summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty')
-rw-r--r--3rdparty/asio/COPYING2
-rw-r--r--3rdparty/asio/Makefile.am3
-rw-r--r--3rdparty/asio/Makefile.in107
-rw-r--r--3rdparty/asio/README4
-rw-r--r--3rdparty/asio/aclocal.m4357
-rw-r--r--3rdparty/asio/asio.pc.in11
-rwxr-xr-x3rdparty/asio/compile17
-rwxr-xr-x3rdparty/asio/config.guess1686
-rwxr-xr-x3rdparty/asio/config.sub2627
-rwxr-xr-x3rdparty/asio/configure3672
-rw-r--r--3rdparty/asio/configure.ac29
-rw-r--r--3rdparty/asio/depcomp10
-rw-r--r--3rdparty/asio/include/Makefile.am163
-rw-r--r--3rdparty/asio/include/Makefile.in178
-rw-r--r--3rdparty/asio/include/asio.hpp49
-rw-r--r--3rdparty/asio/include/asio/any_completion_executor.hpp336
-rw-r--r--3rdparty/asio/include/asio/any_completion_handler.hpp822
-rw-r--r--3rdparty/asio/include/asio/any_io_executor.hpp163
-rw-r--r--3rdparty/asio/include/asio/append.hpp65
-rw-r--r--3rdparty/asio/include/asio/as_tuple.hpp126
-rw-r--r--3rdparty/asio/include/asio/associated_allocator.hpp129
-rw-r--r--3rdparty/asio/include/asio/associated_cancellation_slot.hpp96
-rw-r--r--3rdparty/asio/include/asio/associated_executor.hpp91
-rw-r--r--3rdparty/asio/include/asio/associated_immediate_executor.hpp280
-rw-r--r--3rdparty/asio/include/asio/associator.hpp2
-rw-r--r--3rdparty/asio/include/asio/async_result.hpp1037
-rw-r--r--3rdparty/asio/include/asio/awaitable.hpp11
-rw-r--r--3rdparty/asio/include/asio/basic_datagram_socket.hpp403
-rw-r--r--3rdparty/asio/include/asio/basic_deadline_timer.hpp71
-rw-r--r--3rdparty/asio/include/asio/basic_file.hpp824
-rw-r--r--3rdparty/asio/include/asio/basic_io_object.hpp12
-rw-r--r--3rdparty/asio/include/asio/basic_random_access_file.hpp689
-rw-r--r--3rdparty/asio/include/asio/basic_raw_socket.hpp410
-rw-r--r--3rdparty/asio/include/asio/basic_readable_pipe.hpp626
-rw-r--r--3rdparty/asio/include/asio/basic_seq_packet_socket.hpp185
-rw-r--r--3rdparty/asio/include/asio/basic_serial_port.hpp202
-rw-r--r--3rdparty/asio/include/asio/basic_signal_set.hpp134
-rw-r--r--3rdparty/asio/include/asio/basic_socket.hpp137
-rw-r--r--3rdparty/asio/include/asio/basic_socket_acceptor.hpp620
-rw-r--r--3rdparty/asio/include/asio/basic_socket_iostream.hpp88
-rw-r--r--3rdparty/asio/include/asio/basic_socket_streambuf.hpp57
-rw-r--r--3rdparty/asio/include/asio/basic_stream_file.hpp744
-rw-r--r--3rdparty/asio/include/asio/basic_stream_socket.hpp301
-rw-r--r--3rdparty/asio/include/asio/basic_streambuf.hpp28
-rw-r--r--3rdparty/asio/include/asio/basic_streambuf_fwd.hpp6
-rw-r--r--3rdparty/asio/include/asio/basic_waitable_timer.hpp85
-rw-r--r--3rdparty/asio/include/asio/basic_writable_pipe.hpp622
-rw-r--r--3rdparty/asio/include/asio/bind_allocator.hpp530
-rw-r--r--3rdparty/asio/include/asio/bind_cancellation_slot.hpp379
-rw-r--r--3rdparty/asio/include/asio/bind_executor.hpp400
-rw-r--r--3rdparty/asio/include/asio/bind_immediate_executor.hpp549
-rw-r--r--3rdparty/asio/include/asio/buffer.hpp843
-rw-r--r--3rdparty/asio/include/asio/buffer_registration.hpp318
-rw-r--r--3rdparty/asio/include/asio/buffered_read_stream.hpp78
-rw-r--r--3rdparty/asio/include/asio/buffered_read_stream_fwd.hpp2
-rw-r--r--3rdparty/asio/include/asio/buffered_stream.hpp93
-rw-r--r--3rdparty/asio/include/asio/buffered_stream_fwd.hpp2
-rw-r--r--3rdparty/asio/include/asio/buffered_write_stream.hpp78
-rw-r--r--3rdparty/asio/include/asio/buffered_write_stream_fwd.hpp2
-rw-r--r--3rdparty/asio/include/asio/buffers_iterator.hpp8
-rw-r--r--3rdparty/asio/include/asio/cancellation_signal.hpp182
-rw-r--r--3rdparty/asio/include/asio/cancellation_state.hpp32
-rw-r--r--3rdparty/asio/include/asio/cancellation_type.hpp33
-rw-r--r--3rdparty/asio/include/asio/co_spawn.hpp74
-rw-r--r--3rdparty/asio/include/asio/completion_condition.hpp2
-rw-r--r--3rdparty/asio/include/asio/compose.hpp253
-rw-r--r--3rdparty/asio/include/asio/connect.hpp242
-rw-r--r--3rdparty/asio/include/asio/connect_pipe.hpp83
-rw-r--r--3rdparty/asio/include/asio/consign.hpp75
-rw-r--r--3rdparty/asio/include/asio/coroutine.hpp3
-rw-r--r--3rdparty/asio/include/asio/deadline_timer.hpp2
-rw-r--r--3rdparty/asio/include/asio/defer.hpp198
-rw-r--r--3rdparty/asio/include/asio/deferred.hpp715
-rw-r--r--3rdparty/asio/include/asio/detached.hpp41
-rw-r--r--3rdparty/asio/include/asio/detail/array.hpp12
-rw-r--r--3rdparty/asio/include/asio/detail/array_fwd.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/assert.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/atomic_count.hpp19
-rw-r--r--3rdparty/asio/include/asio/detail/base_from_cancellation_state.hpp41
-rw-r--r--3rdparty/asio/include/asio/detail/base_from_completion_cond.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/bind_handler.hpp664
-rw-r--r--3rdparty/asio/include/asio/detail/blocking_executor_op.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/buffer_resize_guard.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/buffer_sequence_adapter.hpp201
-rw-r--r--3rdparty/asio/include/asio/detail/buffered_stream_storage.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/bulk_executor_op.hpp88
-rw-r--r--3rdparty/asio/include/asio/detail/call_stack.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/chrono.hpp25
-rw-r--r--3rdparty/asio/include/asio/detail/chrono_time_traits.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/completion_handler.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/composed_work.hpp252
-rw-r--r--3rdparty/asio/include/asio/detail/concurrency_hint.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/conditionally_enabled_event.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/conditionally_enabled_mutex.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/config.hpp1266
-rw-r--r--3rdparty/asio/include/asio/detail/consuming_buffers.hpp51
-rw-r--r--3rdparty/asio/include/asio/detail/cstddef.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/cstdint.hpp26
-rw-r--r--3rdparty/asio/include/asio/detail/date_time_fwd.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/deadline_timer_service.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/dependent_type.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/descriptor_ops.hpp44
-rw-r--r--3rdparty/asio/include/asio/detail/descriptor_read_op.hpp46
-rw-r--r--3rdparty/asio/include/asio/detail/descriptor_write_op.hpp45
-rw-r--r--3rdparty/asio/include/asio/detail/dev_poll_reactor.hpp33
-rw-r--r--3rdparty/asio/include/asio/detail/epoll_reactor.hpp27
-rw-r--r--3rdparty/asio/include/asio/detail/event.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/eventfd_select_interrupter.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/exception.hpp29
-rw-r--r--3rdparty/asio/include/asio/detail/executor_function.hpp68
-rw-r--r--3rdparty/asio/include/asio/detail/executor_op.hpp12
-rw-r--r--3rdparty/asio/include/asio/detail/fd_set_adapter.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/fenced_block.hpp46
-rw-r--r--3rdparty/asio/include/asio/detail/functional.hpp13
-rw-r--r--3rdparty/asio/include/asio/detail/future.hpp19
-rw-r--r--3rdparty/asio/include/asio/detail/gcc_arm_fenced_block.hpp91
-rw-r--r--3rdparty/asio/include/asio/detail/gcc_hppa_fenced_block.hpp68
-rw-r--r--3rdparty/asio/include/asio/detail/gcc_sync_fenced_block.hpp65
-rw-r--r--3rdparty/asio/include/asio/detail/gcc_x86_fenced_block.hpp99
-rw-r--r--3rdparty/asio/include/asio/detail/global.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/handler_alloc_helpers.hpp147
-rw-r--r--3rdparty/asio/include/asio/detail/handler_cont_helpers.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/handler_invoke_helpers.hpp80
-rw-r--r--3rdparty/asio/include/asio/detail/handler_tracking.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/handler_type_requirements.hpp24
-rw-r--r--3rdparty/asio/include/asio/detail/handler_work.hpp226
-rw-r--r--3rdparty/asio/include/asio/detail/hash_map.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/descriptor_ops.ipp393
-rw-r--r--3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.hpp16
-rw-r--r--3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.ipp17
-rw-r--r--3rdparty/asio/include/asio/detail/impl/epoll_reactor.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/impl/epoll_reactor.ipp25
-rw-r--r--3rdparty/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/handler_tracking.ipp14
-rw-r--r--3rdparty/asio/include/asio/detail/impl/io_uring_descriptor_service.ipp205
-rw-r--r--3rdparty/asio/include/asio/detail/impl/io_uring_file_service.ipp140
-rw-r--r--3rdparty/asio/include/asio/detail/impl/io_uring_service.hpp112
-rw-r--r--3rdparty/asio/include/asio/detail/impl/io_uring_service.ipp914
-rw-r--r--3rdparty/asio/include/asio/detail/impl/io_uring_socket_service_base.ipp249
-rw-r--r--3rdparty/asio/include/asio/detail/impl/kqueue_reactor.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/impl/kqueue_reactor.ipp21
-rw-r--r--3rdparty/asio/include/asio/detail/impl/null_event.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/pipe_select_interrupter.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/posix_event.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/posix_mutex.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/posix_serial_port_service.ipp (renamed from 3rdparty/asio/include/asio/detail/impl/reactive_serial_port_service.ipp)57
-rw-r--r--3rdparty/asio/include/asio/detail/impl/posix_thread.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/posix_tss_ptr.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/reactive_descriptor_service.ipp27
-rw-r--r--3rdparty/asio/include/asio/detail/impl/reactive_socket_service_base.ipp50
-rw-r--r--3rdparty/asio/include/asio/detail/impl/resolver_service_base.ipp6
-rw-r--r--3rdparty/asio/include/asio/detail/impl/scheduler.ipp24
-rw-r--r--3rdparty/asio/include/asio/detail/impl/select_reactor.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/impl/select_reactor.ipp53
-rw-r--r--3rdparty/asio/include/asio/detail/impl/service_registry.hpp5
-rw-r--r--3rdparty/asio/include/asio/detail/impl/service_registry.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/signal_set_service.ipp170
-rw-r--r--3rdparty/asio/include/asio/detail/impl/socket_ops.ipp323
-rw-r--r--3rdparty/asio/include/asio/detail/impl/socket_select_interrupter.ipp8
-rw-r--r--3rdparty/asio/include/asio/detail/impl/strand_executor_service.hpp112
-rw-r--r--3rdparty/asio/include/asio/detail/impl/strand_executor_service.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/strand_service.hpp5
-rw-r--r--3rdparty/asio/include/asio/detail/impl/strand_service.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/thread_context.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/throw_error.ipp37
-rw-r--r--3rdparty/asio/include/asio/detail/impl/timer_queue_ptime.ipp24
-rw-r--r--3rdparty/asio/include/asio/detail/impl/timer_queue_set.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_event.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_iocp_file_service.ipp280
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_iocp_handle_service.ipp96
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.hpp3
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.ipp12
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp10
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp24
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_mutex.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_object_handle_service.ipp6
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_static_mutex.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_thread.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/win_tss_ptr.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp10
-rw-r--r--3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/impl/winsock_init.ipp2
-rw-r--r--3rdparty/asio/include/asio/detail/initiate_defer.hpp207
-rw-r--r--3rdparty/asio/include/asio/detail/initiate_dispatch.hpp193
-rw-r--r--3rdparty/asio/include/asio/detail/initiate_post.hpp207
-rw-r--r--3rdparty/asio/include/asio/detail/io_control.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/io_object_impl.hpp27
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_descriptor_read_at_op.hpp195
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_descriptor_read_op.hpp190
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_descriptor_service.hpp687
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_descriptor_write_at_op.hpp189
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_descriptor_write_op.hpp185
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_file_service.hpp261
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_null_buffers_op.hpp114
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_operation.hpp84
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_service.hpp319
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_socket_accept_op.hpp280
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_socket_connect_op.hpp140
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_socket_recv_op.hpp205
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_socket_recvfrom_op.hpp206
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_socket_recvmsg_op.hpp192
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_socket_send_op.hpp191
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_socket_sendto_op.hpp194
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_socket_service.hpp629
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_socket_service_base.hpp663
-rw-r--r--3rdparty/asio/include/asio/detail/io_uring_wait_op.hpp112
-rw-r--r--3rdparty/asio/include/asio/detail/is_buffer_sequence.hpp82
-rw-r--r--3rdparty/asio/include/asio/detail/is_executor.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/keyword_tss_ptr.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/kqueue_reactor.hpp27
-rw-r--r--3rdparty/asio/include/asio/detail/limits.hpp7
-rw-r--r--3rdparty/asio/include/asio/detail/local_free_on_block_exit.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/macos_fenced_block.hpp62
-rw-r--r--3rdparty/asio/include/asio/detail/memory.hpp79
-rw-r--r--3rdparty/asio/include/asio/detail/mutex.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/non_const_lvalue.hpp19
-rw-r--r--3rdparty/asio/include/asio/detail/noncopyable.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/null_event.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/null_fenced_block.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/null_global.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/null_mutex.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/null_reactor.hpp23
-rw-r--r--3rdparty/asio/include/asio/detail/null_signal_blocker.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/null_socket_service.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/null_static_mutex.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/null_thread.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/null_tss_ptr.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/object_pool.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/old_win_sdk_compat.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/op_queue.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/operation.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/pipe_select_interrupter.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/pop_options.hpp10
-rw-r--r--3rdparty/asio/include/asio/detail/posix_event.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/posix_fd_set_adapter.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/posix_global.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/posix_mutex.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/posix_serial_port_service.hpp (renamed from 3rdparty/asio/include/asio/detail/reactive_serial_port_service.hpp)48
-rw-r--r--3rdparty/asio/include/asio/detail/posix_signal_blocker.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/posix_static_mutex.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/posix_thread.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/posix_tss_ptr.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/push_options.hpp14
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_descriptor_service.hpp121
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_null_buffers_op.hpp41
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_socket_accept_op.hpp105
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_socket_connect_op.hpp47
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_socket_recv_op.hpp46
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp47
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp47
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_socket_send_op.hpp47
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_socket_sendto_op.hpp46
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_socket_service.hpp92
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_socket_service_base.hpp178
-rw-r--r--3rdparty/asio/include/asio/detail/reactive_wait_op.hpp41
-rw-r--r--3rdparty/asio/include/asio/detail/reactor.hpp32
-rw-r--r--3rdparty/asio/include/asio/detail/reactor_fwd.hpp40
-rw-r--r--3rdparty/asio/include/asio/detail/reactor_op.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/reactor_op_queue.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/recycling_allocator.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/regex_fwd.hpp17
-rw-r--r--3rdparty/asio/include/asio/detail/resolve_endpoint_op.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/resolve_op.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/resolve_query_op.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/resolver_service.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/resolver_service_base.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/scheduler.hpp20
-rw-r--r--3rdparty/asio/include/asio/detail/scheduler_operation.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/scheduler_task.hpp49
-rw-r--r--3rdparty/asio/include/asio/detail/scheduler_thread_info.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/scoped_lock.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/scoped_ptr.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/select_interrupter.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/select_reactor.hpp49
-rw-r--r--3rdparty/asio/include/asio/detail/service_registry.hpp5
-rw-r--r--3rdparty/asio/include/asio/detail/signal_blocker.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/signal_handler.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/signal_init.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/signal_op.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/signal_set_service.hpp71
-rw-r--r--3rdparty/asio/include/asio/detail/socket_holder.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/socket_ops.hpp82
-rw-r--r--3rdparty/asio/include/asio/detail/socket_option.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/socket_select_interrupter.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/socket_types.hpp12
-rw-r--r--3rdparty/asio/include/asio/detail/solaris_fenced_block.hpp62
-rw-r--r--3rdparty/asio/include/asio/detail/source_location.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/static_mutex.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/std_event.hpp7
-rw-r--r--3rdparty/asio/include/asio/detail/std_fenced_block.hpp7
-rw-r--r--3rdparty/asio/include/asio/detail/std_global.hpp7
-rw-r--r--3rdparty/asio/include/asio/detail/std_mutex.hpp7
-rw-r--r--3rdparty/asio/include/asio/detail/std_static_mutex.hpp7
-rw-r--r--3rdparty/asio/include/asio/detail/std_thread.hpp7
-rw-r--r--3rdparty/asio/include/asio/detail/strand_executor_service.hpp26
-rw-r--r--3rdparty/asio/include/asio/detail/strand_service.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/string_view.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/thread.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/thread_context.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/thread_group.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/thread_info_base.hpp38
-rw-r--r--3rdparty/asio/include/asio/detail/throw_error.hpp27
-rw-r--r--3rdparty/asio/include/asio/detail/throw_exception.hpp10
-rw-r--r--3rdparty/asio/include/asio/detail/timer_queue.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/timer_queue_base.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/timer_queue_ptime.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/timer_queue_set.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/timer_scheduler.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/timer_scheduler_fwd.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/tss_ptr.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/type_traits.hpp190
-rw-r--r--3rdparty/asio/include/asio/detail/utility.hpp83
-rw-r--r--3rdparty/asio/include/asio/detail/variadic_templates.hpp294
-rw-r--r--3rdparty/asio/include/asio/detail/wait_handler.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/wait_op.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/win_event.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/win_fd_set_adapter.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/win_fenced_block.hpp90
-rw-r--r--3rdparty/asio/include/asio/detail/win_global.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_file_service.hpp287
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_handle_read_op.hpp10
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_handle_service.hpp38
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_handle_write_op.hpp14
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_io_context.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_null_buffers_op.hpp10
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_operation.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_overlapped_op.hpp14
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp14
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_serial_port_service.hpp3
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_socket_accept_op.hpp25
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_socket_connect_op.hpp11
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_socket_recv_op.hpp10
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp10
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp12
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_socket_send_op.hpp10
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_socket_service.hpp61
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_socket_service_base.hpp29
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_thread_info.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/win_iocp_wait_op.hpp10
-rw-r--r--3rdparty/asio/include/asio/detail/win_mutex.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/win_object_handle_service.hpp3
-rw-r--r--3rdparty/asio/include/asio/detail/win_static_mutex.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/win_thread.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/win_tss_ptr.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/winapp_thread.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/wince_thread.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_async_manager.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_async_op.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_resolve_op.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_resolver_service.hpp6
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_socket_connect_op.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_socket_recv_op.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_socket_send_op.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_ssocket_service.hpp8
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_ssocket_service_base.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_timer_scheduler.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/winrt_utils.hpp2
-rw-r--r--3rdparty/asio/include/asio/detail/winsock_init.hpp4
-rw-r--r--3rdparty/asio/include/asio/detail/work_dispatcher.hpp50
-rw-r--r--3rdparty/asio/include/asio/detail/wrapped_handler.hpp124
-rw-r--r--3rdparty/asio/include/asio/dispatch.hpp180
-rw-r--r--3rdparty/asio/include/asio/error.hpp39
-rw-r--r--3rdparty/asio/include/asio/error_code.hpp169
-rw-r--r--3rdparty/asio/include/asio/execution.hpp17
-rw-r--r--3rdparty/asio/include/asio/execution/allocator.hpp127
-rw-r--r--3rdparty/asio/include/asio/execution/any_executor.hpp1531
-rw-r--r--3rdparty/asio/include/asio/execution/bad_executor.hpp7
-rw-r--r--3rdparty/asio/include/asio/execution/blocking.hpp787
-rw-r--r--3rdparty/asio/include/asio/execution/blocking_adaptation.hpp600
-rw-r--r--3rdparty/asio/include/asio/execution/bulk_execute.hpp397
-rw-r--r--3rdparty/asio/include/asio/execution/bulk_guarantee.hpp1215
-rw-r--r--3rdparty/asio/include/asio/execution/connect.hpp489
-rw-r--r--3rdparty/asio/include/asio/execution/context.hpp82
-rw-r--r--3rdparty/asio/include/asio/execution/context_as.hpp91
-rw-r--r--3rdparty/asio/include/asio/execution/detail/as_invocable.hpp152
-rw-r--r--3rdparty/asio/include/asio/execution/detail/as_operation.hpp105
-rw-r--r--3rdparty/asio/include/asio/execution/detail/as_receiver.hpp128
-rw-r--r--3rdparty/asio/include/asio/execution/detail/bulk_sender.hpp261
-rw-r--r--3rdparty/asio/include/asio/execution/detail/submit_receiver.hpp233
-rw-r--r--3rdparty/asio/include/asio/execution/detail/void_receiver.hpp90
-rw-r--r--3rdparty/asio/include/asio/execution/execute.hpp283
-rw-r--r--3rdparty/asio/include/asio/execution/executor.hpp186
-rw-r--r--3rdparty/asio/include/asio/execution/impl/bad_executor.ipp6
-rw-r--r--3rdparty/asio/include/asio/execution/impl/receiver_invocation_error.ipp36
-rw-r--r--3rdparty/asio/include/asio/execution/invocable_archetype.hpp32
-rw-r--r--3rdparty/asio/include/asio/execution/mapping.hpp594
-rw-r--r--3rdparty/asio/include/asio/execution/occupancy.hpp82
-rw-r--r--3rdparty/asio/include/asio/execution/operation_state.hpp94
-rw-r--r--3rdparty/asio/include/asio/execution/outstanding_work.hpp412
-rw-r--r--3rdparty/asio/include/asio/execution/prefer_only.hpp115
-rw-r--r--3rdparty/asio/include/asio/execution/receiver.hpp280
-rw-r--r--3rdparty/asio/include/asio/execution/receiver_invocation_error.hpp48
-rw-r--r--3rdparty/asio/include/asio/execution/relationship.hpp412
-rw-r--r--3rdparty/asio/include/asio/execution/schedule.hpp287
-rw-r--r--3rdparty/asio/include/asio/execution/scheduler.hpp86
-rw-r--r--3rdparty/asio/include/asio/execution/sender.hpp311
-rw-r--r--3rdparty/asio/include/asio/execution/set_done.hpp250
-rw-r--r--3rdparty/asio/include/asio/execution/set_error.hpp250
-rw-r--r--3rdparty/asio/include/asio/execution/set_value.hpp483
-rw-r--r--3rdparty/asio/include/asio/execution/start.hpp247
-rw-r--r--3rdparty/asio/include/asio/execution/submit.hpp450
-rw-r--r--3rdparty/asio/include/asio/execution_context.hpp26
-rw-r--r--3rdparty/asio/include/asio/executor.hpp102
-rw-r--r--3rdparty/asio/include/asio/executor_work_guard.hpp234
-rw-r--r--3rdparty/asio/include/asio/experimental/append.hpp47
-rw-r--r--3rdparty/asio/include/asio/experimental/as_single.hpp51
-rw-r--r--3rdparty/asio/include/asio/experimental/as_tuple.hpp107
-rw-r--r--3rdparty/asio/include/asio/experimental/awaitable_operators.hpp40
-rw-r--r--3rdparty/asio/include/asio/experimental/basic_channel.hpp513
-rw-r--r--3rdparty/asio/include/asio/experimental/basic_concurrent_channel.hpp513
-rw-r--r--3rdparty/asio/include/asio/experimental/cancellation_condition.hpp53
-rw-r--r--3rdparty/asio/include/asio/experimental/channel.hpp70
-rw-r--r--3rdparty/asio/include/asio/experimental/channel_error.hpp82
-rw-r--r--3rdparty/asio/include/asio/experimental/channel_traits.hpp301
-rw-r--r--3rdparty/asio/include/asio/experimental/co_composed.hpp145
-rw-r--r--3rdparty/asio/include/asio/experimental/co_spawn.hpp187
-rw-r--r--3rdparty/asio/include/asio/experimental/concurrent_channel.hpp70
-rw-r--r--3rdparty/asio/include/asio/experimental/coro.hpp1014
-rw-r--r--3rdparty/asio/include/asio/experimental/coro_traits.hpp (renamed from 3rdparty/asio/include/asio/experimental/detail/coro_traits.hpp)85
-rw-r--r--3rdparty/asio/include/asio/experimental/deferred.hpp581
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/channel_handler.hpp77
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/channel_message.hpp129
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/channel_operation.hpp361
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/channel_payload.hpp222
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/channel_receive_op.hpp127
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/channel_send_functions.hpp192
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/channel_send_op.hpp148
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/channel_service.hpp677
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/completion_handler_erasure.hpp158
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/coro_completion_handler.hpp169
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/coro_promise_allocator.hpp161
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/has_signature.hpp54
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/impl/channel_service.hpp621
-rw-r--r--3rdparty/asio/include/asio/experimental/detail/partial_promise.hpp118
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/append.hpp217
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/as_single.hpp125
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/as_tuple.hpp246
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/channel_error.ipp61
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/co_composed.hpp1174
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/coro.hpp1222
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/deferred.hpp104
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/parallel_group.hpp442
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/prepend.hpp217
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/promise.hpp219
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/use_coro.hpp214
-rw-r--r--3rdparty/asio/include/asio/experimental/impl/use_promise.hpp66
-rw-r--r--3rdparty/asio/include/asio/experimental/parallel_group.hpp316
-rw-r--r--3rdparty/asio/include/asio/experimental/prepend.hpp47
-rw-r--r--3rdparty/asio/include/asio/experimental/promise.hpp554
-rw-r--r--3rdparty/asio/include/asio/experimental/use_coro.hpp363
-rw-r--r--3rdparty/asio/include/asio/experimental/use_promise.hpp111
-rw-r--r--3rdparty/asio/include/asio/file_base.hpp166
-rw-r--r--3rdparty/asio/include/asio/generic/basic_endpoint.hpp8
-rw-r--r--3rdparty/asio/include/asio/generic/datagram_protocol.hpp8
-rw-r--r--3rdparty/asio/include/asio/generic/detail/endpoint.hpp2
-rw-r--r--3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp2
-rw-r--r--3rdparty/asio/include/asio/generic/raw_protocol.hpp8
-rw-r--r--3rdparty/asio/include/asio/generic/seq_packet_protocol.hpp8
-rw-r--r--3rdparty/asio/include/asio/generic/stream_protocol.hpp8
-rw-r--r--3rdparty/asio/include/asio/handler_alloc_hook.hpp104
-rw-r--r--3rdparty/asio/include/asio/handler_continuation_hook.hpp2
-rw-r--r--3rdparty/asio/include/asio/handler_invoke_hook.hpp111
-rw-r--r--3rdparty/asio/include/asio/high_resolution_timer.hpp7
-rw-r--r--3rdparty/asio/include/asio/impl/any_completion_executor.ipp126
-rw-r--r--3rdparty/asio/include/asio/impl/any_io_executor.ipp134
-rw-r--r--3rdparty/asio/include/asio/impl/append.hpp162
-rw-r--r--3rdparty/asio/include/asio/impl/as_tuple.hpp245
-rw-r--r--3rdparty/asio/include/asio/impl/awaitable.hpp478
-rw-r--r--3rdparty/asio/include/asio/impl/buffered_read_stream.hpp222
-rw-r--r--3rdparty/asio/include/asio/impl/buffered_write_stream.hpp222
-rw-r--r--3rdparty/asio/include/asio/impl/cancellation_signal.ipp96
-rw-r--r--3rdparty/asio/include/asio/impl/co_spawn.hpp303
-rw-r--r--3rdparty/asio/include/asio/impl/compose.hpp687
-rw-r--r--3rdparty/asio/include/asio/impl/connect.hpp345
-rw-r--r--3rdparty/asio/include/asio/impl/connect_pipe.hpp73
-rw-r--r--3rdparty/asio/include/asio/impl/connect_pipe.ipp149
-rw-r--r--3rdparty/asio/include/asio/impl/consign.hpp137
-rw-r--r--3rdparty/asio/include/asio/impl/defer.hpp256
-rw-r--r--3rdparty/asio/include/asio/impl/deferred.hpp147
-rw-r--r--3rdparty/asio/include/asio/impl/detached.hpp63
-rw-r--r--3rdparty/asio/include/asio/impl/dispatch.hpp251
-rw-r--r--3rdparty/asio/include/asio/impl/error.ipp8
-rw-r--r--3rdparty/asio/include/asio/impl/error_code.ipp6
-rw-r--r--3rdparty/asio/include/asio/impl/execution_context.hpp38
-rw-r--r--3rdparty/asio/include/asio/impl/execution_context.ipp2
-rw-r--r--3rdparty/asio/include/asio/impl/executor.hpp103
-rw-r--r--3rdparty/asio/include/asio/impl/executor.ipp6
-rw-r--r--3rdparty/asio/include/asio/impl/handler_alloc_hook.ipp62
-rw-r--r--3rdparty/asio/include/asio/impl/io_context.hpp179
-rw-r--r--3rdparty/asio/include/asio/impl/io_context.ipp3
-rw-r--r--3rdparty/asio/include/asio/impl/multiple_exceptions.ipp12
-rw-r--r--3rdparty/asio/include/asio/impl/post.hpp256
-rw-r--r--3rdparty/asio/include/asio/impl/prepend.hpp163
-rw-r--r--3rdparty/asio/include/asio/impl/read.hpp648
-rw-r--r--3rdparty/asio/include/asio/impl/read_at.hpp295
-rw-r--r--3rdparty/asio/include/asio/impl/read_until.hpp1406
-rw-r--r--3rdparty/asio/include/asio/impl/redirect_error.hpp451
-rw-r--r--3rdparty/asio/include/asio/impl/serial_port_base.hpp2
-rw-r--r--3rdparty/asio/include/asio/impl/serial_port_base.ipp2
-rw-r--r--3rdparty/asio/include/asio/impl/spawn.hpp1513
-rw-r--r--3rdparty/asio/include/asio/impl/src.hpp16
-rw-r--r--3rdparty/asio/include/asio/impl/system_context.hpp4
-rw-r--r--3rdparty/asio/include/asio/impl/system_context.ipp4
-rw-r--r--3rdparty/asio/include/asio/impl/system_executor.hpp44
-rw-r--r--3rdparty/asio/include/asio/impl/thread_pool.hpp141
-rw-r--r--3rdparty/asio/include/asio/impl/thread_pool.ipp9
-rw-r--r--3rdparty/asio/include/asio/impl/use_awaitable.hpp28
-rw-r--r--3rdparty/asio/include/asio/impl/use_future.hpp515
-rw-r--r--3rdparty/asio/include/asio/impl/write.hpp699
-rw-r--r--3rdparty/asio/include/asio/impl/write_at.hpp283
-rw-r--r--3rdparty/asio/include/asio/io_context.hpp415
-rw-r--r--3rdparty/asio/include/asio/io_context_strand.hpp62
-rw-r--r--3rdparty/asio/include/asio/io_service.hpp2
-rw-r--r--3rdparty/asio/include/asio/io_service_strand.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/address.hpp61
-rw-r--r--3rdparty/asio/include/asio/ip/address_v4.hpp138
-rw-r--r--3rdparty/asio/include/asio/ip/address_v4_iterator.hpp32
-rw-r--r--3rdparty/asio/include/asio/ip/address_v4_range.hpp38
-rw-r--r--3rdparty/asio/include/asio/ip/address_v6.hpp109
-rw-r--r--3rdparty/asio/include/asio/ip/address_v6_iterator.hpp31
-rw-r--r--3rdparty/asio/include/asio/ip/address_v6_range.hpp35
-rw-r--r--3rdparty/asio/include/asio/ip/bad_address_cast.hpp16
-rw-r--r--3rdparty/asio/include/asio/ip/basic_endpoint.hpp61
-rw-r--r--3rdparty/asio/include/asio/ip/basic_resolver.hpp250
-rw-r--r--3rdparty/asio/include/asio/ip/basic_resolver_entry.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/basic_resolver_iterator.hpp12
-rw-r--r--3rdparty/asio/include/asio/ip/basic_resolver_query.hpp18
-rw-r--r--3rdparty/asio/include/asio/ip/basic_resolver_results.hpp22
-rw-r--r--3rdparty/asio/include/asio/ip/detail/endpoint.hpp34
-rw-r--r--3rdparty/asio/include/asio/ip/detail/impl/endpoint.ipp24
-rw-r--r--3rdparty/asio/include/asio/ip/detail/socket_option.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/host_name.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/icmp.hpp14
-rw-r--r--3rdparty/asio/include/asio/ip/impl/address.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/impl/address.ipp40
-rw-r--r--3rdparty/asio/include/asio/ip/impl/address_v4.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/impl/address_v4.ipp22
-rw-r--r--3rdparty/asio/include/asio/ip/impl/address_v6.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/impl/address_v6.ipp56
-rw-r--r--3rdparty/asio/include/asio/ip/impl/basic_endpoint.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/impl/host_name.ipp2
-rw-r--r--3rdparty/asio/include/asio/ip/impl/network_v4.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/impl/network_v4.ipp10
-rw-r--r--3rdparty/asio/include/asio/ip/impl/network_v6.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/impl/network_v6.ipp10
-rw-r--r--3rdparty/asio/include/asio/ip/multicast.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/network_v4.hpp38
-rw-r--r--3rdparty/asio/include/asio/ip/network_v6.hpp32
-rw-r--r--3rdparty/asio/include/asio/ip/resolver_base.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/resolver_query_base.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/tcp.hpp14
-rw-r--r--3rdparty/asio/include/asio/ip/udp.hpp14
-rw-r--r--3rdparty/asio/include/asio/ip/unicast.hpp2
-rw-r--r--3rdparty/asio/include/asio/ip/v6_only.hpp4
-rw-r--r--3rdparty/asio/include/asio/is_applicable_property.hpp12
-rw-r--r--3rdparty/asio/include/asio/is_contiguous_iterator.hpp45
-rw-r--r--3rdparty/asio/include/asio/is_executor.hpp2
-rw-r--r--3rdparty/asio/include/asio/is_read_buffered.hpp2
-rw-r--r--3rdparty/asio/include/asio/is_write_buffered.hpp2
-rw-r--r--3rdparty/asio/include/asio/local/basic_endpoint.hpp8
-rw-r--r--3rdparty/asio/include/asio/local/connect_pair.hpp2
-rw-r--r--3rdparty/asio/include/asio/local/datagram_protocol.hpp8
-rw-r--r--3rdparty/asio/include/asio/local/detail/endpoint.hpp2
-rw-r--r--3rdparty/asio/include/asio/local/detail/impl/endpoint.ipp2
-rw-r--r--3rdparty/asio/include/asio/local/seq_packet_protocol.hpp84
-rw-r--r--3rdparty/asio/include/asio/local/stream_protocol.hpp8
-rw-r--r--3rdparty/asio/include/asio/multiple_exceptions.hpp12
-rw-r--r--3rdparty/asio/include/asio/packaged_task.hpp62
-rw-r--r--3rdparty/asio/include/asio/placeholders.hpp134
-rw-r--r--3rdparty/asio/include/asio/posix/basic_descriptor.hpp135
-rw-r--r--3rdparty/asio/include/asio/posix/basic_stream_descriptor.hpp150
-rw-r--r--3rdparty/asio/include/asio/posix/descriptor.hpp2
-rw-r--r--3rdparty/asio/include/asio/posix/descriptor_base.hpp2
-rw-r--r--3rdparty/asio/include/asio/posix/stream_descriptor.hpp2
-rw-r--r--3rdparty/asio/include/asio/post.hpp197
-rw-r--r--3rdparty/asio/include/asio/prefer.hpp509
-rw-r--r--3rdparty/asio/include/asio/prepend.hpp66
-rw-r--r--3rdparty/asio/include/asio/query.hpp127
-rw-r--r--3rdparty/asio/include/asio/random_access_file.hpp35
-rw-r--r--3rdparty/asio/include/asio/read.hpp578
-rw-r--r--3rdparty/asio/include/asio/read_at.hpp192
-rw-r--r--3rdparty/asio/include/asio/read_until.hpp843
-rw-r--r--3rdparty/asio/include/asio/readable_pipe.hpp35
-rw-r--r--3rdparty/asio/include/asio/recycling_allocator.hpp138
-rw-r--r--3rdparty/asio/include/asio/redirect_error.hpp20
-rw-r--r--3rdparty/asio/include/asio/registered_buffer.hpp344
-rw-r--r--3rdparty/asio/include/asio/require.hpp354
-rw-r--r--3rdparty/asio/include/asio/require_concept.hpp149
-rw-r--r--3rdparty/asio/include/asio/serial_port.hpp2
-rw-r--r--3rdparty/asio/include/asio/serial_port_base.hpp2
-rw-r--r--3rdparty/asio/include/asio/signal_set.hpp2
-rw-r--r--3rdparty/asio/include/asio/signal_set_base.hpp171
-rw-r--r--3rdparty/asio/include/asio/socket_base.hpp2
-rw-r--r--3rdparty/asio/include/asio/spawn.hpp742
-rw-r--r--3rdparty/asio/include/asio/ssl.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/context.hpp7
-rw-r--r--3rdparty/asio/include/asio/ssl/context_base.hpp48
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/buffered_handshake_op.hpp6
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/engine.hpp13
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/handshake_op.hpp6
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/impl/engine.ipp28
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/impl/openssl_init.ipp12
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/io.hpp87
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/openssl_init.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/openssl_types.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/password_callback.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/read_op.hpp6
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/shutdown_op.hpp8
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/stream_core.hpp49
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/verify_callback.hpp4
-rw-r--r--3rdparty/asio/include/asio/ssl/detail/write_op.hpp6
-rw-r--r--3rdparty/asio/include/asio/ssl/error.hpp4
-rw-r--r--3rdparty/asio/include/asio/ssl/host_name_verification.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/impl/context.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/impl/context.ipp208
-rw-r--r--3rdparty/asio/include/asio/ssl/impl/error.ipp32
-rw-r--r--3rdparty/asio/include/asio/ssl/impl/host_name_verification.ipp2
-rw-r--r--3rdparty/asio/include/asio/ssl/impl/rfc2818_verification.ipp2
-rw-r--r--3rdparty/asio/include/asio/ssl/impl/src.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/rfc2818_verification.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/stream.hpp280
-rw-r--r--3rdparty/asio/include/asio/ssl/stream_base.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/verify_context.hpp2
-rw-r--r--3rdparty/asio/include/asio/ssl/verify_mode.hpp2
-rw-r--r--3rdparty/asio/include/asio/static_thread_pool.hpp2
-rw-r--r--3rdparty/asio/include/asio/steady_timer.hpp7
-rw-r--r--3rdparty/asio/include/asio/strand.hpp220
-rw-r--r--3rdparty/asio/include/asio/stream_file.hpp35
-rw-r--r--3rdparty/asio/include/asio/streambuf.hpp2
-rw-r--r--3rdparty/asio/include/asio/system_context.hpp6
-rw-r--r--3rdparty/asio/include/asio/system_error.hpp104
-rw-r--r--3rdparty/asio/include/asio/system_executor.hpp137
-rw-r--r--3rdparty/asio/include/asio/system_timer.hpp7
-rw-r--r--3rdparty/asio/include/asio/this_coro.hpp91
-rw-r--r--3rdparty/asio/include/asio/thread.hpp2
-rw-r--r--3rdparty/asio/include/asio/thread_pool.hpp368
-rw-r--r--3rdparty/asio/include/asio/time_traits.hpp2
-rw-r--r--3rdparty/asio/include/asio/traits/bulk_execute_free.hpp114
-rw-r--r--3rdparty/asio/include/asio/traits/bulk_execute_member.hpp114
-rw-r--r--3rdparty/asio/include/asio/traits/connect_free.hpp112
-rw-r--r--3rdparty/asio/include/asio/traits/connect_member.hpp112
-rw-r--r--3rdparty/asio/include/asio/traits/equality_comparable.hpp32
-rw-r--r--3rdparty/asio/include/asio/traits/execute_free.hpp108
-rw-r--r--3rdparty/asio/include/asio/traits/execute_member.hpp36
-rw-r--r--3rdparty/asio/include/asio/traits/prefer_free.hpp36
-rw-r--r--3rdparty/asio/include/asio/traits/prefer_member.hpp36
-rw-r--r--3rdparty/asio/include/asio/traits/query_free.hpp36
-rw-r--r--3rdparty/asio/include/asio/traits/query_member.hpp36
-rw-r--r--3rdparty/asio/include/asio/traits/query_static_constexpr_member.hpp37
-rw-r--r--3rdparty/asio/include/asio/traits/require_concept_free.hpp36
-rw-r--r--3rdparty/asio/include/asio/traits/require_concept_member.hpp36
-rw-r--r--3rdparty/asio/include/asio/traits/require_free.hpp36
-rw-r--r--3rdparty/asio/include/asio/traits/require_member.hpp36
-rw-r--r--3rdparty/asio/include/asio/traits/schedule_free.hpp108
-rw-r--r--3rdparty/asio/include/asio/traits/schedule_member.hpp108
-rw-r--r--3rdparty/asio/include/asio/traits/set_done_free.hpp108
-rw-r--r--3rdparty/asio/include/asio/traits/set_done_member.hpp108
-rw-r--r--3rdparty/asio/include/asio/traits/set_error_free.hpp112
-rw-r--r--3rdparty/asio/include/asio/traits/set_error_member.hpp112
-rw-r--r--3rdparty/asio/include/asio/traits/set_value_free.hpp234
-rw-r--r--3rdparty/asio/include/asio/traits/set_value_member.hpp234
-rw-r--r--3rdparty/asio/include/asio/traits/start_free.hpp108
-rw-r--r--3rdparty/asio/include/asio/traits/start_member.hpp108
-rw-r--r--3rdparty/asio/include/asio/traits/static_query.hpp46
-rw-r--r--3rdparty/asio/include/asio/traits/static_require.hpp52
-rw-r--r--3rdparty/asio/include/asio/traits/static_require_concept.hpp52
-rw-r--r--3rdparty/asio/include/asio/traits/submit_free.hpp112
-rw-r--r--3rdparty/asio/include/asio/traits/submit_member.hpp112
-rw-r--r--3rdparty/asio/include/asio/ts/buffer.hpp2
-rw-r--r--3rdparty/asio/include/asio/ts/executor.hpp2
-rw-r--r--3rdparty/asio/include/asio/ts/internet.hpp2
-rw-r--r--3rdparty/asio/include/asio/ts/io_context.hpp2
-rw-r--r--3rdparty/asio/include/asio/ts/net.hpp2
-rw-r--r--3rdparty/asio/include/asio/ts/netfwd.hpp30
-rw-r--r--3rdparty/asio/include/asio/ts/socket.hpp2
-rw-r--r--3rdparty/asio/include/asio/ts/timer.hpp2
-rw-r--r--3rdparty/asio/include/asio/unyield.hpp2
-rw-r--r--3rdparty/asio/include/asio/use_awaitable.hpp41
-rw-r--r--3rdparty/asio/include/asio/use_future.hpp35
-rw-r--r--3rdparty/asio/include/asio/uses_executor.hpp8
-rw-r--r--3rdparty/asio/include/asio/version.hpp4
-rw-r--r--3rdparty/asio/include/asio/wait_traits.hpp2
-rw-r--r--3rdparty/asio/include/asio/windows/basic_object_handle.hpp110
-rw-r--r--3rdparty/asio/include/asio/windows/basic_overlapped_handle.hpp122
-rw-r--r--3rdparty/asio/include/asio/windows/basic_random_access_handle.hpp155
-rw-r--r--3rdparty/asio/include/asio/windows/basic_stream_handle.hpp149
-rw-r--r--3rdparty/asio/include/asio/windows/object_handle.hpp2
-rw-r--r--3rdparty/asio/include/asio/windows/overlapped_handle.hpp2
-rw-r--r--3rdparty/asio/include/asio/windows/overlapped_ptr.hpp34
-rw-r--r--3rdparty/asio/include/asio/windows/random_access_handle.hpp2
-rw-r--r--3rdparty/asio/include/asio/windows/stream_handle.hpp2
-rw-r--r--3rdparty/asio/include/asio/writable_pipe.hpp35
-rw-r--r--3rdparty/asio/include/asio/write.hpp554
-rw-r--r--3rdparty/asio/include/asio/write_at.hpp191
-rw-r--r--3rdparty/asio/include/asio/yield.hpp2
-rwxr-xr-x3rdparty/asio/install-sh422
-rwxr-xr-x3rdparty/asio/missing16
-rw-r--r--3rdparty/asio/src/Makefile.am22
-rw-r--r--3rdparty/asio/src/Makefile.in33
-rw-r--r--3rdparty/asio/src/Makefile.mgw176
-rw-r--r--3rdparty/asio/src/Makefile.msc289
-rw-r--r--3rdparty/asio/src/asio.cpp2
-rw-r--r--3rdparty/asio/src/asio_ssl.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp03/Makefile.am251
-rw-r--r--3rdparty/asio/src/examples/cpp03/Makefile.in2339
-rw-r--r--3rdparty/asio/src/examples/cpp03/allocation/server.cpp285
-rw-r--r--3rdparty/asio/src/examples/cpp03/buffers/reference_counted.cpp131
-rw-r--r--3rdparty/asio/src/examples/cpp03/chat/chat_client.cpp177
-rw-r--r--3rdparty/asio/src/examples/cpp03/chat/chat_message.hpp93
-rw-r--r--3rdparty/asio/src/examples/cpp03/chat/chat_server.cpp249
-rw-r--r--3rdparty/asio/src/examples/cpp03/chat/posix_chat_client.cpp204
-rw-r--r--3rdparty/asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp137
-rw-r--r--3rdparty/asio/src/examples/cpp03/echo/async_udp_echo_server.cpp92
-rw-r--r--3rdparty/asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp59
-rw-r--r--3rdparty/asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp79
-rw-r--r--3rdparty/asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp59
-rw-r--r--3rdparty/asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp53
-rw-r--r--3rdparty/asio/src/examples/cpp03/fork/daemon.cpp190
-rw-r--r--3rdparty/asio/src/examples/cpp03/fork/process_per_connection.cpp161
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/connection.cpp99
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/connection.hpp83
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/connection_manager.cpp38
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/connection_manager.hpp44
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/header.hpp28
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/main.cpp44
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/mime_types.cpp46
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/mime_types.hpp27
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/reply.cpp256
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/reply.hpp64
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/request_handler.cpp122
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/request_handler.hpp46
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/server.cpp94
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server/server.hpp69
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server2/connection.cpp93
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server3/connection.cpp94
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server4/request.hpp46
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server4/request_parser.cpp226
-rw-r--r--3rdparty/asio/src/examples/cpp03/http/server4/request_parser.hpp78
-rw-r--r--3rdparty/asio/src/examples/cpp03/invocation/prioritised_handlers.cpp171
-rw-r--r--3rdparty/asio/src/examples/cpp03/iostreams/http_client.cpp91
-rw-r--r--3rdparty/asio/src/examples/cpp03/local/connect_pair.cpp141
-rw-r--r--3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp62
-rw-r--r--3rdparty/asio/src/examples/cpp03/local/stream_client.cpp61
-rw-r--r--3rdparty/asio/src/examples/cpp03/local/stream_server.cpp141
-rw-r--r--3rdparty/asio/src/examples/cpp03/multicast/receiver.cpp93
-rw-r--r--3rdparty/asio/src/examples/cpp03/multicast/sender.cpp98
-rw-r--r--3rdparty/asio/src/examples/cpp03/nonblocking/third_party_lib.cpp240
-rw-r--r--3rdparty/asio/src/examples/cpp03/socks4/socks4.hpp144
-rw-r--r--3rdparty/asio/src/examples/cpp03/socks4/sync_client.cpp94
-rw-r--r--3rdparty/asio/src/examples/cpp03/spawn/echo_server.cpp122
-rw-r--r--3rdparty/asio/src/examples/cpp03/spawn/parallel_grep.cpp89
-rw-r--r--3rdparty/asio/src/examples/cpp03/ssl/ca.pem49
-rw-r--r--3rdparty/asio/src/examples/cpp03/ssl/client.cpp157
-rw-r--r--3rdparty/asio/src/examples/cpp03/ssl/dh2048.pem8
-rw-r--r--3rdparty/asio/src/examples/cpp03/ssl/server.cpp170
-rw-r--r--3rdparty/asio/src/examples/cpp03/ssl/server.pem71
-rw-r--r--3rdparty/asio/src/examples/cpp03/timeouts/async_tcp_client.cpp311
-rw-r--r--3rdparty/asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp191
-rw-r--r--3rdparty/asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp201
-rw-r--r--3rdparty/asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp154
-rw-r--r--3rdparty/asio/src/examples/cpp03/timeouts/server.cpp433
-rw-r--r--3rdparty/asio/src/examples/cpp03/timers/time_t_timer.cpp106
-rw-r--r--3rdparty/asio/src/examples/cpp11/Makefile.am171
-rw-r--r--3rdparty/asio/src/examples/cpp11/Makefile.in1256
-rw-r--r--3rdparty/asio/src/examples/cpp11/allocation/server.cpp48
-rw-r--r--3rdparty/asio/src/examples/cpp11/buffers/reference_counted.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/chat/chat_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/chat/chat_message.hpp6
-rw-r--r--3rdparty/asio/src/examples/cpp11/chat/chat_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/chat/posix_chat_client.cpp198
-rw-r--r--3rdparty/asio/src/examples/cpp11/deferred/deferred_1.cpp35
-rw-r--r--3rdparty/asio/src/examples/cpp11/deferred/deferred_2.cpp44
-rw-r--r--3rdparty/asio/src/examples/cpp11/echo/async_tcp_echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/echo/async_udp_echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp6
-rw-r--r--3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/executors/bank_account_1.cpp9
-rw-r--r--3rdparty/asio/src/examples/cpp11/executors/bank_account_2.cpp12
-rw-r--r--3rdparty/asio/src/examples/cpp11/executors/fork_join.cpp7
-rw-r--r--3rdparty/asio/src/examples/cpp11/files/async_file_copy.cpp101
-rw-r--r--3rdparty/asio/src/examples/cpp11/files/blocking_file_copy.cpp65
-rw-r--r--3rdparty/asio/src/examples/cpp11/fork/daemon.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/fork/process_per_connection.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/futures/daytime_client.cpp5
-rw-r--r--3rdparty/asio/src/examples/cpp11/handler_tracking/async_tcp_echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp6
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/client/async_client.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/client/async_client.cpp)30
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/client/sync_client.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/client/sync_client.cpp)6
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/connection.cpp5
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/connection.hpp4
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/connection_manager.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/connection_manager.hpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/header.hpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/main.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/mime_types.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/mime_types.hpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/reply.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/reply.hpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/request.hpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/request_handler.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/request_handler.hpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/request_parser.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/request_parser.hpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server/server.hpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/connection.cpp89
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/connection.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/connection.hpp)34
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/header.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/header.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/io_context_pool.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/io_context_pool.cpp)18
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/io_context_pool.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/io_context_pool.hpp)17
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/main.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/main.cpp)6
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/mime_types.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/mime_types.cpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/mime_types.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/mime_types.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/reply.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/reply.cpp)5
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/reply.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/reply.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/request.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/request.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/request_handler.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/request_handler.cpp)5
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/request_handler.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/request_handler.hpp)7
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/request_parser.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/request_parser.cpp)104
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/request_parser.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/request_parser.hpp)29
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/server.cpp)51
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server2/server.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server2/server.hpp)24
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/connection.cpp89
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/connection.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/connection.hpp)37
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/header.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/header.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/main.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/main.cpp)6
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/mime_types.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/mime_types.cpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/mime_types.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/mime_types.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/reply.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/reply.cpp)5
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/reply.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/reply.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/request.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/request.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/request_handler.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/request_handler.cpp)5
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/request_handler.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/request_handler.hpp)7
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/request_parser.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/request_parser.cpp)104
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/request_parser.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/request_parser.hpp)29
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/server.cpp)66
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server3/server.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server3/server.hpp)24
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/file_handler.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/file_handler.cpp)5
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/file_handler.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/file_handler.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/header.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/header.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/main.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/main.cpp)10
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/mime_types.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/mime_types.cpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/mime_types.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/mime_types.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/reply.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/reply.cpp)5
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/reply.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/reply.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/request.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server/request.hpp)12
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/request_parser.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server/request_parser.cpp)108
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/request_parser.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server/request_parser.hpp)39
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/server.cpp)14
-rw-r--r--3rdparty/asio/src/examples/cpp11/http/server4/server.hpp (renamed from 3rdparty/asio/src/examples/cpp03/http/server4/server.hpp)26
-rw-r--r--3rdparty/asio/src/examples/cpp11/icmp/icmp_header.hpp (renamed from 3rdparty/asio/src/examples/cpp03/icmp/icmp_header.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/icmp/ipv4_header.hpp (renamed from 3rdparty/asio/src/examples/cpp03/icmp/ipv4_header.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/icmp/ping.cpp (renamed from 3rdparty/asio/src/examples/cpp03/icmp/ping.cpp)9
-rw-r--r--3rdparty/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp6
-rw-r--r--3rdparty/asio/src/examples/cpp11/iostreams/daytime_client.cpp (renamed from 3rdparty/asio/src/examples/cpp03/iostreams/daytime_client.cpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/iostreams/daytime_server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/iostreams/daytime_server.cpp)4
-rw-r--r--3rdparty/asio/src/examples/cpp11/iostreams/http_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/local/connect_pair.cpp6
-rw-r--r--3rdparty/asio/src/examples/cpp11/local/fd_passing_stream_client.cpp102
-rw-r--r--3rdparty/asio/src/examples/cpp11/local/fd_passing_stream_server.cpp160
-rw-r--r--3rdparty/asio/src/examples/cpp11/local/iostream_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/local/stream_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/local/stream_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/multicast/receiver.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/multicast/sender.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/nonblocking/third_party_lib.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/operations/composed_1.cpp64
-rw-r--r--3rdparty/asio/src/examples/cpp11/operations/composed_2.cpp162
-rw-r--r--3rdparty/asio/src/examples/cpp11/operations/composed_3.cpp64
-rw-r--r--3rdparty/asio/src/examples/cpp11/operations/composed_4.cpp63
-rw-r--r--3rdparty/asio/src/examples/cpp11/operations/composed_5.cpp64
-rw-r--r--3rdparty/asio/src/examples/cpp11/operations/composed_6.cpp75
-rw-r--r--3rdparty/asio/src/examples/cpp11/operations/composed_7.cpp64
-rw-r--r--3rdparty/asio/src/examples/cpp11/operations/composed_8.cpp64
-rw-r--r--3rdparty/asio/src/examples/cpp11/parallel_group/ranged_wait_for_all.cpp70
-rw-r--r--3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_all.cpp62
-rw-r--r--3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one.cpp62
-rw-r--r--3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one_error.cpp62
-rw-r--r--3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one_success.cpp62
-rw-r--r--3rdparty/asio/src/examples/cpp11/porthopper/client.cpp (renamed from 3rdparty/asio/src/examples/cpp03/porthopper/client.cpp)76
-rw-r--r--3rdparty/asio/src/examples/cpp11/porthopper/protocol.hpp (renamed from 3rdparty/asio/src/examples/cpp03/porthopper/protocol.hpp)12
-rw-r--r--3rdparty/asio/src/examples/cpp11/porthopper/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/porthopper/server.cpp)34
-rw-r--r--3rdparty/asio/src/examples/cpp11/serialization/client.cpp (renamed from 3rdparty/asio/src/examples/cpp03/serialization/client.cpp)8
-rw-r--r--3rdparty/asio/src/examples/cpp11/serialization/connection.hpp (renamed from 3rdparty/asio/src/examples/cpp03/serialization/connection.hpp)60
-rw-r--r--3rdparty/asio/src/examples/cpp11/serialization/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/serialization/server.cpp)17
-rw-r--r--3rdparty/asio/src/examples/cpp11/serialization/stock.hpp (renamed from 3rdparty/asio/src/examples/cpp03/serialization/stock.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/services/basic_logger.hpp (renamed from 3rdparty/asio/src/examples/cpp03/services/basic_logger.hpp)7
-rw-r--r--3rdparty/asio/src/examples/cpp11/services/daytime_client.cpp (renamed from 3rdparty/asio/src/examples/cpp03/services/daytime_client.cpp)10
-rw-r--r--3rdparty/asio/src/examples/cpp11/services/logger.hpp (renamed from 3rdparty/asio/src/examples/cpp03/services/logger.hpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/services/logger_service.cpp (renamed from 3rdparty/asio/src/examples/cpp03/services/logger_service.cpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/services/logger_service.hpp (renamed from 3rdparty/asio/src/examples/cpp03/services/logger_service.hpp)42
-rw-r--r--3rdparty/asio/src/examples/cpp11/socks4/socks4.hpp4
-rw-r--r--3rdparty/asio/src/examples/cpp11/socks4/sync_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/spawn/echo_server.cpp20
-rw-r--r--3rdparty/asio/src/examples/cpp11/spawn/parallel_grep.cpp6
-rw-r--r--3rdparty/asio/src/examples/cpp11/ssl/README (renamed from 3rdparty/asio/src/examples/cpp03/ssl/README)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/ssl/ca.pem50
-rw-r--r--3rdparty/asio/src/examples/cpp11/ssl/client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/ssl/dh4096.pem25
-rw-r--r--3rdparty/asio/src/examples/cpp11/ssl/server.cpp4
-rw-r--r--3rdparty/asio/src/examples/cpp11/ssl/server.pem99
-rw-r--r--3rdparty/asio/src/examples/cpp11/timeouts/async_tcp_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/timeouts/blocking_tcp_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp79
-rw-r--r--3rdparty/asio/src/examples/cpp11/timeouts/blocking_udp_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/timeouts/server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/timers/time_t_timer.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/daytime1/client.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/daytime1/client.cpp)10
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/daytime2/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/daytime2/server.cpp)4
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/daytime3/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/daytime3/server.cpp)19
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/daytime4/client.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/daytime4/client.cpp)8
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/daytime5/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/daytime5/server.cpp)8
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/daytime6/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/daytime6/server.cpp)22
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/daytime7/server.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/daytime7/server.cpp)31
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/timer1/timer.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/timer1/timer.cpp)2
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/timer2/timer.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/timer2/timer.cpp)4
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/timer3/timer.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/timer3/timer.cpp)10
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/timer4/timer.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/timer4/timer.cpp)8
-rw-r--r--3rdparty/asio/src/examples/cpp11/tutorial/timer5/timer.cpp (renamed from 3rdparty/asio/src/examples/cpp03/tutorial/timer5/timer.cpp)15
-rw-r--r--3rdparty/asio/src/examples/cpp11/type_erasure/line_reader.hpp48
-rw-r--r--3rdparty/asio/src/examples/cpp11/type_erasure/main.cpp60
-rw-r--r--3rdparty/asio/src/examples/cpp11/type_erasure/sleep.cpp22
-rw-r--r--3rdparty/asio/src/examples/cpp11/type_erasure/sleep.hpp35
-rw-r--r--3rdparty/asio/src/examples/cpp11/type_erasure/stdin_line_reader.cpp44
-rw-r--r--3rdparty/asio/src/examples/cpp11/type_erasure/stdin_line_reader.hpp30
-rw-r--r--3rdparty/asio/src/examples/cpp11/windows/transmit_file.cpp (renamed from 3rdparty/asio/src/examples/cpp03/windows/transmit_file.cpp)25
-rw-r--r--3rdparty/asio/src/examples/cpp14/Makefile.am7
-rw-r--r--3rdparty/asio/src/examples/cpp14/Makefile.in82
-rw-r--r--3rdparty/asio/src/examples/cpp14/deferred/deferred_1.cpp5
-rw-r--r--3rdparty/asio/src/examples/cpp14/deferred/deferred_2.cpp5
-rw-r--r--3rdparty/asio/src/examples/cpp14/deferred/deferred_3.cpp5
-rw-r--r--3rdparty/asio/src/examples/cpp14/deferred/deferred_4.cpp5
-rw-r--r--3rdparty/asio/src/examples/cpp14/deferred/deferred_5.cpp5
-rw-r--r--3rdparty/asio/src/examples/cpp14/deferred/deferred_6.cpp8
-rw-r--r--3rdparty/asio/src/examples/cpp14/deferred/deferred_7.cpp8
-rw-r--r--3rdparty/asio/src/examples/cpp14/echo/async_tcp_echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp14/echo/async_udp_echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp14/executors/async_1.cpp6
-rw-r--r--3rdparty/asio/src/examples/cpp14/executors/async_2.cpp6
-rw-r--r--3rdparty/asio/src/examples/cpp14/executors/bank_account_1.cpp9
-rw-r--r--3rdparty/asio/src/examples/cpp14/executors/bank_account_2.cpp13
-rw-r--r--3rdparty/asio/src/examples/cpp14/executors/fork_join.cpp7
-rw-r--r--3rdparty/asio/src/examples/cpp14/executors/pipeline.cpp10
-rw-r--r--3rdparty/asio/src/examples/cpp14/executors/priority_scheduler.cpp20
-rw-r--r--3rdparty/asio/src/examples/cpp14/iostreams/http_client.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/c_callback_wrapper.cpp230
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/callback_wrapper.cpp152
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/composed_1.cpp56
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/composed_2.cpp146
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/composed_3.cpp54
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/composed_4.cpp53
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/composed_5.cpp54
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/composed_6.cpp64
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/composed_7.cpp56
-rw-r--r--3rdparty/asio/src/examples/cpp14/operations/composed_8.cpp56
-rw-r--r--3rdparty/asio/src/examples/cpp14/parallel_group/parallel_sort.cpp5
-rw-r--r--3rdparty/asio/src/examples/cpp14/parallel_group/ranged_wait_for_all.cpp70
-rw-r--r--3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_all.cpp8
-rw-r--r--3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one.cpp8
-rw-r--r--3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_error.cpp8
-rw-r--r--3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_success.cpp8
-rw-r--r--3rdparty/asio/src/examples/cpp17/Makefile.in15
-rw-r--r--3rdparty/asio/src/examples/cpp17/coroutines_ts/chat_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_single_default.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_tuple_default.cpp6
-rw-r--r--3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_default.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp17/coroutines_ts/range_based_for.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp17/coroutines_ts/refactored_echo_server.cpp2
-rw-r--r--3rdparty/asio/src/examples/cpp20/Makefile.am79
-rw-r--r--3rdparty/asio/src/examples/cpp20/Makefile.in1173
-rw-r--r--3rdparty/asio/src/examples/cpp20/channels/mutual_exclusion_1.cpp182
-rw-r--r--3rdparty/asio/src/examples/cpp20/channels/mutual_exclusion_2.cpp192
-rw-r--r--3rdparty/asio/src/examples/cpp20/channels/throttling_proxy.cpp135
-rw-r--r--3rdparty/asio/src/examples/cpp20/coroutines/chat_server.cpp222
-rw-r--r--3rdparty/asio/src/examples/cpp20/coroutines/echo_server.cpp76
-rw-r--r--3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_as_single_default.cpp71
-rw-r--r--3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_as_tuple_default.cpp71
-rw-r--r--3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_default.cpp73
-rw-r--r--3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_deferred.cpp72
-rw-r--r--3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_deferred_default.cpp74
-rw-r--r--3rdparty/asio/src/examples/cpp20/coroutines/refactored_echo_server.cpp80
-rw-r--r--3rdparty/asio/src/examples/cpp20/coroutines/timeout.cpp66
-rw-r--r--3rdparty/asio/src/examples/cpp20/invocation/completion_executor.cpp83
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/c_callback_wrapper.cpp232
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/callback_wrapper.cpp154
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/composed_1.cpp157
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/composed_2.cpp225
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/composed_3.cpp232
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/composed_4.cpp247
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/composed_5.cpp284
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/composed_6.cpp345
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/composed_7.cpp262
-rw-r--r--3rdparty/asio/src/examples/cpp20/operations/composed_8.cpp255
-rw-r--r--3rdparty/asio/src/examples/cpp20/type_erasure/line_reader.hpp39
-rw-r--r--3rdparty/asio/src/examples/cpp20/type_erasure/main.cpp35
-rw-r--r--3rdparty/asio/src/examples/cpp20/type_erasure/sleep.cpp22
-rw-r--r--3rdparty/asio/src/examples/cpp20/type_erasure/sleep.hpp32
-rw-r--r--3rdparty/asio/src/examples/cpp20/type_erasure/stdin_line_reader.cpp44
-rw-r--r--3rdparty/asio/src/examples/cpp20/type_erasure/stdin_line_reader.hpp30
-rw-r--r--3rdparty/asio/src/tests/Makefile.am162
-rw-r--r--3rdparty/asio/src/tests/Makefile.in1679
-rw-r--r--3rdparty/asio/src/tests/latency/allocator.hpp2
-rw-r--r--3rdparty/asio/src/tests/latency/high_res_clock.hpp2
-rw-r--r--3rdparty/asio/src/tests/latency/tcp_client.cpp2
-rw-r--r--3rdparty/asio/src/tests/latency/tcp_server.cpp2
-rw-r--r--3rdparty/asio/src/tests/latency/udp_client.cpp2
-rw-r--r--3rdparty/asio/src/tests/latency/udp_server.cpp2
-rw-r--r--3rdparty/asio/src/tests/performance/client.cpp2
-rw-r--r--3rdparty/asio/src/tests/performance/handler_allocator.hpp2
-rw-r--r--3rdparty/asio/src/tests/performance/server.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/Makefile.in18
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_prefer_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_query_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_query_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_query_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_query_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_concept_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_concept_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_concept_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_concept_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/can_require_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/prefer_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/prefer_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/prefer_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/prefer_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/prefer_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/prefer_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/query_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/query_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/query_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/require_concept_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/require_concept_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/require_concept_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/require_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/require_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp03/require_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_prefer_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_query_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_query_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_query_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_query_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_concept_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_concept_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_concept_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_concept_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/can_require_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/prefer_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/prefer_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/prefer_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/prefer_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/prefer_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/prefer_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/query_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/query_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/query_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/require_concept_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/require_concept_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/require_concept_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/require_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/require_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp11/require_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_prefer_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_query_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_query_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_query_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_query_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_concept_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_concept_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_concept_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_concept_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/can_require_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/prefer_free_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/prefer_free_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/prefer_member_prefer.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/prefer_member_require.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/prefer_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/prefer_unsupported.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/query_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/query_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/query_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/require_concept_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/require_concept_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/require_concept_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/require_free.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/require_member.cpp2
-rw-r--r--3rdparty/asio/src/tests/properties/cpp14/require_static.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/any_completion_executor.cpp463
-rw-r--r--3rdparty/asio/src/tests/unit/any_completion_handler.cpp260
-rw-r--r--3rdparty/asio/src/tests/unit/any_io_executor.cpp515
-rw-r--r--3rdparty/asio/src/tests/unit/append.cpp58
-rw-r--r--3rdparty/asio/src/tests/unit/archetypes/async_ops.hpp132
-rw-r--r--3rdparty/asio/src/tests/unit/archetypes/async_result.hpp82
-rw-r--r--3rdparty/asio/src/tests/unit/archetypes/gettable_socket_option.hpp2
-rw-r--r--3rdparty/asio/src/tests/unit/archetypes/io_control_command.hpp2
-rw-r--r--3rdparty/asio/src/tests/unit/archetypes/settable_socket_option.hpp2
-rw-r--r--3rdparty/asio/src/tests/unit/as_tuple.cpp122
-rw-r--r--3rdparty/asio/src/tests/unit/associated_allocator.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/associated_cancellation_slot.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/associated_executor.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/associated_immediate_executor.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/associator.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/async_result.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/awaitable.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_datagram_socket.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_deadline_timer.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_file.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/basic_random_access_file.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/basic_raw_socket.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_readable_pipe.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/basic_seq_packet_socket.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_serial_port.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_signal_set.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_socket.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_socket_acceptor.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_stream_file.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/basic_stream_socket.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_streambuf.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_waitable_timer.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/basic_writable_pipe.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/bind_allocator.cpp237
-rw-r--r--3rdparty/asio/src/tests/unit/bind_cancellation_slot.cpp133
-rw-r--r--3rdparty/asio/src/tests/unit/bind_executor.cpp123
-rw-r--r--3rdparty/asio/src/tests/unit/bind_immediate_executor.cpp199
-rw-r--r--3rdparty/asio/src/tests/unit/buffer.cpp133
-rw-r--r--3rdparty/asio/src/tests/unit/buffer_registration.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/buffered_read_stream.cpp15
-rw-r--r--3rdparty/asio/src/tests/unit/buffered_stream.cpp15
-rw-r--r--3rdparty/asio/src/tests/unit/buffered_write_stream.cpp15
-rw-r--r--3rdparty/asio/src/tests/unit/buffers_iterator.cpp17
-rw-r--r--3rdparty/asio/src/tests/unit/cancellation_signal.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/cancellation_state.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/cancellation_type.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/co_spawn.cpp110
-rw-r--r--3rdparty/asio/src/tests/unit/completion_condition.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/compose.cpp44
-rw-r--r--3rdparty/asio/src/tests/unit/connect.cpp14
-rw-r--r--3rdparty/asio/src/tests/unit/connect_pipe.cpp154
-rw-r--r--3rdparty/asio/src/tests/unit/consign.cpp56
-rw-r--r--3rdparty/asio/src/tests/unit/coroutine.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/deadline_timer.cpp14
-rw-r--r--3rdparty/asio/src/tests/unit/defer.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/deferred.cpp (renamed from 3rdparty/asio/src/tests/unit/experimental/deferred.cpp)10
-rw-r--r--3rdparty/asio/src/tests/unit/detached.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/dispatch.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/error.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/execution/any_executor.cpp428
-rw-r--r--3rdparty/asio/src/tests/unit/execution/blocking.cpp151
-rw-r--r--3rdparty/asio/src/tests/unit/execution/blocking_adaptation.cpp194
-rw-r--r--3rdparty/asio/src/tests/unit/execution/bulk_execute.cpp320
-rw-r--r--3rdparty/asio/src/tests/unit/execution/bulk_guarantee.cpp1978
-rw-r--r--3rdparty/asio/src/tests/unit/execution/connect.cpp481
-rw-r--r--3rdparty/asio/src/tests/unit/execution/context_as.cpp14
-rw-r--r--3rdparty/asio/src/tests/unit/execution/execute.cpp388
-rw-r--r--3rdparty/asio/src/tests/unit/execution/executor.cpp98
-rw-r--r--3rdparty/asio/src/tests/unit/execution/invocable_archetype.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/execution/mapping.cpp151
-rw-r--r--3rdparty/asio/src/tests/unit/execution/operation_state.cpp104
-rw-r--r--3rdparty/asio/src/tests/unit/execution/outstanding_work.cpp146
-rw-r--r--3rdparty/asio/src/tests/unit/execution/prefer_only.cpp94
-rw-r--r--3rdparty/asio/src/tests/unit/execution/receiver.cpp549
-rw-r--r--3rdparty/asio/src/tests/unit/execution/relationship.cpp146
-rw-r--r--3rdparty/asio/src/tests/unit/execution/schedule.cpp490
-rw-r--r--3rdparty/asio/src/tests/unit/execution/scheduler.cpp99
-rw-r--r--3rdparty/asio/src/tests/unit/execution/sender.cpp231
-rw-r--r--3rdparty/asio/src/tests/unit/execution/set_done.cpp228
-rw-r--r--3rdparty/asio/src/tests/unit/execution/set_error.cpp244
-rw-r--r--3rdparty/asio/src/tests/unit/execution/set_value.cpp820
-rw-r--r--3rdparty/asio/src/tests/unit/execution/start.cpp228
-rw-r--r--3rdparty/asio/src/tests/unit/execution/submit.cpp546
-rw-r--r--3rdparty/asio/src/tests/unit/execution_context.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/executor.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/executor_work_guard.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/awaitable_operators.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/basic_channel.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/basic_concurrent_channel.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/channel.cpp888
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/channel_traits.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/co_composed.cpp518
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/concurrent_channel.cpp165
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/coro/allocator.cpp113
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/coro/cancel.cpp39
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/coro/co_spawn.cpp67
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/coro/exception.cpp6
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/coro/executor.cpp116
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/coro/partial.cpp6
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/coro/simple_test.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/coro/stack_test.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/coro/use_coro.cpp6
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/parallel_group.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/experimental/promise.cpp326
-rw-r--r--3rdparty/asio/src/tests/unit/file_base.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/generic/basic_endpoint.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/generic/datagram_protocol.cpp41
-rw-r--r--3rdparty/asio/src/tests/unit/generic/raw_protocol.cpp42
-rw-r--r--3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp19
-rw-r--r--3rdparty/asio/src/tests/unit/generic/stream_protocol.cpp27
-rw-r--r--3rdparty/asio/src/tests/unit/high_resolution_timer.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/io_context.cpp103
-rw-r--r--3rdparty/asio/src/tests/unit/io_context_strand.cpp15
-rw-r--r--3rdparty/asio/src/tests/unit/ip/address.cpp6
-rw-r--r--3rdparty/asio/src/tests/unit/ip/address_v4.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/ip/address_v4_iterator.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/address_v4_range.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/address_v6.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/ip/address_v6_iterator.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/address_v6_range.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/basic_endpoint.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/basic_resolver.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/basic_resolver_entry.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/basic_resolver_iterator.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/basic_resolver_query.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/host_name.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/ip/icmp.cpp67
-rw-r--r--3rdparty/asio/src/tests/unit/ip/multicast.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/ip/network_v4.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/ip/network_v6.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/ip/resolver_query_base.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ip/tcp.cpp111
-rw-r--r--3rdparty/asio/src/tests/unit/ip/udp.cpp81
-rw-r--r--3rdparty/asio/src/tests/unit/ip/unicast.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/ip/v6_only.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/is_read_buffered.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/is_write_buffered.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/local/basic_endpoint.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/local/connect_pair.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/local/datagram_protocol.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/local/seq_packet_protocol.cpp209
-rw-r--r--3rdparty/asio/src/tests/unit/local/stream_protocol.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/packaged_task.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/placeholders.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/posix/basic_descriptor.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/posix/basic_stream_descriptor.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/posix/descriptor.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/posix/descriptor_base.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp23
-rw-r--r--3rdparty/asio/src/tests/unit/post.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/prepend.cpp58
-rw-r--r--3rdparty/asio/src/tests/unit/random_access_file.cpp171
-rw-r--r--3rdparty/asio/src/tests/unit/read.cpp76
-rw-r--r--3rdparty/asio/src/tests/unit/read_at.cpp68
-rw-r--r--3rdparty/asio/src/tests/unit/read_until.cpp37
-rw-r--r--3rdparty/asio/src/tests/unit/readable_pipe.cpp131
-rw-r--r--3rdparty/asio/src/tests/unit/recycling_allocator.cpp80
-rw-r--r--3rdparty/asio/src/tests/unit/redirect_error.cpp100
-rw-r--r--3rdparty/asio/src/tests/unit/registered_buffer.cpp111
-rw-r--r--3rdparty/asio/src/tests/unit/serial_port.cpp20
-rw-r--r--3rdparty/asio/src/tests/unit/serial_port_base.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/signal_set.cpp7
-rw-r--r--3rdparty/asio/src/tests/unit/signal_set_base.cpp30
-rw-r--r--3rdparty/asio/src/tests/unit/socket_base.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/ssl/context.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ssl/context_base.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ssl/error.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ssl/host_name_verification.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ssl/rfc2818_verification.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ssl/stream.cpp8
-rw-r--r--3rdparty/asio/src/tests/unit/ssl/stream_base.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/static_thread_pool.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/steady_timer.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/strand.cpp94
-rw-r--r--3rdparty/asio/src/tests/unit/stream_file.cpp173
-rw-r--r--3rdparty/asio/src/tests/unit/streambuf.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/system_context.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/system_executor.cpp93
-rw-r--r--3rdparty/asio/src/tests/unit/system_timer.cpp39
-rw-r--r--3rdparty/asio/src/tests/unit/this_coro.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/thread.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/thread_pool.cpp315
-rw-r--r--3rdparty/asio/src/tests/unit/time_traits.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ts/buffer.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ts/executor.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ts/internet.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ts/io_context.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ts/net.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ts/netfwd.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ts/socket.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/ts/timer.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/unit_test.hpp2
-rw-r--r--3rdparty/asio/src/tests/unit/use_awaitable.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/use_future.cpp8
-rw-r--r--3rdparty/asio/src/tests/unit/uses_executor.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/wait_traits.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/windows/basic_object_handle.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/windows/basic_overlapped_handle.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/windows/basic_random_access_handle.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/windows/basic_stream_handle.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/windows/object_handle.cpp16
-rw-r--r--3rdparty/asio/src/tests/unit/windows/overlapped_handle.cpp2
-rw-r--r--3rdparty/asio/src/tests/unit/windows/overlapped_ptr.cpp4
-rw-r--r--3rdparty/asio/src/tests/unit/windows/random_access_handle.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/windows/stream_handle.cpp25
-rw-r--r--3rdparty/asio/src/tests/unit/writable_pipe.cpp136
-rw-r--r--3rdparty/asio/src/tests/unit/write.cpp84
-rw-r--r--3rdparty/asio/src/tests/unit/write_at.cpp76
-rwxr-xr-x3rdparty/asio/src/tools/handlerlive.pl2
-rwxr-xr-x3rdparty/asio/src/tools/handlertree.pl2
-rwxr-xr-x3rdparty/asio/src/tools/handlerviz.pl2
-rwxr-xr-x3rdparty/asio/test-driver38
-rw-r--r--3rdparty/asmjit/.gitignore3
-rw-r--r--3rdparty/asmjit/CMakeLists.txt296
-rw-r--r--3rdparty/asmjit/CONTRIBUTING.md102
-rw-r--r--3rdparty/asmjit/LICENSE.md2
-rw-r--r--3rdparty/asmjit/README.md51
-rw-r--r--3rdparty/asmjit/src/asmjit/a64.h28
-rw-r--r--3rdparty/asmjit/src/asmjit/arm.h44
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64archtraits_p.h7
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64assembler.cpp306
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64assembler.h15
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64builder.cpp10
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64builder.h2
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64compiler.cpp5
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64compiler.h117
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64emithelper.cpp14
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64emithelper_p.h8
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64emitter.h43
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64formatter.cpp247
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64formatter_p.h17
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64func.cpp29
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64func_p.h2
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64globals.h27
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64instapi.cpp86
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64instapi_p.h10
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64instdb.cpp2402
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64instdb.h12
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64instdb_p.h47
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64operand.cpp96
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64operand.h392
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64rapass.cpp12
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/a64rapass_p.h6
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/armformatter.cpp515
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/armformatter_p.h25
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/armglobals.h4
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/armoperand.h571
-rw-r--r--3rdparty/asmjit/src/asmjit/arm/armutils.h (renamed from 3rdparty/asmjit/src/asmjit/arm/a64utils.h)87
-rw-r--r--3rdparty/asmjit/src/asmjit/asmjit.h2
-rw-r--r--3rdparty/asmjit/src/asmjit/core.h312
-rw-r--r--3rdparty/asmjit/src/asmjit/core/api-build_p.h19
-rw-r--r--3rdparty/asmjit/src/asmjit/core/api-config.h317
-rw-r--r--3rdparty/asmjit/src/asmjit/core/archcommons.h194
-rw-r--r--3rdparty/asmjit/src/asmjit/core/archtraits.cpp1
-rw-r--r--3rdparty/asmjit/src/asmjit/core/archtraits.h45
-rw-r--r--3rdparty/asmjit/src/asmjit/core/assembler.h17
-rw-r--r--3rdparty/asmjit/src/asmjit/core/builder.cpp68
-rw-r--r--3rdparty/asmjit/src/asmjit/core/builder.h492
-rw-r--r--3rdparty/asmjit/src/asmjit/core/builder_p.h37
-rw-r--r--3rdparty/asmjit/src/asmjit/core/codebuffer.h30
-rw-r--r--3rdparty/asmjit/src/asmjit/core/codeholder.cpp41
-rw-r--r--3rdparty/asmjit/src/asmjit/core/codeholder.h304
-rw-r--r--3rdparty/asmjit/src/asmjit/core/codewriter.cpp105
-rw-r--r--3rdparty/asmjit/src/asmjit/core/compiler.cpp42
-rw-r--r--3rdparty/asmjit/src/asmjit/core/compiler.h116
-rw-r--r--3rdparty/asmjit/src/asmjit/core/compilerdefs.h54
-rw-r--r--3rdparty/asmjit/src/asmjit/core/constpool.cpp83
-rw-r--r--3rdparty/asmjit/src/asmjit/core/constpool.h45
-rw-r--r--3rdparty/asmjit/src/asmjit/core/cpuinfo.cpp1967
-rw-r--r--3rdparty/asmjit/src/asmjit/core/cpuinfo.h917
-rw-r--r--3rdparty/asmjit/src/asmjit/core/emithelper.cpp25
-rw-r--r--3rdparty/asmjit/src/asmjit/core/emithelper_p.h12
-rw-r--r--3rdparty/asmjit/src/asmjit/core/emitter.cpp82
-rw-r--r--3rdparty/asmjit/src/asmjit/core/emitter.h237
-rw-r--r--3rdparty/asmjit/src/asmjit/core/emitterutils.cpp8
-rw-r--r--3rdparty/asmjit/src/asmjit/core/emitterutils_p.h4
-rw-r--r--3rdparty/asmjit/src/asmjit/core/environment.h256
-rw-r--r--3rdparty/asmjit/src/asmjit/core/errorhandler.cpp4
-rw-r--r--3rdparty/asmjit/src/asmjit/core/errorhandler.h8
-rw-r--r--3rdparty/asmjit/src/asmjit/core/formatter.cpp62
-rw-r--r--3rdparty/asmjit/src/asmjit/core/formatter.h34
-rw-r--r--3rdparty/asmjit/src/asmjit/core/func.cpp20
-rw-r--r--3rdparty/asmjit/src/asmjit/core/func.h808
-rw-r--r--3rdparty/asmjit/src/asmjit/core/funcargscontext.cpp20
-rw-r--r--3rdparty/asmjit/src/asmjit/core/funcargscontext_p.h12
-rw-r--r--3rdparty/asmjit/src/asmjit/core/globals.cpp4
-rw-r--r--3rdparty/asmjit/src/asmjit/core/globals.h70
-rw-r--r--3rdparty/asmjit/src/asmjit/core/inst.cpp22
-rw-r--r--3rdparty/asmjit/src/asmjit/core/inst.h212
-rw-r--r--3rdparty/asmjit/src/asmjit/core/instdb.cpp101
-rw-r--r--3rdparty/asmjit/src/asmjit/core/instdb_p.h40
-rw-r--r--3rdparty/asmjit/src/asmjit/core/jitallocator.cpp727
-rw-r--r--3rdparty/asmjit/src/asmjit/core/jitallocator.h385
-rw-r--r--3rdparty/asmjit/src/asmjit/core/jitruntime.cpp31
-rw-r--r--3rdparty/asmjit/src/asmjit/core/jitruntime.h26
-rw-r--r--3rdparty/asmjit/src/asmjit/core/logger.cpp8
-rw-r--r--3rdparty/asmjit/src/asmjit/core/logger.h54
-rw-r--r--3rdparty/asmjit/src/asmjit/core/operand.cpp136
-rw-r--r--3rdparty/asmjit/src/asmjit/core/operand.h990
-rw-r--r--3rdparty/asmjit/src/asmjit/core/osutils.cpp82
-rw-r--r--3rdparty/asmjit/src/asmjit/core/osutils.h15
-rw-r--r--3rdparty/asmjit/src/asmjit/core/osutils_p.h40
-rw-r--r--3rdparty/asmjit/src/asmjit/core/raassignment_p.h18
-rw-r--r--3rdparty/asmjit/src/asmjit/core/rabuilders_p.h2
-rw-r--r--3rdparty/asmjit/src/asmjit/core/radefs_p.h364
-rw-r--r--3rdparty/asmjit/src/asmjit/core/ralocal.cpp23
-rw-r--r--3rdparty/asmjit/src/asmjit/core/ralocal_p.h65
-rw-r--r--3rdparty/asmjit/src/asmjit/core/rapass.cpp148
-rw-r--r--3rdparty/asmjit/src/asmjit/core/rapass_p.h294
-rw-r--r--3rdparty/asmjit/src/asmjit/core/rastack.cpp2
-rw-r--r--3rdparty/asmjit/src/asmjit/core/rastack_p.h31
-rw-r--r--3rdparty/asmjit/src/asmjit/core/string.cpp202
-rw-r--r--3rdparty/asmjit/src/asmjit/core/string.h95
-rw-r--r--3rdparty/asmjit/src/asmjit/core/support.cpp452
-rw-r--r--3rdparty/asmjit/src/asmjit/core/support.h661
-rw-r--r--3rdparty/asmjit/src/asmjit/core/support_p.h27
-rw-r--r--3rdparty/asmjit/src/asmjit/core/target.cpp4
-rw-r--r--3rdparty/asmjit/src/asmjit/core/target.h12
-rw-r--r--3rdparty/asmjit/src/asmjit/core/type.h114
-rw-r--r--3rdparty/asmjit/src/asmjit/core/virtmem.cpp886
-rw-r--r--3rdparty/asmjit/src/asmjit/core/virtmem.h147
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zone.cpp12
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zone.h56
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonehash.cpp8
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonehash.h16
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonelist.cpp180
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonelist.h37
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonestack.cpp58
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonestack.h44
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonestring.h16
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonetree.cpp17
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonetree.h62
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonevector.cpp183
-rw-r--r--3rdparty/asmjit/src/asmjit/core/zonevector.h188
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86assembler.cpp484
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86assembler.h68
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86builder.cpp9
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86builder.h11
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86compiler.cpp5
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86compiler.h329
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86emithelper.cpp105
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86emithelper_p.h4
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86emitter.h328
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86formatter.cpp142
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86func.cpp7
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86globals.h401
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp528
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86instapi_p.h7
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86instdb.cpp9283
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86instdb.h166
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86instdb_p.h25
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86opcode_p.h66
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86operand.cpp332
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86operand.h555
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86rapass.cpp81
-rw-r--r--3rdparty/asmjit/src/asmjit/x86/x86rapass_p.h12
-rw-r--r--3rdparty/asmjit/test/asmjit_test_assembler.cpp19
-rw-r--r--3rdparty/asmjit/test/asmjit_test_assembler.h29
-rw-r--r--3rdparty/asmjit/test/asmjit_test_assembler_a64.cpp28
-rw-r--r--3rdparty/asmjit/test/asmjit_test_assembler_x64.cpp5559
-rw-r--r--3rdparty/asmjit/test/asmjit_test_assembler_x86.cpp5111
-rw-r--r--3rdparty/asmjit/test/asmjit_test_compiler.cpp378
-rw-r--r--3rdparty/asmjit/test/asmjit_test_compiler.h20
-rw-r--r--3rdparty/asmjit/test/asmjit_test_compiler_a64.cpp111
-rw-r--r--3rdparty/asmjit/test/asmjit_test_compiler_x86.cpp1854
-rw-r--r--3rdparty/asmjit/test/asmjit_test_emitters.cpp242
-rw-r--r--3rdparty/asmjit/test/asmjit_test_execute.cpp103
-rw-r--r--3rdparty/asmjit/test/asmjit_test_instinfo.cpp12
-rw-r--r--3rdparty/asmjit/test/asmjit_test_misc.h6
-rw-r--r--3rdparty/asmjit/test/asmjit_test_perf.cpp16
-rw-r--r--3rdparty/asmjit/test/asmjit_test_perf.h63
-rw-r--r--3rdparty/asmjit/test/asmjit_test_perf_a64.cpp34
-rw-r--r--3rdparty/asmjit/test/asmjit_test_perf_x86.cpp7612
-rw-r--r--3rdparty/asmjit/test/asmjit_test_unit.cpp3
-rw-r--r--3rdparty/asmjit/test/asmjit_test_x86_sections.cpp35
-rw-r--r--3rdparty/asmjit/test/asmjitutils.h24
-rw-r--r--3rdparty/asmjit/test/broken.cpp16
-rw-r--r--3rdparty/asmjit/test/broken.h212
-rw-r--r--3rdparty/asmjit/test/performancetimer.h8
-rwxr-xr-x[-rw-r--r--]3rdparty/asmjit/tools/configure-makefiles.sh0
-rwxr-xr-x[-rw-r--r--]3rdparty/asmjit/tools/configure-ninja.sh0
-rwxr-xr-x[-rw-r--r--]3rdparty/asmjit/tools/configure-sanitizers.sh4
-rwxr-xr-x[-rw-r--r--]3rdparty/asmjit/tools/configure-xcode.sh0
-rwxr-xr-x[-rw-r--r--]3rdparty/asmjit/tools/enumgen.sh0
-rw-r--r--3rdparty/asmjit/tools/generator-commons.js592
-rw-r--r--3rdparty/asmjit/tools/generator-cxx.js270
-rw-r--r--3rdparty/asmjit/tools/tablegen-a64.js (renamed from 3rdparty/asmjit/tools/tablegen-arm.js)45
-rwxr-xr-x3rdparty/asmjit/tools/tablegen-a64.sh3
-rw-r--r--3rdparty/asmjit/tools/tablegen-arm.sh3
-rw-r--r--3rdparty/asmjit/tools/tablegen-x86.js403
-rwxr-xr-x[-rw-r--r--]3rdparty/asmjit/tools/tablegen-x86.sh0
-rw-r--r--3rdparty/asmjit/tools/tablegen.js871
-rwxr-xr-x[-rw-r--r--]3rdparty/asmjit/tools/tablegen.sh3
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h152
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp9547
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui.h2088
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp6332
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp1495
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h1930
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp1109
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp4334
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl12
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl17
-rw-r--r--3rdparty/bgfx/3rdparty/stb/stb_textedit.h366
-rw-r--r--3rdparty/bgfx/3rdparty/stb/stb_truetype.h645
-rw-r--r--3rdparty/bgfx/examples/22-windows/windows.cpp15
-rw-r--r--3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp10
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.cpp3
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_glfw.cpp77
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_p.h4
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_sdl.cpp92
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_windows.cpp8
-rw-r--r--3rdparty/bgfx/examples/common/example-glue.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.cpp68
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.h4
-rw-r--r--3rdparty/bgfx/examples/common/imgui/makefile2
-rw-r--r--3rdparty/bgfx/scripts/example-common.lua6
-rw-r--r--3rdparty/bgfx/scripts/genie.lua31
-rw-r--r--3rdparty/bgfx/scripts/geometryv.lua16
-rw-r--r--3rdparty/bgfx/scripts/texturev.lua16
-rw-r--r--3rdparty/bgfx/src/glcontext_egl.cpp102
-rw-r--r--3rdparty/bgfx/src/glcontext_egl.h17
-rw-r--r--3rdparty/bgfx/src/glcontext_html5.cpp5
-rw-r--r--3rdparty/bgfx/src/glcontext_html5.h2
-rw-r--r--3rdparty/bgfx/src/glcontext_nsgl.h2
-rw-r--r--3rdparty/bgfx/src/glcontext_nsgl.mm2
-rw-r--r--3rdparty/bgfx/src/glcontext_wgl.cpp3
-rw-r--r--3rdparty/bgfx/src/glcontext_wgl.h2
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp4
-rw-r--r--3rdparty/bgfx/src/renderer_gl.cpp9
-rw-r--r--3rdparty/bgfx/src/renderer_vk.cpp135
-rw-r--r--3rdparty/bgfx/src/renderer_vk.h28
-rw-r--r--3rdparty/bgfx/src/shader_spirv.cpp2
-rw-r--r--3rdparty/bx/include/bx/macros.h6
-rw-r--r--3rdparty/bx/src/debug.cpp8
-rw-r--r--3rdparty/expat/CMake.README14
-rw-r--r--3rdparty/expat/CMakeLists.txt636
-rw-r--r--3rdparty/expat/COPYING2
-rw-r--r--3rdparty/expat/Changes863
-rw-r--r--3rdparty/expat/ConfigureChecks.cmake24
-rw-r--r--3rdparty/expat/Makefile.am43
-rw-r--r--3rdparty/expat/Makefile.in164
-rw-r--r--3rdparty/expat/README.md161
-rw-r--r--3rdparty/expat/acinclude.m42
-rw-r--r--3rdparty/expat/aclocal.m4113
-rwxr-xr-x3rdparty/expat/buildconf.sh35
-rw-r--r--3rdparty/expat/cmake/autotools/expat-config-version.cmake.in65
-rw-r--r--3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in19
-rw-r--r--3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in19
-rw-r--r--3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in19
-rw-r--r--3rdparty/expat/cmake/autotools/expat-package-init.cmake25
-rw-r--r--3rdparty/expat/cmake/autotools/expat.cmake107
-rw-r--r--3rdparty/expat/cmake/mingw-toolchain.cmake1
-rwxr-xr-x3rdparty/expat/configure10315
-rw-r--r--3rdparty/expat/configure.ac196
-rwxr-xr-x3rdparty/expat/conftools/PrintPath116
-rwxr-xr-x3rdparty/expat/conftools/ar-lib2
-rw-r--r--3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m439
-rw-r--r--3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m41018
-rwxr-xr-x3rdparty/expat/conftools/compile2
-rwxr-xr-x3rdparty/expat/conftools/config.guess1209
-rwxr-xr-x3rdparty/expat/conftools/config.sub655
-rwxr-xr-x3rdparty/expat/conftools/depcomp2
-rwxr-xr-x3rdparty/expat/conftools/get-version.sh30
-rwxr-xr-x3rdparty/expat/conftools/install-sh148
-rw-r--r--3rdparty/expat/conftools/ltmain.sh1594
-rwxr-xr-x3rdparty/expat/conftools/missing2
-rwxr-xr-x3rdparty/expat/conftools/test-driver19
-rw-r--r--3rdparty/expat/doc/Makefile.am26
-rw-r--r--3rdparty/expat/doc/Makefile.in96
-rw-r--r--3rdparty/expat/doc/expat.pngbin920 -> 0 bytes
-rw-r--r--3rdparty/expat/doc/ok.min.css2
-rw-r--r--3rdparty/expat/doc/reference.html636
-rw-r--r--3rdparty/expat/doc/style.css134
-rw-r--r--3rdparty/expat/doc/valid-xhtml10.pngbin1981 -> 0 bytes
-rw-r--r--3rdparty/expat/doc/xmlwf.1135
-rw-r--r--3rdparty/expat/doc/xmlwf.xml223
-rw-r--r--3rdparty/expat/examples/Makefile.am8
-rw-r--r--3rdparty/expat/examples/Makefile.in74
-rw-r--r--3rdparty/expat/examples/element_declarations.c235
-rw-r--r--3rdparty/expat/examples/elements.c52
-rw-r--r--3rdparty/expat/examples/outline.c83
-rw-r--r--3rdparty/expat/expat.pc.cmake13
-rw-r--r--3rdparty/expat/expat.pc.in8
-rw-r--r--3rdparty/expat/expat_config.h143
-rw-r--r--3rdparty/expat/expat_config.h.cmake19
-rw-r--r--3rdparty/expat/expat_config.h.in24
-rwxr-xr-x3rdparty/expat/fix-xmltest-log.sh16
-rw-r--r--3rdparty/expat/fuzz/xml_lpm_fuzzer.cpp464
-rw-r--r--3rdparty/expat/fuzz/xml_lpm_fuzzer.proto58
-rw-r--r--3rdparty/expat/fuzz/xml_parse_fuzzer.c105
-rw-r--r--3rdparty/expat/fuzz/xml_parsebuffer_fuzzer.c117
-rw-r--r--3rdparty/expat/lib/Makefile.am17
-rw-r--r--3rdparty/expat/lib/Makefile.in139
-rw-r--r--3rdparty/expat/lib/ascii.h7
-rw-r--r--3rdparty/expat/lib/asciitab.h4
-rw-r--r--3rdparty/expat/lib/expat.h77
-rw-r--r--3rdparty/expat/lib/expat_config.h6
-rw-r--r--3rdparty/expat/lib/expat_external.h9
-rw-r--r--3rdparty/expat/lib/iasciitab.h4
-rw-r--r--3rdparty/expat/lib/internal.h74
-rw-r--r--3rdparty/expat/lib/latin1tab.h4
-rw-r--r--3rdparty/expat/lib/libexpat.def78
-rw-r--r--3rdparty/expat/lib/libexpat.def.cmake (renamed from 3rdparty/expat/lib/libexpatw.def)11
-rw-r--r--3rdparty/expat/lib/nametab.h4
-rw-r--r--3rdparty/expat/lib/siphash.h26
-rw-r--r--3rdparty/expat/lib/utf8tab.h4
-rw-r--r--3rdparty/expat/lib/winconfig.h24
-rw-r--r--3rdparty/expat/lib/xmlparse.c2773
-rw-r--r--3rdparty/expat/lib/xmlrole.c18
-rw-r--r--3rdparty/expat/lib/xmlrole.h9
-rw-r--r--3rdparty/expat/lib/xmltok.c78
-rw-r--r--3rdparty/expat/lib/xmltok.h12
-rw-r--r--3rdparty/expat/lib/xmltok_impl.c38
-rw-r--r--3rdparty/expat/lib/xmltok_impl.h5
-rw-r--r--3rdparty/expat/lib/xmltok_ns.c8
-rw-r--r--3rdparty/expat/m4/libtool.m4682
-rw-r--r--3rdparty/expat/m4/ltoptions.m4108
-rw-r--r--3rdparty/expat/m4/ltsugar.m42
-rw-r--r--3rdparty/expat/m4/ltversion.m413
-rw-r--r--3rdparty/expat/m4/lt~obsolete.m44
-rw-r--r--3rdparty/expat/run.sh.in41
-rwxr-xr-x3rdparty/expat/test-driver-wrapper.sh3
-rw-r--r--3rdparty/expat/tests/Makefile.am65
-rw-r--r--3rdparty/expat/tests/Makefile.in302
-rw-r--r--3rdparty/expat/tests/README.md11
-rw-r--r--3rdparty/expat/tests/README.txt13
-rw-r--r--3rdparty/expat/tests/acc_tests.c458
-rw-r--r--3rdparty/expat/tests/acc_tests.h56
-rw-r--r--3rdparty/expat/tests/acc_tests_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/alloc_tests.c2154
-rw-r--r--3rdparty/expat/tests/alloc_tests.h56
-rw-r--r--3rdparty/expat/tests/alloc_tests_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/basic_tests.c6472
-rw-r--r--3rdparty/expat/tests/basic_tests.h56
-rw-r--r--3rdparty/expat/tests/basic_tests_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/benchmark/Makefile.am3
-rw-r--r--3rdparty/expat/tests/benchmark/Makefile.in40
-rw-r--r--3rdparty/expat/tests/benchmark/benchmark.c73
-rw-r--r--3rdparty/expat/tests/chardata.c22
-rw-r--r--3rdparty/expat/tests/chardata.h5
-rw-r--r--3rdparty/expat/tests/chardata_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/common.c327
-rw-r--r--3rdparty/expat/tests/common.h155
-rw-r--r--3rdparty/expat/tests/common_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/dummy.c261
-rw-r--r--3rdparty/expat/tests/dummy.h150
-rw-r--r--3rdparty/expat/tests/dummy_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/handlers.c1979
-rw-r--r--3rdparty/expat/tests/handlers.h615
-rw-r--r--3rdparty/expat/tests/handlers_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/memcheck.c21
-rw-r--r--3rdparty/expat/tests/memcheck.h4
-rw-r--r--3rdparty/expat/tests/memcheck_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/minicheck.c80
-rw-r--r--3rdparty/expat/tests/minicheck.h84
-rw-r--r--3rdparty/expat/tests/minicheck_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/misc_tests.c709
-rw-r--r--3rdparty/expat/tests/misc_tests.h56
-rw-r--r--3rdparty/expat/tests/misc_tests_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/ns_tests.c754
-rw-r--r--3rdparty/expat/tests/ns_tests.h56
-rw-r--r--3rdparty/expat/tests/ns_tests_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/nsalloc_tests.c1537
-rw-r--r--3rdparty/expat/tests/nsalloc_tests.h56
-rw-r--r--3rdparty/expat/tests/nsalloc_tests_cxx.cpp32
-rw-r--r--3rdparty/expat/tests/runtests.c11607
-rw-r--r--3rdparty/expat/tests/runtests_cxx.cpp (renamed from 3rdparty/expat/tests/runtestspp.cpp)4
-rw-r--r--3rdparty/expat/tests/structdata.c41
-rw-r--r--3rdparty/expat/tests/structdata.h3
-rw-r--r--3rdparty/expat/tests/structdata_cxx.cpp32
-rwxr-xr-x3rdparty/expat/tests/udiffer.py3
-rwxr-xr-x3rdparty/expat/tests/xmltest.sh48
-rw-r--r--3rdparty/expat/win32/README.txt4
-rw-r--r--3rdparty/expat/win32/build_expat_iss.bat12
-rw-r--r--3rdparty/expat/win32/expat.iss57
-rw-r--r--3rdparty/expat/win32/version.rc.cmake17
-rw-r--r--3rdparty/expat/xmlwf/Makefile.am4
-rw-r--r--3rdparty/expat/xmlwf/Makefile.in41
-rw-r--r--3rdparty/expat/xmlwf/codepage.c6
-rw-r--r--3rdparty/expat/xmlwf/codepage.h4
-rw-r--r--3rdparty/expat/xmlwf/ct.c3
-rw-r--r--3rdparty/expat/xmlwf/filemap.h4
-rw-r--r--3rdparty/expat/xmlwf/readfilemap.c31
-rw-r--r--3rdparty/expat/xmlwf/unixfilemap.c6
-rw-r--r--3rdparty/expat/xmlwf/win32filemap.c7
-rw-r--r--3rdparty/expat/xmlwf/xmlfile.c29
-rw-r--r--3rdparty/expat/xmlwf/xmlfile.h7
-rw-r--r--3rdparty/expat/xmlwf/xmlmime.c4
-rw-r--r--3rdparty/expat/xmlwf/xmlmime.h3
-rw-r--r--3rdparty/expat/xmlwf/xmltchar.h7
-rw-r--r--3rdparty/expat/xmlwf/xmlwf.c293
-rwxr-xr-x3rdparty/expat/xmlwf/xmlwf_helpgen.py41
-rwxr-xr-x3rdparty/expat/xmlwf/xmlwf_helpgen.sh5
-rw-r--r--3rdparty/genie/.travis.yml20
-rw-r--r--3rdparty/genie/README.md36
-rw-r--r--3rdparty/genie/build/gmake.darwin/genie.make3
-rw-r--r--3rdparty/genie/build/gmake.freebsd/genie.make163
-rw-r--r--3rdparty/genie/build/gmake.linux/genie.make3
-rw-r--r--3rdparty/genie/build/gmake.solaris/Makefile34
-rw-r--r--3rdparty/genie/build/gmake.solaris/genie.make470
-rw-r--r--3rdparty/genie/build/gmake.windows/genie.make3
-rw-r--r--3rdparty/genie/docs/scripting-reference.md73
-rw-r--r--3rdparty/genie/makefile2
-rw-r--r--3rdparty/genie/scripts/genie.lua2
-rw-r--r--3rdparty/genie/src/_manifest.lua18
-rw-r--r--3rdparty/genie/src/actions/cmake/cmake_project.lua29
-rw-r--r--3rdparty/genie/src/actions/cmake/cmake_workspace.lua40
-rw-r--r--3rdparty/genie/src/actions/fastbuild/_fastbuild.lua44
-rw-r--r--3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua468
-rw-r--r--3rdparty/genie/src/actions/fastbuild/fastbuild_solution.lua195
-rw-r--r--3rdparty/genie/src/actions/jcdb/_jcdb.lua21
-rw-r--r--3rdparty/genie/src/actions/jcdb/jcdb_solution.lua153
-rw-r--r--3rdparty/genie/src/actions/make/_make.lua19
-rw-r--r--3rdparty/genie/src/actions/make/make_cpp.lua4
-rw-r--r--3rdparty/genie/src/actions/make/make_csharp.lua3
-rw-r--r--3rdparty/genie/src/actions/make/make_swift.lua18
-rw-r--r--3rdparty/genie/src/actions/make/make_vala.lua313
-rw-r--r--3rdparty/genie/src/actions/ninja/ninja_cpp.lua124
-rw-r--r--3rdparty/genie/src/actions/qbs/_qbs.lua41
-rw-r--r--3rdparty/genie/src/actions/qbs/qbs_base.lua9
-rw-r--r--3rdparty/genie/src/actions/qbs/qbs_cpp.lua285
-rw-r--r--3rdparty/genie/src/actions/qbs/qbs_solution.lua251
-rw-r--r--3rdparty/genie/src/actions/vstudio/_vstudio.lua57
-rw-r--r--3rdparty/genie/src/actions/vstudio/vs2022.lua (renamed from 3rdparty/genie/src/actions/vstudio/vsllvm.lua)24
-rw-r--r--3rdparty/genie/src/actions/vstudio/vstudio_solution.lua10
-rw-r--r--3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua138
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode10.lua2
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode11.lua91
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode14.lua121
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode15.lua124
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode8.lua16
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode9.lua4
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode_common.lua46
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode_scheme.lua1
-rw-r--r--3rdparty/genie/src/base/api.lua10
-rw-r--r--3rdparty/genie/src/base/bake.lua17
-rw-r--r--3rdparty/genie/src/base/cmdline.lua6
-rw-r--r--3rdparty/genie/src/base/config.lua1
-rw-r--r--3rdparty/genie/src/base/globals.lua20
-rw-r--r--3rdparty/genie/src/base/os.lua3
-rw-r--r--3rdparty/genie/src/base/path.lua10
-rw-r--r--3rdparty/genie/src/base/project.lua31
-rw-r--r--3rdparty/genie/src/host/premake.c2
-rw-r--r--3rdparty/genie/src/host/scripts.c503
-rw-r--r--3rdparty/genie/src/host/version.h5
-rw-r--r--3rdparty/genie/src/tools/gcc.lua19
-rw-r--r--3rdparty/genie/src/tools/valac.lua54
-rw-r--r--3rdparty/genie/tests/actions/vstudio/test_vs2010_flags.lua7
-rw-r--r--3rdparty/genie/tests/actions/vstudio/vc200x/test_mfc.lua98
-rw-r--r--3rdparty/genie/tests/actions/vstudio/vc2010/test_mfc.lua60
-rw-r--r--3rdparty/genie/tests/premake4.lua2
-rw-r--r--3rdparty/lua/Makefile4
-rw-r--r--3rdparty/lua/README2
-rw-r--r--3rdparty/lua/doc/OSIApproved_100X125.pngbin0 -> 12127 bytes
-rw-r--r--3rdparty/lua/doc/contents.html20
-rw-r--r--3rdparty/lua/doc/lua.118
-rw-r--r--3rdparty/lua/doc/lua.css1
-rw-r--r--3rdparty/lua/doc/manual.html355
-rw-r--r--3rdparty/lua/doc/osi-certified-72x60.pngbin3774 -> 0 bytes
-rw-r--r--3rdparty/lua/doc/readme.html53
-rw-r--r--3rdparty/lua/src/Makefile5
-rw-r--r--3rdparty/lua/src/lapi.c253
-rw-r--r--3rdparty/lua/src/lapi.h17
-rw-r--r--3rdparty/lua/src/lauxlib.c84
-rw-r--r--3rdparty/lua/src/lcode.c170
-rw-r--r--3rdparty/lua/src/lcode.h3
-rw-r--r--3rdparty/lua/src/lcorolib.c4
-rw-r--r--3rdparty/lua/src/ldebug.c298
-rw-r--r--3rdparty/lua/src/ldebug.h3
-rw-r--r--3rdparty/lua/src/ldo.c239
-rw-r--r--3rdparty/lua/src/ldo.h18
-rw-r--r--3rdparty/lua/src/ldump.c8
-rw-r--r--3rdparty/lua/src/lfunc.c54
-rw-r--r--3rdparty/lua/src/lfunc.h6
-rw-r--r--3rdparty/lua/src/lgc.c124
-rw-r--r--3rdparty/lua/src/lgc.h19
-rw-r--r--3rdparty/lua/src/liolib.c27
-rw-r--r--3rdparty/lua/src/llex.c6
-rw-r--r--3rdparty/lua/src/llimits.h21
-rw-r--r--3rdparty/lua/src/lmathlib.c41
-rw-r--r--3rdparty/lua/src/lmem.c68
-rw-r--r--3rdparty/lua/src/loadlib.c18
-rw-r--r--3rdparty/lua/src/lobject.c38
-rw-r--r--3rdparty/lua/src/lobject.h37
-rw-r--r--3rdparty/lua/src/lopcodes.h10
-rw-r--r--3rdparty/lua/src/loslib.c38
-rw-r--r--3rdparty/lua/src/lparser.c43
-rw-r--r--3rdparty/lua/src/lstate.c71
-rw-r--r--3rdparty/lua/src/lstate.h28
-rw-r--r--3rdparty/lua/src/lstring.c13
-rw-r--r--3rdparty/lua/src/lstrlib.c2
-rw-r--r--3rdparty/lua/src/ltable.c47
-rw-r--r--3rdparty/lua/src/ltable.h3
-rw-r--r--3rdparty/lua/src/ltablib.c2
-rw-r--r--3rdparty/lua/src/ltm.c38
-rw-r--r--3rdparty/lua/src/lua.c56
-rw-r--r--3rdparty/lua/src/lua.h27
-rw-r--r--3rdparty/lua/src/luac.c6
-rw-r--r--3rdparty/lua/src/luaconf.h22
-rw-r--r--3rdparty/lua/src/lundump.c12
-rw-r--r--3rdparty/lua/src/lundump.h3
-rw-r--r--3rdparty/lua/src/lutf8lib.c27
-rw-r--r--3rdparty/lua/src/lvm.c309
-rw-r--r--3rdparty/lua/src/lvm.h5
-rw-r--r--3rdparty/portmidi/.github/workflows/build.yml47
-rw-r--r--3rdparty/portmidi/.github/workflows/docs.yml28
-rw-r--r--3rdparty/portmidi/.gitignore62
-rw-r--r--3rdparty/portmidi/ALL_BUILD.vcproj128
-rw-r--r--3rdparty/portmidi/CHANGELOG.txt21
-rw-r--r--3rdparty/portmidi/CMakeLists.txt244
-rw-r--r--3rdparty/portmidi/Doxyfile3098
-rw-r--r--3rdparty/portmidi/README.md104
-rw-r--r--3rdparty/portmidi/README.txt18
-rw-r--r--3rdparty/portmidi/ZERO_CHECK.vcproj128
-rw-r--r--3rdparty/portmidi/packaging/PortMidiConfig.cmake.in10
-rw-r--r--3rdparty/portmidi/packaging/portmidi.pc.in11
-rw-r--r--3rdparty/portmidi/pm_cl/README_CL.txt104
-rw-r--r--3rdparty/portmidi/pm_cl/cffi-portmidi.lisp384
-rw-r--r--3rdparty/portmidi/pm_cl/test-no-cm.lisp112
-rw-r--r--3rdparty/portmidi/pm_common/CMakeLists.txt230
-rw-r--r--3rdparty/portmidi/pm_common/pminternal.h59
-rw-r--r--3rdparty/portmidi/pm_common/pmjni.vcproj161
-rw-r--r--3rdparty/portmidi/pm_common/pmutil.c2
-rw-r--r--3rdparty/portmidi/pm_common/pmutil.h198
-rw-r--r--3rdparty/portmidi/pm_common/portmidi-dynamic.vcproj179
-rw-r--r--3rdparty/portmidi/pm_common/portmidi-static.vcproj141
-rw-r--r--3rdparty/portmidi/pm_common/portmidi.c720
-rw-r--r--3rdparty/portmidi/pm_common/portmidi.h908
-rw-r--r--3rdparty/portmidi/pm_csharp/README.txt20
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/AssemblyInfo.cpp40
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/ReadMe.txt31
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/Stdafx.cpp5
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/Stdafx.h7
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/app.icobin1078 -> 0 bytes
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/app.rc63
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.cpp6
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.h53
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.vcproj260
-rw-r--r--3rdparty/portmidi/pm_csharp/pm_managed/resource.h3
-rw-r--r--3rdparty/portmidi/pm_dylib/CMakeLists.txt127
-rw-r--r--3rdparty/portmidi/pm_dylib/README.txt11
-rw-r--r--3rdparty/portmidi/pm_dylib/portmidi-dynamic.vcproj158
-rw-r--r--3rdparty/portmidi/pm_haiku/pmhaiku.cpp514
-rw-r--r--3rdparty/portmidi/pm_java/CMakeLists.txt129
-rw-r--r--3rdparty/portmidi/pm_java/JavaExe.exebin131072 -> 0 bytes
-rw-r--r--3rdparty/portmidi/pm_java/README.txt85
-rw-r--r--3rdparty/portmidi/pm_java/UpdateRsrcJavaExe.exebin102400 -> 0 bytes
-rw-r--r--3rdparty/portmidi/pm_java/jportmidi/JPortMidi.java2
-rw-r--r--3rdparty/portmidi/pm_java/mac-make.sh26
-rw-r--r--3rdparty/portmidi/pm_java/pmdefaults-setup-script.iss44
-rw-r--r--3rdparty/portmidi/pm_java/pmdefaults/PmDefaults.java8
-rw-r--r--3rdparty/portmidi/pm_java/pmdefaults/README.txt19
-rw-r--r--3rdparty/portmidi/pm_java/pmdefaults/pmdefaults9
-rw-r--r--3rdparty/portmidi/pm_java/pmdefaults/pmdefaults-license.txt2
-rw-r--r--3rdparty/portmidi/pm_java/pmdefaults/pmdefaults.bat1
-rw-r--r--3rdparty/portmidi/pm_java/pmdefaults/readme-win32.txt11
-rw-r--r--3rdparty/portmidi/pm_java/pmjni/pmjni-VC8.vcproj225
-rw-r--r--3rdparty/portmidi/pm_java/pmjni/pmjni.c4
-rw-r--r--3rdparty/portmidi/pm_java/setup/pmdefaults-setup.exebin485013 -> 0 bytes
-rw-r--r--3rdparty/portmidi/pm_linux/README_LINUX.txt56
-rw-r--r--3rdparty/portmidi/pm_linux/finddefault.c30
-rw-r--r--3rdparty/portmidi/pm_linux/finddefault.h5
-rw-r--r--3rdparty/portmidi/pm_linux/pmlinux.c30
-rw-r--r--3rdparty/portmidi/pm_linux/pmlinuxalsa.c605
-rw-r--r--3rdparty/portmidi/pm_linux/pmlinuxnull.c31
-rw-r--r--3rdparty/portmidi/pm_linux/pmlinuxnull.h6
-rw-r--r--3rdparty/portmidi/pm_mac/Makefile.osx8
-rw-r--r--3rdparty/portmidi/pm_mac/README_MAC.txt231
-rw-r--r--3rdparty/portmidi/pm_mac/finddefault.c4
-rw-r--r--3rdparty/portmidi/pm_mac/osxsupport.h18
-rw-r--r--3rdparty/portmidi/pm_mac/osxsupport.m37
-rw-r--r--3rdparty/portmidi/pm_mac/pm_mac.xcodeproj/project.pbxproj594
-rw-r--r--3rdparty/portmidi/pm_mac/pmdefaults/make/build.xml87
-rw-r--r--3rdparty/portmidi/pm_mac/pmdefaults/make/find-classrefs.sh31
-rw-r--r--3rdparty/portmidi/pm_mac/pmdefaults/resources/English.lproj/Credits.rtf14
-rw-r--r--3rdparty/portmidi/pm_mac/pmdefaults/resources/English.lproj/InfoPlist.stringsbin220 -> 0 bytes
-rw-r--r--3rdparty/portmidi/pm_mac/pmdefaults/resources/Info.plist40
-rw-r--r--3rdparty/portmidi/pm_mac/pmdefaults/resources/Manifest1
-rw-r--r--3rdparty/portmidi/pm_mac/pmmac.c7
-rw-r--r--3rdparty/portmidi/pm_mac/pmmac.h2
-rw-r--r--3rdparty/portmidi/pm_mac/pmmacosxcm.c1310
-rw-r--r--3rdparty/portmidi/pm_mac/pmmacosxcm.h2
-rw-r--r--3rdparty/portmidi/pm_mac/readbinaryplist.c159
-rw-r--r--3rdparty/portmidi/pm_mac/readbinaryplist.h10
-rw-r--r--3rdparty/portmidi/pm_mingw/README-MINGW.txt11
-rw-r--r--3rdparty/portmidi/pm_mingw/eclipse/README.txt23
-rw-r--r--3rdparty/portmidi/pm_mingw/eclipse/dot-cproject710
-rw-r--r--3rdparty/portmidi/pm_mingw/eclipse/dot-project69
-rw-r--r--3rdparty/portmidi/pm_mingw/msys/README-MSYS.txt8
-rw-r--r--3rdparty/portmidi/pm_python/README_PYTHON.txt34
-rw-r--r--3rdparty/portmidi/pm_python/pyportmidi/__init__.py3
-rw-r--r--3rdparty/portmidi/pm_python/pyportmidi/_pyportmidi.c5663
-rw-r--r--3rdparty/portmidi/pm_python/pyportmidi/_pyportmidi.pyx537
-rw-r--r--3rdparty/portmidi/pm_python/pyportmidi/midi.py566
-rw-r--r--3rdparty/portmidi/pm_python/setup.py185
-rw-r--r--3rdparty/portmidi/pm_qt/README_QT.txt15
-rw-r--r--3rdparty/portmidi/pm_qt/portmidi.pro47
-rw-r--r--3rdparty/portmidi/pm_test/CMakeLists.txt52
-rw-r--r--3rdparty/portmidi/pm_test/README.txt376
-rw-r--r--3rdparty/portmidi/pm_test/fast.c290
-rw-r--r--3rdparty/portmidi/pm_test/fastrcv.c255
-rw-r--r--3rdparty/portmidi/pm_test/latency.c25
-rw-r--r--3rdparty/portmidi/pm_test/latency.vcproj148
-rw-r--r--3rdparty/portmidi/pm_test/midiclock.c23
-rw-r--r--3rdparty/portmidi/pm_test/midiclock.vcproj148
-rw-r--r--3rdparty/portmidi/pm_test/midithread.c60
-rw-r--r--3rdparty/portmidi/pm_test/midithread.vcproj148
-rw-r--r--3rdparty/portmidi/pm_test/midithru.c211
-rw-r--r--3rdparty/portmidi/pm_test/midithru.vcproj148
-rw-r--r--3rdparty/portmidi/pm_test/mm.c31
-rw-r--r--3rdparty/portmidi/pm_test/mm.vcproj148
-rw-r--r--3rdparty/portmidi/pm_test/multivirtual.c224
-rw-r--r--3rdparty/portmidi/pm_test/pmlist.c63
-rw-r--r--3rdparty/portmidi/pm_test/qtest.vcproj148
-rw-r--r--3rdparty/portmidi/pm_test/recvvirtual.c125
-rw-r--r--3rdparty/portmidi/pm_test/sendvirtual.c148
-rw-r--r--3rdparty/portmidi/pm_test/sysex.c84
-rw-r--r--3rdparty/portmidi/pm_test/sysex.vcproj148
-rw-r--r--3rdparty/portmidi/pm_test/test.vcproj148
-rw-r--r--3rdparty/portmidi/pm_test/testio.c (renamed from 3rdparty/portmidi/pm_test/test.c)294
-rw-r--r--3rdparty/portmidi/pm_test/virttest.c339
-rw-r--r--3rdparty/portmidi/pm_win/README_WIN.txt201
-rw-r--r--3rdparty/portmidi/pm_win/clean_cmake.bat6
-rw-r--r--3rdparty/portmidi/pm_win/clean_up_vcproj.awk70
-rw-r--r--3rdparty/portmidi/pm_win/clean_up_vcproj.bat76
-rw-r--r--3rdparty/portmidi/pm_win/pmwin.c46
-rw-r--r--3rdparty/portmidi/pm_win/pmwinmm.c893
-rw-r--r--3rdparty/portmidi/pm_win/pmwinmm.h2
-rw-r--r--3rdparty/portmidi/pm_win/static.cmake8
-rw-r--r--3rdparty/portmidi/portmidi.sln147
-rw-r--r--3rdparty/portmidi/portmidi_cdt.zipbin210271 -> 0 bytes
-rw-r--r--3rdparty/portmidi/porttime/porttime-VC8.vcproj225
-rw-r--r--3rdparty/portmidi/porttime/porttime.dsp104
-rw-r--r--3rdparty/portmidi/porttime/porttime.h58
-rw-r--r--3rdparty/portmidi/porttime/porttime.vcproj184
-rw-r--r--3rdparty/portmidi/porttime/pthaiku.cpp88
-rw-r--r--3rdparty/portmidi/porttime/ptlinux.c26
-rw-r--r--3rdparty/portmidi/porttime/ptmacosx_cf.c6
-rw-r--r--3rdparty/portmidi/porttime/ptmacosx_mach.c97
-rw-r--r--3rdparty/portmidi/porttime/ptwinmm.c6
-rw-r--r--3rdparty/softfloat/mamesf.h9
-rw-r--r--3rdparty/softfloat/milieu.h6
-rw-r--r--3rdparty/softfloat3/bochs_ext/extF80_scale.c156
-rw-r--r--3rdparty/softfloat3/bochs_ext/f2xm1.c491
-rw-r--r--3rdparty/softfloat3/bochs_ext/fpatan.c331
-rw-r--r--3rdparty/softfloat3/bochs_ext/fprem.c255
-rw-r--r--3rdparty/softfloat3/bochs_ext/fpu_constant.h80
-rw-r--r--3rdparty/softfloat3/bochs_ext/fsincos.c457
-rw-r--r--3rdparty/softfloat3/bochs_ext/fyl2x.c409
-rw-r--r--3rdparty/softfloat3/bochs_ext/poly.c91
-rw-r--r--3rdparty/softfloat3/bochs_ext/softfloat-extra.h68
-rw-r--r--3rdparty/softfloat3/bochs_ext/softfloat-helpers.h159
-rw-r--r--3rdparty/softfloat3/bochs_ext/softfloat-specialize.h223
-rw-r--r--3rdparty/softfloat3/bochs_ext/softfloat3_ext.h21
-rw-r--r--3rdparty/softfloat3/build/MAME/platform.h21
-rw-r--r--3rdparty/softfloat3/source/include/softfloat.h46
-rw-r--r--3rdparty/softfloat3/source/include/softfloat_types.h7
-rw-r--r--3rdparty/sol2/sol/sol.hpp25
-rw-r--r--3rdparty/ymfm/examples/buildall/buildall.cpp (renamed from 3rdparty/ymfm/buildall.cpp)0
-rw-r--r--3rdparty/ymfm/src/ymfm.h21
-rw-r--r--3rdparty/ymfm/src/ymfm_fm.h4
-rw-r--r--3rdparty/ymfm/src/ymfm_fm.ipp14
-rw-r--r--3rdparty/ymfm/src/ymfm_misc.h1
-rw-r--r--3rdparty/ymfm/src/ymfm_opl.cpp44
-rw-r--r--3rdparty/ymfm/src/ymfm_opl.h4
-rw-r--r--3rdparty/ymfm/src/ymfm_opm.cpp20
-rw-r--r--3rdparty/ymfm/src/ymfm_opn.cpp29
-rw-r--r--3rdparty/ymfm/src/ymfm_opn.h2
-rw-r--r--3rdparty/ymfm/src/ymfm_opq.cpp12
-rw-r--r--3rdparty/ymfm/src/ymfm_opx.h290
-rw-r--r--3rdparty/ymfm/src/ymfm_opz.cpp36
-rw-r--r--3rdparty/ymfm/src/ymfm_pcm.cpp1
-rw-r--r--3rdparty/ymfm/src/ymfm_ssg.h2
-rw-r--r--3rdparty/zlib/CMakeLists.txt43
-rw-r--r--3rdparty/zlib/ChangeLog10
-rw-r--r--3rdparty/zlib/FAQ3
-rw-r--r--3rdparty/zlib/Makefile.in16
-rw-r--r--3rdparty/zlib/README6
-rw-r--r--3rdparty/zlib/configure9
-rw-r--r--3rdparty/zlib/contrib/delphi/ZLib.pas2
-rw-r--r--3rdparty/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs2
-rw-r--r--3rdparty/zlib/contrib/dotzlib/DotZLib/UnitTests.cs2
-rw-r--r--3rdparty/zlib/contrib/infback9/inftree9.c6
-rw-r--r--3rdparty/zlib/contrib/infback9/inftree9.h4
-rw-r--r--3rdparty/zlib/contrib/iostream3/zfstream.h4
-rw-r--r--3rdparty/zlib/contrib/minizip/Makefile2
-rw-r--r--3rdparty/zlib/contrib/minizip/configure.ac2
-rw-r--r--3rdparty/zlib/contrib/minizip/ioapi.h2
-rw-r--r--3rdparty/zlib/contrib/minizip/miniunz.c18
-rw-r--r--3rdparty/zlib/contrib/minizip/unzip.c8
-rw-r--r--3rdparty/zlib/contrib/minizip/unzip.h2
-rw-r--r--3rdparty/zlib/contrib/minizip/zip.c21
-rw-r--r--3rdparty/zlib/contrib/minizip/zip.h4
-rw-r--r--3rdparty/zlib/contrib/nuget/nuget.csproj43
-rw-r--r--3rdparty/zlib/contrib/nuget/nuget.sln22
-rw-r--r--3rdparty/zlib/contrib/pascal/zlibpas.pas2
-rw-r--r--3rdparty/zlib/contrib/puff/puff.c8
-rw-r--r--3rdparty/zlib/contrib/vstudio/readme.txt10
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc10/zlib.rc8
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc10/zlibvc.def2
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc11/zlib.rc8
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc11/zlibvc.def2
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc12/zlib.rc8
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc12/zlibvc.def2
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc14/zlib.rc8
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc14/zlibvc.def2
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc17/miniunz.vcxproj409
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc17/minizip.vcxproj405
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc17/testzlib.vcxproj473
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj409
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc17/zlib.rc32
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc17/zlibstat.vcxproj602
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc17/zlibvc.def158
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc17/zlibvc.sln179
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc17/zlibvc.vcxproj875
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc9/zlib.rc8
-rw-r--r--3rdparty/zlib/contrib/vstudio/vc9/zlibvc.def2
-rw-r--r--3rdparty/zlib/deflate.c47
-rw-r--r--3rdparty/zlib/deflate.h35
-rw-r--r--3rdparty/zlib/doc/algorithm.txt2
-rw-r--r--3rdparty/zlib/examples/gzlog.c4
-rw-r--r--3rdparty/zlib/examples/zran.c2
-rw-r--r--3rdparty/zlib/gzguts.h8
-rw-r--r--3rdparty/zlib/gzlib.c12
-rw-r--r--3rdparty/zlib/inflate.c2
-rw-r--r--3rdparty/zlib/inftrees.c6
-rw-r--r--3rdparty/zlib/inftrees.h4
-rw-r--r--3rdparty/zlib/old/visual-basic.txt2
-rw-r--r--3rdparty/zlib/os400/README4002
-rw-r--r--3rdparty/zlib/os400/zlib.inc6
-rw-r--r--3rdparty/zlib/qnx/package.qpg10
-rw-r--r--3rdparty/zlib/test/example.c25
-rw-r--r--3rdparty/zlib/test/minigzip.c32
-rw-r--r--3rdparty/zlib/treebuild.xml4
-rw-r--r--3rdparty/zlib/trees.c20
-rw-r--r--3rdparty/zlib/win32/DLL_FAQ.txt20
-rw-r--r--3rdparty/zlib/win32/README-WIN32.txt8
-rw-r--r--3rdparty/zlib/zconf.h10
-rw-r--r--3rdparty/zlib/zconf.h.cmakein10
-rw-r--r--3rdparty/zlib/zconf.h.in10
-rw-r--r--3rdparty/zlib/zlib.36
-rw-r--r--3rdparty/zlib/zlib.3.pdfbin19505 -> 25523 bytes
-rw-r--r--3rdparty/zlib/zlib.h22
-rw-r--r--3rdparty/zlib/zutil.h27
2138 files changed, 178368 insertions, 131812 deletions
diff --git a/3rdparty/asio/COPYING b/3rdparty/asio/COPYING
index 532cec6c8f9..da1a2db4d7b 100644
--- a/3rdparty/asio/COPYING
+++ b/3rdparty/asio/COPYING
@@ -1,4 +1,4 @@
-Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
diff --git a/3rdparty/asio/Makefile.am b/3rdparty/asio/Makefile.am
index 0acdc02d9a1..bc4f75b3553 100644
--- a/3rdparty/asio/Makefile.am
+++ b/3rdparty/asio/Makefile.am
@@ -1,5 +1,8 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip
+pkgconfig_DATA = asio.pc
+pkgconfigdir = $(libdir)/pkgconfig
+
SUBDIRS = include src
MAINTAINERCLEANFILES = \
diff --git a/3rdparty/asio/Makefile.in b/3rdparty/asio/Makefile.in
index 6d79b0ec1d4..e3f325123c4 100644
--- a/3rdparty/asio/Makefile.in
+++ b/3rdparty/asio/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -13,6 +13,7 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
@@ -97,7 +98,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = asio.pc
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -126,6 +127,35 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
+DATA = $(pkgconfig_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
@@ -151,12 +181,10 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in COPYING INSTALL README compile \
- config.guess config.sub depcomp install-sh missing
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/asio.pc.in COPYING \
+ INSTALL README compile config.guess config.sub depcomp \
+ install-sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -195,6 +223,8 @@ am__relativize = \
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).zip
GZIP_ENV = --best
DIST_TARGETS = dist-bzip2 dist-gzip dist-zip
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -210,8 +240,9 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
-CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -220,9 +251,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
-GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -289,9 +319,11 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgconfigdir = $(libdir)/pkgconfig
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -301,6 +333,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip
+pkgconfig_DATA = asio.pc
SUBDIRS = include src
MAINTAINERCLEANFILES = \
$(srcdir)/aclocal.m4 \
@@ -354,6 +387,29 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
+asio.pc: $(top_builddir)/config.status $(srcdir)/asio.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+install-pkgconfigDATA: $(pkgconfig_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+ done
+
+uninstall-pkgconfigDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
@@ -460,7 +516,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -543,6 +598,10 @@ dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
+dist-zstd: distdir
+ tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+ $(am__post_remove_distdir)
+
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@@ -584,6 +643,8 @@ distcheck: dist
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
+ *.tar.zst*) \
+ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
@@ -599,7 +660,7 @@ distcheck: dist
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
@@ -652,9 +713,12 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-recursive
-all-am: Makefile
+all-am: Makefile $(DATA)
installdirs: installdirs-recursive
installdirs-am:
+ for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
@@ -707,7 +771,7 @@ info: info-recursive
info-am:
-install-data-am:
+install-data-am: install-pkgconfigDATA
install-dvi: install-dvi-recursive
@@ -753,7 +817,7 @@ ps: ps-recursive
ps-am:
-uninstall-am:
+uninstall-am: uninstall-pkgconfigDATA
.MAKE: $(am__recursive_targets) install-am install-strip
@@ -761,16 +825,17 @@ uninstall-am:
am--refresh check check-am clean clean-cscope clean-generic \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
- distcheck distclean distclean-generic distclean-tags \
+ dist-zstd distcheck distclean distclean-generic distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
- pdf-am ps ps-am tags tags-am uninstall uninstall-am
+ install-pkgconfigDATA install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-pkgconfigDATA
.PRECIOUS: Makefile
diff --git a/3rdparty/asio/README b/3rdparty/asio/README
index a5aa5cb4cf1..7c7d49dd49e 100644
--- a/3rdparty/asio/README
+++ b/3rdparty/asio/README
@@ -1,4 +1,4 @@
-asio version 1.20.0
-Released Saturday, 16 October 2021.
+asio version 1.30.2
+Released Tuesday, 16 April 2024.
See doc/index.html for API documentation and a tutorial.
diff --git a/3rdparty/asio/aclocal.m4 b/3rdparty/asio/aclocal.m4
index a49964a8b44..00ffbd53c14 100644
--- a/3rdparty/asio/aclocal.m4
+++ b/3rdparty/asio/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,13 +14,289 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $2])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
+
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,7 +311,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.16.1], [],
+m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +327,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.1])dnl
+[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +386,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -141,7 +417,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -332,7 +608,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -371,7 +647,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. Try re-running configure with the
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE="gmake" (or whatever is
+ necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
@@ -398,7 +676,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -426,6 +704,10 @@ m4_defn([AC_PROG_CC])
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
+m4_ifdef([_$0_ALREADY_INIT],
+ [m4_fatal([$0 expanded multiple times
+]m4_defn([_$0_ALREADY_INIT]))],
+ [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -462,7 +744,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
@@ -514,6 +796,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+AC_SUBST([CTAGS])
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+AC_SUBST([ETAGS])
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+AC_SUBST([CSCOPE])
+
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
@@ -595,7 +891,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -616,7 +912,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2018 Free Software Foundation, Inc.
+# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -638,7 +934,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -673,7 +969,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -716,7 +1012,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -737,12 +1033,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
@@ -755,7 +1046,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -784,7 +1075,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -831,7 +1122,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -850,7 +1141,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -931,7 +1222,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -991,7 +1282,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1019,7 +1310,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2018 Free Software Foundation, Inc.
+# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1038,7 +1329,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2018 Free Software Foundation, Inc.
+# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/3rdparty/asio/asio.pc.in b/3rdparty/asio/asio.pc.in
new file mode 100644
index 00000000000..b93eb673dac
--- /dev/null
+++ b/3rdparty/asio/asio.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Description: A cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach.
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
+Lflags:
+Requires:
+Requires.private:
diff --git a/3rdparty/asio/compile b/3rdparty/asio/compile
index 531136b068e..df363c8fbfb 100755
--- a/3rdparty/asio/compile
+++ b/3rdparty/asio/compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
@@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/3rdparty/asio/config.guess b/3rdparty/asio/config.guess
index 9afd6762064..e81d3ae7c21 100755
--- a/3rdparty/asio/config.guess
+++ b/3rdparty/asio/config.guess
@@ -1,8 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright 1992-2021 Free Software Foundation, Inc.
-timestamp='2013-11-29'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2021-06-03'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@ timestamp='2013-11-29'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -24,12 +26,20 @@ timestamp='2013-11-29'
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
-# Originally written by Per Bothner.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
+
+
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -39,7 +49,7 @@ Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -50,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,7 +94,8 @@ if test $# != 0; then
exit 1
fi
-trap 'exit 1' 1 2 15
+# Just in case it came from the environment.
+GUESS=
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
@@ -96,66 +107,90 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team.
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+ # prevent multiple calls if $tmp is already set
+ test "$tmp" && return 0
+ : "${TMPDIR=/tmp}"
+ # shellcheck disable=SC2039,SC3028
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+ dummy=$tmp/dummy
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+ ,,) echo "int x;" > "$dummy.c"
+ for driver in cc gcc c89 c99 ; do
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD=$driver
+ break
+ fi
+ done
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+ esac
+}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
+case $UNAME_SYSTEM in
Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
+ LIBC=unknown
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
+ set_cc_for_build
+ cat <<-EOF > "$dummy.c"
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
- #else
+ #elif defined(__GLIBC__)
LIBC=gnu
+ #else
+ #include <stdarg.h>
+ /* First heuristic to detect musl libc. */
+ #ifdef __DEFINED_va_list
+ LIBC=musl
+ #endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "$cc_set_libc"
+
+ # Second heuristic to detect musl libc.
+ if [ "$LIBC" = unknown ] &&
+ command -v ldd >/dev/null &&
+ ldd --version 2>&1 | grep -q ^musl; then
+ LIBC=musl
+ fi
+
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ if [ "$LIBC" = unknown ]; then
+ LIBC=gnu
+ fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -167,22 +202,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ echo unknown)`
+ case $UNAME_MACHINE_ARCH in
+ aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ earmv*)
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine=${arch}${endian}-unknown
+ ;;
+ *) machine=$UNAME_MACHINE_ARCH-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
+ # to ELF recently (or will in the future) and ABI.
+ case $UNAME_MACHINE_ARCH in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
@@ -197,45 +242,80 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
os=netbsd
;;
esac
+ # Determine ABI tags.
+ case $UNAME_MACHINE_ARCH in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+ ;;
+ esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
+ case $UNAME_VERSION in
Debian*)
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
+ GUESS=$machine-${os}${release}${abi-}
+ ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
+ ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
+ ;;
+ *:SecBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
+ ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
+ ;;
+ *:MidnightBSD:*:*)
+ GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
+ ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
+ ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
+ ;;
+ *:OS108:*:*)
+ GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
+ ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
+ ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
+ ;;
+ *:Sortix:*:*)
+ GUESS=$UNAME_MACHINE-unknown-sortix
+ ;;
+ *:Twizzler:*:*)
+ GUESS=$UNAME_MACHINE-unknown-twizzler
+ ;;
+ *:Redox:*:*)
+ GUESS=$UNAME_MACHINE-unknown-redox
+ ;;
+ mips:OSF1:*.*)
+ GUESS=mips-dec-osf1
+ ;;
alpha:OSF1:*:*)
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ trap '' 0
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -249,163 +329,158 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
+ case $ALPHA_CPU_TYPE in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
+ OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
+ ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
+ GUESS=m68k-unknown-sysv4
+ ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-amigaos
+ ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-morphos
+ ;;
*:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
+ GUESS=i370-ibm-openedition
+ ;;
*:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
+ GUESS=s390-ibm-zvmoe
+ ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
+ GUESS=powerpc-ibm-os400
+ ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
+ GUESS=arm-acorn-riscix$UNAME_RELEASE
+ ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
+ GUESS=arm-unknown-riscos
+ ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
+ GUESS=hppa1.1-hitachi-hiuxmpp
+ ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
+ case `(/bin/universe) 2>/dev/null` in
+ att) GUESS=pyramid-pyramid-sysv3 ;;
+ *) GUESS=pyramid-pyramid-bsd ;;
+ esac
+ ;;
NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
+ GUESS=pyramid-pyramid-svr4
+ ;;
DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
+ GUESS=sparc-icl-nx6
+ ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
+ sparc) GUESS=sparc-icl-nx7 ;;
+ esac
+ ;;
s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
+ ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-hal-solaris2$SUN_REL
+ ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris2$SUN_REL
+ ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-pc-auroraux$UNAME_RELEASE
+ ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
+ set_cc_for_build
+ SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
- SUN_ARCH="x86_64"
+ SUN_ARCH=x86_64
fi
fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
+ ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris3$SUN_REL
+ ;;
sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
+ case `/usr/bin/arch -k` in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
+ GUESS=sparc-sun-sunos$SUN_REL
+ ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
+ ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
+ case `/bin/arch` in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
+ GUESS=sparc-sun-sunos$UNAME_RELEASE
;;
esac
- exit ;;
+ ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-auspex-sunos$UNAME_RELEASE
+ ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -415,44 +490,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-milan-mint$UNAME_RELEASE
+ ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-hades-mint$UNAME_RELEASE
+ ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-unknown-mint$UNAME_RELEASE
+ ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-apple-machten$UNAME_RELEASE
+ ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-apple-machten$UNAME_RELEASE
+ ;;
RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
+ GUESS=mips-dec-mach_bsd4.3
+ ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-dec-ultrix$UNAME_RELEASE
+ ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ GUESS=vax-dec-ultrix$UNAME_RELEASE
+ ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
+ GUESS=clipper-intergraph-clix$UNAME_RELEASE
+ ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
@@ -461,95 +536,96 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-mips-riscos$UNAME_RELEASE
+ ;;
Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
+ GUESS=powerpc-motorola-powermax
+ ;;
Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
+ GUESS=powerpc-harris-powerunix
+ ;;
m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
+ GUESS=m88k-harris-cxux7
+ ;;
m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
+ GUESS=m88k-motorola-sysv4
+ ;;
m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
+ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
+ test "$TARGET_BINARY_INTERFACE"x = x
then
- echo m88k-dg-dgux${UNAME_RELEASE}
+ GUESS=m88k-dg-dgux$UNAME_RELEASE
else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ GUESS=i586-dg-dgux$UNAME_RELEASE
fi
- exit ;;
+ ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
+ GUESS=m88k-dolphin-sysv3
+ ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
+ GUESS=m88k-tektronix-sysv3
+ ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
+ GUESS=m68k-tektronix-bsd
+ ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
+ IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
+ GUESS=mips-sgi-irix$IRIX_REL
+ ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
+ GUESS=i386-ibm-aix
+ ;;
ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
+ if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
+ ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
main()
@@ -560,76 +636,77 @@ EOF
exit(0);
}
EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
- echo "$SYSTEM_NAME"
+ GUESS=$SYSTEM_NAME
else
- echo rs6000-ibm-aix3.2.5
+ GUESS=rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
+ GUESS=rs6000-ibm-aix3.2.4
else
- echo rs6000-ibm-aix3.2
+ GUESS=rs6000-ibm-aix3.2
fi
- exit ;;
+ ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
+ if test -x /usr/bin/lslpp ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
+ GUESS=$IBM_ARCH-ibm-aix$IBM_REV
+ ;;
*:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
+ GUESS=rs6000-ibm-aix
+ ;;
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
+ GUESS=romp-ibm-bsd4.4
+ ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
+ GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
+ ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
+ GUESS=rs6000-bull-bosx
+ ;;
DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
+ GUESS=m68k-bull-sysv3
+ ;;
9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
+ GUESS=m68k-hp-bsd
+ ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
+ GUESS=m68k-hp-bsd4.4
+ ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+ case $UNAME_MACHINE in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
+ if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ case $sc_cpu_version in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ case $sc_kernel_bits in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ if test "$HP_ARCH" = ""; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include <stdlib.h>
@@ -662,13 +739,13 @@ EOF
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if test "$HP_ARCH" = hppa2.0w
then
- eval $set_cc_for_build
+ set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -679,23 +756,23 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
+ GUESS=$HP_ARCH-hp-hpux$HPUX_REV
+ ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+ GUESS=ia64-hp-hpux$HPUX_REV
+ ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h>
int
main ()
@@ -720,38 +797,38 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
+ GUESS=unknown-hitachi-hiuxwe2
+ ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
+ GUESS=hppa1.1-hp-bsd
+ ;;
9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
+ GUESS=hppa1.0-hp-bsd
+ ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-mpeix
+ ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
+ GUESS=hppa1.1-hp-osf
+ ;;
hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-osf
+ ;;
i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ if test -x /usr/sbin/sysversion ; then
+ GUESS=$UNAME_MACHINE-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ GUESS=$UNAME_MACHINE-unknown-osf1
fi
- exit ;;
+ ;;
parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
+ GUESS=hppa1.1-hp-lites
+ ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
+ GUESS=c1-convex-bsd
+ ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
@@ -759,139 +836,145 @@ EOF
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
+ GUESS=c34-convex-bsd
+ ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
+ GUESS=c38-convex-bsd
+ ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
+ GUESS=c4-convex-bsd
+ ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=ymp-cray-unicos$CRAY_REL
+ ;;
CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=t90-cray-unicos$CRAY_REL
+ ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=alphaev5-cray-unicosmk$CRAY_REL
+ ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=sv1-cray-unicos$CRAY_REL
+ ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=craynv-cray-unicosmp$CRAY_REL
+ ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
+ GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
+ ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-unknown-bsdi$UNAME_RELEASE
+ ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
+ ;;
+ arm:FreeBSD:*:*)
+ UNAME_PROCESSOR=`uname -p`
+ set_cc_for_build
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
+ else
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
+ fi
+ ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
+ case $UNAME_PROCESSOR in
amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
esac
- exit ;;
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
+ ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-cygwin
+ ;;
*:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw64
+ ;;
*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw32
+ ;;
+ *:MSYS*:*)
+ GUESS=$UNAME_MACHINE-pc-msys
+ ;;
i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-pw32
+ ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case $UNAME_MACHINE in
x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=i586-pc-interix$UNAME_RELEASE
+ ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=x86_64-unknown-interix$UNAME_RELEASE
+ ;;
IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=ia64-unknown-interix$UNAME_RELEASE
+ ;;
esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-uwin
+ ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
+ GUESS=x86_64-pc-cygwin
+ ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=powerpcle-unknown-solaris2$SUN_REL
+ ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
+ GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
+ GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
+ ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
+ GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
+ ;;
+ *:Minix:*:*)
+ GUESS=$UNAME_MACHINE-unknown-minix
+ ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -901,172 +984,226 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
arm*:Linux:*:*)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
fi
fi
- exit ;;
+ ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
+ e2k:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBC
+ ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ k1om:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ IS_GLIBC=0
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
+ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
+ #undef mips
+ #undef mipsel
+ #undef mips64
+ #undef mips64el
+ #if ${IS_GLIBC} && defined(_ABI64)
+ LIBCABI=gnuabi64
+ #else
+ #if ${IS_GLIBC} && defined(_ABIN32)
+ LIBCABI=gnuabin32
+ #else
+ LIBCABI=${LIBC}
+ #endif
+ #endif
+
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa64r6
+ #else
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa32r6
+ #else
+ #if defined(__mips64)
+ CPU=mips64
+ #else
+ CPU=mips
+ #endif
+ #endif
+ #endif
+
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
+ MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
+ MIPS_ENDIAN=
#else
- CPU=
+ MIPS_ENDIAN=
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
+ eval "$cc_set_vars"
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
+ ;;
+ mips64el:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ openrisc*:Linux:*:*)
+ GUESS=or1k-unknown-linux-$LIBC
+ ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
- exit ;;
+ GUESS=sparc-unknown-linux-$LIBC
+ ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
+ GUESS=hppa64-unknown-linux-$LIBC
+ ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
+ PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
+ *) GUESS=hppa-unknown-linux-$LIBC ;;
esac
- exit ;;
+ ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpc64-unknown-linux-$LIBC
+ ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpc-unknown-linux-$LIBC
+ ;;
ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpc64le-unknown-linux-$LIBC
+ ;;
ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpcle-unknown-linux-$LIBC
+ ;;
+ riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
+ ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-dec-linux-$LIBC
+ ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ set_cc_for_build
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_X32 >/dev/null
+ then
+ LIBCABI=${LIBC}x32
+ fi
+ fi
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
+ ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
+ GUESS=i386-sequent-sysv4
+ ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
+ ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-os2-emx
+ ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-stop
+ ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-atheos
+ ;;
i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-syllable
+ ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-unknown-lynxos$UNAME_RELEASE
+ ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ GUESS=$UNAME_MACHINE-pc-msdosdjgpp
+ ;;
+ i*86:*:4.*:*)
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
fi
- exit ;;
+ ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
@@ -1074,12 +1211,12 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1089,43 +1226,43 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
else
- echo ${UNAME_MACHINE}-pc-sysv32
+ GUESS=$UNAME_MACHINE-pc-sysv32
fi
- exit ;;
+ ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
+ GUESS=i586-pc-msdosdjgpp
+ ;;
Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
+ GUESS=i386-pc-mach3
+ ;;
paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
+ GUESS=i860-intel-osf1
+ ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
fi
- exit ;;
+ ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
- echo m68010-convergent-sysv
- exit ;;
+ GUESS=m68010-convergent-sysv
+ ;;
mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
+ GUESS=m68k-convergent-sysv
+ ;;
M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
+ GUESS=m68k-diab-dnix
+ ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
@@ -1133,9 +1270,9 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
@@ -1144,238 +1281,281 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-unknown-lynxos$UNAME_RELEASE
+ ;;
mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
+ GUESS=m68k-atari-sysv4
+ ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-unknown-lynxos$UNAME_RELEASE
+ ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
+ ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
+ ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-dde-sysv$UNAME_RELEASE
+ ;;
RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
+ GUESS=$UNAME_MACHINE-sni-sysv4
else
- echo ns32k-sni-sysv
+ GUESS=ns32k-sni-sysv
fi
- exit ;;
+ ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ GUESS=i586-unisys-sysv4
+ ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
+ GUESS=hppa1.1-stratus-sysv4
+ ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
+ GUESS=i860-stratus-sysv4
+ ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
+ GUESS=$UNAME_MACHINE-stratus-vos
+ ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
+ GUESS=hppa1.1-stratus-vos
+ ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-apple-aux$UNAME_RELEASE
+ ;;
news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
+ GUESS=mips-sony-newsos6
+ ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ if test -d /usr/nec; then
+ GUESS=mips-nec-sysv$UNAME_RELEASE
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ GUESS=mips-unknown-sysv$UNAME_RELEASE
fi
- exit ;;
+ ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
+ GUESS=powerpc-be-beos
+ ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
+ GUESS=powerpc-apple-beos
+ ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
+ GUESS=i586-pc-beos
+ ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
+ GUESS=i586-pc-haiku
+ ;;
x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
+ GUESS=x86_64-unknown-haiku
+ ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx4-nec-superux$UNAME_RELEASE
+ ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx5-nec-superux$UNAME_RELEASE
+ ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx6-nec-superux$UNAME_RELEASE
+ ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx7-nec-superux$UNAME_RELEASE
+ ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx8-nec-superux$UNAME_RELEASE
+ ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx8r-nec-superux$UNAME_RELEASE
+ ;;
+ SX-ACE:SUPER-UX:*:*)
+ GUESS=sxace-nec-superux$UNAME_RELEASE
+ ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
+ ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
+ ;;
+ arm64:Darwin:*:*)
+ GUESS=aarch64-apple-darwin$UNAME_RELEASE
+ ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
+ UNAME_PROCESSOR=`uname -p`
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ if command -v xcode-select > /dev/null 2> /dev/null && \
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+ # Avoid executing cc if there is no toolchain installed as
+ # cc will be a stub that puts up a graphical alert
+ # prompting the user to install developer tools.
+ CC_FOR_BUILD=no_compiler_found
+ else
+ set_cc_for_build
fi
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
- # Avoid executing cc on OS X 10.9, as it ships with a stub
- # that puts up a graphical alert prompting to install
- # developer tools. Any system running Mac OS X 10.7 or
- # later (Darwin 11 and later) is required to have a 64-bit
- # processor. This is not true of the ARM version of Darwin
- # that Apple uses in portable devices.
- UNAME_PROCESSOR=x86_64
+ # uname -m returns i386 or x86_64
+ UNAME_PROCESSOR=$UNAME_MACHINE
fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
+ ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
+ ;;
*:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-pc-qnx
+ ;;
+ NEO-*:NONSTOP_KERNEL:*:*)
+ GUESS=neo-tandem-nsk$UNAME_RELEASE
+ ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
+ GUESS=nse-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsr-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsv-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsx-tandem-nsk$UNAME_RELEASE
+ ;;
*:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
+ GUESS=mips-compaq-nonstopux
+ ;;
BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
+ GUESS=bs2000-siemens-sysv
+ ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
+ ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ if test "${cputype-}" = 386; then
UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
+ elif test "x${cputype-}" != x; then
+ UNAME_MACHINE=$cputype
fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-plan9
+ ;;
*:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
+ GUESS=pdp10-unknown-tops10
+ ;;
*:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
+ GUESS=pdp10-unknown-tenex
+ ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
+ GUESS=pdp10-dec-tops20
+ ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
+ GUESS=pdp10-xkl-tops20
+ ;;
*:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
+ GUESS=pdp10-unknown-tops20
+ ;;
*:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
+ GUESS=pdp10-unknown-its
+ ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-sei-seiux$UNAME_RELEASE
+ ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
+ DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
+ ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
+ case $UNAME_MACHINE in
+ A*) GUESS=alpha-dec-vms ;;
+ I*) GUESS=ia64-dec-vms ;;
+ V*) GUESS=vax-dec-vms ;;
esac ;;
*:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
+ GUESS=i386-pc-xenix
+ ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
+ SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
+ GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
+ ;;
i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-rdos
+ ;;
+ *:AROS:*:*)
+ GUESS=$UNAME_MACHINE-unknown-aros
+ ;;
x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-esx
+ ;;
+ amd64:Isilon\ OneFS:*:*)
+ GUESS=x86_64-unknown-onefs
+ ;;
+ *:Unleashed:*:*)
+ GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
+ ;;
esac
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
+# Do we have a guess based on uname results?
+if test "x$GUESS" != x; then
+ echo "$GUESS"
+ exit
+fi
+
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
#endif
main ()
{
@@ -1388,22 +1568,14 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
@@ -1443,39 +1615,54 @@ main ()
#endif
#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
+ struct utsname un;
+ uname(&un);
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
#endif
#if defined (alliant) && defined (i860)
@@ -1486,54 +1673,46 @@ main ()
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+echo "$0: unable to guess system type" >&2
-# Convex versions that predate uname can use getsysinfo(1)
+case $UNAME_MACHINE:$UNAME_SYSTEM in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <<EOF
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+ ;;
+esac
cat >&2 <<EOF
-$0: unable to guess system type
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+EOF
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
+our_year=`echo $timestamp | sed 's,-.*,,'`
+thisyear=`date +%Y`
+# shellcheck disable=SC2003
+script_age=`expr "$thisyear" - "$our_year"`
+if test "$script_age" -lt 3 ; then
+ cat >&2 <<EOF
+
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
config.guess timestamp = $timestamp
@@ -1552,16 +1731,17 @@ hostinfo = `(hostinfo) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
EOF
+fi
exit 1
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/3rdparty/asio/config.sub b/3rdparty/asio/config.sub
index 61cb4bc22db..d74fb6deac9 100755
--- a/3rdparty/asio/config.sub
+++ b/3rdparty/asio/config.sub
@@ -1,8 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright 1992-2021 Free Software Foundation, Inc.
-timestamp='2013-10-01'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2021-08-14'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@ timestamp='2013-10-01'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -25,7 +27,7 @@ timestamp='2013-10-01'
# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -33,7 +35,7 @@ timestamp='2013-10-01'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -50,15 +52,21 @@ timestamp='2013-10-01'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -68,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -90,12 +98,12 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- echo "$me: invalid option $1$help"
+ echo "$me: invalid option $1$help" >&2
exit 1 ;;
*local*)
# First pass through any local machine types.
- echo $1
+ echo "$1"
exit ;;
* )
@@ -111,1211 +119,1181 @@ case $# in
exit 1;;
esac
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+saved_IFS=$IFS
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
+IFS=$saved_IFS
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
+# Separate into logical components for further validation
+case $1 in
+ *-*-*-*-*)
+ echo Invalid configuration \`"$1"\': more than four components >&2
+ exit 1
;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ *-*-*-*)
+ basic_machine=$field1-$field2
+ basic_os=$field3-$field4
;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+ nto-qnx* | linux-* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+ | storm-chaos* | os2-emx* | rtmk-nova*)
+ basic_machine=$field1
+ basic_os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+ basic_os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+ basic_os=$field3
+ ;;
+ esac
;;
- -psos*)
- os=-psos
+ *-*)
+ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+ case $field2 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ zephyr*)
+ basic_machine=$field1-unknown
+ basic_os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+ | convergent* | ncr* | news | 32* | 3600* | 3100* \
+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+ | ultra | tti* | harris | dolphin | highlevel | gould \
+ | cbm | ns | masscomp | apple | axis | knuth | cray \
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+ basic_os=
+ ;;
+ *)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ esac
+ ;;
+ esac
;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
+ *)
+ # Convert single-component short-hands not valid as part of
+ # multi-component configurations.
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+ basic_os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ basic_os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+ basic_os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ basic_os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ basic_os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ basic_os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+ basic_os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ basic_os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ basic_os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ basic_os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ basic_os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ basic_os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ basic_os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ basic_os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ basic_os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ basic_os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ basic_os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ basic_os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ basic_os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ basic_os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ basic_os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+ basic_os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ basic_os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+ basic_os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ basic_os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ basic_os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ basic_os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ basic_os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ basic_os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ basic_os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ basic_os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ basic_os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ basic_os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ basic_os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ basic_os=sysv3
+ ;;
+ hp300 | hp300hpux)
+ basic_machine=m68k-hp
+ basic_os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ basic_os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ basic_os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ basic_os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ basic_os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ basic_os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ basic_os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ basic_os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ basic_os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ basic_os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ basic_os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ basic_os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ basic_os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ basic_os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+ basic_os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ basic_os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ basic_os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ basic_os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+ basic_os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ basic_os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ basic_os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ basic_os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ basic_os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ basic_os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ basic_os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ basic_os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ basic_os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ basic_os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ basic_os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ basic_os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ basic_os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ basic_os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ basic_os=linux
+ ;;
+ psp)
+ basic_machine=mipsallegrexel-sony
+ basic_os=psp
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ basic_os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ basic_os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ basic_os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+ basic_os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ basic_os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ basic_os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ basic_os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ basic_os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ basic_os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ basic_os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ basic_os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+ basic_os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ basic_os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ basic_os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ basic_os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ basic_os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ basic_os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ basic_os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ basic_os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ basic_os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ basic_os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ basic_os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ basic_os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ basic_os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ basic_os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ basic_os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ basic_os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ basic_os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ basic_os=vms
+ ;;
+ vsta)
+ basic_machine=i386-pc
+ basic_os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ basic_os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ basic_os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ basic_os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ basic_os=unicos
+ ;;
+ *)
+ basic_machine=$1
+ basic_os=
+ ;;
+ esac
;;
esac
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 \
- | or1k | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ cpu=hppa1.1
+ vendor=winbond
;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
+ op50n)
+ cpu=hppa1.1
+ vendor=oki
;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
+ op60c)
+ cpu=hppa1.1
+ vendor=oki
;;
- xscaleeb)
- basic_machine=armeb-unknown
+ ibm*)
+ cpu=i370
+ vendor=ibm
;;
-
- xscaleel)
- basic_machine=armel-unknown
+ orion105)
+ cpu=clipper
+ vendor=highlevel
;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
+ mac | mpw | mac-mpw)
+ cpu=m68k
+ vendor=apple
;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
+ pmac | pmac-mpw)
+ cpu=powerpc
+ vendor=apple
;;
+
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
+ cpu=m68000
+ vendor=att
;;
3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=we32k
+ vendor=att
;;
bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
+ cpu=powerpc
+ vendor=ibm
+ basic_os=cnk
;;
decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops10
;;
decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
+ cpu=m68k
+ vendor=motorola
;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+ basic_os=sysv3
;;
encore | umax | mmax)
- basic_machine=ns32k-encore
+ cpu=ns32k
+ vendor=encore
;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+ basic_os=${basic_os:-bsd}
;;
fx2800)
- basic_machine=i860-alliant
+ cpu=i860
+ vendor=alliant
;;
genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
+ cpu=ns32k
+ vendor=ns
;;
h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
+ cpu=m68000
+ vendor=hp
;;
hp9k3[2-9][0-9])
- basic_machine=m68k-hp
+ cpu=m68k
+ vendor=hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
+ cpu=hppa1.0
+ vendor=hp
;;
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv32
;;
i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv4
;;
i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv
;;
i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=solaris2
;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+ basic_os=${basic_os:-unicos}
;;
iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
+ cpu=mips
+ vendor=sgi
+ case $basic_os in
+ irix*)
;;
*)
- os=-irix4
+ basic_os=irix4
;;
esac
;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
miniframe)
- basic_machine=m68000-convergent
+ cpu=m68000
+ vendor=convergent
;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+ basic_os=mint
;;
news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
+ cpu=mips
+ vendor=sony
+ basic_os=newsos
+ ;;
+ next | m*-next)
+ cpu=m68k
+ vendor=next
+ case $basic_os in
+ openstep*)
+ ;;
+ nextstep*)
;;
- -ns2*)
- os=-nextstep2
+ ns2*)
+ basic_os=nextstep2
;;
*)
- os=-nextstep3
+ basic_os=nextstep3
;;
esac
;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
+ cpu=np1
+ vendor=gould
;;
op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
+ cpu=hppa1.1
+ vendor=oki
+ basic_os=proelf
;;
pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
pbd)
- basic_machine=sparc-tti
+ cpu=sparc
+ vendor=tti
;;
pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ cpu=m68k
+ vendor=tti
;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ pc532)
+ cpu=ns32k
+ vendor=pc532
;;
pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ cpu=pn
+ vendor=gould
;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ power)
+ cpu=power
+ vendor=ibm
;;
ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
+ cpu=i386
+ vendor=ibm
;;
rm[46]00)
- basic_machine=mips-siemens
+ cpu=mips
+ vendor=siemens
;;
rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
+ cpu=romp
+ vendor=ibm
;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+ basic_os=${basic_os:-elf}
;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+ basic_os=vxworks
;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
+ tower | tower-32)
+ cpu=m68k
+ vendor=ncr
;;
- sei)
- basic_machine=mips-sei
- os=-seiux
+ vpp*|vx|vx-*)
+ cpu=f301
+ vendor=fujitsu
;;
- sequent)
- basic_machine=i386-sequent
+ w65)
+ cpu=w65
+ vendor=wdc
;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+ basic_os=proelf
;;
- sh5el)
- basic_machine=sh5le-unknown
+ none)
+ cpu=none
+ vendor=none
;;
- sh64)
- basic_machine=sh64-unknown
+ leon|leon[3-9])
+ cpu=sparc
+ vendor=$basic_machine
;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
+ leon-*|leon[3-9]-*)
+ cpu=sparc
+ vendor=`echo "$basic_machine" | sed 's/-.*//'`
;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
+
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
+ IFS=$saved_IFS
;;
- spur)
- basic_machine=spur-unknown
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ cpu=$basic_machine
+ vendor=pc
;;
- st2000)
- basic_machine=m68k-tandem
+ # These rules are duplicated from below for sake of the special case above;
+ # i.e. things that normalized to x86 arches should also default to "pc"
+ pc98)
+ cpu=i386
+ vendor=pc
;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
+ x64 | amd64)
+ cpu=x86_64
+ vendor=pc
;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ # Recognize the basic CPU types without company name.
+ *)
+ cpu=$basic_machine
+ vendor=unknown
;;
- sun2)
- basic_machine=m68000-sun
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ craynv-unknown)
+ vendor=cray
+ basic_os=${basic_os:-unicosmp}
;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
+ c90-unknown | c90-cray)
+ vendor=cray
+ basic_os=${Basic_os:-unicos}
;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
+ fx80-unknown)
+ vendor=alliant
;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
+ romp-unknown)
+ vendor=ibm
;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
+ mmix-unknown)
+ vendor=knuth
;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
+ microblaze-unknown | microblazeel-unknown)
+ vendor=xilinx
;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
+ rs6000-unknown)
+ vendor=ibm
;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
+ vax-unknown)
+ vendor=dec
;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
+ pdp11-unknown)
+ vendor=dec
;;
- sun4)
- basic_machine=sparc-sun
+ we32k-unknown)
+ vendor=att
;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
+ cydra-unknown)
+ vendor=cydrome
;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
+ i370-ibm*)
+ vendor=ibm
;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
+ orion-unknown)
+ vendor=highlevel
;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
+ xps-unknown | xps100-unknown)
+ cpu=xps100
+ vendor=honeywell
;;
- t90)
- basic_machine=t90-cray
- os=-unicos
+
+ # Here we normalize CPU types with a missing or matching vendor
+ dpx20-unknown | dpx20-bull)
+ cpu=rs6000
+ vendor=bull
+ basic_os=${basic_os:-bosx}
;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
+
+ # Here we normalize CPU types irrespective of the vendor
+ amd64-*)
+ cpu=x86_64
;;
- tx39)
- basic_machine=mipstx39-unknown
+ blackfin-*)
+ cpu=bfin
+ basic_os=linux
;;
- tx39el)
- basic_machine=mipstx39el-unknown
+ c54x-*)
+ cpu=tic54x
;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
+ c55x-*)
+ cpu=tic55x
;;
- tower | tower-32)
- basic_machine=m68k-ncr
+ c6x-*)
+ cpu=tic6x
;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
+ e500v[12]-*)
+ cpu=powerpc
+ basic_os=${basic_os}"spe"
;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
+ mips3*-*)
+ cpu=mips64
;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
+ ms1-*)
+ cpu=mt
;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
+ m68knommu-*)
+ cpu=m68k
+ basic_os=linux
;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ cpu=s12z
;;
- vms)
- basic_machine=vax-dec
- os=-vms
+ openrisc-*)
+ cpu=or32
;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
+ parisc-*)
+ cpu=hppa
+ basic_os=linux
;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ cpu=i586
;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+ cpu=i686
;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ cpu=i686
;;
- w65*)
- basic_machine=w65-wdc
- os=-none
+ pentium4-*)
+ cpu=i786
;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
+ pc98-*)
+ cpu=i386
;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
+ ppc-* | ppcbe-*)
+ cpu=powerpc
;;
- xps | xps100)
- basic_machine=xps100-honeywell
+ ppcle-* | powerpclittle-*)
+ cpu=powerpcle
;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ppc64-*)
+ cpu=powerpc64
;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
+ ppc64le-* | powerpc64little-*)
+ cpu=powerpc64le
;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
+ sb1-*)
+ cpu=mipsisa64sb1
;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
+ sb1el-*)
+ cpu=mipsisa64sb1el
;;
- none)
- basic_machine=none-none
- os=-none
+ sh5e[lb]-*)
+ cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
+ spur-*)
+ cpu=spur
;;
- op50n)
- basic_machine=hppa1.1-oki
+ strongarm-* | thumb-*)
+ cpu=arm
;;
- op60c)
- basic_machine=hppa1.1-oki
+ tx39-*)
+ cpu=mipstx39
;;
- romp)
- basic_machine=romp-ibm
+ tx39el-*)
+ cpu=mipstx39el
;;
- mmix)
- basic_machine=mmix-knuth
+ x64-*)
+ cpu=x86_64
;;
- rs6000)
- basic_machine=rs6000-ibm
+ xscale-* | xscalee[bl]-*)
+ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
- vax)
- basic_machine=vax-dec
+ arm64-*)
+ cpu=aarch64
;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
+
+ # Recognize the canonical CPU Types that limit and/or modify the
+ # company names they are paired with.
+ cr16-*)
+ basic_os=${basic_os:-elf}
;;
- pdp11)
- basic_machine=pdp11-dec
+ crisv32-* | etraxfs*-*)
+ cpu=crisv32
+ vendor=axis
;;
- we32k)
- basic_machine=we32k-att
+ cris-* | etrax*-*)
+ cpu=cris
+ vendor=axis
;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
+ crx-*)
+ basic_os=${basic_os:-elf}
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
+ neo-tandem)
+ cpu=neo
+ vendor=tandem
;;
- cydra)
- basic_machine=cydra-cydrome
+ nse-tandem)
+ cpu=nse
+ vendor=tandem
;;
- orion)
- basic_machine=orion-highlevel
+ nsr-tandem)
+ cpu=nsr
+ vendor=tandem
;;
- orion105)
- basic_machine=clipper-highlevel
+ nsv-tandem)
+ cpu=nsv
+ vendor=tandem
;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
+ nsx-tandem)
+ cpu=nsx
+ vendor=tandem
;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
+ mipsallegrexel-sony)
+ cpu=mipsallegrexel
+ vendor=sony
;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
+ tile*-*)
+ basic_os=${basic_os:-linux-gnu}
;;
+
*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
+ # Recognize the canonical CPU types that are allowed with any
+ # company name.
+ case $cpu in
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | abacus \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+ | amdgcn \
+ | arc | arceb | arc32 | arc64 \
+ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+ | be32 | be64 \
+ | bfin | bpf | bs2000 \
+ | c[123]* | c30 | [cjt]90 | c4x \
+ | c8051 | clipper | craynv | csky | cydra \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | elxsi | epiphany \
+ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+ | h8300 | h8500 \
+ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | loongarch32 | loongarch64 | loongarchx32 \
+ | m32c | m32r | m32rle \
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
+ | microblaze | microblazeel \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64eb | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r3 | mipsisa32r3el \
+ | mipsisa32r5 | mipsisa32r5el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r3 | mipsisa64r3el \
+ | mipsisa64r5 | mipsisa64r5el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mmix \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nfp \
+ | nios | nios2 | nios2eb | nios2el \
+ | none | np1 | ns16k | ns32k | nvptx \
+ | open8 \
+ | or1k* \
+ | or32 \
+ | orion \
+ | picochip \
+ | pdp10 | pdp11 | pj | pjl | pn | power \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
+ | rl78 | romp | rs6000 | rx \
+ | s390 | s390x \
+ | score \
+ | sh | shl \
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
+ | thumbv7* \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | vax \
+ | visium \
+ | w65 \
+ | wasm32 | wasm64 \
+ | we32k \
+ | x86 | x86_64 | xc16x | xgate | xps100 \
+ | xstormy16 | xtensa* \
+ | ymp \
+ | z8k | z80)
+ ;;
+
+ *)
+ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+ exit 1
+ ;;
+ esac
;;
esac
# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+ digital*)
+ vendor=dec
;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ commodore*)
+ vendor=cbm
;;
*)
;;
@@ -1323,200 +1301,215 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x"$os" != x"" ]
+if test x$basic_os != x
then
+
+# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
+# set os.
+case $basic_os in
+ gnu/linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
+ ;;
+ os2-emx)
+ kernel=os2
+ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
+ ;;
+ nto-qnx*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
+ ;;
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read kernel os <<EOF
+$basic_os
+EOF
+ IFS=$saved_IFS
+ ;;
+ # Default OS when just kernel was specified
+ nto*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
+ ;;
+ linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
+ ;;
+ *)
+ kernel=
+ os=$basic_os
+ ;;
+esac
+
+# Now, normalize the OS (knowing we just have one component, it's not a kernel,
+# etc.)
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
+ # First match some system type aliases that might get confused
+ # with valid system types.
+ # solaris* is a basic system type, with this one exception.
+ auroraux)
+ os=auroraux
;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ bluegene*)
+ os=cnk
;;
- -solaris)
- os=-solaris2
+ solaris1 | solaris1.*)
+ os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
;;
- -svr4*)
- os=-sysv4
+ solaris)
+ os=solaris2
;;
- -unixware*)
- os=-sysv4.2uw
+ unixware*)
+ os=sysv4.2uw
;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ # es1800 is here to avoid being matched by es* (a different OS)
+ es1800*)
+ os=ose
;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
+ # Some version numbers need modification
+ chorusos*)
+ os=chorusos
;;
- -nto-qnx*)
+ isc)
+ os=isc2.2
;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ sco6)
+ os=sco5v6
;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ sco5)
+ os=sco3.2v5
;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
+ sco4)
+ os=sco3.2v4
;;
- -linux-dietlibc)
- os=-linux-dietlibc
+ sco3.2.[4-9]*)
+ os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ sco*v* | scout)
+ # Don't match below
;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ sco*)
+ os=sco3.2v2
;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ psos*)
+ os=psos
;;
- -opened*)
- os=-openedition
+ qnx*)
+ os=qnx
;;
- -os400*)
- os=-os400
+ hiux*)
+ os=hiuxwe2
;;
- -wince*)
- os=-wince
+ lynx*178)
+ os=lynxos178
;;
- -osfrose*)
- os=-osfrose
+ lynx*5)
+ os=lynxos5
;;
- -osf*)
- os=-osf
+ lynxos*)
+ # don't get caught up in next wildcard
;;
- -utek*)
- os=-bsd
+ lynx*)
+ os=lynxos
;;
- -dynix*)
- os=-bsd
+ mac[0-9]*)
+ os=`echo "$os" | sed -e 's|mac|macos|'`
;;
- -acis*)
- os=-aos
+ opened*)
+ os=openedition
;;
- -atheos*)
- os=-atheos
+ os400*)
+ os=os400
;;
- -syllable*)
- os=-syllable
+ sunos5*)
+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
;;
- -386bsd)
- os=-bsd
+ sunos6*)
+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
;;
- -ctix* | -uts*)
- os=-sysv
+ wince*)
+ os=wince
;;
- -nova*)
- os=-rtmk-nova
+ utek*)
+ os=bsd
;;
- -ns2 )
- os=-nextstep2
+ dynix*)
+ os=bsd
;;
- -nsk*)
- os=-nsk
+ acis*)
+ os=aos
;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
+ atheos*)
+ os=atheos
;;
- -sinix*)
- os=-sysv4
+ syllable*)
+ os=syllable
;;
- -tpf*)
- os=-tpf
+ 386bsd)
+ os=bsd
;;
- -triton*)
- os=-sysv3
+ ctix* | uts*)
+ os=sysv
;;
- -oss*)
- os=-sysv3
+ nova*)
+ os=rtmk-nova
;;
- -svr4)
- os=-sysv4
+ ns2)
+ os=nextstep2
;;
- -svr3)
- os=-sysv3
+ # Preserve the version number of sinix5.
+ sinix5.*)
+ os=`echo "$os" | sed -e 's|sinix|sysv|'`
;;
- -sysvr4)
- os=-sysv4
+ sinix*)
+ os=sysv4
;;
- # This must come after -sysvr4.
- -sysv*)
+ tpf*)
+ os=tpf
;;
- -ose*)
- os=-ose
+ triton*)
+ os=sysv3
;;
- -es1800*)
- os=-ose
+ oss*)
+ os=sysv3
;;
- -xenix)
- os=-xenix
+ svr4*)
+ os=sysv4
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
+ svr3)
+ os=sysv3
;;
- -aros*)
- os=-aros
+ sysvr4)
+ os=sysv4
;;
- -zvmoe)
- os=-zvmoe
+ ose*)
+ os=ose
;;
- -dicos*)
- os=-dicos
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ os=mint
;;
- -nacl*)
+ dicos*)
+ os=dicos
;;
- -none)
+ pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
+ # configurations are quite functional.
+ case $cpu in
+ arm*)
+ os=eabi
+ ;;
+ *)
+ os=elf
+ ;;
+ esac
;;
*)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
+ # No normalization, but not necessarily accepted, that comes below.
;;
esac
+
else
# Here we handle the default operating systems that come with various machines.
@@ -1529,264 +1522,362 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
-case $basic_machine in
+kernel=
+case $cpu-$vendor in
score-*)
- os=-elf
+ os=elf
;;
spu-*)
- os=-elf
+ os=elf
;;
*-acorn)
- os=-riscix1.2
+ os=riscix1.2
;;
arm*-rebel)
- os=-linux
+ kernel=linux
+ os=gnu
;;
arm*-semi)
- os=-aout
+ os=aout
;;
c4x-* | tic4x-*)
- os=-coff
+ os=coff
;;
c8051-*)
- os=-elf
+ os=elf
+ ;;
+ clipper-intergraph)
+ os=clix
;;
hexagon-*)
- os=-elf
+ os=elf
;;
tic54x-*)
- os=-coff
+ os=coff
;;
tic55x-*)
- os=-coff
+ os=coff
;;
tic6x-*)
- os=-coff
+ os=coff
;;
# This must come before the *-dec entry.
pdp10-*)
- os=-tops20
+ os=tops20
;;
pdp11-*)
- os=-none
+ os=none
;;
*-dec | vax-*)
- os=-ultrix4.2
+ os=ultrix4.2
;;
m68*-apollo)
- os=-domain
+ os=domain
;;
i386-sun)
- os=-sunos4.0.2
+ os=sunos4.0.2
;;
m68000-sun)
- os=-sunos3
+ os=sunos3
;;
m68*-cisco)
- os=-aout
+ os=aout
;;
mep-*)
- os=-elf
+ os=elf
;;
mips*-cisco)
- os=-elf
+ os=elf
;;
mips*-*)
- os=-elf
- ;;
- or1k-*)
- os=-elf
+ os=elf
;;
or32-*)
- os=-coff
+ os=coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
+ os=sysv3
;;
sparc-* | *-sun)
- os=-sunos4.1.1
+ os=sunos4.1.1
;;
- *-be)
- os=-beos
+ pru-*)
+ os=elf
;;
- *-haiku)
- os=-haiku
+ *-be)
+ os=beos
;;
*-ibm)
- os=-aix
+ os=aix
;;
*-knuth)
- os=-mmixware
+ os=mmixware
;;
*-wec)
- os=-proelf
+ os=proelf
;;
*-winbond)
- os=-proelf
+ os=proelf
;;
*-oki)
- os=-proelf
+ os=proelf
;;
*-hp)
- os=-hpux
+ os=hpux
;;
*-hitachi)
- os=-hiux
+ os=hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
+ os=sysv
;;
*-cbm)
- os=-amigaos
+ os=amigaos
;;
*-dg)
- os=-dgux
+ os=dgux
;;
*-dolphin)
- os=-sysv3
+ os=sysv3
;;
m68k-ccur)
- os=-rtu
+ os=rtu
;;
m88k-omron*)
- os=-luna
+ os=luna
;;
- *-next )
- os=-nextstep
+ *-next)
+ os=nextstep
;;
*-sequent)
- os=-ptx
+ os=ptx
;;
*-crds)
- os=-unos
+ os=unos
;;
*-ns)
- os=-genix
+ os=genix
;;
i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
+ os=mvs
;;
*-gould)
- os=-sysv
+ os=sysv
;;
*-highlevel)
- os=-bsd
+ os=bsd
;;
*-encore)
- os=-bsd
+ os=bsd
;;
*-sgi)
- os=-irix
+ os=irix
;;
*-siemens)
- os=-sysv4
+ os=sysv4
;;
*-masscomp)
- os=-rtu
+ os=rtu
;;
f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
+ os=uxpv
;;
*-rom68k)
- os=-coff
+ os=coff
;;
*-*bug)
- os=-coff
+ os=coff
;;
*-apple)
- os=-macos
+ os=macos
;;
*-atari*)
- os=-mint
+ os=mint
+ ;;
+ *-wrs)
+ os=vxworks
;;
*)
- os=-none
+ os=none
;;
esac
+
fi
+# Now, validate our (potentially fixed-up) OS.
+case $os in
+ # Sometimes we do "kernel-libc", so those need to count as OSes.
+ musl* | newlib* | relibc* | uclibc*)
+ ;;
+ # Likewise for "kernel-abi"
+ eabi* | gnueabi*)
+ ;;
+ # VxWorks passes extra cpu info in the 4th filed.
+ simlinux | simwindows | spe)
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
+ | hiux* | abug | nacl* | netware* | windows* \
+ | os9* | macos* | osx* | ios* \
+ | mpw* | magic* | mmixware* | mon960* | lnews* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* | serenity* \
+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | mint* \
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
+ | storm-chaos* | tops10* | tenex* | tops20* | its* \
+ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
+ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*)
+ ;;
+ # This one is extra strict with allowed versions
+ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ none)
+ ;;
+ *)
+ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os in
+ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
+ | linux-musl* | linux-relibc* | linux-uclibc* )
+ ;;
+ uclinux-uclibc* )
+ ;;
+ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
+ # These are just libc implementations, not actual OSes, and thus
+ # require a kernel.
+ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ kfreebsd*-gnu* | kopensolaris*-gnu*)
+ ;;
+ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+ ;;
+ nto-qnx*)
+ ;;
+ os2-emx)
+ ;;
+ *-eabi* | *-gnueabi*)
+ ;;
+ -*)
+ # Blank kernel with real OS is always fine.
+ ;;
+ *-*)
+ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+ exit 1
+ ;;
+esac
+
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
+case $vendor in
+ unknown)
+ case $cpu-$os in
+ *-riscix*)
vendor=acorn
;;
- -sunos*)
+ *-sunos*)
vendor=sun
;;
- -cnk*|-aix*)
+ *-cnk* | *-aix*)
vendor=ibm
;;
- -beos*)
+ *-beos*)
vendor=be
;;
- -hpux*)
+ *-hpux*)
vendor=hp
;;
- -mpeix*)
+ *-mpeix*)
vendor=hp
;;
- -hiux*)
+ *-hiux*)
vendor=hitachi
;;
- -unos*)
+ *-unos*)
vendor=crds
;;
- -dgux*)
+ *-dgux*)
vendor=dg
;;
- -luna*)
+ *-luna*)
vendor=omron
;;
- -genix*)
+ *-genix*)
vendor=ns
;;
- -mvs* | -opened*)
+ *-clix*)
+ vendor=intergraph
+ ;;
+ *-mvs* | *-opened*)
+ vendor=ibm
+ ;;
+ *-os400*)
vendor=ibm
;;
- -os400*)
+ s390-* | s390x-*)
vendor=ibm
;;
- -ptx*)
+ *-ptx*)
vendor=sequent
;;
- -tpf*)
+ *-tpf*)
vendor=ibm
;;
- -vxsim* | -vxworks* | -windiss*)
+ *-vxsim* | *-vxworks* | *-windiss*)
vendor=wrs
;;
- -aux*)
+ *-aux*)
vendor=apple
;;
- -hms*)
+ *-hms*)
vendor=hitachi
;;
- -mpw* | -macos*)
+ *-mpw* | *-macos*)
vendor=apple
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
vendor=atari
;;
- -vos*)
+ *-vos*)
vendor=stratus
;;
esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
-echo $basic_machine$os
+echo "$cpu-$vendor-${kernel:+$kernel-}$os"
exit
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/3rdparty/asio/configure b/3rdparty/asio/configure
index bd9b1ca1644..3f97eb5ce3f 100755
--- a/3rdparty/asio/configure
+++ b/3rdparty/asio/configure
@@ -1,9 +1,10 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for asio 1.20.0.
+# Generated by GNU Autoconf 2.71 for asio 1.30.2.
#
#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
+# Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -14,14 +15,16 @@
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
+else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
@@ -31,46 +34,46 @@ esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -79,13 +82,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -94,8 +90,12 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
@@ -107,30 +107,10 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
@@ -152,20 +132,22 @@ esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ as_bourne_compatible="as_nop=:
+if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
-else
+else \$as_nop
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
@@ -185,42 +167,52 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+if ( set x; as_fn_ret_success y && test x = \"\$1\" )
+then :
-else
+else \$as_nop
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
+blah=\$(echo \$(echo blah))
+test x\"\$blah\" = xblah || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+ if (eval "$as_required") 2>/dev/null
+then :
as_have_required=yes
-else
+else $as_nop
as_have_required=no
fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
+then :
-else
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
+ as_shell=$as_dir$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
+then :
break 2
fi
fi
@@ -228,14 +220,21 @@ fi
esac
as_found=false
done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
IFS=$as_save_IFS
+if $as_found
+then :
+else $as_nop
+ if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi
+fi
- if test "x$CONFIG_SHELL" != x; then :
+
+ if test "x$CONFIG_SHELL" != x
+then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
@@ -253,18 +252,19 @@ esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ if test x$as_have_required = xno
+then :
+ printf "%s\n" "$0: This script requires a shell more modern than all"
+ printf "%s\n" "$0: the shells that I found on your system."
+ if test ${ZSH_VERSION+y} ; then
+ printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+ printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
@@ -291,6 +291,7 @@ as_fn_unset ()
}
as_unset=as_fn_unset
+
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -308,6 +309,14 @@ as_fn_exit ()
as_fn_set_status $1
exit $1
} # as_fn_exit
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+ return $?
+}
+as_nop=as_fn_nop
# as_fn_mkdir_p
# -------------
@@ -322,7 +331,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -331,7 +340,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -370,12 +379,13 @@ as_fn_executable_p ()
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
+else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
@@ -387,18 +397,27 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
+else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+ return $?
+}
+as_nop=as_fn_nop
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
@@ -410,9 +429,9 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -439,7 +458,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -483,7 +502,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
@@ -497,6 +516,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
exit
}
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -510,6 +533,13 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -577,48 +607,44 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='asio'
PACKAGE_TARNAME='asio'
-PACKAGE_VERSION='1.20.0'
-PACKAGE_STRING='asio 1.20.0'
+PACKAGE_VERSION='1.30.2'
+PACKAGE_STRING='asio 1.30.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
ac_unique_file="include/asio.hpp"
# Factoring default headers for most tests.
ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
+#include <stddef.h>
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
#endif
-#ifdef STDC_HEADERS
+#ifdef HAVE_STDLIB_H
# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
#endif
#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
# include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
+ac_header_cxx_list=
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
@@ -643,9 +669,7 @@ STANDALONE_FALSE
STANDALONE_TRUE
HAVE_OPENSSL_FALSE
HAVE_OPENSSL_TRUE
-EGREP
-GREP
-CXXCPP
+pkgconfigdir
RANLIB
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
@@ -681,6 +705,9 @@ AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
AM_V
+CSCOPE
+ETAGS
+CTAGS
am__untar
am__tar
AMTAR
@@ -726,6 +753,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -752,6 +780,7 @@ enable_option_checking
enable_maintainer_mode
enable_silent_rules
enable_dependency_tracking
+with_pkgconfigdir
with_boost
enable_separate_compilation
enable_boost_coroutine
@@ -767,8 +796,7 @@ LIBS
CPPFLAGS
CXX
CXXFLAGS
-CCC
-CXXCPP'
+CCC'
# Initialize some variables set by options.
@@ -807,6 +835,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -836,8 +865,6 @@ do
*) ac_optarg=yes ;;
esac
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
@@ -878,9 +905,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -904,9 +931,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -1059,6 +1086,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1108,9 +1144,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1124,9 +1160,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1170,9 +1206,9 @@ Try \`$0 --help' for more information"
*)
# FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
@@ -1188,7 +1224,7 @@ if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1196,7 +1232,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1252,7 +1288,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
+printf "%s\n" X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -1309,7 +1345,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures asio 1.20.0 to adapt to many kinds of systems.
+\`configure' configures asio 1.30.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1349,6 +1385,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1379,7 +1416,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of asio 1.20.0:";;
+ short | recursive ) echo "Configuration of asio 1.30.2:";;
esac
cat <<\_ACEOF
@@ -1402,6 +1439,8 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-pkgconfigdir pkg-config installation directory
+ ['${libdir}/pkgconfig']
--with-boost=DIR location of boost distribution
--with-openssl=DIR location of openssl
@@ -1415,7 +1454,6 @@ Some influential environment variables:
you have headers in a nonstandard directory <include dir>
CXX C++ compiler command
CXXFLAGS C++ compiler flags
- CXXCPP C++ preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1436,9 +1474,9 @@ if test "$ac_init_help" = "recursive"; then
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1466,7 +1504,8 @@ esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
+ # Check for configure.gnu first; this name is used for a wrapper for
+ # Metaconfig's "Configure" on case-insensitive file systems.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
@@ -1474,7 +1513,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
@@ -1483,10 +1522,10 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-asio configure 1.20.0
-generated by GNU Autoconf 2.69
+asio configure 1.30.2
+generated by GNU Autoconf 2.71
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1503,14 +1542,14 @@ fi
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
+ rm -f conftest.$ac_objext conftest.beam
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1518,14 +1557,15 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
+ } && test -s conftest.$ac_objext
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1541,14 +1581,14 @@ fi
ac_fn_cxx_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
+ rm -f conftest.$ac_objext conftest.beam
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1556,14 +1596,15 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
+ } && test -s conftest.$ac_objext
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1573,172 +1614,6 @@ fi
} # ac_fn_cxx_try_compile
-# ac_fn_cxx_try_cpp LINENO
-# ------------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_cpp
-
-# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES
-# ---------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_cxx_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_cxx_check_header_mongrel
-
-# ac_fn_cxx_try_run LINENO
-# ------------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_cxx_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_run
-
# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES
# ---------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
@@ -1746,37 +1621,59 @@ fi
ac_fn_cxx_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
eval "$3=yes"
-else
+else $as_nop
eval "$3=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_cxx_check_header_compile
+ac_configure_args_raw=
+for ac_arg
+do
+ case $ac_arg in
+ *\'*)
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_configure_args_raw " '$ac_arg'"
+done
+
+case $ac_configure_args_raw in
+ *$as_nl*)
+ ac_safe_unquote= ;;
+ *)
+ ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.
+ ac_unsafe_a="$ac_unsafe_z#~"
+ ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
+ ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
+esac
+
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by asio $as_me 1.20.0, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+It was created by asio $as_me 1.30.2, which was
+generated by GNU Autoconf 2.71. Invocation command line was
- $ $0 $@
+ $ $0$ac_configure_args_raw
_ACEOF
exec 5>>config.log
@@ -1809,8 +1706,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ printf "%s\n" "PATH: $as_dir"
done
IFS=$as_save_IFS
@@ -1845,7 +1746,7 @@ do
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
@@ -1880,11 +1781,13 @@ done
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
+ # Sanitize IFS.
+ IFS=" "" $as_nl"
# Save into config.log some information that might help in debugging.
{
echo
- $as_echo "## ---------------- ##
+ printf "%s\n" "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
@@ -1895,8 +1798,8 @@ trap 'exit_status=$?
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -1920,7 +1823,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
)
echo
- $as_echo "## ----------------- ##
+ printf "%s\n" "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
@@ -1928,14 +1831,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
+ printf "%s\n" "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
@@ -1943,15 +1846,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
- $as_echo "## ----------- ##
+ printf "%s\n" "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
@@ -1959,8 +1862,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
echo
fi
test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
+ printf "%s\n" "$as_me: caught signal $ac_signal"
+ printf "%s\n" "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -1974,63 +1877,48 @@ ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
-$as_echo "/* confdefs.h */" > confdefs.h
+printf "%s\n" "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
+printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
+printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
+printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
+printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
+ ac_site_files="$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
+ ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
+ ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+
+for ac_site_file in $ac_site_files
do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ case $ac_site_file in #(
+ */*) :
+ ;; #(
+ *) :
+ ac_site_file=./$ac_site_file ;;
+esac
+ if test -f "$ac_site_file" && test -r "$ac_site_file"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
@@ -2040,19 +1928,650 @@ if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
+# Test code for whether the C compiler supports C89 (global declarations)
+ac_c_conftest_c89_globals='
+/* Does the compiler advertise C89 conformance?
+ Do not test the value of __STDC__, because some compilers set it to 0
+ while being otherwise adequately conformant. */
+#if !defined __STDC__
+# error "Compiler does not advertise C89 conformance"
+#endif
+
+#include <stddef.h>
+#include <stdarg.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
+struct buf { int x; };
+struct buf * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not \xHH hex character constants.
+ These do not provoke an error unfortunately, instead are silently treated
+ as an "x". The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously \x00 != x always comes out true, for an
+ array size at least. It is necessary to write \x00 == 0 to get something
+ that is true only with -std. */
+int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) '\''x'\''
+int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
+ int, int);'
+
+# Test code for whether the C compiler supports C89 (body of main).
+ac_c_conftest_c89_main='
+ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
+'
+
+# Test code for whether the C compiler supports C99 (global declarations)
+ac_c_conftest_c99_globals='
+// Does the compiler advertise C99 conformance?
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
+# error "Compiler does not advertise C99 conformance"
+#endif
+
+#include <stdbool.h>
+extern int puts (const char *);
+extern int printf (const char *, ...);
+extern int dprintf (int, const char *, ...);
+extern void *malloc (size_t);
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+// dprintf is used instead of fprintf to avoid needing to declare
+// FILE and stderr.
+#define debug(...) dprintf (2, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ #error "your preprocessor is broken"
+#endif
+#if BIG_OK
+#else
+ #error "your preprocessor is broken"
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case '\''s'\'': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case '\''d'\'': // int
+ number = va_arg (args_copy, int);
+ break;
+ case '\''f'\'': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}
+'
+
+# Test code for whether the C compiler supports C99 (body of main).
+ac_c_conftest_c99_main='
+ // Check bool.
+ _Bool success = false;
+ success |= (argc != 0);
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[0] = argv[0][0];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''
+ || dynamic_array[ni.number - 1] != 543);
+'
+
+# Test code for whether the C compiler supports C11 (global declarations)
+ac_c_conftest_c11_globals='
+// Does the compiler advertise C11 conformance?
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
+# error "Compiler does not advertise C11 conformance"
+#endif
+
+// Check _Alignas.
+char _Alignas (double) aligned_as_double;
+char _Alignas (0) no_special_alignment;
+extern char aligned_as_int;
+char _Alignas (0) _Alignas (int) aligned_as_int;
+
+// Check _Alignof.
+enum
+{
+ int_alignment = _Alignof (int),
+ int_array_alignment = _Alignof (int[100]),
+ char_alignment = _Alignof (char)
+};
+_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
+
+// Check _Noreturn.
+int _Noreturn does_not_return (void) { for (;;) continue; }
+
+// Check _Static_assert.
+struct test_static_assert
+{
+ int x;
+ _Static_assert (sizeof (int) <= sizeof (long int),
+ "_Static_assert does not work in struct");
+ long int y;
+};
+
+// Check UTF-8 literals.
+#define u8 syntax error!
+char const utf8_literal[] = u8"happens to be ASCII" "another string";
+
+// Check duplicate typedefs.
+typedef long *long_ptr;
+typedef long int *long_ptr;
+typedef long_ptr long_ptr;
+
+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
+struct anonymous
+{
+ union {
+ struct { int i; int j; };
+ struct { int k; long int l; } w;
+ };
+ int m;
+} v1;
+'
+
+# Test code for whether the C compiler supports C11 (body of main).
+ac_c_conftest_c11_main='
+ _Static_assert ((offsetof (struct anonymous, i)
+ == offsetof (struct anonymous, w.k)),
+ "Anonymous union alignment botch");
+ v1.i = 2;
+ v1.w.k = 5;
+ ok |= v1.i != 5;
+'
+
+# Test code for whether the C compiler supports C11 (complete).
+ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+${ac_c_conftest_c11_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ ${ac_c_conftest_c99_main}
+ ${ac_c_conftest_c11_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C99 (complete).
+ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ ${ac_c_conftest_c99_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C89 (complete).
+ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ return ok;
+}
+"
+
+# Test code for whether the C++ compiler supports C++98 (global declarations)
+ac_cxx_conftest_cxx98_globals='
+// Does the compiler advertise C++98 conformance?
+#if !defined __cplusplus || __cplusplus < 199711L
+# error "Compiler does not advertise C++98 conformance"
+#endif
+
+// These inclusions are to reject old compilers that
+// lack the unsuffixed header files.
+#include <cstdlib>
+#include <exception>
+
+// <cassert> and <cstring> are *not* freestanding headers in C++98.
+extern void assert (int);
+namespace std {
+ extern int strcmp (const char *, const char *);
+}
+
+// Namespaces, exceptions, and templates were all added after "C++ 2.0".
+using std::exception;
+using std::strcmp;
+
+namespace {
+
+void test_exception_syntax()
+{
+ try {
+ throw "test";
+ } catch (const char *s) {
+ // Extra parentheses suppress a warning when building autoconf itself,
+ // due to lint rules shared with more typical C programs.
+ assert (!(strcmp) (s, "test"));
+ }
+}
+
+template <typename T> struct test_template
+{
+ T const val;
+ explicit test_template(T t) : val(t) {}
+ template <typename U> T add(U u) { return static_cast<T>(u) + val; }
+};
+
+} // anonymous namespace
+'
+
+# Test code for whether the C++ compiler supports C++98 (body of main)
+ac_cxx_conftest_cxx98_main='
+ assert (argc);
+ assert (! argv[0]);
+{
+ test_exception_syntax ();
+ test_template<double> tt (2.0);
+ assert (tt.add (4) == 6.0);
+ assert (true && !false);
+}
+'
+
+# Test code for whether the C++ compiler supports C++11 (global declarations)
+ac_cxx_conftest_cxx11_globals='
+// Does the compiler advertise C++ 2011 conformance?
+#if !defined __cplusplus || __cplusplus < 201103L
+# error "Compiler does not advertise C++11 conformance"
+#endif
+
+namespace cxx11test
+{
+ constexpr int get_val() { return 20; }
+
+ struct testinit
+ {
+ int i;
+ double d;
+ };
+
+ class delegate
+ {
+ public:
+ delegate(int n) : n(n) {}
+ delegate(): delegate(2354) {}
+
+ virtual int getval() { return this->n; };
+ protected:
+ int n;
+ };
+
+ class overridden : public delegate
+ {
+ public:
+ overridden(int n): delegate(n) {}
+ virtual int getval() override final { return this->n * 2; }
+ };
+
+ class nocopy
+ {
+ public:
+ nocopy(int i): i(i) {}
+ nocopy() = default;
+ nocopy(const nocopy&) = delete;
+ nocopy & operator=(const nocopy&) = delete;
+ private:
+ int i;
+ };
+
+ // for testing lambda expressions
+ template <typename Ret, typename Fn> Ret eval(Fn f, Ret v)
+ {
+ return f(v);
+ }
+
+ // for testing variadic templates and trailing return types
+ template <typename V> auto sum(V first) -> V
+ {
+ return first;
+ }
+ template <typename V, typename... Args> auto sum(V first, Args... rest) -> V
+ {
+ return first + sum(rest...);
+ }
+}
+'
+
+# Test code for whether the C++ compiler supports C++11 (body of main)
+ac_cxx_conftest_cxx11_main='
+{
+ // Test auto and decltype
+ auto a1 = 6538;
+ auto a2 = 48573953.4;
+ auto a3 = "String literal";
+
+ int total = 0;
+ for (auto i = a3; *i; ++i) { total += *i; }
+
+ decltype(a2) a4 = 34895.034;
+}
+{
+ // Test constexpr
+ short sa[cxx11test::get_val()] = { 0 };
+}
+{
+ // Test initializer lists
+ cxx11test::testinit il = { 4323, 435234.23544 };
+}
+{
+ // Test range-based for
+ int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3,
+ 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
+ for (auto &x : array) { x += 23; }
+}
+{
+ // Test lambda expressions
+ using cxx11test::eval;
+ assert (eval ([](int x) { return x*2; }, 21) == 42);
+ double d = 2.0;
+ assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0);
+ assert (d == 5.0);
+ assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0);
+ assert (d == 5.0);
+}
+{
+ // Test use of variadic templates
+ using cxx11test::sum;
+ auto a = sum(1);
+ auto b = sum(1, 2);
+ auto c = sum(1.0, 2.0, 3.0);
+}
+{
+ // Test constructor delegation
+ cxx11test::delegate d1;
+ cxx11test::delegate d2();
+ cxx11test::delegate d3(45);
+}
+{
+ // Test override and final
+ cxx11test::overridden o1(55464);
+}
+{
+ // Test nullptr
+ char *c = nullptr;
+}
+{
+ // Test template brackets
+ test_template<::test_template<int>> v(test_template<int>(12));
+}
+{
+ // Unicode literals
+ char const *utf8 = u8"UTF-8 string \u2500";
+ char16_t const *utf16 = u"UTF-8 string \u2500";
+ char32_t const *utf32 = U"UTF-32 string \u2500";
+}
+'
+
+# Test code for whether the C compiler supports C++11 (complete).
+ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals}
+${ac_cxx_conftest_cxx11_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_cxx_conftest_cxx98_main}
+ ${ac_cxx_conftest_cxx11_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C++98 (complete).
+ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals}
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_cxx_conftest_cxx98_main}
+ return ok;
+}
+"
+
+as_fn_append ac_header_cxx_list " stdio.h stdio_h HAVE_STDIO_H"
+as_fn_append ac_header_cxx_list " stdlib.h stdlib_h HAVE_STDLIB_H"
+as_fn_append ac_header_cxx_list " string.h string_h HAVE_STRING_H"
+as_fn_append ac_header_cxx_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
+as_fn_append ac_header_cxx_list " stdint.h stdint_h HAVE_STDINT_H"
+as_fn_append ac_header_cxx_list " strings.h strings_h HAVE_STRINGS_H"
+as_fn_append ac_header_cxx_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
+as_fn_append ac_header_cxx_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
+as_fn_append ac_header_cxx_list " unistd.h unistd_h HAVE_UNISTD_H"
+
+# Auxiliary files required by this configure script.
+ac_aux_files="compile config.guess config.sub missing install-sh"
+
+# Locations in which to look for auxiliary files.
+ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.."
+
+# Search for a directory containing all of the required auxiliary files,
+# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
+# If we don't find one directory that contains all the files we need,
+# we report the set of missing files from the *first* directory in
+# $ac_aux_dir_candidates and give up.
+ac_missing_aux_files=""
+ac_first_candidate=:
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in $ac_aux_dir_candidates
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ as_found=:
+
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5
+ ac_aux_dir_found=yes
+ ac_install_sh=
+ for ac_aux in $ac_aux_files
+ do
+ # As a special case, if "install-sh" is required, that requirement
+ # can be satisfied by any of "install-sh", "install.sh", or "shtool",
+ # and $ac_install_sh is set appropriately for whichever one is found.
+ if test x"$ac_aux" = x"install-sh"
+ then
+ if test -f "${as_dir}install-sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5
+ ac_install_sh="${as_dir}install-sh -c"
+ elif test -f "${as_dir}install.sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5
+ ac_install_sh="${as_dir}install.sh -c"
+ elif test -f "${as_dir}shtool"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5
+ ac_install_sh="${as_dir}shtool install -c"
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} install-sh"
+ else
+ break
+ fi
+ fi
+ else
+ if test -f "${as_dir}${ac_aux}"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
+ else
+ break
+ fi
+ fi
+ fi
+ done
+ if test "$ac_aux_dir_found" = yes; then
+ ac_aux_dir="$as_dir"
+ break
+ fi
+ ac_first_candidate=false
+
+ as_found=false
+done
+IFS=$as_save_IFS
+if $as_found
+then :
+
+else $as_nop
+ as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5
+fi
+
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+if test -f "${ac_aux_dir}config.guess"; then
+ ac_config_guess="$SHELL ${ac_aux_dir}config.guess"
+fi
+if test -f "${ac_aux_dir}config.sub"; then
+ ac_config_sub="$SHELL ${ac_aux_dir}config.sub"
+fi
+if test -f "$ac_aux_dir/configure"; then
+ ac_configure="$SHELL ${ac_aux_dir}configure"
+fi
+
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
@@ -2063,12 +2582,12 @@ for ac_var in $ac_precious_vars; do
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
@@ -2077,24 +2596,24 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
@@ -2104,11 +2623,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi
done
if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
+ and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -2123,17 +2643,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
+if test ${enable_maintainer_mode+y}
+then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
+else $as_nop
USE_MAINTAINER_MODE=no
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+printf "%s\n" "$USE_MAINTAINER_MODE" >&6; }
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
@@ -2147,36 +2668,9 @@ fi
am__api_version='1.16'
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-# Find a good install program. We prefer a C program (faster),
+ # Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
@@ -2190,20 +2684,25 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+printf %s "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+if test ${ac_cv_path_install+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ # Account for fact that we put trailing slashes in our PATH walk.
+case $as_dir in #((
+ ./ | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
@@ -2213,13 +2712,13 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
@@ -2227,12 +2726,12 @@ case $as_dir/ in #((
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c"
break 3
fi
fi
@@ -2248,7 +2747,7 @@ IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
- if test "${ac_cv_path_install+set}" = set; then
+ if test ${ac_cv_path_install+y}; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
@@ -2258,8 +2757,8 @@ fi
INSTALL=$ac_install_sh
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+printf "%s\n" "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -2269,8 +2768,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+printf %s "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -2324,8 +2823,8 @@ else
as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
@@ -2344,26 +2843,23 @@ test "$program_suffix" != NONE &&
# Double any \ or $.
# By default was `s,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"`
+
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+
+ if test x"${MISSING+set}" != xset; then
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh+set}" != xset; then
@@ -2383,11 +2879,12 @@ if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
@@ -2395,11 +2892,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2410,11 +2911,11 @@ fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+printf "%s\n" "$STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -2423,11 +2924,12 @@ if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
@@ -2435,11 +2937,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2450,11 +2956,11 @@ fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+printf "%s\n" "$ac_ct_STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
@@ -2462,8 +2968,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
@@ -2475,25 +2981,31 @@ fi
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5
+printf %s "checking for a race-free mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${ac_cv_path_mkdir+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
+ as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir ('*'coreutils) '* | \
+ 'BusyBox '* | \
'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext
break 3;;
esac
done
@@ -2504,7 +3016,7 @@ IFS=$as_save_IFS
fi
test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
+ if test ${ac_cv_path_mkdir+y}; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
# As a last resort, use the slow shell script. Don't cache a
@@ -2514,18 +3026,19 @@ fi
MKDIR_P="$ac_install_sh -d"
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+printf "%s\n" "$MKDIR_P" >&6; }
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AWK+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
@@ -2533,11 +3046,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2548,24 +3065,25 @@ fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+printf "%s\n" "$AWK" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
test -n "$AWK" && break
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@@ -2581,12 +3099,12 @@ esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -2600,7 +3118,8 @@ fi
rmdir .tst 2>/dev/null
# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
+if test ${enable_silent_rules+y}
+then :
enableval=$enable_silent_rules;
fi
@@ -2610,12 +3129,13 @@ case $enable_silent_rules in # (((
*) AM_DEFAULT_VERBOSITY=1;;
esac
am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+printf %s "checking whether $am_make supports nested variables... " >&6; }
+if test ${am_cv_make_support_nested_variables+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if printf "%s\n" 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
@@ -2627,8 +3147,8 @@ else
am_cv_make_support_nested_variables=no
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
if test $am_cv_make_support_nested_variables = yes; then
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
@@ -2660,17 +3180,13 @@ fi
# Define the identity of the package.
PACKAGE='asio'
- VERSION='1.20.0'
+ VERSION='1.30.2'
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
+printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
+printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h
# Some tools Automake needs.
@@ -2702,47 +3218,16 @@ AMTAR='$${TAR-tar}'
# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar plaintar pax cpio none'
-
-# The POSIX 1988 'ustar' format is defined with fixed-size fields.
- # There is notably a 21 bits limit for the UID and the GID. In fact,
- # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
- # and bug#13588).
- am_max_uid=2097151 # 2^21 - 1
- am_max_gid=$am_max_uid
- # The $UID and $GID variables are not portable, so we need to resort
- # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
- # below are definitely unexpected, so allow the users to see them
- # (that is, avoid stderr redirection).
- am_uid=`id -u || echo unknown`
- am_gid=`id -g || echo unknown`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5
-$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; }
- if test $am_uid -le $am_max_uid; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- _am_tools=none
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5
-$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; }
- if test $am_gid -le $am_max_gid; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- _am_tools=none
- fi
+_am_tools='gnutar pax cpio none'
+
+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
-$as_echo_n "checking how to create a ustar tar archive... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5
+printf %s "checking how to create a pax tar archive... " >&6; }
# Go ahead even if we have the value already cached. We do so because we
# need to set the values for the 'am__tar' and 'am__untar' variables.
- _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
+ _am_tools=${am_cv_prog_tar_pax-$_am_tools}
for _am_tool in $_am_tools; do
case $_am_tool in
@@ -2754,8 +3239,8 @@ $as_echo_n "checking how to create a ustar tar archive... " >&6; }
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && break
done
- am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
+ am__tar="$_am_tar --format=posix -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=posix -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
@@ -2767,14 +3252,14 @@ $as_echo_n "checking how to create a ustar tar archive... " >&6; }
am__untar='tar xf -'
;;
pax)
- am__tar='pax -L -x ustar -w "$$tardir"'
- am__tar_='pax -L -x ustar -w "$tardir"'
+ am__tar='pax -L -x pax -w "$$tardir"'
+ am__tar_='pax -L -x pax -w "$tardir"'
am__untar='pax -r'
;;
cpio)
- am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
- am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
- am__untar='cpio -i -H ustar -d'
+ am__tar='find "$$tardir" -print | cpio -o -H pax -L'
+ am__tar_='find "$tardir" -print | cpio -o -H pax -L'
+ am__untar='cpio -i -H pax -d'
;;
none)
am__tar=false
@@ -2785,7 +3270,7 @@ $as_echo_n "checking how to create a ustar tar archive... " >&6; }
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
- test -n "${am_cv_prog_tar_ustar}" && break
+ test -n "${am_cv_prog_tar_pax}" && break
# tar/untar a dummy directory, and stop if the command works.
rm -rf conftest.dir
@@ -2813,17 +3298,32 @@ $as_echo_n "checking how to create a ustar tar archive... " >&6; }
done
rm -rf conftest.dir
- if ${am_cv_prog_tar_ustar+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- am_cv_prog_tar_ustar=$_am_tool
+ if test ${am_cv_prog_tar_pax+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ am_cv_prog_tar_pax=$_am_tool
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
-$as_echo "$am_cv_prog_tar_ustar" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5
+printf "%s\n" "$am_cv_prog_tar_pax" >&6; }
+
+
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
@@ -2870,26 +3370,29 @@ END
fi
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+
+ # Make sure we can run config.sub.
+$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+printf %s "checking build system type... " >&6; }
+if test ${ac_cv_build+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+ ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+printf "%s\n" "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
@@ -2908,21 +3411,22 @@ IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+printf %s "checking host system type... " >&6; }
+if test ${ac_cv_host+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+ ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+printf "%s\n" "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
@@ -2941,12 +3445,21 @@ IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+
+
+
+
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
-$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; }
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target >confinc.out
@@ -2982,11 +3495,12 @@ esac
fi
done
rm -f confinc.* confmf.*
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
-$as_echo "${_am_result}" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+printf "%s\n" "${_am_result}" >&6; }
# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
+if test ${enable_dependency_tracking+y}
+then :
enableval=$enable_dependency_tracking;
fi
@@ -3012,11 +3526,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3024,11 +3539,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3039,11 +3558,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3052,11 +3571,12 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
@@ -3064,11 +3584,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3079,11 +3603,11 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
@@ -3091,8 +3615,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -3105,11 +3629,12 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3117,11 +3642,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3132,11 +3661,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3145,11 +3674,12 @@ fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3158,15 +3688,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3182,18 +3716,18 @@ if test $ac_prog_rejected = yes; then
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3204,11 +3738,12 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3216,11 +3751,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3231,11 +3770,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3248,11 +3787,12 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
@@ -3260,11 +3800,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3275,11 +3819,11 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3291,8 +3835,8 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -3300,25 +3844,129 @@ esac
fi
fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
+set dummy ${ac_tool_prefix}clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "clang", so it can be a program name with args.
+set dummy clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+
+
+test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
+for ac_option in --version -v -V -qversion -version; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -3328,7 +3976,7 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
@@ -3336,7 +3984,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -3348,9 +3996,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+printf %s "checking whether the C compiler works... " >&6; }
+ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
@@ -3371,11 +4019,12 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
@@ -3392,7 +4041,7 @@ do
# certainly right.
break;;
*.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
@@ -3408,44 +4057,46 @@ do
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
-else
+else $as_nop
ac_file=''
fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+printf %s "checking for C compiler default output file name... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+printf "%s\n" "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+printf %s "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -3459,15 +4110,15 @@ for ac_file in conftest.exe conftest conftest.*; do
* ) break;;
esac
done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+else $as_nop
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+printf "%s\n" "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
@@ -3476,7 +4127,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
int
-main ()
+main (void)
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
@@ -3488,8 +4139,8 @@ _ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+printf %s "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
@@ -3497,10 +4148,10 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
@@ -3508,39 +4159,40 @@ $as_echo "$ac_try_echo"; } >&5
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+printf "%s\n" "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+printf %s "checking for suffix of object files... " >&6; }
+if test ${ac_cv_objext+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -3554,11 +4206,12 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
@@ -3567,31 +4220,32 @@ $as_echo "$ac_try_echo"; } >&5
break;;
esac
done
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+printf "%s\n" "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
+printf %s "checking whether the compiler supports GNU C... " >&6; }
+if test ${ac_cv_c_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -3601,29 +4255,33 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_compiler_gnu=yes
-else
+else $as_nop
ac_compiler_gnu=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
-ac_test_CFLAGS=${CFLAGS+set}
+ac_test_CFLAGS=${CFLAGS+y}
ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+printf %s "checking whether $CC accepts -g... " >&6; }
+if test ${ac_cv_prog_cc_g+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
@@ -3632,57 +4290,60 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
-else
+else $as_nop
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
-else
+else $as_nop
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
+if test $ac_test_CFLAGS; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
@@ -3697,94 +4358,144 @@ else
CFLAGS=
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
+ac_prog_cc_stdc=no
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
+printf %s "checking for $CC option to enable C11 features... " >&6; }
+if test ${ac_cv_prog_cc_c11+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cc_c11=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+$ac_c_conftest_c11_program
+_ACEOF
+for ac_arg in '' -std=gnu11
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+fi
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+if test "x$ac_cv_prog_cc_c11" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cc_c11" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
+ CC="$CC $ac_cv_prog_cc_c11"
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
+ ac_prog_cc_stdc=c11
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
+printf %s "checking for $CC option to enable C99 features... " >&6; }
+if test ${ac_cv_prog_cc_c99+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c99_program
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+fi
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
+if test "x$ac_cv_prog_cc_c99" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cc_c99" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
+ CC="$CC $ac_cv_prog_cc_c99"
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+ ac_prog_cc_stdc=c99
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
+printf %s "checking for $CC option to enable C89 features... " >&6; }
+if test ${ac_cv_prog_cc_c89+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c89_program
_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
+ if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_c89=$ac_arg
fi
-rm -f core conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
-
fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
+if test "x$ac_cv_prog_cc_c89" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cc_c89" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
+ CC="$CC $ac_cv_prog_cc_c89"
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+ ac_prog_cc_stdc=c89
+fi
fi
ac_ext=c
@@ -3793,21 +4504,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-ac_ext=c
+
+ ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+printf %s "checking whether $CC understands -c and -o together... " >&6; }
+if test ${am_cv_prog_cc_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -3835,8 +4548,8 @@ _ACEOF
rm -f core conftest*
unset am_i
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+printf "%s\n" "$am_cv_prog_cc_c_o" >&6; }
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
@@ -3854,11 +4567,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
depcc="$CC" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CC_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
@@ -3965,8 +4679,8 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
if
@@ -3981,6 +4695,12 @@ fi
+
+
+
+
+
+
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3991,15 +4711,16 @@ if test -z "$CXX"; then
CXX=$CCC
else
if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CXX"; then
ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
@@ -4007,11 +4728,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -4022,11 +4747,11 @@ fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+printf "%s\n" "$CXX" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -4035,15 +4760,16 @@ fi
fi
if test -z "$CXX"; then
ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_CXX"; then
ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
@@ -4051,11 +4777,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -4066,11 +4796,11 @@ fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+printf "%s\n" "$ac_ct_CXX" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -4082,8 +4812,8 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CXX=$ac_ct_CXX
@@ -4093,7 +4823,7 @@ fi
fi
fi
# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
@@ -4103,7 +4833,7 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -4113,20 +4843,21 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5
+printf %s "checking whether the compiler supports GNU C++... " >&6; }
+if test ${ac_cv_cxx_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -4136,29 +4867,33 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_compiler_gnu=yes
-else
+else $as_nop
ac_compiler_gnu=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
if test $ac_compiler_gnu = yes; then
GXX=yes
else
GXX=
fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_test_CXXFLAGS=${CXXFLAGS+y}
ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+printf %s "checking whether $CXX accepts -g... " >&6; }
+if test ${ac_cv_prog_cxx_g+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_cv_prog_cxx_g=no
@@ -4167,57 +4902,60 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_prog_cxx_g=yes
-else
+else $as_nop
CXXFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
-else
+else $as_nop
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_prog_cxx_g=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+printf "%s\n" "$ac_cv_prog_cxx_g" >&6; }
+if test $ac_test_CXXFLAGS; then
CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
if test "$GXX" = yes; then
@@ -4232,6 +4970,100 @@ else
CXXFLAGS=
fi
fi
+ac_prog_cxx_stdcxx=no
+if test x$ac_prog_cxx_stdcxx = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
+printf %s "checking for $CXX option to enable C++11 features... " >&6; }
+if test ${ac_cv_prog_cxx_11+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cxx_11=no
+ac_save_CXX=$CXX
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_cxx_conftest_cxx11_program
+_ACEOF
+for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA
+do
+ CXX="$ac_save_CXX $ac_arg"
+ if ac_fn_cxx_try_compile "$LINENO"
+then :
+ ac_cv_prog_cxx_cxx11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cxx_cxx11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CXX=$ac_save_CXX
+fi
+
+if test "x$ac_cv_prog_cxx_cxx11" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cxx_cxx11" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5
+printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; }
+ CXX="$CXX $ac_cv_prog_cxx_cxx11"
+fi
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11
+ ac_prog_cxx_stdcxx=cxx11
+fi
+fi
+if test x$ac_prog_cxx_stdcxx = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
+printf %s "checking for $CXX option to enable C++98 features... " >&6; }
+if test ${ac_cv_prog_cxx_98+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cxx_98=no
+ac_save_CXX=$CXX
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_cxx_conftest_cxx98_program
+_ACEOF
+for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA
+do
+ CXX="$ac_save_CXX $ac_arg"
+ if ac_fn_cxx_try_compile "$LINENO"
+then :
+ ac_cv_prog_cxx_cxx98=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cxx_cxx98" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CXX=$ac_save_CXX
+fi
+
+if test "x$ac_cv_prog_cxx_cxx98" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cxx_cxx98" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5
+printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; }
+ CXX="$CXX $ac_cv_prog_cxx_cxx98"
+fi
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98
+ ac_prog_cxx_stdcxx=cxx98
+fi
+fi
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4240,11 +5072,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
depcc="$CXX" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CXX_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
@@ -4351,8 +5184,8 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; }
CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
if
@@ -4375,11 +5208,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
@@ -4387,11 +5221,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -4402,11 +5240,11 @@ fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+printf "%s\n" "$RANLIB" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -4415,11 +5253,12 @@ if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
@@ -4427,11 +5266,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -4442,11 +5285,11 @@ fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+printf "%s\n" "$ac_ct_RANLIB" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_RANLIB" = x; then
@@ -4454,8 +5297,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
RANLIB=$ac_ct_RANLIB
@@ -4466,12 +5309,29 @@ fi
-$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+# Check whether --with-pkgconfigdir was given.
+if test ${with_pkgconfigdir+y}
+then :
+ withval=$with_pkgconfigdir;
+else $as_nop
+ with_pkgconfigdir='${libdir}/pkgconfig'
+fi
+
+pkgconfigdir=$with_pkgconfigdir
+
+
+
+
+
+
+printf "%s\n" "#define _REENTRANT 1" >>confdefs.h
# Check whether --with-boost was given.
-if test "${with_boost+set}" = set; then :
+if test ${with_boost+y}
+then :
withval=$with_boost;
if test "${withval}" = no; then
STANDALONE="yes"
@@ -4483,7 +5343,7 @@ if test "${with_boost+set}" = set; then :
CPPFLAGS="$CPPFLAGS -DASIO_ENABLE_BOOST -DBOOST_CHRONO_HEADER_ONLY -DBOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING"
fi
-else
+else $as_nop
STANDALONE="yes"
@@ -4491,7 +5351,8 @@ fi
# Check whether --enable-separate-compilation was given.
-if test "${enable_separate_compilation+set}" = set; then :
+if test ${enable_separate_compilation+y}
+then :
enableval=$enable_separate_compilation;
SEPARATE_COMPILATION=yes
@@ -4499,7 +5360,8 @@ fi
# Check whether --enable-boost-coroutine was given.
-if test "${enable_boost_coroutine+set}" = set; then :
+if test ${enable_boost_coroutine+y}
+then :
enableval=$enable_boost_coroutine;
HAVE_BOOST_COROUTINE=yes
@@ -4508,403 +5370,40 @@ fi
if test "$STANDALONE" != yes; then
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
+ac_header= ac_cache=
+for ac_item in $ac_header_cxx_list
do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
+ if test $ac_cache; then
+ ac_fn_cxx_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
+ if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
+ printf "%s\n" "#define $ac_item 1" >> confdefs.h
fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ ac_header= ac_cache=
+ elif test $ac_header; then
+ ac_cache=$ac_item
+ else
+ ac_header=$ac_item
fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
+done
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-fi
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_run "$LINENO"; then :
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-fi
+if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
+then :
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
fi
+ac_fn_cxx_check_header_compile "$LINENO" "boost/noncopyable.hpp" "ac_cv_header_boost_noncopyable_hpp" "$ac_includes_default"
+if test "x$ac_cv_header_boost_noncopyable_hpp" = xyes
+then :
-done
-
-
-ac_fn_cxx_check_header_mongrel "$LINENO" "boost/noncopyable.hpp" "ac_cv_header_boost_noncopyable_hpp" "$ac_includes_default"
-if test "x$ac_cv_header_boost_noncopyable_hpp" = xyes; then :
-
-else
+else $as_nop
echo "Can't find boost headers. Please check the location of the boost"
echo "distribution and rerun configure using the --with-boost=DIR option."
@@ -4913,12 +5412,12 @@ else
fi
-
fi
# Check whether --with-openssl was given.
-if test "${with_openssl+set}" = set; then :
+if test ${with_openssl+y}
+then :
withval=$with_openssl;
CPPFLAGS="$CPPFLAGS -I${withval}/include"
LIBS="$LIBS -L${withval}/lib"
@@ -4926,17 +5425,17 @@ if test "${with_openssl+set}" = set; then :
fi
-ac_fn_cxx_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
+ac_fn_cxx_check_header_compile "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_ssl_h" = xyes
+then :
-else
+else $as_nop
OPENSSL_FOUND=no
fi
-
if test x$OPENSSL_FOUND != xno; then
LIBS="$LIBS -lssl -lcrypto"
fi
@@ -5013,34 +5512,35 @@ if test "$SEPARATE_COMPILATION" = yes; then
CPPFLAGS="$CPPFLAGS -DASIO_SEPARATE_COMPILATION"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++11 is enabled" >&5
-$as_echo_n "checking whether C++11 is enabled... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++11 is enabled" >&5
+printf %s "checking whether C++11 is enabled... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if __cplusplus < 201103L
#error C++11 not available
#endif
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
HAVE_CXX11=yes;
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
HAVE_CXX11=no;
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++14 is enabled" >&5
-$as_echo_n "checking whether C++14 is enabled... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++14 is enabled" >&5
+printf %s "checking whether C++14 is enabled... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined(__GNUC__) && !defined(__clang__)
@@ -5052,84 +5552,99 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#error C++14 not available
#endif
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
HAVE_CXX14=yes;
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
HAVE_CXX14=no;
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++17 is enabled" >&5
-$as_echo_n "checking whether C++17 is enabled... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++17 is enabled" >&5
+printf %s "checking whether C++17 is enabled... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if __cplusplus < 201703L
#error C++17 not available
#endif
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
HAVE_CXX17=yes;
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
HAVE_CXX17=no;
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++20 is enabled" >&5
-$as_echo_n "checking whether C++20 is enabled... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++20 is enabled" >&5
+printf %s "checking whether C++20 is enabled... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if __cplusplus < 202002L
#error C++20 not available
#endif
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
HAVE_CXX20=yes;
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
HAVE_CXX20=no;
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether coroutines are enabled" >&5
-$as_echo_n "checking whether coroutines are enabled... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether coroutines are enabled" >&5
+printf %s "checking whether coroutines are enabled... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined(__clang__)
- # if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
- # if __has_include(<experimental/coroutine>)
- # define ASIO_HAS_CO_AWAIT 1
+ # if (__clang_major__ >= 14)
+ # if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
+ # if __has_include(<coroutine>)
+ # define ASIO_HAS_CO_AWAIT 1
+ # endif
+ # elif (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
+ # if __has_include(<experimental/coroutine>)
+ # define ASIO_HAS_CO_AWAIT 1
+ # endif
+ # endif
+ # else
+ # if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
+ # if __has_include(<experimental/coroutine>)
+ # define ASIO_HAS_CO_AWAIT 1
+ # endif
# endif
# endif
#elif defined(__GNUC__)
@@ -5143,23 +5658,24 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
# error coroutines not available
#endif
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
HAVE_COROUTINES=yes;
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
HAVE_COROUTINES=no;
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
if test "$GXX" = yes; then
if test "$STANDALONE" = yes; then
@@ -5251,7 +5767,10 @@ else
fi
-ac_config_files="$ac_config_files Makefile include/Makefile src/Makefile src/tests/Makefile src/tests/properties/Makefile src/examples/cpp03/Makefile src/examples/cpp11/Makefile src/examples/cpp14/Makefile src/examples/cpp17/Makefile"
+ac_config_files="$ac_config_files asio.pc"
+
+
+ac_config_files="$ac_config_files Makefile include/Makefile src/Makefile src/tests/Makefile src/tests/properties/Makefile src/examples/cpp11/Makefile src/examples/cpp14/Makefile src/examples/cpp17/Makefile src/examples/cpp20/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -5280,8 +5799,8 @@ _ACEOF
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -5311,15 +5830,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
/^ac_cv_env_/b end
t clear
:clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
@@ -5333,8 +5852,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;}
fi
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -5387,7 +5906,7 @@ U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -5402,14 +5921,14 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+printf %s "checking that generated files are newer than configure... " >&6; }
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
+printf "%s\n" "done" >&6; }
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
@@ -5475,8 +5994,8 @@ fi
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
@@ -5499,14 +6018,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
+else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
@@ -5516,46 +6037,46 @@ esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -5564,13 +6085,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -5579,8 +6093,12 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
@@ -5592,30 +6110,10 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
@@ -5628,13 +6126,14 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
+
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -5661,18 +6160,20 @@ as_fn_unset ()
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
+
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
+else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
@@ -5684,12 +6185,13 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
+else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
@@ -5720,7 +6222,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -5742,6 +6244,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -5755,6 +6261,12 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -5796,7 +6308,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -5805,7 +6317,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -5867,8 +6379,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by asio $as_me 1.20.0, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+This file was extended by asio $as_me 1.30.2, which was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -5921,14 +6433,16 @@ $config_commands
Report bugs to the package provider."
_ACEOF
+ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
+ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-asio config.status 1.20.0
-configured by $0, generated by GNU Autoconf 2.69,
+asio config.status 1.30.2
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -5968,21 +6482,21 @@ do
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
+ printf "%s\n" "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
+ printf "%s\n" "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h | --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
+ printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
@@ -6010,7 +6524,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
@@ -6024,7 +6538,7 @@ exec 5>>config.log
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
- $as_echo "$ac_log"
+ printf "%s\n" "$ac_log"
} >&5
_ACEOF
@@ -6043,15 +6557,16 @@ for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "asio.pc") CONFIG_FILES="$CONFIG_FILES asio.pc" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/Makefile" ;;
"src/tests/properties/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/properties/Makefile" ;;
- "src/examples/cpp03/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp03/Makefile" ;;
"src/examples/cpp11/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp11/Makefile" ;;
"src/examples/cpp14/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp14/Makefile" ;;
"src/examples/cpp17/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp17/Makefile" ;;
+ "src/examples/cpp20/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp20/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@@ -6063,8 +6578,8 @@ done
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+ test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
+ test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands
fi
# Have a temporary directory for convenience. Make it in the build tree
@@ -6292,7 +6807,7 @@ do
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
@@ -6300,17 +6815,17 @@ do
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+printf "%s\n" "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
+ ac_sed_conf_input=`printf "%s\n" "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
@@ -6327,7 +6842,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
+printf "%s\n" X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -6351,9 +6866,9 @@ $as_echo X"$ac_file" |
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -6415,8 +6930,8 @@ ac_sed_dataroot='
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
@@ -6460,9 +6975,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
@@ -6474,8 +6989,8 @@ which seems to be undefined. Please make sure it is defined" >&2;}
;;
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
+ :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+printf "%s\n" "$as_me: executing $ac_file commands" >&6;}
;;
esac
@@ -6501,7 +7016,7 @@ esac
for am_mf
do
# Strip MF so we end up with the name of the file.
- am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+ am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
@@ -6513,7 +7028,7 @@ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$am_mf" : 'X\(//\)[^/]' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$am_mf" |
+printf "%s\n" X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -6535,7 +7050,7 @@ $as_echo X"$am_mf" |
$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$am_mf" |
+printf "%s\n" X/"$am_mf" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -6560,10 +7075,12 @@ $as_echo X/"$am_mf" |
(exit $ac_status); } || am_rc=$?
done
if test $am_rc -ne 0; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. Try re-running configure with the
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE=\"gmake\" (or whatever is
+ necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
@@ -6609,7 +7126,8 @@ if test "$no_create" != yes; then
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
+
diff --git a/3rdparty/asio/configure.ac b/3rdparty/asio/configure.ac
index 036e41a1b78..15e470fd1a4 100644
--- a/3rdparty/asio/configure.ac
+++ b/3rdparty/asio/configure.ac
@@ -1,13 +1,14 @@
-AC_INIT(asio, [1.20.0])
+AC_INIT(asio, [1.30.2])
AC_CONFIG_SRCDIR(include/asio.hpp)
AM_MAINTAINER_MODE
-AM_INIT_AUTOMAKE([tar-ustar])
+AM_INIT_AUTOMAKE([tar-pax])
AC_CANONICAL_HOST
AM_PROG_CC_C_O
AC_PROG_CXX
AC_LANG(C++)
AC_PROG_RANLIB
+PKG_INSTALLDIR
AC_DEFINE(_REENTRANT, [1], [Define this])
@@ -184,9 +185,21 @@ AC_MSG_CHECKING([whether coroutines are enabled])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#if defined(__clang__)]]
- [[# if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)]]
- [[# if __has_include(<experimental/coroutine>)]]
- [[# define ASIO_HAS_CO_AWAIT 1]]
+ [[# if (__clang_major__ >= 14)]]
+ [[# if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)]]
+ [[# if __has_include(<coroutine>)]]
+ [[# define ASIO_HAS_CO_AWAIT 1]]
+ [[# endif]]
+ [[# elif (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)]]
+ [[# if __has_include(<experimental/coroutine>)]]
+ [[# define ASIO_HAS_CO_AWAIT 1]]
+ [[# endif]]
+ [[# endif]]
+ [[# else]]
+ [[# if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)]]
+ [[# if __has_include(<experimental/coroutine>)]]
+ [[# define ASIO_HAS_CO_AWAIT 1]]
+ [[# endif]]
[[# endif]]
[[# endif]]
[[#elif defined(__GNUC__)]]
@@ -231,13 +244,15 @@ AM_CONDITIONAL(HAVE_CXX20,test x$HAVE_CXX20 = xyes)
AM_CONDITIONAL(HAVE_COROUTINES,test x$HAVE_COROUTINES = xyes)
+AC_CONFIG_FILES([asio.pc])
+
AC_OUTPUT([
Makefile
include/Makefile
src/Makefile
src/tests/Makefile
src/tests/properties/Makefile
- src/examples/cpp03/Makefile
src/examples/cpp11/Makefile
src/examples/cpp14/Makefile
- src/examples/cpp17/Makefile])
+ src/examples/cpp17/Makefile
+ src/examples/cpp20/Makefile])
diff --git a/3rdparty/asio/depcomp b/3rdparty/asio/depcomp
index 4ebd5b3a2f2..715e34311ed 100644
--- a/3rdparty/asio/depcomp
+++ b/3rdparty/asio/depcomp
@@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2013-05-30.07; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -783,9 +783,9 @@ exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/3rdparty/asio/include/Makefile.am b/3rdparty/asio/include/Makefile.am
index 74933ee7d35..8f43766563e 100644
--- a/3rdparty/asio/include/Makefile.am
+++ b/3rdparty/asio/include/Makefile.am
@@ -1,16 +1,24 @@
# find . -name "*.*pp" | sed -e 's/^\.\///' | sed -e 's/^.*$/ & \\/' | sort
nobase_include_HEADERS = \
+ asio/any_completion_executor.hpp \
+ asio/any_completion_handler.hpp \
asio/any_io_executor.hpp \
+ asio/append.hpp \
+ asio/as_tuple.hpp \
asio/associated_allocator.hpp \
asio/associated_cancellation_slot.hpp \
asio/associated_executor.hpp \
+ asio/associated_immediate_executor.hpp \
asio/associator.hpp \
asio/async_result.hpp \
asio/awaitable.hpp \
asio/basic_datagram_socket.hpp \
asio/basic_deadline_timer.hpp \
+ asio/basic_file.hpp \
asio/basic_io_object.hpp \
+ asio/basic_random_access_file.hpp \
asio/basic_raw_socket.hpp \
+ asio/basic_readable_pipe.hpp \
asio/basic_seq_packet_socket.hpp \
asio/basic_serial_port.hpp \
asio/basic_signal_set.hpp \
@@ -20,10 +28,14 @@ nobase_include_HEADERS = \
asio/basic_socket_streambuf.hpp \
asio/basic_streambuf_fwd.hpp \
asio/basic_streambuf.hpp \
+ asio/basic_stream_file.hpp \
asio/basic_stream_socket.hpp \
asio/basic_waitable_timer.hpp \
+ asio/basic_writable_pipe.hpp \
+ asio/bind_allocator.hpp \
asio/bind_cancellation_slot.hpp \
asio/bind_executor.hpp \
+ asio/bind_immediate_executor.hpp \
asio/buffered_read_stream_fwd.hpp \
asio/buffered_read_stream.hpp \
asio/buffered_stream_fwd.hpp \
@@ -31,6 +43,7 @@ nobase_include_HEADERS = \
asio/buffered_write_stream_fwd.hpp \
asio/buffered_write_stream.hpp \
asio/buffer.hpp \
+ asio/buffer_registration.hpp \
asio/buffers_iterator.hpp \
asio/cancellation_signal.hpp \
asio/cancellation_state.hpp \
@@ -39,9 +52,12 @@ nobase_include_HEADERS = \
asio/completion_condition.hpp \
asio/compose.hpp \
asio/connect.hpp \
+ asio/connect_pipe.hpp \
+ asio/consign.hpp \
asio/coroutine.hpp \
asio/deadline_timer.hpp \
asio/defer.hpp \
+ asio/deferred.hpp \
asio/detached.hpp \
asio/detail/array_fwd.hpp \
asio/detail/array.hpp \
@@ -54,11 +70,11 @@ nobase_include_HEADERS = \
asio/detail/buffered_stream_storage.hpp \
asio/detail/buffer_resize_guard.hpp \
asio/detail/buffer_sequence_adapter.hpp \
- asio/detail/bulk_executor_op.hpp \
asio/detail/call_stack.hpp \
asio/detail/chrono.hpp \
asio/detail/chrono_time_traits.hpp \
asio/detail/completion_handler.hpp \
+ asio/detail/composed_work.hpp \
asio/detail/concurrency_hint.hpp \
asio/detail/conditionally_enabled_event.hpp \
asio/detail/conditionally_enabled_mutex.hpp \
@@ -76,20 +92,16 @@ nobase_include_HEADERS = \
asio/detail/epoll_reactor.hpp \
asio/detail/eventfd_select_interrupter.hpp \
asio/detail/event.hpp \
+ asio/detail/exception.hpp \
asio/detail/executor_function.hpp \
asio/detail/executor_op.hpp \
asio/detail/fd_set_adapter.hpp \
asio/detail/fenced_block.hpp \
asio/detail/functional.hpp \
asio/detail/future.hpp \
- asio/detail/gcc_arm_fenced_block.hpp \
- asio/detail/gcc_hppa_fenced_block.hpp \
- asio/detail/gcc_sync_fenced_block.hpp \
- asio/detail/gcc_x86_fenced_block.hpp \
asio/detail/global.hpp \
asio/detail/handler_alloc_helpers.hpp \
asio/detail/handler_cont_helpers.hpp \
- asio/detail/handler_invoke_helpers.hpp \
asio/detail/handler_tracking.hpp \
asio/detail/handler_type_requirements.hpp \
asio/detail/handler_work.hpp \
@@ -102,16 +114,21 @@ nobase_include_HEADERS = \
asio/detail/impl/epoll_reactor.ipp \
asio/detail/impl/eventfd_select_interrupter.ipp \
asio/detail/impl/handler_tracking.ipp \
+ asio/detail/impl/io_uring_descriptor_service.ipp \
+ asio/detail/impl/io_uring_file_service.ipp \
+ asio/detail/impl/io_uring_service.hpp \
+ asio/detail/impl/io_uring_service.ipp \
+ asio/detail/impl/io_uring_socket_service_base.ipp \
asio/detail/impl/kqueue_reactor.hpp \
asio/detail/impl/kqueue_reactor.ipp \
asio/detail/impl/null_event.ipp \
asio/detail/impl/pipe_select_interrupter.ipp \
asio/detail/impl/posix_event.ipp \
asio/detail/impl/posix_mutex.ipp \
+ asio/detail/impl/posix_serial_port_service.ipp \
asio/detail/impl/posix_thread.ipp \
asio/detail/impl/posix_tss_ptr.ipp \
asio/detail/impl/reactive_descriptor_service.ipp \
- asio/detail/impl/reactive_serial_port_service.ipp \
asio/detail/impl/reactive_socket_service_base.ipp \
asio/detail/impl/resolver_service_base.ipp \
asio/detail/impl/scheduler.ipp \
@@ -131,6 +148,7 @@ nobase_include_HEADERS = \
asio/detail/impl/timer_queue_ptime.ipp \
asio/detail/impl/timer_queue_set.ipp \
asio/detail/impl/win_event.ipp \
+ asio/detail/impl/win_iocp_file_service.ipp \
asio/detail/impl/win_iocp_handle_service.ipp \
asio/detail/impl/win_iocp_io_context.hpp \
asio/detail/impl/win_iocp_io_context.ipp \
@@ -145,15 +163,36 @@ nobase_include_HEADERS = \
asio/detail/impl/win_static_mutex.ipp \
asio/detail/impl/win_thread.ipp \
asio/detail/impl/win_tss_ptr.ipp \
+ asio/detail/initiate_defer.hpp \
+ asio/detail/initiate_dispatch.hpp \
+ asio/detail/initiate_post.hpp \
asio/detail/io_control.hpp \
asio/detail/io_object_impl.hpp \
+ asio/detail/io_uring_descriptor_read_at_op.hpp \
+ asio/detail/io_uring_descriptor_read_op.hpp \
+ asio/detail/io_uring_descriptor_service.hpp \
+ asio/detail/io_uring_descriptor_write_at_op.hpp \
+ asio/detail/io_uring_descriptor_write_op.hpp \
+ asio/detail/io_uring_file_service.hpp \
+ asio/detail/io_uring_null_buffers_op.hpp \
+ asio/detail/io_uring_operation.hpp \
+ asio/detail/io_uring_service.hpp \
+ asio/detail/io_uring_socket_accept_op.hpp \
+ asio/detail/io_uring_socket_connect_op.hpp \
+ asio/detail/io_uring_socket_recvfrom_op.hpp \
+ asio/detail/io_uring_socket_recvmsg_op.hpp \
+ asio/detail/io_uring_socket_recv_op.hpp \
+ asio/detail/io_uring_socket_send_op.hpp \
+ asio/detail/io_uring_socket_sendto_op.hpp \
+ asio/detail/io_uring_socket_service_base.hpp \
+ asio/detail/io_uring_socket_service.hpp \
+ asio/detail/io_uring_wait_op.hpp \
asio/detail/is_buffer_sequence.hpp \
asio/detail/is_executor.hpp \
asio/detail/keyword_tss_ptr.hpp \
asio/detail/kqueue_reactor.hpp \
asio/detail/limits.hpp \
asio/detail/local_free_on_block_exit.hpp \
- asio/detail/macos_fenced_block.hpp \
asio/detail/memory.hpp \
asio/detail/mutex.hpp \
asio/detail/non_const_lvalue.hpp \
@@ -178,6 +217,7 @@ nobase_include_HEADERS = \
asio/detail/posix_fd_set_adapter.hpp \
asio/detail/posix_global.hpp \
asio/detail/posix_mutex.hpp \
+ asio/detail/posix_serial_port_service.hpp \
asio/detail/posix_signal_blocker.hpp \
asio/detail/posix_static_mutex.hpp \
asio/detail/posix_thread.hpp \
@@ -185,7 +225,6 @@ nobase_include_HEADERS = \
asio/detail/push_options.hpp \
asio/detail/reactive_descriptor_service.hpp \
asio/detail/reactive_null_buffers_op.hpp \
- asio/detail/reactive_serial_port_service.hpp \
asio/detail/reactive_socket_accept_op.hpp \
asio/detail/reactive_socket_connect_op.hpp \
asio/detail/reactive_socket_recvfrom_op.hpp \
@@ -196,7 +235,6 @@ nobase_include_HEADERS = \
asio/detail/reactive_socket_service_base.hpp \
asio/detail/reactive_socket_service.hpp \
asio/detail/reactive_wait_op.hpp \
- asio/detail/reactor_fwd.hpp \
asio/detail/reactor.hpp \
asio/detail/reactor_op.hpp \
asio/detail/reactor_op_queue.hpp \
@@ -209,6 +247,7 @@ nobase_include_HEADERS = \
asio/detail/resolver_service.hpp \
asio/detail/scheduler.hpp \
asio/detail/scheduler_operation.hpp \
+ asio/detail/scheduler_task.hpp \
asio/detail/scheduler_thread_info.hpp \
asio/detail/scoped_lock.hpp \
asio/detail/scoped_ptr.hpp \
@@ -225,7 +264,6 @@ nobase_include_HEADERS = \
asio/detail/socket_option.hpp \
asio/detail/socket_select_interrupter.hpp \
asio/detail/socket_types.hpp \
- asio/detail/solaris_fenced_block.hpp \
asio/detail/source_location.hpp \
asio/detail/static_mutex.hpp \
asio/detail/std_event.hpp \
@@ -251,15 +289,15 @@ nobase_include_HEADERS = \
asio/detail/timer_scheduler.hpp \
asio/detail/tss_ptr.hpp \
asio/detail/type_traits.hpp \
- asio/detail/variadic_templates.hpp \
+ asio/detail/utility.hpp \
asio/detail/wait_handler.hpp \
asio/detail/wait_op.hpp \
asio/detail/winapp_thread.hpp \
asio/detail/wince_thread.hpp \
asio/detail/win_event.hpp \
asio/detail/win_fd_set_adapter.hpp \
- asio/detail/win_fenced_block.hpp \
asio/detail/win_global.hpp \
+ asio/detail/win_iocp_file_service.hpp \
asio/detail/win_iocp_handle_read_op.hpp \
asio/detail/win_iocp_handle_service.hpp \
asio/detail/win_iocp_handle_write_op.hpp \
@@ -308,62 +346,61 @@ nobase_include_HEADERS = \
asio/execution/bad_executor.hpp \
asio/execution/blocking.hpp \
asio/execution/blocking_adaptation.hpp \
- asio/execution/bulk_execute.hpp \
- asio/execution/bulk_guarantee.hpp \
- asio/execution/connect.hpp \
asio/execution/context.hpp \
asio/execution/context_as.hpp \
- asio/execution/detail/as_invocable.hpp \
- asio/execution/detail/as_operation.hpp \
- asio/execution/detail/as_receiver.hpp \
- asio/execution/detail/bulk_sender.hpp \
- asio/execution/detail/submit_receiver.hpp \
- asio/execution/detail/void_receiver.hpp \
- asio/execution/execute.hpp \
asio/execution/executor.hpp \
asio/execution/impl/bad_executor.ipp \
- asio/execution/impl/receiver_invocation_error.ipp \
asio/execution/invocable_archetype.hpp \
asio/execution/mapping.hpp \
asio/execution/occupancy.hpp \
- asio/execution/operation_state.hpp \
asio/execution/outstanding_work.hpp \
asio/execution/prefer_only.hpp \
- asio/execution/receiver.hpp \
- asio/execution/receiver_invocation_error.hpp \
asio/execution/relationship.hpp \
- asio/execution/schedule.hpp \
- asio/execution/scheduler.hpp \
- asio/execution/sender.hpp \
- asio/execution/set_done.hpp \
- asio/execution/set_error.hpp \
- asio/execution/set_value.hpp \
- asio/execution/start.hpp \
- asio/execution/submit.hpp \
asio/executor.hpp \
asio/executor_work_guard.hpp \
asio/experimental/append.hpp \
asio/experimental/as_single.hpp \
asio/experimental/as_tuple.hpp \
asio/experimental/awaitable_operators.hpp \
+ asio/experimental/basic_channel.hpp \
+ asio/experimental/basic_concurrent_channel.hpp \
asio/experimental/cancellation_condition.hpp \
+ asio/experimental/channel.hpp \
+ asio/experimental/channel_error.hpp \
+ asio/experimental/channel_traits.hpp \
+ asio/experimental/co_composed.hpp \
+ asio/experimental/co_spawn.hpp \
+ asio/experimental/concurrent_channel.hpp \
asio/experimental/coro.hpp \
+ asio/experimental/coro_traits.hpp \
asio/experimental/deferred.hpp \
- asio/experimental/detail/completion_handler_erasure.hpp \
+ asio/experimental/detail/channel_handler.hpp \
+ asio/experimental/detail/channel_message.hpp \
+ asio/experimental/detail/channel_operation.hpp \
+ asio/experimental/detail/channel_payload.hpp \
+ asio/experimental/detail/channel_receive_op.hpp \
+ asio/experimental/detail/channel_send_functions.hpp \
+ asio/experimental/detail/channel_send_op.hpp \
+ asio/experimental/detail/channel_service.hpp \
+ asio/experimental/detail/coro_completion_handler.hpp \
asio/experimental/detail/coro_promise_allocator.hpp \
- asio/experimental/detail/coro_traits.hpp \
+ asio/experimental/detail/has_signature.hpp \
+ asio/experimental/detail/impl/channel_service.hpp \
asio/experimental/detail/partial_promise.hpp \
- asio/experimental/impl/append.hpp \
asio/experimental/impl/as_single.hpp \
- asio/experimental/impl/as_tuple.hpp \
- asio/experimental/impl/deferred.hpp \
+ asio/experimental/impl/channel_error.ipp \
+ asio/experimental/impl/co_composed.hpp \
+ asio/experimental/impl/coro.hpp \
asio/experimental/impl/parallel_group.hpp \
- asio/experimental/impl/prepend.hpp \
asio/experimental/impl/promise.hpp \
+ asio/experimental/impl/use_coro.hpp \
+ asio/experimental/impl/use_promise.hpp \
asio/experimental/parallel_group.hpp \
asio/experimental/prepend.hpp \
asio/experimental/promise.hpp \
asio/experimental/use_coro.hpp \
+ asio/experimental/use_promise.hpp \
+ asio/file_base.hpp \
asio/generic/basic_endpoint.hpp \
asio/generic/datagram_protocol.hpp \
asio/generic/detail/endpoint.hpp \
@@ -371,31 +408,34 @@ nobase_include_HEADERS = \
asio/generic/raw_protocol.hpp \
asio/generic/seq_packet_protocol.hpp \
asio/generic/stream_protocol.hpp \
- asio/handler_alloc_hook.hpp \
asio/handler_continuation_hook.hpp \
- asio/handler_invoke_hook.hpp \
asio/high_resolution_timer.hpp \
asio.hpp \
+ asio/impl/any_completion_executor.ipp \
+ asio/impl/any_io_executor.ipp \
+ asio/impl/append.hpp \
+ asio/impl/as_tuple.hpp \
asio/impl/awaitable.hpp \
asio/impl/buffered_read_stream.hpp \
asio/impl/buffered_write_stream.hpp \
+ asio/impl/cancellation_signal.ipp \
asio/impl/co_spawn.hpp \
- asio/impl/compose.hpp \
asio/impl/connect.hpp \
- asio/impl/defer.hpp \
+ asio/impl/connect_pipe.hpp \
+ asio/impl/connect_pipe.ipp \
+ asio/impl/consign.hpp \
+ asio/impl/deferred.hpp \
asio/impl/detached.hpp \
- asio/impl/dispatch.hpp \
asio/impl/error_code.ipp \
asio/impl/error.ipp \
asio/impl/execution_context.hpp \
asio/impl/execution_context.ipp \
asio/impl/executor.hpp \
asio/impl/executor.ipp \
- asio/impl/handler_alloc_hook.ipp \
asio/impl/io_context.hpp \
asio/impl/io_context.ipp \
asio/impl/multiple_exceptions.ipp \
- asio/impl/post.hpp \
+ asio/impl/prepend.hpp \
asio/impl/read_at.hpp \
asio/impl/read.hpp \
asio/impl/read_until.hpp \
@@ -458,6 +498,7 @@ nobase_include_HEADERS = \
asio/ip/unicast.hpp \
asio/ip/v6_only.hpp \
asio/is_applicable_property.hpp \
+ asio/is_contiguous_iterator.hpp \
asio/is_executor.hpp \
asio/is_read_buffered.hpp \
asio/is_write_buffered.hpp \
@@ -466,6 +507,7 @@ nobase_include_HEADERS = \
asio/local/datagram_protocol.hpp \
asio/local/detail/endpoint.hpp \
asio/local/detail/impl/endpoint.ipp \
+ asio/local/seq_packet_protocol.hpp \
asio/local/stream_protocol.hpp \
asio/multiple_exceptions.hpp \
asio/packaged_task.hpp \
@@ -477,15 +519,21 @@ nobase_include_HEADERS = \
asio/posix/stream_descriptor.hpp \
asio/post.hpp \
asio/prefer.hpp \
+ asio/prepend.hpp \
asio/query.hpp \
+ asio/random_access_file.hpp \
asio/read_at.hpp \
asio/read.hpp \
asio/read_until.hpp \
+ asio/readable_pipe.hpp \
+ asio/recycling_allocator.hpp \
asio/redirect_error.hpp \
+ asio/registered_buffer.hpp \
asio/require.hpp \
asio/require_concept.hpp \
asio/serial_port_base.hpp \
asio/serial_port.hpp \
+ asio/signal_set_base.hpp \
asio/signal_set.hpp \
asio/socket_base.hpp \
asio/spawn.hpp \
@@ -523,6 +571,7 @@ nobase_include_HEADERS = \
asio/steady_timer.hpp \
asio/strand.hpp \
asio/streambuf.hpp \
+ asio/stream_file.hpp \
asio/system_context.hpp \
asio/system_error.hpp \
asio/system_executor.hpp \
@@ -531,12 +580,7 @@ nobase_include_HEADERS = \
asio/thread.hpp \
asio/thread_pool.hpp \
asio/time_traits.hpp \
- asio/traits/bulk_execute_free.hpp \
- asio/traits/bulk_execute_member.hpp \
- asio/traits/connect_free.hpp \
- asio/traits/connect_member.hpp \
asio/traits/equality_comparable.hpp \
- asio/traits/execute_free.hpp \
asio/traits/execute_member.hpp \
asio/traits/prefer_free.hpp \
asio/traits/prefer_member.hpp \
@@ -547,21 +591,9 @@ nobase_include_HEADERS = \
asio/traits/require_concept_member.hpp \
asio/traits/require_free.hpp \
asio/traits/require_member.hpp \
- asio/traits/schedule_free.hpp \
- asio/traits/schedule_member.hpp \
- asio/traits/set_done_free.hpp \
- asio/traits/set_done_member.hpp \
- asio/traits/set_error_free.hpp \
- asio/traits/set_error_member.hpp \
- asio/traits/set_value_free.hpp \
- asio/traits/set_value_member.hpp \
- asio/traits/start_free.hpp \
- asio/traits/start_member.hpp \
asio/traits/static_query.hpp \
asio/traits/static_require.hpp \
asio/traits/static_require_concept.hpp \
- asio/traits/submit_free.hpp \
- asio/traits/submit_member.hpp \
asio/ts/buffer.hpp \
asio/ts/executor.hpp \
asio/ts/internet.hpp \
@@ -585,6 +617,7 @@ nobase_include_HEADERS = \
asio/windows/overlapped_ptr.hpp \
asio/windows/random_access_handle.hpp \
asio/windows/stream_handle.hpp \
+ asio/writable_pipe.hpp \
asio/write_at.hpp \
asio/write.hpp \
asio/yield.hpp
diff --git a/3rdparty/asio/include/Makefile.in b/3rdparty/asio/include/Makefile.in
index 4bb29452b71..e71be1bf590 100644
--- a/3rdparty/asio/include/Makefile.in
+++ b/3rdparty/asio/include/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -163,8 +163,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -178,8 +176,9 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
-CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -188,9 +187,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
-GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -257,9 +255,11 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -271,17 +271,25 @@ top_srcdir = @top_srcdir@
# find . -name "*.*pp" | sed -e 's/^\.\///' | sed -e 's/^.*$/ & \\/' | sort
nobase_include_HEADERS = \
+ asio/any_completion_executor.hpp \
+ asio/any_completion_handler.hpp \
asio/any_io_executor.hpp \
+ asio/append.hpp \
+ asio/as_tuple.hpp \
asio/associated_allocator.hpp \
asio/associated_cancellation_slot.hpp \
asio/associated_executor.hpp \
+ asio/associated_immediate_executor.hpp \
asio/associator.hpp \
asio/async_result.hpp \
asio/awaitable.hpp \
asio/basic_datagram_socket.hpp \
asio/basic_deadline_timer.hpp \
+ asio/basic_file.hpp \
asio/basic_io_object.hpp \
+ asio/basic_random_access_file.hpp \
asio/basic_raw_socket.hpp \
+ asio/basic_readable_pipe.hpp \
asio/basic_seq_packet_socket.hpp \
asio/basic_serial_port.hpp \
asio/basic_signal_set.hpp \
@@ -291,10 +299,14 @@ nobase_include_HEADERS = \
asio/basic_socket_streambuf.hpp \
asio/basic_streambuf_fwd.hpp \
asio/basic_streambuf.hpp \
+ asio/basic_stream_file.hpp \
asio/basic_stream_socket.hpp \
asio/basic_waitable_timer.hpp \
+ asio/basic_writable_pipe.hpp \
+ asio/bind_allocator.hpp \
asio/bind_cancellation_slot.hpp \
asio/bind_executor.hpp \
+ asio/bind_immediate_executor.hpp \
asio/buffered_read_stream_fwd.hpp \
asio/buffered_read_stream.hpp \
asio/buffered_stream_fwd.hpp \
@@ -302,6 +314,7 @@ nobase_include_HEADERS = \
asio/buffered_write_stream_fwd.hpp \
asio/buffered_write_stream.hpp \
asio/buffer.hpp \
+ asio/buffer_registration.hpp \
asio/buffers_iterator.hpp \
asio/cancellation_signal.hpp \
asio/cancellation_state.hpp \
@@ -310,9 +323,12 @@ nobase_include_HEADERS = \
asio/completion_condition.hpp \
asio/compose.hpp \
asio/connect.hpp \
+ asio/connect_pipe.hpp \
+ asio/consign.hpp \
asio/coroutine.hpp \
asio/deadline_timer.hpp \
asio/defer.hpp \
+ asio/deferred.hpp \
asio/detached.hpp \
asio/detail/array_fwd.hpp \
asio/detail/array.hpp \
@@ -325,11 +341,11 @@ nobase_include_HEADERS = \
asio/detail/buffered_stream_storage.hpp \
asio/detail/buffer_resize_guard.hpp \
asio/detail/buffer_sequence_adapter.hpp \
- asio/detail/bulk_executor_op.hpp \
asio/detail/call_stack.hpp \
asio/detail/chrono.hpp \
asio/detail/chrono_time_traits.hpp \
asio/detail/completion_handler.hpp \
+ asio/detail/composed_work.hpp \
asio/detail/concurrency_hint.hpp \
asio/detail/conditionally_enabled_event.hpp \
asio/detail/conditionally_enabled_mutex.hpp \
@@ -347,20 +363,16 @@ nobase_include_HEADERS = \
asio/detail/epoll_reactor.hpp \
asio/detail/eventfd_select_interrupter.hpp \
asio/detail/event.hpp \
+ asio/detail/exception.hpp \
asio/detail/executor_function.hpp \
asio/detail/executor_op.hpp \
asio/detail/fd_set_adapter.hpp \
asio/detail/fenced_block.hpp \
asio/detail/functional.hpp \
asio/detail/future.hpp \
- asio/detail/gcc_arm_fenced_block.hpp \
- asio/detail/gcc_hppa_fenced_block.hpp \
- asio/detail/gcc_sync_fenced_block.hpp \
- asio/detail/gcc_x86_fenced_block.hpp \
asio/detail/global.hpp \
asio/detail/handler_alloc_helpers.hpp \
asio/detail/handler_cont_helpers.hpp \
- asio/detail/handler_invoke_helpers.hpp \
asio/detail/handler_tracking.hpp \
asio/detail/handler_type_requirements.hpp \
asio/detail/handler_work.hpp \
@@ -373,16 +385,21 @@ nobase_include_HEADERS = \
asio/detail/impl/epoll_reactor.ipp \
asio/detail/impl/eventfd_select_interrupter.ipp \
asio/detail/impl/handler_tracking.ipp \
+ asio/detail/impl/io_uring_descriptor_service.ipp \
+ asio/detail/impl/io_uring_file_service.ipp \
+ asio/detail/impl/io_uring_service.hpp \
+ asio/detail/impl/io_uring_service.ipp \
+ asio/detail/impl/io_uring_socket_service_base.ipp \
asio/detail/impl/kqueue_reactor.hpp \
asio/detail/impl/kqueue_reactor.ipp \
asio/detail/impl/null_event.ipp \
asio/detail/impl/pipe_select_interrupter.ipp \
asio/detail/impl/posix_event.ipp \
asio/detail/impl/posix_mutex.ipp \
+ asio/detail/impl/posix_serial_port_service.ipp \
asio/detail/impl/posix_thread.ipp \
asio/detail/impl/posix_tss_ptr.ipp \
asio/detail/impl/reactive_descriptor_service.ipp \
- asio/detail/impl/reactive_serial_port_service.ipp \
asio/detail/impl/reactive_socket_service_base.ipp \
asio/detail/impl/resolver_service_base.ipp \
asio/detail/impl/scheduler.ipp \
@@ -402,6 +419,7 @@ nobase_include_HEADERS = \
asio/detail/impl/timer_queue_ptime.ipp \
asio/detail/impl/timer_queue_set.ipp \
asio/detail/impl/win_event.ipp \
+ asio/detail/impl/win_iocp_file_service.ipp \
asio/detail/impl/win_iocp_handle_service.ipp \
asio/detail/impl/win_iocp_io_context.hpp \
asio/detail/impl/win_iocp_io_context.ipp \
@@ -416,15 +434,36 @@ nobase_include_HEADERS = \
asio/detail/impl/win_static_mutex.ipp \
asio/detail/impl/win_thread.ipp \
asio/detail/impl/win_tss_ptr.ipp \
+ asio/detail/initiate_defer.hpp \
+ asio/detail/initiate_dispatch.hpp \
+ asio/detail/initiate_post.hpp \
asio/detail/io_control.hpp \
asio/detail/io_object_impl.hpp \
+ asio/detail/io_uring_descriptor_read_at_op.hpp \
+ asio/detail/io_uring_descriptor_read_op.hpp \
+ asio/detail/io_uring_descriptor_service.hpp \
+ asio/detail/io_uring_descriptor_write_at_op.hpp \
+ asio/detail/io_uring_descriptor_write_op.hpp \
+ asio/detail/io_uring_file_service.hpp \
+ asio/detail/io_uring_null_buffers_op.hpp \
+ asio/detail/io_uring_operation.hpp \
+ asio/detail/io_uring_service.hpp \
+ asio/detail/io_uring_socket_accept_op.hpp \
+ asio/detail/io_uring_socket_connect_op.hpp \
+ asio/detail/io_uring_socket_recvfrom_op.hpp \
+ asio/detail/io_uring_socket_recvmsg_op.hpp \
+ asio/detail/io_uring_socket_recv_op.hpp \
+ asio/detail/io_uring_socket_send_op.hpp \
+ asio/detail/io_uring_socket_sendto_op.hpp \
+ asio/detail/io_uring_socket_service_base.hpp \
+ asio/detail/io_uring_socket_service.hpp \
+ asio/detail/io_uring_wait_op.hpp \
asio/detail/is_buffer_sequence.hpp \
asio/detail/is_executor.hpp \
asio/detail/keyword_tss_ptr.hpp \
asio/detail/kqueue_reactor.hpp \
asio/detail/limits.hpp \
asio/detail/local_free_on_block_exit.hpp \
- asio/detail/macos_fenced_block.hpp \
asio/detail/memory.hpp \
asio/detail/mutex.hpp \
asio/detail/non_const_lvalue.hpp \
@@ -449,6 +488,7 @@ nobase_include_HEADERS = \
asio/detail/posix_fd_set_adapter.hpp \
asio/detail/posix_global.hpp \
asio/detail/posix_mutex.hpp \
+ asio/detail/posix_serial_port_service.hpp \
asio/detail/posix_signal_blocker.hpp \
asio/detail/posix_static_mutex.hpp \
asio/detail/posix_thread.hpp \
@@ -456,7 +496,6 @@ nobase_include_HEADERS = \
asio/detail/push_options.hpp \
asio/detail/reactive_descriptor_service.hpp \
asio/detail/reactive_null_buffers_op.hpp \
- asio/detail/reactive_serial_port_service.hpp \
asio/detail/reactive_socket_accept_op.hpp \
asio/detail/reactive_socket_connect_op.hpp \
asio/detail/reactive_socket_recvfrom_op.hpp \
@@ -467,7 +506,6 @@ nobase_include_HEADERS = \
asio/detail/reactive_socket_service_base.hpp \
asio/detail/reactive_socket_service.hpp \
asio/detail/reactive_wait_op.hpp \
- asio/detail/reactor_fwd.hpp \
asio/detail/reactor.hpp \
asio/detail/reactor_op.hpp \
asio/detail/reactor_op_queue.hpp \
@@ -480,6 +518,7 @@ nobase_include_HEADERS = \
asio/detail/resolver_service.hpp \
asio/detail/scheduler.hpp \
asio/detail/scheduler_operation.hpp \
+ asio/detail/scheduler_task.hpp \
asio/detail/scheduler_thread_info.hpp \
asio/detail/scoped_lock.hpp \
asio/detail/scoped_ptr.hpp \
@@ -496,7 +535,6 @@ nobase_include_HEADERS = \
asio/detail/socket_option.hpp \
asio/detail/socket_select_interrupter.hpp \
asio/detail/socket_types.hpp \
- asio/detail/solaris_fenced_block.hpp \
asio/detail/source_location.hpp \
asio/detail/static_mutex.hpp \
asio/detail/std_event.hpp \
@@ -522,15 +560,15 @@ nobase_include_HEADERS = \
asio/detail/timer_scheduler.hpp \
asio/detail/tss_ptr.hpp \
asio/detail/type_traits.hpp \
- asio/detail/variadic_templates.hpp \
+ asio/detail/utility.hpp \
asio/detail/wait_handler.hpp \
asio/detail/wait_op.hpp \
asio/detail/winapp_thread.hpp \
asio/detail/wince_thread.hpp \
asio/detail/win_event.hpp \
asio/detail/win_fd_set_adapter.hpp \
- asio/detail/win_fenced_block.hpp \
asio/detail/win_global.hpp \
+ asio/detail/win_iocp_file_service.hpp \
asio/detail/win_iocp_handle_read_op.hpp \
asio/detail/win_iocp_handle_service.hpp \
asio/detail/win_iocp_handle_write_op.hpp \
@@ -579,62 +617,61 @@ nobase_include_HEADERS = \
asio/execution/bad_executor.hpp \
asio/execution/blocking.hpp \
asio/execution/blocking_adaptation.hpp \
- asio/execution/bulk_execute.hpp \
- asio/execution/bulk_guarantee.hpp \
- asio/execution/connect.hpp \
asio/execution/context.hpp \
asio/execution/context_as.hpp \
- asio/execution/detail/as_invocable.hpp \
- asio/execution/detail/as_operation.hpp \
- asio/execution/detail/as_receiver.hpp \
- asio/execution/detail/bulk_sender.hpp \
- asio/execution/detail/submit_receiver.hpp \
- asio/execution/detail/void_receiver.hpp \
- asio/execution/execute.hpp \
asio/execution/executor.hpp \
asio/execution/impl/bad_executor.ipp \
- asio/execution/impl/receiver_invocation_error.ipp \
asio/execution/invocable_archetype.hpp \
asio/execution/mapping.hpp \
asio/execution/occupancy.hpp \
- asio/execution/operation_state.hpp \
asio/execution/outstanding_work.hpp \
asio/execution/prefer_only.hpp \
- asio/execution/receiver.hpp \
- asio/execution/receiver_invocation_error.hpp \
asio/execution/relationship.hpp \
- asio/execution/schedule.hpp \
- asio/execution/scheduler.hpp \
- asio/execution/sender.hpp \
- asio/execution/set_done.hpp \
- asio/execution/set_error.hpp \
- asio/execution/set_value.hpp \
- asio/execution/start.hpp \
- asio/execution/submit.hpp \
asio/executor.hpp \
asio/executor_work_guard.hpp \
asio/experimental/append.hpp \
asio/experimental/as_single.hpp \
asio/experimental/as_tuple.hpp \
asio/experimental/awaitable_operators.hpp \
+ asio/experimental/basic_channel.hpp \
+ asio/experimental/basic_concurrent_channel.hpp \
asio/experimental/cancellation_condition.hpp \
+ asio/experimental/channel.hpp \
+ asio/experimental/channel_error.hpp \
+ asio/experimental/channel_traits.hpp \
+ asio/experimental/co_composed.hpp \
+ asio/experimental/co_spawn.hpp \
+ asio/experimental/concurrent_channel.hpp \
asio/experimental/coro.hpp \
+ asio/experimental/coro_traits.hpp \
asio/experimental/deferred.hpp \
- asio/experimental/detail/completion_handler_erasure.hpp \
+ asio/experimental/detail/channel_handler.hpp \
+ asio/experimental/detail/channel_message.hpp \
+ asio/experimental/detail/channel_operation.hpp \
+ asio/experimental/detail/channel_payload.hpp \
+ asio/experimental/detail/channel_receive_op.hpp \
+ asio/experimental/detail/channel_send_functions.hpp \
+ asio/experimental/detail/channel_send_op.hpp \
+ asio/experimental/detail/channel_service.hpp \
+ asio/experimental/detail/coro_completion_handler.hpp \
asio/experimental/detail/coro_promise_allocator.hpp \
- asio/experimental/detail/coro_traits.hpp \
+ asio/experimental/detail/has_signature.hpp \
+ asio/experimental/detail/impl/channel_service.hpp \
asio/experimental/detail/partial_promise.hpp \
- asio/experimental/impl/append.hpp \
asio/experimental/impl/as_single.hpp \
- asio/experimental/impl/as_tuple.hpp \
- asio/experimental/impl/deferred.hpp \
+ asio/experimental/impl/channel_error.ipp \
+ asio/experimental/impl/co_composed.hpp \
+ asio/experimental/impl/coro.hpp \
asio/experimental/impl/parallel_group.hpp \
- asio/experimental/impl/prepend.hpp \
asio/experimental/impl/promise.hpp \
+ asio/experimental/impl/use_coro.hpp \
+ asio/experimental/impl/use_promise.hpp \
asio/experimental/parallel_group.hpp \
asio/experimental/prepend.hpp \
asio/experimental/promise.hpp \
asio/experimental/use_coro.hpp \
+ asio/experimental/use_promise.hpp \
+ asio/file_base.hpp \
asio/generic/basic_endpoint.hpp \
asio/generic/datagram_protocol.hpp \
asio/generic/detail/endpoint.hpp \
@@ -642,31 +679,34 @@ nobase_include_HEADERS = \
asio/generic/raw_protocol.hpp \
asio/generic/seq_packet_protocol.hpp \
asio/generic/stream_protocol.hpp \
- asio/handler_alloc_hook.hpp \
asio/handler_continuation_hook.hpp \
- asio/handler_invoke_hook.hpp \
asio/high_resolution_timer.hpp \
asio.hpp \
+ asio/impl/any_completion_executor.ipp \
+ asio/impl/any_io_executor.ipp \
+ asio/impl/append.hpp \
+ asio/impl/as_tuple.hpp \
asio/impl/awaitable.hpp \
asio/impl/buffered_read_stream.hpp \
asio/impl/buffered_write_stream.hpp \
+ asio/impl/cancellation_signal.ipp \
asio/impl/co_spawn.hpp \
- asio/impl/compose.hpp \
asio/impl/connect.hpp \
- asio/impl/defer.hpp \
+ asio/impl/connect_pipe.hpp \
+ asio/impl/connect_pipe.ipp \
+ asio/impl/consign.hpp \
+ asio/impl/deferred.hpp \
asio/impl/detached.hpp \
- asio/impl/dispatch.hpp \
asio/impl/error_code.ipp \
asio/impl/error.ipp \
asio/impl/execution_context.hpp \
asio/impl/execution_context.ipp \
asio/impl/executor.hpp \
asio/impl/executor.ipp \
- asio/impl/handler_alloc_hook.ipp \
asio/impl/io_context.hpp \
asio/impl/io_context.ipp \
asio/impl/multiple_exceptions.ipp \
- asio/impl/post.hpp \
+ asio/impl/prepend.hpp \
asio/impl/read_at.hpp \
asio/impl/read.hpp \
asio/impl/read_until.hpp \
@@ -729,6 +769,7 @@ nobase_include_HEADERS = \
asio/ip/unicast.hpp \
asio/ip/v6_only.hpp \
asio/is_applicable_property.hpp \
+ asio/is_contiguous_iterator.hpp \
asio/is_executor.hpp \
asio/is_read_buffered.hpp \
asio/is_write_buffered.hpp \
@@ -737,6 +778,7 @@ nobase_include_HEADERS = \
asio/local/datagram_protocol.hpp \
asio/local/detail/endpoint.hpp \
asio/local/detail/impl/endpoint.ipp \
+ asio/local/seq_packet_protocol.hpp \
asio/local/stream_protocol.hpp \
asio/multiple_exceptions.hpp \
asio/packaged_task.hpp \
@@ -748,15 +790,21 @@ nobase_include_HEADERS = \
asio/posix/stream_descriptor.hpp \
asio/post.hpp \
asio/prefer.hpp \
+ asio/prepend.hpp \
asio/query.hpp \
+ asio/random_access_file.hpp \
asio/read_at.hpp \
asio/read.hpp \
asio/read_until.hpp \
+ asio/readable_pipe.hpp \
+ asio/recycling_allocator.hpp \
asio/redirect_error.hpp \
+ asio/registered_buffer.hpp \
asio/require.hpp \
asio/require_concept.hpp \
asio/serial_port_base.hpp \
asio/serial_port.hpp \
+ asio/signal_set_base.hpp \
asio/signal_set.hpp \
asio/socket_base.hpp \
asio/spawn.hpp \
@@ -794,6 +842,7 @@ nobase_include_HEADERS = \
asio/steady_timer.hpp \
asio/strand.hpp \
asio/streambuf.hpp \
+ asio/stream_file.hpp \
asio/system_context.hpp \
asio/system_error.hpp \
asio/system_executor.hpp \
@@ -802,12 +851,7 @@ nobase_include_HEADERS = \
asio/thread.hpp \
asio/thread_pool.hpp \
asio/time_traits.hpp \
- asio/traits/bulk_execute_free.hpp \
- asio/traits/bulk_execute_member.hpp \
- asio/traits/connect_free.hpp \
- asio/traits/connect_member.hpp \
asio/traits/equality_comparable.hpp \
- asio/traits/execute_free.hpp \
asio/traits/execute_member.hpp \
asio/traits/prefer_free.hpp \
asio/traits/prefer_member.hpp \
@@ -818,21 +862,9 @@ nobase_include_HEADERS = \
asio/traits/require_concept_member.hpp \
asio/traits/require_free.hpp \
asio/traits/require_member.hpp \
- asio/traits/schedule_free.hpp \
- asio/traits/schedule_member.hpp \
- asio/traits/set_done_free.hpp \
- asio/traits/set_done_member.hpp \
- asio/traits/set_error_free.hpp \
- asio/traits/set_error_member.hpp \
- asio/traits/set_value_free.hpp \
- asio/traits/set_value_member.hpp \
- asio/traits/start_free.hpp \
- asio/traits/start_member.hpp \
asio/traits/static_query.hpp \
asio/traits/static_require.hpp \
asio/traits/static_require_concept.hpp \
- asio/traits/submit_free.hpp \
- asio/traits/submit_member.hpp \
asio/ts/buffer.hpp \
asio/ts/executor.hpp \
asio/ts/internet.hpp \
@@ -856,6 +888,7 @@ nobase_include_HEADERS = \
asio/windows/overlapped_ptr.hpp \
asio/windows/random_access_handle.hpp \
asio/windows/stream_handle.hpp \
+ asio/writable_pipe.hpp \
asio/write_at.hpp \
asio/write.hpp \
asio/yield.hpp
@@ -971,7 +1004,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/3rdparty/asio/include/asio.hpp b/3rdparty/asio/include/asio.hpp
index 94db21e8173..3421b58bdae 100644
--- a/3rdparty/asio/include/asio.hpp
+++ b/3rdparty/asio/include/asio.hpp
@@ -2,7 +2,7 @@
// asio.hpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -15,16 +15,25 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+#include "asio/any_completion_executor.hpp"
+#include "asio/any_completion_handler.hpp"
+#include "asio/any_io_executor.hpp"
+#include "asio/append.hpp"
+#include "asio/as_tuple.hpp"
#include "asio/associated_allocator.hpp"
-#include "asio/associated_executor.hpp"
#include "asio/associated_cancellation_slot.hpp"
+#include "asio/associated_executor.hpp"
+#include "asio/associated_immediate_executor.hpp"
#include "asio/associator.hpp"
#include "asio/async_result.hpp"
#include "asio/awaitable.hpp"
#include "asio/basic_datagram_socket.hpp"
#include "asio/basic_deadline_timer.hpp"
+#include "asio/basic_file.hpp"
#include "asio/basic_io_object.hpp"
+#include "asio/basic_random_access_file.hpp"
#include "asio/basic_raw_socket.hpp"
+#include "asio/basic_readable_pipe.hpp"
#include "asio/basic_seq_packet_socket.hpp"
#include "asio/basic_serial_port.hpp"
#include "asio/basic_signal_set.hpp"
@@ -32,12 +41,17 @@
#include "asio/basic_socket_acceptor.hpp"
#include "asio/basic_socket_iostream.hpp"
#include "asio/basic_socket_streambuf.hpp"
+#include "asio/basic_stream_file.hpp"
#include "asio/basic_stream_socket.hpp"
#include "asio/basic_streambuf.hpp"
#include "asio/basic_waitable_timer.hpp"
+#include "asio/basic_writable_pipe.hpp"
+#include "asio/bind_allocator.hpp"
#include "asio/bind_cancellation_slot.hpp"
#include "asio/bind_executor.hpp"
+#include "asio/bind_immediate_executor.hpp"
#include "asio/buffer.hpp"
+#include "asio/buffer_registration.hpp"
#include "asio/buffered_read_stream_fwd.hpp"
#include "asio/buffered_read_stream.hpp"
#include "asio/buffered_stream_fwd.hpp"
@@ -52,9 +66,12 @@
#include "asio/completion_condition.hpp"
#include "asio/compose.hpp"
#include "asio/connect.hpp"
+#include "asio/connect_pipe.hpp"
+#include "asio/consign.hpp"
#include "asio/coroutine.hpp"
#include "asio/deadline_timer.hpp"
#include "asio/defer.hpp"
+#include "asio/deferred.hpp"
#include "asio/detached.hpp"
#include "asio/dispatch.hpp"
#include "asio/error.hpp"
@@ -64,40 +81,24 @@
#include "asio/execution/any_executor.hpp"
#include "asio/execution/blocking.hpp"
#include "asio/execution/blocking_adaptation.hpp"
-#include "asio/execution/bulk_execute.hpp"
-#include "asio/execution/bulk_guarantee.hpp"
-#include "asio/execution/connect.hpp"
#include "asio/execution/context.hpp"
#include "asio/execution/context_as.hpp"
-#include "asio/execution/execute.hpp"
#include "asio/execution/executor.hpp"
#include "asio/execution/invocable_archetype.hpp"
#include "asio/execution/mapping.hpp"
#include "asio/execution/occupancy.hpp"
-#include "asio/execution/operation_state.hpp"
#include "asio/execution/outstanding_work.hpp"
#include "asio/execution/prefer_only.hpp"
-#include "asio/execution/receiver.hpp"
-#include "asio/execution/receiver_invocation_error.hpp"
#include "asio/execution/relationship.hpp"
-#include "asio/execution/schedule.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
-#include "asio/execution/set_done.hpp"
-#include "asio/execution/set_error.hpp"
-#include "asio/execution/set_value.hpp"
-#include "asio/execution/start.hpp"
-#include "asio/execution_context.hpp"
#include "asio/executor.hpp"
#include "asio/executor_work_guard.hpp"
+#include "asio/file_base.hpp"
#include "asio/generic/basic_endpoint.hpp"
#include "asio/generic/datagram_protocol.hpp"
#include "asio/generic/raw_protocol.hpp"
#include "asio/generic/seq_packet_protocol.hpp"
#include "asio/generic/stream_protocol.hpp"
-#include "asio/handler_alloc_hook.hpp"
#include "asio/handler_continuation_hook.hpp"
-#include "asio/handler_invoke_hook.hpp"
#include "asio/high_resolution_timer.hpp"
#include "asio/io_context.hpp"
#include "asio/io_context_strand.hpp"
@@ -128,12 +129,14 @@
#include "asio/ip/unicast.hpp"
#include "asio/ip/v6_only.hpp"
#include "asio/is_applicable_property.hpp"
+#include "asio/is_contiguous_iterator.hpp"
#include "asio/is_executor.hpp"
#include "asio/is_read_buffered.hpp"
#include "asio/is_write_buffered.hpp"
#include "asio/local/basic_endpoint.hpp"
#include "asio/local/connect_pair.hpp"
#include "asio/local/datagram_protocol.hpp"
+#include "asio/local/seq_packet_protocol.hpp"
#include "asio/local/stream_protocol.hpp"
#include "asio/multiple_exceptions.hpp"
#include "asio/packaged_task.hpp"
@@ -145,20 +148,27 @@
#include "asio/posix/stream_descriptor.hpp"
#include "asio/post.hpp"
#include "asio/prefer.hpp"
+#include "asio/prepend.hpp"
#include "asio/query.hpp"
+#include "asio/random_access_file.hpp"
#include "asio/read.hpp"
#include "asio/read_at.hpp"
#include "asio/read_until.hpp"
+#include "asio/readable_pipe.hpp"
+#include "asio/recycling_allocator.hpp"
#include "asio/redirect_error.hpp"
+#include "asio/registered_buffer.hpp"
#include "asio/require.hpp"
#include "asio/require_concept.hpp"
#include "asio/serial_port.hpp"
#include "asio/serial_port_base.hpp"
#include "asio/signal_set.hpp"
+#include "asio/signal_set_base.hpp"
#include "asio/socket_base.hpp"
#include "asio/static_thread_pool.hpp"
#include "asio/steady_timer.hpp"
#include "asio/strand.hpp"
+#include "asio/stream_file.hpp"
#include "asio/streambuf.hpp"
#include "asio/system_context.hpp"
#include "asio/system_error.hpp"
@@ -182,6 +192,7 @@
#include "asio/windows/overlapped_ptr.hpp"
#include "asio/windows/random_access_handle.hpp"
#include "asio/windows/stream_handle.hpp"
+#include "asio/writable_pipe.hpp"
#include "asio/write.hpp"
#include "asio/write_at.hpp"
diff --git a/3rdparty/asio/include/asio/any_completion_executor.hpp b/3rdparty/asio/include/asio/any_completion_executor.hpp
new file mode 100644
index 00000000000..650ff7bafdd
--- /dev/null
+++ b/3rdparty/asio/include/asio/any_completion_executor.hpp
@@ -0,0 +1,336 @@
+//
+// any_completion_executor.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_ANY_COMPLETION_EXECUTOR_HPP
+#define ASIO_ANY_COMPLETION_EXECUTOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+# include "asio/executor.hpp"
+#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+# include "asio/execution.hpp"
+#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
+typedef executor any_completion_executor;
+
+#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
+/// Polymorphic executor type for use with I/O objects.
+/**
+ * The @c any_completion_executor type is a polymorphic executor that supports
+ * the set of properties required for the execution of completion handlers. It
+ * is defined as the execution::any_executor class template parameterised as
+ * follows:
+ * @code execution::any_executor<
+ * execution::prefer_only<execution::outstanding_work_t::tracked_t>,
+ * execution::prefer_only<execution::outstanding_work_t::untracked_t>
+ * execution::prefer_only<execution::relationship_t::fork_t>,
+ * execution::prefer_only<execution::relationship_t::continuation_t>
+ * > @endcode
+ */
+class any_completion_executor :
+#if defined(GENERATING_DOCUMENTATION)
+ public execution::any_executor<...>
+#else // defined(GENERATING_DOCUMENTATION)
+ public execution::any_executor<
+ execution::prefer_only<execution::outstanding_work_t::tracked_t>,
+ execution::prefer_only<execution::outstanding_work_t::untracked_t>,
+ execution::prefer_only<execution::relationship_t::fork_t>,
+ execution::prefer_only<execution::relationship_t::continuation_t>
+ >
+#endif // defined(GENERATING_DOCUMENTATION)
+{
+public:
+#if !defined(GENERATING_DOCUMENTATION)
+ typedef execution::any_executor<
+ execution::prefer_only<execution::outstanding_work_t::tracked_t>,
+ execution::prefer_only<execution::outstanding_work_t::untracked_t>,
+ execution::prefer_only<execution::relationship_t::fork_t>,
+ execution::prefer_only<execution::relationship_t::continuation_t>
+ > base_type;
+
+ typedef void supportable_properties_type(
+ execution::prefer_only<execution::outstanding_work_t::tracked_t>,
+ execution::prefer_only<execution::outstanding_work_t::untracked_t>,
+ execution::prefer_only<execution::relationship_t::fork_t>,
+ execution::prefer_only<execution::relationship_t::continuation_t>
+ );
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+ /// Default constructor.
+ ASIO_DECL any_completion_executor() noexcept;
+
+ /// Construct in an empty state. Equivalent effects to default constructor.
+ ASIO_DECL any_completion_executor(nullptr_t) noexcept;
+
+ /// Copy constructor.
+ ASIO_DECL any_completion_executor(
+ const any_completion_executor& e) noexcept;
+
+ /// Move constructor.
+ ASIO_DECL any_completion_executor(
+ any_completion_executor&& e) noexcept;
+
+ /// Construct to point to the same target as another any_executor.
+#if defined(GENERATING_DOCUMENTATION)
+ template <class... OtherSupportableProperties>
+ any_completion_executor(
+ execution::any_executor<OtherSupportableProperties...> e);
+#else // defined(GENERATING_DOCUMENTATION)
+ template <typename OtherAnyExecutor>
+ any_completion_executor(OtherAnyExecutor e,
+ constraint_t<
+ conditional<
+ !is_same<OtherAnyExecutor, any_completion_executor>::value
+ && is_base_of<execution::detail::any_executor_base,
+ OtherAnyExecutor>::value,
+ typename execution::detail::supportable_properties<
+ 0, supportable_properties_type>::template
+ is_valid_target<OtherAnyExecutor>,
+ false_type
+ >::type::value
+ > = 0)
+ : base_type(static_cast<OtherAnyExecutor&&>(e))
+ {
+ }
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Construct to point to the same target as another any_executor.
+#if defined(GENERATING_DOCUMENTATION)
+ template <class... OtherSupportableProperties>
+ any_completion_executor(std::nothrow_t,
+ execution::any_executor<OtherSupportableProperties...> e);
+#else // defined(GENERATING_DOCUMENTATION)
+ template <typename OtherAnyExecutor>
+ any_completion_executor(std::nothrow_t, OtherAnyExecutor e,
+ constraint_t<
+ conditional<
+ !is_same<OtherAnyExecutor, any_completion_executor>::value
+ && is_base_of<execution::detail::any_executor_base,
+ OtherAnyExecutor>::value,
+ typename execution::detail::supportable_properties<
+ 0, supportable_properties_type>::template
+ is_valid_target<OtherAnyExecutor>,
+ false_type
+ >::type::value
+ > = 0) noexcept
+ : base_type(std::nothrow, static_cast<OtherAnyExecutor&&>(e))
+ {
+ }
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Construct to point to the same target as another any_executor.
+ ASIO_DECL any_completion_executor(std::nothrow_t,
+ const any_completion_executor& e) noexcept;
+
+ /// Construct to point to the same target as another any_executor.
+ ASIO_DECL any_completion_executor(std::nothrow_t,
+ any_completion_executor&& e) noexcept;
+
+ /// Construct a polymorphic wrapper for the specified executor.
+#if defined(GENERATING_DOCUMENTATION)
+ template <ASIO_EXECUTION_EXECUTOR Executor>
+ any_completion_executor(Executor e);
+#else // defined(GENERATING_DOCUMENTATION)
+ template <ASIO_EXECUTION_EXECUTOR Executor>
+ any_completion_executor(Executor e,
+ constraint_t<
+ conditional<
+ !is_same<Executor, any_completion_executor>::value
+ && !is_base_of<execution::detail::any_executor_base,
+ Executor>::value,
+ execution::detail::is_valid_target_executor<
+ Executor, supportable_properties_type>,
+ false_type
+ >::type::value
+ > = 0)
+ : base_type(static_cast<Executor&&>(e))
+ {
+ }
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Construct a polymorphic wrapper for the specified executor.
+#if defined(GENERATING_DOCUMENTATION)
+ template <ASIO_EXECUTION_EXECUTOR Executor>
+ any_completion_executor(std::nothrow_t, Executor e);
+#else // defined(GENERATING_DOCUMENTATION)
+ template <ASIO_EXECUTION_EXECUTOR Executor>
+ any_completion_executor(std::nothrow_t, Executor e,
+ constraint_t<
+ conditional<
+ !is_same<Executor, any_completion_executor>::value
+ && !is_base_of<execution::detail::any_executor_base,
+ Executor>::value,
+ execution::detail::is_valid_target_executor<
+ Executor, supportable_properties_type>,
+ false_type
+ >::type::value
+ > = 0) noexcept
+ : base_type(std::nothrow, static_cast<Executor&&>(e))
+ {
+ }
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Assignment operator.
+ ASIO_DECL any_completion_executor& operator=(
+ const any_completion_executor& e) noexcept;
+
+ /// Move assignment operator.
+ ASIO_DECL any_completion_executor& operator=(
+ any_completion_executor&& e) noexcept;
+
+ /// Assignment operator that sets the polymorphic wrapper to the empty state.
+ ASIO_DECL any_completion_executor& operator=(nullptr_t);
+
+ /// Destructor.
+ ASIO_DECL ~any_completion_executor();
+
+ /// Swap targets with another polymorphic wrapper.
+ ASIO_DECL void swap(any_completion_executor& other) noexcept;
+
+ /// Obtain a polymorphic wrapper with the specified property.
+ /**
+ * Do not call this function directly. It is intended for use with the
+ * asio::require and asio::prefer customisation points.
+ *
+ * For example:
+ * @code any_completion_executor ex = ...;
+ * auto ex2 = asio::require(ex, execution::relationship.fork); @endcode
+ */
+ template <typename Property>
+ any_completion_executor require(const Property& p,
+ constraint_t<
+ traits::require_member<const base_type&, const Property&>::is_valid
+ > = 0) const
+ {
+ return static_cast<const base_type&>(*this).require(p);
+ }
+
+ /// Obtain a polymorphic wrapper with the specified property.
+ /**
+ * Do not call this function directly. It is intended for use with the
+ * asio::prefer customisation point.
+ *
+ * For example:
+ * @code any_completion_executor ex = ...;
+ * auto ex2 = asio::prefer(ex, execution::relationship.fork); @endcode
+ */
+ template <typename Property>
+ any_completion_executor prefer(const Property& p,
+ constraint_t<
+ traits::prefer_member<const base_type&, const Property&>::is_valid
+ > = 0) const
+ {
+ return static_cast<const base_type&>(*this).prefer(p);
+ }
+};
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <>
+ASIO_DECL any_completion_executor any_completion_executor::prefer(
+ const execution::outstanding_work_t::tracked_t&, int) const;
+
+template <>
+ASIO_DECL any_completion_executor any_completion_executor::prefer(
+ const execution::outstanding_work_t::untracked_t&, int) const;
+
+template <>
+ASIO_DECL any_completion_executor any_completion_executor::prefer(
+ const execution::relationship_t::fork_t&, int) const;
+
+template <>
+ASIO_DECL any_completion_executor any_completion_executor::prefer(
+ const execution::relationship_t::continuation_t&, int) const;
+
+namespace traits {
+
+#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
+
+template <>
+struct equality_comparable<any_completion_executor>
+{
+ static const bool is_valid = true;
+ static const bool is_noexcept = true;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
+
+#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
+
+template <typename F>
+struct execute_member<any_completion_executor, F>
+{
+ static const bool is_valid = true;
+ static const bool is_noexcept = false;
+ typedef void result_type;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
+
+#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
+
+template <typename Prop>
+struct query_member<any_completion_executor, Prop> :
+ query_member<any_completion_executor::base_type, Prop>
+{
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
+
+#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
+
+template <typename Prop>
+struct require_member<any_completion_executor, Prop> :
+ require_member<any_completion_executor::base_type, Prop>
+{
+ typedef any_completion_executor result_type;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
+
+#if !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
+
+template <typename Prop>
+struct prefer_member<any_completion_executor, Prop> :
+ prefer_member<any_completion_executor::base_type, Prop>
+{
+ typedef any_completion_executor result_type;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
+
+} // namespace traits
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#if defined(ASIO_HEADER_ONLY) \
+ && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+# include "asio/impl/any_completion_executor.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+ // && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
+#endif // ASIO_ANY_COMPLETION_EXECUTOR_HPP
diff --git a/3rdparty/asio/include/asio/any_completion_handler.hpp b/3rdparty/asio/include/asio/any_completion_handler.hpp
new file mode 100644
index 00000000000..45b3e75fec7
--- /dev/null
+++ b/3rdparty/asio/include/asio/any_completion_handler.hpp
@@ -0,0 +1,822 @@
+//
+// any_completion_handler.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_ANY_COMPLETION_HANDLER_HPP
+#define ASIO_ANY_COMPLETION_HANDLER_HPP
+
+#include "asio/detail/config.hpp"
+#include <cstring>
+#include <functional>
+#include <memory>
+#include <utility>
+#include "asio/any_completion_executor.hpp"
+#include "asio/any_io_executor.hpp"
+#include "asio/associated_allocator.hpp"
+#include "asio/associated_cancellation_slot.hpp"
+#include "asio/associated_executor.hpp"
+#include "asio/associated_immediate_executor.hpp"
+#include "asio/cancellation_state.hpp"
+#include "asio/recycling_allocator.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class any_completion_handler_impl_base
+{
+public:
+ template <typename S>
+ explicit any_completion_handler_impl_base(S&& slot)
+ : cancel_state_(static_cast<S&&>(slot), enable_total_cancellation())
+ {
+ }
+
+ cancellation_slot get_cancellation_slot() const noexcept
+ {
+ return cancel_state_.slot();
+ }
+
+private:
+ cancellation_state cancel_state_;
+};
+
+template <typename Handler>
+class any_completion_handler_impl :
+ public any_completion_handler_impl_base
+{
+public:
+ template <typename S, typename H>
+ any_completion_handler_impl(S&& slot, H&& h)
+ : any_completion_handler_impl_base(static_cast<S&&>(slot)),
+ handler_(static_cast<H&&>(h))
+ {
+ }
+
+ struct uninit_deleter
+ {
+ typename std::allocator_traits<
+ associated_allocator_t<Handler,
+ asio::recycling_allocator<void>>>::template
+ rebind_alloc<any_completion_handler_impl> alloc;
+
+ void operator()(any_completion_handler_impl* ptr)
+ {
+ std::allocator_traits<decltype(alloc)>::deallocate(alloc, ptr, 1);
+ }
+ };
+
+ struct deleter
+ {
+ typename std::allocator_traits<
+ associated_allocator_t<Handler,
+ asio::recycling_allocator<void>>>::template
+ rebind_alloc<any_completion_handler_impl> alloc;
+
+ void operator()(any_completion_handler_impl* ptr)
+ {
+ std::allocator_traits<decltype(alloc)>::destroy(alloc, ptr);
+ std::allocator_traits<decltype(alloc)>::deallocate(alloc, ptr, 1);
+ }
+ };
+
+ template <typename S, typename H>
+ static any_completion_handler_impl* create(S&& slot, H&& h)
+ {
+ uninit_deleter d{
+ (get_associated_allocator)(h,
+ asio::recycling_allocator<void>())};
+
+ std::unique_ptr<any_completion_handler_impl, uninit_deleter> uninit_ptr(
+ std::allocator_traits<decltype(d.alloc)>::allocate(d.alloc, 1), d);
+
+ any_completion_handler_impl* ptr =
+ new (uninit_ptr.get()) any_completion_handler_impl(
+ static_cast<S&&>(slot), static_cast<H&&>(h));
+
+ uninit_ptr.release();
+ return ptr;
+ }
+
+ void destroy()
+ {
+ deleter d{
+ (get_associated_allocator)(handler_,
+ asio::recycling_allocator<void>())};
+
+ d(this);
+ }
+
+ any_completion_executor executor(
+ const any_completion_executor& candidate) const noexcept
+ {
+ return any_completion_executor(std::nothrow,
+ (get_associated_executor)(handler_, candidate));
+ }
+
+ any_completion_executor immediate_executor(
+ const any_io_executor& candidate) const noexcept
+ {
+ return any_completion_executor(std::nothrow,
+ (get_associated_immediate_executor)(handler_, candidate));
+ }
+
+ void* allocate(std::size_t size, std::size_t align) const
+ {
+ typename std::allocator_traits<
+ associated_allocator_t<Handler,
+ asio::recycling_allocator<void>>>::template
+ rebind_alloc<unsigned char> alloc(
+ (get_associated_allocator)(handler_,
+ asio::recycling_allocator<void>()));
+
+ std::size_t space = size + align - 1;
+ unsigned char* base =
+ std::allocator_traits<decltype(alloc)>::allocate(
+ alloc, space + sizeof(std::ptrdiff_t));
+
+ void* p = base;
+ if (detail::align(align, size, p, space))
+ {
+ std::ptrdiff_t off = static_cast<unsigned char*>(p) - base;
+ std::memcpy(static_cast<unsigned char*>(p) + size, &off, sizeof(off));
+ return p;
+ }
+
+ std::bad_alloc ex;
+ asio::detail::throw_exception(ex);
+ return nullptr;
+ }
+
+ void deallocate(void* p, std::size_t size, std::size_t align) const
+ {
+ if (p)
+ {
+ typename std::allocator_traits<
+ associated_allocator_t<Handler,
+ asio::recycling_allocator<void>>>::template
+ rebind_alloc<unsigned char> alloc(
+ (get_associated_allocator)(handler_,
+ asio::recycling_allocator<void>()));
+
+ std::ptrdiff_t off;
+ std::memcpy(&off, static_cast<unsigned char*>(p) + size, sizeof(off));
+ unsigned char* base = static_cast<unsigned char*>(p) - off;
+
+ std::allocator_traits<decltype(alloc)>::deallocate(
+ alloc, base, size + align -1 + sizeof(std::ptrdiff_t));
+ }
+ }
+
+ template <typename... Args>
+ void call(Args&&... args)
+ {
+ deleter d{
+ (get_associated_allocator)(handler_,
+ asio::recycling_allocator<void>())};
+
+ std::unique_ptr<any_completion_handler_impl, deleter> ptr(this, d);
+ Handler handler(static_cast<Handler&&>(handler_));
+ ptr.reset();
+
+ static_cast<Handler&&>(handler)(
+ static_cast<Args&&>(args)...);
+ }
+
+private:
+ Handler handler_;
+};
+
+template <typename Signature>
+class any_completion_handler_call_fn;
+
+template <typename R, typename... Args>
+class any_completion_handler_call_fn<R(Args...)>
+{
+public:
+ using type = void(*)(any_completion_handler_impl_base*, Args...);
+
+ constexpr any_completion_handler_call_fn(type fn)
+ : call_fn_(fn)
+ {
+ }
+
+ void call(any_completion_handler_impl_base* impl, Args... args) const
+ {
+ call_fn_(impl, static_cast<Args&&>(args)...);
+ }
+
+ template <typename Handler>
+ static void impl(any_completion_handler_impl_base* impl, Args... args)
+ {
+ static_cast<any_completion_handler_impl<Handler>*>(impl)->call(
+ static_cast<Args&&>(args)...);
+ }
+
+private:
+ type call_fn_;
+};
+
+template <typename... Signatures>
+class any_completion_handler_call_fns;
+
+template <typename Signature>
+class any_completion_handler_call_fns<Signature> :
+ public any_completion_handler_call_fn<Signature>
+{
+public:
+ using any_completion_handler_call_fn<
+ Signature>::any_completion_handler_call_fn;
+ using any_completion_handler_call_fn<Signature>::call;
+};
+
+template <typename Signature, typename... Signatures>
+class any_completion_handler_call_fns<Signature, Signatures...> :
+ public any_completion_handler_call_fn<Signature>,
+ public any_completion_handler_call_fns<Signatures...>
+{
+public:
+ template <typename CallFn, typename... CallFns>
+ constexpr any_completion_handler_call_fns(CallFn fn, CallFns... fns)
+ : any_completion_handler_call_fn<Signature>(fn),
+ any_completion_handler_call_fns<Signatures...>(fns...)
+ {
+ }
+
+ using any_completion_handler_call_fn<Signature>::call;
+ using any_completion_handler_call_fns<Signatures...>::call;
+};
+
+class any_completion_handler_destroy_fn
+{
+public:
+ using type = void(*)(any_completion_handler_impl_base*);
+
+ constexpr any_completion_handler_destroy_fn(type fn)
+ : destroy_fn_(fn)
+ {
+ }
+
+ void destroy(any_completion_handler_impl_base* impl) const
+ {
+ destroy_fn_(impl);
+ }
+
+ template <typename Handler>
+ static void impl(any_completion_handler_impl_base* impl)
+ {
+ static_cast<any_completion_handler_impl<Handler>*>(impl)->destroy();
+ }
+
+private:
+ type destroy_fn_;
+};
+
+class any_completion_handler_executor_fn
+{
+public:
+ using type = any_completion_executor(*)(
+ any_completion_handler_impl_base*, const any_completion_executor&);
+
+ constexpr any_completion_handler_executor_fn(type fn)
+ : executor_fn_(fn)
+ {
+ }
+
+ any_completion_executor executor(any_completion_handler_impl_base* impl,
+ const any_completion_executor& candidate) const
+ {
+ return executor_fn_(impl, candidate);
+ }
+
+ template <typename Handler>
+ static any_completion_executor impl(any_completion_handler_impl_base* impl,
+ const any_completion_executor& candidate)
+ {
+ return static_cast<any_completion_handler_impl<Handler>*>(impl)->executor(
+ candidate);
+ }
+
+private:
+ type executor_fn_;
+};
+
+class any_completion_handler_immediate_executor_fn
+{
+public:
+ using type = any_completion_executor(*)(
+ any_completion_handler_impl_base*, const any_io_executor&);
+
+ constexpr any_completion_handler_immediate_executor_fn(type fn)
+ : immediate_executor_fn_(fn)
+ {
+ }
+
+ any_completion_executor immediate_executor(
+ any_completion_handler_impl_base* impl,
+ const any_io_executor& candidate) const
+ {
+ return immediate_executor_fn_(impl, candidate);
+ }
+
+ template <typename Handler>
+ static any_completion_executor impl(any_completion_handler_impl_base* impl,
+ const any_io_executor& candidate)
+ {
+ return static_cast<any_completion_handler_impl<Handler>*>(
+ impl)->immediate_executor(candidate);
+ }
+
+private:
+ type immediate_executor_fn_;
+};
+
+class any_completion_handler_allocate_fn
+{
+public:
+ using type = void*(*)(any_completion_handler_impl_base*,
+ std::size_t, std::size_t);
+
+ constexpr any_completion_handler_allocate_fn(type fn)
+ : allocate_fn_(fn)
+ {
+ }
+
+ void* allocate(any_completion_handler_impl_base* impl,
+ std::size_t size, std::size_t align) const
+ {
+ return allocate_fn_(impl, size, align);
+ }
+
+ template <typename Handler>
+ static void* impl(any_completion_handler_impl_base* impl,
+ std::size_t size, std::size_t align)
+ {
+ return static_cast<any_completion_handler_impl<Handler>*>(impl)->allocate(
+ size, align);
+ }
+
+private:
+ type allocate_fn_;
+};
+
+class any_completion_handler_deallocate_fn
+{
+public:
+ using type = void(*)(any_completion_handler_impl_base*,
+ void*, std::size_t, std::size_t);
+
+ constexpr any_completion_handler_deallocate_fn(type fn)
+ : deallocate_fn_(fn)
+ {
+ }
+
+ void deallocate(any_completion_handler_impl_base* impl,
+ void* p, std::size_t size, std::size_t align) const
+ {
+ deallocate_fn_(impl, p, size, align);
+ }
+
+ template <typename Handler>
+ static void impl(any_completion_handler_impl_base* impl,
+ void* p, std::size_t size, std::size_t align)
+ {
+ static_cast<any_completion_handler_impl<Handler>*>(impl)->deallocate(
+ p, size, align);
+ }
+
+private:
+ type deallocate_fn_;
+};
+
+template <typename... Signatures>
+class any_completion_handler_fn_table
+ : private any_completion_handler_destroy_fn,
+ private any_completion_handler_executor_fn,
+ private any_completion_handler_immediate_executor_fn,
+ private any_completion_handler_allocate_fn,
+ private any_completion_handler_deallocate_fn,
+ private any_completion_handler_call_fns<Signatures...>
+{
+public:
+ template <typename... CallFns>
+ constexpr any_completion_handler_fn_table(
+ any_completion_handler_destroy_fn::type destroy_fn,
+ any_completion_handler_executor_fn::type executor_fn,
+ any_completion_handler_immediate_executor_fn::type immediate_executor_fn,
+ any_completion_handler_allocate_fn::type allocate_fn,
+ any_completion_handler_deallocate_fn::type deallocate_fn,
+ CallFns... call_fns)
+ : any_completion_handler_destroy_fn(destroy_fn),
+ any_completion_handler_executor_fn(executor_fn),
+ any_completion_handler_immediate_executor_fn(immediate_executor_fn),
+ any_completion_handler_allocate_fn(allocate_fn),
+ any_completion_handler_deallocate_fn(deallocate_fn),
+ any_completion_handler_call_fns<Signatures...>(call_fns...)
+ {
+ }
+
+ using any_completion_handler_destroy_fn::destroy;
+ using any_completion_handler_executor_fn::executor;
+ using any_completion_handler_immediate_executor_fn::immediate_executor;
+ using any_completion_handler_allocate_fn::allocate;
+ using any_completion_handler_deallocate_fn::deallocate;
+ using any_completion_handler_call_fns<Signatures...>::call;
+};
+
+template <typename Handler, typename... Signatures>
+struct any_completion_handler_fn_table_instance
+{
+ static constexpr any_completion_handler_fn_table<Signatures...>
+ value = any_completion_handler_fn_table<Signatures...>(
+ &any_completion_handler_destroy_fn::impl<Handler>,
+ &any_completion_handler_executor_fn::impl<Handler>,
+ &any_completion_handler_immediate_executor_fn::impl<Handler>,
+ &any_completion_handler_allocate_fn::impl<Handler>,
+ &any_completion_handler_deallocate_fn::impl<Handler>,
+ &any_completion_handler_call_fn<Signatures>::template impl<Handler>...);
+};
+
+template <typename Handler, typename... Signatures>
+constexpr any_completion_handler_fn_table<Signatures...>
+any_completion_handler_fn_table_instance<Handler, Signatures...>::value;
+
+} // namespace detail
+
+template <typename... Signatures>
+class any_completion_handler;
+
+/// An allocator type that forwards memory allocation operations through an
+/// instance of @c any_completion_handler.
+template <typename T, typename... Signatures>
+class any_completion_handler_allocator
+{
+private:
+ template <typename...>
+ friend class any_completion_handler;
+
+ template <typename, typename...>
+ friend class any_completion_handler_allocator;
+
+ const detail::any_completion_handler_fn_table<Signatures...>* fn_table_;
+ detail::any_completion_handler_impl_base* impl_;
+
+ constexpr any_completion_handler_allocator(int,
+ const any_completion_handler<Signatures...>& h) noexcept
+ : fn_table_(h.fn_table_),
+ impl_(h.impl_)
+ {
+ }
+
+public:
+ /// The type of objects that may be allocated by the allocator.
+ typedef T value_type;
+
+ /// Rebinds an allocator to another value type.
+ template <typename U>
+ struct rebind
+ {
+ /// Specifies the type of the rebound allocator.
+ typedef any_completion_handler_allocator<U, Signatures...> other;
+ };
+
+ /// Construct from another @c any_completion_handler_allocator.
+ template <typename U>
+ constexpr any_completion_handler_allocator(
+ const any_completion_handler_allocator<U, Signatures...>& a)
+ noexcept
+ : fn_table_(a.fn_table_),
+ impl_(a.impl_)
+ {
+ }
+
+ /// Equality operator.
+ constexpr bool operator==(
+ const any_completion_handler_allocator& other) const noexcept
+ {
+ return fn_table_ == other.fn_table_ && impl_ == other.impl_;
+ }
+
+ /// Inequality operator.
+ constexpr bool operator!=(
+ const any_completion_handler_allocator& other) const noexcept
+ {
+ return fn_table_ != other.fn_table_ || impl_ != other.impl_;
+ }
+
+ /// Allocate space for @c n objects of the allocator's value type.
+ T* allocate(std::size_t n) const
+ {
+ if (fn_table_)
+ {
+ return static_cast<T*>(
+ fn_table_->allocate(
+ impl_, sizeof(T) * n, alignof(T)));
+ }
+ std::bad_alloc ex;
+ asio::detail::throw_exception(ex);
+ return nullptr;
+ }
+
+ /// Deallocate space for @c n objects of the allocator's value type.
+ void deallocate(T* p, std::size_t n) const
+ {
+ fn_table_->deallocate(impl_, p, sizeof(T) * n, alignof(T));
+ }
+};
+
+/// A protoco-allocator type that may be rebound to obtain an allocator that
+/// forwards memory allocation operations through an instance of
+/// @c any_completion_handler.
+template <typename... Signatures>
+class any_completion_handler_allocator<void, Signatures...>
+{
+private:
+ template <typename...>
+ friend class any_completion_handler;
+
+ template <typename, typename...>
+ friend class any_completion_handler_allocator;
+
+ const detail::any_completion_handler_fn_table<Signatures...>* fn_table_;
+ detail::any_completion_handler_impl_base* impl_;
+
+ constexpr any_completion_handler_allocator(int,
+ const any_completion_handler<Signatures...>& h) noexcept
+ : fn_table_(h.fn_table_),
+ impl_(h.impl_)
+ {
+ }
+
+public:
+ /// @c void as no objects can be allocated through a proto-allocator.
+ typedef void value_type;
+
+ /// Rebinds an allocator to another value type.
+ template <typename U>
+ struct rebind
+ {
+ /// Specifies the type of the rebound allocator.
+ typedef any_completion_handler_allocator<U, Signatures...> other;
+ };
+
+ /// Construct from another @c any_completion_handler_allocator.
+ template <typename U>
+ constexpr any_completion_handler_allocator(
+ const any_completion_handler_allocator<U, Signatures...>& a)
+ noexcept
+ : fn_table_(a.fn_table_),
+ impl_(a.impl_)
+ {
+ }
+
+ /// Equality operator.
+ constexpr bool operator==(
+ const any_completion_handler_allocator& other) const noexcept
+ {
+ return fn_table_ == other.fn_table_ && impl_ == other.impl_;
+ }
+
+ /// Inequality operator.
+ constexpr bool operator!=(
+ const any_completion_handler_allocator& other) const noexcept
+ {
+ return fn_table_ != other.fn_table_ || impl_ != other.impl_;
+ }
+};
+
+/// Polymorphic wrapper for completion handlers.
+/**
+ * The @c any_completion_handler class template is a polymorphic wrapper for
+ * completion handlers that propagates the associated executor, associated
+ * allocator, and associated cancellation slot through a type-erasing interface.
+ *
+ * When using @c any_completion_handler, specify one or more completion
+ * signatures as template parameters. These will dictate the arguments that may
+ * be passed to the handler through the polymorphic interface.
+ *
+ * Typical uses for @c any_completion_handler include:
+ *
+ * @li Separate compilation of asynchronous operation implementations.
+ *
+ * @li Enabling interoperability between asynchronous operations and virtual
+ * functions.
+ */
+template <typename... Signatures>
+class any_completion_handler
+{
+#if !defined(GENERATING_DOCUMENTATION)
+private:
+ template <typename, typename...>
+ friend class any_completion_handler_allocator;
+
+ template <typename, typename>
+ friend struct associated_executor;
+
+ template <typename, typename>
+ friend struct associated_immediate_executor;
+
+ const detail::any_completion_handler_fn_table<Signatures...>* fn_table_;
+ detail::any_completion_handler_impl_base* impl_;
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+public:
+ /// The associated allocator type.
+ using allocator_type = any_completion_handler_allocator<void, Signatures...>;
+
+ /// The associated cancellation slot type.
+ using cancellation_slot_type = cancellation_slot;
+
+ /// Construct an @c any_completion_handler in an empty state, without a target
+ /// object.
+ constexpr any_completion_handler()
+ : fn_table_(nullptr),
+ impl_(nullptr)
+ {
+ }
+
+ /// Construct an @c any_completion_handler in an empty state, without a target
+ /// object.
+ constexpr any_completion_handler(nullptr_t)
+ : fn_table_(nullptr),
+ impl_(nullptr)
+ {
+ }
+
+ /// Construct an @c any_completion_handler to contain the specified target.
+ template <typename H, typename Handler = decay_t<H>>
+ any_completion_handler(H&& h,
+ constraint_t<
+ !is_same<decay_t<H>, any_completion_handler>::value
+ > = 0)
+ : fn_table_(
+ &detail::any_completion_handler_fn_table_instance<
+ Handler, Signatures...>::value),
+ impl_(detail::any_completion_handler_impl<Handler>::create(
+ (get_associated_cancellation_slot)(h), static_cast<H&&>(h)))
+ {
+ }
+
+ /// Move-construct an @c any_completion_handler from another.
+ /**
+ * After the operation, the moved-from object @c other has no target.
+ */
+ any_completion_handler(any_completion_handler&& other) noexcept
+ : fn_table_(other.fn_table_),
+ impl_(other.impl_)
+ {
+ other.fn_table_ = nullptr;
+ other.impl_ = nullptr;
+ }
+
+ /// Move-assign an @c any_completion_handler from another.
+ /**
+ * After the operation, the moved-from object @c other has no target.
+ */
+ any_completion_handler& operator=(
+ any_completion_handler&& other) noexcept
+ {
+ any_completion_handler(
+ static_cast<any_completion_handler&&>(other)).swap(*this);
+ return *this;
+ }
+
+ /// Assignment operator that sets the polymorphic wrapper to the empty state.
+ any_completion_handler& operator=(nullptr_t) noexcept
+ {
+ any_completion_handler().swap(*this);
+ return *this;
+ }
+
+ /// Destructor.
+ ~any_completion_handler()
+ {
+ if (impl_)
+ fn_table_->destroy(impl_);
+ }
+
+ /// Test if the polymorphic wrapper is empty.
+ constexpr explicit operator bool() const noexcept
+ {
+ return impl_ != nullptr;
+ }
+
+ /// Test if the polymorphic wrapper is non-empty.
+ constexpr bool operator!() const noexcept
+ {
+ return impl_ == nullptr;
+ }
+
+ /// Swap the content of an @c any_completion_handler with another.
+ void swap(any_completion_handler& other) noexcept
+ {
+ std::swap(fn_table_, other.fn_table_);
+ std::swap(impl_, other.impl_);
+ }
+
+ /// Get the associated allocator.
+ allocator_type get_allocator() const noexcept
+ {
+ return allocator_type(0, *this);
+ }
+
+ /// Get the associated cancellation slot.
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return impl_ ? impl_->get_cancellation_slot() : cancellation_slot_type();
+ }
+
+ /// Function call operator.
+ /**
+ * Invokes target completion handler with the supplied arguments.
+ *
+ * This function may only be called once, as the target handler is moved from.
+ * The polymorphic wrapper is left in an empty state.
+ *
+ * Throws @c std::bad_function_call if the polymorphic wrapper is empty.
+ */
+ template <typename... Args>
+ auto operator()(Args&&... args)
+ -> decltype(fn_table_->call(impl_, static_cast<Args&&>(args)...))
+ {
+ if (detail::any_completion_handler_impl_base* impl = impl_)
+ {
+ impl_ = nullptr;
+ return fn_table_->call(impl, static_cast<Args&&>(args)...);
+ }
+ std::bad_function_call ex;
+ asio::detail::throw_exception(ex);
+ }
+
+ /// Equality operator.
+ friend constexpr bool operator==(
+ const any_completion_handler& a, nullptr_t) noexcept
+ {
+ return a.impl_ == nullptr;
+ }
+
+ /// Equality operator.
+ friend constexpr bool operator==(
+ nullptr_t, const any_completion_handler& b) noexcept
+ {
+ return nullptr == b.impl_;
+ }
+
+ /// Inequality operator.
+ friend constexpr bool operator!=(
+ const any_completion_handler& a, nullptr_t) noexcept
+ {
+ return a.impl_ != nullptr;
+ }
+
+ /// Inequality operator.
+ friend constexpr bool operator!=(
+ nullptr_t, const any_completion_handler& b) noexcept
+ {
+ return nullptr != b.impl_;
+ }
+};
+
+template <typename... Signatures, typename Candidate>
+struct associated_executor<any_completion_handler<Signatures...>, Candidate>
+{
+ using type = any_completion_executor;
+
+ static type get(const any_completion_handler<Signatures...>& handler,
+ const Candidate& candidate = Candidate()) noexcept
+ {
+ any_completion_executor any_candidate(std::nothrow, candidate);
+ return handler.fn_table_
+ ? handler.fn_table_->executor(handler.impl_, any_candidate)
+ : any_candidate;
+ }
+};
+
+template <typename... Signatures, typename Candidate>
+struct associated_immediate_executor<
+ any_completion_handler<Signatures...>, Candidate>
+{
+ using type = any_completion_executor;
+
+ static type get(const any_completion_handler<Signatures...>& handler,
+ const Candidate& candidate = Candidate()) noexcept
+ {
+ any_io_executor any_candidate(std::nothrow, candidate);
+ return handler.fn_table_
+ ? handler.fn_table_->immediate_executor(handler.impl_, any_candidate)
+ : any_candidate;
+ }
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_ANY_COMPLETION_HANDLER_HPP
diff --git a/3rdparty/asio/include/asio/any_io_executor.hpp b/3rdparty/asio/include/asio/any_io_executor.hpp
index 5f2c13f014c..d35acf44ae3 100644
--- a/3rdparty/asio/include/asio/any_io_executor.hpp
+++ b/3rdparty/asio/include/asio/any_io_executor.hpp
@@ -2,7 +2,7 @@
// any_io_executor.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -87,30 +87,16 @@ public:
#endif // !defined(GENERATING_DOCUMENTATION)
/// Default constructor.
- any_io_executor() ASIO_NOEXCEPT
- : base_type()
- {
- }
+ ASIO_DECL any_io_executor() noexcept;
/// Construct in an empty state. Equivalent effects to default constructor.
- any_io_executor(nullptr_t) ASIO_NOEXCEPT
- : base_type(nullptr_t())
- {
- }
+ ASIO_DECL any_io_executor(nullptr_t) noexcept;
/// Copy constructor.
- any_io_executor(const any_io_executor& e) ASIO_NOEXCEPT
- : base_type(static_cast<const base_type&>(e))
- {
- }
+ ASIO_DECL any_io_executor(const any_io_executor& e) noexcept;
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move constructor.
- any_io_executor(any_io_executor&& e) ASIO_NOEXCEPT
- : base_type(static_cast<base_type&&>(e))
- {
- }
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+ ASIO_DECL any_io_executor(any_io_executor&& e) noexcept;
/// Construct to point to the same target as another any_executor.
#if defined(GENERATING_DOCUMENTATION)
@@ -119,8 +105,32 @@ public:
#else // defined(GENERATING_DOCUMENTATION)
template <typename OtherAnyExecutor>
any_io_executor(OtherAnyExecutor e,
- typename constraint<
- conditional<
+ constraint_t<
+ conditional_t<
+ !is_same<OtherAnyExecutor, any_io_executor>::value
+ && is_base_of<execution::detail::any_executor_base,
+ OtherAnyExecutor>::value,
+ typename execution::detail::supportable_properties<
+ 0, supportable_properties_type>::template
+ is_valid_target<OtherAnyExecutor>,
+ false_type
+ >::value
+ > = 0)
+ : base_type(static_cast<OtherAnyExecutor&&>(e))
+ {
+ }
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Construct to point to the same target as another any_executor.
+#if defined(GENERATING_DOCUMENTATION)
+ template <class... OtherSupportableProperties>
+ any_io_executor(std::nothrow_t,
+ execution::any_executor<OtherSupportableProperties...> e);
+#else // defined(GENERATING_DOCUMENTATION)
+ template <typename OtherAnyExecutor>
+ any_io_executor(std::nothrow_t, OtherAnyExecutor e,
+ constraint_t<
+ conditional_t<
!is_same<OtherAnyExecutor, any_io_executor>::value
&& is_base_of<execution::detail::any_executor_base,
OtherAnyExecutor>::value,
@@ -128,13 +138,20 @@ public:
0, supportable_properties_type>::template
is_valid_target<OtherAnyExecutor>,
false_type
- >::type::value
- >::type = 0)
- : base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e))
+ >::value
+ > = 0) noexcept
+ : base_type(std::nothrow, static_cast<OtherAnyExecutor&&>(e))
{
}
#endif // defined(GENERATING_DOCUMENTATION)
+ /// Construct to point to the same target as another any_executor.
+ ASIO_DECL any_io_executor(std::nothrow_t,
+ const any_io_executor& e) noexcept;
+
+ /// Construct to point to the same target as another any_executor.
+ ASIO_DECL any_io_executor(std::nothrow_t, any_io_executor&& e) noexcept;
+
/// Construct a polymorphic wrapper for the specified executor.
#if defined(GENERATING_DOCUMENTATION)
template <ASIO_EXECUTION_EXECUTOR Executor>
@@ -142,54 +159,58 @@ public:
#else // defined(GENERATING_DOCUMENTATION)
template <ASIO_EXECUTION_EXECUTOR Executor>
any_io_executor(Executor e,
- typename constraint<
- conditional<
+ constraint_t<
+ conditional_t<
!is_same<Executor, any_io_executor>::value
&& !is_base_of<execution::detail::any_executor_base,
Executor>::value,
execution::detail::is_valid_target_executor<
Executor, supportable_properties_type>,
false_type
- >::type::value
- >::type = 0)
- : base_type(ASIO_MOVE_CAST(Executor)(e))
+ >::value
+ > = 0)
+ : base_type(static_cast<Executor&&>(e))
{
}
#endif // defined(GENERATING_DOCUMENTATION)
- /// Assignment operator.
- any_io_executor& operator=(const any_io_executor& e) ASIO_NOEXCEPT
+ /// Construct a polymorphic wrapper for the specified executor.
+#if defined(GENERATING_DOCUMENTATION)
+ template <ASIO_EXECUTION_EXECUTOR Executor>
+ any_io_executor(std::nothrow_t, Executor e);
+#else // defined(GENERATING_DOCUMENTATION)
+ template <ASIO_EXECUTION_EXECUTOR Executor>
+ any_io_executor(std::nothrow_t, Executor e,
+ constraint_t<
+ conditional_t<
+ !is_same<Executor, any_io_executor>::value
+ && !is_base_of<execution::detail::any_executor_base,
+ Executor>::value,
+ execution::detail::is_valid_target_executor<
+ Executor, supportable_properties_type>,
+ false_type
+ >::value
+ > = 0) noexcept
+ : base_type(std::nothrow, static_cast<Executor&&>(e))
{
- base_type::operator=(static_cast<const base_type&>(e));
- return *this;
}
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Assignment operator.
+ ASIO_DECL any_io_executor& operator=(
+ const any_io_executor& e) noexcept;
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move assignment operator.
- any_io_executor& operator=(any_io_executor&& e) ASIO_NOEXCEPT
- {
- base_type::operator=(static_cast<base_type&&>(e));
- return *this;
- }
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+ ASIO_DECL any_io_executor& operator=(any_io_executor&& e) noexcept;
/// Assignment operator that sets the polymorphic wrapper to the empty state.
- any_io_executor& operator=(nullptr_t)
- {
- base_type::operator=(nullptr_t());
- return *this;
- }
+ ASIO_DECL any_io_executor& operator=(nullptr_t);
/// Destructor.
- ~any_io_executor()
- {
- }
+ ASIO_DECL ~any_io_executor();
/// Swap targets with another polymorphic wrapper.
- void swap(any_io_executor& other) ASIO_NOEXCEPT
- {
- static_cast<base_type&>(*this).swap(static_cast<base_type&>(other));
- }
+ ASIO_DECL void swap(any_io_executor& other) noexcept;
/// Obtain a polymorphic wrapper with the specified property.
/**
@@ -202,9 +223,9 @@ public:
*/
template <typename Property>
any_io_executor require(const Property& p,
- typename constraint<
+ constraint_t<
traits::require_member<const base_type&, const Property&>::is_valid
- >::type = 0) const
+ > = 0) const
{
return static_cast<const base_type&>(*this).require(p);
}
@@ -220,9 +241,9 @@ public:
*/
template <typename Property>
any_io_executor prefer(const Property& p,
- typename constraint<
+ constraint_t<
traits::prefer_member<const base_type&, const Property&>::is_valid
- >::type = 0) const
+ > = 0) const
{
return static_cast<const base_type&>(*this).prefer(p);
}
@@ -230,6 +251,30 @@ public:
#if !defined(GENERATING_DOCUMENTATION)
+template <>
+ASIO_DECL any_io_executor any_io_executor::require(
+ const execution::blocking_t::never_t&, int) const;
+
+template <>
+ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::blocking_t::possibly_t&, int) const;
+
+template <>
+ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::outstanding_work_t::tracked_t&, int) const;
+
+template <>
+ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::outstanding_work_t::untracked_t&, int) const;
+
+template <>
+ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::relationship_t::fork_t&, int) const;
+
+template <>
+ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::relationship_t::continuation_t&, int) const;
+
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -297,4 +342,10 @@ struct prefer_member<any_io_executor, Prop> :
#include "asio/detail/pop_options.hpp"
+#if defined(ASIO_HEADER_ONLY) \
+ && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+# include "asio/impl/any_io_executor.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+ // && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
#endif // ASIO_ANY_IO_EXECUTOR_HPP
diff --git a/3rdparty/asio/include/asio/append.hpp b/3rdparty/asio/include/asio/append.hpp
new file mode 100644
index 00000000000..04608924280
--- /dev/null
+++ b/3rdparty/asio/include/asio/append.hpp
@@ -0,0 +1,65 @@
+//
+// append.hpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_APPEND_HPP
+#define ASIO_APPEND_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <tuple>
+#include "asio/detail/type_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// Completion token type used to specify that the completion handler
+/// arguments should be passed additional values after the results of the
+/// operation.
+template <typename CompletionToken, typename... Values>
+class append_t
+{
+public:
+ /// Constructor.
+ template <typename T, typename... V>
+ constexpr explicit append_t(T&& completion_token, V&&... values)
+ : token_(static_cast<T&&>(completion_token)),
+ values_(static_cast<V&&>(values)...)
+ {
+ }
+
+//private:
+ CompletionToken token_;
+ std::tuple<Values...> values_;
+};
+
+/// Completion token type used to specify that the completion handler
+/// arguments should be passed additional values after the results of the
+/// operation.
+template <typename CompletionToken, typename... Values>
+ASIO_NODISCARD inline constexpr
+append_t<decay_t<CompletionToken>, decay_t<Values>...>
+append(CompletionToken&& completion_token, Values&&... values)
+{
+ return append_t<decay_t<CompletionToken>, decay_t<Values>...>(
+ static_cast<CompletionToken&&>(completion_token),
+ static_cast<Values&&>(values)...);
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/impl/append.hpp"
+
+#endif // ASIO_APPEND_HPP
diff --git a/3rdparty/asio/include/asio/as_tuple.hpp b/3rdparty/asio/include/asio/as_tuple.hpp
new file mode 100644
index 00000000000..60008bda5c2
--- /dev/null
+++ b/3rdparty/asio/include/asio/as_tuple.hpp
@@ -0,0 +1,126 @@
+//
+// as_tuple.hpp
+// ~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_AS_TUPLE_HPP
+#define ASIO_AS_TUPLE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/type_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// A @ref completion_token adapter used to specify that the completion handler
+/// arguments should be combined into a single tuple argument.
+/**
+ * The as_tuple_t class is used to indicate that any arguments to the
+ * completion handler should be combined and passed as a single tuple argument.
+ * The arguments are first moved into a @c std::tuple and that tuple is then
+ * passed to the completion handler.
+ */
+template <typename CompletionToken>
+class as_tuple_t
+{
+public:
+ /// Tag type used to prevent the "default" constructor from being used for
+ /// conversions.
+ struct default_constructor_tag {};
+
+ /// Default constructor.
+ /**
+ * This constructor is only valid if the underlying completion token is
+ * default constructible and move constructible. The underlying completion
+ * token is itself defaulted as an argument to allow it to capture a source
+ * location.
+ */
+ constexpr as_tuple_t(
+ default_constructor_tag = default_constructor_tag(),
+ CompletionToken token = CompletionToken())
+ : token_(static_cast<CompletionToken&&>(token))
+ {
+ }
+
+ /// Constructor.
+ template <typename T>
+ constexpr explicit as_tuple_t(
+ T&& completion_token)
+ : token_(static_cast<T&&>(completion_token))
+ {
+ }
+
+ /// Adapts an executor to add the @c as_tuple_t completion token as the
+ /// default.
+ template <typename InnerExecutor>
+ struct executor_with_default : InnerExecutor
+ {
+ /// Specify @c as_tuple_t as the default completion token type.
+ typedef as_tuple_t default_completion_token_type;
+
+ /// Construct the adapted executor from the inner executor type.
+ template <typename InnerExecutor1>
+ executor_with_default(const InnerExecutor1& ex,
+ constraint_t<
+ conditional_t<
+ !is_same<InnerExecutor1, executor_with_default>::value,
+ is_convertible<InnerExecutor1, InnerExecutor>,
+ false_type
+ >::value
+ > = 0) noexcept
+ : InnerExecutor(ex)
+ {
+ }
+ };
+
+ /// Type alias to adapt an I/O object to use @c as_tuple_t as its
+ /// default completion token type.
+ template <typename T>
+ using as_default_on_t = typename T::template rebind_executor<
+ executor_with_default<typename T::executor_type>>::other;
+
+ /// Function helper to adapt an I/O object to use @c as_tuple_t as its
+ /// default completion token type.
+ template <typename T>
+ static typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other
+ as_default_on(T&& object)
+ {
+ return typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other(static_cast<T&&>(object));
+ }
+
+//private:
+ CompletionToken token_;
+};
+
+/// Adapt a @ref completion_token to specify that the completion handler
+/// arguments should be combined into a single tuple argument.
+template <typename CompletionToken>
+ASIO_NODISCARD inline
+constexpr as_tuple_t<decay_t<CompletionToken>>
+as_tuple(CompletionToken&& completion_token)
+{
+ return as_tuple_t<decay_t<CompletionToken>>(
+ static_cast<CompletionToken&&>(completion_token));
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/impl/as_tuple.hpp"
+
+#endif // ASIO_AS_TUPLE_HPP
diff --git a/3rdparty/asio/include/asio/associated_allocator.hpp b/3rdparty/asio/include/asio/associated_allocator.hpp
index 3f945834a95..f21ea250efb 100644
--- a/3rdparty/asio/include/asio/associated_allocator.hpp
+++ b/3rdparty/asio/include/asio/associated_allocator.hpp
@@ -2,7 +2,7 @@
// associated_allocator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -36,43 +36,54 @@ struct has_allocator_type : false_type
};
template <typename T>
-struct has_allocator_type<T,
- typename void_type<typename T::executor_type>::type>
- : true_type
+struct has_allocator_type<T, void_t<typename T::allocator_type>> : true_type
{
};
-template <typename T, typename E, typename = void, typename = void>
+template <typename T, typename A, typename = void, typename = void>
struct associated_allocator_impl
{
- typedef E type;
+ typedef void asio_associated_allocator_is_unspecialised;
- static type get(const T&, const E& e) ASIO_NOEXCEPT
+ typedef A type;
+
+ static type get(const T&) noexcept
+ {
+ return type();
+ }
+
+ static const type& get(const T&, const A& a) noexcept
{
- return e;
+ return a;
}
};
-template <typename T, typename E>
-struct associated_allocator_impl<T, E,
- typename void_type<typename T::allocator_type>::type>
+template <typename T, typename A>
+struct associated_allocator_impl<T, A, void_t<typename T::allocator_type>>
{
typedef typename T::allocator_type type;
- static type get(const T& t, const E&) ASIO_NOEXCEPT
+ static auto get(const T& t) noexcept
+ -> decltype(t.get_allocator())
+ {
+ return t.get_allocator();
+ }
+
+ static auto get(const T& t, const A&) noexcept
+ -> decltype(t.get_allocator())
{
return t.get_allocator();
}
};
-template <typename T, typename E>
-struct associated_allocator_impl<T, E,
- typename enable_if<
+template <typename T, typename A>
+struct associated_allocator_impl<T, A,
+ enable_if_t<
!has_allocator_type<T>::value
- >::type,
- typename void_type<
- typename associator<associated_allocator, T, E>::type
- >::type> : associator<associated_allocator, T, E>
+ >,
+ void_t<
+ typename associator<associated_allocator, T, A>::type
+ >> : associator<associated_allocator, T, A>
{
};
@@ -92,29 +103,32 @@ struct associated_allocator_impl<T, E,
* Allocator requirements.
*
* @li Provide a noexcept static member function named @c get, callable as @c
- * get(t) and with return type @c type.
+ * get(t) and with return type @c type or a (possibly const) reference to @c
+ * type.
*
* @li Provide a noexcept static member function named @c get, callable as @c
- * get(t,a) and with return type @c type.
+ * get(t,a) and with return type @c type or a (possibly const) reference to @c
+ * type.
*/
-template <typename T, typename Allocator = std::allocator<void> >
+template <typename T, typename Allocator = std::allocator<void>>
struct associated_allocator
+#if !defined(GENERATING_DOCUMENTATION)
+ : detail::associated_allocator_impl<T, Allocator>
+#endif // !defined(GENERATING_DOCUMENTATION)
{
+#if defined(GENERATING_DOCUMENTATION)
/// If @c T has a nested type @c allocator_type, <tt>T::allocator_type</tt>.
/// Otherwise @c Allocator.
-#if defined(GENERATING_DOCUMENTATION)
typedef see_below type;
-#else // defined(GENERATING_DOCUMENTATION)
- typedef typename detail::associated_allocator_impl<T, Allocator>::type type;
-#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// If @c T has a nested type @c allocator_type, returns
+ /// <tt>t.get_allocator()</tt>. Otherwise returns @c type().
+ static decltype(auto) get(const T& t) noexcept;
/// If @c T has a nested type @c allocator_type, returns
/// <tt>t.get_allocator()</tt>. Otherwise returns @c a.
- static type get(const T& t,
- const Allocator& a = Allocator()) ASIO_NOEXCEPT
- {
- return detail::associated_allocator_impl<T, Allocator>::get(t, a);
- }
+ static decltype(auto) get(const T& t, const Allocator& a) noexcept;
+#endif // defined(GENERATING_DOCUMENTATION)
};
/// Helper function to obtain an object's associated allocator.
@@ -122,8 +136,8 @@ struct associated_allocator
* @returns <tt>associated_allocator<T>::get(t)</tt>
*/
template <typename T>
-inline typename associated_allocator<T>::type
-get_associated_allocator(const T& t) ASIO_NOEXCEPT
+ASIO_NODISCARD inline typename associated_allocator<T>::type
+get_associated_allocator(const T& t) noexcept
{
return associated_allocator<T>::get(t);
}
@@ -133,26 +147,45 @@ get_associated_allocator(const T& t) ASIO_NOEXCEPT
* @returns <tt>associated_allocator<T, Allocator>::get(t, a)</tt>
*/
template <typename T, typename Allocator>
-inline typename associated_allocator<T, Allocator>::type
-get_associated_allocator(const T& t, const Allocator& a) ASIO_NOEXCEPT
+ASIO_NODISCARD inline auto get_associated_allocator(
+ const T& t, const Allocator& a) noexcept
+ -> decltype(associated_allocator<T, Allocator>::get(t, a))
{
return associated_allocator<T, Allocator>::get(t, a);
}
-#if defined(ASIO_HAS_ALIAS_TEMPLATES)
-
-template <typename T, typename Allocator = std::allocator<void> >
+template <typename T, typename Allocator = std::allocator<void>>
using associated_allocator_t
= typename associated_allocator<T, Allocator>::type;
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
+namespace detail {
+
+template <typename T, typename A, typename = void>
+struct associated_allocator_forwarding_base
+{
+};
-#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \
- || defined(GENERATING_DOCUMENTATION)
+template <typename T, typename A>
+struct associated_allocator_forwarding_base<T, A,
+ enable_if_t<
+ is_same<
+ typename associated_allocator<T,
+ A>::asio_associated_allocator_is_unspecialised,
+ void
+ >::value
+ >>
+{
+ typedef void asio_associated_allocator_is_unspecialised;
+};
+
+} // namespace detail
/// Specialisation of associated_allocator for @c std::reference_wrapper.
template <typename T, typename Allocator>
struct associated_allocator<reference_wrapper<T>, Allocator>
+#if !defined(GENERATING_DOCUMENTATION)
+ : detail::associated_allocator_forwarding_base<T, Allocator>
+#endif // !defined(GENERATING_DOCUMENTATION)
{
/// Forwards @c type to the associator specialisation for the unwrapped type
/// @c T.
@@ -160,16 +193,20 @@ struct associated_allocator<reference_wrapper<T>, Allocator>
/// Forwards the request to get the allocator to the associator specialisation
/// for the unwrapped type @c T.
- static type get(reference_wrapper<T> t,
- const Allocator& a = Allocator()) ASIO_NOEXCEPT
+ static type get(reference_wrapper<T> t) noexcept
+ {
+ return associated_allocator<T, Allocator>::get(t.get());
+ }
+
+ /// Forwards the request to get the allocator to the associator specialisation
+ /// for the unwrapped type @c T.
+ static auto get(reference_wrapper<T> t, const Allocator& a) noexcept
+ -> decltype(associated_allocator<T, Allocator>::get(t.get(), a))
{
return associated_allocator<T, Allocator>::get(t.get(), a);
}
};
-#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER)
- // || defined(GENERATING_DOCUMENTATION)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/associated_cancellation_slot.hpp b/3rdparty/asio/include/asio/associated_cancellation_slot.hpp
index 6a809e71104..518bd881eaf 100644
--- a/3rdparty/asio/include/asio/associated_cancellation_slot.hpp
+++ b/3rdparty/asio/include/asio/associated_cancellation_slot.hpp
@@ -2,7 +2,7 @@
// associated_cancellation_slot.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,6 +18,7 @@
#include "asio/detail/config.hpp"
#include "asio/associator.hpp"
#include "asio/cancellation_signal.hpp"
+#include "asio/detail/functional.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/detail/push_options.hpp"
@@ -35,9 +36,8 @@ struct has_cancellation_slot_type : false_type
};
template <typename T>
-struct has_cancellation_slot_type<T,
- typename void_type<typename T::cancellation_slot_type>::type>
- : true_type
+struct has_cancellation_slot_type<T, void_t<typename T::cancellation_slot_type>>
+ : true_type
{
};
@@ -48,7 +48,12 @@ struct associated_cancellation_slot_impl
typedef S type;
- static type get(const T&, const S& s = S()) ASIO_NOEXCEPT
+ static type get(const T&) noexcept
+ {
+ return type();
+ }
+
+ static const type& get(const T&, const S& s) noexcept
{
return s;
}
@@ -56,11 +61,18 @@ struct associated_cancellation_slot_impl
template <typename T, typename S>
struct associated_cancellation_slot_impl<T, S,
- typename void_type<typename T::cancellation_slot_type>::type>
+ void_t<typename T::cancellation_slot_type>>
{
typedef typename T::cancellation_slot_type type;
- static type get(const T& t, const S& = S()) ASIO_NOEXCEPT
+ static auto get(const T& t) noexcept
+ -> decltype(t.get_cancellation_slot())
+ {
+ return t.get_cancellation_slot();
+ }
+
+ static auto get(const T& t, const S&) noexcept
+ -> decltype(t.get_cancellation_slot())
{
return t.get_cancellation_slot();
}
@@ -68,12 +80,12 @@ struct associated_cancellation_slot_impl<T, S,
template <typename T, typename S>
struct associated_cancellation_slot_impl<T, S,
- typename enable_if<
+ enable_if_t<
!has_cancellation_slot_type<T>::value
- >::type,
- typename void_type<
+ >,
+ void_t<
typename associator<associated_cancellation_slot, T, S>::type
- >::type> : associator<associated_cancellation_slot, T, S>
+ >> : associator<associated_cancellation_slot, T, S>
{
};
@@ -93,10 +105,12 @@ struct associated_cancellation_slot_impl<T, S,
* CancellationSlot requirements.
*
* @li Provide a noexcept static member function named @c get, callable as @c
- * get(t) and with return type @c type.
+ * get(t) and with return type @c type or a (possibly const) reference to @c
+ * type.
*
* @li Provide a noexcept static member function named @c get, callable as @c
- * get(t,s) and with return type @c type.
+ * get(t,s) and with return type @c type or a (possibly const) reference to @c
+ * type.
*/
template <typename T, typename CancellationSlot = cancellation_slot>
struct associated_cancellation_slot
@@ -111,9 +125,13 @@ struct associated_cancellation_slot
typedef see_below type;
/// If @c T has a nested type @c cancellation_slot_type, returns
+ /// <tt>t.get_cancellation_slot()</tt>. Otherwise returns @c type().
+ static decltype(auto) get(const T& t) noexcept;
+
+ /// If @c T has a nested type @c cancellation_slot_type, returns
/// <tt>t.get_cancellation_slot()</tt>. Otherwise returns @c s.
- static type get(const T& t,
- const CancellationSlot& s = CancellationSlot()) ASIO_NOEXCEPT;
+ static decltype(auto) get(const T& t,
+ const CancellationSlot& s) noexcept;
#endif // defined(GENERATING_DOCUMENTATION)
};
@@ -122,8 +140,8 @@ struct associated_cancellation_slot
* @returns <tt>associated_cancellation_slot<T>::get(t)</tt>
*/
template <typename T>
-inline typename associated_cancellation_slot<T>::type
-get_associated_cancellation_slot(const T& t) ASIO_NOEXCEPT
+ASIO_NODISCARD inline typename associated_cancellation_slot<T>::type
+get_associated_cancellation_slot(const T& t) noexcept
{
return associated_cancellation_slot<T>::get(t);
}
@@ -134,21 +152,17 @@ get_associated_cancellation_slot(const T& t) ASIO_NOEXCEPT
* CancellationSlot>::get(t, st)</tt>
*/
template <typename T, typename CancellationSlot>
-inline typename associated_cancellation_slot<T, CancellationSlot>::type
-get_associated_cancellation_slot(const T& t,
- const CancellationSlot& st) ASIO_NOEXCEPT
+ASIO_NODISCARD inline auto get_associated_cancellation_slot(
+ const T& t, const CancellationSlot& st) noexcept
+ -> decltype(associated_cancellation_slot<T, CancellationSlot>::get(t, st))
{
return associated_cancellation_slot<T, CancellationSlot>::get(t, st);
}
-#if defined(ASIO_HAS_ALIAS_TEMPLATES)
-
template <typename T, typename CancellationSlot = cancellation_slot>
using associated_cancellation_slot_t =
typename associated_cancellation_slot<T, CancellationSlot>::type;
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
-
namespace detail {
template <typename T, typename S, typename = void>
@@ -158,18 +172,48 @@ struct associated_cancellation_slot_forwarding_base
template <typename T, typename S>
struct associated_cancellation_slot_forwarding_base<T, S,
- typename enable_if<
+ enable_if_t<
is_same<
typename associated_cancellation_slot<T,
S>::asio_associated_cancellation_slot_is_unspecialised,
void
>::value
- >::type>
+ >>
{
typedef void asio_associated_cancellation_slot_is_unspecialised;
};
} // namespace detail
+
+/// Specialisation of associated_cancellation_slot for @c
+/// std::reference_wrapper.
+template <typename T, typename CancellationSlot>
+struct associated_cancellation_slot<reference_wrapper<T>, CancellationSlot>
+#if !defined(GENERATING_DOCUMENTATION)
+ : detail::associated_cancellation_slot_forwarding_base<T, CancellationSlot>
+#endif // !defined(GENERATING_DOCUMENTATION)
+{
+ /// Forwards @c type to the associator specialisation for the unwrapped type
+ /// @c T.
+ typedef typename associated_cancellation_slot<T, CancellationSlot>::type type;
+
+ /// Forwards the request to get the cancellation slot to the associator
+ /// specialisation for the unwrapped type @c T.
+ static type get(reference_wrapper<T> t) noexcept
+ {
+ return associated_cancellation_slot<T, CancellationSlot>::get(t.get());
+ }
+
+ /// Forwards the request to get the cancellation slot to the associator
+ /// specialisation for the unwrapped type @c T.
+ static auto get(reference_wrapper<T> t, const CancellationSlot& s) noexcept
+ -> decltype(
+ associated_cancellation_slot<T, CancellationSlot>::get(t.get(), s))
+ {
+ return associated_cancellation_slot<T, CancellationSlot>::get(t.get(), s);
+ }
+};
+
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/associated_executor.hpp b/3rdparty/asio/include/asio/associated_executor.hpp
index 1e62e37a12e..4ca7ba149e9 100644
--- a/3rdparty/asio/include/asio/associated_executor.hpp
+++ b/3rdparty/asio/include/asio/associated_executor.hpp
@@ -2,7 +2,7 @@
// associated_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -38,8 +38,7 @@ struct has_executor_type : false_type
};
template <typename T>
-struct has_executor_type<T,
- typename void_type<typename T::executor_type>::type>
+struct has_executor_type<T, void_t<typename T::executor_type>>
: true_type
{
};
@@ -51,19 +50,30 @@ struct associated_executor_impl
typedef E type;
- static type get(const T&, const E& e = E()) ASIO_NOEXCEPT
+ static type get(const T&) noexcept
+ {
+ return type();
+ }
+
+ static const type& get(const T&, const E& e) noexcept
{
return e;
}
};
template <typename T, typename E>
-struct associated_executor_impl<T, E,
- typename void_type<typename T::executor_type>::type>
+struct associated_executor_impl<T, E, void_t<typename T::executor_type>>
{
typedef typename T::executor_type type;
- static type get(const T& t, const E& = E()) ASIO_NOEXCEPT
+ static auto get(const T& t) noexcept
+ -> decltype(t.get_executor())
+ {
+ return t.get_executor();
+ }
+
+ static auto get(const T& t, const E&) noexcept
+ -> decltype(t.get_executor())
{
return t.get_executor();
}
@@ -71,12 +81,12 @@ struct associated_executor_impl<T, E,
template <typename T, typename E>
struct associated_executor_impl<T, E,
- typename enable_if<
+ enable_if_t<
!has_executor_type<T>::value
- >::type,
- typename void_type<
+ >,
+ void_t<
typename associator<associated_executor, T, E>::type
- >::type> : associator<associated_executor, T, E>
+ >> : associator<associated_executor, T, E>
{
};
@@ -96,10 +106,12 @@ struct associated_executor_impl<T, E,
* Executor requirements.
*
* @li Provide a noexcept static member function named @c get, callable as @c
- * get(t) and with return type @c type.
+ * get(t) and with return type @c type or a (possibly const) reference to @c
+ * type.
*
* @li Provide a noexcept static member function named @c get, callable as @c
- * get(t,e) and with return type @c type.
+ * get(t,e) and with return type @c type or a (possibly const) reference to @c
+ * type.
*/
template <typename T, typename Executor = system_executor>
struct associated_executor
@@ -113,9 +125,12 @@ struct associated_executor
typedef see_below type;
/// If @c T has a nested type @c executor_type, returns
+ /// <tt>t.get_executor()</tt>. Otherwise returns @c type().
+ static decltype(auto) get(const T& t) noexcept;
+
+ /// If @c T has a nested type @c executor_type, returns
/// <tt>t.get_executor()</tt>. Otherwise returns @c ex.
- static type get(const T& t,
- const Executor& ex = Executor()) ASIO_NOEXCEPT;
+ static decltype(auto) get(const T& t, const Executor& ex) noexcept;
#endif // defined(GENERATING_DOCUMENTATION)
};
@@ -124,8 +139,8 @@ struct associated_executor
* @returns <tt>associated_executor<T>::get(t)</tt>
*/
template <typename T>
-inline typename associated_executor<T>::type
-get_associated_executor(const T& t) ASIO_NOEXCEPT
+ASIO_NODISCARD inline typename associated_executor<T>::type
+get_associated_executor(const T& t) noexcept
{
return associated_executor<T>::get(t);
}
@@ -135,11 +150,12 @@ get_associated_executor(const T& t) ASIO_NOEXCEPT
* @returns <tt>associated_executor<T, Executor>::get(t, ex)</tt>
*/
template <typename T, typename Executor>
-inline typename associated_executor<T, Executor>::type
-get_associated_executor(const T& t, const Executor& ex,
- typename constraint<
+ASIO_NODISCARD inline auto get_associated_executor(
+ const T& t, const Executor& ex,
+ constraint_t<
is_executor<Executor>::value || execution::is_executor<Executor>::value
- >::type = 0) ASIO_NOEXCEPT
+ > = 0) noexcept
+ -> decltype(associated_executor<T, Executor>::get(t, ex))
{
return associated_executor<T, Executor>::get(t, ex);
}
@@ -150,23 +166,19 @@ get_associated_executor(const T& t, const Executor& ex,
* ExecutionContext::executor_type>::get(t, ctx.get_executor())</tt>
*/
template <typename T, typename ExecutionContext>
-inline typename associated_executor<T,
- typename ExecutionContext::executor_type>::type
+ASIO_NODISCARD inline typename associated_executor<T,
+ typename ExecutionContext::executor_type>::type
get_associated_executor(const T& t, ExecutionContext& ctx,
- typename constraint<is_convertible<ExecutionContext&,
- execution_context&>::value>::type = 0) ASIO_NOEXCEPT
+ constraint_t<is_convertible<ExecutionContext&,
+ execution_context&>::value> = 0) noexcept
{
return associated_executor<T,
typename ExecutionContext::executor_type>::get(t, ctx.get_executor());
}
-#if defined(ASIO_HAS_ALIAS_TEMPLATES)
-
template <typename T, typename Executor = system_executor>
using associated_executor_t = typename associated_executor<T, Executor>::type;
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
-
namespace detail {
template <typename T, typename E, typename = void>
@@ -176,22 +188,19 @@ struct associated_executor_forwarding_base
template <typename T, typename E>
struct associated_executor_forwarding_base<T, E,
- typename enable_if<
+ enable_if_t<
is_same<
typename associated_executor<T,
E>::asio_associated_executor_is_unspecialised,
void
>::value
- >::type>
+ >>
{
typedef void asio_associated_executor_is_unspecialised;
};
} // namespace detail
-#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \
- || defined(GENERATING_DOCUMENTATION)
-
/// Specialisation of associated_executor for @c std::reference_wrapper.
template <typename T, typename Executor>
struct associated_executor<reference_wrapper<T>, Executor>
@@ -205,16 +214,20 @@ struct associated_executor<reference_wrapper<T>, Executor>
/// Forwards the request to get the executor to the associator specialisation
/// for the unwrapped type @c T.
- static type get(reference_wrapper<T> t,
- const Executor& ex = Executor()) ASIO_NOEXCEPT
+ static type get(reference_wrapper<T> t) noexcept
+ {
+ return associated_executor<T, Executor>::get(t.get());
+ }
+
+ /// Forwards the request to get the executor to the associator specialisation
+ /// for the unwrapped type @c T.
+ static auto get(reference_wrapper<T> t, const Executor& ex) noexcept
+ -> decltype(associated_executor<T, Executor>::get(t.get(), ex))
{
return associated_executor<T, Executor>::get(t.get(), ex);
}
};
-#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER)
- // || defined(GENERATING_DOCUMENTATION)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/associated_immediate_executor.hpp b/3rdparty/asio/include/asio/associated_immediate_executor.hpp
new file mode 100644
index 00000000000..aa6e0fcfee7
--- /dev/null
+++ b/3rdparty/asio/include/asio/associated_immediate_executor.hpp
@@ -0,0 +1,280 @@
+//
+// associated_immediate_executor.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_ASSOCIATED_IMMEDIATE_EXECUTOR_HPP
+#define ASIO_ASSOCIATED_IMMEDIATE_EXECUTOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associator.hpp"
+#include "asio/detail/functional.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/execution/blocking.hpp"
+#include "asio/execution/executor.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/is_executor.hpp"
+#include "asio/require.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+template <typename T, typename Executor>
+struct associated_immediate_executor;
+
+namespace detail {
+
+template <typename T, typename = void>
+struct has_immediate_executor_type : false_type
+{
+};
+
+template <typename T>
+struct has_immediate_executor_type<T,
+ void_t<typename T::immediate_executor_type>>
+ : true_type
+{
+};
+
+template <typename E, typename = void, typename = void>
+struct default_immediate_executor
+{
+ typedef require_result_t<E, execution::blocking_t::never_t> type;
+
+ static type get(const E& e) noexcept
+ {
+ return asio::require(e, execution::blocking.never);
+ }
+};
+
+template <typename E>
+struct default_immediate_executor<E,
+ enable_if_t<
+ !execution::is_executor<E>::value
+ >,
+ enable_if_t<
+ is_executor<E>::value
+ >>
+{
+ class type : public E
+ {
+ public:
+ template <typename Executor1>
+ explicit type(const Executor1& e,
+ constraint_t<
+ conditional_t<
+ !is_same<Executor1, type>::value,
+ is_convertible<Executor1, E>,
+ false_type
+ >::value
+ > = 0) noexcept
+ : E(e)
+ {
+ }
+
+ type(const type& other) noexcept
+ : E(static_cast<const E&>(other))
+ {
+ }
+
+ type(type&& other) noexcept
+ : E(static_cast<E&&>(other))
+ {
+ }
+
+ template <typename Function, typename Allocator>
+ void dispatch(Function&& f, const Allocator& a) const
+ {
+ this->post(static_cast<Function&&>(f), a);
+ }
+
+ friend bool operator==(const type& a, const type& b) noexcept
+ {
+ return static_cast<const E&>(a) == static_cast<const E&>(b);
+ }
+
+ friend bool operator!=(const type& a, const type& b) noexcept
+ {
+ return static_cast<const E&>(a) != static_cast<const E&>(b);
+ }
+ };
+
+ static type get(const E& e) noexcept
+ {
+ return type(e);
+ }
+};
+
+template <typename T, typename E, typename = void, typename = void>
+struct associated_immediate_executor_impl
+{
+ typedef void asio_associated_immediate_executor_is_unspecialised;
+
+ typedef typename default_immediate_executor<E>::type type;
+
+ static auto get(const T&, const E& e) noexcept
+ -> decltype(default_immediate_executor<E>::get(e))
+ {
+ return default_immediate_executor<E>::get(e);
+ }
+};
+
+template <typename T, typename E>
+struct associated_immediate_executor_impl<T, E,
+ void_t<typename T::immediate_executor_type>>
+{
+ typedef typename T::immediate_executor_type type;
+
+ static auto get(const T& t, const E&) noexcept
+ -> decltype(t.get_immediate_executor())
+ {
+ return t.get_immediate_executor();
+ }
+};
+
+template <typename T, typename E>
+struct associated_immediate_executor_impl<T, E,
+ enable_if_t<
+ !has_immediate_executor_type<T>::value
+ >,
+ void_t<
+ typename associator<associated_immediate_executor, T, E>::type
+ >> : associator<associated_immediate_executor, T, E>
+{
+};
+
+} // namespace detail
+
+/// Traits type used to obtain the immediate executor associated with an object.
+/**
+ * A program may specialise this traits type if the @c T template parameter in
+ * the specialisation is a user-defined type. The template parameter @c
+ * Executor shall be a type meeting the Executor requirements.
+ *
+ * Specialisations shall meet the following requirements, where @c t is a const
+ * reference to an object of type @c T, and @c e is an object of type @c
+ * Executor.
+ *
+ * @li Provide a nested typedef @c type that identifies a type meeting the
+ * Executor requirements.
+ *
+ * @li Provide a noexcept static member function named @c get, callable as @c
+ * get(t) and with return type @c type or a (possibly const) reference to @c
+ * type.
+ *
+ * @li Provide a noexcept static member function named @c get, callable as @c
+ * get(t,e) and with return type @c type or a (possibly const) reference to @c
+ * type.
+ */
+template <typename T, typename Executor>
+struct associated_immediate_executor
+#if !defined(GENERATING_DOCUMENTATION)
+ : detail::associated_immediate_executor_impl<T, Executor>
+#endif // !defined(GENERATING_DOCUMENTATION)
+{
+#if defined(GENERATING_DOCUMENTATION)
+ /// If @c T has a nested type @c immediate_executor_type,
+ // <tt>T::immediate_executor_type</tt>. Otherwise @c Executor.
+ typedef see_below type;
+
+ /// If @c T has a nested type @c immediate_executor_type, returns
+ /// <tt>t.get_immediate_executor()</tt>. Otherwise returns
+ /// <tt>asio::require(ex, asio::execution::blocking.never)</tt>.
+ static decltype(auto) get(const T& t, const Executor& ex) noexcept;
+#endif // defined(GENERATING_DOCUMENTATION)
+};
+
+/// Helper function to obtain an object's associated executor.
+/**
+ * @returns <tt>associated_immediate_executor<T, Executor>::get(t, ex)</tt>
+ */
+template <typename T, typename Executor>
+ASIO_NODISCARD inline auto get_associated_immediate_executor(
+ const T& t, const Executor& ex,
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ > = 0) noexcept
+ -> decltype(associated_immediate_executor<T, Executor>::get(t, ex))
+{
+ return associated_immediate_executor<T, Executor>::get(t, ex);
+}
+
+/// Helper function to obtain an object's associated executor.
+/**
+ * @returns <tt>associated_immediate_executor<T, typename
+ * ExecutionContext::executor_type>::get(t, ctx.get_executor())</tt>
+ */
+template <typename T, typename ExecutionContext>
+ASIO_NODISCARD inline typename associated_immediate_executor<T,
+ typename ExecutionContext::executor_type>::type
+get_associated_immediate_executor(const T& t, ExecutionContext& ctx,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0) noexcept
+{
+ return associated_immediate_executor<T,
+ typename ExecutionContext::executor_type>::get(t, ctx.get_executor());
+}
+
+template <typename T, typename Executor>
+using associated_immediate_executor_t =
+ typename associated_immediate_executor<T, Executor>::type;
+
+namespace detail {
+
+template <typename T, typename E, typename = void>
+struct associated_immediate_executor_forwarding_base
+{
+};
+
+template <typename T, typename E>
+struct associated_immediate_executor_forwarding_base<T, E,
+ enable_if_t<
+ is_same<
+ typename associated_immediate_executor<T,
+ E>::asio_associated_immediate_executor_is_unspecialised,
+ void
+ >::value
+ >>
+{
+ typedef void asio_associated_immediate_executor_is_unspecialised;
+};
+
+} // namespace detail
+
+/// Specialisation of associated_immediate_executor for
+/// @c std::reference_wrapper.
+template <typename T, typename Executor>
+struct associated_immediate_executor<reference_wrapper<T>, Executor>
+#if !defined(GENERATING_DOCUMENTATION)
+ : detail::associated_immediate_executor_forwarding_base<T, Executor>
+#endif // !defined(GENERATING_DOCUMENTATION)
+{
+ /// Forwards @c type to the associator specialisation for the unwrapped type
+ /// @c T.
+ typedef typename associated_immediate_executor<T, Executor>::type type;
+
+ /// Forwards the request to get the executor to the associator specialisation
+ /// for the unwrapped type @c T.
+ static auto get(reference_wrapper<T> t, const Executor& ex) noexcept
+ -> decltype(associated_immediate_executor<T, Executor>::get(t.get(), ex))
+ {
+ return associated_immediate_executor<T, Executor>::get(t.get(), ex);
+ }
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_ASSOCIATED_IMMEDIATE_EXECUTOR_HPP
diff --git a/3rdparty/asio/include/asio/associator.hpp b/3rdparty/asio/include/asio/associator.hpp
index 0f93b120623..7952fcc51ba 100644
--- a/3rdparty/asio/include/asio/associator.hpp
+++ b/3rdparty/asio/include/asio/associator.hpp
@@ -2,7 +2,7 @@
// associator.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/async_result.hpp b/3rdparty/asio/include/asio/async_result.hpp
index 1750e19e3a4..cdae9ede687 100644
--- a/3rdparty/asio/include/asio/async_result.hpp
+++ b/3rdparty/asio/include/asio/async_result.hpp
@@ -2,7 +2,7 @@
// async_result.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,15 +17,12 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
-#if defined(ASIO_HAS_CONCEPTS) \
- && defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- && defined(ASIO_HAS_DECLTYPE)
+#if defined(ASIO_HAS_CONCEPTS)
namespace detail {
@@ -39,8 +36,6 @@ struct is_completion_signature<R(Args...)> : true_type
{
};
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
template <typename R, typename... Args>
struct is_completion_signature<R(Args...) &> : true_type
{
@@ -69,7 +64,6 @@ struct is_completion_signature<R(Args...) && noexcept> : true_type
};
# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
template <typename... T>
struct are_completion_signatures : false_type
@@ -103,21 +97,19 @@ struct is_completion_handler_for : false_type
template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...)>
- : integral_constant<bool, (callable_with<T, Args...>)>
+ : integral_constant<bool, (callable_with<decay_t<T>, Args...>)>
{
};
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) &>
- : integral_constant<bool, (callable_with<T&, Args...>)>
+ : integral_constant<bool, (callable_with<decay_t<T>&, Args...>)>
{
};
template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) &&>
- : integral_constant<bool, (callable_with<T&&, Args...>)>
+ : integral_constant<bool, (callable_with<decay_t<T>&&, Args...>)>
{
};
@@ -125,24 +117,23 @@ struct is_completion_handler_for<T, R(Args...) &&>
template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) noexcept>
- : integral_constant<bool, (callable_with<T, Args...>)>
+ : integral_constant<bool, (callable_with<decay_t<T>, Args...>)>
{
};
template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) & noexcept>
- : integral_constant<bool, (callable_with<T&, Args...>)>
+ : integral_constant<bool, (callable_with<decay_t<T>&, Args...>)>
{
};
template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) && noexcept>
- : integral_constant<bool, (callable_with<T&&, Args...>)>
+ : integral_constant<bool, (callable_with<decay_t<T>&&, Args...>)>
{
};
# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
template <typename T, typename Signature0, typename... SignatureN>
struct is_completion_handler_for<T, Signature0, SignatureN...>
@@ -174,8 +165,6 @@ ASIO_CONCEPT completion_handler_for =
::asio::completion_handler_for<sig0, sig1, sig2>
#else // defined(ASIO_HAS_CONCEPTS)
- // && defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // && defined(ASIO_HAS_DECLTYPE)
#define ASIO_COMPLETION_SIGNATURE typename
#define ASIO_COMPLETION_HANDLER_FOR(sig) typename
@@ -183,271 +172,130 @@ ASIO_CONCEPT completion_handler_for =
#define ASIO_COMPLETION_HANDLER_FOR3(sig0, sig1, sig2) typename
#endif // defined(ASIO_HAS_CONCEPTS)
- // && defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // && defined(ASIO_HAS_DECLTYPE)
namespace detail {
template <typename T>
-struct is_simple_completion_signature : false_type
+struct is_lvalue_completion_signature : false_type
{
};
-template <typename T>
-struct simple_completion_signature;
+template <typename R, typename... Args>
+struct is_lvalue_completion_signature<R(Args...) &> : true_type
+{
+};
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
+# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
template <typename R, typename... Args>
-struct is_simple_completion_signature<R(Args...)> : true_type
+struct is_lvalue_completion_signature<R(Args...) & noexcept> : true_type
{
};
+# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
+
template <typename... Signatures>
-struct are_simple_completion_signatures : false_type
+struct are_any_lvalue_completion_signatures : false_type
{
};
template <typename Sig0>
-struct are_simple_completion_signatures<Sig0>
- : is_simple_completion_signature<Sig0>
+struct are_any_lvalue_completion_signatures<Sig0>
+ : is_lvalue_completion_signature<Sig0>
{
};
template <typename Sig0, typename... SigN>
-struct are_simple_completion_signatures<Sig0, SigN...>
+struct are_any_lvalue_completion_signatures<Sig0, SigN...>
: integral_constant<bool, (
- is_simple_completion_signature<Sig0>::value
- && are_simple_completion_signatures<SigN...>::value)>
+ is_lvalue_completion_signature<Sig0>::value
+ || are_any_lvalue_completion_signatures<SigN...>::value)>
{
};
-template <typename R, typename... Args>
-struct simple_completion_signature<R(Args...)>
-{
- typedef R type(Args...);
-};
-
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-template <typename R, typename... Args>
-struct simple_completion_signature<R(Args...) &>
+template <typename T>
+struct is_rvalue_completion_signature : false_type
{
- typedef R type(Args...);
};
template <typename R, typename... Args>
-struct simple_completion_signature<R(Args...) &&>
+struct is_rvalue_completion_signature<R(Args...) &&> : true_type
{
- typedef R type(Args...);
};
# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
template <typename R, typename... Args>
-struct simple_completion_signature<R(Args...) noexcept>
-{
- typedef R type(Args...);
-};
-
-template <typename R, typename... Args>
-struct simple_completion_signature<R(Args...) & noexcept>
+struct is_rvalue_completion_signature<R(Args...) && noexcept> : true_type
{
- typedef R type(Args...);
-};
-
-template <typename R, typename... Args>
-struct simple_completion_signature<R(Args...) && noexcept>
-{
- typedef R type(Args...);
};
# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename R>
-struct is_simple_completion_signature<R()> : true_type
-{
-};
-
-#define ASIO_PRIVATE_SIMPLE_SIG_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct is_simple_completion_signature<R(ASIO_VARIADIC_TARGS(n))> \
- : true_type \
- { \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SIMPLE_SIG_DEF)
-#undef ASIO_PRIVATE_SIMPLE_SIG_DEF
-
-template <typename Sig0 = void, typename Sig1 = void,
- typename Sig2 = void, typename = void>
-struct are_simple_completion_signatures : false_type
+template <typename... Signatures>
+struct are_any_rvalue_completion_signatures : false_type
{
};
template <typename Sig0>
-struct are_simple_completion_signatures<Sig0>
- : is_simple_completion_signature<Sig0>
+struct are_any_rvalue_completion_signatures<Sig0>
+ : is_rvalue_completion_signature<Sig0>
{
};
-template <typename Sig0, typename Sig1>
-struct are_simple_completion_signatures<Sig0, Sig1>
- : integral_constant<bool,
- (is_simple_completion_signature<Sig0>::value
- && is_simple_completion_signature<Sig1>::value)>
+template <typename Sig0, typename... SigN>
+struct are_any_rvalue_completion_signatures<Sig0, SigN...>
+ : integral_constant<bool, (
+ is_rvalue_completion_signature<Sig0>::value
+ || are_any_rvalue_completion_signatures<SigN...>::value)>
{
};
-template <typename Sig0, typename Sig1, typename Sig2>
-struct are_simple_completion_signatures<Sig0, Sig1, Sig2>
- : integral_constant<bool,
- (is_simple_completion_signature<Sig0>::value
- && is_simple_completion_signature<Sig1>::value
- && is_simple_completion_signature<Sig2>::value)>
-{
-};
+template <typename T>
+struct simple_completion_signature;
-template <typename R>
-struct simple_completion_signature<R()>
+template <typename R, typename... Args>
+struct simple_completion_signature<R(Args...)>
{
- typedef R type();
+ typedef R type(Args...);
};
-#define ASIO_PRIVATE_SIMPLE_SIG_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct simple_completion_signature<R(ASIO_VARIADIC_TARGS(n))> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)); \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SIMPLE_SIG_DEF)
-#undef ASIO_PRIVATE_SIMPLE_SIG_DEF
-
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-template <typename R>
-struct simple_completion_signature<R() &>
+template <typename R, typename... Args>
+struct simple_completion_signature<R(Args...) &>
{
- typedef R type();
+ typedef R type(Args...);
};
-template <typename R>
-struct simple_completion_signature<R() &&>
+template <typename R, typename... Args>
+struct simple_completion_signature<R(Args...) &&>
{
- typedef R type();
+ typedef R type(Args...);
};
-#define ASIO_PRIVATE_SIMPLE_SIG_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct simple_completion_signature< \
- R(ASIO_VARIADIC_TARGS(n)) &> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)); \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct simple_completion_signature< \
- R(ASIO_VARIADIC_TARGS(n)) &&> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)); \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SIMPLE_SIG_DEF)
-#undef ASIO_PRIVATE_SIMPLE_SIG_DEF
-
# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-template <typename R>
-struct simple_completion_signature<R() noexcept>
+template <typename R, typename... Args>
+struct simple_completion_signature<R(Args...) noexcept>
{
- typedef R type();
+ typedef R type(Args...);
};
-template <typename R>
-struct simple_completion_signature<R() & noexcept>
+template <typename R, typename... Args>
+struct simple_completion_signature<R(Args...) & noexcept>
{
- typedef R type();
+ typedef R type(Args...);
};
-template <typename R>
-struct simple_completion_signature<R() && noexcept>
+template <typename R, typename... Args>
+struct simple_completion_signature<R(Args...) && noexcept>
{
- typedef R type();
+ typedef R type(Args...);
};
-#define ASIO_PRIVATE_SIMPLE_SIG_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct simple_completion_signature< \
- R(ASIO_VARIADIC_TARGS(n)) noexcept> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)); \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct simple_completion_signature< \
- R(ASIO_VARIADIC_TARGS(n)) & noexcept> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)); \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct simple_completion_signature< \
- R(ASIO_VARIADIC_TARGS(n)) && noexcept> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)); \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SIMPLE_SIG_DEF)
-#undef ASIO_PRIVATE_SIMPLE_SIG_DEF
-
# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
-
-# define ASIO_COMPLETION_SIGNATURES_TPARAMS \
- ASIO_COMPLETION_SIGNATURE... Signatures
-# define ASIO_COMPLETION_SIGNATURES_TSPECPARAMS \
- ASIO_COMPLETION_SIGNATURE... Signatures
-
-# define ASIO_COMPLETION_SIGNATURES_TARGS Signatures...
-
-# define ASIO_COMPLETION_SIGNATURES_TSIMPLEARGS \
- typename asio::detail::simple_completion_signature< \
- Signatures>::type...
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
-# define ASIO_COMPLETION_SIGNATURES_TPARAMS \
- typename Sig0 = void, \
- typename Sig1 = void, \
- typename Sig2 = void
-
-# define ASIO_COMPLETION_SIGNATURES_TSPECPARAMS \
- typename Sig0, \
- typename Sig1, \
- typename Sig2
-
-# define ASIO_COMPLETION_SIGNATURES_TARGS Sig0, Sig1, Sig2
-
-# define ASIO_COMPLETION_SIGNATURES_TSIMPLEARGS \
- typename ::asio::detail::simple_completion_signature<Sig0>::type, \
- typename ::asio::detail::simple_completion_signature<Sig1>::type, \
- typename ::asio::detail::simple_completion_signature<Sig2>::type
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
-template <typename CompletionToken, ASIO_COMPLETION_SIGNATURES_TPARAMS>
+template <typename CompletionToken,
+ ASIO_COMPLETION_SIGNATURE... Signatures>
class completion_handler_async_result
{
public:
@@ -462,56 +310,22 @@ public:
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Initiation,
ASIO_COMPLETION_HANDLER_FOR(Signatures...) RawCompletionToken,
typename... Args>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
+ static return_type initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
{
- ASIO_MOVE_CAST(Initiation)(initiation)(
- ASIO_MOVE_CAST(RawCompletionToken)(token),
- ASIO_MOVE_CAST(Args)(args)...);
+ static_cast<Initiation&&>(initiation)(
+ static_cast<RawCompletionToken&&>(token),
+ static_cast<Args&&>(args)...);
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Initiation, typename RawCompletionToken>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token)
- {
- ASIO_MOVE_CAST(Initiation)(initiation)(
- ASIO_MOVE_CAST(RawCompletionToken)(token));
- }
-
-#define ASIO_PRIVATE_INITIATE_DEF(n) \
- template <typename Initiation, \
- typename RawCompletionToken, \
- ASIO_VARIADIC_TPARAMS(n)> \
- static return_type initiate( \
- ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_MOVE_ARG(RawCompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- ASIO_MOVE_CAST(Initiation)(initiation)( \
- ASIO_MOVE_CAST(RawCompletionToken)(token), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF)
-#undef ASIO_PRIVATE_INITIATE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
private:
completion_handler_async_result(
- const completion_handler_async_result&) ASIO_DELETED;
+ const completion_handler_async_result&) = delete;
completion_handler_async_result& operator=(
- const completion_handler_async_result&) ASIO_DELETED;
+ const completion_handler_async_result&) = delete;
};
} // namespace detail
@@ -536,7 +350,8 @@ private:
* The primary template assumes that the CompletionToken is the completion
* handler.
*/
-template <typename CompletionToken, ASIO_COMPLETION_SIGNATURES_TPARAMS>
+template <typename CompletionToken,
+ ASIO_COMPLETION_SIGNATURE... Signatures>
class async_result
{
public:
@@ -561,70 +376,46 @@ public:
/// obtain the value to be returned from the initiating function.
template <typename Initiation, typename RawCompletionToken, typename... Args>
static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token,
- ASIO_MOVE_ARG(Args)... args);
+ Initiation&& initiation,
+ RawCompletionToken&& token,
+ Args&&... args);
private:
- async_result(const async_result&) ASIO_DELETED;
- async_result& operator=(const async_result&) ASIO_DELETED;
+ async_result(const async_result&) = delete;
+ async_result& operator=(const async_result&) = delete;
};
#else // defined(GENERATING_DOCUMENTATION)
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-template <typename CompletionToken, ASIO_COMPLETION_SIGNATURES_TPARAMS>
+template <typename CompletionToken,
+ ASIO_COMPLETION_SIGNATURE... Signatures>
class async_result :
- public conditional<
- detail::are_simple_completion_signatures<
- ASIO_COMPLETION_SIGNATURES_TARGS>::value,
- detail::completion_handler_async_result<
- CompletionToken, ASIO_COMPLETION_SIGNATURES_TARGS>,
+ public conditional_t<
+ detail::are_any_lvalue_completion_signatures<Signatures...>::value
+ || !detail::are_any_rvalue_completion_signatures<Signatures...>::value,
+ detail::completion_handler_async_result<CompletionToken, Signatures...>,
async_result<CompletionToken,
- ASIO_COMPLETION_SIGNATURES_TSIMPLEARGS>
- >::type
+ typename detail::simple_completion_signature<Signatures>::type...>
+ >
{
public:
- typedef typename conditional<
- detail::are_simple_completion_signatures<
- ASIO_COMPLETION_SIGNATURES_TARGS>::value,
- detail::completion_handler_async_result<
- CompletionToken, ASIO_COMPLETION_SIGNATURES_TARGS>,
+ typedef conditional_t<
+ detail::are_any_lvalue_completion_signatures<Signatures...>::value
+ || !detail::are_any_rvalue_completion_signatures<Signatures...>::value,
+ detail::completion_handler_async_result<CompletionToken, Signatures...>,
async_result<CompletionToken,
- ASIO_COMPLETION_SIGNATURES_TSIMPLEARGS>
- >::type base_type;
+ typename detail::simple_completion_signature<Signatures>::type...>
+ > base_type;
using base_type::base_type;
private:
- async_result(const async_result&) ASIO_DELETED;
- async_result& operator=(const async_result&) ASIO_DELETED;
-};
-
-#else // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-template <typename CompletionToken, ASIO_COMPLETION_SIGNATURES_TPARAMS>
-class async_result :
- public detail::completion_handler_async_result<
- CompletionToken, ASIO_COMPLETION_SIGNATURES_TARGS>
-{
-public:
- explicit async_result(CompletionToken& h)
- : detail::completion_handler_async_result<
- CompletionToken, ASIO_COMPLETION_SIGNATURES_TARGS>(h)
- {
- }
-
-private:
- async_result(const async_result&) ASIO_DELETED;
- async_result& operator=(const async_result&) ASIO_DELETED;
+ async_result(const async_result&) = delete;
+ async_result& operator=(const async_result&) = delete;
};
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-template <ASIO_COMPLETION_SIGNATURES_TSPECPARAMS>
-class async_result<void, ASIO_COMPLETION_SIGNATURES_TARGS>
+template <ASIO_COMPLETION_SIGNATURE... Signatures>
+class async_result<void, Signatures...>
{
// Empty.
};
@@ -634,65 +425,39 @@ class async_result<void, ASIO_COMPLETION_SIGNATURES_TARGS>
/// Helper template to deduce the handler type from a CompletionToken, capture
/// a local copy of the handler, and then create an async_result for the
/// handler.
-template <typename CompletionToken, ASIO_COMPLETION_SIGNATURES_TPARAMS>
+template <typename CompletionToken,
+ ASIO_COMPLETION_SIGNATURE... Signatures>
struct async_completion
{
/// The real handler type to be used for the asynchronous operation.
typedef typename asio::async_result<
- typename decay<CompletionToken>::type,
- ASIO_COMPLETION_SIGNATURES_TARGS>::completion_handler_type
- completion_handler_type;
+ decay_t<CompletionToken>, Signatures...>::completion_handler_type
+ completion_handler_type;
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Constructor.
/**
* The constructor creates the concrete completion handler and makes the link
* between the handler and the asynchronous result.
*/
explicit async_completion(CompletionToken& token)
- : completion_handler(static_cast<typename conditional<
+ : completion_handler(static_cast<conditional_t<
is_same<CompletionToken, completion_handler_type>::value,
- completion_handler_type&, CompletionToken&&>::type>(token)),
- result(completion_handler)
- {
- }
-#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
- explicit async_completion(typename decay<CompletionToken>::type& token)
- : completion_handler(token),
+ completion_handler_type&, CompletionToken&&>>(token)),
result(completion_handler)
{
}
- explicit async_completion(const typename decay<CompletionToken>::type& token)
- : completion_handler(token),
- result(completion_handler)
- {
- }
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
/// A copy of, or reference to, a real handler object.
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
- typename conditional<
+ conditional_t<
is_same<CompletionToken, completion_handler_type>::value,
- completion_handler_type&, completion_handler_type>::type completion_handler;
-#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
- completion_handler_type completion_handler;
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+ completion_handler_type&, completion_handler_type> completion_handler;
/// The result of the asynchronous operation's initiating function.
- async_result<typename decay<CompletionToken>::type,
- ASIO_COMPLETION_SIGNATURES_TARGS> result;
+ async_result<decay_t<CompletionToken>, Signatures...> result;
};
namespace detail {
-template <typename CompletionToken, ASIO_COMPLETION_SIGNATURES_TPARAMS>
-struct async_result_helper
- : async_result<typename decay<CompletionToken>::type,
- ASIO_COMPLETION_SIGNATURES_TARGS>
-{
-};
-
struct async_result_memfns_base
{
void initiate();
@@ -718,11 +483,11 @@ char async_result_initiate_memfn_helper(
void (async_result_memfns_base::*)(),
&async_result_memfns_derived<T>::initiate>*);
-template <typename CompletionToken, ASIO_COMPLETION_SIGNATURES_TPARAMS>
+template <typename CompletionToken,
+ ASIO_COMPLETION_SIGNATURE... Signatures>
struct async_result_has_initiate_memfn
: integral_constant<bool, sizeof(async_result_initiate_memfn_helper<
- async_result<typename decay<CompletionToken>::type,
- ASIO_COMPLETION_SIGNATURES_TARGS>
+ async_result<decay_t<CompletionToken>, Signatures...>
>(0)) != 1>
{
};
@@ -736,25 +501,6 @@ struct async_result_has_initiate_memfn
void_or_deduced
# define ASIO_INITFN_RESULT_TYPE3(ct, sig0, sig1, sig2) \
void_or_deduced
-#elif defined(_MSC_VER) && (_MSC_VER < 1500)
-# define ASIO_INITFN_RESULT_TYPE(ct, sig) \
- typename ::asio::detail::async_result_helper< \
- ct, sig>::return_type
-# define ASIO_INITFN_RESULT_TYPE2(ct, sig0, sig1) \
- typename ::asio::detail::async_result_helper< \
- ct, sig0, sig1>::return_type
-# define ASIO_INITFN_RESULT_TYPE3(ct, sig0, sig1, sig2) \
- typename ::asio::detail::async_result_helper< \
- ct, sig0, sig1, sig2>::return_type
-#define ASIO_HANDLER_TYPE(ct, sig) \
- typename ::asio::detail::async_result_helper< \
- ct, sig>::completion_handler_type
-#define ASIO_HANDLER_TYPE2(ct, sig0, sig1) \
- typename ::asio::detail::async_result_helper< \
- ct, sig0, sig1>::completion_handler_type
-#define ASIO_HANDLER_TYPE3(ct, sig0, sig1, sig2) \
- typename ::asio::detail::async_result_helper< \
- ct, sig0, sig1, sig2>::completion_handler_type
#else
# define ASIO_INITFN_RESULT_TYPE(ct, sig) \
typename ::asio::async_result< \
@@ -802,26 +548,45 @@ struct async_result_has_initiate_memfn
#endif
#if defined(GENERATING_DOCUMENTATION)
+# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(ct, sig) \
+ auto
+# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX2(ct, sig0, sig1) \
+ auto
+# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX3(ct, sig0, sig1, sig2) \
+ auto
+# define ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX(expr)
+#elif defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
+# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(ct, sig) \
+ auto
+# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX2(ct, sig0, sig1) \
+ auto
+# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX3(ct, sig0, sig1, sig2) \
+ auto
+# define ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX(expr)
+#else
+# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(ct, sig) \
+ auto
+# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX2(ct, sig0, sig1) \
+ auto
+# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX3(ct, sig0, sig1, sig2) \
+ auto
+# define ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX(expr) -> decltype expr
+#endif
+
+#if defined(GENERATING_DOCUMENTATION)
# define ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \
void_or_deduced
# define ASIO_INITFN_DEDUCED_RESULT_TYPE2(ct, sig0, sig1, expr) \
void_or_deduced
# define ASIO_INITFN_DEDUCED_RESULT_TYPE3(ct, sig0, sig1, sig2, expr) \
void_or_deduced
-#elif defined(ASIO_HAS_DECLTYPE)
+#else
# define ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \
decltype expr
# define ASIO_INITFN_DEDUCED_RESULT_TYPE2(ct, sig0, sig1, expr) \
decltype expr
# define ASIO_INITFN_DEDUCED_RESULT_TYPE3(ct, sig0, sig1, sig2, expr) \
decltype expr
-#else
-# define ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \
- ASIO_INITFN_RESULT_TYPE(ct, sig)
-# define ASIO_INITFN_DEDUCED_RESULT_TYPE2(ct, sig0, sig1, expr) \
- ASIO_INITFN_RESULT_TYPE2(ct, sig0, sig1)
-# define ASIO_INITFN_DEDUCED_RESULT_TYPE3(ct, sig0, sig1, sig2, expr) \
- ASIO_INITFN_RESULT_TYPE3(ct, sig0, sig1, sig2)
#endif
#if defined(GENERATING_DOCUMENTATION)
@@ -830,326 +595,57 @@ template <typename CompletionToken,
completion_signature... Signatures,
typename Initiation, typename... Args>
void_or_deduced async_initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken),
- ASIO_MOVE_ARG(Args)... args);
+ Initiation&& initiation,
+ type_identity_t<CompletionToken>& token,
+ Args&&... args);
-#elif defined(ASIO_HAS_VARIADIC_TEMPLATES)
+#else // defined(GENERATING_DOCUMENTATION)
template <typename CompletionToken,
ASIO_COMPLETION_SIGNATURE... Signatures,
typename Initiation, typename... Args>
-inline typename constraint<
+inline auto async_initiate(Initiation&& initiation,
+ type_identity_t<CompletionToken>& token, Args&&... args)
+ -> constraint_t<
detail::async_result_has_initiate_memfn<
CompletionToken, Signatures...>::value,
- ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signatures...,
- (async_result<typename decay<CompletionToken>::type,
- Signatures...>::initiate(declval<ASIO_MOVE_ARG(Initiation)>(),
- declval<ASIO_MOVE_ARG(CompletionToken)>(),
- declval<ASIO_MOVE_ARG(Args)>()...)))>::type
-async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
-{
- return async_result<typename decay<CompletionToken>::type,
- Signatures...>::initiate(ASIO_MOVE_CAST(Initiation)(initiation),
- ASIO_MOVE_CAST(CompletionToken)(token),
- ASIO_MOVE_CAST(Args)(args)...);
+ decltype(
+ async_result<decay_t<CompletionToken>, Signatures...>::initiate(
+ static_cast<Initiation&&>(initiation),
+ static_cast<CompletionToken&&>(token),
+ static_cast<Args&&>(args)...))>
+{
+ return async_result<decay_t<CompletionToken>, Signatures...>::initiate(
+ static_cast<Initiation&&>(initiation),
+ static_cast<CompletionToken&&>(token),
+ static_cast<Args&&>(args)...);
}
template <typename CompletionToken,
ASIO_COMPLETION_SIGNATURE... Signatures,
typename Initiation, typename... Args>
-inline typename constraint<
+inline constraint_t<
!detail::async_result_has_initiate_memfn<
CompletionToken, Signatures...>::value,
- ASIO_INITFN_RESULT_TYPE(CompletionToken, Signatures...)>::type
-async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
+ typename async_result<decay_t<CompletionToken>, Signatures...>::return_type>
+async_initiate(Initiation&& initiation,
+ type_identity_t<CompletionToken>& token, Args&&... args)
{
async_completion<CompletionToken, Signatures...> completion(token);
- ASIO_MOVE_CAST(Initiation)(initiation)(
- ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(CompletionToken,
- Signatures...))(completion.completion_handler),
- ASIO_MOVE_CAST(Args)(args)...);
+ static_cast<Initiation&&>(initiation)(
+ static_cast<
+ typename async_result<decay_t<CompletionToken>,
+ Signatures...>::completion_handler_type&&>(
+ completion.completion_handler),
+ static_cast<Args&&>(args)...);
return completion.result.get();
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename CompletionToken,
- ASIO_COMPLETION_SIGNATURE Sig0,
- typename Initiation>
-inline typename constraint<
- detail::async_result_has_initiate_memfn<
- CompletionToken, Sig0>::value,
- ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Sig0,
- (async_result<typename decay<CompletionToken>::type,
- Sig0>::initiate(declval<ASIO_MOVE_ARG(Initiation)>(),
- declval<ASIO_MOVE_ARG(CompletionToken)>())))>::type
-async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token)
-{
- return async_result<typename decay<CompletionToken>::type,
- Sig0>::initiate(ASIO_MOVE_CAST(Initiation)(initiation),
- ASIO_MOVE_CAST(CompletionToken)(token));
-}
-
-template <typename CompletionToken,
- ASIO_COMPLETION_SIGNATURE Sig0,
- ASIO_COMPLETION_SIGNATURE Sig1,
- typename Initiation>
-inline typename constraint<
- detail::async_result_has_initiate_memfn<
- CompletionToken, Sig0, Sig1>::value,
- ASIO_INITFN_DEDUCED_RESULT_TYPE2(CompletionToken, Sig0, Sig1,
- (async_result<typename decay<CompletionToken>::type,
- Sig0, Sig1>::initiate(declval<ASIO_MOVE_ARG(Initiation)>(),
- declval<ASIO_MOVE_ARG(CompletionToken)>())))>::type
-async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token)
-{
- return async_result<typename decay<CompletionToken>::type,
- Sig0, Sig1>::initiate(ASIO_MOVE_CAST(Initiation)(initiation),
- ASIO_MOVE_CAST(CompletionToken)(token));
-}
-
-template <typename CompletionToken,
- ASIO_COMPLETION_SIGNATURE Sig0,
- ASIO_COMPLETION_SIGNATURE Sig1,
- ASIO_COMPLETION_SIGNATURE Sig2,
- typename Initiation>
-inline typename constraint<
- detail::async_result_has_initiate_memfn<
- CompletionToken, Sig0, Sig1, Sig2>::value,
- ASIO_INITFN_DEDUCED_RESULT_TYPE3(CompletionToken, Sig0, Sig1, Sig2,
- (async_result<typename decay<CompletionToken>::type,
- Sig0, Sig1, Sig2>::initiate(declval<ASIO_MOVE_ARG(Initiation)>(),
- declval<ASIO_MOVE_ARG(CompletionToken)>())))>::type
-async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token)
-{
- return async_result<typename decay<CompletionToken>::type,
- Sig0, Sig1, Sig2>::initiate(ASIO_MOVE_CAST(Initiation)(initiation),
- ASIO_MOVE_CAST(CompletionToken)(token));
-}
-
-template <typename CompletionToken,
- ASIO_COMPLETION_SIGNATURE Sig0,
- typename Initiation>
-inline typename constraint<
- !detail::async_result_has_initiate_memfn<
- CompletionToken, Sig0>::value,
- ASIO_INITFN_RESULT_TYPE(CompletionToken, Sig0)>::type
-async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token)
-{
- async_completion<CompletionToken, Sig0> completion(token);
-
- ASIO_MOVE_CAST(Initiation)(initiation)(
- ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(CompletionToken,
- Sig0))(completion.completion_handler));
-
- return completion.result.get();
-}
-
-template <typename CompletionToken,
- ASIO_COMPLETION_SIGNATURE Sig0,
- ASIO_COMPLETION_SIGNATURE Sig1,
- typename Initiation>
-inline typename constraint<
- !detail::async_result_has_initiate_memfn<
- CompletionToken, Sig0, Sig1>::value,
- ASIO_INITFN_RESULT_TYPE2(CompletionToken, Sig0, Sig1)>::type
-async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token)
-{
- async_completion<CompletionToken, Sig0, Sig1> completion(token);
-
- ASIO_MOVE_CAST(Initiation)(initiation)(
- ASIO_MOVE_CAST(ASIO_HANDLER_TYPE2(CompletionToken,
- Sig0, Sig1))(completion.completion_handler));
-
- return completion.result.get();
-}
-
-template <typename CompletionToken,
- ASIO_COMPLETION_SIGNATURE Sig0,
- ASIO_COMPLETION_SIGNATURE Sig1,
- ASIO_COMPLETION_SIGNATURE Sig2,
- typename Initiation>
-inline typename constraint<
- !detail::async_result_has_initiate_memfn<
- CompletionToken, Sig0, Sig1, Sig2>::value,
- ASIO_INITFN_RESULT_TYPE3(CompletionToken, Sig0, Sig1, Sig2)>::type
-async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token)
-{
- async_completion<CompletionToken, Sig0, Sig1, Sig2> completion(token);
-
- ASIO_MOVE_CAST(Initiation)(initiation)(
- ASIO_MOVE_CAST(ASIO_HANDLER_TYPE3(CompletionToken,
- Sig0, Sig1, Sig2))(completion.completion_handler));
-
- return completion.result.get();
-}
+#endif // defined(GENERATING_DOCUMENTATION)
-#define ASIO_PRIVATE_INITIATE_DEF(n) \
- template <typename CompletionToken, \
- ASIO_COMPLETION_SIGNATURE Sig0, \
- typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
- inline typename constraint< \
- detail::async_result_has_initiate_memfn< \
- CompletionToken, Sig0>::value, \
- ASIO_INITFN_DEDUCED_RESULT_TYPE( \
- CompletionToken, Sig0, \
- (async_result<typename decay<CompletionToken>::type, \
- Sig0>::initiate( \
- declval<ASIO_MOVE_ARG(Initiation)>(), \
- declval<ASIO_MOVE_ARG(CompletionToken)>(), \
- ASIO_VARIADIC_MOVE_DECLVAL(n))))>::type \
- async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return async_result<typename decay<CompletionToken>::type, \
- Sig0>::initiate( \
- ASIO_MOVE_CAST(Initiation)(initiation), \
- ASIO_MOVE_CAST(CompletionToken)(token), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <typename CompletionToken, \
- ASIO_COMPLETION_SIGNATURE Sig0, \
- ASIO_COMPLETION_SIGNATURE Sig1, \
- typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
- inline typename constraint< \
- detail::async_result_has_initiate_memfn< \
- CompletionToken, Sig0, Sig1>::value, \
- ASIO_INITFN_DEDUCED_RESULT_TYPE2( \
- CompletionToken, Sig0, Sig1, \
- (async_result<typename decay<CompletionToken>::type, \
- Sig0, Sig1>::initiate( \
- declval<ASIO_MOVE_ARG(Initiation)>(), \
- declval<ASIO_MOVE_ARG(CompletionToken)>(), \
- ASIO_VARIADIC_MOVE_DECLVAL(n))))>::type \
- async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return async_result<typename decay<CompletionToken>::type, \
- Sig0, Sig1>::initiate( \
- ASIO_MOVE_CAST(Initiation)(initiation), \
- ASIO_MOVE_CAST(CompletionToken)(token), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <typename CompletionToken, \
- ASIO_COMPLETION_SIGNATURE Sig0, \
- ASIO_COMPLETION_SIGNATURE Sig1, \
- ASIO_COMPLETION_SIGNATURE Sig2, \
- typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
- inline typename constraint< \
- detail::async_result_has_initiate_memfn< \
- CompletionToken, Sig0, Sig1, Sig2>::value, \
- ASIO_INITFN_DEDUCED_RESULT_TYPE3( \
- CompletionToken, Sig0, Sig1, Sig2, \
- (async_result<typename decay<CompletionToken>::type, \
- Sig0, Sig1, Sig2>::initiate( \
- declval<ASIO_MOVE_ARG(Initiation)>(), \
- declval<ASIO_MOVE_ARG(CompletionToken)>(), \
- ASIO_VARIADIC_MOVE_DECLVAL(n))))>::type \
- async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return async_result<typename decay<CompletionToken>::type, \
- Sig0, Sig1, Sig2>::initiate( \
- ASIO_MOVE_CAST(Initiation)(initiation), \
- ASIO_MOVE_CAST(CompletionToken)(token), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <typename CompletionToken, \
- ASIO_COMPLETION_SIGNATURE Sig0, \
- typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
- inline typename constraint< \
- !detail::async_result_has_initiate_memfn< \
- CompletionToken, Sig0>::value, \
- ASIO_INITFN_RESULT_TYPE(CompletionToken, Sig0)>::type \
- async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- async_completion<CompletionToken, \
- Sig0> completion(token); \
- \
- ASIO_MOVE_CAST(Initiation)(initiation)( \
- ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(CompletionToken, \
- Sig0))(completion.completion_handler), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- \
- return completion.result.get(); \
- } \
- \
- template <typename CompletionToken, \
- ASIO_COMPLETION_SIGNATURE Sig0, \
- ASIO_COMPLETION_SIGNATURE Sig1, \
- typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
- inline typename constraint< \
- !detail::async_result_has_initiate_memfn< \
- CompletionToken, Sig0, Sig1>::value, \
- ASIO_INITFN_RESULT_TYPE2(CompletionToken, Sig0, Sig1)>::type \
- async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- async_completion<CompletionToken, \
- Sig0, Sig1> completion(token); \
- \
- ASIO_MOVE_CAST(Initiation)(initiation)( \
- ASIO_MOVE_CAST(ASIO_HANDLER_TYPE2(CompletionToken, \
- Sig0, Sig1))(completion.completion_handler), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- \
- return completion.result.get(); \
- } \
- \
- template <typename CompletionToken, \
- ASIO_COMPLETION_SIGNATURE Sig0, \
- ASIO_COMPLETION_SIGNATURE Sig1, \
- ASIO_COMPLETION_SIGNATURE Sig2, \
- typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
- inline typename constraint< \
- !detail::async_result_has_initiate_memfn< \
- CompletionToken, Sig0, Sig1, Sig2>::value, \
- ASIO_INITFN_RESULT_TYPE3(CompletionToken, Sig0, Sig1, Sig2)>::type \
- async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- async_completion<CompletionToken, \
- Sig0, Sig1, Sig2> completion(token); \
- \
- ASIO_MOVE_CAST(Initiation)(initiation)( \
- ASIO_MOVE_CAST(ASIO_HANDLER_TYPE3(CompletionToken, \
- Sig0, Sig1, Sig2))(completion.completion_handler), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- \
- return completion.result.get(); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF)
-#undef ASIO_PRIVATE_INITIATE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#if defined(ASIO_HAS_CONCEPTS) \
- && defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- && defined(ASIO_HAS_DECLTYPE)
+#if defined(ASIO_HAS_CONCEPTS)
namespace detail {
@@ -1182,16 +678,209 @@ ASIO_CONCEPT completion_token_for =
::asio::completion_token_for<sig0, sig1, sig2>
#else // defined(ASIO_HAS_CONCEPTS)
- // && defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // && defined(ASIO_HAS_DECLTYPE)
#define ASIO_COMPLETION_TOKEN_FOR(sig) typename
#define ASIO_COMPLETION_TOKEN_FOR2(sig0, sig1) typename
#define ASIO_COMPLETION_TOKEN_FOR3(sig0, sig1, sig2) typename
#endif // defined(ASIO_HAS_CONCEPTS)
- // && defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // && defined(ASIO_HAS_DECLTYPE)
+
+namespace detail {
+
+struct async_operation_probe {};
+struct async_operation_probe_result {};
+
+template <typename Call, typename = void>
+struct is_async_operation_call : false_type
+{
+};
+
+template <typename Call>
+struct is_async_operation_call<Call,
+ void_t<
+ enable_if_t<
+ is_same<
+ result_of_t<Call>,
+ async_operation_probe_result
+ >::value
+ >
+ >
+ > : true_type
+{
+};
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename... Signatures>
+class async_result<detail::async_operation_probe, Signatures...>
+{
+public:
+ typedef detail::async_operation_probe_result return_type;
+
+ template <typename Initiation, typename... InitArgs>
+ static return_type initiate(Initiation&&,
+ detail::async_operation_probe, InitArgs&&...)
+ {
+ return return_type();
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+#if defined(GENERATING_DOCUMENTATION)
+
+/// The is_async_operation trait detects whether a type @c T and arguments
+/// @c Args... may be used to initiate an asynchronous operation.
+/**
+ * Class template @c is_async_operation is a trait is derived from @c true_type
+ * if the expression <tt>T(Args..., token)</tt> initiates an asynchronous
+ * operation, where @c token is an unspecified completion token type. Otherwise,
+ * @c is_async_operation is derived from @c false_type.
+ */
+template <typename T, typename... Args>
+struct is_async_operation : integral_constant<bool, automatically_determined>
+{
+};
+
+#else // defined(GENERATING_DOCUMENTATION)
+
+template <typename T, typename... Args>
+struct is_async_operation :
+ detail::is_async_operation_call<
+ T(Args..., detail::async_operation_probe)>
+{
+};
+
+#endif // defined(GENERATING_DOCUMENTATION)
+
+#if defined(ASIO_HAS_CONCEPTS)
+
+template <typename T, typename... Args>
+ASIO_CONCEPT async_operation = is_async_operation<T, Args...>::value;
+
+#define ASIO_ASYNC_OPERATION(t) \
+ ::asio::async_operation<t>
+#define ASIO_ASYNC_OPERATION1(t, a0) \
+ ::asio::async_operation<t, a0>
+#define ASIO_ASYNC_OPERATION2(t, a0, a1) \
+ ::asio::async_operation<t, a0, a1>
+#define ASIO_ASYNC_OPERATION3(t, a0, a1, a2) \
+ ::asio::async_operation<t, a0, a1, a2>
+
+#else // defined(ASIO_HAS_CONCEPTS)
+
+#define ASIO_ASYNC_OPERATION(t) typename
+#define ASIO_ASYNC_OPERATION1(t, a0) typename
+#define ASIO_ASYNC_OPERATION2(t, a0, a1) typename
+#define ASIO_ASYNC_OPERATION3(t, a0, a1, a2) typename
+
+#endif // defined(ASIO_HAS_CONCEPTS)
+
+namespace detail {
+
+struct completion_signature_probe {};
+
+template <typename... T>
+struct completion_signature_probe_result
+{
+ template <template <typename...> class Op>
+ struct apply
+ {
+ typedef Op<T...> type;
+ };
+};
+
+template <typename T>
+struct completion_signature_probe_result<T>
+{
+ typedef T type;
+
+ template <template <typename...> class Op>
+ struct apply
+ {
+ typedef Op<T> type;
+ };
+};
+
+template <>
+struct completion_signature_probe_result<void>
+{
+ template <template <typename...> class Op>
+ struct apply
+ {
+ typedef Op<> type;
+ };
+};
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename... Signatures>
+class async_result<detail::completion_signature_probe, Signatures...>
+{
+public:
+ typedef detail::completion_signature_probe_result<Signatures...> return_type;
+
+ template <typename Initiation, typename... InitArgs>
+ static return_type initiate(Initiation&&,
+ detail::completion_signature_probe, InitArgs&&...)
+ {
+ return return_type();
+ }
+};
+
+template <typename Signature>
+class async_result<detail::completion_signature_probe, Signature>
+{
+public:
+ typedef detail::completion_signature_probe_result<Signature> return_type;
+
+ template <typename Initiation, typename... InitArgs>
+ static return_type initiate(Initiation&&,
+ detail::completion_signature_probe, InitArgs&&...)
+ {
+ return return_type();
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+#if defined(GENERATING_DOCUMENTATION)
+
+/// The completion_signature_of trait determines the completion signature
+/// of an asynchronous operation.
+/**
+ * Class template @c completion_signature_of is a trait with a member type
+ * alias @c type that denotes the completion signature of the asynchronous
+ * operation initiated by the expression <tt>T(Args..., token)</tt> operation,
+ * where @c token is an unspecified completion token type. If the asynchronous
+ * operation does not have exactly one completion signature, the instantion of
+ * the trait is well-formed but the member type alias @c type is omitted. If
+ * the expression <tt>T(Args..., token)</tt> is not an asynchronous operation
+ * then use of the trait is ill-formed.
+ */
+template <typename T, typename... Args>
+struct completion_signature_of
+{
+ typedef automatically_determined type;
+};
+
+#else // defined(GENERATING_DOCUMENTATION)
+
+template <typename T, typename... Args>
+struct completion_signature_of :
+ result_of_t<T(Args..., detail::completion_signature_probe)>
+{
+};
+
+#endif // defined(GENERATING_DOCUMENTATION)
+
+template <typename T, typename... Args>
+using completion_signature_of_t =
+ typename completion_signature_of<T, Args...>::type;
namespace detail {
@@ -1203,7 +892,8 @@ struct default_completion_token_impl
template <typename T>
struct default_completion_token_impl<T,
- typename void_type<typename T::default_completion_token_type>::type>
+ void_t<typename T::default_completion_token_type>
+ >
{
typedef typename T::default_completion_token_type type;
};
@@ -1237,27 +927,14 @@ struct default_completion_token
};
#endif
-#if defined(ASIO_HAS_ALIAS_TEMPLATES)
-
template <typename T>
using default_completion_token_t = typename default_completion_token<T>::type;
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
-
-#if defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
-
#define ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(e) \
= typename ::asio::default_completion_token<e>::type
#define ASIO_DEFAULT_COMPLETION_TOKEN(e) \
= typename ::asio::default_completion_token<e>::type()
-#else // defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
-
-#define ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(e)
-#define ASIO_DEFAULT_COMPLETION_TOKEN(e)
-
-#endif // defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/awaitable.hpp b/3rdparty/asio/include/asio/awaitable.hpp
index b9e8d51df5c..7e4ee7a2f22 100644
--- a/3rdparty/asio/include/asio/awaitable.hpp
+++ b/3rdparty/asio/include/asio/awaitable.hpp
@@ -2,7 +2,7 @@
// awaitable.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -25,6 +25,7 @@
# include <experimental/coroutine>
#endif // defined(ASIO_HAS_STD_COROUTINE)
+#include <utility>
#include "asio/any_io_executor.hpp"
#include "asio/detail/push_options.hpp"
@@ -75,6 +76,14 @@ public:
frame_->destroy();
}
+ /// Move assignment.
+ awaitable& operator=(awaitable&& other) noexcept
+ {
+ if (this != &other)
+ frame_ = std::exchange(other.frame_, nullptr);
+ return *this;
+ }
+
/// Checks if the awaitable refers to a future result.
bool valid() const noexcept
{
diff --git a/3rdparty/asio/include/asio/basic_datagram_socket.hpp b/3rdparty/asio/include/asio/basic_datagram_socket.hpp
index a09dfcdbee8..3d72a38475a 100644
--- a/3rdparty/asio/include/asio/basic_datagram_socket.hpp
+++ b/3rdparty/asio/include/asio/basic_datagram_socket.hpp
@@ -2,7 +2,7 @@
// basic_datagram_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -46,17 +46,23 @@ class basic_datagram_socket;
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*
- * Synchronous @c send, @c send_to, @c receive, @c receive_from, and @c connect
- * operations are thread safe with respect to each other, if the underlying
- * operating system calls are also thread safe. This means that it is permitted
- * to perform concurrent calls to these synchronous operations on a single
- * socket object. Other synchronous operations, such as @c open or @c close, are
- * not thread safe.
+ * Synchronous @c send, @c send_to, @c receive, @c receive_from, @c connect,
+ * and @c shutdown operations are thread safe with respect to each other, if
+ * the underlying operating system calls are also thread safe. This means that
+ * it is permitted to perform concurrent calls to these synchronous operations
+ * on a single socket object. Other synchronous operations, such as @c open or
+ * @c close, are not thread safe.
*/
template <typename Protocol, typename Executor>
class basic_datagram_socket
: public basic_socket<Protocol, Executor>
{
+private:
+ class initiate_async_send;
+ class initiate_async_send_to;
+ class initiate_async_receive;
+ class initiate_async_receive_from;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -107,9 +113,9 @@ public:
*/
template <typename ExecutionContext>
explicit basic_datagram_socket(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context)
{
}
@@ -145,10 +151,10 @@ public:
template <typename ExecutionContext>
basic_datagram_socket(ExecutionContext& context,
const protocol_type& protocol,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: basic_socket<Protocol, Executor>(context, protocol)
{
}
@@ -192,9 +198,9 @@ public:
template <typename ExecutionContext>
basic_datagram_socket(ExecutionContext& context,
const endpoint_type& endpoint,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context, endpoint)
{
}
@@ -237,14 +243,13 @@ public:
template <typename ExecutionContext>
basic_datagram_socket(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_socket,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context, protocol, native_socket)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_datagram_socket from another.
/**
* This constructor moves a datagram socket from one object to another.
@@ -256,7 +261,7 @@ public:
* constructed using the @c basic_datagram_socket(const executor_type&)
* constructor.
*/
- basic_datagram_socket(basic_datagram_socket&& other) ASIO_NOEXCEPT
+ basic_datagram_socket(basic_datagram_socket&& other) noexcept
: basic_socket<Protocol, Executor>(std::move(other))
{
}
@@ -293,10 +298,10 @@ public:
*/
template <typename Protocol1, typename Executor1>
basic_datagram_socket(basic_datagram_socket<Protocol1, Executor1>&& other,
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(std::move(other))
{
}
@@ -315,16 +320,15 @@ public:
* constructor.
*/
template <typename Protocol1, typename Executor1>
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value,
basic_datagram_socket&
- >::type operator=(basic_datagram_socket<Protocol1, Executor1>&& other)
+ > operator=(basic_datagram_socket<Protocol1, Executor1>&& other)
{
basic_socket<Protocol, Executor>::operator=(std::move(other));
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destroys the socket.
/**
@@ -423,25 +427,31 @@ public:
/// Start an asynchronous send on a connected socket.
/**
* This function is used to asynchronously send data on the datagram socket.
- * The function call always returns immediately.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
- * remain valid until the handler is called.
+ * remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes. Potential
+ * completion tokens include @ref use_future, @ref use_awaitable, @ref
+ * yield_context, or a function object with the correct completion signature.
+ * The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The async_send operation can only be used with a connected socket.
* Use the async_send_to function to send data on an unconnected datagram
* socket.
@@ -467,44 +477,51 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send>(), token,
+ buffers, socket_base::message_flags(0)))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send(this), handler,
+ initiate_async_send(this), token,
buffers, socket_base::message_flags(0));
}
/// Start an asynchronous send on a connected socket.
/**
* This function is used to asynchronously send data on the datagram socket.
- * The function call always returns immediately.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
- * remain valid until the handler is called.
+ * remain valid until the completion handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes. Potential
+ * completion tokens include @ref use_future, @ref use_awaitable, @ref
+ * yield_context, or a function object with the correct completion signature.
+ * The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The async_send operation can only be used with a connected socket.
* Use the async_send_to function to send data on an unconnected datagram
* socket.
@@ -521,18 +538,18 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send(const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send(const ConstBufferSequence& buffers,
socket_base::message_flags flags,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send>(), token, buffers, flags))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send(this), handler, buffers, flags);
+ initiate_async_send(this), token, buffers, flags);
}
/// Send a datagram to the specified endpoint.
@@ -626,28 +643,34 @@ public:
/// Start an asynchronous send.
/**
* This function is used to asynchronously send a datagram to the specified
- * remote endpoint. The function call always returns immediately.
+ * remote endpoint. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param destination The remote endpoint to which the data will be sent.
* Copies will be made of the endpoint as required.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes. Potential
+ * completion tokens include @ref use_future, @ref use_awaitable, @ref
+ * yield_context, or a function object with the correct completion signature.
+ * The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
@@ -672,48 +695,55 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send_to(const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send_to>(), token, buffers,
+ destination, socket_base::message_flags(0)))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send_to(this), handler, buffers,
+ initiate_async_send_to(this), token, buffers,
destination, socket_base::message_flags(0));
}
/// Start an asynchronous send.
/**
* This function is used to asynchronously send a datagram to the specified
- * remote endpoint. The function call always returns immediately.
+ * remote endpoint. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param destination The remote endpoint to which the data will be sent.
* Copies will be made of the endpoint as required.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes. Potential
+ * completion tokens include @ref use_future, @ref use_awaitable, @ref
+ * yield_context, or a function object with the correct completion signature.
+ * The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* On POSIX or Windows operating systems, this asynchronous operation supports
* cancellation for the following asio::cancellation_type values:
@@ -726,18 +756,20 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send_to(const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination, socket_base::message_flags flags,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send_to>(), token,
+ buffers, destination, flags))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send_to(this), handler, buffers, destination, flags);
+ initiate_async_send_to(this), token,
+ buffers, destination, flags);
}
/// Receive some data on a connected socket.
@@ -832,25 +864,31 @@ public:
/// Start an asynchronous receive on a connected socket.
/**
* This function is used to asynchronously receive data from the datagram
- * socket. The function call always returns immediately.
+ * socket. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The async_receive operation can only be used with a connected socket.
* Use the async_receive_from function to receive data on an unconnected
* datagram socket.
@@ -877,44 +915,51 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive>(), token,
+ buffers, socket_base::message_flags(0)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive(this), handler,
+ initiate_async_receive(this), token,
buffers, socket_base::message_flags(0));
}
/// Start an asynchronous receive on a connected socket.
/**
* This function is used to asynchronously receive data from the datagram
- * socket. The function call always returns immediately.
+ * socket. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param flags Flags specifying how the receive call is to be made.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The async_receive operation can only be used with a connected socket.
* Use the async_receive_from function to receive data on an unconnected
* datagram socket.
@@ -931,18 +976,18 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive(const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive(const MutableBufferSequence& buffers,
socket_base::message_flags flags,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive>(), token, buffers, flags))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive(this), handler, buffers, flags);
+ initiate_async_receive(this), token, buffers, flags);
}
/// Receive a datagram with the endpoint of the sender.
@@ -1036,31 +1081,37 @@ public:
/// Start an asynchronous receive.
/**
- * This function is used to asynchronously receive a datagram. The function
- * call always returns immediately.
+ * This function is used to asynchronously receive a datagram. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the datagram. Ownership of the sender_endpoint object
* is retained by the caller, which must guarantee that it is valid until the
- * handler is called.
+ * completion handler is called.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
@@ -1082,50 +1133,57 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive_from(const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive_from>(), token, buffers,
+ &sender_endpoint, socket_base::message_flags(0)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive_from(this), handler, buffers,
+ initiate_async_receive_from(this), token, buffers,
&sender_endpoint, socket_base::message_flags(0));
}
/// Start an asynchronous receive.
/**
- * This function is used to asynchronously receive a datagram. The function
- * call always returns immediately.
+ * This function is used to asynchronously receive a datagram. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the datagram. Ownership of the sender_endpoint object
* is retained by the caller, which must guarantee that it is valid until the
- * handler is called.
+ * completion handler is called.
*
* @param flags Flags specifying how the receive call is to be made.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* On POSIX or Windows operating systems, this asynchronous operation supports
* cancellation for the following asio::cancellation_type values:
@@ -1138,26 +1196,27 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive_from(const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint, socket_base::message_flags flags,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive_from>(), token,
+ buffers, &sender_endpoint, flags))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive_from(this), handler,
+ initiate_async_receive_from(this), token,
buffers, &sender_endpoint, flags);
}
private:
// Disallow copying and assignment.
- basic_datagram_socket(const basic_datagram_socket&) ASIO_DELETED;
+ basic_datagram_socket(const basic_datagram_socket&) = delete;
basic_datagram_socket& operator=(
- const basic_datagram_socket&) ASIO_DELETED;
+ const basic_datagram_socket&) = delete;
class initiate_async_send
{
@@ -1169,13 +1228,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers,
socket_base::message_flags flags) const
{
@@ -1203,13 +1262,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers, const endpoint_type& destination,
socket_base::message_flags flags) const
{
@@ -1237,13 +1296,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers,
socket_base::message_flags flags) const
{
@@ -1271,13 +1330,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers, endpoint_type* sender_endpoint,
socket_base::message_flags flags) const
{
diff --git a/3rdparty/asio/include/asio/basic_deadline_timer.hpp b/3rdparty/asio/include/asio/basic_deadline_timer.hpp
index 4d647f888ce..9343591bf8b 100644
--- a/3rdparty/asio/include/asio/basic_deadline_timer.hpp
+++ b/3rdparty/asio/include/asio/basic_deadline_timer.hpp
@@ -2,7 +2,7 @@
// basic_deadline_timer.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -128,6 +128,9 @@ template <typename Time,
typename Executor = any_io_executor>
class basic_deadline_timer
{
+private:
+ class initiate_async_wait;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -175,9 +178,9 @@ public:
*/
template <typename ExecutionContext>
explicit basic_deadline_timer(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
}
@@ -213,9 +216,9 @@ public:
*/
template <typename ExecutionContext>
basic_deadline_timer(ExecutionContext& context, const time_type& expiry_time,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -257,9 +260,9 @@ public:
template <typename ExecutionContext>
basic_deadline_timer(ExecutionContext& context,
const duration_type& expiry_time,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -268,7 +271,6 @@ public:
asio::detail::throw_error(ec, "expires_from_now");
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_deadline_timer from another.
/**
* This constructor moves a timer from one object to another.
@@ -302,7 +304,6 @@ public:
impl_ = std::move(other.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destroys the timer.
/**
@@ -314,7 +315,7 @@ public:
}
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return impl_.get_executor();
}
@@ -607,30 +608,36 @@ public:
/// Start an asynchronous wait on the timer.
/**
* This function may be used to initiate an asynchronous wait against the
- * timer. It always returns immediately.
+ * timer. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
- * For each call to async_wait(), the supplied handler will be called exactly
- * once. The handler will be called when:
+ * For each call to async_wait(), the completion handler will be called
+ * exactly once. The completion handler will be called when:
*
* @li The timer has expired.
*
* @li The timer was cancelled, in which case the handler is passed the error
* code asio::error::operation_aborted.
*
- * @param handler The handler to be called when the timer expires. Copies
- * will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the timer expires. Potential
+ * completion tokens include @ref use_future, @ref use_awaitable, @ref
+ * yield_context, or a function object with the correct completion signature.
+ * The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
+ *
* @par Per-Operation Cancellation
- * On POSIX or Windows operating systems, this asynchronous operation supports
- * cancellation for the following asio::cancellation_type values:
+ * This asynchronous operation supports cancellation for the following
+ * asio::cancellation_type values:
*
* @li @c cancellation_type::terminal
*
@@ -640,22 +647,22 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler,
- void (asio::error_code))
- async_wait(
- ASIO_MOVE_ARG(WaitHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WaitToken = default_completion_token_t<executor_type>>
+ auto async_wait(
+ WaitToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WaitToken, void (asio::error_code)>(
+ declval<initiate_async_wait>(), token))
{
- return async_initiate<WaitHandler, void (asio::error_code)>(
- initiate_async_wait(this), handler);
+ return async_initiate<WaitToken, void (asio::error_code)>(
+ initiate_async_wait(this), token);
}
private:
// Disallow copying and assignment.
- basic_deadline_timer(const basic_deadline_timer&) ASIO_DELETED;
+ basic_deadline_timer(const basic_deadline_timer&) = delete;
basic_deadline_timer& operator=(
- const basic_deadline_timer&) ASIO_DELETED;
+ const basic_deadline_timer&) = delete;
class initiate_async_wait
{
@@ -667,13 +674,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WaitHandler>
- void operator()(ASIO_MOVE_ARG(WaitHandler) handler) const
+ void operator()(WaitHandler&& handler) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WaitHandler.
diff --git a/3rdparty/asio/include/asio/basic_file.hpp b/3rdparty/asio/include/asio/basic_file.hpp
new file mode 100644
index 00000000000..dbdb6d843d0
--- /dev/null
+++ b/3rdparty/asio/include/asio/basic_file.hpp
@@ -0,0 +1,824 @@
+//
+// basic_file.hpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_BASIC_FILE_HPP
+#define ASIO_BASIC_FILE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_FILE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include <string>
+#include <utility>
+#include "asio/any_io_executor.hpp"
+#include "asio/async_result.hpp"
+#include "asio/detail/cstdint.hpp"
+#include "asio/detail/handler_type_requirements.hpp"
+#include "asio/detail/io_object_impl.hpp"
+#include "asio/detail/non_const_lvalue.hpp"
+#include "asio/detail/throw_error.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/error.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/post.hpp"
+#include "asio/file_base.hpp"
+#if defined(ASIO_HAS_IOCP)
+# include "asio/detail/win_iocp_file_service.hpp"
+#elif defined(ASIO_HAS_IO_URING)
+# include "asio/detail/io_uring_file_service.hpp"
+#endif
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+#if !defined(ASIO_BASIC_FILE_FWD_DECL)
+#define ASIO_BASIC_FILE_FWD_DECL
+
+// Forward declaration with defaulted arguments.
+template <typename Executor = any_io_executor>
+class basic_file;
+
+#endif // !defined(ASIO_BASIC_FILE_FWD_DECL)
+
+/// Provides file functionality.
+/**
+ * The basic_file class template provides functionality that is common to both
+ * stream-oriented and random-access files.
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe.@n
+ * @e Shared @e objects: Unsafe.
+ */
+template <typename Executor>
+class basic_file
+ : public file_base
+{
+public:
+ /// The type of the executor associated with the object.
+ typedef Executor executor_type;
+
+ /// Rebinds the file type to another executor.
+ template <typename Executor1>
+ struct rebind_executor
+ {
+ /// The file type when rebound to the specified executor.
+ typedef basic_file<Executor1> other;
+ };
+
+ /// The native representation of a file.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#elif defined(ASIO_HAS_IOCP)
+ typedef detail::win_iocp_file_service::native_handle_type native_handle_type;
+#elif defined(ASIO_HAS_IO_URING)
+ typedef detail::io_uring_file_service::native_handle_type native_handle_type;
+#endif
+
+ /// Construct a basic_file without opening it.
+ /**
+ * This constructor initialises a file without opening it.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ */
+ explicit basic_file(const executor_type& ex)
+ : impl_(0, ex)
+ {
+ }
+
+ /// Construct a basic_file without opening it.
+ /**
+ * This constructor initialises a file without opening it.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ */
+ template <typename ExecutionContext>
+ explicit basic_file(ExecutionContext& context,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(0, 0, context)
+ {
+ }
+
+ /// Construct and open a basic_file.
+ /**
+ * This constructor initialises a file and opens it.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ */
+ explicit basic_file(const executor_type& ex,
+ const char* path, file_base::flags open_flags)
+ : impl_(0, ex)
+ {
+ asio::error_code ec;
+ impl_.get_service().open(impl_.get_implementation(), path, open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Construct a basic_file without opening it.
+ /**
+ * This constructor initialises a file and opens it.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ */
+ template <typename ExecutionContext>
+ explicit basic_file(ExecutionContext& context,
+ const char* path, file_base::flags open_flags,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(0, 0, context)
+ {
+ asio::error_code ec;
+ impl_.get_service().open(impl_.get_implementation(), path, open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Construct and open a basic_file.
+ /**
+ * This constructor initialises a file and opens it.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ */
+ explicit basic_file(const executor_type& ex,
+ const std::string& path, file_base::flags open_flags)
+ : impl_(0, ex)
+ {
+ asio::error_code ec;
+ impl_.get_service().open(impl_.get_implementation(),
+ path.c_str(), open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Construct a basic_file without opening it.
+ /**
+ * This constructor initialises a file and opens it.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ */
+ template <typename ExecutionContext>
+ explicit basic_file(ExecutionContext& context,
+ const std::string& path, file_base::flags open_flags,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(0, 0, context)
+ {
+ asio::error_code ec;
+ impl_.get_service().open(impl_.get_implementation(),
+ path.c_str(), open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Construct a basic_file on an existing native file handle.
+ /**
+ * This constructor initialises a file object to hold an existing native file.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ *
+ * @param native_file A native file handle.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ basic_file(const executor_type& ex, const native_handle_type& native_file)
+ : impl_(0, ex)
+ {
+ asio::error_code ec;
+ impl_.get_service().assign(
+ impl_.get_implementation(), native_file, ec);
+ asio::detail::throw_error(ec, "assign");
+ }
+
+ /// Construct a basic_file on an existing native file.
+ /**
+ * This constructor initialises a file object to hold an existing native file.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ *
+ * @param native_file A native file.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ template <typename ExecutionContext>
+ basic_file(ExecutionContext& context, const native_handle_type& native_file,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(0, 0, context)
+ {
+ asio::error_code ec;
+ impl_.get_service().assign(
+ impl_.get_implementation(), native_file, ec);
+ asio::detail::throw_error(ec, "assign");
+ }
+
+ /// Move-construct a basic_file from another.
+ /**
+ * This constructor moves a file from one object to another.
+ *
+ * @param other The other basic_file object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_file(const executor_type&) constructor.
+ */
+ basic_file(basic_file&& other) noexcept
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign a basic_file from another.
+ /**
+ * This assignment operator moves a file from one object to another.
+ *
+ * @param other The other basic_file object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_file(const executor_type&) constructor.
+ */
+ basic_file& operator=(basic_file&& other)
+ {
+ impl_ = std::move(other.impl_);
+ return *this;
+ }
+
+ // All files have access to each other's implementations.
+ template <typename Executor1>
+ friend class basic_file;
+
+ /// Move-construct a basic_file from a file of another executor type.
+ /**
+ * This constructor moves a file from one object to another.
+ *
+ * @param other The other basic_file object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_file(const executor_type&) constructor.
+ */
+ template <typename Executor1>
+ basic_file(basic_file<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign a basic_file from a file of another executor type.
+ /**
+ * This assignment operator moves a file from one object to another.
+ *
+ * @param other The other basic_file object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_file(const executor_type&) constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_file&
+ > operator=(basic_file<Executor1>&& other)
+ {
+ basic_file tmp(std::move(other));
+ impl_ = std::move(tmp.impl_);
+ return *this;
+ }
+
+ /// Get the executor associated with the object.
+ const executor_type& get_executor() noexcept
+ {
+ return impl_.get_executor();
+ }
+
+ /// Open the file using the specified path.
+ /**
+ * This function opens the file so that it will use the specified path.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ *
+ * @par Example
+ * @code
+ * asio::stream_file file(my_context);
+ * file.open("/path/to/my/file", asio::stream_file::read_only);
+ * @endcode
+ */
+ void open(const char* path, file_base::flags open_flags)
+ {
+ asio::error_code ec;
+ impl_.get_service().open(impl_.get_implementation(), path, open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Open the file using the specified path.
+ /**
+ * This function opens the file so that it will use the specified path.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @par Example
+ * @code
+ * asio::stream_file file(my_context);
+ * asio::error_code ec;
+ * file.open("/path/to/my/file", asio::stream_file::read_only, ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * @endcode
+ */
+ ASIO_SYNC_OP_VOID open(const char* path,
+ file_base::flags open_flags, asio::error_code& ec)
+ {
+ impl_.get_service().open(impl_.get_implementation(), path, open_flags, ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Open the file using the specified path.
+ /**
+ * This function opens the file so that it will use the specified path.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ *
+ * @par Example
+ * @code
+ * asio::stream_file file(my_context);
+ * file.open("/path/to/my/file", asio::stream_file::read_only);
+ * @endcode
+ */
+ void open(const std::string& path, file_base::flags open_flags)
+ {
+ asio::error_code ec;
+ impl_.get_service().open(impl_.get_implementation(),
+ path.c_str(), open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Open the file using the specified path.
+ /**
+ * This function opens the file so that it will use the specified path.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @par Example
+ * @code
+ * asio::stream_file file(my_context);
+ * asio::error_code ec;
+ * file.open("/path/to/my/file", asio::stream_file::read_only, ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * @endcode
+ */
+ ASIO_SYNC_OP_VOID open(const std::string& path,
+ file_base::flags open_flags, asio::error_code& ec)
+ {
+ impl_.get_service().open(impl_.get_implementation(),
+ path.c_str(), open_flags, ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Assign an existing native file to the file.
+ /*
+ * This function opens the file to hold an existing native file.
+ *
+ * @param native_file A native file.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void assign(const native_handle_type& native_file)
+ {
+ asio::error_code ec;
+ impl_.get_service().assign(
+ impl_.get_implementation(), native_file, ec);
+ asio::detail::throw_error(ec, "assign");
+ }
+
+ /// Assign an existing native file to the file.
+ /*
+ * This function opens the file to hold an existing native file.
+ *
+ * @param native_file A native file.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID assign(const native_handle_type& native_file,
+ asio::error_code& ec)
+ {
+ impl_.get_service().assign(
+ impl_.get_implementation(), native_file, ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Determine whether the file is open.
+ bool is_open() const
+ {
+ return impl_.get_service().is_open(impl_.get_implementation());
+ }
+
+ /// Close the file.
+ /**
+ * This function is used to close the file. Any asynchronous read or write
+ * operations will be cancelled immediately, and will complete with the
+ * asio::error::operation_aborted error.
+ *
+ * @throws asio::system_error Thrown on failure. Note that, even if
+ * the function indicates an error, the underlying descriptor is closed.
+ */
+ void close()
+ {
+ asio::error_code ec;
+ impl_.get_service().close(impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "close");
+ }
+
+ /// Close the file.
+ /**
+ * This function is used to close the file. Any asynchronous read or write
+ * operations will be cancelled immediately, and will complete with the
+ * asio::error::operation_aborted error.
+ *
+ * @param ec Set to indicate what error occurred, if any. Note that, even if
+ * the function indicates an error, the underlying descriptor is closed.
+ *
+ * @par Example
+ * @code
+ * asio::stream_file file(my_context);
+ * ...
+ * asio::error_code ec;
+ * file.close(ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * @endcode
+ */
+ ASIO_SYNC_OP_VOID close(asio::error_code& ec)
+ {
+ impl_.get_service().close(impl_.get_implementation(), ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Release ownership of the underlying native file.
+ /**
+ * This function causes all outstanding asynchronous read and write
+ * operations to finish immediately, and the handlers for cancelled
+ * operations will be passed the asio::error::operation_aborted error.
+ * Ownership of the native file is then transferred to the caller.
+ *
+ * @throws asio::system_error Thrown on failure.
+ *
+ * @note This function is unsupported on Windows versions prior to Windows
+ * 8.1, and will fail with asio::error::operation_not_supported on
+ * these platforms.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603)
+ __declspec(deprecated("This function always fails with "
+ "operation_not_supported when used on Windows versions "
+ "prior to Windows 8.1."))
+#endif
+ native_handle_type release()
+ {
+ asio::error_code ec;
+ native_handle_type s = impl_.get_service().release(
+ impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "release");
+ return s;
+ }
+
+ /// Release ownership of the underlying native file.
+ /**
+ * This function causes all outstanding asynchronous read and write
+ * operations to finish immediately, and the handlers for cancelled
+ * operations will be passed the asio::error::operation_aborted error.
+ * Ownership of the native file is then transferred to the caller.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note This function is unsupported on Windows versions prior to Windows
+ * 8.1, and will fail with asio::error::operation_not_supported on
+ * these platforms.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603)
+ __declspec(deprecated("This function always fails with "
+ "operation_not_supported when used on Windows versions "
+ "prior to Windows 8.1."))
+#endif
+ native_handle_type release(asio::error_code& ec)
+ {
+ return impl_.get_service().release(impl_.get_implementation(), ec);
+ }
+
+ /// Get the native file representation.
+ /**
+ * This function may be used to obtain the underlying representation of the
+ * file. This is intended to allow access to native file functionality
+ * that is not otherwise provided.
+ */
+ native_handle_type native_handle()
+ {
+ return impl_.get_service().native_handle(impl_.get_implementation());
+ }
+
+ /// Cancel all asynchronous operations associated with the file.
+ /**
+ * This function causes all outstanding asynchronous read and write
+ * operations to finish immediately, and the handlers for cancelled
+ * operations will be passed the asio::error::operation_aborted error.
+ *
+ * @throws asio::system_error Thrown on failure.
+ *
+ * @note Calls to cancel() will always fail with
+ * asio::error::operation_not_supported when run on Windows XP, Windows
+ * Server 2003, and earlier versions of Windows, unless
+ * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has
+ * two issues that should be considered before enabling its use:
+ *
+ * @li It will only cancel asynchronous operations that were initiated in the
+ * current thread.
+ *
+ * @li It can appear to complete without error, but the request to cancel the
+ * unfinished operations may be silently ignored by the operating system.
+ * Whether it works or not seems to depend on the drivers that are installed.
+ *
+ * For portable cancellation, consider using the close() function to
+ * simultaneously cancel the outstanding operations and close the file.
+ *
+ * When running on Windows Vista, Windows Server 2008, and later, the
+ * CancelIoEx function is always used. This function does not have the
+ * problems described above.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
+ && !defined(ASIO_ENABLE_CANCELIO)
+ __declspec(deprecated("By default, this function always fails with "
+ "operation_not_supported when used on Windows XP, Windows Server 2003, "
+ "or earlier. Consult documentation for details."))
+#endif
+ void cancel()
+ {
+ asio::error_code ec;
+ impl_.get_service().cancel(impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "cancel");
+ }
+
+ /// Cancel all asynchronous operations associated with the file.
+ /**
+ * This function causes all outstanding asynchronous read and write
+ * operations to finish immediately, and the handlers for cancelled
+ * operations will be passed the asio::error::operation_aborted error.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note Calls to cancel() will always fail with
+ * asio::error::operation_not_supported when run on Windows XP, Windows
+ * Server 2003, and earlier versions of Windows, unless
+ * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has
+ * two issues that should be considered before enabling its use:
+ *
+ * @li It will only cancel asynchronous operations that were initiated in the
+ * current thread.
+ *
+ * @li It can appear to complete without error, but the request to cancel the
+ * unfinished operations may be silently ignored by the operating system.
+ * Whether it works or not seems to depend on the drivers that are installed.
+ *
+ * For portable cancellation, consider using the close() function to
+ * simultaneously cancel the outstanding operations and close the file.
+ *
+ * When running on Windows Vista, Windows Server 2008, and later, the
+ * CancelIoEx function is always used. This function does not have the
+ * problems described above.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
+ && !defined(ASIO_ENABLE_CANCELIO)
+ __declspec(deprecated("By default, this function always fails with "
+ "operation_not_supported when used on Windows XP, Windows Server 2003, "
+ "or earlier. Consult documentation for details."))
+#endif
+ ASIO_SYNC_OP_VOID cancel(asio::error_code& ec)
+ {
+ impl_.get_service().cancel(impl_.get_implementation(), ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Get the size of the file.
+ /**
+ * This function determines the size of the file, in bytes.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ uint64_t size() const
+ {
+ asio::error_code ec;
+ uint64_t s = impl_.get_service().size(impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "size");
+ return s;
+ }
+
+ /// Get the size of the file.
+ /**
+ * This function determines the size of the file, in bytes.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ uint64_t size(asio::error_code& ec) const
+ {
+ return impl_.get_service().size(impl_.get_implementation(), ec);
+ }
+
+ /// Alter the size of the file.
+ /**
+ * This function resizes the file to the specified size, in bytes. If the
+ * current file size exceeds @c n then any extra data is discarded. If the
+ * current size is less than @c n then the file is extended and filled with
+ * zeroes.
+ *
+ * @param n The new size for the file.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void resize(uint64_t n)
+ {
+ asio::error_code ec;
+ impl_.get_service().resize(impl_.get_implementation(), n, ec);
+ asio::detail::throw_error(ec, "resize");
+ }
+
+ /// Alter the size of the file.
+ /**
+ * This function resizes the file to the specified size, in bytes. If the
+ * current file size exceeds @c n then any extra data is discarded. If the
+ * current size is less than @c n then the file is extended and filled with
+ * zeroes.
+ *
+ * @param n The new size for the file.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID resize(uint64_t n, asio::error_code& ec)
+ {
+ impl_.get_service().resize(impl_.get_implementation(), n, ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Synchronise the file to disk.
+ /**
+ * This function synchronises the file data and metadata to disk. Note that
+ * the semantics of this synchronisation vary between operation systems.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void sync_all()
+ {
+ asio::error_code ec;
+ impl_.get_service().sync_all(impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "sync_all");
+ }
+
+ /// Synchronise the file to disk.
+ /**
+ * This function synchronises the file data and metadata to disk. Note that
+ * the semantics of this synchronisation vary between operation systems.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID sync_all(asio::error_code& ec)
+ {
+ impl_.get_service().sync_all(impl_.get_implementation(), ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Synchronise the file data to disk.
+ /**
+ * This function synchronises the file data to disk. Note that the semantics
+ * of this synchronisation vary between operation systems.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void sync_data()
+ {
+ asio::error_code ec;
+ impl_.get_service().sync_data(impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "sync_data");
+ }
+
+ /// Synchronise the file data to disk.
+ /**
+ * This function synchronises the file data to disk. Note that the semantics
+ * of this synchronisation vary between operation systems.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID sync_data(asio::error_code& ec)
+ {
+ impl_.get_service().sync_data(impl_.get_implementation(), ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+protected:
+ /// Protected destructor to prevent deletion through this type.
+ /**
+ * This function destroys the file, cancelling any outstanding asynchronous
+ * operations associated with the file as if by calling @c cancel.
+ */
+ ~basic_file()
+ {
+ }
+
+#if defined(ASIO_HAS_IOCP)
+ detail::io_object_impl<detail::win_iocp_file_service, Executor> impl_;
+#elif defined(ASIO_HAS_IO_URING)
+ detail::io_object_impl<detail::io_uring_file_service, Executor> impl_;
+#endif
+
+private:
+ // Disallow copying and assignment.
+ basic_file(const basic_file&) = delete;
+ basic_file& operator=(const basic_file&) = delete;
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_FILE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_BASIC_FILE_HPP
diff --git a/3rdparty/asio/include/asio/basic_io_object.hpp b/3rdparty/asio/include/asio/basic_io_object.hpp
index 733557e3e10..7e502206ff8 100644
--- a/3rdparty/asio/include/asio/basic_io_object.hpp
+++ b/3rdparty/asio/include/asio/basic_io_object.hpp
@@ -2,7 +2,7 @@
// basic_io_object.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,7 +22,6 @@
namespace asio {
-#if defined(ASIO_HAS_MOVE)
namespace detail
{
// Type trait used to determine whether a service supports move.
@@ -45,14 +44,13 @@ namespace detail
static_cast<implementation_type*>(0))) == 1;
};
}
-#endif // defined(ASIO_HAS_MOVE)
/// Base class for all I/O objects.
/**
* @note All I/O objects are non-copyable. However, when using C++0x, certain
* I/O objects do support move construction and move assignment.
*/
-#if !defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+#if defined(GENERATING_DOCUMENTATION)
template <typename IoObjectService>
#else
template <typename IoObjectService,
@@ -101,7 +99,7 @@ public:
typedef asio::io_context::executor_type executor_type;
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return service_.get_io_context().get_executor();
}
@@ -190,7 +188,6 @@ private:
implementation_type implementation_;
};
-#if defined(ASIO_HAS_MOVE)
// Specialisation for movable objects.
template <typename IoObjectService>
class basic_io_object<IoObjectService, true>
@@ -213,7 +210,7 @@ public:
typedef asio::io_context::executor_type executor_type;
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return service_->get_io_context().get_executor();
}
@@ -281,7 +278,6 @@ private:
IoObjectService* service_;
implementation_type implementation_;
};
-#endif // defined(ASIO_HAS_MOVE)
} // namespace asio
diff --git a/3rdparty/asio/include/asio/basic_random_access_file.hpp b/3rdparty/asio/include/asio/basic_random_access_file.hpp
new file mode 100644
index 00000000000..fe88f420560
--- /dev/null
+++ b/3rdparty/asio/include/asio/basic_random_access_file.hpp
@@ -0,0 +1,689 @@
+//
+// basic_random_access_file.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_BASIC_RANDOM_ACCESS_FILE_HPP
+#define ASIO_BASIC_RANDOM_ACCESS_FILE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_FILE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include <cstddef>
+#include "asio/async_result.hpp"
+#include "asio/basic_file.hpp"
+#include "asio/detail/handler_type_requirements.hpp"
+#include "asio/detail/non_const_lvalue.hpp"
+#include "asio/detail/throw_error.hpp"
+#include "asio/error.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+#if !defined(ASIO_BASIC_RANDOM_ACCESS_FILE_FWD_DECL)
+#define ASIO_BASIC_RANDOM_ACCESS_FILE_FWD_DECL
+
+// Forward declaration with defaulted arguments.
+template <typename Executor = any_io_executor>
+class basic_random_access_file;
+
+#endif // !defined(ASIO_BASIC_RANDOM_ACCESS_FILE_FWD_DECL)
+
+/// Provides random-access file functionality.
+/**
+ * The basic_random_access_file class template provides asynchronous and
+ * blocking random-access file functionality.
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe.@n
+ * @e Shared @e objects: Unsafe.
+ *
+ * Synchronous @c read_some_at and @c write_some_at operations are thread safe
+ * with respect to each other, if the underlying operating system calls are
+ * also thread safe. This means that it is permitted to perform concurrent
+ * calls to these synchronous operations on a single file object. Other
+ * synchronous operations, such as @c open or @c close, are not thread safe.
+ */
+template <typename Executor>
+class basic_random_access_file
+ : public basic_file<Executor>
+{
+private:
+ class initiate_async_write_some_at;
+ class initiate_async_read_some_at;
+
+public:
+ /// The type of the executor associated with the object.
+ typedef Executor executor_type;
+
+ /// Rebinds the file type to another executor.
+ template <typename Executor1>
+ struct rebind_executor
+ {
+ /// The file type when rebound to the specified executor.
+ typedef basic_random_access_file<Executor1> other;
+ };
+
+ /// The native representation of a file.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef typename basic_file<Executor>::native_handle_type native_handle_type;
+#endif
+
+ /// Construct a basic_random_access_file without opening it.
+ /**
+ * This constructor initialises a file without opening it. The file needs to
+ * be opened before data can be read from or or written to it.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ */
+ explicit basic_random_access_file(const executor_type& ex)
+ : basic_file<Executor>(ex)
+ {
+ }
+
+ /// Construct a basic_random_access_file without opening it.
+ /**
+ * This constructor initialises a file without opening it. The file needs to
+ * be opened before data can be read from or or written to it.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ */
+ template <typename ExecutionContext>
+ explicit basic_random_access_file(ExecutionContext& context,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(context)
+ {
+ }
+
+ /// Construct and open a basic_random_access_file.
+ /**
+ * This constructor initialises and opens a file.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ basic_random_access_file(const executor_type& ex,
+ const char* path, file_base::flags open_flags)
+ : basic_file<Executor>(ex, path, open_flags)
+ {
+ }
+
+ /// Construct and open a basic_random_access_file.
+ /**
+ * This constructor initialises and opens a file.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ template <typename ExecutionContext>
+ basic_random_access_file(ExecutionContext& context,
+ const char* path, file_base::flags open_flags,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(context, path, open_flags)
+ {
+ }
+
+ /// Construct and open a basic_random_access_file.
+ /**
+ * This constructor initialises and opens a file.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ basic_random_access_file(const executor_type& ex,
+ const std::string& path, file_base::flags open_flags)
+ : basic_file<Executor>(ex, path, open_flags)
+ {
+ }
+
+ /// Construct and open a basic_random_access_file.
+ /**
+ * This constructor initialises and opens a file.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ template <typename ExecutionContext>
+ basic_random_access_file(ExecutionContext& context,
+ const std::string& path, file_base::flags open_flags,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(context, path, open_flags)
+ {
+ }
+
+ /// Construct a basic_random_access_file on an existing native file.
+ /**
+ * This constructor initialises a random-access file object to hold an
+ * existing native file.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ *
+ * @param native_file The new underlying file implementation.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ basic_random_access_file(const executor_type& ex,
+ const native_handle_type& native_file)
+ : basic_file<Executor>(ex, native_file)
+ {
+ }
+
+ /// Construct a basic_random_access_file on an existing native file.
+ /**
+ * This constructor initialises a random-access file object to hold an
+ * existing native file.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ *
+ * @param native_file The new underlying file implementation.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ template <typename ExecutionContext>
+ basic_random_access_file(ExecutionContext& context,
+ const native_handle_type& native_file,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(context, native_file)
+ {
+ }
+
+ /// Move-construct a basic_random_access_file from another.
+ /**
+ * This constructor moves a random-access file from one object to another.
+ *
+ * @param other The other basic_random_access_file object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_random_access_file(const executor_type&)
+ * constructor.
+ */
+ basic_random_access_file(basic_random_access_file&& other) noexcept
+ : basic_file<Executor>(std::move(other))
+ {
+ }
+
+ /// Move-assign a basic_random_access_file from another.
+ /**
+ * This assignment operator moves a random-access file from one object to
+ * another.
+ *
+ * @param other The other basic_random_access_file object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_random_access_file(const executor_type&)
+ * constructor.
+ */
+ basic_random_access_file& operator=(basic_random_access_file&& other)
+ {
+ basic_file<Executor>::operator=(std::move(other));
+ return *this;
+ }
+
+ /// Move-construct a basic_random_access_file from a file of another executor
+ /// type.
+ /**
+ * This constructor moves a random-access file from one object to another.
+ *
+ * @param other The other basic_random_access_file object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_random_access_file(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ basic_random_access_file(basic_random_access_file<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(std::move(other))
+ {
+ }
+
+ /// Move-assign a basic_random_access_file from a file of another executor
+ /// type.
+ /**
+ * This assignment operator moves a random-access file from one object to
+ * another.
+ *
+ * @param other The other basic_random_access_file object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_random_access_file(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_random_access_file&
+ > operator=(basic_random_access_file<Executor1>&& other)
+ {
+ basic_file<Executor>::operator=(std::move(other));
+ return *this;
+ }
+
+ /// Destroys the file.
+ /**
+ * This function destroys the file, cancelling any outstanding asynchronous
+ * operations associated with the file as if by calling @c cancel.
+ */
+ ~basic_random_access_file()
+ {
+ }
+
+ /// Write some data to the handle at the specified offset.
+ /**
+ * This function is used to write data to the random-access handle. The
+ * function call will block until one or more bytes of the data has been
+ * written successfully, or until an error occurs.
+ *
+ * @param offset The offset at which the data will be written.
+ *
+ * @param buffers One or more data buffers to be written to the handle.
+ *
+ * @returns The number of bytes written.
+ *
+ * @throws asio::system_error Thrown on failure. An error code of
+ * asio::error::eof indicates that the end of the file was reached.
+ *
+ * @note The write_some_at operation may not write all of the data. Consider
+ * using the @ref write_at function if you need to ensure that all data is
+ * written before the blocking operation completes.
+ *
+ * @par Example
+ * To write a single data buffer use the @ref buffer function as follows:
+ * @code
+ * handle.write_some_at(42, asio::buffer(data, size));
+ * @endcode
+ * See the @ref buffer documentation for information on writing multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename ConstBufferSequence>
+ std::size_t write_some_at(uint64_t offset,
+ const ConstBufferSequence& buffers)
+ {
+ asio::error_code ec;
+ std::size_t s = this->impl_.get_service().write_some_at(
+ this->impl_.get_implementation(), offset, buffers, ec);
+ asio::detail::throw_error(ec, "write_some_at");
+ return s;
+ }
+
+ /// Write some data to the handle at the specified offset.
+ /**
+ * This function is used to write data to the random-access handle. The
+ * function call will block until one or more bytes of the data has been
+ * written successfully, or until an error occurs.
+ *
+ * @param offset The offset at which the data will be written.
+ *
+ * @param buffers One or more data buffers to be written to the handle.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes written. Returns 0 if an error occurred.
+ *
+ * @note The write_some operation may not write all of the data to the
+ * file. Consider using the @ref write_at function if you need to ensure that
+ * all data is written before the blocking operation completes.
+ */
+ template <typename ConstBufferSequence>
+ std::size_t write_some_at(uint64_t offset,
+ const ConstBufferSequence& buffers, asio::error_code& ec)
+ {
+ return this->impl_.get_service().write_some_at(
+ this->impl_.get_implementation(), offset, buffers, ec);
+ }
+
+ /// Start an asynchronous write at the specified offset.
+ /**
+ * This function is used to asynchronously write data to the random-access
+ * handle. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
+ *
+ * @param offset The offset at which the data will be written.
+ *
+ * @param buffers One or more data buffers to be written to the handle.
+ * Although the buffers object may be copied as necessary, ownership of the
+ * underlying memory blocks is retained by the caller, which must guarantee
+ * that they remain valid until the completion handler is called.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
+ * @code void handler(
+ * const asio::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Number of bytes written.
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
+ * @note The write operation may not write all of the data to the file.
+ * Consider using the @ref async_write_at function if you need to ensure that
+ * all data is written before the asynchronous operation completes.
+ *
+ * @par Example
+ * To write a single data buffer use the @ref buffer function as follows:
+ * @code
+ * handle.async_write_some_at(42, asio::buffer(data, size), handler);
+ * @endcode
+ * See the @ref buffer documentation for information on writing multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ *
+ * @par Per-Operation Cancellation
+ * This asynchronous operation supports cancellation for the following
+ * asio::cancellation_type values:
+ *
+ * @li @c cancellation_type::terminal
+ *
+ * @li @c cancellation_type::partial
+ *
+ * @li @c cancellation_type::total
+ */
+ template <typename ConstBufferSequence,
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_write_some_at(uint64_t offset, const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_write_some_at>(), token, offset, buffers))
+ {
+ return async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ initiate_async_write_some_at(this), token, offset, buffers);
+ }
+
+ /// Read some data from the handle at the specified offset.
+ /**
+ * This function is used to read data from the random-access handle. The
+ * function call will block until one or more bytes of data has been read
+ * successfully, or until an error occurs.
+ *
+ * @param offset The offset at which the data will be read.
+ *
+ * @param buffers One or more buffers into which the data will be read.
+ *
+ * @returns The number of bytes read.
+ *
+ * @throws asio::system_error Thrown on failure. An error code of
+ * asio::error::eof indicates that the end of the file was reached.
+ *
+ * @note The read_some operation may not read all of the requested number of
+ * bytes. Consider using the @ref read_at function if you need to ensure that
+ * the requested amount of data is read before the blocking operation
+ * completes.
+ *
+ * @par Example
+ * To read into a single data buffer use the @ref buffer function as follows:
+ * @code
+ * handle.read_some_at(42, asio::buffer(data, size));
+ * @endcode
+ * See the @ref buffer documentation for information on reading into multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename MutableBufferSequence>
+ std::size_t read_some_at(uint64_t offset,
+ const MutableBufferSequence& buffers)
+ {
+ asio::error_code ec;
+ std::size_t s = this->impl_.get_service().read_some_at(
+ this->impl_.get_implementation(), offset, buffers, ec);
+ asio::detail::throw_error(ec, "read_some_at");
+ return s;
+ }
+
+ /// Read some data from the handle at the specified offset.
+ /**
+ * This function is used to read data from the random-access handle. The
+ * function call will block until one or more bytes of data has been read
+ * successfully, or until an error occurs.
+ *
+ * @param offset The offset at which the data will be read.
+ *
+ * @param buffers One or more buffers into which the data will be read.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes read. Returns 0 if an error occurred.
+ *
+ * @note The read_some operation may not read all of the requested number of
+ * bytes. Consider using the @ref read_at function if you need to ensure that
+ * the requested amount of data is read before the blocking operation
+ * completes.
+ */
+ template <typename MutableBufferSequence>
+ std::size_t read_some_at(uint64_t offset,
+ const MutableBufferSequence& buffers, asio::error_code& ec)
+ {
+ return this->impl_.get_service().read_some_at(
+ this->impl_.get_implementation(), offset, buffers, ec);
+ }
+
+ /// Start an asynchronous read at the specified offset.
+ /**
+ * This function is used to asynchronously read data from the random-access
+ * handle. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
+ *
+ * @param offset The offset at which the data will be read.
+ *
+ * @param buffers One or more buffers into which the data will be read.
+ * Although the buffers object may be copied as necessary, ownership of the
+ * underlying memory blocks is retained by the caller, which must guarantee
+ * that they remain valid until the completion handler is called.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
+ * @code void handler(
+ * const asio::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Number of bytes read.
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
+ * @note The read operation may not read all of the requested number of bytes.
+ * Consider using the @ref async_read_at function if you need to ensure that
+ * the requested amount of data is read before the asynchronous operation
+ * completes.
+ *
+ * @par Example
+ * To read into a single data buffer use the @ref buffer function as follows:
+ * @code
+ * handle.async_read_some_at(42, asio::buffer(data, size), handler);
+ * @endcode
+ * See the @ref buffer documentation for information on reading into multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ *
+ * @par Per-Operation Cancellation
+ * This asynchronous operation supports cancellation for the following
+ * asio::cancellation_type values:
+ *
+ * @li @c cancellation_type::terminal
+ *
+ * @li @c cancellation_type::partial
+ *
+ * @li @c cancellation_type::total
+ */
+ template <typename MutableBufferSequence,
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_read_some_at(uint64_t offset, const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_read_some_at>(), token, offset, buffers))
+ {
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ initiate_async_read_some_at(this), token, offset, buffers);
+ }
+
+private:
+ // Disallow copying and assignment.
+ basic_random_access_file(const basic_random_access_file&) = delete;
+ basic_random_access_file& operator=(
+ const basic_random_access_file&) = delete;
+
+ class initiate_async_write_some_at
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_write_some_at(basic_random_access_file* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename WriteHandler, typename ConstBufferSequence>
+ void operator()(WriteHandler&& handler,
+ uint64_t offset, const ConstBufferSequence& buffers) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a WriteHandler.
+ ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
+
+ detail::non_const_lvalue<WriteHandler> handler2(handler);
+ self_->impl_.get_service().async_write_some_at(
+ self_->impl_.get_implementation(), offset, buffers,
+ handler2.value, self_->impl_.get_executor());
+ }
+
+ private:
+ basic_random_access_file* self_;
+ };
+
+ class initiate_async_read_some_at
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_read_some_at(basic_random_access_file* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename ReadHandler, typename MutableBufferSequence>
+ void operator()(ReadHandler&& handler,
+ uint64_t offset, const MutableBufferSequence& buffers) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a ReadHandler.
+ ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
+
+ detail::non_const_lvalue<ReadHandler> handler2(handler);
+ self_->impl_.get_service().async_read_some_at(
+ self_->impl_.get_implementation(), offset, buffers,
+ handler2.value, self_->impl_.get_executor());
+ }
+
+ private:
+ basic_random_access_file* self_;
+ };
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_FILE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_BASIC_RANDOM_ACCESS_FILE_HPP
diff --git a/3rdparty/asio/include/asio/basic_raw_socket.hpp b/3rdparty/asio/include/asio/basic_raw_socket.hpp
index d48885dfc45..112090900ce 100644
--- a/3rdparty/asio/include/asio/basic_raw_socket.hpp
+++ b/3rdparty/asio/include/asio/basic_raw_socket.hpp
@@ -2,7 +2,7 @@
// basic_raw_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -46,17 +46,23 @@ class basic_raw_socket;
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*
- * Synchronous @c send, @c send_to, @c receive, @c receive_from, and @c connect
- * operations are thread safe with respect to each other, if the underlying
- * operating system calls are also thread safe. This means that it is permitted
- * to perform concurrent calls to these synchronous operations on a single
- * socket object. Other synchronous operations, such as @c open or @c close, are
- * not thread safe.
+ * Synchronous @c send, @c send_to, @c receive, @c receive_from, @c connect,
+ * and @c shutdown operations are thread safe with respect to each other, if
+ * the underlying operating system calls are also thread safe. This means that
+ * it is permitted to perform concurrent calls to these synchronous operations
+ * on a single socket object. Other synchronous operations, such as @c open or
+ * @c close, are not thread safe.
*/
template <typename Protocol, typename Executor>
class basic_raw_socket
: public basic_socket<Protocol, Executor>
{
+private:
+ class initiate_async_send;
+ class initiate_async_send_to;
+ class initiate_async_receive;
+ class initiate_async_receive_from;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -107,9 +113,9 @@ public:
*/
template <typename ExecutionContext>
explicit basic_raw_socket(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context)
{
}
@@ -144,10 +150,10 @@ public:
*/
template <typename ExecutionContext>
basic_raw_socket(ExecutionContext& context, const protocol_type& protocol,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: basic_socket<Protocol, Executor>(context, protocol)
{
}
@@ -190,9 +196,9 @@ public:
*/
template <typename ExecutionContext>
basic_raw_socket(ExecutionContext& context, const endpoint_type& endpoint,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context, endpoint)
{
}
@@ -235,14 +241,13 @@ public:
template <typename ExecutionContext>
basic_raw_socket(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_socket,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context, protocol, native_socket)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_raw_socket from another.
/**
* This constructor moves a raw socket from one object to another.
@@ -254,7 +259,7 @@ public:
* constructed using the @c basic_raw_socket(const executor_type&)
* constructor.
*/
- basic_raw_socket(basic_raw_socket&& other) ASIO_NOEXCEPT
+ basic_raw_socket(basic_raw_socket&& other) noexcept
: basic_socket<Protocol, Executor>(std::move(other))
{
}
@@ -290,10 +295,10 @@ public:
*/
template <typename Protocol1, typename Executor1>
basic_raw_socket(basic_raw_socket<Protocol1, Executor1>&& other,
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(std::move(other))
{
}
@@ -310,16 +315,15 @@ public:
* constructor.
*/
template <typename Protocol1, typename Executor1>
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value,
basic_raw_socket&
- >::type operator=(basic_raw_socket<Protocol1, Executor1>&& other)
+ > operator=(basic_raw_socket<Protocol1, Executor1>&& other)
{
basic_socket<Protocol, Executor>::operator=(std::move(other));
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destroys the socket.
/**
@@ -414,26 +418,32 @@ public:
/// Start an asynchronous send on a connected socket.
/**
- * This function is used to send data on the raw socket. The function call
- * will block until the data has been sent successfully or an error occurs.
+ * This function is used to asynchronously send data on the raw socket. It is
+ * an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
- * remain valid until the handler is called.
+ * remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The async_send operation can only be used with a connected socket.
* Use the async_send_to function to send data on an unconnected raw
* socket.
@@ -459,44 +469,51 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send>(), token,
+ buffers, socket_base::message_flags(0)))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send(this), handler,
+ initiate_async_send(this), token,
buffers, socket_base::message_flags(0));
}
/// Start an asynchronous send on a connected socket.
/**
- * This function is used to send data on the raw socket. The function call
- * will block until the data has been sent successfully or an error occurs.
+ * This function is used to asynchronously send data on the raw socket. It is
+ * an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
- * remain valid until the handler is called.
+ * remain valid until the completion handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The async_send operation can only be used with a connected socket.
* Use the async_send_to function to send data on an unconnected raw
* socket.
@@ -513,18 +530,18 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send(const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send(const ConstBufferSequence& buffers,
socket_base::message_flags flags,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send>(), token, buffers, flags))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send(this), handler, buffers, flags);
+ initiate_async_send(this), token, buffers, flags);
}
/// Send raw data to the specified endpoint.
@@ -618,28 +635,34 @@ public:
/// Start an asynchronous send.
/**
* This function is used to asynchronously send raw data to the specified
- * remote endpoint. The function call always returns immediately.
+ * remote endpoint. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param destination The remote endpoint to which the data will be sent.
* Copies will be made of the endpoint as required.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
@@ -664,48 +687,55 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send_to(const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send_to>(), token, buffers,
+ destination, socket_base::message_flags(0)))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send_to(this), handler, buffers,
+ initiate_async_send_to(this), token, buffers,
destination, socket_base::message_flags(0));
}
/// Start an asynchronous send.
/**
* This function is used to asynchronously send raw data to the specified
- * remote endpoint. The function call always returns immediately.
+ * remote endpoint. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param destination The remote endpoint to which the data will be sent.
* Copies will be made of the endpoint as required.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* On POSIX or Windows operating systems, this asynchronous operation supports
* cancellation for the following asio::cancellation_type values:
@@ -718,18 +748,20 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send_to(const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination, socket_base::message_flags flags,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send_to>(), token,
+ buffers, destination, flags))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send_to(this), handler, buffers, destination, flags);
+ initiate_async_send_to(this), token,
+ buffers, destination, flags);
}
/// Receive some data on a connected socket.
@@ -824,25 +856,31 @@ public:
/// Start an asynchronous receive on a connected socket.
/**
* This function is used to asynchronously receive data from the raw
- * socket. The function call always returns immediately.
+ * socket. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The async_receive operation can only be used with a connected socket.
* Use the async_receive_from function to receive data on an unconnected
* raw socket.
@@ -869,44 +907,51 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive>(), token,
+ buffers, socket_base::message_flags(0)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive(this), handler,
+ initiate_async_receive(this), token,
buffers, socket_base::message_flags(0));
}
/// Start an asynchronous receive on a connected socket.
/**
* This function is used to asynchronously receive data from the raw
- * socket. The function call always returns immediately.
+ * socket. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param flags Flags specifying how the receive call is to be made.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The async_receive operation can only be used with a connected socket.
* Use the async_receive_from function to receive data on an unconnected
* raw socket.
@@ -923,18 +968,19 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive(const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken
+ = default_completion_token_t<executor_type>>
+ auto async_receive(const MutableBufferSequence& buffers,
socket_base::message_flags flags,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive>(), token, buffers, flags))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive(this), handler, buffers, flags);
+ initiate_async_receive(this), token, buffers, flags);
}
/// Receive raw data with the endpoint of the sender.
@@ -1028,31 +1074,37 @@ public:
/// Start an asynchronous receive.
/**
- * This function is used to asynchronously receive raw data. The function
- * call always returns immediately.
+ * This function is used to asynchronously receive raw data. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the data. Ownership of the sender_endpoint object
* is retained by the caller, which must guarantee that it is valid until the
- * handler is called.
+ * completion handler is called.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
@@ -1074,50 +1126,58 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive_from(const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ReadToken&& token
+ = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive_from>(), token, buffers,
+ &sender_endpoint, socket_base::message_flags(0)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive_from(this), handler, buffers,
+ initiate_async_receive_from(this), token, buffers,
&sender_endpoint, socket_base::message_flags(0));
}
/// Start an asynchronous receive.
/**
- * This function is used to asynchronously receive raw data. The function
- * call always returns immediately.
+ * This function is used to asynchronously receive raw data. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the data. Ownership of the sender_endpoint object
* is retained by the caller, which must guarantee that it is valid until the
- * handler is called.
+ * completion handler is called.
*
* @param flags Flags specifying how the receive call is to be made.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* On POSIX or Windows operating systems, this asynchronous operation supports
* cancellation for the following asio::cancellation_type values:
@@ -1130,25 +1190,27 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive_from(const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken
+ = default_completion_token_t<executor_type>>
+ auto async_receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint, socket_base::message_flags flags,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive_from>(), token,
+ buffers, &sender_endpoint, flags))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive_from(this), handler,
+ initiate_async_receive_from(this), token,
buffers, &sender_endpoint, flags);
}
private:
// Disallow copying and assignment.
- basic_raw_socket(const basic_raw_socket&) ASIO_DELETED;
- basic_raw_socket& operator=(const basic_raw_socket&) ASIO_DELETED;
+ basic_raw_socket(const basic_raw_socket&) = delete;
+ basic_raw_socket& operator=(const basic_raw_socket&) = delete;
class initiate_async_send
{
@@ -1160,13 +1222,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers,
socket_base::message_flags flags) const
{
@@ -1194,13 +1256,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers, const endpoint_type& destination,
socket_base::message_flags flags) const
{
@@ -1228,13 +1290,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers,
socket_base::message_flags flags) const
{
@@ -1262,13 +1324,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers, endpoint_type* sender_endpoint,
socket_base::message_flags flags) const
{
diff --git a/3rdparty/asio/include/asio/basic_readable_pipe.hpp b/3rdparty/asio/include/asio/basic_readable_pipe.hpp
new file mode 100644
index 00000000000..9a5a0653f6b
--- /dev/null
+++ b/3rdparty/asio/include/asio/basic_readable_pipe.hpp
@@ -0,0 +1,626 @@
+//
+// basic_readable_pipe.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_BASIC_READABLE_PIPE_HPP
+#define ASIO_BASIC_READABLE_PIPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_PIPE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include <string>
+#include <utility>
+#include "asio/any_io_executor.hpp"
+#include "asio/async_result.hpp"
+#include "asio/detail/handler_type_requirements.hpp"
+#include "asio/detail/io_object_impl.hpp"
+#include "asio/detail/non_const_lvalue.hpp"
+#include "asio/detail/throw_error.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/error.hpp"
+#include "asio/execution_context.hpp"
+#if defined(ASIO_HAS_IOCP)
+# include "asio/detail/win_iocp_handle_service.hpp"
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_descriptor_service.hpp"
+#else
+# include "asio/detail/reactive_descriptor_service.hpp"
+#endif
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// Provides pipe functionality.
+/**
+ * The basic_readable_pipe class provides a wrapper over pipe
+ * functionality.
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe.@n
+ * @e Shared @e objects: Unsafe.
+ */
+template <typename Executor = any_io_executor>
+class basic_readable_pipe
+{
+private:
+ class initiate_async_read_some;
+
+public:
+ /// The type of the executor associated with the object.
+ typedef Executor executor_type;
+
+ /// Rebinds the pipe type to another executor.
+ template <typename Executor1>
+ struct rebind_executor
+ {
+ /// The pipe type when rebound to the specified executor.
+ typedef basic_readable_pipe<Executor1> other;
+ };
+
+ /// The native representation of a pipe.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#elif defined(ASIO_HAS_IOCP)
+ typedef detail::win_iocp_handle_service::native_handle_type
+ native_handle_type;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ typedef detail::io_uring_descriptor_service::native_handle_type
+ native_handle_type;
+#else
+ typedef detail::reactive_descriptor_service::native_handle_type
+ native_handle_type;
+#endif
+
+ /// A basic_readable_pipe is always the lowest layer.
+ typedef basic_readable_pipe lowest_layer_type;
+
+ /// Construct a basic_readable_pipe without opening it.
+ /**
+ * This constructor creates a pipe without opening it.
+ *
+ * @param ex The I/O executor that the pipe will use, by default, to dispatch
+ * handlers for any asynchronous operations performed on the pipe.
+ */
+ explicit basic_readable_pipe(const executor_type& ex)
+ : impl_(0, ex)
+ {
+ }
+
+ /// Construct a basic_readable_pipe without opening it.
+ /**
+ * This constructor creates a pipe without opening it.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the pipe will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the pipe.
+ */
+ template <typename ExecutionContext>
+ explicit basic_readable_pipe(ExecutionContext& context,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(0, 0, context)
+ {
+ }
+
+ /// Construct a basic_readable_pipe on an existing native pipe.
+ /**
+ * This constructor creates a pipe object to hold an existing native
+ * pipe.
+ *
+ * @param ex The I/O executor that the pipe will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the
+ * pipe.
+ *
+ * @param native_pipe A native pipe.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ basic_readable_pipe(const executor_type& ex,
+ const native_handle_type& native_pipe)
+ : impl_(0, ex)
+ {
+ asio::error_code ec;
+ impl_.get_service().assign(impl_.get_implementation(),
+ native_pipe, ec);
+ asio::detail::throw_error(ec, "assign");
+ }
+
+ /// Construct a basic_readable_pipe on an existing native pipe.
+ /**
+ * This constructor creates a pipe object to hold an existing native
+ * pipe.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the pipe will use, by default, to dispatch handlers for any
+ * asynchronous operations performed on the pipe.
+ *
+ * @param native_pipe A native pipe.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ template <typename ExecutionContext>
+ basic_readable_pipe(ExecutionContext& context,
+ const native_handle_type& native_pipe,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ : impl_(0, 0, context)
+ {
+ asio::error_code ec;
+ impl_.get_service().assign(impl_.get_implementation(),
+ native_pipe, ec);
+ asio::detail::throw_error(ec, "assign");
+ }
+
+ /// Move-construct a basic_readable_pipe from another.
+ /**
+ * This constructor moves a pipe from one object to another.
+ *
+ * @param other The other basic_readable_pipe object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_readable_pipe(const executor_type&)
+ * constructor.
+ */
+ basic_readable_pipe(basic_readable_pipe&& other)
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign a basic_readable_pipe from another.
+ /**
+ * This assignment operator moves a pipe from one object to another.
+ *
+ * @param other The other basic_readable_pipe object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_readable_pipe(const executor_type&)
+ * constructor.
+ */
+ basic_readable_pipe& operator=(basic_readable_pipe&& other)
+ {
+ impl_ = std::move(other.impl_);
+ return *this;
+ }
+
+ // All pipes have access to each other's implementations.
+ template <typename Executor1>
+ friend class basic_readable_pipe;
+
+ /// Move-construct a basic_readable_pipe from a pipe of another executor type.
+ /**
+ * This constructor moves a pipe from one object to another.
+ *
+ * @param other The other basic_readable_pipe object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_readable_pipe(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ basic_readable_pipe(basic_readable_pipe<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign a basic_readable_pipe from a pipe of another executor type.
+ /**
+ * This assignment operator moves a pipe from one object to another.
+ *
+ * @param other The other basic_readable_pipe object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_readable_pipe(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_readable_pipe&
+ > operator=(basic_readable_pipe<Executor1>&& other)
+ {
+ basic_readable_pipe tmp(std::move(other));
+ impl_ = std::move(tmp.impl_);
+ return *this;
+ }
+
+ /// Destroys the pipe.
+ /**
+ * This function destroys the pipe, cancelling any outstanding
+ * asynchronous wait operations associated with the pipe as if by
+ * calling @c cancel.
+ */
+ ~basic_readable_pipe()
+ {
+ }
+
+ /// Get the executor associated with the object.
+ const executor_type& get_executor() noexcept
+ {
+ return impl_.get_executor();
+ }
+
+ /// Get a reference to the lowest layer.
+ /**
+ * This function returns a reference to the lowest layer in a stack of
+ * layers. Since a basic_readable_pipe cannot contain any further layers, it
+ * simply returns a reference to itself.
+ *
+ * @return A reference to the lowest layer in the stack of layers. Ownership
+ * is not transferred to the caller.
+ */
+ lowest_layer_type& lowest_layer()
+ {
+ return *this;
+ }
+
+ /// Get a const reference to the lowest layer.
+ /**
+ * This function returns a const reference to the lowest layer in a stack of
+ * layers. Since a basic_readable_pipe cannot contain any further layers, it
+ * simply returns a reference to itself.
+ *
+ * @return A const reference to the lowest layer in the stack of layers.
+ * Ownership is not transferred to the caller.
+ */
+ const lowest_layer_type& lowest_layer() const
+ {
+ return *this;
+ }
+
+ /// Assign an existing native pipe to the pipe.
+ /*
+ * This function opens the pipe to hold an existing native pipe.
+ *
+ * @param native_pipe A native pipe.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void assign(const native_handle_type& native_pipe)
+ {
+ asio::error_code ec;
+ impl_.get_service().assign(impl_.get_implementation(), native_pipe, ec);
+ asio::detail::throw_error(ec, "assign");
+ }
+
+ /// Assign an existing native pipe to the pipe.
+ /*
+ * This function opens the pipe to hold an existing native pipe.
+ *
+ * @param native_pipe A native pipe.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID assign(const native_handle_type& native_pipe,
+ asio::error_code& ec)
+ {
+ impl_.get_service().assign(impl_.get_implementation(), native_pipe, ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Determine whether the pipe is open.
+ bool is_open() const
+ {
+ return impl_.get_service().is_open(impl_.get_implementation());
+ }
+
+ /// Close the pipe.
+ /**
+ * This function is used to close the pipe. Any asynchronous read operations
+ * will be cancelled immediately, and will complete with the
+ * asio::error::operation_aborted error.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void close()
+ {
+ asio::error_code ec;
+ impl_.get_service().close(impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "close");
+ }
+
+ /// Close the pipe.
+ /**
+ * This function is used to close the pipe. Any asynchronous read operations
+ * will be cancelled immediately, and will complete with the
+ * asio::error::operation_aborted error.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID close(asio::error_code& ec)
+ {
+ impl_.get_service().close(impl_.get_implementation(), ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Release ownership of the underlying native pipe.
+ /**
+ * This function causes all outstanding asynchronous read operations to
+ * finish immediately, and the handlers for cancelled operations will be
+ * passed the asio::error::operation_aborted error. Ownership of the
+ * native pipe is then transferred to the caller.
+ *
+ * @throws asio::system_error Thrown on failure.
+ *
+ * @note This function is unsupported on Windows versions prior to Windows
+ * 8.1, and will fail with asio::error::operation_not_supported on
+ * these platforms.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603)
+ __declspec(deprecated("This function always fails with "
+ "operation_not_supported when used on Windows versions "
+ "prior to Windows 8.1."))
+#endif
+ native_handle_type release()
+ {
+ asio::error_code ec;
+ native_handle_type s = impl_.get_service().release(
+ impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "release");
+ return s;
+ }
+
+ /// Release ownership of the underlying native pipe.
+ /**
+ * This function causes all outstanding asynchronous read operations to
+ * finish immediately, and the handlers for cancelled operations will be
+ * passed the asio::error::operation_aborted error. Ownership of the
+ * native pipe is then transferred to the caller.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note This function is unsupported on Windows versions prior to Windows
+ * 8.1, and will fail with asio::error::operation_not_supported on
+ * these platforms.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603)
+ __declspec(deprecated("This function always fails with "
+ "operation_not_supported when used on Windows versions "
+ "prior to Windows 8.1."))
+#endif
+ native_handle_type release(asio::error_code& ec)
+ {
+ return impl_.get_service().release(impl_.get_implementation(), ec);
+ }
+
+ /// Get the native pipe representation.
+ /**
+ * This function may be used to obtain the underlying representation of the
+ * pipe. This is intended to allow access to native pipe
+ * functionality that is not otherwise provided.
+ */
+ native_handle_type native_handle()
+ {
+ return impl_.get_service().native_handle(impl_.get_implementation());
+ }
+
+ /// Cancel all asynchronous operations associated with the pipe.
+ /**
+ * This function causes all outstanding asynchronous read operations to finish
+ * immediately, and the handlers for cancelled operations will be passed the
+ * asio::error::operation_aborted error.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void cancel()
+ {
+ asio::error_code ec;
+ impl_.get_service().cancel(impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "cancel");
+ }
+
+ /// Cancel all asynchronous operations associated with the pipe.
+ /**
+ * This function causes all outstanding asynchronous read operations to finish
+ * immediately, and the handlers for cancelled operations will be passed the
+ * asio::error::operation_aborted error.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID cancel(asio::error_code& ec)
+ {
+ impl_.get_service().cancel(impl_.get_implementation(), ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Read some data from the pipe.
+ /**
+ * This function is used to read data from the pipe. The function call will
+ * block until one or more bytes of data has been read successfully, or until
+ * an error occurs.
+ *
+ * @param buffers One or more buffers into which the data will be read.
+ *
+ * @returns The number of bytes read.
+ *
+ * @throws asio::system_error Thrown on failure. An error code of
+ * asio::error::eof indicates that the connection was closed by the
+ * peer.
+ *
+ * @note The read_some operation may not read all of the requested number of
+ * bytes. Consider using the @ref read function if you need to ensure that
+ * the requested amount of data is read before the blocking operation
+ * completes.
+ *
+ * @par Example
+ * To read into a single data buffer use the @ref buffer function as follows:
+ * @code
+ * basic_readable_pipe.read_some(asio::buffer(data, size));
+ * @endcode
+ * See the @ref buffer documentation for information on reading into multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename MutableBufferSequence>
+ std::size_t read_some(const MutableBufferSequence& buffers)
+ {
+ asio::error_code ec;
+ std::size_t s = impl_.get_service().read_some(
+ impl_.get_implementation(), buffers, ec);
+ asio::detail::throw_error(ec, "read_some");
+ return s;
+ }
+
+ /// Read some data from the pipe.
+ /**
+ * This function is used to read data from the pipe. The function call will
+ * block until one or more bytes of data has been read successfully, or until
+ * an error occurs.
+ *
+ * @param buffers One or more buffers into which the data will be read.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes read. Returns 0 if an error occurred.
+ *
+ * @note The read_some operation may not read all of the requested number of
+ * bytes. Consider using the @ref read function if you need to ensure that
+ * the requested amount of data is read before the blocking operation
+ * completes.
+ */
+ template <typename MutableBufferSequence>
+ std::size_t read_some(const MutableBufferSequence& buffers,
+ asio::error_code& ec)
+ {
+ return impl_.get_service().read_some(
+ impl_.get_implementation(), buffers, ec);
+ }
+
+ /// Start an asynchronous read.
+ /**
+ * This function is used to asynchronously read data from the pipe. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
+ *
+ * @param buffers One or more buffers into which the data will be read.
+ * Although the buffers object may be copied as necessary, ownership of the
+ * underlying memory blocks is retained by the caller, which must guarantee
+ * that they remain valid until the completion handler is called.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
+ * @code void handler(
+ * const asio::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Number of bytes read.
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
+ * @note The read operation may not read all of the requested number of bytes.
+ * Consider using the @ref async_read function if you need to ensure that the
+ * requested amount of data is read before the asynchronous operation
+ * completes.
+ *
+ * @par Example
+ * To read into a single data buffer use the @ref buffer function as follows:
+ * @code
+ * basic_readable_pipe.async_read_some(
+ * asio::buffer(data, size), handler);
+ * @endcode
+ * See the @ref buffer documentation for information on reading into multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename MutableBufferSequence,
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_read_some>(), token, buffers))
+ {
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ initiate_async_read_some(this), token, buffers);
+ }
+
+private:
+ // Disallow copying and assignment.
+ basic_readable_pipe(const basic_readable_pipe&) = delete;
+ basic_readable_pipe& operator=(const basic_readable_pipe&) = delete;
+
+ class initiate_async_read_some
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_read_some(basic_readable_pipe* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename ReadHandler, typename MutableBufferSequence>
+ void operator()(ReadHandler&& handler,
+ const MutableBufferSequence& buffers) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a ReadHandler.
+ ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
+
+ detail::non_const_lvalue<ReadHandler> handler2(handler);
+ self_->impl_.get_service().async_read_some(
+ self_->impl_.get_implementation(), buffers,
+ handler2.value, self_->impl_.get_executor());
+ }
+
+ private:
+ basic_readable_pipe* self_;
+ };
+
+#if defined(ASIO_HAS_IOCP)
+ detail::io_object_impl<detail::win_iocp_handle_service, Executor> impl_;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ detail::io_object_impl<detail::io_uring_descriptor_service, Executor> impl_;
+#else
+ detail::io_object_impl<detail::reactive_descriptor_service, Executor> impl_;
+#endif
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_PIPE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_BASIC_READABLE_PIPE_HPP
diff --git a/3rdparty/asio/include/asio/basic_seq_packet_socket.hpp b/3rdparty/asio/include/asio/basic_seq_packet_socket.hpp
index a1f6d99831f..cf2a4b6ad71 100644
--- a/3rdparty/asio/include/asio/basic_seq_packet_socket.hpp
+++ b/3rdparty/asio/include/asio/basic_seq_packet_socket.hpp
@@ -2,7 +2,7 @@
// basic_seq_packet_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -44,16 +44,21 @@ class basic_seq_packet_socket;
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*
- * Synchronous @c send, @c receive, and @c connect operations are thread safe
- * with respect to each other, if the underlying operating system calls are
- * also thread safe. This means that it is permitted to perform concurrent
- * calls to these synchronous operations on a single socket object. Other
- * synchronous operations, such as @c open or @c close, are not thread safe.
+ * Synchronous @c send, @c receive, @c connect, and @c shutdown operations are
+ * thread safe with respect to each other, if the underlying operating system
+ * calls are also thread safe. This means that it is permitted to perform
+ * concurrent calls to these synchronous operations on a single socket object.
+ * Other synchronous operations, such as @c open or @c close, are not thread
+ * safe.
*/
template <typename Protocol, typename Executor>
class basic_seq_packet_socket
: public basic_socket<Protocol, Executor>
{
+private:
+ class initiate_async_send;
+ class initiate_async_receive_with_flags;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -106,9 +111,9 @@ public:
*/
template <typename ExecutionContext>
explicit basic_seq_packet_socket(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context)
{
}
@@ -149,10 +154,10 @@ public:
template <typename ExecutionContext>
basic_seq_packet_socket(ExecutionContext& context,
const protocol_type& protocol,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: basic_socket<Protocol, Executor>(context, protocol)
{
}
@@ -197,9 +202,9 @@ public:
template <typename ExecutionContext>
basic_seq_packet_socket(ExecutionContext& context,
const endpoint_type& endpoint,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context, endpoint)
{
}
@@ -242,14 +247,13 @@ public:
template <typename ExecutionContext>
basic_seq_packet_socket(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_socket,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context, protocol, native_socket)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_seq_packet_socket from another.
/**
* This constructor moves a sequenced packet socket from one object to
@@ -262,7 +266,7 @@ public:
* constructed using the @c basic_seq_packet_socket(const executor_type&)
* constructor.
*/
- basic_seq_packet_socket(basic_seq_packet_socket&& other) ASIO_NOEXCEPT
+ basic_seq_packet_socket(basic_seq_packet_socket&& other) noexcept
: basic_socket<Protocol, Executor>(std::move(other))
{
}
@@ -300,10 +304,10 @@ public:
*/
template <typename Protocol1, typename Executor1>
basic_seq_packet_socket(basic_seq_packet_socket<Protocol1, Executor1>&& other,
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(std::move(other))
{
}
@@ -322,16 +326,15 @@ public:
* constructor.
*/
template <typename Protocol1, typename Executor1>
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value,
basic_seq_packet_socket&
- >::type operator=(basic_seq_packet_socket<Protocol1, Executor1>&& other)
+ > operator=(basic_seq_packet_socket<Protocol1, Executor1>&& other)
{
basic_socket<Protocol, Executor>::operator=(std::move(other));
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destroys the socket.
/**
@@ -405,27 +408,33 @@ public:
/// Start an asynchronous send.
/**
* This function is used to asynchronously send data on the sequenced packet
- * socket. The function call always returns immediately.
+ * socket. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
- * remain valid until the handler is called.
+ * remain valid until the completion handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
@@ -447,18 +456,20 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send(const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken
+ = default_completion_token_t<executor_type>>
+ auto async_send(const ConstBufferSequence& buffers,
socket_base::message_flags flags,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WriteToken&& token
+ = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send>(), token, buffers, flags))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send(this), handler, buffers, flags);
+ initiate_async_send(this), token, buffers, flags);
}
/// Receive some data on the socket.
@@ -583,31 +594,37 @@ public:
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive data from the sequenced
- * packet socket. The function call always returns immediately.
+ * packet socket. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param out_flags Once the asynchronous operation completes, contains flags
* associated with the received data. For example, if the
* socket_base::message_end_of_record bit is set then the received data marks
* the end of a record. The caller must guarantee that the referenced
- * variable remains valid until the handler is called.
+ * variable remains valid until the completion handler is called.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
@@ -630,30 +647,32 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive(const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive(const MutableBufferSequence& buffers,
socket_base::message_flags& out_flags,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive_with_flags>(), token,
+ buffers, socket_base::message_flags(0), &out_flags))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive_with_flags(this), handler,
+ initiate_async_receive_with_flags(this), token,
buffers, socket_base::message_flags(0), &out_flags);
}
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive data from the sequenced
- * data socket. The function call always returns immediately.
+ * data socket. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param in_flags Flags specifying how the receive call is to be made.
*
@@ -661,20 +680,25 @@ public:
* associated with the received data. For example, if the
* socket_base::message_end_of_record bit is set then the received data marks
* the end of a record. The caller must guarantee that the referenced
- * variable remains valid until the handler is called.
+ * variable remains valid until the completion handler is called.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
@@ -699,27 +723,28 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive(const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive(const MutableBufferSequence& buffers,
socket_base::message_flags in_flags,
socket_base::message_flags& out_flags,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive_with_flags>(),
+ token, buffers, in_flags, &out_flags))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
initiate_async_receive_with_flags(this),
- handler, buffers, in_flags, &out_flags);
+ token, buffers, in_flags, &out_flags);
}
private:
// Disallow copying and assignment.
- basic_seq_packet_socket(const basic_seq_packet_socket&) ASIO_DELETED;
+ basic_seq_packet_socket(const basic_seq_packet_socket&) = delete;
basic_seq_packet_socket& operator=(
- const basic_seq_packet_socket&) ASIO_DELETED;
+ const basic_seq_packet_socket&) = delete;
class initiate_async_send
{
@@ -731,13 +756,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers,
socket_base::message_flags flags) const
{
@@ -765,13 +790,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers,
socket_base::message_flags in_flags,
socket_base::message_flags* out_flags) const
diff --git a/3rdparty/asio/include/asio/basic_serial_port.hpp b/3rdparty/asio/include/asio/basic_serial_port.hpp
index 1c0c636976c..8fa66c0b0d7 100644
--- a/3rdparty/asio/include/asio/basic_serial_port.hpp
+++ b/3rdparty/asio/include/asio/basic_serial_port.hpp
@@ -2,7 +2,7 @@
// basic_serial_port.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -22,6 +22,7 @@
|| defined(GENERATING_DOCUMENTATION)
#include <string>
+#include <utility>
#include "asio/any_io_executor.hpp"
#include "asio/async_result.hpp"
#include "asio/detail/handler_type_requirements.hpp"
@@ -35,13 +36,9 @@
#if defined(ASIO_HAS_IOCP)
# include "asio/detail/win_iocp_serial_port_service.hpp"
#else
-# include "asio/detail/reactive_serial_port_service.hpp"
+# include "asio/detail/posix_serial_port_service.hpp"
#endif
-#if defined(ASIO_HAS_MOVE)
-# include <utility>
-#endif // defined(ASIO_HAS_MOVE)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -59,6 +56,10 @@ template <typename Executor = any_io_executor>
class basic_serial_port
: public serial_port_base
{
+private:
+ class initiate_async_write_some;
+ class initiate_async_read_some;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -78,7 +79,7 @@ public:
typedef detail::win_iocp_serial_port_service::native_handle_type
native_handle_type;
#else
- typedef detail::reactive_serial_port_service::native_handle_type
+ typedef detail::posix_serial_port_service::native_handle_type
native_handle_type;
#endif
@@ -108,10 +109,10 @@ public:
*/
template <typename ExecutionContext>
explicit basic_serial_port(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
}
@@ -150,9 +151,9 @@ public:
*/
template <typename ExecutionContext>
basic_serial_port(ExecutionContext& context, const char* device,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -194,9 +195,9 @@ public:
*/
template <typename ExecutionContext>
basic_serial_port(ExecutionContext& context, const std::string& device,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -243,9 +244,9 @@ public:
template <typename ExecutionContext>
basic_serial_port(ExecutionContext& context,
const native_handle_type& native_serial_port,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -254,7 +255,6 @@ public:
asio::detail::throw_error(ec, "assign");
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_serial_port from another.
/**
* This constructor moves a serial port from one object to another.
@@ -287,7 +287,55 @@ public:
impl_ = std::move(other.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+
+ // All serial ports have access to each other's implementations.
+ template <typename Executor1>
+ friend class basic_serial_port;
+
+ /// Move-construct a basic_serial_port from a serial port of another executor
+ /// type.
+ /**
+ * This constructor moves a serial port from one object to another.
+ *
+ * @param other The other basic_serial_port object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_serial_port(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ basic_serial_port(basic_serial_port<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign a basic_serial_port from a serial port of another executor
+ /// type.
+ /**
+ * This assignment operator moves a serial port from one object to another.
+ *
+ * @param other The other basic_serial_port object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_serial_port(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_serial_port&
+ > operator=(basic_serial_port<Executor1>&& other)
+ {
+ basic_serial_port tmp(std::move(other));
+ impl_ = std::move(tmp.impl_);
+ return *this;
+ }
/// Destroys the serial port.
/**
@@ -300,7 +348,7 @@ public:
}
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return impl_.get_executor();
}
@@ -656,25 +704,31 @@ public:
/// Start an asynchronous write.
/**
* This function is used to asynchronously write data to the serial port.
- * The function call always returns immediately.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more data buffers to be written to the serial port.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes written.
+ * std::size_t bytes_transferred // Number of bytes written.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The write operation may not transmit all of the data to the peer.
* Consider using the @ref async_write function if you need to ensure that all
* data is written before the asynchronous operation completes.
@@ -688,20 +742,30 @@ public:
* See the @ref buffer documentation for information on writing multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
+ *
+ * @par Per-Operation Cancellation
+ * On POSIX or Windows operating systems, this asynchronous operation supports
+ * cancellation for the following asio::cancellation_type values:
+ *
+ * @li @c cancellation_type::terminal
+ *
+ * @li @c cancellation_type::partial
+ *
+ * @li @c cancellation_type::total
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_write_some(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<WriteHandler,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_write_some>(), token, buffers))
+ {
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_write_some(this), handler, buffers);
+ initiate_async_write_some(this), token, buffers);
}
/// Read some data from the serial port.
@@ -770,25 +834,31 @@ public:
/// Start an asynchronous read.
/**
* This function is used to asynchronously read data from the serial port.
- * The function call always returns immediately.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more buffers into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes read.
+ * std::size_t bytes_transferred // Number of bytes read.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The read operation may not read all of the requested number of bytes.
* Consider using the @ref async_read function if you need to ensure that the
* requested amount of data is read before the asynchronous operation
@@ -803,26 +873,36 @@ public:
* See the @ref buffer documentation for information on reading into multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
+ *
+ * @par Per-Operation Cancellation
+ * On POSIX or Windows operating systems, this asynchronous operation supports
+ * cancellation for the following asio::cancellation_type values:
+ *
+ * @li @c cancellation_type::terminal
+ *
+ * @li @c cancellation_type::partial
+ *
+ * @li @c cancellation_type::total
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_read_some(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<ReadHandler,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_read_some>(), token, buffers))
+ {
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_read_some(this), handler, buffers);
+ initiate_async_read_some(this), token, buffers);
}
private:
// Disallow copying and assignment.
- basic_serial_port(const basic_serial_port&) ASIO_DELETED;
- basic_serial_port& operator=(const basic_serial_port&) ASIO_DELETED;
+ basic_serial_port(const basic_serial_port&) = delete;
+ basic_serial_port& operator=(const basic_serial_port&) = delete;
class initiate_async_write_some
{
@@ -834,13 +914,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
@@ -867,13 +947,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
@@ -893,7 +973,7 @@ private:
#if defined(ASIO_HAS_IOCP)
detail::io_object_impl<detail::win_iocp_serial_port_service, Executor> impl_;
#else
- detail::io_object_impl<detail::reactive_serial_port_service, Executor> impl_;
+ detail::io_object_impl<detail::posix_serial_port_service, Executor> impl_;
#endif
};
diff --git a/3rdparty/asio/include/asio/basic_signal_set.hpp b/3rdparty/asio/include/asio/basic_signal_set.hpp
index 25144346c23..bf74c39b3a8 100644
--- a/3rdparty/asio/include/asio/basic_signal_set.hpp
+++ b/3rdparty/asio/include/asio/basic_signal_set.hpp
@@ -2,7 +2,7 @@
// basic_signal_set.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -27,6 +27,7 @@
#include "asio/detail/type_traits.hpp"
#include "asio/error.hpp"
#include "asio/execution_context.hpp"
+#include "asio/signal_set_base.hpp"
#include "asio/detail/push_options.hpp"
@@ -93,8 +94,11 @@ namespace asio {
* least one thread.
*/
template <typename Executor = any_io_executor>
-class basic_signal_set
+class basic_signal_set : public signal_set_base
{
+private:
+ class initiate_async_wait;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -130,10 +134,10 @@ public:
*/
template <typename ExecutionContext>
explicit basic_signal_set(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
}
@@ -176,10 +180,10 @@ public:
*/
template <typename ExecutionContext>
basic_signal_set(ExecutionContext& context, int signal_number_1,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -235,10 +239,10 @@ public:
template <typename ExecutionContext>
basic_signal_set(ExecutionContext& context, int signal_number_1,
int signal_number_2,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -304,10 +308,10 @@ public:
template <typename ExecutionContext>
basic_signal_set(ExecutionContext& context, int signal_number_1,
int signal_number_2, int signal_number_3,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -330,7 +334,7 @@ public:
}
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return impl_.get_executor();
}
@@ -367,6 +371,58 @@ public:
ASIO_SYNC_OP_VOID_RETURN(ec);
}
+ /// Add a signal to a signal_set with the specified flags.
+ /**
+ * This function adds the specified signal to the set. It has no effect if the
+ * signal is already in the set.
+ *
+ * Flags other than flags::dont_care require OS support for the @c sigaction
+ * call, and this function will fail with @c error::operation_not_supported if
+ * this is unavailable.
+ *
+ * The specified flags will conflict with a prior, active registration of the
+ * same signal, if either specified a flags value other than flags::dont_care.
+ * In this case, the @c add will fail with @c error::invalid_argument.
+ *
+ * @param signal_number The signal to be added to the set.
+ *
+ * @param f Flags to modify the behaviour of the specified signal.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void add(int signal_number, flags_t f)
+ {
+ asio::error_code ec;
+ impl_.get_service().add(impl_.get_implementation(), signal_number, f, ec);
+ asio::detail::throw_error(ec, "add");
+ }
+
+ /// Add a signal to a signal_set with the specified flags.
+ /**
+ * This function adds the specified signal to the set. It has no effect if the
+ * signal is already in the set.
+ *
+ * Flags other than flags::dont_care require OS support for the @c sigaction
+ * call, and this function will fail with @c error::operation_not_supported if
+ * this is unavailable.
+ *
+ * The specified flags will conflict with a prior, active registration of the
+ * same signal, if either specified a flags value other than flags::dont_care.
+ * In this case, the @c add will fail with @c error::invalid_argument.
+ *
+ * @param signal_number The signal to be added to the set.
+ *
+ * @param f Flags to modify the behaviour of the specified signal.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID add(int signal_number, flags_t f,
+ asio::error_code& ec)
+ {
+ impl_.get_service().add(impl_.get_implementation(), signal_number, f, ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
/// Remove a signal from a signal_set.
/**
* This function removes the specified signal from the set. It has no effect
@@ -494,45 +550,61 @@ public:
/// Start an asynchronous operation to wait for a signal to be delivered.
/**
* This function may be used to initiate an asynchronous wait against the
- * signal set. It always returns immediately.
+ * signal set. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
- * For each call to async_wait(), the supplied handler will be called exactly
- * once. The handler will be called when:
+ * For each call to async_wait(), the completion handler will be called
+ * exactly once. The completion handler will be called when:
*
* @li One of the registered signals in the signal set occurs; or
*
* @li The signal set was cancelled, in which case the handler is passed the
* error code asio::error::operation_aborted.
*
- * @param handler The handler to be called when the signal occurs. Copies
- * will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the wait completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
* int signal_number // Indicates which signal occurred.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, int) @endcode
+ *
+ * @par Per-Operation Cancellation
+ * This asynchronous operation supports cancellation for the following
+ * asio::cancellation_type values:
+ *
+ * @li @c cancellation_type::terminal
+ *
+ * @li @c cancellation_type::partial
+ *
+ * @li @c cancellation_type::total
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, int))
- SignalHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(SignalHandler,
- void (asio::error_code, int))
- async_wait(
- ASIO_MOVE_ARG(SignalHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ SignalToken = default_completion_token_t<executor_type>>
+ auto async_wait(
+ SignalToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<SignalToken, void (asio::error_code, int)>(
+ declval<initiate_async_wait>(), token))
{
- return async_initiate<SignalHandler, void (asio::error_code, int)>(
- initiate_async_wait(this), handler);
+ return async_initiate<SignalToken, void (asio::error_code, int)>(
+ initiate_async_wait(this), token);
}
private:
// Disallow copying and assignment.
- basic_signal_set(const basic_signal_set&) ASIO_DELETED;
- basic_signal_set& operator=(const basic_signal_set&) ASIO_DELETED;
+ basic_signal_set(const basic_signal_set&) = delete;
+ basic_signal_set& operator=(const basic_signal_set&) = delete;
class initiate_async_wait
{
@@ -544,13 +616,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename SignalHandler>
- void operator()(ASIO_MOVE_ARG(SignalHandler) handler) const
+ void operator()(SignalHandler&& handler) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a SignalHandler.
diff --git a/3rdparty/asio/include/asio/basic_socket.hpp b/3rdparty/asio/include/asio/basic_socket.hpp
index ba63cbbdeaf..88c4b03fe18 100644
--- a/3rdparty/asio/include/asio/basic_socket.hpp
+++ b/3rdparty/asio/include/asio/basic_socket.hpp
@@ -2,7 +2,7 @@
// basic_socket.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -15,6 +15,7 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+#include <utility>
#include "asio/any_io_executor.hpp"
#include "asio/detail/config.hpp"
#include "asio/async_result.hpp"
@@ -32,14 +33,12 @@
# include "asio/detail/null_socket_service.hpp"
#elif defined(ASIO_HAS_IOCP)
# include "asio/detail/win_iocp_socket_service.hpp"
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_socket_service.hpp"
#else
# include "asio/detail/reactive_socket_service.hpp"
#endif
-#if defined(ASIO_HAS_MOVE)
-# include <utility>
-#endif // defined(ASIO_HAS_MOVE)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -66,6 +65,10 @@ template <typename Protocol, typename Executor>
class basic_socket
: public socket_base
{
+private:
+ class initiate_async_connect;
+ class initiate_async_wait;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -87,6 +90,9 @@ public:
#elif defined(ASIO_HAS_IOCP)
typedef typename detail::win_iocp_socket_service<
Protocol>::native_handle_type native_handle_type;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ typedef typename detail::io_uring_socket_service<
+ Protocol>::native_handle_type native_handle_type;
#else
typedef typename detail::reactive_socket_service<
Protocol>::native_handle_type native_handle_type;
@@ -125,9 +131,9 @@ public:
*/
template <typename ExecutionContext>
explicit basic_socket(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
}
@@ -165,10 +171,10 @@ public:
*/
template <typename ExecutionContext>
basic_socket(ExecutionContext& context, const protocol_type& protocol,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -220,9 +226,9 @@ public:
*/
template <typename ExecutionContext>
basic_socket(ExecutionContext& context, const endpoint_type& endpoint,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -273,9 +279,9 @@ public:
template <typename ExecutionContext>
basic_socket(ExecutionContext& context, const protocol_type& protocol,
const native_handle_type& native_socket,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -284,7 +290,6 @@ public:
asio::detail::throw_error(ec, "assign");
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_socket from another.
/**
* This constructor moves a socket from one object to another.
@@ -295,7 +300,7 @@ public:
* @note Following the move, the moved-from object is in the same state as if
* constructed using the @c basic_socket(const executor_type&) constructor.
*/
- basic_socket(basic_socket&& other) ASIO_NOEXCEPT
+ basic_socket(basic_socket&& other) noexcept
: impl_(std::move(other.impl_))
{
}
@@ -332,10 +337,10 @@ public:
*/
template <typename Protocol1, typename Executor1>
basic_socket(basic_socket<Protocol1, Executor1>&& other,
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value
- >::type = 0)
+ > = 0)
: impl_(std::move(other.impl_))
{
}
@@ -351,20 +356,19 @@ public:
* constructed using the @c basic_socket(const executor_type&) constructor.
*/
template <typename Protocol1, typename Executor1>
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value,
basic_socket&
- >::type operator=(basic_socket<Protocol1, Executor1> && other)
+ > operator=(basic_socket<Protocol1, Executor1>&& other)
{
basic_socket tmp(std::move(other));
impl_ = std::move(tmp.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return impl_.get_executor();
}
@@ -902,7 +906,8 @@ public:
/// Start an asynchronous connect.
/**
* This function is used to asynchronously connect a socket to the specified
- * remote endpoint. The function call always returns immediately.
+ * remote endpoint. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* The socket is automatically opened if it is not already open. If the
* connect fails, and the socket was automatically opened, the socket is
@@ -911,17 +916,22 @@ public:
* @param peer_endpoint The remote endpoint to which the socket will be
* connected. Copies will be made of the endpoint object as required.
*
- * @param handler The handler to be called when the connection operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the connect completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error // Result of operation
+ * const asio::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
+ *
* @par Example
* @code
* void connect_handler(const asio::error_code& error)
@@ -952,12 +962,13 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- ConnectHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ConnectHandler,
- void (asio::error_code))
- async_connect(const endpoint_type& peer_endpoint,
- ASIO_MOVE_ARG(ConnectHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ConnectToken = default_completion_token_t<executor_type>>
+ auto async_connect(const endpoint_type& peer_endpoint,
+ ConnectToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ConnectToken, void (asio::error_code)>(
+ declval<initiate_async_connect>(), token,
+ peer_endpoint, declval<asio::error_code&>()))
{
asio::error_code open_ec;
if (!is_open())
@@ -966,8 +977,8 @@ public:
impl_.get_service().open(impl_.get_implementation(), protocol, open_ec);
}
- return async_initiate<ConnectHandler, void (asio::error_code)>(
- initiate_async_connect(this), handler, peer_endpoint, open_ec);
+ return async_initiate<ConnectToken, void (asio::error_code)>(
+ initiate_async_connect(this), token, peer_endpoint, open_ec);
}
/// Set an option on the socket.
@@ -1751,21 +1762,28 @@ public:
/// write, or to have pending error conditions.
/**
* This function is used to perform an asynchronous wait for a socket to enter
- * a ready to read, write or error condition state.
+ * a ready to read, write or error condition state. It is an initiating
+ * function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* @param w Specifies the desired socket state.
*
- * @param handler The handler to be called when the wait operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the wait completes. Potential
+ * completion tokens include @ref use_future, @ref use_awaitable, @ref
+ * yield_context, or a function object with the correct completion signature.
+ * The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error // Result of operation
+ * const asio::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
+ *
* @par Example
* @code
* void wait_handler(const asio::error_code& error)
@@ -1795,15 +1813,15 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler,
- void (asio::error_code))
- async_wait(wait_type w,
- ASIO_MOVE_ARG(WaitHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WaitToken = default_completion_token_t<executor_type>>
+ auto async_wait(wait_type w,
+ WaitToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WaitToken, void (asio::error_code)>(
+ declval<initiate_async_wait>(), token, w))
{
- return async_initiate<WaitHandler, void (asio::error_code)>(
- initiate_async_wait(this), handler, w);
+ return async_initiate<WaitToken, void (asio::error_code)>(
+ initiate_async_wait(this), token, w);
}
protected:
@@ -1822,6 +1840,9 @@ protected:
#elif defined(ASIO_HAS_IOCP)
detail::io_object_impl<
detail::win_iocp_socket_service<Protocol>, Executor> impl_;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ detail::io_object_impl<
+ detail::io_uring_socket_service<Protocol>, Executor> impl_;
#else
detail::io_object_impl<
detail::reactive_socket_service<Protocol>, Executor> impl_;
@@ -1829,8 +1850,8 @@ protected:
private:
// Disallow copying and assignment.
- basic_socket(const basic_socket&) ASIO_DELETED;
- basic_socket& operator=(const basic_socket&) ASIO_DELETED;
+ basic_socket(const basic_socket&) = delete;
+ basic_socket& operator=(const basic_socket&) = delete;
class initiate_async_connect
{
@@ -1842,13 +1863,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ConnectHandler>
- void operator()(ASIO_MOVE_ARG(ConnectHandler) handler,
+ void operator()(ConnectHandler&& handler,
const endpoint_type& peer_endpoint,
const asio::error_code& open_ec) const
{
@@ -1860,7 +1881,7 @@ private:
{
asio::post(self_->impl_.get_executor(),
asio::detail::bind_handler(
- ASIO_MOVE_CAST(ConnectHandler)(handler), open_ec));
+ static_cast<ConnectHandler&&>(handler), open_ec));
}
else
{
@@ -1885,13 +1906,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WaitHandler>
- void operator()(ASIO_MOVE_ARG(WaitHandler) handler, wait_type w) const
+ void operator()(WaitHandler&& handler, wait_type w) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WaitHandler.
diff --git a/3rdparty/asio/include/asio/basic_socket_acceptor.hpp b/3rdparty/asio/include/asio/basic_socket_acceptor.hpp
index baa0c53ae6c..059d33ead53 100644
--- a/3rdparty/asio/include/asio/basic_socket_acceptor.hpp
+++ b/3rdparty/asio/include/asio/basic_socket_acceptor.hpp
@@ -2,7 +2,7 @@
// basic_socket_acceptor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -15,6 +15,7 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+#include <utility>
#include "asio/detail/config.hpp"
#include "asio/any_io_executor.hpp"
#include "asio/basic_socket.hpp"
@@ -31,14 +32,12 @@
# include "asio/detail/null_socket_service.hpp"
#elif defined(ASIO_HAS_IOCP)
# include "asio/detail/win_iocp_socket_service.hpp"
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_socket_service.hpp"
#else
# include "asio/detail/reactive_socket_service.hpp"
#endif
-#if defined(ASIO_HAS_MOVE)
-# include <utility>
-#endif // defined(ASIO_HAS_MOVE)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -82,6 +81,11 @@ template <typename Protocol, typename Executor>
class basic_socket_acceptor
: public socket_base
{
+private:
+ class initiate_async_wait;
+ class initiate_async_accept;
+ class initiate_async_move_accept;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -103,6 +107,9 @@ public:
#elif defined(ASIO_HAS_IOCP)
typedef typename detail::win_iocp_socket_service<
Protocol>::native_handle_type native_handle_type;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ typedef typename detail::io_uring_socket_service<
+ Protocol>::native_handle_type native_handle_type;
#else
typedef typename detail::reactive_socket_service<
Protocol>::native_handle_type native_handle_type;
@@ -141,9 +148,9 @@ public:
*/
template <typename ExecutionContext>
explicit basic_socket_acceptor(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
}
@@ -183,10 +190,10 @@ public:
template <typename ExecutionContext>
basic_socket_acceptor(ExecutionContext& context,
const protocol_type& protocol,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -272,9 +279,9 @@ public:
template <typename ExecutionContext>
basic_socket_acceptor(ExecutionContext& context,
const endpoint_type& endpoint, bool reuse_addr = true,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -337,9 +344,9 @@ public:
template <typename ExecutionContext>
basic_socket_acceptor(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_acceptor,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -348,7 +355,6 @@ public:
asio::detail::throw_error(ec, "assign");
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_socket_acceptor from another.
/**
* This constructor moves an acceptor from one object to another.
@@ -360,7 +366,7 @@ public:
* constructed using the @c basic_socket_acceptor(const executor_type&)
* constructor.
*/
- basic_socket_acceptor(basic_socket_acceptor&& other) ASIO_NOEXCEPT
+ basic_socket_acceptor(basic_socket_acceptor&& other) noexcept
: impl_(std::move(other.impl_))
{
}
@@ -400,10 +406,10 @@ public:
*/
template <typename Protocol1, typename Executor1>
basic_socket_acceptor(basic_socket_acceptor<Protocol1, Executor1>&& other,
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value
- >::type = 0)
+ > = 0)
: impl_(std::move(other.impl_))
{
}
@@ -421,17 +427,16 @@ public:
* constructor.
*/
template <typename Protocol1, typename Executor1>
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value,
basic_socket_acceptor&
- >::type operator=(basic_socket_acceptor<Protocol1, Executor1>&& other)
+ > operator=(basic_socket_acceptor<Protocol1, Executor1>&& other)
{
basic_socket_acceptor tmp(std::move(other));
impl_ = std::move(tmp.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destroys the acceptor.
/**
@@ -444,7 +449,7 @@ public:
}
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return impl_.get_executor();
}
@@ -1191,21 +1196,28 @@ public:
/// write, or to have pending error conditions.
/**
* This function is used to perform an asynchronous wait for an acceptor to
- * enter a ready to read, write or error condition state.
+ * enter a ready to read, write or error condition state. It is an initiating
+ * function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* @param w Specifies the desired acceptor state.
*
- * @param handler The handler to be called when the wait operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the wait completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error // Result of operation
+ * const asio::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
+ *
* @par Example
* @code
* void wait_handler(const asio::error_code& error)
@@ -1237,15 +1249,15 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler,
- void (asio::error_code))
- async_wait(wait_type w,
- ASIO_MOVE_ARG(WaitHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WaitToken = default_completion_token_t<executor_type>>
+ auto async_wait(wait_type w,
+ WaitToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WaitToken, void (asio::error_code)>(
+ declval<initiate_async_wait>(), token, w))
{
- return async_initiate<WaitHandler, void (asio::error_code)>(
- initiate_async_wait(this), handler, w);
+ return async_initiate<WaitToken, void (asio::error_code)>(
+ initiate_async_wait(this), token, w);
}
#if !defined(ASIO_NO_EXTENSIONS)
@@ -1269,9 +1281,9 @@ public:
*/
template <typename Protocol1, typename Executor1>
void accept(basic_socket<Protocol1, Executor1>& peer,
- typename constraint<
+ constraint_t<
is_convertible<Protocol, Protocol1>::value
- >::type = 0)
+ > = 0)
{
asio::error_code ec;
impl_.get_service().accept(impl_.get_implementation(),
@@ -1305,9 +1317,9 @@ public:
template <typename Protocol1, typename Executor1>
ASIO_SYNC_OP_VOID accept(
basic_socket<Protocol1, Executor1>& peer, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_convertible<Protocol, Protocol1>::value
- >::type = 0)
+ > = 0)
{
impl_.get_service().accept(impl_.get_implementation(),
peer, static_cast<endpoint_type*>(0), ec);
@@ -1317,23 +1329,30 @@ public:
/// Start an asynchronous accept.
/**
* This function is used to asynchronously accept a new connection into a
- * socket. The function call always returns immediately.
+ * socket, and additionally obtain the endpoint of the remote peer. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* @param peer The socket into which the new connection will be accepted.
* Ownership of the peer object is retained by the caller, which must
- * guarantee that it is valid until the handler is called.
+ * guarantee that it is valid until the completion handler is called.
*
- * @param handler The handler to be called when the accept operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the accept completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
+ *
* @par Example
* @code
* void accept_handler(const asio::error_code& error)
@@ -1364,18 +1383,19 @@ public:
*/
template <typename Protocol1, typename Executor1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- AcceptHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(AcceptHandler,
- void (asio::error_code))
- async_accept(basic_socket<Protocol1, Executor1>& peer,
- ASIO_MOVE_ARG(AcceptHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
- typename constraint<
+ AcceptToken = default_completion_token_t<executor_type>>
+ auto async_accept(basic_socket<Protocol1, Executor1>& peer,
+ AcceptToken&& token = default_completion_token_t<executor_type>(),
+ constraint_t<
is_convertible<Protocol, Protocol1>::value
- >::type = 0)
- {
- return async_initiate<AcceptHandler, void (asio::error_code)>(
- initiate_async_accept(this), handler,
+ > = 0)
+ -> decltype(
+ async_initiate<AcceptToken, void (asio::error_code)>(
+ declval<initiate_async_accept>(), token,
+ &peer, static_cast<endpoint_type*>(0)))
+ {
+ return async_initiate<AcceptToken, void (asio::error_code)>(
+ initiate_async_accept(this), token,
&peer, static_cast<endpoint_type*>(0));
}
@@ -1452,29 +1472,35 @@ public:
/// Start an asynchronous accept.
/**
* This function is used to asynchronously accept a new connection into a
- * socket, and additionally obtain the endpoint of the remote peer. The
- * function call always returns immediately.
+ * socket, and additionally obtain the endpoint of the remote peer. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* @param peer The socket into which the new connection will be accepted.
* Ownership of the peer object is retained by the caller, which must
- * guarantee that it is valid until the handler is called.
+ * guarantee that it is valid until the completion handler is called.
*
* @param peer_endpoint An endpoint object into which the endpoint of the
* remote peer will be written. Ownership of the peer_endpoint object is
* retained by the caller, which must guarantee that it is valid until the
* handler is called.
*
- * @param handler The handler to be called when the accept operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the accept completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
+ *
* @par Per-Operation Cancellation
* On POSIX or Windows operating systems, this asynchronous operation supports
* cancellation for the following asio::cancellation_type values:
@@ -1487,20 +1513,19 @@ public:
*/
template <typename Executor1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- AcceptHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(AcceptHandler,
- void (asio::error_code))
- async_accept(basic_socket<protocol_type, Executor1>& peer,
+ AcceptToken = default_completion_token_t<executor_type>>
+ auto async_accept(basic_socket<protocol_type, Executor1>& peer,
endpoint_type& peer_endpoint,
- ASIO_MOVE_ARG(AcceptHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ AcceptToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<AcceptToken, void (asio::error_code)>(
+ declval<initiate_async_accept>(), token, &peer, &peer_endpoint))
{
- return async_initiate<AcceptHandler, void (asio::error_code)>(
- initiate_async_accept(this), handler, &peer, &peer_endpoint);
+ return async_initiate<AcceptToken, void (asio::error_code)>(
+ initiate_async_accept(this), token, &peer, &peer_endpoint);
}
#endif // !defined(ASIO_NO_EXTENSIONS)
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Accept a new connection.
/**
* This function is used to accept a new connection from a peer. The function
@@ -1568,27 +1593,36 @@ public:
/// Start an asynchronous accept.
/**
- * This function is used to asynchronously accept a new connection. The
- * function call always returns immediately.
+ * This function is used to asynchronously accept a new connection. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* This overload requires that the Protocol template parameter satisfy the
* AcceptableProtocol type requirements.
*
- * @param handler The handler to be called when the accept operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the accept completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
+ *
* // On success, the newly accepted socket.
* typename Protocol::socket::template
* rebind_executor<executor_type>::other peer
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code,
+ * typename Protocol::socket::template
+ * rebind_executor<executor_type>::other)) @endcode
+ *
* @par Example
* @code
* void accept_handler(const asio::error_code& error,
@@ -1620,20 +1654,23 @@ public:
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
typename Protocol::socket::template rebind_executor<
- executor_type>::other)) MoveAcceptHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler,
- void (asio::error_code,
- typename Protocol::socket::template
- rebind_executor<executor_type>::other))
- async_accept(
- ASIO_MOVE_ARG(MoveAcceptHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<MoveAcceptHandler,
+ executor_type>::other)) MoveAcceptToken
+ = default_completion_token_t<executor_type>>
+ auto async_accept(
+ MoveAcceptToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<MoveAcceptToken,
+ void (asio::error_code, typename Protocol::socket::template
+ rebind_executor<executor_type>::other)>(
+ declval<initiate_async_move_accept>(), token,
+ declval<const executor_type&>(), static_cast<endpoint_type*>(0),
+ static_cast<typename Protocol::socket::template
+ rebind_executor<executor_type>::other*>(0)))
+ {
+ return async_initiate<MoveAcceptToken,
void (asio::error_code, typename Protocol::socket::template
rebind_executor<executor_type>::other)>(
- initiate_async_move_accept(this), handler,
+ initiate_async_move_accept(this), token,
impl_.get_executor(), static_cast<endpoint_type*>(0),
static_cast<typename Protocol::socket::template
rebind_executor<executor_type>::other*>(0));
@@ -1665,10 +1702,10 @@ public:
template <typename Executor1>
typename Protocol::socket::template rebind_executor<Executor1>::other
accept(const Executor1& ex,
- typename constraint<
+ constraint_t<
is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value
- >::type = 0)
+ > = 0)
{
asio::error_code ec;
typename Protocol::socket::template
@@ -1705,9 +1742,9 @@ public:
typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other
accept(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
{
asio::error_code ec;
typename Protocol::socket::template rebind_executor<
@@ -1748,10 +1785,10 @@ public:
template <typename Executor1>
typename Protocol::socket::template rebind_executor<Executor1>::other
accept(const Executor1& ex, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value
- >::type = 0)
+ > = 0)
{
typename Protocol::socket::template
rebind_executor<Executor1>::other peer(ex);
@@ -1791,9 +1828,9 @@ public:
typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other
accept(ExecutionContext& context, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
{
typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other peer(context);
@@ -1803,8 +1840,9 @@ public:
/// Start an asynchronous accept.
/**
- * This function is used to asynchronously accept a new connection. The
- * function call always returns immediately.
+ * This function is used to asynchronously accept a new connection. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* This overload requires that the Protocol template parameter satisfy the
* AcceptableProtocol type requirements.
@@ -1812,19 +1850,29 @@ public:
* @param ex The I/O executor object to be used for the newly accepted
* socket.
*
- * @param handler The handler to be called when the accept operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the accept completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
+ *
+ * // On success, the newly accepted socket.
* typename Protocol::socket::template rebind_executor<
- * Executor1>::other peer // On success, the newly accepted socket.
+ * Executor1>::other peer
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code,
+ * typename Protocol::socket::template rebind_executor<
+ * Executor1>::other)) @endcode
+ *
* @par Example
* @code
* void accept_handler(const asio::error_code& error,
@@ -1856,34 +1904,41 @@ public:
template <typename Executor1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
typename Protocol::socket::template rebind_executor<
- Executor1>::other)) MoveAcceptHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler,
- void (asio::error_code,
- typename Protocol::socket::template rebind_executor<
- Executor1>::other))
- async_accept(const Executor1& ex,
- ASIO_MOVE_ARG(MoveAcceptHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
- typename constraint<
+ constraint_t<is_executor<Executor1>::value
+ || execution::is_executor<Executor1>::value,
+ Executor1>>::other)) MoveAcceptToken
+ = default_completion_token_t<executor_type>>
+ auto async_accept(const Executor1& ex,
+ MoveAcceptToken&& token = default_completion_token_t<executor_type>(),
+ constraint_t<
is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value
- >::type = 0)
- {
- typedef typename Protocol::socket::template rebind_executor<
- Executor1>::other other_socket_type;
-
- return async_initiate<MoveAcceptHandler,
- void (asio::error_code, other_socket_type)>(
- initiate_async_move_accept(this), handler,
- ex, static_cast<endpoint_type*>(0),
- static_cast<other_socket_type*>(0));
+ > = 0)
+ -> decltype(
+ async_initiate<MoveAcceptToken,
+ void (asio::error_code,
+ typename Protocol::socket::template rebind_executor<
+ Executor1>::other)>(
+ declval<initiate_async_move_accept>(), token,
+ ex, static_cast<endpoint_type*>(0),
+ static_cast<typename Protocol::socket::template
+ rebind_executor<Executor1>::other*>(0)))
+ {
+ return async_initiate<MoveAcceptToken,
+ void (asio::error_code,
+ typename Protocol::socket::template rebind_executor<
+ Executor1>::other)>(
+ initiate_async_move_accept(this), token,
+ ex, static_cast<endpoint_type*>(0),
+ static_cast<typename Protocol::socket::template
+ rebind_executor<Executor1>::other*>(0));
}
/// Start an asynchronous accept.
/**
- * This function is used to asynchronously accept a new connection. The
- * function call always returns immediately.
+ * This function is used to asynchronously accept a new connection. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* This overload requires that the Protocol template parameter satisfy the
* AcceptableProtocol type requirements.
@@ -1891,20 +1946,29 @@ public:
* @param context The I/O execution context object to be used for the newly
* accepted socket.
*
- * @param handler The handler to be called when the accept operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the accept completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
+ *
+ * // On success, the newly accepted socket.
* typename Protocol::socket::template rebind_executor<
* typename ExecutionContext::executor_type>::other peer
- * // On success, the newly accepted socket.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code,
+ * typename Protocol::socket::template rebind_executor<
+ * typename ExecutionContext::executor_type>::other)) @endcode
+ *
* @par Example
* @code
* void accept_handler(const asio::error_code& error,
@@ -1936,27 +2000,31 @@ public:
template <typename ExecutionContext,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
typename Protocol::socket::template rebind_executor<
- typename ExecutionContext::executor_type>::other)) MoveAcceptHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler,
+ typename ExecutionContext::executor_type>::other)) MoveAcceptToken
+ = default_completion_token_t<executor_type>>
+ auto async_accept(ExecutionContext& context,
+ MoveAcceptToken&& token = default_completion_token_t<executor_type>(),
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ -> decltype(
+ async_initiate<MoveAcceptToken,
+ void (asio::error_code,
+ typename Protocol::socket::template rebind_executor<
+ typename ExecutionContext::executor_type>::other)>(
+ declval<initiate_async_move_accept>(), token,
+ context.get_executor(), static_cast<endpoint_type*>(0),
+ static_cast<typename Protocol::socket::template rebind_executor<
+ typename ExecutionContext::executor_type>::other*>(0)))
+ {
+ return async_initiate<MoveAcceptToken,
void (asio::error_code,
typename Protocol::socket::template rebind_executor<
- typename ExecutionContext::executor_type>::other))
- async_accept(ExecutionContext& context,
- ASIO_MOVE_ARG(MoveAcceptHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
- typename constraint<
- is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
- {
- typedef typename Protocol::socket::template rebind_executor<
- typename ExecutionContext::executor_type>::other other_socket_type;
-
- return async_initiate<MoveAcceptHandler,
- void (asio::error_code, other_socket_type)>(
- initiate_async_move_accept(this), handler,
- context.get_executor(), static_cast<endpoint_type*>(0),
- static_cast<other_socket_type*>(0));
+ typename ExecutionContext::executor_type>::other)>(
+ initiate_async_move_accept(this), token,
+ context.get_executor(), static_cast<endpoint_type*>(0),
+ static_cast<typename Protocol::socket::template rebind_executor<
+ typename ExecutionContext::executor_type>::other*>(0));
}
/// Accept a new connection.
@@ -2036,8 +2104,9 @@ public:
/// Start an asynchronous accept.
/**
- * This function is used to asynchronously accept a new connection. The
- * function call always returns immediately.
+ * This function is used to asynchronously accept a new connection. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* This overload requires that the Protocol template parameter satisfy the
* AcceptableProtocol type requirements.
@@ -2045,23 +2114,31 @@ public:
* @param peer_endpoint An endpoint object into which the endpoint of the
* remote peer will be written. Ownership of the peer_endpoint object is
* retained by the caller, which must guarantee that it is valid until the
- * handler is called.
+ * completion handler is called.
*
- * @param handler The handler to be called when the accept operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the accept completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
+ *
* // On success, the newly accepted socket.
* typename Protocol::socket::template
* rebind_executor<executor_type>::other peer
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code,
+ * typename Protocol::socket::template
+ * rebind_executor<executor_type>::other)) @endcode
+ *
* @par Example
* @code
* void accept_handler(const asio::error_code& error,
@@ -2094,20 +2171,23 @@ public:
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
typename Protocol::socket::template rebind_executor<
- executor_type>::other)) MoveAcceptHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler,
- void (asio::error_code,
- typename Protocol::socket::template
- rebind_executor<executor_type>::other))
- async_accept(endpoint_type& peer_endpoint,
- ASIO_MOVE_ARG(MoveAcceptHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<MoveAcceptHandler,
+ executor_type>::other)) MoveAcceptToken
+ = default_completion_token_t<executor_type>>
+ auto async_accept(endpoint_type& peer_endpoint,
+ MoveAcceptToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<MoveAcceptToken,
+ void (asio::error_code, typename Protocol::socket::template
+ rebind_executor<executor_type>::other)>(
+ declval<initiate_async_move_accept>(), token,
+ declval<const executor_type&>(), &peer_endpoint,
+ static_cast<typename Protocol::socket::template
+ rebind_executor<executor_type>::other*>(0)))
+ {
+ return async_initiate<MoveAcceptToken,
void (asio::error_code, typename Protocol::socket::template
rebind_executor<executor_type>::other)>(
- initiate_async_move_accept(this), handler,
+ initiate_async_move_accept(this), token,
impl_.get_executor(), &peer_endpoint,
static_cast<typename Protocol::socket::template
rebind_executor<executor_type>::other*>(0));
@@ -2144,10 +2224,10 @@ public:
template <typename Executor1>
typename Protocol::socket::template rebind_executor<Executor1>::other
accept(const Executor1& ex, endpoint_type& peer_endpoint,
- typename constraint<
+ constraint_t<
is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value
- >::type = 0)
+ > = 0)
{
asio::error_code ec;
typename Protocol::socket::template
@@ -2190,9 +2270,9 @@ public:
typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other
accept(ExecutionContext& context, endpoint_type& peer_endpoint,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
{
asio::error_code ec;
typename Protocol::socket::template rebind_executor<
@@ -2240,10 +2320,10 @@ public:
typename Protocol::socket::template rebind_executor<Executor1>::other
accept(const executor_type& ex,
endpoint_type& peer_endpoint, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value
- >::type = 0)
+ > = 0)
{
typename Protocol::socket::template
rebind_executor<Executor1>::other peer(ex);
@@ -2290,9 +2370,9 @@ public:
typename ExecutionContext::executor_type>::other
accept(ExecutionContext& context,
endpoint_type& peer_endpoint, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
{
typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other peer(context);
@@ -2303,8 +2383,9 @@ public:
/// Start an asynchronous accept.
/**
- * This function is used to asynchronously accept a new connection. The
- * function call always returns immediately.
+ * This function is used to asynchronously accept a new connection. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* This overload requires that the Protocol template parameter satisfy the
* AcceptableProtocol type requirements.
@@ -2315,21 +2396,31 @@ public:
* @param peer_endpoint An endpoint object into which the endpoint of the
* remote peer will be written. Ownership of the peer_endpoint object is
* retained by the caller, which must guarantee that it is valid until the
- * handler is called.
+ * completion handler is called.
*
- * @param handler The handler to be called when the accept operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the accept completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
+ *
+ * // On success, the newly accepted socket.
* typename Protocol::socket::template rebind_executor<
- * Executor1>::other peer // On success, the newly accepted socket.
+ * Executor1>::other peer
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code,
+ * typename Protocol::socket::template rebind_executor<
+ * Executor1>::other)) @endcode
+ *
* @par Example
* @code
* void accept_handler(const asio::error_code& error,
@@ -2362,34 +2453,39 @@ public:
template <typename Executor1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
typename Protocol::socket::template rebind_executor<
- Executor1>::other)) MoveAcceptHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler,
- void (asio::error_code,
- typename Protocol::socket::template rebind_executor<
- Executor1>::other))
- async_accept(const Executor1& ex, endpoint_type& peer_endpoint,
- ASIO_MOVE_ARG(MoveAcceptHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
- typename constraint<
+ constraint_t<is_executor<Executor1>::value
+ || execution::is_executor<Executor1>::value,
+ Executor1>>::other)) MoveAcceptToken
+ = default_completion_token_t<executor_type>>
+ auto async_accept(const Executor1& ex, endpoint_type& peer_endpoint,
+ MoveAcceptToken&& token = default_completion_token_t<executor_type>(),
+ constraint_t<
is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value
- >::type = 0)
+ > = 0)
+ -> decltype(
+ async_initiate<MoveAcceptToken,
+ void (asio::error_code,
+ typename Protocol::socket::template rebind_executor<
+ Executor1>::other)>(
+ declval<initiate_async_move_accept>(), token, ex, &peer_endpoint,
+ static_cast<typename Protocol::socket::template
+ rebind_executor<Executor1>::other*>(0)))
{
- typedef typename Protocol::socket::template rebind_executor<
- Executor1>::other other_socket_type;
-
- return async_initiate<MoveAcceptHandler,
- void (asio::error_code, other_socket_type)>(
- initiate_async_move_accept(this), handler,
- ex, &peer_endpoint,
- static_cast<other_socket_type*>(0));
+ return async_initiate<MoveAcceptToken,
+ void (asio::error_code,
+ typename Protocol::socket::template rebind_executor<
+ Executor1>::other)>(
+ initiate_async_move_accept(this), token, ex, &peer_endpoint,
+ static_cast<typename Protocol::socket::template
+ rebind_executor<Executor1>::other*>(0));
}
/// Start an asynchronous accept.
/**
- * This function is used to asynchronously accept a new connection. The
- * function call always returns immediately.
+ * This function is used to asynchronously accept a new connection. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* This overload requires that the Protocol template parameter satisfy the
* AcceptableProtocol type requirements.
@@ -2400,22 +2496,31 @@ public:
* @param peer_endpoint An endpoint object into which the endpoint of the
* remote peer will be written. Ownership of the peer_endpoint object is
* retained by the caller, which must guarantee that it is valid until the
- * handler is called.
+ * completion handler is called.
*
- * @param handler The handler to be called when the accept operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the accept completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
+ *
+ * // On success, the newly accepted socket.
* typename Protocol::socket::template rebind_executor<
* typename ExecutionContext::executor_type>::other peer
- * // On success, the newly accepted socket.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code,
+ * typename Protocol::socket::template rebind_executor<
+ * typename ExecutionContext::executor_type>::other)) @endcode
+ *
* @par Example
* @code
* void accept_handler(const asio::error_code& error,
@@ -2448,36 +2553,38 @@ public:
template <typename ExecutionContext,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
typename Protocol::socket::template rebind_executor<
- typename ExecutionContext::executor_type>::other)) MoveAcceptHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(MoveAcceptHandler,
+ typename ExecutionContext::executor_type>::other)) MoveAcceptToken
+ = default_completion_token_t<executor_type>>
+ auto async_accept(ExecutionContext& context, endpoint_type& peer_endpoint,
+ MoveAcceptToken&& token = default_completion_token_t<executor_type>(),
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ -> decltype(
+ async_initiate<MoveAcceptToken,
+ void (asio::error_code,
+ typename Protocol::socket::template rebind_executor<
+ typename ExecutionContext::executor_type>::other)>(
+ declval<initiate_async_move_accept>(), token,
+ context.get_executor(), &peer_endpoint,
+ static_cast<typename Protocol::socket::template rebind_executor<
+ typename ExecutionContext::executor_type>::other*>(0)))
+ {
+ return async_initiate<MoveAcceptToken,
void (asio::error_code,
typename Protocol::socket::template rebind_executor<
- typename ExecutionContext::executor_type>::other))
- async_accept(ExecutionContext& context,
- endpoint_type& peer_endpoint,
- ASIO_MOVE_ARG(MoveAcceptHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
- typename constraint<
- is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
- {
- typedef typename Protocol::socket::template rebind_executor<
- typename ExecutionContext::executor_type>::other other_socket_type;
-
- return async_initiate<MoveAcceptHandler,
- void (asio::error_code, other_socket_type)>(
- initiate_async_move_accept(this), handler,
- context.get_executor(), &peer_endpoint,
- static_cast<other_socket_type*>(0));
+ typename ExecutionContext::executor_type>::other)>(
+ initiate_async_move_accept(this), token,
+ context.get_executor(), &peer_endpoint,
+ static_cast<typename Protocol::socket::template rebind_executor<
+ typename ExecutionContext::executor_type>::other*>(0));
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
private:
// Disallow copying and assignment.
- basic_socket_acceptor(const basic_socket_acceptor&) ASIO_DELETED;
+ basic_socket_acceptor(const basic_socket_acceptor&) = delete;
basic_socket_acceptor& operator=(
- const basic_socket_acceptor&) ASIO_DELETED;
+ const basic_socket_acceptor&) = delete;
class initiate_async_wait
{
@@ -2489,13 +2596,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WaitHandler>
- void operator()(ASIO_MOVE_ARG(WaitHandler) handler, wait_type w) const
+ void operator()(WaitHandler&& handler, wait_type w) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WaitHandler.
@@ -2521,13 +2628,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename AcceptHandler, typename Protocol1, typename Executor1>
- void operator()(ASIO_MOVE_ARG(AcceptHandler) handler,
+ void operator()(AcceptHandler&& handler,
basic_socket<Protocol1, Executor1>* peer,
endpoint_type* peer_endpoint) const
{
@@ -2555,13 +2662,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename MoveAcceptHandler, typename Executor1, typename Socket>
- void operator()(ASIO_MOVE_ARG(MoveAcceptHandler) handler,
+ void operator()(MoveAcceptHandler&& handler,
const Executor1& peer_ex, endpoint_type* peer_endpoint, Socket*) const
{
// If you get an error on the following line it means that your handler
@@ -2585,6 +2692,9 @@ private:
#elif defined(ASIO_HAS_IOCP)
detail::io_object_impl<
detail::win_iocp_socket_service<Protocol>, Executor> impl_;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ detail::io_object_impl<
+ detail::io_uring_socket_service<Protocol>, Executor> impl_;
#else
detail::io_object_impl<
detail::reactive_socket_service<Protocol>, Executor> impl_;
diff --git a/3rdparty/asio/include/asio/basic_socket_iostream.hpp b/3rdparty/asio/include/asio/basic_socket_iostream.hpp
index b6fd88880de..902898d9502 100644
--- a/3rdparty/asio/include/asio/basic_socket_iostream.hpp
+++ b/3rdparty/asio/include/asio/basic_socket_iostream.hpp
@@ -2,7 +2,7 @@
// basic_socket_iostream.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,55 +23,6 @@
#include <ostream>
#include "asio/basic_socket_streambuf.hpp"
-#if !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-# include "asio/detail/variadic_templates.hpp"
-
-// A macro that should expand to:
-// template <typename T1, ..., typename Tn>
-// explicit basic_socket_iostream(T1 x1, ..., Tn xn)
-// : std::basic_iostream<char>(
-// &this->detail::socket_iostream_base<
-// Protocol, Clock, WaitTraits>::streambuf_)
-// {
-// if (rdbuf()->connect(x1, ..., xn) == 0)
-// this->setstate(std::ios_base::failbit);
-// }
-// This macro should only persist within this file.
-
-# define ASIO_PRIVATE_CTR_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- explicit basic_socket_iostream(ASIO_VARIADIC_BYVAL_PARAMS(n)) \
- : std::basic_iostream<char>( \
- &this->detail::socket_iostream_base< \
- Protocol, Clock, WaitTraits>::streambuf_) \
- { \
- this->setf(std::ios_base::unitbuf); \
- if (rdbuf()->connect(ASIO_VARIADIC_BYVAL_ARGS(n)) == 0) \
- this->setstate(std::ios_base::failbit); \
- } \
- /**/
-
-// A macro that should expand to:
-// template <typename T1, ..., typename Tn>
-// void connect(T1 x1, ..., Tn xn)
-// {
-// if (rdbuf()->connect(x1, ..., xn) == 0)
-// this->setstate(std::ios_base::failbit);
-// }
-// This macro should only persist within this file.
-
-# define ASIO_PRIVATE_CONNECT_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- void connect(ASIO_VARIADIC_BYVAL_PARAMS(n)) \
- { \
- if (rdbuf()->connect(ASIO_VARIADIC_BYVAL_ARGS(n)) == 0) \
- this->setstate(std::ios_base::failbit); \
- } \
- /**/
-
-#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -87,7 +38,6 @@ protected:
{
}
-#if defined(ASIO_HAS_MOVE)
socket_iostream_base(socket_iostream_base&& other)
: streambuf_(std::move(other.streambuf_))
{
@@ -103,7 +53,6 @@ protected:
streambuf_ = std::move(other.streambuf_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
basic_socket_streambuf<Protocol, Clock, WaitTraits> streambuf_;
};
@@ -118,11 +67,11 @@ template <typename Protocol,
#if defined(ASIO_HAS_BOOST_DATE_TIME) \
&& defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM)
typename Clock = boost::posix_time::ptime,
- typename WaitTraits = time_traits<Clock> >
+ typename WaitTraits = time_traits<Clock>>
#else // defined(ASIO_HAS_BOOST_DATE_TIME)
// && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM)
typename Clock = chrono::steady_clock,
- typename WaitTraits = wait_traits<Clock> >
+ typename WaitTraits = wait_traits<Clock>>
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
// && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM)
class basic_socket_iostream;
@@ -133,7 +82,7 @@ class basic_socket_iostream;
#if defined(GENERATING_DOCUMENTATION)
template <typename Protocol,
typename Clock = chrono::steady_clock,
- typename WaitTraits = wait_traits<Clock> >
+ typename WaitTraits = wait_traits<Clock>>
#else // defined(GENERATING_DOCUMENTATION)
template <typename Protocol, typename Clock, typename WaitTraits>
#endif // defined(GENERATING_DOCUMENTATION)
@@ -193,7 +142,6 @@ public:
this->setf(std::ios_base::unitbuf);
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Construct a basic_socket_iostream from the supplied socket.
explicit basic_socket_iostream(basic_stream_socket<protocol_type> s)
: detail::socket_iostream_base<
@@ -205,8 +153,6 @@ public:
this->setf(std::ios_base::unitbuf);
}
-#if defined(ASIO_HAS_STD_IOSTREAM_MOVE) \
- || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_socket_iostream from another.
basic_socket_iostream(basic_socket_iostream&& other)
: detail::socket_iostream_base<
@@ -225,20 +171,13 @@ public:
Protocol, Clock, WaitTraits>::operator=(std::move(other));
return *this;
}
-#endif // defined(ASIO_HAS_STD_IOSTREAM_MOVE)
- // || defined(GENERATING_DOCUMENTATION)
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-#if defined(GENERATING_DOCUMENTATION)
/// Establish a connection to an endpoint corresponding to a resolver query.
/**
* This constructor automatically establishes a connection based on the
* supplied resolver query parameters. The arguments are used to construct
* a resolver query object.
*/
- template <typename T1, ..., typename TN>
- explicit basic_socket_iostream(T1 t1, ..., TN tn);
-#elif defined(ASIO_HAS_VARIADIC_TEMPLATES)
template <typename... T>
explicit basic_socket_iostream(T... x)
: std::basic_iostream<char>(
@@ -249,29 +188,19 @@ public:
if (rdbuf()->connect(x...) == 0)
this->setstate(std::ios_base::failbit);
}
-#else
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CTR_DEF)
-#endif
-#if defined(GENERATING_DOCUMENTATION)
/// Establish a connection to an endpoint corresponding to a resolver query.
/**
* This function automatically establishes a connection based on the supplied
* resolver query parameters. The arguments are used to construct a resolver
* query object.
*/
- template <typename T1, ..., typename TN>
- void connect(T1 t1, ..., TN tn);
-#elif defined(ASIO_HAS_VARIADIC_TEMPLATES)
template <typename... T>
void connect(T... x)
{
if (rdbuf()->connect(x...) == 0)
this->setstate(std::ios_base::failbit);
}
-#else
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CONNECT_DEF)
-#endif
/// Close the connection.
void close()
@@ -388,20 +317,15 @@ public:
private:
// Disallow copying and assignment.
- basic_socket_iostream(const basic_socket_iostream&) ASIO_DELETED;
+ basic_socket_iostream(const basic_socket_iostream&) = delete;
basic_socket_iostream& operator=(
- const basic_socket_iostream&) ASIO_DELETED;
+ const basic_socket_iostream&) = delete;
};
} // namespace asio
#include "asio/detail/pop_options.hpp"
-#if !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-# undef ASIO_PRIVATE_CTR_DEF
-# undef ASIO_PRIVATE_CONNECT_DEF
-#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#endif // !defined(ASIO_NO_IOSTREAM)
#endif // ASIO_BASIC_SOCKET_IOSTREAM_HPP
diff --git a/3rdparty/asio/include/asio/basic_socket_streambuf.hpp b/3rdparty/asio/include/asio/basic_socket_streambuf.hpp
index 11efcce1091..e3a5f836382 100644
--- a/3rdparty/asio/include/asio/basic_socket_streambuf.hpp
+++ b/3rdparty/asio/include/asio/basic_socket_streambuf.hpp
@@ -2,7 +2,7 @@
// basic_socket_streambuf.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -37,38 +37,6 @@
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
// && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM)
-#if !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-# include "asio/detail/variadic_templates.hpp"
-
-// A macro that should expand to:
-// template <typename T1, ..., typename Tn>
-// basic_socket_streambuf* connect(T1 x1, ..., Tn xn)
-// {
-// init_buffers();
-// typedef typename Protocol::resolver resolver_type;
-// resolver_type resolver(socket().get_executor());
-// connect_to_endpoints(
-// resolver.resolve(x1, ..., xn, ec_));
-// return !ec_ ? this : 0;
-// }
-// This macro should only persist within this file.
-
-# define ASIO_PRIVATE_CONNECT_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- basic_socket_streambuf* connect(ASIO_VARIADIC_BYVAL_PARAMS(n)) \
- { \
- init_buffers(); \
- typedef typename Protocol::resolver resolver_type; \
- resolver_type resolver(socket().get_executor()); \
- connect_to_endpoints( \
- resolver.resolve(ASIO_VARIADIC_BYVAL_ARGS(n), ec_)); \
- return !ec_ ? this : 0; \
- } \
- /**/
-
-#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -116,11 +84,11 @@ template <typename Protocol,
#if defined(ASIO_HAS_BOOST_DATE_TIME) \
&& defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM)
typename Clock = boost::posix_time::ptime,
- typename WaitTraits = time_traits<Clock> >
+ typename WaitTraits = time_traits<Clock>>
#else // defined(ASIO_HAS_BOOST_DATE_TIME)
// && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM)
typename Clock = chrono::steady_clock,
- typename WaitTraits = wait_traits<Clock> >
+ typename WaitTraits = wait_traits<Clock>>
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
// && defined(ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM)
class basic_socket_streambuf;
@@ -131,7 +99,7 @@ class basic_socket_streambuf;
#if defined(GENERATING_DOCUMENTATION)
template <typename Protocol,
typename Clock = chrono::steady_clock,
- typename WaitTraits = wait_traits<Clock> >
+ typename WaitTraits = wait_traits<Clock>>
#else // defined(GENERATING_DOCUMENTATION)
template <typename Protocol, typename Clock, typename WaitTraits>
#endif // defined(GENERATING_DOCUMENTATION)
@@ -197,7 +165,6 @@ public:
init_buffers();
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Construct a basic_socket_streambuf from the supplied socket.
explicit basic_socket_streambuf(basic_stream_socket<protocol_type> s)
: detail::socket_streambuf_io_context(0),
@@ -241,7 +208,6 @@ public:
other.init_buffers();
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destructor flushes buffered data.
virtual ~basic_socket_streambuf()
@@ -265,7 +231,6 @@ public:
return !ec_ ? this : 0;
}
-#if defined(GENERATING_DOCUMENTATION)
/// Establish a connection.
/**
* This function automatically establishes a connection based on the supplied
@@ -275,9 +240,6 @@ public:
* @return \c this if a connection was successfully established, a null
* pointer otherwise.
*/
- template <typename T1, ..., typename TN>
- basic_socket_streambuf* connect(T1 t1, ..., TN tn);
-#elif defined(ASIO_HAS_VARIADIC_TEMPLATES)
template <typename... T>
basic_socket_streambuf* connect(T... x)
{
@@ -287,9 +249,6 @@ public:
connect_to_endpoints(resolver.resolve(x..., ec_));
return !ec_ ? this : 0;
}
-#else
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CONNECT_DEF)
-#endif
/// Close the connection.
/**
@@ -559,9 +518,9 @@ protected:
private:
// Disallow copying and assignment.
- basic_socket_streambuf(const basic_socket_streambuf&) ASIO_DELETED;
+ basic_socket_streambuf(const basic_socket_streambuf&) = delete;
basic_socket_streambuf& operator=(
- const basic_socket_streambuf&) ASIO_DELETED;
+ const basic_socket_streambuf&) = delete;
void init_buffers()
{
@@ -678,10 +637,6 @@ private:
#include "asio/detail/pop_options.hpp"
-#if !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-# undef ASIO_PRIVATE_CONNECT_DEF
-#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#endif // !defined(ASIO_NO_IOSTREAM)
#endif // ASIO_BASIC_SOCKET_STREAMBUF_HPP
diff --git a/3rdparty/asio/include/asio/basic_stream_file.hpp b/3rdparty/asio/include/asio/basic_stream_file.hpp
new file mode 100644
index 00000000000..4b2ca8775e5
--- /dev/null
+++ b/3rdparty/asio/include/asio/basic_stream_file.hpp
@@ -0,0 +1,744 @@
+//
+// basic_stream_file.hpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_BASIC_STREAM_FILE_HPP
+#define ASIO_BASIC_STREAM_FILE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_FILE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include <cstddef>
+#include "asio/async_result.hpp"
+#include "asio/basic_file.hpp"
+#include "asio/detail/handler_type_requirements.hpp"
+#include "asio/detail/non_const_lvalue.hpp"
+#include "asio/detail/throw_error.hpp"
+#include "asio/error.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+#if !defined(ASIO_BASIC_STREAM_FILE_FWD_DECL)
+#define ASIO_BASIC_STREAM_FILE_FWD_DECL
+
+// Forward declaration with defaulted arguments.
+template <typename Executor = any_io_executor>
+class basic_stream_file;
+
+#endif // !defined(ASIO_BASIC_STREAM_FILE_FWD_DECL)
+
+/// Provides stream-oriented file functionality.
+/**
+ * The basic_stream_file class template provides asynchronous and blocking
+ * stream-oriented file functionality.
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe.@n
+ * @e Shared @e objects: Unsafe.
+ *
+ * @par Concepts:
+ * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream.
+ */
+template <typename Executor>
+class basic_stream_file
+ : public basic_file<Executor>
+{
+private:
+ class initiate_async_write_some;
+ class initiate_async_read_some;
+
+public:
+ /// The type of the executor associated with the object.
+ typedef Executor executor_type;
+
+ /// Rebinds the file type to another executor.
+ template <typename Executor1>
+ struct rebind_executor
+ {
+ /// The file type when rebound to the specified executor.
+ typedef basic_stream_file<Executor1> other;
+ };
+
+ /// The native representation of a file.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef typename basic_file<Executor>::native_handle_type native_handle_type;
+#endif
+
+ /// Construct a basic_stream_file without opening it.
+ /**
+ * This constructor initialises a file without opening it. The file needs to
+ * be opened before data can be read from or or written to it.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ */
+ explicit basic_stream_file(const executor_type& ex)
+ : basic_file<Executor>(ex)
+ {
+ this->impl_.get_service().set_is_stream(
+ this->impl_.get_implementation(), true);
+ }
+
+ /// Construct a basic_stream_file without opening it.
+ /**
+ * This constructor initialises a file without opening it. The file needs to
+ * be opened before data can be read from or or written to it.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ */
+ template <typename ExecutionContext>
+ explicit basic_stream_file(ExecutionContext& context,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(context)
+ {
+ this->impl_.get_service().set_is_stream(
+ this->impl_.get_implementation(), true);
+ }
+
+ /// Construct and open a basic_stream_file.
+ /**
+ * This constructor initialises and opens a file.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ basic_stream_file(const executor_type& ex,
+ const char* path, file_base::flags open_flags)
+ : basic_file<Executor>(ex)
+ {
+ asio::error_code ec;
+ this->impl_.get_service().set_is_stream(
+ this->impl_.get_implementation(), true);
+ this->impl_.get_service().open(
+ this->impl_.get_implementation(),
+ path, open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Construct and open a basic_stream_file.
+ /**
+ * This constructor initialises and opens a file.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ template <typename ExecutionContext>
+ basic_stream_file(ExecutionContext& context,
+ const char* path, file_base::flags open_flags,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(context)
+ {
+ asio::error_code ec;
+ this->impl_.get_service().set_is_stream(
+ this->impl_.get_implementation(), true);
+ this->impl_.get_service().open(
+ this->impl_.get_implementation(),
+ path, open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Construct and open a basic_stream_file.
+ /**
+ * This constructor initialises and opens a file.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ basic_stream_file(const executor_type& ex,
+ const std::string& path, file_base::flags open_flags)
+ : basic_file<Executor>(ex)
+ {
+ asio::error_code ec;
+ this->impl_.get_service().set_is_stream(
+ this->impl_.get_implementation(), true);
+ this->impl_.get_service().open(
+ this->impl_.get_implementation(),
+ path.c_str(), open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Construct and open a basic_stream_file.
+ /**
+ * This constructor initialises and opens a file.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ *
+ * @param path The path name identifying the file to be opened.
+ *
+ * @param open_flags A set of flags that determine how the file should be
+ * opened.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ template <typename ExecutionContext>
+ basic_stream_file(ExecutionContext& context,
+ const std::string& path, file_base::flags open_flags,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(context)
+ {
+ asio::error_code ec;
+ this->impl_.get_service().set_is_stream(
+ this->impl_.get_implementation(), true);
+ this->impl_.get_service().open(
+ this->impl_.get_implementation(),
+ path.c_str(), open_flags, ec);
+ asio::detail::throw_error(ec, "open");
+ }
+
+ /// Construct a basic_stream_file on an existing native file.
+ /**
+ * This constructor initialises a stream file object to hold an existing
+ * native file.
+ *
+ * @param ex The I/O executor that the file will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the file.
+ *
+ * @param native_file The new underlying file implementation.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ basic_stream_file(const executor_type& ex,
+ const native_handle_type& native_file)
+ : basic_file<Executor>(ex, native_file)
+ {
+ this->impl_.get_service().set_is_stream(
+ this->impl_.get_implementation(), true);
+ }
+
+ /// Construct a basic_stream_file on an existing native file.
+ /**
+ * This constructor initialises a stream file object to hold an existing
+ * native file.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the file will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the file.
+ *
+ * @param native_file The new underlying file implementation.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ template <typename ExecutionContext>
+ basic_stream_file(ExecutionContext& context,
+ const native_handle_type& native_file,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(context, native_file)
+ {
+ this->impl_.get_service().set_is_stream(
+ this->impl_.get_implementation(), true);
+ }
+
+ /// Move-construct a basic_stream_file from another.
+ /**
+ * This constructor moves a stream file from one object to another.
+ *
+ * @param other The other basic_stream_file object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_file(const executor_type&)
+ * constructor.
+ */
+ basic_stream_file(basic_stream_file&& other) noexcept
+ : basic_file<Executor>(std::move(other))
+ {
+ }
+
+ /// Move-assign a basic_stream_file from another.
+ /**
+ * This assignment operator moves a stream file from one object to another.
+ *
+ * @param other The other basic_stream_file object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_file(const executor_type&)
+ * constructor.
+ */
+ basic_stream_file& operator=(basic_stream_file&& other)
+ {
+ basic_file<Executor>::operator=(std::move(other));
+ return *this;
+ }
+
+ /// Move-construct a basic_stream_file from a file of another executor
+ /// type.
+ /**
+ * This constructor moves a stream file from one object to another.
+ *
+ * @param other The other basic_stream_file object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_file(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ basic_stream_file(basic_stream_file<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_file<Executor>(std::move(other))
+ {
+ }
+
+ /// Move-assign a basic_stream_file from a file of another executor type.
+ /**
+ * This assignment operator moves a stream file from one object to another.
+ *
+ * @param other The other basic_stream_file object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_file(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_stream_file&
+ > operator=(basic_stream_file<Executor1>&& other)
+ {
+ basic_file<Executor>::operator=(std::move(other));
+ return *this;
+ }
+
+ /// Destroys the file.
+ /**
+ * This function destroys the file, cancelling any outstanding asynchronous
+ * operations associated with the file as if by calling @c cancel.
+ */
+ ~basic_stream_file()
+ {
+ }
+
+ /// Seek to a position in the file.
+ /**
+ * This function updates the current position in the file.
+ *
+ * @param offset The requested position in the file, relative to @c whence.
+ *
+ * @param whence One of @c seek_set, @c seek_cur or @c seek_end.
+ *
+ * @returns The new position relative to the beginning of the file.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ uint64_t seek(int64_t offset, file_base::seek_basis whence)
+ {
+ asio::error_code ec;
+ uint64_t n = this->impl_.get_service().seek(
+ this->impl_.get_implementation(), offset, whence, ec);
+ asio::detail::throw_error(ec, "seek");
+ return n;
+ }
+
+ /// Seek to a position in the file.
+ /**
+ * This function updates the current position in the file.
+ *
+ * @param offset The requested position in the file, relative to @c whence.
+ *
+ * @param whence One of @c seek_set, @c seek_cur or @c seek_end.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The new position relative to the beginning of the file.
+ */
+ uint64_t seek(int64_t offset, file_base::seek_basis whence,
+ asio::error_code& ec)
+ {
+ return this->impl_.get_service().seek(
+ this->impl_.get_implementation(), offset, whence, ec);
+ }
+
+ /// Write some data to the file.
+ /**
+ * This function is used to write data to the stream file. The function call
+ * will block until one or more bytes of the data has been written
+ * successfully, or until an error occurs.
+ *
+ * @param buffers One or more data buffers to be written to the file.
+ *
+ * @returns The number of bytes written.
+ *
+ * @throws asio::system_error Thrown on failure. An error code of
+ * asio::error::eof indicates that the end of the file was reached.
+ *
+ * @note The write_some operation may not transmit all of the data to the
+ * peer. Consider using the @ref write function if you need to ensure that
+ * all data is written before the blocking operation completes.
+ *
+ * @par Example
+ * To write a single data buffer use the @ref buffer function as follows:
+ * @code
+ * file.write_some(asio::buffer(data, size));
+ * @endcode
+ * See the @ref buffer documentation for information on writing multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename ConstBufferSequence>
+ std::size_t write_some(const ConstBufferSequence& buffers)
+ {
+ asio::error_code ec;
+ std::size_t s = this->impl_.get_service().write_some(
+ this->impl_.get_implementation(), buffers, ec);
+ asio::detail::throw_error(ec, "write_some");
+ return s;
+ }
+
+ /// Write some data to the file.
+ /**
+ * This function is used to write data to the stream file. The function call
+ * will block until one or more bytes of the data has been written
+ * successfully, or until an error occurs.
+ *
+ * @param buffers One or more data buffers to be written to the file.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes written. Returns 0 if an error occurred.
+ *
+ * @note The write_some operation may not transmit all of the data to the
+ * peer. Consider using the @ref write function if you need to ensure that
+ * all data is written before the blocking operation completes.
+ */
+ template <typename ConstBufferSequence>
+ std::size_t write_some(const ConstBufferSequence& buffers,
+ asio::error_code& ec)
+ {
+ return this->impl_.get_service().write_some(
+ this->impl_.get_implementation(), buffers, ec);
+ }
+
+ /// Start an asynchronous write.
+ /**
+ * This function is used to asynchronously write data to the stream file.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
+ *
+ * @param buffers One or more data buffers to be written to the file.
+ * Although the buffers object may be copied as necessary, ownership of the
+ * underlying memory blocks is retained by the caller, which must guarantee
+ * that they remain valid until the completion handler is called.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
+ * @code void handler(
+ * const asio::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Number of bytes written.
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
+ * @note The write operation may not transmit all of the data to the peer.
+ * Consider using the @ref async_write function if you need to ensure that all
+ * data is written before the asynchronous operation completes.
+ *
+ * @par Example
+ * To write a single data buffer use the @ref buffer function as follows:
+ * @code
+ * file.async_write_some(asio::buffer(data, size), handler);
+ * @endcode
+ * See the @ref buffer documentation for information on writing multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ *
+ * @par Per-Operation Cancellation
+ * On POSIX or Windows operating systems, this asynchronous operation supports
+ * cancellation for the following asio::cancellation_type values:
+ *
+ * @li @c cancellation_type::terminal
+ *
+ * @li @c cancellation_type::partial
+ *
+ * @li @c cancellation_type::total
+ */
+ template <typename ConstBufferSequence,
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_write_some>(), token, buffers))
+ {
+ return async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ initiate_async_write_some(this), token, buffers);
+ }
+
+ /// Read some data from the file.
+ /**
+ * This function is used to read data from the stream file. The function
+ * call will block until one or more bytes of data has been read successfully,
+ * or until an error occurs.
+ *
+ * @param buffers One or more buffers into which the data will be read.
+ *
+ * @returns The number of bytes read.
+ *
+ * @throws asio::system_error Thrown on failure. An error code of
+ * asio::error::eof indicates that the end of the file was reached.
+ *
+ * @note The read_some operation may not read all of the requested number of
+ * bytes. Consider using the @ref read function if you need to ensure that
+ * the requested amount of data is read before the blocking operation
+ * completes.
+ *
+ * @par Example
+ * To read into a single data buffer use the @ref buffer function as follows:
+ * @code
+ * file.read_some(asio::buffer(data, size));
+ * @endcode
+ * See the @ref buffer documentation for information on reading into multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename MutableBufferSequence>
+ std::size_t read_some(const MutableBufferSequence& buffers)
+ {
+ asio::error_code ec;
+ std::size_t s = this->impl_.get_service().read_some(
+ this->impl_.get_implementation(), buffers, ec);
+ asio::detail::throw_error(ec, "read_some");
+ return s;
+ }
+
+ /// Read some data from the file.
+ /**
+ * This function is used to read data from the stream file. The function
+ * call will block until one or more bytes of data has been read successfully,
+ * or until an error occurs.
+ *
+ * @param buffers One or more buffers into which the data will be read.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes read. Returns 0 if an error occurred.
+ *
+ * @note The read_some operation may not read all of the requested number of
+ * bytes. Consider using the @ref read function if you need to ensure that
+ * the requested amount of data is read before the blocking operation
+ * completes.
+ */
+ template <typename MutableBufferSequence>
+ std::size_t read_some(const MutableBufferSequence& buffers,
+ asio::error_code& ec)
+ {
+ return this->impl_.get_service().read_some(
+ this->impl_.get_implementation(), buffers, ec);
+ }
+
+ /// Start an asynchronous read.
+ /**
+ * This function is used to asynchronously read data from the stream file.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
+ *
+ * @param buffers One or more buffers into which the data will be read.
+ * Although the buffers object may be copied as necessary, ownership of the
+ * underlying memory blocks is retained by the caller, which must guarantee
+ * that they remain valid until the completion handler is called.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
+ * @code void handler(
+ * const asio::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Number of bytes read.
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
+ * @note The read operation may not read all of the requested number of bytes.
+ * Consider using the @ref async_read function if you need to ensure that the
+ * requested amount of data is read before the asynchronous operation
+ * completes.
+ *
+ * @par Example
+ * To read into a single data buffer use the @ref buffer function as follows:
+ * @code
+ * file.async_read_some(asio::buffer(data, size), handler);
+ * @endcode
+ * See the @ref buffer documentation for information on reading into multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ *
+ * @par Per-Operation Cancellation
+ * On POSIX or Windows operating systems, this asynchronous operation supports
+ * cancellation for the following asio::cancellation_type values:
+ *
+ * @li @c cancellation_type::terminal
+ *
+ * @li @c cancellation_type::partial
+ *
+ * @li @c cancellation_type::total
+ */
+ template <typename MutableBufferSequence,
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_read_some>(), token, buffers))
+ {
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ initiate_async_read_some(this), token, buffers);
+ }
+
+private:
+ // Disallow copying and assignment.
+ basic_stream_file(const basic_stream_file&) = delete;
+ basic_stream_file& operator=(const basic_stream_file&) = delete;
+
+ class initiate_async_write_some
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_write_some(basic_stream_file* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename WriteHandler, typename ConstBufferSequence>
+ void operator()(WriteHandler&& handler,
+ const ConstBufferSequence& buffers) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a WriteHandler.
+ ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
+
+ detail::non_const_lvalue<WriteHandler> handler2(handler);
+ self_->impl_.get_service().async_write_some(
+ self_->impl_.get_implementation(), buffers,
+ handler2.value, self_->impl_.get_executor());
+ }
+
+ private:
+ basic_stream_file* self_;
+ };
+
+ class initiate_async_read_some
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_read_some(basic_stream_file* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename ReadHandler, typename MutableBufferSequence>
+ void operator()(ReadHandler&& handler,
+ const MutableBufferSequence& buffers) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a ReadHandler.
+ ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
+
+ detail::non_const_lvalue<ReadHandler> handler2(handler);
+ self_->impl_.get_service().async_read_some(
+ self_->impl_.get_implementation(), buffers,
+ handler2.value, self_->impl_.get_executor());
+ }
+
+ private:
+ basic_stream_file* self_;
+ };
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_FILE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_BASIC_STREAM_FILE_HPP
diff --git a/3rdparty/asio/include/asio/basic_stream_socket.hpp b/3rdparty/asio/include/asio/basic_stream_socket.hpp
index 5b573849333..e3a79450037 100644
--- a/3rdparty/asio/include/asio/basic_stream_socket.hpp
+++ b/3rdparty/asio/include/asio/basic_stream_socket.hpp
@@ -2,7 +2,7 @@
// basic_stream_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -46,11 +46,12 @@ class basic_stream_socket;
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*
- * Synchronous @c send, @c receive, and @c connect operations are thread safe
- * with respect to each other, if the underlying operating system calls are
- * also thread safe. This means that it is permitted to perform concurrent
- * calls to these synchronous operations on a single socket object. Other
- * synchronous operations, such as @c open or @c close, are not thread safe.
+ * Synchronous @c send, @c receive, @c connect, and @c shutdown operations are
+ * thread safe with respect to each other, if the underlying operating system
+ * calls are also thread safe. This means that it is permitted to perform
+ * concurrent calls to these synchronous operations on a single socket object.
+ * Other synchronous operations, such as @c open or @c close, are not thread
+ * safe.
*
* @par Concepts:
* AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream.
@@ -59,6 +60,10 @@ template <typename Protocol, typename Executor>
class basic_stream_socket
: public basic_socket<Protocol, Executor>
{
+private:
+ class initiate_async_send;
+ class initiate_async_receive;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -111,9 +116,9 @@ public:
*/
template <typename ExecutionContext>
explicit basic_stream_socket(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context)
{
}
@@ -150,10 +155,10 @@ public:
*/
template <typename ExecutionContext>
basic_stream_socket(ExecutionContext& context, const protocol_type& protocol,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: basic_socket<Protocol, Executor>(context, protocol)
{
}
@@ -196,9 +201,9 @@ public:
*/
template <typename ExecutionContext>
basic_stream_socket(ExecutionContext& context, const endpoint_type& endpoint,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context, endpoint)
{
}
@@ -241,14 +246,13 @@ public:
template <typename ExecutionContext>
basic_stream_socket(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_socket,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(context, protocol, native_socket)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_stream_socket from another.
/**
* This constructor moves a stream socket from one object to another.
@@ -260,7 +264,7 @@ public:
* constructed using the @c basic_stream_socket(const executor_type&)
* constructor.
*/
- basic_stream_socket(basic_stream_socket&& other) ASIO_NOEXCEPT
+ basic_stream_socket(basic_stream_socket&& other) noexcept
: basic_socket<Protocol, Executor>(std::move(other))
{
}
@@ -296,10 +300,10 @@ public:
*/
template <typename Protocol1, typename Executor1>
basic_stream_socket(basic_stream_socket<Protocol1, Executor1>&& other,
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value
- >::type = 0)
+ > = 0)
: basic_socket<Protocol, Executor>(std::move(other))
{
}
@@ -316,16 +320,15 @@ public:
* constructor.
*/
template <typename Protocol1, typename Executor1>
- typename constraint<
+ constraint_t<
is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value,
basic_stream_socket&
- >::type operator=(basic_stream_socket<Protocol1, Executor1>&& other)
+ > operator=(basic_stream_socket<Protocol1, Executor1>&& other)
{
basic_socket<Protocol, Executor>::operator=(std::move(other));
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destroys the socket.
/**
@@ -438,25 +441,31 @@ public:
/// Start an asynchronous send.
/**
* This function is used to asynchronously send data on the stream socket.
- * The function call always returns immediately.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
- * remain valid until the handler is called.
+ * remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The send operation may not transmit all of the data to the peer.
* Consider using the @ref async_write function if you need to ensure that all
* data is written before the asynchronous operation completes.
@@ -482,44 +491,51 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send>(), token,
+ buffers, socket_base::message_flags(0)))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send(this), handler,
+ initiate_async_send(this), token,
buffers, socket_base::message_flags(0));
}
/// Start an asynchronous send.
/**
* This function is used to asynchronously send data on the stream socket.
- * The function call always returns immediately.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
- * remain valid until the handler is called.
+ * remain valid until the completion handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
- * @param handler The handler to be called when the send operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the send completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes sent.
+ * std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The send operation may not transmit all of the data to the peer.
* Consider using the @ref async_write function if you need to ensure that all
* data is written before the asynchronous operation completes.
@@ -545,18 +561,18 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_send(const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_send(const ConstBufferSequence& buffers,
socket_base::message_flags flags,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send>(), token, buffers, flags))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send(this), handler, buffers, flags);
+ initiate_async_send(this), token, buffers, flags);
}
/// Receive some data on the socket.
@@ -667,25 +683,31 @@ public:
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive data from the stream
- * socket. The function call always returns immediately.
+ * socket. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The receive operation may not receive all of the requested number of
* bytes. Consider using the @ref async_read function if you need to ensure
* that the requested amount of data is received before the asynchronous
@@ -713,44 +735,51 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive>(), token,
+ buffers, socket_base::message_flags(0)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive(this), handler,
+ initiate_async_receive(this), token,
buffers, socket_base::message_flags(0));
}
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive data from the stream
- * socket. The function call always returns immediately.
+ * socket. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param flags Flags specifying how the receive call is to be made.
*
- * @param handler The handler to be called when the receive operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the receive completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes received.
+ * std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The receive operation may not receive all of the requested number of
* bytes. Consider using the @ref async_read function if you need to ensure
* that the requested amount of data is received before the asynchronous
@@ -778,18 +807,18 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_receive(const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_receive(const MutableBufferSequence& buffers,
socket_base::message_flags flags,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive>(), token, buffers, flags))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive(this), handler, buffers, flags);
+ initiate_async_receive(this), token, buffers, flags);
}
/// Write some data to the socket.
@@ -856,25 +885,31 @@ public:
/// Start an asynchronous write.
/**
* This function is used to asynchronously write data to the stream socket.
- * The function call always returns immediately.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more data buffers to be written to the socket.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes written.
+ * std::size_t bytes_transferred // Number of bytes written.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The write operation may not transmit all of the data to the peer.
* Consider using the @ref async_write function if you need to ensure that all
* data is written before the asynchronous operation completes.
@@ -900,17 +935,18 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_write_some(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_send>(), token,
+ buffers, socket_base::message_flags(0)))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_send(this), handler,
+ initiate_async_send(this), token,
buffers, socket_base::message_flags(0));
}
@@ -980,25 +1016,31 @@ public:
/// Start an asynchronous read.
/**
* This function is used to asynchronously read data from the stream socket.
- * The function call always returns immediately.
+ * socket. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param buffers One or more buffers into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes read.
+ * std::size_t bytes_transferred // Number of bytes read.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The read operation may not read all of the requested number of bytes.
* Consider using the @ref async_read function if you need to ensure that the
* requested amount of data is read before the asynchronous operation
@@ -1025,24 +1067,25 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_read_some(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_receive>(), token,
+ buffers, socket_base::message_flags(0)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_receive(this), handler,
+ initiate_async_receive(this), token,
buffers, socket_base::message_flags(0));
}
private:
// Disallow copying and assignment.
- basic_stream_socket(const basic_stream_socket&) ASIO_DELETED;
- basic_stream_socket& operator=(const basic_stream_socket&) ASIO_DELETED;
+ basic_stream_socket(const basic_stream_socket&) = delete;
+ basic_stream_socket& operator=(const basic_stream_socket&) = delete;
class initiate_async_send
{
@@ -1054,13 +1097,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers,
socket_base::message_flags flags) const
{
@@ -1088,13 +1131,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers,
socket_base::message_flags flags) const
{
diff --git a/3rdparty/asio/include/asio/basic_streambuf.hpp b/3rdparty/asio/include/asio/basic_streambuf.hpp
index 3e0c6e4a22e..0450811dca1 100644
--- a/3rdparty/asio/include/asio/basic_streambuf.hpp
+++ b/3rdparty/asio/include/asio/basic_streambuf.hpp
@@ -2,7 +2,7 @@
// basic_streambuf.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -103,7 +103,7 @@ namespace asio {
* @endcode
*/
#if defined(GENERATING_DOCUMENTATION)
-template <typename Allocator = std::allocator<char> >
+template <typename Allocator = std::allocator<char>>
#else
template <typename Allocator>
#endif
@@ -155,7 +155,7 @@ public:
* }
* @endcode
*/
- std::size_t size() const ASIO_NOEXCEPT
+ std::size_t size() const noexcept
{
return pptr() - gptr();
}
@@ -165,7 +165,7 @@ public:
* @returns The allowed maximum of the sum of the sizes of the input sequence
* and output sequence.
*/
- std::size_t max_size() const ASIO_NOEXCEPT
+ std::size_t max_size() const noexcept
{
return max_size_;
}
@@ -175,7 +175,7 @@ public:
* @returns The current total capacity of the streambuf, i.e. for both the
* input sequence and output sequence.
*/
- std::size_t capacity() const ASIO_NOEXCEPT
+ std::size_t capacity() const noexcept
{
return buffer_.capacity();
}
@@ -189,7 +189,7 @@ public:
* @note The returned object is invalidated by any @c basic_streambuf member
* function that modifies the input sequence or output sequence.
*/
- const_buffers_type data() const ASIO_NOEXCEPT
+ const_buffers_type data() const noexcept
{
return asio::buffer(asio::const_buffer(gptr(),
(pptr() - gptr()) * sizeof(char_type)));
@@ -361,7 +361,7 @@ private:
/// Adapts basic_streambuf to the dynamic buffer sequence type requirements.
#if defined(GENERATING_DOCUMENTATION)
-template <typename Allocator = std::allocator<char> >
+template <typename Allocator = std::allocator<char>>
#else
template <typename Allocator>
#endif
@@ -383,39 +383,37 @@ public:
}
/// Copy construct a basic_streambuf_ref.
- basic_streambuf_ref(const basic_streambuf_ref& other) ASIO_NOEXCEPT
+ basic_streambuf_ref(const basic_streambuf_ref& other) noexcept
: sb_(other.sb_)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move construct a basic_streambuf_ref.
- basic_streambuf_ref(basic_streambuf_ref&& other) ASIO_NOEXCEPT
+ basic_streambuf_ref(basic_streambuf_ref&& other) noexcept
: sb_(other.sb_)
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Get the size of the input sequence.
- std::size_t size() const ASIO_NOEXCEPT
+ std::size_t size() const noexcept
{
return sb_.size();
}
/// Get the maximum size of the dynamic buffer.
- std::size_t max_size() const ASIO_NOEXCEPT
+ std::size_t max_size() const noexcept
{
return sb_.max_size();
}
/// Get the current capacity of the dynamic buffer.
- std::size_t capacity() const ASIO_NOEXCEPT
+ std::size_t capacity() const noexcept
{
return sb_.capacity();
}
/// Get a list of buffers that represents the input sequence.
- const_buffers_type data() const ASIO_NOEXCEPT
+ const_buffers_type data() const noexcept
{
return sb_.data();
}
diff --git a/3rdparty/asio/include/asio/basic_streambuf_fwd.hpp b/3rdparty/asio/include/asio/basic_streambuf_fwd.hpp
index 5856c966466..1ff320d4637 100644
--- a/3rdparty/asio/include/asio/basic_streambuf_fwd.hpp
+++ b/3rdparty/asio/include/asio/basic_streambuf_fwd.hpp
@@ -2,7 +2,7 @@
// basic_streambuf_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,10 +23,10 @@
namespace asio {
-template <typename Allocator = std::allocator<char> >
+template <typename Allocator = std::allocator<char>>
class basic_streambuf;
-template <typename Allocator = std::allocator<char> >
+template <typename Allocator = std::allocator<char>>
class basic_streambuf_ref;
} // namespace asio
diff --git a/3rdparty/asio/include/asio/basic_waitable_timer.hpp b/3rdparty/asio/include/asio/basic_waitable_timer.hpp
index 3b9adcec7f4..5e9df3ef4f8 100644
--- a/3rdparty/asio/include/asio/basic_waitable_timer.hpp
+++ b/3rdparty/asio/include/asio/basic_waitable_timer.hpp
@@ -2,7 +2,7 @@
// basic_waitable_timer.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,6 +17,7 @@
#include "asio/detail/config.hpp"
#include <cstddef>
+#include <utility>
#include "asio/any_io_executor.hpp"
#include "asio/detail/chrono_time_traits.hpp"
#include "asio/detail/deadline_timer_service.hpp"
@@ -27,10 +28,6 @@
#include "asio/error.hpp"
#include "asio/wait_traits.hpp"
-#if defined(ASIO_HAS_MOVE)
-# include <utility>
-#endif // defined(ASIO_HAS_MOVE)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -141,6 +138,9 @@ class basic_waitable_timer;
template <typename Clock, typename WaitTraits, typename Executor>
class basic_waitable_timer
{
+private:
+ class initiate_async_wait;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -191,9 +191,9 @@ public:
*/
template <typename ExecutionContext>
explicit basic_waitable_timer(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
}
@@ -230,9 +230,9 @@ public:
template <typename ExecutionContext>
explicit basic_waitable_timer(ExecutionContext& context,
const time_point& expiry_time,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -273,9 +273,9 @@ public:
template <typename ExecutionContext>
explicit basic_waitable_timer(ExecutionContext& context,
const duration& expiry_time,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -284,7 +284,6 @@ public:
asio::detail::throw_error(ec, "expires_after");
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_waitable_timer from another.
/**
* This constructor moves a timer from one object to another.
@@ -337,9 +336,9 @@ public:
template <typename Executor1>
basic_waitable_timer(
basic_waitable_timer<Clock, WaitTraits, Executor1>&& other,
- typename constraint<
- is_convertible<Executor1, Executor>::value
- >::type = 0)
+ constraint_t<
+ is_convertible<Executor1, Executor>::value
+ > = 0)
: impl_(std::move(other.impl_))
{
}
@@ -357,16 +356,15 @@ public:
* constructor.
*/
template <typename Executor1>
- typename constraint<
+ constraint_t<
is_convertible<Executor1, Executor>::value,
basic_waitable_timer&
- >::type operator=(basic_waitable_timer<Clock, WaitTraits, Executor1>&& other)
+ > operator=(basic_waitable_timer<Clock, WaitTraits, Executor1>&& other)
{
basic_waitable_timer tmp(std::move(other));
impl_ = std::move(tmp.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destroys the timer.
/**
@@ -378,7 +376,7 @@ public:
}
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return impl_.get_executor();
}
@@ -726,27 +724,33 @@ public:
/// Start an asynchronous wait on the timer.
/**
* This function may be used to initiate an asynchronous wait against the
- * timer. It always returns immediately.
+ * timer. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
- * For each call to async_wait(), the supplied handler will be called exactly
- * once. The handler will be called when:
+ * For each call to async_wait(), the completion handler will be called
+ * exactly once. The completion handler will be called when:
*
* @li The timer has expired.
*
* @li The timer was cancelled, in which case the handler is passed the error
* code asio::error::operation_aborted.
*
- * @param handler The handler to be called when the timer expires. Copies
- * will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the timer expires. Potential
+ * completion tokens include @ref use_future, @ref use_awaitable, @ref
+ * yield_context, or a function object with the correct completion signature.
+ * The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -759,22 +763,21 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler,
- void (asio::error_code))
- async_wait(
- ASIO_MOVE_ARG(WaitHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WaitToken = default_completion_token_t<executor_type>>
+ auto async_wait(
+ WaitToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WaitToken, void (asio::error_code)>(
+ declval<initiate_async_wait>(), token))
{
- return async_initiate<WaitHandler, void (asio::error_code)>(
- initiate_async_wait(this), handler);
+ return async_initiate<WaitToken, void (asio::error_code)>(
+ initiate_async_wait(this), token);
}
private:
// Disallow copying and assignment.
- basic_waitable_timer(const basic_waitable_timer&) ASIO_DELETED;
- basic_waitable_timer& operator=(
- const basic_waitable_timer&) ASIO_DELETED;
+ basic_waitable_timer(const basic_waitable_timer&) = delete;
+ basic_waitable_timer& operator=(const basic_waitable_timer&) = delete;
class initiate_async_wait
{
@@ -786,13 +789,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WaitHandler>
- void operator()(ASIO_MOVE_ARG(WaitHandler) handler) const
+ void operator()(WaitHandler&& handler) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WaitHandler.
@@ -810,7 +813,7 @@ private:
detail::io_object_impl<
detail::deadline_timer_service<
- detail::chrono_time_traits<Clock, WaitTraits> >,
+ detail::chrono_time_traits<Clock, WaitTraits>>,
executor_type > impl_;
};
diff --git a/3rdparty/asio/include/asio/basic_writable_pipe.hpp b/3rdparty/asio/include/asio/basic_writable_pipe.hpp
new file mode 100644
index 00000000000..4c389c9b464
--- /dev/null
+++ b/3rdparty/asio/include/asio/basic_writable_pipe.hpp
@@ -0,0 +1,622 @@
+//
+// basic_writable_pipe.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_BASIC_WRITABLE_PIPE_HPP
+#define ASIO_BASIC_WRITABLE_PIPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_PIPE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include <string>
+#include <utility>
+#include "asio/any_io_executor.hpp"
+#include "asio/async_result.hpp"
+#include "asio/detail/handler_type_requirements.hpp"
+#include "asio/detail/io_object_impl.hpp"
+#include "asio/detail/non_const_lvalue.hpp"
+#include "asio/detail/throw_error.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/error.hpp"
+#include "asio/execution_context.hpp"
+#if defined(ASIO_HAS_IOCP)
+# include "asio/detail/win_iocp_handle_service.hpp"
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_descriptor_service.hpp"
+#else
+# include "asio/detail/reactive_descriptor_service.hpp"
+#endif
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// Provides pipe functionality.
+/**
+ * The basic_writable_pipe class provides a wrapper over pipe
+ * functionality.
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe.@n
+ * @e Shared @e objects: Unsafe.
+ */
+template <typename Executor = any_io_executor>
+class basic_writable_pipe
+{
+private:
+ class initiate_async_write_some;
+
+public:
+ /// The type of the executor associated with the object.
+ typedef Executor executor_type;
+
+ /// Rebinds the pipe type to another executor.
+ template <typename Executor1>
+ struct rebind_executor
+ {
+ /// The pipe type when rebound to the specified executor.
+ typedef basic_writable_pipe<Executor1> other;
+ };
+
+ /// The native representation of a pipe.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#elif defined(ASIO_HAS_IOCP)
+ typedef detail::win_iocp_handle_service::native_handle_type
+ native_handle_type;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ typedef detail::io_uring_descriptor_service::native_handle_type
+ native_handle_type;
+#else
+ typedef detail::reactive_descriptor_service::native_handle_type
+ native_handle_type;
+#endif
+
+ /// A basic_writable_pipe is always the lowest layer.
+ typedef basic_writable_pipe lowest_layer_type;
+
+ /// Construct a basic_writable_pipe without opening it.
+ /**
+ * This constructor creates a pipe without opening it.
+ *
+ * @param ex The I/O executor that the pipe will use, by default, to dispatch
+ * handlers for any asynchronous operations performed on the pipe.
+ */
+ explicit basic_writable_pipe(const executor_type& ex)
+ : impl_(0, ex)
+ {
+ }
+
+ /// Construct a basic_writable_pipe without opening it.
+ /**
+ * This constructor creates a pipe without opening it.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the pipe will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the pipe.
+ */
+ template <typename ExecutionContext>
+ explicit basic_writable_pipe(ExecutionContext& context,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(0, 0, context)
+ {
+ }
+
+ /// Construct a basic_writable_pipe on an existing native pipe.
+ /**
+ * This constructor creates a pipe object to hold an existing native
+ * pipe.
+ *
+ * @param ex The I/O executor that the pipe will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the
+ * pipe.
+ *
+ * @param native_pipe A native pipe.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ basic_writable_pipe(const executor_type& ex,
+ const native_handle_type& native_pipe)
+ : impl_(0, ex)
+ {
+ asio::error_code ec;
+ impl_.get_service().assign(impl_.get_implementation(),
+ native_pipe, ec);
+ asio::detail::throw_error(ec, "assign");
+ }
+
+ /// Construct a basic_writable_pipe on an existing native pipe.
+ /**
+ * This constructor creates a pipe object to hold an existing native
+ * pipe.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the pipe will use, by default, to dispatch handlers for any
+ * asynchronous operations performed on the pipe.
+ *
+ * @param native_pipe A native pipe.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ template <typename ExecutionContext>
+ basic_writable_pipe(ExecutionContext& context,
+ const native_handle_type& native_pipe,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ : impl_(0, 0, context)
+ {
+ asio::error_code ec;
+ impl_.get_service().assign(impl_.get_implementation(),
+ native_pipe, ec);
+ asio::detail::throw_error(ec, "assign");
+ }
+
+ /// Move-construct a basic_writable_pipe from another.
+ /**
+ * This constructor moves a pipe from one object to another.
+ *
+ * @param other The other basic_writable_pipe object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_writable_pipe(const executor_type&)
+ * constructor.
+ */
+ basic_writable_pipe(basic_writable_pipe&& other)
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign a basic_writable_pipe from another.
+ /**
+ * This assignment operator moves a pipe from one object to another.
+ *
+ * @param other The other basic_writable_pipe object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_writable_pipe(const executor_type&)
+ * constructor.
+ */
+ basic_writable_pipe& operator=(basic_writable_pipe&& other)
+ {
+ impl_ = std::move(other.impl_);
+ return *this;
+ }
+
+ // All pipes have access to each other's implementations.
+ template <typename Executor1>
+ friend class basic_writable_pipe;
+
+ /// Move-construct a basic_writable_pipe from a pipe of another executor type.
+ /**
+ * This constructor moves a pipe from one object to another.
+ *
+ * @param other The other basic_writable_pipe object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_writable_pipe(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ basic_writable_pipe(basic_writable_pipe<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign a basic_writable_pipe from a pipe of another executor type.
+ /**
+ * This assignment operator moves a pipe from one object to another.
+ *
+ * @param other The other basic_writable_pipe object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_writable_pipe(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_writable_pipe&
+ > operator=(basic_writable_pipe<Executor1>&& other)
+ {
+ basic_writable_pipe tmp(std::move(other));
+ impl_ = std::move(tmp.impl_);
+ return *this;
+ }
+
+ /// Destroys the pipe.
+ /**
+ * This function destroys the pipe, cancelling any outstanding
+ * asynchronous wait operations associated with the pipe as if by
+ * calling @c cancel.
+ */
+ ~basic_writable_pipe()
+ {
+ }
+
+ /// Get the executor associated with the object.
+ const executor_type& get_executor() noexcept
+ {
+ return impl_.get_executor();
+ }
+
+ /// Get a reference to the lowest layer.
+ /**
+ * This function returns a reference to the lowest layer in a stack of
+ * layers. Since a basic_writable_pipe cannot contain any further layers, it
+ * simply returns a reference to itself.
+ *
+ * @return A reference to the lowest layer in the stack of layers. Ownership
+ * is not transferred to the caller.
+ */
+ lowest_layer_type& lowest_layer()
+ {
+ return *this;
+ }
+
+ /// Get a const reference to the lowest layer.
+ /**
+ * This function returns a const reference to the lowest layer in a stack of
+ * layers. Since a basic_writable_pipe cannot contain any further layers, it
+ * simply returns a reference to itself.
+ *
+ * @return A const reference to the lowest layer in the stack of layers.
+ * Ownership is not transferred to the caller.
+ */
+ const lowest_layer_type& lowest_layer() const
+ {
+ return *this;
+ }
+
+ /// Assign an existing native pipe to the pipe.
+ /*
+ * This function opens the pipe to hold an existing native pipe.
+ *
+ * @param native_pipe A native pipe.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void assign(const native_handle_type& native_pipe)
+ {
+ asio::error_code ec;
+ impl_.get_service().assign(impl_.get_implementation(), native_pipe, ec);
+ asio::detail::throw_error(ec, "assign");
+ }
+
+ /// Assign an existing native pipe to the pipe.
+ /*
+ * This function opens the pipe to hold an existing native pipe.
+ *
+ * @param native_pipe A native pipe.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID assign(const native_handle_type& native_pipe,
+ asio::error_code& ec)
+ {
+ impl_.get_service().assign(impl_.get_implementation(), native_pipe, ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Determine whether the pipe is open.
+ bool is_open() const
+ {
+ return impl_.get_service().is_open(impl_.get_implementation());
+ }
+
+ /// Close the pipe.
+ /**
+ * This function is used to close the pipe. Any asynchronous write operations
+ * will be cancelled immediately, and will complete with the
+ * asio::error::operation_aborted error.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void close()
+ {
+ asio::error_code ec;
+ impl_.get_service().close(impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "close");
+ }
+
+ /// Close the pipe.
+ /**
+ * This function is used to close the pipe. Any asynchronous write operations
+ * will be cancelled immediately, and will complete with the
+ * asio::error::operation_aborted error.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID close(asio::error_code& ec)
+ {
+ impl_.get_service().close(impl_.get_implementation(), ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Release ownership of the underlying native pipe.
+ /**
+ * This function causes all outstanding asynchronous write operations to
+ * finish immediately, and the handlers for cancelled operations will be
+ * passed the asio::error::operation_aborted error. Ownership of the
+ * native pipe is then transferred to the caller.
+ *
+ * @throws asio::system_error Thrown on failure.
+ *
+ * @note This function is unsupported on Windows versions prior to Windows
+ * 8.1, and will fail with asio::error::operation_not_supported on
+ * these platforms.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603)
+ __declspec(deprecated("This function always fails with "
+ "operation_not_supported when used on Windows versions "
+ "prior to Windows 8.1."))
+#endif
+ native_handle_type release()
+ {
+ asio::error_code ec;
+ native_handle_type s = impl_.get_service().release(
+ impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "release");
+ return s;
+ }
+
+ /// Release ownership of the underlying native pipe.
+ /**
+ * This function causes all outstanding asynchronous write operations to
+ * finish immediately, and the handlers for cancelled operations will be
+ * passed the asio::error::operation_aborted error. Ownership of the
+ * native pipe is then transferred to the caller.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note This function is unsupported on Windows versions prior to Windows
+ * 8.1, and will fail with asio::error::operation_not_supported on
+ * these platforms.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603)
+ __declspec(deprecated("This function always fails with "
+ "operation_not_supported when used on Windows versions "
+ "prior to Windows 8.1."))
+#endif
+ native_handle_type release(asio::error_code& ec)
+ {
+ return impl_.get_service().release(impl_.get_implementation(), ec);
+ }
+
+ /// Get the native pipe representation.
+ /**
+ * This function may be used to obtain the underlying representation of the
+ * pipe. This is intended to allow access to native pipe
+ * functionality that is not otherwise provided.
+ */
+ native_handle_type native_handle()
+ {
+ return impl_.get_service().native_handle(impl_.get_implementation());
+ }
+
+ /// Cancel all asynchronous operations associated with the pipe.
+ /**
+ * This function causes all outstanding asynchronous write operations to
+ * finish immediately, and the handlers for cancelled operations will be
+ * passed the asio::error::operation_aborted error.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+ void cancel()
+ {
+ asio::error_code ec;
+ impl_.get_service().cancel(impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "cancel");
+ }
+
+ /// Cancel all asynchronous operations associated with the pipe.
+ /**
+ * This function causes all outstanding asynchronous write operations to
+ * finish immediately, and the handlers for cancelled operations will be
+ * passed the asio::error::operation_aborted error.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ ASIO_SYNC_OP_VOID cancel(asio::error_code& ec)
+ {
+ impl_.get_service().cancel(impl_.get_implementation(), ec);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ /// Write some data to the pipe.
+ /**
+ * This function is used to write data to the pipe. The function call will
+ * block until one or more bytes of the data has been written successfully,
+ * or until an error occurs.
+ *
+ * @param buffers One or more data buffers to be written to the pipe.
+ *
+ * @returns The number of bytes written.
+ *
+ * @throws asio::system_error Thrown on failure. An error code of
+ * asio::error::eof indicates that the connection was closed by the
+ * peer.
+ *
+ * @note The write_some operation may not transmit all of the data to the
+ * peer. Consider using the @ref write function if you need to ensure that
+ * all data is written before the blocking operation completes.
+ *
+ * @par Example
+ * To write a single data buffer use the @ref buffer function as follows:
+ * @code
+ * pipe.write_some(asio::buffer(data, size));
+ * @endcode
+ * See the @ref buffer documentation for information on writing multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename ConstBufferSequence>
+ std::size_t write_some(const ConstBufferSequence& buffers)
+ {
+ asio::error_code ec;
+ std::size_t s = impl_.get_service().write_some(
+ impl_.get_implementation(), buffers, ec);
+ asio::detail::throw_error(ec, "write_some");
+ return s;
+ }
+
+ /// Write some data to the pipe.
+ /**
+ * This function is used to write data to the pipe. The function call will
+ * block until one or more bytes of the data has been written successfully,
+ * or until an error occurs.
+ *
+ * @param buffers One or more data buffers to be written to the pipe.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes written. Returns 0 if an error occurred.
+ *
+ * @note The write_some operation may not transmit all of the data to the
+ * peer. Consider using the @ref write function if you need to ensure that
+ * all data is written before the blocking operation completes.
+ */
+ template <typename ConstBufferSequence>
+ std::size_t write_some(const ConstBufferSequence& buffers,
+ asio::error_code& ec)
+ {
+ return impl_.get_service().write_some(
+ impl_.get_implementation(), buffers, ec);
+ }
+
+ /// Start an asynchronous write.
+ /**
+ * This function is used to asynchronously write data to the pipe. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately.
+ *
+ * @param buffers One or more data buffers to be written to the pipe.
+ * Although the buffers object may be copied as necessary, ownership of the
+ * underlying memory blocks is retained by the caller, which must guarantee
+ * that they remain valid until the completion handler is called.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
+ * @code void handler(
+ * const asio::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Number of bytes written.
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
+ * @note The write operation may not transmit all of the data to the peer.
+ * Consider using the @ref async_write function if you need to ensure that all
+ * data is written before the asynchronous operation completes.
+ *
+ * @par Example
+ * To write a single data buffer use the @ref buffer function as follows:
+ * @code
+ * pipe.async_write_some(asio::buffer(data, size), handler);
+ * @endcode
+ * See the @ref buffer documentation for information on writing multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename ConstBufferSequence,
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_write_some>(), token, buffers))
+ {
+ return async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ initiate_async_write_some(this), token, buffers);
+ }
+
+private:
+ // Disallow copying and assignment.
+ basic_writable_pipe(const basic_writable_pipe&) = delete;
+ basic_writable_pipe& operator=(const basic_writable_pipe&) = delete;
+
+ class initiate_async_write_some
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_write_some(basic_writable_pipe* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename WriteHandler, typename ConstBufferSequence>
+ void operator()(WriteHandler&& handler,
+ const ConstBufferSequence& buffers) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a WriteHandler.
+ ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
+
+ detail::non_const_lvalue<WriteHandler> handler2(handler);
+ self_->impl_.get_service().async_write_some(
+ self_->impl_.get_implementation(), buffers,
+ handler2.value, self_->impl_.get_executor());
+ }
+
+ private:
+ basic_writable_pipe* self_;
+ };
+
+#if defined(ASIO_HAS_IOCP)
+ detail::io_object_impl<detail::win_iocp_handle_service, Executor> impl_;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ detail::io_object_impl<detail::io_uring_descriptor_service, Executor> impl_;
+#else
+ detail::io_object_impl<detail::reactive_descriptor_service, Executor> impl_;
+#endif
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_PIPE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_BASIC_WRITABLE_PIPE_HPP
diff --git a/3rdparty/asio/include/asio/bind_allocator.hpp b/3rdparty/asio/include/asio/bind_allocator.hpp
new file mode 100644
index 00000000000..27910a2ec69
--- /dev/null
+++ b/3rdparty/asio/include/asio/bind_allocator.hpp
@@ -0,0 +1,530 @@
+//
+// bind_allocator.hpp
+// ~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_BIND_ALLOCATOR_HPP
+#define ASIO_BIND_ALLOCATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/associated_allocator.hpp"
+#include "asio/associator.hpp"
+#include "asio/async_result.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+// Helper to automatically define nested typedef result_type.
+
+template <typename T, typename = void>
+struct allocator_binder_result_type
+{
+protected:
+ typedef void result_type_or_void;
+};
+
+template <typename T>
+struct allocator_binder_result_type<T, void_t<typename T::result_type>>
+{
+ typedef typename T::result_type result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R>
+struct allocator_binder_result_type<R(*)()>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R>
+struct allocator_binder_result_type<R(&)()>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R, typename A1>
+struct allocator_binder_result_type<R(*)(A1)>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R, typename A1>
+struct allocator_binder_result_type<R(&)(A1)>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R, typename A1, typename A2>
+struct allocator_binder_result_type<R(*)(A1, A2)>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R, typename A1, typename A2>
+struct allocator_binder_result_type<R(&)(A1, A2)>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+// Helper to automatically define nested typedef argument_type.
+
+template <typename T, typename = void>
+struct allocator_binder_argument_type {};
+
+template <typename T>
+struct allocator_binder_argument_type<T, void_t<typename T::argument_type>>
+{
+ typedef typename T::argument_type argument_type;
+};
+
+template <typename R, typename A1>
+struct allocator_binder_argument_type<R(*)(A1)>
+{
+ typedef A1 argument_type;
+};
+
+template <typename R, typename A1>
+struct allocator_binder_argument_type<R(&)(A1)>
+{
+ typedef A1 argument_type;
+};
+
+// Helper to automatically define nested typedefs first_argument_type and
+// second_argument_type.
+
+template <typename T, typename = void>
+struct allocator_binder_argument_types {};
+
+template <typename T>
+struct allocator_binder_argument_types<T,
+ void_t<typename T::first_argument_type>>
+{
+ typedef typename T::first_argument_type first_argument_type;
+ typedef typename T::second_argument_type second_argument_type;
+};
+
+template <typename R, typename A1, typename A2>
+struct allocator_binder_argument_type<R(*)(A1, A2)>
+{
+ typedef A1 first_argument_type;
+ typedef A2 second_argument_type;
+};
+
+template <typename R, typename A1, typename A2>
+struct allocator_binder_argument_type<R(&)(A1, A2)>
+{
+ typedef A1 first_argument_type;
+ typedef A2 second_argument_type;
+};
+
+} // namespace detail
+
+/// A call wrapper type to bind an allocator of type @c Allocator
+/// to an object of type @c T.
+template <typename T, typename Allocator>
+class allocator_binder
+#if !defined(GENERATING_DOCUMENTATION)
+ : public detail::allocator_binder_result_type<T>,
+ public detail::allocator_binder_argument_type<T>,
+ public detail::allocator_binder_argument_types<T>
+#endif // !defined(GENERATING_DOCUMENTATION)
+{
+public:
+ /// The type of the target object.
+ typedef T target_type;
+
+ /// The type of the associated allocator.
+ typedef Allocator allocator_type;
+
+#if defined(GENERATING_DOCUMENTATION)
+ /// The return type if a function.
+ /**
+ * The type of @c result_type is based on the type @c T of the wrapper's
+ * target object:
+ *
+ * @li if @c T is a pointer to function type, @c result_type is a synonym for
+ * the return type of @c T;
+ *
+ * @li if @c T is a class type with a member type @c result_type, then @c
+ * result_type is a synonym for @c T::result_type;
+ *
+ * @li otherwise @c result_type is not defined.
+ */
+ typedef see_below result_type;
+
+ /// The type of the function's argument.
+ /**
+ * The type of @c argument_type is based on the type @c T of the wrapper's
+ * target object:
+ *
+ * @li if @c T is a pointer to a function type accepting a single argument,
+ * @c argument_type is a synonym for the return type of @c T;
+ *
+ * @li if @c T is a class type with a member type @c argument_type, then @c
+ * argument_type is a synonym for @c T::argument_type;
+ *
+ * @li otherwise @c argument_type is not defined.
+ */
+ typedef see_below argument_type;
+
+ /// The type of the function's first argument.
+ /**
+ * The type of @c first_argument_type is based on the type @c T of the
+ * wrapper's target object:
+ *
+ * @li if @c T is a pointer to a function type accepting two arguments, @c
+ * first_argument_type is a synonym for the return type of @c T;
+ *
+ * @li if @c T is a class type with a member type @c first_argument_type,
+ * then @c first_argument_type is a synonym for @c T::first_argument_type;
+ *
+ * @li otherwise @c first_argument_type is not defined.
+ */
+ typedef see_below first_argument_type;
+
+ /// The type of the function's second argument.
+ /**
+ * The type of @c second_argument_type is based on the type @c T of the
+ * wrapper's target object:
+ *
+ * @li if @c T is a pointer to a function type accepting two arguments, @c
+ * second_argument_type is a synonym for the return type of @c T;
+ *
+ * @li if @c T is a class type with a member type @c first_argument_type,
+ * then @c second_argument_type is a synonym for @c T::second_argument_type;
+ *
+ * @li otherwise @c second_argument_type is not defined.
+ */
+ typedef see_below second_argument_type;
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Construct an allocator wrapper for the specified object.
+ /**
+ * This constructor is only valid if the type @c T is constructible from type
+ * @c U.
+ */
+ template <typename U>
+ allocator_binder(const allocator_type& s, U&& u)
+ : allocator_(s),
+ target_(static_cast<U&&>(u))
+ {
+ }
+
+ /// Copy constructor.
+ allocator_binder(const allocator_binder& other)
+ : allocator_(other.get_allocator()),
+ target_(other.get())
+ {
+ }
+
+ /// Construct a copy, but specify a different allocator.
+ allocator_binder(const allocator_type& s, const allocator_binder& other)
+ : allocator_(s),
+ target_(other.get())
+ {
+ }
+
+ /// Construct a copy of a different allocator wrapper type.
+ /**
+ * This constructor is only valid if the @c Allocator type is
+ * constructible from type @c OtherAllocator, and the type @c T is
+ * constructible from type @c U.
+ */
+ template <typename U, typename OtherAllocator>
+ allocator_binder(const allocator_binder<U, OtherAllocator>& other,
+ constraint_t<is_constructible<Allocator, OtherAllocator>::value> = 0,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : allocator_(other.get_allocator()),
+ target_(other.get())
+ {
+ }
+
+ /// Construct a copy of a different allocator wrapper type, but
+ /// specify a different allocator.
+ /**
+ * This constructor is only valid if the type @c T is constructible from type
+ * @c U.
+ */
+ template <typename U, typename OtherAllocator>
+ allocator_binder(const allocator_type& s,
+ const allocator_binder<U, OtherAllocator>& other,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : allocator_(s),
+ target_(other.get())
+ {
+ }
+
+ /// Move constructor.
+ allocator_binder(allocator_binder&& other)
+ : allocator_(static_cast<allocator_type&&>(
+ other.get_allocator())),
+ target_(static_cast<T&&>(other.get()))
+ {
+ }
+
+ /// Move construct the target object, but specify a different allocator.
+ allocator_binder(const allocator_type& s,
+ allocator_binder&& other)
+ : allocator_(s),
+ target_(static_cast<T&&>(other.get()))
+ {
+ }
+
+ /// Move construct from a different allocator wrapper type.
+ template <typename U, typename OtherAllocator>
+ allocator_binder(
+ allocator_binder<U, OtherAllocator>&& other,
+ constraint_t<is_constructible<Allocator, OtherAllocator>::value> = 0,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : allocator_(static_cast<OtherAllocator&&>(
+ other.get_allocator())),
+ target_(static_cast<U&&>(other.get()))
+ {
+ }
+
+ /// Move construct from a different allocator wrapper type, but
+ /// specify a different allocator.
+ template <typename U, typename OtherAllocator>
+ allocator_binder(const allocator_type& s,
+ allocator_binder<U, OtherAllocator>&& other,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : allocator_(s),
+ target_(static_cast<U&&>(other.get()))
+ {
+ }
+
+ /// Destructor.
+ ~allocator_binder()
+ {
+ }
+
+ /// Obtain a reference to the target object.
+ target_type& get() noexcept
+ {
+ return target_;
+ }
+
+ /// Obtain a reference to the target object.
+ const target_type& get() const noexcept
+ {
+ return target_;
+ }
+
+ /// Obtain the associated allocator.
+ allocator_type get_allocator() const noexcept
+ {
+ return allocator_;
+ }
+
+ /// Forwarding function call operator.
+ template <typename... Args>
+ result_of_t<T(Args...)> operator()(Args&&... args)
+ {
+ return target_(static_cast<Args&&>(args)...);
+ }
+
+ /// Forwarding function call operator.
+ template <typename... Args>
+ result_of_t<T(Args...)> operator()(Args&&... args) const
+ {
+ return target_(static_cast<Args&&>(args)...);
+ }
+
+private:
+ Allocator allocator_;
+ T target_;
+};
+
+/// Associate an object of type @c T with an allocator of type
+/// @c Allocator.
+template <typename Allocator, typename T>
+ASIO_NODISCARD inline allocator_binder<decay_t<T>, Allocator>
+bind_allocator(const Allocator& s, T&& t)
+{
+ return allocator_binder<decay_t<T>, Allocator>(s, static_cast<T&&>(t));
+}
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+namespace detail {
+
+template <typename TargetAsyncResult, typename Allocator, typename = void>
+class allocator_binder_completion_handler_async_result
+{
+public:
+ template <typename T>
+ explicit allocator_binder_completion_handler_async_result(T&)
+ {
+ }
+};
+
+template <typename TargetAsyncResult, typename Allocator>
+class allocator_binder_completion_handler_async_result<
+ TargetAsyncResult, Allocator,
+ void_t<typename TargetAsyncResult::completion_handler_type>>
+{
+private:
+ TargetAsyncResult target_;
+
+public:
+ typedef allocator_binder<
+ typename TargetAsyncResult::completion_handler_type, Allocator>
+ completion_handler_type;
+
+ explicit allocator_binder_completion_handler_async_result(
+ typename TargetAsyncResult::completion_handler_type& handler)
+ : target_(handler)
+ {
+ }
+
+ auto get() -> decltype(target_.get())
+ {
+ return target_.get();
+ }
+};
+
+template <typename TargetAsyncResult, typename = void>
+struct allocator_binder_async_result_return_type
+{
+};
+
+template <typename TargetAsyncResult>
+struct allocator_binder_async_result_return_type<
+ TargetAsyncResult, void_type<typename TargetAsyncResult::return_type>>
+{
+ typedef typename TargetAsyncResult::return_type return_type;
+};
+
+} // namespace detail
+
+template <typename T, typename Allocator, typename Signature>
+class async_result<allocator_binder<T, Allocator>, Signature> :
+ public detail::allocator_binder_completion_handler_async_result<
+ async_result<T, Signature>, Allocator>,
+ public detail::allocator_binder_async_result_return_type<
+ async_result<T, Signature>>
+{
+public:
+ explicit async_result(allocator_binder<T, Allocator>& b)
+ : detail::allocator_binder_completion_handler_async_result<
+ async_result<T, Signature>, Allocator>(b.get())
+ {
+ }
+
+ template <typename Initiation>
+ struct init_wrapper
+ {
+ template <typename Init>
+ init_wrapper(const Allocator& allocator, Init&& init)
+ : allocator_(allocator),
+ initiation_(static_cast<Init&&>(init))
+ {
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args)
+ {
+ static_cast<Initiation&&>(initiation_)(
+ allocator_binder<decay_t<Handler>, Allocator>(
+ allocator_, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args) const
+ {
+ initiation_(
+ allocator_binder<decay_t<Handler>, Allocator>(
+ allocator_, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
+ }
+
+ Allocator allocator_;
+ Initiation initiation_;
+ };
+
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<T, Signature>(
+ declval<init_wrapper<decay_t<Initiation>>>(),
+ token.get(), static_cast<Args&&>(args)...))
+ {
+ return async_initiate<T, Signature>(
+ init_wrapper<decay_t<Initiation>>(token.get_allocator(),
+ static_cast<Initiation&&>(initiation)),
+ token.get(), static_cast<Args&&>(args)...);
+ }
+
+private:
+ async_result(const async_result&) = delete;
+ async_result& operator=(const async_result&) = delete;
+
+ async_result<T, Signature> target_;
+};
+
+template <template <typename, typename> class Associator,
+ typename T, typename Allocator, typename DefaultCandidate>
+struct associator<Associator, allocator_binder<T, Allocator>, DefaultCandidate>
+ : Associator<T, DefaultCandidate>
+{
+ static typename Associator<T, DefaultCandidate>::type get(
+ const allocator_binder<T, Allocator>& b) noexcept
+ {
+ return Associator<T, DefaultCandidate>::get(b.get());
+ }
+
+ static auto get(const allocator_binder<T, Allocator>& b,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<T, DefaultCandidate>::get(b.get(), c))
+ {
+ return Associator<T, DefaultCandidate>::get(b.get(), c);
+ }
+};
+
+template <typename T, typename Allocator, typename Allocator1>
+struct associated_allocator<allocator_binder<T, Allocator>, Allocator1>
+{
+ typedef Allocator type;
+
+ static auto get(const allocator_binder<T, Allocator>& b,
+ const Allocator1& = Allocator1()) noexcept
+ -> decltype(b.get_allocator())
+ {
+ return b.get_allocator();
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_BIND_ALLOCATOR_HPP
diff --git a/3rdparty/asio/include/asio/bind_cancellation_slot.hpp b/3rdparty/asio/include/asio/bind_cancellation_slot.hpp
index 2a17d8f7327..7be13426283 100644
--- a/3rdparty/asio/include/asio/bind_cancellation_slot.hpp
+++ b/3rdparty/asio/include/asio/bind_cancellation_slot.hpp
@@ -2,7 +2,7 @@
// bind_cancellation_slot.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,7 +17,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/associated_cancellation_slot.hpp"
#include "asio/associator.hpp"
#include "asio/async_result.hpp"
@@ -37,8 +36,7 @@ protected:
};
template <typename T>
-struct cancellation_slot_binder_result_type<T,
- typename void_type<typename T::result_type>::type>
+struct cancellation_slot_binder_result_type<T, void_t<typename T::result_type>>
{
typedef typename T::result_type result_type;
protected:
@@ -100,7 +98,7 @@ struct cancellation_slot_binder_argument_type {};
template <typename T>
struct cancellation_slot_binder_argument_type<T,
- typename void_type<typename T::argument_type>::type>
+ void_t<typename T::argument_type>>
{
typedef typename T::argument_type argument_type;
};
@@ -125,7 +123,7 @@ struct cancellation_slot_binder_argument_types {};
template <typename T>
struct cancellation_slot_binder_argument_types<T,
- typename void_type<typename T::first_argument_type>::type>
+ void_t<typename T::first_argument_type>>
{
typedef typename T::first_argument_type first_argument_type;
typedef typename T::second_argument_type second_argument_type;
@@ -145,21 +143,6 @@ struct cancellation_slot_binder_argument_type<R(&)(A1, A2)>
typedef A2 second_argument_type;
};
-// Helper to enable SFINAE on zero-argument operator() below.
-
-template <typename T, typename = void>
-struct cancellation_slot_binder_result_of0
-{
- typedef void type;
-};
-
-template <typename T>
-struct cancellation_slot_binder_result_of0<T,
- typename void_type<typename result_of<T()>::type>::type>
-{
- typedef typename result_of<T()>::type type;
-};
-
} // namespace detail
/// A call wrapper type to bind a cancellation slot of type @c CancellationSlot
@@ -247,10 +230,9 @@ public:
* @c U.
*/
template <typename U>
- cancellation_slot_binder(const cancellation_slot_type& s,
- ASIO_MOVE_ARG(U) u)
+ cancellation_slot_binder(const cancellation_slot_type& s, U&& u)
: slot_(s),
- target_(ASIO_MOVE_CAST(U)(u))
+ target_(static_cast<U&&>(u))
{
}
@@ -277,7 +259,10 @@ public:
*/
template <typename U, typename OtherCancellationSlot>
cancellation_slot_binder(
- const cancellation_slot_binder<U, OtherCancellationSlot>& other)
+ const cancellation_slot_binder<U, OtherCancellationSlot>& other,
+ constraint_t<is_constructible<CancellationSlot,
+ OtherCancellationSlot>::value> = 0,
+ constraint_t<is_constructible<T, U>::value> = 0)
: slot_(other.get_cancellation_slot()),
target_(other.get())
{
@@ -291,19 +276,18 @@ public:
*/
template <typename U, typename OtherCancellationSlot>
cancellation_slot_binder(const cancellation_slot_type& s,
- const cancellation_slot_binder<U, OtherCancellationSlot>& other)
+ const cancellation_slot_binder<U, OtherCancellationSlot>& other,
+ constraint_t<is_constructible<T, U>::value> = 0)
: slot_(s),
target_(other.get())
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
/// Move constructor.
cancellation_slot_binder(cancellation_slot_binder&& other)
- : slot_(ASIO_MOVE_CAST(cancellation_slot_type)(
+ : slot_(static_cast<cancellation_slot_type&&>(
other.get_cancellation_slot())),
- target_(ASIO_MOVE_CAST(T)(other.get()))
+ target_(static_cast<T&&>(other.get()))
{
}
@@ -312,17 +296,20 @@ public:
cancellation_slot_binder(const cancellation_slot_type& s,
cancellation_slot_binder&& other)
: slot_(s),
- target_(ASIO_MOVE_CAST(T)(other.get()))
+ target_(static_cast<T&&>(other.get()))
{
}
/// Move construct from a different cancellation slot wrapper type.
template <typename U, typename OtherCancellationSlot>
cancellation_slot_binder(
- cancellation_slot_binder<U, OtherCancellationSlot>&& other)
- : slot_(ASIO_MOVE_CAST(OtherCancellationSlot)(
+ cancellation_slot_binder<U, OtherCancellationSlot>&& other,
+ constraint_t<is_constructible<CancellationSlot,
+ OtherCancellationSlot>::value> = 0,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : slot_(static_cast<OtherCancellationSlot&&>(
other.get_cancellation_slot())),
- target_(ASIO_MOVE_CAST(U)(other.get()))
+ target_(static_cast<U&&>(other.get()))
{
}
@@ -330,126 +317,50 @@ public:
/// specify a different cancellation slot.
template <typename U, typename OtherCancellationSlot>
cancellation_slot_binder(const cancellation_slot_type& s,
- cancellation_slot_binder<U, OtherCancellationSlot>&& other)
+ cancellation_slot_binder<U, OtherCancellationSlot>&& other,
+ constraint_t<is_constructible<T, U>::value> = 0)
: slot_(s),
- target_(ASIO_MOVE_CAST(U)(other.get()))
+ target_(static_cast<U&&>(other.get()))
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
/// Destructor.
~cancellation_slot_binder()
{
}
/// Obtain a reference to the target object.
- target_type& get() ASIO_NOEXCEPT
+ target_type& get() noexcept
{
return target_;
}
/// Obtain a reference to the target object.
- const target_type& get() const ASIO_NOEXCEPT
+ const target_type& get() const noexcept
{
return target_;
}
/// Obtain the associated cancellation slot.
- cancellation_slot_type get_cancellation_slot() const ASIO_NOEXCEPT
+ cancellation_slot_type get_cancellation_slot() const noexcept
{
return slot_;
}
-#if defined(GENERATING_DOCUMENTATION)
-
- template <typename... Args> auto operator()(Args&& ...);
- template <typename... Args> auto operator()(Args&& ...) const;
-
-#elif defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
/// Forwarding function call operator.
template <typename... Args>
- typename result_of<T(Args...)>::type operator()(
- ASIO_MOVE_ARG(Args)... args)
+ result_of_t<T(Args...)> operator()(Args&&... args)
{
- return target_(ASIO_MOVE_CAST(Args)(args)...);
+ return target_(static_cast<Args&&>(args)...);
}
/// Forwarding function call operator.
template <typename... Args>
- typename result_of<T(Args...)>::type operator()(
- ASIO_MOVE_ARG(Args)... args) const
- {
- return target_(ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#elif defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER)
-
- typename detail::cancellation_slot_binder_result_of0<T>::type operator()()
- {
- return target_();
- }
-
- typename detail::cancellation_slot_binder_result_of0<T>::type
- operator()() const
- {
- return target_();
- }
-
-#define ASIO_PRIVATE_BINDER_CALL_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- typename result_of<T(ASIO_VARIADIC_TARGS(n))>::type operator()( \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return target_(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- typename result_of<T(ASIO_VARIADIC_TARGS(n))>::type operator()( \
- ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- { \
- return target_(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_BINDER_CALL_DEF)
-#undef ASIO_PRIVATE_BINDER_CALL_DEF
-
-#else // defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER)
-
- typedef typename detail::cancellation_slot_binder_result_type<
- T>::result_type_or_void result_type_or_void;
-
- result_type_or_void operator()()
+ result_of_t<T(Args...)> operator()(Args&&... args) const
{
- return target_();
+ return target_(static_cast<Args&&>(args)...);
}
- result_type_or_void operator()() const
- {
- return target_();
- }
-
-#define ASIO_PRIVATE_BINDER_CALL_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- result_type_or_void operator()( \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return target_(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- result_type_or_void operator()( \
- ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- { \
- return target_(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_BINDER_CALL_DEF)
-#undef ASIO_PRIVATE_BINDER_CALL_DEF
-
-#endif // defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER)
-
private:
CancellationSlot slot_;
T target_;
@@ -458,12 +369,12 @@ private:
/// Associate an object of type @c T with a cancellation slot of type
/// @c CancellationSlot.
template <typename CancellationSlot, typename T>
-inline cancellation_slot_binder<typename decay<T>::type, CancellationSlot>
-bind_cancellation_slot(const CancellationSlot& s, ASIO_MOVE_ARG(T) t)
+ASIO_NODISCARD inline
+cancellation_slot_binder<decay_t<T>, CancellationSlot>
+bind_cancellation_slot(const CancellationSlot& s, T&& t)
{
- return cancellation_slot_binder<
- typename decay<T>::type, CancellationSlot>(
- s, ASIO_MOVE_CAST(T)(t));
+ return cancellation_slot_binder<decay_t<T>, CancellationSlot>(
+ s, static_cast<T&&>(t));
}
#if !defined(GENERATING_DOCUMENTATION)
@@ -471,21 +382,39 @@ bind_cancellation_slot(const CancellationSlot& s, ASIO_MOVE_ARG(T) t)
namespace detail {
template <typename TargetAsyncResult,
- typename CancellationSlot, typename = void>
-struct cancellation_slot_binder_async_result_completion_handler_type
+ typename CancellationSlot, typename = void>
+class cancellation_slot_binder_completion_handler_async_result
{
+public:
+ template <typename T>
+ explicit cancellation_slot_binder_completion_handler_async_result(T&)
+ {
+ }
};
template <typename TargetAsyncResult, typename CancellationSlot>
-struct cancellation_slot_binder_async_result_completion_handler_type<
- TargetAsyncResult, CancellationSlot,
- typename void_type<
- typename TargetAsyncResult::completion_handler_type
- >::type>
+class cancellation_slot_binder_completion_handler_async_result<
+ TargetAsyncResult, CancellationSlot,
+ void_t<typename TargetAsyncResult::completion_handler_type>>
{
+private:
+ TargetAsyncResult target_;
+
+public:
typedef cancellation_slot_binder<
typename TargetAsyncResult::completion_handler_type, CancellationSlot>
completion_handler_type;
+
+ explicit cancellation_slot_binder_completion_handler_async_result(
+ typename TargetAsyncResult::completion_handler_type& handler)
+ : target_(handler)
+ {
+ }
+
+ auto get() -> decltype(target_.get())
+ {
+ return target_.get();
+ }
};
template <typename TargetAsyncResult, typename = void>
@@ -495,10 +424,7 @@ struct cancellation_slot_binder_async_result_return_type
template <typename TargetAsyncResult>
struct cancellation_slot_binder_async_result_return_type<
- TargetAsyncResult,
- typename void_type<
- typename TargetAsyncResult::return_type
- >::type>
+ TargetAsyncResult, void_t<typename TargetAsyncResult::return_type>>
{
typedef typename TargetAsyncResult::return_type return_type;
};
@@ -507,178 +433,68 @@ struct cancellation_slot_binder_async_result_return_type<
template <typename T, typename CancellationSlot, typename Signature>
class async_result<cancellation_slot_binder<T, CancellationSlot>, Signature> :
- public detail::cancellation_slot_binder_async_result_completion_handler_type<
- async_result<T, Signature>, CancellationSlot>,
+ public detail::cancellation_slot_binder_completion_handler_async_result<
+ async_result<T, Signature>, CancellationSlot>,
public detail::cancellation_slot_binder_async_result_return_type<
- async_result<T, Signature> >
+ async_result<T, Signature>>
{
public:
explicit async_result(cancellation_slot_binder<T, CancellationSlot>& b)
- : target_(b.get())
+ : detail::cancellation_slot_binder_completion_handler_async_result<
+ async_result<T, Signature>, CancellationSlot>(b.get())
{
}
- typename async_result<T, Signature>::return_type get()
- {
- return target_.get();
- }
-
template <typename Initiation>
struct init_wrapper
{
template <typename Init>
- init_wrapper(const CancellationSlot& slot, ASIO_MOVE_ARG(Init) init)
+ init_wrapper(const CancellationSlot& slot, Init&& init)
: slot_(slot),
- initiation_(ASIO_MOVE_CAST(Init)(init))
+ initiation_(static_cast<Init&&>(init))
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Handler, typename... Args>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Args)... args)
+ void operator()(Handler&& handler, Args&&... args)
{
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- cancellation_slot_binder<
- typename decay<Handler>::type, CancellationSlot>(
- slot_, ASIO_MOVE_CAST(Handler)(handler)),
- ASIO_MOVE_CAST(Args)(args)...);
+ static_cast<Initiation&&>(initiation_)(
+ cancellation_slot_binder<decay_t<Handler>, CancellationSlot>(
+ slot_, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Args)... args) const
+ void operator()(Handler&& handler, Args&&... args) const
{
initiation_(
- cancellation_slot_binder<
- typename decay<Handler>::type, CancellationSlot>(
- slot_, ASIO_MOVE_CAST(Handler)(handler)),
- ASIO_MOVE_CAST(Args)(args)...);
+ cancellation_slot_binder<decay_t<Handler>, CancellationSlot>(
+ slot_, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Handler>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler)
- {
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- cancellation_slot_binder<
- typename decay<Handler>::type, CancellationSlot>(
- slot_, ASIO_MOVE_CAST(Handler)(handler)));
- }
-
- template <typename Handler>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler) const
- {
- initiation_(
- cancellation_slot_binder<
- typename decay<Handler>::type, CancellationSlot>(
- slot_, ASIO_MOVE_CAST(Handler)(handler)));
- }
-
-#define ASIO_PRIVATE_INIT_WRAPPER_DEF(n) \
- template <typename Handler, ASIO_VARIADIC_TPARAMS(n)> \
- void operator()( \
- ASIO_MOVE_ARG(Handler) handler, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- ASIO_MOVE_CAST(Initiation)(initiation_)( \
- cancellation_slot_binder< \
- typename decay<Handler>::type, CancellationSlot>( \
- slot_, ASIO_MOVE_CAST(Handler)(handler)), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <typename Handler, ASIO_VARIADIC_TPARAMS(n)> \
- void operator()( \
- ASIO_MOVE_ARG(Handler) handler, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- { \
- initiation_( \
- cancellation_slot_binder< \
- typename decay<Handler>::type, CancellationSlot>( \
- slot_, ASIO_MOVE_CAST(Handler)(handler)), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INIT_WRAPPER_DEF)
-#undef ASIO_PRIVATE_INIT_WRAPPER_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
CancellationSlot slot_;
Initiation initiation_;
};
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Initiation, typename RawCompletionToken, typename... Args>
- static ASIO_INITFN_DEDUCED_RESULT_TYPE(T, Signature,
- (async_result<T, Signature>::initiate(
- declval<init_wrapper<typename decay<Initiation>::type> >(),
- declval<T>(), declval<ASIO_MOVE_ARG(Args)>()...)))
- initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
- {
- return async_initiate<T, Signature>(
- init_wrapper<typename decay<Initiation>::type>(
- token.get_cancellation_slot(),
- ASIO_MOVE_CAST(Initiation)(initiation)),
- token.get(), ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Initiation, typename RawCompletionToken>
- static ASIO_INITFN_DEDUCED_RESULT_TYPE(T, Signature,
- (async_result<T, Signature>::initiate(
- declval<init_wrapper<typename decay<Initiation>::type> >(),
- declval<T>())))
- initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token)
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<T, Signature>(
+ declval<init_wrapper<decay_t<Initiation>>>(),
+ token.get(), static_cast<Args&&>(args)...))
{
return async_initiate<T, Signature>(
- init_wrapper<typename decay<Initiation>::type>(
+ init_wrapper<decay_t<Initiation>>(
token.get_cancellation_slot(),
- ASIO_MOVE_CAST(Initiation)(initiation)),
- token.get());
+ static_cast<Initiation&&>(initiation)),
+ token.get(), static_cast<Args&&>(args)...);
}
-#define ASIO_PRIVATE_INITIATE_DEF(n) \
- template <typename Initiation, typename RawCompletionToken, \
- ASIO_VARIADIC_TPARAMS(n)> \
- static ASIO_INITFN_DEDUCED_RESULT_TYPE(T, Signature, \
- (async_result<T, Signature>::initiate( \
- declval<init_wrapper<typename decay<Initiation>::type> >(), \
- declval<T>(), ASIO_VARIADIC_MOVE_DECLVAL(n)))) \
- initiate( \
- ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_MOVE_ARG(RawCompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return async_initiate<T, Signature>( \
- init_wrapper<typename decay<Initiation>::type>( \
- token.get_cancellation_slot(), \
- ASIO_MOVE_CAST(Initiation)(initiation)), \
- token.get(), ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF)
-#undef ASIO_PRIVATE_INITIATE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
private:
- async_result(const async_result&) ASIO_DELETED;
- async_result& operator=(const async_result&) ASIO_DELETED;
+ async_result(const async_result&) = delete;
+ async_result& operator=(const async_result&) = delete;
async_result<T, Signature> target_;
};
@@ -688,11 +504,17 @@ template <template <typename, typename> class Associator,
struct associator<Associator,
cancellation_slot_binder<T, CancellationSlot>,
DefaultCandidate>
+ : Associator<T, DefaultCandidate>
{
- typedef typename Associator<T, DefaultCandidate>::type type;
+ static typename Associator<T, DefaultCandidate>::type get(
+ const cancellation_slot_binder<T, CancellationSlot>& b) noexcept
+ {
+ return Associator<T, DefaultCandidate>::get(b.get());
+ }
- static type get(const cancellation_slot_binder<T, CancellationSlot>& b,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ static auto get(const cancellation_slot_binder<T, CancellationSlot>& b,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<T, DefaultCandidate>::get(b.get(), c))
{
return Associator<T, DefaultCandidate>::get(b.get(), c);
}
@@ -705,8 +527,9 @@ struct associated_cancellation_slot<
{
typedef CancellationSlot type;
- static type get(const cancellation_slot_binder<T, CancellationSlot>& b,
- const CancellationSlot1& = CancellationSlot1()) ASIO_NOEXCEPT
+ static auto get(const cancellation_slot_binder<T, CancellationSlot>& b,
+ const CancellationSlot1& = CancellationSlot1()) noexcept
+ -> decltype(b.get_cancellation_slot())
{
return b.get_cancellation_slot();
}
diff --git a/3rdparty/asio/include/asio/bind_executor.hpp b/3rdparty/asio/include/asio/bind_executor.hpp
index 4da0b01e268..f117b4ce903 100644
--- a/3rdparty/asio/include/asio/bind_executor.hpp
+++ b/3rdparty/asio/include/asio/bind_executor.hpp
@@ -2,7 +2,7 @@
// bind_executor.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,7 +17,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/associated_executor.hpp"
#include "asio/associator.hpp"
#include "asio/async_result.hpp"
@@ -41,8 +40,7 @@ protected:
};
template <typename T>
-struct executor_binder_result_type<T,
- typename void_type<typename T::result_type>::type>
+struct executor_binder_result_type<T, void_t<typename T::result_type>>
{
typedef typename T::result_type result_type;
protected:
@@ -103,8 +101,7 @@ template <typename T, typename = void>
struct executor_binder_argument_type {};
template <typename T>
-struct executor_binder_argument_type<T,
- typename void_type<typename T::argument_type>::type>
+struct executor_binder_argument_type<T, void_t<typename T::argument_type>>
{
typedef typename T::argument_type argument_type;
};
@@ -129,7 +126,7 @@ struct executor_binder_argument_types {};
template <typename T>
struct executor_binder_argument_types<T,
- typename void_type<typename T::first_argument_type>::type>
+ void_t<typename T::first_argument_type>>
{
typedef typename T::first_argument_type first_argument_type;
typedef typename T::second_argument_type second_argument_type;
@@ -160,9 +157,9 @@ class executor_binder_base<T, Executor, true>
{
protected:
template <typename E, typename U>
- executor_binder_base(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(U) u)
- : executor_(ASIO_MOVE_CAST(E)(e)),
- target_(executor_arg_t(), executor_, ASIO_MOVE_CAST(U)(u))
+ executor_binder_base(E&& e, U&& u)
+ : executor_(static_cast<E&&>(e)),
+ target_(executor_arg_t(), executor_, static_cast<U&&>(u))
{
}
@@ -175,9 +172,9 @@ class executor_binder_base<T, Executor, false>
{
protected:
template <typename E, typename U>
- executor_binder_base(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(U) u)
- : executor_(ASIO_MOVE_CAST(E)(e)),
- target_(ASIO_MOVE_CAST(U)(u))
+ executor_binder_base(E&& e, U&& u)
+ : executor_(static_cast<E&&>(e)),
+ target_(static_cast<U&&>(u))
{
}
@@ -185,21 +182,6 @@ protected:
T target_;
};
-// Helper to enable SFINAE on zero-argument operator() below.
-
-template <typename T, typename = void>
-struct executor_binder_result_of0
-{
- typedef void type;
-};
-
-template <typename T>
-struct executor_binder_result_of0<T,
- typename void_type<typename result_of<T()>::type>::type>
-{
- typedef typename result_of<T()>::type type;
-};
-
} // namespace detail
/// A call wrapper type to bind an executor of type @c Executor to an object of
@@ -290,8 +272,8 @@ public:
*/
template <typename U>
executor_binder(executor_arg_t, const executor_type& e,
- ASIO_MOVE_ARG(U) u)
- : base_type(e, ASIO_MOVE_CAST(U)(u))
+ U&& u)
+ : base_type(e, static_cast<U&&>(u))
{
}
@@ -315,7 +297,9 @@ public:
* @c U.
*/
template <typename U, typename OtherExecutor>
- executor_binder(const executor_binder<U, OtherExecutor>& other)
+ executor_binder(const executor_binder<U, OtherExecutor>& other,
+ constraint_t<is_constructible<Executor, OtherExecutor>::value> = 0,
+ constraint_t<is_constructible<T, U>::value> = 0)
: base_type(other.get_executor(), other.get())
{
}
@@ -328,32 +312,33 @@ public:
*/
template <typename U, typename OtherExecutor>
executor_binder(executor_arg_t, const executor_type& e,
- const executor_binder<U, OtherExecutor>& other)
+ const executor_binder<U, OtherExecutor>& other,
+ constraint_t<is_constructible<T, U>::value> = 0)
: base_type(e, other.get())
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
/// Move constructor.
executor_binder(executor_binder&& other)
- : base_type(ASIO_MOVE_CAST(executor_type)(other.get_executor()),
- ASIO_MOVE_CAST(T)(other.get()))
+ : base_type(static_cast<executor_type&&>(other.get_executor()),
+ static_cast<T&&>(other.get()))
{
}
/// Move construct the target object, but specify a different executor.
executor_binder(executor_arg_t, const executor_type& e,
executor_binder&& other)
- : base_type(e, ASIO_MOVE_CAST(T)(other.get()))
+ : base_type(e, static_cast<T&&>(other.get()))
{
}
/// Move construct from a different executor wrapper type.
template <typename U, typename OtherExecutor>
- executor_binder(executor_binder<U, OtherExecutor>&& other)
- : base_type(ASIO_MOVE_CAST(OtherExecutor)(other.get_executor()),
- ASIO_MOVE_CAST(U)(other.get()))
+ executor_binder(executor_binder<U, OtherExecutor>&& other,
+ constraint_t<is_constructible<Executor, OtherExecutor>::value> = 0,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : base_type(static_cast<OtherExecutor&&>(other.get_executor()),
+ static_cast<U&&>(other.get()))
{
}
@@ -361,124 +346,49 @@ public:
/// different executor.
template <typename U, typename OtherExecutor>
executor_binder(executor_arg_t, const executor_type& e,
- executor_binder<U, OtherExecutor>&& other)
- : base_type(e, ASIO_MOVE_CAST(U)(other.get()))
+ executor_binder<U, OtherExecutor>&& other,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : base_type(e, static_cast<U&&>(other.get()))
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
/// Destructor.
~executor_binder()
{
}
/// Obtain a reference to the target object.
- target_type& get() ASIO_NOEXCEPT
+ target_type& get() noexcept
{
return this->target_;
}
/// Obtain a reference to the target object.
- const target_type& get() const ASIO_NOEXCEPT
+ const target_type& get() const noexcept
{
return this->target_;
}
/// Obtain the associated executor.
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return this->executor_;
}
-#if defined(GENERATING_DOCUMENTATION)
-
- template <typename... Args> auto operator()(Args&& ...);
- template <typename... Args> auto operator()(Args&& ...) const;
-
-#elif defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
/// Forwarding function call operator.
template <typename... Args>
- typename result_of<T(Args...)>::type operator()(
- ASIO_MOVE_ARG(Args)... args)
+ result_of_t<T(Args...)> operator()(Args&&... args)
{
- return this->target_(ASIO_MOVE_CAST(Args)(args)...);
+ return this->target_(static_cast<Args&&>(args)...);
}
/// Forwarding function call operator.
template <typename... Args>
- typename result_of<T(Args...)>::type operator()(
- ASIO_MOVE_ARG(Args)... args) const
+ result_of_t<T(Args...)> operator()(Args&&... args) const
{
- return this->target_(ASIO_MOVE_CAST(Args)(args)...);
+ return this->target_(static_cast<Args&&>(args)...);
}
-#elif defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER)
-
- typename detail::executor_binder_result_of0<T>::type operator()()
- {
- return this->target_();
- }
-
- typename detail::executor_binder_result_of0<T>::type operator()() const
- {
- return this->target_();
- }
-
-#define ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- typename result_of<T(ASIO_VARIADIC_TARGS(n))>::type operator()( \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- typename result_of<T(ASIO_VARIADIC_TARGS(n))>::type operator()( \
- ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- { \
- return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF)
-#undef ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF
-
-#else // defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER)
-
- typedef typename detail::executor_binder_result_type<T>::result_type_or_void
- result_type_or_void;
-
- result_type_or_void operator()()
- {
- return this->target_();
- }
-
- result_type_or_void operator()() const
- {
- return this->target_();
- }
-
-#define ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- result_type_or_void operator()( \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- result_type_or_void operator()( \
- ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- { \
- return this->target_(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF)
-#undef ASIO_PRIVATE_BIND_EXECUTOR_CALL_DEF
-
-#endif // defined(ASIO_HAS_STD_TYPE_TRAITS) && !defined(_MSC_VER)
-
private:
typedef detail::executor_binder_base<T, Executor,
uses_executor<T, Executor>::value> base_type;
@@ -486,27 +396,27 @@ private:
/// Associate an object of type @c T with an executor of type @c Executor.
template <typename Executor, typename T>
-inline executor_binder<typename decay<T>::type, Executor>
-bind_executor(const Executor& ex, ASIO_MOVE_ARG(T) t,
- typename constraint<
+ASIO_NODISCARD inline executor_binder<decay_t<T>, Executor>
+bind_executor(const Executor& ex, T&& t,
+ constraint_t<
is_executor<Executor>::value || execution::is_executor<Executor>::value
- >::type = 0)
+ > = 0)
{
- return executor_binder<typename decay<T>::type, Executor>(
- executor_arg_t(), ex, ASIO_MOVE_CAST(T)(t));
+ return executor_binder<decay_t<T>, Executor>(
+ executor_arg_t(), ex, static_cast<T&&>(t));
}
/// Associate an object of type @c T with an execution context's executor.
template <typename ExecutionContext, typename T>
-inline executor_binder<typename decay<T>::type,
- typename ExecutionContext::executor_type>
-bind_executor(ExecutionContext& ctx, ASIO_MOVE_ARG(T) t,
- typename constraint<is_convertible<
- ExecutionContext&, execution_context&>::value>::type = 0)
+ASIO_NODISCARD inline executor_binder<decay_t<T>,
+ typename ExecutionContext::executor_type>
+bind_executor(ExecutionContext& ctx, T&& t,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
{
- return executor_binder<typename decay<T>::type,
- typename ExecutionContext::executor_type>(
- executor_arg_t(), ctx.get_executor(), ASIO_MOVE_CAST(T)(t));
+ return executor_binder<decay_t<T>, typename ExecutionContext::executor_type>(
+ executor_arg_t(), ctx.get_executor(), static_cast<T&&>(t));
}
#if !defined(GENERATING_DOCUMENTATION)
@@ -518,20 +428,38 @@ struct uses_executor<executor_binder<T, Executor>, Executor>
namespace detail {
template <typename TargetAsyncResult, typename Executor, typename = void>
-struct executor_binder_async_result_completion_handler_type
+class executor_binder_completion_handler_async_result
{
+public:
+ template <typename T>
+ explicit executor_binder_completion_handler_async_result(T&)
+ {
+ }
};
template <typename TargetAsyncResult, typename Executor>
-struct executor_binder_async_result_completion_handler_type<
- TargetAsyncResult, Executor,
- typename void_type<
- typename TargetAsyncResult::completion_handler_type
- >::type>
+class executor_binder_completion_handler_async_result<
+ TargetAsyncResult, Executor,
+ void_t<typename TargetAsyncResult::completion_handler_type >>
{
+private:
+ TargetAsyncResult target_;
+
+public:
typedef executor_binder<
typename TargetAsyncResult::completion_handler_type, Executor>
completion_handler_type;
+
+ explicit executor_binder_completion_handler_async_result(
+ typename TargetAsyncResult::completion_handler_type& handler)
+ : target_(handler)
+ {
+ }
+
+ auto get() -> decltype(target_.get())
+ {
+ return target_.get();
+ }
};
template <typename TargetAsyncResult, typename = void>
@@ -540,11 +468,8 @@ struct executor_binder_async_result_return_type
};
template <typename TargetAsyncResult>
-struct executor_binder_async_result_return_type<
- TargetAsyncResult,
- typename void_type<
- typename TargetAsyncResult::return_type
- >::type>
+struct executor_binder_async_result_return_type<TargetAsyncResult,
+ void_t<typename TargetAsyncResult::return_type>>
{
typedef typename TargetAsyncResult::return_type return_type;
};
@@ -553,181 +478,83 @@ struct executor_binder_async_result_return_type<
template <typename T, typename Executor, typename Signature>
class async_result<executor_binder<T, Executor>, Signature> :
- public detail::executor_binder_async_result_completion_handler_type<
- async_result<T, Signature>, Executor>,
+ public detail::executor_binder_completion_handler_async_result<
+ async_result<T, Signature>, Executor>,
public detail::executor_binder_async_result_return_type<
- async_result<T, Signature> >
+ async_result<T, Signature>>
{
public:
explicit async_result(executor_binder<T, Executor>& b)
- : target_(b.get())
+ : detail::executor_binder_completion_handler_async_result<
+ async_result<T, Signature>, Executor>(b.get())
{
}
- typename async_result<T, Signature>::return_type get()
- {
- return target_.get();
- }
-
template <typename Initiation>
struct init_wrapper
{
template <typename Init>
- init_wrapper(const Executor& ex, ASIO_MOVE_ARG(Init) init)
+ init_wrapper(const Executor& ex, Init&& init)
: ex_(ex),
- initiation_(ASIO_MOVE_CAST(Init)(init))
+ initiation_(static_cast<Init&&>(init))
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Handler, typename... Args>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Args)... args)
+ void operator()(Handler&& handler, Args&&... args)
{
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- executor_binder<typename decay<Handler>::type, Executor>(
- executor_arg_t(), ex_, ASIO_MOVE_CAST(Handler)(handler)),
- ASIO_MOVE_CAST(Args)(args)...);
+ static_cast<Initiation&&>(initiation_)(
+ executor_binder<decay_t<Handler>, Executor>(
+ executor_arg_t(), ex_, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Args)... args) const
+ void operator()(Handler&& handler, Args&&... args) const
{
initiation_(
- executor_binder<typename decay<Handler>::type, Executor>(
- executor_arg_t(), ex_, ASIO_MOVE_CAST(Handler)(handler)),
- ASIO_MOVE_CAST(Args)(args)...);
+ executor_binder<decay_t<Handler>, Executor>(
+ executor_arg_t(), ex_, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Handler>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler)
- {
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- executor_binder<typename decay<Handler>::type, Executor>(
- executor_arg_t(), ex_, ASIO_MOVE_CAST(Handler)(handler)));
- }
-
- template <typename Handler>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler) const
- {
- initiation_(
- executor_binder<typename decay<Handler>::type, Executor>(
- executor_arg_t(), ex_, ASIO_MOVE_CAST(Handler)(handler)));
- }
-
-#define ASIO_PRIVATE_INIT_WRAPPER_DEF(n) \
- template <typename Handler, ASIO_VARIADIC_TPARAMS(n)> \
- void operator()( \
- ASIO_MOVE_ARG(Handler) handler, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- ASIO_MOVE_CAST(Initiation)(initiation_)( \
- executor_binder<typename decay<Handler>::type, Executor>( \
- executor_arg_t(), ex_, ASIO_MOVE_CAST(Handler)(handler)), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <typename Handler, ASIO_VARIADIC_TPARAMS(n)> \
- void operator()( \
- ASIO_MOVE_ARG(Handler) handler, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- { \
- initiation_( \
- executor_binder<typename decay<Handler>::type, Executor>( \
- executor_arg_t(), ex_, ASIO_MOVE_CAST(Handler)(handler)), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INIT_WRAPPER_DEF)
-#undef ASIO_PRIVATE_INIT_WRAPPER_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
Executor ex_;
Initiation initiation_;
};
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Initiation, typename RawCompletionToken, typename... Args>
- static ASIO_INITFN_DEDUCED_RESULT_TYPE(T, Signature,
- (async_result<T, Signature>::initiate(
- declval<init_wrapper<typename decay<Initiation>::type> >(),
- declval<T>(), declval<ASIO_MOVE_ARG(Args)>()...)))
- initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
- {
- return async_initiate<T, Signature>(
- init_wrapper<typename decay<Initiation>::type>(
- token.get_executor(), ASIO_MOVE_CAST(Initiation)(initiation)),
- token.get(), ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Initiation, typename RawCompletionToken>
- static ASIO_INITFN_DEDUCED_RESULT_TYPE(T, Signature,
- (async_result<T, Signature>::initiate(
- declval<init_wrapper<typename decay<Initiation>::type> >(),
- declval<T>())))
- initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token)
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<T, Signature>(
+ declval<init_wrapper<decay_t<Initiation>>>(),
+ token.get(), static_cast<Args&&>(args)...))
{
return async_initiate<T, Signature>(
- init_wrapper<typename decay<Initiation>::type>(
- token.get_executor(), ASIO_MOVE_CAST(Initiation)(initiation)),
- token.get());
+ init_wrapper<decay_t<Initiation>>(
+ token.get_executor(), static_cast<Initiation&&>(initiation)),
+ token.get(), static_cast<Args&&>(args)...);
}
-#define ASIO_PRIVATE_INITIATE_DEF(n) \
- template <typename Initiation, typename RawCompletionToken, \
- ASIO_VARIADIC_TPARAMS(n)> \
- static ASIO_INITFN_DEDUCED_RESULT_TYPE(T, Signature, \
- (async_result<T, Signature>::initiate( \
- declval<init_wrapper<typename decay<Initiation>::type> >(), \
- declval<T>(), ASIO_VARIADIC_MOVE_DECLVAL(n)))) \
- initiate( \
- ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_MOVE_ARG(RawCompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return async_initiate<T, Signature>( \
- init_wrapper<typename decay<Initiation>::type>( \
- token.get_executor(), ASIO_MOVE_CAST(Initiation)(initiation)), \
- token.get(), ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF)
-#undef ASIO_PRIVATE_INITIATE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
private:
- async_result(const async_result&) ASIO_DELETED;
- async_result& operator=(const async_result&) ASIO_DELETED;
-
- async_result<T, Signature> target_;
+ async_result(const async_result&) = delete;
+ async_result& operator=(const async_result&) = delete;
};
template <template <typename, typename> class Associator,
typename T, typename Executor, typename DefaultCandidate>
struct associator<Associator, executor_binder<T, Executor>, DefaultCandidate>
+ : Associator<T, DefaultCandidate>
{
- typedef typename Associator<T, DefaultCandidate>::type type;
+ static typename Associator<T, DefaultCandidate>::type get(
+ const executor_binder<T, Executor>& b) noexcept
+ {
+ return Associator<T, DefaultCandidate>::get(b.get());
+ }
- static type get(const executor_binder<T, Executor>& b,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ static auto get(const executor_binder<T, Executor>& b,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<T, DefaultCandidate>::get(b.get(), c))
{
return Associator<T, DefaultCandidate>::get(b.get(), c);
}
@@ -738,8 +565,9 @@ struct associated_executor<executor_binder<T, Executor>, Executor1>
{
typedef Executor type;
- static type get(const executor_binder<T, Executor>& b,
- const Executor1& = Executor1()) ASIO_NOEXCEPT
+ static auto get(const executor_binder<T, Executor>& b,
+ const Executor1& = Executor1()) noexcept
+ -> decltype(b.get_executor())
{
return b.get_executor();
}
diff --git a/3rdparty/asio/include/asio/bind_immediate_executor.hpp b/3rdparty/asio/include/asio/bind_immediate_executor.hpp
new file mode 100644
index 00000000000..b02c520a689
--- /dev/null
+++ b/3rdparty/asio/include/asio/bind_immediate_executor.hpp
@@ -0,0 +1,549 @@
+//
+// bind_immediate_executor.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_BIND_IMMEDIATE_EXECUTOR_HPP
+#define ASIO_BIND_IMMEDIATE_EXECUTOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/associated_immediate_executor.hpp"
+#include "asio/associator.hpp"
+#include "asio/async_result.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+// Helper to automatically define nested typedef result_type.
+
+template <typename T, typename = void>
+struct immediate_executor_binder_result_type
+{
+protected:
+ typedef void result_type_or_void;
+};
+
+template <typename T>
+struct immediate_executor_binder_result_type<T, void_t<typename T::result_type>>
+{
+ typedef typename T::result_type result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R>
+struct immediate_executor_binder_result_type<R(*)()>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R>
+struct immediate_executor_binder_result_type<R(&)()>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R, typename A1>
+struct immediate_executor_binder_result_type<R(*)(A1)>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R, typename A1>
+struct immediate_executor_binder_result_type<R(&)(A1)>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R, typename A1, typename A2>
+struct immediate_executor_binder_result_type<R(*)(A1, A2)>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+template <typename R, typename A1, typename A2>
+struct immediate_executor_binder_result_type<R(&)(A1, A2)>
+{
+ typedef R result_type;
+protected:
+ typedef result_type result_type_or_void;
+};
+
+// Helper to automatically define nested typedef argument_type.
+
+template <typename T, typename = void>
+struct immediate_executor_binder_argument_type {};
+
+template <typename T>
+struct immediate_executor_binder_argument_type<T,
+ void_t<typename T::argument_type>>
+{
+ typedef typename T::argument_type argument_type;
+};
+
+template <typename R, typename A1>
+struct immediate_executor_binder_argument_type<R(*)(A1)>
+{
+ typedef A1 argument_type;
+};
+
+template <typename R, typename A1>
+struct immediate_executor_binder_argument_type<R(&)(A1)>
+{
+ typedef A1 argument_type;
+};
+
+// Helper to automatically define nested typedefs first_argument_type and
+// second_argument_type.
+
+template <typename T, typename = void>
+struct immediate_executor_binder_argument_types {};
+
+template <typename T>
+struct immediate_executor_binder_argument_types<T,
+ void_t<typename T::first_argument_type>>
+{
+ typedef typename T::first_argument_type first_argument_type;
+ typedef typename T::second_argument_type second_argument_type;
+};
+
+template <typename R, typename A1, typename A2>
+struct immediate_executor_binder_argument_type<R(*)(A1, A2)>
+{
+ typedef A1 first_argument_type;
+ typedef A2 second_argument_type;
+};
+
+template <typename R, typename A1, typename A2>
+struct immediate_executor_binder_argument_type<R(&)(A1, A2)>
+{
+ typedef A1 first_argument_type;
+ typedef A2 second_argument_type;
+};
+
+} // namespace detail
+
+/// A call wrapper type to bind a immediate executor of type @c Executor
+/// to an object of type @c T.
+template <typename T, typename Executor>
+class immediate_executor_binder
+#if !defined(GENERATING_DOCUMENTATION)
+ : public detail::immediate_executor_binder_result_type<T>,
+ public detail::immediate_executor_binder_argument_type<T>,
+ public detail::immediate_executor_binder_argument_types<T>
+#endif // !defined(GENERATING_DOCUMENTATION)
+{
+public:
+ /// The type of the target object.
+ typedef T target_type;
+
+ /// The type of the associated immediate executor.
+ typedef Executor immediate_executor_type;
+
+#if defined(GENERATING_DOCUMENTATION)
+ /// The return type if a function.
+ /**
+ * The type of @c result_type is based on the type @c T of the wrapper's
+ * target object:
+ *
+ * @li if @c T is a pointer to function type, @c result_type is a synonym for
+ * the return type of @c T;
+ *
+ * @li if @c T is a class type with a member type @c result_type, then @c
+ * result_type is a synonym for @c T::result_type;
+ *
+ * @li otherwise @c result_type is not defined.
+ */
+ typedef see_below result_type;
+
+ /// The type of the function's argument.
+ /**
+ * The type of @c argument_type is based on the type @c T of the wrapper's
+ * target object:
+ *
+ * @li if @c T is a pointer to a function type accepting a single argument,
+ * @c argument_type is a synonym for the return type of @c T;
+ *
+ * @li if @c T is a class type with a member type @c argument_type, then @c
+ * argument_type is a synonym for @c T::argument_type;
+ *
+ * @li otherwise @c argument_type is not defined.
+ */
+ typedef see_below argument_type;
+
+ /// The type of the function's first argument.
+ /**
+ * The type of @c first_argument_type is based on the type @c T of the
+ * wrapper's target object:
+ *
+ * @li if @c T is a pointer to a function type accepting two arguments, @c
+ * first_argument_type is a synonym for the return type of @c T;
+ *
+ * @li if @c T is a class type with a member type @c first_argument_type,
+ * then @c first_argument_type is a synonym for @c T::first_argument_type;
+ *
+ * @li otherwise @c first_argument_type is not defined.
+ */
+ typedef see_below first_argument_type;
+
+ /// The type of the function's second argument.
+ /**
+ * The type of @c second_argument_type is based on the type @c T of the
+ * wrapper's target object:
+ *
+ * @li if @c T is a pointer to a function type accepting two arguments, @c
+ * second_argument_type is a synonym for the return type of @c T;
+ *
+ * @li if @c T is a class type with a member type @c first_argument_type,
+ * then @c second_argument_type is a synonym for @c T::second_argument_type;
+ *
+ * @li otherwise @c second_argument_type is not defined.
+ */
+ typedef see_below second_argument_type;
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Construct a immediate executor wrapper for the specified object.
+ /**
+ * This constructor is only valid if the type @c T is constructible from type
+ * @c U.
+ */
+ template <typename U>
+ immediate_executor_binder(const immediate_executor_type& e,
+ U&& u)
+ : executor_(e),
+ target_(static_cast<U&&>(u))
+ {
+ }
+
+ /// Copy constructor.
+ immediate_executor_binder(const immediate_executor_binder& other)
+ : executor_(other.get_immediate_executor()),
+ target_(other.get())
+ {
+ }
+
+ /// Construct a copy, but specify a different immediate executor.
+ immediate_executor_binder(const immediate_executor_type& e,
+ const immediate_executor_binder& other)
+ : executor_(e),
+ target_(other.get())
+ {
+ }
+
+ /// Construct a copy of a different immediate executor wrapper type.
+ /**
+ * This constructor is only valid if the @c Executor type is
+ * constructible from type @c OtherExecutor, and the type @c T is
+ * constructible from type @c U.
+ */
+ template <typename U, typename OtherExecutor>
+ immediate_executor_binder(
+ const immediate_executor_binder<U, OtherExecutor>& other,
+ constraint_t<is_constructible<Executor, OtherExecutor>::value> = 0,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : executor_(other.get_immediate_executor()),
+ target_(other.get())
+ {
+ }
+
+ /// Construct a copy of a different immediate executor wrapper type, but
+ /// specify a different immediate executor.
+ /**
+ * This constructor is only valid if the type @c T is constructible from type
+ * @c U.
+ */
+ template <typename U, typename OtherExecutor>
+ immediate_executor_binder(const immediate_executor_type& e,
+ const immediate_executor_binder<U, OtherExecutor>& other,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : executor_(e),
+ target_(other.get())
+ {
+ }
+
+ /// Move constructor.
+ immediate_executor_binder(immediate_executor_binder&& other)
+ : executor_(static_cast<immediate_executor_type&&>(
+ other.get_immediate_executor())),
+ target_(static_cast<T&&>(other.get()))
+ {
+ }
+
+ /// Move construct the target object, but specify a different immediate
+ /// executor.
+ immediate_executor_binder(const immediate_executor_type& e,
+ immediate_executor_binder&& other)
+ : executor_(e),
+ target_(static_cast<T&&>(other.get()))
+ {
+ }
+
+ /// Move construct from a different immediate executor wrapper type.
+ template <typename U, typename OtherExecutor>
+ immediate_executor_binder(
+ immediate_executor_binder<U, OtherExecutor>&& other,
+ constraint_t<is_constructible<Executor, OtherExecutor>::value> = 0,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : executor_(static_cast<OtherExecutor&&>(
+ other.get_immediate_executor())),
+ target_(static_cast<U&&>(other.get()))
+ {
+ }
+
+ /// Move construct from a different immediate executor wrapper type, but
+ /// specify a different immediate executor.
+ template <typename U, typename OtherExecutor>
+ immediate_executor_binder(const immediate_executor_type& e,
+ immediate_executor_binder<U, OtherExecutor>&& other,
+ constraint_t<is_constructible<T, U>::value> = 0)
+ : executor_(e),
+ target_(static_cast<U&&>(other.get()))
+ {
+ }
+
+ /// Destructor.
+ ~immediate_executor_binder()
+ {
+ }
+
+ /// Obtain a reference to the target object.
+ target_type& get() noexcept
+ {
+ return target_;
+ }
+
+ /// Obtain a reference to the target object.
+ const target_type& get() const noexcept
+ {
+ return target_;
+ }
+
+ /// Obtain the associated immediate executor.
+ immediate_executor_type get_immediate_executor() const noexcept
+ {
+ return executor_;
+ }
+
+ /// Forwarding function call operator.
+ template <typename... Args>
+ result_of_t<T(Args...)> operator()(Args&&... args)
+ {
+ return target_(static_cast<Args&&>(args)...);
+ }
+
+ /// Forwarding function call operator.
+ template <typename... Args>
+ result_of_t<T(Args...)> operator()(Args&&... args) const
+ {
+ return target_(static_cast<Args&&>(args)...);
+ }
+
+private:
+ Executor executor_;
+ T target_;
+};
+
+/// Associate an object of type @c T with a immediate executor of type
+/// @c Executor.
+template <typename Executor, typename T>
+ASIO_NODISCARD inline immediate_executor_binder<decay_t<T>, Executor>
+bind_immediate_executor(const Executor& e, T&& t)
+{
+ return immediate_executor_binder<
+ decay_t<T>, Executor>(
+ e, static_cast<T&&>(t));
+}
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+namespace detail {
+
+template <typename TargetAsyncResult, typename Executor, typename = void>
+class immediate_executor_binder_completion_handler_async_result
+{
+public:
+ template <typename T>
+ explicit immediate_executor_binder_completion_handler_async_result(T&)
+ {
+ }
+};
+
+template <typename TargetAsyncResult, typename Executor>
+class immediate_executor_binder_completion_handler_async_result<
+ TargetAsyncResult, Executor,
+ void_t<
+ typename TargetAsyncResult::completion_handler_type
+ >>
+{
+private:
+ TargetAsyncResult target_;
+
+public:
+ typedef immediate_executor_binder<
+ typename TargetAsyncResult::completion_handler_type, Executor>
+ completion_handler_type;
+
+ explicit immediate_executor_binder_completion_handler_async_result(
+ typename TargetAsyncResult::completion_handler_type& handler)
+ : target_(handler)
+ {
+ }
+
+ auto get() -> decltype(target_.get())
+ {
+ return target_.get();
+ }
+};
+
+template <typename TargetAsyncResult, typename = void>
+struct immediate_executor_binder_async_result_return_type
+{
+};
+
+template <typename TargetAsyncResult>
+struct immediate_executor_binder_async_result_return_type<
+ TargetAsyncResult,
+ void_t<
+ typename TargetAsyncResult::return_type
+ >>
+{
+ typedef typename TargetAsyncResult::return_type return_type;
+};
+
+} // namespace detail
+
+template <typename T, typename Executor, typename Signature>
+class async_result<immediate_executor_binder<T, Executor>, Signature> :
+ public detail::immediate_executor_binder_completion_handler_async_result<
+ async_result<T, Signature>, Executor>,
+ public detail::immediate_executor_binder_async_result_return_type<
+ async_result<T, Signature>>
+{
+public:
+ explicit async_result(immediate_executor_binder<T, Executor>& b)
+ : detail::immediate_executor_binder_completion_handler_async_result<
+ async_result<T, Signature>, Executor>(b.get())
+ {
+ }
+
+ template <typename Initiation>
+ struct init_wrapper
+ {
+ template <typename Init>
+ init_wrapper(const Executor& e, Init&& init)
+ : executor_(e),
+ initiation_(static_cast<Init&&>(init))
+ {
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args)
+ {
+ static_cast<Initiation&&>(initiation_)(
+ immediate_executor_binder<
+ decay_t<Handler>, Executor>(
+ executor_, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args) const
+ {
+ initiation_(
+ immediate_executor_binder<
+ decay_t<Handler>, Executor>(
+ executor_, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
+ }
+
+ Executor executor_;
+ Initiation initiation_;
+ };
+
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<T, Signature>(
+ declval<init_wrapper<decay_t<Initiation>>>(),
+ token.get(), static_cast<Args&&>(args)...))
+ {
+ return async_initiate<T, Signature>(
+ init_wrapper<decay_t<Initiation>>(
+ token.get_immediate_executor(),
+ static_cast<Initiation&&>(initiation)),
+ token.get(), static_cast<Args&&>(args)...);
+ }
+
+private:
+ async_result(const async_result&) = delete;
+ async_result& operator=(const async_result&) = delete;
+
+ async_result<T, Signature> target_;
+};
+
+template <template <typename, typename> class Associator,
+ typename T, typename Executor, typename DefaultCandidate>
+struct associator<Associator,
+ immediate_executor_binder<T, Executor>,
+ DefaultCandidate>
+ : Associator<T, DefaultCandidate>
+{
+ static typename Associator<T, DefaultCandidate>::type get(
+ const immediate_executor_binder<T, Executor>& b) noexcept
+ {
+ return Associator<T, DefaultCandidate>::get(b.get());
+ }
+
+ static auto get(const immediate_executor_binder<T, Executor>& b,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<T, DefaultCandidate>::get(b.get(), c))
+ {
+ return Associator<T, DefaultCandidate>::get(b.get(), c);
+ }
+};
+
+template <typename T, typename Executor, typename Executor1>
+struct associated_immediate_executor<
+ immediate_executor_binder<T, Executor>,
+ Executor1>
+{
+ typedef Executor type;
+
+ static auto get(const immediate_executor_binder<T, Executor>& b,
+ const Executor1& = Executor1()) noexcept
+ -> decltype(b.get_immediate_executor())
+ {
+ return b.get_immediate_executor();
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_BIND_IMMEDIATE_EXECUTOR_HPP
diff --git a/3rdparty/asio/include/asio/buffer.hpp b/3rdparty/asio/include/asio/buffer.hpp
index 32848dc7850..ad49f290a66 100644
--- a/3rdparty/asio/include/asio/buffer.hpp
+++ b/3rdparty/asio/include/asio/buffer.hpp
@@ -2,7 +2,7 @@
// buffer.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -27,6 +27,7 @@
#include "asio/detail/string_view.hpp"
#include "asio/detail/throw_exception.hpp"
#include "asio/detail/type_traits.hpp"
+#include "asio/is_contiguous_iterator.hpp"
#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1700)
# if defined(_HAS_ITERATOR_DEBUGGING) && (_HAS_ITERATOR_DEBUGGING != 0)
@@ -48,21 +49,6 @@
# include "asio/detail/functional.hpp"
#endif // ASIO_ENABLE_BUFFER_DEBUGGING
-#if defined(ASIO_HAS_BOOST_WORKAROUND)
-# include <boost/detail/workaround.hpp>
-# if !defined(__clang__)
-# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
-# define ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND
-# endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
-# elif BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
-# define ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND
-# endif // BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
-#endif // defined(ASIO_HAS_BOOST_WORKAROUND)
-
-#if defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
-# include "asio/detail/type_traits.hpp"
-#endif // defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -93,14 +79,14 @@ class mutable_buffer
{
public:
/// Construct an empty buffer.
- mutable_buffer() ASIO_NOEXCEPT
+ mutable_buffer() noexcept
: data_(0),
size_(0)
{
}
/// Construct a buffer to represent a given memory range.
- mutable_buffer(void* data, std::size_t size) ASIO_NOEXCEPT
+ mutable_buffer(void* data, std::size_t size) noexcept
: data_(data),
size_(size)
{
@@ -122,7 +108,7 @@ public:
#endif // ASIO_ENABLE_BUFFER_DEBUGGING
/// Get a pointer to the beginning of the memory range.
- void* data() const ASIO_NOEXCEPT
+ void* data() const noexcept
{
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
if (size_ && debug_check_)
@@ -132,13 +118,13 @@ public:
}
/// Get the size of the memory range.
- std::size_t size() const ASIO_NOEXCEPT
+ std::size_t size() const noexcept
{
return size_;
}
/// Move the start of the buffer by the specified number of bytes.
- mutable_buffer& operator+=(std::size_t n) ASIO_NOEXCEPT
+ mutable_buffer& operator+=(std::size_t n) noexcept
{
std::size_t offset = n < size_ ? n : size_;
data_ = static_cast<char*>(data_) + offset;
@@ -170,7 +156,7 @@ public:
typedef const mutable_buffer* const_iterator;
/// Construct to represent a given memory range.
- mutable_buffers_1(void* data, std::size_t size) ASIO_NOEXCEPT
+ mutable_buffers_1(void* data, std::size_t size) noexcept
: mutable_buffer(data, size)
{
}
@@ -184,19 +170,19 @@ public:
#endif // ASIO_ENABLE_BUFFER_DEBUGGING
/// Construct to represent a single modifiable buffer.
- explicit mutable_buffers_1(const mutable_buffer& b) ASIO_NOEXCEPT
+ explicit mutable_buffers_1(const mutable_buffer& b) noexcept
: mutable_buffer(b)
{
}
/// Get a random-access iterator to the first element.
- const_iterator begin() const ASIO_NOEXCEPT
+ const_iterator begin() const noexcept
{
return this;
}
/// Get a random-access iterator for one past the last element.
- const_iterator end() const ASIO_NOEXCEPT
+ const_iterator end() const noexcept
{
return begin() + 1;
}
@@ -227,21 +213,21 @@ class const_buffer
{
public:
/// Construct an empty buffer.
- const_buffer() ASIO_NOEXCEPT
+ const_buffer() noexcept
: data_(0),
size_(0)
{
}
/// Construct a buffer to represent a given memory range.
- const_buffer(const void* data, std::size_t size) ASIO_NOEXCEPT
+ const_buffer(const void* data, std::size_t size) noexcept
: data_(data),
size_(size)
{
}
/// Construct a non-modifiable buffer from a modifiable one.
- const_buffer(const mutable_buffer& b) ASIO_NOEXCEPT
+ const_buffer(const mutable_buffer& b) noexcept
: data_(b.data()),
size_(b.size())
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -266,7 +252,7 @@ public:
#endif // ASIO_ENABLE_BUFFER_DEBUGGING
/// Get a pointer to the beginning of the memory range.
- const void* data() const ASIO_NOEXCEPT
+ const void* data() const noexcept
{
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
if (size_ && debug_check_)
@@ -276,13 +262,13 @@ public:
}
/// Get the size of the memory range.
- std::size_t size() const ASIO_NOEXCEPT
+ std::size_t size() const noexcept
{
return size_;
}
/// Move the start of the buffer by the specified number of bytes.
- const_buffer& operator+=(std::size_t n) ASIO_NOEXCEPT
+ const_buffer& operator+=(std::size_t n) noexcept
{
std::size_t offset = n < size_ ? n : size_;
data_ = static_cast<const char*>(data_) + offset;
@@ -314,7 +300,7 @@ public:
typedef const const_buffer* const_iterator;
/// Construct to represent a given memory range.
- const_buffers_1(const void* data, std::size_t size) ASIO_NOEXCEPT
+ const_buffers_1(const void* data, std::size_t size) noexcept
: const_buffer(data, size)
{
}
@@ -328,19 +314,19 @@ public:
#endif // ASIO_ENABLE_BUFFER_DEBUGGING
/// Construct to represent a single non-modifiable buffer.
- explicit const_buffers_1(const const_buffer& b) ASIO_NOEXCEPT
+ explicit const_buffers_1(const const_buffer& b) noexcept
: const_buffer(b)
{
}
/// Get a random-access iterator to the first element.
- const_iterator begin() const ASIO_NOEXCEPT
+ const_iterator begin() const noexcept
{
return this;
}
/// Get a random-access iterator for one past the last element.
- const_iterator end() const ASIO_NOEXCEPT
+ const_iterator end() const noexcept
{
return begin() + 1;
}
@@ -361,13 +347,13 @@ public:
typedef const mutable_buffer* const_iterator;
/// Get a random-access iterator to the first element.
- const_iterator begin() const ASIO_NOEXCEPT
+ const_iterator begin() const noexcept
{
return &buf_;
}
/// Get a random-access iterator for one past the last element.
- const_iterator end() const ASIO_NOEXCEPT
+ const_iterator end() const noexcept
{
return &buf_;
}
@@ -386,9 +372,9 @@ private:
/// Get an iterator to the first element in a buffer sequence.
template <typename MutableBuffer>
inline const mutable_buffer* buffer_sequence_begin(const MutableBuffer& b,
- typename constraint<
+ constraint_t<
is_convertible<const MutableBuffer*, const mutable_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT
+ > = 0) noexcept
{
return static_cast<const mutable_buffer*>(detail::addressof(b));
}
@@ -396,22 +382,20 @@ inline const mutable_buffer* buffer_sequence_begin(const MutableBuffer& b,
/// Get an iterator to the first element in a buffer sequence.
template <typename ConstBuffer>
inline const const_buffer* buffer_sequence_begin(const ConstBuffer& b,
- typename constraint<
+ constraint_t<
is_convertible<const ConstBuffer*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT
+ > = 0) noexcept
{
return static_cast<const const_buffer*>(detail::addressof(b));
}
-#if defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
-
/// Get an iterator to the first element in a buffer sequence.
template <typename C>
inline auto buffer_sequence_begin(C& c,
- typename constraint<
+ constraint_t<
!is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT -> decltype(c.begin())
+ > = 0) noexcept -> decltype(c.begin())
{
return c.begin();
}
@@ -419,38 +403,14 @@ inline auto buffer_sequence_begin(C& c,
/// Get an iterator to the first element in a buffer sequence.
template <typename C>
inline auto buffer_sequence_begin(const C& c,
- typename constraint<
- !is_convertible<const C*, const mutable_buffer*>::value
- && !is_convertible<const C*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT -> decltype(c.begin())
-{
- return c.begin();
-}
-
-#else // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
-
-template <typename C>
-inline typename C::iterator buffer_sequence_begin(C& c,
- typename constraint<
- !is_convertible<const C*, const mutable_buffer*>::value
- && !is_convertible<const C*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT
-{
- return c.begin();
-}
-
-template <typename C>
-inline typename C::const_iterator buffer_sequence_begin(const C& c,
- typename constraint<
+ constraint_t<
!is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT
+ > = 0) noexcept -> decltype(c.begin())
{
return c.begin();
}
-#endif // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
-
/*@}*/
/** @defgroup buffer_sequence_end asio::buffer_sequence_end
@@ -463,9 +423,9 @@ inline typename C::const_iterator buffer_sequence_begin(const C& c,
/// Get an iterator to one past the end element in a buffer sequence.
template <typename MutableBuffer>
inline const mutable_buffer* buffer_sequence_end(const MutableBuffer& b,
- typename constraint<
+ constraint_t<
is_convertible<const MutableBuffer*, const mutable_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT
+ > = 0) noexcept
{
return static_cast<const mutable_buffer*>(detail::addressof(b)) + 1;
}
@@ -473,22 +433,20 @@ inline const mutable_buffer* buffer_sequence_end(const MutableBuffer& b,
/// Get an iterator to one past the end element in a buffer sequence.
template <typename ConstBuffer>
inline const const_buffer* buffer_sequence_end(const ConstBuffer& b,
- typename constraint<
+ constraint_t<
is_convertible<const ConstBuffer*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT
+ > = 0) noexcept
{
return static_cast<const const_buffer*>(detail::addressof(b)) + 1;
}
-#if defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
-
/// Get an iterator to one past the end element in a buffer sequence.
template <typename C>
inline auto buffer_sequence_end(C& c,
- typename constraint<
+ constraint_t<
!is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT -> decltype(c.end())
+ > = 0) noexcept -> decltype(c.end())
{
return c.end();
}
@@ -496,38 +454,14 @@ inline auto buffer_sequence_end(C& c,
/// Get an iterator to one past the end element in a buffer sequence.
template <typename C>
inline auto buffer_sequence_end(const C& c,
- typename constraint<
- !is_convertible<const C*, const mutable_buffer*>::value
- && !is_convertible<const C*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT -> decltype(c.end())
-{
- return c.end();
-}
-
-#else // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
-
-template <typename C>
-inline typename C::iterator buffer_sequence_end(C& c,
- typename constraint<
- !is_convertible<const C*, const mutable_buffer*>::value
- && !is_convertible<const C*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT
-{
- return c.end();
-}
-
-template <typename C>
-inline typename C::const_iterator buffer_sequence_end(const C& c,
- typename constraint<
+ constraint_t<
!is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value
- >::type = 0) ASIO_NOEXCEPT
+ > = 0) noexcept -> decltype(c.end())
{
return c.end();
}
-#endif // defined(ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
-
/*@}*/
namespace detail {
@@ -539,25 +473,25 @@ struct multiple_buffers {};
// Helper trait to detect single buffers.
template <typename BufferSequence>
struct buffer_sequence_cardinality :
- conditional<
+ conditional_t<
is_same<BufferSequence, mutable_buffer>::value
#if !defined(ASIO_NO_DEPRECATED)
|| is_same<BufferSequence, mutable_buffers_1>::value
|| is_same<BufferSequence, const_buffers_1>::value
#endif // !defined(ASIO_NO_DEPRECATED)
|| is_same<BufferSequence, const_buffer>::value,
- one_buffer, multiple_buffers>::type {};
+ one_buffer, multiple_buffers> {};
template <typename Iterator>
inline std::size_t buffer_size(one_buffer,
- Iterator begin, Iterator) ASIO_NOEXCEPT
+ Iterator begin, Iterator) noexcept
{
return const_buffer(*begin).size();
}
template <typename Iterator>
inline std::size_t buffer_size(multiple_buffers,
- Iterator begin, Iterator end) ASIO_NOEXCEPT
+ Iterator begin, Iterator end) noexcept
{
std::size_t total_buffer_size = 0;
@@ -592,7 +526,7 @@ inline std::size_t buffer_size(multiple_buffers,
* ConstBufferSequence or @c MutableBufferSequence type requirements.
*/
template <typename BufferSequence>
-inline std::size_t buffer_size(const BufferSequence& b) ASIO_NOEXCEPT
+inline std::size_t buffer_size(const BufferSequence& b) noexcept
{
return detail::buffer_size(
detail::buffer_sequence_cardinality<BufferSequence>(),
@@ -627,14 +561,14 @@ inline std::size_t buffer_size(const BufferSequence& b) ASIO_NOEXCEPT
/// Cast a non-modifiable buffer to a specified pointer to POD type.
template <typename PointerToPodType>
-inline PointerToPodType buffer_cast(const mutable_buffer& b) ASIO_NOEXCEPT
+inline PointerToPodType buffer_cast(const mutable_buffer& b) noexcept
{
return static_cast<PointerToPodType>(b.data());
}
/// Cast a non-modifiable buffer to a specified pointer to POD type.
template <typename PointerToPodType>
-inline PointerToPodType buffer_cast(const const_buffer& b) ASIO_NOEXCEPT
+inline PointerToPodType buffer_cast(const const_buffer& b) noexcept
{
return static_cast<PointerToPodType>(b.data());
}
@@ -648,7 +582,7 @@ inline PointerToPodType buffer_cast(const const_buffer& b) ASIO_NOEXCEPT
* @relates mutable_buffer
*/
inline mutable_buffer operator+(const mutable_buffer& b,
- std::size_t n) ASIO_NOEXCEPT
+ std::size_t n) noexcept
{
std::size_t offset = n < b.size() ? n : b.size();
char* new_data = static_cast<char*>(b.data()) + offset;
@@ -665,7 +599,7 @@ inline mutable_buffer operator+(const mutable_buffer& b,
* @relates mutable_buffer
*/
inline mutable_buffer operator+(std::size_t n,
- const mutable_buffer& b) ASIO_NOEXCEPT
+ const mutable_buffer& b) noexcept
{
return b + n;
}
@@ -675,7 +609,7 @@ inline mutable_buffer operator+(std::size_t n,
* @relates const_buffer
*/
inline const_buffer operator+(const const_buffer& b,
- std::size_t n) ASIO_NOEXCEPT
+ std::size_t n) noexcept
{
std::size_t offset = n < b.size() ? n : b.size();
const char* new_data = static_cast<const char*>(b.data()) + offset;
@@ -692,7 +626,7 @@ inline const_buffer operator+(const const_buffer& b,
* @relates const_buffer
*/
inline const_buffer operator+(std::size_t n,
- const const_buffer& b) ASIO_NOEXCEPT
+ const const_buffer& b) noexcept
{
return b + n;
}
@@ -891,6 +825,25 @@ private:
* bufs2.push_back(asio::buffer(d2));
* bufs2.push_back(asio::buffer(d3));
* bytes_transferred = sock.send(bufs2); @endcode
+ *
+ * @par Buffer Literals
+ *
+ * The `_buf` literal suffix, defined in namespace
+ * <tt>asio::buffer_literals</tt>, may be used to create @c const_buffer
+ * objects from string, binary integer, and hexadecimal integer literals.
+ * For example:
+ *
+ * @code
+ * using namespace asio::buffer_literals;
+ *
+ * asio::const_buffer b1 = "hello"_buf;
+ * asio::const_buffer b2 = 0xdeadbeef_buf;
+ * asio::const_buffer b3 = 0x0123456789abcdef0123456789abcdef_buf;
+ * asio::const_buffer b4 = 0b1010101011001100_buf; @endcode
+ *
+ * Note that the memory associated with a buffer literal is valid for the
+ * lifetime of the program. This means that the buffer can be safely used with
+ * asynchronous operations.
*/
/*@{*/
@@ -906,8 +859,8 @@ private:
/**
* @returns <tt>mutable_buffer(b)</tt>.
*/
-inline ASIO_MUTABLE_BUFFER buffer(
- const mutable_buffer& b) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ const mutable_buffer& b) noexcept
{
return ASIO_MUTABLE_BUFFER(b);
}
@@ -919,8 +872,9 @@ inline ASIO_MUTABLE_BUFFER buffer(
* b.data(),
* min(b.size(), max_size_in_bytes)); @endcode
*/
-inline ASIO_MUTABLE_BUFFER buffer(const mutable_buffer& b,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ const mutable_buffer& b,
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_MUTABLE_BUFFER(
mutable_buffer(b.data(),
@@ -936,8 +890,8 @@ inline ASIO_MUTABLE_BUFFER buffer(const mutable_buffer& b,
/**
* @returns <tt>const_buffer(b)</tt>.
*/
-inline ASIO_CONST_BUFFER buffer(
- const const_buffer& b) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const const_buffer& b) noexcept
{
return ASIO_CONST_BUFFER(b);
}
@@ -949,8 +903,9 @@ inline ASIO_CONST_BUFFER buffer(
* b.data(),
* min(b.size(), max_size_in_bytes)); @endcode
*/
-inline ASIO_CONST_BUFFER buffer(const const_buffer& b,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const const_buffer& b,
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(b.data(),
b.size() < max_size_in_bytes
@@ -965,8 +920,8 @@ inline ASIO_CONST_BUFFER buffer(const const_buffer& b,
/**
* @returns <tt>mutable_buffer(data, size_in_bytes)</tt>.
*/
-inline ASIO_MUTABLE_BUFFER buffer(void* data,
- std::size_t size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ void* data, std::size_t size_in_bytes) noexcept
{
return ASIO_MUTABLE_BUFFER(data, size_in_bytes);
}
@@ -975,8 +930,8 @@ inline ASIO_MUTABLE_BUFFER buffer(void* data,
/**
* @returns <tt>const_buffer(data, size_in_bytes)</tt>.
*/
-inline ASIO_CONST_BUFFER buffer(const void* data,
- std::size_t size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const void* data, std::size_t size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(data, size_in_bytes);
}
@@ -989,7 +944,8 @@ inline ASIO_CONST_BUFFER buffer(const void* data,
* N * sizeof(PodType)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N]) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ PodType (&data)[N]) noexcept
{
return ASIO_MUTABLE_BUFFER(data, N * sizeof(PodType));
}
@@ -1002,8 +958,9 @@ inline ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N]) ASIO_NOEXCEPT
* min(N * sizeof(PodType), max_size_in_bytes)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N],
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ PodType (&data)[N],
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_MUTABLE_BUFFER(data,
N * sizeof(PodType) < max_size_in_bytes
@@ -1018,8 +975,8 @@ inline ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N],
* N * sizeof(PodType)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(
- const PodType (&data)[N]) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const PodType (&data)[N]) noexcept
{
return ASIO_CONST_BUFFER(data, N * sizeof(PodType));
}
@@ -1032,84 +989,15 @@ inline ASIO_CONST_BUFFER buffer(
* min(N * sizeof(PodType), max_size_in_bytes)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(const PodType (&data)[N],
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const PodType (&data)[N],
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(data,
N * sizeof(PodType) < max_size_in_bytes
? N * sizeof(PodType) : max_size_in_bytes);
}
-#if defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
-
-// Borland C++ and Sun Studio think the overloads:
-//
-// unspecified buffer(boost::array<PodType, N>& array ...);
-//
-// and
-//
-// unspecified buffer(boost::array<const PodType, N>& array ...);
-//
-// are ambiguous. This will be worked around by using a buffer_types traits
-// class that contains typedefs for the appropriate buffer and container
-// classes, based on whether PodType is const or non-const.
-
-namespace detail {
-
-template <bool IsConst>
-struct buffer_types_base;
-
-template <>
-struct buffer_types_base<false>
-{
- typedef mutable_buffer buffer_type;
- typedef ASIO_MUTABLE_BUFFER container_type;
-};
-
-template <>
-struct buffer_types_base<true>
-{
- typedef const_buffer buffer_type;
- typedef ASIO_CONST_BUFFER container_type;
-};
-
-template <typename PodType>
-struct buffer_types
- : public buffer_types_base<is_const<PodType>::value>
-{
-};
-
-} // namespace detail
-
-template <typename PodType, std::size_t N>
-inline typename detail::buffer_types<PodType>::container_type
-buffer(boost::array<PodType, N>& data) ASIO_NOEXCEPT
-{
- typedef typename asio::detail::buffer_types<PodType>::buffer_type
- buffer_type;
- typedef typename asio::detail::buffer_types<PodType>::container_type
- container_type;
- return container_type(
- buffer_type(data.c_array(), data.size() * sizeof(PodType)));
-}
-
-template <typename PodType, std::size_t N>
-inline typename detail::buffer_types<PodType>::container_type
-buffer(boost::array<PodType, N>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
-{
- typedef typename asio::detail::buffer_types<PodType>::buffer_type
- buffer_type;
- typedef typename asio::detail::buffer_types<PodType>::container_type
- container_type;
- return container_type(
- buffer_type(data.c_array(),
- data.size() * sizeof(PodType) < max_size_in_bytes
- ? data.size() * sizeof(PodType) : max_size_in_bytes));
-}
-
-#else // defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
-
/// Create a new modifiable buffer that represents the given POD array.
/**
* @returns A mutable_buffer value equivalent to:
@@ -1118,8 +1006,8 @@ buffer(boost::array<PodType, N>& data,
* data.size() * sizeof(PodType)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_MUTABLE_BUFFER buffer(
- boost::array<PodType, N>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ boost::array<PodType, N>& data) noexcept
{
return ASIO_MUTABLE_BUFFER(
data.c_array(), data.size() * sizeof(PodType));
@@ -1133,8 +1021,9 @@ inline ASIO_MUTABLE_BUFFER buffer(
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_MUTABLE_BUFFER buffer(boost::array<PodType, N>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ boost::array<PodType, N>& data,
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_MUTABLE_BUFFER(data.c_array(),
data.size() * sizeof(PodType) < max_size_in_bytes
@@ -1149,8 +1038,8 @@ inline ASIO_MUTABLE_BUFFER buffer(boost::array<PodType, N>& data,
* data.size() * sizeof(PodType)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(
- boost::array<const PodType, N>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ boost::array<const PodType, N>& data) noexcept
{
return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType));
}
@@ -1163,16 +1052,15 @@ inline ASIO_CONST_BUFFER buffer(
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(boost::array<const PodType, N>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ boost::array<const PodType, N>& data,
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(data.data(),
data.size() * sizeof(PodType) < max_size_in_bytes
? data.size() * sizeof(PodType) : max_size_in_bytes);
}
-#endif // defined(ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
-
/// Create a new non-modifiable buffer that represents the given POD array.
/**
* @returns A const_buffer value equivalent to:
@@ -1181,8 +1069,8 @@ inline ASIO_CONST_BUFFER buffer(boost::array<const PodType, N>& data,
* data.size() * sizeof(PodType)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(
- const boost::array<PodType, N>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const boost::array<PodType, N>& data) noexcept
{
return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType));
}
@@ -1195,16 +1083,15 @@ inline ASIO_CONST_BUFFER buffer(
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(const boost::array<PodType, N>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const boost::array<PodType, N>& data,
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(data.data(),
data.size() * sizeof(PodType) < max_size_in_bytes
? data.size() * sizeof(PodType) : max_size_in_bytes);
}
-#if defined(ASIO_HAS_STD_ARRAY) || defined(GENERATING_DOCUMENTATION)
-
/// Create a new modifiable buffer that represents the given POD array.
/**
* @returns A mutable_buffer value equivalent to:
@@ -1213,8 +1100,8 @@ inline ASIO_CONST_BUFFER buffer(const boost::array<PodType, N>& data,
* data.size() * sizeof(PodType)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_MUTABLE_BUFFER buffer(
- std::array<PodType, N>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ std::array<PodType, N>& data) noexcept
{
return ASIO_MUTABLE_BUFFER(data.data(), data.size() * sizeof(PodType));
}
@@ -1227,8 +1114,9 @@ inline ASIO_MUTABLE_BUFFER buffer(
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_MUTABLE_BUFFER buffer(std::array<PodType, N>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ std::array<PodType, N>& data,
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_MUTABLE_BUFFER(data.data(),
data.size() * sizeof(PodType) < max_size_in_bytes
@@ -1243,8 +1131,8 @@ inline ASIO_MUTABLE_BUFFER buffer(std::array<PodType, N>& data,
* data.size() * sizeof(PodType)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(
- std::array<const PodType, N>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ std::array<const PodType, N>& data) noexcept
{
return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType));
}
@@ -1257,8 +1145,9 @@ inline ASIO_CONST_BUFFER buffer(
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(std::array<const PodType, N>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ std::array<const PodType, N>& data,
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(data.data(),
data.size() * sizeof(PodType) < max_size_in_bytes
@@ -1273,8 +1162,8 @@ inline ASIO_CONST_BUFFER buffer(std::array<const PodType, N>& data,
* data.size() * sizeof(PodType)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(
- const std::array<PodType, N>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const std::array<PodType, N>& data) noexcept
{
return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType));
}
@@ -1287,16 +1176,15 @@ inline ASIO_CONST_BUFFER buffer(
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
*/
template <typename PodType, std::size_t N>
-inline ASIO_CONST_BUFFER buffer(const std::array<PodType, N>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const std::array<PodType, N>& data,
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(data.data(),
data.size() * sizeof(PodType) < max_size_in_bytes
? data.size() * sizeof(PodType) : max_size_in_bytes);
}
-#endif // defined(ASIO_HAS_STD_ARRAY) || defined(GENERATING_DOCUMENTATION)
-
/// Create a new modifiable buffer that represents the given POD vector.
/**
* @returns A mutable_buffer value equivalent to:
@@ -1308,8 +1196,8 @@ inline ASIO_CONST_BUFFER buffer(const std::array<PodType, N>& data,
* invalidate iterators.
*/
template <typename PodType, typename Allocator>
-inline ASIO_MUTABLE_BUFFER buffer(
- std::vector<PodType, Allocator>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ std::vector<PodType, Allocator>& data) noexcept
{
return ASIO_MUTABLE_BUFFER(
data.size() ? &data[0] : 0, data.size() * sizeof(PodType)
@@ -1332,8 +1220,9 @@ inline ASIO_MUTABLE_BUFFER buffer(
* invalidate iterators.
*/
template <typename PodType, typename Allocator>
-inline ASIO_MUTABLE_BUFFER buffer(std::vector<PodType, Allocator>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ std::vector<PodType, Allocator>& data,
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0,
data.size() * sizeof(PodType) < max_size_in_bytes
@@ -1357,8 +1246,8 @@ inline ASIO_MUTABLE_BUFFER buffer(std::vector<PodType, Allocator>& data,
* invalidate iterators.
*/
template <typename PodType, typename Allocator>
-inline ASIO_CONST_BUFFER buffer(
- const std::vector<PodType, Allocator>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const std::vector<PodType, Allocator>& data) noexcept
{
return ASIO_CONST_BUFFER(
data.size() ? &data[0] : 0, data.size() * sizeof(PodType)
@@ -1381,9 +1270,9 @@ inline ASIO_CONST_BUFFER buffer(
* invalidate iterators.
*/
template <typename PodType, typename Allocator>
-inline ASIO_CONST_BUFFER buffer(
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
const std::vector<PodType, Allocator>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(data.size() ? &data[0] : 0,
data.size() * sizeof(PodType) < max_size_in_bytes
@@ -1405,8 +1294,8 @@ inline ASIO_CONST_BUFFER buffer(
* given string object.
*/
template <typename Elem, typename Traits, typename Allocator>
-inline ASIO_MUTABLE_BUFFER buffer(
- std::basic_string<Elem, Traits, Allocator>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ std::basic_string<Elem, Traits, Allocator>& data) noexcept
{
return ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0,
data.size() * sizeof(Elem)
@@ -1429,9 +1318,9 @@ inline ASIO_MUTABLE_BUFFER buffer(
* given string object.
*/
template <typename Elem, typename Traits, typename Allocator>
-inline ASIO_MUTABLE_BUFFER buffer(
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
std::basic_string<Elem, Traits, Allocator>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0,
data.size() * sizeof(Elem) < max_size_in_bytes
@@ -1452,8 +1341,8 @@ inline ASIO_MUTABLE_BUFFER buffer(
* given string object.
*/
template <typename Elem, typename Traits, typename Allocator>
-inline ASIO_CONST_BUFFER buffer(
- const std::basic_string<Elem, Traits, Allocator>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const std::basic_string<Elem, Traits, Allocator>& data) noexcept
{
return ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(Elem)
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -1475,9 +1364,9 @@ inline ASIO_CONST_BUFFER buffer(
* given string object.
*/
template <typename Elem, typename Traits, typename Allocator>
-inline ASIO_CONST_BUFFER buffer(
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
const std::basic_string<Elem, Traits, Allocator>& data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(data.data(),
data.size() * sizeof(Elem) < max_size_in_bytes
@@ -1493,14 +1382,14 @@ inline ASIO_CONST_BUFFER buffer(
#if defined(ASIO_HAS_STRING_VIEW) \
|| defined(GENERATING_DOCUMENTATION)
-/// Create a new modifiable buffer that represents the given string_view.
+/// Create a new non-modifiable buffer that represents the given string_view.
/**
* @returns <tt>mutable_buffer(data.size() ? &data[0] : 0,
* data.size() * sizeof(Elem))</tt>.
*/
template <typename Elem, typename Traits>
-inline ASIO_CONST_BUFFER buffer(
- basic_string_view<Elem, Traits> data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ basic_string_view<Elem, Traits> data) noexcept
{
return ASIO_CONST_BUFFER(data.size() ? &data[0] : 0,
data.size() * sizeof(Elem)
@@ -1520,9 +1409,9 @@ inline ASIO_CONST_BUFFER buffer(
* min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode
*/
template <typename Elem, typename Traits>
-inline ASIO_CONST_BUFFER buffer(
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
basic_string_view<Elem, Traits> data,
- std::size_t max_size_in_bytes) ASIO_NOEXCEPT
+ std::size_t max_size_in_bytes) noexcept
{
return ASIO_CONST_BUFFER(data.size() ? &data[0] : 0,
data.size() * sizeof(Elem) < max_size_in_bytes
@@ -1538,6 +1427,215 @@ inline ASIO_CONST_BUFFER buffer(
#endif // defined(ASIO_HAS_STRING_VIEW)
// || defined(GENERATING_DOCUMENTATION)
+/// Create a new modifiable buffer from a contiguous container.
+/**
+ * @returns A mutable_buffer value equivalent to:
+ * @code mutable_buffer(
+ * data.size() ? &data[0] : 0,
+ * data.size() * sizeof(typename T::value_type)); @endcode
+ */
+template <typename T>
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ T& data,
+ constraint_t<
+ is_contiguous_iterator<typename T::iterator>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, const_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, mutable_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_const<
+ remove_reference_t<
+ typename std::iterator_traits<typename T::iterator>::reference
+ >
+ >::value,
+ defaulted_constraint
+ > = defaulted_constraint()) noexcept
+{
+ return ASIO_MUTABLE_BUFFER(
+ data.size() ? detail::to_address(data.begin()) : 0,
+ data.size() * sizeof(typename T::value_type));
+}
+
+/// Create a new modifiable buffer from a contiguous container.
+/**
+ * @returns A mutable_buffer value equivalent to:
+ * @code mutable_buffer(
+ * data.size() ? &data[0] : 0,
+ * min(
+ * data.size() * sizeof(typename T::value_type),
+ * max_size_in_bytes)); @endcode
+ */
+template <typename T>
+ASIO_NODISCARD inline ASIO_MUTABLE_BUFFER buffer(
+ T& data, std::size_t max_size_in_bytes,
+ constraint_t<
+ is_contiguous_iterator<typename T::iterator>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, const_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, mutable_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_const<
+ remove_reference_t<
+ typename std::iterator_traits<typename T::iterator>::reference
+ >
+ >::value,
+ defaulted_constraint
+ > = defaulted_constraint()) noexcept
+{
+ return ASIO_MUTABLE_BUFFER(
+ data.size() ? detail::to_address(data.begin()) : 0,
+ data.size() * sizeof(typename T::value_type) < max_size_in_bytes
+ ? data.size() * sizeof(typename T::value_type) : max_size_in_bytes);
+}
+
+/// Create a new non-modifiable buffer from a contiguous container.
+/**
+ * @returns A const_buffer value equivalent to:
+ * @code const_buffer(
+ * data.size() ? &data[0] : 0,
+ * data.size() * sizeof(typename T::value_type)); @endcode
+ */
+template <typename T>
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ T& data,
+ constraint_t<
+ is_contiguous_iterator<typename T::iterator>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, const_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, mutable_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ is_const<
+ remove_reference_t<
+ typename std::iterator_traits<typename T::iterator>::reference
+ >
+ >::value,
+ defaulted_constraint
+ > = defaulted_constraint()) noexcept
+{
+ return ASIO_CONST_BUFFER(
+ data.size() ? detail::to_address(data.begin()) : 0,
+ data.size() * sizeof(typename T::value_type));
+}
+
+/// Create a new non-modifiable buffer from a contiguous container.
+/**
+ * @returns A const_buffer value equivalent to:
+ * @code const_buffer(
+ * data.size() ? &data[0] : 0,
+ * min(
+ * data.size() * sizeof(typename T::value_type),
+ * max_size_in_bytes)); @endcode
+ */
+template <typename T>
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ T& data, std::size_t max_size_in_bytes,
+ constraint_t<
+ is_contiguous_iterator<typename T::iterator>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, const_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, mutable_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ is_const<
+ remove_reference_t<
+ typename std::iterator_traits<typename T::iterator>::reference
+ >
+ >::value,
+ defaulted_constraint
+ > = defaulted_constraint()) noexcept
+{
+ return ASIO_CONST_BUFFER(
+ data.size() ? detail::to_address(data.begin()) : 0,
+ data.size() * sizeof(typename T::value_type) < max_size_in_bytes
+ ? data.size() * sizeof(typename T::value_type) : max_size_in_bytes);
+}
+
+/// Create a new non-modifiable buffer from a contiguous container.
+/**
+ * @returns A const_buffer value equivalent to:
+ * @code const_buffer(
+ * data.size() ? &data[0] : 0,
+ * data.size() * sizeof(typename T::value_type)); @endcode
+ */
+template <typename T>
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const T& data,
+ constraint_t<
+ is_contiguous_iterator<typename T::const_iterator>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, const_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, mutable_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint()) noexcept
+{
+ return ASIO_CONST_BUFFER(
+ data.size() ? detail::to_address(data.begin()) : 0,
+ data.size() * sizeof(typename T::value_type));
+}
+
+/// Create a new non-modifiable buffer from a contiguous container.
+/**
+ * @returns A const_buffer value equivalent to:
+ * @code const_buffer(
+ * data.size() ? &data[0] : 0,
+ * min(
+ * data.size() * sizeof(typename T::value_type),
+ * max_size_in_bytes)); @endcode
+ */
+template <typename T>
+ASIO_NODISCARD inline ASIO_CONST_BUFFER buffer(
+ const T& data, std::size_t max_size_in_bytes,
+ constraint_t<
+ is_contiguous_iterator<typename T::const_iterator>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, const_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint(),
+ constraint_t<
+ !is_convertible<T, mutable_buffer>::value,
+ defaulted_constraint
+ > = defaulted_constraint()) noexcept
+{
+ return ASIO_CONST_BUFFER(
+ data.size() ? detail::to_address(data.begin()) : 0,
+ data.size() * sizeof(typename T::value_type) < max_size_in_bytes
+ ? data.size() * sizeof(typename T::value_type) : max_size_in_bytes);
+}
+
/*@}*/
/// Adapt a basic_string to the DynamicBuffer requirements.
@@ -1570,7 +1668,7 @@ public:
*/
explicit dynamic_string_buffer(std::basic_string<Elem, Traits, Allocator>& s,
std::size_t maximum_size =
- (std::numeric_limits<std::size_t>::max)()) ASIO_NOEXCEPT
+ (std::numeric_limits<std::size_t>::max)()) noexcept
: string_(s),
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
size_((std::numeric_limits<std::size_t>::max)()),
@@ -1580,7 +1678,7 @@ public:
}
/// @b DynamicBuffer_v2: Copy construct a dynamic buffer.
- dynamic_string_buffer(const dynamic_string_buffer& other) ASIO_NOEXCEPT
+ dynamic_string_buffer(const dynamic_string_buffer& other) noexcept
: string_(other.string_),
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
size_(other.size_),
@@ -1589,9 +1687,8 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move construct a dynamic buffer.
- dynamic_string_buffer(dynamic_string_buffer&& other) ASIO_NOEXCEPT
+ dynamic_string_buffer(dynamic_string_buffer&& other) noexcept
: string_(other.string_),
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
size_(other.size_),
@@ -1599,7 +1696,6 @@ public:
max_size_(other.max_size_)
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// @b DynamicBuffer_v1: Get the size of the input sequence.
/// @b DynamicBuffer_v2: Get the current size of the underlying memory.
@@ -1608,7 +1704,7 @@ public:
* @b DynamicBuffer_v2: The current size of the underlying string if less than
* max_size(). Otherwise returns max_size().
*/
- std::size_t size() const ASIO_NOEXCEPT
+ std::size_t size() const noexcept
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
if (size_ != (std::numeric_limits<std::size_t>::max)())
@@ -1621,7 +1717,7 @@ public:
/**
* @returns The allowed maximum size of the underlying memory.
*/
- std::size_t max_size() const ASIO_NOEXCEPT
+ std::size_t max_size() const noexcept
{
return max_size_;
}
@@ -1632,7 +1728,7 @@ public:
* @returns The current capacity of the underlying string if less than
* max_size(). Otherwise returns max_size().
*/
- std::size_t capacity() const ASIO_NOEXCEPT
+ std::size_t capacity() const noexcept
{
return (std::min)(string_.capacity(), max_size());
}
@@ -1648,7 +1744,7 @@ public:
* @note The returned object is invalidated by any @c dynamic_string_buffer
* or @c basic_string member function that resizes or erases the string.
*/
- const_buffers_type data() const ASIO_NOEXCEPT
+ const_buffers_type data() const noexcept
{
return const_buffers_type(asio::buffer(string_, size_));
}
@@ -1669,7 +1765,7 @@ public:
* @note The returned object is invalidated by any @c dynamic_string_buffer
* or @c basic_string member function that resizes or erases the string.
*/
- mutable_buffers_type data(std::size_t pos, std::size_t n) ASIO_NOEXCEPT
+ mutable_buffers_type data(std::size_t pos, std::size_t n) noexcept
{
return mutable_buffers_type(asio::buffer(
asio::buffer(string_, max_size_) + pos, n));
@@ -1688,7 +1784,7 @@ public:
* or @c basic_string member function that resizes or erases the string.
*/
const_buffers_type data(std::size_t pos,
- std::size_t n) const ASIO_NOEXCEPT
+ std::size_t n) const noexcept
{
return const_buffers_type(asio::buffer(
asio::buffer(string_, max_size_) + pos, n));
@@ -1838,7 +1934,7 @@ public:
*/
explicit dynamic_vector_buffer(std::vector<Elem, Allocator>& v,
std::size_t maximum_size =
- (std::numeric_limits<std::size_t>::max)()) ASIO_NOEXCEPT
+ (std::numeric_limits<std::size_t>::max)()) noexcept
: vector_(v),
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
size_((std::numeric_limits<std::size_t>::max)()),
@@ -1848,7 +1944,7 @@ public:
}
/// @b DynamicBuffer_v2: Copy construct a dynamic buffer.
- dynamic_vector_buffer(const dynamic_vector_buffer& other) ASIO_NOEXCEPT
+ dynamic_vector_buffer(const dynamic_vector_buffer& other) noexcept
: vector_(other.vector_),
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
size_(other.size_),
@@ -1857,9 +1953,8 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move construct a dynamic buffer.
- dynamic_vector_buffer(dynamic_vector_buffer&& other) ASIO_NOEXCEPT
+ dynamic_vector_buffer(dynamic_vector_buffer&& other) noexcept
: vector_(other.vector_),
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
size_(other.size_),
@@ -1867,7 +1962,6 @@ public:
max_size_(other.max_size_)
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// @b DynamicBuffer_v1: Get the size of the input sequence.
/// @b DynamicBuffer_v2: Get the current size of the underlying memory.
@@ -1876,7 +1970,7 @@ public:
* @b DynamicBuffer_v2: The current size of the underlying vector if less than
* max_size(). Otherwise returns max_size().
*/
- std::size_t size() const ASIO_NOEXCEPT
+ std::size_t size() const noexcept
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
if (size_ != (std::numeric_limits<std::size_t>::max)())
@@ -1891,7 +1985,7 @@ public:
* of the input sequence and output sequence. @b DynamicBuffer_v2: The allowed
* maximum size of the underlying memory.
*/
- std::size_t max_size() const ASIO_NOEXCEPT
+ std::size_t max_size() const noexcept
{
return max_size_;
}
@@ -1904,7 +1998,7 @@ public:
* The current capacity of the underlying vector if less than max_size().
* Otherwise returns max_size().
*/
- std::size_t capacity() const ASIO_NOEXCEPT
+ std::size_t capacity() const noexcept
{
return (std::min)(vector_.capacity(), max_size());
}
@@ -1921,7 +2015,7 @@ public:
* or @c vector member function that modifies the input sequence or output
* sequence.
*/
- const_buffers_type data() const ASIO_NOEXCEPT
+ const_buffers_type data() const noexcept
{
return const_buffers_type(asio::buffer(vector_, size_));
}
@@ -1942,7 +2036,7 @@ public:
* @note The returned object is invalidated by any @c dynamic_vector_buffer
* or @c vector member function that resizes or erases the vector.
*/
- mutable_buffers_type data(std::size_t pos, std::size_t n) ASIO_NOEXCEPT
+ mutable_buffers_type data(std::size_t pos, std::size_t n) noexcept
{
return mutable_buffers_type(asio::buffer(
asio::buffer(vector_, max_size_) + pos, n));
@@ -1961,7 +2055,7 @@ public:
* or @c vector member function that resizes or erases the vector.
*/
const_buffers_type data(std::size_t pos,
- std::size_t n) const ASIO_NOEXCEPT
+ std::size_t n) const noexcept
{
return const_buffers_type(asio::buffer(
asio::buffer(vector_, max_size_) + pos, n));
@@ -2096,8 +2190,9 @@ private:
* @returns <tt>dynamic_string_buffer<Elem, Traits, Allocator>(data)</tt>.
*/
template <typename Elem, typename Traits, typename Allocator>
-inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
- std::basic_string<Elem, Traits, Allocator>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline
+dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
+ std::basic_string<Elem, Traits, Allocator>& data) noexcept
{
return dynamic_string_buffer<Elem, Traits, Allocator>(data);
}
@@ -2108,9 +2203,10 @@ inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
* max_size)</tt>.
*/
template <typename Elem, typename Traits, typename Allocator>
-inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
+ASIO_NODISCARD inline
+dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
std::basic_string<Elem, Traits, Allocator>& data,
- std::size_t max_size) ASIO_NOEXCEPT
+ std::size_t max_size) noexcept
{
return dynamic_string_buffer<Elem, Traits, Allocator>(data, max_size);
}
@@ -2120,8 +2216,9 @@ inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
* @returns <tt>dynamic_vector_buffer<Elem, Allocator>(data)</tt>.
*/
template <typename Elem, typename Allocator>
-inline dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
- std::vector<Elem, Allocator>& data) ASIO_NOEXCEPT
+ASIO_NODISCARD inline
+dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
+ std::vector<Elem, Allocator>& data) noexcept
{
return dynamic_vector_buffer<Elem, Allocator>(data);
}
@@ -2131,9 +2228,10 @@ inline dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
* @returns <tt>dynamic_vector_buffer<Elem, Allocator>(data, max_size)</tt>.
*/
template <typename Elem, typename Allocator>
-inline dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
+ASIO_NODISCARD inline
+dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
std::vector<Elem, Allocator>& data,
- std::size_t max_size) ASIO_NOEXCEPT
+ std::size_t max_size) noexcept
{
return dynamic_vector_buffer<Elem, Allocator>(data, max_size);
}
@@ -2185,7 +2283,7 @@ inline std::size_t buffer_copy_1(const mutable_buffer& target,
template <typename TargetIterator, typename SourceIterator>
inline std::size_t buffer_copy(one_buffer, one_buffer,
TargetIterator target_begin, TargetIterator,
- SourceIterator source_begin, SourceIterator) ASIO_NOEXCEPT
+ SourceIterator source_begin, SourceIterator) noexcept
{
return (buffer_copy_1)(*target_begin, *source_begin);
}
@@ -2194,7 +2292,7 @@ template <typename TargetIterator, typename SourceIterator>
inline std::size_t buffer_copy(one_buffer, one_buffer,
TargetIterator target_begin, TargetIterator,
SourceIterator source_begin, SourceIterator,
- std::size_t max_bytes_to_copy) ASIO_NOEXCEPT
+ std::size_t max_bytes_to_copy) noexcept
{
return (buffer_copy_1)(*target_begin,
asio::buffer(*source_begin, max_bytes_to_copy));
@@ -2205,7 +2303,7 @@ std::size_t buffer_copy(one_buffer, multiple_buffers,
TargetIterator target_begin, TargetIterator,
SourceIterator source_begin, SourceIterator source_end,
std::size_t max_bytes_to_copy
- = (std::numeric_limits<std::size_t>::max)()) ASIO_NOEXCEPT
+ = (std::numeric_limits<std::size_t>::max)()) noexcept
{
std::size_t total_bytes_copied = 0;
SourceIterator source_iter = source_begin;
@@ -2228,7 +2326,7 @@ std::size_t buffer_copy(multiple_buffers, one_buffer,
TargetIterator target_begin, TargetIterator target_end,
SourceIterator source_begin, SourceIterator,
std::size_t max_bytes_to_copy
- = (std::numeric_limits<std::size_t>::max)()) ASIO_NOEXCEPT
+ = (std::numeric_limits<std::size_t>::max)()) noexcept
{
std::size_t total_bytes_copied = 0;
TargetIterator target_iter = target_begin;
@@ -2249,7 +2347,7 @@ std::size_t buffer_copy(multiple_buffers, one_buffer,
template <typename TargetIterator, typename SourceIterator>
std::size_t buffer_copy(multiple_buffers, multiple_buffers,
TargetIterator target_begin, TargetIterator target_end,
- SourceIterator source_begin, SourceIterator source_end) ASIO_NOEXCEPT
+ SourceIterator source_begin, SourceIterator source_end) noexcept
{
std::size_t total_bytes_copied = 0;
@@ -2294,7 +2392,7 @@ template <typename TargetIterator, typename SourceIterator>
std::size_t buffer_copy(multiple_buffers, multiple_buffers,
TargetIterator target_begin, TargetIterator target_end,
SourceIterator source_begin, SourceIterator source_end,
- std::size_t max_bytes_to_copy) ASIO_NOEXCEPT
+ std::size_t max_bytes_to_copy) noexcept
{
std::size_t total_bytes_copied = 0;
@@ -2361,7 +2459,7 @@ std::size_t buffer_copy(multiple_buffers, multiple_buffers,
*/
template <typename MutableBufferSequence, typename ConstBufferSequence>
inline std::size_t buffer_copy(const MutableBufferSequence& target,
- const ConstBufferSequence& source) ASIO_NOEXCEPT
+ const ConstBufferSequence& source) noexcept
{
return detail::buffer_copy(
detail::buffer_sequence_cardinality<MutableBufferSequence>(),
@@ -2399,7 +2497,7 @@ inline std::size_t buffer_copy(const MutableBufferSequence& target,
template <typename MutableBufferSequence, typename ConstBufferSequence>
inline std::size_t buffer_copy(const MutableBufferSequence& target,
const ConstBufferSequence& source,
- std::size_t max_bytes_to_copy) ASIO_NOEXCEPT
+ std::size_t max_bytes_to_copy) noexcept
{
return detail::buffer_copy(
detail::buffer_sequence_cardinality<MutableBufferSequence>(),
@@ -2489,6 +2587,163 @@ struct is_dynamic_buffer
{
};
+namespace buffer_literals {
+namespace detail {
+
+template <char... Chars>
+struct chars {};
+
+template <unsigned char... Bytes>
+struct bytes {};
+
+// Literal processor that converts binary literals to an array of bytes.
+
+template <typename Bytes, char... Chars>
+struct bin_literal;
+
+template <unsigned char... Bytes>
+struct bin_literal<bytes<Bytes...>>
+{
+ static const std::size_t size = sizeof...(Bytes);
+ static const unsigned char data[sizeof...(Bytes)];
+};
+
+template <unsigned char... Bytes>
+const unsigned char bin_literal<bytes<Bytes...>>::data[sizeof...(Bytes)]
+ = { Bytes... };
+
+template <unsigned char... Bytes, char Bit7, char Bit6, char Bit5,
+ char Bit4, char Bit3, char Bit2, char Bit1, char Bit0, char... Chars>
+struct bin_literal<bytes<Bytes...>, Bit7, Bit6,
+ Bit5, Bit4, Bit3, Bit2, Bit1, Bit0, Chars...> :
+ bin_literal<
+ bytes<Bytes...,
+ static_cast<unsigned char>(
+ (Bit7 == '1' ? 0x80 : 0) |
+ (Bit6 == '1' ? 0x40 : 0) |
+ (Bit5 == '1' ? 0x20 : 0) |
+ (Bit4 == '1' ? 0x10 : 0) |
+ (Bit3 == '1' ? 0x08 : 0) |
+ (Bit2 == '1' ? 0x04 : 0) |
+ (Bit1 == '1' ? 0x02 : 0) |
+ (Bit0 == '1' ? 0x01 : 0))
+ >, Chars...> {};
+
+template <unsigned char... Bytes, char... Chars>
+struct bin_literal<bytes<Bytes...>, Chars...>
+{
+ static_assert(sizeof...(Chars) == 0,
+ "number of digits in a binary buffer literal must be a multiple of 8");
+
+ static const std::size_t size = 0;
+ static const unsigned char data[1];
+};
+
+template <unsigned char... Bytes, char... Chars>
+const unsigned char bin_literal<bytes<Bytes...>, Chars...>::data[1] = {};
+
+// Literal processor that converts hexadecimal literals to an array of bytes.
+
+template <typename Bytes, char... Chars>
+struct hex_literal;
+
+template <unsigned char... Bytes>
+struct hex_literal<bytes<Bytes...>>
+{
+ static const std::size_t size = sizeof...(Bytes);
+ static const unsigned char data[sizeof...(Bytes)];
+};
+
+template <unsigned char... Bytes>
+const unsigned char hex_literal<bytes<Bytes...>>::data[sizeof...(Bytes)]
+ = { Bytes... };
+
+template <unsigned char... Bytes, char Hi, char Lo, char... Chars>
+struct hex_literal<bytes<Bytes...>, Hi, Lo, Chars...> :
+ hex_literal<
+ bytes<Bytes...,
+ static_cast<unsigned char>(
+ Lo >= 'A' && Lo <= 'F' ? Lo - 'A' + 10 :
+ (Lo >= 'a' && Lo <= 'f' ? Lo - 'a' + 10 : Lo - '0')) |
+ ((static_cast<unsigned char>(
+ Hi >= 'A' && Hi <= 'F' ? Hi - 'A' + 10 :
+ (Hi >= 'a' && Hi <= 'f' ? Hi - 'a' + 10 : Hi - '0'))) << 4)
+ >, Chars...> {};
+
+template <unsigned char... Bytes, char Char>
+struct hex_literal<bytes<Bytes...>, Char>
+{
+ static_assert(!Char,
+ "a hexadecimal buffer literal must have an even number of digits");
+
+ static const std::size_t size = 0;
+ static const unsigned char data[1];
+};
+
+template <unsigned char... Bytes, char Char>
+const unsigned char hex_literal<bytes<Bytes...>, Char>::data[1] = {};
+
+// Helper template that removes digit separators and then passes the cleaned
+// variadic pack of characters to the literal processor.
+
+template <template <typename, char...> class Literal,
+ typename Clean, char... Raw>
+struct remove_separators;
+
+template <template <typename, char...> class Literal,
+ char... Clean, char... Raw>
+struct remove_separators<Literal, chars<Clean...>, '\'', Raw...> :
+ remove_separators<Literal, chars<Clean...>, Raw...> {};
+
+template <template <typename, char...> class Literal,
+ char... Clean, char C, char... Raw>
+struct remove_separators<Literal, chars<Clean...>, C, Raw...> :
+ remove_separators<Literal, chars<Clean..., C>, Raw...> {};
+
+template <template <typename, char...> class Literal, char... Clean>
+struct remove_separators<Literal, chars<Clean...>> :
+ Literal<bytes<>, Clean...> {};
+
+// Helper template to determine the literal type based on the prefix.
+
+template <char... Chars>
+struct literal;
+
+template <char... Chars>
+struct literal<'0', 'b', Chars...> :
+ remove_separators<bin_literal, chars<>, Chars...>{};
+
+template <char... Chars>
+struct literal<'0', 'B', Chars...> :
+ remove_separators<bin_literal, chars<>, Chars...>{};
+
+template <char... Chars>
+struct literal<'0', 'x', Chars...> :
+ remove_separators<hex_literal, chars<>, Chars...>{};
+
+template <char... Chars>
+struct literal<'0', 'X', Chars...> :
+ remove_separators<hex_literal, chars<>, Chars...>{};
+
+} // namespace detail
+
+/// Literal operator for creating const_buffer objects from string literals.
+inline ASIO_CONST_BUFFER operator ""_buf(const char* data, std::size_t n)
+{
+ return ASIO_CONST_BUFFER(data, n);
+}
+
+/// Literal operator for creating const_buffer objects from unbounded binary or
+/// hexadecimal integer literals.
+template <char... Chars>
+inline ASIO_CONST_BUFFER operator ""_buf()
+{
+ return ASIO_CONST_BUFFER(
+ +detail::literal<Chars...>::data,
+ detail::literal<Chars...>::size);
+}
+
+} // namespace buffer_literals
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/buffer_registration.hpp b/3rdparty/asio/include/asio/buffer_registration.hpp
new file mode 100644
index 00000000000..39897ba2450
--- /dev/null
+++ b/3rdparty/asio/include/asio/buffer_registration.hpp
@@ -0,0 +1,318 @@
+//
+// buffer_registration.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_BUFFER_REGISTRATION_HPP
+#define ASIO_BUFFER_REGISTRATION_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <iterator>
+#include <utility>
+#include <vector>
+#include "asio/detail/memory.hpp"
+#include "asio/execution/context.hpp"
+#include "asio/execution/executor.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/is_executor.hpp"
+#include "asio/query.hpp"
+#include "asio/registered_buffer.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+# include "asio/detail/scheduler.hpp"
+# include "asio/detail/io_uring_service.hpp"
+#endif // defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class buffer_registration_base
+{
+protected:
+ static mutable_registered_buffer make_buffer(const mutable_buffer& b,
+ const void* scope, int index) noexcept
+ {
+ return mutable_registered_buffer(b, registered_buffer_id(scope, index));
+ }
+};
+
+} // namespace detail
+
+/// Automatically registers and unregistered buffers with an execution context.
+/**
+ * For portability, applications should assume that only one registration is
+ * permitted per execution context.
+ */
+template <typename MutableBufferSequence,
+ typename Allocator = std::allocator<void>>
+class buffer_registration
+ : detail::buffer_registration_base
+{
+public:
+ /// The allocator type used for allocating storage for the buffers container.
+ typedef Allocator allocator_type;
+
+#if defined(GENERATING_DOCUMENTATION)
+ /// The type of an iterator over the registered buffers.
+ typedef unspecified iterator;
+
+ /// The type of a const iterator over the registered buffers.
+ typedef unspecified const_iterator;
+#else // defined(GENERATING_DOCUMENTATION)
+ typedef std::vector<mutable_registered_buffer>::const_iterator iterator;
+ typedef std::vector<mutable_registered_buffer>::const_iterator const_iterator;
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Register buffers with an executor's execution context.
+ template <typename Executor>
+ buffer_registration(const Executor& ex,
+ const MutableBufferSequence& buffer_sequence,
+ const allocator_type& alloc = allocator_type(),
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ > = 0)
+ : buffer_sequence_(buffer_sequence),
+ buffers_(
+ ASIO_REBIND_ALLOC(allocator_type,
+ mutable_registered_buffer)(alloc))
+ {
+ init_buffers(buffer_registration::get_context(ex),
+ asio::buffer_sequence_begin(buffer_sequence_),
+ asio::buffer_sequence_end(buffer_sequence_));
+ }
+
+ /// Register buffers with an execution context.
+ template <typename ExecutionContext>
+ buffer_registration(ExecutionContext& ctx,
+ const MutableBufferSequence& buffer_sequence,
+ const allocator_type& alloc = allocator_type(),
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ : buffer_sequence_(buffer_sequence),
+ buffers_(
+ ASIO_REBIND_ALLOC(allocator_type,
+ mutable_registered_buffer)(alloc))
+ {
+ init_buffers(ctx,
+ asio::buffer_sequence_begin(buffer_sequence_),
+ asio::buffer_sequence_end(buffer_sequence_));
+ }
+
+ /// Move constructor.
+ buffer_registration(buffer_registration&& other) noexcept
+ : buffer_sequence_(std::move(other.buffer_sequence_)),
+ buffers_(std::move(other.buffers_))
+ {
+#if defined(ASIO_HAS_IO_URING)
+ service_ = other.service_;
+ other.service_ = 0;
+#endif // defined(ASIO_HAS_IO_URING)
+ }
+
+ /// Unregisters the buffers.
+ ~buffer_registration()
+ {
+#if defined(ASIO_HAS_IO_URING)
+ if (service_)
+ service_->unregister_buffers();
+#endif // defined(ASIO_HAS_IO_URING)
+ }
+
+ /// Move assignment.
+ buffer_registration& operator=(buffer_registration&& other) noexcept
+ {
+ if (this != &other)
+ {
+ buffer_sequence_ = std::move(other.buffer_sequence_);
+ buffers_ = std::move(other.buffers_);
+#if defined(ASIO_HAS_IO_URING)
+ if (service_)
+ service_->unregister_buffers();
+ service_ = other.service_;
+ other.service_ = 0;
+#endif // defined(ASIO_HAS_IO_URING)
+ }
+ return *this;
+ }
+
+ /// Get the number of registered buffers.
+ std::size_t size() const noexcept
+ {
+ return buffers_.size();
+ }
+
+ /// Get the begin iterator for the sequence of registered buffers.
+ const_iterator begin() const noexcept
+ {
+ return buffers_.begin();
+ }
+
+ /// Get the begin iterator for the sequence of registered buffers.
+ const_iterator cbegin() const noexcept
+ {
+ return buffers_.cbegin();
+ }
+
+ /// Get the end iterator for the sequence of registered buffers.
+ const_iterator end() const noexcept
+ {
+ return buffers_.end();
+ }
+
+ /// Get the end iterator for the sequence of registered buffers.
+ const_iterator cend() const noexcept
+ {
+ return buffers_.cend();
+ }
+
+ /// Get the buffer at the specified index.
+ const mutable_registered_buffer& operator[](std::size_t i) noexcept
+ {
+ return buffers_[i];
+ }
+
+ /// Get the buffer at the specified index.
+ const mutable_registered_buffer& at(std::size_t i) noexcept
+ {
+ return buffers_.at(i);
+ }
+
+private:
+ // Disallow copying and assignment.
+ buffer_registration(const buffer_registration&) = delete;
+ buffer_registration& operator=(const buffer_registration&) = delete;
+
+ // Helper function to get an executor's context.
+ template <typename T>
+ static execution_context& get_context(const T& t,
+ enable_if_t<execution::is_executor<T>::value>* = 0)
+ {
+ return asio::query(t, execution::context);
+ }
+
+ // Helper function to get an executor's context.
+ template <typename T>
+ static execution_context& get_context(const T& t,
+ enable_if_t<!execution::is_executor<T>::value>* = 0)
+ {
+ return t.context();
+ }
+
+ // Helper function to initialise the container of buffers.
+ template <typename Iterator>
+ void init_buffers(execution_context& ctx, Iterator begin, Iterator end)
+ {
+ std::size_t n = std::distance(begin, end);
+ buffers_.resize(n);
+
+#if defined(ASIO_HAS_IO_URING)
+ service_ = &use_service<detail::io_uring_service>(ctx);
+ std::vector<iovec,
+ ASIO_REBIND_ALLOC(allocator_type, iovec)> iovecs(n,
+ ASIO_REBIND_ALLOC(allocator_type, iovec)(
+ buffers_.get_allocator()));
+#endif // defined(ASIO_HAS_IO_URING)
+
+ Iterator iter = begin;
+ for (int index = 0; iter != end; ++index, ++iter)
+ {
+ mutable_buffer b(*iter);
+ std::size_t i = static_cast<std::size_t>(index);
+ buffers_[i] = this->make_buffer(b, &ctx, index);
+
+#if defined(ASIO_HAS_IO_URING)
+ iovecs[i].iov_base = buffers_[i].data();
+ iovecs[i].iov_len = buffers_[i].size();
+#endif // defined(ASIO_HAS_IO_URING)
+ }
+
+#if defined(ASIO_HAS_IO_URING)
+ if (n > 0)
+ {
+ service_->register_buffers(&iovecs[0],
+ static_cast<unsigned>(iovecs.size()));
+ }
+#endif // defined(ASIO_HAS_IO_URING)
+ }
+
+ MutableBufferSequence buffer_sequence_;
+ std::vector<mutable_registered_buffer,
+ ASIO_REBIND_ALLOC(allocator_type,
+ mutable_registered_buffer)> buffers_;
+#if defined(ASIO_HAS_IO_URING)
+ detail::io_uring_service* service_;
+#endif // defined(ASIO_HAS_IO_URING)
+};
+
+/// Register buffers with an execution context.
+template <typename Executor, typename MutableBufferSequence>
+ASIO_NODISCARD inline
+buffer_registration<MutableBufferSequence>
+register_buffers(const Executor& ex,
+ const MutableBufferSequence& buffer_sequence,
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ > = 0)
+{
+ return buffer_registration<MutableBufferSequence>(ex, buffer_sequence);
+}
+
+/// Register buffers with an execution context.
+template <typename Executor, typename MutableBufferSequence, typename Allocator>
+ASIO_NODISCARD inline
+buffer_registration<MutableBufferSequence, Allocator>
+register_buffers(const Executor& ex,
+ const MutableBufferSequence& buffer_sequence, const Allocator& alloc,
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ > = 0)
+{
+ return buffer_registration<MutableBufferSequence, Allocator>(
+ ex, buffer_sequence, alloc);
+}
+
+/// Register buffers with an execution context.
+template <typename ExecutionContext, typename MutableBufferSequence>
+ASIO_NODISCARD inline
+buffer_registration<MutableBufferSequence>
+register_buffers(ExecutionContext& ctx,
+ const MutableBufferSequence& buffer_sequence,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+{
+ return buffer_registration<MutableBufferSequence>(ctx, buffer_sequence);
+}
+
+/// Register buffers with an execution context.
+template <typename ExecutionContext,
+ typename MutableBufferSequence, typename Allocator>
+ASIO_NODISCARD inline
+buffer_registration<MutableBufferSequence, Allocator>
+register_buffers(ExecutionContext& ctx,
+ const MutableBufferSequence& buffer_sequence, const Allocator& alloc,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+{
+ return buffer_registration<MutableBufferSequence, Allocator>(
+ ctx, buffer_sequence, alloc);
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_BUFFER_REGISTRATION_HPP
diff --git a/3rdparty/asio/include/asio/buffered_read_stream.hpp b/3rdparty/asio/include/asio/buffered_read_stream.hpp
index 7ed91dc2e24..264f66c55d8 100644
--- a/3rdparty/asio/include/asio/buffered_read_stream.hpp
+++ b/3rdparty/asio/include/asio/buffered_read_stream.hpp
@@ -2,7 +2,7 @@
// buffered_read_stream.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -30,6 +30,12 @@
#include "asio/detail/push_options.hpp"
namespace asio {
+namespace detail {
+
+template <typename> class initiate_async_buffered_fill;
+template <typename> class initiate_async_buffered_read_some;
+
+} // namespace detail
/// Adds buffering to the read-related operations of a stream.
/**
@@ -49,7 +55,7 @@ class buffered_read_stream
{
public:
/// The type of the next layer.
- typedef typename remove_reference<Stream>::type next_layer_type;
+ typedef remove_reference_t<Stream> next_layer_type;
/// The type of the lowest layer.
typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
@@ -66,16 +72,17 @@ public:
/// Construct, passing the specified argument to initialise the next layer.
template <typename Arg>
- explicit buffered_read_stream(Arg& a)
- : next_layer_(a),
+ explicit buffered_read_stream(Arg&& a)
+ : next_layer_(static_cast<Arg&&>(a)),
storage_(default_buffer_size)
{
}
/// Construct, passing the specified argument to initialise the next layer.
template <typename Arg>
- buffered_read_stream(Arg& a, std::size_t buffer_size)
- : next_layer_(a),
+ buffered_read_stream(Arg&& a,
+ std::size_t buffer_size)
+ : next_layer_(static_cast<Arg&&>(a)),
storage_(buffer_size)
{
}
@@ -99,7 +106,7 @@ public:
}
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return next_layer_.lowest_layer().get_executor();
}
@@ -136,18 +143,21 @@ public:
/// Start an asynchronous write. The data being written must be valid for the
/// lifetime of the asynchronous operation.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_write_some(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteHandler = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ declval<conditional_t<true, Stream&, WriteHandler>>().async_write_some(
+ buffers, static_cast<WriteHandler&&>(handler)))
{
return next_layer_.async_write_some(buffers,
- ASIO_MOVE_CAST(WriteHandler)(handler));
+ static_cast<WriteHandler&&>(handler));
}
/// Fill the buffer with some data. Returns the number of bytes placed in the
@@ -159,15 +169,20 @@ public:
std::size_t fill(asio::error_code& ec);
/// Start an asynchronous fill.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_fill(
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type));
+ std::size_t)) ReadHandler = default_completion_token_t<executor_type>>
+ auto async_fill(
+ ReadHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadHandler,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_buffered_fill<Stream>>(),
+ handler, declval<detail::buffered_stream_storage*>()));
/// Read some data from the stream. Returns the number of bytes read. Throws
/// an exception on failure.
@@ -182,15 +197,20 @@ public:
/// Start an asynchronous read. The buffer into which the data will be read
/// must be valid for the lifetime of the asynchronous operation.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_read_some(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type));
+ std::size_t)) ReadHandler = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadHandler,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_buffered_read_some<Stream>>(),
+ handler, declval<detail::buffered_stream_storage*>(), buffers));
/// Peek at the incoming data on the stream. Returns the number of bytes read.
/// Throws an exception on failure.
diff --git a/3rdparty/asio/include/asio/buffered_read_stream_fwd.hpp b/3rdparty/asio/include/asio/buffered_read_stream_fwd.hpp
index f189b27aadf..d98aa70483a 100644
--- a/3rdparty/asio/include/asio/buffered_read_stream_fwd.hpp
+++ b/3rdparty/asio/include/asio/buffered_read_stream_fwd.hpp
@@ -2,7 +2,7 @@
// buffered_read_stream_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/buffered_stream.hpp b/3rdparty/asio/include/asio/buffered_stream.hpp
index 5d71bf66105..e0e1b47b792 100644
--- a/3rdparty/asio/include/asio/buffered_stream.hpp
+++ b/3rdparty/asio/include/asio/buffered_stream.hpp
@@ -2,7 +2,7 @@
// buffered_stream.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -46,7 +46,7 @@ class buffered_stream
{
public:
/// The type of the next layer.
- typedef typename remove_reference<Stream>::type next_layer_type;
+ typedef remove_reference_t<Stream> next_layer_type;
/// The type of the lowest layer.
typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
@@ -56,17 +56,17 @@ public:
/// Construct, passing the specified argument to initialise the next layer.
template <typename Arg>
- explicit buffered_stream(Arg& a)
- : inner_stream_impl_(a),
+ explicit buffered_stream(Arg&& a)
+ : inner_stream_impl_(static_cast<Arg&&>(a)),
stream_impl_(inner_stream_impl_)
{
}
/// Construct, passing the specified argument to initialise the next layer.
template <typename Arg>
- explicit buffered_stream(Arg& a, std::size_t read_buffer_size,
- std::size_t write_buffer_size)
- : inner_stream_impl_(a, write_buffer_size),
+ explicit buffered_stream(Arg&& a,
+ std::size_t read_buffer_size, std::size_t write_buffer_size)
+ : inner_stream_impl_(static_cast<Arg&&>(a), write_buffer_size),
stream_impl_(inner_stream_impl_, read_buffer_size)
{
}
@@ -90,7 +90,7 @@ public:
}
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return stream_impl_.lowest_layer().get_executor();
}
@@ -125,18 +125,21 @@ public:
}
/// Start an asynchronous flush.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_flush(
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteHandler = default_completion_token_t<executor_type>>
+ auto async_flush(
+ WriteHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ declval<buffered_write_stream<Stream>&>().async_flush(
+ static_cast<WriteHandler&&>(handler)))
{
return stream_impl_.next_layer().async_flush(
- ASIO_MOVE_CAST(WriteHandler)(handler));
+ static_cast<WriteHandler&&>(handler));
}
/// Write the given data to the stream. Returns the number of bytes written.
@@ -158,18 +161,21 @@ public:
/// Start an asynchronous write. The data being written must be valid for the
/// lifetime of the asynchronous operation.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_write_some(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteHandler = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ declval<Stream&>().async_write_some(buffers,
+ static_cast<WriteHandler&&>(handler)))
{
return stream_impl_.async_write_some(buffers,
- ASIO_MOVE_CAST(WriteHandler)(handler));
+ static_cast<WriteHandler&&>(handler));
}
/// Fill the buffer with some data. Returns the number of bytes placed in the
@@ -187,17 +193,21 @@ public:
}
/// Start an asynchronous fill.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_fill(
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadHandler = default_completion_token_t<executor_type>>
+ auto async_fill(
+ ReadHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ declval<buffered_read_stream<
+ buffered_write_stream<Stream>>&>().async_fill(
+ static_cast<ReadHandler&&>(handler)))
{
- return stream_impl_.async_fill(ASIO_MOVE_CAST(ReadHandler)(handler));
+ return stream_impl_.async_fill(static_cast<ReadHandler&&>(handler));
}
/// Read some data from the stream. Returns the number of bytes read. Throws
@@ -219,18 +229,21 @@ public:
/// Start an asynchronous read. The buffer into which the data will be read
/// must be valid for the lifetime of the asynchronous operation.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_read_some(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadHandler = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ declval<Stream&>().async_read_some(buffers,
+ static_cast<ReadHandler&&>(handler)))
{
return stream_impl_.async_read_some(buffers,
- ASIO_MOVE_CAST(ReadHandler)(handler));
+ static_cast<ReadHandler&&>(handler));
}
/// Peek at the incoming data on the stream. Returns the number of bytes read.
diff --git a/3rdparty/asio/include/asio/buffered_stream_fwd.hpp b/3rdparty/asio/include/asio/buffered_stream_fwd.hpp
index d970cbba7a0..790c76269f9 100644
--- a/3rdparty/asio/include/asio/buffered_stream_fwd.hpp
+++ b/3rdparty/asio/include/asio/buffered_stream_fwd.hpp
@@ -2,7 +2,7 @@
// buffered_stream_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/buffered_write_stream.hpp b/3rdparty/asio/include/asio/buffered_write_stream.hpp
index 526cd602916..f8f0538dcea 100644
--- a/3rdparty/asio/include/asio/buffered_write_stream.hpp
+++ b/3rdparty/asio/include/asio/buffered_write_stream.hpp
@@ -2,7 +2,7 @@
// buffered_write_stream.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -30,6 +30,12 @@
#include "asio/detail/push_options.hpp"
namespace asio {
+namespace detail {
+
+template <typename> class initiate_async_buffered_flush;
+template <typename> class initiate_async_buffered_write_some;
+
+} // namespace detail
/// Adds buffering to the write-related operations of a stream.
/**
@@ -49,7 +55,7 @@ class buffered_write_stream
{
public:
/// The type of the next layer.
- typedef typename remove_reference<Stream>::type next_layer_type;
+ typedef remove_reference_t<Stream> next_layer_type;
/// The type of the lowest layer.
typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
@@ -66,16 +72,17 @@ public:
/// Construct, passing the specified argument to initialise the next layer.
template <typename Arg>
- explicit buffered_write_stream(Arg& a)
- : next_layer_(a),
+ explicit buffered_write_stream(Arg&& a)
+ : next_layer_(static_cast<Arg&&>(a)),
storage_(default_buffer_size)
{
}
/// Construct, passing the specified argument to initialise the next layer.
template <typename Arg>
- buffered_write_stream(Arg& a, std::size_t buffer_size)
- : next_layer_(a),
+ buffered_write_stream(Arg&& a,
+ std::size_t buffer_size)
+ : next_layer_(static_cast<Arg&&>(a)),
storage_(buffer_size)
{
}
@@ -99,7 +106,7 @@ public:
}
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return next_layer_.lowest_layer().get_executor();
}
@@ -128,15 +135,20 @@ public:
std::size_t flush(asio::error_code& ec);
/// Start an asynchronous flush.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_flush(
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type));
+ std::size_t)) WriteHandler = default_completion_token_t<executor_type>>
+ auto async_flush(
+ WriteHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteHandler,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_buffered_flush<Stream>>(),
+ handler, declval<detail::buffered_stream_storage*>()));
/// Write the given data to the stream. Returns the number of bytes written.
/// Throws an exception on failure.
@@ -151,15 +163,20 @@ public:
/// Start an asynchronous write. The data being written must be valid for the
/// lifetime of the asynchronous operation.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_write_some(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type));
+ std::size_t)) WriteHandler = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteHandler,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_buffered_write_some<Stream>>(),
+ handler, declval<detail::buffered_stream_storage*>(), buffers));
/// Read some data from the stream. Returns the number of bytes read. Throws
/// an exception on failure.
@@ -180,18 +197,21 @@ public:
/// Start an asynchronous read. The buffer into which the data will be read
/// must be valid for the lifetime of the asynchronous operation.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ */
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_read_some(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadHandler = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadHandler&& handler = default_completion_token_t<executor_type>())
+ -> decltype(
+ declval<conditional_t<true, Stream&, ReadHandler>>().async_read_some(
+ buffers, static_cast<ReadHandler&&>(handler)))
{
return next_layer_.async_read_some(buffers,
- ASIO_MOVE_CAST(ReadHandler)(handler));
+ static_cast<ReadHandler&&>(handler));
}
/// Peek at the incoming data on the stream. Returns the number of bytes read.
diff --git a/3rdparty/asio/include/asio/buffered_write_stream_fwd.hpp b/3rdparty/asio/include/asio/buffered_write_stream_fwd.hpp
index 8999d9e4c21..809f44af03d 100644
--- a/3rdparty/asio/include/asio/buffered_write_stream_fwd.hpp
+++ b/3rdparty/asio/include/asio/buffered_write_stream_fwd.hpp
@@ -2,7 +2,7 @@
// buffered_write_stream_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/buffers_iterator.hpp b/3rdparty/asio/include/asio/buffers_iterator.hpp
index 76b734a6448..2c6d720787c 100644
--- a/3rdparty/asio/include/asio/buffers_iterator.hpp
+++ b/3rdparty/asio/include/asio/buffers_iterator.hpp
@@ -2,7 +2,7 @@
// buffers_iterator.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -38,7 +38,7 @@ namespace detail
template <typename ByteType>
struct byte_type
{
- typedef typename add_const<ByteType>::type type;
+ typedef add_const_t<ByteType> type;
};
};
@@ -80,7 +80,7 @@ namespace detail
struct buffers_iterator_types<const_buffer, ByteType>
{
typedef const_buffer buffer_type;
- typedef typename add_const<ByteType>::type byte_type;
+ typedef add_const_t<ByteType> byte_type;
typedef const const_buffer* const_iterator;
};
@@ -98,7 +98,7 @@ namespace detail
struct buffers_iterator_types<const_buffers_1, ByteType>
{
typedef const_buffer buffer_type;
- typedef typename add_const<ByteType>::type byte_type;
+ typedef add_const_t<ByteType> byte_type;
typedef const const_buffer* const_iterator;
};
diff --git a/3rdparty/asio/include/asio/cancellation_signal.hpp b/3rdparty/asio/include/asio/cancellation_signal.hpp
index afbaecdaf40..43540ac3b08 100644
--- a/3rdparty/asio/include/asio/cancellation_signal.hpp
+++ b/3rdparty/asio/include/asio/cancellation_signal.hpp
@@ -2,7 +2,7 @@
// cancellation_signal.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -21,10 +21,7 @@
#include <utility>
#include "asio/cancellation_type.hpp"
#include "asio/detail/cstddef.hpp"
-#include "asio/detail/thread_context.hpp"
-#include "asio/detail/thread_info_base.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/detail/push_options.hpp"
@@ -35,7 +32,7 @@ class cancellation_handler_base
{
public:
virtual void call(cancellation_type_t) = 0;
- virtual std::pair<void*, std::size_t> destroy() ASIO_NOEXCEPT = 0;
+ virtual std::pair<void*, std::size_t> destroy() noexcept = 0;
protected:
~cancellation_handler_base() {}
@@ -46,45 +43,26 @@ class cancellation_handler
: public cancellation_handler_base
{
public:
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
template <typename... Args>
- cancellation_handler(std::size_t size, ASIO_MOVE_ARG(Args)... args)
- : handler_(ASIO_MOVE_CAST(Args)(args)...),
+ cancellation_handler(std::size_t size, Args&&... args)
+ : handler_(static_cast<Args&&>(args)...),
size_(size)
{
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- cancellation_handler(std::size_t size)
- : handler_(),
- size_(size)
- {
- }
-
-#define ASIO_PRIVATE_HANDLER_CTOR_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- cancellation_handler(std::size_t size, ASIO_VARIADIC_MOVE_PARAMS(n)) \
- : handler_(ASIO_VARIADIC_MOVE_ARGS(n)), \
- size_(size) \
- { \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_HANDLER_CTOR_DEF)
-#undef ASIO_PRIVATE_HANDLER_CTOR_DEF
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
void call(cancellation_type_t type)
{
handler_(type);
}
- std::pair<void*, std::size_t> destroy() ASIO_NOEXCEPT
+ std::pair<void*, std::size_t> destroy() noexcept
{
std::pair<void*, std::size_t> mem(this, size_);
this->cancellation_handler::~cancellation_handler();
return mem;
}
- Handler& handler() ASIO_NOEXCEPT
+ Handler& handler() noexcept
{
return handler_;
}
@@ -106,22 +84,12 @@ class cancellation_slot;
class cancellation_signal
{
public:
- ASIO_CONSTEXPR cancellation_signal()
+ constexpr cancellation_signal()
: handler_(0)
{
}
- ~cancellation_signal()
- {
- if (handler_)
- {
- std::pair<void*, std::size_t> mem = handler_->destroy();
- detail::thread_info_base::deallocate(
- detail::thread_info_base::cancellation_signal_tag(),
- detail::thread_context::top_of_thread_call_stack(),
- mem.first, mem.second);
- }
- }
+ ASIO_DECL ~cancellation_signal();
/// Emits the signal and causes invocation of the slot's handler, if any.
void emit(cancellation_type_t type)
@@ -135,11 +103,11 @@ public:
* The signal object must remain valid for as long the slot may be used.
* Destruction of the signal invalidates the slot.
*/
- cancellation_slot slot() ASIO_NOEXCEPT;
+ cancellation_slot slot() noexcept;
private:
- cancellation_signal(const cancellation_signal&) ASIO_DELETED;
- cancellation_signal& operator=(const cancellation_signal&) ASIO_DELETED;
+ cancellation_signal(const cancellation_signal&) = delete;
+ cancellation_signal& operator=(const cancellation_signal&) = delete;
detail::cancellation_handler_base* handler_;
};
@@ -149,13 +117,11 @@ class cancellation_slot
{
public:
/// Creates a slot that is not connected to any cancellation signal.
- ASIO_CONSTEXPR cancellation_slot()
+ constexpr cancellation_slot()
: handler_(0)
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
/// Installs a handler into the slot, constructing the new object directly.
/**
* Destroys any existing handler in the slot, then installs the new handler,
@@ -174,58 +140,21 @@ public:
* be copy constructible or move constructible.
*/
template <typename CancellationHandler, typename... Args>
- CancellationHandler& emplace(ASIO_MOVE_ARG(Args)... args)
+ CancellationHandler& emplace(Args&&... args)
{
typedef detail::cancellation_handler<CancellationHandler>
cancellation_handler_type;
auto_delete_helper del = { prepare_memory(
sizeof(cancellation_handler_type),
- ASIO_ALIGNOF(CancellationHandler)) };
+ alignof(CancellationHandler)) };
cancellation_handler_type* handler_obj =
new (del.mem.first) cancellation_handler_type(
- del.mem.second, ASIO_MOVE_CAST(Args)(args)...);
- del.mem.first = 0;
- *handler_ = handler_obj;
- return handler_obj->handler();
- }
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
- template <typename CancellationHandler>
- CancellationHandler& emplace()
- {
- typedef detail::cancellation_handler<CancellationHandler>
- cancellation_handler_type;
- auto_delete_helper del = { prepare_memory(
- sizeof(cancellation_handler_type),
- ASIO_ALIGNOF(CancellationHandler)) };
- cancellation_handler_type* handler_obj =
- new (del.mem.first) cancellation_handler_type(del.mem.second);
+ del.mem.second, static_cast<Args&&>(args)...);
del.mem.first = 0;
*handler_ = handler_obj;
return handler_obj->handler();
}
-#define ASIO_PRIVATE_HANDLER_EMPLACE_DEF(n) \
- template <typename CancellationHandler, ASIO_VARIADIC_TPARAMS(n)> \
- CancellationHandler& emplace(ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- typedef detail::cancellation_handler<CancellationHandler> \
- cancellation_handler_type; \
- auto_delete_helper del = { prepare_memory( \
- sizeof(cancellation_handler_type), \
- ASIO_ALIGNOF(CancellationHandler)) }; \
- cancellation_handler_type* handler_obj = \
- new (del.mem.first) cancellation_handler_type( \
- del.mem.second, ASIO_VARIADIC_MOVE_ARGS(n)); \
- del.mem.first = 0; \
- *handler_ = handler_obj; \
- return handler_obj->handler(); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_HANDLER_EMPLACE_DEF)
-#undef ASIO_PRIVATE_HANDLER_EMPLACE_DEF
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
/// Installs a handler into the slot.
/**
* Destroys any existing handler in the slot, then installs the new handler,
@@ -240,52 +169,40 @@ public:
* @returns A reference to the newly installed handler.
*/
template <typename CancellationHandler>
- typename decay<CancellationHandler>::type& assign(
- ASIO_MOVE_ARG(CancellationHandler) handler)
+ decay_t<CancellationHandler>& assign(CancellationHandler&& handler)
{
- return this->emplace<typename decay<CancellationHandler>::type>(
- ASIO_MOVE_CAST(CancellationHandler)(handler));
+ return this->emplace<decay_t<CancellationHandler>>(
+ static_cast<CancellationHandler&&>(handler));
}
/// Clears the slot.
/**
* Destroys any existing handler in the slot.
*/
- void clear()
- {
- if (handler_ != 0 && *handler_ != 0)
- {
- std::pair<void*, std::size_t> mem = (*handler_)->destroy();
- detail::thread_info_base::deallocate(
- detail::thread_info_base::cancellation_signal_tag(),
- detail::thread_context::top_of_thread_call_stack(),
- mem.first, mem.second);
- *handler_ = 0;
- }
- }
+ ASIO_DECL void clear();
/// Returns whether the slot is connected to a signal.
- ASIO_CONSTEXPR bool is_connected() const ASIO_NOEXCEPT
+ constexpr bool is_connected() const noexcept
{
return handler_ != 0;
}
/// Returns whether the slot is connected and has an installed handler.
- ASIO_CONSTEXPR bool has_handler() const ASIO_NOEXCEPT
+ constexpr bool has_handler() const noexcept
{
return handler_ != 0 && *handler_ != 0;
}
/// Compare two slots for equality.
- friend ASIO_CONSTEXPR bool operator==(const cancellation_slot& lhs,
- const cancellation_slot& rhs) ASIO_NOEXCEPT
+ friend constexpr bool operator==(const cancellation_slot& lhs,
+ const cancellation_slot& rhs) noexcept
{
return lhs.handler_ == rhs.handler_;
}
/// Compare two slots for inequality.
- friend ASIO_CONSTEXPR bool operator!=(const cancellation_slot& lhs,
- const cancellation_slot& rhs) ASIO_NOEXCEPT
+ friend constexpr bool operator!=(const cancellation_slot& lhs,
+ const cancellation_slot& rhs) noexcept
{
return lhs.handler_ != rhs.handler_;
}
@@ -293,61 +210,26 @@ public:
private:
friend class cancellation_signal;
- ASIO_CONSTEXPR cancellation_slot(int,
+ constexpr cancellation_slot(int,
detail::cancellation_handler_base** handler)
: handler_(handler)
{
}
- std::pair<void*, std::size_t> prepare_memory(
- std::size_t size, std::size_t align)
- {
- assert(handler_);
- std::pair<void*, std::size_t> mem;
- if (*handler_)
- {
- mem = (*handler_)->destroy();
- *handler_ = 0;
- }
- if (size > mem.second
- || reinterpret_cast<std::size_t>(mem.first) % align != 0)
- {
- if (mem.first)
- {
- detail::thread_info_base::deallocate(
- detail::thread_info_base::cancellation_signal_tag(),
- detail::thread_context::top_of_thread_call_stack(),
- mem.first, mem.second);
- }
- mem.first = detail::thread_info_base::allocate(
- detail::thread_info_base::cancellation_signal_tag(),
- detail::thread_context::top_of_thread_call_stack(),
- size, align);
- mem.second = size;
- }
- return mem;
- }
+ ASIO_DECL std::pair<void*, std::size_t> prepare_memory(
+ std::size_t size, std::size_t align);
struct auto_delete_helper
{
std::pair<void*, std::size_t> mem;
- ~auto_delete_helper()
- {
- if (mem.first)
- {
- detail::thread_info_base::deallocate(
- detail::thread_info_base::cancellation_signal_tag(),
- detail::thread_context::top_of_thread_call_stack(),
- mem.first, mem.second);
- }
- }
+ ASIO_DECL ~auto_delete_helper();
};
detail::cancellation_handler_base** handler_;
};
-inline cancellation_slot cancellation_signal::slot() ASIO_NOEXCEPT
+inline cancellation_slot cancellation_signal::slot() noexcept
{
return cancellation_slot(0, &handler_);
}
@@ -356,4 +238,8 @@ inline cancellation_slot cancellation_signal::slot() ASIO_NOEXCEPT
#include "asio/detail/pop_options.hpp"
+#if defined(ASIO_HEADER_ONLY)
+# include "asio/impl/cancellation_signal.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+
#endif // ASIO_CANCELLATION_SIGNAL_HPP
diff --git a/3rdparty/asio/include/asio/cancellation_state.hpp b/3rdparty/asio/include/asio/cancellation_state.hpp
index 868d8d678cc..3c13edcab94 100644
--- a/3rdparty/asio/include/asio/cancellation_state.hpp
+++ b/3rdparty/asio/include/asio/cancellation_state.hpp
@@ -2,7 +2,7 @@
// cancellation_state.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -32,7 +32,7 @@ struct cancellation_filter
{
/// Returns <tt>type & Mask</tt>.
cancellation_type_t operator()(
- cancellation_type_t type) const ASIO_NOEXCEPT
+ cancellation_type_t type) const noexcept
{
return type & Mask;
}
@@ -80,7 +80,7 @@ class cancellation_state
{
public:
/// Construct a disconnected cancellation state.
- ASIO_CONSTEXPR cancellation_state() ASIO_NOEXCEPT
+ constexpr cancellation_state() noexcept
: impl_(0)
{
}
@@ -95,8 +95,8 @@ public:
* attached.
*/
template <typename CancellationSlot>
- ASIO_CONSTEXPR explicit cancellation_state(CancellationSlot slot)
- : impl_(slot.is_connected() ? &slot.template emplace<impl<> >() : 0)
+ constexpr explicit cancellation_state(CancellationSlot slot)
+ : impl_(slot.is_connected() ? &slot.template emplace<impl<>>() : 0)
{
}
@@ -119,9 +119,9 @@ public:
* @li asio::enable_total_cancellation
*/
template <typename CancellationSlot, typename Filter>
- ASIO_CONSTEXPR cancellation_state(CancellationSlot slot, Filter filter)
+ constexpr cancellation_state(CancellationSlot slot, Filter filter)
: impl_(slot.is_connected()
- ? &slot.template emplace<impl<Filter, Filter> >(filter, filter)
+ ? &slot.template emplace<impl<Filter, Filter>>(filter, filter)
: 0)
{
}
@@ -151,12 +151,12 @@ public:
* @li asio::enable_total_cancellation
*/
template <typename CancellationSlot, typename InFilter, typename OutFilter>
- ASIO_CONSTEXPR cancellation_state(CancellationSlot slot,
+ constexpr cancellation_state(CancellationSlot slot,
InFilter in_filter, OutFilter out_filter)
: impl_(slot.is_connected()
- ? &slot.template emplace<impl<InFilter, OutFilter> >(
- ASIO_MOVE_CAST(InFilter)(in_filter),
- ASIO_MOVE_CAST(OutFilter)(out_filter))
+ ? &slot.template emplace<impl<InFilter, OutFilter>>(
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter))
: 0)
{
}
@@ -165,20 +165,20 @@ public:
/**
* This sub-slot is used with the operations that are being composed.
*/
- ASIO_CONSTEXPR cancellation_slot slot() const ASIO_NOEXCEPT
+ constexpr cancellation_slot slot() const noexcept
{
return impl_ ? impl_->signal_.slot() : cancellation_slot();
}
/// Returns the cancellation types that have been triggered.
- cancellation_type_t cancelled() const ASIO_NOEXCEPT
+ cancellation_type_t cancelled() const noexcept
{
return impl_ ? impl_->cancelled_ : cancellation_type_t();
}
/// Clears the specified cancellation types, if they have been triggered.
void clear(cancellation_type_t mask = cancellation_type::all)
- ASIO_NOEXCEPT
+ noexcept
{
if (impl_)
impl_->cancelled_ &= ~mask;
@@ -208,8 +208,8 @@ private:
}
impl(InFilter in_filter, OutFilter out_filter)
- : in_filter_(ASIO_MOVE_CAST(InFilter)(in_filter)),
- out_filter_(ASIO_MOVE_CAST(OutFilter)(out_filter))
+ : in_filter_(static_cast<InFilter&&>(in_filter)),
+ out_filter_(static_cast<OutFilter&&>(out_filter))
{
}
diff --git a/3rdparty/asio/include/asio/cancellation_type.hpp b/3rdparty/asio/include/asio/cancellation_type.hpp
index 9eff047b63d..ec4a4d2458a 100644
--- a/3rdparty/asio/include/asio/cancellation_type.hpp
+++ b/3rdparty/asio/include/asio/cancellation_type.hpp
@@ -2,7 +2,7 @@
// cancellation_type.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -51,7 +51,7 @@ enum cancellation_type
/// Portability typedef.
typedef cancellation_type cancellation_type_t;
-#elif defined(ASIO_HAS_ENUM_CLASS)
+#else // defined(GENERATING_DOCUMENTATION)
enum class cancellation_type : unsigned int
{
@@ -64,30 +64,13 @@ enum class cancellation_type : unsigned int
typedef cancellation_type cancellation_type_t;
-#else // defined(ASIO_HAS_ENUM_CLASS)
-
-namespace cancellation_type {
-
-enum cancellation_type_t
-{
- none = 0,
- terminal = 1,
- partial = 2,
- total = 4,
- all = 0xFFFFFFFF
-};
-
-} // namespace cancellation_type
-
-typedef cancellation_type::cancellation_type_t cancellation_type_t;
-
-#endif // defined(ASIO_HAS_ENUM_CLASS)
+#endif // defined(GENERATING_DOCUMENTATION)
/// Negation operator.
/**
* @relates cancellation_type
*/
-inline ASIO_CONSTEXPR bool operator!(cancellation_type_t x)
+inline constexpr bool operator!(cancellation_type_t x)
{
return static_cast<unsigned int>(x) == 0;
}
@@ -96,7 +79,7 @@ inline ASIO_CONSTEXPR bool operator!(cancellation_type_t x)
/**
* @relates cancellation_type
*/
-inline ASIO_CONSTEXPR cancellation_type_t operator&(
+inline constexpr cancellation_type_t operator&(
cancellation_type_t x, cancellation_type_t y)
{
return static_cast<cancellation_type_t>(
@@ -107,7 +90,7 @@ inline ASIO_CONSTEXPR cancellation_type_t operator&(
/**
* @relates cancellation_type
*/
-inline ASIO_CONSTEXPR cancellation_type_t operator|(
+inline constexpr cancellation_type_t operator|(
cancellation_type_t x, cancellation_type_t y)
{
return static_cast<cancellation_type_t>(
@@ -118,7 +101,7 @@ inline ASIO_CONSTEXPR cancellation_type_t operator|(
/**
* @relates cancellation_type
*/
-inline ASIO_CONSTEXPR cancellation_type_t operator^(
+inline constexpr cancellation_type_t operator^(
cancellation_type_t x, cancellation_type_t y)
{
return static_cast<cancellation_type_t>(
@@ -129,7 +112,7 @@ inline ASIO_CONSTEXPR cancellation_type_t operator^(
/**
* @relates cancellation_type
*/
-inline ASIO_CONSTEXPR cancellation_type_t operator~(cancellation_type_t x)
+inline constexpr cancellation_type_t operator~(cancellation_type_t x)
{
return static_cast<cancellation_type_t>(~static_cast<unsigned int>(x));
}
diff --git a/3rdparty/asio/include/asio/co_spawn.hpp b/3rdparty/asio/include/asio/co_spawn.hpp
index d65593d69f4..26988f47da0 100644
--- a/3rdparty/asio/include/asio/co_spawn.hpp
+++ b/3rdparty/asio/include/asio/co_spawn.hpp
@@ -2,7 +2,7 @@
// co_spawn.hpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -54,11 +54,14 @@ struct awaitable_signature<awaitable<void, Executor>>
* @param a The asio::awaitable object that is the result of calling the
* coroutine's entry point function.
*
- * @param token The completion token that will handle the notification that
+ * @param token The @ref completion_token that will handle the notification that
* the thread of execution has completed. The function signature of the
* completion handler must be:
* @code void handler(std::exception_ptr, T); @endcode
*
+ * @par Completion Signature
+ * @code void(std::exception_ptr, T) @endcode
+ *
* @par Example
* @code
* asio::awaitable<std::size_t> echo(tcp::socket socket)
@@ -110,10 +113,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
co_spawn(const Executor& ex, awaitable<T, AwaitableExecutor> a,
CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<
+ constraint_t<
(is_executor<Executor>::value || execution::is_executor<Executor>::value)
&& is_convertible<Executor, AwaitableExecutor>::value
- >::type = 0);
+ > = 0);
/// Spawn a new coroutined-based thread of execution.
/**
@@ -123,11 +126,14 @@ co_spawn(const Executor& ex, awaitable<T, AwaitableExecutor> a,
* @param a The asio::awaitable object that is the result of calling the
* coroutine's entry point function.
*
- * @param token The completion token that will handle the notification that
+ * @param token The @ref completion_token that will handle the notification that
* the thread of execution has completed. The function signature of the
* completion handler must be:
* @code void handler(std::exception_ptr); @endcode
*
+ * @par Completion Signature
+ * @code void(std::exception_ptr) @endcode
+ *
* @par Example
* @code
* asio::awaitable<void> echo(tcp::socket socket)
@@ -171,10 +177,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
co_spawn(const Executor& ex, awaitable<void, AwaitableExecutor> a,
CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<
+ constraint_t<
(is_executor<Executor>::value || execution::is_executor<Executor>::value)
&& is_convertible<Executor, AwaitableExecutor>::value
- >::type = 0);
+ > = 0);
/// Spawn a new coroutined-based thread of execution.
/**
@@ -184,11 +190,14 @@ co_spawn(const Executor& ex, awaitable<void, AwaitableExecutor> a,
* @param a The asio::awaitable object that is the result of calling the
* coroutine's entry point function.
*
- * @param token The completion token that will handle the notification that
+ * @param token The @ref completion_token that will handle the notification that
* the thread of execution has completed. The function signature of the
* completion handler must be:
* @code void handler(std::exception_ptr); @endcode
*
+ * @par Completion Signature
+ * @code void(std::exception_ptr, T) @endcode
+ *
* @par Example
* @code
* asio::awaitable<std::size_t> echo(tcp::socket socket)
@@ -242,11 +251,11 @@ co_spawn(ExecutionContext& ctx, awaitable<T, AwaitableExecutor> a,
CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN(
typename ExecutionContext::executor_type),
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
&& is_convertible<typename ExecutionContext::executor_type,
AwaitableExecutor>::value
- >::type = 0);
+ > = 0);
/// Spawn a new coroutined-based thread of execution.
/**
@@ -256,11 +265,14 @@ co_spawn(ExecutionContext& ctx, awaitable<T, AwaitableExecutor> a,
* @param a The asio::awaitable object that is the result of calling the
* coroutine's entry point function.
*
- * @param token The completion token that will handle the notification that
+ * @param token The @ref completion_token that will handle the notification that
* the thread of execution has completed. The function signature of the
* completion handler must be:
* @code void handler(std::exception_ptr); @endcode
*
+ * @par Completion Signature
+ * @code void(std::exception_ptr) @endcode
+ *
* @par Example
* @code
* asio::awaitable<void> echo(tcp::socket socket)
@@ -306,11 +318,11 @@ co_spawn(ExecutionContext& ctx, awaitable<void, AwaitableExecutor> a,
CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN(
typename ExecutionContext::executor_type),
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
&& is_convertible<typename ExecutionContext::executor_type,
AwaitableExecutor>::value
- >::type = 0);
+ > = 0);
/// Spawn a new coroutined-based thread of execution.
/**
@@ -321,14 +333,20 @@ co_spawn(ExecutionContext& ctx, awaitable<void, AwaitableExecutor> a,
* @c asio::awaitable<R,E> that will be used as the coroutine's entry
* point.
*
- * @param token The completion token that will handle the notification that the
- * thread of execution has completed. If @c R is @c void, the function
+ * @param token The @ref completion_token that will handle the notification
+ * that the thread of execution has completed. If @c R is @c void, the function
* signature of the completion handler must be:
*
* @code void handler(std::exception_ptr); @endcode
* Otherwise, the function signature of the completion handler must be:
* @code void handler(std::exception_ptr, R); @endcode
*
+ * @par Completion Signature
+ * @code void(std::exception_ptr, R) @endcode
+ * where @c R is the first template argument to the @c awaitable returned by the
+ * supplied function object @c F:
+ * @code asio::awaitable<R, AwaitableExecutor> F() @endcode
+ *
* @par Example
* @code
* asio::awaitable<std::size_t> echo(tcp::socket socket)
@@ -388,16 +406,16 @@ co_spawn(ExecutionContext& ctx, awaitable<void, AwaitableExecutor> a,
*/
template <typename Executor, typename F,
ASIO_COMPLETION_TOKEN_FOR(typename detail::awaitable_signature<
- typename result_of<F()>::type>::type) CompletionToken
+ result_of_t<F()>>::type) CompletionToken
ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
- typename detail::awaitable_signature<typename result_of<F()>::type>::type)
+ typename detail::awaitable_signature<result_of_t<F()>>::type)
co_spawn(const Executor& ex, F&& f,
CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<
+ constraint_t<
is_executor<Executor>::value || execution::is_executor<Executor>::value
- >::type = 0);
+ > = 0);
/// Spawn a new coroutined-based thread of execution.
/**
@@ -408,14 +426,20 @@ co_spawn(const Executor& ex, F&& f,
* @c asio::awaitable<R,E> that will be used as the coroutine's entry
* point.
*
- * @param token The completion token that will handle the notification that the
- * thread of execution has completed. If @c R is @c void, the function
+ * @param token The @ref completion_token that will handle the notification
+ * that the thread of execution has completed. If @c R is @c void, the function
* signature of the completion handler must be:
*
* @code void handler(std::exception_ptr); @endcode
* Otherwise, the function signature of the completion handler must be:
* @code void handler(std::exception_ptr, R); @endcode
*
+ * @par Completion Signature
+ * @code void(std::exception_ptr, R) @endcode
+ * where @c R is the first template argument to the @c awaitable returned by the
+ * supplied function object @c F:
+ * @code asio::awaitable<R, AwaitableExecutor> F() @endcode
+ *
* @par Example
* @code
* asio::awaitable<std::size_t> echo(tcp::socket socket)
@@ -475,18 +499,18 @@ co_spawn(const Executor& ex, F&& f,
*/
template <typename ExecutionContext, typename F,
ASIO_COMPLETION_TOKEN_FOR(typename detail::awaitable_signature<
- typename result_of<F()>::type>::type) CompletionToken
+ result_of_t<F()>>::type) CompletionToken
ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
typename ExecutionContext::executor_type)>
ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
- typename detail::awaitable_signature<typename result_of<F()>::type>::type)
+ typename detail::awaitable_signature<result_of_t<F()>>::type)
co_spawn(ExecutionContext& ctx, F&& f,
CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN(
typename ExecutionContext::executor_type),
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0);
+ > = 0);
} // namespace asio
diff --git a/3rdparty/asio/include/asio/completion_condition.hpp b/3rdparty/asio/include/asio/completion_condition.hpp
index cf8c7c2bc92..3fe774f1ef1 100644
--- a/3rdparty/asio/include/asio/completion_condition.hpp
+++ b/3rdparty/asio/include/asio/completion_condition.hpp
@@ -2,7 +2,7 @@
// completion_condition.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/compose.hpp b/3rdparty/asio/include/asio/compose.hpp
index 3f6f1b88978..abb438e3da7 100644
--- a/3rdparty/asio/include/asio/compose.hpp
+++ b/3rdparty/asio/include/asio/compose.hpp
@@ -2,7 +2,7 @@
// compose.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,14 +16,196 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
+#include "asio/associated_executor.hpp"
#include "asio/async_result.hpp"
+#include "asio/detail/base_from_cancellation_state.hpp"
+#include "asio/detail/composed_work.hpp"
+#include "asio/detail/handler_cont_helpers.hpp"
+#include "asio/detail/type_traits.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
+namespace detail {
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
+template <typename Impl, typename Work, typename Handler, typename Signature>
+class composed_op;
+
+template <typename Impl, typename Work, typename Handler,
+ typename R, typename... Args>
+class composed_op<Impl, Work, Handler, R(Args...)>
+ : public base_from_cancellation_state<Handler>
+{
+public:
+ template <typename I, typename W, typename H>
+ composed_op(I&& impl,
+ W&& work,
+ H&& handler)
+ : base_from_cancellation_state<Handler>(
+ handler, enable_terminal_cancellation()),
+ impl_(static_cast<I&&>(impl)),
+ work_(static_cast<W&&>(work)),
+ handler_(static_cast<H&&>(handler)),
+ invocations_(0)
+ {
+ }
+
+ composed_op(composed_op&& other)
+ : base_from_cancellation_state<Handler>(
+ static_cast<base_from_cancellation_state<Handler>&&>(other)),
+ impl_(static_cast<Impl&&>(other.impl_)),
+ work_(static_cast<Work&&>(other.work_)),
+ handler_(static_cast<Handler&&>(other.handler_)),
+ invocations_(other.invocations_)
+ {
+ }
+
+ typedef typename composed_work_guard<
+ typename Work::head_type>::executor_type io_executor_type;
+
+ io_executor_type get_io_executor() const noexcept
+ {
+ return work_.head_.get_executor();
+ }
+
+ typedef associated_executor_t<Handler, io_executor_type> executor_type;
+
+ executor_type get_executor() const noexcept
+ {
+ return (get_associated_executor)(handler_, work_.head_.get_executor());
+ }
+
+ typedef associated_allocator_t<Handler, std::allocator<void>> allocator_type;
+
+ allocator_type get_allocator() const noexcept
+ {
+ return (get_associated_allocator)(handler_, std::allocator<void>());
+ }
+
+ template<typename... T>
+ void operator()(T&&... t)
+ {
+ if (invocations_ < ~0u)
+ ++invocations_;
+ this->get_cancellation_state().slot().clear();
+ impl_(*this, static_cast<T&&>(t)...);
+ }
+
+ void complete(Args... args)
+ {
+ this->work_.reset();
+ static_cast<Handler&&>(this->handler_)(static_cast<Args&&>(args)...);
+ }
+
+ void reset_cancellation_state()
+ {
+ base_from_cancellation_state<Handler>::reset_cancellation_state(handler_);
+ }
+
+ template <typename Filter>
+ void reset_cancellation_state(Filter&& filter)
+ {
+ base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
+ static_cast<Filter&&>(filter));
+ }
+
+ template <typename InFilter, typename OutFilter>
+ void reset_cancellation_state(InFilter&& in_filter,
+ OutFilter&& out_filter)
+ {
+ base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter));
+ }
+
+ cancellation_type_t cancelled() const noexcept
+ {
+ return base_from_cancellation_state<Handler>::cancelled();
+ }
+
+//private:
+ Impl impl_;
+ Work work_;
+ Handler handler_;
+ unsigned invocations_;
+};
+
+template <typename Impl, typename Work, typename Handler, typename Signature>
+inline bool asio_handler_is_continuation(
+ composed_op<Impl, Work, Handler, Signature>* this_handler)
+{
+ return this_handler->invocations_ > 1 ? true
+ : asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
+template <typename Signature, typename Executors>
+class initiate_composed_op
+{
+public:
+ typedef typename composed_io_executors<Executors>::head_type executor_type;
+
+ template <typename T>
+ explicit initiate_composed_op(int, T&& executors)
+ : executors_(static_cast<T&&>(executors))
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return executors_.head_;
+ }
+
+ template <typename Handler, typename Impl>
+ void operator()(Handler&& handler,
+ Impl&& impl) const
+ {
+ composed_op<decay_t<Impl>, composed_work<Executors>,
+ decay_t<Handler>, Signature>(
+ static_cast<Impl&&>(impl),
+ composed_work<Executors>(executors_),
+ static_cast<Handler&&>(handler))();
+ }
+
+private:
+ composed_io_executors<Executors> executors_;
+};
+
+template <typename Signature, typename Executors>
+inline initiate_composed_op<Signature, Executors> make_initiate_composed_op(
+ composed_io_executors<Executors>&& executors)
+{
+ return initiate_composed_op<Signature, Executors>(0,
+ static_cast<composed_io_executors<Executors>&&>(executors));
+}
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <template <typename, typename> class Associator,
+ typename Impl, typename Work, typename Handler,
+ typename Signature, typename DefaultCandidate>
+struct associator<Associator,
+ detail::composed_op<Impl, Work, Handler, Signature>,
+ DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const detail::composed_op<Impl, Work, Handler, Signature>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::composed_op<Impl, Work, Handler, Signature>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
/// Launch an asynchronous operation with a stateful implementation.
/**
@@ -37,12 +219,19 @@ namespace asio {
* handler. The remaining arguments are any arguments that originate from the
* completion handlers of any asynchronous operations performed by the
* implementation.
-
+ *
* @param token The completion token.
*
* @param io_objects_or_executors Zero or more I/O objects or I/O executors for
* which outstanding work must be maintained.
*
+ * @par Per-Operation Cancellation
+ * By default, terminal per-operation cancellation is enabled for
+ * composed operations that are implemented using @c async_compose. To
+ * disable cancellation for the composed operation, or to alter its
+ * supported cancellation types, call the @c self object's @c
+ * reset_cancellation_state function.
+ *
* @par Example:
*
* @code struct async_echo_implementation
@@ -87,9 +276,11 @@ namespace asio {
* auto async_echo(tcp::socket& socket,
* asio::mutable_buffer buffer,
* CompletionToken&& token) ->
- * typename asio::async_result<
- * typename std::decay<CompletionToken>::type,
- * void(asio::error_code, std::size_t)>::return_type
+ * decltype(
+ * asio::async_compose<CompletionToken,
+ * void(asio::error_code, std::size_t)>(
+ * std::declval<async_echo_implementation>(),
+ * token, socket))
* {
* return asio::async_compose<CompletionToken,
* void(asio::error_code, std::size_t)>(
@@ -100,37 +291,29 @@ namespace asio {
*/
template <typename CompletionToken, typename Signature,
typename Implementation, typename... IoObjectsOrExecutors>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature)
-async_compose(ASIO_MOVE_ARG(Implementation) implementation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token,
- ASIO_MOVE_ARG(IoObjectsOrExecutors)... io_objects_or_executors);
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
-template <typename CompletionToken, typename Signature, typename Implementation>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature)
-async_compose(ASIO_MOVE_ARG(Implementation) implementation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token);
-
-#define ASIO_PRIVATE_ASYNC_COMPOSE_DEF(n) \
- template <typename CompletionToken, typename Signature, \
- typename Implementation, ASIO_VARIADIC_TPARAMS(n)> \
- ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature) \
- async_compose(ASIO_MOVE_ARG(Implementation) implementation, \
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n));
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ASYNC_COMPOSE_DEF)
-#undef ASIO_PRIVATE_ASYNC_COMPOSE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
+auto async_compose(Implementation&& implementation,
+ type_identity_t<CompletionToken>& token,
+ IoObjectsOrExecutors&&... io_objects_or_executors)
+ -> decltype(
+ async_initiate<CompletionToken, Signature>(
+ detail::make_initiate_composed_op<Signature>(
+ detail::make_composed_io_executors(
+ detail::get_composed_io_executor(
+ static_cast<IoObjectsOrExecutors&&>(
+ io_objects_or_executors))...)),
+ token, static_cast<Implementation&&>(implementation)))
+{
+ return async_initiate<CompletionToken, Signature>(
+ detail::make_initiate_composed_op<Signature>(
+ detail::make_composed_io_executors(
+ detail::get_composed_io_executor(
+ static_cast<IoObjectsOrExecutors&&>(
+ io_objects_or_executors))...)),
+ token, static_cast<Implementation&&>(implementation));
+}
} // namespace asio
#include "asio/detail/pop_options.hpp"
-#include "asio/impl/compose.hpp"
-
#endif // ASIO_COMPOSE_HPP
diff --git a/3rdparty/asio/include/asio/connect.hpp b/3rdparty/asio/include/asio/connect.hpp
index ff22a670b17..d2916675455 100644
--- a/3rdparty/asio/include/asio/connect.hpp
+++ b/3rdparty/asio/include/asio/connect.hpp
@@ -2,7 +2,7 @@
// connect.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -27,6 +27,10 @@ namespace asio {
namespace detail
{
+ struct default_connect_condition;
+ template <typename, typename> class initiate_async_range_connect;
+ template <typename, typename> class initiate_async_iterator_connect;
+
char (&has_iterator_helper(...))[2];
template <typename T>
@@ -90,8 +94,7 @@ struct is_endpoint_sequence
template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type = 0);
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0);
/// Establishes a socket connection by trying each endpoint in a sequence.
/**
@@ -126,8 +129,7 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, asio::error_code& ec,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type = 0);
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0);
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Establishes a socket connection by trying
@@ -156,7 +158,7 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
*/
template <typename Protocol, typename Executor, typename Iterator>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
+ constraint_t<!is_endpoint_sequence<Iterator>::value> = 0);
/// (Deprecated: Use range overload.) Establishes a socket connection by trying
/// each endpoint in a sequence.
@@ -185,7 +187,7 @@ Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
template <typename Protocol, typename Executor, typename Iterator>
Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, asio::error_code& ec,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
+ constraint_t<!is_endpoint_sequence<Iterator>::value> = 0);
#endif // !defined(ASIO_NO_DEPRECATED)
/// Establishes a socket connection by trying each endpoint in a sequence.
@@ -311,8 +313,7 @@ template <typename Protocol, typename Executor,
typename EndpointSequence, typename ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type = 0);
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0);
/// Establishes a socket connection by trying each endpoint in a sequence.
/**
@@ -379,8 +380,7 @@ template <typename Protocol, typename Executor,
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
asio::error_code& ec,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type = 0);
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0);
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Establishes a socket connection by trying
@@ -422,7 +422,7 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
+ constraint_t<!is_endpoint_sequence<Iterator>::value> = 0);
/// (Deprecated: Use range overload.) Establishes a socket connection by trying
/// each endpoint in a sequence.
@@ -463,7 +463,7 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
ConnectCondition connect_condition, asio::error_code& ec,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
+ constraint_t<!is_endpoint_sequence<Iterator>::value> = 0);
#endif // !defined(ASIO_NO_DEPRECATED)
/// Establishes a socket connection by trying each endpoint in a sequence.
@@ -610,16 +610,19 @@ Iterator connect(basic_socket<Protocol, Executor>& s,
* This function attempts to connect a socket to one of a sequence of
* endpoints. It does this by repeated calls to the socket's @c async_connect
* member function, once for each endpoint in the sequence, until a connection
- * is successfully established.
+ * is successfully established. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param s The socket to be connected. If the socket is already open, it will
* be closed.
*
* @param endpoints A sequence of endpoints.
*
- * @param handler The handler to be called when the connect operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the connect completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation. if the sequence is empty, set to
* // asio::error::not_found. Otherwise, contains the
@@ -631,10 +634,13 @@ Iterator connect(basic_socket<Protocol, Executor>& s,
* const typename Protocol::endpoint& endpoint
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, typename Protocol::endpoint) @endcode
+ *
* @par Example
* @code tcp::resolver r(my_context);
* tcp::resolver::query q("host", "service");
@@ -677,16 +683,17 @@ Iterator connect(basic_socket<Protocol, Executor>& s,
*/
template <typename Protocol, typename Executor, typename EndpointSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- typename Protocol::endpoint)) RangeConnectHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
-ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
- void (asio::error_code, typename Protocol::endpoint))
-async_connect(basic_socket<Protocol, Executor>& s,
+ typename Protocol::endpoint)) RangeConnectToken
+ = default_completion_token_t<Executor>>
+auto async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
- ASIO_MOVE_ARG(RangeConnectHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type = 0);
+ RangeConnectToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0)
+ -> decltype(
+ async_initiate<RangeConnectToken,
+ void (asio::error_code, typename Protocol::endpoint)>(
+ declval<detail::initiate_async_range_connect<Protocol, Executor>>(),
+ token, endpoints, declval<detail::default_connect_condition>()));
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Asynchronously establishes a socket
@@ -695,16 +702,19 @@ async_connect(basic_socket<Protocol, Executor>& s,
* This function attempts to connect a socket to one of a sequence of
* endpoints. It does this by repeated calls to the socket's @c async_connect
* member function, once for each endpoint in the sequence, until a connection
- * is successfully established.
+ * is successfully established. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param s The socket to be connected. If the socket is already open, it will
* be closed.
*
* @param begin An iterator pointing to the start of a sequence of endpoints.
*
- * @param handler The handler to be called when the connect operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the connect completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation. if the sequence is empty, set to
* // asio::error::not_found. Otherwise, contains the
@@ -716,10 +726,13 @@ async_connect(basic_socket<Protocol, Executor>& s,
* Iterator iterator
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, Iterator) @endcode
+ *
* @note This overload assumes that a default constructed object of type @c
* Iterator represents the end of the sequence. This is a valid assumption for
* iterator types such as @c asio::ip::tcp::resolver::iterator.
@@ -736,14 +749,16 @@ async_connect(basic_socket<Protocol, Executor>& s,
*/
template <typename Protocol, typename Executor, typename Iterator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- Iterator)) IteratorConnectHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
-ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
- void (asio::error_code, Iterator))
-async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- ASIO_MOVE_ARG(IteratorConnectHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
+ Iterator)) IteratorConnectToken = default_completion_token_t<Executor>>
+auto async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
+ IteratorConnectToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<!is_endpoint_sequence<Iterator>::value> = 0)
+ -> decltype(
+ async_initiate<IteratorConnectToken,
+ void (asio::error_code, Iterator)>(
+ declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
+ token, begin, Iterator(),
+ declval<detail::default_connect_condition>()));
#endif // !defined(ASIO_NO_DEPRECATED)
/// Asynchronously establishes a socket connection by trying each endpoint in a
@@ -752,7 +767,8 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
* This function attempts to connect a socket to one of a sequence of
* endpoints. It does this by repeated calls to the socket's @c async_connect
* member function, once for each endpoint in the sequence, until a connection
- * is successfully established.
+ * is successfully established. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param s The socket to be connected. If the socket is already open, it will
* be closed.
@@ -761,9 +777,11 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
*
* @param end An iterator pointing to the end of a sequence of endpoints.
*
- * @param handler The handler to be called when the connect operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the connect completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation. if the sequence is empty, set to
* // asio::error::not_found. Otherwise, contains the
@@ -775,10 +793,13 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
* Iterator iterator
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, Iterator) @endcode
+ *
* @par Example
* @code std::vector<tcp::endpoint> endpoints = ...;
* tcp::socket s(my_context);
@@ -807,13 +828,15 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
*/
template <typename Protocol, typename Executor, typename Iterator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- Iterator)) IteratorConnectHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
-ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
- void (asio::error_code, Iterator))
-async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator end,
- ASIO_MOVE_ARG(IteratorConnectHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(Executor));
+ Iterator)) IteratorConnectToken = default_completion_token_t<Executor>>
+auto async_connect(
+ basic_socket<Protocol, Executor>& s, Iterator begin, Iterator end,
+ IteratorConnectToken&& token = default_completion_token_t<Executor>())
+ -> decltype(
+ async_initiate<IteratorConnectToken,
+ void (asio::error_code, Iterator)>(
+ declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
+ token, begin, end, declval<detail::default_connect_condition>()));
/// Asynchronously establishes a socket connection by trying each endpoint in a
/// sequence.
@@ -821,7 +844,8 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator end,
* This function attempts to connect a socket to one of a sequence of
* endpoints. It does this by repeated calls to the socket's @c async_connect
* member function, once for each endpoint in the sequence, until a connection
- * is successfully established.
+ * is successfully established. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param s The socket to be connected. If the socket is already open, it will
* be closed.
@@ -839,9 +863,11 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator end,
* The function object should return true if the next endpoint should be tried,
* and false if it should be skipped.
*
- * @param handler The handler to be called when the connect operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the connect completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation. if the sequence is empty, set to
* // asio::error::not_found. Otherwise, contains the
@@ -853,10 +879,13 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator end,
* Iterator iterator
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, typename Protocol::endpoint) @endcode
+ *
* @par Example
* The following connect condition function object can be used to output
* information about the individual connection attempts:
@@ -923,16 +952,17 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator end,
template <typename Protocol, typename Executor,
typename EndpointSequence, typename ConnectCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- typename Protocol::endpoint)) RangeConnectHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
-ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
- void (asio::error_code, typename Protocol::endpoint))
-async_connect(basic_socket<Protocol, Executor>& s,
+ typename Protocol::endpoint)) RangeConnectToken
+ = default_completion_token_t<Executor>>
+auto async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
- ASIO_MOVE_ARG(RangeConnectHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type = 0);
+ RangeConnectToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0)
+ -> decltype(
+ async_initiate<RangeConnectToken,
+ void (asio::error_code, typename Protocol::endpoint)>(
+ declval<detail::initiate_async_range_connect<Protocol, Executor>>(),
+ token, endpoints, connect_condition));
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Asynchronously establishes a socket
@@ -941,7 +971,8 @@ async_connect(basic_socket<Protocol, Executor>& s,
* This function attempts to connect a socket to one of a sequence of
* endpoints. It does this by repeated calls to the socket's @c async_connect
* member function, once for each endpoint in the sequence, until a connection
- * is successfully established.
+ * is successfully established. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param s The socket to be connected. If the socket is already open, it will
* be closed.
@@ -959,9 +990,11 @@ async_connect(basic_socket<Protocol, Executor>& s,
* The function object should return true if the next endpoint should be tried,
* and false if it should be skipped.
*
- * @param handler The handler to be called when the connect operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the connect completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation. if the sequence is empty, set to
* // asio::error::not_found. Otherwise, contains the
@@ -973,10 +1006,13 @@ async_connect(basic_socket<Protocol, Executor>& s,
* Iterator iterator
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, Iterator) @endcode
+ *
* @note This overload assumes that a default constructed object of type @c
* Iterator represents the end of the sequence. This is a valid assumption for
* iterator types such as @c asio::ip::tcp::resolver::iterator.
@@ -994,15 +1030,16 @@ async_connect(basic_socket<Protocol, Executor>& s,
template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- Iterator)) IteratorConnectHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
-ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
- void (asio::error_code, Iterator))
-async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- ConnectCondition connect_condition,
- ASIO_MOVE_ARG(IteratorConnectHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
+ Iterator)) IteratorConnectToken = default_completion_token_t<Executor>>
+auto async_connect(basic_socket<Protocol, Executor>& s,
+ Iterator begin, ConnectCondition connect_condition,
+ IteratorConnectToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<!is_endpoint_sequence<Iterator>::value> = 0)
+ -> decltype(
+ async_initiate<IteratorConnectToken,
+ void (asio::error_code, Iterator)>(
+ declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
+ token, begin, Iterator(), connect_condition));
#endif // !defined(ASIO_NO_DEPRECATED)
/// Asynchronously establishes a socket connection by trying each endpoint in a
@@ -1011,7 +1048,8 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
* This function attempts to connect a socket to one of a sequence of
* endpoints. It does this by repeated calls to the socket's @c async_connect
* member function, once for each endpoint in the sequence, until a connection
- * is successfully established.
+ * is successfully established. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param s The socket to be connected. If the socket is already open, it will
* be closed.
@@ -1031,9 +1069,11 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
* The function object should return true if the next endpoint should be tried,
* and false if it should be skipped.
*
- * @param handler The handler to be called when the connect operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the connect completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation. if the sequence is empty, set to
* // asio::error::not_found. Otherwise, contains the
@@ -1045,10 +1085,13 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
* Iterator iterator
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, Iterator) @endcode
+ *
* @par Example
* The following connect condition function object can be used to output
* information about the individual connection attempts:
@@ -1116,14 +1159,15 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- Iterator)) IteratorConnectHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
-ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
- void (asio::error_code, Iterator))
-async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- Iterator end, ConnectCondition connect_condition,
- ASIO_MOVE_ARG(IteratorConnectHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(Executor));
+ Iterator)) IteratorConnectToken = default_completion_token_t<Executor>>
+auto async_connect(basic_socket<Protocol, Executor>& s,
+ Iterator begin, Iterator end, ConnectCondition connect_condition,
+ IteratorConnectToken&& token = default_completion_token_t<Executor>())
+ -> decltype(
+ async_initiate<IteratorConnectToken,
+ void (asio::error_code, Iterator)>(
+ declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
+ token, begin, end, connect_condition));
/*@}*/
diff --git a/3rdparty/asio/include/asio/connect_pipe.hpp b/3rdparty/asio/include/asio/connect_pipe.hpp
new file mode 100644
index 00000000000..1c9eb79383f
--- /dev/null
+++ b/3rdparty/asio/include/asio/connect_pipe.hpp
@@ -0,0 +1,83 @@
+//
+// connect_pipe.hpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_CONNECT_PIPE_HPP
+#define ASIO_CONNECT_PIPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_PIPE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include "asio/basic_readable_pipe.hpp"
+#include "asio/basic_writable_pipe.hpp"
+#include "asio/error.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+#if defined(ASIO_HAS_IOCP)
+typedef HANDLE native_pipe_handle;
+#else // defined(ASIO_HAS_IOCP)
+typedef int native_pipe_handle;
+#endif // defined(ASIO_HAS_IOCP)
+
+ASIO_DECL void create_pipe(native_pipe_handle p[2],
+ asio::error_code& ec);
+
+ASIO_DECL void close_pipe(native_pipe_handle p);
+
+} // namespace detail
+
+/// Connect two pipe ends using an anonymous pipe.
+/**
+ * @param read_end The read end of the pipe.
+ *
+ * @param write_end The write end of the pipe.
+ *
+ * @throws asio::system_error Thrown on failure.
+ */
+template <typename Executor1, typename Executor2>
+void connect_pipe(basic_readable_pipe<Executor1>& read_end,
+ basic_writable_pipe<Executor2>& write_end);
+
+/// Connect two pipe ends using an anonymous pipe.
+/**
+ * @param read_end The read end of the pipe.
+ *
+ * @param write_end The write end of the pipe.
+ *
+ * @throws asio::system_error Thrown on failure.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+template <typename Executor1, typename Executor2>
+ASIO_SYNC_OP_VOID connect_pipe(basic_readable_pipe<Executor1>& read_end,
+ basic_writable_pipe<Executor2>& write_end, asio::error_code& ec);
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/impl/connect_pipe.hpp"
+#if defined(ASIO_HEADER_ONLY)
+# include "asio/impl/connect_pipe.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+
+#endif // defined(ASIO_HAS_PIPE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_CONNECT_PIPE_HPP
diff --git a/3rdparty/asio/include/asio/consign.hpp b/3rdparty/asio/include/asio/consign.hpp
new file mode 100644
index 00000000000..4b0bc431309
--- /dev/null
+++ b/3rdparty/asio/include/asio/consign.hpp
@@ -0,0 +1,75 @@
+//
+// consign.hpp
+// ~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_CONSIGN_HPP
+#define ASIO_CONSIGN_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <tuple>
+#include "asio/detail/type_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// Completion token type used to specify that the completion handler should
+/// carry additional values along with it.
+/**
+ * This completion token adapter is typically used to keep at least one copy of
+ * an object, such as a smart pointer, alive until the completion handler is
+ * called.
+ */
+template <typename CompletionToken, typename... Values>
+class consign_t
+{
+public:
+ /// Constructor.
+ template <typename T, typename... V>
+ constexpr explicit consign_t(T&& completion_token, V&&... values)
+ : token_(static_cast<T&&>(completion_token)),
+ values_(static_cast<V&&>(values)...)
+ {
+ }
+
+#if defined(GENERATING_DOCUMENTATION)
+private:
+#endif // defined(GENERATING_DOCUMENTATION)
+ CompletionToken token_;
+ std::tuple<Values...> values_;
+};
+
+/// Completion token adapter used to specify that the completion handler should
+/// carry additional values along with it.
+/**
+ * This completion token adapter is typically used to keep at least one copy of
+ * an object, such as a smart pointer, alive until the completion handler is
+ * called.
+ */
+template <typename CompletionToken, typename... Values>
+ASIO_NODISCARD inline constexpr
+consign_t<decay_t<CompletionToken>, decay_t<Values>...>
+consign(CompletionToken&& completion_token, Values&&... values)
+{
+ return consign_t<decay_t<CompletionToken>, decay_t<Values>...>(
+ static_cast<CompletionToken&&>(completion_token),
+ static_cast<Values&&>(values)...);
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/impl/consign.hpp"
+
+#endif // ASIO_CONSIGN_HPP
diff --git a/3rdparty/asio/include/asio/coroutine.hpp b/3rdparty/asio/include/asio/coroutine.hpp
index bb0bdba8451..036e5148ad0 100644
--- a/3rdparty/asio/include/asio/coroutine.hpp
+++ b/3rdparty/asio/include/asio/coroutine.hpp
@@ -2,7 +2,7 @@
// coroutine.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -266,6 +266,7 @@ class coroutine_ref
public:
coroutine_ref(coroutine& c) : value_(c.value_), modified_(false) {}
coroutine_ref(coroutine* c) : value_(c->value_), modified_(false) {}
+ coroutine_ref(const coroutine_ref&) = default;
~coroutine_ref() { if (!modified_) value_ = -1; }
operator int() const { return value_; }
int& operator=(int v) { modified_ = true; return value_ = v; }
diff --git a/3rdparty/asio/include/asio/deadline_timer.hpp b/3rdparty/asio/include/asio/deadline_timer.hpp
index 73872c8d357..dfa0b9ca169 100644
--- a/3rdparty/asio/include/asio/deadline_timer.hpp
+++ b/3rdparty/asio/include/asio/deadline_timer.hpp
@@ -2,7 +2,7 @@
// deadline_timer.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/defer.hpp b/3rdparty/asio/include/asio/defer.hpp
index b0829e83848..608debe4d91 100644
--- a/3rdparty/asio/include/asio/defer.hpp
+++ b/3rdparty/asio/include/asio/defer.hpp
@@ -2,7 +2,7 @@
// defer.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,10 +17,13 @@
#include "asio/detail/config.hpp"
#include "asio/async_result.hpp"
+#include "asio/detail/initiate_defer.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution_context.hpp"
+#include "asio/execution/blocking.hpp"
#include "asio/execution/executor.hpp"
#include "asio/is_executor.hpp"
+#include "asio/require.hpp"
#include "asio/detail/push_options.hpp"
@@ -37,27 +40,53 @@ namespace asio {
* may allow the executor to optimise queueing for cases when the function
* object represents a continuation of the current call context.
*
- * This function has the following effects:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler. The function signature of the completion handler must be:
+ * @code void handler(); @endcode
*
- * @li Constructs a function object handler of type @c Handler, initialized
- * with <tt>handler(forward<CompletionToken>(token))</tt>.
+ * @returns This function returns <tt>async_initiate<NullaryToken,
+ * void()>(Init{}, token)</tt>, where @c Init is a function object type defined
+ * as:
*
- * @li Constructs an object @c result of type <tt>async_result<Handler></tt>,
- * initializing the object as <tt>result(handler)</tt>.
+ * @code class Init
+ * {
+ * public:
+ * template <typename CompletionHandler>
+ * void operator()(CompletionHandler&& completion_handler) const;
+ * }; @endcode
*
- * @li Obtains the handler's associated executor object @c ex by performing
- * <tt>get_associated_executor(handler)</tt>.
+ * The function call operator of @c Init:
*
- * @li Obtains the handler's associated allocator object @c alloc by performing
- * <tt>get_associated_allocator(handler)</tt>.
- *
- * @li Performs <tt>ex.defer(std::move(handler), alloc)</tt>.
+ * @li Obtains the handler's associated executor object @c ex of type @c Ex by
+ * performing @code auto ex = get_associated_executor(handler); @endcode
*
- * @li Returns <tt>result.get()</tt>.
+ * @li Obtains the handler's associated allocator object @c alloc by performing
+ * @code auto alloc = get_associated_allocator(handler); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is true, performs
+ * @code prefer(
+ * require(ex, execution::blocking.never),
+ * execution::relationship.continuation,
+ * execution::allocator(alloc)
+ * ).execute(std::forward<CompletionHandler>(completion_handler)); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is false, performs
+ * @code ex.defer(
+ * std::forward<CompletionHandler>(completion_handler),
+ * alloc); @endcode
+ *
+ * @par Completion Signature
+ * @code void() @endcode
*/
-template <ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
- ASIO_MOVE_ARG(CompletionToken) token);
+template <ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken>
+auto defer(NullaryToken&& token)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_defer>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_defer(), token);
+}
/// Submits a completion token or function object for execution.
/**
@@ -70,61 +99,120 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
* may allow the executor to optimise queueing for cases when the function
* object represents a continuation of the current call context.
*
- * This function has the following effects:
+ * @param ex The target executor.
*
- * @li Constructs a function object handler of type @c Handler, initialized
- * with <tt>handler(forward<CompletionToken>(token))</tt>.
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler. The function signature of the completion handler must be:
+ * @code void handler(); @endcode
*
- * @li Constructs an object @c result of type <tt>async_result<Handler></tt>,
- * initializing the object as <tt>result(handler)</tt>.
+ * @returns This function returns <tt>async_initiate<NullaryToken,
+ * void()>(Init{ex}, token)</tt>, where @c Init is a function object type
+ * defined as:
*
- * @li Obtains the handler's associated executor object @c ex1 by performing
- * <tt>get_associated_executor(handler)</tt>.
- *
- * @li Creates a work object @c w by performing <tt>make_work(ex1)</tt>.
- *
- * @li Obtains the handler's associated allocator object @c alloc by performing
- * <tt>get_associated_allocator(handler)</tt>.
+ * @code class Init
+ * {
+ * public:
+ * using executor_type = Executor;
+ * explicit Init(const Executor& ex) : ex_(ex) {}
+ * executor_type get_executor() const noexcept { return ex_; }
+ * template <typename CompletionHandler>
+ * void operator()(CompletionHandler&& completion_handler) const;
+ * private:
+ * Executor ex_; // exposition only
+ * }; @endcode
*
- * @li Constructs a function object @c f with a function call operator that
- * performs <tt>ex1.dispatch(std::move(handler), alloc)</tt> followed by
- * <tt>w.reset()</tt>.
+ * The function call operator of @c Init:
*
- * @li Performs <tt>Executor(ex).defer(std::move(f), alloc)</tt>.
+ * @li Obtains the handler's associated executor object @c ex1 of type @c Ex1 by
+ * performing @code auto ex1 = get_associated_executor(handler, ex); @endcode
*
- * @li Returns <tt>result.get()</tt>.
+ * @li Obtains the handler's associated allocator object @c alloc by performing
+ * @code auto alloc = get_associated_allocator(handler); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex1>::value</tt> is true, constructs a
+ * function object @c f with a member @c executor_ that is initialised with
+ * <tt>prefer(ex1, execution::outstanding_work.tracked)</tt>, a member @c
+ * handler_ that is a decay-copy of @c completion_handler, and a function call
+ * operator that performs:
+ * @code auto a = get_associated_allocator(handler_);
+ * prefer(executor_, execution::allocator(a)).execute(std::move(handler_));
+ * @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex1>::value</tt> is false, constructs a
+ * function object @c f with a member @c work_ that is initialised with
+ * <tt>make_work_guard(ex1)</tt>, a member @c handler_ that is a decay-copy of
+ * @c completion_handler, and a function call operator that performs:
+ * @code auto a = get_associated_allocator(handler_);
+ * work_.get_executor().dispatch(std::move(handler_), a);
+ * work_.reset(); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is true, performs
+ * @code prefer(
+ * require(ex, execution::blocking.never),
+ * execution::relationship.continuation,
+ * execution::allocator(alloc)
+ * ).execute(std::move(f)); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is false, performs
+ * @code ex.defer(std::move(f), alloc); @endcode
+ *
+ * @par Completion Signature
+ * @code void() @endcode
*/
template <typename Executor,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
- const Executor& ex,
- ASIO_MOVE_ARG(CompletionToken) token
- ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<
- execution::is_executor<Executor>::value || is_executor<Executor>::value
- >::type = 0);
+ ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken
+ = default_completion_token_t<Executor>>
+auto defer(const Executor& ex,
+ NullaryToken&& token
+ = default_completion_token_t<Executor>(),
+ constraint_t<
+ (execution::is_executor<Executor>::value
+ && can_require<Executor, execution::blocking_t::never_t>::value)
+ || is_executor<Executor>::value
+ > = 0)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_defer_with_executor<Executor>>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_defer_with_executor<Executor>(ex), token);
+}
/// Submits a completion token or function object for execution.
/**
- * @returns <tt>defer(ctx.get_executor(), forward<CompletionToken>(token))</tt>.
+ * @param ctx An execution context, from which the target executor is obtained.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler. The function signature of the completion handler must be:
+ * @code void handler(); @endcode
+ *
+ * @returns <tt>defer(ctx.get_executor(), forward<NullaryToken>(token))</tt>.
+ *
+ * @par Completion Signature
+ * @code void() @endcode
*/
template <typename ExecutionContext,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename ExecutionContext::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
- ExecutionContext& ctx,
- ASIO_MOVE_ARG(CompletionToken) token
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename ExecutionContext::executor_type),
- typename constraint<is_convertible<
- ExecutionContext&, execution_context&>::value>::type = 0);
+ ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken
+ = default_completion_token_t<typename ExecutionContext::executor_type>>
+auto defer(ExecutionContext& ctx,
+ NullaryToken&& token
+ = default_completion_token_t<typename ExecutionContext::executor_type>(),
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_defer_with_executor<
+ typename ExecutionContext::executor_type>>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_defer_with_executor<
+ typename ExecutionContext::executor_type>(
+ ctx.get_executor()), token);
+}
} // namespace asio
#include "asio/detail/pop_options.hpp"
-#include "asio/impl/defer.hpp"
-
#endif // ASIO_DEFER_HPP
diff --git a/3rdparty/asio/include/asio/deferred.hpp b/3rdparty/asio/include/asio/deferred.hpp
new file mode 100644
index 00000000000..b919f249553
--- /dev/null
+++ b/3rdparty/asio/include/asio/deferred.hpp
@@ -0,0 +1,715 @@
+//
+// deferred.hpp
+// ~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DEFERRED_HPP
+#define ASIO_DEFERRED_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <tuple>
+#include "asio/associator.hpp"
+#include "asio/async_result.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/detail/utility.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// Trait for detecting objects that are usable as deferred operations.
+template <typename T>
+struct is_deferred : false_type
+{
+};
+
+/// Helper type to wrap multiple completion signatures.
+template <typename... Signatures>
+struct deferred_signatures
+{
+};
+
+namespace detail {
+
+// Helper trait for getting the completion signatures of the tail in a sequence
+// when invoked with the specified arguments.
+
+template <typename Tail, typename... Signatures>
+struct deferred_sequence_signatures;
+
+template <typename Tail, typename R, typename... Args, typename... Signatures>
+struct deferred_sequence_signatures<Tail, R(Args...), Signatures...>
+ : completion_signature_of<decltype(declval<Tail>()(declval<Args>()...))>
+{
+ static_assert(
+ !is_same<decltype(declval<Tail>()(declval<Args>()...)), void>::value,
+ "deferred functions must produce a deferred return type");
+};
+
+// Completion handler for the head component of a deferred sequence.
+template <typename Handler, typename Tail>
+class deferred_sequence_handler
+{
+public:
+ template <typename H, typename T>
+ explicit deferred_sequence_handler(H&& handler, T&& tail)
+ : handler_(static_cast<H&&>(handler)),
+ tail_(static_cast<T&&>(tail))
+ {
+ }
+
+ template <typename... Args>
+ void operator()(Args&&... args)
+ {
+ static_cast<Tail&&>(tail_)(
+ static_cast<Args&&>(args)...)(
+ static_cast<Handler&&>(handler_));
+ }
+
+//private:
+ Handler handler_;
+ Tail tail_;
+};
+
+template <typename Head, typename Tail, typename... Signatures>
+class deferred_sequence_base
+{
+private:
+ struct initiate
+ {
+ template <typename Handler>
+ void operator()(Handler&& handler, Head head, Tail&& tail)
+ {
+ static_cast<Head&&>(head)(
+ deferred_sequence_handler<decay_t<Handler>, decay_t<Tail>>(
+ static_cast<Handler&&>(handler), static_cast<Tail&&>(tail)));
+ }
+ };
+
+ Head head_;
+ Tail tail_;
+
+public:
+ template <typename H, typename T>
+ constexpr explicit deferred_sequence_base(H&& head, T&& tail)
+ : head_(static_cast<H&&>(head)),
+ tail_(static_cast<T&&>(tail))
+ {
+ }
+
+ template <ASIO_COMPLETION_TOKEN_FOR(Signatures...) CompletionToken>
+ auto operator()(CompletionToken&& token) &&
+ -> decltype(
+ async_initiate<CompletionToken, Signatures...>(
+ initiate(), token, static_cast<Head&&>(this->head_),
+ static_cast<Tail&&>(this->tail_)))
+ {
+ return async_initiate<CompletionToken, Signatures...>(initiate(),
+ token, static_cast<Head&&>(head_), static_cast<Tail&&>(tail_));
+ }
+
+ template <ASIO_COMPLETION_TOKEN_FOR(Signatures...) CompletionToken>
+ auto operator()(CompletionToken&& token) const &
+ -> decltype(
+ async_initiate<CompletionToken, Signatures...>(
+ initiate(), token, this->head_, this->tail_))
+ {
+ return async_initiate<CompletionToken, Signatures...>(
+ initiate(), token, head_, tail_);
+ }
+};
+
+// Two-step application of variadic Signatures to determine correct base type.
+
+template <typename Head, typename Tail>
+struct deferred_sequence_types
+{
+ template <typename... Signatures>
+ struct op1
+ {
+ typedef deferred_sequence_base<Head, Tail, Signatures...> type;
+ };
+
+ template <typename... Signatures>
+ struct op2
+ {
+ typedef typename deferred_sequence_signatures<Tail, Signatures...>::template
+ apply<op1>::type::type type;
+ };
+
+ typedef typename completion_signature_of<Head>::template
+ apply<op2>::type::type base;
+};
+
+} // namespace detail
+
+/// Used to represent an empty deferred action.
+struct deferred_noop
+{
+ /// No effect.
+ template <typename... Args>
+ void operator()(Args&&...) &&
+ {
+ }
+
+ /// No effect.
+ template <typename... Args>
+ void operator()(Args&&...) const &
+ {
+ }
+};
+
+#if !defined(GENERATING_DOCUMENTATION)
+template <>
+struct is_deferred<deferred_noop> : true_type
+{
+};
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+/// Tag type to disambiguate deferred constructors.
+struct deferred_init_tag {};
+
+/// Wraps a function object so that it may be used as an element in a deferred
+/// composition.
+template <typename Function>
+class deferred_function
+{
+public:
+ /// Constructor.
+ template <typename F>
+ constexpr explicit deferred_function(deferred_init_tag, F&& function)
+ : function_(static_cast<F&&>(function))
+ {
+ }
+
+//private:
+ Function function_;
+
+public:
+ template <typename... Args>
+ auto operator()(Args&&... args) &&
+ -> decltype(
+ static_cast<Function&&>(this->function_)(static_cast<Args&&>(args)...))
+ {
+ return static_cast<Function&&>(function_)(static_cast<Args&&>(args)...);
+ }
+
+ template <typename... Args>
+ auto operator()(Args&&... args) const &
+ -> decltype(Function(function_)(static_cast<Args&&>(args)...))
+ {
+ return Function(function_)(static_cast<Args&&>(args)...);
+ }
+};
+
+#if !defined(GENERATING_DOCUMENTATION)
+template <typename Function>
+struct is_deferred<deferred_function<Function>> : true_type
+{
+};
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+/// Encapsulates deferred values.
+template <typename... Values>
+class ASIO_NODISCARD deferred_values
+{
+private:
+ std::tuple<Values...> values_;
+
+ struct initiate
+ {
+ template <typename Handler, typename... V>
+ void operator()(Handler handler, V&&... values)
+ {
+ static_cast<Handler&&>(handler)(static_cast<V&&>(values)...);
+ }
+ };
+
+ template <typename CompletionToken, std::size_t... I>
+ auto invoke_helper(CompletionToken&& token, detail::index_sequence<I...>)
+ -> decltype(
+ async_initiate<CompletionToken, void(Values...)>(initiate(), token,
+ std::get<I>(static_cast<std::tuple<Values...>&&>(this->values_))...))
+ {
+ return async_initiate<CompletionToken, void(Values...)>(initiate(), token,
+ std::get<I>(static_cast<std::tuple<Values...>&&>(values_))...);
+ }
+
+ template <typename CompletionToken, std::size_t... I>
+ auto const_invoke_helper(CompletionToken&& token,
+ detail::index_sequence<I...>)
+ -> decltype(
+ async_initiate<CompletionToken, void(Values...)>(
+ initiate(), token, std::get<I>(values_)...))
+ {
+ return async_initiate<CompletionToken, void(Values...)>(
+ initiate(), token, std::get<I>(values_)...);
+ }
+
+public:
+ /// Construct a deferred asynchronous operation from the arguments to an
+ /// initiation function object.
+ template <typename... V>
+ constexpr explicit deferred_values(
+ deferred_init_tag, V&&... values)
+ : values_(static_cast<V&&>(values)...)
+ {
+ }
+
+ /// Initiate the deferred operation using the supplied completion token.
+ template <ASIO_COMPLETION_TOKEN_FOR(void(Values...)) CompletionToken>
+ auto operator()(CompletionToken&& token) &&
+ -> decltype(
+ this->invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<Values...>()))
+ {
+ return this->invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<Values...>());
+ }
+
+ template <ASIO_COMPLETION_TOKEN_FOR(void(Values...)) CompletionToken>
+ auto operator()(CompletionToken&& token) const &
+ -> decltype(
+ this->const_invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<Values...>()))
+ {
+ return this->const_invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<Values...>());
+ }
+};
+
+#if !defined(GENERATING_DOCUMENTATION)
+template <typename... Values>
+struct is_deferred<deferred_values<Values...>> : true_type
+{
+};
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+/// Encapsulates a deferred asynchronous operation.
+template <typename Signature, typename Initiation, typename... InitArgs>
+class ASIO_NODISCARD deferred_async_operation
+{
+private:
+ typedef decay_t<Initiation> initiation_t;
+ initiation_t initiation_;
+ typedef std::tuple<decay_t<InitArgs>...> init_args_t;
+ init_args_t init_args_;
+
+ template <typename CompletionToken, std::size_t... I>
+ auto invoke_helper(CompletionToken&& token, detail::index_sequence<I...>)
+ -> decltype(
+ async_initiate<CompletionToken, Signature>(
+ static_cast<initiation_t&&>(initiation_), token,
+ std::get<I>(static_cast<init_args_t&&>(init_args_))...))
+ {
+ return async_initiate<CompletionToken, Signature>(
+ static_cast<initiation_t&&>(initiation_), token,
+ std::get<I>(static_cast<init_args_t&&>(init_args_))...);
+ }
+
+ template <typename CompletionToken, std::size_t... I>
+ auto const_invoke_helper(CompletionToken&& token,
+ detail::index_sequence<I...>) const &
+ -> decltype(
+ async_initiate<CompletionToken, Signature>(
+ initiation_t(initiation_), token, std::get<I>(init_args_)...))
+ {
+ return async_initiate<CompletionToken, Signature>(
+ initiation_t(initiation_), token, std::get<I>(init_args_)...);
+ }
+
+public:
+ /// Construct a deferred asynchronous operation from the arguments to an
+ /// initiation function object.
+ template <typename I, typename... A>
+ constexpr explicit deferred_async_operation(
+ deferred_init_tag, I&& initiation, A&&... init_args)
+ : initiation_(static_cast<I&&>(initiation)),
+ init_args_(static_cast<A&&>(init_args)...)
+ {
+ }
+
+ /// Initiate the asynchronous operation using the supplied completion token.
+ template <ASIO_COMPLETION_TOKEN_FOR(Signature) CompletionToken>
+ auto operator()(CompletionToken&& token) &&
+ -> decltype(
+ this->invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<InitArgs...>()))
+ {
+ return this->invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<InitArgs...>());
+ }
+
+ template <ASIO_COMPLETION_TOKEN_FOR(Signature) CompletionToken>
+ auto operator()(CompletionToken&& token) const &
+ -> decltype(
+ this->const_invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<InitArgs...>()))
+ {
+ return this->const_invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<InitArgs...>());
+ }
+};
+
+/// Encapsulates a deferred asynchronous operation thas has multiple completion
+/// signatures.
+template <typename... Signatures, typename Initiation, typename... InitArgs>
+class ASIO_NODISCARD deferred_async_operation<
+ deferred_signatures<Signatures...>, Initiation, InitArgs...>
+{
+private:
+ typedef decay_t<Initiation> initiation_t;
+ initiation_t initiation_;
+ typedef std::tuple<decay_t<InitArgs>...> init_args_t;
+ init_args_t init_args_;
+
+ template <typename CompletionToken, std::size_t... I>
+ auto invoke_helper(CompletionToken&& token, detail::index_sequence<I...>)
+ -> decltype(
+ async_initiate<CompletionToken, Signatures...>(
+ static_cast<initiation_t&&>(initiation_), token,
+ std::get<I>(static_cast<init_args_t&&>(init_args_))...))
+ {
+ return async_initiate<CompletionToken, Signatures...>(
+ static_cast<initiation_t&&>(initiation_), token,
+ std::get<I>(static_cast<init_args_t&&>(init_args_))...);
+ }
+
+ template <typename CompletionToken, std::size_t... I>
+ auto const_invoke_helper(CompletionToken&& token,
+ detail::index_sequence<I...>) const &
+ -> decltype(
+ async_initiate<CompletionToken, Signatures...>(
+ initiation_t(initiation_), token, std::get<I>(init_args_)...))
+ {
+ return async_initiate<CompletionToken, Signatures...>(
+ initiation_t(initiation_), token, std::get<I>(init_args_)...);
+ }
+
+public:
+ /// Construct a deferred asynchronous operation from the arguments to an
+ /// initiation function object.
+ template <typename I, typename... A>
+ constexpr explicit deferred_async_operation(
+ deferred_init_tag, I&& initiation, A&&... init_args)
+ : initiation_(static_cast<I&&>(initiation)),
+ init_args_(static_cast<A&&>(init_args)...)
+ {
+ }
+
+ /// Initiate the asynchronous operation using the supplied completion token.
+ template <ASIO_COMPLETION_TOKEN_FOR(Signatures...) CompletionToken>
+ auto operator()(CompletionToken&& token) &&
+ -> decltype(
+ this->invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<InitArgs...>()))
+ {
+ return this->invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<InitArgs...>());
+ }
+
+ template <ASIO_COMPLETION_TOKEN_FOR(Signatures...) CompletionToken>
+ auto operator()(CompletionToken&& token) const &
+ -> decltype(
+ this->const_invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<InitArgs...>()))
+ {
+ return this->const_invoke_helper(
+ static_cast<CompletionToken&&>(token),
+ detail::index_sequence_for<InitArgs...>());
+ }
+};
+
+#if !defined(GENERATING_DOCUMENTATION)
+template <typename Signature, typename Initiation, typename... InitArgs>
+struct is_deferred<
+ deferred_async_operation<Signature, Initiation, InitArgs...>> : true_type
+{
+};
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+/// Defines a link between two consecutive operations in a sequence.
+template <typename Head, typename Tail>
+class ASIO_NODISCARD deferred_sequence :
+ public detail::deferred_sequence_types<Head, Tail>::base
+{
+public:
+ template <typename H, typename T>
+ constexpr explicit deferred_sequence(deferred_init_tag, H&& head, T&& tail)
+ : detail::deferred_sequence_types<Head, Tail>::base(
+ static_cast<H&&>(head), static_cast<T&&>(tail))
+ {
+ }
+
+#if defined(GENERATING_DOCUMENTATION)
+ template <typename CompletionToken>
+ auto operator()(CompletionToken&& token) &&;
+
+ template <typename CompletionToken>
+ auto operator()(CompletionToken&& token) const &;
+#endif // defined(GENERATING_DOCUMENTATION)
+};
+
+#if !defined(GENERATING_DOCUMENTATION)
+template <typename Head, typename Tail>
+struct is_deferred<deferred_sequence<Head, Tail>> : true_type
+{
+};
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+/// Used to represent a deferred conditional branch.
+template <typename OnTrue = deferred_noop, typename OnFalse = deferred_noop>
+class ASIO_NODISCARD deferred_conditional
+{
+private:
+ template <typename T, typename F> friend class deferred_conditional;
+
+ // Helper constructor.
+ template <typename T, typename F>
+ explicit deferred_conditional(bool b, T&& on_true, F&& on_false)
+ : on_true_(static_cast<T&&>(on_true)),
+ on_false_(static_cast<F&&>(on_false)),
+ bool_(b)
+ {
+ }
+
+ OnTrue on_true_;
+ OnFalse on_false_;
+ bool bool_;
+
+public:
+ /// Construct a deferred conditional with the value to determine which branch
+ /// will be executed.
+ constexpr explicit deferred_conditional(bool b)
+ : on_true_(),
+ on_false_(),
+ bool_(b)
+ {
+ }
+
+ /// Invoke the conditional branch bsaed on the stored value.
+ template <typename... Args>
+ auto operator()(Args&&... args) &&
+ -> decltype(static_cast<OnTrue&&>(on_true_)(static_cast<Args&&>(args)...))
+ {
+ if (bool_)
+ {
+ return static_cast<OnTrue&&>(on_true_)(static_cast<Args&&>(args)...);
+ }
+ else
+ {
+ return static_cast<OnFalse&&>(on_false_)(static_cast<Args&&>(args)...);
+ }
+ }
+
+ template <typename... Args>
+ auto operator()(Args&&... args) const &
+ -> decltype(on_true_(static_cast<Args&&>(args)...))
+ {
+ if (bool_)
+ {
+ return on_true_(static_cast<Args&&>(args)...);
+ }
+ else
+ {
+ return on_false_(static_cast<Args&&>(args)...);
+ }
+ }
+
+ /// Set the true branch of the conditional.
+ template <typename T>
+ deferred_conditional<T, OnFalse> then(T on_true,
+ constraint_t<
+ is_deferred<T>::value
+ >* = 0,
+ constraint_t<
+ is_same<
+ conditional_t<true, OnTrue, T>,
+ deferred_noop
+ >::value
+ >* = 0) &&
+ {
+ return deferred_conditional<T, OnFalse>(
+ bool_, static_cast<T&&>(on_true),
+ static_cast<OnFalse&&>(on_false_));
+ }
+
+ /// Set the false branch of the conditional.
+ template <typename T>
+ deferred_conditional<OnTrue, T> otherwise(T on_false,
+ constraint_t<
+ is_deferred<T>::value
+ >* = 0,
+ constraint_t<
+ !is_same<
+ conditional_t<true, OnTrue, T>,
+ deferred_noop
+ >::value
+ >* = 0,
+ constraint_t<
+ is_same<
+ conditional_t<true, OnFalse, T>,
+ deferred_noop
+ >::value
+ >* = 0) &&
+ {
+ return deferred_conditional<OnTrue, T>(
+ bool_, static_cast<OnTrue&&>(on_true_),
+ static_cast<T&&>(on_false));
+ }
+};
+
+#if !defined(GENERATING_DOCUMENTATION)
+template <typename OnTrue, typename OnFalse>
+struct is_deferred<deferred_conditional<OnTrue, OnFalse>> : true_type
+{
+};
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+/// Class used to specify that an asynchronous operation should return a
+/// function object to lazily launch the operation.
+/**
+ * The deferred_t class is used to indicate that an asynchronous operation
+ * should return a function object which is itself an initiation function. A
+ * deferred_t object may be passed as a completion token to an asynchronous
+ * operation, typically using the special value @c asio::deferred. For
+ * example:
+ *
+ * @code auto my_deferred_op
+ * = my_socket.async_read_some(my_buffer,
+ * asio::deferred); @endcode
+ *
+ * The initiating function (async_read_some in the above example) returns a
+ * function object that will lazily initiate the operation.
+ */
+class deferred_t
+{
+public:
+ /// Default constructor.
+ constexpr deferred_t()
+ {
+ }
+
+ /// Adapts an executor to add the @c deferred_t completion token as the
+ /// default.
+ template <typename InnerExecutor>
+ struct executor_with_default : InnerExecutor
+ {
+ /// Specify @c deferred_t as the default completion token type.
+ typedef deferred_t default_completion_token_type;
+
+ /// Construct the adapted executor from the inner executor type.
+ template <typename InnerExecutor1>
+ executor_with_default(const InnerExecutor1& ex,
+ constraint_t<
+ conditional_t<
+ !is_same<InnerExecutor1, executor_with_default>::value,
+ is_convertible<InnerExecutor1, InnerExecutor>,
+ false_type
+ >::value
+ > = 0) noexcept
+ : InnerExecutor(ex)
+ {
+ }
+ };
+
+ /// Type alias to adapt an I/O object to use @c deferred_t as its
+ /// default completion token type.
+ template <typename T>
+ using as_default_on_t = typename T::template rebind_executor<
+ executor_with_default<typename T::executor_type>>::other;
+
+ /// Function helper to adapt an I/O object to use @c deferred_t as its
+ /// default completion token type.
+ template <typename T>
+ static typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other
+ as_default_on(T&& object)
+ {
+ return typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other(static_cast<T&&>(object));
+ }
+
+ /// Creates a new deferred from a function.
+ template <typename Function>
+ constraint_t<
+ !is_deferred<decay_t<Function>>::value,
+ deferred_function<decay_t<Function>>
+ > operator()(Function&& function) const
+ {
+ return deferred_function<decay_t<Function>>(
+ deferred_init_tag{}, static_cast<Function&&>(function));
+ }
+
+ /// Passes through anything that is already deferred.
+ template <typename T>
+ constraint_t<
+ is_deferred<decay_t<T>>::value,
+ decay_t<T>
+ > operator()(T&& t) const
+ {
+ return static_cast<T&&>(t);
+ }
+
+ /// Returns a deferred operation that returns the provided values.
+ template <typename... Args>
+ static constexpr deferred_values<decay_t<Args>...> values(Args&&... args)
+ {
+ return deferred_values<decay_t<Args>...>(
+ deferred_init_tag{}, static_cast<Args&&>(args)...);
+ }
+
+ /// Creates a conditional object for branching deferred operations.
+ static constexpr deferred_conditional<> when(bool b)
+ {
+ return deferred_conditional<>(b);
+ }
+};
+
+/// Pipe operator used to chain deferred operations.
+template <typename Head, typename Tail>
+inline auto operator|(Head head, Tail&& tail)
+ -> constraint_t<
+ is_deferred<Head>::value,
+ decltype(static_cast<Head&&>(head)(static_cast<Tail&&>(tail)))
+ >
+{
+ return static_cast<Head&&>(head)(static_cast<Tail&&>(tail));
+}
+
+/// A @ref completion_token object used to specify that an asynchronous
+/// operation should return a function object to lazily launch the operation.
+/**
+ * See the documentation for asio::deferred_t for a usage example.
+ */
+constexpr deferred_t deferred;
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/impl/deferred.hpp"
+
+#endif // ASIO_DEFERRED_HPP
diff --git a/3rdparty/asio/include/asio/detached.hpp b/3rdparty/asio/include/asio/detached.hpp
index e99875e36d7..b71bd9d978b 100644
--- a/3rdparty/asio/include/asio/detached.hpp
+++ b/3rdparty/asio/include/asio/detached.hpp
@@ -2,7 +2,7 @@
// detached.hpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,15 +23,15 @@
namespace asio {
-/// Class used to specify that an asynchronous operation is detached.
+/// A @ref completion_token type used to specify that an asynchronous operation
+/// is detached.
/**
-
* The detached_t class is used to indicate that an asynchronous operation is
* detached. That is, there is no completion handler waiting for the
* operation's result. A detached_t object may be passed as a handler to an
* asynchronous operation, typically using the special value
* @c asio::detached. For example:
-
+ *
* @code my_socket.async_send(my_buffer, asio::detached);
* @endcode
*/
@@ -39,7 +39,7 @@ class detached_t
{
public:
/// Constructor.
- ASIO_CONSTEXPR detached_t()
+ constexpr detached_t()
{
}
@@ -52,7 +52,7 @@ public:
typedef detached_t default_completion_token_type;
/// Construct the adapted executor from the inner executor type.
- executor_with_default(const InnerExecutor& ex) ASIO_NOEXCEPT
+ executor_with_default(const InnerExecutor& ex) noexcept
: InnerExecutor(ex)
{
}
@@ -61,9 +61,9 @@ public:
/// that to construct the adapted executor.
template <typename OtherExecutor>
executor_with_default(const OtherExecutor& ex,
- typename constraint<
+ constraint_t<
is_convertible<OtherExecutor, InnerExecutor>::value
- >::type = 0) ASIO_NOEXCEPT
+ > = 0) noexcept
: InnerExecutor(ex)
{
}
@@ -71,37 +71,30 @@ public:
/// Type alias to adapt an I/O object to use @c detached_t as its
/// default completion token type.
-#if defined(ASIO_HAS_ALIAS_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
template <typename T>
using as_default_on_t = typename T::template rebind_executor<
- executor_with_default<typename T::executor_type> >::other;
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
+ executor_with_default<typename T::executor_type>>::other;
/// Function helper to adapt an I/O object to use @c detached_t as its
/// default completion token type.
template <typename T>
- static typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
+ static typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
>::other
- as_default_on(ASIO_MOVE_ARG(T) object)
+ as_default_on(T&& object)
{
- return typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
- >::other(ASIO_MOVE_CAST(T)(object));
+ return typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other(static_cast<T&&>(object));
}
};
-/// A special value, similar to std::nothrow.
+/// A @ref completion_token object used to specify that an asynchronous
+/// operation is detached.
/**
* See the documentation for asio::detached_t for a usage example.
*/
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr detached_t detached;
-#elif defined(ASIO_MSVC)
-__declspec(selectany) detached_t detached;
-#endif
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/array.hpp b/3rdparty/asio/include/asio/detail/array.hpp
index ef230c321ca..f2015c7919b 100644
--- a/3rdparty/asio/include/asio/detail/array.hpp
+++ b/3rdparty/asio/include/asio/detail/array.hpp
@@ -2,7 +2,7 @@
// detail/array.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,20 +17,12 @@
#include "asio/detail/config.hpp"
-#if defined(ASIO_HAS_STD_ARRAY)
-# include <array>
-#else // defined(ASIO_HAS_STD_ARRAY)
-# include <boost/array.hpp>
-#endif // defined(ASIO_HAS_STD_ARRAY)
+#include <array>
namespace asio {
namespace detail {
-#if defined(ASIO_HAS_STD_ARRAY)
using std::array;
-#else // defined(ASIO_HAS_STD_ARRAY)
-using boost::array;
-#endif // defined(ASIO_HAS_STD_ARRAY)
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/array_fwd.hpp b/3rdparty/asio/include/asio/detail/array_fwd.hpp
index fb81dba5ce2..79491348a69 100644
--- a/3rdparty/asio/include/asio/detail/array_fwd.hpp
+++ b/3rdparty/asio/include/asio/detail/array_fwd.hpp
@@ -2,7 +2,7 @@
// detail/array_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -27,8 +27,6 @@ class array;
// Standard library components can't be forward declared, so we'll have to
// include the array header. Fortunately, it's fairly lightweight and doesn't
// add significantly to the compile time.
-#if defined(ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(ASIO_HAS_STD_ARRAY)
+#include <array>
#endif // ASIO_DETAIL_ARRAY_FWD_HPP
diff --git a/3rdparty/asio/include/asio/detail/assert.hpp b/3rdparty/asio/include/asio/detail/assert.hpp
index 8eaf59530bc..b53774d9aff 100644
--- a/3rdparty/asio/include/asio/detail/assert.hpp
+++ b/3rdparty/asio/include/asio/detail/assert.hpp
@@ -2,7 +2,7 @@
// detail/assert.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/atomic_count.hpp b/3rdparty/asio/include/asio/detail/atomic_count.hpp
index 8409298a9af..6116279c89e 100644
--- a/3rdparty/asio/include/asio/detail/atomic_count.hpp
+++ b/3rdparty/asio/include/asio/detail/atomic_count.hpp
@@ -2,7 +2,7 @@
// detail/atomic_count.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,11 +19,9 @@
#if !defined(ASIO_HAS_THREADS)
// Nothing to include.
-#elif defined(ASIO_HAS_STD_ATOMIC)
+#else // !defined(ASIO_HAS_THREADS)
# include <atomic>
-#else // defined(ASIO_HAS_STD_ATOMIC)
-# include <boost/detail/atomic_count.hpp>
-#endif // defined(ASIO_HAS_STD_ATOMIC)
+#endif // !defined(ASIO_HAS_THREADS)
namespace asio {
namespace detail {
@@ -31,11 +29,13 @@ namespace detail {
#if !defined(ASIO_HAS_THREADS)
typedef long atomic_count;
inline void increment(atomic_count& a, long b) { a += b; }
+inline void decrement(atomic_count& a, long b) { a -= b; }
inline void ref_count_up(atomic_count& a) { ++a; }
inline bool ref_count_down(atomic_count& a) { return --a == 0; }
-#elif defined(ASIO_HAS_STD_ATOMIC)
+#else // !defined(ASIO_HAS_THREADS)
typedef std::atomic<long> atomic_count;
inline void increment(atomic_count& a, long b) { a += b; }
+inline void decrement(atomic_count& a, long b) { a -= b; }
inline void ref_count_up(atomic_count& a)
{
@@ -51,12 +51,7 @@ inline bool ref_count_down(atomic_count& a)
}
return false;
}
-#else // defined(ASIO_HAS_STD_ATOMIC)
-typedef boost::detail::atomic_count atomic_count;
-inline void increment(atomic_count& a, long b) { while (b > 0) ++a, --b; }
-inline void ref_count_up(atomic_count& a) { ++a; }
-inline bool ref_count_down(atomic_count& a) { return --a == 0; }
-#endif // defined(ASIO_HAS_STD_ATOMIC)
+#endif // !defined(ASIO_HAS_THREADS)
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/base_from_cancellation_state.hpp b/3rdparty/asio/include/asio/detail/base_from_cancellation_state.hpp
index ae8db1764b1..3ce7dcf0b7f 100644
--- a/3rdparty/asio/include/asio/detail/base_from_cancellation_state.hpp
+++ b/3rdparty/asio/include/asio/detail/base_from_cancellation_state.hpp
@@ -2,7 +2,7 @@
// detail/base_from_cancellation_state.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -31,12 +31,12 @@ class base_from_cancellation_state
public:
typedef cancellation_slot cancellation_slot_type;
- cancellation_slot_type get_cancellation_slot() const ASIO_NOEXCEPT
+ cancellation_slot_type get_cancellation_slot() const noexcept
{
return cancellation_state_.slot();
}
- cancellation_state get_cancellation_state() const ASIO_NOEXCEPT
+ cancellation_state get_cancellation_state() const noexcept
{
return cancellation_state_;
}
@@ -57,12 +57,12 @@ protected:
template <typename InFilter, typename OutFilter>
base_from_cancellation_state(const Handler& handler,
- ASIO_MOVE_ARG(InFilter) in_filter,
- ASIO_MOVE_ARG(OutFilter) out_filter)
+ InFilter&& in_filter,
+ OutFilter&& out_filter)
: cancellation_state_(
asio::get_associated_cancellation_slot(handler),
- ASIO_MOVE_CAST(InFilter)(in_filter),
- ASIO_MOVE_CAST(OutFilter)(out_filter))
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter))
{
}
@@ -81,16 +81,16 @@ protected:
template <typename InFilter, typename OutFilter>
void reset_cancellation_state(const Handler& handler,
- ASIO_MOVE_ARG(InFilter) in_filter,
- ASIO_MOVE_ARG(OutFilter) out_filter)
+ InFilter&& in_filter,
+ OutFilter&& out_filter)
{
cancellation_state_ = cancellation_state(
asio::get_associated_cancellation_slot(handler),
- ASIO_MOVE_CAST(InFilter)(in_filter),
- ASIO_MOVE_CAST(OutFilter)(out_filter));
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter));
}
- cancellation_type_t cancelled() const ASIO_NOEXCEPT
+ cancellation_type_t cancelled() const noexcept
{
return cancellation_state_.cancelled();
}
@@ -101,17 +101,18 @@ private:
template <typename Handler>
class base_from_cancellation_state<Handler,
- typename enable_if<
+ enable_if_t<
is_same<
typename associated_cancellation_slot<
Handler, cancellation_slot
>::asio_associated_cancellation_slot_is_unspecialised,
void
>::value
- >::type>
+ >
+ >
{
public:
- cancellation_state get_cancellation_state() const ASIO_NOEXCEPT
+ cancellation_state get_cancellation_state() const noexcept
{
return cancellation_state();
}
@@ -128,8 +129,8 @@ protected:
template <typename InFilter, typename OutFilter>
base_from_cancellation_state(const Handler&,
- ASIO_MOVE_ARG(InFilter),
- ASIO_MOVE_ARG(OutFilter))
+ InFilter&&,
+ OutFilter&&)
{
}
@@ -144,12 +145,12 @@ protected:
template <typename InFilter, typename OutFilter>
void reset_cancellation_state(const Handler&,
- ASIO_MOVE_ARG(InFilter),
- ASIO_MOVE_ARG(OutFilter))
+ InFilter&&,
+ OutFilter&&)
{
}
- ASIO_CONSTEXPR cancellation_type_t cancelled() const ASIO_NOEXCEPT
+ constexpr cancellation_type_t cancelled() const noexcept
{
return cancellation_type::none;
}
diff --git a/3rdparty/asio/include/asio/detail/base_from_completion_cond.hpp b/3rdparty/asio/include/asio/detail/base_from_completion_cond.hpp
index 0139d261237..ba0cc879602 100644
--- a/3rdparty/asio/include/asio/detail/base_from_completion_cond.hpp
+++ b/3rdparty/asio/include/asio/detail/base_from_completion_cond.hpp
@@ -2,7 +2,7 @@
// detail/base_from_completion_cond.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -29,7 +29,7 @@ class base_from_completion_cond
protected:
explicit base_from_completion_cond(CompletionCondition& completion_condition)
: completion_condition_(
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition))
+ static_cast<CompletionCondition&&>(completion_condition))
{
}
diff --git a/3rdparty/asio/include/asio/detail/bind_handler.hpp b/3rdparty/asio/include/asio/detail/bind_handler.hpp
index 40f30f14ff4..3c16b13a458 100644
--- a/3rdparty/asio/include/asio/detail/bind_handler.hpp
+++ b/3rdparty/asio/include/asio/detail/bind_handler.hpp
@@ -2,7 +2,7 @@
// detail/bind_handler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,9 +17,7 @@
#include "asio/detail/config.hpp"
#include "asio/associator.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/detail/push_options.hpp"
@@ -32,31 +30,29 @@ class binder0
{
public:
template <typename T>
- binder0(int, ASIO_MOVE_ARG(T) handler)
- : handler_(ASIO_MOVE_CAST(T)(handler))
+ binder0(int, T&& handler)
+ : handler_(static_cast<T&&>(handler))
{
}
binder0(Handler& handler)
- : handler_(ASIO_MOVE_CAST(Handler)(handler))
+ : handler_(static_cast<Handler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
binder0(const binder0& other)
: handler_(other.handler_)
{
}
binder0(binder0&& other)
- : handler_(ASIO_MOVE_CAST(Handler)(other.handler_))
+ : handler_(static_cast<Handler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)();
+ static_cast<Handler&&>(handler_)();
}
void operator()() const
@@ -69,32 +65,6 @@ public:
};
template <typename Handler>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- binder0<Handler>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- binder0<Handler>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
inline bool asio_handler_is_continuation(
binder0<Handler>* this_handler)
{
@@ -102,36 +72,12 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- binder0<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- binder0<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Handler>
-inline binder0<typename decay<Handler>::type> bind_handler(
- ASIO_MOVE_ARG(Handler) handler)
+inline binder0<decay_t<Handler>> bind_handler(
+ Handler&& handler)
{
- return binder0<typename decay<Handler>::type>(
- 0, ASIO_MOVE_CAST(Handler)(handler));
+ return binder0<decay_t<Handler>>(
+ 0, static_cast<Handler&&>(handler));
}
template <typename Handler, typename Arg1>
@@ -139,19 +85,18 @@ class binder1
{
public:
template <typename T>
- binder1(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1)
- : handler_(ASIO_MOVE_CAST(T)(handler)),
+ binder1(int, T&& handler, const Arg1& arg1)
+ : handler_(static_cast<T&&>(handler)),
arg1_(arg1)
{
}
binder1(Handler& handler, const Arg1& arg1)
- : handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ : handler_(static_cast<Handler&&>(handler)),
arg1_(arg1)
{
}
-#if defined(ASIO_HAS_MOVE)
binder1(const binder1& other)
: handler_(other.handler_),
arg1_(other.arg1_)
@@ -159,15 +104,14 @@ public:
}
binder1(binder1&& other)
- : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
- arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_))
+ : handler_(static_cast<Handler&&>(other.handler_)),
+ arg1_(static_cast<Arg1&&>(other.arg1_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
+ static_cast<Handler&&>(handler_)(
static_cast<const Arg1&>(arg1_));
}
@@ -182,32 +126,6 @@ public:
};
template <typename Handler, typename Arg1>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- binder1<Handler, Arg1>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- binder1<Handler, Arg1>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1>
inline bool asio_handler_is_continuation(
binder1<Handler, Arg1>* this_handler)
{
@@ -215,36 +133,12 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler, typename Arg1>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- binder1<Handler, Arg1>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler, typename Arg1>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- binder1<Handler, Arg1>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Handler, typename Arg1>
-inline binder1<typename decay<Handler>::type, Arg1> bind_handler(
- ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1)
+inline binder1<decay_t<Handler>, Arg1> bind_handler(
+ Handler&& handler, const Arg1& arg1)
{
- return binder1<typename decay<Handler>::type, Arg1>(0,
- ASIO_MOVE_CAST(Handler)(handler), arg1);
+ return binder1<decay_t<Handler>, Arg1>(0,
+ static_cast<Handler&&>(handler), arg1);
}
template <typename Handler, typename Arg1, typename Arg2>
@@ -252,22 +146,21 @@ class binder2
{
public:
template <typename T>
- binder2(int, ASIO_MOVE_ARG(T) handler,
+ binder2(int, T&& handler,
const Arg1& arg1, const Arg2& arg2)
- : handler_(ASIO_MOVE_CAST(T)(handler)),
+ : handler_(static_cast<T&&>(handler)),
arg1_(arg1),
arg2_(arg2)
{
}
binder2(Handler& handler, const Arg1& arg1, const Arg2& arg2)
- : handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ : handler_(static_cast<Handler&&>(handler)),
arg1_(arg1),
arg2_(arg2)
{
}
-#if defined(ASIO_HAS_MOVE)
binder2(const binder2& other)
: handler_(other.handler_),
arg1_(other.arg1_),
@@ -276,16 +169,15 @@ public:
}
binder2(binder2&& other)
- : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
- arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)),
- arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_))
+ : handler_(static_cast<Handler&&>(other.handler_)),
+ arg1_(static_cast<Arg1&&>(other.arg1_)),
+ arg2_(static_cast<Arg2&&>(other.arg2_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
+ static_cast<Handler&&>(handler_)(
static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_));
}
@@ -302,32 +194,6 @@ public:
};
template <typename Handler, typename Arg1, typename Arg2>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- binder2<Handler, Arg1, Arg2>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1, typename Arg2>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- binder2<Handler, Arg1, Arg2>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1, typename Arg2>
inline bool asio_handler_is_continuation(
binder2<Handler, Arg1, Arg2>* this_handler)
{
@@ -335,36 +201,12 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler, typename Arg1, typename Arg2>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- binder2<Handler, Arg1, Arg2>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler, typename Arg1, typename Arg2>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- binder2<Handler, Arg1, Arg2>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Handler, typename Arg1, typename Arg2>
-inline binder2<typename decay<Handler>::type, Arg1, Arg2> bind_handler(
- ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, const Arg2& arg2)
+inline binder2<decay_t<Handler>, Arg1, Arg2> bind_handler(
+ Handler&& handler, const Arg1& arg1, const Arg2& arg2)
{
- return binder2<typename decay<Handler>::type, Arg1, Arg2>(0,
- ASIO_MOVE_CAST(Handler)(handler), arg1, arg2);
+ return binder2<decay_t<Handler>, Arg1, Arg2>(0,
+ static_cast<Handler&&>(handler), arg1, arg2);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
@@ -372,9 +214,9 @@ class binder3
{
public:
template <typename T>
- binder3(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1,
+ binder3(int, T&& handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3)
- : handler_(ASIO_MOVE_CAST(T)(handler)),
+ : handler_(static_cast<T&&>(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3)
@@ -383,14 +225,13 @@ public:
binder3(Handler& handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3)
- : handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ : handler_(static_cast<Handler&&>(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3)
{
}
-#if defined(ASIO_HAS_MOVE)
binder3(const binder3& other)
: handler_(other.handler_),
arg1_(other.arg1_),
@@ -400,17 +241,16 @@ public:
}
binder3(binder3&& other)
- : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
- arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)),
- arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)),
- arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_))
+ : handler_(static_cast<Handler&&>(other.handler_)),
+ arg1_(static_cast<Arg1&&>(other.arg1_)),
+ arg2_(static_cast<Arg2&&>(other.arg2_)),
+ arg3_(static_cast<Arg3&&>(other.arg3_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
+ static_cast<Handler&&>(handler_)(
static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_),
static_cast<const Arg3&>(arg3_));
@@ -429,32 +269,6 @@ public:
};
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
inline bool asio_handler_is_continuation(
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
@@ -462,39 +276,13 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler,
- typename Arg1, typename Arg2, typename Arg3>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler,
- typename Arg1, typename Arg2, typename Arg3>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
-inline binder3<typename decay<Handler>::type, Arg1, Arg2, Arg3> bind_handler(
- ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, const Arg2& arg2,
+inline binder3<decay_t<Handler>, Arg1, Arg2, Arg3> bind_handler(
+ Handler&& handler, const Arg1& arg1, const Arg2& arg2,
const Arg3& arg3)
{
- return binder3<typename decay<Handler>::type, Arg1, Arg2, Arg3>(0,
- ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3);
+ return binder3<decay_t<Handler>, Arg1, Arg2, Arg3>(0,
+ static_cast<Handler&&>(handler), arg1, arg2, arg3);
}
template <typename Handler, typename Arg1,
@@ -503,9 +291,9 @@ class binder4
{
public:
template <typename T>
- binder4(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1,
+ binder4(int, T&& handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4)
- : handler_(ASIO_MOVE_CAST(T)(handler)),
+ : handler_(static_cast<T&&>(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3),
@@ -515,7 +303,7 @@ public:
binder4(Handler& handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4)
- : handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ : handler_(static_cast<Handler&&>(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3),
@@ -523,7 +311,6 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE)
binder4(const binder4& other)
: handler_(other.handler_),
arg1_(other.arg1_),
@@ -534,18 +321,17 @@ public:
}
binder4(binder4&& other)
- : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
- arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)),
- arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)),
- arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)),
- arg4_(ASIO_MOVE_CAST(Arg4)(other.arg4_))
+ : handler_(static_cast<Handler&&>(other.handler_)),
+ arg1_(static_cast<Arg1&&>(other.arg1_)),
+ arg2_(static_cast<Arg2&&>(other.arg2_)),
+ arg3_(static_cast<Arg3&&>(other.arg3_)),
+ arg4_(static_cast<Arg4&&>(other.arg4_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
+ static_cast<Handler&&>(handler_)(
static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_),
static_cast<const Arg3&>(arg3_),
@@ -567,34 +353,6 @@ public:
template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1,
- typename Arg2, typename Arg3, typename Arg4>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1,
- typename Arg2, typename Arg3, typename Arg4>
inline bool asio_handler_is_continuation(
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
@@ -602,40 +360,14 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler, typename Arg1,
- typename Arg2, typename Arg3, typename Arg4>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler, typename Arg1,
- typename Arg2, typename Arg3, typename Arg4>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
-inline binder4<typename decay<Handler>::type, Arg1, Arg2, Arg3, Arg4>
-bind_handler(ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1,
+inline binder4<decay_t<Handler>, Arg1, Arg2, Arg3, Arg4>
+bind_handler(Handler&& handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4)
{
- return binder4<typename decay<Handler>::type, Arg1, Arg2, Arg3, Arg4>(0,
- ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3, arg4);
+ return binder4<decay_t<Handler>, Arg1, Arg2, Arg3, Arg4>(0,
+ static_cast<Handler&&>(handler), arg1, arg2, arg3, arg4);
}
template <typename Handler, typename Arg1, typename Arg2,
@@ -644,9 +376,9 @@ class binder5
{
public:
template <typename T>
- binder5(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1,
+ binder5(int, T&& handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
- : handler_(ASIO_MOVE_CAST(T)(handler)),
+ : handler_(static_cast<T&&>(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3),
@@ -657,7 +389,7 @@ public:
binder5(Handler& handler, const Arg1& arg1, const Arg2& arg2,
const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
- : handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ : handler_(static_cast<Handler&&>(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3),
@@ -666,7 +398,6 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE)
binder5(const binder5& other)
: handler_(other.handler_),
arg1_(other.arg1_),
@@ -678,19 +409,18 @@ public:
}
binder5(binder5&& other)
- : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
- arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)),
- arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)),
- arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)),
- arg4_(ASIO_MOVE_CAST(Arg4)(other.arg4_)),
- arg5_(ASIO_MOVE_CAST(Arg5)(other.arg5_))
+ : handler_(static_cast<Handler&&>(other.handler_)),
+ arg1_(static_cast<Arg1&&>(other.arg1_)),
+ arg2_(static_cast<Arg2&&>(other.arg2_)),
+ arg3_(static_cast<Arg3&&>(other.arg3_)),
+ arg4_(static_cast<Arg4&&>(other.arg4_)),
+ arg5_(static_cast<Arg5&&>(other.arg5_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
+ static_cast<Handler&&>(handler_)(
static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_),
static_cast<const Arg3&>(arg3_),
@@ -714,34 +444,6 @@ public:
template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1, typename Arg2,
- typename Arg3, typename Arg4, typename Arg5>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1, typename Arg2,
- typename Arg3, typename Arg4, typename Arg5>
inline bool asio_handler_is_continuation(
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
@@ -749,65 +451,37 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler, typename Arg1,
- typename Arg2, typename Arg3, typename Arg4, typename Arg5>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler, typename Arg1,
- typename Arg2, typename Arg3, typename Arg4, typename Arg5>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
-inline binder5<typename decay<Handler>::type, Arg1, Arg2, Arg3, Arg4, Arg5>
-bind_handler(ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1,
+inline binder5<decay_t<Handler>, Arg1, Arg2, Arg3, Arg4, Arg5>
+bind_handler(Handler&& handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
{
- return binder5<typename decay<Handler>::type, Arg1, Arg2, Arg3, Arg4, Arg5>(0,
- ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3, arg4, arg5);
+ return binder5<decay_t<Handler>, Arg1, Arg2, Arg3, Arg4, Arg5>(0,
+ static_cast<Handler&&>(handler), arg1, arg2, arg3, arg4, arg5);
}
-#if defined(ASIO_HAS_MOVE)
-
template <typename Handler, typename Arg1>
class move_binder1
{
public:
- move_binder1(int, ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Arg1) arg1)
- : handler_(ASIO_MOVE_CAST(Handler)(handler)),
- arg1_(ASIO_MOVE_CAST(Arg1)(arg1))
+ move_binder1(int, Handler&& handler,
+ Arg1&& arg1)
+ : handler_(static_cast<Handler&&>(handler)),
+ arg1_(static_cast<Arg1&&>(arg1))
{
}
move_binder1(move_binder1&& other)
- : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
- arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_))
+ : handler_(static_cast<Handler&&>(other.handler_)),
+ arg1_(static_cast<Arg1&&>(other.arg1_))
{
}
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
- ASIO_MOVE_CAST(Arg1)(arg1_));
+ static_cast<Handler&&>(handler_)(
+ static_cast<Arg1&&>(arg1_));
}
//private:
@@ -816,32 +490,6 @@ public:
};
template <typename Handler, typename Arg1>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- move_binder1<Handler, Arg1>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- move_binder1<Handler, Arg1>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1>
inline bool asio_handler_is_continuation(
move_binder1<Handler, Arg1>* this_handler)
{
@@ -849,42 +497,30 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler, typename Arg1>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(ASIO_MOVE_ARG(Function) function,
- move_binder1<Handler, Arg1>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- ASIO_MOVE_CAST(Function)(function), this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Handler, typename Arg1, typename Arg2>
class move_binder2
{
public:
- move_binder2(int, ASIO_MOVE_ARG(Handler) handler,
- const Arg1& arg1, ASIO_MOVE_ARG(Arg2) arg2)
- : handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ move_binder2(int, Handler&& handler,
+ const Arg1& arg1, Arg2&& arg2)
+ : handler_(static_cast<Handler&&>(handler)),
arg1_(arg1),
- arg2_(ASIO_MOVE_CAST(Arg2)(arg2))
+ arg2_(static_cast<Arg2&&>(arg2))
{
}
move_binder2(move_binder2&& other)
- : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
- arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)),
- arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_))
+ : handler_(static_cast<Handler&&>(other.handler_)),
+ arg1_(static_cast<Arg1&&>(other.arg1_)),
+ arg2_(static_cast<Arg2&&>(other.arg2_))
{
}
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
+ static_cast<Handler&&>(handler_)(
static_cast<const Arg1&>(arg1_),
- ASIO_MOVE_CAST(Arg2)(arg2_));
+ static_cast<Arg2&&>(arg2_));
}
//private:
@@ -894,32 +530,6 @@ public:
};
template <typename Handler, typename Arg1, typename Arg2>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- move_binder2<Handler, Arg1, Arg2>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1, typename Arg2>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- move_binder2<Handler, Arg1, Arg2>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Arg1, typename Arg2>
inline bool asio_handler_is_continuation(
move_binder2<Handler, Arg1, Arg2>* this_handler)
{
@@ -927,20 +537,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler, typename Arg1, typename Arg2>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(ASIO_MOVE_ARG(Function) function,
- move_binder2<Handler, Arg1, Arg2>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- ASIO_MOVE_CAST(Function)(function), this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-#endif // defined(ASIO_HAS_MOVE)
-
} // namespace detail
template <template <typename, typename> class Associator,
@@ -950,8 +546,14 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::binder0<Handler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::binder0<Handler>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::binder0<Handler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
@@ -964,8 +566,14 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::binder1<Handler, Arg1>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::binder1<Handler, Arg1>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::binder1<Handler, Arg1>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
@@ -979,8 +587,14 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::binder2<Handler, Arg1, Arg2>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::binder2<Handler, Arg1, Arg2>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::binder2<Handler, Arg1, Arg2>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
@@ -994,8 +608,14 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::binder3<Handler, Arg1, Arg2, Arg3>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::binder3<Handler, Arg1, Arg2, Arg3>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::binder3<Handler, Arg1, Arg2, Arg3>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
@@ -1009,8 +629,14 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::binder4<Handler, Arg1, Arg2, Arg3, Arg4>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::binder4<Handler, Arg1, Arg2, Arg3, Arg4>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::binder4<Handler, Arg1, Arg2, Arg3, Arg4>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
@@ -1024,15 +650,20 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
+ const detail::binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
const detail::binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
};
-#if defined(ASIO_HAS_MOVE)
-
template <template <typename, typename> class Associator,
typename Handler, typename Arg1, typename DefaultCandidate>
struct associator<Associator,
@@ -1040,30 +671,39 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::move_binder1<Handler, Arg1>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::move_binder1<Handler, Arg1>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::move_binder1<Handler, Arg1>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
};
template <template <typename, typename> class Associator,
- typename Handler, typename Arg1, typename Arg2,
- typename DefaultCandidate>
+ typename Handler, typename Arg1, typename Arg2, typename DefaultCandidate>
struct associator<Associator,
detail::move_binder2<Handler, Arg1, Arg2>, DefaultCandidate>
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::move_binder2<Handler, Arg1, Arg2>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::move_binder2<Handler, Arg1, Arg2>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::move_binder2<Handler, Arg1, Arg2>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
};
-#endif // defined(ASIO_HAS_MOVE)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/detail/blocking_executor_op.hpp b/3rdparty/asio/include/asio/detail/blocking_executor_op.hpp
index d58df20d787..c70e562f403 100644
--- a/3rdparty/asio/include/asio/detail/blocking_executor_op.hpp
+++ b/3rdparty/asio/include/asio/detail/blocking_executor_op.hpp
@@ -2,7 +2,7 @@
// detail/blocking_executor_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,7 +18,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/event.hpp"
#include "asio/detail/fenced_block.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/mutex.hpp"
#include "asio/detail/scheduler_operation.hpp"
@@ -77,6 +76,7 @@ public:
const asio::error_code& /*ec*/,
std::size_t /*bytes_transferred*/)
{
+ ASIO_ASSUME(base != 0);
blocking_executor_op* o(static_cast<blocking_executor_op*>(base));
typename blocking_executor_op_base<Operation>::do_complete_cleanup
@@ -90,7 +90,7 @@ public:
{
fenced_block b(fenced_block::half);
ASIO_HANDLER_INVOCATION_BEGIN(());
- asio_handler_invoke_helpers::invoke(o->handler_, o->handler_);
+ static_cast<Handler&&>(o->handler_)();
ASIO_HANDLER_INVOCATION_END;
}
}
diff --git a/3rdparty/asio/include/asio/detail/buffer_resize_guard.hpp b/3rdparty/asio/include/asio/detail/buffer_resize_guard.hpp
index 00f4aa34c1c..1a78307aaae 100644
--- a/3rdparty/asio/include/asio/detail/buffer_resize_guard.hpp
+++ b/3rdparty/asio/include/asio/detail/buffer_resize_guard.hpp
@@ -2,7 +2,7 @@
// detail/buffer_resize_guard.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/buffer_sequence_adapter.hpp b/3rdparty/asio/include/asio/detail/buffer_sequence_adapter.hpp
index 89b05ce37ed..8ea904e7023 100644
--- a/3rdparty/asio/include/asio/detail/buffer_sequence_adapter.hpp
+++ b/3rdparty/asio/include/asio/detail/buffer_sequence_adapter.hpp
@@ -2,7 +2,7 @@
// detail/buffer_sequence_adapter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,6 +19,7 @@
#include "asio/buffer.hpp"
#include "asio/detail/array_fwd.hpp"
#include "asio/detail/socket_types.hpp"
+#include "asio/registered_buffer.hpp"
#include "asio/detail/push_options.hpp"
@@ -105,6 +106,7 @@ class buffer_sequence_adapter
{
public:
enum { is_single_buffer = false };
+ enum { is_registered_buffer = false };
explicit buffer_sequence_adapter(const Buffers& buffer_sequence)
: count_(0), total_buffer_size_(0)
@@ -129,6 +131,11 @@ public:
return total_buffer_size_;
}
+ registered_buffer_id registered_id() const
+ {
+ return registered_buffer_id();
+ }
+
bool all_empty() const
{
return total_buffer_size_ == 0;
@@ -248,6 +255,7 @@ class buffer_sequence_adapter<Buffer, asio::mutable_buffer>
{
public:
enum { is_single_buffer = true };
+ enum { is_registered_buffer = false };
explicit buffer_sequence_adapter(
const asio::mutable_buffer& buffer_sequence)
@@ -271,6 +279,11 @@ public:
return total_buffer_size_;
}
+ registered_buffer_id registered_id() const
+ {
+ return registered_buffer_id();
+ }
+
bool all_empty() const
{
return total_buffer_size_ == 0;
@@ -310,6 +323,7 @@ class buffer_sequence_adapter<Buffer, asio::const_buffer>
{
public:
enum { is_single_buffer = true };
+ enum { is_registered_buffer = false };
explicit buffer_sequence_adapter(
const asio::const_buffer& buffer_sequence)
@@ -333,6 +347,11 @@ public:
return total_buffer_size_;
}
+ registered_buffer_id registered_id() const
+ {
+ return registered_buffer_id();
+ }
+
bool all_empty() const
{
return total_buffer_size_ == 0;
@@ -374,6 +393,7 @@ class buffer_sequence_adapter<Buffer, asio::mutable_buffers_1>
{
public:
enum { is_single_buffer = true };
+ enum { is_registered_buffer = false };
explicit buffer_sequence_adapter(
const asio::mutable_buffers_1& buffer_sequence)
@@ -397,6 +417,11 @@ public:
return total_buffer_size_;
}
+ registered_buffer_id registered_id() const
+ {
+ return registered_buffer_id();
+ }
+
bool all_empty() const
{
return total_buffer_size_ == 0;
@@ -436,6 +461,7 @@ class buffer_sequence_adapter<Buffer, asio::const_buffers_1>
{
public:
enum { is_single_buffer = true };
+ enum { is_registered_buffer = false };
explicit buffer_sequence_adapter(
const asio::const_buffers_1& buffer_sequence)
@@ -459,6 +485,11 @@ public:
return total_buffer_size_;
}
+ registered_buffer_id registered_id() const
+ {
+ return registered_buffer_id();
+ }
+
bool all_empty() const
{
return total_buffer_size_ == 0;
@@ -494,12 +525,161 @@ private:
#endif // !defined(ASIO_NO_DEPRECATED)
+template <typename Buffer>
+class buffer_sequence_adapter<Buffer, asio::mutable_registered_buffer>
+ : buffer_sequence_adapter_base
+{
+public:
+ enum { is_single_buffer = true };
+ enum { is_registered_buffer = true };
+
+ explicit buffer_sequence_adapter(
+ const asio::mutable_registered_buffer& buffer_sequence)
+ {
+ init_native_buffer(buffer_, buffer_sequence.buffer());
+ total_buffer_size_ = buffer_sequence.size();
+ registered_id_ = buffer_sequence.id();
+ }
+
+ native_buffer_type* buffers()
+ {
+ return &buffer_;
+ }
+
+ std::size_t count() const
+ {
+ return 1;
+ }
+
+ std::size_t total_size() const
+ {
+ return total_buffer_size_;
+ }
+
+ registered_buffer_id registered_id() const
+ {
+ return registered_id_;
+ }
+
+ bool all_empty() const
+ {
+ return total_buffer_size_ == 0;
+ }
+
+ static bool all_empty(
+ const asio::mutable_registered_buffer& buffer_sequence)
+ {
+ return buffer_sequence.size() == 0;
+ }
+
+ static void validate(
+ const asio::mutable_registered_buffer& buffer_sequence)
+ {
+ buffer_sequence.data();
+ }
+
+ static Buffer first(
+ const asio::mutable_registered_buffer& buffer_sequence)
+ {
+ return Buffer(buffer_sequence.buffer());
+ }
+
+ enum { linearisation_storage_size = 1 };
+
+ static Buffer linearise(
+ const asio::mutable_registered_buffer& buffer_sequence,
+ const Buffer&)
+ {
+ return Buffer(buffer_sequence.buffer());
+ }
+
+private:
+ native_buffer_type buffer_;
+ std::size_t total_buffer_size_;
+ registered_buffer_id registered_id_;
+};
+
+template <typename Buffer>
+class buffer_sequence_adapter<Buffer, asio::const_registered_buffer>
+ : buffer_sequence_adapter_base
+{
+public:
+ enum { is_single_buffer = true };
+ enum { is_registered_buffer = true };
+
+ explicit buffer_sequence_adapter(
+ const asio::const_registered_buffer& buffer_sequence)
+ {
+ init_native_buffer(buffer_, buffer_sequence.buffer());
+ total_buffer_size_ = buffer_sequence.size();
+ registered_id_ = buffer_sequence.id();
+ }
+
+ native_buffer_type* buffers()
+ {
+ return &buffer_;
+ }
+
+ std::size_t count() const
+ {
+ return 1;
+ }
+
+ std::size_t total_size() const
+ {
+ return total_buffer_size_;
+ }
+
+ registered_buffer_id registered_id() const
+ {
+ return registered_id_;
+ }
+
+ bool all_empty() const
+ {
+ return total_buffer_size_ == 0;
+ }
+
+ static bool all_empty(
+ const asio::const_registered_buffer& buffer_sequence)
+ {
+ return buffer_sequence.size() == 0;
+ }
+
+ static void validate(
+ const asio::const_registered_buffer& buffer_sequence)
+ {
+ buffer_sequence.data();
+ }
+
+ static Buffer first(
+ const asio::const_registered_buffer& buffer_sequence)
+ {
+ return Buffer(buffer_sequence.buffer());
+ }
+
+ enum { linearisation_storage_size = 1 };
+
+ static Buffer linearise(
+ const asio::const_registered_buffer& buffer_sequence,
+ const Buffer&)
+ {
+ return Buffer(buffer_sequence.buffer());
+ }
+
+private:
+ native_buffer_type buffer_;
+ std::size_t total_buffer_size_;
+ registered_buffer_id registered_id_;
+};
+
template <typename Buffer, typename Elem>
-class buffer_sequence_adapter<Buffer, boost::array<Elem, 2> >
+class buffer_sequence_adapter<Buffer, boost::array<Elem, 2>>
: buffer_sequence_adapter_base
{
public:
enum { is_single_buffer = false };
+ enum { is_registered_buffer = false };
explicit buffer_sequence_adapter(
const boost::array<Elem, 2>& buffer_sequence)
@@ -524,6 +704,11 @@ public:
return total_buffer_size_;
}
+ registered_buffer_id registered_id() const
+ {
+ return registered_buffer_id();
+ }
+
bool all_empty() const
{
return total_buffer_size_ == 0;
@@ -564,14 +749,13 @@ private:
std::size_t total_buffer_size_;
};
-#if defined(ASIO_HAS_STD_ARRAY)
-
template <typename Buffer, typename Elem>
-class buffer_sequence_adapter<Buffer, std::array<Elem, 2> >
+class buffer_sequence_adapter<Buffer, std::array<Elem, 2>>
: buffer_sequence_adapter_base
{
public:
enum { is_single_buffer = false };
+ enum { is_registered_buffer = false };
explicit buffer_sequence_adapter(
const std::array<Elem, 2>& buffer_sequence)
@@ -596,6 +780,11 @@ public:
return total_buffer_size_;
}
+ registered_buffer_id registered_id() const
+ {
+ return registered_buffer_id();
+ }
+
bool all_empty() const
{
return total_buffer_size_ == 0;
@@ -636,8 +825,6 @@ private:
std::size_t total_buffer_size_;
};
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/buffered_stream_storage.hpp b/3rdparty/asio/include/asio/detail/buffered_stream_storage.hpp
index 04cef8250d9..afe5cadffda 100644
--- a/3rdparty/asio/include/asio/detail/buffered_stream_storage.hpp
+++ b/3rdparty/asio/include/asio/detail/buffered_stream_storage.hpp
@@ -2,7 +2,7 @@
// detail/buffered_stream_storage.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/bulk_executor_op.hpp b/3rdparty/asio/include/asio/detail/bulk_executor_op.hpp
deleted file mode 100644
index 8f6921b9f80..00000000000
--- a/3rdparty/asio/include/asio/detail/bulk_executor_op.hpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// detail/bulk_executor_op.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_BULK_EXECUTOR_OP_HPP
-#define ASIO_DETAIL_BULK_EXECUTOR_OP_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/bind_handler.hpp"
-#include "asio/detail/fenced_block.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
-#include "asio/detail/scheduler_operation.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-template <typename Handler, typename Alloc,
- typename Operation = scheduler_operation>
-class bulk_executor_op : public Operation
-{
-public:
- ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(bulk_executor_op);
-
- template <typename H>
- bulk_executor_op(ASIO_MOVE_ARG(H) h,
- const Alloc& allocator, std::size_t i)
- : Operation(&bulk_executor_op::do_complete),
- handler_(ASIO_MOVE_CAST(H)(h)),
- allocator_(allocator),
- index_(i)
- {
- }
-
- static void do_complete(void* owner, Operation* base,
- const asio::error_code& /*ec*/,
- std::size_t /*bytes_transferred*/)
- {
- // Take ownership of the handler object.
- bulk_executor_op* o(static_cast<bulk_executor_op*>(base));
- Alloc allocator(o->allocator_);
- ptr p = { detail::addressof(allocator), o, o };
-
- ASIO_HANDLER_COMPLETION((*o));
-
- // Make a copy of the handler so that the memory can be deallocated before
- // the upcall is made. Even if we're not about to make an upcall, a
- // sub-object of the handler may be the true owner of the memory associated
- // with the handler. Consequently, a local copy of the handler is required
- // to ensure that any owning sub-object remains valid until after we have
- // deallocated the memory here.
- detail::binder1<Handler, std::size_t> handler(o->handler_, o->index_);
- p.reset();
-
- // Make the upcall if required.
- if (owner)
- {
- fenced_block b(fenced_block::half);
- ASIO_HANDLER_INVOCATION_BEGIN(());
- asio_handler_invoke_helpers::invoke(handler, handler.handler_);
- ASIO_HANDLER_INVOCATION_END;
- }
- }
-
-private:
- Handler handler_;
- Alloc allocator_;
- std::size_t index_;
-};
-
-} // namespace detail
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_DETAIL_BULK_EXECUTOR_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/call_stack.hpp b/3rdparty/asio/include/asio/detail/call_stack.hpp
index 40f762d4406..c287c57e2c6 100644
--- a/3rdparty/asio/include/asio/detail/call_stack.hpp
+++ b/3rdparty/asio/include/asio/detail/call_stack.hpp
@@ -2,7 +2,7 @@
// detail/call_stack.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/chrono.hpp b/3rdparty/asio/include/asio/detail/chrono.hpp
index 0abae1cd96b..45490dde02e 100644
--- a/3rdparty/asio/include/asio/detail/chrono.hpp
+++ b/3rdparty/asio/include/asio/detail/chrono.hpp
@@ -2,7 +2,7 @@
// detail/chrono.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,17 +16,11 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_CHRONO)
-# include <chrono>
-#elif defined(ASIO_HAS_BOOST_CHRONO)
-# include <boost/chrono/system_clocks.hpp>
-#endif // defined(ASIO_HAS_BOOST_CHRONO)
+#include <chrono>
namespace asio {
namespace chrono {
-#if defined(ASIO_HAS_STD_CHRONO)
using std::chrono::duration;
using std::chrono::time_point;
using std::chrono::duration_cast;
@@ -44,21 +38,6 @@ using std::chrono::steady_clock;
#endif // defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK)
using std::chrono::system_clock;
using std::chrono::high_resolution_clock;
-#elif defined(ASIO_HAS_BOOST_CHRONO)
-using boost::chrono::duration;
-using boost::chrono::time_point;
-using boost::chrono::duration_cast;
-using boost::chrono::nanoseconds;
-using boost::chrono::microseconds;
-using boost::chrono::milliseconds;
-using boost::chrono::seconds;
-using boost::chrono::minutes;
-using boost::chrono::hours;
-using boost::chrono::time_point_cast;
-using boost::chrono::system_clock;
-using boost::chrono::steady_clock;
-using boost::chrono::high_resolution_clock;
-#endif // defined(ASIO_HAS_BOOST_CHRONO)
} // namespace chrono
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/chrono_time_traits.hpp b/3rdparty/asio/include/asio/detail/chrono_time_traits.hpp
index 17b9645cc0d..de7b7d69929 100644
--- a/3rdparty/asio/include/asio/detail/chrono_time_traits.hpp
+++ b/3rdparty/asio/include/asio/detail/chrono_time_traits.hpp
@@ -2,7 +2,7 @@
// detail/chrono_time_traits.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/completion_handler.hpp b/3rdparty/asio/include/asio/detail/completion_handler.hpp
index 5c24fa42a8b..c6f98b36c38 100644
--- a/3rdparty/asio/include/asio/detail/completion_handler.hpp
+++ b/3rdparty/asio/include/asio/detail/completion_handler.hpp
@@ -2,7 +2,7 @@
// detail/completion_handler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -35,7 +35,7 @@ public:
completion_handler(Handler& h, const IoExecutor& io_ex)
: operation(&completion_handler::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(h)),
+ handler_(static_cast<Handler&&>(h)),
work_(handler_, io_ex)
{
}
@@ -52,7 +52,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
h->work_));
// Make a copy of the handler so that the memory can be deallocated before
@@ -61,7 +61,7 @@ public:
// with the handler. Consequently, a local copy of the handler is required
// to ensure that any owning sub-object remains valid until after we have
// deallocated the memory here.
- Handler handler(ASIO_MOVE_CAST(Handler)(h->handler_));
+ Handler handler(static_cast<Handler&&>(h->handler_));
p.h = asio::detail::addressof(handler);
p.reset();
diff --git a/3rdparty/asio/include/asio/detail/composed_work.hpp b/3rdparty/asio/include/asio/detail/composed_work.hpp
new file mode 100644
index 00000000000..8076f8508d6
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/composed_work.hpp
@@ -0,0 +1,252 @@
+//
+// detail/composed_work.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_COMPOSED_WORK_HPP
+#define ASIO_DETAIL_COMPOSED_WORK_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/execution/executor.hpp"
+#include "asio/execution/outstanding_work.hpp"
+#include "asio/executor_work_guard.hpp"
+#include "asio/is_executor.hpp"
+#include "asio/system_executor.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename Executor, typename = void>
+class composed_work_guard
+{
+public:
+ typedef decay_t<
+ prefer_result_t<Executor, execution::outstanding_work_t::tracked_t>
+ > executor_type;
+
+ composed_work_guard(const Executor& ex)
+ : executor_(asio::prefer(ex, execution::outstanding_work.tracked))
+ {
+ }
+
+ void reset()
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return executor_;
+ }
+
+private:
+ executor_type executor_;
+};
+
+template <>
+struct composed_work_guard<system_executor>
+{
+public:
+ typedef system_executor executor_type;
+
+ composed_work_guard(const system_executor&)
+ {
+ }
+
+ void reset()
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return system_executor();
+ }
+};
+
+#if !defined(ASIO_NO_TS_EXECUTORS)
+
+template <typename Executor>
+struct composed_work_guard<Executor,
+ enable_if_t<
+ !execution::is_executor<Executor>::value
+ >
+ > : executor_work_guard<Executor>
+{
+ composed_work_guard(const Executor& ex)
+ : executor_work_guard<Executor>(ex)
+ {
+ }
+};
+
+#endif // !defined(ASIO_NO_TS_EXECUTORS)
+
+template <typename>
+struct composed_io_executors;
+
+template <>
+struct composed_io_executors<void()>
+{
+ composed_io_executors() noexcept
+ : head_(system_executor())
+ {
+ }
+
+ typedef system_executor head_type;
+ system_executor head_;
+};
+
+inline composed_io_executors<void()> make_composed_io_executors()
+{
+ return composed_io_executors<void()>();
+}
+
+template <typename Head>
+struct composed_io_executors<void(Head)>
+{
+ explicit composed_io_executors(const Head& ex) noexcept
+ : head_(ex)
+ {
+ }
+
+ typedef Head head_type;
+ Head head_;
+};
+
+template <typename Head>
+inline composed_io_executors<void(Head)>
+make_composed_io_executors(const Head& head)
+{
+ return composed_io_executors<void(Head)>(head);
+}
+
+template <typename Head, typename... Tail>
+struct composed_io_executors<void(Head, Tail...)>
+{
+ explicit composed_io_executors(const Head& head,
+ const Tail&... tail) noexcept
+ : head_(head),
+ tail_(tail...)
+ {
+ }
+
+ void reset()
+ {
+ head_.reset();
+ tail_.reset();
+ }
+
+ typedef Head head_type;
+ Head head_;
+ composed_io_executors<void(Tail...)> tail_;
+};
+
+template <typename Head, typename... Tail>
+inline composed_io_executors<void(Head, Tail...)>
+make_composed_io_executors(const Head& head, const Tail&... tail)
+{
+ return composed_io_executors<void(Head, Tail...)>(head, tail...);
+}
+
+template <typename>
+struct composed_work;
+
+template <>
+struct composed_work<void()>
+{
+ typedef composed_io_executors<void()> executors_type;
+
+ composed_work(const executors_type&) noexcept
+ : head_(system_executor())
+ {
+ }
+
+ void reset()
+ {
+ head_.reset();
+ }
+
+ typedef system_executor head_type;
+ composed_work_guard<system_executor> head_;
+};
+
+template <typename Head>
+struct composed_work<void(Head)>
+{
+ typedef composed_io_executors<void(Head)> executors_type;
+
+ explicit composed_work(const executors_type& ex) noexcept
+ : head_(ex.head_)
+ {
+ }
+
+ void reset()
+ {
+ head_.reset();
+ }
+
+ typedef Head head_type;
+ composed_work_guard<Head> head_;
+};
+
+template <typename Head, typename... Tail>
+struct composed_work<void(Head, Tail...)>
+{
+ typedef composed_io_executors<void(Head, Tail...)> executors_type;
+
+ explicit composed_work(const executors_type& ex) noexcept
+ : head_(ex.head_),
+ tail_(ex.tail_)
+ {
+ }
+
+ void reset()
+ {
+ head_.reset();
+ tail_.reset();
+ }
+
+ typedef Head head_type;
+ composed_work_guard<Head> head_;
+ composed_work<void(Tail...)> tail_;
+};
+
+template <typename IoObject>
+inline typename IoObject::executor_type
+get_composed_io_executor(IoObject& io_object,
+ enable_if_t<
+ !is_executor<IoObject>::value
+ >* = 0,
+ enable_if_t<
+ !execution::is_executor<IoObject>::value
+ >* = 0)
+{
+ return io_object.get_executor();
+}
+
+template <typename Executor>
+inline const Executor& get_composed_io_executor(const Executor& ex,
+ enable_if_t<
+ is_executor<Executor>::value
+ || execution::is_executor<Executor>::value
+ >* = 0)
+{
+ return ex;
+}
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_DETAIL_COMPOSED_WORK_HPP
diff --git a/3rdparty/asio/include/asio/detail/concurrency_hint.hpp b/3rdparty/asio/include/asio/detail/concurrency_hint.hpp
index 60ab2a8cd3f..43e81a4c22d 100644
--- a/3rdparty/asio/include/asio/detail/concurrency_hint.hpp
+++ b/3rdparty/asio/include/asio/detail/concurrency_hint.hpp
@@ -2,7 +2,7 @@
// detail/concurrency_hint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/conditionally_enabled_event.hpp b/3rdparty/asio/include/asio/detail/conditionally_enabled_event.hpp
index bb5c524b0c7..af68dde32c0 100644
--- a/3rdparty/asio/include/asio/detail/conditionally_enabled_event.hpp
+++ b/3rdparty/asio/include/asio/detail/conditionally_enabled_event.hpp
@@ -2,7 +2,7 @@
// detail/conditionally_enabled_event.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/conditionally_enabled_mutex.hpp b/3rdparty/asio/include/asio/detail/conditionally_enabled_mutex.hpp
index 4f354ea5b8d..27fc30ecbb2 100644
--- a/3rdparty/asio/include/asio/detail/conditionally_enabled_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/conditionally_enabled_mutex.hpp
@@ -2,7 +2,7 @@
// detail/conditionally_enabled_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/config.hpp b/3rdparty/asio/include/asio/detail/config.hpp
index be350c4e6d0..cd345eac2cd 100644
--- a/3rdparty/asio/include/asio/detail/config.hpp
+++ b/3rdparty/asio/include/asio/detail/config.hpp
@@ -2,7 +2,7 @@
// detail/config.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -24,6 +24,17 @@
# endif // !defined(ASIO_ENABLE_BOOST)
#endif // !defined(ASIO_STANDALONE)
+// Make standard library feature macros available.
+#if defined(__has_include)
+# if __has_include(<version>)
+# include <version>
+# else // __has_include(<version>)
+# include <cstddef>
+# endif // __has_include(<version>)
+#else // defined(__has_include)
+# include <cstddef>
+#endif // defined(__has_include)
+
// boostify: non-boost code ends here
#if defined(ASIO_STANDALONE)
# define ASIO_DISABLE_BOOST_ALIGN 1
@@ -38,6 +49,7 @@
# define ASIO_DISABLE_BOOST_THROW_EXCEPTION 1
# define ASIO_DISABLE_BOOST_WORKAROUND 1
#else // defined(ASIO_STANDALONE)
+// Boost.Config library is available.
# include <boost/config.hpp>
# include <boost/version.hpp>
# define ASIO_HAS_BOOST_CONFIG 1
@@ -106,244 +118,85 @@
# include <android/api-level.h>
#endif // defined(__ANDROID__)
-// Support move construction and assignment on compilers known to allow it.
-#if !defined(ASIO_HAS_MOVE)
-# if !defined(ASIO_DISABLE_MOVE)
-# if defined(__clang__)
-# if __has_feature(__cxx_rvalue_references__)
-# define ASIO_HAS_MOVE 1
-# endif // __has_feature(__cxx_rvalue_references__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_MOVE 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_MOVE 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# if defined(__INTEL_CXX11_MODE__)
-# if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
-# define ASIO_HAS_MOVE 1
-# endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
-# if defined(__ICL) && (__ICL >= 1500)
-# define ASIO_HAS_MOVE 1
-# endif // defined(__ICL) && (__ICL >= 1500)
-# endif // defined(__INTEL_CXX11_MODE__)
-# endif // !defined(ASIO_DISABLE_MOVE)
-#endif // !defined(ASIO_HAS_MOVE)
-
-// If ASIO_MOVE_CAST isn't defined, and move support is available, define
-// * ASIO_MOVE_ARG,
-// * ASIO_NONDEDUCED_MOVE_ARG, and
-// * ASIO_MOVE_CAST
-// to take advantage of rvalue references and perfect forwarding.
-#if defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST)
+// Always enabled. Retained for backwards compatibility in user code.
+#if !defined(ASIO_DISABLE_CXX11_MACROS)
+# define ASIO_HAS_MOVE 1
# define ASIO_MOVE_ARG(type) type&&
# define ASIO_MOVE_ARG2(type1, type2) type1, type2&&
# define ASIO_NONDEDUCED_MOVE_ARG(type) type&
# define ASIO_MOVE_CAST(type) static_cast<type&&>
# define ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
# define ASIO_MOVE_OR_LVALUE(type) static_cast<type&&>
+# define ASIO_MOVE_OR_LVALUE_ARG(type) type&&
# define ASIO_MOVE_OR_LVALUE_TYPE(type) type
-#endif // defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST)
-
-// If ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible
-// implementation. Note that older g++ and MSVC versions don't like it when you
-// pass a non-member function through a const reference, so for most compilers
-// we'll play it safe and stick with the old approach of passing the handler by
-// value.
-#if !defined(ASIO_MOVE_CAST)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
-# define ASIO_MOVE_ARG(type) const type&
-# else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
-# define ASIO_MOVE_ARG(type) type
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
-# elif defined(ASIO_MSVC)
-# if (_MSC_VER >= 1400)
-# define ASIO_MOVE_ARG(type) const type&
-# else // (_MSC_VER >= 1400)
-# define ASIO_MOVE_ARG(type) type
-# endif // (_MSC_VER >= 1400)
-# else
-# define ASIO_MOVE_ARG(type) type
-# endif
-# define ASIO_NONDEDUCED_MOVE_ARG(type) const type&
-# define ASIO_MOVE_CAST(type) static_cast<const type&>
-# define ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&>
-# define ASIO_MOVE_OR_LVALUE(type)
-# define ASIO_MOVE_OR_LVALUE_TYPE(type) type&
-#endif // !defined(ASIO_MOVE_CAST)
-
-// Support variadic templates on compilers known to allow it.
-#if !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-# if !defined(ASIO_DISABLE_VARIADIC_TEMPLATES)
-# if defined(__clang__)
-# if __has_feature(__cxx_variadic_templates__)
-# define ASIO_HAS_VARIADIC_TEMPLATES 1
-# endif // __has_feature(__cxx_variadic_templates__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_VARIADIC_TEMPLATES 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900)
-# define ASIO_HAS_VARIADIC_TEMPLATES 1
-# endif // (_MSC_VER >= 1900)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_VARIADIC_TEMPLATES)
-#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-#if !defined(ASIO_ELLIPSIS)
-# if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-# define ASIO_ELLIPSIS ...
-# else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-# define ASIO_ELLIPSIS
-# endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-#endif // !defined(ASIO_ELLIPSIS)
-
-// Support deleted functions on compilers known to allow it.
-#if !defined(ASIO_DELETED)
-# if defined(__clang__)
-# if __has_feature(__cxx_deleted_functions__)
-# define ASIO_DELETED = delete
-# endif // __has_feature(__cxx_deleted_functions__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_DELETED = delete
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900)
-# define ASIO_DELETED = delete
-# endif // (_MSC_VER >= 1900)
-# endif // defined(ASIO_MSVC)
-# if !defined(ASIO_DELETED)
-# define ASIO_DELETED
-# endif // !defined(ASIO_DELETED)
-#endif // !defined(ASIO_DELETED)
-
-// Support constexpr on compilers known to allow it.
-#if !defined(ASIO_HAS_CONSTEXPR)
-# if !defined(ASIO_DISABLE_CONSTEXPR)
-# if defined(__clang__)
-# if __has_feature(__cxx_constexpr__)
-# define ASIO_HAS_CONSTEXPR 1
-# endif // __has_feature(__cxx_constexpr__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_CONSTEXPR 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900)
-# define ASIO_HAS_CONSTEXPR 1
-# endif // (_MSC_VER >= 1900)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_CONSTEXPR)
-#endif // !defined(ASIO_HAS_CONSTEXPR)
-#if !defined(ASIO_CONSTEXPR)
-# if defined(ASIO_HAS_CONSTEXPR)
-# define ASIO_CONSTEXPR constexpr
-# else // defined(ASIO_HAS_CONSTEXPR)
-# define ASIO_CONSTEXPR
-# endif // defined(ASIO_HAS_CONSTEXPR)
-#endif // !defined(ASIO_CONSTEXPR)
-#if !defined(ASIO_STATIC_CONSTEXPR)
-# if defined(ASIO_HAS_CONSTEXPR)
-# define ASIO_STATIC_CONSTEXPR(type, assignment) \
- static constexpr type assignment
-# else // defined(ASIO_HAS_CONSTEXPR)
-# define ASIO_STATIC_CONSTEXPR(type, assignment) \
- static const type assignment
-# endif // defined(ASIO_HAS_CONSTEXPR)
-#endif // !defined(ASIO_STATIC_CONSTEXPR)
+# define ASIO_DELETED = delete
+# define ASIO_HAS_VARIADIC_TEMPLATES 1
+# define ASIO_HAS_CONSTEXPR 1
+# define ASIO_STATIC_CONSTEXPR(type, assignment) \
+ static constexpr type assignment
+# define ASIO_HAS_NOEXCEPT 1
+# define ASIO_NOEXCEPT noexcept(true)
+# define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
+# define ASIO_NOEXCEPT_IF(c) noexcept(c)
+# define ASIO_HAS_DECLTYPE 1
+# define ASIO_AUTO_RETURN_TYPE_PREFIX(t) auto
+# define ASIO_AUTO_RETURN_TYPE_PREFIX2(t0, t1) auto
+# define ASIO_AUTO_RETURN_TYPE_PREFIX3(t0, t1, t2) auto
+# define ASIO_AUTO_RETURN_TYPE_SUFFIX(expr) -> decltype expr
+# define ASIO_HAS_ALIAS_TEMPLATES 1
+# define ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
+# define ASIO_HAS_ENUM_CLASS 1
+# define ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
+# define ASIO_LVALUE_REF_QUAL &
+# define ASIO_RVALUE_REF_QUAL &&
+# define ASIO_HAS_USER_DEFINED_LITERALS 1
+# define ASIO_HAS_ALIGNOF 1
+# define ASIO_ALIGNOF(T) alignof(T)
+# define ASIO_HAS_STD_ALIGN 1
+# define ASIO_HAS_STD_SYSTEM_ERROR 1
+# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
+# define ASIO_HAS_STD_ARRAY 1
+# define ASIO_HAS_STD_SHARED_PTR 1
+# define ASIO_HAS_STD_ALLOCATOR_ARG 1
+# define ASIO_HAS_STD_ATOMIC 1
+# define ASIO_HAS_STD_CHRONO 1
+# define ASIO_HAS_STD_ADDRESSOF 1
+# define ASIO_HAS_STD_FUNCTION 1
+# define ASIO_HAS_STD_REFERENCE_WRAPPER 1
+# define ASIO_HAS_STD_TYPE_TRAITS 1
+# define ASIO_HAS_NULLPTR 1
+# define ASIO_HAS_CXX11_ALLOCATORS 1
+# define ASIO_HAS_CSTDINT 1
+# define ASIO_HAS_STD_THREAD 1
+# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
+# define ASIO_HAS_STD_CALL_ONCE 1
+# define ASIO_HAS_STD_FUTURE 1
+# define ASIO_HAS_STD_TUPLE 1
+# define ASIO_HAS_STD_IOSTREAM_MOVE 1
+# define ASIO_HAS_STD_EXCEPTION_PTR 1
+# define ASIO_HAS_STD_NESTED_EXCEPTION 1
+# define ASIO_HAS_STD_HASH 1
+#endif // !defined(ASIO_DISABLE_CXX11_MACROS)
+
+// Support for static constexpr with default initialisation.
#if !defined(ASIO_STATIC_CONSTEXPR_DEFAULT_INIT)
-# if defined(ASIO_HAS_CONSTEXPR)
-# if defined(__GNUC__)
-# if (__GNUC__ >= 8)
-# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
- static constexpr const type name{}
-# else // (__GNUC__ >= 8)
-# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
- static const type name
-# endif // (__GNUC__ >= 8)
-# elif defined(ASIO_MSVC)
-# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
- static const type name
-# else // defined(ASIO_MSVC)
+# if defined(__GNUC__)
+# if (__GNUC__ >= 8)
# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
static constexpr const type name{}
-# endif // defined(ASIO_MSVC)
-# else // defined(ASIO_HAS_CONSTEXPR)
+# else // (__GNUC__ >= 8)
+# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
+ static const type name
+# endif // (__GNUC__ >= 8)
+# elif defined(ASIO_MSVC)
# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
static const type name
-# endif // defined(ASIO_HAS_CONSTEXPR)
+# else // defined(ASIO_MSVC)
+# define ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
+ static constexpr const type name{}
+# endif // defined(ASIO_MSVC)
#endif // !defined(ASIO_STATIC_CONSTEXPR_DEFAULT_INIT)
-// Support noexcept on compilers known to allow it.
-#if !defined(ASIO_HAS_NOEXCEPT)
-# if !defined(ASIO_DISABLE_NOEXCEPT)
-# if defined(ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
-# if !defined(BOOST_NO_NOEXCEPT)
-# define ASIO_HAS_NOEXCEPT 1
-# endif // !defined(BOOST_NO_NOEXCEPT)
-# define ASIO_NOEXCEPT BOOST_NOEXCEPT
-# define ASIO_NOEXCEPT_OR_NOTHROW BOOST_NOEXCEPT_OR_NOTHROW
-# define ASIO_NOEXCEPT_IF(c) BOOST_NOEXCEPT_IF(c)
-# elif defined(__clang__)
-# if __has_feature(__cxx_noexcept__)
-# define ASIO_HAS_NOEXCEPT 1
-# endif // __has_feature(__cxx_noexcept__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_NOEXCEPT 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# elif defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900)
-# define ASIO_HAS_NOEXCEPT 1
-# endif // (_MSC_VER >= 1900)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_NOEXCEPT)
-# if !defined(ASIO_NOEXCEPT)
-# endif // !defined(ASIO_NOEXCEPT)
-# if !defined(ASIO_NOEXCEPT_OR_NOTHROW)
-# endif // !defined(ASIO_NOEXCEPT_OR_NOTHROW)
-#endif // !defined(ASIO_HAS_NOEXCEPT)
-#if !defined(ASIO_NOEXCEPT)
-# if defined(ASIO_HAS_NOEXCEPT)
-# define ASIO_NOEXCEPT noexcept(true)
-# else // defined(ASIO_HAS_NOEXCEPT)
-# define ASIO_NOEXCEPT
-# endif // defined(ASIO_HAS_NOEXCEPT)
-#endif // !defined(ASIO_NOEXCEPT)
-#if !defined(ASIO_NOEXCEPT_OR_NOTHROW)
-# if defined(ASIO_HAS_NOEXCEPT)
-# define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
-# else // defined(ASIO_HAS_NOEXCEPT)
-# define ASIO_NOEXCEPT_OR_NOTHROW throw()
-# endif // defined(ASIO_HAS_NOEXCEPT)
-#endif // !defined(ASIO_NOEXCEPT_OR_NOTHROW)
-#if !defined(ASIO_NOEXCEPT_IF)
-# if defined(ASIO_HAS_NOEXCEPT)
-# define ASIO_NOEXCEPT_IF(c) noexcept(c)
-# else // defined(ASIO_HAS_NOEXCEPT)
-# define ASIO_NOEXCEPT_IF(c)
-# endif // defined(ASIO_HAS_NOEXCEPT)
-#endif // !defined(ASIO_NOEXCEPT_IF)
-
// Support noexcept on function types on compilers known to allow it.
#if !defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
# if !defined(ASIO_DISABLE_NOEXCEPT_FUNCTION_TYPE)
@@ -363,50 +216,6 @@
# endif // !defined(ASIO_DISABLE_NOEXCEPT_FUNCTION_TYPE)
#endif // !defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-// Support automatic type deduction on compilers known to support it.
-#if !defined(ASIO_HAS_DECLTYPE)
-# if !defined(ASIO_DISABLE_DECLTYPE)
-# if defined(__clang__)
-# if __has_feature(__cxx_decltype__)
-# define ASIO_HAS_DECLTYPE 1
-# endif // __has_feature(__cxx_decltype__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_DECLTYPE 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1800)
-# define ASIO_HAS_DECLTYPE 1
-# endif // (_MSC_VER >= 1800)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_DECLTYPE)
-#endif // !defined(ASIO_HAS_DECLTYPE)
-
-// Support alias templates on compilers known to allow it.
-#if !defined(ASIO_HAS_ALIAS_TEMPLATES)
-# if !defined(ASIO_DISABLE_ALIAS_TEMPLATES)
-# if defined(__clang__)
-# if __has_feature(__cxx_alias_templates__)
-# define ASIO_HAS_ALIAS_TEMPLATES 1
-# endif // __has_feature(__cxx_alias_templates__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_ALIAS_TEMPLATES 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900)
-# define ASIO_HAS_ALIAS_TEMPLATES 1
-# endif // (_MSC_VER >= 1900)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_ALIAS_TEMPLATES)
-#endif // !defined(ASIO_HAS_ALIAS_TEMPLATES)
-
// Support return type deduction on compilers known to allow it.
#if !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
# if !defined(ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
@@ -420,35 +229,13 @@
# if (__cpp_return_type_deduction >= 201304)
# define ASIO_HAS_RETURN_TYPE_DEDUCTION 1
# endif // (__cpp_return_type_deduction >= 201304)
-# endif // defined(__cpp_return_type_deduction)
-# endif // !defined(ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
-#endif // !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
-
-// Support default function template arguments on compilers known to allow it.
-#if !defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
-# if !defined(ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
-# if (__cplusplus >= 201103)
-# define ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
-# elif defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
-# define ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
-# endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
-#endif // !defined(ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
-
-// Support enum classes on compilers known to allow them.
-#if !defined(ASIO_HAS_ENUM_CLASS)
-# if !defined(ASIO_DISABLE_ENUM_CLASS)
-# if (__cplusplus >= 201103)
-# define ASIO_HAS_ENUM_CLASS 1
# elif defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
-# define ASIO_HAS_ENUM_CLASS 1
-# endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
+# if (_MSC_VER >= 1900 && _MSVC_LANG >= 201402)
+# define ASIO_HAS_RETURN_TYPE_DEDUCTION 1
+# endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 201402)
# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_ENUM_CLASS)
-#endif // !defined(ASIO_HAS_ENUM_CLASS)
+# endif // !defined(ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
+#endif // !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
// Support concepts on compilers known to allow them.
#if !defined(ASIO_HAS_CONCEPTS)
@@ -464,6 +251,17 @@
# endif // !defined(ASIO_DISABLE_CONCEPTS)
#endif // !defined(ASIO_HAS_CONCEPTS)
+// Support concepts on compilers known to allow them.
+#if !defined(ASIO_HAS_STD_CONCEPTS)
+# if !defined(ASIO_DISABLE_STD_CONCEPTS)
+# if defined(ASIO_HAS_CONCEPTS)
+# if (__cpp_lib_concepts >= 202002L)
+# define ASIO_HAS_STD_CONCEPTS 1
+# endif // (__cpp_concepts >= 202002L)
+# endif // defined(ASIO_HAS_CONCEPTS)
+# endif // !defined(ASIO_DISABLE_STD_CONCEPTS)
+#endif // !defined(ASIO_HAS_STD_CONCEPTS)
+
// Support template variables on compilers known to allow it.
#if !defined(ASIO_HAS_VARIABLE_TEMPLATES)
# if !defined(ASIO_DISABLE_VARIABLE_TEMPLATES)
@@ -549,67 +347,37 @@
# endif // !defined(ASIO_DISABLE_WORKING_EXPRESSION_SFINAE)
#endif // !defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-// Support ref-qualified functions on compilers known to allow it.
-#if !defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-# if !defined(ASIO_DISABLE_REF_QUALIFIED_FUNCTIONS)
-# if defined(__clang__)
-# if __has_feature(__cxx_reference_qualified_functions__)
-# define ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
-# endif // __has_feature(__cxx_reference_qualified_functions__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900)
-# define ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
-# endif // (_MSC_VER >= 1900)
+// Support for capturing parameter packs in lambdas.
+#if !defined(ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
+# if !defined(ASIO_DISABLE_VARIADIC_LAMBDA_CAPTURES)
+# if defined(__GNUC__)
+# if (__GNUC__ >= 6)
+# define ASIO_HAS_VARIADIC_LAMBDA_CAPTURES 1
+# endif // (__GNUC__ >= 6)
+# elif defined(ASIO_MSVC)
+# if (_MSVC_LANG >= 201103)
+# define ASIO_HAS_VARIADIC_LAMBDA_CAPTURES 1
+# endif // (_MSC_LANG >= 201103)
+# else // defined(ASIO_MSVC)
+# if (__cplusplus >= 201103)
+# define ASIO_HAS_VARIADIC_LAMBDA_CAPTURES 1
+# endif // (__cplusplus >= 201103)
# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_REF_QUALIFIED_FUNCTIONS)
-#endif // !defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-# if !defined(ASIO_LVALUE_REF_QUAL)
-# define ASIO_LVALUE_REF_QUAL &
-# endif // !defined(ASIO_LVALUE_REF_QUAL)
-# if !defined(ASIO_RVALUE_REF_QUAL)
-# define ASIO_RVALUE_REF_QUAL &&
-# endif // !defined(ASIO_RVALUE_REF_QUAL)
-#else // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-# if !defined(ASIO_LVALUE_REF_QUAL)
-# define ASIO_LVALUE_REF_QUAL
-# endif // !defined(ASIO_LVALUE_REF_QUAL)
-# if !defined(ASIO_RVALUE_REF_QUAL)
-# define ASIO_RVALUE_REF_QUAL
-# endif // !defined(ASIO_RVALUE_REF_QUAL)
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-// Support for the alignof operator.
-#if !defined(ASIO_HAS_ALIGNOF)
-# if !defined(ASIO_DISABLE_ALIGNOF)
-# if (__cplusplus >= 201103)
-# define ASIO_HAS_ALIGNOF 1
-# endif // (__cplusplus >= 201103)
-# endif // !defined(ASIO_DISABLE_ALIGNOF)
-#endif // !defined(ASIO_HAS_ALIGNOF)
+# endif // !defined(ASIO_DISABLE_VARIADIC_LAMBDA_CAPTURES)
+#endif // !defined(ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
-#if defined(ASIO_HAS_ALIGNOF)
-# define ASIO_ALIGNOF(T) alignof(T)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-# define ASIO_DEFAULT_ALIGN alignof(std::max_align_t)
-# else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-# define ASIO_DEFAULT_ALIGN alignof(max_align_t)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-# else // defined(__GNUC__)
+// Default alignment.
+#if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__)
+# define ASIO_DEFAULT_ALIGN __STDCPP_DEFAULT_NEW_ALIGNMENT__
+#elif defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
# define ASIO_DEFAULT_ALIGN alignof(std::max_align_t)
-# endif // defined(__GNUC__)
-#else // defined(ASIO_HAS_ALIGNOF)
-# define ASIO_ALIGNOF(T) 1
-# define ASIO_DEFAULT_ALIGN 1
-#endif // defined(ASIO_HAS_ALIGNOF)
+# else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
+# define ASIO_DEFAULT_ALIGN alignof(max_align_t)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
+#else // defined(__GNUC__)
+# define ASIO_DEFAULT_ALIGN alignof(std::max_align_t)
+#endif // defined(__GNUC__)
// Standard library support for aligned allocation.
#if !defined(ASIO_HAS_STD_ALIGNED_ALLOC)
@@ -617,208 +385,45 @@
# if (__cplusplus >= 201703)
# if defined(__clang__)
# if defined(ASIO_HAS_CLANG_LIBCXX)
-# if (_LIBCPP_STD_VER > 14) && defined(_LIBCPP_HAS_ALIGNED_ALLOC)
-# define ASIO_HAS_STD_ALIGNED_ALLOC 1
+# if (_LIBCPP_STD_VER > 14) && defined(_LIBCPP_HAS_ALIGNED_ALLOC) \
+ && !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__)
+# if defined(__APPLE__)
+# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+# if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
+# define ASIO_HAS_STD_ALIGNED_ALLOC 1
+# endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
+# elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+# if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
+# define ASIO_HAS_STD_ALIGNED_ALLOC 1
+# endif // (__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
+# elif defined(__TV_OS_VERSION_MIN_REQUIRED)
+# if (__TV_OS_VERSION_MIN_REQUIRED >= 130000)
+# define ASIO_HAS_STD_ALIGNED_ALLOC 1
+# endif // (__TV_OS_VERSION_MIN_REQUIRED >= 130000)
+# elif defined(__WATCH_OS_VERSION_MIN_REQUIRED)
+# if (__WATCH_OS_VERSION_MIN_REQUIRED >= 60000)
+# define ASIO_HAS_STD_ALIGNED_ALLOC 1
+# endif // (__WATCH_OS_VERSION_MIN_REQUIRED >= 60000)
+# endif // defined(__WATCH_OS_X_VERSION_MIN_REQUIRED)
+# else // defined(__APPLE__)
+# define ASIO_HAS_STD_ALIGNED_ALLOC 1
+# endif // defined(__APPLE__)
# endif // (_LIBCPP_STD_VER > 14) && defined(_LIBCPP_HAS_ALIGNED_ALLOC)
+ // && !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__)
# elif defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
# define ASIO_HAS_STD_ALIGNED_ALLOC 1
# endif // defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
# elif defined(__GNUC__)
-# if defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
-# define ASIO_HAS_STD_ALIGNED_ALLOC 1
-# endif // defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
+# if ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 7)
+# if defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
+# define ASIO_HAS_STD_ALIGNED_ALLOC 1
+# endif // defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
+# endif // ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 7)
# endif // defined(__GNUC__)
# endif // (__cplusplus >= 201703)
# endif // !defined(ASIO_DISABLE_STD_ALIGNED_ALLOC)
#endif // !defined(ASIO_HAS_STD_ALIGNED_ALLOC)
-// Standard library support for system errors.
-#if !defined(ASIO_HAS_STD_SYSTEM_ERROR)
-# if !defined(ASIO_DISABLE_STD_SYSTEM_ERROR)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_SYSTEM_ERROR 1
-# elif (__cplusplus >= 201103)
-# if __has_include(<system_error>)
-# define ASIO_HAS_STD_SYSTEM_ERROR 1
-# endif // __has_include(<system_error>)
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_SYSTEM_ERROR 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_SYSTEM_ERROR 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_SYSTEM_ERROR)
-#endif // !defined(ASIO_HAS_STD_SYSTEM_ERROR)
-
-// Compliant C++11 compilers put noexcept specifiers on error_category members.
-#if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
-# if defined(ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
-# define ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
-# elif defined(__clang__)
-# if __has_feature(__cxx_noexcept__)
-# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
-# endif // __has_feature(__cxx_noexcept__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# elif defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900)
-# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
-# endif // (_MSC_VER >= 1900)
-# endif // defined(ASIO_MSVC)
-# if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
-# define ASIO_ERROR_CATEGORY_NOEXCEPT
-# endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
-#endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
-
-// Standard library support for arrays.
-#if !defined(ASIO_HAS_STD_ARRAY)
-# if !defined(ASIO_DISABLE_STD_ARRAY)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_ARRAY 1
-# elif (__cplusplus >= 201103)
-# if __has_include(<array>)
-# define ASIO_HAS_STD_ARRAY 1
-# endif // __has_include(<array>)
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_ARRAY 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1600)
-# define ASIO_HAS_STD_ARRAY 1
-# endif // (_MSC_VER >= 1600)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_ARRAY)
-#endif // !defined(ASIO_HAS_STD_ARRAY)
-
-// Standard library support for shared_ptr and weak_ptr.
-#if !defined(ASIO_HAS_STD_SHARED_PTR)
-# if !defined(ASIO_DISABLE_STD_SHARED_PTR)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_SHARED_PTR 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_STD_SHARED_PTR 1
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_SHARED_PTR 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1600)
-# define ASIO_HAS_STD_SHARED_PTR 1
-# endif // (_MSC_VER >= 1600)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_SHARED_PTR)
-#endif // !defined(ASIO_HAS_STD_SHARED_PTR)
-
-// Standard library support for allocator_arg_t.
-#if !defined(ASIO_HAS_STD_ALLOCATOR_ARG)
-# if !defined(ASIO_DISABLE_STD_ALLOCATOR_ARG)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_ALLOCATOR_ARG 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_STD_ALLOCATOR_ARG 1
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_ALLOCATOR_ARG 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1600)
-# define ASIO_HAS_STD_ALLOCATOR_ARG 1
-# endif // (_MSC_VER >= 1600)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_ALLOCATOR_ARG)
-#endif // !defined(ASIO_HAS_STD_ALLOCATOR_ARG)
-
-// Standard library support for atomic operations.
-#if !defined(ASIO_HAS_STD_ATOMIC)
-# if !defined(ASIO_DISABLE_STD_ATOMIC)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_ATOMIC 1
-# elif (__cplusplus >= 201103)
-# if __has_include(<atomic>)
-# define ASIO_HAS_STD_ATOMIC 1
-# endif // __has_include(<atomic>)
-# elif defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
-# if (__clang_major__ >= 10)
-# if __has_include(<atomic>)
-# define ASIO_HAS_STD_ATOMIC 1
-# endif // __has_include(<atomic>)
-# endif // (__clang_major__ >= 10)
-# endif // defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_ATOMIC 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_ATOMIC 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_ATOMIC)
-#endif // !defined(ASIO_HAS_STD_ATOMIC)
-
-// Standard library support for chrono. Some standard libraries (such as the
-// libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x
-// drafts, rather than the eventually standardised name of steady_clock.
-#if !defined(ASIO_HAS_STD_CHRONO)
-# if !defined(ASIO_DISABLE_STD_CHRONO)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_CHRONO 1
-# elif (__cplusplus >= 201103)
-# if __has_include(<chrono>)
-# define ASIO_HAS_STD_CHRONO 1
-# endif // __has_include(<chrono>)
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_CHRONO 1
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
-# define ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_CHRONO 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_CHRONO)
-#endif // !defined(ASIO_HAS_STD_CHRONO)
-
// Boost support for chrono.
#if !defined(ASIO_HAS_BOOST_CHRONO)
# if !defined(ASIO_DISABLE_BOOST_CHRONO)
@@ -844,277 +449,34 @@
# endif // !defined(ASIO_DISABLE_BOOST_DATE_TIME)
#endif // !defined(ASIO_HAS_BOOST_DATE_TIME)
-// Standard library support for addressof.
-#if !defined(ASIO_HAS_STD_ADDRESSOF)
-# if !defined(ASIO_DISABLE_STD_ADDRESSOF)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_ADDRESSOF 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_STD_ADDRESSOF 1
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_ADDRESSOF 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_ADDRESSOF 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_ADDRESSOF)
-#endif // !defined(ASIO_HAS_STD_ADDRESSOF)
+// Boost support for the Coroutine library.
+#if !defined(ASIO_HAS_BOOST_COROUTINE)
+# if !defined(ASIO_DISABLE_BOOST_COROUTINE)
+# define ASIO_HAS_BOOST_COROUTINE 1
+# endif // !defined(ASIO_DISABLE_BOOST_COROUTINE)
+#endif // !defined(ASIO_HAS_BOOST_COROUTINE)
-// Standard library support for the function class.
-#if !defined(ASIO_HAS_STD_FUNCTION)
-# if !defined(ASIO_DISABLE_STD_FUNCTION)
+// Boost support for the Context library's fibers.
+#if !defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+# if !defined(ASIO_DISABLE_BOOST_CONTEXT_FIBER)
# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_FUNCTION 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_STD_FUNCTION 1
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_FUNCTION 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_FUNCTION 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_FUNCTION)
-#endif // !defined(ASIO_HAS_STD_FUNCTION)
-
-// Standard library support for the reference_wrapper class.
-#if !defined(ASIO_HAS_STD_REFERENCE_WRAPPER)
-# if !defined(ASIO_DISABLE_STD_REFERENCE_WRAPPER)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_REFERENCE_WRAPPER 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_STD_REFERENCE_WRAPPER 1
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_REFERENCE_WRAPPER 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_REFERENCE_WRAPPER 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_REFERENCE_WRAPPER)
-#endif // !defined(ASIO_HAS_STD_REFERENCE_WRAPPER)
-
-// Standard library support for type traits.
-#if !defined(ASIO_HAS_STD_TYPE_TRAITS)
-# if !defined(ASIO_DISABLE_STD_TYPE_TRAITS)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_TYPE_TRAITS 1
-# elif (__cplusplus >= 201103)
-# if __has_include(<type_traits>)
-# define ASIO_HAS_STD_TYPE_TRAITS 1
-# endif // __has_include(<type_traits>)
+# if (__cplusplus >= 201103)
+# define ASIO_HAS_BOOST_CONTEXT_FIBER 1
# endif // (__cplusplus >= 201103)
# elif defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_TYPE_TRAITS 1
+# define ASIO_HAS_BOOST_CONTEXT_FIBER 1
# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_TYPE_TRAITS 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_TYPE_TRAITS)
-#endif // !defined(ASIO_HAS_STD_TYPE_TRAITS)
-
-// Standard library support for the nullptr_t type.
-#if !defined(ASIO_HAS_NULLPTR)
-# if !defined(ASIO_DISABLE_NULLPTR)
-# if defined(__clang__)
-# if __has_feature(__cxx_nullptr__)
-# define ASIO_HAS_NULLPTR 1
-# endif // __has_feature(__cxx_nullptr__)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_NULLPTR 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_NULLPTR 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_NULLPTR)
-#endif // !defined(ASIO_HAS_NULLPTR)
-
-// Standard library support for the C++11 allocator additions.
-#if !defined(ASIO_HAS_CXX11_ALLOCATORS)
-# if !defined(ASIO_DISABLE_CXX11_ALLOCATORS)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_CXX11_ALLOCATORS 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_CXX11_ALLOCATORS 1
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_CXX11_ALLOCATORS 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1800)
-# define ASIO_HAS_CXX11_ALLOCATORS 1
-# endif // (_MSC_VER >= 1800)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_CXX11_ALLOCATORS)
-#endif // !defined(ASIO_HAS_CXX11_ALLOCATORS)
-
-// Standard library support for the cstdint header.
-#if !defined(ASIO_HAS_CSTDINT)
-# if !defined(ASIO_DISABLE_CSTDINT)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_CSTDINT 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_CSTDINT 1
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_CSTDINT 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_CSTDINT 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_CSTDINT)
-#endif // !defined(ASIO_HAS_CSTDINT)
-
-// Standard library support for the thread class.
-#if !defined(ASIO_HAS_STD_THREAD)
-# if !defined(ASIO_DISABLE_STD_THREAD)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_THREAD 1
-# elif (__cplusplus >= 201103)
-# if __has_include(<thread>)
-# define ASIO_HAS_STD_THREAD 1
-# endif // __has_include(<thread>)
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_THREAD 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_THREAD 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_THREAD)
-#endif // !defined(ASIO_HAS_STD_THREAD)
-
-// Standard library support for the mutex and condition variable classes.
-#if !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-# if !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
-# elif (__cplusplus >= 201103)
-# if __has_include(<mutex>)
-# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
-# endif // __has_include(<mutex>)
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
-#endif // !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-
-// Standard library support for the call_once function.
-#if !defined(ASIO_HAS_STD_CALL_ONCE)
-# if !defined(ASIO_DISABLE_STD_CALL_ONCE)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_CALL_ONCE 1
-# elif (__cplusplus >= 201103)
-# if __has_include(<mutex>)
-# define ASIO_HAS_STD_CALL_ONCE 1
-# endif // __has_include(<mutex>)
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_CALL_ONCE 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_CALL_ONCE 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_CALL_ONCE)
-#endif // !defined(ASIO_HAS_STD_CALL_ONCE)
-
-// Standard library support for futures.
-#if !defined(ASIO_HAS_STD_FUTURE)
-# if !defined(ASIO_DISABLE_STD_FUTURE)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_FUTURE 1
-# elif (__cplusplus >= 201103)
-# if __has_include(<future>)
-# define ASIO_HAS_STD_FUTURE 1
-# endif // __has_include(<future>)
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_FUTURE 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_FUTURE 1
-# endif // (_MSC_VER >= 1700)
+# if (_MSVC_LANG >= 201103)
+# define ASIO_HAS_BOOST_CONTEXT_FIBER 1
+# endif // (_MSC_LANG >= 201103)
# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_FUTURE)
-#endif // !defined(ASIO_HAS_STD_FUTURE)
+# endif // !defined(ASIO_DISABLE_BOOST_CONTEXT_FIBER)
+#endif // !defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
// Standard library support for std::string_view.
#if !defined(ASIO_HAS_STD_STRING_VIEW)
@@ -1187,24 +549,6 @@
# endif // !defined(ASIO_DISABLE_STRING_VIEW)
#endif // !defined(ASIO_HAS_STRING_VIEW)
-// Standard library support for iostream move construction and assignment.
-#if !defined(ASIO_HAS_STD_IOSTREAM_MOVE)
-# if !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE)
-# if defined(__GNUC__)
-# if (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_IOSTREAM_MOVE 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_IOSTREAM_MOVE 1
-# endif // (_MSC_VER >= 1700)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE)
-#endif // !defined(ASIO_HAS_STD_IOSTREAM_MOVE)
-
// Standard library has invoke_result (which supersedes result_of).
#if !defined(ASIO_HAS_STD_INVOKE_RESULT)
# if !defined(ASIO_DISABLE_STD_INVOKE_RESULT)
@@ -1212,58 +556,14 @@
# if (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
# define ASIO_HAS_STD_INVOKE_RESULT 1
# endif // (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
+# else // defined(ASIO_MSVC)
+# if (__cplusplus >= 201703)
+# define ASIO_HAS_STD_INVOKE_RESULT 1
+# endif // (__cplusplus >= 201703)
# endif // defined(ASIO_MSVC)
# endif // !defined(ASIO_DISABLE_STD_INVOKE_RESULT)
#endif // !defined(ASIO_HAS_STD_INVOKE_RESULT)
-// Standard library support for std::exception_ptr and std::current_exception.
-#if !defined(ASIO_HAS_STD_EXCEPTION_PTR)
-# if !defined(ASIO_DISABLE_STD_EXCEPTION_PTR)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_EXCEPTION_PTR 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_STD_EXCEPTION_PTR 1
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_EXCEPTION_PTR 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1800)
-# define ASIO_HAS_STD_EXCEPTION_PTR 1
-# endif // (_MSC_VER >= 1800)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_EXCEPTION_PTR)
-#endif // !defined(ASIO_HAS_STD_EXCEPTION_PTR)
-
-// Standard library support for std::nested_exception.
-#if !defined(ASIO_HAS_STD_NESTED_EXCEPTION)
-# if !defined(ASIO_DISABLE_STD_NESTED_EXCEPTION)
-# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_NESTED_EXCEPTION 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_STD_NESTED_EXCEPTION 1
-# endif // (__cplusplus >= 201103)
-# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_NESTED_EXCEPTION 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1900)
-# define ASIO_HAS_STD_NESTED_EXCEPTION 1
-# endif // (_MSC_VER >= 1900)
-# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_NESTED_EXCEPTION)
-#endif // !defined(ASIO_HAS_STD_NESTED_EXCEPTION)
-
// Standard library support for std::any.
#if !defined(ASIO_HAS_STD_ANY)
# if !defined(ASIO_DISABLE_STD_ANY)
@@ -1288,6 +588,30 @@
# endif // !defined(ASIO_DISABLE_STD_ANY)
#endif // !defined(ASIO_HAS_STD_ANY)
+// Standard library support for std::variant.
+#if !defined(ASIO_HAS_STD_VARIANT)
+# if !defined(ASIO_DISABLE_STD_VARIANT)
+# if defined(__clang__)
+# if (__cplusplus >= 201703)
+# if __has_include(<variant>)
+# define ASIO_HAS_STD_VARIANT 1
+# endif // __has_include(<variant>)
+# endif // (__cplusplus >= 201703)
+# elif defined(__GNUC__)
+# if (__GNUC__ >= 7)
+# if (__cplusplus >= 201703)
+# define ASIO_HAS_STD_VARIANT 1
+# endif // (__cplusplus >= 201703)
+# endif // (__GNUC__ >= 7)
+# endif // defined(__GNUC__)
+# if defined(ASIO_MSVC)
+# if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
+# define ASIO_HAS_STD_VARIANT 1
+# endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
+# endif // defined(ASIO_MSVC)
+# endif // !defined(ASIO_DISABLE_STD_VARIANT)
+#endif // !defined(ASIO_HAS_STD_VARIANT)
+
// Standard library support for std::source_location.
#if !defined(ASIO_HAS_STD_SOURCE_LOCATION)
# if !defined(ASIO_DISABLE_STD_SOURCE_LOCATION)
@@ -1319,6 +643,50 @@
# endif // !defined(ASIO_DISABLE_SOURCE_LOCATION)
#endif // !defined(ASIO_HAS_SOURCE_LOCATION)
+// Boost support for source_location and system errors.
+#if !defined(ASIO_HAS_BOOST_SOURCE_LOCATION)
+# if !defined(ASIO_DISABLE_BOOST_SOURCE_LOCATION)
+# if defined(ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 107900)
+# define ASIO_HAS_BOOST_SOURCE_LOCATION 1
+# endif // defined(ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 107900)
+# endif // !defined(ASIO_DISABLE_BOOST_SOURCE_LOCATION)
+#endif // !defined(ASIO_HAS_BOOST_SOURCE_LOCATION)
+
+// Helper macros for working with Boost source locations.
+#if defined(ASIO_HAS_BOOST_SOURCE_LOCATION)
+# define ASIO_SOURCE_LOCATION_PARAM \
+ , const boost::source_location& loc
+# define ASIO_SOURCE_LOCATION_DEFAULTED_PARAM \
+ , const boost::source_location& loc = BOOST_CURRENT_LOCATION
+# define ASIO_SOURCE_LOCATION_ARG , loc
+#else // if defined(ASIO_HAS_BOOST_SOURCE_LOCATION)
+# define ASIO_SOURCE_LOCATION_PARAM
+# define ASIO_SOURCE_LOCATION_DEFAULTED_PARAM
+# define ASIO_SOURCE_LOCATION_ARG
+#endif // if defined(ASIO_HAS_BOOST_SOURCE_LOCATION)
+
+// Standard library support for std::index_sequence.
+#if !defined(ASIO_HAS_STD_INDEX_SEQUENCE)
+# if !defined(ASIO_DISABLE_STD_INDEX_SEQUENCE)
+# if defined(__clang__)
+# if (__cplusplus >= 201402)
+# define ASIO_HAS_STD_INDEX_SEQUENCE 1
+# endif // (__cplusplus >= 201402)
+# elif defined(__GNUC__)
+# if (__GNUC__ >= 7)
+# if (__cplusplus >= 201402)
+# define ASIO_HAS_STD_INDEX_SEQUENCE 1
+# endif // (__cplusplus >= 201402)
+# endif // (__GNUC__ >= 7)
+# endif // defined(__GNUC__)
+# if defined(ASIO_MSVC)
+# if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201402)
+# define ASIO_HAS_STD_INDEX_SEQUENCE 1
+# endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201402)
+# endif // defined(ASIO_MSVC)
+# endif // !defined(ASIO_DISABLE_STD_INDEX_SEQUENCE)
+#endif // !defined(ASIO_HAS_STD_INDEX_SEQUENCE)
+
// Windows App target. Windows but with a limited API.
#if !defined(ASIO_WINDOWS_APP)
# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
@@ -1454,7 +822,7 @@
# include <unistd.h>
#endif // defined(ASIO_HAS_UNISTD_H)
-// Linux: epoll, eventfd and timerfd.
+// Linux: epoll, eventfd, timerfd and io_uring.
#if defined(__linux__)
# include <linux/version.h>
# if !defined(ASIO_HAS_EPOLL)
@@ -1478,8 +846,20 @@
# endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
# endif // defined(ASIO_HAS_EPOLL)
# endif // !defined(ASIO_HAS_TIMERFD)
+# if defined(ASIO_HAS_IO_URING)
+# if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
+# error Linux kernel 5.10 or later is required to support io_uring
+# endif // LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
+# endif // defined(ASIO_HAS_IO_URING)
#endif // defined(__linux__)
+// Linux: io_uring is used instead of epoll.
+#if !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# if !defined(ASIO_HAS_EPOLL) && defined(ASIO_HAS_IO_URING)
+# define ASIO_HAS_IO_URING_AS_DEFAULT 1
+# endif // !defined(ASIO_HAS_EPOLL) && defined(ASIO_HAS_IO_URING)
+#endif // !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+
// Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
#if (defined(__MACH__) && defined(__APPLE__)) \
|| defined(__FreeBSD__) \
@@ -1581,6 +961,34 @@
# endif // !defined(ASIO_DISABLE_LOCAL_SOCKETS)
#endif // !defined(ASIO_HAS_LOCAL_SOCKETS)
+// Files.
+#if !defined(ASIO_HAS_FILE)
+# if !defined(ASIO_DISABLE_FILE)
+# if defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
+# define ASIO_HAS_FILE 1
+# elif defined(ASIO_HAS_IO_URING)
+# define ASIO_HAS_FILE 1
+# endif // defined(ASIO_HAS_IO_URING)
+# endif // !defined(ASIO_DISABLE_FILE)
+#endif // !defined(ASIO_HAS_FILE)
+
+// Pipes.
+#if !defined(ASIO_HAS_PIPE)
+# if defined(ASIO_HAS_IOCP) \
+ || !defined(ASIO_WINDOWS) \
+ && !defined(ASIO_WINDOWS_RUNTIME) \
+ && !defined(__CYGWIN__)
+# if !defined(__SYMBIAN32__)
+# if !defined(ASIO_DISABLE_PIPE)
+# define ASIO_HAS_PIPE 1
+# endif // !defined(ASIO_DISABLE_PIPE)
+# endif // !defined(__SYMBIAN32__)
+# endif // defined(ASIO_HAS_IOCP)
+ // || !defined(ASIO_WINDOWS)
+ // && !defined(ASIO_WINDOWS_RUNTIME)
+ // && !defined(__CYGWIN__)
+#endif // !defined(ASIO_HAS_PIPE)
+
// Can use sigaction() instead of signal().
#if !defined(ASIO_HAS_SIGACTION)
# if !defined(ASIO_DISABLE_SIGACTION)
@@ -1782,7 +1190,7 @@
# endif // !defined(ASIO_DISABLE_HANDLER_HOOKS)
#endif // !defined(ASIO_HAS_HANDLER_HOOKS)
-// Support for the __thread keyword extension.
+// Support for the __thread keyword extension, or equivalent.
#if !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
# if defined(__linux__)
# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
@@ -1804,6 +1212,22 @@
# define ASIO_THREAD_KEYWORD __declspec(thread)
# endif // (_MSC_VER >= 1700)
# endif // defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME)
+# if defined(__APPLE__)
+# if defined(__clang__)
+# if defined(__apple_build_version__)
+# define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
+# define ASIO_THREAD_KEYWORD __thread
+# endif // defined(__apple_build_version__)
+# endif // defined(__clang__)
+# endif // defined(__APPLE__)
+# if !defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION)
+# if defined(ASIO_HAS_BOOST_CONFIG)
+# if !defined(BOOST_NO_CXX11_THREAD_LOCAL)
+# define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
+# define ASIO_THREAD_KEYWORD thread_local
+# endif // !defined(BOOST_NO_CXX11_THREAD_LOCAL)
+# endif // defined(ASIO_HAS_BOOST_CONFIG)
+# endif // !defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION)
#endif // !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
#if !defined(ASIO_THREAD_KEYWORD)
# define ASIO_THREAD_KEYWORD __thread
@@ -1857,6 +1281,22 @@
# define ASIO_UNUSED_VARIABLE
#endif // !defined(ASIO_UNUSED_VARIABLE)
+// Helper macro to tell the optimiser what may be assumed to be true.
+#if defined(ASIO_MSVC)
+# define ASIO_ASSUME(expr) __assume(expr)
+#elif defined(__clang__)
+# if __has_builtin(__builtin_assume)
+# define ASIO_ASSUME(expr) __builtin_assume(expr)
+# endif // __has_builtin(__builtin_assume)
+#elif defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# define ASIO_ASSUME(expr) if (expr) {} else { __builtin_unreachable(); }
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+#endif // defined(__GNUC__)
+#if !defined(ASIO_ASSUME)
+# define ASIO_ASSUME(expr) (void)0
+#endif // !defined(ASIO_ASSUME)
+
// Support the co_await keyword on compilers known to allow it.
#if !defined(ASIO_HAS_CO_AWAIT)
# if !defined(ASIO_DISABLE_CO_AWAIT)
@@ -1869,11 +1309,23 @@
# endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
# endif // (_MSC_FULL_VER >= 190023506)
# elif defined(__clang__)
-# if (__cplusplus >= 201703) && defined(__cpp_coroutines) && (__cpp_coroutines >= 201703)
-# if __has_include(<experimental/coroutine>)
-# define ASIO_HAS_CO_AWAIT 1
-# endif // __has_include(<experimental/coroutine>)
-# endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
+# if (__clang_major__ >= 14)
+# if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
+# if __has_include(<coroutine>)
+# define ASIO_HAS_CO_AWAIT 1
+# endif // __has_include(<coroutine>)
+# elif (__cplusplus >= 201703) && defined(__cpp_coroutines) && (__cpp_coroutines >= 201703)
+# if __has_include(<experimental/coroutine>)
+# define ASIO_HAS_CO_AWAIT 1
+# endif // __has_include(<experimental/coroutine>)
+# endif // (__cplusplus >= 201703) && defined(__cpp_coroutines) && (__cpp_coroutines >= 201703)
+# else // (__clang_major__ >= 14)
+# if (__cplusplus >= 201703) && defined(__cpp_coroutines) && (__cpp_coroutines >= 201703)
+# if __has_include(<experimental/coroutine>)
+# define ASIO_HAS_CO_AWAIT 1
+# endif // __has_include(<experimental/coroutine>)
+# endif // (__cplusplus >= 201703) && defined(__cpp_coroutines) && (__cpp_coroutines >= 201703)
+# endif // (__clang_major__ >= 14)
# elif defined(__GNUC__)
# if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
# if __has_include(<coroutine>)
@@ -1891,8 +1343,15 @@
# if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705)
# define ASIO_HAS_STD_COROUTINE 1
# endif // (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705)
-# endif // defined(ASIO_MSVC)
-# if defined(__GNUC__)
+# elif defined(__clang__)
+# if (__clang_major__ >= 14)
+# if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
+# if __has_include(<coroutine>)
+# define ASIO_HAS_STD_COROUTINE 1
+# endif // __has_include(<coroutine>)
+# endif // (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
+# endif // (__clang_major__ >= 14)
+# elif defined(__GNUC__)
# if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
# if __has_include(<coroutine>)
# define ASIO_HAS_STD_COROUTINE 1
@@ -1927,28 +1386,37 @@
# endif // defined(_POSIX_VERSION)
#endif // !defined(ASIO_HAS_MSG_NOSIGNAL)
-// Standard library support for std::hash.
-#if !defined(ASIO_HAS_STD_HASH)
-# if !defined(ASIO_DISABLE_STD_HASH)
+// Standard library support for std::to_address.
+#if !defined(ASIO_HAS_STD_TO_ADDRESS)
+# if !defined(ASIO_DISABLE_STD_TO_ADDRESS)
# if defined(__clang__)
-# if defined(ASIO_HAS_CLANG_LIBCXX)
-# define ASIO_HAS_STD_HASH 1
-# elif (__cplusplus >= 201103)
-# define ASIO_HAS_STD_HASH 1
-# endif // (__cplusplus >= 201103)
+# if (__cplusplus >= 202002)
+# define ASIO_HAS_STD_TO_ADDRESS 1
+# endif // (__cplusplus >= 202002)
# elif defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
-# if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define ASIO_HAS_STD_HASH 1
-# endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
+# if (__GNUC__ >= 8)
+# if (__cplusplus >= 202002)
+# define ASIO_HAS_STD_TO_ADDRESS 1
+# endif // (__cplusplus >= 202002)
+# endif // (__GNUC__ >= 8)
# endif // defined(__GNUC__)
# if defined(ASIO_MSVC)
-# if (_MSC_VER >= 1700)
-# define ASIO_HAS_STD_HASH 1
-# endif // (_MSC_VER >= 1700)
+# if (_MSC_VER >= 1922) && (_MSVC_LANG >= 202002)
+# define ASIO_HAS_STD_TO_ADDRESS 1
+# endif // (_MSC_VER >= 1922) && (_MSVC_LANG >= 202002)
# endif // defined(ASIO_MSVC)
-# endif // !defined(ASIO_DISABLE_STD_HASH)
-#endif // !defined(ASIO_HAS_STD_HASH)
+# endif // !defined(ASIO_DISABLE_STD_TO_ADDRESS)
+#endif // !defined(ASIO_HAS_STD_TO_ADDRESS)
+
+// Standard library support for snprintf.
+#if !defined(ASIO_HAS_SNPRINTF)
+# if !defined(ASIO_DISABLE_SNPRINTF)
+# if defined(__apple_build_version__)
+# if (__clang_major__ >= 14)
+# define ASIO_HAS_SNPRINTF 1
+# endif // (__clang_major__ >= 14)
+# endif // defined(__apple_build_version__)
+# endif // !defined(ASIO_DISABLE_SNPRINTF)
+#endif // !defined(ASIO_HAS_SNPRINTF)
#endif // ASIO_DETAIL_CONFIG_HPP
diff --git a/3rdparty/asio/include/asio/detail/consuming_buffers.hpp b/3rdparty/asio/include/asio/detail/consuming_buffers.hpp
index 0d99093a4dd..8af95aab769 100644
--- a/3rdparty/asio/include/asio/detail/consuming_buffers.hpp
+++ b/3rdparty/asio/include/asio/detail/consuming_buffers.hpp
@@ -2,7 +2,7 @@
// detail/consuming_buffers.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,6 +20,7 @@
#include "asio/buffer.hpp"
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/limits.hpp"
+#include "asio/registered_buffer.hpp"
#include "asio/detail/push_options.hpp"
@@ -34,21 +35,17 @@ struct prepared_buffers_max
};
template <typename Elem, std::size_t N>
-struct prepared_buffers_max<boost::array<Elem, N> >
+struct prepared_buffers_max<boost::array<Elem, N>>
{
enum { value = N };
};
-#if defined(ASIO_HAS_STD_ARRAY)
-
template <typename Elem, std::size_t N>
-struct prepared_buffers_max<std::array<Elem, N> >
+struct prepared_buffers_max<std::array<Elem, N>>
{
enum { value = N };
};
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
// A buffer sequence used to represent a subsequence of the buffers.
template <typename Buffer, std::size_t MaxBuffers>
struct prepared_buffers
@@ -269,6 +266,42 @@ public:
#endif // !defined(ASIO_NO_DEPRECATED)
+template <>
+class consuming_buffers<mutable_buffer,
+ mutable_registered_buffer, const mutable_buffer*>
+ : public consuming_single_buffer<mutable_registered_buffer>
+{
+public:
+ explicit consuming_buffers(const mutable_registered_buffer& buffer)
+ : consuming_single_buffer<mutable_registered_buffer>(buffer)
+ {
+ }
+};
+
+template <>
+class consuming_buffers<const_buffer,
+ mutable_registered_buffer, const mutable_buffer*>
+ : public consuming_single_buffer<mutable_registered_buffer>
+{
+public:
+ explicit consuming_buffers(const mutable_registered_buffer& buffer)
+ : consuming_single_buffer<mutable_registered_buffer>(buffer)
+ {
+ }
+};
+
+template <>
+class consuming_buffers<const_buffer,
+ const_registered_buffer, const const_buffer*>
+ : public consuming_single_buffer<const_registered_buffer>
+{
+public:
+ explicit consuming_buffers(const const_registered_buffer& buffer)
+ : consuming_single_buffer<const_registered_buffer>(buffer)
+ {
+ }
+};
+
template <typename Buffer, typename Elem>
class consuming_buffers<Buffer, boost::array<Elem, 2>,
typename boost::array<Elem, 2>::const_iterator>
@@ -319,8 +352,6 @@ private:
std::size_t total_consumed_;
};
-#if defined(ASIO_HAS_STD_ARRAY)
-
template <typename Buffer, typename Elem>
class consuming_buffers<Buffer, std::array<Elem, 2>,
typename std::array<Elem, 2>::const_iterator>
@@ -371,8 +402,6 @@ private:
std::size_t total_consumed_;
};
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
// Specialisation for null_buffers to ensure that the null_buffers type is
// always passed through to the underlying read or write operation.
template <typename Buffer>
diff --git a/3rdparty/asio/include/asio/detail/cstddef.hpp b/3rdparty/asio/include/asio/detail/cstddef.hpp
index e9fd2d23b83..15ec42df5f3 100644
--- a/3rdparty/asio/include/asio/detail/cstddef.hpp
+++ b/3rdparty/asio/include/asio/detail/cstddef.hpp
@@ -2,7 +2,7 @@
// detail/cstddef.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,11 +20,7 @@
namespace asio {
-#if defined(ASIO_HAS_NULLPTR)
using std::nullptr_t;
-#else // defined(ASIO_HAS_NULLPTR)
-struct nullptr_t {};
-#endif // defined(ASIO_HAS_NULLPTR)
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/cstdint.hpp b/3rdparty/asio/include/asio/detail/cstdint.hpp
index d29929b711c..a696e34c8ae 100644
--- a/3rdparty/asio/include/asio/detail/cstdint.hpp
+++ b/3rdparty/asio/include/asio/detail/cstdint.hpp
@@ -2,7 +2,7 @@
// detail/cstdint.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,16 +16,10 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_CSTDINT)
-# include <cstdint>
-#else // defined(ASIO_HAS_CSTDINT)
-# include <boost/cstdint.hpp>
-#endif // defined(ASIO_HAS_CSTDINT)
+#include <cstdint>
namespace asio {
-#if defined(ASIO_HAS_CSTDINT)
using std::int16_t;
using std::int_least16_t;
using std::uint16_t;
@@ -38,22 +32,8 @@ using std::int64_t;
using std::int_least64_t;
using std::uint64_t;
using std::uint_least64_t;
+using std::uintptr_t;
using std::uintmax_t;
-#else // defined(ASIO_HAS_CSTDINT)
-using boost::int16_t;
-using boost::int_least16_t;
-using boost::uint16_t;
-using boost::uint_least16_t;
-using boost::int32_t;
-using boost::int_least32_t;
-using boost::uint32_t;
-using boost::uint_least32_t;
-using boost::int64_t;
-using boost::int_least64_t;
-using boost::uint64_t;
-using boost::uint_least64_t;
-using boost::uintmax_t;
-#endif // defined(ASIO_HAS_CSTDINT)
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/date_time_fwd.hpp b/3rdparty/asio/include/asio/detail/date_time_fwd.hpp
index 1b210228de8..a586fbea713 100644
--- a/3rdparty/asio/include/asio/detail/date_time_fwd.hpp
+++ b/3rdparty/asio/include/asio/detail/date_time_fwd.hpp
@@ -2,7 +2,7 @@
// detail/date_time_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/deadline_timer_service.hpp b/3rdparty/asio/include/asio/detail/deadline_timer_service.hpp
index a46e5653ef2..bd99a6e910c 100644
--- a/3rdparty/asio/include/asio/detail/deadline_timer_service.hpp
+++ b/3rdparty/asio/include/asio/detail/deadline_timer_service.hpp
@@ -2,7 +2,7 @@
// detail/deadline_timer_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -45,7 +45,7 @@ namespace detail {
template <typename Time_Traits>
class deadline_timer_service
- : public execution_context_service_base<deadline_timer_service<Time_Traits> >
+ : public execution_context_service_base<deadline_timer_service<Time_Traits>>
{
public:
// The time type.
@@ -67,7 +67,7 @@ public:
// Constructor.
deadline_timer_service(execution_context& context)
: execution_context_service_base<
- deadline_timer_service<Time_Traits> >(context),
+ deadline_timer_service<Time_Traits>>(context),
scheduler_(asio::use_service<timer_scheduler>(context))
{
scheduler_.init_task();
@@ -247,7 +247,7 @@ public:
void async_wait(implementation_type& impl,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
diff --git a/3rdparty/asio/include/asio/detail/dependent_type.hpp b/3rdparty/asio/include/asio/detail/dependent_type.hpp
index bcdfff3c1d3..fde0e4a6eb5 100644
--- a/3rdparty/asio/include/asio/detail/dependent_type.hpp
+++ b/3rdparty/asio/include/asio/detail/dependent_type.hpp
@@ -2,7 +2,7 @@
// detail/dependent_type.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/descriptor_ops.hpp b/3rdparty/asio/include/asio/detail/descriptor_ops.hpp
index 384aa8d1d13..c001696a9fd 100644
--- a/3rdparty/asio/include/asio/detail/descriptor_ops.hpp
+++ b/3rdparty/asio/include/asio/detail/descriptor_ops.hpp
@@ -2,7 +2,7 @@
// detail/descriptor_ops.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -24,6 +24,7 @@
#include <cstddef>
#include "asio/error.hpp"
#include "asio/error_code.hpp"
+#include "asio/detail/cstdint.hpp"
#include "asio/detail/socket_types.hpp"
#include "asio/detail/push_options.hpp"
@@ -55,7 +56,7 @@ inline void get_last_error(
{
if (!is_error_condition)
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
else
{
@@ -67,6 +68,9 @@ inline void get_last_error(
ASIO_DECL int open(const char* path, int flags,
asio::error_code& ec);
+ASIO_DECL int open(const char* path, int flags, unsigned mode,
+ asio::error_code& ec);
+
ASIO_DECL int close(int d, state_type& state,
asio::error_code& ec);
@@ -105,6 +109,42 @@ ASIO_DECL bool non_blocking_write1(int d,
const void* data, std::size_t size,
asio::error_code& ec, std::size_t& bytes_transferred);
+#if defined(ASIO_HAS_FILE)
+
+ASIO_DECL std::size_t sync_read_at(int d, state_type state,
+ uint64_t offset, buf* bufs, std::size_t count, bool all_empty,
+ asio::error_code& ec);
+
+ASIO_DECL std::size_t sync_read_at1(int d, state_type state,
+ uint64_t offset, void* data, std::size_t size,
+ asio::error_code& ec);
+
+ASIO_DECL bool non_blocking_read_at(int d, uint64_t offset,
+ buf* bufs, std::size_t count, asio::error_code& ec,
+ std::size_t& bytes_transferred);
+
+ASIO_DECL bool non_blocking_read_at1(int d, uint64_t offset,
+ void* data, std::size_t size, asio::error_code& ec,
+ std::size_t& bytes_transferred);
+
+ASIO_DECL std::size_t sync_write_at(int d, state_type state,
+ uint64_t offset, const buf* bufs, std::size_t count, bool all_empty,
+ asio::error_code& ec);
+
+ASIO_DECL std::size_t sync_write_at1(int d, state_type state,
+ uint64_t offset, const void* data, std::size_t size,
+ asio::error_code& ec);
+
+ASIO_DECL bool non_blocking_write_at(int d,
+ uint64_t offset, const buf* bufs, std::size_t count,
+ asio::error_code& ec, std::size_t& bytes_transferred);
+
+ASIO_DECL bool non_blocking_write_at1(int d,
+ uint64_t offset, const void* data, std::size_t size,
+ asio::error_code& ec, std::size_t& bytes_transferred);
+
+#endif // defined(ASIO_HAS_FILE)
+
ASIO_DECL int ioctl(int d, state_type& state, long cmd,
ioctl_arg_type* arg, asio::error_code& ec);
diff --git a/3rdparty/asio/include/asio/detail/descriptor_read_op.hpp b/3rdparty/asio/include/asio/detail/descriptor_read_op.hpp
index edc8d34022e..415490cb8a5 100644
--- a/3rdparty/asio/include/asio/detail/descriptor_read_op.hpp
+++ b/3rdparty/asio/include/asio/detail/descriptor_read_op.hpp
@@ -2,7 +2,7 @@
// detail/descriptor_read_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -26,6 +26,7 @@
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
+#include "asio/dispatch.hpp"
#include "asio/detail/push_options.hpp"
@@ -48,6 +49,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
descriptor_read_op_base* o(static_cast<descriptor_read_op_base*>(base));
typedef buffer_sequence_adapter<asio::mutable_buffer,
@@ -85,6 +87,9 @@ class descriptor_read_op
: public descriptor_read_op_base<MutableBufferSequence>
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(descriptor_read_op);
descriptor_read_op(const asio::error_code& success_ec,
@@ -92,7 +97,7 @@ public:
Handler& handler, const IoExecutor& io_ex)
: descriptor_read_op_base<MutableBufferSequence>(success_ec,
descriptor, buffers, &descriptor_read_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -102,6 +107,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
descriptor_read_op* o(static_cast<descriptor_read_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -109,9 +115,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -133,6 +141,38 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ descriptor_read_op* o(static_cast<descriptor_read_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/descriptor_write_op.hpp b/3rdparty/asio/include/asio/detail/descriptor_write_op.hpp
index c2bc8675f58..ed1814e7e39 100644
--- a/3rdparty/asio/include/asio/detail/descriptor_write_op.hpp
+++ b/3rdparty/asio/include/asio/detail/descriptor_write_op.hpp
@@ -2,7 +2,7 @@
// detail/descriptor_write_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -48,6 +48,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
descriptor_write_op_base* o(static_cast<descriptor_write_op_base*>(base));
typedef buffer_sequence_adapter<asio::const_buffer,
@@ -85,6 +86,9 @@ class descriptor_write_op
: public descriptor_write_op_base<ConstBufferSequence>
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(descriptor_write_op);
descriptor_write_op(const asio::error_code& success_ec,
@@ -92,7 +96,7 @@ public:
Handler& handler, const IoExecutor& io_ex)
: descriptor_write_op_base<ConstBufferSequence>(success_ec,
descriptor, buffers, &descriptor_write_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -102,6 +106,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
descriptor_write_op* o(static_cast<descriptor_write_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -109,9 +114,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -133,6 +140,38 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ descriptor_write_op* o(static_cast<descriptor_write_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/dev_poll_reactor.hpp b/3rdparty/asio/include/asio/detail/dev_poll_reactor.hpp
index 92930bba5b9..720fd6b54e8 100644
--- a/3rdparty/asio/include/asio/detail/dev_poll_reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/dev_poll_reactor.hpp
@@ -2,7 +2,7 @@
// detail/dev_poll_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -28,6 +28,7 @@
#include "asio/detail/op_queue.hpp"
#include "asio/detail/reactor_op.hpp"
#include "asio/detail/reactor_op_queue.hpp"
+#include "asio/detail/scheduler_task.hpp"
#include "asio/detail/select_interrupter.hpp"
#include "asio/detail/socket_types.hpp"
#include "asio/detail/timer_queue_base.hpp"
@@ -41,7 +42,8 @@ namespace asio {
namespace detail {
class dev_poll_reactor
- : public execution_context_service_base<dev_poll_reactor>
+ : public execution_context_service_base<dev_poll_reactor>,
+ public scheduler_task
{
public:
enum op_types { read_op = 0, write_op = 1,
@@ -84,13 +86,30 @@ public:
per_descriptor_data& source_descriptor_data);
// Post a reactor operation for immediate completion.
- void post_immediate_completion(reactor_op* op, bool is_continuation);
+ void post_immediate_completion(operation* op, bool is_continuation) const;
+
+ // Post a reactor operation for immediate completion.
+ ASIO_DECL static void call_post_immediate_completion(
+ operation* op, bool is_continuation, const void* self);
// Start a new operation. The reactor operation will be performed when the
// given descriptor is flagged as ready, or an error has occurred.
ASIO_DECL void start_op(int op_type, socket_type descriptor,
per_descriptor_data&, reactor_op* op,
- bool is_continuation, bool allow_speculative);
+ bool is_continuation, bool allow_speculative,
+ void (*on_immediate)(operation*, bool, const void*),
+ const void* immediate_arg);
+
+ // Start a new operation. The reactor operation will be performed when the
+ // given descriptor is flagged as ready, or an error has occurred.
+ void start_op(int op_type, socket_type descriptor,
+ per_descriptor_data& descriptor_data, reactor_op* op,
+ bool is_continuation, bool allow_speculative)
+ {
+ start_op(op_type, descriptor, descriptor_data,
+ op, is_continuation, allow_speculative,
+ &dev_poll_reactor::call_post_immediate_completion, this);
+ }
// Cancel all operations associated with the given descriptor. The
// handlers associated with the descriptor will be invoked with the
@@ -142,6 +161,12 @@ public:
typename timer_queue<Time_Traits>::per_timer_data& timer,
std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
+ // Cancel the timer operations associated with the given key.
+ template <typename Time_Traits>
+ void cancel_timer_by_key(timer_queue<Time_Traits>& queue,
+ typename timer_queue<Time_Traits>::per_timer_data* timer,
+ void* cancellation_key);
+
// Move the timer operations associated with the given timer.
template <typename Time_Traits>
void move_timer(timer_queue<Time_Traits>& queue,
diff --git a/3rdparty/asio/include/asio/detail/epoll_reactor.hpp b/3rdparty/asio/include/asio/detail/epoll_reactor.hpp
index 15cb384d5a7..212767a760f 100644
--- a/3rdparty/asio/include/asio/detail/epoll_reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/epoll_reactor.hpp
@@ -2,7 +2,7 @@
// detail/epoll_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -25,6 +25,7 @@
#include "asio/detail/object_pool.hpp"
#include "asio/detail/op_queue.hpp"
#include "asio/detail/reactor_op.hpp"
+#include "asio/detail/scheduler_task.hpp"
#include "asio/detail/select_interrupter.hpp"
#include "asio/detail/socket_types.hpp"
#include "asio/detail/timer_queue_base.hpp"
@@ -42,7 +43,8 @@ namespace asio {
namespace detail {
class epoll_reactor
- : public execution_context_service_base<epoll_reactor>
+ : public execution_context_service_base<epoll_reactor>,
+ public scheduler_task
{
private:
// The mutex type used by this reactor.
@@ -114,13 +116,30 @@ public:
per_descriptor_data& source_descriptor_data);
// Post a reactor operation for immediate completion.
- void post_immediate_completion(operation* op, bool is_continuation);
+ void post_immediate_completion(operation* op, bool is_continuation) const;
+
+ // Post a reactor operation for immediate completion.
+ ASIO_DECL static void call_post_immediate_completion(
+ operation* op, bool is_continuation, const void* self);
// Start a new operation. The reactor operation will be performed when the
// given descriptor is flagged as ready, or an error has occurred.
ASIO_DECL void start_op(int op_type, socket_type descriptor,
per_descriptor_data& descriptor_data, reactor_op* op,
- bool is_continuation, bool allow_speculative);
+ bool is_continuation, bool allow_speculative,
+ void (*on_immediate)(operation*, bool, const void*),
+ const void* immediate_arg);
+
+ // Start a new operation. The reactor operation will be performed when the
+ // given descriptor is flagged as ready, or an error has occurred.
+ void start_op(int op_type, socket_type descriptor,
+ per_descriptor_data& descriptor_data, reactor_op* op,
+ bool is_continuation, bool allow_speculative)
+ {
+ start_op(op_type, descriptor, descriptor_data,
+ op, is_continuation, allow_speculative,
+ &epoll_reactor::call_post_immediate_completion, this);
+ }
// Cancel all operations associated with the given descriptor. The
// handlers associated with the descriptor will be invoked with the
diff --git a/3rdparty/asio/include/asio/detail/event.hpp b/3rdparty/asio/include/asio/detail/event.hpp
index d2b850af187..19e458cdf05 100644
--- a/3rdparty/asio/include/asio/detail/event.hpp
+++ b/3rdparty/asio/include/asio/detail/event.hpp
@@ -2,7 +2,7 @@
// detail/event.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,10 +23,8 @@
# include "asio/detail/win_event.hpp"
#elif defined(ASIO_HAS_PTHREADS)
# include "asio/detail/posix_event.hpp"
-#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-# include "asio/detail/std_event.hpp"
#else
-# error Only Windows, POSIX and std::condition_variable are supported!
+# include "asio/detail/std_event.hpp"
#endif
namespace asio {
@@ -38,7 +36,7 @@ typedef null_event event;
typedef win_event event;
#elif defined(ASIO_HAS_PTHREADS)
typedef posix_event event;
-#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
+#else
typedef std_event event;
#endif
diff --git a/3rdparty/asio/include/asio/detail/eventfd_select_interrupter.hpp b/3rdparty/asio/include/asio/detail/eventfd_select_interrupter.hpp
index 964e90c7439..0eb8843dd56 100644
--- a/3rdparty/asio/include/asio/detail/eventfd_select_interrupter.hpp
+++ b/3rdparty/asio/include/asio/detail/eventfd_select_interrupter.hpp
@@ -2,7 +2,7 @@
// detail/eventfd_select_interrupter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/detail/exception.hpp b/3rdparty/asio/include/asio/detail/exception.hpp
new file mode 100644
index 00000000000..28c7cffb5d8
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/exception.hpp
@@ -0,0 +1,29 @@
+//
+// detail/exception.hpp
+// ~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_EXCEPTION_HPP
+#define ASIO_DETAIL_EXCEPTION_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <exception>
+
+namespace asio {
+
+using std::exception_ptr;
+using std::current_exception;
+using std::rethrow_exception;
+
+} // namespace asio
+
+#endif // ASIO_DETAIL_EXCEPTION_HPP
diff --git a/3rdparty/asio/include/asio/detail/executor_function.hpp b/3rdparty/asio/include/asio/detail/executor_function.hpp
index 6b24f3aa130..cccf31bf3af 100644
--- a/3rdparty/asio/include/asio/detail/executor_function.hpp
+++ b/3rdparty/asio/include/asio/detail/executor_function.hpp
@@ -2,7 +2,7 @@
// detail/executor_function.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,7 +17,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/push_options.hpp"
@@ -25,8 +24,6 @@
namespace asio {
namespace detail {
-#if defined(ASIO_HAS_MOVE)
-
// Lightweight, move-only function object wrapper.
class executor_function
{
@@ -38,11 +35,11 @@ public:
typedef impl<F, Alloc> impl_type;
typename impl_type::ptr p = {
detail::addressof(a), impl_type::ptr::allocate(a), 0 };
- impl_ = new (p.v) impl_type(ASIO_MOVE_CAST(F)(f), a);
+ impl_ = new (p.v) impl_type(static_cast<F&&>(f), a);
p.v = 0;
}
- executor_function(executor_function&& other) ASIO_NOEXCEPT
+ executor_function(executor_function&& other) noexcept
: impl_(other.impl_)
{
other.impl_ = 0;
@@ -79,8 +76,8 @@ private:
thread_info_base::executor_function_tag, impl);
template <typename F>
- impl(ASIO_MOVE_ARG(F) f, const Alloc& a)
- : function_(ASIO_MOVE_CAST(F)(f)),
+ impl(F&& f, const Alloc& a)
+ : function_(static_cast<F&&>(f)),
allocator_(a)
{
complete_ = &executor_function::complete<Function, Alloc>;
@@ -106,74 +103,25 @@ private:
// associated with the function. Consequently, a local copy of the function
// is required to ensure that any owning sub-object remains valid until
// after we have deallocated the memory here.
- Function function(ASIO_MOVE_CAST(Function)(i->function_));
+ Function function(static_cast<Function&&>(i->function_));
p.reset();
// Make the upcall if required.
if (call)
{
- asio_handler_invoke_helpers::invoke(function, function);
+ static_cast<Function&&>(function)();
}
}
impl_base* impl_;
};
-#else // defined(ASIO_HAS_MOVE)
-
-// Not so lightweight, copyable function object wrapper.
-class executor_function
-{
-public:
- template <typename F, typename Alloc>
- explicit executor_function(const F& f, const Alloc&)
- : impl_(new impl<typename decay<F>::type>(f))
- {
- }
-
- void operator()()
- {
- impl_->complete_(impl_.get());
- }
-
-private:
- // Base class for polymorphic function implementations.
- struct impl_base
- {
- void (*complete_)(impl_base*);
- };
-
- // Polymorphic function implementation.
- template <typename F>
- struct impl : impl_base
- {
- impl(const F& f)
- : function_(f)
- {
- complete_ = &executor_function::complete<F>;
- }
-
- F function_;
- };
-
- // Helper to complete function invocation.
- template <typename F>
- static void complete(impl_base* i)
- {
- static_cast<impl<F>*>(i)->function_();
- }
-
- shared_ptr<impl_base> impl_;
-};
-
-#endif // defined(ASIO_HAS_MOVE)
-
// Lightweight, non-owning, copyable function object wrapper.
class executor_function_view
{
public:
template <typename F>
- explicit executor_function_view(F& f) ASIO_NOEXCEPT
+ explicit executor_function_view(F& f) noexcept
: complete_(&executor_function_view::complete<F>),
function_(&f)
{
diff --git a/3rdparty/asio/include/asio/detail/executor_op.hpp b/3rdparty/asio/include/asio/detail/executor_op.hpp
index f97618c378a..78e781e217b 100644
--- a/3rdparty/asio/include/asio/detail/executor_op.hpp
+++ b/3rdparty/asio/include/asio/detail/executor_op.hpp
@@ -2,7 +2,7 @@
// detail/executor_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,7 +18,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/scheduler_operation.hpp"
#include "asio/detail/push_options.hpp"
@@ -34,9 +33,9 @@ public:
ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(executor_op);
template <typename H>
- executor_op(ASIO_MOVE_ARG(H) h, const Alloc& allocator)
+ executor_op(H&& h, const Alloc& allocator)
: Operation(&executor_op::do_complete),
- handler_(ASIO_MOVE_CAST(H)(h)),
+ handler_(static_cast<H&&>(h)),
allocator_(allocator)
{
}
@@ -46,6 +45,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
executor_op* o(static_cast<executor_op*>(base));
Alloc allocator(o->allocator_);
ptr p = { detail::addressof(allocator), o, o };
@@ -58,7 +58,7 @@ public:
// with the handler. Consequently, a local copy of the handler is required
// to ensure that any owning sub-object remains valid until after we have
// deallocated the memory here.
- Handler handler(ASIO_MOVE_CAST(Handler)(o->handler_));
+ Handler handler(static_cast<Handler&&>(o->handler_));
p.reset();
// Make the upcall if required.
@@ -66,7 +66,7 @@ public:
{
fenced_block b(fenced_block::half);
ASIO_HANDLER_INVOCATION_BEGIN(());
- asio_handler_invoke_helpers::invoke(handler, handler);
+ static_cast<Handler&&>(handler)();
ASIO_HANDLER_INVOCATION_END;
}
}
diff --git a/3rdparty/asio/include/asio/detail/fd_set_adapter.hpp b/3rdparty/asio/include/asio/detail/fd_set_adapter.hpp
index ade20ca56b3..80b8974a417 100644
--- a/3rdparty/asio/include/asio/detail/fd_set_adapter.hpp
+++ b/3rdparty/asio/include/asio/detail/fd_set_adapter.hpp
@@ -2,7 +2,7 @@
// detail/fd_set_adapter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/fenced_block.hpp b/3rdparty/asio/include/asio/detail/fenced_block.hpp
index 08e47d67169..ff096dc8486 100644
--- a/3rdparty/asio/include/asio/detail/fenced_block.hpp
+++ b/3rdparty/asio/include/asio/detail/fenced_block.hpp
@@ -2,7 +2,7 @@
// detail/fenced_block.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,28 +20,8 @@
#if !defined(ASIO_HAS_THREADS) \
|| defined(ASIO_DISABLE_FENCED_BLOCK)
# include "asio/detail/null_fenced_block.hpp"
-#elif defined(ASIO_HAS_STD_ATOMIC)
-# include "asio/detail/std_fenced_block.hpp"
-#elif defined(__MACH__) && defined(__APPLE__)
-# include "asio/detail/macos_fenced_block.hpp"
-#elif defined(__sun)
-# include "asio/detail/solaris_fenced_block.hpp"
-#elif defined(__GNUC__) && defined(__arm__) \
- && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
-# include "asio/detail/gcc_arm_fenced_block.hpp"
-#elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
-# include "asio/detail/gcc_hppa_fenced_block.hpp"
-#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
-# include "asio/detail/gcc_x86_fenced_block.hpp"
-#elif defined(__GNUC__) \
- && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \
- && !defined(__INTEL_COMPILER) && !defined(__ICL) \
- && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__)
-# include "asio/detail/gcc_sync_fenced_block.hpp"
-#elif defined(ASIO_WINDOWS) && !defined(UNDER_CE)
-# include "asio/detail/win_fenced_block.hpp"
#else
-# include "asio/detail/null_fenced_block.hpp"
+# include "asio/detail/std_fenced_block.hpp"
#endif
namespace asio {
@@ -50,28 +30,8 @@ namespace detail {
#if !defined(ASIO_HAS_THREADS) \
|| defined(ASIO_DISABLE_FENCED_BLOCK)
typedef null_fenced_block fenced_block;
-#elif defined(ASIO_HAS_STD_ATOMIC)
-typedef std_fenced_block fenced_block;
-#elif defined(__MACH__) && defined(__APPLE__)
-typedef macos_fenced_block fenced_block;
-#elif defined(__sun)
-typedef solaris_fenced_block fenced_block;
-#elif defined(__GNUC__) && defined(__arm__) \
- && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
-typedef gcc_arm_fenced_block fenced_block;
-#elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
-typedef gcc_hppa_fenced_block fenced_block;
-#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
-typedef gcc_x86_fenced_block fenced_block;
-#elif defined(__GNUC__) \
- && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \
- && !defined(__INTEL_COMPILER) && !defined(__ICL) \
- && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__)
-typedef gcc_sync_fenced_block fenced_block;
-#elif defined(ASIO_WINDOWS) && !defined(UNDER_CE)
-typedef win_fenced_block fenced_block;
#else
-typedef null_fenced_block fenced_block;
+typedef std_fenced_block fenced_block;
#endif
} // namespace detail
diff --git a/3rdparty/asio/include/asio/detail/functional.hpp b/3rdparty/asio/include/asio/detail/functional.hpp
index 54256c130b0..145f9d2a9e1 100644
--- a/3rdparty/asio/include/asio/detail/functional.hpp
+++ b/3rdparty/asio/include/asio/detail/functional.hpp
@@ -2,7 +2,7 @@
// detail/functional.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,28 +16,17 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
#include <functional>
-#if !defined(ASIO_HAS_STD_FUNCTION)
-# include <boost/function.hpp>
-#endif // !defined(ASIO_HAS_STD_FUNCTION)
-
namespace asio {
namespace detail {
-#if defined(ASIO_HAS_STD_FUNCTION)
using std::function;
-#else // defined(ASIO_HAS_STD_FUNCTION)
-using boost::function;
-#endif // defined(ASIO_HAS_STD_FUNCTION)
} // namespace detail
-#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER)
using std::ref;
using std::reference_wrapper;
-#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER)
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/future.hpp b/3rdparty/asio/include/asio/detail/future.hpp
index 9fe828e78ee..f33136cbef2 100644
--- a/3rdparty/asio/include/asio/detail/future.hpp
+++ b/3rdparty/asio/include/asio/detail/future.hpp
@@ -2,7 +2,7 @@
// detail/future.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,18 +16,17 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-#if defined(ASIO_HAS_STD_FUTURE)
-# include <future>
+#include <future>
+
// Even though the future header is available, libstdc++ may not implement the
// std::future class itself. However, we need to have already included the
// future header to reliably test for _GLIBCXX_HAS_GTHREADS.
-# if defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX)
-# if defined(_GLIBCXX_HAS_GTHREADS)
-# define ASIO_HAS_STD_FUTURE_CLASS 1
-# endif // defined(_GLIBCXX_HAS_GTHREADS)
-# else // defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX)
+#if defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX)
+# if defined(_GLIBCXX_HAS_GTHREADS)
# define ASIO_HAS_STD_FUTURE_CLASS 1
-# endif // defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX)
-#endif // defined(ASIO_HAS_STD_FUTURE)
+# endif // defined(_GLIBCXX_HAS_GTHREADS)
+#else // defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX)
+# define ASIO_HAS_STD_FUTURE_CLASS 1
+#endif // defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX)
#endif // ASIO_DETAIL_FUTURE_HPP
diff --git a/3rdparty/asio/include/asio/detail/gcc_arm_fenced_block.hpp b/3rdparty/asio/include/asio/detail/gcc_arm_fenced_block.hpp
deleted file mode 100644
index c879c22d6bf..00000000000
--- a/3rdparty/asio/include/asio/detail/gcc_arm_fenced_block.hpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// detail/gcc_arm_fenced_block.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_GCC_ARM_FENCED_BLOCK_HPP
-#define ASIO_DETAIL_GCC_ARM_FENCED_BLOCK_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#if defined(__GNUC__) && defined(__arm__)
-
-#include "asio/detail/noncopyable.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class gcc_arm_fenced_block
- : private noncopyable
-{
-public:
- enum half_t { half };
- enum full_t { full };
-
- // Constructor for a half fenced block.
- explicit gcc_arm_fenced_block(half_t)
- {
- }
-
- // Constructor for a full fenced block.
- explicit gcc_arm_fenced_block(full_t)
- {
- barrier();
- }
-
- // Destructor.
- ~gcc_arm_fenced_block()
- {
- barrier();
- }
-
-private:
- static void barrier()
- {
-#if defined(__ARM_ARCH_4__) \
- || defined(__ARM_ARCH_4T__) \
- || defined(__ARM_ARCH_5__) \
- || defined(__ARM_ARCH_5E__) \
- || defined(__ARM_ARCH_5T__) \
- || defined(__ARM_ARCH_5TE__) \
- || defined(__ARM_ARCH_5TEJ__) \
- || defined(__ARM_ARCH_6__) \
- || defined(__ARM_ARCH_6J__) \
- || defined(__ARM_ARCH_6K__) \
- || defined(__ARM_ARCH_6Z__) \
- || defined(__ARM_ARCH_6ZK__) \
- || defined(__ARM_ARCH_6T2__)
-# if defined(__thumb__)
- // This is just a placeholder and almost certainly not sufficient.
- __asm__ __volatile__ ("" : : : "memory");
-# else // defined(__thumb__)
- int a = 0, b = 0;
- __asm__ __volatile__ ("swp %0, %1, [%2]"
- : "=&r"(a) : "r"(1), "r"(&b) : "memory", "cc");
-# endif // defined(__thumb__)
-#else
- // ARMv7 and later.
- __asm__ __volatile__ ("dmb" : : : "memory");
-#endif
- }
-};
-
-} // namespace detail
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // defined(__GNUC__) && defined(__arm__)
-
-#endif // ASIO_DETAIL_GCC_ARM_FENCED_BLOCK_HPP
diff --git a/3rdparty/asio/include/asio/detail/gcc_hppa_fenced_block.hpp b/3rdparty/asio/include/asio/detail/gcc_hppa_fenced_block.hpp
deleted file mode 100644
index 38caa4b01c6..00000000000
--- a/3rdparty/asio/include/asio/detail/gcc_hppa_fenced_block.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// detail/gcc_hppa_fenced_block.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP
-#define ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#if defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
-
-#include "asio/detail/noncopyable.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class gcc_hppa_fenced_block
- : private noncopyable
-{
-public:
- enum half_t { half };
- enum full_t { full };
-
- // Constructor for a half fenced block.
- explicit gcc_hppa_fenced_block(half_t)
- {
- }
-
- // Constructor for a full fenced block.
- explicit gcc_hppa_fenced_block(full_t)
- {
- barrier();
- }
-
- // Destructor.
- ~gcc_hppa_fenced_block()
- {
- barrier();
- }
-
-private:
- static void barrier()
- {
- // This is just a placeholder and almost certainly not sufficient.
- __asm__ __volatile__ ("" : : : "memory");
- }
-};
-
-} // namespace detail
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
-
-#endif // ASIO_DETAIL_GCC_HPPA_FENCED_BLOCK_HPP
diff --git a/3rdparty/asio/include/asio/detail/gcc_sync_fenced_block.hpp b/3rdparty/asio/include/asio/detail/gcc_sync_fenced_block.hpp
deleted file mode 100644
index 68fdcf722dd..00000000000
--- a/3rdparty/asio/include/asio/detail/gcc_sync_fenced_block.hpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// detail/gcc_sync_fenced_block.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP
-#define ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#if defined(__GNUC__) \
- && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) \
- && !defined(__INTEL_COMPILER) && !defined(__ICL) \
- && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__)
-
-#include "asio/detail/noncopyable.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class gcc_sync_fenced_block
- : private noncopyable
-{
-public:
- enum half_or_full_t { half, full };
-
- // Constructor.
- explicit gcc_sync_fenced_block(half_or_full_t)
- : value_(0)
- {
- __sync_lock_test_and_set(&value_, 1);
- }
-
- // Destructor.
- ~gcc_sync_fenced_block()
- {
- __sync_lock_release(&value_);
- }
-
-private:
- int value_;
-};
-
-} // namespace detail
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // defined(__GNUC__)
- // && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4))
- // && !defined(__INTEL_COMPILER) && !defined(__ICL)
- // && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__)
-
-#endif // ASIO_DETAIL_GCC_SYNC_FENCED_BLOCK_HPP
diff --git a/3rdparty/asio/include/asio/detail/gcc_x86_fenced_block.hpp b/3rdparty/asio/include/asio/detail/gcc_x86_fenced_block.hpp
deleted file mode 100644
index c21b2bad5af..00000000000
--- a/3rdparty/asio/include/asio/detail/gcc_x86_fenced_block.hpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// detail/gcc_x86_fenced_block.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_GCC_X86_FENCED_BLOCK_HPP
-#define ASIO_DETAIL_GCC_X86_FENCED_BLOCK_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
-
-#include "asio/detail/noncopyable.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class gcc_x86_fenced_block
- : private noncopyable
-{
-public:
- enum half_t { half };
- enum full_t { full };
-
- // Constructor for a half fenced block.
- explicit gcc_x86_fenced_block(half_t)
- {
- }
-
- // Constructor for a full fenced block.
- explicit gcc_x86_fenced_block(full_t)
- {
- lbarrier();
- }
-
- // Destructor.
- ~gcc_x86_fenced_block()
- {
- sbarrier();
- }
-
-private:
- static int barrier()
- {
- int r = 0, m = 1;
- __asm__ __volatile__ (
- "xchgl %0, %1" :
- "=r"(r), "=m"(m) :
- "0"(1), "m"(m) :
- "memory", "cc");
- return r;
- }
-
- static void lbarrier()
- {
-#if defined(__SSE2__)
-# if (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL)
- __builtin_ia32_lfence();
-# else // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL)
- __asm__ __volatile__ ("lfence" ::: "memory");
-# endif // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL)
-#else // defined(__SSE2__)
- barrier();
-#endif // defined(__SSE2__)
- }
-
- static void sbarrier()
- {
-#if defined(__SSE2__)
-# if (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL)
- __builtin_ia32_sfence();
-# else // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL)
- __asm__ __volatile__ ("sfence" ::: "memory");
-# endif // (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL)
-#else // defined(__SSE2__)
- barrier();
-#endif // defined(__SSE2__)
- }
-};
-
-} // namespace detail
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
-
-#endif // ASIO_DETAIL_GCC_X86_FENCED_BLOCK_HPP
diff --git a/3rdparty/asio/include/asio/detail/global.hpp b/3rdparty/asio/include/asio/detail/global.hpp
index 685cf90f2cf..59de23a4884 100644
--- a/3rdparty/asio/include/asio/detail/global.hpp
+++ b/3rdparty/asio/include/asio/detail/global.hpp
@@ -2,7 +2,7 @@
// detail/global.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,10 +23,8 @@
# include "asio/detail/win_global.hpp"
#elif defined(ASIO_HAS_PTHREADS)
# include "asio/detail/posix_global.hpp"
-#elif defined(ASIO_HAS_STD_CALL_ONCE)
-# include "asio/detail/std_global.hpp"
#else
-# error Only Windows, POSIX and std::call_once are supported!
+# include "asio/detail/std_global.hpp"
#endif
namespace asio {
@@ -41,7 +39,7 @@ inline T& global()
return win_global<T>();
#elif defined(ASIO_HAS_PTHREADS)
return posix_global<T>();
-#elif defined(ASIO_HAS_STD_CALL_ONCE)
+#else
return std_global<T>();
#endif
}
diff --git a/3rdparty/asio/include/asio/detail/handler_alloc_helpers.hpp b/3rdparty/asio/include/asio/detail/handler_alloc_helpers.hpp
index 14033a49a16..c14d542e48c 100644
--- a/3rdparty/asio/include/asio/detail/handler_alloc_helpers.hpp
+++ b/3rdparty/asio/include/asio/detail/handler_alloc_helpers.hpp
@@ -2,7 +2,7 @@
// detail/handler_alloc_helpers.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -21,88 +21,37 @@
#include "asio/detail/recycling_allocator.hpp"
#include "asio/detail/thread_info_base.hpp"
#include "asio/associated_allocator.hpp"
-#include "asio/handler_alloc_hook.hpp"
#include "asio/detail/push_options.hpp"
-// Calls to asio_handler_allocate and asio_handler_deallocate must be made from
-// a namespace that does not contain any overloads of these functions. The
-// asio_handler_alloc_helpers namespace is defined here for that purpose.
-namespace asio_handler_alloc_helpers {
-
-#if defined(ASIO_NO_DEPRECATED)
-template <typename Handler>
-inline void error_if_hooks_are_defined(Handler& h)
-{
- using asio::asio_handler_allocate;
- // If you get an error here it is because some of your handlers still
- // overload asio_handler_allocate, but this hook is no longer used.
- (void)static_cast<asio::asio_handler_allocate_is_no_longer_used>(
- asio_handler_allocate(static_cast<std::size_t>(0),
- asio::detail::addressof(h)));
-
- using asio::asio_handler_deallocate;
- // If you get an error here it is because some of your handlers still
- // overload asio_handler_deallocate, but this hook is no longer used.
- (void)static_cast<asio::asio_handler_deallocate_is_no_longer_used>(
- asio_handler_deallocate(static_cast<void*>(0),
- static_cast<std::size_t>(0), asio::detail::addressof(h)));
-}
-#endif // defined(ASIO_NO_DEPRECATED)
+namespace asio {
+namespace detail {
-template <typename Handler>
-inline void* allocate(std::size_t s, Handler& h,
+inline void* default_allocate(std::size_t s,
std::size_t align = ASIO_DEFAULT_ALIGN)
{
-#if !defined(ASIO_HAS_HANDLER_HOOKS)
- return aligned_new(align, s);
-#elif defined(ASIO_NO_DEPRECATED)
- // The asio_handler_allocate hook is no longer used to obtain memory.
- (void)&error_if_hooks_are_defined<Handler>;
- (void)h;
-# if !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+#if !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
return asio::detail::thread_info_base::allocate(
asio::detail::thread_context::top_of_thread_call_stack(),
s, align);
-# else // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
- return aligned_new(align, s);
-# endif // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
-#else
- (void)align;
- using asio::asio_handler_allocate;
- return asio_handler_allocate(s, asio::detail::addressof(h));
-#endif
+#else // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+ return asio::aligned_new(align, s);
+#endif // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
}
-template <typename Handler>
-inline void deallocate(void* p, std::size_t s, Handler& h)
+inline void default_deallocate(void* p, std::size_t s)
{
-#if !defined(ASIO_HAS_HANDLER_HOOKS)
- aligned_delete(p);
-#elif defined(ASIO_NO_DEPRECATED)
- // The asio_handler_allocate hook is no longer used to obtain memory.
- (void)&error_if_hooks_are_defined<Handler>;
- (void)h;
#if !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
asio::detail::thread_info_base::deallocate(
asio::detail::thread_context::top_of_thread_call_stack(), p, s);
#else // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
(void)s;
- aligned_delete(p);
+ asio::aligned_delete(p);
#endif // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
-#else
- using asio::asio_handler_deallocate;
- asio_handler_deallocate(p, s, asio::detail::addressof(h));
-#endif
}
-} // namespace asio_handler_alloc_helpers
-
-namespace asio {
-namespace detail {
-
-template <typename Handler, typename T>
-class hook_allocator
+template <typename T>
+class default_allocator
{
public:
typedef T value_type;
@@ -110,38 +59,31 @@ public:
template <typename U>
struct rebind
{
- typedef hook_allocator<Handler, U> other;
+ typedef default_allocator<U> other;
};
- explicit hook_allocator(Handler& h)
- : handler_(h)
+ default_allocator() noexcept
{
}
template <typename U>
- hook_allocator(const hook_allocator<Handler, U>& a)
- : handler_(a.handler_)
+ default_allocator(const default_allocator<U>&) noexcept
{
}
T* allocate(std::size_t n)
{
- return static_cast<T*>(
- asio_handler_alloc_helpers::allocate(
- sizeof(T) * n, handler_, ASIO_ALIGNOF(T)));
+ return static_cast<T*>(default_allocate(sizeof(T) * n, alignof(T)));
}
void deallocate(T* p, std::size_t n)
{
- asio_handler_alloc_helpers::deallocate(p, sizeof(T) * n, handler_);
+ default_deallocate(p, sizeof(T) * n);
}
-
-//private:
- Handler& handler_;
};
-template <typename Handler>
-class hook_allocator<Handler, void>
+template <>
+class default_allocator<void>
{
public:
typedef void value_type;
@@ -149,43 +91,38 @@ public:
template <typename U>
struct rebind
{
- typedef hook_allocator<Handler, U> other;
+ typedef default_allocator<U> other;
};
- explicit hook_allocator(Handler& h)
- : handler_(h)
+ default_allocator() noexcept
{
}
template <typename U>
- hook_allocator(const hook_allocator<Handler, U>& a)
- : handler_(a.handler_)
+ default_allocator(const default_allocator<U>&) noexcept
{
}
-
-//private:
- Handler& handler_;
};
-template <typename Handler, typename Allocator>
-struct get_hook_allocator
+template <typename Allocator>
+struct get_default_allocator
{
typedef Allocator type;
- static type get(Handler&, const Allocator& a)
+ static type get(const Allocator& a)
{
return a;
}
};
-template <typename Handler, typename T>
-struct get_hook_allocator<Handler, std::allocator<T> >
+template <typename T>
+struct get_default_allocator<std::allocator<T>>
{
- typedef hook_allocator<Handler, T> type;
+ typedef default_allocator<T> type;
- static type get(Handler& handler, const std::allocator<T>&)
+ static type get(const std::allocator<T>&)
{
- return type(handler);
+ return type();
}
};
@@ -206,12 +143,12 @@ struct get_hook_allocator<Handler, std::allocator<T> >
{ \
typedef typename ::asio::associated_allocator< \
Handler>::type associated_allocator_type; \
- typedef typename ::asio::detail::get_hook_allocator< \
- Handler, associated_allocator_type>::type hook_allocator_type; \
- ASIO_REBIND_ALLOC(hook_allocator_type, op) a( \
- ::asio::detail::get_hook_allocator< \
- Handler, associated_allocator_type>::get( \
- handler, ::asio::get_associated_allocator(handler))); \
+ typedef typename ::asio::detail::get_default_allocator< \
+ associated_allocator_type>::type default_allocator_type; \
+ ASIO_REBIND_ALLOC(default_allocator_type, op) a( \
+ ::asio::detail::get_default_allocator< \
+ associated_allocator_type>::get( \
+ ::asio::get_associated_allocator(handler))); \
return a.allocate(1); \
} \
void reset() \
@@ -225,12 +162,12 @@ struct get_hook_allocator<Handler, std::allocator<T> >
{ \
typedef typename ::asio::associated_allocator< \
Handler>::type associated_allocator_type; \
- typedef typename ::asio::detail::get_hook_allocator< \
- Handler, associated_allocator_type>::type hook_allocator_type; \
- ASIO_REBIND_ALLOC(hook_allocator_type, op) a( \
- ::asio::detail::get_hook_allocator< \
- Handler, associated_allocator_type>::get( \
- *h, ::asio::get_associated_allocator(*h))); \
+ typedef typename ::asio::detail::get_default_allocator< \
+ associated_allocator_type>::type default_allocator_type; \
+ ASIO_REBIND_ALLOC(default_allocator_type, op) a( \
+ ::asio::detail::get_default_allocator< \
+ associated_allocator_type>::get( \
+ ::asio::get_associated_allocator(*h))); \
a.deallocate(static_cast<op*>(v), 1); \
v = 0; \
} \
diff --git a/3rdparty/asio/include/asio/detail/handler_cont_helpers.hpp b/3rdparty/asio/include/asio/detail/handler_cont_helpers.hpp
index 5d47465bdd4..9f8f971984f 100644
--- a/3rdparty/asio/include/asio/detail/handler_cont_helpers.hpp
+++ b/3rdparty/asio/include/asio/detail/handler_cont_helpers.hpp
@@ -2,7 +2,7 @@
// detail/handler_cont_helpers.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/handler_invoke_helpers.hpp b/3rdparty/asio/include/asio/detail/handler_invoke_helpers.hpp
deleted file mode 100644
index 86b8bf2b4b3..00000000000
--- a/3rdparty/asio/include/asio/detail/handler_invoke_helpers.hpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// detail/handler_invoke_helpers.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP
-#define ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/memory.hpp"
-#include "asio/handler_invoke_hook.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-// Calls to asio_handler_invoke must be made from a namespace that does not
-// contain overloads of this function. The asio_handler_invoke_helpers
-// namespace is defined here for that purpose.
-namespace asio_handler_invoke_helpers {
-
-#if defined(ASIO_NO_DEPRECATED)
-template <typename Function, typename Context>
-inline void error_if_hook_is_defined(Function& function, Context& context)
-{
- using asio::asio_handler_invoke;
- // If you get an error here it is because some of your handlers still
- // overload asio_handler_invoke, but this hook is no longer used.
- (void)static_cast<asio::asio_handler_invoke_is_no_longer_used>(
- asio_handler_invoke(function, asio::detail::addressof(context)));
-}
-#endif // defined(ASIO_NO_DEPRECATED)
-
-template <typename Function, typename Context>
-inline void invoke(Function& function, Context& context)
-{
-#if !defined(ASIO_HAS_HANDLER_HOOKS)
- Function tmp(function);
- tmp();
-#elif defined(ASIO_NO_DEPRECATED)
- // The asio_handler_invoke hook is no longer used to invoke the function.
- (void)&error_if_hook_is_defined<Function, Context>;
- (void)context;
- function();
-#else
- using asio::asio_handler_invoke;
- asio_handler_invoke(function, asio::detail::addressof(context));
-#endif
-}
-
-template <typename Function, typename Context>
-inline void invoke(const Function& function, Context& context)
-{
-#if !defined(ASIO_HAS_HANDLER_HOOKS)
- Function tmp(function);
- tmp();
-#elif defined(ASIO_NO_DEPRECATED)
- // The asio_handler_invoke hook is no longer used to invoke the function.
- (void)&error_if_hook_is_defined<const Function, Context>;
- (void)context;
- Function tmp(function);
- tmp();
-#else
- using asio::asio_handler_invoke;
- asio_handler_invoke(function, asio::detail::addressof(context));
-#endif
-}
-
-} // namespace asio_handler_invoke_helpers
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP
diff --git a/3rdparty/asio/include/asio/detail/handler_tracking.hpp b/3rdparty/asio/include/asio/detail/handler_tracking.hpp
index 14195cd4389..f47c777a2d6 100644
--- a/3rdparty/asio/include/asio/detail/handler_tracking.hpp
+++ b/3rdparty/asio/include/asio/detail/handler_tracking.hpp
@@ -2,7 +2,7 @@
// detail/handler_tracking.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -99,8 +99,8 @@ public:
private:
// Disallow copying and assignment.
- location(const location&) ASIO_DELETED;
- location& operator=(const location&) ASIO_DELETED;
+ location(const location&) = delete;
+ location& operator=(const location&) = delete;
friend class handler_tracking;
const char* file_;
diff --git a/3rdparty/asio/include/asio/detail/handler_type_requirements.hpp b/3rdparty/asio/include/asio/detail/handler_type_requirements.hpp
index ced34e8e014..54c53b9b6e3 100644
--- a/3rdparty/asio/include/asio/detail/handler_type_requirements.hpp
+++ b/3rdparty/asio/include/asio/detail/handler_type_requirements.hpp
@@ -2,7 +2,7 @@
// detail/handler_type_requirements.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -64,7 +64,7 @@ template <typename Handler>
auto zero_arg_copyable_handler_test(Handler h, void*)
-> decltype(
sizeof(Handler(static_cast<const Handler&>(h))),
- (ASIO_MOVE_OR_LVALUE(Handler)(h)()),
+ (static_cast<Handler&&>(h)()),
char(0));
template <typename Handler>
@@ -73,8 +73,8 @@ char (&zero_arg_copyable_handler_test(Handler, ...))[2];
template <typename Handler, typename Arg1>
auto one_arg_handler_test(Handler h, Arg1* a1)
-> decltype(
- sizeof(Handler(ASIO_MOVE_CAST(Handler)(h))),
- (ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1)),
+ sizeof(Handler(static_cast<Handler&&>(h))),
+ (static_cast<Handler&&>(h)(*a1)),
char(0));
template <typename Handler>
@@ -83,8 +83,8 @@ char (&one_arg_handler_test(Handler h, ...))[2];
template <typename Handler, typename Arg1, typename Arg2>
auto two_arg_handler_test(Handler h, Arg1* a1, Arg2* a2)
-> decltype(
- sizeof(Handler(ASIO_MOVE_CAST(Handler)(h))),
- (ASIO_MOVE_OR_LVALUE(Handler)(h)(*a1, *a2)),
+ sizeof(Handler(static_cast<Handler&&>(h))),
+ (static_cast<Handler&&>(h)(*a1, *a2)),
char(0));
template <typename Handler>
@@ -93,9 +93,9 @@ char (&two_arg_handler_test(Handler, ...))[2];
template <typename Handler, typename Arg1, typename Arg2>
auto two_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2)
-> decltype(
- sizeof(Handler(ASIO_MOVE_CAST(Handler)(h))),
- (ASIO_MOVE_OR_LVALUE(Handler)(h)(
- *a1, ASIO_MOVE_CAST(Arg2)(*a2))),
+ sizeof(Handler(static_cast<Handler&&>(h))),
+ (static_cast<Handler&&>(h)(
+ *a1, static_cast<Arg2&&>(*a2))),
char(0));
template <typename Handler>
@@ -114,15 +114,9 @@ template <typename T> T& lvref();
template <typename T> T& lvref(T);
template <typename T> const T& clvref();
template <typename T> const T& clvref(T);
-#if defined(ASIO_HAS_MOVE)
template <typename T> T rvref();
template <typename T> T rvref(T);
template <typename T> T rorlvref();
-#else // defined(ASIO_HAS_MOVE)
-template <typename T> const T& rvref();
-template <typename T> const T& rvref(T);
-template <typename T> T& rorlvref();
-#endif // defined(ASIO_HAS_MOVE)
template <typename T> char argbyv(T);
template <int>
diff --git a/3rdparty/asio/include/asio/detail/handler_work.hpp b/3rdparty/asio/include/asio/detail/handler_work.hpp
index c564eb944c3..596d076327a 100644
--- a/3rdparty/asio/include/asio/detail/handler_work.hpp
+++ b/3rdparty/asio/include/asio/detail/handler_work.hpp
@@ -2,7 +2,7 @@
// detail/handler_work.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,12 +16,14 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
+#include "asio/associated_allocator.hpp"
#include "asio/associated_executor.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
+#include "asio/associated_immediate_executor.hpp"
+#include "asio/detail/initiate_dispatch.hpp"
#include "asio/detail/type_traits.hpp"
+#include "asio/detail/work_dispatcher.hpp"
#include "asio/execution/allocator.hpp"
#include "asio/execution/blocking.hpp"
-#include "asio/execution/execute.hpp"
#include "asio/execution/executor.hpp"
#include "asio/execution/outstanding_work.hpp"
#include "asio/executor_work_guard.hpp"
@@ -36,23 +38,15 @@ class io_context;
#if !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+class any_completion_executor;
class any_io_executor;
#endif // !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
namespace execution {
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename...> class any_executor;
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename, typename, typename, typename, typename,
- typename, typename, typename, typename> class any_executor;
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
} // namespace execution
namespace detail {
@@ -62,31 +56,29 @@ template <typename Executor, typename CandidateExecutor = void,
class handler_work_base
{
public:
- explicit handler_work_base(int, int, const Executor& ex) ASIO_NOEXCEPT
+ explicit handler_work_base(int, int, const Executor& ex) noexcept
: executor_(asio::prefer(ex, execution::outstanding_work.tracked))
{
}
template <typename OtherExecutor>
handler_work_base(bool /*base1_owns_work*/, const Executor& ex,
- const OtherExecutor& /*candidate*/) ASIO_NOEXCEPT
+ const OtherExecutor& /*candidate*/) noexcept
: executor_(asio::prefer(ex, execution::outstanding_work.tracked))
{
}
- handler_work_base(const handler_work_base& other) ASIO_NOEXCEPT
+ handler_work_base(const handler_work_base& other) noexcept
: executor_(other.executor_)
{
}
-#if defined(ASIO_HAS_MOVE)
- handler_work_base(handler_work_base&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(executor_type)(other.executor_))
+ handler_work_base(handler_work_base&& other) noexcept
+ : executor_(static_cast<executor_type&&>(other.executor_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
- bool owns_work() const ASIO_NOEXCEPT
+ bool owns_work() const noexcept
{
return true;
}
@@ -94,19 +86,15 @@ public:
template <typename Function, typename Handler>
void dispatch(Function& function, Handler& handler)
{
- execution::execute(
- asio::prefer(executor_,
- execution::blocking.possibly,
- execution::allocator((get_associated_allocator)(handler))),
- ASIO_MOVE_CAST(Function)(function));
+ asio::prefer(executor_,
+ execution::allocator((get_associated_allocator)(handler))
+ ).execute(static_cast<Function&&>(function));
}
private:
- typedef typename decay<
- typename prefer_result<Executor,
- execution::outstanding_work_t::tracked_t
- >::type
- >::type executor_type;
+ typedef decay_t<
+ prefer_result_t<Executor, execution::outstanding_work_t::tracked_t>
+ > executor_type;
executor_type executor_;
};
@@ -115,14 +103,15 @@ template <typename Executor, typename CandidateExecutor,
typename IoContext, typename PolymorphicExecutor>
class handler_work_base<Executor, CandidateExecutor,
IoContext, PolymorphicExecutor,
- typename enable_if<
+ enable_if_t<
!execution::is_executor<Executor>::value
&& (!is_same<Executor, PolymorphicExecutor>::value
|| !is_same<CandidateExecutor, void>::value)
- >::type>
+ >
+ >
{
public:
- explicit handler_work_base(int, int, const Executor& ex) ASIO_NOEXCEPT
+ explicit handler_work_base(int, int, const Executor& ex) noexcept
: executor_(ex),
owns_work_(true)
{
@@ -130,7 +119,7 @@ public:
}
handler_work_base(bool /*base1_owns_work*/, const Executor& ex,
- const Executor& candidate) ASIO_NOEXCEPT
+ const Executor& candidate) noexcept
: executor_(ex),
owns_work_(ex != candidate)
{
@@ -140,14 +129,14 @@ public:
template <typename OtherExecutor>
handler_work_base(bool /*base1_owns_work*/, const Executor& ex,
- const OtherExecutor& /*candidate*/) ASIO_NOEXCEPT
+ const OtherExecutor& /*candidate*/) noexcept
: executor_(ex),
owns_work_(true)
{
executor_.on_work_started();
}
- handler_work_base(const handler_work_base& other) ASIO_NOEXCEPT
+ handler_work_base(const handler_work_base& other) noexcept
: executor_(other.executor_),
owns_work_(other.owns_work_)
{
@@ -155,14 +144,12 @@ public:
executor_.on_work_started();
}
-#if defined(ASIO_HAS_MOVE)
- handler_work_base(handler_work_base&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)),
+ handler_work_base(handler_work_base&& other) noexcept
+ : executor_(static_cast<Executor&&>(other.executor_)),
owns_work_(other.owns_work_)
{
other.owns_work_ = false;
}
-#endif // defined(ASIO_HAS_MOVE)
~handler_work_base()
{
@@ -170,7 +157,7 @@ public:
executor_.on_work_finished();
}
- bool owns_work() const ASIO_NOEXCEPT
+ bool owns_work() const noexcept
{
return owns_work_;
}
@@ -178,7 +165,7 @@ public:
template <typename Function, typename Handler>
void dispatch(Function& function, Handler& handler)
{
- executor_.dispatch(ASIO_MOVE_CAST(Function)(function),
+ executor_.dispatch(static_cast<Function&&>(function),
asio::get_associated_allocator(handler));
}
@@ -189,30 +176,31 @@ private:
template <typename Executor, typename IoContext, typename PolymorphicExecutor>
class handler_work_base<Executor, void, IoContext, PolymorphicExecutor,
- typename enable_if<
+ enable_if_t<
is_same<
Executor,
typename IoContext::executor_type
>::value
- >::type>
+ >
+ >
{
public:
explicit handler_work_base(int, int, const Executor&)
{
}
- bool owns_work() const ASIO_NOEXCEPT
+ bool owns_work() const noexcept
{
return false;
}
template <typename Function, typename Handler>
- void dispatch(Function& function, Handler& handler)
+ void dispatch(Function& function, Handler&)
{
// When using a native implementation, I/O completion handlers are
// already dispatched according to the execution context's executor's
// rules. We can call the function directly.
- asio_handler_invoke_helpers::invoke(function, handler);
+ static_cast<Function&&>(function)();
}
};
@@ -220,7 +208,7 @@ template <typename Executor, typename IoContext>
class handler_work_base<Executor, void, IoContext, Executor>
{
public:
- explicit handler_work_base(int, int, const Executor& ex) ASIO_NOEXCEPT
+ explicit handler_work_base(int, int, const Executor& ex) noexcept
#if !defined(ASIO_NO_TYPEID)
: executor_(
ex.target_type() == typeid(typename IoContext::executor_type)
@@ -234,7 +222,7 @@ public:
}
handler_work_base(bool /*base1_owns_work*/, const Executor& ex,
- const Executor& candidate) ASIO_NOEXCEPT
+ const Executor& candidate) noexcept
: executor_(ex != candidate ? ex : Executor())
{
if (executor_)
@@ -243,25 +231,23 @@ public:
template <typename OtherExecutor>
handler_work_base(const Executor& ex,
- const OtherExecutor&) ASIO_NOEXCEPT
+ const OtherExecutor&) noexcept
: executor_(ex)
{
executor_.on_work_started();
}
- handler_work_base(const handler_work_base& other) ASIO_NOEXCEPT
+ handler_work_base(const handler_work_base& other) noexcept
: executor_(other.executor_)
{
if (executor_)
executor_.on_work_started();
}
-#if defined(ASIO_HAS_MOVE)
- handler_work_base(handler_work_base&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(Executor)(other.executor_))
+ handler_work_base(handler_work_base&& other) noexcept
+ : executor_(static_cast<Executor&&>(other.executor_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
~handler_work_base()
{
@@ -269,7 +255,7 @@ public:
executor_.on_work_finished();
}
- bool owns_work() const ASIO_NOEXCEPT
+ bool owns_work() const noexcept
{
return !!executor_;
}
@@ -277,7 +263,7 @@ public:
template <typename Function, typename Handler>
void dispatch(Function& function, Handler& handler)
{
- executor_.dispatch(ASIO_MOVE_CAST(Function)(function),
+ executor_.dispatch(static_cast<Function&&>(function),
asio::get_associated_allocator(handler));
}
@@ -285,34 +271,15 @@ private:
Executor executor_;
};
-template <
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
- typename... SupportableProperties,
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9,
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- typename CandidateExecutor, typename IoContext,
- typename PolymorphicExecutor>
-class handler_work_base<
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
- execution::any_executor<SupportableProperties...>,
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- execution::any_executor<T1, T2, T3, T4, T5, T6, T7, T8, T9>,
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
+template <typename... SupportableProperties, typename CandidateExecutor,
+ typename IoContext, typename PolymorphicExecutor>
+class handler_work_base<execution::any_executor<SupportableProperties...>,
CandidateExecutor, IoContext, PolymorphicExecutor>
{
public:
- typedef
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
- execution::any_executor<SupportableProperties...>
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- execution::any_executor<T1, T2, T3, T4, T5, T6, T7, T8, T9>
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- executor_type;
+ typedef execution::any_executor<SupportableProperties...> executor_type;
- explicit handler_work_base(int, int,
- const executor_type& ex) ASIO_NOEXCEPT
+ explicit handler_work_base(int, int, const executor_type& ex) noexcept
#if !defined(ASIO_NO_TYPEID)
: executor_(
ex.target_type() == typeid(typename IoContext::executor_type)
@@ -325,7 +292,7 @@ public:
}
handler_work_base(bool base1_owns_work, const executor_type& ex,
- const executor_type& candidate) ASIO_NOEXCEPT
+ const executor_type& candidate) noexcept
: executor_(
!base1_owns_work && ex == candidate
? executor_type()
@@ -335,24 +302,22 @@ public:
template <typename OtherExecutor>
handler_work_base(bool /*base1_owns_work*/, const executor_type& ex,
- const OtherExecutor& /*candidate*/) ASIO_NOEXCEPT
+ const OtherExecutor& /*candidate*/) noexcept
: executor_(asio::prefer(ex, execution::outstanding_work.tracked))
{
}
- handler_work_base(const handler_work_base& other) ASIO_NOEXCEPT
+ handler_work_base(const handler_work_base& other) noexcept
: executor_(other.executor_)
{
}
-#if defined(ASIO_HAS_MOVE)
- handler_work_base(handler_work_base&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(executor_type)(other.executor_))
+ handler_work_base(handler_work_base&& other) noexcept
+ : executor_(static_cast<executor_type&&>(other.executor_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
- bool owns_work() const ASIO_NOEXCEPT
+ bool owns_work() const noexcept
{
return !!executor_;
}
@@ -360,9 +325,7 @@ public:
template <typename Function, typename Handler>
void dispatch(Function& function, Handler&)
{
- execution::execute(
- asio::prefer(executor_, execution::blocking.possibly),
- ASIO_MOVE_CAST(Function)(function));
+ executor_.execute(static_cast<Function&&>(function));
}
private:
@@ -376,18 +339,17 @@ template <typename Executor, typename CandidateExecutor,
class handler_work_base<
Executor, CandidateExecutor,
IoContext, PolymorphicExecutor,
- typename enable_if<
- is_same<
- Executor,
- any_io_executor
- >::value
- >::type>
+ enable_if_t<
+ is_same<Executor, any_completion_executor>::value
+ || is_same<Executor, any_io_executor>::value
+ >
+ >
{
public:
typedef Executor executor_type;
explicit handler_work_base(int, int,
- const executor_type& ex) ASIO_NOEXCEPT
+ const executor_type& ex) noexcept
#if !defined(ASIO_NO_TYPEID)
: executor_(
ex.target_type() == typeid(typename IoContext::executor_type)
@@ -400,7 +362,7 @@ public:
}
handler_work_base(bool base1_owns_work, const executor_type& ex,
- const executor_type& candidate) ASIO_NOEXCEPT
+ const executor_type& candidate) noexcept
: executor_(
!base1_owns_work && ex == candidate
? executor_type()
@@ -410,24 +372,22 @@ public:
template <typename OtherExecutor>
handler_work_base(bool /*base1_owns_work*/, const executor_type& ex,
- const OtherExecutor& /*candidate*/) ASIO_NOEXCEPT
+ const OtherExecutor& /*candidate*/) noexcept
: executor_(asio::prefer(ex, execution::outstanding_work.tracked))
{
}
- handler_work_base(const handler_work_base& other) ASIO_NOEXCEPT
+ handler_work_base(const handler_work_base& other) noexcept
: executor_(other.executor_)
{
}
-#if defined(ASIO_HAS_MOVE)
- handler_work_base(handler_work_base&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(executor_type)(other.executor_))
+ handler_work_base(handler_work_base&& other) noexcept
+ : executor_(static_cast<executor_type&&>(other.executor_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
- bool owns_work() const ASIO_NOEXCEPT
+ bool owns_work() const noexcept
{
return !!executor_;
}
@@ -435,9 +395,7 @@ public:
template <typename Function, typename Handler>
void dispatch(Function& function, Handler&)
{
- execution::execute(
- asio::prefer(executor_, execution::blocking.possibly),
- ASIO_MOVE_CAST(Function)(function));
+ executor_.execute(static_cast<Function&&>(function));
}
private:
@@ -449,15 +407,14 @@ private:
template <typename Handler, typename IoExecutor, typename = void>
class handler_work :
handler_work_base<IoExecutor>,
- handler_work_base<typename associated_executor<
- Handler, IoExecutor>::type, IoExecutor>
+ handler_work_base<associated_executor_t<Handler, IoExecutor>, IoExecutor>
{
public:
typedef handler_work_base<IoExecutor> base1_type;
- typedef handler_work_base<typename associated_executor<
- Handler, IoExecutor>::type, IoExecutor> base2_type;
+ typedef handler_work_base<associated_executor_t<Handler, IoExecutor>,
+ IoExecutor> base2_type;
- handler_work(Handler& handler, const IoExecutor& io_ex) ASIO_NOEXCEPT
+ handler_work(Handler& handler, const IoExecutor& io_ex) noexcept
: base1_type(0, 0, io_ex),
base2_type(base1_type::owns_work(),
asio::get_associated_executor(handler, io_ex), io_ex)
@@ -472,7 +429,7 @@ public:
// When using a native implementation, I/O completion handlers are
// already dispatched according to the execution context's executor's
// rules. We can call the function directly.
- asio_handler_invoke_helpers::invoke(function, handler);
+ static_cast<Function&&>(function)();
}
else
{
@@ -484,18 +441,19 @@ public:
template <typename Handler, typename IoExecutor>
class handler_work<
Handler, IoExecutor,
- typename enable_if<
+ enable_if_t<
is_same<
typename associated_executor<Handler,
IoExecutor>::asio_associated_executor_is_unspecialised,
void
>::value
- >::type> : handler_work_base<IoExecutor>
+ >
+ > : handler_work_base<IoExecutor>
{
public:
typedef handler_work_base<IoExecutor> base1_type;
- handler_work(Handler&, const IoExecutor& io_ex) ASIO_NOEXCEPT
+ handler_work(Handler&, const IoExecutor& io_ex) noexcept
: base1_type(0, 0, io_ex)
{
}
@@ -508,7 +466,7 @@ public:
// When using a native implementation, I/O completion handlers are
// already dispatched according to the execution context's executor's
// rules. We can call the function directly.
- asio_handler_invoke_helpers::invoke(function, handler);
+ static_cast<Function&&>(function)();
}
else
{
@@ -517,6 +475,34 @@ public:
}
};
+template <typename Handler, typename IoExecutor>
+class immediate_handler_work
+{
+public:
+ typedef handler_work<Handler, IoExecutor> handler_work_type;
+
+ explicit immediate_handler_work(handler_work_type&& w)
+ : handler_work_(static_cast<handler_work_type&&>(w))
+ {
+ }
+
+ template <typename Function>
+ void complete(Function& function, Handler& handler, const void* io_ex)
+ {
+ typedef associated_immediate_executor_t<Handler, IoExecutor>
+ immediate_ex_type;
+
+ immediate_ex_type immediate_ex = (get_associated_immediate_executor)(
+ handler, *static_cast<const IoExecutor*>(io_ex));
+
+ (initiate_dispatch_with_executor<immediate_ex_type>(immediate_ex))(
+ static_cast<Function&&>(function));
+ }
+
+private:
+ handler_work_type handler_work_;
+};
+
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/hash_map.hpp b/3rdparty/asio/include/asio/detail/hash_map.hpp
index 78edec8bdd1..e23de914a18 100644
--- a/3rdparty/asio/include/asio/detail/hash_map.hpp
+++ b/3rdparty/asio/include/asio/detail/hash_map.hpp
@@ -2,7 +2,7 @@
// detail/hash_map.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp b/3rdparty/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp
index d7c5e35ba84..372ce426e57 100644
--- a/3rdparty/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp
@@ -2,7 +2,7 @@
// detail/impl/buffer_sequence_adapter.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/descriptor_ops.ipp b/3rdparty/asio/include/asio/detail/impl/descriptor_ops.ipp
index 9abf204a828..c56a512e462 100644
--- a/3rdparty/asio/include/asio/detail/impl/descriptor_ops.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/descriptor_ops.ipp
@@ -2,7 +2,7 @@
// detail/impl/descriptor_ops.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -37,6 +37,14 @@ int open(const char* path, int flags, asio::error_code& ec)
return result;
}
+int open(const char* path, int flags,
+ unsigned mode, asio::error_code& ec)
+{
+ int result = ::open(path, flags, mode);
+ get_last_error(ec, result < 0);
+ return result;
+}
+
int close(int d, state_type& state, asio::error_code& ec)
{
int result = 0;
@@ -61,7 +69,25 @@ int close(int d, state_type& state, asio::error_code& ec)
::fcntl(d, F_SETFL, flags & ~O_NONBLOCK);
#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = 0;
+# if defined(ENOTTY) || defined(ENOTCAPABLE)
+ result = ::ioctl(d, FIONBIO, &arg);
+ get_last_error(ec, result < 0);
+ if (false
+# if defined(ENOTTY)
+ || ec.value() == ENOTTY
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
+ || ec.value() == ENOTCAPABLE
+# endif // defined(ENOTCAPABLE)
+ )
+ {
+ int flags = ::fcntl(d, F_GETFL, 0);
+ if (flags >= 0)
+ ::fcntl(d, F_SETFL, flags & ~O_NONBLOCK);
+ }
+# else // defined(ENOTTY) || defined(ENOTCAPABLE)
::ioctl(d, FIONBIO, &arg);
+# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
state &= ~non_blocking;
@@ -95,6 +121,26 @@ bool set_user_non_blocking(int d, state_type& state,
ioctl_arg_type arg = (value ? 1 : 0);
int result = ::ioctl(d, FIONBIO, &arg);
get_last_error(ec, result < 0);
+# if defined(ENOTTY) || defined(ENOTCAPABLE)
+ if (false
+# if defined(ENOTTY)
+ || ec.value() == ENOTTY
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
+ || ec.value() == ENOTCAPABLE
+# endif // defined(ENOTCAPABLE)
+ )
+ {
+ result = ::fcntl(d, F_GETFL, 0);
+ get_last_error(ec, result < 0);
+ if (result >= 0)
+ {
+ int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
+ result = ::fcntl(d, F_SETFL, flag);
+ get_last_error(ec, result < 0);
+ }
+ }
+# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
if (result >= 0)
@@ -145,6 +191,26 @@ bool set_internal_non_blocking(int d, state_type& state,
ioctl_arg_type arg = (value ? 1 : 0);
int result = ::ioctl(d, FIONBIO, &arg);
get_last_error(ec, result < 0);
+# if defined(ENOTTY) || defined(ENOTCAPABLE)
+ if (false
+# if defined(ENOTTY)
+ || ec.value() == ENOTTY
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
+ || ec.value() == ENOTCAPABLE
+# endif // defined(ENOTCAPABLE)
+ )
+ {
+ result = ::fcntl(d, F_GETFL, 0);
+ get_last_error(ec, result < 0);
+ if (result >= 0)
+ {
+ int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
+ result = ::fcntl(d, F_SETFL, flag);
+ get_last_error(ec, result < 0);
+ }
+ }
+# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
if (result >= 0)
@@ -171,7 +237,7 @@ std::size_t sync_read(int d, state_type state, buf* bufs,
// A request to read 0 bytes on a stream is a no-op.
if (all_empty)
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -217,7 +283,7 @@ std::size_t sync_read1(int d, state_type state, void* data,
// A request to read 0 bytes on a stream is a no-op.
if (size == 0)
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -339,7 +405,7 @@ std::size_t sync_write(int d, state_type state, const buf* bufs,
// A request to write 0 bytes on a stream is a no-op.
if (all_empty)
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -378,7 +444,7 @@ std::size_t sync_write1(int d, state_type state, const void* data,
// A request to write 0 bytes on a stream is a no-op.
if (size == 0)
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -467,6 +533,323 @@ bool non_blocking_write1(int d, const void* data, std::size_t size,
}
}
+#if defined(ASIO_HAS_FILE)
+
+std::size_t sync_read_at(int d, state_type state, uint64_t offset,
+ buf* bufs, std::size_t count, bool all_empty, asio::error_code& ec)
+{
+ if (d == -1)
+ {
+ ec = asio::error::bad_descriptor;
+ return 0;
+ }
+
+ // A request to read 0 bytes on a stream is a no-op.
+ if (all_empty)
+ {
+ asio::error::clear(ec);
+ return 0;
+ }
+
+ // Read some data.
+ for (;;)
+ {
+ // Try to complete the operation without blocking.
+ signed_size_type bytes = ::preadv(d, bufs, static_cast<int>(count), offset);
+ get_last_error(ec, bytes < 0);
+
+ // Check if operation succeeded.
+ if (bytes > 0)
+ return bytes;
+
+ // Check for EOF.
+ if (bytes == 0)
+ {
+ ec = asio::error::eof;
+ return 0;
+ }
+
+ // Operation failed.
+ if ((state & user_set_non_blocking)
+ || (ec != asio::error::would_block
+ && ec != asio::error::try_again))
+ return 0;
+
+ // Wait for descriptor to become ready.
+ if (descriptor_ops::poll_read(d, 0, ec) < 0)
+ return 0;
+ }
+}
+
+std::size_t sync_read_at1(int d, state_type state, uint64_t offset,
+ void* data, std::size_t size, asio::error_code& ec)
+{
+ if (d == -1)
+ {
+ ec = asio::error::bad_descriptor;
+ return 0;
+ }
+
+ // A request to read 0 bytes on a stream is a no-op.
+ if (size == 0)
+ {
+ asio::error::clear(ec);
+ return 0;
+ }
+
+ // Read some data.
+ for (;;)
+ {
+ // Try to complete the operation without blocking.
+ signed_size_type bytes = ::pread(d, data, size, offset);
+ get_last_error(ec, bytes < 0);
+
+ // Check if operation succeeded.
+ if (bytes > 0)
+ return bytes;
+
+ // Check for EOF.
+ if (bytes == 0)
+ {
+ ec = asio::error::eof;
+ return 0;
+ }
+
+ // Operation failed.
+ if ((state & user_set_non_blocking)
+ || (ec != asio::error::would_block
+ && ec != asio::error::try_again))
+ return 0;
+
+ // Wait for descriptor to become ready.
+ if (descriptor_ops::poll_read(d, 0, ec) < 0)
+ return 0;
+ }
+}
+
+bool non_blocking_read_at(int d, uint64_t offset, buf* bufs, std::size_t count,
+ asio::error_code& ec, std::size_t& bytes_transferred)
+{
+ for (;;)
+ {
+ // Read some data.
+ signed_size_type bytes = ::preadv(d, bufs, static_cast<int>(count), offset);
+ get_last_error(ec, bytes < 0);
+
+ // Check for EOF.
+ if (bytes == 0)
+ {
+ ec = asio::error::eof;
+ return true;
+ }
+
+ // Check if operation succeeded.
+ if (bytes > 0)
+ {
+ bytes_transferred = bytes;
+ return true;
+ }
+
+ // Retry operation if interrupted by signal.
+ if (ec == asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == asio::error::would_block
+ || ec == asio::error::try_again)
+ return false;
+
+ // Operation failed.
+ bytes_transferred = 0;
+ return true;
+ }
+}
+
+bool non_blocking_read_at1(int d, uint64_t offset, void* data, std::size_t size,
+ asio::error_code& ec, std::size_t& bytes_transferred)
+{
+ for (;;)
+ {
+ // Read some data.
+ signed_size_type bytes = ::pread(d, data, size, offset);
+ get_last_error(ec, bytes < 0);
+
+ // Check for EOF.
+ if (bytes == 0)
+ {
+ ec = asio::error::eof;
+ return true;
+ }
+
+ // Check if operation succeeded.
+ if (bytes > 0)
+ {
+ bytes_transferred = bytes;
+ return true;
+ }
+
+ // Retry operation if interrupted by signal.
+ if (ec == asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == asio::error::would_block
+ || ec == asio::error::try_again)
+ return false;
+
+ // Operation failed.
+ bytes_transferred = 0;
+ return true;
+ }
+}
+
+std::size_t sync_write_at(int d, state_type state, uint64_t offset,
+ const buf* bufs, std::size_t count, bool all_empty,
+ asio::error_code& ec)
+{
+ if (d == -1)
+ {
+ ec = asio::error::bad_descriptor;
+ return 0;
+ }
+
+ // A request to write 0 bytes on a stream is a no-op.
+ if (all_empty)
+ {
+ asio::error::clear(ec);
+ return 0;
+ }
+
+ // Write some data.
+ for (;;)
+ {
+ // Try to complete the operation without blocking.
+ signed_size_type bytes = ::pwritev(d,
+ bufs, static_cast<int>(count), offset);
+ get_last_error(ec, bytes < 0);
+
+ // Check if operation succeeded.
+ if (bytes > 0)
+ return bytes;
+
+ // Operation failed.
+ if ((state & user_set_non_blocking)
+ || (ec != asio::error::would_block
+ && ec != asio::error::try_again))
+ return 0;
+
+ // Wait for descriptor to become ready.
+ if (descriptor_ops::poll_write(d, 0, ec) < 0)
+ return 0;
+ }
+}
+
+std::size_t sync_write_at1(int d, state_type state, uint64_t offset,
+ const void* data, std::size_t size, asio::error_code& ec)
+{
+ if (d == -1)
+ {
+ ec = asio::error::bad_descriptor;
+ return 0;
+ }
+
+ // A request to write 0 bytes on a stream is a no-op.
+ if (size == 0)
+ {
+ asio::error::clear(ec);
+ return 0;
+ }
+
+ // Write some data.
+ for (;;)
+ {
+ // Try to complete the operation without blocking.
+ signed_size_type bytes = ::pwrite(d, data, size, offset);
+ get_last_error(ec, bytes < 0);
+
+ // Check if operation succeeded.
+ if (bytes > 0)
+ return bytes;
+
+ // Operation failed.
+ if ((state & user_set_non_blocking)
+ || (ec != asio::error::would_block
+ && ec != asio::error::try_again))
+ return 0;
+
+ // Wait for descriptor to become ready.
+ if (descriptor_ops::poll_write(d, 0, ec) < 0)
+ return 0;
+ }
+}
+
+bool non_blocking_write_at(int d, uint64_t offset,
+ const buf* bufs, std::size_t count,
+ asio::error_code& ec, std::size_t& bytes_transferred)
+{
+ for (;;)
+ {
+ // Write some data.
+ signed_size_type bytes = ::pwritev(d,
+ bufs, static_cast<int>(count), offset);
+ get_last_error(ec, bytes < 0);
+
+ // Check if operation succeeded.
+ if (bytes >= 0)
+ {
+ bytes_transferred = bytes;
+ return true;
+ }
+
+ // Retry operation if interrupted by signal.
+ if (ec == asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == asio::error::would_block
+ || ec == asio::error::try_again)
+ return false;
+
+ // Operation failed.
+ bytes_transferred = 0;
+ return true;
+ }
+}
+
+bool non_blocking_write_at1(int d, uint64_t offset,
+ const void* data, std::size_t size,
+ asio::error_code& ec, std::size_t& bytes_transferred)
+{
+ for (;;)
+ {
+ // Write some data.
+ signed_size_type bytes = ::pwrite(d, data, size, offset);
+ get_last_error(ec, bytes < 0);
+
+ // Check if operation succeeded.
+ if (bytes >= 0)
+ {
+ bytes_transferred = bytes;
+ return true;
+ }
+
+ // Retry operation if interrupted by signal.
+ if (ec == asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == asio::error::would_block
+ || ec == asio::error::try_again)
+ return false;
+
+ // Operation failed.
+ bytes_transferred = 0;
+ return true;
+ }
+}
+
+#endif // defined(ASIO_HAS_FILE)
+
int ioctl(int d, state_type& state, long cmd,
ioctl_arg_type* arg, asio::error_code& ec)
{
diff --git a/3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.hpp b/3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.hpp
index f9babbb53a6..b483e44fd1c 100644
--- a/3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.hpp
@@ -2,7 +2,7 @@
// detail/impl/dev_poll_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -27,7 +27,7 @@ namespace asio {
namespace detail {
inline void dev_poll_reactor::post_immediate_completion(
- reactor_op* op, bool is_continuation)
+ operation* op, bool is_continuation) const
{
scheduler_.post_immediate_completion(op, is_continuation);
}
@@ -77,6 +77,18 @@ std::size_t dev_poll_reactor::cancel_timer(timer_queue<Time_Traits>& queue,
}
template <typename Time_Traits>
+void dev_poll_reactor::cancel_timer_by_key(timer_queue<Time_Traits>& queue,
+ typename timer_queue<Time_Traits>::per_timer_data* timer,
+ void* cancellation_key)
+{
+ asio::detail::mutex::scoped_lock lock(mutex_);
+ op_queue<operation> ops;
+ queue.cancel_timer_by_key(timer, ops, cancellation_key);
+ lock.unlock();
+ scheduler_.post_deferred_completions(ops);
+}
+
+template <typename Time_Traits>
void dev_poll_reactor::move_timer(timer_queue<Time_Traits>& queue,
typename timer_queue<Time_Traits>::per_timer_data& target,
typename timer_queue<Time_Traits>::per_timer_data& source)
diff --git a/3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.ipp b/3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.ipp
index 42efcd624aa..c9c53fbeafd 100644
--- a/3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/dev_poll_reactor.ipp
@@ -2,7 +2,7 @@
// detail/impl/dev_poll_reactor.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -148,15 +148,24 @@ void dev_poll_reactor::move_descriptor(socket_type,
{
}
+void dev_poll_reactor::call_post_immediate_completion(
+ operation* op, bool is_continuation, const void* self)
+{
+ static_cast<const dev_poll_reactor*>(self)->post_immediate_completion(
+ op, is_continuation);
+}
+
void dev_poll_reactor::start_op(int op_type, socket_type descriptor,
dev_poll_reactor::per_descriptor_data&, reactor_op* op,
- bool is_continuation, bool allow_speculative)
+ bool is_continuation, bool allow_speculative,
+ void (*on_immediate)(operation*, bool, const void*),
+ const void* immediate_arg)
{
asio::detail::mutex::scoped_lock lock(mutex_);
if (shutdown_)
{
- post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
@@ -169,7 +178,7 @@ void dev_poll_reactor::start_op(int op_type, socket_type descriptor,
if (op->perform())
{
lock.unlock();
- scheduler_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
}
diff --git a/3rdparty/asio/include/asio/detail/impl/epoll_reactor.hpp b/3rdparty/asio/include/asio/detail/impl/epoll_reactor.hpp
index 3055085f4a3..4fffeb75924 100644
--- a/3rdparty/asio/include/asio/detail/impl/epoll_reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/impl/epoll_reactor.hpp
@@ -2,7 +2,7 @@
// detail/impl/epoll_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -25,7 +25,7 @@ namespace asio {
namespace detail {
inline void epoll_reactor::post_immediate_completion(
- operation* op, bool is_continuation)
+ operation* op, bool is_continuation) const
{
scheduler_.post_immediate_completion(op, is_continuation);
}
diff --git a/3rdparty/asio/include/asio/detail/impl/epoll_reactor.ipp b/3rdparty/asio/include/asio/detail/impl/epoll_reactor.ipp
index 79ec5410767..51795bda40c 100644
--- a/3rdparty/asio/include/asio/detail/impl/epoll_reactor.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/epoll_reactor.ipp
@@ -2,7 +2,7 @@
// detail/impl/epoll_reactor.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -229,14 +229,23 @@ void epoll_reactor::move_descriptor(socket_type,
source_descriptor_data = 0;
}
+void epoll_reactor::call_post_immediate_completion(
+ operation* op, bool is_continuation, const void* self)
+{
+ static_cast<const epoll_reactor*>(self)->post_immediate_completion(
+ op, is_continuation);
+}
+
void epoll_reactor::start_op(int op_type, socket_type descriptor,
epoll_reactor::per_descriptor_data& descriptor_data, reactor_op* op,
- bool is_continuation, bool allow_speculative)
+ bool is_continuation, bool allow_speculative,
+ void (*on_immediate)(operation*, bool, const void*),
+ const void* immediate_arg)
{
if (!descriptor_data)
{
op->ec_ = asio::error::bad_descriptor;
- post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
@@ -244,7 +253,7 @@ void epoll_reactor::start_op(int op_type, socket_type descriptor,
if (descriptor_data->shutdown_)
{
- post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
@@ -262,7 +271,7 @@ void epoll_reactor::start_op(int op_type, socket_type descriptor,
if (descriptor_data->registered_events_ != 0)
descriptor_data->try_speculative_[op_type] = false;
descriptor_lock.unlock();
- scheduler_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
}
@@ -270,7 +279,7 @@ void epoll_reactor::start_op(int op_type, socket_type descriptor,
if (descriptor_data->registered_events_ == 0)
{
op->ec_ = asio::error::operation_not_supported;
- scheduler_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
@@ -289,7 +298,7 @@ void epoll_reactor::start_op(int op_type, socket_type descriptor,
{
op->ec_ = asio::error_code(errno,
asio::error::get_system_category());
- scheduler_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
}
@@ -298,7 +307,7 @@ void epoll_reactor::start_op(int op_type, socket_type descriptor,
else if (descriptor_data->registered_events_ == 0)
{
op->ec_ = asio::error::operation_not_supported;
- scheduler_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
else
diff --git a/3rdparty/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp b/3rdparty/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp
index 8ed61f8b7c9..2e970d8850b 100644
--- a/3rdparty/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp
@@ -2,7 +2,7 @@
// detail/impl/eventfd_select_interrupter.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/detail/impl/handler_tracking.ipp b/3rdparty/asio/include/asio/detail/impl/handler_tracking.ipp
index 79a87df09b5..f4e3e3b501a 100644
--- a/3rdparty/asio/include/asio/detail/impl/handler_tracking.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/handler_tracking.ipp
@@ -2,7 +2,7 @@
// detail/impl/handler_tracking.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -29,7 +29,7 @@
#if defined(ASIO_HAS_BOOST_DATE_TIME)
# include "asio/time_traits.hpp"
-#elif defined(ASIO_HAS_CHRONO)
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
# include "asio/detail/chrono.hpp"
# include "asio/detail/chrono_time_traits.hpp"
# include "asio/wait_traits.hpp"
@@ -57,12 +57,12 @@ struct handler_tracking_timestamp
boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
boost::posix_time::time_duration now =
boost::posix_time::microsec_clock::universal_time() - epoch;
-#elif defined(ASIO_HAS_CHRONO)
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
typedef chrono_time_traits<chrono::system_clock,
- asio::wait_traits<chrono::system_clock> > traits_helper;
+ asio::wait_traits<chrono::system_clock>> traits_helper;
traits_helper::posix_time_duration now(
chrono::system_clock::now().time_since_epoch());
-#endif
+#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
seconds = static_cast<uint64_t>(now.total_seconds());
microseconds = static_cast<uint64_t>(now.total_microseconds() % 1000000);
}
@@ -365,7 +365,9 @@ void handler_tracking::write_line(const char* format, ...)
va_start(args, format);
char line[256] = "";
-#if defined(ASIO_HAS_SECURE_RTL)
+#if defined(ASIO_HAS_SNPRINTF)
+ int length = vsnprintf(line, sizeof(line), format, args);
+#elif defined(ASIO_HAS_SECURE_RTL)
int length = vsprintf_s(line, sizeof(line), format, args);
#else // defined(ASIO_HAS_SECURE_RTL)
int length = vsprintf(line, format, args);
diff --git a/3rdparty/asio/include/asio/detail/impl/io_uring_descriptor_service.ipp b/3rdparty/asio/include/asio/detail/impl/io_uring_descriptor_service.ipp
new file mode 100644
index 00000000000..21b9e232cfb
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/impl/io_uring_descriptor_service.ipp
@@ -0,0 +1,205 @@
+//
+// detail/impl/io_uring_descriptor_service.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IMPL_IO_URING_DESCRIPTOR_SERVICE_IPP
+#define ASIO_DETAIL_IMPL_IO_URING_DESCRIPTOR_SERVICE_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/error.hpp"
+#include "asio/detail/io_uring_descriptor_service.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+io_uring_descriptor_service::io_uring_descriptor_service(
+ execution_context& context)
+ : execution_context_service_base<io_uring_descriptor_service>(context),
+ io_uring_service_(asio::use_service<io_uring_service>(context))
+{
+ io_uring_service_.init_task();
+}
+
+void io_uring_descriptor_service::shutdown()
+{
+}
+
+void io_uring_descriptor_service::construct(
+ io_uring_descriptor_service::implementation_type& impl)
+{
+ impl.descriptor_ = -1;
+ impl.state_ = 0;
+ impl.io_object_data_ = 0;
+}
+
+void io_uring_descriptor_service::move_construct(
+ io_uring_descriptor_service::implementation_type& impl,
+ io_uring_descriptor_service::implementation_type& other_impl)
+ noexcept
+{
+ impl.descriptor_ = other_impl.descriptor_;
+ other_impl.descriptor_ = -1;
+
+ impl.state_ = other_impl.state_;
+ other_impl.state_ = 0;
+
+ impl.io_object_data_ = other_impl.io_object_data_;
+ other_impl.io_object_data_ = 0;
+}
+
+void io_uring_descriptor_service::move_assign(
+ io_uring_descriptor_service::implementation_type& impl,
+ io_uring_descriptor_service& /*other_service*/,
+ io_uring_descriptor_service::implementation_type& other_impl)
+{
+ destroy(impl);
+
+ impl.descriptor_ = other_impl.descriptor_;
+ other_impl.descriptor_ = -1;
+
+ impl.state_ = other_impl.state_;
+ other_impl.state_ = 0;
+
+ impl.io_object_data_ = other_impl.io_object_data_;
+ other_impl.io_object_data_ = 0;
+}
+
+void io_uring_descriptor_service::destroy(
+ io_uring_descriptor_service::implementation_type& impl)
+{
+ if (is_open(impl))
+ {
+ ASIO_HANDLER_OPERATION((io_uring_service_.context(),
+ "descriptor", &impl, impl.descriptor_, "close"));
+
+ io_uring_service_.deregister_io_object(impl.io_object_data_);
+ asio::error_code ignored_ec;
+ descriptor_ops::close(impl.descriptor_, impl.state_, ignored_ec);
+ io_uring_service_.cleanup_io_object(impl.io_object_data_);
+ }
+}
+
+asio::error_code io_uring_descriptor_service::assign(
+ io_uring_descriptor_service::implementation_type& impl,
+ const native_handle_type& native_descriptor, asio::error_code& ec)
+{
+ if (is_open(impl))
+ {
+ ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ io_uring_service_.register_io_object(impl.io_object_data_);
+
+ impl.descriptor_ = native_descriptor;
+ impl.state_ = descriptor_ops::possible_dup;
+ ec = success_ec_;
+ return ec;
+}
+
+asio::error_code io_uring_descriptor_service::close(
+ io_uring_descriptor_service::implementation_type& impl,
+ asio::error_code& ec)
+{
+ if (is_open(impl))
+ {
+ ASIO_HANDLER_OPERATION((io_uring_service_.context(),
+ "descriptor", &impl, impl.descriptor_, "close"));
+
+ io_uring_service_.deregister_io_object(impl.io_object_data_);
+ descriptor_ops::close(impl.descriptor_, impl.state_, ec);
+ io_uring_service_.cleanup_io_object(impl.io_object_data_);
+ }
+ else
+ {
+ ec = success_ec_;
+ }
+
+ // The descriptor is closed by the OS even if close() returns an error.
+ //
+ // (Actually, POSIX says the state of the descriptor is unspecified. On
+ // Linux the descriptor is apparently closed anyway; e.g. see
+ // http://lkml.org/lkml/2005/9/10/129
+ construct(impl);
+
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+}
+
+io_uring_descriptor_service::native_handle_type
+io_uring_descriptor_service::release(
+ io_uring_descriptor_service::implementation_type& impl)
+{
+ native_handle_type descriptor = impl.descriptor_;
+
+ if (is_open(impl))
+ {
+ ASIO_HANDLER_OPERATION((io_uring_service_.context(),
+ "descriptor", &impl, impl.descriptor_, "release"));
+
+ io_uring_service_.deregister_io_object(impl.io_object_data_);
+ io_uring_service_.cleanup_io_object(impl.io_object_data_);
+ construct(impl);
+ }
+
+ return descriptor;
+}
+
+asio::error_code io_uring_descriptor_service::cancel(
+ io_uring_descriptor_service::implementation_type& impl,
+ asio::error_code& ec)
+{
+ if (!is_open(impl))
+ {
+ ec = asio::error::bad_descriptor;
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ ASIO_HANDLER_OPERATION((io_uring_service_.context(),
+ "descriptor", &impl, impl.descriptor_, "cancel"));
+
+ io_uring_service_.cancel_ops(impl.io_object_data_);
+ ec = success_ec_;
+ return ec;
+}
+
+void io_uring_descriptor_service::start_op(
+ io_uring_descriptor_service::implementation_type& impl,
+ int op_type, io_uring_operation* op, bool is_continuation, bool noop)
+{
+ if (!noop)
+ {
+ io_uring_service_.start_op(op_type,
+ impl.io_object_data_, op, is_continuation);
+ }
+ else
+ {
+ io_uring_service_.post_immediate_completion(op, is_continuation);
+ }
+}
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IMPL_IO_URING_DESCRIPTOR_SERVICE_IPP
diff --git a/3rdparty/asio/include/asio/detail/impl/io_uring_file_service.ipp b/3rdparty/asio/include/asio/detail/impl/io_uring_file_service.ipp
new file mode 100644
index 00000000000..4742a7190d3
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/impl/io_uring_file_service.ipp
@@ -0,0 +1,140 @@
+//
+// detail/impl/io_uring_file_service.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IMPL_IO_URING_FILE_SERVICE_IPP
+#define ASIO_DETAIL_IMPL_IO_URING_FILE_SERVICE_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_FILE) \
+ && defined(ASIO_HAS_IO_URING)
+
+#include <cstring>
+#include <sys/stat.h>
+#include "asio/detail/io_uring_file_service.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+io_uring_file_service::io_uring_file_service(
+ execution_context& context)
+ : execution_context_service_base<io_uring_file_service>(context),
+ descriptor_service_(context)
+{
+}
+
+void io_uring_file_service::shutdown()
+{
+ descriptor_service_.shutdown();
+}
+
+asio::error_code io_uring_file_service::open(
+ io_uring_file_service::implementation_type& impl,
+ const char* path, file_base::flags open_flags,
+ asio::error_code& ec)
+{
+ if (is_open(impl))
+ {
+ ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ descriptor_ops::state_type state = 0;
+ int fd = descriptor_ops::open(path, static_cast<int>(open_flags), 0777, ec);
+ if (fd < 0)
+ {
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // We're done. Take ownership of the serial port descriptor.
+ if (descriptor_service_.assign(impl, fd, ec))
+ {
+ asio::error_code ignored_ec;
+ descriptor_ops::close(fd, state, ignored_ec);
+ }
+
+ (void)::posix_fadvise(native_handle(impl), 0, 0,
+ impl.is_stream_ ? POSIX_FADV_SEQUENTIAL : POSIX_FADV_RANDOM);
+
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+}
+
+uint64_t io_uring_file_service::size(
+ const io_uring_file_service::implementation_type& impl,
+ asio::error_code& ec) const
+{
+ struct stat s;
+ int result = ::fstat(native_handle(impl), &s);
+ descriptor_ops::get_last_error(ec, result != 0);
+ ASIO_ERROR_LOCATION(ec);
+ return !ec ? s.st_size : 0;
+}
+
+asio::error_code io_uring_file_service::resize(
+ io_uring_file_service::implementation_type& impl,
+ uint64_t n, asio::error_code& ec)
+{
+ int result = ::ftruncate(native_handle(impl), n);
+ descriptor_ops::get_last_error(ec, result != 0);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+}
+
+asio::error_code io_uring_file_service::sync_all(
+ io_uring_file_service::implementation_type& impl,
+ asio::error_code& ec)
+{
+ int result = ::fsync(native_handle(impl));
+ descriptor_ops::get_last_error(ec, result != 0);
+ return ec;
+}
+
+asio::error_code io_uring_file_service::sync_data(
+ io_uring_file_service::implementation_type& impl,
+ asio::error_code& ec)
+{
+#if defined(_POSIX_SYNCHRONIZED_IO)
+ int result = ::fdatasync(native_handle(impl));
+#else // defined(_POSIX_SYNCHRONIZED_IO)
+ int result = ::fsync(native_handle(impl));
+#endif // defined(_POSIX_SYNCHRONIZED_IO)
+ descriptor_ops::get_last_error(ec, result != 0);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+}
+
+uint64_t io_uring_file_service::seek(
+ io_uring_file_service::implementation_type& impl, int64_t offset,
+ file_base::seek_basis whence, asio::error_code& ec)
+{
+ int64_t result = ::lseek(native_handle(impl), offset, whence);
+ descriptor_ops::get_last_error(ec, result < 0);
+ ASIO_ERROR_LOCATION(ec);
+ return !ec ? static_cast<uint64_t>(result) : 0;
+}
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_FILE)
+ // && defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IMPL_IO_URING_FILE_SERVICE_IPP
diff --git a/3rdparty/asio/include/asio/detail/impl/io_uring_service.hpp b/3rdparty/asio/include/asio/detail/impl/io_uring_service.hpp
new file mode 100644
index 00000000000..8dfab1e6d1d
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/impl/io_uring_service.hpp
@@ -0,0 +1,112 @@
+//
+// detail/impl/io_uring_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IMPL_IO_URING_SERVICE_HPP
+#define ASIO_DETAIL_IMPL_IO_URING_SERVICE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/scheduler.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+inline void io_uring_service::post_immediate_completion(
+ operation* op, bool is_continuation)
+{
+ scheduler_.post_immediate_completion(op, is_continuation);
+}
+
+template <typename Time_Traits>
+void io_uring_service::add_timer_queue(timer_queue<Time_Traits>& queue)
+{
+ do_add_timer_queue(queue);
+}
+
+template <typename Time_Traits>
+void io_uring_service::remove_timer_queue(timer_queue<Time_Traits>& queue)
+{
+ do_remove_timer_queue(queue);
+}
+
+template <typename Time_Traits>
+void io_uring_service::schedule_timer(timer_queue<Time_Traits>& queue,
+ const typename Time_Traits::time_type& time,
+ typename timer_queue<Time_Traits>::per_timer_data& timer, wait_op* op)
+{
+ mutex::scoped_lock lock(mutex_);
+
+ if (shutdown_)
+ {
+ scheduler_.post_immediate_completion(op, false);
+ return;
+ }
+
+ bool earliest = queue.enqueue_timer(time, timer, op);
+ scheduler_.work_started();
+ if (earliest)
+ {
+ update_timeout();
+ post_submit_sqes_op(lock);
+ }
+}
+
+template <typename Time_Traits>
+std::size_t io_uring_service::cancel_timer(timer_queue<Time_Traits>& queue,
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled)
+{
+ mutex::scoped_lock lock(mutex_);
+ op_queue<operation> ops;
+ std::size_t n = queue.cancel_timer(timer, ops, max_cancelled);
+ lock.unlock();
+ scheduler_.post_deferred_completions(ops);
+ return n;
+}
+
+template <typename Time_Traits>
+void io_uring_service::cancel_timer_by_key(timer_queue<Time_Traits>& queue,
+ typename timer_queue<Time_Traits>::per_timer_data* timer,
+ void* cancellation_key)
+{
+ mutex::scoped_lock lock(mutex_);
+ op_queue<operation> ops;
+ queue.cancel_timer_by_key(timer, ops, cancellation_key);
+ lock.unlock();
+ scheduler_.post_deferred_completions(ops);
+}
+
+template <typename Time_Traits>
+void io_uring_service::move_timer(timer_queue<Time_Traits>& queue,
+ typename timer_queue<Time_Traits>::per_timer_data& target,
+ typename timer_queue<Time_Traits>::per_timer_data& source)
+{
+ mutex::scoped_lock lock(mutex_);
+ op_queue<operation> ops;
+ queue.cancel_timer(target, ops);
+ queue.move_timer(target, source);
+ lock.unlock();
+ scheduler_.post_deferred_completions(ops);
+}
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IMPL_IO_URING_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/detail/impl/io_uring_service.ipp b/3rdparty/asio/include/asio/detail/impl/io_uring_service.ipp
new file mode 100644
index 00000000000..740010cda11
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/impl/io_uring_service.ipp
@@ -0,0 +1,914 @@
+//
+// detail/impl/io_uring_service.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IMPL_IO_URING_SERVICE_IPP
+#define ASIO_DETAIL_IMPL_IO_URING_SERVICE_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include <cstddef>
+#include <sys/eventfd.h>
+#include "asio/detail/io_uring_service.hpp"
+#include "asio/detail/reactor_op.hpp"
+#include "asio/detail/scheduler.hpp"
+#include "asio/detail/throw_error.hpp"
+#include "asio/error.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+io_uring_service::io_uring_service(asio::execution_context& ctx)
+ : execution_context_service_base<io_uring_service>(ctx),
+ scheduler_(use_service<scheduler>(ctx)),
+ mutex_(ASIO_CONCURRENCY_HINT_IS_LOCKING(
+ REACTOR_REGISTRATION, scheduler_.concurrency_hint())),
+ outstanding_work_(0),
+ submit_sqes_op_(this),
+ pending_sqes_(0),
+ pending_submit_sqes_op_(false),
+ shutdown_(false),
+ timeout_(),
+ registration_mutex_(mutex_.enabled()),
+ reactor_(use_service<reactor>(ctx)),
+ reactor_data_(),
+ event_fd_(-1)
+{
+ reactor_.init_task();
+ init_ring();
+ register_with_reactor();
+}
+
+io_uring_service::~io_uring_service()
+{
+ if (ring_.ring_fd != -1)
+ ::io_uring_queue_exit(&ring_);
+ if (event_fd_ != -1)
+ ::close(event_fd_);
+}
+
+void io_uring_service::shutdown()
+{
+ mutex::scoped_lock lock(mutex_);
+ shutdown_ = true;
+ lock.unlock();
+
+ op_queue<operation> ops;
+
+ // Cancel all outstanding operations.
+ while (io_object* io_obj = registered_io_objects_.first())
+ {
+ for (int i = 0; i < max_ops; ++i)
+ {
+ if (!io_obj->queues_[i].op_queue_.empty())
+ {
+ ops.push(io_obj->queues_[i].op_queue_);
+ if (::io_uring_sqe* sqe = get_sqe())
+ ::io_uring_prep_cancel(sqe, &io_obj->queues_[i], 0);
+ }
+ }
+ io_obj->shutdown_ = true;
+ registered_io_objects_.free(io_obj);
+ }
+
+ // Cancel the timeout operation.
+ if (::io_uring_sqe* sqe = get_sqe())
+ ::io_uring_prep_cancel(sqe, &timeout_, IOSQE_IO_DRAIN);
+ submit_sqes();
+
+ // Wait for all completions to come back.
+ for (; outstanding_work_ > 0; --outstanding_work_)
+ {
+ ::io_uring_cqe* cqe = 0;
+ if (::io_uring_wait_cqe(&ring_, &cqe) != 0)
+ break;
+ }
+
+ timer_queues_.get_all_timers(ops);
+
+ scheduler_.abandon_operations(ops);
+}
+
+void io_uring_service::notify_fork(
+ asio::execution_context::fork_event fork_ev)
+{
+ switch (fork_ev)
+ {
+ case asio::execution_context::fork_prepare:
+ {
+ // Cancel all outstanding operations. They will be restarted
+ // after the fork completes.
+ mutex::scoped_lock registration_lock(registration_mutex_);
+ for (io_object* io_obj = registered_io_objects_.first();
+ io_obj != 0; io_obj = io_obj->next_)
+ {
+ mutex::scoped_lock io_object_lock(io_obj->mutex_);
+ for (int i = 0; i < max_ops; ++i)
+ {
+ if (!io_obj->queues_[i].op_queue_.empty()
+ && !io_obj->queues_[i].cancel_requested_)
+ {
+ mutex::scoped_lock lock(mutex_);
+ if (::io_uring_sqe* sqe = get_sqe())
+ ::io_uring_prep_cancel(sqe, &io_obj->queues_[i], 0);
+ }
+ }
+ }
+
+ // Cancel the timeout operation.
+ {
+ mutex::scoped_lock lock(mutex_);
+ if (::io_uring_sqe* sqe = get_sqe())
+ ::io_uring_prep_cancel(sqe, &timeout_, IOSQE_IO_DRAIN);
+ submit_sqes();
+ }
+
+ // Wait for all completions to come back, and post all completed I/O
+ // queues to the scheduler. Note that some operations may have already
+ // completed, or were explicitly cancelled. All others will be
+ // automatically restarted.
+ op_queue<operation> ops;
+ for (; outstanding_work_ > 0; --outstanding_work_)
+ {
+ ::io_uring_cqe* cqe = 0;
+ if (::io_uring_wait_cqe(&ring_, &cqe) != 0)
+ break;
+ if (void* ptr = ::io_uring_cqe_get_data(cqe))
+ {
+ if (ptr != this && ptr != &timer_queues_ && ptr != &timeout_)
+ {
+ io_queue* io_q = static_cast<io_queue*>(ptr);
+ io_q->set_result(cqe->res);
+ ops.push(io_q);
+ }
+ }
+ }
+ scheduler_.post_deferred_completions(ops);
+
+ // Restart and eventfd operation.
+ register_with_reactor();
+ }
+ break;
+
+ case asio::execution_context::fork_parent:
+ // Restart the timeout and eventfd operations.
+ update_timeout();
+ register_with_reactor();
+ break;
+
+ case asio::execution_context::fork_child:
+ {
+ // The child process gets a new io_uring instance.
+ ::io_uring_queue_exit(&ring_);
+ init_ring();
+ register_with_reactor();
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void io_uring_service::init_task()
+{
+ scheduler_.init_task();
+}
+
+void io_uring_service::register_io_object(
+ io_uring_service::per_io_object_data& io_obj)
+{
+ io_obj = allocate_io_object();
+
+ mutex::scoped_lock io_object_lock(io_obj->mutex_);
+
+ io_obj->service_ = this;
+ io_obj->shutdown_ = false;
+ for (int i = 0; i < max_ops; ++i)
+ {
+ io_obj->queues_[i].io_object_ = io_obj;
+ io_obj->queues_[i].cancel_requested_ = false;
+ }
+}
+
+void io_uring_service::register_internal_io_object(
+ io_uring_service::per_io_object_data& io_obj,
+ int op_type, io_uring_operation* op)
+{
+ io_obj = allocate_io_object();
+
+ mutex::scoped_lock io_object_lock(io_obj->mutex_);
+
+ io_obj->service_ = this;
+ io_obj->shutdown_ = false;
+ for (int i = 0; i < max_ops; ++i)
+ {
+ io_obj->queues_[i].io_object_ = io_obj;
+ io_obj->queues_[i].cancel_requested_ = false;
+ }
+
+ io_obj->queues_[op_type].op_queue_.push(op);
+ io_object_lock.unlock();
+ mutex::scoped_lock lock(mutex_);
+ if (::io_uring_sqe* sqe = get_sqe())
+ {
+ op->prepare(sqe);
+ ::io_uring_sqe_set_data(sqe, &io_obj->queues_[op_type]);
+ post_submit_sqes_op(lock);
+ }
+ else
+ {
+ asio::error_code ec(ENOBUFS,
+ asio::error::get_system_category());
+ asio::detail::throw_error(ec, "io_uring_get_sqe");
+ }
+}
+
+void io_uring_service::register_buffers(const ::iovec* v, unsigned n)
+{
+ int result = ::io_uring_register_buffers(&ring_, v, n);
+ if (result < 0)
+ {
+ asio::error_code ec(-result,
+ asio::error::get_system_category());
+ asio::detail::throw_error(ec, "io_uring_register_buffers");
+ }
+}
+
+void io_uring_service::unregister_buffers()
+{
+ (void)::io_uring_unregister_buffers(&ring_);
+}
+
+void io_uring_service::start_op(int op_type,
+ io_uring_service::per_io_object_data& io_obj,
+ io_uring_operation* op, bool is_continuation)
+{
+ if (!io_obj)
+ {
+ op->ec_ = asio::error::bad_descriptor;
+ post_immediate_completion(op, is_continuation);
+ return;
+ }
+
+ mutex::scoped_lock io_object_lock(io_obj->mutex_);
+
+ if (io_obj->shutdown_)
+ {
+ io_object_lock.unlock();
+ post_immediate_completion(op, is_continuation);
+ return;
+ }
+
+ if (io_obj->queues_[op_type].op_queue_.empty())
+ {
+ if (op->perform(false))
+ {
+ io_object_lock.unlock();
+ scheduler_.post_immediate_completion(op, is_continuation);
+ }
+ else
+ {
+ io_obj->queues_[op_type].op_queue_.push(op);
+ io_object_lock.unlock();
+ mutex::scoped_lock lock(mutex_);
+ if (::io_uring_sqe* sqe = get_sqe())
+ {
+ op->prepare(sqe);
+ ::io_uring_sqe_set_data(sqe, &io_obj->queues_[op_type]);
+ scheduler_.work_started();
+ post_submit_sqes_op(lock);
+ }
+ else
+ {
+ lock.unlock();
+ io_obj->queues_[op_type].set_result(-ENOBUFS);
+ post_immediate_completion(&io_obj->queues_[op_type], is_continuation);
+ }
+ }
+ }
+ else
+ {
+ io_obj->queues_[op_type].op_queue_.push(op);
+ scheduler_.work_started();
+ }
+}
+
+void io_uring_service::cancel_ops(io_uring_service::per_io_object_data& io_obj)
+{
+ if (!io_obj)
+ return;
+
+ mutex::scoped_lock io_object_lock(io_obj->mutex_);
+ op_queue<operation> ops;
+ do_cancel_ops(io_obj, ops);
+ io_object_lock.unlock();
+ scheduler_.post_deferred_completions(ops);
+}
+
+void io_uring_service::cancel_ops_by_key(
+ io_uring_service::per_io_object_data& io_obj,
+ int op_type, void* cancellation_key)
+{
+ if (!io_obj)
+ return;
+
+ mutex::scoped_lock io_object_lock(io_obj->mutex_);
+
+ bool first = true;
+ op_queue<operation> ops;
+ op_queue<io_uring_operation> other_ops;
+ while (io_uring_operation* op = io_obj->queues_[op_type].op_queue_.front())
+ {
+ io_obj->queues_[op_type].op_queue_.pop();
+ if (op->cancellation_key_ == cancellation_key)
+ {
+ if (first)
+ {
+ other_ops.push(op);
+ if (!io_obj->queues_[op_type].cancel_requested_)
+ {
+ io_obj->queues_[op_type].cancel_requested_ = true;
+ mutex::scoped_lock lock(mutex_);
+ if (::io_uring_sqe* sqe = get_sqe())
+ {
+ ::io_uring_prep_cancel(sqe, &io_obj->queues_[op_type], 0);
+ submit_sqes();
+ }
+ }
+ }
+ else
+ {
+ op->ec_ = asio::error::operation_aborted;
+ ops.push(op);
+ }
+ }
+ else
+ other_ops.push(op);
+ first = false;
+ }
+ io_obj->queues_[op_type].op_queue_.push(other_ops);
+
+ io_object_lock.unlock();
+
+ scheduler_.post_deferred_completions(ops);
+}
+
+void io_uring_service::deregister_io_object(
+ io_uring_service::per_io_object_data& io_obj)
+{
+ if (!io_obj)
+ return;
+
+ mutex::scoped_lock io_object_lock(io_obj->mutex_);
+ if (!io_obj->shutdown_)
+ {
+ op_queue<operation> ops;
+ bool pending_cancelled_ops = do_cancel_ops(io_obj, ops);
+ io_obj->shutdown_ = true;
+ io_object_lock.unlock();
+ scheduler_.post_deferred_completions(ops);
+ if (pending_cancelled_ops)
+ {
+ // There are still pending operations. Prevent cleanup_io_object from
+ // freeing the I/O object and let the last operation to complete free it.
+ io_obj = 0;
+ }
+ else
+ {
+ // Leave io_obj set so that it will be freed by the subsequent call to
+ // cleanup_io_object.
+ }
+ }
+ else
+ {
+ // We are shutting down, so prevent cleanup_io_object from freeing
+ // the I/O object and let the destructor free it instead.
+ io_obj = 0;
+ }
+}
+
+void io_uring_service::cleanup_io_object(
+ io_uring_service::per_io_object_data& io_obj)
+{
+ if (io_obj)
+ {
+ free_io_object(io_obj);
+ io_obj = 0;
+ }
+}
+
+void io_uring_service::run(long usec, op_queue<operation>& ops)
+{
+ __kernel_timespec ts;
+ int local_ops = 0;
+
+ if (usec > 0)
+ {
+ ts.tv_sec = usec / 1000000;
+ ts.tv_nsec = (usec % 1000000) * 1000;
+ mutex::scoped_lock lock(mutex_);
+ if (::io_uring_sqe* sqe = get_sqe())
+ {
+ ++local_ops;
+ ::io_uring_prep_timeout(sqe, &ts, 0, 0);
+ ::io_uring_sqe_set_data(sqe, &ts);
+ submit_sqes();
+ }
+ }
+
+ ::io_uring_cqe* cqe = 0;
+ int result = (usec == 0)
+ ? ::io_uring_peek_cqe(&ring_, &cqe)
+ : ::io_uring_wait_cqe(&ring_, &cqe);
+
+ if (local_ops > 0)
+ {
+ if (result != 0 || ::io_uring_cqe_get_data(cqe) != &ts)
+ {
+ mutex::scoped_lock lock(mutex_);
+ if (::io_uring_sqe* sqe = get_sqe())
+ {
+ ++local_ops;
+ ::io_uring_prep_timeout_remove(sqe, reinterpret_cast<__u64>(&ts), 0);
+ ::io_uring_sqe_set_data(sqe, &ts);
+ submit_sqes();
+ }
+ }
+ }
+
+ bool check_timers = false;
+ int count = 0;
+ while (result == 0 || local_ops > 0)
+ {
+ if (result == 0)
+ {
+ if (void* ptr = ::io_uring_cqe_get_data(cqe))
+ {
+ if (ptr == this)
+ {
+ // The io_uring service was interrupted.
+ }
+ else if (ptr == &timer_queues_)
+ {
+ check_timers = true;
+ }
+ else if (ptr == &timeout_)
+ {
+ check_timers = true;
+ timeout_.tv_sec = 0;
+ timeout_.tv_nsec = 0;
+ }
+ else if (ptr == &ts)
+ {
+ --local_ops;
+ }
+ else
+ {
+ io_queue* io_q = static_cast<io_queue*>(ptr);
+ io_q->set_result(cqe->res);
+ ops.push(io_q);
+ }
+ }
+ ::io_uring_cqe_seen(&ring_, cqe);
+ ++count;
+ }
+ result = (count < complete_batch_size || local_ops > 0)
+ ? ::io_uring_peek_cqe(&ring_, &cqe) : -EAGAIN;
+ }
+
+ decrement(outstanding_work_, count);
+
+ if (check_timers)
+ {
+ mutex::scoped_lock lock(mutex_);
+ timer_queues_.get_ready_timers(ops);
+ if (timeout_.tv_sec == 0 && timeout_.tv_nsec == 0)
+ {
+ timeout_ = get_timeout();
+ if (::io_uring_sqe* sqe = get_sqe())
+ {
+ ::io_uring_prep_timeout(sqe, &timeout_, 0, 0);
+ ::io_uring_sqe_set_data(sqe, &timeout_);
+ push_submit_sqes_op(ops);
+ }
+ }
+ }
+}
+
+void io_uring_service::interrupt()
+{
+ mutex::scoped_lock lock(mutex_);
+ if (::io_uring_sqe* sqe = get_sqe())
+ {
+ ::io_uring_prep_nop(sqe);
+ ::io_uring_sqe_set_data(sqe, this);
+ }
+ submit_sqes();
+}
+
+void io_uring_service::init_ring()
+{
+ int result = ::io_uring_queue_init(ring_size, &ring_, 0);
+ if (result < 0)
+ {
+ ring_.ring_fd = -1;
+ asio::error_code ec(-result,
+ asio::error::get_system_category());
+ asio::detail::throw_error(ec, "io_uring_queue_init");
+ }
+
+#if !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ event_fd_ = ::eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
+ if (event_fd_ < 0)
+ {
+ asio::error_code ec(-result,
+ asio::error::get_system_category());
+ ::io_uring_queue_exit(&ring_);
+ asio::detail::throw_error(ec, "eventfd");
+ }
+
+ result = ::io_uring_register_eventfd(&ring_, event_fd_);
+ if (result < 0)
+ {
+ ::close(event_fd_);
+ ::io_uring_queue_exit(&ring_);
+ asio::error_code ec(-result,
+ asio::error::get_system_category());
+ asio::detail::throw_error(ec, "io_uring_queue_init");
+ }
+#endif // !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+}
+
+#if !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+class io_uring_service::event_fd_read_op :
+ public reactor_op
+{
+public:
+ event_fd_read_op(io_uring_service* s)
+ : reactor_op(asio::error_code(),
+ &event_fd_read_op::do_perform, event_fd_read_op::do_complete),
+ service_(s)
+ {
+ }
+
+ static status do_perform(reactor_op* base)
+ {
+ event_fd_read_op* o(static_cast<event_fd_read_op*>(base));
+
+ for (;;)
+ {
+ // Only perform one read. The kernel maintains an atomic counter.
+ uint64_t counter(0);
+ errno = 0;
+ int bytes_read = ::read(o->service_->event_fd_,
+ &counter, sizeof(uint64_t));
+ if (bytes_read < 0 && errno == EINTR)
+ continue;
+ break;
+ }
+
+ op_queue<operation> ops;
+ o->service_->run(0, ops);
+ o->service_->scheduler_.post_deferred_completions(ops);
+
+ return not_done;
+ }
+
+ static void do_complete(void* /*owner*/, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ event_fd_read_op* o(static_cast<event_fd_read_op*>(base));
+ delete o;
+ }
+
+private:
+ io_uring_service* service_;
+};
+#endif // !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+
+void io_uring_service::register_with_reactor()
+{
+#if !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ reactor_.register_internal_descriptor(reactor::read_op,
+ event_fd_, reactor_data_, new event_fd_read_op(this));
+#endif // !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+}
+
+io_uring_service::io_object* io_uring_service::allocate_io_object()
+{
+ mutex::scoped_lock registration_lock(registration_mutex_);
+ return registered_io_objects_.alloc(
+ ASIO_CONCURRENCY_HINT_IS_LOCKING(
+ REACTOR_IO, scheduler_.concurrency_hint()));
+}
+
+void io_uring_service::free_io_object(io_uring_service::io_object* io_obj)
+{
+ mutex::scoped_lock registration_lock(registration_mutex_);
+ registered_io_objects_.free(io_obj);
+}
+
+bool io_uring_service::do_cancel_ops(
+ per_io_object_data& io_obj, op_queue<operation>& ops)
+{
+ bool cancel_op = false;
+
+ for (int i = 0; i < max_ops; ++i)
+ {
+ if (io_uring_operation* first_op = io_obj->queues_[i].op_queue_.front())
+ {
+ cancel_op = true;
+ io_obj->queues_[i].op_queue_.pop();
+ while (io_uring_operation* op = io_obj->queues_[i].op_queue_.front())
+ {
+ op->ec_ = asio::error::operation_aborted;
+ io_obj->queues_[i].op_queue_.pop();
+ ops.push(op);
+ }
+ io_obj->queues_[i].op_queue_.push(first_op);
+ }
+ }
+
+ if (cancel_op)
+ {
+ mutex::scoped_lock lock(mutex_);
+ for (int i = 0; i < max_ops; ++i)
+ {
+ if (!io_obj->queues_[i].op_queue_.empty()
+ && !io_obj->queues_[i].cancel_requested_)
+ {
+ io_obj->queues_[i].cancel_requested_ = true;
+ if (::io_uring_sqe* sqe = get_sqe())
+ ::io_uring_prep_cancel(sqe, &io_obj->queues_[i], 0);
+ }
+ }
+ submit_sqes();
+ }
+
+ return cancel_op;
+}
+
+void io_uring_service::do_add_timer_queue(timer_queue_base& queue)
+{
+ mutex::scoped_lock lock(mutex_);
+ timer_queues_.insert(&queue);
+}
+
+void io_uring_service::do_remove_timer_queue(timer_queue_base& queue)
+{
+ mutex::scoped_lock lock(mutex_);
+ timer_queues_.erase(&queue);
+}
+
+void io_uring_service::update_timeout()
+{
+ if (::io_uring_sqe* sqe = get_sqe())
+ {
+ ::io_uring_prep_timeout_remove(sqe, reinterpret_cast<__u64>(&timeout_), 0);
+ ::io_uring_sqe_set_data(sqe, &timer_queues_);
+ }
+}
+
+__kernel_timespec io_uring_service::get_timeout() const
+{
+ __kernel_timespec ts;
+ long usec = timer_queues_.wait_duration_usec(5 * 60 * 1000 * 1000);
+ ts.tv_sec = usec / 1000000;
+ ts.tv_nsec = usec ? (usec % 1000000) * 1000 : 1;
+ return ts;
+}
+
+::io_uring_sqe* io_uring_service::get_sqe()
+{
+ ::io_uring_sqe* sqe = ::io_uring_get_sqe(&ring_);
+ if (!sqe)
+ {
+ submit_sqes();
+ sqe = ::io_uring_get_sqe(&ring_);
+ }
+ if (sqe)
+ {
+ ::io_uring_sqe_set_data(sqe, 0);
+ ++pending_sqes_;
+ }
+ return sqe;
+}
+
+void io_uring_service::submit_sqes()
+{
+ if (pending_sqes_ != 0)
+ {
+ int result = ::io_uring_submit(&ring_);
+ if (result > 0)
+ {
+ pending_sqes_ -= result;
+ increment(outstanding_work_, result);
+ }
+ }
+}
+
+void io_uring_service::post_submit_sqes_op(mutex::scoped_lock& lock)
+{
+ if (pending_sqes_ >= submit_batch_size)
+ {
+ submit_sqes();
+ }
+ else if (pending_sqes_ != 0 && !pending_submit_sqes_op_)
+ {
+ pending_submit_sqes_op_ = true;
+ lock.unlock();
+ scheduler_.post_immediate_completion(&submit_sqes_op_, false);
+ }
+}
+
+void io_uring_service::push_submit_sqes_op(op_queue<operation>& ops)
+{
+ if (pending_sqes_ != 0 && !pending_submit_sqes_op_)
+ {
+ pending_submit_sqes_op_ = true;
+ ops.push(&submit_sqes_op_);
+ scheduler_.compensating_work_started();
+ }
+}
+
+io_uring_service::submit_sqes_op::submit_sqes_op(io_uring_service* s)
+ : operation(&io_uring_service::submit_sqes_op::do_complete),
+ service_(s)
+{
+}
+
+void io_uring_service::submit_sqes_op::do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/, std::size_t /*bytes_transferred*/)
+{
+ if (owner)
+ {
+ submit_sqes_op* o = static_cast<submit_sqes_op*>(base);
+ mutex::scoped_lock lock(o->service_->mutex_);
+ o->service_->submit_sqes();
+ if (o->service_->pending_sqes_ != 0)
+ o->service_->scheduler_.post_immediate_completion(o, true);
+ else
+ o->service_->pending_submit_sqes_op_ = false;
+ }
+}
+
+io_uring_service::io_queue::io_queue()
+ : operation(&io_uring_service::io_queue::do_complete)
+{
+}
+
+struct io_uring_service::perform_io_cleanup_on_block_exit
+{
+ explicit perform_io_cleanup_on_block_exit(io_uring_service* s)
+ : service_(s), io_object_to_free_(0), first_op_(0)
+ {
+ }
+
+ ~perform_io_cleanup_on_block_exit()
+ {
+ if (io_object_to_free_)
+ {
+ mutex::scoped_lock lock(service_->mutex_);
+ service_->free_io_object(io_object_to_free_);
+ }
+
+ if (first_op_)
+ {
+ // Post the remaining completed operations for invocation.
+ if (!ops_.empty())
+ service_->scheduler_.post_deferred_completions(ops_);
+
+ // A user-initiated operation has completed, but there's no need to
+ // explicitly call work_finished() here. Instead, we'll take advantage of
+ // the fact that the scheduler will call work_finished() once we return.
+ }
+ else
+ {
+ // No user-initiated operations have completed, so we need to compensate
+ // for the work_finished() call that the scheduler will make once this
+ // operation returns.
+ service_->scheduler_.compensating_work_started();
+ }
+ }
+
+ io_uring_service* service_;
+ io_object* io_object_to_free_;
+ op_queue<operation> ops_;
+ operation* first_op_;
+};
+
+operation* io_uring_service::io_queue::perform_io(int result)
+{
+ perform_io_cleanup_on_block_exit io_cleanup(io_object_->service_);
+ mutex::scoped_lock io_object_lock(io_object_->mutex_);
+
+ if (result != -ECANCELED || cancel_requested_)
+ {
+ if (io_uring_operation* op = op_queue_.front())
+ {
+ if (result < 0)
+ {
+ op->ec_.assign(-result, asio::error::get_system_category());
+ op->bytes_transferred_ = 0;
+ }
+ else
+ {
+ op->ec_.assign(0, op->ec_.category());
+ op->bytes_transferred_ = static_cast<std::size_t>(result);
+ }
+ }
+
+ while (io_uring_operation* op = op_queue_.front())
+ {
+ if (op->perform(io_cleanup.ops_.empty()))
+ {
+ op_queue_.pop();
+ io_cleanup.ops_.push(op);
+ }
+ else
+ break;
+ }
+ }
+
+ cancel_requested_ = false;
+
+ if (!op_queue_.empty())
+ {
+ io_uring_service* service = io_object_->service_;
+ mutex::scoped_lock lock(service->mutex_);
+ if (::io_uring_sqe* sqe = service->get_sqe())
+ {
+ op_queue_.front()->prepare(sqe);
+ ::io_uring_sqe_set_data(sqe, this);
+ service->post_submit_sqes_op(lock);
+ }
+ else
+ {
+ lock.unlock();
+ while (io_uring_operation* op = op_queue_.front())
+ {
+ op->ec_ = asio::error::no_buffer_space;
+ op_queue_.pop();
+ io_cleanup.ops_.push(op);
+ }
+ }
+ }
+
+ // The last operation to complete on a shut down object must free it.
+ if (io_object_->shutdown_)
+ {
+ io_cleanup.io_object_to_free_ = io_object_;
+ for (int i = 0; i < max_ops; ++i)
+ if (!io_object_->queues_[i].op_queue_.empty())
+ io_cleanup.io_object_to_free_ = 0;
+ }
+
+ // The first operation will be returned for completion now. The others will
+ // be posted for later by the io_cleanup object's destructor.
+ io_cleanup.first_op_ = io_cleanup.ops_.front();
+ io_cleanup.ops_.pop();
+ return io_cleanup.first_op_;
+}
+
+void io_uring_service::io_queue::do_complete(void* owner, operation* base,
+ const asio::error_code& ec, std::size_t bytes_transferred)
+{
+ if (owner)
+ {
+ io_queue* io_q = static_cast<io_queue*>(base);
+ int result = static_cast<int>(bytes_transferred);
+ if (operation* op = io_q->perform_io(result))
+ {
+ op->complete(owner, ec, 0);
+ }
+ }
+}
+
+io_uring_service::io_object::io_object(bool locking)
+ : mutex_(locking)
+{
+}
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IMPL_IO_URING_SERVICE_IPP
diff --git a/3rdparty/asio/include/asio/detail/impl/io_uring_socket_service_base.ipp b/3rdparty/asio/include/asio/detail/impl/io_uring_socket_service_base.ipp
new file mode 100644
index 00000000000..79302fdc6f6
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/impl/io_uring_socket_service_base.ipp
@@ -0,0 +1,249 @@
+//
+// detail/io_uring_socket_service_base.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IMPL_IO_URING_SOCKET_SERVICE_BASE_IPP
+#define ASIO_DETAIL_IMPL_IO_URING_SOCKET_SERVICE_BASE_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/io_uring_socket_service_base.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+io_uring_socket_service_base::io_uring_socket_service_base(
+ execution_context& context)
+ : io_uring_service_(asio::use_service<io_uring_service>(context))
+{
+ io_uring_service_.init_task();
+}
+
+void io_uring_socket_service_base::base_shutdown()
+{
+}
+
+void io_uring_socket_service_base::construct(
+ io_uring_socket_service_base::base_implementation_type& impl)
+{
+ impl.socket_ = invalid_socket;
+ impl.state_ = 0;
+ impl.io_object_data_ = 0;
+}
+
+void io_uring_socket_service_base::base_move_construct(
+ io_uring_socket_service_base::base_implementation_type& impl,
+ io_uring_socket_service_base::base_implementation_type& other_impl)
+ noexcept
+{
+ impl.socket_ = other_impl.socket_;
+ other_impl.socket_ = invalid_socket;
+
+ impl.state_ = other_impl.state_;
+ other_impl.state_ = 0;
+
+ impl.io_object_data_ = other_impl.io_object_data_;
+ other_impl.io_object_data_ = 0;
+}
+
+void io_uring_socket_service_base::base_move_assign(
+ io_uring_socket_service_base::base_implementation_type& impl,
+ io_uring_socket_service_base& /*other_service*/,
+ io_uring_socket_service_base::base_implementation_type& other_impl)
+{
+ destroy(impl);
+
+ impl.socket_ = other_impl.socket_;
+ other_impl.socket_ = invalid_socket;
+
+ impl.state_ = other_impl.state_;
+ other_impl.state_ = 0;
+
+ impl.io_object_data_ = other_impl.io_object_data_;
+ other_impl.io_object_data_ = 0;
+}
+
+void io_uring_socket_service_base::destroy(
+ io_uring_socket_service_base::base_implementation_type& impl)
+{
+ if (impl.socket_ != invalid_socket)
+ {
+ ASIO_HANDLER_OPERATION((io_uring_service_.context(),
+ "socket", &impl, impl.socket_, "close"));
+
+ io_uring_service_.deregister_io_object(impl.io_object_data_);
+ asio::error_code ignored_ec;
+ socket_ops::close(impl.socket_, impl.state_, true, ignored_ec);
+ io_uring_service_.cleanup_io_object(impl.io_object_data_);
+ }
+}
+
+asio::error_code io_uring_socket_service_base::close(
+ io_uring_socket_service_base::base_implementation_type& impl,
+ asio::error_code& ec)
+{
+ if (is_open(impl))
+ {
+ ASIO_HANDLER_OPERATION((io_uring_service_.context(),
+ "socket", &impl, impl.socket_, "close"));
+
+ io_uring_service_.deregister_io_object(impl.io_object_data_);
+ socket_ops::close(impl.socket_, impl.state_, false, ec);
+ io_uring_service_.cleanup_io_object(impl.io_object_data_);
+ }
+ else
+ {
+ ec = success_ec_;
+ }
+
+ // The descriptor is closed by the OS even if close() returns an error.
+ //
+ // (Actually, POSIX says the state of the descriptor is unspecified. On
+ // Linux the descriptor is apparently closed anyway; e.g. see
+ // http://lkml.org/lkml/2005/9/10/129
+ construct(impl);
+
+ return ec;
+}
+
+socket_type io_uring_socket_service_base::release(
+ io_uring_socket_service_base::base_implementation_type& impl,
+ asio::error_code& ec)
+{
+ if (!is_open(impl))
+ {
+ ec = asio::error::bad_descriptor;
+ return invalid_socket;
+ }
+
+ ASIO_HANDLER_OPERATION((io_uring_service_.context(),
+ "socket", &impl, impl.socket_, "release"));
+
+ io_uring_service_.deregister_io_object(impl.io_object_data_);
+ io_uring_service_.cleanup_io_object(impl.io_object_data_);
+ socket_type sock = impl.socket_;
+ construct(impl);
+ ec = success_ec_;
+ return sock;
+}
+
+asio::error_code io_uring_socket_service_base::cancel(
+ io_uring_socket_service_base::base_implementation_type& impl,
+ asio::error_code& ec)
+{
+ if (!is_open(impl))
+ {
+ ec = asio::error::bad_descriptor;
+ return ec;
+ }
+
+ ASIO_HANDLER_OPERATION((io_uring_service_.context(),
+ "socket", &impl, impl.socket_, "cancel"));
+
+ io_uring_service_.cancel_ops(impl.io_object_data_);
+ ec = success_ec_;
+ return ec;
+}
+
+asio::error_code io_uring_socket_service_base::do_open(
+ io_uring_socket_service_base::base_implementation_type& impl,
+ int af, int type, int protocol, asio::error_code& ec)
+{
+ if (is_open(impl))
+ {
+ ec = asio::error::already_open;
+ return ec;
+ }
+
+ socket_holder sock(socket_ops::socket(af, type, protocol, ec));
+ if (sock.get() == invalid_socket)
+ return ec;
+
+ io_uring_service_.register_io_object(impl.io_object_data_);
+
+ impl.socket_ = sock.release();
+ switch (type)
+ {
+ case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break;
+ case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break;
+ default: impl.state_ = 0; break;
+ }
+ ec = success_ec_;
+ return ec;
+}
+
+asio::error_code io_uring_socket_service_base::do_assign(
+ io_uring_socket_service_base::base_implementation_type& impl, int type,
+ const io_uring_socket_service_base::native_handle_type& native_socket,
+ asio::error_code& ec)
+{
+ if (is_open(impl))
+ {
+ ec = asio::error::already_open;
+ return ec;
+ }
+
+ io_uring_service_.register_io_object(impl.io_object_data_);
+
+ impl.socket_ = native_socket;
+ switch (type)
+ {
+ case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break;
+ case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break;
+ default: impl.state_ = 0; break;
+ }
+ impl.state_ |= socket_ops::possible_dup;
+ ec = success_ec_;
+ return ec;
+}
+
+void io_uring_socket_service_base::start_op(
+ io_uring_socket_service_base::base_implementation_type& impl,
+ int op_type, io_uring_operation* op, bool is_continuation, bool noop)
+{
+ if (!noop)
+ {
+ io_uring_service_.start_op(op_type,
+ impl.io_object_data_, op, is_continuation);
+ }
+ else
+ {
+ io_uring_service_.post_immediate_completion(op, is_continuation);
+ }
+}
+
+void io_uring_socket_service_base::start_accept_op(
+ io_uring_socket_service_base::base_implementation_type& impl,
+ io_uring_operation* op, bool is_continuation, bool peer_is_open)
+{
+ if (!peer_is_open)
+ start_op(impl, io_uring_service::read_op, op, is_continuation, false);
+ else
+ {
+ op->ec_ = asio::error::already_open;
+ io_uring_service_.post_immediate_completion(op, is_continuation);
+ }
+}
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IMPL_IO_URING_SOCKET_SERVICE_BASE_IPP
diff --git a/3rdparty/asio/include/asio/detail/impl/kqueue_reactor.hpp b/3rdparty/asio/include/asio/detail/impl/kqueue_reactor.hpp
index 82584ae7914..3f79e9f7217 100644
--- a/3rdparty/asio/include/asio/detail/impl/kqueue_reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/impl/kqueue_reactor.hpp
@@ -2,7 +2,7 @@
// detail/impl/kqueue_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2005 Stefan Arentz (stefan at soze dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -28,7 +28,7 @@ namespace asio {
namespace detail {
inline void kqueue_reactor::post_immediate_completion(
- operation* op, bool is_continuation)
+ operation* op, bool is_continuation) const
{
scheduler_.post_immediate_completion(op, is_continuation);
}
diff --git a/3rdparty/asio/include/asio/detail/impl/kqueue_reactor.ipp b/3rdparty/asio/include/asio/detail/impl/kqueue_reactor.ipp
index 60b5ca861ee..210a89dd49e 100644
--- a/3rdparty/asio/include/asio/detail/impl/kqueue_reactor.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/kqueue_reactor.ipp
@@ -2,7 +2,7 @@
// detail/impl/kqueue_reactor.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2005 Stefan Arentz (stefan at soze dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -190,14 +190,23 @@ void kqueue_reactor::move_descriptor(socket_type,
source_descriptor_data = 0;
}
+void kqueue_reactor::call_post_immediate_completion(
+ operation* op, bool is_continuation, const void* self)
+{
+ static_cast<const kqueue_reactor*>(self)->post_immediate_completion(
+ op, is_continuation);
+}
+
void kqueue_reactor::start_op(int op_type, socket_type descriptor,
kqueue_reactor::per_descriptor_data& descriptor_data, reactor_op* op,
- bool is_continuation, bool allow_speculative)
+ bool is_continuation, bool allow_speculative,
+ void (*on_immediate)(operation*, bool, const void*),
+ const void* immediate_arg)
{
if (!descriptor_data)
{
op->ec_ = asio::error::bad_descriptor;
- post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
@@ -205,7 +214,7 @@ void kqueue_reactor::start_op(int op_type, socket_type descriptor,
if (descriptor_data->shutdown_)
{
- post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
@@ -220,7 +229,7 @@ void kqueue_reactor::start_op(int op_type, socket_type descriptor,
if (op->perform())
{
descriptor_lock.unlock();
- scheduler_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
@@ -239,7 +248,7 @@ void kqueue_reactor::start_op(int op_type, socket_type descriptor,
{
op->ec_ = asio::error_code(errno,
asio::error::get_system_category());
- scheduler_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
}
diff --git a/3rdparty/asio/include/asio/detail/impl/null_event.ipp b/3rdparty/asio/include/asio/detail/impl/null_event.ipp
index 7b8f968fa0f..1c9f5684298 100644
--- a/3rdparty/asio/include/asio/detail/impl/null_event.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/null_event.ipp
@@ -2,7 +2,7 @@
// detail/impl/null_event.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/pipe_select_interrupter.ipp b/3rdparty/asio/include/asio/detail/impl/pipe_select_interrupter.ipp
index 31c1b5c9b30..75138312d9d 100644
--- a/3rdparty/asio/include/asio/detail/impl/pipe_select_interrupter.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/pipe_select_interrupter.ipp
@@ -2,7 +2,7 @@
// detail/impl/pipe_select_interrupter.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/posix_event.ipp b/3rdparty/asio/include/asio/detail/impl/posix_event.ipp
index a823d8fbee8..76d5c468cbf 100644
--- a/3rdparty/asio/include/asio/detail/impl/posix_event.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/posix_event.ipp
@@ -2,7 +2,7 @@
// detail/impl/posix_event.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/posix_mutex.ipp b/3rdparty/asio/include/asio/detail/impl/posix_mutex.ipp
index c553ab4eef8..5fd832f9821 100644
--- a/3rdparty/asio/include/asio/detail/impl/posix_mutex.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/posix_mutex.ipp
@@ -2,7 +2,7 @@
// detail/impl/posix_mutex.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/reactive_serial_port_service.ipp b/3rdparty/asio/include/asio/detail/impl/posix_serial_port_service.ipp
index 23515a96c18..98ed5822877 100644
--- a/3rdparty/asio/include/asio/detail/impl/reactive_serial_port_service.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/posix_serial_port_service.ipp
@@ -1,16 +1,16 @@
//
-// detail/impl/reactive_serial_port_service.ipp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// detail/impl/posix_serial_port_service.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// 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 ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP
-#define ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP
+#ifndef ASIO_DETAIL_IMPL_POSIX_SERIAL_PORT_SERVICE_IPP
+#define ASIO_DETAIL_IMPL_POSIX_SERIAL_PORT_SERVICE_IPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
@@ -22,32 +22,33 @@
#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__)
#include <cstring>
-#include "asio/detail/reactive_serial_port_service.hpp"
+#include "asio/detail/posix_serial_port_service.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
namespace detail {
-reactive_serial_port_service::reactive_serial_port_service(
+posix_serial_port_service::posix_serial_port_service(
execution_context& context)
- : execution_context_service_base<reactive_serial_port_service>(context),
+ : execution_context_service_base<posix_serial_port_service>(context),
descriptor_service_(context)
{
}
-void reactive_serial_port_service::shutdown()
+void posix_serial_port_service::shutdown()
{
descriptor_service_.shutdown();
}
-asio::error_code reactive_serial_port_service::open(
- reactive_serial_port_service::implementation_type& impl,
+asio::error_code posix_serial_port_service::open(
+ posix_serial_port_service::implementation_type& impl,
const std::string& device, asio::error_code& ec)
{
if (is_open(impl))
{
ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -55,7 +56,10 @@ asio::error_code reactive_serial_port_service::open(
int fd = descriptor_ops::open(device.c_str(),
O_RDWR | O_NONBLOCK | O_NOCTTY, ec);
if (fd < 0)
+ {
+ ASIO_ERROR_LOCATION(ec);
return ec;
+ }
int s = descriptor_ops::fcntl(fd, F_GETFL, ec);
if (s >= 0)
@@ -64,6 +68,7 @@ asio::error_code reactive_serial_port_service::open(
{
asio::error_code ignored_ec;
descriptor_ops::close(fd, state, ignored_ec);
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -92,6 +97,7 @@ asio::error_code reactive_serial_port_service::open(
{
asio::error_code ignored_ec;
descriptor_ops::close(fd, state, ignored_ec);
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -102,40 +108,53 @@ asio::error_code reactive_serial_port_service::open(
descriptor_ops::close(fd, state, ignored_ec);
}
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
-asio::error_code reactive_serial_port_service::do_set_option(
- reactive_serial_port_service::implementation_type& impl,
- reactive_serial_port_service::store_function_type store,
+asio::error_code posix_serial_port_service::do_set_option(
+ posix_serial_port_service::implementation_type& impl,
+ posix_serial_port_service::store_function_type store,
const void* option, asio::error_code& ec)
{
termios ios;
int s = ::tcgetattr(descriptor_service_.native_handle(impl), &ios);
descriptor_ops::get_last_error(ec, s < 0);
if (s < 0)
+ {
+ ASIO_ERROR_LOCATION(ec);
return ec;
+ }
if (store(option, ios, ec))
+ {
+ ASIO_ERROR_LOCATION(ec);
return ec;
+ }
s = ::tcsetattr(descriptor_service_.native_handle(impl), TCSANOW, &ios);
descriptor_ops::get_last_error(ec, s < 0);
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
-asio::error_code reactive_serial_port_service::do_get_option(
- const reactive_serial_port_service::implementation_type& impl,
- reactive_serial_port_service::load_function_type load,
+asio::error_code posix_serial_port_service::do_get_option(
+ const posix_serial_port_service::implementation_type& impl,
+ posix_serial_port_service::load_function_type load,
void* option, asio::error_code& ec) const
{
termios ios;
int s = ::tcgetattr(descriptor_service_.native_handle(impl), &ios);
descriptor_ops::get_last_error(ec, s < 0);
if (s < 0)
+ {
+ ASIO_ERROR_LOCATION(ec);
return ec;
+ }
- return load(option, ios, ec);
+ load(option, ios, ec);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
}
} // namespace detail
@@ -146,4 +165,4 @@ asio::error_code reactive_serial_port_service::do_get_option(
#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__)
#endif // defined(ASIO_HAS_SERIAL_PORT)
-#endif // ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP
+#endif // ASIO_DETAIL_IMPL_POSIX_SERIAL_PORT_SERVICE_IPP
diff --git a/3rdparty/asio/include/asio/detail/impl/posix_thread.ipp b/3rdparty/asio/include/asio/detail/impl/posix_thread.ipp
index 94373ee0287..7602377336e 100644
--- a/3rdparty/asio/include/asio/detail/impl/posix_thread.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/posix_thread.ipp
@@ -2,7 +2,7 @@
// detail/impl/posix_thread.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/posix_tss_ptr.ipp b/3rdparty/asio/include/asio/detail/impl/posix_tss_ptr.ipp
index 6a368e0ffd1..099274b2779 100644
--- a/3rdparty/asio/include/asio/detail/impl/posix_tss_ptr.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/posix_tss_ptr.ipp
@@ -2,7 +2,7 @@
// detail/impl/posix_tss_ptr.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/reactive_descriptor_service.ipp b/3rdparty/asio/include/asio/detail/impl/reactive_descriptor_service.ipp
index 9caf06877d7..829aefb01bf 100644
--- a/3rdparty/asio/include/asio/detail/impl/reactive_descriptor_service.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/reactive_descriptor_service.ipp
@@ -2,7 +2,7 @@
// detail/impl/reactive_descriptor_service.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,7 +19,8 @@
#if !defined(ASIO_WINDOWS) \
&& !defined(ASIO_WINDOWS_RUNTIME) \
- && !defined(__CYGWIN__)
+ && !defined(__CYGWIN__) \
+ && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#include "asio/error.hpp"
#include "asio/detail/reactive_descriptor_service.hpp"
@@ -46,12 +47,13 @@ void reactive_descriptor_service::construct(
{
impl.descriptor_ = -1;
impl.state_ = 0;
+ impl.reactor_data_ = reactor::per_descriptor_data();
}
void reactive_descriptor_service::move_construct(
reactive_descriptor_service::implementation_type& impl,
reactive_descriptor_service::implementation_type& other_impl)
- ASIO_NOEXCEPT
+ noexcept
{
impl.descriptor_ = other_impl.descriptor_;
other_impl.descriptor_ = -1;
@@ -105,6 +107,7 @@ asio::error_code reactive_descriptor_service::assign(
if (is_open(impl))
{
ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -113,6 +116,7 @@ asio::error_code reactive_descriptor_service::assign(
{
ec = asio::error_code(err,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -151,6 +155,7 @@ asio::error_code reactive_descriptor_service::close(
// We'll just have to assume that other OSes follow the same behaviour.)
construct(impl);
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -180,6 +185,7 @@ asio::error_code reactive_descriptor_service::cancel(
if (!is_open(impl))
{
ec = asio::error::bad_descriptor;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -191,10 +197,10 @@ asio::error_code reactive_descriptor_service::cancel(
return ec;
}
-void reactive_descriptor_service::start_op(
- reactive_descriptor_service::implementation_type& impl,
- int op_type, reactor_op* op, bool is_continuation,
- bool is_non_blocking, bool noop)
+void reactive_descriptor_service::do_start_op(implementation_type& impl,
+ int op_type, reactor_op* op, bool is_continuation, bool is_non_blocking,
+ bool noop, void (*on_immediate)(operation* op, bool, const void*),
+ const void* immediate_arg)
{
if (!noop)
{
@@ -202,13 +208,13 @@ void reactive_descriptor_service::start_op(
descriptor_ops::set_internal_non_blocking(
impl.descriptor_, impl.state_, true, op->ec_))
{
- reactor_.start_op(op_type, impl.descriptor_,
- impl.reactor_data_, op, is_continuation, is_non_blocking);
+ reactor_.start_op(op_type, impl.descriptor_, impl.reactor_data_, op,
+ is_continuation, is_non_blocking, on_immediate, immediate_arg);
return;
}
}
- reactor_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
}
} // namespace detail
@@ -219,5 +225,6 @@ void reactive_descriptor_service::start_op(
#endif // !defined(ASIO_WINDOWS)
// && !defined(ASIO_WINDOWS_RUNTIME)
// && !defined(__CYGWIN__)
+ // && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // ASIO_DETAIL_IMPL_REACTIVE_DESCRIPTOR_SERVICE_IPP
diff --git a/3rdparty/asio/include/asio/detail/impl/reactive_socket_service_base.ipp b/3rdparty/asio/include/asio/detail/impl/reactive_socket_service_base.ipp
index afda16f3520..a02001b421f 100644
--- a/3rdparty/asio/include/asio/detail/impl/reactive_socket_service_base.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/reactive_socket_service_base.ipp
@@ -2,7 +2,7 @@
// detail/reactive_socket_service_base.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,7 +18,8 @@
#include "asio/detail/config.hpp"
#if !defined(ASIO_HAS_IOCP) \
- && !defined(ASIO_WINDOWS_RUNTIME)
+ && !defined(ASIO_WINDOWS_RUNTIME) \
+ && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#include "asio/detail/reactive_socket_service_base.hpp"
@@ -43,12 +44,13 @@ void reactive_socket_service_base::construct(
{
impl.socket_ = invalid_socket;
impl.state_ = 0;
+ impl.reactor_data_ = reactor::per_descriptor_data();
}
void reactive_socket_service_base::base_move_construct(
reactive_socket_service_base::base_implementation_type& impl,
reactive_socket_service_base::base_implementation_type& other_impl)
- ASIO_NOEXCEPT
+ noexcept
{
impl.socket_ = other_impl.socket_;
other_impl.socket_ = invalid_socket;
@@ -231,10 +233,11 @@ asio::error_code reactive_socket_service_base::do_assign(
return ec;
}
-void reactive_socket_service_base::start_op(
- reactive_socket_service_base::base_implementation_type& impl,
- int op_type, reactor_op* op, bool is_continuation,
- bool is_non_blocking, bool noop)
+void reactive_socket_service_base::do_start_op(
+ reactive_socket_service_base::base_implementation_type& impl, int op_type,
+ reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop,
+ void (*on_immediate)(operation* op, bool, const void*),
+ const void* immediate_arg)
{
if (!noop)
{
@@ -242,32 +245,38 @@ void reactive_socket_service_base::start_op(
|| socket_ops::set_internal_non_blocking(
impl.socket_, impl.state_, true, op->ec_))
{
- reactor_.start_op(op_type, impl.socket_,
- impl.reactor_data_, op, is_continuation, is_non_blocking);
+ reactor_.start_op(op_type, impl.socket_, impl.reactor_data_, op,
+ is_continuation, is_non_blocking, on_immediate, immediate_arg);
return;
}
}
- reactor_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
}
-void reactive_socket_service_base::start_accept_op(
+void reactive_socket_service_base::do_start_accept_op(
reactive_socket_service_base::base_implementation_type& impl,
- reactor_op* op, bool is_continuation, bool peer_is_open)
+ reactor_op* op, bool is_continuation, bool peer_is_open,
+ void (*on_immediate)(operation* op, bool, const void*),
+ const void* immediate_arg)
{
if (!peer_is_open)
- start_op(impl, reactor::read_op, op, is_continuation, true, false);
+ {
+ do_start_op(impl, reactor::read_op, op, is_continuation,
+ true, false, on_immediate, immediate_arg);
+ }
else
{
op->ec_ = asio::error::already_open;
- reactor_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
}
}
-void reactive_socket_service_base::start_connect_op(
+void reactive_socket_service_base::do_start_connect_op(
reactive_socket_service_base::base_implementation_type& impl,
- reactor_op* op, bool is_continuation,
- const socket_addr_type* addr, size_t addrlen)
+ reactor_op* op, bool is_continuation, const void* addr, size_t addrlen,
+ void (*on_immediate)(operation* op, bool, const void*),
+ const void* immediate_arg)
{
if ((impl.state_ & socket_ops::non_blocking)
|| socket_ops::set_internal_non_blocking(
@@ -279,14 +288,14 @@ void reactive_socket_service_base::start_connect_op(
|| op->ec_ == asio::error::would_block)
{
op->ec_ = asio::error_code();
- reactor_.start_op(reactor::connect_op, impl.socket_,
- impl.reactor_data_, op, is_continuation, false);
+ reactor_.start_op(reactor::connect_op, impl.socket_, impl.reactor_data_,
+ op, is_continuation, false, on_immediate, immediate_arg);
return;
}
}
}
- reactor_.post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
}
} // namespace detail
@@ -296,5 +305,6 @@ void reactive_socket_service_base::start_connect_op(
#endif // !defined(ASIO_HAS_IOCP)
// && !defined(ASIO_WINDOWS_RUNTIME)
+ // && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_IPP
diff --git a/3rdparty/asio/include/asio/detail/impl/resolver_service_base.ipp b/3rdparty/asio/include/asio/detail/impl/resolver_service_base.ipp
index bd1b0bc0296..8d9e944ddde 100644
--- a/3rdparty/asio/include/asio/detail/impl/resolver_service_base.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/resolver_service_base.ipp
@@ -2,7 +2,7 @@
// detail/impl/resolver_service_base.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -105,14 +105,14 @@ void resolver_service_base::destroy(
void resolver_service_base::move_construct(implementation_type& impl,
implementation_type& other_impl)
{
- impl = ASIO_MOVE_CAST(implementation_type)(other_impl);
+ impl = static_cast<implementation_type&&>(other_impl);
}
void resolver_service_base::move_assign(implementation_type& impl,
resolver_service_base&, implementation_type& other_impl)
{
destroy(impl);
- impl = ASIO_MOVE_CAST(implementation_type)(other_impl);
+ impl = static_cast<implementation_type&&>(other_impl);
}
void resolver_service_base::cancel(
diff --git a/3rdparty/asio/include/asio/detail/impl/scheduler.ipp b/3rdparty/asio/include/asio/detail/impl/scheduler.ipp
index 0734fc8e832..eccc80322d1 100644
--- a/3rdparty/asio/include/asio/detail/impl/scheduler.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/scheduler.ipp
@@ -2,7 +2,7 @@
// detail/impl/scheduler.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,11 +20,16 @@
#include "asio/detail/concurrency_hint.hpp"
#include "asio/detail/event.hpp"
#include "asio/detail/limits.hpp"
-#include "asio/detail/reactor.hpp"
#include "asio/detail/scheduler.hpp"
#include "asio/detail/scheduler_thread_info.hpp"
#include "asio/detail/signal_blocker.hpp"
+#if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_service.hpp"
+#else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/reactor.hpp"
+#endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -104,7 +109,7 @@ struct scheduler::work_cleanup
};
scheduler::scheduler(asio::execution_context& ctx,
- int concurrency_hint, bool own_thread)
+ int concurrency_hint, bool own_thread, get_task_func_type get_task)
: asio::detail::execution_context_service_base<scheduler>(ctx),
one_thread_(concurrency_hint == 1
|| !ASIO_CONCURRENCY_HINT_IS_LOCKING(
@@ -114,6 +119,7 @@ scheduler::scheduler(asio::execution_context& ctx,
mutex_(ASIO_CONCURRENCY_HINT_IS_LOCKING(
SCHEDULER, concurrency_hint)),
task_(0),
+ get_task_(get_task),
task_interrupted_(true),
outstanding_work_(0),
stopped_(false),
@@ -178,7 +184,7 @@ void scheduler::init_task()
mutex::scoped_lock lock(mutex_);
if (!shutdown_ && !task_)
{
- task_ = &use_service<reactor>(this->context());
+ task_ = get_task_(this->context());
op_queue_.push(&task_operation_);
wake_one_thread_and_unlock(lock);
}
@@ -321,6 +327,7 @@ void scheduler::restart()
void scheduler::compensating_work_started()
{
thread_info_base* this_thread = thread_call_stack::contains(this);
+ ASIO_ASSUME(this_thread != 0); // Only called from inside scheduler.
++static_cast<thread_info*>(this_thread)->private_outstanding_work;
}
@@ -651,6 +658,15 @@ void scheduler::wake_one_thread_and_unlock(
}
}
+scheduler_task* scheduler::get_default_task(asio::execution_context& ctx)
+{
+#if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ return &use_service<io_uring_service>(ctx);
+#else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ return &use_service<reactor>(ctx);
+#endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+}
+
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/impl/select_reactor.hpp b/3rdparty/asio/include/asio/detail/impl/select_reactor.hpp
index c0499618bb6..933b02cddc5 100644
--- a/3rdparty/asio/include/asio/detail/impl/select_reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/impl/select_reactor.hpp
@@ -2,7 +2,7 @@
// detail/impl/select_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -35,7 +35,7 @@ namespace asio {
namespace detail {
inline void select_reactor::post_immediate_completion(
- reactor_op* op, bool is_continuation)
+ operation* op, bool is_continuation) const
{
scheduler_.post_immediate_completion(op, is_continuation);
}
diff --git a/3rdparty/asio/include/asio/detail/impl/select_reactor.ipp b/3rdparty/asio/include/asio/detail/impl/select_reactor.ipp
index f7d64731de7..5e5946bb84b 100644
--- a/3rdparty/asio/include/asio/detail/impl/select_reactor.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/select_reactor.ipp
@@ -2,7 +2,7 @@
// detail/impl/select_reactor.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -66,6 +66,7 @@ select_reactor::select_reactor(asio::execution_context& ctx)
#if defined(ASIO_HAS_IOCP)
stop_thread_(false),
thread_(0),
+ restart_reactor_(this),
#endif // defined(ASIO_HAS_IOCP)
shutdown_(false)
{
@@ -113,8 +114,12 @@ void select_reactor::shutdown()
void select_reactor::notify_fork(
asio::execution_context::fork_event fork_ev)
{
+#if defined(ASIO_HAS_IOCP)
+ (void)fork_ev;
+#else // defined(ASIO_HAS_IOCP)
if (fork_ev == asio::execution_context::fork_child)
interrupter_.recreate();
+#endif // defined(ASIO_HAS_IOCP)
}
void select_reactor::init_task()
@@ -146,15 +151,23 @@ void select_reactor::move_descriptor(socket_type,
{
}
+void select_reactor::call_post_immediate_completion(
+ operation* op, bool is_continuation, const void* self)
+{
+ static_cast<const select_reactor*>(self)->post_immediate_completion(
+ op, is_continuation);
+}
+
void select_reactor::start_op(int op_type, socket_type descriptor,
- select_reactor::per_descriptor_data&, reactor_op* op,
- bool is_continuation, bool)
+ select_reactor::per_descriptor_data&, reactor_op* op, bool is_continuation,
+ bool, void (*on_immediate)(operation*, bool, const void*),
+ const void* immediate_arg)
{
asio::detail::mutex::scoped_lock lock(mutex_);
if (shutdown_)
{
- post_immediate_completion(op, is_continuation);
+ on_immediate(op, is_continuation, immediate_arg);
return;
}
@@ -262,7 +275,12 @@ void select_reactor::run(long usec, op_queue<operation>& ops)
if (!interrupter_.reset())
{
lock.lock();
+#if defined(ASIO_HAS_IOCP)
+ stop_thread_ = true;
+ scheduler_.post_immediate_completion(&restart_reactor_, false);
+#else // defined(ASIO_HAS_IOCP)
interrupter_.recreate();
+#endif // defined(ASIO_HAS_IOCP)
}
--retval;
}
@@ -299,11 +317,36 @@ void select_reactor::run_thread()
{
lock.unlock();
op_queue<operation> ops;
- run(true, ops);
+ run(-1, ops);
scheduler_.post_deferred_completions(ops);
lock.lock();
}
}
+
+void select_reactor::restart_reactor::do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/, std::size_t /*bytes_transferred*/)
+{
+ if (owner)
+ {
+ select_reactor* reactor = static_cast<restart_reactor*>(base)->reactor_;
+
+ if (reactor->thread_)
+ {
+ reactor->thread_->join();
+ delete reactor->thread_;
+ reactor->thread_ = 0;
+ }
+
+ asio::detail::mutex::scoped_lock lock(reactor->mutex_);
+ reactor->interrupter_.recreate();
+ reactor->stop_thread_ = false;
+ lock.unlock();
+
+ asio::detail::signal_blocker sb;
+ reactor->thread_ =
+ new asio::detail::thread(thread_function(reactor));
+ }
+}
#endif // defined(ASIO_HAS_IOCP)
void select_reactor::do_add_timer_queue(timer_queue_base& queue)
diff --git a/3rdparty/asio/include/asio/detail/impl/service_registry.hpp b/3rdparty/asio/include/asio/detail/impl/service_registry.hpp
index 8b9566e103a..2490636c0ad 100644
--- a/3rdparty/asio/include/asio/detail/impl/service_registry.hpp
+++ b/3rdparty/asio/include/asio/detail/impl/service_registry.hpp
@@ -2,7 +2,7 @@
// detail/impl/service_registry.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -64,8 +64,7 @@ inline void service_registry::init_key(
#if !defined(ASIO_NO_TYPEID)
template <typename Service>
void service_registry::init_key(execution_context::service::key& key,
- typename enable_if<
- is_base_of<typename Service::key_type, Service>::value>::type*)
+ enable_if_t<is_base_of<typename Service::key_type, Service>::value>*)
{
key.type_info_ = &typeid(typeid_wrapper<Service>);
key.id_ = 0;
diff --git a/3rdparty/asio/include/asio/detail/impl/service_registry.ipp b/3rdparty/asio/include/asio/detail/impl/service_registry.ipp
index 363a56fb82f..b0133421d25 100644
--- a/3rdparty/asio/include/asio/detail/impl/service_registry.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/service_registry.ipp
@@ -2,7 +2,7 @@
// detail/impl/service_registry.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/signal_set_service.ipp b/3rdparty/asio/include/asio/detail/impl/signal_set_service.ipp
index b657d0e580f..7f6be8b71a9 100644
--- a/3rdparty/asio/include/asio/detail/impl/signal_set_service.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/signal_set_service.ipp
@@ -2,7 +2,7 @@
// detail/impl/signal_set_service.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,12 +19,17 @@
#include <cstring>
#include <stdexcept>
-#include "asio/detail/reactor.hpp"
#include "asio/detail/signal_blocker.hpp"
#include "asio/detail/signal_set_service.hpp"
#include "asio/detail/static_mutex.hpp"
#include "asio/detail/throw_exception.hpp"
+#if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_service.hpp"
+#else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/reactor.hpp"
+#endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -49,12 +54,16 @@ struct signal_state
// A count of the number of objects that are registered for each signal.
std::size_t registration_count_[max_signal_number];
+
+ // The flags used for each registered signal.
+ signal_set_base::flags_t flags_[max_signal_number];
};
signal_state* get_signal_state()
{
static signal_state state = {
- ASIO_STATIC_MUTEX_INIT, -1, -1, false, 0, { 0 } };
+ ASIO_STATIC_MUTEX_INIT, -1, -1, false, 0,
+ { 0 }, { signal_set_base::flags_t() } };
return &state;
}
@@ -85,9 +94,42 @@ void asio_signal_handler(int signal_number)
#if !defined(ASIO_WINDOWS) \
&& !defined(ASIO_WINDOWS_RUNTIME) \
&& !defined(__CYGWIN__)
-class signal_set_service::pipe_read_op : public reactor_op
+class signal_set_service::pipe_read_op :
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ public io_uring_operation
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ public reactor_op
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
{
public:
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ pipe_read_op()
+ : io_uring_operation(asio::error_code(), &pipe_read_op::do_prepare,
+ &pipe_read_op::do_perform, pipe_read_op::do_complete)
+ {
+ }
+
+ static void do_prepare(io_uring_operation*, ::io_uring_sqe* sqe)
+ {
+ signal_state* state = get_signal_state();
+
+ int fd = state->read_descriptor_;
+ ::io_uring_prep_poll_add(sqe, fd, POLLIN);
+ }
+
+ static bool do_perform(io_uring_operation*, bool)
+ {
+ signal_state* state = get_signal_state();
+
+ int fd = state->read_descriptor_;
+ int signal_number = 0;
+ while (::read(fd, &signal_number, sizeof(int)) == sizeof(int))
+ if (signal_number >= 0 && signal_number < max_signal_number)
+ signal_set_service::deliver_signal(signal_number);
+
+ return false;
+ }
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
pipe_read_op()
: reactor_op(asio::error_code(),
&pipe_read_op::do_perform, pipe_read_op::do_complete)
@@ -106,6 +148,7 @@ public:
return not_done;
}
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
static void do_complete(void* /*owner*/, operation* base,
const asio::error_code& /*ec*/,
@@ -125,7 +168,11 @@ signal_set_service::signal_set_service(execution_context& context)
#if !defined(ASIO_WINDOWS) \
&& !defined(ASIO_WINDOWS_RUNTIME) \
&& !defined(__CYGWIN__)
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ io_uring_service_(asio::use_service<io_uring_service>(context)),
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
reactor_(asio::use_service<reactor>(context)),
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // !defined(ASIO_WINDOWS)
// && !defined(ASIO_WINDOWS_RUNTIME)
// && !defined(__CYGWIN__)
@@ -137,7 +184,11 @@ signal_set_service::signal_set_service(execution_context& context)
#if !defined(ASIO_WINDOWS) \
&& !defined(ASIO_WINDOWS_RUNTIME) \
&& !defined(__CYGWIN__)
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ io_uring_service_.init_task();
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
reactor_.init_task();
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // !defined(ASIO_WINDOWS)
// && !defined(ASIO_WINDOWS_RUNTIME)
// && !defined(__CYGWIN__)
@@ -187,8 +238,14 @@ void signal_set_service::notify_fork(execution_context::fork_event fork_ev)
int read_descriptor = state->read_descriptor_;
state->fork_prepared_ = true;
lock.unlock();
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ (void)read_descriptor;
+ io_uring_service_.deregister_io_object(io_object_data_);
+ io_uring_service_.cleanup_io_object(io_object_data_);
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
reactor_.deregister_internal_descriptor(read_descriptor, reactor_data_);
reactor_.cleanup_descriptor_data(reactor_data_);
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
}
break;
case execution_context::fork_parent:
@@ -197,8 +254,14 @@ void signal_set_service::notify_fork(execution_context::fork_event fork_ev)
int read_descriptor = state->read_descriptor_;
state->fork_prepared_ = false;
lock.unlock();
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ (void)read_descriptor;
+ io_uring_service_.register_internal_io_object(io_object_data_,
+ io_uring_service::read_op, new pipe_read_op);
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
reactor_.register_internal_descriptor(reactor::read_op,
read_descriptor, reactor_data_, new pipe_read_op);
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
}
break;
case execution_context::fork_child:
@@ -210,8 +273,14 @@ void signal_set_service::notify_fork(execution_context::fork_event fork_ev)
int read_descriptor = state->read_descriptor_;
state->fork_prepared_ = false;
lock.unlock();
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ (void)read_descriptor;
+ io_uring_service_.register_internal_io_object(io_object_data_,
+ io_uring_service::read_op, new pipe_read_op);
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
reactor_.register_internal_descriptor(reactor::read_op,
read_descriptor, reactor_data_, new pipe_read_op);
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
}
break;
default:
@@ -241,8 +310,8 @@ void signal_set_service::destroy(
}
asio::error_code signal_set_service::add(
- signal_set_service::implementation_type& impl,
- int signal_number, asio::error_code& ec)
+ signal_set_service::implementation_type& impl, int signal_number,
+ signal_set_base::flags_t f, asio::error_code& ec)
{
// Check that the signal number is valid.
if (signal_number < 0 || signal_number >= max_signal_number)
@@ -251,6 +320,15 @@ asio::error_code signal_set_service::add(
return ec;
}
+ // Check that the specified flags are supported.
+#if !defined(ASIO_HAS_SIGACTION)
+ if (f != signal_set_base::flags::dont_care)
+ {
+ ec = asio::error::operation_not_supported;
+ return ec;
+ }
+#endif // !defined(ASIO_HAS_SIGACTION)
+
signal_state* state = get_signal_state();
static_mutex::scoped_lock lock(state->mutex_);
@@ -278,6 +356,8 @@ asio::error_code signal_set_service::add(
memset(&sa, 0, sizeof(sa));
sa.sa_handler = asio_signal_handler;
sigfillset(&sa.sa_mask);
+ if (f != signal_set_base::flags::dont_care)
+ sa.sa_flags = static_cast<int>(f);
if (::sigaction(signal_number, &sa, 0) == -1)
# else // defined(ASIO_HAS_SIGACTION)
if (::signal(signal_number, asio_signal_handler) == SIG_ERR)
@@ -292,7 +372,39 @@ asio::error_code signal_set_service::add(
delete new_registration;
return ec;
}
+# if defined(ASIO_HAS_SIGACTION)
+ state->flags_[signal_number] = f;
+# endif // defined(ASIO_HAS_SIGACTION)
}
+# if defined(ASIO_HAS_SIGACTION)
+ // Otherwise check to see if the flags have changed.
+ else if (f != signal_set_base::flags::dont_care)
+ {
+ if (f != state->flags_[signal_number])
+ {
+ using namespace std; // For memset.
+ if (state->flags_[signal_number] != signal_set_base::flags::dont_care)
+ {
+ ec = asio::error::invalid_argument;
+ delete new_registration;
+ return ec;
+ }
+ struct sigaction sa;
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = asio_signal_handler;
+ sigfillset(&sa.sa_mask);
+ sa.sa_flags = static_cast<int>(f);
+ if (::sigaction(signal_number, &sa, 0) == -1)
+ {
+ ec = asio::error_code(errno,
+ asio::error::get_system_category());
+ delete new_registration;
+ return ec;
+ }
+ state->flags_[signal_number] = f;
+ }
+ }
+# endif // defined(ASIO_HAS_SIGACTION)
#endif // defined(ASIO_HAS_SIGNAL) || defined(ASIO_HAS_SIGACTION)
// Record the new registration in the set.
@@ -361,6 +473,9 @@ asio::error_code signal_set_service::remove(
# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
return ec;
}
+# if defined(ASIO_HAS_SIGACTION)
+ state->flags_[signal_number] = signal_set_base::flags_t();
+# endif // defined(ASIO_HAS_SIGACTION)
}
#endif // defined(ASIO_HAS_SIGNAL) || defined(ASIO_HAS_SIGACTION)
@@ -415,6 +530,9 @@ asio::error_code signal_set_service::clear(
# endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
return ec;
}
+# if defined(ASIO_HAS_SIGACTION)
+ state->flags_[reg->signal_number_] = signal_set_base::flags_t();
+# endif // defined(ASIO_HAS_SIGACTION)
}
#endif // defined(ASIO_HAS_SIGNAL) || defined(ASIO_HAS_SIGACTION)
@@ -462,6 +580,33 @@ asio::error_code signal_set_service::cancel(
return ec;
}
+void signal_set_service::cancel_ops_by_key(
+ signal_set_service::implementation_type& impl, void* cancellation_key)
+{
+ op_queue<operation> ops;
+ {
+ op_queue<signal_op> other_ops;
+ signal_state* state = get_signal_state();
+ static_mutex::scoped_lock lock(state->mutex_);
+
+ while (signal_op* op = impl.queue_.front())
+ {
+ impl.queue_.pop();
+ if (op->cancellation_key_ == cancellation_key)
+ {
+ op->ec_ = asio::error::operation_aborted;
+ ops.push(op);
+ }
+ else
+ other_ops.push(op);
+ }
+
+ impl.queue_.push(other_ops);
+ }
+
+ scheduler_.post_deferred_completions(ops);
+}
+
void signal_set_service::deliver_signal(int signal_number)
{
signal_state* state = get_signal_state();
@@ -538,8 +683,14 @@ void signal_set_service::add_service(signal_set_service* service)
// Register for pipe readiness notifications.
int read_descriptor = state->read_descriptor_;
lock.unlock();
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ (void)read_descriptor;
+ service->io_uring_service_.register_internal_io_object(
+ service->io_object_data_, io_uring_service::read_op, new pipe_read_op);
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
service->reactor_.register_internal_descriptor(reactor::read_op,
read_descriptor, service->reactor_data_, new pipe_read_op);
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // !defined(ASIO_WINDOWS)
// && !defined(ASIO_WINDOWS_RUNTIME)
// && !defined(__CYGWIN__)
@@ -558,10 +709,17 @@ void signal_set_service::remove_service(signal_set_service* service)
// Disable the pipe readiness notifications.
int read_descriptor = state->read_descriptor_;
lock.unlock();
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ (void)read_descriptor;
+ service->io_uring_service_.deregister_io_object(service->io_object_data_);
+ service->io_uring_service_.cleanup_io_object(service->io_object_data_);
+ lock.lock();
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
service->reactor_.deregister_internal_descriptor(
read_descriptor, service->reactor_data_);
service->reactor_.cleanup_descriptor_data(service->reactor_data_);
lock.lock();
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // !defined(ASIO_WINDOWS)
// && !defined(ASIO_WINDOWS_RUNTIME)
// && !defined(__CYGWIN__)
diff --git a/3rdparty/asio/include/asio/detail/impl/socket_ops.ipp b/3rdparty/asio/include/asio/detail/impl/socket_ops.ipp
index 3403f1c0a85..7feb7ca02df 100644
--- a/3rdparty/asio/include/asio/detail/impl/socket_ops.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/socket_ops.ipp
@@ -2,7 +2,7 @@
// detail/impl/socket_ops.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -78,7 +78,7 @@ inline void get_last_error(
{
if (!is_error_condition)
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
else
{
@@ -94,16 +94,18 @@ inline void get_last_error(
template <typename SockLenType>
inline socket_type call_accept(SockLenType msghdr::*,
- socket_type s, socket_addr_type* addr, std::size_t* addrlen)
+ socket_type s, void* addr, std::size_t* addrlen)
{
SockLenType tmp_addrlen = addrlen ? (SockLenType)*addrlen : 0;
- socket_type result = ::accept(s, addr, addrlen ? &tmp_addrlen : 0);
+ socket_type result = ::accept(s,
+ static_cast<socket_addr_type*>(addr),
+ addrlen ? &tmp_addrlen : 0);
if (addrlen)
*addrlen = (std::size_t)tmp_addrlen;
return result;
}
-socket_type accept(socket_type s, socket_addr_type* addr,
+socket_type accept(socket_type s, void* addr,
std::size_t* addrlen, asio::error_code& ec)
{
if (s == invalid_socket)
@@ -129,12 +131,12 @@ socket_type accept(socket_type s, socket_addr_type* addr,
}
#endif
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return new_s;
}
socket_type sync_accept(socket_type s, state_type state,
- socket_addr_type* addr, std::size_t* addrlen, asio::error_code& ec)
+ void* addr, std::size_t* addrlen, asio::error_code& ec)
{
// Accept a socket.
for (;;)
@@ -179,9 +181,8 @@ socket_type sync_accept(socket_type s, state_type state,
#if defined(ASIO_HAS_IOCP)
-void complete_iocp_accept(socket_type s,
- void* output_buffer, DWORD address_length,
- socket_addr_type* addr, std::size_t* addrlen,
+void complete_iocp_accept(socket_type s, void* output_buffer,
+ DWORD address_length, void* addr, std::size_t* addrlen,
socket_type new_socket, asio::error_code& ec)
{
// Map non-portable errors to their portable counterparts.
@@ -225,7 +226,7 @@ void complete_iocp_accept(socket_type s,
#else // defined(ASIO_HAS_IOCP)
bool non_blocking_accept(socket_type s,
- state_type state, socket_addr_type* addr, std::size_t* addrlen,
+ state_type state, void* addr, std::size_t* addrlen,
asio::error_code& ec, socket_type& new_socket)
{
for (;;)
@@ -272,12 +273,13 @@ bool non_blocking_accept(socket_type s,
template <typename SockLenType>
inline int call_bind(SockLenType msghdr::*,
- socket_type s, const socket_addr_type* addr, std::size_t addrlen)
+ socket_type s, const void* addr, std::size_t addrlen)
{
- return ::bind(s, addr, (SockLenType)addrlen);
+ return ::bind(s, static_cast<const socket_addr_type*>(addr),
+ (SockLenType)addrlen);
}
-int bind(socket_type s, const socket_addr_type* addr,
+int bind(socket_type s, const void* addr,
std::size_t addrlen, asio::error_code& ec)
{
if (s == invalid_socket)
@@ -337,7 +339,25 @@ int close(socket_type s, state_type& state,
::fcntl(s, F_SETFL, flags & ~O_NONBLOCK);
# else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = 0;
+# if defined(ENOTTY) || defined(ENOTCAPABLE)
+ result = ::ioctl(s, FIONBIO, &arg);
+ get_last_error(ec, result < 0);
+ if (false
+# if defined(ENOTTY)
+ || ec.value() == ENOTTY
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
+ || ec.value() == ENOTCAPABLE
+# endif // defined(ENOTCAPABLE)
+ )
+ {
+ int flags = ::fcntl(s, F_GETFL, 0);
+ if (flags >= 0)
+ ::fcntl(s, F_SETFL, flags & ~O_NONBLOCK);
+ }
+# else // defined(ENOTTY) || defined(ENOTCAPABLE)
::ioctl(s, FIONBIO, &arg);
+# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
# endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
state &= ~non_blocking;
@@ -376,11 +396,31 @@ bool set_user_non_blocking(socket_type s,
result = ::fcntl(s, F_SETFL, flag);
get_last_error(ec, result < 0);
}
-#else
+#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = (value ? 1 : 0);
int result = ::ioctl(s, FIONBIO, &arg);
get_last_error(ec, result < 0);
-#endif
+# if defined(ENOTTY) || defined(ENOTCAPABLE)
+ if (false
+# if defined(ENOTTY)
+ || ec.value() == ENOTTY
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
+ || ec.value() == ENOTCAPABLE
+# endif // defined(ENOTCAPABLE)
+ )
+ {
+ result = ::fcntl(s, F_GETFL, 0);
+ get_last_error(ec, result < 0);
+ if (result >= 0)
+ {
+ int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
+ result = ::fcntl(s, F_SETFL, flag);
+ get_last_error(ec, result < 0);
+ }
+ }
+# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
+#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
if (result >= 0)
{
@@ -430,11 +470,31 @@ bool set_internal_non_blocking(socket_type s,
result = ::fcntl(s, F_SETFL, flag);
get_last_error(ec, result < 0);
}
-#else
+#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = (value ? 1 : 0);
int result = ::ioctl(s, FIONBIO, &arg);
get_last_error(ec, result < 0);
-#endif
+# if defined(ENOTTY) || defined(ENOTCAPABLE)
+ if (false
+# if defined(ENOTTY)
+ || ec.value() == ENOTTY
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
+ || ec.value() == ENOTCAPABLE
+# endif // defined(ENOTCAPABLE)
+ )
+ {
+ result = ::fcntl(s, F_GETFL, 0);
+ get_last_error(ec, result < 0);
+ if (result >= 0)
+ {
+ int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
+ result = ::fcntl(s, F_SETFL, flag);
+ get_last_error(ec, result < 0);
+ }
+ }
+# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
+#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
if (result >= 0)
{
@@ -463,12 +523,13 @@ int shutdown(socket_type s, int what, asio::error_code& ec)
template <typename SockLenType>
inline int call_connect(SockLenType msghdr::*,
- socket_type s, const socket_addr_type* addr, std::size_t addrlen)
+ socket_type s, const void* addr, std::size_t addrlen)
{
- return ::connect(s, addr, (SockLenType)addrlen);
+ return ::connect(s, static_cast<const socket_addr_type*>(addr),
+ (SockLenType)addrlen);
}
-int connect(socket_type s, const socket_addr_type* addr,
+int connect(socket_type s, const void* addr,
std::size_t addrlen, asio::error_code& ec)
{
if (s == invalid_socket)
@@ -481,12 +542,17 @@ int connect(socket_type s, const socket_addr_type* addr,
get_last_error(ec, result != 0);
#if defined(__linux__)
if (result != 0 && ec == asio::error::try_again)
- ec = asio::error::no_buffer_space;
+ {
+ if (static_cast<const socket_addr_type*>(addr)->sa_family == AF_UNIX)
+ ec = asio::error::in_progress;
+ else
+ ec = asio::error::no_buffer_space;
+ }
#endif // defined(__linux__)
return result;
}
-void sync_connect(socket_type s, const socket_addr_type* addr,
+void sync_connect(socket_type s, const void* addr,
std::size_t addrlen, asio::error_code& ec)
{
// Perform the connect operation.
@@ -596,7 +662,7 @@ bool non_blocking_connect(socket_type s, asio::error_code& ec)
asio::error::get_system_category());
}
else
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
return true;
@@ -722,9 +788,9 @@ void init_buf(buf& b, const void* data, size_t size)
#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
}
-inline void init_msghdr_msg_name(void*& name, socket_addr_type* addr)
+inline void init_msghdr_msg_name(void*& name, void* addr)
{
- name = addr;
+ name = static_cast<socket_addr_type*>(addr);
}
inline void init_msghdr_msg_name(void*& name, const socket_addr_type* addr)
@@ -733,15 +799,15 @@ inline void init_msghdr_msg_name(void*& name, const socket_addr_type* addr)
}
template <typename T>
-inline void init_msghdr_msg_name(T& name, socket_addr_type* addr)
+inline void init_msghdr_msg_name(T& name, void* addr)
{
- name = reinterpret_cast<T>(addr);
+ name = static_cast<T>(addr);
}
template <typename T>
-inline void init_msghdr_msg_name(T& name, const socket_addr_type* addr)
+inline void init_msghdr_msg_name(T& name, const void* addr)
{
- name = reinterpret_cast<T>(const_cast<socket_addr_type*>(addr));
+ name = static_cast<T>(const_cast<void*>(addr));
}
signed_size_type recv(socket_type s, buf* bufs, size_t count,
@@ -763,7 +829,7 @@ signed_size_type recv(socket_type s, buf* bufs, size_t count,
result = 0;
if (result != 0)
return socket_error_retval;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return bytes_transferred;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
msghdr msg = msghdr();
@@ -796,7 +862,7 @@ signed_size_type recv1(socket_type s, void* data, size_t size,
result = 0;
if (result != 0)
return socket_error_retval;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return bytes_transferred;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
signed_size_type result = ::recv(s, static_cast<char*>(data), size, flags);
@@ -817,7 +883,7 @@ size_t sync_recv(socket_type s, state_type state, buf* bufs,
// A request to read 0 bytes on a stream is a no-op.
if (all_empty && (state & stream_oriented))
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -862,7 +928,7 @@ size_t sync_recv1(socket_type s, state_type state, void* data,
// A request to read 0 bytes on a stream is a no-op.
if (size == 0 && (state & stream_oriented))
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -915,7 +981,7 @@ void complete_iocp_recv(state_type state,
}
else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA)
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
// Check for connection closed.
@@ -1008,8 +1074,7 @@ bool non_blocking_recv1(socket_type s,
#endif // defined(ASIO_HAS_IOCP)
signed_size_type recvfrom(socket_type s, buf* bufs, size_t count,
- int flags, socket_addr_type* addr, std::size_t* addrlen,
- asio::error_code& ec)
+ int flags, void* addr, std::size_t* addrlen, asio::error_code& ec)
{
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
// Receive some data.
@@ -1017,8 +1082,8 @@ signed_size_type recvfrom(socket_type s, buf* bufs, size_t count,
DWORD bytes_transferred = 0;
DWORD recv_flags = flags;
int tmp_addrlen = (int)*addrlen;
- int result = ::WSARecvFrom(s, bufs, recv_buf_count,
- &bytes_transferred, &recv_flags, addr, &tmp_addrlen, 0, 0);
+ int result = ::WSARecvFrom(s, bufs, recv_buf_count, &bytes_transferred,
+ &recv_flags, static_cast<socket_addr_type*>(addr), &tmp_addrlen, 0, 0);
get_last_error(ec, true);
*addrlen = (std::size_t)tmp_addrlen;
if (ec.value() == ERROR_NETNAME_DELETED)
@@ -1029,7 +1094,7 @@ signed_size_type recvfrom(socket_type s, buf* bufs, size_t count,
result = 0;
if (result != 0)
return socket_error_retval;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return bytes_transferred;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
msghdr msg = msghdr();
@@ -1045,21 +1110,19 @@ signed_size_type recvfrom(socket_type s, buf* bufs, size_t count,
}
template <typename SockLenType>
-inline signed_size_type call_recvfrom(SockLenType msghdr::*,
- socket_type s, void* data, size_t size, int flags,
- socket_addr_type* addr, std::size_t* addrlen)
+inline signed_size_type call_recvfrom(SockLenType msghdr::*, socket_type s,
+ void* data, size_t size, int flags, void* addr, std::size_t* addrlen)
{
SockLenType tmp_addrlen = addrlen ? (SockLenType)*addrlen : 0;
- signed_size_type result = ::recvfrom(s, static_cast<char*>(data),
- size, flags, addr, addrlen ? &tmp_addrlen : 0);
+ signed_size_type result = ::recvfrom(s, static_cast<char*>(data), size,
+ flags, static_cast<socket_addr_type*>(addr), addrlen ? &tmp_addrlen : 0);
if (addrlen)
*addrlen = (std::size_t)tmp_addrlen;
return result;
}
signed_size_type recvfrom1(socket_type s, void* data, size_t size,
- int flags, socket_addr_type* addr, std::size_t* addrlen,
- asio::error_code& ec)
+ int flags, void* addr, std::size_t* addrlen, asio::error_code& ec)
{
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
// Receive some data.
@@ -1069,8 +1132,8 @@ signed_size_type recvfrom1(socket_type s, void* data, size_t size,
DWORD bytes_transferred = 0;
DWORD recv_flags = flags;
int tmp_addrlen = (int)*addrlen;
- int result = ::WSARecvFrom(s, &buf, 1, &bytes_transferred,
- &recv_flags, addr, &tmp_addrlen, 0, 0);
+ int result = ::WSARecvFrom(s, &buf, 1, &bytes_transferred, &recv_flags,
+ static_cast<socket_addr_type*>(addr), &tmp_addrlen, 0, 0);
get_last_error(ec, true);
*addrlen = (std::size_t)tmp_addrlen;
if (ec.value() == ERROR_NETNAME_DELETED)
@@ -1081,7 +1144,7 @@ signed_size_type recvfrom1(socket_type s, void* data, size_t size,
result = 0;
if (result != 0)
return socket_error_retval;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return bytes_transferred;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
signed_size_type result = call_recvfrom(&msghdr::msg_namelen,
@@ -1091,9 +1154,8 @@ signed_size_type recvfrom1(socket_type s, void* data, size_t size,
#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
}
-size_t sync_recvfrom(socket_type s, state_type state, buf* bufs,
- size_t count, int flags, socket_addr_type* addr,
- std::size_t* addrlen, asio::error_code& ec)
+size_t sync_recvfrom(socket_type s, state_type state, buf* bufs, size_t count,
+ int flags, void* addr, std::size_t* addrlen, asio::error_code& ec)
{
if (s == invalid_socket)
{
@@ -1124,9 +1186,8 @@ size_t sync_recvfrom(socket_type s, state_type state, buf* bufs,
}
}
-size_t sync_recvfrom1(socket_type s, state_type state, void* data,
- size_t size, int flags, socket_addr_type* addr,
- std::size_t* addrlen, asio::error_code& ec)
+size_t sync_recvfrom1(socket_type s, state_type state, void* data, size_t size,
+ int flags, void* addr, std::size_t* addrlen, asio::error_code& ec)
{
if (s == invalid_socket)
{
@@ -1177,15 +1238,14 @@ void complete_iocp_recvfrom(
}
else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA)
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
}
#else // defined(ASIO_HAS_IOCP)
-bool non_blocking_recvfrom(socket_type s,
- buf* bufs, size_t count, int flags,
- socket_addr_type* addr, std::size_t* addrlen,
+bool non_blocking_recvfrom(socket_type s, buf* bufs,
+ size_t count, int flags, void* addr, std::size_t* addrlen,
asio::error_code& ec, size_t& bytes_transferred)
{
for (;;)
@@ -1216,9 +1276,8 @@ bool non_blocking_recvfrom(socket_type s,
}
}
-bool non_blocking_recvfrom1(socket_type s,
- void* data, size_t size, int flags,
- socket_addr_type* addr, std::size_t* addrlen,
+bool non_blocking_recvfrom1(socket_type s, void* data,
+ size_t size, int flags, void* addr, std::size_t* addrlen,
asio::error_code& ec, size_t& bytes_transferred)
{
for (;;)
@@ -1324,7 +1383,7 @@ void complete_iocp_recvmsg(
}
else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA)
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
}
@@ -1381,7 +1440,7 @@ signed_size_type send(socket_type s, const buf* bufs, size_t count,
ec = asio::error::connection_refused;
if (result != 0)
return socket_error_retval;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return bytes_transferred;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
msghdr msg = msghdr();
@@ -1415,7 +1474,7 @@ signed_size_type send1(socket_type s, const void* data, size_t size,
ec = asio::error::connection_refused;
if (result != 0)
return socket_error_retval;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return bytes_transferred;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
#if defined(ASIO_HAS_MSG_NOSIGNAL)
@@ -1440,7 +1499,7 @@ size_t sync_send(socket_type s, state_type state, const buf* bufs,
// A request to write 0 bytes to a stream is a no-op.
if (all_empty && (state & stream_oriented))
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -1478,7 +1537,7 @@ size_t sync_send1(socket_type s, state_type state, const void* data,
// A request to write 0 bytes to a stream is a no-op.
if (size == 0 && (state & stream_oriented))
{
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -1590,16 +1649,17 @@ bool non_blocking_send1(socket_type s,
#endif // defined(ASIO_HAS_IOCP)
-signed_size_type sendto(socket_type s, const buf* bufs, size_t count,
- int flags, const socket_addr_type* addr, std::size_t addrlen,
- asio::error_code& ec)
+signed_size_type sendto(socket_type s, const buf* bufs,
+ size_t count, int flags, const void* addr,
+ std::size_t addrlen, asio::error_code& ec)
{
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
// Send the data.
DWORD send_buf_count = static_cast<DWORD>(count);
DWORD bytes_transferred = 0;
int result = ::WSASendTo(s, const_cast<buf*>(bufs),
- send_buf_count, &bytes_transferred, flags, addr,
+ send_buf_count, &bytes_transferred, flags,
+ static_cast<const socket_addr_type*>(addr),
static_cast<int>(addrlen), 0, 0);
get_last_error(ec, true);
if (ec.value() == ERROR_NETNAME_DELETED)
@@ -1608,7 +1668,7 @@ signed_size_type sendto(socket_type s, const buf* bufs, size_t count,
ec = asio::error::connection_refused;
if (result != 0)
return socket_error_retval;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return bytes_transferred;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
msghdr msg = msghdr();
@@ -1628,15 +1688,15 @@ signed_size_type sendto(socket_type s, const buf* bufs, size_t count,
template <typename SockLenType>
inline signed_size_type call_sendto(SockLenType msghdr::*,
socket_type s, const void* data, size_t size, int flags,
- const socket_addr_type* addr, std::size_t addrlen)
+ const void* addr, std::size_t addrlen)
{
- return ::sendto(s, static_cast<char*>(const_cast<void*>(data)),
- size, flags, addr, (SockLenType)addrlen);
+ return ::sendto(s, static_cast<char*>(const_cast<void*>(data)), size, flags,
+ static_cast<const socket_addr_type*>(addr), (SockLenType)addrlen);
}
-signed_size_type sendto1(socket_type s, const void* data, size_t size,
- int flags, const socket_addr_type* addr, std::size_t addrlen,
- asio::error_code& ec)
+signed_size_type sendto1(socket_type s, const void* data,
+ size_t size, int flags, const void* addr,
+ std::size_t addrlen, asio::error_code& ec)
{
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
// Send the data.
@@ -1644,8 +1704,9 @@ signed_size_type sendto1(socket_type s, const void* data, size_t size,
buf.buf = const_cast<char*>(static_cast<const char*>(data));
buf.len = static_cast<ULONG>(size);
DWORD bytes_transferred = 0;
- int result = ::WSASendTo(s, &buf, 1, &bytes_transferred,
- flags, addr, static_cast<int>(addrlen), 0, 0);
+ int result = ::WSASendTo(s, &buf, 1, &bytes_transferred, flags,
+ static_cast<const socket_addr_type*>(addr),
+ static_cast<int>(addrlen), 0, 0);
get_last_error(ec, true);
if (ec.value() == ERROR_NETNAME_DELETED)
ec = asio::error::connection_reset;
@@ -1653,7 +1714,7 @@ signed_size_type sendto1(socket_type s, const void* data, size_t size,
ec = asio::error::connection_refused;
if (result != 0)
return socket_error_retval;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return bytes_transferred;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
#if defined(ASIO_HAS_MSG_NOSIGNAL)
@@ -1666,8 +1727,8 @@ signed_size_type sendto1(socket_type s, const void* data, size_t size,
#endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
}
-size_t sync_sendto(socket_type s, state_type state, const buf* bufs,
- size_t count, int flags, const socket_addr_type* addr,
+size_t sync_sendto(socket_type s, state_type state,
+ const buf* bufs, size_t count, int flags, const void* addr,
std::size_t addrlen, asio::error_code& ec)
{
if (s == invalid_socket)
@@ -1699,8 +1760,8 @@ size_t sync_sendto(socket_type s, state_type state, const buf* bufs,
}
}
-size_t sync_sendto1(socket_type s, state_type state, const void* data,
- size_t size, int flags, const socket_addr_type* addr,
+size_t sync_sendto1(socket_type s, state_type state,
+ const void* data, size_t size, int flags, const void* addr,
std::size_t addrlen, asio::error_code& ec)
{
if (s == invalid_socket)
@@ -1736,7 +1797,7 @@ size_t sync_sendto1(socket_type s, state_type state, const void* data,
bool non_blocking_sendto(socket_type s,
const buf* bufs, size_t count, int flags,
- const socket_addr_type* addr, std::size_t addrlen,
+ const void* addr, std::size_t addrlen,
asio::error_code& ec, size_t& bytes_transferred)
{
for (;;)
@@ -1769,7 +1830,7 @@ bool non_blocking_sendto(socket_type s,
bool non_blocking_sendto1(socket_type s,
const void* data, size_t size, int flags,
- const socket_addr_type* addr, std::size_t addrlen,
+ const void* addr, std::size_t addrlen,
asio::error_code& ec, size_t& bytes_transferred)
{
for (;;)
@@ -1883,7 +1944,7 @@ int setsockopt(socket_type s, state_type& state, int level, int optname,
state |= enable_connection_aborted;
else
state &= ~enable_connection_aborted;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -1968,7 +2029,7 @@ int getsockopt(socket_type s, state_type state, int level, int optname,
}
*static_cast<int*>(optval) = (state & enable_connection_aborted) ? 1 : 0;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -1995,7 +2056,7 @@ int getsockopt(socket_type s, state_type state, int level, int optname,
// value is non-zero (i.e. true). This corresponds to the behavior of
// IPv6 sockets on Windows platforms pre-Vista.
*static_cast<DWORD*>(optval) = 1;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
return result;
}
@@ -2015,7 +2076,7 @@ int getsockopt(socket_type s, state_type state, int level, int optname,
// non-zero (i.e. true). This corresponds to the behavior of IPv6 sockets
// on Windows platforms pre-Vista.
*static_cast<DWORD*>(optval) = 1;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
return result;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
@@ -2040,16 +2101,17 @@ int getsockopt(socket_type s, state_type state, int level, int optname,
template <typename SockLenType>
inline int call_getpeername(SockLenType msghdr::*,
- socket_type s, socket_addr_type* addr, std::size_t* addrlen)
+ socket_type s, void* addr, std::size_t* addrlen)
{
SockLenType tmp_addrlen = (SockLenType)*addrlen;
- int result = ::getpeername(s, addr, &tmp_addrlen);
+ int result = ::getpeername(s,
+ static_cast<socket_addr_type*>(addr), &tmp_addrlen);
*addrlen = (std::size_t)tmp_addrlen;
return result;
}
-int getpeername(socket_type s, socket_addr_type* addr,
- std::size_t* addrlen, bool cached, asio::error_code& ec)
+int getpeername(socket_type s, void* addr, std::size_t* addrlen,
+ bool cached, asio::error_code& ec)
{
if (s == invalid_socket)
{
@@ -2076,7 +2138,7 @@ int getpeername(socket_type s, socket_addr_type* addr,
}
// The cached value is still valid.
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
#else // defined(ASIO_WINDOWS) && !defined(ASIO_WINDOWS_APP)
@@ -2092,15 +2154,16 @@ int getpeername(socket_type s, socket_addr_type* addr,
template <typename SockLenType>
inline int call_getsockname(SockLenType msghdr::*,
- socket_type s, socket_addr_type* addr, std::size_t* addrlen)
+ socket_type s, void* addr, std::size_t* addrlen)
{
SockLenType tmp_addrlen = (SockLenType)*addrlen;
- int result = ::getsockname(s, addr, &tmp_addrlen);
+ int result = ::getsockname(s,
+ static_cast<socket_addr_type*>(addr), &tmp_addrlen);
*addrlen = (std::size_t)tmp_addrlen;
return result;
}
-int getsockname(socket_type s, socket_addr_type* addr,
+int getsockname(socket_type s, void* addr,
std::size_t* addrlen, asio::error_code& ec)
{
if (s == invalid_socket)
@@ -2171,7 +2234,7 @@ int select(int nfds, fd_set* readfds, fd_set* writefds,
if (milliseconds == 0)
milliseconds = 1; // Force context switch.
::Sleep(milliseconds);
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 0;
}
@@ -2491,7 +2554,7 @@ const char* inet_ntop(int af, const void* src, char* dest, size_t length,
// Windows may set error code on success.
if (result != socket_error_retval)
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
// Windows may not set an error code on failure.
else if (result == socket_error_retval && !ec)
@@ -2514,7 +2577,11 @@ const char* inet_ntop(int af, const void* src, char* dest, size_t length,
&& ((ipv6_address->s6_addr[1] & 0x0f) == 0x02));
if ((!is_link_local && !is_multicast_link_local)
|| if_indextoname(static_cast<unsigned>(scope_id), if_name + 1) == 0)
+#if defined(ASIO_HAS_SNPRINTF)
+ snprintf(if_name + 1, sizeof(if_name) - 1, "%lu", scope_id);
+#else // defined(ASIO_HAS_SNPRINTF)
sprintf(if_name + 1, "%lu", scope_id);
+#endif // defined(ASIO_HAS_SNPRINTF)
strcat(dest, if_name);
}
return result;
@@ -2545,7 +2612,7 @@ int inet_pton(int af, const char* src, void* dest,
bytes[1] = static_cast<unsigned char>(b1);
bytes[2] = static_cast<unsigned char>(b2);
bytes[3] = static_cast<unsigned char>(b3);
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 1;
}
else if (af == ASIO_OS_DEF(AF_INET6))
@@ -2661,7 +2728,7 @@ int inet_pton(int af, const char* src, void* dest,
for (int i = 0; i < num_back_bytes; ++i)
bytes[16 - num_back_bytes + i] = back_bytes[i];
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return 1;
}
else
@@ -2704,12 +2771,12 @@ int inet_pton(int af, const char* src, void* dest,
if (result != socket_error_retval)
{
memcpy(dest, &address.v4.sin_addr, sizeof(in4_addr_type));
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
else if (strcmp(src, "255.255.255.255") == 0)
{
static_cast<in4_addr_type*>(dest)->s_addr = INADDR_NONE;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
}
else // AF_INET6
@@ -2719,7 +2786,7 @@ int inet_pton(int af, const char* src, void* dest,
memcpy(dest, &address.v6.sin6_addr, sizeof(in6_addr_type));
if (scope_id)
*scope_id = address.v6.sin6_scope_id;
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
}
}
@@ -2728,7 +2795,7 @@ int inet_pton(int af, const char* src, void* dest,
ec = asio::error::invalid_argument;
if (result != socket_error_retval)
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return result == socket_error_retval ? -1 : 1;
#else // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
@@ -3622,7 +3689,9 @@ inline asio::error_code getnameinfo_emulation(
{
return ec = asio::error::no_buffer_space;
}
-#if defined(ASIO_HAS_SECURE_RTL)
+#if defined(ASIO_HAS_SNPRINTF)
+ snprintf(serv, servlen, "%u", ntohs(port));
+#elif defined(ASIO_HAS_SECURE_RTL)
sprintf_s(serv, servlen, "%u", ntohs(port));
#else // defined(ASIO_HAS_SECURE_RTL)
sprintf(serv, "%u", ntohs(port));
@@ -3645,7 +3714,9 @@ inline asio::error_code getnameinfo_emulation(
{
return ec = asio::error::no_buffer_space;
}
-#if defined(ASIO_HAS_SECURE_RTL)
+#if defined(ASIO_HAS_SNPRINTF)
+ snprintf(serv, servlen, "%u", ntohs(port));
+#elif defined(ASIO_HAS_SECURE_RTL)
sprintf_s(serv, servlen, "%u", ntohs(port));
#else // defined(ASIO_HAS_SECURE_RTL)
sprintf(serv, "%u", ntohs(port));
@@ -3657,7 +3728,7 @@ inline asio::error_code getnameinfo_emulation(
}
}
- ec.assign(0, ec.category());
+ asio::error::clear(ec);
return ec;
}
@@ -3807,7 +3878,7 @@ void freeaddrinfo(addrinfo_type* ai)
#endif
}
-asio::error_code getnameinfo(const socket_addr_type* addr,
+asio::error_code getnameinfo(const void* addr,
std::size_t addrlen, char* host, std::size_t hostlen,
char* serv, std::size_t servlen, int flags, asio::error_code& ec)
{
@@ -3815,8 +3886,8 @@ asio::error_code getnameinfo(const socket_addr_type* addr,
# if defined(ASIO_HAS_GETADDRINFO)
// Building for Windows XP, Windows Server 2003, or later.
clear_last_error();
- int error = ::getnameinfo(addr, static_cast<socklen_t>(addrlen),
- host, static_cast<DWORD>(hostlen),
+ int error = ::getnameinfo(static_cast<const socket_addr_type*>(addr),
+ static_cast<socklen_t>(addrlen), host, static_cast<DWORD>(hostlen),
serv, static_cast<DWORD>(servlen), flags);
return ec = translate_addrinfo_error(error);
# else
@@ -3828,34 +3899,34 @@ asio::error_code getnameinfo(const socket_addr_type* addr,
if (gni_t gni = (gni_t)::GetProcAddress(winsock_module, "getnameinfo"))
{
clear_last_error();
- int error = gni(addr, static_cast<int>(addrlen),
- host, static_cast<DWORD>(hostlen),
+ int error = gni(static_cast<const socket_addr_type*>(addr),
+ static_cast<int>(addrlen), host, static_cast<DWORD>(hostlen),
serv, static_cast<DWORD>(servlen), flags);
return ec = translate_addrinfo_error(error);
}
}
clear_last_error();
- return getnameinfo_emulation(addr, addrlen,
- host, hostlen, serv, servlen, flags, ec);
+ return getnameinfo_emulation(static_cast<const socket_addr_type*>(addr),
+ addrlen, host, hostlen, serv, servlen, flags, ec);
# endif
#elif !defined(ASIO_HAS_GETADDRINFO)
using namespace std; // For memcpy.
sockaddr_storage_type tmp_addr;
memcpy(&tmp_addr, addr, addrlen);
- addr = reinterpret_cast<socket_addr_type*>(&tmp_addr);
+ addr = &tmp_addr;
clear_last_error();
- return getnameinfo_emulation(addr, addrlen,
- host, hostlen, serv, servlen, flags, ec);
+ return getnameinfo_emulation(static_cast<const socket_addr_type*>(addr),
+ addrlen, host, hostlen, serv, servlen, flags, ec);
#else
clear_last_error();
- int error = ::getnameinfo(addr, addrlen, host, hostlen, serv, servlen, flags);
+ int error = ::getnameinfo(static_cast<const socket_addr_type*>(addr),
+ addrlen, host, hostlen, serv, servlen, flags);
return ec = translate_addrinfo_error(error);
#endif
}
-asio::error_code sync_getnameinfo(
- const socket_addr_type* addr, std::size_t addrlen,
- char* host, std::size_t hostlen, char* serv,
+asio::error_code sync_getnameinfo(const void* addr,
+ std::size_t addrlen, char* host, std::size_t hostlen, char* serv,
std::size_t servlen, int sock_type, asio::error_code& ec)
{
// First try resolving with the service name. If that fails try resolving
@@ -3874,7 +3945,7 @@ asio::error_code sync_getnameinfo(
asio::error_code background_getnameinfo(
const weak_cancel_token_type& cancel_token,
- const socket_addr_type* addr, std::size_t addrlen,
+ const void* addr, std::size_t addrlen,
char* host, std::size_t hostlen, char* serv,
std::size_t servlen, int sock_type, asio::error_code& ec)
{
diff --git a/3rdparty/asio/include/asio/detail/impl/socket_select_interrupter.ipp b/3rdparty/asio/include/asio/detail/impl/socket_select_interrupter.ipp
index 81813db0b7a..a5b29581eb0 100644
--- a/3rdparty/asio/include/asio/detail/impl/socket_select_interrupter.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/socket_select_interrupter.ipp
@@ -2,7 +2,7 @@
// detail/impl/socket_select_interrupter.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -60,11 +60,11 @@ void socket_select_interrupter::open_descriptors()
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = socket_ops::host_to_network_long(INADDR_LOOPBACK);
addr.sin_port = 0;
- if (socket_ops::bind(acceptor.get(), (const socket_addr_type*)&addr,
+ if (socket_ops::bind(acceptor.get(), &addr,
addr_len, ec) == socket_error_retval)
asio::detail::throw_error(ec, "socket_select_interrupter");
- if (socket_ops::getsockname(acceptor.get(), (socket_addr_type*)&addr,
+ if (socket_ops::getsockname(acceptor.get(), &addr,
&addr_len, ec) == socket_error_retval)
asio::detail::throw_error(ec, "socket_select_interrupter");
@@ -83,7 +83,7 @@ void socket_select_interrupter::open_descriptors()
if (client.get() == invalid_socket)
asio::detail::throw_error(ec, "socket_select_interrupter");
- if (socket_ops::connect(client.get(), (const socket_addr_type*)&addr,
+ if (socket_ops::connect(client.get(), &addr,
addr_len, ec) == socket_error_retval)
asio::detail::throw_error(ec, "socket_select_interrupter");
diff --git a/3rdparty/asio/include/asio/detail/impl/strand_executor_service.hpp b/3rdparty/asio/include/asio/detail/impl/strand_executor_service.hpp
index b66b6747f01..3ffb398dcf6 100644
--- a/3rdparty/asio/include/asio/detail/impl/strand_executor_service.hpp
+++ b/3rdparty/asio/include/asio/detail/impl/strand_executor_service.hpp
@@ -2,7 +2,7 @@
// detail/impl/strand_executor_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,7 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/fenced_block.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/recycling_allocator.hpp"
#include "asio/executor_work_guard.hpp"
#include "asio/defer.hpp"
@@ -34,8 +33,8 @@ class strand_executor_service::allocator_binder
public:
typedef Allocator allocator_type;
- allocator_binder(ASIO_MOVE_ARG(F) f, const Allocator& a)
- : f_(ASIO_MOVE_CAST(F)(f)),
+ allocator_binder(F&& f, const Allocator& a)
+ : f_(static_cast<F&&>(f)),
allocator_(a)
{
}
@@ -46,15 +45,13 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE)
allocator_binder(allocator_binder&& other)
- : f_(ASIO_MOVE_CAST(F)(other.f_)),
- allocator_(ASIO_MOVE_CAST(allocator_type)(other.allocator_))
+ : f_(static_cast<F&&>(other.f_)),
+ allocator_(static_cast<allocator_type&&>(other.allocator_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
- allocator_type get_allocator() const ASIO_NOEXCEPT
+ allocator_type get_allocator() const noexcept
{
return allocator_;
}
@@ -71,9 +68,9 @@ private:
template <typename Executor>
class strand_executor_service::invoker<Executor,
- typename enable_if<
+ enable_if_t<
execution::is_executor<Executor>::value
- >::type>
+ >>
{
public:
invoker(const implementation_type& impl, Executor& ex)
@@ -88,13 +85,11 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE)
invoker(invoker&& other)
- : impl_(ASIO_MOVE_CAST(implementation_type)(other.impl_)),
- executor_(ASIO_MOVE_CAST(executor_type)(other.executor_))
+ : impl_(static_cast<implementation_type&&>(other.impl_)),
+ executor_(static_cast<executor_type&&>(other.executor_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
struct on_invoker_exit
{
@@ -106,13 +101,12 @@ public:
{
recycling_allocator<void> allocator;
executor_type ex = this_->executor_;
- execution::execute(
- asio::prefer(
- asio::require(
- ASIO_MOVE_CAST(executor_type)(ex),
- execution::blocking.never),
- execution::allocator(allocator)),
- ASIO_MOVE_CAST(invoker)(*this_));
+ asio::prefer(
+ asio::require(
+ static_cast<executor_type&&>(ex),
+ execution::blocking.never),
+ execution::allocator(allocator)
+ ).execute(static_cast<invoker&&>(*this_));
}
}
};
@@ -127,12 +121,12 @@ public:
}
private:
- typedef typename decay<
- typename prefer_result<
+ typedef decay_t<
+ prefer_result_t<
Executor,
execution::outstanding_work_t::tracked_t
- >::type
- >::type executor_type;
+ >
+ > executor_type;
implementation_type impl_;
executor_type executor_;
@@ -142,9 +136,9 @@ private:
template <typename Executor>
class strand_executor_service::invoker<Executor,
- typename enable_if<
+ enable_if_t<
!execution::is_executor<Executor>::value
- >::type>
+ >>
{
public:
invoker(const implementation_type& impl, Executor& ex)
@@ -159,13 +153,11 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE)
invoker(invoker&& other)
- : impl_(ASIO_MOVE_CAST(implementation_type)(other.impl_)),
- work_(ASIO_MOVE_CAST(executor_work_guard<Executor>)(other.work_))
+ : impl_(static_cast<implementation_type&&>(other.impl_)),
+ work_(static_cast<executor_work_guard<Executor>&&>(other.work_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
struct on_invoker_exit
{
@@ -177,7 +169,7 @@ public:
{
Executor ex(this_->work_.get_executor());
recycling_allocator<void> allocator;
- ex.post(ASIO_MOVE_CAST(invoker)(*this_), allocator);
+ ex.post(static_cast<invoker&&>(*this_), allocator);
}
}
};
@@ -200,33 +192,33 @@ private:
template <typename Executor, typename Function>
inline void strand_executor_service::execute(const implementation_type& impl,
- Executor& ex, ASIO_MOVE_ARG(Function) function,
- typename enable_if<
- can_query<Executor, execution::allocator_t<void> >::value
- >::type*)
+ Executor& ex, Function&& function,
+ enable_if_t<
+ can_query<Executor, execution::allocator_t<void>>::value
+ >*)
{
return strand_executor_service::do_execute(impl, ex,
- ASIO_MOVE_CAST(Function)(function),
+ static_cast<Function&&>(function),
asio::query(ex, execution::allocator));
}
template <typename Executor, typename Function>
inline void strand_executor_service::execute(const implementation_type& impl,
- Executor& ex, ASIO_MOVE_ARG(Function) function,
- typename enable_if<
- !can_query<Executor, execution::allocator_t<void> >::value
- >::type*)
+ Executor& ex, Function&& function,
+ enable_if_t<
+ !can_query<Executor, execution::allocator_t<void>>::value
+ >*)
{
return strand_executor_service::do_execute(impl, ex,
- ASIO_MOVE_CAST(Function)(function),
+ static_cast<Function&&>(function),
std::allocator<void>());
}
template <typename Executor, typename Function, typename Allocator>
void strand_executor_service::do_execute(const implementation_type& impl,
- Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a)
+ Executor& ex, Function&& function, const Allocator& a)
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// If the executor is not never-blocking, and we are already in the strand,
// then the function can run immediately.
@@ -234,17 +226,17 @@ void strand_executor_service::do_execute(const implementation_type& impl,
&& running_in_this_thread(impl))
{
// Make a local, non-const copy of the function.
- function_type tmp(ASIO_MOVE_CAST(Function)(function));
+ function_type tmp(static_cast<Function&&>(function));
fenced_block b(fenced_block::full);
- asio_handler_invoke_helpers::invoke(tmp, tmp);
+ static_cast<function_type&&>(tmp)();
return;
}
// Allocate and construct an operation to wrap the function.
typedef executor_op<function_type, Allocator> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a);
+ p.p = new (p.v) op(static_cast<Function&&>(function), a);
ASIO_HANDLER_CREATION((impl->service_->context(), *p.p,
"strand_executor", impl.get(), 0, "execute"));
@@ -254,31 +246,31 @@ void strand_executor_service::do_execute(const implementation_type& impl,
p.v = p.p = 0;
if (first)
{
- execution::execute(ex, invoker<Executor>(impl, ex));
+ ex.execute(invoker<Executor>(impl, ex));
}
}
template <typename Executor, typename Function, typename Allocator>
void strand_executor_service::dispatch(const implementation_type& impl,
- Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a)
+ Executor& ex, Function&& function, const Allocator& a)
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// If we are already in the strand then the function can run immediately.
if (running_in_this_thread(impl))
{
// Make a local, non-const copy of the function.
- function_type tmp(ASIO_MOVE_CAST(Function)(function));
+ function_type tmp(static_cast<Function&&>(function));
fenced_block b(fenced_block::full);
- asio_handler_invoke_helpers::invoke(tmp, tmp);
+ static_cast<function_type&&>(tmp)();
return;
}
// Allocate and construct an operation to wrap the function.
typedef executor_op<function_type, Allocator> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a);
+ p.p = new (p.v) op(static_cast<Function&&>(function), a);
ASIO_HANDLER_CREATION((impl->service_->context(), *p.p,
"strand_executor", impl.get(), 0, "dispatch"));
@@ -297,14 +289,14 @@ void strand_executor_service::dispatch(const implementation_type& impl,
// Request invocation of the given function and return immediately.
template <typename Executor, typename Function, typename Allocator>
void strand_executor_service::post(const implementation_type& impl,
- Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a)
+ Executor& ex, Function&& function, const Allocator& a)
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// Allocate and construct an operation to wrap the function.
typedef executor_op<function_type, Allocator> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a);
+ p.p = new (p.v) op(static_cast<Function&&>(function), a);
ASIO_HANDLER_CREATION((impl->service_->context(), *p.p,
"strand_executor", impl.get(), 0, "post"));
@@ -323,14 +315,14 @@ void strand_executor_service::post(const implementation_type& impl,
// Request invocation of the given function and return immediately.
template <typename Executor, typename Function, typename Allocator>
void strand_executor_service::defer(const implementation_type& impl,
- Executor& ex, ASIO_MOVE_ARG(Function) function, const Allocator& a)
+ Executor& ex, Function&& function, const Allocator& a)
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// Allocate and construct an operation to wrap the function.
typedef executor_op<function_type, Allocator> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(function), a);
+ p.p = new (p.v) op(static_cast<Function&&>(function), a);
ASIO_HANDLER_CREATION((impl->service_->context(), *p.p,
"strand_executor", impl.get(), 0, "defer"));
diff --git a/3rdparty/asio/include/asio/detail/impl/strand_executor_service.ipp b/3rdparty/asio/include/asio/detail/impl/strand_executor_service.ipp
index c97b6df5a69..a2dff894cca 100644
--- a/3rdparty/asio/include/asio/detail/impl/strand_executor_service.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/strand_executor_service.ipp
@@ -2,7 +2,7 @@
// detail/impl/strand_executor_service.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/strand_service.hpp b/3rdparty/asio/include/asio/detail/impl/strand_service.hpp
index 3e395d6c9d6..8249c9eb8d5 100644
--- a/3rdparty/asio/include/asio/detail/impl/strand_service.hpp
+++ b/3rdparty/asio/include/asio/detail/impl/strand_service.hpp
@@ -2,7 +2,7 @@
// detail/impl/strand_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,7 +18,6 @@
#include "asio/detail/completion_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/push_options.hpp"
@@ -40,7 +39,7 @@ void strand_service::dispatch(strand_service::implementation_type& impl,
if (running_in_this_thread(impl))
{
fenced_block b(fenced_block::full);
- asio_handler_invoke_helpers::invoke(handler, handler);
+ static_cast<Handler&&>(handler)();
return;
}
diff --git a/3rdparty/asio/include/asio/detail/impl/strand_service.ipp b/3rdparty/asio/include/asio/detail/impl/strand_service.ipp
index 58d657c9853..af8929a00c6 100644
--- a/3rdparty/asio/include/asio/detail/impl/strand_service.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/strand_service.ipp
@@ -2,7 +2,7 @@
// detail/impl/strand_service.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/thread_context.ipp b/3rdparty/asio/include/asio/detail/impl/thread_context.ipp
index 65cc275df24..8e729776362 100644
--- a/3rdparty/asio/include/asio/detail/impl/thread_context.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/thread_context.ipp
@@ -2,7 +2,7 @@
// detail/impl/thread_context.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/throw_error.ipp b/3rdparty/asio/include/asio/detail/impl/throw_error.ipp
index 9553add22e4..7baf3e729e5 100644
--- a/3rdparty/asio/include/asio/detail/impl/throw_error.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/throw_error.ipp
@@ -2,7 +2,7 @@
// detail/impl/throw_error.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,7 +17,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/throw_error.hpp"
-#include "asio/detail/throw_exception.hpp"
#include "asio/system_error.hpp"
#include "asio/detail/push_options.hpp"
@@ -25,37 +24,21 @@
namespace asio {
namespace detail {
-void do_throw_error(const asio::error_code& err)
+void do_throw_error(
+ const asio::error_code& err
+ ASIO_SOURCE_LOCATION_PARAM)
{
asio::system_error e(err);
- asio::detail::throw_exception(e);
+ asio::detail::throw_exception(e ASIO_SOURCE_LOCATION_ARG);
}
-void do_throw_error(const asio::error_code& err, const char* location)
+void do_throw_error(
+ const asio::error_code& err,
+ const char* location
+ ASIO_SOURCE_LOCATION_PARAM)
{
- // boostify: non-boost code starts here
-#if defined(ASIO_MSVC) \
- && defined(ASIO_HAS_STD_SYSTEM_ERROR) \
- && (_MSC_VER < 1928)
- // Microsoft's implementation of std::system_error is non-conformant in that
- // it ignores the error code's message when a "what" string is supplied. We'll
- // work around this by explicitly formatting the "what" string.
- std::string what_msg = location;
- what_msg += ": ";
- what_msg += err.message();
- asio::system_error e(err, what_msg);
- asio::detail::throw_exception(e);
-#else // defined(ASIO_MSVC)
- // && defined(ASIO_HAS_STD_SYSTEM_ERROR)
- // && (_MSC_VER < 1928)
- // boostify: non-boost code ends here
asio::system_error e(err, location);
- asio::detail::throw_exception(e);
- // boostify: non-boost code starts here
-#endif // defined(ASIO_MSVC)
- // && defined(ASIO_HAS_STD_SYSTEM_ERROR)
- // && (_MSC_VER < 1928)
- // boostify: non-boost code ends here
+ asio::detail::throw_exception(e ASIO_SOURCE_LOCATION_ARG);
}
} // namespace detail
diff --git a/3rdparty/asio/include/asio/detail/impl/timer_queue_ptime.ipp b/3rdparty/asio/include/asio/detail/impl/timer_queue_ptime.ipp
index 8d39edbc1a6..bdf994e3a41 100644
--- a/3rdparty/asio/include/asio/detail/impl/timer_queue_ptime.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/timer_queue_ptime.ipp
@@ -2,7 +2,7 @@
// detail/impl/timer_queue_ptime.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -26,62 +26,62 @@
namespace asio {
namespace detail {
-timer_queue<time_traits<boost::posix_time::ptime> >::timer_queue()
+timer_queue<time_traits<boost::posix_time::ptime>>::timer_queue()
{
}
-timer_queue<time_traits<boost::posix_time::ptime> >::~timer_queue()
+timer_queue<time_traits<boost::posix_time::ptime>>::~timer_queue()
{
}
-bool timer_queue<time_traits<boost::posix_time::ptime> >::enqueue_timer(
+bool timer_queue<time_traits<boost::posix_time::ptime>>::enqueue_timer(
const time_type& time, per_timer_data& timer, wait_op* op)
{
return impl_.enqueue_timer(time, timer, op);
}
-bool timer_queue<time_traits<boost::posix_time::ptime> >::empty() const
+bool timer_queue<time_traits<boost::posix_time::ptime>>::empty() const
{
return impl_.empty();
}
-long timer_queue<time_traits<boost::posix_time::ptime> >::wait_duration_msec(
+long timer_queue<time_traits<boost::posix_time::ptime>>::wait_duration_msec(
long max_duration) const
{
return impl_.wait_duration_msec(max_duration);
}
-long timer_queue<time_traits<boost::posix_time::ptime> >::wait_duration_usec(
+long timer_queue<time_traits<boost::posix_time::ptime>>::wait_duration_usec(
long max_duration) const
{
return impl_.wait_duration_usec(max_duration);
}
-void timer_queue<time_traits<boost::posix_time::ptime> >::get_ready_timers(
+void timer_queue<time_traits<boost::posix_time::ptime>>::get_ready_timers(
op_queue<operation>& ops)
{
impl_.get_ready_timers(ops);
}
-void timer_queue<time_traits<boost::posix_time::ptime> >::get_all_timers(
+void timer_queue<time_traits<boost::posix_time::ptime>>::get_all_timers(
op_queue<operation>& ops)
{
impl_.get_all_timers(ops);
}
-std::size_t timer_queue<time_traits<boost::posix_time::ptime> >::cancel_timer(
+std::size_t timer_queue<time_traits<boost::posix_time::ptime>>::cancel_timer(
per_timer_data& timer, op_queue<operation>& ops, std::size_t max_cancelled)
{
return impl_.cancel_timer(timer, ops, max_cancelled);
}
-void timer_queue<time_traits<boost::posix_time::ptime> >::cancel_timer_by_key(
+void timer_queue<time_traits<boost::posix_time::ptime>>::cancel_timer_by_key(
per_timer_data* timer, op_queue<operation>& ops, void* cancellation_key)
{
impl_.cancel_timer_by_key(timer, ops, cancellation_key);
}
-void timer_queue<time_traits<boost::posix_time::ptime> >::move_timer(
+void timer_queue<time_traits<boost::posix_time::ptime>>::move_timer(
per_timer_data& target, per_timer_data& source)
{
impl_.move_timer(target, source);
diff --git a/3rdparty/asio/include/asio/detail/impl/timer_queue_set.ipp b/3rdparty/asio/include/asio/detail/impl/timer_queue_set.ipp
index 04c62c3b5a7..66420e98a7c 100644
--- a/3rdparty/asio/include/asio/detail/impl/timer_queue_set.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/timer_queue_set.ipp
@@ -2,7 +2,7 @@
// detail/impl/timer_queue_set.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/win_event.ipp b/3rdparty/asio/include/asio/detail/impl/win_event.ipp
index d442c4d0ec7..9827e339769 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_event.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_event.ipp
@@ -2,7 +2,7 @@
// detail/win_event.ipp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/win_iocp_file_service.ipp b/3rdparty/asio/include/asio/detail/impl/win_iocp_file_service.ipp
new file mode 100644
index 00000000000..faaab48ad52
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/impl/win_iocp_file_service.ipp
@@ -0,0 +1,280 @@
+//
+// detail/impl/win_iocp_file_service.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IMPL_WIN_IOCP_FILE_SERVICE_IPP
+#define ASIO_DETAIL_IMPL_WIN_IOCP_FILE_SERVICE_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_FILE) \
+ && defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
+
+#include <cstring>
+#include <sys/stat.h>
+#include "asio/detail/win_iocp_file_service.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+win_iocp_file_service::win_iocp_file_service(
+ execution_context& context)
+ : execution_context_service_base<win_iocp_file_service>(context),
+ handle_service_(context),
+ nt_flush_buffers_file_ex_(0)
+{
+ if (FARPROC nt_flush_buffers_file_ex_ptr = ::GetProcAddress(
+ ::GetModuleHandleA("NTDLL"), "NtFlushBuffersFileEx"))
+ {
+ nt_flush_buffers_file_ex_ = reinterpret_cast<nt_flush_buffers_file_ex_fn>(
+ reinterpret_cast<void*>(nt_flush_buffers_file_ex_ptr));
+ }
+}
+
+void win_iocp_file_service::shutdown()
+{
+ handle_service_.shutdown();
+}
+
+asio::error_code win_iocp_file_service::open(
+ win_iocp_file_service::implementation_type& impl,
+ const char* path, file_base::flags open_flags,
+ asio::error_code& ec)
+{
+ if (is_open(impl))
+ {
+ ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ DWORD access = 0;
+ if ((open_flags & file_base::read_only) != 0)
+ access = GENERIC_READ;
+ else if ((open_flags & file_base::write_only) != 0)
+ access = GENERIC_WRITE;
+ else if ((open_flags & file_base::read_write) != 0)
+ access = GENERIC_READ | GENERIC_WRITE;
+
+ DWORD share = FILE_SHARE_READ | FILE_SHARE_WRITE;
+
+ DWORD disposition = 0;
+ if ((open_flags & file_base::create) != 0)
+ {
+ if ((open_flags & file_base::exclusive) != 0)
+ disposition = CREATE_NEW;
+ else
+ disposition = OPEN_ALWAYS;
+ }
+ else
+ {
+ if ((open_flags & file_base::truncate) != 0)
+ disposition = TRUNCATE_EXISTING;
+ else
+ disposition = OPEN_EXISTING;
+ }
+
+ DWORD flags = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED;
+ if (impl.is_stream_)
+ flags |= FILE_FLAG_SEQUENTIAL_SCAN;
+ else
+ flags |= FILE_FLAG_RANDOM_ACCESS;
+ if ((open_flags & file_base::sync_all_on_write) != 0)
+ flags |= FILE_FLAG_WRITE_THROUGH;
+
+ HANDLE handle = ::CreateFileA(path, access, share, 0, disposition, flags, 0);
+ if (handle != INVALID_HANDLE_VALUE)
+ {
+ if (disposition == OPEN_ALWAYS)
+ {
+ if ((open_flags & file_base::truncate) != 0)
+ {
+ if (!::SetEndOfFile(handle))
+ {
+ DWORD last_error = ::GetLastError();
+ ::CloseHandle(handle);
+ ec.assign(last_error, asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+ }
+ else if ((open_flags & file_base::append) != 0)
+ {
+ if (::SetFilePointer(handle, 0, 0, FILE_END)
+ == INVALID_SET_FILE_POINTER)
+ {
+ DWORD last_error = ::GetLastError();
+ ::CloseHandle(handle);
+ ec.assign(last_error, asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+ }
+ }
+
+ handle_service_.assign(impl, handle, ec);
+ if (ec)
+ ::CloseHandle(handle);
+ impl.offset_ = 0;
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+ else
+ {
+ DWORD last_error = ::GetLastError();
+ ec.assign(last_error, asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+}
+
+uint64_t win_iocp_file_service::size(
+ const win_iocp_file_service::implementation_type& impl,
+ asio::error_code& ec) const
+{
+ LARGE_INTEGER result;
+ if (::GetFileSizeEx(native_handle(impl), &result))
+ {
+ asio::error::clear(ec);
+ return static_cast<uint64_t>(result.QuadPart);
+ }
+ else
+ {
+ DWORD last_error = ::GetLastError();
+ ec.assign(last_error, asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
+ return 0;
+ }
+}
+
+asio::error_code win_iocp_file_service::resize(
+ win_iocp_file_service::implementation_type& impl,
+ uint64_t n, asio::error_code& ec)
+{
+ LARGE_INTEGER distance;
+ distance.QuadPart = n;
+ if (::SetFilePointerEx(native_handle(impl), distance, 0, FILE_BEGIN))
+ {
+ BOOL result = ::SetEndOfFile(native_handle(impl));
+ DWORD last_error = ::GetLastError();
+
+ distance.QuadPart = static_cast<LONGLONG>(impl.offset_);
+ if (!::SetFilePointerEx(native_handle(impl), distance, 0, FILE_BEGIN))
+ {
+ result = FALSE;
+ last_error = ::GetLastError();
+ }
+
+ if (result)
+ asio::error::clear(ec);
+ else
+ ec.assign(last_error, asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+ else
+ {
+ DWORD last_error = ::GetLastError();
+ ec.assign(last_error, asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+}
+
+asio::error_code win_iocp_file_service::sync_all(
+ win_iocp_file_service::implementation_type& impl,
+ asio::error_code& ec)
+{
+ BOOL result = ::FlushFileBuffers(native_handle(impl));
+ if (result)
+ {
+ asio::error::clear(ec);
+ return ec;
+ }
+ else
+ {
+ DWORD last_error = ::GetLastError();
+ ec.assign(last_error, asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+}
+
+asio::error_code win_iocp_file_service::sync_data(
+ win_iocp_file_service::implementation_type& impl,
+ asio::error_code& ec)
+{
+ if (nt_flush_buffers_file_ex_)
+ {
+ io_status_block status = {};
+ if (!nt_flush_buffers_file_ex_(native_handle(impl),
+ flush_flags_file_data_sync_only, 0, 0, &status))
+ {
+ asio::error::clear(ec);
+ return ec;
+ }
+ }
+ return sync_all(impl, ec);
+}
+
+uint64_t win_iocp_file_service::seek(
+ win_iocp_file_service::implementation_type& impl, int64_t offset,
+ file_base::seek_basis whence, asio::error_code& ec)
+{
+ DWORD method;
+ switch (whence)
+ {
+ case file_base::seek_set:
+ method = FILE_BEGIN;
+ break;
+ case file_base::seek_cur:
+ method = FILE_BEGIN;
+ offset = static_cast<int64_t>(impl.offset_) + offset;
+ break;
+ case file_base::seek_end:
+ method = FILE_END;
+ break;
+ default:
+ ec = asio::error::invalid_argument;
+ ASIO_ERROR_LOCATION(ec);
+ return 0;
+ }
+
+ LARGE_INTEGER distance, new_offset;
+ distance.QuadPart = offset;
+ if (::SetFilePointerEx(native_handle(impl), distance, &new_offset, method))
+ {
+ impl.offset_ = new_offset.QuadPart;
+ asio::error::clear(ec);
+ return impl.offset_;
+ }
+ else
+ {
+ DWORD last_error = ::GetLastError();
+ ec.assign(last_error, asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
+ return 0;
+ }
+}
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_FILE)
+ // && defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
+
+#endif // ASIO_DETAIL_IMPL_WIN_IOCP_FILE_SERVICE_IPP
diff --git a/3rdparty/asio/include/asio/detail/impl/win_iocp_handle_service.ipp b/3rdparty/asio/include/asio/detail/impl/win_iocp_handle_service.ipp
index 7cefc156337..6136e27fb32 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_iocp_handle_service.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_iocp_handle_service.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_iocp_handle_service.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -68,6 +68,7 @@ public:
win_iocp_handle_service::win_iocp_handle_service(execution_context& context)
: execution_context_service_base<win_iocp_handle_service>(context),
iocp_service_(asio::use_service<win_iocp_io_context>(context)),
+ nt_set_info_(0),
mutex_(),
impl_list_(0)
{
@@ -182,11 +183,15 @@ asio::error_code win_iocp_handle_service::assign(
if (is_open(impl))
{
ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
if (iocp_service_.register_handle(handle, ec))
+ {
+ ASIO_ERROR_LOCATION(ec);
return ec;
+ }
impl.handle_ = handle;
ec = asio::error_code();
@@ -221,9 +226,47 @@ asio::error_code win_iocp_handle_service::close(
ec = asio::error_code();
}
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
+win_iocp_handle_service::native_handle_type win_iocp_handle_service::release(
+ win_iocp_handle_service::implementation_type& impl,
+ asio::error_code& ec)
+{
+ if (!is_open(impl))
+ return INVALID_HANDLE_VALUE;
+
+ cancel(impl, ec);
+ if (ec)
+ {
+ ASIO_ERROR_LOCATION(ec);
+ return INVALID_HANDLE_VALUE;
+ }
+
+ nt_set_info_fn fn = get_nt_set_info();
+ if (fn == 0)
+ {
+ ec = asio::error::operation_not_supported;
+ ASIO_ERROR_LOCATION(ec);
+ return INVALID_HANDLE_VALUE;
+ }
+
+ ULONG_PTR iosb[2] = { 0, 0 };
+ void* info[2] = { 0, 0 };
+ if (fn(impl.handle_, iosb, &info, sizeof(info),
+ 61 /* FileReplaceCompletionInformation */))
+ {
+ ec = asio::error::operation_not_supported;
+ ASIO_ERROR_LOCATION(ec);
+ return INVALID_HANDLE_VALUE;
+ }
+
+ native_handle_type tmp = impl.handle_;
+ impl.handle_ = INVALID_HANDLE_VALUE;
+ return tmp;
+}
+
asio::error_code win_iocp_handle_service::cancel(
win_iocp_handle_service::implementation_type& impl,
asio::error_code& ec)
@@ -231,6 +274,7 @@ asio::error_code win_iocp_handle_service::cancel(
if (!is_open(impl))
{
ec = asio::error::bad_descriptor;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -292,6 +336,7 @@ asio::error_code win_iocp_handle_service::cancel(
ec = asio::error::operation_not_supported;
}
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -302,6 +347,7 @@ size_t win_iocp_handle_service::do_write(
if (!is_open(impl))
{
ec = asio::error::bad_descriptor;
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -315,6 +361,7 @@ size_t win_iocp_handle_service::do_write(
overlapped_wrapper overlapped(ec);
if (ec)
{
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -330,6 +377,7 @@ size_t win_iocp_handle_service::do_write(
{
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
}
@@ -343,6 +391,7 @@ size_t win_iocp_handle_service::do_write(
DWORD last_error = ::GetLastError();
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -394,6 +443,7 @@ size_t win_iocp_handle_service::do_read(
if (!is_open(impl))
{
ec = asio::error::bad_descriptor;
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -407,6 +457,7 @@ size_t win_iocp_handle_service::do_read(
overlapped_wrapper overlapped(ec);
if (ec)
{
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -429,6 +480,7 @@ size_t win_iocp_handle_service::do_read(
ec = asio::error_code(last_error,
asio::error::get_system_category());
}
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
}
@@ -449,6 +501,7 @@ size_t win_iocp_handle_service::do_read(
ec = asio::error_code(last_error,
asio::error::get_system_category());
}
+ ASIO_ERROR_LOCATION(ec);
return (last_error == ERROR_MORE_DATA) ? bytes_transferred : 0;
}
@@ -515,6 +568,47 @@ void win_iocp_handle_service::close_for_destruction(implementation_type& impl)
}
}
+win_iocp_handle_service::nt_set_info_fn
+win_iocp_handle_service::get_nt_set_info()
+{
+ void* ptr = interlocked_compare_exchange_pointer(&nt_set_info_, 0, 0);
+ if (!ptr)
+ {
+ if (HMODULE h = ::GetModuleHandleA("NTDLL.DLL"))
+ ptr = reinterpret_cast<void*>(GetProcAddress(h, "NtSetInformationFile"));
+
+ // On failure, set nt_set_info_ to a special value to indicate that the
+ // NtSetInformationFile function is unavailable. That way we won't bother
+ // trying to look it up again.
+ interlocked_exchange_pointer(&nt_set_info_, ptr ? ptr : this);
+ }
+
+ return reinterpret_cast<nt_set_info_fn>(ptr == this ? 0 : ptr);
+}
+
+void* win_iocp_handle_service::interlocked_compare_exchange_pointer(
+ void** dest, void* exch, void* cmp)
+{
+#if defined(_M_IX86)
+ return reinterpret_cast<void*>(InterlockedCompareExchange(
+ reinterpret_cast<PLONG>(dest), reinterpret_cast<LONG>(exch),
+ reinterpret_cast<LONG>(cmp)));
+#else
+ return InterlockedCompareExchangePointer(dest, exch, cmp);
+#endif
+}
+
+void* win_iocp_handle_service::interlocked_exchange_pointer(
+ void** dest, void* val)
+{
+#if defined(_M_IX86)
+ return reinterpret_cast<void*>(InterlockedExchange(
+ reinterpret_cast<PLONG>(dest), reinterpret_cast<LONG>(val)));
+#else
+ return InterlockedExchangePointer(dest, val);
+#endif
+}
+
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.hpp b/3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.hpp
index 224e3c2acd0..6479500184a 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.hpp
+++ b/3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.hpp
@@ -2,7 +2,7 @@
// detail/impl/win_iocp_io_context.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,7 +22,6 @@
#include "asio/detail/completion_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/push_options.hpp"
diff --git a/3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.ipp b/3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.ipp
index 37e32507288..1c7fb28b2d6 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_iocp_io_context.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_iocp_io_context.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,7 +22,6 @@
#include "asio/error.hpp"
#include "asio/detail/cstdint.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/limits.hpp"
#include "asio/detail/thread.hpp"
#include "asio/detail/throw_error.hpp"
@@ -51,7 +50,7 @@ struct win_iocp_io_context::thread_function
struct win_iocp_io_context::work_finished_on_block_exit
{
- ~work_finished_on_block_exit()
+ ~work_finished_on_block_exit() noexcept(false)
{
io_context_->work_finished();
}
@@ -168,7 +167,10 @@ void win_iocp_io_context::shutdown()
}
if (timer_thread_.get())
+ {
timer_thread_->join();
+ timer_thread_.reset();
+ }
}
asio::error_code win_iocp_io_context::register_handle(
@@ -527,6 +529,7 @@ size_t win_iocp_io_context::do_one(DWORD msec,
DWORD win_iocp_io_context::get_gqcs_timeout()
{
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0600)
OSVERSIONINFOEX osvi;
ZeroMemory(&osvi, sizeof(osvi));
osvi.dwOSVersionInfoSize = sizeof(osvi);
@@ -539,6 +542,9 @@ DWORD win_iocp_io_context::get_gqcs_timeout()
return INFINITE;
return default_gqcs_timeout;
+#else // !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0600)
+ return INFINITE;
+#endif // !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0600)
}
void win_iocp_io_context::do_add_timer_queue(timer_queue_base& queue)
diff --git a/3rdparty/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp b/3rdparty/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp
index 8b47920e654..abeb3cecb0a 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_iocp_serial_port_service.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -46,6 +46,7 @@ asio::error_code win_iocp_serial_port_service::open(
if (is_open(impl))
{
ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -61,6 +62,7 @@ asio::error_code win_iocp_serial_port_service::open(
DWORD last_error = ::GetLastError();
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -75,6 +77,7 @@ asio::error_code win_iocp_serial_port_service::open(
::CloseHandle(handle);
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -101,6 +104,7 @@ asio::error_code win_iocp_serial_port_service::open(
::CloseHandle(handle);
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -119,6 +123,7 @@ asio::error_code win_iocp_serial_port_service::open(
::CloseHandle(handle);
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -143,6 +148,7 @@ asio::error_code win_iocp_serial_port_service::do_set_option(
DWORD last_error = ::GetLastError();
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -154,6 +160,7 @@ asio::error_code win_iocp_serial_port_service::do_set_option(
DWORD last_error = ::GetLastError();
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -176,6 +183,7 @@ asio::error_code win_iocp_serial_port_service::do_get_option(
DWORD last_error = ::GetLastError();
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
diff --git a/3rdparty/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp b/3rdparty/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp
index 6adcf7e558b..af28718c905 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_iocp_socket_service_base.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -72,7 +72,7 @@ void win_iocp_socket_service_base::construct(
void win_iocp_socket_service_base::base_move_construct(
win_iocp_socket_service_base::base_implementation_type& impl,
win_iocp_socket_service_base::base_implementation_type& other_impl)
- ASIO_NOEXCEPT
+ noexcept
{
impl.socket_ = other_impl.socket_;
other_impl.socket_ = invalid_socket;
@@ -410,9 +410,8 @@ void win_iocp_socket_service_base::start_send_op(
void win_iocp_socket_service_base::start_send_to_op(
win_iocp_socket_service_base::base_implementation_type& impl,
- WSABUF* buffers, std::size_t buffer_count,
- const socket_addr_type* addr, int addrlen,
- socket_base::message_flags flags, operation* op)
+ WSABUF* buffers, std::size_t buffer_count, const void* addr,
+ int addrlen, socket_base::message_flags flags, operation* op)
{
update_cancellation_thread_id(impl);
iocp_service_.work_started();
@@ -423,8 +422,8 @@ void win_iocp_socket_service_base::start_send_to_op(
{
DWORD bytes_transferred = 0;
int result = ::WSASendTo(impl.socket_, buffers,
- static_cast<DWORD>(buffer_count),
- &bytes_transferred, flags, addr, addrlen, op, 0);
+ static_cast<DWORD>(buffer_count), &bytes_transferred, flags,
+ static_cast<const socket_addr_type*>(addr), addrlen, op, 0);
DWORD last_error = ::WSAGetLastError();
if (last_error == ERROR_PORT_UNREACHABLE)
last_error = WSAECONNREFUSED;
@@ -489,7 +488,7 @@ int win_iocp_socket_service_base::start_null_buffers_receive_op(
void win_iocp_socket_service_base::start_receive_from_op(
win_iocp_socket_service_base::base_implementation_type& impl,
- WSABUF* buffers, std::size_t buffer_count, socket_addr_type* addr,
+ WSABUF* buffers, std::size_t buffer_count, void* addr,
socket_base::message_flags flags, int* addrlen, operation* op)
{
update_cancellation_thread_id(impl);
@@ -502,8 +501,8 @@ void win_iocp_socket_service_base::start_receive_from_op(
DWORD bytes_transferred = 0;
DWORD recv_flags = flags;
int result = ::WSARecvFrom(impl.socket_, buffers,
- static_cast<DWORD>(buffer_count),
- &bytes_transferred, &recv_flags, addr, addrlen, op, 0);
+ static_cast<DWORD>(buffer_count), &bytes_transferred, &recv_flags,
+ static_cast<socket_addr_type*>(addr), addrlen, op, 0);
DWORD last_error = ::WSAGetLastError();
if (last_error == ERROR_PORT_UNREACHABLE)
last_error = WSAECONNREFUSED;
@@ -608,7 +607,7 @@ void win_iocp_socket_service_base::start_reactor_op(
int win_iocp_socket_service_base::start_connect_op(
win_iocp_socket_service_base::base_implementation_type& impl,
- int family, int type, const socket_addr_type* addr, std::size_t addrlen,
+ int family, int type, const void* addr, std::size_t addrlen,
win_iocp_socket_connect_op_base* op, operation* iocp_op)
{
// If ConnectEx is available, use that.
@@ -642,7 +641,8 @@ int win_iocp_socket_service_base::start_connect_op(
iocp_service_.work_started();
BOOL result = connect_ex(impl.socket_,
- addr, static_cast<int>(addrlen), 0, 0, 0, iocp_op);
+ static_cast<const socket_addr_type*>(addr),
+ static_cast<int>(addrlen), 0, 0, 0, iocp_op);
DWORD last_error = ::WSAGetLastError();
if (!result && last_error != WSA_IO_PENDING)
iocp_service_.on_completion(iocp_op, last_error);
diff --git a/3rdparty/asio/include/asio/detail/impl/win_mutex.ipp b/3rdparty/asio/include/asio/detail/impl/win_mutex.ipp
index 8a2db6f38c1..6340b6e1256 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_mutex.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_mutex.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_mutex.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/win_object_handle_service.ipp b/3rdparty/asio/include/asio/detail/impl/win_object_handle_service.ipp
index 0c44a41236b..d7db3e3f3a1 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_object_handle_service.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_object_handle_service.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_object_handle_service.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2011 Boris Schaeling (boris@highscore.de)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -213,6 +213,7 @@ asio::error_code win_object_handle_service::assign(
if (is_open(impl))
{
ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -270,6 +271,7 @@ asio::error_code win_object_handle_service::close(
ec = asio::error_code();
}
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -312,6 +314,7 @@ asio::error_code win_object_handle_service::cancel(
ec = asio::error::bad_descriptor;
}
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -326,6 +329,7 @@ void win_object_handle_service::wait(
DWORD last_error = ::GetLastError();
ec = asio::error_code(last_error,
asio::error::get_system_category());
+ ASIO_ERROR_LOCATION(ec);
break;
}
case WAIT_OBJECT_0:
diff --git a/3rdparty/asio/include/asio/detail/impl/win_static_mutex.ipp b/3rdparty/asio/include/asio/detail/impl/win_static_mutex.ipp
index 070eb5951b5..5b459843338 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_static_mutex.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_static_mutex.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_static_mutex.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/win_thread.ipp b/3rdparty/asio/include/asio/detail/impl/win_thread.ipp
index 142ba67fc56..0ebc5db86b4 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_thread.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_thread.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_thread.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/win_tss_ptr.ipp b/3rdparty/asio/include/asio/detail/impl/win_tss_ptr.ipp
index c6ece2e20bf..5bc9de2c308 100644
--- a/3rdparty/asio/include/asio/detail/impl/win_tss_ptr.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/win_tss_ptr.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_tss_ptr.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp b/3rdparty/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp
index 92a29f06460..90a03542a9c 100644
--- a/3rdparty/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp
@@ -2,7 +2,7 @@
// detail/impl/winrt_ssocket_service_base.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -66,7 +66,7 @@ void winrt_ssocket_service_base::construct(
void winrt_ssocket_service_base::base_move_construct(
winrt_ssocket_service_base::base_implementation_type& impl,
winrt_ssocket_service_base::base_implementation_type& other_impl)
- ASIO_NOEXCEPT
+ noexcept
{
impl.socket_ = other_impl.socket_;
other_impl.socket_ = nullptr;
@@ -182,7 +182,7 @@ std::size_t winrt_ssocket_service_base::do_get_endpoint(
: impl.socket_->Information->RemotePort);
unsigned long scope = 0;
- switch (reinterpret_cast<const socket_addr_type*>(addr)->sa_family)
+ switch (static_cast<const socket_addr_type*>(addr)->sa_family)
{
case ASIO_OS_DEF(AF_INET):
if (addr_len < sizeof(sockaddr_in4_type))
@@ -351,7 +351,7 @@ asio::error_code winrt_ssocket_service_base::do_connect(
char addr_string[max_addr_v6_str_len];
unsigned short port;
- switch (reinterpret_cast<const socket_addr_type*>(addr)->sa_family)
+ switch (static_cast<const socket_addr_type*>(addr)->sa_family)
{
case ASIO_OS_DEF(AF_INET):
socket_ops::inet_ntop(ASIO_OS_DEF(AF_INET),
@@ -401,7 +401,7 @@ void winrt_ssocket_service_base::start_connect_op(
char addr_string[max_addr_v6_str_len];
unsigned short port = 0;
- switch (reinterpret_cast<const socket_addr_type*>(addr)->sa_family)
+ switch (static_cast<const socket_addr_type*>(addr)->sa_family)
{
case ASIO_OS_DEF(AF_INET):
socket_ops::inet_ntop(ASIO_OS_DEF(AF_INET),
diff --git a/3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp b/3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp
index 7c7da52bb15..9c967508e4f 100644
--- a/3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp
+++ b/3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp
@@ -2,7 +2,7 @@
// detail/impl/winrt_timer_scheduler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp b/3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp
index d3d6103a644..028b5f9f3cb 100644
--- a/3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp
@@ -2,7 +2,7 @@
// detail/impl/winrt_timer_scheduler.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/impl/winsock_init.ipp b/3rdparty/asio/include/asio/detail/impl/winsock_init.ipp
index f2e8cb51a3f..5b5f56037ea 100644
--- a/3rdparty/asio/include/asio/detail/impl/winsock_init.ipp
+++ b/3rdparty/asio/include/asio/detail/impl/winsock_init.ipp
@@ -2,7 +2,7 @@
// detail/impl/winsock_init.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/initiate_defer.hpp b/3rdparty/asio/include/asio/detail/initiate_defer.hpp
new file mode 100644
index 00000000000..92abb0aa2f0
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/initiate_defer.hpp
@@ -0,0 +1,207 @@
+//
+// detail/initiate_defer.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_INITIATE_DEFER_HPP
+#define ASIO_DETAIL_INITIATE_DEFER_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associated_allocator.hpp"
+#include "asio/associated_executor.hpp"
+#include "asio/detail/work_dispatcher.hpp"
+#include "asio/execution/allocator.hpp"
+#include "asio/execution/blocking.hpp"
+#include "asio/execution/relationship.hpp"
+#include "asio/prefer.hpp"
+#include "asio/require.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class initiate_defer
+{
+public:
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ execution::is_executor<
+ associated_executor_t<decay_t<CompletionHandler>>
+ >::value
+ >* = 0) const
+ {
+ associated_executor_t<decay_t<CompletionHandler>> ex(
+ (get_associated_executor)(handler));
+
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ asio::prefer(
+ asio::require(ex, execution::blocking.never),
+ execution::relationship.continuation,
+ execution::allocator(alloc)
+ ).execute(
+ asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)));
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ !execution::is_executor<
+ associated_executor_t<decay_t<CompletionHandler>>
+ >::value
+ >* = 0) const
+ {
+ associated_executor_t<decay_t<CompletionHandler>> ex(
+ (get_associated_executor)(handler));
+
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ ex.defer(asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)), alloc);
+ }
+};
+
+template <typename Executor>
+class initiate_defer_with_executor
+{
+public:
+ typedef Executor executor_type;
+
+ explicit initiate_defer_with_executor(const Executor& ex)
+ : ex_(ex)
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return ex_;
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ !detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ asio::prefer(
+ asio::require(ex_, execution::blocking.never),
+ execution::relationship.continuation,
+ execution::allocator(alloc)
+ ).execute(
+ asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)));
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ typedef decay_t<CompletionHandler> handler_t;
+
+ typedef associated_executor_t<handler_t, Executor> handler_ex_t;
+ handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
+
+ associated_allocator_t<handler_t> alloc(
+ (get_associated_allocator)(handler));
+
+ asio::prefer(
+ asio::require(ex_, execution::blocking.never),
+ execution::relationship.continuation,
+ execution::allocator(alloc)
+ ).execute(
+ detail::work_dispatcher<handler_t, handler_ex_t>(
+ static_cast<CompletionHandler&&>(handler), handler_ex));
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ !execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ !detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ ex_.defer(asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)), alloc);
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ !execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ typedef decay_t<CompletionHandler> handler_t;
+
+ typedef associated_executor_t<handler_t, Executor> handler_ex_t;
+ handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
+
+ associated_allocator_t<handler_t> alloc(
+ (get_associated_allocator)(handler));
+
+ ex_.defer(detail::work_dispatcher<handler_t, handler_ex_t>(
+ static_cast<CompletionHandler&&>(handler), handler_ex), alloc);
+ }
+
+private:
+ Executor ex_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_DETAIL_INITIATE_DEFER_HPP
diff --git a/3rdparty/asio/include/asio/detail/initiate_dispatch.hpp b/3rdparty/asio/include/asio/detail/initiate_dispatch.hpp
new file mode 100644
index 00000000000..ba2f68f0579
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/initiate_dispatch.hpp
@@ -0,0 +1,193 @@
+//
+// detail/initiate_dispatch.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_INITIATE_DISPATCH_HPP
+#define ASIO_DETAIL_INITIATE_DISPATCH_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associated_allocator.hpp"
+#include "asio/associated_executor.hpp"
+#include "asio/detail/work_dispatcher.hpp"
+#include "asio/execution/allocator.hpp"
+#include "asio/execution/blocking.hpp"
+#include "asio/prefer.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class initiate_dispatch
+{
+public:
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ execution::is_executor<
+ associated_executor_t<decay_t<CompletionHandler>>
+ >::value
+ >* = 0) const
+ {
+ associated_executor_t<decay_t<CompletionHandler>> ex(
+ (get_associated_executor)(handler));
+
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ asio::prefer(ex, execution::allocator(alloc)).execute(
+ asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)));
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ !execution::is_executor<
+ associated_executor_t<decay_t<CompletionHandler>>
+ >::value
+ >* = 0) const
+ {
+ associated_executor_t<decay_t<CompletionHandler>> ex(
+ (get_associated_executor)(handler));
+
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ ex.dispatch(asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)), alloc);
+ }
+};
+
+template <typename Executor>
+class initiate_dispatch_with_executor
+{
+public:
+ typedef Executor executor_type;
+
+ explicit initiate_dispatch_with_executor(const Executor& ex)
+ : ex_(ex)
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return ex_;
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ !detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ asio::prefer(ex_, execution::allocator(alloc)).execute(
+ asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)));
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ typedef decay_t<CompletionHandler> handler_t;
+
+ typedef associated_executor_t<handler_t, Executor> handler_ex_t;
+ handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
+
+ associated_allocator_t<handler_t> alloc(
+ (get_associated_allocator)(handler));
+
+ asio::prefer(ex_, execution::allocator(alloc)).execute(
+ detail::work_dispatcher<handler_t, handler_ex_t>(
+ static_cast<CompletionHandler&&>(handler), handler_ex));
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ !execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ !detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ ex_.dispatch(asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)), alloc);
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ !execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ typedef decay_t<CompletionHandler> handler_t;
+
+ typedef associated_executor_t<handler_t, Executor> handler_ex_t;
+ handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
+
+ associated_allocator_t<handler_t> alloc(
+ (get_associated_allocator)(handler));
+
+ ex_.dispatch(detail::work_dispatcher<handler_t, handler_ex_t>(
+ static_cast<CompletionHandler&&>(handler), handler_ex), alloc);
+ }
+
+private:
+ Executor ex_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_DETAIL_INITIATE_DISPATCH_HPP
diff --git a/3rdparty/asio/include/asio/detail/initiate_post.hpp b/3rdparty/asio/include/asio/detail/initiate_post.hpp
new file mode 100644
index 00000000000..f73c8ee0b81
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/initiate_post.hpp
@@ -0,0 +1,207 @@
+//
+// detail/initiate_post.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_INITIATE_POST_HPP
+#define ASIO_DETAIL_INITIATE_POST_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associated_allocator.hpp"
+#include "asio/associated_executor.hpp"
+#include "asio/detail/work_dispatcher.hpp"
+#include "asio/execution/allocator.hpp"
+#include "asio/execution/blocking.hpp"
+#include "asio/execution/relationship.hpp"
+#include "asio/prefer.hpp"
+#include "asio/require.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class initiate_post
+{
+public:
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ execution::is_executor<
+ associated_executor_t<decay_t<CompletionHandler>>
+ >::value
+ >* = 0) const
+ {
+ associated_executor_t<decay_t<CompletionHandler>> ex(
+ (get_associated_executor)(handler));
+
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ asio::prefer(
+ asio::require(ex, execution::blocking.never),
+ execution::relationship.fork,
+ execution::allocator(alloc)
+ ).execute(
+ asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)));
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ !execution::is_executor<
+ associated_executor_t<decay_t<CompletionHandler>>
+ >::value
+ >* = 0) const
+ {
+ associated_executor_t<decay_t<CompletionHandler>> ex(
+ (get_associated_executor)(handler));
+
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ ex.post(asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)), alloc);
+ }
+};
+
+template <typename Executor>
+class initiate_post_with_executor
+{
+public:
+ typedef Executor executor_type;
+
+ explicit initiate_post_with_executor(const Executor& ex)
+ : ex_(ex)
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return ex_;
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ !detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ asio::prefer(
+ asio::require(ex_, execution::blocking.never),
+ execution::relationship.fork,
+ execution::allocator(alloc)
+ ).execute(
+ asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)));
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ typedef decay_t<CompletionHandler> handler_t;
+
+ typedef associated_executor_t<handler_t, Executor> handler_ex_t;
+ handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
+
+ associated_allocator_t<handler_t> alloc(
+ (get_associated_allocator)(handler));
+
+ asio::prefer(
+ asio::require(ex_, execution::blocking.never),
+ execution::relationship.fork,
+ execution::allocator(alloc)
+ ).execute(
+ detail::work_dispatcher<handler_t, handler_ex_t>(
+ static_cast<CompletionHandler&&>(handler), handler_ex));
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ !execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ !detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ associated_allocator_t<decay_t<CompletionHandler>> alloc(
+ (get_associated_allocator)(handler));
+
+ ex_.post(asio::detail::bind_handler(
+ static_cast<CompletionHandler&&>(handler)), alloc);
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler,
+ enable_if_t<
+ !execution::is_executor<
+ conditional_t<true, executor_type, CompletionHandler>
+ >::value
+ >* = 0,
+ enable_if_t<
+ detail::is_work_dispatcher_required<
+ decay_t<CompletionHandler>,
+ Executor
+ >::value
+ >* = 0) const
+ {
+ typedef decay_t<CompletionHandler> handler_t;
+
+ typedef associated_executor_t<handler_t, Executor> handler_ex_t;
+ handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
+
+ associated_allocator_t<handler_t> alloc(
+ (get_associated_allocator)(handler));
+
+ ex_.post(detail::work_dispatcher<handler_t, handler_ex_t>(
+ static_cast<CompletionHandler&&>(handler), handler_ex), alloc);
+ }
+
+private:
+ Executor ex_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_DETAIL_INITIATE_POST_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_control.hpp b/3rdparty/asio/include/asio/detail/io_control.hpp
index 2b6d593891f..14daf85730a 100644
--- a/3rdparty/asio/include/asio/detail/io_control.hpp
+++ b/3rdparty/asio/include/asio/detail/io_control.hpp
@@ -2,7 +2,7 @@
// detail/io_control.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/io_object_impl.hpp b/3rdparty/asio/include/asio/detail/io_object_impl.hpp
index 9efd0d62047..bd7312b8491 100644
--- a/3rdparty/asio/include/asio/detail/io_object_impl.hpp
+++ b/3rdparty/asio/include/asio/detail/io_object_impl.hpp
@@ -1,8 +1,8 @@
//
-// io_object_impl.hpp
-// ~~~~~~~~~~~~~~~~~~
+// detail/io_object_impl.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -60,7 +60,6 @@ public:
service_->construct(implementation_);
}
-#if defined(ASIO_HAS_MOVE)
// Move-construct an I/O object.
io_object_impl(io_object_impl&& other)
: service_(&other.get_service()),
@@ -69,7 +68,16 @@ public:
service_->move_construct(implementation_, other.implementation_);
}
- // Perform a converting move-construction of an I/O object.
+ // Perform converting move-construction of an I/O object on the same service.
+ template <typename Executor1>
+ io_object_impl(io_object_impl<IoObjectService, Executor1>&& other)
+ : service_(&other.get_service()),
+ executor_(other.get_executor())
+ {
+ service_->move_construct(implementation_, other.get_implementation());
+ }
+
+ // Perform converting move-construction of an I/O object on another service.
template <typename IoObjectService1, typename Executor1>
io_object_impl(io_object_impl<IoObjectService1, Executor1>&& other)
: service_(&asio::use_service<IoObjectService>(
@@ -79,7 +87,6 @@ public:
service_->converting_move_construct(implementation_,
other.get_service(), other.get_implementation());
}
-#endif // defined(ASIO_HAS_MOVE)
// Destructor.
~io_object_impl()
@@ -87,7 +94,6 @@ public:
service_->destroy(implementation_);
}
-#if defined(ASIO_HAS_MOVE)
// Move-assign an I/O object.
io_object_impl& operator=(io_object_impl&& other)
{
@@ -101,10 +107,9 @@ public:
}
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
// Get the executor associated with the object.
- const executor_type& get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return executor_;
}
@@ -137,7 +142,7 @@ private:
// Helper function to get an executor's context.
template <typename T>
static execution_context& get_context(const T& t,
- typename enable_if<execution::is_executor<T>::value>::type* = 0)
+ enable_if_t<execution::is_executor<T>::value>* = 0)
{
return asio::query(t, execution::context);
}
@@ -145,7 +150,7 @@ private:
// Helper function to get an executor's context.
template <typename T>
static execution_context& get_context(const T& t,
- typename enable_if<!execution::is_executor<T>::value>::type* = 0)
+ enable_if_t<!execution::is_executor<T>::value>* = 0)
{
return t.context();
}
diff --git a/3rdparty/asio/include/asio/detail/io_uring_descriptor_read_at_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_descriptor_read_at_op.hpp
new file mode 100644
index 00000000000..114bdb54297
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_descriptor_read_at_op.hpp
@@ -0,0 +1,195 @@
+//
+// detail/io_uring_descriptor_read_at_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_DESCRIPTOR_READ_AT_OP_HPP
+#define ASIO_DETAIL_IO_URING_DESCRIPTOR_READ_AT_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/cstdint.hpp"
+#include "asio/detail/descriptor_ops.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename MutableBufferSequence>
+class io_uring_descriptor_read_at_op_base : public io_uring_operation
+{
+public:
+ io_uring_descriptor_read_at_op_base(
+ const asio::error_code& success_ec, int descriptor,
+ descriptor_ops::state_type state, uint64_t offset,
+ const MutableBufferSequence& buffers, func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_descriptor_read_at_op_base::do_prepare,
+ &io_uring_descriptor_read_at_op_base::do_perform, complete_func),
+ descriptor_(descriptor),
+ state_(state),
+ offset_(offset),
+ buffers_(buffers),
+ bufs_(buffers)
+ {
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_read_at_op_base* o(
+ static_cast<io_uring_descriptor_read_at_op_base*>(base));
+
+ if ((o->state_ & descriptor_ops::internal_non_blocking) != 0)
+ {
+ ::io_uring_prep_poll_add(sqe, o->descriptor_, POLLIN);
+ }
+ else if (o->bufs_.is_single_buffer && o->bufs_.is_registered_buffer)
+ {
+ ::io_uring_prep_read_fixed(sqe, o->descriptor_,
+ o->bufs_.buffers()->iov_base, o->bufs_.buffers()->iov_len,
+ o->offset_, o->bufs_.registered_id().native_handle());
+ }
+ else
+ {
+ ::io_uring_prep_readv(sqe, o->descriptor_,
+ o->bufs_.buffers(), o->bufs_.count(), o->offset_);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_read_at_op_base* o(
+ static_cast<io_uring_descriptor_read_at_op_base*>(base));
+
+ if ((o->state_ & descriptor_ops::internal_non_blocking) != 0)
+ {
+ if (o->bufs_.is_single_buffer)
+ {
+ return descriptor_ops::non_blocking_read_at1(o->descriptor_,
+ o->offset_, o->bufs_.first(o->buffers_).data(),
+ o->bufs_.first(o->buffers_).size(), o->ec_,
+ o->bytes_transferred_);
+ }
+ else
+ {
+ return descriptor_ops::non_blocking_read_at(o->descriptor_,
+ o->offset_, o->bufs_.buffers(), o->bufs_.count(),
+ o->ec_, o->bytes_transferred_);
+ }
+ }
+ else if (after_completion)
+ {
+ if (!o->ec_ && o->bytes_transferred_ == 0)
+ o->ec_ = asio::error::eof;
+ }
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= descriptor_ops::internal_non_blocking;
+ return false;
+ }
+
+ return after_completion;
+ }
+
+private:
+ int descriptor_;
+ descriptor_ops::state_type state_;
+ uint64_t offset_;
+ MutableBufferSequence buffers_;
+ buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs_;
+};
+
+template <typename MutableBufferSequence, typename Handler, typename IoExecutor>
+class io_uring_descriptor_read_at_op
+ : public io_uring_descriptor_read_at_op_base<MutableBufferSequence>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_descriptor_read_at_op);
+
+ io_uring_descriptor_read_at_op(const asio::error_code& success_ec,
+ int descriptor, descriptor_ops::state_type state, uint64_t offset,
+ const MutableBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ : io_uring_descriptor_read_at_op_base<MutableBufferSequence>(
+ success_ec, descriptor, state, offset, buffers,
+ &io_uring_descriptor_read_at_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_read_at_op* o
+ (static_cast<io_uring_descriptor_read_at_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_DESCRIPTOR_READ_AT_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_descriptor_read_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_descriptor_read_op.hpp
new file mode 100644
index 00000000000..9f8cf70bca3
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_descriptor_read_op.hpp
@@ -0,0 +1,190 @@
+//
+// detail/io_uring_descriptor_read_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_DESCRIPTOR_READ_OP_HPP
+#define ASIO_DETAIL_IO_URING_DESCRIPTOR_READ_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/descriptor_ops.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename MutableBufferSequence>
+class io_uring_descriptor_read_op_base : public io_uring_operation
+{
+public:
+ io_uring_descriptor_read_op_base(const asio::error_code& success_ec,
+ int descriptor, descriptor_ops::state_type state,
+ const MutableBufferSequence& buffers, func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_descriptor_read_op_base::do_prepare,
+ &io_uring_descriptor_read_op_base::do_perform, complete_func),
+ descriptor_(descriptor),
+ state_(state),
+ buffers_(buffers),
+ bufs_(buffers)
+ {
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_read_op_base* o(
+ static_cast<io_uring_descriptor_read_op_base*>(base));
+
+ if ((o->state_ & descriptor_ops::internal_non_blocking) != 0)
+ {
+ ::io_uring_prep_poll_add(sqe, o->descriptor_, POLLIN);
+ }
+ else if (o->bufs_.is_single_buffer && o->bufs_.is_registered_buffer)
+ {
+ ::io_uring_prep_read_fixed(sqe, o->descriptor_,
+ o->bufs_.buffers()->iov_base, o->bufs_.buffers()->iov_len,
+ 0, o->bufs_.registered_id().native_handle());
+ }
+ else
+ {
+ ::io_uring_prep_readv(sqe, o->descriptor_,
+ o->bufs_.buffers(), o->bufs_.count(), -1);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_read_op_base* o(
+ static_cast<io_uring_descriptor_read_op_base*>(base));
+
+ if ((o->state_ & descriptor_ops::internal_non_blocking) != 0)
+ {
+ if (o->bufs_.is_single_buffer)
+ {
+ return descriptor_ops::non_blocking_read1(
+ o->descriptor_, o->bufs_.first(o->buffers_).data(),
+ o->bufs_.first(o->buffers_).size(), o->ec_,
+ o->bytes_transferred_);
+ }
+ else
+ {
+ return descriptor_ops::non_blocking_read(
+ o->descriptor_, o->bufs_.buffers(), o->bufs_.count(),
+ o->ec_, o->bytes_transferred_);
+ }
+ }
+ else if (after_completion)
+ {
+ if (!o->ec_ && o->bytes_transferred_ == 0)
+ o->ec_ = asio::error::eof;
+ }
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= descriptor_ops::internal_non_blocking;
+ return false;
+ }
+
+ return after_completion;
+ }
+
+private:
+ int descriptor_;
+ descriptor_ops::state_type state_;
+ MutableBufferSequence buffers_;
+ buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs_;
+};
+
+template <typename MutableBufferSequence, typename Handler, typename IoExecutor>
+class io_uring_descriptor_read_op
+ : public io_uring_descriptor_read_op_base<MutableBufferSequence>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_descriptor_read_op);
+
+ io_uring_descriptor_read_op(const asio::error_code& success_ec,
+ int descriptor, descriptor_ops::state_type state,
+ const MutableBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ : io_uring_descriptor_read_op_base<MutableBufferSequence>(success_ec,
+ descriptor, state, buffers, &io_uring_descriptor_read_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_read_op* o
+ (static_cast<io_uring_descriptor_read_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_DESCRIPTOR_READ_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_descriptor_service.hpp b/3rdparty/asio/include/asio/detail/io_uring_descriptor_service.hpp
new file mode 100644
index 00000000000..04d1e36edd8
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_descriptor_service.hpp
@@ -0,0 +1,687 @@
+//
+// detail/io_uring_descriptor_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_DESCRIPTOR_SERVICE_HPP
+#define ASIO_DETAIL_IO_URING_DESCRIPTOR_SERVICE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/associated_cancellation_slot.hpp"
+#include "asio/buffer.hpp"
+#include "asio/cancellation_type.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/descriptor_ops.hpp"
+#include "asio/detail/io_uring_descriptor_read_at_op.hpp"
+#include "asio/detail/io_uring_descriptor_read_op.hpp"
+#include "asio/detail/io_uring_descriptor_write_at_op.hpp"
+#include "asio/detail/io_uring_descriptor_write_op.hpp"
+#include "asio/detail/io_uring_null_buffers_op.hpp"
+#include "asio/detail/io_uring_service.hpp"
+#include "asio/detail/io_uring_wait_op.hpp"
+#include "asio/detail/memory.hpp"
+#include "asio/detail/noncopyable.hpp"
+#include "asio/posix/descriptor_base.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class io_uring_descriptor_service :
+ public execution_context_service_base<io_uring_descriptor_service>
+{
+public:
+ // The native type of a descriptor.
+ typedef int native_handle_type;
+
+ // The implementation type of the descriptor.
+ class implementation_type
+ : private asio::detail::noncopyable
+ {
+ public:
+ // Default constructor.
+ implementation_type()
+ : descriptor_(-1),
+ state_(0)
+ {
+ }
+
+ private:
+ // Only this service will have access to the internal values.
+ friend class io_uring_descriptor_service;
+
+ // The native descriptor representation.
+ int descriptor_;
+
+ // The current state of the descriptor.
+ descriptor_ops::state_type state_;
+
+ // Per I/O object data used by the io_uring_service.
+ io_uring_service::per_io_object_data io_object_data_;
+ };
+
+ // Constructor.
+ ASIO_DECL io_uring_descriptor_service(execution_context& context);
+
+ // Destroy all user-defined handler objects owned by the service.
+ ASIO_DECL void shutdown();
+
+ // Construct a new descriptor implementation.
+ ASIO_DECL void construct(implementation_type& impl);
+
+ // Move-construct a new descriptor implementation.
+ ASIO_DECL void move_construct(implementation_type& impl,
+ implementation_type& other_impl) noexcept;
+
+ // Move-assign from another descriptor implementation.
+ ASIO_DECL void move_assign(implementation_type& impl,
+ io_uring_descriptor_service& other_service,
+ implementation_type& other_impl);
+
+ // Destroy a descriptor implementation.
+ ASIO_DECL void destroy(implementation_type& impl);
+
+ // Assign a native descriptor to a descriptor implementation.
+ ASIO_DECL asio::error_code assign(implementation_type& impl,
+ const native_handle_type& native_descriptor,
+ asio::error_code& ec);
+
+ // Determine whether the descriptor is open.
+ bool is_open(const implementation_type& impl) const
+ {
+ return impl.descriptor_ != -1;
+ }
+
+ // Destroy a descriptor implementation.
+ ASIO_DECL asio::error_code close(implementation_type& impl,
+ asio::error_code& ec);
+
+ // Get the native descriptor representation.
+ native_handle_type native_handle(const implementation_type& impl) const
+ {
+ return impl.descriptor_;
+ }
+
+ // Release ownership of the native descriptor representation.
+ ASIO_DECL native_handle_type release(implementation_type& impl);
+
+ // Release ownership of the native descriptor representation.
+ native_handle_type release(implementation_type& impl,
+ asio::error_code& ec)
+ {
+ ec = success_ec_;
+ return release(impl);
+ }
+
+ // Cancel all operations associated with the descriptor.
+ ASIO_DECL asio::error_code cancel(implementation_type& impl,
+ asio::error_code& ec);
+
+ // Perform an IO control command on the descriptor.
+ template <typename IO_Control_Command>
+ asio::error_code io_control(implementation_type& impl,
+ IO_Control_Command& command, asio::error_code& ec)
+ {
+ descriptor_ops::ioctl(impl.descriptor_, impl.state_,
+ command.name(), static_cast<ioctl_arg_type*>(command.data()), ec);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Gets the non-blocking mode of the descriptor.
+ bool non_blocking(const implementation_type& impl) const
+ {
+ return (impl.state_ & descriptor_ops::user_set_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the descriptor.
+ asio::error_code non_blocking(implementation_type& impl,
+ bool mode, asio::error_code& ec)
+ {
+ descriptor_ops::set_user_non_blocking(
+ impl.descriptor_, impl.state_, mode, ec);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Gets the non-blocking mode of the native descriptor implementation.
+ bool native_non_blocking(const implementation_type& impl) const
+ {
+ return (impl.state_ & descriptor_ops::internal_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the native descriptor implementation.
+ asio::error_code native_non_blocking(implementation_type& impl,
+ bool mode, asio::error_code& ec)
+ {
+ descriptor_ops::set_internal_non_blocking(
+ impl.descriptor_, impl.state_, mode, ec);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Wait for the descriptor to become ready to read, ready to write, or to have
+ // pending error conditions.
+ asio::error_code wait(implementation_type& impl,
+ posix::descriptor_base::wait_type w, asio::error_code& ec)
+ {
+ switch (w)
+ {
+ case posix::descriptor_base::wait_read:
+ descriptor_ops::poll_read(impl.descriptor_, impl.state_, ec);
+ break;
+ case posix::descriptor_base::wait_write:
+ descriptor_ops::poll_write(impl.descriptor_, impl.state_, ec);
+ break;
+ case posix::descriptor_base::wait_error:
+ descriptor_ops::poll_error(impl.descriptor_, impl.state_, ec);
+ break;
+ default:
+ ec = asio::error::invalid_argument;
+ break;
+ }
+
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Asynchronously wait for the descriptor to become ready to read, ready to
+ // write, or to have pending error conditions.
+ template <typename Handler, typename IoExecutor>
+ void async_wait(implementation_type& impl,
+ posix::descriptor_base::wait_type w,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ int op_type;
+ int poll_flags;
+ switch (w)
+ {
+ case posix::descriptor_base::wait_read:
+ op_type = io_uring_service::read_op;
+ poll_flags = POLLIN;
+ break;
+ case posix::descriptor_base::wait_write:
+ op_type = io_uring_service::write_op;
+ poll_flags = POLLOUT;
+ break;
+ case posix::descriptor_base::wait_error:
+ op_type = io_uring_service::except_op;
+ poll_flags = POLLPRI | POLLERR | POLLHUP;
+ break;
+ default:
+ op_type = -1;
+ poll_flags = -1;
+ return;
+ }
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_wait_op<Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.descriptor_,
+ poll_flags, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected() && op_type != -1)
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(
+ &io_uring_service_, &impl.io_object_data_, op_type);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "descriptor", &impl, impl.descriptor_, "async_wait"));
+
+ start_op(impl, op_type, p.p, is_continuation, op_type == -1);
+ p.v = p.p = 0;
+ }
+
+ // Write some data to the descriptor.
+ template <typename ConstBufferSequence>
+ size_t write_some(implementation_type& impl,
+ const ConstBufferSequence& buffers, asio::error_code& ec)
+ {
+ typedef buffer_sequence_adapter<asio::const_buffer,
+ ConstBufferSequence> bufs_type;
+
+ size_t n;
+ if (bufs_type::is_single_buffer)
+ {
+ n = descriptor_ops::sync_write1(impl.descriptor_,
+ impl.state_, bufs_type::first(buffers).data(),
+ bufs_type::first(buffers).size(), ec);
+ }
+ else
+ {
+ bufs_type bufs(buffers);
+
+ n = descriptor_ops::sync_write(impl.descriptor_, impl.state_,
+ bufs.buffers(), bufs.count(), bufs.all_empty(), ec);
+ }
+
+ ASIO_ERROR_LOCATION(ec);
+ return n;
+ }
+
+ // Wait until data can be written without blocking.
+ size_t write_some(implementation_type& impl,
+ const null_buffers&, asio::error_code& ec)
+ {
+ // Wait for descriptor to become ready.
+ descriptor_ops::poll_write(impl.descriptor_, impl.state_, ec);
+
+ ASIO_ERROR_LOCATION(ec);
+ return 0;
+ }
+
+ // Start an asynchronous write. The data being sent must be valid for the
+ // lifetime of the asynchronous operation.
+ template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+ void async_write_some(implementation_type& impl,
+ const ConstBufferSequence& buffers, Handler& handler,
+ const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_descriptor_write_op<
+ ConstBufferSequence, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.descriptor_,
+ impl.state_, buffers, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::write_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "descriptor", &impl, impl.descriptor_, "async_write_some"));
+
+ start_op(impl, io_uring_service::write_op, p.p, is_continuation,
+ buffer_sequence_adapter<asio::const_buffer,
+ ConstBufferSequence>::all_empty(buffers));
+ p.v = p.p = 0;
+ }
+
+ // Start an asynchronous wait until data can be written without blocking.
+ template <typename Handler, typename IoExecutor>
+ void async_write_some(implementation_type& impl,
+ const null_buffers&, Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_null_buffers_op<Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.descriptor_, POLLOUT, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::write_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(),
+ *p.p, "descriptor", &impl, impl.descriptor_,
+ "async_write_some(null_buffers)"));
+
+ start_op(impl, io_uring_service::write_op, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Write some data to the descriptor at the specified offset.
+ template <typename ConstBufferSequence>
+ size_t write_some_at(implementation_type& impl, uint64_t offset,
+ const ConstBufferSequence& buffers, asio::error_code& ec)
+ {
+ typedef buffer_sequence_adapter<asio::const_buffer,
+ ConstBufferSequence> bufs_type;
+
+ size_t n;
+ if (bufs_type::is_single_buffer)
+ {
+ n = descriptor_ops::sync_write_at1(impl.descriptor_,
+ impl.state_, offset, bufs_type::first(buffers).data(),
+ bufs_type::first(buffers).size(), ec);
+ }
+ else
+ {
+ bufs_type bufs(buffers);
+
+ n = descriptor_ops::sync_write_at(impl.descriptor_, impl.state_,
+ offset, bufs.buffers(), bufs.count(), bufs.all_empty(), ec);
+ }
+
+ ASIO_ERROR_LOCATION(ec);
+ return n;
+ }
+
+ // Wait until data can be written without blocking.
+ size_t write_some_at(implementation_type& impl, uint64_t,
+ const null_buffers& buffers, asio::error_code& ec)
+ {
+ return write_some(impl, buffers, ec);
+ }
+
+ // Start an asynchronous write at the specified offset. The data being sent
+ // must be valid for the lifetime of the asynchronous operation.
+ template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+ void async_write_some_at(implementation_type& impl, uint64_t offset,
+ const ConstBufferSequence& buffers, Handler& handler,
+ const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_descriptor_write_at_op<
+ ConstBufferSequence, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.descriptor_,
+ impl.state_, offset, buffers, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::write_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "descriptor", &impl, impl.descriptor_, "async_write_some"));
+
+ start_op(impl, io_uring_service::write_op, p.p, is_continuation,
+ buffer_sequence_adapter<asio::const_buffer,
+ ConstBufferSequence>::all_empty(buffers));
+ p.v = p.p = 0;
+ }
+
+ // Start an asynchronous wait until data can be written without blocking.
+ template <typename Handler, typename IoExecutor>
+ void async_write_some_at(implementation_type& impl,
+ const null_buffers& buffers, Handler& handler, const IoExecutor& io_ex)
+ {
+ return async_write_some(impl, buffers, handler, io_ex);
+ }
+
+ // Read some data from the stream. Returns the number of bytes read.
+ template <typename MutableBufferSequence>
+ size_t read_some(implementation_type& impl,
+ const MutableBufferSequence& buffers, asio::error_code& ec)
+ {
+ typedef buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs_type;
+
+ size_t n;
+ if (bufs_type::is_single_buffer)
+ {
+ n = descriptor_ops::sync_read1(impl.descriptor_,
+ impl.state_, bufs_type::first(buffers).data(),
+ bufs_type::first(buffers).size(), ec);
+ }
+ else
+ {
+ bufs_type bufs(buffers);
+
+ n = descriptor_ops::sync_read(impl.descriptor_, impl.state_,
+ bufs.buffers(), bufs.count(), bufs.all_empty(), ec);
+ }
+
+ ASIO_ERROR_LOCATION(ec);
+ return n;
+ }
+
+ // Wait until data can be read without blocking.
+ size_t read_some(implementation_type& impl,
+ const null_buffers&, asio::error_code& ec)
+ {
+ // Wait for descriptor to become ready.
+ descriptor_ops::poll_read(impl.descriptor_, impl.state_, ec);
+
+ ASIO_ERROR_LOCATION(ec);
+ return 0;
+ }
+
+ // Start an asynchronous read. The buffer for the data being read must be
+ // valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence,
+ typename Handler, typename IoExecutor>
+ void async_read_some(implementation_type& impl,
+ const MutableBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_descriptor_read_op<
+ MutableBufferSequence, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.descriptor_,
+ impl.state_, buffers, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::read_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "descriptor", &impl, impl.descriptor_, "async_read_some"));
+
+ start_op(impl, io_uring_service::read_op, p.p, is_continuation,
+ buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence>::all_empty(buffers));
+ p.v = p.p = 0;
+ }
+
+ // Wait until data can be read without blocking.
+ template <typename Handler, typename IoExecutor>
+ void async_read_some(implementation_type& impl,
+ const null_buffers&, Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_null_buffers_op<Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.descriptor_, POLLIN, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::read_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(),
+ *p.p, "descriptor", &impl, impl.descriptor_,
+ "async_read_some(null_buffers)"));
+
+ start_op(impl, io_uring_service::read_op, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Read some data at the specified offset. Returns the number of bytes read.
+ template <typename MutableBufferSequence>
+ size_t read_some_at(implementation_type& impl, uint64_t offset,
+ const MutableBufferSequence& buffers, asio::error_code& ec)
+ {
+ typedef buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs_type;
+
+ if (bufs_type::is_single_buffer)
+ {
+ return descriptor_ops::sync_read_at1(impl.descriptor_,
+ impl.state_, offset, bufs_type::first(buffers).data(),
+ bufs_type::first(buffers).size(), ec);
+ }
+ else
+ {
+ bufs_type bufs(buffers);
+
+ return descriptor_ops::sync_read_at(impl.descriptor_, impl.state_,
+ offset, bufs.buffers(), bufs.count(), bufs.all_empty(), ec);
+ }
+ }
+
+ // Wait until data can be read without blocking.
+ size_t read_some_at(implementation_type& impl, uint64_t,
+ const null_buffers& buffers, asio::error_code& ec)
+ {
+ return read_some(impl, buffers, ec);
+ }
+
+ // Start an asynchronous read. The buffer for the data being read must be
+ // valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence,
+ typename Handler, typename IoExecutor>
+ void async_read_some_at(implementation_type& impl,
+ uint64_t offset, const MutableBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_descriptor_read_at_op<
+ MutableBufferSequence, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.descriptor_,
+ impl.state_, offset, buffers, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::read_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "descriptor", &impl, impl.descriptor_, "async_read_some"));
+
+ start_op(impl, io_uring_service::read_op, p.p, is_continuation,
+ buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence>::all_empty(buffers));
+ p.v = p.p = 0;
+ }
+
+ // Wait until data can be read without blocking.
+ template <typename Handler, typename IoExecutor>
+ void async_read_some_at(implementation_type& impl, uint64_t,
+ const null_buffers& buffers, Handler& handler, const IoExecutor& io_ex)
+ {
+ return async_read_some(impl, buffers, handler, io_ex);
+ }
+
+private:
+ // Start the asynchronous operation.
+ ASIO_DECL void start_op(implementation_type& impl, int op_type,
+ io_uring_operation* op, bool is_continuation, bool noop);
+
+ // Helper class used to implement per-operation cancellation
+ class io_uring_op_cancellation
+ {
+ public:
+ io_uring_op_cancellation(io_uring_service* s,
+ io_uring_service::per_io_object_data* p, int o)
+ : io_uring_service_(s),
+ io_object_data_(p),
+ op_type_(o)
+ {
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ if (!!(type &
+ (cancellation_type::terminal
+ | cancellation_type::partial
+ | cancellation_type::total)))
+ {
+ io_uring_service_->cancel_ops_by_key(*io_object_data_, op_type_, this);
+ }
+ }
+
+ private:
+ io_uring_service* io_uring_service_;
+ io_uring_service::per_io_object_data* io_object_data_;
+ int op_type_;
+ };
+
+ // The io_uring_service that performs event demultiplexing for the service.
+ io_uring_service& io_uring_service_;
+
+ // Cached success value to avoid accessing category singleton.
+ const asio::error_code success_ec_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#if defined(ASIO_HEADER_ONLY)
+# include "asio/detail/impl/io_uring_descriptor_service.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_DESCRIPTOR_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_descriptor_write_at_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_descriptor_write_at_op.hpp
new file mode 100644
index 00000000000..10a3f7a6c3d
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_descriptor_write_at_op.hpp
@@ -0,0 +1,189 @@
+//
+// detail/io_uring_descriptor_write_at_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_DESCRIPTOR_WRITE_AT_OP_HPP
+#define ASIO_DETAIL_IO_URING_DESCRIPTOR_WRITE_AT_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/descriptor_ops.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename ConstBufferSequence>
+class io_uring_descriptor_write_at_op_base : public io_uring_operation
+{
+public:
+ io_uring_descriptor_write_at_op_base(
+ const asio::error_code& success_ec, int descriptor,
+ descriptor_ops::state_type state, uint64_t offset,
+ const ConstBufferSequence& buffers, func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_descriptor_write_at_op_base::do_prepare,
+ &io_uring_descriptor_write_at_op_base::do_perform, complete_func),
+ descriptor_(descriptor),
+ state_(state),
+ offset_(offset),
+ buffers_(buffers),
+ bufs_(buffers)
+ {
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_write_at_op_base* o(
+ static_cast<io_uring_descriptor_write_at_op_base*>(base));
+
+ if ((o->state_ & descriptor_ops::internal_non_blocking) != 0)
+ {
+ ::io_uring_prep_poll_add(sqe, o->descriptor_, POLLOUT);
+ }
+ else if (o->bufs_.is_single_buffer && o->bufs_.is_registered_buffer)
+ {
+ ::io_uring_prep_write_fixed(sqe, o->descriptor_,
+ o->bufs_.buffers()->iov_base, o->bufs_.buffers()->iov_len,
+ o->offset_, o->bufs_.registered_id().native_handle());
+ }
+ else
+ {
+ ::io_uring_prep_writev(sqe, o->descriptor_,
+ o->bufs_.buffers(), o->bufs_.count(), o->offset_);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_write_at_op_base* o(
+ static_cast<io_uring_descriptor_write_at_op_base*>(base));
+
+ if ((o->state_ & descriptor_ops::internal_non_blocking) != 0)
+ {
+ if (o->bufs_.is_single_buffer)
+ {
+ return descriptor_ops::non_blocking_write_at1(o->descriptor_,
+ o->offset_, o->bufs_.first(o->buffers_).data(),
+ o->bufs_.first(o->buffers_).size(), o->ec_,
+ o->bytes_transferred_);
+ }
+ else
+ {
+ return descriptor_ops::non_blocking_write_at(o->descriptor_,
+ o->offset_, o->bufs_.buffers(), o->bufs_.count(),
+ o->ec_, o->bytes_transferred_);
+ }
+ }
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= descriptor_ops::internal_non_blocking;
+ return false;
+ }
+
+ return after_completion;
+ }
+
+private:
+ int descriptor_;
+ descriptor_ops::state_type state_;
+ uint64_t offset_;
+ ConstBufferSequence buffers_;
+ buffer_sequence_adapter<asio::const_buffer,
+ ConstBufferSequence> bufs_;
+};
+
+template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+class io_uring_descriptor_write_at_op
+ : public io_uring_descriptor_write_at_op_base<ConstBufferSequence>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_descriptor_write_at_op);
+
+ io_uring_descriptor_write_at_op(const asio::error_code& success_ec,
+ int descriptor, descriptor_ops::state_type state, uint64_t offset,
+ const ConstBufferSequence& buffers, Handler& handler,
+ const IoExecutor& io_ex)
+ : io_uring_descriptor_write_at_op_base<ConstBufferSequence>(
+ success_ec, descriptor, state, offset, buffers,
+ &io_uring_descriptor_write_at_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_write_at_op* o
+ (static_cast<io_uring_descriptor_write_at_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_DESCRIPTOR_WRITE_AT_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_descriptor_write_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_descriptor_write_op.hpp
new file mode 100644
index 00000000000..090d644c7c8
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_descriptor_write_op.hpp
@@ -0,0 +1,185 @@
+//
+// detail/io_uring_descriptor_write_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_DESCRIPTOR_WRITE_OP_HPP
+#define ASIO_DETAIL_IO_URING_DESCRIPTOR_WRITE_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/descriptor_ops.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename ConstBufferSequence>
+class io_uring_descriptor_write_op_base : public io_uring_operation
+{
+public:
+ io_uring_descriptor_write_op_base(const asio::error_code& success_ec,
+ int descriptor, descriptor_ops::state_type state,
+ const ConstBufferSequence& buffers, func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_descriptor_write_op_base::do_prepare,
+ &io_uring_descriptor_write_op_base::do_perform, complete_func),
+ descriptor_(descriptor),
+ state_(state),
+ buffers_(buffers),
+ bufs_(buffers)
+ {
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_write_op_base* o(
+ static_cast<io_uring_descriptor_write_op_base*>(base));
+
+ if ((o->state_ & descriptor_ops::internal_non_blocking) != 0)
+ {
+ ::io_uring_prep_poll_add(sqe, o->descriptor_, POLLOUT);
+ }
+ else if (o->bufs_.is_single_buffer && o->bufs_.is_registered_buffer)
+ {
+ ::io_uring_prep_write_fixed(sqe, o->descriptor_,
+ o->bufs_.buffers()->iov_base, o->bufs_.buffers()->iov_len,
+ 0, o->bufs_.registered_id().native_handle());
+ }
+ else
+ {
+ ::io_uring_prep_writev(sqe, o->descriptor_,
+ o->bufs_.buffers(), o->bufs_.count(), -1);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_write_op_base* o(
+ static_cast<io_uring_descriptor_write_op_base*>(base));
+
+ if ((o->state_ & descriptor_ops::internal_non_blocking) != 0)
+ {
+ if (o->bufs_.is_single_buffer)
+ {
+ return descriptor_ops::non_blocking_write1(
+ o->descriptor_, o->bufs_.first(o->buffers_).data(),
+ o->bufs_.first(o->buffers_).size(), o->ec_,
+ o->bytes_transferred_);
+ }
+ else
+ {
+ return descriptor_ops::non_blocking_write(
+ o->descriptor_, o->bufs_.buffers(), o->bufs_.count(),
+ o->ec_, o->bytes_transferred_);
+ }
+ }
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= descriptor_ops::internal_non_blocking;
+ return false;
+ }
+
+ return after_completion;
+ }
+
+private:
+ int descriptor_;
+ descriptor_ops::state_type state_;
+ ConstBufferSequence buffers_;
+ buffer_sequence_adapter<asio::const_buffer,
+ ConstBufferSequence> bufs_;
+};
+
+template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+class io_uring_descriptor_write_op
+ : public io_uring_descriptor_write_op_base<ConstBufferSequence>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_descriptor_write_op);
+
+ io_uring_descriptor_write_op(const asio::error_code& success_ec,
+ int descriptor, descriptor_ops::state_type state,
+ const ConstBufferSequence& buffers, Handler& handler,
+ const IoExecutor& io_ex)
+ : io_uring_descriptor_write_op_base<ConstBufferSequence>(success_ec,
+ descriptor, state, buffers, &io_uring_descriptor_write_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_descriptor_write_op* o
+ (static_cast<io_uring_descriptor_write_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_DESCRIPTOR_WRITE_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_file_service.hpp b/3rdparty/asio/include/asio/detail/io_uring_file_service.hpp
new file mode 100644
index 00000000000..3a0a4538623
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_file_service.hpp
@@ -0,0 +1,261 @@
+//
+// detail/io_uring_file_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_FILE_SERVICE_HPP
+#define ASIO_DETAIL_IO_URING_FILE_SERVICE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_FILE) \
+ && defined(ASIO_HAS_IO_URING)
+
+#include <string>
+#include "asio/detail/cstdint.hpp"
+#include "asio/detail/descriptor_ops.hpp"
+#include "asio/detail/io_uring_descriptor_service.hpp"
+#include "asio/error.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/file_base.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+// Extend the io_uring_descriptor_service to provide file support.
+class io_uring_file_service :
+ public execution_context_service_base<io_uring_file_service>
+{
+public:
+ typedef io_uring_descriptor_service descriptor_service;
+
+ // The native type of a file.
+ typedef descriptor_service::native_handle_type native_handle_type;
+
+ // The implementation type of the file.
+ class implementation_type : descriptor_service::implementation_type
+ {
+ private:
+ // Only this service will have access to the internal values.
+ friend class io_uring_file_service;
+
+ bool is_stream_;
+ };
+
+ ASIO_DECL io_uring_file_service(execution_context& context);
+
+ // Destroy all user-defined handler objects owned by the service.
+ ASIO_DECL void shutdown();
+
+ // Construct a new file implementation.
+ void construct(implementation_type& impl)
+ {
+ descriptor_service_.construct(impl);
+ impl.is_stream_ = false;
+ }
+
+ // Move-construct a new file implementation.
+ void move_construct(implementation_type& impl,
+ implementation_type& other_impl)
+ {
+ descriptor_service_.move_construct(impl, other_impl);
+ impl.is_stream_ = other_impl.is_stream_;
+ }
+
+ // Move-assign from another file implementation.
+ void move_assign(implementation_type& impl,
+ io_uring_file_service& other_service,
+ implementation_type& other_impl)
+ {
+ descriptor_service_.move_assign(impl,
+ other_service.descriptor_service_, other_impl);
+ impl.is_stream_ = other_impl.is_stream_;
+ }
+
+ // Destroy a file implementation.
+ void destroy(implementation_type& impl)
+ {
+ descriptor_service_.destroy(impl);
+ }
+
+ // Open the file using the specified path name.
+ ASIO_DECL asio::error_code open(implementation_type& impl,
+ const char* path, file_base::flags open_flags,
+ asio::error_code& ec);
+
+ // Assign a native descriptor to a file implementation.
+ asio::error_code assign(implementation_type& impl,
+ const native_handle_type& native_descriptor,
+ asio::error_code& ec)
+ {
+ return descriptor_service_.assign(impl, native_descriptor, ec);
+ }
+
+ // Set whether the implementation is stream-oriented.
+ void set_is_stream(implementation_type& impl, bool is_stream)
+ {
+ impl.is_stream_ = is_stream;
+ }
+
+ // Determine whether the file is open.
+ bool is_open(const implementation_type& impl) const
+ {
+ return descriptor_service_.is_open(impl);
+ }
+
+ // Destroy a file implementation.
+ asio::error_code close(implementation_type& impl,
+ asio::error_code& ec)
+ {
+ return descriptor_service_.close(impl, ec);
+ }
+
+ // Get the native file representation.
+ native_handle_type native_handle(const implementation_type& impl) const
+ {
+ return descriptor_service_.native_handle(impl);
+ }
+
+ // Release ownership of the native descriptor representation.
+ native_handle_type release(implementation_type& impl,
+ asio::error_code& ec)
+ {
+ return descriptor_service_.release(impl, ec);
+ }
+
+ // Cancel all operations associated with the file.
+ asio::error_code cancel(implementation_type& impl,
+ asio::error_code& ec)
+ {
+ return descriptor_service_.cancel(impl, ec);
+ }
+
+ // Get the size of the file.
+ ASIO_DECL uint64_t size(const implementation_type& impl,
+ asio::error_code& ec) const;
+
+ // Alter the size of the file.
+ ASIO_DECL asio::error_code resize(implementation_type& impl,
+ uint64_t n, asio::error_code& ec);
+
+ // Synchronise the file to disk.
+ ASIO_DECL asio::error_code sync_all(implementation_type& impl,
+ asio::error_code& ec);
+
+ // Synchronise the file data to disk.
+ ASIO_DECL asio::error_code sync_data(implementation_type& impl,
+ asio::error_code& ec);
+
+ // Seek to a position in the file.
+ ASIO_DECL uint64_t seek(implementation_type& impl, int64_t offset,
+ file_base::seek_basis whence, asio::error_code& ec);
+
+ // Write the given data. Returns the number of bytes written.
+ template <typename ConstBufferSequence>
+ size_t write_some(implementation_type& impl,
+ const ConstBufferSequence& buffers, asio::error_code& ec)
+ {
+ return descriptor_service_.write_some(impl, buffers, ec);
+ }
+
+ // Start an asynchronous write. The data being written must be valid for the
+ // lifetime of the asynchronous operation.
+ template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+ void async_write_some(implementation_type& impl,
+ const ConstBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ descriptor_service_.async_write_some(impl, buffers, handler, io_ex);
+ }
+
+ // Write the given data at the specified location. Returns the number of
+ // bytes written.
+ template <typename ConstBufferSequence>
+ size_t write_some_at(implementation_type& impl, uint64_t offset,
+ const ConstBufferSequence& buffers, asio::error_code& ec)
+ {
+ return descriptor_service_.write_some_at(impl, offset, buffers, ec);
+ }
+
+ // Start an asynchronous write at the specified location. The data being
+ // written must be valid for the lifetime of the asynchronous operation.
+ template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+ void async_write_some_at(implementation_type& impl,
+ uint64_t offset, const ConstBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ descriptor_service_.async_write_some_at(
+ impl, offset, buffers, handler, io_ex);
+ }
+
+ // Read some data. Returns the number of bytes read.
+ template <typename MutableBufferSequence>
+ size_t read_some(implementation_type& impl,
+ const MutableBufferSequence& buffers, asio::error_code& ec)
+ {
+ return descriptor_service_.read_some(impl, buffers, ec);
+ }
+
+ // Start an asynchronous read. The buffer for the data being read must be
+ // valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence,
+ typename Handler, typename IoExecutor>
+ void async_read_some(implementation_type& impl,
+ const MutableBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ descriptor_service_.async_read_some(impl, buffers, handler, io_ex);
+ }
+
+ // Read some data. Returns the number of bytes read.
+ template <typename MutableBufferSequence>
+ size_t read_some_at(implementation_type& impl, uint64_t offset,
+ const MutableBufferSequence& buffers, asio::error_code& ec)
+ {
+ return descriptor_service_.read_some_at(impl, offset, buffers, ec);
+ }
+
+ // Start an asynchronous read. The buffer for the data being read must be
+ // valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence,
+ typename Handler, typename IoExecutor>
+ void async_read_some_at(implementation_type& impl,
+ uint64_t offset, const MutableBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ descriptor_service_.async_read_some_at(
+ impl, offset, buffers, handler, io_ex);
+ }
+
+private:
+ // The implementation used for initiating asynchronous operations.
+ descriptor_service descriptor_service_;
+
+ // Cached success value to avoid accessing category singleton.
+ const asio::error_code success_ec_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#if defined(ASIO_HEADER_ONLY)
+# include "asio/detail/impl/io_uring_file_service.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+
+#endif // defined(ASIO_HAS_FILE)
+ // && defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_FILE_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_null_buffers_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_null_buffers_op.hpp
new file mode 100644
index 00000000000..61fe6a6aafb
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_null_buffers_op.hpp
@@ -0,0 +1,114 @@
+//
+// detail/io_uring_null_buffers_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_NULL_BUFFERS_OP_HPP
+#define ASIO_DETAIL_IO_URING_NULL_BUFFERS_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_alloc_helpers.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename Handler, typename IoExecutor>
+class io_uring_null_buffers_op : public io_uring_operation
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_null_buffers_op);
+
+ io_uring_null_buffers_op(const asio::error_code& success_ec,
+ int descriptor, int poll_flags, Handler& handler, const IoExecutor& io_ex)
+ : io_uring_operation(success_ec,
+ &io_uring_null_buffers_op::do_prepare,
+ &io_uring_null_buffers_op::do_perform,
+ &io_uring_null_buffers_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex),
+ descriptor_(descriptor),
+ poll_flags_(poll_flags)
+ {
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_null_buffers_op* o(static_cast<io_uring_null_buffers_op*>(base));
+
+ ::io_uring_prep_poll_add(sqe, o->descriptor_, o->poll_flags_);
+ }
+
+ static bool do_perform(io_uring_operation*, bool after_completion)
+ {
+ return after_completion;
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_null_buffers_op* o(static_cast<io_uring_null_buffers_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+ int descriptor_;
+ int poll_flags_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_DETAIL_IO_URING_NULL_BUFFERS_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_operation.hpp b/3rdparty/asio/include/asio/detail/io_uring_operation.hpp
new file mode 100644
index 00000000000..f2635cc4074
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_operation.hpp
@@ -0,0 +1,84 @@
+//
+// detail/io_uring_operation.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_OPERATION_HPP
+#define ASIO_DETAIL_IO_URING_OPERATION_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include <liburing.h>
+#include "asio/detail/cstdint.hpp"
+#include "asio/detail/operation.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class io_uring_operation
+ : public operation
+{
+public:
+ // The error code to be passed to the completion handler.
+ asio::error_code ec_;
+
+ // The number of bytes transferred, to be passed to the completion handler.
+ std::size_t bytes_transferred_;
+
+ // The operation key used for targeted cancellation.
+ void* cancellation_key_;
+
+ // Prepare the operation.
+ void prepare(::io_uring_sqe* sqe)
+ {
+ return prepare_func_(this, sqe);
+ }
+
+ // Perform actions associated with the operation. Returns true when complete.
+ bool perform(bool after_completion)
+ {
+ return perform_func_(this, after_completion);
+ }
+
+protected:
+ typedef void (*prepare_func_type)(io_uring_operation*, ::io_uring_sqe*);
+ typedef bool (*perform_func_type)(io_uring_operation*, bool);
+
+ io_uring_operation(const asio::error_code& success_ec,
+ prepare_func_type prepare_func, perform_func_type perform_func,
+ func_type complete_func)
+ : operation(complete_func),
+ ec_(success_ec),
+ bytes_transferred_(0),
+ cancellation_key_(0),
+ prepare_func_(prepare_func),
+ perform_func_(perform_func)
+ {
+ }
+
+private:
+ prepare_func_type prepare_func_;
+ perform_func_type perform_func_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_OPERATION_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_service.hpp b/3rdparty/asio/include/asio/detail/io_uring_service.hpp
new file mode 100644
index 00000000000..2dd3c0bf14d
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_service.hpp
@@ -0,0 +1,319 @@
+//
+// detail/io_uring_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SERVICE_HPP
+#define ASIO_DETAIL_IO_URING_SERVICE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include <liburing.h>
+#include "asio/detail/atomic_count.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/conditionally_enabled_mutex.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/limits.hpp"
+#include "asio/detail/object_pool.hpp"
+#include "asio/detail/op_queue.hpp"
+#include "asio/detail/reactor.hpp"
+#include "asio/detail/scheduler_task.hpp"
+#include "asio/detail/timer_queue_base.hpp"
+#include "asio/detail/timer_queue_set.hpp"
+#include "asio/detail/wait_op.hpp"
+#include "asio/execution_context.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class io_uring_service
+ : public execution_context_service_base<io_uring_service>,
+ public scheduler_task
+{
+private:
+ // The mutex type used by this reactor.
+ typedef conditionally_enabled_mutex mutex;
+
+public:
+ enum op_types { read_op = 0, write_op = 1, except_op = 2, max_ops = 3 };
+
+ class io_object;
+
+ // An I/O queue stores operations that must run serially.
+ class io_queue : operation
+ {
+ friend class io_uring_service;
+
+ io_object* io_object_;
+ op_queue<io_uring_operation> op_queue_;
+ bool cancel_requested_;
+
+ ASIO_DECL io_queue();
+ void set_result(int r) { task_result_ = static_cast<unsigned>(r); }
+ ASIO_DECL operation* perform_io(int result);
+ ASIO_DECL static void do_complete(void* owner, operation* base,
+ const asio::error_code& ec, std::size_t bytes_transferred);
+ };
+
+ // Per I/O object state.
+ class io_object
+ {
+ friend class io_uring_service;
+ friend class object_pool_access;
+
+ io_object* next_;
+ io_object* prev_;
+
+ mutex mutex_;
+ io_uring_service* service_;
+ io_queue queues_[max_ops];
+ bool shutdown_;
+
+ ASIO_DECL io_object(bool locking);
+ };
+
+ // Per I/O object data.
+ typedef io_object* per_io_object_data;
+
+ // Constructor.
+ ASIO_DECL io_uring_service(asio::execution_context& ctx);
+
+ // Destructor.
+ ASIO_DECL ~io_uring_service();
+
+ // Destroy all user-defined handler objects owned by the service.
+ ASIO_DECL void shutdown();
+
+ // Recreate internal state following a fork.
+ ASIO_DECL void notify_fork(
+ asio::execution_context::fork_event fork_ev);
+
+ // Initialise the task.
+ ASIO_DECL void init_task();
+
+ // Register an I/O object with io_uring.
+ ASIO_DECL void register_io_object(io_object*& io_obj);
+
+ // Register an internal I/O object with io_uring.
+ ASIO_DECL void register_internal_io_object(
+ io_object*& io_obj, int op_type, io_uring_operation* op);
+
+ // Register buffers with io_uring.
+ ASIO_DECL void register_buffers(const ::iovec* v, unsigned n);
+
+ // Unregister buffers from io_uring.
+ ASIO_DECL void unregister_buffers();
+
+ // Post an operation for immediate completion.
+ void post_immediate_completion(operation* op, bool is_continuation);
+
+ // Start a new operation. The operation will be prepared and submitted to the
+ // io_uring when it is at the head of its I/O operation queue.
+ ASIO_DECL void start_op(int op_type, per_io_object_data& io_obj,
+ io_uring_operation* op, bool is_continuation);
+
+ // Cancel all operations associated with the given I/O object. The handlers
+ // associated with the I/O object will be invoked with the operation_aborted
+ // error.
+ ASIO_DECL void cancel_ops(per_io_object_data& io_obj);
+
+ // Cancel all operations associated with the given I/O object and key. The
+ // handlers associated with the object and key will be invoked with the
+ // operation_aborted error.
+ ASIO_DECL void cancel_ops_by_key(per_io_object_data& io_obj,
+ int op_type, void* cancellation_key);
+
+ // Cancel any operations that are running against the I/O object and remove
+ // its registration from the service. The service resources associated with
+ // the I/O object must be released by calling cleanup_io_object.
+ ASIO_DECL void deregister_io_object(per_io_object_data& io_obj);
+
+ // Perform any post-deregistration cleanup tasks associated with the I/O
+ // object.
+ ASIO_DECL void cleanup_io_object(per_io_object_data& io_obj);
+
+ // Add a new timer queue to the reactor.
+ template <typename Time_Traits>
+ void add_timer_queue(timer_queue<Time_Traits>& timer_queue);
+
+ // Remove a timer queue from the reactor.
+ template <typename Time_Traits>
+ void remove_timer_queue(timer_queue<Time_Traits>& timer_queue);
+
+ // Schedule a new operation in the given timer queue to expire at the
+ // specified absolute time.
+ template <typename Time_Traits>
+ void schedule_timer(timer_queue<Time_Traits>& queue,
+ const typename Time_Traits::time_type& time,
+ typename timer_queue<Time_Traits>::per_timer_data& timer, wait_op* op);
+
+ // Cancel the timer operations associated with the given token. Returns the
+ // number of operations that have been posted or dispatched.
+ template <typename Time_Traits>
+ std::size_t cancel_timer(timer_queue<Time_Traits>& queue,
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
+
+ // Cancel the timer operations associated with the given key.
+ template <typename Time_Traits>
+ void cancel_timer_by_key(timer_queue<Time_Traits>& queue,
+ typename timer_queue<Time_Traits>::per_timer_data* timer,
+ void* cancellation_key);
+
+ // Move the timer operations associated with the given timer.
+ template <typename Time_Traits>
+ void move_timer(timer_queue<Time_Traits>& queue,
+ typename timer_queue<Time_Traits>::per_timer_data& target,
+ typename timer_queue<Time_Traits>::per_timer_data& source);
+
+ // Wait on io_uring once until interrupted or events are ready to be
+ // dispatched.
+ ASIO_DECL void run(long usec, op_queue<operation>& ops);
+
+ // Interrupt the io_uring wait.
+ ASIO_DECL void interrupt();
+
+private:
+ // The hint to pass to io_uring_queue_init to size its data structures.
+ enum { ring_size = 16384 };
+
+ // The number of operations to submit in a batch.
+ enum { submit_batch_size = 128 };
+
+ // The number of operations to complete in a batch.
+ enum { complete_batch_size = 128 };
+
+ // The type used for processing eventfd readiness notifications.
+ class event_fd_read_op;
+
+ // Initialise the ring.
+ ASIO_DECL void init_ring();
+
+ // Register the eventfd descriptor for readiness notifications.
+ ASIO_DECL void register_with_reactor();
+
+ // Allocate a new I/O object.
+ ASIO_DECL io_object* allocate_io_object();
+
+ // Free an existing I/O object.
+ ASIO_DECL void free_io_object(io_object* s);
+
+ // Helper function to cancel all operations associated with the given I/O
+ // object. This function must be called while the I/O object's mutex is held.
+ // Returns true if there are operations for which cancellation is pending.
+ ASIO_DECL bool do_cancel_ops(
+ per_io_object_data& io_obj, op_queue<operation>& ops);
+
+ // Helper function to add a new timer queue.
+ ASIO_DECL void do_add_timer_queue(timer_queue_base& queue);
+
+ // Helper function to remove a timer queue.
+ ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue);
+
+ // Called to recalculate and update the timeout.
+ ASIO_DECL void update_timeout();
+
+ // Get the current timeout value.
+ ASIO_DECL __kernel_timespec get_timeout() const;
+
+ // Get a new submission queue entry, flushing the queue if necessary.
+ ASIO_DECL ::io_uring_sqe* get_sqe();
+
+ // Submit pending submission queue entries.
+ ASIO_DECL void submit_sqes();
+
+ // Post an operation to submit the pending submission queue entries.
+ ASIO_DECL void post_submit_sqes_op(mutex::scoped_lock& lock);
+
+ // Push an operation to submit the pending submission queue entries.
+ ASIO_DECL void push_submit_sqes_op(op_queue<operation>& ops);
+
+ // Helper operation to submit pending submission queue entries.
+ class submit_sqes_op : operation
+ {
+ friend class io_uring_service;
+
+ io_uring_service* service_;
+
+ ASIO_DECL submit_sqes_op(io_uring_service* s);
+ ASIO_DECL static void do_complete(void* owner, operation* base,
+ const asio::error_code& ec, std::size_t bytes_transferred);
+ };
+
+ // The scheduler implementation used to post completions.
+ scheduler& scheduler_;
+
+ // Mutex to protect access to internal data.
+ mutex mutex_;
+
+ // The ring.
+ ::io_uring ring_;
+
+ // The count of unfinished work.
+ atomic_count outstanding_work_;
+
+ // The operation used to submit the pending submission queue entries.
+ submit_sqes_op submit_sqes_op_;
+
+ // The number of pending submission queue entries_.
+ int pending_sqes_;
+
+ // Whether there is a pending submission operation.
+ bool pending_submit_sqes_op_;
+
+ // Whether the service has been shut down.
+ bool shutdown_;
+
+ // The timer queues.
+ timer_queue_set timer_queues_;
+
+ // The timespec for the pending timeout operation. Must remain valid while the
+ // operation is outstanding.
+ __kernel_timespec timeout_;
+
+ // Mutex to protect access to the registered I/O objects.
+ mutex registration_mutex_;
+
+ // Keep track of all registered I/O objects.
+ object_pool<io_object> registered_io_objects_;
+
+ // Helper class to do post-perform_io cleanup.
+ struct perform_io_cleanup_on_block_exit;
+ friend struct perform_io_cleanup_on_block_exit;
+
+ // The reactor used to register for eventfd readiness.
+ reactor& reactor_;
+
+ // The per-descriptor reactor data used for the eventfd.
+ reactor::per_descriptor_data reactor_data_;
+
+ // The eventfd descriptor used to wait for readiness.
+ int event_fd_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/detail/impl/io_uring_service.hpp"
+#if defined(ASIO_HEADER_ONLY)
+# include "asio/detail/impl/io_uring_service.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_socket_accept_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_socket_accept_op.hpp
new file mode 100644
index 00000000000..dbf1a98b536
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_socket_accept_op.hpp
@@ -0,0 +1,280 @@
+//
+// detail/io_uring_socket_accept_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SOCKET_ACCEPT_OP_HPP
+#define ASIO_DETAIL_IO_URING_SOCKET_ACCEPT_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_alloc_helpers.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+#include "asio/detail/socket_holder.hpp"
+#include "asio/detail/socket_ops.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename Socket, typename Protocol>
+class io_uring_socket_accept_op_base : public io_uring_operation
+{
+public:
+ io_uring_socket_accept_op_base(const asio::error_code& success_ec,
+ socket_type socket, socket_ops::state_type state, Socket& peer,
+ const Protocol& protocol, typename Protocol::endpoint* peer_endpoint,
+ func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_socket_accept_op_base::do_prepare,
+ &io_uring_socket_accept_op_base::do_perform, complete_func),
+ socket_(socket),
+ state_(state),
+ peer_(peer),
+ protocol_(protocol),
+ peer_endpoint_(peer_endpoint),
+ addrlen_(peer_endpoint ? peer_endpoint->capacity() : 0)
+ {
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_accept_op_base* o(
+ static_cast<io_uring_socket_accept_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ ::io_uring_prep_poll_add(sqe, o->socket_, POLLIN);
+ }
+ else
+ {
+ ::io_uring_prep_accept(sqe, o->socket_,
+ o->peer_endpoint_ ? o->peer_endpoint_->data() : 0,
+ o->peer_endpoint_ ? &o->addrlen_ : 0, 0);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_accept_op_base* o(
+ static_cast<io_uring_socket_accept_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ socket_type new_socket = invalid_socket;
+ std::size_t addrlen = static_cast<std::size_t>(o->addrlen_);
+ bool result = socket_ops::non_blocking_accept(o->socket_,
+ o->state_, o->peer_endpoint_ ? o->peer_endpoint_->data() : 0,
+ o->peer_endpoint_ ? &addrlen : 0, o->ec_, new_socket);
+ o->new_socket_.reset(new_socket);
+ o->addrlen_ = static_cast<socklen_t>(addrlen);
+ return result;
+ }
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= socket_ops::internal_non_blocking;
+ return false;
+ }
+
+ if (after_completion && !o->ec_)
+ o->new_socket_.reset(static_cast<int>(o->bytes_transferred_));
+
+ return after_completion;
+ }
+
+ void do_assign()
+ {
+ if (new_socket_.get() != invalid_socket)
+ {
+ if (peer_endpoint_)
+ peer_endpoint_->resize(addrlen_);
+ peer_.assign(protocol_, new_socket_.get(), ec_);
+ if (!ec_)
+ new_socket_.release();
+ }
+ }
+
+private:
+ socket_type socket_;
+ socket_ops::state_type state_;
+ socket_holder new_socket_;
+ Socket& peer_;
+ Protocol protocol_;
+ typename Protocol::endpoint* peer_endpoint_;
+ socklen_t addrlen_;
+};
+
+template <typename Socket, typename Protocol,
+ typename Handler, typename IoExecutor>
+class io_uring_socket_accept_op :
+ public io_uring_socket_accept_op_base<Socket, Protocol>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_socket_accept_op);
+
+ io_uring_socket_accept_op(const asio::error_code& success_ec,
+ socket_type socket, socket_ops::state_type state, Socket& peer,
+ const Protocol& protocol, typename Protocol::endpoint* peer_endpoint,
+ Handler& handler, const IoExecutor& io_ex)
+ : io_uring_socket_accept_op_base<Socket, Protocol>(
+ success_ec, socket, state, peer, protocol, peer_endpoint,
+ &io_uring_socket_accept_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_accept_op* o(static_cast<io_uring_socket_accept_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ // On success, assign new connection to peer socket object.
+ if (owner)
+ o->do_assign();
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder1<Handler, asio::error_code>
+ handler(o->handler_, o->ec_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+template <typename Protocol, typename PeerIoExecutor,
+ typename Handler, typename IoExecutor>
+class io_uring_socket_move_accept_op :
+ private Protocol::socket::template rebind_executor<PeerIoExecutor>::other,
+ public io_uring_socket_accept_op_base<
+ typename Protocol::socket::template rebind_executor<PeerIoExecutor>::other,
+ Protocol>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_socket_move_accept_op);
+
+ io_uring_socket_move_accept_op(const asio::error_code& success_ec,
+ const PeerIoExecutor& peer_io_ex, socket_type socket,
+ socket_ops::state_type state, const Protocol& protocol,
+ typename Protocol::endpoint* peer_endpoint, Handler& handler,
+ const IoExecutor& io_ex)
+ : peer_socket_type(peer_io_ex),
+ io_uring_socket_accept_op_base<peer_socket_type, Protocol>(
+ success_ec, socket, state, *this, protocol, peer_endpoint,
+ &io_uring_socket_move_accept_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_move_accept_op* o(
+ static_cast<io_uring_socket_move_accept_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ // On success, assign new connection to peer socket object.
+ if (owner)
+ o->do_assign();
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::move_binder2<Handler,
+ asio::error_code, peer_socket_type>
+ handler(0, static_cast<Handler&&>(o->handler_), o->ec_,
+ static_cast<peer_socket_type&&>(*o));
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "..."));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ typedef typename Protocol::socket::template
+ rebind_executor<PeerIoExecutor>::other peer_socket_type;
+
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SOCKET_ACCEPT_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_socket_connect_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_socket_connect_op.hpp
new file mode 100644
index 00000000000..45d30c6bb0a
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_socket_connect_op.hpp
@@ -0,0 +1,140 @@
+//
+// detail/io_uring_socket_connect_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SOCKET_CONNECT_OP_HPP
+#define ASIO_DETAIL_IO_URING_SOCKET_CONNECT_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_alloc_helpers.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+#include "asio/detail/socket_ops.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename Protocol>
+class io_uring_socket_connect_op_base : public io_uring_operation
+{
+public:
+ io_uring_socket_connect_op_base(const asio::error_code& success_ec,
+ socket_type socket, const typename Protocol::endpoint& endpoint,
+ func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_socket_connect_op_base::do_prepare,
+ &io_uring_socket_connect_op_base::do_perform, complete_func),
+ socket_(socket),
+ endpoint_(endpoint)
+ {
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_connect_op_base* o(
+ static_cast<io_uring_socket_connect_op_base*>(base));
+
+ ::io_uring_prep_connect(sqe, o->socket_,
+ static_cast<sockaddr*>(o->endpoint_.data()),
+ static_cast<socklen_t>(o->endpoint_.size()));
+ }
+
+ static bool do_perform(io_uring_operation*, bool after_completion)
+ {
+ return after_completion;
+ }
+
+private:
+ socket_type socket_;
+ typename Protocol::endpoint endpoint_;
+};
+
+template <typename Protocol, typename Handler, typename IoExecutor>
+class io_uring_socket_connect_op :
+ public io_uring_socket_connect_op_base<Protocol>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_socket_connect_op);
+
+ io_uring_socket_connect_op(const asio::error_code& success_ec,
+ socket_type socket, const typename Protocol::endpoint& endpoint,
+ Handler& handler, const IoExecutor& io_ex)
+ : io_uring_socket_connect_op_base<Protocol>(success_ec, socket,
+ endpoint, &io_uring_socket_connect_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_connect_op* o
+ (static_cast<io_uring_socket_connect_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder1<Handler, asio::error_code>
+ handler(o->handler_, o->ec_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SOCKET_CONNECT_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_socket_recv_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_socket_recv_op.hpp
new file mode 100644
index 00000000000..b1936c1ab93
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_socket_recv_op.hpp
@@ -0,0 +1,205 @@
+//
+// detail/io_uring_socket_recv_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SOCKET_RECV_OP_HPP
+#define ASIO_DETAIL_IO_URING_SOCKET_RECV_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/socket_ops.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename MutableBufferSequence>
+class io_uring_socket_recv_op_base : public io_uring_operation
+{
+public:
+ io_uring_socket_recv_op_base(const asio::error_code& success_ec,
+ socket_type socket, socket_ops::state_type state,
+ const MutableBufferSequence& buffers,
+ socket_base::message_flags flags, func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_socket_recv_op_base::do_prepare,
+ &io_uring_socket_recv_op_base::do_perform, complete_func),
+ socket_(socket),
+ state_(state),
+ buffers_(buffers),
+ flags_(flags),
+ bufs_(buffers),
+ msghdr_()
+ {
+ msghdr_.msg_iov = bufs_.buffers();
+ msghdr_.msg_iovlen = static_cast<int>(bufs_.count());
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_recv_op_base* o(
+ static_cast<io_uring_socket_recv_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ bool except_op = (o->flags_ & socket_base::message_out_of_band) != 0;
+ ::io_uring_prep_poll_add(sqe, o->socket_, except_op ? POLLPRI : POLLIN);
+ }
+ else if (o->bufs_.is_single_buffer
+ && o->bufs_.is_registered_buffer && o->flags_ == 0)
+ {
+ ::io_uring_prep_read_fixed(sqe, o->socket_,
+ o->bufs_.buffers()->iov_base, o->bufs_.buffers()->iov_len,
+ 0, o->bufs_.registered_id().native_handle());
+ }
+ else
+ {
+ ::io_uring_prep_recvmsg(sqe, o->socket_, &o->msghdr_, o->flags_);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_recv_op_base* o(
+ static_cast<io_uring_socket_recv_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ bool except_op = (o->flags_ & socket_base::message_out_of_band) != 0;
+ if (after_completion || !except_op)
+ {
+ if (o->bufs_.is_single_buffer)
+ {
+ return socket_ops::non_blocking_recv1(o->socket_,
+ o->bufs_.first(o->buffers_).data(),
+ o->bufs_.first(o->buffers_).size(), o->flags_,
+ (o->state_ & socket_ops::stream_oriented) != 0,
+ o->ec_, o->bytes_transferred_);
+ }
+ else
+ {
+ return socket_ops::non_blocking_recv(o->socket_,
+ o->bufs_.buffers(), o->bufs_.count(), o->flags_,
+ (o->state_ & socket_ops::stream_oriented) != 0,
+ o->ec_, o->bytes_transferred_);
+ }
+ }
+ }
+ else if (after_completion)
+ {
+ if (!o->ec_ && o->bytes_transferred_ == 0)
+ if ((o->state_ & socket_ops::stream_oriented) != 0)
+ o->ec_ = asio::error::eof;
+ }
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= socket_ops::internal_non_blocking;
+ return false;
+ }
+
+ return after_completion;
+ }
+
+private:
+ socket_type socket_;
+ socket_ops::state_type state_;
+ MutableBufferSequence buffers_;
+ socket_base::message_flags flags_;
+ buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs_;
+ msghdr msghdr_;
+};
+
+template <typename MutableBufferSequence, typename Handler, typename IoExecutor>
+class io_uring_socket_recv_op
+ : public io_uring_socket_recv_op_base<MutableBufferSequence>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_socket_recv_op);
+
+ io_uring_socket_recv_op(const asio::error_code& success_ec,
+ int socket, socket_ops::state_type state,
+ const MutableBufferSequence& buffers, socket_base::message_flags flags,
+ Handler& handler, const IoExecutor& io_ex)
+ : io_uring_socket_recv_op_base<MutableBufferSequence>(success_ec,
+ socket, state, buffers, flags, &io_uring_socket_recv_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_recv_op* o
+ (static_cast<io_uring_socket_recv_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SOCKET_RECV_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_socket_recvfrom_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_socket_recvfrom_op.hpp
new file mode 100644
index 00000000000..dfd30e4f2a1
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_socket_recvfrom_op.hpp
@@ -0,0 +1,206 @@
+//
+// detail/io_uring_socket_recvfrom_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SOCKET_RECVFROM_OP_HPP
+#define ASIO_DETAIL_IO_URING_SOCKET_RECVFROM_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/socket_ops.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename MutableBufferSequence, typename Endpoint>
+class io_uring_socket_recvfrom_op_base : public io_uring_operation
+{
+public:
+ io_uring_socket_recvfrom_op_base(const asio::error_code& success_ec,
+ socket_type socket, socket_ops::state_type state,
+ const MutableBufferSequence& buffers, Endpoint& endpoint,
+ socket_base::message_flags flags, func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_socket_recvfrom_op_base::do_prepare,
+ &io_uring_socket_recvfrom_op_base::do_perform, complete_func),
+ socket_(socket),
+ state_(state),
+ buffers_(buffers),
+ sender_endpoint_(endpoint),
+ flags_(flags),
+ bufs_(buffers),
+ msghdr_()
+ {
+ msghdr_.msg_iov = bufs_.buffers();
+ msghdr_.msg_iovlen = static_cast<int>(bufs_.count());
+ msghdr_.msg_name = static_cast<sockaddr*>(
+ static_cast<void*>(sender_endpoint_.data()));
+ msghdr_.msg_namelen = sender_endpoint_.capacity();
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_recvfrom_op_base* o(
+ static_cast<io_uring_socket_recvfrom_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ bool except_op = (o->flags_ & socket_base::message_out_of_band) != 0;
+ ::io_uring_prep_poll_add(sqe, o->socket_, except_op ? POLLPRI : POLLIN);
+ }
+ else
+ {
+ ::io_uring_prep_recvmsg(sqe, o->socket_, &o->msghdr_, o->flags_);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_recvfrom_op_base* o(
+ static_cast<io_uring_socket_recvfrom_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ bool except_op = (o->flags_ & socket_base::message_out_of_band) != 0;
+ if (after_completion || !except_op)
+ {
+ std::size_t addr_len = o->sender_endpoint_.capacity();
+ bool result;
+ if (o->bufs_.is_single_buffer)
+ {
+ result = socket_ops::non_blocking_recvfrom1(o->socket_,
+ o->bufs_.first(o->buffers_).data(),
+ o->bufs_.first(o->buffers_).size(), o->flags_,
+ o->sender_endpoint_.data(), &addr_len,
+ o->ec_, o->bytes_transferred_);
+ }
+ else
+ {
+ result = socket_ops::non_blocking_recvfrom(o->socket_,
+ o->bufs_.buffers(), o->bufs_.count(), o->flags_,
+ o->sender_endpoint_.data(), &addr_len,
+ o->ec_, o->bytes_transferred_);
+ }
+ if (result && !o->ec_)
+ o->sender_endpoint_.resize(addr_len);
+ }
+ }
+ else if (after_completion && !o->ec_)
+ o->sender_endpoint_.resize(o->msghdr_.msg_namelen);
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= socket_ops::internal_non_blocking;
+ return false;
+ }
+
+ return after_completion;
+ }
+
+private:
+ socket_type socket_;
+ socket_ops::state_type state_;
+ MutableBufferSequence buffers_;
+ Endpoint& sender_endpoint_;
+ socket_base::message_flags flags_;
+ buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs_;
+ msghdr msghdr_;
+};
+
+template <typename MutableBufferSequence, typename Endpoint,
+ typename Handler, typename IoExecutor>
+class io_uring_socket_recvfrom_op
+ : public io_uring_socket_recvfrom_op_base<MutableBufferSequence, Endpoint>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_socket_recvfrom_op);
+
+ io_uring_socket_recvfrom_op(const asio::error_code& success_ec,
+ int socket, socket_ops::state_type state,
+ const MutableBufferSequence& buffers, Endpoint& endpoint,
+ socket_base::message_flags flags,
+ Handler& handler, const IoExecutor& io_ex)
+ : io_uring_socket_recvfrom_op_base<MutableBufferSequence, Endpoint>(
+ success_ec, socket, state, buffers, endpoint, flags,
+ &io_uring_socket_recvfrom_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_recvfrom_op* o
+ (static_cast<io_uring_socket_recvfrom_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SOCKET_RECVFROM_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_socket_recvmsg_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_socket_recvmsg_op.hpp
new file mode 100644
index 00000000000..778d0fa3acf
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_socket_recvmsg_op.hpp
@@ -0,0 +1,192 @@
+//
+// detail/io_uring_socket_recvmsg_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SOCKET_RECVMSG_OP_HPP
+#define ASIO_DETAIL_IO_URING_SOCKET_RECVMSG_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/socket_ops.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename MutableBufferSequence>
+class io_uring_socket_recvmsg_op_base : public io_uring_operation
+{
+public:
+ io_uring_socket_recvmsg_op_base(const asio::error_code& success_ec,
+ socket_type socket, socket_ops::state_type state,
+ const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_socket_recvmsg_op_base::do_prepare,
+ &io_uring_socket_recvmsg_op_base::do_perform, complete_func),
+ socket_(socket),
+ state_(state),
+ buffers_(buffers),
+ in_flags_(in_flags),
+ out_flags_(out_flags),
+ bufs_(buffers),
+ msghdr_()
+ {
+ msghdr_.msg_iov = bufs_.buffers();
+ msghdr_.msg_iovlen = static_cast<int>(bufs_.count());
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_recvmsg_op_base* o(
+ static_cast<io_uring_socket_recvmsg_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ bool except_op = (o->in_flags_ & socket_base::message_out_of_band) != 0;
+ ::io_uring_prep_poll_add(sqe, o->socket_, except_op ? POLLPRI : POLLIN);
+ }
+ else
+ {
+ ::io_uring_prep_recvmsg(sqe, o->socket_, &o->msghdr_, o->in_flags_);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_recvmsg_op_base* o(
+ static_cast<io_uring_socket_recvmsg_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ bool except_op = (o->in_flags_ & socket_base::message_out_of_band) != 0;
+ if (after_completion || !except_op)
+ {
+ return socket_ops::non_blocking_recvmsg(o->socket_,
+ o->bufs_.buffers(), o->bufs_.count(), o->in_flags_,
+ o->out_flags_, o->ec_, o->bytes_transferred_);
+ }
+ }
+ else if (after_completion)
+ {
+ if (!o->ec_)
+ o->out_flags_ = o->msghdr_.msg_flags;
+ else
+ o->out_flags_ = 0;
+ }
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= socket_ops::internal_non_blocking;
+ return false;
+ }
+
+ return after_completion;
+ }
+
+private:
+ socket_type socket_;
+ socket_ops::state_type state_;
+ MutableBufferSequence buffers_;
+ socket_base::message_flags in_flags_;
+ socket_base::message_flags& out_flags_;
+ buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs_;
+ msghdr msghdr_;
+};
+
+template <typename MutableBufferSequence, typename Handler, typename IoExecutor>
+class io_uring_socket_recvmsg_op
+ : public io_uring_socket_recvmsg_op_base<MutableBufferSequence>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_socket_recvmsg_op);
+
+ io_uring_socket_recvmsg_op(const asio::error_code& success_ec,
+ int socket, socket_ops::state_type state,
+ const MutableBufferSequence& buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags,
+ Handler& handler, const IoExecutor& io_ex)
+ : io_uring_socket_recvmsg_op_base<MutableBufferSequence>(success_ec,
+ socket, state, buffers, in_flags, out_flags,
+ &io_uring_socket_recvmsg_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_recvmsg_op* o
+ (static_cast<io_uring_socket_recvmsg_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SOCKET_RECVMSG_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_socket_send_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_socket_send_op.hpp
new file mode 100644
index 00000000000..2f57dae920d
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_socket_send_op.hpp
@@ -0,0 +1,191 @@
+//
+// detail/io_uring_socket_send_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SOCKET_SEND_OP_HPP
+#define ASIO_DETAIL_IO_URING_SOCKET_SEND_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/socket_ops.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename ConstBufferSequence>
+class io_uring_socket_send_op_base : public io_uring_operation
+{
+public:
+ io_uring_socket_send_op_base(const asio::error_code& success_ec,
+ socket_type socket, socket_ops::state_type state,
+ const ConstBufferSequence& buffers,
+ socket_base::message_flags flags, func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_socket_send_op_base::do_prepare,
+ &io_uring_socket_send_op_base::do_perform, complete_func),
+ socket_(socket),
+ state_(state),
+ buffers_(buffers),
+ flags_(flags),
+ bufs_(buffers),
+ msghdr_()
+ {
+ msghdr_.msg_iov = bufs_.buffers();
+ msghdr_.msg_iovlen = static_cast<int>(bufs_.count());
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_send_op_base* o(
+ static_cast<io_uring_socket_send_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ ::io_uring_prep_poll_add(sqe, o->socket_, POLLOUT);
+ }
+ else if (o->bufs_.is_single_buffer
+ && o->bufs_.is_registered_buffer && o->flags_ == 0)
+ {
+ ::io_uring_prep_write_fixed(sqe, o->socket_,
+ o->bufs_.buffers()->iov_base, o->bufs_.buffers()->iov_len,
+ 0, o->bufs_.registered_id().native_handle());
+ }
+ else
+ {
+ ::io_uring_prep_sendmsg(sqe, o->socket_, &o->msghdr_, o->flags_);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_send_op_base* o(
+ static_cast<io_uring_socket_send_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ if (o->bufs_.is_single_buffer)
+ {
+ return socket_ops::non_blocking_send1(o->socket_,
+ o->bufs_.first(o->buffers_).data(),
+ o->bufs_.first(o->buffers_).size(), o->flags_,
+ o->ec_, o->bytes_transferred_);
+ }
+ else
+ {
+ return socket_ops::non_blocking_send(o->socket_,
+ o->bufs_.buffers(), o->bufs_.count(), o->flags_,
+ o->ec_, o->bytes_transferred_);
+ }
+ }
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= socket_ops::internal_non_blocking;
+ return false;
+ }
+
+ return after_completion;
+ }
+
+private:
+ socket_type socket_;
+ socket_ops::state_type state_;
+ ConstBufferSequence buffers_;
+ socket_base::message_flags flags_;
+ buffer_sequence_adapter<asio::const_buffer, ConstBufferSequence> bufs_;
+ msghdr msghdr_;
+};
+
+template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+class io_uring_socket_send_op
+ : public io_uring_socket_send_op_base<ConstBufferSequence>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_socket_send_op);
+
+ io_uring_socket_send_op(const asio::error_code& success_ec,
+ int socket, socket_ops::state_type state,
+ const ConstBufferSequence& buffers, socket_base::message_flags flags,
+ Handler& handler, const IoExecutor& io_ex)
+ : io_uring_socket_send_op_base<ConstBufferSequence>(success_ec,
+ socket, state, buffers, flags, &io_uring_socket_send_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_send_op* o
+ (static_cast<io_uring_socket_send_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SOCKET_SEND_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_socket_sendto_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_socket_sendto_op.hpp
new file mode 100644
index 00000000000..1866938a4b4
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_socket_sendto_op.hpp
@@ -0,0 +1,194 @@
+//
+// detail/io_uring_socket_sendto_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SOCKET_SENDTO_OP_HPP
+#define ASIO_DETAIL_IO_URING_SOCKET_SENDTO_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/socket_ops.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename ConstBufferSequence, typename Endpoint>
+class io_uring_socket_sendto_op_base : public io_uring_operation
+{
+public:
+ io_uring_socket_sendto_op_base(const asio::error_code& success_ec,
+ socket_type socket, socket_ops::state_type state,
+ const ConstBufferSequence& buffers, const Endpoint& endpoint,
+ socket_base::message_flags flags, func_type complete_func)
+ : io_uring_operation(success_ec,
+ &io_uring_socket_sendto_op_base::do_prepare,
+ &io_uring_socket_sendto_op_base::do_perform, complete_func),
+ socket_(socket),
+ state_(state),
+ buffers_(buffers),
+ destination_(endpoint),
+ flags_(flags),
+ bufs_(buffers),
+ msghdr_()
+ {
+ msghdr_.msg_iov = bufs_.buffers();
+ msghdr_.msg_iovlen = static_cast<int>(bufs_.count());
+ msghdr_.msg_name = static_cast<sockaddr*>(
+ static_cast<void*>(destination_.data()));
+ msghdr_.msg_namelen = destination_.size();
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_sendto_op_base* o(
+ static_cast<io_uring_socket_sendto_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ ::io_uring_prep_poll_add(sqe, o->socket_, POLLOUT);
+ }
+ else
+ {
+ ::io_uring_prep_sendmsg(sqe, o->socket_, &o->msghdr_, o->flags_);
+ }
+ }
+
+ static bool do_perform(io_uring_operation* base, bool after_completion)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_sendto_op_base* o(
+ static_cast<io_uring_socket_sendto_op_base*>(base));
+
+ if ((o->state_ & socket_ops::internal_non_blocking) != 0)
+ {
+ if (o->bufs_.is_single_buffer)
+ {
+ return socket_ops::non_blocking_sendto1(o->socket_,
+ o->bufs_.first(o->buffers_).data(),
+ o->bufs_.first(o->buffers_).size(), o->flags_,
+ o->destination_.data(), o->destination_.size(),
+ o->ec_, o->bytes_transferred_);
+ }
+ else
+ {
+ return socket_ops::non_blocking_sendto(o->socket_,
+ o->bufs_.buffers(), o->bufs_.count(), o->flags_,
+ o->destination_.data(), o->destination_.size(),
+ o->ec_, o->bytes_transferred_);
+ }
+ }
+
+ if (o->ec_ && o->ec_ == asio::error::would_block)
+ {
+ o->state_ |= socket_ops::internal_non_blocking;
+ return false;
+ }
+
+ return after_completion;
+ }
+
+private:
+ socket_type socket_;
+ socket_ops::state_type state_;
+ ConstBufferSequence buffers_;
+ Endpoint destination_;
+ socket_base::message_flags flags_;
+ buffer_sequence_adapter<asio::const_buffer, ConstBufferSequence> bufs_;
+ msghdr msghdr_;
+};
+
+template <typename ConstBufferSequence, typename Endpoint,
+ typename Handler, typename IoExecutor>
+class io_uring_socket_sendto_op
+ : public io_uring_socket_sendto_op_base<ConstBufferSequence, Endpoint>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_socket_sendto_op);
+
+ io_uring_socket_sendto_op(const asio::error_code& success_ec,
+ int socket, socket_ops::state_type state,
+ const ConstBufferSequence& buffers, const Endpoint& endpoint,
+ socket_base::message_flags flags,
+ Handler& handler, const IoExecutor& io_ex)
+ : io_uring_socket_sendto_op_base<ConstBufferSequence, Endpoint>(
+ success_ec, socket, state, buffers, endpoint, flags,
+ &io_uring_socket_sendto_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_socket_sendto_op* o
+ (static_cast<io_uring_socket_sendto_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SOCKET_SENDTO_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_socket_service.hpp b/3rdparty/asio/include/asio/detail/io_uring_socket_service.hpp
new file mode 100644
index 00000000000..3daa22ef797
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_socket_service.hpp
@@ -0,0 +1,629 @@
+//
+// detail/io_uring_socket_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SOCKET_SERVICE_HPP
+#define ASIO_DETAIL_IO_URING_SOCKET_SERVICE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/buffer.hpp"
+#include "asio/error.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/socket_base.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/memory.hpp"
+#include "asio/detail/noncopyable.hpp"
+#include "asio/detail/io_uring_null_buffers_op.hpp"
+#include "asio/detail/io_uring_service.hpp"
+#include "asio/detail/io_uring_socket_accept_op.hpp"
+#include "asio/detail/io_uring_socket_connect_op.hpp"
+#include "asio/detail/io_uring_socket_recvfrom_op.hpp"
+#include "asio/detail/io_uring_socket_sendto_op.hpp"
+#include "asio/detail/io_uring_socket_service_base.hpp"
+#include "asio/detail/socket_holder.hpp"
+#include "asio/detail/socket_ops.hpp"
+#include "asio/detail/socket_types.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename Protocol>
+class io_uring_socket_service :
+ public execution_context_service_base<io_uring_socket_service<Protocol>>,
+ public io_uring_socket_service_base
+{
+public:
+ // The protocol type.
+ typedef Protocol protocol_type;
+
+ // The endpoint type.
+ typedef typename Protocol::endpoint endpoint_type;
+
+ // The native type of a socket.
+ typedef socket_type native_handle_type;
+
+ // The implementation type of the socket.
+ struct implementation_type :
+ io_uring_socket_service_base::base_implementation_type
+ {
+ // Default constructor.
+ implementation_type()
+ : protocol_(endpoint_type().protocol())
+ {
+ }
+
+ // The protocol associated with the socket.
+ protocol_type protocol_;
+ };
+
+ // Constructor.
+ io_uring_socket_service(execution_context& context)
+ : execution_context_service_base<
+ io_uring_socket_service<Protocol>>(context),
+ io_uring_socket_service_base(context)
+ {
+ }
+
+ // Destroy all user-defined handler objects owned by the service.
+ void shutdown()
+ {
+ this->base_shutdown();
+ }
+
+ // Move-construct a new socket implementation.
+ void move_construct(implementation_type& impl,
+ implementation_type& other_impl) noexcept
+ {
+ this->base_move_construct(impl, other_impl);
+
+ impl.protocol_ = other_impl.protocol_;
+ other_impl.protocol_ = endpoint_type().protocol();
+ }
+
+ // Move-assign from another socket implementation.
+ void move_assign(implementation_type& impl,
+ io_uring_socket_service_base& other_service,
+ implementation_type& other_impl)
+ {
+ this->base_move_assign(impl, other_service, other_impl);
+
+ impl.protocol_ = other_impl.protocol_;
+ other_impl.protocol_ = endpoint_type().protocol();
+ }
+
+ // Move-construct a new socket implementation from another protocol type.
+ template <typename Protocol1>
+ void converting_move_construct(implementation_type& impl,
+ io_uring_socket_service<Protocol1>&,
+ typename io_uring_socket_service<
+ Protocol1>::implementation_type& other_impl)
+ {
+ this->base_move_construct(impl, other_impl);
+
+ impl.protocol_ = protocol_type(other_impl.protocol_);
+ other_impl.protocol_ = typename Protocol1::endpoint().protocol();
+ }
+
+ // Open a new socket implementation.
+ asio::error_code open(implementation_type& impl,
+ const protocol_type& protocol, asio::error_code& ec)
+ {
+ if (!do_open(impl, protocol.family(),
+ protocol.type(), protocol.protocol(), ec))
+ impl.protocol_ = protocol;
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Assign a native socket to a socket implementation.
+ asio::error_code assign(implementation_type& impl,
+ const protocol_type& protocol, const native_handle_type& native_socket,
+ asio::error_code& ec)
+ {
+ if (!do_assign(impl, protocol.type(), native_socket, ec))
+ impl.protocol_ = protocol;
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Get the native socket representation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return impl.socket_;
+ }
+
+ // Bind the socket to the specified local endpoint.
+ asio::error_code bind(implementation_type& impl,
+ const endpoint_type& endpoint, asio::error_code& ec)
+ {
+ socket_ops::bind(impl.socket_, endpoint.data(), endpoint.size(), ec);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Set a socket option.
+ template <typename Option>
+ asio::error_code set_option(implementation_type& impl,
+ const Option& option, asio::error_code& ec)
+ {
+ socket_ops::setsockopt(impl.socket_, impl.state_,
+ option.level(impl.protocol_), option.name(impl.protocol_),
+ option.data(impl.protocol_), option.size(impl.protocol_), ec);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Set a socket option.
+ template <typename Option>
+ asio::error_code get_option(const implementation_type& impl,
+ Option& option, asio::error_code& ec) const
+ {
+ std::size_t size = option.size(impl.protocol_);
+ socket_ops::getsockopt(impl.socket_, impl.state_,
+ option.level(impl.protocol_), option.name(impl.protocol_),
+ option.data(impl.protocol_), &size, ec);
+ if (!ec)
+ option.resize(impl.protocol_, size);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Get the local endpoint.
+ endpoint_type local_endpoint(const implementation_type& impl,
+ asio::error_code& ec) const
+ {
+ endpoint_type endpoint;
+ std::size_t addr_len = endpoint.capacity();
+ if (socket_ops::getsockname(impl.socket_, endpoint.data(), &addr_len, ec))
+ {
+ ASIO_ERROR_LOCATION(ec);
+ return endpoint_type();
+ }
+ endpoint.resize(addr_len);
+ return endpoint;
+ }
+
+ // Get the remote endpoint.
+ endpoint_type remote_endpoint(const implementation_type& impl,
+ asio::error_code& ec) const
+ {
+ endpoint_type endpoint;
+ std::size_t addr_len = endpoint.capacity();
+ if (socket_ops::getpeername(impl.socket_,
+ endpoint.data(), &addr_len, false, ec))
+ {
+ ASIO_ERROR_LOCATION(ec);
+ return endpoint_type();
+ }
+ endpoint.resize(addr_len);
+ return endpoint;
+ }
+
+ // Disable sends or receives on the socket.
+ asio::error_code shutdown(base_implementation_type& impl,
+ socket_base::shutdown_type what, asio::error_code& ec)
+ {
+ socket_ops::shutdown(impl.socket_, what, ec);
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Send a datagram to the specified endpoint. Returns the number of bytes
+ // sent.
+ template <typename ConstBufferSequence>
+ size_t send_to(implementation_type& impl, const ConstBufferSequence& buffers,
+ const endpoint_type& destination, socket_base::message_flags flags,
+ asio::error_code& ec)
+ {
+ typedef buffer_sequence_adapter<asio::const_buffer,
+ ConstBufferSequence> bufs_type;
+
+ size_t n;
+ if (bufs_type::is_single_buffer)
+ {
+ n = socket_ops::sync_sendto1(impl.socket_, impl.state_,
+ bufs_type::first(buffers).data(),
+ bufs_type::first(buffers).size(), flags,
+ destination.data(), destination.size(), ec);
+ }
+ else
+ {
+ bufs_type bufs(buffers);
+ n = socket_ops::sync_sendto(impl.socket_, impl.state_,
+ bufs.buffers(), bufs.count(), flags,
+ destination.data(), destination.size(), ec);
+ }
+
+ ASIO_ERROR_LOCATION(ec);
+ return n;
+ }
+
+ // Wait until data can be sent without blocking.
+ size_t send_to(implementation_type& impl, const null_buffers&,
+ const endpoint_type&, socket_base::message_flags,
+ asio::error_code& ec)
+ {
+ // Wait for socket to become ready.
+ socket_ops::poll_write(impl.socket_, impl.state_, -1, ec);
+ ASIO_ERROR_LOCATION(ec);
+ return 0;
+ }
+
+ // Start an asynchronous send. The data being sent must be valid for the
+ // lifetime of the asynchronous operation.
+ template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+ void async_send_to(implementation_type& impl,
+ const ConstBufferSequence& buffers,
+ const endpoint_type& destination, socket_base::message_flags flags,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_socket_sendto_op<ConstBufferSequence,
+ endpoint_type, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_,
+ buffers, destination, flags, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::write_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_send_to"));
+
+ start_op(impl, io_uring_service::write_op, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Start an asynchronous wait until data can be sent without blocking.
+ template <typename Handler, typename IoExecutor>
+ void async_send_to(implementation_type& impl, const null_buffers&,
+ const endpoint_type&, socket_base::message_flags,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_null_buffers_op<Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_, POLLOUT, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::write_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p, "socket",
+ &impl, impl.socket_, "async_send_to(null_buffers)"));
+
+ start_op(impl, io_uring_service::write_op, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Receive a datagram with the endpoint of the sender. Returns the number of
+ // bytes received.
+ template <typename MutableBufferSequence>
+ size_t receive_from(implementation_type& impl,
+ const MutableBufferSequence& buffers,
+ endpoint_type& sender_endpoint, socket_base::message_flags flags,
+ asio::error_code& ec)
+ {
+ typedef buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs_type;
+
+ std::size_t addr_len = sender_endpoint.capacity();
+ std::size_t n;
+ if (bufs_type::is_single_buffer)
+ {
+ n = socket_ops::sync_recvfrom1(impl.socket_, impl.state_,
+ bufs_type::first(buffers).data(), bufs_type::first(buffers).size(),
+ flags, sender_endpoint.data(), &addr_len, ec);
+ }
+ else
+ {
+ bufs_type bufs(buffers);
+ n = socket_ops::sync_recvfrom(impl.socket_, impl.state_, bufs.buffers(),
+ bufs.count(), flags, sender_endpoint.data(), &addr_len, ec);
+ }
+
+ if (!ec)
+ sender_endpoint.resize(addr_len);
+
+ ASIO_ERROR_LOCATION(ec);
+ return n;
+ }
+
+ // Wait until data can be received without blocking.
+ size_t receive_from(implementation_type& impl, const null_buffers&,
+ endpoint_type& sender_endpoint, socket_base::message_flags,
+ asio::error_code& ec)
+ {
+ // Wait for socket to become ready.
+ socket_ops::poll_read(impl.socket_, impl.state_, -1, ec);
+
+ // Reset endpoint since it can be given no sensible value at this time.
+ sender_endpoint = endpoint_type();
+
+ ASIO_ERROR_LOCATION(ec);
+ return 0;
+ }
+
+ // Start an asynchronous receive. The buffer for the data being received and
+ // the sender_endpoint object must both be valid for the lifetime of the
+ // asynchronous operation.
+ template <typename MutableBufferSequence,
+ typename Handler, typename IoExecutor>
+ void async_receive_from(implementation_type& impl,
+ const MutableBufferSequence& buffers, endpoint_type& sender_endpoint,
+ socket_base::message_flags flags, Handler& handler,
+ const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ int op_type = (flags & socket_base::message_out_of_band)
+ ? io_uring_service::except_op : io_uring_service::read_op;
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_socket_recvfrom_op<MutableBufferSequence,
+ endpoint_type, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_,
+ buffers, sender_endpoint, flags, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(
+ &io_uring_service_, &impl.io_object_data_, op_type);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_receive_from"));
+
+ start_op(impl, op_type, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Wait until data can be received without blocking.
+ template <typename Handler, typename IoExecutor>
+ void async_receive_from(implementation_type& impl, const null_buffers&,
+ endpoint_type& sender_endpoint, socket_base::message_flags flags,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ int op_type;
+ int poll_flags;
+ if ((flags & socket_base::message_out_of_band) != 0)
+ {
+ op_type = io_uring_service::except_op;
+ poll_flags = POLLPRI;
+ }
+ else
+ {
+ op_type = io_uring_service::read_op;
+ poll_flags = POLLIN;
+ }
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_null_buffers_op<Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_, poll_flags, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(
+ &io_uring_service_, &impl.io_object_data_, op_type);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p, "socket",
+ &impl, impl.socket_, "async_receive_from(null_buffers)"));
+
+ // Reset endpoint since it can be given no sensible value at this time.
+ sender_endpoint = endpoint_type();
+
+ start_op(impl, op_type, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Accept a new connection.
+ template <typename Socket>
+ asio::error_code accept(implementation_type& impl,
+ Socket& peer, endpoint_type* peer_endpoint, asio::error_code& ec)
+ {
+ // We cannot accept a socket that is already open.
+ if (peer.is_open())
+ {
+ ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ std::size_t addr_len = peer_endpoint ? peer_endpoint->capacity() : 0;
+ socket_holder new_socket(socket_ops::sync_accept(impl.socket_,
+ impl.state_, peer_endpoint ? peer_endpoint->data() : 0,
+ peer_endpoint ? &addr_len : 0, ec));
+
+ // On success, assign new connection to peer socket object.
+ if (new_socket.get() != invalid_socket)
+ {
+ if (peer_endpoint)
+ peer_endpoint->resize(addr_len);
+ peer.assign(impl.protocol_, new_socket.get(), ec);
+ if (!ec)
+ new_socket.release();
+ }
+
+ ASIO_ERROR_LOCATION(ec);
+ return ec;
+ }
+
+ // Start an asynchronous accept. The peer and peer_endpoint objects must be
+ // valid until the accept's handler is invoked.
+ template <typename Socket, typename Handler, typename IoExecutor>
+ void async_accept(implementation_type& impl, Socket& peer,
+ endpoint_type* peer_endpoint, Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_socket_accept_op<Socket, Protocol, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_,
+ peer, impl.protocol_, peer_endpoint, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected() && !peer.is_open())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::read_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_accept"));
+
+ start_accept_op(impl, p.p, is_continuation, peer.is_open());
+ p.v = p.p = 0;
+ }
+
+ // Start an asynchronous accept. The peer_endpoint object must be valid until
+ // the accept's handler is invoked.
+ template <typename PeerIoExecutor, typename Handler, typename IoExecutor>
+ void async_move_accept(implementation_type& impl,
+ const PeerIoExecutor& peer_io_ex, endpoint_type* peer_endpoint,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_socket_move_accept_op<Protocol,
+ PeerIoExecutor, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, peer_io_ex, impl.socket_,
+ impl.state_, impl.protocol_, peer_endpoint, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::read_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_accept"));
+
+ start_accept_op(impl, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Connect the socket to the specified endpoint.
+ asio::error_code connect(implementation_type& impl,
+ const endpoint_type& peer_endpoint, asio::error_code& ec)
+ {
+ socket_ops::sync_connect(impl.socket_,
+ peer_endpoint.data(), peer_endpoint.size(), ec);
+ return ec;
+ }
+
+ // Start an asynchronous connect.
+ template <typename Handler, typename IoExecutor>
+ void async_connect(implementation_type& impl,
+ const endpoint_type& peer_endpoint,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_socket_connect_op<Protocol, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_,
+ peer_endpoint, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::write_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_connect"));
+
+ start_op(impl, io_uring_service::write_op, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SOCKET_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_socket_service_base.hpp b/3rdparty/asio/include/asio/detail/io_uring_socket_service_base.hpp
new file mode 100644
index 00000000000..99b075c9fe5
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_socket_service_base.hpp
@@ -0,0 +1,663 @@
+//
+// detail/io_uring_socket_service_base.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_SOCKET_SERVICE_BASE_HPP
+#define ASIO_DETAIL_IO_URING_SOCKET_SERVICE_BASE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IO_URING)
+
+#include "asio/associated_cancellation_slot.hpp"
+#include "asio/buffer.hpp"
+#include "asio/cancellation_type.hpp"
+#include "asio/error.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/socket_base.hpp"
+#include "asio/detail/buffer_sequence_adapter.hpp"
+#include "asio/detail/memory.hpp"
+#include "asio/detail/io_uring_null_buffers_op.hpp"
+#include "asio/detail/io_uring_service.hpp"
+#include "asio/detail/io_uring_socket_recv_op.hpp"
+#include "asio/detail/io_uring_socket_recvmsg_op.hpp"
+#include "asio/detail/io_uring_socket_send_op.hpp"
+#include "asio/detail/io_uring_wait_op.hpp"
+#include "asio/detail/socket_holder.hpp"
+#include "asio/detail/socket_ops.hpp"
+#include "asio/detail/socket_types.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class io_uring_socket_service_base
+{
+public:
+ // The native type of a socket.
+ typedef socket_type native_handle_type;
+
+ // The implementation type of the socket.
+ struct base_implementation_type
+ {
+ // The native socket representation.
+ socket_type socket_;
+
+ // The current state of the socket.
+ socket_ops::state_type state_;
+
+ // Per I/O object data used by the io_uring_service.
+ io_uring_service::per_io_object_data io_object_data_;
+ };
+
+ // Constructor.
+ ASIO_DECL io_uring_socket_service_base(execution_context& context);
+
+ // Destroy all user-defined handler objects owned by the service.
+ ASIO_DECL void base_shutdown();
+
+ // Construct a new socket implementation.
+ ASIO_DECL void construct(base_implementation_type& impl);
+
+ // Move-construct a new socket implementation.
+ ASIO_DECL void base_move_construct(base_implementation_type& impl,
+ base_implementation_type& other_impl) noexcept;
+
+ // Move-assign from another socket implementation.
+ ASIO_DECL void base_move_assign(base_implementation_type& impl,
+ io_uring_socket_service_base& other_service,
+ base_implementation_type& other_impl);
+
+ // Destroy a socket implementation.
+ ASIO_DECL void destroy(base_implementation_type& impl);
+
+ // Determine whether the socket is open.
+ bool is_open(const base_implementation_type& impl) const
+ {
+ return impl.socket_ != invalid_socket;
+ }
+
+ // Destroy a socket implementation.
+ ASIO_DECL asio::error_code close(
+ base_implementation_type& impl, asio::error_code& ec);
+
+ // Release ownership of the socket.
+ ASIO_DECL socket_type release(
+ base_implementation_type& impl, asio::error_code& ec);
+
+ // Get the native socket representation.
+ native_handle_type native_handle(base_implementation_type& impl)
+ {
+ return impl.socket_;
+ }
+
+ // Cancel all operations associated with the socket.
+ ASIO_DECL asio::error_code cancel(
+ base_implementation_type& impl, asio::error_code& ec);
+
+ // Determine whether the socket is at the out-of-band data mark.
+ bool at_mark(const base_implementation_type& impl,
+ asio::error_code& ec) const
+ {
+ return socket_ops::sockatmark(impl.socket_, ec);
+ }
+
+ // Determine the number of bytes available for reading.
+ std::size_t available(const base_implementation_type& impl,
+ asio::error_code& ec) const
+ {
+ return socket_ops::available(impl.socket_, ec);
+ }
+
+ // Place the socket into the state where it will listen for new connections.
+ asio::error_code listen(base_implementation_type& impl,
+ int backlog, asio::error_code& ec)
+ {
+ socket_ops::listen(impl.socket_, backlog, ec);
+ return ec;
+ }
+
+ // Perform an IO control command on the socket.
+ template <typename IO_Control_Command>
+ asio::error_code io_control(base_implementation_type& impl,
+ IO_Control_Command& command, asio::error_code& ec)
+ {
+ socket_ops::ioctl(impl.socket_, impl.state_, command.name(),
+ static_cast<ioctl_arg_type*>(command.data()), ec);
+ return ec;
+ }
+
+ // Gets the non-blocking mode of the socket.
+ bool non_blocking(const base_implementation_type& impl) const
+ {
+ return (impl.state_ & socket_ops::user_set_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the socket.
+ asio::error_code non_blocking(base_implementation_type& impl,
+ bool mode, asio::error_code& ec)
+ {
+ socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec);
+ return ec;
+ }
+
+ // Gets the non-blocking mode of the native socket implementation.
+ bool native_non_blocking(const base_implementation_type& impl) const
+ {
+ return (impl.state_ & socket_ops::internal_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the native socket implementation.
+ asio::error_code native_non_blocking(base_implementation_type& impl,
+ bool mode, asio::error_code& ec)
+ {
+ socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec);
+ return ec;
+ }
+
+ // Wait for the socket to become ready to read, ready to write, or to have
+ // pending error conditions.
+ asio::error_code wait(base_implementation_type& impl,
+ socket_base::wait_type w, asio::error_code& ec)
+ {
+ switch (w)
+ {
+ case socket_base::wait_read:
+ socket_ops::poll_read(impl.socket_, impl.state_, -1, ec);
+ break;
+ case socket_base::wait_write:
+ socket_ops::poll_write(impl.socket_, impl.state_, -1, ec);
+ break;
+ case socket_base::wait_error:
+ socket_ops::poll_error(impl.socket_, impl.state_, -1, ec);
+ break;
+ default:
+ ec = asio::error::invalid_argument;
+ break;
+ }
+
+ return ec;
+ }
+
+ // Asynchronously wait for the socket to become ready to read, ready to
+ // write, or to have pending error conditions.
+ template <typename Handler, typename IoExecutor>
+ void async_wait(base_implementation_type& impl,
+ socket_base::wait_type w, Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ int op_type;
+ int poll_flags;
+ switch (w)
+ {
+ case socket_base::wait_read:
+ op_type = io_uring_service::read_op;
+ poll_flags = POLLIN;
+ break;
+ case socket_base::wait_write:
+ op_type = io_uring_service::write_op;
+ poll_flags = POLLOUT;
+ break;
+ case socket_base::wait_error:
+ op_type = io_uring_service::except_op;
+ poll_flags = POLLPRI | POLLERR | POLLHUP;
+ break;
+ default:
+ op_type = -1;
+ poll_flags = -1;
+ return;
+ }
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_wait_op<Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_,
+ poll_flags, handler, io_ex);
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_wait"));
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(
+ &io_uring_service_, &impl.io_object_data_, op_type);
+ }
+
+ start_op(impl, op_type, p.p, is_continuation, op_type == -1);
+ p.v = p.p = 0;
+ }
+
+ // Send the given data to the peer.
+ template <typename ConstBufferSequence>
+ size_t send(base_implementation_type& impl,
+ const ConstBufferSequence& buffers,
+ socket_base::message_flags flags, asio::error_code& ec)
+ {
+ typedef buffer_sequence_adapter<asio::const_buffer,
+ ConstBufferSequence> bufs_type;
+
+ if (bufs_type::is_single_buffer)
+ {
+ return socket_ops::sync_send1(impl.socket_,
+ impl.state_, bufs_type::first(buffers).data(),
+ bufs_type::first(buffers).size(), flags, ec);
+ }
+ else
+ {
+ bufs_type bufs(buffers);
+ return socket_ops::sync_send(impl.socket_, impl.state_,
+ bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec);
+ }
+ }
+
+ // Wait until data can be sent without blocking.
+ size_t send(base_implementation_type& impl, const null_buffers&,
+ socket_base::message_flags, asio::error_code& ec)
+ {
+ // Wait for socket to become ready.
+ socket_ops::poll_write(impl.socket_, impl.state_, -1, ec);
+
+ return 0;
+ }
+
+ // Start an asynchronous send. The data being sent must be valid for the
+ // lifetime of the asynchronous operation.
+ template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+ void async_send(base_implementation_type& impl,
+ const ConstBufferSequence& buffers, socket_base::message_flags flags,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_socket_send_op<
+ ConstBufferSequence, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_,
+ impl.state_, buffers, flags, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::write_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_send"));
+
+ start_op(impl, io_uring_service::write_op, p.p, is_continuation,
+ ((impl.state_ & socket_ops::stream_oriented)
+ && buffer_sequence_adapter<asio::const_buffer,
+ ConstBufferSequence>::all_empty(buffers)));
+ p.v = p.p = 0;
+ }
+
+ // Start an asynchronous wait until data can be sent without blocking.
+ template <typename Handler, typename IoExecutor>
+ void async_send(base_implementation_type& impl, const null_buffers&,
+ socket_base::message_flags, Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_null_buffers_op<Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_, POLLOUT, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(&io_uring_service_,
+ &impl.io_object_data_, io_uring_service::write_op);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_send(null_buffers)"));
+
+ start_op(impl, io_uring_service::write_op, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Receive some data from the peer. Returns the number of bytes received.
+ template <typename MutableBufferSequence>
+ size_t receive(base_implementation_type& impl,
+ const MutableBufferSequence& buffers,
+ socket_base::message_flags flags, asio::error_code& ec)
+ {
+ typedef buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs_type;
+
+ if (bufs_type::is_single_buffer)
+ {
+ return socket_ops::sync_recv1(impl.socket_,
+ impl.state_, bufs_type::first(buffers).data(),
+ bufs_type::first(buffers).size(), flags, ec);
+ }
+ else
+ {
+ bufs_type bufs(buffers);
+ return socket_ops::sync_recv(impl.socket_, impl.state_,
+ bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec);
+ }
+ }
+
+ // Wait until data can be received without blocking.
+ size_t receive(base_implementation_type& impl, const null_buffers&,
+ socket_base::message_flags, asio::error_code& ec)
+ {
+ // Wait for socket to become ready.
+ socket_ops::poll_read(impl.socket_, impl.state_, -1, ec);
+
+ return 0;
+ }
+
+ // Start an asynchronous receive. The buffer for the data being received
+ // must be valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence,
+ typename Handler, typename IoExecutor>
+ void async_receive(base_implementation_type& impl,
+ const MutableBufferSequence& buffers, socket_base::message_flags flags,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ int op_type = (flags & socket_base::message_out_of_band)
+ ? io_uring_service::except_op : io_uring_service::read_op;
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_socket_recv_op<
+ MutableBufferSequence, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_,
+ impl.state_, buffers, flags, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(
+ &io_uring_service_, &impl.io_object_data_, op_type);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_receive"));
+
+ start_op(impl, op_type, p.p, is_continuation,
+ ((impl.state_ & socket_ops::stream_oriented)
+ && buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence>::all_empty(buffers)));
+ p.v = p.p = 0;
+ }
+
+ // Wait until data can be received without blocking.
+ template <typename Handler, typename IoExecutor>
+ void async_receive(base_implementation_type& impl,
+ const null_buffers&, socket_base::message_flags flags,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ int op_type;
+ int poll_flags;
+ if ((flags & socket_base::message_out_of_band) != 0)
+ {
+ op_type = io_uring_service::except_op;
+ poll_flags = POLLPRI;
+ }
+ else
+ {
+ op_type = io_uring_service::read_op;
+ poll_flags = POLLIN;
+ }
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_null_buffers_op<Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_, poll_flags, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(
+ &io_uring_service_, &impl.io_object_data_, op_type);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_receive(null_buffers)"));
+
+ start_op(impl, op_type, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Receive some data with associated flags. Returns the number of bytes
+ // received.
+ template <typename MutableBufferSequence>
+ size_t receive_with_flags(base_implementation_type& impl,
+ const MutableBufferSequence& buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, asio::error_code& ec)
+ {
+ buffer_sequence_adapter<asio::mutable_buffer,
+ MutableBufferSequence> bufs(buffers);
+
+ return socket_ops::sync_recvmsg(impl.socket_, impl.state_,
+ bufs.buffers(), bufs.count(), in_flags, out_flags, ec);
+ }
+
+ // Wait until data can be received without blocking.
+ size_t receive_with_flags(base_implementation_type& impl,
+ const null_buffers&, socket_base::message_flags,
+ socket_base::message_flags& out_flags, asio::error_code& ec)
+ {
+ // Wait for socket to become ready.
+ socket_ops::poll_read(impl.socket_, impl.state_, -1, ec);
+
+ // Clear out_flags, since we cannot give it any other sensible value when
+ // performing a null_buffers operation.
+ out_flags = 0;
+
+ return 0;
+ }
+
+ // Start an asynchronous receive. The buffer for the data being received
+ // must be valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence,
+ typename Handler, typename IoExecutor>
+ void async_receive_with_flags(base_implementation_type& impl,
+ const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, Handler& handler,
+ const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ int op_type = (in_flags & socket_base::message_out_of_band)
+ ? io_uring_service::except_op : io_uring_service::read_op;
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_socket_recvmsg_op<
+ MutableBufferSequence, Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_,
+ buffers, in_flags, out_flags, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(
+ &io_uring_service_, &impl.io_object_data_, op_type);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p,
+ "socket", &impl, impl.socket_, "async_receive_with_flags"));
+
+ start_op(impl, op_type, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+ // Wait until data can be received without blocking.
+ template <typename Handler, typename IoExecutor>
+ void async_receive_with_flags(base_implementation_type& impl,
+ const null_buffers&, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, Handler& handler,
+ const IoExecutor& io_ex)
+ {
+ bool is_continuation =
+ asio_handler_cont_helpers::is_continuation(handler);
+
+ int op_type;
+ int poll_flags;
+ if ((in_flags & socket_base::message_out_of_band) != 0)
+ {
+ op_type = io_uring_service::except_op;
+ poll_flags = POLLPRI;
+ }
+ else
+ {
+ op_type = io_uring_service::read_op;
+ poll_flags = POLLIN;
+ }
+
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef io_uring_null_buffers_op<Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(success_ec_, impl.socket_, poll_flags, handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<io_uring_op_cancellation>(
+ &io_uring_service_, &impl.io_object_data_, op_type);
+ }
+
+ ASIO_HANDLER_CREATION((io_uring_service_.context(), *p.p, "socket",
+ &impl, impl.socket_, "async_receive_with_flags(null_buffers)"));
+
+ // Clear out_flags, since we cannot give it any other sensible value when
+ // performing a null_buffers operation.
+ out_flags = 0;
+
+ start_op(impl, op_type, p.p, is_continuation, false);
+ p.v = p.p = 0;
+ }
+
+protected:
+ // Open a new socket implementation.
+ ASIO_DECL asio::error_code do_open(
+ base_implementation_type& impl, int af,
+ int type, int protocol, asio::error_code& ec);
+
+ // Assign a native socket to a socket implementation.
+ ASIO_DECL asio::error_code do_assign(
+ base_implementation_type& impl, int type,
+ const native_handle_type& native_socket, asio::error_code& ec);
+
+ // Start the asynchronous read or write operation.
+ ASIO_DECL void start_op(base_implementation_type& impl, int op_type,
+ io_uring_operation* op, bool is_continuation, bool noop);
+
+ // Start the asynchronous accept operation.
+ ASIO_DECL void start_accept_op(base_implementation_type& impl,
+ io_uring_operation* op, bool is_continuation, bool peer_is_open);
+
+ // Helper class used to implement per-operation cancellation
+ class io_uring_op_cancellation
+ {
+ public:
+ io_uring_op_cancellation(io_uring_service* s,
+ io_uring_service::per_io_object_data* p, int o)
+ : io_uring_service_(s),
+ io_object_data_(p),
+ op_type_(o)
+ {
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ if (!!(type &
+ (cancellation_type::terminal
+ | cancellation_type::partial
+ | cancellation_type::total)))
+ {
+ io_uring_service_->cancel_ops_by_key(*io_object_data_, op_type_, this);
+ }
+ }
+
+ private:
+ io_uring_service* io_uring_service_;
+ io_uring_service::per_io_object_data* io_object_data_;
+ int op_type_;
+ };
+
+ // The io_uring_service that performs event demultiplexing for the service.
+ io_uring_service& io_uring_service_;
+
+ // Cached success value to avoid accessing category singleton.
+ const asio::error_code success_ec_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#if defined(ASIO_HEADER_ONLY)
+# include "asio/detail/impl/io_uring_socket_service_base.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+
+#endif // defined(ASIO_HAS_IO_URING)
+
+#endif // ASIO_DETAIL_IO_URING_SOCKET_SERVICE_BASE_HPP
diff --git a/3rdparty/asio/include/asio/detail/io_uring_wait_op.hpp b/3rdparty/asio/include/asio/detail/io_uring_wait_op.hpp
new file mode 100644
index 00000000000..4dec72ce42c
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/io_uring_wait_op.hpp
@@ -0,0 +1,112 @@
+//
+// detail/io_uring_wait_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_IO_URING_WAIT_OP_HPP
+#define ASIO_DETAIL_IO_URING_WAIT_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/fenced_block.hpp"
+#include "asio/detail/handler_alloc_helpers.hpp"
+#include "asio/detail/handler_work.hpp"
+#include "asio/detail/io_uring_operation.hpp"
+#include "asio/detail/memory.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+template <typename Handler, typename IoExecutor>
+class io_uring_wait_op : public io_uring_operation
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(io_uring_wait_op);
+
+ io_uring_wait_op(const asio::error_code& success_ec, int descriptor,
+ int poll_flags, Handler& handler, const IoExecutor& io_ex)
+ : io_uring_operation(success_ec, &io_uring_wait_op::do_prepare,
+ &io_uring_wait_op::do_perform, &io_uring_wait_op::do_complete),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex),
+ descriptor_(descriptor),
+ poll_flags_(poll_flags)
+ {
+ }
+
+ static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe)
+ {
+ ASIO_ASSUME(base != 0);
+ io_uring_wait_op* o(static_cast<io_uring_wait_op*>(base));
+
+ ::io_uring_prep_poll_add(sqe, o->descriptor_, o->poll_flags_);
+ }
+
+ static bool do_perform(io_uring_operation*, bool after_completion)
+ {
+ return after_completion;
+ }
+
+ static void do_complete(void* owner, operation* base,
+ const asio::error_code& /*ec*/,
+ std::size_t /*bytes_transferred*/)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ io_uring_wait_op* o(static_cast<io_uring_wait_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder1<Handler, asio::error_code>
+ handler(o->handler_, o->ec_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ fenced_block b(fenced_block::half);
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ handler_work<Handler, IoExecutor> work_;
+ int descriptor_;
+ int poll_flags_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_DETAIL_IO_URING_WAIT_OP_HPP
diff --git a/3rdparty/asio/include/asio/detail/is_buffer_sequence.hpp b/3rdparty/asio/include/asio/detail/is_buffer_sequence.hpp
index e3d8de3d8f6..c64e7b16824 100644
--- a/3rdparty/asio/include/asio/detail/is_buffer_sequence.hpp
+++ b/3rdparty/asio/include/asio/detail/is_buffer_sequence.hpp
@@ -2,7 +2,7 @@
// detail/is_buffer_sequence.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -24,6 +24,8 @@ namespace asio {
class mutable_buffer;
class const_buffer;
+class mutable_registered_buffer;
+class const_registered_buffer;
namespace detail {
@@ -53,53 +55,23 @@ struct buffer_sequence_memfns_check
{
};
-#if defined(ASIO_HAS_DECLTYPE)
-
template <typename>
char buffer_sequence_begin_helper(...);
template <typename T>
char (&buffer_sequence_begin_helper(T* t,
- typename enable_if<!is_same<
+ enable_if_t<!is_same<
decltype(asio::buffer_sequence_begin(*t)),
- void>::value>::type*))[2];
-
-#else // defined(ASIO_HAS_DECLTYPE)
-
-template <typename>
-char (&buffer_sequence_begin_helper(...))[2];
-
-template <typename T>
-char buffer_sequence_begin_helper(T* t,
- buffer_sequence_memfns_check<
- void (buffer_sequence_memfns_base::*)(),
- &buffer_sequence_memfns_derived<T>::begin>*);
-
-#endif // defined(ASIO_HAS_DECLTYPE)
-
-#if defined(ASIO_HAS_DECLTYPE)
+ void>::value>*))[2];
template <typename>
char buffer_sequence_end_helper(...);
template <typename T>
char (&buffer_sequence_end_helper(T* t,
- typename enable_if<!is_same<
+ enable_if_t<!is_same<
decltype(asio::buffer_sequence_end(*t)),
- void>::value>::type*))[2];
-
-#else // defined(ASIO_HAS_DECLTYPE)
-
-template <typename>
-char (&buffer_sequence_end_helper(...))[2];
-
-template <typename T>
-char buffer_sequence_end_helper(T* t,
- buffer_sequence_memfns_check<
- void (buffer_sequence_memfns_base::*)(),
- &buffer_sequence_memfns_derived<T>::end>*);
-
-#endif // defined(ASIO_HAS_DECLTYPE)
+ void>::value>*))[2];
template <typename>
char (&size_memfn_helper(...))[2];
@@ -185,23 +157,11 @@ char shrink_memfn_helper(
template <typename, typename>
char (&buffer_sequence_element_type_helper(...))[2];
-#if defined(ASIO_HAS_DECLTYPE)
-
template <typename T, typename Buffer>
char buffer_sequence_element_type_helper(T* t,
- typename enable_if<is_convertible<
+ enable_if_t<is_convertible<
decltype(*asio::buffer_sequence_begin(*t)),
- Buffer>::value>::type*);
-
-#else // defined(ASIO_HAS_DECLTYPE)
-
-template <typename T, typename Buffer>
-char buffer_sequence_element_type_helper(
- typename T::const_iterator*,
- typename enable_if<is_convertible<
- typename T::value_type, Buffer>::value>::type*);
-
-#endif // defined(ASIO_HAS_DECLTYPE)
+ Buffer>::value>*);
template <typename>
char (&const_buffers_type_typedef_helper(...))[2];
@@ -258,6 +218,30 @@ struct is_buffer_sequence<const_buffer, mutable_buffer>
{
};
+template <>
+struct is_buffer_sequence<mutable_registered_buffer, mutable_buffer>
+ : true_type
+{
+};
+
+template <>
+struct is_buffer_sequence<mutable_registered_buffer, const_buffer>
+ : true_type
+{
+};
+
+template <>
+struct is_buffer_sequence<const_registered_buffer, const_buffer>
+ : true_type
+{
+};
+
+template <>
+struct is_buffer_sequence<const_registered_buffer, mutable_buffer>
+ : false_type
+{
+};
+
template <typename T>
struct is_dynamic_buffer_class_v1
: integral_constant<bool,
diff --git a/3rdparty/asio/include/asio/detail/is_executor.hpp b/3rdparty/asio/include/asio/detail/is_executor.hpp
index a099eecff90..2636f9c66f3 100644
--- a/3rdparty/asio/include/asio/detail/is_executor.hpp
+++ b/3rdparty/asio/include/asio/detail/is_executor.hpp
@@ -2,7 +2,7 @@
// detail/is_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/keyword_tss_ptr.hpp b/3rdparty/asio/include/asio/detail/keyword_tss_ptr.hpp
index 9378af3d45c..2e42df8b358 100644
--- a/3rdparty/asio/include/asio/detail/keyword_tss_ptr.hpp
+++ b/3rdparty/asio/include/asio/detail/keyword_tss_ptr.hpp
@@ -2,7 +2,7 @@
// detail/keyword_tss_ptr.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/kqueue_reactor.hpp b/3rdparty/asio/include/asio/detail/kqueue_reactor.hpp
index 645f1221cd8..f034410d6d5 100644
--- a/3rdparty/asio/include/asio/detail/kqueue_reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/kqueue_reactor.hpp
@@ -2,7 +2,7 @@
// detail/kqueue_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2005 Stefan Arentz (stefan at soze dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -29,6 +29,7 @@
#include "asio/detail/object_pool.hpp"
#include "asio/detail/op_queue.hpp"
#include "asio/detail/reactor_op.hpp"
+#include "asio/detail/scheduler_task.hpp"
#include "asio/detail/select_interrupter.hpp"
#include "asio/detail/socket_types.hpp"
#include "asio/detail/timer_queue_base.hpp"
@@ -50,7 +51,8 @@ namespace detail {
class scheduler;
class kqueue_reactor
- : public execution_context_service_base<kqueue_reactor>
+ : public execution_context_service_base<kqueue_reactor>,
+ public scheduler_task
{
private:
// The mutex type used by this reactor.
@@ -114,13 +116,30 @@ public:
per_descriptor_data& source_descriptor_data);
// Post a reactor operation for immediate completion.
- void post_immediate_completion(operation* op, bool is_continuation);
+ void post_immediate_completion(operation* op, bool is_continuation) const;
+
+ // Post a reactor operation for immediate completion.
+ ASIO_DECL static void call_post_immediate_completion(
+ operation* op, bool is_continuation, const void* self);
// Start a new operation. The reactor operation will be performed when the
// given descriptor is flagged as ready, or an error has occurred.
ASIO_DECL void start_op(int op_type, socket_type descriptor,
per_descriptor_data& descriptor_data, reactor_op* op,
- bool is_continuation, bool allow_speculative);
+ bool is_continuation, bool allow_speculative,
+ void (*on_immediate)(operation*, bool, const void*),
+ const void* immediate_arg);
+
+ // Start a new operation. The reactor operation will be performed when the
+ // given descriptor is flagged as ready, or an error has occurred.
+ void start_op(int op_type, socket_type descriptor,
+ per_descriptor_data& descriptor_data, reactor_op* op,
+ bool is_continuation, bool allow_speculative)
+ {
+ start_op(op_type, descriptor, descriptor_data,
+ op, is_continuation, allow_speculative,
+ &kqueue_reactor::call_post_immediate_completion, this);
+ }
// Cancel all operations associated with the given descriptor. The
// handlers associated with the descriptor will be invoked with the
diff --git a/3rdparty/asio/include/asio/detail/limits.hpp b/3rdparty/asio/include/asio/detail/limits.hpp
index d32470d2d35..323af22b300 100644
--- a/3rdparty/asio/include/asio/detail/limits.hpp
+++ b/3rdparty/asio/include/asio/detail/limits.hpp
@@ -16,11 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_BOOST_LIMITS)
-# include <boost/limits.hpp>
-#else // defined(ASIO_HAS_BOOST_LIMITS)
-# include <limits>
-#endif // defined(ASIO_HAS_BOOST_LIMITS)
+#include <limits>
#endif // ASIO_DETAIL_LIMITS_HPP
diff --git a/3rdparty/asio/include/asio/detail/local_free_on_block_exit.hpp b/3rdparty/asio/include/asio/detail/local_free_on_block_exit.hpp
index 9ca4b3f68ab..212f9c1bcd2 100644
--- a/3rdparty/asio/include/asio/detail/local_free_on_block_exit.hpp
+++ b/3rdparty/asio/include/asio/detail/local_free_on_block_exit.hpp
@@ -2,7 +2,7 @@
// detail/local_free_on_block_exit.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/macos_fenced_block.hpp b/3rdparty/asio/include/asio/detail/macos_fenced_block.hpp
deleted file mode 100644
index 54768e51f51..00000000000
--- a/3rdparty/asio/include/asio/detail/macos_fenced_block.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// detail/macos_fenced_block.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP
-#define ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#if defined(__MACH__) && defined(__APPLE__)
-
-#include <libkern/OSAtomic.h>
-#include "asio/detail/noncopyable.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class macos_fenced_block
- : private noncopyable
-{
-public:
- enum half_t { half };
- enum full_t { full };
-
- // Constructor for a half fenced block.
- explicit macos_fenced_block(half_t)
- {
- }
-
- // Constructor for a full fenced block.
- explicit macos_fenced_block(full_t)
- {
- OSMemoryBarrier();
- }
-
- // Destructor.
- ~macos_fenced_block()
- {
- OSMemoryBarrier();
- }
-};
-
-} // namespace detail
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // defined(__MACH__) && defined(__APPLE__)
-
-#endif // ASIO_DETAIL_MACOS_FENCED_BLOCK_HPP
diff --git a/3rdparty/asio/include/asio/detail/memory.hpp b/3rdparty/asio/include/asio/detail/memory.hpp
index d61dfa5788c..173e49fe065 100644
--- a/3rdparty/asio/include/asio/detail/memory.hpp
+++ b/3rdparty/asio/include/asio/detail/memory.hpp
@@ -2,7 +2,7 @@
// detail/memory.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,48 +20,45 @@
#include <cstdlib>
#include <memory>
#include <new>
+#include "asio/detail/cstdint.hpp"
#include "asio/detail/throw_exception.hpp"
-#if !defined(ASIO_HAS_STD_SHARED_PTR)
-# include <boost/make_shared.hpp>
-# include <boost/shared_ptr.hpp>
-# include <boost/weak_ptr.hpp>
-#endif // !defined(ASIO_HAS_STD_SHARED_PTR)
-
-#if !defined(ASIO_HAS_STD_ADDRESSOF)
-# include <boost/utility/addressof.hpp>
-#endif // !defined(ASIO_HAS_STD_ADDRESSOF)
-
#if !defined(ASIO_HAS_STD_ALIGNED_ALLOC) \
- && defined(ASIO_HAS_BOOST_ALIGN) \
- && defined(ASIO_HAS_ALIGNOF)
+ && defined(ASIO_HAS_BOOST_ALIGN)
# include <boost/align/aligned_alloc.hpp>
#endif // !defined(ASIO_HAS_STD_ALIGNED_ALLOC)
// && defined(ASIO_HAS_BOOST_ALIGN)
- // && defined(ASIO_HAS_ALIGNOF)
namespace asio {
namespace detail {
-#if defined(ASIO_HAS_STD_SHARED_PTR)
+using std::allocate_shared;
using std::make_shared;
using std::shared_ptr;
using std::weak_ptr;
-#else // defined(ASIO_HAS_STD_SHARED_PTR)
-using boost::make_shared;
-using boost::shared_ptr;
-using boost::weak_ptr;
-#endif // defined(ASIO_HAS_STD_SHARED_PTR)
-
-#if defined(ASIO_HAS_STD_ADDRESSOF)
using std::addressof;
-#else // defined(ASIO_HAS_STD_ADDRESSOF)
-using boost::addressof;
-#endif // defined(ASIO_HAS_STD_ADDRESSOF)
+
+#if defined(ASIO_HAS_STD_TO_ADDRESS)
+using std::to_address;
+#else // defined(ASIO_HAS_STD_TO_ADDRESS)
+template <typename T>
+inline T* to_address(T* p) { return p; }
+template <typename T>
+inline const T* to_address(const T* p) { return p; }
+template <typename T>
+inline volatile T* to_address(volatile T* p) { return p; }
+template <typename T>
+inline const volatile T* to_address(const volatile T* p) { return p; }
+#endif // defined(ASIO_HAS_STD_TO_ADDRESS)
+
+inline void* align(std::size_t alignment,
+ std::size_t size, void*& ptr, std::size_t& space)
+{
+ return std::align(alignment, size, ptr, space);
+}
} // namespace detail
-#if defined(ASIO_HAS_CXX11_ALLOCATORS)
using std::allocator_arg_t;
# define ASIO_USES_ALLOCATOR(t) \
namespace std { \
@@ -72,17 +69,11 @@ using std::allocator_arg_t;
# define ASIO_REBIND_ALLOC(alloc, t) \
typename std::allocator_traits<alloc>::template rebind_alloc<t>
/**/
-#else // defined(ASIO_HAS_CXX11_ALLOCATORS)
-struct allocator_arg_t {};
-# define ASIO_USES_ALLOCATOR(t)
-# define ASIO_REBIND_ALLOC(alloc, t) \
- typename alloc::template rebind<t>::other
- /**/
-#endif // defined(ASIO_HAS_CXX11_ALLOCATORS)
inline void* aligned_new(std::size_t align, std::size_t size)
{
-#if defined(ASIO_HAS_STD_ALIGNED_ALLOC) && defined(ASIO_HAS_ALIGNOF)
+#if defined(ASIO_HAS_STD_ALIGNED_ALLOC)
+ align = (align < ASIO_DEFAULT_ALIGN) ? ASIO_DEFAULT_ALIGN : align;
size = (size % align == 0) ? size : size + (align - size % align);
void* ptr = std::aligned_alloc(align, size);
if (!ptr)
@@ -91,7 +82,8 @@ inline void* aligned_new(std::size_t align, std::size_t size)
asio::detail::throw_exception(ex);
}
return ptr;
-#elif defined(ASIO_HAS_BOOST_ALIGN) && defined(ASIO_HAS_ALIGNOF)
+#elif defined(ASIO_HAS_BOOST_ALIGN)
+ align = (align < ASIO_DEFAULT_ALIGN) ? ASIO_DEFAULT_ALIGN : align;
size = (size % align == 0) ? size : size + (align - size % align);
void* ptr = boost::alignment::aligned_alloc(align, size);
if (!ptr)
@@ -100,7 +92,8 @@ inline void* aligned_new(std::size_t align, std::size_t size)
asio::detail::throw_exception(ex);
}
return ptr;
-#elif defined(ASIO_MSVC) && defined(ASIO_HAS_ALIGNOF)
+#elif defined(ASIO_MSVC)
+ align = (align < ASIO_DEFAULT_ALIGN) ? ASIO_DEFAULT_ALIGN : align;
size = (size % align == 0) ? size : size + (align - size % align);
void* ptr = _aligned_malloc(size, align);
if (!ptr)
@@ -109,23 +102,23 @@ inline void* aligned_new(std::size_t align, std::size_t size)
asio::detail::throw_exception(ex);
}
return ptr;
-#else // defined(ASIO_MSVC) && defined(ASIO_HAS_ALIGNOF)
+#else // defined(ASIO_MSVC)
(void)align;
return ::operator new(size);
-#endif // defined(ASIO_MSVC) && defined(ASIO_HAS_ALIGNOF)
+#endif // defined(ASIO_MSVC)
}
inline void aligned_delete(void* ptr)
{
-#if defined(ASIO_HAS_STD_ALIGNED_ALLOC) && defined(ASIO_HAS_ALIGNOF)
+#if defined(ASIO_HAS_STD_ALIGNED_ALLOC)
std::free(ptr);
-#elif defined(ASIO_HAS_BOOST_ALIGN) && defined(ASIO_HAS_ALIGNOF)
+#elif defined(ASIO_HAS_BOOST_ALIGN)
boost::alignment::aligned_free(ptr);
-#elif defined(ASIO_MSVC) && defined(ASIO_HAS_ALIGNOF)
+#elif defined(ASIO_MSVC)
_aligned_free(ptr);
-#else // defined(ASIO_MSVC) && defined(ASIO_HAS_ALIGNOF)
+#else // defined(ASIO_MSVC)
::operator delete(ptr);
-#endif // defined(ASIO_MSVC) && defined(ASIO_HAS_ALIGNOF)
+#endif // defined(ASIO_MSVC)
}
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/mutex.hpp b/3rdparty/asio/include/asio/detail/mutex.hpp
index 283fade654d..e701c238296 100644
--- a/3rdparty/asio/include/asio/detail/mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/mutex.hpp
@@ -2,7 +2,7 @@
// detail/mutex.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,10 +23,8 @@
# include "asio/detail/win_mutex.hpp"
#elif defined(ASIO_HAS_PTHREADS)
# include "asio/detail/posix_mutex.hpp"
-#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-# include "asio/detail/std_mutex.hpp"
#else
-# error Only Windows, POSIX and std::mutex are supported!
+# include "asio/detail/std_mutex.hpp"
#endif
namespace asio {
@@ -38,7 +36,7 @@ typedef null_mutex mutex;
typedef win_mutex mutex;
#elif defined(ASIO_HAS_PTHREADS)
typedef posix_mutex mutex;
-#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
+#else
typedef std_mutex mutex;
#endif
diff --git a/3rdparty/asio/include/asio/detail/non_const_lvalue.hpp b/3rdparty/asio/include/asio/detail/non_const_lvalue.hpp
index 49603656850..940bf251b71 100644
--- a/3rdparty/asio/include/asio/detail/non_const_lvalue.hpp
+++ b/3rdparty/asio/include/asio/detail/non_const_lvalue.hpp
@@ -2,7 +2,7 @@
// detail/non_const_lvalue.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -26,24 +26,13 @@ namespace detail {
template <typename T>
struct non_const_lvalue
{
-#if defined(ASIO_HAS_MOVE)
explicit non_const_lvalue(T& t)
- : value(static_cast<typename conditional<
- is_same<T, typename decay<T>::type>::value,
- typename decay<T>::type&, T&&>::type>(t))
+ : value(static_cast<conditional_t<
+ is_same<T, decay_t<T>>::value, decay_t<T>&, T&&>>(t))
{
}
- typename conditional<is_same<T, typename decay<T>::type>::value,
- typename decay<T>::type&, typename decay<T>::type>::type value;
-#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
- explicit non_const_lvalue(const typename decay<T>::type& t)
- : value(t)
- {
- }
-
- typename decay<T>::type value;
-#endif // defined(ASIO_HAS_MOVE)
+ conditional_t<is_same<T, decay_t<T>>::value, decay_t<T>&, decay_t<T>> value;
};
} // namespace detail
diff --git a/3rdparty/asio/include/asio/detail/noncopyable.hpp b/3rdparty/asio/include/asio/detail/noncopyable.hpp
index a148e031cf1..7b80a89457a 100644
--- a/3rdparty/asio/include/asio/detail/noncopyable.hpp
+++ b/3rdparty/asio/include/asio/detail/noncopyable.hpp
@@ -2,7 +2,7 @@
// detail/noncopyable.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/null_event.hpp b/3rdparty/asio/include/asio/detail/null_event.hpp
index 5bff3c46afe..d50724c9e5b 100644
--- a/3rdparty/asio/include/asio/detail/null_event.hpp
+++ b/3rdparty/asio/include/asio/detail/null_event.hpp
@@ -2,7 +2,7 @@
// detail/null_event.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/null_fenced_block.hpp b/3rdparty/asio/include/asio/detail/null_fenced_block.hpp
index 265b3bffd5b..ccf65c3ca78 100644
--- a/3rdparty/asio/include/asio/detail/null_fenced_block.hpp
+++ b/3rdparty/asio/include/asio/detail/null_fenced_block.hpp
@@ -2,7 +2,7 @@
// detail/null_fenced_block.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/null_global.hpp b/3rdparty/asio/include/asio/detail/null_global.hpp
index 7bd12502eb3..ab8b9c87e61 100644
--- a/3rdparty/asio/include/asio/detail/null_global.hpp
+++ b/3rdparty/asio/include/asio/detail/null_global.hpp
@@ -2,7 +2,7 @@
// detail/null_global.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/null_mutex.hpp b/3rdparty/asio/include/asio/detail/null_mutex.hpp
index b5457339843..77e759473f5 100644
--- a/3rdparty/asio/include/asio/detail/null_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/null_mutex.hpp
@@ -2,7 +2,7 @@
// detail/null_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,8 +17,6 @@
#include "asio/detail/config.hpp"
-#if !defined(ASIO_HAS_THREADS)
-
#include "asio/detail/noncopyable.hpp"
#include "asio/detail/scoped_lock.hpp"
@@ -59,6 +57,4 @@ public:
#include "asio/detail/pop_options.hpp"
-#endif // !defined(ASIO_HAS_THREADS)
-
#endif // ASIO_DETAIL_NULL_MUTEX_HPP
diff --git a/3rdparty/asio/include/asio/detail/null_reactor.hpp b/3rdparty/asio/include/asio/detail/null_reactor.hpp
index f05c6ee15d2..128f2b45329 100644
--- a/3rdparty/asio/include/asio/detail/null_reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/null_reactor.hpp
@@ -2,7 +2,7 @@
// detail/null_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,9 +17,12 @@
#include "asio/detail/config.hpp"
-#if defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME)
+#if defined(ASIO_HAS_IOCP) \
+ || defined(ASIO_WINDOWS_RUNTIME) \
+ || defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#include "asio/detail/scheduler_operation.hpp"
+#include "asio/detail/scheduler_task.hpp"
#include "asio/execution_context.hpp"
#include "asio/detail/push_options.hpp"
@@ -28,9 +31,14 @@ namespace asio {
namespace detail {
class null_reactor
- : public execution_context_service_base<null_reactor>
+ : public execution_context_service_base<null_reactor>,
+ public scheduler_task
{
public:
+ struct per_descriptor_data
+ {
+ };
+
// Constructor.
null_reactor(asio::execution_context& ctx)
: execution_context_service_base<null_reactor>(ctx)
@@ -42,6 +50,11 @@ public:
{
}
+ // Initialise the task.
+ void init_task()
+ {
+ }
+
// Destroy all user-defined handler objects owned by the service.
void shutdown()
{
@@ -63,6 +76,8 @@ public:
#include "asio/detail/pop_options.hpp"
-#endif // defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME)
+#endif // defined(ASIO_HAS_IOCP)
+ // || defined(ASIO_WINDOWS_RUNTIME)
+ // || defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // ASIO_DETAIL_NULL_REACTOR_HPP
diff --git a/3rdparty/asio/include/asio/detail/null_signal_blocker.hpp b/3rdparty/asio/include/asio/detail/null_signal_blocker.hpp
index 8a9bf367a00..1c4030799fa 100644
--- a/3rdparty/asio/include/asio/detail/null_signal_blocker.hpp
+++ b/3rdparty/asio/include/asio/detail/null_signal_blocker.hpp
@@ -2,7 +2,7 @@
// detail/null_signal_blocker.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/null_socket_service.hpp b/3rdparty/asio/include/asio/detail/null_socket_service.hpp
index e6525465c4e..84e21295f63 100644
--- a/3rdparty/asio/include/asio/detail/null_socket_service.hpp
+++ b/3rdparty/asio/include/asio/detail/null_socket_service.hpp
@@ -2,7 +2,7 @@
// detail/null_socket_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -33,7 +33,7 @@ namespace detail {
template <typename Protocol>
class null_socket_service :
- public execution_context_service_base<null_socket_service<Protocol> >
+ public execution_context_service_base<null_socket_service<Protocol>>
{
public:
// The protocol type.
@@ -52,7 +52,7 @@ public:
// Constructor.
null_socket_service(execution_context& context)
- : execution_context_service_base<null_socket_service<Protocol> >(context)
+ : execution_context_service_base<null_socket_service<Protocol>>(context)
{
}
diff --git a/3rdparty/asio/include/asio/detail/null_static_mutex.hpp b/3rdparty/asio/include/asio/detail/null_static_mutex.hpp
index 4053056aa2f..15d649bb0da 100644
--- a/3rdparty/asio/include/asio/detail/null_static_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/null_static_mutex.hpp
@@ -2,7 +2,7 @@
// detail/null_static_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/null_thread.hpp b/3rdparty/asio/include/asio/detail/null_thread.hpp
index bbdba55622f..aca261671c5 100644
--- a/3rdparty/asio/include/asio/detail/null_thread.hpp
+++ b/3rdparty/asio/include/asio/detail/null_thread.hpp
@@ -2,7 +2,7 @@
// detail/null_thread.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/null_tss_ptr.hpp b/3rdparty/asio/include/asio/detail/null_tss_ptr.hpp
index e2b4cf3d607..cf64a2bcdda 100644
--- a/3rdparty/asio/include/asio/detail/null_tss_ptr.hpp
+++ b/3rdparty/asio/include/asio/detail/null_tss_ptr.hpp
@@ -2,7 +2,7 @@
// detail/null_tss_ptr.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/object_pool.hpp b/3rdparty/asio/include/asio/detail/object_pool.hpp
index 45524d35501..41254ce52ee 100644
--- a/3rdparty/asio/include/asio/detail/object_pool.hpp
+++ b/3rdparty/asio/include/asio/detail/object_pool.hpp
@@ -2,7 +2,7 @@
// detail/object_pool.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/old_win_sdk_compat.hpp b/3rdparty/asio/include/asio/detail/old_win_sdk_compat.hpp
index 734d72e7833..2c43c1dab80 100644
--- a/3rdparty/asio/include/asio/detail/old_win_sdk_compat.hpp
+++ b/3rdparty/asio/include/asio/detail/old_win_sdk_compat.hpp
@@ -2,7 +2,7 @@
// detail/old_win_sdk_compat.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/op_queue.hpp b/3rdparty/asio/include/asio/detail/op_queue.hpp
index 1261339921f..db6335f40f6 100644
--- a/3rdparty/asio/include/asio/detail/op_queue.hpp
+++ b/3rdparty/asio/include/asio/detail/op_queue.hpp
@@ -2,7 +2,7 @@
// detail/op_queue.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/operation.hpp b/3rdparty/asio/include/asio/detail/operation.hpp
index 6e58117ff0d..8721f397a5c 100644
--- a/3rdparty/asio/include/asio/detail/operation.hpp
+++ b/3rdparty/asio/include/asio/detail/operation.hpp
@@ -2,7 +2,7 @@
// detail/operation.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/pipe_select_interrupter.hpp b/3rdparty/asio/include/asio/detail/pipe_select_interrupter.hpp
index 09b3f3bdb67..f7b219644e4 100644
--- a/3rdparty/asio/include/asio/detail/pipe_select_interrupter.hpp
+++ b/3rdparty/asio/include/asio/detail/pipe_select_interrupter.hpp
@@ -2,7 +2,7 @@
// detail/pipe_select_interrupter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/pop_options.hpp b/3rdparty/asio/include/asio/detail/pop_options.hpp
index 9b14085bd49..93cdb5abb4d 100644
--- a/3rdparty/asio/include/asio/detail/pop_options.hpp
+++ b/3rdparty/asio/include/asio/detail/pop_options.hpp
@@ -2,7 +2,7 @@
// detail/pop_options.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -29,6 +29,10 @@
# endif // !defined(ASIO_DISABLE_VISIBILITY)
# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+# pragma pop_macro ("emit")
+# pragma pop_macro ("signal")
+# pragma pop_macro ("slot")
+
#elif defined(__clang__)
// Clang
@@ -146,4 +150,8 @@
# endif
# endif
+# pragma pop_macro ("emit")
+# pragma pop_macro ("signal")
+# pragma pop_macro ("slot")
+
#endif
diff --git a/3rdparty/asio/include/asio/detail/posix_event.hpp b/3rdparty/asio/include/asio/detail/posix_event.hpp
index 8a06b422466..0c83bd31a30 100644
--- a/3rdparty/asio/include/asio/detail/posix_event.hpp
+++ b/3rdparty/asio/include/asio/detail/posix_event.hpp
@@ -2,7 +2,7 @@
// detail/posix_event.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/posix_fd_set_adapter.hpp b/3rdparty/asio/include/asio/detail/posix_fd_set_adapter.hpp
index 230160b8e27..bd28a13fb2c 100644
--- a/3rdparty/asio/include/asio/detail/posix_fd_set_adapter.hpp
+++ b/3rdparty/asio/include/asio/detail/posix_fd_set_adapter.hpp
@@ -2,7 +2,7 @@
// detail/posix_fd_set_adapter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/posix_global.hpp b/3rdparty/asio/include/asio/detail/posix_global.hpp
index b7b113a4726..aea71e15c82 100644
--- a/3rdparty/asio/include/asio/detail/posix_global.hpp
+++ b/3rdparty/asio/include/asio/detail/posix_global.hpp
@@ -2,7 +2,7 @@
// detail/posix_global.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/posix_mutex.hpp b/3rdparty/asio/include/asio/detail/posix_mutex.hpp
index ee0e8b20242..38ce2867ff5 100644
--- a/3rdparty/asio/include/asio/detail/posix_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/posix_mutex.hpp
@@ -2,7 +2,7 @@
// detail/posix_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/reactive_serial_port_service.hpp b/3rdparty/asio/include/asio/detail/posix_serial_port_service.hpp
index e5a605c943d..79309549845 100644
--- a/3rdparty/asio/include/asio/detail/reactive_serial_port_service.hpp
+++ b/3rdparty/asio/include/asio/detail/posix_serial_port_service.hpp
@@ -1,16 +1,16 @@
//
-// detail/reactive_serial_port_service.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// detail/posix_serial_port_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// 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 ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP
-#define ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP
+#ifndef ASIO_DETAIL_POSIX_SERIAL_PORT_SERVICE_HPP
+#define ASIO_DETAIL_POSIX_SERIAL_PORT_SERVICE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
@@ -26,25 +26,36 @@
#include "asio/execution_context.hpp"
#include "asio/serial_port_base.hpp"
#include "asio/detail/descriptor_ops.hpp"
-#include "asio/detail/reactive_descriptor_service.hpp"
+
+#if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_descriptor_service.hpp"
+#else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/reactive_descriptor_service.hpp"
+#endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace detail {
-// Extend reactive_descriptor_service to provide serial port support.
-class reactive_serial_port_service :
- public execution_context_service_base<reactive_serial_port_service>
+// Extend a descriptor_service to provide serial port support.
+class posix_serial_port_service :
+ public execution_context_service_base<posix_serial_port_service>
{
public:
+#if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ typedef io_uring_descriptor_service descriptor_service;
+#else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ typedef reactive_descriptor_service descriptor_service;
+#endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+
// The native type of a serial port.
- typedef reactive_descriptor_service::native_handle_type native_handle_type;
+ typedef descriptor_service::native_handle_type native_handle_type;
// The implementation type of the serial port.
- typedef reactive_descriptor_service::implementation_type implementation_type;
+ typedef descriptor_service::implementation_type implementation_type;
- ASIO_DECL reactive_serial_port_service(execution_context& context);
+ ASIO_DECL posix_serial_port_service(execution_context& context);
// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
@@ -64,7 +75,7 @@ public:
// Move-assign from another serial port implementation.
void move_assign(implementation_type& impl,
- reactive_serial_port_service& other_service,
+ posix_serial_port_service& other_service,
implementation_type& other_impl)
{
descriptor_service_.move_assign(impl,
@@ -121,7 +132,7 @@ public:
const SettableSerialPortOption& option, asio::error_code& ec)
{
return do_set_option(impl,
- &reactive_serial_port_service::store_option<SettableSerialPortOption>,
+ &posix_serial_port_service::store_option<SettableSerialPortOption>,
&option, ec);
}
@@ -131,7 +142,7 @@ public:
GettableSerialPortOption& option, asio::error_code& ec) const
{
return do_get_option(impl,
- &reactive_serial_port_service::load_option<GettableSerialPortOption>,
+ &posix_serial_port_service::load_option<GettableSerialPortOption>,
&option, ec);
}
@@ -141,6 +152,7 @@ public:
{
int result = ::tcsendbreak(descriptor_service_.native_handle(impl), 0);
descriptor_ops::get_last_error(ec, result < 0);
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -219,7 +231,7 @@ private:
void* option, asio::error_code& ec) const;
// The implementation used for initiating asynchronous operations.
- reactive_descriptor_service descriptor_service_;
+ descriptor_service descriptor_service_;
};
} // namespace detail
@@ -228,10 +240,10 @@ private:
#include "asio/detail/pop_options.hpp"
#if defined(ASIO_HEADER_ONLY)
-# include "asio/detail/impl/reactive_serial_port_service.ipp"
+# include "asio/detail/impl/posix_serial_port_service.ipp"
#endif // defined(ASIO_HEADER_ONLY)
#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__)
#endif // defined(ASIO_HAS_SERIAL_PORT)
-#endif // ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP
+#endif // ASIO_DETAIL_POSIX_SERIAL_PORT_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/detail/posix_signal_blocker.hpp b/3rdparty/asio/include/asio/detail/posix_signal_blocker.hpp
index e0a4420bfb8..a57c09687b8 100644
--- a/3rdparty/asio/include/asio/detail/posix_signal_blocker.hpp
+++ b/3rdparty/asio/include/asio/detail/posix_signal_blocker.hpp
@@ -2,7 +2,7 @@
// detail/posix_signal_blocker.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/posix_static_mutex.hpp b/3rdparty/asio/include/asio/detail/posix_static_mutex.hpp
index b9fdd481ae7..38a44c0327a 100644
--- a/3rdparty/asio/include/asio/detail/posix_static_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/posix_static_mutex.hpp
@@ -2,7 +2,7 @@
// detail/posix_static_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/posix_thread.hpp b/3rdparty/asio/include/asio/detail/posix_thread.hpp
index cd80af10f1f..9085a0b4a7b 100644
--- a/3rdparty/asio/include/asio/detail/posix_thread.hpp
+++ b/3rdparty/asio/include/asio/detail/posix_thread.hpp
@@ -2,7 +2,7 @@
// detail/posix_thread.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/posix_tss_ptr.hpp b/3rdparty/asio/include/asio/detail/posix_tss_ptr.hpp
index 6d8b29f6581..b0d0653bed5 100644
--- a/3rdparty/asio/include/asio/detail/posix_tss_ptr.hpp
+++ b/3rdparty/asio/include/asio/detail/posix_tss_ptr.hpp
@@ -2,7 +2,7 @@
// detail/posix_tss_ptr.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/push_options.hpp b/3rdparty/asio/include/asio/detail/push_options.hpp
index 9786ff90098..d270e9ae13c 100644
--- a/3rdparty/asio/include/asio/detail/push_options.hpp
+++ b/3rdparty/asio/include/asio/detail/push_options.hpp
@@ -2,7 +2,7 @@
// detail/push_options.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -29,6 +29,15 @@
# endif // !defined(ASIO_DISABLE_VISIBILITY)
# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+# pragma push_macro ("emit")
+# undef emit
+
+# pragma push_macro ("signal")
+# undef signal
+
+# pragma push_macro ("slot")
+# undef slot
+
#elif defined(__clang__)
// Clang
@@ -163,12 +172,13 @@
//
// Must remain the last #elif since some other vendors (Metrowerks, for example)
// also #define _MSC_VER
-
# pragma warning (disable:4103)
# pragma warning (push)
+# pragma warning (disable:4619) // suppress 'there is no warning number XXXX'
# pragma warning (disable:4127)
# pragma warning (disable:4180)
# pragma warning (disable:4244)
+# pragma warning (disable:4265)
# pragma warning (disable:4355)
# pragma warning (disable:4510)
# pragma warning (disable:4512)
diff --git a/3rdparty/asio/include/asio/detail/reactive_descriptor_service.hpp b/3rdparty/asio/include/asio/detail/reactive_descriptor_service.hpp
index 2c557e8b4c7..f7c7e86916d 100644
--- a/3rdparty/asio/include/asio/detail/reactive_descriptor_service.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_descriptor_service.hpp
@@ -2,7 +2,7 @@
// detail/reactive_descriptor_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,9 +19,11 @@
#if !defined(ASIO_WINDOWS) \
&& !defined(ASIO_WINDOWS_RUNTIME) \
- && !defined(__CYGWIN__)
+ && !defined(__CYGWIN__) \
+ && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#include "asio/associated_cancellation_slot.hpp"
+#include "asio/associated_immediate_executor.hpp"
#include "asio/buffer.hpp"
#include "asio/cancellation_type.hpp"
#include "asio/execution_context.hpp"
@@ -87,7 +89,7 @@ public:
// Move-construct a new descriptor implementation.
ASIO_DECL void move_construct(implementation_type& impl,
- implementation_type& other_impl) ASIO_NOEXCEPT;
+ implementation_type& other_impl) noexcept;
// Move-assign from another descriptor implementation.
ASIO_DECL void move_assign(implementation_type& impl,
@@ -121,6 +123,14 @@ public:
// Release ownership of the native descriptor representation.
ASIO_DECL native_handle_type release(implementation_type& impl);
+ // Release ownership of the native descriptor representation.
+ native_handle_type release(implementation_type& impl,
+ asio::error_code& ec)
+ {
+ ec = success_ec_;
+ return release(impl);
+ }
+
// Cancel all operations associated with the descriptor.
ASIO_DECL asio::error_code cancel(implementation_type& impl,
asio::error_code& ec);
@@ -132,6 +142,7 @@ public:
{
descriptor_ops::ioctl(impl.descriptor_, impl.state_,
command.name(), static_cast<ioctl_arg_type*>(command.data()), ec);
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -147,6 +158,7 @@ public:
{
descriptor_ops::set_user_non_blocking(
impl.descriptor_, impl.state_, mode, ec);
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -186,6 +198,7 @@ public:
break;
}
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -199,7 +212,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -215,19 +228,20 @@ public:
switch (w)
{
case posix::descriptor_base::wait_read:
- op_type = reactor::read_op;
- break;
+ op_type = reactor::read_op;
+ break;
case posix::descriptor_base::wait_write:
- op_type = reactor::write_op;
- break;
+ op_type = reactor::write_op;
+ break;
case posix::descriptor_base::wait_error:
- op_type = reactor::except_op;
- break;
- default:
- p.p->ec_ = asio::error::invalid_argument;
- reactor_.post_immediate_completion(p.p, is_continuation);
- p.v = p.p = 0;
- return;
+ op_type = reactor::except_op;
+ break;
+ default:
+ p.p->ec_ = asio::error::invalid_argument;
+ start_op(impl, reactor::read_op, p.p,
+ is_continuation, false, true, &io_ex, 0);
+ p.v = p.p = 0;
+ return;
}
// Optionally register for per-operation cancellation.
@@ -238,7 +252,7 @@ public:
&reactor_, &impl.reactor_data_, impl.descriptor_, op_type);
}
- start_op(impl, op_type, p.p, is_continuation, false, false);
+ start_op(impl, op_type, p.p, is_continuation, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -250,9 +264,10 @@ public:
typedef buffer_sequence_adapter<asio::const_buffer,
ConstBufferSequence> bufs_type;
+ size_t n;
if (bufs_type::is_single_buffer)
{
- return descriptor_ops::sync_write1(impl.descriptor_,
+ n = descriptor_ops::sync_write1(impl.descriptor_,
impl.state_, bufs_type::first(buffers).data(),
bufs_type::first(buffers).size(), ec);
}
@@ -260,9 +275,12 @@ public:
{
bufs_type bufs(buffers);
- return descriptor_ops::sync_write(impl.descriptor_, impl.state_,
+ n = descriptor_ops::sync_write(impl.descriptor_, impl.state_,
bufs.buffers(), bufs.count(), bufs.all_empty(), ec);
}
+
+ ASIO_ERROR_LOCATION(ec);
+ return n;
}
// Wait until data can be written without blocking.
@@ -271,7 +289,7 @@ public:
{
// Wait for descriptor to become ready.
descriptor_ops::poll_write(impl.descriptor_, impl.state_, ec);
-
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -285,7 +303,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -308,7 +326,7 @@ public:
start_op(impl, reactor::write_op, p.p, is_continuation, true,
buffer_sequence_adapter<asio::const_buffer,
- ConstBufferSequence>::all_empty(buffers));
+ ConstBufferSequence>::all_empty(buffers), &io_ex, 0);
p.v = p.p = 0;
}
@@ -320,7 +338,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -341,7 +359,8 @@ public:
ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor",
&impl, impl.descriptor_, "async_write_some(null_buffers)"));
- start_op(impl, reactor::write_op, p.p, is_continuation, false, false);
+ start_op(impl, reactor::write_op, p.p,
+ is_continuation, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -353,9 +372,10 @@ public:
typedef buffer_sequence_adapter<asio::mutable_buffer,
MutableBufferSequence> bufs_type;
+ size_t n;
if (bufs_type::is_single_buffer)
{
- return descriptor_ops::sync_read1(impl.descriptor_,
+ n = descriptor_ops::sync_read1(impl.descriptor_,
impl.state_, bufs_type::first(buffers).data(),
bufs_type::first(buffers).size(), ec);
}
@@ -363,9 +383,12 @@ public:
{
bufs_type bufs(buffers);
- return descriptor_ops::sync_read(impl.descriptor_, impl.state_,
+ n = descriptor_ops::sync_read(impl.descriptor_, impl.state_,
bufs.buffers(), bufs.count(), bufs.all_empty(), ec);
}
+
+ ASIO_ERROR_LOCATION(ec);
+ return n;
}
// Wait until data can be read without blocking.
@@ -374,7 +397,7 @@ public:
{
// Wait for descriptor to become ready.
descriptor_ops::poll_read(impl.descriptor_, impl.state_, ec);
-
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -389,7 +412,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -412,7 +435,7 @@ public:
start_op(impl, reactor::read_op, p.p, is_continuation, true,
buffer_sequence_adapter<asio::mutable_buffer,
- MutableBufferSequence>::all_empty(buffers));
+ MutableBufferSequence>::all_empty(buffers), &io_ex, 0);
p.v = p.p = 0;
}
@@ -424,7 +447,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -445,14 +468,47 @@ public:
ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "descriptor",
&impl, impl.descriptor_, "async_read_some(null_buffers)"));
- start_op(impl, reactor::read_op, p.p, is_continuation, false, false);
+ start_op(impl, reactor::read_op, p.p,
+ is_continuation, false, false, &io_ex, 0);
p.v = p.p = 0;
}
private:
// Start the asynchronous operation.
- ASIO_DECL void start_op(implementation_type& impl, int op_type,
- reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop);
+ ASIO_DECL void do_start_op(implementation_type& impl, int op_type,
+ reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop,
+ void (*on_immediate)(operation* op, bool, const void*),
+ const void* immediate_arg);
+
+ // Start the asynchronous operation for handlers that are specialised for
+ // immediate completion.
+ template <typename Op>
+ void start_op(implementation_type& impl, int op_type, Op* op,
+ bool is_continuation, bool is_non_blocking, bool noop,
+ const void* io_ex, ...)
+ {
+ return do_start_op(impl, op_type, op, is_continuation,
+ is_non_blocking, noop, &Op::do_immediate, io_ex);
+ }
+
+ // Start the asynchronous operation for handlers that are not specialised for
+ // immediate completion.
+ template <typename Op>
+ void start_op(implementation_type& impl, int op_type, Op* op,
+ bool is_continuation, bool is_non_blocking, bool noop, const void*,
+ enable_if_t<
+ is_same<
+ typename associated_immediate_executor<
+ typename Op::handler_type,
+ typename Op::io_executor_type
+ >::asio_associated_immediate_executor_is_unspecialised,
+ void
+ >::value
+ >*)
+ {
+ return do_start_op(impl, op_type, op, is_continuation, is_non_blocking,
+ noop, &reactor::call_post_immediate_completion, &reactor_);
+ }
// Helper class used to implement per-operation cancellation
class reactor_op_cancellation
@@ -505,5 +561,6 @@ private:
#endif // !defined(ASIO_WINDOWS)
// && !defined(ASIO_WINDOWS_RUNTIME)
// && !defined(__CYGWIN__)
+ // && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/detail/reactive_null_buffers_op.hpp b/3rdparty/asio/include/asio/detail/reactive_null_buffers_op.hpp
index 48214dcba87..b9a32a91217 100644
--- a/3rdparty/asio/include/asio/detail/reactive_null_buffers_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_null_buffers_op.hpp
@@ -2,7 +2,7 @@
// detail/reactive_null_buffers_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,7 +19,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -33,13 +32,16 @@ template <typename Handler, typename IoExecutor>
class reactive_null_buffers_op : public reactor_op
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_null_buffers_op);
reactive_null_buffers_op(const asio::error_code& success_ec,
Handler& handler, const IoExecutor& io_ex)
: reactor_op(success_ec, &reactive_null_buffers_op::do_perform,
&reactive_null_buffers_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -54,6 +56,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_null_buffers_op* o(static_cast<reactive_null_buffers_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -61,7 +64,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
// Make a copy of the handler so that the memory can be deallocated before
@@ -85,6 +88,36 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_null_buffers_op* o(static_cast<reactive_null_buffers_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/reactive_socket_accept_op.hpp b/3rdparty/asio/include/asio/detail/reactive_socket_accept_op.hpp
index ac036717e8d..5ae84fd9966 100644
--- a/3rdparty/asio/include/asio/detail/reactive_socket_accept_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_socket_accept_op.hpp
@@ -2,7 +2,7 @@
// detail/reactive_socket_accept_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,7 +19,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -52,6 +51,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
reactive_socket_accept_op_base* o(
static_cast<reactive_socket_accept_op_base*>(base));
@@ -95,6 +95,9 @@ class reactive_socket_accept_op :
public reactive_socket_accept_op_base<Socket, Protocol>
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_socket_accept_op);
reactive_socket_accept_op(const asio::error_code& success_ec,
@@ -104,7 +107,7 @@ public:
: reactive_socket_accept_op_base<Socket, Protocol>(
success_ec, socket, state, peer, protocol, peer_endpoint,
&reactive_socket_accept_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -114,6 +117,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_socket_accept_op* o(static_cast<reactive_socket_accept_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -125,9 +129,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -149,13 +155,46 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_socket_accept_op* o(static_cast<reactive_socket_accept_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ // On success, assign new connection to peer socket object.
+ o->do_assign();
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder1<Handler, asio::error_code>
+ handler(o->handler_, o->ec_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
};
-#if defined(ASIO_HAS_MOVE)
-
template <typename Protocol, typename PeerIoExecutor,
typename Handler, typename IoExecutor>
class reactive_socket_move_accept_op :
@@ -165,6 +204,9 @@ class reactive_socket_move_accept_op :
Protocol>
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_socket_move_accept_op);
reactive_socket_move_accept_op(const asio::error_code& success_ec,
@@ -176,7 +218,7 @@ public:
reactive_socket_accept_op_base<peer_socket_type, Protocol>(
success_ec, socket, state, *this, protocol, peer_endpoint,
&reactive_socket_move_accept_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -186,6 +228,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_socket_move_accept_op* o(
static_cast<reactive_socket_move_accept_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -198,9 +241,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -209,8 +254,8 @@ public:
// deallocated the memory here.
detail::move_binder2<Handler,
asio::error_code, peer_socket_type>
- handler(0, ASIO_MOVE_CAST(Handler)(o->handler_), o->ec_,
- ASIO_MOVE_CAST(peer_socket_type)(*o));
+ handler(0, static_cast<Handler&&>(o->handler_), o->ec_,
+ static_cast<peer_socket_type&&>(*o));
p.h = asio::detail::addressof(handler.handler_);
p.reset();
@@ -224,6 +269,44 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_socket_move_accept_op* o(
+ static_cast<reactive_socket_move_accept_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ // On success, assign new connection to peer socket object.
+ o->do_assign();
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::move_binder2<Handler,
+ asio::error_code, peer_socket_type>
+ handler(0, static_cast<Handler&&>(o->handler_), o->ec_,
+ static_cast<peer_socket_type&&>(*o));
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "..."));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
typedef typename Protocol::socket::template
rebind_executor<PeerIoExecutor>::other peer_socket_type;
@@ -232,8 +315,6 @@ private:
handler_work<Handler, IoExecutor> work_;
};
-#endif // defined(ASIO_HAS_MOVE)
-
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/reactive_socket_connect_op.hpp b/3rdparty/asio/include/asio/detail/reactive_socket_connect_op.hpp
index 956bc522d10..03c0db2e7dd 100644
--- a/3rdparty/asio/include/asio/detail/reactive_socket_connect_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_socket_connect_op.hpp
@@ -2,7 +2,7 @@
// detail/reactive_socket_connect_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,7 +19,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -43,6 +42,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
reactive_socket_connect_op_base* o(
static_cast<reactive_socket_connect_op_base*>(base));
@@ -62,13 +62,16 @@ template <typename Handler, typename IoExecutor>
class reactive_socket_connect_op : public reactive_socket_connect_op_base
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_socket_connect_op);
reactive_socket_connect_op(const asio::error_code& success_ec,
socket_type socket, Handler& handler, const IoExecutor& io_ex)
: reactive_socket_connect_op_base(success_ec, socket,
&reactive_socket_connect_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -78,6 +81,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_socket_connect_op* o
(static_cast<reactive_socket_connect_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -86,9 +90,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -110,6 +116,39 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_socket_connect_op* o
+ (static_cast<reactive_socket_connect_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder1<Handler, asio::error_code>
+ handler(o->handler_, o->ec_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/reactive_socket_recv_op.hpp b/3rdparty/asio/include/asio/detail/reactive_socket_recv_op.hpp
index d30f4ab315a..b6533655674 100644
--- a/3rdparty/asio/include/asio/detail/reactive_socket_recv_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_socket_recv_op.hpp
@@ -2,7 +2,7 @@
// detail/reactive_socket_recv_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,7 +20,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -50,6 +49,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
reactive_socket_recv_op_base* o(
static_cast<reactive_socket_recv_op_base*>(base));
@@ -97,6 +97,9 @@ class reactive_socket_recv_op :
public reactive_socket_recv_op_base<MutableBufferSequence>
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_socket_recv_op);
reactive_socket_recv_op(const asio::error_code& success_ec,
@@ -105,7 +108,7 @@ public:
Handler& handler, const IoExecutor& io_ex)
: reactive_socket_recv_op_base<MutableBufferSequence>(success_ec, socket,
state, buffers, flags, &reactive_socket_recv_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -115,6 +118,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_socket_recv_op* o(static_cast<reactive_socket_recv_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -122,9 +126,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -146,6 +152,38 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_socket_recv_op* o(static_cast<reactive_socket_recv_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp b/3rdparty/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp
index 0d7673a1120..b84ea61794f 100644
--- a/3rdparty/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp
@@ -2,7 +2,7 @@
// detail/reactive_socket_recvfrom_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,7 +20,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -51,6 +50,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
reactive_socket_recvfrom_op_base* o(
static_cast<reactive_socket_recvfrom_op_base*>(base));
@@ -99,6 +99,9 @@ class reactive_socket_recvfrom_op :
public reactive_socket_recvfrom_op_base<MutableBufferSequence, Endpoint>
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvfrom_op);
reactive_socket_recvfrom_op(const asio::error_code& success_ec,
@@ -109,7 +112,7 @@ public:
: reactive_socket_recvfrom_op_base<MutableBufferSequence, Endpoint>(
success_ec, socket, protocol_type, buffers, endpoint, flags,
&reactive_socket_recvfrom_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -119,6 +122,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_socket_recvfrom_op* o(
static_cast<reactive_socket_recvfrom_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -127,9 +131,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -151,6 +157,39 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_socket_recvfrom_op* o(
+ static_cast<reactive_socket_recvfrom_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp b/3rdparty/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp
index b387f048f0c..e4c8117b675 100644
--- a/3rdparty/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp
@@ -2,7 +2,7 @@
// detail/reactive_socket_recvmsg_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,7 +20,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -51,6 +50,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
reactive_socket_recvmsg_op_base* o(
static_cast<reactive_socket_recvmsg_op_base*>(base));
@@ -80,6 +80,9 @@ class reactive_socket_recvmsg_op :
public reactive_socket_recvmsg_op_base<MutableBufferSequence>
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvmsg_op);
reactive_socket_recvmsg_op(const asio::error_code& success_ec,
@@ -90,7 +93,7 @@ public:
: reactive_socket_recvmsg_op_base<MutableBufferSequence>(
success_ec, socket, buffers, in_flags, out_flags,
&reactive_socket_recvmsg_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -100,6 +103,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_socket_recvmsg_op* o(
static_cast<reactive_socket_recvmsg_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -108,9 +112,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -132,6 +138,39 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_socket_recvmsg_op* o(
+ static_cast<reactive_socket_recvmsg_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/reactive_socket_send_op.hpp b/3rdparty/asio/include/asio/detail/reactive_socket_send_op.hpp
index 5a778566ad8..ef7ec69933b 100644
--- a/3rdparty/asio/include/asio/detail/reactive_socket_send_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_socket_send_op.hpp
@@ -2,7 +2,7 @@
// detail/reactive_socket_send_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,7 +20,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -50,6 +49,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
reactive_socket_send_op_base* o(
static_cast<reactive_socket_send_op_base*>(base));
@@ -100,6 +100,9 @@ class reactive_socket_send_op :
public reactive_socket_send_op_base<ConstBufferSequence>
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_socket_send_op);
reactive_socket_send_op(const asio::error_code& success_ec,
@@ -108,7 +111,7 @@ public:
Handler& handler, const IoExecutor& io_ex)
: reactive_socket_send_op_base<ConstBufferSequence>(success_ec, socket,
state, buffers, flags, &reactive_socket_send_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -118,6 +121,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_socket_send_op* o(static_cast<reactive_socket_send_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -125,9 +129,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -149,6 +155,39 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_socket_send_op* o(static_cast<reactive_socket_send_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/reactive_socket_sendto_op.hpp b/3rdparty/asio/include/asio/detail/reactive_socket_sendto_op.hpp
index 28bff66980d..e1bbb70389c 100644
--- a/3rdparty/asio/include/asio/detail/reactive_socket_sendto_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_socket_sendto_op.hpp
@@ -2,7 +2,7 @@
// detail/reactive_socket_sendto_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,7 +20,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -50,6 +49,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
reactive_socket_sendto_op_base* o(
static_cast<reactive_socket_sendto_op_base*>(base));
@@ -93,6 +93,9 @@ class reactive_socket_sendto_op :
public reactive_socket_sendto_op_base<ConstBufferSequence, Endpoint>
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_socket_sendto_op);
reactive_socket_sendto_op(const asio::error_code& success_ec,
@@ -102,7 +105,7 @@ public:
: reactive_socket_sendto_op_base<ConstBufferSequence, Endpoint>(
success_ec, socket, buffers, endpoint, flags,
&reactive_socket_sendto_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -112,6 +115,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_socket_sendto_op* o(static_cast<reactive_socket_sendto_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -119,9 +123,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(o->ec_);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -143,6 +149,38 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_socket_sendto_op* o(static_cast<reactive_socket_sendto_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ ASIO_ERROR_LOCATION(o->ec_);
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder2<Handler, asio::error_code, std::size_t>
+ handler(o->handler_, o->ec_, o->bytes_transferred_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/reactive_socket_service.hpp b/3rdparty/asio/include/asio/detail/reactive_socket_service.hpp
index 2124eaf9a9d..c828e7f1f2a 100644
--- a/3rdparty/asio/include/asio/detail/reactive_socket_service.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_socket_service.hpp
@@ -2,7 +2,7 @@
// detail/reactive_socket_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,7 +17,8 @@
#include "asio/detail/config.hpp"
-#if !defined(ASIO_HAS_IOCP)
+#if !defined(ASIO_HAS_IOCP) \
+ && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#include "asio/buffer.hpp"
#include "asio/error.hpp"
@@ -45,7 +46,7 @@ namespace detail {
template <typename Protocol>
class reactive_socket_service :
- public execution_context_service_base<reactive_socket_service<Protocol> >,
+ public execution_context_service_base<reactive_socket_service<Protocol>>,
public reactive_socket_service_base
{
public:
@@ -75,7 +76,7 @@ public:
// Constructor.
reactive_socket_service(execution_context& context)
: execution_context_service_base<
- reactive_socket_service<Protocol> >(context),
+ reactive_socket_service<Protocol>>(context),
reactive_socket_service_base(context)
{
}
@@ -88,7 +89,7 @@ public:
// Move-construct a new socket implementation.
void move_construct(implementation_type& impl,
- implementation_type& other_impl) ASIO_NOEXCEPT
+ implementation_type& other_impl) noexcept
{
this->base_move_construct(impl, other_impl);
@@ -127,6 +128,8 @@ public:
if (!do_open(impl, protocol.family(),
protocol.type(), protocol.protocol(), ec))
impl.protocol_ = protocol;
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -137,6 +140,8 @@ public:
{
if (!do_assign(impl, protocol.type(), native_socket, ec))
impl.protocol_ = protocol;
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -151,6 +156,8 @@ public:
const endpoint_type& endpoint, asio::error_code& ec)
{
socket_ops::bind(impl.socket_, endpoint.data(), endpoint.size(), ec);
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -162,6 +169,8 @@ public:
socket_ops::setsockopt(impl.socket_, impl.state_,
option.level(impl.protocol_), option.name(impl.protocol_),
option.data(impl.protocol_), option.size(impl.protocol_), ec);
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -176,6 +185,8 @@ public:
option.data(impl.protocol_), &size, ec);
if (!ec)
option.resize(impl.protocol_, size);
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -186,7 +197,10 @@ public:
endpoint_type endpoint;
std::size_t addr_len = endpoint.capacity();
if (socket_ops::getsockname(impl.socket_, endpoint.data(), &addr_len, ec))
+ {
+ ASIO_ERROR_LOCATION(ec);
return endpoint_type();
+ }
endpoint.resize(addr_len);
return endpoint;
}
@@ -199,7 +213,10 @@ public:
std::size_t addr_len = endpoint.capacity();
if (socket_ops::getpeername(impl.socket_,
endpoint.data(), &addr_len, false, ec))
+ {
+ ASIO_ERROR_LOCATION(ec);
return endpoint_type();
+ }
endpoint.resize(addr_len);
return endpoint;
}
@@ -209,6 +226,8 @@ public:
socket_base::shutdown_type what, asio::error_code& ec)
{
socket_ops::shutdown(impl.socket_, what, ec);
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -222,9 +241,10 @@ public:
typedef buffer_sequence_adapter<asio::const_buffer,
ConstBufferSequence> bufs_type;
+ size_t n;
if (bufs_type::is_single_buffer)
{
- return socket_ops::sync_sendto1(impl.socket_, impl.state_,
+ n = socket_ops::sync_sendto1(impl.socket_, impl.state_,
bufs_type::first(buffers).data(),
bufs_type::first(buffers).size(), flags,
destination.data(), destination.size(), ec);
@@ -232,10 +252,13 @@ public:
else
{
bufs_type bufs(buffers);
- return socket_ops::sync_sendto(impl.socket_, impl.state_,
+ n = socket_ops::sync_sendto(impl.socket_, impl.state_,
bufs.buffers(), bufs.count(), flags,
destination.data(), destination.size(), ec);
}
+
+ ASIO_ERROR_LOCATION(ec);
+ return n;
}
// Wait until data can be sent without blocking.
@@ -246,6 +269,7 @@ public:
// Wait for socket to become ready.
socket_ops::poll_write(impl.socket_, impl.state_, -1, ec);
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -260,7 +284,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -282,7 +306,8 @@ public:
ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket",
&impl, impl.socket_, "async_send_to"));
- start_op(impl, reactor::write_op, p.p, is_continuation, true, false);
+ start_op(impl, reactor::write_op, p.p,
+ is_continuation, true, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -295,7 +320,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -315,7 +340,8 @@ public:
ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket",
&impl, impl.socket_, "async_send_to(null_buffers)"));
- start_op(impl, reactor::write_op, p.p, is_continuation, false, false);
+ start_op(impl, reactor::write_op, p.p,
+ is_continuation, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -331,26 +357,25 @@ public:
MutableBufferSequence> bufs_type;
std::size_t addr_len = sender_endpoint.capacity();
- std::size_t bytes_recvd;
+ std::size_t n;
if (bufs_type::is_single_buffer)
{
- bytes_recvd = socket_ops::sync_recvfrom1(impl.socket_,
- impl.state_, bufs_type::first(buffers).data(),
- bufs_type::first(buffers).size(), flags,
- sender_endpoint.data(), &addr_len, ec);
+ n = socket_ops::sync_recvfrom1(impl.socket_, impl.state_,
+ bufs_type::first(buffers).data(), bufs_type::first(buffers).size(),
+ flags, sender_endpoint.data(), &addr_len, ec);
}
else
{
bufs_type bufs(buffers);
- bytes_recvd = socket_ops::sync_recvfrom(
- impl.socket_, impl.state_, bufs.buffers(), bufs.count(),
- flags, sender_endpoint.data(), &addr_len, ec);
+ n = socket_ops::sync_recvfrom(impl.socket_, impl.state_, bufs.buffers(),
+ bufs.count(), flags, sender_endpoint.data(), &addr_len, ec);
}
if (!ec)
sender_endpoint.resize(addr_len);
- return bytes_recvd;
+ ASIO_ERROR_LOCATION(ec);
+ return n;
}
// Wait until data can be received without blocking.
@@ -364,6 +389,7 @@ public:
// Reset endpoint since it can be given no sensible value at this time.
sender_endpoint = endpoint_type();
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -380,7 +406,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -406,7 +432,7 @@ public:
start_op(impl,
(flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
- p.p, is_continuation, true, false);
+ p.p, is_continuation, true, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -419,7 +445,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -445,7 +471,7 @@ public:
start_op(impl,
(flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
- p.p, is_continuation, false, false);
+ p.p, is_continuation, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -458,6 +484,7 @@ public:
if (peer.is_open())
{
ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -476,6 +503,7 @@ public:
new_socket.release();
}
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -488,7 +516,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -509,11 +537,10 @@ public:
ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket",
&impl, impl.socket_, "async_accept"));
- start_accept_op(impl, p.p, is_continuation, peer.is_open());
+ start_accept_op(impl, p.p, is_continuation, peer.is_open(), &io_ex, 0);
p.v = p.p = 0;
}
-#if defined(ASIO_HAS_MOVE)
// Start an asynchronous accept. The peer_endpoint object must be valid until
// the accept's handler is invoked.
template <typename PeerIoExecutor, typename Handler, typename IoExecutor>
@@ -524,7 +551,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -546,10 +573,9 @@ public:
ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket",
&impl, impl.socket_, "async_accept"));
- start_accept_op(impl, p.p, is_continuation, false);
+ start_accept_op(impl, p.p, is_continuation, false, &io_ex, 0);
p.v = p.p = 0;
}
-#endif // defined(ASIO_HAS_MOVE)
// Connect the socket to the specified endpoint.
asio::error_code connect(implementation_type& impl,
@@ -557,6 +583,7 @@ public:
{
socket_ops::sync_connect(impl.socket_,
peer_endpoint.data(), peer_endpoint.size(), ec);
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -569,7 +596,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -590,7 +617,7 @@ public:
&impl, impl.socket_, "async_connect"));
start_connect_op(impl, p.p, is_continuation,
- peer_endpoint.data(), peer_endpoint.size());
+ peer_endpoint.data(), peer_endpoint.size(), &io_ex, 0);
p.v = p.p = 0;
}
};
@@ -601,5 +628,6 @@ public:
#include "asio/detail/pop_options.hpp"
#endif // !defined(ASIO_HAS_IOCP)
+ // && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/detail/reactive_socket_service_base.hpp b/3rdparty/asio/include/asio/detail/reactive_socket_service_base.hpp
index c36811b9a99..63dcacad582 100644
--- a/3rdparty/asio/include/asio/detail/reactive_socket_service_base.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_socket_service_base.hpp
@@ -2,7 +2,7 @@
// detail/reactive_socket_service_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,7 +18,8 @@
#include "asio/detail/config.hpp"
#if !defined(ASIO_HAS_IOCP) \
- && !defined(ASIO_WINDOWS_RUNTIME)
+ && !defined(ASIO_WINDOWS_RUNTIME) \
+ && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#include "asio/associated_cancellation_slot.hpp"
#include "asio/buffer.hpp"
@@ -74,7 +75,7 @@ public:
// Move-construct a new socket implementation.
ASIO_DECL void base_move_construct(base_implementation_type& impl,
- base_implementation_type& other_impl) ASIO_NOEXCEPT;
+ base_implementation_type& other_impl) noexcept;
// Move-assign from another socket implementation.
ASIO_DECL void base_move_assign(base_implementation_type& impl,
@@ -201,7 +202,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -216,20 +217,21 @@ public:
int op_type;
switch (w)
{
- case socket_base::wait_read:
- op_type = reactor::read_op;
- break;
- case socket_base::wait_write:
- op_type = reactor::write_op;
- break;
- case socket_base::wait_error:
- op_type = reactor::except_op;
- break;
- default:
- p.p->ec_ = asio::error::invalid_argument;
- reactor_.post_immediate_completion(p.p, is_continuation);
- p.v = p.p = 0;
- return;
+ case socket_base::wait_read:
+ op_type = reactor::read_op;
+ break;
+ case socket_base::wait_write:
+ op_type = reactor::write_op;
+ break;
+ case socket_base::wait_error:
+ op_type = reactor::except_op;
+ break;
+ default:
+ p.p->ec_ = asio::error::invalid_argument;
+ start_op(impl, reactor::read_op, p.p,
+ is_continuation, false, true, &io_ex, 0);
+ p.v = p.p = 0;
+ return;
}
// Optionally register for per-operation cancellation.
@@ -240,7 +242,7 @@ public:
&reactor_, &impl.reactor_data_, impl.socket_, op_type);
}
- start_op(impl, op_type, p.p, is_continuation, false, false);
+ start_op(impl, op_type, p.p, is_continuation, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -287,7 +289,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -312,7 +314,7 @@ public:
start_op(impl, reactor::write_op, p.p, is_continuation, true,
((impl.state_ & socket_ops::stream_oriented)
&& buffer_sequence_adapter<asio::const_buffer,
- ConstBufferSequence>::all_empty(buffers)));
+ ConstBufferSequence>::all_empty(buffers)), &io_ex, 0);
p.v = p.p = 0;
}
@@ -324,7 +326,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -344,7 +346,8 @@ public:
ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket",
&impl, impl.socket_, "async_send(null_buffers)"));
- start_op(impl, reactor::write_op, p.p, is_continuation, false, false);
+ start_op(impl, reactor::write_op, p.p,
+ is_continuation, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -392,7 +395,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -421,7 +424,7 @@ public:
(flags & socket_base::message_out_of_band) == 0,
((impl.state_ & socket_ops::stream_oriented)
&& buffer_sequence_adapter<asio::mutable_buffer,
- MutableBufferSequence>::all_empty(buffers)));
+ MutableBufferSequence>::all_empty(buffers)), &io_ex, 0);
p.v = p.p = 0;
}
@@ -434,7 +437,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -457,7 +460,7 @@ public:
start_op(impl,
(flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
- p.p, is_continuation, false, false);
+ p.p, is_continuation, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -503,7 +506,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -529,7 +532,7 @@ public:
(in_flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
p.p, is_continuation,
- (in_flags & socket_base::message_out_of_band) == 0, false);
+ (in_flags & socket_base::message_out_of_band) == 0, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -543,7 +546,7 @@ public:
bool is_continuation =
asio_handler_cont_helpers::is_continuation(handler);
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -570,7 +573,7 @@ public:
start_op(impl,
(in_flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
- p.p, is_continuation, false, false);
+ p.p, is_continuation, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -586,24 +589,118 @@ protected:
const native_handle_type& native_socket, asio::error_code& ec);
// Start the asynchronous read or write operation.
- ASIO_DECL void start_op(base_implementation_type& impl, int op_type,
- reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop);
+ ASIO_DECL void do_start_op(base_implementation_type& impl, int op_type,
+ reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop,
+ void (*on_immediate)(operation* op, bool, const void*),
+ const void* immediate_arg);
+
+ // Start the asynchronous operation for handlers that are specialised for
+ // immediate completion.
+ template <typename Op>
+ void start_op(base_implementation_type& impl, int op_type, Op* op,
+ bool is_continuation, bool is_non_blocking, bool noop,
+ const void* io_ex, ...)
+ {
+ return do_start_op(impl, op_type, op, is_continuation,
+ is_non_blocking, noop, &Op::do_immediate, io_ex);
+ }
+
+ // Start the asynchronous operation for handlers that are not specialised for
+ // immediate completion.
+ template <typename Op>
+ void start_op(base_implementation_type& impl, int op_type, Op* op,
+ bool is_continuation, bool is_non_blocking, bool noop, const void*,
+ enable_if_t<
+ is_same<
+ typename associated_immediate_executor<
+ typename Op::handler_type,
+ typename Op::io_executor_type
+ >::asio_associated_immediate_executor_is_unspecialised,
+ void
+ >::value
+ >*)
+ {
+ return do_start_op(impl, op_type, op, is_continuation, is_non_blocking,
+ noop, &reactor::call_post_immediate_completion, &reactor_);
+ }
// Start the asynchronous accept operation.
- ASIO_DECL void start_accept_op(base_implementation_type& impl,
- reactor_op* op, bool is_continuation, bool peer_is_open);
+ ASIO_DECL void do_start_accept_op(base_implementation_type& impl,
+ reactor_op* op, bool is_continuation, bool peer_is_open,
+ void (*on_immediate)(operation* op, bool, const void*),
+ const void* immediate_arg);
+
+ // Start the asynchronous accept operation for handlers that are specialised
+ // for immediate completion.
+ template <typename Op>
+ void start_accept_op(base_implementation_type& impl, Op* op,
+ bool is_continuation, bool peer_is_open, const void* io_ex, ...)
+ {
+ return do_start_accept_op(impl, op, is_continuation,
+ peer_is_open, &Op::do_immediate, io_ex);
+ }
+
+ // Start the asynchronous operation for handlers that are not specialised for
+ // immediate completion.
+ template <typename Op>
+ void start_accept_op(base_implementation_type& impl, Op* op,
+ bool is_continuation, bool peer_is_open, const void*,
+ enable_if_t<
+ is_same<
+ typename associated_immediate_executor<
+ typename Op::handler_type,
+ typename Op::io_executor_type
+ >::asio_associated_immediate_executor_is_unspecialised,
+ void
+ >::value
+ >*)
+ {
+ return do_start_accept_op(impl, op, is_continuation, peer_is_open,
+ &reactor::call_post_immediate_completion, &reactor_);
+ }
// Start the asynchronous connect operation.
- ASIO_DECL void start_connect_op(base_implementation_type& impl,
- reactor_op* op, bool is_continuation,
- const socket_addr_type* addr, size_t addrlen);
+ ASIO_DECL void do_start_connect_op(base_implementation_type& impl,
+ reactor_op* op, bool is_continuation, const void* addr, size_t addrlen,
+ void (*on_immediate)(operation* op, bool, const void*),
+ const void* immediate_arg);
+
+ // Start the asynchronous operation for handlers that are specialised for
+ // immediate completion.
+ template <typename Op>
+ void start_connect_op(base_implementation_type& impl,
+ Op* op, bool is_continuation, const void* addr,
+ size_t addrlen, const void* io_ex, ...)
+ {
+ return do_start_connect_op(impl, op, is_continuation,
+ addr, addrlen, &Op::do_immediate, io_ex);
+ }
+
+ // Start the asynchronous operation for handlers that are not specialised for
+ // immediate completion.
+ template <typename Op>
+ void start_connect_op(base_implementation_type& impl, Op* op,
+ bool is_continuation, const void* addr, size_t addrlen, const void*,
+ enable_if_t<
+ is_same<
+ typename associated_immediate_executor<
+ typename Op::handler_type,
+ typename Op::io_executor_type
+ >::asio_associated_immediate_executor_is_unspecialised,
+ void
+ >::value
+ >*)
+ {
+ return do_start_connect_op(impl, op, is_continuation, addr,
+ addrlen, &reactor::call_post_immediate_completion, &reactor_);
+ }
// Helper class used to implement per-operation cancellation
class reactor_op_cancellation
{
public:
reactor_op_cancellation(reactor* r,
- reactor::per_descriptor_data* p, int d, int o)
+ reactor::per_descriptor_data* p, socket_type d, int o)
: reactor_(r),
reactor_data_(p),
descriptor_(d),
@@ -626,7 +723,7 @@ protected:
private:
reactor* reactor_;
reactor::per_descriptor_data* reactor_data_;
- int descriptor_;
+ socket_type descriptor_;
int op_type_;
};
@@ -648,5 +745,6 @@ protected:
#endif // !defined(ASIO_HAS_IOCP)
// && !defined(ASIO_WINDOWS_RUNTIME)
+ // && !defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP
diff --git a/3rdparty/asio/include/asio/detail/reactive_wait_op.hpp b/3rdparty/asio/include/asio/detail/reactive_wait_op.hpp
index c7e2eb8d376..62938e2d83e 100644
--- a/3rdparty/asio/include/asio/detail/reactive_wait_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactive_wait_op.hpp
@@ -2,7 +2,7 @@
// detail/reactive_wait_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,7 +19,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -33,13 +32,16 @@ template <typename Handler, typename IoExecutor>
class reactive_wait_op : public reactor_op
{
public:
+ typedef Handler handler_type;
+ typedef IoExecutor io_executor_type;
+
ASIO_DEFINE_HANDLER_PTR(reactive_wait_op);
reactive_wait_op(const asio::error_code& success_ec,
Handler& handler, const IoExecutor& io_ex)
: reactor_op(success_ec, &reactive_wait_op::do_perform,
&reactive_wait_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -54,6 +56,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
reactive_wait_op* o(static_cast<reactive_wait_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -61,7 +64,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
// Make a copy of the handler so that the memory can be deallocated before
@@ -85,6 +88,36 @@ public:
}
}
+ static void do_immediate(operation* base, bool, const void* io_ex)
+ {
+ // Take ownership of the handler object.
+ ASIO_ASSUME(base != 0);
+ reactive_wait_op* o(static_cast<reactive_wait_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ immediate_handler_work<Handler, IoExecutor> w(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ detail::binder1<Handler, asio::error_code>
+ handler(o->handler_, o->ec_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_));
+ w.complete(handler, handler.handler_, io_ex);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/3rdparty/asio/include/asio/detail/reactor.hpp b/3rdparty/asio/include/asio/detail/reactor.hpp
index 03a601c7d43..054acfdab00 100644
--- a/3rdparty/asio/include/asio/detail/reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/reactor.hpp
@@ -2,7 +2,7 @@
// detail/reactor.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -15,18 +15,40 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include "asio/detail/reactor_fwd.hpp"
+#include "asio/detail/config.hpp"
-#if defined(ASIO_HAS_EPOLL)
+#if defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME)
+# include "asio/detail/null_reactor.hpp"
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/null_reactor.hpp"
+#elif defined(ASIO_HAS_EPOLL)
# include "asio/detail/epoll_reactor.hpp"
#elif defined(ASIO_HAS_KQUEUE)
# include "asio/detail/kqueue_reactor.hpp"
#elif defined(ASIO_HAS_DEV_POLL)
# include "asio/detail/dev_poll_reactor.hpp"
-#elif defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME)
-# include "asio/detail/null_reactor.hpp"
#else
# include "asio/detail/select_reactor.hpp"
#endif
+namespace asio {
+namespace detail {
+
+#if defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME)
+typedef null_reactor reactor;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+typedef null_reactor reactor;
+#elif defined(ASIO_HAS_EPOLL)
+typedef epoll_reactor reactor;
+#elif defined(ASIO_HAS_KQUEUE)
+typedef kqueue_reactor reactor;
+#elif defined(ASIO_HAS_DEV_POLL)
+typedef dev_poll_reactor reactor;
+#else
+typedef select_reactor reactor;
+#endif
+
+} // namespace detail
+} // namespace asio
+
#endif // ASIO_DETAIL_REACTOR_HPP
diff --git a/3rdparty/asio/include/asio/detail/reactor_fwd.hpp b/3rdparty/asio/include/asio/detail/reactor_fwd.hpp
deleted file mode 100644
index b9c084614ab..00000000000
--- a/3rdparty/asio/include/asio/detail/reactor_fwd.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// detail/reactor_fwd.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_REACTOR_FWD_HPP
-#define ASIO_DETAIL_REACTOR_FWD_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-namespace asio {
-namespace detail {
-
-#if defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME)
-typedef class null_reactor reactor;
-#elif defined(ASIO_HAS_IOCP)
-typedef class select_reactor reactor;
-#elif defined(ASIO_HAS_EPOLL)
-typedef class epoll_reactor reactor;
-#elif defined(ASIO_HAS_KQUEUE)
-typedef class kqueue_reactor reactor;
-#elif defined(ASIO_HAS_DEV_POLL)
-typedef class dev_poll_reactor reactor;
-#else
-typedef class select_reactor reactor;
-#endif
-
-} // namespace detail
-} // namespace asio
-
-#endif // ASIO_DETAIL_REACTOR_FWD_HPP
diff --git a/3rdparty/asio/include/asio/detail/reactor_op.hpp b/3rdparty/asio/include/asio/detail/reactor_op.hpp
index d38aa7e111e..54d6cd964eb 100644
--- a/3rdparty/asio/include/asio/detail/reactor_op.hpp
+++ b/3rdparty/asio/include/asio/detail/reactor_op.hpp
@@ -2,7 +2,7 @@
// detail/reactor_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/reactor_op_queue.hpp b/3rdparty/asio/include/asio/detail/reactor_op_queue.hpp
index 0eb4ca3293a..fae1a52d9e7 100644
--- a/3rdparty/asio/include/asio/detail/reactor_op_queue.hpp
+++ b/3rdparty/asio/include/asio/detail/reactor_op_queue.hpp
@@ -2,7 +2,7 @@
// detail/reactor_op_queue.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/recycling_allocator.hpp b/3rdparty/asio/include/asio/detail/recycling_allocator.hpp
index 8ca2e2ba16b..d556f22a399 100644
--- a/3rdparty/asio/include/asio/detail/recycling_allocator.hpp
+++ b/3rdparty/asio/include/asio/detail/recycling_allocator.hpp
@@ -2,7 +2,7 @@
// detail/recycling_allocator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -50,7 +50,7 @@ public:
{
void* p = thread_info_base::allocate(Purpose(),
thread_context::top_of_thread_call_stack(),
- sizeof(T) * n, ASIO_ALIGNOF(T));
+ sizeof(T) * n, alignof(T));
return static_cast<T*>(p);
}
diff --git a/3rdparty/asio/include/asio/detail/regex_fwd.hpp b/3rdparty/asio/include/asio/detail/regex_fwd.hpp
index bde7402ee66..a5c6c0a9428 100644
--- a/3rdparty/asio/include/asio/detail/regex_fwd.hpp
+++ b/3rdparty/asio/include/asio/detail/regex_fwd.hpp
@@ -2,7 +2,7 @@
// detail/regex_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,18 +17,6 @@
#if defined(ASIO_HAS_BOOST_REGEX)
-#include <boost/regex_fwd.hpp>
-#include <boost/version.hpp>
-#if BOOST_VERSION >= 107600
-# if defined(BOOST_REGEX_CXX03)
-# include <boost/regex/v4/match_flags.hpp>
-# else // defined(BOOST_REGEX_CXX03)
-# include <boost/regex/v5/match_flags.hpp>
-# endif // defined(BOOST_REGEX_CXX03)
-#else // BOOST_VERSION >= 107600
-# include <boost/regex/v4/match_flags.hpp>
-#endif // BOOST_VERSION >= 107600
-
namespace boost {
template <class BidiIterator>
@@ -37,6 +25,9 @@ struct sub_match;
template <class BidiIterator, class Allocator>
class match_results;
+template <class CharT, class Traits>
+class basic_regex;
+
} // namespace boost
#endif // defined(ASIO_HAS_BOOST_REGEX)
diff --git a/3rdparty/asio/include/asio/detail/resolve_endpoint_op.hpp b/3rdparty/asio/include/asio/detail/resolve_endpoint_op.hpp
index 998bbb8a8cf..c7cb2c4c101 100644
--- a/3rdparty/asio/include/asio/detail/resolve_endpoint_op.hpp
+++ b/3rdparty/asio/include/asio/detail/resolve_endpoint_op.hpp
@@ -2,7 +2,7 @@
// detail/resolve_endpoint_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,7 +19,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/resolve_op.hpp"
@@ -60,7 +59,7 @@ public:
cancel_token_(cancel_token),
endpoint_(endpoint),
scheduler_(sched),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -70,6 +69,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
resolve_endpoint_op* o(static_cast<resolve_endpoint_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -99,7 +99,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
// Make a copy of the handler so that the memory can be deallocated
diff --git a/3rdparty/asio/include/asio/detail/resolve_op.hpp b/3rdparty/asio/include/asio/detail/resolve_op.hpp
index e0ac00bd746..5b41ad2fe68 100644
--- a/3rdparty/asio/include/asio/detail/resolve_op.hpp
+++ b/3rdparty/asio/include/asio/detail/resolve_op.hpp
@@ -2,7 +2,7 @@
// detail/resolve_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/resolve_query_op.hpp b/3rdparty/asio/include/asio/detail/resolve_query_op.hpp
index 5a2ffa71a7b..b7f9e35cef0 100644
--- a/3rdparty/asio/include/asio/detail/resolve_query_op.hpp
+++ b/3rdparty/asio/include/asio/detail/resolve_query_op.hpp
@@ -2,7 +2,7 @@
// detail/resolve_query_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,7 +19,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/resolve_op.hpp"
@@ -61,7 +60,7 @@ public:
cancel_token_(cancel_token),
query_(qry),
scheduler_(sched),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex),
addrinfo_(0)
{
@@ -78,6 +77,7 @@ public:
std::size_t /*bytes_transferred*/)
{
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
resolve_query_op* o(static_cast<resolve_query_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -104,7 +104,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
// Make a copy of the handler so that the memory can be deallocated
diff --git a/3rdparty/asio/include/asio/detail/resolver_service.hpp b/3rdparty/asio/include/asio/detail/resolver_service.hpp
index 006b35c7c5a..2d1fe22b62a 100644
--- a/3rdparty/asio/include/asio/detail/resolver_service.hpp
+++ b/3rdparty/asio/include/asio/detail/resolver_service.hpp
@@ -2,7 +2,7 @@
// detail/resolver_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -34,7 +34,7 @@ namespace detail {
template <typename Protocol>
class resolver_service :
- public execution_context_service_base<resolver_service<Protocol> >,
+ public execution_context_service_base<resolver_service<Protocol>>,
public resolver_service_base
{
public:
@@ -53,7 +53,7 @@ public:
// Constructor.
resolver_service(execution_context& context)
- : execution_context_service_base<resolver_service<Protocol> >(context),
+ : execution_context_service_base<resolver_service<Protocol>>(context),
resolver_service_base(context)
{
}
@@ -80,6 +80,7 @@ public:
qry.service_name().c_str(), qry.hints(), &address_info, ec);
auto_addrinfo auto_address_info(address_info);
+ ASIO_ERROR_LOCATION(ec);
return ec ? results_type() : results_type::create(
address_info, qry.host_name(), qry.service_name());
}
@@ -112,6 +113,7 @@ public:
host_name, NI_MAXHOST, service_name, NI_MAXSERV,
endpoint.protocol().type(), ec);
+ ASIO_ERROR_LOCATION(ec);
return ec ? results_type() : results_type::create(
endpoint, host_name, service_name);
}
diff --git a/3rdparty/asio/include/asio/detail/resolver_service_base.hpp b/3rdparty/asio/include/asio/detail/resolver_service_base.hpp
index 0df30f40607..160793c89cb 100644
--- a/3rdparty/asio/include/asio/detail/resolver_service_base.hpp
+++ b/3rdparty/asio/include/asio/detail/resolver_service_base.hpp
@@ -2,7 +2,7 @@
// detail/resolver_service_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/scheduler.hpp b/3rdparty/asio/include/asio/detail/scheduler.hpp
index ce8a7e17b9b..a73ec141ebc 100644
--- a/3rdparty/asio/include/asio/detail/scheduler.hpp
+++ b/3rdparty/asio/include/asio/detail/scheduler.hpp
@@ -2,7 +2,7 @@
// detail/scheduler.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,8 +23,8 @@
#include "asio/detail/conditionally_enabled_event.hpp"
#include "asio/detail/conditionally_enabled_mutex.hpp"
#include "asio/detail/op_queue.hpp"
-#include "asio/detail/reactor_fwd.hpp"
#include "asio/detail/scheduler_operation.hpp"
+#include "asio/detail/scheduler_task.hpp"
#include "asio/detail/thread.hpp"
#include "asio/detail/thread_context.hpp"
@@ -42,10 +42,15 @@ class scheduler
public:
typedef scheduler_operation operation;
+ // The type of a function used to obtain a task instance.
+ typedef scheduler_task* (*get_task_func_type)(
+ asio::execution_context&);
+
// Constructor. Specifies the number of concurrent threads that are likely to
// run the scheduler. If set to 1 certain optimisation are performed.
ASIO_DECL scheduler(asio::execution_context& ctx,
- int concurrency_hint = 0, bool own_thread = true);
+ int concurrency_hint = 0, bool own_thread = true,
+ get_task_func_type get_task = &scheduler::get_default_task);
// Destructor.
ASIO_DECL ~scheduler();
@@ -165,6 +170,10 @@ private:
ASIO_DECL void wake_one_thread_and_unlock(
mutex::scoped_lock& lock);
+ // Get the default task.
+ ASIO_DECL static scheduler_task* get_default_task(
+ asio::execution_context& ctx);
+
// Helper class to run the scheduler in its own thread.
class thread_function;
friend class thread_function;
@@ -187,7 +196,10 @@ private:
event wakeup_event_;
// The task to be run by this service.
- reactor* task_;
+ scheduler_task* task_;
+
+ // The function used to get the task.
+ get_task_func_type get_task_;
// Operation object to represent the position of the task in the queue.
struct task_operation : operation
diff --git a/3rdparty/asio/include/asio/detail/scheduler_operation.hpp b/3rdparty/asio/include/asio/detail/scheduler_operation.hpp
index 1ca4964f540..1b4ceb36f5c 100644
--- a/3rdparty/asio/include/asio/detail/scheduler_operation.hpp
+++ b/3rdparty/asio/include/asio/detail/scheduler_operation.hpp
@@ -2,7 +2,7 @@
// detail/scheduler_operation.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/scheduler_task.hpp b/3rdparty/asio/include/asio/detail/scheduler_task.hpp
new file mode 100644
index 00000000000..a1a4ec1c85f
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/scheduler_task.hpp
@@ -0,0 +1,49 @@
+//
+// detail/scheduler_task.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_SCHEDULER_TASK_HPP
+#define ASIO_DETAIL_SCHEDULER_TASK_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/op_queue.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class scheduler_operation;
+
+// Base class for all tasks that may be run by a scheduler.
+class scheduler_task
+{
+public:
+ // Run the task once until interrupted or events are ready to be dispatched.
+ virtual void run(long usec, op_queue<scheduler_operation>& ops) = 0;
+
+ // Interrupt the task.
+ virtual void interrupt() = 0;
+
+protected:
+ // Prevent deletion through this type.
+ ~scheduler_task()
+ {
+ }
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_DETAIL_SCHEDULER_TASK_HPP
diff --git a/3rdparty/asio/include/asio/detail/scheduler_thread_info.hpp b/3rdparty/asio/include/asio/detail/scheduler_thread_info.hpp
index 3202e3c5792..410d2866b59 100644
--- a/3rdparty/asio/include/asio/detail/scheduler_thread_info.hpp
+++ b/3rdparty/asio/include/asio/detail/scheduler_thread_info.hpp
@@ -2,7 +2,7 @@
// detail/scheduler_thread_info.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/scoped_lock.hpp b/3rdparty/asio/include/asio/detail/scoped_lock.hpp
index 273d702375a..778832d6350 100644
--- a/3rdparty/asio/include/asio/detail/scoped_lock.hpp
+++ b/3rdparty/asio/include/asio/detail/scoped_lock.hpp
@@ -2,7 +2,7 @@
// detail/scoped_lock.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/scoped_ptr.hpp b/3rdparty/asio/include/asio/detail/scoped_ptr.hpp
index 2eab4c99a36..a517c2b947c 100644
--- a/3rdparty/asio/include/asio/detail/scoped_ptr.hpp
+++ b/3rdparty/asio/include/asio/detail/scoped_ptr.hpp
@@ -2,7 +2,7 @@
// detail/scoped_ptr.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/select_interrupter.hpp b/3rdparty/asio/include/asio/detail/select_interrupter.hpp
index a542373cc3b..57cb4ce8d71 100644
--- a/3rdparty/asio/include/asio/detail/select_interrupter.hpp
+++ b/3rdparty/asio/include/asio/detail/select_interrupter.hpp
@@ -2,7 +2,7 @@
// detail/select_interrupter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/select_reactor.hpp b/3rdparty/asio/include/asio/detail/select_reactor.hpp
index cb3e525a1d0..7fe647b7e63 100644
--- a/3rdparty/asio/include/asio/detail/select_reactor.hpp
+++ b/3rdparty/asio/include/asio/detail/select_reactor.hpp
@@ -2,7 +2,7 @@
// detail/select_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -30,6 +30,7 @@
#include "asio/detail/op_queue.hpp"
#include "asio/detail/reactor_op.hpp"
#include "asio/detail/reactor_op_queue.hpp"
+#include "asio/detail/scheduler_task.hpp"
#include "asio/detail/select_interrupter.hpp"
#include "asio/detail/socket_types.hpp"
#include "asio/detail/timer_queue_base.hpp"
@@ -48,6 +49,9 @@ namespace detail {
class select_reactor
: public execution_context_service_base<select_reactor>
+#if !defined(ASIO_HAS_IOCP)
+ , public scheduler_task
+#endif // !defined(ASIO_HAS_IOCP)
{
public:
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
@@ -90,12 +94,29 @@ public:
per_descriptor_data& descriptor_data, reactor_op* op);
// Post a reactor operation for immediate completion.
- void post_immediate_completion(reactor_op* op, bool is_continuation);
+ void post_immediate_completion(operation* op, bool is_continuation) const;
+
+ // Post a reactor operation for immediate completion.
+ ASIO_DECL static void call_post_immediate_completion(
+ operation* op, bool is_continuation, const void* self);
// Start a new operation. The reactor operation will be performed when the
// given descriptor is flagged as ready, or an error has occurred.
ASIO_DECL void start_op(int op_type, socket_type descriptor,
- per_descriptor_data&, reactor_op* op, bool is_continuation, bool);
+ per_descriptor_data&, reactor_op* op, bool is_continuation, bool,
+ void (*on_immediate)(operation*, bool, const void*),
+ const void* immediate_arg);
+
+ // Start a new operation. The reactor operation will be performed when the
+ // given descriptor is flagged as ready, or an error has occurred.
+ void start_op(int op_type, socket_type descriptor,
+ per_descriptor_data& descriptor_data, reactor_op* op,
+ bool is_continuation, bool allow_speculative)
+ {
+ start_op(op_type, descriptor, descriptor_data,
+ op, is_continuation, allow_speculative,
+ &select_reactor::call_post_immediate_completion, this);
+ }
// Cancel all operations associated with the given descriptor. The
// handlers associated with the descriptor will be invoked with the
@@ -223,6 +244,28 @@ private:
// The thread that is running the reactor loop.
asio::detail::thread* thread_;
+
+ // Helper class to join and restart the reactor thread.
+ class restart_reactor : public operation
+ {
+ public:
+ restart_reactor(select_reactor* r)
+ : operation(&restart_reactor::do_complete),
+ reactor_(r)
+ {
+ }
+
+ ASIO_DECL static void do_complete(void* owner, operation* base,
+ const asio::error_code& ec, std::size_t bytes_transferred);
+
+ private:
+ select_reactor* reactor_;
+ };
+
+ friend class restart_reactor;
+
+ // Operation used to join and restart the reactor thread.
+ restart_reactor restart_reactor_;
#endif // defined(ASIO_HAS_IOCP)
// Whether the service has been shut down.
diff --git a/3rdparty/asio/include/asio/detail/service_registry.hpp b/3rdparty/asio/include/asio/detail/service_registry.hpp
index 2c7f4a52068..991b32a4980 100644
--- a/3rdparty/asio/include/asio/detail/service_registry.hpp
+++ b/3rdparty/asio/include/asio/detail/service_registry.hpp
@@ -2,7 +2,7 @@
// detail/service_registry.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -84,8 +84,7 @@ private:
// Initalise a service's key when the key_type typedef is available.
template <typename Service>
static void init_key(execution_context::service::key& key,
- typename enable_if<
- is_base_of<typename Service::key_type, Service>::value>::type*);
+ enable_if_t<is_base_of<typename Service::key_type, Service>::value>*);
#endif // !defined(ASIO_NO_TYPEID)
// Initialise a service's key based on its id.
diff --git a/3rdparty/asio/include/asio/detail/signal_blocker.hpp b/3rdparty/asio/include/asio/detail/signal_blocker.hpp
index bbe7b3fedd5..11d0b0e9633 100644
--- a/3rdparty/asio/include/asio/detail/signal_blocker.hpp
+++ b/3rdparty/asio/include/asio/detail/signal_blocker.hpp
@@ -2,7 +2,7 @@
// detail/signal_blocker.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/signal_handler.hpp b/3rdparty/asio/include/asio/detail/signal_handler.hpp
index 0153133f1de..6d43f578cb9 100644
--- a/3rdparty/asio/include/asio/detail/signal_handler.hpp
+++ b/3rdparty/asio/include/asio/detail/signal_handler.hpp
@@ -2,7 +2,7 @@
// detail/signal_handler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -36,7 +36,7 @@ public:
signal_handler(Handler& h, const IoExecutor& io_ex)
: signal_op(&signal_handler::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(h)),
+ handler_(static_cast<Handler&&>(h)),
work_(handler_, io_ex)
{
}
@@ -53,7 +53,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
h->work_));
// Make a copy of the handler so that the memory can be deallocated before
diff --git a/3rdparty/asio/include/asio/detail/signal_init.hpp b/3rdparty/asio/include/asio/detail/signal_init.hpp
index 80c7a7adc81..6f2c7c867e2 100644
--- a/3rdparty/asio/include/asio/detail/signal_init.hpp
+++ b/3rdparty/asio/include/asio/detail/signal_init.hpp
@@ -2,7 +2,7 @@
// detail/signal_init.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/signal_op.hpp b/3rdparty/asio/include/asio/detail/signal_op.hpp
index 297c0d9fa76..5e0071a5d62 100644
--- a/3rdparty/asio/include/asio/detail/signal_op.hpp
+++ b/3rdparty/asio/include/asio/detail/signal_op.hpp
@@ -2,7 +2,7 @@
// detail/signal_op.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -30,12 +30,16 @@ public:
// The error code to be passed to the completion handler.
asio::error_code ec_;
+ // The operation key used for targeted cancellation.
+ void* cancellation_key_;
+
// The signal number to be passed to the completion handler.
int signal_number_;
protected:
signal_op(func_type func)
: operation(func),
+ cancellation_key_(0),
signal_number_(0)
{
}
diff --git a/3rdparty/asio/include/asio/detail/signal_set_service.hpp b/3rdparty/asio/include/asio/detail/signal_set_service.hpp
index 7652fe20064..142ff43851a 100644
--- a/3rdparty/asio/include/asio/detail/signal_set_service.hpp
+++ b/3rdparty/asio/include/asio/detail/signal_set_service.hpp
@@ -2,7 +2,7 @@
// detail/signal_set_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,8 +19,11 @@
#include <cstddef>
#include <signal.h>
+#include "asio/associated_cancellation_slot.hpp"
+#include "asio/cancellation_type.hpp"
#include "asio/error.hpp"
#include "asio/execution_context.hpp"
+#include "asio/signal_set_base.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/op_queue.hpp"
@@ -35,7 +38,11 @@
#endif // defined(ASIO_HAS_IOCP)
#if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__)
-# include "asio/detail/reactor.hpp"
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_service.hpp"
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/reactor.hpp"
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__)
#include "asio/detail/push_options.hpp"
@@ -134,8 +141,16 @@ public:
ASIO_DECL void destroy(implementation_type& impl);
// Add a signal to a signal_set.
+ asio::error_code add(implementation_type& impl,
+ int signal_number, asio::error_code& ec)
+ {
+ return add(impl, signal_number, signal_set_base::flags::dont_care, ec);
+ }
+
+ // Add a signal to a signal_set with the specified flags.
ASIO_DECL asio::error_code add(implementation_type& impl,
- int signal_number, asio::error_code& ec);
+ int signal_number, signal_set_base::flags_t f,
+ asio::error_code& ec);
// Remove a signal to a signal_set.
ASIO_DECL asio::error_code remove(implementation_type& impl,
@@ -149,17 +164,31 @@ public:
ASIO_DECL asio::error_code cancel(implementation_type& impl,
asio::error_code& ec);
+ // Cancel a specific operation associated with the signal set.
+ ASIO_DECL void cancel_ops_by_key(implementation_type& impl,
+ void* cancellation_key);
+
// Start an asynchronous operation to wait for a signal to be delivered.
template <typename Handler, typename IoExecutor>
void async_wait(implementation_type& impl,
Handler& handler, const IoExecutor& io_ex)
{
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
// Allocate and construct an operation to wrap the handler.
typedef signal_handler<Handler, IoExecutor> op;
typename op::ptr p = { asio::detail::addressof(handler),
op::ptr::allocate(handler), 0 };
p.p = new (p.v) op(handler, io_ex);
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<signal_op_cancellation>(this, &impl);
+ }
+
ASIO_HANDLER_CREATION((scheduler_.context(),
*p.p, "signal_set", &impl, 0, "async_wait"));
@@ -186,6 +215,32 @@ private:
// Helper function to start a wait operation.
ASIO_DECL void start_wait_op(implementation_type& impl, signal_op* op);
+ // Helper class used to implement per-operation cancellation
+ class signal_op_cancellation
+ {
+ public:
+ signal_op_cancellation(signal_set_service* s, implementation_type* i)
+ : service_(s),
+ implementation_(i)
+ {
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ if (!!(type &
+ (cancellation_type::terminal
+ | cancellation_type::partial
+ | cancellation_type::total)))
+ {
+ service_->cancel_ops_by_key(*implementation_, this);
+ }
+ }
+
+ private:
+ signal_set_service* service_;
+ implementation_type* implementation_;
+ };
+
// The scheduler used for dispatching handlers.
#if defined(ASIO_HAS_IOCP)
typedef class win_iocp_io_context scheduler_impl;
@@ -197,14 +252,22 @@ private:
#if !defined(ASIO_WINDOWS) \
&& !defined(ASIO_WINDOWS_RUNTIME) \
&& !defined(__CYGWIN__)
- // The type used for registering for pipe reactor notifications.
+ // The type used for processing pipe readiness notifications.
class pipe_read_op;
+# if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ // The io_uring service used for waiting for pipe readiness.
+ io_uring_service& io_uring_service_;
+
+ // The per I/O object data used for the pipe.
+ io_uring_service::per_io_object_data io_object_data_;
+# else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
// The reactor used for waiting for pipe readiness.
reactor& reactor_;
// The per-descriptor reactor data used for the pipe.
reactor::per_descriptor_data reactor_data_;
+# endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#endif // !defined(ASIO_WINDOWS)
// && !defined(ASIO_WINDOWS_RUNTIME)
// && !defined(__CYGWIN__)
diff --git a/3rdparty/asio/include/asio/detail/socket_holder.hpp b/3rdparty/asio/include/asio/detail/socket_holder.hpp
index 571b9f67c27..300e3736636 100644
--- a/3rdparty/asio/include/asio/detail/socket_holder.hpp
+++ b/3rdparty/asio/include/asio/detail/socket_holder.hpp
@@ -2,7 +2,7 @@
// detail/socket_holder.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/socket_ops.hpp b/3rdparty/asio/include/asio/detail/socket_ops.hpp
index a37684e1c62..fd2dc09c094 100644
--- a/3rdparty/asio/include/asio/detail/socket_ops.hpp
+++ b/3rdparty/asio/include/asio/detail/socket_ops.hpp
@@ -2,7 +2,7 @@
// detail/socket_ops.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -63,29 +63,27 @@ typedef weak_ptr<void> weak_cancel_token_type;
#if !defined(ASIO_WINDOWS_RUNTIME)
-ASIO_DECL socket_type accept(socket_type s, socket_addr_type* addr,
+ASIO_DECL socket_type accept(socket_type s, void* addr,
std::size_t* addrlen, asio::error_code& ec);
-ASIO_DECL socket_type sync_accept(socket_type s,
- state_type state, socket_addr_type* addr,
- std::size_t* addrlen, asio::error_code& ec);
+ASIO_DECL socket_type sync_accept(socket_type s, state_type state,
+ void* addr, std::size_t* addrlen, asio::error_code& ec);
#if defined(ASIO_HAS_IOCP)
-ASIO_DECL void complete_iocp_accept(socket_type s,
- void* output_buffer, DWORD address_length,
- socket_addr_type* addr, std::size_t* addrlen,
+ASIO_DECL void complete_iocp_accept(socket_type s, void* output_buffer,
+ DWORD address_length, void* addr, std::size_t* addrlen,
socket_type new_socket, asio::error_code& ec);
#else // defined(ASIO_HAS_IOCP)
ASIO_DECL bool non_blocking_accept(socket_type s,
- state_type state, socket_addr_type* addr, std::size_t* addrlen,
+ state_type state, void* addr, std::size_t* addrlen,
asio::error_code& ec, socket_type& new_socket);
#endif // defined(ASIO_HAS_IOCP)
-ASIO_DECL int bind(socket_type s, const socket_addr_type* addr,
+ASIO_DECL int bind(socket_type s, const void* addr,
std::size_t addrlen, asio::error_code& ec);
ASIO_DECL int close(socket_type s, state_type& state,
@@ -100,10 +98,10 @@ ASIO_DECL bool set_internal_non_blocking(socket_type s,
ASIO_DECL int shutdown(socket_type s,
int what, asio::error_code& ec);
-ASIO_DECL int connect(socket_type s, const socket_addr_type* addr,
+ASIO_DECL int connect(socket_type s, const void* addr,
std::size_t addrlen, asio::error_code& ec);
-ASIO_DECL void sync_connect(socket_type s, const socket_addr_type* addr,
+ASIO_DECL void sync_connect(socket_type s, const void* addr,
std::size_t addrlen, asio::error_code& ec);
#if defined(ASIO_HAS_IOCP)
@@ -166,20 +164,20 @@ ASIO_DECL bool non_blocking_recv1(socket_type s,
#endif // defined(ASIO_HAS_IOCP)
-ASIO_DECL signed_size_type recvfrom(socket_type s, buf* bufs,
- size_t count, int flags, socket_addr_type* addr,
+ASIO_DECL signed_size_type recvfrom(socket_type s,
+ buf* bufs, size_t count, int flags, void* addr,
std::size_t* addrlen, asio::error_code& ec);
-ASIO_DECL signed_size_type recvfrom1(socket_type s, void* data,
- size_t size, int flags, socket_addr_type* addr,
+ASIO_DECL signed_size_type recvfrom1(socket_type s,
+ void* data, size_t size, int flags, void* addr,
std::size_t* addrlen, asio::error_code& ec);
ASIO_DECL size_t sync_recvfrom(socket_type s, state_type state,
- buf* bufs, size_t count, int flags, socket_addr_type* addr,
+ buf* bufs, size_t count, int flags, void* addr,
std::size_t* addrlen, asio::error_code& ec);
ASIO_DECL size_t sync_recvfrom1(socket_type s, state_type state,
- void* data, size_t size, int flags, socket_addr_type* addr,
+ void* data, size_t size, int flags, void* addr,
std::size_t* addrlen, asio::error_code& ec);
#if defined(ASIO_HAS_IOCP)
@@ -190,14 +188,12 @@ ASIO_DECL void complete_iocp_recvfrom(
#else // defined(ASIO_HAS_IOCP)
-ASIO_DECL bool non_blocking_recvfrom(socket_type s,
- buf* bufs, size_t count, int flags,
- socket_addr_type* addr, std::size_t* addrlen,
+ASIO_DECL bool non_blocking_recvfrom(socket_type s, buf* bufs,
+ size_t count, int flags, void* addr, std::size_t* addrlen,
asio::error_code& ec, size_t& bytes_transferred);
-ASIO_DECL bool non_blocking_recvfrom1(socket_type s,
- void* data, size_t size, int flags,
- socket_addr_type* addr, std::size_t* addrlen,
+ASIO_DECL bool non_blocking_recvfrom1(socket_type s, void* data,
+ size_t size, int flags, void* addr, std::size_t* addrlen,
asio::error_code& ec, size_t& bytes_transferred);
#endif // defined(ASIO_HAS_IOCP)
@@ -255,32 +251,30 @@ ASIO_DECL bool non_blocking_send1(socket_type s,
#endif // defined(ASIO_HAS_IOCP)
-ASIO_DECL signed_size_type sendto(socket_type s, const buf* bufs,
- size_t count, int flags, const socket_addr_type* addr,
+ASIO_DECL signed_size_type sendto(socket_type s,
+ const buf* bufs, size_t count, int flags, const void* addr,
std::size_t addrlen, asio::error_code& ec);
-ASIO_DECL signed_size_type sendto1(socket_type s, const void* data,
- size_t size, int flags, const socket_addr_type* addr,
+ASIO_DECL signed_size_type sendto1(socket_type s,
+ const void* data, size_t size, int flags, const void* addr,
std::size_t addrlen, asio::error_code& ec);
ASIO_DECL size_t sync_sendto(socket_type s, state_type state,
- const buf* bufs, size_t count, int flags, const socket_addr_type* addr,
+ const buf* bufs, size_t count, int flags, const void* addr,
std::size_t addrlen, asio::error_code& ec);
ASIO_DECL size_t sync_sendto1(socket_type s, state_type state,
- const void* data, size_t size, int flags, const socket_addr_type* addr,
+ const void* data, size_t size, int flags, const void* addr,
std::size_t addrlen, asio::error_code& ec);
#if !defined(ASIO_HAS_IOCP)
-ASIO_DECL bool non_blocking_sendto(socket_type s,
- const buf* bufs, size_t count, int flags,
- const socket_addr_type* addr, std::size_t addrlen,
+ASIO_DECL bool non_blocking_sendto(socket_type s, const buf* bufs,
+ size_t count, int flags, const void* addr, std::size_t addrlen,
asio::error_code& ec, size_t& bytes_transferred);
-ASIO_DECL bool non_blocking_sendto1(socket_type s,
- const void* data, size_t size, int flags,
- const socket_addr_type* addr, std::size_t addrlen,
+ASIO_DECL bool non_blocking_sendto1(socket_type s, const void* data,
+ size_t size, int flags, const void* addr, std::size_t addrlen,
asio::error_code& ec, size_t& bytes_transferred);
#endif // !defined(ASIO_HAS_IOCP)
@@ -296,10 +290,10 @@ ASIO_DECL int getsockopt(socket_type s, state_type state,
int level, int optname, void* optval,
size_t* optlen, asio::error_code& ec);
-ASIO_DECL int getpeername(socket_type s, socket_addr_type* addr,
+ASIO_DECL int getpeername(socket_type s, void* addr,
std::size_t* addrlen, bool cached, asio::error_code& ec);
-ASIO_DECL int getsockname(socket_type s, socket_addr_type* addr,
+ASIO_DECL int getsockname(socket_type s, void* addr,
std::size_t* addrlen, asio::error_code& ec);
ASIO_DECL int ioctl(socket_type s, state_type& state,
@@ -344,19 +338,17 @@ ASIO_DECL asio::error_code background_getaddrinfo(
ASIO_DECL void freeaddrinfo(addrinfo_type* ai);
-ASIO_DECL asio::error_code getnameinfo(
- const socket_addr_type* addr, std::size_t addrlen,
- char* host, std::size_t hostlen, char* serv,
+ASIO_DECL asio::error_code getnameinfo(const void* addr,
+ std::size_t addrlen, char* host, std::size_t hostlen, char* serv,
std::size_t servlen, int flags, asio::error_code& ec);
-ASIO_DECL asio::error_code sync_getnameinfo(
- const socket_addr_type* addr, std::size_t addrlen,
- char* host, std::size_t hostlen, char* serv,
+ASIO_DECL asio::error_code sync_getnameinfo(const void* addr,
+ std::size_t addrlen, char* host, std::size_t hostlen, char* serv,
std::size_t servlen, int sock_type, asio::error_code& ec);
ASIO_DECL asio::error_code background_getnameinfo(
const weak_cancel_token_type& cancel_token,
- const socket_addr_type* addr, std::size_t addrlen,
+ const void* addr, std::size_t addrlen,
char* host, std::size_t hostlen, char* serv,
std::size_t servlen, int sock_type, asio::error_code& ec);
diff --git a/3rdparty/asio/include/asio/detail/socket_option.hpp b/3rdparty/asio/include/asio/detail/socket_option.hpp
index 8d8c0d84f47..760713daad8 100644
--- a/3rdparty/asio/include/asio/detail/socket_option.hpp
+++ b/3rdparty/asio/include/asio/detail/socket_option.hpp
@@ -2,7 +2,7 @@
// detail/socket_option.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/socket_select_interrupter.hpp b/3rdparty/asio/include/asio/detail/socket_select_interrupter.hpp
index 2e971d2005e..e2432622e47 100644
--- a/3rdparty/asio/include/asio/detail/socket_select_interrupter.hpp
+++ b/3rdparty/asio/include/asio/detail/socket_select_interrupter.hpp
@@ -2,7 +2,7 @@
// detail/socket_select_interrupter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/socket_types.hpp b/3rdparty/asio/include/asio/detail/socket_types.hpp
index 33ad63eec8e..cf4f746a44b 100644
--- a/3rdparty/asio/include/asio/detail/socket_types.hpp
+++ b/3rdparty/asio/include/asio/detail/socket_types.hpp
@@ -2,7 +2,7 @@
// detail/socket_types.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -89,6 +89,7 @@
# include <sys/filio.h>
# include <sys/sockio.h>
# endif
+# include <signal.h>
#endif
#include "asio/detail/push_options.hpp"
@@ -178,6 +179,9 @@ typedef int signed_size_type;
# define ASIO_OS_DEF_AI_V4MAPPED 0x800
# define ASIO_OS_DEF_AI_ALL 0x100
# define ASIO_OS_DEF_AI_ADDRCONFIG 0x400
+# define ASIO_OS_DEF_SA_RESTART 0x1
+# define ASIO_OS_DEF_SA_NOCLDSTOP 0x2
+# define ASIO_OS_DEF_SA_NOCLDWAIT 0x4
#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__)
typedef SOCKET socket_type;
const SOCKET invalid_socket = INVALID_SOCKET;
@@ -285,6 +289,9 @@ const int max_iov_len = 64;
# else
const int max_iov_len = 16;
# endif
+# define ASIO_OS_DEF_SA_RESTART 0x1
+# define ASIO_OS_DEF_SA_NOCLDSTOP 0x2
+# define ASIO_OS_DEF_SA_NOCLDWAIT 0x4
#else
typedef int socket_type;
const int invalid_socket = -1;
@@ -404,6 +411,9 @@ const int max_iov_len = IOV_MAX;
// POSIX platforms are not required to define IOV_MAX.
const int max_iov_len = 16;
# endif
+# define ASIO_OS_DEF_SA_RESTART SA_RESTART
+# define ASIO_OS_DEF_SA_NOCLDSTOP SA_NOCLDSTOP
+# define ASIO_OS_DEF_SA_NOCLDWAIT SA_NOCLDWAIT
#endif
const int custom_socket_option_level = 0xA5100000;
const int enable_connection_aborted_option = 1;
diff --git a/3rdparty/asio/include/asio/detail/solaris_fenced_block.hpp b/3rdparty/asio/include/asio/detail/solaris_fenced_block.hpp
deleted file mode 100644
index 4f6640b3d04..00000000000
--- a/3rdparty/asio/include/asio/detail/solaris_fenced_block.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// detail/solaris_fenced_block.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_SOLARIS_FENCED_BLOCK_HPP
-#define ASIO_DETAIL_SOLARIS_FENCED_BLOCK_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#if defined(__sun)
-
-#include <atomic.h>
-#include "asio/detail/noncopyable.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class solaris_fenced_block
- : private noncopyable
-{
-public:
- enum half_t { half };
- enum full_t { full };
-
- // Constructor for a half fenced block.
- explicit solaris_fenced_block(half_t)
- {
- }
-
- // Constructor for a full fenced block.
- explicit solaris_fenced_block(full_t)
- {
- membar_consumer();
- }
-
- // Destructor.
- ~solaris_fenced_block()
- {
- membar_producer();
- }
-};
-
-} // namespace detail
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // defined(__sun)
-
-#endif // ASIO_DETAIL_SOLARIS_FENCED_BLOCK_HPP
diff --git a/3rdparty/asio/include/asio/detail/source_location.hpp b/3rdparty/asio/include/asio/detail/source_location.hpp
index a9ac8e83514..14b74f91435 100644
--- a/3rdparty/asio/include/asio/detail/source_location.hpp
+++ b/3rdparty/asio/include/asio/detail/source_location.hpp
@@ -2,7 +2,7 @@
// detail/source_location.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/static_mutex.hpp b/3rdparty/asio/include/asio/detail/static_mutex.hpp
index 5876a99a800..b47d087bf4a 100644
--- a/3rdparty/asio/include/asio/detail/static_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/static_mutex.hpp
@@ -2,7 +2,7 @@
// detail/static_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,10 +23,8 @@
# include "asio/detail/win_static_mutex.hpp"
#elif defined(ASIO_HAS_PTHREADS)
# include "asio/detail/posix_static_mutex.hpp"
-#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-# include "asio/detail/std_static_mutex.hpp"
#else
-# error Only Windows and POSIX are supported!
+# include "asio/detail/std_static_mutex.hpp"
#endif
namespace asio {
@@ -41,7 +39,7 @@ typedef win_static_mutex static_mutex;
#elif defined(ASIO_HAS_PTHREADS)
typedef posix_static_mutex static_mutex;
# define ASIO_STATIC_MUTEX_INIT ASIO_POSIX_STATIC_MUTEX_INIT
-#elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
+#else
typedef std_static_mutex static_mutex;
# define ASIO_STATIC_MUTEX_INIT ASIO_STD_STATIC_MUTEX_INIT
#endif
diff --git a/3rdparty/asio/include/asio/detail/std_event.hpp b/3rdparty/asio/include/asio/detail/std_event.hpp
index 1fc5177ed8f..97a347ed725 100644
--- a/3rdparty/asio/include/asio/detail/std_event.hpp
+++ b/3rdparty/asio/include/asio/detail/std_event.hpp
@@ -2,7 +2,7 @@
// detail/std_event.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-
#include <chrono>
#include <condition_variable>
#include "asio/detail/assert.hpp"
@@ -183,6 +180,4 @@ private:
#include "asio/detail/pop_options.hpp"
-#endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-
#endif // ASIO_DETAIL_STD_EVENT_HPP
diff --git a/3rdparty/asio/include/asio/detail/std_fenced_block.hpp b/3rdparty/asio/include/asio/detail/std_fenced_block.hpp
index 2361b17fdfd..d1e0c603cbc 100644
--- a/3rdparty/asio/include/asio/detail/std_fenced_block.hpp
+++ b/3rdparty/asio/include/asio/detail/std_fenced_block.hpp
@@ -2,7 +2,7 @@
// detail/std_fenced_block.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_ATOMIC)
-
#include <atomic>
#include "asio/detail/noncopyable.hpp"
@@ -57,6 +54,4 @@ public:
#include "asio/detail/pop_options.hpp"
-#endif // defined(ASIO_HAS_STD_ATOMIC)
-
#endif // ASIO_DETAIL_STD_FENCED_BLOCK_HPP
diff --git a/3rdparty/asio/include/asio/detail/std_global.hpp b/3rdparty/asio/include/asio/detail/std_global.hpp
index cdb3062079b..49ae055ea7d 100644
--- a/3rdparty/asio/include/asio/detail/std_global.hpp
+++ b/3rdparty/asio/include/asio/detail/std_global.hpp
@@ -2,7 +2,7 @@
// detail/std_global.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_CALL_ONCE)
-
#include <exception>
#include <mutex>
@@ -65,6 +62,4 @@ T& std_global()
#include "asio/detail/pop_options.hpp"
-#endif // defined(ASIO_HAS_STD_CALL_ONCE)
-
#endif // ASIO_DETAIL_STD_GLOBAL_HPP
diff --git a/3rdparty/asio/include/asio/detail/std_mutex.hpp b/3rdparty/asio/include/asio/detail/std_mutex.hpp
index 37471bebad5..06839d69ca3 100644
--- a/3rdparty/asio/include/asio/detail/std_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/std_mutex.hpp
@@ -2,7 +2,7 @@
// detail/std_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-
#include <mutex>
#include "asio/detail/noncopyable.hpp"
#include "asio/detail/scoped_lock.hpp"
@@ -68,6 +65,4 @@ private:
#include "asio/detail/pop_options.hpp"
-#endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-
#endif // ASIO_DETAIL_STD_MUTEX_HPP
diff --git a/3rdparty/asio/include/asio/detail/std_static_mutex.hpp b/3rdparty/asio/include/asio/detail/std_static_mutex.hpp
index ce14133f5ee..302b729037d 100644
--- a/3rdparty/asio/include/asio/detail/std_static_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/std_static_mutex.hpp
@@ -2,7 +2,7 @@
// detail/std_static_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-
#include <mutex>
#include "asio/detail/noncopyable.hpp"
#include "asio/detail/scoped_lock.hpp"
@@ -76,6 +73,4 @@ private:
#include "asio/detail/pop_options.hpp"
-#endif // defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
-
#endif // ASIO_DETAIL_STD_STATIC_MUTEX_HPP
diff --git a/3rdparty/asio/include/asio/detail/std_thread.hpp b/3rdparty/asio/include/asio/detail/std_thread.hpp
index 00cd4c902a7..78bbab9ea10 100644
--- a/3rdparty/asio/include/asio/detail/std_thread.hpp
+++ b/3rdparty/asio/include/asio/detail/std_thread.hpp
@@ -2,7 +2,7 @@
// detail/std_thread.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_THREAD)
-
#include <thread>
#include "asio/detail/noncopyable.hpp"
@@ -66,6 +63,4 @@ private:
#include "asio/detail/pop_options.hpp"
-#endif // defined(ASIO_HAS_STD_THREAD)
-
#endif // ASIO_DETAIL_STD_THREAD_HPP
diff --git a/3rdparty/asio/include/asio/detail/strand_executor_service.hpp b/3rdparty/asio/include/asio/detail/strand_executor_service.hpp
index cdbea6ba55b..45536ed5368 100644
--- a/3rdparty/asio/include/asio/detail/strand_executor_service.hpp
+++ b/3rdparty/asio/include/asio/detail/strand_executor_service.hpp
@@ -2,7 +2,7 @@
// detail/strand_executor_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -90,33 +90,33 @@ public:
// Request invocation of the given function.
template <typename Executor, typename Function>
static void execute(const implementation_type& impl, Executor& ex,
- ASIO_MOVE_ARG(Function) function,
- typename enable_if<
- can_query<Executor, execution::allocator_t<void> >::value
- >::type* = 0);
+ Function&& function,
+ enable_if_t<
+ can_query<Executor, execution::allocator_t<void>>::value
+ >* = 0);
// Request invocation of the given function.
template <typename Executor, typename Function>
static void execute(const implementation_type& impl, Executor& ex,
- ASIO_MOVE_ARG(Function) function,
- typename enable_if<
- !can_query<Executor, execution::allocator_t<void> >::value
- >::type* = 0);
+ Function&& function,
+ enable_if_t<
+ !can_query<Executor, execution::allocator_t<void>>::value
+ >* = 0);
// Request invocation of the given function.
template <typename Executor, typename Function, typename Allocator>
static void dispatch(const implementation_type& impl, Executor& ex,
- ASIO_MOVE_ARG(Function) function, const Allocator& a);
+ Function&& function, const Allocator& a);
// Request invocation of the given function and return immediately.
template <typename Executor, typename Function, typename Allocator>
static void post(const implementation_type& impl, Executor& ex,
- ASIO_MOVE_ARG(Function) function, const Allocator& a);
+ Function&& function, const Allocator& a);
// Request invocation of the given function and return immediately.
template <typename Executor, typename Function, typename Allocator>
static void defer(const implementation_type& impl, Executor& ex,
- ASIO_MOVE_ARG(Function) function, const Allocator& a);
+ Function&& function, const Allocator& a);
// Determine whether the strand is running in the current thread.
ASIO_DECL static bool running_in_this_thread(
@@ -141,7 +141,7 @@ private:
// Helper function to request invocation of the given function.
template <typename Executor, typename Function, typename Allocator>
static void do_execute(const implementation_type& impl, Executor& ex,
- ASIO_MOVE_ARG(Function) function, const Allocator& a);
+ Function&& function, const Allocator& a);
// Mutex to protect access to the service-wide state.
mutex mutex_;
diff --git a/3rdparty/asio/include/asio/detail/strand_service.hpp b/3rdparty/asio/include/asio/detail/strand_service.hpp
index 2aec8e5d450..084eb0b3066 100644
--- a/3rdparty/asio/include/asio/detail/strand_service.hpp
+++ b/3rdparty/asio/include/asio/detail/strand_service.hpp
@@ -2,7 +2,7 @@
// detail/strand_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/string_view.hpp b/3rdparty/asio/include/asio/detail/string_view.hpp
index 488e9aa5a59..a4470f1e580 100644
--- a/3rdparty/asio/include/asio/detail/string_view.hpp
+++ b/3rdparty/asio/include/asio/detail/string_view.hpp
@@ -2,7 +2,7 @@
// detail/string_view.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/thread.hpp b/3rdparty/asio/include/asio/detail/thread.hpp
index 8d1b66283db..faa7fad2438 100644
--- a/3rdparty/asio/include/asio/detail/thread.hpp
+++ b/3rdparty/asio/include/asio/detail/thread.hpp
@@ -2,7 +2,7 @@
// detail/thread.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -29,10 +29,8 @@
# else
# include "asio/detail/win_thread.hpp"
# endif
-#elif defined(ASIO_HAS_STD_THREAD)
-# include "asio/detail/std_thread.hpp"
#else
-# error Only Windows, POSIX and std::thread are supported!
+# include "asio/detail/std_thread.hpp"
#endif
namespace asio {
@@ -50,7 +48,7 @@ typedef winapp_thread thread;
# else
typedef win_thread thread;
# endif
-#elif defined(ASIO_HAS_STD_THREAD)
+#else
typedef std_thread thread;
#endif
diff --git a/3rdparty/asio/include/asio/detail/thread_context.hpp b/3rdparty/asio/include/asio/detail/thread_context.hpp
index f17824182b4..bebfc4a43a2 100644
--- a/3rdparty/asio/include/asio/detail/thread_context.hpp
+++ b/3rdparty/asio/include/asio/detail/thread_context.hpp
@@ -2,7 +2,7 @@
// detail/thread_context.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/thread_group.hpp b/3rdparty/asio/include/asio/detail/thread_group.hpp
index 11965f5a7f2..5ebff5e185f 100644
--- a/3rdparty/asio/include/asio/detail/thread_group.hpp
+++ b/3rdparty/asio/include/asio/detail/thread_group.hpp
@@ -2,7 +2,7 @@
// detail/thread_group.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/thread_info_base.hpp b/3rdparty/asio/include/asio/detail/thread_info_base.hpp
index 2223e8b3faf..5a74cef776a 100644
--- a/3rdparty/asio/include/asio/detail/thread_info_base.hpp
+++ b/3rdparty/asio/include/asio/detail/thread_info_base.hpp
@@ -2,7 +2,7 @@
// detail/thread_info_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -21,12 +21,10 @@
#include "asio/detail/memory.hpp"
#include "asio/detail/noncopyable.hpp"
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- && !defined(ASIO_NO_EXCEPTIONS)
+#if !defined(ASIO_NO_EXCEPTIONS)
# include <exception>
# include "asio/multiple_exceptions.hpp"
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // && !defined(ASIO_NO_EXCEPTIONS)
+#endif // !defined(ASIO_NO_EXCEPTIONS)
#include "asio/detail/push_options.hpp"
@@ -94,11 +92,9 @@ public:
enum { max_mem_index = parallel_group_tag::end_mem_index };
thread_info_base()
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- && !defined(ASIO_NO_EXCEPTIONS)
+#if !defined(ASIO_NO_EXCEPTIONS)
: has_pending_exception_(0)
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // && !defined(ASIO_NO_EXCEPTIONS)
+#endif // !defined(ASIO_NO_EXCEPTIONS)
{
for (int i = 0; i < max_mem_index; ++i)
reusable_memory_[i] = 0;
@@ -199,8 +195,7 @@ public:
void capture_current_exception()
{
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- && !defined(ASIO_NO_EXCEPTIONS)
+#if !defined(ASIO_NO_EXCEPTIONS)
switch (has_pending_exception_)
{
case 0:
@@ -216,36 +211,35 @@ public:
default:
break;
}
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // && !defined(ASIO_NO_EXCEPTIONS)
+#endif // !defined(ASIO_NO_EXCEPTIONS)
}
void rethrow_pending_exception()
{
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- && !defined(ASIO_NO_EXCEPTIONS)
+#if !defined(ASIO_NO_EXCEPTIONS)
if (has_pending_exception_ > 0)
{
has_pending_exception_ = 0;
std::exception_ptr ex(
- ASIO_MOVE_CAST(std::exception_ptr)(
+ static_cast<std::exception_ptr&&>(
pending_exception_));
std::rethrow_exception(ex);
}
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // && !defined(ASIO_NO_EXCEPTIONS)
+#endif // !defined(ASIO_NO_EXCEPTIONS)
}
private:
+#if defined(ASIO_HAS_IO_URING)
+ enum { chunk_size = 8 };
+#else // defined(ASIO_HAS_IO_URING)
enum { chunk_size = 4 };
+#endif // defined(ASIO_HAS_IO_URING)
void* reusable_memory_[max_mem_index];
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- && !defined(ASIO_NO_EXCEPTIONS)
+#if !defined(ASIO_NO_EXCEPTIONS)
int has_pending_exception_;
std::exception_ptr pending_exception_;
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // && !defined(ASIO_NO_EXCEPTIONS)
+#endif // !defined(ASIO_NO_EXCEPTIONS)
};
} // namespace detail
diff --git a/3rdparty/asio/include/asio/detail/throw_error.hpp b/3rdparty/asio/include/asio/detail/throw_error.hpp
index d03cad54acd..881c3128576 100644
--- a/3rdparty/asio/include/asio/detail/throw_error.hpp
+++ b/3rdparty/asio/include/asio/detail/throw_error.hpp
@@ -2,7 +2,7 @@
// detail/throw_error.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,6 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
+#include "asio/detail/throw_exception.hpp"
#include "asio/error_code.hpp"
#include "asio/detail/push_options.hpp"
@@ -23,22 +24,30 @@
namespace asio {
namespace detail {
-ASIO_DECL void do_throw_error(const asio::error_code& err);
+ASIO_DECL void do_throw_error(
+ const asio::error_code& err
+ ASIO_SOURCE_LOCATION_PARAM);
-ASIO_DECL void do_throw_error(const asio::error_code& err,
- const char* location);
+ASIO_DECL void do_throw_error(
+ const asio::error_code& err,
+ const char* location
+ ASIO_SOURCE_LOCATION_PARAM);
-inline void throw_error(const asio::error_code& err)
+inline void throw_error(
+ const asio::error_code& err
+ ASIO_SOURCE_LOCATION_DEFAULTED_PARAM)
{
if (err)
- do_throw_error(err);
+ do_throw_error(err ASIO_SOURCE_LOCATION_ARG);
}
-inline void throw_error(const asio::error_code& err,
- const char* location)
+inline void throw_error(
+ const asio::error_code& err,
+ const char* location
+ ASIO_SOURCE_LOCATION_DEFAULTED_PARAM)
{
if (err)
- do_throw_error(err, location);
+ do_throw_error(err, location ASIO_SOURCE_LOCATION_ARG);
}
} // namespace detail
diff --git a/3rdparty/asio/include/asio/detail/throw_exception.hpp b/3rdparty/asio/include/asio/detail/throw_exception.hpp
index bbee22ae963..e939c1093f6 100644
--- a/3rdparty/asio/include/asio/detail/throw_exception.hpp
+++ b/3rdparty/asio/include/asio/detail/throw_exception.hpp
@@ -2,7 +2,7 @@
// detail/throw_exception.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -30,14 +30,18 @@ using boost::throw_exception;
// Declare the throw_exception function for all targets.
template <typename Exception>
-void throw_exception(const Exception& e);
+void throw_exception(
+ const Exception& e
+ ASIO_SOURCE_LOCATION_DEFAULTED_PARAM);
// Only define the throw_exception function when exceptions are enabled.
// Otherwise, it is up to the application to provide a definition of this
// function.
# if !defined(ASIO_NO_EXCEPTIONS)
template <typename Exception>
-void throw_exception(const Exception& e)
+void throw_exception(
+ const Exception& e
+ ASIO_SOURCE_LOCATION_PARAM)
{
throw e;
}
diff --git a/3rdparty/asio/include/asio/detail/timer_queue.hpp b/3rdparty/asio/include/asio/detail/timer_queue.hpp
index cb5f4fc3caa..843f3614da0 100644
--- a/3rdparty/asio/include/asio/detail/timer_queue.hpp
+++ b/3rdparty/asio/include/asio/detail/timer_queue.hpp
@@ -2,7 +2,7 @@
// detail/timer_queue.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/timer_queue_base.hpp b/3rdparty/asio/include/asio/detail/timer_queue_base.hpp
index 7ab2e6d40a5..ddcf41c1371 100644
--- a/3rdparty/asio/include/asio/detail/timer_queue_base.hpp
+++ b/3rdparty/asio/include/asio/detail/timer_queue_base.hpp
@@ -2,7 +2,7 @@
// detail/timer_queue_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/timer_queue_ptime.hpp b/3rdparty/asio/include/asio/detail/timer_queue_ptime.hpp
index 0886ac96f85..937a4ad85fa 100644
--- a/3rdparty/asio/include/asio/detail/timer_queue_ptime.hpp
+++ b/3rdparty/asio/include/asio/detail/timer_queue_ptime.hpp
@@ -2,7 +2,7 @@
// detail/timer_queue_ptime.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -31,7 +31,7 @@ struct forwarding_posix_time_traits : time_traits<boost::posix_time::ptime> {};
// Template specialisation for the commonly used instantation.
template <>
-class timer_queue<time_traits<boost::posix_time::ptime> >
+class timer_queue<time_traits<boost::posix_time::ptime>>
: public timer_queue_base
{
public:
diff --git a/3rdparty/asio/include/asio/detail/timer_queue_set.hpp b/3rdparty/asio/include/asio/detail/timer_queue_set.hpp
index 2cd3826c7d8..7bf50747be1 100644
--- a/3rdparty/asio/include/asio/detail/timer_queue_set.hpp
+++ b/3rdparty/asio/include/asio/detail/timer_queue_set.hpp
@@ -2,7 +2,7 @@
// detail/timer_queue_set.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/timer_scheduler.hpp b/3rdparty/asio/include/asio/detail/timer_scheduler.hpp
index 8d9b4ed7c93..dd34d328c84 100644
--- a/3rdparty/asio/include/asio/detail/timer_scheduler.hpp
+++ b/3rdparty/asio/include/asio/detail/timer_scheduler.hpp
@@ -2,7 +2,7 @@
// detail/timer_scheduler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,6 +22,8 @@
# include "asio/detail/winrt_timer_scheduler.hpp"
#elif defined(ASIO_HAS_IOCP)
# include "asio/detail/win_iocp_io_context.hpp"
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_service.hpp"
#elif defined(ASIO_HAS_EPOLL)
# include "asio/detail/epoll_reactor.hpp"
#elif defined(ASIO_HAS_KQUEUE)
diff --git a/3rdparty/asio/include/asio/detail/timer_scheduler_fwd.hpp b/3rdparty/asio/include/asio/detail/timer_scheduler_fwd.hpp
index 15b5fbdffa1..bbb8a4e8ded 100644
--- a/3rdparty/asio/include/asio/detail/timer_scheduler_fwd.hpp
+++ b/3rdparty/asio/include/asio/detail/timer_scheduler_fwd.hpp
@@ -2,7 +2,7 @@
// detail/timer_scheduler_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -24,6 +24,8 @@ namespace detail {
typedef class winrt_timer_scheduler timer_scheduler;
#elif defined(ASIO_HAS_IOCP)
typedef class win_iocp_io_context timer_scheduler;
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+typedef class io_uring_service timer_scheduler;
#elif defined(ASIO_HAS_EPOLL)
typedef class epoll_reactor timer_scheduler;
#elif defined(ASIO_HAS_KQUEUE)
diff --git a/3rdparty/asio/include/asio/detail/tss_ptr.hpp b/3rdparty/asio/include/asio/detail/tss_ptr.hpp
index 25e4d3d84d1..f7aaa2ec29c 100644
--- a/3rdparty/asio/include/asio/detail/tss_ptr.hpp
+++ b/3rdparty/asio/include/asio/detail/tss_ptr.hpp
@@ -2,7 +2,7 @@
// detail/tss_ptr.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/type_traits.hpp b/3rdparty/asio/include/asio/detail/type_traits.hpp
index 968f19a802e..a4706a5ff1c 100644
--- a/3rdparty/asio/include/asio/detail/type_traits.hpp
+++ b/3rdparty/asio/include/asio/detail/type_traits.hpp
@@ -2,7 +2,7 @@
// detail/type_traits.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,140 +16,162 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_TYPE_TRAITS)
-# include <type_traits>
-#else // defined(ASIO_HAS_STD_TYPE_TRAITS)
-# include <boost/type_traits/add_const.hpp>
-# include <boost/type_traits/add_lvalue_reference.hpp>
-# include <boost/type_traits/aligned_storage.hpp>
-# include <boost/type_traits/alignment_of.hpp>
-# include <boost/type_traits/conditional.hpp>
-# include <boost/type_traits/decay.hpp>
-# include <boost/type_traits/has_nothrow_copy.hpp>
-# include <boost/type_traits/has_nothrow_destructor.hpp>
-# include <boost/type_traits/integral_constant.hpp>
-# include <boost/type_traits/is_base_of.hpp>
-# include <boost/type_traits/is_class.hpp>
-# include <boost/type_traits/is_const.hpp>
-# include <boost/type_traits/is_convertible.hpp>
-# include <boost/type_traits/is_constructible.hpp>
-# include <boost/type_traits/is_copy_constructible.hpp>
-# include <boost/type_traits/is_destructible.hpp>
-# include <boost/type_traits/is_function.hpp>
-# include <boost/type_traits/is_object.hpp>
-# include <boost/type_traits/is_same.hpp>
-# include <boost/type_traits/remove_cv.hpp>
-# include <boost/type_traits/remove_pointer.hpp>
-# include <boost/type_traits/remove_reference.hpp>
-# include <boost/utility/declval.hpp>
-# include <boost/utility/enable_if.hpp>
-# include <boost/utility/result_of.hpp>
-#endif // defined(ASIO_HAS_STD_TYPE_TRAITS)
+#include <type_traits>
namespace asio {
-#if defined(ASIO_HAS_STD_TYPE_TRAITS)
using std::add_const;
+
+template <typename T>
+using add_const_t = typename std::add_const<T>::type;
+
using std::add_lvalue_reference;
-using std::aligned_storage;
+
+template <typename T>
+using add_lvalue_reference_t = typename std::add_lvalue_reference<T>::type;
+
+template <std::size_t N, std::size_t A>
+struct aligned_storage
+{
+ struct type
+ {
+ alignas(A) unsigned char data[N];
+ };
+};
+
+template <std::size_t N, std::size_t A>
+using aligned_storage_t = typename aligned_storage<N, A>::type;
+
using std::alignment_of;
+
using std::conditional;
+
+template <bool C, typename T, typename U>
+using conditional_t = typename std::conditional<C, T, U>::type;
+
using std::decay;
+
+template <typename T>
+using decay_t = typename std::decay<T>::type;
+
using std::declval;
+
using std::enable_if;
+
+template <bool C, typename T = void>
+using enable_if_t = typename std::enable_if<C, T>::type;
+
using std::false_type;
+
using std::integral_constant;
+
using std::is_base_of;
+
using std::is_class;
+
using std::is_const;
+
using std::is_constructible;
+
using std::is_convertible;
+
using std::is_copy_constructible;
+
using std::is_destructible;
+
using std::is_function;
+
using std::is_move_constructible;
+
using std::is_nothrow_copy_constructible;
+
using std::is_nothrow_destructible;
+
using std::is_object;
+
+using std::is_pointer;
+
using std::is_reference;
+
using std::is_same;
+
using std::is_scalar;
+
using std::remove_cv;
+
+template <typename T>
+using remove_cv_t = typename std::remove_cv<T>::type;
+
+template <typename T>
+struct remove_cvref :
+ std::remove_cv<typename std::remove_reference<T>::type> {};
+
template <typename T>
-struct remove_cvref : remove_cv<typename std::remove_reference<T>::type> {};
+using remove_cvref_t = typename remove_cvref<T>::type;
+
using std::remove_pointer;
+
+template <typename T>
+using remove_pointer_t = typename std::remove_pointer<T>::type;
+
using std::remove_reference;
+
+template <typename T>
+using remove_reference_t = typename std::remove_reference<T>::type;
+
#if defined(ASIO_HAS_STD_INVOKE_RESULT)
+
template <typename> struct result_of;
+
template <typename F, typename... Args>
struct result_of<F(Args...)> : std::invoke_result<F, Args...> {};
+
+template <typename T>
+using result_of_t = typename result_of<T>::type;
+
#else // defined(ASIO_HAS_STD_INVOKE_RESULT)
+
using std::result_of;
+
+template <typename T>
+using result_of_t = typename std::result_of<T>::type;
+
#endif // defined(ASIO_HAS_STD_INVOKE_RESULT)
+
using std::true_type;
-#else // defined(ASIO_HAS_STD_TYPE_TRAITS)
-using boost::add_const;
-using boost::add_lvalue_reference;
-using boost::aligned_storage;
-using boost::alignment_of;
-template <bool Condition, typename Type = void>
-struct enable_if : boost::enable_if_c<Condition, Type> {};
-using boost::conditional;
-using boost::decay;
-using boost::declval;
-using boost::false_type;
-using boost::integral_constant;
-using boost::is_base_of;
-using boost::is_class;
-using boost::is_const;
-using boost::is_constructible;
-using boost::is_convertible;
-using boost::is_copy_constructible;
-using boost::is_destructible;
-using boost::is_function;
-#if defined(ASIO_HAS_MOVE)
-template <typename T>
-struct is_move_constructible : false_type {};
-#else // defined(ASIO_HAS_MOVE)
-template <typename T>
-struct is_move_constructible : is_copy_constructible<T> {};
-#endif // defined(ASIO_HAS_MOVE)
-template <typename T>
-struct is_nothrow_copy_constructible : boost::has_nothrow_copy<T> {};
-template <typename T>
-struct is_nothrow_destructible : boost::has_nothrow_destructor<T> {};
-using boost::is_object;
-using boost::is_reference;
-using boost::is_same;
-using boost::is_scalar;
-using boost::remove_cv;
-template <typename T>
-struct remove_cvref : remove_cv<typename boost::remove_reference<T>::type> {};
-using boost::remove_pointer;
-using boost::remove_reference;
-using boost::result_of;
-using boost::true_type;
-#endif // defined(ASIO_HAS_STD_TYPE_TRAITS)
-template <typename> struct void_type { typedef void type; };
+template <typename> struct void_type
+{
+ typedef void type;
+};
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
+template <typename T>
+using void_t = typename void_type<T>::type;
template <typename...> struct conjunction : true_type {};
+
template <typename T> struct conjunction<T> : T {};
-template <typename Head, typename... Tail> struct conjunction<Head, Tail...> :
- conditional<Head::value, conjunction<Tail...>, Head>::type {};
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
+template <typename Head, typename... Tail>
+struct conjunction<Head, Tail...> :
+ conditional_t<Head::value, conjunction<Tail...>, Head> {};
struct defaulted_constraint
{
- ASIO_CONSTEXPR defaulted_constraint() {}
+ constexpr defaulted_constraint() {}
};
template <bool Condition, typename Type = int>
-struct constraint : enable_if<Condition, Type> {};
+struct constraint : std::enable_if<Condition, Type> {};
+
+template <bool Condition, typename Type = int>
+using constraint_t = typename constraint<Condition, Type>::type;
+
+template <typename T>
+struct type_identity { typedef T type; };
+
+template <typename T>
+using type_identity_t = typename type_identity<T>::type;
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/utility.hpp b/3rdparty/asio/include/asio/detail/utility.hpp
new file mode 100644
index 00000000000..72dd4d43190
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/utility.hpp
@@ -0,0 +1,83 @@
+//
+// detail/utility.hpp
+// ~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_UTILITY_HPP
+#define ASIO_DETAIL_UTILITY_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <utility>
+
+namespace asio {
+namespace detail {
+
+#if defined(ASIO_HAS_STD_INDEX_SEQUENCE)
+
+using std::index_sequence;
+using std::index_sequence_for;
+using std::make_index_sequence;
+
+#else // defined(ASIO_HAS_STD_INDEX_SEQUENCE)
+
+template <std::size_t...>
+struct index_sequence
+{
+};
+
+template <typename T, typename U>
+struct join_index_sequences;
+
+template <std::size_t... I, std::size_t... J>
+struct join_index_sequences<index_sequence<I...>, index_sequence<J...>>
+{
+ using type = index_sequence<I..., J...>;
+};
+
+template <std::size_t First, std::size_t Last>
+struct index_pack :
+ join_index_sequences<
+ typename index_pack<First, First + (Last - First + 1) / 2 - 1>::type,
+ typename index_pack<First + (Last - First + 1) / 2, Last>::type
+ >
+{
+};
+
+template <std::size_t N>
+struct index_pack<N, N>
+{
+ using type = index_sequence<N>;
+};
+
+template <std::size_t Begin, std::size_t End>
+struct index_range : index_pack<Begin, End - 1>
+{
+};
+
+template <std::size_t N>
+struct index_range<N, N>
+{
+ using type = index_sequence<>;
+};
+
+template <typename... T>
+using index_sequence_for = typename index_range<0, sizeof...(T)>::type;
+
+template <std::size_t N>
+using make_index_sequence = typename index_range<0, N>::type;
+
+#endif // defined(ASIO_HAS_STD_INDEX_SEQUENCE)
+
+} // namespace detail
+} // namespace asio
+
+#endif // ASIO_DETAIL_UTILITY_HPP
diff --git a/3rdparty/asio/include/asio/detail/variadic_templates.hpp b/3rdparty/asio/include/asio/detail/variadic_templates.hpp
deleted file mode 100644
index 3bcc8d27605..00000000000
--- a/3rdparty/asio/include/asio/detail/variadic_templates.hpp
+++ /dev/null
@@ -1,294 +0,0 @@
-//
-// detail/variadic_templates.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_VARIADIC_TEMPLATES_HPP
-#define ASIO_DETAIL_VARIADIC_TEMPLATES_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#if !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-# define ASIO_VARIADIC_TPARAMS(n) ASIO_VARIADIC_TPARAMS_##n
-
-# define ASIO_VARIADIC_TPARAMS_1 \
- typename T1
-# define ASIO_VARIADIC_TPARAMS_2 \
- typename T1, typename T2
-# define ASIO_VARIADIC_TPARAMS_3 \
- typename T1, typename T2, typename T3
-# define ASIO_VARIADIC_TPARAMS_4 \
- typename T1, typename T2, typename T3, typename T4
-# define ASIO_VARIADIC_TPARAMS_5 \
- typename T1, typename T2, typename T3, typename T4, typename T5
-# define ASIO_VARIADIC_TPARAMS_6 \
- typename T1, typename T2, typename T3, typename T4, typename T5, \
- typename T6
-# define ASIO_VARIADIC_TPARAMS_7 \
- typename T1, typename T2, typename T3, typename T4, typename T5, \
- typename T6, typename T7
-# define ASIO_VARIADIC_TPARAMS_8 \
- typename T1, typename T2, typename T3, typename T4, typename T5, \
- typename T6, typename T7, typename T8
-
-# define ASIO_VARIADIC_TARGS(n) ASIO_VARIADIC_TARGS_##n
-
-# define ASIO_VARIADIC_TARGS_1 T1
-# define ASIO_VARIADIC_TARGS_2 T1, T2
-# define ASIO_VARIADIC_TARGS_3 T1, T2, T3
-# define ASIO_VARIADIC_TARGS_4 T1, T2, T3, T4
-# define ASIO_VARIADIC_TARGS_5 T1, T2, T3, T4, T5
-# define ASIO_VARIADIC_TARGS_6 T1, T2, T3, T4, T5, T6
-# define ASIO_VARIADIC_TARGS_7 T1, T2, T3, T4, T5, T6, T7
-# define ASIO_VARIADIC_TARGS_8 T1, T2, T3, T4, T5, T6, T7, T8
-
-# define ASIO_VARIADIC_BYVAL_PARAMS(n) \
- ASIO_VARIADIC_BYVAL_PARAMS_##n
-
-# define ASIO_VARIADIC_BYVAL_PARAMS_1 T1 x1
-# define ASIO_VARIADIC_BYVAL_PARAMS_2 T1 x1, T2 x2
-# define ASIO_VARIADIC_BYVAL_PARAMS_3 T1 x1, T2 x2, T3 x3
-# define ASIO_VARIADIC_BYVAL_PARAMS_4 T1 x1, T2 x2, T3 x3, T4 x4
-# define ASIO_VARIADIC_BYVAL_PARAMS_5 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5
-# define ASIO_VARIADIC_BYVAL_PARAMS_6 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, \
- T6 x6
-# define ASIO_VARIADIC_BYVAL_PARAMS_7 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, \
- T6 x6, T7 x7
-# define ASIO_VARIADIC_BYVAL_PARAMS_8 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, \
- T6 x6, T7 x7, T8 x8
-
-# define ASIO_VARIADIC_BYVAL_ARGS(n) \
- ASIO_VARIADIC_BYVAL_ARGS_##n
-
-# define ASIO_VARIADIC_BYVAL_ARGS_1 x1
-# define ASIO_VARIADIC_BYVAL_ARGS_2 x1, x2
-# define ASIO_VARIADIC_BYVAL_ARGS_3 x1, x2, x3
-# define ASIO_VARIADIC_BYVAL_ARGS_4 x1, x2, x3, x4
-# define ASIO_VARIADIC_BYVAL_ARGS_5 x1, x2, x3, x4, x5
-# define ASIO_VARIADIC_BYVAL_ARGS_6 x1, x2, x3, x4, x5, x6
-# define ASIO_VARIADIC_BYVAL_ARGS_7 x1, x2, x3, x4, x5, x6, x7
-# define ASIO_VARIADIC_BYVAL_ARGS_8 x1, x2, x3, x4, x5, x6, x7, x8
-
-# define ASIO_VARIADIC_CONSTREF_PARAMS(n) \
- ASIO_VARIADIC_CONSTREF_PARAMS_##n
-
-# define ASIO_VARIADIC_CONSTREF_PARAMS_1 \
- const T1& x1
-# define ASIO_VARIADIC_CONSTREF_PARAMS_2 \
- const T1& x1, const T2& x2
-# define ASIO_VARIADIC_CONSTREF_PARAMS_3 \
- const T1& x1, const T2& x2, const T3& x3
-# define ASIO_VARIADIC_CONSTREF_PARAMS_4 \
- const T1& x1, const T2& x2, const T3& x3, const T4& x4
-# define ASIO_VARIADIC_CONSTREF_PARAMS_5 \
- const T1& x1, const T2& x2, const T3& x3, const T4& x4, const T5& x5
-# define ASIO_VARIADIC_CONSTREF_PARAMS_6 \
- const T1& x1, const T2& x2, const T3& x3, const T4& x4, const T5& x5, \
- const T6& x6
-# define ASIO_VARIADIC_CONSTREF_PARAMS_7 \
- const T1& x1, const T2& x2, const T3& x3, const T4& x4, const T5& x5, \
- const T6& x6, const T7& x7
-# define ASIO_VARIADIC_CONSTREF_PARAMS_8 \
- const T1& x1, const T2& x2, const T3& x3, const T4& x4, const T5& x5, \
- const T6& x6, const T7& x7, const T8& x8
-
-# define ASIO_VARIADIC_MOVE_PARAMS(n) \
- ASIO_VARIADIC_MOVE_PARAMS_##n
-
-# define ASIO_VARIADIC_MOVE_PARAMS_1 \
- ASIO_MOVE_ARG(T1) x1
-# define ASIO_VARIADIC_MOVE_PARAMS_2 \
- ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2
-# define ASIO_VARIADIC_MOVE_PARAMS_3 \
- ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \
- ASIO_MOVE_ARG(T3) x3
-# define ASIO_VARIADIC_MOVE_PARAMS_4 \
- ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \
- ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4
-# define ASIO_VARIADIC_MOVE_PARAMS_5 \
- ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \
- ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4, \
- ASIO_MOVE_ARG(T5) x5
-# define ASIO_VARIADIC_MOVE_PARAMS_6 \
- ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \
- ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4, \
- ASIO_MOVE_ARG(T5) x5, ASIO_MOVE_ARG(T6) x6
-# define ASIO_VARIADIC_MOVE_PARAMS_7 \
- ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \
- ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4, \
- ASIO_MOVE_ARG(T5) x5, ASIO_MOVE_ARG(T6) x6, \
- ASIO_MOVE_ARG(T7) x7
-# define ASIO_VARIADIC_MOVE_PARAMS_8 \
- ASIO_MOVE_ARG(T1) x1, ASIO_MOVE_ARG(T2) x2, \
- ASIO_MOVE_ARG(T3) x3, ASIO_MOVE_ARG(T4) x4, \
- ASIO_MOVE_ARG(T5) x5, ASIO_MOVE_ARG(T6) x6, \
- ASIO_MOVE_ARG(T7) x7, ASIO_MOVE_ARG(T8) x8
-
-# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS(n) \
- ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_##n
-
-# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_1 \
- ASIO_MOVE_ARG(T1)
-# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_2 \
- ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2)
-# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_3 \
- ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \
- ASIO_MOVE_ARG(T3)
-# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_4 \
- ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \
- ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4)
-# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_5 \
- ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \
- ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4), \
- ASIO_MOVE_ARG(T5)
-# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_6 \
- ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \
- ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4), \
- ASIO_MOVE_ARG(T5), ASIO_MOVE_ARG(T6)
-# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_7 \
- ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \
- ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4), \
- ASIO_MOVE_ARG(T5), ASIO_MOVE_ARG(T6), \
- ASIO_MOVE_ARG(T7)
-# define ASIO_VARIADIC_UNNAMED_MOVE_PARAMS_8 \
- ASIO_MOVE_ARG(T1), ASIO_MOVE_ARG(T2), \
- ASIO_MOVE_ARG(T3), ASIO_MOVE_ARG(T4), \
- ASIO_MOVE_ARG(T5), ASIO_MOVE_ARG(T6), \
- ASIO_MOVE_ARG(T7), ASIO_MOVE_ARG(T8)
-
-# define ASIO_VARIADIC_MOVE_ARGS(n) \
- ASIO_VARIADIC_MOVE_ARGS_##n
-
-# define ASIO_VARIADIC_MOVE_ARGS_1 \
- ASIO_MOVE_CAST(T1)(x1)
-# define ASIO_VARIADIC_MOVE_ARGS_2 \
- ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2)
-# define ASIO_VARIADIC_MOVE_ARGS_3 \
- ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \
- ASIO_MOVE_CAST(T3)(x3)
-# define ASIO_VARIADIC_MOVE_ARGS_4 \
- ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \
- ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4)
-# define ASIO_VARIADIC_MOVE_ARGS_5 \
- ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \
- ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4), \
- ASIO_MOVE_CAST(T5)(x5)
-# define ASIO_VARIADIC_MOVE_ARGS_6 \
- ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \
- ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4), \
- ASIO_MOVE_CAST(T5)(x5), ASIO_MOVE_CAST(T6)(x6)
-# define ASIO_VARIADIC_MOVE_ARGS_7 \
- ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \
- ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4), \
- ASIO_MOVE_CAST(T5)(x5), ASIO_MOVE_CAST(T6)(x6), \
- ASIO_MOVE_CAST(T7)(x7)
-# define ASIO_VARIADIC_MOVE_ARGS_8 \
- ASIO_MOVE_CAST(T1)(x1), ASIO_MOVE_CAST(T2)(x2), \
- ASIO_MOVE_CAST(T3)(x3), ASIO_MOVE_CAST(T4)(x4), \
- ASIO_MOVE_CAST(T5)(x5), ASIO_MOVE_CAST(T6)(x6), \
- ASIO_MOVE_CAST(T7)(x7), ASIO_MOVE_CAST(T8)(x8)
-
-# define ASIO_VARIADIC_DECLVAL(n) \
- ASIO_VARIADIC_DECLVAL_##n
-
-# define ASIO_VARIADIC_DECLVAL_1 \
- declval<T1>()
-# define ASIO_VARIADIC_DECLVAL_2 \
- declval<T1>(), declval<T2>()
-# define ASIO_VARIADIC_DECLVAL_3 \
- declval<T1>(), declval<T2>(), declval<T3>()
-# define ASIO_VARIADIC_DECLVAL_4 \
- declval<T1>(), declval<T2>(), declval<T3>(), declval<T4>()
-# define ASIO_VARIADIC_DECLVAL_5 \
- declval<T1>(), declval<T2>(), declval<T3>(), declval<T4>(), \
- declval<T5>()
-# define ASIO_VARIADIC_DECLVAL_6 \
- declval<T1>(), declval<T2>(), declval<T3>(), declval<T4>(), \
- declval<T5>(), declval<T6>()
-# define ASIO_VARIADIC_DECLVAL_7 \
- declval<T1>(), declval<T2>(), declval<T3>(), declval<T4>(), \
- declval<T5>(), declval<T6>(), declval<T7>()
-# define ASIO_VARIADIC_DECLVAL_8 \
- declval<T1>(), declval<T2>(), declval<T3>(), declval<T4>(), \
- declval<T5>(), declval<T6>(), declval<T7>(), declval<T8>()
-
-# define ASIO_VARIADIC_MOVE_DECLVAL(n) \
- ASIO_VARIADIC_MOVE_DECLVAL_##n
-
-# define ASIO_VARIADIC_MOVE_DECLVAL_1 \
- declval<ASIO_MOVE_ARG(T1)>()
-# define ASIO_VARIADIC_MOVE_DECLVAL_2 \
- declval<ASIO_MOVE_ARG(T1)>(), declval<ASIO_MOVE_ARG(T2)>()
-# define ASIO_VARIADIC_MOVE_DECLVAL_3 \
- declval<ASIO_MOVE_ARG(T1)>(), declval<ASIO_MOVE_ARG(T2)>(), \
- declval<ASIO_MOVE_ARG(T3)>()
-# define ASIO_VARIADIC_MOVE_DECLVAL_4 \
- declval<ASIO_MOVE_ARG(T1)>(), declval<ASIO_MOVE_ARG(T2)>(), \
- declval<ASIO_MOVE_ARG(T3)>(), declval<ASIO_MOVE_ARG(T4)>()
-# define ASIO_VARIADIC_MOVE_DECLVAL_5 \
- declval<ASIO_MOVE_ARG(T1)>(), declval<ASIO_MOVE_ARG(T2)>(), \
- declval<ASIO_MOVE_ARG(T3)>(), declval<ASIO_MOVE_ARG(T4)>(), \
- declval<ASIO_MOVE_ARG(T5)>()
-# define ASIO_VARIADIC_MOVE_DECLVAL_6 \
- declval<ASIO_MOVE_ARG(T1)>(), declval<ASIO_MOVE_ARG(T2)>(), \
- declval<ASIO_MOVE_ARG(T3)>(), declval<ASIO_MOVE_ARG(T4)>(), \
- declval<ASIO_MOVE_ARG(T5)>(), declval<ASIO_MOVE_ARG(T6)>()
-# define ASIO_VARIADIC_MOVE_DECLVAL_7 \
- declval<ASIO_MOVE_ARG(T1)>(), declval<ASIO_MOVE_ARG(T2)>(), \
- declval<ASIO_MOVE_ARG(T3)>(), declval<ASIO_MOVE_ARG(T4)>(), \
- declval<ASIO_MOVE_ARG(T5)>(), declval<ASIO_MOVE_ARG(T6)>(), \
- declval<ASIO_MOVE_ARG(T7)>()
-# define ASIO_VARIADIC_MOVE_DECLVAL_8 \
- declval<ASIO_MOVE_ARG(T1)>(), declval<ASIO_MOVE_ARG(T2)>(), \
- declval<ASIO_MOVE_ARG(T3)>(), declval<ASIO_MOVE_ARG(T4)>(), \
- declval<ASIO_MOVE_ARG(T5)>(), declval<ASIO_MOVE_ARG(T6)>(), \
- declval<ASIO_MOVE_ARG(T7)>(), declval<ASIO_MOVE_ARG(T8)>()
-
-# define ASIO_VARIADIC_DECAY(n) \
- ASIO_VARIADIC_DECAY_##n
-
-# define ASIO_VARIADIC_DECAY_1 \
- typename decay<T1>::type
-# define ASIO_VARIADIC_DECAY_2 \
- typename decay<T1>::type, typename decay<T2>::type
-# define ASIO_VARIADIC_DECAY_3 \
- typename decay<T1>::type, typename decay<T2>::type, \
- typename decay<T3>::type
-# define ASIO_VARIADIC_DECAY_4 \
- typename decay<T1>::type, typename decay<T2>::type, \
- typename decay<T3>::type, typename decay<T4>::type
-# define ASIO_VARIADIC_DECAY_5 \
- typename decay<T1>::type, typename decay<T2>::type, \
- typename decay<T3>::type, typename decay<T4>::type, \
- typename decay<T5>::type
-# define ASIO_VARIADIC_DECAY_6 \
- typename decay<T1>::type, typename decay<T2>::type, \
- typename decay<T3>::type, typename decay<T4>::type, \
- typename decay<T5>::type, typename decay<T6>::type
-# define ASIO_VARIADIC_DECAY_7 \
- typename decay<T1>::type, typename decay<T2>::type, \
- typename decay<T3>::type, typename decay<T4>::type, \
- typename decay<T5>::type, typename decay<T6>::type, \
- typename decay<T7>::type
-# define ASIO_VARIADIC_DECAY_8 \
- typename decay<T1>::type, typename decay<T2>::type, \
- typename decay<T3>::type, typename decay<T4>::type, \
- typename decay<T5>::type, typename decay<T6>::type, \
- typename decay<T7>::type, typename decay<T8>::type
-
-# define ASIO_VARIADIC_GENERATE(m) m(1) m(2) m(3) m(4) m(5) m(6) m(7) m(8)
-# define ASIO_VARIADIC_GENERATE_5(m) m(1) m(2) m(3) m(4) m(5)
-
-#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#endif // ASIO_DETAIL_VARIADIC_TEMPLATES_HPP
diff --git a/3rdparty/asio/include/asio/detail/wait_handler.hpp b/3rdparty/asio/include/asio/detail/wait_handler.hpp
index 6a87a538567..489a968cd77 100644
--- a/3rdparty/asio/include/asio/detail/wait_handler.hpp
+++ b/3rdparty/asio/include/asio/detail/wait_handler.hpp
@@ -2,7 +2,7 @@
// detail/wait_handler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -36,7 +36,7 @@ public:
wait_handler(Handler& h, const IoExecutor& io_ex)
: wait_op(&wait_handler::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(h)),
+ handler_(static_cast<Handler&&>(h)),
work_(handler_, io_ex)
{
}
@@ -53,7 +53,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
h->work_));
// Make a copy of the handler so that the memory can be deallocated before
diff --git a/3rdparty/asio/include/asio/detail/wait_op.hpp b/3rdparty/asio/include/asio/detail/wait_op.hpp
index e4a62de6170..548232c1c55 100644
--- a/3rdparty/asio/include/asio/detail/wait_op.hpp
+++ b/3rdparty/asio/include/asio/detail/wait_op.hpp
@@ -2,7 +2,7 @@
// detail/wait_op.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/win_event.hpp b/3rdparty/asio/include/asio/detail/win_event.hpp
index 3f00e003289..e61843e5b9d 100644
--- a/3rdparty/asio/include/asio/detail/win_event.hpp
+++ b/3rdparty/asio/include/asio/detail/win_event.hpp
@@ -2,7 +2,7 @@
// detail/win_event.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/win_fd_set_adapter.hpp b/3rdparty/asio/include/asio/detail/win_fd_set_adapter.hpp
index f5e19f01107..0e3e63f0c25 100644
--- a/3rdparty/asio/include/asio/detail/win_fd_set_adapter.hpp
+++ b/3rdparty/asio/include/asio/detail/win_fd_set_adapter.hpp
@@ -2,7 +2,7 @@
// detail/win_fd_set_adapter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/win_fenced_block.hpp b/3rdparty/asio/include/asio/detail/win_fenced_block.hpp
deleted file mode 100644
index 77d1eb1506b..00000000000
--- a/3rdparty/asio/include/asio/detail/win_fenced_block.hpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// detail/win_fenced_block.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_DETAIL_WIN_FENCED_BLOCK_HPP
-#define ASIO_DETAIL_WIN_FENCED_BLOCK_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#if defined(ASIO_WINDOWS) && !defined(UNDER_CE)
-
-#include "asio/detail/socket_types.hpp"
-#include "asio/detail/noncopyable.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class win_fenced_block
- : private noncopyable
-{
-public:
- enum half_t { half };
- enum full_t { full };
-
- // Constructor for a half fenced block.
- explicit win_fenced_block(half_t)
- {
- }
-
- // Constructor for a full fenced block.
- explicit win_fenced_block(full_t)
- {
-#if defined(__BORLANDC__)
- LONG barrier = 0;
- ::InterlockedExchange(&barrier, 1);
-#elif defined(ASIO_MSVC) \
- && ((ASIO_MSVC < 1400) || !defined(MemoryBarrier))
-# if defined(_M_IX86)
-# pragma warning(push)
-# pragma warning(disable:4793)
- LONG barrier;
- __asm { xchg barrier, eax }
-# pragma warning(pop)
-# endif // defined(_M_IX86)
-#else
- MemoryBarrier();
-#endif
- }
-
- // Destructor.
- ~win_fenced_block()
- {
-#if defined(__BORLANDC__)
- LONG barrier = 0;
- ::InterlockedExchange(&barrier, 1);
-#elif defined(ASIO_MSVC) \
- && ((ASIO_MSVC < 1400) || !defined(MemoryBarrier))
-# if defined(_M_IX86)
-# pragma warning(push)
-# pragma warning(disable:4793)
- LONG barrier;
- __asm { xchg barrier, eax }
-# pragma warning(pop)
-# endif // defined(_M_IX86)
-#else
- MemoryBarrier();
-#endif
- }
-};
-
-} // namespace detail
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // defined(ASIO_WINDOWS) && !defined(UNDER_CE)
-
-#endif // ASIO_DETAIL_WIN_FENCED_BLOCK_HPP
diff --git a/3rdparty/asio/include/asio/detail/win_global.hpp b/3rdparty/asio/include/asio/detail/win_global.hpp
index f77976e21ed..771f3fcba4b 100644
--- a/3rdparty/asio/include/asio/detail/win_global.hpp
+++ b/3rdparty/asio/include/asio/detail/win_global.hpp
@@ -2,7 +2,7 @@
// detail/win_global.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_file_service.hpp b/3rdparty/asio/include/asio/detail/win_iocp_file_service.hpp
new file mode 100644
index 00000000000..f10a8d3cdf4
--- /dev/null
+++ b/3rdparty/asio/include/asio/detail/win_iocp_file_service.hpp
@@ -0,0 +1,287 @@
+//
+// detail/win_iocp_file_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_DETAIL_WIN_IOCP_FILE_SERVICE_HPP
+#define ASIO_DETAIL_WIN_IOCP_FILE_SERVICE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_FILE)
+
+#include <string>
+#include "asio/detail/cstdint.hpp"
+#include "asio/detail/win_iocp_handle_service.hpp"
+#include "asio/error.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/file_base.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+// Extend win_iocp_handle_service to provide file support.
+class win_iocp_file_service :
+ public execution_context_service_base<win_iocp_file_service>
+{
+public:
+ // The native type of a file.
+ typedef win_iocp_handle_service::native_handle_type native_handle_type;
+
+ // The implementation type of the file.
+ class implementation_type : win_iocp_handle_service::implementation_type
+ {
+ private:
+ // Only this service will have access to the internal values.
+ friend class win_iocp_file_service;
+
+ uint64_t offset_;
+ bool is_stream_;
+ };
+
+ // Constructor.
+ ASIO_DECL win_iocp_file_service(execution_context& context);
+
+ // Destroy all user-defined handler objects owned by the service.
+ ASIO_DECL void shutdown();
+
+ // Construct a new file implementation.
+ void construct(implementation_type& impl)
+ {
+ handle_service_.construct(impl);
+ impl.offset_ = 0;
+ impl.is_stream_ = false;
+ }
+
+ // Move-construct a new file implementation.
+ void move_construct(implementation_type& impl,
+ implementation_type& other_impl)
+ {
+ handle_service_.move_construct(impl, other_impl);
+ impl.offset_ = other_impl.offset_;
+ impl.is_stream_ = other_impl.is_stream_;
+ other_impl.offset_ = 0;
+ }
+
+ // Move-assign from another file implementation.
+ void move_assign(implementation_type& impl,
+ win_iocp_file_service& other_service,
+ implementation_type& other_impl)
+ {
+ handle_service_.move_assign(impl,
+ other_service.handle_service_, other_impl);
+ impl.offset_ = other_impl.offset_;
+ impl.is_stream_ = other_impl.is_stream_;
+ other_impl.offset_ = 0;
+ }
+
+ // Destroy a file implementation.
+ void destroy(implementation_type& impl)
+ {
+ handle_service_.destroy(impl);
+ }
+
+ // Set whether the implementation is stream-oriented.
+ void set_is_stream(implementation_type& impl, bool is_stream)
+ {
+ impl.is_stream_ = is_stream;
+ }
+
+ // Open the file using the specified path name.
+ ASIO_DECL asio::error_code open(implementation_type& impl,
+ const char* path, file_base::flags open_flags,
+ asio::error_code& ec);
+
+ // Assign a native handle to a file implementation.
+ asio::error_code assign(implementation_type& impl,
+ const native_handle_type& native_handle,
+ asio::error_code& ec)
+ {
+ return handle_service_.assign(impl, native_handle, ec);
+ }
+
+ // Determine whether the file is open.
+ bool is_open(const implementation_type& impl) const
+ {
+ return handle_service_.is_open(impl);
+ }
+
+ // Destroy a file implementation.
+ asio::error_code close(implementation_type& impl,
+ asio::error_code& ec)
+ {
+ return handle_service_.close(impl, ec);
+ }
+
+ // Get the native file representation.
+ native_handle_type native_handle(const implementation_type& impl) const
+ {
+ return handle_service_.native_handle(impl);
+ }
+
+ // Release ownership of a file.
+ native_handle_type release(implementation_type& impl,
+ asio::error_code& ec)
+ {
+ return handle_service_.release(impl, ec);
+ }
+
+ // Cancel all operations associated with the file.
+ asio::error_code cancel(implementation_type& impl,
+ asio::error_code& ec)
+ {
+ return handle_service_.cancel(impl, ec);
+ }
+
+ // Get the size of the file.
+ ASIO_DECL uint64_t size(const implementation_type& impl,
+ asio::error_code& ec) const;
+
+ // Alter the size of the file.
+ ASIO_DECL asio::error_code resize(implementation_type& impl,
+ uint64_t n, asio::error_code& ec);
+
+ // Synchronise the file to disk.
+ ASIO_DECL asio::error_code sync_all(implementation_type& impl,
+ asio::error_code& ec);
+
+ // Synchronise the file data to disk.
+ ASIO_DECL asio::error_code sync_data(implementation_type& impl,
+ asio::error_code& ec);
+
+ // Seek to a position in the file.
+ ASIO_DECL uint64_t seek(implementation_type& impl, int64_t offset,
+ file_base::seek_basis whence, asio::error_code& ec);
+
+ // Write the given data. Returns the number of bytes written.
+ template <typename ConstBufferSequence>
+ size_t write_some(implementation_type& impl,
+ const ConstBufferSequence& buffers, asio::error_code& ec)
+ {
+ uint64_t offset = impl.offset_;
+ impl.offset_ += asio::buffer_size(buffers);
+ return handle_service_.write_some_at(impl, offset, buffers, ec);
+ }
+
+ // Start an asynchronous write. The data being written must be valid for the
+ // lifetime of the asynchronous operation.
+ template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+ void async_write_some(implementation_type& impl,
+ const ConstBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ uint64_t offset = impl.offset_;
+ impl.offset_ += asio::buffer_size(buffers);
+ handle_service_.async_write_some_at(impl, offset, buffers, handler, io_ex);
+ }
+
+ // Write the given data at the specified location. Returns the number of
+ // bytes written.
+ template <typename ConstBufferSequence>
+ size_t write_some_at(implementation_type& impl, uint64_t offset,
+ const ConstBufferSequence& buffers, asio::error_code& ec)
+ {
+ return handle_service_.write_some_at(impl, offset, buffers, ec);
+ }
+
+ // Start an asynchronous write at the specified location. The data being
+ // written must be valid for the lifetime of the asynchronous operation.
+ template <typename ConstBufferSequence, typename Handler, typename IoExecutor>
+ void async_write_some_at(implementation_type& impl,
+ uint64_t offset, const ConstBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ handle_service_.async_write_some_at(impl, offset, buffers, handler, io_ex);
+ }
+
+ // Read some data. Returns the number of bytes read.
+ template <typename MutableBufferSequence>
+ size_t read_some(implementation_type& impl,
+ const MutableBufferSequence& buffers, asio::error_code& ec)
+ {
+ uint64_t offset = impl.offset_;
+ impl.offset_ += asio::buffer_size(buffers);
+ return handle_service_.read_some_at(impl, offset, buffers, ec);
+ }
+
+ // Start an asynchronous read. The buffer for the data being read must be
+ // valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence,
+ typename Handler, typename IoExecutor>
+ void async_read_some(implementation_type& impl,
+ const MutableBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ uint64_t offset = impl.offset_;
+ impl.offset_ += asio::buffer_size(buffers);
+ handle_service_.async_read_some_at(impl, offset, buffers, handler, io_ex);
+ }
+
+ // Read some data. Returns the number of bytes read.
+ template <typename MutableBufferSequence>
+ size_t read_some_at(implementation_type& impl, uint64_t offset,
+ const MutableBufferSequence& buffers, asio::error_code& ec)
+ {
+ return handle_service_.read_some_at(impl, offset, buffers, ec);
+ }
+
+ // Start an asynchronous read. The buffer for the data being read must be
+ // valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence,
+ typename Handler, typename IoExecutor>
+ void async_read_some_at(implementation_type& impl,
+ uint64_t offset, const MutableBufferSequence& buffers,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ handle_service_.async_read_some_at(impl, offset, buffers, handler, io_ex);
+ }
+
+private:
+ // The implementation used for initiating asynchronous operations.
+ win_iocp_handle_service handle_service_;
+
+ // Emulation of Windows IO_STATUS_BLOCK structure.
+ struct io_status_block
+ {
+ union u
+ {
+ LONG Status;
+ void* Pointer;
+ };
+ ULONG_PTR Information;
+ };
+
+ // Emulation of flag passed to NtFlushBuffersFileEx.
+ enum { flush_flags_file_data_sync_only = 4 };
+
+ // The type of a NtFlushBuffersFileEx function pointer.
+ typedef LONG (NTAPI *nt_flush_buffers_file_ex_fn)(
+ HANDLE, ULONG, void*, ULONG, io_status_block*);
+
+ // The NTFlushBuffersFileEx function pointer.
+ nt_flush_buffers_file_ex_fn nt_flush_buffers_file_ex_;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#if defined(ASIO_HEADER_ONLY)
+# include "asio/detail/impl/win_iocp_file_service.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+
+#endif // defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_FILE)
+
+#endif // ASIO_DETAIL_WIN_IOCP_FILE_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_handle_read_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_handle_read_op.hpp
index f11abb122e4..9721bda1c21 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_handle_read_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_handle_read_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_handle_read_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -24,7 +24,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/operation.hpp"
@@ -45,7 +44,7 @@ public:
Handler& handler, const IoExecutor& io_ex)
: operation(&win_iocp_handle_read_op::do_complete),
buffers_(buffers),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -57,6 +56,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_handle_read_op* o(static_cast<win_iocp_handle_read_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -64,7 +64,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -80,6 +80,8 @@ public:
if (ec.value() == ERROR_HANDLE_EOF)
ec = asio::error::eof;
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_handle_service.hpp b/3rdparty/asio/include/asio/detail/win_iocp_handle_service.hpp
index 99fc94f0bdf..9e2486b4b79 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_handle_service.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_handle_service.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_handle_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -110,6 +110,10 @@ public:
ASIO_DECL asio::error_code close(implementation_type& impl,
asio::error_code& ec);
+ // Release ownership of a handle.
+ ASIO_DECL native_handle_type release(implementation_type& impl,
+ asio::error_code& ec);
+
// Get the native handle representation.
native_handle_type native_handle(const implementation_type& impl) const
{
@@ -148,7 +152,7 @@ public:
const ConstBufferSequence& buffers,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -178,7 +182,7 @@ public:
uint64_t offset, const ConstBufferSequence& buffers,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -229,7 +233,7 @@ public:
const MutableBufferSequence& buffers,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -261,7 +265,7 @@ public:
uint64_t offset, const MutableBufferSequence& buffers,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -339,6 +343,27 @@ private:
// destroyed.
ASIO_DECL void close_for_destruction(implementation_type& impl);
+ // The type of a NtSetInformationFile function pointer.
+ typedef LONG (NTAPI *nt_set_info_fn)(HANDLE, ULONG_PTR*, void*, ULONG, ULONG);
+
+ // Helper function to get the NtSetInformationFile function pointer. If no
+ // NtSetInformationFile pointer has been obtained yet, one is obtained using
+ // GetProcAddress and the pointer is cached. Returns a null pointer if
+ // NtSetInformationFile is not available.
+ ASIO_DECL nt_set_info_fn get_nt_set_info();
+
+ // Helper function to emulate InterlockedCompareExchangePointer functionality
+ // for:
+ // - very old Platform SDKs; and
+ // - platform SDKs where MSVC's /Wp64 option causes spurious warnings.
+ ASIO_DECL void* interlocked_compare_exchange_pointer(
+ void** dest, void* exch, void* cmp);
+
+ // Helper function to emulate InterlockedExchangePointer functionality for:
+ // - very old Platform SDKs; and
+ // - platform SDKs where MSVC's /Wp64 option causes spurious warnings.
+ ASIO_DECL void* interlocked_exchange_pointer(void** dest, void* val);
+
// Helper class used to implement per operation cancellation.
class iocp_op_cancellation : public operation
{
@@ -382,6 +407,9 @@ private:
// handlers.
win_iocp_io_context& iocp_service_;
+ // Pointer to NtSetInformationFile implementation.
+ void* nt_set_info_;
+
// Mutex to protect access to the linked list of implementations.
mutex mutex_;
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_handle_write_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_handle_write_op.hpp
index a6862051d2d..6a5b7e78338 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_handle_write_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_handle_write_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_handle_write_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -24,7 +24,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/operation.hpp"
@@ -45,15 +44,18 @@ public:
Handler& handler, const IoExecutor& io_ex)
: operation(&win_iocp_handle_write_op::do_complete),
buffers_(buffers),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
static void do_complete(void* owner, operation* base,
- const asio::error_code& ec, std::size_t bytes_transferred)
+ const asio::error_code& result_ec, std::size_t bytes_transferred)
{
+ asio::error_code ec(result_ec);
+
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_handle_write_op* o(static_cast<win_iocp_handle_write_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -61,7 +63,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -73,6 +75,8 @@ public:
}
#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING)
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_io_context.hpp b/3rdparty/asio/include/asio/detail/win_iocp_io_context.hpp
index 1376d37fc45..1de94df7854 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_io_context.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_io_context.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_io_context.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -272,11 +272,13 @@ private:
enum
{
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0600)
// Timeout to use with GetQueuedCompletionStatus on older versions of
// Windows. Some versions of windows have a "bug" where a call to
// GetQueuedCompletionStatus can appear stuck even though there are events
// waiting on the queue. Using a timeout helps to work around the issue.
default_gqcs_timeout = 500,
+#endif // !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0600)
// Maximum waitable timer timeout, in milliseconds.
max_timeout_msec = 5 * 60 * 1000,
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_null_buffers_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_null_buffers_op.hpp
index 5aedd7aed97..07751b9234b 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_null_buffers_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_null_buffers_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_null_buffers_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,7 +22,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -46,7 +45,7 @@ public:
&win_iocp_null_buffers_op::do_perform,
&win_iocp_null_buffers_op::do_complete),
cancel_token_(cancel_token),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -63,6 +62,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_null_buffers_op* o(static_cast<win_iocp_null_buffers_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -70,7 +70,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
// The reactor may have stored a result in the operation object.
@@ -90,6 +90,8 @@ public:
ec = asio::error::connection_refused;
}
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_operation.hpp b/3rdparty/asio/include/asio/detail/win_iocp_operation.hpp
index 4e1cd6a98c7..a935f87b882 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_operation.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_operation.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_operation.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_overlapped_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_overlapped_op.hpp
index 247375ba2c7..dc65ad08311 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_overlapped_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_overlapped_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_overlapped_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,7 +22,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/operation.hpp"
@@ -41,15 +40,18 @@ public:
win_iocp_overlapped_op(Handler& handler, const IoExecutor& io_ex)
: operation(&win_iocp_overlapped_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
static void do_complete(void* owner, operation* base,
- const asio::error_code& ec, std::size_t bytes_transferred)
+ const asio::error_code& result_ec, std::size_t bytes_transferred)
{
+ asio::error_code ec(result_ec);
+
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_overlapped_op* o(static_cast<win_iocp_overlapped_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -57,9 +59,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp b/3rdparty/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp
index 5249abb66dd..596705a38c6 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_overlapped_ptr.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -47,11 +47,11 @@ public:
// Construct an win_iocp_overlapped_ptr to contain the specified handler.
template <typename Executor, typename Handler>
explicit win_iocp_overlapped_ptr(const Executor& ex,
- ASIO_MOVE_ARG(Handler) handler)
+ Handler&& handler)
: ptr_(0),
iocp_service_(0)
{
- this->reset(ex, ASIO_MOVE_CAST(Handler)(handler));
+ this->reset(ex, static_cast<Handler&&>(handler));
}
// Destructor automatically frees the OVERLAPPED object unless released.
@@ -134,9 +134,9 @@ public:
private:
template <typename Executor>
static win_iocp_io_context* get_iocp_service(const Executor& ex,
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, execution::context_t>::value
- >::type* = 0)
+ >* = 0)
{
return &use_service<win_iocp_io_context>(
asio::query(ex, execution::context));
@@ -144,9 +144,9 @@ private:
template <typename Executor>
static win_iocp_io_context* get_iocp_service(const Executor& ex,
- typename enable_if<
+ enable_if_t<
!can_query<const Executor&, execution::context_t>::value
- >::type* = 0)
+ >* = 0)
{
return &use_service<win_iocp_io_context>(ex.context());
}
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_serial_port_service.hpp b/3rdparty/asio/include/asio/detail/win_iocp_serial_port_service.hpp
index d1d9d8281ce..e0e12e91d5f 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_serial_port_service.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_serial_port_service.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_serial_port_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -137,6 +137,7 @@ public:
asio::error_code& ec)
{
ec = asio::error::operation_not_supported;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_socket_accept_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_socket_accept_op.hpp
index c25cb172484..f4aa850be80 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_socket_accept_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_socket_accept_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_socket_accept_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,7 +22,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/operation.hpp"
@@ -55,7 +54,7 @@ public:
enable_connection_aborted_(enable_connection_aborted),
proxy_op_(0),
cancel_requested_(0),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -88,6 +87,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_socket_accept_op* o(static_cast<win_iocp_socket_accept_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -137,9 +137,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -176,8 +178,6 @@ private:
handler_work<Handler, IoExecutor> work_;
};
-#if defined(ASIO_HAS_MOVE)
-
template <typename Protocol, typename PeerIoExecutor,
typename Handler, typename IoExecutor>
class win_iocp_socket_move_accept_op : public operation
@@ -199,7 +199,7 @@ public:
enable_connection_aborted_(enable_connection_aborted),
cancel_requested_(0),
proxy_op_(0),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -232,6 +232,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_socket_move_accept_op* o(
static_cast<win_iocp_socket_move_accept_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -282,9 +283,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
@@ -293,8 +296,8 @@ public:
// deallocated the memory here.
detail::move_binder2<Handler,
asio::error_code, peer_socket_type>
- handler(0, ASIO_MOVE_CAST(Handler)(o->handler_), ec,
- ASIO_MOVE_CAST(peer_socket_type)(o->peer_));
+ handler(0, static_cast<Handler&&>(o->handler_), ec,
+ static_cast<peer_socket_type&&>(o->peer_));
p.h = asio::detail::addressof(handler.handler_);
p.reset();
@@ -326,8 +329,6 @@ private:
handler_work<Handler, IoExecutor> work_;
};
-#endif // defined(ASIO_HAS_MOVE)
-
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_socket_connect_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_socket_connect_op.hpp
index f7be04d5c56..104ee87bb24 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_socket_connect_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_socket_connect_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_socket_connect_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,7 +22,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -47,6 +46,7 @@ public:
static status do_perform(reactor_op* base)
{
+ ASIO_ASSUME(base != 0);
win_iocp_socket_connect_op_base* o(
static_cast<win_iocp_socket_connect_op_base*>(base));
@@ -68,7 +68,7 @@ public:
Handler& handler, const IoExecutor& io_ex)
: win_iocp_socket_connect_op_base(socket,
&win_iocp_socket_connect_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -80,6 +80,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_socket_connect_op* o(
static_cast<win_iocp_socket_connect_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -96,9 +97,11 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_socket_recv_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_socket_recv_op.hpp
index 0da29825dd2..874a12aa7d0 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_socket_recv_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_socket_recv_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_socket_recv_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/operation.hpp"
@@ -49,7 +48,7 @@ public:
state_(state),
cancel_token_(cancel_token),
buffers_(buffers),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -61,6 +60,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_socket_recv_op* o(static_cast<win_iocp_socket_recv_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -68,7 +68,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -85,6 +85,8 @@ public:
MutableBufferSequence>::all_empty(o->buffers_),
ec, bytes_transferred);
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp
index 40c91144c58..b4b98aa0148 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_socket_recvfrom_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/operation.hpp"
@@ -51,7 +50,7 @@ public:
endpoint_size_(static_cast<int>(endpoint.capacity())),
cancel_token_(cancel_token),
buffers_(buffers),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -68,6 +67,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_socket_recvfrom_op* o(
static_cast<win_iocp_socket_recvfrom_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -76,7 +76,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -93,6 +93,8 @@ public:
// Record the size of the endpoint returned by the operation.
o->endpoint_.resize(o->endpoint_size_);
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp
index a14a4b5cb1b..85e4b78dc20 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp
@@ -1,8 +1,8 @@
//
// detail/win_iocp_socket_recvmsg_op.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/operation.hpp"
@@ -51,7 +50,7 @@ public:
cancel_token_(cancel_token),
buffers_(buffers),
out_flags_(out_flags),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -63,6 +62,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_socket_recvmsg_op* o(
static_cast<win_iocp_socket_recvmsg_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -71,7 +71,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -86,6 +86,8 @@ public:
socket_ops::complete_iocp_recvmsg(o->cancel_token_, ec);
o->out_flags_ = 0;
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_socket_send_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_socket_send_op.hpp
index 3a40abefa06..c7043c4875e 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_socket_send_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_socket_send_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_socket_send_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/operation.hpp"
@@ -47,7 +46,7 @@ public:
: operation(&win_iocp_socket_send_op::do_complete),
cancel_token_(cancel_token),
buffers_(buffers),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -59,6 +58,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_socket_send_op* o(static_cast<win_iocp_socket_send_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -66,7 +66,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -80,6 +80,8 @@ public:
socket_ops::complete_iocp_send(o->cancel_token_, ec);
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_socket_service.hpp b/3rdparty/asio/include/asio/detail/win_iocp_socket_service.hpp
index 6f7fa182c43..faeaffa4c36 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_socket_service.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_socket_service.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_socket_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -27,7 +27,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/mutex.hpp"
#include "asio/detail/operation.hpp"
@@ -51,7 +50,7 @@ namespace detail {
template <typename Protocol>
class win_iocp_socket_service :
- public execution_context_service_base<win_iocp_socket_service<Protocol> >,
+ public execution_context_service_base<win_iocp_socket_service<Protocol>>,
public win_iocp_socket_service_base
{
public:
@@ -131,7 +130,7 @@ public:
// Constructor.
win_iocp_socket_service(execution_context& context)
: execution_context_service_base<
- win_iocp_socket_service<Protocol> >(context),
+ win_iocp_socket_service<Protocol>>(context),
win_iocp_socket_service_base(context)
{
}
@@ -144,7 +143,7 @@ public:
// Move-construct a new socket implementation.
void move_construct(implementation_type& impl,
- implementation_type& other_impl) ASIO_NOEXCEPT
+ implementation_type& other_impl) noexcept
{
this->base_move_construct(impl, other_impl);
@@ -205,6 +204,8 @@ public:
impl.have_remote_endpoint_ = false;
impl.remote_endpoint_ = endpoint_type();
}
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -219,6 +220,8 @@ public:
impl.have_remote_endpoint_ = native_socket.have_remote_endpoint();
impl.remote_endpoint_ = native_socket.remote_endpoint();
}
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -235,6 +238,8 @@ public:
const endpoint_type& endpoint, asio::error_code& ec)
{
socket_ops::bind(impl.socket_, endpoint.data(), endpoint.size(), ec);
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -246,6 +251,8 @@ public:
socket_ops::setsockopt(impl.socket_, impl.state_,
option.level(impl.protocol_), option.name(impl.protocol_),
option.data(impl.protocol_), option.size(impl.protocol_), ec);
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -260,6 +267,8 @@ public:
option.data(impl.protocol_), &size, ec);
if (!ec)
option.resize(impl.protocol_, size);
+
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -270,7 +279,10 @@ public:
endpoint_type endpoint;
std::size_t addr_len = endpoint.capacity();
if (socket_ops::getsockname(impl.socket_, endpoint.data(), &addr_len, ec))
+ {
+ ASIO_ERROR_LOCATION(ec);
return endpoint_type();
+ }
endpoint.resize(addr_len);
return endpoint;
}
@@ -283,7 +295,10 @@ public:
std::size_t addr_len = endpoint.capacity();
if (socket_ops::getpeername(impl.socket_, endpoint.data(),
&addr_len, impl.have_remote_endpoint_, ec))
+ {
+ ASIO_ERROR_LOCATION(ec);
return endpoint_type();
+ }
endpoint.resize(addr_len);
return endpoint;
}
@@ -306,9 +321,12 @@ public:
buffer_sequence_adapter<asio::const_buffer,
ConstBufferSequence> bufs(buffers);
- return socket_ops::sync_sendto(impl.socket_, impl.state_,
- bufs.buffers(), bufs.count(), flags,
+ size_t n = socket_ops::sync_sendto(impl.socket_,
+ impl.state_, bufs.buffers(), bufs.count(), flags,
destination.data(), destination.size(), ec);
+
+ ASIO_ERROR_LOCATION(ec);
+ return n;
}
// Wait until data can be sent without blocking.
@@ -318,7 +336,7 @@ public:
{
// Wait for socket to become ready.
socket_ops::poll_write(impl.socket_, impl.state_, -1, ec);
-
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -330,7 +348,7 @@ public:
socket_base::message_flags flags, Handler& handler,
const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -388,14 +406,15 @@ public:
MutableBufferSequence> bufs(buffers);
std::size_t addr_len = sender_endpoint.capacity();
- std::size_t bytes_recvd = socket_ops::sync_recvfrom(
- impl.socket_, impl.state_, bufs.buffers(), bufs.count(),
- flags, sender_endpoint.data(), &addr_len, ec);
+ std::size_t n = socket_ops::sync_recvfrom(impl.socket_,
+ impl.state_, bufs.buffers(), bufs.count(), flags,
+ sender_endpoint.data(), &addr_len, ec);
if (!ec)
sender_endpoint.resize(addr_len);
- return bytes_recvd;
+ ASIO_ERROR_LOCATION(ec);
+ return n;
}
// Wait until data can be received without blocking.
@@ -409,6 +428,7 @@ public:
// Reset endpoint since it can be given no sensible value at this time.
sender_endpoint = endpoint_type();
+ ASIO_ERROR_LOCATION(ec);
return 0;
}
@@ -422,7 +442,7 @@ public:
socket_base::message_flags flags, Handler& handler,
const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -454,7 +474,7 @@ public:
endpoint_type& sender_endpoint, socket_base::message_flags flags,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -498,6 +518,7 @@ public:
if (peer.is_open())
{
ec = asio::error::already_open;
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -516,6 +537,7 @@ public:
new_socket.release();
}
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -525,7 +547,7 @@ public:
void async_accept(implementation_type& impl, Socket& peer,
endpoint_type* peer_endpoint, Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -557,7 +579,6 @@ public:
p.v = p.p = 0;
}
-#if defined(ASIO_HAS_MOVE)
// Start an asynchronous accept. The peer and peer_endpoint objects
// must be valid until the accept's handler is invoked.
template <typename PeerIoExecutor, typename Handler, typename IoExecutor>
@@ -565,7 +586,7 @@ public:
const PeerIoExecutor& peer_io_ex, endpoint_type* peer_endpoint,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -597,7 +618,6 @@ public:
p.p->address_length(), o);
p.v = p.p = 0;
}
-#endif // defined(ASIO_HAS_MOVE)
// Connect the socket to the specified endpoint.
asio::error_code connect(implementation_type& impl,
@@ -605,6 +625,7 @@ public:
{
socket_ops::sync_connect(impl.socket_,
peer_endpoint.data(), peer_endpoint.size(), ec);
+ ASIO_ERROR_LOCATION(ec);
return ec;
}
@@ -614,7 +635,7 @@ public:
const endpoint_type& peer_endpoint, Handler& handler,
const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_socket_service_base.hpp b/3rdparty/asio/include/asio/detail/win_iocp_socket_service_base.hpp
index 738c6f04191..a157143e35b 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_socket_service_base.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_socket_service_base.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_socket_service_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -27,7 +27,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/mutex.hpp"
#include "asio/detail/operation.hpp"
@@ -96,7 +95,7 @@ public:
// Move-construct a new socket implementation.
ASIO_DECL void base_move_construct(base_implementation_type& impl,
- base_implementation_type& other_impl) ASIO_NOEXCEPT;
+ base_implementation_type& other_impl) noexcept;
// Move-assign from another socket implementation.
ASIO_DECL void base_move_assign(base_implementation_type& impl,
@@ -214,7 +213,7 @@ public:
void async_wait(base_implementation_type& impl,
socket_base::wait_type w, Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
bool is_continuation =
@@ -298,7 +297,7 @@ public:
const ConstBufferSequence& buffers, socket_base::message_flags flags,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -374,7 +373,7 @@ public:
const MutableBufferSequence& buffers, socket_base::message_flags flags,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -407,7 +406,7 @@ public:
const null_buffers&, socket_base::message_flags flags,
Handler& handler, const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -478,7 +477,7 @@ public:
socket_base::message_flags& out_flags, Handler& handler,
const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -510,7 +509,7 @@ public:
socket_base::message_flags& out_flags, Handler& handler,
const IoExecutor& io_ex)
{
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Allocate and construct an operation to wrap the handler.
@@ -569,9 +568,8 @@ protected:
// Helper function to start an asynchronous send_to operation.
ASIO_DECL void start_send_to_op(base_implementation_type& impl,
- WSABUF* buffers, std::size_t buffer_count,
- const socket_addr_type* addr, int addrlen,
- socket_base::message_flags flags, operation* op);
+ WSABUF* buffers, std::size_t buffer_count, const void* addr,
+ int addrlen, socket_base::message_flags flags, operation* op);
// Helper function to start an asynchronous receive operation.
ASIO_DECL void start_receive_op(base_implementation_type& impl,
@@ -585,7 +583,7 @@ protected:
// Helper function to start an asynchronous receive_from operation.
ASIO_DECL void start_receive_from_op(base_implementation_type& impl,
- WSABUF* buffers, std::size_t buffer_count, socket_addr_type* addr,
+ WSABUF* buffers, std::size_t buffer_count, void* addr,
socket_base::message_flags flags, int* addrlen, operation* op);
// Helper function to start an asynchronous accept operation.
@@ -599,9 +597,8 @@ protected:
// Start the asynchronous connect operation using the reactor.
ASIO_DECL int start_connect_op(base_implementation_type& impl,
- int family, int type, const socket_addr_type* remote_addr,
- std::size_t remote_addrlen, win_iocp_socket_connect_op_base* op,
- operation* iocp_op);
+ int family, int type, const void* remote_addr, std::size_t remote_addrlen,
+ win_iocp_socket_connect_op_base* op, operation* iocp_op);
// Helper function to close a socket when the associated object is being
// destroyed.
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_thread_info.hpp b/3rdparty/asio/include/asio/detail/win_iocp_thread_info.hpp
index 2b9b1bf5623..3f1e0126779 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_thread_info.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_thread_info.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_thread_info.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/win_iocp_wait_op.hpp b/3rdparty/asio/include/asio/detail/win_iocp_wait_op.hpp
index b17fe404b89..882f16e73cf 100644
--- a/3rdparty/asio/include/asio/detail/win_iocp_wait_op.hpp
+++ b/3rdparty/asio/include/asio/detail/win_iocp_wait_op.hpp
@@ -2,7 +2,7 @@
// detail/win_iocp_wait_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/reactor_op.hpp"
@@ -47,7 +46,7 @@ public:
&win_iocp_wait_op::do_perform,
&win_iocp_wait_op::do_complete),
cancel_token_(cancel_token),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -64,6 +63,7 @@ public:
asio::error_code ec(result_ec);
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
win_iocp_wait_op* o(static_cast<win_iocp_wait_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -71,7 +71,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
// The reactor may have stored a result in the operation object.
@@ -91,6 +91,8 @@ public:
ec = asio::error::connection_refused;
}
+ ASIO_ERROR_LOCATION(ec);
+
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
diff --git a/3rdparty/asio/include/asio/detail/win_mutex.hpp b/3rdparty/asio/include/asio/detail/win_mutex.hpp
index aed9ad91b92..77603ec9750 100644
--- a/3rdparty/asio/include/asio/detail/win_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/win_mutex.hpp
@@ -2,7 +2,7 @@
// detail/win_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/win_object_handle_service.hpp b/3rdparty/asio/include/asio/detail/win_object_handle_service.hpp
index a80c27dfc0b..8e01b72f4f6 100644
--- a/3rdparty/asio/include/asio/detail/win_object_handle_service.hpp
+++ b/3rdparty/asio/include/asio/detail/win_object_handle_service.hpp
@@ -2,7 +2,7 @@
// detail/win_object_handle_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2011 Boris Schaeling (boris@highscore.de)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -20,7 +20,6 @@
#if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE)
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/wait_handler.hpp"
#include "asio/error.hpp"
diff --git a/3rdparty/asio/include/asio/detail/win_static_mutex.hpp b/3rdparty/asio/include/asio/detail/win_static_mutex.hpp
index 4538c3d168c..736ef0e3f2c 100644
--- a/3rdparty/asio/include/asio/detail/win_static_mutex.hpp
+++ b/3rdparty/asio/include/asio/detail/win_static_mutex.hpp
@@ -2,7 +2,7 @@
// detail/win_static_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/win_thread.hpp b/3rdparty/asio/include/asio/detail/win_thread.hpp
index 0f6679d0190..c1e7b8e618a 100644
--- a/3rdparty/asio/include/asio/detail/win_thread.hpp
+++ b/3rdparty/asio/include/asio/detail/win_thread.hpp
@@ -2,7 +2,7 @@
// detail/win_thread.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/win_tss_ptr.hpp b/3rdparty/asio/include/asio/detail/win_tss_ptr.hpp
index fa137a8bce2..95a87717bad 100644
--- a/3rdparty/asio/include/asio/detail/win_tss_ptr.hpp
+++ b/3rdparty/asio/include/asio/detail/win_tss_ptr.hpp
@@ -2,7 +2,7 @@
// detail/win_tss_ptr.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/winapp_thread.hpp b/3rdparty/asio/include/asio/detail/winapp_thread.hpp
index 512aa231e26..efa662dfe6f 100644
--- a/3rdparty/asio/include/asio/detail/winapp_thread.hpp
+++ b/3rdparty/asio/include/asio/detail/winapp_thread.hpp
@@ -2,7 +2,7 @@
// detail/winapp_thread.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/wince_thread.hpp b/3rdparty/asio/include/asio/detail/wince_thread.hpp
index 63030f2545f..3c6b8543c21 100644
--- a/3rdparty/asio/include/asio/detail/wince_thread.hpp
+++ b/3rdparty/asio/include/asio/detail/wince_thread.hpp
@@ -2,7 +2,7 @@
// detail/wince_thread.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/winrt_async_manager.hpp b/3rdparty/asio/include/asio/detail/winrt_async_manager.hpp
index ee7d4f691a6..9d0f9023c8c 100644
--- a/3rdparty/asio/include/asio/detail/winrt_async_manager.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_async_manager.hpp
@@ -2,7 +2,7 @@
// detail/winrt_async_manager.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/winrt_async_op.hpp b/3rdparty/asio/include/asio/detail/winrt_async_op.hpp
index 0751681fae7..a34989841bc 100644
--- a/3rdparty/asio/include/asio/detail/winrt_async_op.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_async_op.hpp
@@ -2,7 +2,7 @@
// detail/winrt_async_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/winrt_resolve_op.hpp b/3rdparty/asio/include/asio/detail/winrt_resolve_op.hpp
index b7cfcb203ae..3cbd00e61f2 100644
--- a/3rdparty/asio/include/asio/detail/winrt_resolve_op.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_resolve_op.hpp
@@ -2,7 +2,7 @@
// detail/winrt_resolve_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,7 +22,6 @@
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/winrt_async_op.hpp"
@@ -54,7 +53,7 @@ public:
Windows::Networking::EndpointPair^>^>(
&winrt_resolve_op::do_complete),
query_(query),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -63,6 +62,7 @@ public:
const asio::error_code&, std::size_t)
{
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
winrt_resolve_op* o(static_cast<winrt_resolve_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -70,7 +70,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
results_type results = results_type();
diff --git a/3rdparty/asio/include/asio/detail/winrt_resolver_service.hpp b/3rdparty/asio/include/asio/detail/winrt_resolver_service.hpp
index 81ecb7400bf..02dddf08226 100644
--- a/3rdparty/asio/include/asio/detail/winrt_resolver_service.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_resolver_service.hpp
@@ -2,7 +2,7 @@
// detail/winrt_resolver_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -42,7 +42,7 @@ namespace detail {
template <typename Protocol>
class winrt_resolver_service :
- public execution_context_service_base<winrt_resolver_service<Protocol> >
+ public execution_context_service_base<winrt_resolver_service<Protocol>>
{
public:
// The implementation type of the resolver. A cancellation token is used to
@@ -62,7 +62,7 @@ public:
// Constructor.
winrt_resolver_service(execution_context& context)
: execution_context_service_base<
- winrt_resolver_service<Protocol> >(context),
+ winrt_resolver_service<Protocol>>(context),
scheduler_(use_service<scheduler_impl>(context)),
async_manager_(use_service<winrt_async_manager>(context))
{
diff --git a/3rdparty/asio/include/asio/detail/winrt_socket_connect_op.hpp b/3rdparty/asio/include/asio/detail/winrt_socket_connect_op.hpp
index b0e0fbf2975..008062e1b6e 100644
--- a/3rdparty/asio/include/asio/detail/winrt_socket_connect_op.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_socket_connect_op.hpp
@@ -2,7 +2,7 @@
// detail/winrt_socket_connect_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/winrt_async_op.hpp"
@@ -43,7 +42,7 @@ public:
winrt_socket_connect_op(Handler& handler, const IoExecutor& io_ex)
: winrt_async_op<void>(&winrt_socket_connect_op::do_complete),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -52,6 +51,7 @@ public:
const asio::error_code&, std::size_t)
{
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
winrt_socket_connect_op* o(static_cast<winrt_socket_connect_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -59,7 +59,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
// Make a copy of the handler so that the memory can be deallocated before
diff --git a/3rdparty/asio/include/asio/detail/winrt_socket_recv_op.hpp b/3rdparty/asio/include/asio/detail/winrt_socket_recv_op.hpp
index 722578ee9f9..4b1d9f895f3 100644
--- a/3rdparty/asio/include/asio/detail/winrt_socket_recv_op.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_socket_recv_op.hpp
@@ -2,7 +2,7 @@
// detail/winrt_socket_recv_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/winrt_async_op.hpp"
@@ -46,7 +45,7 @@ public:
: winrt_async_op<Windows::Storage::Streams::IBuffer^>(
&winrt_socket_recv_op::do_complete),
buffers_(buffers),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -55,6 +54,7 @@ public:
const asio::error_code&, std::size_t)
{
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
winrt_socket_recv_op* o(static_cast<winrt_socket_recv_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -62,7 +62,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
diff --git a/3rdparty/asio/include/asio/detail/winrt_socket_send_op.hpp b/3rdparty/asio/include/asio/detail/winrt_socket_send_op.hpp
index 0f52d9718e7..eb21ef7e902 100644
--- a/3rdparty/asio/include/asio/detail/winrt_socket_send_op.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_socket_send_op.hpp
@@ -2,7 +2,7 @@
// detail/winrt_socket_send_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,6 @@
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_work.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/winrt_async_op.hpp"
@@ -45,7 +44,7 @@ public:
Handler& handler, const IoExecutor& io_ex)
: winrt_async_op<unsigned int>(&winrt_socket_send_op::do_complete),
buffers_(buffers),
- handler_(ASIO_MOVE_CAST(Handler)(handler)),
+ handler_(static_cast<Handler&&>(handler)),
work_(handler_, io_ex)
{
}
@@ -54,6 +53,7 @@ public:
const asio::error_code&, std::size_t)
{
// Take ownership of the operation object.
+ ASIO_ASSUME(base != 0);
winrt_socket_send_op* o(static_cast<winrt_socket_send_op*>(base));
ptr p = { asio::detail::addressof(o->handler_), o, o };
@@ -61,7 +61,7 @@ public:
// Take ownership of the operation's outstanding work.
handler_work<Handler, IoExecutor> w(
- ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+ static_cast<handler_work<Handler, IoExecutor>&&>(
o->work_));
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
diff --git a/3rdparty/asio/include/asio/detail/winrt_ssocket_service.hpp b/3rdparty/asio/include/asio/detail/winrt_ssocket_service.hpp
index b7727ff2d2f..6b45ed4fb0c 100644
--- a/3rdparty/asio/include/asio/detail/winrt_ssocket_service.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_ssocket_service.hpp
@@ -2,7 +2,7 @@
// detail/winrt_ssocket_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -33,7 +33,7 @@ namespace detail {
template <typename Protocol>
class winrt_ssocket_service :
- public execution_context_service_base<winrt_ssocket_service<Protocol> >,
+ public execution_context_service_base<winrt_ssocket_service<Protocol>>,
public winrt_ssocket_service_base
{
public:
@@ -62,7 +62,7 @@ public:
// Constructor.
winrt_ssocket_service(execution_context& context)
- : execution_context_service_base<winrt_ssocket_service<Protocol> >(context),
+ : execution_context_service_base<winrt_ssocket_service<Protocol>>(context),
winrt_ssocket_service_base(context)
{
}
@@ -75,7 +75,7 @@ public:
// Move-construct a new socket implementation.
void move_construct(implementation_type& impl,
- implementation_type& other_impl) ASIO_NOEXCEPT
+ implementation_type& other_impl) noexcept
{
this->base_move_construct(impl, other_impl);
diff --git a/3rdparty/asio/include/asio/detail/winrt_ssocket_service_base.hpp b/3rdparty/asio/include/asio/detail/winrt_ssocket_service_base.hpp
index 6668975e5a7..c752da80e2a 100644
--- a/3rdparty/asio/include/asio/detail/winrt_ssocket_service_base.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_ssocket_service_base.hpp
@@ -2,7 +2,7 @@
// detail/winrt_ssocket_service_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -77,7 +77,7 @@ public:
// Move-construct a new socket implementation.
ASIO_DECL void base_move_construct(base_implementation_type& impl,
- base_implementation_type& other_impl) ASIO_NOEXCEPT;
+ base_implementation_type& other_impl) noexcept;
// Move-assign from another socket implementation.
ASIO_DECL void base_move_assign(base_implementation_type& impl,
diff --git a/3rdparty/asio/include/asio/detail/winrt_timer_scheduler.hpp b/3rdparty/asio/include/asio/detail/winrt_timer_scheduler.hpp
index 8fd9636bf85..aadd581f75d 100644
--- a/3rdparty/asio/include/asio/detail/winrt_timer_scheduler.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_timer_scheduler.hpp
@@ -2,7 +2,7 @@
// detail/winrt_timer_scheduler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/winrt_utils.hpp b/3rdparty/asio/include/asio/detail/winrt_utils.hpp
index d0e184098eb..f33786ccf8b 100644
--- a/3rdparty/asio/include/asio/detail/winrt_utils.hpp
+++ b/3rdparty/asio/include/asio/detail/winrt_utils.hpp
@@ -2,7 +2,7 @@
// detail/winrt_utils.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/detail/winsock_init.hpp b/3rdparty/asio/include/asio/detail/winsock_init.hpp
index a9e361a1c94..7914560ab64 100644
--- a/3rdparty/asio/include/asio/detail/winsock_init.hpp
+++ b/3rdparty/asio/include/asio/detail/winsock_init.hpp
@@ -2,7 +2,7 @@
// detail/winsock_init.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -47,7 +47,7 @@ protected:
ASIO_DECL static void throw_on_error(data& d);
};
-template <int Major = 2, int Minor = 0>
+template <int Major = 2, int Minor = 2>
class winsock_init : private winsock_init_base
{
public:
diff --git a/3rdparty/asio/include/asio/detail/work_dispatcher.hpp b/3rdparty/asio/include/asio/detail/work_dispatcher.hpp
index 9ece5014d94..2a473e45af6 100644
--- a/3rdparty/asio/include/asio/detail/work_dispatcher.hpp
+++ b/3rdparty/asio/include/asio/detail/work_dispatcher.hpp
@@ -2,7 +2,7 @@
// detail/work_dispatcher.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -39,13 +39,13 @@ struct is_work_dispatcher_required : true_type
template <typename Handler, typename Executor>
struct is_work_dispatcher_required<Handler, Executor,
- typename enable_if<
+ enable_if_t<
is_same<
typename associated_executor<Handler,
Executor>::asio_associated_executor_is_unspecialised,
void
>::value
- >::type> : false_type
+ >> : false_type
{
};
@@ -54,15 +54,14 @@ class work_dispatcher
{
public:
template <typename CompletionHandler>
- work_dispatcher(ASIO_MOVE_ARG(CompletionHandler) handler,
+ work_dispatcher(CompletionHandler&& handler,
const Executor& handler_ex)
- : handler_(ASIO_MOVE_CAST(CompletionHandler)(handler)),
+ : handler_(static_cast<CompletionHandler&&>(handler)),
executor_(asio::prefer(handler_ex,
execution::outstanding_work.tracked))
{
}
-#if defined(ASIO_HAS_MOVE)
work_dispatcher(const work_dispatcher& other)
: handler_(other.handler_),
executor_(other.executor_)
@@ -70,28 +69,25 @@ public:
}
work_dispatcher(work_dispatcher&& other)
- : handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
- executor_(ASIO_MOVE_CAST(work_executor_type)(other.executor_))
+ : handler_(static_cast<Handler&&>(other.handler_)),
+ executor_(static_cast<work_executor_type&&>(other.executor_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
- execution::execute(
- asio::prefer(executor_,
- execution::blocking.possibly,
- execution::allocator((get_associated_allocator)(handler_))),
+ associated_allocator_t<Handler> alloc((get_associated_allocator)(handler_));
+ asio::prefer(executor_, execution::allocator(alloc)).execute(
asio::detail::bind_handler(
- ASIO_MOVE_CAST(Handler)(handler_)));
+ static_cast<Handler&&>(handler_)));
}
private:
- typedef typename decay<
- typename prefer_result<const Executor&,
+ typedef decay_t<
+ prefer_result_t<const Executor&,
execution::outstanding_work_t::tracked_t
- >::type
- >::type work_executor_type;
+ >
+ > work_executor_type;
Handler handler_;
work_executor_type executor_;
@@ -101,18 +97,16 @@ private:
template <typename Handler, typename Executor>
class work_dispatcher<Handler, Executor,
- typename enable_if<!execution::is_executor<Executor>::value>::type>
+ enable_if_t<!execution::is_executor<Executor>::value>>
{
public:
template <typename CompletionHandler>
- work_dispatcher(ASIO_MOVE_ARG(CompletionHandler) handler,
- const Executor& handler_ex)
+ work_dispatcher(CompletionHandler&& handler, const Executor& handler_ex)
: work_(handler_ex),
- handler_(ASIO_MOVE_CAST(CompletionHandler)(handler))
+ handler_(static_cast<CompletionHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
work_dispatcher(const work_dispatcher& other)
: work_(other.work_),
handler_(other.handler_)
@@ -120,19 +114,17 @@ public:
}
work_dispatcher(work_dispatcher&& other)
- : work_(ASIO_MOVE_CAST(executor_work_guard<Executor>)(other.work_)),
- handler_(ASIO_MOVE_CAST(Handler)(other.handler_))
+ : work_(static_cast<executor_work_guard<Executor>&&>(other.work_)),
+ handler_(static_cast<Handler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
- typename associated_allocator<Handler>::type alloc(
- (get_associated_allocator)(handler_));
+ associated_allocator_t<Handler> alloc((get_associated_allocator)(handler_));
work_.get_executor().dispatch(
asio::detail::bind_handler(
- ASIO_MOVE_CAST(Handler)(handler_)), alloc);
+ static_cast<Handler&&>(handler_)), alloc);
work_.reset();
}
diff --git a/3rdparty/asio/include/asio/detail/wrapped_handler.hpp b/3rdparty/asio/include/asio/detail/wrapped_handler.hpp
index 18ca6d3b955..fce9abfab43 100644
--- a/3rdparty/asio/include/asio/detail/wrapped_handler.hpp
+++ b/3rdparty/asio/include/asio/detail/wrapped_handler.hpp
@@ -2,7 +2,7 @@
// detail/wrapped_handler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/bind_handler.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/push_options.hpp"
@@ -52,11 +50,10 @@ public:
wrapped_handler(Dispatcher dispatcher, Handler& handler)
: dispatcher_(dispatcher),
- handler_(ASIO_MOVE_CAST(Handler)(handler))
+ handler_(static_cast<Handler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
wrapped_handler(const wrapped_handler& other)
: dispatcher_(other.dispatcher_),
handler_(other.handler_)
@@ -65,14 +62,13 @@ public:
wrapped_handler(wrapped_handler&& other)
: dispatcher_(other.dispatcher_),
- handler_(ASIO_MOVE_CAST(Handler)(other.handler_))
+ handler_(static_cast<Handler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
- dispatcher_.dispatch(ASIO_MOVE_CAST(Handler)(handler_));
+ dispatcher_.dispatch(static_cast<Handler&&>(handler_));
}
void operator()() const
@@ -161,7 +157,7 @@ class rewrapped_handler
public:
explicit rewrapped_handler(Handler& handler, const Context& context)
: context_(context),
- handler_(ASIO_MOVE_CAST(Handler)(handler))
+ handler_(static_cast<Handler&&>(handler))
{
}
@@ -171,7 +167,6 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE)
rewrapped_handler(const rewrapped_handler& other)
: context_(other.context_),
handler_(other.handler_)
@@ -179,11 +174,10 @@ public:
}
rewrapped_handler(rewrapped_handler&& other)
- : context_(ASIO_MOVE_CAST(Context)(other.context_)),
- handler_(ASIO_MOVE_CAST(Handler)(other.handler_))
+ : context_(static_cast<Context&&>(other.context_)),
+ handler_(static_cast<Handler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
@@ -201,92 +195,12 @@ public:
};
template <typename Dispatcher, typename Handler, typename IsContinuation>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Dispatcher, typename Handler, typename IsContinuation>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Dispatcher, typename Handler, typename IsContinuation>
inline bool asio_handler_is_continuation(
wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
{
return IsContinuation()(this_handler->dispatcher_, this_handler->handler_);
}
-template <typename Function, typename Dispatcher,
- typename Handler, typename IsContinuation>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
-{
- this_handler->dispatcher_.dispatch(
- rewrapped_handler<Function, Handler>(
- function, this_handler->handler_));
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Dispatcher,
- typename Handler, typename IsContinuation>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
-{
- this_handler->dispatcher_.dispatch(
- rewrapped_handler<Function, Handler>(
- function, this_handler->handler_));
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Context>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- rewrapped_handler<Handler, Context>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler, typename Context>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- rewrapped_handler<Handler, Context>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->context_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Dispatcher, typename Context>
inline bool asio_handler_is_continuation(
rewrapped_handler<Dispatcher, Context>* this_handler)
@@ -295,30 +209,6 @@ inline bool asio_handler_is_continuation(
this_handler->context_);
}
-template <typename Function, typename Handler, typename Context>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- rewrapped_handler<Handler, Context>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->context_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler, typename Context>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- rewrapped_handler<Handler, Context>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->context_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/dispatch.hpp b/3rdparty/asio/include/asio/dispatch.hpp
index 64da41b7c25..9eb60a4103d 100644
--- a/3rdparty/asio/include/asio/dispatch.hpp
+++ b/3rdparty/asio/include/asio/dispatch.hpp
@@ -2,7 +2,7 @@
// dispatch.hpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,6 +17,7 @@
#include "asio/detail/config.hpp"
#include "asio/async_result.hpp"
+#include "asio/detail/initiate_dispatch.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution_context.hpp"
#include "asio/execution/executor.hpp"
@@ -32,27 +33,50 @@ namespace asio {
* executor. The function object may be called from the current thread prior to
* returning from <tt>dispatch()</tt>. Otherwise, it is queued for execution.
*
- * This function has the following effects:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler. The function signature of the completion handler must be:
+ * @code void handler(); @endcode
*
- * @li Constructs a function object handler of type @c Handler, initialized
- * with <tt>handler(forward<CompletionToken>(token))</tt>.
+ * @returns This function returns <tt>async_initiate<NullaryToken,
+ * void()>(Init{}, token)</tt>, where @c Init is a function object type defined
+ * as:
*
- * @li Constructs an object @c result of type <tt>async_result<Handler></tt>,
- * initializing the object as <tt>result(handler)</tt>.
+ * @code class Init
+ * {
+ * public:
+ * template <typename CompletionHandler>
+ * void operator()(CompletionHandler&& completion_handler) const;
+ * }; @endcode
*
- * @li Obtains the handler's associated executor object @c ex by performing
- * <tt>get_associated_executor(handler)</tt>.
+ * The function call operator of @c Init:
+ *
+ * @li Obtains the handler's associated executor object @c ex of type @c Ex by
+ * performing @code auto ex = get_associated_executor(handler); @endcode
*
* @li Obtains the handler's associated allocator object @c alloc by performing
- * <tt>get_associated_allocator(handler)</tt>.
+ * @code auto alloc = get_associated_allocator(handler); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is true, performs
+ * @code prefer(ex, execution::allocator(alloc)).execute(
+ * std::forward<CompletionHandler>(completion_handler)); @endcode
*
- * @li Performs <tt>ex.dispatch(std::move(handler), alloc)</tt>.
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is false, performs
+ * @code ex.dispatch(
+ * std::forward<CompletionHandler>(completion_handler),
+ * alloc); @endcode
*
- * @li Returns <tt>result.get()</tt>.
+ * @par Completion Signature
+ * @code void() @endcode
*/
-template <ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
- ASIO_MOVE_ARG(CompletionToken) token);
+template <ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken>
+inline auto dispatch(NullaryToken&& token)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_dispatch>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_dispatch(), token);
+}
/// Submits a completion token or function object for execution.
/**
@@ -60,62 +84,114 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
* The function object may be called from the current thread prior to returning
* from <tt>dispatch()</tt>. Otherwise, it is queued for execution.
*
- * This function has the following effects:
- *
- * @li Constructs a function object handler of type @c Handler, initialized
- * with <tt>handler(forward<CompletionToken>(token))</tt>.
+ * @param ex The target executor.
*
- * @li Constructs an object @c result of type <tt>async_result<Handler></tt>,
- * initializing the object as <tt>result(handler)</tt>.
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler. The function signature of the completion handler must be:
+ * @code void handler(); @endcode
*
- * @li Obtains the handler's associated executor object @c ex1 by performing
- * <tt>get_associated_executor(handler)</tt>.
+ * @returns This function returns <tt>async_initiate<NullaryToken,
+ * void()>(Init{ex}, token)</tt>, where @c Init is a function object type
+ * defined as:
*
- * @li Creates a work object @c w by performing <tt>make_work(ex1)</tt>.
- *
- * @li Obtains the handler's associated allocator object @c alloc by performing
- * <tt>get_associated_allocator(handler)</tt>.
+ * @code class Init
+ * {
+ * public:
+ * using executor_type = Executor;
+ * explicit Init(const Executor& ex) : ex_(ex) {}
+ * executor_type get_executor() const noexcept { return ex_; }
+ * template <typename CompletionHandler>
+ * void operator()(CompletionHandler&& completion_handler) const;
+ * private:
+ * Executor ex_; // exposition only
+ * }; @endcode
*
- * @li Constructs a function object @c f with a function call operator that
- * performs <tt>ex1.dispatch(std::move(handler), alloc)</tt> followed by
- * <tt>w.reset()</tt>.
+ * The function call operator of @c Init:
*
- * @li Performs <tt>Executor(ex).dispatch(std::move(f), alloc)</tt>.
+ * @li Obtains the handler's associated executor object @c ex1 of type @c Ex1 by
+ * performing @code auto ex1 = get_associated_executor(handler, ex); @endcode
*
- * @li Returns <tt>result.get()</tt>.
+ * @li Obtains the handler's associated allocator object @c alloc by performing
+ * @code auto alloc = get_associated_allocator(handler); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex1>::value</tt> is true, constructs a
+ * function object @c f with a member @c executor_ that is initialised with
+ * <tt>prefer(ex1, execution::outstanding_work.tracked)</tt>, a member @c
+ * handler_ that is a decay-copy of @c completion_handler, and a function call
+ * operator that performs:
+ * @code auto a = get_associated_allocator(handler_);
+ * prefer(executor_, execution::allocator(a)).execute(std::move(handler_));
+ * @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex1>::value</tt> is false, constructs a
+ * function object @c f with a member @c work_ that is initialised with
+ * <tt>make_work_guard(ex1)</tt>, a member @c handler_ that is a decay-copy of
+ * @c completion_handler, and a function call operator that performs:
+ * @code auto a = get_associated_allocator(handler_);
+ * work_.get_executor().dispatch(std::move(handler_), a);
+ * work_.reset(); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is true, performs
+ * @code prefer(ex, execution::allocator(alloc)).execute(std::move(f)); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is false, performs
+ * @code ex.dispatch(std::move(f), alloc); @endcode
+ *
+ * @par Completion Signature
+ * @code void() @endcode
*/
template <typename Executor,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
- const Executor& ex,
- ASIO_MOVE_ARG(CompletionToken) token
- ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<
+ ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken
+ = default_completion_token_t<Executor>>
+inline auto dispatch(const Executor& ex,
+ NullaryToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<
execution::is_executor<Executor>::value || is_executor<Executor>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_dispatch_with_executor<Executor>>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_dispatch_with_executor<Executor>(ex), token);
+}
/// Submits a completion token or function object for execution.
/**
+ * @param ctx An execution context, from which the target executor is obtained.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler. The function signature of the completion handler must be:
+ * @code void handler(); @endcode
+ *
* @returns <tt>dispatch(ctx.get_executor(),
- * forward<CompletionToken>(token))</tt>.
+ * forward<NullaryToken>(token))</tt>.
+ *
+ * @par Completion Signature
+ * @code void() @endcode
*/
template <typename ExecutionContext,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename ExecutionContext::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
- ExecutionContext& ctx,
- ASIO_MOVE_ARG(CompletionToken) token
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename ExecutionContext::executor_type),
- typename constraint<is_convertible<
- ExecutionContext&, execution_context&>::value>::type = 0);
+ ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken
+ = default_completion_token_t<typename ExecutionContext::executor_type>>
+inline auto dispatch(ExecutionContext& ctx,
+ NullaryToken&& token = default_completion_token_t<
+ typename ExecutionContext::executor_type>(),
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_dispatch_with_executor<
+ typename ExecutionContext::executor_type>>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_dispatch_with_executor<
+ typename ExecutionContext::executor_type>(
+ ctx.get_executor()), token);
+}
} // namespace asio
#include "asio/detail/pop_options.hpp"
-#include "asio/impl/dispatch.hpp"
-
#endif // ASIO_DISPATCH_HPP
diff --git a/3rdparty/asio/include/asio/error.hpp b/3rdparty/asio/include/asio/error.hpp
index 8b4decd52d2..d676ee8aa7d 100644
--- a/3rdparty/asio/include/asio/error.hpp
+++ b/3rdparty/asio/include/asio/error.hpp
@@ -2,7 +2,7 @@
// error.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -223,6 +223,41 @@ enum misc_errors
fd_set_failure
};
+// boostify: non-boost code starts here
+#if !defined(ASIO_ERROR_LOCATION)
+# define ASIO_ERROR_LOCATION(e) (void)0
+#endif // !defined(ASIO_ERROR_LOCATION)
+
+// boostify: non-boost code ends here
+#if !defined(ASIO_ERROR_LOCATION) \
+ && !defined(ASIO_DISABLE_ERROR_LOCATION) \
+ && defined(ASIO_HAS_BOOST_CONFIG) \
+ && (BOOST_VERSION >= 107900)
+
+# define ASIO_ERROR_LOCATION(e) \
+ do { \
+ BOOST_STATIC_CONSTEXPR boost::source_location loc \
+ = BOOST_CURRENT_LOCATION; \
+ (e).assign((e), &loc); \
+ } while (false)
+
+#else // !defined(ASIO_ERROR_LOCATION)
+ // && !defined(ASIO_DISABLE_ERROR_LOCATION)
+ // && defined(ASIO_HAS_BOOST_CONFIG)
+ // && (BOOST_VERSION >= 107900)
+
+# define ASIO_ERROR_LOCATION(e) (void)0
+
+#endif // !defined(ASIO_ERROR_LOCATION)
+ // && !defined(ASIO_DISABLE_ERROR_LOCATION)
+ // && defined(ASIO_HAS_BOOST_CONFIG)
+ // && (BOOST_VERSION >= 107900)
+
+inline void clear(asio::error_code& ec)
+{
+ ec.assign(0, ec.category());
+}
+
inline const asio::error_category& get_system_category()
{
return asio::system_category();
@@ -269,7 +304,6 @@ static const asio::error_category&
} // namespace error
} // namespace asio
-#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
namespace std {
template<> struct is_error_code_enum<asio::error::basic_errors>
@@ -293,7 +327,6 @@ template<> struct is_error_code_enum<asio::error::misc_errors>
};
} // namespace std
-#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
namespace asio {
namespace error {
diff --git a/3rdparty/asio/include/asio/error_code.hpp b/3rdparty/asio/include/asio/error_code.hpp
index 4026b9ca58f..5cb07f48c42 100644
--- a/3rdparty/asio/include/asio/error_code.hpp
+++ b/3rdparty/asio/include/asio/error_code.hpp
@@ -2,7 +2,7 @@
// error_code.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,181 +16,18 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
-# include <system_error>
-#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
-# include <string>
-# include "asio/detail/noncopyable.hpp"
-# if !defined(ASIO_NO_IOSTREAM)
-# include <iosfwd>
-# endif // !defined(ASIO_NO_IOSTREAM)
-#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
+#include <system_error>
#include "asio/detail/push_options.hpp"
namespace asio {
-#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
-
typedef std::error_category error_category;
-
-#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
-
-/// Base class for all error categories.
-class error_category : private noncopyable
-{
-public:
- /// Destructor.
- virtual ~error_category()
- {
- }
-
- /// Returns a string naming the error gategory.
- virtual const char* name() const = 0;
-
- /// Returns a string describing the error denoted by @c value.
- virtual std::string message(int value) const = 0;
-
- /// Equality operator to compare two error categories.
- bool operator==(const error_category& rhs) const
- {
- return this == &rhs;
- }
-
- /// Inequality operator to compare two error categories.
- bool operator!=(const error_category& rhs) const
- {
- return !(*this == rhs);
- }
-};
-
-#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
+typedef std::error_code error_code;
/// Returns the error category used for the system errors produced by asio.
extern ASIO_DECL const error_category& system_category();
-#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
-
-typedef std::error_code error_code;
-
-#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
-
-/// Class to represent an error code value.
-class error_code
-{
-public:
- /// Default constructor.
- error_code()
- : value_(0),
- category_(&system_category())
- {
- }
-
- /// Construct with specific error code and category.
- error_code(int v, const error_category& c)
- : value_(v),
- category_(&c)
- {
- }
-
- /// Construct from an error code enum.
- template <typename ErrorEnum>
- error_code(ErrorEnum e)
- {
- *this = make_error_code(e);
- }
-
- /// Clear the error value to the default.
- void clear()
- {
- value_ = 0;
- category_ = &system_category();
- }
-
- /// Assign a new error value.
- void assign(int v, const error_category& c)
- {
- value_ = v;
- category_ = &c;
- }
-
- /// Get the error value.
- int value() const
- {
- return value_;
- }
-
- /// Get the error category.
- const error_category& category() const
- {
- return *category_;
- }
-
- /// Get the message associated with the error.
- std::string message() const
- {
- return category_->message(value_);
- }
-
- struct unspecified_bool_type_t
- {
- };
-
- typedef void (*unspecified_bool_type)(unspecified_bool_type_t);
-
- static void unspecified_bool_true(unspecified_bool_type_t) {}
-
- /// Operator returns non-null if there is a non-success error code.
- operator unspecified_bool_type() const
- {
- if (value_ == 0)
- return 0;
- else
- return &error_code::unspecified_bool_true;
- }
-
- /// Operator to test if the error represents success.
- bool operator!() const
- {
- return value_ == 0;
- }
-
- /// Equality operator to compare two error objects.
- friend bool operator==(const error_code& e1, const error_code& e2)
- {
- return e1.value_ == e2.value_ && e1.category_ == e2.category_;
- }
-
- /// Inequality operator to compare two error objects.
- friend bool operator!=(const error_code& e1, const error_code& e2)
- {
- return e1.value_ != e2.value_ || e1.category_ != e2.category_;
- }
-
-private:
- // The value associated with the error code.
- int value_;
-
- // The category associated with the error code.
- const error_category* category_;
-};
-
-# if !defined(ASIO_NO_IOSTREAM)
-
-/// Output an error code.
-template <typename Elem, typename Traits>
-std::basic_ostream<Elem, Traits>& operator<<(
- std::basic_ostream<Elem, Traits>& os, const error_code& ec)
-{
- os << ec.category().name() << ':' << ec.value();
- return os;
-}
-
-# endif // !defined(ASIO_NO_IOSTREAM)
-
-#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/execution.hpp b/3rdparty/asio/include/asio/execution.hpp
index 861b25bb4b4..fa773259fad 100644
--- a/3rdparty/asio/include/asio/execution.hpp
+++ b/3rdparty/asio/include/asio/execution.hpp
@@ -2,7 +2,7 @@
// execution.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,29 +20,14 @@
#include "asio/execution/bad_executor.hpp"
#include "asio/execution/blocking.hpp"
#include "asio/execution/blocking_adaptation.hpp"
-#include "asio/execution/bulk_execute.hpp"
-#include "asio/execution/bulk_guarantee.hpp"
-#include "asio/execution/connect.hpp"
#include "asio/execution/context.hpp"
#include "asio/execution/context_as.hpp"
-#include "asio/execution/execute.hpp"
#include "asio/execution/executor.hpp"
#include "asio/execution/invocable_archetype.hpp"
#include "asio/execution/mapping.hpp"
#include "asio/execution/occupancy.hpp"
-#include "asio/execution/operation_state.hpp"
#include "asio/execution/outstanding_work.hpp"
#include "asio/execution/prefer_only.hpp"
-#include "asio/execution/receiver.hpp"
-#include "asio/execution/receiver_invocation_error.hpp"
#include "asio/execution/relationship.hpp"
-#include "asio/execution/schedule.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
-#include "asio/execution/set_done.hpp"
-#include "asio/execution/set_error.hpp"
-#include "asio/execution/set_value.hpp"
-#include "asio/execution/start.hpp"
-#include "asio/execution/submit.hpp"
#endif // ASIO_EXECUTION_HPP
diff --git a/3rdparty/asio/include/asio/execution/allocator.hpp b/3rdparty/asio/include/asio/execution/allocator.hpp
index ea4d56c381a..cdb6a4a9203 100644
--- a/3rdparty/asio/include/asio/execution/allocator.hpp
+++ b/3rdparty/asio/include/asio/execution/allocator.hpp
@@ -2,7 +2,7 @@
// execution/allocator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,8 +18,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
#include "asio/is_applicable_property.hpp"
#include "asio/traits/query_static_constexpr_member.hpp"
#include "asio/traits/static_query.hpp"
@@ -37,10 +35,9 @@ namespace execution {
template <typename ProtoAllocator>
struct allocator_t
{
- /// The allocator_t property applies to executors, senders, and schedulers.
+ /// The allocator_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The allocator_t property can be required.
static constexpr bool is_requirable = true;
@@ -79,23 +76,11 @@ struct allocator_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
template <typename T>
struct static_proxy
@@ -104,17 +89,17 @@ struct allocator_t
struct type
{
template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
+ static constexpr auto query(P&& p)
noexcept(
noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
)
-> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
{
- return T::query(ASIO_MOVE_CAST(P)(p));
+ return T::query(static_cast<P&&>(p));
}
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
@@ -130,22 +115,19 @@ struct allocator_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(allocator_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = allocator_t::static_query<E>();
+ static constexpr const T static_query_v = allocator_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- ASIO_CONSTEXPR ProtoAllocator value() const
+ constexpr ProtoAllocator value() const
{
return a_;
}
@@ -153,7 +135,7 @@ struct allocator_t
private:
friend struct allocator_t<void>;
- explicit ASIO_CONSTEXPR allocator_t(const ProtoAllocator& a)
+ explicit constexpr allocator_t(const ProtoAllocator& a)
: a_(a)
{
}
@@ -173,25 +155,13 @@ struct allocator_t<void>
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
- ASIO_CONSTEXPR allocator_t()
+ constexpr allocator_t()
{
}
@@ -202,17 +172,17 @@ struct allocator_t<void>
struct type
{
template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
+ static constexpr auto query(P&& p)
noexcept(
noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
)
-> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
{
- return T::query(ASIO_MOVE_CAST(P)(p));
+ return T::query(static_cast<P&&>(p));
}
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
@@ -228,23 +198,20 @@ struct allocator_t<void>
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(allocator_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = allocator_t::static_query<E>();
+ static constexpr const T static_query_v = allocator_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename OtherProtoAllocator>
- ASIO_CONSTEXPR allocator_t<OtherProtoAllocator> operator()(
+ constexpr allocator_t<OtherProtoAllocator> operator()(
const OtherProtoAllocator& a) const
{
return allocator_t<OtherProtoAllocator>(a);
@@ -258,41 +225,15 @@ const T allocator_t<void>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr allocator_t<void> allocator;
-#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-template <typename T>
-struct allocator_instance
-{
- static allocator_t<T> instance;
-};
-
-template <typename T>
-allocator_t<T> allocator_instance<T>::instance;
-
-namespace {
-static const allocator_t<void>& allocator = allocator_instance<void>::instance;
-} // namespace
-#endif
} // namespace execution
#if !defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T, typename ProtoAllocator>
-struct is_applicable_property<T, execution::allocator_t<ProtoAllocator> >
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+struct is_applicable_property<T, execution::allocator_t<ProtoAllocator>>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
@@ -305,18 +246,18 @@ namespace traits {
template <typename T, typename ProtoAllocator>
struct static_query<T, execution::allocator_t<ProtoAllocator>,
- typename enable_if<
+ enable_if_t<
execution::allocator_t<ProtoAllocator>::template
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::allocator_t<ProtoAllocator>::template
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::allocator_t<ProtoAllocator>::template
query_static_constexpr_member<T>::value();
diff --git a/3rdparty/asio/include/asio/execution/any_executor.hpp b/3rdparty/asio/include/asio/execution/any_executor.hpp
index b5f5233fdfb..a057543b139 100644
--- a/3rdparty/asio/include/asio/execution/any_executor.hpp
+++ b/3rdparty/asio/include/asio/execution/any_executor.hpp
@@ -2,7 +2,7 @@
// execution/any_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,6 +19,7 @@
#include <new>
#include <typeinfo>
#include "asio/detail/assert.hpp"
+#include "asio/detail/atomic_count.hpp"
#include "asio/detail/cstddef.hpp"
#include "asio/detail/executor_function.hpp"
#include "asio/detail/memory.hpp"
@@ -26,10 +27,8 @@
#include "asio/detail/scoped_ptr.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/detail/throw_exception.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/execution/bad_executor.hpp"
#include "asio/execution/blocking.hpp"
-#include "asio/execution/execute.hpp"
#include "asio/execution/executor.hpp"
#include "asio/prefer.hpp"
#include "asio/query.hpp"
@@ -64,10 +63,25 @@ public:
template <class... OtherSupportableProperties>
any_executor(any_executor<OtherSupportableProperties...> e);
+ /// Construct to point to the same target as another any_executor.
+ template <class... OtherSupportableProperties>
+ any_executor(std::nothrow_t,
+ any_executor<OtherSupportableProperties...> e) noexcept;
+
+ /// Construct to point to the same target as another any_executor.
+ any_executor(std::nothrow_t, const any_executor& e) noexcept;
+
+ /// Construct to point to the same target as another any_executor.
+ any_executor(std::nothrow_t, any_executor&& e) noexcept;
+
/// Construct a polymorphic wrapper for the specified executor.
template <typename Executor>
any_executor(Executor e);
+ /// Construct a polymorphic wrapper for the specified executor.
+ template <typename Executor>
+ any_executor(std::nothrow_t, Executor e) noexcept;
+
/// Assignment operator.
any_executor& operator=(const any_executor& e) noexcept;
@@ -126,13 +140,6 @@ public:
/// Execute the function on the target executor.
/**
- * Do not call this function directly. It is intended for use with the
- * execution::execute customisation point.
- *
- * For example:
- * @code execution::any_executor<> ex = ...;
- * execution::execute(ex, my_function_object); @endcode
- *
* Throws asio::bad_executor if the polymorphic wrapper has no target.
*/
template <typename Function>
@@ -220,20 +227,9 @@ namespace execution {
#if !defined(ASIO_EXECUTION_ANY_EXECUTOR_FWD_DECL)
#define ASIO_EXECUTION_ANY_EXECUTOR_FWD_DECL
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... SupportableProperties>
class any_executor;
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename = void, typename = void, typename = void,
- typename = void, typename = void, typename = void,
- typename = void, typename = void, typename = void>
-class any_executor;
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#endif // !defined(ASIO_EXECUTION_ANY_EXECUTOR_FWD_DECL)
template <typename U>
@@ -249,15 +245,13 @@ template <typename T, typename = void>
struct is_requirable : false_type {};
template <typename T>
-struct is_requirable<T, typename enable_if<T::is_requirable>::type> :
- true_type {};
+struct is_requirable<T, enable_if_t<T::is_requirable>> : true_type {};
template <typename T, typename = void>
struct is_preferable : false_type {};
template <typename T>
-struct is_preferable<T, typename enable_if<T::is_preferable>::type> :
- true_type {};
+struct is_preferable<T, enable_if_t<T::is_preferable>> : true_type {};
// Trait used to detect context_as property, for backward compatibility.
@@ -265,7 +259,7 @@ template <typename T>
struct is_context_as : false_type {};
template <typename U>
-struct is_context_as<context_as_t<U> > : true_type {};
+struct is_context_as<context_as_t<U>> : true_type {};
// Helper template to:
// - Check if a target can supply the supportable properties.
@@ -302,53 +296,51 @@ struct supportable_properties<I, void(Prop)>
struct found
{
- ASIO_STATIC_CONSTEXPR(bool, value = true);
+ static constexpr bool value = true;
typedef Prop type;
typedef typename Prop::polymorphic_query_result_type query_result_type;
- ASIO_STATIC_CONSTEXPR(std::size_t, index = I);
+ static constexpr std::size_t index = I;
};
struct not_found
{
- ASIO_STATIC_CONSTEXPR(bool, value = false);
+ static constexpr bool value = false;
};
template <typename T>
struct find_convertible_property :
- conditional<
+ conditional_t<
is_same<T, Prop>::value || is_convertible<T, Prop>::value,
found,
not_found
- >::type {};
+ > {};
template <typename T>
struct find_convertible_requirable_property :
- conditional<
+ conditional_t<
is_requirable<Prop>::value
&& (is_same<T, Prop>::value || is_convertible<T, Prop>::value),
found,
not_found
- >::type {};
+ > {};
template <typename T>
struct find_convertible_preferable_property :
- conditional<
+ conditional_t<
is_preferable<Prop>::value
&& (is_same<T, Prop>::value || is_convertible<T, Prop>::value),
found,
not_found
- >::type {};
+ > {};
struct find_context_as_property :
- conditional<
+ conditional_t<
is_context_as<Prop>::value,
found,
not_found
- >::type {};
+ > {};
};
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <std::size_t I, typename Head, typename... Tail>
struct supportable_properties<I, void(Head, Tail...)>
{
@@ -367,127 +359,136 @@ struct supportable_properties<I, void(Head, Tail...)>
template <typename T>
struct find_convertible_property :
- conditional<
+ conditional_t<
is_convertible<T, Head>::value,
typename supportable_properties<I, void(Head)>::found,
typename supportable_properties<I + 1,
void(Tail...)>::template find_convertible_property<T>
- >::type {};
+ > {};
template <typename T>
struct find_convertible_requirable_property :
- conditional<
+ conditional_t<
is_requirable<Head>::value
&& is_convertible<T, Head>::value,
typename supportable_properties<I, void(Head)>::found,
typename supportable_properties<I + 1,
void(Tail...)>::template find_convertible_requirable_property<T>
- >::type {};
+ > {};
template <typename T>
struct find_convertible_preferable_property :
- conditional<
+ conditional_t<
is_preferable<Head>::value
&& is_convertible<T, Head>::value,
typename supportable_properties<I, void(Head)>::found,
typename supportable_properties<I + 1,
void(Tail...)>::template find_convertible_preferable_property<T>
- >::type {};
+ > {};
struct find_context_as_property :
- conditional<
+ conditional_t<
is_context_as<Head>::value,
typename supportable_properties<I, void(Head)>::found,
typename supportable_properties<I + 1,
void(Tail...)>::find_context_as_property
- >::type {};
+ > {};
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROPS_BASE_DEF(n) \
- template <std::size_t I, \
- typename Head, ASIO_VARIADIC_TPARAMS(n)> \
- struct supportable_properties<I, \
- void(Head, ASIO_VARIADIC_TARGS(n))> \
- { \
- template <typename T> \
- struct is_valid_target : integral_constant<bool, \
- ( \
- supportable_properties<I, \
- void(Head)>::template is_valid_target<T>::value \
- && \
- supportable_properties<I + 1, \
- void(ASIO_VARIADIC_TARGS(n))>::template \
- is_valid_target<T>::value \
- ) \
- > \
- { \
- }; \
- \
- template <typename T> \
- struct find_convertible_property : \
- conditional< \
- is_convertible<T, Head>::value, \
- typename supportable_properties<I, void(Head)>::found, \
- typename supportable_properties<I + 1, \
- void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_property<T> \
- >::type {}; \
- \
- template <typename T> \
- struct find_convertible_requirable_property : \
- conditional< \
- is_requirable<Head>::value \
- && is_convertible<T, Head>::value, \
- typename supportable_properties<I, void(Head)>::found, \
- typename supportable_properties<I + 1, \
- void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_requirable_property<T> \
- >::type {}; \
- \
- template <typename T> \
- struct find_convertible_preferable_property : \
- conditional< \
- is_preferable<Head>::value \
- && is_convertible<T, Head>::value, \
- typename supportable_properties<I, void(Head)>::found, \
- typename supportable_properties<I + 1, \
- void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_preferable_property<T> \
- >::type {}; \
- \
- struct find_context_as_property : \
- conditional< \
- is_context_as<Head>::value, \
- typename supportable_properties<I, void(Head)>::found, \
- typename supportable_properties<I + 1, void( \
- ASIO_VARIADIC_TARGS(n))>::find_context_as_property \
- >::type {}; \
- }; \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ANY_EXECUTOR_PROPS_BASE_DEF)
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROPS_BASE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename T, typename Props>
struct is_valid_target_executor :
- conditional<
+ conditional_t<
is_executor<T>::value,
typename supportable_properties<0, Props>::template is_valid_target<T>,
false_type
- >::type
+ >
+{
+};
+
+template <typename Props>
+struct is_valid_target_executor<int, Props> : false_type
+{
+};
+
+class shared_target_executor
{
+public:
+ template <typename E>
+ shared_target_executor(E&& e, decay_t<E>*& target)
+ {
+ impl<decay_t<E>>* i =
+ new impl<decay_t<E>>(static_cast<E&&>(e));
+ target = &i->ex_;
+ impl_ = i;
+ }
+
+ template <typename E>
+ shared_target_executor(std::nothrow_t, E&& e, decay_t<E>*& target) noexcept
+ {
+ impl<decay_t<E>>* i =
+ new (std::nothrow) impl<decay_t<E>>(static_cast<E&&>(e));
+ target = i ? &i->ex_ : 0;
+ impl_ = i;
+ }
+
+ shared_target_executor(const shared_target_executor& other) noexcept
+ : impl_(other.impl_)
+ {
+ if (impl_)
+ asio::detail::ref_count_up(impl_->ref_count_);
+ }
+
+ shared_target_executor(shared_target_executor&& other) noexcept
+ : impl_(other.impl_)
+ {
+ other.impl_ = 0;
+ }
+
+ ~shared_target_executor()
+ {
+ if (impl_)
+ if (asio::detail::ref_count_down(impl_->ref_count_))
+ delete impl_;
+ }
+
+ void* get() const noexcept
+ {
+ return impl_ ? impl_->get() : 0;
+ }
+
+private:
+ shared_target_executor& operator=(
+ const shared_target_executor& other) = delete;
+
+ shared_target_executor& operator=(
+ shared_target_executor&& other) = delete;
+
+ struct impl_base
+ {
+ impl_base() : ref_count_(1) {}
+ virtual ~impl_base() {}
+ virtual void* get() = 0;
+ asio::detail::atomic_count ref_count_;
+ };
+
+ template <typename Executor>
+ struct impl : impl_base
+ {
+ impl(Executor ex) : ex_(static_cast<Executor&&>(ex)) {}
+ virtual void* get() { return &ex_; }
+ Executor ex_;
+ };
+
+ impl_base* impl_;
};
class any_executor_base
{
public:
- any_executor_base() ASIO_NOEXCEPT
- : object_fns_(object_fns_table<void>()),
+ any_executor_base() noexcept
+ : object_fns_(0),
target_(0),
- target_fns_(target_fns_table<void>())
+ target_fns_(0)
{
}
@@ -506,144 +507,231 @@ public:
}
template <ASIO_EXECUTION_EXECUTOR Executor>
+ any_executor_base(std::nothrow_t, Executor ex, false_type) noexcept
+ : target_fns_(target_fns_table<Executor>(
+ any_executor_base::query_blocking(ex,
+ can_query<const Executor&, const execution::blocking_t&>())
+ == execution::blocking.always))
+ {
+ any_executor_base::construct_object(std::nothrow, ex,
+ integral_constant<bool,
+ sizeof(Executor) <= sizeof(object_type)
+ && alignment_of<Executor>::value <= alignment_of<object_type>::value
+ >());
+ if (target_ == 0)
+ {
+ object_fns_ = 0;
+ target_fns_ = 0;
+ }
+ }
+
+ template <ASIO_EXECUTION_EXECUTOR Executor>
any_executor_base(Executor other, true_type)
- : object_fns_(object_fns_table<asio::detail::shared_ptr<void> >()),
+ : object_fns_(object_fns_table<shared_target_executor>()),
target_fns_(other.target_fns_)
{
- asio::detail::shared_ptr<Executor> p =
- asio::detail::make_shared<Executor>(
- ASIO_MOVE_CAST(Executor)(other));
+ Executor* p = 0;
+ new (&object_) shared_target_executor(
+ static_cast<Executor&&>(other), p);
target_ = p->template target<void>();
- new (&object_) asio::detail::shared_ptr<void>(
- ASIO_MOVE_CAST(asio::detail::shared_ptr<Executor>)(p));
}
- any_executor_base(const any_executor_base& other) ASIO_NOEXCEPT
- : object_fns_(other.object_fns_),
+ template <ASIO_EXECUTION_EXECUTOR Executor>
+ any_executor_base(std::nothrow_t,
+ Executor other, true_type) noexcept
+ : object_fns_(object_fns_table<shared_target_executor>()),
target_fns_(other.target_fns_)
{
- object_fns_->copy(*this, other);
+ Executor* p = 0;
+ new (&object_) shared_target_executor(
+ std::nothrow, static_cast<Executor&&>(other), p);
+ if (p)
+ target_ = p->template target<void>();
+ else
+ {
+ target_ = 0;
+ object_fns_ = 0;
+ target_fns_ = 0;
+ }
}
- ~any_executor_base() ASIO_NOEXCEPT
+ any_executor_base(const any_executor_base& other) noexcept
{
- object_fns_->destroy(*this);
+ if (!!other)
+ {
+ object_fns_ = other.object_fns_;
+ target_fns_ = other.target_fns_;
+ object_fns_->copy(*this, other);
+ }
+ else
+ {
+ object_fns_ = 0;
+ target_ = 0;
+ target_fns_ = 0;
+ }
+ }
+
+ ~any_executor_base() noexcept
+ {
+ if (!!*this)
+ object_fns_->destroy(*this);
}
any_executor_base& operator=(
- const any_executor_base& other) ASIO_NOEXCEPT
+ const any_executor_base& other) noexcept
{
if (this != &other)
{
- object_fns_->destroy(*this);
- object_fns_ = other.object_fns_;
- target_fns_ = other.target_fns_;
- object_fns_->copy(*this, other);
+ if (!!*this)
+ object_fns_->destroy(*this);
+ if (!!other)
+ {
+ object_fns_ = other.object_fns_;
+ target_fns_ = other.target_fns_;
+ object_fns_->copy(*this, other);
+ }
+ else
+ {
+ object_fns_ = 0;
+ target_ = 0;
+ target_fns_ = 0;
+ }
}
return *this;
}
- any_executor_base& operator=(nullptr_t) ASIO_NOEXCEPT
+ any_executor_base& operator=(nullptr_t) noexcept
{
- object_fns_->destroy(*this);
+ if (target_)
+ object_fns_->destroy(*this);
target_ = 0;
- object_fns_ = object_fns_table<void>();
- target_fns_ = target_fns_table<void>();
+ object_fns_ = 0;
+ target_fns_ = 0;
return *this;
}
-#if defined(ASIO_HAS_MOVE)
-
- any_executor_base(any_executor_base&& other) ASIO_NOEXCEPT
- : object_fns_(other.object_fns_),
- target_fns_(other.target_fns_)
+ any_executor_base(any_executor_base&& other) noexcept
{
- other.object_fns_ = object_fns_table<void>();
- other.target_fns_ = target_fns_table<void>();
- object_fns_->move(*this, other);
- other.target_ = 0;
+ if (other.target_)
+ {
+ object_fns_ = other.object_fns_;
+ target_fns_ = other.target_fns_;
+ other.object_fns_ = 0;
+ other.target_fns_ = 0;
+ object_fns_->move(*this, other);
+ other.target_ = 0;
+ }
+ else
+ {
+ object_fns_ = 0;
+ target_ = 0;
+ target_fns_ = 0;
+ }
}
any_executor_base& operator=(
- any_executor_base&& other) ASIO_NOEXCEPT
+ any_executor_base&& other) noexcept
{
if (this != &other)
{
- object_fns_->destroy(*this);
- object_fns_ = other.object_fns_;
- other.object_fns_ = object_fns_table<void>();
- target_fns_ = other.target_fns_;
- other.target_fns_ = target_fns_table<void>();
- object_fns_->move(*this, other);
- other.target_ = 0;
+ if (!!*this)
+ object_fns_->destroy(*this);
+ if (!!other)
+ {
+ object_fns_ = other.object_fns_;
+ target_fns_ = other.target_fns_;
+ other.object_fns_ = 0;
+ other.target_fns_ = 0;
+ object_fns_->move(*this, other);
+ other.target_ = 0;
+ }
+ else
+ {
+ object_fns_ = 0;
+ target_ = 0;
+ target_fns_ = 0;
+ }
}
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
-
- void swap(any_executor_base& other) ASIO_NOEXCEPT
+ void swap(any_executor_base& other) noexcept
{
if (this != &other)
{
- any_executor_base tmp(ASIO_MOVE_CAST(any_executor_base)(other));
- other = ASIO_MOVE_CAST(any_executor_base)(*this);
- *this = ASIO_MOVE_CAST(any_executor_base)(tmp);
+ any_executor_base tmp(static_cast<any_executor_base&&>(other));
+ other = static_cast<any_executor_base&&>(*this);
+ *this = static_cast<any_executor_base&&>(tmp);
}
}
template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const
+ void execute(F&& f) const
{
- if (target_fns_->blocking_execute != 0)
+ if (target_)
{
- asio::detail::non_const_lvalue<F> f2(f);
- target_fns_->blocking_execute(*this, function_view(f2.value));
+ if (target_fns_->blocking_execute != 0)
+ {
+ asio::detail::non_const_lvalue<F> f2(f);
+ target_fns_->blocking_execute(*this, function_view(f2.value));
+ }
+ else
+ {
+ target_fns_->execute(*this,
+ function(static_cast<F&&>(f), std::allocator<void>()));
+ }
}
else
{
- target_fns_->execute(*this,
- function(ASIO_MOVE_CAST(F)(f), std::allocator<void>()));
+ bad_executor ex;
+ asio::detail::throw_exception(ex);
}
}
template <typename Executor>
Executor* target()
{
- return static_cast<Executor*>(target_);
+ return target_ && (is_same<Executor, void>::value
+ || target_fns_->target_type() == target_type_ex<Executor>())
+ ? static_cast<Executor*>(target_) : 0;
}
template <typename Executor>
const Executor* target() const
{
- return static_cast<Executor*>(target_);
+ return target_ && (is_same<Executor, void>::value
+ || target_fns_->target_type() == target_type_ex<Executor>())
+ ? static_cast<const Executor*>(target_) : 0;
}
#if !defined(ASIO_NO_TYPEID)
const std::type_info& target_type() const
+ {
+ return target_ ? target_fns_->target_type() : typeid(void);
+ }
#else // !defined(ASIO_NO_TYPEID)
const void* target_type() const
-#endif // !defined(ASIO_NO_TYPEID)
{
- return target_fns_->target_type();
+ return target_ ? target_fns_->target_type() : 0;
}
+#endif // !defined(ASIO_NO_TYPEID)
struct unspecified_bool_type_t {};
typedef void (*unspecified_bool_type)(unspecified_bool_type_t);
static void unspecified_bool_true(unspecified_bool_type_t) {}
- operator unspecified_bool_type() const ASIO_NOEXCEPT
+ operator unspecified_bool_type() const noexcept
{
return target_ ? &any_executor_base::unspecified_bool_true : 0;
}
- bool operator!() const ASIO_NOEXCEPT
+ bool operator!() const noexcept
{
return target_ == 0;
}
protected:
- bool equality_helper(const any_executor_base& other) const ASIO_NOEXCEPT
+ bool equality_helper(const any_executor_base& other) const noexcept
{
if (target_ == other.target_)
return true;
@@ -676,73 +764,38 @@ protected:
const void* (*target)(const any_executor_base&);
};
- static void destroy_void(any_executor_base&)
- {
- }
-
- static void copy_void(any_executor_base& ex1, const any_executor_base&)
- {
- ex1.target_ = 0;
- }
-
- static void move_void(any_executor_base& ex1, any_executor_base&)
- {
- ex1.target_ = 0;
- }
-
- static const void* target_void(const any_executor_base&)
- {
- return 0;
- }
-
- template <typename Obj>
- static const object_fns* object_fns_table(
- typename enable_if<
- is_same<Obj, void>::value
- >::type* = 0)
- {
- static const object_fns fns =
- {
- &any_executor_base::destroy_void,
- &any_executor_base::copy_void,
- &any_executor_base::move_void,
- &any_executor_base::target_void
- };
- return &fns;
- }
-
static void destroy_shared(any_executor_base& ex)
{
- typedef asio::detail::shared_ptr<void> type;
+ typedef shared_target_executor type;
ex.object<type>().~type();
}
static void copy_shared(any_executor_base& ex1, const any_executor_base& ex2)
{
- typedef asio::detail::shared_ptr<void> type;
+ typedef shared_target_executor type;
new (&ex1.object_) type(ex2.object<type>());
ex1.target_ = ex2.target_;
}
static void move_shared(any_executor_base& ex1, any_executor_base& ex2)
{
- typedef asio::detail::shared_ptr<void> type;
- new (&ex1.object_) type(ASIO_MOVE_CAST(type)(ex2.object<type>()));
+ typedef shared_target_executor type;
+ new (&ex1.object_) type(static_cast<type&&>(ex2.object<type>()));
ex1.target_ = ex2.target_;
ex2.object<type>().~type();
}
static const void* target_shared(const any_executor_base& ex)
{
- typedef asio::detail::shared_ptr<void> type;
+ typedef shared_target_executor type;
return ex.object<type>().get();
}
template <typename Obj>
static const object_fns* object_fns_table(
- typename enable_if<
- is_same<Obj, asio::detail::shared_ptr<void> >::value
- >::type* = 0)
+ enable_if_t<
+ is_same<Obj, shared_target_executor>::value
+ >* = 0)
{
static const object_fns fns =
{
@@ -770,7 +823,7 @@ protected:
template <typename Obj>
static void move_object(any_executor_base& ex1, any_executor_base& ex2)
{
- new (&ex1.object_) Obj(ASIO_MOVE_CAST(Obj)(ex2.object<Obj>()));
+ new (&ex1.object_) Obj(static_cast<Obj&&>(ex2.object<Obj>()));
ex1.target_ = &ex1.object<Obj>();
ex2.object<Obj>().~Obj();
}
@@ -783,10 +836,10 @@ protected:
template <typename Obj>
static const object_fns* object_fns_table(
- typename enable_if<
+ enable_if_t<
!is_same<Obj, void>::value
- && !is_same<Obj, asio::detail::shared_ptr<void> >::value
- >::type* = 0)
+ && !is_same<Obj, shared_target_executor>::value
+ >* = 0)
{
static const object_fns fns =
{
@@ -809,57 +862,11 @@ protected:
const void* (*target_type)();
#endif // !defined(ASIO_NO_TYPEID)
bool (*equal)(const any_executor_base&, const any_executor_base&);
- void (*execute)(const any_executor_base&, ASIO_MOVE_ARG(function));
+ void (*execute)(const any_executor_base&, function&&);
void (*blocking_execute)(const any_executor_base&, function_view);
};
#if !defined(ASIO_NO_TYPEID)
- static const std::type_info& target_type_void()
- {
- return typeid(void);
- }
-#else // !defined(ASIO_NO_TYPEID)
- static const void* target_type_void()
- {
- return 0;
- }
-#endif // !defined(ASIO_NO_TYPEID)
-
- static bool equal_void(const any_executor_base&, const any_executor_base&)
- {
- return true;
- }
-
- static void execute_void(const any_executor_base&,
- ASIO_MOVE_ARG(function))
- {
- bad_executor ex;
- asio::detail::throw_exception(ex);
- }
-
- static void blocking_execute_void(const any_executor_base&, function_view)
- {
- bad_executor ex;
- asio::detail::throw_exception(ex);
- }
-
- template <typename Ex>
- static const target_fns* target_fns_table(
- typename enable_if<
- is_same<Ex, void>::value
- >::type* = 0)
- {
- static const target_fns fns =
- {
- &any_executor_base::target_type_void,
- &any_executor_base::equal_void,
- &any_executor_base::execute_void,
- &any_executor_base::blocking_execute_void
- };
- return &fns;
- }
-
-#if !defined(ASIO_NO_TYPEID)
template <typename Ex>
static const std::type_info& target_type_ex()
{
@@ -878,27 +885,33 @@ protected:
static bool equal_ex(const any_executor_base& ex1,
const any_executor_base& ex2)
{
- return *ex1.target<Ex>() == *ex2.target<Ex>();
+ const Ex* p1 = ex1.target<Ex>();
+ const Ex* p2 = ex2.target<Ex>();
+ ASIO_ASSUME(p1 != 0 && p2 != 0);
+ return *p1 == *p2;
}
template <typename Ex>
- static void execute_ex(const any_executor_base& ex,
- ASIO_MOVE_ARG(function) f)
+ static void execute_ex(const any_executor_base& ex, function&& f)
{
- execution::execute(*ex.target<Ex>(), ASIO_MOVE_CAST(function)(f));
+ const Ex* p = ex.target<Ex>();
+ ASIO_ASSUME(p != 0);
+ p->execute(static_cast<function&&>(f));
}
template <typename Ex>
static void blocking_execute_ex(const any_executor_base& ex, function_view f)
{
- execution::execute(*ex.target<Ex>(), f);
+ const Ex* p = ex.target<Ex>();
+ ASIO_ASSUME(p != 0);
+ p->execute(f);
}
template <typename Ex>
static const target_fns* target_fns_table(bool is_always_blocking,
- typename enable_if<
+ enable_if_t<
!is_same<Ex, void>::value
- >::type* = 0)
+ >* = 0)
{
static const target_fns fns_with_execute =
{
@@ -932,10 +945,10 @@ protected:
template <typename Ex, class Prop>
static void query_fn_non_void(void*, const void* ex, const void* prop,
- typename enable_if<
+ enable_if_t<
asio::can_query<const Ex&, const Prop&>::value
&& is_same<typename Prop::polymorphic_query_result_type, void>::value
- >::type*)
+ >*)
{
asio::query(*static_cast<const Ex*>(ex),
*static_cast<const Prop*>(prop));
@@ -943,23 +956,23 @@ protected:
template <typename Ex, class Prop>
static void query_fn_non_void(void*, const void*, const void*,
- typename enable_if<
+ enable_if_t<
!asio::can_query<const Ex&, const Prop&>::value
&& is_same<typename Prop::polymorphic_query_result_type, void>::value
- >::type*)
+ >*)
{
}
template <typename Ex, class Prop>
static void query_fn_non_void(void* result, const void* ex, const void* prop,
- typename enable_if<
+ enable_if_t<
asio::can_query<const Ex&, const Prop&>::value
&& !is_same<typename Prop::polymorphic_query_result_type, void>::value
&& is_reference<typename Prop::polymorphic_query_result_type>::value
- >::type*)
+ >*)
{
- *static_cast<typename remove_reference<
- typename Prop::polymorphic_query_result_type>::type**>(result)
+ *static_cast<remove_reference_t<
+ typename Prop::polymorphic_query_result_type>**>(result)
= &static_cast<typename Prop::polymorphic_query_result_type>(
asio::query(*static_cast<const Ex*>(ex),
*static_cast<const Prop*>(prop)));
@@ -967,22 +980,22 @@ protected:
template <typename Ex, class Prop>
static void query_fn_non_void(void*, const void*, const void*,
- typename enable_if<
+ enable_if_t<
!asio::can_query<const Ex&, const Prop&>::value
&& !is_same<typename Prop::polymorphic_query_result_type, void>::value
&& is_reference<typename Prop::polymorphic_query_result_type>::value
- >::type*)
+ >*)
{
std::terminate(); // Combination should not be possible.
}
template <typename Ex, class Prop>
static void query_fn_non_void(void* result, const void* ex, const void* prop,
- typename enable_if<
+ enable_if_t<
asio::can_query<const Ex&, const Prop&>::value
&& !is_same<typename Prop::polymorphic_query_result_type, void>::value
&& is_scalar<typename Prop::polymorphic_query_result_type>::value
- >::type*)
+ >*)
{
*static_cast<typename Prop::polymorphic_query_result_type*>(result)
= static_cast<typename Prop::polymorphic_query_result_type>(
@@ -992,11 +1005,11 @@ protected:
template <typename Ex, class Prop>
static void query_fn_non_void(void* result, const void*, const void*,
- typename enable_if<
+ enable_if_t<
!asio::can_query<const Ex&, const Prop&>::value
&& !is_same<typename Prop::polymorphic_query_result_type, void>::value
&& is_scalar<typename Prop::polymorphic_query_result_type>::value
- >::type*)
+ >*)
{
*static_cast<typename Prop::polymorphic_query_result_type*>(result)
= typename Prop::polymorphic_query_result_type();
@@ -1004,12 +1017,12 @@ protected:
template <typename Ex, class Prop>
static void query_fn_non_void(void* result, const void* ex, const void* prop,
- typename enable_if<
+ enable_if_t<
asio::can_query<const Ex&, const Prop&>::value
&& !is_same<typename Prop::polymorphic_query_result_type, void>::value
&& !is_reference<typename Prop::polymorphic_query_result_type>::value
&& !is_scalar<typename Prop::polymorphic_query_result_type>::value
- >::type*)
+ >*)
{
*static_cast<typename Prop::polymorphic_query_result_type**>(result)
= new typename Prop::polymorphic_query_result_type(
@@ -1026,18 +1039,18 @@ protected:
template <typename Ex, class Prop>
static void query_fn_impl(void* result, const void* ex, const void* prop,
- typename enable_if<
+ enable_if_t<
is_same<Ex, void>::value
- >::type*)
+ >*)
{
query_fn_void(result, ex, prop);
}
template <typename Ex, class Prop>
static void query_fn_impl(void* result, const void* ex, const void* prop,
- typename enable_if<
+ enable_if_t<
!is_same<Ex, void>::value
- >::type*)
+ >*)
{
query_fn_non_void<Ex, Prop>(result, ex, prop, 0);
}
@@ -1050,9 +1063,9 @@ protected:
template <typename Poly, typename Ex, class Prop>
static Poly require_fn_impl(const void*, const void*,
- typename enable_if<
+ enable_if_t<
is_same<Ex, void>::value
- >::type*)
+ >*)
{
bad_executor ex;
asio::detail::throw_exception(ex);
@@ -1061,9 +1074,9 @@ protected:
template <typename Poly, typename Ex, class Prop>
static Poly require_fn_impl(const void* ex, const void* prop,
- typename enable_if<
+ enable_if_t<
!is_same<Ex, void>::value && Prop::is_requirable
- >::type*)
+ >*)
{
return asio::require(*static_cast<const Ex*>(ex),
*static_cast<const Prop*>(prop));
@@ -1083,9 +1096,9 @@ protected:
template <typename Poly, typename Ex, class Prop>
static Poly prefer_fn_impl(const void*, const void*,
- typename enable_if<
+ enable_if_t<
is_same<Ex, void>::value
- >::type*)
+ >*)
{
bad_executor ex;
asio::detail::throw_exception(ex);
@@ -1094,9 +1107,9 @@ protected:
template <typename Poly, typename Ex, class Prop>
static Poly prefer_fn_impl(const void* ex, const void* prop,
- typename enable_if<
+ enable_if_t<
!is_same<Ex, void>::value && Prop::is_preferable
- >::type*)
+ >*)
{
return asio::prefer(*static_cast<const Ex*>(ex),
*static_cast<const Prop*>(prop));
@@ -1143,27 +1156,44 @@ private:
void construct_object(Executor& ex, true_type)
{
object_fns_ = object_fns_table<Executor>();
- target_ = new (&object_) Executor(ASIO_MOVE_CAST(Executor)(ex));
+ target_ = new (&object_) Executor(static_cast<Executor&&>(ex));
}
template <typename Executor>
void construct_object(Executor& ex, false_type)
{
- object_fns_ = object_fns_table<asio::detail::shared_ptr<void> >();
- asio::detail::shared_ptr<Executor> p =
- asio::detail::make_shared<Executor>(
- ASIO_MOVE_CAST(Executor)(ex));
- target_ = p.get();
- new (&object_) asio::detail::shared_ptr<void>(
- ASIO_MOVE_CAST(asio::detail::shared_ptr<Executor>)(p));
+ object_fns_ = object_fns_table<shared_target_executor>();
+ Executor* p = 0;
+ new (&object_) shared_target_executor(
+ static_cast<Executor&&>(ex), p);
+ target_ = p;
+ }
+
+ template <typename Executor>
+ void construct_object(std::nothrow_t,
+ Executor& ex, true_type) noexcept
+ {
+ object_fns_ = object_fns_table<Executor>();
+ target_ = new (&object_) Executor(static_cast<Executor&&>(ex));
+ }
+
+ template <typename Executor>
+ void construct_object(std::nothrow_t,
+ Executor& ex, false_type) noexcept
+ {
+ object_fns_ = object_fns_table<shared_target_executor>();
+ Executor* p = 0;
+ new (&object_) shared_target_executor(
+ std::nothrow, static_cast<Executor&&>(ex), p);
+ target_ = p;
}
/*private:*/public:
// template <typename...> friend class any_executor;
typedef aligned_storage<
- sizeof(asio::detail::shared_ptr<void>),
- alignment_of<asio::detail::shared_ptr<void> >::value
+ sizeof(asio::detail::shared_ptr<void>) + sizeof(void*),
+ alignment_of<asio::detail::shared_ptr<void>>::value
>::type object_type;
object_type object_;
@@ -1180,8 +1210,7 @@ struct any_executor_context
#if !defined(ASIO_NO_TS_EXECUTORS)
template <typename Derived, typename Property>
-struct any_executor_context<Derived, Property,
- typename enable_if<Property::value>::type>
+struct any_executor_context<Derived, Property, enable_if_t<Property::value>>
{
typename Property::query_result_type context() const
{
@@ -1197,32 +1226,45 @@ template <>
class any_executor<> : public detail::any_executor_base
{
public:
- any_executor() ASIO_NOEXCEPT
+ any_executor() noexcept
: detail::any_executor_base()
{
}
- any_executor(nullptr_t) ASIO_NOEXCEPT
+ any_executor(nullptr_t) noexcept
: detail::any_executor_base()
{
}
template <typename Executor>
any_executor(Executor ex,
- typename enable_if<
- conditional<
+ enable_if_t<
+ conditional_t<
!is_same<Executor, any_executor>::value
&& !is_base_of<detail::any_executor_base, Executor>::value,
is_executor<Executor>,
false_type
- >::type::value
- >::type* = 0)
+ >::value
+ >* = 0)
: detail::any_executor_base(
- ASIO_MOVE_CAST(Executor)(ex), false_type())
+ static_cast<Executor&&>(ex), false_type())
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
+ template <typename Executor>
+ any_executor(std::nothrow_t, Executor ex,
+ enable_if_t<
+ conditional_t<
+ !is_same<Executor, any_executor>::value
+ && !is_base_of<detail::any_executor_base, Executor>::value,
+ is_executor<Executor>,
+ false_type
+ >::value
+ >* = 0) noexcept
+ : detail::any_executor_base(std::nothrow,
+ static_cast<Executor&&>(ex), false_type())
+ {
+ }
template <typename... OtherSupportableProperties>
any_executor(any_executor<OtherSupportableProperties...> other)
@@ -1231,25 +1273,27 @@ public:
{
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename U0, typename U1, typename U2, typename U3,
- typename U4, typename U5, typename U6, typename U7>
- any_executor(any_executor<U0, U1, U2, U3, U4, U5, U6, U7> other)
+ template <typename... OtherSupportableProperties>
+ any_executor(std::nothrow_t,
+ any_executor<OtherSupportableProperties...> other) noexcept
: detail::any_executor_base(
static_cast<const detail::any_executor_base&>(other))
{
}
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
+ any_executor(const any_executor& other) noexcept
+ : detail::any_executor_base(
+ static_cast<const detail::any_executor_base&>(other))
+ {
+ }
- any_executor(const any_executor& other) ASIO_NOEXCEPT
+ any_executor(std::nothrow_t, const any_executor& other) noexcept
: detail::any_executor_base(
static_cast<const detail::any_executor_base&>(other))
{
}
- any_executor& operator=(const any_executor& other) ASIO_NOEXCEPT
+ any_executor& operator=(const any_executor& other) noexcept
{
if (this != &other)
{
@@ -1259,22 +1303,27 @@ public:
return *this;
}
- any_executor& operator=(nullptr_t p) ASIO_NOEXCEPT
+ any_executor& operator=(nullptr_t p) noexcept
{
detail::any_executor_base::operator=(p);
return *this;
}
-#if defined(ASIO_HAS_MOVE)
+ any_executor(any_executor&& other) noexcept
+ : detail::any_executor_base(
+ static_cast<any_executor_base&&>(
+ static_cast<any_executor_base&>(other)))
+ {
+ }
- any_executor(any_executor&& other) ASIO_NOEXCEPT
+ any_executor(std::nothrow_t, any_executor&& other) noexcept
: detail::any_executor_base(
static_cast<any_executor_base&&>(
static_cast<any_executor_base&>(other)))
{
}
- any_executor& operator=(any_executor&& other) ASIO_NOEXCEPT
+ any_executor& operator=(any_executor&& other) noexcept
{
if (this != &other)
{
@@ -1285,9 +1334,7 @@ public:
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
-
- void swap(any_executor& other) ASIO_NOEXCEPT
+ void swap(any_executor& other) noexcept
{
detail::any_executor_base::swap(
static_cast<detail::any_executor_base&>(other));
@@ -1299,77 +1346,75 @@ public:
using detail::any_executor_base::operator unspecified_bool_type;
using detail::any_executor_base::operator!;
- bool equality_helper(const any_executor& other) const ASIO_NOEXCEPT
+ bool equality_helper(const any_executor& other) const noexcept
{
return any_executor_base::equality_helper(other);
}
template <typename AnyExecutor1, typename AnyExecutor2>
- friend typename enable_if<
+ friend enable_if_t<
is_base_of<any_executor, AnyExecutor1>::value
|| is_base_of<any_executor, AnyExecutor2>::value,
bool
- >::type operator==(const AnyExecutor1& a,
- const AnyExecutor2& b) ASIO_NOEXCEPT
+ > operator==(const AnyExecutor1& a,
+ const AnyExecutor2& b) noexcept
{
return static_cast<const any_executor&>(a).equality_helper(b);
}
template <typename AnyExecutor>
- friend typename enable_if<
+ friend enable_if_t<
is_same<AnyExecutor, any_executor>::value,
bool
- >::type operator==(const AnyExecutor& a, nullptr_t) ASIO_NOEXCEPT
+ > operator==(const AnyExecutor& a, nullptr_t) noexcept
{
return !a;
}
template <typename AnyExecutor>
- friend typename enable_if<
+ friend enable_if_t<
is_same<AnyExecutor, any_executor>::value,
bool
- >::type operator==(nullptr_t, const AnyExecutor& b) ASIO_NOEXCEPT
+ > operator==(nullptr_t, const AnyExecutor& b) noexcept
{
return !b;
}
template <typename AnyExecutor1, typename AnyExecutor2>
- friend typename enable_if<
+ friend enable_if_t<
is_base_of<any_executor, AnyExecutor1>::value
|| is_base_of<any_executor, AnyExecutor2>::value,
bool
- >::type operator!=(const AnyExecutor1& a,
- const AnyExecutor2& b) ASIO_NOEXCEPT
+ > operator!=(const AnyExecutor1& a,
+ const AnyExecutor2& b) noexcept
{
return !static_cast<const any_executor&>(a).equality_helper(b);
}
template <typename AnyExecutor>
- friend typename enable_if<
+ friend enable_if_t<
is_same<AnyExecutor, any_executor>::value,
bool
- >::type operator!=(const AnyExecutor& a, nullptr_t) ASIO_NOEXCEPT
+ > operator!=(const AnyExecutor& a, nullptr_t) noexcept
{
return !!a;
}
template <typename AnyExecutor>
- friend typename enable_if<
+ friend enable_if_t<
is_same<AnyExecutor, any_executor>::value,
bool
- >::type operator!=(nullptr_t, const AnyExecutor& b) ASIO_NOEXCEPT
+ > operator!=(nullptr_t, const AnyExecutor& b) noexcept
{
return !!b;
}
};
-inline void swap(any_executor<>& a, any_executor<>& b) ASIO_NOEXCEPT
+inline void swap(any_executor<>& a, any_executor<>& b) noexcept
{
return a.swap(b);
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... SupportableProperties>
class any_executor :
public detail::any_executor_base,
@@ -1379,13 +1424,13 @@ class any_executor :
0, void(SupportableProperties...)>::find_context_as_property>
{
public:
- any_executor() ASIO_NOEXCEPT
+ any_executor() noexcept
: detail::any_executor_base(),
prop_fns_(prop_fns_table<void>())
{
}
- any_executor(nullptr_t) ASIO_NOEXCEPT
+ any_executor(nullptr_t) noexcept
: detail::any_executor_base(),
prop_fns_(prop_fns_table<void>())
{
@@ -1393,49 +1438,100 @@ public:
template <typename Executor>
any_executor(Executor ex,
- typename enable_if<
- conditional<
+ enable_if_t<
+ conditional_t<
!is_same<Executor, any_executor>::value
&& !is_base_of<detail::any_executor_base, Executor>::value,
detail::is_valid_target_executor<
Executor, void(SupportableProperties...)>,
false_type
- >::type::value
- >::type* = 0)
+ >::value
+ >* = 0)
: detail::any_executor_base(
- ASIO_MOVE_CAST(Executor)(ex), false_type()),
+ static_cast<Executor&&>(ex), false_type()),
prop_fns_(prop_fns_table<Executor>())
{
}
+ template <typename Executor>
+ any_executor(std::nothrow_t, Executor ex,
+ enable_if_t<
+ conditional_t<
+ !is_same<Executor, any_executor>::value
+ && !is_base_of<detail::any_executor_base, Executor>::value,
+ detail::is_valid_target_executor<
+ Executor, void(SupportableProperties...)>,
+ false_type
+ >::value
+ >* = 0) noexcept
+ : detail::any_executor_base(std::nothrow,
+ static_cast<Executor&&>(ex), false_type()),
+ prop_fns_(prop_fns_table<Executor>())
+ {
+ if (this->template target<void>() == 0)
+ prop_fns_ = prop_fns_table<void>();
+ }
+
template <typename... OtherSupportableProperties>
any_executor(any_executor<OtherSupportableProperties...> other,
- typename enable_if<
- conditional<
+ enable_if_t<
+ conditional_t<
!is_same<
any_executor<OtherSupportableProperties...>,
any_executor
>::value,
typename detail::supportable_properties<
0, void(SupportableProperties...)>::template is_valid_target<
- any_executor<OtherSupportableProperties...> >,
+ any_executor<OtherSupportableProperties...>>,
false_type
- >::type::value
- >::type* = 0)
- : detail::any_executor_base(ASIO_MOVE_CAST(
- any_executor<OtherSupportableProperties...>)(other), true_type()),
- prop_fns_(prop_fns_table<any_executor<OtherSupportableProperties...> >())
+ >::value
+ >* = 0)
+ : detail::any_executor_base(
+ static_cast<any_executor<OtherSupportableProperties...>&&>(other),
+ true_type()),
+ prop_fns_(prop_fns_table<any_executor<OtherSupportableProperties...>>())
{
}
- any_executor(const any_executor& other) ASIO_NOEXCEPT
+ template <typename... OtherSupportableProperties>
+ any_executor(std::nothrow_t,
+ any_executor<OtherSupportableProperties...> other,
+ enable_if_t<
+ conditional_t<
+ !is_same<
+ any_executor<OtherSupportableProperties...>,
+ any_executor
+ >::value,
+ typename detail::supportable_properties<
+ 0, void(SupportableProperties...)>::template is_valid_target<
+ any_executor<OtherSupportableProperties...>>,
+ false_type
+ >::value
+ >* = 0) noexcept
+ : detail::any_executor_base(std::nothrow,
+ static_cast<any_executor<OtherSupportableProperties...>&&>(other),
+ true_type()),
+ prop_fns_(prop_fns_table<any_executor<OtherSupportableProperties...>>())
+ {
+ if (this->template target<void>() == 0)
+ prop_fns_ = prop_fns_table<void>();
+ }
+
+ any_executor(const any_executor& other) noexcept
: detail::any_executor_base(
static_cast<const detail::any_executor_base&>(other)),
prop_fns_(other.prop_fns_)
{
}
- any_executor& operator=(const any_executor& other) ASIO_NOEXCEPT
+ any_executor(std::nothrow_t, const any_executor& other) noexcept
+ : detail::any_executor_base(
+ static_cast<const detail::any_executor_base&>(other)),
+ prop_fns_(other.prop_fns_)
+ {
+ }
+
+ any_executor& operator=(const any_executor& other) noexcept
{
if (this != &other)
{
@@ -1446,16 +1542,23 @@ public:
return *this;
}
- any_executor& operator=(nullptr_t p) ASIO_NOEXCEPT
+ any_executor& operator=(nullptr_t p) noexcept
{
prop_fns_ = prop_fns_table<void>();
detail::any_executor_base::operator=(p);
return *this;
}
-#if defined(ASIO_HAS_MOVE)
+ any_executor(any_executor&& other) noexcept
+ : detail::any_executor_base(
+ static_cast<any_executor_base&&>(
+ static_cast<any_executor_base&>(other))),
+ prop_fns_(other.prop_fns_)
+ {
+ other.prop_fns_ = prop_fns_table<void>();
+ }
- any_executor(any_executor&& other) ASIO_NOEXCEPT
+ any_executor(std::nothrow_t, any_executor&& other) noexcept
: detail::any_executor_base(
static_cast<any_executor_base&&>(
static_cast<any_executor_base&>(other))),
@@ -1464,7 +1567,7 @@ public:
other.prop_fns_ = prop_fns_table<void>();
}
- any_executor& operator=(any_executor&& other) ASIO_NOEXCEPT
+ any_executor& operator=(any_executor&& other) noexcept
{
if (this != &other)
{
@@ -1476,9 +1579,7 @@ public:
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
-
- void swap(any_executor& other) ASIO_NOEXCEPT
+ void swap(any_executor& other) noexcept
{
if (this != &other)
{
@@ -1496,65 +1597,65 @@ public:
using detail::any_executor_base::operator unspecified_bool_type;
using detail::any_executor_base::operator!;
- bool equality_helper(const any_executor& other) const ASIO_NOEXCEPT
+ bool equality_helper(const any_executor& other) const noexcept
{
return any_executor_base::equality_helper(other);
}
template <typename AnyExecutor1, typename AnyExecutor2>
- friend typename enable_if<
+ friend enable_if_t<
is_base_of<any_executor, AnyExecutor1>::value
|| is_base_of<any_executor, AnyExecutor2>::value,
bool
- >::type operator==(const AnyExecutor1& a,
- const AnyExecutor2& b) ASIO_NOEXCEPT
+ > operator==(const AnyExecutor1& a,
+ const AnyExecutor2& b) noexcept
{
return static_cast<const any_executor&>(a).equality_helper(b);
}
template <typename AnyExecutor>
- friend typename enable_if<
+ friend enable_if_t<
is_same<AnyExecutor, any_executor>::value,
bool
- >::type operator==(const AnyExecutor& a, nullptr_t) ASIO_NOEXCEPT
+ > operator==(const AnyExecutor& a, nullptr_t) noexcept
{
return !a;
}
template <typename AnyExecutor>
- friend typename enable_if<
+ friend enable_if_t<
is_same<AnyExecutor, any_executor>::value,
bool
- >::type operator==(nullptr_t, const AnyExecutor& b) ASIO_NOEXCEPT
+ > operator==(nullptr_t, const AnyExecutor& b) noexcept
{
return !b;
}
template <typename AnyExecutor1, typename AnyExecutor2>
- friend typename enable_if<
+ friend enable_if_t<
is_base_of<any_executor, AnyExecutor1>::value
|| is_base_of<any_executor, AnyExecutor2>::value,
bool
- >::type operator!=(const AnyExecutor1& a,
- const AnyExecutor2& b) ASIO_NOEXCEPT
+ > operator!=(const AnyExecutor1& a,
+ const AnyExecutor2& b) noexcept
{
return !static_cast<const any_executor&>(a).equality_helper(b);
}
template <typename AnyExecutor>
- friend typename enable_if<
+ friend enable_if_t<
is_same<AnyExecutor, any_executor>::value,
bool
- >::type operator!=(const AnyExecutor& a, nullptr_t) ASIO_NOEXCEPT
+ > operator!=(const AnyExecutor& a, nullptr_t) noexcept
{
return !!a;
}
template <typename AnyExecutor>
- friend typename enable_if<
+ friend enable_if_t<
is_same<AnyExecutor, any_executor>::value,
bool
- >::type operator!=(nullptr_t, const AnyExecutor& b) ASIO_NOEXCEPT
+ > operator!=(nullptr_t, const AnyExecutor& b) noexcept
{
return !!b;
}
@@ -1567,13 +1668,18 @@ public:
template <typename Property>
void query(const Property& p,
- typename enable_if<
+ enable_if_t<
is_same<
typename find_convertible_property<Property>::query_result_type,
void
>::value
- >::type* = 0) const
+ >* = 0) const
{
+ if (!target_)
+ {
+ bad_executor ex;
+ asio::detail::throw_exception(ex);
+ }
typedef find_convertible_property<Property> found;
prop_fns_[found::index].query(0, object_fns_->target(*this),
&static_cast<const typename found::type&>(p));
@@ -1582,7 +1688,7 @@ public:
template <typename Property>
typename find_convertible_property<Property>::query_result_type
query(const Property& p,
- typename enable_if<
+ enable_if_t<
!is_same<
typename find_convertible_property<Property>::query_result_type,
void
@@ -1591,11 +1697,15 @@ public:
is_reference<
typename find_convertible_property<Property>::query_result_type
>::value
- >::type* = 0) const
+ >* = 0) const
{
+ if (!target_)
+ {
+ bad_executor ex;
+ asio::detail::throw_exception(ex);
+ }
typedef find_convertible_property<Property> found;
- typename remove_reference<
- typename found::query_result_type>::type* result = 0;
+ remove_reference_t<typename found::query_result_type>* result = 0;
prop_fns_[found::index].query(&result, object_fns_->target(*this),
&static_cast<const typename found::type&>(p));
return *result;
@@ -1604,7 +1714,7 @@ public:
template <typename Property>
typename find_convertible_property<Property>::query_result_type
query(const Property& p,
- typename enable_if<
+ enable_if_t<
!is_same<
typename find_convertible_property<Property>::query_result_type,
void
@@ -1613,8 +1723,13 @@ public:
is_scalar<
typename find_convertible_property<Property>::query_result_type
>::value
- >::type* = 0) const
+ >* = 0) const
{
+ if (!target_)
+ {
+ bad_executor ex;
+ asio::detail::throw_exception(ex);
+ }
typedef find_convertible_property<Property> found;
typename found::query_result_type result;
prop_fns_[found::index].query(&result, object_fns_->target(*this),
@@ -1625,7 +1740,7 @@ public:
template <typename Property>
typename find_convertible_property<Property>::query_result_type
query(const Property& p,
- typename enable_if<
+ enable_if_t<
!is_same<
typename find_convertible_property<Property>::query_result_type,
void
@@ -1638,8 +1753,13 @@ public:
!is_scalar<
typename find_convertible_property<Property>::query_result_type
>::value
- >::type* = 0) const
+ >* = 0) const
{
+ if (!target_)
+ {
+ bad_executor ex;
+ asio::detail::throw_exception(ex);
+ }
typedef find_convertible_property<Property> found;
typename found::query_result_type* result;
prop_fns_[found::index].query(&result, object_fns_->target(*this),
@@ -1656,10 +1776,15 @@ public:
template <typename Property>
any_executor require(const Property& p,
- typename enable_if<
+ enable_if_t<
find_convertible_requirable_property<Property>::value
- >::type* = 0) const
+ >* = 0) const
{
+ if (!target_)
+ {
+ bad_executor ex;
+ asio::detail::throw_exception(ex);
+ }
typedef find_convertible_requirable_property<Property> found;
return prop_fns_[found::index].require(object_fns_->target(*this),
&static_cast<const typename found::type&>(p));
@@ -1673,10 +1798,15 @@ public:
template <typename Property>
any_executor prefer(const Property& p,
- typename enable_if<
+ enable_if_t<
find_convertible_preferable_property<Property>::value
- >::type* = 0) const
+ >* = 0) const
{
+ if (!target_)
+ {
+ bad_executor ex;
+ asio::detail::throw_exception(ex);
+ }
typedef find_convertible_preferable_property<Property> found;
return prop_fns_[found::index].prefer(object_fns_->target(*this),
&static_cast<const typename found::type&>(p));
@@ -1705,634 +1835,91 @@ public:
template <typename... SupportableProperties>
inline void swap(any_executor<SupportableProperties...>& a,
- any_executor<SupportableProperties...>& b) ASIO_NOEXCEPT
+ any_executor<SupportableProperties...>& b) noexcept
{
return a.swap(b);
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS(n) \
- ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_##n
-
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_1 \
- { \
- &detail::any_executor_base::query_fn<Ex, T1>, \
- &detail::any_executor_base::require_fn<any_executor, Ex, T1>, \
- &detail::any_executor_base::prefer_fn<any_executor, Ex, T1> \
- }
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_2 \
- ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_1, \
- { \
- &detail::any_executor_base::query_fn<Ex, T2>, \
- &detail::any_executor_base::require_fn<any_executor, Ex, T2>, \
- &detail::any_executor_base::prefer_fn<any_executor, Ex, T2> \
- }
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_3 \
- ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_2, \
- { \
- &detail::any_executor_base::query_fn<Ex, T3>, \
- &detail::any_executor_base::require_fn<any_executor, Ex, T3>, \
- &detail::any_executor_base::prefer_fn<any_executor, Ex, T3> \
- }
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_4 \
- ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_3, \
- { \
- &detail::any_executor_base::query_fn<Ex, T4>, \
- &detail::any_executor_base::require_fn<any_executor, Ex, T4>, \
- &detail::any_executor_base::prefer_fn<any_executor, Ex, T4> \
- }
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_5 \
- ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_4, \
- { \
- &detail::any_executor_base::query_fn<Ex, T5>, \
- &detail::any_executor_base::require_fn<any_executor, Ex, T5>, \
- &detail::any_executor_base::prefer_fn<any_executor, Ex, T5> \
- }
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_6 \
- ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_5, \
- { \
- &detail::any_executor_base::query_fn<Ex, T6>, \
- &detail::any_executor_base::require_fn<any_executor, Ex, T6>, \
- &detail::any_executor_base::prefer_fn<any_executor, Ex, T6> \
- }
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_7 \
- ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_6, \
- { \
- &detail::any_executor_base::query_fn<Ex, T7>, \
- &detail::any_executor_base::require_fn<any_executor, Ex, T7>, \
- &detail::any_executor_base::prefer_fn<any_executor, Ex, T7> \
- }
-#define ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_8 \
- ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_7, \
- { \
- &detail::any_executor_base::query_fn<Ex, T8>, \
- &detail::any_executor_base::require_fn<any_executor, Ex, T8>, \
- &detail::any_executor_base::prefer_fn<any_executor, Ex, T8> \
- }
-
-#if defined(ASIO_HAS_MOVE)
-
-# define ASIO_PRIVATE_ANY_EXECUTOR_MOVE_OPS \
- any_executor(any_executor&& other) ASIO_NOEXCEPT \
- : detail::any_executor_base( \
- static_cast<any_executor_base&&>( \
- static_cast<any_executor_base&>(other))), \
- prop_fns_(other.prop_fns_) \
- { \
- other.prop_fns_ = prop_fns_table<void>(); \
- } \
- \
- any_executor& operator=(any_executor&& other) ASIO_NOEXCEPT \
- { \
- if (this != &other) \
- { \
- prop_fns_ = other.prop_fns_; \
- detail::any_executor_base::operator=( \
- static_cast<detail::any_executor_base&&>( \
- static_cast<detail::any_executor_base&>(other))); \
- } \
- return *this; \
- } \
- /**/
-#else // defined(ASIO_HAS_MOVE)
-
-# define ASIO_PRIVATE_ANY_EXECUTOR_MOVE_OPS
-
-#endif // defined(ASIO_HAS_MOVE)
-
-#define ASIO_PRIVATE_ANY_EXECUTOR_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- class any_executor<ASIO_VARIADIC_TARGS(n)> : \
- public detail::any_executor_base, \
- public detail::any_executor_context< \
- any_executor<ASIO_VARIADIC_TARGS(n)>, \
- typename detail::supportable_properties< \
- 0, void(ASIO_VARIADIC_TARGS(n))>::find_context_as_property> \
- { \
- public: \
- any_executor() ASIO_NOEXCEPT \
- : detail::any_executor_base(), \
- prop_fns_(prop_fns_table<void>()) \
- { \
- } \
- \
- any_executor(nullptr_t) ASIO_NOEXCEPT \
- : detail::any_executor_base(), \
- prop_fns_(prop_fns_table<void>()) \
- { \
- } \
- \
- template <ASIO_EXECUTION_EXECUTOR Executor> \
- any_executor(Executor ex, \
- typename enable_if< \
- conditional< \
- !is_same<Executor, any_executor>::value \
- && !is_base_of<detail::any_executor_base, Executor>::value, \
- detail::is_valid_target_executor< \
- Executor, void(ASIO_VARIADIC_TARGS(n))>, \
- false_type \
- >::type::value \
- >::type* = 0) \
- : detail::any_executor_base(ASIO_MOVE_CAST( \
- Executor)(ex), false_type()), \
- prop_fns_(prop_fns_table<Executor>()) \
- { \
- } \
- \
- any_executor(const any_executor& other) ASIO_NOEXCEPT \
- : detail::any_executor_base( \
- static_cast<const detail::any_executor_base&>(other)), \
- prop_fns_(other.prop_fns_) \
- { \
- } \
- \
- any_executor(any_executor<> other) \
- : detail::any_executor_base(ASIO_MOVE_CAST( \
- any_executor<>)(other), true_type()), \
- prop_fns_(prop_fns_table<any_executor<> >()) \
- { \
- } \
- \
- template <typename OtherAnyExecutor> \
- any_executor(OtherAnyExecutor other, \
- typename enable_if< \
- conditional< \
- !is_same<OtherAnyExecutor, any_executor>::value \
- && is_base_of<detail::any_executor_base, \
- OtherAnyExecutor>::value, \
- typename detail::supportable_properties< \
- 0, void(ASIO_VARIADIC_TARGS(n))>::template \
- is_valid_target<OtherAnyExecutor>, \
- false_type \
- >::type::value \
- >::type* = 0) \
- : detail::any_executor_base(ASIO_MOVE_CAST( \
- OtherAnyExecutor)(other), true_type()), \
- prop_fns_(prop_fns_table<OtherAnyExecutor>()) \
- { \
- } \
- \
- any_executor& operator=(const any_executor& other) ASIO_NOEXCEPT \
- { \
- if (this != &other) \
- { \
- prop_fns_ = other.prop_fns_; \
- detail::any_executor_base::operator=( \
- static_cast<const detail::any_executor_base&>(other)); \
- } \
- return *this; \
- } \
- \
- any_executor& operator=(nullptr_t p) ASIO_NOEXCEPT \
- { \
- prop_fns_ = prop_fns_table<void>(); \
- detail::any_executor_base::operator=(p); \
- return *this; \
- } \
- \
- ASIO_PRIVATE_ANY_EXECUTOR_MOVE_OPS \
- \
- void swap(any_executor& other) ASIO_NOEXCEPT \
- { \
- if (this != &other) \
- { \
- detail::any_executor_base::swap( \
- static_cast<detail::any_executor_base&>(other)); \
- const prop_fns<any_executor>* tmp_prop_fns = other.prop_fns_; \
- other.prop_fns_ = prop_fns_; \
- prop_fns_ = tmp_prop_fns; \
- } \
- } \
- \
- using detail::any_executor_base::execute; \
- using detail::any_executor_base::target; \
- using detail::any_executor_base::target_type; \
- using detail::any_executor_base::operator unspecified_bool_type; \
- using detail::any_executor_base::operator!; \
- \
- bool equality_helper(const any_executor& other) const ASIO_NOEXCEPT \
- { \
- return any_executor_base::equality_helper(other); \
- } \
- \
- template <typename AnyExecutor1, typename AnyExecutor2> \
- friend typename enable_if< \
- is_base_of<any_executor, AnyExecutor1>::value \
- || is_base_of<any_executor, AnyExecutor2>::value, \
- bool \
- >::type operator==(const AnyExecutor1& a, \
- const AnyExecutor2& b) ASIO_NOEXCEPT \
- { \
- return static_cast<const any_executor&>(a).equality_helper(b); \
- } \
- \
- template <typename AnyExecutor> \
- friend typename enable_if< \
- is_same<AnyExecutor, any_executor>::value, \
- bool \
- >::type operator==(const AnyExecutor& a, nullptr_t) ASIO_NOEXCEPT \
- { \
- return !a; \
- } \
- \
- template <typename AnyExecutor> \
- friend typename enable_if< \
- is_same<AnyExecutor, any_executor>::value, \
- bool \
- >::type operator==(nullptr_t, const AnyExecutor& b) ASIO_NOEXCEPT \
- { \
- return !b; \
- } \
- \
- template <typename AnyExecutor1, typename AnyExecutor2> \
- friend typename enable_if< \
- is_base_of<any_executor, AnyExecutor1>::value \
- || is_base_of<any_executor, AnyExecutor2>::value, \
- bool \
- >::type operator!=(const AnyExecutor1& a, \
- const AnyExecutor2& b) ASIO_NOEXCEPT \
- { \
- return !static_cast<const any_executor&>(a).equality_helper(b); \
- } \
- \
- template <typename AnyExecutor> \
- friend typename enable_if< \
- is_same<AnyExecutor, any_executor>::value, \
- bool \
- >::type operator!=(const AnyExecutor& a, nullptr_t) ASIO_NOEXCEPT \
- { \
- return !!a; \
- } \
- \
- template <typename AnyExecutor> \
- friend typename enable_if< \
- is_same<AnyExecutor, any_executor>::value, \
- bool \
- >::type operator!=(nullptr_t, const AnyExecutor& b) ASIO_NOEXCEPT \
- { \
- return !!b; \
- } \
- \
- template <typename T> \
- struct find_convertible_property : \
- detail::supportable_properties< \
- 0, void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_property<T> {}; \
- \
- template <typename Property> \
- void query(const Property& p, \
- typename enable_if< \
- is_same< \
- typename find_convertible_property<Property>::query_result_type, \
- void \
- >::value \
- >::type* = 0) const \
- { \
- typedef find_convertible_property<Property> found; \
- prop_fns_[found::index].query(0, object_fns_->target(*this), \
- &static_cast<const typename found::type&>(p)); \
- } \
- \
- template <typename Property> \
- typename find_convertible_property<Property>::query_result_type \
- query(const Property& p, \
- typename enable_if< \
- !is_same< \
- typename find_convertible_property<Property>::query_result_type, \
- void \
- >::value \
- && \
- is_reference< \
- typename find_convertible_property<Property>::query_result_type \
- >::value \
- >::type* = 0) const \
- { \
- typedef find_convertible_property<Property> found; \
- typename remove_reference< \
- typename found::query_result_type>::type* result; \
- prop_fns_[found::index].query(&result, object_fns_->target(*this), \
- &static_cast<const typename found::type&>(p)); \
- return *result; \
- } \
- \
- template <typename Property> \
- typename find_convertible_property<Property>::query_result_type \
- query(const Property& p, \
- typename enable_if< \
- !is_same< \
- typename find_convertible_property<Property>::query_result_type, \
- void \
- >::value \
- && \
- is_scalar< \
- typename find_convertible_property<Property>::query_result_type \
- >::value \
- >::type* = 0) const \
- { \
- typedef find_convertible_property<Property> found; \
- typename found::query_result_type result; \
- prop_fns_[found::index].query(&result, object_fns_->target(*this), \
- &static_cast<const typename found::type&>(p)); \
- return result; \
- } \
- \
- template <typename Property> \
- typename find_convertible_property<Property>::query_result_type \
- query(const Property& p, \
- typename enable_if< \
- !is_same< \
- typename find_convertible_property<Property>::query_result_type, \
- void \
- >::value \
- && \
- !is_reference< \
- typename find_convertible_property<Property>::query_result_type \
- >::value \
- && \
- !is_scalar< \
- typename find_convertible_property<Property>::query_result_type \
- >::value \
- >::type* = 0) const \
- { \
- typedef find_convertible_property<Property> found; \
- typename found::query_result_type* result; \
- prop_fns_[found::index].query(&result, object_fns_->target(*this), \
- &static_cast<const typename found::type&>(p)); \
- return *asio::detail::scoped_ptr< \
- typename found::query_result_type>(result); \
- } \
- \
- template <typename T> \
- struct find_convertible_requirable_property : \
- detail::supportable_properties< \
- 0, void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_requirable_property<T> {}; \
- \
- template <typename Property> \
- any_executor require(const Property& p, \
- typename enable_if< \
- find_convertible_requirable_property<Property>::value \
- >::type* = 0) const \
- { \
- typedef find_convertible_requirable_property<Property> found; \
- return prop_fns_[found::index].require(object_fns_->target(*this), \
- &static_cast<const typename found::type&>(p)); \
- } \
- \
- template <typename T> \
- struct find_convertible_preferable_property : \
- detail::supportable_properties< \
- 0, void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_preferable_property<T> {}; \
- \
- template <typename Property> \
- any_executor prefer(const Property& p, \
- typename enable_if< \
- find_convertible_preferable_property<Property>::value \
- >::type* = 0) const \
- { \
- typedef find_convertible_preferable_property<Property> found; \
- return prop_fns_[found::index].prefer(object_fns_->target(*this), \
- &static_cast<const typename found::type&>(p)); \
- } \
- \
- template <typename Ex> \
- static const prop_fns<any_executor>* prop_fns_table() \
- { \
- static const prop_fns<any_executor> fns[] = \
- { \
- ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS(n) \
- }; \
- return fns; \
- } \
- \
- const prop_fns<any_executor>* prop_fns_; \
- typedef detail::supportable_properties<0, \
- void(ASIO_VARIADIC_TARGS(n))> supportable_properties_type; \
- }; \
- \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- inline void swap(any_executor<ASIO_VARIADIC_TARGS(n)>& a, \
- any_executor<ASIO_VARIADIC_TARGS(n)>& b) ASIO_NOEXCEPT \
- { \
- return a.swap(b); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ANY_EXECUTOR_DEF)
-#undef ASIO_PRIVATE_ANY_EXECUTOR_DEF
-#undef ASIO_PRIVATE_ANY_EXECUTOR_MOVE_OPS
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_1
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_2
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_3
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_4
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_5
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_6
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_7
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PROP_FNS_8
-
-#endif // if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
} // namespace execution
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
template <typename... SupportableProperties>
-struct equality_comparable<execution::any_executor<SupportableProperties...> >
-{
- static const bool is_valid = true;
- static const bool is_noexcept = true;
-};
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <>
-struct equality_comparable<execution::any_executor<> >
+struct equality_comparable<execution::any_executor<SupportableProperties...>>
{
- static const bool is_valid = true;
- static const bool is_noexcept = true;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
-#define ASIO_PRIVATE_ANY_EXECUTOR_EQUALITY_COMPARABLE_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- struct equality_comparable< \
- execution::any_executor<ASIO_VARIADIC_TARGS(n)> > \
- { \
- static const bool is_valid = true; \
- static const bool is_noexcept = true; \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(
- ASIO_PRIVATE_ANY_EXECUTOR_EQUALITY_COMPARABLE_DEF)
-#undef ASIO_PRIVATE_ANY_EXECUTOR_EQUALITY_COMPARABLE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
template <typename F, typename... SupportableProperties>
struct execute_member<execution::any_executor<SupportableProperties...>, F>
{
- static const bool is_valid = true;
- static const bool is_noexcept = false;
- typedef void result_type;
-};
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename F>
-struct execute_member<execution::any_executor<>, F>
-{
- static const bool is_valid = true;
- static const bool is_noexcept = false;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
-#define ASIO_PRIVATE_ANY_EXECUTOR_EXECUTE_MEMBER_DEF(n) \
- template <typename F, ASIO_VARIADIC_TPARAMS(n)> \
- struct execute_member< \
- execution::any_executor<ASIO_VARIADIC_TARGS(n)>, F> \
- { \
- static const bool is_valid = true; \
- static const bool is_noexcept = false; \
- typedef void result_type; \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(
- ASIO_PRIVATE_ANY_EXECUTOR_EXECUTE_MEMBER_DEF)
-#undef ASIO_PRIVATE_ANY_EXECUTOR_EXECUTE_MEMBER_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
template <typename Prop, typename... SupportableProperties>
struct query_member<
execution::any_executor<SupportableProperties...>, Prop,
- typename enable_if<
+ enable_if_t<
execution::detail::supportable_properties<
0, void(SupportableProperties...)>::template
find_convertible_property<Prop>::value
- >::type>
+ >>
{
- static const bool is_valid = true;
- static const bool is_noexcept = false;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef typename execution::detail::supportable_properties<
0, void(SupportableProperties...)>::template
find_convertible_property<Prop>::query_result_type result_type;
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_ANY_EXECUTOR_QUERY_MEMBER_DEF(n) \
- template <typename Prop, ASIO_VARIADIC_TPARAMS(n)> \
- struct query_member< \
- execution::any_executor<ASIO_VARIADIC_TARGS(n)>, Prop, \
- typename enable_if< \
- execution::detail::supportable_properties< \
- 0, void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_property<Prop>::value \
- >::type> \
- { \
- static const bool is_valid = true; \
- static const bool is_noexcept = false; \
- typedef typename execution::detail::supportable_properties< \
- 0, void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_property<Prop>::query_result_type result_type; \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ANY_EXECUTOR_QUERY_MEMBER_DEF)
-#undef ASIO_PRIVATE_ANY_EXECUTOR_QUERY_MEMBER_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
template <typename Prop, typename... SupportableProperties>
struct require_member<
execution::any_executor<SupportableProperties...>, Prop,
- typename enable_if<
+ enable_if_t<
execution::detail::supportable_properties<
0, void(SupportableProperties...)>::template
find_convertible_requirable_property<Prop>::value
- >::type>
+ >>
{
- static const bool is_valid = true;
- static const bool is_noexcept = false;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef execution::any_executor<SupportableProperties...> result_type;
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_ANY_EXECUTOR_REQUIRE_MEMBER_DEF(n) \
- template <typename Prop, ASIO_VARIADIC_TPARAMS(n)> \
- struct require_member< \
- execution::any_executor<ASIO_VARIADIC_TARGS(n)>, Prop, \
- typename enable_if< \
- execution::detail::supportable_properties< \
- 0, void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_requirable_property<Prop>::value \
- >::type> \
- { \
- static const bool is_valid = true; \
- static const bool is_noexcept = false; \
- typedef execution::any_executor<ASIO_VARIADIC_TARGS(n)> result_type; \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(
- ASIO_PRIVATE_ANY_EXECUTOR_REQUIRE_MEMBER_DEF)
-#undef ASIO_PRIVATE_ANY_EXECUTOR_REQUIRE_MEMBER_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
template <typename Prop, typename... SupportableProperties>
struct prefer_member<
execution::any_executor<SupportableProperties...>, Prop,
- typename enable_if<
+ enable_if_t<
execution::detail::supportable_properties<
0, void(SupportableProperties...)>::template
find_convertible_preferable_property<Prop>::value
- >::type>
+ >>
{
- static const bool is_valid = true;
- static const bool is_noexcept = false;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef execution::any_executor<SupportableProperties...> result_type;
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_ANY_EXECUTOR_PREFER_FREE_DEF(n) \
- template <typename Prop, ASIO_VARIADIC_TPARAMS(n)> \
- struct prefer_member< \
- execution::any_executor<ASIO_VARIADIC_TARGS(n)>, Prop, \
- typename enable_if< \
- execution::detail::supportable_properties< \
- 0, void(ASIO_VARIADIC_TARGS(n))>::template \
- find_convertible_preferable_property<Prop>::value \
- >::type> \
- { \
- static const bool is_valid = true; \
- static const bool is_noexcept = false; \
- typedef execution::any_executor<ASIO_VARIADIC_TARGS(n)> result_type; \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ANY_EXECUTOR_PREFER_FREE_DEF)
-#undef ASIO_PRIVATE_ANY_EXECUTOR_PREFER_FREE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
} // namespace traits
diff --git a/3rdparty/asio/include/asio/execution/bad_executor.hpp b/3rdparty/asio/include/asio/execution/bad_executor.hpp
index 0532ceff17a..791951684fe 100644
--- a/3rdparty/asio/include/asio/execution/bad_executor.hpp
+++ b/3rdparty/asio/include/asio/execution/bad_executor.hpp
@@ -2,7 +2,7 @@
// execution/bad_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -28,11 +28,10 @@ class bad_executor
{
public:
/// Constructor.
- ASIO_DECL bad_executor() ASIO_NOEXCEPT;
+ ASIO_DECL bad_executor() noexcept;
/// Obtain message associated with exception.
- ASIO_DECL virtual const char* what() const
- ASIO_NOEXCEPT_OR_NOTHROW;
+ ASIO_DECL virtual const char* what() const noexcept;
};
} // namespace execution
diff --git a/3rdparty/asio/include/asio/execution/blocking.hpp b/3rdparty/asio/include/asio/execution/blocking.hpp
index 76a2eb523dc..e120299bded 100644
--- a/3rdparty/asio/include/asio/execution/blocking.hpp
+++ b/3rdparty/asio/include/asio/execution/blocking.hpp
@@ -2,7 +2,7 @@
// execution/blocking.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,14 +17,12 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/execution/execute.hpp"
#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
#include "asio/is_applicable_property.hpp"
#include "asio/prefer.hpp"
#include "asio/query.hpp"
#include "asio/require.hpp"
+#include "asio/traits/execute_member.hpp"
#include "asio/traits/query_free.hpp"
#include "asio/traits/query_member.hpp"
#include "asio/traits/query_static_constexpr_member.hpp"
@@ -43,10 +41,9 @@ namespace execution {
/// behaviour of their execution functions.
struct blocking_t
{
- /// The blocking_t property applies to executors, senders, and schedulers.
+ /// The blocking_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The top-level blocking_t property cannot be required.
static constexpr bool is_requirable = false;
@@ -62,11 +59,9 @@ struct blocking_t
/// submitted function object.
struct possibly_t
{
- /// The blocking_t::possibly_t property applies to executors, senders, and
- /// schedulers.
+ /// The blocking_t::possibly_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The blocking_t::possibly_t property can be required.
static constexpr bool is_requirable = true;
@@ -92,11 +87,9 @@ struct blocking_t
/// function object.
struct always_t
{
- /// The blocking_t::always_t property applies to executors, senders, and
- /// schedulers.
+ /// The blocking_t::always_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The blocking_t::always_t property can be required.
static constexpr bool is_requirable = true;
@@ -122,11 +115,9 @@ struct blocking_t
/// submitted function object.
struct never_t
{
- /// The blocking_t::never_t property applies to executors, senders, and
- /// schedulers.
+ /// The blocking_t::never_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The blocking_t::never_t property can be required.
static constexpr bool is_requirable = true;
@@ -199,8 +190,8 @@ template <int I> struct allowed_t;
template <typename Executor, typename Function>
void blocking_execute(
- ASIO_MOVE_ARG(Executor) ex,
- ASIO_MOVE_ARG(Function) func);
+ Executor&& ex,
+ Function&& func);
} // namespace blocking_adaptation
@@ -209,45 +200,33 @@ struct blocking_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = false;
+ static constexpr bool is_preferable = false;
typedef blocking_t polymorphic_query_result_type;
typedef detail::blocking::possibly_t<I> possibly_t;
typedef detail::blocking::always_t<I> always_t;
typedef detail::blocking::never_t<I> never_t;
- ASIO_CONSTEXPR blocking_t()
+ constexpr blocking_t()
: value_(-1)
{
}
- ASIO_CONSTEXPR blocking_t(possibly_t)
+ constexpr blocking_t(possibly_t)
: value_(0)
{
}
- ASIO_CONSTEXPR blocking_t(always_t)
+ constexpr blocking_t(always_t)
: value_(1)
{
}
- ASIO_CONSTEXPR blocking_t(never_t)
+ constexpr blocking_t(never_t)
: value_(2)
{
}
@@ -259,16 +238,14 @@ struct blocking_t
struct type
{
template <typename P>
- auto query(ASIO_MOVE_ARG(P) p) const
+ auto query(P&& p) const
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -283,17 +260,17 @@ struct blocking_t
struct type
{
template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
+ static constexpr auto query(P&& p)
noexcept(
noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
)
-> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
{
- return T::query(ASIO_MOVE_CAST(P)(p));
+ return T::query(static_cast<P&&>(p));
}
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
@@ -313,88 +290,87 @@ struct blocking_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, possibly_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, possibly_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, possibly_t>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, always_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::static_query<T, possibly_t>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, always_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, always_t>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, never_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::static_query<T, possibly_t>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::static_query<T, always_t>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, never_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, never_t>::value();
}
template <typename E, typename T = decltype(blocking_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= blocking_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const blocking_t& a, const blocking_t& b)
{
return a.value_ == b.value_;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const blocking_t& a, const blocking_t& b)
{
return a.value_ != b.value_;
@@ -402,22 +378,20 @@ struct blocking_t
struct convertible_from_blocking_t
{
- ASIO_CONSTEXPR convertible_from_blocking_t(blocking_t) {}
+ constexpr convertible_from_blocking_t(blocking_t) {}
};
template <typename Executor>
- friend ASIO_CONSTEXPR blocking_t query(
+ friend constexpr blocking_t query(
const Executor& ex, convertible_from_blocking_t,
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, possibly_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, blocking_t<>::possibly_t>::value))
+ noexcept(is_nothrow_query<const Executor&, blocking_t<>::possibly_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, possibly_t>::value))
+ noexcept(is_nothrow_query<const Executor&, possibly_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -425,21 +399,19 @@ struct blocking_t
}
template <typename Executor>
- friend ASIO_CONSTEXPR blocking_t query(
+ friend constexpr blocking_t query(
const Executor& ex, convertible_from_blocking_t,
- typename enable_if<
+ enable_if_t<
!can_query<const Executor&, possibly_t>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_query<const Executor&, always_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, blocking_t<>::always_t>::value))
+ noexcept(is_nothrow_query<const Executor&, blocking_t<>::always_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, always_t>::value))
+ noexcept(is_nothrow_query<const Executor&, always_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -447,24 +419,22 @@ struct blocking_t
}
template <typename Executor>
- friend ASIO_CONSTEXPR blocking_t query(
+ friend constexpr blocking_t query(
const Executor& ex, convertible_from_blocking_t,
- typename enable_if<
+ enable_if_t<
!can_query<const Executor&, possibly_t>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!can_query<const Executor&, always_t>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_query<const Executor&, never_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, blocking_t<>::never_t>::value))
+ noexcept(is_nothrow_query<const Executor&, blocking_t<>::never_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, never_t>::value))
+ noexcept(is_nothrow_query<const Executor&, never_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -475,10 +445,6 @@ struct blocking_t
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(always_t, always);
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(never_t, never);
-#if !defined(ASIO_HAS_CONSTEXPR)
- static const blocking_t instance;
-#endif // !defined(ASIO_HAS_CONSTEXPR)
-
private:
int value_;
};
@@ -490,11 +456,6 @@ const T blocking_t<I>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_CONSTEXPR)
-template <int I>
-const blocking_t<I> blocking_t<I>::instance;
-#endif
-
template <int I>
const typename blocking_t<I>::possibly_t blocking_t<I>::possibly;
@@ -511,26 +472,14 @@ struct possibly_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef blocking_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR possibly_t()
+ constexpr possibly_t()
{
}
@@ -547,78 +496,77 @@ struct possibly_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR possibly_t static_query(
- typename enable_if<
+ static constexpr possibly_t static_query(
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::query_free<T, possibly_t>::is_valid
- >::type* = 0,
- typename enable_if<
- !can_query<T, always_t<I> >::value
- >::type* = 0,
- typename enable_if<
- !can_query<T, never_t<I> >::value
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0,
+ enable_if_t<
+ !can_query<T, always_t<I>>::value
+ >* = 0,
+ enable_if_t<
+ !can_query<T, never_t<I>>::value
+ >* = 0) noexcept
{
return possibly_t();
}
template <typename E, typename T = decltype(possibly_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= possibly_t::static_query<E>();
#endif // defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR blocking_t<I> value()
+ static constexpr blocking_t<I> value()
{
return possibly_t();
}
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const possibly_t&, const possibly_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const possibly_t&, const possibly_t&)
{
return false;
}
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const possibly_t&, const always_t<I>&)
{
return false;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const possibly_t&, const always_t<I>&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const possibly_t&, const never_t<I>&)
{
return false;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const possibly_t&, const never_t<I>&)
{
return true;
@@ -636,125 +584,110 @@ template <typename Executor>
class adapter
{
public:
- adapter(int, const Executor& e) ASIO_NOEXCEPT
+ adapter(int, const Executor& e) noexcept
: executor_(e)
{
}
- adapter(const adapter& other) ASIO_NOEXCEPT
+ adapter(const adapter& other) noexcept
: executor_(other.executor_)
{
}
-#if defined(ASIO_HAS_MOVE)
- adapter(adapter&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(Executor)(other.executor_))
+ adapter(adapter&& other) noexcept
+ : executor_(static_cast<Executor&&>(other.executor_))
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
template <int I>
- static ASIO_CONSTEXPR always_t<I> query(
- blocking_t<I>) ASIO_NOEXCEPT
+ static constexpr always_t<I> query(blocking_t<I>) noexcept
{
return always_t<I>();
}
template <int I>
- static ASIO_CONSTEXPR always_t<I> query(
- possibly_t<I>) ASIO_NOEXCEPT
+ static constexpr always_t<I> query(possibly_t<I>) noexcept
{
return always_t<I>();
}
template <int I>
- static ASIO_CONSTEXPR always_t<I> query(
- always_t<I>) ASIO_NOEXCEPT
+ static constexpr always_t<I> query(always_t<I>) noexcept
{
return always_t<I>();
}
template <int I>
- static ASIO_CONSTEXPR always_t<I> query(
- never_t<I>) ASIO_NOEXCEPT
+ static constexpr always_t<I> query(never_t<I>) noexcept
{
return always_t<I>();
}
template <typename Property>
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, Property>::value,
- typename query_result<const Executor&, Property>::type
- >::type query(const Property& p) const
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, Property>::value))
+ query_result_t<const Executor&, Property>
+ > query(const Property& p) const
+ noexcept(is_nothrow_query<const Executor&, Property>::value)
{
return asio::query(executor_, p);
}
template <int I>
- typename enable_if<
- can_require<const Executor&, possibly_t<I> >::value,
- typename require_result<const Executor&, possibly_t<I> >::type
- >::type require(possibly_t<I>) const ASIO_NOEXCEPT
+ enable_if_t<
+ can_require<const Executor&, possibly_t<I>>::value,
+ require_result_t<const Executor&, possibly_t<I>>
+ > require(possibly_t<I>) const noexcept
{
return asio::require(executor_, possibly_t<I>());
}
template <int I>
- typename enable_if<
- can_require<const Executor&, never_t<I> >::value,
- typename require_result<const Executor&, never_t<I> >::type
- >::type require(never_t<I>) const ASIO_NOEXCEPT
+ enable_if_t<
+ can_require<const Executor&, never_t<I>>::value,
+ require_result_t<const Executor&, never_t<I>>
+ > require(never_t<I>) const noexcept
{
return asio::require(executor_, never_t<I>());
}
template <typename Property>
- typename enable_if<
+ enable_if_t<
can_require<const Executor&, Property>::value,
- adapter<typename decay<
- typename require_result<const Executor&, Property>::type
- >::type>
- >::type require(const Property& p) const
- ASIO_NOEXCEPT_IF((
- is_nothrow_require<const Executor&, Property>::value))
+ adapter<decay_t<require_result_t<const Executor&, Property>>>
+ > require(const Property& p) const
+ noexcept(is_nothrow_require<const Executor&, Property>::value)
{
- return adapter<typename decay<
- typename require_result<const Executor&, Property>::type
- >::type>(0, asio::require(executor_, p));
+ return adapter<decay_t<require_result_t<const Executor&, Property>>>(
+ 0, asio::require(executor_, p));
}
template <typename Property>
- typename enable_if<
+ enable_if_t<
can_prefer<const Executor&, Property>::value,
- adapter<typename decay<
- typename prefer_result<const Executor&, Property>::type
- >::type>
- >::type prefer(const Property& p) const
- ASIO_NOEXCEPT_IF((
- is_nothrow_prefer<const Executor&, Property>::value))
+ adapter<decay_t<prefer_result_t<const Executor&, Property>>>
+ > prefer(const Property& p) const
+ noexcept(is_nothrow_prefer<const Executor&, Property>::value)
{
- return adapter<typename decay<
- typename prefer_result<const Executor&, Property>::type
- >::type>(0, asio::prefer(executor_, p));
+ return adapter<decay_t<prefer_result_t<const Executor&, Property>>>(
+ 0, asio::prefer(executor_, p));
}
template <typename Function>
- typename enable_if<
- execution::can_execute<const Executor&, Function>::value
- >::type execute(ASIO_MOVE_ARG(Function) f) const
+ enable_if_t<
+ traits::execute_member<const Executor&, Function>::is_valid
+ > execute(Function&& f) const
{
blocking_adaptation::blocking_execute(
- executor_, ASIO_MOVE_CAST(Function)(f));
+ executor_, static_cast<Function&&>(f));
}
- friend bool operator==(const adapter& a, const adapter& b) ASIO_NOEXCEPT
+ friend bool operator==(const adapter& a, const adapter& b) noexcept
{
return a.executor_ == b.executor_;
}
- friend bool operator!=(const adapter& a, const adapter& b) ASIO_NOEXCEPT
+ friend bool operator!=(const adapter& a, const adapter& b) noexcept
{
return a.executor_ != b.executor_;
}
@@ -768,26 +701,14 @@ struct always_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = false;
typedef blocking_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR always_t()
+ constexpr always_t()
{
}
@@ -804,57 +725,54 @@ struct always_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(always_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = always_t::static_query<E>();
+ static constexpr const T static_query_v = always_t::static_query<E>();
#endif // defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR blocking_t<I> value()
+ static constexpr blocking_t<I> value()
{
return always_t();
}
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const always_t&, const always_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const always_t&, const always_t&)
{
return false;
}
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const always_t&, const possibly_t<I>&)
{
return false;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const always_t&, const possibly_t<I>&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const always_t&, const never_t<I>&)
{
return false;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const always_t&, const never_t<I>&)
{
return true;
@@ -863,15 +781,15 @@ struct always_t
template <typename Executor>
friend adapter<Executor> require(
const Executor& e, const always_t&,
- typename enable_if<
+ enable_if_t<
is_executor<Executor>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_require<
const Executor&,
blocking_adaptation::allowed_t<0>
>::is_valid
- >::type* = 0)
+ >* = 0)
{
return adapter<Executor>(0, e);
}
@@ -889,26 +807,14 @@ struct never_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef blocking_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR never_t()
+ constexpr never_t()
{
}
@@ -925,58 +831,51 @@ struct never_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(never_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= never_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR blocking_t<I> value()
+ static constexpr blocking_t<I> value()
{
return never_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const never_t&, const never_t&)
+ friend constexpr bool operator==(const never_t&, const never_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const never_t&, const never_t&)
+ friend constexpr bool operator!=(const never_t&, const never_t&)
{
return false;
}
- friend ASIO_CONSTEXPR bool operator==(
- const never_t&, const possibly_t<I>&)
+ friend constexpr bool operator==(const never_t&, const possibly_t<I>&)
{
return false;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const never_t&, const possibly_t<I>&)
+ friend constexpr bool operator!=(const never_t&, const possibly_t<I>&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator==(
- const never_t&, const always_t<I>&)
+ friend constexpr bool operator==(const never_t&, const always_t<I>&)
{
return false;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const never_t&, const always_t<I>&)
+ friend constexpr bool operator!=(const never_t&, const always_t<I>&)
{
return true;
}
@@ -993,11 +892,7 @@ const T never_t<I>::static_query_v;
typedef detail::blocking_t<> blocking_t;
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr blocking_t blocking;
-#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-namespace { static const blocking_t& blocking = blocking_t::instance; }
-#endif
} // namespace execution
@@ -1005,69 +900,25 @@ namespace { static const blocking_t& blocking = blocking_t::instance; }
template <typename T>
struct is_applicable_property<T, execution::blocking_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::blocking_t::possibly_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::blocking_t::always_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::blocking_t::never_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
@@ -1079,42 +930,42 @@ namespace traits {
template <typename T>
struct query_free_default<T, execution::blocking_t,
- typename enable_if<
+ enable_if_t<
can_query<T, execution::blocking_t::possibly_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::blocking_t::possibly_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::blocking_t::possibly_t>::value;
typedef execution::blocking_t result_type;
};
template <typename T>
struct query_free_default<T, execution::blocking_t,
- typename enable_if<
+ enable_if_t<
!can_query<T, execution::blocking_t::possibly_t>::value
&& can_query<T, execution::blocking_t::always_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::blocking_t::always_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::blocking_t::always_t>::value;
typedef execution::blocking_t result_type;
};
template <typename T>
struct query_free_default<T, execution::blocking_t,
- typename enable_if<
+ enable_if_t<
!can_query<T, execution::blocking_t::possibly_t>::value
&& !can_query<T, execution::blocking_t::always_t>::value
&& can_query<T, execution::blocking_t::never_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::blocking_t::never_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::blocking_t::never_t>::value;
typedef execution::blocking_t result_type;
};
@@ -1126,18 +977,18 @@ struct query_free_default<T, execution::blocking_t,
template <typename T>
struct static_query<T, execution::blocking_t,
- typename enable_if<
+ enable_if_t<
execution::detail::blocking_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::blocking_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::blocking_t::query_static_constexpr_member<T>::value();
}
@@ -1145,21 +996,21 @@ struct static_query<T, execution::blocking_t,
template <typename T>
struct static_query<T, execution::blocking_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::blocking_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::blocking_t<0>::
query_member<T>::is_valid
&& traits::static_query<T, execution::blocking_t::possibly_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::blocking_t::possibly_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T, execution::blocking_t::possibly_t>::value();
}
@@ -1167,22 +1018,22 @@ struct static_query<T, execution::blocking_t,
template <typename T>
struct static_query<T, execution::blocking_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::blocking_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::blocking_t<0>::
query_member<T>::is_valid
&& !traits::static_query<T, execution::blocking_t::possibly_t>::is_valid
&& traits::static_query<T, execution::blocking_t::always_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::blocking_t::always_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T, execution::blocking_t::always_t>::value();
}
@@ -1190,7 +1041,7 @@ struct static_query<T, execution::blocking_t,
template <typename T>
struct static_query<T, execution::blocking_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::blocking_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::blocking_t<0>::
@@ -1198,15 +1049,15 @@ struct static_query<T, execution::blocking_t,
&& !traits::static_query<T, execution::blocking_t::possibly_t>::is_valid
&& !traits::static_query<T, execution::blocking_t::always_t>::is_valid
&& traits::static_query<T, execution::blocking_t::never_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::blocking_t::never_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T, execution::blocking_t::never_t>::value();
}
@@ -1214,18 +1065,18 @@ struct static_query<T, execution::blocking_t,
template <typename T>
struct static_query<T, execution::blocking_t::possibly_t,
- typename enable_if<
+ enable_if_t<
execution::detail::blocking::possibly_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::blocking::possibly_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::blocking::possibly_t<0>::
query_static_constexpr_member<T>::value();
@@ -1234,7 +1085,7 @@ struct static_query<T, execution::blocking_t::possibly_t,
template <typename T>
struct static_query<T, execution::blocking_t::possibly_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::blocking::possibly_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::blocking::possibly_t<0>::
@@ -1242,14 +1093,14 @@ struct static_query<T, execution::blocking_t::possibly_t,
&& !traits::query_free<T, execution::blocking_t::possibly_t>::is_valid
&& !can_query<T, execution::blocking_t::always_t>::value
&& !can_query<T, execution::blocking_t::never_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_t::possibly_t result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return result_type();
}
@@ -1257,18 +1108,18 @@ struct static_query<T, execution::blocking_t::possibly_t,
template <typename T>
struct static_query<T, execution::blocking_t::always_t,
- typename enable_if<
+ enable_if_t<
execution::detail::blocking::always_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::blocking::always_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::blocking::always_t<0>::
query_static_constexpr_member<T>::value();
@@ -1277,18 +1128,18 @@ struct static_query<T, execution::blocking_t::always_t,
template <typename T>
struct static_query<T, execution::blocking_t::never_t,
- typename enable_if<
+ enable_if_t<
execution::detail::blocking::never_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::blocking::never_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::blocking::never_t<0>::
query_static_constexpr_member<T>::value();
@@ -1298,61 +1149,21 @@ struct static_query<T, execution::blocking_t::never_t,
#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
-template <typename T>
-struct static_require<T, execution::blocking_t::possibly_t,
- typename enable_if<
- static_query<T, execution::blocking_t::possibly_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::blocking_t::possibly_t>::result_type,
- execution::blocking_t::possibly_t>::value));
-};
-
-template <typename T>
-struct static_require<T, execution::blocking_t::always_t,
- typename enable_if<
- static_query<T, execution::blocking_t::always_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::blocking_t::always_t>::result_type,
- execution::blocking_t::always_t>::value));
-};
-
-template <typename T>
-struct static_require<T, execution::blocking_t::never_t,
- typename enable_if<
- static_query<T, execution::blocking_t::never_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::blocking_t::never_t>::result_type,
- execution::blocking_t::never_t>::value));
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename T>
struct require_free_default<T, execution::blocking_t::always_t,
- typename enable_if<
- is_same<T, typename decay<T>::type>::value
+ enable_if_t<
+ is_same<T, decay_t<T>>::value
&& execution::is_executor<T>::value
&& traits::static_require<
const T&,
execution::detail::blocking_adaptation::allowed_t<0>
>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef execution::detail::blocking::adapter<T> result_type;
};
@@ -1362,10 +1173,10 @@ struct require_free_default<T, execution::blocking_t::always_t,
template <typename Executor>
struct equality_comparable<
- execution::detail::blocking::adapter<Executor> >
+ execution::detail::blocking::adapter<Executor>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -1376,8 +1187,8 @@ template <typename Executor, typename Function>
struct execute_member<
execution::detail::blocking::adapter<Executor>, Function>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -1388,13 +1199,13 @@ struct execute_member<
template <typename Executor, int I>
struct query_static_constexpr_member<
execution::detail::blocking::adapter<Executor>,
- execution::detail::blocking_t<I> >
+ execution::detail::blocking_t<I>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_t::always_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -1403,13 +1214,13 @@ struct query_static_constexpr_member<
template <typename Executor, int I>
struct query_static_constexpr_member<
execution::detail::blocking::adapter<Executor>,
- execution::detail::blocking::always_t<I> >
+ execution::detail::blocking::always_t<I>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_t::always_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -1418,13 +1229,13 @@ struct query_static_constexpr_member<
template <typename Executor, int I>
struct query_static_constexpr_member<
execution::detail::blocking::adapter<Executor>,
- execution::detail::blocking::possibly_t<I> >
+ execution::detail::blocking::possibly_t<I>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_t::always_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -1433,13 +1244,13 @@ struct query_static_constexpr_member<
template <typename Executor, int I>
struct query_static_constexpr_member<
execution::detail::blocking::adapter<Executor>,
- execution::detail::blocking::never_t<I> >
+ execution::detail::blocking::never_t<I>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_t::always_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -1452,14 +1263,14 @@ struct query_static_constexpr_member<
template <typename Executor, typename Property>
struct query_member<
execution::detail::blocking::adapter<Executor>, Property,
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, Property>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<Executor, Property>::value));
- typedef typename query_result<Executor, Property>::type result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<Executor, Property>::value;
+ typedef query_result_t<Executor, Property> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -1470,53 +1281,52 @@ template <typename Executor, int I>
struct require_member<
execution::detail::blocking::adapter<Executor>,
execution::detail::blocking::possibly_t<I>,
- typename enable_if<
+ enable_if_t<
can_require<
const Executor&,
execution::detail::blocking::possibly_t<I>
>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_require<const Executor&,
- execution::detail::blocking::possibly_t<I> >::value));
- typedef typename require_result<const Executor&,
- execution::detail::blocking::possibly_t<I> >::type result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_require<const Executor&,
+ execution::detail::blocking::possibly_t<I>>::value;
+ typedef require_result_t<const Executor&,
+ execution::detail::blocking::possibly_t<I>> result_type;
};
template <typename Executor, int I>
struct require_member<
execution::detail::blocking::adapter<Executor>,
execution::detail::blocking::never_t<I>,
- typename enable_if<
+ enable_if_t<
can_require<
const Executor&,
execution::detail::blocking::never_t<I>
>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_require<const Executor&,
- execution::detail::blocking::never_t<I> >::value));
- typedef typename require_result<const Executor&,
- execution::detail::blocking::never_t<I> >::type result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_require<const Executor&,
+ execution::detail::blocking::never_t<I>>::value;
+ typedef require_result_t<const Executor&,
+ execution::detail::blocking::never_t<I>> result_type;
};
template <typename Executor, typename Property>
struct require_member<
execution::detail::blocking::adapter<Executor>, Property,
- typename enable_if<
+ enable_if_t<
can_require<const Executor&, Property>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_require<Executor, Property>::value));
- typedef execution::detail::blocking::adapter<typename decay<
- typename require_result<Executor, Property>::type
- >::type> result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_require<Executor, Property>::value;
+ typedef execution::detail::blocking::adapter<
+ decay_t<require_result_t<Executor, Property>>> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
@@ -1526,16 +1336,15 @@ struct require_member<
template <typename Executor, typename Property>
struct prefer_member<
execution::detail::blocking::adapter<Executor>, Property,
- typename enable_if<
+ enable_if_t<
can_prefer<const Executor&, Property>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_prefer<Executor, Property>::value));
- typedef execution::detail::blocking::adapter<typename decay<
- typename prefer_result<Executor, Property>::type
- >::type> result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_prefer<Executor, Property>::value;
+ typedef execution::detail::blocking::adapter<
+ decay_t<prefer_result_t<Executor, Property>>> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
diff --git a/3rdparty/asio/include/asio/execution/blocking_adaptation.hpp b/3rdparty/asio/include/asio/execution/blocking_adaptation.hpp
index 2a3fe908df9..a2769b254a5 100644
--- a/3rdparty/asio/include/asio/execution/blocking_adaptation.hpp
+++ b/3rdparty/asio/include/asio/execution/blocking_adaptation.hpp
@@ -2,7 +2,7 @@
// execution/blocking_adaptation.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,10 +19,7 @@
#include "asio/detail/event.hpp"
#include "asio/detail/mutex.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/execution/execute.hpp"
#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
#include "asio/is_applicable_property.hpp"
#include "asio/prefer.hpp"
#include "asio/query.hpp"
@@ -47,11 +44,9 @@ namespace execution {
/// allowed in order to apply the blocking_adaptation_t::allowed_t property.
struct blocking_adaptation_t
{
- /// The blocking_adaptation_t property applies to executors, senders, and
- /// schedulers.
+ /// The blocking_adaptation_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The top-level blocking_adaptation_t property cannot be required.
static constexpr bool is_requirable = false;
@@ -65,11 +60,9 @@ struct blocking_adaptation_t
/// A sub-property that indicates that automatic adaptation is not allowed.
struct disallowed_t
{
- /// The blocking_adaptation_t::disallowed_t property applies to executors,
- /// senders, and schedulers.
+ /// The blocking_adaptation_t::disallowed_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The blocking_adaptation_t::disallowed_t property can be required.
static constexpr bool is_requirable = true;
@@ -93,11 +86,9 @@ struct blocking_adaptation_t
/// A sub-property that indicates that automatic adaptation is allowed.
struct allowed_t
{
- /// The blocking_adaptation_t::allowed_t property applies to executors,
- /// senders, and schedulers.
+ /// The blocking_adaptation_t::allowed_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The blocking_adaptation_t::allowed_t property can be required.
static constexpr bool is_requirable = true;
@@ -165,39 +156,27 @@ struct blocking_adaptation_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = false;
+ static constexpr bool is_preferable = false;
typedef blocking_adaptation_t polymorphic_query_result_type;
typedef detail::blocking_adaptation::disallowed_t<I> disallowed_t;
typedef detail::blocking_adaptation::allowed_t<I> allowed_t;
- ASIO_CONSTEXPR blocking_adaptation_t()
+ constexpr blocking_adaptation_t()
: value_(-1)
{
}
- ASIO_CONSTEXPR blocking_adaptation_t(disallowed_t)
+ constexpr blocking_adaptation_t(disallowed_t)
: value_(0)
{
}
- ASIO_CONSTEXPR blocking_adaptation_t(allowed_t)
+ constexpr blocking_adaptation_t(allowed_t)
: value_(1)
{
}
@@ -209,16 +188,14 @@ struct blocking_adaptation_t
struct type
{
template <typename P>
- auto query(ASIO_MOVE_ARG(P) p) const
+ auto query(P&& p) const
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -233,17 +210,17 @@ struct blocking_adaptation_t
struct type
{
template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
+ static constexpr auto query(P&& p)
noexcept(
noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
)
-> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
{
- return T::query(ASIO_MOVE_CAST(P)(p));
+ return T::query(static_cast<P&&>(p));
}
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
@@ -263,66 +240,64 @@ struct blocking_adaptation_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, disallowed_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, disallowed_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, disallowed_t>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, allowed_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::static_query<T, disallowed_t>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, allowed_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, allowed_t>::value();
}
template <typename E,
typename T = decltype(blocking_adaptation_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= blocking_adaptation_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const blocking_adaptation_t& a, const blocking_adaptation_t& b)
{
return a.value_ == b.value_;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const blocking_adaptation_t& a, const blocking_adaptation_t& b)
{
return a.value_ != b.value_;
@@ -330,26 +305,24 @@ struct blocking_adaptation_t
struct convertible_from_blocking_adaptation_t
{
- ASIO_CONSTEXPR convertible_from_blocking_adaptation_t(
+ constexpr convertible_from_blocking_adaptation_t(
blocking_adaptation_t)
{
}
};
template <typename Executor>
- friend ASIO_CONSTEXPR blocking_adaptation_t query(
+ friend constexpr blocking_adaptation_t query(
const Executor& ex, convertible_from_blocking_adaptation_t,
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, disallowed_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&,
- blocking_adaptation_t<>::disallowed_t>::value))
+ noexcept(is_nothrow_query<const Executor&,
+ blocking_adaptation_t<>::disallowed_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, disallowed_t>::value))
+ noexcept(is_nothrow_query<const Executor&, disallowed_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -357,22 +330,20 @@ struct blocking_adaptation_t
}
template <typename Executor>
- friend ASIO_CONSTEXPR blocking_adaptation_t query(
+ friend constexpr blocking_adaptation_t query(
const Executor& ex, convertible_from_blocking_adaptation_t,
- typename enable_if<
+ enable_if_t<
!can_query<const Executor&, disallowed_t>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_query<const Executor&, allowed_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&,
- blocking_adaptation_t<>::allowed_t>::value))
+ noexcept(is_nothrow_query<const Executor&,
+ blocking_adaptation_t<>::allowed_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, allowed_t>::value))
+ noexcept(is_nothrow_query<const Executor&, allowed_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -382,10 +353,6 @@ struct blocking_adaptation_t
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(disallowed_t, disallowed);
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(allowed_t, allowed);
-#if !defined(ASIO_HAS_CONSTEXPR)
- static const blocking_adaptation_t instance;
-#endif // !defined(ASIO_HAS_CONSTEXPR)
-
private:
int value_;
};
@@ -397,11 +364,6 @@ const T blocking_adaptation_t<I>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_CONSTEXPR)
-template <int I>
-const blocking_adaptation_t<I> blocking_adaptation_t<I>::instance;
-#endif
-
template <int I>
const typename blocking_adaptation_t<I>::disallowed_t
blocking_adaptation_t<I>::disallowed;
@@ -417,26 +379,14 @@ struct disallowed_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef blocking_adaptation_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR disallowed_t()
+ constexpr disallowed_t()
{
}
@@ -455,55 +405,62 @@ struct disallowed_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR disallowed_t static_query(
- typename enable_if<
+ static constexpr disallowed_t static_query(
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::query_free<T, disallowed_t>::is_valid
- >::type* = 0,
- typename enable_if<
- !can_query<T, allowed_t<I> >::value
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0,
+ enable_if_t<
+ !can_query<T, allowed_t<I>>::value
+ >* = 0) noexcept
{
return disallowed_t();
}
template <typename E, typename T = decltype(disallowed_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= disallowed_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR blocking_adaptation_t<I> value()
+ static constexpr blocking_adaptation_t<I> value()
{
return disallowed_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const disallowed_t&, const disallowed_t&)
+ friend constexpr bool operator==(const disallowed_t&, const disallowed_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const disallowed_t&, const disallowed_t&)
+ friend constexpr bool operator!=(const disallowed_t&, const disallowed_t&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator==(const disallowed_t&, const allowed_t<I>&)
{
return false;
}
+
+ friend constexpr bool operator!=(const disallowed_t&, const allowed_t<I>&)
+ {
+ return true;
+ }
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -517,105 +474,91 @@ template <typename Executor>
class adapter
{
public:
- adapter(int, const Executor& e) ASIO_NOEXCEPT
+ adapter(int, const Executor& e) noexcept
: executor_(e)
{
}
- adapter(const adapter& other) ASIO_NOEXCEPT
+ adapter(const adapter& other) noexcept
: executor_(other.executor_)
{
}
-#if defined(ASIO_HAS_MOVE)
- adapter(adapter&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(Executor)(other.executor_))
+ adapter(adapter&& other) noexcept
+ : executor_(static_cast<Executor&&>(other.executor_))
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
template <int I>
- static ASIO_CONSTEXPR allowed_t<I> query(
- blocking_adaptation_t<I>) ASIO_NOEXCEPT
+ static constexpr allowed_t<I> query(blocking_adaptation_t<I>) noexcept
{
return allowed_t<I>();
}
template <int I>
- static ASIO_CONSTEXPR allowed_t<I> query(
- allowed_t<I>) ASIO_NOEXCEPT
+ static constexpr allowed_t<I> query(allowed_t<I>) noexcept
{
return allowed_t<I>();
}
template <int I>
- static ASIO_CONSTEXPR allowed_t<I> query(
- disallowed_t<I>) ASIO_NOEXCEPT
+ static constexpr allowed_t<I> query(disallowed_t<I>) noexcept
{
return allowed_t<I>();
}
template <typename Property>
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, Property>::value,
- typename query_result<const Executor&, Property>::type
- >::type query(const Property& p) const
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, Property>::value))
+ query_result_t<const Executor&, Property>
+ > query(const Property& p) const
+ noexcept(is_nothrow_query<const Executor&, Property>::value)
{
return asio::query(executor_, p);
}
template <int I>
- Executor require(disallowed_t<I>) const ASIO_NOEXCEPT
+ Executor require(disallowed_t<I>) const noexcept
{
return executor_;
}
template <typename Property>
- typename enable_if<
+ enable_if_t<
can_require<const Executor&, Property>::value,
- adapter<typename decay<
- typename require_result<const Executor&, Property>::type
- >::type>
- >::type require(const Property& p) const
- ASIO_NOEXCEPT_IF((
- is_nothrow_require<const Executor&, Property>::value))
+ adapter<decay_t<require_result_t<const Executor&, Property>>>
+ > require(const Property& p) const
+ noexcept(is_nothrow_require<const Executor&, Property>::value)
{
- return adapter<typename decay<
- typename require_result<const Executor&, Property>::type
- >::type>(0, asio::require(executor_, p));
+ return adapter<decay_t<require_result_t<const Executor&, Property>>>(
+ 0, asio::require(executor_, p));
}
template <typename Property>
- typename enable_if<
+ enable_if_t<
can_prefer<const Executor&, Property>::value,
- adapter<typename decay<
- typename prefer_result<const Executor&, Property>::type
- >::type>
- >::type prefer(const Property& p) const
- ASIO_NOEXCEPT_IF((
- is_nothrow_prefer<const Executor&, Property>::value))
+ adapter<decay_t<prefer_result_t<const Executor&, Property>>>
+ > prefer(const Property& p) const
+ noexcept(is_nothrow_prefer<const Executor&, Property>::value)
{
- return adapter<typename decay<
- typename prefer_result<const Executor&, Property>::type
- >::type>(0, asio::prefer(executor_, p));
+ return adapter<decay_t<prefer_result_t<const Executor&, Property>>>(
+ 0, asio::prefer(executor_, p));
}
template <typename Function>
- typename enable_if<
- execution::can_execute<const Executor&, Function>::value
- >::type execute(ASIO_MOVE_ARG(Function) f) const
+ enable_if_t<
+ traits::execute_member<const Executor&, Function>::is_valid
+ > execute(Function&& f) const
{
- execution::execute(executor_, ASIO_MOVE_CAST(Function)(f));
+ executor_.execute(static_cast<Function&&>(f));
}
- friend bool operator==(const adapter& a, const adapter& b) ASIO_NOEXCEPT
+ friend bool operator==(const adapter& a, const adapter& b) noexcept
{
return a.executor_ == b.executor_;
}
- friend bool operator!=(const adapter& a, const adapter& b) ASIO_NOEXCEPT
+ friend bool operator!=(const adapter& a, const adapter& b) noexcept
{
return a.executor_ != b.executor_;
}
@@ -629,26 +572,14 @@ struct allowed_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = false;
typedef blocking_adaptation_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR allowed_t()
+ constexpr allowed_t()
{
}
@@ -667,44 +598,49 @@ struct allowed_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(allowed_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = allowed_t::static_query<E>();
+ static constexpr const T static_query_v = allowed_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR blocking_adaptation_t<I> value()
+ static constexpr blocking_adaptation_t<I> value()
{
return allowed_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const allowed_t&, const allowed_t&)
+ friend constexpr bool operator==(const allowed_t&, const allowed_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const allowed_t&, const allowed_t&)
+ friend constexpr bool operator!=(const allowed_t&, const allowed_t&)
{
return false;
}
+ friend constexpr bool operator==(const allowed_t&, const disallowed_t<I>&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator!=(const allowed_t&, const disallowed_t<I>&)
+ {
+ return true;
+ }
+
template <typename Executor>
friend adapter<Executor> require(
const Executor& e, const allowed_t&,
- typename enable_if<
+ enable_if_t<
is_executor<Executor>::value
- >::type* = 0)
+ >* = 0)
{
return adapter<Executor>(0, e);
}
@@ -722,17 +658,17 @@ class blocking_execute_state
{
public:
template <typename F>
- blocking_execute_state(ASIO_MOVE_ARG(F) f)
- : func_(ASIO_MOVE_CAST(F)(f)),
+ blocking_execute_state(F&& f)
+ : func_(static_cast<F&&>(f)),
is_complete_(false)
{
}
template <typename Executor>
- void execute_and_wait(ASIO_MOVE_ARG(Executor) ex)
+ void execute_and_wait(Executor&& ex)
{
handler h = { this };
- execution::execute(ASIO_MOVE_CAST(Executor)(ex), h);
+ ex.execute(h);
asio::detail::mutex::scoped_lock lock(mutex_);
while (!is_complete_)
event_.wait(lock);
@@ -769,11 +705,11 @@ public:
template <typename Executor, typename Function>
void blocking_execute(
- ASIO_MOVE_ARG(Executor) ex,
- ASIO_MOVE_ARG(Function) func)
+ Executor&& ex,
+ Function&& func)
{
- typedef typename decay<Function>::type func_t;
- blocking_execute_state<func_t> state(ASIO_MOVE_CAST(Function)(func));
+ typedef decay_t<Function> func_t;
+ blocking_execute_state<func_t> state(static_cast<Function&&>(func));
state.execute_and_wait(ex);
}
@@ -782,12 +718,7 @@ void blocking_execute(
typedef detail::blocking_adaptation_t<> blocking_adaptation_t;
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr blocking_adaptation_t blocking_adaptation;
-#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-namespace { static const blocking_adaptation_t&
- blocking_adaptation = blocking_adaptation_t::instance; }
-#endif
} // namespace execution
@@ -795,52 +726,19 @@ namespace { static const blocking_adaptation_t&
template <typename T>
struct is_applicable_property<T, execution::blocking_adaptation_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::blocking_adaptation_t::disallowed_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::blocking_adaptation_t::allowed_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
@@ -852,27 +750,27 @@ namespace traits {
template <typename T>
struct query_free_default<T, execution::blocking_adaptation_t,
- typename enable_if<
+ enable_if_t<
can_query<T, execution::blocking_adaptation_t::disallowed_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = (is_nothrow_query<T,
- execution::blocking_adaptation_t::disallowed_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::blocking_adaptation_t::disallowed_t>::value;
typedef execution::blocking_adaptation_t result_type;
};
template <typename T>
struct query_free_default<T, execution::blocking_adaptation_t,
- typename enable_if<
+ enable_if_t<
!can_query<T, execution::blocking_adaptation_t::disallowed_t>::value
&& can_query<T, execution::blocking_adaptation_t::allowed_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::blocking_adaptation_t::allowed_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::blocking_adaptation_t::allowed_t>::value;
typedef execution::blocking_adaptation_t result_type;
};
@@ -884,18 +782,18 @@ struct query_free_default<T, execution::blocking_adaptation_t,
template <typename T>
struct static_query<T, execution::blocking_adaptation_t,
- typename enable_if<
+ enable_if_t<
execution::detail::blocking_adaptation_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::blocking_adaptation_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::blocking_adaptation_t<0>::
query_static_constexpr_member<T>::value();
@@ -904,22 +802,22 @@ struct static_query<T, execution::blocking_adaptation_t,
template <typename T>
struct static_query<T, execution::blocking_adaptation_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::blocking_adaptation_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::blocking_adaptation_t<0>::
query_member<T>::is_valid
&& traits::static_query<T,
execution::blocking_adaptation_t::disallowed_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::blocking_adaptation_t::disallowed_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T,
execution::blocking_adaptation_t::disallowed_t>::value();
@@ -928,7 +826,7 @@ struct static_query<T, execution::blocking_adaptation_t,
template <typename T>
struct static_query<T, execution::blocking_adaptation_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::blocking_adaptation_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::blocking_adaptation_t<0>::
@@ -937,15 +835,15 @@ struct static_query<T, execution::blocking_adaptation_t,
execution::blocking_adaptation_t::disallowed_t>::is_valid
&& traits::static_query<T,
execution::blocking_adaptation_t::allowed_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::blocking_adaptation_t::allowed_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T,
execution::blocking_adaptation_t::allowed_t>::value();
@@ -954,18 +852,18 @@ struct static_query<T, execution::blocking_adaptation_t,
template <typename T>
struct static_query<T, execution::blocking_adaptation_t::disallowed_t,
- typename enable_if<
+ enable_if_t<
execution::detail::blocking_adaptation::disallowed_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::blocking_adaptation::disallowed_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::blocking_adaptation::disallowed_t<0>::
query_static_constexpr_member<T>::value();
@@ -974,7 +872,7 @@ struct static_query<T, execution::blocking_adaptation_t::disallowed_t,
template <typename T>
struct static_query<T, execution::blocking_adaptation_t::disallowed_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::blocking_adaptation::disallowed_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::blocking_adaptation::disallowed_t<0>::
@@ -982,14 +880,14 @@ struct static_query<T, execution::blocking_adaptation_t::disallowed_t,
&& !traits::query_free<T,
execution::blocking_adaptation_t::disallowed_t>::is_valid
&& !can_query<T, execution::blocking_adaptation_t::allowed_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_adaptation_t::disallowed_t result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return result_type();
}
@@ -997,18 +895,18 @@ struct static_query<T, execution::blocking_adaptation_t::disallowed_t,
template <typename T>
struct static_query<T, execution::blocking_adaptation_t::allowed_t,
- typename enable_if<
+ enable_if_t<
execution::detail::blocking_adaptation::allowed_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::blocking_adaptation::allowed_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::blocking_adaptation::allowed_t<0>::
query_static_constexpr_member<T>::value();
@@ -1018,45 +916,17 @@ struct static_query<T, execution::blocking_adaptation_t::allowed_t,
#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
-template <typename T>
-struct static_require<T, execution::blocking_adaptation_t::disallowed_t,
- typename enable_if<
- static_query<T, execution::blocking_adaptation_t::disallowed_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::blocking_adaptation_t::disallowed_t>::result_type,
- execution::blocking_adaptation_t::disallowed_t>::value));
-};
-
-template <typename T>
-struct static_require<T, execution::blocking_adaptation_t::allowed_t,
- typename enable_if<
- static_query<T, execution::blocking_adaptation_t::allowed_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::blocking_adaptation_t::allowed_t>::result_type,
- execution::blocking_adaptation_t::allowed_t>::value));
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename T>
struct require_free_default<T, execution::blocking_adaptation_t::allowed_t,
- typename enable_if<
- is_same<T, typename decay<T>::type>::value
+ enable_if_t<
+ is_same<T, decay_t<T>>::value
&& execution::is_executor<T>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef execution::detail::blocking_adaptation::adapter<T> result_type;
};
@@ -1066,10 +936,10 @@ struct require_free_default<T, execution::blocking_adaptation_t::allowed_t,
template <typename Executor>
struct equality_comparable<
- execution::detail::blocking_adaptation::adapter<Executor> >
+ execution::detail::blocking_adaptation::adapter<Executor>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -1080,8 +950,8 @@ template <typename Executor, typename Function>
struct execute_member<
execution::detail::blocking_adaptation::adapter<Executor>, Function>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -1092,13 +962,13 @@ struct execute_member<
template <typename Executor, int I>
struct query_static_constexpr_member<
execution::detail::blocking_adaptation::adapter<Executor>,
- execution::detail::blocking_adaptation_t<I> >
+ execution::detail::blocking_adaptation_t<I>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_adaptation_t::allowed_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -1107,13 +977,13 @@ struct query_static_constexpr_member<
template <typename Executor, int I>
struct query_static_constexpr_member<
execution::detail::blocking_adaptation::adapter<Executor>,
- execution::detail::blocking_adaptation::allowed_t<I> >
+ execution::detail::blocking_adaptation::allowed_t<I>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_adaptation_t::allowed_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -1122,13 +992,13 @@ struct query_static_constexpr_member<
template <typename Executor, int I>
struct query_static_constexpr_member<
execution::detail::blocking_adaptation::adapter<Executor>,
- execution::detail::blocking_adaptation::disallowed_t<I> >
+ execution::detail::blocking_adaptation::disallowed_t<I>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_adaptation_t::allowed_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -1141,14 +1011,14 @@ struct query_static_constexpr_member<
template <typename Executor, typename Property>
struct query_member<
execution::detail::blocking_adaptation::adapter<Executor>, Property,
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, Property>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<Executor, Property>::value));
- typedef typename query_result<Executor, Property>::type result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<Executor, Property>::value;
+ typedef query_result_t<Executor, Property> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -1158,26 +1028,25 @@ struct query_member<
template <typename Executor, int I>
struct require_member<
execution::detail::blocking_adaptation::adapter<Executor>,
- execution::detail::blocking_adaptation::disallowed_t<I> >
+ execution::detail::blocking_adaptation::disallowed_t<I>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Executor result_type;
};
template <typename Executor, typename Property>
struct require_member<
execution::detail::blocking_adaptation::adapter<Executor>, Property,
- typename enable_if<
+ enable_if_t<
can_require<const Executor&, Property>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_require<Executor, Property>::value));
- typedef execution::detail::blocking_adaptation::adapter<typename decay<
- typename require_result<Executor, Property>::type
- >::type> result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_require<Executor, Property>::value;
+ typedef execution::detail::blocking_adaptation::adapter<
+ decay_t<require_result_t<Executor, Property>>> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
@@ -1187,16 +1056,15 @@ struct require_member<
template <typename Executor, typename Property>
struct prefer_member<
execution::detail::blocking_adaptation::adapter<Executor>, Property,
- typename enable_if<
+ enable_if_t<
can_prefer<const Executor&, Property>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_prefer<Executor, Property>::value));
- typedef execution::detail::blocking_adaptation::adapter<typename decay<
- typename prefer_result<Executor, Property>::type
- >::type> result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_prefer<Executor, Property>::value;
+ typedef execution::detail::blocking_adaptation::adapter<
+ decay_t<prefer_result_t<Executor, Property>>> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
diff --git a/3rdparty/asio/include/asio/execution/bulk_execute.hpp b/3rdparty/asio/include/asio/execution/bulk_execute.hpp
deleted file mode 100644
index 2bc13c954c0..00000000000
--- a/3rdparty/asio/include/asio/execution/bulk_execute.hpp
+++ /dev/null
@@ -1,397 +0,0 @@
-//
-// execution/bulk_execute.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_BULK_EXECUTE_HPP
-#define ASIO_EXECUTION_BULK_EXECUTE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/bulk_guarantee.hpp"
-#include "asio/execution/detail/bulk_sender.hpp"
-#include "asio/execution/executor.hpp"
-#include "asio/execution/sender.hpp"
-#include "asio/traits/bulk_execute_member.hpp"
-#include "asio/traits/bulk_execute_free.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-/// A customisation point that creates a bulk sender.
-/**
- * The name <tt>execution::bulk_execute</tt> denotes a customisation point
- * object. If <tt>is_convertible_v<N, size_t></tt> is true, then the expression
- * <tt>execution::bulk_execute(S, F, N)</tt> for some subexpressions
- * <tt>S</tt>, <tt>F</tt>, and <tt>N</tt> is expression-equivalent to:
- *
- * @li <tt>S.bulk_execute(F, N)</tt>, if that expression is valid. If the
- * function selected does not execute <tt>N</tt> invocations of the function
- * object <tt>F</tt> on the executor <tt>S</tt> in bulk with forward progress
- * guarantee <tt>asio::query(S, execution::bulk_guarantee)</tt>, and
- * the result of that function does not model <tt>sender<void></tt>, the
- * program is ill-formed with no diagnostic required.
- *
- * @li Otherwise, <tt>bulk_execute(S, F, N)</tt>, if that expression is valid,
- * with overload resolution performed in a context that includes the
- * declaration <tt>void bulk_execute();</tt> and that does not include a
- * declaration of <tt>execution::bulk_execute</tt>. If the function selected
- * by overload resolution does not execute <tt>N</tt> invocations of the
- * function object <tt>F</tt> on the executor <tt>S</tt> in bulk with forward
- * progress guarantee <tt>asio::query(E,
- * execution::bulk_guarantee)</tt>, and the result of that function does not
- * model <tt>sender<void></tt>, the program is ill-formed with no diagnostic
- * required.
- *
- * @li Otherwise, if the types <tt>F</tt> and
- * <tt>executor_index_t<remove_cvref_t<S>></tt> model <tt>invocable</tt> and
- * if <tt>asio::query(S, execution::bulk_guarantee)</tt> equals
- * <tt>execution::bulk_guarantee.unsequenced</tt>, then
- *
- * - Evaluates <tt>DECAY_COPY(std::forward<decltype(F)>(F))</tt> on the
- * calling thread to create a function object <tt>cf</tt>. [Note:
- * Additional copies of <tt>cf</tt> may subsequently be created. --end
- * note.]
- *
- * - For each value of <tt>i</tt> in <tt>N</tt>, <tt>cf(i)</tt> (or copy of
- * <tt>cf</tt>)) will be invoked at most once by an execution agent that is
- * unique for each value of <tt>i</tt>.
- *
- * - May block pending completion of one or more invocations of <tt>cf</tt>.
- *
- * - Synchronizes with (C++Std [intro.multithread]) the invocations of
- * <tt>cf</tt>.
- *
- * @li Otherwise, <tt>execution::bulk_execute(S, F, N)</tt> is ill-formed.
- */
-inline constexpr unspecified bulk_execute = unspecified;
-
-/// A type trait that determines whether a @c bulk_execute expression is
-/// well-formed.
-/**
- * Class template @c can_bulk_execute is a trait that is derived from @c
- * true_type if the expression <tt>execution::bulk_execute(std::declval<S>(),
- * std::declval<F>(), std::declval<N>)</tt> is well formed; otherwise @c
- * false_type.
- */
-template <typename S, typename F, typename N>
-struct can_bulk_execute :
- integral_constant<bool, automatically_determined>
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace asio_execution_bulk_execute_fn {
-
-using asio::declval;
-using asio::enable_if;
-using asio::execution::bulk_guarantee_t;
-using asio::execution::detail::bulk_sender;
-using asio::execution::executor_index;
-using asio::execution::is_sender;
-using asio::is_convertible;
-using asio::is_same;
-using asio::remove_cvref;
-using asio::result_of;
-using asio::traits::bulk_execute_free;
-using asio::traits::bulk_execute_member;
-using asio::traits::static_require;
-
-void bulk_execute();
-
-enum overload_type
-{
- call_member,
- call_free,
- adapter,
- ill_formed
-};
-
-template <typename S, typename Args, typename = void, typename = void,
- typename = void, typename = void, typename = void, typename = void>
-struct call_traits
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename S, typename F, typename N>
-struct call_traits<S, void(F, N),
- typename enable_if<
- is_convertible<N, std::size_t>::value
- >::type,
- typename enable_if<
- bulk_execute_member<S, F, N>::is_valid
- >::type,
- typename enable_if<
- is_sender<
- typename bulk_execute_member<S, F, N>::result_type
- >::value
- >::type> :
- bulk_execute_member<S, F, N>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
-};
-
-template <typename S, typename F, typename N>
-struct call_traits<S, void(F, N),
- typename enable_if<
- is_convertible<N, std::size_t>::value
- >::type,
- typename enable_if<
- !bulk_execute_member<S, F, N>::is_valid
- >::type,
- typename enable_if<
- bulk_execute_free<S, F, N>::is_valid
- >::type,
- typename enable_if<
- is_sender<
- typename bulk_execute_free<S, F, N>::result_type
- >::value
- >::type> :
- bulk_execute_free<S, F, N>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
-};
-
-template <typename S, typename F, typename N>
-struct call_traits<S, void(F, N),
- typename enable_if<
- is_convertible<N, std::size_t>::value
- >::type,
- typename enable_if<
- !bulk_execute_member<S, F, N>::is_valid
- >::type,
- typename enable_if<
- !bulk_execute_free<S, F, N>::is_valid
- >::type,
- typename enable_if<
- is_sender<S>::value
- >::type,
- typename enable_if<
- is_same<
- typename result_of<
- F(typename executor_index<typename remove_cvref<S>::type>::type)
- >::type,
- typename result_of<
- F(typename executor_index<typename remove_cvref<S>::type>::type)
- >::type
- >::value
- >::type,
- typename enable_if<
- static_require<S, bulk_guarantee_t::unsequenced_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef bulk_sender<S, F, N> result_type;
-};
-
-struct impl
-{
-#if defined(ASIO_HAS_MOVE)
- template <typename S, typename F, typename N>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(F, N)>::overload == call_member,
- typename call_traits<S, void(F, N)>::result_type
- >::type
- operator()(S&& s, F&& f, N&& n) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(F, N)>::is_noexcept))
- {
- return ASIO_MOVE_CAST(S)(s).bulk_execute(
- ASIO_MOVE_CAST(F)(f), ASIO_MOVE_CAST(N)(n));
- }
-
- template <typename S, typename F, typename N>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(F, N)>::overload == call_free,
- typename call_traits<S, void(F, N)>::result_type
- >::type
- operator()(S&& s, F&& f, N&& n) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(F, N)>::is_noexcept))
- {
- return bulk_execute(ASIO_MOVE_CAST(S)(s),
- ASIO_MOVE_CAST(F)(f), ASIO_MOVE_CAST(N)(n));
- }
-
- template <typename S, typename F, typename N>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(F, N)>::overload == adapter,
- typename call_traits<S, void(F, N)>::result_type
- >::type
- operator()(S&& s, F&& f, N&& n) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(F, N)>::is_noexcept))
- {
- return typename call_traits<S, void(F, N)>::result_type(
- ASIO_MOVE_CAST(S)(s), ASIO_MOVE_CAST(F)(f),
- ASIO_MOVE_CAST(N)(n));
- }
-#else // defined(ASIO_HAS_MOVE)
- template <typename S, typename F, typename N>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(const F&, const N&)>::overload == call_member,
- typename call_traits<S, void(const F&, const N&)>::result_type
- >::type
- operator()(S& s, const F& f, const N& n) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(const F&, const N&)>::is_noexcept))
- {
- return s.bulk_execute(ASIO_MOVE_CAST(F)(f),
- ASIO_MOVE_CAST(N)(n));
- }
-
- template <typename S, typename F, typename N>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(const F&, const N&)>::overload == call_member,
- typename call_traits<S, void(const F&, const N&)>::result_type
- >::type
- operator()(const S& s, const F& f, const N& n) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(const F&, const N&)>::is_noexcept))
- {
- return s.bulk_execute(ASIO_MOVE_CAST(F)(f),
- ASIO_MOVE_CAST(N)(n));
- }
-
- template <typename S, typename F, typename N>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(const F&, const N&)>::overload == call_free,
- typename call_traits<S, void(const F&, const N&)>::result_type
- >::type
- operator()(S& s, const F& f, const N& n) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(const F&, const N&)>::is_noexcept))
- {
- return bulk_execute(s, ASIO_MOVE_CAST(F)(f),
- ASIO_MOVE_CAST(N)(n));
- }
-
- template <typename S, typename F, typename N>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(const F&, const N&)>::overload == call_free,
- typename call_traits<S, void(const F&, const N&)>::result_type
- >::type
- operator()(const S& s, const F& f, const N& n) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(const F&, const N&)>::is_noexcept))
- {
- return bulk_execute(s, ASIO_MOVE_CAST(F)(f),
- ASIO_MOVE_CAST(N)(n));
- }
-
- template <typename S, typename F, typename N>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(const F&, const N&)>::overload == adapter,
- typename call_traits<S, void(const F&, const N&)>::result_type
- >::type
- operator()(S& s, const F& f, const N& n) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(const F&, const N&)>::is_noexcept))
- {
- return typename call_traits<S, void(const F&, const N&)>::result_type(
- s, ASIO_MOVE_CAST(F)(f), ASIO_MOVE_CAST(N)(n));
- }
-
- template <typename S, typename F, typename N>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(const F&, const N&)>::overload == adapter,
- typename call_traits<S, void(const F&, const N&)>::result_type
- >::type
- operator()(const S& s, const F& f, const N& n) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(const F&, const N&)>::is_noexcept))
- {
- return typename call_traits<S, void(const F&, const N&)>::result_type(
- s, ASIO_MOVE_CAST(F)(f), ASIO_MOVE_CAST(N)(n));
- }
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-template <typename T = impl>
-struct static_instance
-{
- static const T instance;
-};
-
-template <typename T>
-const T static_instance<T>::instance = {};
-
-} // namespace asio_execution_bulk_execute_fn
-namespace asio {
-namespace execution {
-namespace {
-
-static ASIO_CONSTEXPR
- const asio_execution_bulk_execute_fn::impl& bulk_execute =
- asio_execution_bulk_execute_fn::static_instance<>::instance;
-
-} // namespace
-
-template <typename S, typename F, typename N>
-struct can_bulk_execute :
- integral_constant<bool,
- asio_execution_bulk_execute_fn::call_traits<
- S, void(F, N)>::overload !=
- asio_execution_bulk_execute_fn::ill_formed>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename F, typename N>
-constexpr bool can_bulk_execute_v = can_bulk_execute<S, F, N>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename F, typename N>
-struct is_nothrow_bulk_execute :
- integral_constant<bool,
- asio_execution_bulk_execute_fn::call_traits<
- S, void(F, N)>::is_noexcept>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename F, typename N>
-constexpr bool is_nothrow_bulk_execute_v
- = is_nothrow_bulk_execute<S, F, N>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename F, typename N>
-struct bulk_execute_result
-{
- typedef typename asio_execution_bulk_execute_fn::call_traits<
- S, void(F, N)>::result_type type;
-};
-
-} // namespace execution
-} // namespace asio
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_BULK_EXECUTE_HPP
diff --git a/3rdparty/asio/include/asio/execution/bulk_guarantee.hpp b/3rdparty/asio/include/asio/execution/bulk_guarantee.hpp
deleted file mode 100644
index 6482218357d..00000000000
--- a/3rdparty/asio/include/asio/execution/bulk_guarantee.hpp
+++ /dev/null
@@ -1,1215 +0,0 @@
-//
-// execution/bulk_guarantee.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_BULK_GUARANTEE_HPP
-#define ASIO_EXECUTION_BULK_GUARANTEE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
-#include "asio/is_applicable_property.hpp"
-#include "asio/query.hpp"
-#include "asio/traits/query_free.hpp"
-#include "asio/traits/query_member.hpp"
-#include "asio/traits/query_static_constexpr_member.hpp"
-#include "asio/traits/static_query.hpp"
-#include "asio/traits/static_require.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace execution {
-
-/// A property to communicate the forward progress and ordering guarantees of
-/// execution agents associated with the bulk execution.
-struct bulk_guarantee_t
-{
- /// The bulk_guarantee_t property applies to executors, senders, and
- /// schedulers.
- template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
-
- /// The top-level bulk_guarantee_t property cannot be required.
- static constexpr bool is_requirable = false;
-
- /// The top-level bulk_guarantee_t property cannot be preferred.
- static constexpr bool is_preferable = false;
-
- /// The type returned by queries against an @c any_executor.
- typedef bulk_guarantee_t polymorphic_query_result_type;
-
- /// A sub-property that indicates that execution agents within the same bulk
- /// execution may be parallelised and vectorised.
- struct unsequenced_t
- {
- /// The bulk_guarantee_t::unsequenced_t property applies to executors,
- /// senders, and schedulers.
- template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
-
- /// The bulk_guarantee_t::unsequenced_t property can be required.
- static constexpr bool is_requirable = true;
-
- /// The bulk_guarantee_t::unsequenced_t property can be preferred.
- static constexpr bool is_preferable = true;
-
- /// The type returned by queries against an @c any_executor.
- typedef bulk_guarantee_t polymorphic_query_result_type;
-
- /// Default constructor.
- constexpr unsequenced_t();
-
- /// Get the value associated with a property object.
- /**
- * @returns unsequenced_t();
- */
- static constexpr bulk_guarantee_t value();
- };
-
- /// A sub-property that indicates that execution agents within the same bulk
- /// execution may not be parallelised and vectorised.
- struct sequenced_t
- {
- /// The bulk_guarantee_t::sequenced_t property applies to executors,
- /// senders, and schedulers.
- template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
-
- /// The bulk_guarantee_t::sequenced_t property can be required.
- static constexpr bool is_requirable = true;
-
- /// The bulk_guarantee_t::sequenced_t property can be preferred.
- static constexpr bool is_preferable = true;
-
- /// The type returned by queries against an @c any_executor.
- typedef bulk_guarantee_t polymorphic_query_result_type;
-
- /// Default constructor.
- constexpr sequenced_t();
-
- /// Get the value associated with a property object.
- /**
- * @returns sequenced_t();
- */
- static constexpr bulk_guarantee_t value();
- };
-
- /// A sub-property that indicates that execution agents within the same bulk
- /// execution may be parallelised.
- struct parallel_t
- {
- /// The bulk_guarantee_t::parallel_t property applies to executors,
- /// senders, and schedulers.
- template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
-
- /// The bulk_guarantee_t::parallel_t property can be required.
- static constexpr bool is_requirable = true;
-
- /// The bulk_guarantee_t::parallel_t property can be preferred.
- static constexpr bool is_preferable = true;
-
- /// The type returned by queries against an @c any_executor.
- typedef bulk_guarantee_t polymorphic_query_result_type;
-
- /// Default constructor.
- constexpr parallel_t();
-
- /// Get the value associated with a property object.
- /**
- * @returns parallel_t();
- */
- static constexpr bulk_guarantee_t value();
- };
-
- /// A special value used for accessing the bulk_guarantee_t::unsequenced_t
- /// property.
- static constexpr unsequenced_t unsequenced;
-
- /// A special value used for accessing the bulk_guarantee_t::sequenced_t
- /// property.
- static constexpr sequenced_t sequenced;
-
- /// A special value used for accessing the bulk_guarantee_t::parallel_t
- /// property.
- static constexpr parallel_t parallel;
-
- /// Default constructor.
- constexpr bulk_guarantee_t();
-
- /// Construct from a sub-property value.
- constexpr bulk_guarantee_t(unsequenced_t);
-
- /// Construct from a sub-property value.
- constexpr bulk_guarantee_t(sequenced_t);
-
- /// Construct from a sub-property value.
- constexpr bulk_guarantee_t(parallel_t);
-
- /// Compare property values for equality.
- friend constexpr bool operator==(
- const bulk_guarantee_t& a, const bulk_guarantee_t& b) noexcept;
-
- /// Compare property values for inequality.
- friend constexpr bool operator!=(
- const bulk_guarantee_t& a, const bulk_guarantee_t& b) noexcept;
-};
-
-/// A special value used for accessing the bulk_guarantee_t property.
-constexpr bulk_guarantee_t bulk_guarantee;
-
-} // namespace execution
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace execution {
-namespace detail {
-namespace bulk_guarantee {
-
-template <int I> struct unsequenced_t;
-template <int I> struct sequenced_t;
-template <int I> struct parallel_t;
-
-} // namespace bulk_guarantee
-
-template <int I = 0>
-struct bulk_guarantee_t
-{
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
- template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
- typedef bulk_guarantee_t polymorphic_query_result_type;
-
- typedef detail::bulk_guarantee::unsequenced_t<I> unsequenced_t;
- typedef detail::bulk_guarantee::sequenced_t<I> sequenced_t;
- typedef detail::bulk_guarantee::parallel_t<I> parallel_t;
-
- ASIO_CONSTEXPR bulk_guarantee_t()
- : value_(-1)
- {
- }
-
- ASIO_CONSTEXPR bulk_guarantee_t(unsequenced_t)
- : value_(0)
- {
- }
-
- ASIO_CONSTEXPR bulk_guarantee_t(sequenced_t)
- : value_(1)
- {
- }
-
- ASIO_CONSTEXPR bulk_guarantee_t(parallel_t)
- : value_(2)
- {
- }
-
- template <typename T>
- struct proxy
- {
-#if defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
- struct type
- {
- template <typename P>
- auto query(ASIO_MOVE_ARG(P) p) const
- noexcept(
- noexcept(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
- )
- )
- -> decltype(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
- );
- };
-#else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
- typedef T type;
-#endif // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
- };
-
- template <typename T>
- struct static_proxy
- {
-#if defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
- struct type
- {
- template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
- noexcept(
- noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
- )
- )
- -> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
- )
- {
- return T::query(ASIO_MOVE_CAST(P)(p));
- }
- };
-#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
- typedef T type;
-#endif // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
- };
-
- template <typename T>
- struct query_member :
- traits::query_member<typename proxy<T>::type, bulk_guarantee_t> {};
-
- template <typename T>
- struct query_static_constexpr_member :
- traits::query_static_constexpr_member<
- typename static_proxy<T>::type, bulk_guarantee_t> {};
-
-#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
- && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
- static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
- {
- return query_static_constexpr_member<T>::value();
- }
-
- template <typename T>
- static ASIO_CONSTEXPR
- typename traits::static_query<T, unsequenced_t>::result_type
- static_query(
- typename enable_if<
- !query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
- !query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
- traits::static_query<T, unsequenced_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
- {
- return traits::static_query<T, unsequenced_t>::value();
- }
-
- template <typename T>
- static ASIO_CONSTEXPR
- typename traits::static_query<T, sequenced_t>::result_type
- static_query(
- typename enable_if<
- !query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
- !query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
- !traits::static_query<T, unsequenced_t>::is_valid
- >::type* = 0,
- typename enable_if<
- traits::static_query<T, sequenced_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
- {
- return traits::static_query<T, sequenced_t>::value();
- }
-
- template <typename T>
- static ASIO_CONSTEXPR
- typename traits::static_query<T, parallel_t>::result_type
- static_query(
- typename enable_if<
- !query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
- !query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
- !traits::static_query<T, unsequenced_t>::is_valid
- >::type* = 0,
- typename enable_if<
- !traits::static_query<T, sequenced_t>::is_valid
- >::type* = 0,
- typename enable_if<
- traits::static_query<T, parallel_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
- {
- return traits::static_query<T, parallel_t>::value();
- }
-
- template <typename E,
- typename T = decltype(bulk_guarantee_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = bulk_guarantee_t::static_query<E>();
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
- // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
- friend ASIO_CONSTEXPR bool operator==(
- const bulk_guarantee_t& a, const bulk_guarantee_t& b)
- {
- return a.value_ == b.value_;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const bulk_guarantee_t& a, const bulk_guarantee_t& b)
- {
- return a.value_ != b.value_;
- }
-
- struct convertible_from_bulk_guarantee_t
- {
- ASIO_CONSTEXPR convertible_from_bulk_guarantee_t(bulk_guarantee_t) {}
- };
-
- template <typename Executor>
- friend ASIO_CONSTEXPR bulk_guarantee_t query(
- const Executor& ex, convertible_from_bulk_guarantee_t,
- typename enable_if<
- can_query<const Executor&, unsequenced_t>::value
- >::type* = 0)
-#if !defined(__clang__) // Clang crashes if noexcept is used here.
-#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&,
- bulk_guarantee_t<>::unsequenced_t>::value))
-#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, unsequenced_t>::value))
-#endif // defined(ASIO_MSVC)
-#endif // !defined(__clang__)
- {
- return asio::query(ex, unsequenced_t());
- }
-
- template <typename Executor>
- friend ASIO_CONSTEXPR bulk_guarantee_t query(
- const Executor& ex, convertible_from_bulk_guarantee_t,
- typename enable_if<
- !can_query<const Executor&, unsequenced_t>::value
- >::type* = 0,
- typename enable_if<
- can_query<const Executor&, sequenced_t>::value
- >::type* = 0)
-#if !defined(__clang__) // Clang crashes if noexcept is used here.
-#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&,
- bulk_guarantee_t<>::sequenced_t>::value))
-#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, sequenced_t>::value))
-#endif // defined(ASIO_MSVC)
-#endif // !defined(__clang__)
- {
- return asio::query(ex, sequenced_t());
- }
-
- template <typename Executor>
- friend ASIO_CONSTEXPR bulk_guarantee_t query(
- const Executor& ex, convertible_from_bulk_guarantee_t,
- typename enable_if<
- !can_query<const Executor&, unsequenced_t>::value
- >::type* = 0,
- typename enable_if<
- !can_query<const Executor&, sequenced_t>::value
- >::type* = 0,
- typename enable_if<
- can_query<const Executor&, parallel_t>::value
- >::type* = 0)
-#if !defined(__clang__) // Clang crashes if noexcept is used here.
-#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, bulk_guarantee_t<>::parallel_t>::value))
-#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, parallel_t>::value))
-#endif // defined(ASIO_MSVC)
-#endif // !defined(__clang__)
- {
- return asio::query(ex, parallel_t());
- }
-
- ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(unsequenced_t, unsequenced);
- ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(sequenced_t, sequenced);
- ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(parallel_t, parallel);
-
-#if !defined(ASIO_HAS_CONSTEXPR)
- static const bulk_guarantee_t instance;
-#endif // !defined(ASIO_HAS_CONSTEXPR)
-
-private:
- int value_;
-};
-
-#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
- && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-template <int I> template <typename E, typename T>
-const T bulk_guarantee_t<I>::static_query_v;
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
- // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
-#if !defined(ASIO_HAS_CONSTEXPR)
-template <int I>
-const bulk_guarantee_t<I> bulk_guarantee_t<I>::instance;
-#endif
-
-template <int I>
-const typename bulk_guarantee_t<I>::unsequenced_t
-bulk_guarantee_t<I>::unsequenced;
-
-template <int I>
-const typename bulk_guarantee_t<I>::sequenced_t
-bulk_guarantee_t<I>::sequenced;
-
-template <int I>
-const typename bulk_guarantee_t<I>::parallel_t
-bulk_guarantee_t<I>::parallel;
-
-namespace bulk_guarantee {
-
-template <int I = 0>
-struct unsequenced_t
-{
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
- template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
- typedef bulk_guarantee_t<I> polymorphic_query_result_type;
-
- ASIO_CONSTEXPR unsequenced_t()
- {
- }
-
- template <typename T>
- struct query_member :
- traits::query_member<
- typename bulk_guarantee_t<I>::template proxy<T>::type,
- unsequenced_t> {};
-
- template <typename T>
- struct query_static_constexpr_member :
- traits::query_static_constexpr_member<
- typename bulk_guarantee_t<I>::template static_proxy<T>::type,
- unsequenced_t> {};
-
-#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
- && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
- static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
- {
- return query_static_constexpr_member<T>::value();
- }
-
- template <typename T>
- static ASIO_CONSTEXPR unsequenced_t static_query(
- typename enable_if<
- !query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
- !query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
- !traits::query_free<T, unsequenced_t>::is_valid
- >::type* = 0,
- typename enable_if<
- !can_query<T, sequenced_t<I> >::value
- >::type* = 0,
- typename enable_if<
- !can_query<T, parallel_t<I> >::value
- >::type* = 0) ASIO_NOEXCEPT
- {
- return unsequenced_t();
- }
-
- template <typename E, typename T = decltype(unsequenced_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = unsequenced_t::static_query<E>();
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
- // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
- static ASIO_CONSTEXPR bulk_guarantee_t<I> value()
- {
- return unsequenced_t();
- }
-
- friend ASIO_CONSTEXPR bool operator==(
- const unsequenced_t&, const unsequenced_t&)
- {
- return true;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const unsequenced_t&, const unsequenced_t&)
- {
- return false;
- }
-
- friend ASIO_CONSTEXPR bool operator==(
- const unsequenced_t&, const sequenced_t<I>&)
- {
- return false;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const unsequenced_t&, const sequenced_t<I>&)
- {
- return true;
- }
-
- friend ASIO_CONSTEXPR bool operator==(
- const unsequenced_t&, const parallel_t<I>&)
- {
- return false;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const unsequenced_t&, const parallel_t<I>&)
- {
- return true;
- }
-};
-
-#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
- && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-template <int I> template <typename E, typename T>
-const T unsequenced_t<I>::static_query_v;
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
- // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
-template <int I = 0>
-struct sequenced_t
-{
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
- template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
- typedef bulk_guarantee_t<I> polymorphic_query_result_type;
-
- ASIO_CONSTEXPR sequenced_t()
- {
- }
-
- template <typename T>
- struct query_member :
- traits::query_member<
- typename bulk_guarantee_t<I>::template proxy<T>::type,
- sequenced_t> {};
-
- template <typename T>
- struct query_static_constexpr_member :
- traits::query_static_constexpr_member<
- typename bulk_guarantee_t<I>::template static_proxy<T>::type,
- sequenced_t> {};
-
-#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
- && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
- static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
- {
- return query_static_constexpr_member<T>::value();
- }
-
- template <typename E, typename T = decltype(sequenced_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = sequenced_t::static_query<E>();
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
- // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
- static ASIO_CONSTEXPR bulk_guarantee_t<I> value()
- {
- return sequenced_t();
- }
-
- friend ASIO_CONSTEXPR bool operator==(
- const sequenced_t&, const sequenced_t&)
- {
- return true;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const sequenced_t&, const sequenced_t&)
- {
- return false;
- }
-
- friend ASIO_CONSTEXPR bool operator==(
- const sequenced_t&, const unsequenced_t<I>&)
- {
- return false;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const sequenced_t&, const unsequenced_t<I>&)
- {
- return true;
- }
-
- friend ASIO_CONSTEXPR bool operator==(
- const sequenced_t&, const parallel_t<I>&)
- {
- return false;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const sequenced_t&, const parallel_t<I>&)
- {
- return true;
- }
-};
-
-#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
- && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-template <int I> template <typename E, typename T>
-const T sequenced_t<I>::static_query_v;
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
- // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
-template <int I>
-struct parallel_t
-{
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
- template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
- typedef bulk_guarantee_t<I> polymorphic_query_result_type;
-
- ASIO_CONSTEXPR parallel_t()
- {
- }
-
- template <typename T>
- struct query_member :
- traits::query_member<
- typename bulk_guarantee_t<I>::template proxy<T>::type,
- parallel_t> {};
-
- template <typename T>
- struct query_static_constexpr_member :
- traits::query_static_constexpr_member<
- typename bulk_guarantee_t<I>::template static_proxy<T>::type,
- parallel_t> {};
-
-#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
- && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
- static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
- {
- return query_static_constexpr_member<T>::value();
- }
-
- template <typename E, typename T = decltype(parallel_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = parallel_t::static_query<E>();
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
- // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
- static ASIO_CONSTEXPR bulk_guarantee_t<I> value()
- {
- return parallel_t();
- }
-
- friend ASIO_CONSTEXPR bool operator==(
- const parallel_t&, const parallel_t&)
- {
- return true;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const parallel_t&, const parallel_t&)
- {
- return false;
- }
-
- friend ASIO_CONSTEXPR bool operator==(
- const parallel_t&, const unsequenced_t<I>&)
- {
- return false;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const parallel_t&, const unsequenced_t<I>&)
- {
- return true;
- }
-
- friend ASIO_CONSTEXPR bool operator==(
- const parallel_t&, const sequenced_t<I>&)
- {
- return false;
- }
-
- friend ASIO_CONSTEXPR bool operator!=(
- const parallel_t&, const sequenced_t<I>&)
- {
- return true;
- }
-};
-
-#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
- && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-template <int I> template <typename E, typename T>
-const T parallel_t<I>::static_query_v;
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
- // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
-} // namespace bulk_guarantee
-} // namespace detail
-
-typedef detail::bulk_guarantee_t<> bulk_guarantee_t;
-
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-constexpr bulk_guarantee_t bulk_guarantee;
-#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-namespace { static const bulk_guarantee_t&
- bulk_guarantee = bulk_guarantee_t::instance; }
-#endif
-
-} // namespace execution
-
-#if !defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T>
-struct is_applicable_property<T, execution::bulk_guarantee_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
-{
-};
-
-template <typename T>
-struct is_applicable_property<T, execution::bulk_guarantee_t::unsequenced_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
-{
-};
-
-template <typename T>
-struct is_applicable_property<T, execution::bulk_guarantee_t::sequenced_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
-{
-};
-
-template <typename T>
-struct is_applicable_property<T, execution::bulk_guarantee_t::parallel_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
-{
-};
-
-#endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
-
-template <typename T>
-struct query_free_default<T, execution::bulk_guarantee_t,
- typename enable_if<
- can_query<T, execution::bulk_guarantee_t::unsequenced_t>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::bulk_guarantee_t::unsequenced_t>::value));
-
- typedef execution::bulk_guarantee_t result_type;
-};
-
-template <typename T>
-struct query_free_default<T, execution::bulk_guarantee_t,
- typename enable_if<
- !can_query<T, execution::bulk_guarantee_t::unsequenced_t>::value
- && can_query<T, execution::bulk_guarantee_t::sequenced_t>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::bulk_guarantee_t::sequenced_t>::value));
-
- typedef execution::bulk_guarantee_t result_type;
-};
-
-template <typename T>
-struct query_free_default<T, execution::bulk_guarantee_t,
- typename enable_if<
- !can_query<T, execution::bulk_guarantee_t::unsequenced_t>::value
- && !can_query<T, execution::bulk_guarantee_t::sequenced_t>::value
- && can_query<T, execution::bulk_guarantee_t::parallel_t>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::bulk_guarantee_t::parallel_t>::value));
-
- typedef execution::bulk_guarantee_t result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
- || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
-template <typename T>
-struct static_query<T, execution::bulk_guarantee_t,
- typename enable_if<
- execution::detail::bulk_guarantee_t<0>::
- query_static_constexpr_member<T>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef typename execution::detail::bulk_guarantee_t<0>::
- query_static_constexpr_member<T>::result_type result_type;
-
- static ASIO_CONSTEXPR result_type value()
- {
- return execution::detail::bulk_guarantee_t<0>::
- query_static_constexpr_member<T>::value();
- }
-};
-
-template <typename T>
-struct static_query<T, execution::bulk_guarantee_t,
- typename enable_if<
- !execution::detail::bulk_guarantee_t<0>::
- query_static_constexpr_member<T>::is_valid
- && !execution::detail::bulk_guarantee_t<0>::
- query_member<T>::is_valid
- && traits::static_query<T,
- execution::bulk_guarantee_t::unsequenced_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef typename traits::static_query<T,
- execution::bulk_guarantee_t::unsequenced_t>::result_type result_type;
-
- static ASIO_CONSTEXPR result_type value()
- {
- return traits::static_query<T,
- execution::bulk_guarantee_t::unsequenced_t>::value();
- }
-};
-
-template <typename T>
-struct static_query<T, execution::bulk_guarantee_t,
- typename enable_if<
- !execution::detail::bulk_guarantee_t<0>::
- query_static_constexpr_member<T>::is_valid
- && !execution::detail::bulk_guarantee_t<0>::
- query_member<T>::is_valid
- && !traits::static_query<T,
- execution::bulk_guarantee_t::unsequenced_t>::is_valid
- && traits::static_query<T,
- execution::bulk_guarantee_t::sequenced_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef typename traits::static_query<T,
- execution::bulk_guarantee_t::sequenced_t>::result_type result_type;
-
- static ASIO_CONSTEXPR result_type value()
- {
- return traits::static_query<T,
- execution::bulk_guarantee_t::sequenced_t>::value();
- }
-};
-
-template <typename T>
-struct static_query<T, execution::bulk_guarantee_t,
- typename enable_if<
- !execution::detail::bulk_guarantee_t<0>::
- query_static_constexpr_member<T>::is_valid
- && !execution::detail::bulk_guarantee_t<0>::
- query_member<T>::is_valid
- && !traits::static_query<T,
- execution::bulk_guarantee_t::unsequenced_t>::is_valid
- && !traits::static_query<T,
- execution::bulk_guarantee_t::sequenced_t>::is_valid
- && traits::static_query<T,
- execution::bulk_guarantee_t::parallel_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef typename traits::static_query<T,
- execution::bulk_guarantee_t::parallel_t>::result_type result_type;
-
- static ASIO_CONSTEXPR result_type value()
- {
- return traits::static_query<T,
- execution::bulk_guarantee_t::parallel_t>::value();
- }
-};
-
-template <typename T>
-struct static_query<T, execution::bulk_guarantee_t::unsequenced_t,
- typename enable_if<
- execution::detail::bulk_guarantee::unsequenced_t<0>::
- query_static_constexpr_member<T>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef typename execution::detail::bulk_guarantee::unsequenced_t<0>::
- query_static_constexpr_member<T>::result_type result_type;
-
- static ASIO_CONSTEXPR result_type value()
- {
- return execution::detail::bulk_guarantee::unsequenced_t<0>::
- query_static_constexpr_member<T>::value();
- }
-};
-
-template <typename T>
-struct static_query<T, execution::bulk_guarantee_t::unsequenced_t,
- typename enable_if<
- !execution::detail::bulk_guarantee::unsequenced_t<0>::
- query_static_constexpr_member<T>::is_valid
- && !execution::detail::bulk_guarantee::unsequenced_t<0>::
- query_member<T>::is_valid
- && !traits::query_free<T,
- execution::bulk_guarantee_t::unsequenced_t>::is_valid
- && !can_query<T, execution::bulk_guarantee_t::sequenced_t>::value
- && !can_query<T, execution::bulk_guarantee_t::parallel_t>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef execution::bulk_guarantee_t::unsequenced_t result_type;
-
- static ASIO_CONSTEXPR result_type value()
- {
- return result_type();
- }
-};
-
-template <typename T>
-struct static_query<T, execution::bulk_guarantee_t::sequenced_t,
- typename enable_if<
- execution::detail::bulk_guarantee::sequenced_t<0>::
- query_static_constexpr_member<T>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef typename execution::detail::bulk_guarantee::sequenced_t<0>::
- query_static_constexpr_member<T>::result_type result_type;
-
- static ASIO_CONSTEXPR result_type value()
- {
- return execution::detail::bulk_guarantee::sequenced_t<0>::
- query_static_constexpr_member<T>::value();
- }
-};
-
-template <typename T>
-struct static_query<T, execution::bulk_guarantee_t::parallel_t,
- typename enable_if<
- execution::detail::bulk_guarantee::parallel_t<0>::
- query_static_constexpr_member<T>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef typename execution::detail::bulk_guarantee::parallel_t<0>::
- query_static_constexpr_member<T>::result_type result_type;
-
- static ASIO_CONSTEXPR result_type value()
- {
- return execution::detail::bulk_guarantee::parallel_t<0>::
- query_static_constexpr_member<T>::value();
- }
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
- // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
-#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
-template <typename T>
-struct static_require<T, execution::bulk_guarantee_t::unsequenced_t,
- typename enable_if<
- static_query<T, execution::bulk_guarantee_t::unsequenced_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::bulk_guarantee_t::unsequenced_t>::result_type,
- execution::bulk_guarantee_t::unsequenced_t>::value));
-};
-
-template <typename T>
-struct static_require<T, execution::bulk_guarantee_t::sequenced_t,
- typename enable_if<
- static_query<T, execution::bulk_guarantee_t::sequenced_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::bulk_guarantee_t::sequenced_t>::result_type,
- execution::bulk_guarantee_t::sequenced_t>::value));
-};
-
-template <typename T>
-struct static_require<T, execution::bulk_guarantee_t::parallel_t,
- typename enable_if<
- static_query<T, execution::bulk_guarantee_t::parallel_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::bulk_guarantee_t::parallel_t>::result_type,
- execution::bulk_guarantee_t::parallel_t>::value));
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
-} // namespace traits
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_BULK_GUARANTEE_HPP
diff --git a/3rdparty/asio/include/asio/execution/connect.hpp b/3rdparty/asio/include/asio/execution/connect.hpp
deleted file mode 100644
index 527f123294f..00000000000
--- a/3rdparty/asio/include/asio/execution/connect.hpp
+++ /dev/null
@@ -1,489 +0,0 @@
-//
-// execution/connect.hpp
-// ~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_CONNECT_HPP
-#define ASIO_EXECUTION_CONNECT_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/detail/as_invocable.hpp"
-#include "asio/execution/detail/as_operation.hpp"
-#include "asio/execution/detail/as_receiver.hpp"
-#include "asio/execution/executor.hpp"
-#include "asio/execution/operation_state.hpp"
-#include "asio/execution/receiver.hpp"
-#include "asio/execution/sender.hpp"
-#include "asio/traits/connect_member.hpp"
-#include "asio/traits/connect_free.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-/// A customisation point that connects a sender to a receiver.
-/**
- * The name <tt>execution::connect</tt> denotes a customisation point object.
- * For some subexpressions <tt>s</tt> and <tt>r</tt>, let <tt>S</tt> be a type
- * such that <tt>decltype((s))</tt> is <tt>S</tt> and let <tt>R</tt> be a type
- * such that <tt>decltype((r))</tt> is <tt>R</tt>. The expression
- * <tt>execution::connect(s, r)</tt> is expression-equivalent to:
- *
- * @li <tt>s.connect(r)</tt>, if that expression is valid, if its type
- * satisfies <tt>operation_state</tt>, and if <tt>S</tt> satisfies
- * <tt>sender</tt>.
- *
- * @li Otherwise, <tt>connect(s, r)</tt>, if that expression is valid, if its
- * type satisfies <tt>operation_state</tt>, and if <tt>S</tt> satisfies
- * <tt>sender</tt>, with overload resolution performed in a context that
- * includes the declaration <tt>void connect();</tt> and that does not include
- * a declaration of <tt>execution::connect</tt>.
- *
- * @li Otherwise, <tt>as_operation{s, r}</tt>, if <tt>r</tt> is not an instance
- * of <tt>as_receiver<F, S></tt> for some type <tt>F</tt>, and if
- * <tt>receiver_of<R> && executor_of<remove_cvref_t<S>,
- * as_invocable<remove_cvref_t<R>, S>></tt> is <tt>true</tt>, where
- * <tt>as_operation</tt> is an implementation-defined class equivalent to
- * @code template <class S, class R>
- * struct as_operation
- * {
- * remove_cvref_t<S> e_;
- * remove_cvref_t<R> r_;
- * void start() noexcept try {
- * execution::execute(std::move(e_),
- * as_invocable<remove_cvref_t<R>, S>{r_});
- * } catch(...) {
- * execution::set_error(std::move(r_), current_exception());
- * }
- * }; @endcode
- * and <tt>as_invocable</tt> is a class template equivalent to the following:
- * @code template<class R>
- * struct as_invocable
- * {
- * R* r_;
- * explicit as_invocable(R& r) noexcept
- * : r_(std::addressof(r)) {}
- * as_invocable(as_invocable && other) noexcept
- * : r_(std::exchange(other.r_, nullptr)) {}
- * ~as_invocable() {
- * if(r_)
- * execution::set_done(std::move(*r_));
- * }
- * void operator()() & noexcept try {
- * execution::set_value(std::move(*r_));
- * r_ = nullptr;
- * } catch(...) {
- * execution::set_error(std::move(*r_), current_exception());
- * r_ = nullptr;
- * }
- * };
- * @endcode
- *
- * @li Otherwise, <tt>execution::connect(s, r)</tt> is ill-formed.
- */
-inline constexpr unspecified connect = unspecified;
-
-/// A type trait that determines whether a @c connect expression is
-/// well-formed.
-/**
- * Class template @c can_connect is a trait that is derived from
- * @c true_type if the expression <tt>execution::connect(std::declval<S>(),
- * std::declval<R>())</tt> is well formed; otherwise @c false_type.
- */
-template <typename S, typename R>
-struct can_connect :
- integral_constant<bool, automatically_determined>
-{
-};
-
-/// A type trait to determine the result of a @c connect expression.
-template <typename S, typename R>
-struct connect_result
-{
- /// The type of the connect expression.
- /**
- * The type of the expression <tt>execution::connect(std::declval<S>(),
- * std::declval<R>())</tt>.
- */
- typedef automatically_determined type;
-};
-
-/// A type alis to determine the result of a @c connect expression.
-template <typename S, typename R>
-using connect_result_t = typename connect_result<S, R>::type;
-
-} // namespace execution
-} // namespace asio
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace asio_execution_connect_fn {
-
-using asio::conditional;
-using asio::declval;
-using asio::enable_if;
-using asio::execution::detail::as_invocable;
-using asio::execution::detail::as_operation;
-using asio::execution::detail::is_as_receiver;
-using asio::execution::is_executor_of;
-using asio::execution::is_operation_state;
-using asio::execution::is_receiver;
-using asio::execution::is_sender;
-using asio::false_type;
-using asio::remove_cvref;
-using asio::traits::connect_free;
-using asio::traits::connect_member;
-
-void connect();
-
-enum overload_type
-{
- call_member,
- call_free,
- adapter,
- ill_formed
-};
-
-template <typename S, typename R, typename = void,
- typename = void, typename = void, typename = void>
-struct call_traits
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename S, typename R>
-struct call_traits<S, void(R),
- typename enable_if<
- connect_member<S, R>::is_valid
- >::type,
- typename enable_if<
- is_operation_state<typename connect_member<S, R>::result_type>::value
- >::type,
- typename enable_if<
- is_sender<typename remove_cvref<S>::type>::value
- >::type> :
- connect_member<S, R>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
-};
-
-template <typename S, typename R>
-struct call_traits<S, void(R),
- typename enable_if<
- !connect_member<S, R>::is_valid
- >::type,
- typename enable_if<
- connect_free<S, R>::is_valid
- >::type,
- typename enable_if<
- is_operation_state<typename connect_free<S, R>::result_type>::value
- >::type,
- typename enable_if<
- is_sender<typename remove_cvref<S>::type>::value
- >::type> :
- connect_free<S, R>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
-};
-
-template <typename S, typename R>
-struct call_traits<S, void(R),
- typename enable_if<
- !connect_member<S, R>::is_valid
- >::type,
- typename enable_if<
- !connect_free<S, R>::is_valid
- >::type,
- typename enable_if<
- is_receiver<R>::value
- >::type,
- typename enable_if<
- conditional<
- !is_as_receiver<
- typename remove_cvref<R>::type
- >::value,
- is_executor_of<
- typename remove_cvref<S>::type,
- as_invocable<typename remove_cvref<R>::type, S>
- >,
- false_type
- >::type::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef as_operation<S, R> result_type;
-};
-
-struct impl
-{
-#if defined(ASIO_HAS_MOVE)
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(R)>::overload == call_member,
- typename call_traits<S, void(R)>::result_type
- >::type
- operator()(S&& s, R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(R)>::is_noexcept))
- {
- return ASIO_MOVE_CAST(S)(s).connect(ASIO_MOVE_CAST(R)(r));
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(R)>::overload == call_free,
- typename call_traits<S, void(R)>::result_type
- >::type
- operator()(S&& s, R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(R)>::is_noexcept))
- {
- return connect(ASIO_MOVE_CAST(S)(s), ASIO_MOVE_CAST(R)(r));
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(R)>::overload == adapter,
- typename call_traits<S, void(R)>::result_type
- >::type
- operator()(S&& s, R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(R)>::is_noexcept))
- {
- return typename call_traits<S, void(R)>::result_type(
- ASIO_MOVE_CAST(S)(s), ASIO_MOVE_CAST(R)(r));
- }
-#else // defined(ASIO_HAS_MOVE)
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(R&)>::overload == call_member,
- typename call_traits<S&, void(R&)>::result_type
- >::type
- operator()(S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(R&)>::is_noexcept))
- {
- return s.connect(r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(R&)>::overload == call_member,
- typename call_traits<const S&, void(R&)>::result_type
- >::type
- operator()(const S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(R&)>::is_noexcept))
- {
- return s.connect(r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(R&)>::overload == call_free,
- typename call_traits<S&, void(R&)>::result_type
- >::type
- operator()(S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(R&)>::is_noexcept))
- {
- return connect(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(R&)>::overload == call_free,
- typename call_traits<const S&, void(R&)>::result_type
- >::type
- operator()(const S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(R&)>::is_noexcept))
- {
- return connect(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(R&)>::overload == adapter,
- typename call_traits<S&, void(R&)>::result_type
- >::type
- operator()(S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(R&)>::is_noexcept))
- {
- return typename call_traits<S&, void(R&)>::result_type(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(R&)>::overload == adapter,
- typename call_traits<const S&, void(R&)>::result_type
- >::type
- operator()(const S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(R&)>::is_noexcept))
- {
- return typename call_traits<const S&, void(R&)>::result_type(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(const R&)>::overload == call_member,
- typename call_traits<S&, void(const R&)>::result_type
- >::type
- operator()(S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(const R&)>::is_noexcept))
- {
- return s.connect(r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(const R&)>::overload == call_member,
- typename call_traits<const S&, void(const R&)>::result_type
- >::type
- operator()(const S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(const R&)>::is_noexcept))
- {
- return s.connect(r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(const R&)>::overload == call_free,
- typename call_traits<S&, void(const R&)>::result_type
- >::type
- operator()(S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(const R&)>::is_noexcept))
- {
- return connect(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(const R&)>::overload == call_free,
- typename call_traits<const S&, void(const R&)>::result_type
- >::type
- operator()(const S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(const R&)>::is_noexcept))
- {
- return connect(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(const R&)>::overload == adapter,
- typename call_traits<S&, void(const R&)>::result_type
- >::type
- operator()(S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(const R&)>::is_noexcept))
- {
- return typename call_traits<S&, void(const R&)>::result_type(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(const R&)>::overload == adapter,
- typename call_traits<const S&, void(const R&)>::result_type
- >::type
- operator()(const S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(const R&)>::is_noexcept))
- {
- return typename call_traits<const S&, void(const R&)>::result_type(s, r);
- }
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-template <typename T = impl>
-struct static_instance
-{
- static const T instance;
-};
-
-template <typename T>
-const T static_instance<T>::instance = {};
-
-} // namespace asio_execution_connect_fn
-namespace asio {
-namespace execution {
-namespace {
-
-static ASIO_CONSTEXPR const asio_execution_connect_fn::impl&
- connect = asio_execution_connect_fn::static_instance<>::instance;
-
-} // namespace
-
-template <typename S, typename R>
-struct can_connect :
- integral_constant<bool,
- asio_execution_connect_fn::call_traits<S, void(R)>::overload !=
- asio_execution_connect_fn::ill_formed>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename R>
-constexpr bool can_connect_v = can_connect<S, R>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename R>
-struct is_nothrow_connect :
- integral_constant<bool,
- asio_execution_connect_fn::call_traits<S, void(R)>::is_noexcept>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename R>
-constexpr bool is_nothrow_connect_v
- = is_nothrow_connect<S, R>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename R>
-struct connect_result
-{
- typedef typename asio_execution_connect_fn::call_traits<
- S, void(R)>::result_type type;
-};
-
-#if defined(ASIO_HAS_ALIAS_TEMPLATES)
-
-template <typename S, typename R>
-using connect_result_t = typename connect_result<S, R>::type;
-
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
-
-} // namespace execution
-} // namespace asio
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_CONNECT_HPP
diff --git a/3rdparty/asio/include/asio/execution/context.hpp b/3rdparty/asio/include/asio/execution/context.hpp
index f751c7a6e65..a9df9c1c4b6 100644
--- a/3rdparty/asio/include/asio/execution/context.hpp
+++ b/3rdparty/asio/include/asio/execution/context.hpp
@@ -2,7 +2,7 @@
// execution/context.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,8 +18,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
#include "asio/is_applicable_property.hpp"
#include "asio/traits/query_static_constexpr_member.hpp"
#include "asio/traits/static_query.hpp"
@@ -40,10 +38,9 @@ namespace execution {
/// with an executor.
struct context_t
{
- /// The context_t property applies to executors, senders, and schedulers.
+ /// The context_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The context_t property cannot be required.
static constexpr bool is_requirable = false;
@@ -70,29 +67,17 @@ struct context_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = false;
+ static constexpr bool is_preferable = false;
#if defined(ASIO_HAS_STD_ANY)
typedef std::any polymorphic_query_result_type;
#endif // defined(ASIO_HAS_STD_ANY)
- ASIO_CONSTEXPR context_t()
+ constexpr context_t()
{
}
@@ -103,17 +88,17 @@ struct context_t
struct type
{
template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
+ static constexpr auto query(P&& p)
noexcept(
noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
)
-> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
{
- return T::query(ASIO_MOVE_CAST(P)(p));
+ return T::query(static_cast<P&&>(p));
}
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
@@ -129,24 +114,17 @@ struct context_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(context_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = context_t::static_query<E>();
+ static constexpr const T static_query_v = context_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
-#if !defined(ASIO_HAS_CONSTEXPR)
- static const context_t instance;
-#endif // !defined(ASIO_HAS_CONSTEXPR)
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -156,20 +134,11 @@ const T context_t<I>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_CONSTEXPR)
-template <int I>
-const context_t<I> context_t<I>::instance;
-#endif
-
} // namespace detail
typedef detail::context_t<> context_t;
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr context_t context;
-#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-namespace { static const context_t& context = context_t::instance; }
-#endif
} // namespace execution
@@ -177,18 +146,7 @@ namespace { static const context_t& context = context_t::instance; }
template <typename T>
struct is_applicable_property<T, execution::context_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
@@ -201,18 +159,18 @@ namespace traits {
template <typename T>
struct static_query<T, execution::context_t,
- typename enable_if<
+ enable_if_t<
execution::detail::context_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::context_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::context_t<0>::
query_static_constexpr_member<T>::value();
diff --git a/3rdparty/asio/include/asio/execution/context_as.hpp b/3rdparty/asio/include/asio/execution/context_as.hpp
index 740918c7993..f51fb1dc4c7 100644
--- a/3rdparty/asio/include/asio/execution/context_as.hpp
+++ b/3rdparty/asio/include/asio/execution/context_as.hpp
@@ -2,7 +2,7 @@
// execution/context_as.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,8 +19,6 @@
#include "asio/detail/type_traits.hpp"
#include "asio/execution/context.hpp"
#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
#include "asio/is_applicable_property.hpp"
#include "asio/query.hpp"
#include "asio/traits/query_static_constexpr_member.hpp"
@@ -39,10 +37,9 @@ namespace execution {
template <typename U>
struct context_as_t
{
- /// The context_as_t property applies to executors, senders, and schedulers.
+ /// The context_as_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The context_t property cannot be required.
static constexpr bool is_requirable = false;
@@ -69,68 +66,53 @@ struct context_as_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename U>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<U>::value
- || conditional<
- is_executor<U>::value,
- false_type,
- is_sender<U>
- >::type::value
- || conditional<
- is_executor<U>::value,
- false_type,
- is_scheduler<U>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<U>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = false;
+ static constexpr bool is_preferable = false;
typedef T polymorphic_query_result_type;
- ASIO_CONSTEXPR context_as_t()
+ constexpr context_as_t()
{
}
- ASIO_CONSTEXPR context_as_t(context_t)
+ constexpr context_as_t(context_t)
{
}
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename E>
- static ASIO_CONSTEXPR
+ static constexpr
typename context_t::query_static_constexpr_member<E>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- context_t::query_static_constexpr_member<E>::is_noexcept))
+ noexcept(context_t::query_static_constexpr_member<E>::is_noexcept)
{
return context_t::query_static_constexpr_member<E>::value();
}
template <typename E, typename U = decltype(context_as_t::static_query<E>())>
- static ASIO_CONSTEXPR const U static_query_v
+ static constexpr const U static_query_v
= context_as_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename Executor, typename U>
- friend ASIO_CONSTEXPR U query(
+ friend constexpr U query(
const Executor& ex, const context_as_t<U>&,
- typename enable_if<
+ enable_if_t<
is_same<T, U>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_query<const Executor&, const context_t&>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, const context_t&>::value))
+ noexcept(is_nothrow_query<const Executor&, const context_t&>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, const context_t&>::value))
+ noexcept(is_nothrow_query<const Executor&, const context_t&>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -145,13 +127,11 @@ const U context_as_t<T>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if (defined(ASIO_HAS_VARIABLE_TEMPLATES) \
- && defined(ASIO_HAS_CONSTEXPR)) \
+#if defined(ASIO_HAS_VARIABLE_TEMPLATES) \
|| defined(GENERATING_DOCUMENTATION)
template <typename T>
constexpr context_as_t<T> context_as{};
-#endif // (defined(ASIO_HAS_VARIABLE_TEMPLATES)
- // && defined(ASIO_HAS_CONSTEXPR))
+#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
// || defined(GENERATING_DOCUMENTATION)
} // namespace execution
@@ -159,19 +139,8 @@ constexpr context_as_t<T> context_as{};
#if !defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T, typename U>
-struct is_applicable_property<T, execution::context_as_t<U> >
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+struct is_applicable_property<T, execution::context_as_t<U>>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
@@ -184,9 +153,9 @@ namespace traits {
template <typename T, typename U>
struct static_query<T, execution::context_as_t<U>,
- typename enable_if<
+ enable_if_t<
static_query<T, execution::context_t>::is_valid
- >::type> : static_query<T, execution::context_t>
+ >> : static_query<T, execution::context_t>
{
};
@@ -197,13 +166,13 @@ struct static_query<T, execution::context_as_t<U>,
template <typename T, typename U>
struct query_free<T, execution::context_as_t<U>,
- typename enable_if<
- can_query<const T&, const execution::context_t&>::value
- >::type>
+ enable_if_t<
+ can_query<const T&, const execution::context_t&>::value
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<const T&, const execution::context_t&>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<const T&, const execution::context_t&>::value;
typedef U result_type;
};
diff --git a/3rdparty/asio/include/asio/execution/detail/as_invocable.hpp b/3rdparty/asio/include/asio/execution/detail/as_invocable.hpp
deleted file mode 100644
index 13b6e44dd23..00000000000
--- a/3rdparty/asio/include/asio/execution/detail/as_invocable.hpp
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// execution/detail/as_invocable.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_DETAIL_AS_INVOCABLE_HPP
-#define ASIO_EXECUTION_DETAIL_AS_INVOCABLE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/atomic_count.hpp"
-#include "asio/detail/memory.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/receiver_invocation_error.hpp"
-#include "asio/execution/set_done.hpp"
-#include "asio/execution/set_error.hpp"
-#include "asio/execution/set_value.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-#if defined(ASIO_HAS_MOVE)
-
-template <typename Receiver, typename>
-struct as_invocable
-{
- Receiver* receiver_;
-
- explicit as_invocable(Receiver& r) ASIO_NOEXCEPT
- : receiver_(asio::detail::addressof(r))
- {
- }
-
- as_invocable(as_invocable&& other) ASIO_NOEXCEPT
- : receiver_(other.receiver_)
- {
- other.receiver_ = 0;
- }
-
- ~as_invocable()
- {
- if (receiver_)
- execution::set_done(ASIO_MOVE_OR_LVALUE(Receiver)(*receiver_));
- }
-
- void operator()() ASIO_LVALUE_REF_QUAL ASIO_NOEXCEPT
- {
-#if !defined(ASIO_NO_EXCEPTIONS)
- try
- {
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- execution::set_value(ASIO_MOVE_CAST(Receiver)(*receiver_));
- receiver_ = 0;
-#if !defined(ASIO_NO_EXCEPTIONS)
- }
- catch (...)
- {
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR)
- execution::set_error(ASIO_MOVE_CAST(Receiver)(*receiver_),
- std::make_exception_ptr(receiver_invocation_error()));
- receiver_ = 0;
-#else // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- std::terminate();
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- }
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- }
-};
-
-#else // defined(ASIO_HAS_MOVE)
-
-template <typename Receiver, typename>
-struct as_invocable
-{
- Receiver* receiver_;
- asio::detail::shared_ptr<asio::detail::atomic_count> ref_count_;
-
- explicit as_invocable(Receiver& r,
- const asio::detail::shared_ptr<
- asio::detail::atomic_count>& c) ASIO_NOEXCEPT
- : receiver_(asio::detail::addressof(r)),
- ref_count_(c)
- {
- }
-
- as_invocable(const as_invocable& other) ASIO_NOEXCEPT
- : receiver_(other.receiver_),
- ref_count_(other.ref_count_)
- {
- ++(*ref_count_);
- }
-
- ~as_invocable()
- {
- if (--(*ref_count_) == 0)
- execution::set_done(*receiver_);
- }
-
- void operator()() ASIO_LVALUE_REF_QUAL ASIO_NOEXCEPT
- {
-#if !defined(ASIO_NO_EXCEPTIONS)
- try
- {
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- execution::set_value(*receiver_);
- ++(*ref_count_);
- }
-#if !defined(ASIO_NO_EXCEPTIONS)
- catch (...)
- {
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR)
- execution::set_error(*receiver_,
- std::make_exception_ptr(receiver_invocation_error()));
- ++(*ref_count_);
-#else // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- std::terminate();
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- }
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- }
-};
-
-#endif // defined(ASIO_HAS_MOVE)
-
-template <typename T>
-struct is_as_invocable : false_type
-{
-};
-
-template <typename Function, typename T>
-struct is_as_invocable<as_invocable<Function, T> > : true_type
-{
-};
-
-} // namespace detail
-} // namespace execution
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_DETAIL_AS_INVOCABLE_HPP
diff --git a/3rdparty/asio/include/asio/execution/detail/as_operation.hpp b/3rdparty/asio/include/asio/execution/detail/as_operation.hpp
deleted file mode 100644
index 565bf3634e6..00000000000
--- a/3rdparty/asio/include/asio/execution/detail/as_operation.hpp
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// execution/detail/as_operation.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_DETAIL_AS_OPERATION_HPP
-#define ASIO_EXECUTION_DETAIL_AS_OPERATION_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/memory.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/detail/as_invocable.hpp"
-#include "asio/execution/execute.hpp"
-#include "asio/execution/set_error.hpp"
-#include "asio/traits/start_member.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-template <typename Executor, typename Receiver>
-struct as_operation
-{
- typename remove_cvref<Executor>::type ex_;
- typename remove_cvref<Receiver>::type receiver_;
-#if !defined(ASIO_HAS_MOVE)
- asio::detail::shared_ptr<asio::detail::atomic_count> ref_count_;
-#endif // !defined(ASIO_HAS_MOVE)
-
- template <typename E, typename R>
- explicit as_operation(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(R) r)
- : ex_(ASIO_MOVE_CAST(E)(e)),
- receiver_(ASIO_MOVE_CAST(R)(r))
-#if !defined(ASIO_HAS_MOVE)
- , ref_count_(new asio::detail::atomic_count(1))
-#endif // !defined(ASIO_HAS_MOVE)
- {
- }
-
- void start() ASIO_NOEXCEPT
- {
-#if !defined(ASIO_NO_EXCEPTIONS)
- try
- {
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- execution::execute(
- ASIO_MOVE_CAST(typename remove_cvref<Executor>::type)(ex_),
- as_invocable<typename remove_cvref<Receiver>::type,
- Executor>(receiver_
-#if !defined(ASIO_HAS_MOVE)
- , ref_count_
-#endif // !defined(ASIO_HAS_MOVE)
- ));
-#if !defined(ASIO_NO_EXCEPTIONS)
- }
- catch (...)
- {
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR)
- execution::set_error(
- ASIO_MOVE_OR_LVALUE(
- typename remove_cvref<Receiver>::type)(
- receiver_),
- std::current_exception());
-#else // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- std::terminate();
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- }
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- }
-};
-
-} // namespace detail
-} // namespace execution
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <typename Executor, typename Receiver>
-struct start_member<
- asio::execution::detail::as_operation<Executor, Receiver> >
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_DETAIL_AS_OPERATION_HPP
diff --git a/3rdparty/asio/include/asio/execution/detail/as_receiver.hpp b/3rdparty/asio/include/asio/execution/detail/as_receiver.hpp
deleted file mode 100644
index a10bdc7f9b4..00000000000
--- a/3rdparty/asio/include/asio/execution/detail/as_receiver.hpp
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// execution/detail/as_receiver.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_DETAIL_AS_RECEIVER_HPP
-#define ASIO_EXECUTION_DETAIL_AS_RECEIVER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/traits/set_done_member.hpp"
-#include "asio/traits/set_error_member.hpp"
-#include "asio/traits/set_value_member.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-template <typename Function, typename>
-struct as_receiver
-{
- Function f_;
-
- template <typename F>
- explicit as_receiver(ASIO_MOVE_ARG(F) f, int)
- : f_(ASIO_MOVE_CAST(F)(f))
- {
- }
-
-#if defined(ASIO_MSVC) && defined(ASIO_HAS_MOVE)
- as_receiver(as_receiver&& other)
- : f_(ASIO_MOVE_CAST(Function)(other.f_))
- {
- }
-#endif // defined(ASIO_MSVC) && defined(ASIO_HAS_MOVE)
-
- void set_value()
- ASIO_NOEXCEPT_IF(noexcept(declval<Function&>()()))
- {
- f_();
- }
-
- template <typename E>
- void set_error(E) ASIO_NOEXCEPT
- {
- std::terminate();
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-};
-
-template <typename T>
-struct is_as_receiver : false_type
-{
-};
-
-template <typename Function, typename T>
-struct is_as_receiver<as_receiver<Function, T> > : true_type
-{
-};
-
-} // namespace detail
-} // namespace execution
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-template <typename Function, typename T>
-struct set_value_member<
- asio::execution::detail::as_receiver<Function, T>, void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-#if defined(ASIO_HAS_NOEXCEPT)
- ASIO_STATIC_CONSTEXPR(bool,
- is_noexcept = noexcept(declval<Function&>()()));
-#else // defined(ASIO_HAS_NOEXCEPT)
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-#endif // defined(ASIO_HAS_NOEXCEPT)
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename Function, typename T, typename E>
-struct set_error_member<
- asio::execution::detail::as_receiver<Function, T>, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <typename Function, typename T>
-struct set_done_member<
- asio::execution::detail::as_receiver<Function, T> >
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_DETAIL_AS_RECEIVER_HPP
diff --git a/3rdparty/asio/include/asio/execution/detail/bulk_sender.hpp b/3rdparty/asio/include/asio/execution/detail/bulk_sender.hpp
deleted file mode 100644
index 0e4e5c12d5b..00000000000
--- a/3rdparty/asio/include/asio/execution/detail/bulk_sender.hpp
+++ /dev/null
@@ -1,261 +0,0 @@
-//
-// execution/detail/bulk_sender.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_DETAIL_BULK_SENDER_HPP
-#define ASIO_EXECUTION_DETAIL_BULK_SENDER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/connect.hpp"
-#include "asio/execution/executor.hpp"
-#include "asio/execution/set_done.hpp"
-#include "asio/execution/set_error.hpp"
-#include "asio/traits/connect_member.hpp"
-#include "asio/traits/set_done_member.hpp"
-#include "asio/traits/set_error_member.hpp"
-#include "asio/traits/set_value_member.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-template <typename Receiver, typename Function, typename Number, typename Index>
-struct bulk_receiver
-{
- typename remove_cvref<Receiver>::type receiver_;
- typename decay<Function>::type f_;
- typename decay<Number>::type n_;
-
- template <typename R, typename F, typename N>
- explicit bulk_receiver(ASIO_MOVE_ARG(R) r,
- ASIO_MOVE_ARG(F) f, ASIO_MOVE_ARG(N) n)
- : receiver_(ASIO_MOVE_CAST(R)(r)),
- f_(ASIO_MOVE_CAST(F)(f)),
- n_(ASIO_MOVE_CAST(N)(n))
- {
- }
-
- void set_value()
- {
- for (Index i = 0; i < n_; ++i)
- f_(i);
-
- execution::set_value(
- ASIO_MOVE_OR_LVALUE(
- typename remove_cvref<Receiver>::type)(receiver_));
- }
-
- template <typename Error>
- void set_error(ASIO_MOVE_ARG(Error) e) ASIO_NOEXCEPT
- {
- execution::set_error(
- ASIO_MOVE_OR_LVALUE(
- typename remove_cvref<Receiver>::type)(receiver_),
- ASIO_MOVE_CAST(Error)(e));
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- execution::set_done(
- ASIO_MOVE_OR_LVALUE(
- typename remove_cvref<Receiver>::type)(receiver_));
- }
-};
-
-template <typename Sender, typename Receiver,
- typename Function, typename Number>
-struct bulk_receiver_traits
-{
- typedef bulk_receiver<
- Receiver, Function, Number,
- typename execution::executor_index<
- typename remove_cvref<Sender>::type
- >::type
- > type;
-
-#if defined(ASIO_HAS_MOVE)
- typedef type arg_type;
-#else // defined(ASIO_HAS_MOVE)
- typedef const type& arg_type;
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-template <typename Sender, typename Function, typename Number>
-struct bulk_sender : sender_base
-{
- typename remove_cvref<Sender>::type sender_;
- typename decay<Function>::type f_;
- typename decay<Number>::type n_;
-
- template <typename S, typename F, typename N>
- explicit bulk_sender(ASIO_MOVE_ARG(S) s,
- ASIO_MOVE_ARG(F) f, ASIO_MOVE_ARG(N) n)
- : sender_(ASIO_MOVE_CAST(S)(s)),
- f_(ASIO_MOVE_CAST(F)(f)),
- n_(ASIO_MOVE_CAST(N)(n))
- {
- }
-
- template <typename Receiver>
- typename connect_result<
- ASIO_MOVE_OR_LVALUE_TYPE(typename remove_cvref<Sender>::type),
- typename bulk_receiver_traits<
- Sender, Receiver, Function, Number
- >::arg_type
- >::type connect(ASIO_MOVE_ARG(Receiver) r,
- typename enable_if<
- can_connect<
- typename remove_cvref<Sender>::type,
- typename bulk_receiver_traits<
- Sender, Receiver, Function, Number
- >::arg_type
- >::value
- >::type* = 0) ASIO_RVALUE_REF_QUAL ASIO_NOEXCEPT
- {
- return execution::connect(
- ASIO_MOVE_OR_LVALUE(typename remove_cvref<Sender>::type)(sender_),
- typename bulk_receiver_traits<Sender, Receiver, Function, Number>::type(
- ASIO_MOVE_CAST(Receiver)(r),
- ASIO_MOVE_CAST(typename decay<Function>::type)(f_),
- ASIO_MOVE_CAST(typename decay<Number>::type)(n_)));
- }
-
- template <typename Receiver>
- typename connect_result<
- const typename remove_cvref<Sender>::type&,
- typename bulk_receiver_traits<
- Sender, Receiver, Function, Number
- >::arg_type
- >::type connect(ASIO_MOVE_ARG(Receiver) r,
- typename enable_if<
- can_connect<
- const typename remove_cvref<Sender>::type&,
- typename bulk_receiver_traits<
- Sender, Receiver, Function, Number
- >::arg_type
- >::value
- >::type* = 0) const ASIO_LVALUE_REF_QUAL ASIO_NOEXCEPT
- {
- return execution::connect(sender_,
- typename bulk_receiver_traits<Sender, Receiver, Function, Number>::type(
- ASIO_MOVE_CAST(Receiver)(r), f_, n_));
- }
-};
-
-} // namespace detail
-} // namespace execution
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-template <typename Receiver, typename Function, typename Number, typename Index>
-struct set_value_member<
- execution::detail::bulk_receiver<Receiver, Function, Number, Index>,
- void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename Receiver, typename Function,
- typename Number, typename Index, typename Error>
-struct set_error_member<
- execution::detail::bulk_receiver<Receiver, Function, Number, Index>,
- Error>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <typename Receiver, typename Function, typename Number, typename Index>
-struct set_done_member<
- execution::detail::bulk_receiver<Receiver, Function, Number, Index> >
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename Sender, typename Function,
- typename Number, typename Receiver>
-struct connect_member<
- execution::detail::bulk_sender<Sender, Function, Number>,
- Receiver,
- typename enable_if<
- execution::can_connect<
- ASIO_MOVE_OR_LVALUE_TYPE(typename remove_cvref<Sender>::type),
- typename execution::detail::bulk_receiver_traits<
- Sender, Receiver, Function, Number
- >::arg_type
- >::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef typename execution::connect_result<
- ASIO_MOVE_OR_LVALUE_TYPE(typename remove_cvref<Sender>::type),
- typename execution::detail::bulk_receiver_traits<
- Sender, Receiver, Function, Number
- >::arg_type
- >::type result_type;
-};
-
-template <typename Sender, typename Function,
- typename Number, typename Receiver>
-struct connect_member<
- const execution::detail::bulk_sender<Sender, Function, Number>,
- Receiver,
- typename enable_if<
- execution::can_connect<
- const typename remove_cvref<Sender>::type&,
- typename execution::detail::bulk_receiver_traits<
- Sender, Receiver, Function, Number
- >::arg_type
- >::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef typename execution::connect_result<
- const typename remove_cvref<Sender>::type&,
- typename execution::detail::bulk_receiver_traits<
- Sender, Receiver, Function, Number
- >::arg_type
- >::type result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_DETAIL_BULK_SENDER_HPP
diff --git a/3rdparty/asio/include/asio/execution/detail/submit_receiver.hpp b/3rdparty/asio/include/asio/execution/detail/submit_receiver.hpp
deleted file mode 100644
index 6faa119d224..00000000000
--- a/3rdparty/asio/include/asio/execution/detail/submit_receiver.hpp
+++ /dev/null
@@ -1,233 +0,0 @@
-//
-// execution/detail/submit_receiver.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_DETAIL_SUBMIT_RECEIVER_HPP
-#define ASIO_EXECUTION_DETAIL_SUBMIT_RECEIVER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
-#include "asio/execution/connect.hpp"
-#include "asio/execution/receiver.hpp"
-#include "asio/execution/set_done.hpp"
-#include "asio/execution/set_error.hpp"
-#include "asio/execution/set_value.hpp"
-#include "asio/traits/set_done_member.hpp"
-#include "asio/traits/set_error_member.hpp"
-#include "asio/traits/set_value_member.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-template <typename Sender, typename Receiver>
-struct submit_receiver;
-
-template <typename Sender, typename Receiver>
-struct submit_receiver_wrapper
-{
- submit_receiver<Sender, Receiver>* p_;
-
- explicit submit_receiver_wrapper(submit_receiver<Sender, Receiver>* p)
- : p_(p)
- {
- }
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename... Args>
- typename enable_if<is_receiver_of<Receiver, Args...>::value>::type
- set_value(ASIO_MOVE_ARG(Args)... args) ASIO_RVALUE_REF_QUAL
- ASIO_NOEXCEPT_IF((is_nothrow_receiver_of<Receiver, Args...>::value))
- {
- execution::set_value(
- ASIO_MOVE_OR_LVALUE(
- typename remove_cvref<Receiver>::type)(p_->r_),
- ASIO_MOVE_CAST(Args)(args)...);
- delete p_;
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- void set_value() ASIO_RVALUE_REF_QUAL
- ASIO_NOEXCEPT_IF((is_nothrow_receiver_of<Receiver>::value))
- {
- execution::set_value(
- ASIO_MOVE_OR_LVALUE(
- typename remove_cvref<Receiver>::type)(p_->r_));
- delete p_;
- }
-
-#define ASIO_PRIVATE_SUBMIT_RECEIVER_SET_VALUE_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- typename enable_if<is_receiver_of<Receiver, \
- ASIO_VARIADIC_TARGS(n)>::value>::type \
- set_value(ASIO_VARIADIC_MOVE_PARAMS(n)) ASIO_RVALUE_REF_QUAL \
- ASIO_NOEXCEPT_IF((is_nothrow_receiver_of< \
- Receiver, ASIO_VARIADIC_TARGS(n)>::value)) \
- { \
- execution::set_value( \
- ASIO_MOVE_OR_LVALUE( \
- typename remove_cvref<Receiver>::type)(p_->r_), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- delete p_; \
- } \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SUBMIT_RECEIVER_SET_VALUE_DEF)
-#undef ASIO_PRIVATE_SUBMIT_RECEIVER_SET_VALUE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e)
- ASIO_RVALUE_REF_QUAL ASIO_NOEXCEPT
- {
- execution::set_error(
- ASIO_MOVE_OR_LVALUE(
- typename remove_cvref<Receiver>::type)(p_->r_),
- ASIO_MOVE_CAST(E)(e));
- delete p_;
- }
-
- void set_done() ASIO_RVALUE_REF_QUAL ASIO_NOEXCEPT
- {
- execution::set_done(
- ASIO_MOVE_OR_LVALUE(
- typename remove_cvref<Receiver>::type)(p_->r_));
- delete p_;
- }
-};
-
-template <typename Sender, typename Receiver>
-struct submit_receiver
-{
- typename remove_cvref<Receiver>::type r_;
-#if defined(ASIO_HAS_MOVE)
- typename connect_result<Sender,
- submit_receiver_wrapper<Sender, Receiver> >::type state_;
-#else // defined(ASIO_HAS_MOVE)
- typename connect_result<Sender,
- const submit_receiver_wrapper<Sender, Receiver>& >::type state_;
-#endif // defined(ASIO_HAS_MOVE)
-
-#if defined(ASIO_HAS_MOVE)
- template <typename S, typename R>
- explicit submit_receiver(ASIO_MOVE_ARG(S) s, ASIO_MOVE_ARG(R) r)
- : r_(ASIO_MOVE_CAST(R)(r)),
- state_(execution::connect(ASIO_MOVE_CAST(S)(s),
- submit_receiver_wrapper<Sender, Receiver>(this)))
- {
- }
-#else // defined(ASIO_HAS_MOVE)
- explicit submit_receiver(Sender s, Receiver r)
- : r_(r),
- state_(execution::connect(s,
- submit_receiver_wrapper<Sender, Receiver>(this)))
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-} // namespace detail
-} // namespace execution
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename Sender, typename Receiver, typename... Args>
-struct set_value_member<
- asio::execution::detail::submit_receiver_wrapper<
- Sender, Receiver>,
- void(Args...)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (asio::execution::is_nothrow_receiver_of<Receiver, Args...>::value));
- typedef void result_type;
-};
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename Sender, typename Receiver>
-struct set_value_member<
- asio::execution::detail::submit_receiver_wrapper<
- Sender, Receiver>,
- void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- asio::execution::is_nothrow_receiver_of<Receiver>::value);
- typedef void result_type;
-};
-
-#define ASIO_PRIVATE_SUBMIT_RECEIVER_TRAIT_DEF(n) \
- template <typename Sender, typename Receiver, \
- ASIO_VARIADIC_TPARAMS(n)> \
- struct set_value_member< \
- asio::execution::detail::submit_receiver_wrapper< \
- Sender, Receiver>, \
- void(ASIO_VARIADIC_TARGS(n))> \
- { \
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true); \
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = \
- (asio::execution::is_nothrow_receiver_of<Receiver, \
- ASIO_VARIADIC_TARGS(n)>::value)); \
- typedef void result_type; \
- }; \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SUBMIT_RECEIVER_TRAIT_DEF)
-#undef ASIO_PRIVATE_SUBMIT_RECEIVER_TRAIT_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename Sender, typename Receiver, typename E>
-struct set_error_member<
- asio::execution::detail::submit_receiver_wrapper<
- Sender, Receiver>, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <typename Sender, typename Receiver>
-struct set_done_member<
- asio::execution::detail::submit_receiver_wrapper<
- Sender, Receiver> >
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_DETAIL_SUBMIT_RECEIVER_HPP
diff --git a/3rdparty/asio/include/asio/execution/detail/void_receiver.hpp b/3rdparty/asio/include/asio/execution/detail/void_receiver.hpp
deleted file mode 100644
index fb2d53f58ee..00000000000
--- a/3rdparty/asio/include/asio/execution/detail/void_receiver.hpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// execution/detail/void_receiver.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_DETAIL_VOID_RECEIVER_HPP
-#define ASIO_EXECUTION_DETAIL_VOID_RECEIVER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/traits/set_done_member.hpp"
-#include "asio/traits/set_error_member.hpp"
-#include "asio/traits/set_value_member.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-struct void_receiver
-{
- void set_value() ASIO_NOEXCEPT
- {
- }
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E)) ASIO_NOEXCEPT
- {
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-};
-
-} // namespace detail
-} // namespace execution
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-template <>
-struct set_value_member<asio::execution::detail::void_receiver, void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename E>
-struct set_error_member<asio::execution::detail::void_receiver, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_done_member<asio::execution::detail::void_receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_DETAIL_VOID_RECEIVER_HPP
diff --git a/3rdparty/asio/include/asio/execution/execute.hpp b/3rdparty/asio/include/asio/execution/execute.hpp
deleted file mode 100644
index 54eb31bebab..00000000000
--- a/3rdparty/asio/include/asio/execution/execute.hpp
+++ /dev/null
@@ -1,283 +0,0 @@
-//
-// execution/execute.hpp
-// ~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_EXECUTE_HPP
-#define ASIO_EXECUTION_EXECUTE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/detail/as_invocable.hpp"
-#include "asio/execution/detail/as_receiver.hpp"
-#include "asio/traits/execute_member.hpp"
-#include "asio/traits/execute_free.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-/// A customisation point that executes a function on an executor.
-/**
- * The name <tt>execution::execute</tt> denotes a customisation point object.
- *
- * For some subexpressions <tt>e</tt> and <tt>f</tt>, let <tt>E</tt> be a type
- * such that <tt>decltype((e))</tt> is <tt>E</tt> and let <tt>F</tt> be a type
- * such that <tt>decltype((f))</tt> is <tt>F</tt>. The expression
- * <tt>execution::execute(e, f)</tt> is ill-formed if <tt>F</tt> does not model
- * <tt>invocable</tt>, or if <tt>E</tt> does not model either <tt>executor</tt>
- * or <tt>sender</tt>. Otherwise, it is expression-equivalent to:
- *
- * @li <tt>e.execute(f)</tt>, if that expression is valid. If the function
- * selected does not execute the function object <tt>f</tt> on the executor
- * <tt>e</tt>, the program is ill-formed with no diagnostic required.
- *
- * @li Otherwise, <tt>execute(e, f)</tt>, if that expression is valid, with
- * overload resolution performed in a context that includes the declaration
- * <tt>void execute();</tt> and that does not include a declaration of
- * <tt>execution::execute</tt>. If the function selected by overload
- * resolution does not execute the function object <tt>f</tt> on the executor
- * <tt>e</tt>, the program is ill-formed with no diagnostic required.
- */
-inline constexpr unspecified execute = unspecified;
-
-/// A type trait that determines whether a @c execute expression is well-formed.
-/**
- * Class template @c can_execute is a trait that is derived from
- * @c true_type if the expression <tt>execution::execute(std::declval<T>(),
- * std::declval<F>())</tt> is well formed; otherwise @c false_type.
- */
-template <typename T, typename F>
-struct can_execute :
- integral_constant<bool, automatically_determined>
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-template <typename T, typename R>
-struct is_sender_to;
-
-namespace detail {
-
-template <typename S, typename R>
-void submit_helper(ASIO_MOVE_ARG(S) s, ASIO_MOVE_ARG(R) r);
-
-} // namespace detail
-} // namespace execution
-} // namespace asio
-namespace asio_execution_execute_fn {
-
-using asio::conditional;
-using asio::decay;
-using asio::declval;
-using asio::enable_if;
-using asio::execution::detail::as_receiver;
-using asio::execution::detail::is_as_invocable;
-using asio::execution::is_sender_to;
-using asio::false_type;
-using asio::result_of;
-using asio::traits::execute_free;
-using asio::traits::execute_member;
-using asio::true_type;
-using asio::void_type;
-
-void execute();
-
-enum overload_type
-{
- call_member,
- call_free,
- adapter,
- ill_formed
-};
-
-template <typename Impl, typename T, typename F, typename = void,
- typename = void, typename = void, typename = void, typename = void>
-struct call_traits
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
-};
-
-template <typename Impl, typename T, typename F>
-struct call_traits<Impl, T, void(F),
- typename enable_if<
- execute_member<typename Impl::template proxy<T>::type, F>::is_valid
- >::type> :
- execute_member<typename Impl::template proxy<T>::type, F>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
-};
-
-template <typename Impl, typename T, typename F>
-struct call_traits<Impl, T, void(F),
- typename enable_if<
- !execute_member<typename Impl::template proxy<T>, F>::is_valid
- >::type,
- typename enable_if<
- execute_free<T, F>::is_valid
- >::type> :
- execute_free<T, F>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
-};
-
-template <typename Impl, typename T, typename F>
-struct call_traits<Impl, T, void(F),
- typename enable_if<
- !execute_member<typename Impl::template proxy<T>::type, F>::is_valid
- >::type,
- typename enable_if<
- !execute_free<T, F>::is_valid
- >::type,
- typename void_type<
- typename result_of<typename decay<F>::type&()>::type
- >::type,
- typename enable_if<
- !is_as_invocable<typename decay<F>::type>::value
- >::type,
- typename enable_if<
- is_sender_to<T, as_receiver<typename decay<F>::type, T> >::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter);
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-struct impl
-{
- template <typename T>
- struct proxy
- {
-#if defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
- struct type
- {
- template <typename F>
- auto execute(ASIO_MOVE_ARG(F) f)
- noexcept(
- noexcept(
- declval<typename conditional<true, T, F>::type>().execute(
- ASIO_MOVE_CAST(F)(f))
- )
- )
- -> decltype(
- declval<typename conditional<true, T, F>::type>().execute(
- ASIO_MOVE_CAST(F)(f))
- );
- };
-#else // defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
- typedef T type;
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
- };
-
- template <typename T, typename F>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<impl, T, void(F)>::overload == call_member,
- typename call_traits<impl, T, void(F)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(F) f) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(F)>::is_noexcept))
- {
- return ASIO_MOVE_CAST(T)(t).execute(ASIO_MOVE_CAST(F)(f));
- }
-
- template <typename T, typename F>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<impl, T, void(F)>::overload == call_free,
- typename call_traits<impl, T, void(F)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(F) f) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(F)>::is_noexcept))
- {
- return execute(ASIO_MOVE_CAST(T)(t), ASIO_MOVE_CAST(F)(f));
- }
-
- template <typename T, typename F>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<impl, T, void(F)>::overload == adapter,
- typename call_traits<impl, T, void(F)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(F) f) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(F)>::is_noexcept))
- {
- return asio::execution::detail::submit_helper(
- ASIO_MOVE_CAST(T)(t),
- as_receiver<typename decay<F>::type, T>(
- ASIO_MOVE_CAST(F)(f), 0));
- }
-};
-
-template <typename T = impl>
-struct static_instance
-{
- static const T instance;
-};
-
-template <typename T>
-const T static_instance<T>::instance = {};
-
-} // namespace asio_execution_execute_fn
-namespace asio {
-namespace execution {
-namespace {
-
-static ASIO_CONSTEXPR const asio_execution_execute_fn::impl&
- execute = asio_execution_execute_fn::static_instance<>::instance;
-
-} // namespace
-
-typedef asio_execution_execute_fn::impl execute_t;
-
-template <typename T, typename F>
-struct can_execute :
- integral_constant<bool,
- asio_execution_execute_fn::call_traits<
- execute_t, T, void(F)>::overload !=
- asio_execution_execute_fn::ill_formed>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T, typename F>
-constexpr bool can_execute_v = can_execute<T, F>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-} // namespace execution
-} // namespace asio
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_EXECUTE_HPP
diff --git a/3rdparty/asio/include/asio/execution/executor.hpp b/3rdparty/asio/include/asio/execution/executor.hpp
index 7e05d5a0f8c..1f34981fa78 100644
--- a/3rdparty/asio/include/asio/execution/executor.hpp
+++ b/3rdparty/asio/include/asio/execution/executor.hpp
@@ -2,7 +2,7 @@
// execution/executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,16 +17,14 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/execution/execute.hpp"
#include "asio/execution/invocable_archetype.hpp"
#include "asio/traits/equality_comparable.hpp"
+#include "asio/traits/execute_member.hpp"
-#if defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT) \
- && defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) \
+#if defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) \
&& defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
# define ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT 1
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT)
- // && defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
+#endif // defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
// && defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#include "asio/detail/push_options.hpp"
@@ -44,72 +42,33 @@ struct is_executor_of_impl : false_type
template <typename T, typename F>
struct is_executor_of_impl<T, F,
- typename enable_if<
- can_execute<typename add_const<T>::type, F>::value
- >::type,
- typename void_type<
- typename result_of<typename decay<F>::type&()>::type
- >::type,
- typename enable_if<
- is_constructible<typename decay<F>::type, F>::value
- >::type,
- typename enable_if<
- is_move_constructible<typename decay<F>::type>::value
- >::type,
-#if defined(ASIO_HAS_NOEXCEPT)
- typename enable_if<
+ enable_if_t<
+ traits::execute_member<add_const_t<T>, F>::is_valid
+ >,
+ void_t<
+ result_of_t<decay_t<F>&()>
+ >,
+ enable_if_t<
+ is_constructible<decay_t<F>, F>::value
+ >,
+ enable_if_t<
+ is_move_constructible<decay_t<F>>::value
+ >,
+ enable_if_t<
is_nothrow_copy_constructible<T>::value
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
is_nothrow_destructible<T>::value
- >::type,
-#else // defined(ASIO_HAS_NOEXCEPT)
- typename enable_if<
- is_copy_constructible<T>::value
- >::type,
- typename enable_if<
- is_destructible<T>::value
- >::type,
-#endif // defined(ASIO_HAS_NOEXCEPT)
- typename enable_if<
+ >,
+ enable_if_t<
traits::equality_comparable<T>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
traits::equality_comparable<T>::is_noexcept
- >::type> : true_type
+ >> : true_type
{
};
-template <typename T, typename = void>
-struct executor_shape
-{
- typedef std::size_t type;
-};
-
-template <typename T>
-struct executor_shape<T,
- typename void_type<
- typename T::shape_type
- >::type>
-{
- typedef typename T::shape_type type;
-};
-
-template <typename T, typename Default, typename = void>
-struct executor_index
-{
- typedef Default type;
-};
-
-template <typename T, typename Default>
-struct executor_index<T, Default,
- typename void_type<
- typename T::index_type
- >::type>
-{
- typedef typename T::index_type type;
-};
-
} // namespace detail
/// The is_executor trait detects whether a type T satisfies the
@@ -132,7 +91,7 @@ struct is_executor :
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
-ASIO_CONSTEXPR const bool is_executor_v = is_executor<T>::value;
+constexpr const bool is_executor_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
@@ -149,101 +108,6 @@ ASIO_CONCEPT executor = is_executor<T>::value;
#endif // defined(ASIO_HAS_CONCEPTS)
-/// The is_executor_of trait detects whether a type T satisfies the
-/// execution::executor_of concept for some set of value arguments.
-/**
- * Class template @c is_executor_of is a type trait that is derived from @c
- * true_type if the type @c T meets the concept definition for an executor
- * that is invocable with a function object of type @c F, otherwise @c
- * false_type.
- */
-template <typename T, typename F>
-struct is_executor_of :
-#if defined(GENERATING_DOCUMENTATION)
- integral_constant<bool, automatically_determined>
-#else // defined(GENERATING_DOCUMENTATION)
- integral_constant<bool,
- is_executor<T>::value && detail::is_executor_of_impl<T, F>::value
- >
-#endif // defined(GENERATING_DOCUMENTATION)
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T, typename F>
-ASIO_CONSTEXPR const bool is_executor_of_v =
- is_executor_of<T, F>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#if defined(ASIO_HAS_CONCEPTS)
-
-template <typename T, typename F>
-ASIO_CONCEPT executor_of = is_executor_of<T, F>::value;
-
-#define ASIO_EXECUTION_EXECUTOR_OF(f) \
- ::asio::execution::executor_of<f>
-
-#else // defined(ASIO_HAS_CONCEPTS)
-
-#define ASIO_EXECUTION_EXECUTOR_OF typename
-
-#endif // defined(ASIO_HAS_CONCEPTS)
-
-/// The executor_shape trait detects the type used by an executor to represent
-/// the shape of a bulk operation.
-/**
- * Class template @c executor_shape is a type trait with a nested type alias
- * @c type whose type is @c T::shape_type if @c T::shape_type is valid,
- * otherwise @c std::size_t.
- */
-template <typename T>
-struct executor_shape
-#if !defined(GENERATING_DOCUMENTATION)
- : detail::executor_shape<T>
-#endif // !defined(GENERATING_DOCUMENTATION)
-{
-#if defined(GENERATING_DOCUMENTATION)
- /// @c T::shape_type if @c T::shape_type is valid, otherwise @c std::size_t.
- typedef automatically_determined type;
-#endif // defined(GENERATING_DOCUMENTATION)
-};
-
-#if defined(ASIO_HAS_ALIAS_TEMPLATES)
-
-template <typename T>
-using executor_shape_t = typename executor_shape<T>::type;
-
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
-
-/// The executor_index trait detects the type used by an executor to represent
-/// an index within a bulk operation.
-/**
- * Class template @c executor_index is a type trait with a nested type alias
- * @c type whose type is @c T::index_type if @c T::index_type is valid,
- * otherwise @c executor_shape_t<T>.
- */
-template <typename T>
-struct executor_index
-#if !defined(GENERATING_DOCUMENTATION)
- : detail::executor_index<T, typename executor_shape<T>::type>
-#endif // !defined(GENERATING_DOCUMENTATION)
-{
-#if defined(GENERATING_DOCUMENTATION)
- /// @c T::index_type if @c T::index_type is valid, otherwise
- /// @c executor_shape_t<T>.
- typedef automatically_determined type;
-#endif // defined(GENERATING_DOCUMENTATION)
-};
-
-#if defined(ASIO_HAS_ALIAS_TEMPLATES)
-
-template <typename T>
-using executor_index_t = typename executor_index<T>::type;
-
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
-
} // namespace execution
} // namespace asio
diff --git a/3rdparty/asio/include/asio/execution/impl/bad_executor.ipp b/3rdparty/asio/include/asio/execution/impl/bad_executor.ipp
index 7505e5c85c1..4e185acb059 100644
--- a/3rdparty/asio/include/asio/execution/impl/bad_executor.ipp
+++ b/3rdparty/asio/include/asio/execution/impl/bad_executor.ipp
@@ -2,7 +2,7 @@
// exection/impl/bad_executor.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,11 +23,11 @@
namespace asio {
namespace execution {
-bad_executor::bad_executor() ASIO_NOEXCEPT
+bad_executor::bad_executor() noexcept
{
}
-const char* bad_executor::what() const ASIO_NOEXCEPT_OR_NOTHROW
+const char* bad_executor::what() const noexcept
{
return "bad executor";
}
diff --git a/3rdparty/asio/include/asio/execution/impl/receiver_invocation_error.ipp b/3rdparty/asio/include/asio/execution/impl/receiver_invocation_error.ipp
deleted file mode 100644
index 5fd4e91191a..00000000000
--- a/3rdparty/asio/include/asio/execution/impl/receiver_invocation_error.ipp
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// exection/impl/receiver_invocation_error.ipp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_IMPL_RECEIVER_INVOCATION_ERROR_IPP
-#define ASIO_EXECUTION_IMPL_RECEIVER_INVOCATION_ERROR_IPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/execution/receiver_invocation_error.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-
-receiver_invocation_error::receiver_invocation_error()
- : std::runtime_error("receiver invocation error")
-{
-}
-
-} // namespace execution
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_IMPL_RECEIVER_INVOCATION_ERROR_IPP
diff --git a/3rdparty/asio/include/asio/execution/invocable_archetype.hpp b/3rdparty/asio/include/asio/execution/invocable_archetype.hpp
index b141979caff..50223279e1f 100644
--- a/3rdparty/asio/include/asio/execution/invocable_archetype.hpp
+++ b/3rdparty/asio/include/asio/execution/invocable_archetype.hpp
@@ -2,7 +2,7 @@
// execution/invocable_archetype.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,7 +17,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/detail/push_options.hpp"
@@ -28,38 +27,11 @@ namespace execution {
/// execution::executor concept.
struct invocable_archetype
{
-#if !defined(GENERATING_DOCUMENTATION)
- // Necessary for compatibility with a C++03 implementation of result_of.
- typedef void result_type;
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
-
/// Function call operator.
template <typename... Args>
- void operator()(ASIO_MOVE_ARG(Args)...)
- {
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
- void operator()()
+ void operator()(Args&&...)
{
}
-
-#define ASIO_PRIVATE_INVOCABLE_ARCHETYPE_CALL_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- void operator()(ASIO_VARIADIC_UNNAMED_MOVE_PARAMS(n)) \
- { \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INVOCABLE_ARCHETYPE_CALL_DEF)
-#undef ASIO_PRIVATE_INVOCABLE_ARCHETYPE_CALL_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
};
} // namespace execution
diff --git a/3rdparty/asio/include/asio/execution/mapping.hpp b/3rdparty/asio/include/asio/execution/mapping.hpp
index 33924c81466..4c6e1791869 100644
--- a/3rdparty/asio/include/asio/execution/mapping.hpp
+++ b/3rdparty/asio/include/asio/execution/mapping.hpp
@@ -2,7 +2,7 @@
// execution/mapping.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,8 +18,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
#include "asio/is_applicable_property.hpp"
#include "asio/query.hpp"
#include "asio/traits/query_free.hpp"
@@ -40,10 +38,9 @@ namespace execution {
/// of execution agents on to threads of execution.
struct mapping_t
{
- /// The mapping_t property applies to executors, senders, and schedulers.
+ /// The mapping_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The top-level mapping_t property cannot be required.
static constexpr bool is_requirable = false;
@@ -58,11 +55,9 @@ struct mapping_t
/// threads of execution.
struct thread_t
{
- /// The mapping_t::thread_t property applies to executors, senders, and
- /// schedulers.
+ /// The mapping_t::thread_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The mapping_t::thread_t property can be required.
static constexpr bool is_requirable = true;
@@ -87,11 +82,9 @@ struct mapping_t
/// new threads of execution.
struct new_thread_t
{
- /// The mapping_t::new_thread_t property applies to executors, senders, and
- /// schedulers.
+ /// The mapping_t::new_thread_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The mapping_t::new_thread_t property can be required.
static constexpr bool is_requirable = true;
@@ -116,11 +109,9 @@ struct mapping_t
/// implementation-defined.
struct other_t
{
- /// The mapping_t::other_t property applies to executors, senders, and
- /// schedulers.
+ /// The mapping_t::other_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The mapping_t::other_t property can be required.
static constexpr bool is_requirable = true;
@@ -193,45 +184,33 @@ struct mapping_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = false;
+ static constexpr bool is_preferable = false;
typedef mapping_t polymorphic_query_result_type;
typedef detail::mapping::thread_t<I> thread_t;
typedef detail::mapping::new_thread_t<I> new_thread_t;
typedef detail::mapping::other_t<I> other_t;
- ASIO_CONSTEXPR mapping_t()
+ constexpr mapping_t()
: value_(-1)
{
}
- ASIO_CONSTEXPR mapping_t(thread_t)
+ constexpr mapping_t(thread_t)
: value_(0)
{
}
- ASIO_CONSTEXPR mapping_t(new_thread_t)
+ constexpr mapping_t(new_thread_t)
: value_(1)
{
}
- ASIO_CONSTEXPR mapping_t(other_t)
+ constexpr mapping_t(other_t)
: value_(2)
{
}
@@ -243,16 +222,14 @@ struct mapping_t
struct type
{
template <typename P>
- auto query(ASIO_MOVE_ARG(P) p) const
+ auto query(P&& p) const
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -267,17 +244,17 @@ struct mapping_t
struct type
{
template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
+ static constexpr auto query(P&& p)
noexcept(
noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
)
-> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
{
- return T::query(ASIO_MOVE_CAST(P)(p));
+ return T::query(static_cast<P&&>(p));
}
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
@@ -297,88 +274,87 @@ struct mapping_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, thread_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, thread_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, thread_t>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, new_thread_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::static_query<T, thread_t>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, new_thread_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, new_thread_t>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, other_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::static_query<T, thread_t>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::static_query<T, new_thread_t>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, other_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, other_t>::value();
}
template <typename E, typename T = decltype(mapping_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= mapping_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const mapping_t& a, const mapping_t& b)
{
return a.value_ == b.value_;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const mapping_t& a, const mapping_t& b)
{
return a.value_ != b.value_;
@@ -386,22 +362,20 @@ struct mapping_t
struct convertible_from_mapping_t
{
- ASIO_CONSTEXPR convertible_from_mapping_t(mapping_t) {}
+ constexpr convertible_from_mapping_t(mapping_t) {}
};
template <typename Executor>
- friend ASIO_CONSTEXPR mapping_t query(
+ friend constexpr mapping_t query(
const Executor& ex, convertible_from_mapping_t,
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, thread_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, mapping_t<>::thread_t>::value))
+ noexcept(is_nothrow_query<const Executor&, mapping_t<>::thread_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, thread_t>::value))
+ noexcept(is_nothrow_query<const Executor&, thread_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -409,21 +383,20 @@ struct mapping_t
}
template <typename Executor>
- friend ASIO_CONSTEXPR mapping_t query(
+ friend constexpr mapping_t query(
const Executor& ex, convertible_from_mapping_t,
- typename enable_if<
+ enable_if_t<
!can_query<const Executor&, thread_t>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_query<const Executor&, new_thread_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, mapping_t<>::new_thread_t>::value))
+ noexcept(
+ is_nothrow_query<const Executor&, mapping_t<>::new_thread_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, new_thread_t>::value))
+ noexcept(is_nothrow_query<const Executor&, new_thread_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -431,24 +404,22 @@ struct mapping_t
}
template <typename Executor>
- friend ASIO_CONSTEXPR mapping_t query(
+ friend constexpr mapping_t query(
const Executor& ex, convertible_from_mapping_t,
- typename enable_if<
+ enable_if_t<
!can_query<const Executor&, thread_t>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!can_query<const Executor&, new_thread_t>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_query<const Executor&, other_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, mapping_t<>::other_t>::value))
+ noexcept(is_nothrow_query<const Executor&, mapping_t<>::other_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, other_t>::value))
+ noexcept(is_nothrow_query<const Executor&, other_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -459,10 +430,6 @@ struct mapping_t
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(new_thread_t, new_thread);
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(other_t, other);
-#if !defined(ASIO_HAS_CONSTEXPR)
- static const mapping_t instance;
-#endif // !defined(ASIO_HAS_CONSTEXPR)
-
private:
int value_;
};
@@ -474,11 +441,6 @@ const T mapping_t<I>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_CONSTEXPR)
-template <int I>
-const mapping_t<I> mapping_t<I>::instance;
-#endif
-
template <int I>
const typename mapping_t<I>::thread_t mapping_t<I>::thread;
@@ -495,26 +457,14 @@ struct thread_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef mapping_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR thread_t()
+ constexpr thread_t()
{
}
@@ -531,58 +481,75 @@ struct thread_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR thread_t static_query(
- typename enable_if<
+ static constexpr thread_t static_query(
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::query_free<T, thread_t>::is_valid
- >::type* = 0,
- typename enable_if<
- !can_query<T, new_thread_t<I> >::value
- >::type* = 0,
- typename enable_if<
- !can_query<T, other_t<I> >::value
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0,
+ enable_if_t<
+ !can_query<T, new_thread_t<I>>::value
+ >* = 0,
+ enable_if_t<
+ !can_query<T, other_t<I>>::value
+ >* = 0) noexcept
{
return thread_t();
}
template <typename E, typename T = decltype(thread_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= thread_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR mapping_t<I> value()
+ static constexpr mapping_t<I> value()
{
return thread_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const thread_t&, const thread_t&)
+ friend constexpr bool operator==(const thread_t&, const thread_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const thread_t&, const thread_t&)
+ friend constexpr bool operator!=(const thread_t&, const thread_t&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator==(const thread_t&, const new_thread_t<I>&)
{
return false;
}
+
+ friend constexpr bool operator!=(const thread_t&, const new_thread_t<I>&)
+ {
+ return true;
+ }
+
+ friend constexpr bool operator==(const thread_t&, const other_t<I>&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator!=(const thread_t&, const other_t<I>&)
+ {
+ return true;
+ }
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -597,26 +564,14 @@ struct new_thread_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef mapping_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR new_thread_t()
+ constexpr new_thread_t()
{
}
@@ -633,37 +588,52 @@ struct new_thread_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(new_thread_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = new_thread_t::static_query<E>();
+ static constexpr const T static_query_v = new_thread_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR mapping_t<I> value()
+ static constexpr mapping_t<I> value()
{
return new_thread_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const new_thread_t&, const new_thread_t&)
+ friend constexpr bool operator==(const new_thread_t&, const new_thread_t&)
+ {
+ return true;
+ }
+
+ friend constexpr bool operator!=(const new_thread_t&, const new_thread_t&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator==(const new_thread_t&, const thread_t<I>&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator!=(const new_thread_t&, const thread_t<I>&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const new_thread_t&, const new_thread_t&)
+ friend constexpr bool operator==(const new_thread_t&, const other_t<I>&)
{
return false;
}
+
+ friend constexpr bool operator!=(const new_thread_t&, const other_t<I>&)
+ {
+ return true;
+ }
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -678,26 +648,14 @@ struct other_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef mapping_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR other_t()
+ constexpr other_t()
{
}
@@ -714,37 +672,53 @@ struct other_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(other_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = other_t::static_query<E>();
+ static constexpr const T static_query_v = other_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR mapping_t<I> value()
+ static constexpr mapping_t<I> value()
{
return other_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const other_t&, const other_t&)
+ friend constexpr bool operator==(const other_t&, const other_t&)
+ {
+ return true;
+ }
+
+ friend constexpr bool operator!=(const other_t&, const other_t&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator==(const other_t&, const thread_t<I>&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator!=(const other_t&, const thread_t<I>&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const other_t&, const other_t&)
+ friend constexpr bool operator==(const other_t&, const new_thread_t<I>&)
{
return false;
}
+
+ friend constexpr bool operator!=(const other_t&, const new_thread_t<I>&)
+ {
+ return true;
+ }
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -759,11 +733,7 @@ const T other_t<I>::static_query_v;
typedef detail::mapping_t<> mapping_t;
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr mapping_t mapping;
-#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-namespace { static const mapping_t& mapping = mapping_t::instance; }
-#endif
} // namespace execution
@@ -771,69 +741,25 @@ namespace { static const mapping_t& mapping = mapping_t::instance; }
template <typename T>
struct is_applicable_property<T, execution::mapping_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::mapping_t::thread_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::mapping_t::new_thread_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::mapping_t::other_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
@@ -845,42 +771,42 @@ namespace traits {
template <typename T>
struct query_free_default<T, execution::mapping_t,
- typename enable_if<
+ enable_if_t<
can_query<T, execution::mapping_t::thread_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::mapping_t::thread_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::mapping_t::thread_t>::value;
typedef execution::mapping_t result_type;
};
template <typename T>
struct query_free_default<T, execution::mapping_t,
- typename enable_if<
+ enable_if_t<
!can_query<T, execution::mapping_t::thread_t>::value
&& can_query<T, execution::mapping_t::new_thread_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::mapping_t::new_thread_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::mapping_t::new_thread_t>::value;
typedef execution::mapping_t result_type;
};
template <typename T>
struct query_free_default<T, execution::mapping_t,
- typename enable_if<
+ enable_if_t<
!can_query<T, execution::mapping_t::thread_t>::value
&& !can_query<T, execution::mapping_t::new_thread_t>::value
&& can_query<T, execution::mapping_t::other_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::mapping_t::other_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::mapping_t::other_t>::value;
typedef execution::mapping_t result_type;
};
@@ -892,18 +818,18 @@ struct query_free_default<T, execution::mapping_t,
template <typename T>
struct static_query<T, execution::mapping_t,
- typename enable_if<
+ enable_if_t<
execution::detail::mapping_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::mapping_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::mapping_t<0>::
query_static_constexpr_member<T>::value();
@@ -912,21 +838,21 @@ struct static_query<T, execution::mapping_t,
template <typename T>
struct static_query<T, execution::mapping_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::mapping_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::mapping_t<0>::
query_member<T>::is_valid
&& traits::static_query<T, execution::mapping_t::thread_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::mapping_t::thread_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T, execution::mapping_t::thread_t>::value();
}
@@ -934,22 +860,22 @@ struct static_query<T, execution::mapping_t,
template <typename T>
struct static_query<T, execution::mapping_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::mapping_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::mapping_t<0>::
query_member<T>::is_valid
&& !traits::static_query<T, execution::mapping_t::thread_t>::is_valid
&& traits::static_query<T, execution::mapping_t::new_thread_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::mapping_t::new_thread_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T, execution::mapping_t::new_thread_t>::value();
}
@@ -957,7 +883,7 @@ struct static_query<T, execution::mapping_t,
template <typename T>
struct static_query<T, execution::mapping_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::mapping_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::mapping_t<0>::
@@ -965,15 +891,15 @@ struct static_query<T, execution::mapping_t,
&& !traits::static_query<T, execution::mapping_t::thread_t>::is_valid
&& !traits::static_query<T, execution::mapping_t::new_thread_t>::is_valid
&& traits::static_query<T, execution::mapping_t::other_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::mapping_t::other_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T, execution::mapping_t::other_t>::value();
}
@@ -981,18 +907,18 @@ struct static_query<T, execution::mapping_t,
template <typename T>
struct static_query<T, execution::mapping_t::thread_t,
- typename enable_if<
+ enable_if_t<
execution::detail::mapping::thread_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::mapping::thread_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::mapping::thread_t<0>::
query_static_constexpr_member<T>::value();
@@ -1001,7 +927,7 @@ struct static_query<T, execution::mapping_t::thread_t,
template <typename T>
struct static_query<T, execution::mapping_t::thread_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::mapping::thread_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::mapping::thread_t<0>::
@@ -1009,14 +935,14 @@ struct static_query<T, execution::mapping_t::thread_t,
&& !traits::query_free<T, execution::mapping_t::thread_t>::is_valid
&& !can_query<T, execution::mapping_t::new_thread_t>::value
&& !can_query<T, execution::mapping_t::other_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::mapping_t::thread_t result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return result_type();
}
@@ -1024,18 +950,18 @@ struct static_query<T, execution::mapping_t::thread_t,
template <typename T>
struct static_query<T, execution::mapping_t::new_thread_t,
- typename enable_if<
+ enable_if_t<
execution::detail::mapping::new_thread_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::mapping::new_thread_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::mapping::new_thread_t<0>::
query_static_constexpr_member<T>::value();
@@ -1044,18 +970,18 @@ struct static_query<T, execution::mapping_t::new_thread_t,
template <typename T>
struct static_query<T, execution::mapping_t::other_t,
- typename enable_if<
+ enable_if_t<
execution::detail::mapping::other_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::mapping::other_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::mapping::other_t<0>::
query_static_constexpr_member<T>::value();
@@ -1065,46 +991,6 @@ struct static_query<T, execution::mapping_t::other_t,
#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
-template <typename T>
-struct static_require<T, execution::mapping_t::thread_t,
- typename enable_if<
- static_query<T, execution::mapping_t::thread_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::mapping_t::thread_t>::result_type,
- execution::mapping_t::thread_t>::value));
-};
-
-template <typename T>
-struct static_require<T, execution::mapping_t::new_thread_t,
- typename enable_if<
- static_query<T, execution::mapping_t::new_thread_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::mapping_t::new_thread_t>::result_type,
- execution::mapping_t::new_thread_t>::value));
-};
-
-template <typename T>
-struct static_require<T, execution::mapping_t::other_t,
- typename enable_if<
- static_query<T, execution::mapping_t::other_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::mapping_t::other_t>::result_type,
- execution::mapping_t::other_t>::value));
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
} // namespace traits
#endif // defined(GENERATING_DOCUMENTATION)
diff --git a/3rdparty/asio/include/asio/execution/occupancy.hpp b/3rdparty/asio/include/asio/execution/occupancy.hpp
index e1842a46ab0..c986c88113d 100644
--- a/3rdparty/asio/include/asio/execution/occupancy.hpp
+++ b/3rdparty/asio/include/asio/execution/occupancy.hpp
@@ -2,7 +2,7 @@
// execution/occupancy.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,8 +18,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
#include "asio/is_applicable_property.hpp"
#include "asio/traits/query_static_constexpr_member.hpp"
#include "asio/traits/static_query.hpp"
@@ -36,10 +34,9 @@ namespace execution {
/// should occupy the associated execution context.
struct occupancy_t
{
- /// The occupancy_t property applies to executors, senders, and schedulers.
+ /// The occupancy_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The occupancy_t property cannot be required.
static constexpr bool is_requirable = false;
@@ -66,26 +63,14 @@ struct occupancy_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = false;
+ static constexpr bool is_preferable = false;
typedef std::size_t polymorphic_query_result_type;
- ASIO_CONSTEXPR occupancy_t()
+ constexpr occupancy_t()
{
}
@@ -96,17 +81,17 @@ struct occupancy_t
struct type
{
template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
+ static constexpr auto query(P&& p)
noexcept(
noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
)
-> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
{
- return T::query(ASIO_MOVE_CAST(P)(p));
+ return T::query(static_cast<P&&>(p));
}
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
@@ -122,24 +107,17 @@ struct occupancy_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(occupancy_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = occupancy_t::static_query<E>();
+ static constexpr const T static_query_v = occupancy_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-
-#if !defined(ASIO_HAS_CONSTEXPR)
- static const occupancy_t instance;
-#endif // !defined(ASIO_HAS_CONSTEXPR)
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -149,20 +127,11 @@ const T occupancy_t<I>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_CONSTEXPR)
-template <int I>
-const occupancy_t<I> occupancy_t<I>::instance;
-#endif
-
} // namespace detail
typedef detail::occupancy_t<> occupancy_t;
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr occupancy_t occupancy;
-#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-namespace { static const occupancy_t& occupancy = occupancy_t::instance; }
-#endif
} // namespace execution
@@ -170,18 +139,7 @@ namespace { static const occupancy_t& occupancy = occupancy_t::instance; }
template <typename T>
struct is_applicable_property<T, execution::occupancy_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
@@ -194,18 +152,18 @@ namespace traits {
template <typename T>
struct static_query<T, execution::occupancy_t,
- typename enable_if<
+ enable_if_t<
execution::detail::occupancy_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::occupancy_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::occupancy_t<0>::
query_static_constexpr_member<T>::value();
diff --git a/3rdparty/asio/include/asio/execution/operation_state.hpp b/3rdparty/asio/include/asio/execution/operation_state.hpp
deleted file mode 100644
index 8fb7a94b8ca..00000000000
--- a/3rdparty/asio/include/asio/execution/operation_state.hpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// execution/operation_state.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_OPERATION_STATE_HPP
-#define ASIO_EXECUTION_OPERATION_STATE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/start.hpp"
-
-#if defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT) \
- && defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-# define ASIO_HAS_DEDUCED_EXECUTION_IS_OPERATION_STATE_TRAIT 1
-#endif // defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT)
- // && defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-template <typename T>
-struct is_operation_state_base :
- integral_constant<bool,
- is_destructible<T>::value
- && is_object<T>::value
- >
-{
-};
-
-} // namespace detail
-
-/// The is_operation_state trait detects whether a type T satisfies the
-/// execution::operation_state concept.
-/**
- * Class template @c is_operation_state is a type trait that is derived from
- * @c true_type if the type @c T meets the concept definition for an
- * @c operation_state, otherwise @c false_type.
- */
-template <typename T>
-struct is_operation_state :
-#if defined(GENERATING_DOCUMENTATION)
- integral_constant<bool, automatically_determined>
-#else // defined(GENERATING_DOCUMENTATION)
- conditional<
- can_start<typename add_lvalue_reference<T>::type>::value
- && is_nothrow_start<typename add_lvalue_reference<T>::type>::value,
- detail::is_operation_state_base<T>,
- false_type
- >::type
-#endif // defined(GENERATING_DOCUMENTATION)
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T>
-ASIO_CONSTEXPR const bool is_operation_state_v =
- is_operation_state<T>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#if defined(ASIO_HAS_CONCEPTS)
-
-template <typename T>
-ASIO_CONCEPT operation_state = is_operation_state<T>::value;
-
-#define ASIO_EXECUTION_OPERATION_STATE \
- ::asio::execution::operation_state
-
-#else // defined(ASIO_HAS_CONCEPTS)
-
-#define ASIO_EXECUTION_OPERATION_STATE typename
-
-#endif // defined(ASIO_HAS_CONCEPTS)
-
-} // namespace execution
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_OPERATION_STATE_HPP
diff --git a/3rdparty/asio/include/asio/execution/outstanding_work.hpp b/3rdparty/asio/include/asio/execution/outstanding_work.hpp
index 48ed71d1563..600792b95b4 100644
--- a/3rdparty/asio/include/asio/execution/outstanding_work.hpp
+++ b/3rdparty/asio/include/asio/execution/outstanding_work.hpp
@@ -2,7 +2,7 @@
// execution/outstanding_work.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,8 +18,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
#include "asio/is_applicable_property.hpp"
#include "asio/query.hpp"
#include "asio/traits/query_free.hpp"
@@ -39,11 +37,9 @@ namespace execution {
/// A property to describe whether task submission is likely in the future.
struct outstanding_work_t
{
- /// The outstanding_work_t property applies to executors, senders, and
- /// schedulers.
+ /// The outstanding_work_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The top-level outstanding_work_t property cannot be required.
static constexpr bool is_requirable = false;
@@ -58,11 +54,9 @@ struct outstanding_work_t
/// future submission of a function object.
struct untracked_t
{
- /// The outstanding_work_t::untracked_t property applies to executors,
- /// senders, and schedulers.
+ /// The outstanding_work_t::untracked_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The outstanding_work_t::untracked_t property can be required.
static constexpr bool is_requirable = true;
@@ -87,11 +81,9 @@ struct outstanding_work_t
/// future submission of a function object.
struct tracked_t
{
- /// The outstanding_work_t::untracked_t property applies to executors,
- /// senders, and schedulers.
+ /// The outstanding_work_t::untracked_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The outstanding_work_t::tracked_t property can be required.
static constexpr bool is_requirable = true;
@@ -159,39 +151,27 @@ struct outstanding_work_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = false;
+ static constexpr bool is_preferable = false;
typedef outstanding_work_t polymorphic_query_result_type;
typedef detail::outstanding_work::untracked_t<I> untracked_t;
typedef detail::outstanding_work::tracked_t<I> tracked_t;
- ASIO_CONSTEXPR outstanding_work_t()
+ constexpr outstanding_work_t()
: value_(-1)
{
}
- ASIO_CONSTEXPR outstanding_work_t(untracked_t)
+ constexpr outstanding_work_t(untracked_t)
: value_(0)
{
}
- ASIO_CONSTEXPR outstanding_work_t(tracked_t)
+ constexpr outstanding_work_t(tracked_t)
: value_(1)
{
}
@@ -203,16 +183,14 @@ struct outstanding_work_t
struct type
{
template <typename P>
- auto query(ASIO_MOVE_ARG(P) p) const
+ auto query(P&& p) const
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -227,17 +205,17 @@ struct outstanding_work_t
struct type
{
template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
+ static constexpr auto query(P&& p)
noexcept(
noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
)
-> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
{
- return T::query(ASIO_MOVE_CAST(P)(p));
+ return T::query(static_cast<P&&>(p));
}
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
@@ -257,66 +235,65 @@ struct outstanding_work_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, untracked_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, untracked_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, untracked_t>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, tracked_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::static_query<T, untracked_t>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, tracked_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, tracked_t>::value();
}
template <typename E,
typename T = decltype(outstanding_work_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= outstanding_work_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const outstanding_work_t& a, const outstanding_work_t& b)
{
return a.value_ == b.value_;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const outstanding_work_t& a, const outstanding_work_t& b)
{
return a.value_ != b.value_;
@@ -324,25 +301,23 @@ struct outstanding_work_t
struct convertible_from_outstanding_work_t
{
- ASIO_CONSTEXPR convertible_from_outstanding_work_t(outstanding_work_t)
+ constexpr convertible_from_outstanding_work_t(outstanding_work_t)
{
}
};
template <typename Executor>
- friend ASIO_CONSTEXPR outstanding_work_t query(
+ friend constexpr outstanding_work_t query(
const Executor& ex, convertible_from_outstanding_work_t,
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, untracked_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&,
- outstanding_work_t<>::untracked_t>::value))
+ noexcept(is_nothrow_query<const Executor&,
+ outstanding_work_t<>::untracked_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, untracked_t>::value))
+ noexcept(is_nothrow_query<const Executor&, untracked_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -350,22 +325,20 @@ struct outstanding_work_t
}
template <typename Executor>
- friend ASIO_CONSTEXPR outstanding_work_t query(
+ friend constexpr outstanding_work_t query(
const Executor& ex, convertible_from_outstanding_work_t,
- typename enable_if<
+ enable_if_t<
!can_query<const Executor&, untracked_t>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_query<const Executor&, tracked_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&,
- outstanding_work_t<>::tracked_t>::value))
+ noexcept(is_nothrow_query<const Executor&,
+ outstanding_work_t<>::tracked_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, tracked_t>::value))
+ noexcept(is_nothrow_query<const Executor&, tracked_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -375,10 +348,6 @@ struct outstanding_work_t
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(untracked_t, untracked);
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(tracked_t, tracked);
-#if !defined(ASIO_HAS_CONSTEXPR)
- static const outstanding_work_t instance;
-#endif // !defined(ASIO_HAS_CONSTEXPR)
-
private:
int value_;
};
@@ -390,11 +359,6 @@ const T outstanding_work_t<I>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_CONSTEXPR)
-template <int I>
-const outstanding_work_t<I> outstanding_work_t<I>::instance;
-#endif
-
template <int I>
const typename outstanding_work_t<I>::untracked_t
outstanding_work_t<I>::untracked;
@@ -410,26 +374,14 @@ struct untracked_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef outstanding_work_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR untracked_t()
+ constexpr untracked_t()
{
}
@@ -447,55 +399,61 @@ struct untracked_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR untracked_t static_query(
- typename enable_if<
+ static constexpr untracked_t static_query(
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::query_free<T, untracked_t>::is_valid
- >::type* = 0,
- typename enable_if<
- !can_query<T, tracked_t<I> >::value
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0,
+ enable_if_t<
+ !can_query<T, tracked_t<I>>::value
+ >* = 0) noexcept
{
return untracked_t();
}
template <typename E, typename T = decltype(untracked_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = untracked_t::static_query<E>();
+ static constexpr const T static_query_v = untracked_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR outstanding_work_t<I> value()
+ static constexpr outstanding_work_t<I> value()
{
return untracked_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const untracked_t&, const untracked_t&)
+ friend constexpr bool operator==(const untracked_t&, const untracked_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const untracked_t&, const untracked_t&)
+ friend constexpr bool operator!=(const untracked_t&, const untracked_t&)
{
return false;
}
+
+ friend constexpr bool operator==(const untracked_t&, const tracked_t<I>&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator!=(const untracked_t&, const tracked_t<I>&)
+ {
+ return true;
+ }
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -510,26 +468,14 @@ struct tracked_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef outstanding_work_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR tracked_t()
+ constexpr tracked_t()
{
}
@@ -547,37 +493,43 @@ struct tracked_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E, typename T = decltype(tracked_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
- = tracked_t::static_query<E>();
+ static constexpr const T static_query_v = tracked_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR outstanding_work_t<I> value()
+ static constexpr outstanding_work_t<I> value()
{
return tracked_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const tracked_t&, const tracked_t&)
+ friend constexpr bool operator==(const tracked_t&, const tracked_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const tracked_t&, const tracked_t&)
+ friend constexpr bool operator!=(const tracked_t&, const tracked_t&)
{
return false;
}
+
+ friend constexpr bool operator==(const tracked_t&, const untracked_t<I>&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator!=(const tracked_t&, const untracked_t<I>&)
+ {
+ return true;
+ }
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -592,12 +544,7 @@ const T tracked_t<I>::static_query_v;
typedef detail::outstanding_work_t<> outstanding_work_t;
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr outstanding_work_t outstanding_work;
-#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-namespace { static const outstanding_work_t&
- outstanding_work = outstanding_work_t::instance; }
-#endif
} // namespace execution
@@ -605,52 +552,19 @@ namespace { static const outstanding_work_t&
template <typename T>
struct is_applicable_property<T, execution::outstanding_work_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::outstanding_work_t::untracked_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::outstanding_work_t::tracked_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
@@ -662,27 +576,27 @@ namespace traits {
template <typename T>
struct query_free_default<T, execution::outstanding_work_t,
- typename enable_if<
+ enable_if_t<
can_query<T, execution::outstanding_work_t::untracked_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::outstanding_work_t::untracked_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::outstanding_work_t::untracked_t>::value;
typedef execution::outstanding_work_t result_type;
};
template <typename T>
struct query_free_default<T, execution::outstanding_work_t,
- typename enable_if<
+ enable_if_t<
!can_query<T, execution::outstanding_work_t::untracked_t>::value
&& can_query<T, execution::outstanding_work_t::tracked_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::outstanding_work_t::tracked_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::outstanding_work_t::tracked_t>::value;
typedef execution::outstanding_work_t result_type;
};
@@ -694,18 +608,18 @@ struct query_free_default<T, execution::outstanding_work_t,
template <typename T>
struct static_query<T, execution::outstanding_work_t,
- typename enable_if<
+ enable_if_t<
execution::detail::outstanding_work_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::outstanding_work_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::outstanding_work_t<0>::
query_static_constexpr_member<T>::value();
@@ -714,22 +628,22 @@ struct static_query<T, execution::outstanding_work_t,
template <typename T>
struct static_query<T, execution::outstanding_work_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::outstanding_work_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::outstanding_work_t<0>::
query_member<T>::is_valid
&& traits::static_query<T,
execution::outstanding_work_t::untracked_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::outstanding_work_t::untracked_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T,
execution::outstanding_work_t::untracked_t>::value();
@@ -738,7 +652,7 @@ struct static_query<T, execution::outstanding_work_t,
template <typename T>
struct static_query<T, execution::outstanding_work_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::outstanding_work_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::outstanding_work_t<0>::
@@ -747,15 +661,15 @@ struct static_query<T, execution::outstanding_work_t,
execution::outstanding_work_t::untracked_t>::is_valid
&& traits::static_query<T,
execution::outstanding_work_t::tracked_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::outstanding_work_t::tracked_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T,
execution::outstanding_work_t::tracked_t>::value();
@@ -764,18 +678,18 @@ struct static_query<T, execution::outstanding_work_t,
template <typename T>
struct static_query<T, execution::outstanding_work_t::untracked_t,
- typename enable_if<
+ enable_if_t<
execution::detail::outstanding_work::untracked_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::outstanding_work::untracked_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::outstanding_work::untracked_t<0>::
query_static_constexpr_member<T>::value();
@@ -784,7 +698,7 @@ struct static_query<T, execution::outstanding_work_t::untracked_t,
template <typename T>
struct static_query<T, execution::outstanding_work_t::untracked_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::outstanding_work::untracked_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::outstanding_work::untracked_t<0>::
@@ -792,14 +706,14 @@ struct static_query<T, execution::outstanding_work_t::untracked_t,
&& !traits::query_free<T,
execution::outstanding_work_t::untracked_t>::is_valid
&& !can_query<T, execution::outstanding_work_t::tracked_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::outstanding_work_t::untracked_t result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return result_type();
}
@@ -807,18 +721,18 @@ struct static_query<T, execution::outstanding_work_t::untracked_t,
template <typename T>
struct static_query<T, execution::outstanding_work_t::tracked_t,
- typename enable_if<
+ enable_if_t<
execution::detail::outstanding_work::tracked_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::outstanding_work::tracked_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::outstanding_work::tracked_t<0>::
query_static_constexpr_member<T>::value();
@@ -828,34 +742,6 @@ struct static_query<T, execution::outstanding_work_t::tracked_t,
#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
-template <typename T>
-struct static_require<T, execution::outstanding_work_t::untracked_t,
- typename enable_if<
- static_query<T, execution::outstanding_work_t::untracked_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::outstanding_work_t::untracked_t>::result_type,
- execution::outstanding_work_t::untracked_t>::value));
-};
-
-template <typename T>
-struct static_require<T, execution::outstanding_work_t::tracked_t,
- typename enable_if<
- static_query<T, execution::outstanding_work_t::tracked_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::outstanding_work_t::tracked_t>::result_type,
- execution::outstanding_work_t::tracked_t>::value));
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
} // namespace traits
#endif // defined(GENERATING_DOCUMENTATION)
diff --git a/3rdparty/asio/include/asio/execution/prefer_only.hpp b/3rdparty/asio/include/asio/execution/prefer_only.hpp
index e608a7707db..1a990ebf392 100644
--- a/3rdparty/asio/include/asio/execution/prefer_only.hpp
+++ b/3rdparty/asio/include/asio/execution/prefer_only.hpp
@@ -2,7 +2,7 @@
// execution/prefer_only.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -65,16 +65,17 @@ namespace detail {
template <typename InnerProperty, typename = void>
struct prefer_only_is_preferable
{
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_preferable = false;
};
template <typename InnerProperty>
struct prefer_only_is_preferable<InnerProperty,
- typename enable_if<
+ enable_if_t<
InnerProperty::is_preferable
- >::type>
+ >
+ >
{
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_preferable = true;
};
template <typename InnerProperty, typename = void>
@@ -84,9 +85,10 @@ struct prefer_only_polymorphic_query_result_type
template <typename InnerProperty>
struct prefer_only_polymorphic_query_result_type<InnerProperty,
- typename void_type<
+ void_t<
typename InnerProperty::polymorphic_query_result_type
- >::type>
+ >
+ >
{
typedef typename InnerProperty::polymorphic_query_result_type
polymorphic_query_result_type;
@@ -103,14 +105,14 @@ struct prefer_only_property
}
};
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
template <typename InnerProperty>
struct prefer_only_property<InnerProperty,
- typename void_type<
+ void_t<
decltype(asio::declval<const InnerProperty>().value())
- >::type>
+ >
+ >
{
InnerProperty property;
@@ -119,17 +121,15 @@ struct prefer_only_property<InnerProperty,
{
}
- ASIO_CONSTEXPR auto value() const
- ASIO_NOEXCEPT_IF((
- noexcept(asio::declval<const InnerProperty>().value())))
+ constexpr auto value() const
+ noexcept(noexcept(asio::declval<const InnerProperty>().value()))
-> decltype(asio::declval<const InnerProperty>().value())
{
return property.value();
}
};
-#else // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#else // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
struct prefer_only_memfns_base
{
@@ -158,11 +158,12 @@ char prefer_only_value_memfn_helper(
template <typename InnerProperty>
struct prefer_only_property<InnerProperty,
- typename enable_if<
+ enable_if_t<
sizeof(prefer_only_value_memfn_helper<InnerProperty>(0)) != 1
&& !is_same<typename InnerProperty::polymorphic_query_result_type,
void>::value
- >::type>
+ >
+ >
{
InnerProperty property;
@@ -171,15 +172,14 @@ struct prefer_only_property<InnerProperty,
{
}
- ASIO_CONSTEXPR typename InnerProperty::polymorphic_query_result_type
+ constexpr typename InnerProperty::polymorphic_query_result_type
value() const
{
return property.value();
}
};
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
} // namespace detail
@@ -189,9 +189,9 @@ struct prefer_only :
detail::prefer_only_polymorphic_query_result_type<InnerProperty>,
detail::prefer_only_property<InnerProperty>
{
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
+ static constexpr bool is_requirable = false;
- ASIO_CONSTEXPR prefer_only(const InnerProperty& p)
+ constexpr prefer_only(const InnerProperty& p)
: detail::prefer_only_property<InnerProperty>(p)
{
}
@@ -199,35 +199,33 @@ struct prefer_only :
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, InnerProperty>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- traits::static_query<T, InnerProperty>::is_noexcept))
+ noexcept(traits::static_query<T, InnerProperty>::is_noexcept)
{
return traits::static_query<T, InnerProperty>::value();
}
template <typename E, typename T = decltype(prefer_only::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= prefer_only::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename Executor, typename Property>
- friend ASIO_CONSTEXPR
- typename prefer_result<const Executor&, const InnerProperty&>::type
+ friend constexpr
+ prefer_result_t<const Executor&, const InnerProperty&>
prefer(const Executor& ex, const prefer_only<Property>& p,
- typename enable_if<
+ enable_if_t<
is_same<Property, InnerProperty>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_prefer<const Executor&, const InnerProperty&>::value
- >::type* = 0)
+ >* = 0)
#if !defined(ASIO_MSVC) \
&& !defined(__clang__) // Clang crashes if noexcept is used here.
- ASIO_NOEXCEPT_IF((
- is_nothrow_prefer<const Executor&, const InnerProperty&>::value))
+ noexcept(is_nothrow_prefer<const Executor&, const InnerProperty&>::value)
#endif // !defined(ASIO_MSVC)
// && !defined(__clang__)
{
@@ -235,19 +233,18 @@ struct prefer_only :
}
template <typename Executor, typename Property>
- friend ASIO_CONSTEXPR
- typename query_result<const Executor&, const InnerProperty&>::type
+ friend constexpr
+ query_result_t<const Executor&, const InnerProperty&>
query(const Executor& ex, const prefer_only<Property>& p,
- typename enable_if<
+ enable_if_t<
is_same<Property, InnerProperty>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_query<const Executor&, const InnerProperty&>::value
- >::type* = 0)
+ >* = 0)
#if !defined(ASIO_MSVC) \
&& !defined(__clang__) // Clang crashes if noexcept is used here.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, const InnerProperty&>::value))
+ noexcept(is_nothrow_query<const Executor&, const InnerProperty&>::value)
#endif // !defined(ASIO_MSVC)
// && !defined(__clang__)
{
@@ -265,7 +262,7 @@ const T prefer_only<InnerProperty>::static_query_v;
} // namespace execution
template <typename T, typename InnerProperty>
-struct is_applicable_property<T, execution::prefer_only<InnerProperty> >
+struct is_applicable_property<T, execution::prefer_only<InnerProperty>>
: is_applicable_property<T, InnerProperty>
{
};
@@ -276,7 +273,7 @@ namespace traits {
|| !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T, typename InnerProperty>
-struct static_query<T, execution::prefer_only<InnerProperty> > :
+struct static_query<T, execution::prefer_only<InnerProperty>> :
static_query<T, const InnerProperty&>
{
};
@@ -288,16 +285,16 @@ struct static_query<T, execution::prefer_only<InnerProperty> > :
template <typename T, typename InnerProperty>
struct prefer_free_default<T, execution::prefer_only<InnerProperty>,
- typename enable_if<
+ enable_if_t<
can_prefer<const T&, const InnerProperty&>::value
- >::type>
+ >
+ >
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_prefer<const T&, const InnerProperty&>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_prefer<const T&, const InnerProperty&>::value;
- typedef typename prefer_result<const T&,
- const InnerProperty&>::type result_type;
+ typedef prefer_result_t<const T&, const InnerProperty&> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
@@ -306,16 +303,16 @@ struct prefer_free_default<T, execution::prefer_only<InnerProperty>,
template <typename T, typename InnerProperty>
struct query_free<T, execution::prefer_only<InnerProperty>,
- typename enable_if<
+ enable_if_t<
can_query<const T&, const InnerProperty&>::value
- >::type>
+ >
+ >
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<const T&, const InnerProperty&>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<const T&, const InnerProperty&>::value;
- typedef typename query_result<const T&,
- const InnerProperty&>::type result_type;
+ typedef query_result_t<const T&, const InnerProperty&> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
diff --git a/3rdparty/asio/include/asio/execution/receiver.hpp b/3rdparty/asio/include/asio/execution/receiver.hpp
deleted file mode 100644
index 4f205aa5240..00000000000
--- a/3rdparty/asio/include/asio/execution/receiver.hpp
+++ /dev/null
@@ -1,280 +0,0 @@
-//
-// execution/receiver.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_RECEIVER_HPP
-#define ASIO_EXECUTION_RECEIVER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
-#include "asio/execution/set_done.hpp"
-#include "asio/execution/set_error.hpp"
-#include "asio/execution/set_value.hpp"
-
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR)
-# include <exception>
-#else // defined(ASIO_HAS_STD_EXCEPTION_PTR)
-# include "asio/error_code.hpp"
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
-
-#if defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT) \
- && defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT) \
- && defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT) \
- && defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT) \
- && defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT) \
- && defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT) \
- && defined(ASIO_HAS_DEDUCED_RECEIVER_OF_FREE_TRAIT) \
- && defined(ASIO_HAS_DEDUCED_RECEIVER_OF_MEMBER_TRAIT)
-# define ASIO_HAS_DEDUCED_EXECUTION_IS_RECEIVER_TRAIT 1
-#endif // defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT)
- // && defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
- // && defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT)
- // && defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
- // && defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
- // && defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
- // && defined(ASIO_HAS_DEDUCED_RECEIVER_OF_FREE_TRAIT)
- // && defined(ASIO_HAS_DEDUCED_RECEIVER_OF_MEMBER_TRAIT)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-template <typename T, typename E>
-struct is_receiver_base :
- integral_constant<bool,
- is_move_constructible<typename remove_cvref<T>::type>::value
- && is_constructible<typename remove_cvref<T>::type, T>::value
- >
-{
-};
-
-} // namespace detail
-
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR)
-# define ASIO_EXECUTION_RECEIVER_ERROR_DEFAULT = std::exception_ptr
-#else // defined(ASIO_HAS_STD_EXCEPTION_PTR)
-# define ASIO_EXECUTION_RECEIVER_ERROR_DEFAULT \
- = ::asio::error_code
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
-
-/// The is_receiver trait detects whether a type T satisfies the
-/// execution::receiver concept.
-/**
- * Class template @c is_receiver is a type trait that is derived from @c
- * true_type if the type @c T meets the concept definition for a receiver for
- * error type @c E, otherwise @c false_type.
- */
-template <typename T, typename E ASIO_EXECUTION_RECEIVER_ERROR_DEFAULT>
-struct is_receiver :
-#if defined(GENERATING_DOCUMENTATION)
- integral_constant<bool, automatically_determined>
-#else // defined(GENERATING_DOCUMENTATION)
- conditional<
- can_set_done<typename remove_cvref<T>::type>::value
- && is_nothrow_set_done<typename remove_cvref<T>::type>::value
- && can_set_error<typename remove_cvref<T>::type, E>::value
- && is_nothrow_set_error<typename remove_cvref<T>::type, E>::value,
- detail::is_receiver_base<T, E>,
- false_type
- >::type
-#endif // defined(GENERATING_DOCUMENTATION)
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T, typename E ASIO_EXECUTION_RECEIVER_ERROR_DEFAULT>
-ASIO_CONSTEXPR const bool is_receiver_v = is_receiver<T, E>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#if defined(ASIO_HAS_CONCEPTS)
-
-template <typename T, typename E ASIO_EXECUTION_RECEIVER_ERROR_DEFAULT>
-ASIO_CONCEPT receiver = is_receiver<T, E>::value;
-
-#define ASIO_EXECUTION_RECEIVER ::asio::execution::receiver
-
-#else // defined(ASIO_HAS_CONCEPTS)
-
-#define ASIO_EXECUTION_RECEIVER typename
-
-#endif // defined(ASIO_HAS_CONCEPTS)
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
-
-/// The is_receiver_of trait detects whether a type T satisfies the
-/// execution::receiver_of concept for some set of value arguments.
-/**
- * Class template @c is_receiver_of is a type trait that is derived from @c
- * true_type if the type @c T meets the concept definition for a receiver for
- * value arguments @c Vs, otherwise @c false_type.
- */
-template <typename T, typename... Vs>
-struct is_receiver_of :
-#if defined(GENERATING_DOCUMENTATION)
- integral_constant<bool, automatically_determined>
-#else // defined(GENERATING_DOCUMENTATION)
- conditional<
- is_receiver<T>::value,
- can_set_value<typename remove_cvref<T>::type, Vs...>,
- false_type
- >::type
-#endif // defined(GENERATING_DOCUMENTATION)
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T, typename... Vs>
-ASIO_CONSTEXPR const bool is_receiver_of_v =
- is_receiver_of<T, Vs...>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#if defined(ASIO_HAS_CONCEPTS)
-
-template <typename T, typename... Vs>
-ASIO_CONCEPT receiver_of = is_receiver_of<T, Vs...>::value;
-
-#define ASIO_EXECUTION_RECEIVER_OF_0 \
- ::asio::execution::receiver_of
-
-#define ASIO_EXECUTION_RECEIVER_OF_1(v) \
- ::asio::execution::receiver_of<v>
-
-#else // defined(ASIO_HAS_CONCEPTS)
-
-#define ASIO_EXECUTION_RECEIVER_OF_0 typename
-#define ASIO_EXECUTION_RECEIVER_OF_1(v) typename
-
-#endif // defined(ASIO_HAS_CONCEPTS)
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
-template <typename T, typename = void,
- typename = void, typename = void, typename = void, typename = void,
- typename = void, typename = void, typename = void, typename = void>
-struct is_receiver_of;
-
-template <typename T>
-struct is_receiver_of<T> :
- conditional<
- is_receiver<T>::value,
- can_set_value<typename remove_cvref<T>::type>,
- false_type
- >::type
-{
-};
-
-#define ASIO_PRIVATE_RECEIVER_OF_TRAITS_DEF(n) \
- template <typename T, ASIO_VARIADIC_TPARAMS(n)> \
- struct is_receiver_of<T, ASIO_VARIADIC_TARGS(n)> : \
- conditional< \
- conditional<true, is_receiver<T>, void>::type::value, \
- can_set_value< \
- typename remove_cvref<T>::type, \
- ASIO_VARIADIC_TARGS(n)>, \
- false_type \
- >::type \
- { \
- }; \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_RECEIVER_OF_TRAITS_DEF)
-#undef ASIO_PRIVATE_RECEIVER_OF_TRAITS_DEF
-
-#define ASIO_EXECUTION_RECEIVER_OF_0 typename
-#define ASIO_EXECUTION_RECEIVER_OF_1(v) typename
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
-
-/// The is_nothrow_receiver_of trait detects whether a type T satisfies the
-/// execution::receiver_of concept for some set of value arguments, with a
-/// noexcept @c set_value operation.
-/**
- * Class template @c is_nothrow_receiver_of is a type trait that is derived
- * from @c true_type if the type @c T meets the concept definition for a
- * receiver for value arguments @c Vs, and the expression
- * <tt>execution::set_value(declval<T>(), declval<Ts>()...)</tt> is noexcept,
- * otherwise @c false_type.
- */
-template <typename T, typename... Vs>
-struct is_nothrow_receiver_of :
-#if defined(GENERATING_DOCUMENTATION)
- integral_constant<bool, automatically_determined>
-#else // defined(GENERATING_DOCUMENTATION)
- integral_constant<bool,
- is_receiver_of<T, Vs...>::value
- && is_nothrow_set_value<typename remove_cvref<T>::type, Vs...>::value
- >
-#endif // defined(GENERATING_DOCUMENTATION)
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T, typename... Vs>
-ASIO_CONSTEXPR const bool is_nothrow_receiver_of_v =
- is_nothrow_receiver_of<T, Vs...>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
-template <typename T, typename = void,
- typename = void, typename = void, typename = void, typename = void,
- typename = void, typename = void, typename = void, typename = void>
-struct is_nothrow_receiver_of;
-
-template <typename T>
-struct is_nothrow_receiver_of<T> :
- integral_constant<bool,
- is_receiver_of<T>::value
- && is_nothrow_set_value<typename remove_cvref<T>::type>::value
- >
-{
-};
-
-#define ASIO_PRIVATE_NOTHROW_RECEIVER_OF_TRAITS_DEF(n) \
- template <typename T, ASIO_VARIADIC_TPARAMS(n)> \
- struct is_nothrow_receiver_of<T, ASIO_VARIADIC_TARGS(n)> : \
- integral_constant<bool, \
- is_receiver_of<T, ASIO_VARIADIC_TARGS(n)>::value \
- && is_nothrow_set_value<typename remove_cvref<T>::type, \
- ASIO_VARIADIC_TARGS(n)>::value \
- > \
- { \
- }; \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_NOTHROW_RECEIVER_OF_TRAITS_DEF)
-#undef ASIO_PRIVATE_NOTHROW_RECEIVER_OF_TRAITS_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
-} // namespace execution
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_RECEIVER_HPP
diff --git a/3rdparty/asio/include/asio/execution/receiver_invocation_error.hpp b/3rdparty/asio/include/asio/execution/receiver_invocation_error.hpp
deleted file mode 100644
index 00557da85e1..00000000000
--- a/3rdparty/asio/include/asio/execution/receiver_invocation_error.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// execution/receiver_invocation_error.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_RECEIVER_INVOCATION_ERROR_HPP
-#define ASIO_EXECUTION_RECEIVER_INVOCATION_ERROR_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include <stdexcept>
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-
-/// Exception reported via @c set_error when an exception escapes from
-/// @c set_value.
-class receiver_invocation_error
- : public std::runtime_error
-#if defined(ASIO_HAS_STD_NESTED_EXCEPTION)
- , public std::nested_exception
-#endif // defined(ASIO_HAS_STD_NESTED_EXCEPTION)
-{
-public:
- /// Constructor.
- ASIO_DECL receiver_invocation_error();
-};
-
-} // namespace execution
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#if defined(ASIO_HEADER_ONLY)
-# include "asio/execution/impl/receiver_invocation_error.ipp"
-#endif // defined(ASIO_HEADER_ONLY)
-
-#endif // ASIO_EXECUTION_RECEIVER_INVOCATION_ERROR_HPP
diff --git a/3rdparty/asio/include/asio/execution/relationship.hpp b/3rdparty/asio/include/asio/execution/relationship.hpp
index 95160e07f1a..e4f27555e24 100644
--- a/3rdparty/asio/include/asio/execution/relationship.hpp
+++ b/3rdparty/asio/include/asio/execution/relationship.hpp
@@ -2,7 +2,7 @@
// execution/relationship.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,8 +18,6 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution/executor.hpp"
-#include "asio/execution/scheduler.hpp"
-#include "asio/execution/sender.hpp"
#include "asio/is_applicable_property.hpp"
#include "asio/query.hpp"
#include "asio/traits/query_free.hpp"
@@ -40,10 +38,9 @@ namespace execution {
/// the calling context.
struct relationship_t
{
- /// The relationship_t property applies to executors, senders, and schedulers.
+ /// The relationship_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The top-level relationship_t property cannot be required.
static constexpr bool is_requirable = false;
@@ -58,11 +55,9 @@ struct relationship_t
/// continuation of the calling context.
struct fork_t
{
- /// The relationship_t::fork_t property applies to executors, senders, and
- /// schedulers.
+ /// The relationship_t::fork_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The relationship_t::fork_t property can be required.
static constexpr bool is_requirable = true;
@@ -87,11 +82,9 @@ struct relationship_t
/// of the calling context.
struct continuation_t
{
- /// The relationship_t::continuation_t property applies to executors,
- /// senders, and schedulers.
+ /// The relationship_t::continuation_t property applies to executors.
template <typename T>
- static constexpr bool is_applicable_property_v =
- is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
+ static constexpr bool is_applicable_property_v = is_executor_v<T>;
/// The relationship_t::continuation_t property can be required.
static constexpr bool is_requirable = true;
@@ -158,39 +151,27 @@ struct relationship_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
+ static constexpr bool is_requirable = false;
+ static constexpr bool is_preferable = false;
typedef relationship_t polymorphic_query_result_type;
typedef detail::relationship::fork_t<I> fork_t;
typedef detail::relationship::continuation_t<I> continuation_t;
- ASIO_CONSTEXPR relationship_t()
+ constexpr relationship_t()
: value_(-1)
{
}
- ASIO_CONSTEXPR relationship_t(fork_t)
+ constexpr relationship_t(fork_t)
: value_(0)
{
}
- ASIO_CONSTEXPR relationship_t(continuation_t)
+ constexpr relationship_t(continuation_t)
: value_(1)
{
}
@@ -202,16 +183,14 @@ struct relationship_t
struct type
{
template <typename P>
- auto query(ASIO_MOVE_ARG(P) p) const
+ auto query(P&& p) const
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -226,17 +205,17 @@ struct relationship_t
struct type
{
template <typename P>
- static constexpr auto query(ASIO_MOVE_ARG(P) p)
+ static constexpr auto query(P&& p)
noexcept(
noexcept(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
)
-> decltype(
- conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
+ conditional_t<true, T, P>::query(static_cast<P&&>(p))
)
{
- return T::query(ASIO_MOVE_CAST(P)(p));
+ return T::query(static_cast<P&&>(p));
}
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
@@ -256,66 +235,65 @@ struct relationship_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, fork_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, fork_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, fork_t>::value();
}
template <typename T>
- static ASIO_CONSTEXPR
+ static constexpr
typename traits::static_query<T, continuation_t>::result_type
static_query(
- typename enable_if<
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::static_query<T, fork_t>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
traits::static_query<T, continuation_t>::is_valid
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0) noexcept
{
return traits::static_query<T, continuation_t>::value();
}
template <typename E,
typename T = decltype(relationship_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= relationship_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- friend ASIO_CONSTEXPR bool operator==(
+ friend constexpr bool operator==(
const relationship_t& a, const relationship_t& b)
{
return a.value_ == b.value_;
}
- friend ASIO_CONSTEXPR bool operator!=(
+ friend constexpr bool operator!=(
const relationship_t& a, const relationship_t& b)
{
return a.value_ != b.value_;
@@ -323,24 +301,22 @@ struct relationship_t
struct convertible_from_relationship_t
{
- ASIO_CONSTEXPR convertible_from_relationship_t(relationship_t)
+ constexpr convertible_from_relationship_t(relationship_t)
{
}
};
template <typename Executor>
- friend ASIO_CONSTEXPR relationship_t query(
+ friend constexpr relationship_t query(
const Executor& ex, convertible_from_relationship_t,
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, fork_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, relationship_t<>::fork_t>::value))
+ noexcept(is_nothrow_query<const Executor&, relationship_t<>::fork_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, fork_t>::value))
+ noexcept(is_nothrow_query<const Executor&, fork_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -348,22 +324,20 @@ struct relationship_t
}
template <typename Executor>
- friend ASIO_CONSTEXPR relationship_t query(
+ friend constexpr relationship_t query(
const Executor& ex, convertible_from_relationship_t,
- typename enable_if<
+ enable_if_t<
!can_query<const Executor&, fork_t>::value
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
can_query<const Executor&, continuation_t>::value
- >::type* = 0)
+ >* = 0)
#if !defined(__clang__) // Clang crashes if noexcept is used here.
#if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&,
- relationship_t<>::continuation_t>::value))
+ noexcept(is_nothrow_query<const Executor&,
+ relationship_t<>::continuation_t>::value)
#else // defined(ASIO_MSVC)
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, continuation_t>::value))
+ noexcept(is_nothrow_query<const Executor&, continuation_t>::value)
#endif // defined(ASIO_MSVC)
#endif // !defined(__clang__)
{
@@ -373,10 +347,6 @@ struct relationship_t
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(fork_t, fork);
ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(continuation_t, continuation);
-#if !defined(ASIO_HAS_CONSTEXPR)
- static const relationship_t instance;
-#endif // !defined(ASIO_HAS_CONSTEXPR)
-
private:
int value_;
};
@@ -388,14 +358,8 @@ const T relationship_t<I>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_CONSTEXPR)
template <int I>
-const relationship_t<I> relationship_t<I>::instance;
-#endif
-
-template <int I>
-const typename relationship_t<I>::fork_t
-relationship_t<I>::fork;
+const typename relationship_t<I>::fork_t relationship_t<I>::fork;
template <int I>
const typename relationship_t<I>::continuation_t
@@ -408,26 +372,14 @@ struct fork_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef relationship_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR fork_t()
+ constexpr fork_t()
{
}
@@ -444,55 +396,61 @@ struct fork_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename T>
- static ASIO_CONSTEXPR fork_t static_query(
- typename enable_if<
+ static constexpr fork_t static_query(
+ enable_if_t<
!query_static_constexpr_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!query_member<T>::is_valid
- >::type* = 0,
- typename enable_if<
+ >* = 0,
+ enable_if_t<
!traits::query_free<T, fork_t>::is_valid
- >::type* = 0,
- typename enable_if<
- !can_query<T, continuation_t<I> >::value
- >::type* = 0) ASIO_NOEXCEPT
+ >* = 0,
+ enable_if_t<
+ !can_query<T, continuation_t<I>>::value
+ >* = 0) noexcept
{
return fork_t();
}
template <typename E, typename T = decltype(fork_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= fork_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR relationship_t<I> value()
+ static constexpr relationship_t<I> value()
{
return fork_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const fork_t&, const fork_t&)
+ friend constexpr bool operator==(const fork_t&, const fork_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const fork_t&, const fork_t&)
+ friend constexpr bool operator!=(const fork_t&, const fork_t&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator==(const fork_t&, const continuation_t<I>&)
{
return false;
}
+
+ friend constexpr bool operator!=(const fork_t&, const continuation_t<I>&)
+ {
+ return true;
+ }
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -507,26 +465,14 @@ struct continuation_t
{
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T>
- ASIO_STATIC_CONSTEXPR(bool,
- is_applicable_property_v = (
- is_executor<T>::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_sender<T>
- >::type::value
- || conditional<
- is_executor<T>::value,
- false_type,
- is_scheduler<T>
- >::type::value));
+ static constexpr bool is_applicable_property_v = is_executor<T>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
- ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
- ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
+ static constexpr bool is_requirable = true;
+ static constexpr bool is_preferable = true;
typedef relationship_t<I> polymorphic_query_result_type;
- ASIO_CONSTEXPR continuation_t()
+ constexpr continuation_t()
{
}
@@ -544,38 +490,44 @@ struct continuation_t
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
&& defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
template <typename T>
- static ASIO_CONSTEXPR
- typename query_static_constexpr_member<T>::result_type
+ static constexpr typename query_static_constexpr_member<T>::result_type
static_query()
- ASIO_NOEXCEPT_IF((
- query_static_constexpr_member<T>::is_noexcept))
+ noexcept(query_static_constexpr_member<T>::is_noexcept)
{
return query_static_constexpr_member<T>::value();
}
template <typename E,
typename T = decltype(continuation_t::static_query<E>())>
- static ASIO_CONSTEXPR const T static_query_v
+ static constexpr const T static_query_v
= continuation_t::static_query<E>();
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
- static ASIO_CONSTEXPR relationship_t<I> value()
+ static constexpr relationship_t<I> value()
{
return continuation_t();
}
- friend ASIO_CONSTEXPR bool operator==(
- const continuation_t&, const continuation_t&)
+ friend constexpr bool operator==(const continuation_t&, const continuation_t&)
{
return true;
}
- friend ASIO_CONSTEXPR bool operator!=(
- const continuation_t&, const continuation_t&)
+ friend constexpr bool operator!=(const continuation_t&, const continuation_t&)
{
return false;
}
+
+ friend constexpr bool operator==(const continuation_t&, const fork_t<I>&)
+ {
+ return false;
+ }
+
+ friend constexpr bool operator!=(const continuation_t&, const fork_t<I>&)
+ {
+ return true;
+ }
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
@@ -590,12 +542,7 @@ const T continuation_t<I>::static_query_v;
typedef detail::relationship_t<> relationship_t;
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr relationship_t relationship;
-#else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-namespace { static const relationship_t&
- relationship = relationship_t::instance; }
-#endif
} // namespace execution
@@ -603,52 +550,19 @@ namespace { static const relationship_t&
template <typename T>
struct is_applicable_property<T, execution::relationship_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::relationship_t::fork_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
template <typename T>
struct is_applicable_property<T, execution::relationship_t::continuation_t>
- : integral_constant<bool,
- execution::is_executor<T>::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_sender<T>
- >::type::value
- || conditional<
- execution::is_executor<T>::value,
- false_type,
- execution::is_scheduler<T>
- >::type::value>
+ : integral_constant<bool, execution::is_executor<T>::value>
{
};
@@ -660,27 +574,27 @@ namespace traits {
template <typename T>
struct query_free_default<T, execution::relationship_t,
- typename enable_if<
+ enable_if_t<
can_query<T, execution::relationship_t::fork_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::relationship_t::fork_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::relationship_t::fork_t>::value;
typedef execution::relationship_t result_type;
};
template <typename T>
struct query_free_default<T, execution::relationship_t,
- typename enable_if<
+ enable_if_t<
!can_query<T, execution::relationship_t::fork_t>::value
&& can_query<T, execution::relationship_t::continuation_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<T, execution::relationship_t::continuation_t>::value));
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<T, execution::relationship_t::continuation_t>::value;
typedef execution::relationship_t result_type;
};
@@ -692,18 +606,18 @@ struct query_free_default<T, execution::relationship_t,
template <typename T>
struct static_query<T, execution::relationship_t,
- typename enable_if<
+ enable_if_t<
execution::detail::relationship_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::relationship_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::relationship_t<0>::
query_static_constexpr_member<T>::value();
@@ -712,22 +626,22 @@ struct static_query<T, execution::relationship_t,
template <typename T>
struct static_query<T, execution::relationship_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::relationship_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::relationship_t<0>::
query_member<T>::is_valid
&& traits::static_query<T,
execution::relationship_t::fork_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::relationship_t::fork_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T,
execution::relationship_t::fork_t>::value();
@@ -736,7 +650,7 @@ struct static_query<T, execution::relationship_t,
template <typename T>
struct static_query<T, execution::relationship_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::relationship_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::relationship_t<0>::
@@ -745,15 +659,15 @@ struct static_query<T, execution::relationship_t,
execution::relationship_t::fork_t>::is_valid
&& traits::static_query<T,
execution::relationship_t::continuation_t>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename traits::static_query<T,
execution::relationship_t::continuation_t>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return traits::static_query<T,
execution::relationship_t::continuation_t>::value();
@@ -762,18 +676,18 @@ struct static_query<T, execution::relationship_t,
template <typename T>
struct static_query<T, execution::relationship_t::fork_t,
- typename enable_if<
+ enable_if_t<
execution::detail::relationship::fork_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::relationship::fork_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::relationship::fork_t<0>::
query_static_constexpr_member<T>::value();
@@ -782,7 +696,7 @@ struct static_query<T, execution::relationship_t::fork_t,
template <typename T>
struct static_query<T, execution::relationship_t::fork_t,
- typename enable_if<
+ enable_if_t<
!execution::detail::relationship::fork_t<0>::
query_static_constexpr_member<T>::is_valid
&& !execution::detail::relationship::fork_t<0>::
@@ -790,14 +704,14 @@ struct static_query<T, execution::relationship_t::fork_t,
&& !traits::query_free<T,
execution::relationship_t::fork_t>::is_valid
&& !can_query<T, execution::relationship_t::continuation_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::relationship_t::fork_t result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return result_type();
}
@@ -805,18 +719,18 @@ struct static_query<T, execution::relationship_t::fork_t,
template <typename T>
struct static_query<T, execution::relationship_t::continuation_t,
- typename enable_if<
+ enable_if_t<
execution::detail::relationship::continuation_t<0>::
query_static_constexpr_member<T>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef typename execution::detail::relationship::continuation_t<0>::
query_static_constexpr_member<T>::result_type result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return execution::detail::relationship::continuation_t<0>::
query_static_constexpr_member<T>::value();
@@ -826,34 +740,6 @@ struct static_query<T, execution::relationship_t::continuation_t,
#endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-#if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
-template <typename T>
-struct static_require<T, execution::relationship_t::fork_t,
- typename enable_if<
- static_query<T, execution::relationship_t::fork_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::relationship_t::fork_t>::result_type,
- execution::relationship_t::fork_t>::value));
-};
-
-template <typename T>
-struct static_require<T, execution::relationship_t::continuation_t,
- typename enable_if<
- static_query<T, execution::relationship_t::continuation_t>::is_valid
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid =
- (is_same<typename static_query<T,
- execution::relationship_t::continuation_t>::result_type,
- execution::relationship_t::continuation_t>::value));
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
} // namespace traits
#endif // defined(GENERATING_DOCUMENTATION)
diff --git a/3rdparty/asio/include/asio/execution/schedule.hpp b/3rdparty/asio/include/asio/execution/schedule.hpp
deleted file mode 100644
index fde0cdda599..00000000000
--- a/3rdparty/asio/include/asio/execution/schedule.hpp
+++ /dev/null
@@ -1,287 +0,0 @@
-//
-// execution/schedule.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_SCHEDULE_HPP
-#define ASIO_EXECUTION_SCHEDULE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/executor.hpp"
-#include "asio/traits/schedule_member.hpp"
-#include "asio/traits/schedule_free.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-/// A customisation point that is used to obtain a sender from a scheduler.
-/**
- * The name <tt>execution::schedule</tt> denotes a customisation point object.
- * For some subexpression <tt>s</tt>, let <tt>S</tt> be a type such that
- * <tt>decltype((s))</tt> is <tt>S</tt>. The expression
- * <tt>execution::schedule(s)</tt> is expression-equivalent to:
- *
- * @li <tt>s.schedule()</tt>, if that expression is valid and its type models
- * <tt>sender</tt>.
- *
- * @li Otherwise, <tt>schedule(s)</tt>, if that expression is valid and its
- * type models <tt>sender</tt> with overload resolution performed in a context
- * that includes the declaration <tt>void schedule();</tt> and that does not
- * include a declaration of <tt>execution::schedule</tt>.
- *
- * @li Otherwise, <tt>S</tt> if <tt>S</tt> satisfies <tt>executor</tt>.
- *
- * @li Otherwise, <tt>execution::schedule(s)</tt> is ill-formed.
- */
-inline constexpr unspecified schedule = unspecified;
-
-/// A type trait that determines whether a @c schedule expression is
-/// well-formed.
-/**
- * Class template @c can_schedule is a trait that is derived from @c true_type
- * if the expression <tt>execution::schedule(std::declval<S>())</tt> is well
- * formed; otherwise @c false_type.
- */
-template <typename S>
-struct can_schedule :
- integral_constant<bool, automatically_determined>
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace asio_execution_schedule_fn {
-
-using asio::decay;
-using asio::declval;
-using asio::enable_if;
-using asio::execution::is_executor;
-using asio::traits::schedule_free;
-using asio::traits::schedule_member;
-
-void schedule();
-
-enum overload_type
-{
- identity,
- call_member,
- call_free,
- ill_formed
-};
-
-template <typename S, typename = void, typename = void, typename = void>
-struct call_traits
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename S>
-struct call_traits<S,
- typename enable_if<
- schedule_member<S>::is_valid
- >::type> :
- schedule_member<S>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
-};
-
-template <typename S>
-struct call_traits<S,
- typename enable_if<
- !schedule_member<S>::is_valid
- >::type,
- typename enable_if<
- schedule_free<S>::is_valid
- >::type> :
- schedule_free<S>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
-};
-
-template <typename S>
-struct call_traits<S,
- typename enable_if<
- !schedule_member<S>::is_valid
- >::type,
- typename enable_if<
- !schedule_free<S>::is_valid
- >::type,
- typename enable_if<
- is_executor<typename decay<S>::type>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = identity);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
-#if defined(ASIO_HAS_MOVE)
- typedef ASIO_MOVE_ARG(S) result_type;
-#else // defined(ASIO_HAS_MOVE)
- typedef ASIO_MOVE_ARG(typename decay<S>::type) result_type;
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-struct impl
-{
- template <typename S>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S>::overload == identity,
- typename call_traits<S>::result_type
- >::type
- operator()(ASIO_MOVE_ARG(S) s) const
- ASIO_NOEXCEPT_IF((
- call_traits<S>::is_noexcept))
- {
- return ASIO_MOVE_CAST(S)(s);
- }
-
-#if defined(ASIO_HAS_MOVE)
- template <typename S>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S>::overload == call_member,
- typename call_traits<S>::result_type
- >::type
- operator()(S&& s) const
- ASIO_NOEXCEPT_IF((
- call_traits<S>::is_noexcept))
- {
- return ASIO_MOVE_CAST(S)(s).schedule();
- }
-
- template <typename S>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S>::overload == call_free,
- typename call_traits<S>::result_type
- >::type
- operator()(S&& s) const
- ASIO_NOEXCEPT_IF((
- call_traits<S>::is_noexcept))
- {
- return schedule(ASIO_MOVE_CAST(S)(s));
- }
-#else // defined(ASIO_HAS_MOVE)
- template <typename S>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&>::overload == call_member,
- typename call_traits<S&>::result_type
- >::type
- operator()(S& s) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&>::is_noexcept))
- {
- return s.schedule();
- }
-
- template <typename S>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&>::overload == call_member,
- typename call_traits<const S&>::result_type
- >::type
- operator()(const S& s) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&>::is_noexcept))
- {
- return s.schedule();
- }
-
- template <typename S>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&>::overload == call_free,
- typename call_traits<S&>::result_type
- >::type
- operator()(S& s) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&>::is_noexcept))
- {
- return schedule(s);
- }
-
- template <typename S>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&>::overload == call_free,
- typename call_traits<const S&>::result_type
- >::type
- operator()(const S& s) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&>::is_noexcept))
- {
- return schedule(s);
- }
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-template <typename T = impl>
-struct static_instance
-{
- static const T instance;
-};
-
-template <typename T>
-const T static_instance<T>::instance = {};
-
-} // namespace asio_execution_schedule_fn
-namespace asio {
-namespace execution {
-namespace {
-
-static ASIO_CONSTEXPR const asio_execution_schedule_fn::impl&
- schedule = asio_execution_schedule_fn::static_instance<>::instance;
-
-} // namespace
-
-template <typename S>
-struct can_schedule :
- integral_constant<bool,
- asio_execution_schedule_fn::call_traits<S>::overload !=
- asio_execution_schedule_fn::ill_formed>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S>
-constexpr bool can_schedule_v = can_schedule<S>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S>
-struct is_nothrow_schedule :
- integral_constant<bool,
- asio_execution_schedule_fn::call_traits<S>::is_noexcept>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S>
-constexpr bool is_nothrow_schedule_v
- = is_nothrow_schedule<S>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-} // namespace execution
-} // namespace asio
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_SCHEDULE_HPP
diff --git a/3rdparty/asio/include/asio/execution/scheduler.hpp b/3rdparty/asio/include/asio/execution/scheduler.hpp
deleted file mode 100644
index b99ab3c7e9f..00000000000
--- a/3rdparty/asio/include/asio/execution/scheduler.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// execution/scheduler.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_SCHEDULER_HPP
-#define ASIO_EXECUTION_SCHEDULER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/schedule.hpp"
-#include "asio/traits/equality_comparable.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-template <typename T>
-struct is_scheduler_base :
- integral_constant<bool,
- is_copy_constructible<typename remove_cvref<T>::type>::value
- && traits::equality_comparable<typename remove_cvref<T>::type>::is_valid
- >
-{
-};
-
-} // namespace detail
-
-/// The is_scheduler trait detects whether a type T satisfies the
-/// execution::scheduler concept.
-/**
- * Class template @c is_scheduler is a type trait that is derived from @c
- * true_type if the type @c T meets the concept definition for a scheduler for
- * error type @c E, otherwise @c false_type.
- */
-template <typename T>
-struct is_scheduler :
-#if defined(GENERATING_DOCUMENTATION)
- integral_constant<bool, automatically_determined>
-#else // defined(GENERATING_DOCUMENTATION)
- conditional<
- can_schedule<T>::value,
- detail::is_scheduler_base<T>,
- false_type
- >::type
-#endif // defined(GENERATING_DOCUMENTATION)
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T>
-ASIO_CONSTEXPR const bool is_scheduler_v = is_scheduler<T>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#if defined(ASIO_HAS_CONCEPTS)
-
-template <typename T>
-ASIO_CONCEPT scheduler = is_scheduler<T>::value;
-
-#define ASIO_EXECUTION_SCHEDULER ::asio::execution::scheduler
-
-#else // defined(ASIO_HAS_CONCEPTS)
-
-#define ASIO_EXECUTION_SCHEDULER typename
-
-#endif // defined(ASIO_HAS_CONCEPTS)
-
-} // namespace execution
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_SCHEDULER_HPP
diff --git a/3rdparty/asio/include/asio/execution/sender.hpp b/3rdparty/asio/include/asio/execution/sender.hpp
deleted file mode 100644
index 4e4ba476b01..00000000000
--- a/3rdparty/asio/include/asio/execution/sender.hpp
+++ /dev/null
@@ -1,311 +0,0 @@
-//
-// execution/sender.hpp
-// ~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_SENDER_HPP
-#define ASIO_EXECUTION_SENDER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/detail/as_invocable.hpp"
-#include "asio/execution/detail/void_receiver.hpp"
-#include "asio/execution/executor.hpp"
-#include "asio/execution/receiver.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(ASIO_HAS_ALIAS_TEMPLATES) \
- && defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- && defined(ASIO_HAS_DECLTYPE) \
- && !defined(ASIO_MSVC) || (_MSC_VER >= 1910)
-# define ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT 1
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
- // && defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // && defined(ASIO_HAS_DECLTYPE)
- // && !defined(ASIO_MSVC) || (_MSC_VER >= 1910)
-
-namespace asio {
-namespace execution {
-namespace detail {
-
-namespace sender_base_ns { struct sender_base {}; }
-
-template <typename S, typename = void>
-struct sender_traits_base
-{
- typedef void asio_execution_sender_traits_base_is_unspecialised;
-};
-
-template <typename S>
-struct sender_traits_base<S,
- typename enable_if<
- is_base_of<sender_base_ns::sender_base, S>::value
- >::type>
-{
-};
-
-template <typename S, typename = void, typename = void, typename = void>
-struct has_sender_types : false_type
-{
-};
-
-#if defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
-
-template <
- template <
- template <typename...> class Tuple,
- template <typename...> class Variant
- > class>
-struct has_value_types
-{
- typedef void type;
-};
-
-template <
- template <
- template <typename...> class Variant
- > class>
-struct has_error_types
-{
- typedef void type;
-};
-
-template <typename S>
-struct has_sender_types<S,
- typename has_value_types<S::template value_types>::type,
- typename has_error_types<S::template error_types>::type,
- typename conditional<S::sends_done, void, void>::type> : true_type
-{
-};
-
-template <typename S>
-struct sender_traits_base<S,
- typename enable_if<
- has_sender_types<S>::value
- >::type>
-{
- template <
- template <typename...> class Tuple,
- template <typename...> class Variant>
- using value_types = typename S::template value_types<Tuple, Variant>;
-
- template <template <typename...> class Variant>
- using error_types = typename S::template error_types<Variant>;
-
- ASIO_STATIC_CONSTEXPR(bool, sends_done = S::sends_done);
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
-
-template <typename S>
-struct sender_traits_base<S,
- typename enable_if<
- !has_sender_types<S>::value
- && detail::is_executor_of_impl<S,
- as_invocable<void_receiver, S> >::value
- >::type>
-{
-#if defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT) \
- && defined(ASIO_HAS_STD_EXCEPTION_PTR)
-
- template <
- template <typename...> class Tuple,
- template <typename...> class Variant>
- using value_types = Variant<Tuple<>>;
-
- template <template <typename...> class Variant>
- using error_types = Variant<std::exception_ptr>;
-
- ASIO_STATIC_CONSTEXPR(bool, sends_done = true);
-
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
- // && defined(ASIO_HAS_STD_EXCEPTION_PTR)
-};
-
-} // namespace detail
-
-/// Base class used for tagging senders.
-#if defined(GENERATING_DOCUMENTATION)
-typedef unspecified sender_base;
-#else // defined(GENERATING_DOCUMENTATION)
-typedef detail::sender_base_ns::sender_base sender_base;
-#endif // defined(GENERATING_DOCUMENTATION)
-
-/// Traits for senders.
-template <typename S>
-struct sender_traits
-#if !defined(GENERATING_DOCUMENTATION)
- : detail::sender_traits_base<S>
-#endif // !defined(GENERATING_DOCUMENTATION)
-{
-};
-
-namespace detail {
-
-template <typename S, typename = void>
-struct has_sender_traits : true_type
-{
-};
-
-template <typename S>
-struct has_sender_traits<S,
- typename enable_if<
- is_same<
- typename asio::execution::sender_traits<
- S>::asio_execution_sender_traits_base_is_unspecialised,
- void
- >::value
- >::type> : false_type
-{
-};
-
-} // namespace detail
-
-/// The is_sender trait detects whether a type T satisfies the
-/// execution::sender concept.
-
-/**
- * Class template @c is_sender is a type trait that is derived from @c
- * true_type if the type @c T meets the concept definition for a sender,
- * otherwise @c false_type.
- */
-template <typename T>
-struct is_sender :
-#if defined(GENERATING_DOCUMENTATION)
- integral_constant<bool, automatically_determined>
-#else // defined(GENERATING_DOCUMENTATION)
- conditional<
- detail::has_sender_traits<typename remove_cvref<T>::type>::value,
- is_move_constructible<typename remove_cvref<T>::type>,
- false_type
- >::type
-#endif // defined(GENERATING_DOCUMENTATION)
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T>
-ASIO_CONSTEXPR const bool is_sender_v = is_sender<T>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#if defined(ASIO_HAS_CONCEPTS)
-
-template <typename T>
-ASIO_CONCEPT sender = is_sender<T>::value;
-
-#define ASIO_EXECUTION_SENDER ::asio::execution::sender
-
-#else // defined(ASIO_HAS_CONCEPTS)
-
-#define ASIO_EXECUTION_SENDER typename
-
-#endif // defined(ASIO_HAS_CONCEPTS)
-
-template <typename S, typename R>
-struct can_connect;
-
-/// The is_sender_to trait detects whether a type T satisfies the
-/// execution::sender_to concept for some receiver.
-/**
- * Class template @c is_sender_to is a type trait that is derived from @c
- * true_type if the type @c T meets the concept definition for a sender
- * for some receiver type R, otherwise @c false.
- */
-template <typename T, typename R>
-struct is_sender_to :
-#if defined(GENERATING_DOCUMENTATION)
- integral_constant<bool, automatically_determined>
-#else // defined(GENERATING_DOCUMENTATION)
- integral_constant<bool,
- is_sender<T>::value
- && is_receiver<R>::value
- && can_connect<T, R>::value
- >
-#endif // defined(GENERATING_DOCUMENTATION)
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T, typename R>
-ASIO_CONSTEXPR const bool is_sender_to_v =
- is_sender_to<T, R>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#if defined(ASIO_HAS_CONCEPTS)
-
-template <typename T, typename R>
-ASIO_CONCEPT sender_to = is_sender_to<T, R>::value;
-
-#define ASIO_EXECUTION_SENDER_TO(r) \
- ::asio::execution::sender_to<r>
-
-#else // defined(ASIO_HAS_CONCEPTS)
-
-#define ASIO_EXECUTION_SENDER_TO(r) typename
-
-#endif // defined(ASIO_HAS_CONCEPTS)
-
-/// The is_typed_sender trait detects whether a type T satisfies the
-/// execution::typed_sender concept.
-/**
- * Class template @c is_typed_sender is a type trait that is derived from @c
- * true_type if the type @c T meets the concept definition for a typed sender,
- * otherwise @c false.
- */
-template <typename T>
-struct is_typed_sender :
-#if defined(GENERATING_DOCUMENTATION)
- integral_constant<bool, automatically_determined>
-#else // defined(GENERATING_DOCUMENTATION)
- integral_constant<bool,
- is_sender<T>::value
- && detail::has_sender_types<
- sender_traits<typename remove_cvref<T>::type> >::value
- >
-#endif // defined(GENERATING_DOCUMENTATION)
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename T>
-ASIO_CONSTEXPR const bool is_typed_sender_v = is_typed_sender<T>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#if defined(ASIO_HAS_CONCEPTS)
-
-template <typename T>
-ASIO_CONCEPT typed_sender = is_typed_sender<T>::value;
-
-#define ASIO_EXECUTION_TYPED_SENDER \
- ::asio::execution::typed_sender
-
-#else // defined(ASIO_HAS_CONCEPTS)
-
-#define ASIO_EXECUTION_TYPED_SENDER typename
-
-#endif // defined(ASIO_HAS_CONCEPTS)
-
-} // namespace execution
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#include "asio/execution/connect.hpp"
-
-#endif // ASIO_EXECUTION_SENDER_HPP
diff --git a/3rdparty/asio/include/asio/execution/set_done.hpp b/3rdparty/asio/include/asio/execution/set_done.hpp
deleted file mode 100644
index ae26869a020..00000000000
--- a/3rdparty/asio/include/asio/execution/set_done.hpp
+++ /dev/null
@@ -1,250 +0,0 @@
-//
-// execution/set_done.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_SET_DONE_HPP
-#define ASIO_EXECUTION_SET_DONE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/traits/set_done_member.hpp"
-#include "asio/traits/set_done_free.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-/// A customisation point that delivers a done notification to a receiver.
-/**
- * The name <tt>execution::set_done</tt> denotes a customisation point object.
- * The expression <tt>execution::set_done(R)</tt> for some subexpression
- * <tt>R</tt> is expression-equivalent to:
- *
- * @li <tt>R.set_done()</tt>, if that expression is valid. If the function
- * selected does not signal the receiver <tt>R</tt>'s done channel, the
- * program is ill-formed with no diagnostic required.
- *
- * @li Otherwise, <tt>set_done(R)</tt>, if that expression is valid, with
- * overload resolution performed in a context that includes the declaration
- * <tt>void set_done();</tt> and that does not include a declaration of
- * <tt>execution::set_done</tt>. If the function selected by overload
- * resolution does not signal the receiver <tt>R</tt>'s done channel, the
- * program is ill-formed with no diagnostic required.
- *
- * @li Otherwise, <tt>execution::set_done(R)</tt> is ill-formed.
- */
-inline constexpr unspecified set_done = unspecified;
-
-/// A type trait that determines whether a @c set_done expression is
-/// well-formed.
-/**
- * Class template @c can_set_done is a trait that is derived from
- * @c true_type if the expression <tt>execution::set_done(std::declval<R>(),
- * std::declval<E>())</tt> is well formed; otherwise @c false_type.
- */
-template <typename R>
-struct can_set_done :
- integral_constant<bool, automatically_determined>
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace asio_execution_set_done_fn {
-
-using asio::decay;
-using asio::declval;
-using asio::enable_if;
-using asio::traits::set_done_free;
-using asio::traits::set_done_member;
-
-void set_done();
-
-enum overload_type
-{
- call_member,
- call_free,
- ill_formed
-};
-
-template <typename R, typename = void, typename = void>
-struct call_traits
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename R>
-struct call_traits<R,
- typename enable_if<
- set_done_member<R>::is_valid
- >::type> :
- set_done_member<R>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
-};
-
-template <typename R>
-struct call_traits<R,
- typename enable_if<
- !set_done_member<R>::is_valid
- >::type,
- typename enable_if<
- set_done_free<R>::is_valid
- >::type> :
- set_done_free<R>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
-};
-
-struct impl
-{
-#if defined(ASIO_HAS_MOVE)
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R>::overload == call_member,
- typename call_traits<R>::result_type
- >::type
- operator()(R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R>::is_noexcept))
- {
- return ASIO_MOVE_CAST(R)(r).set_done();
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R>::overload == call_free,
- typename call_traits<R>::result_type
- >::type
- operator()(R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R>::is_noexcept))
- {
- return set_done(ASIO_MOVE_CAST(R)(r));
- }
-#else // defined(ASIO_HAS_MOVE)
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&>::overload == call_member,
- typename call_traits<R&>::result_type
- >::type
- operator()(R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&>::is_noexcept))
- {
- return r.set_done();
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&>::overload == call_member,
- typename call_traits<const R&>::result_type
- >::type
- operator()(const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&>::is_noexcept))
- {
- return r.set_done();
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&>::overload == call_free,
- typename call_traits<R&>::result_type
- >::type
- operator()(R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&>::is_noexcept))
- {
- return set_done(r);
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&>::overload == call_free,
- typename call_traits<const R&>::result_type
- >::type
- operator()(const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&>::is_noexcept))
- {
- return set_done(r);
- }
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-template <typename T = impl>
-struct static_instance
-{
- static const T instance;
-};
-
-template <typename T>
-const T static_instance<T>::instance = {};
-
-} // namespace asio_execution_set_done_fn
-namespace asio {
-namespace execution {
-namespace {
-
-static ASIO_CONSTEXPR const asio_execution_set_done_fn::impl&
- set_done = asio_execution_set_done_fn::static_instance<>::instance;
-
-} // namespace
-
-template <typename R>
-struct can_set_done :
- integral_constant<bool,
- asio_execution_set_done_fn::call_traits<R>::overload !=
- asio_execution_set_done_fn::ill_formed>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R>
-constexpr bool can_set_done_v = can_set_done<R>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R>
-struct is_nothrow_set_done :
- integral_constant<bool,
- asio_execution_set_done_fn::call_traits<R>::is_noexcept>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R>
-constexpr bool is_nothrow_set_done_v
- = is_nothrow_set_done<R>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-} // namespace execution
-} // namespace asio
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_SET_DONE_HPP
diff --git a/3rdparty/asio/include/asio/execution/set_error.hpp b/3rdparty/asio/include/asio/execution/set_error.hpp
deleted file mode 100644
index 2aa3de3a6fc..00000000000
--- a/3rdparty/asio/include/asio/execution/set_error.hpp
+++ /dev/null
@@ -1,250 +0,0 @@
-//
-// execution/set_error.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_SET_ERROR_HPP
-#define ASIO_EXECUTION_SET_ERROR_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/traits/set_error_member.hpp"
-#include "asio/traits/set_error_free.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-/// A customisation point that delivers an error notification to a receiver.
-/**
- * The name <tt>execution::set_error</tt> denotes a customisation point object.
- * The expression <tt>execution::set_error(R, E)</tt> for some subexpressions
- * <tt>R</tt> and <tt>E</tt> are expression-equivalent to:
- *
- * @li <tt>R.set_error(E)</tt>, if that expression is valid. If the function
- * selected does not send the error <tt>E</tt> to the receiver <tt>R</tt>'s
- * error channel, the program is ill-formed with no diagnostic required.
- *
- * @li Otherwise, <tt>set_error(R, E)</tt>, if that expression is valid, with
- * overload resolution performed in a context that includes the declaration
- * <tt>void set_error();</tt> and that does not include a declaration of
- * <tt>execution::set_error</tt>. If the function selected by overload
- * resolution does not send the error <tt>E</tt> to the receiver <tt>R</tt>'s
- * error channel, the program is ill-formed with no diagnostic required.
- *
- * @li Otherwise, <tt>execution::set_error(R, E)</tt> is ill-formed.
- */
-inline constexpr unspecified set_error = unspecified;
-
-/// A type trait that determines whether a @c set_error expression is
-/// well-formed.
-/**
- * Class template @c can_set_error is a trait that is derived from
- * @c true_type if the expression <tt>execution::set_error(std::declval<R>(),
- * std::declval<E>())</tt> is well formed; otherwise @c false_type.
- */
-template <typename R, typename E>
-struct can_set_error :
- integral_constant<bool, automatically_determined>
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace asio_execution_set_error_fn {
-
-using asio::decay;
-using asio::declval;
-using asio::enable_if;
-using asio::traits::set_error_free;
-using asio::traits::set_error_member;
-
-void set_error();
-
-enum overload_type
-{
- call_member,
- call_free,
- ill_formed
-};
-
-template <typename R, typename E, typename = void, typename = void>
-struct call_traits
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename R, typename E>
-struct call_traits<R, void(E),
- typename enable_if<
- set_error_member<R, E>::is_valid
- >::type> :
- set_error_member<R, E>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
-};
-
-template <typename R, typename E>
-struct call_traits<R, void(E),
- typename enable_if<
- !set_error_member<R, E>::is_valid
- >::type,
- typename enable_if<
- set_error_free<R, E>::is_valid
- >::type> :
- set_error_free<R, E>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
-};
-
-struct impl
-{
-#if defined(ASIO_HAS_MOVE)
- template <typename R, typename E>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R, void(E)>::overload == call_member,
- typename call_traits<R, void(E)>::result_type
- >::type
- operator()(R&& r, E&& e) const
- ASIO_NOEXCEPT_IF((
- call_traits<R, void(E)>::is_noexcept))
- {
- return ASIO_MOVE_CAST(R)(r).set_error(ASIO_MOVE_CAST(E)(e));
- }
-
- template <typename R, typename E>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R, void(E)>::overload == call_free,
- typename call_traits<R, void(E)>::result_type
- >::type
- operator()(R&& r, E&& e) const
- ASIO_NOEXCEPT_IF((
- call_traits<R, void(E)>::is_noexcept))
- {
- return set_error(ASIO_MOVE_CAST(R)(r), ASIO_MOVE_CAST(E)(e));
- }
-#else // defined(ASIO_HAS_MOVE)
- template <typename R, typename E>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&, void(const E&)>::overload == call_member,
- typename call_traits<R&, void(const E&)>::result_type
- >::type
- operator()(R& r, const E& e) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&, void(const E&)>::is_noexcept))
- {
- return r.set_error(e);
- }
-
- template <typename R, typename E>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&, void(const E&)>::overload == call_member,
- typename call_traits<const R&, void(const E&)>::result_type
- >::type
- operator()(const R& r, const E& e) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&, void(const E&)>::is_noexcept))
- {
- return r.set_error(e);
- }
-
- template <typename R, typename E>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&, void(const E&)>::overload == call_free,
- typename call_traits<R&, void(const E&)>::result_type
- >::type
- operator()(R& r, const E& e) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&, void(const E&)>::is_noexcept))
- {
- return set_error(r, e);
- }
-
- template <typename R, typename E>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&, void(const E&)>::overload == call_free,
- typename call_traits<const R&, void(const E&)>::result_type
- >::type
- operator()(const R& r, const E& e) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&, void(const E&)>::is_noexcept))
- {
- return set_error(r, e);
- }
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-template <typename T = impl>
-struct static_instance
-{
- static const T instance;
-};
-
-template <typename T>
-const T static_instance<T>::instance = {};
-
-} // namespace asio_execution_set_error_fn
-namespace asio {
-namespace execution {
-namespace {
-
-static ASIO_CONSTEXPR const asio_execution_set_error_fn::impl&
- set_error = asio_execution_set_error_fn::static_instance<>::instance;
-
-} // namespace
-
-template <typename R, typename E>
-struct can_set_error :
- integral_constant<bool,
- asio_execution_set_error_fn::call_traits<R, void(E)>::overload !=
- asio_execution_set_error_fn::ill_formed>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R, typename E>
-constexpr bool can_set_error_v = can_set_error<R, E>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R, typename E>
-struct is_nothrow_set_error :
- integral_constant<bool,
- asio_execution_set_error_fn::call_traits<R, void(E)>::is_noexcept>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R, typename E>
-constexpr bool is_nothrow_set_error_v
- = is_nothrow_set_error<R, E>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-} // namespace execution
-} // namespace asio
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_SET_ERROR_HPP
diff --git a/3rdparty/asio/include/asio/execution/set_value.hpp b/3rdparty/asio/include/asio/execution/set_value.hpp
deleted file mode 100644
index 90d29dda540..00000000000
--- a/3rdparty/asio/include/asio/execution/set_value.hpp
+++ /dev/null
@@ -1,483 +0,0 @@
-//
-// execution/set_value.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_SET_VALUE_HPP
-#define ASIO_EXECUTION_SET_VALUE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
-#include "asio/traits/set_value_member.hpp"
-#include "asio/traits/set_value_free.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-/// A customisation point that delivers a value to a receiver.
-/**
- * The name <tt>execution::set_value</tt> denotes a customisation point object.
- * The expression <tt>execution::set_value(R, Vs...)</tt> for some
- * subexpressions <tt>R</tt> and <tt>Vs...</tt> is expression-equivalent to:
- *
- * @li <tt>R.set_value(Vs...)</tt>, if that expression is valid. If the
- * function selected does not send the value(s) <tt>Vs...</tt> to the receiver
- * <tt>R</tt>'s value channel, the program is ill-formed with no diagnostic
- * required.
- *
- * @li Otherwise, <tt>set_value(R, Vs...)</tt>, if that expression is valid,
- * with overload resolution performed in a context that includes the
- * declaration <tt>void set_value();</tt> and that does not include a
- * declaration of <tt>execution::set_value</tt>. If the function selected by
- * overload resolution does not send the value(s) <tt>Vs...</tt> to the
- * receiver <tt>R</tt>'s value channel, the program is ill-formed with no
- * diagnostic required.
- *
- * @li Otherwise, <tt>execution::set_value(R, Vs...)</tt> is ill-formed.
- */
-inline constexpr unspecified set_value = unspecified;
-
-/// A type trait that determines whether a @c set_value expression is
-/// well-formed.
-/**
- * Class template @c can_set_value is a trait that is derived from
- * @c true_type if the expression <tt>execution::set_value(std::declval<R>(),
- * std::declval<Vs>()...)</tt> is well formed; otherwise @c false_type.
- */
-template <typename R, typename... Vs>
-struct can_set_value :
- integral_constant<bool, automatically_determined>
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace asio_execution_set_value_fn {
-
-using asio::decay;
-using asio::declval;
-using asio::enable_if;
-using asio::traits::set_value_free;
-using asio::traits::set_value_member;
-
-void set_value();
-
-enum overload_type
-{
- call_member,
- call_free,
- ill_formed
-};
-
-template <typename R, typename Vs, typename = void, typename = void>
-struct call_traits
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename R, typename Vs>
-struct call_traits<R, Vs,
- typename enable_if<
- set_value_member<R, Vs>::is_valid
- >::type> :
- set_value_member<R, Vs>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
-};
-
-template <typename R, typename Vs>
-struct call_traits<R, Vs,
- typename enable_if<
- !set_value_member<R, Vs>::is_valid
- >::type,
- typename enable_if<
- set_value_free<R, Vs>::is_valid
- >::type> :
- set_value_free<R, Vs>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
-};
-
-struct impl
-{
-#if defined(ASIO_HAS_MOVE)
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename R, typename... Vs>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R, void(Vs...)>::overload == call_member,
- typename call_traits<R, void(Vs...)>::result_type
- >::type
- operator()(R&& r, Vs&&... v) const
- ASIO_NOEXCEPT_IF((
- call_traits<R, void(Vs...)>::is_noexcept))
- {
- return ASIO_MOVE_CAST(R)(r).set_value(ASIO_MOVE_CAST(Vs)(v)...);
- }
-
- template <typename R, typename... Vs>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R, void(Vs...)>::overload == call_free,
- typename call_traits<R, void(Vs...)>::result_type
- >::type
- operator()(R&& r, Vs&&... v) const
- ASIO_NOEXCEPT_IF((
- call_traits<R, void(Vs...)>::is_noexcept))
- {
- return set_value(ASIO_MOVE_CAST(R)(r),
- ASIO_MOVE_CAST(Vs)(v)...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R, void()>::overload == call_member,
- typename call_traits<R, void()>::result_type
- >::type
- operator()(R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R, void()>::is_noexcept))
- {
- return ASIO_MOVE_CAST(R)(r).set_value();
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R, void()>::overload == call_free,
- typename call_traits<R, void()>::result_type
- >::type
- operator()(R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R, void()>::is_noexcept))
- {
- return set_value(ASIO_MOVE_CAST(R)(r));
- }
-
-#define ASIO_PRIVATE_SET_VALUE_CALL_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- ASIO_CONSTEXPR typename enable_if< \
- call_traits<R, \
- void(ASIO_VARIADIC_TARGS(n))>::overload == call_member, \
- typename call_traits<R, void(ASIO_VARIADIC_TARGS(n))>::result_type \
- >::type \
- operator()(R&& r, ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- ASIO_NOEXCEPT_IF(( \
- call_traits<R, void(ASIO_VARIADIC_TARGS(n))>::is_noexcept)) \
- { \
- return ASIO_MOVE_CAST(R)(r).set_value( \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- ASIO_CONSTEXPR typename enable_if< \
- call_traits<R, void(ASIO_VARIADIC_TARGS(n))>::overload == call_free, \
- typename call_traits<R, void(ASIO_VARIADIC_TARGS(n))>::result_type \
- >::type \
- operator()(R&& r, ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- ASIO_NOEXCEPT_IF(( \
- call_traits<R, void(ASIO_VARIADIC_TARGS(n))>::is_noexcept)) \
- { \
- return set_value(ASIO_MOVE_CAST(R)(r), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SET_VALUE_CALL_DEF)
-#undef ASIO_PRIVATE_SET_VALUE_CALL_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#else // defined(ASIO_HAS_MOVE)
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename R, typename... Vs>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&, void(const Vs&...)>::overload == call_member,
- typename call_traits<R&, void(const Vs&...)>::result_type
- >::type
- operator()(R& r, const Vs&... v) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&, void(const Vs&...)>::is_noexcept))
- {
- return r.set_value(v...);
- }
-
- template <typename R, typename... Vs>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&, void(const Vs&...)>::overload == call_member,
- typename call_traits<const R&, void(const Vs&...)>::result_type
- >::type
- operator()(const R& r, const Vs&... v) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&, void(const Vs&...)>::is_noexcept))
- {
- return r.set_value(v...);
- }
-
- template <typename R, typename... Vs>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&, void(const Vs&...)>::overload == call_free,
- typename call_traits<R&, void(const Vs&...)>::result_type
- >::type
- operator()(R& r, const Vs&... v) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&, void(const Vs&...)>::is_noexcept))
- {
- return set_value(r, v...);
- }
-
- template <typename R, typename... Vs>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&, void(const Vs&...)>::overload == call_free,
- typename call_traits<const R&, void(const Vs&...)>::result_type
- >::type
- operator()(const R& r, const Vs&... v) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&, void(const Vs&...)>::is_noexcept))
- {
- return set_value(r, v...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&, void()>::overload == call_member,
- typename call_traits<R&, void()>::result_type
- >::type
- operator()(R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&, void()>::is_noexcept))
- {
- return r.set_value();
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&, void()>::overload == call_member,
- typename call_traits<const R&, void()>::result_type
- >::type
- operator()(const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&, void()>::is_noexcept))
- {
- return r.set_value();
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&, void()>::overload == call_free,
- typename call_traits<R&, void()>::result_type
- >::type
- operator()(R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&, void()>::is_noexcept))
- {
- return set_value(r);
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&, void()>::overload == call_free,
- typename call_traits<const R&, void()>::result_type
- >::type
- operator()(const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&, void()>::is_noexcept))
- {
- return set_value(r);
- }
-
-#define ASIO_PRIVATE_SET_VALUE_CALL_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- ASIO_CONSTEXPR typename enable_if< \
- call_traits<R&, \
- void(ASIO_VARIADIC_TARGS(n))>::overload == call_member, \
- typename call_traits<R&, void(ASIO_VARIADIC_TARGS(n))>::result_type \
- >::type \
- operator()(R& r, ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- ASIO_NOEXCEPT_IF(( \
- call_traits<R&, void(ASIO_VARIADIC_TARGS(n))>::is_noexcept)) \
- { \
- return r.set_value(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- ASIO_CONSTEXPR typename enable_if< \
- call_traits<const R&, \
- void(ASIO_VARIADIC_TARGS(n))>::overload == call_member, \
- typename call_traits<const R&, \
- void(ASIO_VARIADIC_TARGS(n))>::result_type \
- >::type \
- operator()(const R& r, ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- ASIO_NOEXCEPT_IF(( \
- call_traits<const R&, void(ASIO_VARIADIC_TARGS(n))>::is_noexcept)) \
- { \
- return r.set_value(ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- ASIO_CONSTEXPR typename enable_if< \
- call_traits<R&, \
- void(ASIO_VARIADIC_TARGS(n))>::overload == call_free, \
- typename call_traits<R&, void(ASIO_VARIADIC_TARGS(n))>::result_type \
- >::type \
- operator()(R& r, ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- ASIO_NOEXCEPT_IF(( \
- call_traits<R&, void(ASIO_VARIADIC_TARGS(n))>::is_noexcept)) \
- { \
- return set_value(r, ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- ASIO_CONSTEXPR typename enable_if< \
- call_traits<const R&, \
- void(ASIO_VARIADIC_TARGS(n))>::overload == call_free, \
- typename call_traits<const R&, \
- void(ASIO_VARIADIC_TARGS(n))>::result_type \
- >::type \
- operator()(const R& r, ASIO_VARIADIC_MOVE_PARAMS(n)) const \
- ASIO_NOEXCEPT_IF(( \
- call_traits<const R&, void(ASIO_VARIADIC_TARGS(n))>::is_noexcept)) \
- { \
- return set_value(r, ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SET_VALUE_CALL_DEF)
-#undef ASIO_PRIVATE_SET_VALUE_CALL_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-template <typename T = impl>
-struct static_instance
-{
- static const T instance;
-};
-
-template <typename T>
-const T static_instance<T>::instance = {};
-
-} // namespace asio_execution_set_value_fn
-namespace asio {
-namespace execution {
-namespace {
-
-static ASIO_CONSTEXPR const asio_execution_set_value_fn::impl&
- set_value = asio_execution_set_value_fn::static_instance<>::instance;
-
-} // namespace
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename R, typename... Vs>
-struct can_set_value :
- integral_constant<bool,
- asio_execution_set_value_fn::call_traits<R, void(Vs...)>::overload !=
- asio_execution_set_value_fn::ill_formed>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R, typename... Vs>
-constexpr bool can_set_value_v = can_set_value<R, Vs...>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R, typename... Vs>
-struct is_nothrow_set_value :
- integral_constant<bool,
- asio_execution_set_value_fn::call_traits<R, void(Vs...)>::is_noexcept>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R, typename... Vs>
-constexpr bool is_nothrow_set_value_v
- = is_nothrow_set_value<R, Vs...>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename R, typename = void,
- typename = void, typename = void, typename = void, typename = void,
- typename = void, typename = void, typename = void, typename = void>
-struct can_set_value;
-
-template <typename R, typename = void,
- typename = void, typename = void, typename = void, typename = void,
- typename = void, typename = void, typename = void, typename = void>
-struct is_nothrow_set_value;
-
-template <typename R>
-struct can_set_value<R> :
- integral_constant<bool,
- asio_execution_set_value_fn::call_traits<R, void()>::overload !=
- asio_execution_set_value_fn::ill_formed>
-{
-};
-
-template <typename R>
-struct is_nothrow_set_value<R> :
- integral_constant<bool,
- asio_execution_set_value_fn::call_traits<R, void()>::is_noexcept>
-{
-};
-
-#define ASIO_PRIVATE_SET_VALUE_TRAITS_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct can_set_value<R, ASIO_VARIADIC_TARGS(n)> : \
- integral_constant<bool, \
- asio_execution_set_value_fn::call_traits<R, \
- void(ASIO_VARIADIC_TARGS(n))>::overload != \
- asio_execution_set_value_fn::ill_formed> \
- { \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct is_nothrow_set_value<R, ASIO_VARIADIC_TARGS(n)> : \
- integral_constant<bool, \
- asio_execution_set_value_fn::call_traits<R, \
- void(ASIO_VARIADIC_TARGS(n))>::is_noexcept> \
- { \
- }; \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SET_VALUE_TRAITS_DEF)
-#undef ASIO_PRIVATE_SET_VALUE_TRAITS_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-} // namespace execution
-} // namespace asio
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_SET_VALUE_HPP
diff --git a/3rdparty/asio/include/asio/execution/start.hpp b/3rdparty/asio/include/asio/execution/start.hpp
deleted file mode 100644
index 80592356570..00000000000
--- a/3rdparty/asio/include/asio/execution/start.hpp
+++ /dev/null
@@ -1,247 +0,0 @@
-//
-// execution/start.hpp
-// ~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_START_HPP
-#define ASIO_EXECUTION_START_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/traits/start_member.hpp"
-#include "asio/traits/start_free.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-/// A customisation point that notifies an operation state object to start
-/// its associated operation.
-/**
- * The name <tt>execution::start</tt> denotes a customisation point object.
- * The expression <tt>execution::start(R)</tt> for some subexpression
- * <tt>R</tt> is expression-equivalent to:
- *
- * @li <tt>R.start()</tt>, if that expression is valid.
- *
- * @li Otherwise, <tt>start(R)</tt>, if that expression is valid, with
- * overload resolution performed in a context that includes the declaration
- * <tt>void start();</tt> and that does not include a declaration of
- * <tt>execution::start</tt>.
- *
- * @li Otherwise, <tt>execution::start(R)</tt> is ill-formed.
- */
-inline constexpr unspecified start = unspecified;
-
-/// A type trait that determines whether a @c start expression is
-/// well-formed.
-/**
- * Class template @c can_start is a trait that is derived from
- * @c true_type if the expression <tt>execution::start(std::declval<R>(),
- * std::declval<E>())</tt> is well formed; otherwise @c false_type.
- */
-template <typename R>
-struct can_start :
- integral_constant<bool, automatically_determined>
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace asio_execution_start_fn {
-
-using asio::decay;
-using asio::declval;
-using asio::enable_if;
-using asio::traits::start_free;
-using asio::traits::start_member;
-
-void start();
-
-enum overload_type
-{
- call_member,
- call_free,
- ill_formed
-};
-
-template <typename R, typename = void, typename = void>
-struct call_traits
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename R>
-struct call_traits<R,
- typename enable_if<
- start_member<R>::is_valid
- >::type> :
- start_member<R>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
-};
-
-template <typename R>
-struct call_traits<R,
- typename enable_if<
- !start_member<R>::is_valid
- >::type,
- typename enable_if<
- start_free<R>::is_valid
- >::type> :
- start_free<R>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
-};
-
-struct impl
-{
-#if defined(ASIO_HAS_MOVE)
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R>::overload == call_member,
- typename call_traits<R>::result_type
- >::type
- operator()(R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R>::is_noexcept))
- {
- return ASIO_MOVE_CAST(R)(r).start();
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R>::overload == call_free,
- typename call_traits<R>::result_type
- >::type
- operator()(R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R>::is_noexcept))
- {
- return start(ASIO_MOVE_CAST(R)(r));
- }
-#else // defined(ASIO_HAS_MOVE)
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&>::overload == call_member,
- typename call_traits<R&>::result_type
- >::type
- operator()(R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&>::is_noexcept))
- {
- return r.start();
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&>::overload == call_member,
- typename call_traits<const R&>::result_type
- >::type
- operator()(const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&>::is_noexcept))
- {
- return r.start();
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<R&>::overload == call_free,
- typename call_traits<R&>::result_type
- >::type
- operator()(R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<R&>::is_noexcept))
- {
- return start(r);
- }
-
- template <typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const R&>::overload == call_free,
- typename call_traits<const R&>::result_type
- >::type
- operator()(const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const R&>::is_noexcept))
- {
- return start(r);
- }
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-template <typename T = impl>
-struct static_instance
-{
- static const T instance;
-};
-
-template <typename T>
-const T static_instance<T>::instance = {};
-
-} // namespace asio_execution_start_fn
-namespace asio {
-namespace execution {
-namespace {
-
-static ASIO_CONSTEXPR const asio_execution_start_fn::impl&
- start = asio_execution_start_fn::static_instance<>::instance;
-
-} // namespace
-
-template <typename R>
-struct can_start :
- integral_constant<bool,
- asio_execution_start_fn::call_traits<R>::overload !=
- asio_execution_start_fn::ill_formed>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R>
-constexpr bool can_start_v = can_start<R>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R>
-struct is_nothrow_start :
- integral_constant<bool,
- asio_execution_start_fn::call_traits<R>::is_noexcept>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename R>
-constexpr bool is_nothrow_start_v
- = is_nothrow_start<R>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-} // namespace execution
-} // namespace asio
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_START_HPP
diff --git a/3rdparty/asio/include/asio/execution/submit.hpp b/3rdparty/asio/include/asio/execution/submit.hpp
deleted file mode 100644
index 7a0bddf83be..00000000000
--- a/3rdparty/asio/include/asio/execution/submit.hpp
+++ /dev/null
@@ -1,450 +0,0 @@
-//
-// execution/submit.hpp
-// ~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXECUTION_SUBMIT_HPP
-#define ASIO_EXECUTION_SUBMIT_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/execution/detail/submit_receiver.hpp"
-#include "asio/execution/executor.hpp"
-#include "asio/execution/receiver.hpp"
-#include "asio/execution/sender.hpp"
-#include "asio/execution/start.hpp"
-#include "asio/traits/submit_member.hpp"
-#include "asio/traits/submit_free.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-#if defined(GENERATING_DOCUMENTATION)
-
-namespace asio {
-namespace execution {
-
-/// A customisation point that submits a sender to a receiver.
-/**
- * The name <tt>execution::submit</tt> denotes a customisation point object. For
- * some subexpressions <tt>s</tt> and <tt>r</tt>, let <tt>S</tt> be a type such
- * that <tt>decltype((s))</tt> is <tt>S</tt> and let <tt>R</tt> be a type such
- * that <tt>decltype((r))</tt> is <tt>R</tt>. The expression
- * <tt>execution::submit(s, r)</tt> is ill-formed if <tt>sender_to<S, R></tt> is
- * not <tt>true</tt>. Otherwise, it is expression-equivalent to:
- *
- * @li <tt>s.submit(r)</tt>, if that expression is valid and <tt>S</tt> models
- * <tt>sender</tt>. If the function selected does not submit the receiver
- * object <tt>r</tt> via the sender <tt>s</tt>, the program is ill-formed with
- * no diagnostic required.
- *
- * @li Otherwise, <tt>submit(s, r)</tt>, if that expression is valid and
- * <tt>S</tt> models <tt>sender</tt>, with overload resolution performed in a
- * context that includes the declaration <tt>void submit();</tt> and that does
- * not include a declaration of <tt>execution::submit</tt>. If the function
- * selected by overload resolution does not submit the receiver object
- * <tt>r</tt> via the sender <tt>s</tt>, the program is ill-formed with no
- * diagnostic required.
- *
- * @li Otherwise, <tt>execution::start((new submit_receiver<S,
- * R>{s,r})->state_)</tt>, where <tt>submit_receiver</tt> is an
- * implementation-defined class template equivalent to:
- * @code template<class S, class R>
- * struct submit_receiver {
- * struct wrap {
- * submit_receiver * p_;
- * template<class...As>
- * requires receiver_of<R, As...>
- * void set_value(As&&... as) &&
- * noexcept(is_nothrow_receiver_of_v<R, As...>) {
- * execution::set_value(std::move(p_->r_), (As&&) as...);
- * delete p_;
- * }
- * template<class E>
- * requires receiver<R, E>
- * void set_error(E&& e) && noexcept {
- * execution::set_error(std::move(p_->r_), (E&&) e);
- * delete p_;
- * }
- * void set_done() && noexcept {
- * execution::set_done(std::move(p_->r_));
- * delete p_;
- * }
- * };
- * remove_cvref_t<R> r_;
- * connect_result_t<S, wrap> state_;
- * submit_receiver(S&& s, R&& r)
- * : r_((R&&) r)
- * , state_(execution::connect((S&&) s, wrap{this})) {}
- * };
- * @endcode
- */
-inline constexpr unspecified submit = unspecified;
-
-/// A type trait that determines whether a @c submit expression is
-/// well-formed.
-/**
- * Class template @c can_submit is a trait that is derived from
- * @c true_type if the expression <tt>execution::submit(std::declval<R>(),
- * std::declval<E>())</tt> is well formed; otherwise @c false_type.
- */
-template <typename S, typename R>
-struct can_submit :
- integral_constant<bool, automatically_determined>
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#else // defined(GENERATING_DOCUMENTATION)
-
-namespace asio_execution_submit_fn {
-
-using asio::declval;
-using asio::enable_if;
-using asio::execution::is_sender_to;
-using asio::traits::submit_free;
-using asio::traits::submit_member;
-
-void submit();
-
-enum overload_type
-{
- call_member,
- call_free,
- adapter,
- ill_formed
-};
-
-template <typename S, typename R, typename = void,
- typename = void, typename = void>
-struct call_traits
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename S, typename R>
-struct call_traits<S, void(R),
- typename enable_if<
- submit_member<S, R>::is_valid
- >::type,
- typename enable_if<
- is_sender_to<S, R>::value
- >::type> :
- submit_member<S, R>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
-};
-
-template <typename S, typename R>
-struct call_traits<S, void(R),
- typename enable_if<
- !submit_member<S, R>::is_valid
- >::type,
- typename enable_if<
- submit_free<S, R>::is_valid
- >::type,
- typename enable_if<
- is_sender_to<S, R>::value
- >::type> :
- submit_free<S, R>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
-};
-
-template <typename S, typename R>
-struct call_traits<S, void(R),
- typename enable_if<
- !submit_member<S, R>::is_valid
- >::type,
- typename enable_if<
- !submit_free<S, R>::is_valid
- >::type,
- typename enable_if<
- is_sender_to<S, R>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-struct impl
-{
-#if defined(ASIO_HAS_MOVE)
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(R)>::overload == call_member,
- typename call_traits<S, void(R)>::result_type
- >::type
- operator()(S&& s, R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(R)>::is_noexcept))
- {
- return ASIO_MOVE_CAST(S)(s).submit(ASIO_MOVE_CAST(R)(r));
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(R)>::overload == call_free,
- typename call_traits<S, void(R)>::result_type
- >::type
- operator()(S&& s, R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(R)>::is_noexcept))
- {
- return submit(ASIO_MOVE_CAST(S)(s), ASIO_MOVE_CAST(R)(r));
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S, void(R)>::overload == adapter,
- typename call_traits<S, void(R)>::result_type
- >::type
- operator()(S&& s, R&& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S, void(R)>::is_noexcept))
- {
- return asio::execution::start(
- (new asio::execution::detail::submit_receiver<S, R>(
- ASIO_MOVE_CAST(S)(s), ASIO_MOVE_CAST(R)(r)))->state_);
- }
-#else // defined(ASIO_HAS_MOVE)
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(R&)>::overload == call_member,
- typename call_traits<S&, void(R&)>::result_type
- >::type
- operator()(S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(R&)>::is_noexcept))
- {
- return s.submit(r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(R&)>::overload == call_member,
- typename call_traits<const S&, void(R&)>::result_type
- >::type
- operator()(const S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(R&)>::is_noexcept))
- {
- return s.submit(r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(R&)>::overload == call_free,
- typename call_traits<S&, void(R&)>::result_type
- >::type
- operator()(S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(R&)>::is_noexcept))
- {
- return submit(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(R&)>::overload == call_free,
- typename call_traits<const S&, void(R&)>::result_type
- >::type
- operator()(const S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(R&)>::is_noexcept))
- {
- return submit(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(R&)>::overload == adapter,
- typename call_traits<S&, void(R&)>::result_type
- >::type
- operator()(S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(R&)>::is_noexcept))
- {
- return asio::execution::start(
- (new asio::execution::detail::submit_receiver<
- S&, R&>(s, r))->state_);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(R&)>::overload == adapter,
- typename call_traits<const S&, void(R&)>::result_type
- >::type
- operator()(const S& s, R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(R&)>::is_noexcept))
- {
- asio::execution::start(
- (new asio::execution::detail::submit_receiver<
- const S&, R&>(s, r))->state_);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(const R&)>::overload == call_member,
- typename call_traits<S&, void(const R&)>::result_type
- >::type
- operator()(S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(const R&)>::is_noexcept))
- {
- return s.submit(r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(const R&)>::overload == call_member,
- typename call_traits<const S&, void(const R&)>::result_type
- >::type
- operator()(const S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(const R&)>::is_noexcept))
- {
- return s.submit(r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(const R&)>::overload == call_free,
- typename call_traits<S&, void(const R&)>::result_type
- >::type
- operator()(S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(const R&)>::is_noexcept))
- {
- return submit(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(const R&)>::overload == call_free,
- typename call_traits<const S&, void(const R&)>::result_type
- >::type
- operator()(const S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(const R&)>::is_noexcept))
- {
- return submit(s, r);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<S&, void(const R&)>::overload == adapter,
- typename call_traits<S&, void(const R&)>::result_type
- >::type
- operator()(S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<S&, void(const R&)>::is_noexcept))
- {
- asio::execution::start(
- (new asio::execution::detail::submit_receiver<
- S&, const R&>(s, r))->state_);
- }
-
- template <typename S, typename R>
- ASIO_CONSTEXPR typename enable_if<
- call_traits<const S&, void(const R&)>::overload == adapter,
- typename call_traits<const S&, void(const R&)>::result_type
- >::type
- operator()(const S& s, const R& r) const
- ASIO_NOEXCEPT_IF((
- call_traits<const S&, void(const R&)>::is_noexcept))
- {
- asio::execution::start(
- (new asio::execution::detail::submit_receiver<
- const S&, const R&>(s, r))->state_);
- }
-#endif // defined(ASIO_HAS_MOVE)
-};
-
-template <typename T = impl>
-struct static_instance
-{
- static const T instance;
-};
-
-template <typename T>
-const T static_instance<T>::instance = {};
-
-} // namespace asio_execution_submit_fn
-namespace asio {
-namespace execution {
-namespace {
-
-static ASIO_CONSTEXPR const asio_execution_submit_fn::impl&
- submit = asio_execution_submit_fn::static_instance<>::instance;
-
-} // namespace
-
-template <typename S, typename R>
-struct can_submit :
- integral_constant<bool,
- asio_execution_submit_fn::call_traits<S, void(R)>::overload !=
- asio_execution_submit_fn::ill_formed>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename R>
-constexpr bool can_submit_v = can_submit<S, R>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename R>
-struct is_nothrow_submit :
- integral_constant<bool,
- asio_execution_submit_fn::call_traits<S, void(R)>::is_noexcept>
-{
-};
-
-#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename R>
-constexpr bool is_nothrow_submit_v
- = is_nothrow_submit<S, R>::value;
-
-#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-
-template <typename S, typename R>
-struct submit_result
-{
- typedef typename asio_execution_submit_fn::call_traits<
- S, void(R)>::result_type type;
-};
-
-namespace detail {
-
-template <typename S, typename R>
-void submit_helper(ASIO_MOVE_ARG(S) s, ASIO_MOVE_ARG(R) r)
-{
- execution::submit(ASIO_MOVE_CAST(S)(s), ASIO_MOVE_CAST(R)(r));
-}
-
-} // namespace detail
-} // namespace execution
-} // namespace asio
-
-#endif // defined(GENERATING_DOCUMENTATION)
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXECUTION_SUBMIT_HPP
diff --git a/3rdparty/asio/include/asio/execution_context.hpp b/3rdparty/asio/include/asio/execution_context.hpp
index e1ee67a28c7..bce8d431607 100644
--- a/3rdparty/asio/include/asio/execution_context.hpp
+++ b/3rdparty/asio/include/asio/execution_context.hpp
@@ -2,7 +2,7 @@
// execution_context.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,7 +20,6 @@
#include <stdexcept>
#include <typeinfo>
#include "asio/detail/noncopyable.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/detail/push_options.hpp"
@@ -224,8 +223,6 @@ public:
template <typename Service>
friend Service& use_service(io_context& ioc);
-#if defined(GENERATING_DOCUMENTATION)
-
/// Creates a service object and adds it to the execution_context.
/**
* This function is used to add a service to the execution_context.
@@ -241,27 +238,6 @@ public:
template <typename Service, typename... Args>
friend Service& make_service(execution_context& e, Args&&... args);
-#elif defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Service, typename... Args>
- friend Service& make_service(execution_context& e,
- ASIO_MOVE_ARG(Args)... args);
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Service>
- friend Service& make_service(execution_context& e);
-
-#define ASIO_PRIVATE_MAKE_SERVICE_DEF(n) \
- template <typename Service, ASIO_VARIADIC_TPARAMS(n)> \
- friend Service& make_service(execution_context& e, \
- ASIO_VARIADIC_MOVE_PARAMS(n)); \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_MAKE_SERVICE_DEF)
-#undef ASIO_PRIVATE_MAKE_SERVICE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
/// (Deprecated: Use make_service().) Add a service object to the
/// execution_context.
/**
diff --git a/3rdparty/asio/include/asio/executor.hpp b/3rdparty/asio/include/asio/executor.hpp
index 419fdcae653..c056525460a 100644
--- a/3rdparty/asio/include/asio/executor.hpp
+++ b/3rdparty/asio/include/asio/executor.hpp
@@ -2,7 +2,7 @@
// executor.hpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,6 +19,7 @@
#if !defined(ASIO_NO_TS_EXECUTORS)
+#include <new>
#include <typeinfo>
#include "asio/detail/cstddef.hpp"
#include "asio/detail/executor_function.hpp"
@@ -36,11 +37,11 @@ class bad_executor
{
public:
/// Constructor.
- ASIO_DECL bad_executor() ASIO_NOEXCEPT;
+ ASIO_DECL bad_executor() noexcept;
/// Obtain message associated with exception.
ASIO_DECL virtual const char* what() const
- ASIO_NOEXCEPT_OR_NOTHROW;
+ noexcept;
};
/// Polymorphic wrapper for executors.
@@ -48,36 +49,53 @@ class executor
{
public:
/// Default constructor.
- executor() ASIO_NOEXCEPT
+ executor() noexcept
: impl_(0)
{
}
/// Construct from nullptr.
- executor(nullptr_t) ASIO_NOEXCEPT
+ executor(nullptr_t) noexcept
: impl_(0)
{
}
/// Copy constructor.
- executor(const executor& other) ASIO_NOEXCEPT
+ executor(const executor& other) noexcept
: impl_(other.clone())
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move constructor.
- executor(executor&& other) ASIO_NOEXCEPT
+ executor(executor&& other) noexcept
: impl_(other.impl_)
{
other.impl_ = 0;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Construct a polymorphic wrapper for the specified executor.
template <typename Executor>
executor(Executor e);
+ /// Construct a polymorphic executor that points to the same target as
+ /// another polymorphic executor.
+ executor(std::nothrow_t, const executor& other) noexcept
+ : impl_(other.clone())
+ {
+ }
+
+ /// Construct a polymorphic executor that moves the target from another
+ /// polymorphic executor.
+ executor(std::nothrow_t, executor&& other) noexcept
+ : impl_(other.impl_)
+ {
+ other.impl_ = 0;
+ }
+
+ /// Construct a polymorphic wrapper for the specified executor.
+ template <typename Executor>
+ executor(std::nothrow_t, Executor e) noexcept;
+
/// Allocator-aware constructor to create a polymorphic wrapper for the
/// specified executor.
template <typename Executor, typename Allocator>
@@ -90,26 +108,24 @@ public:
}
/// Assignment operator.
- executor& operator=(const executor& other) ASIO_NOEXCEPT
+ executor& operator=(const executor& other) noexcept
{
destroy();
impl_ = other.clone();
return *this;
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
// Move assignment operator.
- executor& operator=(executor&& other) ASIO_NOEXCEPT
+ executor& operator=(executor&& other) noexcept
{
destroy();
impl_ = other.impl_;
other.impl_ = 0;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Assignment operator for nullptr_t.
- executor& operator=(nullptr_t) ASIO_NOEXCEPT
+ executor& operator=(nullptr_t) noexcept
{
destroy();
impl_ = 0;
@@ -119,9 +135,9 @@ public:
/// Assignment operator to create a polymorphic wrapper for the specified
/// executor.
template <typename Executor>
- executor& operator=(ASIO_MOVE_ARG(Executor) e) ASIO_NOEXCEPT
+ executor& operator=(Executor&& e) noexcept
{
- executor tmp(ASIO_MOVE_CAST(Executor)(e));
+ executor tmp(static_cast<Executor&&>(e));
destroy();
impl_ = tmp.impl_;
tmp.impl_ = 0;
@@ -129,19 +145,19 @@ public:
}
/// Obtain the underlying execution context.
- execution_context& context() const ASIO_NOEXCEPT
+ execution_context& context() const noexcept
{
return get_impl()->context();
}
/// Inform the executor that it has some outstanding work to do.
- void on_work_started() const ASIO_NOEXCEPT
+ void on_work_started() const noexcept
{
get_impl()->on_work_started();
}
/// Inform the executor that some work is no longer outstanding.
- void on_work_finished() const ASIO_NOEXCEPT
+ void on_work_finished() const noexcept
{
get_impl()->on_work_finished();
}
@@ -160,7 +176,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename Allocator>
- void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const;
+ void dispatch(Function&& f, const Allocator& a) const;
/// Request the executor to invoke the given function object.
/**
@@ -176,7 +192,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename Allocator>
- void post(ASIO_MOVE_ARG(Function) f, const Allocator& a) const;
+ void post(Function&& f, const Allocator& a) const;
/// Request the executor to invoke the given function object.
/**
@@ -192,14 +208,14 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename Allocator>
- void defer(ASIO_MOVE_ARG(Function) f, const Allocator& a) const;
+ void defer(Function&& f, const Allocator& a) const;
struct unspecified_bool_type_t {};
typedef void (*unspecified_bool_type)(unspecified_bool_type_t);
static void unspecified_bool_true(unspecified_bool_type_t) {}
/// Operator to test if the executor contains a valid target.
- operator unspecified_bool_type() const ASIO_NOEXCEPT
+ operator unspecified_bool_type() const noexcept
{
return impl_ ? &executor::unspecified_bool_true : 0;
}
@@ -210,12 +226,12 @@ public:
* otherwise, <tt>typeid(void)</tt>.
*/
#if !defined(ASIO_NO_TYPEID) || defined(GENERATING_DOCUMENTATION)
- const std::type_info& target_type() const ASIO_NOEXCEPT
+ const std::type_info& target_type() const noexcept
{
return impl_ ? impl_->target_type() : typeid(void);
}
#else // !defined(ASIO_NO_TYPEID) || defined(GENERATING_DOCUMENTATION)
- const void* target_type() const ASIO_NOEXCEPT
+ const void* target_type() const noexcept
{
return impl_ ? impl_->target_type() : 0;
}
@@ -227,7 +243,7 @@ public:
* executor target; otherwise, a null pointer.
*/
template <typename Executor>
- Executor* target() ASIO_NOEXCEPT;
+ Executor* target() noexcept;
/// Obtain a pointer to the target executor object.
/**
@@ -235,11 +251,11 @@ public:
* executor target; otherwise, a null pointer.
*/
template <typename Executor>
- const Executor* target() const ASIO_NOEXCEPT;
+ const Executor* target() const noexcept;
/// Compare two executors for equality.
friend bool operator==(const executor& a,
- const executor& b) ASIO_NOEXCEPT
+ const executor& b) noexcept
{
if (a.impl_ == b.impl_)
return true;
@@ -250,7 +266,7 @@ public:
/// Compare two executors for inequality.
friend bool operator!=(const executor& a,
- const executor& b) ASIO_NOEXCEPT
+ const executor& b) noexcept
{
return !(a == b);
}
@@ -281,18 +297,18 @@ private:
class impl_base
{
public:
- virtual impl_base* clone() const ASIO_NOEXCEPT = 0;
- virtual void destroy() ASIO_NOEXCEPT = 0;
- virtual execution_context& context() ASIO_NOEXCEPT = 0;
- virtual void on_work_started() ASIO_NOEXCEPT = 0;
- virtual void on_work_finished() ASIO_NOEXCEPT = 0;
- virtual void dispatch(ASIO_MOVE_ARG(function)) = 0;
- virtual void post(ASIO_MOVE_ARG(function)) = 0;
- virtual void defer(ASIO_MOVE_ARG(function)) = 0;
- virtual type_id_result_type target_type() const ASIO_NOEXCEPT = 0;
- virtual void* target() ASIO_NOEXCEPT = 0;
- virtual const void* target() const ASIO_NOEXCEPT = 0;
- virtual bool equals(const impl_base* e) const ASIO_NOEXCEPT = 0;
+ virtual impl_base* clone() const noexcept = 0;
+ virtual void destroy() noexcept = 0;
+ virtual execution_context& context() noexcept = 0;
+ virtual void on_work_started() noexcept = 0;
+ virtual void on_work_finished() noexcept = 0;
+ virtual void dispatch(function&&) = 0;
+ virtual void post(function&&) = 0;
+ virtual void defer(function&&) = 0;
+ virtual type_id_result_type target_type() const noexcept = 0;
+ virtual void* target() noexcept = 0;
+ virtual const void* target() const noexcept = 0;
+ virtual bool equals(const impl_base* e) const noexcept = 0;
protected:
impl_base(bool fast_dispatch) : fast_dispatch_(fast_dispatch) {}
@@ -315,13 +331,13 @@ private:
}
// Helper function to clone another implementation.
- impl_base* clone() const ASIO_NOEXCEPT
+ impl_base* clone() const noexcept
{
return impl_ ? impl_->clone() : 0;
}
// Helper function to destroy an implementation.
- void destroy() ASIO_NOEXCEPT
+ void destroy() noexcept
{
if (impl_)
impl_->destroy();
diff --git a/3rdparty/asio/include/asio/executor_work_guard.hpp b/3rdparty/asio/include/asio/executor_work_guard.hpp
index 63837cb7458..72787ccdc83 100644
--- a/3rdparty/asio/include/asio/executor_work_guard.hpp
+++ b/3rdparty/asio/include/asio/executor_work_guard.hpp
@@ -2,7 +2,7 @@
// executor_work_guard.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,8 +17,6 @@
#include "asio/detail/config.hpp"
-#if !defined(ASIO_NO_TS_EXECUTORS)
-
#include "asio/associated_executor.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution.hpp"
@@ -36,13 +34,11 @@ class executor_work_guard;
#endif // !defined(ASIO_EXECUTOR_WORK_GUARD_DECL)
-/// An object of type @c executor_work_guard controls ownership of executor work
-/// within a scope.
#if defined(GENERATING_DOCUMENTATION)
+
+/// An object of type @c executor_work_guard controls ownership of outstanding
+/// executor work within a scope.
template <typename Executor>
-#else // defined(GENERATING_DOCUMENTATION)
-template <typename Executor, typename, typename>
-#endif // defined(GENERATING_DOCUMENTATION)
class executor_work_guard
{
public:
@@ -53,15 +49,58 @@ public:
/**
* Stores a copy of @c e and calls <tt>on_work_started()</tt> on it.
*/
- explicit executor_work_guard(const executor_type& e) ASIO_NOEXCEPT
+ explicit executor_work_guard(const executor_type& e) noexcept;
+
+ /// Copy constructor.
+ executor_work_guard(const executor_work_guard& other) noexcept;
+
+ /// Move constructor.
+ executor_work_guard(executor_work_guard&& other) noexcept;
+
+ /// Destructor.
+ /**
+ * Unless the object has already been reset, or is in a moved-from state,
+ * calls <tt>on_work_finished()</tt> on the stored executor.
+ */
+ ~executor_work_guard();
+
+ /// Obtain the associated executor.
+ executor_type get_executor() const noexcept;
+
+ /// Whether the executor_work_guard object owns some outstanding work.
+ bool owns_work() const noexcept;
+
+ /// Indicate that the work is no longer outstanding.
+ /**
+ * Unless the object has already been reset, or is in a moved-from state,
+ * calls <tt>on_work_finished()</tt> on the stored executor.
+ */
+ void reset() noexcept;
+};
+
+#endif // defined(GENERATING_DOCUMENTATION)
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+#if !defined(ASIO_NO_TS_EXECUTORS)
+
+template <typename Executor>
+class executor_work_guard<Executor,
+ enable_if_t<
+ is_executor<Executor>::value
+ >>
+{
+public:
+ typedef Executor executor_type;
+
+ explicit executor_work_guard(const executor_type& e) noexcept
: executor_(e),
owns_(true)
{
executor_.on_work_started();
}
- /// Copy constructor.
- executor_work_guard(const executor_work_guard& other) ASIO_NOEXCEPT
+ executor_work_guard(const executor_work_guard& other) noexcept
: executor_(other.executor_),
owns_(other.owns_)
{
@@ -69,45 +108,30 @@ public:
executor_.on_work_started();
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
- /// Move constructor.
- executor_work_guard(executor_work_guard&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)),
+ executor_work_guard(executor_work_guard&& other) noexcept
+ : executor_(static_cast<Executor&&>(other.executor_)),
owns_(other.owns_)
{
other.owns_ = false;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
- /// Destructor.
- /**
- * Unless the object has already been reset, or is in a moved-from state,
- * calls <tt>on_work_finished()</tt> on the stored executor.
- */
~executor_work_guard()
{
if (owns_)
executor_.on_work_finished();
}
- /// Obtain the associated executor.
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return executor_;
}
- /// Whether the executor_work_guard object owns some outstanding work.
- bool owns_work() const ASIO_NOEXCEPT
+ bool owns_work() const noexcept
{
return owns_;
}
- /// Indicate that the work is no longer outstanding.
- /**
- * Unless the object has already been reset, or is in a moved-from state,
- * calls <tt>on_work_finished()</tt> on the stored executor.
- */
- void reset() ASIO_NOEXCEPT
+ void reset() noexcept
{
if (owns_)
{
@@ -124,21 +148,21 @@ private:
bool owns_;
};
-#if !defined(GENERATING_DOCUMENTATION)
+#endif // !defined(ASIO_NO_TS_EXECUTORS)
template <typename Executor>
class executor_work_guard<Executor,
- typename enable_if<
+ enable_if_t<
!is_executor<Executor>::value
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
execution::is_executor<Executor>::value
- >::type>
+ >>
{
public:
typedef Executor executor_type;
- explicit executor_work_guard(const executor_type& e) ASIO_NOEXCEPT
+ explicit executor_work_guard(const executor_type& e) noexcept
: executor_(e),
owns_(true)
{
@@ -146,7 +170,7 @@ public:
execution::outstanding_work.tracked));
}
- executor_work_guard(const executor_work_guard& other) ASIO_NOEXCEPT
+ executor_work_guard(const executor_work_guard& other) noexcept
: executor_(other.executor_),
owns_(other.owns_)
{
@@ -157,21 +181,19 @@ public:
}
}
-#if defined(ASIO_HAS_MOVE)
- executor_work_guard(executor_work_guard&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)),
+ executor_work_guard(executor_work_guard&& other) noexcept
+ : executor_(static_cast<Executor&&>(other.executor_)),
owns_(other.owns_)
{
if (owns_)
{
new (&work_) work_type(
- ASIO_MOVE_CAST(work_type)(
+ static_cast<work_type&&>(
*static_cast<work_type*>(
static_cast<void*>(&other.work_))));
other.owns_ = false;
}
}
-#endif // defined(ASIO_HAS_MOVE)
~executor_work_guard()
{
@@ -179,17 +201,17 @@ public:
static_cast<work_type*>(static_cast<void*>(&work_))->~work_type();
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return executor_;
}
- bool owns_work() const ASIO_NOEXCEPT
+ bool owns_work() const noexcept
{
return owns_;
}
- void reset() ASIO_NOEXCEPT
+ void reset() noexcept
{
if (owns_)
{
@@ -202,93 +224,133 @@ private:
// Disallow assignment.
executor_work_guard& operator=(const executor_work_guard&);
- typedef typename decay<
- typename prefer_result<
+ typedef decay_t<
+ prefer_result_t<
const executor_type&,
execution::outstanding_work_t::tracked_t
- >::type
- >::type work_type;
+ >
+ > work_type;
executor_type executor_;
- typename aligned_storage<sizeof(work_type),
- alignment_of<work_type>::value>::type work_;
+ aligned_storage_t<sizeof(work_type), alignment_of<work_type>::value> work_;
bool owns_;
};
#endif // !defined(GENERATING_DOCUMENTATION)
/// Create an @ref executor_work_guard object.
+/**
+ * @param ex An executor.
+ *
+ * @returns A work guard constructed with the specified executor.
+ */
template <typename Executor>
-inline executor_work_guard<Executor> make_work_guard(const Executor& ex,
- typename constraint<
+ASIO_NODISCARD inline executor_work_guard<Executor>
+make_work_guard(const Executor& ex,
+ constraint_t<
is_executor<Executor>::value || execution::is_executor<Executor>::value
- >::type = 0)
+ > = 0)
{
return executor_work_guard<Executor>(ex);
}
/// Create an @ref executor_work_guard object.
+/**
+ * @param ctx An execution context, from which an executor will be obtained.
+ *
+ * @returns A work guard constructed with the execution context's executor,
+ * obtained by performing <tt>ctx.get_executor()</tt>.
+ */
template <typename ExecutionContext>
-inline executor_work_guard<typename ExecutionContext::executor_type>
+ASIO_NODISCARD inline
+executor_work_guard<typename ExecutionContext::executor_type>
make_work_guard(ExecutionContext& ctx,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
{
return executor_work_guard<typename ExecutionContext::executor_type>(
ctx.get_executor());
}
/// Create an @ref executor_work_guard object.
+/**
+ * @param t An arbitrary object, such as a completion handler, for which the
+ * associated executor will be obtained.
+ *
+ * @returns A work guard constructed with the associated executor of the object
+ * @c t, which is obtained as if by calling <tt>get_associated_executor(t)</tt>.
+ */
template <typename T>
-inline executor_work_guard<typename associated_executor<T>::type>
-make_work_guard(const T& t,
- typename constraint<
+ASIO_NODISCARD inline
+executor_work_guard<
+ typename constraint_t<
!is_executor<T>::value
- >::type = 0,
- typename constraint<
- !execution::is_executor<T>::value
- >::type = 0,
- typename constraint<
- !is_convertible<T&, execution_context&>::value
- >::type = 0)
+ && !execution::is_executor<T>::value
+ && !is_convertible<T&, execution_context&>::value,
+ associated_executor<T>
+ >::type>
+make_work_guard(const T& t)
{
- return executor_work_guard<typename associated_executor<T>::type>(
+ return executor_work_guard<associated_executor_t<T>>(
associated_executor<T>::get(t));
}
/// Create an @ref executor_work_guard object.
+/**
+ * @param t An arbitrary object, such as a completion handler, for which the
+ * associated executor will be obtained.
+ *
+ * @param ex An executor to be used as the candidate object when determining the
+ * associated executor.
+ *
+ * @returns A work guard constructed with the associated executor of the object
+ * @c t, which is obtained as if by calling <tt>get_associated_executor(t,
+ * ex)</tt>.
+ */
template <typename T, typename Executor>
-inline executor_work_guard<typename associated_executor<T, Executor>::type>
+ASIO_NODISCARD inline
+executor_work_guard<associated_executor_t<T, Executor>>
make_work_guard(const T& t, const Executor& ex,
- typename constraint<
+ constraint_t<
is_executor<Executor>::value || execution::is_executor<Executor>::value
- >::type = 0)
+ > = 0)
{
- return executor_work_guard<typename associated_executor<T, Executor>::type>(
+ return executor_work_guard<associated_executor_t<T, Executor>>(
associated_executor<T, Executor>::get(t, ex));
}
/// Create an @ref executor_work_guard object.
+/**
+ * @param t An arbitrary object, such as a completion handler, for which the
+ * associated executor will be obtained.
+ *
+ * @param ctx An execution context, from which an executor is obtained to use as
+ * the candidate object for determining the associated executor.
+ *
+ * @returns A work guard constructed with the associated executor of the object
+ * @c t, which is obtained as if by calling <tt>get_associated_executor(t,
+ * ctx.get_executor())</tt>.
+ */
template <typename T, typename ExecutionContext>
-inline executor_work_guard<typename associated_executor<T,
- typename ExecutionContext::executor_type>::type>
+ASIO_NODISCARD inline executor_work_guard<
+ associated_executor_t<T, typename ExecutionContext::executor_type>>
make_work_guard(const T& t, ExecutionContext& ctx,
- typename constraint<
+ constraint_t<
!is_executor<T>::value
- >::type = 0,
- typename constraint<
+ > = 0,
+ constraint_t<
!execution::is_executor<T>::value
- >::type = 0,
- typename constraint<
+ > = 0,
+ constraint_t<
!is_convertible<T&, execution_context&>::value
- >::type = 0,
- typename constraint<
+ > = 0,
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
{
- return executor_work_guard<typename associated_executor<T,
- typename ExecutionContext::executor_type>::type>(
+ return executor_work_guard<
+ associated_executor_t<T, typename ExecutionContext::executor_type>>(
associated_executor<T, typename ExecutionContext::executor_type>::get(
t, ctx.get_executor()));
}
@@ -297,6 +359,4 @@ make_work_guard(const T& t, ExecutionContext& ctx,
#include "asio/detail/pop_options.hpp"
-#endif // !defined(ASIO_NO_TS_EXECUTORS)
-
#endif // ASIO_EXECUTOR_WORK_GUARD_HPP
diff --git a/3rdparty/asio/include/asio/experimental/append.hpp b/3rdparty/asio/include/asio/experimental/append.hpp
index 681d5e34c17..6a1f280cdd9 100644
--- a/3rdparty/asio/include/asio/experimental/append.hpp
+++ b/3rdparty/asio/include/asio/experimental/append.hpp
@@ -2,7 +2,7 @@
// experimental/append.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,56 +16,21 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-#include <tuple>
-#include "asio/detail/type_traits.hpp"
+#include "asio/append.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
namespace experimental {
-/// Completion token type used to specify that the completion handler
-/// arguments should be passed additional values after the results of the
-/// operation.
-template <typename CompletionToken, typename... Values>
-class append_t
-{
-public:
- /// Constructor.
- template <typename T, typename... V>
- ASIO_CONSTEXPR explicit append_t(
- ASIO_MOVE_ARG(T) completion_token,
- ASIO_MOVE_ARG(V)... values)
- : token_(ASIO_MOVE_CAST(T)(completion_token)),
- values_(ASIO_MOVE_CAST(V)(values)...)
- {
- }
-
-//private:
- CompletionToken token_;
- std::tuple<Values...> values_;
-};
-
-/// Completion token type used to specify that the completion handler
-/// arguments should be passed additional values after the results of the
-/// operation.
-template <typename CompletionToken, typename... Values>
-inline ASIO_CONSTEXPR append_t<
- typename decay<CompletionToken>::type, typename decay<Values>::type...>
-append(ASIO_MOVE_ARG(CompletionToken) completion_token,
- ASIO_MOVE_ARG(Values)... values)
-{
- return append_t<
- typename decay<CompletionToken>::type, typename decay<Values>::type...>(
- ASIO_MOVE_CAST(CompletionToken)(completion_token),
- ASIO_MOVE_CAST(Values)(values)...);
-}
+#if !defined(ASIO_NO_DEPRECATED)
+using asio::append_t;
+using asio::append;
+#endif // !defined(ASIO_NO_DEPRECATED)
} // namespace experimental
} // namespace asio
#include "asio/detail/pop_options.hpp"
-#include "asio/experimental/impl/append.hpp"
-
#endif // ASIO_EXPERIMENTAL_APPEND_HPP
diff --git a/3rdparty/asio/include/asio/experimental/as_single.hpp b/3rdparty/asio/include/asio/experimental/as_single.hpp
index cfd63ad122f..6282c14f142 100644
--- a/3rdparty/asio/include/asio/experimental/as_single.hpp
+++ b/3rdparty/asio/include/asio/experimental/as_single.hpp
@@ -2,7 +2,7 @@
// experimental/as_single.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,7 @@
namespace asio {
namespace experimental {
-/// Completion token type used to specify that the completion handler
+/// A @ref completion_token adapter used to specify that the completion handler
/// arguments should be combined into a single argument.
/**
* The as_single_t class is used to indicate that any arguments to the
@@ -47,18 +47,18 @@ public:
* token is itself defaulted as an argument to allow it to capture a source
* location.
*/
- ASIO_CONSTEXPR as_single_t(
+ constexpr as_single_t(
default_constructor_tag = default_constructor_tag(),
CompletionToken token = CompletionToken())
- : token_(ASIO_MOVE_CAST(CompletionToken)(token))
+ : token_(static_cast<CompletionToken&&>(token))
{
}
/// Constructor.
template <typename T>
- ASIO_CONSTEXPR explicit as_single_t(
- ASIO_MOVE_ARG(T) completion_token)
- : token_(ASIO_MOVE_CAST(T)(completion_token))
+ constexpr explicit as_single_t(
+ T&& completion_token)
+ : token_(static_cast<T&&>(completion_token))
{
}
@@ -71,7 +71,7 @@ public:
typedef as_single_t default_completion_token_type;
/// Construct the adapted executor from the inner executor type.
- executor_with_default(const InnerExecutor& ex) ASIO_NOEXCEPT
+ executor_with_default(const InnerExecutor& ex) noexcept
: InnerExecutor(ex)
{
}
@@ -80,9 +80,9 @@ public:
/// that to construct the adapted executor.
template <typename OtherExecutor>
executor_with_default(const OtherExecutor& ex,
- typename constraint<
+ constraint_t<
is_convertible<OtherExecutor, InnerExecutor>::value
- >::type = 0) ASIO_NOEXCEPT
+ > = 0) noexcept
: InnerExecutor(ex)
{
}
@@ -90,39 +90,36 @@ public:
/// Type alias to adapt an I/O object to use @c as_single_t as its
/// default completion token type.
-#if defined(ASIO_HAS_ALIAS_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
template <typename T>
using as_default_on_t = typename T::template rebind_executor<
- executor_with_default<typename T::executor_type> >::other;
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
+ executor_with_default<typename T::executor_type>>::other;
/// Function helper to adapt an I/O object to use @c as_single_t as its
/// default completion token type.
template <typename T>
- static typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
+ static typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
>::other
- as_default_on(ASIO_MOVE_ARG(T) object)
+ as_default_on(T&& object)
{
- return typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
- >::other(ASIO_MOVE_CAST(T)(object));
+ return typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other(static_cast<T&&>(object));
}
//private:
CompletionToken token_;
};
-/// Create a completion token to specify that the completion handler arguments
-/// should be combined into a single argument.
+/// Adapt a @ref completion_token to specify that the completion handler
+/// arguments should be combined into a single argument.
template <typename CompletionToken>
-inline ASIO_CONSTEXPR as_single_t<typename decay<CompletionToken>::type>
-as_single(ASIO_MOVE_ARG(CompletionToken) completion_token)
+ASIO_NODISCARD inline
+constexpr as_single_t<decay_t<CompletionToken>>
+as_single(CompletionToken&& completion_token)
{
- return as_single_t<typename decay<CompletionToken>::type>(
- ASIO_MOVE_CAST(CompletionToken)(completion_token));
+ return as_single_t<decay_t<CompletionToken>>(
+ static_cast<CompletionToken&&>(completion_token));
}
} // namespace experimental
diff --git a/3rdparty/asio/include/asio/experimental/as_tuple.hpp b/3rdparty/asio/include/asio/experimental/as_tuple.hpp
index d8ccdafd806..02f23f2909b 100644
--- a/3rdparty/asio/include/asio/experimental/as_tuple.hpp
+++ b/3rdparty/asio/include/asio/experimental/as_tuple.hpp
@@ -2,7 +2,7 @@
// experimental/as_tuple.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,116 +16,21 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
+#include "asio/as_tuple.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
namespace experimental {
-/// Completion token type used to specify that the completion handler
-/// arguments should be combined into a single tuple argument.
-/**
- * The as_tuple_t class is used to indicate that any arguments to the
- * completion handler should be combined and passed as a single tuple argument.
- * The arguments are first moved into a @c std::tuple and that tuple is then
- * passed to the completion handler.
- */
-template <typename CompletionToken>
-class as_tuple_t
-{
-public:
- /// Tag type used to prevent the "default" constructor from being used for
- /// conversions.
- struct default_constructor_tag {};
-
- /// Default constructor.
- /**
- * This constructor is only valid if the underlying completion token is
- * default constructible and move constructible. The underlying completion
- * token is itself defaulted as an argument to allow it to capture a source
- * location.
- */
- ASIO_CONSTEXPR as_tuple_t(
- default_constructor_tag = default_constructor_tag(),
- CompletionToken token = CompletionToken())
- : token_(ASIO_MOVE_CAST(CompletionToken)(token))
- {
- }
-
- /// Constructor.
- template <typename T>
- ASIO_CONSTEXPR explicit as_tuple_t(
- ASIO_MOVE_ARG(T) completion_token)
- : token_(ASIO_MOVE_CAST(T)(completion_token))
- {
- }
-
- /// Adapts an executor to add the @c as_tuple_t completion token as the
- /// default.
- template <typename InnerExecutor>
- struct executor_with_default : InnerExecutor
- {
- /// Specify @c as_tuple_t as the default completion token type.
- typedef as_tuple_t default_completion_token_type;
-
- /// Construct the adapted executor from the inner executor type.
- template <typename InnerExecutor1>
- executor_with_default(const InnerExecutor1& ex,
- typename constraint<
- conditional<
- !is_same<InnerExecutor1, executor_with_default>::value,
- is_convertible<InnerExecutor1, InnerExecutor>,
- false_type
- >::type::value
- >::type = 0) ASIO_NOEXCEPT
- : InnerExecutor(ex)
- {
- }
- };
-
- /// Type alias to adapt an I/O object to use @c as_tuple_t as its
- /// default completion token type.
-#if defined(ASIO_HAS_ALIAS_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
- template <typename T>
- using as_default_on_t = typename T::template rebind_executor<
- executor_with_default<typename T::executor_type> >::other;
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
- /// Function helper to adapt an I/O object to use @c as_tuple_t as its
- /// default completion token type.
- template <typename T>
- static typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
- >::other
- as_default_on(ASIO_MOVE_ARG(T) object)
- {
- return typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
- >::other(ASIO_MOVE_CAST(T)(object));
- }
-
-//private:
- CompletionToken token_;
-};
-
-/// Create a completion token to specify that the completion handler arguments
-/// should be combined into a single tuple argument.
-template <typename CompletionToken>
-inline ASIO_CONSTEXPR as_tuple_t<typename decay<CompletionToken>::type>
-as_tuple(ASIO_MOVE_ARG(CompletionToken) completion_token)
-{
- return as_tuple_t<typename decay<CompletionToken>::type>(
- ASIO_MOVE_CAST(CompletionToken)(completion_token));
-}
+#if !defined(ASIO_NO_DEPRECATED)
+using asio::as_tuple_t;
+using asio::as_tuple;
+#endif // !defined(ASIO_NO_DEPRECATED)
} // namespace experimental
} // namespace asio
#include "asio/detail/pop_options.hpp"
-#include "asio/experimental/impl/as_tuple.hpp"
-
#endif // ASIO_EXPERIMENTAL_AS_TUPLE_HPP
diff --git a/3rdparty/asio/include/asio/experimental/awaitable_operators.hpp b/3rdparty/asio/include/asio/experimental/awaitable_operators.hpp
index ddc24c0af82..45799daaa5f 100644
--- a/3rdparty/asio/include/asio/experimental/awaitable_operators.hpp
+++ b/3rdparty/asio/include/asio/experimental/awaitable_operators.hpp
@@ -2,7 +2,7 @@
// experimental/awaitable_operators.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -21,12 +21,12 @@
#include <tuple>
#include <variant>
#include "asio/awaitable.hpp"
+#include "asio/co_spawn.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/experimental/deferred.hpp"
#include "asio/experimental/parallel_group.hpp"
#include "asio/multiple_exceptions.hpp"
#include "asio/this_coro.hpp"
-#include "asio/use_awaitable.hpp"
#include "asio/detail/push_options.hpp"
@@ -37,28 +37,28 @@ namespace detail {
template <typename T, typename Executor>
awaitable<T, Executor> awaitable_wrap(awaitable<T, Executor> a,
- typename constraint<is_constructible<T>::value>::type* = 0)
+ constraint_t<is_constructible<T>::value>* = 0)
{
return a;
}
template <typename T, typename Executor>
awaitable<std::optional<T>, Executor> awaitable_wrap(awaitable<T, Executor> a,
- typename constraint<!is_constructible<T>::value>::type* = 0)
+ constraint_t<!is_constructible<T>::value>* = 0)
{
co_return std::optional<T>(co_await std::move(a));
}
template <typename T>
-T& awaitable_unwrap(typename conditional<true, T, void>::type& r,
- typename constraint<is_constructible<T>::value>::type* = 0)
+T& awaitable_unwrap(conditional_t<true, T, void>& r,
+ constraint_t<is_constructible<T>::value>* = 0)
{
return r;
}
template <typename T>
-T& awaitable_unwrap(std::optional<typename conditional<true, T, void>::type>& r,
- typename constraint<!is_constructible<T>::value>::type* = 0)
+T& awaitable_unwrap(std::optional<conditional_t<true, T, void>>& r,
+ constraint_t<!is_constructible<T>::value>* = 0)
{
return *r;
}
@@ -82,7 +82,7 @@ awaitable<void, Executor> operator&&(
co_spawn(ex, std::move(u), deferred)
).async_wait(
wait_for_one_error(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (ex0 && ex1)
@@ -111,7 +111,7 @@ awaitable<U, Executor> operator&&(
co_spawn(ex, detail::awaitable_wrap(std::move(u)), deferred)
).async_wait(
wait_for_one_error(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (ex0 && ex1)
@@ -140,7 +140,7 @@ awaitable<T, Executor> operator&&(
co_spawn(ex, std::move(u), deferred)
).async_wait(
wait_for_one_error(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (ex0 && ex1)
@@ -169,7 +169,7 @@ awaitable<std::tuple<T, U>, Executor> operator&&(
co_spawn(ex, detail::awaitable_wrap(std::move(u)), deferred)
).async_wait(
wait_for_one_error(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (ex0 && ex1)
@@ -200,7 +200,7 @@ awaitable<std::tuple<T..., std::monostate>, Executor> operator&&(
co_spawn(ex, std::move(u), deferred)
).async_wait(
wait_for_one_error(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (ex0 && ex1)
@@ -229,7 +229,7 @@ awaitable<std::tuple<T..., U>, Executor> operator&&(
co_spawn(ex, detail::awaitable_wrap(std::move(u)), deferred)
).async_wait(
wait_for_one_error(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (ex0 && ex1)
@@ -260,7 +260,7 @@ awaitable<std::variant<std::monostate, std::monostate>, Executor> operator||(
co_spawn(ex, std::move(u), deferred)
).async_wait(
wait_for_one_success(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (order[0] == 0)
@@ -302,7 +302,7 @@ awaitable<std::variant<std::monostate, U>, Executor> operator||(
co_spawn(ex, detail::awaitable_wrap(std::move(u)), deferred)
).async_wait(
wait_for_one_success(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (order[0] == 0)
@@ -346,7 +346,7 @@ awaitable<std::variant<T, std::monostate>, Executor> operator||(
co_spawn(ex, std::move(u), deferred)
).async_wait(
wait_for_one_success(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (order[0] == 0)
@@ -390,7 +390,7 @@ awaitable<std::variant<T, U>, Executor> operator||(
co_spawn(ex, detail::awaitable_wrap(std::move(u)), deferred)
).async_wait(
wait_for_one_success(),
- use_awaitable_t<Executor>{}
+ deferred
);
if (order[0] == 0)
@@ -456,7 +456,7 @@ awaitable<std::variant<T..., std::monostate>, Executor> operator||(
co_spawn(ex, std::move(u), deferred)
).async_wait(
wait_for_one_success(),
- use_awaitable_t<Executor>{}
+ deferred
);
using widen = detail::widen_variant<T..., std::monostate>;
@@ -499,7 +499,7 @@ awaitable<std::variant<T..., U>, Executor> operator||(
co_spawn(ex, detail::awaitable_wrap(std::move(u)), deferred)
).async_wait(
wait_for_one_success(),
- use_awaitable_t<Executor>{}
+ deferred
);
using widen = detail::widen_variant<T..., U>;
diff --git a/3rdparty/asio/include/asio/experimental/basic_channel.hpp b/3rdparty/asio/include/asio/experimental/basic_channel.hpp
new file mode 100644
index 00000000000..6ca1438a093
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/basic_channel.hpp
@@ -0,0 +1,513 @@
+//
+// experimental/basic_channel.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_BASIC_CHANNEL_HPP
+#define ASIO_EXPERIMENTAL_BASIC_CHANNEL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/non_const_lvalue.hpp"
+#include "asio/detail/null_mutex.hpp"
+#include "asio/execution/executor.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/experimental/detail/channel_send_functions.hpp"
+#include "asio/experimental/detail/channel_service.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+} // namespace detail
+
+/// A channel for messages.
+/**
+ * The basic_channel class template is used for sending messages between
+ * different parts of the same application. A <em>message</em> is defined as a
+ * collection of arguments to be passed to a completion handler, and the set of
+ * messages supported by a channel is specified by its @c Traits and
+ * <tt>Signatures...</tt> template parameters. Messages may be sent and received
+ * using asynchronous or non-blocking synchronous operations.
+ *
+ * Unless customising the traits, applications will typically use the @c
+ * experimental::channel alias template. For example:
+ * @code void send_loop(int i, steady_timer& timer,
+ * channel<void(error_code, int)>& ch)
+ * {
+ * if (i < 10)
+ * {
+ * timer.expires_after(chrono::seconds(1));
+ * timer.async_wait(
+ * [i, &timer, &ch](error_code error)
+ * {
+ * if (!error)
+ * {
+ * ch.async_send(error_code(), i,
+ * [i, &timer, &ch](error_code error)
+ * {
+ * if (!error)
+ * {
+ * send_loop(i + 1, timer, ch);
+ * }
+ * });
+ * }
+ * });
+ * }
+ * else
+ * {
+ * ch.close();
+ * }
+ * }
+ *
+ * void receive_loop(channel<void(error_code, int)>& ch)
+ * {
+ * ch.async_receive(
+ * [&ch](error_code error, int i)
+ * {
+ * if (!error)
+ * {
+ * std::cout << "Received " << i << "\n";
+ * receive_loop(ch);
+ * }
+ * });
+ * } @endcode
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe.@n
+ * @e Shared @e objects: Unsafe.
+ *
+ * The basic_channel class template is not thread-safe, and would typically be
+ * used for passing messages between application code that runs on the same
+ * thread or in the same strand. Consider using @ref basic_concurrent_channel,
+ * and its alias template @c experimental::concurrent_channel, to pass messages
+ * between code running in different threads.
+ */
+template <typename Executor, typename Traits, typename... Signatures>
+class basic_channel
+#if !defined(GENERATING_DOCUMENTATION)
+ : public detail::channel_send_functions<
+ basic_channel<Executor, Traits, Signatures...>,
+ Executor, Signatures...>
+#endif // !defined(GENERATING_DOCUMENTATION)
+{
+private:
+ class initiate_async_send;
+ class initiate_async_receive;
+ typedef detail::channel_service<asio::detail::null_mutex> service_type;
+ typedef typename service_type::template implementation_type<
+ Traits, Signatures...>::payload_type payload_type;
+
+ template <typename... PayloadSignatures,
+ ASIO_COMPLETION_TOKEN_FOR(PayloadSignatures...) CompletionToken>
+ auto do_async_receive(detail::channel_payload<PayloadSignatures...>*,
+ CompletionToken&& token)
+ -> decltype(
+ async_initiate<CompletionToken, PayloadSignatures...>(
+ declval<initiate_async_receive>(), token))
+ {
+ return async_initiate<CompletionToken, PayloadSignatures...>(
+ initiate_async_receive(this), token);
+ }
+
+public:
+ /// The type of the executor associated with the channel.
+ typedef Executor executor_type;
+
+ /// Rebinds the channel type to another executor.
+ template <typename Executor1>
+ struct rebind_executor
+ {
+ /// The channel type when rebound to the specified executor.
+ typedef basic_channel<Executor1, Traits, Signatures...> other;
+ };
+
+ /// The traits type associated with the channel.
+ typedef typename Traits::template rebind<Signatures...>::other traits_type;
+
+ /// Construct a basic_channel.
+ /**
+ * This constructor creates and channel.
+ *
+ * @param ex The I/O executor that the channel will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the channel.
+ *
+ * @param max_buffer_size The maximum number of messages that may be buffered
+ * in the channel.
+ */
+ basic_channel(const executor_type& ex, std::size_t max_buffer_size = 0)
+ : service_(&asio::use_service<service_type>(
+ basic_channel::get_context(ex))),
+ impl_(),
+ executor_(ex)
+ {
+ service_->construct(impl_, max_buffer_size);
+ }
+
+ /// Construct and open a basic_channel.
+ /**
+ * This constructor creates and opens a channel.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the channel will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the channel.
+ *
+ * @param max_buffer_size The maximum number of messages that may be buffered
+ * in the channel.
+ */
+ template <typename ExecutionContext>
+ basic_channel(ExecutionContext& context, std::size_t max_buffer_size = 0,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : service_(&asio::use_service<service_type>(context)),
+ impl_(),
+ executor_(context.get_executor())
+ {
+ service_->construct(impl_, max_buffer_size);
+ }
+
+ /// Move-construct a basic_channel from another.
+ /**
+ * This constructor moves a channel from one object to another.
+ *
+ * @param other The other basic_channel object from which the move will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_channel(const executor_type&) constructor.
+ */
+ basic_channel(basic_channel&& other)
+ : service_(other.service_),
+ executor_(other.executor_)
+ {
+ service_->move_construct(impl_, other.impl_);
+ }
+
+ /// Move-assign a basic_channel from another.
+ /**
+ * This assignment operator moves a channel from one object to another.
+ * Cancels any outstanding asynchronous operations associated with the target
+ * object.
+ *
+ * @param other The other basic_channel object from which the move will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_channel(const executor_type&)
+ * constructor.
+ */
+ basic_channel& operator=(basic_channel&& other)
+ {
+ if (this != &other)
+ {
+ service_->move_assign(impl_, *other.service_, other.impl_);
+ executor_.~executor_type();
+ new (&executor_) executor_type(other.executor_);
+ service_ = other.service_;
+ }
+ return *this;
+ }
+
+ // All channels have access to each other's implementations.
+ template <typename, typename, typename...>
+ friend class basic_channel;
+
+ /// Move-construct a basic_channel from another.
+ /**
+ * This constructor moves a channel from one object to another.
+ *
+ * @param other The other basic_channel object from which the move will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_channel(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ basic_channel(
+ basic_channel<Executor1, Traits, Signatures...>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value
+ > = 0)
+ : service_(other.service_),
+ executor_(other.executor_)
+ {
+ service_->move_construct(impl_, other.impl_);
+ }
+
+ /// Move-assign a basic_channel from another.
+ /**
+ * This assignment operator moves a channel from one object to another.
+ * Cancels any outstanding asynchronous operations associated with the target
+ * object.
+ *
+ * @param other The other basic_channel object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_channel(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_channel&
+ > operator=(basic_channel<Executor1, Traits, Signatures...>&& other)
+ {
+ if (this != &other)
+ {
+ service_->move_assign(impl_, *other.service_, other.impl_);
+ executor_.~executor_type();
+ new (&executor_) executor_type(other.executor_);
+ service_ = other.service_;
+ }
+ return *this;
+ }
+
+ /// Destructor.
+ ~basic_channel()
+ {
+ service_->destroy(impl_);
+ }
+
+ /// Get the executor associated with the object.
+ const executor_type& get_executor() noexcept
+ {
+ return executor_;
+ }
+
+ /// Get the capacity of the channel's buffer.
+ std::size_t capacity() noexcept
+ {
+ return service_->capacity(impl_);
+ }
+
+ /// Determine whether the channel is open.
+ bool is_open() const noexcept
+ {
+ return service_->is_open(impl_);
+ }
+
+ /// Reset the channel to its initial state.
+ void reset()
+ {
+ service_->reset(impl_);
+ }
+
+ /// Close the channel.
+ void close()
+ {
+ service_->close(impl_);
+ }
+
+ /// Cancel all asynchronous operations waiting on the channel.
+ /**
+ * All outstanding send operations will complete with the error
+ * @c asio::experimental::error::channel_cancelled. Outstanding receive
+ * operations complete with the result as determined by the channel traits.
+ */
+ void cancel()
+ {
+ service_->cancel(impl_);
+ }
+
+ /// Determine whether a message can be received without blocking.
+ bool ready() const noexcept
+ {
+ return service_->ready(impl_);
+ }
+
+#if defined(GENERATING_DOCUMENTATION)
+
+ /// Try to send a message without blocking.
+ /**
+ * Fails if the buffer is full and there are no waiting receive operations.
+ *
+ * @returns @c true on success, @c false on failure.
+ */
+ template <typename... Args>
+ bool try_send(Args&&... args);
+
+ /// Try to send a message without blocking, using dispatch semantics to call
+ /// the receive operation's completion handler.
+ /**
+ * Fails if the buffer is full and there are no waiting receive operations.
+ *
+ * The receive operation's completion handler may be called from inside this
+ * function.
+ *
+ * @returns @c true on success, @c false on failure.
+ */
+ template <typename... Args>
+ bool try_send_via_dispatch(Args&&... args);
+
+ /// Try to send a number of messages without blocking.
+ /**
+ * @returns The number of messages that were sent.
+ */
+ template <typename... Args>
+ std::size_t try_send_n(std::size_t count, Args&&... args);
+
+ /// Try to send a number of messages without blocking, using dispatch
+ /// semantics to call the receive operations' completion handlers.
+ /**
+ * The receive operations' completion handlers may be called from inside this
+ * function.
+ *
+ * @returns The number of messages that were sent.
+ */
+ template <typename... Args>
+ std::size_t try_send_n_via_dispatch(std::size_t count, Args&&... args);
+
+ /// Asynchronously send a message.
+ /**
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
+ */
+ template <typename... Args,
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
+ CompletionToken ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
+ auto async_send(Args&&... args,
+ CompletionToken&& token);
+
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Try to receive a message without blocking.
+ /**
+ * Fails if the buffer is full and there are no waiting receive operations.
+ *
+ * @returns @c true on success, @c false on failure.
+ */
+ template <typename Handler>
+ bool try_receive(Handler&& handler)
+ {
+ return service_->try_receive(impl_, static_cast<Handler&&>(handler));
+ }
+
+ /// Asynchronously receive a message.
+ /**
+ * @par Completion Signature
+ * As determined by the <tt>Signatures...</tt> template parameter and the
+ * channel traits.
+ */
+ template <typename CompletionToken
+ ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
+ auto async_receive(
+ CompletionToken&& token
+ ASIO_DEFAULT_COMPLETION_TOKEN(Executor))
+#if !defined(GENERATING_DOCUMENTATION)
+ -> decltype(
+ this->do_async_receive(static_cast<payload_type*>(0),
+ static_cast<CompletionToken&&>(token)))
+#endif // !defined(GENERATING_DOCUMENTATION)
+ {
+ return this->do_async_receive(static_cast<payload_type*>(0),
+ static_cast<CompletionToken&&>(token));
+ }
+
+private:
+ // Disallow copying and assignment.
+ basic_channel(const basic_channel&) = delete;
+ basic_channel& operator=(const basic_channel&) = delete;
+
+ template <typename, typename, typename...>
+ friend class detail::channel_send_functions;
+
+ // Helper function to get an executor's context.
+ template <typename T>
+ static execution_context& get_context(const T& t,
+ enable_if_t<execution::is_executor<T>::value>* = 0)
+ {
+ return asio::query(t, execution::context);
+ }
+
+ // Helper function to get an executor's context.
+ template <typename T>
+ static execution_context& get_context(const T& t,
+ enable_if_t<!execution::is_executor<T>::value>* = 0)
+ {
+ return t.context();
+ }
+
+ class initiate_async_send
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_send(basic_channel* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename SendHandler>
+ void operator()(SendHandler&& handler,
+ payload_type&& payload) const
+ {
+ asio::detail::non_const_lvalue<SendHandler> handler2(handler);
+ self_->service_->async_send(self_->impl_,
+ static_cast<payload_type&&>(payload),
+ handler2.value, self_->get_executor());
+ }
+
+ private:
+ basic_channel* self_;
+ };
+
+ class initiate_async_receive
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_receive(basic_channel* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename ReceiveHandler>
+ void operator()(ReceiveHandler&& handler) const
+ {
+ asio::detail::non_const_lvalue<ReceiveHandler> handler2(handler);
+ self_->service_->async_receive(self_->impl_,
+ handler2.value, self_->get_executor());
+ }
+
+ private:
+ basic_channel* self_;
+ };
+
+ // The service associated with the I/O object.
+ service_type* service_;
+
+ // The underlying implementation of the I/O object.
+ typename service_type::template implementation_type<
+ Traits, Signatures...> impl_;
+
+ // The associated executor.
+ Executor executor_;
+};
+
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_BASIC_CHANNEL_HPP
diff --git a/3rdparty/asio/include/asio/experimental/basic_concurrent_channel.hpp b/3rdparty/asio/include/asio/experimental/basic_concurrent_channel.hpp
new file mode 100644
index 00000000000..9dbfea39527
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/basic_concurrent_channel.hpp
@@ -0,0 +1,513 @@
+//
+// experimental/basic_concurrent_channel.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_BASIC_CONCURRENT_CHANNEL_HPP
+#define ASIO_EXPERIMENTAL_BASIC_CONCURRENT_CHANNEL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/non_const_lvalue.hpp"
+#include "asio/detail/mutex.hpp"
+#include "asio/execution/executor.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/experimental/detail/channel_send_functions.hpp"
+#include "asio/experimental/detail/channel_service.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+} // namespace detail
+
+/// A channel for messages.
+/**
+ * The basic_concurrent_channel class template is used for sending messages
+ * between different parts of the same application. A <em>message</em> is
+ * defined as a collection of arguments to be passed to a completion handler,
+ * and the set of messages supported by a channel is specified by its @c Traits
+ * and <tt>Signatures...</tt> template parameters. Messages may be sent and
+ * received using asynchronous or non-blocking synchronous operations.
+ *
+ * Unless customising the traits, applications will typically use the @c
+ * experimental::concurrent_channel alias template. For example:
+ * @code void send_loop(int i, steady_timer& timer,
+ * concurrent_channel<void(error_code, int)>& ch)
+ * {
+ * if (i < 10)
+ * {
+ * timer.expires_after(chrono::seconds(1));
+ * timer.async_wait(
+ * [i, &timer, &ch](error_code error)
+ * {
+ * if (!error)
+ * {
+ * ch.async_send(error_code(), i,
+ * [i, &timer, &ch](error_code error)
+ * {
+ * if (!error)
+ * {
+ * send_loop(i + 1, timer, ch);
+ * }
+ * });
+ * }
+ * });
+ * }
+ * else
+ * {
+ * ch.close();
+ * }
+ * }
+ *
+ * void receive_loop(concurent_channel<void(error_code, int)>& ch)
+ * {
+ * ch.async_receive(
+ * [&ch](error_code error, int i)
+ * {
+ * if (!error)
+ * {
+ * std::cout << "Received " << i << "\n";
+ * receive_loop(ch);
+ * }
+ * });
+ * } @endcode
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe.@n
+ * @e Shared @e objects: Safe.
+ *
+ * The basic_concurrent_channel class template is thread-safe, and would
+ * typically be used for passing messages between application code that run on
+ * different threads. Consider using @ref basic_channel, and its alias template
+ * @c experimental::channel, to pass messages between code running in a single
+ * thread or on the same strand.
+ */
+template <typename Executor, typename Traits, typename... Signatures>
+class basic_concurrent_channel
+#if !defined(GENERATING_DOCUMENTATION)
+ : public detail::channel_send_functions<
+ basic_concurrent_channel<Executor, Traits, Signatures...>,
+ Executor, Signatures...>
+#endif // !defined(GENERATING_DOCUMENTATION)
+{
+private:
+ class initiate_async_send;
+ class initiate_async_receive;
+ typedef detail::channel_service<asio::detail::mutex> service_type;
+ typedef typename service_type::template implementation_type<
+ Traits, Signatures...>::payload_type payload_type;
+
+ template <typename... PayloadSignatures,
+ ASIO_COMPLETION_TOKEN_FOR(PayloadSignatures...) CompletionToken>
+ auto do_async_receive(detail::channel_payload<PayloadSignatures...>*,
+ CompletionToken&& token)
+ -> decltype(
+ async_initiate<CompletionToken, PayloadSignatures...>(
+ declval<initiate_async_receive>(), token))
+ {
+ return async_initiate<CompletionToken, PayloadSignatures...>(
+ initiate_async_receive(this), token);
+ }
+
+public:
+ /// The type of the executor associated with the channel.
+ typedef Executor executor_type;
+
+ /// Rebinds the channel type to another executor.
+ template <typename Executor1>
+ struct rebind_executor
+ {
+ /// The channel type when rebound to the specified executor.
+ typedef basic_concurrent_channel<Executor1, Traits, Signatures...> other;
+ };
+
+ /// The traits type associated with the channel.
+ typedef typename Traits::template rebind<Signatures...>::other traits_type;
+
+ /// Construct a basic_concurrent_channel.
+ /**
+ * This constructor creates and channel.
+ *
+ * @param ex The I/O executor that the channel will use, by default, to
+ * dispatch handlers for any asynchronous operations performed on the channel.
+ *
+ * @param max_buffer_size The maximum number of messages that may be buffered
+ * in the channel.
+ */
+ basic_concurrent_channel(const executor_type& ex,
+ std::size_t max_buffer_size = 0)
+ : service_(&asio::use_service<service_type>(
+ basic_concurrent_channel::get_context(ex))),
+ impl_(),
+ executor_(ex)
+ {
+ service_->construct(impl_, max_buffer_size);
+ }
+
+ /// Construct and open a basic_concurrent_channel.
+ /**
+ * This constructor creates and opens a channel.
+ *
+ * @param context An execution context which provides the I/O executor that
+ * the channel will use, by default, to dispatch handlers for any asynchronous
+ * operations performed on the channel.
+ *
+ * @param max_buffer_size The maximum number of messages that may be buffered
+ * in the channel.
+ */
+ template <typename ExecutionContext>
+ basic_concurrent_channel(ExecutionContext& context,
+ std::size_t max_buffer_size = 0,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : service_(&asio::use_service<service_type>(context)),
+ impl_(),
+ executor_(context.get_executor())
+ {
+ service_->construct(impl_, max_buffer_size);
+ }
+
+ /// Move-construct a basic_concurrent_channel from another.
+ /**
+ * This constructor moves a channel from one object to another.
+ *
+ * @param other The other basic_concurrent_channel object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_concurrent_channel(const executor_type&)
+ * constructor.
+ */
+ basic_concurrent_channel(basic_concurrent_channel&& other)
+ : service_(other.service_),
+ executor_(other.executor_)
+ {
+ service_->move_construct(impl_, other.impl_);
+ }
+
+ /// Move-assign a basic_concurrent_channel from another.
+ /**
+ * This assignment operator moves a channel from one object to another.
+ * Cancels any outstanding asynchronous operations associated with the target
+ * object.
+ *
+ * @param other The other basic_concurrent_channel object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_concurrent_channel(const executor_type&)
+ * constructor.
+ */
+ basic_concurrent_channel& operator=(basic_concurrent_channel&& other)
+ {
+ if (this != &other)
+ {
+ service_->move_assign(impl_, *other.service_, other.impl_);
+ executor_.~executor_type();
+ new (&executor_) executor_type(other.executor_);
+ service_ = other.service_;
+ }
+ return *this;
+ }
+
+ // All channels have access to each other's implementations.
+ template <typename, typename, typename...>
+ friend class basic_concurrent_channel;
+
+ /// Move-construct a basic_concurrent_channel from another.
+ /**
+ * This constructor moves a channel from one object to another.
+ *
+ * @param other The other basic_concurrent_channel object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_concurrent_channel(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ basic_concurrent_channel(
+ basic_concurrent_channel<Executor1, Traits, Signatures...>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value
+ > = 0)
+ : service_(other.service_),
+ executor_(other.executor_)
+ {
+ service_->move_construct(impl_, other.impl_);
+ }
+
+ /// Move-assign a basic_concurrent_channel from another.
+ /**
+ * This assignment operator moves a channel from one object to another.
+ * Cancels any outstanding asynchronous operations associated with the target
+ * object.
+ *
+ * @param other The other basic_concurrent_channel object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_concurrent_channel(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_concurrent_channel&
+ > operator=(
+ basic_concurrent_channel<Executor1, Traits, Signatures...>&& other)
+ {
+ if (this != &other)
+ {
+ service_->move_assign(impl_, *other.service_, other.impl_);
+ executor_.~executor_type();
+ new (&executor_) executor_type(other.executor_);
+ service_ = other.service_;
+ }
+ return *this;
+ }
+
+ /// Destructor.
+ ~basic_concurrent_channel()
+ {
+ service_->destroy(impl_);
+ }
+
+ /// Get the executor associated with the object.
+ const executor_type& get_executor() noexcept
+ {
+ return executor_;
+ }
+
+ /// Get the capacity of the channel's buffer.
+ std::size_t capacity() noexcept
+ {
+ return service_->capacity(impl_);
+ }
+
+ /// Determine whether the channel is open.
+ bool is_open() const noexcept
+ {
+ return service_->is_open(impl_);
+ }
+
+ /// Reset the channel to its initial state.
+ void reset()
+ {
+ service_->reset(impl_);
+ }
+
+ /// Close the channel.
+ void close()
+ {
+ service_->close(impl_);
+ }
+
+ /// Cancel all asynchronous operations waiting on the channel.
+ /**
+ * All outstanding send operations will complete with the error
+ * @c asio::experimental::error::channel_cancelled. Outstanding receive
+ * operations complete with the result as determined by the channel traits.
+ */
+ void cancel()
+ {
+ service_->cancel(impl_);
+ }
+
+ /// Determine whether a message can be received without blocking.
+ bool ready() const noexcept
+ {
+ return service_->ready(impl_);
+ }
+
+#if defined(GENERATING_DOCUMENTATION)
+
+ /// Try to send a message without blocking.
+ /**
+ * Fails if the buffer is full and there are no waiting receive operations.
+ *
+ * @returns @c true on success, @c false on failure.
+ */
+ template <typename... Args>
+ bool try_send(Args&&... args);
+
+ /// Try to send a message without blocking, using dispatch semantics to call
+ /// the receive operation's completion handler.
+ /**
+ * Fails if the buffer is full and there are no waiting receive operations.
+ *
+ * The receive operation's completion handler may be called from inside this
+ * function.
+ *
+ * @returns @c true on success, @c false on failure.
+ */
+ template <typename... Args>
+ bool try_send_via_dispatch(Args&&... args);
+
+ /// Try to send a number of messages without blocking.
+ /**
+ * @returns The number of messages that were sent.
+ */
+ template <typename... Args>
+ std::size_t try_send_n(std::size_t count, Args&&... args);
+
+ /// Try to send a number of messages without blocking, using dispatch
+ /// semantics to call the receive operations' completion handlers.
+ /**
+ * The receive operations' completion handlers may be called from inside this
+ * function.
+ *
+ * @returns The number of messages that were sent.
+ */
+ template <typename... Args>
+ std::size_t try_send_n_via_dispatch(std::size_t count, Args&&... args);
+
+ /// Asynchronously send a message.
+ template <typename... Args,
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
+ CompletionToken ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
+ auto async_send(Args&&... args,
+ CompletionToken&& token);
+
+#endif // defined(GENERATING_DOCUMENTATION)
+
+ /// Try to receive a message without blocking.
+ /**
+ * Fails if the buffer is full and there are no waiting receive operations.
+ *
+ * @returns @c true on success, @c false on failure.
+ */
+ template <typename Handler>
+ bool try_receive(Handler&& handler)
+ {
+ return service_->try_receive(impl_, static_cast<Handler&&>(handler));
+ }
+
+ /// Asynchronously receive a message.
+ template <typename CompletionToken
+ ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
+ auto async_receive(
+ CompletionToken&& token
+ ASIO_DEFAULT_COMPLETION_TOKEN(Executor))
+#if !defined(GENERATING_DOCUMENTATION)
+ -> decltype(
+ this->do_async_receive(static_cast<payload_type*>(0),
+ static_cast<CompletionToken&&>(token)))
+#endif // !defined(GENERATING_DOCUMENTATION)
+ {
+ return this->do_async_receive(static_cast<payload_type*>(0),
+ static_cast<CompletionToken&&>(token));
+ }
+
+private:
+ // Disallow copying and assignment.
+ basic_concurrent_channel(
+ const basic_concurrent_channel&) = delete;
+ basic_concurrent_channel& operator=(
+ const basic_concurrent_channel&) = delete;
+
+ template <typename, typename, typename...>
+ friend class detail::channel_send_functions;
+
+ // Helper function to get an executor's context.
+ template <typename T>
+ static execution_context& get_context(const T& t,
+ enable_if_t<execution::is_executor<T>::value>* = 0)
+ {
+ return asio::query(t, execution::context);
+ }
+
+ // Helper function to get an executor's context.
+ template <typename T>
+ static execution_context& get_context(const T& t,
+ enable_if_t<!execution::is_executor<T>::value>* = 0)
+ {
+ return t.context();
+ }
+
+ class initiate_async_send
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_send(basic_concurrent_channel* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename SendHandler>
+ void operator()(SendHandler&& handler,
+ payload_type&& payload) const
+ {
+ asio::detail::non_const_lvalue<SendHandler> handler2(handler);
+ self_->service_->async_send(self_->impl_,
+ static_cast<payload_type&&>(payload),
+ handler2.value, self_->get_executor());
+ }
+
+ private:
+ basic_concurrent_channel* self_;
+ };
+
+ class initiate_async_receive
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_receive(basic_concurrent_channel* self)
+ : self_(self)
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return self_->get_executor();
+ }
+
+ template <typename ReceiveHandler>
+ void operator()(ReceiveHandler&& handler) const
+ {
+ asio::detail::non_const_lvalue<ReceiveHandler> handler2(handler);
+ self_->service_->async_receive(self_->impl_,
+ handler2.value, self_->get_executor());
+ }
+
+ private:
+ basic_concurrent_channel* self_;
+ };
+
+ // The service associated with the I/O object.
+ service_type* service_;
+
+ // The underlying implementation of the I/O object.
+ typename service_type::template implementation_type<
+ Traits, Signatures...> impl_;
+
+ // The associated executor.
+ Executor executor_;
+};
+
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_BASIC_CONCURRENT_CHANNEL_HPP
diff --git a/3rdparty/asio/include/asio/experimental/cancellation_condition.hpp b/3rdparty/asio/include/asio/experimental/cancellation_condition.hpp
index 586e75e2857..6b1b46dd759 100644
--- a/3rdparty/asio/include/asio/experimental/cancellation_condition.hpp
+++ b/3rdparty/asio/include/asio/experimental/cancellation_condition.hpp
@@ -2,7 +2,7 @@
// experimental/cancellation_condition.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -31,8 +31,7 @@ class wait_for_all
{
public:
template <typename... Args>
- ASIO_CONSTEXPR cancellation_type_t operator()(
- Args&&...) const ASIO_NOEXCEPT
+ constexpr cancellation_type_t operator()(Args&&...) const noexcept
{
return cancellation_type::none;
}
@@ -42,15 +41,14 @@ public:
class wait_for_one
{
public:
- ASIO_CONSTEXPR explicit wait_for_one(
+ constexpr explicit wait_for_one(
cancellation_type_t cancel_type = cancellation_type::all)
: cancel_type_(cancel_type)
{
}
template <typename... Args>
- ASIO_CONSTEXPR cancellation_type_t operator()(
- Args&&...) const ASIO_NOEXCEPT
+ constexpr cancellation_type_t operator()(Args&&...) const noexcept
{
return cancel_type_;
}
@@ -67,34 +65,34 @@ private:
class wait_for_one_success
{
public:
- ASIO_CONSTEXPR explicit wait_for_one_success(
+ constexpr explicit wait_for_one_success(
cancellation_type_t cancel_type = cancellation_type::all)
: cancel_type_(cancel_type)
{
}
- ASIO_CONSTEXPR cancellation_type_t
- operator()() const ASIO_NOEXCEPT
+ constexpr cancellation_type_t
+ operator()() const noexcept
{
return cancel_type_;
}
template <typename E, typename... Args>
- ASIO_CONSTEXPR typename constraint<
- !is_same<typename decay<E>::type, asio::error_code>::value
- && !is_same<typename decay<E>::type, std::exception_ptr>::value,
+ constexpr constraint_t<
+ !is_same<decay_t<E>, asio::error_code>::value
+ && !is_same<decay_t<E>, std::exception_ptr>::value,
cancellation_type_t
- >::type operator()(const E&, Args&&...) const ASIO_NOEXCEPT
+ > operator()(const E&, Args&&...) const noexcept
{
return cancel_type_;
}
template <typename E, typename... Args>
- ASIO_CONSTEXPR typename constraint<
- is_same<typename decay<E>::type, asio::error_code>::value
- || is_same<typename decay<E>::type, std::exception_ptr>::value,
+ constexpr constraint_t<
+ is_same<decay_t<E>, asio::error_code>::value
+ || is_same<decay_t<E>, std::exception_ptr>::value,
cancellation_type_t
- >::type operator()(const E& e, Args&&...) const ASIO_NOEXCEPT
+ > operator()(const E& e, Args&&...) const noexcept
{
return !!e ? cancellation_type::none : cancel_type_;
}
@@ -111,34 +109,33 @@ private:
class wait_for_one_error
{
public:
- ASIO_CONSTEXPR explicit wait_for_one_error(
+ constexpr explicit wait_for_one_error(
cancellation_type_t cancel_type = cancellation_type::all)
: cancel_type_(cancel_type)
{
}
- ASIO_CONSTEXPR cancellation_type_t
- operator()() const ASIO_NOEXCEPT
+ constexpr cancellation_type_t operator()() const noexcept
{
return cancellation_type::none;
}
template <typename E, typename... Args>
- ASIO_CONSTEXPR typename constraint<
- !is_same<typename decay<E>::type, asio::error_code>::value
- && !is_same<typename decay<E>::type, std::exception_ptr>::value,
+ constexpr constraint_t<
+ !is_same<decay_t<E>, asio::error_code>::value
+ && !is_same<decay_t<E>, std::exception_ptr>::value,
cancellation_type_t
- >::type operator()(const E&, Args&&...) const ASIO_NOEXCEPT
+ > operator()(const E&, Args&&...) const noexcept
{
return cancellation_type::none;
}
template <typename E, typename... Args>
- ASIO_CONSTEXPR typename constraint<
- is_same<typename decay<E>::type, asio::error_code>::value
- || is_same<typename decay<E>::type, std::exception_ptr>::value,
+ constexpr constraint_t<
+ is_same<decay_t<E>, asio::error_code>::value
+ || is_same<decay_t<E>, std::exception_ptr>::value,
cancellation_type_t
- >::type operator()(const E& e, Args&&...) const ASIO_NOEXCEPT
+ > operator()(const E& e, Args&&...) const noexcept
{
return !!e ? cancel_type_ : cancellation_type::none;
}
diff --git a/3rdparty/asio/include/asio/experimental/channel.hpp b/3rdparty/asio/include/asio/experimental/channel.hpp
new file mode 100644
index 00000000000..c808bb4aafd
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/channel.hpp
@@ -0,0 +1,70 @@
+//
+// experimental/channel.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_CHANNEL_HPP
+#define ASIO_EXPERIMENTAL_CHANNEL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/any_io_executor.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/execution/executor.hpp"
+#include "asio/is_executor.hpp"
+#include "asio/experimental/basic_channel.hpp"
+#include "asio/experimental/channel_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename ExecutorOrSignature, typename = void>
+struct channel_type
+{
+ template <typename... Signatures>
+ struct inner
+ {
+ typedef basic_channel<any_io_executor, channel_traits<>,
+ ExecutorOrSignature, Signatures...> type;
+ };
+};
+
+template <typename ExecutorOrSignature>
+struct channel_type<ExecutorOrSignature,
+ enable_if_t<
+ is_executor<ExecutorOrSignature>::value
+ || execution::is_executor<ExecutorOrSignature>::value
+ >>
+{
+ template <typename... Signatures>
+ struct inner
+ {
+ typedef basic_channel<ExecutorOrSignature,
+ channel_traits<>, Signatures...> type;
+ };
+};
+
+} // namespace detail
+
+/// Template type alias for common use of channel.
+template <typename ExecutorOrSignature, typename... Signatures>
+using channel = typename detail::channel_type<
+ ExecutorOrSignature>::template inner<Signatures...>::type;
+
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_CHANNEL_HPP
diff --git a/3rdparty/asio/include/asio/experimental/channel_error.hpp b/3rdparty/asio/include/asio/experimental/channel_error.hpp
new file mode 100644
index 00000000000..dd419757cc3
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/channel_error.hpp
@@ -0,0 +1,82 @@
+//
+// experimental/channel_error.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_CHANNEL_ERROR_HPP
+#define ASIO_EXPERIMENTAL_CHANNEL_ERROR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/error_code.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace error {
+
+enum channel_errors
+{
+ /// The channel was closed.
+ channel_closed = 1,
+
+ /// The channel was cancelled.
+ channel_cancelled = 2
+};
+
+extern ASIO_DECL
+const asio::error_category& get_channel_category();
+
+static const asio::error_category&
+ channel_category ASIO_UNUSED_VARIABLE
+ = asio::experimental::error::get_channel_category();
+
+} // namespace error
+namespace channel_errc {
+ // Simulates a scoped enum.
+ using error::channel_closed;
+ using error::channel_cancelled;
+} // namespace channel_errc
+} // namespace experimental
+} // namespace asio
+
+namespace std {
+
+template<> struct is_error_code_enum<
+ asio::experimental::error::channel_errors>
+{
+ static const bool value = true;
+};
+
+} // namespace std
+
+namespace asio {
+namespace experimental {
+namespace error {
+
+inline asio::error_code make_error_code(channel_errors e)
+{
+ return asio::error_code(
+ static_cast<int>(e), get_channel_category());
+}
+
+} // namespace error
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#if defined(ASIO_HEADER_ONLY)
+# include "asio/experimental/impl/channel_error.ipp"
+#endif // defined(ASIO_HEADER_ONLY)
+
+#endif // ASIO_EXPERIMENTAL_CHANNEL_ERROR_HPP
diff --git a/3rdparty/asio/include/asio/experimental/channel_traits.hpp b/3rdparty/asio/include/asio/experimental/channel_traits.hpp
new file mode 100644
index 00000000000..bccff9876e4
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/channel_traits.hpp
@@ -0,0 +1,301 @@
+//
+// experimental/channel_traits.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_CHANNEL_TRAITS_HPP
+#define ASIO_EXPERIMENTAL_CHANNEL_TRAITS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <deque>
+#include "asio/detail/type_traits.hpp"
+#include "asio/error.hpp"
+#include "asio/experimental/channel_error.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+
+#if defined(GENERATING_DOCUMENTATION)
+
+template <typename... Signatures>
+struct channel_traits
+{
+ /// Rebind the traits to a new set of signatures.
+ /**
+ * This nested structure must have a single nested type @c other that
+ * aliases a traits type with the specified set of signatures.
+ */
+ template <typename... NewSignatures>
+ struct rebind
+ {
+ typedef user_defined other;
+ };
+
+ /// Determine the container for the specified elements.
+ /**
+ * This nested structure must have a single nested type @c other that
+ * aliases a container type for the specified element type.
+ */
+ template <typename Element>
+ struct container
+ {
+ typedef user_defined type;
+ };
+
+ /// The signature of a channel cancellation notification.
+ typedef void receive_cancelled_signature(...);
+
+ /// Invoke the specified handler with a cancellation notification.
+ template <typename F>
+ static void invoke_receive_cancelled(F f);
+
+ /// The signature of a channel closed notification.
+ typedef void receive_closed_signature(...);
+
+ /// Invoke the specified handler with a closed notification.
+ template <typename F>
+ static void invoke_receive_closed(F f);
+};
+
+#else // defined(GENERATING_DOCUMENTATION)
+
+/// Traits used for customising channel behaviour.
+template <typename... Signatures>
+struct channel_traits
+{
+ template <typename... NewSignatures>
+ struct rebind
+ {
+ typedef channel_traits<NewSignatures...> other;
+ };
+};
+
+template <typename R>
+struct channel_traits<R(asio::error_code)>
+{
+ template <typename... NewSignatures>
+ struct rebind
+ {
+ typedef channel_traits<NewSignatures...> other;
+ };
+
+ template <typename Element>
+ struct container
+ {
+ typedef std::deque<Element> type;
+ };
+
+ typedef R receive_cancelled_signature(asio::error_code);
+
+ template <typename F>
+ static void invoke_receive_cancelled(F f)
+ {
+ const asio::error_code e = error::channel_cancelled;
+ static_cast<F&&>(f)(e);
+ }
+
+ typedef R receive_closed_signature(asio::error_code);
+
+ template <typename F>
+ static void invoke_receive_closed(F f)
+ {
+ const asio::error_code e = error::channel_closed;
+ static_cast<F&&>(f)(e);
+ }
+};
+
+template <typename R, typename... Args, typename... Signatures>
+struct channel_traits<R(asio::error_code, Args...), Signatures...>
+{
+ template <typename... NewSignatures>
+ struct rebind
+ {
+ typedef channel_traits<NewSignatures...> other;
+ };
+
+ template <typename Element>
+ struct container
+ {
+ typedef std::deque<Element> type;
+ };
+
+ typedef R receive_cancelled_signature(asio::error_code, Args...);
+
+ template <typename F>
+ static void invoke_receive_cancelled(F f)
+ {
+ const asio::error_code e = error::channel_cancelled;
+ static_cast<F&&>(f)(e, decay_t<Args>()...);
+ }
+
+ typedef R receive_closed_signature(asio::error_code, Args...);
+
+ template <typename F>
+ static void invoke_receive_closed(F f)
+ {
+ const asio::error_code e = error::channel_closed;
+ static_cast<F&&>(f)(e, decay_t<Args>()...);
+ }
+};
+
+template <typename R>
+struct channel_traits<R(std::exception_ptr)>
+{
+ template <typename... NewSignatures>
+ struct rebind
+ {
+ typedef channel_traits<NewSignatures...> other;
+ };
+
+ template <typename Element>
+ struct container
+ {
+ typedef std::deque<Element> type;
+ };
+
+ typedef R receive_cancelled_signature(std::exception_ptr);
+
+ template <typename F>
+ static void invoke_receive_cancelled(F f)
+ {
+ const asio::error_code e = error::channel_cancelled;
+ static_cast<F&&>(f)(
+ std::make_exception_ptr(asio::system_error(e)));
+ }
+
+ typedef R receive_closed_signature(std::exception_ptr);
+
+ template <typename F>
+ static void invoke_receive_closed(F f)
+ {
+ const asio::error_code e = error::channel_closed;
+ static_cast<F&&>(f)(
+ std::make_exception_ptr(asio::system_error(e)));
+ }
+};
+
+template <typename R, typename... Args, typename... Signatures>
+struct channel_traits<R(std::exception_ptr, Args...), Signatures...>
+{
+ template <typename... NewSignatures>
+ struct rebind
+ {
+ typedef channel_traits<NewSignatures...> other;
+ };
+
+ template <typename Element>
+ struct container
+ {
+ typedef std::deque<Element> type;
+ };
+
+ typedef R receive_cancelled_signature(std::exception_ptr, Args...);
+
+ template <typename F>
+ static void invoke_receive_cancelled(F f)
+ {
+ const asio::error_code e = error::channel_cancelled;
+ static_cast<F&&>(f)(
+ std::make_exception_ptr(asio::system_error(e)),
+ decay_t<Args>()...);
+ }
+
+ typedef R receive_closed_signature(std::exception_ptr, Args...);
+
+ template <typename F>
+ static void invoke_receive_closed(F f)
+ {
+ const asio::error_code e = error::channel_closed;
+ static_cast<F&&>(f)(
+ std::make_exception_ptr(asio::system_error(e)),
+ decay_t<Args>()...);
+ }
+};
+
+template <typename R>
+struct channel_traits<R()>
+{
+ template <typename... NewSignatures>
+ struct rebind
+ {
+ typedef channel_traits<NewSignatures...> other;
+ };
+
+ template <typename Element>
+ struct container
+ {
+ typedef std::deque<Element> type;
+ };
+
+ typedef R receive_cancelled_signature(asio::error_code);
+
+ template <typename F>
+ static void invoke_receive_cancelled(F f)
+ {
+ const asio::error_code e = error::channel_cancelled;
+ static_cast<F&&>(f)(e);
+ }
+
+ typedef R receive_closed_signature(asio::error_code);
+
+ template <typename F>
+ static void invoke_receive_closed(F f)
+ {
+ const asio::error_code e = error::channel_closed;
+ static_cast<F&&>(f)(e);
+ }
+};
+
+template <typename R, typename T>
+struct channel_traits<R(T)>
+{
+ template <typename... NewSignatures>
+ struct rebind
+ {
+ typedef channel_traits<NewSignatures...> other;
+ };
+
+ template <typename Element>
+ struct container
+ {
+ typedef std::deque<Element> type;
+ };
+
+ typedef R receive_cancelled_signature(asio::error_code);
+
+ template <typename F>
+ static void invoke_receive_cancelled(F f)
+ {
+ const asio::error_code e = error::channel_cancelled;
+ static_cast<F&&>(f)(e);
+ }
+
+ typedef R receive_closed_signature(asio::error_code);
+
+ template <typename F>
+ static void invoke_receive_closed(F f)
+ {
+ const asio::error_code e = error::channel_closed;
+ static_cast<F&&>(f)(e);
+ }
+};
+
+#endif // defined(GENERATING_DOCUMENTATION)
+
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_CHANNEL_TRAITS_HPP
diff --git a/3rdparty/asio/include/asio/experimental/co_composed.hpp b/3rdparty/asio/include/asio/experimental/co_composed.hpp
new file mode 100644
index 00000000000..dd1b82939cd
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/co_composed.hpp
@@ -0,0 +1,145 @@
+//
+// experimental/co_composed.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_CO_COMPOSED_HPP
+#define ASIO_EXPERIMENTAL_CO_COMPOSED_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/async_result.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+
+/// Creates an initiation function object that may be used to launch a
+/// coroutine-based composed asynchronous operation.
+/**
+ * The experimental::co_composed utility simplifies the implementation of
+ * composed asynchronous operations by automatically adapting a coroutine to be
+ * an initiation function object for use with @c async_initiate. When awaiting
+ * asynchronous operations, the coroutine automatically uses a conforming
+ * intermediate completion handler.
+ *
+ * @param implementation A function object that contains the coroutine-based
+ * implementation of the composed asynchronous operation. The first argument to
+ * the function object represents the state of the operation, and may be used
+ * to test for cancellation. The remaining arguments are those passed to @c
+ * async_initiate after the completion token.
+ *
+ * @param io_objects_or_executors Zero or more I/O objects or I/O executors for
+ * which outstanding work must be maintained while the operation is incomplete.
+ *
+ * @par Per-Operation Cancellation
+ * By default, terminal per-operation cancellation is enabled for composed
+ * operations that use experimental::co_composed. To disable cancellation for
+ * the composed operation, or to alter its supported cancellation types, call
+ * the state's @c reset_cancellation_state function.
+ *
+ * @par Examples
+ * The following example illustrates manual error handling and explicit checks
+ * for cancellation. The completion handler is invoked via a @c co_yield to the
+ * state's @c complete function, which never returns.
+ *
+ * @code template <typename CompletionToken>
+ * auto async_echo(tcp::socket& socket,
+ * CompletionToken&& token)
+ * {
+ * return asio::async_initiate<
+ * CompletionToken, void(std::error_code)>(
+ * asio::experimental::co_composed(
+ * [](auto state, tcp::socket& socket) -> void
+ * {
+ * state.reset_cancellation_state(
+ * asio::enable_terminal_cancellation());
+ *
+ * while (!state.cancelled())
+ * {
+ * char data[1024];
+ * auto [e1, n1] =
+ * co_await socket.async_read_some(
+ * asio::buffer(data),
+ * asio::as_tuple(asio::deferred));
+ *
+ * if (e1)
+ * co_yield state.complete(e1);
+ *
+ * if (!!state.cancelled())
+ * co_yield state.complete(
+ * make_error_code(asio::error::operation_aborted));
+ *
+ * auto [e2, n2] =
+ * co_await asio::async_write(socket,
+ * asio::buffer(data, n1),
+ * asio::as_tuple(asio::deferred));
+ *
+ * if (e2)
+ * co_yield state.complete(e2);
+ * }
+ * }, socket),
+ * token, std::ref(socket));
+ * } @endcode
+ *
+ * This next example shows exception-based error handling and implicit checks
+ * for cancellation. The completion handler is invoked after returning from the
+ * coroutine via @c co_return. Valid @c co_return values are specified using
+ * completion signatures passed to the @c co_composed function.
+ *
+ * @code template <typename CompletionToken>
+ * auto async_echo(tcp::socket& socket,
+ * CompletionToken&& token)
+ * {
+ * return asio::async_initiate<
+ * CompletionToken, void(std::error_code)>(
+ * asio::experimental::co_composed<
+ * void(std::error_code)>(
+ * [](auto state, tcp::socket& socket) -> void
+ * {
+ * try
+ * {
+ * state.throw_if_cancelled(true);
+ * state.reset_cancellation_state(
+ * asio::enable_terminal_cancellation());
+ *
+ * for (;;)
+ * {
+ * char data[1024];
+ * std::size_t n = co_await socket.async_read_some(
+ * asio::buffer(data), asio::deferred);
+ *
+ * co_await asio::async_write(socket,
+ * asio::buffer(data, n), asio::deferred);
+ * }
+ * }
+ * catch (const std::system_error& e)
+ * {
+ * co_return {e.code()};
+ * }
+ * }, socket),
+ * token, std::ref(socket));
+ * } @endcode
+ */
+template <completion_signature... Signatures,
+ typename Implementation, typename... IoObjectsOrExecutors>
+auto co_composed(Implementation&& implementation,
+ IoObjectsOrExecutors&&... io_objects_or_executors);
+
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/experimental/impl/co_composed.hpp"
+
+#endif // ASIO_EXPERIMENTAL_CO_COMPOSED_HPP
diff --git a/3rdparty/asio/include/asio/experimental/co_spawn.hpp b/3rdparty/asio/include/asio/experimental/co_spawn.hpp
new file mode 100644
index 00000000000..8ef59283178
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/co_spawn.hpp
@@ -0,0 +1,187 @@
+//
+// experimental/co_spawn.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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 ASIO_EXPERIMENTAL_CO_SPAWN_HPP
+#define ASIO_EXPERIMENTAL_CO_SPAWN_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <utility>
+#include "asio/compose.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/experimental/coro.hpp"
+#include "asio/experimental/deferred.hpp"
+#include "asio/experimental/prepend.hpp"
+#include "asio/redirect_error.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename T, typename U, typename Executor>
+struct coro_spawn_op
+{
+ coro<T, U, Executor> c;
+
+ void operator()(auto& self)
+ {
+ auto op = c.async_resume(deferred);
+ std::move(op)((prepend)(std::move(self), 0));
+ }
+
+ void operator()(auto& self, int, auto... res)
+ {
+ self.complete(std::move(res)...);
+ }
+};
+
+} // namespace detail
+
+/// Spawn a resumable coroutine.
+/**
+ * This function spawns the coroutine for execution on its executor. It binds
+ * the lifetime of the coroutine to the executor.
+ *
+ * @param c The coroutine
+ *
+ * @param token The completion token
+ *
+ * @returns Implementation defined
+ */
+template <typename T, typename Executor, typename CompletionToken>
+ASIO_INITFN_AUTO_RESULT_TYPE(
+ CompletionToken, void(std::exception_ptr, T))
+co_spawn(coro<void, T, Executor> c, CompletionToken&& token)
+{
+ auto exec = c.get_executor();
+ return async_compose<CompletionToken, void(std::exception_ptr, T)>(
+ detail::coro_spawn_op<void, T, Executor>{std::move(c)},
+ token, exec);
+}
+
+/// Spawn a resumable coroutine.
+/**
+ * This function spawns the coroutine for execution on its executor. It binds
+ * the lifetime of the coroutine to the executor.
+ *
+ * @param c The coroutine
+ *
+ * @param token The completion token
+ *
+ * @returns Implementation defined
+ */
+template <typename T, typename Executor, typename CompletionToken>
+ASIO_INITFN_AUTO_RESULT_TYPE(
+ CompletionToken, void(std::exception_ptr, T))
+co_spawn(coro<void(), T, Executor> c, CompletionToken&& token)
+{
+ auto exec = c.get_executor();
+ return async_compose<CompletionToken, void(std::exception_ptr, T)>(
+ detail::coro_spawn_op<void(), T, Executor>{std::move(c)},
+ token, exec);
+}
+
+/// Spawn a resumable coroutine.
+/**
+ * This function spawns the coroutine for execution on its executor. It binds
+ * the lifetime of the coroutine to the executor.
+ *
+ * @param c The coroutine
+ *
+ * @param token The completion token
+ *
+ * @returns Implementation defined
+ */
+template <typename T, typename Executor, typename CompletionToken>
+ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(T))
+co_spawn(coro<void() noexcept, T, Executor> c, CompletionToken&& token)
+{
+ auto exec = c.get_executor();
+ return async_compose<CompletionToken, void(T)>(
+ detail::coro_spawn_op<void() noexcept, T, Executor>{std::move(c)},
+ token, exec);
+}
+
+/// Spawn a resumable coroutine.
+/**
+ * This function spawns the coroutine for execution on its executor. It binds
+ * the lifetime of the coroutine to the executor.
+ *
+ * @param c The coroutine
+ *
+ * @param token The completion token
+ *
+ * @returns Implementation defined
+ */
+template <typename Executor, typename CompletionToken>
+ASIO_INITFN_AUTO_RESULT_TYPE(
+ CompletionToken, void(std::exception_ptr))
+co_spawn(coro<void, void, Executor> c, CompletionToken&& token)
+{
+ auto exec = c.get_executor();
+ return async_compose<CompletionToken, void(std::exception_ptr)>(
+ detail::coro_spawn_op<void, void, Executor>{std::move(c)},
+ token, exec);
+}
+
+/// Spawn a resumable coroutine.
+/**
+ * This function spawns the coroutine for execution on its executor. It binds
+ * the lifetime of the coroutine to the executor.
+ *
+ * @param c The coroutine
+ *
+ * @param token The completion token
+ *
+ * @returns Implementation defined
+ */
+template <typename Executor, typename CompletionToken>
+ASIO_INITFN_AUTO_RESULT_TYPE(
+ CompletionToken, void(std::exception_ptr))
+co_spawn(coro<void(), void, Executor> c, CompletionToken&& token)
+{
+ auto exec = c.get_executor();
+ return async_compose<CompletionToken, void(std::exception_ptr)>(
+ detail::coro_spawn_op<void(), void, Executor>{std::move(c)},
+ token, exec);
+}
+
+/// Spawn a resumable coroutine.
+/**
+ * This function spawns the coroutine for execution on its executor. It binds
+ * the lifetime of the coroutine to the executor.
+ *
+ * @param c The coroutine
+ *
+ * @param token The completion token
+ *
+ * @returns Implementation defined
+ */
+template <typename Executor, typename CompletionToken>
+ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void())
+co_spawn(coro<void() noexcept, void, Executor> c, CompletionToken&& token)
+{
+ auto exec = c.get_executor();
+ return async_compose<CompletionToken, void()>(
+ detail::coro_spawn_op<void() noexcept, void, Executor>{std::move(c)},
+ token, exec);
+}
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif //ASIO_EXPERIMENTAL_CO_SPAWN_HPP
diff --git a/3rdparty/asio/include/asio/experimental/concurrent_channel.hpp b/3rdparty/asio/include/asio/experimental/concurrent_channel.hpp
new file mode 100644
index 00000000000..b326be96d31
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/concurrent_channel.hpp
@@ -0,0 +1,70 @@
+//
+// experimental/concurrent_channel.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_CONCURRENT_CHANNEL_HPP
+#define ASIO_EXPERIMENTAL_CONCURRENT_CHANNEL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/any_io_executor.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/execution/executor.hpp"
+#include "asio/is_executor.hpp"
+#include "asio/experimental/basic_concurrent_channel.hpp"
+#include "asio/experimental/channel_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename ExecutorOrSignature, typename = void>
+struct concurrent_channel_type
+{
+ template <typename... Signatures>
+ struct inner
+ {
+ typedef basic_concurrent_channel<any_io_executor, channel_traits<>,
+ ExecutorOrSignature, Signatures...> type;
+ };
+};
+
+template <typename ExecutorOrSignature>
+struct concurrent_channel_type<ExecutorOrSignature,
+ enable_if_t<
+ is_executor<ExecutorOrSignature>::value
+ || execution::is_executor<ExecutorOrSignature>::value
+ >>
+{
+ template <typename... Signatures>
+ struct inner
+ {
+ typedef basic_concurrent_channel<ExecutorOrSignature,
+ channel_traits<>, Signatures...> type;
+ };
+};
+
+} // namespace detail
+
+/// Template type alias for common use of channel.
+template <typename ExecutorOrSignature, typename... Signatures>
+using concurrent_channel = typename detail::concurrent_channel_type<
+ ExecutorOrSignature>::template inner<Signatures...>::type;
+
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_CONCURRENT_CHANNEL_HPP
diff --git a/3rdparty/asio/include/asio/experimental/coro.hpp b/3rdparty/asio/include/asio/experimental/coro.hpp
index fb2ad013a52..de909d29a6b 100644
--- a/3rdparty/asio/include/asio/experimental/coro.hpp
+++ b/3rdparty/asio/include/asio/experimental/coro.hpp
@@ -2,8 +2,8 @@
// experimental/coro.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -12,236 +12,105 @@
#ifndef ASIO_EXPERIMENTAL_CORO_HPP
#define ASIO_EXPERIMENTAL_CORO_HPP
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
#include "asio/detail/config.hpp"
#include "asio/dispatch.hpp"
-#include "asio/experimental/detail/coro_promise_allocator.hpp"
-#include "asio/experimental/detail/partial_promise.hpp"
-#include "asio/experimental/detail/coro_traits.hpp"
#include "asio/error.hpp"
#include "asio/error_code.hpp"
-#include "asio/experimental/use_coro.hpp"
+#include "asio/experimental/coro_traits.hpp"
+#include "asio/experimental/detail/coro_promise_allocator.hpp"
+#include "asio/experimental/detail/partial_promise.hpp"
#include "asio/post.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
namespace experimental {
-
-template <typename Yield, typename Return, typename Executor>
-struct coro;
-
namespace detail {
-template <typename Signature, typename Return, typename Executor>
+template <typename Signature, typename Return,
+ typename Executor, typename Allocator>
struct coro_promise;
-template <typename T>
-struct is_noexcept : std::false_type
-{
-};
-
-template <typename Return, typename... Args>
-struct is_noexcept<Return(Args...)> : std::false_type
-{
-};
-
-template <typename Return, typename... Args>
-struct is_noexcept<Return(Args...) noexcept> : std::true_type
-{
-};
-
-template <typename T>
-constexpr bool is_noexcept_v = is_noexcept<T>::value;
-
-template <typename T>
-struct coro_error;
-
-template <>
-struct coro_error<asio::error_code>
-{
- static asio::error_code invalid()
- {
- return error::fault;
- }
-
- static asio::error_code cancelled()
- {
- return error::operation_aborted;
- }
-
- static asio::error_code interrupted()
- {
- return error::interrupted;
- }
-
- static asio::error_code done()
- {
- return error::broken_pipe;
- }
-};
-
-template <>
-struct coro_error<std::exception_ptr>
-{
- static std::exception_ptr invalid()
- {
- return std::make_exception_ptr(
- asio::system_error(
- coro_error<asio::error_code>::invalid()));
- }
-
- static std::exception_ptr cancelled()
- {
- return std::make_exception_ptr(
- asio::system_error(
- coro_error<asio::error_code>::cancelled()));
- }
-
- static std::exception_ptr interrupted()
- {
- return std::make_exception_ptr(
- asio::system_error(
- coro_error<asio::error_code>::interrupted()));
- }
-
- static std::exception_ptr done()
- {
- return std::make_exception_ptr(
- asio::system_error(
- coro_error<asio::error_code>::done()));
- }
-};
-
-template <typename T, typename Coroutine, typename = void>
-struct coro_with_arg
-{
- using coro_t = Coroutine;
- T value;
- coro_t& coro;
-
- struct awaitable_t
- {
- T value;
- coro_t& coro;
-
- constexpr static bool await_ready() { return false; }
-
- template <typename Y, typename R, typename E>
- auto await_suspend(coroutine_handle<coro_promise<Y, R, E>> h)
- -> coroutine_handle<>
- {
- auto& hp = h.promise();
- if (hp.get_executor() == coro.get_executor())
- {
- coro.coro_->awaited_from = h;
- coro.coro_->reset_error();
- coro.coro_->input_ = std::move(value);
- struct cancel_handler
- {
- cancel_handler(coro_t& coro) : coro(coro.coro_) {}
-
- typename coro_t::promise_type* coro;
-
- void operator()(cancellation_type ct)
- {
- coro->cancel.signal.emit(ct);
- }
- };
-
- hp.cancel.state.slot().template emplace<cancel_handler>(coro);
- return coro.coro_->get_handle();
- } else
- {
- coro.coro_->awaited_from =
- dispatch_coroutine(hp.get_executor(), [h]() mutable
- { h.resume(); });
- coro.coro_->reset_error();
- coro.coro_->input_ = std::move(value);
-
- struct cancel_handler
- {
- cancel_handler(E e, coro_t& coro) : e(e), coro(coro.coro_) {}
-
- E e;
- typename coro_t::promise_type* coro;
-
- void operator()(cancellation_type ct)
- {
- asio::dispatch(e,
- [ct, p = coro]() mutable
- {
- p->cancel.signal.emit(ct);
- });
- }
- };
-
- hp.cancel.state.slot().template emplace<cancel_handler>(
- coro.get_executor(), coro);
-
- return dispatch_coroutine(
- hp.get_executor(), [h]() mutable { h.resume(); });
- }
-
- }
-
- auto await_resume() -> typename coro_t::result_type
- {
- coro.coro_->cancel.state.slot().clear();
- coro.coro_->rethrow_if();
- return std::move(coro.coro_->result_);
- }
- };
-
- template <typename CompletionToken>
- auto async_resume(CompletionToken&& token) &&
- {
- return coro.async_resume(std::move(value),
- std::forward<CompletionToken>(token));
- }
-
- auto operator co_await() &&
- {
- return awaitable_t{std::move(value), coro};
- }
-};
+template <typename T, typename Coroutine>
+struct coro_with_arg;
} // namespace detail
+/// The main type of a resumable coroutine.
+/**
+ * Template parameter @c Yield specifies type or signature used by co_yield,
+ * @c Return specifies the type used for co_return, and @c Executor specifies
+ * the underlying executor type.
+ */
template <typename Yield = void, typename Return = void,
- typename Executor = any_io_executor>
+ typename Executor = any_io_executor,
+ typename Allocator = std::allocator<void>>
struct coro
{
- using traits = detail::coro_traits<Yield, Return, Executor>;
+ /// The traits of the coroutine. See asio::experimental::coro_traits
+ /// for details.
+ using traits = coro_traits<Yield, Return, Executor>;
+ /// The value that can be passed into a symmetrical cororoutine. @c void if
+ /// asymmetrical.
using input_type = typename traits::input_type;
+
+ /// The type that can be passed out through a co_yield.
using yield_type = typename traits::yield_type;
+
+ /// The type that can be passed out through a co_return.
using return_type = typename traits::return_type;
- using error_type = typename traits::error_type;
+
+ /// The type received by a co_await or async_resume. Its a combination of
+ /// yield and return.
using result_type = typename traits::result_type;
+
+ /// The signature used by the async_resume.
+ using signature_type = typename traits::signature_type;
+
+ /// Whether or not the coroutine is noexcept.
constexpr static bool is_noexcept = traits::is_noexcept;
- using promise_type = detail::coro_promise<Yield, Return, Executor>;
+ /// The error type of the coroutine. Void for noexcept
+ using error_type = typename traits::error_type;
+
+ /// Completion handler type used by async_resume.
+ using completion_handler = typename traits::completion_handler;
+
+ /// The internal promise-type of the coroutine.
+ using promise_type = detail::coro_promise<Yield, Return, Executor, Allocator>;
#if !defined(GENERATING_DOCUMENTATION)
- template <typename T, typename Coroutine, typename>
+ template <typename T, typename Coroutine>
friend struct detail::coro_with_arg;
#endif // !defined(GENERATING_DOCUMENTATION)
+ /// The executor type.
using executor_type = Executor;
+ /// The allocator type.
+ using allocator_type = Allocator;
+
#if !defined(GENERATING_DOCUMENTATION)
- friend struct detail::coro_promise<Yield, Return, Executor>;
+ friend struct detail::coro_promise<Yield, Return, Executor, Allocator>;
#endif // !defined(GENERATING_DOCUMENTATION)
+ /// The default constructor, gives an invalid coroutine.
coro() = default;
+ /// Move constructor.
coro(coro&& lhs) noexcept
: coro_(std::exchange(lhs.coro_, nullptr))
{
}
- coro(const coro &) = delete;
+ coro(const coro&) = delete;
+ /// Move assignment.
coro& operator=(coro&& lhs) noexcept
{
std::swap(coro_, lhs.coro_);
@@ -250,6 +119,12 @@ struct coro
coro& operator=(const coro&) = delete;
+ /// Destructor. Destroys the coroutine, if it holds a valid one.
+ /**
+ * @note This does not cancel an active coroutine. Destructing a resumable
+ * coroutine, i.e. one with a call to async_resume that has not completed, is
+ * undefined behaviour.
+ */
~coro()
{
if (coro_ != nullptr)
@@ -260,8 +135,7 @@ struct coro
destroyer(const detail::coroutine_handle<promise_type>& handle)
: handle(handle)
- {
- }
+ { }
destroyer(destroyer&& lhs)
: handle(std::exchange(lhs.handle, nullptr))
@@ -286,6 +160,7 @@ struct coro
}
}
+ /// Get the used executor.
executor_type get_executor() const
{
if (coro_)
@@ -297,29 +172,74 @@ struct coro
throw std::logic_error("Coroutine has no executor");
}
+ /// Get the used allocator.
+ allocator_type get_allocator() const
+ {
+ if (coro_)
+ return coro_->get_allocator();
+
+ if constexpr (std::is_default_constructible_v<Allocator>)
+ return Allocator{};
+ else
+ throw std::logic_error(
+ "Coroutine has no available allocator without a constructed promise");
+ }
+
+ /// Resume the coroutine.
+ /**
+ * @param token The completion token of the async resume.
+ *
+ * @attention Calling an invalid coroutine with a noexcept signature is
+ * undefined behaviour.
+ *
+ * @note This overload is only available for coroutines without an input
+ * value.
+ */
template <typename CompletionToken>
requires std::is_void_v<input_type>
- auto async_resume(CompletionToken&& token)
+ auto async_resume(CompletionToken&& token) &
{
return async_initiate<CompletionToken,
typename traits::completion_handler>(
initiate_async_resume(this), token);
}
-
+ /// Resume the coroutine.
+ /**
+ * @param token The completion token of the async resume.
+ *
+ * @attention Calling an invalid coroutine with a noexcept signature is
+ * undefined behaviour.
+ *
+ * @note This overload is only available for coroutines with an input value.
+ */
template <typename CompletionToken, detail::convertible_to<input_type> T>
- auto async_resume(T&& ip, CompletionToken&& token)
+ auto async_resume(T&& ip, CompletionToken&& token) &
{
return async_initiate<CompletionToken,
typename traits::completion_handler>(
initiate_async_resume(this), token, std::forward<T>(ip));
}
+ /// Operator used for coroutines without input value.
auto operator co_await() requires (std::is_void_v<input_type>)
{
return awaitable_t{*this};
}
+ /// Operator used for coroutines with input value.
+ /**
+ * @param ip The input value
+ *
+ * @returns An awaitable handle.
+ *
+ * @code
+ * coro<void> push_values(coro<double(int)> c)
+ * {
+ * std::optional<double> res = co_await c(42);
+ * }
+ * @endcode
+ */
template <detail::convertible_to<input_type> T>
auto operator()(T&& ip)
{
@@ -327,6 +247,7 @@ struct coro
std::forward<T>(ip), *this};
}
+ /// Check whether the coroutine is open, i.e. can be resumed.
bool is_open() const
{
if (coro_)
@@ -339,717 +260,34 @@ struct coro
return false;
}
+ /// Check whether the coroutine is open, i.e. can be resumed.
explicit operator bool() const { return is_open(); }
- void cancel(cancellation_type ct = cancellation_type::all)
- {
- if (is_open() && !coro_->cancel.state.cancelled())
- asio::dispatch(get_executor(),
- [ct, coro = coro_] { coro->cancel.signal.emit(ct); });
- }
-
private:
- struct awaitable_t
- {
- coro& coro_;
-
- constexpr static bool await_ready() { return false; }
-
- template <typename Y, typename R, typename E>
- auto await_suspend(
- detail::coroutine_handle<detail::coro_promise<Y, R, E>> h)
- -> detail::coroutine_handle<>
- {
- auto& hp = h.promise();
- if (hp.get_executor() == coro_.get_executor())
- {
- coro_.coro_->awaited_from = h;
- coro_.coro_->reset_error();
-
- struct cancel_handler
- {
- cancel_handler(coro& coro_) : coro_(coro_.coro_) {}
-
- typename coro::promise_type* coro_;
+ struct awaitable_t;
- void operator()(cancellation_type ct)
- {
- coro_->cancel.signal.emit(ct);
- }
- };
-
- hp.cancel.state.slot().template emplace<cancel_handler>(coro_);
- return coro_.coro_->get_handle();
- }
- else
- {
- coro_.coro_->awaited_from = detail::dispatch_coroutine(
- hp.get_executor(), [h]() mutable { h.resume(); });
- coro_.coro_->reset_error();
-
- struct cancel_handler
- {
- cancel_handler(E e, coro& coro) : e(e), coro_(coro.coro_) {}
-
- E e;
- typename coro::promise_type* coro_;
-
- void operator()(cancellation_type ct)
- {
- asio::dispatch(e,
- [ct, p = coro_]() mutable
- {
- p->cancel.signal.emit(ct);
- });
- }
- };
-
- hp.cancel.state.slot().template emplace<cancel_handler>(
- coro_.get_executor(), coro_);
-
- return detail::dispatch_coroutine(
- hp.get_executor(), [h]() mutable { h.resume(); });
- }
- }
-
- auto await_resume() -> result_type
- {
- coro_.coro_->cancel.state.slot().clear();
- coro_.coro_->rethrow_if();
- if constexpr (!std::is_void_v<result_type>)
- return std::move(coro_.coro_->result_);
- }
- };
-
- class initiate_async_resume
- {
- public:
- typedef Executor executor_type;
-
- explicit initiate_async_resume(coro* self)
- : self_(self)
- {
- }
-
- executor_type get_executor() const noexcept
- {
- return self_->get_executor();
- }
-
- template <typename E, typename WaitHandler>
- auto handle(E exec, WaitHandler&& handler,
- std::true_type /* error is noexcept */,
- std::true_type /* result is void */) const //noexcept
- {
- return [self = self_,
- h = std::forward<WaitHandler>(handler),
- exec = std::move(exec)]() mutable
- {
- assert(self);
- auto ch =
- detail::coroutine_handle<promise_type>::from_promise(*self->coro_);
- assert(ch && !ch.done());
- assert(self->coro_->awaited_from == detail::noop_coroutine());
-
- self->coro_->awaited_from =
- post_coroutine(std::move(exec), std::move(h));
- self->coro_->reset_error();
- ch.resume();
- };
- }
-
- template <typename E, typename WaitHandler>
- requires (!std::is_void_v<result_type>)
- auto handle(E exec, WaitHandler&& handler,
- std::true_type /* error is noexcept */,
- std::false_type /* result is void */) const //noexcept
- {
- return [self = self_,
- h = std::forward<WaitHandler>(handler),
- exec = std::move(exec)]() mutable
- {
- assert(self);
-
- auto ch =
- detail::coroutine_handle<promise_type>::from_promise(*self->coro_);
- assert(ch && !ch.done());
- assert(self->coro_->awaited_from == detail::noop_coroutine());
-
- self->coro_->awaited_from =
- detail::post_coroutine(exec,
- [self, h = std::move(h)]() mutable
- {
- std::move(h)(std::move(self->coro_->result_));
- });
- self->coro_->reset_error();
- ch.resume();
- };
- }
-
- template <typename E, typename WaitHandler>
- auto handle(E exec, WaitHandler&& handler,
- std::false_type /* error is noexcept */,
- std::true_type /* result is void */) const
- {
- return [self = self_,
- h = std::forward<WaitHandler>(handler),
- exec = std::move(exec)]() mutable
- {
- if (!self)
- {
- asio::post(exec,
- [h = std::move(h)]() mutable
- {
- h(detail::coro_error<error_type>::invalid());
- });
- return;
- }
-
- auto ch =
- detail::coroutine_handle<promise_type>::from_promise(*self->coro_);
- if (!ch)
- {
- asio::post(exec,
- [h = std::move(h)]() mutable
- {
- h(detail::coro_error<error_type>::invalid());
- });
- }
- else if (ch.done())
- {
- asio::post(exec,
- [h = std::move(h)]() mutable
- {
- h(detail::coro_error<error_type>::done());
- });
- }
- else
- {
- assert(self->coro_->awaited_from == detail::noop_coroutine());
- self->coro_->awaited_from =
- detail::post_coroutine(exec,
- [self, h = std::move(h)]() mutable
- {
- std::move(h)(std::move(self->coro_->error_));
- });
- self->coro_->reset_error();
- ch.resume();
- }
- };
- }
-
- template <typename E, typename WaitHandler>
- auto handle(E exec, WaitHandler&& handler,
- std::false_type /* error is noexcept */,
- std::false_type /* result is void */) const
- {
- return [self = self_, h = std::forward<WaitHandler>(handler),
- exec = std::move(exec)]() mutable
- {
- if (!self)
- {
- asio::post(exec,
- [h = std::move(h)]() mutable
- {
- h(detail::coro_error<error_type>::invalid(), result_type{});
- });
- return;
- }
-
- auto ch =
- detail::coroutine_handle<promise_type>::from_promise(*self->coro_);
- if (!ch)
- {
- asio::post(exec,
- [h = std::move(h)]() mutable
- {
- h(detail::coro_error<error_type>::invalid(), result_type{});
- });
- }
- else if (ch.done())
- {
- asio::post(exec,
- [h = std::move(h)]() mutable
- {
- h(detail::coro_error<error_type>::done(), result_type{});
- });
- }
- else
- {
- assert(self->coro_->awaited_from == detail::noop_coroutine());
- self->coro_->awaited_from =
- detail::post_coroutine(exec,
- [h = std::move(h), self]() mutable
- {
- std::move(h)(std::move(self->coro_->error_),
- std::move(self->coro_->result_));
- });
- self->coro_->reset_error();
- ch.resume();
- }
- };
- }
-
- struct cancel_handler
- {
- promise_type* coro;
-
- cancel_handler(promise_type* coro) : coro(coro) {}
-
- void operator()(cancellation_type ct)
- {
- asio::dispatch(coro->get_executor(),
- [ct, k = coro] { k->cancel.signal.emit(ct); });
- }
- };
-
- template <typename WaitHandler>
- void operator()(WaitHandler&& handler) const
- {
- const auto exec =
- asio::prefer(
- get_associated_executor(handler, get_executor()),
- execution::outstanding_work.tracked);
-
- using cancel_t = decltype(self_->coro_->cancel);
- self_->coro_->cancel.~cancel_t();
- new(&self_->coro_->cancel) cancel_t();
-
- auto cancel = get_associated_cancellation_slot(handler);
- if (cancel.is_connected())
- cancel.template emplace<cancel_handler>(self_->coro_);
-
- asio::dispatch(get_executor(),
- handle(exec, std::forward<WaitHandler>(handler),
- std::integral_constant<bool, is_noexcept>{},
- std::is_void<result_type>{}));
- }
-
- template <typename WaitHandler, typename Input>
- void operator()(WaitHandler&& handler, Input&& input) const
- {
- const auto exec =
- asio::prefer(
- get_associated_executor(handler, get_executor()),
- execution::outstanding_work.tracked);
- auto cancel = get_associated_cancellation_slot(handler);
-
- using cancel_t = decltype(self_->coro_->cancel);
- self_->coro_->cancel.~cancel_t();
- new(&self_->coro_->cancel) cancel_t();
-
- if (cancel.is_connected())
- cancel.template emplace<cancel_handler>(self_->coro_);
-
- asio::dispatch(get_executor(),
- [h = handle(exec, std::forward<WaitHandler>(handler),
- std::integral_constant<bool, is_noexcept>{},
- std::is_void<result_type>{}),
- in = std::forward<Input>(input), self = self_]() mutable
- {
- self->coro_->input_ = std::move(in);
- std::move(h)();
- });
- }
-
- private:
- coro* self_;
- };
+ struct initiate_async_resume;
explicit coro(promise_type* const cr) : coro_(cr) {}
promise_type* coro_{nullptr};
};
-namespace detail {
+/// A generator is a coro that returns void and yields value.
+template<typename T, typename Executor = asio::any_io_executor,
+ typename Allocator = std::allocator<void>>
+using generator = coro<T, void, Executor, Allocator>;
-template <bool IsNoexcept>
-struct coro_promise_error;
+/// A task is a coro that does not yield values
+template<typename T, typename Executor = asio::any_io_executor,
+ typename Allocator = std::allocator<void>>
+using task = coro<void(), T, Executor, Allocator>;
-template <>
-struct coro_promise_error<false>
-{
- std::exception_ptr error_;
-
- void reset_error() { error_ = std::exception_ptr{}; }
-
- void unhandled_exception() { error_ = std::current_exception(); }
-
- void rethrow_if()
- {
- if (error_)
- std::rethrow_exception(error_);
- }
-};
-
-template <>
-struct coro_promise_error<true>
-{
- void reset_error() {}
-
- void unhandled_exception() noexcept { throw; }
-
- void rethrow_if() {}
-};
-
-template <typename T = void>
-struct yield_input
-{
- T& value;
- coroutine_handle<> awaited_from{noop_coroutine()};
-
- bool await_ready() const noexcept
- {
- return false;
- }
-
- auto await_suspend(coroutine_handle<>) noexcept
- {
- return std::exchange(awaited_from, noop_coroutine());
- }
-
- T await_resume() const noexcept { return std::move(value); }
-};
-
-template <>
-struct yield_input<void>
-{
- coroutine_handle<> awaited_from{noop_coroutine()};
-
- bool await_ready() const noexcept
- {
- return false;
- }
-
- auto await_suspend(coroutine_handle<>) noexcept
- {
- return std::exchange(awaited_from, noop_coroutine());
- }
-
- constexpr void await_resume() const noexcept {}
-};
-
-struct coro_awaited_from
-{
- coroutine_handle<> awaited_from{noop_coroutine()};
-
- auto final_suspend() noexcept
- {
- struct suspendor
- {
- coroutine_handle<> awaited_from;
-
- constexpr static bool await_ready() noexcept { return false; }
-
- auto await_suspend(coroutine_handle<>) noexcept
- {
- return std::exchange(awaited_from, noop_coroutine());
- }
-
- constexpr static void await_resume() noexcept {}
- };
-
- return suspendor{std::exchange(awaited_from, noop_coroutine())};
- }
-
- ~coro_awaited_from()
- {
- awaited_from.resume();
- }//must be on the right executor
-};
-
-template <typename Yield, typename Input, typename Return>
-struct coro_promise_exchange : coro_awaited_from
-{
- using result_type = coro_result_t<Yield, Return>;
-
- result_type result_;
- Input input_;
-
- auto yield_value(Yield&& y)
- {
- result_ = std::move(y);
- return yield_input<Input>{std::move(input_),
- std::exchange(awaited_from, noop_coroutine())};
- }
-
- auto yield_value(const Yield& y)
- {
- result_ = y;
- return yield_input<Input>{std::move(input_),
- std::exchange(awaited_from, noop_coroutine())};
- }
-
- void return_value(const Return& r) { result_ = r; }
-
- void return_value(Return&& r) { result_ = std::move(r); }
-};
-
-template <typename YieldReturn>
-struct coro_promise_exchange<YieldReturn, void, YieldReturn> : coro_awaited_from
-{
- using result_type = coro_result_t<YieldReturn, YieldReturn>;
-
- result_type result_;
-
- auto yield_value(const YieldReturn& y)
- {
- result_ = y;
- return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
- }
-
- auto yield_value(YieldReturn&& y)
- {
- result_ = std::move(y);
- return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
- }
-
- void return_value(const YieldReturn& r) { result_ = r; }
-
- void return_value(YieldReturn&& r) { result_ = std::move(r); }
-};
-
-template <typename Yield, typename Return>
-struct coro_promise_exchange<Yield, void, Return> : coro_awaited_from
-{
- using result_type = coro_result_t<Yield, Return>;
-
- result_type result_;
-
- auto yield_value(const Yield& y)
- {
- result_.template emplace<0>(y);
- return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
- }
-
- auto yield_value(Yield&& y)
- {
- result_.template emplace<0>(std::move(y));
- return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
- }
-
- void return_value(const Return& r)
- { result_.template emplace<1>(r); }
-
- void return_value(Return&& r)
- { result_.template emplace<1>(std::move(r)); }
-};
-
-template <typename Yield, typename Input>
-struct coro_promise_exchange<Yield, Input, void> : coro_awaited_from
-{
- using result_type = coro_result_t<Yield, void>;
-
- result_type result_;
- Input input_;
-
- auto yield_value(Yield&& y)
- {
- result_ = std::move(y);
- return yield_input<Input>{input_,
- std::exchange(awaited_from, noop_coroutine())};
- }
-
- auto yield_value(const Yield& y)
- {
- result_ = y;
- return yield_input<Input>{input_,
- std::exchange(awaited_from, noop_coroutine())};
- }
-
- void return_void() { result_.reset(); }
-};
-
-template <typename Return>
-struct coro_promise_exchange<void, void, Return> : coro_awaited_from
-{
- using result_type = coro_result_t<void, Return>;
-
- result_type result_;
-
- void yield_value();
-
- void return_value(const Return& r) { result_ = r; }
-
- void return_value(Return&& r) { result_ = std::move(r); }
-};
-
-
-template <>
-struct coro_promise_exchange<void, void, void> : coro_awaited_from
-{
- void return_void() {}
-
- void yield_value();
-};
-
-template <typename Yield>
-struct coro_promise_exchange<Yield, void, void> : coro_awaited_from
-{
- using result_type = coro_result_t<Yield, void>;
-
- result_type result_;
-
- auto yield_value(const Yield& y)
- {
- result_ = y;
- return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
- }
-
- auto yield_value(Yield&& y)
- {
- result_ = std::move(y);
- return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
- }
-
- void return_void() { result_.reset(); }
-};
-
-template <typename Yield, typename Return, typename Executor>
-struct coro_promise final :
- coro_promise_allocator<coro<Yield, Return, Executor>>,
- coro_promise_error<coro_traits<Yield, Return, Executor>::is_noexcept>,
- coro_promise_exchange<
- typename coro_traits<Yield, Return, Executor>::yield_type,
- typename coro_traits<Yield, Return, Executor>::input_type,
- typename coro_traits<Yield, Return, Executor>::return_type>
-{
- using coro_type = coro<Yield, Return, Executor>;
-
- auto handle()
- { return coroutine_handle<coro_promise>::from_promise(this); }
-
- using executor_type = Executor;
-
- executor_type executor_;
- struct cancel_pair
- {
- cancellation_signal signal;
- asio::cancellation_state state{signal.slot()};
-
- };
- cancel_pair cancel;
-
- using allocator_type =
- typename std::allocator_traits<associated_allocator_t < Executor>>::
- template rebind_alloc<std::byte>;
- using traits = coro_traits<Yield, Return, Executor>;
-
- using input_type = typename traits::input_type;
- using yield_type = typename traits::yield_type;
- using return_type = typename traits::return_type;
- using error_type = typename traits::error_type;
- using result_type = typename traits::result_type;
- constexpr static bool is_noexcept = traits::is_noexcept;
-
- auto get_executor() const -> Executor { return executor_; }
-
- auto get_handle()
- {
- return coroutine_handle<coro_promise>::from_promise(*this);
- }
-
- template <typename... Args>
- coro_promise(Executor executor, Args &&...) noexcept
- : executor_(std::move(executor))
- {
- }
-
- template <execution_context Context, typename... Args>
- coro_promise(Context&& ctx, Args&&...) noexcept
- : executor_(ctx.get_executor())
- {
- }
-
- auto get_return_object()
- {
- return coro<Yield, Return, Executor>{this};
- }
-
- auto initial_suspend() noexcept
- {
- return suspend_always{};
- }
-
- using coro_promise_exchange<
- typename coro_traits<Yield, Return, Executor>::yield_type,
- typename coro_traits<Yield, Return, Executor>::input_type,
- typename coro_traits<Yield, Return, Executor>::return_type>::yield_value;
-
- auto await_transform(this_coro::executor_t) const
- {
- struct exec_helper
- {
- const executor_type& value;
-
- constexpr static bool await_ready() noexcept { return true; }
-
- constexpr static void await_suspend(coroutine_handle<>) noexcept {}
-
- executor_type await_resume() const noexcept { return value; }
- };
-
- return exec_helper{executor_};
- }
-
- auto await_transform(this_coro::cancellation_state_t) const
- {
- struct exec_helper
- {
- const asio::cancellation_state& value;
-
- constexpr static bool await_ready() noexcept { return true; }
-
- constexpr static void await_suspend(coroutine_handle<>) noexcept {}
-
- const asio::cancellation_state& await_resume() const noexcept
- {
- return value;
- }
- };
-
- return exec_helper{cancel.state};
- }
-
- template <typename Yield_, typename Return_, typename Executor_>
- auto await_transform(coro<Yield_, Return_, Executor_>& kr) -> decltype(auto)
- {
- return kr;
- }
-
- template <typename Yield_, typename Return_, typename Executor_>
- auto await_transform(coro<Yield_, Return_, Executor_>&& kr)
- {
- return std::move(kr);
- }
-
- template <typename T_, typename Coroutine>
- auto await_transform(coro_with_arg<T_, Coroutine>&& kr) -> decltype(auto)
- {
- return std::move(kr);
- }
-
- template <typename T_>
- requires requires(T_ t) {{ t.async_wait(use_coro) }; }
- auto await_transform(T_ &t) -> decltype(auto)
- {
- return await_transform(t.async_wait(use_coro));
- }
-
- template <typename... Ts>
- auto await_transform(coro_init_handler<Executor, Ts...>&& kr) const
- {
- if constexpr (is_noexcept)
- return std::move(kr).as_noexcept(cancel.state.slot());
- else
- return std::move(kr).as_throwing(cancel.state.slot());
- }
-};
-
-} // namespace detail
} // namespace experimental
} // namespace asio
#include "asio/detail/pop_options.hpp"
+#include "asio/experimental/impl/coro.hpp"
+
#endif // ASIO_EXPERIMENTAL_CORO_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/coro_traits.hpp b/3rdparty/asio/include/asio/experimental/coro_traits.hpp
index a2b31cb952e..7da904b1273 100644
--- a/3rdparty/asio/include/asio/experimental/detail/coro_traits.hpp
+++ b/3rdparty/asio/include/asio/experimental/coro_traits.hpp
@@ -2,8 +2,8 @@
// experimental/detail/coro_traits.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -12,6 +12,10 @@
#ifndef ASIO_EXPERIMENTAL_DETAIL_CORO_TRAITS_HPP
#define ASIO_EXPERIMENTAL_DETAIL_CORO_TRAITS_HPP
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
#include "asio/detail/config.hpp"
#include <optional>
#include <variant>
@@ -22,16 +26,15 @@ namespace experimental {
namespace detail {
template <class From, class To>
-concept convertible_to = std::is_convertible_v<From, To> &&
- requires(std::add_rvalue_reference_t<From> (&f)()) {static_cast<To>(f()); };
+concept convertible_to = std::is_convertible_v<From, To>;
template <typename T>
concept decays_to_executor = execution::executor<std::decay_t<T>>;
-template <typename T>
+template <typename T, typename Executor = any_io_executor>
concept execution_context = requires (T& t)
{
- {t.get_executor()} -> decays_to_executor;
+ {t.get_executor()} -> convertible_to<Executor>;
};
template <typename Yield, typename Return>
@@ -97,17 +100,59 @@ struct coro_handler<T, true>
template <typename Result, bool IsNoexcept>
using coro_handler_t = typename coro_handler<Result, IsNoexcept>::type;
+} // namespace detail
+
+#if defined(GENERATING_DOCUMENTATION)
+
+/// The traits describing the resumable coroutine behaviour.
+/**
+ * Template parameter @c Yield specifies type or signature used by co_yield,
+ * @c Return specifies the type used for co_return, and @c Executor specifies
+ * the underlying executor type.
+ */
+template <typename Yield, typename Return, typename Executor>
+struct coro_traits
+{
+ /// The value that can be passed into a symmetrical cororoutine. @c void if
+ /// asymmetrical.
+ using input_type = argument_dependent;
+
+ /// The type that can be passed out through a co_yield.
+ using yield_type = argument_dependent;
+
+ /// The type that can be passed out through a co_return.
+ using return_type = argument_dependent;
+
+ /// The type received by a co_await or async_resume. It's a combination of
+ /// yield and return.
+ using result_type = argument_dependent;
+
+ /// The signature used by the async_resume.
+ using signature_type = argument_dependent;
+
+ /// Whether or not the coroutine is noexcept.
+ constexpr static bool is_noexcept = argument_dependent;
+
+ /// The error type of the coroutine. @c void for noexcept.
+ using error_type = argument_dependent;
+
+ /// Completion handler type used by async_resume.
+ using completion_handler = argument_dependent;
+};
+
+#else // defined(GENERATING_DOCUMENTATION)
+
template <typename Yield, typename Return, typename Executor>
struct coro_traits
{
using input_type = void;
using yield_type = Yield;
using return_type = Return;
- using result_type = coro_result_t<yield_type, return_type>;
+ using result_type = detail::coro_result_t<yield_type, return_type>;
using signature_type = result_type();
constexpr static bool is_noexcept = false;
using error_type = std::conditional_t<is_noexcept, void, std::exception_ptr>;
- using completion_handler = coro_handler_t<result_type, is_noexcept>;
+ using completion_handler = detail::coro_handler_t<result_type, is_noexcept>;
};
template <typename T, typename Return, typename Executor>
@@ -116,11 +161,11 @@ struct coro_traits<T(), Return, Executor>
using input_type = void;
using yield_type = T;
using return_type = Return;
- using result_type = coro_result_t<yield_type, return_type>;
+ using result_type = detail::coro_result_t<yield_type, return_type>;
using signature_type = result_type();
constexpr static bool is_noexcept = false;
using error_type = std::conditional_t<is_noexcept, void, std::exception_ptr>;
- using completion_handler = coro_handler_t<result_type, is_noexcept>;
+ using completion_handler = detail::coro_handler_t<result_type, is_noexcept>;
};
template <typename T, typename Return, typename Executor>
@@ -129,11 +174,11 @@ struct coro_traits<T() noexcept, Return, Executor>
using input_type = void;
using yield_type = T;
using return_type = Return;
- using result_type = coro_result_t<yield_type, return_type>;
+ using result_type = detail::coro_result_t<yield_type, return_type>;
using signature_type = result_type();
constexpr static bool is_noexcept = true;
using error_type = std::conditional_t<is_noexcept, void, std::exception_ptr>;
- using completion_handler = coro_handler_t<result_type, is_noexcept>;
+ using completion_handler = detail::coro_handler_t<result_type, is_noexcept>;
};
template <typename T, typename U, typename Return, typename Executor>
@@ -142,11 +187,11 @@ struct coro_traits<T(U), Return, Executor>
using input_type = U;
using yield_type = T;
using return_type = Return;
- using result_type = coro_result_t<yield_type, return_type>;
+ using result_type = detail::coro_result_t<yield_type, return_type>;
using signature_type = result_type(input_type);
constexpr static bool is_noexcept = false;
using error_type = std::conditional_t<is_noexcept, void, std::exception_ptr>;
- using completion_handler = coro_handler_t<result_type, is_noexcept>;
+ using completion_handler = detail::coro_handler_t<result_type, is_noexcept>;
};
template <typename T, typename U, typename Return, typename Executor>
@@ -155,28 +200,28 @@ struct coro_traits<T(U) noexcept, Return, Executor>
using input_type = U;
using yield_type = T;
using return_type = Return;
- using result_type = coro_result_t<yield_type, return_type>;
+ using result_type = detail::coro_result_t<yield_type, return_type>;
using signature_type = result_type(input_type);
constexpr static bool is_noexcept = true;
using error_type = std::conditional_t<is_noexcept, void, std::exception_ptr>;
- using completion_handler = coro_handler_t<result_type, is_noexcept>;
+ using completion_handler = detail::coro_handler_t<result_type, is_noexcept>;
};
-
template <typename Executor>
struct coro_traits<void() noexcept, void, Executor>
{
using input_type = void;
using yield_type = void;
using return_type = void;
- using result_type = coro_result_t<yield_type, return_type>;
+ using result_type = detail::coro_result_t<yield_type, return_type>;
using signature_type = result_type(input_type);
constexpr static bool is_noexcept = true;
using error_type = std::conditional_t<is_noexcept, void, std::exception_ptr>;
- using completion_handler = coro_handler_t<result_type, is_noexcept>;
+ using completion_handler = detail::coro_handler_t<result_type, is_noexcept>;
};
-} // namespace detail
+#endif // defined(GENERATING_DOCUMENTATION)
+
} // namespace experimental
} // namespace asio
diff --git a/3rdparty/asio/include/asio/experimental/deferred.hpp b/3rdparty/asio/include/asio/experimental/deferred.hpp
index f09be1582a3..c722ad1a2de 100644
--- a/3rdparty/asio/include/asio/experimental/deferred.hpp
+++ b/3rdparty/asio/include/asio/experimental/deferred.hpp
@@ -2,7 +2,7 @@
// experimental/deferred.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,590 +16,21 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-#include <tuple>
-#include "asio/associator.hpp"
-#include "asio/async_result.hpp"
-#include "asio/detail/type_traits.hpp"
+#include "asio/deferred.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
namespace experimental {
-/// Trait for detecting objects that are usable as deferred operations.
-template <typename T>
-struct is_deferred : false_type
-{
-};
-
-namespace detail {
-
-// Helper trait for getting the completion signature from an async operation.
-
-struct deferred_signature_probe {};
-
-template <typename T>
-struct deferred_signature_probe_result
-{
- typedef T type;
-};
-
-template <typename T>
-struct deferred_signature
-{
- typedef typename decltype(
- declval<T>()(declval<deferred_signature_probe>()))::type type;
-};
-
-// Helper trait for getting the completion signature of the tail in a sequence
-// when invoked with the specified arguments.
-
-template <typename HeadSignature, typename Tail>
-struct deferred_sequence_signature;
-
-template <typename R, typename... Args, typename Tail>
-struct deferred_sequence_signature<R(Args...), Tail>
-{
- static_assert(
- !is_same<decltype(declval<Tail>()(declval<Args>()...)), void>::value,
- "deferred functions must produce a deferred return type");
-
- typedef typename decltype(
- declval<Tail>()(declval<Args>()...)(
- declval<deferred_signature_probe>()))::type type;
-};
-
-// Completion handler for the head component of a deferred sequence.
-template <typename Handler, typename Tail>
-class deferred_sequence_handler
-{
-public:
- template <typename H, typename T>
- explicit deferred_sequence_handler(
- ASIO_MOVE_ARG(H) handler, ASIO_MOVE_ARG(T) tail)
- : handler_(ASIO_MOVE_CAST(H)(handler)),
- tail_(ASIO_MOVE_CAST(T)(tail))
- {
- }
-
- template <typename... Args>
- void operator()(ASIO_MOVE_ARG(Args)... args)
- {
- ASIO_MOVE_OR_LVALUE(Tail)(tail_)(
- ASIO_MOVE_CAST(Args)(args)...)(
- ASIO_MOVE_OR_LVALUE(Handler)(handler_));
- }
-
-//private:
- Handler handler_;
- Tail tail_;
-};
-
-} // namespace detail
-
-/// Used to represent an empty deferred action.
-struct deferred_noop
-{
- /// No effect.
- template <typename... Args>
- void operator()(ASIO_MOVE_ARG(Args)...) ASIO_RVALUE_REF_QUAL
- {
- }
-
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
- /// No effect.
- template <typename... Args>
- decltype(auto) operator()(ASIO_MOVE_ARG(Args)...) const &
- {
- }
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-};
-
-#if !defined(GENERATING_DOCUMENTATION)
-template <>
-struct is_deferred<deferred_noop> : true_type
-{
-};
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-/// Tag type to disambiguate deferred constructors.
-struct deferred_init_tag {};
-
-/// Wraps a function object so that it may be used as an element in a deferred
-/// composition.
-template <typename Function>
-class deferred_function
-{
-public:
- /// Constructor.
- template <typename F>
- ASIO_CONSTEXPR explicit deferred_function(
- deferred_init_tag, ASIO_MOVE_ARG(F) function)
- : function_(ASIO_MOVE_CAST(F)(function))
- {
- }
-
- template <typename... Args>
- decltype(auto) operator()(
- ASIO_MOVE_ARG(Args)... args) ASIO_RVALUE_REF_QUAL
- {
- return ASIO_MOVE_CAST(Function)(function_)(
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
- template <typename... Args>
- decltype(auto) operator()(
- ASIO_MOVE_ARG(Args)... args) const &
- {
- return deferred_function(*this)(
- ASIO_MOVE_CAST(Args)(args)...);
- }
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-//private:
- Function function_;
-};
-
-#if !defined(GENERATING_DOCUMENTATION)
-template <typename Function>
-struct is_deferred<deferred_function<Function> > : true_type
-{
-};
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-/// Encapsulates deferred values.
-template <typename... Values>
-class ASIO_NODISCARD deferred_values
-{
-private:
- std::tuple<Values...> values_;
-
- struct initiate
- {
- template <typename Handler, typename... V>
- void operator()(Handler handler, ASIO_MOVE_ARG(V)... values)
- {
- ASIO_MOVE_OR_LVALUE(Handler)(handler)(
- ASIO_MOVE_CAST(V)(values)...);
- }
- };
-
- template <typename CompletionToken, std::size_t... I>
- decltype(auto) invoke_helper(
- ASIO_MOVE_ARG(CompletionToken) token,
- std::index_sequence<I...>)
- {
- return asio::async_initiate<CompletionToken, void(Values...)>(
- initiate(), token,
- std::get<I>(ASIO_MOVE_CAST(std::tuple<Values...>)(values_))...);
- }
-
-public:
- /// Construct a deferred asynchronous operation from the arguments to an
- /// initiation function object.
- template <typename... V>
- ASIO_CONSTEXPR explicit deferred_values(
- deferred_init_tag, ASIO_MOVE_ARG(V)... values)
- : values_(ASIO_MOVE_CAST(V)(values)...)
- {
- }
-
- /// Initiate the deferred operation using the supplied completion token.
- template <ASIO_COMPLETION_TOKEN_FOR(void(Values...)) CompletionToken>
- decltype(auto) operator()(
- ASIO_MOVE_ARG(CompletionToken) token) ASIO_RVALUE_REF_QUAL
- {
- return this->invoke_helper(
- ASIO_MOVE_CAST(CompletionToken)(token),
- std::index_sequence_for<Values...>());
- }
-
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
- template <ASIO_COMPLETION_TOKEN_FOR(void(Values...)) CompletionToken>
- decltype(auto) operator()(
- ASIO_MOVE_ARG(CompletionToken) token) const &
- {
- return deferred_values(*this)(
- ASIO_MOVE_CAST(CompletionToken)(token));
- }
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-};
-
-#if !defined(GENERATING_DOCUMENTATION)
-template <typename... Values>
-struct is_deferred<deferred_values<Values...> > : true_type
-{
-};
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-/// Encapsulates a deferred asynchronous operation.
-template <typename Signature, typename Initiation, typename... InitArgs>
-class ASIO_NODISCARD deferred_async_operation
-{
-private:
- typename decay<Initiation>::type initiation_;
- typedef std::tuple<typename decay<InitArgs>::type...> init_args_t;
- init_args_t init_args_;
-
- template <typename CompletionToken, std::size_t... I>
- decltype(auto) invoke_helper(
- ASIO_MOVE_ARG(CompletionToken) token,
- std::index_sequence<I...>)
- {
- return asio::async_initiate<CompletionToken, Signature>(
- ASIO_MOVE_CAST(typename decay<Initiation>::type)(initiation_),
- token, std::get<I>(ASIO_MOVE_CAST(init_args_t)(init_args_))...);
- }
-
-public:
- /// Construct a deferred asynchronous operation from the arguments to an
- /// initiation function object.
- template <typename I, typename... A>
- ASIO_CONSTEXPR explicit deferred_async_operation(
- deferred_init_tag, ASIO_MOVE_ARG(I) initiation,
- ASIO_MOVE_ARG(A)... init_args)
- : initiation_(ASIO_MOVE_CAST(I)(initiation)),
- init_args_(ASIO_MOVE_CAST(A)(init_args)...)
- {
- }
-
- /// Initiate the asynchronous operation using the supplied completion token.
- template <ASIO_COMPLETION_TOKEN_FOR(Signature) CompletionToken>
- decltype(auto) operator()(
- ASIO_MOVE_ARG(CompletionToken) token) ASIO_RVALUE_REF_QUAL
- {
- return this->invoke_helper(
- ASIO_MOVE_CAST(CompletionToken)(token),
- std::index_sequence_for<InitArgs...>());
- }
-
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
- template <ASIO_COMPLETION_TOKEN_FOR(Signature) CompletionToken>
- decltype(auto) operator()(
- ASIO_MOVE_ARG(CompletionToken) token) const &
- {
- return deferred_async_operation(*this)(
- ASIO_MOVE_CAST(CompletionToken)(token));
- }
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-};
-
-#if !defined(GENERATING_DOCUMENTATION)
-template <typename Signature, typename Initiation, typename... InitArgs>
-struct is_deferred<
- deferred_async_operation<Signature, Initiation, InitArgs...> > : true_type
-{
-};
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-/// Defines a link between two consecutive operations in a sequence.
-template <typename Head, typename Tail>
-class ASIO_NODISCARD deferred_sequence
-{
-private:
- typedef typename detail::deferred_sequence_signature<
- typename detail::deferred_signature<Head>::type, Tail>::type
- signature;
-
-public:
- template <typename H, typename T>
- ASIO_CONSTEXPR explicit deferred_sequence(deferred_init_tag,
- ASIO_MOVE_ARG(H) head, ASIO_MOVE_ARG(T) tail)
- : head_(ASIO_MOVE_CAST(H)(head)),
- tail_(ASIO_MOVE_CAST(T)(tail))
- {
- }
-
- template <ASIO_COMPLETION_TOKEN_FOR(signature) CompletionToken>
- decltype(auto) operator()(
- ASIO_MOVE_ARG(CompletionToken) token) ASIO_RVALUE_REF_QUAL
- {
- return asio::async_initiate<CompletionToken, signature>(
- initiate(), token, ASIO_MOVE_OR_LVALUE(Head)(head_),
- ASIO_MOVE_OR_LVALUE(Tail)(tail_));
- }
-
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
- template <ASIO_COMPLETION_TOKEN_FOR(signature) CompletionToken>
- decltype(auto) operator()(
- ASIO_MOVE_ARG(CompletionToken) token) const &
- {
- return deferred_sequence(*this)(
- ASIO_MOVE_CAST(CompletionToken)(token));
- }
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-private:
- struct initiate
- {
- template <typename Handler>
- void operator()(ASIO_MOVE_ARG(Handler) handler,
- Head head, ASIO_MOVE_ARG(Tail) tail)
- {
- ASIO_MOVE_OR_LVALUE(Head)(head)(
- detail::deferred_sequence_handler<
- typename decay<Handler>::type,
- typename decay<Tail>::type>(
- ASIO_MOVE_CAST(Handler)(handler),
- ASIO_MOVE_CAST(Tail)(tail)));
- }
- };
-
- Head head_;
- Tail tail_;
-};
-
-#if !defined(GENERATING_DOCUMENTATION)
-template <typename Head, typename Tail>
-struct is_deferred<deferred_sequence<Head, Tail> > : true_type
-{
-};
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-/// Used to represent a deferred conditional branch.
-template <typename OnTrue = deferred_noop,
- typename OnFalse = deferred_noop>
-class ASIO_NODISCARD deferred_conditional
-{
-public:
- /// Construct a deferred conditional with the value to determine which branch
- /// will be executed.
- ASIO_CONSTEXPR explicit deferred_conditional(bool b)
- : on_true_(),
- on_false_(),
- bool_(b)
- {
- }
-
- /// Invoke the conditional branch bsaed on the stored alue.
- template <typename... Args>
- auto operator()(ASIO_MOVE_ARG(Args)... args) ASIO_RVALUE_REF_QUAL
- {
- if (bool_)
- {
- return ASIO_MOVE_OR_LVALUE(OnTrue)(on_true_)(
- ASIO_MOVE_CAST(Args)(args)...);
- }
- else
- {
- return ASIO_MOVE_OR_LVALUE(OnFalse)(on_false_)(
- ASIO_MOVE_CAST(Args)(args)...);
- }
- }
-
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
- template <typename... Args>
- auto operator()(ASIO_MOVE_ARG(Args)... args) const &
- {
- return deferred_conditional(*this)(
- ASIO_MOVE_CAST(Args)(args)...);
- }
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
- /// Set the true branch of the conditional.
- template <typename T>
- deferred_conditional<T, OnFalse> then(T on_true,
- typename constraint<
- is_deferred<T>::value
- >::type* = 0,
- typename constraint<
- is_same<
- typename conditional<true, OnTrue, T>::type,
- deferred_noop
- >::value
- >::type* = 0) ASIO_RVALUE_REF_QUAL
- {
- return deferred_conditional<T, OnFalse>(
- bool_, ASIO_MOVE_CAST(T)(on_true),
- ASIO_MOVE_CAST(OnFalse)(on_false_));
- }
-
- /// Set the false branch of the conditional.
- template <typename T>
- deferred_conditional<OnTrue, T> otherwise(T on_false,
- typename constraint<
- is_deferred<T>::value
- >::type* = 0,
- typename constraint<
- !is_same<
- typename conditional<true, OnTrue, T>::type,
- deferred_noop
- >::value
- >::type* = 0,
- typename constraint<
- is_same<
- typename conditional<true, OnFalse, T>::type,
- deferred_noop
- >::value
- >::type* = 0) ASIO_RVALUE_REF_QUAL
- {
- return deferred_conditional<OnTrue, T>(
- bool_, ASIO_MOVE_CAST(OnTrue)(on_true_),
- ASIO_MOVE_CAST(T)(on_false));
- }
-
-private:
- template <typename T, typename F> friend class deferred_conditional;
-
- // Helper constructor.
- template <typename T, typename F>
- explicit deferred_conditional(bool b, ASIO_MOVE_ARG(T) on_true,
- ASIO_MOVE_ARG(F) on_false)
- : on_true_(ASIO_MOVE_CAST(T)(on_true)),
- on_false_(ASIO_MOVE_CAST(F)(on_false)),
- bool_(b)
- {
- }
-
- OnTrue on_true_;
- OnFalse on_false_;
- bool bool_;
-};
-
-#if !defined(GENERATING_DOCUMENTATION)
-template <typename OnTrue, typename OnFalse>
-struct is_deferred<deferred_conditional<OnTrue, OnFalse> > : true_type
-{
-};
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-/// Class used to specify that an asynchronous operation should return a
-/// function object to lazily launch the operation.
-/**
- * The deferred_t class is used to indicate that an asynchronous operation
- * should return a function object which is itself an initiation function. A
- * deferred_t object may be passed as a completion token to an asynchronous
- * operation, typically using the special value @c asio::deferred. For
- * example:
- *
- * @code auto my_sender
- * = my_socket.async_read_some(my_buffer,
- * asio::experimental::deferred); @endcode
- *
- * The initiating function (async_read_some in the above example) returns a
- * function object that will lazily initiate the operation.
- */
-class deferred_t
-{
-public:
- /// Default constructor.
- ASIO_CONSTEXPR deferred_t()
- {
- }
-
- /// Adapts an executor to add the @c deferred_t completion token as the
- /// default.
- template <typename InnerExecutor>
- struct executor_with_default : InnerExecutor
- {
- /// Specify @c deferred_t as the default completion token type.
- typedef deferred_t default_completion_token_type;
-
- /// Construct the adapted executor from the inner executor type.
- template <typename InnerExecutor1>
- executor_with_default(const InnerExecutor1& ex,
- typename constraint<
- conditional<
- !is_same<InnerExecutor1, executor_with_default>::value,
- is_convertible<InnerExecutor1, InnerExecutor>,
- false_type
- >::type::value
- >::type = 0) ASIO_NOEXCEPT
- : InnerExecutor(ex)
- {
- }
- };
-
- /// Type alias to adapt an I/O object to use @c deferred_t as its
- /// default completion token type.
-#if defined(ASIO_HAS_ALIAS_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
- template <typename T>
- using as_default_on_t = typename T::template rebind_executor<
- executor_with_default<typename T::executor_type> >::other;
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
- /// Function helper to adapt an I/O object to use @c deferred_t as its
- /// default completion token type.
- template <typename T>
- static typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
- >::other
- as_default_on(ASIO_MOVE_ARG(T) object)
- {
- return typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
- >::other(ASIO_MOVE_CAST(T)(object));
- }
-
- /// Creates a new deferred from a function.
- template <typename Function>
- typename constraint<
- !is_deferred<typename decay<Function>::type>::value,
- deferred_function<typename decay<Function>::type>
- >::type operator()(ASIO_MOVE_ARG(Function) function) const
- {
- return deferred_function<typename decay<Function>::type>(
- deferred_init_tag{}, ASIO_MOVE_CAST(Function)(function));
- }
-
- /// Passes through anything that is already deferred.
- template <typename T>
- typename constraint<
- is_deferred<typename decay<T>::type>::value,
- typename decay<T>::type
- >::type operator()(ASIO_MOVE_ARG(T) t) const
- {
- return ASIO_MOVE_CAST(T)(t);
- }
-
- /// Returns a deferred operation that returns the provided values.
- template <typename... Args>
- static ASIO_CONSTEXPR deferred_values<typename decay<Args>::type...>
- values(ASIO_MOVE_ARG(Args)... args)
- {
- return deferred_values<typename decay<Args>::type...>(
- deferred_init_tag{}, ASIO_MOVE_CAST(Args)(args)...);
- }
-
- /// Creates a conditional object for branching deferred operations.
- static ASIO_CONSTEXPR deferred_conditional<> when(bool b)
- {
- return deferred_conditional<>(b);
- }
-};
-
-/// Pipe operator used to chain deferred operations.
-template <typename Head, typename Tail>
-inline auto operator|(Head head, ASIO_MOVE_ARG(Tail) tail)
- -> typename constraint<
- is_deferred<Head>::value,
- decltype(ASIO_MOVE_OR_LVALUE(Head)(head)(
- ASIO_MOVE_CAST(Tail)(tail)))
- >::type
-{
- return ASIO_MOVE_OR_LVALUE(Head)(head)(
- ASIO_MOVE_CAST(Tail)(tail));
-}
-
-/// A special value, similar to std::nothrow.
-/**
- * See the documentation for asio::experimental::deferred_t for a usage
- * example.
- */
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
-constexpr deferred_t deferred;
-#elif defined(ASIO_MSVC)
-__declspec(selectany) deferred_t deferred;
-#endif
+#if !defined(ASIO_NO_DEPRECATED)
+using asio::deferred_t;
+using asio::deferred;
+#endif // !defined(ASIO_NO_DEPRECATED)
} // namespace experimental
} // namespace asio
#include "asio/detail/pop_options.hpp"
-#include "asio/experimental/impl/deferred.hpp"
-
#endif // ASIO_EXPERIMENTAL_DEFERRED_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/channel_handler.hpp b/3rdparty/asio/include/asio/experimental/detail/channel_handler.hpp
new file mode 100644
index 00000000000..0152c2e76ff
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/channel_handler.hpp
@@ -0,0 +1,77 @@
+//
+// experimental/detail/channel_handler.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_CHANNEL_HANDLER_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_CHANNEL_HANDLER_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associator.hpp"
+#include "asio/experimental/detail/channel_payload.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename Payload, typename Handler>
+class channel_handler
+{
+public:
+ channel_handler(Payload&& p, Handler& h)
+ : payload_(static_cast<Payload&&>(p)),
+ handler_(static_cast<Handler&&>(h))
+ {
+ }
+
+ void operator()()
+ {
+ payload_.receive(handler_);
+ }
+
+//private:
+ Payload payload_;
+ Handler handler_;
+};
+
+} // namespace detail
+} // namespace experimental
+
+template <template <typename, typename> class Associator,
+ typename Payload, typename Handler, typename DefaultCandidate>
+struct associator<Associator,
+ experimental::detail::channel_handler<Payload, Handler>,
+ DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const experimental::detail::channel_handler<Payload, Handler>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const experimental::detail::channel_handler<Payload, Handler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ }
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_CHANNEL_HANDLER_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/channel_message.hpp b/3rdparty/asio/include/asio/experimental/detail/channel_message.hpp
new file mode 100644
index 00000000000..16446f0c1bb
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/channel_message.hpp
@@ -0,0 +1,129 @@
+//
+// experimental/detail/channel_message.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_CHANNEL_MESSAGE_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_CHANNEL_MESSAGE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <tuple>
+#include "asio/detail/type_traits.hpp"
+#include "asio/detail/utility.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename Signature>
+class channel_message;
+
+template <typename R>
+class channel_message<R()>
+{
+public:
+ channel_message(int)
+ {
+ }
+
+ template <typename Handler>
+ void receive(Handler& handler)
+ {
+ static_cast<Handler&&>(handler)();
+ }
+};
+
+template <typename R, typename Arg0>
+class channel_message<R(Arg0)>
+{
+public:
+ template <typename T0>
+ channel_message(int, T0&& t0)
+ : arg0_(static_cast<T0&&>(t0))
+ {
+ }
+
+ template <typename Handler>
+ void receive(Handler& handler)
+ {
+ static_cast<Handler&&>(handler)(
+ static_cast<arg0_type&&>(arg0_));
+ }
+
+private:
+ typedef decay_t<Arg0> arg0_type;
+ arg0_type arg0_;
+};
+
+template <typename R, typename Arg0, typename Arg1>
+class channel_message<R(Arg0, Arg1)>
+{
+public:
+ template <typename T0, typename T1>
+ channel_message(int, T0&& t0, T1&& t1)
+ : arg0_(static_cast<T0&&>(t0)),
+ arg1_(static_cast<T1&&>(t1))
+ {
+ }
+
+ template <typename Handler>
+ void receive(Handler& handler)
+ {
+ static_cast<Handler&&>(handler)(
+ static_cast<arg0_type&&>(arg0_),
+ static_cast<arg1_type&&>(arg1_));
+ }
+
+private:
+ typedef decay_t<Arg0> arg0_type;
+ arg0_type arg0_;
+ typedef decay_t<Arg1> arg1_type;
+ arg1_type arg1_;
+};
+
+template <typename R, typename... Args>
+class channel_message<R(Args...)>
+{
+public:
+ template <typename... T>
+ channel_message(int, T&&... t)
+ : args_(static_cast<T&&>(t)...)
+ {
+ }
+
+ template <typename Handler>
+ void receive(Handler& h)
+ {
+ this->do_receive(h, asio::detail::index_sequence_for<Args...>());
+ }
+
+private:
+ template <typename Handler, std::size_t... I>
+ void do_receive(Handler& h, asio::detail::index_sequence<I...>)
+ {
+ static_cast<Handler&&>(h)(
+ std::get<I>(static_cast<args_type&&>(args_))...);
+ }
+
+ typedef std::tuple<decay_t<Args>...> args_type;
+ args_type args_;
+};
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_CHANNEL_MESSAGE_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/channel_operation.hpp b/3rdparty/asio/include/asio/experimental/detail/channel_operation.hpp
new file mode 100644
index 00000000000..1231f1f87c1
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/channel_operation.hpp
@@ -0,0 +1,361 @@
+//
+// experimental/detail/channel_operation.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_CHANNEL_OPERATION_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_CHANNEL_OPERATION_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associated_allocator.hpp"
+#include "asio/associated_executor.hpp"
+#include "asio/associated_immediate_executor.hpp"
+#include "asio/detail/initiate_post.hpp"
+#include "asio/detail/initiate_dispatch.hpp"
+#include "asio/detail/op_queue.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/execution/executor.hpp"
+#include "asio/execution/outstanding_work.hpp"
+#include "asio/executor_work_guard.hpp"
+#include "asio/prefer.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+// Base class for all channel operations. A function pointer is used instead of
+// virtual functions to avoid the associated overhead.
+class channel_operation ASIO_INHERIT_TRACKED_HANDLER
+{
+public:
+ template <typename Executor, typename = void, typename = void>
+ class handler_work_base;
+
+ template <typename Handler, typename IoExecutor, typename = void>
+ class handler_work;
+
+ void destroy()
+ {
+ func_(this, destroy_op, 0);
+ }
+
+protected:
+ enum action
+ {
+ destroy_op = 0,
+ immediate_op = 1,
+ post_op = 2,
+ dispatch_op = 3,
+ cancel_op = 4,
+ close_op = 5
+ };
+
+ typedef void (*func_type)(channel_operation*, action, void*);
+
+ channel_operation(func_type func)
+ : next_(0),
+ func_(func),
+ cancellation_key_(0)
+ {
+ }
+
+ // Prevents deletion through this type.
+ ~channel_operation()
+ {
+ }
+
+ friend class asio::detail::op_queue_access;
+ channel_operation* next_;
+ func_type func_;
+
+public:
+ // The operation key used for targeted cancellation.
+ void* cancellation_key_;
+};
+
+template <typename Executor, typename, typename>
+class channel_operation::handler_work_base
+{
+public:
+ typedef decay_t<
+ prefer_result_t<Executor,
+ execution::outstanding_work_t::tracked_t
+ >
+ > executor_type;
+
+ handler_work_base(int, const Executor& ex)
+ : executor_(asio::prefer(ex, execution::outstanding_work.tracked))
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return executor_;
+ }
+
+ template <typename IoExecutor, typename Function, typename Handler>
+ void post(const IoExecutor& io_exec, Function& function, Handler&)
+ {
+ (asio::detail::initiate_post_with_executor<IoExecutor>(io_exec))(
+ static_cast<Function&&>(function));
+ }
+
+ template <typename Function, typename Handler>
+ void dispatch(Function& function, Handler& handler)
+ {
+ associated_allocator_t<Handler> allocator =
+ (get_associated_allocator)(handler);
+
+ asio::prefer(executor_,
+ execution::allocator(allocator)
+ ).execute(static_cast<Function&&>(function));
+ }
+
+private:
+ executor_type executor_;
+};
+
+template <typename Executor>
+class channel_operation::handler_work_base<Executor,
+ enable_if_t<
+ execution::is_executor<Executor>::value
+ >,
+ enable_if_t<
+ can_require<Executor, execution::blocking_t::never_t>::value
+ >
+ >
+{
+public:
+ typedef decay_t<
+ prefer_result_t<Executor,
+ execution::outstanding_work_t::tracked_t
+ >
+ > executor_type;
+
+ handler_work_base(int, const Executor& ex)
+ : executor_(asio::prefer(ex, execution::outstanding_work.tracked))
+ {
+ }
+
+ const executor_type& get_executor() const noexcept
+ {
+ return executor_;
+ }
+
+ template <typename IoExecutor, typename Function, typename Handler>
+ void post(const IoExecutor&, Function& function, Handler& handler)
+ {
+ associated_allocator_t<Handler> allocator =
+ (get_associated_allocator)(handler);
+
+ asio::prefer(
+ asio::require(executor_, execution::blocking.never),
+ execution::allocator(allocator)
+ ).execute(static_cast<Function&&>(function));
+ }
+
+ template <typename Function, typename Handler>
+ void dispatch(Function& function, Handler& handler)
+ {
+ associated_allocator_t<Handler> allocator =
+ (get_associated_allocator)(handler);
+
+ asio::prefer(executor_,
+ execution::allocator(allocator)
+ ).execute(static_cast<Function&&>(function));
+ }
+
+private:
+ executor_type executor_;
+};
+
+#if !defined(ASIO_NO_TS_EXECUTORS)
+
+template <typename Executor>
+class channel_operation::handler_work_base<Executor,
+ enable_if_t<
+ !execution::is_executor<Executor>::value
+ >
+ >
+{
+public:
+ typedef Executor executor_type;
+
+ handler_work_base(int, const Executor& ex)
+ : work_(ex)
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return work_.get_executor();
+ }
+
+ template <typename IoExecutor, typename Function, typename Handler>
+ void post(const IoExecutor&, Function& function, Handler& handler)
+ {
+ associated_allocator_t<Handler> allocator =
+ (get_associated_allocator)(handler);
+
+ work_.get_executor().post(
+ static_cast<Function&&>(function), allocator);
+ }
+
+ template <typename Function, typename Handler>
+ void dispatch(Function& function, Handler& handler)
+ {
+ associated_allocator_t<Handler> allocator =
+ (get_associated_allocator)(handler);
+
+ work_.get_executor().dispatch(
+ static_cast<Function&&>(function), allocator);
+ }
+
+private:
+ executor_work_guard<Executor> work_;
+};
+
+#endif // !defined(ASIO_NO_TS_EXECUTORS)
+
+template <typename Handler, typename IoExecutor, typename>
+class channel_operation::handler_work :
+ channel_operation::handler_work_base<IoExecutor>,
+ channel_operation::handler_work_base<
+ associated_executor_t<Handler, IoExecutor>, IoExecutor>
+{
+public:
+ typedef channel_operation::handler_work_base<IoExecutor> base1_type;
+
+ typedef channel_operation::handler_work_base<
+ associated_executor_t<Handler, IoExecutor>, IoExecutor>
+ base2_type;
+
+ handler_work(Handler& handler, const IoExecutor& io_ex) noexcept
+ : base1_type(0, io_ex),
+ base2_type(0, (get_associated_executor)(handler, io_ex))
+ {
+ }
+
+ template <typename Function>
+ void post(Function& function, Handler& handler)
+ {
+ base2_type::post(base1_type::get_executor(), function, handler);
+ }
+
+ template <typename Function>
+ void dispatch(Function& function, Handler& handler)
+ {
+ base2_type::dispatch(function, handler);
+ }
+
+ template <typename Function>
+ void immediate(Function& function, Handler& handler, ...)
+ {
+ typedef associated_immediate_executor_t<Handler,
+ typename base1_type::executor_type> immediate_ex_type;
+
+ immediate_ex_type immediate_ex = (get_associated_immediate_executor)(
+ handler, base1_type::get_executor());
+
+ (asio::detail::initiate_dispatch_with_executor<immediate_ex_type>(
+ immediate_ex))(static_cast<Function&&>(function));
+ }
+
+ template <typename Function>
+ void immediate(Function& function, Handler&,
+ enable_if_t<
+ is_same<
+ typename associated_immediate_executor<
+ conditional_t<false, Function, Handler>,
+ typename base1_type::executor_type>::
+ asio_associated_immediate_executor_is_unspecialised,
+ void
+ >::value
+ >*)
+ {
+ (asio::detail::initiate_post_with_executor<
+ typename base1_type::executor_type>(
+ base1_type::get_executor()))(
+ static_cast<Function&&>(function));
+ }
+};
+
+template <typename Handler, typename IoExecutor>
+class channel_operation::handler_work<
+ Handler, IoExecutor,
+ enable_if_t<
+ is_same<
+ typename associated_executor<Handler,
+ IoExecutor>::asio_associated_executor_is_unspecialised,
+ void
+ >::value
+ >
+ > : handler_work_base<IoExecutor>
+{
+public:
+ typedef channel_operation::handler_work_base<IoExecutor> base1_type;
+
+ handler_work(Handler&, const IoExecutor& io_ex) noexcept
+ : base1_type(0, io_ex)
+ {
+ }
+
+ template <typename Function>
+ void post(Function& function, Handler& handler)
+ {
+ base1_type::post(base1_type::get_executor(), function, handler);
+ }
+
+ template <typename Function>
+ void dispatch(Function& function, Handler& handler)
+ {
+ base1_type::dispatch(function, handler);
+ }
+
+ template <typename Function>
+ void immediate(Function& function, Handler& handler, ...)
+ {
+ typedef associated_immediate_executor_t<Handler,
+ typename base1_type::executor_type> immediate_ex_type;
+
+ immediate_ex_type immediate_ex = (get_associated_immediate_executor)(
+ handler, base1_type::get_executor());
+
+ (asio::detail::initiate_dispatch_with_executor<immediate_ex_type>(
+ immediate_ex))(static_cast<Function&&>(function));
+ }
+
+ template <typename Function>
+ void immediate(Function& function, Handler& handler,
+ enable_if_t<
+ is_same<
+ typename associated_immediate_executor<
+ conditional_t<false, Function, Handler>,
+ typename base1_type::executor_type>::
+ asio_associated_immediate_executor_is_unspecialised,
+ void
+ >::value
+ >*)
+ {
+ base1_type::post(base1_type::get_executor(), function, handler);
+ }
+};
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_CHANNEL_OPERATION_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/channel_payload.hpp b/3rdparty/asio/include/asio/experimental/detail/channel_payload.hpp
new file mode 100644
index 00000000000..31614cd5dbc
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/channel_payload.hpp
@@ -0,0 +1,222 @@
+//
+// experimental/detail/channel_payload.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_CHANNEL_PAYLOAD_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_CHANNEL_PAYLOAD_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/error_code.hpp"
+#include "asio/experimental/detail/channel_message.hpp"
+
+#if defined(ASIO_HAS_STD_VARIANT)
+# include <variant>
+#else // defined(ASIO_HAS_STD_VARIANT)
+# include <new>
+#endif // defined(ASIO_HAS_STD_VARIANT)
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename... Signatures>
+class channel_payload;
+
+template <typename R>
+class channel_payload<R()>
+{
+public:
+ explicit channel_payload(channel_message<R()>)
+ {
+ }
+
+ template <typename Handler>
+ void receive(Handler& handler)
+ {
+ static_cast<Handler&&>(handler)();
+ }
+};
+
+template <typename Signature>
+class channel_payload<Signature>
+{
+public:
+ channel_payload(channel_message<Signature>&& m)
+ : message_(static_cast<channel_message<Signature>&&>(m))
+ {
+ }
+
+ template <typename Handler>
+ void receive(Handler& handler)
+ {
+ message_.receive(handler);
+ }
+
+private:
+ channel_message<Signature> message_;
+};
+
+#if defined(ASIO_HAS_STD_VARIANT)
+
+template <typename... Signatures>
+class channel_payload
+{
+public:
+ template <typename Signature>
+ channel_payload(channel_message<Signature>&& m)
+ : message_(static_cast<channel_message<Signature>&&>(m))
+ {
+ }
+
+ template <typename Handler>
+ void receive(Handler& handler)
+ {
+ std::visit(
+ [&](auto& message)
+ {
+ message.receive(handler);
+ }, message_);
+ }
+
+private:
+ std::variant<channel_message<Signatures>...> message_;
+};
+
+#else // defined(ASIO_HAS_STD_VARIANT)
+
+template <typename R1, typename R2>
+class channel_payload<R1(), R2(asio::error_code)>
+{
+public:
+ typedef channel_message<R1()> void_message_type;
+ typedef channel_message<R2(asio::error_code)> error_message_type;
+
+ channel_payload(void_message_type&&)
+ : message_(0, asio::error_code()),
+ empty_(true)
+ {
+ }
+
+ channel_payload(error_message_type&& m)
+ : message_(static_cast<error_message_type&&>(m)),
+ empty_(false)
+ {
+ }
+
+ template <typename Handler>
+ void receive(Handler& handler)
+ {
+ if (empty_)
+ channel_message<R1()>(0).receive(handler);
+ else
+ message_.receive(handler);
+ }
+
+private:
+ error_message_type message_;
+ bool empty_;
+};
+
+template <typename Sig1, typename Sig2>
+class channel_payload<Sig1, Sig2>
+{
+public:
+ typedef channel_message<Sig1> message_1_type;
+ typedef channel_message<Sig2> message_2_type;
+
+ channel_payload(message_1_type&& m)
+ : index_(1)
+ {
+ new (&storage_.message_1_) message_1_type(static_cast<message_1_type&&>(m));
+ }
+
+ channel_payload(message_2_type&& m)
+ : index_(2)
+ {
+ new (&storage_.message_2_) message_2_type(static_cast<message_2_type&&>(m));
+ }
+
+ channel_payload(channel_payload&& other)
+ : index_(other.index_)
+ {
+ switch (index_)
+ {
+ case 1:
+ new (&storage_.message_1_) message_1_type(
+ static_cast<message_1_type&&>(other.storage_.message_1_));
+ break;
+ case 2:
+ new (&storage_.message_2_) message_2_type(
+ static_cast<message_2_type&&>(other.storage_.message_2_));
+ break;
+ default:
+ break;
+ }
+ }
+
+ ~channel_payload()
+ {
+ switch (index_)
+ {
+ case 1:
+ storage_.message_1_.~message_1_type();
+ break;
+ case 2:
+ storage_.message_2_.~message_2_type();
+ break;
+ default:
+ break;
+ }
+ }
+
+ template <typename Handler>
+ void receive(Handler& handler)
+ {
+ switch (index_)
+ {
+ case 1:
+ storage_.message_1_.receive(handler);
+ break;
+ case 2:
+ storage_.message_2_.receive(handler);
+ break;
+ default:
+ break;
+ }
+ }
+
+private:
+ union storage
+ {
+ storage() {}
+ ~storage() {}
+
+ char dummy_;
+ message_1_type message_1_;
+ message_2_type message_2_;
+ } storage_;
+ unsigned char index_;
+};
+
+#endif // defined(ASIO_HAS_STD_VARIANT)
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_CHANNEL_PAYLOAD_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/channel_receive_op.hpp b/3rdparty/asio/include/asio/experimental/detail/channel_receive_op.hpp
new file mode 100644
index 00000000000..89d8ac2a5ab
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/channel_receive_op.hpp
@@ -0,0 +1,127 @@
+//
+// experimental/detail/channel_receive_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_CHANNEL_RECEIVE_OP_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_CHANNEL_RECEIVE_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/handler_alloc_helpers.hpp"
+#include "asio/error.hpp"
+#include "asio/experimental/detail/channel_handler.hpp"
+#include "asio/experimental/detail/channel_operation.hpp"
+#include "asio/experimental/detail/channel_payload.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename Payload>
+class channel_receive : public channel_operation
+{
+public:
+ void immediate(Payload payload)
+ {
+ func_(this, immediate_op, &payload);
+ }
+
+ void post(Payload payload)
+ {
+ func_(this, post_op, &payload);
+ }
+
+ void dispatch(Payload payload)
+ {
+ func_(this, dispatch_op, &payload);
+ }
+
+protected:
+ channel_receive(func_type func)
+ : channel_operation(func)
+ {
+ }
+};
+
+template <typename Payload, typename Handler, typename IoExecutor>
+class channel_receive_op : public channel_receive<Payload>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(channel_receive_op);
+
+ template <typename... Args>
+ channel_receive_op(Handler& handler, const IoExecutor& io_ex)
+ : channel_receive<Payload>(&channel_receive_op::do_action),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_action(channel_operation* base,
+ channel_operation::action a, void* v)
+ {
+ // Take ownership of the operation object.
+ channel_receive_op* o(static_cast<channel_receive_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ channel_operation::handler_work<Handler, IoExecutor> w(
+ static_cast<channel_operation::handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the handler is posted. Even if we're not about to post the handler, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ if (a != channel_operation::destroy_op)
+ {
+ Payload* payload = static_cast<Payload*>(v);
+ channel_handler<Payload, Handler> handler(
+ static_cast<Payload&&>(*payload), o->handler_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+ ASIO_HANDLER_INVOCATION_BEGIN(());
+ if (a == channel_operation::immediate_op)
+ w.immediate(handler, handler.handler_, 0);
+ else if (a == channel_operation::dispatch_op)
+ w.dispatch(handler, handler.handler_);
+ else
+ w.post(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ else
+ {
+ asio::detail::binder0<Handler> handler(o->handler_);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+ }
+ }
+
+private:
+ Handler handler_;
+ channel_operation::handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_CHANNEL_RECEIVE_OP_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/channel_send_functions.hpp b/3rdparty/asio/include/asio/experimental/detail/channel_send_functions.hpp
new file mode 100644
index 00000000000..108dffec934
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/channel_send_functions.hpp
@@ -0,0 +1,192 @@
+//
+// experimental/detail/channel_send_functions.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_CHANNEL_SEND_FUNCTIONS_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_CHANNEL_SEND_FUNCTIONS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/async_result.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/error_code.hpp"
+#include "asio/experimental/detail/channel_message.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename Derived, typename Executor, typename... Signatures>
+class channel_send_functions;
+
+template <typename Derived, typename Executor, typename R, typename... Args>
+class channel_send_functions<Derived, Executor, R(Args...)>
+{
+public:
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ bool
+ > try_send(Args2&&... args)
+ {
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return self->service_->template try_send<message_type>(
+ self->impl_, false, static_cast<Args2&&>(args)...);
+ }
+
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ bool
+ > try_send_via_dispatch(Args2&&... args)
+ {
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return self->service_->template try_send<message_type>(
+ self->impl_, true, static_cast<Args2&&>(args)...);
+ }
+
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ std::size_t
+ > try_send_n(std::size_t count, Args2&&... args)
+ {
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return self->service_->template try_send_n<message_type>(
+ self->impl_, count, false, static_cast<Args2&&>(args)...);
+ }
+
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ std::size_t
+ > try_send_n_via_dispatch(std::size_t count, Args2&&... args)
+ {
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return self->service_->template try_send_n<message_type>(
+ self->impl_, count, true, static_cast<Args2&&>(args)...);
+ }
+
+ template <
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
+ CompletionToken ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
+ auto async_send(Args... args,
+ CompletionToken&& token
+ ASIO_DEFAULT_COMPLETION_TOKEN(Executor))
+ -> decltype(
+ async_initiate<CompletionToken, void (asio::error_code)>(
+ declval<typename conditional_t<false, CompletionToken,
+ Derived>::initiate_async_send>(), token,
+ declval<typename conditional_t<false, CompletionToken,
+ Derived>::payload_type>()))
+ {
+ typedef typename Derived::payload_type payload_type;
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return async_initiate<CompletionToken, void (asio::error_code)>(
+ typename Derived::initiate_async_send(self), token,
+ payload_type(message_type(0, static_cast<Args&&>(args)...)));
+ }
+};
+
+template <typename Derived, typename Executor,
+ typename R, typename... Args, typename... Signatures>
+class channel_send_functions<Derived, Executor, R(Args...), Signatures...> :
+ public channel_send_functions<Derived, Executor, Signatures...>
+{
+public:
+ using channel_send_functions<Derived, Executor, Signatures...>::try_send;
+ using channel_send_functions<Derived, Executor, Signatures...>::async_send;
+
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ bool
+ > try_send(Args2&&... args)
+ {
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return self->service_->template try_send<message_type>(
+ self->impl_, false, static_cast<Args2&&>(args)...);
+ }
+
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ bool
+ > try_send_via_dispatch(Args2&&... args)
+ {
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return self->service_->template try_send<message_type>(
+ self->impl_, true, static_cast<Args2&&>(args)...);
+ }
+
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ std::size_t
+ > try_send_n(std::size_t count, Args2&&... args)
+ {
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return self->service_->template try_send_n<message_type>(
+ self->impl_, count, false, static_cast<Args2&&>(args)...);
+ }
+
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ std::size_t
+ > try_send_n_via_dispatch(std::size_t count, Args2&&... args)
+ {
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return self->service_->template try_send_n<message_type>(
+ self->impl_, count, true, static_cast<Args2&&>(args)...);
+ }
+
+ template <
+ ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
+ CompletionToken ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
+ auto async_send(Args... args,
+ CompletionToken&& token
+ ASIO_DEFAULT_COMPLETION_TOKEN(Executor))
+ -> decltype(
+ async_initiate<CompletionToken, void (asio::error_code)>(
+ declval<typename conditional_t<false, CompletionToken,
+ Derived>::initiate_async_send>(), token,
+ declval<typename conditional_t<false, CompletionToken,
+ Derived>::payload_type>()))
+ {
+ typedef typename Derived::payload_type payload_type;
+ typedef typename detail::channel_message<R(Args...)> message_type;
+ Derived* self = static_cast<Derived*>(this);
+ return async_initiate<CompletionToken, void (asio::error_code)>(
+ typename Derived::initiate_async_send(self), token,
+ payload_type(message_type(0, static_cast<Args&&>(args)...)));
+ }
+};
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_CHANNEL_SEND_FUNCTIONS_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/channel_send_op.hpp b/3rdparty/asio/include/asio/experimental/detail/channel_send_op.hpp
new file mode 100644
index 00000000000..4326c23253e
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/channel_send_op.hpp
@@ -0,0 +1,148 @@
+//
+// experimental/detail/channel_send_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_CHANNEL_SEND_OP_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_CHANNEL_SEND_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/bind_handler.hpp"
+#include "asio/detail/handler_alloc_helpers.hpp"
+#include "asio/error.hpp"
+#include "asio/experimental/channel_error.hpp"
+#include "asio/experimental/detail/channel_operation.hpp"
+#include "asio/experimental/detail/channel_payload.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename Payload>
+class channel_send : public channel_operation
+{
+public:
+ Payload get_payload()
+ {
+ return static_cast<Payload&&>(payload_);
+ }
+
+ void immediate()
+ {
+ func_(this, immediate_op, 0);
+ }
+
+ void post()
+ {
+ func_(this, post_op, 0);
+ }
+
+ void cancel()
+ {
+ func_(this, cancel_op, 0);
+ }
+
+ void close()
+ {
+ func_(this, close_op, 0);
+ }
+
+protected:
+ channel_send(func_type func, Payload&& payload)
+ : channel_operation(func),
+ payload_(static_cast<Payload&&>(payload))
+ {
+ }
+
+private:
+ Payload payload_;
+};
+
+template <typename Payload, typename Handler, typename IoExecutor>
+class channel_send_op : public channel_send<Payload>
+{
+public:
+ ASIO_DEFINE_HANDLER_PTR(channel_send_op);
+
+ channel_send_op(Payload&& payload,
+ Handler& handler, const IoExecutor& io_ex)
+ : channel_send<Payload>(&channel_send_op::do_action,
+ static_cast<Payload&&>(payload)),
+ handler_(static_cast<Handler&&>(handler)),
+ work_(handler_, io_ex)
+ {
+ }
+
+ static void do_action(channel_operation* base,
+ channel_operation::action a, void*)
+ {
+ // Take ownership of the operation object.
+ channel_send_op* o(static_cast<channel_send_op*>(base));
+ ptr p = { asio::detail::addressof(o->handler_), o, o };
+
+ ASIO_HANDLER_COMPLETION((*o));
+
+ // Take ownership of the operation's outstanding work.
+ channel_operation::handler_work<Handler, IoExecutor> w(
+ static_cast<channel_operation::handler_work<Handler, IoExecutor>&&>(
+ o->work_));
+
+ asio::error_code ec;
+ switch (a)
+ {
+ case channel_operation::cancel_op:
+ ec = error::channel_cancelled;
+ break;
+ case channel_operation::close_op:
+ ec = error::channel_closed;
+ break;
+ default:
+ break;
+ }
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the handler is posted. Even if we're not about to post the handler, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // deallocated the memory here.
+ asio::detail::binder1<Handler, asio::error_code>
+ handler(o->handler_, ec);
+ p.h = asio::detail::addressof(handler.handler_);
+ p.reset();
+
+ // Post the completion if required.
+ if (a != channel_operation::destroy_op)
+ {
+ ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_));
+ if (a == channel_operation::immediate_op)
+ w.immediate(handler, handler.handler_, 0);
+ else
+ w.post(handler, handler.handler_);
+ ASIO_HANDLER_INVOCATION_END;
+ }
+ }
+
+private:
+ Handler handler_;
+ channel_operation::handler_work<Handler, IoExecutor> work_;
+};
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_CHANNEL_SEND_OP_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/channel_service.hpp b/3rdparty/asio/include/asio/experimental/detail/channel_service.hpp
new file mode 100644
index 00000000000..12324414613
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/channel_service.hpp
@@ -0,0 +1,677 @@
+//
+// experimental/detail/channel_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_CHANNEL_SERVICE_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_CHANNEL_SERVICE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associated_cancellation_slot.hpp"
+#include "asio/cancellation_type.hpp"
+#include "asio/detail/mutex.hpp"
+#include "asio/detail/op_queue.hpp"
+#include "asio/execution_context.hpp"
+#include "asio/experimental/detail/channel_message.hpp"
+#include "asio/experimental/detail/channel_receive_op.hpp"
+#include "asio/experimental/detail/channel_send_op.hpp"
+#include "asio/experimental/detail/has_signature.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename Mutex>
+class channel_service
+ : public asio::detail::execution_context_service_base<
+ channel_service<Mutex>>
+{
+public:
+ // Possible states for a channel end.
+ enum state
+ {
+ buffer = 0,
+ waiter = 1,
+ block = 2,
+ closed = 3
+ };
+
+ // The base implementation type of all channels.
+ struct base_implementation_type
+ {
+ // Default constructor.
+ base_implementation_type()
+ : receive_state_(block),
+ send_state_(block),
+ max_buffer_size_(0),
+ next_(0),
+ prev_(0)
+ {
+ }
+
+ // The current state of the channel.
+ state receive_state_ : 16;
+ state send_state_ : 16;
+
+ // The maximum number of elements that may be buffered in the channel.
+ std::size_t max_buffer_size_;
+
+ // The operations that are waiting on the channel.
+ asio::detail::op_queue<channel_operation> waiters_;
+
+ // Pointers to adjacent channel implementations in linked list.
+ base_implementation_type* next_;
+ base_implementation_type* prev_;
+
+ // The mutex type to protect the internal implementation.
+ mutable Mutex mutex_;
+ };
+
+ // The implementation for a specific value type.
+ template <typename Traits, typename... Signatures>
+ struct implementation_type;
+
+ // Constructor.
+ channel_service(asio::execution_context& ctx);
+
+ // Destroy all user-defined handler objects owned by the service.
+ void shutdown();
+
+ // Construct a new channel implementation.
+ void construct(base_implementation_type& impl, std::size_t max_buffer_size);
+
+ // Destroy a channel implementation.
+ template <typename Traits, typename... Signatures>
+ void destroy(implementation_type<Traits, Signatures...>& impl);
+
+ // Move-construct a new channel implementation.
+ template <typename Traits, typename... Signatures>
+ void move_construct(implementation_type<Traits, Signatures...>& impl,
+ implementation_type<Traits, Signatures...>& other_impl);
+
+ // Move-assign from another channel implementation.
+ template <typename Traits, typename... Signatures>
+ void move_assign(implementation_type<Traits, Signatures...>& impl,
+ channel_service& other_service,
+ implementation_type<Traits, Signatures...>& other_impl);
+
+ // Get the capacity of the channel.
+ std::size_t capacity(
+ const base_implementation_type& impl) const noexcept;
+
+ // Determine whether the channel is open.
+ bool is_open(const base_implementation_type& impl) const noexcept;
+
+ // Reset the channel to its initial state.
+ template <typename Traits, typename... Signatures>
+ void reset(implementation_type<Traits, Signatures...>& impl);
+
+ // Close the channel.
+ template <typename Traits, typename... Signatures>
+ void close(implementation_type<Traits, Signatures...>& impl);
+
+ // Cancel all operations associated with the channel.
+ template <typename Traits, typename... Signatures>
+ void cancel(implementation_type<Traits, Signatures...>& impl);
+
+ // Cancel the operation associated with the channel that has the given key.
+ template <typename Traits, typename... Signatures>
+ void cancel_by_key(implementation_type<Traits, Signatures...>& impl,
+ void* cancellation_key);
+
+ // Determine whether a value can be read from the channel without blocking.
+ bool ready(const base_implementation_type& impl) const noexcept;
+
+ // Synchronously send a new value into the channel.
+ template <typename Message, typename Traits,
+ typename... Signatures, typename... Args>
+ bool try_send(implementation_type<Traits, Signatures...>& impl,
+ bool via_dispatch, Args&&... args);
+
+ // Synchronously send a number of new values into the channel.
+ template <typename Message, typename Traits,
+ typename... Signatures, typename... Args>
+ std::size_t try_send_n(implementation_type<Traits, Signatures...>& impl,
+ std::size_t count, bool via_dispatch, Args&&... args);
+
+ // Asynchronously send a new value into the channel.
+ template <typename Traits, typename... Signatures,
+ typename Handler, typename IoExecutor>
+ void async_send(implementation_type<Traits, Signatures...>& impl,
+ typename implementation_type<Traits,
+ Signatures...>::payload_type&& payload,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef channel_send_op<
+ typename implementation_type<Traits, Signatures...>::payload_type,
+ Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(static_cast<typename implementation_type<
+ Traits, Signatures...>::payload_type&&>(payload), handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<op_cancellation<Traits, Signatures...>>(
+ this, &impl);
+ }
+
+ ASIO_HANDLER_CREATION((this->context(), *p.p,
+ "channel", &impl, 0, "async_send"));
+
+ start_send_op(impl, p.p);
+ p.v = p.p = 0;
+ }
+
+ // Synchronously receive a value from the channel.
+ template <typename Traits, typename... Signatures, typename Handler>
+ bool try_receive(implementation_type<Traits, Signatures...>& impl,
+ Handler&& handler);
+
+ // Asynchronously receive a value from the channel.
+ template <typename Traits, typename... Signatures,
+ typename Handler, typename IoExecutor>
+ void async_receive(implementation_type<Traits, Signatures...>& impl,
+ Handler& handler, const IoExecutor& io_ex)
+ {
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // Allocate and construct an operation to wrap the handler.
+ typedef channel_receive_op<
+ typename implementation_type<Traits, Signatures...>::payload_type,
+ Handler, IoExecutor> op;
+ typename op::ptr p = { asio::detail::addressof(handler),
+ op::ptr::allocate(handler), 0 };
+ p.p = new (p.v) op(handler, io_ex);
+
+ // Optionally register for per-operation cancellation.
+ if (slot.is_connected())
+ {
+ p.p->cancellation_key_ =
+ &slot.template emplace<op_cancellation<Traits, Signatures...>>(
+ this, &impl);
+ }
+
+ ASIO_HANDLER_CREATION((this->context(), *p.p,
+ "channel", &impl, 0, "async_receive"));
+
+ start_receive_op(impl, p.p);
+ p.v = p.p = 0;
+ }
+
+private:
+ // Helper function object to handle a closed notification.
+ template <typename Payload, typename Signature>
+ struct post_receive
+ {
+ explicit post_receive(channel_receive<Payload>* op)
+ : op_(op)
+ {
+ }
+
+ template <typename... Args>
+ void operator()(Args&&... args)
+ {
+ op_->post(
+ channel_message<Signature>(0,
+ static_cast<Args&&>(args)...));
+ }
+
+ channel_receive<Payload>* op_;
+ };
+
+ // Destroy a base channel implementation.
+ void base_destroy(base_implementation_type& impl);
+
+ // Helper function to start an asynchronous put operation.
+ template <typename Traits, typename... Signatures>
+ void start_send_op(implementation_type<Traits, Signatures...>& impl,
+ channel_send<typename implementation_type<
+ Traits, Signatures...>::payload_type>* send_op);
+
+ // Helper function to start an asynchronous get operation.
+ template <typename Traits, typename... Signatures>
+ void start_receive_op(implementation_type<Traits, Signatures...>& impl,
+ channel_receive<typename implementation_type<
+ Traits, Signatures...>::payload_type>* receive_op);
+
+ // Helper class used to implement per-operation cancellation.
+ template <typename Traits, typename... Signatures>
+ class op_cancellation
+ {
+ public:
+ op_cancellation(channel_service* s,
+ implementation_type<Traits, Signatures...>* impl)
+ : service_(s),
+ impl_(impl)
+ {
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ if (!!(type &
+ (cancellation_type::terminal
+ | cancellation_type::partial
+ | cancellation_type::total)))
+ {
+ service_->cancel_by_key(*impl_, this);
+ }
+ }
+
+ private:
+ channel_service* service_;
+ implementation_type<Traits, Signatures...>* impl_;
+ };
+
+ // Mutex to protect access to the linked list of implementations.
+ asio::detail::mutex mutex_;
+
+ // The head of a linked list of all implementations.
+ base_implementation_type* impl_list_;
+};
+
+// The implementation for a specific value type.
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+struct channel_service<Mutex>::implementation_type : base_implementation_type
+{
+ // The traits type associated with the channel.
+ typedef typename Traits::template rebind<Signatures...>::other traits_type;
+
+ // Type of an element stored in the buffer.
+ typedef conditional_t<
+ has_signature<
+ typename traits_type::receive_cancelled_signature,
+ Signatures...
+ >::value,
+ conditional_t<
+ has_signature<
+ typename traits_type::receive_closed_signature,
+ Signatures...
+ >::value,
+ channel_payload<Signatures...>,
+ channel_payload<
+ Signatures...,
+ typename traits_type::receive_closed_signature
+ >
+ >,
+ conditional_t<
+ has_signature<
+ typename traits_type::receive_closed_signature,
+ Signatures...,
+ typename traits_type::receive_cancelled_signature
+ >::value,
+ channel_payload<
+ Signatures...,
+ typename traits_type::receive_cancelled_signature
+ >,
+ channel_payload<
+ Signatures...,
+ typename traits_type::receive_cancelled_signature,
+ typename traits_type::receive_closed_signature
+ >
+ >
+ > payload_type;
+
+ // Move from another buffer.
+ void buffer_move_from(implementation_type& other)
+ {
+ buffer_ = static_cast<
+ typename traits_type::template container<payload_type>::type&&>(
+ other.buffer_);
+ other.buffer_clear();
+ }
+
+ // Get number of buffered elements.
+ std::size_t buffer_size() const
+ {
+ return buffer_.size();
+ }
+
+ // Push a new value to the back of the buffer.
+ void buffer_push(payload_type payload)
+ {
+ buffer_.push_back(static_cast<payload_type&&>(payload));
+ }
+
+ // Push new values to the back of the buffer.
+ std::size_t buffer_push_n(std::size_t count, payload_type payload)
+ {
+ std::size_t i = 0;
+ for (; i < count && buffer_.size() < this->max_buffer_size_; ++i)
+ buffer_.push_back(payload);
+ return i;
+ }
+
+ // Get the element at the front of the buffer.
+ payload_type buffer_front()
+ {
+ return static_cast<payload_type&&>(buffer_.front());
+ }
+
+ // Pop a value from the front of the buffer.
+ void buffer_pop()
+ {
+ buffer_.pop_front();
+ }
+
+ // Clear all buffered values.
+ void buffer_clear()
+ {
+ buffer_.clear();
+ }
+
+private:
+ // Buffered values.
+ typename traits_type::template container<payload_type>::type buffer_;
+};
+
+// The implementation for a void value type.
+template <typename Mutex>
+template <typename Traits, typename R>
+struct channel_service<Mutex>::implementation_type<Traits, R()>
+ : channel_service::base_implementation_type
+{
+ // The traits type associated with the channel.
+ typedef typename Traits::template rebind<R()>::other traits_type;
+
+ // Type of an element stored in the buffer.
+ typedef conditional_t<
+ has_signature<
+ typename traits_type::receive_cancelled_signature,
+ R()
+ >::value,
+ conditional_t<
+ has_signature<
+ typename traits_type::receive_closed_signature,
+ R()
+ >::value,
+ channel_payload<R()>,
+ channel_payload<
+ R(),
+ typename traits_type::receive_closed_signature
+ >
+ >,
+ conditional_t<
+ has_signature<
+ typename traits_type::receive_closed_signature,
+ R(),
+ typename traits_type::receive_cancelled_signature
+ >::value,
+ channel_payload<
+ R(),
+ typename traits_type::receive_cancelled_signature
+ >,
+ channel_payload<
+ R(),
+ typename traits_type::receive_cancelled_signature,
+ typename traits_type::receive_closed_signature
+ >
+ >
+ > payload_type;
+
+ // Construct with empty buffer.
+ implementation_type()
+ : buffer_(0)
+ {
+ }
+
+ // Move from another buffer.
+ void buffer_move_from(implementation_type& other)
+ {
+ buffer_ = other.buffer_;
+ other.buffer_ = 0;
+ }
+
+ // Get number of buffered elements.
+ std::size_t buffer_size() const
+ {
+ return buffer_;
+ }
+
+ // Push a new value to the back of the buffer.
+ void buffer_push(payload_type)
+ {
+ ++buffer_;
+ }
+
+ // Push new values to the back of the buffer.
+ std::size_t buffer_push_n(std::size_t count, payload_type)
+ {
+ std::size_t available = this->max_buffer_size_ - buffer_;
+ count = (count < available) ? count : available;
+ buffer_ += count;
+ return count;
+ }
+
+ // Get the element at the front of the buffer.
+ payload_type buffer_front()
+ {
+ return payload_type(channel_message<R()>(0));
+ }
+
+ // Pop a value from the front of the buffer.
+ void buffer_pop()
+ {
+ --buffer_;
+ }
+
+ // Clear all values from the buffer.
+ void buffer_clear()
+ {
+ buffer_ = 0;
+ }
+
+private:
+ // Number of buffered "values".
+ std::size_t buffer_;
+};
+
+// The implementation for an error_code signature.
+template <typename Mutex>
+template <typename Traits, typename R>
+struct channel_service<Mutex>::implementation_type<
+ Traits, R(asio::error_code)>
+ : channel_service::base_implementation_type
+{
+ // The traits type associated with the channel.
+ typedef typename Traits::template rebind<R(asio::error_code)>::other
+ traits_type;
+
+ // Type of an element stored in the buffer.
+ typedef conditional_t<
+ has_signature<
+ typename traits_type::receive_cancelled_signature,
+ R(asio::error_code)
+ >::value,
+ conditional_t<
+ has_signature<
+ typename traits_type::receive_closed_signature,
+ R(asio::error_code)
+ >::value,
+ channel_payload<R(asio::error_code)>,
+ channel_payload<
+ R(asio::error_code),
+ typename traits_type::receive_closed_signature
+ >
+ >,
+ conditional_t<
+ has_signature<
+ typename traits_type::receive_closed_signature,
+ R(asio::error_code),
+ typename traits_type::receive_cancelled_signature
+ >::value,
+ channel_payload<
+ R(asio::error_code),
+ typename traits_type::receive_cancelled_signature
+ >,
+ channel_payload<
+ R(asio::error_code),
+ typename traits_type::receive_cancelled_signature,
+ typename traits_type::receive_closed_signature
+ >
+ >
+ > payload_type;
+
+ // Construct with empty buffer.
+ implementation_type()
+ : size_(0)
+ {
+ first_.count_ = 0;
+ }
+
+ // Move from another buffer.
+ void buffer_move_from(implementation_type& other)
+ {
+ size_ = other.buffer_;
+ other.size_ = 0;
+ first_ = other.first_;
+ other.first.count_ = 0;
+ rest_ = static_cast<
+ typename traits_type::template container<buffered_value>::type&&>(
+ other.rest_);
+ other.buffer_clear();
+ }
+
+ // Get number of buffered elements.
+ std::size_t buffer_size() const
+ {
+ return size_;
+ }
+
+ // Push a new value to the back of the buffer.
+ void buffer_push(payload_type payload)
+ {
+ buffered_value& last = rest_.empty() ? first_ : rest_.back();
+ if (last.count_ == 0)
+ {
+ value_handler handler{last.value_};
+ payload.receive(handler);
+ last.count_ = 1;
+ }
+ else
+ {
+ asio::error_code value{last.value_};
+ value_handler handler{value};
+ payload.receive(handler);
+ if (last.value_ == value)
+ ++last.count_;
+ else
+ rest_.push_back({value, 1});
+ }
+ ++size_;
+ }
+
+ // Push new values to the back of the buffer.
+ std::size_t buffer_push_n(std::size_t count, payload_type payload)
+ {
+ std::size_t available = this->max_buffer_size_ - size_;
+ count = (count < available) ? count : available;
+ if (count > 0)
+ {
+ buffered_value& last = rest_.empty() ? first_ : rest_.back();
+ if (last.count_ == 0)
+ {
+ payload.receive(value_handler{last.value_});
+ last.count_ = count;
+ }
+ else
+ {
+ asio::error_code value{last.value_};
+ payload.receive(value_handler{value});
+ if (last.value_ == value)
+ last.count_ += count;
+ else
+ rest_.push_back({value, count});
+ }
+ size_ += count;
+ }
+ return count;
+ }
+
+ // Get the element at the front of the buffer.
+ payload_type buffer_front()
+ {
+ return payload_type({0, first_.value_});
+ }
+
+ // Pop a value from the front of the buffer.
+ void buffer_pop()
+ {
+ --size_;
+ if (--first_.count_ == 0 && !rest_.empty())
+ {
+ first_ = rest_.front();
+ rest_.pop_front();
+ }
+ }
+
+ // Clear all values from the buffer.
+ void buffer_clear()
+ {
+ size_ = 0;
+ first_.count_ == 0;
+ rest_.clear();
+ }
+
+private:
+ struct buffered_value
+ {
+ asio::error_code value_;
+ std::size_t count_;
+ };
+
+ struct value_handler
+ {
+ asio::error_code& target_;
+
+ template <typename... Args>
+ void operator()(const asio::error_code& value, Args&&...)
+ {
+ target_ = value;
+ }
+ };
+
+ buffered_value& last_value()
+ {
+ return rest_.empty() ? first_ : rest_.back();
+ }
+
+ // Total number of buffered values.
+ std::size_t size_;
+
+ // The first buffered value is maintained as a separate data member to avoid
+ // allocating space in the container in the common case.
+ buffered_value first_;
+
+ // The rest of the buffered values.
+ typename traits_type::template container<buffered_value>::type rest_;
+};
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/experimental/detail/impl/channel_service.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_CHANNEL_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/completion_handler_erasure.hpp b/3rdparty/asio/include/asio/experimental/detail/completion_handler_erasure.hpp
deleted file mode 100644
index aca02496957..00000000000
--- a/3rdparty/asio/include/asio/experimental/detail/completion_handler_erasure.hpp
+++ /dev/null
@@ -1,158 +0,0 @@
-//
-// experimental/detail/completion_handler_erasure.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
-//
-// 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 ASIO_EXPERIMENTAL_DETAIL_COMPLETION_HANDLER_ERASURE_HPP
-#define ASIO_EXPERIMENTAL_DETAIL_COMPLETION_HANDLER_ERASURE_HPP
-
-#include "asio/associated_allocator.hpp"
-#include "asio/dispatch.hpp"
-
-namespace asio {
-
-class any_io_executor;
-
-namespace experimental {
-namespace detail {
-
-template<typename Signature, typename Executor>
-struct completion_handler_erasure_base;
-
-template<typename Func, typename Signature, typename Executor>
-struct completion_handler_erasure_impl;
-
-template<typename Return, typename ... Args, typename Executor>
-struct completion_handler_erasure_base<Return(Args...), Executor>
-{
- Executor executor;
-
- completion_handler_erasure_base(Executor&& executor)
- : executor(std::move(executor))
- {
- }
-
- virtual Return call(Args ...args) = 0;
- virtual ~completion_handler_erasure_base() = default;
-};
-
-template<typename Func, typename Return, typename ... Args, typename Executor>
-struct completion_handler_erasure_impl<Func, Return(Args...), Executor> final
- : completion_handler_erasure_base<Return(Args...), Executor>
-{
- completion_handler_erasure_impl(Executor&& exec, Func&& func)
- : completion_handler_erasure_base<Return(Args...), Executor>(
- std::move(exec)), func(std::move(func))
- {
- }
-
- virtual Return call(Args ...args) override
- {
- std::move(func)(std::move(args)...);
- }
-
- Func func;
-};
-
-template<typename Signature, typename Executor = any_io_executor>
-struct completion_handler_erasure;
-
-template<typename Return, typename ... Args, typename Executor>
-struct completion_handler_erasure<Return(Args...), Executor>
-{
- struct deleter_t
- {
- using allocator_base = typename associated_allocator<Executor>::type;
- using allocator_type =
- typename std::allocator_traits<allocator_base>::template rebind_alloc<
- completion_handler_erasure_base<Return(Args...), Executor>>;
-
- allocator_type allocator;
- std::size_t size;
-
- template<typename Func>
- static std::unique_ptr<
- completion_handler_erasure_base<Return(Args...), Executor>, deleter_t>
- make(Executor exec, Func&& func)
- {
- using type = completion_handler_erasure_impl<
- std::remove_reference_t<Func>, Return(Args...), Executor>;
- using alloc_type = typename std::allocator_traits<
- allocator_base>::template rebind_alloc<type>;
- auto alloc = alloc_type(get_associated_allocator(exec));
- auto size = sizeof(type);
- auto p = std::allocator_traits<alloc_type>::allocate(alloc, size);
- auto res = std::unique_ptr<type, deleter_t>(
- p, deleter_t{allocator_type(alloc), size});
- std::allocator_traits<alloc_type>::construct(alloc,
- p, std::move(exec), std::forward<Func>(func));
- return res;
- }
-
- void operator()(
- completion_handler_erasure_base<Return(Args...), Executor> * p)
- {
- std::allocator_traits<allocator_type>::destroy(allocator, p);
- std::allocator_traits<allocator_type>::deallocate(allocator, p, size);
- }
- };
-
- completion_handler_erasure(const completion_handler_erasure&) = delete;
- completion_handler_erasure(completion_handler_erasure&&) = default;
- completion_handler_erasure& operator=(
- const completion_handler_erasure&) = delete;
- completion_handler_erasure& operator=(
- completion_handler_erasure&&) = default;
-
- constexpr completion_handler_erasure() = default;
-
- constexpr completion_handler_erasure(nullptr_t)
- : completion_handler_erasure()
- {
- }
-
- template<typename Func>
- completion_handler_erasure(Executor exec, Func&& func)
- : impl_(deleter_t::make(std::move(exec), std::forward<Func>(func)))
- {
- }
-
- ~completion_handler_erasure()
- {
- if (auto f = std::exchange(impl_, nullptr); f != nullptr)
- {
- asio::dispatch(f->executor,
- [f = std::move(f)]() mutable
- {
- std::move(f)->call(Args{}...);
- });
- }
- }
-
- Return operator()(Args ... args)
- {
- if (auto f = std::exchange(impl_, nullptr); f != nullptr)
- f->call(std::move(args)...);
- }
-
- constexpr bool operator==(nullptr_t) const noexcept {return impl_ == nullptr;}
- constexpr bool operator!=(nullptr_t) const noexcept {return impl_ != nullptr;}
- constexpr bool operator!() const noexcept {return impl_ == nullptr;}
-
-private:
- std::unique_ptr<
- completion_handler_erasure_base<Return(Args...), Executor>, deleter_t>
- impl_;
-};
-
-} // namespace detail
-} // namespace experimental
-} // namespace asio
-
-#endif // ASIO_EXPERIMENTAL_DETAIL_COMPLETION_HANDLER_ERASURE_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/coro_completion_handler.hpp b/3rdparty/asio/include/asio/experimental/detail/coro_completion_handler.hpp
new file mode 100644
index 00000000000..52809134cb0
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/coro_completion_handler.hpp
@@ -0,0 +1,169 @@
+//
+// experimental/detail/coro_completion_handler.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_CORO_COMPLETION_HANDLER_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_CORO_COMPLETION_HANDLER_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/deferred.hpp"
+#include "asio/experimental/coro.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename Promise, typename... Args>
+struct coro_completion_handler
+{
+ coro_completion_handler(coroutine_handle<Promise> h,
+ std::optional<std::tuple<Args...>>& result)
+ : self(h),
+ result(result)
+ {
+ }
+
+ coro_completion_handler(coro_completion_handler&&) = default;
+
+ coroutine_handle<Promise> self;
+
+ std::optional<std::tuple<Args...>>& result;
+
+ using promise_type = Promise;
+
+ void operator()(Args... args)
+ {
+ result.emplace(std::move(args)...);
+ self.resume();
+ }
+
+ using allocator_type = typename promise_type::allocator_type;
+ allocator_type get_allocator() const noexcept
+ {
+ return self.promise().get_allocator();
+ }
+
+ using executor_type = typename promise_type::executor_type;
+ executor_type get_executor() const noexcept
+ {
+ return self.promise().get_executor();
+ }
+
+ using cancellation_slot_type = typename promise_type::cancellation_slot_type;
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return self.promise().get_cancellation_slot();
+ }
+};
+
+template <typename Signature>
+struct coro_completion_handler_type;
+
+template <typename... Args>
+struct coro_completion_handler_type<void(Args...)>
+{
+ using type = std::tuple<Args...>;
+
+ template <typename Promise>
+ using completion_handler = coro_completion_handler<Promise, Args...>;
+};
+
+template <typename Signature>
+using coro_completion_handler_type_t =
+ typename coro_completion_handler_type<Signature>::type;
+
+inline void coro_interpret_result(std::tuple<>&&)
+{
+}
+
+template <typename... Args>
+inline auto coro_interpret_result(std::tuple<Args...>&& args)
+{
+ return std::move(args);
+}
+
+template <typename... Args>
+auto coro_interpret_result(std::tuple<std::exception_ptr, Args...>&& args)
+{
+ if (std::get<0>(args))
+ std::rethrow_exception(std::get<0>(args));
+
+ return std::apply(
+ [](auto, auto&&... rest)
+ {
+ return std::make_tuple(std::move(rest)...);
+ }, std::move(args));
+}
+
+template <typename... Args>
+auto coro_interpret_result(
+ std::tuple<asio::error_code, Args...>&& args)
+{
+ if (std::get<0>(args))
+ asio::detail::throw_exception(
+ asio::system_error(std::get<0>(args)));
+
+ return std::apply(
+ [](auto, auto&&... rest)
+ {
+ return std::make_tuple(std::move(rest)...);
+ }, std::move(args));
+}
+
+template <typename Arg>
+inline auto coro_interpret_result(std::tuple<Arg>&& args)
+{
+ return std::get<0>(std::move(args));
+}
+
+template <typename Arg>
+auto coro_interpret_result(std::tuple<std::exception_ptr, Arg>&& args)
+{
+ if (std::get<0>(args))
+ std::rethrow_exception(std::get<0>(args));
+ return std::get<1>(std::move(args));
+}
+
+inline auto coro_interpret_result(
+ std::tuple<asio::error_code>&& args)
+{
+ if (std::get<0>(args))
+ asio::detail::throw_exception(
+ asio::system_error(std::get<0>(args)));
+}
+
+inline auto coro_interpret_result(std::tuple<std::exception_ptr>&& args)
+{
+ if (std::get<0>(args))
+ std::rethrow_exception(std::get<0>(args));
+}
+
+template <typename Arg>
+auto coro_interpret_result(std::tuple<asio::error_code, Arg>&& args)
+{
+ if (std::get<0>(args))
+ asio::detail::throw_exception(
+ asio::system_error(std::get<0>(args)));
+ return std::get<1>(std::move(args));
+}
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_CORO_COMPLETION_HANDLER_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/coro_promise_allocator.hpp b/3rdparty/asio/include/asio/experimental/detail/coro_promise_allocator.hpp
index bb78677f115..328646968f3 100644
--- a/3rdparty/asio/include/asio/experimental/detail/coro_promise_allocator.hpp
+++ b/3rdparty/asio/include/asio/experimental/detail/coro_promise_allocator.hpp
@@ -2,8 +2,8 @@
// experimental/detail/coro_promise_allocator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -13,101 +13,124 @@
#define ASIO_EXPERIMENTAL_DETAIL_CORO_PROMISE_ALLOCATOR_HPP
#include "asio/detail/config.hpp"
-#include "asio/experimental/detail/coro_traits.hpp"
+#include "asio/experimental/coro_traits.hpp"
namespace asio {
namespace experimental {
namespace detail {
-template <typename Coroutine,
- typename Executor = typename Coroutine::executor_type,
- typename Allocator = typename std::allocator_traits<
- associated_allocator_t<Executor>>:: template rebind_alloc<std::byte>,
- bool Noexcept = noexcept(std::declval<Allocator>().allocate(0u))>
-struct coro_promise_allocator
+/// Allocate the memory and put the allocator behind the coro memory
+template <typename AllocatorType>
+void* allocate_coroutine(const std::size_t size, AllocatorType alloc_)
{
- using allocator_type = Allocator;
+ using alloc_type = typename std::allocator_traits<AllocatorType>::template
+ rebind_alloc<unsigned char>;
+ alloc_type alloc{alloc_};
+
+ const auto align_needed = size % alignof(alloc_type);
+ const auto align_offset = align_needed != 0
+ ? alignof(alloc_type) - align_needed : 0ull;
+ const auto alloc_size = size + sizeof(alloc_type) + align_offset;
+ const auto raw =
+ std::allocator_traits<alloc_type>::allocate(alloc, alloc_size);
+ new(raw + size + align_offset) alloc_type(std::move(alloc));
+
+ return raw;
+}
+
+/// Deallocate the memory and destroy the allocator in the coro memory.
+template <typename AllocatorType>
+void deallocate_coroutine(void* raw_, const std::size_t size)
+{
+ using alloc_type = typename std::allocator_traits<AllocatorType>::template
+ rebind_alloc<unsigned char>;
- template <typename... Args>
- void* operator new(const std::size_t size, Executor executor, Args&&...)
- {
- static_assert(std::is_nothrow_move_constructible_v<allocator_type>);
- allocator_type alloc{get_associated_allocator(executor)};
-
- const auto csize = size + sizeof(alloc);
- const auto raw =
- std::allocator_traits<allocator_type>::allocate(alloc, csize);
- new (raw) allocator_type(std::move(alloc));
- return static_cast<std::byte*>(raw) + sizeof(alloc);
- }
+ const auto raw = static_cast<unsigned char *>(raw_);
- template <execution_context Context, typename... Args>
- void* operator new(const std::size_t size, Context&& ctx, Args&&... args)
- {
- return coro_promise_allocator::operator new(size,
- ctx.get_executor(), std::forward<Args>(args)...);
- }
+ const auto align_needed = size % alignof(alloc_type);
+ const auto align_offset = align_needed != 0
+ ? alignof(alloc_type) - align_needed : 0ull;
+ const auto alloc_size = size + sizeof(alloc_type) + align_offset;
- void operator delete(void* raw, std::size_t size )
- {
- auto * alloc_p = static_cast<allocator_type*>(raw);
+ auto alloc_p = reinterpret_cast<alloc_type *>(raw + size + align_offset);
+ auto alloc = std::move(*alloc_p);
+ alloc_p->~alloc_type();
+ std::allocator_traits<alloc_type>::deallocate(alloc, raw, alloc_size);
+}
+
+template <typename T>
+constexpr std::size_t variadic_first(std::size_t = 0u)
+{
+ return std::numeric_limits<std::size_t>::max();
+}
- auto alloc = std::move(*alloc_p);
- alloc_p->~allocator_type();
- std::allocator_traits<allocator_type>::deallocate(alloc,
- static_cast<std::byte*>(raw), size + sizeof(allocator_type));
- }
-};
-template <typename Coroutine, typename Executor>
-struct coro_promise_allocator<Coroutine,
- Executor, std::allocator<std::byte>, false>
+template <typename T, typename First, typename... Args>
+constexpr std::size_t variadic_first(std::size_t pos = 0u)
{
+ if constexpr (std::is_same_v<std::decay_t<First>, T>)
+ return pos;
+ else
+ return variadic_first<T, Args...>(pos+1);
+}
+
+template <std::size_t Idx, typename First, typename... Args>
+ requires (Idx <= sizeof...(Args))
+constexpr decltype(auto) get_variadic(First&& first, Args&&... args)
+{
+ if constexpr (Idx == 0u)
+ return static_cast<First>(first);
+ else
+ return get_variadic<Idx-1u>(static_cast<Args>(args)...);
+}
-};
+template <std::size_t Idx>
+constexpr decltype(auto) get_variadic();
-template <typename Coroutine, typename Executor, typename Allocator>
-struct coro_promise_allocator<Coroutine, Executor, Allocator, true>
+template <typename Allocator>
+struct coro_promise_allocator
{
using allocator_type = Allocator;
+ allocator_type get_allocator() const {return alloc_;}
template <typename... Args>
- void* operator new(const std::size_t size,
- Executor executor, Args&&...) noexcept
+ void* operator new(const std::size_t size, Args & ... args)
+ {
+ return allocate_coroutine(size,
+ get_variadic<variadic_first<std::allocator_arg_t,
+ std::decay_t<Args>...>() + 1u>(args...));
+ }
+
+ void operator delete(void* raw, const std::size_t size)
{
- static_assert(std::is_nothrow_move_constructible_v<allocator_type>);
- allocator_type alloc{get_associated_allocator(executor)};
-
- const auto csize = size + sizeof(alloc);
- const auto raw =
- std::allocator_traits<allocator_type>::allocate(alloc, csize);
- if (raw == nullptr)
- return nullptr;
- new (raw) allocator_type(std::move(alloc));
- return static_cast<std::byte*>(raw) + sizeof(alloc);
+ deallocate_coroutine<allocator_type>(raw, size);
}
- template <execution_context Context, typename... Args>
- void* operator new(const std::size_t size,
- Context&& ctx, Args&&... args) noexcept
+ template <typename... Args>
+ coro_promise_allocator(Args&& ... args)
+ : alloc_(
+ get_variadic<variadic_first<std::allocator_arg_t,
+ std::decay_t<Args>...>() + 1u>(args...))
{
- return coro_promise_allocator::operator new(size,
- ctx.get_executor(), std::forward<Args>(args)...);
}
- void operator delete(void* raw, std::size_t size) noexcept
+private:
+ allocator_type alloc_;
+};
+
+template <>
+struct coro_promise_allocator<std::allocator<void>>
+{
+ using allocator_type = std::allocator<void>;
+
+ template <typename... Args>
+ coro_promise_allocator(Args&&...)
{
- auto * alloc_p = static_cast<allocator_type*>(raw);
- auto alloc = std::move(*alloc_p);
- alloc_p->~allocator_type();
- const auto csize = size + sizeof(allocator_type);
- std::allocator_traits<allocator_type>::deallocate(alloc,
- static_cast<std::byte*>(raw) - sizeof(allocator_type), csize);
}
- static auto get_return_object_on_allocation_failure() noexcept -> Coroutine
+ allocator_type get_allocator() const
{
- return Coroutine{};
+ return {};
}
};
diff --git a/3rdparty/asio/include/asio/experimental/detail/has_signature.hpp b/3rdparty/asio/include/asio/experimental/detail/has_signature.hpp
new file mode 100644
index 00000000000..ea5dac8c69b
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/has_signature.hpp
@@ -0,0 +1,54 @@
+//
+// experimental/detail/has_signature.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_HAS_SIGNATURE_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_HAS_SIGNATURE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/type_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename S, typename... Signatures>
+struct has_signature;
+
+template <typename S, typename... Signatures>
+struct has_signature;
+
+template <typename S>
+struct has_signature<S> : false_type
+{
+};
+
+template <typename S, typename... Signatures>
+struct has_signature<S, S, Signatures...> : true_type
+{
+};
+
+template <typename S, typename Head, typename... Tail>
+struct has_signature<S, Head, Tail...> : has_signature<S, Tail...>
+{
+};
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_HAS_SIGNATURE_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/impl/channel_service.hpp b/3rdparty/asio/include/asio/experimental/detail/impl/channel_service.hpp
new file mode 100644
index 00000000000..797c9f433c7
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/detail/impl/channel_service.hpp
@@ -0,0 +1,621 @@
+//
+// experimental/detail/impl/channel_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_DETAIL_IMPL_CHANNEL_SERVICE_HPP
+#define ASIO_EXPERIMENTAL_DETAIL_IMPL_CHANNEL_SERVICE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+template <typename Mutex>
+inline channel_service<Mutex>::channel_service(
+ asio::execution_context& ctx)
+ : asio::detail::execution_context_service_base<channel_service>(ctx),
+ mutex_(),
+ impl_list_(0)
+{
+}
+
+template <typename Mutex>
+inline void channel_service<Mutex>::shutdown()
+{
+ // Abandon all pending operations.
+ asio::detail::op_queue<channel_operation> ops;
+ asio::detail::mutex::scoped_lock lock(mutex_);
+ base_implementation_type* impl = impl_list_;
+ while (impl)
+ {
+ ops.push(impl->waiters_);
+ impl = impl->next_;
+ }
+}
+
+template <typename Mutex>
+inline void channel_service<Mutex>::construct(
+ channel_service<Mutex>::base_implementation_type& impl,
+ std::size_t max_buffer_size)
+{
+ impl.max_buffer_size_ = max_buffer_size;
+ impl.receive_state_ = block;
+ impl.send_state_ = max_buffer_size ? buffer : block;
+
+ // Insert implementation into linked list of all implementations.
+ asio::detail::mutex::scoped_lock lock(mutex_);
+ impl.next_ = impl_list_;
+ impl.prev_ = 0;
+ if (impl_list_)
+ impl_list_->prev_ = &impl;
+ impl_list_ = &impl;
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+void channel_service<Mutex>::destroy(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl)
+{
+ cancel(impl);
+ base_destroy(impl);
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+void channel_service<Mutex>::move_construct(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl,
+ channel_service<Mutex>::implementation_type<
+ Traits, Signatures...>& other_impl)
+{
+ impl.max_buffer_size_ = other_impl.max_buffer_size_;
+ impl.receive_state_ = other_impl.receive_state_;
+ other_impl.receive_state_ = block;
+ impl.send_state_ = other_impl.send_state_;
+ other_impl.send_state_ = other_impl.max_buffer_size_ ? buffer : block;
+ impl.buffer_move_from(other_impl);
+
+ // Insert implementation into linked list of all implementations.
+ asio::detail::mutex::scoped_lock lock(mutex_);
+ impl.next_ = impl_list_;
+ impl.prev_ = 0;
+ if (impl_list_)
+ impl_list_->prev_ = &impl;
+ impl_list_ = &impl;
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+void channel_service<Mutex>::move_assign(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl,
+ channel_service& other_service,
+ channel_service<Mutex>::implementation_type<
+ Traits, Signatures...>& other_impl)
+{
+ cancel(impl);
+
+ if (this != &other_service)
+ {
+ // Remove implementation from linked list of all implementations.
+ asio::detail::mutex::scoped_lock lock(mutex_);
+ if (impl_list_ == &impl)
+ impl_list_ = impl.next_;
+ if (impl.prev_)
+ impl.prev_->next_ = impl.next_;
+ if (impl.next_)
+ impl.next_->prev_= impl.prev_;
+ impl.next_ = 0;
+ impl.prev_ = 0;
+ }
+
+ impl.max_buffer_size_ = other_impl.max_buffer_size_;
+ impl.receive_state_ = other_impl.receive_state_;
+ other_impl.receive_state_ = block;
+ impl.send_state_ = other_impl.send_state_;
+ other_impl.send_state_ = other_impl.max_buffer_size_ ? buffer : block;
+ impl.buffer_move_from(other_impl);
+
+ if (this != &other_service)
+ {
+ // Insert implementation into linked list of all implementations.
+ asio::detail::mutex::scoped_lock lock(other_service.mutex_);
+ impl.next_ = other_service.impl_list_;
+ impl.prev_ = 0;
+ if (other_service.impl_list_)
+ other_service.impl_list_->prev_ = &impl;
+ other_service.impl_list_ = &impl;
+ }
+}
+
+template <typename Mutex>
+inline void channel_service<Mutex>::base_destroy(
+ channel_service<Mutex>::base_implementation_type& impl)
+{
+ // Remove implementation from linked list of all implementations.
+ asio::detail::mutex::scoped_lock lock(mutex_);
+ if (impl_list_ == &impl)
+ impl_list_ = impl.next_;
+ if (impl.prev_)
+ impl.prev_->next_ = impl.next_;
+ if (impl.next_)
+ impl.next_->prev_= impl.prev_;
+ impl.next_ = 0;
+ impl.prev_ = 0;
+}
+
+template <typename Mutex>
+inline std::size_t channel_service<Mutex>::capacity(
+ const channel_service<Mutex>::base_implementation_type& impl)
+ const noexcept
+{
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ return impl.max_buffer_size_;
+}
+
+template <typename Mutex>
+inline bool channel_service<Mutex>::is_open(
+ const channel_service<Mutex>::base_implementation_type& impl)
+ const noexcept
+{
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ return impl.send_state_ != closed;
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+void channel_service<Mutex>::reset(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl)
+{
+ cancel(impl);
+
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ impl.receive_state_ = block;
+ impl.send_state_ = impl.max_buffer_size_ ? buffer : block;
+ impl.buffer_clear();
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+void channel_service<Mutex>::close(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl)
+{
+ typedef typename implementation_type<Traits,
+ Signatures...>::traits_type traits_type;
+ typedef typename implementation_type<Traits,
+ Signatures...>::payload_type payload_type;
+
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ if (impl.receive_state_ == block)
+ {
+ while (channel_operation* op = impl.waiters_.front())
+ {
+ impl.waiters_.pop();
+ traits_type::invoke_receive_closed(
+ post_receive<payload_type,
+ typename traits_type::receive_closed_signature>(
+ static_cast<channel_receive<payload_type>*>(op)));
+ }
+ }
+
+ impl.send_state_ = closed;
+ if (impl.receive_state_ != buffer)
+ impl.receive_state_ = closed;
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+void channel_service<Mutex>::cancel(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl)
+{
+ typedef typename implementation_type<Traits,
+ Signatures...>::traits_type traits_type;
+ typedef typename implementation_type<Traits,
+ Signatures...>::payload_type payload_type;
+
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ while (channel_operation* op = impl.waiters_.front())
+ {
+ if (impl.send_state_ == block)
+ {
+ impl.waiters_.pop();
+ static_cast<channel_send<payload_type>*>(op)->cancel();
+ }
+ else
+ {
+ impl.waiters_.pop();
+ traits_type::invoke_receive_cancelled(
+ post_receive<payload_type,
+ typename traits_type::receive_cancelled_signature>(
+ static_cast<channel_receive<payload_type>*>(op)));
+ }
+ }
+
+ if (impl.receive_state_ == waiter)
+ impl.receive_state_ = block;
+ if (impl.send_state_ == waiter)
+ impl.send_state_ = impl.max_buffer_size_ ? buffer : block;
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+void channel_service<Mutex>::cancel_by_key(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl,
+ void* cancellation_key)
+{
+ typedef typename implementation_type<Traits,
+ Signatures...>::traits_type traits_type;
+ typedef typename implementation_type<Traits,
+ Signatures...>::payload_type payload_type;
+
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ asio::detail::op_queue<channel_operation> other_ops;
+ while (channel_operation* op = impl.waiters_.front())
+ {
+ if (op->cancellation_key_ == cancellation_key)
+ {
+ if (impl.send_state_ == block)
+ {
+ impl.waiters_.pop();
+ static_cast<channel_send<payload_type>*>(op)->cancel();
+ }
+ else
+ {
+ impl.waiters_.pop();
+ traits_type::invoke_receive_cancelled(
+ post_receive<payload_type,
+ typename traits_type::receive_cancelled_signature>(
+ static_cast<channel_receive<payload_type>*>(op)));
+ }
+ }
+ else
+ {
+ impl.waiters_.pop();
+ other_ops.push(op);
+ }
+ }
+ impl.waiters_.push(other_ops);
+
+ if (impl.waiters_.empty())
+ {
+ if (impl.receive_state_ == waiter)
+ impl.receive_state_ = block;
+ if (impl.send_state_ == waiter)
+ impl.send_state_ = impl.max_buffer_size_ ? buffer : block;
+ }
+}
+
+template <typename Mutex>
+inline bool channel_service<Mutex>::ready(
+ const channel_service<Mutex>::base_implementation_type& impl)
+ const noexcept
+{
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ return impl.receive_state_ != block;
+}
+
+template <typename Mutex>
+template <typename Message, typename Traits,
+ typename... Signatures, typename... Args>
+bool channel_service<Mutex>::try_send(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl,
+ bool via_dispatch, Args&&... args)
+{
+ typedef typename implementation_type<Traits,
+ Signatures...>::payload_type payload_type;
+
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ switch (impl.send_state_)
+ {
+ case block:
+ {
+ return false;
+ }
+ case buffer:
+ {
+ impl.buffer_push(Message(0, static_cast<Args&&>(args)...));
+ impl.receive_state_ = buffer;
+ if (impl.buffer_size() == impl.max_buffer_size_)
+ impl.send_state_ = block;
+ return true;
+ }
+ case waiter:
+ {
+ payload_type payload(Message(0, static_cast<Args&&>(args)...));
+ channel_receive<payload_type>* receive_op =
+ static_cast<channel_receive<payload_type>*>(impl.waiters_.front());
+ impl.waiters_.pop();
+ if (impl.waiters_.empty())
+ impl.send_state_ = impl.max_buffer_size_ ? buffer : block;
+ lock.unlock();
+ if (via_dispatch)
+ receive_op->dispatch(static_cast<payload_type&&>(payload));
+ else
+ receive_op->post(static_cast<payload_type&&>(payload));
+ return true;
+ }
+ case closed:
+ default:
+ {
+ return false;
+ }
+ }
+}
+
+template <typename Mutex>
+template <typename Message, typename Traits,
+ typename... Signatures, typename... Args>
+std::size_t channel_service<Mutex>::try_send_n(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl,
+ std::size_t count, bool via_dispatch, Args&&... args)
+{
+ typedef typename implementation_type<Traits,
+ Signatures...>::payload_type payload_type;
+
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ if (count == 0)
+ return 0;
+
+ switch (impl.send_state_)
+ {
+ case block:
+ return 0;
+ case buffer:
+ case waiter:
+ break;
+ case closed:
+ default:
+ return 0;
+ }
+
+ payload_type payload(Message(0, static_cast<Args&&>(args)...));
+
+ for (std::size_t i = 0; i < count; ++i)
+ {
+ switch (impl.send_state_)
+ {
+ case block:
+ {
+ return i;
+ }
+ case buffer:
+ {
+ i += impl.buffer_push_n(count - i,
+ static_cast<payload_type&&>(payload));
+ impl.receive_state_ = buffer;
+ if (impl.buffer_size() == impl.max_buffer_size_)
+ impl.send_state_ = block;
+ return i;
+ }
+ case waiter:
+ {
+ channel_receive<payload_type>* receive_op =
+ static_cast<channel_receive<payload_type>*>(impl.waiters_.front());
+ impl.waiters_.pop();
+ if (impl.waiters_.empty())
+ impl.send_state_ = impl.max_buffer_size_ ? buffer : block;
+ lock.unlock();
+ if (via_dispatch)
+ receive_op->dispatch(payload);
+ else
+ receive_op->post(payload);
+ break;
+ }
+ case closed:
+ default:
+ {
+ return i;
+ }
+ }
+ }
+
+ return count;
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+void channel_service<Mutex>::start_send_op(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl,
+ channel_send<typename implementation_type<
+ Traits, Signatures...>::payload_type>* send_op)
+{
+ typedef typename implementation_type<Traits,
+ Signatures...>::payload_type payload_type;
+
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ switch (impl.send_state_)
+ {
+ case block:
+ {
+ impl.waiters_.push(send_op);
+ if (impl.receive_state_ == block)
+ impl.receive_state_ = waiter;
+ return;
+ }
+ case buffer:
+ {
+ impl.buffer_push(send_op->get_payload());
+ impl.receive_state_ = buffer;
+ if (impl.buffer_size() == impl.max_buffer_size_)
+ impl.send_state_ = block;
+ send_op->immediate();
+ break;
+ }
+ case waiter:
+ {
+ channel_receive<payload_type>* receive_op =
+ static_cast<channel_receive<payload_type>*>(impl.waiters_.front());
+ impl.waiters_.pop();
+ if (impl.waiters_.empty())
+ impl.send_state_ = impl.max_buffer_size_ ? buffer : block;
+ receive_op->post(send_op->get_payload());
+ send_op->immediate();
+ break;
+ }
+ case closed:
+ default:
+ {
+ send_op->close();
+ break;
+ }
+ }
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures, typename Handler>
+bool channel_service<Mutex>::try_receive(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl,
+ Handler&& handler)
+{
+ typedef typename implementation_type<Traits,
+ Signatures...>::payload_type payload_type;
+
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ switch (impl.receive_state_)
+ {
+ case block:
+ {
+ return false;
+ }
+ case buffer:
+ {
+ payload_type payload(impl.buffer_front());
+ if (channel_send<payload_type>* send_op =
+ static_cast<channel_send<payload_type>*>(impl.waiters_.front()))
+ {
+ impl.buffer_pop();
+ impl.buffer_push(send_op->get_payload());
+ impl.waiters_.pop();
+ send_op->post();
+ }
+ else
+ {
+ impl.buffer_pop();
+ if (impl.buffer_size() == 0)
+ impl.receive_state_ = (impl.send_state_ == closed) ? closed : block;
+ impl.send_state_ = (impl.send_state_ == closed) ? closed : buffer;
+ }
+ lock.unlock();
+ asio::detail::non_const_lvalue<Handler> handler2(handler);
+ channel_handler<payload_type, decay_t<Handler>>(
+ static_cast<payload_type&&>(payload), handler2.value)();
+ return true;
+ }
+ case waiter:
+ {
+ channel_send<payload_type>* send_op =
+ static_cast<channel_send<payload_type>*>(impl.waiters_.front());
+ payload_type payload = send_op->get_payload();
+ impl.waiters_.pop();
+ if (impl.waiters_.front() == 0)
+ impl.receive_state_ = (impl.send_state_ == closed) ? closed : block;
+ send_op->post();
+ lock.unlock();
+ asio::detail::non_const_lvalue<Handler> handler2(handler);
+ channel_handler<payload_type, decay_t<Handler>>(
+ static_cast<payload_type&&>(payload), handler2.value)();
+ return true;
+ }
+ case closed:
+ default:
+ {
+ return false;
+ }
+ }
+}
+
+template <typename Mutex>
+template <typename Traits, typename... Signatures>
+void channel_service<Mutex>::start_receive_op(
+ channel_service<Mutex>::implementation_type<Traits, Signatures...>& impl,
+ channel_receive<typename implementation_type<
+ Traits, Signatures...>::payload_type>* receive_op)
+{
+ typedef typename implementation_type<Traits,
+ Signatures...>::traits_type traits_type;
+ typedef typename implementation_type<Traits,
+ Signatures...>::payload_type payload_type;
+
+ typename Mutex::scoped_lock lock(impl.mutex_);
+
+ switch (impl.receive_state_)
+ {
+ case block:
+ {
+ impl.waiters_.push(receive_op);
+ if (impl.send_state_ != closed)
+ impl.send_state_ = waiter;
+ return;
+ }
+ case buffer:
+ {
+ payload_type payload(
+ static_cast<payload_type&&>(impl.buffer_front()));
+ if (channel_send<payload_type>* send_op =
+ static_cast<channel_send<payload_type>*>(impl.waiters_.front()))
+ {
+ impl.buffer_pop();
+ impl.buffer_push(send_op->get_payload());
+ impl.waiters_.pop();
+ send_op->post();
+ }
+ else
+ {
+ impl.buffer_pop();
+ if (impl.buffer_size() == 0)
+ impl.receive_state_ = (impl.send_state_ == closed) ? closed : block;
+ impl.send_state_ = (impl.send_state_ == closed) ? closed : buffer;
+ }
+ receive_op->immediate(static_cast<payload_type&&>(payload));
+ break;
+ }
+ case waiter:
+ {
+ channel_send<payload_type>* send_op =
+ static_cast<channel_send<payload_type>*>(impl.waiters_.front());
+ payload_type payload = send_op->get_payload();
+ impl.waiters_.pop();
+ if (impl.waiters_.front() == 0)
+ impl.receive_state_ = (impl.send_state_ == closed) ? closed : block;
+ send_op->post();
+ receive_op->immediate(static_cast<payload_type&&>(payload));
+ break;
+ }
+ case closed:
+ default:
+ {
+ traits_type::invoke_receive_closed(
+ post_receive<payload_type,
+ typename traits_type::receive_closed_signature>(receive_op));
+ break;
+ }
+ }
+}
+
+} // namespace detail
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_DETAIL_IMPL_CHANNEL_SERVICE_HPP
diff --git a/3rdparty/asio/include/asio/experimental/detail/partial_promise.hpp b/3rdparty/asio/include/asio/experimental/detail/partial_promise.hpp
index 55aa6d0c2b6..8495af2f0ba 100644
--- a/3rdparty/asio/include/asio/experimental/detail/partial_promise.hpp
+++ b/3rdparty/asio/include/asio/experimental/detail/partial_promise.hpp
@@ -2,8 +2,8 @@
// experimental/detail/partial_promise.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -13,9 +13,9 @@
#define ASIO_EXPERIMENTAL_DETAIL_PARTIAL_PROMISE_HPP
#include "asio/detail/config.hpp"
-#include "asio/experimental/detail/coro_traits.hpp"
+#include "asio/append.hpp"
#include "asio/awaitable.hpp"
-#include <iostream>
+#include "asio/experimental/coro_traits.hpp"
#if defined(ASIO_HAS_STD_COROUTINE)
# include <coroutine>
@@ -45,7 +45,33 @@ using std::experimental::noop_coroutine;
#endif // defined(ASIO_HAS_STD_COROUTINE)
-struct partial_promise
+struct partial_coro
+{
+ coroutine_handle<void> handle{nullptr};
+};
+
+template <typename Allocator>
+struct partial_promise_base
+{
+ template <typename Executor, typename Token, typename... Args>
+ void* operator new(const std::size_t size, Executor&, Token& tk, Args&...)
+ {
+ return allocate_coroutine<Allocator>(size, get_associated_allocator(tk));
+ }
+
+ void operator delete(void* raw, const std::size_t size)
+ {
+ deallocate_coroutine<Allocator>(raw, size);
+ }
+};
+
+template <>
+struct partial_promise_base<std::allocator<void>>
+{
+};
+
+template <typename Allocator>
+struct partial_promise : partial_promise_base<Allocator>
{
auto initial_suspend() noexcept
{
@@ -62,7 +88,7 @@ struct partial_promise
auto await_suspend(asio::detail::coroutine_handle<>) noexcept
{
- p->get_return_object().destroy();
+ p->get_return_object().handle.destroy();
}
constexpr void await_resume() noexcept {}
@@ -73,9 +99,9 @@ struct partial_promise
void return_void() {}
- coroutine_handle<partial_promise> get_return_object()
+ partial_coro get_return_object()
{
- return coroutine_handle<partial_promise>::from_promise(*this);
+ return partial_coro{coroutine_handle<partial_promise>::from_promise(*this)};
}
void unhandled_exception()
@@ -84,7 +110,9 @@ struct partial_promise
}
};
-} // namespace detail
+
+
+}; // namespace detail
} // namespace experimental
} // namespace asio
@@ -92,12 +120,14 @@ struct partial_promise
namespace std {
-template<typename ... Args>
+template <typename Executor, typename Completion, typename... Args>
struct coroutine_traits<
- coroutine_handle<asio::experimental::detail::partial_promise>,
- Args...>
+ asio::experimental::detail::partial_coro,
+ Executor, Completion, Args...>
{
- using promise_type = asio::experimental::detail::partial_promise;
+ using promise_type =
+ asio::experimental::detail::partial_promise<
+ asio::associated_allocator_t<Completion>>;
};
} // namespace std
@@ -106,12 +136,14 @@ struct coroutine_traits<
namespace std { namespace experimental {
-template<typename... Args>
+template <typename Executor, typename Completion, typename... Args>
struct coroutine_traits<
- coroutine_handle<asio::experimental::detail::partial_promise>,
- Args...>
+ asio::experimental::detail::partial_coro,
+ Executor, Completion, Args...>
{
- using promise_type = asio::experimental::detail::partial_promise;
+ using promise_type =
+ asio::experimental::detail::partial_promise<
+ asio::associated_allocator_t<Completion>>;
};
}} // namespace std::experimental
@@ -122,51 +154,39 @@ namespace asio {
namespace experimental {
namespace detail {
-template<typename CompletionToken>
-auto post_coroutine(CompletionToken token) noexcept
- -> coroutine_handle<partial_promise>
-{
- post(std::move(token));
- co_return;
-}
-
-template<execution::executor Executor, typename CompletionToken>
-auto post_coroutine(Executor exec, CompletionToken token) noexcept
- -> coroutine_handle<partial_promise>
-{
- post(exec, std::move(token));
- co_return;
-}
-
-template<execution_context Context, typename CompletionToken>
-auto post_coroutine(Context &ctx, CompletionToken token) noexcept
- -> coroutine_handle<partial_promise>
+template <execution::executor Executor,
+ typename CompletionToken, typename... Args>
+partial_coro post_coroutine(Executor exec,
+ CompletionToken token, Args&&... args) noexcept
{
- post(ctx, std::move(token));
+ post(exec, asio::append(std::move(token), std::move(args)...));
co_return;
}
-template<typename CompletionToken>
-auto dispatch_coroutine(CompletionToken token) noexcept
- -> coroutine_handle<partial_promise>
+template <detail::execution_context Context,
+ typename CompletionToken, typename... Args>
+partial_coro post_coroutine(Context& ctx,
+ CompletionToken token, Args&&... args) noexcept
{
- dispatch(std::move(token));
+ post(ctx, asio::append(std::move(token), std::move(args)...));
co_return;
}
-template<execution::executor Executor, typename CompletionToken>
-auto dispatch_coroutine(Executor exec, CompletionToken token) noexcept
- -> coroutine_handle<partial_promise>
+template <execution::executor Executor,
+ typename CompletionToken, typename... Args>
+partial_coro dispatch_coroutine(Executor exec,
+ CompletionToken token, Args&&... args) noexcept
{
- dispatch(exec, std::move(token));
+ dispatch(exec, asio::append(std::move(token), std::move(args)...));
co_return;
}
-template<execution_context Context, typename CompletionToken>
-auto dispatch_coroutine(Context &ctx, CompletionToken token) noexcept
- -> coroutine_handle<partial_promise>
+template <detail::execution_context Context,
+ typename CompletionToken, typename... Args>
+partial_coro dispatch_coroutine(Context& ctx,
+ CompletionToken token, Args &&... args) noexcept
{
- dispatch(ctx, std::move(token));
+ dispatch(ctx, asio::append(std::move(token), std::move(args)...));
co_return;
}
diff --git a/3rdparty/asio/include/asio/experimental/impl/append.hpp b/3rdparty/asio/include/asio/experimental/impl/append.hpp
deleted file mode 100644
index 7a764832e1b..00000000000
--- a/3rdparty/asio/include/asio/experimental/impl/append.hpp
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// experimental/impl/append.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_IMPL_EXPERIMENTAL_APPEND_HPP
-#define ASIO_IMPL_EXPERIMENTAL_APPEND_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#include "asio/associator.hpp"
-#include "asio/async_result.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace experimental {
-namespace detail {
-
-// Class to adapt a append_t as a completion handler.
-template <typename Handler, typename... Values>
-class append_handler
-{
-public:
- typedef void result_type;
-
- template <typename H>
- append_handler(ASIO_MOVE_ARG(H) handler, std::tuple<Values...> values)
- : handler_(ASIO_MOVE_CAST(H)(handler)),
- values_(ASIO_MOVE_CAST(std::tuple<Values...>)(values))
- {
- }
-
- template <typename... Args>
- void operator()(ASIO_MOVE_ARG(Args)... args)
- {
- this->invoke(
- std::make_index_sequence<sizeof...(Values)>{},
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
- template <std::size_t... I, typename... Args>
- void invoke(std::index_sequence<I...>, ASIO_MOVE_ARG(Args)... args)
- {
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
- ASIO_MOVE_CAST(Args)(args)...,
- ASIO_MOVE_CAST(Values)(std::get<I>(values_))...);
- }
-
-//private:
- Handler handler_;
- std::tuple<Values...> values_;
-};
-
-template <typename Handler>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- append_handler<Handler>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- append_handler<Handler>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
-inline bool asio_handler_is_continuation(
- append_handler<Handler>* this_handler)
-{
- return asio_handler_cont_helpers::is_continuation(
- this_handler->handler_);
-}
-
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- append_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- append_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Signature, typename... Values>
-struct append_signature;
-
-template <typename R, typename... Args, typename... Values>
-struct append_signature<R(Args...), Values...>
-{
- typedef R type(typename decay<Args>::type..., Values...);
-};
-
-} // namespace detail
-} // namespace experimental
-
-#if !defined(GENERATING_DOCUMENTATION)
-
-template <typename CompletionToken, typename... Values, typename Signature>
-struct async_result<
- experimental::append_t<CompletionToken, Values...>, Signature>
- : async_result<CompletionToken,
- typename experimental::detail::append_signature<
- Signature, Values...>::type>
-{
- typedef typename experimental::detail::append_signature<
- Signature, Values...>::type signature;
-
- template <typename Initiation>
- struct init_wrapper
- {
- init_wrapper(Initiation init)
- : initiation_(ASIO_MOVE_CAST(Initiation)(init))
- {
- }
-
- template <typename Handler, typename... Args>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler,
- std::tuple<Values...> values,
- ASIO_MOVE_ARG(Args)... args)
- {
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- experimental::detail::append_handler<
- typename decay<Handler>::type, Values...>(
- ASIO_MOVE_CAST(Handler)(handler),
- ASIO_MOVE_CAST(std::tuple<Values...>)(values)),
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
- Initiation initiation_;
- };
-
- template <typename Initiation, typename RawCompletionToken, typename... Args>
- static ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, signature,
- (async_initiate<CompletionToken, signature>(
- declval<init_wrapper<typename decay<Initiation>::type> >(),
- declval<CompletionToken&>(),
- declval<std::tuple<Values...> >(),
- declval<ASIO_MOVE_ARG(Args)>()...)))
- initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
- {
- return async_initiate<CompletionToken, signature>(
- init_wrapper<typename decay<Initiation>::type>(
- ASIO_MOVE_CAST(Initiation)(initiation)),
- token.token_,
- ASIO_MOVE_CAST(std::tuple<Values...>)(token.values_),
- ASIO_MOVE_CAST(Args)(args)...);
- }
-};
-
-template <template <typename, typename> class Associator,
- typename Handler, typename DefaultCandidate>
-struct associator<Associator,
- experimental::detail::append_handler<Handler>, DefaultCandidate>
- : Associator<Handler, DefaultCandidate>
-{
- static typename Associator<Handler, DefaultCandidate>::type get(
- const experimental::detail::append_handler<Handler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
- {
- return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
- }
-};
-
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_IMPL_EXPERIMENTAL_APPEND_HPP
diff --git a/3rdparty/asio/include/asio/experimental/impl/as_single.hpp b/3rdparty/asio/include/asio/experimental/impl/as_single.hpp
index dce5f2a3052..d183cf5679e 100644
--- a/3rdparty/asio/include/asio/experimental/impl/as_single.hpp
+++ b/3rdparty/asio/include/asio/experimental/impl/as_single.hpp
@@ -2,7 +2,7 @@
// experimental/impl/as_single.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,16 +16,11 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
#include <tuple>
-
#include "asio/associator.hpp"
#include "asio/async_result.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/detail/push_options.hpp"
@@ -42,33 +37,32 @@ public:
template <typename CompletionToken>
as_single_handler(as_single_t<CompletionToken> e)
- : handler_(ASIO_MOVE_CAST(CompletionToken)(e.token_))
+ : handler_(static_cast<CompletionToken&&>(e.token_))
{
}
template <typename RedirectedHandler>
- as_single_handler(ASIO_MOVE_ARG(RedirectedHandler) h)
- : handler_(ASIO_MOVE_CAST(RedirectedHandler)(h))
+ as_single_handler(RedirectedHandler&& h)
+ : handler_(static_cast<RedirectedHandler&&>(h))
{
}
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)();
+ static_cast<Handler&&>(handler_)();
}
template <typename Arg>
- void operator()(ASIO_MOVE_ARG(Arg) arg)
+ void operator()(Arg&& arg)
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
- ASIO_MOVE_CAST(Arg)(arg));
+ static_cast<Handler&&>(handler_)(static_cast<Arg&&>(arg));
}
template <typename... Args>
- void operator()(ASIO_MOVE_ARG(Args)... args)
+ void operator()(Args&&... args)
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
- std::make_tuple(ASIO_MOVE_CAST(Args)(args)...));
+ static_cast<Handler&&>(handler_)(
+ std::make_tuple(static_cast<Args&&>(args)...));
}
//private:
@@ -76,32 +70,6 @@ public:
};
template <typename Handler>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- as_single_handler<Handler>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- as_single_handler<Handler>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
inline bool asio_handler_is_continuation(
as_single_handler<Handler>* this_handler)
{
@@ -109,30 +77,6 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- as_single_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- as_single_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Signature>
struct as_single_signature
{
@@ -154,7 +98,7 @@ struct as_single_signature<R(Arg)>
template <typename R, typename... Args>
struct as_single_signature<R(Args...)>
{
- typedef R type(std::tuple<typename decay<Args>::type...>);
+ typedef R type(std::tuple<decay_t<Args>...>);
};
} // namespace detail
@@ -165,44 +109,41 @@ struct as_single_signature<R(Args...)>
template <typename CompletionToken, typename Signature>
struct async_result<experimental::as_single_t<CompletionToken>, Signature>
{
- typedef typename async_result<CompletionToken,
- typename experimental::detail::as_single_signature<Signature>::type>
- ::return_type return_type;
-
template <typename Initiation>
struct init_wrapper
{
init_wrapper(Initiation init)
- : initiation_(ASIO_MOVE_CAST(Initiation)(init))
+ : initiation_(static_cast<Initiation&&>(init))
{
}
template <typename Handler, typename... Args>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Args)... args)
+ void operator()(Handler&& handler, Args&&... args)
{
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- experimental::detail::as_single_handler<
- typename decay<Handler>::type>(
- ASIO_MOVE_CAST(Handler)(handler)),
- ASIO_MOVE_CAST(Args)(args)...);
+ static_cast<Initiation&&>(initiation_)(
+ experimental::detail::as_single_handler<decay_t<Handler>>(
+ static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename experimental::detail::as_single_signature<Signature>::type>(
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, static_cast<Args&&>(args)...))
{
return async_initiate<CompletionToken,
typename experimental::detail::as_single_signature<Signature>::type>(
- init_wrapper<typename decay<Initiation>::type>(
- ASIO_MOVE_CAST(Initiation)(initiation)),
- token.token_, ASIO_MOVE_CAST(Args)(args)...);
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, static_cast<Args&&>(args)...);
}
};
@@ -213,8 +154,14 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const experimental::detail::as_single_handler<Handler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const experimental::detail::as_single_handler<Handler>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const experimental::detail::as_single_handler<Handler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
diff --git a/3rdparty/asio/include/asio/experimental/impl/as_tuple.hpp b/3rdparty/asio/include/asio/experimental/impl/as_tuple.hpp
deleted file mode 100644
index a1135de49dc..00000000000
--- a/3rdparty/asio/include/asio/experimental/impl/as_tuple.hpp
+++ /dev/null
@@ -1,246 +0,0 @@
-//
-// experimental/impl/as_tuple.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_IMPL_EXPERIMENTAL_AS_TUPLE_HPP
-#define ASIO_IMPL_EXPERIMENTAL_AS_TUPLE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#include <tuple>
-
-#include "asio/associator.hpp"
-#include "asio/async_result.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace experimental {
-namespace detail {
-
-// Class to adapt a as_tuple_t as a completion handler.
-template <typename Handler>
-class as_tuple_handler
-{
-public:
- typedef void result_type;
-
- template <typename CompletionToken>
- as_tuple_handler(as_tuple_t<CompletionToken> e)
- : handler_(ASIO_MOVE_CAST(CompletionToken)(e.token_))
- {
- }
-
- template <typename RedirectedHandler>
- as_tuple_handler(ASIO_MOVE_ARG(RedirectedHandler) h)
- : handler_(ASIO_MOVE_CAST(RedirectedHandler)(h))
- {
- }
-
- template <typename... Args>
- void operator()(ASIO_MOVE_ARG(Args)... args)
- {
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
- std::make_tuple(ASIO_MOVE_CAST(Args)(args)...));
- }
-
-//private:
- Handler handler_;
-};
-
-template <typename Handler>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- as_tuple_handler<Handler>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- as_tuple_handler<Handler>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
-inline bool asio_handler_is_continuation(
- as_tuple_handler<Handler>* this_handler)
-{
- return asio_handler_cont_helpers::is_continuation(
- this_handler->handler_);
-}
-
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- as_tuple_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- as_tuple_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Signature>
-struct as_tuple_signature;
-
-template <typename R, typename... Args>
-struct as_tuple_signature<R(Args...)>
-{
- typedef R type(std::tuple<typename decay<Args>::type...>);
-};
-
-#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-template <typename R, typename... Args>
-struct as_tuple_signature<R(Args...) &>
-{
- typedef R type(std::tuple<typename decay<Args>::type...>) &;
-};
-
-template <typename R, typename... Args>
-struct as_tuple_signature<R(Args...) &&>
-{
- typedef R type(std::tuple<typename decay<Args>::type...>) &&;
-};
-
-# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-
-template <typename R, typename... Args>
-struct as_tuple_signature<R(Args...) noexcept>
-{
- typedef R type(std::tuple<typename decay<Args>::type...>) noexcept;
-};
-
-template <typename R, typename... Args>
-struct as_tuple_signature<R(Args...) & noexcept>
-{
- typedef R type(std::tuple<typename decay<Args>::type...>) & noexcept;
-};
-
-template <typename R, typename... Args>
-struct as_tuple_signature<R(Args...) && noexcept>
-{
- typedef R type(std::tuple<typename decay<Args>::type...>) && noexcept;
-};
-
-# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-} // namespace detail
-} // namespace experimental
-
-#if !defined(GENERATING_DOCUMENTATION)
-
-template <typename CompletionToken, typename... Signatures>
-struct async_result<experimental::as_tuple_t<CompletionToken>, Signatures...>
- : async_result<CompletionToken,
- typename experimental::detail::as_tuple_signature<Signatures>::type...>
-{
- typedef async_result<CompletionToken,
- typename experimental::detail::as_tuple_signature<Signatures>::type...>
- base_async_result;
-
- template <typename Initiation>
- struct init_wrapper
- {
- init_wrapper(Initiation init)
- : initiation_(ASIO_MOVE_CAST(Initiation)(init))
- {
- }
-
- template <typename Handler, typename... Args>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Args)... args)
- {
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- experimental::detail::as_tuple_handler<
- typename decay<Handler>::type>(
- ASIO_MOVE_CAST(Handler)(handler)),
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
- Initiation initiation_;
- };
-
- template <typename Initiation, typename RawCompletionToken, typename... Args>
- static ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken,
- typename experimental::detail::as_tuple_signature<Signatures>::type...,
- (base_async_result::initiate(
- declval<init_wrapper<typename decay<Initiation>::type> >(),
- declval<CompletionToken>(),
- declval<ASIO_MOVE_ARG(Args)>()...)))
- initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
- {
- return base_async_result::initiate(
- init_wrapper<typename decay<Initiation>::type>(
- ASIO_MOVE_CAST(Initiation)(initiation)),
- token.token_, ASIO_MOVE_CAST(Args)(args)...);
- }
-};
-
-template <template <typename, typename> class Associator,
- typename Handler, typename DefaultCandidate>
-struct associator<Associator,
- experimental::detail::as_tuple_handler<Handler>, DefaultCandidate>
- : Associator<Handler, DefaultCandidate>
-{
- static typename Associator<Handler, DefaultCandidate>::type get(
- const experimental::detail::as_tuple_handler<Handler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
- {
- return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
- }
-};
-
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_IMPL_EXPERIMENTAL_AS_TUPLE_HPP
diff --git a/3rdparty/asio/include/asio/experimental/impl/channel_error.ipp b/3rdparty/asio/include/asio/experimental/impl/channel_error.ipp
new file mode 100644
index 00000000000..3f4b9829774
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/impl/channel_error.ipp
@@ -0,0 +1,61 @@
+//
+// experimental/impl/channel_error.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_EXPERIMENTAL_IMPL_CHANNEL_ERROR_IPP
+#define ASIO_EXPERIMENTAL_IMPL_CHANNEL_ERROR_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/experimental/channel_error.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace error {
+namespace detail {
+
+class channel_category : public asio::error_category
+{
+public:
+ const char* name() const noexcept
+ {
+ return "asio.channel";
+ }
+
+ std::string message(int value) const
+ {
+ switch (value)
+ {
+ case channel_closed: return "Channel closed";
+ case channel_cancelled: return "Channel cancelled";
+ default: return "asio.channel error";
+ }
+ }
+};
+
+} // namespace detail
+
+const asio::error_category& get_channel_category()
+{
+ static detail::channel_category instance;
+ return instance;
+}
+
+} // namespace error
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_IMPL_CHANNEL_ERROR_IPP
diff --git a/3rdparty/asio/include/asio/experimental/impl/co_composed.hpp b/3rdparty/asio/include/asio/experimental/impl/co_composed.hpp
new file mode 100644
index 00000000000..3eef2e2ee2c
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/impl/co_composed.hpp
@@ -0,0 +1,1174 @@
+//
+// experimental/impl/co_composed.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_EXPERIMENTAL_CO_COMPOSED_HPP
+#define ASIO_IMPL_EXPERIMENTAL_CO_COMPOSED_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <new>
+#include <tuple>
+#include <variant>
+#include "asio/associated_cancellation_slot.hpp"
+#include "asio/associator.hpp"
+#include "asio/async_result.hpp"
+#include "asio/cancellation_state.hpp"
+#include "asio/detail/composed_work.hpp"
+#include "asio/detail/recycling_allocator.hpp"
+#include "asio/detail/throw_error.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/error.hpp"
+
+#if defined(ASIO_HAS_STD_COROUTINE)
+# include <coroutine>
+#else // defined(ASIO_HAS_STD_COROUTINE)
+# include <experimental/coroutine>
+#endif // defined(ASIO_HAS_STD_COROUTINE)
+
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+# include "asio/detail/source_location.hpp"
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+namespace detail {
+
+#if defined(ASIO_HAS_STD_COROUTINE)
+using std::coroutine_handle;
+using std::suspend_always;
+using std::suspend_never;
+#else // defined(ASIO_HAS_STD_COROUTINE)
+using std::experimental::coroutine_handle;
+using std::experimental::suspend_always;
+using std::experimental::suspend_never;
+#endif // defined(ASIO_HAS_STD_COROUTINE)
+
+using asio::detail::composed_io_executors;
+using asio::detail::composed_work;
+using asio::detail::composed_work_guard;
+using asio::detail::get_composed_io_executor;
+using asio::detail::make_composed_io_executors;
+using asio::detail::recycling_allocator;
+using asio::detail::throw_error;
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_state;
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_handler_base;
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_promise;
+
+template <completion_signature... Signatures>
+class co_composed_returns
+{
+};
+
+struct co_composed_on_suspend
+{
+ void (*fn_)(void*) = nullptr;
+ void* arg_ = nullptr;
+};
+
+template <typename... T>
+struct co_composed_completion : std::tuple<T&&...>
+{
+ template <typename... U>
+ co_composed_completion(U&&... u) noexcept
+ : std::tuple<T&&...>(std::forward<U>(u)...)
+ {
+ }
+};
+
+template <typename Executors, typename Handler,
+ typename Return, typename Signature>
+class co_composed_state_return_overload;
+
+template <typename Executors, typename Handler,
+ typename Return, typename R, typename... Args>
+class co_composed_state_return_overload<
+ Executors, Handler, Return, R(Args...)>
+{
+public:
+ using derived_type = co_composed_state<Executors, Handler, Return>;
+ using promise_type = co_composed_promise<Executors, Handler, Return>;
+ using return_type = std::tuple<Args...>;
+
+ void on_cancellation_complete_with(Args... args)
+ {
+ derived_type& state = *static_cast<derived_type*>(this);
+ state.return_value_ = std::make_tuple(std::move(args)...);
+ state.cancellation_on_suspend_fn(
+ [](void* p)
+ {
+ auto& promise = *static_cast<promise_type*>(p);
+
+ co_composed_handler_base<Executors, Handler,
+ Return> composed_handler(promise);
+
+ Handler handler(std::move(promise.state().handler_));
+ return_type result(
+ std::move(std::get<return_type>(promise.state().return_value_)));
+
+ co_composed_handler_base<Executors, Handler,
+ Return>(std::move(composed_handler));
+
+ std::apply(std::move(handler), std::move(result));
+ });
+ }
+};
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_state_return;
+
+template <typename Executors, typename Handler, typename... Signatures>
+class co_composed_state_return<
+ Executors, Handler, co_composed_returns<Signatures...>>
+ : public co_composed_state_return_overload<Executors,
+ Handler, co_composed_returns<Signatures...>, Signatures>...
+{
+public:
+ using co_composed_state_return_overload<Executors,
+ Handler, co_composed_returns<Signatures...>,
+ Signatures>::on_cancellation_complete_with...;
+
+private:
+ template <typename, typename, typename, typename>
+ friend class co_composed_promise_return_overload;
+ template <typename, typename, typename, typename>
+ friend class co_composed_state_return_overload;
+
+ std::variant<std::monostate,
+ typename co_composed_state_return_overload<
+ Executors, Handler, co_composed_returns<Signatures...>,
+ Signatures>::return_type...> return_value_;
+};
+
+template <typename Executors, typename Handler,
+ typename Return, typename... Signatures>
+struct co_composed_state_default_cancellation_on_suspend_impl;
+
+template <typename Executors, typename Handler, typename Return>
+struct co_composed_state_default_cancellation_on_suspend_impl<
+ Executors, Handler, Return>
+{
+ static constexpr void (*fn())(void*)
+ {
+ return nullptr;
+ }
+};
+
+template <typename Executors, typename Handler, typename Return,
+ typename R, typename... Args, typename... Signatures>
+struct co_composed_state_default_cancellation_on_suspend_impl<
+ Executors, Handler, Return, R(Args...), Signatures...>
+{
+ static constexpr void (*fn())(void*)
+ {
+ return co_composed_state_default_cancellation_on_suspend_impl<
+ Executors, Handler, Return, Signatures...>::fn();
+ }
+};
+
+template <typename Executors, typename Handler, typename Return,
+ typename R, typename... Args, typename... Signatures>
+struct co_composed_state_default_cancellation_on_suspend_impl<Executors,
+ Handler, Return, R(asio::error_code, Args...), Signatures...>
+{
+ using promise_type = co_composed_promise<Executors, Handler, Return>;
+ using return_type = std::tuple<asio::error_code, Args...>;
+
+ static constexpr void (*fn())(void*)
+ {
+ if constexpr ((is_constructible<Args>::value && ...))
+ {
+ return [](void* p)
+ {
+ auto& promise = *static_cast<promise_type*>(p);
+
+ co_composed_handler_base<Executors, Handler,
+ Return> composed_handler(promise);
+
+ Handler handler(std::move(promise.state().handler_));
+
+ co_composed_handler_base<Executors, Handler,
+ Return>(std::move(composed_handler));
+
+ std::move(handler)(
+ asio::error_code(asio::error::operation_aborted),
+ Args{}...);
+ };
+ }
+ else
+ {
+ return co_composed_state_default_cancellation_on_suspend_impl<
+ Executors, Handler, Return, Signatures...>::fn();
+ }
+ }
+};
+
+template <typename Executors, typename Handler, typename Return,
+ typename R, typename... Args, typename... Signatures>
+struct co_composed_state_default_cancellation_on_suspend_impl<Executors,
+ Handler, Return, R(std::exception_ptr, Args...), Signatures...>
+{
+ using promise_type = co_composed_promise<Executors, Handler, Return>;
+ using return_type = std::tuple<std::exception_ptr, Args...>;
+
+ static constexpr void (*fn())(void*)
+ {
+ if constexpr ((is_constructible<Args>::value && ...))
+ {
+ return [](void* p)
+ {
+ auto& promise = *static_cast<promise_type*>(p);
+
+ co_composed_handler_base<Executors, Handler,
+ Return> composed_handler(promise);
+
+ Handler handler(std::move(promise.state().handler_));
+
+ co_composed_handler_base<Executors, Handler,
+ Return>(std::move(composed_handler));
+
+ std::move(handler)(
+ std::make_exception_ptr(
+ asio::system_error(
+ asio::error::operation_aborted, "co_await")),
+ Args{}...);
+ };
+ }
+ else
+ {
+ return co_composed_state_default_cancellation_on_suspend_impl<
+ Executors, Handler, Return, Signatures...>::fn();
+ }
+ }
+};
+
+template <typename Executors, typename Handler, typename Return>
+struct co_composed_state_default_cancellation_on_suspend;
+
+template <typename Executors, typename Handler, typename... Signatures>
+struct co_composed_state_default_cancellation_on_suspend<
+ Executors, Handler, co_composed_returns<Signatures...>>
+ : co_composed_state_default_cancellation_on_suspend_impl<Executors,
+ Handler, co_composed_returns<Signatures...>, Signatures...>
+{
+};
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_state_cancellation
+{
+public:
+ using cancellation_slot_type = cancellation_slot;
+
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return cancellation_state_.slot();
+ }
+
+ cancellation_state get_cancellation_state() const noexcept
+ {
+ return cancellation_state_;
+ }
+
+ void reset_cancellation_state()
+ {
+ cancellation_state_ = cancellation_state(
+ (get_associated_cancellation_slot)(
+ static_cast<co_composed_state<Executors, Handler, Return>*>(
+ this)->handler()));
+ }
+
+ template <typename Filter>
+ void reset_cancellation_state(Filter filter)
+ {
+ cancellation_state_ = cancellation_state(
+ (get_associated_cancellation_slot)(
+ static_cast<co_composed_state<Executors, Handler, Return>*>(
+ this)->handler()), filter, filter);
+ }
+
+ template <typename InFilter, typename OutFilter>
+ void reset_cancellation_state(InFilter&& in_filter, OutFilter&& out_filter)
+ {
+ cancellation_state_ = cancellation_state(
+ (get_associated_cancellation_slot)(
+ static_cast<co_composed_state<Executors, Handler, Return>*>(
+ this)->handler()),
+ std::forward<InFilter>(in_filter),
+ std::forward<OutFilter>(out_filter));
+ }
+
+ cancellation_type_t cancelled() const noexcept
+ {
+ return cancellation_state_.cancelled();
+ }
+
+ void clear_cancellation_slot() noexcept
+ {
+ cancellation_state_.slot().clear();
+ }
+
+ [[nodiscard]] bool throw_if_cancelled() const noexcept
+ {
+ return throw_if_cancelled_;
+ }
+
+ void throw_if_cancelled(bool b) noexcept
+ {
+ throw_if_cancelled_ = b;
+ }
+
+ [[nodiscard]] bool complete_if_cancelled() const noexcept
+ {
+ return complete_if_cancelled_;
+ }
+
+ void complete_if_cancelled(bool b) noexcept
+ {
+ complete_if_cancelled_ = b;
+ }
+
+private:
+ template <typename, typename, typename>
+ friend class co_composed_promise;
+ template <typename, typename, typename, typename>
+ friend class co_composed_state_return_overload;
+
+ void cancellation_on_suspend_fn(void (*fn)(void*))
+ {
+ cancellation_on_suspend_fn_ = fn;
+ }
+
+ void check_for_cancellation_on_transform()
+ {
+ if (throw_if_cancelled_ && !!cancelled())
+ throw_error(asio::error::operation_aborted, "co_await");
+ }
+
+ bool check_for_cancellation_on_suspend(
+ co_composed_promise<Executors, Handler, Return>& promise) noexcept
+ {
+ if (complete_if_cancelled_ && !!cancelled() && cancellation_on_suspend_fn_)
+ {
+ promise.state().work_.reset();
+ promise.state().on_suspend_->fn_ = cancellation_on_suspend_fn_;
+ promise.state().on_suspend_->arg_ = &promise;
+ return false;
+ }
+ return true;
+ }
+
+ cancellation_state cancellation_state_;
+ void (*cancellation_on_suspend_fn_)(void*) =
+ co_composed_state_default_cancellation_on_suspend<
+ Executors, Handler, Return>::fn();
+ bool throw_if_cancelled_ = false;
+ bool complete_if_cancelled_ = true;
+};
+
+template <typename Executors, typename Handler, typename Return>
+ requires is_same<
+ typename associated_cancellation_slot<
+ Handler, cancellation_slot
+ >::asio_associated_cancellation_slot_is_unspecialised,
+ void>::value
+class co_composed_state_cancellation<Executors, Handler, Return>
+{
+public:
+ void reset_cancellation_state()
+ {
+ }
+
+ template <typename Filter>
+ void reset_cancellation_state(Filter)
+ {
+ }
+
+ template <typename InFilter, typename OutFilter>
+ void reset_cancellation_state(InFilter&&, OutFilter&&)
+ {
+ }
+
+ cancellation_type_t cancelled() const noexcept
+ {
+ return cancellation_type::none;
+ }
+
+ void clear_cancellation_slot() noexcept
+ {
+ }
+
+ [[nodiscard]] bool throw_if_cancelled() const noexcept
+ {
+ return false;
+ }
+
+ void throw_if_cancelled(bool) noexcept
+ {
+ }
+
+ [[nodiscard]] bool complete_if_cancelled() const noexcept
+ {
+ return false;
+ }
+
+ void complete_if_cancelled(bool) noexcept
+ {
+ }
+
+private:
+ template <typename, typename, typename>
+ friend class co_composed_promise;
+ template <typename, typename, typename, typename>
+ friend class co_composed_state_return_overload;
+
+ void cancellation_on_suspend_fn(void (*)(void*))
+ {
+ }
+
+ void check_for_cancellation_on_transform() noexcept
+ {
+ }
+
+ bool check_for_cancellation_on_suspend(
+ co_composed_promise<Executors, Handler, Return>&) noexcept
+ {
+ return true;
+ }
+};
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_state
+ : public co_composed_state_return<Executors, Handler, Return>,
+ public co_composed_state_cancellation<Executors, Handler, Return>
+{
+public:
+ using io_executor_type = typename composed_work_guard<
+ typename composed_work<Executors>::head_type>::executor_type;
+
+ template <typename H>
+ co_composed_state(composed_io_executors<Executors>&& executors,
+ H&& h, co_composed_on_suspend& on_suspend)
+ : work_(std::move(executors)),
+ handler_(std::forward<H>(h)),
+ on_suspend_(&on_suspend)
+ {
+ this->reset_cancellation_state(enable_terminal_cancellation());
+ }
+
+ io_executor_type get_io_executor() const noexcept
+ {
+ return work_.head_.get_executor();
+ }
+
+ template <typename... Args>
+ [[nodiscard]] co_composed_completion<Args...> complete(Args&&... args)
+ requires requires { declval<Handler>()(std::forward<Args>(args)...); }
+ {
+ return co_composed_completion<Args...>(std::forward<Args>(args)...);
+ }
+
+ const Handler& handler() const noexcept
+ {
+ return handler_;
+ }
+
+private:
+ template <typename, typename, typename>
+ friend class co_composed_handler_base;
+ template <typename, typename, typename>
+ friend class co_composed_promise;
+ template <typename, typename, typename, typename>
+ friend class co_composed_promise_return_overload;
+ template <typename, typename, typename>
+ friend class co_composed_state_cancellation;
+ template <typename, typename, typename, typename>
+ friend class co_composed_state_return_overload;
+ template <typename, typename, typename, typename...>
+ friend struct co_composed_state_default_cancellation_on_suspend_impl;
+
+ composed_work<Executors> work_;
+ Handler handler_;
+ co_composed_on_suspend* on_suspend_;
+};
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_handler_cancellation
+{
+public:
+ using cancellation_slot_type = cancellation_slot;
+
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return static_cast<
+ const co_composed_handler_base<Executors, Handler, Return>*>(
+ this)->promise().state().get_cancellation_slot();
+ }
+};
+
+template <typename Executors, typename Handler, typename Return>
+ requires is_same<
+ typename associated_cancellation_slot<
+ Handler, cancellation_slot
+ >::asio_associated_cancellation_slot_is_unspecialised,
+ void>::value
+class co_composed_handler_cancellation<Executors, Handler, Return>
+{
+};
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_handler_base :
+ public co_composed_handler_cancellation<Executors, Handler, Return>
+{
+public:
+ co_composed_handler_base(
+ co_composed_promise<Executors, Handler, Return>& p) noexcept
+ : p_(&p)
+ {
+ }
+
+ co_composed_handler_base(co_composed_handler_base&& other) noexcept
+ : p_(std::exchange(other.p_, nullptr))
+ {
+ }
+
+ ~co_composed_handler_base()
+ {
+ if (p_) [[unlikely]]
+ p_->destroy();
+ }
+
+ co_composed_promise<Executors, Handler, Return>& promise() const noexcept
+ {
+ return *p_;
+ }
+
+protected:
+ void resume(void* result)
+ {
+ co_composed_on_suspend on_suspend{};
+ std::exchange(p_, nullptr)->resume(p_, result, on_suspend);
+ if (on_suspend.fn_)
+ on_suspend.fn_(on_suspend.arg_);
+ }
+
+private:
+ co_composed_promise<Executors, Handler, Return>* p_;
+};
+
+template <typename Executors, typename Handler,
+ typename Return, typename Signature>
+class co_composed_handler;
+
+template <typename Executors, typename Handler,
+ typename Return, typename R, typename... Args>
+class co_composed_handler<Executors, Handler, Return, R(Args...)>
+ : public co_composed_handler_base<Executors, Handler, Return>
+{
+public:
+ using co_composed_handler_base<Executors,
+ Handler, Return>::co_composed_handler_base;
+
+ using result_type = std::tuple<decay_t<Args>...>;
+
+ template <typename... T>
+ void operator()(T&&... args)
+ {
+ result_type result(std::forward<T>(args)...);
+ this->resume(&result);
+ }
+
+ static auto on_resume(void* result)
+ {
+ auto& args = *static_cast<result_type*>(result);
+ if constexpr (sizeof...(Args) == 0)
+ return;
+ else if constexpr (sizeof...(Args) == 1)
+ return std::move(std::get<0>(args));
+ else
+ return std::move(args);
+ }
+};
+
+template <typename Executors, typename Handler,
+ typename Return, typename R, typename... Args>
+class co_composed_handler<Executors, Handler,
+ Return, R(asio::error_code, Args...)>
+ : public co_composed_handler_base<Executors, Handler, Return>
+{
+public:
+ using co_composed_handler_base<Executors,
+ Handler, Return>::co_composed_handler_base;
+
+ using args_type = std::tuple<decay_t<Args>...>;
+ using result_type = std::tuple<asio::error_code, args_type>;
+
+ template <typename... T>
+ void operator()(const asio::error_code& ec, T&&... args)
+ {
+ result_type result(ec, args_type(std::forward<T>(args)...));
+ this->resume(&result);
+ }
+
+ static auto on_resume(void* result)
+ {
+ auto& [ec, args] = *static_cast<result_type*>(result);
+ throw_error(ec);
+ if constexpr (sizeof...(Args) == 0)
+ return;
+ else if constexpr (sizeof...(Args) == 1)
+ return std::move(std::get<0>(args));
+ else
+ return std::move(args);
+ }
+};
+
+template <typename Executors, typename Handler,
+ typename Return, typename R, typename... Args>
+class co_composed_handler<Executors, Handler,
+ Return, R(std::exception_ptr, Args...)>
+ : public co_composed_handler_base<Executors, Handler, Return>
+{
+public:
+ using co_composed_handler_base<Executors,
+ Handler, Return>::co_composed_handler_base;
+
+ using args_type = std::tuple<decay_t<Args>...>;
+ using result_type = std::tuple<std::exception_ptr, args_type>;
+
+ template <typename... T>
+ void operator()(std::exception_ptr ex, T&&... args)
+ {
+ result_type result(std::move(ex), args_type(std::forward<T>(args)...));
+ this->resume(&result);
+ }
+
+ static auto on_resume(void* result)
+ {
+ auto& [ex, args] = *static_cast<result_type*>(result);
+ if (ex)
+ std::rethrow_exception(ex);
+ if constexpr (sizeof...(Args) == 0)
+ return;
+ else if constexpr (sizeof...(Args) == 1)
+ return std::move(std::get<0>(args));
+ else
+ return std::move(args);
+ }
+};
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_promise_return;
+
+template <typename Executors, typename Handler>
+class co_composed_promise_return<Executors, Handler, co_composed_returns<>>
+{
+public:
+ auto final_suspend() noexcept
+ {
+ return suspend_never();
+ }
+
+ void return_void() noexcept
+ {
+ }
+};
+
+template <typename Executors, typename Handler,
+ typename Return, typename Signature>
+class co_composed_promise_return_overload;
+
+template <typename Executors, typename Handler,
+ typename Return, typename R, typename... Args>
+class co_composed_promise_return_overload<
+ Executors, Handler, Return, R(Args...)>
+{
+public:
+ using derived_type = co_composed_promise<Executors, Handler, Return>;
+ using return_type = std::tuple<Args...>;
+
+ void return_value(std::tuple<Args...>&& value)
+ {
+ derived_type& promise = *static_cast<derived_type*>(this);
+ promise.state().return_value_ = std::move(value);
+ promise.state().work_.reset();
+ promise.state().on_suspend_->arg_ = this;
+ promise.state().on_suspend_->fn_ =
+ [](void* p)
+ {
+ auto& promise = *static_cast<derived_type*>(p);
+
+ co_composed_handler_base<Executors, Handler,
+ Return> composed_handler(promise);
+
+ Handler handler(std::move(promise.state().handler_));
+ return_type result(
+ std::move(std::get<return_type>(promise.state().return_value_)));
+
+ co_composed_handler_base<Executors, Handler,
+ Return>(std::move(composed_handler));
+
+ std::apply(std::move(handler), std::move(result));
+ };
+ }
+};
+
+template <typename Executors, typename Handler, typename... Signatures>
+class co_composed_promise_return<Executors,
+ Handler, co_composed_returns<Signatures...>>
+ : public co_composed_promise_return_overload<Executors,
+ Handler, co_composed_returns<Signatures...>, Signatures>...
+{
+public:
+ auto final_suspend() noexcept
+ {
+ return suspend_always();
+ }
+
+ using co_composed_promise_return_overload<Executors, Handler,
+ co_composed_returns<Signatures...>, Signatures>::return_value...;
+
+private:
+ template <typename, typename, typename, typename>
+ friend class co_composed_promise_return_overload;
+};
+
+template <typename Executors, typename Handler, typename Return>
+class co_composed_promise
+ : public co_composed_promise_return<Executors, Handler, Return>
+{
+public:
+ template <typename... Args>
+ void* operator new(std::size_t size,
+ co_composed_state<Executors, Handler, Return>& state, Args&&...)
+ {
+ block_allocator_type allocator(
+ (get_associated_allocator)(state.handler_,
+ recycling_allocator<void>()));
+
+ block* base_ptr = std::allocator_traits<block_allocator_type>::allocate(
+ allocator, blocks(sizeof(allocator_type)) + blocks(size));
+
+ new (static_cast<void*>(base_ptr)) allocator_type(std::move(allocator));
+
+ return base_ptr + blocks(sizeof(allocator_type));
+ }
+
+ template <typename C, typename... Args>
+ void* operator new(std::size_t size, C&&,
+ co_composed_state<Executors, Handler, Return>& state, Args&&...)
+ {
+ return co_composed_promise::operator new(size, state);
+ }
+
+ void operator delete(void* ptr, std::size_t size)
+ {
+ block* base_ptr = static_cast<block*>(ptr) - blocks(sizeof(allocator_type));
+
+ allocator_type* allocator_ptr = std::launder(
+ static_cast<allocator_type*>(static_cast<void*>(base_ptr)));
+
+ block_allocator_type block_allocator(std::move(*allocator_ptr));
+ allocator_ptr->~allocator_type();
+
+ std::allocator_traits<block_allocator_type>::deallocate(block_allocator,
+ base_ptr, blocks(sizeof(allocator_type)) + blocks(size));
+ }
+
+ template <typename... Args>
+ co_composed_promise(
+ co_composed_state<Executors, Handler, Return>& state, Args&&...)
+ : state_(state)
+ {
+ }
+
+ template <typename C, typename... Args>
+ co_composed_promise(C&&,
+ co_composed_state<Executors, Handler, Return>& state, Args&&...)
+ : state_(state)
+ {
+ }
+
+ void destroy() noexcept
+ {
+ coroutine_handle<co_composed_promise>::from_promise(*this).destroy();
+ }
+
+ void resume(co_composed_promise*& owner, void* result,
+ co_composed_on_suspend& on_suspend)
+ {
+ state_.on_suspend_ = &on_suspend;
+ state_.clear_cancellation_slot();
+ owner_ = &owner;
+ result_ = result;
+ coroutine_handle<co_composed_promise>::from_promise(*this).resume();
+ }
+
+ co_composed_state<Executors, Handler, Return>& state() noexcept
+ {
+ return state_;
+ }
+
+ void get_return_object() noexcept
+ {
+ }
+
+ auto initial_suspend() noexcept
+ {
+ return suspend_never();
+ }
+
+ void unhandled_exception()
+ {
+ if (owner_)
+ *owner_ = this;
+ throw;
+ }
+
+ template <async_operation Op>
+ auto await_transform(Op&& op
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , asio::detail::source_location location
+ = asio::detail::source_location::current()
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ )
+ {
+ class [[nodiscard]] awaitable
+ {
+ public:
+ awaitable(Op&& op, co_composed_promise& promise
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , const asio::detail::source_location& location
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ )
+ : op_(std::forward<Op>(op)),
+ promise_(promise)
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , location_(location)
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ {
+ }
+
+ constexpr bool await_ready() const noexcept
+ {
+ return false;
+ }
+
+ void await_suspend(coroutine_handle<co_composed_promise>)
+ {
+ if (promise_.state_.check_for_cancellation_on_suspend(promise_))
+ {
+ promise_.state_.on_suspend_->arg_ = this;
+ promise_.state_.on_suspend_->fn_ =
+ [](void* p)
+ {
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ ASIO_HANDLER_LOCATION((
+ static_cast<awaitable*>(p)->location_.file_name(),
+ static_cast<awaitable*>(p)->location_.line(),
+ static_cast<awaitable*>(p)->location_.function_name()));
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ std::forward<Op>(static_cast<awaitable*>(p)->op_)(
+ co_composed_handler<Executors, Handler,
+ Return, completion_signature_of_t<Op>>(
+ static_cast<awaitable*>(p)->promise_));
+ };
+ }
+ }
+
+ auto await_resume()
+ {
+ return co_composed_handler<Executors, Handler, Return,
+ completion_signature_of_t<Op>>::on_resume(promise_.result_);
+ }
+
+ private:
+ Op&& op_;
+ co_composed_promise& promise_;
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ asio::detail::source_location location_;
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ };
+
+ state_.check_for_cancellation_on_transform();
+ return awaitable{std::forward<Op>(op), *this
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , location
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ };
+ }
+
+ template <typename... Args>
+ auto yield_value(co_composed_completion<Args...>&& result)
+ {
+ class [[nodiscard]] awaitable
+ {
+ public:
+ awaitable(co_composed_completion<Args...>&& result,
+ co_composed_promise& promise)
+ : result_(std::move(result)),
+ promise_(promise)
+ {
+ }
+
+ constexpr bool await_ready() const noexcept
+ {
+ return false;
+ }
+
+ void await_suspend(coroutine_handle<co_composed_promise>)
+ {
+ promise_.state_.work_.reset();
+ promise_.state_.on_suspend_->arg_ = this;
+ promise_.state_.on_suspend_->fn_ =
+ [](void* p)
+ {
+ awaitable& a = *static_cast<awaitable*>(p);
+
+ co_composed_handler_base<Executors, Handler,
+ Return> composed_handler(a.promise_);
+
+ Handler handler(std::move(a.promise_.state_.handler_));
+ std::tuple<decay_t<Args>...> result(
+ std::move(static_cast<std::tuple<Args&&...>>(a.result_)));
+
+ co_composed_handler_base<Executors, Handler,
+ Return>(std::move(composed_handler));
+
+ std::apply(std::move(handler), std::move(result));
+ };
+ }
+
+ void await_resume() noexcept
+ {
+ }
+
+ private:
+ co_composed_completion<Args...> result_;
+ co_composed_promise& promise_;
+ };
+
+ return awaitable{std::move(result), *this};
+ }
+
+private:
+ using allocator_type =
+ associated_allocator_t<Handler, recycling_allocator<void>>;
+
+ union block
+ {
+ std::max_align_t max_align;
+ alignas(allocator_type) char pad[alignof(allocator_type)];
+ };
+
+ using block_allocator_type =
+ typename std::allocator_traits<allocator_type>
+ ::template rebind_alloc<block>;
+
+ static constexpr std::size_t blocks(std::size_t size)
+ {
+ return (size + sizeof(block) - 1) / sizeof(block);
+ }
+
+ co_composed_state<Executors, Handler, Return>& state_;
+ co_composed_promise** owner_ = nullptr;
+ void* result_ = nullptr;
+};
+
+template <typename Implementation, typename Executors, typename... Signatures>
+class initiate_co_composed
+{
+public:
+ using executor_type = typename composed_io_executors<Executors>::head_type;
+
+ template <typename I>
+ initiate_co_composed(I&& impl, composed_io_executors<Executors>&& executors)
+ : implementation_(std::forward<I>(impl)),
+ executors_(std::move(executors))
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return executors_.head_;
+ }
+
+ template <typename Handler, typename... InitArgs>
+ void operator()(Handler&& handler, InitArgs&&... init_args) const &
+ {
+ using handler_type = decay_t<Handler>;
+ using returns_type = co_composed_returns<Signatures...>;
+ co_composed_on_suspend on_suspend{};
+ implementation_(
+ co_composed_state<Executors, handler_type, returns_type>(
+ executors_, std::forward<Handler>(handler), on_suspend),
+ std::forward<InitArgs>(init_args)...);
+ if (on_suspend.fn_)
+ on_suspend.fn_(on_suspend.arg_);
+ }
+
+ template <typename Handler, typename... InitArgs>
+ void operator()(Handler&& handler, InitArgs&&... init_args) &&
+ {
+ using handler_type = decay_t<Handler>;
+ using returns_type = co_composed_returns<Signatures...>;
+ co_composed_on_suspend on_suspend{};
+ std::move(implementation_)(
+ co_composed_state<Executors, handler_type, returns_type>(
+ std::move(executors_), std::forward<Handler>(handler), on_suspend),
+ std::forward<InitArgs>(init_args)...);
+ if (on_suspend.fn_)
+ on_suspend.fn_(on_suspend.arg_);
+ }
+
+private:
+ Implementation implementation_;
+ composed_io_executors<Executors> executors_;
+};
+
+template <typename... Signatures, typename Implementation, typename Executors>
+inline initiate_co_composed<Implementation, Executors, Signatures...>
+make_initiate_co_composed(Implementation&& implementation,
+ composed_io_executors<Executors>&& executors)
+{
+ return initiate_co_composed<
+ decay_t<Implementation>, Executors, Signatures...>(
+ std::forward<Implementation>(implementation), std::move(executors));
+}
+
+} // namespace detail
+
+template <completion_signature... Signatures,
+ typename Implementation, typename... IoObjectsOrExecutors>
+inline auto co_composed(Implementation&& implementation,
+ IoObjectsOrExecutors&&... io_objects_or_executors)
+{
+ return detail::make_initiate_co_composed<Signatures...>(
+ std::forward<Implementation>(implementation),
+ detail::make_composed_io_executors(
+ detail::get_composed_io_executor(
+ std::forward<IoObjectsOrExecutors>(
+ io_objects_or_executors))...));
+}
+
+} // namespace experimental
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <template <typename, typename> class Associator,
+ typename Executors, typename Handler, typename Return,
+ typename Signature, typename DefaultCandidate>
+struct associator<Associator,
+ experimental::detail::co_composed_handler<
+ Executors, Handler, Return, Signature>,
+ DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const experimental::detail::co_composed_handler<
+ Executors, Handler, Return, Signature>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(
+ h.promise().state().handler());
+ }
+
+ static auto get(
+ const experimental::detail::co_composed_handler<
+ Executors, Handler, Return, Signature>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(
+ Associator<Handler, DefaultCandidate>::get(
+ h.promise().state().handler(), c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(
+ h.promise().state().handler(), c);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#if !defined(GENERATING_DOCUMENTATION)
+# if defined(ASIO_HAS_STD_COROUTINE)
+namespace std {
+# else // defined(ASIO_HAS_STD_COROUTINE)
+namespace std { namespace experimental {
+# endif // defined(ASIO_HAS_STD_COROUTINE)
+
+template <typename C, typename Executors,
+ typename Handler, typename Return, typename... Args>
+struct coroutine_traits<void, C&,
+ asio::experimental::detail::co_composed_state<
+ Executors, Handler, Return>,
+ Args...>
+{
+ using promise_type =
+ asio::experimental::detail::co_composed_promise<
+ Executors, Handler, Return>;
+};
+
+template <typename C, typename Executors,
+ typename Handler, typename Return, typename... Args>
+struct coroutine_traits<void, C&&,
+ asio::experimental::detail::co_composed_state<
+ Executors, Handler, Return>,
+ Args...>
+{
+ using promise_type =
+ asio::experimental::detail::co_composed_promise<
+ Executors, Handler, Return>;
+};
+
+template <typename Executors, typename Handler,
+ typename Return, typename... Args>
+struct coroutine_traits<void,
+ asio::experimental::detail::co_composed_state<
+ Executors, Handler, Return>,
+ Args...>
+{
+ using promise_type =
+ asio::experimental::detail::co_composed_promise<
+ Executors, Handler, Return>;
+};
+
+# if defined(ASIO_HAS_STD_COROUTINE)
+} // namespace std
+# else // defined(ASIO_HAS_STD_COROUTINE)
+}} // namespace std::experimental
+# endif // defined(ASIO_HAS_STD_COROUTINE)
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_IMPL_EXPERIMENTAL_CO_COMPOSED_HPP
diff --git a/3rdparty/asio/include/asio/experimental/impl/coro.hpp b/3rdparty/asio/include/asio/experimental/impl/coro.hpp
new file mode 100644
index 00000000000..872d1a0255c
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/impl/coro.hpp
@@ -0,0 +1,1222 @@
+//
+// experimental/impl/coro.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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 ASIO_EXPERIMENTAL_IMPL_CORO_HPP
+#define ASIO_EXPERIMENTAL_IMPL_CORO_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/append.hpp"
+#include "asio/associated_cancellation_slot.hpp"
+#include "asio/bind_allocator.hpp"
+#include "asio/deferred.hpp"
+#include "asio/experimental/detail/coro_completion_handler.hpp"
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+
+template <typename Yield, typename Return,
+ typename Executor, typename Allocator>
+struct coro;
+
+namespace detail {
+
+struct coro_cancellation_source
+{
+ cancellation_slot slot;
+ cancellation_state state;
+ bool throw_if_cancelled_ = true;
+
+ void reset_cancellation_state()
+ {
+ state = cancellation_state(slot);
+ }
+
+ template <typename Filter>
+ void reset_cancellation_state(Filter&& filter)
+ {
+ state = cancellation_state(slot, static_cast<Filter&&>(filter));
+ }
+
+ template <typename InFilter, typename OutFilter>
+ void reset_cancellation_state(InFilter&& in_filter,
+ OutFilter&& out_filter)
+ {
+ state = cancellation_state(slot,
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter));
+ }
+
+ bool throw_if_cancelled() const
+ {
+ return throw_if_cancelled_;
+ }
+
+ void throw_if_cancelled(bool value)
+ {
+ throw_if_cancelled_ = value;
+ }
+};
+
+template <typename Signature, typename Return,
+ typename Executor, typename Allocator>
+struct coro_promise;
+
+template <typename T>
+struct is_noexcept : std::false_type
+{
+};
+
+template <typename Return, typename... Args>
+struct is_noexcept<Return(Args...)> : std::false_type
+{
+};
+
+template <typename Return, typename... Args>
+struct is_noexcept<Return(Args...) noexcept> : std::true_type
+{
+};
+
+template <typename T>
+constexpr bool is_noexcept_v = is_noexcept<T>::value;
+
+template <typename T>
+struct coro_error;
+
+template <>
+struct coro_error<asio::error_code>
+{
+ static asio::error_code invalid()
+ {
+ return asio::error::fault;
+ }
+
+ static asio::error_code cancelled()
+ {
+ return asio::error::operation_aborted;
+ }
+
+ static asio::error_code interrupted()
+ {
+ return asio::error::interrupted;
+ }
+
+ static asio::error_code done()
+ {
+ return asio::error::broken_pipe;
+ }
+};
+
+template <>
+struct coro_error<std::exception_ptr>
+{
+ static std::exception_ptr invalid()
+ {
+ return std::make_exception_ptr(
+ asio::system_error(
+ coro_error<asio::error_code>::invalid()));
+ }
+
+ static std::exception_ptr cancelled()
+ {
+ return std::make_exception_ptr(
+ asio::system_error(
+ coro_error<asio::error_code>::cancelled()));
+ }
+
+ static std::exception_ptr interrupted()
+ {
+ return std::make_exception_ptr(
+ asio::system_error(
+ coro_error<asio::error_code>::interrupted()));
+ }
+
+ static std::exception_ptr done()
+ {
+ return std::make_exception_ptr(
+ asio::system_error(
+ coro_error<asio::error_code>::done()));
+ }
+};
+
+template <typename T, typename Coroutine >
+struct coro_with_arg
+{
+ using coro_t = Coroutine;
+ T value;
+ coro_t& coro;
+
+ struct awaitable_t
+ {
+ T value;
+ coro_t& coro;
+
+ constexpr static bool await_ready() { return false; }
+
+ template <typename Y, typename R, typename E, typename A>
+ auto await_suspend(coroutine_handle<coro_promise<Y, R, E, A>> h)
+ -> coroutine_handle<>
+ {
+ auto& hp = h.promise();
+
+ if constexpr (!coro_promise<Y, R, E, A>::is_noexcept)
+ {
+ if ((hp.cancel->state.cancelled() != cancellation_type::none)
+ && hp.cancel->throw_if_cancelled_)
+ {
+ asio::detail::throw_error(
+ asio::error::operation_aborted, "coro-cancelled");
+ }
+ }
+
+ if (hp.get_executor() == coro.get_executor())
+ {
+ coro.coro_->awaited_from = h;
+ coro.coro_->reset_error();
+ coro.coro_->input_ = std::move(value);
+ coro.coro_->cancel = hp.cancel;
+ return coro.coro_->get_handle();
+ }
+ else
+ {
+ coro.coro_->awaited_from =
+ dispatch_coroutine(
+ asio::prefer(hp.get_executor(),
+ execution::outstanding_work.tracked),
+ [h]() mutable { h.resume(); }).handle;
+
+ coro.coro_->reset_error();
+ coro.coro_->input_ = std::move(value);
+
+ struct cancel_handler
+ {
+ using src = std::pair<cancellation_signal,
+ detail::coro_cancellation_source>;
+
+ std::shared_ptr<src> st = std::make_shared<src>();
+
+ cancel_handler(E e, coro_t& coro) : e(e), coro_(coro.coro_)
+ {
+ st->second.state =
+ cancellation_state(st->second.slot = st->first.slot());
+ }
+
+ E e;
+ typename coro_t::promise_type* coro_;
+
+ void operator()(cancellation_type ct)
+ {
+ asio::dispatch(e, [ct, st = st]() mutable
+ {
+ auto & [sig, state] = *st;
+ sig.emit(ct);
+ });
+ }
+ };
+
+ if (hp.cancel->state.slot().is_connected())
+ {
+ hp.cancel->state.slot().template emplace<cancel_handler>(
+ coro.get_executor(), coro);
+ }
+
+ auto hh = detail::coroutine_handle<
+ typename coro_t::promise_type>::from_promise(*coro.coro_);
+
+ return dispatch_coroutine(
+ coro.coro_->get_executor(), [hh]() mutable { hh.resume(); }).handle;
+ }
+ }
+
+ auto await_resume() -> typename coro_t::result_type
+ {
+ coro.coro_->cancel = nullptr;
+ coro.coro_->rethrow_if();
+ return std::move(coro.coro_->result_);
+ }
+ };
+
+ template <typename CompletionToken>
+ auto async_resume(CompletionToken&& token) &&
+ {
+ return coro.async_resume(std::move(value),
+ std::forward<CompletionToken>(token));
+ }
+
+ auto operator co_await() &&
+ {
+ return awaitable_t{std::move(value), coro};
+ }
+};
+
+template <bool IsNoexcept>
+struct coro_promise_error;
+
+template <>
+struct coro_promise_error<false>
+{
+ std::exception_ptr error_;
+
+ void reset_error()
+ {
+ error_ = std::exception_ptr{};
+ }
+
+ void unhandled_exception()
+ {
+ error_ = std::current_exception();
+ }
+
+ void rethrow_if()
+ {
+ if (error_)
+ std::rethrow_exception(error_);
+ }
+};
+
+#if defined(__GNUC__)
+# pragma GCC diagnostic push
+# if defined(__clang__)
+# pragma GCC diagnostic ignored "-Wexceptions"
+# else
+# pragma GCC diagnostic ignored "-Wterminate"
+# endif
+#elif defined(_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4297)
+#endif
+
+template <>
+struct coro_promise_error<true>
+{
+ void reset_error()
+ {
+ }
+
+ void unhandled_exception() noexcept
+ {
+ throw;
+ }
+
+ void rethrow_if()
+ {
+ }
+};
+
+#if defined(__GNUC__)
+# pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+# pragma warning(pop)
+#endif
+
+template <typename T = void>
+struct yield_input
+{
+ T& value;
+ coroutine_handle<> awaited_from{noop_coroutine()};
+
+ bool await_ready() const noexcept
+ {
+ return false;
+ }
+
+ template <typename U>
+ coroutine_handle<> await_suspend(coroutine_handle<U>) noexcept
+ {
+ return std::exchange(awaited_from, noop_coroutine());
+ }
+
+ T await_resume() const noexcept
+ {
+ return std::move(value);
+ }
+};
+
+template <>
+struct yield_input<void>
+{
+ coroutine_handle<> awaited_from{noop_coroutine()};
+
+ bool await_ready() const noexcept
+ {
+ return false;
+ }
+
+ auto await_suspend(coroutine_handle<>) noexcept
+ {
+ return std::exchange(awaited_from, noop_coroutine());
+ }
+
+ constexpr void await_resume() const noexcept
+ {
+ }
+};
+
+struct coro_awaited_from
+{
+ coroutine_handle<> awaited_from{noop_coroutine()};
+
+ auto final_suspend() noexcept
+ {
+ struct suspendor
+ {
+ coroutine_handle<> awaited_from;
+
+ constexpr static bool await_ready() noexcept
+ {
+ return false;
+ }
+
+ auto await_suspend(coroutine_handle<>) noexcept
+ {
+ return std::exchange(awaited_from, noop_coroutine());
+ }
+
+ constexpr static void await_resume() noexcept
+ {
+ }
+ };
+
+ return suspendor{std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ ~coro_awaited_from()
+ {
+ awaited_from.resume();
+ }//must be on the right executor
+};
+
+template <typename Yield, typename Input, typename Return>
+struct coro_promise_exchange : coro_awaited_from
+{
+ using result_type = coro_result_t<Yield, Return>;
+
+ result_type result_;
+ Input input_;
+
+ auto yield_value(Yield&& y)
+ {
+ result_ = std::move(y);
+ return yield_input<Input>{std::move(input_),
+ std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ auto yield_value(const Yield& y)
+ {
+ result_ = y;
+ return yield_input<Input>{std::move(input_),
+ std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ void return_value(const Return& r)
+ {
+ result_ = r;
+ }
+
+ void return_value(Return&& r)
+ {
+ result_ = std::move(r);
+ }
+};
+
+template <typename YieldReturn>
+struct coro_promise_exchange<YieldReturn, void, YieldReturn> : coro_awaited_from
+{
+ using result_type = coro_result_t<YieldReturn, YieldReturn>;
+
+ result_type result_;
+
+ auto yield_value(const YieldReturn& y)
+ {
+ result_ = y;
+ return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ auto yield_value(YieldReturn&& y)
+ {
+ result_ = std::move(y);
+ return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ void return_value(const YieldReturn& r)
+ {
+ result_ = r;
+ }
+
+ void return_value(YieldReturn&& r)
+ {
+ result_ = std::move(r);
+ }
+};
+
+template <typename Yield, typename Return>
+struct coro_promise_exchange<Yield, void, Return> : coro_awaited_from
+{
+ using result_type = coro_result_t<Yield, Return>;
+
+ result_type result_;
+
+ auto yield_value(const Yield& y)
+ {
+ result_.template emplace<0>(y);
+ return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ auto yield_value(Yield&& y)
+ {
+ result_.template emplace<0>(std::move(y));
+ return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ void return_value(const Return& r)
+ {
+ result_.template emplace<1>(r);
+ }
+
+ void return_value(Return&& r)
+ {
+ result_.template emplace<1>(std::move(r));
+ }
+};
+
+template <typename Yield, typename Input>
+struct coro_promise_exchange<Yield, Input, void> : coro_awaited_from
+{
+ using result_type = coro_result_t<Yield, void>;
+
+ result_type result_;
+ Input input_;
+
+ auto yield_value(Yield&& y)
+ {
+ result_ = std::move(y);
+ return yield_input<Input>{input_,
+ std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ auto yield_value(const Yield& y)
+ {
+ result_ = y;
+ return yield_input<Input>{input_,
+ std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ void return_void()
+ {
+ result_.reset();
+ }
+};
+
+template <typename Return>
+struct coro_promise_exchange<void, void, Return> : coro_awaited_from
+{
+ using result_type = coro_result_t<void, Return>;
+
+ result_type result_;
+
+ void yield_value();
+
+ void return_value(const Return& r)
+ {
+ result_ = r;
+ }
+
+ void return_value(Return&& r)
+ {
+ result_ = std::move(r);
+ }
+};
+
+template <>
+struct coro_promise_exchange<void, void, void> : coro_awaited_from
+{
+ void return_void() {}
+
+ void yield_value();
+};
+
+template <typename Yield>
+struct coro_promise_exchange<Yield, void, void> : coro_awaited_from
+{
+ using result_type = coro_result_t<Yield, void>;
+
+ result_type result_;
+
+ auto yield_value(const Yield& y)
+ {
+ result_ = y;
+ return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ auto yield_value(Yield&& y)
+ {
+ result_ = std::move(y);
+ return yield_input<void>{std::exchange(awaited_from, noop_coroutine())};
+ }
+
+ void return_void()
+ {
+ result_.reset();
+ }
+};
+
+template <typename Yield, typename Return,
+ typename Executor, typename Allocator>
+struct coro_promise final :
+ coro_promise_allocator<Allocator>,
+ coro_promise_error<coro_traits<Yield, Return, Executor>::is_noexcept>,
+ coro_promise_exchange<
+ typename coro_traits<Yield, Return, Executor>::yield_type,
+ typename coro_traits<Yield, Return, Executor>::input_type,
+ typename coro_traits<Yield, Return, Executor>::return_type>
+{
+ using coro_type = coro<Yield, Return, Executor, Allocator>;
+
+ auto handle()
+ {
+ return coroutine_handle<coro_promise>::from_promise(this);
+ }
+
+ using executor_type = Executor;
+
+ executor_type executor_;
+
+ std::optional<coro_cancellation_source> cancel_source;
+ coro_cancellation_source * cancel;
+
+ using cancellation_slot_type = asio::cancellation_slot;
+
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return cancel ? cancel->slot : cancellation_slot_type{};
+ }
+
+ using allocator_type =
+ typename std::allocator_traits<associated_allocator_t<Executor>>::
+ template rebind_alloc<std::byte>;
+ using traits = coro_traits<Yield, Return, Executor>;
+
+ using input_type = typename traits::input_type;
+ using yield_type = typename traits::yield_type;
+ using return_type = typename traits::return_type;
+ using error_type = typename traits::error_type;
+ using result_type = typename traits::result_type;
+ constexpr static bool is_noexcept = traits::is_noexcept;
+
+ auto get_executor() const -> Executor
+ {
+ return executor_;
+ }
+
+ auto get_handle()
+ {
+ return coroutine_handle<coro_promise>::from_promise(*this);
+ }
+
+ template <typename... Args>
+ coro_promise(Executor executor, Args&&... args) noexcept
+ : coro_promise_allocator<Allocator>(
+ executor, std::forward<Args>(args)...),
+ executor_(std::move(executor))
+ {
+ }
+
+ template <typename First, typename... Args>
+ coro_promise(First&& f, Executor executor, Args&&... args) noexcept
+ : coro_promise_allocator<Allocator>(
+ f, executor, std::forward<Args>(args)...),
+ executor_(std::move(executor))
+ {
+ }
+
+ template <typename First, detail::execution_context Context, typename... Args>
+ coro_promise(First&& f, Context&& ctx, Args&&... args) noexcept
+ : coro_promise_allocator<Allocator>(
+ f, ctx, std::forward<Args>(args)...),
+ executor_(ctx.get_executor())
+ {
+ }
+
+ template <detail::execution_context Context, typename... Args>
+ coro_promise(Context&& ctx, Args&&... args) noexcept
+ : coro_promise_allocator<Allocator>(
+ ctx, std::forward<Args>(args)...),
+ executor_(ctx.get_executor())
+ {
+ }
+
+ auto get_return_object()
+ {
+ return coro<Yield, Return, Executor, Allocator>{this};
+ }
+
+ auto initial_suspend() noexcept
+ {
+ return suspend_always{};
+ }
+
+ using coro_promise_exchange<
+ typename coro_traits<Yield, Return, Executor>::yield_type,
+ typename coro_traits<Yield, Return, Executor>::input_type,
+ typename coro_traits<Yield, Return, Executor>::return_type>::yield_value;
+
+ auto await_transform(this_coro::executor_t) const
+ {
+ struct exec_helper
+ {
+ const executor_type& value;
+
+ constexpr static bool await_ready() noexcept
+ {
+ return true;
+ }
+
+ constexpr static void await_suspend(coroutine_handle<>) noexcept
+ {
+ }
+
+ executor_type await_resume() const noexcept
+ {
+ return value;
+ }
+ };
+
+ return exec_helper{executor_};
+ }
+
+ auto await_transform(this_coro::cancellation_state_t) const
+ {
+ struct exec_helper
+ {
+ const asio::cancellation_state& value;
+
+ constexpr static bool await_ready() noexcept
+ {
+ return true;
+ }
+
+ constexpr static void await_suspend(coroutine_handle<>) noexcept
+ {
+ }
+
+ asio::cancellation_state await_resume() const noexcept
+ {
+ return value;
+ }
+ };
+ assert(cancel);
+ return exec_helper{cancel->state};
+ }
+
+ // This await transformation resets the associated cancellation state.
+ auto await_transform(this_coro::reset_cancellation_state_0_t) noexcept
+ {
+ struct result
+ {
+ detail::coro_cancellation_source * src_;
+
+ bool await_ready() const noexcept
+ {
+ return true;
+ }
+
+ void await_suspend(coroutine_handle<void>) noexcept
+ {
+ }
+
+ auto await_resume() const
+ {
+ return src_->reset_cancellation_state();
+ }
+ };
+
+ return result{cancel};
+ }
+
+ // This await transformation resets the associated cancellation state.
+ template <typename Filter>
+ auto await_transform(
+ this_coro::reset_cancellation_state_1_t<Filter> reset) noexcept
+ {
+ struct result
+ {
+ detail::coro_cancellation_source* src_;
+ Filter filter_;
+
+ bool await_ready() const noexcept
+ {
+ return true;
+ }
+
+ void await_suspend(coroutine_handle<void>) noexcept
+ {
+ }
+
+ auto await_resume()
+ {
+ return src_->reset_cancellation_state(
+ static_cast<Filter&&>(filter_));
+ }
+ };
+
+ return result{cancel, static_cast<Filter&&>(reset.filter)};
+ }
+
+ // This await transformation resets the associated cancellation state.
+ template <typename InFilter, typename OutFilter>
+ auto await_transform(
+ this_coro::reset_cancellation_state_2_t<InFilter, OutFilter> reset)
+ noexcept
+ {
+ struct result
+ {
+ detail::coro_cancellation_source* src_;
+ InFilter in_filter_;
+ OutFilter out_filter_;
+
+ bool await_ready() const noexcept
+ {
+ return true;
+ }
+
+ void await_suspend(coroutine_handle<void>) noexcept
+ {
+ }
+
+ auto await_resume()
+ {
+ return src_->reset_cancellation_state(
+ static_cast<InFilter&&>(in_filter_),
+ static_cast<OutFilter&&>(out_filter_));
+ }
+ };
+
+ return result{cancel,
+ static_cast<InFilter&&>(reset.in_filter),
+ static_cast<OutFilter&&>(reset.out_filter)};
+ }
+
+ // This await transformation determines whether cancellation is propagated as
+ // an exception.
+ auto await_transform(this_coro::throw_if_cancelled_0_t) noexcept
+ requires (!is_noexcept)
+ {
+ struct result
+ {
+ detail::coro_cancellation_source* src_;
+
+ bool await_ready() const noexcept
+ {
+ return true;
+ }
+
+ void await_suspend(coroutine_handle<void>) noexcept
+ {
+ }
+
+ auto await_resume()
+ {
+ return src_->throw_if_cancelled();
+ }
+ };
+
+ return result{cancel};
+ }
+
+ // This await transformation sets whether cancellation is propagated as an
+ // exception.
+ auto await_transform(
+ this_coro::throw_if_cancelled_1_t throw_if_cancelled) noexcept
+ requires (!is_noexcept)
+ {
+ struct result
+ {
+ detail::coro_cancellation_source* src_;
+ bool value_;
+
+ bool await_ready() const noexcept
+ {
+ return true;
+ }
+
+ void await_suspend(coroutine_handle<void>) noexcept
+ {
+ }
+
+ auto await_resume()
+ {
+ src_->throw_if_cancelled(value_);
+ }
+ };
+
+ return result{cancel, throw_if_cancelled.value};
+ }
+
+ template <typename Yield_, typename Return_,
+ typename Executor_, typename Allocator_>
+ auto await_transform(coro<Yield_, Return_, Executor_, Allocator_>& kr)
+ -> decltype(auto)
+ {
+ return kr;
+ }
+
+ template <typename Yield_, typename Return_,
+ typename Executor_, typename Allocator_>
+ auto await_transform(coro<Yield_, Return_, Executor_, Allocator_>&& kr)
+ {
+ return std::move(kr);
+ }
+
+ template <typename T_, typename Coroutine >
+ auto await_transform(coro_with_arg<T_, Coroutine>&& kr) -> decltype(auto)
+ {
+ return std::move(kr);
+ }
+
+ template <typename T_>
+ requires requires(T_ t) {{ t.async_wait(deferred) }; }
+ auto await_transform(T_& t) -> decltype(auto)
+ {
+ return await_transform(t.async_wait(deferred));
+ }
+
+ template <typename Op>
+ auto await_transform(Op&& op,
+ constraint_t<is_async_operation<Op>::value> = 0)
+ {
+ if ((cancel->state.cancelled() != cancellation_type::none)
+ && cancel->throw_if_cancelled_)
+ {
+ asio::detail::throw_error(
+ asio::error::operation_aborted, "coro-cancelled");
+ }
+ using signature = completion_signature_of_t<Op>;
+ using result_type = detail::coro_completion_handler_type_t<signature>;
+ using handler_type =
+ typename detail::coro_completion_handler_type<signature>::template
+ completion_handler<coro_promise>;
+
+ struct aw_t
+ {
+ Op op;
+ std::optional<result_type> result;
+
+ constexpr static bool await_ready()
+ {
+ return false;
+ }
+
+ void await_suspend(coroutine_handle<coro_promise> h)
+ {
+ std::move(op)(handler_type{h, result});
+ }
+
+ auto await_resume()
+ {
+ if constexpr (is_noexcept)
+ {
+ if constexpr (std::tuple_size_v<result_type> == 0u)
+ return;
+ else if constexpr (std::tuple_size_v<result_type> == 1u)
+ return std::get<0>(std::move(result).value());
+ else
+ return std::move(result).value();
+ }
+ else
+ return detail::coro_interpret_result(std::move(result).value());
+ }
+ };
+
+ return aw_t{std::move(op), {}};
+ }
+};
+
+} // namespace detail
+
+template <typename Yield, typename Return,
+ typename Executor, typename Allocator>
+struct coro<Yield, Return, Executor, Allocator>::awaitable_t
+{
+ coro& coro_;
+
+ constexpr static bool await_ready() { return false; }
+
+ template <typename Y, typename R, typename E, typename A>
+ auto await_suspend(
+ detail::coroutine_handle<detail::coro_promise<Y, R, E, A>> h)
+ -> detail::coroutine_handle<>
+ {
+ auto& hp = h.promise();
+
+ if constexpr (!detail::coro_promise<Y, R, E, A>::is_noexcept)
+ {
+ if ((hp.cancel->state.cancelled() != cancellation_type::none)
+ && hp.cancel->throw_if_cancelled_)
+ {
+ asio::detail::throw_error(
+ asio::error::operation_aborted, "coro-cancelled");
+ }
+ }
+
+ if (hp.get_executor() == coro_.get_executor())
+ {
+ coro_.coro_->awaited_from = h;
+ coro_.coro_->cancel = hp.cancel;
+ coro_.coro_->reset_error();
+
+ return coro_.coro_->get_handle();
+ }
+ else
+ {
+ coro_.coro_->awaited_from = detail::dispatch_coroutine(
+ asio::prefer(hp.get_executor(),
+ execution::outstanding_work.tracked),
+ [h]() mutable
+ {
+ h.resume();
+ }).handle;
+
+ coro_.coro_->reset_error();
+
+ struct cancel_handler
+ {
+ std::shared_ptr<std::pair<cancellation_signal,
+ detail::coro_cancellation_source>> st = std::make_shared<
+ std::pair<cancellation_signal, detail::coro_cancellation_source>>();
+
+ cancel_handler(E e, coro& coro) : e(e), coro_(coro.coro_)
+ {
+ st->second.state = cancellation_state(
+ st->second.slot = st->first.slot());
+ }
+
+ E e;
+ typename coro::promise_type* coro_;
+
+ void operator()(cancellation_type ct)
+ {
+ asio::dispatch(e,
+ [ct, st = st]() mutable
+ {
+ auto & [sig, state] = *st;
+ sig.emit(ct);
+ });
+ }
+ };
+
+ if (hp.cancel->state.slot().is_connected())
+ {
+ hp.cancel->state.slot().template emplace<cancel_handler>(
+ coro_.get_executor(), coro_);
+ }
+
+ auto hh = detail::coroutine_handle<
+ detail::coro_promise<Yield, Return, Executor, Allocator>>::from_promise(
+ *coro_.coro_);
+
+ return detail::dispatch_coroutine(
+ coro_.coro_->get_executor(),
+ [hh]() mutable { hh.resume(); }).handle;
+ }
+ }
+
+ auto await_resume() -> result_type
+ {
+ coro_.coro_->cancel = nullptr;
+ coro_.coro_->rethrow_if();
+ if constexpr (!std::is_void_v<result_type>)
+ return std::move(coro_.coro_->result_);
+ }
+};
+
+template <typename Yield, typename Return,
+ typename Executor, typename Allocator>
+struct coro<Yield, Return, Executor, Allocator>::initiate_async_resume
+{
+ typedef Executor executor_type;
+ typedef Allocator allocator_type;
+ typedef asio::cancellation_slot cancellation_slot_type;
+
+ explicit initiate_async_resume(coro* self)
+ : coro_(self->coro_)
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return coro_->get_executor();
+ }
+
+ allocator_type get_allocator() const noexcept
+ {
+ return coro_->get_allocator();
+ }
+
+ template <typename E, typename WaitHandler>
+ auto handle(E exec, WaitHandler&& handler,
+ std::true_type /* error is noexcept */,
+ std::true_type /* result is void */) //noexcept
+ {
+ return [this, the_coro = coro_,
+ h = std::forward<WaitHandler>(handler),
+ exec = std::move(exec)]() mutable
+ {
+ assert(the_coro);
+
+ auto ch = detail::coroutine_handle<promise_type>::from_promise(*the_coro);
+ assert(ch && !ch.done());
+
+ the_coro->awaited_from = post_coroutine(std::move(exec), std::move(h));
+ the_coro->reset_error();
+ ch.resume();
+ };
+ }
+
+ template <typename E, typename WaitHandler>
+ requires (!std::is_void_v<result_type>)
+ auto handle(E exec, WaitHandler&& handler,
+ std::true_type /* error is noexcept */,
+ std::false_type /* result is void */) //noexcept
+ {
+ return [the_coro = coro_,
+ h = std::forward<WaitHandler>(handler),
+ exec = std::move(exec)]() mutable
+ {
+ assert(the_coro);
+
+ auto ch = detail::coroutine_handle<promise_type>::from_promise(*the_coro);
+ assert(ch && !ch.done());
+
+ the_coro->awaited_from = detail::post_coroutine(
+ exec, std::move(h), the_coro->result_).handle;
+ the_coro->reset_error();
+ ch.resume();
+ };
+ }
+
+ template <typename E, typename WaitHandler>
+ auto handle(E exec, WaitHandler&& handler,
+ std::false_type /* error is noexcept */,
+ std::true_type /* result is void */)
+ {
+ return [the_coro = coro_,
+ h = std::forward<WaitHandler>(handler),
+ exec = std::move(exec)]() mutable
+ {
+ if (!the_coro)
+ return asio::post(exec,
+ asio::append(std::move(h),
+ detail::coro_error<error_type>::invalid()));
+
+ auto ch = detail::coroutine_handle<promise_type>::from_promise(*the_coro);
+ if (!ch)
+ return asio::post(exec,
+ asio::append(std::move(h),
+ detail::coro_error<error_type>::invalid()));
+ else if (ch.done())
+ return asio::post(exec,
+ asio::append(std::move(h),
+ detail::coro_error<error_type>::done()));
+ else
+ {
+ the_coro->awaited_from = detail::post_coroutine(
+ exec, std::move(h), the_coro->error_).handle;
+ the_coro->reset_error();
+ ch.resume();
+ }
+ };
+ }
+
+ template <typename E, typename WaitHandler>
+ auto handle(E exec, WaitHandler&& handler,
+ std::false_type /* error is noexcept */,
+ std::false_type /* result is void */)
+ {
+ return [the_coro = coro_,
+ h = std::forward<WaitHandler>(handler),
+ exec = std::move(exec)]() mutable
+ {
+ if (!the_coro)
+ return asio::post(exec,
+ asio::append(std::move(h),
+ detail::coro_error<error_type>::invalid(), result_type{}));
+
+ auto ch =
+ detail::coroutine_handle<promise_type>::from_promise(*the_coro);
+ if (!ch)
+ return asio::post(exec,
+ asio::append(std::move(h),
+ detail::coro_error<error_type>::invalid(), result_type{}));
+ else if (ch.done())
+ return asio::post(exec,
+ asio::append(std::move(h),
+ detail::coro_error<error_type>::done(), result_type{}));
+ else
+ {
+ the_coro->awaited_from = detail::post_coroutine(
+ exec, std::move(h), the_coro->error_, the_coro->result_).handle;
+ the_coro->reset_error();
+ ch.resume();
+ }
+ };
+ }
+
+ template <typename WaitHandler>
+ void operator()(WaitHandler&& handler)
+ {
+ const auto exec = asio::prefer(
+ get_associated_executor(handler, get_executor()),
+ execution::outstanding_work.tracked);
+
+ coro_->cancel = &coro_->cancel_source.emplace();
+ coro_->cancel->state = cancellation_state(
+ coro_->cancel->slot = get_associated_cancellation_slot(handler));
+ asio::dispatch(get_executor(),
+ handle(exec, std::forward<WaitHandler>(handler),
+ std::integral_constant<bool, is_noexcept>{},
+ std::is_void<result_type>{}));
+ }
+
+ template <typename WaitHandler, typename Input>
+ void operator()(WaitHandler&& handler, Input&& input)
+ {
+ const auto exec = asio::prefer(
+ get_associated_executor(handler, get_executor()),
+ execution::outstanding_work.tracked);
+
+ coro_->cancel = &coro_->cancel_source.emplace();
+ coro_->cancel->state = cancellation_state(
+ coro_->cancel->slot = get_associated_cancellation_slot(handler));
+ asio::dispatch(get_executor(),
+ [h = handle(exec, std::forward<WaitHandler>(handler),
+ std::integral_constant<bool, is_noexcept>{},
+ std::is_void<result_type>{}),
+ in = std::forward<Input>(input), the_coro = coro_]() mutable
+ {
+ the_coro->input_ = std::move(in);
+ std::move(h)();
+ });
+ }
+
+private:
+ typename coro::promise_type* coro_;
+};
+
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_IMPL_CORO_HPP
diff --git a/3rdparty/asio/include/asio/experimental/impl/deferred.hpp b/3rdparty/asio/include/asio/experimental/impl/deferred.hpp
deleted file mode 100644
index e9b9b29fa2f..00000000000
--- a/3rdparty/asio/include/asio/experimental/impl/deferred.hpp
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// experimental/impl/deferred.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_EXPERIMENTAL_IMPL_DEFERRED_HPP
-#define ASIO_EXPERIMENTAL_IMPL_DEFERRED_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-
-#if !defined(GENERATING_DOCUMENTATION)
-
-template <typename R, typename... Args>
-class async_result<
- experimental::detail::deferred_signature_probe, R(Args...)>
-{
-public:
- typedef experimental::detail::deferred_signature_probe_result<void(Args...)>
- return_type;
-
- template <typename Initiation, typename... InitArgs>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation),
- experimental::detail::deferred_signature_probe,
- ASIO_MOVE_ARG(InitArgs)...)
- {
- return return_type{};
- }
-};
-
-template <typename Signature>
-class async_result<experimental::deferred_t, Signature>
-{
-public:
- template <typename Initiation, typename... InitArgs>
- static experimental::deferred_async_operation<
- Signature, Initiation, InitArgs...>
- initiate(ASIO_MOVE_ARG(Initiation) initiation,
- experimental::deferred_t, ASIO_MOVE_ARG(InitArgs)... args)
- {
- return experimental::deferred_async_operation<
- Signature, Initiation, InitArgs...>(
- experimental::deferred_init_tag{},
- ASIO_MOVE_CAST(Initiation)(initiation),
- ASIO_MOVE_CAST(InitArgs)(args)...);
- }
-};
-
-template <typename Function, typename R, typename... Args>
-class async_result<
- experimental::deferred_function<Function>, R(Args...)>
-{
-public:
- template <typename Initiation, typename... InitArgs>
- static auto initiate(ASIO_MOVE_ARG(Initiation) initiation,
- experimental::deferred_function<Function> token,
- ASIO_MOVE_ARG(InitArgs)... init_args)
- {
- return experimental::deferred_sequence<
- experimental::deferred_async_operation<
- R(Args...), Initiation, InitArgs...>,
- Function>(experimental::deferred_init_tag{},
- experimental::deferred_async_operation<
- R(Args...), Initiation, InitArgs...>(
- experimental::deferred_init_tag{},
- ASIO_MOVE_CAST(Initiation)(initiation),
- ASIO_MOVE_CAST(InitArgs)(init_args)...),
- ASIO_MOVE_CAST(Function)(token.function_));
- }
-};
-
-template <template <typename, typename> class Associator,
- typename Handler, typename Tail, typename DefaultCandidate>
-struct associator<Associator,
- experimental::detail::deferred_sequence_handler<Handler, Tail>,
- DefaultCandidate>
- : Associator<Handler, DefaultCandidate>
-{
- static typename Associator<Handler, DefaultCandidate>::type get(
- const experimental::detail::deferred_sequence_handler<Handler, Tail>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
- {
- return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
- }
-};
-
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_EXPERIMENTAL_IMPL_DEFERRED_HPP
diff --git a/3rdparty/asio/include/asio/experimental/impl/parallel_group.hpp b/3rdparty/asio/include/asio/experimental/impl/parallel_group.hpp
index e1cfc1e2c98..75e8a151876 100644
--- a/3rdparty/asio/include/asio/experimental/impl/parallel_group.hpp
+++ b/3rdparty/asio/include/asio/experimental/impl/parallel_group.hpp
@@ -2,7 +2,7 @@
// experimental/impl/parallel_group.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,6 +17,7 @@
#include "asio/detail/config.hpp"
#include <atomic>
+#include <deque>
#include <memory>
#include <new>
#include <tuple>
@@ -83,12 +84,12 @@ private:
template <typename Handler, typename... Ops>
struct parallel_group_completion_handler
{
- typedef typename decay<
- typename prefer_result<
- typename associated_executor<Handler>::type,
+ typedef decay_t<
+ prefer_result_t<
+ associated_executor_t<Handler>,
execution::outstanding_work_t::tracked_t
- >::type
- >::type executor_type;
+ >
+ > executor_type;
parallel_group_completion_handler(Handler&& h)
: handler_(std::move(h)),
@@ -106,11 +107,11 @@ struct parallel_group_completion_handler
void operator()()
{
- this->invoke(std::make_index_sequence<sizeof...(Ops)>());
+ this->invoke(asio::detail::make_index_sequence<sizeof...(Ops)>());
}
template <std::size_t... I>
- void invoke(std::index_sequence<I...>)
+ void invoke(asio::detail::index_sequence<I...>)
{
this->invoke(std::tuple_cat(std::move(std::get<I>(args_).get())...));
}
@@ -118,11 +119,13 @@ struct parallel_group_completion_handler
template <typename... Args>
void invoke(std::tuple<Args...>&& args)
{
- this->invoke(std::move(args), std::make_index_sequence<sizeof...(Args)>());
+ this->invoke(std::move(args),
+ asio::detail::index_sequence_for<Args...>());
}
template <typename... Args, std::size_t... I>
- void invoke(std::tuple<Args...>&& args, std::index_sequence<I...>)
+ void invoke(std::tuple<Args...>&& args,
+ asio::detail::index_sequence<I...>)
{
std::move(handler_)(completion_order_, std::move(std::get<I>(args))...);
}
@@ -133,7 +136,7 @@ struct parallel_group_completion_handler
std::tuple<
parallel_group_op_result<
typename parallel_op_signature_as_tuple<
- typename parallel_op_signature<Ops>::type
+ completion_signature_of_t<Ops>
>::type
>...
> args_{};
@@ -186,7 +189,7 @@ struct parallel_group_op_handler
typedef asio::cancellation_slot cancellation_slot_type;
parallel_group_op_handler(
- std::shared_ptr<parallel_group_state<Condition, Handler, Ops...> > state)
+ std::shared_ptr<parallel_group_state<Condition, Handler, Ops...>> state)
: state_(std::move(state))
{
}
@@ -227,7 +230,7 @@ struct parallel_group_op_handler
asio::dispatch(std::move(state_->handler_));
}
- std::shared_ptr<parallel_group_state<Condition, Handler, Ops...> > state_;
+ std::shared_ptr<parallel_group_state<Condition, Handler, Ops...>> state_;
};
// Handler for an individual operation within the parallel group that has an
@@ -242,7 +245,7 @@ struct parallel_group_op_handler_with_executor :
typedef Executor executor_type;
parallel_group_op_handler_with_executor(
- std::shared_ptr<parallel_group_state<Condition, Handler, Ops...> > state,
+ std::shared_ptr<parallel_group_state<Condition, Handler, Ops...>> state,
executor_type ex)
: parallel_group_op_handler<I, Condition, Handler, Ops...>(std::move(state))
{
@@ -266,7 +269,7 @@ struct parallel_group_op_handler_with_executor :
{
cancel_proxy(
std::shared_ptr<parallel_group_state<
- Condition, Handler, Ops...> > state,
+ Condition, Handler, Ops...>> state,
executor_type ex)
: state_(std::move(state)),
executor_(std::move(ex))
@@ -283,7 +286,7 @@ struct parallel_group_op_handler_with_executor :
}
}
- std::weak_ptr<parallel_group_state<Condition, Handler, Ops...> > state_;
+ std::weak_ptr<parallel_group_state<Condition, Handler, Ops...>> state_;
asio::cancellation_signal signal_;
executor_type executor_;
};
@@ -298,9 +301,9 @@ struct parallel_group_op_launcher
template <typename Condition, typename Handler, typename... Ops>
static void launch(Op& op,
const std::shared_ptr<parallel_group_state<
- Condition, Handler, Ops...> >& state)
+ Condition, Handler, Ops...>>& state)
{
- typedef typename associated_executor<Op>::type ex_type;
+ typedef associated_executor_t<Op> ex_type;
ex_type ex = asio::get_associated_executor(op);
std::move(op)(
parallel_group_op_handler_with_executor<ex_type, I,
@@ -311,18 +314,18 @@ struct parallel_group_op_launcher
// Specialised launcher for operations that specify no executor.
template <std::size_t I, typename Op>
struct parallel_group_op_launcher<I, Op,
- typename enable_if<
+ enable_if_t<
is_same<
typename associated_executor<
Op>::asio_associated_executor_is_unspecialised,
void
>::value
- >::type>
+ >>
{
template <typename Condition, typename Handler, typename... Ops>
static void launch(Op& op,
const std::shared_ptr<parallel_group_state<
- Condition, Handler, Ops...> >& state)
+ Condition, Handler, Ops...>>& state)
{
std::move(op)(
parallel_group_op_handler<I, Condition, Handler, Ops...>(state));
@@ -333,7 +336,7 @@ template <typename Condition, typename Handler, typename... Ops>
struct parallel_group_cancellation_handler
{
parallel_group_cancellation_handler(
- std::shared_ptr<parallel_group_state<Condition, Handler, Ops...> > state)
+ std::shared_ptr<parallel_group_state<Condition, Handler, Ops...>> state)
: state_(std::move(state))
{
}
@@ -344,22 +347,23 @@ struct parallel_group_cancellation_handler
// yet completed and requested cancellation, emit a signal for each
// operation in the group.
if (cancel_type != cancellation_type::none)
- if (state_->cancellations_requested_++ == 0)
- for (std::size_t i = 0; i < sizeof...(Ops); ++i)
- state_->cancellation_signals_[i].emit(cancel_type);
+ if (auto state = state_.lock())
+ if (state->cancellations_requested_++ == 0)
+ for (std::size_t i = 0; i < sizeof...(Ops); ++i)
+ state->cancellation_signals_[i].emit(cancel_type);
}
- std::shared_ptr<parallel_group_state<Condition, Handler, Ops...> > state_;
+ std::weak_ptr<parallel_group_state<Condition, Handler, Ops...>> state_;
};
template <typename Condition, typename Handler,
typename... Ops, std::size_t... I>
void parallel_group_launch(Condition cancellation_condition, Handler handler,
- std::tuple<Ops...>& ops, std::index_sequence<I...>)
+ std::tuple<Ops...>& ops, asio::detail::index_sequence<I...>)
{
// Get the user's completion handler's cancellation slot, so that we can allow
// cancellation of the entire group.
- typename associated_cancellation_slot<Handler>::type slot
+ associated_cancellation_slot_t<Handler> slot
= asio::get_associated_cancellation_slot(handler);
// Create the shared state for the operation.
@@ -386,29 +390,348 @@ void parallel_group_launch(Condition cancellation_condition, Handler handler,
if (slot.is_connected())
slot.template emplace<
parallel_group_cancellation_handler<
- Condition, Handler, Ops...> >(state);
+ Condition, Handler, Ops...>>(state);
}
-} // namespace detail
-} // namespace experimental
+// Proxy completion handler for the ranged group of parallel operatations.
+// Unpacks and recombines the individual operations' results, and invokes the
+// user's completion handler.
+template <typename Handler, typename Op, typename Allocator>
+struct ranged_parallel_group_completion_handler
+{
+ typedef decay_t<
+ prefer_result_t<
+ associated_executor_t<Handler>,
+ execution::outstanding_work_t::tracked_t
+ >
+ > executor_type;
+
+ typedef typename parallel_op_signature_as_tuple<
+ completion_signature_of_t<Op>
+ >::type op_tuple_type;
+
+ typedef parallel_group_op_result<op_tuple_type> op_result_type;
+
+ ranged_parallel_group_completion_handler(Handler&& h,
+ std::size_t size, const Allocator& allocator)
+ : handler_(std::move(h)),
+ executor_(
+ asio::prefer(
+ asio::get_associated_executor(handler_),
+ execution::outstanding_work.tracked)),
+ allocator_(allocator),
+ completion_order_(size, 0,
+ ASIO_REBIND_ALLOC(Allocator, std::size_t)(allocator)),
+ args_(ASIO_REBIND_ALLOC(Allocator, op_result_type)(allocator))
+ {
+ for (std::size_t i = 0; i < size; ++i)
+ args_.emplace_back();
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return executor_;
+ }
+
+ void operator()()
+ {
+ this->invoke(
+ asio::detail::make_index_sequence<
+ std::tuple_size<op_tuple_type>::value>());
+ }
+
+ template <std::size_t... I>
+ void invoke(asio::detail::index_sequence<I...>)
+ {
+ typedef typename parallel_op_signature_as_tuple<
+ typename ranged_parallel_group_signature<
+ completion_signature_of_t<Op>,
+ Allocator
+ >::raw_type
+ >::type vectors_type;
+
+ // Construct all result vectors using the supplied allocator.
+ vectors_type vectors{
+ typename std::tuple_element<I, vectors_type>::type(
+ ASIO_REBIND_ALLOC(Allocator, int)(allocator_))...};
+
+ // Reserve sufficient space in each of the result vectors.
+ int reserve_fold[] = { 0,
+ ( std::get<I>(vectors).reserve(completion_order_.size()),
+ 0 )...
+ };
+ (void)reserve_fold;
+
+ // Copy the results from all operations into the result vectors.
+ for (std::size_t idx = 0; idx < completion_order_.size(); ++idx)
+ {
+ int pushback_fold[] = { 0,
+ ( std::get<I>(vectors).push_back(
+ std::move(std::get<I>(args_[idx].get()))),
+ 0 )...
+ };
+ (void)pushback_fold;
+ }
+
+ std::move(handler_)(std::move(completion_order_),
+ std::move(std::get<I>(vectors))...);
+ }
+
+ Handler handler_;
+ executor_type executor_;
+ Allocator allocator_;
+ std::vector<std::size_t,
+ ASIO_REBIND_ALLOC(Allocator, std::size_t)> completion_order_;
+ std::deque<op_result_type,
+ ASIO_REBIND_ALLOC(Allocator, op_result_type)> args_;
+};
-template <typename R, typename... Args>
-class async_result<
- experimental::detail::parallel_op_signature_probe,
- R(Args...)>
+// Shared state for the parallel group.
+template <typename Condition, typename Handler, typename Op, typename Allocator>
+struct ranged_parallel_group_state
{
-public:
- typedef experimental::detail::parallel_op_signature_probe_result<
- void(Args...)> return_type;
+ ranged_parallel_group_state(Condition&& c, Handler&& h,
+ std::size_t size, const Allocator& allocator)
+ : cancellations_requested_(size),
+ outstanding_(size),
+ cancellation_signals_(
+ ASIO_REBIND_ALLOC(Allocator,
+ asio::cancellation_signal)(allocator)),
+ cancellation_condition_(std::move(c)),
+ handler_(std::move(h), size, allocator)
+ {
+ for (std::size_t i = 0; i < size; ++i)
+ cancellation_signals_.emplace_back();
+ }
+
+ // The number of operations that have completed so far. Used to determine the
+ // order of completion.
+ std::atomic<unsigned int> completed_{0};
+
+ // The non-none cancellation type that resulted from a cancellation condition.
+ // Stored here for use by the group's initiating function.
+ std::atomic<cancellation_type_t> cancel_type_{cancellation_type::none};
+
+ // The number of cancellations that have been requested, either on completion
+ // of the operations within the group, or via the cancellation slot for the
+ // group operation. Initially set to the number of operations to prevent
+ // cancellation signals from being emitted until after all of the group's
+ // operations' initiating functions have completed.
+ std::atomic<unsigned int> cancellations_requested_;
- template <typename Initiation, typename... InitArgs>
- static return_type initiate(Initiation&&,
- experimental::detail::parallel_op_signature_probe, InitArgs&&...)
+ // The number of operations that are yet to complete. Used to determine when
+ // it is safe to invoke the user's completion handler.
+ std::atomic<unsigned int> outstanding_;
+
+ // The cancellation signals for each operation in the group.
+ std::deque<asio::cancellation_signal,
+ ASIO_REBIND_ALLOC(Allocator, asio::cancellation_signal)>
+ cancellation_signals_;
+
+ // The cancellation condition is used to determine whether the results from an
+ // individual operation warrant a cancellation request for the whole group.
+ Condition cancellation_condition_;
+
+ // The proxy handler to be invoked once all operations in the group complete.
+ ranged_parallel_group_completion_handler<Handler, Op, Allocator> handler_;
+};
+
+// Handler for an individual operation within the parallel group.
+template <typename Condition, typename Handler, typename Op, typename Allocator>
+struct ranged_parallel_group_op_handler
+{
+ typedef asio::cancellation_slot cancellation_slot_type;
+
+ ranged_parallel_group_op_handler(
+ std::shared_ptr<ranged_parallel_group_state<
+ Condition, Handler, Op, Allocator>> state,
+ std::size_t idx)
+ : state_(std::move(state)),
+ idx_(idx)
{
- return return_type{};
}
+
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return state_->cancellation_signals_[idx_].slot();
+ }
+
+ template <typename... Args>
+ void operator()(Args... args)
+ {
+ // Capture this operation into the completion order.
+ state_->handler_.completion_order_[state_->completed_++] = idx_;
+
+ // Determine whether the results of this operation require cancellation of
+ // the whole group.
+ cancellation_type_t cancel_type = state_->cancellation_condition_(args...);
+
+ // Capture the result of the operation into the proxy completion handler.
+ state_->handler_.args_[idx_].emplace(std::move(args)...);
+
+ if (cancel_type != cancellation_type::none)
+ {
+ // Save the type for potential use by the group's initiating function.
+ state_->cancel_type_ = cancel_type;
+
+ // If we are the first operation to request cancellation, emit a signal
+ // for each operation in the group.
+ if (state_->cancellations_requested_++ == 0)
+ for (std::size_t i = 0; i < state_->cancellation_signals_.size(); ++i)
+ if (i != idx_)
+ state_->cancellation_signals_[i].emit(cancel_type);
+ }
+
+ // If this is the last outstanding operation, invoke the user's handler.
+ if (--state_->outstanding_ == 0)
+ asio::dispatch(std::move(state_->handler_));
+ }
+
+ std::shared_ptr<ranged_parallel_group_state<
+ Condition, Handler, Op, Allocator>> state_;
+ std::size_t idx_;
};
+// Handler for an individual operation within the parallel group that has an
+// explicitly specified executor.
+template <typename Executor, typename Condition,
+ typename Handler, typename Op, typename Allocator>
+struct ranged_parallel_group_op_handler_with_executor :
+ ranged_parallel_group_op_handler<Condition, Handler, Op, Allocator>
+{
+ typedef ranged_parallel_group_op_handler<
+ Condition, Handler, Op, Allocator> base_type;
+ typedef asio::cancellation_slot cancellation_slot_type;
+ typedef Executor executor_type;
+
+ ranged_parallel_group_op_handler_with_executor(
+ std::shared_ptr<ranged_parallel_group_state<
+ Condition, Handler, Op, Allocator>> state,
+ executor_type ex, std::size_t idx)
+ : ranged_parallel_group_op_handler<Condition, Handler, Op, Allocator>(
+ std::move(state), idx)
+ {
+ cancel_proxy_ =
+ &this->state_->cancellation_signals_[idx].slot().template
+ emplace<cancel_proxy>(this->state_, std::move(ex));
+ }
+
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return cancel_proxy_->signal_.slot();
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return cancel_proxy_->executor_;
+ }
+
+ // Proxy handler that forwards the emitted signal to the correct executor.
+ struct cancel_proxy
+ {
+ cancel_proxy(
+ std::shared_ptr<ranged_parallel_group_state<
+ Condition, Handler, Op, Allocator>> state,
+ executor_type ex)
+ : state_(std::move(state)),
+ executor_(std::move(ex))
+ {
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ if (auto state = state_.lock())
+ {
+ asio::cancellation_signal* sig = &signal_;
+ asio::dispatch(executor_,
+ [state, sig, type]{ sig->emit(type); });
+ }
+ }
+
+ std::weak_ptr<ranged_parallel_group_state<
+ Condition, Handler, Op, Allocator>> state_;
+ asio::cancellation_signal signal_;
+ executor_type executor_;
+ };
+
+ cancel_proxy* cancel_proxy_;
+};
+
+template <typename Condition, typename Handler, typename Op, typename Allocator>
+struct ranged_parallel_group_cancellation_handler
+{
+ ranged_parallel_group_cancellation_handler(
+ std::shared_ptr<ranged_parallel_group_state<
+ Condition, Handler, Op, Allocator>> state)
+ : state_(std::move(state))
+ {
+ }
+
+ void operator()(cancellation_type_t cancel_type)
+ {
+ // If we are the first place to request cancellation, i.e. no operation has
+ // yet completed and requested cancellation, emit a signal for each
+ // operation in the group.
+ if (cancel_type != cancellation_type::none)
+ if (auto state = state_.lock())
+ if (state->cancellations_requested_++ == 0)
+ for (std::size_t i = 0; i < state->cancellation_signals_.size(); ++i)
+ state->cancellation_signals_[i].emit(cancel_type);
+ }
+
+ std::weak_ptr<ranged_parallel_group_state<
+ Condition, Handler, Op, Allocator>> state_;
+};
+
+template <typename Condition, typename Handler,
+ typename Range, typename Allocator>
+void ranged_parallel_group_launch(Condition cancellation_condition,
+ Handler handler, Range&& range, const Allocator& allocator)
+{
+ // Get the user's completion handler's cancellation slot, so that we can allow
+ // cancellation of the entire group.
+ associated_cancellation_slot_t<Handler> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ // The type of the asynchronous operation.
+ typedef decay_t<decltype(*declval<typename Range::iterator>())> op_type;
+
+ // Create the shared state for the operation.
+ typedef ranged_parallel_group_state<Condition,
+ Handler, op_type, Allocator> state_type;
+ std::shared_ptr<state_type> state = std::allocate_shared<state_type>(
+ asio::detail::recycling_allocator<state_type,
+ asio::detail::thread_info_base::parallel_group_tag>(),
+ std::move(cancellation_condition),
+ std::move(handler), range.size(), allocator);
+
+ std::size_t idx = 0;
+ for (auto&& op : std::forward<Range>(range))
+ {
+ typedef associated_executor_t<op_type> ex_type;
+ ex_type ex = asio::get_associated_executor(op);
+ std::move(op)(
+ ranged_parallel_group_op_handler_with_executor<
+ ex_type, Condition, Handler, op_type, Allocator>(
+ state, std::move(ex), idx++));
+ }
+
+ // Check if any of the operations has already requested cancellation, and if
+ // so, emit a signal for each operation in the group.
+ if ((state->cancellations_requested_ -= range.size()) > 0)
+ for (auto& signal : state->cancellation_signals_)
+ signal.emit(state->cancel_type_);
+
+ // Register a handler with the user's completion handler's cancellation slot.
+ if (slot.is_connected())
+ slot.template emplace<
+ ranged_parallel_group_cancellation_handler<
+ Condition, Handler, op_type, Allocator>>(state);
+}
+
+} // namespace detail
+} // namespace experimental
+
template <template <typename, typename> class Associator,
typename Handler, typename... Ops, typename DefaultCandidate>
struct associator<Associator,
@@ -418,8 +741,41 @@ struct associator<Associator,
{
static typename Associator<Handler, DefaultCandidate>::type get(
const experimental::detail::parallel_group_completion_handler<
+ Handler, Ops...>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const experimental::detail::parallel_group_completion_handler<
Handler, Ops...>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ }
+};
+
+template <template <typename, typename> class Associator, typename Handler,
+ typename Op, typename Allocator, typename DefaultCandidate>
+struct associator<Associator,
+ experimental::detail::ranged_parallel_group_completion_handler<
+ Handler, Op, Allocator>,
+ DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const experimental::detail::ranged_parallel_group_completion_handler<
+ Handler, Op, Allocator>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const experimental::detail::ranged_parallel_group_completion_handler<
+ Handler, Op, Allocator>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
diff --git a/3rdparty/asio/include/asio/experimental/impl/prepend.hpp b/3rdparty/asio/include/asio/experimental/impl/prepend.hpp
deleted file mode 100644
index 73978348f7a..00000000000
--- a/3rdparty/asio/include/asio/experimental/impl/prepend.hpp
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// experimental/impl/prepend.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_IMPL_EXPERIMENTAL_PREPEND_HPP
-#define ASIO_IMPL_EXPERIMENTAL_PREPEND_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#include "asio/associator.hpp"
-#include "asio/async_result.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace experimental {
-namespace detail {
-
-// Class to adapt a prepend_t as a completion handler.
-template <typename Handler, typename... Values>
-class prepend_handler
-{
-public:
- typedef void result_type;
-
- template <typename H>
- prepend_handler(ASIO_MOVE_ARG(H) handler, std::tuple<Values...> values)
- : handler_(ASIO_MOVE_CAST(H)(handler)),
- values_(ASIO_MOVE_CAST(std::tuple<Values...>)(values))
- {
- }
-
- template <typename... Args>
- void operator()(ASIO_MOVE_ARG(Args)... args)
- {
- this->invoke(
- std::make_index_sequence<sizeof...(Values)>{},
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
- template <std::size_t... I, typename... Args>
- void invoke(std::index_sequence<I...>, ASIO_MOVE_ARG(Args)... args)
- {
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
- ASIO_MOVE_CAST(Values)(std::get<I>(values_))...,
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
-//private:
- Handler handler_;
- std::tuple<Values...> values_;
-};
-
-template <typename Handler>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- prepend_handler<Handler>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- prepend_handler<Handler>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
-inline bool asio_handler_is_continuation(
- prepend_handler<Handler>* this_handler)
-{
- return asio_handler_cont_helpers::is_continuation(
- this_handler->handler_);
-}
-
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- prepend_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- prepend_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Signature, typename... Values>
-struct prepend_signature;
-
-template <typename R, typename... Args, typename... Values>
-struct prepend_signature<R(Args...), Values...>
-{
- typedef R type(Values..., typename decay<Args>::type...);
-};
-
-} // namespace detail
-} // namespace experimental
-
-#if !defined(GENERATING_DOCUMENTATION)
-
-template <typename CompletionToken, typename... Values, typename Signature>
-struct async_result<
- experimental::prepend_t<CompletionToken, Values...>, Signature>
- : async_result<CompletionToken,
- typename experimental::detail::prepend_signature<
- Signature, Values...>::type>
-{
- typedef typename experimental::detail::prepend_signature<
- Signature, Values...>::type signature;
-
- template <typename Initiation>
- struct init_wrapper
- {
- init_wrapper(Initiation init)
- : initiation_(ASIO_MOVE_CAST(Initiation)(init))
- {
- }
-
- template <typename Handler, typename... Args>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler,
- std::tuple<Values...> values,
- ASIO_MOVE_ARG(Args)... args)
- {
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- experimental::detail::prepend_handler<
- typename decay<Handler>::type, Values...>(
- ASIO_MOVE_CAST(Handler)(handler),
- ASIO_MOVE_CAST(std::tuple<Values...>)(values)),
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
- Initiation initiation_;
- };
-
- template <typename Initiation, typename RawCompletionToken, typename... Args>
- static ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, signature,
- (async_initiate<CompletionToken, signature>(
- declval<init_wrapper<typename decay<Initiation>::type> >(),
- declval<CompletionToken&>(),
- declval<std::tuple<Values...> >(),
- declval<ASIO_MOVE_ARG(Args)>()...)))
- initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
- {
- return async_initiate<CompletionToken, signature>(
- init_wrapper<typename decay<Initiation>::type>(
- ASIO_MOVE_CAST(Initiation)(initiation)),
- token.token_,
- ASIO_MOVE_CAST(std::tuple<Values...>)(token.values_),
- ASIO_MOVE_CAST(Args)(args)...);
- }
-};
-
-template <template <typename, typename> class Associator,
- typename Handler, typename DefaultCandidate>
-struct associator<Associator,
- experimental::detail::prepend_handler<Handler>, DefaultCandidate>
- : Associator<Handler, DefaultCandidate>
-{
- static typename Associator<Handler, DefaultCandidate>::type get(
- const experimental::detail::prepend_handler<Handler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
- {
- return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
- }
-};
-
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_IMPL_EXPERIMENTAL_PREPEND_HPP
diff --git a/3rdparty/asio/include/asio/experimental/impl/promise.hpp b/3rdparty/asio/include/asio/experimental/impl/promise.hpp
index 803b41e1a27..a80cf110baa 100644
--- a/3rdparty/asio/include/asio/experimental/impl/promise.hpp
+++ b/3rdparty/asio/include/asio/experimental/impl/promise.hpp
@@ -2,8 +2,8 @@
// experimental/impl/promise.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -11,61 +11,199 @@
#ifndef ASIO_EXPERIMENTAL_IMPL_PROMISE_HPP
#define ASIO_EXPERIMENTAL_IMPL_PROMISE_HPP
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
#include "asio/cancellation_signal.hpp"
-#include "asio/experimental/detail/completion_handler_erasure.hpp"
+#include "asio/detail/utility.hpp"
+#include "asio/error.hpp"
+#include "asio/system_error.hpp"
#include <tuple>
-#include <optional>
#include "asio/detail/push_options.hpp"
namespace asio {
namespace experimental {
-template<typename Signature = void(), typename Executor = any_io_executor>
+template<typename Signature = void(),
+ typename Executor = asio::any_io_executor,
+ typename Allocator = std::allocator<void>>
struct promise;
namespace detail {
-template<typename Signature, typename Executor>
+template<typename Signature, typename Executor, typename Allocator>
struct promise_impl;
-template<typename ... Ts, typename Executor>
-struct promise_impl<void(Ts...), Executor>
+template<typename... Ts, typename Executor, typename Allocator>
+struct promise_impl<void(Ts...), Executor, Allocator>
{
using result_type = std::tuple<Ts...>;
- promise_impl(Executor executor = {})
- : executor(std::move(executor))
+ promise_impl(Allocator allocator, Executor executor)
+ : allocator(std::move(allocator)), executor(std::move(executor))
{
}
- std::optional<result_type> result;
- bool done{false};
- detail::completion_handler_erasure<void(Ts...), Executor> completion;
+ promise_impl(const promise_impl&) = delete;
+
+ ~promise_impl()
+ {
+ if (completion)
+ this->cancel_();
+
+ if (done)
+ reinterpret_cast<result_type*>(&result)->~result_type();
+ }
+
+ aligned_storage_t<sizeof(result_type), alignof(result_type)> result;
+ std::atomic<bool> done{false};
cancellation_signal cancel;
+ Allocator allocator;
Executor executor;
-};
-template<typename Signature = void(), typename Executor = any_io_executor>
-struct promise_handler;
+ template<typename Func, std::size_t... Idx>
+ void apply_impl(Func f, asio::detail::index_sequence<Idx...>)
+ {
+ auto& result_type = *reinterpret_cast<promise_impl::result_type*>(&result);
+ f(std::get<Idx>(std::move(result_type))...);
+ }
+
+ using allocator_type = Allocator;
+ allocator_type get_allocator() {return allocator;}
+
+ using executor_type = Executor;
+ executor_type get_executor() {return executor;}
+
+ template<typename Func>
+ void apply(Func f)
+ {
+ apply_impl(std::forward<Func>(f),
+ asio::detail::make_index_sequence<sizeof...(Ts)>{});
+ }
+
+ struct completion_base
+ {
+ virtual void invoke(Ts&&...ts) = 0;
+ };
+
+ template<typename Alloc, typename WaitHandler_>
+ struct completion_impl final : completion_base
+ {
+ WaitHandler_ handler;
+ Alloc allocator;
+ void invoke(Ts&&... ts)
+ {
+ auto h = std::move(handler);
+
+ using alloc_t = typename std::allocator_traits<
+ typename asio::decay<Alloc>::type>::template
+ rebind_alloc<completion_impl>;
+
+ alloc_t alloc_{allocator};
+ this->~completion_impl();
+ std::allocator_traits<alloc_t>::deallocate(alloc_, this, 1u);
+ std::move(h)(std::forward<Ts>(ts)...);
+ }
+
+ template<typename Alloc_, typename Handler_>
+ completion_impl(Alloc_&& alloc, Handler_&& wh)
+ : handler(std::forward<Handler_>(wh)),
+ allocator(std::forward<Alloc_>(alloc))
+ {
+ }
+ };
+
+ completion_base* completion = nullptr;
+ typename asio::aligned_storage<sizeof(void*) * 4,
+ alignof(completion_base)>::type completion_opt;
+
+ template<typename Alloc, typename Handler>
+ void set_completion(Alloc&& alloc, Handler&& handler)
+ {
+ if (completion)
+ cancel_();
+
+ using impl_t = completion_impl<
+ typename asio::decay<Alloc>::type, Handler>;
+ using alloc_t = typename std::allocator_traits<
+ typename asio::decay<Alloc>::type>::template rebind_alloc<impl_t>;
+
+ alloc_t alloc_{alloc};
+ auto p = std::allocator_traits<alloc_t>::allocate(alloc_, 1u);
+ completion = new (p) impl_t(std::forward<Alloc>(alloc),
+ std::forward<Handler>(handler));
+ }
+
+ template<typename... T_>
+ void complete(T_&&... ts)
+ {
+ assert(completion);
+ std::exchange(completion, nullptr)->invoke(std::forward<T_>(ts)...);
+ }
+
+ template<std::size_t... Idx>
+ void complete_with_result_impl(asio::detail::index_sequence<Idx...>)
+ {
+ auto& result_type = *reinterpret_cast<promise_impl::result_type*>(&result);
+ this->complete(std::get<Idx>(std::move(result_type))...);
+ }
-template<typename Signature, typename Executor>
+ void complete_with_result()
+ {
+ complete_with_result_impl(
+ asio::detail::make_index_sequence<sizeof...(Ts)>{});
+ }
+
+ template<typename... T_>
+ void cancel_impl_(std::exception_ptr*, T_*...)
+ {
+ complete(
+ std::make_exception_ptr(
+ asio::system_error(
+ asio::error::operation_aborted)),
+ T_{}...);
+ }
+
+ template<typename... T_>
+ void cancel_impl_(asio::error_code*, T_*...)
+ {
+ complete(asio::error::operation_aborted, T_{}...);
+ }
+
+ template<typename... T_>
+ void cancel_impl_(T_*...)
+ {
+ complete(T_{}...);
+ }
+
+ void cancel_()
+ {
+ cancel_impl_(static_cast<Ts*>(nullptr)...);
+ }
+};
+
+template<typename Signature = void(),
+ typename Executor = asio::any_io_executor,
+ typename Allocator = any_io_executor>
struct promise_handler;
-template<typename ... Ts, typename Executor>
-struct promise_handler<void(Ts...), Executor>
+template<typename... Ts, typename Executor, typename Allocator>
+struct promise_handler<void(Ts...), Executor, Allocator>
{
- using promise_type = promise<void(Ts...), Executor>;
+ using promise_type = promise<void(Ts...), Executor, Allocator>;
- promise_handler(Executor executor) // get_associated_allocator(exec)
- : impl_{
- std::allocate_shared<promise_impl<void(Ts...), Executor>>(
- get_associated_allocator(executor))}
+ promise_handler(
+ Allocator allocator, Executor executor) // get_associated_allocator(exec)
+ : impl_(
+ std::allocate_shared<promise_impl<void(Ts...), Executor, Allocator>>(
+ allocator, allocator, executor))
{
- impl_->executor = std::move(executor);
}
- std::shared_ptr<promise_impl<void(Ts...), Executor>> impl_;
+ std::shared_ptr<promise_impl<void(Ts...), Executor, Allocator>> impl_;
using cancellation_slot_type = cancellation_slot;
@@ -74,18 +212,37 @@ struct promise_handler<void(Ts...), Executor>
return impl_->cancel.slot();
}
- auto make_promise() -> promise<void(Ts...), Executor>
+ using allocator_type = Allocator;
+
+ allocator_type get_allocator() const noexcept
+ {
+ return impl_->get_allocator();
+ }
+
+ using executor_type = Executor;
+
+ Executor get_executor() const noexcept
{
- return {impl_};
+ return impl_->get_executor();
+ }
+
+ auto make_promise() -> promise<void(Ts...), executor_type, allocator_type>
+ {
+ return promise<void(Ts...), executor_type, allocator_type>{impl_};
}
void operator()(std::remove_reference_t<Ts>... ts)
{
assert(impl_);
- impl_->result.emplace(std::move(ts)...);
+
+ using result_type = typename promise_impl<
+ void(Ts...), allocator_type, executor_type>::result_type ;
+
+ new (&impl_->result) result_type(std::move(ts)...);
impl_->done = true;
- if (auto f = std::exchange(impl_->completion, nullptr); f != nullptr)
- std::apply(std::move(f), std::move(*impl_->result));
+
+ if (impl_->completion)
+ impl_->complete_with_result();
}
};
diff --git a/3rdparty/asio/include/asio/experimental/impl/use_coro.hpp b/3rdparty/asio/include/asio/experimental/impl/use_coro.hpp
new file mode 100644
index 00000000000..ab5a2e68959
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/impl/use_coro.hpp
@@ -0,0 +1,214 @@
+//
+// experimental/impl/use_coro.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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 ASIO_EXPERIMENTAL_IMPL_USE_CORO_HPP
+#define ASIO_EXPERIMENTAL_IMPL_USE_CORO_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/deferred.hpp"
+#include "asio/experimental/coro.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename Allocator, typename R>
+struct async_result<experimental::use_coro_t<Allocator>, R()>
+{
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate_impl(Initiation initiation,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void() noexcept, void,
+ asio::associated_executor_t<Initiation>, Allocator>
+ {
+ co_await deferred_async_operation<R(), Initiation, InitArgs...>(
+ deferred_init_tag{}, std::move(initiation), std::move(args)...);
+ }
+
+ template <typename... InitArgs>
+ static auto initiate_impl(asio::detail::initiation_archetype<R()>,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void(), void,
+ asio::any_io_executor, Allocator>;
+
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate(Initiation initiation,
+ experimental::use_coro_t<Allocator> tk, InitArgs&&... args)
+ {
+ return initiate_impl(std::move(initiation), std::allocator_arg,
+ tk.get_allocator(), std::forward<InitArgs>(args)...);
+ }
+};
+
+template <typename Allocator, typename R>
+struct async_result<
+ experimental::use_coro_t<Allocator>, R(asio::error_code)>
+{
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate_impl(Initiation initiation,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void() noexcept, void,
+ asio::associated_executor_t<Initiation>, Allocator>
+ {
+ co_await deferred_async_operation<
+ R(asio::error_code), Initiation, InitArgs...>(
+ deferred_init_tag{}, std::move(initiation), std::move(args)...);
+ }
+
+ template <typename... InitArgs>
+ static auto initiate_impl(
+ asio::detail::initiation_archetype<R(asio::error_code)>,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void(), void,
+ asio::any_io_executor, Allocator>;
+
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate(Initiation initiation,
+ experimental::use_coro_t<Allocator> tk, InitArgs&&... args)
+ {
+ return initiate_impl(std::move(initiation), std::allocator_arg,
+ tk.get_allocator(), std::forward<InitArgs>(args)...);
+ }
+};
+
+template <typename Allocator, typename R>
+struct async_result<
+ experimental::use_coro_t<Allocator>, R(std::exception_ptr)>
+{
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate_impl(Initiation initiation,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void(), void,
+ asio::associated_executor_t<Initiation>, Allocator>
+ {
+ co_await deferred_async_operation<
+ R(std::exception_ptr), Initiation, InitArgs...>(
+ deferred_init_tag{}, std::move(initiation), std::move(args)...);
+ }
+
+ template <typename... InitArgs>
+ static auto initiate_impl(
+ asio::detail::initiation_archetype<R(std::exception_ptr)>,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void(), void,
+ asio::any_io_executor, Allocator>;
+
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate(Initiation initiation,
+ experimental::use_coro_t<Allocator> tk, InitArgs&&... args)
+ {
+ return initiate_impl(std::move(initiation), std::allocator_arg,
+ tk.get_allocator(), std::forward<InitArgs>(args)...);
+ }
+};
+
+template <typename Allocator, typename R, typename T>
+struct async_result<experimental::use_coro_t<Allocator>, R(T)>
+{
+
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate_impl(Initiation initiation,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void() noexcept, T,
+ asio::associated_executor_t<Initiation>, Allocator>
+ {
+ co_return co_await deferred_async_operation<R(T), Initiation, InitArgs...>(
+ deferred_init_tag{}, std::move(initiation), std::move(args)...);
+ }
+
+ template <typename... InitArgs>
+ static auto initiate_impl(asio::detail::initiation_archetype<R(T)>,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void() noexcept, T,
+ asio::any_io_executor, Allocator>;
+
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate(Initiation initiation,
+ experimental::use_coro_t<Allocator> tk, InitArgs&&... args)
+ {
+ return initiate_impl(std::move(initiation), std::allocator_arg,
+ tk.get_allocator(), std::forward<InitArgs>(args)...);
+ }
+};
+
+template <typename Allocator, typename R, typename T>
+struct async_result<
+ experimental::use_coro_t<Allocator>, R(asio::error_code, T)>
+{
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate_impl(Initiation initiation,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void(), T,
+ asio::associated_executor_t<Initiation>, Allocator>
+ {
+ co_return co_await deferred_async_operation<
+ R(asio::error_code, T), Initiation, InitArgs...>(
+ deferred_init_tag{}, std::move(initiation), std::move(args)...);
+ }
+
+ template <typename... InitArgs>
+ static auto initiate_impl(
+ asio::detail::initiation_archetype<
+ R(asio::error_code, T)>,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void(), T, asio::any_io_executor, Allocator>;
+
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate(Initiation initiation,
+ experimental::use_coro_t<Allocator> tk, InitArgs&&... args)
+ {
+ return initiate_impl(std::move(initiation), std::allocator_arg,
+ tk.get_allocator(), std::forward<InitArgs>(args)...);
+ }
+};
+
+template <typename Allocator, typename R, typename T>
+struct async_result<
+ experimental::use_coro_t<Allocator>, R(std::exception_ptr, T)>
+{
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate_impl(Initiation initiation,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void(), T,
+ asio::associated_executor_t<Initiation>, Allocator>
+ {
+ co_return co_await deferred_async_operation<
+ R(std::exception_ptr, T), Initiation, InitArgs...>(
+ deferred_init_tag{}, std::move(initiation), std::move(args)...);
+ }
+
+ template <typename... InitArgs>
+ static auto initiate_impl(
+ asio::detail::initiation_archetype<R(std::exception_ptr, T)>,
+ std::allocator_arg_t, Allocator, InitArgs... args)
+ -> experimental::coro<void(), T, asio::any_io_executor, Allocator>;
+
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate(Initiation initiation,
+ experimental::use_coro_t<Allocator> tk, InitArgs&&... args)
+ {
+ return initiate_impl(std::move(initiation), std::allocator_arg,
+ tk.get_allocator(), std::forward<InitArgs>(args)...);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_IMPL_USE_CORO_HPP
diff --git a/3rdparty/asio/include/asio/experimental/impl/use_promise.hpp b/3rdparty/asio/include/asio/experimental/impl/use_promise.hpp
new file mode 100644
index 00000000000..259edb394bf
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/impl/use_promise.hpp
@@ -0,0 +1,66 @@
+//
+// experimental/impl/use_promise.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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 ASIO_EXPERIMENTAL_IMPL_USE_PROMISE_HPP
+#define ASIO_EXPERIMENTAL_IMPL_USE_PROMISE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <memory>
+#include "asio/async_result.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+
+template <typename Allocator>
+struct use_promise_t;
+
+namespace detail {
+
+template<typename Signature, typename Executor, typename Allocator>
+struct promise_handler;
+
+} // namespace detail
+} // namespace experimental
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename Allocator, typename R, typename... Args>
+struct async_result<experimental::use_promise_t<Allocator>, R(Args...)>
+{
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate(Initiation initiation,
+ experimental::use_promise_t<Allocator> up, InitArgs... args)
+ -> experimental::promise<void(decay_t<Args>...),
+ asio::associated_executor_t<Initiation>, Allocator>
+ {
+ using handler_type = experimental::detail::promise_handler<
+ void(decay_t<Args>...),
+ asio::associated_executor_t<Initiation>, Allocator>;
+
+ handler_type ht{up.get_allocator(), get_associated_executor(initiation)};
+ std::move(initiation)(ht, std::move(args)...);
+ return ht.make_promise();
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_EXPERIMENTAL_IMPL_USE_PROMISE_HPP
diff --git a/3rdparty/asio/include/asio/experimental/parallel_group.hpp b/3rdparty/asio/include/asio/experimental/parallel_group.hpp
index 8a097286199..967fc8802db 100644
--- a/3rdparty/asio/include/asio/experimental/parallel_group.hpp
+++ b/3rdparty/asio/include/asio/experimental/parallel_group.hpp
@@ -2,7 +2,7 @@
// experimental/parallel_group.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,8 +16,12 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-#include <utility>
+#include <vector>
+#include "asio/async_result.hpp"
#include "asio/detail/array.hpp"
+#include "asio/detail/memory.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/detail/utility.hpp"
#include "asio/experimental/cancellation_condition.hpp"
#include "asio/detail/push_options.hpp"
@@ -26,23 +30,6 @@ namespace asio {
namespace experimental {
namespace detail {
-// Helper trait for getting the completion signature from an async operation.
-
-struct parallel_op_signature_probe {};
-
-template <typename T>
-struct parallel_op_signature_probe_result
-{
- typedef T type;
-};
-
-template <typename Op>
-struct parallel_op_signature
-{
- typedef typename decltype(declval<Op>()(
- declval<parallel_op_signature_probe>()))::type type;
-};
-
// Helper trait for getting a tuple from a completion signature.
template <typename Signature>
@@ -51,7 +38,7 @@ struct parallel_op_signature_as_tuple;
template <typename R, typename... Args>
struct parallel_op_signature_as_tuple<R(Args...)>
{
- typedef std::tuple<typename decay<Args>::type...> type;
+ typedef std::tuple<decay_t<Args>...> type;
};
// Helper trait for concatenating completion signatures.
@@ -93,10 +80,59 @@ struct parallel_group_signature<N, Sig0, Sig1, SigN...>
template <typename Condition, typename Handler,
typename... Ops, std::size_t... I>
void parallel_group_launch(Condition cancellation_condition, Handler handler,
- std::tuple<Ops...>& ops, std::index_sequence<I...>);
+ std::tuple<Ops...>& ops, asio::detail::index_sequence<I...>);
+
+// Helper trait for determining ranged parallel group completion signatures.
+
+template <typename Signature, typename Allocator>
+struct ranged_parallel_group_signature;
+
+template <typename R, typename... Args, typename Allocator>
+struct ranged_parallel_group_signature<R(Args...), Allocator>
+{
+ typedef std::vector<std::size_t,
+ ASIO_REBIND_ALLOC(Allocator, std::size_t)> order_type;
+ typedef R raw_type(
+ std::vector<Args, ASIO_REBIND_ALLOC(Allocator, Args)>...);
+ typedef R type(order_type,
+ std::vector<Args, ASIO_REBIND_ALLOC(Allocator, Args)>...);
+};
+
+template <typename Condition, typename Handler,
+ typename Range, typename Allocator>
+void ranged_parallel_group_launch(Condition cancellation_condition,
+ Handler handler, Range&& range, const Allocator& allocator);
+
+char (&parallel_group_has_iterator_helper(...))[2];
+
+template <typename T>
+char parallel_group_has_iterator_helper(T*, typename T::iterator* = 0);
+
+template <typename T>
+struct parallel_group_has_iterator_typedef
+{
+ enum { value = (sizeof((parallel_group_has_iterator_helper)((T*)(0))) == 1) };
+};
} // namespace detail
+/// Type trait used to determine whether a type is a range of asynchronous
+/// operations that can be used with with @c make_parallel_group.
+template <typename T>
+struct is_async_operation_range
+{
+#if defined(GENERATING_DOCUMENTATION)
+ /// The value member is true if the type may be used as a range of
+ /// asynchronous operations.
+ static const bool value;
+#else
+ enum
+ {
+ value = detail::parallel_group_has_iterator_typedef<T>::value
+ };
+#endif
+};
+
/// A group of asynchronous operations that may be launched in parallel.
/**
* See the documentation for asio::experimental::make_parallel_group for
@@ -105,6 +141,20 @@ void parallel_group_launch(Condition cancellation_condition, Handler handler,
template <typename... Ops>
class parallel_group
{
+private:
+ struct initiate_async_wait
+ {
+ template <typename Handler, typename Condition>
+ void operator()(Handler&& h, Condition&& c, std::tuple<Ops...>&& ops) const
+ {
+ detail::parallel_group_launch(
+ std::forward<Condition>(c), std::forward<Handler>(h),
+ ops, asio::detail::index_sequence_for<Ops...>());
+ }
+ };
+
+ std::tuple<Ops...> ops_;
+
public:
/// Constructor.
explicit parallel_group(Ops... ops)
@@ -114,7 +164,7 @@ public:
/// The completion signature for the group of operations.
typedef typename detail::parallel_group_signature<sizeof...(Ops),
- typename detail::parallel_op_signature<Ops>::type...>::type signature;
+ completion_signature_of_t<Ops>...>::type signature;
/// Initiate an asynchronous wait for the group of operations.
/**
@@ -127,7 +177,7 @@ public:
* operations, it must return a asio::cancellation_type value other
* than <tt>asio::cancellation_type::none</tt>.
*
- * @param token A completion token whose signature is comprised of
+ * @param token A @ref completion_token whose signature is comprised of
* a @c std::array<std::size_t, N> indicating the completion order of the
* operations, followed by all operations' completion handler arguments.
*
@@ -142,24 +192,15 @@ public:
ASIO_COMPLETION_TOKEN_FOR(signature) CompletionToken>
auto async_wait(CancellationCondition cancellation_condition,
CompletionToken&& token)
+ -> decltype(
+ asio::async_initiate<CompletionToken, signature>(
+ declval<initiate_async_wait>(), token,
+ std::move(cancellation_condition), std::move(ops_)))
{
return asio::async_initiate<CompletionToken, signature>(
initiate_async_wait(), token,
std::move(cancellation_condition), std::move(ops_));
}
-
-private:
- struct initiate_async_wait
- {
- template <typename Handler, typename Condition>
- void operator()(Handler&& h, Condition&& c, std::tuple<Ops...>&& ops) const
- {
- detail::parallel_group_launch(std::move(c), std::move(h),
- ops, std::make_index_sequence<sizeof...(Ops)>());
- }
- };
-
- std::tuple<Ops...> ops_;
};
/// Create a group of operations that may be launched in parallel.
@@ -200,11 +241,212 @@ private:
* @endcode
*/
template <typename... Ops>
-inline parallel_group<Ops...> make_parallel_group(Ops... ops)
+ASIO_NODISCARD inline parallel_group<Ops...>
+make_parallel_group(Ops... ops)
{
return parallel_group<Ops...>(std::move(ops)...);
}
+/// A range-based group of asynchronous operations that may be launched in
+/// parallel.
+/**
+ * See the documentation for asio::experimental::make_parallel_group for
+ * a usage example.
+ */
+template <typename Range, typename Allocator = std::allocator<void>>
+class ranged_parallel_group
+{
+private:
+ struct initiate_async_wait
+ {
+ template <typename Handler, typename Condition>
+ void operator()(Handler&& h, Condition&& c,
+ Range&& range, const Allocator& allocator) const
+ {
+ detail::ranged_parallel_group_launch(std::move(c),
+ std::move(h), std::forward<Range>(range), allocator);
+ }
+ };
+
+ Range range_;
+ Allocator allocator_;
+
+public:
+ /// Constructor.
+ explicit ranged_parallel_group(Range range,
+ const Allocator& allocator = Allocator())
+ : range_(std::move(range)),
+ allocator_(allocator)
+ {
+ }
+
+ /// The completion signature for the group of operations.
+ typedef typename detail::ranged_parallel_group_signature<
+ completion_signature_of_t<
+ decay_t<decltype(*std::declval<typename Range::iterator>())>>,
+ Allocator>::type signature;
+
+ /// Initiate an asynchronous wait for the group of operations.
+ /**
+ * Launches the group and asynchronously waits for completion.
+ *
+ * @param cancellation_condition A function object, called on completion of
+ * an operation within the group, that is used to determine whether to cancel
+ * the remaining operations. The function object is passed the arguments of
+ * the completed operation's handler. To trigger cancellation of the remaining
+ * operations, it must return a asio::cancellation_type value other
+ * than <tt>asio::cancellation_type::none</tt>.
+ *
+ * @param token A @ref completion_token whose signature is comprised of
+ * a @c std::vector<std::size_t, Allocator> indicating the completion order of
+ * the operations, followed by a vector for each of the completion signature's
+ * arguments.
+ *
+ * The library provides the following @c cancellation_condition types:
+ *
+ * @li asio::experimental::wait_for_all
+ * @li asio::experimental::wait_for_one
+ * @li asio::experimental::wait_for_one_error
+ * @li asio::experimental::wait_for_one_success
+ */
+ template <typename CancellationCondition,
+ ASIO_COMPLETION_TOKEN_FOR(signature) CompletionToken>
+ auto async_wait(CancellationCondition cancellation_condition,
+ CompletionToken&& token)
+ -> decltype(
+ asio::async_initiate<CompletionToken, signature>(
+ declval<initiate_async_wait>(), token,
+ std::move(cancellation_condition),
+ std::move(range_), allocator_))
+ {
+ return asio::async_initiate<CompletionToken, signature>(
+ initiate_async_wait(), token,
+ std::move(cancellation_condition),
+ std::move(range_), allocator_);
+ }
+};
+
+/// Create a group of operations that may be launched in parallel.
+/**
+ * @param range A range containing the operations to be launched.
+ *
+ * For example:
+ * @code
+ * using op_type = decltype(
+ * socket1.async_read_some(
+ * asio::buffer(data1),
+ * asio::deferred
+ * )
+ * );
+ *
+ * std::vector<op_type> ops;
+ *
+ * ops.push_back(
+ * socket1.async_read_some(
+ * asio::buffer(data1),
+ * asio::deferred
+ * )
+ * );
+ *
+ * ops.push_back(
+ * socket2.async_read_some(
+ * asio::buffer(data2),
+ * asio::deferred
+ * )
+ * );
+ *
+ * asio::experimental::make_parallel_group(ops).async_wait(
+ * asio::experimental::wait_for_all(),
+ * [](
+ * std::vector<std::size_t> completion_order,
+ * std::vector<std::error_code> e,
+ * std::vector<std::size_t> n
+ * )
+ * {
+ * for (std::size_t i = 0; i < completion_order.size(); ++i)
+ * {
+ * std::size_t idx = completion_order[i];
+ * std::cout << "socket " << idx << " finished: ";
+ * std::cout << e[idx] << ", " << n[idx] << "\n";
+ * }
+ * }
+ * );
+ * @endcode
+ */
+template <typename Range>
+ASIO_NODISCARD inline ranged_parallel_group<decay_t<Range>>
+make_parallel_group(Range&& range,
+ constraint_t<
+ is_async_operation_range<decay_t<Range>>::value
+ > = 0)
+{
+ return ranged_parallel_group<decay_t<Range>>(std::forward<Range>(range));
+}
+
+/// Create a group of operations that may be launched in parallel.
+/**
+ * @param allocator Specifies the allocator to be used with the result vectors.
+ *
+ * @param range A range containing the operations to be launched.
+ *
+ * For example:
+ * @code
+ * using op_type = decltype(
+ * socket1.async_read_some(
+ * asio::buffer(data1),
+ * asio::deferred
+ * )
+ * );
+ *
+ * std::vector<op_type> ops;
+ *
+ * ops.push_back(
+ * socket1.async_read_some(
+ * asio::buffer(data1),
+ * asio::deferred
+ * )
+ * );
+ *
+ * ops.push_back(
+ * socket2.async_read_some(
+ * asio::buffer(data2),
+ * asio::deferred
+ * )
+ * );
+ *
+ * asio::experimental::make_parallel_group(
+ * std::allocator_arg_t,
+ * my_allocator,
+ * ops
+ * ).async_wait(
+ * asio::experimental::wait_for_all(),
+ * [](
+ * std::vector<std::size_t> completion_order,
+ * std::vector<std::error_code> e,
+ * std::vector<std::size_t> n
+ * )
+ * {
+ * for (std::size_t i = 0; i < completion_order.size(); ++i)
+ * {
+ * std::size_t idx = completion_order[i];
+ * std::cout << "socket " << idx << " finished: ";
+ * std::cout << e[idx] << ", " << n[idx] << "\n";
+ * }
+ * }
+ * );
+ * @endcode
+ */
+template <typename Allocator, typename Range>
+ASIO_NODISCARD inline ranged_parallel_group<decay_t<Range>, Allocator>
+make_parallel_group(allocator_arg_t, const Allocator& allocator, Range&& range,
+ constraint_t<
+ is_async_operation_range<decay_t<Range>>::value
+ > = 0)
+{
+ return ranged_parallel_group<decay_t<Range>, Allocator>(
+ std::forward<Range>(range), allocator);
+}
+
} // namespace experimental
} // namespace asio
diff --git a/3rdparty/asio/include/asio/experimental/prepend.hpp b/3rdparty/asio/include/asio/experimental/prepend.hpp
index 4f892999e3e..503981f776f 100644
--- a/3rdparty/asio/include/asio/experimental/prepend.hpp
+++ b/3rdparty/asio/include/asio/experimental/prepend.hpp
@@ -2,7 +2,7 @@
// experimental/prepend.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,56 +16,21 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-#include <tuple>
-#include "asio/detail/type_traits.hpp"
+#include "asio/prepend.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
namespace experimental {
-/// Completion token type used to specify that the completion handler
-/// arguments should be passed additional values before the results of the
-/// operation.
-template <typename CompletionToken, typename... Values>
-class prepend_t
-{
-public:
- /// Constructor.
- template <typename T, typename... V>
- ASIO_CONSTEXPR explicit prepend_t(
- ASIO_MOVE_ARG(T) completion_token,
- ASIO_MOVE_ARG(V)... values)
- : token_(ASIO_MOVE_CAST(T)(completion_token)),
- values_(ASIO_MOVE_CAST(V)(values)...)
- {
- }
-
-//private:
- CompletionToken token_;
- std::tuple<Values...> values_;
-};
-
-/// Completion token type used to specify that the completion handler
-/// arguments should be passed additional values before the results of the
-/// operation.
-template <typename CompletionToken, typename... Values>
-inline ASIO_CONSTEXPR prepend_t<
- typename decay<CompletionToken>::type, typename decay<Values>::type...>
-prepend(ASIO_MOVE_ARG(CompletionToken) completion_token,
- ASIO_MOVE_ARG(Values)... values)
-{
- return prepend_t<
- typename decay<CompletionToken>::type, typename decay<Values>::type...>(
- ASIO_MOVE_CAST(CompletionToken)(completion_token),
- ASIO_MOVE_CAST(Values)(values)...);
-}
+#if !defined(ASIO_NO_DEPRECATED)
+using asio::prepend_t;
+using asio::prepend;
+#endif // !defined(ASIO_NO_DEPRECATED)
} // namespace experimental
} // namespace asio
#include "asio/detail/pop_options.hpp"
-#include "asio/experimental/impl/prepend.hpp"
-
#endif // ASIO_EXPERIMENTAL_PREPEND_HPP
diff --git a/3rdparty/asio/include/asio/experimental/promise.hpp b/3rdparty/asio/include/asio/experimental/promise.hpp
index 89ca9c1b496..2bcf66b4e30 100644
--- a/3rdparty/asio/include/asio/experimental/promise.hpp
+++ b/3rdparty/asio/include/asio/experimental/promise.hpp
@@ -2,8 +2,8 @@
// experimental/promise.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -12,28 +12,28 @@
#ifndef ASIO_EXPERIMENTAL_PROMISE_HPP
#define ASIO_EXPERIMENTAL_PROMISE_HPP
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/any_io_executor.hpp"
#include "asio/associated_cancellation_slot.hpp"
+#include "asio/associated_executor.hpp"
#include "asio/bind_executor.hpp"
#include "asio/cancellation_signal.hpp"
-#include "asio/experimental/detail/completion_handler_erasure.hpp"
+#include "asio/dispatch.hpp"
#include "asio/experimental/impl/promise.hpp"
#include "asio/post.hpp"
-#include <variant>
+#include <algorithm>
#include "asio/detail/push_options.hpp"
namespace asio {
namespace experimental {
-template <typename Executor = any_io_executor>
-struct use_promise_t {};
-
-constexpr use_promise_t<> use_promise;
-
template <typename T>
struct is_promise : std::false_type {};
@@ -43,9 +43,6 @@ struct is_promise<promise<Ts...>> : std::true_type {};
template <typename T>
constexpr bool is_promise_v = is_promise<T>::value;
-template <typename T>
-concept is_promise_c = is_promise_v<std::remove_reference_t<T>>;
-
template <typename ... Ts>
struct promise_value_type
{
@@ -61,48 +58,70 @@ struct promise_value_type<T>
template <>
struct promise_value_type<>
{
- using type = std::monostate;
+ using type = std::tuple<>;
};
#if defined(GENERATING_DOCUMENTATION)
-/// The primary template is not defined.
-template<typename Signature = void(), typename Executor = any_io_executor>
+/// A disposable handle for an eager operation.
+/**
+ * @tparam Signature The signature of the operation.
+ *
+ * @tparam Executor The executor to be used by the promise (taken from the
+ * operation).
+ *
+ * @tparam Allocator The allocator used for the promise. Can be set through
+ * use_allocator.
+ *
+ * A promise can be used to initiate an asynchronous option that can be
+ * completed later. If the promise gets destroyed before completion, the
+ * operation gets a cancel signal and the result is ignored.
+ *
+ * A promise fulfills the requirements of async_operation.
+ *
+ * @par Examples
+ * Reading and writing from one coroutine.
+ * @code
+ * awaitable<void> read_write_some(asio::ip::tcp::socket & sock,
+ * asio::mutable_buffer read_buf, asio::const_buffer to_write)
+ * {
+ * auto p = asio::async_read(read_buf, asio::use_awaitable);
+ * co_await asio::async_write_some(to_write, asio::deferred);
+ * co_await p;
+ * }
+ * @endcode
+ */
+template<typename Signature = void(),
+ typename Executor = asio::any_io_executor,
+ typename Allocator = std::allocator<void>>
struct promise
-{
-};
+#else
+template <typename ... Ts, typename Executor, typename Allocator>
+struct promise<void(Ts...), Executor, Allocator>
#endif // defined(GENERATING_DOCUMENTATION)
-
-template <typename ... Ts, typename Executor>
-struct promise<void(Ts...), Executor>
{
+ /// The value that's returned by the promise.
using value_type = typename promise_value_type<Ts...>::type;
- using tuple_type = std::tuple<Ts...>;
- using executor_type = Executor;
-
- executor_type get_executor() const
- {
- if (impl_)
- return impl_->executor;
- else
- return {};
- }
+ /// Cancel the promise. Usually done through the destructor.
void cancel(cancellation_type level = cancellation_type::all)
{
if (impl_ && !impl_->done)
{
asio::dispatch(impl_->executor,
- [level, impl = impl_]{impl->cancel.emit(level);});
+ [level, impl = impl_]{ impl->cancel.emit(level); });
}
}
- bool complete() const noexcept
+ /// Check if the promise is completed already.
+ bool completed() const noexcept
{
return impl_ && impl_->done;
}
- template <typename CompletionToken>
- auto async_wait(CompletionToken&& token)
+ /// Wait for the promise to become ready.
+ template <ASIO_COMPLETION_TOKEN_FOR(void(Ts...)) CompletionToken>
+ inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(Ts...))
+ operator()(CompletionToken&& token)
{
assert(impl_);
@@ -114,435 +133,52 @@ struct promise<void(Ts...), Executor>
promise(const promise& ) = delete;
promise(promise&& ) noexcept = default;
+ /// Destruct the promise and cancel the operation.
+ /**
+ * It is safe to destruct a promise of a promise that didn't complete.
+ */
~promise() { cancel(); }
- template <execution::executor Executor1, is_promise_c ... Ps>
- static auto race(Executor1 exec, Ps ... ps)
- -> promise<void(std::variant<typename Ps::value_type...>), Executor1>
- {
- using var_t = std::variant<typename Ps::value_type...>;
- using pi = detail::promise_impl<void(var_t), Executor1>;
-
- struct impl_t : pi
- {
- impl_t(Executor1 exec, Ps&& ... ps)
- : pi(std::move(exec)),
- tup(std::move(ps)...)
- {
- this->slot.template emplace<cancel_handler>(this);
- }
-
- struct cancel_handler
- {
- impl_t* self;
-
- cancel_handler(impl_t* self)
- : self(self)
- {
- }
-
- void operator()(cancellation_type ct)
- {
- [ct, s=self]<std::size_t... Idx>(std::index_sequence<Idx...>)
- {
- (std::get<Idx>(s->tup).cancel(ct), ... );
- }(std::make_index_sequence<sizeof...(Ps)>{});
- }
- };
-
- std::tuple<std::remove_reference_t<Ps>...> tup;
- cancellation_slot slot{this->cancel.slot()};
- };
-
- auto impl = std::allocate_shared<impl_t>(
- get_associated_allocator(exec), exec, std::move(ps)...);
-
- impl->executor = exec;
-
- [impl, exec]<std::size_t... Idx>(std::index_sequence<Idx...>)
- {
- auto step =
- [&]<std::size_t I>(std::integral_constant<std::size_t, I>)
- {
- return [impl]<typename... Args > (Args&& ... args)
- {
- if (impl->done)
- return;
- impl->result = var_t(std::in_place_index<I>,
- std::forward<Args>(args)...);
- impl->done = true;
- if (auto f = std::exchange(impl->completion, nullptr); !!f)
- std::apply(std::move(f), std::move(*impl->result));
-
- auto cancel =
- [&]<std::size_t Id>(std::integral_constant<std::size_t, Id>)
- {
- if constexpr (I != Id)
- get<I>(impl->tup).cancel();
- };
-
- (cancel(std::integral_constant<std::size_t, Idx>{}), ...);
- };
- };
-
- (
- std::get<Idx>(impl->tup).async_wait(
- bind_executor(exec,
- step(std::integral_constant<std::size_t, Idx>{}))),
- ...
- );
- }(std::make_index_sequence<sizeof...(Ps)>{});
-
- return {impl};
- }
-
- template <execution::executor Executor1, is_promise_c ... Ps>
- static auto all(Executor1 exec, Ps ... ps)
- -> promise<void(typename Ps::value_type...), Executor1>
- {
- using pi = detail::promise_impl<
- void(typename Ps::value_type...), Executor1>;
-
- struct impl_t : pi
- {
- impl_t(Executor1 exec, Ps&& ... ps)
- : pi(std::move(exec)),
- tup(std::move(ps)...)
- {
- this->slot.template emplace<cancel_handler>(this);
- }
-
- struct cancel_handler
- {
- impl_t* self;
-
- cancel_handler(impl_t* self)
- : self(self)
- {
- }
-
- void operator()(cancellation_type level)
- {
- [level, s=self]<std::size_t... Idx>(std::index_sequence<Idx...>)
- {
- (std::get<Idx>(s->tup).cancel(level), ... );
- }(std::make_index_sequence<sizeof...(Ps)>{});
- }
- };
-
- std::tuple<std::remove_reference_t<Ps>...> tup;
- std::tuple<std::optional<typename Ps::value_type>...> partial_result;
- cancellation_slot slot{this->cancel.slot()};
- };
-
- auto impl = std::allocate_shared<impl_t>(
- get_associated_allocator(exec), exec, std::move(ps)...);
- impl->executor = exec;
-
- [impl, exec]<std::size_t... Idx>(std::index_sequence<Idx...>)
- {
- auto step =
- [&]<std::size_t I>(std::integral_constant<std::size_t, I>)
- {
- return [impl]<typename... Args>(Args&& ... args)
- {
- std::get<I>(impl->partial_result).emplace(
- std::forward<Args>(args)...);
- if ((std::get<Idx>(impl->partial_result) && ...)) // we're done.
- {
- impl->result = {*std::get<Idx>(impl->partial_result)...};
-
- impl->done = true;
- if (auto f = std::exchange(impl->completion, nullptr); !!f)
- std::apply(std::move(f), std::move(*impl->result));
- }
- };
- };
-
- (
- std::get<Idx>(impl->tup).async_wait(
- bind_executor(exec,
- step(std::integral_constant<std::size_t, Idx>{}))),
- ...
- );
- }(std::make_index_sequence<sizeof...(Ps)>{});
-
- return {impl};
- }
-
- template <is_promise_c ... Ps>
- static auto race(Ps ... ps)
- {
- auto exec = get<0>(std::tie(ps...)).get_executor();
- return race(std::move(exec), std::move(ps)...);
- }
-
- template <is_promise_c ... Ps>
- static auto all(Ps ... ps)
- {
- auto exec = get<0>(std::tie(ps...)).get_executor();
- return all(std::move(exec), std::move(ps)...);
- }
-
- template <execution::executor Executor1, typename Range>
-#if !defined(GENERATING_DOCUMENTATION)
- requires requires (Range r)
- {
- {*std::begin(r)} -> is_promise_c;
- {*std:: end(r)} -> is_promise_c;
- }
-#endif // !defined(GENERATING_DOCUMENTATION)
- static auto race(Executor1 exec, Range range)
- {
- using var_t = typename std::decay_t<
- decltype(*std::begin(range))>::value_type;
- using signature_type = std::conditional_t<
- std::is_same_v<var_t, std::monostate>,
- void(std::size_t),
- void(std::size_t, var_t)>;
- using pi = detail::promise_impl<signature_type, Executor1>;
- using promise_t = promise<signature_type, Executor1>;
-
- struct impl_t : pi
- {
- impl_t(Executor1 exec, Range&& range)
- : pi(std::move(exec)),
- range(std::move(range))
- {
- this->slot.template emplace<cancel_handler>(this);
- }
-
- struct cancel_handler
- {
- impl_t* self;
-
- cancel_handler(impl_t* self)
- : self(self)
- {
- }
-
- void operator()(asio::cancellation_type ct)
- {
- for (auto& r : self->range)
- r.cancel(ct);
- }
- };
-
- Range range;
- cancellation_slot slot{this->cancel.slot()};
- };
-
- const auto size = std::distance(std::begin(range), std::end(range));
- auto impl = std::allocate_shared<impl_t>(
- get_associated_allocator(exec), exec, std::move(range));
- impl->executor = exec;
-
- if (size == 0u)
- {
- if constexpr (std::is_same_v<var_t, std::monostate>)
- impl->result = {-1};
- else
- impl->result = {-1, var_t{}};
-
- impl->done = true;
- if (auto f = std::exchange(impl->completion, nullptr); !!f)
- {
- asio::post(exec,
- [impl, f = std::move(f)]() mutable
- {
- std::apply(std::move(f), std::move(*impl->result));
- });
- }
- return promise_t{impl};
- }
- auto idx = 0u;
- for (auto& val : impl->range)
- {
- val.async_wait(
- bind_executor(exec,
- [idx, impl]<typename... Args>(Args&&... args)
- {
- if (impl->done)
- return;
- if constexpr (std::is_same_v<var_t, std::monostate>)
- impl->result = idx;
- else
- impl->result = std::make_tuple(idx,
- var_t(std::forward<Args>(args)...));
- impl->done = true;
- if (auto f = std::exchange(impl->completion, nullptr); !!f)
- std::apply(std::move(f), std::move(*impl->result));
-
- auto jdx = 0u;
-
- for (auto &tc : impl->range)
- if (jdx++ != idx)
- tc.cancel();
- }));
- idx++;
- }
- return promise_t{impl};
- }
-
-
- template <execution::executor Executor1, typename Range>
-#if !defined(GENERATING_DOCUMENTATION)
- requires requires (Range r)
- {
- {*std::begin(r)} -> is_promise_c;
- {*std:: end(r)} -> is_promise_c;
- }
-#endif // !defined(GENERATING_DOCUMENTATION)
- static auto all(Executor1 exec, Range range)
- -> promise<
- void(
- std::vector<
- typename std::decay_t<
- decltype(*std::begin(range))
- >::value_type
- >
- ), Executor1>
- {
- using var_t = typename std::decay_t<
- decltype(*std::begin(range))>::value_type;
- using pi = detail::promise_impl<void(std::vector<var_t>), Executor1>;
-
- struct impl_t : pi
- {
- impl_t(Executor1 exec, Range&& range)
- : pi(std::move(exec)),
- range(std::move(range))
- {
- this->slot.template emplace<cancel_handler>(this);
- }
-
- struct cancel_handler
- {
- impl_t* self;
-
- cancel_handler(impl_t* self)
- : self(self)
- {
- }
-
- void operator()(cancellation_type ct)
- {
- for (auto& r : self->range)
- r.cancel(ct);
- }
- };
-
- Range range;
- std::vector<std::optional<var_t>> partial_result;
- cancellation_slot slot{this->cancel.slot()};
- };
-
- const auto size = std::distance(std::begin(range), std::end(range));
- auto impl = std::allocate_shared<impl_t>(
- get_associated_allocator(exec), exec, std::move(range));
- impl->executor = exec;
- impl->partial_result.resize(size);
-
- if (size == 0u)
- {
- impl->result.emplace();
- impl->done = true;
- if (auto f = std::exchange(impl->completion, nullptr); !!f)
- asio::post(exec, [impl, f = std::move(f)]() mutable
- {
- std::apply(std::move(f), std::move(*impl->result));
- });
- return {impl};
- }
- auto idx = 0u;
- for (auto& val : impl->range) {
- val.async_wait(bind_executor(
- exec,
- [idx, impl]<typename... Args>(Args&&... args) {
-
- impl->partial_result[idx].emplace(std::forward<Args>(args)...);
- if (std::all_of(impl->partial_result.begin(),
- impl->partial_result.end(),
- [](auto &opt) {return opt.has_value();}))
- {
- impl->result.emplace();
- get<0>(*impl->result).reserve(impl->partial_result.size());
- for (auto& p : impl->partial_result)
- get<0>(*impl->result).push_back(std::move(*p));
-
- impl->done = true;
- if (auto f = std::exchange(impl->completion, nullptr); !!f)
- std::apply(std::move(f), std::move(*impl->result));
- }
-
- }));
- idx++;
- }
- return {impl};
- }
-
- template <typename Range>
-#if !defined(GENERATING_DOCUMENTATION)
- requires requires (Range r)
- {
- {*std::begin(r)} -> is_promise_c;
- {*std:: end(r)} -> is_promise_c;
- }
-#endif // !defined(GENERATING_DOCUMENTATION)
- static auto race(Range range)
- {
- if (std::begin(range) == std::end(range))
- throw std::logic_error(
- "Can't use race on an empty range with deduced executor");
- else
- return race(std::begin(range)->get_executor(), std::move(range));
- }
-
- template <typename Range>
-#if !defined(GENERATING_DOCUMENTATION)
- requires requires (Range&& r)
- {
- {*std::begin(r)} -> is_promise_c;
- {*std:: end(r)} -> is_promise_c;
- }
-#endif // !defined(GENERATING_DOCUMENTATION)
- static auto all(Range range)
- {
- if (std::begin(range) == std::end(range))
- throw std::logic_error(
- "Can't use all on an empty range with deduced executor");
- else
- return all(std::begin(range)->get_executor(), std::move(range));
- }
private:
#if !defined(GENERATING_DOCUMENTATION)
- template <typename, typename> friend struct promise;
- friend struct detail::promise_handler<void(Ts...)>;
+ template <typename, typename, typename> friend struct promise;
+ friend struct detail::promise_handler<void(Ts...), Executor, Allocator>;
#endif // !defined(GENERATING_DOCUMENTATION)
- std::shared_ptr<detail::promise_impl<void(Ts...), Executor>> impl_;
- promise(std::shared_ptr<detail::promise_impl<void(Ts...), Executor>> impl)
+ std::shared_ptr<detail::promise_impl<
+ void(Ts...), Executor, Allocator>> impl_;
+
+ promise(
+ std::shared_ptr<detail::promise_impl<
+ void(Ts...), Executor, Allocator>> impl)
: impl_(impl)
{
}
struct initiate_async_wait
{
- std::shared_ptr<detail::promise_impl<void(Ts...), Executor>> self_;
+ std::shared_ptr<detail::promise_impl<
+ void(Ts...), Executor, Allocator>> self_;
template <typename WaitHandler>
void operator()(WaitHandler&& handler) const
{
- const auto exec = get_associated_executor(handler, self_->executor);
+ const auto alloc = get_associated_allocator(
+ handler, self_->get_allocator());
+
auto cancel = get_associated_cancellation_slot(handler);
+
if (self_->done)
{
+ auto exec = asio::get_associated_executor(
+ handler, self_->get_executor());
+
asio::post(exec,
- [self = self_, h = std::forward<WaitHandler>(handler)]() mutable
+ [self = std::move(self_),
+ handler = std::forward<WaitHandler>(handler)]() mutable
{
- std::apply(std::forward<WaitHandler>(h),
- std::move(*self->result));
+ self->apply(std::move(handler));
});
}
else
@@ -551,26 +187,29 @@ private:
{
struct cancel_handler
{
- std::weak_ptr<detail::promise_impl<void(Ts...), Executor>> self;
+ std::weak_ptr<detail::promise_impl<
+ void(Ts...), Executor, Allocator>> self;
cancel_handler(
- std::weak_ptr<detail::promise_impl<void(Ts...), Executor>> self)
+ std::weak_ptr<detail::promise_impl<
+ void(Ts...), Executor, Allocator>> self)
: self(std::move(self))
{
}
void operator()(cancellation_type level) const
{
- if (auto p = self.lock(); p != nullptr)
+ if (auto p = self.lock())
+ {
p->cancel.emit(level);
-
+ p->cancel_();
+ }
}
};
-
cancel.template emplace<cancel_handler>(self_);
}
- self_->completion = {exec, std::forward<WaitHandler>(handler)};
+ self_->set_completion(alloc, std::forward<WaitHandler>(handler));
}
}
};
@@ -578,27 +217,6 @@ private:
} // namespace experimental
-#if !defined(GENERATING_DOCUMENTATION)
-
-template <typename Executor, typename R, typename... Args>
-struct async_result<experimental::use_promise_t<Executor>, R(Args...)>
-{
- using handler_type = experimental::detail::promise_handler<
- void(typename decay<Args>::type...), Executor>;
-
- template <typename Initiation, typename... InitArgs>
- static auto initiate(Initiation initiation,
- experimental::use_promise_t<Executor>, InitArgs... args)
- -> typename handler_type::promise_type
- {
- handler_type ht{get_associated_executor(initiation)};
- std::move(initiation)(ht, std::move(args)...);
- return ht.make_promise();
- }
-};
-
-#endif // !defined(GENERATING_DOCUMENTATION)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/experimental/use_coro.hpp b/3rdparty/asio/include/asio/experimental/use_coro.hpp
index a94d3ae5191..d9e0544106c 100644
--- a/3rdparty/asio/include/asio/experimental/use_coro.hpp
+++ b/3rdparty/asio/include/asio/experimental/use_coro.hpp
@@ -2,8 +2,8 @@
// experimental/use_coro.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -12,12 +12,14 @@
#ifndef ASIO_EXPERIMENTAL_USE_CORO_HPP
#define ASIO_EXPERIMENTAL_USE_CORO_HPP
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
#include "asio/detail/config.hpp"
-#include <optional>
-#include "asio/bind_cancellation_slot.hpp"
-#include "asio/bind_executor.hpp"
-#include "asio/error_code.hpp"
-#include "asio/experimental/detail/partial_promise.hpp"
+#include <memory>
+#include "asio/deferred.hpp"
+#include "asio/detail/source_location.hpp"
#include "asio/detail/push_options.hpp"
@@ -27,256 +29,161 @@ class any_io_executor;
namespace experimental {
-template <typename Executor = any_io_executor>
+/// A @ref completion_token that creates another coro for the task completion.
+/**
+ * The @c use_coro_t class, with its value @c use_coro, is used to represent an
+ * operation that can be awaited by the current resumable coroutine. This
+ * completion token may be passed as a handler to an asynchronous operation.
+ * For example:
+ *
+ * @code coro<void> my_coroutine(tcp::socket my_socket)
+ * {
+ * std::size_t n = co_await my_socket.async_read_some(buffer, use_coro);
+ * ...
+ * } @endcode
+ *
+ * When used with co_await, the initiating function (@c async_read_some in the
+ * above example) suspends the current coroutine. The coroutine is resumed when
+ * the asynchronous operation completes, and the result of the operation is
+ * returned.
+ *
+ * Note that this token is not the most efficient (use @c asio::deferred
+ * for that) but does provide type erasure, as it will always return a @c coro.
+ */
+template <typename Allocator = std::allocator<void>>
struct use_coro_t
{
-};
-
-constexpr use_coro_t<> use_coro;
-
-template <typename Yield, typename Return, typename Executor>
-struct coro;
-
-namespace detail {
-template <typename Yield, typename Return, typename Executor>
-struct coro_promise;
-
-template <typename Executor, typename... Ts>
-struct coro_init_handler
-{
- struct handler_t
+ /// The allocator type. The allocator is used when constructing the
+ /// @c std::promise object for a given asynchronous operation.
+ typedef Allocator allocator_type;
+
+ /// Default constructor.
+ constexpr use_coro_t(
+ allocator_type allocator = allocator_type{}
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , asio::detail::source_location location =
+ asio::detail::source_location::current()
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ )
+ : allocator_(allocator)
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , file_name_(location.file_name()),
+ line_(location.line()),
+ function_name_(location.function_name())
+# else // defined(ASIO_HAS_SOURCE_LOCATION)
+ , file_name_(0),
+ line_(0),
+ function_name_(0)
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
{
- };
-
- constexpr static handler_t handler{};
+ }
- struct init_helper;
- struct promise_type
+ /// Specify an alternate allocator.
+ template <typename OtherAllocator>
+ use_coro_t<OtherAllocator> rebind(const OtherAllocator& allocator) const
{
- auto initial_suspend() noexcept { return suspend_always{}; }
-
- auto final_suspend() noexcept { return suspend_always(); }
-
- void return_void() {}
-
- void unhandled_exception() { assert(false); }
-
- auto await_transform(handler_t)
- {
- assert(executor);
- assert(h);
- return init_helper{this};
- }
-
- std::optional<Executor> executor;
- std::optional<std::tuple<Ts...>> result;
- coroutine_handle<> h;
-
- coro_init_handler get_return_object() { return coro_init_handler{this}; }
-
- cancellation_slot cancel_slot;
- };
-
- struct init_helper
- {
- promise_type *self_;
-
- constexpr static bool await_ready() noexcept { return true; }
-
- constexpr static void await_suspend(coroutine_handle<>) noexcept {}
-
- auto await_resume() const noexcept
- {
- assert(self_);
- return bind_cancellation_slot(self_->cancel_slot,
- bind_executor(*self_->executor, [self = self_](Ts... ts)
- {
- self->result.emplace(std::move(ts)...);
- self->h.resume();
- }));
- }
- };
-
- promise_type* promise;
+ return use_future_t<OtherAllocator>(allocator);
+ }
- void unhandled_exception() noexcept
+ /// Obtain allocator.
+ allocator_type get_allocator() const
{
- throw;
+ return allocator_;
}
- struct noexcept_version
+ /// Constructor used to specify file name, line, and function name.
+ constexpr use_coro_t(const char* file_name,
+ int line, const char* function_name,
+ allocator_type allocator = allocator_type{}) :
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+ file_name_(file_name),
+ line_(line),
+ function_name_(function_name),
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ allocator_(allocator)
{
- promise_type *promise;
-
- constexpr static bool await_ready() noexcept { return false; }
-
- template <typename Yield, typename Return,
- convertible_to<Executor> Executor1>
- auto await_suspend(
- coroutine_handle<coro_promise<Yield, Return, Executor1> > h) noexcept
- {
- promise->executor = h.promise().get_executor();
- promise->h = h;
- return coroutine_handle<promise_type>::from_promise(*promise);
- }
-
- template <typename... Args>
- static auto resume_impl(std::tuple<Args...>&& tup)
- {
- return std::move(tup);
- }
-
- template <typename Arg>
- static auto resume_impl(std::tuple<Arg>&& tup)
- {
- return get<0>(std::move(tup));
- }
-
- static void resume_impl(std::tuple<>&&) {}
-
- auto await_resume() const noexcept
- {
- auto res = std::move(promise->result.value());
- coroutine_handle<promise_type>::from_promise(*promise).destroy();
- return resume_impl(std::move(res));
- }
- };
+#if !defined(ASIO_ENABLE_HANDLER_TRACKING)
+ (void)file_name;
+ (void)line;
+ (void)function_name;
+#endif // !defined(ASIO_ENABLE_HANDLER_TRACKING)
+ }
- struct throwing_version
+ /// Adapts an executor to add the @c use_coro_t completion token as the
+ /// default.
+ template <typename InnerExecutor>
+ struct executor_with_default : InnerExecutor
{
- promise_type *promise;
-
- constexpr static bool await_ready() noexcept { return false; }
-
- template <typename Yield, typename Return,
- convertible_to<Executor> Executor1>
- auto await_suspend(
- coroutine_handle<coro_promise<Yield, Return, Executor1> > h) noexcept
- {
- promise->executor = h.promise().get_executor();
- promise->h = h;
- return coroutine_handle<promise_type>::from_promise(*promise);
- }
-
- template <typename... Args>
- static auto resume_impl(std::tuple<Args...>&& tup)
- {
- return std::move(tup);
- }
-
- static void resume_impl(std::tuple<>&&) {}
-
- template <typename Arg>
- static auto resume_impl(std::tuple<Arg>&& tup)
- {
- return get<0>(std::move(tup));
- }
-
- template <typename... Args>
- static auto resume_impl(std::tuple<std::exception_ptr, Args...>&& tup)
- {
- auto ex = get<0>(std::move(tup));
- if (ex)
- std::rethrow_exception(ex);
-
- if constexpr (sizeof...(Args) == 0u)
- return;
- else if constexpr (sizeof...(Args) == 1u)
- return get<1>(std::move(tup));
- else
- {
- return
- [&]<std::size_t... Idx>(std::index_sequence<Idx...>)
- {
- return std::make_tuple(std::get<Idx + 1>(std::move(tup))...);
- }(std::make_index_sequence<sizeof...(Args) - 1>{});
- }
- }
-
- template <typename... Args>
- static auto resume_impl(
- std::tuple<asio::error_code, Args...>&& tup)
- {
- auto ec = get<0>(std::move(tup));
- if (ec)
- asio::detail::throw_exception(
- asio::system_error(ec, "error_code in use_coro"));
-
- if constexpr (sizeof...(Args) == 0u)
- return;
- else if constexpr (sizeof...(Args) == 1u)
- return get<1>(std::move(tup));
- else
- return
- [&]<std::size_t... Idx>(std::index_sequence<Idx...>)
- {
- return std::make_tuple(std::get<Idx + 1>(std::move(tup))...);
- }(std::make_index_sequence<sizeof...(Args) - 1>{});
- }
-
- static auto resume_impl(std::tuple<std::exception_ptr>&& tup)
- {
- auto ex = get<0>(std::move(tup));
- if (ex)
- std::rethrow_exception(ex);
- }
-
- static auto resume_impl(
- std::tuple<asio::error_code>&& tup)
+ /// Specify @c use_coro_t as the default completion token type.
+ typedef use_coro_t default_completion_token_type;
+
+ /// Construct the adapted executor from the inner executor type.
+ template <typename InnerExecutor1>
+ executor_with_default(const InnerExecutor1& ex,
+ constraint_t<
+ conditional_t<
+ !is_same<InnerExecutor1, executor_with_default>::value,
+ is_convertible<InnerExecutor1, InnerExecutor>,
+ false_type
+ >::value
+ > = 0) noexcept
+ : InnerExecutor(ex)
{
- auto ec = get<0>(std::move(tup));
- if (ec)
- asio::detail::throw_error(ec, "error_code in use_coro");
- }
-
- auto await_resume() const
- {
- auto res = std::move(promise->result.value());
- coroutine_handle<promise_type>::from_promise(*promise).destroy();
- return resume_impl(std::move(res));
}
};
- auto as_noexcept(cancellation_slot&& sl) && noexcept
+ /// Type alias to adapt an I/O object to use @c use_coro_t as its
+ /// default completion token type.
+ template <typename T>
+ using as_default_on_t = typename T::template rebind_executor<
+ executor_with_default<typename T::executor_type>>::other;
+
+ /// Function helper to adapt an I/O object to use @c use_coro_t as its
+ /// default completion token type.
+ template <typename T>
+ static typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other
+ as_default_on(T&& object)
{
- promise->cancel_slot = std::move(sl);
- return noexcept_version{promise};
+ return typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other(static_cast<T&&>(object));
}
- auto as_throwing(cancellation_slot&& sl) && noexcept
- {
- promise->cancel_slot = std::move(sl);
- return throwing_version{promise};
- }
-};
-
-} // namespace detail
-} // namespace experimental
-
-#if !defined(GENERATING_DOCUMENTATION)
-
-template <typename Executor, typename R, typename... Args>
-struct async_result<experimental::use_coro_t<Executor>, R(Args...)>
-{
- using return_type = experimental::detail::coro_init_handler<
- Executor, typename decay<Args>::type...>;
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+ const char* file_name_;
+ int line_;
+ const char* function_name_;
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
- template <typename Initiation, typename... InitArgs>
- static return_type initiate(Initiation initiation,
- experimental::use_coro_t<Executor>, InitArgs... args)
- {
- std::move(initiation)(co_await return_type::handler, std::move(args)...);
- }
+private:
+ Allocator allocator_;
};
-#endif // !defined(GENERATING_DOCUMENTATION)
+/// A @ref completion_token object that represents the currently executing
+/// resumable coroutine.
+/**
+ * See the documentation for asio::use_coro_t for a usage example.
+ */
+#if defined(GENERATING_DOCUMENTATION)
+constexpr use_coro_t<> use_coro;
+#else
+constexpr use_coro_t<> use_coro(0, 0, 0);
+#endif
+} // namespace experimental
} // namespace asio
#include "asio/detail/pop_options.hpp"
+#include "asio/experimental/impl/use_coro.hpp"
#include "asio/experimental/coro.hpp"
#endif // ASIO_EXPERIMENTAL_USE_CORO_HPP
diff --git a/3rdparty/asio/include/asio/experimental/use_promise.hpp b/3rdparty/asio/include/asio/experimental/use_promise.hpp
new file mode 100644
index 00000000000..cf19aca59d5
--- /dev/null
+++ b/3rdparty/asio/include/asio/experimental/use_promise.hpp
@@ -0,0 +1,111 @@
+//
+// experimental/use_promise.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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 ASIO_EXPERIMENTAL_USE_PROMISE_HPP
+#define ASIO_EXPERIMENTAL_USE_PROMISE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <memory>
+#include "asio/detail/type_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace experimental {
+
+template <typename Allocator = std::allocator<void>>
+struct use_promise_t
+{
+ /// The allocator type. The allocator is used when constructing the
+ /// @c promise object for a given asynchronous operation.
+ typedef Allocator allocator_type;
+
+ /// Construct using default-constructed allocator.
+ constexpr use_promise_t()
+ {
+ }
+
+ /// Construct using specified allocator.
+ explicit use_promise_t(const Allocator& allocator)
+ : allocator_(allocator)
+ {
+ }
+
+ /// Obtain allocator.
+ allocator_type get_allocator() const noexcept
+ {
+ return allocator_;
+ }
+
+ /// Adapts an executor to add the @c use_promise_t completion token as the
+ /// default.
+ template <typename InnerExecutor>
+ struct executor_with_default : InnerExecutor
+ {
+ /// Specify @c use_promise_t as the default completion token type.
+ typedef use_promise_t<Allocator> default_completion_token_type;
+
+ /// Construct the adapted executor from the inner executor type.
+ executor_with_default(const InnerExecutor& ex) noexcept
+ : InnerExecutor(ex)
+ {
+ }
+
+ /// Convert the specified executor to the inner executor type, then use
+ /// that to construct the adapted executor.
+ template <typename OtherExecutor>
+ executor_with_default(const OtherExecutor& ex,
+ constraint_t<
+ is_convertible<OtherExecutor, InnerExecutor>::value
+ > = 0) noexcept
+ : InnerExecutor(ex)
+ {
+ }
+ };
+
+ /// Function helper to adapt an I/O object to use @c use_promise_t as its
+ /// default completion token type.
+ template <typename T>
+ static typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other
+ as_default_on(T&& object)
+ {
+ return typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other(static_cast<T&&>(object));
+ }
+
+ /// Specify an alternate allocator.
+ template <typename OtherAllocator>
+ use_promise_t<OtherAllocator> rebind(const OtherAllocator& allocator) const
+ {
+ return use_promise_t<OtherAllocator>(allocator);
+ }
+
+private:
+ Allocator allocator_;
+};
+
+constexpr use_promise_t<> use_promise;
+
+} // namespace experimental
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/experimental/impl/use_promise.hpp"
+
+#endif // ASIO_EXPERIMENTAL_USE_CORO_HPP
diff --git a/3rdparty/asio/include/asio/file_base.hpp b/3rdparty/asio/include/asio/file_base.hpp
new file mode 100644
index 00000000000..5e8ac4f2ed5
--- /dev/null
+++ b/3rdparty/asio/include/asio/file_base.hpp
@@ -0,0 +1,166 @@
+//
+// file_base.hpp
+// ~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_FILE_BASE_HPP
+#define ASIO_FILE_BASE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_FILE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#if !defined(ASIO_WINDOWS)
+# include <fcntl.h>
+#endif // !defined(ASIO_WINDOWS)
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// The file_base class is used as a base for the basic_stream_file and
+/// basic_random_access_file class templates so that we have a common place to
+/// define flags.
+class file_base
+{
+public:
+#if defined(GENERATING_DOCUMENTATION)
+ /// A bitmask type (C++ Std [lib.bitmask.types]).
+ typedef unspecified flags;
+
+ /// Open the file for reading.
+ static const flags read_only = implementation_defined;
+
+ /// Open the file for writing.
+ static const flags write_only = implementation_defined;
+
+ /// Open the file for reading and writing.
+ static const flags read_write = implementation_defined;
+
+ /// Open the file in append mode.
+ static const flags append = implementation_defined;
+
+ /// Create the file if it does not exist.
+ static const flags create = implementation_defined;
+
+ /// Ensure a new file is created. Must be combined with @c create.
+ static const flags exclusive = implementation_defined;
+
+ /// Open the file with any existing contents truncated.
+ static const flags truncate = implementation_defined;
+
+ /// Open the file so that write operations automatically synchronise the file
+ /// data and metadata to disk.
+ static const flags sync_all_on_write = implementation_defined;
+#else
+ enum flags
+ {
+#if defined(ASIO_WINDOWS)
+ read_only = 1,
+ write_only = 2,
+ read_write = 4,
+ append = 8,
+ create = 16,
+ exclusive = 32,
+ truncate = 64,
+ sync_all_on_write = 128
+#else // defined(ASIO_WINDOWS)
+ read_only = O_RDONLY,
+ write_only = O_WRONLY,
+ read_write = O_RDWR,
+ append = O_APPEND,
+ create = O_CREAT,
+ exclusive = O_EXCL,
+ truncate = O_TRUNC,
+ sync_all_on_write = O_SYNC
+#endif // defined(ASIO_WINDOWS)
+ };
+
+ // Implement bitmask operations as shown in C++ Std [lib.bitmask.types].
+
+ friend flags operator&(flags x, flags y)
+ {
+ return static_cast<flags>(
+ static_cast<unsigned int>(x) & static_cast<unsigned int>(y));
+ }
+
+ friend flags operator|(flags x, flags y)
+ {
+ return static_cast<flags>(
+ static_cast<unsigned int>(x) | static_cast<unsigned int>(y));
+ }
+
+ friend flags operator^(flags x, flags y)
+ {
+ return static_cast<flags>(
+ static_cast<unsigned int>(x) ^ static_cast<unsigned int>(y));
+ }
+
+ friend flags operator~(flags x)
+ {
+ return static_cast<flags>(~static_cast<unsigned int>(x));
+ }
+
+ friend flags& operator&=(flags& x, flags y)
+ {
+ x = x & y;
+ return x;
+ }
+
+ friend flags& operator|=(flags& x, flags y)
+ {
+ x = x | y;
+ return x;
+ }
+
+ friend flags& operator^=(flags& x, flags y)
+ {
+ x = x ^ y;
+ return x;
+ }
+#endif
+
+ /// Basis for seeking in a file.
+ enum seek_basis
+ {
+#if defined(GENERATING_DOCUMENTATION)
+ /// Seek to an absolute position.
+ seek_set = implementation_defined,
+
+ /// Seek to an offset relative to the current file position.
+ seek_cur = implementation_defined,
+
+ /// Seek to an offset relative to the end of the file.
+ seek_end = implementation_defined
+#else
+ seek_set = SEEK_SET,
+ seek_cur = SEEK_CUR,
+ seek_end = SEEK_END
+#endif
+ };
+
+protected:
+ /// Protected destructor to prevent deletion through this type.
+ ~file_base()
+ {
+ }
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_FILE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_FILE_BASE_HPP
diff --git a/3rdparty/asio/include/asio/generic/basic_endpoint.hpp b/3rdparty/asio/include/asio/generic/basic_endpoint.hpp
index 64dd940026e..e7e1f6d4103 100644
--- a/3rdparty/asio/include/asio/generic/basic_endpoint.hpp
+++ b/3rdparty/asio/include/asio/generic/basic_endpoint.hpp
@@ -2,7 +2,7 @@
// generic/basic_endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -54,7 +54,7 @@ public:
#endif
/// Default constructor.
- basic_endpoint() ASIO_NOEXCEPT
+ basic_endpoint() noexcept
{
}
@@ -78,13 +78,11 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
basic_endpoint(basic_endpoint&& other)
: impl_(other.impl_)
{
}
-#endif // defined(ASIO_HAS_MOVE)
/// Assign from another endpoint.
basic_endpoint& operator=(const basic_endpoint& other)
@@ -93,14 +91,12 @@ public:
return *this;
}
-#if defined(ASIO_HAS_MOVE)
/// Move-assign from another endpoint.
basic_endpoint& operator=(basic_endpoint&& other)
{
impl_ = other.impl_;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
/// The protocol associated with the endpoint.
protocol_type protocol() const
diff --git a/3rdparty/asio/include/asio/generic/datagram_protocol.hpp b/3rdparty/asio/include/asio/generic/datagram_protocol.hpp
index 6bb711b9d24..6e81cd6a084 100644
--- a/3rdparty/asio/include/asio/generic/datagram_protocol.hpp
+++ b/3rdparty/asio/include/asio/generic/datagram_protocol.hpp
@@ -2,7 +2,7 @@
// generic/datagram_protocol.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -73,19 +73,19 @@ public:
}
/// Obtain an identifier for the type of the protocol.
- int type() const ASIO_NOEXCEPT
+ int type() const noexcept
{
return ASIO_OS_DEF(SOCK_DGRAM);
}
/// Obtain an identifier for the protocol.
- int protocol() const ASIO_NOEXCEPT
+ int protocol() const noexcept
{
return protocol_;
}
/// Obtain an identifier for the protocol family.
- int family() const ASIO_NOEXCEPT
+ int family() const noexcept
{
return family_;
}
diff --git a/3rdparty/asio/include/asio/generic/detail/endpoint.hpp b/3rdparty/asio/include/asio/generic/detail/endpoint.hpp
index e58271a660a..fdbcde92e5a 100644
--- a/3rdparty/asio/include/asio/generic/detail/endpoint.hpp
+++ b/3rdparty/asio/include/asio/generic/detail/endpoint.hpp
@@ -2,7 +2,7 @@
// generic/detail/endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp b/3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp
index 6a1124a791a..3e88c21098b 100644
--- a/3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp
+++ b/3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp
@@ -2,7 +2,7 @@
// generic/detail/impl/endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/generic/raw_protocol.hpp b/3rdparty/asio/include/asio/generic/raw_protocol.hpp
index 69abfc190b5..fc81cdd1ee9 100644
--- a/3rdparty/asio/include/asio/generic/raw_protocol.hpp
+++ b/3rdparty/asio/include/asio/generic/raw_protocol.hpp
@@ -2,7 +2,7 @@
// generic/raw_protocol.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -73,19 +73,19 @@ public:
}
/// Obtain an identifier for the type of the protocol.
- int type() const ASIO_NOEXCEPT
+ int type() const noexcept
{
return ASIO_OS_DEF(SOCK_RAW);
}
/// Obtain an identifier for the protocol.
- int protocol() const ASIO_NOEXCEPT
+ int protocol() const noexcept
{
return protocol_;
}
/// Obtain an identifier for the protocol family.
- int family() const ASIO_NOEXCEPT
+ int family() const noexcept
{
return family_;
}
diff --git a/3rdparty/asio/include/asio/generic/seq_packet_protocol.hpp b/3rdparty/asio/include/asio/generic/seq_packet_protocol.hpp
index 1734cb0b9f1..e0342a47836 100644
--- a/3rdparty/asio/include/asio/generic/seq_packet_protocol.hpp
+++ b/3rdparty/asio/include/asio/generic/seq_packet_protocol.hpp
@@ -2,7 +2,7 @@
// generic/seq_packet_protocol.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -72,19 +72,19 @@ public:
}
/// Obtain an identifier for the type of the protocol.
- int type() const ASIO_NOEXCEPT
+ int type() const noexcept
{
return ASIO_OS_DEF(SOCK_SEQPACKET);
}
/// Obtain an identifier for the protocol.
- int protocol() const ASIO_NOEXCEPT
+ int protocol() const noexcept
{
return protocol_;
}
/// Obtain an identifier for the protocol family.
- int family() const ASIO_NOEXCEPT
+ int family() const noexcept
{
return family_;
}
diff --git a/3rdparty/asio/include/asio/generic/stream_protocol.hpp b/3rdparty/asio/include/asio/generic/stream_protocol.hpp
index 78c92eead89..270006e60ed 100644
--- a/3rdparty/asio/include/asio/generic/stream_protocol.hpp
+++ b/3rdparty/asio/include/asio/generic/stream_protocol.hpp
@@ -2,7 +2,7 @@
// generic/stream_protocol.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -74,19 +74,19 @@ public:
}
/// Obtain an identifier for the type of the protocol.
- int type() const ASIO_NOEXCEPT
+ int type() const noexcept
{
return ASIO_OS_DEF(SOCK_STREAM);
}
/// Obtain an identifier for the protocol.
- int protocol() const ASIO_NOEXCEPT
+ int protocol() const noexcept
{
return protocol_;
}
/// Obtain an identifier for the protocol family.
- int family() const ASIO_NOEXCEPT
+ int family() const noexcept
{
return family_;
}
diff --git a/3rdparty/asio/include/asio/handler_alloc_hook.hpp b/3rdparty/asio/include/asio/handler_alloc_hook.hpp
deleted file mode 100644
index 16f4f5a5b2a..00000000000
--- a/3rdparty/asio/include/asio/handler_alloc_hook.hpp
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// handler_alloc_hook.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_HANDLER_ALLOC_HOOK_HPP
-#define ASIO_HANDLER_ALLOC_HOOK_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include <cstddef>
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-
-#if defined(ASIO_NO_DEPRECATED)
-
-// Places in asio that would have previously called the allocate or deallocate
-// hooks to manage memory, now call them only to check whether the result types
-// are these types. If the result is not the correct type, it indicates that
-// the user code still has the old hooks in place, and if so we want to trigger
-// a compile error.
-enum asio_handler_allocate_is_no_longer_used {};
-enum asio_handler_deallocate_is_no_longer_used {};
-
-typedef asio_handler_allocate_is_no_longer_used
- asio_handler_allocate_is_deprecated;
-typedef asio_handler_deallocate_is_no_longer_used
- asio_handler_deallocate_is_deprecated;
-
-#else // defined(ASIO_NO_DEPRECATED)
-
-typedef void* asio_handler_allocate_is_deprecated;
-typedef void asio_handler_deallocate_is_deprecated;
-
-#endif // defined(ASIO_NO_DEPRECATED)
-
-/// (Deprecated: Use the associated_allocator trait.) Default allocation
-/// function for handlers.
-/**
- * Asynchronous operations may need to allocate temporary objects. Since
- * asynchronous operations have a handler function object, these temporary
- * objects can be said to be associated with the handler.
- *
- * Implement asio_handler_allocate and asio_handler_deallocate for your own
- * handlers to provide custom allocation for these temporary objects.
- *
- * The default implementation of these allocation hooks uses <tt>::operator
- * new</tt> and <tt>::operator delete</tt>.
- *
- * @note All temporary objects associated with a handler will be deallocated
- * before the upcall to the handler is performed. This allows the same memory to
- * be reused for a subsequent asynchronous operation initiated by the handler.
- *
- * @par Example
- * @code
- * class my_handler;
- *
- * void* asio_handler_allocate(std::size_t size, my_handler* context)
- * {
- * return ::operator new(size);
- * }
- *
- * void asio_handler_deallocate(void* pointer, std::size_t size,
- * my_handler* context)
- * {
- * ::operator delete(pointer);
- * }
- * @endcode
- */
-ASIO_DECL asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size, ...);
-
-/// Default deallocation function for handlers.
-/**
- * Implement asio_handler_allocate and asio_handler_deallocate for your own
- * handlers to provide custom allocation for the associated temporary objects.
- *
- * The default implementation of these allocation hooks uses <tt>::operator
- * new</tt> and <tt>::operator delete</tt>.
- *
- * @sa asio_handler_allocate.
- */
-ASIO_DECL asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size, ...);
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#if defined(ASIO_HEADER_ONLY)
-# include "asio/impl/handler_alloc_hook.ipp"
-#endif // defined(ASIO_HEADER_ONLY)
-
-#endif // ASIO_HANDLER_ALLOC_HOOK_HPP
diff --git a/3rdparty/asio/include/asio/handler_continuation_hook.hpp b/3rdparty/asio/include/asio/handler_continuation_hook.hpp
index 40199f45054..8c5c65243de 100644
--- a/3rdparty/asio/include/asio/handler_continuation_hook.hpp
+++ b/3rdparty/asio/include/asio/handler_continuation_hook.hpp
@@ -2,7 +2,7 @@
// handler_continuation_hook.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/handler_invoke_hook.hpp b/3rdparty/asio/include/asio/handler_invoke_hook.hpp
deleted file mode 100644
index 238745218b2..00000000000
--- a/3rdparty/asio/include/asio/handler_invoke_hook.hpp
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// handler_invoke_hook.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_HANDLER_INVOKE_HOOK_HPP
-#define ASIO_HANDLER_INVOKE_HOOK_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-
-/** @defgroup asio_handler_invoke asio::asio_handler_invoke
- *
- * @brief (Deprecated: Use the associated_executor trait.) Default invoke
- * function for handlers.
- *
- * Completion handlers for asynchronous operations are invoked by the
- * io_context associated with the corresponding object (e.g. a socket or
- * deadline_timer). Certain guarantees are made on when the handler may be
- * invoked, in particular that a handler can only be invoked from a thread that
- * is currently calling @c run() on the corresponding io_context object.
- * Handlers may subsequently be invoked through other objects (such as
- * io_context::strand objects) that provide additional guarantees.
- *
- * When asynchronous operations are composed from other asynchronous
- * operations, all intermediate handlers should be invoked using the same
- * method as the final handler. This is required to ensure that user-defined
- * objects are not accessed in a way that may violate the guarantees. This
- * hooking function ensures that the invoked method used for the final handler
- * is accessible at each intermediate step.
- *
- * Implement asio_handler_invoke for your own handlers to specify a custom
- * invocation strategy.
- *
- * This default implementation invokes the function object like so:
- * @code function(); @endcode
- * If necessary, the default implementation makes a copy of the function object
- * so that the non-const operator() can be used.
- *
- * @par Example
- * @code
- * class my_handler;
- *
- * template <typename Function>
- * void asio_handler_invoke(Function function, my_handler* context)
- * {
- * context->strand_.dispatch(function);
- * }
- * @endcode
- */
-/*@{*/
-
-#if defined(ASIO_NO_DEPRECATED)
-
-// Places in asio that would have previously called the invocation hook to
-// execute a handler, now call it only to check whether the result type is this
-// type. If the result is not this type, it indicates that the user code still
-// has the old hooks in place, and if so we want to trigger a compile error.
-enum asio_handler_invoke_is_no_longer_used {};
-
-typedef asio_handler_invoke_is_no_longer_used
- asio_handler_invoke_is_deprecated;
-
-#else // defined(ASIO_NO_DEPRECATED)
-
-typedef void asio_handler_invoke_is_deprecated;
-
-#endif // defined(ASIO_NO_DEPRECATED)
-
-/// Default handler invocation hook used for non-const function objects.
-template <typename Function>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function, ...)
-{
- function();
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-/// Default handler invocation hook used for const function objects.
-template <typename Function>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function, ...)
-{
- Function tmp(function);
- tmp();
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-/*@}*/
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_HANDLER_INVOKE_HOOK_HPP
diff --git a/3rdparty/asio/include/asio/high_resolution_timer.hpp b/3rdparty/asio/include/asio/high_resolution_timer.hpp
index 2bbc1a1ead5..50e8030a225 100644
--- a/3rdparty/asio/include/asio/high_resolution_timer.hpp
+++ b/3rdparty/asio/include/asio/high_resolution_timer.hpp
@@ -2,7 +2,7 @@
// high_resolution_timer.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
-
#include "asio/basic_waitable_timer.hpp"
#include "asio/detail/chrono.hpp"
@@ -39,6 +36,4 @@ typedef basic_waitable_timer<
} // namespace asio
-#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
-
#endif // ASIO_HIGH_RESOLUTION_TIMER_HPP
diff --git a/3rdparty/asio/include/asio/impl/any_completion_executor.ipp b/3rdparty/asio/include/asio/impl/any_completion_executor.ipp
new file mode 100644
index 00000000000..fdad007dab1
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/any_completion_executor.ipp
@@ -0,0 +1,126 @@
+//
+// impl/any_completion_executor.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_ANY_COMPLETION_EXECUTOR_IPP
+#define ASIO_IMPL_ANY_COMPLETION_EXECUTOR_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
+#include "asio/any_completion_executor.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+any_completion_executor::any_completion_executor() noexcept
+ : base_type()
+{
+}
+
+any_completion_executor::any_completion_executor(nullptr_t) noexcept
+ : base_type(nullptr_t())
+{
+}
+
+any_completion_executor::any_completion_executor(
+ const any_completion_executor& e) noexcept
+ : base_type(static_cast<const base_type&>(e))
+{
+}
+
+any_completion_executor::any_completion_executor(std::nothrow_t,
+ const any_completion_executor& e) noexcept
+ : base_type(static_cast<const base_type&>(e))
+{
+}
+
+any_completion_executor::any_completion_executor(
+ any_completion_executor&& e) noexcept
+ : base_type(static_cast<base_type&&>(e))
+{
+}
+
+any_completion_executor::any_completion_executor(std::nothrow_t,
+ any_completion_executor&& e) noexcept
+ : base_type(static_cast<base_type&&>(e))
+{
+}
+
+any_completion_executor& any_completion_executor::operator=(
+ const any_completion_executor& e) noexcept
+{
+ base_type::operator=(static_cast<const base_type&>(e));
+ return *this;
+}
+
+any_completion_executor& any_completion_executor::operator=(
+ any_completion_executor&& e) noexcept
+{
+ base_type::operator=(static_cast<base_type&&>(e));
+ return *this;
+}
+
+any_completion_executor& any_completion_executor::operator=(nullptr_t)
+{
+ base_type::operator=(nullptr_t());
+ return *this;
+}
+
+any_completion_executor::~any_completion_executor()
+{
+}
+
+void any_completion_executor::swap(
+ any_completion_executor& other) noexcept
+{
+ static_cast<base_type&>(*this).swap(static_cast<base_type&>(other));
+}
+
+template <>
+any_completion_executor any_completion_executor::prefer(
+ const execution::outstanding_work_t::tracked_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).prefer(p);
+}
+
+template <>
+any_completion_executor any_completion_executor::prefer(
+ const execution::outstanding_work_t::untracked_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).prefer(p);
+}
+
+template <>
+any_completion_executor any_completion_executor::prefer(
+ const execution::relationship_t::fork_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).prefer(p);
+}
+
+template <>
+any_completion_executor any_completion_executor::prefer(
+ const execution::relationship_t::continuation_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).prefer(p);
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
+#endif // ASIO_IMPL_ANY_COMPLETION_EXECUTOR_IPP
diff --git a/3rdparty/asio/include/asio/impl/any_io_executor.ipp b/3rdparty/asio/include/asio/impl/any_io_executor.ipp
new file mode 100644
index 00000000000..338ad4d3ae2
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/any_io_executor.ipp
@@ -0,0 +1,134 @@
+//
+// impl/any_io_executor.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_ANY_IO_EXECUTOR_IPP
+#define ASIO_IMPL_ANY_IO_EXECUTOR_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
+#include "asio/any_io_executor.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+any_io_executor::any_io_executor() noexcept
+ : base_type()
+{
+}
+
+any_io_executor::any_io_executor(nullptr_t) noexcept
+ : base_type(nullptr_t())
+{
+}
+
+any_io_executor::any_io_executor(const any_io_executor& e) noexcept
+ : base_type(static_cast<const base_type&>(e))
+{
+}
+
+any_io_executor::any_io_executor(std::nothrow_t,
+ const any_io_executor& e) noexcept
+ : base_type(static_cast<const base_type&>(e))
+{
+}
+
+any_io_executor::any_io_executor(any_io_executor&& e) noexcept
+ : base_type(static_cast<base_type&&>(e))
+{
+}
+
+any_io_executor::any_io_executor(std::nothrow_t, any_io_executor&& e) noexcept
+ : base_type(static_cast<base_type&&>(e))
+{
+}
+
+any_io_executor& any_io_executor::operator=(const any_io_executor& e) noexcept
+{
+ base_type::operator=(static_cast<const base_type&>(e));
+ return *this;
+}
+
+any_io_executor& any_io_executor::operator=(any_io_executor&& e) noexcept
+{
+ base_type::operator=(static_cast<base_type&&>(e));
+ return *this;
+}
+
+any_io_executor& any_io_executor::operator=(nullptr_t)
+{
+ base_type::operator=(nullptr_t());
+ return *this;
+}
+
+any_io_executor::~any_io_executor()
+{
+}
+
+void any_io_executor::swap(any_io_executor& other) noexcept
+{
+ static_cast<base_type&>(*this).swap(static_cast<base_type&>(other));
+}
+
+template <>
+any_io_executor any_io_executor::require(
+ const execution::blocking_t::never_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).require(p);
+}
+
+template <>
+any_io_executor any_io_executor::prefer(
+ const execution::blocking_t::possibly_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).prefer(p);
+}
+
+template <>
+any_io_executor any_io_executor::prefer(
+ const execution::outstanding_work_t::tracked_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).prefer(p);
+}
+
+template <>
+any_io_executor any_io_executor::prefer(
+ const execution::outstanding_work_t::untracked_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).prefer(p);
+}
+
+template <>
+any_io_executor any_io_executor::prefer(
+ const execution::relationship_t::fork_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).prefer(p);
+}
+
+template <>
+any_io_executor any_io_executor::prefer(
+ const execution::relationship_t::continuation_t& p, int) const
+{
+ return static_cast<const base_type&>(*this).prefer(p);
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
+#endif // ASIO_IMPL_ANY_IO_EXECUTOR_IPP
diff --git a/3rdparty/asio/include/asio/impl/append.hpp b/3rdparty/asio/include/asio/impl/append.hpp
new file mode 100644
index 00000000000..cfa54191fcd
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/append.hpp
@@ -0,0 +1,162 @@
+//
+// impl/append.hpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_APPEND_HPP
+#define ASIO_IMPL_APPEND_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associator.hpp"
+#include "asio/async_result.hpp"
+#include "asio/detail/handler_cont_helpers.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/detail/utility.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+// Class to adapt an append_t as a completion handler.
+template <typename Handler, typename... Values>
+class append_handler
+{
+public:
+ typedef void result_type;
+
+ template <typename H>
+ append_handler(H&& handler, std::tuple<Values...> values)
+ : handler_(static_cast<H&&>(handler)),
+ values_(static_cast<std::tuple<Values...>&&>(values))
+ {
+ }
+
+ template <typename... Args>
+ void operator()(Args&&... args)
+ {
+ this->invoke(
+ index_sequence_for<Values...>{},
+ static_cast<Args&&>(args)...);
+ }
+
+ template <std::size_t... I, typename... Args>
+ void invoke(index_sequence<I...>, Args&&... args)
+ {
+ static_cast<Handler&&>(handler_)(
+ static_cast<Args&&>(args)...,
+ static_cast<Values&&>(std::get<I>(values_))...);
+ }
+
+//private:
+ Handler handler_;
+ std::tuple<Values...> values_;
+};
+
+template <typename Handler>
+inline bool asio_handler_is_continuation(
+ append_handler<Handler>* this_handler)
+{
+ return asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
+template <typename Signature, typename... Values>
+struct append_signature;
+
+template <typename R, typename... Args, typename... Values>
+struct append_signature<R(Args...), Values...>
+{
+ typedef R type(decay_t<Args>..., Values...);
+};
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename CompletionToken, typename... Values, typename Signature>
+struct async_result<append_t<CompletionToken, Values...>, Signature>
+ : async_result<CompletionToken,
+ typename detail::append_signature<
+ Signature, Values...>::type>
+{
+ typedef typename detail::append_signature<
+ Signature, Values...>::type signature;
+
+ template <typename Initiation>
+ struct init_wrapper
+ {
+ init_wrapper(Initiation init)
+ : initiation_(static_cast<Initiation&&>(init))
+ {
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler,
+ std::tuple<Values...> values, Args&&... args)
+ {
+ static_cast<Initiation&&>(initiation_)(
+ detail::append_handler<decay_t<Handler>, Values...>(
+ static_cast<Handler&&>(handler),
+ static_cast<std::tuple<Values...>&&>(values)),
+ static_cast<Args&&>(args)...);
+ }
+
+ Initiation initiation_;
+ };
+
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<CompletionToken, signature>(
+ declval<init_wrapper<decay_t<Initiation>>>(),
+ token.token_,
+ static_cast<std::tuple<Values...>&&>(token.values_),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<CompletionToken, signature>(
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_,
+ static_cast<std::tuple<Values...>&&>(token.values_),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <template <typename, typename> class Associator,
+ typename Handler, typename... Values, typename DefaultCandidate>
+struct associator<Associator,
+ detail::append_handler<Handler, Values...>, DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const detail::append_handler<Handler, Values...>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::append_handler<Handler, Values...>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_IMPL_APPEND_HPP
diff --git a/3rdparty/asio/include/asio/impl/as_tuple.hpp b/3rdparty/asio/include/asio/impl/as_tuple.hpp
new file mode 100644
index 00000000000..6d47510b997
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/as_tuple.hpp
@@ -0,0 +1,245 @@
+//
+// impl/as_tuple.hpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_AS_TUPLE_HPP
+#define ASIO_IMPL_AS_TUPLE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <tuple>
+#include "asio/associator.hpp"
+#include "asio/async_result.hpp"
+#include "asio/detail/handler_cont_helpers.hpp"
+#include "asio/detail/type_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+// Class to adapt a as_tuple_t as a completion handler.
+template <typename Handler>
+class as_tuple_handler
+{
+public:
+ typedef void result_type;
+
+ template <typename CompletionToken>
+ as_tuple_handler(as_tuple_t<CompletionToken> e)
+ : handler_(static_cast<CompletionToken&&>(e.token_))
+ {
+ }
+
+ template <typename RedirectedHandler>
+ as_tuple_handler(RedirectedHandler&& h)
+ : handler_(static_cast<RedirectedHandler&&>(h))
+ {
+ }
+
+ template <typename... Args>
+ void operator()(Args&&... args)
+ {
+ static_cast<Handler&&>(handler_)(
+ std::make_tuple(static_cast<Args&&>(args)...));
+ }
+
+//private:
+ Handler handler_;
+};
+
+template <typename Handler>
+inline bool asio_handler_is_continuation(
+ as_tuple_handler<Handler>* this_handler)
+{
+ return asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
+template <typename Signature>
+struct as_tuple_signature;
+
+template <typename R, typename... Args>
+struct as_tuple_signature<R(Args...)>
+{
+ typedef R type(std::tuple<decay_t<Args>...>);
+};
+
+template <typename R, typename... Args>
+struct as_tuple_signature<R(Args...) &>
+{
+ typedef R type(std::tuple<decay_t<Args>...>) &;
+};
+
+template <typename R, typename... Args>
+struct as_tuple_signature<R(Args...) &&>
+{
+ typedef R type(std::tuple<decay_t<Args>...>) &&;
+};
+
+#if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
+
+template <typename R, typename... Args>
+struct as_tuple_signature<R(Args...) noexcept>
+{
+ typedef R type(std::tuple<decay_t<Args>...>) noexcept;
+};
+
+template <typename R, typename... Args>
+struct as_tuple_signature<R(Args...) & noexcept>
+{
+ typedef R type(std::tuple<decay_t<Args>...>) & noexcept;
+};
+
+template <typename R, typename... Args>
+struct as_tuple_signature<R(Args...) && noexcept>
+{
+ typedef R type(std::tuple<decay_t<Args>...>) && noexcept;
+};
+
+#endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename CompletionToken, typename... Signatures>
+struct async_result<as_tuple_t<CompletionToken>, Signatures...>
+ : async_result<CompletionToken,
+ typename detail::as_tuple_signature<Signatures>::type...>
+{
+ template <typename Initiation>
+ struct init_wrapper
+ {
+ init_wrapper(Initiation init)
+ : initiation_(static_cast<Initiation&&>(init))
+ {
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args)
+ {
+ static_cast<Initiation&&>(initiation_)(
+ detail::as_tuple_handler<decay_t<Handler>>(
+ static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
+ }
+
+ Initiation initiation_;
+ };
+
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ typename detail::as_tuple_signature<Signatures>::type...>(
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, static_cast<Args&&>(args)...))
+ {
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ typename detail::as_tuple_signature<Signatures>::type...>(
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, static_cast<Args&&>(args)...);
+ }
+};
+
+#if defined(ASIO_MSVC)
+
+// Workaround for MSVC internal compiler error.
+
+template <typename CompletionToken, typename Signature>
+struct async_result<as_tuple_t<CompletionToken>, Signature>
+ : async_result<CompletionToken,
+ typename detail::as_tuple_signature<Signature>::type>
+{
+ template <typename Initiation>
+ struct init_wrapper
+ {
+ init_wrapper(Initiation init)
+ : initiation_(static_cast<Initiation&&>(init))
+ {
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args)
+ {
+ static_cast<Initiation&&>(initiation_)(
+ detail::as_tuple_handler<decay_t<Handler>>(
+ static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
+ }
+
+ Initiation initiation_;
+ };
+
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ typename detail::as_tuple_signature<Signature>::type>(
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, static_cast<Args&&>(args)...))
+ {
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ typename detail::as_tuple_signature<Signature>::type>(
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, static_cast<Args&&>(args)...);
+ }
+};
+
+#endif // defined(ASIO_MSVC)
+
+template <template <typename, typename> class Associator,
+ typename Handler, typename DefaultCandidate>
+struct associator<Associator,
+ detail::as_tuple_handler<Handler>, DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const detail::as_tuple_handler<Handler>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::as_tuple_handler<Handler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_IMPL_AS_TUPLE_HPP
diff --git a/3rdparty/asio/include/asio/impl/awaitable.hpp b/3rdparty/asio/include/asio/impl/awaitable.hpp
index 598b00baf68..c5ea2649171 100644
--- a/3rdparty/asio/include/asio/impl/awaitable.hpp
+++ b/3rdparty/asio/include/asio/impl/awaitable.hpp
@@ -2,7 +2,7 @@
// impl/awaitable.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,7 +19,6 @@
#include <exception>
#include <new>
#include <tuple>
-#include <utility>
#include "asio/cancellation_signal.hpp"
#include "asio/cancellation_state.hpp"
#include "asio/detail/thread_context.hpp"
@@ -31,12 +30,20 @@
#include "asio/system_error.hpp"
#include "asio/this_coro.hpp"
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+# include "asio/detail/source_location.hpp"
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+
#include "asio/detail/push_options.hpp"
namespace asio {
namespace detail {
struct awaitable_thread_has_context_switched {};
+template <typename, typename> class awaitable_async_op_handler;
+template <typename, typename, typename> class awaitable_async_op;
// An awaitable_thread represents a thread-of-execution that is composed of one
// or more "stack frames", with each frame represented by an awaitable_frame.
@@ -162,10 +169,35 @@ public:
{
if (attached_thread_->entry_point()->throw_if_cancelled_)
if (!!attached_thread_->get_cancellation_state().cancelled())
- do_throw_error(asio::error::operation_aborted, "co_await");
+ throw_error(asio::error::operation_aborted, "co_await");
return a;
}
+ template <typename Op>
+ auto await_transform(Op&& op,
+ constraint_t<is_async_operation<Op>::value> = 0
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , detail::source_location location = detail::source_location::current()
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ )
+ {
+ if (attached_thread_->entry_point()->throw_if_cancelled_)
+ if (!!attached_thread_->get_cancellation_state().cancelled())
+ throw_error(asio::error::operation_aborted, "co_await");
+
+ return awaitable_async_op<
+ completion_signature_of_t<Op>, decay_t<Op>, Executor>{
+ std::forward<Op>(op), this
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , location
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ };
+ }
+
// This await transformation obtains the associated executor of the thread of
// execution.
auto await_transform(this_coro::executor_t) noexcept
@@ -265,11 +297,11 @@ public:
auto await_resume()
{
return this_->attached_thread_->reset_cancellation_state(
- ASIO_MOVE_CAST(Filter)(filter_));
+ static_cast<Filter&&>(filter_));
}
};
- return result{this, ASIO_MOVE_CAST(Filter)(reset.filter)};
+ return result{this, static_cast<Filter&&>(reset.filter)};
}
// This await transformation resets the associated cancellation state.
@@ -296,14 +328,14 @@ public:
auto await_resume()
{
return this_->attached_thread_->reset_cancellation_state(
- ASIO_MOVE_CAST(InFilter)(in_filter_),
- ASIO_MOVE_CAST(OutFilter)(out_filter_));
+ static_cast<InFilter&&>(in_filter_),
+ static_cast<OutFilter&&>(out_filter_));
}
};
return result{this,
- ASIO_MOVE_CAST(InFilter)(reset.in_filter),
- ASIO_MOVE_CAST(OutFilter)(reset.out_filter)};
+ static_cast<InFilter&&>(reset.in_filter),
+ static_cast<OutFilter&&>(reset.out_filter)};
}
// This await transformation determines whether cancellation is propagated as
@@ -367,12 +399,12 @@ public:
// race condition.
template <typename Function>
auto await_transform(Function f,
- typename enable_if<
+ enable_if_t<
is_convertible<
- typename result_of<Function(awaitable_frame_base*)>::type,
+ result_of_t<Function(awaitable_frame_base*)>,
awaitable_thread<Executor>*
>::value
- >::type* = 0)
+ >* = nullptr)
{
struct result
{
@@ -386,7 +418,12 @@ public:
void await_suspend(coroutine_handle<void>) noexcept
{
- function_(this_);
+ this_->after_suspend(
+ [](void* arg)
+ {
+ result* r = static_cast<result*>(arg);
+ r->function_(r->this_);
+ }, this);
}
void await_resume() const noexcept
@@ -450,9 +487,25 @@ public:
caller_ = nullptr;
}
+ struct resume_context
+ {
+ void (*after_suspend_fn_)(void*) = nullptr;
+ void *after_suspend_arg_ = nullptr;
+ };
+
void resume()
{
+ resume_context context;
+ resume_context_ = &context;
coro_.resume();
+ if (context.after_suspend_fn_)
+ context.after_suspend_fn_(context.after_suspend_arg_);
+ }
+
+ void after_suspend(void (*fn)(void*), void* arg)
+ {
+ resume_context_->after_suspend_fn_ = fn;
+ resume_context_->after_suspend_arg_ = arg;
}
void destroy()
@@ -465,6 +518,7 @@ protected:
awaitable_thread<Executor>* attached_thread_ = nullptr;
awaitable_frame_base<Executor>* caller_ = nullptr;
std::exception_ptr pending_exception_ = nullptr;
+ resume_context* resume_context_ = nullptr;
};
template <typename T, typename Executor>
@@ -484,7 +538,7 @@ public:
~awaitable_frame()
{
if (has_result_)
- static_cast<T*>(static_cast<void*>(result_))->~T();
+ std::launder(static_cast<T*>(static_cast<void*>(result_)))->~T();
}
awaitable<T, Executor> get_return_object() noexcept
@@ -510,7 +564,8 @@ public:
{
this->caller_ = nullptr;
this->rethrow_exception();
- return std::move(*static_cast<T*>(static_cast<void*>(result_)));
+ return std::move(*std::launder(
+ static_cast<T*>(static_cast<void*>(result_))));
}
private:
@@ -579,6 +634,7 @@ public:
private:
template <typename> friend class awaitable_frame_base;
+ template <typename, typename> friend class awaitable_async_op_handler;
template <typename, typename> friend class awaitable_handler_base;
template <typename> friend class awaitable_thread;
@@ -663,21 +719,21 @@ public:
}
template <typename Filter>
- void reset_cancellation_state(ASIO_MOVE_ARG(Filter) filter)
+ void reset_cancellation_state(Filter&& filter)
{
bottom_of_stack_.frame_->cancellation_state_ =
cancellation_state(bottom_of_stack_.frame_->parent_cancellation_slot_,
- ASIO_MOVE_CAST(Filter)(filter));
+ static_cast<Filter&&>(filter));
}
template <typename InFilter, typename OutFilter>
- void reset_cancellation_state(ASIO_MOVE_ARG(InFilter) in_filter,
- ASIO_MOVE_ARG(OutFilter) out_filter)
+ void reset_cancellation_state(InFilter&& in_filter,
+ OutFilter&& out_filter)
{
bottom_of_stack_.frame_->cancellation_state_ =
cancellation_state(bottom_of_stack_.frame_->parent_cancellation_slot_,
- ASIO_MOVE_CAST(InFilter)(in_filter),
- ASIO_MOVE_CAST(OutFilter)(out_filter));
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter));
}
bool throw_if_cancelled() const
@@ -724,6 +780,386 @@ protected:
awaitable<awaitable_thread_entry_point, Executor> bottom_of_stack_;
};
+template <typename Signature, typename Executor>
+class awaitable_async_op_handler;
+
+template <typename R, typename Executor>
+class awaitable_async_op_handler<R(), Executor>
+ : public awaitable_thread<Executor>
+{
+public:
+ struct result_type {};
+
+ awaitable_async_op_handler(
+ awaitable_thread<Executor>* h, result_type&)
+ : awaitable_thread<Executor>(std::move(*h))
+ {
+ }
+
+ void operator()()
+ {
+ this->entry_point()->top_of_stack_->attach_thread(this);
+ this->entry_point()->top_of_stack_->clear_cancellation_slot();
+ this->pump();
+ }
+
+ static void resume(result_type&)
+ {
+ }
+};
+
+template <typename R, typename Executor>
+class awaitable_async_op_handler<R(asio::error_code), Executor>
+ : public awaitable_thread<Executor>
+{
+public:
+ typedef asio::error_code* result_type;
+
+ awaitable_async_op_handler(
+ awaitable_thread<Executor>* h, result_type& result)
+ : awaitable_thread<Executor>(std::move(*h)),
+ result_(result)
+ {
+ }
+
+ void operator()(asio::error_code ec)
+ {
+ result_ = &ec;
+ this->entry_point()->top_of_stack_->attach_thread(this);
+ this->entry_point()->top_of_stack_->clear_cancellation_slot();
+ this->pump();
+ }
+
+ static void resume(result_type& result)
+ {
+ throw_error(*result);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename R, typename Executor>
+class awaitable_async_op_handler<R(std::exception_ptr), Executor>
+ : public awaitable_thread<Executor>
+{
+public:
+ typedef std::exception_ptr* result_type;
+
+ awaitable_async_op_handler(
+ awaitable_thread<Executor>* h, result_type& result)
+ : awaitable_thread<Executor>(std::move(*h)),
+ result_(result)
+ {
+ }
+
+ void operator()(std::exception_ptr ex)
+ {
+ result_ = &ex;
+ this->entry_point()->top_of_stack_->attach_thread(this);
+ this->entry_point()->top_of_stack_->clear_cancellation_slot();
+ this->pump();
+ }
+
+ static void resume(result_type& result)
+ {
+ if (*result)
+ {
+ std::exception_ptr ex = std::exchange(*result, nullptr);
+ std::rethrow_exception(ex);
+ }
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename R, typename T, typename Executor>
+class awaitable_async_op_handler<R(T), Executor>
+ : public awaitable_thread<Executor>
+{
+public:
+ typedef T* result_type;
+
+ awaitable_async_op_handler(
+ awaitable_thread<Executor>* h, result_type& result)
+ : awaitable_thread<Executor>(std::move(*h)),
+ result_(result)
+ {
+ }
+
+ void operator()(T result)
+ {
+ result_ = &result;
+ this->entry_point()->top_of_stack_->attach_thread(this);
+ this->entry_point()->top_of_stack_->clear_cancellation_slot();
+ this->pump();
+ }
+
+ static T resume(result_type& result)
+ {
+ return std::move(*result);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename R, typename T, typename Executor>
+class awaitable_async_op_handler<R(asio::error_code, T), Executor>
+ : public awaitable_thread<Executor>
+{
+public:
+ struct result_type
+ {
+ asio::error_code* ec_;
+ T* value_;
+ };
+
+ awaitable_async_op_handler(
+ awaitable_thread<Executor>* h, result_type& result)
+ : awaitable_thread<Executor>(std::move(*h)),
+ result_(result)
+ {
+ }
+
+ void operator()(asio::error_code ec, T value)
+ {
+ result_.ec_ = &ec;
+ result_.value_ = &value;
+ this->entry_point()->top_of_stack_->attach_thread(this);
+ this->entry_point()->top_of_stack_->clear_cancellation_slot();
+ this->pump();
+ }
+
+ static T resume(result_type& result)
+ {
+ throw_error(*result.ec_);
+ return std::move(*result.value_);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename R, typename T, typename Executor>
+class awaitable_async_op_handler<R(std::exception_ptr, T), Executor>
+ : public awaitable_thread<Executor>
+{
+public:
+ struct result_type
+ {
+ std::exception_ptr* ex_;
+ T* value_;
+ };
+
+ awaitable_async_op_handler(
+ awaitable_thread<Executor>* h, result_type& result)
+ : awaitable_thread<Executor>(std::move(*h)),
+ result_(result)
+ {
+ }
+
+ void operator()(std::exception_ptr ex, T value)
+ {
+ result_.ex_ = &ex;
+ result_.value_ = &value;
+ this->entry_point()->top_of_stack_->attach_thread(this);
+ this->entry_point()->top_of_stack_->clear_cancellation_slot();
+ this->pump();
+ }
+
+ static T resume(result_type& result)
+ {
+ if (*result.ex_)
+ {
+ std::exception_ptr ex = std::exchange(*result.ex_, nullptr);
+ std::rethrow_exception(ex);
+ }
+ return std::move(*result.value_);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename R, typename... Ts, typename Executor>
+class awaitable_async_op_handler<R(Ts...), Executor>
+ : public awaitable_thread<Executor>
+{
+public:
+ typedef std::tuple<Ts...>* result_type;
+
+ awaitable_async_op_handler(
+ awaitable_thread<Executor>* h, result_type& result)
+ : awaitable_thread<Executor>(std::move(*h)),
+ result_(result)
+ {
+ }
+
+ template <typename... Args>
+ void operator()(Args&&... args)
+ {
+ std::tuple<Ts...> result(std::forward<Args>(args)...);
+ result_ = &result;
+ this->entry_point()->top_of_stack_->attach_thread(this);
+ this->entry_point()->top_of_stack_->clear_cancellation_slot();
+ this->pump();
+ }
+
+ static std::tuple<Ts...> resume(result_type& result)
+ {
+ return std::move(*result);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename R, typename... Ts, typename Executor>
+class awaitable_async_op_handler<R(asio::error_code, Ts...), Executor>
+ : public awaitable_thread<Executor>
+{
+public:
+ struct result_type
+ {
+ asio::error_code* ec_;
+ std::tuple<Ts...>* value_;
+ };
+
+ awaitable_async_op_handler(
+ awaitable_thread<Executor>* h, result_type& result)
+ : awaitable_thread<Executor>(std::move(*h)),
+ result_(result)
+ {
+ }
+
+ template <typename... Args>
+ void operator()(asio::error_code ec, Args&&... args)
+ {
+ result_.ec_ = &ec;
+ std::tuple<Ts...> value(std::forward<Args>(args)...);
+ result_.value_ = &value;
+ this->entry_point()->top_of_stack_->attach_thread(this);
+ this->entry_point()->top_of_stack_->clear_cancellation_slot();
+ this->pump();
+ }
+
+ static std::tuple<Ts...> resume(result_type& result)
+ {
+ throw_error(*result.ec_);
+ return std::move(*result.value_);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename R, typename... Ts, typename Executor>
+class awaitable_async_op_handler<R(std::exception_ptr, Ts...), Executor>
+ : public awaitable_thread<Executor>
+{
+public:
+ struct result_type
+ {
+ std::exception_ptr* ex_;
+ std::tuple<Ts...>* value_;
+ };
+
+ awaitable_async_op_handler(
+ awaitable_thread<Executor>* h, result_type& result)
+ : awaitable_thread<Executor>(std::move(*h)),
+ result_(result)
+ {
+ }
+
+ template <typename... Args>
+ void operator()(std::exception_ptr ex, Args&&... args)
+ {
+ result_.ex_ = &ex;
+ std::tuple<Ts...> value(std::forward<Args>(args)...);
+ result_.value_ = &value;
+ this->entry_point()->top_of_stack_->attach_thread(this);
+ this->entry_point()->top_of_stack_->clear_cancellation_slot();
+ this->pump();
+ }
+
+ static std::tuple<Ts...> resume(result_type& result)
+ {
+ if (*result.ex_)
+ {
+ std::exception_ptr ex = std::exchange(*result.ex_, nullptr);
+ std::rethrow_exception(ex);
+ }
+ return std::move(*result.value_);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename Signature, typename Op, typename Executor>
+class awaitable_async_op
+{
+public:
+ typedef awaitable_async_op_handler<Signature, Executor> handler_type;
+
+ awaitable_async_op(Op&& o, awaitable_frame_base<Executor>* frame
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , const detail::source_location& location
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ )
+ : op_(std::forward<Op>(o)),
+ frame_(frame),
+ result_()
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ , location_(location)
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ {
+ }
+
+ bool await_ready() const noexcept
+ {
+ return false;
+ }
+
+ void await_suspend(coroutine_handle<void>)
+ {
+ frame_->after_suspend(
+ [](void* arg)
+ {
+ awaitable_async_op* self = static_cast<awaitable_async_op*>(arg);
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ ASIO_HANDLER_LOCATION((self->location_.file_name(),
+ self->location_.line(), self->location_.function_name()));
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+ std::forward<Op&&>(self->op_)(
+ handler_type(self->frame_->detach_thread(), self->result_));
+ }, this);
+ }
+
+ auto await_resume()
+ {
+ return handler_type::resume(result_);
+ }
+
+private:
+ Op&& op_;
+ awaitable_frame_base<Executor>* frame_;
+ typename handler_type::result_type result_;
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# if defined(ASIO_HAS_SOURCE_LOCATION)
+ detail::source_location location_;
+# endif // defined(ASIO_HAS_SOURCE_LOCATION)
+#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
+};
+
} // namespace detail
} // namespace asio
diff --git a/3rdparty/asio/include/asio/impl/buffered_read_stream.hpp b/3rdparty/asio/include/asio/impl/buffered_read_stream.hpp
index a25beeedce0..9a1d78b465e 100644
--- a/3rdparty/asio/include/asio/impl/buffered_read_stream.hpp
+++ b/3rdparty/asio/include/asio/impl/buffered_read_stream.hpp
@@ -2,7 +2,7 @@
// impl/buffered_read_stream.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/associator.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/non_const_lvalue.hpp"
#include "asio/detail/type_traits.hpp"
@@ -66,11 +64,10 @@ namespace detail
std::size_t previous_size, ReadHandler& handler)
: storage_(storage),
previous_size_(previous_size),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
buffered_fill_handler(const buffered_fill_handler& other)
: storage_(other.storage_),
previous_size_(other.previous_size_),
@@ -81,16 +78,15 @@ namespace detail
buffered_fill_handler(buffered_fill_handler&& other)
: storage_(other.storage_),
previous_size_(other.previous_size_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
const std::size_t bytes_transferred)
{
storage_.resize(previous_size_ + bytes_transferred);
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(ec, bytes_transferred);
+ static_cast<ReadHandler&&>(handler_)(ec, bytes_transferred);
}
//private:
@@ -100,32 +96,6 @@ namespace detail
};
template <typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- buffered_fill_handler<ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- buffered_fill_handler<ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename ReadHandler>
inline bool asio_handler_is_continuation(
buffered_fill_handler<ReadHandler>* this_handler)
{
@@ -133,50 +103,26 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- buffered_fill_handler<ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- buffered_fill_handler<ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename Stream>
class initiate_async_buffered_fill
{
public:
- typedef typename remove_reference<
- Stream>::type::lowest_layer_type::executor_type executor_type;
+ typedef typename remove_reference_t<
+ Stream>::lowest_layer_type::executor_type executor_type;
explicit initiate_async_buffered_fill(
- typename remove_reference<Stream>::type& next_layer)
+ remove_reference_t<Stream>& next_layer)
: next_layer_(next_layer)
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return next_layer_.lowest_layer().get_executor();
}
template <typename ReadHandler>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
buffered_stream_storage* storage) const
{
// If you get an error on the following line it means that your handler
@@ -190,12 +136,12 @@ namespace detail
buffer(
storage->data() + previous_size,
storage->size() - previous_size),
- buffered_fill_handler<typename decay<ReadHandler>::type>(
+ buffered_fill_handler<decay_t<ReadHandler>>(
*storage, previous_size, handler2.value));
}
private:
- typename remove_reference<Stream>::type& next_layer_;
+ remove_reference_t<Stream>& next_layer_;
};
} // namespace detail
@@ -209,8 +155,14 @@ struct associator<Associator,
: Associator<ReadHandler, DefaultCandidate>
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
- const detail::buffered_fill_handler<ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::buffered_fill_handler<ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::buffered_fill_handler<ReadHandler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -222,10 +174,12 @@ template <typename Stream>
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-buffered_read_stream<Stream>::async_fill(
- ASIO_MOVE_ARG(ReadHandler) handler)
+inline auto buffered_read_stream<Stream>::async_fill(ReadHandler&& handler)
+ -> decltype(
+ async_initiate<ReadHandler,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_buffered_fill<Stream>>(),
+ handler, declval<detail::buffered_stream_storage*>()))
{
return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>(
@@ -275,39 +229,37 @@ namespace detail
const MutableBufferSequence& buffers, ReadHandler& handler)
: storage_(storage),
buffers_(buffers),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
- buffered_read_some_handler(const buffered_read_some_handler& other)
- : storage_(other.storage_),
- buffers_(other.buffers_),
- handler_(other.handler_)
- {
- }
+ buffered_read_some_handler(const buffered_read_some_handler& other)
+ : storage_(other.storage_),
+ buffers_(other.buffers_),
+ handler_(other.handler_)
+ {
+ }
- buffered_read_some_handler(buffered_read_some_handler&& other)
- : storage_(other.storage_),
- buffers_(other.buffers_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
+ buffered_read_some_handler(buffered_read_some_handler&& other)
+ : storage_(other.storage_),
+ buffers_(other.buffers_),
+ handler_(static_cast<ReadHandler&&>(other.handler_))
+ {
+ }
void operator()(const asio::error_code& ec, std::size_t)
{
if (ec || storage_.empty())
{
const std::size_t length = 0;
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(ec, length);
+ static_cast<ReadHandler&&>(handler_)(ec, length);
}
else
{
const std::size_t bytes_copied = asio::buffer_copy(
buffers_, storage_.data(), storage_.size());
storage_.consume(bytes_copied);
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(ec, bytes_copied);
+ static_cast<ReadHandler&&>(handler_)(ec, bytes_copied);
}
}
@@ -318,34 +270,6 @@ namespace detail
};
template <typename MutableBufferSequence, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- buffered_read_some_handler<
- MutableBufferSequence, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename MutableBufferSequence, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- buffered_read_some_handler<
- MutableBufferSequence, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename MutableBufferSequence, typename ReadHandler>
inline bool asio_handler_is_continuation(
buffered_read_some_handler<
MutableBufferSequence, ReadHandler>* this_handler)
@@ -354,54 +278,26 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename MutableBufferSequence,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- buffered_read_some_handler<
- MutableBufferSequence, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename MutableBufferSequence,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- buffered_read_some_handler<
- MutableBufferSequence, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename Stream>
class initiate_async_buffered_read_some
{
public:
- typedef typename remove_reference<
- Stream>::type::lowest_layer_type::executor_type executor_type;
+ typedef typename remove_reference_t<
+ Stream>::lowest_layer_type::executor_type executor_type;
explicit initiate_async_buffered_read_some(
- typename remove_reference<Stream>::type& next_layer)
+ remove_reference_t<Stream>& next_layer)
: next_layer_(next_layer)
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return next_layer_.lowest_layer().get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
buffered_stream_storage* storage,
const MutableBufferSequence& buffers) const
{
@@ -415,21 +311,21 @@ namespace detail
{
next_layer_.async_read_some(ASIO_MUTABLE_BUFFER(0, 0),
buffered_read_some_handler<MutableBufferSequence,
- typename decay<ReadHandler>::type>(
+ decay_t<ReadHandler>>(
*storage, buffers, handler2.value));
}
else
{
initiate_async_buffered_fill<Stream>(this->next_layer_)(
buffered_read_some_handler<MutableBufferSequence,
- typename decay<ReadHandler>::type>(
+ decay_t<ReadHandler>>(
*storage, buffers, handler2.value),
storage);
}
}
private:
- typename remove_reference<Stream>::type& next_layer_;
+ remove_reference_t<Stream>& next_layer_;
};
} // namespace detail
@@ -445,8 +341,16 @@ struct associator<Associator,
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::buffered_read_some_handler<
+ MutableBufferSequence, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::buffered_read_some_handler<
MutableBufferSequence, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -458,11 +362,13 @@ template <typename Stream>
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-buffered_read_stream<Stream>::async_read_some(
- const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler)
+inline auto buffered_read_stream<Stream>::async_read_some(
+ const MutableBufferSequence& buffers, ReadHandler&& handler)
+ -> decltype(
+ async_initiate<ReadHandler,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_buffered_read_some<Stream>>(),
+ handler, declval<detail::buffered_stream_storage*>(), buffers))
{
return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>(
diff --git a/3rdparty/asio/include/asio/impl/buffered_write_stream.hpp b/3rdparty/asio/include/asio/impl/buffered_write_stream.hpp
index efb30a684c9..5bf58278ca6 100644
--- a/3rdparty/asio/include/asio/impl/buffered_write_stream.hpp
+++ b/3rdparty/asio/include/asio/impl/buffered_write_stream.hpp
@@ -2,7 +2,7 @@
// impl/buffered_write_stream.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/associator.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/non_const_lvalue.hpp"
@@ -54,11 +52,10 @@ namespace detail
buffered_flush_handler(detail::buffered_stream_storage& storage,
WriteHandler& handler)
: storage_(storage),
- handler_(ASIO_MOVE_CAST(WriteHandler)(handler))
+ handler_(static_cast<WriteHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
buffered_flush_handler(const buffered_flush_handler& other)
: storage_(other.storage_),
handler_(other.handler_)
@@ -67,16 +64,15 @@ namespace detail
buffered_flush_handler(buffered_flush_handler&& other)
: storage_(other.storage_),
- handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_))
+ handler_(static_cast<WriteHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
const std::size_t bytes_written)
{
storage_.consume(bytes_written);
- ASIO_MOVE_OR_LVALUE(WriteHandler)(handler_)(ec, bytes_written);
+ static_cast<WriteHandler&&>(handler_)(ec, bytes_written);
}
//private:
@@ -85,32 +81,6 @@ namespace detail
};
template <typename WriteHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- buffered_flush_handler<WriteHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename WriteHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- buffered_flush_handler<WriteHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename WriteHandler>
inline bool asio_handler_is_continuation(
buffered_flush_handler<WriteHandler>* this_handler)
{
@@ -118,50 +88,26 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- buffered_flush_handler<WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- buffered_flush_handler<WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename Stream>
class initiate_async_buffered_flush
{
public:
- typedef typename remove_reference<
- Stream>::type::lowest_layer_type::executor_type executor_type;
+ typedef typename remove_reference_t<
+ Stream>::lowest_layer_type::executor_type executor_type;
explicit initiate_async_buffered_flush(
- typename remove_reference<Stream>::type& next_layer)
+ remove_reference_t<Stream>& next_layer)
: next_layer_(next_layer)
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return next_layer_.lowest_layer().get_executor();
}
template <typename WriteHandler>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
buffered_stream_storage* storage) const
{
// If you get an error on the following line it means that your handler
@@ -170,12 +116,12 @@ namespace detail
non_const_lvalue<WriteHandler> handler2(handler);
async_write(next_layer_, buffer(storage->data(), storage->size()),
- buffered_flush_handler<typename decay<WriteHandler>::type>(
+ buffered_flush_handler<decay_t<WriteHandler>>(
*storage, handler2.value));
}
private:
- typename remove_reference<Stream>::type& next_layer_;
+ remove_reference_t<Stream>& next_layer_;
};
} // namespace detail
@@ -189,8 +135,14 @@ struct associator<Associator,
: Associator<WriteHandler, DefaultCandidate>
{
static typename Associator<WriteHandler, DefaultCandidate>::type get(
- const detail::buffered_flush_handler<WriteHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::buffered_flush_handler<WriteHandler>& h) noexcept
+ {
+ return Associator<WriteHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::buffered_flush_handler<WriteHandler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -202,10 +154,12 @@ template <typename Stream>
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
std::size_t)) WriteHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-buffered_write_stream<Stream>::async_flush(
- ASIO_MOVE_ARG(WriteHandler) handler)
+inline auto buffered_write_stream<Stream>::async_flush(WriteHandler&& handler)
+ -> decltype(
+ async_initiate<WriteHandler,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_buffered_flush<Stream>>(),
+ handler, declval<detail::buffered_stream_storage*>()))
{
return async_initiate<WriteHandler,
void (asio::error_code, std::size_t)>(
@@ -255,32 +209,30 @@ namespace detail
const ConstBufferSequence& buffers, WriteHandler& handler)
: storage_(storage),
buffers_(buffers),
- handler_(ASIO_MOVE_CAST(WriteHandler)(handler))
+ handler_(static_cast<WriteHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
- buffered_write_some_handler(const buffered_write_some_handler& other)
- : storage_(other.storage_),
- buffers_(other.buffers_),
- handler_(other.handler_)
- {
- }
+ buffered_write_some_handler(const buffered_write_some_handler& other)
+ : storage_(other.storage_),
+ buffers_(other.buffers_),
+ handler_(other.handler_)
+ {
+ }
- buffered_write_some_handler(buffered_write_some_handler&& other)
- : storage_(other.storage_),
- buffers_(other.buffers_),
- handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_))
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
+ buffered_write_some_handler(buffered_write_some_handler&& other)
+ : storage_(other.storage_),
+ buffers_(other.buffers_),
+ handler_(static_cast<WriteHandler&&>(other.handler_))
+ {
+ }
void operator()(const asio::error_code& ec, std::size_t)
{
if (ec)
{
const std::size_t length = 0;
- ASIO_MOVE_OR_LVALUE(WriteHandler)(handler_)(ec, length);
+ static_cast<WriteHandler&&>(handler_)(ec, length);
}
else
{
@@ -293,7 +245,7 @@ namespace detail
storage_.resize(orig_size + length);
const std::size_t bytes_copied = asio::buffer_copy(
storage_.data() + orig_size, buffers_, length);
- ASIO_MOVE_OR_LVALUE(WriteHandler)(handler_)(ec, bytes_copied);
+ static_cast<WriteHandler&&>(handler_)(ec, bytes_copied);
}
}
@@ -304,34 +256,6 @@ namespace detail
};
template <typename ConstBufferSequence, typename WriteHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- buffered_write_some_handler<
- ConstBufferSequence, WriteHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename ConstBufferSequence, typename WriteHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- buffered_write_some_handler<
- ConstBufferSequence, WriteHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename ConstBufferSequence, typename WriteHandler>
inline bool asio_handler_is_continuation(
buffered_write_some_handler<
ConstBufferSequence, WriteHandler>* this_handler)
@@ -340,54 +264,26 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename ConstBufferSequence,
- typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- buffered_write_some_handler<
- ConstBufferSequence, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename ConstBufferSequence,
- typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- buffered_write_some_handler<
- ConstBufferSequence, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename Stream>
class initiate_async_buffered_write_some
{
public:
- typedef typename remove_reference<
- Stream>::type::lowest_layer_type::executor_type executor_type;
+ typedef typename remove_reference_t<
+ Stream>::lowest_layer_type::executor_type executor_type;
explicit initiate_async_buffered_write_some(
- typename remove_reference<Stream>::type& next_layer)
+ remove_reference_t<Stream>& next_layer)
: next_layer_(next_layer)
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return next_layer_.lowest_layer().get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
buffered_stream_storage* storage,
const ConstBufferSequence& buffers) const
{
@@ -401,21 +297,21 @@ namespace detail
{
next_layer_.async_write_some(ASIO_CONST_BUFFER(0, 0),
buffered_write_some_handler<ConstBufferSequence,
- typename decay<WriteHandler>::type>(
+ decay_t<WriteHandler>>(
*storage, buffers, handler2.value));
}
else
{
initiate_async_buffered_flush<Stream>(this->next_layer_)(
buffered_write_some_handler<ConstBufferSequence,
- typename decay<WriteHandler>::type>(
+ decay_t<WriteHandler>>(
*storage, buffers, handler2.value),
storage);
}
}
private:
- typename remove_reference<Stream>::type& next_layer_;
+ remove_reference_t<Stream>& next_layer_;
};
} // namespace detail
@@ -431,8 +327,16 @@ struct associator<Associator,
{
static typename Associator<WriteHandler, DefaultCandidate>::type get(
const detail::buffered_write_some_handler<
+ ConstBufferSequence, WriteHandler>& h) noexcept
+ {
+ return Associator<WriteHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::buffered_write_some_handler<
ConstBufferSequence, WriteHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -444,11 +348,13 @@ template <typename Stream>
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
std::size_t)) WriteHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-buffered_write_stream<Stream>::async_write_some(
- const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler)
+inline auto buffered_write_stream<Stream>::async_write_some(
+ const ConstBufferSequence& buffers, WriteHandler&& handler)
+ -> decltype(
+ async_initiate<WriteHandler,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_buffered_write_some<Stream>>(),
+ handler, declval<detail::buffered_stream_storage*>(), buffers))
{
return async_initiate<WriteHandler,
void (asio::error_code, std::size_t)>(
diff --git a/3rdparty/asio/include/asio/impl/cancellation_signal.ipp b/3rdparty/asio/include/asio/impl/cancellation_signal.ipp
new file mode 100644
index 00000000000..f63ab8de0f3
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/cancellation_signal.ipp
@@ -0,0 +1,96 @@
+//
+// impl/cancellation_signal.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_CANCELLATION_SIGNAL_IPP
+#define ASIO_IMPL_CANCELLATION_SIGNAL_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/cancellation_signal.hpp"
+#include "asio/detail/thread_context.hpp"
+#include "asio/detail/thread_info_base.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+cancellation_signal::~cancellation_signal()
+{
+ if (handler_)
+ {
+ std::pair<void*, std::size_t> mem = handler_->destroy();
+ detail::thread_info_base::deallocate(
+ detail::thread_info_base::cancellation_signal_tag(),
+ detail::thread_context::top_of_thread_call_stack(),
+ mem.first, mem.second);
+ }
+}
+
+void cancellation_slot::clear()
+{
+ if (handler_ != 0 && *handler_ != 0)
+ {
+ std::pair<void*, std::size_t> mem = (*handler_)->destroy();
+ detail::thread_info_base::deallocate(
+ detail::thread_info_base::cancellation_signal_tag(),
+ detail::thread_context::top_of_thread_call_stack(),
+ mem.first, mem.second);
+ *handler_ = 0;
+ }
+}
+
+std::pair<void*, std::size_t> cancellation_slot::prepare_memory(
+ std::size_t size, std::size_t align)
+{
+ assert(handler_);
+ std::pair<void*, std::size_t> mem;
+ if (*handler_)
+ {
+ mem = (*handler_)->destroy();
+ *handler_ = 0;
+ }
+ if (size > mem.second
+ || reinterpret_cast<std::size_t>(mem.first) % align != 0)
+ {
+ if (mem.first)
+ {
+ detail::thread_info_base::deallocate(
+ detail::thread_info_base::cancellation_signal_tag(),
+ detail::thread_context::top_of_thread_call_stack(),
+ mem.first, mem.second);
+ }
+ mem.first = detail::thread_info_base::allocate(
+ detail::thread_info_base::cancellation_signal_tag(),
+ detail::thread_context::top_of_thread_call_stack(),
+ size, align);
+ mem.second = size;
+ }
+ return mem;
+}
+
+cancellation_slot::auto_delete_helper::~auto_delete_helper()
+{
+ if (mem.first)
+ {
+ detail::thread_info_base::deallocate(
+ detail::thread_info_base::cancellation_signal_tag(),
+ detail::thread_context::top_of_thread_call_stack(),
+ mem.first, mem.second);
+ }
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_IMPL_CANCELLATION_SIGNAL_IPP
diff --git a/3rdparty/asio/include/asio/impl/co_spawn.hpp b/3rdparty/asio/include/asio/impl/co_spawn.hpp
index b235e5c4495..3eba7d86db8 100644
--- a/3rdparty/asio/include/asio/impl/co_spawn.hpp
+++ b/3rdparty/asio/include/asio/impl/co_spawn.hpp
@@ -2,7 +2,7 @@
// impl/co_spawn.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,6 +18,8 @@
#include "asio/detail/config.hpp"
#include "asio/associated_cancellation_slot.hpp"
#include "asio/awaitable.hpp"
+#include "asio/detail/memory.hpp"
+#include "asio/detail/recycling_allocator.hpp"
#include "asio/dispatch.hpp"
#include "asio/execution/outstanding_work.hpp"
#include "asio/post.hpp"
@@ -33,18 +35,18 @@ template <typename Executor, typename = void>
class co_spawn_work_guard
{
public:
- typedef typename decay<
- typename prefer_result<Executor,
+ typedef decay_t<
+ prefer_result_t<Executor,
execution::outstanding_work_t::tracked_t
- >::type
- >::type executor_type;
+ >
+ > executor_type;
co_spawn_work_guard(const Executor& ex)
: executor_(asio::prefer(ex, execution::outstanding_work.tracked))
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return executor_;
}
@@ -57,9 +59,9 @@ private:
template <typename Executor>
struct co_spawn_work_guard<Executor,
- typename enable_if<
+ enable_if_t<
!execution::is_executor<Executor>::value
- >::type> : executor_work_guard<Executor>
+ >> : executor_work_guard<Executor>
{
co_spawn_work_guard(const Executor& ex)
: executor_work_guard<Executor>(ex)
@@ -69,50 +71,96 @@ struct co_spawn_work_guard<Executor,
#endif // !defined(ASIO_NO_TS_EXECUTORS)
-template <typename Executor>
-inline co_spawn_work_guard<Executor>
-make_co_spawn_work_guard(const Executor& ex)
+template <typename Handler, typename Executor,
+ typename Function, typename = void>
+struct co_spawn_state
{
- return co_spawn_work_guard<Executor>(ex);
-}
+ template <typename H, typename F>
+ co_spawn_state(H&& h, const Executor& ex, F&& f)
+ : handler(std::forward<H>(h)),
+ spawn_work(ex),
+ handler_work(asio::get_associated_executor(handler, ex)),
+ function(std::forward<F>(f))
+ {
+ }
-template <typename T, typename Executor, typename F, typename Handler>
-awaitable<awaitable_thread_entry_point, Executor> co_spawn_entry_point(
- awaitable<T, Executor>*, Executor ex, F f, Handler handler)
+ Handler handler;
+ co_spawn_work_guard<Executor> spawn_work;
+ co_spawn_work_guard<associated_executor_t<Handler, Executor>> handler_work;
+ Function function;
+};
+
+template <typename Handler, typename Executor, typename Function>
+struct co_spawn_state<Handler, Executor, Function,
+ enable_if_t<
+ is_same<
+ typename associated_executor<Handler,
+ Executor>::asio_associated_executor_is_unspecialised,
+ void
+ >::value
+ >>
{
- auto spawn_work = make_co_spawn_work_guard(ex);
- auto handler_work = make_co_spawn_work_guard(
- asio::get_associated_executor(handler, ex));
+ template <typename H, typename F>
+ co_spawn_state(H&& h, const Executor& ex, F&& f)
+ : handler(std::forward<H>(h)),
+ handler_work(ex),
+ function(std::forward<F>(f))
+ {
+ }
- (void) co_await (dispatch)(
- use_awaitable_t<Executor>{__FILE__, __LINE__, "co_spawn_entry_point"});
+ Handler handler;
+ co_spawn_work_guard<Executor> handler_work;
+ Function function;
+};
+
+struct co_spawn_dispatch
+{
+ template <typename CompletionToken>
+ auto operator()(CompletionToken&& token) const
+ -> decltype(asio::dispatch(std::forward<CompletionToken>(token)))
+ {
+ return asio::dispatch(std::forward<CompletionToken>(token));
+ }
+};
+
+struct co_spawn_post
+{
+ template <typename CompletionToken>
+ auto operator()(CompletionToken&& token) const
+ -> decltype(asio::post(std::forward<CompletionToken>(token)))
+ {
+ return asio::post(std::forward<CompletionToken>(token));
+ }
+};
+
+template <typename T, typename Handler, typename Executor, typename Function>
+awaitable<awaitable_thread_entry_point, Executor> co_spawn_entry_point(
+ awaitable<T, Executor>*, co_spawn_state<Handler, Executor, Function> s)
+{
+ (void) co_await co_spawn_dispatch{};
(co_await awaitable_thread_has_context_switched{}) = false;
std::exception_ptr e = nullptr;
bool done = false;
try
{
- T t = co_await f();
+ T t = co_await s.function();
done = true;
- if (co_await awaitable_thread_has_context_switched{})
+ bool switched = (co_await awaitable_thread_has_context_switched{});
+ if (!switched)
{
- (dispatch)(handler_work.get_executor(),
- [handler = std::move(handler), t = std::move(t)]() mutable
- {
- std::move(handler)(std::exception_ptr(), std::move(t));
- });
- }
- else
- {
- (post)(handler_work.get_executor(),
- [handler = std::move(handler), t = std::move(t)]() mutable
- {
- std::move(handler)(std::exception_ptr(), std::move(t));
- });
+ co_await this_coro::throw_if_cancelled(false);
+ (void) co_await co_spawn_post();
}
+ (dispatch)(s.handler_work.get_executor(),
+ [handler = std::move(s.handler), t = std::move(t)]() mutable
+ {
+ std::move(handler)(std::exception_ptr(), std::move(t));
+ });
+
co_return;
}
catch (...)
@@ -123,62 +171,49 @@ awaitable<awaitable_thread_entry_point, Executor> co_spawn_entry_point(
e = std::current_exception();
}
- if (co_await awaitable_thread_has_context_switched{})
+ bool switched = (co_await awaitable_thread_has_context_switched{});
+ if (!switched)
{
- (dispatch)(handler_work.get_executor(),
- [handler = std::move(handler), e]() mutable
- {
- std::move(handler)(e, T());
- });
- }
- else
- {
- (post)(handler_work.get_executor(),
- [handler = std::move(handler), e]() mutable
- {
- std::move(handler)(e, T());
- });
+ co_await this_coro::throw_if_cancelled(false);
+ (void) co_await co_spawn_post();
}
+
+ (dispatch)(s.handler_work.get_executor(),
+ [handler = std::move(s.handler), e]() mutable
+ {
+ std::move(handler)(e, T());
+ });
}
-template <typename Executor, typename F, typename Handler>
+template <typename Handler, typename Executor, typename Function>
awaitable<awaitable_thread_entry_point, Executor> co_spawn_entry_point(
- awaitable<void, Executor>*, Executor ex, F f, Handler handler)
+ awaitable<void, Executor>*, co_spawn_state<Handler, Executor, Function> s)
{
- auto spawn_work = make_co_spawn_work_guard(ex);
- auto handler_work = make_co_spawn_work_guard(
- asio::get_associated_executor(handler, ex));
-
- (void) co_await (dispatch)(
- use_awaitable_t<Executor>{__FILE__, __LINE__, "co_spawn_entry_point"});
+ (void) co_await co_spawn_dispatch{};
(co_await awaitable_thread_has_context_switched{}) = false;
std::exception_ptr e = nullptr;
try
{
- co_await f();
+ co_await s.function();
}
catch (...)
{
e = std::current_exception();
}
- if (co_await awaitable_thread_has_context_switched{})
+ bool switched = (co_await awaitable_thread_has_context_switched{});
+ if (!switched)
{
- (dispatch)(handler_work.get_executor(),
- [handler = std::move(handler), e]() mutable
- {
- std::move(handler)(e);
- });
- }
- else
- {
- (post)(handler_work.get_executor(),
- [handler = std::move(handler), e]() mutable
- {
- std::move(handler)(e);
- });
+ co_await this_coro::throw_if_cancelled(false);
+ (void) co_await co_spawn_post();
}
+
+ (dispatch)(s.handler_work.get_executor(),
+ [handler = std::move(s.handler), e]() mutable
+ {
+ std::move(handler)(e);
+ });
}
template <typename T, typename Executor>
@@ -199,6 +234,63 @@ private:
awaitable<T, Executor> awaitable_;
};
+template <typename Handler, typename Executor, typename = void>
+class co_spawn_cancellation_handler
+{
+public:
+ co_spawn_cancellation_handler(const Handler&, const Executor& ex)
+ : signal_(detail::allocate_shared<cancellation_signal>(
+ detail::recycling_allocator<cancellation_signal,
+ detail::thread_info_base::cancellation_signal_tag>())),
+ ex_(ex)
+ {
+ }
+
+ cancellation_slot slot()
+ {
+ return signal_->slot();
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ shared_ptr<cancellation_signal> sig = signal_;
+ asio::dispatch(ex_, [sig, type]{ sig->emit(type); });
+ }
+
+private:
+ shared_ptr<cancellation_signal> signal_;
+ Executor ex_;
+};
+
+template <typename Handler, typename Executor>
+class co_spawn_cancellation_handler<Handler, Executor,
+ enable_if_t<
+ is_same<
+ typename associated_executor<Handler,
+ Executor>::asio_associated_executor_is_unspecialised,
+ void
+ >::value
+ >>
+{
+public:
+ co_spawn_cancellation_handler(const Handler&, const Executor&)
+ {
+ }
+
+ cancellation_slot slot()
+ {
+ return signal_.slot();
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ signal_.emit(type);
+ }
+
+private:
+ cancellation_signal signal_;
+};
+
template <typename Executor>
class initiate_co_spawn
{
@@ -211,7 +303,7 @@ public:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return ex_;
}
@@ -219,18 +311,29 @@ public:
template <typename Handler, typename F>
void operator()(Handler&& handler, F&& f) const
{
- typedef typename result_of<F()>::type awaitable_type;
+ typedef result_of_t<F()> awaitable_type;
+ typedef decay_t<Handler> handler_type;
+ typedef decay_t<F> function_type;
+ typedef co_spawn_cancellation_handler<
+ handler_type, Executor> cancel_handler_type;
+
+ auto slot = asio::get_associated_cancellation_slot(handler);
+ cancel_handler_type* cancel_handler = slot.is_connected()
+ ? &slot.template emplace<cancel_handler_type>(handler, ex_)
+ : nullptr;
- cancellation_state proxy_cancel_state(
- asio::get_associated_cancellation_slot(handler),
- enable_total_cancellation());
+ cancellation_slot proxy_slot(
+ cancel_handler
+ ? cancel_handler->slot()
+ : cancellation_slot());
- cancellation_state cancel_state(proxy_cancel_state.slot());
+ cancellation_state cancel_state(proxy_slot);
auto a = (co_spawn_entry_point)(static_cast<awaitable_type*>(nullptr),
- ex_, std::forward<F>(f), std::forward<Handler>(handler));
- awaitable_handler<executor_type, void>(std::move(a), ex_,
- proxy_cancel_state.slot(), cancel_state).launch();
+ co_spawn_state<handler_type, Executor, function_type>(
+ std::forward<Handler>(handler), ex_, std::forward<F>(f)));
+ awaitable_handler<executor_type, void>(std::move(a),
+ ex_, proxy_slot, cancel_state).launch();
}
private:
@@ -246,10 +349,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
CompletionToken, void(std::exception_ptr, T))
co_spawn(const Executor& ex,
awaitable<T, AwaitableExecutor> a, CompletionToken&& token,
- typename constraint<
+ constraint_t<
(is_executor<Executor>::value || execution::is_executor<Executor>::value)
&& is_convertible<Executor, AwaitableExecutor>::value
- >::type)
+ >)
{
return async_initiate<CompletionToken, void(std::exception_ptr, T)>(
detail::initiate_co_spawn<AwaitableExecutor>(AwaitableExecutor(ex)),
@@ -263,10 +366,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
CompletionToken, void(std::exception_ptr))
co_spawn(const Executor& ex,
awaitable<void, AwaitableExecutor> a, CompletionToken&& token,
- typename constraint<
+ constraint_t<
(is_executor<Executor>::value || execution::is_executor<Executor>::value)
&& is_convertible<Executor, AwaitableExecutor>::value
- >::type)
+ >)
{
return async_initiate<CompletionToken, void(std::exception_ptr)>(
detail::initiate_co_spawn<AwaitableExecutor>(AwaitableExecutor(ex)),
@@ -281,11 +384,11 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
CompletionToken, void(std::exception_ptr, T))
co_spawn(ExecutionContext& ctx,
awaitable<T, AwaitableExecutor> a, CompletionToken&& token,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
&& is_convertible<typename ExecutionContext::executor_type,
AwaitableExecutor>::value
- >::type)
+ >)
{
return (co_spawn)(ctx.get_executor(), std::move(a),
std::forward<CompletionToken>(token));
@@ -298,11 +401,11 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
CompletionToken, void(std::exception_ptr))
co_spawn(ExecutionContext& ctx,
awaitable<void, AwaitableExecutor> a, CompletionToken&& token,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
&& is_convertible<typename ExecutionContext::executor_type,
AwaitableExecutor>::value
- >::type)
+ >)
{
return (co_spawn)(ctx.get_executor(), std::move(a),
std::forward<CompletionToken>(token));
@@ -310,30 +413,30 @@ co_spawn(ExecutionContext& ctx,
template <typename Executor, typename F,
ASIO_COMPLETION_TOKEN_FOR(typename detail::awaitable_signature<
- typename result_of<F()>::type>::type) CompletionToken>
+ result_of_t<F()>>::type) CompletionToken>
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
- typename detail::awaitable_signature<typename result_of<F()>::type>::type)
+ typename detail::awaitable_signature<result_of_t<F()>>::type)
co_spawn(const Executor& ex, F&& f, CompletionToken&& token,
- typename constraint<
+ constraint_t<
is_executor<Executor>::value || execution::is_executor<Executor>::value
- >::type)
+ >)
{
return async_initiate<CompletionToken,
- typename detail::awaitable_signature<typename result_of<F()>::type>::type>(
+ typename detail::awaitable_signature<result_of_t<F()>>::type>(
detail::initiate_co_spawn<
- typename result_of<F()>::type::executor_type>(ex),
+ typename result_of_t<F()>::executor_type>(ex),
token, std::forward<F>(f));
}
template <typename ExecutionContext, typename F,
ASIO_COMPLETION_TOKEN_FOR(typename detail::awaitable_signature<
- typename result_of<F()>::type>::type) CompletionToken>
+ result_of_t<F()>>::type) CompletionToken>
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
- typename detail::awaitable_signature<typename result_of<F()>::type>::type)
+ typename detail::awaitable_signature<result_of_t<F()>>::type)
co_spawn(ExecutionContext& ctx, F&& f, CompletionToken&& token,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type)
+ >)
{
return (co_spawn)(ctx.get_executor(), std::forward<F>(f),
std::forward<CompletionToken>(token));
diff --git a/3rdparty/asio/include/asio/impl/compose.hpp b/3rdparty/asio/include/asio/impl/compose.hpp
deleted file mode 100644
index 586911ea708..00000000000
--- a/3rdparty/asio/include/asio/impl/compose.hpp
+++ /dev/null
@@ -1,687 +0,0 @@
-//
-// impl/compose.hpp
-// ~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_IMPL_COMPOSE_HPP
-#define ASIO_IMPL_COMPOSE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/associated_executor.hpp"
-#include "asio/detail/base_from_cancellation_state.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
-#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
-#include "asio/execution/executor.hpp"
-#include "asio/execution/outstanding_work.hpp"
-#include "asio/executor_work_guard.hpp"
-#include "asio/is_executor.hpp"
-#include "asio/system_executor.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-
-namespace detail
-{
- template <typename Executor, typename = void>
- class composed_work_guard
- {
- public:
- typedef typename decay<
- typename prefer_result<Executor,
- execution::outstanding_work_t::tracked_t
- >::type
- >::type executor_type;
-
- composed_work_guard(const Executor& ex)
- : executor_(asio::prefer(ex, execution::outstanding_work.tracked))
- {
- }
-
- void reset()
- {
- }
-
- executor_type get_executor() const ASIO_NOEXCEPT
- {
- return executor_;
- }
-
- private:
- executor_type executor_;
- };
-
-#if !defined(ASIO_NO_TS_EXECUTORS)
-
- template <typename Executor>
- struct composed_work_guard<Executor,
- typename enable_if<
- !execution::is_executor<Executor>::value
- >::type> : executor_work_guard<Executor>
- {
- composed_work_guard(const Executor& ex)
- : executor_work_guard<Executor>(ex)
- {
- }
- };
-
-#endif // !defined(ASIO_NO_TS_EXECUTORS)
-
- template <typename>
- struct composed_io_executors;
-
- template <>
- struct composed_io_executors<void()>
- {
- composed_io_executors() ASIO_NOEXCEPT
- : head_(system_executor())
- {
- }
-
- typedef system_executor head_type;
- system_executor head_;
- };
-
- inline composed_io_executors<void()> make_composed_io_executors()
- {
- return composed_io_executors<void()>();
- }
-
- template <typename Head>
- struct composed_io_executors<void(Head)>
- {
- explicit composed_io_executors(const Head& ex) ASIO_NOEXCEPT
- : head_(ex)
- {
- }
-
- typedef Head head_type;
- Head head_;
- };
-
- template <typename Head>
- inline composed_io_executors<void(Head)>
- make_composed_io_executors(const Head& head)
- {
- return composed_io_executors<void(Head)>(head);
- }
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Head, typename... Tail>
- struct composed_io_executors<void(Head, Tail...)>
- {
- explicit composed_io_executors(const Head& head,
- const Tail&... tail) ASIO_NOEXCEPT
- : head_(head),
- tail_(tail...)
- {
- }
-
- void reset()
- {
- head_.reset();
- tail_.reset();
- }
-
- typedef Head head_type;
- Head head_;
- composed_io_executors<void(Tail...)> tail_;
- };
-
- template <typename Head, typename... Tail>
- inline composed_io_executors<void(Head, Tail...)>
- make_composed_io_executors(const Head& head, const Tail&... tail)
- {
- return composed_io_executors<void(Head, Tail...)>(head, tail...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_COMPOSED_IO_EXECUTORS_DEF(n) \
- template <typename Head, ASIO_VARIADIC_TPARAMS(n)> \
- struct composed_io_executors<void(Head, ASIO_VARIADIC_TARGS(n))> \
- { \
- explicit composed_io_executors(const Head& head, \
- ASIO_VARIADIC_CONSTREF_PARAMS(n)) ASIO_NOEXCEPT \
- : head_(head), \
- tail_(ASIO_VARIADIC_BYVAL_ARGS(n)) \
- { \
- } \
- \
- void reset() \
- { \
- head_.reset(); \
- tail_.reset(); \
- } \
- \
- typedef Head head_type; \
- Head head_; \
- composed_io_executors<void(ASIO_VARIADIC_TARGS(n))> tail_; \
- }; \
- \
- template <typename Head, ASIO_VARIADIC_TPARAMS(n)> \
- inline composed_io_executors<void(Head, ASIO_VARIADIC_TARGS(n))> \
- make_composed_io_executors(const Head& head, \
- ASIO_VARIADIC_CONSTREF_PARAMS(n)) \
- { \
- return composed_io_executors< \
- void(Head, ASIO_VARIADIC_TARGS(n))>( \
- head, ASIO_VARIADIC_BYVAL_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_COMPOSED_IO_EXECUTORS_DEF)
-#undef ASIO_PRIVATE_COMPOSED_IO_EXECUTORS_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename>
- struct composed_work;
-
- template <>
- struct composed_work<void()>
- {
- typedef composed_io_executors<void()> executors_type;
-
- composed_work(const executors_type&) ASIO_NOEXCEPT
- : head_(system_executor())
- {
- }
-
- void reset()
- {
- head_.reset();
- }
-
- typedef system_executor head_type;
- composed_work_guard<system_executor> head_;
- };
-
- template <typename Head>
- struct composed_work<void(Head)>
- {
- typedef composed_io_executors<void(Head)> executors_type;
-
- explicit composed_work(const executors_type& ex) ASIO_NOEXCEPT
- : head_(ex.head_)
- {
- }
-
- void reset()
- {
- head_.reset();
- }
-
- typedef Head head_type;
- composed_work_guard<Head> head_;
- };
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Head, typename... Tail>
- struct composed_work<void(Head, Tail...)>
- {
- typedef composed_io_executors<void(Head, Tail...)> executors_type;
-
- explicit composed_work(const executors_type& ex) ASIO_NOEXCEPT
- : head_(ex.head_),
- tail_(ex.tail_)
- {
- }
-
- void reset()
- {
- head_.reset();
- tail_.reset();
- }
-
- typedef Head head_type;
- composed_work_guard<Head> head_;
- composed_work<void(Tail...)> tail_;
- };
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_COMPOSED_WORK_DEF(n) \
- template <typename Head, ASIO_VARIADIC_TPARAMS(n)> \
- struct composed_work<void(Head, ASIO_VARIADIC_TARGS(n))> \
- { \
- typedef composed_io_executors<void(Head, \
- ASIO_VARIADIC_TARGS(n))> executors_type; \
- \
- explicit composed_work(const executors_type& ex) ASIO_NOEXCEPT \
- : head_(ex.head_), \
- tail_(ex.tail_) \
- { \
- } \
- \
- void reset() \
- { \
- head_.reset(); \
- tail_.reset(); \
- } \
- \
- typedef Head head_type; \
- composed_work_guard<Head> head_; \
- composed_work<void(ASIO_VARIADIC_TARGS(n))> tail_; \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_COMPOSED_WORK_DEF)
-#undef ASIO_PRIVATE_COMPOSED_WORK_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
- template <typename Impl, typename Work, typename Handler, typename Signature>
- class composed_op;
-
- template <typename Impl, typename Work, typename Handler,
- typename R, typename... Args>
- class composed_op<Impl, Work, Handler, R(Args...)>
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- template <typename Impl, typename Work, typename Handler, typename Signature>
- class composed_op
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- : public base_from_cancellation_state<Handler>
- {
- public:
- template <typename I, typename W, typename H>
- composed_op(ASIO_MOVE_ARG(I) impl,
- ASIO_MOVE_ARG(W) work,
- ASIO_MOVE_ARG(H) handler)
- : base_from_cancellation_state<Handler>(
- handler, enable_terminal_cancellation()),
- impl_(ASIO_MOVE_CAST(I)(impl)),
- work_(ASIO_MOVE_CAST(W)(work)),
- handler_(ASIO_MOVE_CAST(H)(handler)),
- invocations_(0)
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- composed_op(composed_op&& other)
- : base_from_cancellation_state<Handler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- Handler>)(other)),
- impl_(ASIO_MOVE_CAST(Impl)(other.impl_)),
- work_(ASIO_MOVE_CAST(Work)(other.work_)),
- handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
- invocations_(other.invocations_)
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- typedef typename associated_executor<Handler,
- typename composed_work_guard<
- typename Work::head_type
- >::executor_type
- >::type executor_type;
-
- executor_type get_executor() const ASIO_NOEXCEPT
- {
- return (get_associated_executor)(handler_, work_.head_.get_executor());
- }
-
- typedef typename associated_allocator<Handler,
- std::allocator<void> >::type allocator_type;
-
- allocator_type get_allocator() const ASIO_NOEXCEPT
- {
- return (get_associated_allocator)(handler_, std::allocator<void>());
- }
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template<typename... T>
- void operator()(ASIO_MOVE_ARG(T)... t)
- {
- if (invocations_ < ~0u)
- ++invocations_;
- this->get_cancellation_state().slot().clear();
- impl_(*this, ASIO_MOVE_CAST(T)(t)...);
- }
-
- void complete(Args... args)
- {
- this->work_.reset();
- ASIO_MOVE_OR_LVALUE(Handler)(this->handler_)(
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- void operator()()
- {
- if (invocations_ < ~0u)
- ++invocations_;
- this->get_cancellation_state().slot().clear();
- impl_(*this);
- }
-
- void complete()
- {
- this->work_.reset();
- ASIO_MOVE_OR_LVALUE(Handler)(this->handler_)();
- }
-
-#define ASIO_PRIVATE_COMPOSED_OP_DEF(n) \
- template<ASIO_VARIADIC_TPARAMS(n)> \
- void operator()(ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- if (invocations_ < ~0u) \
- ++invocations_; \
- this->get_cancellation_state().slot().clear(); \
- impl_(*this, ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template<ASIO_VARIADIC_TPARAMS(n)> \
- void complete(ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- this->work_.reset(); \
- ASIO_MOVE_OR_LVALUE(Handler)(this->handler_)( \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_COMPOSED_OP_DEF)
-#undef ASIO_PRIVATE_COMPOSED_OP_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- void reset_cancellation_state()
- {
- base_from_cancellation_state<Handler>::reset_cancellation_state(handler_);
- }
-
- template <typename Filter>
- void reset_cancellation_state(ASIO_MOVE_ARG(Filter) filter)
- {
- base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
- ASIO_MOVE_CAST(Filter)(filter));
- }
-
- template <typename InFilter, typename OutFilter>
- void reset_cancellation_state(ASIO_MOVE_ARG(InFilter) in_filter,
- ASIO_MOVE_ARG(OutFilter) out_filter)
- {
- base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
- ASIO_MOVE_CAST(InFilter)(in_filter),
- ASIO_MOVE_CAST(OutFilter)(out_filter));
- }
-
- //private:
- Impl impl_;
- Work work_;
- Handler handler_;
- unsigned invocations_;
- };
-
- template <typename Impl, typename Work, typename Handler, typename Signature>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- composed_op<Impl, Work, Handler, Signature>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Impl, typename Work, typename Handler, typename Signature>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- composed_op<Impl, Work, Handler, Signature>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Impl, typename Work, typename Handler, typename Signature>
- inline bool asio_handler_is_continuation(
- composed_op<Impl, Work, Handler, Signature>* this_handler)
- {
- return this_handler->invocations_ > 1 ? true
- : asio_handler_cont_helpers::is_continuation(
- this_handler->handler_);
- }
-
- template <typename Function, typename Impl,
- typename Work, typename Handler, typename Signature>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- composed_op<Impl, Work, Handler, Signature>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename Impl,
- typename Work, typename Handler, typename Signature>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- composed_op<Impl, Work, Handler, Signature>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Signature, typename Executors>
- class initiate_composed_op
- {
- public:
- typedef typename composed_io_executors<Executors>::head_type executor_type;
-
- template <typename T>
- explicit initiate_composed_op(int, ASIO_MOVE_ARG(T) executors)
- : executors_(ASIO_MOVE_CAST(T)(executors))
- {
- }
-
- executor_type get_executor() const ASIO_NOEXCEPT
- {
- return executors_.head_;
- }
-
- template <typename Handler, typename Impl>
- void operator()(ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Impl) impl) const
- {
- composed_op<typename decay<Impl>::type, composed_work<Executors>,
- typename decay<Handler>::type, Signature>(
- ASIO_MOVE_CAST(Impl)(impl),
- composed_work<Executors>(executors_),
- ASIO_MOVE_CAST(Handler)(handler))();
- }
-
- private:
- composed_io_executors<Executors> executors_;
- };
-
- template <typename Signature, typename Executors>
- inline initiate_composed_op<Signature, Executors> make_initiate_composed_op(
- ASIO_MOVE_ARG(composed_io_executors<Executors>) executors)
- {
- return initiate_composed_op<Signature, Executors>(0,
- ASIO_MOVE_CAST(composed_io_executors<Executors>)(executors));
- }
-
- template <typename IoObject>
- inline typename IoObject::executor_type
- get_composed_io_executor(IoObject& io_object,
- typename enable_if<
- !is_executor<IoObject>::value
- >::type* = 0,
- typename enable_if<
- !execution::is_executor<IoObject>::value
- >::type* = 0)
- {
- return io_object.get_executor();
- }
-
- template <typename Executor>
- inline const Executor& get_composed_io_executor(const Executor& ex,
- typename enable_if<
- is_executor<Executor>::value
- || execution::is_executor<Executor>::value
- >::type* = 0)
- {
- return ex;
- }
-} // namespace detail
-
-#if !defined(GENERATING_DOCUMENTATION)
-
-template <template <typename, typename> class Associator,
- typename Impl, typename Work, typename Handler,
- typename Signature, typename DefaultCandidate>
-struct associator<Associator,
- detail::composed_op<Impl, Work, Handler, Signature>,
- DefaultCandidate>
- : Associator<Handler, DefaultCandidate>
-{
- static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::composed_op<Impl, Work, Handler, Signature>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
- {
- return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
- }
-};
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename CompletionToken, typename Signature,
- typename Implementation, typename... IoObjectsOrExecutors>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature)
-async_compose(ASIO_MOVE_ARG(Implementation) implementation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token,
- ASIO_MOVE_ARG(IoObjectsOrExecutors)... io_objects_or_executors)
-{
- return async_initiate<CompletionToken, Signature>(
- detail::make_initiate_composed_op<Signature>(
- detail::make_composed_io_executors(
- detail::get_composed_io_executor(
- ASIO_MOVE_CAST(IoObjectsOrExecutors)(
- io_objects_or_executors))...)),
- token, ASIO_MOVE_CAST(Implementation)(implementation));
-}
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename CompletionToken, typename Signature, typename Implementation>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature)
-async_compose(ASIO_MOVE_ARG(Implementation) implementation,
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token)
-{
- return async_initiate<CompletionToken, Signature>(
- detail::make_initiate_composed_op<Signature>(
- detail::make_composed_io_executors()),
- token, ASIO_MOVE_CAST(Implementation)(implementation));
-}
-
-# define ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR(n) \
- ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_##n
-
-# define ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_1 \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T1)(x1))
-# define ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_2 \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T1)(x1)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T2)(x2))
-# define ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_3 \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T1)(x1)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T2)(x2)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T3)(x3))
-# define ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_4 \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T1)(x1)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T2)(x2)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T3)(x3)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T4)(x4))
-# define ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_5 \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T1)(x1)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T2)(x2)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T3)(x3)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T4)(x4)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T5)(x5))
-# define ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_6 \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T1)(x1)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T2)(x2)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T3)(x3)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T4)(x4)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T5)(x5)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T6)(x6))
-# define ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_7 \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T1)(x1)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T2)(x2)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T3)(x3)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T4)(x4)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T5)(x5)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T6)(x6)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T7)(x7))
-# define ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_8 \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T1)(x1)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T2)(x2)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T3)(x3)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T4)(x4)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T5)(x5)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T6)(x6)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T7)(x7)), \
- detail::get_composed_io_executor(ASIO_MOVE_CAST(T8)(x8))
-
-#define ASIO_PRIVATE_ASYNC_COMPOSE_DEF(n) \
- template <typename CompletionToken, typename Signature, \
- typename Implementation, ASIO_VARIADIC_TPARAMS(n)> \
- ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature) \
- async_compose(ASIO_MOVE_ARG(Implementation) implementation, \
- ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return async_initiate<CompletionToken, Signature>( \
- detail::make_initiate_composed_op<Signature>( \
- detail::make_composed_io_executors( \
- ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR(n))), \
- token, ASIO_MOVE_CAST(Implementation)(implementation)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ASYNC_COMPOSE_DEF)
-#undef ASIO_PRIVATE_ASYNC_COMPOSE_DEF
-
-#undef ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR
-#undef ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_1
-#undef ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_2
-#undef ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_3
-#undef ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_4
-#undef ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_5
-#undef ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_6
-#undef ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_7
-#undef ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR_8
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-#endif // !defined(GENERATING_DOCUMENTATION)
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_IMPL_COMPOSE_HPP
diff --git a/3rdparty/asio/include/asio/impl/connect.hpp b/3rdparty/asio/include/asio/impl/connect.hpp
index 31ec4e165b4..ac74ae0a782 100644
--- a/3rdparty/asio/include/asio/impl/connect.hpp
+++ b/3rdparty/asio/include/asio/impl/connect.hpp
@@ -2,7 +2,7 @@
// impl/connect.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,13 +19,12 @@
#include "asio/associator.hpp"
#include "asio/detail/base_from_cancellation_state.hpp"
#include "asio/detail/bind_handler.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_tracking.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/non_const_lvalue.hpp"
#include "asio/detail/throw_error.hpp"
+#include "asio/detail/type_traits.hpp"
#include "asio/error.hpp"
#include "asio/post.hpp"
@@ -73,16 +72,16 @@ namespace detail
static const bool value =
sizeof(asio_connect_condition_check(
- (*static_cast<legacy_connect_condition_helper<T, Iterator>*>(0))(
- *static_cast<const asio::error_code*>(0),
- *static_cast<const Iterator*>(0)))) != 1;
+ (declval<legacy_connect_condition_helper<T, Iterator>>())(
+ declval<const asio::error_code>(),
+ declval<const Iterator>()))) != 1;
};
template <typename ConnectCondition, typename Iterator>
inline Iterator call_connect_condition(ConnectCondition& connect_condition,
const asio::error_code& ec, Iterator next, Iterator end,
- typename enable_if<is_legacy_connect_condition<
- ConnectCondition, Iterator>::value>::type* = 0)
+ enable_if_t<is_legacy_connect_condition<
+ ConnectCondition, Iterator>::value>* = 0)
{
if (next != end)
return connect_condition(ec, next);
@@ -92,8 +91,8 @@ namespace detail
template <typename ConnectCondition, typename Iterator>
inline Iterator call_connect_condition(ConnectCondition& connect_condition,
const asio::error_code& ec, Iterator next, Iterator end,
- typename enable_if<!is_legacy_connect_condition<
- ConnectCondition, Iterator>::value>::type* = 0)
+ enable_if_t<!is_legacy_connect_condition<
+ ConnectCondition, Iterator>::value>* = 0)
{
for (;next != end; ++next)
if (connect_condition(ec, *next))
@@ -105,8 +104,7 @@ namespace detail
template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type)
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
{
asio::error_code ec;
typename Protocol::endpoint result = connect(s, endpoints, ec);
@@ -117,8 +115,7 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, asio::error_code& ec,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type)
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
{
return detail::deref_connect_result<Protocol>(
connect(s, endpoints.begin(), endpoints.end(),
@@ -128,7 +125,7 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
#if !defined(ASIO_NO_DEPRECATED)
template <typename Protocol, typename Executor, typename Iterator>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
+ constraint_t<!is_endpoint_sequence<Iterator>::value>)
{
asio::error_code ec;
Iterator result = connect(s, begin, ec);
@@ -139,7 +136,7 @@ Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
template <typename Protocol, typename Executor, typename Iterator>
inline Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, asio::error_code& ec,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
+ constraint_t<!is_endpoint_sequence<Iterator>::value>)
{
return connect(s, begin, Iterator(), detail::default_connect_condition(), ec);
}
@@ -166,8 +163,7 @@ template <typename Protocol, typename Executor,
typename EndpointSequence, typename ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type)
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
{
asio::error_code ec;
typename Protocol::endpoint result = connect(
@@ -181,8 +177,7 @@ template <typename Protocol, typename Executor,
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
asio::error_code& ec,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type)
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
{
return detail::deref_connect_result<Protocol>(
connect(s, endpoints.begin(), endpoints.end(),
@@ -194,7 +189,7 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
+ constraint_t<!is_endpoint_sequence<Iterator>::value>)
{
asio::error_code ec;
Iterator result = connect(s, begin, connect_condition, ec);
@@ -207,7 +202,7 @@ template <typename Protocol, typename Executor,
inline Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition,
asio::error_code& ec,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
+ constraint_t<!is_endpoint_sequence<Iterator>::value>)
{
return connect(s, begin, Iterator(), connect_condition, ec);
}
@@ -310,11 +305,10 @@ namespace detail
endpoints_(endpoints),
index_(0),
start_(0),
- handler_(ASIO_MOVE_CAST(RangeConnectHandler)(handler))
+ handler_(static_cast<RangeConnectHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
range_connect_op(const range_connect_op& other)
: base_from_cancellation_state<RangeConnectHandler>(other),
base_from_connect_condition<ConnectCondition>(other),
@@ -328,17 +322,16 @@ namespace detail
range_connect_op(range_connect_op&& other)
: base_from_cancellation_state<RangeConnectHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- RangeConnectHandler>)(other)),
+ static_cast<base_from_cancellation_state<RangeConnectHandler>&&>(
+ other)),
base_from_connect_condition<ConnectCondition>(other),
socket_(other.socket_),
endpoints_(other.endpoints_),
index_(other.index_),
start_(other.start_),
- handler_(ASIO_MOVE_CAST(RangeConnectHandler)(other.handler_))
+ handler_(static_cast<RangeConnectHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec, int start = 0)
{
@@ -368,7 +361,7 @@ namespace detail
socket_.close(ec);
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_connect"));
socket_.async_connect(*iter,
- ASIO_MOVE_CAST(range_connect_op)(*this));
+ static_cast<range_connect_op&&>(*this));
return;
}
@@ -378,7 +371,7 @@ namespace detail
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_connect"));
asio::post(socket_.get_executor(),
detail::bind_handler(
- ASIO_MOVE_CAST(range_connect_op)(*this), ec));
+ static_cast<range_connect_op&&>(*this), ec));
return;
}
@@ -406,7 +399,7 @@ namespace detail
++index_;
}
- ASIO_MOVE_OR_LVALUE(RangeConnectHandler)(handler_)(
+ static_cast<RangeConnectHandler&&>(handler_)(
static_cast<const asio::error_code&>(ec),
static_cast<const typename Protocol::endpoint&>(
ec || iter == end ? typename Protocol::endpoint() : *iter));
@@ -422,36 +415,6 @@ namespace detail
template <typename Protocol, typename Executor, typename EndpointSequence,
typename ConnectCondition, typename RangeConnectHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- range_connect_op<Protocol, Executor, EndpointSequence,
- ConnectCondition, RangeConnectHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Protocol, typename Executor, typename EndpointSequence,
- typename ConnectCondition, typename RangeConnectHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- range_connect_op<Protocol, Executor, EndpointSequence,
- ConnectCondition, RangeConnectHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Protocol, typename Executor, typename EndpointSequence,
- typename ConnectCondition, typename RangeConnectHandler>
inline bool asio_handler_is_continuation(
range_connect_op<Protocol, Executor, EndpointSequence,
ConnectCondition, RangeConnectHandler>* this_handler)
@@ -460,36 +423,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename Executor, typename Protocol,
- typename EndpointSequence, typename ConnectCondition,
- typename RangeConnectHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- range_connect_op<Protocol, Executor, EndpointSequence,
- ConnectCondition, RangeConnectHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename Executor, typename Protocol,
- typename EndpointSequence, typename ConnectCondition,
- typename RangeConnectHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- range_connect_op<Protocol, Executor, EndpointSequence,
- ConnectCondition, RangeConnectHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename Protocol, typename Executor>
class initiate_async_range_connect
{
@@ -501,14 +434,14 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return socket_.get_executor();
}
template <typename RangeConnectHandler,
typename EndpointSequence, typename ConnectCondition>
- void operator()(ASIO_MOVE_ARG(RangeConnectHandler) handler,
+ void operator()(RangeConnectHandler&& handler,
const EndpointSequence& endpoints,
const ConnectCondition& connect_condition) const
{
@@ -520,7 +453,7 @@ namespace detail
non_const_lvalue<RangeConnectHandler> handler2(handler);
range_connect_op<Protocol, Executor, EndpointSequence, ConnectCondition,
- typename decay<RangeConnectHandler>::type>(socket_, endpoints,
+ decay_t<RangeConnectHandler>>(socket_, endpoints,
connect_condition, handler2.value)(asio::error_code(), 1);
}
@@ -546,11 +479,10 @@ namespace detail
iter_(begin),
end_(end),
start_(0),
- handler_(ASIO_MOVE_CAST(IteratorConnectHandler)(handler))
+ handler_(static_cast<IteratorConnectHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
iterator_connect_op(const iterator_connect_op& other)
: base_from_cancellation_state<IteratorConnectHandler>(other),
base_from_connect_condition<ConnectCondition>(other),
@@ -564,17 +496,16 @@ namespace detail
iterator_connect_op(iterator_connect_op&& other)
: base_from_cancellation_state<IteratorConnectHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- IteratorConnectHandler>)(other)),
+ static_cast<base_from_cancellation_state<IteratorConnectHandler>&&>(
+ other)),
base_from_connect_condition<ConnectCondition>(other),
socket_(other.socket_),
iter_(other.iter_),
end_(other.end_),
start_(other.start_),
- handler_(ASIO_MOVE_CAST(IteratorConnectHandler)(other.handler_))
+ handler_(static_cast<IteratorConnectHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec, int start = 0)
{
@@ -590,7 +521,7 @@ namespace detail
socket_.close(ec);
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_connect"));
socket_.async_connect(*iter_,
- ASIO_MOVE_CAST(iterator_connect_op)(*this));
+ static_cast<iterator_connect_op&&>(*this));
return;
}
@@ -600,7 +531,7 @@ namespace detail
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_connect"));
asio::post(socket_.get_executor(),
detail::bind_handler(
- ASIO_MOVE_CAST(iterator_connect_op)(*this), ec));
+ static_cast<iterator_connect_op&&>(*this), ec));
return;
}
@@ -627,7 +558,7 @@ namespace detail
++iter_;
}
- ASIO_MOVE_OR_LVALUE(IteratorConnectHandler)(handler_)(
+ static_cast<IteratorConnectHandler&&>(handler_)(
static_cast<const asio::error_code&>(ec),
static_cast<const Iterator&>(iter_));
}
@@ -643,36 +574,6 @@ namespace detail
template <typename Protocol, typename Executor, typename Iterator,
typename ConnectCondition, typename IteratorConnectHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- iterator_connect_op<Protocol, Executor, Iterator,
- ConnectCondition, IteratorConnectHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Protocol, typename Executor, typename Iterator,
- typename ConnectCondition, typename IteratorConnectHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- iterator_connect_op<Protocol, Executor, Iterator,
- ConnectCondition, IteratorConnectHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Protocol, typename Executor, typename Iterator,
- typename ConnectCondition, typename IteratorConnectHandler>
inline bool asio_handler_is_continuation(
iterator_connect_op<Protocol, Executor, Iterator,
ConnectCondition, IteratorConnectHandler>* this_handler)
@@ -681,36 +582,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename Executor, typename Protocol,
- typename Iterator, typename ConnectCondition,
- typename IteratorConnectHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- iterator_connect_op<Protocol, Executor, Iterator,
- ConnectCondition, IteratorConnectHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename Executor, typename Protocol,
- typename Iterator, typename ConnectCondition,
- typename IteratorConnectHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- iterator_connect_op<Protocol, Executor, Iterator,
- ConnectCondition, IteratorConnectHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename Protocol, typename Executor>
class initiate_async_iterator_connect
{
@@ -723,14 +594,14 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return socket_.get_executor();
}
template <typename IteratorConnectHandler,
typename Iterator, typename ConnectCondition>
- void operator()(ASIO_MOVE_ARG(IteratorConnectHandler) handler,
+ void operator()(IteratorConnectHandler&& handler,
Iterator begin, Iterator end,
const ConnectCondition& connect_condition) const
{
@@ -742,7 +613,7 @@ namespace detail
non_const_lvalue<IteratorConnectHandler> handler2(handler);
iterator_connect_op<Protocol, Executor, Iterator, ConnectCondition,
- typename decay<IteratorConnectHandler>::type>(socket_, begin, end,
+ decay_t<IteratorConnectHandler>>(socket_, begin, end,
connect_condition, handler2.value)(asio::error_code(), 1);
}
@@ -764,9 +635,19 @@ struct associator<Associator,
: Associator<RangeConnectHandler, DefaultCandidate>
{
static typename Associator<RangeConnectHandler, DefaultCandidate>::type get(
+ const detail::range_connect_op<Protocol, Executor, EndpointSequence,
+ ConnectCondition, RangeConnectHandler>& h) noexcept
+ {
+ return Associator<RangeConnectHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
const detail::range_connect_op<Protocol, Executor,
EndpointSequence, ConnectCondition, RangeConnectHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(
+ Associator<RangeConnectHandler, DefaultCandidate>::get(
+ h.handler_, c))
{
return Associator<RangeConnectHandler, DefaultCandidate>::get(
h.handler_, c);
@@ -784,10 +665,20 @@ struct associator<Associator,
: Associator<IteratorConnectHandler, DefaultCandidate>
{
static typename Associator<IteratorConnectHandler, DefaultCandidate>::type
- get(
+ get(const detail::iterator_connect_op<Protocol, Executor, Iterator,
+ ConnectCondition, IteratorConnectHandler>& h) noexcept
+ {
+ return Associator<IteratorConnectHandler, DefaultCandidate>::get(
+ h.handler_);
+ }
+
+ static auto get(
const detail::iterator_connect_op<Protocol, Executor,
Iterator, ConnectCondition, IteratorConnectHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(
+ Associator<IteratorConnectHandler, DefaultCandidate>::get(
+ h.handler_, c))
{
return Associator<IteratorConnectHandler, DefaultCandidate>::get(
h.handler_, c);
@@ -798,103 +689,117 @@ struct associator<Associator,
template <typename Protocol, typename Executor, typename EndpointSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- typename Protocol::endpoint)) RangeConnectHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
- void (asio::error_code, typename Protocol::endpoint))
-async_connect(basic_socket<Protocol, Executor>& s,
- const EndpointSequence& endpoints,
- ASIO_MOVE_ARG(RangeConnectHandler) handler,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type)
+ typename Protocol::endpoint)) RangeConnectToken>
+inline auto async_connect(basic_socket<Protocol, Executor>& s,
+ const EndpointSequence& endpoints, RangeConnectToken&& token,
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
+ -> decltype(
+ async_initiate<RangeConnectToken,
+ void (asio::error_code, typename Protocol::endpoint)>(
+ declval<detail::initiate_async_range_connect<Protocol, Executor>>(),
+ token, endpoints, declval<detail::default_connect_condition>()))
{
- return async_initiate<RangeConnectHandler,
+ return async_initiate<RangeConnectToken,
void (asio::error_code, typename Protocol::endpoint)>(
detail::initiate_async_range_connect<Protocol, Executor>(s),
- handler, endpoints, detail::default_connect_condition());
+ token, endpoints, detail::default_connect_condition());
}
#if !defined(ASIO_NO_DEPRECATED)
template <typename Protocol, typename Executor, typename Iterator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- Iterator)) IteratorConnectHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
- void (asio::error_code, Iterator))
-async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- ASIO_MOVE_ARG(IteratorConnectHandler) handler,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
+ Iterator)) IteratorConnectToken>
+inline auto async_connect(basic_socket<Protocol, Executor>& s,
+ Iterator begin, IteratorConnectToken&& token,
+ constraint_t<!is_endpoint_sequence<Iterator>::value>)
+ -> decltype(
+ async_initiate<IteratorConnectToken,
+ void (asio::error_code, Iterator)>(
+ declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
+ token, begin, Iterator(), declval<detail::default_connect_condition>()))
{
- return async_initiate<IteratorConnectHandler,
+ return async_initiate<IteratorConnectToken,
void (asio::error_code, Iterator)>(
detail::initiate_async_iterator_connect<Protocol, Executor>(s),
- handler, begin, Iterator(), detail::default_connect_condition());
+ token, begin, Iterator(), detail::default_connect_condition());
}
#endif // !defined(ASIO_NO_DEPRECATED)
template <typename Protocol, typename Executor, typename Iterator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- Iterator)) IteratorConnectHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
- void (asio::error_code, Iterator))
-async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator end,
- ASIO_MOVE_ARG(IteratorConnectHandler) handler)
+ Iterator)) IteratorConnectToken>
+inline auto async_connect(basic_socket<Protocol, Executor>& s,
+ Iterator begin, Iterator end, IteratorConnectToken&& token)
+ -> decltype(
+ async_initiate<IteratorConnectToken,
+ void (asio::error_code, Iterator)>(
+ declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
+ token, begin, end, declval<detail::default_connect_condition>()))
{
- return async_initiate<IteratorConnectHandler,
+ return async_initiate<IteratorConnectToken,
void (asio::error_code, Iterator)>(
detail::initiate_async_iterator_connect<Protocol, Executor>(s),
- handler, begin, end, detail::default_connect_condition());
+ token, begin, end, detail::default_connect_condition());
}
template <typename Protocol, typename Executor,
typename EndpointSequence, typename ConnectCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- typename Protocol::endpoint)) RangeConnectHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
- void (asio::error_code, typename Protocol::endpoint))
-async_connect(basic_socket<Protocol, Executor>& s,
+ typename Protocol::endpoint)) RangeConnectToken>
+inline auto async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
- ASIO_MOVE_ARG(RangeConnectHandler) handler,
- typename constraint<is_endpoint_sequence<
- EndpointSequence>::value>::type)
+ RangeConnectToken&& token,
+ constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
+ -> decltype(
+ async_initiate<RangeConnectToken,
+ void (asio::error_code, typename Protocol::endpoint)>(
+ declval<detail::initiate_async_range_connect<Protocol, Executor>>(),
+ token, endpoints, connect_condition))
{
- return async_initiate<RangeConnectHandler,
+ return async_initiate<RangeConnectToken,
void (asio::error_code, typename Protocol::endpoint)>(
detail::initiate_async_range_connect<Protocol, Executor>(s),
- handler, endpoints, connect_condition);
+ token, endpoints, connect_condition);
}
#if !defined(ASIO_NO_DEPRECATED)
template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- Iterator)) IteratorConnectHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
- void (asio::error_code, Iterator))
-async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- ConnectCondition connect_condition,
- ASIO_MOVE_ARG(IteratorConnectHandler) handler,
- typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
+ Iterator)) IteratorConnectToken>
+inline auto async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
+ ConnectCondition connect_condition, IteratorConnectToken&& token,
+ constraint_t<!is_endpoint_sequence<Iterator>::value>)
+ -> decltype(
+ async_initiate<IteratorConnectToken,
+ void (asio::error_code, Iterator)>(
+ declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
+ token, begin, Iterator(), connect_condition))
{
- return async_initiate<IteratorConnectHandler,
+ return async_initiate<IteratorConnectToken,
void (asio::error_code, Iterator)>(
detail::initiate_async_iterator_connect<Protocol, Executor>(s),
- handler, begin, Iterator(), connect_condition);
+ token, begin, Iterator(), connect_condition);
}
#endif // !defined(ASIO_NO_DEPRECATED)
template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- Iterator)) IteratorConnectHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
- void (asio::error_code, Iterator))
-async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- Iterator end, ConnectCondition connect_condition,
- ASIO_MOVE_ARG(IteratorConnectHandler) handler)
+ Iterator)) IteratorConnectToken>
+inline auto async_connect(basic_socket<Protocol, Executor>& s,
+ Iterator begin, Iterator end, ConnectCondition connect_condition,
+ IteratorConnectToken&& token)
+ -> decltype(
+ async_initiate<IteratorConnectToken,
+ void (asio::error_code, Iterator)>(
+ declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
+ token, begin, end, connect_condition))
{
- return async_initiate<IteratorConnectHandler,
+ return async_initiate<IteratorConnectToken,
void (asio::error_code, Iterator)>(
detail::initiate_async_iterator_connect<Protocol, Executor>(s),
- handler, begin, end, connect_condition);
+ token, begin, end, connect_condition);
}
} // namespace asio
diff --git a/3rdparty/asio/include/asio/impl/connect_pipe.hpp b/3rdparty/asio/include/asio/impl/connect_pipe.hpp
new file mode 100644
index 00000000000..e40b3c9433c
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/connect_pipe.hpp
@@ -0,0 +1,73 @@
+//
+// impl/connect_pipe.hpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_CONNECT_PIPE_HPP
+#define ASIO_IMPL_CONNECT_PIPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_PIPE)
+
+#include "asio/connect_pipe.hpp"
+#include "asio/detail/throw_error.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+template <typename Executor1, typename Executor2>
+void connect_pipe(basic_readable_pipe<Executor1>& read_end,
+ basic_writable_pipe<Executor2>& write_end)
+{
+ asio::error_code ec;
+ asio::connect_pipe(read_end, write_end, ec);
+ asio::detail::throw_error(ec, "connect_pipe");
+}
+
+template <typename Executor1, typename Executor2>
+ASIO_SYNC_OP_VOID connect_pipe(basic_readable_pipe<Executor1>& read_end,
+ basic_writable_pipe<Executor2>& write_end, asio::error_code& ec)
+{
+ detail::native_pipe_handle p[2];
+ detail::create_pipe(p, ec);
+ if (ec)
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+
+ read_end.assign(p[0], ec);
+ if (ec)
+ {
+ detail::close_pipe(p[0]);
+ detail::close_pipe(p[1]);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ write_end.assign(p[1], ec);
+ if (ec)
+ {
+ asio::error_code temp_ec;
+ read_end.close(temp_ec);
+ detail::close_pipe(p[1]);
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_PIPE)
+
+#endif // ASIO_IMPL_CONNECT_PIPE_HPP
diff --git a/3rdparty/asio/include/asio/impl/connect_pipe.ipp b/3rdparty/asio/include/asio/impl/connect_pipe.ipp
new file mode 100644
index 00000000000..6efe790d713
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/connect_pipe.ipp
@@ -0,0 +1,149 @@
+//
+// impl/connect_pipe.ipp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2021 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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 ASIO_IMPL_CONNECT_PIPE_IPP
+#define ASIO_IMPL_CONNECT_PIPE_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_PIPE)
+
+#include "asio/connect_pipe.hpp"
+
+#if defined(ASIO_HAS_IOCP)
+# include <cstdio>
+# if _WIN32_WINNT >= 0x601
+# include <bcrypt.h>
+# if !defined(ASIO_NO_DEFAULT_LINKED_LIBS)
+# if defined(_MSC_VER)
+# pragma comment(lib, "bcrypt.lib")
+# endif // defined(_MSC_VER)
+# endif // !defined(ASIO_NO_DEFAULT_LINKED_LIBS)
+# endif // _WIN32_WINNT >= 0x601
+#else // defined(ASIO_HAS_IOCP)
+# include "asio/detail/descriptor_ops.hpp"
+#endif // defined(ASIO_HAS_IOCP)
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+void create_pipe(native_pipe_handle p[2], asio::error_code& ec)
+{
+#if defined(ASIO_HAS_IOCP)
+ using namespace std; // For sprintf and memcmp.
+
+ static long counter1 = 0;
+ static long counter2 = 0;
+
+ long n1 = ::InterlockedIncrement(&counter1);
+ long n2 = (static_cast<unsigned long>(n1) % 0x10000000) == 0
+ ? ::InterlockedIncrement(&counter2)
+ : ::InterlockedExchangeAdd(&counter2, 0);
+
+ wchar_t pipe_name[128];
+#if defined(ASIO_HAS_SECURE_RTL)
+ swprintf_s(
+#else // defined(ASIO_HAS_SECURE_RTL)
+ _snwprintf(
+#endif // defined(ASIO_HAS_SECURE_RTL)
+ pipe_name, 128,
+ L"\\\\.\\pipe\\asio-A0812896-741A-484D-AF23-BE51BF620E22-%u-%ld-%ld",
+ static_cast<unsigned int>(::GetCurrentProcessId()), n1, n2);
+
+ p[0] = ::CreateNamedPipeW(pipe_name,
+ PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,
+ 0, 1, 8192, 8192, 0, 0);
+
+ if (p[0] == INVALID_HANDLE_VALUE)
+ {
+ DWORD last_error = ::GetLastError();
+ ec.assign(last_error, asio::error::get_system_category());
+ return;
+ }
+
+ p[1] = ::CreateFileW(pipe_name, GENERIC_WRITE, 0,
+ 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
+
+ if (p[1] == INVALID_HANDLE_VALUE)
+ {
+ DWORD last_error = ::GetLastError();
+ ::CloseHandle(p[0]);
+ ec.assign(last_error, asio::error::get_system_category());
+ return;
+ }
+
+# if _WIN32_WINNT >= 0x601
+ unsigned char nonce[16];
+ if (::BCryptGenRandom(0, nonce, sizeof(nonce),
+ BCRYPT_USE_SYSTEM_PREFERRED_RNG) != 0)
+ {
+ ec = asio::error::connection_aborted;
+ ::CloseHandle(p[0]);
+ ::CloseHandle(p[1]);
+ return;
+ }
+
+ DWORD bytes_written = 0;
+ BOOL ok = ::WriteFile(p[1], nonce, sizeof(nonce), &bytes_written, 0);
+ if (!ok || bytes_written != sizeof(nonce))
+ {
+ ec = asio::error::connection_aborted;
+ ::CloseHandle(p[0]);
+ ::CloseHandle(p[1]);
+ return;
+ }
+
+ unsigned char nonce_check[sizeof(nonce)];
+ DWORD bytes_read = 0;
+ ok = ::ReadFile(p[0], nonce_check, sizeof(nonce), &bytes_read, 0);
+ if (!ok || bytes_read != sizeof(nonce)
+ || memcmp(nonce, nonce_check, sizeof(nonce)) != 0)
+ {
+ ec = asio::error::connection_aborted;
+ ::CloseHandle(p[0]);
+ ::CloseHandle(p[1]);
+ return;
+ }
+#endif // _WIN32_WINNT >= 0x601
+
+ asio::error::clear(ec);
+#else // defined(ASIO_HAS_IOCP)
+ int result = ::pipe(p);
+ detail::descriptor_ops::get_last_error(ec, result != 0);
+#endif // defined(ASIO_HAS_IOCP)
+}
+
+void close_pipe(native_pipe_handle p)
+{
+#if defined(ASIO_HAS_IOCP)
+ ::CloseHandle(p);
+#else // defined(ASIO_HAS_IOCP)
+ asio::error_code ignored_ec;
+ detail::descriptor_ops::state_type state = 0;
+ detail::descriptor_ops::close(p, state, ignored_ec);
+#endif // defined(ASIO_HAS_IOCP)
+}
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_PIPE)
+
+#endif // ASIO_IMPL_CONNECT_PIPE_IPP
diff --git a/3rdparty/asio/include/asio/impl/consign.hpp b/3rdparty/asio/include/asio/impl/consign.hpp
new file mode 100644
index 00000000000..3b753c10fd0
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/consign.hpp
@@ -0,0 +1,137 @@
+//
+// impl/consign.hpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_CONSIGN_HPP
+#define ASIO_IMPL_CONSIGN_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associator.hpp"
+#include "asio/async_result.hpp"
+#include "asio/detail/handler_cont_helpers.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/detail/utility.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+// Class to adapt a consign_t as a completion handler.
+template <typename Handler, typename... Values>
+class consign_handler
+{
+public:
+ typedef void result_type;
+
+ template <typename H>
+ consign_handler(H&& handler, std::tuple<Values...> values)
+ : handler_(static_cast<H&&>(handler)),
+ values_(static_cast<std::tuple<Values...>&&>(values))
+ {
+ }
+
+ template <typename... Args>
+ void operator()(Args&&... args)
+ {
+ static_cast<Handler&&>(handler_)(static_cast<Args&&>(args)...);
+ }
+
+//private:
+ Handler handler_;
+ std::tuple<Values...> values_;
+};
+
+template <typename Handler>
+inline bool asio_handler_is_continuation(
+ consign_handler<Handler>* this_handler)
+{
+ return asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename CompletionToken, typename... Values, typename... Signatures>
+struct async_result<consign_t<CompletionToken, Values...>, Signatures...>
+ : async_result<CompletionToken, Signatures...>
+{
+ template <typename Initiation>
+ struct init_wrapper
+ {
+ init_wrapper(Initiation init)
+ : initiation_(static_cast<Initiation&&>(init))
+ {
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler,
+ std::tuple<Values...> values, Args&&... args)
+ {
+ static_cast<Initiation&&>(initiation_)(
+ detail::consign_handler<decay_t<Handler>, Values...>(
+ static_cast<Handler&&>(handler),
+ static_cast<std::tuple<Values...>&&>(values)),
+ static_cast<Args&&>(args)...);
+ }
+
+ Initiation initiation_;
+ };
+
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<CompletionToken, Signatures...>(
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, static_cast<std::tuple<Values...>&&>(token.values_),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<CompletionToken, Signatures...>(
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, static_cast<std::tuple<Values...>&&>(token.values_),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <template <typename, typename> class Associator,
+ typename Handler, typename... Values, typename DefaultCandidate>
+struct associator<Associator,
+ detail::consign_handler<Handler, Values...>, DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const detail::consign_handler<Handler, Values...>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::consign_handler<Handler, Values...>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_IMPL_CONSIGN_HPP
diff --git a/3rdparty/asio/include/asio/impl/defer.hpp b/3rdparty/asio/include/asio/impl/defer.hpp
deleted file mode 100644
index 129d8684a94..00000000000
--- a/3rdparty/asio/include/asio/impl/defer.hpp
+++ /dev/null
@@ -1,256 +0,0 @@
-//
-// impl/defer.hpp
-// ~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_IMPL_DEFER_HPP
-#define ASIO_IMPL_DEFER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/associated_allocator.hpp"
-#include "asio/associated_executor.hpp"
-#include "asio/detail/work_dispatcher.hpp"
-#include "asio/execution/allocator.hpp"
-#include "asio/execution/blocking.hpp"
-#include "asio/execution/relationship.hpp"
-#include "asio/prefer.hpp"
-#include "asio/require.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class initiate_defer
-{
-public:
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- execution::is_executor<
- typename associated_executor<
- typename decay<CompletionHandler>::type
- >::type
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_executor<handler_t>::type ex(
- (get_associated_executor)(handler));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- execution::execute(
- asio::prefer(
- asio::require(ex, execution::blocking.never),
- execution::relationship.continuation,
- execution::allocator(alloc)),
- asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)));
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- !execution::is_executor<
- typename associated_executor<
- typename decay<CompletionHandler>::type
- >::type
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_executor<handler_t>::type ex(
- (get_associated_executor)(handler));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- ex.defer(asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
- }
-};
-
-template <typename Executor>
-class initiate_defer_with_executor
-{
-public:
- typedef Executor executor_type;
-
- explicit initiate_defer_with_executor(const Executor& ex)
- : ex_(ex)
- {
- }
-
- executor_type get_executor() const ASIO_NOEXCEPT
- {
- return ex_;
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- !detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- execution::execute(
- asio::prefer(
- asio::require(ex_, execution::blocking.never),
- execution::relationship.continuation,
- execution::allocator(alloc)),
- asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)));
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typedef typename associated_executor<
- handler_t, Executor>::type handler_ex_t;
- handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- execution::execute(
- asio::prefer(
- asio::require(ex_, execution::blocking.never),
- execution::relationship.continuation,
- execution::allocator(alloc)),
- detail::work_dispatcher<handler_t, handler_ex_t>(
- ASIO_MOVE_CAST(CompletionHandler)(handler), handler_ex));
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- !execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- !detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- ex_.defer(asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- !execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typedef typename associated_executor<
- handler_t, Executor>::type handler_ex_t;
- handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- ex_.defer(detail::work_dispatcher<handler_t, handler_ex_t>(
- ASIO_MOVE_CAST(CompletionHandler)(handler),
- handler_ex), alloc);
- }
-
-private:
- Executor ex_;
-};
-
-} // namespace detail
-
-template <ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
- ASIO_MOVE_ARG(CompletionToken) token)
-{
- return async_initiate<CompletionToken, void()>(
- detail::initiate_defer(), token);
-}
-
-template <typename Executor,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
- const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token,
- typename constraint<
- execution::is_executor<Executor>::value || is_executor<Executor>::value
- >::type)
-{
- return async_initiate<CompletionToken, void()>(
- detail::initiate_defer_with_executor<Executor>(ex), token);
-}
-
-template <typename ExecutionContext,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
- ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token,
- typename constraint<is_convertible<
- ExecutionContext&, execution_context&>::value>::type)
-{
- return async_initiate<CompletionToken, void()>(
- detail::initiate_defer_with_executor<
- typename ExecutionContext::executor_type>(
- ctx.get_executor()), token);
-}
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_IMPL_DEFER_HPP
diff --git a/3rdparty/asio/include/asio/impl/deferred.hpp b/3rdparty/asio/include/asio/impl/deferred.hpp
new file mode 100644
index 00000000000..defc34fb3e7
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/deferred.hpp
@@ -0,0 +1,147 @@
+//
+// impl/deferred.hpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_DEFERRED_HPP
+#define ASIO_IMPL_DEFERRED_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename Signature>
+class async_result<deferred_t, Signature>
+{
+public:
+ template <typename Initiation, typename... InitArgs>
+ static deferred_async_operation<Signature, Initiation, InitArgs...>
+ initiate(Initiation&& initiation, deferred_t, InitArgs&&... args)
+ {
+ return deferred_async_operation<Signature, Initiation, InitArgs...>(
+ deferred_init_tag{},
+ static_cast<Initiation&&>(initiation),
+ static_cast<InitArgs&&>(args)...);
+ }
+};
+
+template <typename... Signatures>
+class async_result<deferred_t, Signatures...>
+{
+public:
+ template <typename Initiation, typename... InitArgs>
+ static deferred_async_operation<
+ deferred_signatures<Signatures...>, Initiation, InitArgs...>
+ initiate(Initiation&& initiation, deferred_t, InitArgs&&... args)
+ {
+ return deferred_async_operation<
+ deferred_signatures<Signatures...>, Initiation, InitArgs...>(
+ deferred_init_tag{},
+ static_cast<Initiation&&>(initiation),
+ static_cast<InitArgs&&>(args)...);
+ }
+};
+
+template <typename Function, typename Signature>
+class async_result<deferred_function<Function>, Signature>
+{
+public:
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate(Initiation&& initiation,
+ deferred_function<Function> token, InitArgs&&... init_args)
+ -> decltype(
+ deferred_sequence<
+ deferred_async_operation<
+ Signature, Initiation, InitArgs...>,
+ Function>(deferred_init_tag{},
+ deferred_async_operation<
+ Signature, Initiation, InitArgs...>(
+ deferred_init_tag{},
+ static_cast<Initiation&&>(initiation),
+ static_cast<InitArgs&&>(init_args)...),
+ static_cast<Function&&>(token.function_)))
+ {
+ return deferred_sequence<
+ deferred_async_operation<
+ Signature, Initiation, InitArgs...>,
+ Function>(deferred_init_tag{},
+ deferred_async_operation<
+ Signature, Initiation, InitArgs...>(
+ deferred_init_tag{},
+ static_cast<Initiation&&>(initiation),
+ static_cast<InitArgs&&>(init_args)...),
+ static_cast<Function&&>(token.function_));
+ }
+};
+
+template <typename Function, typename... Signatures>
+class async_result<deferred_function<Function>, Signatures...>
+{
+public:
+ template <typename Initiation, typename... InitArgs>
+ static auto initiate(Initiation&& initiation,
+ deferred_function<Function> token, InitArgs&&... init_args)
+ -> decltype(
+ deferred_sequence<
+ deferred_async_operation<
+ deferred_signatures<Signatures...>, Initiation, InitArgs...>,
+ Function>(deferred_init_tag{},
+ deferred_async_operation<
+ deferred_signatures<Signatures...>, Initiation, InitArgs...>(
+ deferred_init_tag{},
+ static_cast<Initiation&&>(initiation),
+ static_cast<InitArgs&&>(init_args)...),
+ static_cast<Function&&>(token.function_)))
+ {
+ return deferred_sequence<
+ deferred_async_operation<
+ deferred_signatures<Signatures...>, Initiation, InitArgs...>,
+ Function>(deferred_init_tag{},
+ deferred_async_operation<
+ deferred_signatures<Signatures...>, Initiation, InitArgs...>(
+ deferred_init_tag{},
+ static_cast<Initiation&&>(initiation),
+ static_cast<InitArgs&&>(init_args)...),
+ static_cast<Function&&>(token.function_));
+ }
+};
+
+template <template <typename, typename> class Associator,
+ typename Handler, typename Tail, typename DefaultCandidate>
+struct associator<Associator,
+ detail::deferred_sequence_handler<Handler, Tail>,
+ DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const detail::deferred_sequence_handler<Handler, Tail>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::deferred_sequence_handler<Handler, Tail>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_IMPL_DEFERRED_HPP
diff --git a/3rdparty/asio/include/asio/impl/detached.hpp b/3rdparty/asio/include/asio/impl/detached.hpp
index f159b1ffbaa..774e52b1e01 100644
--- a/3rdparty/asio/include/asio/impl/detached.hpp
+++ b/3rdparty/asio/include/asio/impl/detached.hpp
@@ -2,7 +2,7 @@
// impl/detached.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,7 +17,6 @@
#include "asio/detail/config.hpp"
#include "asio/async_result.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/detail/push_options.hpp"
@@ -34,29 +33,10 @@ namespace detail {
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... Args>
void operator()(Args...)
{
}
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- void operator()()
- {
- }
-
-#define ASIO_PRIVATE_DETACHED_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- void operator()(ASIO_VARIADIC_TARGS(n)) \
- { \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_DETACHED_DEF)
-#undef ASIO_PRIVATE_DETACHED_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
} // namespace detail
@@ -78,47 +58,14 @@ struct async_result<detached_t, Signature>
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Initiation, typename RawCompletionToken, typename... Args>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken),
- ASIO_MOVE_ARG(Args)... args)
+ static return_type initiate(Initiation&& initiation,
+ RawCompletionToken&&, Args&&... args)
{
- ASIO_MOVE_CAST(Initiation)(initiation)(
+ static_cast<Initiation&&>(initiation)(
detail::detached_handler(detached_t()),
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Initiation, typename RawCompletionToken>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken))
- {
- ASIO_MOVE_CAST(Initiation)(initiation)(
- detail::detached_handler(detached_t()));
+ static_cast<Args&&>(args)...);
}
-
-#define ASIO_PRIVATE_INITIATE_DEF(n) \
- template <typename Initiation, typename RawCompletionToken, \
- ASIO_VARIADIC_TPARAMS(n)> \
- static return_type initiate( \
- ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_MOVE_ARG(RawCompletionToken), \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- ASIO_MOVE_CAST(Initiation)(initiation)( \
- detail::detached_handler(detached_t()), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF)
-#undef ASIO_PRIVATE_INITIATE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
#endif // !defined(GENERATING_DOCUMENTATION)
diff --git a/3rdparty/asio/include/asio/impl/dispatch.hpp b/3rdparty/asio/include/asio/impl/dispatch.hpp
deleted file mode 100644
index b602f6fcf41..00000000000
--- a/3rdparty/asio/include/asio/impl/dispatch.hpp
+++ /dev/null
@@ -1,251 +0,0 @@
-//
-// impl/dispatch.hpp
-// ~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_IMPL_DISPATCH_HPP
-#define ASIO_IMPL_DISPATCH_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/associated_allocator.hpp"
-#include "asio/associated_executor.hpp"
-#include "asio/detail/work_dispatcher.hpp"
-#include "asio/execution/allocator.hpp"
-#include "asio/execution/blocking.hpp"
-#include "asio/prefer.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class initiate_dispatch
-{
-public:
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- execution::is_executor<
- typename associated_executor<
- typename decay<CompletionHandler>::type
- >::type
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_executor<handler_t>::type ex(
- (get_associated_executor)(handler));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- execution::execute(
- asio::prefer(ex,
- execution::blocking.possibly,
- execution::allocator(alloc)),
- asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)));
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- !execution::is_executor<
- typename associated_executor<
- typename decay<CompletionHandler>::type
- >::type
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_executor<handler_t>::type ex(
- (get_associated_executor)(handler));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- ex.dispatch(asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
- }
-};
-
-template <typename Executor>
-class initiate_dispatch_with_executor
-{
-public:
- typedef Executor executor_type;
-
- explicit initiate_dispatch_with_executor(const Executor& ex)
- : ex_(ex)
- {
- }
-
- executor_type get_executor() const ASIO_NOEXCEPT
- {
- return ex_;
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- !detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- execution::execute(
- asio::prefer(ex_,
- execution::blocking.possibly,
- execution::allocator(alloc)),
- asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)));
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typedef typename associated_executor<
- handler_t, Executor>::type handler_ex_t;
- handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- execution::execute(
- asio::prefer(ex_,
- execution::blocking.possibly,
- execution::allocator(alloc)),
- detail::work_dispatcher<handler_t, handler_ex_t>(
- ASIO_MOVE_CAST(CompletionHandler)(handler), handler_ex));
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- !execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- !detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- ex_.dispatch(asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- !execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typedef typename associated_executor<
- handler_t, Executor>::type handler_ex_t;
- handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- ex_.dispatch(detail::work_dispatcher<handler_t, handler_ex_t>(
- ASIO_MOVE_CAST(CompletionHandler)(handler),
- handler_ex), alloc);
- }
-
-private:
- Executor ex_;
-};
-
-} // namespace detail
-
-template <ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
- ASIO_MOVE_ARG(CompletionToken) token)
-{
- return async_initiate<CompletionToken, void()>(
- detail::initiate_dispatch(), token);
-}
-
-template <typename Executor,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
- const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token,
- typename constraint<
- execution::is_executor<Executor>::value || is_executor<Executor>::value
- >::type)
-{
- return async_initiate<CompletionToken, void()>(
- detail::initiate_dispatch_with_executor<Executor>(ex), token);
-}
-
-template <typename ExecutionContext,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
- ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token,
- typename constraint<is_convertible<
- ExecutionContext&, execution_context&>::value>::type)
-{
- return async_initiate<CompletionToken, void()>(
- detail::initiate_dispatch_with_executor<
- typename ExecutionContext::executor_type>(
- ctx.get_executor()), token);
-}
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_IMPL_DISPATCH_HPP
diff --git a/3rdparty/asio/include/asio/impl/error.ipp b/3rdparty/asio/include/asio/impl/error.ipp
index 1dbb408f240..b564a8c68e2 100644
--- a/3rdparty/asio/include/asio/impl/error.ipp
+++ b/3rdparty/asio/include/asio/impl/error.ipp
@@ -2,7 +2,7 @@
// impl/error.ipp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -31,7 +31,7 @@ namespace detail {
class netdb_category : public asio::error_category
{
public:
- const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
+ const char* name() const noexcept
{
return "asio.netdb";
}
@@ -63,7 +63,7 @@ namespace detail {
class addrinfo_category : public asio::error_category
{
public:
- const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
+ const char* name() const noexcept
{
return "asio.addrinfo";
}
@@ -93,7 +93,7 @@ namespace detail {
class misc_category : public asio::error_category
{
public:
- const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
+ const char* name() const noexcept
{
return "asio.misc";
}
diff --git a/3rdparty/asio/include/asio/impl/error_code.ipp b/3rdparty/asio/include/asio/impl/error_code.ipp
index 8c2253051dd..caeb1967caa 100644
--- a/3rdparty/asio/include/asio/impl/error_code.ipp
+++ b/3rdparty/asio/include/asio/impl/error_code.ipp
@@ -2,7 +2,7 @@
// impl/error_code.ipp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -37,7 +37,7 @@ namespace detail {
class system_category : public error_category
{
public:
- const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
+ const char* name() const noexcept
{
return "asio.system";
}
@@ -108,7 +108,7 @@ public:
#if defined(ASIO_HAS_STD_ERROR_CODE)
std::error_condition default_error_condition(
- int ev) const ASIO_ERROR_CATEGORY_NOEXCEPT
+ int ev) const noexcept
{
switch (ev)
{
diff --git a/3rdparty/asio/include/asio/impl/execution_context.hpp b/3rdparty/asio/include/asio/impl/execution_context.hpp
index ddbb99deba3..35dda80417f 100644
--- a/3rdparty/asio/include/asio/impl/execution_context.hpp
+++ b/3rdparty/asio/include/asio/impl/execution_context.hpp
@@ -2,7 +2,7 @@
// impl/execution_context.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -34,49 +34,17 @@ inline Service& use_service(execution_context& e)
return e.service_registry_->template use_service<Service>();
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Service, typename... Args>
-Service& make_service(execution_context& e, ASIO_MOVE_ARG(Args)... args)
+Service& make_service(execution_context& e, Args&&... args)
{
detail::scoped_ptr<Service> svc(
- new Service(e, ASIO_MOVE_CAST(Args)(args)...));
+ new Service(e, static_cast<Args&&>(args)...));
e.service_registry_->template add_service<Service>(svc.get());
Service& result = *svc;
svc.release();
return result;
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename Service>
-Service& make_service(execution_context& e)
-{
- detail::scoped_ptr<Service> svc(new Service(e));
- e.service_registry_->template add_service<Service>(svc.get());
- Service& result = *svc;
- svc.release();
- return result;
-}
-
-#define ASIO_PRIVATE_MAKE_SERVICE_DEF(n) \
- template <typename Service, ASIO_VARIADIC_TPARAMS(n)> \
- Service& make_service(execution_context& e, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- detail::scoped_ptr<Service> svc( \
- new Service(e, ASIO_VARIADIC_MOVE_ARGS(n))); \
- e.service_registry_->template add_service<Service>(svc.get()); \
- Service& result = *svc; \
- svc.release(); \
- return result; \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_MAKE_SERVICE_DEF)
-#undef ASIO_PRIVATE_MAKE_SERVICE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Service>
inline void add_service(execution_context& e, Service* svc)
{
diff --git a/3rdparty/asio/include/asio/impl/execution_context.ipp b/3rdparty/asio/include/asio/impl/execution_context.ipp
index 21adf8ef6ff..ed2603c9011 100644
--- a/3rdparty/asio/include/asio/impl/execution_context.ipp
+++ b/3rdparty/asio/include/asio/impl/execution_context.ipp
@@ -2,7 +2,7 @@
// impl/execution_context.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/impl/executor.hpp b/3rdparty/asio/include/asio/impl/executor.hpp
index 3b473f32c1c..8bf76ccd183 100644
--- a/3rdparty/asio/include/asio/impl/executor.hpp
+++ b/3rdparty/asio/include/asio/impl/executor.hpp
@@ -2,7 +2,7 @@
// impl/executor.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,6 +19,7 @@
#if !defined(ASIO_NO_TS_EXECUTORS)
+#include <new>
#include "asio/detail/atomic_count.hpp"
#include "asio/detail/global.hpp"
#include "asio/detail/memory.hpp"
@@ -47,7 +48,12 @@ public:
return p;
}
- impl(const Executor& e, const Allocator& a) ASIO_NOEXCEPT
+ static impl_base* create(std::nothrow_t, const Executor& e) noexcept
+ {
+ return new (std::nothrow) impl(e, std::allocator<void>());
+ }
+
+ impl(const Executor& e, const Allocator& a) noexcept
: impl_base(false),
ref_count_(1),
executor_(e),
@@ -55,13 +61,13 @@ public:
{
}
- impl_base* clone() const ASIO_NOEXCEPT
+ impl_base* clone() const noexcept
{
detail::ref_count_up(ref_count_);
return const_cast<impl_base*>(static_cast<const impl_base*>(this));
}
- void destroy() ASIO_NOEXCEPT
+ void destroy() noexcept
{
if (detail::ref_count_down(ref_count_))
{
@@ -72,52 +78,52 @@ public:
}
}
- void on_work_started() ASIO_NOEXCEPT
+ void on_work_started() noexcept
{
executor_.on_work_started();
}
- void on_work_finished() ASIO_NOEXCEPT
+ void on_work_finished() noexcept
{
executor_.on_work_finished();
}
- execution_context& context() ASIO_NOEXCEPT
+ execution_context& context() noexcept
{
return executor_.context();
}
- void dispatch(ASIO_MOVE_ARG(function) f)
+ void dispatch(function&& f)
{
- executor_.dispatch(ASIO_MOVE_CAST(function)(f), allocator_);
+ executor_.dispatch(static_cast<function&&>(f), allocator_);
}
- void post(ASIO_MOVE_ARG(function) f)
+ void post(function&& f)
{
- executor_.post(ASIO_MOVE_CAST(function)(f), allocator_);
+ executor_.post(static_cast<function&&>(f), allocator_);
}
- void defer(ASIO_MOVE_ARG(function) f)
+ void defer(function&& f)
{
- executor_.defer(ASIO_MOVE_CAST(function)(f), allocator_);
+ executor_.defer(static_cast<function&&>(f), allocator_);
}
- type_id_result_type target_type() const ASIO_NOEXCEPT
+ type_id_result_type target_type() const noexcept
{
return type_id<Executor>();
}
- void* target() ASIO_NOEXCEPT
+ void* target() noexcept
{
return &executor_;
}
- const void* target() const ASIO_NOEXCEPT
+ const void* target() const noexcept
{
return &executor_;
}
- bool equals(const impl_base* e) const ASIO_NOEXCEPT
+ bool equals(const impl_base* e) const noexcept
{
if (this == e)
return true;
@@ -164,7 +170,12 @@ public:
static impl_base* create(const system_executor&,
const Allocator& = Allocator())
{
- return &detail::global<impl<system_executor, std::allocator<void> > >();
+ return &detail::global<impl<system_executor, std::allocator<void>> >();
+ }
+
+ static impl_base* create(std::nothrow_t, const system_executor&) noexcept
+ {
+ return &detail::global<impl<system_executor, std::allocator<void>> >();
}
impl()
@@ -172,64 +183,64 @@ public:
{
}
- impl_base* clone() const ASIO_NOEXCEPT
+ impl_base* clone() const noexcept
{
return const_cast<impl_base*>(static_cast<const impl_base*>(this));
}
- void destroy() ASIO_NOEXCEPT
+ void destroy() noexcept
{
}
- void on_work_started() ASIO_NOEXCEPT
+ void on_work_started() noexcept
{
executor_.on_work_started();
}
- void on_work_finished() ASIO_NOEXCEPT
+ void on_work_finished() noexcept
{
executor_.on_work_finished();
}
- execution_context& context() ASIO_NOEXCEPT
+ execution_context& context() noexcept
{
return executor_.context();
}
- void dispatch(ASIO_MOVE_ARG(function) f)
+ void dispatch(function&& f)
{
- executor_.dispatch(ASIO_MOVE_CAST(function)(f),
+ executor_.dispatch(static_cast<function&&>(f),
std::allocator<void>());
}
- void post(ASIO_MOVE_ARG(function) f)
+ void post(function&& f)
{
- executor_.post(ASIO_MOVE_CAST(function)(f),
+ executor_.post(static_cast<function&&>(f),
std::allocator<void>());
}
- void defer(ASIO_MOVE_ARG(function) f)
+ void defer(function&& f)
{
- executor_.defer(ASIO_MOVE_CAST(function)(f),
+ executor_.defer(static_cast<function&&>(f),
std::allocator<void>());
}
- type_id_result_type target_type() const ASIO_NOEXCEPT
+ type_id_result_type target_type() const noexcept
{
return type_id<system_executor>();
}
- void* target() ASIO_NOEXCEPT
+ void* target() noexcept
{
return &executor_;
}
- const void* target() const ASIO_NOEXCEPT
+ const void* target() const noexcept
{
return &executor_;
}
- bool equals(const impl_base* e) const ASIO_NOEXCEPT
+ bool equals(const impl_base* e) const noexcept
{
return this == e;
}
@@ -240,7 +251,13 @@ private:
template <typename Executor>
executor::executor(Executor e)
- : impl_(impl<Executor, std::allocator<void> >::create(e))
+ : impl_(impl<Executor, std::allocator<void>>::create(e))
+{
+}
+
+template <typename Executor>
+executor::executor(std::nothrow_t, Executor e) noexcept
+ : impl_(impl<Executor, std::allocator<void>>::create(std::nothrow, e))
{
}
@@ -251,39 +268,39 @@ executor::executor(allocator_arg_t, const Allocator& a, Executor e)
}
template <typename Function, typename Allocator>
-void executor::dispatch(ASIO_MOVE_ARG(Function) f,
+void executor::dispatch(Function&& f,
const Allocator& a) const
{
impl_base* i = get_impl();
if (i->fast_dispatch_)
- system_executor().dispatch(ASIO_MOVE_CAST(Function)(f), a);
+ system_executor().dispatch(static_cast<Function&&>(f), a);
else
- i->dispatch(function(ASIO_MOVE_CAST(Function)(f), a));
+ i->dispatch(function(static_cast<Function&&>(f), a));
}
template <typename Function, typename Allocator>
-void executor::post(ASIO_MOVE_ARG(Function) f,
+void executor::post(Function&& f,
const Allocator& a) const
{
- get_impl()->post(function(ASIO_MOVE_CAST(Function)(f), a));
+ get_impl()->post(function(static_cast<Function&&>(f), a));
}
template <typename Function, typename Allocator>
-void executor::defer(ASIO_MOVE_ARG(Function) f,
+void executor::defer(Function&& f,
const Allocator& a) const
{
- get_impl()->defer(function(ASIO_MOVE_CAST(Function)(f), a));
+ get_impl()->defer(function(static_cast<Function&&>(f), a));
}
template <typename Executor>
-Executor* executor::target() ASIO_NOEXCEPT
+Executor* executor::target() noexcept
{
return impl_ && impl_->target_type() == type_id<Executor>()
? static_cast<Executor*>(impl_->target()) : 0;
}
template <typename Executor>
-const Executor* executor::target() const ASIO_NOEXCEPT
+const Executor* executor::target() const noexcept
{
return impl_ && impl_->target_type() == type_id<Executor>()
? static_cast<Executor*>(impl_->target()) : 0;
diff --git a/3rdparty/asio/include/asio/impl/executor.ipp b/3rdparty/asio/include/asio/impl/executor.ipp
index 393f79249c5..4153a171e09 100644
--- a/3rdparty/asio/include/asio/impl/executor.ipp
+++ b/3rdparty/asio/include/asio/impl/executor.ipp
@@ -2,7 +2,7 @@
// impl/executor.ipp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -25,11 +25,11 @@
namespace asio {
-bad_executor::bad_executor() ASIO_NOEXCEPT
+bad_executor::bad_executor() noexcept
{
}
-const char* bad_executor::what() const ASIO_NOEXCEPT_OR_NOTHROW
+const char* bad_executor::what() const noexcept
{
return "bad executor";
}
diff --git a/3rdparty/asio/include/asio/impl/handler_alloc_hook.ipp b/3rdparty/asio/include/asio/impl/handler_alloc_hook.ipp
deleted file mode 100644
index 531002b318e..00000000000
--- a/3rdparty/asio/include/asio/impl/handler_alloc_hook.ipp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// impl/handler_alloc_hook.ipp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_IMPL_HANDLER_ALLOC_HOOK_IPP
-#define ASIO_IMPL_HANDLER_ALLOC_HOOK_IPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/memory.hpp"
-#include "asio/detail/thread_context.hpp"
-#include "asio/detail/thread_info_base.hpp"
-#include "asio/handler_alloc_hook.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-
-asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size, ...)
-{
-#if defined(ASIO_NO_DEPRECATED)
- (void)size;
- return asio_handler_allocate_is_no_longer_used();
-#elif !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
- return detail::thread_info_base::allocate(
- detail::thread_context::top_of_thread_call_stack(), size);
-#else // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
- return aligned_new(ASIO_DEFAULT_ALIGN, size);
-#endif // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
-}
-
-asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size, ...)
-{
-#if defined(ASIO_NO_DEPRECATED)
- (void)pointer;
- (void)size;
- return asio_handler_deallocate_is_no_longer_used();
-#elif !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
- detail::thread_info_base::deallocate(
- detail::thread_context::top_of_thread_call_stack(), pointer, size);
-#else // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
- (void)size;
- aligned_delete(pointer)
-#endif // !defined(ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
-}
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_IMPL_HANDLER_ALLOC_HOOK_IPP
diff --git a/3rdparty/asio/include/asio/impl/io_context.hpp b/3rdparty/asio/include/asio/impl/io_context.hpp
index 7e624844aa8..002b585502d 100644
--- a/3rdparty/asio/include/asio/impl/io_context.hpp
+++ b/3rdparty/asio/include/asio/impl/io_context.hpp
@@ -2,7 +2,7 @@
// impl/io_context.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -50,13 +50,11 @@ inline detail::io_context_impl& use_service<detail::io_context_impl>(
#endif // !defined(GENERATING_DOCUMENTATION)
inline io_context::executor_type
-io_context::get_executor() ASIO_NOEXCEPT
+io_context::get_executor() noexcept
{
return executor_type(*this);
}
-#if defined(ASIO_HAS_CHRONO)
-
template <typename Rep, typename Period>
std::size_t io_context::run_for(
const chrono::duration<Rep, Period>& rel_time)
@@ -108,8 +106,6 @@ std::size_t io_context::run_one_until(
return 0;
}
-#endif // defined(ASIO_HAS_CHRONO)
-
#if !defined(ASIO_NO_DEPRECATED)
inline void io_context::reset()
@@ -120,7 +116,7 @@ inline void io_context::reset()
struct io_context::initiate_dispatch
{
template <typename LegacyCompletionHandler>
- void operator()(ASIO_MOVE_ARG(LegacyCompletionHandler) handler,
+ void operator()(LegacyCompletionHandler&& handler,
io_context* self) const
{
// If you get an error on the following line it means that your handler does
@@ -132,14 +128,13 @@ struct io_context::initiate_dispatch
if (self->impl_.can_dispatch())
{
detail::fenced_block b(detail::fenced_block::full);
- asio_handler_invoke_helpers::invoke(
- handler2.value, handler2.value);
+ static_cast<decay_t<LegacyCompletionHandler>&&>(handler2.value)();
}
else
{
// Allocate and construct an operation to wrap the handler.
typedef detail::completion_handler<
- typename decay<LegacyCompletionHandler>::type, executor_type> op;
+ decay_t<LegacyCompletionHandler>, executor_type> op;
typename op::ptr p = { detail::addressof(handler2.value),
op::ptr::allocate(handler2.value), 0 };
p.p = new (p.v) op(handler2.value, self->get_executor());
@@ -154,8 +149,10 @@ struct io_context::initiate_dispatch
};
template <typename LegacyCompletionHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
-io_context::dispatch(ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
+auto io_context::dispatch(LegacyCompletionHandler&& handler)
+ -> decltype(
+ async_initiate<LegacyCompletionHandler, void ()>(
+ declval<initiate_dispatch>(), handler, this))
{
return async_initiate<LegacyCompletionHandler, void ()>(
initiate_dispatch(), handler, this);
@@ -164,7 +161,7 @@ io_context::dispatch(ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
struct io_context::initiate_post
{
template <typename LegacyCompletionHandler>
- void operator()(ASIO_MOVE_ARG(LegacyCompletionHandler) handler,
+ void operator()(LegacyCompletionHandler&& handler,
io_context* self) const
{
// If you get an error on the following line it means that your handler does
@@ -179,7 +176,7 @@ struct io_context::initiate_post
// Allocate and construct an operation to wrap the handler.
typedef detail::completion_handler<
- typename decay<LegacyCompletionHandler>::type, executor_type> op;
+ decay_t<LegacyCompletionHandler>, executor_type> op;
typename op::ptr p = { detail::addressof(handler2.value),
op::ptr::allocate(handler2.value), 0 };
p.p = new (p.v) op(handler2.value, self->get_executor());
@@ -193,8 +190,10 @@ struct io_context::initiate_post
};
template <typename LegacyCompletionHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
-io_context::post(ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
+auto io_context::post(LegacyCompletionHandler&& handler)
+ -> decltype(
+ async_initiate<LegacyCompletionHandler, void ()>(
+ declval<initiate_post>(), handler, this))
{
return async_initiate<LegacyCompletionHandler, void ()>(
initiate_post(), handler, this);
@@ -213,21 +212,20 @@ io_context::wrap(Handler handler)
#endif // !defined(ASIO_NO_DEPRECATED)
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
io_context::basic_executor_type<Allocator, Bits>&
io_context::basic_executor_type<Allocator, Bits>::operator=(
- const basic_executor_type& other) ASIO_NOEXCEPT
+ const basic_executor_type& other) noexcept
{
if (this != &other)
{
- io_context* old_io_context = io_context_;
- io_context_ = other.io_context_;
- allocator_ = other.allocator_;
- bits_ = other.bits_;
+ static_cast<Allocator&>(*this) = static_cast<const Allocator&>(other);
+ io_context* old_io_context = context_ptr();
+ target_ = other.target_;
if (Bits & outstanding_work_tracked)
{
- if (io_context_)
- io_context_->impl_.work_started();
+ if (context_ptr())
+ context_ptr()->impl_.work_started();
if (old_io_context)
old_io_context->impl_.work_finished();
}
@@ -235,122 +233,117 @@ io_context::basic_executor_type<Allocator, Bits>::operator=(
return *this;
}
-#if defined(ASIO_HAS_MOVE)
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
io_context::basic_executor_type<Allocator, Bits>&
io_context::basic_executor_type<Allocator, Bits>::operator=(
- basic_executor_type&& other) ASIO_NOEXCEPT
+ basic_executor_type&& other) noexcept
{
if (this != &other)
{
- io_context* old_io_context = io_context_;
- io_context_ = other.io_context_;
- allocator_ = std::move(other.allocator_);
- bits_ = other.bits_;
+ static_cast<Allocator&>(*this) = static_cast<Allocator&&>(other);
+ io_context* old_io_context = context_ptr();
+ target_ = other.target_;
if (Bits & outstanding_work_tracked)
{
- other.io_context_ = 0;
+ other.target_ = 0;
if (old_io_context)
old_io_context->impl_.work_finished();
}
}
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
inline bool io_context::basic_executor_type<Allocator,
- Bits>::running_in_this_thread() const ASIO_NOEXCEPT
+ Bits>::running_in_this_thread() const noexcept
{
- return io_context_->impl_.can_dispatch();
+ return context_ptr()->impl_.can_dispatch();
}
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
template <typename Function>
void io_context::basic_executor_type<Allocator, Bits>::execute(
- ASIO_MOVE_ARG(Function) f) const
+ Function&& f) const
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// Invoke immediately if the blocking.possibly property is enabled and we are
// already inside the thread pool.
- if ((bits_ & blocking_never) == 0 && io_context_->impl_.can_dispatch())
+ if ((bits() & blocking_never) == 0 && context_ptr()->impl_.can_dispatch())
{
// Make a local, non-const copy of the function.
- function_type tmp(ASIO_MOVE_CAST(Function)(f));
+ function_type tmp(static_cast<Function&&>(f));
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- && !defined(ASIO_NO_EXCEPTIONS)
+#if !defined(ASIO_NO_EXCEPTIONS)
try
{
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // && !defined(ASIO_NO_EXCEPTIONS)
+#endif // !defined(ASIO_NO_EXCEPTIONS)
detail::fenced_block b(detail::fenced_block::full);
- asio_handler_invoke_helpers::invoke(tmp, tmp);
+ static_cast<function_type&&>(tmp)();
return;
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- && !defined(ASIO_NO_EXCEPTIONS)
+#if !defined(ASIO_NO_EXCEPTIONS)
}
catch (...)
{
- io_context_->impl_.capture_current_exception();
+ context_ptr()->impl_.capture_current_exception();
return;
}
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // && !defined(ASIO_NO_EXCEPTIONS)
+#endif // !defined(ASIO_NO_EXCEPTIONS)
}
// Allocate and construct an operation to wrap the function.
typedef detail::executor_op<function_type, Allocator, detail::operation> op;
- typename op::ptr p = { detail::addressof(allocator_),
- op::ptr::allocate(allocator_), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), allocator_);
+ typename op::ptr p = {
+ detail::addressof(static_cast<const Allocator&>(*this)),
+ op::ptr::allocate(static_cast<const Allocator&>(*this)), 0 };
+ p.p = new (p.v) op(static_cast<Function&&>(f),
+ static_cast<const Allocator&>(*this));
- ASIO_HANDLER_CREATION((*io_context_, *p.p,
- "io_context", io_context_, 0, "execute"));
+ ASIO_HANDLER_CREATION((*context_ptr(), *p.p,
+ "io_context", context_ptr(), 0, "execute"));
- io_context_->impl_.post_immediate_completion(p.p,
- (bits_ & relationship_continuation) != 0);
+ context_ptr()->impl_.post_immediate_completion(p.p,
+ (bits() & relationship_continuation) != 0);
p.v = p.p = 0;
}
#if !defined(ASIO_NO_TS_EXECUTORS)
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
inline io_context& io_context::basic_executor_type<
- Allocator, Bits>::context() const ASIO_NOEXCEPT
+ Allocator, Bits>::context() const noexcept
{
- return *io_context_;
+ return *context_ptr();
}
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
inline void io_context::basic_executor_type<Allocator,
- Bits>::on_work_started() const ASIO_NOEXCEPT
+ Bits>::on_work_started() const noexcept
{
- io_context_->impl_.work_started();
+ context_ptr()->impl_.work_started();
}
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
inline void io_context::basic_executor_type<Allocator,
- Bits>::on_work_finished() const ASIO_NOEXCEPT
+ Bits>::on_work_finished() const noexcept
{
- io_context_->impl_.work_finished();
+ context_ptr()->impl_.work_finished();
}
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
template <typename Function, typename OtherAllocator>
void io_context::basic_executor_type<Allocator, Bits>::dispatch(
- ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const
+ Function&& f, const OtherAllocator& a) const
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// Invoke immediately if we are already inside the thread pool.
- if (io_context_->impl_.can_dispatch())
+ if (context_ptr()->impl_.can_dispatch())
{
// Make a local, non-const copy of the function.
- function_type tmp(ASIO_MOVE_CAST(Function)(f));
+ function_type tmp(static_cast<Function&&>(f));
detail::fenced_block b(detail::fenced_block::full);
- asio_handler_invoke_helpers::invoke(tmp, tmp);
+ static_cast<function_type&&>(tmp)();
return;
}
@@ -358,52 +351,48 @@ void io_context::basic_executor_type<Allocator, Bits>::dispatch(
typedef detail::executor_op<function_type,
OtherAllocator, detail::operation> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a);
+ p.p = new (p.v) op(static_cast<Function&&>(f), a);
- ASIO_HANDLER_CREATION((*io_context_, *p.p,
- "io_context", io_context_, 0, "dispatch"));
+ ASIO_HANDLER_CREATION((*context_ptr(), *p.p,
+ "io_context", context_ptr(), 0, "dispatch"));
- io_context_->impl_.post_immediate_completion(p.p, false);
+ context_ptr()->impl_.post_immediate_completion(p.p, false);
p.v = p.p = 0;
}
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
template <typename Function, typename OtherAllocator>
void io_context::basic_executor_type<Allocator, Bits>::post(
- ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const
+ Function&& f, const OtherAllocator& a) const
{
- typedef typename decay<Function>::type function_type;
-
// Allocate and construct an operation to wrap the function.
- typedef detail::executor_op<function_type,
+ typedef detail::executor_op<decay_t<Function>,
OtherAllocator, detail::operation> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a);
+ p.p = new (p.v) op(static_cast<Function&&>(f), a);
- ASIO_HANDLER_CREATION((*io_context_, *p.p,
- "io_context", io_context_, 0, "post"));
+ ASIO_HANDLER_CREATION((*context_ptr(), *p.p,
+ "io_context", context_ptr(), 0, "post"));
- io_context_->impl_.post_immediate_completion(p.p, false);
+ context_ptr()->impl_.post_immediate_completion(p.p, false);
p.v = p.p = 0;
}
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
template <typename Function, typename OtherAllocator>
void io_context::basic_executor_type<Allocator, Bits>::defer(
- ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const
+ Function&& f, const OtherAllocator& a) const
{
- typedef typename decay<Function>::type function_type;
-
// Allocate and construct an operation to wrap the function.
- typedef detail::executor_op<function_type,
+ typedef detail::executor_op<decay_t<Function>,
OtherAllocator, detail::operation> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a);
+ p.p = new (p.v) op(static_cast<Function&&>(f), a);
- ASIO_HANDLER_CREATION((*io_context_, *p.p,
- "io_context", io_context_, 0, "defer"));
+ ASIO_HANDLER_CREATION((*context_ptr(), *p.p,
+ "io_context", context_ptr(), 0, "defer"));
- io_context_->impl_.post_immediate_completion(p.p, true);
+ context_ptr()->impl_.post_immediate_completion(p.p, true);
p.v = p.p = 0;
}
#endif // !defined(ASIO_NO_TS_EXECUTORS)
diff --git a/3rdparty/asio/include/asio/impl/io_context.ipp b/3rdparty/asio/include/asio/impl/io_context.ipp
index 3eb2b4576e5..14c8736c7b2 100644
--- a/3rdparty/asio/include/asio/impl/io_context.ipp
+++ b/3rdparty/asio/include/asio/impl/io_context.ipp
@@ -2,7 +2,7 @@
// impl/io_context.ipp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -54,6 +54,7 @@ io_context::impl_type& io_context::add_impl(io_context::impl_type* impl)
io_context::~io_context()
{
+ shutdown();
}
io_context::count_type io_context::run()
diff --git a/3rdparty/asio/include/asio/impl/multiple_exceptions.ipp b/3rdparty/asio/include/asio/impl/multiple_exceptions.ipp
index fd2177f1f07..c922c27a055 100644
--- a/3rdparty/asio/include/asio/impl/multiple_exceptions.ipp
+++ b/3rdparty/asio/include/asio/impl/multiple_exceptions.ipp
@@ -2,7 +2,7 @@
// impl/multiple_exceptions.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,15 +22,13 @@
namespace asio {
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR)
-
multiple_exceptions::multiple_exceptions(
- std::exception_ptr first) ASIO_NOEXCEPT
- : first_(ASIO_MOVE_CAST(std::exception_ptr)(first))
+ std::exception_ptr first) noexcept
+ : first_(static_cast<std::exception_ptr&&>(first))
{
}
-const char* multiple_exceptions::what() const ASIO_NOEXCEPT_OR_NOTHROW
+const char* multiple_exceptions::what() const noexcept
{
return "multiple exceptions";
}
@@ -40,8 +38,6 @@ std::exception_ptr multiple_exceptions::first_exception() const
return first_;
}
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/impl/post.hpp b/3rdparty/asio/include/asio/impl/post.hpp
deleted file mode 100644
index ec96a6cb903..00000000000
--- a/3rdparty/asio/include/asio/impl/post.hpp
+++ /dev/null
@@ -1,256 +0,0 @@
-//
-// impl/post.hpp
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_IMPL_POST_HPP
-#define ASIO_IMPL_POST_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/associated_allocator.hpp"
-#include "asio/associated_executor.hpp"
-#include "asio/detail/work_dispatcher.hpp"
-#include "asio/execution/allocator.hpp"
-#include "asio/execution/blocking.hpp"
-#include "asio/execution/relationship.hpp"
-#include "asio/prefer.hpp"
-#include "asio/require.hpp"
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace detail {
-
-class initiate_post
-{
-public:
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- execution::is_executor<
- typename associated_executor<
- typename decay<CompletionHandler>::type
- >::type
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_executor<handler_t>::type ex(
- (get_associated_executor)(handler));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- execution::execute(
- asio::prefer(
- asio::require(ex, execution::blocking.never),
- execution::relationship.fork,
- execution::allocator(alloc)),
- asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)));
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- !execution::is_executor<
- typename associated_executor<
- typename decay<CompletionHandler>::type
- >::type
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_executor<handler_t>::type ex(
- (get_associated_executor)(handler));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- ex.post(asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
- }
-};
-
-template <typename Executor>
-class initiate_post_with_executor
-{
-public:
- typedef Executor executor_type;
-
- explicit initiate_post_with_executor(const Executor& ex)
- : ex_(ex)
- {
- }
-
- executor_type get_executor() const ASIO_NOEXCEPT
- {
- return ex_;
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- !detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- execution::execute(
- asio::prefer(
- asio::require(ex_, execution::blocking.never),
- execution::relationship.fork,
- execution::allocator(alloc)),
- asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)));
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typedef typename associated_executor<
- handler_t, Executor>::type handler_ex_t;
- handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- execution::execute(
- asio::prefer(
- asio::require(ex_, execution::blocking.never),
- execution::relationship.fork,
- execution::allocator(alloc)),
- detail::work_dispatcher<handler_t, handler_ex_t>(
- ASIO_MOVE_CAST(CompletionHandler)(handler), handler_ex));
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- !execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- !detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- ex_.post(asio::detail::bind_handler(
- ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
- }
-
- template <typename CompletionHandler>
- void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
- typename enable_if<
- !execution::is_executor<
- typename conditional<true, executor_type, CompletionHandler>::type
- >::value
- >::type* = 0,
- typename enable_if<
- detail::is_work_dispatcher_required<
- typename decay<CompletionHandler>::type,
- Executor
- >::value
- >::type* = 0) const
- {
- typedef typename decay<CompletionHandler>::type handler_t;
-
- typedef typename associated_executor<
- handler_t, Executor>::type handler_ex_t;
- handler_ex_t handler_ex((get_associated_executor)(handler, ex_));
-
- typename associated_allocator<handler_t>::type alloc(
- (get_associated_allocator)(handler));
-
- ex_.post(detail::work_dispatcher<handler_t, handler_ex_t>(
- ASIO_MOVE_CAST(CompletionHandler)(handler),
- handler_ex), alloc);
- }
-
-private:
- Executor ex_;
-};
-
-} // namespace detail
-
-template <ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
- ASIO_MOVE_ARG(CompletionToken) token)
-{
- return async_initiate<CompletionToken, void()>(
- detail::initiate_post(), token);
-}
-
-template <typename Executor,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
- const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token,
- typename constraint<
- execution::is_executor<Executor>::value || is_executor<Executor>::value
- >::type)
-{
- return async_initiate<CompletionToken, void()>(
- detail::initiate_post_with_executor<Executor>(ex), token);
-}
-
-template <typename ExecutionContext,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
- ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token,
- typename constraint<is_convertible<
- ExecutionContext&, execution_context&>::value>::type)
-{
- return async_initiate<CompletionToken, void()>(
- detail::initiate_post_with_executor<
- typename ExecutionContext::executor_type>(
- ctx.get_executor()), token);
-}
-
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_IMPL_POST_HPP
diff --git a/3rdparty/asio/include/asio/impl/prepend.hpp b/3rdparty/asio/include/asio/impl/prepend.hpp
new file mode 100644
index 00000000000..f336d55d825
--- /dev/null
+++ b/3rdparty/asio/include/asio/impl/prepend.hpp
@@ -0,0 +1,163 @@
+//
+// impl/prepend.hpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IMPL_PREPEND_HPP
+#define ASIO_IMPL_PREPEND_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/associator.hpp"
+#include "asio/async_result.hpp"
+#include "asio/detail/handler_cont_helpers.hpp"
+#include "asio/detail/type_traits.hpp"
+#include "asio/detail/utility.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+// Class to adapt a prepend_t as a completion handler.
+template <typename Handler, typename... Values>
+class prepend_handler
+{
+public:
+ typedef void result_type;
+
+ template <typename H>
+ prepend_handler(H&& handler, std::tuple<Values...> values)
+ : handler_(static_cast<H&&>(handler)),
+ values_(static_cast<std::tuple<Values...>&&>(values))
+ {
+ }
+
+ template <typename... Args>
+ void operator()(Args&&... args)
+ {
+ this->invoke(
+ index_sequence_for<Values...>{},
+ static_cast<Args&&>(args)...);
+ }
+
+ template <std::size_t... I, typename... Args>
+ void invoke(index_sequence<I...>, Args&&... args)
+ {
+ static_cast<Handler&&>(handler_)(
+ static_cast<Values&&>(std::get<I>(values_))...,
+ static_cast<Args&&>(args)...);
+ }
+
+//private:
+ Handler handler_;
+ std::tuple<Values...> values_;
+};
+
+template <typename Handler>
+inline bool asio_handler_is_continuation(
+ prepend_handler<Handler>* this_handler)
+{
+ return asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
+template <typename Signature, typename... Values>
+struct prepend_signature;
+
+template <typename R, typename... Args, typename... Values>
+struct prepend_signature<R(Args...), Values...>
+{
+ typedef R type(Values..., decay_t<Args>...);
+};
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename CompletionToken, typename... Values, typename Signature>
+struct async_result<
+ prepend_t<CompletionToken, Values...>, Signature>
+ : async_result<CompletionToken,
+ typename detail::prepend_signature<
+ Signature, Values...>::type>
+{
+ typedef typename detail::prepend_signature<
+ Signature, Values...>::type signature;
+
+ template <typename Initiation>
+ struct init_wrapper
+ {
+ init_wrapper(Initiation init)
+ : initiation_(static_cast<Initiation&&>(init))
+ {
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler,
+ std::tuple<Values...> values, Args&&... args)
+ {
+ static_cast<Initiation&&>(initiation_)(
+ detail::prepend_handler<decay_t<Handler>, Values...>(
+ static_cast<Handler&&>(handler),
+ static_cast<std::tuple<Values...>&&>(values)),
+ static_cast<Args&&>(args)...);
+ }
+
+ Initiation initiation_;
+ };
+
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<CompletionToken, signature>(
+ declval<init_wrapper<decay_t<Initiation>>>(),
+ token.token_,
+ static_cast<std::tuple<Values...>&&>(token.values_),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<CompletionToken, signature>(
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_,
+ static_cast<std::tuple<Values...>&&>(token.values_),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <template <typename, typename> class Associator,
+ typename Handler, typename... Values, typename DefaultCandidate>
+struct associator<Associator,
+ detail::prepend_handler<Handler, Values...>, DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const detail::prepend_handler<Handler, Values...>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::prepend_handler<Handler, Values...>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_IMPL_PREPEND_HPP
diff --git a/3rdparty/asio/include/asio/impl/read.hpp b/3rdparty/asio/include/asio/impl/read.hpp
index fb176d4343c..d86fb6467b1 100644
--- a/3rdparty/asio/include/asio/impl/read.hpp
+++ b/3rdparty/asio/include/asio/impl/read.hpp
@@ -2,7 +2,7 @@
// impl/read.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,16 +18,13 @@
#include <algorithm>
#include "asio/associator.hpp"
#include "asio/buffer.hpp"
-#include "asio/completion_condition.hpp"
#include "asio/detail/array_fwd.hpp"
#include "asio/detail/base_from_cancellation_state.hpp"
#include "asio/detail/base_from_completion_cond.hpp"
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/consuming_buffers.hpp"
#include "asio/detail/dependent_type.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_tracking.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/non_const_lvalue.hpp"
@@ -42,7 +39,7 @@ namespace detail
{
template <typename SyncReadStream, typename MutableBufferSequence,
typename MutableBufferIterator, typename CompletionCondition>
- std::size_t read_buffer_sequence(SyncReadStream& s,
+ std::size_t read_buffer_seq(SyncReadStream& s,
const MutableBufferSequence& buffers, const MutableBufferIterator&,
CompletionCondition completion_condition, asio::error_code& ec)
{
@@ -65,20 +62,20 @@ template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type)
+ >)
{
- return detail::read_buffer_sequence(s, buffers,
+ return detail::read_buffer_seq(s, buffers,
asio::buffer_sequence_begin(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
}
template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
- typename constraint<
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec);
@@ -89,9 +86,9 @@ inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type)
+ >)
{
return read(s, buffers, transfer_all(), ec);
}
@@ -100,13 +97,13 @@ template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
- typename constraint<
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read(s, buffers,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "read");
return bytes_transferred;
}
@@ -116,17 +113,17 @@ inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
template <typename SyncReadStream, typename DynamicBuffer_v1,
typename CompletionCondition>
std::size_t read(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
- typename decay<DynamicBuffer_v1>::type b(
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
+ decay_t<DynamicBuffer_v1> b(
+ static_cast<DynamicBuffer_v1&&>(buffers));
ec = asio::error_code();
std::size_t total_transferred = 0;
@@ -151,52 +148,52 @@ std::size_t read(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ DynamicBuffer_v1&& buffers,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), transfer_all(), ec);
+ static_cast<DynamicBuffer_v1&&>(buffers), transfer_all(), ec);
asio::detail::throw_error(ec, "read");
return bytes_transferred;
}
template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
- return read(s, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ return read(s, static_cast<DynamicBuffer_v1&&>(buffers),
transfer_all(), ec);
}
template <typename SyncReadStream, typename DynamicBuffer_v1,
typename CompletionCondition>
inline std::size_t read(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "read");
return bytes_transferred;
}
@@ -211,7 +208,7 @@ inline std::size_t read(SyncReadStream& s,
CompletionCondition completion_condition, asio::error_code& ec)
{
return read(s, basic_streambuf_ref<Allocator>(b),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
}
template <typename SyncReadStream, typename Allocator>
@@ -236,7 +233,7 @@ inline std::size_t read(SyncReadStream& s,
CompletionCondition completion_condition)
{
return read(s, basic_streambuf_ref<Allocator>(b),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ static_cast<CompletionCondition&&>(completion_condition));
}
#endif // !defined(ASIO_NO_IOSTREAM)
@@ -247,9 +244,9 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
DynamicBuffer_v2& b = buffers;
@@ -279,13 +276,13 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), transfer_all(), ec);
+ static_cast<DynamicBuffer_v2&&>(buffers), transfer_all(), ec);
asio::detail::throw_error(ec, "read");
return bytes_transferred;
}
@@ -293,11 +290,11 @@ inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
- return read(s, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
+ return read(s, static_cast<DynamicBuffer_v2&&>(buffers),
transfer_all(), ec);
}
@@ -305,14 +302,14 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "read");
return bytes_transferred;
}
@@ -335,11 +332,10 @@ namespace detail
stream_(stream),
buffers_(buffers),
start_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_op(const read_op& other)
: base_from_cancellation_state<ReadHandler>(other),
base_from_completion_cond<CompletionCondition>(other),
@@ -352,18 +348,15 @@ namespace detail
read_op(read_op&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
base_from_completion_cond<CompletionCondition>(
- ASIO_MOVE_CAST(base_from_completion_cond<
- CompletionCondition>)(other)),
+ static_cast<base_from_completion_cond<CompletionCondition>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(buffers_type)(other.buffers_)),
+ buffers_(static_cast<buffers_type&&>(other.buffers_)),
start_(other.start_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -378,7 +371,7 @@ namespace detail
{
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_read"));
stream_.async_read_some(buffers_.prepare(max_size),
- ASIO_MOVE_CAST(read_op)(*this));
+ static_cast<read_op&&>(*this));
}
return; default:
buffers_.consume(bytes_transferred);
@@ -394,7 +387,7 @@ namespace detail
}
}
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(
+ static_cast<ReadHandler&&>(handler_)(
static_cast<const asio::error_code&>(ec),
static_cast<const std::size_t&>(buffers_.total_consumed()));
}
@@ -413,38 +406,6 @@ namespace detail
template <typename AsyncReadStream, typename MutableBufferSequence,
typename MutableBufferIterator, typename CompletionCondition,
typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
- CompletionCondition, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename MutableBufferSequence,
- typename MutableBufferIterator, typename CompletionCondition,
- typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename MutableBufferSequence,
- typename MutableBufferIterator, typename CompletionCondition,
- typename ReadHandler>
inline bool asio_handler_is_continuation(
read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
CompletionCondition, ReadHandler>* this_handler)
@@ -454,70 +415,40 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename MutableBufferSequence, typename MutableBufferIterator,
- typename CompletionCondition, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename MutableBufferSequence, typename MutableBufferIterator,
- typename CompletionCondition, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream, typename MutableBufferSequence,
typename MutableBufferIterator, typename CompletionCondition,
typename ReadHandler>
- inline void start_read_buffer_sequence_op(AsyncReadStream& stream,
+ inline void start_read_op(AsyncReadStream& stream,
const MutableBufferSequence& buffers, const MutableBufferIterator&,
CompletionCondition& completion_condition, ReadHandler& handler)
{
- detail::read_op<AsyncReadStream, MutableBufferSequence,
+ read_op<AsyncReadStream, MutableBufferSequence,
MutableBufferIterator, CompletionCondition, ReadHandler>(
stream, buffers, completion_condition, handler)(
asio::error_code(), 0, 1);
}
template <typename AsyncReadStream>
- class initiate_async_read_buffer_sequence
+ class initiate_async_read
{
public:
typedef typename AsyncReadStream::executor_type executor_type;
- explicit initiate_async_read_buffer_sequence(AsyncReadStream& stream)
+ explicit initiate_async_read(AsyncReadStream& stream)
: stream_(stream)
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence,
typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
+ CompletionCondition&& completion_cond) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ReadHandler.
@@ -525,7 +456,7 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
- start_read_buffer_sequence_op(stream_, buffers,
+ start_read_op(stream_, buffers,
asio::buffer_sequence_begin(buffers),
completion_cond2.value, handler2.value);
}
@@ -549,8 +480,16 @@ struct associator<Associator,
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::read_op<AsyncReadStream, MutableBufferSequence,
+ MutableBufferIterator, CompletionCondition, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_op<AsyncReadStream, MutableBufferSequence,
MutableBufferIterator, CompletionCondition, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -561,37 +500,42 @@ struct associator<Associator,
template <typename AsyncReadStream,
typename MutableBufferSequence, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
+ std::size_t)) ReadToken>
+inline auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
+ CompletionCondition completion_condition, ReadToken&& token,
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type)
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read<AsyncReadStream>>(), token, buffers,
+ static_cast<CompletionCondition&&>(completion_condition)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_read_buffer_sequence<AsyncReadStream>(s), handler,
- buffers, ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ detail::initiate_async_read<AsyncReadStream>(s), token, buffers,
+ static_cast<CompletionCondition&&>(completion_condition));
}
template <typename AsyncReadStream, typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
+ std::size_t)) ReadToken>
+inline auto async_read(AsyncReadStream& s,
+ const MutableBufferSequence& buffers, ReadToken&& token,
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type)
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read<AsyncReadStream>>(),
+ token, buffers, transfer_all()))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_read_buffer_sequence<AsyncReadStream>(s),
- handler, buffers, transfer_all());
+ detail::initiate_async_read<AsyncReadStream>(s),
+ token, buffers, transfer_all());
}
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -607,20 +551,19 @@ namespace detail
public:
template <typename BufferSequence>
read_dynbuf_v1_op(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
CompletionCondition& completion_condition, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
base_from_completion_cond<CompletionCondition>(completion_condition),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
start_(0),
total_transferred_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_dynbuf_v1_op(const read_dynbuf_v1_op& other)
: base_from_cancellation_state<ReadHandler>(other),
base_from_completion_cond<CompletionCondition>(other),
@@ -634,19 +577,16 @@ namespace detail
read_dynbuf_v1_op(read_dynbuf_v1_op&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
base_from_completion_cond<CompletionCondition>(
- ASIO_MOVE_CAST(base_from_completion_cond<
- CompletionCondition>)(other)),
+ static_cast<base_from_completion_cond<CompletionCondition>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v1)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v1&&>(other.buffers_)),
start_(other.start_),
total_transferred_(other.total_transferred_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -666,7 +606,7 @@ namespace detail
{
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_read"));
stream_.async_read_some(buffers_.prepare(bytes_available),
- ASIO_MOVE_CAST(read_dynbuf_v1_op)(*this));
+ static_cast<read_dynbuf_v1_op&&>(*this));
}
return; default:
total_transferred_ += bytes_transferred;
@@ -686,7 +626,7 @@ namespace detail
}
}
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(
+ static_cast<ReadHandler&&>(handler_)(
static_cast<const asio::error_code&>(ec),
static_cast<const std::size_t&>(total_transferred_));
}
@@ -702,36 +642,6 @@ namespace detail
template <typename AsyncReadStream, typename DynamicBuffer_v1,
typename CompletionCondition, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
- CompletionCondition, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v1,
- typename CompletionCondition, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v1,
- typename CompletionCondition, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
CompletionCondition, ReadHandler>* this_handler)
@@ -741,36 +651,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename CompletionCondition,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename CompletionCondition,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_dynbuf_v1
{
@@ -782,16 +662,16 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler, typename DynamicBuffer_v1,
typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v1&& buffers,
+ CompletionCondition&& completion_cond) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ReadHandler.
@@ -799,9 +679,9 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
- read_dynbuf_v1_op<AsyncReadStream, typename decay<DynamicBuffer_v1>::type,
- CompletionCondition, typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ read_dynbuf_v1_op<AsyncReadStream, decay_t<DynamicBuffer_v1>,
+ CompletionCondition, decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v1&&>(buffers),
completion_cond2.value, handler2.value)(
asio::error_code(), 0, 1);
}
@@ -824,9 +704,17 @@ struct associator<Associator,
: Associator<ReadHandler, DefaultCandidate>
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
+ const detail::read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
+ CompletionCondition, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
const detail::read_dynbuf_v1_op<AsyncReadStream,
DynamicBuffer_v1, CompletionCondition, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -836,46 +724,51 @@ struct associator<Associator,
template <typename AsyncReadStream, typename DynamicBuffer_v1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ std::size_t)) ReadToken>
+inline auto async_read(AsyncReadStream& s,
+ DynamicBuffer_v1&& buffers, ReadToken&& token,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), transfer_all()))
{
- return async_read(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
- transfer_all(), ASIO_MOVE_CAST(ReadHandler)(handler));
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), transfer_all());
}
template <typename AsyncReadStream,
typename DynamicBuffer_v1, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ std::size_t)) ReadToken>
+inline auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
+ CompletionCondition completion_condition, ReadToken&& token,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition));
}
#if !defined(ASIO_NO_EXTENSIONS)
@@ -883,29 +776,39 @@ async_read(AsyncReadStream& s,
template <typename AsyncReadStream, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
- ASIO_MOVE_ARG(ReadHandler) handler)
+ std::size_t)) ReadToken>
+inline auto async_read(AsyncReadStream& s,
+ basic_streambuf<Allocator>& b, ReadToken&& token)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), transfer_all()))
{
- return async_read(s, basic_streambuf_ref<Allocator>(b),
- ASIO_MOVE_CAST(ReadHandler)(handler));
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), transfer_all());
}
template <typename AsyncReadStream,
typename Allocator, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler)
+ std::size_t)) ReadToken>
+inline auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
+ CompletionCondition completion_condition, ReadToken&& token)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<CompletionCondition&&>(completion_condition)))
{
- return async_read(s, basic_streambuf_ref<Allocator>(b),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition),
- ASIO_MOVE_CAST(ReadHandler)(handler));
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<CompletionCondition&&>(completion_condition));
}
#endif // !defined(ASIO_NO_IOSTREAM)
@@ -923,21 +826,20 @@ namespace detail
public:
template <typename BufferSequence>
read_dynbuf_v2_op(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
CompletionCondition& completion_condition, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
base_from_completion_cond<CompletionCondition>(completion_condition),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
start_(0),
total_transferred_(0),
bytes_available_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_dynbuf_v2_op(const read_dynbuf_v2_op& other)
: base_from_cancellation_state<ReadHandler>(other),
base_from_completion_cond<CompletionCondition>(other),
@@ -952,20 +854,17 @@ namespace detail
read_dynbuf_v2_op(read_dynbuf_v2_op&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
base_from_completion_cond<CompletionCondition>(
- ASIO_MOVE_CAST(base_from_completion_cond<
- CompletionCondition>)(other)),
+ static_cast<base_from_completion_cond<CompletionCondition>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v2)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v2&&>(other.buffers_)),
start_(other.start_),
total_transferred_(other.total_transferred_),
bytes_available_(other.bytes_available_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -987,7 +886,7 @@ namespace detail
{
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_read"));
stream_.async_read_some(buffers_.data(pos, bytes_available_),
- ASIO_MOVE_CAST(read_dynbuf_v2_op)(*this));
+ static_cast<read_dynbuf_v2_op&&>(*this));
}
return; default:
total_transferred_ += bytes_transferred;
@@ -1007,7 +906,7 @@ namespace detail
}
}
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(
+ static_cast<ReadHandler&&>(handler_)(
static_cast<const asio::error_code&>(ec),
static_cast<const std::size_t&>(total_transferred_));
}
@@ -1024,36 +923,6 @@ namespace detail
template <typename AsyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
- CompletionCondition, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v2,
- typename CompletionCondition, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v2,
- typename CompletionCondition, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
CompletionCondition, ReadHandler>* this_handler)
@@ -1063,36 +932,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename CompletionCondition,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename CompletionCondition,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_dynbuf_v2
{
@@ -1104,16 +943,16 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler, typename DynamicBuffer_v2,
typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
- ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v2&& buffers,
+ CompletionCondition&& completion_cond) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ReadHandler.
@@ -1121,9 +960,9 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
- read_dynbuf_v2_op<AsyncReadStream, typename decay<DynamicBuffer_v2>::type,
- CompletionCondition, typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
+ read_dynbuf_v2_op<AsyncReadStream, decay_t<DynamicBuffer_v2>,
+ CompletionCondition, decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v2&&>(buffers),
completion_cond2.value, handler2.value)(
asio::error_code(), 0, 1);
}
@@ -1146,9 +985,17 @@ struct associator<Associator,
: Associator<ReadHandler, DefaultCandidate>
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
+ const detail::read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
+ CompletionCondition, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
const detail::read_dynbuf_v2_op<AsyncReadStream,
DynamicBuffer_v2, CompletionCondition, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -1158,38 +1005,45 @@ struct associator<Associator,
template <typename AsyncReadStream, typename DynamicBuffer_v2,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
+ std::size_t)) ReadToken>
+inline auto async_read(AsyncReadStream& s,
+ DynamicBuffer_v2 buffers, ReadToken&& token,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), transfer_all()))
{
- return async_read(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
- transfer_all(), ASIO_MOVE_CAST(ReadHandler)(handler));
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v2<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), transfer_all());
}
template <typename AsyncReadStream,
typename DynamicBuffer_v2, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
+ std::size_t)) ReadToken>
+inline auto async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+ CompletionCondition completion_condition, ReadToken&& token,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_dynbuf_v2<AsyncReadStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition));
}
} // namespace asio
diff --git a/3rdparty/asio/include/asio/impl/read_at.hpp b/3rdparty/asio/include/asio/impl/read_at.hpp
index 7d37c4ddfa4..7c668a03f46 100644
--- a/3rdparty/asio/include/asio/impl/read_at.hpp
+++ b/3rdparty/asio/include/asio/impl/read_at.hpp
@@ -2,7 +2,7 @@
// impl/read_at.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,16 +18,13 @@
#include <algorithm>
#include "asio/associator.hpp"
#include "asio/buffer.hpp"
-#include "asio/completion_condition.hpp"
#include "asio/detail/array_fwd.hpp"
#include "asio/detail/base_from_cancellation_state.hpp"
#include "asio/detail/base_from_completion_cond.hpp"
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/consuming_buffers.hpp"
#include "asio/detail/dependent_type.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_tracking.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/non_const_lvalue.hpp"
@@ -73,7 +70,7 @@ std::size_t read_at(SyncRandomAccessReadDevice& d,
{
return detail::read_at_buffer_sequence(d, offset, buffers,
asio::buffer_sequence_begin(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
}
template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
@@ -103,7 +100,7 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d,
{
asio::error_code ec;
std::size_t bytes_transferred = read_at(d, offset, buffers,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}
@@ -162,7 +159,7 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d,
{
asio::error_code ec;
std::size_t bytes_transferred = read_at(d, offset, b,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}
@@ -190,11 +187,10 @@ namespace detail
offset_(offset),
buffers_(buffers),
start_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_at_op(const read_at_op& other)
: base_from_cancellation_state<ReadHandler>(other),
base_from_completion_cond<CompletionCondition>(other),
@@ -208,19 +204,16 @@ namespace detail
read_at_op(read_at_op&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
base_from_completion_cond<CompletionCondition>(
- ASIO_MOVE_CAST(base_from_completion_cond<
- CompletionCondition>)(other)),
+ static_cast<base_from_completion_cond<CompletionCondition>&&>(other)),
device_(other.device_),
offset_(other.offset_),
- buffers_(ASIO_MOVE_CAST(buffers_type)(other.buffers_)),
+ buffers_(static_cast<buffers_type&&>(other.buffers_)),
start_(other.start_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -236,7 +229,7 @@ namespace detail
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_read_at"));
device_.async_read_some_at(
offset_ + buffers_.total_consumed(), buffers_.prepare(max_size),
- ASIO_MOVE_CAST(read_at_op)(*this));
+ static_cast<read_at_op&&>(*this));
}
return; default:
buffers_.consume(bytes_transferred);
@@ -252,7 +245,7 @@ namespace detail
}
}
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(
+ static_cast<ReadHandler&&>(handler_)(
static_cast<const asio::error_code&>(ec),
static_cast<const std::size_t&>(buffers_.total_consumed()));
}
@@ -272,38 +265,6 @@ namespace detail
template <typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename MutableBufferIterator,
typename CompletionCondition, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
- MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncRandomAccessReadDevice,
- typename MutableBufferSequence, typename MutableBufferIterator,
- typename CompletionCondition, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
- MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncRandomAccessReadDevice,
- typename MutableBufferSequence, typename MutableBufferIterator,
- typename CompletionCondition, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
@@ -313,40 +274,10 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncRandomAccessReadDevice,
- typename MutableBufferSequence, typename MutableBufferIterator,
- typename CompletionCondition, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
- MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncRandomAccessReadDevice,
- typename MutableBufferSequence, typename MutableBufferIterator,
- typename CompletionCondition, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
- MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename MutableBufferIterator,
typename CompletionCondition, typename ReadHandler>
- inline void start_read_at_buffer_sequence_op(AsyncRandomAccessReadDevice& d,
+ inline void start_read_at_op(AsyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
const MutableBufferIterator&, CompletionCondition& completion_condition,
ReadHandler& handler)
@@ -358,27 +289,26 @@ namespace detail
}
template <typename AsyncRandomAccessReadDevice>
- class initiate_async_read_at_buffer_sequence
+ class initiate_async_read_at
{
public:
typedef typename AsyncRandomAccessReadDevice::executor_type executor_type;
- explicit initiate_async_read_at_buffer_sequence(
- AsyncRandomAccessReadDevice& device)
+ explicit initiate_async_read_at(AsyncRandomAccessReadDevice& device)
: device_(device)
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return device_.get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence,
typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
uint64_t offset, const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
+ CompletionCondition&& completion_cond) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ReadHandler.
@@ -386,7 +316,7 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
- start_read_at_buffer_sequence_op(device_, offset, buffers,
+ start_read_at_op(device_, offset, buffers,
asio::buffer_sequence_begin(buffers),
completion_cond2.value, handler2.value);
}
@@ -411,8 +341,17 @@ struct associator<Associator,
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::read_at_op<AsyncRandomAccessReadDevice,
MutableBufferSequence, MutableBufferIterator,
+ CompletionCondition, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_at_op<AsyncRandomAccessReadDevice,
+ MutableBufferSequence, MutableBufferIterator,
CompletionCondition, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -423,36 +362,39 @@ struct associator<Associator,
template <typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d,
+ std::size_t)) ReadToken>
+inline auto async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler)
+ CompletionCondition completion_condition, ReadToken&& token)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_at<AsyncRandomAccessReadDevice>>(),
+ token, offset, buffers,
+ static_cast<CompletionCondition&&>(completion_condition)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_read_at_buffer_sequence<
- AsyncRandomAccessReadDevice>(d),
- handler, offset, buffers,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ detail::initiate_async_read_at<AsyncRandomAccessReadDevice>(d),
+ token, offset, buffers,
+ static_cast<CompletionCondition&&>(completion_condition));
}
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d,
- uint64_t offset, const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler)
+ std::size_t)) ReadToken>
+inline auto async_read_at(AsyncRandomAccessReadDevice& d,
+ uint64_t offset, const MutableBufferSequence& buffers, ReadToken&& token)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_at<AsyncRandomAccessReadDevice>>(),
+ token, offset, buffers, transfer_all()))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_read_at_buffer_sequence<
- AsyncRandomAccessReadDevice>(d),
- handler, offset, buffers, transfer_all());
+ detail::initiate_async_read_at<AsyncRandomAccessReadDevice>(d),
+ token, offset, buffers, transfer_all());
}
#if !defined(ASIO_NO_EXTENSIONS)
@@ -478,11 +420,10 @@ namespace detail
streambuf_(streambuf),
start_(0),
total_transferred_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_at_streambuf_op(const read_at_streambuf_op& other)
: base_from_cancellation_state<ReadHandler>(other),
base_from_completion_cond<CompletionCondition>(other),
@@ -497,20 +438,17 @@ namespace detail
read_at_streambuf_op(read_at_streambuf_op&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
base_from_completion_cond<CompletionCondition>(
- ASIO_MOVE_CAST(base_from_completion_cond<
- CompletionCondition>)(other)),
+ static_cast<base_from_completion_cond<CompletionCondition>&&>(other)),
device_(other.device_),
offset_(other.offset_),
streambuf_(other.streambuf_),
start_(other.start_),
total_transferred_(other.total_transferred_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -527,7 +465,7 @@ namespace detail
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_read_at"));
device_.async_read_some_at(offset_ + total_transferred_,
streambuf_.prepare(bytes_available),
- ASIO_MOVE_CAST(read_at_streambuf_op)(*this));
+ static_cast<read_at_streambuf_op&&>(*this));
}
return; default:
total_transferred_ += bytes_transferred;
@@ -543,7 +481,7 @@ namespace detail
}
}
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(
+ static_cast<ReadHandler&&>(handler_)(
static_cast<const asio::error_code&>(ec),
static_cast<const std::size_t&>(total_transferred_));
}
@@ -560,36 +498,6 @@ namespace detail
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
- CompletionCondition, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncRandomAccessReadDevice, typename Allocator,
- typename CompletionCondition, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncRandomAccessReadDevice, typename Allocator,
- typename CompletionCondition, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
CompletionCondition, ReadHandler>* this_handler)
@@ -599,34 +507,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncRandomAccessReadDevice,
- typename Allocator, typename CompletionCondition, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncRandomAccessReadDevice,
- typename Allocator, typename CompletionCondition, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
- CompletionCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncRandomAccessReadDevice>
class initiate_async_read_at_streambuf
{
@@ -639,16 +519,16 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return device_.get_executor();
}
template <typename ReadHandler,
typename Allocator, typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
uint64_t offset, basic_streambuf<Allocator>* b,
- ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
+ CompletionCondition&& completion_cond) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ReadHandler.
@@ -657,7 +537,7 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
- CompletionCondition, typename decay<ReadHandler>::type>(
+ CompletionCondition, decay_t<ReadHandler>>(
device_, offset, *b, completion_cond2.value, handler2.value)(
asio::error_code(), 0, 1);
}
@@ -681,8 +561,16 @@ struct associator<Associator,
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
+ Executor, CompletionCondition, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
Executor, CompletionCondition, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -693,34 +581,41 @@ struct associator<Associator,
template <typename AsyncRandomAccessReadDevice,
typename Allocator, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d,
+ std::size_t)) ReadToken>
+inline auto async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler)
+ CompletionCondition completion_condition, ReadToken&& token)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_at_streambuf<
+ AsyncRandomAccessReadDevice>>(),
+ token, offset, &b,
+ static_cast<CompletionCondition&&>(completion_condition)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
- handler, offset, &b,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ token, offset, &b,
+ static_cast<CompletionCondition&&>(completion_condition));
}
template <typename AsyncRandomAccessReadDevice, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d,
- uint64_t offset, asio::basic_streambuf<Allocator>& b,
- ASIO_MOVE_ARG(ReadHandler) handler)
+ std::size_t)) ReadToken>
+inline auto async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
+ asio::basic_streambuf<Allocator>& b, ReadToken&& token)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_at_streambuf<
+ AsyncRandomAccessReadDevice>>(),
+ token, offset, &b, transfer_all()))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
- handler, offset, &b, transfer_all());
+ token, offset, &b, transfer_all());
}
#endif // !defined(ASIO_NO_IOSTREAM)
diff --git a/3rdparty/asio/include/asio/impl/read_until.hpp b/3rdparty/asio/include/asio/impl/read_until.hpp
index d3a6f259933..7592263723f 100644
--- a/3rdparty/asio/include/asio/impl/read_until.hpp
+++ b/3rdparty/asio/include/asio/impl/read_until.hpp
@@ -2,7 +2,7 @@
// impl/read_until.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -24,9 +24,7 @@
#include "asio/buffers_iterator.hpp"
#include "asio/detail/base_from_cancellation_state.hpp"
#include "asio/detail/bind_handler.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_tracking.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/limits.hpp"
@@ -76,34 +74,34 @@ namespace detail
template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, char delim,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ DynamicBuffer_v1&& buffers, char delim,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), delim, ec);
+ static_cast<DynamicBuffer_v1&&>(buffers), delim, ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
char delim, asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
- typename decay<DynamicBuffer_v1>::type b(
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
+ decay_t<DynamicBuffer_v1> b(
+ static_cast<DynamicBuffer_v1&&>(buffers));
std::size_t search_position = 0;
for (;;)
@@ -149,35 +147,35 @@ std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
ASIO_STRING_VIEW_PARAM delim,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), delim, ec);
+ static_cast<DynamicBuffer_v1&&>(buffers), delim, ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
- typename decay<DynamicBuffer_v1>::type b(
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
+ decay_t<DynamicBuffer_v1> b(
+ static_cast<DynamicBuffer_v1&&>(buffers));
std::size_t search_position = 0;
for (;;)
@@ -233,37 +231,48 @@ std::size_t read_until(SyncReadStream& s,
#if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX)
-template <typename SyncReadStream, typename DynamicBuffer_v1>
-inline std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- const boost::regex& expr,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+namespace detail {
+
+struct regex_match_flags
+{
+ template <typename T>
+ operator T() const
+ {
+ return T::match_default | T::match_partial;
+ }
+};
+
+} // namespace detail
+
+template <typename SyncReadStream, typename DynamicBuffer_v1, typename Traits>
+inline std::size_t read_until(SyncReadStream& s, DynamicBuffer_v1&& buffers,
+ const boost::basic_regex<char, Traits>& expr,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), expr, ec);
+ static_cast<DynamicBuffer_v1&&>(buffers), expr, ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}
-template <typename SyncReadStream, typename DynamicBuffer_v1>
-std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- const boost::regex& expr, asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+template <typename SyncReadStream, typename DynamicBuffer_v1, typename Traits>
+std::size_t read_until(SyncReadStream& s, DynamicBuffer_v1&& buffers,
+ const boost::basic_regex<char, Traits>& expr, asio::error_code& ec,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
- typename decay<DynamicBuffer_v1>::type b(
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
+ decay_t<DynamicBuffer_v1> b(
+ static_cast<DynamicBuffer_v1&&>(buffers));
std::size_t search_position = 0;
for (;;)
@@ -278,10 +287,10 @@ std::size_t read_until(SyncReadStream& s,
// Look for a match.
boost::match_results<iterator,
- typename std::vector<boost::sub_match<iterator> >::allocator_type>
+ typename std::vector<boost::sub_match<iterator>>::allocator_type>
match_results;
- if (regex_search(start_pos, end, match_results, expr,
- boost::match_default | boost::match_partial))
+ if (regex_search(start_pos, end, match_results,
+ expr, detail::regex_match_flags()))
{
if (match_results[0].matched)
{
@@ -323,21 +332,21 @@ std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream,
typename DynamicBuffer_v1, typename MatchCondition>
inline std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
MatchCondition match_condition,
- typename constraint<
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ >,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ static_cast<DynamicBuffer_v1&&>(buffers),
match_condition, ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
@@ -346,20 +355,20 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream,
typename DynamicBuffer_v1, typename MatchCondition>
std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
MatchCondition match_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ >,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
- typename decay<DynamicBuffer_v1>::type b(
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
+ decay_t<DynamicBuffer_v1> b(
+ static_cast<DynamicBuffer_v1&&>(buffers));
std::size_t search_position = 0;
for (;;)
@@ -443,16 +452,18 @@ inline std::size_t read_until(SyncReadStream& s,
#if defined(ASIO_HAS_BOOST_REGEX)
-template <typename SyncReadStream, typename Allocator>
+template <typename SyncReadStream, typename Allocator, typename Traits>
inline std::size_t read_until(SyncReadStream& s,
- asio::basic_streambuf<Allocator>& b, const boost::regex& expr)
+ asio::basic_streambuf<Allocator>& b,
+ const boost::basic_regex<char, Traits>& expr)
{
return read_until(s, basic_streambuf_ref<Allocator>(b), expr);
}
-template <typename SyncReadStream, typename Allocator>
+template <typename SyncReadStream, typename Allocator, typename Traits>
inline std::size_t read_until(SyncReadStream& s,
- asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
+ asio::basic_streambuf<Allocator>& b,
+ const boost::basic_regex<char, Traits>& expr,
asio::error_code& ec)
{
return read_until(s, basic_streambuf_ref<Allocator>(b), expr, ec);
@@ -463,7 +474,7 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename Allocator, typename MatchCondition>
inline std::size_t read_until(SyncReadStream& s,
asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
- typename constraint<is_match_condition<MatchCondition>::value>::type)
+ constraint_t<is_match_condition<MatchCondition>::value>)
{
return read_until(s, basic_streambuf_ref<Allocator>(b), match_condition);
}
@@ -472,7 +483,7 @@ template <typename SyncReadStream, typename Allocator, typename MatchCondition>
inline std::size_t read_until(SyncReadStream& s,
asio::basic_streambuf<Allocator>& b,
MatchCondition match_condition, asio::error_code& ec,
- typename constraint<is_match_condition<MatchCondition>::value>::type)
+ constraint_t<is_match_condition<MatchCondition>::value>)
{
return read_until(s, basic_streambuf_ref<Allocator>(b), match_condition, ec);
}
@@ -484,13 +495,13 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read_until(SyncReadStream& s,
DynamicBuffer_v2 buffers, char delim,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), delim, ec);
+ static_cast<DynamicBuffer_v2&&>(buffers), delim, ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}
@@ -498,9 +509,9 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
char delim, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
DynamicBuffer_v2& b = buffers;
@@ -553,13 +564,13 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read_until(SyncReadStream& s,
DynamicBuffer_v2 buffers, ASIO_STRING_VIEW_PARAM delim,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), delim, ec);
+ static_cast<DynamicBuffer_v2&&>(buffers), delim, ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}
@@ -567,9 +578,9 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
DynamicBuffer_v2& b = buffers;
@@ -631,26 +642,26 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
#if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX)
-template <typename SyncReadStream, typename DynamicBuffer_v2>
-inline std::size_t read_until(SyncReadStream& s,
- DynamicBuffer_v2 buffers, const boost::regex& expr,
- typename constraint<
+template <typename SyncReadStream, typename DynamicBuffer_v2, typename Traits>
+inline std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
+ const boost::basic_regex<char, Traits>& expr,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), expr, ec);
+ static_cast<DynamicBuffer_v2&&>(buffers), expr, ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
}
-template <typename SyncReadStream, typename DynamicBuffer_v2>
+template <typename SyncReadStream, typename DynamicBuffer_v2, typename Traits>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
- const boost::regex& expr, asio::error_code& ec,
- typename constraint<
+ const boost::basic_regex<char, Traits>& expr, asio::error_code& ec,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
DynamicBuffer_v2& b = buffers;
@@ -668,10 +679,10 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
// Look for a match.
boost::match_results<iterator,
- typename std::vector<boost::sub_match<iterator> >::allocator_type>
+ typename std::vector<boost::sub_match<iterator>>::allocator_type>
match_results;
- if (regex_search(start_pos, end, match_results, expr,
- boost::match_default | boost::match_partial))
+ if (regex_search(start_pos, end, match_results,
+ expr, detail::regex_match_flags()))
{
if (match_results[0].matched)
{
@@ -717,16 +728,16 @@ template <typename SyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition>
inline std::size_t read_until(SyncReadStream& s,
DynamicBuffer_v2 buffers, MatchCondition match_condition,
- typename constraint<
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type,
- typename constraint<
+ >,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = read_until(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
+ static_cast<DynamicBuffer_v2&&>(buffers),
match_condition, ec);
asio::detail::throw_error(ec, "read_until");
return bytes_transferred;
@@ -736,12 +747,12 @@ template <typename SyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
MatchCondition match_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type,
- typename constraint<
+ >,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
DynamicBuffer_v2& b = buffers;
@@ -810,20 +821,19 @@ namespace detail
public:
template <typename BufferSequence>
read_until_delim_op_v1(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
char delim, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
delim_(delim),
start_(0),
search_position_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_until_delim_op_v1(const read_until_delim_op_v1& other)
: base_from_cancellation_state<ReadHandler>(other),
stream_(other.stream_),
@@ -837,17 +847,15 @@ namespace detail
read_until_delim_op_v1(read_until_delim_op_v1&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v1)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v1&&>(other.buffers_)),
delim_(other.delim_),
start_(other.start_),
search_position_(other.search_position_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -907,7 +915,7 @@ namespace detail
ASIO_HANDLER_LOCATION((
__FILE__, __LINE__, "async_read_until"));
stream_.async_read_some(buffers_.prepare(bytes_to_read),
- ASIO_MOVE_CAST(read_until_delim_op_v1)(*this));
+ static_cast<read_until_delim_op_v1&&>(*this));
}
return; default:
buffers_.commit(bytes_transferred);
@@ -928,7 +936,7 @@ namespace detail
(ec || search_position_ == not_found)
? 0 : search_position_;
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(result_ec, result_n);
+ static_cast<ReadHandler&&>(handler_)(result_ec, result_n);
}
}
@@ -943,36 +951,6 @@ namespace detail
template <typename AsyncReadStream,
typename DynamicBuffer_v1, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_until_delim_op_v1<AsyncReadStream,
- DynamicBuffer_v1, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream,
- typename DynamicBuffer_v1, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_until_delim_op_v1<AsyncReadStream,
- DynamicBuffer_v1, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream,
- typename DynamicBuffer_v1, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_until_delim_op_v1<AsyncReadStream,
DynamicBuffer_v1, ReadHandler>* this_handler)
@@ -982,34 +960,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_until_delim_op_v1<AsyncReadStream,
- DynamicBuffer_v1, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_until_delim_op_v1<AsyncReadStream,
- DynamicBuffer_v1, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_until_delim_v1
{
@@ -1021,14 +971,14 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler, typename DynamicBuffer_v1>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v1&& buffers,
char delim) const
{
// If you get an error on the following line it means that your handler
@@ -1037,9 +987,9 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
read_until_delim_op_v1<AsyncReadStream,
- typename decay<DynamicBuffer_v1>::type,
- typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ decay_t<DynamicBuffer_v1>,
+ decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v1&&>(buffers),
delim, handler2.value)(asio::error_code(), 0, 1);
}
@@ -1061,8 +1011,16 @@ struct associator<Associator,
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::read_until_delim_op_v1<AsyncReadStream,
+ DynamicBuffer_v1, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_until_delim_op_v1<AsyncReadStream,
DynamicBuffer_v1, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -1072,23 +1030,25 @@ struct associator<Associator,
template <typename AsyncReadStream, typename DynamicBuffer_v1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- char delim, ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s,
+ DynamicBuffer_v1&& buffers, char delim, ReadToken&& token,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), delim))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_until_delim_v1<AsyncReadStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), delim);
+ token, static_cast<DynamicBuffer_v1&&>(buffers), delim);
}
namespace detail
@@ -1101,20 +1061,19 @@ namespace detail
public:
template <typename BufferSequence>
read_until_delim_string_op_v1(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
const std::string& delim, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
delim_(delim),
start_(0),
search_position_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_until_delim_string_op_v1(const read_until_delim_string_op_v1& other)
: base_from_cancellation_state<ReadHandler>(other),
stream_(other.stream_),
@@ -1128,17 +1087,15 @@ namespace detail
read_until_delim_string_op_v1(read_until_delim_string_op_v1&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v1)(other.buffers_)),
- delim_(ASIO_MOVE_CAST(std::string)(other.delim_)),
+ buffers_(static_cast<DynamicBuffer_v1&&>(other.buffers_)),
+ delim_(static_cast<std::string&&>(other.delim_)),
start_(other.start_),
search_position_(other.search_position_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -1209,7 +1166,7 @@ namespace detail
ASIO_HANDLER_LOCATION((
__FILE__, __LINE__, "async_read_until"));
stream_.async_read_some(buffers_.prepare(bytes_to_read),
- ASIO_MOVE_CAST(read_until_delim_string_op_v1)(*this));
+ static_cast<read_until_delim_string_op_v1&&>(*this));
}
return; default:
buffers_.commit(bytes_transferred);
@@ -1230,7 +1187,7 @@ namespace detail
(ec || search_position_ == not_found)
? 0 : search_position_;
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(result_ec, result_n);
+ static_cast<ReadHandler&&>(handler_)(result_ec, result_n);
}
}
@@ -1245,36 +1202,6 @@ namespace detail
template <typename AsyncReadStream,
typename DynamicBuffer_v1, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_until_delim_string_op_v1<AsyncReadStream,
- DynamicBuffer_v1, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream,
- typename DynamicBuffer_v1, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_until_delim_string_op_v1<AsyncReadStream,
- DynamicBuffer_v1, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream,
- typename DynamicBuffer_v1, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_until_delim_string_op_v1<AsyncReadStream,
DynamicBuffer_v1, ReadHandler>* this_handler)
@@ -1284,34 +1211,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_until_delim_string_op_v1<AsyncReadStream,
- DynamicBuffer_v1, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_until_delim_string_op_v1<AsyncReadStream,
- DynamicBuffer_v1, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_until_delim_string_v1
{
@@ -1323,14 +1222,14 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler, typename DynamicBuffer_v1>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v1&& buffers,
const std::string& delim) const
{
// If you get an error on the following line it means that your handler
@@ -1339,9 +1238,9 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
read_until_delim_string_op_v1<AsyncReadStream,
- typename decay<DynamicBuffer_v1>::type,
- typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ decay_t<DynamicBuffer_v1>,
+ decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v1&&>(buffers),
delim, handler2.value)(asio::error_code(), 0, 1);
}
@@ -1362,9 +1261,17 @@ struct associator<Associator,
: Associator<ReadHandler, DefaultCandidate>
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
- const detail::read_until_delim_string_op_v1<AsyncReadStream,
- DynamicBuffer_v1, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::read_until_delim_string_op_v1<
+ AsyncReadStream, DynamicBuffer_v1, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_until_delim_string_op_v1<
+ AsyncReadStream, DynamicBuffer_v1, ReadHandler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -1374,24 +1281,27 @@ struct associator<Associator,
template <typename AsyncReadStream, typename DynamicBuffer_v1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- ASIO_STRING_VIEW_PARAM delim,
- ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
+ ASIO_STRING_VIEW_PARAM delim, ReadToken&& token,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_string_v1<
+ AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<std::string>(delim)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_until_delim_string_v1<AsyncReadStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
static_cast<std::string>(delim));
}
@@ -1406,22 +1316,20 @@ namespace detail
: public base_from_cancellation_state<ReadHandler>
{
public:
- template <typename BufferSequence>
- read_until_expr_op_v1(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
- const boost::regex& expr, ReadHandler& handler)
+ template <typename BufferSequence, typename Traits>
+ read_until_expr_op_v1(AsyncReadStream& stream, BufferSequence&& buffers,
+ const boost::basic_regex<char, Traits>& expr, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
expr_(expr),
start_(0),
search_position_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_until_expr_op_v1(const read_until_expr_op_v1& other)
: base_from_cancellation_state<ReadHandler>(other),
stream_(other.stream_),
@@ -1435,17 +1343,15 @@ namespace detail
read_until_expr_op_v1(read_until_expr_op_v1&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v1)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v1&&>(other.buffers_)),
expr_(other.expr_),
start_(other.start_),
search_position_(other.search_position_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -1469,10 +1375,10 @@ namespace detail
// Look for a match.
boost::match_results<iterator,
- typename std::vector<boost::sub_match<iterator> >::allocator_type>
+ typename std::vector<boost::sub_match<iterator>>::allocator_type>
match_results;
- bool match = regex_search(start_pos, end, match_results, expr_,
- boost::match_default | boost::match_partial);
+ bool match = regex_search(start_pos, end,
+ match_results, expr_, regex_match_flags());
if (match && match_results[0].matched)
{
// Full match. We're done.
@@ -1519,7 +1425,7 @@ namespace detail
ASIO_HANDLER_LOCATION((
__FILE__, __LINE__, "async_read_until"));
stream_.async_read_some(buffers_.prepare(bytes_to_read),
- ASIO_MOVE_CAST(read_until_expr_op_v1)(*this));
+ static_cast<read_until_expr_op_v1&&>(*this));
}
return; default:
buffers_.commit(bytes_transferred);
@@ -1540,7 +1446,7 @@ namespace detail
(ec || search_position_ == not_found)
? 0 : search_position_;
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(result_ec, result_n);
+ static_cast<ReadHandler&&>(handler_)(result_ec, result_n);
}
}
@@ -1555,36 +1461,6 @@ namespace detail
template <typename AsyncReadStream, typename DynamicBuffer_v1,
typename RegEx, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_until_expr_op_v1<AsyncReadStream,
- DynamicBuffer_v1, RegEx, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v1,
- typename RegEx, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_until_expr_op_v1<AsyncReadStream,
- DynamicBuffer_v1, RegEx, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v1,
- typename RegEx, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_until_expr_op_v1<AsyncReadStream,
DynamicBuffer_v1, RegEx, ReadHandler>* this_handler)
@@ -1594,34 +1470,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename RegEx, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_until_expr_op_v1<AsyncReadStream,
- DynamicBuffer_v1, RegEx, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename RegEx, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_until_expr_op_v1<AsyncReadStream,
- DynamicBuffer_v1, RegEx, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_until_expr_v1
{
@@ -1633,14 +1481,14 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler, typename DynamicBuffer_v1, typename RegEx>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, const RegEx& expr) const
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v1&& buffers, const RegEx& expr) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ReadHandler.
@@ -1648,9 +1496,9 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
read_until_expr_op_v1<AsyncReadStream,
- typename decay<DynamicBuffer_v1>::type,
- RegEx, typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ decay_t<DynamicBuffer_v1>,
+ RegEx, decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v1&&>(buffers),
expr, handler2.value)(asio::error_code(), 0, 1);
}
@@ -1672,8 +1520,16 @@ struct associator<Associator,
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::read_until_expr_op_v1<AsyncReadStream,
+ DynamicBuffer_v1, RegEx, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_until_expr_op_v1<AsyncReadStream,
DynamicBuffer_v1, RegEx, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -1681,26 +1537,27 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream, typename DynamicBuffer_v1,
+template <typename AsyncReadStream, typename DynamicBuffer_v1, typename Traits,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- const boost::regex& expr,
- ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
+ const boost::basic_regex<char, Traits>& expr, ReadToken&& token,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_expr_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), expr))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_until_expr_v1<AsyncReadStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), expr);
+ token, static_cast<DynamicBuffer_v1&&>(buffers), expr);
}
#endif // defined(ASIO_HAS_BOOST_REGEX)
@@ -1715,20 +1572,19 @@ namespace detail
public:
template <typename BufferSequence>
read_until_match_op_v1(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
MatchCondition match_condition, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
match_condition_(match_condition),
start_(0),
search_position_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_until_match_op_v1(const read_until_match_op_v1& other)
: base_from_cancellation_state<ReadHandler>(other),
stream_(other.stream_),
@@ -1742,17 +1598,15 @@ namespace detail
read_until_match_op_v1(read_until_match_op_v1&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v1)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v1&&>(other.buffers_)),
match_condition_(other.match_condition_),
start_(other.start_),
search_position_(other.search_position_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -1822,7 +1676,7 @@ namespace detail
ASIO_HANDLER_LOCATION((
__FILE__, __LINE__, "async_read_until"));
stream_.async_read_some(buffers_.prepare(bytes_to_read),
- ASIO_MOVE_CAST(read_until_match_op_v1)(*this));
+ static_cast<read_until_match_op_v1&&>(*this));
}
return; default:
buffers_.commit(bytes_transferred);
@@ -1843,7 +1697,7 @@ namespace detail
(ec || search_position_ == not_found)
? 0 : search_position_;
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(result_ec, result_n);
+ static_cast<ReadHandler&&>(handler_)(result_ec, result_n);
}
}
@@ -1858,36 +1712,6 @@ namespace detail
template <typename AsyncReadStream, typename DynamicBuffer_v1,
typename MatchCondition, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_until_match_op_v1<AsyncReadStream, DynamicBuffer_v1,
- MatchCondition, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v1,
- typename MatchCondition, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_until_match_op_v1<AsyncReadStream, DynamicBuffer_v1,
- MatchCondition, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v1,
- typename MatchCondition, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_until_match_op_v1<AsyncReadStream, DynamicBuffer_v1,
MatchCondition, ReadHandler>* this_handler)
@@ -1897,36 +1721,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename MatchCondition,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_until_match_op_v1<AsyncReadStream, DynamicBuffer_v1,
- MatchCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v1, typename MatchCondition,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_until_match_op_v1<AsyncReadStream, DynamicBuffer_v1,
- MatchCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_until_match_v1
{
@@ -1938,15 +1732,15 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler,
typename DynamicBuffer_v1, typename MatchCondition>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v1&& buffers,
MatchCondition match_condition) const
{
// If you get an error on the following line it means that your handler
@@ -1955,9 +1749,9 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
read_until_match_op_v1<AsyncReadStream,
- typename decay<DynamicBuffer_v1>::type,
- MatchCondition, typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ decay_t<DynamicBuffer_v1>,
+ MatchCondition, decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v1&&>(buffers),
match_condition, handler2.value)(asio::error_code(), 0, 1);
}
@@ -1979,8 +1773,16 @@ struct associator<Associator,
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::read_until_match_op_v1<AsyncReadStream,
+ DynamicBuffer_v1, MatchCondition, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_until_match_op_v1<AsyncReadStream,
DynamicBuffer_v1, MatchCondition, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -1991,86 +1793,111 @@ struct associator<Associator,
template <typename AsyncReadStream,
typename DynamicBuffer_v1, typename MatchCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
+ MatchCondition match_condition, ReadToken&& token,
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ >,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_match_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ match_condition))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_read_until_match_v1<AsyncReadStream>(s), handler,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), match_condition);
+ detail::initiate_async_read_until_match_v1<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ match_condition);
}
#if !defined(ASIO_NO_IOSTREAM)
template <typename AsyncReadStream, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- asio::basic_streambuf<Allocator>& b,
- char delim, ASIO_MOVE_ARG(ReadHandler) handler)
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s,
+ asio::basic_streambuf<Allocator>& b, char delim, ReadToken&& token)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), delim))
{
- return async_read_until(s, basic_streambuf_ref<Allocator>(b),
- delim, ASIO_MOVE_CAST(ReadHandler)(handler));
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_read_until_delim_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), delim);
}
template <typename AsyncReadStream, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s,
asio::basic_streambuf<Allocator>& b,
- ASIO_STRING_VIEW_PARAM delim,
- ASIO_MOVE_ARG(ReadHandler) handler)
+ ASIO_STRING_VIEW_PARAM delim, ReadToken&& token)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_string_v1<
+ AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<std::string>(delim)))
{
- return async_read_until(s, basic_streambuf_ref<Allocator>(b),
- delim, ASIO_MOVE_CAST(ReadHandler)(handler));
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_read_until_delim_string_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<std::string>(delim));
}
#if defined(ASIO_HAS_BOOST_REGEX)
-template <typename AsyncReadStream, typename Allocator,
+template <typename AsyncReadStream, typename Allocator, typename Traits,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
- ASIO_MOVE_ARG(ReadHandler) handler)
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s,
+ asio::basic_streambuf<Allocator>& b,
+ const boost::basic_regex<char, Traits>& expr, ReadToken&& token)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_expr_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), expr))
{
- return async_read_until(s, basic_streambuf_ref<Allocator>(b),
- expr, ASIO_MOVE_CAST(ReadHandler)(handler));
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_read_until_expr_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), expr);
}
#endif // defined(ASIO_HAS_BOOST_REGEX)
template <typename AsyncReadStream, typename Allocator, typename MatchCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s,
asio::basic_streambuf<Allocator>& b,
- MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<is_match_condition<MatchCondition>::value>::type)
+ MatchCondition match_condition, ReadToken&& token,
+ constraint_t<is_match_condition<MatchCondition>::value>)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_match_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), match_condition))
{
- return async_read_until(s, basic_streambuf_ref<Allocator>(b),
- match_condition, ASIO_MOVE_CAST(ReadHandler)(handler));
+ return async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_read_until_match_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), match_condition);
}
#endif // !defined(ASIO_NO_IOSTREAM)
@@ -2087,21 +1914,20 @@ namespace detail
public:
template <typename BufferSequence>
read_until_delim_op_v2(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
char delim, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
delim_(delim),
start_(0),
search_position_(0),
bytes_to_read_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_until_delim_op_v2(const read_until_delim_op_v2& other)
: base_from_cancellation_state<ReadHandler>(other),
stream_(other.stream_),
@@ -2116,18 +1942,16 @@ namespace detail
read_until_delim_op_v2(read_until_delim_op_v2&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v2)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v2&&>(other.buffers_)),
delim_(other.delim_),
start_(other.start_),
search_position_(other.search_position_),
bytes_to_read_(other.bytes_to_read_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -2191,7 +2015,7 @@ namespace detail
ASIO_HANDLER_LOCATION((
__FILE__, __LINE__, "async_read_until"));
stream_.async_read_some(buffers_.data(pos, bytes_to_read_),
- ASIO_MOVE_CAST(read_until_delim_op_v2)(*this));
+ static_cast<read_until_delim_op_v2&&>(*this));
}
return; default:
buffers_.shrink(bytes_to_read_ - bytes_transferred);
@@ -2212,7 +2036,7 @@ namespace detail
(ec || search_position_ == not_found)
? 0 : search_position_;
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(result_ec, result_n);
+ static_cast<ReadHandler&&>(handler_)(result_ec, result_n);
}
}
@@ -2228,36 +2052,6 @@ namespace detail
template <typename AsyncReadStream,
typename DynamicBuffer_v2, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_until_delim_op_v2<AsyncReadStream,
- DynamicBuffer_v2, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream,
- typename DynamicBuffer_v2, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_until_delim_op_v2<AsyncReadStream,
- DynamicBuffer_v2, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream,
- typename DynamicBuffer_v2, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_until_delim_op_v2<AsyncReadStream,
DynamicBuffer_v2, ReadHandler>* this_handler)
@@ -2267,34 +2061,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_until_delim_op_v2<AsyncReadStream,
- DynamicBuffer_v2, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_until_delim_op_v2<AsyncReadStream,
- DynamicBuffer_v2, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_until_delim_v2
{
@@ -2306,14 +2072,14 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler, typename DynamicBuffer_v2>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v2) buffers, char delim) const
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v2&& buffers, char delim) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ReadHandler.
@@ -2321,9 +2087,9 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
read_until_delim_op_v2<AsyncReadStream,
- typename decay<DynamicBuffer_v2>::type,
- typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
+ decay_t<DynamicBuffer_v2>,
+ decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v2&&>(buffers),
delim, handler2.value)(asio::error_code(), 0, 1);
}
@@ -2345,8 +2111,16 @@ struct associator<Associator,
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::read_until_delim_op_v2<AsyncReadStream,
+ DynamicBuffer_v2, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_until_delim_op_v2<AsyncReadStream,
DynamicBuffer_v2, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -2356,19 +2130,22 @@ struct associator<Associator,
template <typename AsyncReadStream, typename DynamicBuffer_v2,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- char delim, ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s,
+ DynamicBuffer_v2 buffers, char delim, ReadToken&& token,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), delim))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_until_delim_v2<AsyncReadStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), delim);
+ token, static_cast<DynamicBuffer_v2&&>(buffers), delim);
}
namespace detail
@@ -2381,21 +2158,20 @@ namespace detail
public:
template <typename BufferSequence>
read_until_delim_string_op_v2(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
const std::string& delim, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
delim_(delim),
start_(0),
search_position_(0),
bytes_to_read_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_until_delim_string_op_v2(const read_until_delim_string_op_v2& other)
: base_from_cancellation_state<ReadHandler>(other),
stream_(other.stream_),
@@ -2410,18 +2186,16 @@ namespace detail
read_until_delim_string_op_v2(read_until_delim_string_op_v2&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v2)(other.buffers_)),
- delim_(ASIO_MOVE_CAST(std::string)(other.delim_)),
+ buffers_(static_cast<DynamicBuffer_v2&&>(other.buffers_)),
+ delim_(static_cast<std::string&&>(other.delim_)),
start_(other.start_),
search_position_(other.search_position_),
bytes_to_read_(other.bytes_to_read_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -2496,7 +2270,7 @@ namespace detail
ASIO_HANDLER_LOCATION((
__FILE__, __LINE__, "async_read_until"));
stream_.async_read_some(buffers_.data(pos, bytes_to_read_),
- ASIO_MOVE_CAST(read_until_delim_string_op_v2)(*this));
+ static_cast<read_until_delim_string_op_v2&&>(*this));
}
return; default:
buffers_.shrink(bytes_to_read_ - bytes_transferred);
@@ -2517,7 +2291,7 @@ namespace detail
(ec || search_position_ == not_found)
? 0 : search_position_;
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(result_ec, result_n);
+ static_cast<ReadHandler&&>(handler_)(result_ec, result_n);
}
}
@@ -2533,36 +2307,6 @@ namespace detail
template <typename AsyncReadStream,
typename DynamicBuffer_v2, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_until_delim_string_op_v2<AsyncReadStream,
- DynamicBuffer_v2, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream,
- typename DynamicBuffer_v2, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_until_delim_string_op_v2<AsyncReadStream,
- DynamicBuffer_v2, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream,
- typename DynamicBuffer_v2, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_until_delim_string_op_v2<AsyncReadStream,
DynamicBuffer_v2, ReadHandler>* this_handler)
@@ -2572,34 +2316,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_until_delim_string_op_v2<AsyncReadStream,
- DynamicBuffer_v2, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_until_delim_string_op_v2<AsyncReadStream,
- DynamicBuffer_v2, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_until_delim_string_v2
{
@@ -2611,14 +2327,14 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler, typename DynamicBuffer_v2>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v2&& buffers,
const std::string& delim) const
{
// If you get an error on the following line it means that your handler
@@ -2627,9 +2343,9 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
read_until_delim_string_op_v2<AsyncReadStream,
- typename decay<DynamicBuffer_v2>::type,
- typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
+ decay_t<DynamicBuffer_v2>,
+ decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v2&&>(buffers),
delim, handler2.value)(asio::error_code(), 0, 1);
}
@@ -2650,9 +2366,17 @@ struct associator<Associator,
: Associator<ReadHandler, DefaultCandidate>
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
- const detail::read_until_delim_string_op_v2<AsyncReadStream,
- DynamicBuffer_v2, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::read_until_delim_string_op_v2<
+ AsyncReadStream, DynamicBuffer_v2, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_until_delim_string_op_v2<
+ AsyncReadStream, DynamicBuffer_v2, ReadHandler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -2663,20 +2387,24 @@ struct associator<Associator,
template <typename AsyncReadStream,
typename DynamicBuffer_v2,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- DynamicBuffer_v2 buffers, ASIO_STRING_VIEW_PARAM delim,
- ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+ ASIO_STRING_VIEW_PARAM delim, ReadToken&& token,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_string_v2<
+ AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<std::string>(delim)))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_until_delim_string_v2<AsyncReadStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
static_cast<std::string>(delim));
}
@@ -2691,23 +2419,21 @@ namespace detail
: public base_from_cancellation_state<ReadHandler>
{
public:
- template <typename BufferSequence>
- read_until_expr_op_v2(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
- const boost::regex& expr, ReadHandler& handler)
+ template <typename BufferSequence, typename Traits>
+ read_until_expr_op_v2(AsyncReadStream& stream, BufferSequence&& buffers,
+ const boost::basic_regex<char, Traits>& expr, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
expr_(expr),
start_(0),
search_position_(0),
bytes_to_read_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_until_expr_op_v2(const read_until_expr_op_v2& other)
: base_from_cancellation_state<ReadHandler>(other),
stream_(other.stream_),
@@ -2722,18 +2448,16 @@ namespace detail
read_until_expr_op_v2(read_until_expr_op_v2&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v2)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v2&&>(other.buffers_)),
expr_(other.expr_),
start_(other.start_),
search_position_(other.search_position_),
bytes_to_read_(other.bytes_to_read_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -2759,10 +2483,10 @@ namespace detail
// Look for a match.
boost::match_results<iterator,
- typename std::vector<boost::sub_match<iterator> >::allocator_type>
+ typename std::vector<boost::sub_match<iterator>>::allocator_type>
match_results;
- bool match = regex_search(start_pos, end, match_results, expr_,
- boost::match_default | boost::match_partial);
+ bool match = regex_search(start_pos, end,
+ match_results, expr_, regex_match_flags());
if (match && match_results[0].matched)
{
// Full match. We're done.
@@ -2811,7 +2535,7 @@ namespace detail
ASIO_HANDLER_LOCATION((
__FILE__, __LINE__, "async_read_until"));
stream_.async_read_some(buffers_.data(pos, bytes_to_read_),
- ASIO_MOVE_CAST(read_until_expr_op_v2)(*this));
+ static_cast<read_until_expr_op_v2&&>(*this));
}
return; default:
buffers_.shrink(bytes_to_read_ - bytes_transferred);
@@ -2832,7 +2556,7 @@ namespace detail
(ec || search_position_ == not_found)
? 0 : search_position_;
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(result_ec, result_n);
+ static_cast<ReadHandler&&>(handler_)(result_ec, result_n);
}
}
@@ -2848,36 +2572,6 @@ namespace detail
template <typename AsyncReadStream, typename DynamicBuffer_v2,
typename RegEx, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_until_expr_op_v2<AsyncReadStream,
- DynamicBuffer_v2, RegEx, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v2,
- typename RegEx, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_until_expr_op_v2<AsyncReadStream,
- DynamicBuffer_v2, RegEx, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v2,
- typename RegEx, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_until_expr_op_v2<AsyncReadStream,
DynamicBuffer_v2, RegEx, ReadHandler>* this_handler)
@@ -2887,34 +2581,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename RegEx, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_until_expr_op_v2<AsyncReadStream,
- DynamicBuffer_v2, RegEx, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename RegEx, typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_until_expr_op_v2<AsyncReadStream,
- DynamicBuffer_v2, RegEx, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_until_expr_v2
{
@@ -2926,14 +2592,14 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler, typename DynamicBuffer_v2, typename RegEx>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v2&& buffers,
const RegEx& expr) const
{
// If you get an error on the following line it means that your handler
@@ -2942,9 +2608,9 @@ namespace detail
non_const_lvalue<ReadHandler> handler2(handler);
read_until_expr_op_v2<AsyncReadStream,
- typename decay<DynamicBuffer_v2>::type,
- RegEx, typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
+ decay_t<DynamicBuffer_v2>,
+ RegEx, decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v2&&>(buffers),
expr, handler2.value)(asio::error_code(), 0, 1);
}
@@ -2966,8 +2632,16 @@ struct associator<Associator,
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::read_until_expr_op_v2<AsyncReadStream,
+ DynamicBuffer_v2, RegEx, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_until_expr_op_v2<AsyncReadStream,
DynamicBuffer_v2, RegEx, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -2975,21 +2649,24 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream, typename DynamicBuffer_v2,
+template <typename AsyncReadStream, typename DynamicBuffer_v2, typename Traits,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- const boost::regex& expr, ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+ const boost::basic_regex<char, Traits>& expr, ReadToken&& token,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_expr_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), expr))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_read_until_expr_v2<AsyncReadStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), expr);
+ token, static_cast<DynamicBuffer_v2&&>(buffers), expr);
}
#endif // defined(ASIO_HAS_BOOST_REGEX)
@@ -3004,21 +2681,20 @@ namespace detail
public:
template <typename BufferSequence>
read_until_match_op_v2(AsyncReadStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
MatchCondition match_condition, ReadHandler& handler)
: base_from_cancellation_state<ReadHandler>(
handler, enable_partial_cancellation()),
stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
match_condition_(match_condition),
start_(0),
search_position_(0),
bytes_to_read_(0),
- handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
+ handler_(static_cast<ReadHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
read_until_match_op_v2(const read_until_match_op_v2& other)
: base_from_cancellation_state<ReadHandler>(other),
stream_(other.stream_),
@@ -3033,18 +2709,16 @@ namespace detail
read_until_match_op_v2(read_until_match_op_v2&& other)
: base_from_cancellation_state<ReadHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- ReadHandler>)(other)),
+ static_cast<base_from_cancellation_state<ReadHandler>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v2)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v2&&>(other.buffers_)),
match_condition_(other.match_condition_),
start_(other.start_),
search_position_(other.search_position_),
bytes_to_read_(other.bytes_to_read_),
- handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
+ handler_(static_cast<ReadHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -3118,7 +2792,7 @@ namespace detail
ASIO_HANDLER_LOCATION((
__FILE__, __LINE__, "async_read_until"));
stream_.async_read_some(buffers_.data(pos, bytes_to_read_),
- ASIO_MOVE_CAST(read_until_match_op_v2)(*this));
+ static_cast<read_until_match_op_v2&&>(*this));
}
return; default:
buffers_.shrink(bytes_to_read_ - bytes_transferred);
@@ -3139,7 +2813,7 @@ namespace detail
(ec || search_position_ == not_found)
? 0 : search_position_;
- ASIO_MOVE_OR_LVALUE(ReadHandler)(handler_)(result_ec, result_n);
+ static_cast<ReadHandler&&>(handler_)(result_ec, result_n);
}
}
@@ -3155,36 +2829,6 @@ namespace detail
template <typename AsyncReadStream, typename DynamicBuffer_v2,
typename MatchCondition, typename ReadHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- read_until_match_op_v2<AsyncReadStream, DynamicBuffer_v2,
- MatchCondition, ReadHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v2,
- typename MatchCondition, typename ReadHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- read_until_match_op_v2<AsyncReadStream, DynamicBuffer_v2,
- MatchCondition, ReadHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncReadStream, typename DynamicBuffer_v2,
- typename MatchCondition, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_until_match_op_v2<AsyncReadStream, DynamicBuffer_v2,
MatchCondition, ReadHandler>* this_handler)
@@ -3194,36 +2838,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename MatchCondition,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- read_until_match_op_v2<AsyncReadStream, DynamicBuffer_v2,
- MatchCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncReadStream,
- typename DynamicBuffer_v2, typename MatchCondition,
- typename ReadHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- read_until_match_op_v2<AsyncReadStream, DynamicBuffer_v2,
- MatchCondition, ReadHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncReadStream>
class initiate_async_read_until_match_v2
{
@@ -3235,15 +2849,15 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename ReadHandler,
typename DynamicBuffer_v2, typename MatchCondition>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
+ void operator()(ReadHandler&& handler,
+ DynamicBuffer_v2&& buffers,
MatchCondition match_condition) const
{
// If you get an error on the following line it means that your handler
@@ -3251,11 +2865,10 @@ namespace detail
ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
non_const_lvalue<ReadHandler> handler2(handler);
- read_until_match_op_v2<AsyncReadStream,
- typename decay<DynamicBuffer_v2>::type,
- MatchCondition, typename decay<ReadHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
- match_condition, handler2.value)(asio::error_code(), 0, 1);
+ read_until_match_op_v2<AsyncReadStream, decay_t<DynamicBuffer_v2>,
+ MatchCondition, decay_t<ReadHandler>>(
+ stream_, static_cast<DynamicBuffer_v2&&>(buffers),
+ match_condition, handler2.value)(asio::error_code(), 0, 1);
}
private:
@@ -3276,8 +2889,16 @@ struct associator<Associator,
{
static typename Associator<ReadHandler, DefaultCandidate>::type get(
const detail::read_until_match_op_v2<AsyncReadStream,
+ DynamicBuffer_v2, MatchCondition, ReadHandler>& h) noexcept
+ {
+ return Associator<ReadHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::read_until_match_op_v2<AsyncReadStream,
DynamicBuffer_v2, MatchCondition, ReadHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<ReadHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -3288,22 +2909,27 @@ struct associator<Associator,
template <typename AsyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler,
- typename constraint<
+ std::size_t)) ReadToken>
+inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+ MatchCondition match_condition, ReadToken&& token,
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type,
- typename constraint<
+ >,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_match_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ match_condition))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_read_until_match_v2<AsyncReadStream>(s), handler,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), match_condition);
+ detail::initiate_async_read_until_match_v2<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ match_condition);
}
#endif // !defined(ASIO_NO_EXTENSIONS)
diff --git a/3rdparty/asio/include/asio/impl/redirect_error.hpp b/3rdparty/asio/include/asio/impl/redirect_error.hpp
index 79162868959..e75aa0f706c 100644
--- a/3rdparty/asio/include/asio/impl/redirect_error.hpp
+++ b/3rdparty/asio/include/asio/impl/redirect_error.hpp
@@ -2,7 +2,7 @@
// impl/redirect_error.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,11 +18,8 @@
#include "asio/detail/config.hpp"
#include "asio/associator.hpp"
#include "asio/async_result.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/system_error.hpp"
#include "asio/detail/push_options.hpp"
@@ -40,121 +37,47 @@ public:
template <typename CompletionToken>
redirect_error_handler(redirect_error_t<CompletionToken> e)
: ec_(e.ec_),
- handler_(ASIO_MOVE_CAST(CompletionToken)(e.token_))
+ handler_(static_cast<CompletionToken&&>(e.token_))
{
}
template <typename RedirectedHandler>
redirect_error_handler(asio::error_code& ec,
- ASIO_MOVE_ARG(RedirectedHandler) h)
+ RedirectedHandler&& h)
: ec_(ec),
- handler_(ASIO_MOVE_CAST(RedirectedHandler)(h))
+ handler_(static_cast<RedirectedHandler&&>(h))
{
}
void operator()()
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)();
+ static_cast<Handler&&>(handler_)();
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Arg, typename... Args>
- typename enable_if<
- !is_same<typename decay<Arg>::type, asio::error_code>::value
- >::type
- operator()(ASIO_MOVE_ARG(Arg) arg, ASIO_MOVE_ARG(Args)... args)
+ enable_if_t<
+ !is_same<decay_t<Arg>, asio::error_code>::value
+ >
+ operator()(Arg&& arg, Args&&... args)
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
- ASIO_MOVE_CAST(Arg)(arg),
- ASIO_MOVE_CAST(Args)(args)...);
+ static_cast<Handler&&>(handler_)(
+ static_cast<Arg&&>(arg),
+ static_cast<Args&&>(args)...);
}
template <typename... Args>
- void operator()(const asio::error_code& ec,
- ASIO_MOVE_ARG(Args)... args)
- {
- ec_ = ec;
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Arg>
- typename enable_if<
- !is_same<typename decay<Arg>::type, asio::error_code>::value
- >::type
- operator()(ASIO_MOVE_ARG(Arg) arg)
- {
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)(
- ASIO_MOVE_CAST(Arg)(arg));
- }
-
- void operator()(const asio::error_code& ec)
+ void operator()(const asio::error_code& ec, Args&&... args)
{
ec_ = ec;
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)();
+ static_cast<Handler&&>(handler_)(static_cast<Args&&>(args)...);
}
-#define ASIO_PRIVATE_REDIRECT_ERROR_DEF(n) \
- template <typename Arg, ASIO_VARIADIC_TPARAMS(n)> \
- typename enable_if< \
- !is_same<typename decay<Arg>::type, asio::error_code>::value \
- >::type \
- operator()(ASIO_MOVE_ARG(Arg) arg, ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)( \
- ASIO_MOVE_CAST(Arg)(arg), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- void operator()(const asio::error_code& ec, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- ec_ = ec; \
- ASIO_MOVE_OR_LVALUE(Handler)(handler_)( \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_REDIRECT_ERROR_DEF)
-#undef ASIO_PRIVATE_REDIRECT_ERROR_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
//private:
asio::error_code& ec_;
Handler handler_;
};
template <typename Handler>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- redirect_error_handler<Handler>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- redirect_error_handler<Handler>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Handler>
inline bool asio_handler_is_continuation(
redirect_error_handler<Handler>* this_handler)
{
@@ -162,38 +85,12 @@ inline bool asio_handler_is_continuation(
this_handler->handler_);
}
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- redirect_error_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- redirect_error_handler<Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Signature>
struct redirect_error_signature
{
typedef Signature type;
};
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename R, typename... Args>
struct redirect_error_signature<R(asio::error_code, Args...)>
{
@@ -206,8 +103,6 @@ struct redirect_error_signature<R(const asio::error_code&, Args...)>
typedef R type(Args...);
};
-# if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
template <typename R, typename... Args>
struct redirect_error_signature<R(asio::error_code, Args...) &>
{
@@ -232,7 +127,7 @@ struct redirect_error_signature<R(const asio::error_code&, Args...) &&>
typedef R type(Args...) &&;
};
-# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
+#if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
template <typename R, typename... Args>
struct redirect_error_signature<
@@ -276,196 +171,7 @@ struct redirect_error_signature<
typedef R type(Args...) && noexcept;
};
-# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-# endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename R>
-struct redirect_error_signature<R(asio::error_code)>
-{
- typedef R type();
-};
-
-template <typename R>
-struct redirect_error_signature<R(const asio::error_code&)>
-{
- typedef R type();
-};
-
-#define ASIO_PRIVATE_REDIRECT_ERROR_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(asio::error_code, ASIO_VARIADIC_TARGS(n))> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)); \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(const asio::error_code&, ASIO_VARIADIC_TARGS(n))> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)); \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_REDIRECT_ERROR_DEF)
-#undef ASIO_PRIVATE_REDIRECT_ERROR_DEF
-
-# if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-
-template <typename R>
-struct redirect_error_signature<R(asio::error_code) &>
-{
- typedef R type() &;
-};
-
-template <typename R>
-struct redirect_error_signature<R(const asio::error_code&) &>
-{
- typedef R type() &;
-};
-
-template <typename R>
-struct redirect_error_signature<R(asio::error_code) &&>
-{
- typedef R type() &&;
-};
-
-template <typename R>
-struct redirect_error_signature<R(const asio::error_code&) &&>
-{
- typedef R type() &&;
-};
-
-#define ASIO_PRIVATE_REDIRECT_ERROR_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(asio::error_code, ASIO_VARIADIC_TARGS(n)) &> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) &; \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(const asio::error_code&, ASIO_VARIADIC_TARGS(n)) &> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) &; \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(asio::error_code, ASIO_VARIADIC_TARGS(n)) &&> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) &&; \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(const asio::error_code&, ASIO_VARIADIC_TARGS(n)) &&> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) &&; \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_REDIRECT_ERROR_DEF)
-#undef ASIO_PRIVATE_REDIRECT_ERROR_DEF
-
-# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-
-template <typename R>
-struct redirect_error_signature<
- R(asio::error_code) noexcept>
-{
- typedef R type() noexcept;
-};
-
-template <typename R>
-struct redirect_error_signature<
- R(const asio::error_code&) noexcept>
-{
- typedef R type() noexcept;
-};
-
-template <typename R>
-struct redirect_error_signature<
- R(asio::error_code) & noexcept>
-{
- typedef R type() & noexcept;
-};
-
-template <typename R>
-struct redirect_error_signature<
- R(const asio::error_code&) & noexcept>
-{
- typedef R type() & noexcept;
-};
-
-template <typename R>
-struct redirect_error_signature<
- R(asio::error_code) && noexcept>
-{
- typedef R type() && noexcept;
-};
-
-template <typename R>
-struct redirect_error_signature<
- R(const asio::error_code&) && noexcept>
-{
- typedef R type() && noexcept;
-};
-
-#define ASIO_PRIVATE_REDIRECT_ERROR_DEF(n) \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(asio::error_code, ASIO_VARIADIC_TARGS(n)) noexcept> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) noexcept; \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(const asio::error_code&, \
- ASIO_VARIADIC_TARGS(n)) noexcept> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) noexcept; \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(asio::error_code, \
- ASIO_VARIADIC_TARGS(n)) & noexcept> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) & noexcept; \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(const asio::error_code&, \
- ASIO_VARIADIC_TARGS(n)) & noexcept> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) & noexcept; \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(asio::error_code, \
- ASIO_VARIADIC_TARGS(n)) && noexcept> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) && noexcept; \
- }; \
- \
- template <typename R, ASIO_VARIADIC_TPARAMS(n)> \
- struct redirect_error_signature< \
- R(const asio::error_code&, \
- ASIO_VARIADIC_TARGS(n)) && noexcept> \
- { \
- typedef R type(ASIO_VARIADIC_TARGS(n)) && noexcept; \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_REDIRECT_ERROR_DEF)
-#undef ASIO_PRIVATE_REDIRECT_ERROR_DEF
-
-# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
-# endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
+#endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
} // namespace detail
@@ -473,117 +179,46 @@ struct redirect_error_signature<
template <typename CompletionToken, typename Signature>
struct async_result<redirect_error_t<CompletionToken>, Signature>
+ : async_result<CompletionToken,
+ typename detail::redirect_error_signature<Signature>::type>
{
- typedef typename async_result<CompletionToken,
- typename detail::redirect_error_signature<Signature>::type>
- ::return_type return_type;
- template <typename Initiation>
struct init_wrapper
{
- template <typename Init>
- init_wrapper(asio::error_code& ec, ASIO_MOVE_ARG(Init) init)
- : ec_(ec),
- initiation_(ASIO_MOVE_CAST(Init)(init))
+ explicit init_wrapper(asio::error_code& ec)
+ : ec_(ec)
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Handler, typename... Args>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Args)... args)
+ template <typename Handler, typename Initiation, typename... Args>
+ void operator()(Handler&& handler,
+ Initiation&& initiation, Args&&... args) const
{
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- detail::redirect_error_handler<
- typename decay<Handler>::type>(
- ec_, ASIO_MOVE_CAST(Handler)(handler)),
- ASIO_MOVE_CAST(Args)(args)...);
+ static_cast<Initiation&&>(initiation)(
+ detail::redirect_error_handler<decay_t<Handler>>(
+ ec_, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Handler>
- void operator()(
- ASIO_MOVE_ARG(Handler) handler)
- {
- ASIO_MOVE_CAST(Initiation)(initiation_)(
- detail::redirect_error_handler<
- typename decay<Handler>::type>(
- ec_, ASIO_MOVE_CAST(Handler)(handler)));
- }
-
-#define ASIO_PRIVATE_INIT_WRAPPER_DEF(n) \
- template <typename Handler, ASIO_VARIADIC_TPARAMS(n)> \
- void operator()( \
- ASIO_MOVE_ARG(Handler) handler, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- ASIO_MOVE_CAST(Initiation)(initiation_)( \
- detail::redirect_error_handler< \
- typename decay<Handler>::type>( \
- ec_, ASIO_MOVE_CAST(Handler)(handler)), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INIT_WRAPPER_DEF)
-#undef ASIO_PRIVATE_INIT_WRAPPER_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
asio::error_code& ec_;
- Initiation initiation_;
};
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Initiation, typename RawCompletionToken, typename... Args>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token,
- ASIO_MOVE_ARG(Args)... args)
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::redirect_error_signature<Signature>::type>(
+ declval<init_wrapper>(), token.token_,
+ static_cast<Initiation&&>(initiation),
+ static_cast<Args&&>(args)...))
{
return async_initiate<CompletionToken,
typename detail::redirect_error_signature<Signature>::type>(
- init_wrapper<typename decay<Initiation>::type>(
- token.ec_, ASIO_MOVE_CAST(Initiation)(initiation)),
- token.token_, ASIO_MOVE_CAST(Args)(args)...);
+ init_wrapper(token.ec_), token.token_,
+ static_cast<Initiation&&>(initiation),
+ static_cast<Args&&>(args)...);
}
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Initiation, typename RawCompletionToken>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken) token)
- {
- return async_initiate<CompletionToken,
- typename detail::redirect_error_signature<Signature>::type>(
- init_wrapper<typename decay<Initiation>::type>(
- token.ec_, ASIO_MOVE_CAST(Initiation)(initiation)),
- token.token_);
- }
-
-#define ASIO_PRIVATE_INITIATE_DEF(n) \
- template <typename Initiation, typename RawCompletionToken, \
- ASIO_VARIADIC_TPARAMS(n)> \
- static return_type initiate( \
- ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_MOVE_ARG(RawCompletionToken) token, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- return async_initiate<CompletionToken, \
- typename detail::redirect_error_signature<Signature>::type>( \
- init_wrapper<typename decay<Initiation>::type>( \
- token.ec_, ASIO_MOVE_CAST(Initiation)(initiation)), \
- token.token_, ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF)
-#undef ASIO_PRIVATE_INITIATE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
template <template <typename, typename> class Associator,
@@ -593,8 +228,14 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::redirect_error_handler<Handler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::redirect_error_handler<Handler>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::redirect_error_handler<Handler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
diff --git a/3rdparty/asio/include/asio/impl/serial_port_base.hpp b/3rdparty/asio/include/asio/impl/serial_port_base.hpp
index 6ba9168d2ea..1fa2af66f73 100644
--- a/3rdparty/asio/include/asio/impl/serial_port_base.hpp
+++ b/3rdparty/asio/include/asio/impl/serial_port_base.hpp
@@ -2,7 +2,7 @@
// impl/serial_port_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/impl/serial_port_base.ipp b/3rdparty/asio/include/asio/impl/serial_port_base.ipp
index ebb38870a34..646af3453d6 100644
--- a/3rdparty/asio/include/asio/impl/serial_port_base.ipp
+++ b/3rdparty/asio/include/asio/impl/serial_port_base.ipp
@@ -2,7 +2,7 @@
// impl/serial_port_base.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/impl/spawn.hpp b/3rdparty/asio/include/asio/impl/spawn.hpp
index 7b510cebd42..38a96406ed4 100644
--- a/3rdparty/asio/include/asio/impl/spawn.hpp
+++ b/3rdparty/asio/include/asio/impl/spawn.hpp
@@ -2,7 +2,7 @@
// impl/spawn.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,499 +16,1382 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
+#include <tuple>
#include "asio/associated_allocator.hpp"
+#include "asio/associated_cancellation_slot.hpp"
#include "asio/associated_executor.hpp"
#include "asio/async_result.hpp"
#include "asio/bind_executor.hpp"
#include "asio/detail/atomic_count.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
+#include "asio/detail/bind_handler.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/noncopyable.hpp"
#include "asio/detail/type_traits.hpp"
+#include "asio/detail/utility.hpp"
#include "asio/system_error.hpp"
+#if defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+# include <boost/context/fiber.hpp>
+#endif // defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+
#include "asio/detail/push_options.hpp"
namespace asio {
namespace detail {
- template <typename Handler, typename T>
- class coro_handler
+#if !defined(ASIO_NO_EXCEPTIONS)
+inline void spawned_thread_rethrow(void* ex)
+{
+ if (*static_cast<exception_ptr*>(ex))
+ rethrow_exception(*static_cast<exception_ptr*>(ex));
+}
+#endif // !defined(ASIO_NO_EXCEPTIONS)
+
+#if defined(ASIO_HAS_BOOST_COROUTINE)
+
+// Spawned thread implementation using Boost.Coroutine.
+class spawned_coroutine_thread : public spawned_thread_base
+{
+public:
+#if defined(BOOST_COROUTINES_UNIDIRECT) || defined(BOOST_COROUTINES_V2)
+ typedef boost::coroutines::pull_coroutine<void> callee_type;
+ typedef boost::coroutines::push_coroutine<void> caller_type;
+#else
+ typedef boost::coroutines::coroutine<void()> callee_type;
+ typedef boost::coroutines::coroutine<void()> caller_type;
+#endif
+
+ spawned_coroutine_thread(caller_type& caller)
+ : caller_(caller),
+ on_suspend_fn_(0),
+ on_suspend_arg_(0)
+ {
+ }
+
+ template <typename F>
+ static spawned_thread_base* spawn(F&& f,
+ const boost::coroutines::attributes& attributes,
+ cancellation_slot parent_cancel_slot = cancellation_slot(),
+ cancellation_state cancel_state = cancellation_state())
{
- public:
- coro_handler(basic_yield_context<Handler> ctx)
- : coro_(ctx.coro_.lock()),
- ca_(ctx.ca_),
- handler_(ctx.handler_),
- ready_(0),
- ec_(ctx.ec_),
- value_(0)
+ spawned_coroutine_thread* spawned_thread = 0;
+ callee_type callee(entry_point<decay_t<F>>(
+ static_cast<F&&>(f), &spawned_thread), attributes);
+ spawned_thread->callee_.swap(callee);
+ spawned_thread->parent_cancellation_slot_ = parent_cancel_slot;
+ spawned_thread->cancellation_state_ = cancel_state;
+ return spawned_thread;
+ }
+
+ template <typename F>
+ static spawned_thread_base* spawn(F&& f,
+ cancellation_slot parent_cancel_slot = cancellation_slot(),
+ cancellation_state cancel_state = cancellation_state())
+ {
+ return spawn(static_cast<F&&>(f), boost::coroutines::attributes(),
+ parent_cancel_slot, cancel_state);
+ }
+
+ void resume()
+ {
+ callee_();
+ if (on_suspend_fn_)
{
+ void (*fn)(void*) = on_suspend_fn_;
+ void* arg = on_suspend_arg_;
+ on_suspend_fn_ = 0;
+ fn(arg);
}
+ }
+
+ void suspend_with(void (*fn)(void*), void* arg)
+ {
+ if (throw_if_cancelled_)
+ if (!!cancellation_state_.cancelled())
+ throw_error(asio::error::operation_aborted, "yield");
+ has_context_switched_ = true;
+ on_suspend_fn_ = fn;
+ on_suspend_arg_ = arg;
+ caller_();
+ }
+
+ void destroy()
+ {
+ callee_type callee;
+ callee.swap(callee_);
+ if (terminal_)
+ callee();
+ }
- void operator()(T value)
+private:
+ template <typename Function>
+ class entry_point
+ {
+ public:
+ template <typename F>
+ entry_point(F&& f,
+ spawned_coroutine_thread** spawned_thread_out)
+ : function_(static_cast<F&&>(f)),
+ spawned_thread_out_(spawned_thread_out)
{
- *ec_ = asio::error_code();
- *value_ = ASIO_MOVE_CAST(T)(value);
- if (--*ready_ == 0)
- (*coro_)();
}
- void operator()(asio::error_code ec, T value)
+ void operator()(caller_type& caller)
{
- *ec_ = ec;
- *value_ = ASIO_MOVE_CAST(T)(value);
- if (--*ready_ == 0)
- (*coro_)();
+ Function function(static_cast<Function&&>(function_));
+ spawned_coroutine_thread spawned_thread(caller);
+ *spawned_thread_out_ = &spawned_thread;
+ spawned_thread_out_ = 0;
+ spawned_thread.suspend();
+#if !defined(ASIO_NO_EXCEPTIONS)
+ try
+#endif // !defined(ASIO_NO_EXCEPTIONS)
+ {
+ function(&spawned_thread);
+ spawned_thread.terminal_ = true;
+ spawned_thread.suspend();
+ }
+#if !defined(ASIO_NO_EXCEPTIONS)
+ catch (const boost::coroutines::detail::forced_unwind&)
+ {
+ throw;
+ }
+ catch (...)
+ {
+ exception_ptr ex = current_exception();
+ spawned_thread.terminal_ = true;
+ spawned_thread.suspend_with(spawned_thread_rethrow, &ex);
+ }
+#endif // !defined(ASIO_NO_EXCEPTIONS)
}
- //private:
- shared_ptr<typename basic_yield_context<Handler>::callee_type> coro_;
- typename basic_yield_context<Handler>::caller_type& ca_;
- Handler handler_;
- atomic_count* ready_;
- asio::error_code* ec_;
- T* value_;
+ private:
+ Function function_;
+ spawned_coroutine_thread** spawned_thread_out_;
};
- template <typename Handler>
- class coro_handler<Handler, void>
+ caller_type& caller_;
+ callee_type callee_;
+ void (*on_suspend_fn_)(void*);
+ void* on_suspend_arg_;
+};
+
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
+
+#if defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+
+// Spawned thread implementation using Boost.Context's fiber.
+class spawned_fiber_thread : public spawned_thread_base
+{
+public:
+ typedef boost::context::fiber fiber_type;
+
+ spawned_fiber_thread(fiber_type&& caller)
+ : caller_(static_cast<fiber_type&&>(caller)),
+ on_suspend_fn_(0),
+ on_suspend_arg_(0)
{
- public:
- coro_handler(basic_yield_context<Handler> ctx)
- : coro_(ctx.coro_.lock()),
- ca_(ctx.ca_),
- handler_(ctx.handler_),
- ready_(0),
- ec_(ctx.ec_)
+ }
+
+ template <typename StackAllocator, typename F>
+ static spawned_thread_base* spawn(allocator_arg_t,
+ StackAllocator&& stack_allocator,
+ F&& f,
+ cancellation_slot parent_cancel_slot = cancellation_slot(),
+ cancellation_state cancel_state = cancellation_state())
+ {
+ spawned_fiber_thread* spawned_thread = 0;
+ fiber_type callee(allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ entry_point<decay_t<F>>(
+ static_cast<F&&>(f), &spawned_thread));
+ callee = fiber_type(static_cast<fiber_type&&>(callee)).resume();
+ spawned_thread->callee_ = static_cast<fiber_type&&>(callee);
+ spawned_thread->parent_cancellation_slot_ = parent_cancel_slot;
+ spawned_thread->cancellation_state_ = cancel_state;
+ return spawned_thread;
+ }
+
+ template <typename F>
+ static spawned_thread_base* spawn(F&& f,
+ cancellation_slot parent_cancel_slot = cancellation_slot(),
+ cancellation_state cancel_state = cancellation_state())
+ {
+ return spawn(allocator_arg_t(), boost::context::fixedsize_stack(),
+ static_cast<F&&>(f), parent_cancel_slot, cancel_state);
+ }
+
+ void resume()
+ {
+ callee_ = fiber_type(static_cast<fiber_type&&>(callee_)).resume();
+ if (on_suspend_fn_)
{
+ void (*fn)(void*) = on_suspend_fn_;
+ void* arg = on_suspend_arg_;
+ on_suspend_fn_ = 0;
+ fn(arg);
}
+ }
- void operator()()
+ void suspend_with(void (*fn)(void*), void* arg)
+ {
+ if (throw_if_cancelled_)
+ if (!!cancellation_state_.cancelled())
+ throw_error(asio::error::operation_aborted, "yield");
+ has_context_switched_ = true;
+ on_suspend_fn_ = fn;
+ on_suspend_arg_ = arg;
+ caller_ = fiber_type(static_cast<fiber_type&&>(caller_)).resume();
+ }
+
+ void destroy()
+ {
+ fiber_type callee = static_cast<fiber_type&&>(callee_);
+ if (terminal_)
+ fiber_type(static_cast<fiber_type&&>(callee)).resume();
+ }
+
+private:
+ template <typename Function>
+ class entry_point
+ {
+ public:
+ template <typename F>
+ entry_point(F&& f,
+ spawned_fiber_thread** spawned_thread_out)
+ : function_(static_cast<F&&>(f)),
+ spawned_thread_out_(spawned_thread_out)
{
- *ec_ = asio::error_code();
- if (--*ready_ == 0)
- (*coro_)();
}
- void operator()(asio::error_code ec)
+ fiber_type operator()(fiber_type&& caller)
{
- *ec_ = ec;
- if (--*ready_ == 0)
- (*coro_)();
+ Function function(static_cast<Function&&>(function_));
+ spawned_fiber_thread spawned_thread(
+ static_cast<fiber_type&&>(caller));
+ *spawned_thread_out_ = &spawned_thread;
+ spawned_thread_out_ = 0;
+ spawned_thread.suspend();
+#if !defined(ASIO_NO_EXCEPTIONS)
+ try
+#endif // !defined(ASIO_NO_EXCEPTIONS)
+ {
+ function(&spawned_thread);
+ spawned_thread.terminal_ = true;
+ spawned_thread.suspend();
+ }
+#if !defined(ASIO_NO_EXCEPTIONS)
+ catch (const boost::context::detail::forced_unwind&)
+ {
+ throw;
+ }
+ catch (...)
+ {
+ exception_ptr ex = current_exception();
+ spawned_thread.terminal_ = true;
+ spawned_thread.suspend_with(spawned_thread_rethrow, &ex);
+ }
+#endif // !defined(ASIO_NO_EXCEPTIONS)
+ return static_cast<fiber_type&&>(spawned_thread.caller_);
}
- //private:
- shared_ptr<typename basic_yield_context<Handler>::callee_type> coro_;
- typename basic_yield_context<Handler>::caller_type& ca_;
- Handler handler_;
- atomic_count* ready_;
- asio::error_code* ec_;
+ private:
+ Function function_;
+ spawned_fiber_thread** spawned_thread_out_;
};
- template <typename Handler, typename T>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- coro_handler<Handler, T>* this_handler)
+ fiber_type caller_;
+ fiber_type callee_;
+ void (*on_suspend_fn_)(void*);
+ void* on_suspend_arg_;
+};
+
+#endif // defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+
+#if defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+typedef spawned_fiber_thread default_spawned_thread_type;
+#elif defined(ASIO_HAS_BOOST_COROUTINE)
+typedef spawned_coroutine_thread default_spawned_thread_type;
+#else
+# error No spawn() implementation available
+#endif
+
+// Helper class to perform the initial resume on the correct executor.
+class spawned_thread_resumer
+{
+public:
+ explicit spawned_thread_resumer(spawned_thread_base* spawned_thread)
+ : spawned_thread_(spawned_thread)
{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
}
- template <typename Handler, typename T>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- coro_handler<Handler, T>* this_handler)
+ spawned_thread_resumer(spawned_thread_resumer&& other) noexcept
+ : spawned_thread_(other.spawned_thread_)
{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
+ other.spawned_thread_ = 0;
}
- template <typename Handler, typename T>
- inline bool asio_handler_is_continuation(coro_handler<Handler, T>*)
+ ~spawned_thread_resumer()
{
- return true;
+ if (spawned_thread_)
+ spawned_thread_->destroy();
}
- template <typename Function, typename Handler, typename T>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- coro_handler<Handler, T>* this_handler)
+ void operator()()
+ {
+ spawned_thread_->attach(&spawned_thread_);
+ spawned_thread_->resume();
+ }
+
+private:
+ spawned_thread_base* spawned_thread_;
+};
+
+// Helper class to ensure spawned threads are destroyed on the correct executor.
+class spawned_thread_destroyer
+{
+public:
+ explicit spawned_thread_destroyer(spawned_thread_base* spawned_thread)
+ : spawned_thread_(spawned_thread)
{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
+ spawned_thread->detach();
}
- template <typename Function, typename Handler, typename T>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- coro_handler<Handler, T>* this_handler)
+ spawned_thread_destroyer(spawned_thread_destroyer&& other) noexcept
+ : spawned_thread_(other.spawned_thread_)
{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
+ other.spawned_thread_ = 0;
}
- template <typename Handler, typename T>
- class coro_async_result
+ ~spawned_thread_destroyer()
{
- public:
- typedef coro_handler<Handler, T> completion_handler_type;
- typedef T return_type;
+ if (spawned_thread_)
+ spawned_thread_->destroy();
+ }
- explicit coro_async_result(completion_handler_type& h)
- : handler_(h),
- ca_(h.ca_),
- ready_(2)
+ void operator()()
+ {
+ if (spawned_thread_)
{
- h.ready_ = &ready_;
- out_ec_ = h.ec_;
- if (!out_ec_) h.ec_ = &ec_;
- h.value_ = &value_;
+ spawned_thread_->destroy();
+ spawned_thread_ = 0;
}
+ }
- return_type get()
- {
- // Must not hold shared_ptr to coro while suspended.
- handler_.coro_.reset();
+private:
+ spawned_thread_base* spawned_thread_;
+};
- if (--ready_ != 0)
- ca_();
- if (!out_ec_ && ec_) throw asio::system_error(ec_);
- return ASIO_MOVE_CAST(return_type)(value_);
- }
+// Base class for all completion handlers associated with a spawned thread.
+template <typename Executor>
+class spawn_handler_base
+{
+public:
+ typedef Executor executor_type;
+ typedef cancellation_slot cancellation_slot_type;
- private:
- completion_handler_type& handler_;
- typename basic_yield_context<Handler>::caller_type& ca_;
- atomic_count ready_;
- asio::error_code* out_ec_;
- asio::error_code ec_;
- return_type value_;
- };
+ spawn_handler_base(const basic_yield_context<Executor>& yield)
+ : yield_(yield),
+ spawned_thread_(yield.spawned_thread_)
+ {
+ spawned_thread_->detach();
+ }
+
+ spawn_handler_base(spawn_handler_base&& other) noexcept
+ : yield_(other.yield_),
+ spawned_thread_(other.spawned_thread_)
- template <typename Handler>
- class coro_async_result<Handler, void>
{
- public:
- typedef coro_handler<Handler, void> completion_handler_type;
- typedef void return_type;
+ other.spawned_thread_ = 0;
+ }
- explicit coro_async_result(completion_handler_type& h)
- : handler_(h),
- ca_(h.ca_),
- ready_(2)
- {
- h.ready_ = &ready_;
- out_ec_ = h.ec_;
- if (!out_ec_) h.ec_ = &ec_;
- }
+ ~spawn_handler_base()
+ {
+ if (spawned_thread_)
+ (post)(yield_.executor_, spawned_thread_destroyer(spawned_thread_));
+ }
- void get()
- {
- // Must not hold shared_ptr to coro while suspended.
- handler_.coro_.reset();
+ executor_type get_executor() const noexcept
+ {
+ return yield_.executor_;
+ }
- if (--ready_ != 0)
- ca_();
- if (!out_ec_ && ec_) throw asio::system_error(ec_);
- }
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return spawned_thread_->get_cancellation_slot();
+ }
- private:
- completion_handler_type& handler_;
- typename basic_yield_context<Handler>::caller_type& ca_;
- atomic_count ready_;
- asio::error_code* out_ec_;
- asio::error_code ec_;
- };
+ void resume()
+ {
+ spawned_thread_resumer resumer(spawned_thread_);
+ spawned_thread_ = 0;
+ resumer();
+ }
-} // namespace detail
+protected:
+ const basic_yield_context<Executor>& yield_;
+ spawned_thread_base* spawned_thread_;
+};
-#if !defined(GENERATING_DOCUMENTATION)
+// Completion handlers for when basic_yield_context is used as a token.
+template <typename Executor, typename Signature>
+class spawn_handler;
-template <typename Handler, typename ReturnType>
-class async_result<basic_yield_context<Handler>, ReturnType()>
- : public detail::coro_async_result<Handler, void>
+template <typename Executor, typename R>
+class spawn_handler<Executor, R()>
+ : public spawn_handler_base<Executor>
{
public:
- explicit async_result(
- typename detail::coro_async_result<Handler,
- void>::completion_handler_type& h)
- : detail::coro_async_result<Handler, void>(h)
+ typedef void return_type;
+
+ struct result_type {};
+
+ spawn_handler(const basic_yield_context<Executor>& yield, result_type&)
+ : spawn_handler_base<Executor>(yield)
+ {
+ }
+
+ void operator()()
+ {
+ this->resume();
+ }
+
+ static return_type on_resume(result_type&)
{
}
};
-template <typename Handler, typename ReturnType, typename Arg1>
-class async_result<basic_yield_context<Handler>, ReturnType(Arg1)>
- : public detail::coro_async_result<Handler, typename decay<Arg1>::type>
+template <typename Executor, typename R>
+class spawn_handler<Executor, R(asio::error_code)>
+ : public spawn_handler_base<Executor>
{
public:
- explicit async_result(
- typename detail::coro_async_result<Handler,
- typename decay<Arg1>::type>::completion_handler_type& h)
- : detail::coro_async_result<Handler, typename decay<Arg1>::type>(h)
+ typedef void return_type;
+ typedef asio::error_code* result_type;
+
+ spawn_handler(const basic_yield_context<Executor>& yield, result_type& result)
+ : spawn_handler_base<Executor>(yield),
+ result_(result)
+ {
+ }
+
+ void operator()(asio::error_code ec)
+ {
+ if (this->yield_.ec_)
+ {
+ *this->yield_.ec_ = ec;
+ result_ = 0;
+ }
+ else
+ result_ = &ec;
+ this->resume();
+ }
+
+ static return_type on_resume(result_type& result)
{
+ if (result)
+ throw_error(*result);
}
+
+private:
+ result_type& result_;
};
-template <typename Handler, typename ReturnType>
-class async_result<basic_yield_context<Handler>,
- ReturnType(asio::error_code)>
- : public detail::coro_async_result<Handler, void>
+template <typename Executor, typename R>
+class spawn_handler<Executor, R(exception_ptr)>
+ : public spawn_handler_base<Executor>
{
public:
- explicit async_result(
- typename detail::coro_async_result<Handler,
- void>::completion_handler_type& h)
- : detail::coro_async_result<Handler, void>(h)
+ typedef void return_type;
+ typedef exception_ptr* result_type;
+
+ spawn_handler(const basic_yield_context<Executor>& yield, result_type& result)
+ : spawn_handler_base<Executor>(yield),
+ result_(result)
+ {
+ }
+
+ void operator()(exception_ptr ex)
{
+ result_ = &ex;
+ this->resume();
}
+
+ static return_type on_resume(result_type& result)
+ {
+ if (*result)
+ rethrow_exception(*result);
+ }
+
+private:
+ result_type& result_;
};
-template <typename Handler, typename ReturnType, typename Arg2>
-class async_result<basic_yield_context<Handler>,
- ReturnType(asio::error_code, Arg2)>
- : public detail::coro_async_result<Handler, typename decay<Arg2>::type>
+template <typename Executor, typename R, typename T>
+class spawn_handler<Executor, R(T)>
+ : public spawn_handler_base<Executor>
{
public:
- explicit async_result(
- typename detail::coro_async_result<Handler,
- typename decay<Arg2>::type>::completion_handler_type& h)
- : detail::coro_async_result<Handler, typename decay<Arg2>::type>(h)
+ typedef T return_type;
+ typedef return_type* result_type;
+
+ spawn_handler(const basic_yield_context<Executor>& yield, result_type& result)
+ : spawn_handler_base<Executor>(yield),
+ result_(result)
{
}
-};
-template <template <typename, typename> class Associator,
- typename Handler, typename T, typename DefaultCandidate>
-struct associator<Associator,
- detail::coro_handler<Handler, T>,
- DefaultCandidate>
- : Associator<Handler, DefaultCandidate>
-{
- static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::coro_handler<Handler, T>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ void operator()(T value)
{
- return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ result_ = &value;
+ this->resume();
}
+
+ static return_type on_resume(result_type& result)
+ {
+ return static_cast<return_type&&>(*result);
+ }
+
+private:
+ result_type& result_;
};
-namespace detail {
+template <typename Executor, typename R, typename T>
+class spawn_handler<Executor, R(asio::error_code, T)>
+ : public spawn_handler_base<Executor>
+{
+public:
+ typedef T return_type;
+
+ struct result_type
+ {
+ asio::error_code* ec_;
+ return_type* value_;
+ };
- template <typename Handler, typename Function>
- struct spawn_data : private noncopyable
+ spawn_handler(const basic_yield_context<Executor>& yield, result_type& result)
+ : spawn_handler_base<Executor>(yield),
+ result_(result)
{
- template <typename Hand, typename Func>
- spawn_data(ASIO_MOVE_ARG(Hand) handler,
- bool call_handler, ASIO_MOVE_ARG(Func) function)
- : handler_(ASIO_MOVE_CAST(Hand)(handler)),
- call_handler_(call_handler),
- function_(ASIO_MOVE_CAST(Func)(function))
+ }
+
+ void operator()(asio::error_code ec, T value)
+ {
+ if (this->yield_.ec_)
{
+ *this->yield_.ec_ = ec;
+ result_.ec_ = 0;
}
+ else
+ result_.ec_ = &ec;
+ result_.value_ = &value;
+ this->resume();
+ }
- weak_ptr<typename basic_yield_context<Handler>::callee_type> coro_;
- Handler handler_;
- bool call_handler_;
- Function function_;
+ static return_type on_resume(result_type& result)
+ {
+ if (result.ec_)
+ throw_error(*result.ec_);
+ return static_cast<return_type&&>(*result.value_);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename Executor, typename R, typename T>
+class spawn_handler<Executor, R(exception_ptr, T)>
+ : public spawn_handler_base<Executor>
+{
+public:
+ typedef T return_type;
+
+ struct result_type
+ {
+ exception_ptr* ex_;
+ return_type* value_;
};
- template <typename Handler, typename Function>
- struct coro_entry_point
+ spawn_handler(const basic_yield_context<Executor>& yield, result_type& result)
+ : spawn_handler_base<Executor>(yield),
+ result_(result)
+ {
+ }
+
+ void operator()(exception_ptr ex, T value)
{
- void operator()(typename basic_yield_context<Handler>::caller_type& ca)
+ result_.ex_ = &ex;
+ result_.value_ = &value;
+ this->resume();
+ }
+
+ static return_type on_resume(result_type& result)
+ {
+ if (*result.ex_)
+ rethrow_exception(*result.ex_);
+ return static_cast<return_type&&>(*result.value_);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename Executor, typename R, typename... Ts>
+class spawn_handler<Executor, R(Ts...)>
+ : public spawn_handler_base<Executor>
+{
+public:
+ typedef std::tuple<Ts...> return_type;
+
+ typedef return_type* result_type;
+
+ spawn_handler(const basic_yield_context<Executor>& yield, result_type& result)
+ : spawn_handler_base<Executor>(yield),
+ result_(result)
+ {
+ }
+
+ template <typename... Args>
+ void operator()(Args&&... args)
+ {
+ return_type value(static_cast<Args&&>(args)...);
+ result_ = &value;
+ this->resume();
+ }
+
+ static return_type on_resume(result_type& result)
+ {
+ return static_cast<return_type&&>(*result);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename Executor, typename R, typename... Ts>
+class spawn_handler<Executor, R(asio::error_code, Ts...)>
+ : public spawn_handler_base<Executor>
+{
+public:
+ typedef std::tuple<Ts...> return_type;
+
+ struct result_type
+ {
+ asio::error_code* ec_;
+ return_type* value_;
+ };
+
+ spawn_handler(const basic_yield_context<Executor>& yield, result_type& result)
+ : spawn_handler_base<Executor>(yield),
+ result_(result)
+ {
+ }
+
+ template <typename... Args>
+ void operator()(asio::error_code ec,
+ Args&&... args)
+ {
+ return_type value(static_cast<Args&&>(args)...);
+ if (this->yield_.ec_)
{
- shared_ptr<spawn_data<Handler, Function> > data(data_);
-#if !defined(BOOST_COROUTINES_UNIDIRECT) && !defined(BOOST_COROUTINES_V2)
- ca(); // Yield until coroutine pointer has been initialised.
-#endif // !defined(BOOST_COROUTINES_UNIDIRECT) && !defined(BOOST_COROUTINES_V2)
- const basic_yield_context<Handler> yield(
- data->coro_, ca, data->handler_);
-
- (data->function_)(yield);
- if (data->call_handler_)
- ASIO_MOVE_OR_LVALUE(Handler)(data->handler_)();
+ *this->yield_.ec_ = ec;
+ result_.ec_ = 0;
}
+ else
+ result_.ec_ = &ec;
+ result_.value_ = &value;
+ this->resume();
+ }
- shared_ptr<spawn_data<Handler, Function> > data_;
+ static return_type on_resume(result_type& result)
+ {
+ if (result.ec_)
+ throw_error(*result.ec_);
+ return static_cast<return_type&&>(*result.value_);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename Executor, typename R, typename... Ts>
+class spawn_handler<Executor, R(exception_ptr, Ts...)>
+ : public spawn_handler_base<Executor>
+{
+public:
+ typedef std::tuple<Ts...> return_type;
+
+ struct result_type
+ {
+ exception_ptr* ex_;
+ return_type* value_;
};
- template <typename Handler, typename Function>
- struct spawn_helper
+ spawn_handler(const basic_yield_context<Executor>& yield, result_type& result)
+ : spawn_handler_base<Executor>(yield),
+ result_(result)
+ {
+ }
+
+ template <typename... Args>
+ void operator()(exception_ptr ex, Args&&... args)
+ {
+ return_type value(static_cast<Args&&>(args)...);
+ result_.ex_ = &ex;
+ result_.value_ = &value;
+ this->resume();
+ }
+
+ static return_type on_resume(result_type& result)
{
- typedef typename associated_allocator<Handler>::type allocator_type;
+ if (*result.ex_)
+ rethrow_exception(*result.ex_);
+ return static_cast<return_type&&>(*result.value_);
+ }
+
+private:
+ result_type& result_;
+};
+
+template <typename Executor, typename Signature>
+inline bool asio_handler_is_continuation(spawn_handler<Executor, Signature>*)
+{
+ return true;
+}
+
+} // namespace detail
- allocator_type get_allocator() const ASIO_NOEXCEPT
+template <typename Executor, typename Signature>
+class async_result<basic_yield_context<Executor>, Signature>
+{
+public:
+ typedef typename detail::spawn_handler<Executor, Signature> handler_type;
+ typedef typename handler_type::return_type return_type;
+
+#if defined(ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
+
+ template <typename Initiation, typename... InitArgs>
+ static return_type initiate(Initiation&& init,
+ const basic_yield_context<Executor>& yield,
+ InitArgs&&... init_args)
+ {
+ typename handler_type::result_type result
+ = typename handler_type::result_type();
+
+ yield.spawned_thread_->suspend_with(
+ [&]()
+ {
+ static_cast<Initiation&&>(init)(
+ handler_type(yield, result),
+ static_cast<InitArgs&&>(init_args)...);
+ });
+
+ return handler_type::on_resume(result);
+ }
+
+#else // defined(ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
+
+ template <typename Initiation, typename... InitArgs>
+ struct suspend_with_helper
+ {
+ typename handler_type::result_type& result_;
+ Initiation&& init_;
+ const basic_yield_context<Executor>& yield_;
+ std::tuple<InitArgs&&...> init_args_;
+
+ template <std::size_t... I>
+ void do_invoke(detail::index_sequence<I...>)
{
- return (get_associated_allocator)(data_->handler_);
+ static_cast<Initiation&&>(init_)(
+ handler_type(yield_, result_),
+ static_cast<InitArgs&&>(std::get<I>(init_args_))...);
}
- typedef typename associated_executor<Handler>::type executor_type;
+ void operator()()
+ {
+ this->do_invoke(detail::make_index_sequence<sizeof...(InitArgs)>());
+ }
+ };
+
+ template <typename Initiation, typename... InitArgs>
+ static return_type initiate(Initiation&& init,
+ const basic_yield_context<Executor>& yield,
+ InitArgs&&... init_args)
+ {
+ typename handler_type::result_type result
+ = typename handler_type::result_type();
+
+ yield.spawned_thread_->suspend_with(
+ suspend_with_helper<Initiation, InitArgs...>{
+ result, static_cast<Initiation&&>(init), yield,
+ std::tuple<InitArgs&&...>(
+ static_cast<InitArgs&&>(init_args)...)});
+
+ return handler_type::on_resume(result);
+ }
+
+#endif // defined(ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
+};
+
+namespace detail {
- executor_type get_executor() const ASIO_NOEXCEPT
+template <typename Executor, typename Function, typename Handler>
+class spawn_entry_point
+{
+public:
+ template <typename F, typename H>
+ spawn_entry_point(const Executor& ex,
+ F&& f, H&& h)
+ : executor_(ex),
+ function_(static_cast<F&&>(f)),
+ handler_(static_cast<H&&>(h)),
+ work_(handler_, executor_)
+ {
+ }
+
+ void operator()(spawned_thread_base* spawned_thread)
+ {
+ const basic_yield_context<Executor> yield(spawned_thread, executor_);
+ this->call(yield,
+ void_type<result_of_t<Function(basic_yield_context<Executor>)>>());
+ }
+
+private:
+ void call(const basic_yield_context<Executor>& yield, void_type<void>)
+ {
+#if !defined(ASIO_NO_EXCEPTIONS)
+ try
+#endif // !defined(ASIO_NO_EXCEPTIONS)
+ {
+ function_(yield);
+ if (!yield.spawned_thread_->has_context_switched())
+ (post)(yield);
+ detail::binder1<Handler, exception_ptr>
+ handler(handler_, exception_ptr());
+ work_.complete(handler, handler.handler_);
+ }
+#if !defined(ASIO_NO_EXCEPTIONS)
+# if defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+ catch (const boost::context::detail::forced_unwind&)
{
- return (get_associated_executor)(data_->handler_);
+ throw;
}
+# endif // defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+# if defined(ASIO_HAS_BOOST_COROUTINE)
+ catch (const boost::coroutines::detail::forced_unwind&)
+ {
+ throw;
+ }
+# endif // defined(ASIO_HAS_BOOST_COROUTINE)
+ catch (...)
+ {
+ exception_ptr ex = current_exception();
+ if (!yield.spawned_thread_->has_context_switched())
+ (post)(yield);
+ detail::binder1<Handler, exception_ptr> handler(handler_, ex);
+ work_.complete(handler, handler.handler_);
+ }
+#endif // !defined(ASIO_NO_EXCEPTIONS)
+ }
- void operator()()
+ template <typename T>
+ void call(const basic_yield_context<Executor>& yield, void_type<T>)
+ {
+#if !defined(ASIO_NO_EXCEPTIONS)
+ try
+#endif // !defined(ASIO_NO_EXCEPTIONS)
+ {
+ T result(function_(yield));
+ if (!yield.spawned_thread_->has_context_switched())
+ (post)(yield);
+ detail::binder2<Handler, exception_ptr, T>
+ handler(handler_, exception_ptr(), static_cast<T&&>(result));
+ work_.complete(handler, handler.handler_);
+ }
+#if !defined(ASIO_NO_EXCEPTIONS)
+# if defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+ catch (const boost::context::detail::forced_unwind&)
+ {
+ throw;
+ }
+# endif // defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+# if defined(ASIO_HAS_BOOST_COROUTINE)
+ catch (const boost::coroutines::detail::forced_unwind&)
{
- typedef typename basic_yield_context<Handler>::callee_type callee_type;
- coro_entry_point<Handler, Function> entry_point = { data_ };
- shared_ptr<callee_type> coro(new callee_type(entry_point, attributes_));
- data_->coro_ = coro;
- (*coro)();
+ throw;
}
+# endif // defined(ASIO_HAS_BOOST_COROUTINE)
+ catch (...)
+ {
+ exception_ptr ex = current_exception();
+ if (!yield.spawned_thread_->has_context_switched())
+ (post)(yield);
+ detail::binder2<Handler, exception_ptr, T> handler(handler_, ex, T());
+ work_.complete(handler, handler.handler_);
+ }
+#endif // !defined(ASIO_NO_EXCEPTIONS)
+ }
- shared_ptr<spawn_data<Handler, Function> > data_;
- boost::coroutines::attributes attributes_;
- };
+ Executor executor_;
+ Function function_;
+ Handler handler_;
+ handler_work<Handler, Executor> work_;
+};
+
+struct spawn_cancellation_signal_emitter
+{
+ cancellation_signal* signal_;
+ cancellation_type_t type_;
+
+ void operator()()
+ {
+ signal_->emit(type_);
+ }
+};
- template <typename Function, typename Handler, typename Function1>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- spawn_helper<Handler, Function1>* this_handler)
+template <typename Handler, typename Executor, typename = void>
+class spawn_cancellation_handler
+{
+public:
+ spawn_cancellation_handler(const Handler&, const Executor& ex)
+ : ex_(ex)
+ {
+ }
+
+ cancellation_slot slot()
+ {
+ return signal_.slot();
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ spawn_cancellation_signal_emitter emitter = { &signal_, type };
+ (dispatch)(ex_, emitter);
+ }
+
+private:
+ cancellation_signal signal_;
+ Executor ex_;
+};
+
+
+template <typename Handler, typename Executor>
+class spawn_cancellation_handler<Handler, Executor,
+ enable_if_t<
+ is_same<
+ typename associated_executor<Handler,
+ Executor>::asio_associated_executor_is_unspecialised,
+ void
+ >::value
+ >>
+{
+public:
+ spawn_cancellation_handler(const Handler&, const Executor&)
+ {
+ }
+
+ cancellation_slot slot()
+ {
+ return signal_.slot();
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ signal_.emit(type);
+ }
+
+private:
+ cancellation_signal signal_;
+};
+
+template <typename Executor>
+class initiate_spawn
+{
+public:
+ typedef Executor executor_type;
+
+ explicit initiate_spawn(const executor_type& ex)
+ : executor_(ex)
+ {
+ }
+
+ executor_type get_executor() const noexcept
{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->data_->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
+ return executor_;
}
- template <typename Function, typename Handler, typename Function1>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- spawn_helper<Handler, Function1>* this_handler)
+ template <typename Handler, typename F>
+ void operator()(Handler&& handler,
+ F&& f) const
{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->data_->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
+ typedef decay_t<Handler> handler_type;
+ typedef decay_t<F> function_type;
+ typedef spawn_cancellation_handler<
+ handler_type, Executor> cancel_handler_type;
+
+ associated_cancellation_slot_t<handler_type> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ cancel_handler_type* cancel_handler = slot.is_connected()
+ ? &slot.template emplace<cancel_handler_type>(handler, executor_)
+ : 0;
+
+ cancellation_slot proxy_slot(
+ cancel_handler
+ ? cancel_handler->slot()
+ : cancellation_slot());
+
+ cancellation_state cancel_state(proxy_slot);
+
+ (dispatch)(executor_,
+ spawned_thread_resumer(
+ default_spawned_thread_type::spawn(
+ spawn_entry_point<Executor, function_type, handler_type>(
+ executor_, static_cast<F&&>(f),
+ static_cast<Handler&&>(handler)),
+ proxy_slot, cancel_state)));
}
- inline void default_spawn_handler() {}
+#if defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+
+ template <typename Handler, typename StackAllocator, typename F>
+ void operator()(Handler&& handler, allocator_arg_t,
+ StackAllocator&& stack_allocator,
+ F&& f) const
+ {
+ typedef decay_t<Handler> handler_type;
+ typedef decay_t<F> function_type;
+ typedef spawn_cancellation_handler<
+ handler_type, Executor> cancel_handler_type;
+
+ associated_cancellation_slot_t<handler_type> slot
+ = asio::get_associated_cancellation_slot(handler);
+
+ cancel_handler_type* cancel_handler = slot.is_connected()
+ ? &slot.template emplace<cancel_handler_type>(handler, executor_)
+ : 0;
+
+ cancellation_slot proxy_slot(
+ cancel_handler
+ ? cancel_handler->slot()
+ : cancellation_slot());
+
+ cancellation_state cancel_state(proxy_slot);
+
+ (dispatch)(executor_,
+ spawned_thread_resumer(
+ spawned_fiber_thread::spawn(allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ spawn_entry_point<Executor, function_type, handler_type>(
+ executor_, static_cast<F&&>(f),
+ static_cast<Handler&&>(handler)),
+ proxy_slot, cancel_state)));
+ }
+
+#endif // defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+
+private:
+ executor_type executor_;
+};
+
+} // namespace detail
+
+template <typename Executor, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type) CompletionToken>
+inline auto spawn(const Executor& ex, F&& function, CompletionToken&& token,
+#if defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ !is_same<
+ decay_t<CompletionToken>,
+ boost::coroutines::attributes
+ >::value
+ >,
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ >)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ declval<detail::initiate_spawn<Executor>>(),
+ token, static_cast<F&&>(function)))
+{
+ return async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ detail::initiate_spawn<Executor>(ex),
+ token, static_cast<F&&>(function));
+}
+
+template <typename ExecutionContext, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<
+ typename ExecutionContext::executor_type>)>>::type) CompletionToken>
+inline auto spawn(ExecutionContext& ctx, F&& function, CompletionToken&& token,
+#if defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ !is_same<
+ decay_t<CompletionToken>,
+ boost::coroutines::attributes
+ >::value
+ >,
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ >)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<
+ typename ExecutionContext::executor_type>)>>::type>(
+ declval<detail::initiate_spawn<
+ typename ExecutionContext::executor_type>>(),
+ token, static_cast<F&&>(function)))
+{
+ return (spawn)(ctx.get_executor(), static_cast<F&&>(function),
+ static_cast<CompletionToken&&>(token));
+}
+
+template <typename Executor, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type)
+ CompletionToken>
+inline auto spawn(const basic_yield_context<Executor>& ctx,
+ F&& function, CompletionToken&& token,
+#if defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ !is_same<
+ decay_t<CompletionToken>,
+ boost::coroutines::attributes
+ >::value
+ >,
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ >)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ declval<detail::initiate_spawn<Executor>>(),
+ token, static_cast<F&&>(function)))
+{
+ return (spawn)(ctx.get_executor(), static_cast<F&&>(function),
+ static_cast<CompletionToken&&>(token));
+}
+
+#if defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+
+template <typename Executor, typename StackAllocator, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type)
+ CompletionToken>
+inline auto spawn(const Executor& ex, allocator_arg_t,
+ StackAllocator&& stack_allocator, F&& function, CompletionToken&& token,
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ >)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ declval<detail::initiate_spawn<Executor>>(),
+ token, allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ static_cast<F&&>(function)))
+{
+ return async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ detail::initiate_spawn<Executor>(ex), token, allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ static_cast<F&&>(function));
+}
+
+template <typename ExecutionContext, typename StackAllocator, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<
+ typename ExecutionContext::executor_type>)>>::type) CompletionToken>
+inline auto spawn(ExecutionContext& ctx, allocator_arg_t,
+ StackAllocator&& stack_allocator, F&& function, CompletionToken&& token,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ >)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<
+ typename ExecutionContext::executor_type>)>>::type>(
+ declval<detail::initiate_spawn<
+ typename ExecutionContext::executor_type>>(),
+ token, allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ static_cast<F&&>(function)))
+{
+ return (spawn)(ctx.get_executor(), allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ static_cast<F&&>(function), static_cast<CompletionToken&&>(token));
+}
+
+template <typename Executor, typename StackAllocator, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type) CompletionToken>
+inline auto spawn(const basic_yield_context<Executor>& ctx, allocator_arg_t,
+ StackAllocator&& stack_allocator, F&& function, CompletionToken&& token,
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ >)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ declval<detail::initiate_spawn<Executor>>(), token,
+ allocator_arg_t(), static_cast<StackAllocator&&>(stack_allocator),
+ static_cast<F&&>(function)))
+{
+ return (spawn)(ctx.get_executor(), allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ static_cast<F&&>(function), static_cast<CompletionToken&&>(token));
+}
+
+#endif // defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+
+#if defined(ASIO_HAS_BOOST_COROUTINE)
+
+namespace detail {
+
+template <typename Executor, typename Function, typename Handler>
+class old_spawn_entry_point
+{
+public:
+ template <typename F, typename H>
+ old_spawn_entry_point(const Executor& ex, F&& f, H&& h)
+ : executor_(ex),
+ function_(static_cast<F&&>(f)),
+ handler_(static_cast<H&&>(h))
+ {
+ }
+
+ void operator()(spawned_thread_base* spawned_thread)
+ {
+ const basic_yield_context<Executor> yield(spawned_thread, executor_);
+ this->call(yield,
+ void_type<result_of_t<Function(basic_yield_context<Executor>)>>());
+ }
+
+private:
+ void call(const basic_yield_context<Executor>& yield, void_type<void>)
+ {
+ function_(yield);
+ static_cast<Handler&&>(handler_)();
+ }
+
+ template <typename T>
+ void call(const basic_yield_context<Executor>& yield, void_type<T>)
+ {
+ static_cast<Handler&&>(handler_)(function_(yield));
+ }
+
+ Executor executor_;
+ Function function_;
+ Handler handler_;
+};
+
+inline void default_spawn_handler() {}
} // namespace detail
template <typename Function>
-inline void spawn(ASIO_MOVE_ARG(Function) function,
+inline void spawn(Function&& function,
const boost::coroutines::attributes& attributes)
{
- typedef typename decay<Function>::type function_type;
-
- typename associated_executor<function_type>::type ex(
+ associated_executor_t<decay_t<Function>> ex(
(get_associated_executor)(function));
- asio::spawn(ex, ASIO_MOVE_CAST(Function)(function), attributes);
+ asio::spawn(ex, static_cast<Function&&>(function), attributes);
}
template <typename Handler, typename Function>
-void spawn(ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Function) function,
+void spawn(Handler&& handler, Function&& function,
const boost::coroutines::attributes& attributes,
- typename constraint<
- !is_executor<typename decay<Handler>::type>::value &&
- !execution::is_executor<typename decay<Handler>::type>::value &&
- !is_convertible<Handler&, execution_context&>::value>::type)
-{
- typedef typename decay<Handler>::type handler_type;
- typedef typename decay<Function>::type function_type;
-
- detail::spawn_helper<handler_type, function_type> helper;
- helper.data_.reset(
- new detail::spawn_data<handler_type, function_type>(
- ASIO_MOVE_CAST(Handler)(handler), true,
- ASIO_MOVE_CAST(Function)(function)));
- helper.attributes_ = attributes;
-
- asio::dispatch(helper);
+ constraint_t<
+ !is_executor<decay_t<Handler>>::value &&
+ !execution::is_executor<decay_t<Handler>>::value &&
+ !is_convertible<Handler&, execution_context&>::value>)
+{
+ typedef associated_executor_t<decay_t<Handler>> executor_type;
+ executor_type ex((get_associated_executor)(handler));
+
+ (dispatch)(ex,
+ detail::spawned_thread_resumer(
+ detail::spawned_coroutine_thread::spawn(
+ detail::old_spawn_entry_point<executor_type,
+ decay_t<Function>, void (*)()>(
+ ex, static_cast<Function&&>(function),
+ &detail::default_spawn_handler), attributes)));
}
-template <typename Handler, typename Function>
-void spawn(basic_yield_context<Handler> ctx,
- ASIO_MOVE_ARG(Function) function,
+template <typename Executor, typename Function>
+void spawn(basic_yield_context<Executor> ctx, Function&& function,
const boost::coroutines::attributes& attributes)
{
- typedef typename decay<Function>::type function_type;
-
- Handler handler(ctx.handler_); // Explicit copy that might be moved from.
-
- detail::spawn_helper<Handler, function_type> helper;
- helper.data_.reset(
- new detail::spawn_data<Handler, function_type>(
- ASIO_MOVE_CAST(Handler)(handler), false,
- ASIO_MOVE_CAST(Function)(function)));
- helper.attributes_ = attributes;
-
- asio::dispatch(helper);
+ (dispatch)(ctx.get_executor(),
+ detail::spawned_thread_resumer(
+ detail::spawned_coroutine_thread::spawn(
+ detail::old_spawn_entry_point<Executor,
+ decay_t<Function>, void (*)()>(
+ ctx.get_executor(), static_cast<Function&&>(function),
+ &detail::default_spawn_handler), attributes)));
}
template <typename Function, typename Executor>
-inline void spawn(const Executor& ex,
- ASIO_MOVE_ARG(Function) function,
+inline void spawn(const Executor& ex, Function&& function,
const boost::coroutines::attributes& attributes,
- typename constraint<
+ constraint_t<
is_executor<Executor>::value || execution::is_executor<Executor>::value
- >::type)
+ >)
{
asio::spawn(asio::strand<Executor>(ex),
- ASIO_MOVE_CAST(Function)(function), attributes);
+ static_cast<Function&&>(function), attributes);
}
template <typename Function, typename Executor>
-inline void spawn(const strand<Executor>& ex,
- ASIO_MOVE_ARG(Function) function,
+inline void spawn(const strand<Executor>& ex, Function&& function,
const boost::coroutines::attributes& attributes)
{
asio::spawn(asio::bind_executor(
ex, &detail::default_spawn_handler),
- ASIO_MOVE_CAST(Function)(function), attributes);
+ static_cast<Function&&>(function), attributes);
}
#if !defined(ASIO_NO_TS_EXECUTORS)
template <typename Function>
-inline void spawn(const asio::io_context::strand& s,
- ASIO_MOVE_ARG(Function) function,
+inline void spawn(const asio::io_context::strand& s, Function&& function,
const boost::coroutines::attributes& attributes)
{
asio::spawn(asio::bind_executor(
s, &detail::default_spawn_handler),
- ASIO_MOVE_CAST(Function)(function), attributes);
+ static_cast<Function&&>(function), attributes);
}
#endif // !defined(ASIO_NO_TS_EXECUTORS)
template <typename Function, typename ExecutionContext>
-inline void spawn(ExecutionContext& ctx,
- ASIO_MOVE_ARG(Function) function,
+inline void spawn(ExecutionContext& ctx, Function&& function,
const boost::coroutines::attributes& attributes,
- typename constraint<is_convertible<
- ExecutionContext&, execution_context&>::value>::type)
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ >)
{
asio::spawn(ctx.get_executor(),
- ASIO_MOVE_CAST(Function)(function), attributes);
+ static_cast<Function&&>(function), attributes);
}
-#endif // !defined(GENERATING_DOCUMENTATION)
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
} // namespace asio
diff --git a/3rdparty/asio/include/asio/impl/src.hpp b/3rdparty/asio/include/asio/impl/src.hpp
index 14ca9c252f4..28396195b06 100644
--- a/3rdparty/asio/include/asio/impl/src.hpp
+++ b/3rdparty/asio/include/asio/impl/src.hpp
@@ -2,7 +2,7 @@
// impl/src.hpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,11 +19,14 @@
# error Do not compile Asio library source with ASIO_HEADER_ONLY defined
#endif
+#include "asio/impl/any_completion_executor.ipp"
+#include "asio/impl/any_io_executor.ipp"
+#include "asio/impl/cancellation_signal.ipp"
+#include "asio/impl/connect_pipe.ipp"
#include "asio/impl/error.ipp"
#include "asio/impl/error_code.ipp"
#include "asio/impl/execution_context.ipp"
#include "asio/impl/executor.ipp"
-#include "asio/impl/handler_alloc_hook.ipp"
#include "asio/impl/io_context.ipp"
#include "asio/impl/multiple_exceptions.ipp"
#include "asio/impl/serial_port_base.ipp"
@@ -35,15 +38,19 @@
#include "asio/detail/impl/epoll_reactor.ipp"
#include "asio/detail/impl/eventfd_select_interrupter.ipp"
#include "asio/detail/impl/handler_tracking.ipp"
+#include "asio/detail/impl/io_uring_descriptor_service.ipp"
+#include "asio/detail/impl/io_uring_file_service.ipp"
+#include "asio/detail/impl/io_uring_socket_service_base.ipp"
+#include "asio/detail/impl/io_uring_service.ipp"
#include "asio/detail/impl/kqueue_reactor.ipp"
#include "asio/detail/impl/null_event.ipp"
#include "asio/detail/impl/pipe_select_interrupter.ipp"
#include "asio/detail/impl/posix_event.ipp"
#include "asio/detail/impl/posix_mutex.ipp"
+#include "asio/detail/impl/posix_serial_port_service.ipp"
#include "asio/detail/impl/posix_thread.ipp"
#include "asio/detail/impl/posix_tss_ptr.ipp"
#include "asio/detail/impl/reactive_descriptor_service.ipp"
-#include "asio/detail/impl/reactive_serial_port_service.ipp"
#include "asio/detail/impl/reactive_socket_service_base.ipp"
#include "asio/detail/impl/resolver_service_base.ipp"
#include "asio/detail/impl/scheduler.ipp"
@@ -58,6 +65,7 @@
#include "asio/detail/impl/throw_error.ipp"
#include "asio/detail/impl/timer_queue_ptime.ipp"
#include "asio/detail/impl/timer_queue_set.ipp"
+#include "asio/detail/impl/win_iocp_file_service.ipp"
#include "asio/detail/impl/win_iocp_handle_service.ipp"
#include "asio/detail/impl/win_iocp_io_context.ipp"
#include "asio/detail/impl/win_iocp_serial_port_service.ipp"
@@ -72,7 +80,7 @@
#include "asio/detail/impl/winrt_timer_scheduler.ipp"
#include "asio/detail/impl/winsock_init.ipp"
#include "asio/execution/impl/bad_executor.ipp"
-#include "asio/execution/impl/receiver_invocation_error.ipp"
+#include "asio/experimental/impl/channel_error.ipp"
#include "asio/generic/detail/impl/endpoint.ipp"
#include "asio/ip/impl/address.ipp"
#include "asio/ip/impl/address_v4.ipp"
diff --git a/3rdparty/asio/include/asio/impl/system_context.hpp b/3rdparty/asio/include/asio/impl/system_context.hpp
index 650b0ca57dc..34b5a3a0659 100644
--- a/3rdparty/asio/include/asio/impl/system_context.hpp
+++ b/3rdparty/asio/include/asio/impl/system_context.hpp
@@ -2,7 +2,7 @@
// impl/system_context.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,7 +22,7 @@
namespace asio {
inline system_context::executor_type
-system_context::get_executor() ASIO_NOEXCEPT
+system_context::get_executor() noexcept
{
return system_executor();
}
diff --git a/3rdparty/asio/include/asio/impl/system_context.ipp b/3rdparty/asio/include/asio/impl/system_context.ipp
index d12c5747277..95fda4804da 100644
--- a/3rdparty/asio/include/asio/impl/system_context.ipp
+++ b/3rdparty/asio/include/asio/impl/system_context.ipp
@@ -2,7 +2,7 @@
// impl/system_context.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -67,7 +67,7 @@ void system_context::stop()
scheduler_.stop();
}
-bool system_context::stopped() const ASIO_NOEXCEPT
+bool system_context::stopped() const noexcept
{
return scheduler_.stopped();
}
diff --git a/3rdparty/asio/include/asio/impl/system_executor.hpp b/3rdparty/asio/include/asio/impl/system_executor.hpp
index bee9e9ee8c9..099b2d63ef2 100644
--- a/3rdparty/asio/include/asio/impl/system_executor.hpp
+++ b/3rdparty/asio/include/asio/impl/system_executor.hpp
@@ -2,7 +2,7 @@
// impl/system_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -27,7 +27,7 @@ namespace asio {
template <typename Blocking, typename Relationship, typename Allocator>
inline system_context&
basic_system_executor<Blocking, Relationship, Allocator>::query(
- execution::context_t) ASIO_NOEXCEPT
+ execution::context_t) noexcept
{
return detail::global<system_context>();
}
@@ -35,7 +35,7 @@ basic_system_executor<Blocking, Relationship, Allocator>::query(
template <typename Blocking, typename Relationship, typename Allocator>
inline std::size_t
basic_system_executor<Blocking, Relationship, Allocator>::query(
- execution::occupancy_t) const ASIO_NOEXCEPT
+ execution::occupancy_t) const noexcept
{
return detail::global<system_context>().num_threads_;
}
@@ -44,7 +44,7 @@ template <typename Blocking, typename Relationship, typename Allocator>
template <typename Function>
inline void
basic_system_executor<Blocking, Relationship, Allocator>::do_execute(
- ASIO_MOVE_ARG(Function) f, execution::blocking_t::possibly_t) const
+ Function&& f, execution::blocking_t::possibly_t) const
{
// Obtain a non-const instance of the function.
detail::non_const_lvalue<Function> f2(f);
@@ -54,7 +54,7 @@ basic_system_executor<Blocking, Relationship, Allocator>::do_execute(
{
#endif// !defined(ASIO_NO_EXCEPTIONS)
detail::fenced_block b(detail::fenced_block::full);
- asio_handler_invoke_helpers::invoke(f2.value, f2.value);
+ static_cast<decay_t<Function>&&>(f2.value)();
#if !defined(ASIO_NO_EXCEPTIONS)
}
catch (...)
@@ -68,7 +68,7 @@ template <typename Blocking, typename Relationship, typename Allocator>
template <typename Function>
inline void
basic_system_executor<Blocking, Relationship, Allocator>::do_execute(
- ASIO_MOVE_ARG(Function) f, execution::blocking_t::always_t) const
+ Function&& f, execution::blocking_t::always_t) const
{
// Obtain a non-const instance of the function.
detail::non_const_lvalue<Function> f2(f);
@@ -78,7 +78,7 @@ basic_system_executor<Blocking, Relationship, Allocator>::do_execute(
{
#endif// !defined(ASIO_NO_EXCEPTIONS)
detail::fenced_block b(detail::fenced_block::full);
- asio_handler_invoke_helpers::invoke(f2.value, f2.value);
+ static_cast<decay_t<Function>&&>(f2.value)();
#if !defined(ASIO_NO_EXCEPTIONS)
}
catch (...)
@@ -91,16 +91,15 @@ basic_system_executor<Blocking, Relationship, Allocator>::do_execute(
template <typename Blocking, typename Relationship, typename Allocator>
template <typename Function>
void basic_system_executor<Blocking, Relationship, Allocator>::do_execute(
- ASIO_MOVE_ARG(Function) f, execution::blocking_t::never_t) const
+ Function&& f, execution::blocking_t::never_t) const
{
system_context& ctx = detail::global<system_context>();
// Allocate and construct an operation to wrap the function.
- typedef typename decay<Function>::type function_type;
- typedef detail::executor_op<function_type, Allocator> op;
+ typedef detail::executor_op<decay_t<Function>, Allocator> op;
typename op::ptr p = { detail::addressof(allocator_),
op::ptr::allocate(allocator_), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), allocator_);
+ p.p = new (p.v) op(static_cast<Function&&>(f), allocator_);
if (is_same<Relationship, execution::relationship_t::continuation_t>::value)
{
@@ -121,7 +120,7 @@ void basic_system_executor<Blocking, Relationship, Allocator>::do_execute(
#if !defined(ASIO_NO_TS_EXECUTORS)
template <typename Blocking, typename Relationship, typename Allocator>
inline system_context& basic_system_executor<
- Blocking, Relationship, Allocator>::context() const ASIO_NOEXCEPT
+ Blocking, Relationship, Allocator>::context() const noexcept
{
return detail::global<system_context>();
}
@@ -129,25 +128,22 @@ inline system_context& basic_system_executor<
template <typename Blocking, typename Relationship, typename Allocator>
template <typename Function, typename OtherAllocator>
void basic_system_executor<Blocking, Relationship, Allocator>::dispatch(
- ASIO_MOVE_ARG(Function) f, const OtherAllocator&) const
+ Function&& f, const OtherAllocator&) const
{
- typename decay<Function>::type tmp(ASIO_MOVE_CAST(Function)(f));
- asio_handler_invoke_helpers::invoke(tmp, tmp);
+ decay_t<Function>(static_cast<Function&&>(f))();
}
template <typename Blocking, typename Relationship, typename Allocator>
template <typename Function, typename OtherAllocator>
void basic_system_executor<Blocking, Relationship, Allocator>::post(
- ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const
+ Function&& f, const OtherAllocator& a) const
{
- typedef typename decay<Function>::type function_type;
-
system_context& ctx = detail::global<system_context>();
// Allocate and construct an operation to wrap the function.
- typedef detail::executor_op<function_type, OtherAllocator> op;
+ typedef detail::executor_op<decay_t<Function>, OtherAllocator> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a);
+ p.p = new (p.v) op(static_cast<Function&&>(f), a);
ASIO_HANDLER_CREATION((ctx, *p.p,
"system_executor", &this->context(), 0, "post"));
@@ -159,16 +155,14 @@ void basic_system_executor<Blocking, Relationship, Allocator>::post(
template <typename Blocking, typename Relationship, typename Allocator>
template <typename Function, typename OtherAllocator>
void basic_system_executor<Blocking, Relationship, Allocator>::defer(
- ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const
+ Function&& f, const OtherAllocator& a) const
{
- typedef typename decay<Function>::type function_type;
-
system_context& ctx = detail::global<system_context>();
// Allocate and construct an operation to wrap the function.
- typedef detail::executor_op<function_type, OtherAllocator> op;
+ typedef detail::executor_op<decay_t<Function>, OtherAllocator> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a);
+ p.p = new (p.v) op(static_cast<Function&&>(f), a);
ASIO_HANDLER_CREATION((ctx, *p.p,
"system_executor", &this->context(), 0, "defer"));
diff --git a/3rdparty/asio/include/asio/impl/thread_pool.hpp b/3rdparty/asio/include/asio/impl/thread_pool.hpp
index 4a6d9d4ca38..3aed249781a 100644
--- a/3rdparty/asio/include/asio/impl/thread_pool.hpp
+++ b/3rdparty/asio/include/asio/impl/thread_pool.hpp
@@ -2,7 +2,7 @@
// impl/thread_pool.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,7 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/blocking_executor_op.hpp"
-#include "asio/detail/bulk_executor_op.hpp"
#include "asio/detail/executor_op.hpp"
#include "asio/detail/fenced_block.hpp"
#include "asio/detail/non_const_lvalue.hpp"
@@ -28,27 +27,21 @@
namespace asio {
inline thread_pool::executor_type
-thread_pool::get_executor() ASIO_NOEXCEPT
+thread_pool::get_executor() noexcept
{
return executor_type(*this);
}
inline thread_pool::executor_type
-thread_pool::executor() ASIO_NOEXCEPT
+thread_pool::executor() noexcept
{
return executor_type(*this);
}
-inline thread_pool::scheduler_type
-thread_pool::scheduler() ASIO_NOEXCEPT
-{
- return scheduler_type(*this);
-}
-
template <typename Allocator, unsigned int Bits>
thread_pool::basic_executor_type<Allocator, Bits>&
thread_pool::basic_executor_type<Allocator, Bits>::operator=(
- const basic_executor_type& other) ASIO_NOEXCEPT
+ const basic_executor_type& other) noexcept
{
if (this != &other)
{
@@ -67,11 +60,10 @@ thread_pool::basic_executor_type<Allocator, Bits>::operator=(
return *this;
}
-#if defined(ASIO_HAS_MOVE)
template <typename Allocator, unsigned int Bits>
thread_pool::basic_executor_type<Allocator, Bits>&
thread_pool::basic_executor_type<Allocator, Bits>::operator=(
- basic_executor_type&& other) ASIO_NOEXCEPT
+ basic_executor_type&& other) noexcept
{
if (this != &other)
{
@@ -88,11 +80,10 @@ thread_pool::basic_executor_type<Allocator, Bits>::operator=(
}
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
template <typename Allocator, unsigned int Bits>
inline bool thread_pool::basic_executor_type<Allocator,
- Bits>::running_in_this_thread() const ASIO_NOEXCEPT
+ Bits>::running_in_this_thread() const noexcept
{
return pool_->scheduler_.can_dispatch();
}
@@ -100,43 +91,39 @@ inline bool thread_pool::basic_executor_type<Allocator,
template <typename Allocator, unsigned int Bits>
template <typename Function>
void thread_pool::basic_executor_type<Allocator,
- Bits>::do_execute(ASIO_MOVE_ARG(Function) f, false_type) const
+ Bits>::do_execute(Function&& f, false_type) const
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// Invoke immediately if the blocking.possibly property is enabled and we are
// already inside the thread pool.
if ((bits_ & blocking_never) == 0 && pool_->scheduler_.can_dispatch())
{
// Make a local, non-const copy of the function.
- function_type tmp(ASIO_MOVE_CAST(Function)(f));
+ function_type tmp(static_cast<Function&&>(f));
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- && !defined(ASIO_NO_EXCEPTIONS)
+#if !defined(ASIO_NO_EXCEPTIONS)
try
{
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // && !defined(ASIO_NO_EXCEPTIONS)
+#endif // !defined(ASIO_NO_EXCEPTIONS)
detail::fenced_block b(detail::fenced_block::full);
- asio_handler_invoke_helpers::invoke(tmp, tmp);
+ static_cast<function_type&&>(tmp)();
return;
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- && !defined(ASIO_NO_EXCEPTIONS)
+#if !defined(ASIO_NO_EXCEPTIONS)
}
catch (...)
{
pool_->scheduler_.capture_current_exception();
return;
}
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // && !defined(ASIO_NO_EXCEPTIONS)
+#endif // !defined(ASIO_NO_EXCEPTIONS)
}
// Allocate and construct an operation to wrap the function.
typedef detail::executor_op<function_type, Allocator> op;
typename op::ptr p = { detail::addressof(allocator_),
op::ptr::allocate(allocator_), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), allocator_);
+ p.p = new (p.v) op(static_cast<Function&&>(f), allocator_);
if ((bits_ & relationship_continuation) != 0)
{
@@ -157,7 +144,7 @@ void thread_pool::basic_executor_type<Allocator,
template <typename Allocator, unsigned int Bits>
template <typename Function>
void thread_pool::basic_executor_type<Allocator,
- Bits>::do_execute(ASIO_MOVE_ARG(Function) f, true_type) const
+ Bits>::do_execute(Function&& f, true_type) const
{
// Obtain a non-const instance of the function.
detail::non_const_lvalue<Function> f2(f);
@@ -170,7 +157,7 @@ void thread_pool::basic_executor_type<Allocator,
{
#endif // !defined(ASIO_NO_EXCEPTIONS)
detail::fenced_block b(detail::fenced_block::full);
- asio_handler_invoke_helpers::invoke(f2.value, f2.value);
+ static_cast<decay_t<Function>&&>(f2.value)();
return;
#if !defined(ASIO_NO_EXCEPTIONS)
}
@@ -182,7 +169,7 @@ void thread_pool::basic_executor_type<Allocator,
}
// Construct an operation to wrap the function.
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
detail::blocking_executor_op<function_type> op(f2.value);
ASIO_HANDLER_CREATION((*pool_, op,
@@ -192,88 +179,24 @@ void thread_pool::basic_executor_type<Allocator,
op.wait();
}
-template <typename Allocator, unsigned int Bits>
-template <typename Function>
-void thread_pool::basic_executor_type<Allocator, Bits>::do_bulk_execute(
- ASIO_MOVE_ARG(Function) f, std::size_t n, false_type) const
-{
- typedef typename decay<Function>::type function_type;
- typedef detail::bulk_executor_op<function_type, Allocator> op;
-
- // Allocate and construct operations to wrap the function.
- detail::op_queue<detail::scheduler_operation> ops;
- for (std::size_t i = 0; i < n; ++i)
- {
- typename op::ptr p = { detail::addressof(allocator_),
- op::ptr::allocate(allocator_), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), allocator_, i);
- ops.push(p.p);
-
- if ((bits_ & relationship_continuation) != 0)
- {
- ASIO_HANDLER_CREATION((*pool_, *p.p,
- "thread_pool", pool_, 0, "bulk_execute(blk=never,rel=cont)"));
- }
- else
- {
- ASIO_HANDLER_CREATION((*pool_, *p.p,
- "thread_pool", pool_, 0, "bulk)execute(blk=never,rel=fork)"));
- }
-
- p.v = p.p = 0;
- }
-
- pool_->scheduler_.post_immediate_completions(n,
- ops, (bits_ & relationship_continuation) != 0);
-}
-
-template <typename Function>
-struct thread_pool_always_blocking_function_adapter
-{
- typename decay<Function>::type* f;
- std::size_t n;
-
- void operator()()
- {
- for (std::size_t i = 0; i < n; ++i)
- {
- (*f)(i);
- }
- }
-};
-
-template <typename Allocator, unsigned int Bits>
-template <typename Function>
-void thread_pool::basic_executor_type<Allocator, Bits>::do_bulk_execute(
- ASIO_MOVE_ARG(Function) f, std::size_t n, true_type) const
-{
- // Obtain a non-const instance of the function.
- detail::non_const_lvalue<Function> f2(f);
-
- thread_pool_always_blocking_function_adapter<Function>
- adapter = { detail::addressof(f2.value), n };
-
- this->do_execute(adapter, true_type());
-}
-
#if !defined(ASIO_NO_TS_EXECUTORS)
template <typename Allocator, unsigned int Bits>
inline thread_pool& thread_pool::basic_executor_type<
- Allocator, Bits>::context() const ASIO_NOEXCEPT
+ Allocator, Bits>::context() const noexcept
{
return *pool_;
}
template <typename Allocator, unsigned int Bits>
inline void thread_pool::basic_executor_type<Allocator,
- Bits>::on_work_started() const ASIO_NOEXCEPT
+ Bits>::on_work_started() const noexcept
{
pool_->scheduler_.work_started();
}
template <typename Allocator, unsigned int Bits>
inline void thread_pool::basic_executor_type<Allocator,
- Bits>::on_work_finished() const ASIO_NOEXCEPT
+ Bits>::on_work_finished() const noexcept
{
pool_->scheduler_.work_finished();
}
@@ -281,25 +204,25 @@ inline void thread_pool::basic_executor_type<Allocator,
template <typename Allocator, unsigned int Bits>
template <typename Function, typename OtherAllocator>
void thread_pool::basic_executor_type<Allocator, Bits>::dispatch(
- ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const
+ Function&& f, const OtherAllocator& a) const
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// Invoke immediately if we are already inside the thread pool.
if (pool_->scheduler_.can_dispatch())
{
// Make a local, non-const copy of the function.
- function_type tmp(ASIO_MOVE_CAST(Function)(f));
+ function_type tmp(static_cast<Function&&>(f));
detail::fenced_block b(detail::fenced_block::full);
- asio_handler_invoke_helpers::invoke(tmp, tmp);
+ static_cast<function_type&&>(tmp)();
return;
}
// Allocate and construct an operation to wrap the function.
typedef detail::executor_op<function_type, OtherAllocator> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a);
+ p.p = new (p.v) op(static_cast<Function&&>(f), a);
ASIO_HANDLER_CREATION((*pool_, *p.p,
"thread_pool", pool_, 0, "dispatch"));
@@ -311,14 +234,14 @@ void thread_pool::basic_executor_type<Allocator, Bits>::dispatch(
template <typename Allocator, unsigned int Bits>
template <typename Function, typename OtherAllocator>
void thread_pool::basic_executor_type<Allocator, Bits>::post(
- ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const
+ Function&& f, const OtherAllocator& a) const
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// Allocate and construct an operation to wrap the function.
typedef detail::executor_op<function_type, OtherAllocator> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a);
+ p.p = new (p.v) op(static_cast<Function&&>(f), a);
ASIO_HANDLER_CREATION((*pool_, *p.p,
"thread_pool", pool_, 0, "post"));
@@ -330,14 +253,14 @@ void thread_pool::basic_executor_type<Allocator, Bits>::post(
template <typename Allocator, unsigned int Bits>
template <typename Function, typename OtherAllocator>
void thread_pool::basic_executor_type<Allocator, Bits>::defer(
- ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const
+ Function&& f, const OtherAllocator& a) const
{
- typedef typename decay<Function>::type function_type;
+ typedef decay_t<Function> function_type;
// Allocate and construct an operation to wrap the function.
typedef detail::executor_op<function_type, OtherAllocator> op;
typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
- p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), a);
+ p.p = new (p.v) op(static_cast<Function&&>(f), a);
ASIO_HANDLER_CREATION((*pool_, *p.p,
"thread_pool", pool_, 0, "defer"));
diff --git a/3rdparty/asio/include/asio/impl/thread_pool.ipp b/3rdparty/asio/include/asio/impl/thread_pool.ipp
index 2e04d2afffc..3f327e4610b 100644
--- a/3rdparty/asio/include/asio/impl/thread_pool.ipp
+++ b/3rdparty/asio/include/asio/impl/thread_pool.ipp
@@ -2,7 +2,7 @@
// impl/thread_pool.ipp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -98,6 +98,7 @@ thread_pool::~thread_pool()
{
stop();
join();
+ shutdown();
}
void thread_pool::stop()
@@ -114,11 +115,11 @@ void thread_pool::attach()
void thread_pool::join()
{
- if (!threads_.empty())
- {
+ if (num_threads_)
scheduler_.work_finished();
+
+ if (!threads_.empty())
threads_.join();
- }
}
detail::scheduler& thread_pool::add_scheduler(detail::scheduler* s)
diff --git a/3rdparty/asio/include/asio/impl/use_awaitable.hpp b/3rdparty/asio/include/asio/impl/use_awaitable.hpp
index 2f5449f5428..3cd95165c4f 100644
--- a/3rdparty/asio/include/asio/impl/use_awaitable.hpp
+++ b/3rdparty/asio/include/asio/impl/use_awaitable.hpp
@@ -2,7 +2,7 @@
// impl/use_awaitable.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -258,21 +258,31 @@ class async_result<use_awaitable_t<Executor>, R(Args...)>
{
public:
typedef typename detail::awaitable_handler<
- Executor, typename decay<Args>::type...> handler_type;
+ Executor, decay_t<Args>...> handler_type;
typedef typename handler_type::awaitable_type return_type;
template <typename Initiation, typename... InitArgs>
- static return_type initiate(Initiation initiation,
- use_awaitable_t<Executor> u, InitArgs... args)
+#if defined(__APPLE_CC__) && (__clang_major__ == 13)
+ __attribute__((noinline))
+#endif // defined(__APPLE_CC__) && (__clang_major__ == 13)
+ static handler_type* do_init(
+ detail::awaitable_frame_base<Executor>* frame, Initiation& initiation,
+ use_awaitable_t<Executor> u, InitArgs&... args)
{
(void)u;
+ ASIO_HANDLER_LOCATION((u.file_name_, u.line_, u.function_name_));
+ handler_type handler(frame->detach_thread());
+ std::move(initiation)(std::move(handler), std::move(args)...);
+ return nullptr;
+ }
- co_await [&](auto* frame)
+ template <typename Initiation, typename... InitArgs>
+ static return_type initiate(Initiation initiation,
+ use_awaitable_t<Executor> u, InitArgs... args)
+ {
+ co_await [&] (auto* frame)
{
- ASIO_HANDLER_LOCATION((u.file_name_, u.line_, u.function_name_));
- handler_type handler(frame->detach_thread());
- std::move(initiation)(std::move(handler), std::move(args)...);
- return static_cast<handler_type*>(nullptr);
+ return do_init(frame, initiation, u, args...);
};
for (;;) {} // Never reached.
diff --git a/3rdparty/asio/include/asio/impl/use_future.hpp b/3rdparty/asio/include/asio/impl/use_future.hpp
index 4a35ab4754d..579b93f5f30 100644
--- a/3rdparty/asio/include/asio/impl/use_future.hpp
+++ b/3rdparty/asio/include/asio/impl/use_future.hpp
@@ -2,7 +2,7 @@
// impl/use_future.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -31,17 +31,15 @@
namespace asio {
namespace detail {
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename T, typename F, typename... Args>
inline void promise_invoke_and_set(std::promise<T>& p,
- F& f, ASIO_MOVE_ARG(Args)... args)
+ F& f, Args&&... args)
{
#if !defined(ASIO_NO_EXCEPTIONS)
try
#endif // !defined(ASIO_NO_EXCEPTIONS)
{
- p.set_value(f(ASIO_MOVE_CAST(Args)(args)...));
+ p.set_value(f(static_cast<Args&&>(args)...));
}
#if !defined(ASIO_NO_EXCEPTIONS)
catch (...)
@@ -53,13 +51,13 @@ inline void promise_invoke_and_set(std::promise<T>& p,
template <typename F, typename... Args>
inline void promise_invoke_and_set(std::promise<void>& p,
- F& f, ASIO_MOVE_ARG(Args)... args)
+ F& f, Args&&... args)
{
#if !defined(ASIO_NO_EXCEPTIONS)
try
#endif // !defined(ASIO_NO_EXCEPTIONS)
{
- f(ASIO_MOVE_CAST(Args)(args)...);
+ f(static_cast<Args&&>(args)...);
p.set_value();
}
#if !defined(ASIO_NO_EXCEPTIONS)
@@ -70,112 +68,15 @@ inline void promise_invoke_and_set(std::promise<void>& p,
#endif // !defined(ASIO_NO_EXCEPTIONS)
}
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename F>
-inline void promise_invoke_and_set(std::promise<T>& p, F& f)
-{
-#if !defined(ASIO_NO_EXCEPTIONS)
- try
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- {
- p.set_value(f());
- }
-#if !defined(ASIO_NO_EXCEPTIONS)
- catch (...)
- {
- p.set_exception(std::current_exception());
- }
-#endif // !defined(ASIO_NO_EXCEPTIONS)
-}
-
-template <typename F, typename Args>
-inline void promise_invoke_and_set(std::promise<void>& p, F& f)
-{
-#if !defined(ASIO_NO_EXCEPTIONS)
- try
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- {
- f();
- p.set_value();
-#if !defined(ASIO_NO_EXCEPTIONS)
- }
- catch (...)
- {
- p.set_exception(std::current_exception());
- }
-#endif // !defined(ASIO_NO_EXCEPTIONS)
-}
-
-#if defined(ASIO_NO_EXCEPTIONS)
-
-#define ASIO_PRIVATE_PROMISE_INVOKE_DEF(n) \
- template <typename T, typename F, ASIO_VARIADIC_TPARAMS(n)> \
- inline void promise_invoke_and_set(std::promise<T>& p, \
- F& f, ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- p.set_value(f(ASIO_VARIADIC_MOVE_ARGS(n))); \
- } \
- \
- template <typename F, ASIO_VARIADIC_TPARAMS(n)> \
- inline void promise_invoke_and_set(std::promise<void>& p, \
- F& f, ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- f(ASIO_VARIADIC_MOVE_ARGS(n)); \
- p.set_value(); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_PROMISE_INVOKE_DEF)
-#undef ASIO_PRIVATE_PROMISE_INVOKE_DEF
-
-#else // defined(ASIO_NO_EXCEPTIONS)
-
-#define ASIO_PRIVATE_PROMISE_INVOKE_DEF(n) \
- template <typename T, typename F, ASIO_VARIADIC_TPARAMS(n)> \
- inline void promise_invoke_and_set(std::promise<T>& p, \
- F& f, ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- try \
- { \
- p.set_value(f(ASIO_VARIADIC_MOVE_ARGS(n))); \
- } \
- catch (...) \
- { \
- p.set_exception(std::current_exception()); \
- } \
- } \
- \
- template <typename F, ASIO_VARIADIC_TPARAMS(n)> \
- inline void promise_invoke_and_set(std::promise<void>& p, \
- F& f, ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- try \
- { \
- f(ASIO_VARIADIC_MOVE_ARGS(n)); \
- p.set_value(); \
- } \
- catch (...) \
- { \
- p.set_exception(std::current_exception()); \
- } \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_PROMISE_INVOKE_DEF)
-#undef ASIO_PRIVATE_PROMISE_INVOKE_DEF
-
-#endif // defined(ASIO_NO_EXCEPTIONS)
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
// A function object adapter to invoke a nullary function object and capture
// any exception thrown into a promise.
template <typename T, typename F>
class promise_invoker
{
public:
- promise_invoker(const shared_ptr<std::promise<T> >& p,
- ASIO_MOVE_ARG(F) f)
- : p_(p), f_(ASIO_MOVE_CAST(F)(f))
+ promise_invoker(const shared_ptr<std::promise<T>>& p,
+ F&& f)
+ : p_(p), f_(static_cast<F&&>(f))
{
}
@@ -196,8 +97,8 @@ public:
}
private:
- shared_ptr<std::promise<T> > p_;
- typename decay<F>::type f_;
+ shared_ptr<std::promise<T>> p_;
+ decay_t<F> f_;
};
// An executor that adapts the system_executor to capture any exeption thrown
@@ -206,12 +107,17 @@ template <typename T, typename Blocking = execution::blocking_t::possibly_t>
class promise_executor
{
public:
- explicit promise_executor(const shared_ptr<std::promise<T> >& p)
+ explicit promise_executor(const shared_ptr<std::promise<T>>& p)
: p_(p)
{
}
- static ASIO_CONSTEXPR Blocking query(execution::blocking_t)
+ execution_context& query(execution::context_t) const noexcept
+ {
+ return asio::query(system_executor(), execution::context);
+ }
+
+ static constexpr Blocking query(execution::blocking_t)
{
return Blocking();
}
@@ -229,57 +135,56 @@ public:
}
template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const
+ void execute(F&& f) const
{
- execution::execute(
- asio::require(system_executor(), Blocking()),
- promise_invoker<T, F>(p_, ASIO_MOVE_CAST(F)(f)));
+ asio::require(system_executor(), Blocking()).execute(
+ promise_invoker<T, F>(p_, static_cast<F&&>(f)));
}
#if !defined(ASIO_NO_TS_EXECUTORS)
- execution_context& context() const ASIO_NOEXCEPT
+ execution_context& context() const noexcept
{
return system_executor().context();
}
- void on_work_started() const ASIO_NOEXCEPT {}
- void on_work_finished() const ASIO_NOEXCEPT {}
+ void on_work_started() const noexcept {}
+ void on_work_finished() const noexcept {}
template <typename F, typename A>
- void dispatch(ASIO_MOVE_ARG(F) f, const A&) const
+ void dispatch(F&& f, const A&) const
{
- promise_invoker<T, F>(p_, ASIO_MOVE_CAST(F)(f))();
+ promise_invoker<T, F>(p_, static_cast<F&&>(f))();
}
template <typename F, typename A>
- void post(ASIO_MOVE_ARG(F) f, const A& a) const
+ void post(F&& f, const A& a) const
{
system_executor().post(
- promise_invoker<T, F>(p_, ASIO_MOVE_CAST(F)(f)), a);
+ promise_invoker<T, F>(p_, static_cast<F&&>(f)), a);
}
template <typename F, typename A>
- void defer(ASIO_MOVE_ARG(F) f, const A& a) const
+ void defer(F&& f, const A& a) const
{
system_executor().defer(
- promise_invoker<T, F>(p_, ASIO_MOVE_CAST(F)(f)), a);
+ promise_invoker<T, F>(p_, static_cast<F&&>(f)), a);
}
#endif // !defined(ASIO_NO_TS_EXECUTORS)
friend bool operator==(const promise_executor& a,
- const promise_executor& b) ASIO_NOEXCEPT
+ const promise_executor& b) noexcept
{
return a.p_ == b.p_;
}
friend bool operator!=(const promise_executor& a,
- const promise_executor& b) ASIO_NOEXCEPT
+ const promise_executor& b) noexcept
{
return a.p_ != b.p_;
}
private:
- shared_ptr<std::promise<T> > p_;
+ shared_ptr<std::promise<T>> p_;
};
// The base class for all completion handlers that create promises.
@@ -289,7 +194,7 @@ class promise_creator
public:
typedef promise_executor<T> executor_type;
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return executor_type(p_);
}
@@ -309,7 +214,7 @@ protected:
p_ = std::allocate_shared<std::promise<T>>(b, std::allocator_arg, b);
}
- shared_ptr<std::promise<T> > p_;
+ shared_ptr<std::promise<T>> p_;
};
// For completion signature void().
@@ -368,9 +273,9 @@ class promise_handler_1
{
public:
template <typename Arg>
- void operator()(ASIO_MOVE_ARG(Arg) arg)
+ void operator()(Arg&& arg)
{
- this->p_->set_value(ASIO_MOVE_CAST(Arg)(arg));
+ this->p_->set_value(static_cast<Arg&&>(arg));
}
};
@@ -382,7 +287,7 @@ class promise_handler_ec_1
public:
template <typename Arg>
void operator()(const asio::error_code& ec,
- ASIO_MOVE_ARG(Arg) arg)
+ Arg&& arg)
{
if (ec)
{
@@ -391,7 +296,7 @@ public:
asio::system_error(ec)));
}
else
- this->p_->set_value(ASIO_MOVE_CAST(Arg)(arg));
+ this->p_->set_value(static_cast<Arg&&>(arg));
}
};
@@ -403,12 +308,12 @@ class promise_handler_ex_1
public:
template <typename Arg>
void operator()(const std::exception_ptr& ex,
- ASIO_MOVE_ARG(Arg) arg)
+ Arg&& arg)
{
if (ex)
this->p_->set_exception(ex);
else
- this->p_->set_value(ASIO_MOVE_CAST(Arg)(arg));
+ this->p_->set_value(static_cast<Arg&&>(arg));
}
};
@@ -418,31 +323,13 @@ class promise_handler_n
: public promise_creator<T>
{
public:
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... Args>
- void operator()(ASIO_MOVE_ARG(Args)... args)
+ void operator()(Args&&... args)
{
this->p_->set_value(
std::forward_as_tuple(
- ASIO_MOVE_CAST(Args)(args)...));
+ static_cast<Args&&>(args)...));
}
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_CALL_OP_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- void operator()(ASIO_VARIADIC_MOVE_PARAMS(n)) \
- {\
- this->p_->set_value( \
- std::forward_as_tuple( \
- ASIO_VARIADIC_MOVE_ARGS(n))); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CALL_OP_DEF)
-#undef ASIO_PRIVATE_CALL_OP_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
// For completion signature void(error_code, T1, ..., Tn);
@@ -451,11 +338,8 @@ class promise_handler_ec_n
: public promise_creator<T>
{
public:
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... Args>
- void operator()(const asio::error_code& ec,
- ASIO_MOVE_ARG(Args)... args)
+ void operator()(const asio::error_code& ec, Args&&... args)
{
if (ec)
{
@@ -467,35 +351,9 @@ public:
{
this->p_->set_value(
std::forward_as_tuple(
- ASIO_MOVE_CAST(Args)(args)...));
+ static_cast<Args&&>(args)...));
}
}
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_CALL_OP_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- void operator()(const asio::error_code& ec, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- {\
- if (ec) \
- { \
- this->p_->set_exception( \
- std::make_exception_ptr( \
- asio::system_error(ec))); \
- } \
- else \
- { \
- this->p_->set_value( \
- std::forward_as_tuple( \
- ASIO_VARIADIC_MOVE_ARGS(n))); \
- } \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CALL_OP_DEF)
-#undef ASIO_PRIVATE_CALL_OP_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
// For completion signature void(exception_ptr, T1, ..., Tn);
@@ -504,11 +362,9 @@ class promise_handler_ex_n
: public promise_creator<T>
{
public:
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... Args>
void operator()(const std::exception_ptr& ex,
- ASIO_MOVE_ARG(Args)... args)
+ Args&&... args)
{
if (ex)
this->p_->set_exception(ex);
@@ -516,31 +372,9 @@ public:
{
this->p_->set_value(
std::forward_as_tuple(
- ASIO_MOVE_CAST(Args)(args)...));
+ static_cast<Args&&>(args)...));
}
}
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_CALL_OP_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- void operator()(const std::exception_ptr& ex, \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- {\
- if (ex) \
- this->p_->set_exception(ex); \
- else \
- { \
- this->p_->set_value( \
- std::forward_as_tuple( \
- ASIO_VARIADIC_MOVE_ARGS(n))); \
- } \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CALL_OP_DEF)
-#undef ASIO_PRIVATE_CALL_OP_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
// Helper template to choose the appropriate concrete promise handler
@@ -571,45 +405,17 @@ template <typename Arg>
class promise_handler_selector<void(std::exception_ptr, Arg)>
: public promise_handler_ex_1<Arg> {};
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... Arg>
class promise_handler_selector<void(Arg...)>
- : public promise_handler_n<std::tuple<Arg...> > {};
+ : public promise_handler_n<std::tuple<Arg...>> {};
template <typename... Arg>
class promise_handler_selector<void(asio::error_code, Arg...)>
- : public promise_handler_ec_n<std::tuple<Arg...> > {};
+ : public promise_handler_ec_n<std::tuple<Arg...>> {};
template <typename... Arg>
class promise_handler_selector<void(std::exception_ptr, Arg...)>
- : public promise_handler_ex_n<std::tuple<Arg...> > {};
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#define ASIO_PRIVATE_PROMISE_SELECTOR_DEF(n) \
- template <typename Arg, ASIO_VARIADIC_TPARAMS(n)> \
- class promise_handler_selector< \
- void(Arg, ASIO_VARIADIC_TARGS(n))> \
- : public promise_handler_n< \
- std::tuple<Arg, ASIO_VARIADIC_TARGS(n)> > {}; \
- \
- template <typename Arg, ASIO_VARIADIC_TPARAMS(n)> \
- class promise_handler_selector< \
- void(asio::error_code, Arg, ASIO_VARIADIC_TARGS(n))> \
- : public promise_handler_ec_n< \
- std::tuple<Arg, ASIO_VARIADIC_TARGS(n)> > {}; \
- \
- template <typename Arg, ASIO_VARIADIC_TPARAMS(n)> \
- class promise_handler_selector< \
- void(std::exception_ptr, Arg, ASIO_VARIADIC_TARGS(n))> \
- : public promise_handler_ex_n< \
- std::tuple<Arg, ASIO_VARIADIC_TARGS(n)> > {}; \
- /**/
- ASIO_VARIADIC_GENERATE_5(ASIO_PRIVATE_PROMISE_SELECTOR_DEF)
-#undef ASIO_PRIVATE_PROMISE_SELECTOR_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
+ : public promise_handler_ex_n<std::tuple<Arg...>> {};
// Completion handlers produced from the use_future completion token, when not
// using use_future::operator().
@@ -627,7 +433,7 @@ public:
this->create_promise(allocator_);
}
- allocator_type get_allocator() const ASIO_NOEXCEPT
+ allocator_type get_allocator() const noexcept
{
return allocator_;
}
@@ -640,7 +446,7 @@ template <typename Function>
struct promise_function_wrapper
{
explicit promise_function_wrapper(Function& f)
- : function_(ASIO_MOVE_CAST(Function)(f))
+ : function_(static_cast<Function&&>(f))
{
}
@@ -657,28 +463,6 @@ struct promise_function_wrapper
Function function_;
};
-#if !defined(ASIO_NO_DEPRECATED)
-
-template <typename Function, typename Signature, typename Allocator>
-inline void asio_handler_invoke(Function& f,
- promise_handler<Signature, Allocator>* h)
-{
- typename promise_handler<Signature, Allocator>::executor_type
- ex(h->get_executor());
- asio::dispatch(ex, promise_function_wrapper<Function>(f));
-}
-
-template <typename Function, typename Signature, typename Allocator>
-inline void asio_handler_invoke(const Function& f,
- promise_handler<Signature, Allocator>* h)
-{
- typename promise_handler<Signature, Allocator>::executor_type
- ex(h->get_executor());
- asio::dispatch(ex, promise_function_wrapper<Function>(f));
-}
-
-#endif // !defined(ASIO_NO_DEPRECATED)
-
// Helper base class for async_result specialisation.
template <typename Signature, typename Allocator>
class promise_async_result
@@ -694,7 +478,7 @@ public:
return_type get()
{
- return ASIO_MOVE_CAST(return_type)(future_);
+ return static_cast<return_type&&>(future_);
}
private:
@@ -707,7 +491,7 @@ class packaged_token
{
public:
packaged_token(Function f, const Allocator& a)
- : function_(ASIO_MOVE_CAST(Function)(f)),
+ : function_(static_cast<Function&&>(f)),
allocator_(a)
{
}
@@ -728,75 +512,29 @@ public:
typedef void result_type;
packaged_handler(packaged_token<Function, Allocator> t)
- : function_(ASIO_MOVE_CAST(Function)(t.function_)),
+ : function_(static_cast<Function&&>(t.function_)),
allocator_(t.allocator_)
{
this->create_promise(allocator_);
}
- allocator_type get_allocator() const ASIO_NOEXCEPT
+ allocator_type get_allocator() const noexcept
{
return allocator_;
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... Args>
- void operator()(ASIO_MOVE_ARG(Args)... args)
+ void operator()(Args&&... args)
{
(promise_invoke_and_set)(*this->p_,
- function_, ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- void operator()()
- {
- (promise_invoke_and_set)(*this->p_, function_);
+ function_, static_cast<Args&&>(args)...);
}
-#define ASIO_PRIVATE_CALL_OP_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- void operator()(ASIO_VARIADIC_MOVE_PARAMS(n)) \
- {\
- (promise_invoke_and_set)(*this->p_, \
- function_, ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_CALL_OP_DEF)
-#undef ASIO_PRIVATE_CALL_OP_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
private:
Function function_;
Allocator allocator_;
};
-#if !defined(ASIO_NO_DEPRECATED)
-
-template <typename Function,
- typename Function1, typename Allocator, typename Result>
-inline void asio_handler_invoke(Function& f,
- packaged_handler<Function1, Allocator, Result>* h)
-{
- typename packaged_handler<Function1, Allocator, Result>::executor_type
- ex(h->get_executor());
- asio::dispatch(ex, promise_function_wrapper<Function>(f));
-}
-
-template <typename Function,
- typename Function1, typename Allocator, typename Result>
-inline void asio_handler_invoke(const Function& f,
- packaged_handler<Function1, Allocator, Result>* h)
-{
- typename packaged_handler<Function1, Allocator, Result>::executor_type
- ex(h->get_executor());
- asio::dispatch(ex, promise_function_wrapper<Function>(f));
-}
-
-#endif // !defined(ASIO_NO_DEPRECATED)
-
// Helper base class for async_result specialisation.
template <typename Function, typename Allocator, typename Result>
class packaged_async_result
@@ -812,7 +550,7 @@ public:
return_type get()
{
- return ASIO_MOVE_CAST(return_type)(future_);
+ return static_cast<return_type&&>(future_);
}
private:
@@ -822,28 +560,26 @@ private:
} // namespace detail
template <typename Allocator> template <typename Function>
-inline detail::packaged_token<typename decay<Function>::type, Allocator>
-use_future_t<Allocator>::operator()(ASIO_MOVE_ARG(Function) f) const
+inline detail::packaged_token<decay_t<Function>, Allocator>
+use_future_t<Allocator>::operator()(Function&& f) const
{
- return detail::packaged_token<typename decay<Function>::type, Allocator>(
- ASIO_MOVE_CAST(Function)(f), allocator_);
+ return detail::packaged_token<decay_t<Function>, Allocator>(
+ static_cast<Function&&>(f), allocator_);
}
#if !defined(GENERATING_DOCUMENTATION)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Allocator, typename Result, typename... Args>
class async_result<use_future_t<Allocator>, Result(Args...)>
: public detail::promise_async_result<
- void(typename decay<Args>::type...), Allocator>
+ void(decay_t<Args>...), Allocator>
{
public:
explicit async_result(
- typename detail::promise_async_result<void(typename decay<Args>::type...),
+ typename detail::promise_async_result<void(decay_t<Args>...),
Allocator>::completion_handler_type& h)
: detail::promise_async_result<
- void(typename decay<Args>::type...), Allocator>(h)
+ void(decay_t<Args>...), Allocator>(h)
{
}
};
@@ -852,100 +588,28 @@ template <typename Function, typename Allocator,
typename Result, typename... Args>
class async_result<detail::packaged_token<Function, Allocator>, Result(Args...)>
: public detail::packaged_async_result<Function, Allocator,
- typename result_of<Function(Args...)>::type>
-{
-public:
- explicit async_result(
- typename detail::packaged_async_result<Function, Allocator,
- typename result_of<Function(Args...)>::type>::completion_handler_type& h)
- : detail::packaged_async_result<Function, Allocator,
- typename result_of<Function(Args...)>::type>(h)
- {
- }
-};
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename Allocator, typename Result>
-class async_result<use_future_t<Allocator>, Result()>
- : public detail::promise_async_result<void(), Allocator>
-{
-public:
- explicit async_result(
- typename detail::promise_async_result<
- void(), Allocator>::completion_handler_type& h)
- : detail::promise_async_result<void(), Allocator>(h)
- {
- }
-};
-
-template <typename Function, typename Allocator, typename Result>
-class async_result<detail::packaged_token<Function, Allocator>, Result()>
- : public detail::packaged_async_result<Function, Allocator,
- typename result_of<Function()>::type>
+ result_of_t<Function(Args...)>>
{
public:
explicit async_result(
typename detail::packaged_async_result<Function, Allocator,
- typename result_of<Function()>::type>::completion_handler_type& h)
+ result_of_t<Function(Args...)>>::completion_handler_type& h)
: detail::packaged_async_result<Function, Allocator,
- typename result_of<Function()>::type>(h)
+ result_of_t<Function(Args...)>>(h)
{
}
};
-#define ASIO_PRIVATE_ASYNC_RESULT_DEF(n) \
- template <typename Allocator, \
- typename Result, ASIO_VARIADIC_TPARAMS(n)> \
- class async_result<use_future_t<Allocator>, \
- Result(ASIO_VARIADIC_TARGS(n))> \
- : public detail::promise_async_result< \
- void(ASIO_VARIADIC_DECAY(n)), Allocator> \
- { \
- public: \
- explicit async_result( \
- typename detail::promise_async_result< \
- void(ASIO_VARIADIC_DECAY(n)), \
- Allocator>::completion_handler_type& h) \
- : detail::promise_async_result< \
- void(ASIO_VARIADIC_DECAY(n)), Allocator>(h) \
- { \
- } \
- }; \
- \
- template <typename Function, typename Allocator, \
- typename Result, ASIO_VARIADIC_TPARAMS(n)> \
- class async_result<detail::packaged_token<Function, Allocator>, \
- Result(ASIO_VARIADIC_TARGS(n))> \
- : public detail::packaged_async_result<Function, Allocator, \
- typename result_of<Function(ASIO_VARIADIC_TARGS(n))>::type> \
- { \
- public: \
- explicit async_result( \
- typename detail::packaged_async_result<Function, Allocator, \
- typename result_of<Function(ASIO_VARIADIC_TARGS(n))>::type \
- >::completion_handler_type& h) \
- : detail::packaged_async_result<Function, Allocator, \
- typename result_of<Function(ASIO_VARIADIC_TARGS(n))>::type>(h) \
- { \
- } \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ASYNC_RESULT_DEF)
-#undef ASIO_PRIVATE_ASYNC_RESULT_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename T, typename Blocking>
struct equality_comparable<
- asio::detail::promise_executor<T, Blocking> >
+ asio::detail::promise_executor<T, Blocking>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -956,14 +620,14 @@ template <typename T, typename Blocking, typename Function>
struct execute_member<
asio::detail::promise_executor<T, Blocking>, Function>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_TRAIT)
+#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
template <typename T, typename Blocking, typename Property>
struct query_static_constexpr_member<
@@ -977,17 +641,32 @@ struct query_static_constexpr_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Blocking result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return Blocking();
}
};
-#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_TRAIT)
+#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
+
+#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
+
+template <typename T, typename Blocking>
+struct query_member<
+ asio::detail::promise_executor<T, Blocking>,
+ execution::context_t
+ >
+{
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
+ typedef asio::system_context& result_type;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
@@ -997,8 +676,8 @@ struct require_member<
execution::blocking_t::possibly_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::detail::promise_executor<T,
execution::blocking_t::possibly_t> result_type;
};
@@ -1009,8 +688,8 @@ struct require_member<
execution::blocking_t::never_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::detail::promise_executor<T,
execution::blocking_t::never_t> result_type;
};
diff --git a/3rdparty/asio/include/asio/impl/write.hpp b/3rdparty/asio/include/asio/impl/write.hpp
index 67eb093f894..af2bb5544bb 100644
--- a/3rdparty/asio/include/asio/impl/write.hpp
+++ b/3rdparty/asio/include/asio/impl/write.hpp
@@ -2,7 +2,7 @@
// impl/write.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,16 +17,13 @@
#include "asio/associator.hpp"
#include "asio/buffer.hpp"
-#include "asio/completion_condition.hpp"
#include "asio/detail/array_fwd.hpp"
#include "asio/detail/base_from_cancellation_state.hpp"
#include "asio/detail/base_from_completion_cond.hpp"
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/consuming_buffers.hpp"
#include "asio/detail/dependent_type.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_tracking.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/non_const_lvalue.hpp"
@@ -40,7 +37,7 @@ namespace detail
{
template <typename SyncWriteStream, typename ConstBufferSequence,
typename ConstBufferIterator, typename CompletionCondition>
- std::size_t write_buffer_sequence(SyncWriteStream& s,
+ std::size_t write(SyncWriteStream& s,
const ConstBufferSequence& buffers, const ConstBufferIterator&,
CompletionCondition completion_condition, asio::error_code& ec)
{
@@ -63,20 +60,20 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition>
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type)
+ >)
{
- return detail::write_buffer_sequence(s, buffers,
+ return detail::write(s, buffers,
asio::buffer_sequence_begin(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
}
template <typename SyncWriteStream, typename ConstBufferSequence>
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
- typename constraint<
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = write(s, buffers, transfer_all(), ec);
@@ -87,9 +84,9 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
template <typename SyncWriteStream, typename ConstBufferSequence>
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type)
+ >)
{
return write(s, buffers, transfer_all(), ec);
}
@@ -98,13 +95,13 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition>
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition,
- typename constraint<
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = write(s, buffers,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "write");
return bytes_transferred;
}
@@ -114,37 +111,37 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
template <typename SyncWriteStream, typename DynamicBuffer_v1,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
- typename decay<DynamicBuffer_v1>::type b(
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
+ decay_t<DynamicBuffer_v1> b(
+ static_cast<DynamicBuffer_v1&&>(buffers));
std::size_t bytes_transferred = write(s, b.data(),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
b.consume(bytes_transferred);
return bytes_transferred;
}
template <typename SyncWriteStream, typename DynamicBuffer_v1>
inline std::size_t write(SyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ DynamicBuffer_v1&& buffers,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = write(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ static_cast<DynamicBuffer_v1&&>(buffers),
transfer_all(), ec);
asio::detail::throw_error(ec, "write");
return bytes_transferred;
@@ -152,35 +149,35 @@ inline std::size_t write(SyncWriteStream& s,
template <typename SyncWriteStream, typename DynamicBuffer_v1>
inline std::size_t write(SyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
-{
- return write(s, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
+{
+ return write(s, static_cast<DynamicBuffer_v1&&>(buffers),
transfer_all(), ec);
}
template <typename SyncWriteStream, typename DynamicBuffer_v1,
typename CompletionCondition>
inline std::size_t write(SyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = write(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "write");
return bytes_transferred;
}
@@ -195,7 +192,7 @@ inline std::size_t write(SyncWriteStream& s,
CompletionCondition completion_condition, asio::error_code& ec)
{
return write(s, basic_streambuf_ref<Allocator>(b),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
}
template <typename SyncWriteStream, typename Allocator>
@@ -220,7 +217,7 @@ inline std::size_t write(SyncWriteStream& s,
CompletionCondition completion_condition)
{
return write(s, basic_streambuf_ref<Allocator>(b),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ static_cast<CompletionCondition&&>(completion_condition));
}
#endif // !defined(ASIO_NO_IOSTREAM)
@@ -231,25 +228,25 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
std::size_t bytes_transferred = write(s, buffers.data(0, buffers.size()),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
buffers.consume(bytes_transferred);
return bytes_transferred;
}
template <typename SyncWriteStream, typename DynamicBuffer_v2>
inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = write(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
+ static_cast<DynamicBuffer_v2&&>(buffers),
transfer_all(), ec);
asio::detail::throw_error(ec, "write");
return bytes_transferred;
@@ -258,11 +255,11 @@ inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
template <typename SyncWriteStream, typename DynamicBuffer_v2>
inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
- return write(s, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
+ return write(s, static_cast<DynamicBuffer_v2&&>(buffers),
transfer_all(), ec);
}
@@ -270,14 +267,14 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
typename CompletionCondition>
inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
+ >)
{
asio::error_code ec;
std::size_t bytes_transferred = write(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "write");
return bytes_transferred;
}
@@ -300,11 +297,10 @@ namespace detail
stream_(stream),
buffers_(buffers),
start_(0),
- handler_(ASIO_MOVE_CAST(WriteHandler)(handler))
+ handler_(static_cast<WriteHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
write_op(const write_op& other)
: base_from_cancellation_state<WriteHandler>(other),
base_from_completion_cond<CompletionCondition>(other),
@@ -317,18 +313,15 @@ namespace detail
write_op(write_op&& other)
: base_from_cancellation_state<WriteHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- WriteHandler>)(other)),
+ static_cast<base_from_cancellation_state<WriteHandler>&&>(other)),
base_from_completion_cond<CompletionCondition>(
- ASIO_MOVE_CAST(base_from_completion_cond<
- CompletionCondition>)(other)),
+ static_cast<base_from_completion_cond<CompletionCondition>&&>(other)),
stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(buffers_type)(other.buffers_)),
+ buffers_(static_cast<buffers_type&&>(other.buffers_)),
start_(other.start_),
- handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_))
+ handler_(static_cast<WriteHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -343,7 +336,7 @@ namespace detail
{
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_write"));
stream_.async_write_some(buffers_.prepare(max_size),
- ASIO_MOVE_CAST(write_op)(*this));
+ static_cast<write_op&&>(*this));
}
return; default:
buffers_.consume(bytes_transferred);
@@ -359,7 +352,7 @@ namespace detail
}
}
- ASIO_MOVE_OR_LVALUE(WriteHandler)(handler_)(
+ static_cast<WriteHandler&&>(handler_)(
static_cast<const asio::error_code&>(ec),
static_cast<const std::size_t&>(buffers_.total_consumed()));
}
@@ -378,38 +371,6 @@ namespace detail
template <typename AsyncWriteStream, typename ConstBufferSequence,
typename ConstBufferIterator, typename CompletionCondition,
typename WriteHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- write_op<AsyncWriteStream, ConstBufferSequence, ConstBufferIterator,
- CompletionCondition, WriteHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncWriteStream, typename ConstBufferSequence,
- typename ConstBufferIterator, typename CompletionCondition,
- typename WriteHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- write_op<AsyncWriteStream, ConstBufferSequence, ConstBufferIterator,
- CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncWriteStream, typename ConstBufferSequence,
- typename ConstBufferIterator, typename CompletionCondition,
- typename WriteHandler>
inline bool asio_handler_is_continuation(
write_op<AsyncWriteStream, ConstBufferSequence, ConstBufferIterator,
CompletionCondition, WriteHandler>* this_handler)
@@ -419,40 +380,10 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncWriteStream,
- typename ConstBufferSequence, typename ConstBufferIterator,
- typename CompletionCondition, typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- write_op<AsyncWriteStream, ConstBufferSequence, ConstBufferIterator,
- CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncWriteStream,
- typename ConstBufferSequence, typename ConstBufferIterator,
- typename CompletionCondition, typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- write_op<AsyncWriteStream, ConstBufferSequence, ConstBufferIterator,
- CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncWriteStream, typename ConstBufferSequence,
typename ConstBufferIterator, typename CompletionCondition,
typename WriteHandler>
- inline void start_write_buffer_sequence_op(AsyncWriteStream& stream,
+ inline void start_write_op(AsyncWriteStream& stream,
const ConstBufferSequence& buffers, const ConstBufferIterator&,
CompletionCondition& completion_condition, WriteHandler& handler)
{
@@ -463,26 +394,26 @@ namespace detail
}
template <typename AsyncWriteStream>
- class initiate_async_write_buffer_sequence
+ class initiate_async_write
{
public:
typedef typename AsyncWriteStream::executor_type executor_type;
- explicit initiate_async_write_buffer_sequence(AsyncWriteStream& stream)
+ explicit initiate_async_write(AsyncWriteStream& stream)
: stream_(stream)
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence,
typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
+ CompletionCondition&& completion_cond) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WriteHandler.
@@ -490,7 +421,7 @@ namespace detail
non_const_lvalue<WriteHandler> handler2(handler);
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
- start_write_buffer_sequence_op(stream_, buffers,
+ start_write_op(stream_, buffers,
asio::buffer_sequence_begin(buffers),
completion_cond2.value, handler2.value);
}
@@ -514,8 +445,16 @@ struct associator<Associator,
{
static typename Associator<WriteHandler, DefaultCandidate>::type get(
const detail::write_op<AsyncWriteStream, ConstBufferSequence,
+ ConstBufferIterator, CompletionCondition, WriteHandler>& h) noexcept
+ {
+ return Associator<WriteHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::write_op<AsyncWriteStream, ConstBufferSequence,
ConstBufferIterator, CompletionCondition, WriteHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -526,38 +465,44 @@ struct associator<Associator,
template <typename AsyncWriteStream,
typename ConstBufferSequence, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler,
- typename constraint<
+ std::size_t)) WriteToken>
+inline auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
+ CompletionCondition completion_condition, WriteToken&& token,
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type)
-{
- return async_initiate<WriteHandler,
+ >)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write<AsyncWriteStream>>(),
+ token, buffers,
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_write_buffer_sequence<AsyncWriteStream>(s),
- handler, buffers,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ detail::initiate_async_write<AsyncWriteStream>(s),
+ token, buffers,
+ static_cast<CompletionCondition&&>(completion_condition));
}
template <typename AsyncWriteStream, typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler,
- typename constraint<
+ std::size_t)) WriteToken>
+inline auto async_write(AsyncWriteStream& s,
+ const ConstBufferSequence& buffers, WriteToken&& token,
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type)
-{
- return async_initiate<WriteHandler,
+ >)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write<AsyncWriteStream>>(),
+ token, buffers, transfer_all()))
+{
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_write_buffer_sequence<AsyncWriteStream>(s),
- handler, buffers, transfer_all());
+ detail::initiate_async_write<AsyncWriteStream>(s),
+ token, buffers, transfer_all());
}
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -571,17 +516,16 @@ namespace detail
public:
template <typename BufferSequence>
write_dynbuf_v1_op(AsyncWriteStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
CompletionCondition& completion_condition, WriteHandler& handler)
: stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
completion_condition_(
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition)),
- handler_(ASIO_MOVE_CAST(WriteHandler)(handler))
+ static_cast<CompletionCondition&&>(completion_condition)),
+ handler_(static_cast<WriteHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
write_dynbuf_v1_op(const write_dynbuf_v1_op& other)
: stream_(other.stream_),
buffers_(other.buffers_),
@@ -592,14 +536,13 @@ namespace detail
write_dynbuf_v1_op(write_dynbuf_v1_op&& other)
: stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v1)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v1&&>(other.buffers_)),
completion_condition_(
- ASIO_MOVE_CAST(CompletionCondition)(
+ static_cast<CompletionCondition&&>(
other.completion_condition_)),
- handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_))
+ handler_(static_cast<WriteHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
std::size_t bytes_transferred, int start = 0)
@@ -608,11 +551,11 @@ namespace detail
{
case 1:
async_write(stream_, buffers_.data(),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition_),
- ASIO_MOVE_CAST(write_dynbuf_v1_op)(*this));
+ static_cast<CompletionCondition&&>(completion_condition_),
+ static_cast<write_dynbuf_v1_op&&>(*this));
return; default:
buffers_.consume(bytes_transferred);
- ASIO_MOVE_OR_LVALUE(WriteHandler)(handler_)(ec,
+ static_cast<WriteHandler&&>(handler_)(ec,
static_cast<const std::size_t&>(bytes_transferred));
}
}
@@ -626,36 +569,6 @@ namespace detail
template <typename AsyncWriteStream, typename DynamicBuffer_v1,
typename CompletionCondition, typename WriteHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- write_dynbuf_v1_op<AsyncWriteStream, DynamicBuffer_v1,
- CompletionCondition, WriteHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncWriteStream, typename DynamicBuffer_v1,
- typename CompletionCondition, typename WriteHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- write_dynbuf_v1_op<AsyncWriteStream, DynamicBuffer_v1,
- CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncWriteStream, typename DynamicBuffer_v1,
- typename CompletionCondition, typename WriteHandler>
inline bool asio_handler_is_continuation(
write_dynbuf_v1_op<AsyncWriteStream, DynamicBuffer_v1,
CompletionCondition, WriteHandler>* this_handler)
@@ -664,36 +577,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncWriteStream,
- typename DynamicBuffer_v1, typename CompletionCondition,
- typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- write_dynbuf_v1_op<AsyncWriteStream, DynamicBuffer_v1,
- CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncWriteStream,
- typename DynamicBuffer_v1, typename CompletionCondition,
- typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- write_dynbuf_v1_op<AsyncWriteStream, DynamicBuffer_v1,
- CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncWriteStream>
class initiate_async_write_dynbuf_v1
{
@@ -705,16 +588,16 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename WriteHandler, typename DynamicBuffer_v1,
typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
+ void operator()(WriteHandler&& handler,
+ DynamicBuffer_v1&& buffers,
+ CompletionCondition&& completion_cond) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WriteHandler.
@@ -723,9 +606,9 @@ namespace detail
non_const_lvalue<WriteHandler> handler2(handler);
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
write_dynbuf_v1_op<AsyncWriteStream,
- typename decay<DynamicBuffer_v1>::type,
- CompletionCondition, typename decay<WriteHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
+ decay_t<DynamicBuffer_v1>,
+ CompletionCondition, decay_t<WriteHandler>>(
+ stream_, static_cast<DynamicBuffer_v1&&>(buffers),
completion_cond2.value, handler2.value)(
asio::error_code(), 0, 1);
}
@@ -748,9 +631,17 @@ struct associator<Associator,
: Associator<WriteHandler, DefaultCandidate>
{
static typename Associator<WriteHandler, DefaultCandidate>::type get(
+ const detail::write_dynbuf_v1_op<AsyncWriteStream, DynamicBuffer_v1,
+ CompletionCondition, WriteHandler>& h) noexcept
+ {
+ return Associator<WriteHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
const detail::write_dynbuf_v1_op<AsyncWriteStream,
DynamicBuffer_v1, CompletionCondition, WriteHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -760,46 +651,53 @@ struct associator<Associator,
template <typename AsyncWriteStream, typename DynamicBuffer_v1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- ASIO_MOVE_ARG(WriteHandler) handler,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
-{
- return async_write(s,
- ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
- transfer_all(), ASIO_MOVE_CAST(WriteHandler)(handler));
+ std::size_t)) WriteToken>
+inline auto async_write(AsyncWriteStream& s,
+ DynamicBuffer_v1&& buffers, WriteToken&& token,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ transfer_all()))
+{
+ return async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ transfer_all());
}
template <typename AsyncWriteStream,
typename DynamicBuffer_v1, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type)
-{
- return async_initiate<WriteHandler,
+ std::size_t)) WriteToken>
+inline auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
+ CompletionCondition completion_condition, WriteToken&& token,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition));
}
#if !defined(ASIO_NO_EXTENSIONS)
@@ -807,31 +705,41 @@ async_write(AsyncWriteStream& s,
template <typename AsyncWriteStream, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s,
+ std::size_t)) WriteToken>
+inline auto async_write(AsyncWriteStream& s,
asio::basic_streambuf<Allocator>& b,
- ASIO_MOVE_ARG(WriteHandler) handler)
-{
- return async_write(s, basic_streambuf_ref<Allocator>(b),
- ASIO_MOVE_CAST(WriteHandler)(handler));
+ WriteToken&& token)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), transfer_all()))
+{
+ return async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), transfer_all());
}
template <typename AsyncWriteStream,
typename Allocator, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s,
+ std::size_t)) WriteToken>
+inline auto async_write(AsyncWriteStream& s,
asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler)
-{
- return async_write(s, basic_streambuf_ref<Allocator>(b),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition),
- ASIO_MOVE_CAST(WriteHandler)(handler));
+ CompletionCondition completion_condition, WriteToken&& token)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<CompletionCondition&&>(completion_condition));
}
#endif // !defined(ASIO_NO_IOSTREAM)
@@ -847,17 +755,16 @@ namespace detail
public:
template <typename BufferSequence>
write_dynbuf_v2_op(AsyncWriteStream& stream,
- ASIO_MOVE_ARG(BufferSequence) buffers,
+ BufferSequence&& buffers,
CompletionCondition& completion_condition, WriteHandler& handler)
: stream_(stream),
- buffers_(ASIO_MOVE_CAST(BufferSequence)(buffers)),
+ buffers_(static_cast<BufferSequence&&>(buffers)),
completion_condition_(
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition)),
- handler_(ASIO_MOVE_CAST(WriteHandler)(handler))
+ static_cast<CompletionCondition&&>(completion_condition)),
+ handler_(static_cast<WriteHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
write_dynbuf_v2_op(const write_dynbuf_v2_op& other)
: stream_(other.stream_),
buffers_(other.buffers_),
@@ -868,14 +775,13 @@ namespace detail
write_dynbuf_v2_op(write_dynbuf_v2_op&& other)
: stream_(other.stream_),
- buffers_(ASIO_MOVE_CAST(DynamicBuffer_v2)(other.buffers_)),
+ buffers_(static_cast<DynamicBuffer_v2&&>(other.buffers_)),
completion_condition_(
- ASIO_MOVE_CAST(CompletionCondition)(
+ static_cast<CompletionCondition&&>(
other.completion_condition_)),
- handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_))
+ handler_(static_cast<WriteHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
std::size_t bytes_transferred, int start = 0)
@@ -884,11 +790,11 @@ namespace detail
{
case 1:
async_write(stream_, buffers_.data(0, buffers_.size()),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition_),
- ASIO_MOVE_CAST(write_dynbuf_v2_op)(*this));
+ static_cast<CompletionCondition&&>(completion_condition_),
+ static_cast<write_dynbuf_v2_op&&>(*this));
return; default:
buffers_.consume(bytes_transferred);
- ASIO_MOVE_OR_LVALUE(WriteHandler)(handler_)(ec,
+ static_cast<WriteHandler&&>(handler_)(ec,
static_cast<const std::size_t&>(bytes_transferred));
}
}
@@ -902,36 +808,6 @@ namespace detail
template <typename AsyncWriteStream, typename DynamicBuffer_v2,
typename CompletionCondition, typename WriteHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- write_dynbuf_v2_op<AsyncWriteStream, DynamicBuffer_v2,
- CompletionCondition, WriteHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncWriteStream, typename DynamicBuffer_v2,
- typename CompletionCondition, typename WriteHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- write_dynbuf_v2_op<AsyncWriteStream, DynamicBuffer_v2,
- CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncWriteStream, typename DynamicBuffer_v2,
- typename CompletionCondition, typename WriteHandler>
inline bool asio_handler_is_continuation(
write_dynbuf_v2_op<AsyncWriteStream, DynamicBuffer_v2,
CompletionCondition, WriteHandler>* this_handler)
@@ -940,36 +816,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncWriteStream,
- typename DynamicBuffer_v2, typename CompletionCondition,
- typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- write_dynbuf_v2_op<AsyncWriteStream, DynamicBuffer_v2,
- CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncWriteStream,
- typename DynamicBuffer_v2, typename CompletionCondition,
- typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- write_dynbuf_v2_op<AsyncWriteStream, DynamicBuffer_v2,
- CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncWriteStream>
class initiate_async_write_dynbuf_v2
{
@@ -981,16 +827,16 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return stream_.get_executor();
}
template <typename WriteHandler, typename DynamicBuffer_v2,
typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
- ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
- ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
+ void operator()(WriteHandler&& handler,
+ DynamicBuffer_v2&& buffers,
+ CompletionCondition&& completion_cond) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WriteHandler.
@@ -998,12 +844,11 @@ namespace detail
non_const_lvalue<WriteHandler> handler2(handler);
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
- write_dynbuf_v2_op<AsyncWriteStream,
- typename decay<DynamicBuffer_v2>::type,
- CompletionCondition, typename decay<WriteHandler>::type>(
- stream_, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
- completion_cond2.value, handler2.value)(
- asio::error_code(), 0, 1);
+ write_dynbuf_v2_op<AsyncWriteStream, decay_t<DynamicBuffer_v2>,
+ CompletionCondition, decay_t<WriteHandler>>(
+ stream_, static_cast<DynamicBuffer_v2&&>(buffers),
+ completion_cond2.value, handler2.value)(
+ asio::error_code(), 0, 1);
}
private:
@@ -1024,34 +869,19 @@ struct associator<Associator,
: Associator<WriteHandler, DefaultCandidate>
{
static typename Associator<WriteHandler, DefaultCandidate>::type get(
- const detail::write_dynbuf_v2_op<AsyncWriteStream,
- DynamicBuffer_v2, CompletionCondition, WriteHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const detail::write_dynbuf_v2_op<AsyncWriteStream, DynamicBuffer_v2,
+ CompletionCondition, WriteHandler>& h) noexcept
{
- return Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c);
+ return Associator<WriteHandler, DefaultCandidate>::get(h.handler_);
}
-};
-template <typename AsyncWriteStream, typename DynamicBuffer_v2,
- typename CompletionCondition, typename WriteHandler,
- typename CancellationSlot>
-struct associated_cancellation_slot<
- detail::write_dynbuf_v2_op<AsyncWriteStream,
- DynamicBuffer_v2, CompletionCondition, WriteHandler>,
- CancellationSlot>
- : detail::associated_cancellation_slot_forwarding_base<
- WriteHandler, CancellationSlot>
-{
- typedef typename associated_cancellation_slot<
- WriteHandler, CancellationSlot>::type type;
-
- static type get(
+ static auto get(
const detail::write_dynbuf_v2_op<AsyncWriteStream,
DynamicBuffer_v2, CompletionCondition, WriteHandler>& h,
- const CancellationSlot& s = CancellationSlot()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c))
{
- return associated_cancellation_slot<WriteHandler,
- CancellationSlot>::get(h.handler_, s);
+ return Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c);
}
};
@@ -1059,38 +889,47 @@ struct associated_cancellation_slot<
template <typename AsyncWriteStream, typename DynamicBuffer_v2,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
- ASIO_MOVE_ARG(WriteHandler) handler,
- typename constraint<
+ std::size_t)) WriteToken>
+inline auto async_write(AsyncWriteStream& s,
+ DynamicBuffer_v2 buffers, WriteToken&& token,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
-{
- return async_write(s,
- ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
- transfer_all(), ASIO_MOVE_CAST(WriteHandler)(handler));
+ >)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ transfer_all()))
+{
+ return async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ transfer_all());
}
template <typename AsyncWriteStream,
typename DynamicBuffer_v2, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler,
- typename constraint<
+ std::size_t)) WriteToken>
+inline auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
+ CompletionCondition completion_condition, WriteToken&& token,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type)
-{
- return async_initiate<WriteHandler,
+ >)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>(s),
- handler, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition));
}
} // namespace asio
diff --git a/3rdparty/asio/include/asio/impl/write_at.hpp b/3rdparty/asio/include/asio/impl/write_at.hpp
index 87780d552b6..b5a67e30051 100644
--- a/3rdparty/asio/include/asio/impl/write_at.hpp
+++ b/3rdparty/asio/include/asio/impl/write_at.hpp
@@ -2,7 +2,7 @@
// impl/write_at.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,16 +17,13 @@
#include "asio/associator.hpp"
#include "asio/buffer.hpp"
-#include "asio/completion_condition.hpp"
#include "asio/detail/array_fwd.hpp"
#include "asio/detail/base_from_cancellation_state.hpp"
#include "asio/detail/base_from_completion_cond.hpp"
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/consuming_buffers.hpp"
#include "asio/detail/dependent_type.hpp"
-#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
-#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_tracking.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/non_const_lvalue.hpp"
@@ -71,7 +68,7 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d,
{
return detail::write_at_buffer_sequence(d, offset, buffers,
asio::buffer_sequence_begin(buffers),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
}
template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
@@ -101,7 +98,7 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
{
asio::error_code ec;
std::size_t bytes_transferred = write_at(d, offset, buffers,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "write_at");
return bytes_transferred;
}
@@ -116,7 +113,7 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d,
CompletionCondition completion_condition, asio::error_code& ec)
{
std::size_t bytes_transferred = write_at(d, offset, b.data(),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
b.consume(bytes_transferred);
return bytes_transferred;
}
@@ -147,7 +144,7 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
{
asio::error_code ec;
std::size_t bytes_transferred = write_at(d, offset, b,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
+ static_cast<CompletionCondition&&>(completion_condition), ec);
asio::detail::throw_error(ec, "write_at");
return bytes_transferred;
}
@@ -175,11 +172,10 @@ namespace detail
offset_(offset),
buffers_(buffers),
start_(0),
- handler_(ASIO_MOVE_CAST(WriteHandler)(handler))
+ handler_(static_cast<WriteHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
write_at_op(const write_at_op& other)
: base_from_cancellation_state<WriteHandler>(other),
base_from_completion_cond<CompletionCondition>(other),
@@ -193,19 +189,16 @@ namespace detail
write_at_op(write_at_op&& other)
: base_from_cancellation_state<WriteHandler>(
- ASIO_MOVE_CAST(base_from_cancellation_state<
- WriteHandler>)(other)),
+ static_cast<base_from_cancellation_state<WriteHandler>&&>(other)),
base_from_completion_cond<CompletionCondition>(
- ASIO_MOVE_CAST(base_from_completion_cond<
- CompletionCondition>)(other)),
+ static_cast<base_from_completion_cond<CompletionCondition>&&>(other)),
device_(other.device_),
offset_(other.offset_),
- buffers_(ASIO_MOVE_CAST(buffers_type)(other.buffers_)),
+ buffers_(static_cast<buffers_type&&>(other.buffers_)),
start_(other.start_),
- handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_))
+ handler_(static_cast<WriteHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred, int start = 0)
@@ -221,7 +214,7 @@ namespace detail
ASIO_HANDLER_LOCATION((__FILE__, __LINE__, "async_write_at"));
device_.async_write_some_at(
offset_ + buffers_.total_consumed(), buffers_.prepare(max_size),
- ASIO_MOVE_CAST(write_at_op)(*this));
+ static_cast<write_at_op&&>(*this));
}
return; default:
buffers_.consume(bytes_transferred);
@@ -237,7 +230,7 @@ namespace detail
}
}
- ASIO_MOVE_OR_LVALUE(WriteHandler)(handler_)(
+ static_cast<WriteHandler&&>(handler_)(
static_cast<const asio::error_code&>(ec),
static_cast<const std::size_t&>(buffers_.total_consumed()));
}
@@ -257,38 +250,6 @@ namespace detail
template <typename AsyncRandomAccessWriteDevice,
typename ConstBufferSequence, typename ConstBufferIterator,
typename CompletionCondition, typename WriteHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- write_at_op<AsyncRandomAccessWriteDevice, ConstBufferSequence,
- ConstBufferIterator, CompletionCondition, WriteHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncRandomAccessWriteDevice,
- typename ConstBufferSequence, typename ConstBufferIterator,
- typename CompletionCondition, typename WriteHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- write_at_op<AsyncRandomAccessWriteDevice, ConstBufferSequence,
- ConstBufferIterator, CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename AsyncRandomAccessWriteDevice,
- typename ConstBufferSequence, typename ConstBufferIterator,
- typename CompletionCondition, typename WriteHandler>
inline bool asio_handler_is_continuation(
write_at_op<AsyncRandomAccessWriteDevice, ConstBufferSequence,
ConstBufferIterator, CompletionCondition, WriteHandler>* this_handler)
@@ -298,40 +259,10 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename AsyncRandomAccessWriteDevice,
- typename ConstBufferSequence, typename ConstBufferIterator,
- typename CompletionCondition, typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- write_at_op<AsyncRandomAccessWriteDevice, ConstBufferSequence,
- ConstBufferIterator, CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename AsyncRandomAccessWriteDevice,
- typename ConstBufferSequence, typename ConstBufferIterator,
- typename CompletionCondition, typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- write_at_op<AsyncRandomAccessWriteDevice, ConstBufferSequence,
- ConstBufferIterator, CompletionCondition, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncRandomAccessWriteDevice,
typename ConstBufferSequence, typename ConstBufferIterator,
typename CompletionCondition, typename WriteHandler>
- inline void start_write_at_buffer_sequence_op(AsyncRandomAccessWriteDevice& d,
+ inline void start_write_at_op(AsyncRandomAccessWriteDevice& d,
uint64_t offset, const ConstBufferSequence& buffers,
const ConstBufferIterator&, CompletionCondition& completion_condition,
WriteHandler& handler)
@@ -343,27 +274,26 @@ namespace detail
}
template <typename AsyncRandomAccessWriteDevice>
- class initiate_async_write_at_buffer_sequence
+ class initiate_async_write_at
{
public:
typedef typename AsyncRandomAccessWriteDevice::executor_type executor_type;
- explicit initiate_async_write_at_buffer_sequence(
- AsyncRandomAccessWriteDevice& device)
+ explicit initiate_async_write_at(AsyncRandomAccessWriteDevice& device)
: device_(device)
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return device_.get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence,
typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
uint64_t offset, const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
+ CompletionCondition&& completion_cond) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WriteHandler.
@@ -371,7 +301,7 @@ namespace detail
non_const_lvalue<WriteHandler> handler2(handler);
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
- start_write_at_buffer_sequence_op(device_, offset, buffers,
+ start_write_at_op(device_, offset, buffers,
asio::buffer_sequence_begin(buffers),
completion_cond2.value, handler2.value);
}
@@ -396,8 +326,17 @@ struct associator<Associator,
static typename Associator<WriteHandler, DefaultCandidate>::type get(
const detail::write_at_op<AsyncRandomAccessWriteDevice,
ConstBufferSequence, ConstBufferIterator,
+ CompletionCondition, WriteHandler>& h) noexcept
+ {
+ return Associator<WriteHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
+ const detail::write_at_op<AsyncRandomAccessWriteDevice,
+ ConstBufferSequence, ConstBufferIterator,
CompletionCondition, WriteHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -408,36 +347,41 @@ struct associator<Associator,
template <typename AsyncRandomAccessWriteDevice,
typename ConstBufferSequence, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d,
+ std::size_t)) WriteToken>
+inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
uint64_t offset, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler)
+ CompletionCondition completion_condition, WriteToken&& token)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_at<
+ AsyncRandomAccessWriteDevice>>(),
+ token, offset, buffers,
+ static_cast<CompletionCondition&&>(completion_condition)))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_write_at_buffer_sequence<
- AsyncRandomAccessWriteDevice>(d),
- handler, offset, buffers,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ detail::initiate_async_write_at<AsyncRandomAccessWriteDevice>(d),
+ token, offset, buffers,
+ static_cast<CompletionCondition&&>(completion_condition));
}
template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d,
- uint64_t offset, const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler)
+ std::size_t)) WriteToken>
+inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
+ uint64_t offset, const ConstBufferSequence& buffers, WriteToken&& token)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_at<
+ AsyncRandomAccessWriteDevice>>(),
+ token, offset, buffers, transfer_all()))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- detail::initiate_async_write_at_buffer_sequence<
- AsyncRandomAccessWriteDevice>(d),
- handler, offset, buffers, transfer_all());
+ detail::initiate_async_write_at<AsyncRandomAccessWriteDevice>(d),
+ token, offset, buffers, transfer_all());
}
#if !defined(ASIO_NO_EXTENSIONS)
@@ -453,11 +397,10 @@ namespace detail
asio::basic_streambuf<Allocator>& streambuf,
WriteHandler& handler)
: streambuf_(streambuf),
- handler_(ASIO_MOVE_CAST(WriteHandler)(handler))
+ handler_(static_cast<WriteHandler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
write_at_streambuf_op(const write_at_streambuf_op& other)
: streambuf_(other.streambuf_),
handler_(other.handler_)
@@ -466,16 +409,15 @@ namespace detail
write_at_streambuf_op(write_at_streambuf_op&& other)
: streambuf_(other.streambuf_),
- handler_(ASIO_MOVE_CAST(WriteHandler)(other.handler_))
+ handler_(static_cast<WriteHandler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
const std::size_t bytes_transferred)
{
streambuf_.consume(bytes_transferred);
- ASIO_MOVE_OR_LVALUE(WriteHandler)(handler_)(ec, bytes_transferred);
+ static_cast<WriteHandler&&>(handler_)(ec, bytes_transferred);
}
//private:
@@ -484,32 +426,6 @@ namespace detail
};
template <typename Allocator, typename WriteHandler>
- inline asio_handler_allocate_is_deprecated
- asio_handler_allocate(std::size_t size,
- write_at_streambuf_op<Allocator, WriteHandler>* this_handler)
- {
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Allocator, typename WriteHandler>
- inline asio_handler_deallocate_is_deprecated
- asio_handler_deallocate(void* pointer, std::size_t size,
- write_at_streambuf_op<Allocator, WriteHandler>* this_handler)
- {
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Allocator, typename WriteHandler>
inline bool asio_handler_is_continuation(
write_at_streambuf_op<Allocator, WriteHandler>* this_handler)
{
@@ -517,30 +433,6 @@ namespace detail
this_handler->handler_);
}
- template <typename Function, typename Allocator, typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(Function& function,
- write_at_streambuf_op<Allocator, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
- template <typename Function, typename Allocator, typename WriteHandler>
- inline asio_handler_invoke_is_deprecated
- asio_handler_invoke(const Function& function,
- write_at_streambuf_op<Allocator, WriteHandler>* this_handler)
- {
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
- }
-
template <typename AsyncRandomAccessWriteDevice>
class initiate_async_write_at_streambuf
{
@@ -553,16 +445,16 @@ namespace detail
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return device_.get_executor();
}
template <typename WriteHandler,
typename Allocator, typename CompletionCondition>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
uint64_t offset, basic_streambuf<Allocator>* b,
- ASIO_MOVE_ARG(CompletionCondition) completion_condition) const
+ CompletionCondition&& completion_condition) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WriteHandler.
@@ -570,8 +462,8 @@ namespace detail
non_const_lvalue<WriteHandler> handler2(handler);
async_write_at(device_, offset, b->data(),
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition),
- write_at_streambuf_op<Allocator, typename decay<WriteHandler>::type>(
+ static_cast<CompletionCondition&&>(completion_condition),
+ write_at_streambuf_op<Allocator, decay_t<WriteHandler>>(
*b, handler2.value));
}
@@ -590,8 +482,15 @@ struct associator<Associator,
: Associator<WriteHandler, DefaultCandidate>
{
static typename Associator<WriteHandler, DefaultCandidate>::type get(
+ const detail::write_at_streambuf_op<Executor, WriteHandler>& h) noexcept
+ {
+ return Associator<WriteHandler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(
const detail::write_at_streambuf_op<Executor, WriteHandler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<WriteHandler, DefaultCandidate>::get(h.handler_, c);
}
@@ -602,36 +501,44 @@ struct associator<Associator,
template <typename AsyncRandomAccessWriteDevice,
typename Allocator, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d,
+ std::size_t)) WriteToken>
+inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
uint64_t offset, asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler)
+ CompletionCondition completion_condition, WriteToken&& token)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_at_streambuf<
+ AsyncRandomAccessWriteDevice>>(),
+ token, offset, &b,
+ static_cast<CompletionCondition&&>(completion_condition)))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_write_at_streambuf<
AsyncRandomAccessWriteDevice>(d),
- handler, offset, &b,
- ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
+ token, offset, &b,
+ static_cast<CompletionCondition&&>(completion_condition));
}
template <typename AsyncRandomAccessWriteDevice, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d,
+ std::size_t)) WriteToken>
+inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
uint64_t offset, asio::basic_streambuf<Allocator>& b,
- ASIO_MOVE_ARG(WriteHandler) handler)
+ WriteToken&& token)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_at_streambuf<
+ AsyncRandomAccessWriteDevice>>(),
+ token, offset, &b, transfer_all()))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
detail::initiate_async_write_at_streambuf<
AsyncRandomAccessWriteDevice>(d),
- handler, offset, &b, transfer_all());
+ token, offset, &b, transfer_all());
}
#endif // !defined(ASIO_NO_IOSTREAM)
diff --git a/3rdparty/asio/include/asio/io_context.hpp b/3rdparty/asio/include/asio/io_context.hpp
index 7b69418c1b7..5de125685fc 100644
--- a/3rdparty/asio/include/asio/io_context.hpp
+++ b/3rdparty/asio/include/asio/io_context.hpp
@@ -2,7 +2,7 @@
// io_context.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,15 +20,14 @@
#include <stdexcept>
#include <typeinfo>
#include "asio/async_result.hpp"
+#include "asio/detail/chrono.hpp"
+#include "asio/detail/concurrency_hint.hpp"
+#include "asio/detail/cstdint.hpp"
#include "asio/detail/wrapped_handler.hpp"
#include "asio/error_code.hpp"
#include "asio/execution.hpp"
#include "asio/execution_context.hpp"
-#if defined(ASIO_HAS_CHRONO)
-# include "asio/detail/chrono.hpp"
-#endif // defined(ASIO_HAS_CHRONO)
-
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
# include "asio/detail/winsock_init.hpp"
#elif defined(__sun) || defined(__QNX__) || defined(__hpux) || defined(_AIX) \
@@ -56,9 +55,10 @@ namespace detail {
struct io_context_bits
{
- ASIO_STATIC_CONSTEXPR(unsigned int, blocking_never = 1);
- ASIO_STATIC_CONSTEXPR(unsigned int, relationship_continuation = 2);
- ASIO_STATIC_CONSTEXPR(unsigned int, outstanding_work_tracked = 4);
+ static constexpr uintptr_t blocking_never = 1;
+ static constexpr uintptr_t relationship_continuation = 2;
+ static constexpr uintptr_t outstanding_work_tracked = 4;
+ static constexpr uintptr_t runtime_bits = 3;
};
} // namespace detail
@@ -166,30 +166,12 @@ namespace detail {
* returning when there is no more work to do. For example, the io_context may
* be being run in a background thread that is launched prior to the
* application's asynchronous operations. The run() call may be kept running by
- * creating an executor that tracks work against the io_context:
- *
- * @code asio::io_context io_context;
- * auto work = asio::require(io_context.get_executor(),
- * asio::execution::outstanding_work.tracked);
- * ... @endcode
- *
- * If using C++03, which lacks automatic variable type deduction, you may
- * compute the return type of the require call:
+ * using the @ref make_work_guard function to create an object of type
+ * asio::executor_work_guard<io_context::executor_type>:
*
* @code asio::io_context io_context;
- * typename asio::require_result<
- * asio::io_context::executor_type,
- * asio::exeution::outstanding_work_t::tracked_t>
- * work = asio::require(io_context.get_executor(),
- * asio::execution::outstanding_work.tracked);
- * ... @endcode
- *
- * or store the result in the type-erasing executor wrapper, any_io_executor:
- *
- * @code asio::io_context io_context;
- * asio::any_io_executor work
- * = asio::require(io_context.get_executor(),
- * asio::execution::outstanding_work.tracked);
+ * asio::executor_work_guard<asio::io_context::executor_type>
+ * = asio::make_work_guard(io_context);
* ... @endcode
*
* To effect a shutdown, the application will then need to call the io_context
@@ -198,15 +180,13 @@ namespace detail {
* permitting ready handlers to be dispatched.
*
* Alternatively, if the application requires that all operations and handlers
- * be allowed to finish normally, store the work-tracking executor in an
- * any_io_executor object, so that it may be explicitly reset.
+ * be allowed to finish normally, the work object may be explicitly reset.
*
* @code asio::io_context io_context;
- * asio::any_io_executor work
- * = asio::require(io_context.get_executor(),
- * asio::execution::outstanding_work.tracked);
+ * asio::executor_work_guard<asio::io_context::executor_type>
+ * = asio::make_work_guard(io_context);
* ...
- * work = asio::any_io_executor(); // Allow run() to exit. @endcode
+ * work.reset(); // Allow run() to exit. @endcode
*/
class io_context
: public execution_context
@@ -217,11 +197,16 @@ private:
friend class detail::win_iocp_overlapped_ptr;
#endif
+#if !defined(ASIO_NO_DEPRECATED)
+ struct initiate_dispatch;
+ struct initiate_post;
+#endif // !defined(ASIO_NO_DEPRECATED)
+
public:
- template <typename Allocator, unsigned int Bits>
+ template <typename Allocator, uintptr_t Bits>
class basic_executor_type;
- template <typename Allocator, unsigned int Bits>
+ template <typename Allocator, uintptr_t Bits>
friend class basic_executor_type;
/// Executor used to submit functions to an io_context.
@@ -290,7 +275,7 @@ public:
ASIO_DECL ~io_context();
/// Obtains the executor associated with the io_context.
- executor_type get_executor() ASIO_NOEXCEPT;
+ executor_type get_executor() noexcept;
/// Run the io_context object's event processing loop.
/**
@@ -351,7 +336,6 @@ public:
ASIO_DECL count_type run(asio::error_code& ec);
#endif // !defined(ASIO_NO_DEPRECATED)
-#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
/// Run the io_context object's event processing loop for a specified
/// duration.
/**
@@ -378,7 +362,6 @@ public:
*/
template <typename Clock, typename Duration>
std::size_t run_until(const chrono::time_point<Clock, Duration>& abs_time);
-#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
/// Run the io_context object's event processing loop to execute at most one
/// handler.
@@ -400,7 +383,7 @@ public:
ASIO_DECL count_type run_one();
#if !defined(ASIO_NO_DEPRECATED)
- /// (Deprecated: Use non-error_code overlaod.) Run the io_context object's
+ /// (Deprecated: Use non-error_code overload.) Run the io_context object's
/// event processing loop to execute at most one handler.
/**
* The run_one() function blocks until one handler has been dispatched, or
@@ -422,7 +405,6 @@ public:
ASIO_DECL count_type run_one(asio::error_code& ec);
#endif // !defined(ASIO_NO_DEPRECATED)
-#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
/// Run the io_context object's event processing loop for a specified duration
/// to execute at most one handler.
/**
@@ -451,7 +433,6 @@ public:
template <typename Clock, typename Duration>
std::size_t run_one_until(
const chrono::time_point<Clock, Duration>& abs_time);
-#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
/// Run the io_context object's event processing loop to execute ready
/// handlers.
@@ -566,15 +547,17 @@ public:
*
* @note This function throws an exception only if:
*
- * @li the handler's @c asio_handler_allocate function; or
+ * @li the handler's associated allocator; or
*
* @li the handler's copy constructor
*
* throws an exception.
*/
template <typename LegacyCompletionHandler>
- ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
- dispatch(ASIO_MOVE_ARG(LegacyCompletionHandler) handler);
+ auto dispatch(LegacyCompletionHandler&& handler)
+ -> decltype(
+ async_initiate<LegacyCompletionHandler, void ()>(
+ declval<initiate_dispatch>(), handler, this));
/// (Deprecated: Use asio::post().) Request the io_context to invoke
/// the given handler and return immediately.
@@ -593,15 +576,17 @@ public:
*
* @note This function throws an exception only if:
*
- * @li the handler's @c asio_handler_allocate function; or
+ * @li the handler's associated allocator; or
*
* @li the handler's copy constructor
*
* throws an exception.
*/
template <typename LegacyCompletionHandler>
- ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
- post(ASIO_MOVE_ARG(LegacyCompletionHandler) handler);
+ auto post(LegacyCompletionHandler&& handler)
+ -> decltype(
+ async_initiate<LegacyCompletionHandler, void ()>(
+ declval<initiate_post>(), handler, this));
/// (Deprecated: Use asio::bind_executor().) Create a new handler that
/// automatically dispatches the wrapped handler on the io_context.
@@ -635,13 +620,8 @@ public:
#endif // !defined(ASIO_NO_DEPRECATED)
private:
- io_context(const io_context&) ASIO_DELETED;
- io_context& operator=(const io_context&) ASIO_DELETED;
-
-#if !defined(ASIO_NO_DEPRECATED)
- struct initiate_dispatch;
- struct initiate_post;
-#endif // !defined(ASIO_NO_DEPRECATED)
+ io_context(const io_context&) = delete;
+ io_context& operator=(const io_context&) = delete;
// Helper function to add the implementation.
ASIO_DECL impl_type& add_impl(impl_type* impl);
@@ -662,56 +642,44 @@ private:
impl_type& impl_;
};
-namespace detail {
-
-} // namespace detail
-
/// Executor implementation type used to submit functions to an io_context.
-template <typename Allocator, unsigned int Bits>
-class io_context::basic_executor_type : detail::io_context_bits
+template <typename Allocator, uintptr_t Bits>
+class io_context::basic_executor_type :
+ detail::io_context_bits, Allocator
{
public:
/// Copy constructor.
- basic_executor_type(
- const basic_executor_type& other) ASIO_NOEXCEPT
- : io_context_(other.io_context_),
- allocator_(other.allocator_),
- bits_(other.bits_)
+ basic_executor_type(const basic_executor_type& other) noexcept
+ : Allocator(static_cast<const Allocator&>(other)),
+ target_(other.target_)
{
if (Bits & outstanding_work_tracked)
- if (io_context_)
- io_context_->impl_.work_started();
+ if (context_ptr())
+ context_ptr()->impl_.work_started();
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move constructor.
- basic_executor_type(basic_executor_type&& other) ASIO_NOEXCEPT
- : io_context_(other.io_context_),
- allocator_(ASIO_MOVE_CAST(Allocator)(other.allocator_)),
- bits_(other.bits_)
+ basic_executor_type(basic_executor_type&& other) noexcept
+ : Allocator(static_cast<Allocator&&>(other)),
+ target_(other.target_)
{
if (Bits & outstanding_work_tracked)
- other.io_context_ = 0;
+ other.target_ = 0;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destructor.
- ~basic_executor_type() ASIO_NOEXCEPT
+ ~basic_executor_type() noexcept
{
if (Bits & outstanding_work_tracked)
- if (io_context_)
- io_context_->impl_.work_finished();
+ if (context_ptr())
+ context_ptr()->impl_.work_finished();
}
/// Assignment operator.
- basic_executor_type& operator=(
- const basic_executor_type& other) ASIO_NOEXCEPT;
+ basic_executor_type& operator=(const basic_executor_type& other) noexcept;
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move assignment operator.
- basic_executor_type& operator=(
- basic_executor_type&& other) ASIO_NOEXCEPT;
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+ basic_executor_type& operator=(basic_executor_type&& other) noexcept;
#if !defined(GENERATING_DOCUMENTATION)
private:
@@ -729,11 +697,10 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::blocking.possibly); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type require(
- execution::blocking_t::possibly_t) const
+ constexpr basic_executor_type require(execution::blocking_t::possibly_t) const
{
- return basic_executor_type(io_context_,
- allocator_, bits_ & ~blocking_never);
+ return basic_executor_type(context_ptr(),
+ *this, bits() & ~blocking_never);
}
/// Obtain an executor with the @c blocking.never property.
@@ -746,11 +713,10 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::blocking.never); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type require(
- execution::blocking_t::never_t) const
+ constexpr basic_executor_type require(execution::blocking_t::never_t) const
{
- return basic_executor_type(io_context_,
- allocator_, bits_ | blocking_never);
+ return basic_executor_type(context_ptr(),
+ *this, bits() | blocking_never);
}
/// Obtain an executor with the @c relationship.fork property.
@@ -763,11 +729,10 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::relationship.fork); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type require(
- execution::relationship_t::fork_t) const
+ constexpr basic_executor_type require(execution::relationship_t::fork_t) const
{
- return basic_executor_type(io_context_,
- allocator_, bits_ & ~relationship_continuation);
+ return basic_executor_type(context_ptr(),
+ *this, bits() & ~relationship_continuation);
}
/// Obtain an executor with the @c relationship.continuation property.
@@ -780,11 +745,11 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::relationship.continuation); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type require(
+ constexpr basic_executor_type require(
execution::relationship_t::continuation_t) const
{
- return basic_executor_type(io_context_,
- allocator_, bits_ | relationship_continuation);
+ return basic_executor_type(context_ptr(),
+ *this, bits() | relationship_continuation);
}
/// Obtain an executor with the @c outstanding_work.tracked property.
@@ -797,12 +762,12 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::outstanding_work.tracked); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type<Allocator,
+ constexpr basic_executor_type<Allocator,
ASIO_UNSPECIFIED(Bits | outstanding_work_tracked)>
require(execution::outstanding_work_t::tracked_t) const
{
return basic_executor_type<Allocator, Bits | outstanding_work_tracked>(
- io_context_, allocator_, bits_);
+ context_ptr(), *this, bits());
}
/// Obtain an executor with the @c outstanding_work.untracked property.
@@ -815,12 +780,12 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::outstanding_work.untracked); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type<Allocator,
+ constexpr basic_executor_type<Allocator,
ASIO_UNSPECIFIED(Bits & ~outstanding_work_tracked)>
require(execution::outstanding_work_t::untracked_t) const
{
return basic_executor_type<Allocator, Bits & ~outstanding_work_tracked>(
- io_context_, allocator_, bits_);
+ context_ptr(), *this, bits());
}
/// Obtain an executor with the specified @c allocator property.
@@ -834,11 +799,11 @@ private:
* asio::execution::allocator(my_allocator)); @endcode
*/
template <typename OtherAllocator>
- ASIO_CONSTEXPR basic_executor_type<OtherAllocator, Bits>
+ constexpr basic_executor_type<OtherAllocator, Bits>
require(execution::allocator_t<OtherAllocator> a) const
{
return basic_executor_type<OtherAllocator, Bits>(
- io_context_, a.value(), bits_);
+ context_ptr(), a.value(), bits());
}
/// Obtain an executor with the default @c allocator property.
@@ -851,11 +816,11 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::allocator); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type<std::allocator<void>, Bits>
+ constexpr basic_executor_type<std::allocator<void>, Bits>
require(execution::allocator_t<void>) const
{
return basic_executor_type<std::allocator<void>, Bits>(
- io_context_, std::allocator<void>(), bits_);
+ context_ptr(), std::allocator<void>(), bits());
}
#if !defined(GENERATING_DOCUMENTATION)
@@ -876,8 +841,7 @@ private:
* == asio::execution::mapping.thread)
* ... @endcode
*/
- static ASIO_CONSTEXPR execution::mapping_t query(
- execution::mapping_t) ASIO_NOEXCEPT
+ static constexpr execution::mapping_t query(execution::mapping_t) noexcept
{
return execution::mapping.thread;
}
@@ -892,9 +856,9 @@ private:
* asio::io_context& ctx = asio::query(
* ex, asio::execution::context); @endcode
*/
- io_context& query(execution::context_t) const ASIO_NOEXCEPT
+ io_context& query(execution::context_t) const noexcept
{
- return *io_context_;
+ return *context_ptr();
}
/// Query the current value of the @c blocking property.
@@ -908,10 +872,9 @@ private:
* == asio::execution::blocking.always)
* ... @endcode
*/
- ASIO_CONSTEXPR execution::blocking_t query(
- execution::blocking_t) const ASIO_NOEXCEPT
+ constexpr execution::blocking_t query(execution::blocking_t) const noexcept
{
- return (bits_ & blocking_never)
+ return (bits() & blocking_never)
? execution::blocking_t(execution::blocking.never)
: execution::blocking_t(execution::blocking.possibly);
}
@@ -927,10 +890,10 @@ private:
* == asio::execution::relationship.continuation)
* ... @endcode
*/
- ASIO_CONSTEXPR execution::relationship_t query(
- execution::relationship_t) const ASIO_NOEXCEPT
+ constexpr execution::relationship_t query(
+ execution::relationship_t) const noexcept
{
- return (bits_ & relationship_continuation)
+ return (bits() & relationship_continuation)
? execution::relationship_t(execution::relationship.continuation)
: execution::relationship_t(execution::relationship.fork);
}
@@ -946,8 +909,8 @@ private:
* == asio::execution::outstanding_work.tracked)
* ... @endcode
*/
- static ASIO_CONSTEXPR execution::outstanding_work_t query(
- execution::outstanding_work_t) ASIO_NOEXCEPT
+ static constexpr execution::outstanding_work_t query(
+ execution::outstanding_work_t) noexcept
{
return (Bits & outstanding_work_tracked)
? execution::outstanding_work_t(execution::outstanding_work.tracked)
@@ -965,10 +928,10 @@ private:
* asio::execution::allocator); @endcode
*/
template <typename OtherAllocator>
- ASIO_CONSTEXPR Allocator query(
- execution::allocator_t<OtherAllocator>) const ASIO_NOEXCEPT
+ constexpr Allocator query(
+ execution::allocator_t<OtherAllocator>) const noexcept
{
- return allocator_;
+ return static_cast<const Allocator&>(*this);
}
/// Query the current value of the @c allocator property.
@@ -981,10 +944,9 @@ private:
* auto alloc = asio::query(ex,
* asio::execution::allocator); @endcode
*/
- ASIO_CONSTEXPR Allocator query(
- execution::allocator_t<void>) const ASIO_NOEXCEPT
+ constexpr Allocator query(execution::allocator_t<void>) const noexcept
{
- return allocator_;
+ return static_cast<const Allocator&>(*this);
}
public:
@@ -993,18 +955,17 @@ public:
* @return @c true if the current thread is running the io_context. Otherwise
* returns @c false.
*/
- bool running_in_this_thread() const ASIO_NOEXCEPT;
+ bool running_in_this_thread() const noexcept;
/// Compare two executors for equality.
/**
* Two executors are equal if they refer to the same underlying io_context.
*/
friend bool operator==(const basic_executor_type& a,
- const basic_executor_type& b) ASIO_NOEXCEPT
+ const basic_executor_type& b) noexcept
{
- return a.io_context_ == b.io_context_
- && a.allocator_ == b.allocator_
- && a.bits_ == b.bits_;
+ return a.target_ == b.target_
+ && static_cast<const Allocator&>(a) == static_cast<const Allocator&>(b);
}
/// Compare two executors for inequality.
@@ -1012,34 +973,20 @@ public:
* Two executors are equal if they refer to the same underlying io_context.
*/
friend bool operator!=(const basic_executor_type& a,
- const basic_executor_type& b) ASIO_NOEXCEPT
+ const basic_executor_type& b) noexcept
{
- return a.io_context_ != b.io_context_
- || a.allocator_ != b.allocator_
- || a.bits_ != b.bits_;
+ return a.target_ != b.target_
+ || static_cast<const Allocator&>(a) != static_cast<const Allocator&>(b);
}
-#if !defined(GENERATING_DOCUMENTATION)
-private:
- friend struct asio_execution_execute_fn::impl;
-#endif // !defined(GENERATING_DOCUMENTATION)
-
/// Execution function.
- /**
- * Do not call this function directly. It is intended for use with the
- * execution::execute customisation point.
- *
- * For example:
- * @code auto ex = my_io_context.get_executor();
- * execution::execute(ex, my_function_object); @endcode
- */
template <typename Function>
- void execute(ASIO_MOVE_ARG(Function) f) const;
+ void execute(Function&& f) const;
#if !defined(ASIO_NO_TS_EXECUTORS)
public:
/// Obtain the underlying execution context.
- io_context& context() const ASIO_NOEXCEPT;
+ io_context& context() const noexcept;
/// Inform the io_context that it has some outstanding work to do.
/**
@@ -1047,7 +994,7 @@ public:
* This ensures that the io_context's run() and run_one() functions do not
* exit while the work is underway.
*/
- void on_work_started() const ASIO_NOEXCEPT;
+ void on_work_started() const noexcept;
/// Inform the io_context that some work is no longer outstanding.
/**
@@ -1055,7 +1002,7 @@ public:
* finished. Once the count of unfinished work reaches zero, the io_context
* is stopped and the run() and run_one() functions may exit.
*/
- void on_work_finished() const ASIO_NOEXCEPT;
+ void on_work_finished() const noexcept;
/// Request the io_context to invoke the given function object.
/**
@@ -1072,8 +1019,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename OtherAllocator>
- void dispatch(ASIO_MOVE_ARG(Function) f,
- const OtherAllocator& a) const;
+ void dispatch(Function&& f, const OtherAllocator& a) const;
/// Request the io_context to invoke the given function object.
/**
@@ -1089,8 +1035,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename OtherAllocator>
- void post(ASIO_MOVE_ARG(Function) f,
- const OtherAllocator& a) const;
+ void post(Function&& f, const OtherAllocator& a) const;
/// Request the io_context to invoke the given function object.
/**
@@ -1110,44 +1055,45 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename OtherAllocator>
- void defer(ASIO_MOVE_ARG(Function) f,
- const OtherAllocator& a) const;
+ void defer(Function&& f, const OtherAllocator& a) const;
#endif // !defined(ASIO_NO_TS_EXECUTORS)
private:
friend class io_context;
- template <typename, unsigned int> friend class basic_executor_type;
+ template <typename, uintptr_t> friend class basic_executor_type;
// Constructor used by io_context::get_executor().
- explicit basic_executor_type(io_context& i) ASIO_NOEXCEPT
- : io_context_(&i),
- allocator_(),
- bits_(0)
+ explicit basic_executor_type(io_context& i) noexcept
+ : Allocator(),
+ target_(reinterpret_cast<uintptr_t>(&i))
{
if (Bits & outstanding_work_tracked)
- io_context_->impl_.work_started();
+ context_ptr()->impl_.work_started();
}
// Constructor used by require().
basic_executor_type(io_context* i,
- const Allocator& a, unsigned int bits) ASIO_NOEXCEPT
- : io_context_(i),
- allocator_(a),
- bits_(bits)
+ const Allocator& a, uintptr_t bits) noexcept
+ : Allocator(a),
+ target_(reinterpret_cast<uintptr_t>(i) | bits)
{
if (Bits & outstanding_work_tracked)
- if (io_context_)
- io_context_->impl_.work_started();
+ if (context_ptr())
+ context_ptr()->impl_.work_started();
}
- // The underlying io_context.
- io_context* io_context_;
+ io_context* context_ptr() const noexcept
+ {
+ return reinterpret_cast<io_context*>(target_ & ~runtime_bits);
+ }
- // The allocator used for execution functions.
- Allocator allocator_;
+ uintptr_t bits() const noexcept
+ {
+ return target_ & runtime_bits;
+ }
- // The runtime-switched properties of the io_context executor.
- unsigned int bits_;
+ // The underlying io_context and runtime bits.
+ uintptr_t target_;
};
#if !defined(ASIO_NO_DEPRECATED)
@@ -1278,27 +1224,27 @@ namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct equality_comparable<
asio::io_context::basic_executor_type<Allocator, Bits>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-template <typename Allocator, unsigned int Bits, typename Function>
+template <typename Allocator, uintptr_t Bits, typename Function>
struct execute_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
Function
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -1306,99 +1252,99 @@ struct execute_member<
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct require_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::blocking_t::possibly_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::io_context::basic_executor_type<
Allocator, Bits> result_type;
};
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct require_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::blocking_t::never_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::io_context::basic_executor_type<
Allocator, Bits> result_type;
};
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct require_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::relationship_t::fork_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::io_context::basic_executor_type<
Allocator, Bits> result_type;
};
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct require_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::relationship_t::continuation_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::io_context::basic_executor_type<
Allocator, Bits> result_type;
};
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct require_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::outstanding_work_t::tracked_t
> : asio::detail::io_context_bits
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::io_context::basic_executor_type<
Allocator, Bits | outstanding_work_tracked> result_type;
};
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct require_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::outstanding_work_t::untracked_t
> : asio::detail::io_context_bits
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::io_context::basic_executor_type<
Allocator, Bits & ~outstanding_work_tracked> result_type;
};
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct require_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::allocator_t<void>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::io_context::basic_executor_type<
std::allocator<void>, Bits> result_type;
};
-template <unsigned int Bits,
+template <uintptr_t Bits,
typename Allocator, typename OtherAllocator>
struct require_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::allocator_t<OtherAllocator>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::io_context::basic_executor_type<
OtherAllocator, Bits> result_type;
};
@@ -1407,7 +1353,7 @@ struct require_member<
#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
-template <typename Allocator, unsigned int Bits, typename Property>
+template <typename Allocator, uintptr_t Bits, typename Property>
struct query_static_constexpr_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
Property,
@@ -1419,11 +1365,11 @@ struct query_static_constexpr_member<
>::type
> : asio::detail::io_context_bits
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::outstanding_work_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return (Bits & outstanding_work_tracked)
? execution::outstanding_work_t(execution::outstanding_work.tracked)
@@ -1431,7 +1377,7 @@ struct query_static_constexpr_member<
}
};
-template <typename Allocator, unsigned int Bits, typename Property>
+template <typename Allocator, uintptr_t Bits, typename Property>
struct query_static_constexpr_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
Property,
@@ -1443,11 +1389,11 @@ struct query_static_constexpr_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::mapping_t::thread_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -1457,7 +1403,7 @@ struct query_static_constexpr_member<
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
-template <typename Allocator, unsigned int Bits, typename Property>
+template <typename Allocator, uintptr_t Bits, typename Property>
struct query_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
Property,
@@ -1469,12 +1415,12 @@ struct query_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::blocking_t result_type;
};
-template <typename Allocator, unsigned int Bits, typename Property>
+template <typename Allocator, uintptr_t Bits, typename Property>
struct query_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
Property,
@@ -1486,41 +1432,41 @@ struct query_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::relationship_t result_type;
};
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct query_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::context_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::io_context& result_type;
};
-template <typename Allocator, unsigned int Bits>
+template <typename Allocator, uintptr_t Bits>
struct query_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::allocator_t<void>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Allocator result_type;
};
-template <typename Allocator, unsigned int Bits, typename OtherAllocator>
+template <typename Allocator, uintptr_t Bits, typename OtherAllocator>
struct query_member<
asio::io_context::basic_executor_type<Allocator, Bits>,
asio::execution::allocator_t<OtherAllocator>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Allocator result_type;
};
@@ -1528,6 +1474,15 @@ struct query_member<
} // namespace traits
+namespace execution {
+
+template <>
+struct is_executor<io_context> : false_type
+{
+};
+
+} // namespace execution
+
#endif // !defined(GENERATING_DOCUMENTATION)
} // namespace asio
diff --git a/3rdparty/asio/include/asio/io_context_strand.hpp b/3rdparty/asio/include/asio/io_context_strand.hpp
index 8cd17cfbfc5..288ac238feb 100644
--- a/3rdparty/asio/include/asio/io_context_strand.hpp
+++ b/3rdparty/asio/include/asio/io_context_strand.hpp
@@ -2,7 +2,7 @@
// io_context_strand.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -64,8 +64,7 @@ namespace asio {
* @li @c s.dispatch(a) happens-before @c s.dispatch(b), where both are
* performed outside the strand
*
- * then @c asio_handler_invoke(a1, &a1) happens-before
- * @c asio_handler_invoke(b1, &b1).
+ * then @c a() happens-before @c b()
*
* Note that in the following case:
* @code async_op_1(..., s.wrap(a));
@@ -88,6 +87,12 @@ namespace asio {
*/
class io_context::strand
{
+private:
+#if !defined(ASIO_NO_DEPRECATED)
+ struct initiate_dispatch;
+ struct initiate_post;
+#endif // !defined(ASIO_NO_DEPRECATED)
+
public:
/// Constructor.
/**
@@ -103,6 +108,17 @@ public:
service_.construct(impl_);
}
+ /// Copy constructor.
+ /**
+ * Creates a copy such that both strand objects share the same underlying
+ * state.
+ */
+ strand(const strand& other) noexcept
+ : service_(other.service_),
+ impl_(other.impl_)
+ {
+ }
+
/// Destructor.
/**
* Destroys a strand.
@@ -115,7 +131,7 @@ public:
}
/// Obtain the underlying execution context.
- asio::io_context& context() const ASIO_NOEXCEPT
+ asio::io_context& context() const noexcept
{
return service_.get_io_context();
}
@@ -124,7 +140,7 @@ public:
/**
* The strand delegates this call to its underlying io_context.
*/
- void on_work_started() const ASIO_NOEXCEPT
+ void on_work_started() const noexcept
{
context().get_executor().on_work_started();
}
@@ -133,7 +149,7 @@ public:
/**
* The strand delegates this call to its underlying io_context.
*/
- void on_work_finished() const ASIO_NOEXCEPT
+ void on_work_finished() const noexcept
{
context().get_executor().on_work_finished();
}
@@ -154,9 +170,9 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename Allocator>
- void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const
+ void dispatch(Function&& f, const Allocator& a) const
{
- typename decay<Function>::type tmp(ASIO_MOVE_CAST(Function)(f));
+ decay_t<Function> tmp(static_cast<Function&&>(f));
service_.dispatch(impl_, tmp);
(void)a;
}
@@ -183,8 +199,10 @@ public:
* @code void handler(); @endcode
*/
template <typename LegacyCompletionHandler>
- ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
- dispatch(ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
+ auto dispatch(LegacyCompletionHandler&& handler)
+ -> decltype(
+ async_initiate<LegacyCompletionHandler, void ()>(
+ declval<initiate_dispatch>(), handler, this))
{
return async_initiate<LegacyCompletionHandler, void ()>(
initiate_dispatch(), handler, this);
@@ -205,9 +223,9 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename Allocator>
- void post(ASIO_MOVE_ARG(Function) f, const Allocator& a) const
+ void post(Function&& f, const Allocator& a) const
{
- typename decay<Function>::type tmp(ASIO_MOVE_CAST(Function)(f));
+ decay_t<Function> tmp(static_cast<Function&&>(f));
service_.post(impl_, tmp);
(void)a;
}
@@ -230,8 +248,10 @@ public:
* @code void handler(); @endcode
*/
template <typename LegacyCompletionHandler>
- ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
- post(ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
+ auto post(LegacyCompletionHandler&& handler)
+ -> decltype(
+ async_initiate<LegacyCompletionHandler, void ()>(
+ declval<initiate_post>(), handler, this))
{
return async_initiate<LegacyCompletionHandler, void ()>(
initiate_post(), handler, this);
@@ -252,9 +272,9 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename Allocator>
- void defer(ASIO_MOVE_ARG(Function) f, const Allocator& a) const
+ void defer(Function&& f, const Allocator& a) const
{
- typename decay<Function>::type tmp(ASIO_MOVE_CAST(Function)(f));
+ decay_t<Function> tmp(static_cast<Function&&>(f));
service_.post(impl_, tmp);
(void)a;
}
@@ -300,7 +320,7 @@ public:
* submitted to the strand using post(), dispatch() or wrap(). Otherwise
* returns @c false.
*/
- bool running_in_this_thread() const ASIO_NOEXCEPT
+ bool running_in_this_thread() const noexcept
{
return service_.running_in_this_thread(impl_);
}
@@ -310,7 +330,7 @@ public:
* Two strands are equal if they refer to the same ordered, non-concurrent
* state.
*/
- friend bool operator==(const strand& a, const strand& b) ASIO_NOEXCEPT
+ friend bool operator==(const strand& a, const strand& b) noexcept
{
return a.impl_ == b.impl_;
}
@@ -320,7 +340,7 @@ public:
* Two strands are equal if they refer to the same ordered, non-concurrent
* state.
*/
- friend bool operator!=(const strand& a, const strand& b) ASIO_NOEXCEPT
+ friend bool operator!=(const strand& a, const strand& b) noexcept
{
return a.impl_ != b.impl_;
}
@@ -330,7 +350,7 @@ private:
struct initiate_dispatch
{
template <typename LegacyCompletionHandler>
- void operator()(ASIO_MOVE_ARG(LegacyCompletionHandler) handler,
+ void operator()(LegacyCompletionHandler&& handler,
strand* self) const
{
// If you get an error on the following line it means that your
@@ -347,7 +367,7 @@ private:
struct initiate_post
{
template <typename LegacyCompletionHandler>
- void operator()(ASIO_MOVE_ARG(LegacyCompletionHandler) handler,
+ void operator()(LegacyCompletionHandler&& handler,
strand* self) const
{
// If you get an error on the following line it means that your
diff --git a/3rdparty/asio/include/asio/io_service.hpp b/3rdparty/asio/include/asio/io_service.hpp
index 7290ad159c5..748d8a6a323 100644
--- a/3rdparty/asio/include/asio/io_service.hpp
+++ b/3rdparty/asio/include/asio/io_service.hpp
@@ -2,7 +2,7 @@
// io_service.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/io_service_strand.hpp b/3rdparty/asio/include/asio/io_service_strand.hpp
index 46756a3106a..65bb8db2dd3 100644
--- a/3rdparty/asio/include/asio/io_service_strand.hpp
+++ b/3rdparty/asio/include/asio/io_service_strand.hpp
@@ -2,7 +2,7 @@
// io_service_strand.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/address.hpp b/3rdparty/asio/include/asio/ip/address.hpp
index 1b26c384df5..337abe7fd69 100644
--- a/3rdparty/asio/include/asio/ip/address.hpp
+++ b/3rdparty/asio/include/asio/ip/address.hpp
@@ -2,7 +2,7 @@
// ip/address.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,6 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
+#include <functional>
#include <string>
#include "asio/detail/throw_exception.hpp"
#include "asio/detail/string_view.hpp"
@@ -25,10 +26,6 @@
#include "asio/ip/address_v6.hpp"
#include "asio/ip/bad_address_cast.hpp"
-#if defined(ASIO_HAS_STD_HASH)
-# include <functional>
-#endif // defined(ASIO_HAS_STD_HASH)
-
#if !defined(ASIO_NO_IOSTREAM)
# include <iosfwd>
#endif // !defined(ASIO_NO_IOSTREAM)
@@ -51,48 +48,44 @@ class address
{
public:
/// Default constructor.
- ASIO_DECL address() ASIO_NOEXCEPT;
+ ASIO_DECL address() noexcept;
/// Construct an address from an IPv4 address.
ASIO_DECL address(
- const asio::ip::address_v4& ipv4_address) ASIO_NOEXCEPT;
+ const asio::ip::address_v4& ipv4_address) noexcept;
/// Construct an address from an IPv6 address.
ASIO_DECL address(
- const asio::ip::address_v6& ipv6_address) ASIO_NOEXCEPT;
+ const asio::ip::address_v6& ipv6_address) noexcept;
/// Copy constructor.
- ASIO_DECL address(const address& other) ASIO_NOEXCEPT;
+ ASIO_DECL address(const address& other) noexcept;
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
- ASIO_DECL address(address&& other) ASIO_NOEXCEPT;
-#endif // defined(ASIO_HAS_MOVE)
+ ASIO_DECL address(address&& other) noexcept;
/// Assign from another address.
- ASIO_DECL address& operator=(const address& other) ASIO_NOEXCEPT;
+ ASIO_DECL address& operator=(const address& other) noexcept;
-#if defined(ASIO_HAS_MOVE)
/// Move-assign from another address.
- ASIO_DECL address& operator=(address&& other) ASIO_NOEXCEPT;
-#endif // defined(ASIO_HAS_MOVE)
+ ASIO_DECL address& operator=(address&& other) noexcept;
/// Assign from an IPv4 address.
ASIO_DECL address& operator=(
- const asio::ip::address_v4& ipv4_address) ASIO_NOEXCEPT;
+ const asio::ip::address_v4& ipv4_address) noexcept;
/// Assign from an IPv6 address.
ASIO_DECL address& operator=(
- const asio::ip::address_v6& ipv6_address) ASIO_NOEXCEPT;
+ const asio::ip::address_v6& ipv6_address) noexcept;
/// Get whether the address is an IP version 4 address.
- bool is_v4() const ASIO_NOEXCEPT
+ bool is_v4() const noexcept
{
return type_ == ipv4;
}
/// Get whether the address is an IP version 6 address.
- bool is_v6() const ASIO_NOEXCEPT
+ bool is_v6() const noexcept
{
return type_ == ipv6;
}
@@ -133,46 +126,46 @@ public:
#endif // !defined(ASIO_NO_DEPRECATED)
/// Determine whether the address is a loopback address.
- ASIO_DECL bool is_loopback() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_loopback() const noexcept;
/// Determine whether the address is unspecified.
- ASIO_DECL bool is_unspecified() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_unspecified() const noexcept;
/// Determine whether the address is a multicast address.
- ASIO_DECL bool is_multicast() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_multicast() const noexcept;
/// Compare two addresses for equality.
ASIO_DECL friend bool operator==(const address& a1,
- const address& a2) ASIO_NOEXCEPT;
+ const address& a2) noexcept;
/// Compare two addresses for inequality.
friend bool operator!=(const address& a1,
- const address& a2) ASIO_NOEXCEPT
+ const address& a2) noexcept
{
return !(a1 == a2);
}
/// Compare addresses for ordering.
ASIO_DECL friend bool operator<(const address& a1,
- const address& a2) ASIO_NOEXCEPT;
+ const address& a2) noexcept;
/// Compare addresses for ordering.
friend bool operator>(const address& a1,
- const address& a2) ASIO_NOEXCEPT
+ const address& a2) noexcept
{
return a2 < a1;
}
/// Compare addresses for ordering.
friend bool operator<=(const address& a1,
- const address& a2) ASIO_NOEXCEPT
+ const address& a2) noexcept
{
return !(a2 < a1);
}
/// Compare addresses for ordering.
friend bool operator>=(const address& a1,
- const address& a2) ASIO_NOEXCEPT
+ const address& a2) noexcept
{
return !(a1 < a2);
}
@@ -201,7 +194,7 @@ ASIO_DECL address make_address(const char* str);
* @relates address
*/
ASIO_DECL address make_address(const char* str,
- asio::error_code& ec) ASIO_NOEXCEPT;
+ asio::error_code& ec) noexcept;
/// Create an address from an IPv4 address string in dotted decimal form,
/// or from an IPv6 address in hexadecimal notation.
@@ -216,7 +209,7 @@ ASIO_DECL address make_address(const std::string& str);
* @relates address
*/
ASIO_DECL address make_address(const std::string& str,
- asio::error_code& ec) ASIO_NOEXCEPT;
+ asio::error_code& ec) noexcept;
#if defined(ASIO_HAS_STRING_VIEW) \
|| defined(GENERATING_DOCUMENTATION)
@@ -234,7 +227,7 @@ ASIO_DECL address make_address(string_view str);
* @relates address
*/
ASIO_DECL address make_address(string_view str,
- asio::error_code& ec) ASIO_NOEXCEPT;
+ asio::error_code& ec) noexcept;
#endif // defined(ASIO_HAS_STRING_VIEW)
// || defined(GENERATING_DOCUMENTATION)
@@ -262,14 +255,13 @@ std::basic_ostream<Elem, Traits>& operator<<(
} // namespace ip
} // namespace asio
-#if defined(ASIO_HAS_STD_HASH)
namespace std {
template <>
struct hash<asio::ip::address>
{
std::size_t operator()(const asio::ip::address& addr)
- const ASIO_NOEXCEPT
+ const noexcept
{
return addr.is_v4()
? std::hash<asio::ip::address_v4>()(addr.to_v4())
@@ -278,7 +270,6 @@ struct hash<asio::ip::address>
};
} // namespace std
-#endif // defined(ASIO_HAS_STD_HASH)
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/ip/address_v4.hpp b/3rdparty/asio/include/asio/ip/address_v4.hpp
index 8babd025d45..ccef6c80cda 100644
--- a/3rdparty/asio/include/asio/ip/address_v4.hpp
+++ b/3rdparty/asio/include/asio/ip/address_v4.hpp
@@ -2,7 +2,7 @@
// ip/address_v4.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,6 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
+#include <functional>
#include <string>
#include "asio/detail/array.hpp"
#include "asio/detail/cstdint.hpp"
@@ -24,10 +25,6 @@
#include "asio/detail/winsock_init.hpp"
#include "asio/error_code.hpp"
-#if defined(ASIO_HAS_STD_HASH)
-# include <functional>
-#endif // defined(ASIO_HAS_STD_HASH)
-
#if !defined(ASIO_NO_IOSTREAM)
# include <iosfwd>
#endif // !defined(ASIO_NO_IOSTREAM)
@@ -64,55 +61,68 @@ public:
#endif
/// Default constructor.
- address_v4() ASIO_NOEXCEPT
+ /**
+ * Initialises the @c address_v4 object such that:
+ * @li <tt>to_bytes()</tt> yields <tt>{0, 0, 0, 0}</tt>; and
+ * @li <tt>to_uint() == 0</tt>.
+ */
+ address_v4() noexcept
{
addr_.s_addr = 0;
}
/// Construct an address from raw bytes.
+ /**
+ * Initialises the @c address_v4 object such that <tt>to_bytes() ==
+ * bytes</tt>.
+ *
+ * @throws out_of_range Thrown if any element in @c bytes is not in the range
+ * <tt>0 - 0xFF</tt>. Note that no range checking is required for platforms
+ * where <tt>std::numeric_limits<unsigned char>::max()</tt> is <tt>0xFF</tt>.
+ */
ASIO_DECL explicit address_v4(const bytes_type& bytes);
/// Construct an address from an unsigned integer in host byte order.
+ /**
+ * Initialises the @c address_v4 object such that <tt>to_uint() == addr</tt>.
+ */
ASIO_DECL explicit address_v4(uint_type addr);
/// Copy constructor.
- address_v4(const address_v4& other) ASIO_NOEXCEPT
+ address_v4(const address_v4& other) noexcept
: addr_(other.addr_)
{
}
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
- address_v4(address_v4&& other) ASIO_NOEXCEPT
+ address_v4(address_v4&& other) noexcept
: addr_(other.addr_)
{
}
-#endif // defined(ASIO_HAS_MOVE)
/// Assign from another address.
- address_v4& operator=(const address_v4& other) ASIO_NOEXCEPT
+ address_v4& operator=(const address_v4& other) noexcept
{
addr_ = other.addr_;
return *this;
}
-#if defined(ASIO_HAS_MOVE)
/// Move-assign from another address.
- address_v4& operator=(address_v4&& other) ASIO_NOEXCEPT
+ address_v4& operator=(address_v4&& other) noexcept
{
addr_ = other.addr_;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
/// Get the address in bytes, in network byte order.
- ASIO_DECL bytes_type to_bytes() const ASIO_NOEXCEPT;
+ ASIO_DECL bytes_type to_bytes() const noexcept;
- /// Get the address as an unsigned integer in host byte order
- ASIO_DECL uint_type to_uint() const ASIO_NOEXCEPT;
+ /// Get the address as an unsigned integer in host byte order.
+ ASIO_DECL uint_type to_uint() const noexcept;
#if !defined(ASIO_NO_DEPRECATED)
- /// Get the address as an unsigned long in host byte order
+ /// (Deprecated: Use to_uint().) Get the address as an unsigned long in host
+ /// byte order.
ASIO_DECL unsigned long to_ulong() const;
#endif // !defined(ASIO_NO_DEPRECATED)
@@ -144,10 +154,23 @@ public:
#endif // !defined(ASIO_NO_DEPRECATED)
/// Determine whether the address is a loopback address.
- ASIO_DECL bool is_loopback() const ASIO_NOEXCEPT;
+ /**
+ * This function tests whether the address is in the address block
+ * <tt>127.0.0.0/8</tt>, which corresponds to the address range
+ * <tt>127.0.0.0 - 127.255.255.255</tt>.
+ *
+ * @returns <tt>(to_uint() & 0xFF000000) == 0x7F000000</tt>.
+ */
+ ASIO_DECL bool is_loopback() const noexcept;
/// Determine whether the address is unspecified.
- ASIO_DECL bool is_unspecified() const ASIO_NOEXCEPT;
+ /**
+ * This function tests whether the address is the unspecified address
+ * <tt>0.0.0.0</tt>.
+ *
+ * @returns <tt>to_uint() == 0</tt>.
+ */
+ ASIO_DECL bool is_unspecified() const noexcept;
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use network_v4 class.) Determine whether the address is a
@@ -164,64 +187,109 @@ public:
#endif // !defined(ASIO_NO_DEPRECATED)
/// Determine whether the address is a multicast address.
- ASIO_DECL bool is_multicast() const ASIO_NOEXCEPT;
+ /**
+ * This function tests whether the address is in the multicast address block
+ * <tt>224.0.0.0/4</tt>, which corresponds to the address range
+ * <tt>224.0.0.0 - 239.255.255.255</tt>.
+ *
+ * @returns <tt>(to_uint() & 0xF0000000) == 0xE0000000</tt>.
+ */
+ ASIO_DECL bool is_multicast() const noexcept;
/// Compare two addresses for equality.
friend bool operator==(const address_v4& a1,
- const address_v4& a2) ASIO_NOEXCEPT
+ const address_v4& a2) noexcept
{
return a1.addr_.s_addr == a2.addr_.s_addr;
}
/// Compare two addresses for inequality.
friend bool operator!=(const address_v4& a1,
- const address_v4& a2) ASIO_NOEXCEPT
+ const address_v4& a2) noexcept
{
return a1.addr_.s_addr != a2.addr_.s_addr;
}
/// Compare addresses for ordering.
+ /**
+ * Compares two addresses in host byte order.
+ *
+ * @returns <tt>a1.to_uint() < a2.to_uint()</tt>.
+ */
friend bool operator<(const address_v4& a1,
- const address_v4& a2) ASIO_NOEXCEPT
+ const address_v4& a2) noexcept
{
return a1.to_uint() < a2.to_uint();
}
/// Compare addresses for ordering.
+ /**
+ * Compares two addresses in host byte order.
+ *
+ * @returns <tt>a1.to_uint() > a2.to_uint()</tt>.
+ */
friend bool operator>(const address_v4& a1,
- const address_v4& a2) ASIO_NOEXCEPT
+ const address_v4& a2) noexcept
{
return a1.to_uint() > a2.to_uint();
}
/// Compare addresses for ordering.
+ /**
+ * Compares two addresses in host byte order.
+ *
+ * @returns <tt>a1.to_uint() <= a2.to_uint()</tt>.
+ */
friend bool operator<=(const address_v4& a1,
- const address_v4& a2) ASIO_NOEXCEPT
+ const address_v4& a2) noexcept
{
return a1.to_uint() <= a2.to_uint();
}
/// Compare addresses for ordering.
+ /**
+ * Compares two addresses in host byte order.
+ *
+ * @returns <tt>a1.to_uint() >= a2.to_uint()</tt>.
+ */
friend bool operator>=(const address_v4& a1,
- const address_v4& a2) ASIO_NOEXCEPT
+ const address_v4& a2) noexcept
{
return a1.to_uint() >= a2.to_uint();
}
/// Obtain an address object that represents any address.
- static address_v4 any() ASIO_NOEXCEPT
+ /**
+ * This functions returns an address that represents the "any" address
+ * <tt>0.0.0.0</tt>.
+ *
+ * @returns A default-constructed @c address_v4 object.
+ */
+ static address_v4 any() noexcept
{
return address_v4();
}
/// Obtain an address object that represents the loopback address.
- static address_v4 loopback() ASIO_NOEXCEPT
+ /**
+ * This function returns an address that represents the well-known loopback
+ * address <tt>127.0.0.1</tt>.
+ *
+ * @returns <tt>address_v4(0x7F000001)</tt>.
+ */
+ static address_v4 loopback() noexcept
{
return address_v4(0x7F000001);
}
/// Obtain an address object that represents the broadcast address.
- static address_v4 broadcast() ASIO_NOEXCEPT
+ /**
+ * This function returns an address that represents the broadcast address
+ * <tt>255.255.255.255</tt>.
+ *
+ * @returns <tt>address_v4(0xFFFFFFFF)</tt>.
+ */
+ static address_v4 broadcast() noexcept
{
return address_v4(0xFFFFFFFF);
}
@@ -272,7 +340,7 @@ ASIO_DECL address_v4 make_address_v4(const char* str);
* @relates address_v4
*/
ASIO_DECL address_v4 make_address_v4(const char* str,
- asio::error_code& ec) ASIO_NOEXCEPT;
+ asio::error_code& ec) noexcept;
/// Create an IPv4 address from an IP address string in dotted decimal form.
/**
@@ -285,7 +353,7 @@ ASIO_DECL address_v4 make_address_v4(const std::string& str);
* @relates address_v4
*/
ASIO_DECL address_v4 make_address_v4(const std::string& str,
- asio::error_code& ec) ASIO_NOEXCEPT;
+ asio::error_code& ec) noexcept;
#if defined(ASIO_HAS_STRING_VIEW) \
|| defined(GENERATING_DOCUMENTATION)
@@ -301,7 +369,7 @@ ASIO_DECL address_v4 make_address_v4(string_view str);
* @relates address_v4
*/
ASIO_DECL address_v4 make_address_v4(string_view str,
- asio::error_code& ec) ASIO_NOEXCEPT;
+ asio::error_code& ec) noexcept;
#endif // defined(ASIO_HAS_STRING_VIEW)
// || defined(GENERATING_DOCUMENTATION)
@@ -329,21 +397,19 @@ std::basic_ostream<Elem, Traits>& operator<<(
} // namespace ip
} // namespace asio
-#if defined(ASIO_HAS_STD_HASH)
namespace std {
template <>
struct hash<asio::ip::address_v4>
{
std::size_t operator()(const asio::ip::address_v4& addr)
- const ASIO_NOEXCEPT
+ const noexcept
{
return std::hash<unsigned int>()(addr.to_uint());
}
};
} // namespace std
-#endif // defined(ASIO_HAS_STD_HASH)
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/ip/address_v4_iterator.hpp b/3rdparty/asio/include/asio/ip/address_v4_iterator.hpp
index 1216956f156..5b91f400ac1 100644
--- a/3rdparty/asio/include/asio/ip/address_v4_iterator.hpp
+++ b/3rdparty/asio/include/asio/ip/address_v4_iterator.hpp
@@ -2,7 +2,7 @@
// ip/address_v4_iterator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -53,65 +53,59 @@ public:
typedef std::input_iterator_tag iterator_category;
/// Construct an iterator that points to the specified address.
- basic_address_iterator(const address_v4& addr) ASIO_NOEXCEPT
+ basic_address_iterator(const address_v4& addr) noexcept
: address_(addr)
{
}
/// Copy constructor.
- basic_address_iterator(
- const basic_address_iterator& other) ASIO_NOEXCEPT
+ basic_address_iterator(const basic_address_iterator& other) noexcept
: address_(other.address_)
{
}
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
- basic_address_iterator(basic_address_iterator&& other) ASIO_NOEXCEPT
- : address_(ASIO_MOVE_CAST(address_v4)(other.address_))
+ basic_address_iterator(basic_address_iterator&& other) noexcept
+ : address_(static_cast<address_v4&&>(other.address_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
/// Assignment operator.
basic_address_iterator& operator=(
- const basic_address_iterator& other) ASIO_NOEXCEPT
+ const basic_address_iterator& other) noexcept
{
address_ = other.address_;
return *this;
}
-#if defined(ASIO_HAS_MOVE)
/// Move assignment operator.
- basic_address_iterator& operator=(
- basic_address_iterator&& other) ASIO_NOEXCEPT
+ basic_address_iterator& operator=(basic_address_iterator&& other) noexcept
{
- address_ = ASIO_MOVE_CAST(address_v4)(other.address_);
+ address_ = static_cast<address_v4&&>(other.address_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
/// Dereference the iterator.
- const address_v4& operator*() const ASIO_NOEXCEPT
+ const address_v4& operator*() const noexcept
{
return address_;
}
/// Dereference the iterator.
- const address_v4* operator->() const ASIO_NOEXCEPT
+ const address_v4* operator->() const noexcept
{
return &address_;
}
/// Pre-increment operator.
- basic_address_iterator& operator++() ASIO_NOEXCEPT
+ basic_address_iterator& operator++() noexcept
{
address_ = address_v4((address_.to_uint() + 1) & 0xFFFFFFFF);
return *this;
}
/// Post-increment operator.
- basic_address_iterator operator++(int) ASIO_NOEXCEPT
+ basic_address_iterator operator++(int) noexcept
{
basic_address_iterator tmp(*this);
++*this;
@@ -119,7 +113,7 @@ public:
}
/// Pre-decrement operator.
- basic_address_iterator& operator--() ASIO_NOEXCEPT
+ basic_address_iterator& operator--() noexcept
{
address_ = address_v4((address_.to_uint() - 1) & 0xFFFFFFFF);
return *this;
diff --git a/3rdparty/asio/include/asio/ip/address_v4_range.hpp b/3rdparty/asio/include/asio/ip/address_v4_range.hpp
index 45a1d158902..5fb5e65e2aa 100644
--- a/3rdparty/asio/include/asio/ip/address_v4_range.hpp
+++ b/3rdparty/asio/include/asio/ip/address_v4_range.hpp
@@ -2,7 +2,7 @@
// ip/address_v4_range.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -38,7 +38,7 @@ public:
typedef basic_address_iterator<address_v4> iterator;
/// Construct an empty range.
- basic_address_range() ASIO_NOEXCEPT
+ basic_address_range() noexcept
: begin_(address_v4()),
end_(address_v4())
{
@@ -46,74 +46,68 @@ public:
/// Construct an range that represents the given range of addresses.
explicit basic_address_range(const iterator& first,
- const iterator& last) ASIO_NOEXCEPT
+ const iterator& last) noexcept
: begin_(first),
end_(last)
{
}
/// Copy constructor.
- basic_address_range(const basic_address_range& other) ASIO_NOEXCEPT
+ basic_address_range(const basic_address_range& other) noexcept
: begin_(other.begin_),
end_(other.end_)
{
}
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
- basic_address_range(basic_address_range&& other) ASIO_NOEXCEPT
- : begin_(ASIO_MOVE_CAST(iterator)(other.begin_)),
- end_(ASIO_MOVE_CAST(iterator)(other.end_))
+ basic_address_range(basic_address_range&& other) noexcept
+ : begin_(static_cast<iterator&&>(other.begin_)),
+ end_(static_cast<iterator&&>(other.end_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
/// Assignment operator.
- basic_address_range& operator=(
- const basic_address_range& other) ASIO_NOEXCEPT
+ basic_address_range& operator=(const basic_address_range& other) noexcept
{
begin_ = other.begin_;
end_ = other.end_;
return *this;
}
-#if defined(ASIO_HAS_MOVE)
/// Move assignment operator.
- basic_address_range& operator=(
- basic_address_range&& other) ASIO_NOEXCEPT
+ basic_address_range& operator=(basic_address_range&& other) noexcept
{
- begin_ = ASIO_MOVE_CAST(iterator)(other.begin_);
- end_ = ASIO_MOVE_CAST(iterator)(other.end_);
+ begin_ = static_cast<iterator&&>(other.begin_);
+ end_ = static_cast<iterator&&>(other.end_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
/// Obtain an iterator that points to the start of the range.
- iterator begin() const ASIO_NOEXCEPT
+ iterator begin() const noexcept
{
return begin_;
}
/// Obtain an iterator that points to the end of the range.
- iterator end() const ASIO_NOEXCEPT
+ iterator end() const noexcept
{
return end_;
}
/// Determine whether the range is empty.
- bool empty() const ASIO_NOEXCEPT
+ bool empty() const noexcept
{
return size() == 0;
}
/// Return the size of the range.
- std::size_t size() const ASIO_NOEXCEPT
+ std::size_t size() const noexcept
{
return end_->to_uint() - begin_->to_uint();
}
/// Find an address in the range.
- iterator find(const address_v4& addr) const ASIO_NOEXCEPT
+ iterator find(const address_v4& addr) const noexcept
{
return addr >= *begin_ && addr < *end_ ? iterator(addr) : end_;
}
diff --git a/3rdparty/asio/include/asio/ip/address_v6.hpp b/3rdparty/asio/include/asio/ip/address_v6.hpp
index 3d4070f1030..aa650825cf3 100644
--- a/3rdparty/asio/include/asio/ip/address_v6.hpp
+++ b/3rdparty/asio/include/asio/ip/address_v6.hpp
@@ -2,7 +2,7 @@
// ip/address_v6.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,6 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
+#include <functional>
#include <string>
#include "asio/detail/array.hpp"
#include "asio/detail/cstdint.hpp"
@@ -25,10 +26,6 @@
#include "asio/error_code.hpp"
#include "asio/ip/address_v4.hpp"
-#if defined(ASIO_HAS_STD_HASH)
-# include <functional>
-#endif // defined(ASIO_HAS_STD_HASH)
-
#if !defined(ASIO_NO_IOSTREAM)
# include <iosfwd>
#endif // !defined(ASIO_NO_IOSTREAM)
@@ -67,34 +64,44 @@ public:
#endif
/// Default constructor.
- ASIO_DECL address_v6() ASIO_NOEXCEPT;
+ /**
+ * Initialises the @c address_v6 object such that:
+ * @li <tt>to_bytes()</tt> yields <tt>{0, 0, ..., 0}</tt>; and
+ * @li <tt>scope_id() == 0</tt>.
+ */
+ ASIO_DECL address_v6() noexcept;
/// Construct an address from raw bytes and scope ID.
+ /**
+ * Initialises the @c address_v6 object such that:
+ * @li <tt>to_bytes() == bytes</tt>; and
+ * @li <tt>this->scope_id() == scope_id</tt>.
+ *
+ * @throws out_of_range Thrown if any element in @c bytes is not in the range
+ * <tt>0 - 0xFF</tt>. Note that no range checking is required for platforms
+ * where <tt>std::numeric_limits<unsigned char>::max()</tt> is <tt>0xFF</tt>.
+ */
ASIO_DECL explicit address_v6(const bytes_type& bytes,
scope_id_type scope_id = 0);
/// Copy constructor.
- ASIO_DECL address_v6(const address_v6& other) ASIO_NOEXCEPT;
+ ASIO_DECL address_v6(const address_v6& other) noexcept;
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
- ASIO_DECL address_v6(address_v6&& other) ASIO_NOEXCEPT;
-#endif // defined(ASIO_HAS_MOVE)
+ ASIO_DECL address_v6(address_v6&& other) noexcept;
/// Assign from another address.
ASIO_DECL address_v6& operator=(
- const address_v6& other) ASIO_NOEXCEPT;
+ const address_v6& other) noexcept;
-#if defined(ASIO_HAS_MOVE)
/// Move-assign from another address.
- ASIO_DECL address_v6& operator=(address_v6&& other) ASIO_NOEXCEPT;
-#endif // defined(ASIO_HAS_MOVE)
+ ASIO_DECL address_v6& operator=(address_v6&& other) noexcept;
/// The scope ID of the address.
/**
* Returns the scope ID associated with the IPv6 address.
*/
- scope_id_type scope_id() const ASIO_NOEXCEPT
+ scope_id_type scope_id() const noexcept
{
return scope_id_;
}
@@ -102,14 +109,16 @@ public:
/// The scope ID of the address.
/**
* Modifies the scope ID associated with the IPv6 address.
+ *
+ * @param id The new scope ID.
*/
- void scope_id(scope_id_type id) ASIO_NOEXCEPT
+ void scope_id(scope_id_type id) noexcept
{
scope_id_ = id;
}
/// Get the address in bytes, in network byte order.
- ASIO_DECL bytes_type to_bytes() const ASIO_NOEXCEPT;
+ ASIO_DECL bytes_type to_bytes() const noexcept;
/// Get the address as a string.
ASIO_DECL std::string to_string() const;
@@ -142,19 +151,27 @@ public:
#endif // !defined(ASIO_NO_DEPRECATED)
/// Determine whether the address is a loopback address.
- ASIO_DECL bool is_loopback() const ASIO_NOEXCEPT;
+ /**
+ * This function tests whether the address is the loopback address
+ * <tt>::1</tt>.
+ */
+ ASIO_DECL bool is_loopback() const noexcept;
/// Determine whether the address is unspecified.
- ASIO_DECL bool is_unspecified() const ASIO_NOEXCEPT;
+ /**
+ * This function tests whether the address is the loopback address
+ * <tt>::</tt>.
+ */
+ ASIO_DECL bool is_unspecified() const noexcept;
/// Determine whether the address is link local.
- ASIO_DECL bool is_link_local() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_link_local() const noexcept;
/// Determine whether the address is site local.
- ASIO_DECL bool is_site_local() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_site_local() const noexcept;
/// Determine whether the address is a mapped IPv4 address.
- ASIO_DECL bool is_v4_mapped() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_v4_mapped() const noexcept;
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: No replacement.) Determine whether the address is an
@@ -163,67 +180,77 @@ public:
#endif // !defined(ASIO_NO_DEPRECATED)
/// Determine whether the address is a multicast address.
- ASIO_DECL bool is_multicast() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_multicast() const noexcept;
/// Determine whether the address is a global multicast address.
- ASIO_DECL bool is_multicast_global() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_multicast_global() const noexcept;
/// Determine whether the address is a link-local multicast address.
- ASIO_DECL bool is_multicast_link_local() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_multicast_link_local() const noexcept;
/// Determine whether the address is a node-local multicast address.
- ASIO_DECL bool is_multicast_node_local() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_multicast_node_local() const noexcept;
/// Determine whether the address is a org-local multicast address.
- ASIO_DECL bool is_multicast_org_local() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_multicast_org_local() const noexcept;
/// Determine whether the address is a site-local multicast address.
- ASIO_DECL bool is_multicast_site_local() const ASIO_NOEXCEPT;
+ ASIO_DECL bool is_multicast_site_local() const noexcept;
/// Compare two addresses for equality.
ASIO_DECL friend bool operator==(const address_v6& a1,
- const address_v6& a2) ASIO_NOEXCEPT;
+ const address_v6& a2) noexcept;
/// Compare two addresses for inequality.
friend bool operator!=(const address_v6& a1,
- const address_v6& a2) ASIO_NOEXCEPT
+ const address_v6& a2) noexcept
{
return !(a1 == a2);
}
/// Compare addresses for ordering.
ASIO_DECL friend bool operator<(const address_v6& a1,
- const address_v6& a2) ASIO_NOEXCEPT;
+ const address_v6& a2) noexcept;
/// Compare addresses for ordering.
friend bool operator>(const address_v6& a1,
- const address_v6& a2) ASIO_NOEXCEPT
+ const address_v6& a2) noexcept
{
return a2 < a1;
}
/// Compare addresses for ordering.
friend bool operator<=(const address_v6& a1,
- const address_v6& a2) ASIO_NOEXCEPT
+ const address_v6& a2) noexcept
{
return !(a2 < a1);
}
/// Compare addresses for ordering.
friend bool operator>=(const address_v6& a1,
- const address_v6& a2) ASIO_NOEXCEPT
+ const address_v6& a2) noexcept
{
return !(a1 < a2);
}
/// Obtain an address object that represents any address.
- static address_v6 any() ASIO_NOEXCEPT
+ /**
+ * This functions returns an address that represents the "any" address
+ * <tt>::</tt>.
+ *
+ * @returns A default-constructed @c address_v6 object.
+ */
+ static address_v6 any() noexcept
{
return address_v6();
}
/// Obtain an address object that represents the loopback address.
- ASIO_DECL static address_v6 loopback() ASIO_NOEXCEPT;
+ /**
+ * This function returns an address that represents the well-known loopback
+ * address <tt>::1</tt>.
+ */
+ ASIO_DECL static address_v6 loopback() noexcept;
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address.
@@ -264,7 +291,7 @@ ASIO_DECL address_v6 make_address_v6(const char* str);
* @relates address_v6
*/
ASIO_DECL address_v6 make_address_v6(const char* str,
- asio::error_code& ec) ASIO_NOEXCEPT;
+ asio::error_code& ec) noexcept;
/// Createan IPv6 address from an IP address string.
/**
@@ -277,7 +304,7 @@ ASIO_DECL address_v6 make_address_v6(const std::string& str);
* @relates address_v6
*/
ASIO_DECL address_v6 make_address_v6(const std::string& str,
- asio::error_code& ec) ASIO_NOEXCEPT;
+ asio::error_code& ec) noexcept;
#if defined(ASIO_HAS_STRING_VIEW) \
|| defined(GENERATING_DOCUMENTATION)
@@ -293,7 +320,7 @@ ASIO_DECL address_v6 make_address_v6(string_view str);
* @relates address_v6
*/
ASIO_DECL address_v6 make_address_v6(string_view str,
- asio::error_code& ec) ASIO_NOEXCEPT;
+ asio::error_code& ec) noexcept;
#endif // defined(ASIO_HAS_STRING_VIEW)
// || defined(GENERATING_DOCUMENTATION)
@@ -339,14 +366,13 @@ std::basic_ostream<Elem, Traits>& operator<<(
} // namespace ip
} // namespace asio
-#if defined(ASIO_HAS_STD_HASH)
namespace std {
template <>
struct hash<asio::ip::address_v6>
{
std::size_t operator()(const asio::ip::address_v6& addr)
- const ASIO_NOEXCEPT
+ const noexcept
{
const asio::ip::address_v6::bytes_type bytes = addr.to_bytes();
std::size_t result = static_cast<std::size_t>(addr.scope_id());
@@ -370,7 +396,6 @@ private:
};
} // namespace std
-#endif // defined(ASIO_HAS_STD_HASH)
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/ip/address_v6_iterator.hpp b/3rdparty/asio/include/asio/ip/address_v6_iterator.hpp
index 5345d206cf5..5116f614f08 100644
--- a/3rdparty/asio/include/asio/ip/address_v6_iterator.hpp
+++ b/3rdparty/asio/include/asio/ip/address_v6_iterator.hpp
@@ -2,7 +2,7 @@
// ip/address_v6_iterator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Oliver Kowalke (oliver dot kowalke at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -54,58 +54,53 @@ public:
typedef std::input_iterator_tag iterator_category;
/// Construct an iterator that points to the specified address.
- basic_address_iterator(const address_v6& addr) ASIO_NOEXCEPT
+ basic_address_iterator(const address_v6& addr) noexcept
: address_(addr)
{
}
/// Copy constructor.
basic_address_iterator(
- const basic_address_iterator& other) ASIO_NOEXCEPT
+ const basic_address_iterator& other) noexcept
: address_(other.address_)
{
}
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
- basic_address_iterator(basic_address_iterator&& other) ASIO_NOEXCEPT
- : address_(ASIO_MOVE_CAST(address_v6)(other.address_))
+ basic_address_iterator(basic_address_iterator&& other) noexcept
+ : address_(static_cast<address_v6&&>(other.address_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
/// Assignment operator.
basic_address_iterator& operator=(
- const basic_address_iterator& other) ASIO_NOEXCEPT
+ const basic_address_iterator& other) noexcept
{
address_ = other.address_;
return *this;
}
-#if defined(ASIO_HAS_MOVE)
/// Move assignment operator.
- basic_address_iterator& operator=(
- basic_address_iterator&& other) ASIO_NOEXCEPT
+ basic_address_iterator& operator=(basic_address_iterator&& other) noexcept
{
- address_ = ASIO_MOVE_CAST(address_v6)(other.address_);
+ address_ = static_cast<address_v6&&>(other.address_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
/// Dereference the iterator.
- const address_v6& operator*() const ASIO_NOEXCEPT
+ const address_v6& operator*() const noexcept
{
return address_;
}
/// Dereference the iterator.
- const address_v6* operator->() const ASIO_NOEXCEPT
+ const address_v6* operator->() const noexcept
{
return &address_;
}
/// Pre-increment operator.
- basic_address_iterator& operator++() ASIO_NOEXCEPT
+ basic_address_iterator& operator++() noexcept
{
for (int i = 15; i >= 0; --i)
{
@@ -122,7 +117,7 @@ public:
}
/// Post-increment operator.
- basic_address_iterator operator++(int) ASIO_NOEXCEPT
+ basic_address_iterator operator++(int) noexcept
{
basic_address_iterator tmp(*this);
++*this;
@@ -130,7 +125,7 @@ public:
}
/// Pre-decrement operator.
- basic_address_iterator& operator--() ASIO_NOEXCEPT
+ basic_address_iterator& operator--() noexcept
{
for (int i = 15; i >= 0; --i)
{
diff --git a/3rdparty/asio/include/asio/ip/address_v6_range.hpp b/3rdparty/asio/include/asio/ip/address_v6_range.hpp
index ecd9d7cd5a6..7f89773383d 100644
--- a/3rdparty/asio/include/asio/ip/address_v6_range.hpp
+++ b/3rdparty/asio/include/asio/ip/address_v6_range.hpp
@@ -2,7 +2,7 @@
// ip/address_v6_range.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Oliver Kowalke (oliver dot kowalke at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -39,7 +39,7 @@ public:
typedef basic_address_iterator<address_v6> iterator;
/// Construct an empty range.
- basic_address_range() ASIO_NOEXCEPT
+ basic_address_range() noexcept
: begin_(address_v6()),
end_(address_v6())
{
@@ -47,68 +47,63 @@ public:
/// Construct an range that represents the given range of addresses.
explicit basic_address_range(const iterator& first,
- const iterator& last) ASIO_NOEXCEPT
+ const iterator& last) noexcept
: begin_(first),
end_(last)
{
}
/// Copy constructor.
- basic_address_range(const basic_address_range& other) ASIO_NOEXCEPT
+ basic_address_range(const basic_address_range& other) noexcept
: begin_(other.begin_),
end_(other.end_)
{
}
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
- basic_address_range(basic_address_range&& other) ASIO_NOEXCEPT
- : begin_(ASIO_MOVE_CAST(iterator)(other.begin_)),
- end_(ASIO_MOVE_CAST(iterator)(other.end_))
+ basic_address_range(basic_address_range&& other) noexcept
+ : begin_(static_cast<iterator&&>(other.begin_)),
+ end_(static_cast<iterator&&>(other.end_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
/// Assignment operator.
basic_address_range& operator=(
- const basic_address_range& other) ASIO_NOEXCEPT
+ const basic_address_range& other) noexcept
{
begin_ = other.begin_;
end_ = other.end_;
return *this;
}
-#if defined(ASIO_HAS_MOVE)
/// Move assignment operator.
- basic_address_range& operator=(
- basic_address_range&& other) ASIO_NOEXCEPT
+ basic_address_range& operator=(basic_address_range&& other) noexcept
{
- begin_ = ASIO_MOVE_CAST(iterator)(other.begin_);
- end_ = ASIO_MOVE_CAST(iterator)(other.end_);
+ begin_ = static_cast<iterator&&>(other.begin_);
+ end_ = static_cast<iterator&&>(other.end_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
/// Obtain an iterator that points to the start of the range.
- iterator begin() const ASIO_NOEXCEPT
+ iterator begin() const noexcept
{
return begin_;
}
/// Obtain an iterator that points to the end of the range.
- iterator end() const ASIO_NOEXCEPT
+ iterator end() const noexcept
{
return end_;
}
/// Determine whether the range is empty.
- bool empty() const ASIO_NOEXCEPT
+ bool empty() const noexcept
{
return begin_ == end_;
}
/// Find an address in the range.
- iterator find(const address_v6& addr) const ASIO_NOEXCEPT
+ iterator find(const address_v6& addr) const noexcept
{
return addr >= *begin_ && addr < *end_ ? iterator(addr) : end_;
}
diff --git a/3rdparty/asio/include/asio/ip/bad_address_cast.hpp b/3rdparty/asio/include/asio/ip/bad_address_cast.hpp
index 105c350718d..3d242f07048 100644
--- a/3rdparty/asio/include/asio/ip/bad_address_cast.hpp
+++ b/3rdparty/asio/include/asio/ip/bad_address_cast.hpp
@@ -2,7 +2,7 @@
// ip/bad_address_cast.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -35,11 +35,21 @@ public:
/// Default constructor.
bad_address_cast() {}
+ /// Copy constructor.
+ bad_address_cast(const bad_address_cast& other) noexcept
+#if defined(ASIO_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS
+ : std::exception(static_cast<const std::exception&>(other))
+#else
+ : std::bad_cast(static_cast<const std::bad_cast&>(other))
+#endif
+ {
+ }
+
/// Destructor.
- virtual ~bad_address_cast() ASIO_NOEXCEPT_OR_NOTHROW {}
+ virtual ~bad_address_cast() noexcept {}
/// Get the message associated with the exception.
- virtual const char* what() const ASIO_NOEXCEPT_OR_NOTHROW
+ virtual const char* what() const noexcept
{
return "bad address cast";
}
diff --git a/3rdparty/asio/include/asio/ip/basic_endpoint.hpp b/3rdparty/asio/include/asio/ip/basic_endpoint.hpp
index 10596702bb7..3dfb1248db7 100644
--- a/3rdparty/asio/include/asio/ip/basic_endpoint.hpp
+++ b/3rdparty/asio/include/asio/ip/basic_endpoint.hpp
@@ -2,7 +2,7 @@
// ip/basic_endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,14 +16,11 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
+#include <functional>
#include "asio/detail/cstdint.hpp"
#include "asio/ip/address.hpp"
#include "asio/ip/detail/endpoint.hpp"
-#if defined(ASIO_HAS_STD_HASH)
-# include <functional>
-#endif // defined(ASIO_HAS_STD_HASH)
-
#if !defined(ASIO_NO_IOSTREAM)
# include <iosfwd>
#endif // !defined(ASIO_NO_IOSTREAM)
@@ -64,7 +61,7 @@ public:
#endif
/// Default constructor.
- basic_endpoint() ASIO_NOEXCEPT
+ basic_endpoint() noexcept
: impl_()
{
}
@@ -86,7 +83,7 @@ public:
* @endcode
*/
basic_endpoint(const InternetProtocol& internet_protocol,
- port_type port_num) ASIO_NOEXCEPT
+ port_type port_num) noexcept
: impl_(internet_protocol.family(), port_num)
{
}
@@ -95,43 +92,39 @@ public:
/// constructor may be used for accepting connections on a specific interface
/// or for making a connection to a remote endpoint.
basic_endpoint(const asio::ip::address& addr,
- port_type port_num) ASIO_NOEXCEPT
+ port_type port_num) noexcept
: impl_(addr, port_num)
{
}
/// Copy constructor.
- basic_endpoint(const basic_endpoint& other) ASIO_NOEXCEPT
+ basic_endpoint(const basic_endpoint& other) noexcept
: impl_(other.impl_)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move constructor.
- basic_endpoint(basic_endpoint&& other) ASIO_NOEXCEPT
+ basic_endpoint(basic_endpoint&& other) noexcept
: impl_(other.impl_)
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Assign from another endpoint.
- basic_endpoint& operator=(const basic_endpoint& other) ASIO_NOEXCEPT
+ basic_endpoint& operator=(const basic_endpoint& other) noexcept
{
impl_ = other.impl_;
return *this;
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-assign from another endpoint.
- basic_endpoint& operator=(basic_endpoint&& other) ASIO_NOEXCEPT
+ basic_endpoint& operator=(basic_endpoint&& other) noexcept
{
impl_ = other.impl_;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// The protocol associated with the endpoint.
- protocol_type protocol() const ASIO_NOEXCEPT
+ protocol_type protocol() const noexcept
{
if (impl_.is_v4())
return InternetProtocol::v4();
@@ -139,19 +132,19 @@ public:
}
/// Get the underlying endpoint in the native type.
- data_type* data() ASIO_NOEXCEPT
+ data_type* data() noexcept
{
return impl_.data();
}
/// Get the underlying endpoint in the native type.
- const data_type* data() const ASIO_NOEXCEPT
+ const data_type* data() const noexcept
{
return impl_.data();
}
/// Get the underlying size of the endpoint in the native type.
- std::size_t size() const ASIO_NOEXCEPT
+ std::size_t size() const noexcept
{
return impl_.size();
}
@@ -163,75 +156,75 @@ public:
}
/// Get the capacity of the endpoint in the native type.
- std::size_t capacity() const ASIO_NOEXCEPT
+ std::size_t capacity() const noexcept
{
return impl_.capacity();
}
/// Get the port associated with the endpoint. The port number is always in
/// the host's byte order.
- port_type port() const ASIO_NOEXCEPT
+ port_type port() const noexcept
{
return impl_.port();
}
/// Set the port associated with the endpoint. The port number is always in
/// the host's byte order.
- void port(port_type port_num) ASIO_NOEXCEPT
+ void port(port_type port_num) noexcept
{
impl_.port(port_num);
}
/// Get the IP address associated with the endpoint.
- asio::ip::address address() const ASIO_NOEXCEPT
+ asio::ip::address address() const noexcept
{
return impl_.address();
}
/// Set the IP address associated with the endpoint.
- void address(const asio::ip::address& addr) ASIO_NOEXCEPT
+ void address(const asio::ip::address& addr) noexcept
{
impl_.address(addr);
}
/// Compare two endpoints for equality.
friend bool operator==(const basic_endpoint<InternetProtocol>& e1,
- const basic_endpoint<InternetProtocol>& e2) ASIO_NOEXCEPT
+ const basic_endpoint<InternetProtocol>& e2) noexcept
{
return e1.impl_ == e2.impl_;
}
/// Compare two endpoints for inequality.
friend bool operator!=(const basic_endpoint<InternetProtocol>& e1,
- const basic_endpoint<InternetProtocol>& e2) ASIO_NOEXCEPT
+ const basic_endpoint<InternetProtocol>& e2) noexcept
{
return !(e1 == e2);
}
/// Compare endpoints for ordering.
friend bool operator<(const basic_endpoint<InternetProtocol>& e1,
- const basic_endpoint<InternetProtocol>& e2) ASIO_NOEXCEPT
+ const basic_endpoint<InternetProtocol>& e2) noexcept
{
return e1.impl_ < e2.impl_;
}
/// Compare endpoints for ordering.
friend bool operator>(const basic_endpoint<InternetProtocol>& e1,
- const basic_endpoint<InternetProtocol>& e2) ASIO_NOEXCEPT
+ const basic_endpoint<InternetProtocol>& e2) noexcept
{
return e2.impl_ < e1.impl_;
}
/// Compare endpoints for ordering.
friend bool operator<=(const basic_endpoint<InternetProtocol>& e1,
- const basic_endpoint<InternetProtocol>& e2) ASIO_NOEXCEPT
+ const basic_endpoint<InternetProtocol>& e2) noexcept
{
return !(e2 < e1);
}
/// Compare endpoints for ordering.
friend bool operator>=(const basic_endpoint<InternetProtocol>& e1,
- const basic_endpoint<InternetProtocol>& e2) ASIO_NOEXCEPT
+ const basic_endpoint<InternetProtocol>& e2) noexcept
{
return !(e1 < e2);
}
@@ -265,15 +258,14 @@ std::basic_ostream<Elem, Traits>& operator<<(
} // namespace ip
} // namespace asio
-#if defined(ASIO_HAS_STD_HASH)
namespace std {
template <typename InternetProtocol>
-struct hash<asio::ip::basic_endpoint<InternetProtocol> >
+struct hash<asio::ip::basic_endpoint<InternetProtocol>>
{
std::size_t operator()(
const asio::ip::basic_endpoint<InternetProtocol>& ep)
- const ASIO_NOEXCEPT
+ const noexcept
{
std::size_t hash1 = std::hash<asio::ip::address>()(ep.address());
std::size_t hash2 = std::hash<unsigned short>()(ep.port());
@@ -282,7 +274,6 @@ struct hash<asio::ip::basic_endpoint<InternetProtocol> >
};
} // namespace std
-#endif // defined(ASIO_HAS_STD_HASH)
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/ip/basic_resolver.hpp b/3rdparty/asio/include/asio/ip/basic_resolver.hpp
index cfadba4af9d..4d41bfde090 100644
--- a/3rdparty/asio/include/asio/ip/basic_resolver.hpp
+++ b/3rdparty/asio/include/asio/ip/basic_resolver.hpp
@@ -2,7 +2,7 @@
// ip/basic_resolver.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,6 +17,7 @@
#include "asio/detail/config.hpp"
#include <string>
+#include <utility>
#include "asio/any_io_executor.hpp"
#include "asio/async_result.hpp"
#include "asio/detail/handler_type_requirements.hpp"
@@ -36,10 +37,6 @@
# include "asio/detail/resolver_service.hpp"
#endif
-#if defined(ASIO_HAS_MOVE)
-# include <utility>
-#endif // defined(ASIO_HAS_MOVE)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -67,6 +64,9 @@ template <typename InternetProtocol, typename Executor>
class basic_resolver
: public resolver_base
{
+private:
+ class initiate_async_resolve;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -119,14 +119,13 @@ public:
*/
template <typename ExecutionContext>
explicit basic_resolver(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_resolver from another.
/**
* This constructor moves a resolver from one object to another.
@@ -158,9 +157,9 @@ public:
*/
template <typename Executor1>
basic_resolver(basic_resolver<InternetProtocol, Executor1>&& other,
- typename constraint<
+ constraint_t<
is_convertible<Executor1, Executor>::value
- >::type = 0)
+ > = 0)
: impl_(std::move(other.impl_))
{
}
@@ -196,16 +195,15 @@ public:
* constructed using the @c basic_resolver(const executor_type&) constructor.
*/
template <typename Executor1>
- typename constraint<
+ constraint_t<
is_convertible<Executor1, Executor>::value,
basic_resolver&
- >::type operator=(basic_resolver<InternetProtocol, Executor1>&& other)
+ > operator=(basic_resolver<InternetProtocol, Executor1>&& other)
{
basic_resolver tmp(std::move(other));
impl_ = std::move(tmp.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destroys the resolver.
/**
@@ -218,7 +216,7 @@ public:
}
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return impl_.get_executor();
}
@@ -647,38 +645,44 @@ public:
/// Asynchronously perform forward resolution of a query to a list of entries.
/**
* This function is used to asynchronously resolve a query into a list of
- * endpoint entries.
+ * endpoint entries. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param q A query object that determines what endpoints will be returned.
*
- * @param handler The handler to be called when the resolve operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the resolve completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
* resolver::results_type results // Resolved endpoints as a range.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, results_type) @endcode
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- results_type)) ResolveHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
- void (asio::error_code, results_type))
- async_resolve(const query& q,
- ASIO_MOVE_ARG(ResolveHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ results_type)) ResolveToken = default_completion_token_t<executor_type>>
+ auto async_resolve(const query& q,
+ ResolveToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ asio::async_initiate<ResolveToken,
+ void (asio::error_code, results_type)>(
+ declval<initiate_async_resolve>(), token, q))
{
- return asio::async_initiate<ResolveHandler,
+ return asio::async_initiate<ResolveToken,
void (asio::error_code, results_type)>(
- initiate_async_resolve(this), handler, q);
+ initiate_async_resolve(this), token, q);
}
#endif // !defined(ASIO_NO_DEPRECATED)
@@ -698,21 +702,26 @@ public:
* be an empty string, in which case all resolved endpoints will have a port
* number of 0.
*
- * @param handler The handler to be called when the resolve operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the resolve completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
* resolver::results_type results // Resolved endpoints as a range.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
*
+ * @par Completion Signature
+ * @code void(asio::error_code, results_type) @endcode
+ *
* @note On POSIX systems, host names may be locally defined in the file
* <tt>/etc/hosts</tt>. On Windows, host names may be defined in the file
* <tt>c:\\windows\\system32\\drivers\\etc\\hosts</tt>. Remote host name
@@ -726,23 +735,25 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- results_type)) ResolveHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
- void (asio::error_code, results_type))
- async_resolve(ASIO_STRING_VIEW_PARAM host,
+ results_type)) ResolveToken = default_completion_token_t<executor_type>>
+ auto async_resolve(ASIO_STRING_VIEW_PARAM host,
ASIO_STRING_VIEW_PARAM service,
- ASIO_MOVE_ARG(ResolveHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ResolveToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ asio::async_initiate<ResolveToken,
+ void (asio::error_code, results_type)>(
+ declval<initiate_async_resolve>(), token,
+ declval<basic_resolver_query<protocol_type>&>()))
{
return async_resolve(host, service, resolver_base::flags(),
- ASIO_MOVE_CAST(ResolveHandler)(handler));
+ static_cast<ResolveToken&&>(token));
}
/// Asynchronously perform forward resolution of a query to a list of entries.
/**
* This function is used to resolve host and service names into a list of
- * endpoint entries.
+ * endpoint entries. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param host A string identifying a location. May be a descriptive name or
* a numeric address string. If an empty string and the passive flag has been
@@ -760,21 +771,26 @@ public:
* remote hosts. See the @ref resolver_base documentation for the set of
* available flags.
*
- * @param handler The handler to be called when the resolve operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the resolve completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
* resolver::results_type results // Resolved endpoints as a range.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
*
+ * @par Completion Signature
+ * @code void(asio::error_code, results_type) @endcode
+ *
* @note On POSIX systems, host names may be locally defined in the file
* <tt>/etc/hosts</tt>. On Windows, host names may be defined in the file
* <tt>c:\\windows\\system32\\drivers\\etc\\hosts</tt>. Remote host name
@@ -788,28 +804,29 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- results_type)) ResolveHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
- void (asio::error_code, results_type))
- async_resolve(ASIO_STRING_VIEW_PARAM host,
- ASIO_STRING_VIEW_PARAM service,
- resolver_base::flags resolve_flags,
- ASIO_MOVE_ARG(ResolveHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ results_type)) ResolveToken = default_completion_token_t<executor_type>>
+ auto async_resolve(ASIO_STRING_VIEW_PARAM host,
+ ASIO_STRING_VIEW_PARAM service, resolver_base::flags resolve_flags,
+ ResolveToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ asio::async_initiate<ResolveToken,
+ void (asio::error_code, results_type)>(
+ declval<initiate_async_resolve>(), token,
+ declval<basic_resolver_query<protocol_type>&>()))
{
basic_resolver_query<protocol_type> q(static_cast<std::string>(host),
static_cast<std::string>(service), resolve_flags);
- return asio::async_initiate<ResolveHandler,
+ return asio::async_initiate<ResolveToken,
void (asio::error_code, results_type)>(
- initiate_async_resolve(this), handler, q);
+ initiate_async_resolve(this), token, q);
}
/// Asynchronously perform forward resolution of a query to a list of entries.
/**
* This function is used to resolve host and service names into a list of
- * endpoint entries.
+ * endpoint entries. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param protocol A protocol object, normally representing either the IPv4 or
* IPv6 version of an internet protocol.
@@ -825,21 +842,26 @@ public:
* be an empty string, in which case all resolved endpoints will have a port
* number of 0.
*
- * @param handler The handler to be called when the resolve operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the resolve completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
* resolver::results_type results // Resolved endpoints as a range.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
*
+ * @par Completion Signature
+ * @code void(asio::error_code, results_type) @endcode
+ *
* @note On POSIX systems, host names may be locally defined in the file
* <tt>/etc/hosts</tt>. On Windows, host names may be defined in the file
* <tt>c:\\windows\\system32\\drivers\\etc\\hosts</tt>. Remote host name
@@ -853,23 +875,25 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- results_type)) ResolveHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
- void (asio::error_code, results_type))
- async_resolve(const protocol_type& protocol,
+ results_type)) ResolveToken = default_completion_token_t<executor_type>>
+ auto async_resolve(const protocol_type& protocol,
ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service,
- ASIO_MOVE_ARG(ResolveHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ResolveToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ asio::async_initiate<ResolveToken,
+ void (asio::error_code, results_type)>(
+ declval<initiate_async_resolve>(), token,
+ declval<basic_resolver_query<protocol_type>&>()))
{
return async_resolve(protocol, host, service, resolver_base::flags(),
- ASIO_MOVE_CAST(ResolveHandler)(handler));
+ static_cast<ResolveToken&&>(token));
}
/// Asynchronously perform forward resolution of a query to a list of entries.
/**
* This function is used to resolve host and service names into a list of
- * endpoint entries.
+ * endpoint entries. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param protocol A protocol object, normally representing either the IPv4 or
* IPv6 version of an internet protocol.
@@ -890,21 +914,26 @@ public:
* remote hosts. See the @ref resolver_base documentation for the set of
* available flags.
*
- * @param handler The handler to be called when the resolve operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the resolve completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
* resolver::results_type results // Resolved endpoints as a range.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
*
+ * @par Completion Signature
+ * @code void(asio::error_code, results_type) @endcode
+ *
* @note On POSIX systems, host names may be locally defined in the file
* <tt>/etc/hosts</tt>. On Windows, host names may be defined in the file
* <tt>c:\\windows\\system32\\drivers\\etc\\hosts</tt>. Remote host name
@@ -918,23 +947,24 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- results_type)) ResolveHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
- void (asio::error_code, results_type))
- async_resolve(const protocol_type& protocol,
+ results_type)) ResolveToken = default_completion_token_t<executor_type>>
+ auto async_resolve(const protocol_type& protocol,
ASIO_STRING_VIEW_PARAM host, ASIO_STRING_VIEW_PARAM service,
resolver_base::flags resolve_flags,
- ASIO_MOVE_ARG(ResolveHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ ResolveToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ asio::async_initiate<ResolveToken,
+ void (asio::error_code, results_type)>(
+ declval<initiate_async_resolve>(), token,
+ declval<basic_resolver_query<protocol_type>&>()))
{
basic_resolver_query<protocol_type> q(
protocol, static_cast<std::string>(host),
static_cast<std::string>(service), resolve_flags);
- return asio::async_initiate<ResolveHandler,
+ return asio::async_initiate<ResolveToken,
void (asio::error_code, results_type)>(
- initiate_async_resolve(this), handler, q);
+ initiate_async_resolve(this), token, q);
}
/// Perform reverse resolution of an endpoint to a list of entries.
@@ -983,45 +1013,51 @@ public:
/// entries.
/**
* This function is used to asynchronously resolve an endpoint into a list of
- * endpoint entries.
+ * endpoint entries. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param e An endpoint object that determines what endpoints will be
* returned.
*
- * @param handler The handler to be called when the resolve operation
- * completes. Copies will be made of the handler as required. The function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the resolve completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
* resolver::results_type results // Resolved endpoints as a range.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, results_type) @endcode
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- results_type)) ResolveHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
- void (asio::error_code, results_type))
- async_resolve(const endpoint_type& e,
- ASIO_MOVE_ARG(ResolveHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ results_type)) ResolveToken = default_completion_token_t<executor_type>>
+ auto async_resolve(const endpoint_type& e,
+ ResolveToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ asio::async_initiate<ResolveToken,
+ void (asio::error_code, results_type)>(
+ declval<initiate_async_resolve>(), token, e))
{
- return asio::async_initiate<ResolveHandler,
+ return asio::async_initiate<ResolveToken,
void (asio::error_code, results_type)>(
- initiate_async_resolve(this), handler, e);
+ initiate_async_resolve(this), token, e);
}
private:
// Disallow copying and assignment.
- basic_resolver(const basic_resolver&) ASIO_DELETED;
- basic_resolver& operator=(const basic_resolver&) ASIO_DELETED;
+ basic_resolver(const basic_resolver&) = delete;
+ basic_resolver& operator=(const basic_resolver&) = delete;
class initiate_async_resolve
{
@@ -1033,13 +1069,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ResolveHandler, typename Query>
- void operator()(ASIO_MOVE_ARG(ResolveHandler) handler,
+ void operator()(ResolveHandler&& handler,
const Query& q) const
{
// If you get an error on the following line it means that your handler
diff --git a/3rdparty/asio/include/asio/ip/basic_resolver_entry.hpp b/3rdparty/asio/include/asio/ip/basic_resolver_entry.hpp
index 9f299491911..a65af27af50 100644
--- a/3rdparty/asio/include/asio/ip/basic_resolver_entry.hpp
+++ b/3rdparty/asio/include/asio/ip/basic_resolver_entry.hpp
@@ -2,7 +2,7 @@
// ip/basic_resolver_entry.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/basic_resolver_iterator.hpp b/3rdparty/asio/include/asio/ip/basic_resolver_iterator.hpp
index e93cf1f797b..b494f7ae02c 100644
--- a/3rdparty/asio/include/asio/ip/basic_resolver_iterator.hpp
+++ b/3rdparty/asio/include/asio/ip/basic_resolver_iterator.hpp
@@ -2,7 +2,7 @@
// ip/basic_resolver_iterator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -79,15 +79,13 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move constructor.
basic_resolver_iterator(basic_resolver_iterator&& other)
- : values_(ASIO_MOVE_CAST(values_ptr_type)(other.values_)),
+ : values_(static_cast<values_ptr_type&&>(other.values_)),
index_(other.index_)
{
other.index_ = 0;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Assignment operator.
basic_resolver_iterator& operator=(const basic_resolver_iterator& other)
@@ -97,20 +95,18 @@ public:
return *this;
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-assignment operator.
basic_resolver_iterator& operator=(basic_resolver_iterator&& other)
{
if (this != &other)
{
- values_ = ASIO_MOVE_CAST(values_ptr_type)(other.values_);
+ values_ = static_cast<values_ptr_type&&>(other.values_);
index_ = other.index_;
other.index_ = 0;
}
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Dereference an iterator.
const basic_resolver_entry<InternetProtocol>& operator*() const
@@ -178,7 +174,7 @@ protected:
return (*values_)[index_];
}
- typedef std::vector<basic_resolver_entry<InternetProtocol> > values_type;
+ typedef std::vector<basic_resolver_entry<InternetProtocol>> values_type;
typedef asio::detail::shared_ptr<values_type> values_ptr_type;
values_ptr_type values_;
std::size_t index_;
diff --git a/3rdparty/asio/include/asio/ip/basic_resolver_query.hpp b/3rdparty/asio/include/asio/ip/basic_resolver_query.hpp
index e0d2dedd7d9..ada5a4f3802 100644
--- a/3rdparty/asio/include/asio/ip/basic_resolver_query.hpp
+++ b/3rdparty/asio/include/asio/ip/basic_resolver_query.hpp
@@ -2,7 +2,7 @@
// ip/basic_resolver_query.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -212,6 +212,22 @@ public:
hints_.ai_next = 0;
}
+ /// Copy construct a @c basic_resolver_query from another.
+ basic_resolver_query(const basic_resolver_query& other)
+ : hints_(other.hints_),
+ host_name_(other.host_name_),
+ service_name_(other.service_name_)
+ {
+ }
+
+ /// Move construct a @c basic_resolver_query from another.
+ basic_resolver_query(basic_resolver_query&& other)
+ : hints_(other.hints_),
+ host_name_(static_cast<std::string&&>(other.host_name_)),
+ service_name_(static_cast<std::string&&>(other.service_name_))
+ {
+ }
+
/// Get the hints associated with the query.
const asio::detail::addrinfo_type& hints() const
{
diff --git a/3rdparty/asio/include/asio/ip/basic_resolver_results.hpp b/3rdparty/asio/include/asio/ip/basic_resolver_results.hpp
index fb7c4149b93..7a461f13bc4 100644
--- a/3rdparty/asio/include/asio/ip/basic_resolver_results.hpp
+++ b/3rdparty/asio/include/asio/ip/basic_resolver_results.hpp
@@ -2,7 +2,7 @@
// ip/basic_resolver_results.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -93,14 +93,12 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move constructor.
basic_resolver_results(basic_resolver_results&& other)
: basic_resolver_iterator<InternetProtocol>(
- ASIO_MOVE_CAST(basic_resolver_results)(other))
+ static_cast<basic_resolver_results&&>(other))
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Assignment operator.
basic_resolver_results& operator=(const basic_resolver_results& other)
@@ -109,15 +107,13 @@ public:
return *this;
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-assignment operator.
basic_resolver_results& operator=(basic_resolver_results&& other)
{
basic_resolver_iterator<InternetProtocol>::operator=(
- ASIO_MOVE_CAST(basic_resolver_results)(other));
+ static_cast<basic_resolver_results&&>(other));
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
#if !defined(GENERATING_DOCUMENTATION)
// Create results from an addrinfo list returned by getaddrinfo.
@@ -230,19 +226,19 @@ public:
#endif // !defined(GENERATING_DOCUMENTATION)
/// Get the number of entries in the results range.
- size_type size() const ASIO_NOEXCEPT
+ size_type size() const noexcept
{
return this->values_ ? this->values_->size() : 0;
}
/// Get the maximum number of entries permitted in a results range.
- size_type max_size() const ASIO_NOEXCEPT
+ size_type max_size() const noexcept
{
return this->values_ ? this->values_->max_size() : values_type().max_size();
}
/// Determine whether the results range is empty.
- bool empty() const ASIO_NOEXCEPT
+ bool empty() const noexcept
{
return this->values_ ? this->values_->empty() : true;
}
@@ -252,7 +248,7 @@ public:
{
basic_resolver_results tmp(*this);
tmp.index_ = 0;
- return ASIO_MOVE_CAST(basic_resolver_results)(tmp);
+ return static_cast<basic_resolver_results&&>(tmp);
}
/// Obtain an end iterator for the results range.
@@ -274,7 +270,7 @@ public:
}
/// Swap the results range with another.
- void swap(basic_resolver_results& that) ASIO_NOEXCEPT
+ void swap(basic_resolver_results& that) noexcept
{
if (this != &that)
{
@@ -300,7 +296,7 @@ public:
}
private:
- typedef std::vector<basic_resolver_entry<InternetProtocol> > values_type;
+ typedef std::vector<basic_resolver_entry<InternetProtocol>> values_type;
};
} // namespace ip
diff --git a/3rdparty/asio/include/asio/ip/detail/endpoint.hpp b/3rdparty/asio/include/asio/ip/detail/endpoint.hpp
index a19fa48e17f..2c4e3cd43f3 100644
--- a/3rdparty/asio/include/asio/ip/detail/endpoint.hpp
+++ b/3rdparty/asio/include/asio/ip/detail/endpoint.hpp
@@ -2,7 +2,7 @@
// ip/detail/endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -33,43 +33,43 @@ class endpoint
{
public:
// Default constructor.
- ASIO_DECL endpoint() ASIO_NOEXCEPT;
+ ASIO_DECL endpoint() noexcept;
// Construct an endpoint using a family and port number.
ASIO_DECL endpoint(int family,
- unsigned short port_num) ASIO_NOEXCEPT;
+ unsigned short port_num) noexcept;
// Construct an endpoint using an address and port number.
ASIO_DECL endpoint(const asio::ip::address& addr,
- unsigned short port_num) ASIO_NOEXCEPT;
+ unsigned short port_num) noexcept;
// Copy constructor.
- endpoint(const endpoint& other) ASIO_NOEXCEPT
+ endpoint(const endpoint& other) noexcept
: data_(other.data_)
{
}
// Assign from another endpoint.
- endpoint& operator=(const endpoint& other) ASIO_NOEXCEPT
+ endpoint& operator=(const endpoint& other) noexcept
{
data_ = other.data_;
return *this;
}
// Get the underlying endpoint in the native type.
- asio::detail::socket_addr_type* data() ASIO_NOEXCEPT
+ asio::detail::socket_addr_type* data() noexcept
{
return &data_.base;
}
// Get the underlying endpoint in the native type.
- const asio::detail::socket_addr_type* data() const ASIO_NOEXCEPT
+ const asio::detail::socket_addr_type* data() const noexcept
{
return &data_.base;
}
// Get the underlying size of the endpoint in the native type.
- std::size_t size() const ASIO_NOEXCEPT
+ std::size_t size() const noexcept
{
if (is_v4())
return sizeof(asio::detail::sockaddr_in4_type);
@@ -81,34 +81,34 @@ public:
ASIO_DECL void resize(std::size_t new_size);
// Get the capacity of the endpoint in the native type.
- std::size_t capacity() const ASIO_NOEXCEPT
+ std::size_t capacity() const noexcept
{
return sizeof(data_);
}
// Get the port associated with the endpoint.
- ASIO_DECL unsigned short port() const ASIO_NOEXCEPT;
+ ASIO_DECL unsigned short port() const noexcept;
// Set the port associated with the endpoint.
- ASIO_DECL void port(unsigned short port_num) ASIO_NOEXCEPT;
+ ASIO_DECL void port(unsigned short port_num) noexcept;
// Get the IP address associated with the endpoint.
- ASIO_DECL asio::ip::address address() const ASIO_NOEXCEPT;
+ ASIO_DECL asio::ip::address address() const noexcept;
// Set the IP address associated with the endpoint.
ASIO_DECL void address(
- const asio::ip::address& addr) ASIO_NOEXCEPT;
+ const asio::ip::address& addr) noexcept;
// Compare two endpoints for equality.
ASIO_DECL friend bool operator==(const endpoint& e1,
- const endpoint& e2) ASIO_NOEXCEPT;
+ const endpoint& e2) noexcept;
// Compare endpoints for ordering.
ASIO_DECL friend bool operator<(const endpoint& e1,
- const endpoint& e2) ASIO_NOEXCEPT;
+ const endpoint& e2) noexcept;
// Determine whether the endpoint is IPv4.
- bool is_v4() const ASIO_NOEXCEPT
+ bool is_v4() const noexcept
{
return data_.base.sa_family == ASIO_OS_DEF(AF_INET);
}
diff --git a/3rdparty/asio/include/asio/ip/detail/impl/endpoint.ipp b/3rdparty/asio/include/asio/ip/detail/impl/endpoint.ipp
index 2a63996eb72..ef61208e234 100644
--- a/3rdparty/asio/include/asio/ip/detail/impl/endpoint.ipp
+++ b/3rdparty/asio/include/asio/ip/detail/impl/endpoint.ipp
@@ -2,7 +2,7 @@
// ip/detail/impl/endpoint.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -31,7 +31,7 @@ namespace asio {
namespace ip {
namespace detail {
-endpoint::endpoint() ASIO_NOEXCEPT
+endpoint::endpoint() noexcept
: data_()
{
data_.v4.sin_family = ASIO_OS_DEF(AF_INET);
@@ -39,7 +39,7 @@ endpoint::endpoint() ASIO_NOEXCEPT
data_.v4.sin_addr.s_addr = ASIO_OS_DEF(INADDR_ANY);
}
-endpoint::endpoint(int family, unsigned short port_num) ASIO_NOEXCEPT
+endpoint::endpoint(int family, unsigned short port_num) noexcept
: data_()
{
using namespace std; // For memcpy.
@@ -69,7 +69,7 @@ endpoint::endpoint(int family, unsigned short port_num) ASIO_NOEXCEPT
}
endpoint::endpoint(const asio::ip::address& addr,
- unsigned short port_num) ASIO_NOEXCEPT
+ unsigned short port_num) noexcept
: data_()
{
using namespace std; // For memcpy.
@@ -106,7 +106,7 @@ void endpoint::resize(std::size_t new_size)
}
}
-unsigned short endpoint::port() const ASIO_NOEXCEPT
+unsigned short endpoint::port() const noexcept
{
if (is_v4())
{
@@ -120,7 +120,7 @@ unsigned short endpoint::port() const ASIO_NOEXCEPT
}
}
-void endpoint::port(unsigned short port_num) ASIO_NOEXCEPT
+void endpoint::port(unsigned short port_num) noexcept
{
if (is_v4())
{
@@ -134,7 +134,7 @@ void endpoint::port(unsigned short port_num) ASIO_NOEXCEPT
}
}
-asio::ip::address endpoint::address() const ASIO_NOEXCEPT
+asio::ip::address endpoint::address() const noexcept
{
using namespace std; // For memcpy.
if (is_v4())
@@ -146,27 +146,23 @@ asio::ip::address endpoint::address() const ASIO_NOEXCEPT
else
{
asio::ip::address_v6::bytes_type bytes;
-#if defined(ASIO_HAS_STD_ARRAY)
memcpy(bytes.data(), data_.v6.sin6_addr.s6_addr, 16);
-#else // defined(ASIO_HAS_STD_ARRAY)
- memcpy(bytes.elems, data_.v6.sin6_addr.s6_addr, 16);
-#endif // defined(ASIO_HAS_STD_ARRAY)
return asio::ip::address_v6(bytes, data_.v6.sin6_scope_id);
}
}
-void endpoint::address(const asio::ip::address& addr) ASIO_NOEXCEPT
+void endpoint::address(const asio::ip::address& addr) noexcept
{
endpoint tmp_endpoint(addr, port());
data_ = tmp_endpoint.data_;
}
-bool operator==(const endpoint& e1, const endpoint& e2) ASIO_NOEXCEPT
+bool operator==(const endpoint& e1, const endpoint& e2) noexcept
{
return e1.address() == e2.address() && e1.port() == e2.port();
}
-bool operator<(const endpoint& e1, const endpoint& e2) ASIO_NOEXCEPT
+bool operator<(const endpoint& e1, const endpoint& e2) noexcept
{
if (e1.address() < e2.address())
return true;
diff --git a/3rdparty/asio/include/asio/ip/detail/socket_option.hpp b/3rdparty/asio/include/asio/ip/detail/socket_option.hpp
index 87d6bd6c7e9..c9883ae033e 100644
--- a/3rdparty/asio/include/asio/ip/detail/socket_option.hpp
+++ b/3rdparty/asio/include/asio/ip/detail/socket_option.hpp
@@ -2,7 +2,7 @@
// detail/socket_option.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/host_name.hpp b/3rdparty/asio/include/asio/ip/host_name.hpp
index ab9f82e394f..f9cb1852cae 100644
--- a/3rdparty/asio/include/asio/ip/host_name.hpp
+++ b/3rdparty/asio/include/asio/ip/host_name.hpp
@@ -2,7 +2,7 @@
// ip/host_name.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/icmp.hpp b/3rdparty/asio/include/asio/ip/icmp.hpp
index f9ae9864d7b..9e4e8e4cb5b 100644
--- a/3rdparty/asio/include/asio/ip/icmp.hpp
+++ b/3rdparty/asio/include/asio/ip/icmp.hpp
@@ -2,7 +2,7 @@
// ip/icmp.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -46,33 +46,33 @@ public:
typedef basic_endpoint<icmp> endpoint;
/// Construct to represent the IPv4 ICMP protocol.
- static icmp v4() ASIO_NOEXCEPT
+ static icmp v4() noexcept
{
return icmp(ASIO_OS_DEF(IPPROTO_ICMP),
ASIO_OS_DEF(AF_INET));
}
/// Construct to represent the IPv6 ICMP protocol.
- static icmp v6() ASIO_NOEXCEPT
+ static icmp v6() noexcept
{
return icmp(ASIO_OS_DEF(IPPROTO_ICMPV6),
ASIO_OS_DEF(AF_INET6));
}
/// Obtain an identifier for the type of the protocol.
- int type() const ASIO_NOEXCEPT
+ int type() const noexcept
{
return ASIO_OS_DEF(SOCK_RAW);
}
/// Obtain an identifier for the protocol.
- int protocol() const ASIO_NOEXCEPT
+ int protocol() const noexcept
{
return protocol_;
}
/// Obtain an identifier for the protocol family.
- int family() const ASIO_NOEXCEPT
+ int family() const noexcept
{
return family_;
}
@@ -97,7 +97,7 @@ public:
private:
// Construct with a specific family.
- explicit icmp(int protocol_id, int protocol_family) ASIO_NOEXCEPT
+ explicit icmp(int protocol_id, int protocol_family) noexcept
: protocol_(protocol_id),
family_(protocol_family)
{
diff --git a/3rdparty/asio/include/asio/ip/impl/address.hpp b/3rdparty/asio/include/asio/ip/impl/address.hpp
index 56e391914f6..5780f320067 100644
--- a/3rdparty/asio/include/asio/ip/impl/address.hpp
+++ b/3rdparty/asio/include/asio/ip/impl/address.hpp
@@ -2,7 +2,7 @@
// ip/impl/address.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/impl/address.ipp b/3rdparty/asio/include/asio/ip/impl/address.ipp
index 2e104e92a7b..9893b4ce9c2 100644
--- a/3rdparty/asio/include/asio/ip/impl/address.ipp
+++ b/3rdparty/asio/include/asio/ip/impl/address.ipp
@@ -2,7 +2,7 @@
// ip/impl/address.ipp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -29,7 +29,7 @@
namespace asio {
namespace ip {
-address::address() ASIO_NOEXCEPT
+address::address() noexcept
: type_(ipv4),
ipv4_address_(),
ipv6_address_()
@@ -37,7 +37,7 @@ address::address() ASIO_NOEXCEPT
}
address::address(
- const asio::ip::address_v4& ipv4_address) ASIO_NOEXCEPT
+ const asio::ip::address_v4& ipv4_address) noexcept
: type_(ipv4),
ipv4_address_(ipv4_address),
ipv6_address_()
@@ -45,30 +45,28 @@ address::address(
}
address::address(
- const asio::ip::address_v6& ipv6_address) ASIO_NOEXCEPT
+ const asio::ip::address_v6& ipv6_address) noexcept
: type_(ipv6),
ipv4_address_(),
ipv6_address_(ipv6_address)
{
}
-address::address(const address& other) ASIO_NOEXCEPT
+address::address(const address& other) noexcept
: type_(other.type_),
ipv4_address_(other.ipv4_address_),
ipv6_address_(other.ipv6_address_)
{
}
-#if defined(ASIO_HAS_MOVE)
-address::address(address&& other) ASIO_NOEXCEPT
+address::address(address&& other) noexcept
: type_(other.type_),
ipv4_address_(other.ipv4_address_),
ipv6_address_(other.ipv6_address_)
{
}
-#endif // defined(ASIO_HAS_MOVE)
-address& address::operator=(const address& other) ASIO_NOEXCEPT
+address& address::operator=(const address& other) noexcept
{
type_ = other.type_;
ipv4_address_ = other.ipv4_address_;
@@ -76,18 +74,16 @@ address& address::operator=(const address& other) ASIO_NOEXCEPT
return *this;
}
-#if defined(ASIO_HAS_MOVE)
-address& address::operator=(address&& other) ASIO_NOEXCEPT
+address& address::operator=(address&& other) noexcept
{
type_ = other.type_;
ipv4_address_ = other.ipv4_address_;
ipv6_address_ = other.ipv6_address_;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
address& address::operator=(
- const asio::ip::address_v4& ipv4_address) ASIO_NOEXCEPT
+ const asio::ip::address_v4& ipv4_address) noexcept
{
type_ = ipv4;
ipv4_address_ = ipv4_address;
@@ -96,7 +92,7 @@ address& address::operator=(
}
address& address::operator=(
- const asio::ip::address_v6& ipv6_address) ASIO_NOEXCEPT
+ const asio::ip::address_v6& ipv6_address) noexcept
{
type_ = ipv6;
ipv4_address_ = asio::ip::address_v4();
@@ -113,7 +109,7 @@ address make_address(const char* str)
}
address make_address(const char* str,
- asio::error_code& ec) ASIO_NOEXCEPT
+ asio::error_code& ec) noexcept
{
asio::ip::address_v6 ipv6_address =
asio::ip::make_address_v6(str, ec);
@@ -134,7 +130,7 @@ address make_address(const std::string& str)
}
address make_address(const std::string& str,
- asio::error_code& ec) ASIO_NOEXCEPT
+ asio::error_code& ec) noexcept
{
return make_address(str.c_str(), ec);
}
@@ -147,7 +143,7 @@ address make_address(string_view str)
}
address make_address(string_view str,
- asio::error_code& ec) ASIO_NOEXCEPT
+ asio::error_code& ec) noexcept
{
return make_address(static_cast<std::string>(str), ec);
}
@@ -190,28 +186,28 @@ std::string address::to_string(asio::error_code& ec) const
}
#endif // !defined(ASIO_NO_DEPRECATED)
-bool address::is_loopback() const ASIO_NOEXCEPT
+bool address::is_loopback() const noexcept
{
return (type_ == ipv4)
? ipv4_address_.is_loopback()
: ipv6_address_.is_loopback();
}
-bool address::is_unspecified() const ASIO_NOEXCEPT
+bool address::is_unspecified() const noexcept
{
return (type_ == ipv4)
? ipv4_address_.is_unspecified()
: ipv6_address_.is_unspecified();
}
-bool address::is_multicast() const ASIO_NOEXCEPT
+bool address::is_multicast() const noexcept
{
return (type_ == ipv4)
? ipv4_address_.is_multicast()
: ipv6_address_.is_multicast();
}
-bool operator==(const address& a1, const address& a2) ASIO_NOEXCEPT
+bool operator==(const address& a1, const address& a2) noexcept
{
if (a1.type_ != a2.type_)
return false;
@@ -220,7 +216,7 @@ bool operator==(const address& a1, const address& a2) ASIO_NOEXCEPT
return a1.ipv4_address_ == a2.ipv4_address_;
}
-bool operator<(const address& a1, const address& a2) ASIO_NOEXCEPT
+bool operator<(const address& a1, const address& a2) noexcept
{
if (a1.type_ < a2.type_)
return true;
diff --git a/3rdparty/asio/include/asio/ip/impl/address_v4.hpp b/3rdparty/asio/include/asio/ip/impl/address_v4.hpp
index 8cb22ef0f96..5e29a249ba8 100644
--- a/3rdparty/asio/include/asio/ip/impl/address_v4.hpp
+++ b/3rdparty/asio/include/asio/ip/impl/address_v4.hpp
@@ -2,7 +2,7 @@
// ip/impl/address_v4.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/impl/address_v4.ipp b/3rdparty/asio/include/asio/ip/impl/address_v4.ipp
index 276b399497f..d7803271ac9 100644
--- a/3rdparty/asio/include/asio/ip/impl/address_v4.ipp
+++ b/3rdparty/asio/include/asio/ip/impl/address_v4.ipp
@@ -2,7 +2,7 @@
// ip/impl/address_v4.ipp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -57,19 +57,15 @@ address_v4::address_v4(address_v4::uint_type addr)
static_cast<asio::detail::u_long_type>(addr));
}
-address_v4::bytes_type address_v4::to_bytes() const ASIO_NOEXCEPT
+address_v4::bytes_type address_v4::to_bytes() const noexcept
{
using namespace std; // For memcpy.
bytes_type bytes;
-#if defined(ASIO_HAS_STD_ARRAY)
memcpy(bytes.data(), &addr_.s_addr, 4);
-#else // defined(ASIO_HAS_STD_ARRAY)
- memcpy(bytes.elems, &addr_.s_addr, 4);
-#endif // defined(ASIO_HAS_STD_ARRAY)
return bytes;
}
-address_v4::uint_type address_v4::to_uint() const ASIO_NOEXCEPT
+address_v4::uint_type address_v4::to_uint() const noexcept
{
return asio::detail::socket_ops::network_to_host_long(addr_.s_addr);
}
@@ -108,12 +104,12 @@ std::string address_v4::to_string(asio::error_code& ec) const
}
#endif // !defined(ASIO_NO_DEPRECATED)
-bool address_v4::is_loopback() const ASIO_NOEXCEPT
+bool address_v4::is_loopback() const noexcept
{
return (to_uint() & 0xFF000000) == 0x7F000000;
}
-bool address_v4::is_unspecified() const ASIO_NOEXCEPT
+bool address_v4::is_unspecified() const noexcept
{
return to_uint() == 0;
}
@@ -135,7 +131,7 @@ bool address_v4::is_class_c() const
}
#endif // !defined(ASIO_NO_DEPRECATED)
-bool address_v4::is_multicast() const ASIO_NOEXCEPT
+bool address_v4::is_multicast() const noexcept
{
return (to_uint() & 0xF0000000) == 0xE0000000;
}
@@ -167,7 +163,7 @@ address_v4 make_address_v4(const char* str)
}
address_v4 make_address_v4(const char* str,
- asio::error_code& ec) ASIO_NOEXCEPT
+ asio::error_code& ec) noexcept
{
address_v4::bytes_type bytes;
if (asio::detail::socket_ops::inet_pton(
@@ -182,7 +178,7 @@ address_v4 make_address_v4(const std::string& str)
}
address_v4 make_address_v4(const std::string& str,
- asio::error_code& ec) ASIO_NOEXCEPT
+ asio::error_code& ec) noexcept
{
return make_address_v4(str.c_str(), ec);
}
@@ -195,7 +191,7 @@ address_v4 make_address_v4(string_view str)
}
address_v4 make_address_v4(string_view str,
- asio::error_code& ec) ASIO_NOEXCEPT
+ asio::error_code& ec) noexcept
{
return make_address_v4(static_cast<std::string>(str), ec);
}
diff --git a/3rdparty/asio/include/asio/ip/impl/address_v6.hpp b/3rdparty/asio/include/asio/ip/impl/address_v6.hpp
index f65fab73488..b4b53abe069 100644
--- a/3rdparty/asio/include/asio/ip/impl/address_v6.hpp
+++ b/3rdparty/asio/include/asio/ip/impl/address_v6.hpp
@@ -2,7 +2,7 @@
// ip/impl/address_v6.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/impl/address_v6.ipp b/3rdparty/asio/include/asio/ip/impl/address_v6.ipp
index 0021a22d603..8d5b7d1fd09 100644
--- a/3rdparty/asio/include/asio/ip/impl/address_v6.ipp
+++ b/3rdparty/asio/include/asio/ip/impl/address_v6.ipp
@@ -2,7 +2,7 @@
// ip/impl/address_v6.ipp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -31,7 +31,7 @@
namespace asio {
namespace ip {
-address_v6::address_v6() ASIO_NOEXCEPT
+address_v6::address_v6() noexcept
: addr_(),
scope_id_(0)
{
@@ -56,45 +56,37 @@ address_v6::address_v6(const address_v6::bytes_type& bytes,
memcpy(addr_.s6_addr, bytes.data(), 16);
}
-address_v6::address_v6(const address_v6& other) ASIO_NOEXCEPT
+address_v6::address_v6(const address_v6& other) noexcept
: addr_(other.addr_),
scope_id_(other.scope_id_)
{
}
-#if defined(ASIO_HAS_MOVE)
-address_v6::address_v6(address_v6&& other) ASIO_NOEXCEPT
+address_v6::address_v6(address_v6&& other) noexcept
: addr_(other.addr_),
scope_id_(other.scope_id_)
{
}
-#endif // defined(ASIO_HAS_MOVE)
-address_v6& address_v6::operator=(const address_v6& other) ASIO_NOEXCEPT
+address_v6& address_v6::operator=(const address_v6& other) noexcept
{
addr_ = other.addr_;
scope_id_ = other.scope_id_;
return *this;
}
-#if defined(ASIO_HAS_MOVE)
-address_v6& address_v6::operator=(address_v6&& other) ASIO_NOEXCEPT
+address_v6& address_v6::operator=(address_v6&& other) noexcept
{
addr_ = other.addr_;
scope_id_ = other.scope_id_;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
-address_v6::bytes_type address_v6::to_bytes() const ASIO_NOEXCEPT
+address_v6::bytes_type address_v6::to_bytes() const noexcept
{
using namespace std; // For memcpy.
bytes_type bytes;
-#if defined(ASIO_HAS_STD_ARRAY)
memcpy(bytes.data(), addr_.s6_addr, 16);
-#else // defined(ASIO_HAS_STD_ARRAY)
- memcpy(bytes.elems, addr_.s6_addr, 16);
-#endif // defined(ASIO_HAS_STD_ARRAY)
return bytes;
}
@@ -138,7 +130,7 @@ address_v4 address_v6::to_v4() const
}
#endif // !defined(ASIO_NO_DEPRECATED)
-bool address_v6::is_loopback() const ASIO_NOEXCEPT
+bool address_v6::is_loopback() const noexcept
{
return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
&& (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
@@ -150,7 +142,7 @@ bool address_v6::is_loopback() const ASIO_NOEXCEPT
&& (addr_.s6_addr[14] == 0) && (addr_.s6_addr[15] == 1));
}
-bool address_v6::is_unspecified() const ASIO_NOEXCEPT
+bool address_v6::is_unspecified() const noexcept
{
return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
&& (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
@@ -162,17 +154,17 @@ bool address_v6::is_unspecified() const ASIO_NOEXCEPT
&& (addr_.s6_addr[14] == 0) && (addr_.s6_addr[15] == 0));
}
-bool address_v6::is_link_local() const ASIO_NOEXCEPT
+bool address_v6::is_link_local() const noexcept
{
return ((addr_.s6_addr[0] == 0xfe) && ((addr_.s6_addr[1] & 0xc0) == 0x80));
}
-bool address_v6::is_site_local() const ASIO_NOEXCEPT
+bool address_v6::is_site_local() const noexcept
{
return ((addr_.s6_addr[0] == 0xfe) && ((addr_.s6_addr[1] & 0xc0) == 0xc0));
}
-bool address_v6::is_v4_mapped() const ASIO_NOEXCEPT
+bool address_v6::is_v4_mapped() const noexcept
{
return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
&& (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
@@ -198,37 +190,37 @@ bool address_v6::is_v4_compatible() const
}
#endif // !defined(ASIO_NO_DEPRECATED)
-bool address_v6::is_multicast() const ASIO_NOEXCEPT
+bool address_v6::is_multicast() const noexcept
{
return (addr_.s6_addr[0] == 0xff);
}
-bool address_v6::is_multicast_global() const ASIO_NOEXCEPT
+bool address_v6::is_multicast_global() const noexcept
{
return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x0e));
}
-bool address_v6::is_multicast_link_local() const ASIO_NOEXCEPT
+bool address_v6::is_multicast_link_local() const noexcept
{
return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x02));
}
-bool address_v6::is_multicast_node_local() const ASIO_NOEXCEPT
+bool address_v6::is_multicast_node_local() const noexcept
{
return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x01));
}
-bool address_v6::is_multicast_org_local() const ASIO_NOEXCEPT
+bool address_v6::is_multicast_org_local() const noexcept
{
return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x08));
}
-bool address_v6::is_multicast_site_local() const ASIO_NOEXCEPT
+bool address_v6::is_multicast_site_local() const noexcept
{
return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x05));
}
-bool operator==(const address_v6& a1, const address_v6& a2) ASIO_NOEXCEPT
+bool operator==(const address_v6& a1, const address_v6& a2) noexcept
{
using namespace std; // For memcmp.
return memcmp(&a1.addr_, &a2.addr_,
@@ -236,7 +228,7 @@ bool operator==(const address_v6& a1, const address_v6& a2) ASIO_NOEXCEPT
&& a1.scope_id_ == a2.scope_id_;
}
-bool operator<(const address_v6& a1, const address_v6& a2) ASIO_NOEXCEPT
+bool operator<(const address_v6& a1, const address_v6& a2) noexcept
{
using namespace std; // For memcmp.
int memcmp_result = memcmp(&a1.addr_, &a2.addr_,
@@ -248,7 +240,7 @@ bool operator<(const address_v6& a1, const address_v6& a2) ASIO_NOEXCEPT
return a1.scope_id_ < a2.scope_id_;
}
-address_v6 address_v6::loopback() ASIO_NOEXCEPT
+address_v6 address_v6::loopback() noexcept
{
address_v6 tmp;
tmp.addr_.s6_addr[15] = 1;
@@ -282,7 +274,7 @@ address_v6 make_address_v6(const char* str)
}
address_v6 make_address_v6(const char* str,
- asio::error_code& ec) ASIO_NOEXCEPT
+ asio::error_code& ec) noexcept
{
address_v6::bytes_type bytes;
unsigned long scope_id = 0;
@@ -298,7 +290,7 @@ address_v6 make_address_v6(const std::string& str)
}
address_v6 make_address_v6(const std::string& str,
- asio::error_code& ec) ASIO_NOEXCEPT
+ asio::error_code& ec) noexcept
{
return make_address_v6(str.c_str(), ec);
}
@@ -311,7 +303,7 @@ address_v6 make_address_v6(string_view str)
}
address_v6 make_address_v6(string_view str,
- asio::error_code& ec) ASIO_NOEXCEPT
+ asio::error_code& ec) noexcept
{
return make_address_v6(static_cast<std::string>(str), ec);
}
diff --git a/3rdparty/asio/include/asio/ip/impl/basic_endpoint.hpp b/3rdparty/asio/include/asio/ip/impl/basic_endpoint.hpp
index 7cd90e6f42e..2da96c16547 100644
--- a/3rdparty/asio/include/asio/ip/impl/basic_endpoint.hpp
+++ b/3rdparty/asio/include/asio/ip/impl/basic_endpoint.hpp
@@ -2,7 +2,7 @@
// ip/impl/basic_endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/impl/host_name.ipp b/3rdparty/asio/include/asio/ip/impl/host_name.ipp
index 84f5729246c..eb27829fdab 100644
--- a/3rdparty/asio/include/asio/ip/impl/host_name.ipp
+++ b/3rdparty/asio/include/asio/ip/impl/host_name.ipp
@@ -2,7 +2,7 @@
// ip/impl/host_name.ipp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/impl/network_v4.hpp b/3rdparty/asio/include/asio/ip/impl/network_v4.hpp
index ae0defa8836..2199c7da8ca 100644
--- a/3rdparty/asio/include/asio/ip/impl/network_v4.hpp
+++ b/3rdparty/asio/include/asio/ip/impl/network_v4.hpp
@@ -2,7 +2,7 @@
// ip/impl/network_v4.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/ip/impl/network_v4.ipp b/3rdparty/asio/include/asio/ip/impl/network_v4.ipp
index 27f0519acf5..e7e68ed443a 100644
--- a/3rdparty/asio/include/asio/ip/impl/network_v4.ipp
+++ b/3rdparty/asio/include/asio/ip/impl/network_v4.ipp
@@ -2,7 +2,7 @@
// ip/impl/network_v4.ipp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -91,7 +91,7 @@ network_v4::network_v4(const address_v4& addr, const address_v4& mask)
}
}
-address_v4 network_v4::netmask() const ASIO_NOEXCEPT
+address_v4 network_v4::netmask() const noexcept
{
uint32_t nmbits = 0xffffffff;
if (prefix_length_ == 0)
@@ -101,7 +101,7 @@ address_v4 network_v4::netmask() const ASIO_NOEXCEPT
return address_v4(nmbits);
}
-address_v4_range network_v4::hosts() const ASIO_NOEXCEPT
+address_v4_range network_v4::hosts() const noexcept
{
return is_host()
? address_v4_range(address_, address_v4(address_.to_uint() + 1))
@@ -129,7 +129,9 @@ std::string network_v4::to_string(asio::error_code& ec) const
using namespace std; // For sprintf.
ec = asio::error_code();
char prefix_len[16];
-#if defined(ASIO_HAS_SECURE_RTL)
+#if defined(ASIO_HAS_SNPRINTF)
+ snprintf(prefix_len, sizeof(prefix_len), "/%u", prefix_length_);
+#elif defined(ASIO_HAS_SECURE_RTL)
sprintf_s(prefix_len, sizeof(prefix_len), "/%u", prefix_length_);
#else // defined(ASIO_HAS_SECURE_RTL)
sprintf(prefix_len, "/%u", prefix_length_);
diff --git a/3rdparty/asio/include/asio/ip/impl/network_v6.hpp b/3rdparty/asio/include/asio/ip/impl/network_v6.hpp
index f159f839b85..69c121813cb 100644
--- a/3rdparty/asio/include/asio/ip/impl/network_v6.hpp
+++ b/3rdparty/asio/include/asio/ip/impl/network_v6.hpp
@@ -2,7 +2,7 @@
// ip/impl/network_v6.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/impl/network_v6.ipp b/3rdparty/asio/include/asio/ip/impl/network_v6.ipp
index 1a4684bf03d..d85cd647e06 100644
--- a/3rdparty/asio/include/asio/ip/impl/network_v6.ipp
+++ b/3rdparty/asio/include/asio/ip/impl/network_v6.ipp
@@ -2,7 +2,7 @@
// ip/impl/network_v6.ipp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -42,7 +42,7 @@ network_v6::network_v6(const address_v6& addr, unsigned short prefix_len)
}
}
-ASIO_DECL address_v6 network_v6::network() const ASIO_NOEXCEPT
+ASIO_DECL address_v6 network_v6::network() const noexcept
{
address_v6::bytes_type bytes(address_.to_bytes());
for (std::size_t i = 0; i < 16; ++i)
@@ -55,7 +55,7 @@ ASIO_DECL address_v6 network_v6::network() const ASIO_NOEXCEPT
return address_v6(bytes, address_.scope_id());
}
-address_v6_range network_v6::hosts() const ASIO_NOEXCEPT
+address_v6_range network_v6::hosts() const noexcept
{
address_v6::bytes_type begin_bytes(address_.to_bytes());
address_v6::bytes_type end_bytes(address_.to_bytes());
@@ -98,7 +98,9 @@ std::string network_v6::to_string(asio::error_code& ec) const
using namespace std; // For sprintf.
ec = asio::error_code();
char prefix_len[16];
-#if defined(ASIO_HAS_SECURE_RTL)
+#if defined(ASIO_HAS_SNPRINTF)
+ snprintf(prefix_len, sizeof(prefix_len), "/%u", prefix_length_);
+#elif defined(ASIO_HAS_SECURE_RTL)
sprintf_s(prefix_len, sizeof(prefix_len), "/%u", prefix_length_);
#else // defined(ASIO_HAS_SECURE_RTL)
sprintf(prefix_len, "/%u", prefix_length_);
diff --git a/3rdparty/asio/include/asio/ip/multicast.hpp b/3rdparty/asio/include/asio/ip/multicast.hpp
index 1b86351f095..363f5ed81d5 100644
--- a/3rdparty/asio/include/asio/ip/multicast.hpp
+++ b/3rdparty/asio/include/asio/ip/multicast.hpp
@@ -2,7 +2,7 @@
// ip/multicast.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/network_v4.hpp b/3rdparty/asio/include/asio/ip/network_v4.hpp
index 035dea89e79..1c29ebec143 100644
--- a/3rdparty/asio/include/asio/ip/network_v4.hpp
+++ b/3rdparty/asio/include/asio/ip/network_v4.hpp
@@ -2,7 +2,7 @@
// ip/network_v4.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -40,7 +40,7 @@ class network_v4
{
public:
/// Default constructor.
- network_v4() ASIO_NOEXCEPT
+ network_v4() noexcept
: address_(),
prefix_length_(0)
{
@@ -55,78 +55,74 @@ public:
const address_v4& mask);
/// Copy constructor.
- network_v4(const network_v4& other) ASIO_NOEXCEPT
+ network_v4(const network_v4& other) noexcept
: address_(other.address_),
prefix_length_(other.prefix_length_)
{
}
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
- network_v4(network_v4&& other) ASIO_NOEXCEPT
- : address_(ASIO_MOVE_CAST(address_v4)(other.address_)),
+ network_v4(network_v4&& other) noexcept
+ : address_(static_cast<address_v4&&>(other.address_)),
prefix_length_(other.prefix_length_)
{
}
-#endif // defined(ASIO_HAS_MOVE)
/// Assign from another network.
- network_v4& operator=(const network_v4& other) ASIO_NOEXCEPT
+ network_v4& operator=(const network_v4& other) noexcept
{
address_ = other.address_;
prefix_length_ = other.prefix_length_;
return *this;
}
-#if defined(ASIO_HAS_MOVE)
/// Move-assign from another network.
- network_v4& operator=(network_v4&& other) ASIO_NOEXCEPT
+ network_v4& operator=(network_v4&& other) noexcept
{
- address_ = ASIO_MOVE_CAST(address_v4)(other.address_);
+ address_ = static_cast<address_v4&&>(other.address_);
prefix_length_ = other.prefix_length_;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
/// Obtain the address object specified when the network object was created.
- address_v4 address() const ASIO_NOEXCEPT
+ address_v4 address() const noexcept
{
return address_;
}
/// Obtain the prefix length that was specified when the network object was
/// created.
- unsigned short prefix_length() const ASIO_NOEXCEPT
+ unsigned short prefix_length() const noexcept
{
return prefix_length_;
}
/// Obtain the netmask that was specified when the network object was created.
- ASIO_DECL address_v4 netmask() const ASIO_NOEXCEPT;
+ ASIO_DECL address_v4 netmask() const noexcept;
/// Obtain an address object that represents the network address.
- address_v4 network() const ASIO_NOEXCEPT
+ address_v4 network() const noexcept
{
return address_v4(address_.to_uint() & netmask().to_uint());
}
/// Obtain an address object that represents the network's broadcast address.
- address_v4 broadcast() const ASIO_NOEXCEPT
+ address_v4 broadcast() const noexcept
{
return address_v4(network().to_uint() | (netmask().to_uint() ^ 0xFFFFFFFF));
}
/// Obtain an address range corresponding to the hosts in the network.
- ASIO_DECL address_v4_range hosts() const ASIO_NOEXCEPT;
+ ASIO_DECL address_v4_range hosts() const noexcept;
/// Obtain the true network address, omitting any host bits.
- network_v4 canonical() const ASIO_NOEXCEPT
+ network_v4 canonical() const noexcept
{
- return network_v4(network(), netmask());
+ return network_v4(network(), prefix_length());
}
/// Test if network is a valid host address.
- bool is_host() const ASIO_NOEXCEPT
+ bool is_host() const noexcept
{
return prefix_length_ == 32;
}
diff --git a/3rdparty/asio/include/asio/ip/network_v6.hpp b/3rdparty/asio/include/asio/ip/network_v6.hpp
index 44c0ff36305..942ed9d2f29 100644
--- a/3rdparty/asio/include/asio/ip/network_v6.hpp
+++ b/3rdparty/asio/include/asio/ip/network_v6.hpp
@@ -2,7 +2,7 @@
// ip/network_v6.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -40,7 +40,7 @@ class network_v6
{
public:
/// Default constructor.
- network_v6() ASIO_NOEXCEPT
+ network_v6() noexcept
: address_(),
prefix_length_(0)
{
@@ -51,66 +51,62 @@ public:
unsigned short prefix_len);
/// Copy constructor.
- network_v6(const network_v6& other) ASIO_NOEXCEPT
+ network_v6(const network_v6& other) noexcept
: address_(other.address_),
prefix_length_(other.prefix_length_)
{
}
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
- network_v6(network_v6&& other) ASIO_NOEXCEPT
- : address_(ASIO_MOVE_CAST(address_v6)(other.address_)),
+ network_v6(network_v6&& other) noexcept
+ : address_(static_cast<address_v6&&>(other.address_)),
prefix_length_(other.prefix_length_)
{
}
-#endif // defined(ASIO_HAS_MOVE)
/// Assign from another network.
- network_v6& operator=(const network_v6& other) ASIO_NOEXCEPT
+ network_v6& operator=(const network_v6& other) noexcept
{
address_ = other.address_;
prefix_length_ = other.prefix_length_;
return *this;
}
-#if defined(ASIO_HAS_MOVE)
/// Move-assign from another network.
- network_v6& operator=(network_v6&& other) ASIO_NOEXCEPT
+ network_v6& operator=(network_v6&& other) noexcept
{
- address_ = ASIO_MOVE_CAST(address_v6)(other.address_);
+ address_ = static_cast<address_v6&&>(other.address_);
prefix_length_ = other.prefix_length_;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
/// Obtain the address object specified when the network object was created.
- address_v6 address() const ASIO_NOEXCEPT
+ address_v6 address() const noexcept
{
return address_;
}
/// Obtain the prefix length that was specified when the network object was
/// created.
- unsigned short prefix_length() const ASIO_NOEXCEPT
+ unsigned short prefix_length() const noexcept
{
return prefix_length_;
}
/// Obtain an address object that represents the network address.
- ASIO_DECL address_v6 network() const ASIO_NOEXCEPT;
+ ASIO_DECL address_v6 network() const noexcept;
/// Obtain an address range corresponding to the hosts in the network.
- ASIO_DECL address_v6_range hosts() const ASIO_NOEXCEPT;
+ ASIO_DECL address_v6_range hosts() const noexcept;
/// Obtain the true network address, omitting any host bits.
- network_v6 canonical() const ASIO_NOEXCEPT
+ network_v6 canonical() const noexcept
{
return network_v6(network(), prefix_length());
}
/// Test if network is a valid host address.
- bool is_host() const ASIO_NOEXCEPT
+ bool is_host() const noexcept
{
return prefix_length_ == 128;
}
diff --git a/3rdparty/asio/include/asio/ip/resolver_base.hpp b/3rdparty/asio/include/asio/ip/resolver_base.hpp
index 06e769c05b8..9fa01ca9107 100644
--- a/3rdparty/asio/include/asio/ip/resolver_base.hpp
+++ b/3rdparty/asio/include/asio/ip/resolver_base.hpp
@@ -2,7 +2,7 @@
// ip/resolver_base.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/resolver_query_base.hpp b/3rdparty/asio/include/asio/ip/resolver_query_base.hpp
index a96068cb3f3..892bc28e006 100644
--- a/3rdparty/asio/include/asio/ip/resolver_query_base.hpp
+++ b/3rdparty/asio/include/asio/ip/resolver_query_base.hpp
@@ -2,7 +2,7 @@
// ip/resolver_query_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/tcp.hpp b/3rdparty/asio/include/asio/ip/tcp.hpp
index df2b99c0f8c..b8319609ddb 100644
--- a/3rdparty/asio/include/asio/ip/tcp.hpp
+++ b/3rdparty/asio/include/asio/ip/tcp.hpp
@@ -2,7 +2,7 @@
// ip/tcp.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -49,31 +49,31 @@ public:
typedef basic_endpoint<tcp> endpoint;
/// Construct to represent the IPv4 TCP protocol.
- static tcp v4() ASIO_NOEXCEPT
+ static tcp v4() noexcept
{
return tcp(ASIO_OS_DEF(AF_INET));
}
/// Construct to represent the IPv6 TCP protocol.
- static tcp v6() ASIO_NOEXCEPT
+ static tcp v6() noexcept
{
return tcp(ASIO_OS_DEF(AF_INET6));
}
/// Obtain an identifier for the type of the protocol.
- int type() const ASIO_NOEXCEPT
+ int type() const noexcept
{
return ASIO_OS_DEF(SOCK_STREAM);
}
/// Obtain an identifier for the protocol.
- int protocol() const ASIO_NOEXCEPT
+ int protocol() const noexcept
{
return ASIO_OS_DEF(IPPROTO_TCP);
}
/// Obtain an identifier for the protocol family.
- int family() const ASIO_NOEXCEPT
+ int family() const noexcept
{
return family_;
}
@@ -139,7 +139,7 @@ public:
private:
// Construct with a specific family.
- explicit tcp(int protocol_family) ASIO_NOEXCEPT
+ explicit tcp(int protocol_family) noexcept
: family_(protocol_family)
{
}
diff --git a/3rdparty/asio/include/asio/ip/udp.hpp b/3rdparty/asio/include/asio/ip/udp.hpp
index 796de061229..50c667a5371 100644
--- a/3rdparty/asio/include/asio/ip/udp.hpp
+++ b/3rdparty/asio/include/asio/ip/udp.hpp
@@ -2,7 +2,7 @@
// ip/udp.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -46,31 +46,31 @@ public:
typedef basic_endpoint<udp> endpoint;
/// Construct to represent the IPv4 UDP protocol.
- static udp v4() ASIO_NOEXCEPT
+ static udp v4() noexcept
{
return udp(ASIO_OS_DEF(AF_INET));
}
/// Construct to represent the IPv6 UDP protocol.
- static udp v6() ASIO_NOEXCEPT
+ static udp v6() noexcept
{
return udp(ASIO_OS_DEF(AF_INET6));
}
/// Obtain an identifier for the type of the protocol.
- int type() const ASIO_NOEXCEPT
+ int type() const noexcept
{
return ASIO_OS_DEF(SOCK_DGRAM);
}
/// Obtain an identifier for the protocol.
- int protocol() const ASIO_NOEXCEPT
+ int protocol() const noexcept
{
return ASIO_OS_DEF(IPPROTO_UDP);
}
/// Obtain an identifier for the protocol family.
- int family() const ASIO_NOEXCEPT
+ int family() const noexcept
{
return family_;
}
@@ -95,7 +95,7 @@ public:
private:
// Construct with a specific family.
- explicit udp(int protocol_family) ASIO_NOEXCEPT
+ explicit udp(int protocol_family) noexcept
: family_(protocol_family)
{
}
diff --git a/3rdparty/asio/include/asio/ip/unicast.hpp b/3rdparty/asio/include/asio/ip/unicast.hpp
index a0b78516372..4d68af877bc 100644
--- a/3rdparty/asio/include/asio/ip/unicast.hpp
+++ b/3rdparty/asio/include/asio/ip/unicast.hpp
@@ -2,7 +2,7 @@
// ip/unicast.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ip/v6_only.hpp b/3rdparty/asio/include/asio/ip/v6_only.hpp
index ff93767f3f2..0fc61213bda 100644
--- a/3rdparty/asio/include/asio/ip/v6_only.hpp
+++ b/3rdparty/asio/include/asio/ip/v6_only.hpp
@@ -2,7 +2,7 @@
// ip/v6_only.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -26,7 +26,7 @@ namespace ip {
/// Socket option for determining whether an IPv6 socket supports IPv6
/// communication only.
/**
- * Implements the IPPROTO_IPV6/IP_V6ONLY socket option.
+ * Implements the IPPROTO_IPV6/IPV6_V6ONLY socket option.
*
* @par Examples
* Setting the option:
diff --git a/3rdparty/asio/include/asio/is_applicable_property.hpp b/3rdparty/asio/include/asio/is_applicable_property.hpp
index c0100e0b1f1..20ca981ad02 100644
--- a/3rdparty/asio/include/asio/is_applicable_property.hpp
+++ b/3rdparty/asio/include/asio/is_applicable_property.hpp
@@ -2,7 +2,7 @@
// is_applicable_property.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -30,11 +30,11 @@ struct is_applicable_property_trait : false_type
template <typename T, typename Property>
struct is_applicable_property_trait<T, Property,
- typename void_type<
- typename enable_if<
+ void_t<
+ enable_if_t<
!!Property::template is_applicable_property_v<T>
- >::type
- >::type> : true_type
+ >
+ >> : true_type
{
};
@@ -51,7 +51,7 @@ struct is_applicable_property :
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T, typename Property>
-ASIO_CONSTEXPR const bool is_applicable_property_v
+constexpr const bool is_applicable_property_v
= is_applicable_property<T, Property>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
diff --git a/3rdparty/asio/include/asio/is_contiguous_iterator.hpp b/3rdparty/asio/include/asio/is_contiguous_iterator.hpp
new file mode 100644
index 00000000000..a120d4d3761
--- /dev/null
+++ b/3rdparty/asio/include/asio/is_contiguous_iterator.hpp
@@ -0,0 +1,45 @@
+//
+// is_contiguous_iterator.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_IS_CONTIGUOUS_ITERATOR_HPP
+#define ASIO_IS_CONTIGUOUS_ITERATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <iterator>
+#include "asio/detail/type_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// The is_contiguous_iterator class is a traits class that may be used to
+/// determine whether a type is a contiguous iterator.
+template <typename T>
+struct is_contiguous_iterator :
+#if defined(ASIO_HAS_STD_CONCEPTS) \
+ || defined(GENERATING_DOCUMENTATION)
+ integral_constant<bool, std::contiguous_iterator<T>>
+#else // defined(ASIO_HAS_STD_CONCEPTS)
+ // || defined(GENERATING_DOCUMENTATION)
+ is_pointer<T>
+#endif // defined(ASIO_HAS_STD_CONCEPTS)
+ // || defined(GENERATING_DOCUMENTATION)
+{
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_IS_CONTIGUOUS_ITERATOR_HPP
diff --git a/3rdparty/asio/include/asio/is_executor.hpp b/3rdparty/asio/include/asio/is_executor.hpp
index 0d5d703be35..2c933a3949c 100644
--- a/3rdparty/asio/include/asio/is_executor.hpp
+++ b/3rdparty/asio/include/asio/is_executor.hpp
@@ -2,7 +2,7 @@
// is_executor.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/is_read_buffered.hpp b/3rdparty/asio/include/asio/is_read_buffered.hpp
index aed333249c3..768f70fb7e1 100644
--- a/3rdparty/asio/include/asio/is_read_buffered.hpp
+++ b/3rdparty/asio/include/asio/is_read_buffered.hpp
@@ -2,7 +2,7 @@
// is_read_buffered.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/is_write_buffered.hpp b/3rdparty/asio/include/asio/is_write_buffered.hpp
index b091d9a05bc..1818fd4b2d5 100644
--- a/3rdparty/asio/include/asio/is_write_buffered.hpp
+++ b/3rdparty/asio/include/asio/is_write_buffered.hpp
@@ -2,7 +2,7 @@
// is_write_buffered.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/local/basic_endpoint.hpp b/3rdparty/asio/include/asio/local/basic_endpoint.hpp
index 11a3c9b5a1f..d363f352531 100644
--- a/3rdparty/asio/include/asio/local/basic_endpoint.hpp
+++ b/3rdparty/asio/include/asio/local/basic_endpoint.hpp
@@ -2,7 +2,7 @@
// local/basic_endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Derived from a public domain implementation written by Daniel Casimiro.
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -60,7 +60,7 @@ public:
#endif
/// Default constructor.
- basic_endpoint() ASIO_NOEXCEPT
+ basic_endpoint() noexcept
{
}
@@ -90,13 +90,11 @@ public:
{
}
-#if defined(ASIO_HAS_MOVE)
/// Move constructor.
basic_endpoint(basic_endpoint&& other)
: impl_(other.impl_)
{
}
-#endif // defined(ASIO_HAS_MOVE)
/// Assign from another endpoint.
basic_endpoint& operator=(const basic_endpoint& other)
@@ -105,14 +103,12 @@ public:
return *this;
}
-#if defined(ASIO_HAS_MOVE)
/// Move-assign from another endpoint.
basic_endpoint& operator=(basic_endpoint&& other)
{
impl_ = other.impl_;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
/// The protocol associated with the endpoint.
protocol_type protocol() const
diff --git a/3rdparty/asio/include/asio/local/connect_pair.hpp b/3rdparty/asio/include/asio/local/connect_pair.hpp
index 0b22ef44780..b8608e40de5 100644
--- a/3rdparty/asio/include/asio/local/connect_pair.hpp
+++ b/3rdparty/asio/include/asio/local/connect_pair.hpp
@@ -2,7 +2,7 @@
// local/connect_pair.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/local/datagram_protocol.hpp b/3rdparty/asio/include/asio/local/datagram_protocol.hpp
index a147eb8c7f4..6bf18a46e49 100644
--- a/3rdparty/asio/include/asio/local/datagram_protocol.hpp
+++ b/3rdparty/asio/include/asio/local/datagram_protocol.hpp
@@ -2,7 +2,7 @@
// local/datagram_protocol.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -45,19 +45,19 @@ class datagram_protocol
{
public:
/// Obtain an identifier for the type of the protocol.
- int type() const ASIO_NOEXCEPT
+ int type() const noexcept
{
return SOCK_DGRAM;
}
/// Obtain an identifier for the protocol.
- int protocol() const ASIO_NOEXCEPT
+ int protocol() const noexcept
{
return 0;
}
/// Obtain an identifier for the protocol family.
- int family() const ASIO_NOEXCEPT
+ int family() const noexcept
{
return AF_UNIX;
}
diff --git a/3rdparty/asio/include/asio/local/detail/endpoint.hpp b/3rdparty/asio/include/asio/local/detail/endpoint.hpp
index 699c225d5a6..5e94c3d0aeb 100644
--- a/3rdparty/asio/include/asio/local/detail/endpoint.hpp
+++ b/3rdparty/asio/include/asio/local/detail/endpoint.hpp
@@ -2,7 +2,7 @@
// local/detail/endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Derived from a public domain implementation written by Daniel Casimiro.
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/local/detail/impl/endpoint.ipp b/3rdparty/asio/include/asio/local/detail/impl/endpoint.ipp
index 8a254ed6da1..55b403e8ed6 100644
--- a/3rdparty/asio/include/asio/local/detail/impl/endpoint.ipp
+++ b/3rdparty/asio/include/asio/local/detail/impl/endpoint.ipp
@@ -2,7 +2,7 @@
// local/detail/impl/endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Derived from a public domain implementation written by Daniel Casimiro.
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/local/seq_packet_protocol.hpp b/3rdparty/asio/include/asio/local/seq_packet_protocol.hpp
new file mode 100644
index 00000000000..c5a231fe859
--- /dev/null
+++ b/3rdparty/asio/include/asio/local/seq_packet_protocol.hpp
@@ -0,0 +1,84 @@
+//
+// local/seq_packet_protocol.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_LOCAL_SEQ_PACKET_PROTOCOL_HPP
+#define ASIO_LOCAL_SEQ_PACKET_PROTOCOL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_LOCAL_SOCKETS) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include "asio/basic_socket_acceptor.hpp"
+#include "asio/basic_seq_packet_socket.hpp"
+#include "asio/detail/socket_types.hpp"
+#include "asio/local/basic_endpoint.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace local {
+
+/// Encapsulates the flags needed for seq_packet UNIX sockets.
+/**
+ * The asio::local::seq_packet_protocol class contains flags necessary
+ * for sequenced packet UNIX domain sockets.
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe.@n
+ * @e Shared @e objects: Safe.
+ *
+ * @par Concepts:
+ * Protocol.
+ */
+class seq_packet_protocol
+{
+public:
+ /// Obtain an identifier for the type of the protocol.
+ int type() const noexcept
+ {
+ return SOCK_SEQPACKET;
+ }
+
+ /// Obtain an identifier for the protocol.
+ int protocol() const noexcept
+ {
+ return 0;
+ }
+
+ /// Obtain an identifier for the protocol family.
+ int family() const noexcept
+ {
+ return AF_UNIX;
+ }
+
+ /// The type of a UNIX domain endpoint.
+ typedef basic_endpoint<seq_packet_protocol> endpoint;
+
+ /// The UNIX domain socket type.
+ typedef basic_seq_packet_socket<seq_packet_protocol> socket;
+
+ /// The UNIX domain acceptor type.
+ typedef basic_socket_acceptor<seq_packet_protocol> acceptor;
+};
+
+} // namespace local
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_LOCAL_SEQ_PACKET_PROTOCOL_HPP
diff --git a/3rdparty/asio/include/asio/local/stream_protocol.hpp b/3rdparty/asio/include/asio/local/stream_protocol.hpp
index 5f39f2cc3c7..4cbad450fc5 100644
--- a/3rdparty/asio/include/asio/local/stream_protocol.hpp
+++ b/3rdparty/asio/include/asio/local/stream_protocol.hpp
@@ -2,7 +2,7 @@
// local/stream_protocol.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -47,19 +47,19 @@ class stream_protocol
{
public:
/// Obtain an identifier for the type of the protocol.
- int type() const ASIO_NOEXCEPT
+ int type() const noexcept
{
return SOCK_STREAM;
}
/// Obtain an identifier for the protocol.
- int protocol() const ASIO_NOEXCEPT
+ int protocol() const noexcept
{
return 0;
}
/// Obtain an identifier for the protocol family.
- int family() const ASIO_NOEXCEPT
+ int family() const noexcept
{
return AF_UNIX;
}
diff --git a/3rdparty/asio/include/asio/multiple_exceptions.hpp b/3rdparty/asio/include/asio/multiple_exceptions.hpp
index f66f8e67132..2fd0455a91a 100644
--- a/3rdparty/asio/include/asio/multiple_exceptions.hpp
+++ b/3rdparty/asio/include/asio/multiple_exceptions.hpp
@@ -2,7 +2,7 @@
// multiple_exceptions.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -21,9 +21,6 @@
namespace asio {
-#if defined(ASIO_HAS_STD_EXCEPTION_PTR) \
- || defined(GENERATING_DOCUMENTATION)
-
/// Exception thrown when there are multiple pending exceptions to rethrow.
class multiple_exceptions
: public std::exception
@@ -31,11 +28,11 @@ class multiple_exceptions
public:
/// Constructor.
ASIO_DECL multiple_exceptions(
- std::exception_ptr first) ASIO_NOEXCEPT;
+ std::exception_ptr first) noexcept;
/// Obtain message associated with exception.
ASIO_DECL virtual const char* what() const
- ASIO_NOEXCEPT_OR_NOTHROW;
+ noexcept;
/// Obtain a pointer to the first exception.
ASIO_DECL std::exception_ptr first_exception() const;
@@ -44,9 +41,6 @@ private:
std::exception_ptr first_;
};
-#endif // defined(ASIO_HAS_STD_EXCEPTION_PTR)
- // || defined(GENERATING_DOCUMENTATION)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/packaged_task.hpp b/3rdparty/asio/include/asio/packaged_task.hpp
index cd47f66d833..68e5b9b175a 100644
--- a/3rdparty/asio/include/asio/packaged_task.hpp
+++ b/3rdparty/asio/include/asio/packaged_task.hpp
@@ -2,7 +2,7 @@
// packaged_task.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,15 +23,11 @@
#include "asio/async_result.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
-
/// Partial specialisation of @c async_result for @c std::packaged_task.
template <typename Result, typename... Args, typename Signature>
class async_result<std::packaged_task<Result(Args...)>, Signature>
@@ -60,62 +56,6 @@ private:
return_type future_;
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
-template <typename Result, typename Signature>
-struct async_result<std::packaged_task<Result()>, Signature>
-{
- typedef std::packaged_task<Result()> completion_handler_type;
- typedef std::future<Result> return_type;
-
- explicit async_result(completion_handler_type& h)
- : future_(h.get_future())
- {
- }
-
- return_type get()
- {
- return std::move(future_);
- }
-
-private:
- return_type future_;
-};
-
-#define ASIO_PRIVATE_ASYNC_RESULT_DEF(n) \
- template <typename Result, \
- ASIO_VARIADIC_TPARAMS(n), typename Signature> \
- class async_result< \
- std::packaged_task<Result(ASIO_VARIADIC_TARGS(n))>, Signature> \
- { \
- public: \
- typedef std::packaged_task< \
- Result(ASIO_VARIADIC_TARGS(n))> \
- completion_handler_type; \
- \
- typedef std::future<Result> return_type; \
- \
- explicit async_result(completion_handler_type& h) \
- : future_(h.get_future()) \
- { \
- } \
- \
- return_type get() \
- { \
- return std::move(future_); \
- } \
- \
- private: \
- return_type future_; \
- }; \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_ASYNC_RESULT_DEF)
-#undef ASIO_PRIVATE_ASYNC_RESULT_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/placeholders.hpp b/3rdparty/asio/include/asio/placeholders.hpp
index 9c4a7053fdc..21da545fe9e 100644
--- a/3rdparty/asio/include/asio/placeholders.hpp
+++ b/3rdparty/asio/include/asio/placeholders.hpp
@@ -2,7 +2,7 @@
// placeholders.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,10 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/arg.hpp>
-#endif // defined(ASIO_HAS_BOOST_BIND)
+#include "asio/detail/functional.hpp"
#include "asio/detail/push_options.hpp"
@@ -28,119 +25,46 @@ namespace placeholders {
#if defined(GENERATING_DOCUMENTATION)
-/// An argument placeholder, for use with boost::bind(), that corresponds to
-/// the error argument of a handler for any of the asynchronous functions.
+/// An argument placeholder, for use with std::bind() or boost::bind(), that
+/// corresponds to the error argument of a handler for any of the asynchronous
+/// functions.
unspecified error;
-/// An argument placeholder, for use with boost::bind(), that corresponds to
-/// the bytes_transferred argument of a handler for asynchronous functions such
-/// as asio::basic_stream_socket::async_write_some or
+/// An argument placeholder, for use with std::bind() or boost::bind(), that
+/// corresponds to the bytes_transferred argument of a handler for asynchronous
+/// functions such as asio::basic_stream_socket::async_write_some or
/// asio::async_write.
unspecified bytes_transferred;
-/// An argument placeholder, for use with boost::bind(), that corresponds to
-/// the iterator argument of a handler for asynchronous functions such as
-/// asio::async_connect.
+/// An argument placeholder, for use with std::bind() or boost::bind(), that
+/// corresponds to the iterator argument of a handler for asynchronous functions
+/// such as asio::async_connect.
unspecified iterator;
-/// An argument placeholder, for use with boost::bind(), that corresponds to
-/// the results argument of a handler for asynchronous functions such as
-/// asio::basic_resolver::async_resolve.
+/// An argument placeholder, for use with std::bind() or boost::bind(), that
+/// corresponds to the results argument of a handler for asynchronous functions
+/// such as asio::basic_resolver::async_resolve.
unspecified results;
-/// An argument placeholder, for use with boost::bind(), that corresponds to
-/// the results argument of a handler for asynchronous functions such as
-/// asio::async_connect.
+/// An argument placeholder, for use with std::bind() or boost::bind(), that
+/// corresponds to the results argument of a handler for asynchronous functions
+/// such as asio::async_connect.
unspecified endpoint;
-/// An argument placeholder, for use with boost::bind(), that corresponds to
-/// the signal_number argument of a handler for asynchronous functions such as
-/// asio::signal_set::async_wait.
+/// An argument placeholder, for use with std::bind() or boost::bind(), that
+/// corresponds to the signal_number argument of a handler for asynchronous
+/// functions such as asio::signal_set::async_wait.
unspecified signal_number;
-#elif defined(ASIO_HAS_BOOST_BIND)
-# if defined(__BORLANDC__) || defined(__GNUC__)
-
-inline boost::arg<1> error()
-{
- return boost::arg<1>();
-}
-
-inline boost::arg<2> bytes_transferred()
-{
- return boost::arg<2>();
-}
-
-inline boost::arg<2> iterator()
-{
- return boost::arg<2>();
-}
-
-inline boost::arg<2> results()
-{
- return boost::arg<2>();
-}
-
-inline boost::arg<2> endpoint()
-{
- return boost::arg<2>();
-}
-
-inline boost::arg<2> signal_number()
-{
- return boost::arg<2>();
-}
-
-# else
-
-namespace detail
-{
- template <int Number>
- struct placeholder
- {
- static boost::arg<Number>& get()
- {
- static boost::arg<Number> result;
- return result;
- }
- };
-}
-
-# if defined(ASIO_MSVC) && (ASIO_MSVC < 1400)
-
-static boost::arg<1>& error
- = asio::placeholders::detail::placeholder<1>::get();
-static boost::arg<2>& bytes_transferred
- = asio::placeholders::detail::placeholder<2>::get();
-static boost::arg<2>& iterator
- = asio::placeholders::detail::placeholder<2>::get();
-static boost::arg<2>& results
- = asio::placeholders::detail::placeholder<2>::get();
-static boost::arg<2>& endpoint
- = asio::placeholders::detail::placeholder<2>::get();
-static boost::arg<2>& signal_number
- = asio::placeholders::detail::placeholder<2>::get();
-
-# else
-
-namespace
-{
- boost::arg<1>& error
- = asio::placeholders::detail::placeholder<1>::get();
- boost::arg<2>& bytes_transferred
- = asio::placeholders::detail::placeholder<2>::get();
- boost::arg<2>& iterator
- = asio::placeholders::detail::placeholder<2>::get();
- boost::arg<2>& results
- = asio::placeholders::detail::placeholder<2>::get();
- boost::arg<2>& endpoint
- = asio::placeholders::detail::placeholder<2>::get();
- boost::arg<2>& signal_number
- = asio::placeholders::detail::placeholder<2>::get();
-} // namespace
-
-# endif
-# endif
+#else
+
+static constexpr auto& error = std::placeholders::_1;
+static constexpr auto& bytes_transferred = std::placeholders::_2;
+static constexpr auto& iterator = std::placeholders::_2;
+static constexpr auto& results = std::placeholders::_2;
+static constexpr auto& endpoint = std::placeholders::_2;
+static constexpr auto& signal_number = std::placeholders::_2;
+
#endif
} // namespace placeholders
diff --git a/3rdparty/asio/include/asio/posix/basic_descriptor.hpp b/3rdparty/asio/include/asio/posix/basic_descriptor.hpp
index e7152798a4e..fa47d6a0949 100644
--- a/3rdparty/asio/include/asio/posix/basic_descriptor.hpp
+++ b/3rdparty/asio/include/asio/posix/basic_descriptor.hpp
@@ -2,7 +2,7 @@
// posix/basic_descriptor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,20 +20,22 @@
#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \
|| defined(GENERATING_DOCUMENTATION)
+#include <utility>
#include "asio/any_io_executor.hpp"
#include "asio/async_result.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/io_object_impl.hpp"
#include "asio/detail/non_const_lvalue.hpp"
-#include "asio/detail/reactive_descriptor_service.hpp"
#include "asio/detail/throw_error.hpp"
#include "asio/error.hpp"
#include "asio/execution_context.hpp"
#include "asio/posix/descriptor_base.hpp"
-#if defined(ASIO_HAS_MOVE)
-# include <utility>
-#endif // defined(ASIO_HAS_MOVE)
+#if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/io_uring_descriptor_service.hpp"
+#else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+# include "asio/detail/reactive_descriptor_service.hpp"
+#endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
#include "asio/detail/push_options.hpp"
@@ -53,6 +55,9 @@ template <typename Executor = any_io_executor>
class basic_descriptor
: public descriptor_base
{
+private:
+ class initiate_async_wait;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -68,10 +73,13 @@ public:
/// The native representation of a descriptor.
#if defined(GENERATING_DOCUMENTATION)
typedef implementation_defined native_handle_type;
-#else
+#elif defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ typedef detail::io_uring_descriptor_service::native_handle_type
+ native_handle_type;
+#else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
typedef detail::reactive_descriptor_service::native_handle_type
native_handle_type;
-#endif
+#endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
/// A descriptor is always the lowest layer.
typedef basic_descriptor lowest_layer_type;
@@ -99,10 +107,10 @@ public:
*/
template <typename ExecutionContext>
explicit basic_descriptor(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
}
@@ -146,9 +154,9 @@ public:
template <typename ExecutionContext>
basic_descriptor(ExecutionContext& context,
const native_handle_type& native_descriptor,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -157,7 +165,6 @@ public:
asio::detail::throw_error(ec, "assign");
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a descriptor from another.
/**
* This constructor moves a descriptor from one object to another.
@@ -169,7 +176,7 @@ public:
* constructed using the @c basic_descriptor(const executor_type&)
* constructor.
*/
- basic_descriptor(basic_descriptor&& other) ASIO_NOEXCEPT
+ basic_descriptor(basic_descriptor&& other) noexcept
: impl_(std::move(other.impl_))
{
}
@@ -190,10 +197,57 @@ public:
impl_ = std::move(other.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+
+ // All descriptors have access to each other's implementations.
+ template <typename Executor1>
+ friend class basic_descriptor;
+
+ /// Move-construct a basic_descriptor from a descriptor of another executor
+ /// type.
+ /**
+ * This constructor moves a descriptor from one object to another.
+ *
+ * @param other The other basic_descriptor object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_descriptor(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ basic_descriptor(basic_descriptor<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign a basic_descriptor from a descriptor of another executor type.
+ /**
+ * This assignment operator moves a descriptor from one object to another.
+ *
+ * @param other The other basic_descriptor object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_descriptor(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_descriptor&
+ > operator=(basic_descriptor<Executor1> && other)
+ {
+ basic_descriptor tmp(std::move(other));
+ impl_ = std::move(tmp.impl_);
+ return *this;
+ }
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return impl_.get_executor();
}
@@ -589,21 +643,28 @@ public:
/// write, or to have pending error conditions.
/**
* This function is used to perform an asynchronous wait for a descriptor to
- * enter a ready to read, write or error condition state.
+ * enter a ready to read, write or error condition state. It is an initiating
+ * function for an @ref asynchronous_operation, and always returns
+ * immediately.
*
* @param w Specifies the desired descriptor state.
*
- * @param handler The handler to be called when the wait operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the wait completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error // Result of operation
+ * const asio::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
+ *
* @par Example
* @code
* void wait_handler(const asio::error_code& error)
@@ -635,15 +696,15 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler,
- void (asio::error_code))
- async_wait(wait_type w,
- ASIO_MOVE_ARG(WaitHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<WaitHandler, void (asio::error_code)>(
- initiate_async_wait(this), handler, w);
+ WaitToken = default_completion_token_t<executor_type>>
+ auto async_wait(wait_type w,
+ WaitToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WaitToken, void (asio::error_code)>(
+ declval<initiate_async_wait>(), token, w))
+ {
+ return async_initiate<WaitToken, void (asio::error_code)>(
+ initiate_async_wait(this), token, w);
}
protected:
@@ -657,12 +718,16 @@ protected:
{
}
+#if defined(ASIO_HAS_IO_URING_AS_DEFAULT)
+ detail::io_object_impl<detail::io_uring_descriptor_service, Executor> impl_;
+#else // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
detail::io_object_impl<detail::reactive_descriptor_service, Executor> impl_;
+#endif // defined(ASIO_HAS_IO_URING_AS_DEFAULT)
private:
// Disallow copying and assignment.
- basic_descriptor(const basic_descriptor&) ASIO_DELETED;
- basic_descriptor& operator=(const basic_descriptor&) ASIO_DELETED;
+ basic_descriptor(const basic_descriptor&) = delete;
+ basic_descriptor& operator=(const basic_descriptor&) = delete;
class initiate_async_wait
{
@@ -674,13 +739,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WaitHandler>
- void operator()(ASIO_MOVE_ARG(WaitHandler) handler, wait_type w) const
+ void operator()(WaitHandler&& handler, wait_type w) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WaitHandler.
diff --git a/3rdparty/asio/include/asio/posix/basic_stream_descriptor.hpp b/3rdparty/asio/include/asio/posix/basic_stream_descriptor.hpp
index 7bf4b361020..9868dee1259 100644
--- a/3rdparty/asio/include/asio/posix/basic_stream_descriptor.hpp
+++ b/3rdparty/asio/include/asio/posix/basic_stream_descriptor.hpp
@@ -2,7 +2,7 @@
// posix/basic_stream_descriptor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -48,6 +48,10 @@ template <typename Executor = any_io_executor>
class basic_stream_descriptor
: public basic_descriptor<Executor>
{
+private:
+ class initiate_async_write_some;
+ class initiate_async_read_some;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -91,10 +95,10 @@ public:
*/
template <typename ExecutionContext>
explicit basic_stream_descriptor(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: basic_descriptor<Executor>(context)
{
}
@@ -134,14 +138,13 @@ public:
template <typename ExecutionContext>
basic_stream_descriptor(ExecutionContext& context,
const native_handle_type& native_descriptor,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_descriptor<Executor>(context, native_descriptor)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a stream descriptor from another.
/**
* This constructor moves a stream descriptor from one object to another.
@@ -153,7 +156,7 @@ public:
* constructed using the @c basic_stream_descriptor(const executor_type&)
* constructor.
*/
- basic_stream_descriptor(basic_stream_descriptor&& other) ASIO_NOEXCEPT
+ basic_stream_descriptor(basic_stream_descriptor&& other) noexcept
: basic_descriptor<Executor>(std::move(other))
{
}
@@ -175,7 +178,50 @@ public:
basic_descriptor<Executor>::operator=(std::move(other));
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+
+ /// Move-construct a basic_stream_descriptor from a descriptor of another
+ /// executor type.
+ /**
+ * This constructor moves a descriptor from one object to another.
+ *
+ * @param other The other basic_stream_descriptor object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_descriptor(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ basic_stream_descriptor(basic_stream_descriptor<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_descriptor<Executor>(std::move(other))
+ {
+ }
+
+ /// Move-assign a basic_stream_descriptor from a descriptor of another
+ /// executor type.
+ /**
+ * This assignment operator moves a descriptor from one object to another.
+ *
+ * @param other The other basic_stream_descriptor object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_descriptor(const executor_type&)
+ * constructor.
+ */
+ template <typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_stream_descriptor&
+ > operator=(basic_stream_descriptor<Executor1> && other)
+ {
+ basic_descriptor<Executor>::operator=(std::move(other));
+ return *this;
+ }
/// Write some data to the descriptor.
/**
@@ -241,25 +287,31 @@ public:
/// Start an asynchronous write.
/**
* This function is used to asynchronously write data to the stream
- * descriptor. The function call always returns immediately.
+ * descriptor. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers One or more data buffers to be written to the descriptor.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes written.
+ * std::size_t bytes_transferred // Number of bytes written.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The write operation may not transmit all of the data to the peer.
* Consider using the @ref async_write function if you need to ensure that all
* data is written before the asynchronous operation completes.
@@ -285,17 +337,17 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_write_some(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ initiate_async_write_some(this), token, buffers))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_write_some(this), handler, buffers);
+ initiate_async_write_some(this), token, buffers);
}
/// Read some data from the descriptor.
@@ -364,25 +416,31 @@ public:
/// Start an asynchronous read.
/**
* This function is used to asynchronously read data from the stream
- * descriptor. The function call always returns immediately.
+ * descriptor. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers One or more buffers into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes read.
+ * std::size_t bytes_transferred // Number of bytes read.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The read operation may not read all of the requested number of bytes.
* Consider using the @ref async_read function if you need to ensure that the
* requested amount of data is read before the asynchronous operation
@@ -409,17 +467,17 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_read_some(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_read_some>(), token, buffers))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_read_some(this), handler, buffers);
+ initiate_async_read_some(this), token, buffers);
}
private:
@@ -433,13 +491,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
@@ -466,13 +524,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
diff --git a/3rdparty/asio/include/asio/posix/descriptor.hpp b/3rdparty/asio/include/asio/posix/descriptor.hpp
index 891daa6be68..57b5b2522fd 100644
--- a/3rdparty/asio/include/asio/posix/descriptor.hpp
+++ b/3rdparty/asio/include/asio/posix/descriptor.hpp
@@ -2,7 +2,7 @@
// posix/descriptor.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/posix/descriptor_base.hpp b/3rdparty/asio/include/asio/posix/descriptor_base.hpp
index 0f1541abc1f..7bc3bc1e8f6 100644
--- a/3rdparty/asio/include/asio/posix/descriptor_base.hpp
+++ b/3rdparty/asio/include/asio/posix/descriptor_base.hpp
@@ -2,7 +2,7 @@
// posix/descriptor_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/posix/stream_descriptor.hpp b/3rdparty/asio/include/asio/posix/stream_descriptor.hpp
index b07fb035def..4855f10777e 100644
--- a/3rdparty/asio/include/asio/posix/stream_descriptor.hpp
+++ b/3rdparty/asio/include/asio/posix/stream_descriptor.hpp
@@ -2,7 +2,7 @@
// posix/stream_descriptor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/post.hpp b/3rdparty/asio/include/asio/post.hpp
index f7e93489349..6b534dfae4a 100644
--- a/3rdparty/asio/include/asio/post.hpp
+++ b/3rdparty/asio/include/asio/post.hpp
@@ -2,7 +2,7 @@
// post.hpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,10 +17,13 @@
#include "asio/detail/config.hpp"
#include "asio/async_result.hpp"
+#include "asio/detail/initiate_post.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/execution_context.hpp"
+#include "asio/execution/blocking.hpp"
#include "asio/execution/executor.hpp"
#include "asio/is_executor.hpp"
+#include "asio/require.hpp"
#include "asio/detail/push_options.hpp"
@@ -35,27 +38,53 @@ namespace asio {
* The use of @c post(), rather than @ref defer(), indicates the caller's
* preference that the function object be eagerly queued for execution.
*
- * This function has the following effects:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler. The function signature of the completion handler must be:
+ * @code void handler(); @endcode
*
- * @li Constructs a function object handler of type @c Handler, initialized
- * with <tt>handler(forward<CompletionToken>(token))</tt>.
+ * @returns This function returns <tt>async_initiate<NullaryToken,
+ * void()>(Init{}, token)</tt>, where @c Init is a function object type defined
+ * as:
*
- * @li Constructs an object @c result of type <tt>async_result<Handler></tt>,
- * initializing the object as <tt>result(handler)</tt>.
+ * @code class Init
+ * {
+ * public:
+ * template <typename CompletionHandler>
+ * void operator()(CompletionHandler&& completion_handler) const;
+ * }; @endcode
*
- * @li Obtains the handler's associated executor object @c ex by performing
- * <tt>get_associated_executor(handler)</tt>.
+ * The function call operator of @c Init:
*
- * @li Obtains the handler's associated allocator object @c alloc by performing
- * <tt>get_associated_allocator(handler)</tt>.
- *
- * @li Performs <tt>ex.post(std::move(handler), alloc)</tt>.
+ * @li Obtains the handler's associated executor object @c ex of type @c Ex by
+ * performing @code auto ex = get_associated_executor(handler); @endcode
*
- * @li Returns <tt>result.get()</tt>.
+ * @li Obtains the handler's associated allocator object @c alloc by performing
+ * @code auto alloc = get_associated_allocator(handler); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is true, performs
+ * @code prefer(
+ * require(ex, execution::blocking.never),
+ * execution::relationship.fork,
+ * execution::allocator(alloc)
+ * ).execute(std::forward<CompletionHandler>(completion_handler)); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is false, performs
+ * @code ex.post(
+ * std::forward<CompletionHandler>(completion_handler),
+ * alloc); @endcode
+ *
+ * @par Completion Signature
+ * @code void() @endcode
*/
-template <ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
- ASIO_MOVE_ARG(CompletionToken) token);
+template <ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken>
+inline auto post(NullaryToken&& token)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_post>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_post(), token);
+}
/// Submits a completion token or function object for execution.
/**
@@ -66,61 +95,119 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
* The use of @c post(), rather than @ref defer(), indicates the caller's
* preference that the function object be eagerly queued for execution.
*
- * This function has the following effects:
+ * @param ex The target executor.
*
- * @li Constructs a function object handler of type @c Handler, initialized
- * with <tt>handler(forward<CompletionToken>(token))</tt>.
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler. The function signature of the completion handler must be:
+ * @code void handler(); @endcode
*
- * @li Constructs an object @c result of type <tt>async_result<Handler></tt>,
- * initializing the object as <tt>result(handler)</tt>.
+ * @returns This function returns <tt>async_initiate<NullaryToken,
+ * void()>(Init{ex}, token)</tt>, where @c Init is a function object type
+ * defined as:
*
- * @li Obtains the handler's associated executor object @c ex1 by performing
- * <tt>get_associated_executor(handler)</tt>.
- *
- * @li Creates a work object @c w by performing <tt>make_work(ex1)</tt>.
- *
- * @li Obtains the handler's associated allocator object @c alloc by performing
- * <tt>get_associated_allocator(handler)</tt>.
+ * @code class Init
+ * {
+ * public:
+ * using executor_type = Executor;
+ * explicit Init(const Executor& ex) : ex_(ex) {}
+ * executor_type get_executor() const noexcept { return ex_; }
+ * template <typename CompletionHandler>
+ * void operator()(CompletionHandler&& completion_handler) const;
+ * private:
+ * Executor ex_; // exposition only
+ * }; @endcode
*
- * @li Constructs a function object @c f with a function call operator that
- * performs <tt>ex1.dispatch(std::move(handler), alloc)</tt> followed by
- * <tt>w.reset()</tt>.
+ * The function call operator of @c Init:
*
- * @li Performs <tt>Executor(ex).post(std::move(f), alloc)</tt>.
+ * @li Obtains the handler's associated executor object @c ex1 of type @c Ex1 by
+ * performing @code auto ex1 = get_associated_executor(handler, ex); @endcode
*
- * @li Returns <tt>result.get()</tt>.
+ * @li Obtains the handler's associated allocator object @c alloc by performing
+ * @code auto alloc = get_associated_allocator(handler); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex1>::value</tt> is true, constructs a
+ * function object @c f with a member @c executor_ that is initialised with
+ * <tt>prefer(ex1, execution::outstanding_work.tracked)</tt>, a member @c
+ * handler_ that is a decay-copy of @c completion_handler, and a function call
+ * operator that performs:
+ * @code auto a = get_associated_allocator(handler_);
+ * prefer(executor_, execution::allocator(a)).execute(std::move(handler_));
+ * @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex1>::value</tt> is false, constructs a
+ * function object @c f with a member @c work_ that is initialised with
+ * <tt>make_work_guard(ex1)</tt>, a member @c handler_ that is a decay-copy of
+ * @c completion_handler, and a function call operator that performs:
+ * @code auto a = get_associated_allocator(handler_);
+ * work_.get_executor().dispatch(std::move(handler_), a);
+ * work_.reset(); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is true, performs
+ * @code prefer(
+ * require(ex, execution::blocking.never),
+ * execution::relationship.fork,
+ * execution::allocator(alloc)
+ * ).execute(std::move(f)); @endcode
+ *
+ * @li If <tt>execution::is_executor<Ex>::value</tt> is false, performs
+ * @code ex.post(std::move(f), alloc); @endcode
+ *
+ * @par Completion Signature
+ * @code void() @endcode
*/
template <typename Executor,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
- const Executor& ex,
- ASIO_MOVE_ARG(CompletionToken) token
- ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
- typename constraint<
- execution::is_executor<Executor>::value || is_executor<Executor>::value
- >::type = 0);
+ ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken
+ = default_completion_token_t<Executor>>
+inline auto post(const Executor& ex,
+ NullaryToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<
+ (execution::is_executor<Executor>::value
+ && can_require<Executor, execution::blocking_t::never_t>::value)
+ || is_executor<Executor>::value
+ > = 0)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_post_with_executor<Executor>>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_post_with_executor<Executor>(ex), token);
+}
/// Submits a completion token or function object for execution.
/**
- * @returns <tt>post(ctx.get_executor(), forward<CompletionToken>(token))</tt>.
+ * @param ctx An execution context, from which the target executor is obtained.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler. The function signature of the completion handler must be:
+ * @code void handler(); @endcode
+ *
+ * @returns <tt>post(ctx.get_executor(), forward<NullaryToken>(token))</tt>.
+ *
+ * @par Completion Signature
+ * @code void() @endcode
*/
template <typename ExecutionContext,
- ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename ExecutionContext::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
- ExecutionContext& ctx,
- ASIO_MOVE_ARG(CompletionToken) token
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename ExecutionContext::executor_type),
- typename constraint<is_convertible<
- ExecutionContext&, execution_context&>::value>::type = 0);
+ ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken
+ = default_completion_token_t<typename ExecutionContext::executor_type>>
+inline auto post(ExecutionContext& ctx,
+ NullaryToken&& token = default_completion_token_t<
+ typename ExecutionContext::executor_type>(),
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_post_with_executor<
+ typename ExecutionContext::executor_type>>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_post_with_executor<
+ typename ExecutionContext::executor_type>(
+ ctx.get_executor()), token);
+}
} // namespace asio
#include "asio/detail/pop_options.hpp"
-#include "asio/impl/post.hpp"
-
#endif // ASIO_POST_HPP
diff --git a/3rdparty/asio/include/asio/prefer.hpp b/3rdparty/asio/include/asio/prefer.hpp
index 504392cd5d1..3b13d4123bf 100644
--- a/3rdparty/asio/include/asio/prefer.hpp
+++ b/3rdparty/asio/include/asio/prefer.hpp
@@ -2,7 +2,7 @@
// prefer.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -118,10 +118,10 @@ struct prefer_result
namespace asio_prefer_fn {
-using asio::conditional;
-using asio::decay;
+using asio::conditional_t;
+using asio::decay_t;
using asio::declval;
-using asio::enable_if;
+using asio::enable_if_t;
using asio::is_applicable_property;
using asio::traits::prefer_free;
using asio::traits::prefer_member;
@@ -149,195 +149,187 @@ template <typename Impl, typename T, typename Properties,
typename = void, typename = void, typename = void>
struct call_traits
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr overload_type overload = ill_formed;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_preferable
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_preferable
+ >,
+ enable_if_t<
static_require<T, Property>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = identity);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
-#if defined(ASIO_HAS_MOVE)
- typedef ASIO_MOVE_ARG(T) result_type;
-#else // defined(ASIO_HAS_MOVE)
- typedef ASIO_MOVE_ARG(typename decay<T>::type) result_type;
-#endif // defined(ASIO_HAS_MOVE)
+ static constexpr overload_type overload = identity;
+ static constexpr bool is_noexcept = true;
+
+ typedef T&& result_type;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_preferable
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_preferable
+ >,
+ enable_if_t<
!static_require<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
require_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type> :
+ >> :
require_member<typename Impl::template proxy<T>::type, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_require_member);
+ static constexpr overload_type overload = call_require_member;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_preferable
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_preferable
+ >,
+ enable_if_t<
!static_require<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!require_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
require_free<T, Property>::is_valid
- >::type> :
+ >> :
require_free<T, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_require_free);
+ static constexpr overload_type overload = call_require_free;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_preferable
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_preferable
+ >,
+ enable_if_t<
!static_require<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!require_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!require_free<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
prefer_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type> :
+ >> :
prefer_member<typename Impl::template proxy<T>::type, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_prefer_member);
+ static constexpr overload_type overload = call_prefer_member;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_preferable
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_preferable
+ >,
+ enable_if_t<
!static_require<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!require_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!require_free<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!prefer_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
prefer_free<T, Property>::is_valid
- >::type> :
+ >> :
prefer_free<T, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_prefer_free);
+ static constexpr overload_type overload = call_prefer_free;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_preferable
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_preferable
+ >,
+ enable_if_t<
!static_require<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!require_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!require_free<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!prefer_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!prefer_free<T, Property>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = identity);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
-#if defined(ASIO_HAS_MOVE)
- typedef ASIO_MOVE_ARG(T) result_type;
-#else // defined(ASIO_HAS_MOVE)
- typedef ASIO_MOVE_ARG(typename decay<T>::type) result_type;
-#endif // defined(ASIO_HAS_MOVE)
+ static constexpr overload_type overload = identity;
+ static constexpr bool is_noexcept = true;
+
+ typedef T&& result_type;
};
template <typename Impl, typename T, typename P0, typename P1>
struct call_traits<Impl, T, void(P0, P1),
- typename enable_if<
+ enable_if_t<
call_traits<Impl, T, void(P0)>::overload != ill_formed
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
void(P1)
>::overload != ill_formed
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = two_props);
+ static constexpr overload_type overload = two_props;
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
+ static constexpr bool is_noexcept =
(
call_traits<Impl, T, void(P0)>::is_noexcept
&&
@@ -346,51 +338,51 @@ struct call_traits<Impl, T, void(P0, P1),
typename call_traits<Impl, T, void(P0)>::result_type,
void(P1)
>::is_noexcept
- ));
+ );
- typedef typename decay<
+ typedef decay_t<
typename call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
void(P1)
>::result_type
- >::type result_type;
+ > result_type;
};
template <typename Impl, typename T, typename P0,
- typename P1, typename ASIO_ELLIPSIS PN>
-struct call_traits<Impl, T, void(P0, P1, PN ASIO_ELLIPSIS),
- typename enable_if<
+ typename P1, typename... PN>
+struct call_traits<Impl, T, void(P0, P1, PN...),
+ enable_if_t<
call_traits<Impl, T, void(P0)>::overload != ill_formed
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
- void(P1, PN ASIO_ELLIPSIS)
+ void(P1, PN...)
>::overload != ill_formed
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = n_props);
+ static constexpr overload_type overload = n_props;
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
+ static constexpr bool is_noexcept =
(
call_traits<Impl, T, void(P0)>::is_noexcept
&&
call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
- void(P1, PN ASIO_ELLIPSIS)
+ void(P1, PN...)
>::is_noexcept
- ));
+ );
- typedef typename decay<
+ typedef decay_t<
typename call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
- void(P1, PN ASIO_ELLIPSIS)
+ void(P1, PN...)
>::result_type
- >::type result_type;
+ > result_type;
};
struct impl
@@ -403,29 +395,25 @@ struct impl
struct type
{
template <typename P>
- auto require(ASIO_MOVE_ARG(P) p)
+ auto require(P&& p)
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().require(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().require(static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().require(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().require(static_cast<P&&>(p))
);
template <typename P>
- auto prefer(ASIO_MOVE_ARG(P) p)
+ auto prefer(P&& p)
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().prefer(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().prefer(static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().prefer(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().prefer(static_cast<P&&>(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
@@ -436,122 +424,85 @@ struct impl
};
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == identity,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property)) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&&) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return ASIO_MOVE_CAST(T)(t);
+ return static_cast<T&&>(t);
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_require_member,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return ASIO_MOVE_CAST(T)(t).require(
- ASIO_MOVE_CAST(Property)(p));
+ return static_cast<T&&>(t).require(static_cast<Property&&>(p));
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_require_free,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return require(
- ASIO_MOVE_CAST(T)(t),
- ASIO_MOVE_CAST(Property)(p));
+ return require(static_cast<T&&>(t), static_cast<Property&&>(p));
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_prefer_member,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return ASIO_MOVE_CAST(T)(t).prefer(
- ASIO_MOVE_CAST(Property)(p));
+ return static_cast<T&&>(t).prefer(static_cast<Property&&>(p));
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_prefer_free,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return prefer(
- ASIO_MOVE_CAST(T)(t),
- ASIO_MOVE_CAST(Property)(p));
+ return prefer(static_cast<T&&>(t), static_cast<Property&&>(p));
}
template <typename T, typename P0, typename P1>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(P0, P1)>::overload == two_props,
typename call_traits<impl, T, void(P0, P1)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(P0) p0,
- ASIO_MOVE_ARG(P1) p1) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(P0, P1)>::is_noexcept))
+ >
+ operator()(T&& t, P0&& p0, P1&& p1) const
+ noexcept(call_traits<impl, T, void(P0, P1)>::is_noexcept)
{
return (*this)(
- (*this)(
- ASIO_MOVE_CAST(T)(t),
- ASIO_MOVE_CAST(P0)(p0)),
- ASIO_MOVE_CAST(P1)(p1));
+ (*this)(static_cast<T&&>(t), static_cast<P0&&>(p0)),
+ static_cast<P1&&>(p1));
}
template <typename T, typename P0, typename P1,
- typename ASIO_ELLIPSIS PN>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
- call_traits<impl, T,
- void(P0, P1, PN ASIO_ELLIPSIS)>::overload == n_props,
- typename call_traits<impl, T,
- void(P0, P1, PN ASIO_ELLIPSIS)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(P0) p0,
- ASIO_MOVE_ARG(P1) p1,
- ASIO_MOVE_ARG(PN) ASIO_ELLIPSIS pn) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(P0, P1, PN ASIO_ELLIPSIS)>::is_noexcept))
+ typename... PN>
+ ASIO_NODISCARD constexpr enable_if_t<
+ call_traits<impl, T, void(P0, P1, PN...)>::overload == n_props,
+ typename call_traits<impl, T, void(P0, P1, PN...)>::result_type
+ >
+ operator()(T&& t, P0&& p0, P1&& p1, PN&&... pn) const
+ noexcept(call_traits<impl, T, void(P0, P1, PN...)>::is_noexcept)
{
return (*this)(
- (*this)(
- ASIO_MOVE_CAST(T)(t),
- ASIO_MOVE_CAST(P0)(p0)),
- ASIO_MOVE_CAST(P1)(p1),
- ASIO_MOVE_CAST(PN)(pn) ASIO_ELLIPSIS);
+ (*this)(static_cast<T&&>(t), static_cast<P0&&>(p0)),
+ static_cast<P1&&>(p1), static_cast<PN&&>(pn)...);
}
};
@@ -568,15 +519,13 @@ const T static_instance<T>::instance = {};
namespace asio {
namespace {
-static ASIO_CONSTEXPR const asio_prefer_fn::impl&
+static constexpr const asio_prefer_fn::impl&
prefer = asio_prefer_fn::static_instance<>::instance;
} // namespace
typedef asio_prefer_fn::impl prefer_t;
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename T, typename... Properties>
struct can_prefer :
integral_constant<bool,
@@ -586,54 +535,14 @@ struct can_prefer :
{
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename P0 = void,
- typename P1 = void, typename P2 = void>
-struct can_prefer :
- integral_constant<bool,
- asio_prefer_fn::call_traits<
- prefer_t, T, void(P0, P1, P2)>::overload
- != asio_prefer_fn::ill_formed>
-{
-};
-
-template <typename T, typename P0, typename P1>
-struct can_prefer<T, P0, P1> :
- integral_constant<bool,
- asio_prefer_fn::call_traits<
- prefer_t, T, void(P0, P1)>::overload
- != asio_prefer_fn::ill_formed>
-{
-};
-
-template <typename T, typename P0>
-struct can_prefer<T, P0> :
- integral_constant<bool,
- asio_prefer_fn::call_traits<
- prefer_t, T, void(P0)>::overload
- != asio_prefer_fn::ill_formed>
-{
-};
-
-template <typename T>
-struct can_prefer<T> :
- false_type
-{
-};
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-template <typename T, typename ASIO_ELLIPSIS Properties>
+template <typename T, typename... Properties>
constexpr bool can_prefer_v
- = can_prefer<T, Properties ASIO_ELLIPSIS>::value;
+ = can_prefer<T, Properties...>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename T, typename... Properties>
struct is_nothrow_prefer :
integral_constant<bool,
@@ -642,51 +551,13 @@ struct is_nothrow_prefer :
{
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename P0 = void,
- typename P1 = void, typename P2 = void>
-struct is_nothrow_prefer :
- integral_constant<bool,
- asio_prefer_fn::call_traits<
- prefer_t, T, void(P0, P1, P2)>::is_noexcept>
-{
-};
-
-template <typename T, typename P0, typename P1>
-struct is_nothrow_prefer<T, P0, P1> :
- integral_constant<bool,
- asio_prefer_fn::call_traits<
- prefer_t, T, void(P0, P1)>::is_noexcept>
-{
-};
-
-template <typename T, typename P0>
-struct is_nothrow_prefer<T, P0> :
- integral_constant<bool,
- asio_prefer_fn::call_traits<
- prefer_t, T, void(P0)>::is_noexcept>
-{
-};
-
-template <typename T>
-struct is_nothrow_prefer<T> :
- false_type
-{
-};
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-template <typename T, typename ASIO_ELLIPSIS Properties>
-constexpr bool is_nothrow_prefer_v
- = is_nothrow_prefer<T, Properties ASIO_ELLIPSIS>::value;
+template <typename T, typename... Properties>
+constexpr bool is_nothrow_prefer_v = is_nothrow_prefer<T, Properties...>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename T, typename... Properties>
struct prefer_result
{
@@ -694,36 +565,8 @@ struct prefer_result
prefer_t, T, void(Properties...)>::result_type type;
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename P0 = void,
- typename P1 = void, typename P2 = void>
-struct prefer_result
-{
- typedef typename asio_prefer_fn::call_traits<
- prefer_t, T, void(P0, P1, P2)>::result_type type;
-};
-
-template <typename T, typename P0, typename P1>
-struct prefer_result<T, P0, P1>
-{
- typedef typename asio_prefer_fn::call_traits<
- prefer_t, T, void(P0, P1)>::result_type type;
-};
-
-template <typename T, typename P0>
-struct prefer_result<T, P0>
-{
- typedef typename asio_prefer_fn::call_traits<
- prefer_t, T, void(P0)>::result_type type;
-};
-
-template <typename T>
-struct prefer_result<T>
-{
-};
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
+template <typename T, typename... Properties>
+using prefer_result_t = typename prefer_result<T, Properties...>::type;
} // namespace asio
diff --git a/3rdparty/asio/include/asio/prepend.hpp b/3rdparty/asio/include/asio/prepend.hpp
new file mode 100644
index 00000000000..972b47fd300
--- /dev/null
+++ b/3rdparty/asio/include/asio/prepend.hpp
@@ -0,0 +1,66 @@
+//
+// prepend.hpp
+// ~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_PREPEND_HPP
+#define ASIO_PREPEND_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <tuple>
+#include "asio/detail/type_traits.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// Completion token type used to specify that the completion handler
+/// arguments should be passed additional values before the results of the
+/// operation.
+template <typename CompletionToken, typename... Values>
+class prepend_t
+{
+public:
+ /// Constructor.
+ template <typename T, typename... V>
+ constexpr explicit prepend_t(T&& completion_token, V&&... values)
+ : token_(static_cast<T&&>(completion_token)),
+ values_(static_cast<V&&>(values)...)
+ {
+ }
+
+//private:
+ CompletionToken token_;
+ std::tuple<Values...> values_;
+};
+
+/// Completion token type used to specify that the completion handler
+/// arguments should be passed additional values before the results of the
+/// operation.
+template <typename CompletionToken, typename... Values>
+ASIO_NODISCARD inline constexpr
+prepend_t<decay_t<CompletionToken>, decay_t<Values>...>
+prepend(CompletionToken&& completion_token,
+ Values&&... values)
+{
+ return prepend_t<decay_t<CompletionToken>, decay_t<Values>...>(
+ static_cast<CompletionToken&&>(completion_token),
+ static_cast<Values&&>(values)...);
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#include "asio/impl/prepend.hpp"
+
+#endif // ASIO_PREPEND_HPP
diff --git a/3rdparty/asio/include/asio/query.hpp b/3rdparty/asio/include/asio/query.hpp
index 2312b60320d..c27d26a4030 100644
--- a/3rdparty/asio/include/asio/query.hpp
+++ b/3rdparty/asio/include/asio/query.hpp
@@ -2,7 +2,7 @@
// query.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -100,10 +100,10 @@ struct query_result
namespace asio_query_fn {
-using asio::conditional;
-using asio::decay;
+using asio::conditional_t;
+using asio::decay_t;
using asio::declval;
-using asio::enable_if;
+using asio::enable_if_t;
using asio::is_applicable_property;
using asio::traits::query_free;
using asio::traits::query_member;
@@ -123,66 +123,66 @@ template <typename Impl, typename T, typename Properties,
typename = void, typename = void, typename = void, typename = void>
struct call_traits
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr overload_type overload = ill_formed;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
static_query<T, Property>::is_valid
- >::type> :
+ >> :
static_query<T, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = static_value);
+ static constexpr overload_type overload = static_value;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!static_query<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
query_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type> :
+ >> :
query_member<typename Impl::template proxy<T>::type, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
+ static constexpr overload_type overload = call_member;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!static_query<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!query_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
query_free<T, Property>::is_valid
- >::type> :
+ >> :
query_free<T, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
+ static constexpr overload_type overload = call_free;
};
struct impl
@@ -194,16 +194,14 @@ struct impl
struct type
{
template <typename P>
- auto query(ASIO_MOVE_ARG(P) p)
+ auto query(P&& p)
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().query(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -212,48 +210,36 @@ struct impl
};
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == static_value,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T),
- ASIO_MOVE_ARG(Property)) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&&, Property&&) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return static_query<
- typename decay<T>::type,
- typename decay<Property>::type
- >::value();
+ return static_query<decay_t<T>, decay_t<Property>>::value();
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_member,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return ASIO_MOVE_CAST(T)(t).query(ASIO_MOVE_CAST(Property)(p));
+ return static_cast<T&&>(t).query(static_cast<Property&&>(p));
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_free,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return query(ASIO_MOVE_CAST(T)(t), ASIO_MOVE_CAST(Property)(p));
+ return query(static_cast<T&&>(t), static_cast<Property&&>(p));
}
};
@@ -270,7 +256,7 @@ const T static_instance<T>::instance = {};
namespace asio {
namespace {
-static ASIO_CONSTEXPR const asio_query_fn::impl&
+static constexpr const asio_query_fn::impl&
query = asio_query_fn::static_instance<>::instance;
} // namespace
@@ -288,8 +274,7 @@ struct can_query :
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T, typename Property>
-constexpr bool can_query_v
- = can_query<T, Property>::value;
+constexpr bool can_query_v = can_query<T, Property>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
@@ -303,8 +288,7 @@ struct is_nothrow_query :
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T, typename Property>
-constexpr bool is_nothrow_query_v
- = is_nothrow_query<T, Property>::value;
+constexpr bool is_nothrow_query_v = is_nothrow_query<T, Property>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
@@ -315,6 +299,9 @@ struct query_result
query_t, T, void(Property)>::result_type type;
};
+template <typename T, typename Property>
+using query_result_t = typename query_result<T, Property>::type;
+
} // namespace asio
#endif // defined(GENERATING_DOCUMENTATION)
diff --git a/3rdparty/asio/include/asio/random_access_file.hpp b/3rdparty/asio/include/asio/random_access_file.hpp
new file mode 100644
index 00000000000..c638e336394
--- /dev/null
+++ b/3rdparty/asio/include/asio/random_access_file.hpp
@@ -0,0 +1,35 @@
+//
+// random_access_file.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_RANDOM_ACCESS_FILE_HPP
+#define ASIO_RANDOM_ACCESS_FILE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_FILE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include "asio/basic_random_access_file.hpp"
+
+namespace asio {
+
+/// Typedef for the typical usage of a random-access file.
+typedef basic_random_access_file<> random_access_file;
+
+} // namespace asio
+
+#endif // defined(ASIO_HAS_FILE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_RANDOM_ACCESS_FILE_HPP
diff --git a/3rdparty/asio/include/asio/read.hpp b/3rdparty/asio/include/asio/read.hpp
index 3d666adb8d3..0eb966af36f 100644
--- a/3rdparty/asio/include/asio/read.hpp
+++ b/3rdparty/asio/include/asio/read.hpp
@@ -2,7 +2,7 @@
// read.hpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,6 +19,7 @@
#include <cstddef>
#include "asio/async_result.hpp"
#include "asio/buffer.hpp"
+#include "asio/completion_condition.hpp"
#include "asio/error.hpp"
#if !defined(ASIO_NO_EXTENSIONS)
@@ -28,6 +29,15 @@
#include "asio/detail/push_options.hpp"
namespace asio {
+namespace detail {
+
+template <typename> class initiate_async_read;
+#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
+template <typename> class initiate_async_read_dynbuf_v1;
+#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
+template <typename> class initiate_async_read_dynbuf_v2;
+
+} // namespace detail
/**
* @defgroup read asio::read
@@ -75,9 +85,9 @@ namespace asio {
*/
template <typename SyncReadStream, typename MutableBufferSequence>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
- typename constraint<
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type = 0);
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -118,9 +128,9 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
template <typename SyncReadStream, typename MutableBufferSequence>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type = 0);
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -172,9 +182,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
- typename constraint<
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type = 0);
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -219,9 +229,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type = 0);
+ > = 0);
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -254,13 +264,13 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
*/
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ DynamicBuffer_v1&& buffers,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -290,14 +300,14 @@ std::size_t read(SyncReadStream& s,
*/
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -338,14 +348,14 @@ std::size_t read(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v1,
typename CompletionCondition>
std::size_t read(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -387,14 +397,14 @@ std::size_t read(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v1,
typename CompletionCondition>
std::size_t read(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
#if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM)
@@ -572,9 +582,9 @@ std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
*/
template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -605,9 +615,9 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -649,9 +659,9 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -694,9 +704,9 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/*@}*/
/**
@@ -711,9 +721,9 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
/// stream.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions is
- * true:
+ * data from a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The supplied buffers are full. That is, the bytes transferred is equal to
* the sum of the buffer sizes.
@@ -733,25 +743,30 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
* of the buffer sizes indicates the maximum number of bytes to read from the
* stream. Although the buffers object may be copied as necessary, ownership of
* the underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes copied into the
- * // buffers. If an error occurred,
- * // this will be the number of
- * // bytes successfully transferred
- * // prior to the error.
+ * // Number of bytes copied into the buffers. If an error
+ * // occurred, this will be the number of bytes successfully
+ * // transferred prior to the error.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To read into a single data buffer use the @ref buffer function as follows:
* @code
@@ -780,26 +795,27 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
*/
template <typename AsyncReadStream, typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read<AsyncReadStream>>(),
+ token, buffers, transfer_all()));
/// Start an asynchronous operation to read a certain amount of data from a
/// stream.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions is
- * true:
+ * data from a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The supplied buffers are full. That is, the bytes transferred is equal to
* the sum of the buffer sizes.
@@ -813,7 +829,7 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
* of the buffer sizes indicates the maximum number of bytes to read from the
* stream. Although the buffers object may be copied as necessary, ownership of
* the underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the read operation is complete. The signature of the function object
@@ -829,23 +845,28 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
* return value indicates the maximum number of bytes to be read on the next
* call to the stream's async_read_some function.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes copied into the
- * // buffers. If an error occurred,
- * // this will be the number of
- * // bytes successfully transferred
- * // prior to the error.
+ * // Number of bytes copied into the buffers. If an error
+ * // occurred, this will be the number of bytes successfully
+ * // transferred prior to the error.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To read into a single data buffer use the @ref buffer function as follows:
* @code asio::async_read(s,
@@ -870,19 +891,21 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
template <typename AsyncReadStream,
typename MutableBufferSequence, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read<AsyncReadStream>>(),
+ token, buffers,
+ static_cast<CompletionCondition&&>(completion_condition)));
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -890,9 +913,9 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
/// stream.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions is
- * true:
+ * data from a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The specified dynamic buffer sequence is full (that is, it has reached
* maximum size).
@@ -911,25 +934,30 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes copied into the
- * // buffers. If an error occurred,
- * // this will be the number of
- * // bytes successfully transferred
- * // prior to the error.
+ * // Number of bytes copied into the buffers. If an error
+ * // occurred, this will be the number of bytes successfully
+ * // transferred prior to the error.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note This overload is equivalent to calling:
* @code asio::async_read(
* s, buffers,
@@ -949,30 +977,30 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
*/
template <typename AsyncReadStream, typename DynamicBuffer_v1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), transfer_all()));
/// Start an asynchronous operation to read a certain amount of data from a
/// stream.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions is
- * true:
+ * data from a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The specified dynamic buffer sequence is full (that is, it has reached
* maximum size).
@@ -991,7 +1019,7 @@ async_read(AsyncReadStream& s,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the read operation is complete. The signature of the function object
@@ -1007,23 +1035,28 @@ async_read(AsyncReadStream& s,
* return value indicates the maximum number of bytes to be read on the next
* call to the stream's async_read_some function.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes copied into the
- * // buffers. If an error occurred,
- * // this will be the number of
- * // bytes successfully transferred
- * // prior to the error.
+ * // Number of bytes copied into the buffers. If an error
+ * // occurred, this will be the number of bytes successfully
+ * // transferred prior to the error.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -1038,23 +1071,24 @@ async_read(AsyncReadStream& s,
template <typename AsyncReadStream,
typename DynamicBuffer_v1, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition)));
#if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM)
@@ -1063,9 +1097,9 @@ async_read(AsyncReadStream& s,
/// stream.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions is
- * true:
+ * data from a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The supplied buffer is full (that is, it has reached maximum size).
*
@@ -1082,25 +1116,30 @@ async_read(AsyncReadStream& s,
*
* @param b A basic_streambuf object into which the data will be read. Ownership
* of the streambuf is retained by the caller, which must guarantee that it
- * remains valid until the handler is called.
+ * remains valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes copied into the
- * // buffers. If an error occurred,
- * // this will be the number of
- * // bytes successfully transferred
- * // prior to the error.
+ * // Number of bytes copied into the buffers. If an error
+ * // occurred, this will be the number of bytes successfully
+ * // transferred prior to the error.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note This overload is equivalent to calling:
* @code asio::async_read(
* s, b,
@@ -1120,23 +1159,24 @@ async_read(AsyncReadStream& s,
*/
template <typename AsyncReadStream, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type));
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), transfer_all()));
/// Start an asynchronous operation to read a certain amount of data from a
/// stream.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions is
- * true:
+ * data from a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The supplied buffer is full (that is, it has reached maximum size).
*
@@ -1153,7 +1193,7 @@ async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
*
* @param b A basic_streambuf object into which the data will be read. Ownership
* of the streambuf is retained by the caller, which must guarantee that it
- * remains valid until the handler is called.
+ * remains valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the read operation is complete. The signature of the function object
@@ -1169,23 +1209,28 @@ async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
* return value indicates the maximum number of bytes to be read on the next
* call to the stream's async_read_some function.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes copied into the
- * // buffers. If an error occurred,
- * // this will be the number of
- * // bytes successfully transferred
- * // prior to the error.
+ * // Number of bytes copied into the buffers. If an error
+ * // occurred, this will be the number of bytes successfully
+ * // transferred prior to the error.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -1200,16 +1245,18 @@ async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
template <typename AsyncReadStream,
typename Allocator, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type));
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<CompletionCondition&&>(completion_condition)));
#endif // !defined(ASIO_NO_IOSTREAM)
#endif // !defined(ASIO_NO_EXTENSIONS)
@@ -1219,9 +1266,9 @@ async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
/// stream.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions is
- * true:
+ * data from a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The specified dynamic buffer sequence is full (that is, it has reached
* maximum size).
@@ -1240,25 +1287,30 @@ async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes copied into the
- * // buffers. If an error occurred,
- * // this will be the number of
- * // bytes successfully transferred
- * // prior to the error.
+ * // Number of bytes copied into the buffers. If an error
+ * // occurred, this will be the number of bytes successfully
+ * // transferred prior to the error.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note This overload is equivalent to calling:
* @code asio::async_read(
* s, buffers,
@@ -1278,26 +1330,27 @@ async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
*/
template <typename AsyncReadStream, typename DynamicBuffer_v2,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), transfer_all()));
/// Start an asynchronous operation to read a certain amount of data from a
/// stream.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions is
- * true:
+ * data from a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The specified dynamic buffer sequence is full (that is, it has reached
* maximum size).
@@ -1316,7 +1369,7 @@ async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the read operation is complete. The signature of the function object
@@ -1332,23 +1385,28 @@ async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* return value indicates the maximum number of bytes to be read on the next
* call to the stream's async_read_some function.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes copied into the
- * // buffers. If an error occurred,
- * // this will be the number of
- * // bytes successfully transferred
- * // prior to the error.
+ * // Number of bytes copied into the buffers. If an error
+ * // occurred, this will be the number of bytes successfully
+ * // transferred prior to the error.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -1363,19 +1421,21 @@ async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename AsyncReadStream,
typename DynamicBuffer_v2, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_dynbuf_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition)));
/*@}*/
diff --git a/3rdparty/asio/include/asio/read_at.hpp b/3rdparty/asio/include/asio/read_at.hpp
index 2b94845c581..09a0b22e12e 100644
--- a/3rdparty/asio/include/asio/read_at.hpp
+++ b/3rdparty/asio/include/asio/read_at.hpp
@@ -2,7 +2,7 @@
// read_at.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,6 +18,7 @@
#include "asio/detail/config.hpp"
#include <cstddef>
#include "asio/async_result.hpp"
+#include "asio/completion_condition.hpp"
#include "asio/detail/cstdint.hpp"
#include "asio/error.hpp"
@@ -28,6 +29,14 @@
#include "asio/detail/push_options.hpp"
namespace asio {
+namespace detail {
+
+template <typename> class initiate_async_read_at;
+#if !defined(ASIO_NO_IOSTREAM)
+template <typename> class initiate_async_read_at_streambuf;
+#endif // !defined(ASIO_NO_IOSTREAM)
+
+} // namespace detail
/**
* @defgroup read_at asio::read_at
@@ -403,9 +412,10 @@ std::size_t read_at(SyncRandomAccessReadDevice& d,
/// specified offset.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a random access device at the specified offset. The function call
- * always returns immediately. The asynchronous operation will continue until
- * one of the following conditions is true:
+ * data from a random access device at the specified offset. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately. The asynchronous operation will continue until one of the
+ * following conditions is true:
*
* @li The supplied buffers are full. That is, the bytes transferred is equal to
* the sum of the buffer sizes.
@@ -424,11 +434,13 @@ std::size_t read_at(SyncRandomAccessReadDevice& d,
* of the buffer sizes indicates the maximum number of bytes to read from the
* device. Although the buffers object may be copied as necessary, ownership of
* the underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -439,10 +451,13 @@ std::size_t read_at(SyncRandomAccessReadDevice& d,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To read into a single data buffer use the @ref buffer function as follows:
* @code
@@ -471,24 +486,26 @@ std::size_t read_at(SyncRandomAccessReadDevice& d,
*/
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncRandomAccessReadDevice::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
- const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncRandomAccessReadDevice::executor_type));
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncRandomAccessReadDevice::executor_type>>
+auto async_read_at(AsyncRandomAccessReadDevice& d,
+ uint64_t offset, const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncRandomAccessReadDevice::executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_at<AsyncRandomAccessReadDevice>>(),
+ token, offset, buffers, transfer_all()));
/// Start an asynchronous operation to read a certain amount of data at the
/// specified offset.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a random access device at the specified offset. The function call
- * always returns immediately. The asynchronous operation will continue until
- * one of the following conditions is true:
+ * data from a random access device at the specified offset. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately. The asynchronous operation will continue until one of the
+ * following conditions is true:
*
* @li The supplied buffers are full. That is, the bytes transferred is equal to
* the sum of the buffer sizes.
@@ -504,7 +521,7 @@ async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
* of the buffer sizes indicates the maximum number of bytes to read from the
* device. Although the buffers object may be copied as necessary, ownership of
* the underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the read operation is complete. The signature of the function object
@@ -520,9 +537,11 @@ async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
* return value indicates the maximum number of bytes to be read on the next
* call to the device's async_read_some_at function.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -533,10 +552,13 @@ async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To read into a single data buffer use the @ref buffer function as follows:
* @code asio::async_read_at(d, 42,
@@ -561,17 +583,19 @@ async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
template <typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncRandomAccessReadDevice::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncRandomAccessReadDevice::executor_type>>
+auto async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncRandomAccessReadDevice::executor_type));
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncRandomAccessReadDevice::executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_at<AsyncRandomAccessReadDevice>>(),
+ token, offset, buffers,
+ static_cast<CompletionCondition&&>(completion_condition)));
#if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM)
@@ -580,9 +604,10 @@ async_read_at(AsyncRandomAccessReadDevice& d,
/// specified offset.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a random access device at the specified offset. The function call
- * always returns immediately. The asynchronous operation will continue until
- * one of the following conditions is true:
+ * data from a random access device at the specified offset. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately. The asynchronous operation will continue until one of the
+ * following conditions is true:
*
* @li An error occurred.
*
@@ -596,11 +621,13 @@ async_read_at(AsyncRandomAccessReadDevice& d,
*
* @param b A basic_streambuf object into which the data will be read. Ownership
* of the streambuf is retained by the caller, which must guarantee that it
- * remains valid until the handler is called.
+ * remains valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -611,10 +638,13 @@ async_read_at(AsyncRandomAccessReadDevice& d,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note This overload is equivalent to calling:
* @code asio::async_read_at(
* d, 42, b,
@@ -634,24 +664,27 @@ async_read_at(AsyncRandomAccessReadDevice& d,
*/
template <typename AsyncRandomAccessReadDevice, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncRandomAccessReadDevice::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncRandomAccessReadDevice::executor_type>>
+auto async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, basic_streambuf<Allocator>& b,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncRandomAccessReadDevice::executor_type));
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncRandomAccessReadDevice::executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_at_streambuf<
+ AsyncRandomAccessReadDevice>>(),
+ token, offset, &b, transfer_all()));
/// Start an asynchronous operation to read a certain amount of data at the
/// specified offset.
/**
* This function is used to asynchronously read a certain number of bytes of
- * data from a random access device at the specified offset. The function call
- * always returns immediately. The asynchronous operation will continue until
- * one of the following conditions is true:
+ * data from a random access device at the specified offset. It is an
+ * initiating function for an @ref asynchronous_operation, and always returns
+ * immediately. The asynchronous operation will continue until one of the
+ * following conditions is true:
*
* @li The completion_condition function object returns 0.
*
@@ -665,7 +698,7 @@ async_read_at(AsyncRandomAccessReadDevice& d,
*
* @param b A basic_streambuf object into which the data will be read. Ownership
* of the streambuf is retained by the caller, which must guarantee that it
- * remains valid until the handler is called.
+ * remains valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the read operation is complete. The signature of the function object
@@ -681,9 +714,11 @@ async_read_at(AsyncRandomAccessReadDevice& d,
* return value indicates the maximum number of bytes to be read on the next
* call to the device's async_read_some_at function.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -694,10 +729,13 @@ async_read_at(AsyncRandomAccessReadDevice& d,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -712,17 +750,19 @@ async_read_at(AsyncRandomAccessReadDevice& d,
template <typename AsyncRandomAccessReadDevice,
typename Allocator, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncRandomAccessReadDevice::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_at(AsyncRandomAccessReadDevice& d,
- uint64_t offset, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncRandomAccessReadDevice::executor_type));
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncRandomAccessReadDevice::executor_type>>
+auto async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
+ basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncRandomAccessReadDevice::executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_at_streambuf<
+ AsyncRandomAccessReadDevice>>(),
+ token, offset, &b,
+ static_cast<CompletionCondition&&>(completion_condition)));
#endif // !defined(ASIO_NO_IOSTREAM)
#endif // !defined(ASIO_NO_EXTENSIONS)
diff --git a/3rdparty/asio/include/asio/read_until.hpp b/3rdparty/asio/include/asio/read_until.hpp
index bb1767ed6a6..97abbdbf0ea 100644
--- a/3rdparty/asio/include/asio/read_until.hpp
+++ b/3rdparty/asio/include/asio/read_until.hpp
@@ -2,7 +2,7 @@
// read_until.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -32,19 +32,34 @@
#include "asio/detail/push_options.hpp"
namespace asio {
+namespace detail {
-namespace detail
+char (&has_result_type_helper(...))[2];
+
+template <typename T>
+char has_result_type_helper(T*, typename T::result_type* = 0);
+
+template <typename T>
+struct has_result_type
{
- char (&has_result_type_helper(...))[2];
+ enum { value = (sizeof((has_result_type_helper)((T*)(0))) == 1) };
+};
- template <typename T>
- char has_result_type_helper(T*, typename T::result_type* = 0);
+#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
+template <typename> class initiate_async_read_until_delim_v1;
+template <typename> class initiate_async_read_until_delim_string_v1;
+#if defined(ASIO_HAS_BOOST_REGEX)
+template <typename> class initiate_async_read_until_expr_v1;
+#endif // defined(ASIO_HAS_BOOST_REGEX)
+template <typename> class initiate_async_read_until_match_v1;
+#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
+template <typename> class initiate_async_read_until_delim_v2;
+template <typename> class initiate_async_read_until_delim_string_v2;
+#if defined(ASIO_HAS_BOOST_REGEX)
+template <typename> class initiate_async_read_until_expr_v2;
+#endif // defined(ASIO_HAS_BOOST_REGEX)
+template <typename> class initiate_async_read_until_match_v2;
- template <typename T>
- struct has_result_type
- {
- enum { value = (sizeof((has_result_type_helper)((T*)(0))) == 1) };
- };
} // namespace detail
/// Type trait used to determine whether a type can be used as a match condition
@@ -58,8 +73,7 @@ struct is_match_condition
#else
enum
{
- value = asio::is_function<
- typename asio::remove_pointer<T>::type>::value
+ value = asio::is_function<remove_pointer_t<T>>::value
|| detail::has_result_type<T>::value
};
#endif
@@ -132,13 +146,13 @@ struct is_match_condition
*/
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, char delim,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ DynamicBuffer_v1&& buffers, char delim,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter.
@@ -176,14 +190,14 @@ std::size_t read_until(SyncReadStream& s,
*/
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
char delim, asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter.
@@ -238,14 +252,14 @@ std::size_t read_until(SyncReadStream& s,
*/
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
ASIO_STRING_VIEW_PARAM delim,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter.
@@ -283,15 +297,15 @@ std::size_t read_until(SyncReadStream& s,
*/
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
ASIO_STRING_VIEW_PARAM delim,
asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
#if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX) \
@@ -351,16 +365,15 @@ std::size_t read_until(SyncReadStream& s,
* This data may be the start of a new line, to be extracted by a subsequent
* @c read_until operation.
*/
-template <typename SyncReadStream, typename DynamicBuffer_v1>
-std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- const boost::regex& expr,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+template <typename SyncReadStream, typename DynamicBuffer_v1, typename Traits>
+std::size_t read_until(SyncReadStream& s, DynamicBuffer_v1&& buffers,
+ const boost::basic_regex<char, Traits>& expr,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Read data into a dynamic buffer sequence until some part of the data it
/// contains matches a regular expression.
@@ -398,16 +411,15 @@ std::size_t read_until(SyncReadStream& s,
* expression. An application will typically leave that data in the dynamic
* buffer sequence for a subsequent read_until operation to examine.
*/
-template <typename SyncReadStream, typename DynamicBuffer_v1>
-std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- const boost::regex& expr, asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+template <typename SyncReadStream, typename DynamicBuffer_v1, typename Traits>
+std::size_t read_until(SyncReadStream& s, DynamicBuffer_v1&& buffers,
+ const boost::basic_regex<char, Traits>& expr, asio::error_code& ec,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
#endif // defined(ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION)
@@ -517,17 +529,17 @@ std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream,
typename DynamicBuffer_v1, typename MatchCondition>
std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
MatchCondition match_condition,
- typename constraint<
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type = 0,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ > = 0,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Read data into a dynamic buffer sequence until a function object indicates a
/// match.
@@ -585,17 +597,17 @@ std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream,
typename DynamicBuffer_v1, typename MatchCondition>
std::size_t read_until(SyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
MatchCondition match_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type = 0,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ > = 0,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
#if !defined(ASIO_NO_IOSTREAM)
@@ -827,9 +839,10 @@ std::size_t read_until(SyncReadStream& s,
* This data may be the start of a new line, to be extracted by a subsequent
* @c read_until operation.
*/
-template <typename SyncReadStream, typename Allocator>
+template <typename SyncReadStream, typename Allocator, typename Traits>
std::size_t read_until(SyncReadStream& s,
- asio::basic_streambuf<Allocator>& b, const boost::regex& expr);
+ asio::basic_streambuf<Allocator>& b,
+ const boost::basic_regex<char, Traits>& expr);
/// Read data into a streambuf until some part of the data it contains matches
/// a regular expression.
@@ -864,9 +877,10 @@ std::size_t read_until(SyncReadStream& s,
* application will typically leave that data in the streambuf for a subsequent
* read_until operation to examine.
*/
-template <typename SyncReadStream, typename Allocator>
+template <typename SyncReadStream, typename Allocator, typename Traits>
std::size_t read_until(SyncReadStream& s,
- asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
+ asio::basic_streambuf<Allocator>& b,
+ const boost::basic_regex<char, Traits>& expr,
asio::error_code& ec);
#endif // defined(ASIO_HAS_BOOST_REGEX)
@@ -975,7 +989,7 @@ std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename Allocator, typename MatchCondition>
std::size_t read_until(SyncReadStream& s,
asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
- typename constraint<is_match_condition<MatchCondition>::value>::type = 0);
+ constraint_t<is_match_condition<MatchCondition>::value> = 0);
/// Read data into a streambuf until a function object indicates a match.
/**
@@ -1032,7 +1046,7 @@ template <typename SyncReadStream, typename Allocator, typename MatchCondition>
std::size_t read_until(SyncReadStream& s,
asio::basic_streambuf<Allocator>& b,
MatchCondition match_condition, asio::error_code& ec,
- typename constraint<is_match_condition<MatchCondition>::value>::type = 0);
+ constraint_t<is_match_condition<MatchCondition>::value> = 0);
#endif // !defined(ASIO_NO_IOSTREAM)
#endif // !defined(ASIO_NO_EXTENSIONS)
@@ -1093,9 +1107,9 @@ std::size_t read_until(SyncReadStream& s,
*/
template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter.
@@ -1134,9 +1148,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
char delim, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter.
@@ -1192,9 +1206,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_STRING_VIEW_PARAM delim,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter.
@@ -1233,9 +1247,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
#if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX) \
@@ -1295,12 +1309,12 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
* This data may be the start of a new line, to be extracted by a subsequent
* @c read_until operation.
*/
-template <typename SyncReadStream, typename DynamicBuffer_v2>
+template <typename SyncReadStream, typename DynamicBuffer_v2, typename Traits>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
- const boost::regex& expr,
- typename constraint<
+ const boost::basic_regex<char, Traits>& expr,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Read data into a dynamic buffer sequence until some part of the data it
/// contains matches a regular expression.
@@ -1338,12 +1352,12 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
* expression. An application will typically leave that data in the dynamic
* buffer sequence for a subsequent read_until operation to examine.
*/
-template <typename SyncReadStream, typename DynamicBuffer_v2>
+template <typename SyncReadStream, typename DynamicBuffer_v2, typename Traits>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
- const boost::regex& expr, asio::error_code& ec,
- typename constraint<
+ const boost::basic_regex<char, Traits>& expr, asio::error_code& ec,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
#endif // defined(ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION)
@@ -1454,12 +1468,12 @@ template <typename SyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
MatchCondition match_condition,
- typename constraint<
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type = 0,
- typename constraint<
+ > = 0,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Read data into a dynamic buffer sequence until a function object indicates a
/// match.
@@ -1518,12 +1532,12 @@ template <typename SyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
MatchCondition match_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type = 0,
- typename constraint<
+ > = 0,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
#endif // !defined(ASIO_NO_EXTENSIONS)
@@ -1545,9 +1559,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
/**
* This function is used to asynchronously read data into the specified dynamic
* buffer sequence until the dynamic buffer sequence's get area contains the
- * specified delimiter. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * specified delimiter. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The get area of the dynamic buffer sequence contains the specified
* delimiter.
@@ -1568,27 +1582,31 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param delim The delimiter character.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
*
* // The number of bytes in the dynamic buffer sequence's
* // get area up to and including the delimiter.
- * // 0 if an error occurred.
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note After a successful async_read_until operation, the dynamic buffer
* sequence may contain additional data beyond the delimiter. An application
* will typically leave that data in the dynamic buffer sequence for a
@@ -1635,31 +1653,32 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
*/
template <typename AsyncReadStream, typename DynamicBuffer_v1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, char delim,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s,
+ DynamicBuffer_v1&& buffers, char delim,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), delim));
/// Start an asynchronous operation to read data into a dynamic buffer sequence
/// until it contains a specified delimiter.
/**
* This function is used to asynchronously read data into the specified dynamic
* buffer sequence until the dynamic buffer sequence's get area contains the
- * specified delimiter. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * specified delimiter. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The get area of the dynamic buffer sequence contains the specified
* delimiter.
@@ -1680,27 +1699,31 @@ async_read_until(AsyncReadStream& s,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param delim The delimiter string.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
*
* // The number of bytes in the dynamic buffer sequence's
* // get area up to and including the delimiter.
- * // 0 if an error occurred.
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note After a successful async_read_until operation, the dynamic buffer
* sequence may contain additional data beyond the delimiter. An application
* will typically leave that data in the dynamic buffer sequence for a
@@ -1747,23 +1770,26 @@ async_read_until(AsyncReadStream& s,
*/
template <typename AsyncReadStream, typename DynamicBuffer_v1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s,
+ DynamicBuffer_v1&& buffers,
ASIO_STRING_VIEW_PARAM delim,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_string_v1<
+ AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<std::string>(delim)));
#if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX) \
@@ -1774,9 +1800,10 @@ async_read_until(AsyncReadStream& s,
/**
* This function is used to asynchronously read data into the specified dynamic
* buffer sequence until the dynamic buffer sequence's get area contains some
- * data that matches a regular expression. The function call always returns
- * immediately. The asynchronous operation will continue until one of the
- * following conditions is true:
+ * data that matches a regular expression. It is an initiating function for an
+ * @ref asynchronous_operation, and always returns immediately. The
+ * asynchronous operation will continue until one of the following conditions
+ * is true:
*
* @li A substring of the dynamic buffer sequence's get area matches the regular
* expression.
@@ -1798,13 +1825,15 @@ async_read_until(AsyncReadStream& s,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param expr The regular expression.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -1816,10 +1845,13 @@ async_read_until(AsyncReadStream& s,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note After a successful async_read_until operation, the dynamic buffer
* sequence may contain additional data beyond that which matched the regular
* expression. An application will typically leave that data in the dynamic
@@ -1865,25 +1897,25 @@ async_read_until(AsyncReadStream& s,
* if they are also supported by the @c AsyncReadStream type's
* @c async_read_some operation.
*/
-template <typename AsyncReadStream, typename DynamicBuffer_v1,
+template <typename AsyncReadStream, typename DynamicBuffer_v1, typename Traits,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- const boost::regex& expr,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
+ const boost::basic_regex<char, Traits>& expr,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_expr_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), expr));
#endif // defined(ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION)
@@ -1894,9 +1926,9 @@ async_read_until(AsyncReadStream& s,
* This function is used to asynchronously read data into the specified dynamic
* buffer sequence until a user-defined match condition function object, when
* applied to the data contained in the dynamic buffer sequence, indicates a
- * successful match. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * successful match. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The match condition function object returns a std::pair where the second
* element evaluates to true.
@@ -1917,7 +1949,7 @@ async_read_until(AsyncReadStream& s,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param match_condition The function object to be called to determine whether
* a match exists. The signature of the function object must be:
@@ -1934,9 +1966,11 @@ async_read_until(AsyncReadStream& s,
* @c second member of the return value is true if a match has been found, false
* otherwise.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -1947,8 +1981,8 @@ async_read_until(AsyncReadStream& s,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
* @note After a successful async_read_until operation, the dynamic buffer
@@ -1956,6 +1990,9 @@ async_read_until(AsyncReadStream& s,
* object. An application will typically leave that data in the dynamic buffer
* sequence for a subsequent async_read_until operation to examine.
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The default implementation of the @c is_match_condition type trait
* evaluates to true for function pointers and function objects with a
* @c result_type typedef. It must be specialised for other user-defined
@@ -2030,26 +2067,27 @@ async_read_until(AsyncReadStream& s,
template <typename AsyncReadStream,
typename DynamicBuffer_v1, typename MatchCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- MatchCondition match_condition,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s,
+ DynamicBuffer_v1&& buffers, MatchCondition match_condition,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type = 0,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ > = 0,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_match_v1<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ match_condition));
#if !defined(ASIO_NO_IOSTREAM)
@@ -2058,8 +2096,9 @@ async_read_until(AsyncReadStream& s,
/**
* This function is used to asynchronously read data into the specified
* streambuf until the streambuf's get area contains the specified delimiter.
- * The function call always returns immediately. The asynchronous operation
- * will continue until one of the following conditions is true:
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately. The asynchronous operation will continue until one of
+ * the following conditions is true:
*
* @li The get area of the streambuf contains the specified delimiter.
*
@@ -2078,13 +2117,15 @@ async_read_until(AsyncReadStream& s,
*
* @param b A streambuf object into which the data will be read. Ownership of
* the streambuf is retained by the caller, which must guarantee that it remains
- * valid until the handler is called.
+ * valid until the completion handler is called.
*
* @param delim The delimiter character.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -2095,10 +2136,13 @@ async_read_until(AsyncReadStream& s,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note After a successful async_read_until operation, the streambuf may
* contain additional data beyond the delimiter. An application will typically
* leave that data in the streambuf for a subsequent async_read_until operation
@@ -2144,24 +2188,26 @@ async_read_until(AsyncReadStream& s,
*/
template <typename AsyncReadStream, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s,
asio::basic_streambuf<Allocator>& b, char delim,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type));
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), delim));
/// Start an asynchronous operation to read data into a streambuf until it
/// contains a specified delimiter.
/**
* This function is used to asynchronously read data into the specified
* streambuf until the streambuf's get area contains the specified delimiter.
- * The function call always returns immediately. The asynchronous operation
- * will continue until one of the following conditions is true:
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately. The asynchronous operation will continue until one of
+ * the following conditions is true:
*
* @li The get area of the streambuf contains the specified delimiter.
*
@@ -2180,13 +2226,15 @@ async_read_until(AsyncReadStream& s,
*
* @param b A streambuf object into which the data will be read. Ownership of
* the streambuf is retained by the caller, which must guarantee that it remains
- * valid until the handler is called.
+ * valid until the completion handler is called.
*
* @param delim The delimiter string.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -2197,10 +2245,13 @@ async_read_until(AsyncReadStream& s,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note After a successful async_read_until operation, the streambuf may
* contain additional data beyond the delimiter. An application will typically
* leave that data in the streambuf for a subsequent async_read_until operation
@@ -2246,17 +2297,20 @@ async_read_until(AsyncReadStream& s,
*/
template <typename AsyncReadStream, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s,
asio::basic_streambuf<Allocator>& b,
ASIO_STRING_VIEW_PARAM delim,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type));
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_string_v1<
+ AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<std::string>(delim)));
#if defined(ASIO_HAS_BOOST_REGEX) \
|| defined(GENERATING_DOCUMENTATION)
@@ -2266,9 +2320,9 @@ async_read_until(AsyncReadStream& s,
/**
* This function is used to asynchronously read data into the specified
* streambuf until the streambuf's get area contains some data that matches a
- * regular expression. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * regular expression. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li A substring of the streambuf's get area matches the regular expression.
*
@@ -2288,13 +2342,15 @@ async_read_until(AsyncReadStream& s,
*
* @param b A streambuf object into which the data will be read. Ownership of
* the streambuf is retained by the caller, which must guarantee that it remains
- * valid until the handler is called.
+ * valid until the completion handler is called.
*
* @param expr The regular expression.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -2306,10 +2362,13 @@ async_read_until(AsyncReadStream& s,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note After a successful async_read_until operation, the streambuf may
* contain additional data beyond that which matched the regular expression. An
* application will typically leave that data in the streambuf for a subsequent
@@ -2354,18 +2413,20 @@ async_read_until(AsyncReadStream& s,
* if they are also supported by the @c AsyncReadStream type's
* @c async_read_some operation.
*/
-template <typename AsyncReadStream, typename Allocator,
+template <typename AsyncReadStream, typename Allocator, typename Traits,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type));
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s,
+ asio::basic_streambuf<Allocator>& b,
+ const boost::basic_regex<char, Traits>& expr,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_expr_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), expr));
#endif // defined(ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION)
@@ -2375,9 +2436,10 @@ async_read_until(AsyncReadStream& s,
/**
* This function is used to asynchronously read data into the specified
* streambuf until a user-defined match condition function object, when applied
- * to the data contained in the streambuf, indicates a successful match. The
- * function call always returns immediately. The asynchronous operation will
- * continue until one of the following conditions is true:
+ * to the data contained in the streambuf, indicates a successful match. It is
+ * an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately. The asynchronous operation will continue until one of
+ * the following conditions is true:
*
* @li The match condition function object returns a std::pair where the second
* element evaluates to true.
@@ -2412,9 +2474,11 @@ async_read_until(AsyncReadStream& s,
* @c second member of the return value is true if a match has been found, false
* otherwise.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -2425,8 +2489,8 @@ async_read_until(AsyncReadStream& s,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
* @note After a successful async_read_until operation, the streambuf may
@@ -2434,6 +2498,9 @@ async_read_until(AsyncReadStream& s,
* application will typically leave that data in the streambuf for a subsequent
* async_read_until operation to examine.
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The default implementation of the @c is_match_condition type trait
* evaluates to true for function pointers and function objects with a
* @c result_type typedef. It must be specialised for other user-defined
@@ -2506,18 +2573,18 @@ async_read_until(AsyncReadStream& s,
*/
template <typename AsyncReadStream, typename Allocator, typename MatchCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s,
- asio::basic_streambuf<Allocator>& b,
- MatchCondition match_condition,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<is_match_condition<MatchCondition>::value>::type = 0);
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s,
+ asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<is_match_condition<MatchCondition>::value> = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_match_v1<AsyncReadStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), match_condition));
#endif // !defined(ASIO_NO_IOSTREAM)
#endif // !defined(ASIO_NO_EXTENSIONS)
@@ -2528,9 +2595,9 @@ async_read_until(AsyncReadStream& s,
/**
* This function is used to asynchronously read data into the specified dynamic
* buffer sequence until the dynamic buffer sequence's get area contains the
- * specified delimiter. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * specified delimiter. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The get area of the dynamic buffer sequence contains the specified
* delimiter.
@@ -2551,13 +2618,15 @@ async_read_until(AsyncReadStream& s,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param delim The delimiter character.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -2568,10 +2637,13 @@ async_read_until(AsyncReadStream& s,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note After a successful async_read_until operation, the dynamic buffer
* sequence may contain additional data beyond the delimiter. An application
* will typically leave that data in the dynamic buffer sequence for a
@@ -2618,27 +2690,28 @@ async_read_until(AsyncReadStream& s,
*/
template <typename AsyncReadStream, typename DynamicBuffer_v2,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), delim));
/// Start an asynchronous operation to read data into a dynamic buffer sequence
/// until it contains a specified delimiter.
/**
* This function is used to asynchronously read data into the specified dynamic
* buffer sequence until the dynamic buffer sequence's get area contains the
- * specified delimiter. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * specified delimiter. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The get area of the dynamic buffer sequence contains the specified
* delimiter.
@@ -2659,27 +2732,31 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param delim The delimiter string.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
*
* // The number of bytes in the dynamic buffer sequence's
* // get area up to and including the delimiter.
- * // 0 if an error occurred.
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note After a successful async_read_until operation, the dynamic buffer
* sequence may contain additional data beyond the delimiter. An application
* will typically leave that data in the dynamic buffer sequence for a
@@ -2726,19 +2803,22 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
*/
template <typename AsyncReadStream, typename DynamicBuffer_v2,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_STRING_VIEW_PARAM delim,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_delim_string_v2<
+ AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<std::string>(delim)));
#if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX) \
@@ -2749,9 +2829,10 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
/**
* This function is used to asynchronously read data into the specified dynamic
* buffer sequence until the dynamic buffer sequence's get area contains some
- * data that matches a regular expression. The function call always returns
- * immediately. The asynchronous operation will continue until one of the
- * following conditions is true:
+ * data that matches a regular expression. It is an initiating function for an
+ * @ref asynchronous_operation, and always returns immediately. The
+ * asynchronous operation will continue until one of the following conditions
+ * is true:
*
* @li A substring of the dynamic buffer sequence's get area matches the regular
* expression.
@@ -2773,13 +2854,15 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param expr The regular expression.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -2791,10 +2874,13 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note After a successful async_read_until operation, the dynamic buffer
* sequence may contain additional data beyond that which matched the regular
* expression. An application will typically leave that data in the dynamic
@@ -2840,21 +2926,22 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* if they are also supported by the @c AsyncReadStream type's
* @c async_read_some operation.
*/
-template <typename AsyncReadStream, typename DynamicBuffer_v2,
+template <typename AsyncReadStream, typename DynamicBuffer_v2, typename Traits,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- const boost::regex& expr,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+ const boost::basic_regex<char, Traits>& expr,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_expr_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), expr));
#endif // defined(ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION)
@@ -2865,9 +2952,9 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* This function is used to asynchronously read data into the specified dynamic
* buffer sequence until a user-defined match condition function object, when
* applied to the data contained in the dynamic buffer sequence, indicates a
- * successful match. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * successful match. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li The match condition function object returns a std::pair where the second
* element evaluates to true.
@@ -2888,7 +2975,7 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* @param buffers The dynamic buffer sequence into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param match_condition The function object to be called to determine whether
* a match exists. The signature of the function object must be:
@@ -2905,9 +2992,11 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* @c second member of the return value is true if a match has been found, false
* otherwise.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -2918,8 +3007,8 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
* @note After a successful async_read_until operation, the dynamic buffer
@@ -2927,6 +3016,9 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* object. An application will typically leave that data in the dynamic buffer
* sequence for a subsequent async_read_until operation to examine.
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The default implementation of the @c is_match_condition type trait
* evaluates to true for function pointers and function objects with a
* @c result_type typedef. It must be specialised for other user-defined
@@ -3001,22 +3093,23 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename AsyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncReadStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
-async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- MatchCondition match_condition,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncReadStream::executor_type),
- typename constraint<
+ std::size_t)) ReadToken = default_completion_token_t<
+ typename AsyncReadStream::executor_type>>
+auto async_read_until(AsyncReadStream& s,
+ DynamicBuffer_v2 buffers, MatchCondition match_condition,
+ ReadToken&& token = default_completion_token_t<
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
is_match_condition<MatchCondition>::value
- >::type = 0,
- typename constraint<
+ > = 0,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_read_until_match_v2<AsyncReadStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), match_condition));
#endif // !defined(ASIO_NO_EXTENSIONS)
diff --git a/3rdparty/asio/include/asio/readable_pipe.hpp b/3rdparty/asio/include/asio/readable_pipe.hpp
new file mode 100644
index 00000000000..19101c28702
--- /dev/null
+++ b/3rdparty/asio/include/asio/readable_pipe.hpp
@@ -0,0 +1,35 @@
+//
+// readable_pipe.hpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_READABLE_PIPE_HPP
+#define ASIO_READABLE_PIPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_PIPE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include "asio/basic_readable_pipe.hpp"
+
+namespace asio {
+
+/// Typedef for the typical usage of a readable pipe.
+typedef basic_readable_pipe<> readable_pipe;
+
+} // namespace asio
+
+#endif // defined(ASIO_HAS_PIPE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_READABLE_PIPE_HPP
diff --git a/3rdparty/asio/include/asio/recycling_allocator.hpp b/3rdparty/asio/include/asio/recycling_allocator.hpp
new file mode 100644
index 00000000000..b3986c0242e
--- /dev/null
+++ b/3rdparty/asio/include/asio/recycling_allocator.hpp
@@ -0,0 +1,138 @@
+//
+// recycling_allocator.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_RECYCLING_ALLOCATOR_HPP
+#define ASIO_RECYCLING_ALLOCATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/recycling_allocator.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// An allocator that caches memory blocks in thread-local storage for reuse.
+/**
+ * The @recycling_allocator uses a simple strategy where a limited number of
+ * small memory blocks are cached in thread-local storage, if the current
+ * thread is running an @c io_context or is part of a @c thread_pool.
+ */
+template <typename T>
+class recycling_allocator
+{
+public:
+ /// The type of object allocated by the recycling allocator.
+ typedef T value_type;
+
+ /// Rebind the allocator to another value_type.
+ template <typename U>
+ struct rebind
+ {
+ /// The rebound @c allocator type.
+ typedef recycling_allocator<U> other;
+ };
+
+ /// Default constructor.
+ constexpr recycling_allocator() noexcept
+ {
+ }
+
+ /// Converting constructor.
+ template <typename U>
+ constexpr recycling_allocator(
+ const recycling_allocator<U>&) noexcept
+ {
+ }
+
+ /// Equality operator. Always returns true.
+ constexpr bool operator==(
+ const recycling_allocator&) const noexcept
+ {
+ return true;
+ }
+
+ /// Inequality operator. Always returns false.
+ constexpr bool operator!=(
+ const recycling_allocator&) const noexcept
+ {
+ return false;
+ }
+
+ /// Allocate memory for the specified number of values.
+ T* allocate(std::size_t n)
+ {
+ return detail::recycling_allocator<T>().allocate(n);
+ }
+
+ /// Deallocate memory for the specified number of values.
+ void deallocate(T* p, std::size_t n)
+ {
+ detail::recycling_allocator<T>().deallocate(p, n);
+ }
+};
+
+/// A proto-allocator that caches memory blocks in thread-local storage for
+/// reuse.
+/**
+ * The @recycling_allocator uses a simple strategy where a limited number of
+ * small memory blocks are cached in thread-local storage, if the current
+ * thread is running an @c io_context or is part of a @c thread_pool.
+ */
+template <>
+class recycling_allocator<void>
+{
+public:
+ /// No values are allocated by a proto-allocator.
+ typedef void value_type;
+
+ /// Rebind the allocator to another value_type.
+ template <typename U>
+ struct rebind
+ {
+ /// The rebound @c allocator type.
+ typedef recycling_allocator<U> other;
+ };
+
+ /// Default constructor.
+ constexpr recycling_allocator() noexcept
+ {
+ }
+
+ /// Converting constructor.
+ template <typename U>
+ constexpr recycling_allocator(
+ const recycling_allocator<U>&) noexcept
+ {
+ }
+
+ /// Equality operator. Always returns true.
+ constexpr bool operator==(
+ const recycling_allocator&) const noexcept
+ {
+ return true;
+ }
+
+ /// Inequality operator. Always returns false.
+ constexpr bool operator!=(
+ const recycling_allocator&) const noexcept
+ {
+ return false;
+ }
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_RECYCLING_ALLOCATOR_HPP
diff --git a/3rdparty/asio/include/asio/redirect_error.hpp b/3rdparty/asio/include/asio/redirect_error.hpp
index 57389dd97af..524bd0b99a1 100644
--- a/3rdparty/asio/include/asio/redirect_error.hpp
+++ b/3rdparty/asio/include/asio/redirect_error.hpp
@@ -2,7 +2,7 @@
// redirect_error.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -23,7 +23,7 @@
namespace asio {
-/// Completion token type used to specify that an error produced by an
+/// A @ref completion_token adapter used to specify that an error produced by an
/// asynchronous operation is captured to an error_code variable.
/**
* The redirect_error_t class is used to indicate that any error_code produced
@@ -35,9 +35,8 @@ class redirect_error_t
public:
/// Constructor.
template <typename T>
- redirect_error_t(ASIO_MOVE_ARG(T) completion_token,
- asio::error_code& ec)
- : token_(ASIO_MOVE_CAST(T)(completion_token)),
+ redirect_error_t(T&& completion_token, asio::error_code& ec)
+ : token_(static_cast<T&&>(completion_token)),
ec_(ec)
{
}
@@ -47,14 +46,13 @@ public:
asio::error_code& ec_;
};
-/// Create a completion token to capture error_code values to a variable.
+/// Adapt a @ref completion_token to capture error_code values to a variable.
template <typename CompletionToken>
-inline redirect_error_t<typename decay<CompletionToken>::type> redirect_error(
- ASIO_MOVE_ARG(CompletionToken) completion_token,
- asio::error_code& ec)
+inline redirect_error_t<decay_t<CompletionToken>> redirect_error(
+ CompletionToken&& completion_token, asio::error_code& ec)
{
- return redirect_error_t<typename decay<CompletionToken>::type>(
- ASIO_MOVE_CAST(CompletionToken)(completion_token), ec);
+ return redirect_error_t<decay_t<CompletionToken>>(
+ static_cast<CompletionToken&&>(completion_token), ec);
}
} // namespace asio
diff --git a/3rdparty/asio/include/asio/registered_buffer.hpp b/3rdparty/asio/include/asio/registered_buffer.hpp
new file mode 100644
index 00000000000..f563277b30a
--- /dev/null
+++ b/3rdparty/asio/include/asio/registered_buffer.hpp
@@ -0,0 +1,344 @@
+//
+// registered_buffer.hpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_REGISTERED_BUFFER_HPP
+#define ASIO_REGISTERED_BUFFER_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/buffer.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+namespace detail {
+
+class buffer_registration_base;
+
+} // namespace detail
+
+class const_registered_buffer;
+
+/// Type used to identify a registered buffer.
+class registered_buffer_id
+{
+public:
+ /// The native buffer identifier type.
+ typedef int native_handle_type;
+
+ /// Default constructor creates an invalid registered buffer identifier.
+ registered_buffer_id() noexcept
+ : scope_(0),
+ index_(-1)
+ {
+ }
+
+ /// Get the native buffer identifier type.
+ native_handle_type native_handle() const noexcept
+ {
+ return index_;
+ }
+
+ /// Compare two IDs for equality.
+ friend bool operator==(const registered_buffer_id& lhs,
+ const registered_buffer_id& rhs) noexcept
+ {
+ return lhs.scope_ == rhs.scope_ && lhs.index_ == rhs.index_;
+ }
+
+ /// Compare two IDs for equality.
+ friend bool operator!=(const registered_buffer_id& lhs,
+ const registered_buffer_id& rhs) noexcept
+ {
+ return lhs.scope_ != rhs.scope_ || lhs.index_ != rhs.index_;
+ }
+
+private:
+ friend class detail::buffer_registration_base;
+
+ // Hidden constructor used by buffer registration.
+ registered_buffer_id(const void* scope, int index) noexcept
+ : scope_(scope),
+ index_(index)
+ {
+ }
+
+ const void* scope_;
+ int index_;
+};
+
+/// Holds a registered buffer over modifiable data.
+/**
+ * Satisfies the @c MutableBufferSequence type requirements.
+ */
+class mutable_registered_buffer
+{
+public:
+ /// Default constructor creates an invalid registered buffer.
+ mutable_registered_buffer() noexcept
+ : buffer_(),
+ id_()
+ {
+ }
+
+ /// Get the underlying mutable buffer.
+ const mutable_buffer& buffer() const noexcept
+ {
+ return buffer_;
+ }
+
+ /// Get a pointer to the beginning of the memory range.
+ /**
+ * @returns <tt>buffer().data()</tt>.
+ */
+ void* data() const noexcept
+ {
+ return buffer_.data();
+ }
+
+ /// Get the size of the memory range.
+ /**
+ * @returns <tt>buffer().size()</tt>.
+ */
+ std::size_t size() const noexcept
+ {
+ return buffer_.size();
+ }
+
+ /// Get the registered buffer identifier.
+ const registered_buffer_id& id() const noexcept
+ {
+ return id_;
+ }
+
+ /// Move the start of the buffer by the specified number of bytes.
+ mutable_registered_buffer& operator+=(std::size_t n) noexcept
+ {
+ buffer_ += n;
+ return *this;
+ }
+
+private:
+ friend class detail::buffer_registration_base;
+
+ // Hidden constructor used by buffer registration and operators.
+ mutable_registered_buffer(const mutable_buffer& b,
+ const registered_buffer_id& i) noexcept
+ : buffer_(b),
+ id_(i)
+ {
+ }
+
+#if !defined(GENERATING_DOCUMENTATION)
+ friend mutable_registered_buffer buffer(
+ const mutable_registered_buffer& b, std::size_t n) noexcept;
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+ mutable_buffer buffer_;
+ registered_buffer_id id_;
+};
+
+/// Holds a registered buffer over non-modifiable data.
+/**
+ * Satisfies the @c ConstBufferSequence type requirements.
+ */
+class const_registered_buffer
+{
+public:
+ /// Default constructor creates an invalid registered buffer.
+ const_registered_buffer() noexcept
+ : buffer_(),
+ id_()
+ {
+ }
+
+ /// Construct a non-modifiable buffer from a modifiable one.
+ const_registered_buffer(
+ const mutable_registered_buffer& b) noexcept
+ : buffer_(b.buffer()),
+ id_(b.id())
+ {
+ }
+
+ /// Get the underlying constant buffer.
+ const const_buffer& buffer() const noexcept
+ {
+ return buffer_;
+ }
+
+ /// Get a pointer to the beginning of the memory range.
+ /**
+ * @returns <tt>buffer().data()</tt>.
+ */
+ const void* data() const noexcept
+ {
+ return buffer_.data();
+ }
+
+ /// Get the size of the memory range.
+ /**
+ * @returns <tt>buffer().size()</tt>.
+ */
+ std::size_t size() const noexcept
+ {
+ return buffer_.size();
+ }
+
+ /// Get the registered buffer identifier.
+ const registered_buffer_id& id() const noexcept
+ {
+ return id_;
+ }
+
+ /// Move the start of the buffer by the specified number of bytes.
+ const_registered_buffer& operator+=(std::size_t n) noexcept
+ {
+ buffer_ += n;
+ return *this;
+ }
+
+private:
+ // Hidden constructor used by operators.
+ const_registered_buffer(const const_buffer& b,
+ const registered_buffer_id& i) noexcept
+ : buffer_(b),
+ id_(i)
+ {
+ }
+
+#if !defined(GENERATING_DOCUMENTATION)
+ friend const_registered_buffer buffer(
+ const const_registered_buffer& b, std::size_t n) noexcept;
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+ const_buffer buffer_;
+ registered_buffer_id id_;
+};
+
+/** @addtogroup buffer_sequence_begin */
+
+/// Get an iterator to the first element in a buffer sequence.
+inline const mutable_buffer* buffer_sequence_begin(
+ const mutable_registered_buffer& b) noexcept
+{
+ return &b.buffer();
+}
+
+/// Get an iterator to the first element in a buffer sequence.
+inline const const_buffer* buffer_sequence_begin(
+ const const_registered_buffer& b) noexcept
+{
+ return &b.buffer();
+}
+
+/** @} */
+/** @addtogroup buffer_sequence_end */
+
+/// Get an iterator to one past the end element in a buffer sequence.
+inline const mutable_buffer* buffer_sequence_end(
+ const mutable_registered_buffer& b) noexcept
+{
+ return &b.buffer() + 1;
+}
+
+/// Get an iterator to one past the end element in a buffer sequence.
+inline const const_buffer* buffer_sequence_end(
+ const const_registered_buffer& b) noexcept
+{
+ return &b.buffer() + 1;
+}
+
+/** @} */
+/** @addtogroup buffer */
+
+/// Obtain a buffer representing the entire registered buffer.
+inline mutable_registered_buffer buffer(
+ const mutable_registered_buffer& b) noexcept
+{
+ return b;
+}
+
+/// Obtain a buffer representing the entire registered buffer.
+inline const_registered_buffer buffer(
+ const const_registered_buffer& b) noexcept
+{
+ return b;
+}
+
+/// Obtain a buffer representing part of a registered buffer.
+inline mutable_registered_buffer buffer(
+ const mutable_registered_buffer& b, std::size_t n) noexcept
+{
+ return mutable_registered_buffer(buffer(b.buffer_, n), b.id_);
+}
+
+/// Obtain a buffer representing part of a registered buffer.
+inline const_registered_buffer buffer(
+ const const_registered_buffer& b, std::size_t n) noexcept
+{
+ return const_registered_buffer(buffer(b.buffer_, n), b.id_);
+}
+
+/** @} */
+
+/// Create a new modifiable registered buffer that is offset from the start of
+/// another.
+/**
+ * @relates mutable_registered_buffer
+ */
+inline mutable_registered_buffer operator+(
+ const mutable_registered_buffer& b, std::size_t n) noexcept
+{
+ mutable_registered_buffer tmp(b);
+ tmp += n;
+ return tmp;
+}
+
+/// Create a new modifiable buffer that is offset from the start of another.
+/**
+ * @relates mutable_registered_buffer
+ */
+inline mutable_registered_buffer operator+(std::size_t n,
+ const mutable_registered_buffer& b) noexcept
+{
+ return b + n;
+}
+
+/// Create a new non-modifiable registered buffer that is offset from the start
+/// of another.
+/**
+ * @relates const_registered_buffer
+ */
+inline const_registered_buffer operator+(const const_registered_buffer& b,
+ std::size_t n) noexcept
+{
+ const_registered_buffer tmp(b);
+ tmp += n;
+ return tmp;
+}
+
+/// Create a new non-modifiable buffer that is offset from the start of another.
+/**
+ * @relates const_registered_buffer
+ */
+inline const_registered_buffer operator+(std::size_t n,
+ const const_registered_buffer& b) noexcept
+{
+ return b + n;
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_REGISTERED_BUFFER_HPP
diff --git a/3rdparty/asio/include/asio/require.hpp b/3rdparty/asio/include/asio/require.hpp
index c8b40fce959..609e54fcaa3 100644
--- a/3rdparty/asio/include/asio/require.hpp
+++ b/3rdparty/asio/include/asio/require.hpp
@@ -2,7 +2,7 @@
// require.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -107,10 +107,10 @@ struct require_result
namespace asio_require_fn {
-using asio::conditional;
-using asio::decay;
+using asio::conditional_t;
+using asio::decay_t;
using asio::declval;
-using asio::enable_if;
+using asio::enable_if_t;
using asio::is_applicable_property;
using asio::traits::require_free;
using asio::traits::require_member;
@@ -132,99 +132,95 @@ template <typename Impl, typename T, typename Properties, typename = void,
typename = void, typename = void, typename = void, typename = void>
struct call_traits
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr overload_type overload = ill_formed;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_requirable
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_requirable
+ >,
+ enable_if_t<
static_require<T, Property>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = identity);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
-#if defined(ASIO_HAS_MOVE)
- typedef ASIO_MOVE_ARG(T) result_type;
-#else // defined(ASIO_HAS_MOVE)
- typedef ASIO_MOVE_ARG(typename decay<T>::type) result_type;
-#endif // defined(ASIO_HAS_MOVE)
+ static constexpr overload_type overload = identity;
+ static constexpr bool is_noexcept = true;
+
+ typedef T&& result_type;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_requirable
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_requirable
+ >,
+ enable_if_t<
!static_require<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
require_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type> :
+ >> :
require_member<typename Impl::template proxy<T>::type, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
+ static constexpr overload_type overload = call_member;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_requirable
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_requirable
+ >,
+ enable_if_t<
!static_require<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!require_member<typename Impl::template proxy<T>::type, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
require_free<T, Property>::is_valid
- >::type> :
+ >> :
require_free<T, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
+ static constexpr overload_type overload = call_free;
};
template <typename Impl, typename T, typename P0, typename P1>
struct call_traits<Impl, T, void(P0, P1),
- typename enable_if<
+ enable_if_t<
call_traits<Impl, T, void(P0)>::overload != ill_formed
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
void(P1)
>::overload != ill_formed
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = two_props);
+ static constexpr overload_type overload = two_props;
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
+ static constexpr bool is_noexcept =
(
call_traits<Impl, T, void(P0)>::is_noexcept
&&
@@ -233,51 +229,51 @@ struct call_traits<Impl, T, void(P0, P1),
typename call_traits<Impl, T, void(P0)>::result_type,
void(P1)
>::is_noexcept
- ));
+ );
- typedef typename decay<
+ typedef decay_t<
typename call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
void(P1)
>::result_type
- >::type result_type;
+ > result_type;
};
template <typename Impl, typename T, typename P0,
- typename P1, typename ASIO_ELLIPSIS PN>
-struct call_traits<Impl, T, void(P0, P1, PN ASIO_ELLIPSIS),
- typename enable_if<
+ typename P1, typename... PN>
+struct call_traits<Impl, T, void(P0, P1, PN...),
+ enable_if_t<
call_traits<Impl, T, void(P0)>::overload != ill_formed
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
- void(P1, PN ASIO_ELLIPSIS)
+ void(P1, PN...)
>::overload != ill_formed
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = n_props);
+ static constexpr overload_type overload = n_props;
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
+ static constexpr bool is_noexcept =
(
call_traits<Impl, T, void(P0)>::is_noexcept
&&
call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
- void(P1, PN ASIO_ELLIPSIS)
+ void(P1, PN...)
>::is_noexcept
- ));
+ );
- typedef typename decay<
+ typedef decay_t<
typename call_traits<
Impl,
typename call_traits<Impl, T, void(P0)>::result_type,
- void(P1, PN ASIO_ELLIPSIS)
+ void(P1, PN...)
>::result_type
- >::type result_type;
+ > result_type;
};
struct impl
@@ -289,16 +285,14 @@ struct impl
struct type
{
template <typename P>
- auto require(ASIO_MOVE_ARG(P) p)
+ auto require(P&& p)
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().require(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().require(static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().require(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().require(static_cast<P&&>(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
@@ -307,91 +301,63 @@ struct impl
};
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == identity,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property)) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&&) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return ASIO_MOVE_CAST(T)(t);
+ return static_cast<T&&>(t);
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_member,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return ASIO_MOVE_CAST(T)(t).require(
- ASIO_MOVE_CAST(Property)(p));
+ return static_cast<T&&>(t).require(static_cast<Property&&>(p));
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_free,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return require(
- ASIO_MOVE_CAST(T)(t),
- ASIO_MOVE_CAST(Property)(p));
+ return require(static_cast<T&&>(t), static_cast<Property&&>(p));
}
template <typename T, typename P0, typename P1>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(P0, P1)>::overload == two_props,
typename call_traits<impl, T, void(P0, P1)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(P0) p0,
- ASIO_MOVE_ARG(P1) p1) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(P0, P1)>::is_noexcept))
+ >
+ operator()(T&& t, P0&& p0, P1&& p1) const
+ noexcept(call_traits<impl, T, void(P0, P1)>::is_noexcept)
{
return (*this)(
- (*this)(
- ASIO_MOVE_CAST(T)(t),
- ASIO_MOVE_CAST(P0)(p0)),
- ASIO_MOVE_CAST(P1)(p1));
+ (*this)(static_cast<T&&>(t), static_cast<P0&&>(p0)),
+ static_cast<P1&&>(p1));
}
template <typename T, typename P0, typename P1,
- typename ASIO_ELLIPSIS PN>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
- call_traits<impl, T,
- void(P0, P1, PN ASIO_ELLIPSIS)>::overload == n_props,
- typename call_traits<impl, T,
- void(P0, P1, PN ASIO_ELLIPSIS)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(P0) p0,
- ASIO_MOVE_ARG(P1) p1,
- ASIO_MOVE_ARG(PN) ASIO_ELLIPSIS pn) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(P0, P1, PN ASIO_ELLIPSIS)>::is_noexcept))
+ typename... PN>
+ ASIO_NODISCARD constexpr enable_if_t<
+ call_traits<impl, T, void(P0, P1, PN...)>::overload == n_props,
+ typename call_traits<impl, T, void(P0, P1, PN...)>::result_type
+ >
+ operator()(T&& t, P0&& p0, P1&& p1, PN&&... pn) const
+ noexcept(call_traits<impl, T, void(P0, P1, PN...)>::is_noexcept)
{
return (*this)(
- (*this)(
- ASIO_MOVE_CAST(T)(t),
- ASIO_MOVE_CAST(P0)(p0)),
- ASIO_MOVE_CAST(P1)(p1),
- ASIO_MOVE_CAST(PN)(pn) ASIO_ELLIPSIS);
+ (*this)(static_cast<T&&>(t), static_cast<P0&&>(p0)),
+ static_cast<P1&&>(p1), static_cast<PN&&>(pn)...);
}
};
@@ -408,15 +374,13 @@ const T static_instance<T>::instance = {};
namespace asio {
namespace {
-static ASIO_CONSTEXPR const asio_require_fn::impl&
+static constexpr const asio_require_fn::impl&
require = asio_require_fn::static_instance<>::instance;
} // namespace
typedef asio_require_fn::impl require_t;
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename T, typename... Properties>
struct can_require :
integral_constant<bool,
@@ -426,51 +390,14 @@ struct can_require :
{
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename P0 = void,
- typename P1 = void, typename P2 = void>
-struct can_require :
- integral_constant<bool,
- asio_require_fn::call_traits<require_t, T, void(P0, P1, P2)>::overload
- != asio_require_fn::ill_formed>
-{
-};
-
-template <typename T, typename P0, typename P1>
-struct can_require<T, P0, P1> :
- integral_constant<bool,
- asio_require_fn::call_traits<require_t, T, void(P0, P1)>::overload
- != asio_require_fn::ill_formed>
-{
-};
-
-template <typename T, typename P0>
-struct can_require<T, P0> :
- integral_constant<bool,
- asio_require_fn::call_traits<require_t, T, void(P0)>::overload
- != asio_require_fn::ill_formed>
-{
-};
-
-template <typename T>
-struct can_require<T> :
- false_type
-{
-};
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-template <typename T, typename ASIO_ELLIPSIS Properties>
+template <typename T, typename... Properties>
constexpr bool can_require_v
- = can_require<T, Properties ASIO_ELLIPSIS>::value;
+ = can_require<T, Properties...>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename T, typename... Properties>
struct is_nothrow_require :
integral_constant<bool,
@@ -479,51 +406,14 @@ struct is_nothrow_require :
{
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename P0 = void,
- typename P1 = void, typename P2 = void>
-struct is_nothrow_require :
- integral_constant<bool,
- asio_require_fn::call_traits<
- require_t, T, void(P0, P1, P2)>::is_noexcept>
-{
-};
-
-template <typename T, typename P0, typename P1>
-struct is_nothrow_require<T, P0, P1> :
- integral_constant<bool,
- asio_require_fn::call_traits<
- require_t, T, void(P0, P1)>::is_noexcept>
-{
-};
-
-template <typename T, typename P0>
-struct is_nothrow_require<T, P0> :
- integral_constant<bool,
- asio_require_fn::call_traits<
- require_t, T, void(P0)>::is_noexcept>
-{
-};
-
-template <typename T>
-struct is_nothrow_require<T> :
- false_type
-{
-};
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
-template <typename T, typename ASIO_ELLIPSIS Properties>
+template <typename T, typename... Properties>
constexpr bool is_nothrow_require_v
- = is_nothrow_require<T, Properties ASIO_ELLIPSIS>::value;
+ = is_nothrow_require<T, Properties...>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename T, typename... Properties>
struct require_result
{
@@ -531,36 +421,8 @@ struct require_result
require_t, T, void(Properties...)>::result_type type;
};
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename P0 = void,
- typename P1 = void, typename P2 = void>
-struct require_result
-{
- typedef typename asio_require_fn::call_traits<
- require_t, T, void(P0, P1, P2)>::result_type type;
-};
-
-template <typename T, typename P0, typename P1>
-struct require_result<T, P0, P1>
-{
- typedef typename asio_require_fn::call_traits<
- require_t, T, void(P0, P1)>::result_type type;
-};
-
-template <typename T, typename P0>
-struct require_result<T, P0>
-{
- typedef typename asio_require_fn::call_traits<
- require_t, T, void(P0)>::result_type type;
-};
-
-template <typename T>
-struct require_result<T>
-{
-};
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
+template <typename T, typename... Properties>
+using require_result_t = typename require_result<T, Properties...>::type;
} // namespace asio
diff --git a/3rdparty/asio/include/asio/require_concept.hpp b/3rdparty/asio/include/asio/require_concept.hpp
index 1238d6b6158..b735b669952 100644
--- a/3rdparty/asio/include/asio/require_concept.hpp
+++ b/3rdparty/asio/include/asio/require_concept.hpp
@@ -2,7 +2,7 @@
// require_concept.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -107,10 +107,10 @@ struct require_concept_result
namespace asio_require_concept_fn {
-using asio::conditional;
-using asio::decay;
+using asio::conditional_t;
+using asio::decay_t;
using asio::declval;
-using asio::enable_if;
+using asio::enable_if_t;
using asio::is_applicable_property;
using asio::traits::require_concept_free;
using asio::traits::require_concept_member;
@@ -130,85 +130,85 @@ template <typename Impl, typename T, typename Properties, typename = void,
typename = void, typename = void, typename = void, typename = void>
struct call_traits
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr overload_type overload = ill_formed;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_requirable_concept
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_requirable_concept
+ >,
+ enable_if_t<
static_require_concept<T, Property>::is_valid
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = identity);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef ASIO_MOVE_ARG(T) result_type;
+ static constexpr overload_type overload = identity;
+ static constexpr bool is_noexcept = true;
+ typedef T&& result_type;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_requirable_concept
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_requirable_concept
+ >,
+ enable_if_t<
!static_require_concept<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
require_concept_member<
typename Impl::template proxy<T>::type,
Property
>::is_valid
- >::type> :
+ >> :
require_concept_member<
typename Impl::template proxy<T>::type,
Property
>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
+ static constexpr overload_type overload = call_member;
};
template <typename Impl, typename T, typename Property>
struct call_traits<Impl, T, void(Property),
- typename enable_if<
+ enable_if_t<
is_applicable_property<
- typename decay<T>::type,
- typename decay<Property>::type
+ decay_t<T>,
+ decay_t<Property>
>::value
- >::type,
- typename enable_if<
- decay<Property>::type::is_requirable_concept
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
+ decay_t<Property>::is_requirable_concept
+ >,
+ enable_if_t<
!static_require_concept<T, Property>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
!require_concept_member<
typename Impl::template proxy<T>::type,
Property
>::is_valid
- >::type,
- typename enable_if<
+ >,
+ enable_if_t<
require_concept_free<T, Property>::is_valid
- >::type> :
+ >> :
require_concept_free<T, Property>
{
- ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
+ static constexpr overload_type overload = call_free;
};
struct impl
@@ -220,16 +220,16 @@ struct impl
struct type
{
template <typename P>
- auto require_concept(ASIO_MOVE_ARG(P) p)
+ auto require_concept(P&& p)
noexcept(
noexcept(
- declval<typename conditional<true, T, P>::type>().require_concept(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().require_concept(
+ static_cast<P&&>(p))
)
)
-> decltype(
- declval<typename conditional<true, T, P>::type>().require_concept(
- ASIO_MOVE_CAST(P)(p))
+ declval<conditional_t<true, T, P>>().require_concept(
+ static_cast<P&&>(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT)
@@ -238,48 +238,36 @@ struct impl
};
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == identity,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property)) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&&) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return ASIO_MOVE_CAST(T)(t);
+ return static_cast<T&&>(t);
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_member,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return ASIO_MOVE_CAST(T)(t).require_concept(
- ASIO_MOVE_CAST(Property)(p));
+ return static_cast<T&&>(t).require_concept(static_cast<Property&&>(p));
}
template <typename T, typename Property>
- ASIO_NODISCARD ASIO_CONSTEXPR typename enable_if<
+ ASIO_NODISCARD constexpr enable_if_t<
call_traits<impl, T, void(Property)>::overload == call_free,
typename call_traits<impl, T, void(Property)>::result_type
- >::type
- operator()(
- ASIO_MOVE_ARG(T) t,
- ASIO_MOVE_ARG(Property) p) const
- ASIO_NOEXCEPT_IF((
- call_traits<impl, T, void(Property)>::is_noexcept))
+ >
+ operator()(T&& t, Property&& p) const
+ noexcept(call_traits<impl, T, void(Property)>::is_noexcept)
{
- return require_concept(
- ASIO_MOVE_CAST(T)(t),
- ASIO_MOVE_CAST(Property)(p));
+ return require_concept(static_cast<T&&>(t), static_cast<Property&&>(p));
}
};
@@ -296,7 +284,7 @@ const T static_instance<T>::instance = {};
namespace asio {
namespace {
-static ASIO_CONSTEXPR const asio_require_concept_fn::impl&
+static constexpr const asio_require_concept_fn::impl&
require_concept = asio_require_concept_fn::static_instance<>::instance;
} // namespace
@@ -315,8 +303,7 @@ struct can_require_concept :
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template <typename T, typename Property>
-constexpr bool can_require_concept_v
- = can_require_concept<T, Property>::value;
+constexpr bool can_require_concept_v = can_require_concept<T, Property>::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
@@ -343,6 +330,10 @@ struct require_concept_result
require_concept_t, T, void(Property)>::result_type type;
};
+template <typename T, typename Property>
+using require_concept_result_t =
+ typename require_concept_result<T, Property>::type;
+
} // namespace asio
#endif // defined(GENERATING_DOCUMENTATION)
diff --git a/3rdparty/asio/include/asio/serial_port.hpp b/3rdparty/asio/include/asio/serial_port.hpp
index bc5c552c23e..61e893769bf 100644
--- a/3rdparty/asio/include/asio/serial_port.hpp
+++ b/3rdparty/asio/include/asio/serial_port.hpp
@@ -2,7 +2,7 @@
// serial_port.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/serial_port_base.hpp b/3rdparty/asio/include/asio/serial_port_base.hpp
index 6d4b047124c..479d69796e7 100644
--- a/3rdparty/asio/include/asio/serial_port_base.hpp
+++ b/3rdparty/asio/include/asio/serial_port_base.hpp
@@ -2,7 +2,7 @@
// serial_port_base.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/signal_set.hpp b/3rdparty/asio/include/asio/signal_set.hpp
index 24cd8bfd4f2..b2e189d01d7 100644
--- a/3rdparty/asio/include/asio/signal_set.hpp
+++ b/3rdparty/asio/include/asio/signal_set.hpp
@@ -2,7 +2,7 @@
// signal_set.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/signal_set_base.hpp b/3rdparty/asio/include/asio/signal_set_base.hpp
new file mode 100644
index 00000000000..9863a1598a3
--- /dev/null
+++ b/3rdparty/asio/include/asio/signal_set_base.hpp
@@ -0,0 +1,171 @@
+//
+// signal_set_base.hpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_SIGNAL_SET_BASE_HPP
+#define ASIO_SIGNAL_SET_BASE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/detail/socket_types.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// The signal_set_base class is used as a base for the basic_signal_set class
+/// templates so that we have a common place to define the flags enum.
+class signal_set_base
+{
+public:
+# if defined(GENERATING_DOCUMENTATION)
+ /// Enumeration representing the different types of flags that may specified
+ /// when adding a signal to a set.
+ enum flags
+ {
+ /// Bitmask representing no flags.
+ none = 0,
+
+ /// Affects the behaviour of interruptible functions such that, if the
+ /// function would have failed with error::interrupted when interrupted by
+ /// the specified signal, the function shall instead be restarted and not
+ /// fail with error::interrupted.
+ restart = implementation_defined,
+
+ /// Do not generate SIGCHLD when child processes stop or stopped child
+ /// processes continue.
+ no_child_stop = implementation_defined,
+
+ /// Do not transform child processes into zombies when they terminate.
+ no_child_wait = implementation_defined,
+
+ /// Special value to indicate that the signal registration does not care
+ /// which flags are set, and so will not conflict with any prior
+ /// registrations of the same signal.
+ dont_care = -1
+ };
+
+ /// Portability typedef.
+ typedef flags flags_t;
+
+#else // defined(GENERATING_DOCUMENTATION)
+
+ enum class flags : int
+ {
+ none = 0,
+ restart = ASIO_OS_DEF(SA_RESTART),
+ no_child_stop = ASIO_OS_DEF(SA_NOCLDSTOP),
+ no_child_wait = ASIO_OS_DEF(SA_NOCLDWAIT),
+ dont_care = -1
+ };
+
+ typedef flags flags_t;
+
+#endif // defined(GENERATING_DOCUMENTATION)
+
+protected:
+ /// Protected destructor to prevent deletion through this type.
+ ~signal_set_base()
+ {
+ }
+};
+
+/// Negation operator.
+/**
+ * @relates signal_set_base::flags
+ */
+inline constexpr bool operator!(signal_set_base::flags_t x)
+{
+ return static_cast<int>(x) == 0;
+}
+
+/// Bitwise and operator.
+/**
+ * @relates signal_set_base::flags
+ */
+inline constexpr signal_set_base::flags_t operator&(
+ signal_set_base::flags_t x, signal_set_base::flags_t y)
+{
+ return static_cast<signal_set_base::flags_t>(
+ static_cast<int>(x) & static_cast<int>(y));
+}
+
+/// Bitwise or operator.
+/**
+ * @relates signal_set_base::flags
+ */
+inline constexpr signal_set_base::flags_t operator|(
+ signal_set_base::flags_t x, signal_set_base::flags_t y)
+{
+ return static_cast<signal_set_base::flags_t>(
+ static_cast<int>(x) | static_cast<int>(y));
+}
+
+/// Bitwise xor operator.
+/**
+ * @relates signal_set_base::flags
+ */
+inline constexpr signal_set_base::flags_t operator^(
+ signal_set_base::flags_t x, signal_set_base::flags_t y)
+{
+ return static_cast<signal_set_base::flags_t>(
+ static_cast<int>(x) ^ static_cast<int>(y));
+}
+
+/// Bitwise negation operator.
+/**
+ * @relates signal_set_base::flags
+ */
+inline constexpr signal_set_base::flags_t operator~(
+ signal_set_base::flags_t x)
+{
+ return static_cast<signal_set_base::flags_t>(~static_cast<int>(x));
+}
+
+/// Bitwise and-assignment operator.
+/**
+ * @relates signal_set_base::flags
+ */
+inline signal_set_base::flags_t& operator&=(
+ signal_set_base::flags_t& x, signal_set_base::flags_t y)
+{
+ x = x & y;
+ return x;
+}
+
+/// Bitwise or-assignment operator.
+/**
+ * @relates signal_set_base::flags
+ */
+inline signal_set_base::flags_t& operator|=(
+ signal_set_base::flags_t& x, signal_set_base::flags_t y)
+{
+ x = x | y;
+ return x;
+}
+
+/// Bitwise xor-assignment operator.
+/**
+ * @relates signal_set_base::flags
+ */
+inline signal_set_base::flags_t& operator^=(
+ signal_set_base::flags_t& x, signal_set_base::flags_t y)
+{
+ x = x ^ y;
+ return x;
+}
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_SIGNAL_SET_BASE_HPP
diff --git a/3rdparty/asio/include/asio/socket_base.hpp b/3rdparty/asio/include/asio/socket_base.hpp
index e43790cc8b7..5d509790d3d 100644
--- a/3rdparty/asio/include/asio/socket_base.hpp
+++ b/3rdparty/asio/include/asio/socket_base.hpp
@@ -2,7 +2,7 @@
// socket_base.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/spawn.hpp b/3rdparty/asio/include/asio/spawn.hpp
index 780de6b7284..eeacb49de6d 100644
--- a/3rdparty/asio/include/asio/spawn.hpp
+++ b/3rdparty/asio/include/asio/spawn.hpp
@@ -2,7 +2,7 @@
// spawn.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,28 +16,162 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-#include <boost/coroutine/all.hpp>
#include "asio/any_io_executor.hpp"
-#include "asio/bind_executor.hpp"
+#include "asio/cancellation_signal.hpp"
+#include "asio/cancellation_state.hpp"
+#include "asio/detail/exception.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/type_traits.hpp"
-#include "asio/detail/wrapped_handler.hpp"
#include "asio/io_context.hpp"
#include "asio/is_executor.hpp"
#include "asio/strand.hpp"
+#if defined(ASIO_HAS_BOOST_COROUTINE)
+# include <boost/coroutine/all.hpp>
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
+
#include "asio/detail/push_options.hpp"
namespace asio {
+namespace detail {
+
+// Base class for all spawn()-ed thread implementations.
+class spawned_thread_base
+{
+public:
+ spawned_thread_base()
+ : owner_(0),
+ has_context_switched_(false),
+ throw_if_cancelled_(false),
+ terminal_(false)
+ {
+ }
+
+ virtual ~spawned_thread_base() {}
+ virtual void resume() = 0;
+ virtual void suspend_with(void (*fn)(void*), void* arg) = 0;
+ virtual void destroy() = 0;
+
+ void attach(spawned_thread_base** owner)
+ {
+ owner_ = owner;
+ *owner_ = this;
+ }
+
+ void detach()
+ {
+ if (owner_)
+ *owner_ = 0;
+ owner_ = 0;
+ }
+
+ void suspend()
+ {
+ suspend_with(0, 0);
+ }
+
+ template <typename F>
+ void suspend_with(F f)
+ {
+ suspend_with(&spawned_thread_base::call<F>, &f);
+ }
+
+ cancellation_slot get_cancellation_slot() const noexcept
+ {
+ return cancellation_state_.slot();
+ }
-/// Context object the represents the currently executing coroutine.
+ cancellation_state get_cancellation_state() const noexcept
+ {
+ return cancellation_state_;
+ }
+
+ void reset_cancellation_state()
+ {
+ cancellation_state_ = cancellation_state(parent_cancellation_slot_);
+ }
+
+ template <typename Filter>
+ void reset_cancellation_state(Filter filter)
+ {
+ cancellation_state_ = cancellation_state(
+ parent_cancellation_slot_, filter, filter);
+ }
+
+ template <typename InFilter, typename OutFilter>
+ void reset_cancellation_state(InFilter in_filter, OutFilter out_filter)
+ {
+ cancellation_state_ = cancellation_state(
+ parent_cancellation_slot_, in_filter, out_filter);
+ }
+
+ cancellation_type_t cancelled() const noexcept
+ {
+ return cancellation_state_.cancelled();
+ }
+
+ bool has_context_switched() const noexcept
+ {
+ return has_context_switched_;
+ }
+
+ bool throw_if_cancelled() const noexcept
+ {
+ return throw_if_cancelled_;
+ }
+
+ void throw_if_cancelled(bool value) noexcept
+ {
+ throw_if_cancelled_ = value;
+ }
+
+protected:
+ spawned_thread_base** owner_; // Points to data member in active handler.
+ asio::cancellation_slot parent_cancellation_slot_;
+ asio::cancellation_state cancellation_state_;
+ bool has_context_switched_;
+ bool throw_if_cancelled_;
+ bool terminal_;
+
+private:
+ // Disallow copying and assignment.
+ spawned_thread_base(const spawned_thread_base&) = delete;
+ spawned_thread_base& operator=(const spawned_thread_base&) = delete;
+
+ template <typename F>
+ static void call(void* f)
+ {
+ (*static_cast<F*>(f))();
+ }
+};
+
+
+template <typename T>
+struct spawn_signature
+{
+ typedef void type(exception_ptr, T);
+};
+
+template <>
+struct spawn_signature<void>
+{
+ typedef void type(exception_ptr);
+};
+
+template <typename Executor>
+class initiate_spawn;
+
+} // namespace detail
+
+/// A @ref completion_token that represents the currently executing coroutine.
/**
- * The basic_yield_context class is used to represent the currently executing
- * stackful coroutine. A basic_yield_context may be passed as a handler to an
- * asynchronous operation. For example:
+ * The basic_yield_context class is a completion token type that is used to
+ * represent the currently executing stackful coroutine. A basic_yield_context
+ * object may be passed as a completion token to an asynchronous operation. For
+ * example:
*
- * @code template <typename Handler>
- * void my_coroutine(basic_yield_context<Handler> yield)
+ * @code template <typename Executor>
+ * void my_coroutine(basic_yield_context<Executor> yield)
* {
* ...
* std::size_t n = my_socket.async_read_some(buffer, yield);
@@ -48,67 +182,112 @@ namespace asio {
* current coroutine. The coroutine is resumed when the asynchronous operation
* completes, and the result of the operation is returned.
*/
-template <typename Handler>
+template <typename Executor>
class basic_yield_context
{
public:
- /// The coroutine callee type, used by the implementation.
+ /// The executor type associated with the yield context.
+ typedef Executor executor_type;
+
+ /// The cancellation slot type associated with the yield context.
+ typedef cancellation_slot cancellation_slot_type;
+
+ /// Construct a yield context from another yield context type.
/**
- * When using Boost.Coroutine v1, this type is:
- * @code typename coroutine<void()> @endcode
- * When using Boost.Coroutine v2 (unidirectional coroutines), this type is:
- * @code push_coroutine<void> @endcode
+ * Requires that OtherExecutor be convertible to Executor.
*/
-#if defined(GENERATING_DOCUMENTATION)
- typedef implementation_defined callee_type;
-#elif defined(BOOST_COROUTINES_UNIDIRECT) || defined(BOOST_COROUTINES_V2)
- typedef boost::coroutines::push_coroutine<void> callee_type;
-#else
- typedef boost::coroutines::coroutine<void()> callee_type;
-#endif
-
- /// The coroutine caller type, used by the implementation.
+ template <typename OtherExecutor>
+ basic_yield_context(const basic_yield_context<OtherExecutor>& other,
+ constraint_t<
+ is_convertible<OtherExecutor, Executor>::value
+ > = 0)
+ : spawned_thread_(other.spawned_thread_),
+ executor_(other.executor_),
+ ec_(other.ec_)
+ {
+ }
+
+ /// Get the executor associated with the yield context.
+ executor_type get_executor() const noexcept
+ {
+ return executor_;
+ }
+
+ /// Get the cancellation slot associated with the coroutine.
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return spawned_thread_->get_cancellation_slot();
+ }
+
+ /// Get the cancellation state associated with the coroutine.
+ cancellation_state get_cancellation_state() const noexcept
+ {
+ return spawned_thread_->get_cancellation_state();
+ }
+
+ /// Reset the cancellation state associated with the coroutine.
/**
- * When using Boost.Coroutine v1, this type is:
- * @code typename coroutine<void()>::caller_type @endcode
- * When using Boost.Coroutine v2 (unidirectional coroutines), this type is:
- * @code pull_coroutine<void> @endcode
+ * Let <tt>P</tt> be the cancellation slot associated with the current
+ * coroutine's @ref spawn completion handler. Assigns a new
+ * asio::cancellation_state object <tt>S</tt>, constructed as
+ * <tt>S(P)</tt>, into the current coroutine's cancellation state object.
*/
-#if defined(GENERATING_DOCUMENTATION)
- typedef implementation_defined caller_type;
-#elif defined(BOOST_COROUTINES_UNIDIRECT) || defined(BOOST_COROUTINES_V2)
- typedef boost::coroutines::pull_coroutine<void> caller_type;
-#else
- typedef boost::coroutines::coroutine<void()>::caller_type caller_type;
-#endif
-
- /// Construct a yield context to represent the specified coroutine.
+ void reset_cancellation_state() const
+ {
+ spawned_thread_->reset_cancellation_state();
+ }
+
+ /// Reset the cancellation state associated with the coroutine.
/**
- * Most applications do not need to use this constructor. Instead, the
- * spawn() function passes a yield context as an argument to the coroutine
- * function.
+ * Let <tt>P</tt> be the cancellation slot associated with the current
+ * coroutine's @ref spawn completion handler. Assigns a new
+ * asio::cancellation_state object <tt>S</tt>, constructed as <tt>S(P,
+ * std::forward<Filter>(filter))</tt>, into the current coroutine's
+ * cancellation state object.
*/
- basic_yield_context(
- const detail::weak_ptr<callee_type>& coro,
- caller_type& ca, Handler& handler)
- : coro_(coro),
- ca_(ca),
- handler_(handler),
- ec_(0)
+ template <typename Filter>
+ void reset_cancellation_state(Filter&& filter) const
{
+ spawned_thread_->reset_cancellation_state(
+ static_cast<Filter&&>(filter));
}
- /// Construct a yield context from another yield context type.
+ /// Reset the cancellation state associated with the coroutine.
/**
- * Requires that OtherHandler be convertible to Handler.
+ * Let <tt>P</tt> be the cancellation slot associated with the current
+ * coroutine's @ref spawn completion handler. Assigns a new
+ * asio::cancellation_state object <tt>S</tt>, constructed as <tt>S(P,
+ * std::forward<InFilter>(in_filter),
+ * std::forward<OutFilter>(out_filter))</tt>, into the current coroutine's
+ * cancellation state object.
*/
- template <typename OtherHandler>
- basic_yield_context(const basic_yield_context<OtherHandler>& other)
- : coro_(other.coro_),
- ca_(other.ca_),
- handler_(other.handler_),
- ec_(other.ec_)
+ template <typename InFilter, typename OutFilter>
+ void reset_cancellation_state(InFilter&& in_filter,
+ OutFilter&& out_filter) const
+ {
+ spawned_thread_->reset_cancellation_state(
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter));
+ }
+
+ /// Determine whether the current coroutine has been cancelled.
+ cancellation_type_t cancelled() const noexcept
{
+ return spawned_thread_->cancelled();
+ }
+
+ /// Determine whether the coroutine throws if trying to suspend when it has
+ /// been cancelled.
+ bool throw_if_cancelled() const noexcept
+ {
+ return spawned_thread_->throw_if_cancelled();
+ }
+
+ /// Set whether the coroutine throws if trying to suspend when it has been
+ /// cancelled.
+ void throw_if_cancelled(bool value) const noexcept
+ {
+ spawned_thread_->throw_if_cancelled(value);
}
/// Return a yield context that sets the specified error_code.
@@ -118,8 +297,8 @@ public:
* operator may be used to specify an error_code object that should instead be
* set with the asynchronous operation's result. For example:
*
- * @code template <typename Handler>
- * void my_coroutine(basic_yield_context<Handler> yield)
+ * @code template <typename Executor>
+ * void my_coroutine(basic_yield_context<Executor> yield)
* {
* ...
* std::size_t n = my_socket.async_read_some(buffer, yield[ec]);
@@ -137,22 +316,25 @@ public:
return tmp;
}
-#if defined(GENERATING_DOCUMENTATION)
-private:
-#endif // defined(GENERATING_DOCUMENTATION)
- detail::weak_ptr<callee_type> coro_;
- caller_type& ca_;
- Handler handler_;
+#if !defined(GENERATING_DOCUMENTATION)
+//private:
+ basic_yield_context(detail::spawned_thread_base* spawned_thread,
+ const Executor& ex)
+ : spawned_thread_(spawned_thread),
+ executor_(ex),
+ ec_(0)
+ {
+ }
+
+ detail::spawned_thread_base* spawned_thread_;
+ Executor executor_;
asio::error_code* ec_;
+#endif // !defined(GENERATING_DOCUMENTATION)
};
-#if defined(GENERATING_DOCUMENTATION)
-/// Context object that represents the currently executing coroutine.
-typedef basic_yield_context<unspecified> yield_context;
-#else // defined(GENERATING_DOCUMENTATION)
-typedef basic_yield_context<
- executor_binder<void(*)(), any_io_executor> > yield_context;
-#endif // defined(GENERATING_DOCUMENTATION)
+/// A @ref completion_token object that represents the currently executing
+/// coroutine.
+typedef basic_yield_context<any_io_executor> yield_context;
/**
* @defgroup spawn asio::spawn
@@ -163,7 +345,7 @@ typedef basic_yield_context<
* library. This function enables programs to implement asynchronous logic in a
* synchronous manner, as illustrated by the following example:
*
- * @code asio::spawn(my_strand, do_echo);
+ * @code asio::spawn(my_strand, do_echo, asio::detached);
*
* // ...
*
@@ -190,23 +372,363 @@ typedef basic_yield_context<
*/
/*@{*/
-/// Start a new stackful coroutine, calling the specified handler when it
-/// completes.
+/// Start a new stackful coroutine that executes on a given executor.
+/**
+ * This function is used to launch a new stackful coroutine.
+ *
+ * @param ex Identifies the executor that will run the stackful coroutine.
+ *
+ * @param function The coroutine function. The function must be callable the
+ * signature:
+ * @code void function(basic_yield_context<Executor> yield); @endcode
+ *
+ * @param token The @ref completion_token that will handle the notification
+ * that the coroutine has completed. If the return type @c R of @c function is
+ * @c void, the function signature of the completion handler must be:
+ *
+ * @code void handler(std::exception_ptr); @endcode
+ * Otherwise, the function signature of the completion handler must be:
+ * @code void handler(std::exception_ptr, R); @endcode
+ *
+ * @par Completion Signature
+ * @code void(std::exception_ptr, R) @endcode
+ * where @c R is the return type of the function object.
+ *
+ * @par Per-Operation Cancellation
+ * The new thread of execution is created with a cancellation state that
+ * supports @c cancellation_type::terminal values only. To change the
+ * cancellation state, call the basic_yield_context member function
+ * @c reset_cancellation_state.
+ */
+template <typename Executor, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type)
+ CompletionToken = default_completion_token_t<Executor>>
+auto spawn(const Executor& ex, F&& function,
+ CompletionToken&& token = default_completion_token_t<Executor>(),
+#if defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ !is_same<
+ decay_t<CompletionToken>,
+ boost::coroutines::attributes
+ >::value
+ > = 0,
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ > = 0)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ declval<detail::initiate_spawn<Executor>>(),
+ token, static_cast<F&&>(function)));
+
+/// Start a new stackful coroutine that executes on a given execution context.
+/**
+ * This function is used to launch a new stackful coroutine.
+ *
+ * @param ctx Identifies the execution context that will run the stackful
+ * coroutine.
+ *
+ * @param function The coroutine function. The function must be callable the
+ * signature:
+ * @code void function(basic_yield_context<Executor> yield); @endcode
+ *
+ * @param token The @ref completion_token that will handle the notification
+ * that the coroutine has completed. If the return type @c R of @c function is
+ * @c void, the function signature of the completion handler must be:
+ *
+ * @code void handler(std::exception_ptr); @endcode
+ * Otherwise, the function signature of the completion handler must be:
+ * @code void handler(std::exception_ptr, R); @endcode
+ *
+ * @par Completion Signature
+ * @code void(std::exception_ptr, R) @endcode
+ * where @c R is the return type of the function object.
+ *
+ * @par Per-Operation Cancellation
+ * The new thread of execution is created with a cancellation state that
+ * supports @c cancellation_type::terminal values only. To change the
+ * cancellation state, call the basic_yield_context member function
+ * @c reset_cancellation_state.
+ */
+template <typename ExecutionContext, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<
+ typename ExecutionContext::executor_type>)>>::type)
+ CompletionToken = default_completion_token_t<
+ typename ExecutionContext::executor_type>>
+auto spawn(ExecutionContext& ctx, F&& function,
+ CompletionToken&& token
+ = default_completion_token_t<typename ExecutionContext::executor_type>(),
+#if defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ !is_same<
+ decay_t<CompletionToken>,
+ boost::coroutines::attributes
+ >::value
+ > = 0,
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<
+ typename ExecutionContext::executor_type>)>>::type>(
+ declval<detail::initiate_spawn<
+ typename ExecutionContext::executor_type>>(),
+ token, static_cast<F&&>(function)));
+
+/// Start a new stackful coroutine, inheriting the executor of another.
+/**
+ * This function is used to launch a new stackful coroutine.
+ *
+ * @param ctx Identifies the current coroutine as a parent of the new
+ * coroutine. This specifies that the new coroutine should inherit the executor
+ * of the parent. For example, if the parent coroutine is executing in a
+ * particular strand, then the new coroutine will execute in the same strand.
+ *
+ * @param function The coroutine function. The function must be callable the
+ * signature:
+ * @code void function(basic_yield_context<Executor> yield); @endcode
+ *
+ * @param token The @ref completion_token that will handle the notification
+ * that the coroutine has completed. If the return type @c R of @c function is
+ * @c void, the function signature of the completion handler must be:
+ *
+ * @code void handler(std::exception_ptr); @endcode
+ * Otherwise, the function signature of the completion handler must be:
+ * @code void handler(std::exception_ptr, R); @endcode
+ *
+ * @par Completion Signature
+ * @code void(std::exception_ptr, R) @endcode
+ * where @c R is the return type of the function object.
+ *
+ * @par Per-Operation Cancellation
+ * The new thread of execution is created with a cancellation state that
+ * supports @c cancellation_type::terminal values only. To change the
+ * cancellation state, call the basic_yield_context member function
+ * @c reset_cancellation_state.
+ */
+template <typename Executor, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type)
+ CompletionToken = default_completion_token_t<Executor>>
+auto spawn(const basic_yield_context<Executor>& ctx, F&& function,
+ CompletionToken&& token = default_completion_token_t<Executor>(),
+#if defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ !is_same<
+ decay_t<CompletionToken>,
+ boost::coroutines::attributes
+ >::value
+ > = 0,
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ > = 0)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ declval<detail::initiate_spawn<Executor>>(),
+ token, static_cast<F&&>(function)));
+
+#if defined(ASIO_HAS_BOOST_CONTEXT_FIBER) \
+ || defined(GENERATING_DOCUMENTATION)
+
+/// Start a new stackful coroutine that executes on a given executor.
+/**
+ * This function is used to launch a new stackful coroutine using the
+ * specified stack allocator.
+ *
+ * @param ex Identifies the executor that will run the stackful coroutine.
+ *
+ * @param stack_allocator Denotes the allocator to be used to allocate the
+ * underlying coroutine's stack. The type must satisfy the stack-allocator
+ * concept defined by the Boost.Context library.
+ *
+ * @param function The coroutine function. The function must be callable the
+ * signature:
+ * @code void function(basic_yield_context<Executor> yield); @endcode
+ *
+ * @param token The @ref completion_token that will handle the notification
+ * that the coroutine has completed. If the return type @c R of @c function is
+ * @c void, the function signature of the completion handler must be:
+ *
+ * @code void handler(std::exception_ptr); @endcode
+ * Otherwise, the function signature of the completion handler must be:
+ * @code void handler(std::exception_ptr, R); @endcode
+ *
+ * @par Completion Signature
+ * @code void(std::exception_ptr, R) @endcode
+ * where @c R is the return type of the function object.
+ *
+ * @par Per-Operation Cancellation
+ * The new thread of execution is created with a cancellation state that
+ * supports @c cancellation_type::terminal values only. To change the
+ * cancellation state, call the basic_yield_context member function
+ * @c reset_cancellation_state.
+ */
+template <typename Executor, typename StackAllocator, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type)
+ CompletionToken = default_completion_token_t<Executor>>
+auto spawn(const Executor& ex, allocator_arg_t,
+ StackAllocator&& stack_allocator, F&& function,
+ CompletionToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ > = 0)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ declval<detail::initiate_spawn<Executor>>(),
+ token, allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ static_cast<F&&>(function)));
+
+/// Start a new stackful coroutine that executes on a given execution context.
+/**
+ * This function is used to launch a new stackful coroutine.
+ *
+ * @param ctx Identifies the execution context that will run the stackful
+ * coroutine.
+ *
+ * @param stack_allocator Denotes the allocator to be used to allocate the
+ * underlying coroutine's stack. The type must satisfy the stack-allocator
+ * concept defined by the Boost.Context library.
+ *
+ * @param function The coroutine function. The function must be callable the
+ * signature:
+ * @code void function(basic_yield_context<Executor> yield); @endcode
+ *
+ * @param token The @ref completion_token that will handle the notification
+ * that the coroutine has completed. If the return type @c R of @c function is
+ * @c void, the function signature of the completion handler must be:
+ *
+ * @code void handler(std::exception_ptr); @endcode
+ * Otherwise, the function signature of the completion handler must be:
+ * @code void handler(std::exception_ptr, R); @endcode
+ *
+ * @par Completion Signature
+ * @code void(std::exception_ptr, R) @endcode
+ * where @c R is the return type of the function object.
+ *
+ * @par Per-Operation Cancellation
+ * The new thread of execution is created with a cancellation state that
+ * supports @c cancellation_type::terminal values only. To change the
+ * cancellation state, call the basic_yield_context member function
+ * @c reset_cancellation_state.
+ */
+template <typename ExecutionContext, typename StackAllocator, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<
+ typename ExecutionContext::executor_type>)>>::type)
+ CompletionToken = default_completion_token_t<
+ typename ExecutionContext::executor_type>>
+auto spawn(ExecutionContext& ctx, allocator_arg_t,
+ StackAllocator&& stack_allocator, F&& function,
+ CompletionToken&& token
+ = default_completion_token_t<typename ExecutionContext::executor_type>(),
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<
+ typename ExecutionContext::executor_type>)>>::type>(
+ declval<detail::initiate_spawn<
+ typename ExecutionContext::executor_type>>(),
+ token, allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ static_cast<F&&>(function)));
+
+/// Start a new stackful coroutine, inheriting the executor of another.
+/**
+ * This function is used to launch a new stackful coroutine using the
+ * specified stack allocator.
+ *
+ * @param ctx Identifies the current coroutine as a parent of the new
+ * coroutine. This specifies that the new coroutine should inherit the
+ * executor of the parent. For example, if the parent coroutine is executing
+ * in a particular strand, then the new coroutine will execute in the same
+ * strand.
+ *
+ * @param stack_allocator Denotes the allocator to be used to allocate the
+ * underlying coroutine's stack. The type must satisfy the stack-allocator
+ * concept defined by the Boost.Context library.
+ *
+ * @param function The coroutine function. The function must be callable the
+ * signature:
+ * @code void function(basic_yield_context<Executor> yield); @endcode
+ *
+ * @param token The @ref completion_token that will handle the notification
+ * that the coroutine has completed. If the return type @c R of @c function is
+ * @c void, the function signature of the completion handler must be:
+ *
+ * @code void handler(std::exception_ptr); @endcode
+ * Otherwise, the function signature of the completion handler must be:
+ * @code void handler(std::exception_ptr, R); @endcode
+ *
+ * @par Completion Signature
+ * @code void(std::exception_ptr, R) @endcode
+ * where @c R is the return type of the function object.
+ *
+ * @par Per-Operation Cancellation
+ * The new thread of execution is created with a cancellation state that
+ * supports @c cancellation_type::terminal values only. To change the
+ * cancellation state, call the basic_yield_context member function
+ * @c reset_cancellation_state.
+ */
+template <typename Executor, typename StackAllocator, typename F,
+ ASIO_COMPLETION_TOKEN_FOR(typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type)
+ CompletionToken = default_completion_token_t<Executor>>
+auto spawn(const basic_yield_context<Executor>& ctx, allocator_arg_t,
+ StackAllocator&& stack_allocator, F&& function,
+ CompletionToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ > = 0)
+ -> decltype(
+ async_initiate<CompletionToken,
+ typename detail::spawn_signature<
+ result_of_t<F(basic_yield_context<Executor>)>>::type>(
+ declval<detail::initiate_spawn<Executor>>(),
+ token, allocator_arg_t(),
+ static_cast<StackAllocator&&>(stack_allocator),
+ static_cast<F&&>(function)));
+
+#endif // defined(ASIO_HAS_BOOST_CONTEXT_FIBER)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#if defined(ASIO_HAS_BOOST_COROUTINE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+/// (Deprecated: Use overloads with a completion token.) Start a new stackful
+/// coroutine, calling the specified handler when it completes.
/**
* This function is used to launch a new coroutine.
*
* @param function The coroutine function. The function must have the signature:
- * @code void function(basic_yield_context<Handler> yield); @endcode
+ * @code void function(basic_yield_context<Executor> yield); @endcode
+ * where Executor is the associated executor type of @c Function.
*
* @param attributes Boost.Coroutine attributes used to customise the coroutine.
*/
template <typename Function>
-void spawn(ASIO_MOVE_ARG(Function) function,
+void spawn(Function&& function,
const boost::coroutines::attributes& attributes
= boost::coroutines::attributes());
-/// Start a new stackful coroutine, calling the specified handler when it
-/// completes.
+/// (Deprecated: Use overloads with a completion token.) Start a new stackful
+/// coroutine, calling the specified handler when it completes.
/**
* This function is used to launch a new coroutine.
*
@@ -216,21 +738,23 @@ void spawn(ASIO_MOVE_ARG(Function) function,
* @code void handler(); @endcode
*
* @param function The coroutine function. The function must have the signature:
- * @code void function(basic_yield_context<Handler> yield); @endcode
+ * @code void function(basic_yield_context<Executor> yield); @endcode
+ * where Executor is the associated executor type of @c Handler.
*
* @param attributes Boost.Coroutine attributes used to customise the coroutine.
*/
template <typename Handler, typename Function>
-void spawn(ASIO_MOVE_ARG(Handler) handler,
- ASIO_MOVE_ARG(Function) function,
+void spawn(Handler&& handler, Function&& function,
const boost::coroutines::attributes& attributes
= boost::coroutines::attributes(),
- typename constraint<
- !is_executor<typename decay<Handler>::type>::value &&
- !execution::is_executor<typename decay<Handler>::type>::value &&
- !is_convertible<Handler&, execution_context&>::value>::type = 0);
+ constraint_t<
+ !is_executor<decay_t<Handler>>::value &&
+ !execution::is_executor<decay_t<Handler>>::value &&
+ !is_convertible<Handler&, execution_context&>::value
+ > = 0);
-/// Start a new stackful coroutine, inheriting the execution context of another.
+/// (Deprecated: Use overloads with a completion token.) Start a new stackful
+/// coroutine, inheriting the execution context of another.
/**
* This function is used to launch a new coroutine.
*
@@ -241,22 +765,23 @@ void spawn(ASIO_MOVE_ARG(Handler) handler,
* same strand.
*
* @param function The coroutine function. The function must have the signature:
- * @code void function(basic_yield_context<Handler> yield); @endcode
+ * @code void function(basic_yield_context<Executor> yield); @endcode
*
* @param attributes Boost.Coroutine attributes used to customise the coroutine.
*/
-template <typename Handler, typename Function>
-void spawn(basic_yield_context<Handler> ctx,
- ASIO_MOVE_ARG(Function) function,
+template <typename Executor, typename Function>
+void spawn(basic_yield_context<Executor> ctx, Function&& function,
const boost::coroutines::attributes& attributes
= boost::coroutines::attributes());
-/// Start a new stackful coroutine that executes on a given executor.
+/// (Deprecated: Use overloads with a completion token.) Start a new stackful
+/// coroutine that executes on a given executor.
/**
* This function is used to launch a new coroutine.
*
* @param ex Identifies the executor that will run the coroutine. The new
- * coroutine is implicitly given its own strand within this executor.
+ * coroutine is automatically given its own explicit strand within this
+ * executor.
*
* @param function The coroutine function. The function must have the signature:
* @code void function(yield_context yield); @endcode
@@ -264,15 +789,15 @@ void spawn(basic_yield_context<Handler> ctx,
* @param attributes Boost.Coroutine attributes used to customise the coroutine.
*/
template <typename Function, typename Executor>
-void spawn(const Executor& ex,
- ASIO_MOVE_ARG(Function) function,
+void spawn(const Executor& ex, Function&& function,
const boost::coroutines::attributes& attributes
= boost::coroutines::attributes(),
- typename constraint<
+ constraint_t<
is_executor<Executor>::value || execution::is_executor<Executor>::value
- >::type = 0);
+ > = 0);
-/// Start a new stackful coroutine that executes on a given strand.
+/// (Deprecated: Use overloads with a completion token.) Start a new stackful
+/// coroutine that executes on a given strand.
/**
* This function is used to launch a new coroutine.
*
@@ -284,14 +809,14 @@ void spawn(const Executor& ex,
* @param attributes Boost.Coroutine attributes used to customise the coroutine.
*/
template <typename Function, typename Executor>
-void spawn(const strand<Executor>& ex,
- ASIO_MOVE_ARG(Function) function,
+void spawn(const strand<Executor>& ex, Function&& function,
const boost::coroutines::attributes& attributes
= boost::coroutines::attributes());
#if !defined(ASIO_NO_TS_EXECUTORS)
-/// Start a new stackful coroutine that executes in the context of a strand.
+/// (Deprecated: Use overloads with a completion token.) Start a new stackful
+/// coroutine that executes in the context of a strand.
/**
* This function is used to launch a new coroutine.
*
@@ -305,14 +830,14 @@ void spawn(const strand<Executor>& ex,
* @param attributes Boost.Coroutine attributes used to customise the coroutine.
*/
template <typename Function>
-void spawn(const asio::io_context::strand& s,
- ASIO_MOVE_ARG(Function) function,
+void spawn(const asio::io_context::strand& s, Function&& function,
const boost::coroutines::attributes& attributes
= boost::coroutines::attributes());
#endif // !defined(ASIO_NO_TS_EXECUTORS)
-/// Start a new stackful coroutine that executes on a given execution context.
+/// (Deprecated: Use overloads with a completion token.) Start a new stackful
+/// coroutine that executes on a given execution context.
/**
* This function is used to launch a new coroutine.
*
@@ -326,12 +851,15 @@ void spawn(const asio::io_context::strand& s,
* @param attributes Boost.Coroutine attributes used to customise the coroutine.
*/
template <typename Function, typename ExecutionContext>
-void spawn(ExecutionContext& ctx,
- ASIO_MOVE_ARG(Function) function,
+void spawn(ExecutionContext& ctx, Function&& function,
const boost::coroutines::attributes& attributes
= boost::coroutines::attributes(),
- typename constraint<is_convertible<
- ExecutionContext&, execution_context&>::value>::type = 0);
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0);
+
+#endif // defined(ASIO_HAS_BOOST_COROUTINE)
+ // || defined(GENERATING_DOCUMENTATION)
/*@}*/
diff --git a/3rdparty/asio/include/asio/ssl.hpp b/3rdparty/asio/include/asio/ssl.hpp
index 79764367db2..4180dab6f42 100644
--- a/3rdparty/asio/include/asio/ssl.hpp
+++ b/3rdparty/asio/include/asio/ssl.hpp
@@ -2,7 +2,7 @@
// ssl.hpp
// ~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/context.hpp b/3rdparty/asio/include/asio/ssl/context.hpp
index 7360c33cef3..a41904a4089 100644
--- a/3rdparty/asio/include/asio/ssl/context.hpp
+++ b/3rdparty/asio/include/asio/ssl/context.hpp
@@ -2,7 +2,7 @@
// ssl/context.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -46,7 +46,6 @@ public:
/// Construct to take ownership of a native handle.
ASIO_DECL explicit context(native_handle_type native_handle);
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a context from another.
/**
* This constructor moves an SSL context from one object to another.
@@ -72,7 +71,6 @@ public:
* @li As a target for move-assignment.
*/
ASIO_DECL context& operator=(context&& other);
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destructor.
ASIO_DECL ~context();
@@ -741,6 +739,9 @@ private:
// Helper function to make a BIO from a memory buffer.
ASIO_DECL BIO* make_buffer_bio(const const_buffer& b);
+ // Translate an SSL error into an error code.
+ ASIO_DECL static asio::error_code translate_error(long error);
+
// The underlying native implementation.
native_handle_type handle_;
diff --git a/3rdparty/asio/include/asio/ssl/context_base.hpp b/3rdparty/asio/include/asio/ssl/context_base.hpp
index fe7946e38ef..36271012b06 100644
--- a/3rdparty/asio/include/asio/ssl/context_base.hpp
+++ b/3rdparty/asio/include/asio/ssl/context_base.hpp
@@ -2,7 +2,7 @@
// ssl/context_base.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -105,60 +105,60 @@ public:
};
/// Bitmask type for SSL options.
- typedef long options;
+ typedef uint64_t options;
#if defined(GENERATING_DOCUMENTATION)
/// Implement various bug workarounds.
- static const long default_workarounds = implementation_defined;
+ static const uint64_t default_workarounds = implementation_defined;
/// Always create a new key when using tmp_dh parameters.
- static const long single_dh_use = implementation_defined;
+ static const uint64_t single_dh_use = implementation_defined;
/// Disable SSL v2.
- static const long no_sslv2 = implementation_defined;
+ static const uint64_t no_sslv2 = implementation_defined;
/// Disable SSL v3.
- static const long no_sslv3 = implementation_defined;
+ static const uint64_t no_sslv3 = implementation_defined;
/// Disable TLS v1.
- static const long no_tlsv1 = implementation_defined;
+ static const uint64_t no_tlsv1 = implementation_defined;
/// Disable TLS v1.1.
- static const long no_tlsv1_1 = implementation_defined;
+ static const uint64_t no_tlsv1_1 = implementation_defined;
/// Disable TLS v1.2.
- static const long no_tlsv1_2 = implementation_defined;
+ static const uint64_t no_tlsv1_2 = implementation_defined;
/// Disable TLS v1.3.
- static const long no_tlsv1_3 = implementation_defined;
+ static const uint64_t no_tlsv1_3 = implementation_defined;
/// Disable compression. Compression is disabled by default.
- static const long no_compression = implementation_defined;
+ static const uint64_t no_compression = implementation_defined;
#else
- ASIO_STATIC_CONSTANT(long, default_workarounds = SSL_OP_ALL);
- ASIO_STATIC_CONSTANT(long, single_dh_use = SSL_OP_SINGLE_DH_USE);
- ASIO_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2);
- ASIO_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3);
- ASIO_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1);
+ ASIO_STATIC_CONSTANT(uint64_t, default_workarounds = SSL_OP_ALL);
+ ASIO_STATIC_CONSTANT(uint64_t, single_dh_use = SSL_OP_SINGLE_DH_USE);
+ ASIO_STATIC_CONSTANT(uint64_t, no_sslv2 = SSL_OP_NO_SSLv2);
+ ASIO_STATIC_CONSTANT(uint64_t, no_sslv3 = SSL_OP_NO_SSLv3);
+ ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1 = SSL_OP_NO_TLSv1);
# if defined(SSL_OP_NO_TLSv1_1)
- ASIO_STATIC_CONSTANT(long, no_tlsv1_1 = SSL_OP_NO_TLSv1_1);
+ ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_1 = SSL_OP_NO_TLSv1_1);
# else // defined(SSL_OP_NO_TLSv1_1)
- ASIO_STATIC_CONSTANT(long, no_tlsv1_1 = 0x10000000L);
+ ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_1 = 0x10000000L);
# endif // defined(SSL_OP_NO_TLSv1_1)
# if defined(SSL_OP_NO_TLSv1_2)
- ASIO_STATIC_CONSTANT(long, no_tlsv1_2 = SSL_OP_NO_TLSv1_2);
+ ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_2 = SSL_OP_NO_TLSv1_2);
# else // defined(SSL_OP_NO_TLSv1_2)
- ASIO_STATIC_CONSTANT(long, no_tlsv1_2 = 0x08000000L);
+ ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_2 = 0x08000000L);
# endif // defined(SSL_OP_NO_TLSv1_2)
# if defined(SSL_OP_NO_TLSv1_3)
- ASIO_STATIC_CONSTANT(long, no_tlsv1_3 = SSL_OP_NO_TLSv1_3);
+ ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_3 = SSL_OP_NO_TLSv1_3);
# else // defined(SSL_OP_NO_TLSv1_3)
- ASIO_STATIC_CONSTANT(long, no_tlsv1_3 = 0x20000000L);
+ ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_3 = 0x20000000L);
# endif // defined(SSL_OP_NO_TLSv1_3)
# if defined(SSL_OP_NO_COMPRESSION)
- ASIO_STATIC_CONSTANT(long, no_compression = SSL_OP_NO_COMPRESSION);
+ ASIO_STATIC_CONSTANT(uint64_t, no_compression = SSL_OP_NO_COMPRESSION);
# else // defined(SSL_OP_NO_COMPRESSION)
- ASIO_STATIC_CONSTANT(long, no_compression = 0x20000L);
+ ASIO_STATIC_CONSTANT(uint64_t, no_compression = 0x20000L);
# endif // defined(SSL_OP_NO_COMPRESSION)
#endif
diff --git a/3rdparty/asio/include/asio/ssl/detail/buffered_handshake_op.hpp b/3rdparty/asio/include/asio/ssl/detail/buffered_handshake_op.hpp
index ee1e32d36fc..4dba7120929 100644
--- a/3rdparty/asio/include/asio/ssl/detail/buffered_handshake_op.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/buffered_handshake_op.hpp
@@ -2,7 +2,7 @@
// ssl/detail/buffered_handshake_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -29,7 +29,7 @@ template <typename ConstBufferSequence>
class buffered_handshake_op
{
public:
- static ASIO_CONSTEXPR const char* tracking_name()
+ static constexpr const char* tracking_name()
{
return "ssl::stream<>::async_buffered_handshake";
}
@@ -56,7 +56,7 @@ public:
const asio::error_code& ec,
const std::size_t& bytes_transferred) const
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler)(ec, bytes_transferred);
+ static_cast<Handler&&>(handler)(ec, bytes_transferred);
}
private:
diff --git a/3rdparty/asio/include/asio/ssl/detail/engine.hpp b/3rdparty/asio/include/asio/ssl/detail/engine.hpp
index 40799330b73..e500ca529da 100644
--- a/3rdparty/asio/include/asio/ssl/detail/engine.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/engine.hpp
@@ -2,7 +2,7 @@
// ssl/detail/engine.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -58,18 +58,17 @@ public:
// Construct a new engine for the specified context.
ASIO_DECL explicit engine(SSL_CTX* context);
-#if defined(ASIO_HAS_MOVE)
+ // Construct a new engine for an existing native SSL implementation.
+ ASIO_DECL explicit engine(SSL* ssl_impl);
+
// Move construct from another engine.
- ASIO_DECL engine(engine&& other) ASIO_NOEXCEPT;
-#endif // defined(ASIO_HAS_MOVE)
+ ASIO_DECL engine(engine&& other) noexcept;
// Destructor.
ASIO_DECL ~engine();
-#if defined(ASIO_HAS_MOVE)
// Move assign from another engine.
- ASIO_DECL engine& operator=(engine&& other) ASIO_NOEXCEPT;
-#endif // defined(ASIO_HAS_MOVE)
+ ASIO_DECL engine& operator=(engine&& other) noexcept;
// Get the underlying implementation in the native type.
ASIO_DECL SSL* native_handle();
diff --git a/3rdparty/asio/include/asio/ssl/detail/handshake_op.hpp b/3rdparty/asio/include/asio/ssl/detail/handshake_op.hpp
index 74b624fde81..53533eb7a80 100644
--- a/3rdparty/asio/include/asio/ssl/detail/handshake_op.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/handshake_op.hpp
@@ -2,7 +2,7 @@
// ssl/detail/handshake_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -28,7 +28,7 @@ namespace detail {
class handshake_op
{
public:
- static ASIO_CONSTEXPR const char* tracking_name()
+ static constexpr const char* tracking_name()
{
return "ssl::stream<>::async_handshake";
}
@@ -51,7 +51,7 @@ public:
const asio::error_code& ec,
const std::size_t&) const
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler)(ec);
+ static_cast<Handler&&>(handler)(ec);
}
private:
diff --git a/3rdparty/asio/include/asio/ssl/detail/impl/engine.ipp b/3rdparty/asio/include/asio/ssl/detail/impl/engine.ipp
index 2c047389f00..91588cd6b47 100644
--- a/3rdparty/asio/include/asio/ssl/detail/impl/engine.ipp
+++ b/3rdparty/asio/include/asio/ssl/detail/impl/engine.ipp
@@ -2,7 +2,7 @@
// ssl/detail/impl/engine.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -55,15 +55,31 @@ engine::engine(SSL_CTX* context)
::SSL_set_bio(ssl_, int_bio, int_bio);
}
-#if defined(ASIO_HAS_MOVE)
-engine::engine(engine&& other) ASIO_NOEXCEPT
+engine::engine(SSL* ssl_impl)
+ : ssl_(ssl_impl)
+{
+#if (OPENSSL_VERSION_NUMBER < 0x10000000L)
+ accept_mutex().init();
+#endif // (OPENSSL_VERSION_NUMBER < 0x10000000L)
+
+ ::SSL_set_mode(ssl_, SSL_MODE_ENABLE_PARTIAL_WRITE);
+ ::SSL_set_mode(ssl_, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+#if defined(SSL_MODE_RELEASE_BUFFERS)
+ ::SSL_set_mode(ssl_, SSL_MODE_RELEASE_BUFFERS);
+#endif // defined(SSL_MODE_RELEASE_BUFFERS)
+
+ ::BIO* int_bio = 0;
+ ::BIO_new_bio_pair(&int_bio, 0, &ext_bio_, 0);
+ ::SSL_set_bio(ssl_, int_bio, int_bio);
+}
+
+engine::engine(engine&& other) noexcept
: ssl_(other.ssl_),
ext_bio_(other.ext_bio_)
{
other.ssl_ = 0;
other.ext_bio_ = 0;
}
-#endif // defined(ASIO_HAS_MOVE)
engine::~engine()
{
@@ -80,8 +96,7 @@ engine::~engine()
::SSL_free(ssl_);
}
-#if defined(ASIO_HAS_MOVE)
-engine& engine::operator=(engine&& other) ASIO_NOEXCEPT
+engine& engine::operator=(engine&& other) noexcept
{
if (this != &other)
{
@@ -92,7 +107,6 @@ engine& engine::operator=(engine&& other) ASIO_NOEXCEPT
}
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
SSL* engine::native_handle()
{
diff --git a/3rdparty/asio/include/asio/ssl/detail/impl/openssl_init.ipp b/3rdparty/asio/include/asio/ssl/detail/impl/openssl_init.ipp
index 2c38e03a1f0..7a10cc2aa8a 100644
--- a/3rdparty/asio/include/asio/ssl/detail/impl/openssl_init.ipp
+++ b/3rdparty/asio/include/asio/ssl/detail/impl/openssl_init.ipp
@@ -3,7 +3,7 @@
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -85,9 +85,13 @@ public:
#endif // (OPENSSL_VERSION_NUMBER >= 0x10002000L)
// && (OPENSSL_VERSION_NUMBER < 0x10100000L)
// && !defined(SSL_OP_NO_COMPRESSION)
-#if !defined(OPENSSL_IS_BORINGSSL) && !defined(ASIO_USE_WOLFSSL)
+#if !defined(OPENSSL_IS_BORINGSSL) \
+ && !defined(ASIO_USE_WOLFSSL) \
+ && (OPENSSL_VERSION_NUMBER < 0x30000000L)
::CONF_modules_unload(1);
-#endif // !defined(OPENSSL_IS_BORINGSSL) && !defined(ASIO_USE_WOLFSSL)
+#endif // !defined(OPENSSL_IS_BORINGSSL)
+ // && !defined(ASIO_USE_WOLFSSL)
+ // && (OPENSSL_VERSION_NUMBER < 0x30000000L)
#if !defined(OPENSSL_NO_ENGINE) \
&& (OPENSSL_VERSION_NUMBER < 0x10100000L)
::ENGINE_cleanup();
@@ -130,7 +134,7 @@ private:
// Mutexes to be used in locking callbacks.
std::vector<asio::detail::shared_ptr<
- asio::detail::mutex> > mutexes_;
+ asio::detail::mutex>> mutexes_;
#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L)
#if !defined(SSL_OP_NO_COMPRESSION) \
diff --git a/3rdparty/asio/include/asio/ssl/detail/io.hpp b/3rdparty/asio/include/asio/ssl/detail/io.hpp
index b8c85dc6b53..d951db593af 100644
--- a/3rdparty/asio/include/asio/ssl/detail/io.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/io.hpp
@@ -2,7 +2,7 @@
// ssl/detail/io.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -107,11 +107,10 @@ public:
start_(0),
want_(engine::want_nothing),
bytes_transferred_(0),
- handler_(ASIO_MOVE_CAST(Handler)(handler))
+ handler_(static_cast<Handler&&>(handler))
{
}
-#if defined(ASIO_HAS_MOVE)
io_op(const io_op& other)
: asio::detail::base_from_cancellation_state<Handler>(other),
next_layer_(other.next_layer_),
@@ -127,20 +126,18 @@ public:
io_op(io_op&& other)
: asio::detail::base_from_cancellation_state<Handler>(
- ASIO_MOVE_CAST(
- asio::detail::base_from_cancellation_state<Handler>)(
- other)),
+ static_cast<
+ asio::detail::base_from_cancellation_state<Handler>&&>(other)),
next_layer_(other.next_layer_),
core_(other.core_),
- op_(ASIO_MOVE_CAST(Operation)(other.op_)),
+ op_(static_cast<Operation&&>(other.op_)),
start_(other.start_),
want_(other.want_),
ec_(other.ec_),
bytes_transferred_(other.bytes_transferred_),
- handler_(ASIO_MOVE_CAST(Handler)(other.handler_))
+ handler_(static_cast<Handler&&>(other.handler_))
{
}
-#endif // defined(ASIO_HAS_MOVE)
void operator()(asio::error_code ec,
std::size_t bytes_transferred = ~std::size_t(0), int start = 0)
@@ -177,7 +174,7 @@ public:
// Start reading some data from the underlying transport.
next_layer_.async_read_some(
asio::buffer(core_.input_buffer_),
- ASIO_MOVE_CAST(io_op)(*this));
+ static_cast<io_op&&>(*this));
}
else
{
@@ -185,7 +182,7 @@ public:
__FILE__, __LINE__, Operation::tracking_name()));
// Wait until the current read operation completes.
- core_.pending_read_.async_wait(ASIO_MOVE_CAST(io_op)(*this));
+ core_.pending_read_.async_wait(static_cast<io_op&&>(*this));
}
// Yield control until asynchronous operation completes. Control
@@ -210,7 +207,7 @@ public:
// Start writing all the data to the underlying transport.
asio::async_write(next_layer_,
core_.engine_.get_output(core_.output_buffer_),
- ASIO_MOVE_CAST(io_op)(*this));
+ static_cast<io_op&&>(*this));
}
else
{
@@ -218,7 +215,7 @@ public:
__FILE__, __LINE__, Operation::tracking_name()));
// Wait until the current write operation completes.
- core_.pending_write_.async_wait(ASIO_MOVE_CAST(io_op)(*this));
+ core_.pending_write_.async_wait(static_cast<io_op&&>(*this));
}
// Yield control until asynchronous operation completes. Control
@@ -239,7 +236,7 @@ public:
next_layer_.async_read_some(
asio::buffer(core_.input_buffer_, 0),
- ASIO_MOVE_CAST(io_op)(*this));
+ static_cast<io_op&&>(*this));
// Yield control until asynchronous operation completes. Control
// resumes at the "default:" label below.
@@ -331,32 +328,6 @@ public:
};
template <typename Stream, typename Operation, typename Handler>
-inline asio_handler_allocate_is_deprecated
-asio_handler_allocate(std::size_t size,
- io_op<Stream, Operation, Handler>* this_handler)
-{
-#if defined(ASIO_NO_DEPRECATED)
- asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
- return asio_handler_allocate_is_no_longer_used();
-#else // defined(ASIO_NO_DEPRECATED)
- return asio_handler_alloc_helpers::allocate(
- size, this_handler->handler_);
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Stream, typename Operation, typename Handler>
-inline asio_handler_deallocate_is_deprecated
-asio_handler_deallocate(void* pointer, std::size_t size,
- io_op<Stream, Operation, Handler>* this_handler)
-{
- asio_handler_alloc_helpers::deallocate(
- pointer, size, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_deallocate_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Stream, typename Operation, typename Handler>
inline bool asio_handler_is_continuation(
io_op<Stream, Operation, Handler>* this_handler)
{
@@ -364,32 +335,6 @@ inline bool asio_handler_is_continuation(
: asio_handler_cont_helpers::is_continuation(this_handler->handler_);
}
-template <typename Function, typename Stream,
- typename Operation, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(Function& function,
- io_op<Stream, Operation, Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
-template <typename Function, typename Stream,
- typename Operation, typename Handler>
-inline asio_handler_invoke_is_deprecated
-asio_handler_invoke(const Function& function,
- io_op<Stream, Operation, Handler>* this_handler)
-{
- asio_handler_invoke_helpers::invoke(
- function, this_handler->handler_);
-#if defined(ASIO_NO_DEPRECATED)
- return asio_handler_invoke_is_no_longer_used();
-#endif // defined(ASIO_NO_DEPRECATED)
-}
-
template <typename Stream, typename Operation, typename Handler>
inline void async_io(Stream& next_layer, stream_core& core,
const Operation& op, Handler& handler)
@@ -411,8 +356,14 @@ struct associator<Associator,
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const ssl::detail::io_op<Stream, Operation, Handler>& h,
- const DefaultCandidate& c = DefaultCandidate()) ASIO_NOEXCEPT
+ const ssl::detail::io_op<Stream, Operation, Handler>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const ssl::detail::io_op<Stream, Operation, Handler>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
}
diff --git a/3rdparty/asio/include/asio/ssl/detail/openssl_init.hpp b/3rdparty/asio/include/asio/ssl/detail/openssl_init.hpp
index 8921bb64137..c66d9d62692 100644
--- a/3rdparty/asio/include/asio/ssl/detail/openssl_init.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/openssl_init.hpp
@@ -2,7 +2,7 @@
// ssl/detail/openssl_init.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/detail/openssl_types.hpp b/3rdparty/asio/include/asio/ssl/detail/openssl_types.hpp
index 0b1b8f90b1d..25f080f1e8e 100644
--- a/3rdparty/asio/include/asio/ssl/detail/openssl_types.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/openssl_types.hpp
@@ -2,7 +2,7 @@
// ssl/detail/openssl_types.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/detail/password_callback.hpp b/3rdparty/asio/include/asio/ssl/detail/password_callback.hpp
index 0e5e39824ef..03ac7db0f06 100644
--- a/3rdparty/asio/include/asio/ssl/detail/password_callback.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/password_callback.hpp
@@ -2,7 +2,7 @@
// ssl/detail/password_callback.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/detail/read_op.hpp b/3rdparty/asio/include/asio/ssl/detail/read_op.hpp
index fb2cf62f84a..5cb4249556f 100644
--- a/3rdparty/asio/include/asio/ssl/detail/read_op.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/read_op.hpp
@@ -2,7 +2,7 @@
// ssl/detail/read_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -30,7 +30,7 @@ template <typename MutableBufferSequence>
class read_op
{
public:
- static ASIO_CONSTEXPR const char* tracking_name()
+ static constexpr const char* tracking_name()
{
return "ssl::stream<>::async_read_some";
}
@@ -56,7 +56,7 @@ public:
const asio::error_code& ec,
const std::size_t& bytes_transferred) const
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler)(ec, bytes_transferred);
+ static_cast<Handler&&>(handler)(ec, bytes_transferred);
}
private:
diff --git a/3rdparty/asio/include/asio/ssl/detail/shutdown_op.hpp b/3rdparty/asio/include/asio/ssl/detail/shutdown_op.hpp
index 2a8927db357..1f6b91e17c1 100644
--- a/3rdparty/asio/include/asio/ssl/detail/shutdown_op.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/shutdown_op.hpp
@@ -2,7 +2,7 @@
// ssl/detail/shutdown_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -28,7 +28,7 @@ namespace detail {
class shutdown_op
{
public:
- static ASIO_CONSTEXPR const char* tracking_name()
+ static constexpr const char* tracking_name()
{
return "ssl::stream<>::async_shutdown";
}
@@ -51,11 +51,11 @@ public:
// The engine only generates an eof when the shutdown notification has
// been received from the peer. This indicates that the shutdown has
// completed successfully, and thus need not be passed on to the handler.
- ASIO_MOVE_OR_LVALUE(Handler)(handler)(asio::error_code());
+ static_cast<Handler&&>(handler)(asio::error_code());
}
else
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler)(ec);
+ static_cast<Handler&&>(handler)(ec);
}
}
};
diff --git a/3rdparty/asio/include/asio/ssl/detail/stream_core.hpp b/3rdparty/asio/include/asio/ssl/detail/stream_core.hpp
index 27b77cf11f2..0ec763d4a2b 100644
--- a/3rdparty/asio/include/asio/ssl/detail/stream_core.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/stream_core.hpp
@@ -2,7 +2,7 @@
// ssl/detail/stream_core.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -51,30 +51,43 @@ struct stream_core
pending_write_.expires_at(neg_infin());
}
-#if defined(ASIO_HAS_MOVE)
+ template <typename Executor>
+ stream_core(SSL* ssl_impl, const Executor& ex)
+ : engine_(ssl_impl),
+ pending_read_(ex),
+ pending_write_(ex),
+ output_buffer_space_(max_tls_record_size),
+ output_buffer_(asio::buffer(output_buffer_space_)),
+ input_buffer_space_(max_tls_record_size),
+ input_buffer_(asio::buffer(input_buffer_space_))
+ {
+ pending_read_.expires_at(neg_infin());
+ pending_write_.expires_at(neg_infin());
+ }
+
stream_core(stream_core&& other)
- : engine_(ASIO_MOVE_CAST(engine)(other.engine_)),
+ : engine_(static_cast<engine&&>(other.engine_)),
#if defined(ASIO_HAS_BOOST_DATE_TIME)
pending_read_(
- ASIO_MOVE_CAST(asio::deadline_timer)(
+ static_cast<asio::deadline_timer&&>(
other.pending_read_)),
pending_write_(
- ASIO_MOVE_CAST(asio::deadline_timer)(
+ static_cast<asio::deadline_timer&&>(
other.pending_write_)),
#else // defined(ASIO_HAS_BOOST_DATE_TIME)
pending_read_(
- ASIO_MOVE_CAST(asio::steady_timer)(
+ static_cast<asio::steady_timer&&>(
other.pending_read_)),
pending_write_(
- ASIO_MOVE_CAST(asio::steady_timer)(
+ static_cast<asio::steady_timer&&>(
other.pending_write_)),
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
output_buffer_space_(
- ASIO_MOVE_CAST(std::vector<unsigned char>)(
+ static_cast<std::vector<unsigned char>&&>(
other.output_buffer_space_)),
output_buffer_(other.output_buffer_),
input_buffer_space_(
- ASIO_MOVE_CAST(std::vector<unsigned char>)(
+ static_cast<std::vector<unsigned char>&&>(
other.input_buffer_space_)),
input_buffer_(other.input_buffer_),
input_(other.input_)
@@ -83,40 +96,39 @@ struct stream_core
other.input_buffer_ = asio::mutable_buffer(0, 0);
other.input_ = asio::const_buffer(0, 0);
}
-#endif // defined(ASIO_HAS_MOVE)
~stream_core()
{
}
-#if defined(ASIO_HAS_MOVE)
stream_core& operator=(stream_core&& other)
{
if (this != &other)
{
- engine_ = ASIO_MOVE_CAST(engine)(other.engine_);
+ engine_ = static_cast<engine&&>(other.engine_);
#if defined(ASIO_HAS_BOOST_DATE_TIME)
pending_read_ =
- ASIO_MOVE_CAST(asio::deadline_timer)(
+ static_cast<asio::deadline_timer&&>(
other.pending_read_);
pending_write_ =
- ASIO_MOVE_CAST(asio::deadline_timer)(
+ static_cast<asio::deadline_timer&&>(
other.pending_write_);
#else // defined(ASIO_HAS_BOOST_DATE_TIME)
pending_read_ =
- ASIO_MOVE_CAST(asio::steady_timer)(
+ static_cast<asio::steady_timer&&>(
other.pending_read_);
pending_write_ =
- ASIO_MOVE_CAST(asio::steady_timer)(
+ static_cast<asio::steady_timer&&>(
other.pending_write_);
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
output_buffer_space_ =
- ASIO_MOVE_CAST(std::vector<unsigned char>)(
+ static_cast<std::vector<unsigned char>&&>(
other.output_buffer_space_);
output_buffer_ = other.output_buffer_;
input_buffer_space_ =
- ASIO_MOVE_CAST(std::vector<unsigned char>)(
+ static_cast<std::vector<unsigned char>&&>(
other.input_buffer_space_);
+ input_buffer_ = other.input_buffer_;
input_ = other.input_;
other.output_buffer_ = asio::mutable_buffer(0, 0);
other.input_buffer_ = asio::mutable_buffer(0, 0);
@@ -124,7 +136,6 @@ struct stream_core
}
return *this;
}
-#endif // defined(ASIO_HAS_MOVE)
// The SSL engine.
engine engine_;
diff --git a/3rdparty/asio/include/asio/ssl/detail/verify_callback.hpp b/3rdparty/asio/include/asio/ssl/detail/verify_callback.hpp
index 7f13fe49536..54169c9e6b8 100644
--- a/3rdparty/asio/include/asio/ssl/detail/verify_callback.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/verify_callback.hpp
@@ -1,8 +1,8 @@
//
// ssl/detail/verify_callback.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/detail/write_op.hpp b/3rdparty/asio/include/asio/ssl/detail/write_op.hpp
index 407995b4fad..edcbcad5850 100644
--- a/3rdparty/asio/include/asio/ssl/detail/write_op.hpp
+++ b/3rdparty/asio/include/asio/ssl/detail/write_op.hpp
@@ -2,7 +2,7 @@
// ssl/detail/write_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -30,7 +30,7 @@ template <typename ConstBufferSequence>
class write_op
{
public:
- static ASIO_CONSTEXPR const char* tracking_name()
+ static constexpr const char* tracking_name()
{
return "ssl::stream<>::async_write_some";
}
@@ -60,7 +60,7 @@ public:
const asio::error_code& ec,
const std::size_t& bytes_transferred) const
{
- ASIO_MOVE_OR_LVALUE(Handler)(handler)(ec, bytes_transferred);
+ static_cast<Handler&&>(handler)(ec, bytes_transferred);
}
private:
diff --git a/3rdparty/asio/include/asio/ssl/error.hpp b/3rdparty/asio/include/asio/ssl/error.hpp
index f1d1801cde4..e126f52c1c7 100644
--- a/3rdparty/asio/include/asio/ssl/error.hpp
+++ b/3rdparty/asio/include/asio/ssl/error.hpp
@@ -2,7 +2,7 @@
// ssl/error.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -77,7 +77,6 @@ static const asio::error_category&
} // namespace ssl
} // namespace asio
-#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
namespace std {
template<> struct is_error_code_enum<asio::error::ssl_errors>
@@ -91,7 +90,6 @@ template<> struct is_error_code_enum<asio::ssl::error::stream_errors>
};
} // namespace std
-#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
namespace asio {
namespace error {
diff --git a/3rdparty/asio/include/asio/ssl/host_name_verification.hpp b/3rdparty/asio/include/asio/ssl/host_name_verification.hpp
index 0aabac54893..adb6ac8c0f7 100644
--- a/3rdparty/asio/include/asio/ssl/host_name_verification.hpp
+++ b/3rdparty/asio/include/asio/ssl/host_name_verification.hpp
@@ -2,7 +2,7 @@
// ssl/host_name_verification.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/impl/context.hpp b/3rdparty/asio/include/asio/ssl/impl/context.hpp
index 1734e7bd262..2324a9880aa 100644
--- a/3rdparty/asio/include/asio/ssl/impl/context.hpp
+++ b/3rdparty/asio/include/asio/ssl/impl/context.hpp
@@ -3,7 +3,7 @@
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/impl/context.ipp b/3rdparty/asio/include/asio/ssl/impl/context.ipp
index 56f8d7d2775..8711048b9a7 100644
--- a/3rdparty/asio/include/asio/ssl/impl/context.ipp
+++ b/3rdparty/asio/include/asio/ssl/impl/context.ipp
@@ -3,7 +3,7 @@
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -47,6 +47,7 @@ struct context::evp_pkey_cleanup
~evp_pkey_cleanup() { if (p) ::EVP_PKEY_free(p); }
};
+#if (OPENSSL_VERSION_NUMBER < 0x30000000L)
struct context::rsa_cleanup
{
RSA* p;
@@ -58,6 +59,7 @@ struct context::dh_cleanup
DH* p;
~dh_cleanup() { if (p) ::DH_free(p); }
};
+#endif // (OPENSSL_VERSION_NUMBER < 0x30000000L)
context::context(context::method m)
: handle_(0)
@@ -357,9 +359,7 @@ context::context(context::method m)
if (handle_ == 0)
{
- asio::error_code ec(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ asio::error_code ec = translate_error(::ERR_get_error());
asio::detail::throw_error(ec, "context");
}
@@ -376,7 +376,6 @@ context::context(context::native_handle_type native_handle)
}
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
context::context(context&& other)
{
handle_ = other.handle_;
@@ -385,12 +384,11 @@ context::context(context&& other)
context& context::operator=(context&& other)
{
- context tmp(ASIO_MOVE_CAST(context)(*this));
+ context tmp(static_cast<context&&>(*this));
handle_ = other.handle_;
other.handle_ = 0;
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
context::~context()
{
@@ -545,9 +543,7 @@ ASIO_SYNC_OP_VOID context::load_verify_file(
if (::SSL_CTX_load_verify_locations(handle_, filename.c_str(), 0) != 1)
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -582,17 +578,13 @@ ASIO_SYNC_OP_VOID context::add_certificate_authority(
&& ERR_GET_REASON(err) == PEM_R_NO_START_LINE)
break;
- ec = asio::error_code(
- static_cast<int>(err),
- asio::error::get_ssl_category());
+ ec = translate_error(err);
ASIO_SYNC_OP_VOID_RETURN(ec);
}
if (::X509_STORE_add_cert(store, cert.p) != 1)
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
}
@@ -617,9 +609,7 @@ ASIO_SYNC_OP_VOID context::set_default_verify_paths(
if (::SSL_CTX_set_default_verify_paths(handle_) != 1)
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -641,9 +631,7 @@ ASIO_SYNC_OP_VOID context::add_verify_path(
if (::SSL_CTX_load_verify_locations(handle_, 0, path.c_str()) != 1)
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -697,9 +685,7 @@ ASIO_SYNC_OP_VOID context::use_certificate(
ASIO_SYNC_OP_VOID_RETURN(ec);
}
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -735,9 +721,7 @@ ASIO_SYNC_OP_VOID context::use_certificate_file(
if (::SSL_CTX_use_certificate_file(handle_, filename.c_str(), file_type) != 1)
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -776,17 +760,14 @@ ASIO_SYNC_OP_VOID context::use_certificate_chain(
cb_userdata) };
if (!cert.p)
{
- ec = asio::error_code(ERR_R_PEM_LIB,
- asio::error::get_ssl_category());
+ ec = translate_error(ERR_R_PEM_LIB);
ASIO_SYNC_OP_VOID_RETURN(ec);
}
int result = ::SSL_CTX_use_certificate(handle_, cert.p);
if (result == 0 || ::ERR_peek_error() != 0)
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -809,9 +790,7 @@ ASIO_SYNC_OP_VOID context::use_certificate_chain(
{
if (!::SSL_CTX_add_extra_chain_cert(handle_, cacert))
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
}
@@ -826,9 +805,7 @@ ASIO_SYNC_OP_VOID context::use_certificate_chain(
}
}
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -846,9 +823,7 @@ ASIO_SYNC_OP_VOID context::use_certificate_chain_file(
if (::SSL_CTX_use_certificate_chain_file(handle_, filename.c_str()) != 1)
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -912,9 +887,7 @@ ASIO_SYNC_OP_VOID context::use_private_key(
}
}
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -944,16 +917,51 @@ ASIO_SYNC_OP_VOID context::use_rsa_private_key(
&& (!defined(LIBRESSL_VERSION_NUMBER) \
|| LIBRESSL_VERSION_NUMBER >= 0x2070000fL)) \
|| defined(ASIO_USE_WOLFSSL)
- pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_);
- void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_);
+ pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_);
+ void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_);
#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L)
- pem_password_cb* callback = handle_->default_passwd_callback;
- void* cb_userdata = handle_->default_passwd_callback_userdata;
+ pem_password_cb* callback = handle_->default_passwd_callback;
+ void* cb_userdata = handle_->default_passwd_callback_userdata;
#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L)
bio_cleanup bio = { make_buffer_bio(private_key) };
if (bio.p)
{
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+ evp_pkey_cleanup evp_private_key = { 0 };
+ switch (format)
+ {
+ case context_base::asn1:
+ evp_private_key.p = ::d2i_PrivateKey_bio(bio.p, 0);
+ break;
+ case context_base::pem:
+ evp_private_key.p = ::PEM_read_bio_PrivateKey(
+ bio.p, 0, callback,
+ cb_userdata);
+ break;
+ default:
+ {
+ ec = asio::error::invalid_argument;
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+ }
+
+ if (evp_private_key.p)
+ {
+ if (::EVP_PKEY_is_a(evp_private_key.p, "RSA") == 0)
+ {
+ ec = translate_error(
+ ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_AN_RSA_KEY));
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ if (::SSL_CTX_use_PrivateKey(handle_, evp_private_key.p) == 1)
+ {
+ ec = asio::error_code();
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+ }
+#else // (OPENSSL_VERSION_NUMBER >= 0x30000000L)
rsa_cleanup rsa_private_key = { 0 };
switch (format)
{
@@ -980,11 +988,10 @@ ASIO_SYNC_OP_VOID context::use_rsa_private_key(
ASIO_SYNC_OP_VOID_RETURN(ec);
}
}
+#endif // (OPENSSL_VERSION_NUMBER >= 0x30000000L)
}
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -1012,9 +1019,7 @@ ASIO_SYNC_OP_VOID context::use_private_key_file(
if (::SSL_CTX_use_PrivateKey_file(handle_, filename.c_str(), file_type) != 1)
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -1034,6 +1039,53 @@ ASIO_SYNC_OP_VOID context::use_rsa_private_key_file(
const std::string& filename, context::file_format format,
asio::error_code& ec)
{
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+ ::ERR_clear_error();
+
+ pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_);
+ void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_);
+
+ bio_cleanup bio = { ::BIO_new_file(filename.c_str(), "r") };
+ if (bio.p)
+ {
+ evp_pkey_cleanup evp_private_key = { 0 };
+ switch (format)
+ {
+ case context_base::asn1:
+ evp_private_key.p = ::d2i_PrivateKey_bio(bio.p, 0);
+ break;
+ case context_base::pem:
+ evp_private_key.p = ::PEM_read_bio_PrivateKey(
+ bio.p, 0, callback,
+ cb_userdata);
+ break;
+ default:
+ {
+ ec = asio::error::invalid_argument;
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+ }
+
+ if (evp_private_key.p)
+ {
+ if (::EVP_PKEY_is_a(evp_private_key.p, "RSA") == 0)
+ {
+ ec = translate_error(
+ ERR_PACK(ERR_LIB_EVP, 0, EVP_R_EXPECTING_AN_RSA_KEY));
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+
+ if (::SSL_CTX_use_PrivateKey(handle_, evp_private_key.p) == 1)
+ {
+ ec = asio::error_code();
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+ }
+ }
+
+ ec = translate_error(::ERR_get_error());
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+#else // (OPENSSL_VERSION_NUMBER >= 0x30000000L)
int file_type;
switch (format)
{
@@ -1055,14 +1107,13 @@ ASIO_SYNC_OP_VOID context::use_rsa_private_key_file(
if (::SSL_CTX_use_RSAPrivateKey_file(
handle_, filename.c_str(), file_type) != 1)
{
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
ec = asio::error_code();
ASIO_SYNC_OP_VOID_RETURN(ec);
+#endif // (OPENSSL_VERSION_NUMBER >= 0x30000000L)
}
void context::use_tmp_dh(const const_buffer& dh)
@@ -1083,9 +1134,7 @@ ASIO_SYNC_OP_VOID context::use_tmp_dh(
return do_use_tmp_dh(bio.p, ec);
}
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -1107,9 +1156,7 @@ ASIO_SYNC_OP_VOID context::use_tmp_dh_file(
return do_use_tmp_dh(bio.p, ec);
}
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -1118,6 +1165,19 @@ ASIO_SYNC_OP_VOID context::do_use_tmp_dh(
{
::ERR_clear_error();
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+ EVP_PKEY* p = ::PEM_read_bio_Parameters(bio, 0);
+ if (p)
+ {
+ if (::SSL_CTX_set0_tmp_dh_pkey(handle_, p) == 1)
+ {
+ ec = asio::error_code();
+ ASIO_SYNC_OP_VOID_RETURN(ec);
+ }
+ else
+ ::EVP_PKEY_free(p);
+ }
+#else // (OPENSSL_VERSION_NUMBER >= 0x30000000L)
dh_cleanup dh = { ::PEM_read_bio_DHparams(bio, 0, 0, 0) };
if (dh.p)
{
@@ -1127,10 +1187,9 @@ ASIO_SYNC_OP_VOID context::do_use_tmp_dh(
ASIO_SYNC_OP_VOID_RETURN(ec);
}
}
+#endif // (OPENSSL_VERSION_NUMBER >= 0x30000000L)
- ec = asio::error_code(
- static_cast<int>(::ERR_get_error()),
- asio::error::get_ssl_category());
+ ec = translate_error(::ERR_get_error());
ASIO_SYNC_OP_VOID_RETURN(ec);
}
@@ -1237,6 +1296,21 @@ BIO* context::make_buffer_bio(const const_buffer& b)
static_cast<int>(b.size()));
}
+asio::error_code context::translate_error(long error)
+{
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+ if (ERR_SYSTEM_ERROR(error))
+ {
+ return asio::error_code(
+ static_cast<int>(ERR_GET_REASON(error)),
+ asio::error::get_system_category());
+ }
+#endif // (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+
+ return asio::error_code(static_cast<int>(error),
+ asio::error::get_ssl_category());
+}
+
} // namespace ssl
} // namespace asio
diff --git a/3rdparty/asio/include/asio/ssl/impl/error.ipp b/3rdparty/asio/include/asio/ssl/impl/error.ipp
index dbc1fa0a084..7ff6e8a7359 100644
--- a/3rdparty/asio/include/asio/ssl/impl/error.ipp
+++ b/3rdparty/asio/include/asio/ssl/impl/error.ipp
@@ -2,7 +2,7 @@
// ssl/impl/error.ipp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -28,15 +28,37 @@ namespace detail {
class ssl_category : public asio::error_category
{
public:
- const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
+ const char* name() const noexcept
{
return "asio.ssl";
}
std::string message(int value) const
{
- const char* s = ::ERR_reason_error_string(value);
- return s ? s : "asio.ssl error";
+ const char* reason = ::ERR_reason_error_string(value);
+ if (reason)
+ {
+ const char* lib = ::ERR_lib_error_string(value);
+#if (OPENSSL_VERSION_NUMBER < 0x30000000L)
+ const char* func = ::ERR_func_error_string(value);
+#else // (OPENSSL_VERSION_NUMBER < 0x30000000L)
+ const char* func = 0;
+#endif // (OPENSSL_VERSION_NUMBER < 0x30000000L)
+ std::string result(reason);
+ if (lib || func)
+ {
+ result += " (";
+ if (lib)
+ result += lib;
+ if (lib && func)
+ result += ", ";
+ if (func)
+ result += func;
+ result += ")";
+ }
+ return result;
+ }
+ return "asio.ssl error";
}
};
@@ -66,7 +88,7 @@ namespace detail {
class stream_category : public asio::error_category
{
public:
- const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
+ const char* name() const noexcept
{
return "asio.ssl.stream";
}
diff --git a/3rdparty/asio/include/asio/ssl/impl/host_name_verification.ipp b/3rdparty/asio/include/asio/ssl/impl/host_name_verification.ipp
index adfcbdcc7e4..198d1f3989c 100644
--- a/3rdparty/asio/include/asio/ssl/impl/host_name_verification.ipp
+++ b/3rdparty/asio/include/asio/ssl/impl/host_name_verification.ipp
@@ -2,7 +2,7 @@
// ssl/impl/host_name_verification.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/impl/rfc2818_verification.ipp b/3rdparty/asio/include/asio/ssl/impl/rfc2818_verification.ipp
index 9e198e76060..93e161daa85 100644
--- a/3rdparty/asio/include/asio/ssl/impl/rfc2818_verification.ipp
+++ b/3rdparty/asio/include/asio/ssl/impl/rfc2818_verification.ipp
@@ -2,7 +2,7 @@
// ssl/impl/rfc2818_verification.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/impl/src.hpp b/3rdparty/asio/include/asio/ssl/impl/src.hpp
index 4be197132e1..5ffb95fdcd6 100644
--- a/3rdparty/asio/include/asio/ssl/impl/src.hpp
+++ b/3rdparty/asio/include/asio/ssl/impl/src.hpp
@@ -2,7 +2,7 @@
// impl/ssl/src.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/rfc2818_verification.hpp b/3rdparty/asio/include/asio/ssl/rfc2818_verification.hpp
index c5a9b9ea59c..db2831045d9 100644
--- a/3rdparty/asio/include/asio/ssl/rfc2818_verification.hpp
+++ b/3rdparty/asio/include/asio/ssl/rfc2818_verification.hpp
@@ -2,7 +2,7 @@
// ssl/rfc2818_verification.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/stream.hpp b/3rdparty/asio/include/asio/ssl/stream.hpp
index 616be7b806f..befcc287e7f 100644
--- a/3rdparty/asio/include/asio/ssl/stream.hpp
+++ b/3rdparty/asio/include/asio/ssl/stream.hpp
@@ -2,7 +2,7 @@
// ssl/stream.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,6 +18,7 @@
#include "asio/detail/config.hpp"
#include "asio/async_result.hpp"
+#include "asio/buffer.hpp"
#include "asio/detail/buffer_sequence_adapter.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/non_const_lvalue.hpp"
@@ -54,7 +55,7 @@ namespace ssl {
* @code
* asio::io_context my_context;
* asio::ssl::context ctx(asio::ssl::context::sslv23);
- * asio::ssl::stream<asio:ip::tcp::socket> sock(my_context, ctx);
+ * asio::ssl::stream<asio::ip::tcp::socket> sock(my_context, ctx);
* @endcode
*
* @par Concepts:
@@ -65,6 +66,13 @@ class stream :
public stream_base,
private noncopyable
{
+private:
+ class initiate_async_handshake;
+ class initiate_async_buffered_handshake;
+ class initiate_async_shutdown;
+ class initiate_async_write_some;
+ class initiate_async_read_some;
+
public:
/// The native handle type of the SSL stream.
typedef SSL* native_handle_type;
@@ -76,7 +84,7 @@ public:
};
/// The type of the next layer.
- typedef typename remove_reference<Stream>::type next_layer_type;
+ typedef remove_reference_t<Stream> next_layer_type;
/// The type of the lowest layer.
typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
@@ -84,7 +92,6 @@ public:
/// The type of the executor associated with the object.
typedef typename lowest_layer_type::executor_type executor_type;
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Construct a stream.
/**
* This constructor creates a stream and initialises the underlying stream
@@ -96,20 +103,28 @@ public:
*/
template <typename Arg>
stream(Arg&& arg, context& ctx)
- : next_layer_(ASIO_MOVE_CAST(Arg)(arg)),
+ : next_layer_(static_cast<Arg&&>(arg)),
core_(ctx.native_handle(), next_layer_.lowest_layer().get_executor())
{
}
-#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+
+ /// Construct a stream from an existing native implementation.
+ /**
+ * This constructor creates a stream and initialises the underlying stream
+ * object. On success, ownership of the native implementation is transferred
+ * to the stream, and it will be cleaned up when the stream is destroyed.
+ *
+ * @param arg The argument to be passed to initialise the underlying stream.
+ *
+ * @param handle An existing native SSL implementation.
+ */
template <typename Arg>
- stream(Arg& arg, context& ctx)
- : next_layer_(arg),
- core_(ctx.native_handle(), next_layer_.lowest_layer().get_executor())
+ stream(Arg&& arg, native_handle_type handle)
+ : next_layer_(static_cast<Arg&&>(arg)),
+ core_(handle, next_layer_.lowest_layer().get_executor())
{
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a stream from another.
/**
* @param other The other stream object from which the move will occur. Must
@@ -118,8 +133,8 @@ public:
* operation is destruction, or use as the target of a move assignment.
*/
stream(stream&& other)
- : next_layer_(ASIO_MOVE_CAST(Stream)(other.next_layer_)),
- core_(ASIO_MOVE_CAST(detail::stream_core)(other.core_))
+ : next_layer_(static_cast<Stream&&>(other.next_layer_)),
+ core_(static_cast<detail::stream_core&&>(other.core_))
{
}
@@ -134,12 +149,11 @@ public:
{
if (this != &other)
{
- next_layer_ = ASIO_MOVE_CAST(Stream)(other.next_layer_);
- core_ = ASIO_MOVE_CAST(detail::stream_core)(other.core_);
+ next_layer_ = static_cast<Stream&&>(other.next_layer_);
+ core_ = static_cast<detail::stream_core&&>(other.core_);
}
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destructor.
/**
@@ -157,7 +171,7 @@ public:
*
* @return A copy of the executor that stream will use to dispatch handlers.
*/
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return next_layer_.lowest_layer().get_executor();
}
@@ -173,7 +187,7 @@ public:
* suitable for passing to functions such as @c SSL_get_verify_result and
* @c SSL_get_peer_certificate:
* @code
- * asio::ssl::stream<asio:ip::tcp::socket> sock(my_context, ctx);
+ * asio::ssl::stream<asio::ip::tcp::socket> sock(io_ctx, ctx);
*
* // ... establish connection and perform handshake ...
*
@@ -450,17 +464,27 @@ public:
/// Start an asynchronous SSL handshake.
/**
* This function is used to asynchronously perform an SSL handshake on the
- * stream. This function call always returns immediately.
+ * stream. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param type The type of handshaking to be performed, i.e. as a client or as
* a server.
*
- * @param handler The handler to be called when the handshake operation
- * completes. Copies will be made of the handler as required. The equivalent
- * function signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the handshake completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error // Result of operation.
* ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
*
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
@@ -475,23 +499,24 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- HandshakeHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(HandshakeHandler,
- void (asio::error_code))
- async_handshake(handshake_type type,
- ASIO_MOVE_ARG(HandshakeHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<HandshakeHandler,
+ HandshakeToken = default_completion_token_t<executor_type>>
+ auto async_handshake(handshake_type type,
+ HandshakeToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<HandshakeToken,
+ void (asio::error_code)>(
+ declval<initiate_async_handshake>(), token, type))
+ {
+ return async_initiate<HandshakeToken,
void (asio::error_code)>(
- initiate_async_handshake(this), handler, type);
+ initiate_async_handshake(this), token, type);
}
/// Start an asynchronous SSL handshake.
/**
* This function is used to asynchronously perform an SSL handshake on the
- * stream. This function call always returns immediately.
+ * stream. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param type The type of handshaking to be performed, i.e. as a client or as
* a server.
@@ -499,15 +524,24 @@ public:
* @param buffers The buffered data to be reused for the handshake. Although
* the buffers object may be copied as necessary, ownership of the underlying
* buffers is retained by the caller, which must guarantee that they remain
- * valid until the handler is called.
+ * valid until the completion handler is called.
*
- * @param handler The handler to be called when the handshake operation
- * completes. Copies will be made of the handler as required. The equivalent
- * function signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the handshake completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Amount of buffers used in handshake.
* ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
*
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
@@ -522,17 +556,22 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) BufferedHandshakeHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(BufferedHandshakeHandler,
- void (asio::error_code, std::size_t))
- async_handshake(handshake_type type, const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(BufferedHandshakeHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<BufferedHandshakeHandler,
+ std::size_t)) BufferedHandshakeToken
+ = default_completion_token_t<executor_type>>
+ auto async_handshake(handshake_type type, const ConstBufferSequence& buffers,
+ BufferedHandshakeToken&& token
+ = default_completion_token_t<executor_type>(),
+ constraint_t<
+ is_const_buffer_sequence<ConstBufferSequence>::value
+ > = 0)
+ -> decltype(
+ async_initiate<BufferedHandshakeToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_buffered_handshake>(), token, type, buffers))
+ {
+ return async_initiate<BufferedHandshakeToken,
void (asio::error_code, std::size_t)>(
- initiate_async_buffered_handshake(this), handler, type, buffers);
+ initiate_async_buffered_handshake(this), token, type, buffers);
}
/// Shut down SSL on the stream.
@@ -564,15 +603,25 @@ public:
/// Asynchronously shut down SSL on the stream.
/**
- * This function is used to asynchronously shut down SSL on the stream. This
- * function call always returns immediately.
- *
- * @param handler The handler to be called when the handshake operation
- * completes. Copies will be made of the handler as required. The equivalent
- * function signature of the handler must be:
+ * This function is used to asynchronously shut down SSL on the stream. It is
+ * an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the shutdown completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error // Result of operation.
* ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
*
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
@@ -587,17 +636,18 @@ public:
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- ShutdownHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ShutdownHandler,
- void (asio::error_code))
- async_shutdown(
- ASIO_MOVE_ARG(ShutdownHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<ShutdownHandler,
+ ShutdownToken
+ = default_completion_token_t<executor_type>>
+ auto async_shutdown(
+ ShutdownToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ShutdownToken,
+ void (asio::error_code)>(
+ declval<initiate_async_shutdown>(), token))
+ {
+ return async_initiate<ShutdownToken,
void (asio::error_code)>(
- initiate_async_shutdown(this), handler);
+ initiate_async_shutdown(this), token);
}
/// Write some data to the stream.
@@ -652,20 +702,30 @@ public:
/// Start an asynchronous write.
/**
* This function is used to asynchronously write one or more bytes of data to
- * the stream. The function call always returns immediately.
+ * the stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers The data to be written to the stream. Although the buffers
* object may be copied as necessary, ownership of the underlying buffers is
* retained by the caller, which must guarantee that they remain valid until
- * the handler is called.
+ * the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The equivalent function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes written.
+ * std::size_t bytes_transferred // Number of bytes written.
* ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
*
* @note The async_write_some operation may not transmit all of the data to
* the peer. Consider using the @ref async_write function if you need to
@@ -685,17 +745,17 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_write_some(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<WriteHandler,
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_write_some>(), token, buffers))
+ {
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_write_some(this), handler, buffers);
+ initiate_async_write_some(this), token, buffers);
}
/// Read some data from the stream.
@@ -750,20 +810,30 @@ public:
/// Start an asynchronous read.
/**
* This function is used to asynchronously read one or more bytes of data from
- * the stream. The function call always returns immediately.
+ * the stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
* @param buffers The buffers into which the data will be read. Although the
* buffers object may be copied as necessary, ownership of the underlying
* buffers is retained by the caller, which must guarantee that they remain
- * valid until the handler is called.
+ * valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The equivalent function
- * signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes read.
+ * std::size_t bytes_transferred // Number of bytes read.
* ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
+ * manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
*
* @note The async_read_some operation may not read all of the requested
* number of bytes. Consider using the @ref async_read function if you need to
@@ -783,17 +853,17 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_read_some(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
- {
- return async_initiate<ReadHandler,
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_read_some>(), token, buffers))
+ {
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_read_some(this), handler, buffers);
+ initiate_async_read_some(this), token, buffers);
}
private:
@@ -807,13 +877,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return self_->get_executor();
}
template <typename HandshakeHandler>
- void operator()(ASIO_MOVE_ARG(HandshakeHandler) handler,
+ void operator()(HandshakeHandler&& handler,
handshake_type type) const
{
// If you get an error on the following line it means that your handler
@@ -839,13 +909,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return self_->get_executor();
}
template <typename BufferedHandshakeHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(BufferedHandshakeHandler) handler,
+ void operator()(BufferedHandshakeHandler&& handler,
handshake_type type, const ConstBufferSequence& buffers) const
{
// If you get an error on the following line it means that your
@@ -875,13 +945,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ShutdownHandler>
- void operator()(ASIO_MOVE_ARG(ShutdownHandler) handler) const
+ void operator()(ShutdownHandler&& handler) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ShutdownHandler.
@@ -906,13 +976,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
@@ -938,13 +1008,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ executor_type get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
diff --git a/3rdparty/asio/include/asio/ssl/stream_base.hpp b/3rdparty/asio/include/asio/ssl/stream_base.hpp
index 41b7df3c851..2728ec8ca1b 100644
--- a/3rdparty/asio/include/asio/ssl/stream_base.hpp
+++ b/3rdparty/asio/include/asio/ssl/stream_base.hpp
@@ -2,7 +2,7 @@
// ssl/stream_base.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/verify_context.hpp b/3rdparty/asio/include/asio/ssl/verify_context.hpp
index dbfcf1be491..7251856f08e 100644
--- a/3rdparty/asio/include/asio/ssl/verify_context.hpp
+++ b/3rdparty/asio/include/asio/ssl/verify_context.hpp
@@ -2,7 +2,7 @@
// ssl/verify_context.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ssl/verify_mode.hpp b/3rdparty/asio/include/asio/ssl/verify_mode.hpp
index 241bd65eaca..919e308c8a4 100644
--- a/3rdparty/asio/include/asio/ssl/verify_mode.hpp
+++ b/3rdparty/asio/include/asio/ssl/verify_mode.hpp
@@ -2,7 +2,7 @@
// ssl/verify_mode.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/static_thread_pool.hpp b/3rdparty/asio/include/asio/static_thread_pool.hpp
index 0b611266d9b..636afe1cee5 100644
--- a/3rdparty/asio/include/asio/static_thread_pool.hpp
+++ b/3rdparty/asio/include/asio/static_thread_pool.hpp
@@ -2,7 +2,7 @@
// static_thread_pool.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/steady_timer.hpp b/3rdparty/asio/include/asio/steady_timer.hpp
index 17a72446d92..5db00250b71 100644
--- a/3rdparty/asio/include/asio/steady_timer.hpp
+++ b/3rdparty/asio/include/asio/steady_timer.hpp
@@ -2,7 +2,7 @@
// steady_timer.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
-
#include "asio/basic_waitable_timer.hpp"
#include "asio/detail/chrono.hpp"
@@ -37,6 +34,4 @@ typedef basic_waitable_timer<chrono::steady_clock> steady_timer;
} // namespace asio
-#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
-
#endif // ASIO_STEADY_TIMER_HPP
diff --git a/3rdparty/asio/include/asio/strand.hpp b/3rdparty/asio/include/asio/strand.hpp
index 52b2314df56..c63592b8649 100644
--- a/3rdparty/asio/include/asio/strand.hpp
+++ b/3rdparty/asio/include/asio/strand.hpp
@@ -2,7 +2,7 @@
// strand.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -48,20 +48,20 @@ public:
/// Construct a strand for the specified executor.
template <typename Executor1>
explicit strand(const Executor1& e,
- typename constraint<
- conditional<
+ constraint_t<
+ conditional_t<
!is_same<Executor1, strand>::value,
is_convertible<Executor1, Executor>,
false_type
- >::type::value
- >::type = 0)
+ >::value
+ > = 0)
: executor_(e),
impl_(strand::create_implementation(executor_))
{
}
/// Copy constructor.
- strand(const strand& other) ASIO_NOEXCEPT
+ strand(const strand& other) noexcept
: executor_(other.executor_),
impl_(other.impl_)
{
@@ -74,14 +74,14 @@ public:
*/
template <class OtherExecutor>
strand(
- const strand<OtherExecutor>& other) ASIO_NOEXCEPT
+ const strand<OtherExecutor>& other) noexcept
: executor_(other.executor_),
impl_(other.impl_)
{
}
/// Assignment operator.
- strand& operator=(const strand& other) ASIO_NOEXCEPT
+ strand& operator=(const strand& other) noexcept
{
executor_ = other.executor_;
impl_ = other.impl_;
@@ -95,18 +95,17 @@ public:
*/
template <class OtherExecutor>
strand& operator=(
- const strand<OtherExecutor>& other) ASIO_NOEXCEPT
+ const strand<OtherExecutor>& other) noexcept
{
executor_ = other.executor_;
impl_ = other.impl_;
return *this;
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move constructor.
- strand(strand&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(Executor)(other.executor_)),
- impl_(ASIO_MOVE_CAST(implementation_type)(other.impl_))
+ strand(strand&& other) noexcept
+ : executor_(static_cast<Executor&&>(other.executor_)),
+ impl_(static_cast<implementation_type&&>(other.impl_))
{
}
@@ -116,17 +115,17 @@ public:
* to @c Executor.
*/
template <class OtherExecutor>
- strand(strand<OtherExecutor>&& other) ASIO_NOEXCEPT
- : executor_(ASIO_MOVE_CAST(OtherExecutor)(other.executor_)),
- impl_(ASIO_MOVE_CAST(implementation_type)(other.impl_))
+ strand(strand<OtherExecutor>&& other) noexcept
+ : executor_(static_cast<OtherExecutor&&>(other.executor_)),
+ impl_(static_cast<implementation_type&&>(other.impl_))
{
}
/// Move assignment operator.
- strand& operator=(strand&& other) ASIO_NOEXCEPT
+ strand& operator=(strand&& other) noexcept
{
- executor_ = ASIO_MOVE_CAST(Executor)(other.executor_);
- impl_ = ASIO_MOVE_CAST(implementation_type)(other.impl_);
+ executor_ = static_cast<Executor&&>(other.executor_);
+ impl_ = static_cast<implementation_type&&>(other.impl_);
return *this;
}
@@ -136,21 +135,20 @@ public:
* convertible to @c Executor.
*/
template <class OtherExecutor>
- strand& operator=(strand<OtherExecutor>&& other) ASIO_NOEXCEPT
+ strand& operator=(strand<OtherExecutor>&& other) noexcept
{
- executor_ = ASIO_MOVE_CAST(OtherExecutor)(other.executor_);
- impl_ = ASIO_MOVE_CAST(implementation_type)(other.impl_);
+ executor_ = static_cast<OtherExecutor&&>(other.executor_);
+ impl_ = static_cast<implementation_type&&>(other.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destructor.
- ~strand() ASIO_NOEXCEPT
+ ~strand() noexcept
{
}
/// Obtain the underlying executor.
- inner_executor_type get_inner_executor() const ASIO_NOEXCEPT
+ inner_executor_type get_inner_executor() const noexcept
{
return executor_;
}
@@ -167,16 +165,15 @@ public:
* ... @endcode
*/
template <typename Property>
- typename constraint<
+ constraint_t<
can_query<const Executor&, Property>::value,
- typename conditional<
+ conditional_t<
is_convertible<Property, execution::blocking_t>::value,
execution::blocking_t,
- typename query_result<const Executor&, Property>::type
- >::type
- >::type query(const Property& p) const
- ASIO_NOEXCEPT_IF((
- is_nothrow_query<const Executor&, Property>::value))
+ query_result_t<const Executor&, Property>
+ >
+ > query(const Property& p) const
+ noexcept(is_nothrow_query<const Executor&, Property>::value)
{
return this->query_helper(
is_convertible<Property, execution::blocking_t>(), p);
@@ -193,19 +190,15 @@ public:
* asio::execution::blocking.never); @endcode
*/
template <typename Property>
- typename constraint<
+ constraint_t<
can_require<const Executor&, Property>::value
&& !is_convertible<Property, execution::blocking_t::always_t>::value,
- strand<typename decay<
- typename require_result<const Executor&, Property>::type
- >::type>
- >::type require(const Property& p) const
- ASIO_NOEXCEPT_IF((
- is_nothrow_require<const Executor&, Property>::value))
+ strand<decay_t<require_result_t<const Executor&, Property>>>
+ > require(const Property& p) const
+ noexcept(is_nothrow_require<const Executor&, Property>::value)
{
- return strand<typename decay<
- typename require_result<const Executor&, Property>::type
- >::type>(asio::require(executor_, p), impl_);
+ return strand<decay_t<require_result_t<const Executor&, Property>>>(
+ asio::require(executor_, p), impl_);
}
/// Forward a preference to the underlying executor.
@@ -219,24 +212,20 @@ public:
* asio::execution::blocking.never); @endcode
*/
template <typename Property>
- typename constraint<
+ constraint_t<
can_prefer<const Executor&, Property>::value
&& !is_convertible<Property, execution::blocking_t::always_t>::value,
- strand<typename decay<
- typename prefer_result<const Executor&, Property>::type
- >::type>
- >::type prefer(const Property& p) const
- ASIO_NOEXCEPT_IF((
- is_nothrow_prefer<const Executor&, Property>::value))
+ strand<decay_t<prefer_result_t<const Executor&, Property>>>
+ > prefer(const Property& p) const
+ noexcept(is_nothrow_prefer<const Executor&, Property>::value)
{
- return strand<typename decay<
- typename prefer_result<const Executor&, Property>::type
- >::type>(asio::prefer(executor_, p), impl_);
+ return strand<decay_t<prefer_result_t<const Executor&, Property>>>(
+ asio::prefer(executor_, p), impl_);
}
#if !defined(ASIO_NO_TS_EXECUTORS)
/// Obtain the underlying execution context.
- execution_context& context() const ASIO_NOEXCEPT
+ execution_context& context() const noexcept
{
return executor_.context();
}
@@ -245,7 +234,7 @@ public:
/**
* The strand delegates this call to its underlying executor.
*/
- void on_work_started() const ASIO_NOEXCEPT
+ void on_work_started() const noexcept
{
executor_.on_work_started();
}
@@ -254,7 +243,7 @@ public:
/**
* The strand delegates this call to its underlying executor.
*/
- void on_work_finished() const ASIO_NOEXCEPT
+ void on_work_finished() const noexcept
{
executor_.on_work_finished();
}
@@ -262,13 +251,6 @@ public:
/// Request the strand to invoke the given function object.
/**
- * Do not call this function directly. It is intended for use with the
- * execution::execute customisation point.
- *
- * For example:
- * @code asio::strand<my_executor_type> ex = ...;
- * execution::execute(ex, my_function_object); @endcode
- *
* This function is used to ask the strand to execute the given function
* object on its underlying executor. The function object will be executed
* according to the properties of the underlying executor.
@@ -278,13 +260,13 @@ public:
* function object must be: @code void function(); @endcode
*/
template <typename Function>
- typename constraint<
- execution::can_execute<const Executor&, Function>::value,
+ constraint_t<
+ traits::execute_member<const Executor&, Function>::is_valid,
void
- >::type execute(ASIO_MOVE_ARG(Function) f) const
+ > execute(Function&& f) const
{
detail::strand_executor_service::execute(impl_,
- executor_, ASIO_MOVE_CAST(Function)(f));
+ executor_, static_cast<Function&&>(f));
}
#if !defined(ASIO_NO_TS_EXECUTORS)
@@ -304,10 +286,10 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename Allocator>
- void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const
+ void dispatch(Function&& f, const Allocator& a) const
{
detail::strand_executor_service::dispatch(impl_,
- executor_, ASIO_MOVE_CAST(Function)(f), a);
+ executor_, static_cast<Function&&>(f), a);
}
/// Request the strand to invoke the given function object.
@@ -324,10 +306,10 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename Allocator>
- void post(ASIO_MOVE_ARG(Function) f, const Allocator& a) const
+ void post(Function&& f, const Allocator& a) const
{
detail::strand_executor_service::post(impl_,
- executor_, ASIO_MOVE_CAST(Function)(f), a);
+ executor_, static_cast<Function&&>(f), a);
}
/// Request the strand to invoke the given function object.
@@ -344,10 +326,10 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename Allocator>
- void defer(ASIO_MOVE_ARG(Function) f, const Allocator& a) const
+ void defer(Function&& f, const Allocator& a) const
{
detail::strand_executor_service::defer(impl_,
- executor_, ASIO_MOVE_CAST(Function)(f), a);
+ executor_, static_cast<Function&&>(f), a);
}
#endif // !defined(ASIO_NO_TS_EXECUTORS)
@@ -357,7 +339,7 @@ public:
* submitted to the strand using post(), dispatch() or defer(). Otherwise
* returns @c false.
*/
- bool running_in_this_thread() const ASIO_NOEXCEPT
+ bool running_in_this_thread() const noexcept
{
return detail::strand_executor_service::running_in_this_thread(impl_);
}
@@ -367,7 +349,7 @@ public:
* Two strands are equal if they refer to the same ordered, non-concurrent
* state.
*/
- friend bool operator==(const strand& a, const strand& b) ASIO_NOEXCEPT
+ friend bool operator==(const strand& a, const strand& b) noexcept
{
return a.impl_ == b.impl_;
}
@@ -377,7 +359,7 @@ public:
* Two strands are equal if they refer to the same ordered, non-concurrent
* state.
*/
- friend bool operator!=(const strand& a, const strand& b) ASIO_NOEXCEPT
+ friend bool operator!=(const strand& a, const strand& b) noexcept
{
return a.impl_ != b.impl_;
}
@@ -390,9 +372,9 @@ private:
template <typename InnerExecutor>
static implementation_type create_implementation(const InnerExecutor& ex,
- typename constraint<
+ constraint_t<
can_query<InnerExecutor, execution::context_t>::value
- >::type = 0)
+ > = 0)
{
return use_service<detail::strand_executor_service>(
asio::query(ex, execution::context)).create_implementation();
@@ -400,9 +382,9 @@ private:
template <typename InnerExecutor>
static implementation_type create_implementation(const InnerExecutor& ex,
- typename constraint<
+ constraint_t<
!can_query<InnerExecutor, execution::context_t>::value
- >::type = 0)
+ > = 0)
{
return use_service<detail::strand_executor_service>(
ex.context()).create_implementation();
@@ -415,7 +397,7 @@ private:
}
template <typename Property>
- typename query_result<const Executor&, Property>::type query_helper(
+ query_result_t<const Executor&, Property> query_helper(
false_type, const Property& property) const
{
return asio::query(executor_, property);
@@ -441,22 +423,33 @@ private:
/*@{*/
/// Create a @ref strand object for an executor.
+/**
+ * @param ex An executor.
+ *
+ * @returns A strand constructed with the specified executor.
+ */
template <typename Executor>
inline strand<Executor> make_strand(const Executor& ex,
- typename constraint<
+ constraint_t<
is_executor<Executor>::value || execution::is_executor<Executor>::value
- >::type = 0)
+ > = 0)
{
return strand<Executor>(ex);
}
/// Create a @ref strand object for an execution context.
+/**
+ * @param ctx An execution context, from which an executor will be obtained.
+ *
+ * @returns A strand constructed with the execution context's executor, obtained
+ * by performing <tt>ctx.get_executor()</tt>.
+ */
template <typename ExecutionContext>
inline strand<typename ExecutionContext::executor_type>
make_strand(ExecutionContext& ctx,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
{
return strand<typename ExecutionContext::executor_type>(ctx.get_executor());
}
@@ -470,10 +463,10 @@ namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename Executor>
-struct equality_comparable<strand<Executor> >
+struct equality_comparable<strand<Executor>>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -482,12 +475,12 @@ struct equality_comparable<strand<Executor> >
template <typename Executor, typename Function>
struct execute_member<strand<Executor>, Function,
- typename enable_if<
- execution::can_execute<const Executor&, Function>::value
- >::type>
+ enable_if_t<
+ traits::execute_member<const Executor&, Function>::is_valid
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -497,17 +490,16 @@ struct execute_member<strand<Executor>, Function,
template <typename Executor, typename Property>
struct query_member<strand<Executor>, Property,
- typename enable_if<
+ enable_if_t<
can_query<const Executor&, Property>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_query<Executor, Property>::value));
- typedef typename conditional<
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_query<Executor, Property>::value;
+ typedef conditional_t<
is_convertible<Property, execution::blocking_t>::value,
- execution::blocking_t, typename query_result<Executor, Property>::type
- >::type result_type;
+ execution::blocking_t, query_result_t<Executor, Property>> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -516,17 +508,15 @@ struct query_member<strand<Executor>, Property,
template <typename Executor, typename Property>
struct require_member<strand<Executor>, Property,
- typename enable_if<
+ enable_if_t<
can_require<const Executor&, Property>::value
&& !is_convertible<Property, execution::blocking_t::always_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_require<Executor, Property>::value));
- typedef strand<typename decay<
- typename require_result<Executor, Property>::type
- >::type> result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_require<Executor, Property>::value;
+ typedef strand<decay_t<require_result_t<Executor, Property>>> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
@@ -535,17 +525,15 @@ struct require_member<strand<Executor>, Property,
template <typename Executor, typename Property>
struct prefer_member<strand<Executor>, Property,
- typename enable_if<
+ enable_if_t<
can_prefer<const Executor&, Property>::value
&& !is_convertible<Property, execution::blocking_t::always_t>::value
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- (is_nothrow_prefer<Executor, Property>::value));
- typedef strand<typename decay<
- typename prefer_result<Executor, Property>::type
- >::type> result_type;
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept =
+ is_nothrow_prefer<Executor, Property>::value;
+ typedef strand<decay_t<prefer_result_t<Executor, Property>>> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
diff --git a/3rdparty/asio/include/asio/stream_file.hpp b/3rdparty/asio/include/asio/stream_file.hpp
new file mode 100644
index 00000000000..ef059a987e5
--- /dev/null
+++ b/3rdparty/asio/include/asio/stream_file.hpp
@@ -0,0 +1,35 @@
+//
+// stream_file.hpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_STREAM_FILE_HPP
+#define ASIO_STREAM_FILE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_FILE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include "asio/basic_stream_file.hpp"
+
+namespace asio {
+
+/// Typedef for the typical usage of a stream-oriented file.
+typedef basic_stream_file<> stream_file;
+
+} // namespace asio
+
+#endif // defined(ASIO_HAS_FILE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_STREAM_FILE_HPP
diff --git a/3rdparty/asio/include/asio/streambuf.hpp b/3rdparty/asio/include/asio/streambuf.hpp
index 4b7995e5480..d7745245cb8 100644
--- a/3rdparty/asio/include/asio/streambuf.hpp
+++ b/3rdparty/asio/include/asio/streambuf.hpp
@@ -2,7 +2,7 @@
// streambuf.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/system_context.hpp b/3rdparty/asio/include/asio/system_context.hpp
index 6611ab7ee08..132ce615677 100644
--- a/3rdparty/asio/include/asio/system_context.hpp
+++ b/3rdparty/asio/include/asio/system_context.hpp
@@ -2,7 +2,7 @@
// system_context.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -43,13 +43,13 @@ public:
ASIO_DECL ~system_context();
/// Obtain an executor for the context.
- executor_type get_executor() ASIO_NOEXCEPT;
+ executor_type get_executor() noexcept;
/// Signal all threads in the system thread pool to stop.
ASIO_DECL void stop();
/// Determine whether the system thread pool has been stopped.
- ASIO_DECL bool stopped() const ASIO_NOEXCEPT;
+ ASIO_DECL bool stopped() const noexcept;
/// Join all threads in the system thread pool.
ASIO_DECL void join();
diff --git a/3rdparty/asio/include/asio/system_error.hpp b/3rdparty/asio/include/asio/system_error.hpp
index 3fb2d14db20..d7f932627bd 100644
--- a/3rdparty/asio/include/asio/system_error.hpp
+++ b/3rdparty/asio/include/asio/system_error.hpp
@@ -2,7 +2,7 @@
// system_error.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,114 +16,14 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
-# include <system_error>
-#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
-# include <cerrno>
-# include <exception>
-# include <string>
-# include "asio/error_code.hpp"
-# include "asio/detail/scoped_ptr.hpp"
-#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
+#include <system_error>
#include "asio/detail/push_options.hpp"
namespace asio {
-#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
-
typedef std::system_error system_error;
-#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
-
-/// The system_error class is used to represent system conditions that
-/// prevent the library from operating correctly.
-class system_error
- : public std::exception
-{
-public:
- /// Construct with an error code.
- system_error(const error_code& ec)
- : code_(ec),
- context_()
- {
- }
-
- /// Construct with an error code and context.
- system_error(const error_code& ec, const std::string& context)
- : code_(ec),
- context_(context)
- {
- }
-
- /// Copy constructor.
- system_error(const system_error& other)
- : std::exception(other),
- code_(other.code_),
- context_(other.context_),
- what_()
- {
- }
-
- /// Destructor.
- virtual ~system_error() throw ()
- {
- }
-
- /// Assignment operator.
- system_error& operator=(const system_error& e)
- {
- context_ = e.context_;
- code_ = e.code_;
- what_.reset();
- return *this;
- }
-
- /// Get a string representation of the exception.
- virtual const char* what() const throw ()
- {
-#if !defined(ASIO_NO_EXCEPTIONS)
- try
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- {
- if (!what_.get())
- {
- std::string tmp(context_);
- if (tmp.length())
- tmp += ": ";
- tmp += code_.message();
- what_.reset(new std::string(tmp));
- }
- return what_->c_str();
- }
-#if !defined(ASIO_NO_EXCEPTIONS)
- catch (std::exception&)
- {
- return "system_error";
- }
-#endif // !defined(ASIO_NO_EXCEPTIONS)
- }
-
- /// Get the error code associated with the exception.
- error_code code() const
- {
- return code_;
- }
-
-private:
- // The code associated with the error.
- error_code code_;
-
- // The context associated with the error.
- std::string context_;
-
- // The string representation of the error.
- mutable asio::detail::scoped_ptr<std::string> what_;
-};
-
-#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
-
} // namespace asio
#include "asio/detail/pop_options.hpp"
diff --git a/3rdparty/asio/include/asio/system_executor.hpp b/3rdparty/asio/include/asio/system_executor.hpp
index 84025f0d519..19b6d30e322 100644
--- a/3rdparty/asio/include/asio/system_executor.hpp
+++ b/3rdparty/asio/include/asio/system_executor.hpp
@@ -2,7 +2,7 @@
// system_executor.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -39,7 +39,7 @@ class basic_system_executor
{
public:
/// Default constructor.
- basic_system_executor() ASIO_NOEXCEPT
+ basic_system_executor() noexcept
: allocator_(Allocator())
{
}
@@ -168,11 +168,11 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::allocator); @endcode
*/
- basic_system_executor<Blocking, Relationship, std::allocator<void> >
+ basic_system_executor<Blocking, Relationship, std::allocator<void>>
require(execution::allocator_t<void>) const
{
return basic_system_executor<Blocking,
- Relationship, std::allocator<void> >();
+ Relationship, std::allocator<void>>();
}
#if !defined(GENERATING_DOCUMENTATION)
@@ -195,8 +195,8 @@ private:
* == asio::execution::mapping.thread)
* ... @endcode
*/
- static ASIO_CONSTEXPR execution::mapping_t query(
- execution::mapping_t) ASIO_NOEXCEPT
+ static constexpr execution::mapping_t query(
+ execution::mapping_t) noexcept
{
return execution::mapping.thread;
}
@@ -211,7 +211,7 @@ private:
* asio::system_context& pool = asio::query(
* ex, asio::execution::context); @endcode
*/
- static system_context& query(execution::context_t) ASIO_NOEXCEPT;
+ static system_context& query(execution::context_t) noexcept;
/// Query the current value of the @c blocking property.
/**
@@ -224,8 +224,8 @@ private:
* == asio::execution::blocking.always)
* ... @endcode
*/
- static ASIO_CONSTEXPR execution::blocking_t query(
- execution::blocking_t) ASIO_NOEXCEPT
+ static constexpr execution::blocking_t query(
+ execution::blocking_t) noexcept
{
return Blocking();
}
@@ -241,8 +241,8 @@ private:
* == asio::execution::relationship.continuation)
* ... @endcode
*/
- static ASIO_CONSTEXPR execution::relationship_t query(
- execution::relationship_t) ASIO_NOEXCEPT
+ static constexpr execution::relationship_t query(
+ execution::relationship_t) noexcept
{
return Relationship();
}
@@ -258,8 +258,8 @@ private:
* asio::execution::allocator); @endcode
*/
template <typename OtherAllocator>
- ASIO_CONSTEXPR Allocator query(
- execution::allocator_t<OtherAllocator>) const ASIO_NOEXCEPT
+ constexpr Allocator query(
+ execution::allocator_t<OtherAllocator>) const noexcept
{
return allocator_;
}
@@ -274,8 +274,8 @@ private:
* auto alloc = asio::query(ex,
* asio::execution::allocator); @endcode
*/
- ASIO_CONSTEXPR Allocator query(
- execution::allocator_t<void>) const ASIO_NOEXCEPT
+ constexpr Allocator query(
+ execution::allocator_t<void>) const noexcept
{
return allocator_;
}
@@ -291,7 +291,7 @@ private:
* std::size_t occupancy = asio::query(
* ex, asio::execution::occupancy); @endcode
*/
- std::size_t query(execution::occupancy_t) const ASIO_NOEXCEPT;
+ std::size_t query(execution::occupancy_t) const noexcept;
public:
/// Compare two executors for equality.
@@ -299,7 +299,7 @@ public:
* Two executors are equal if they refer to the same underlying io_context.
*/
friend bool operator==(const basic_system_executor&,
- const basic_system_executor&) ASIO_NOEXCEPT
+ const basic_system_executor&) noexcept
{
return true;
}
@@ -309,41 +309,28 @@ public:
* Two executors are equal if they refer to the same underlying io_context.
*/
friend bool operator!=(const basic_system_executor&,
- const basic_system_executor&) ASIO_NOEXCEPT
+ const basic_system_executor&) noexcept
{
return false;
}
-#if !defined(GENERATING_DOCUMENTATION)
-private:
- friend struct asio_execution_execute_fn::impl;
-#endif // !defined(GENERATING_DOCUMENTATION)
-
/// Execution function.
- /**
- * Do not call this function directly. It is intended for use with the
- * execution::execute customisation point.
- *
- * For example:
- * @code asio::system_executor ex;
- * execution::execute(ex, my_function_object); @endcode
- */
template <typename Function>
- void execute(ASIO_MOVE_ARG(Function) f) const
+ void execute(Function&& f) const
{
- this->do_execute(ASIO_MOVE_CAST(Function)(f), Blocking());
+ this->do_execute(static_cast<Function&&>(f), Blocking());
}
#if !defined(ASIO_NO_TS_EXECUTORS)
public:
/// Obtain the underlying execution context.
- system_context& context() const ASIO_NOEXCEPT;
+ system_context& context() const noexcept;
/// Inform the executor that it has some outstanding work to do.
/**
* For the system executor, this is a no-op.
*/
- void on_work_started() const ASIO_NOEXCEPT
+ void on_work_started() const noexcept
{
}
@@ -351,7 +338,7 @@ public:
/**
* For the system executor, this is a no-op.
*/
- void on_work_finished() const ASIO_NOEXCEPT
+ void on_work_finished() const noexcept
{
}
@@ -368,7 +355,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename OtherAllocator>
- void dispatch(ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const;
+ void dispatch(Function&& f, const OtherAllocator& a) const;
/// Request the system executor to invoke the given function object.
/**
@@ -384,7 +371,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename OtherAllocator>
- void post(ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const;
+ void post(Function&& f, const OtherAllocator& a) const;
/// Request the system executor to invoke the given function object.
/**
@@ -400,7 +387,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename OtherAllocator>
- void defer(ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const;
+ void defer(Function&& f, const OtherAllocator& a) const;
#endif // !defined(ASIO_NO_TS_EXECUTORS)
private:
@@ -414,17 +401,17 @@ private:
/// Execution helper implementation for the possibly blocking property.
template <typename Function>
- void do_execute(ASIO_MOVE_ARG(Function) f,
+ void do_execute(Function&& f,
execution::blocking_t::possibly_t) const;
/// Execution helper implementation for the always blocking property.
template <typename Function>
- void do_execute(ASIO_MOVE_ARG(Function) f,
+ void do_execute(Function&& f,
execution::blocking_t::always_t) const;
/// Execution helper implementation for the never blocking property.
template <typename Function>
- void do_execute(ASIO_MOVE_ARG(Function) f,
+ void do_execute(Function&& f,
execution::blocking_t::never_t) const;
// The allocator used for execution functions.
@@ -441,7 +428,7 @@ private:
* immediately.
*/
typedef basic_system_executor<execution::blocking_t::possibly_t,
- execution::relationship_t::fork_t, std::allocator<void> >
+ execution::relationship_t::fork_t, std::allocator<void>>
system_executor;
#if !defined(GENERATING_DOCUMENTATION)
@@ -455,8 +442,8 @@ struct equality_comparable<
asio::basic_system_executor<Blocking, Relationship, Allocator>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -470,8 +457,8 @@ struct execute_member<
Function
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -485,8 +472,8 @@ struct require_member<
asio::execution::blocking_t::possibly_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::basic_system_executor<
asio::execution::blocking_t::possibly_t,
Relationship, Allocator> result_type;
@@ -498,8 +485,8 @@ struct require_member<
asio::execution::blocking_t::always_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::basic_system_executor<
asio::execution::blocking_t::always_t,
Relationship, Allocator> result_type;
@@ -511,8 +498,8 @@ struct require_member<
asio::execution::blocking_t::never_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::basic_system_executor<
asio::execution::blocking_t::never_t,
Relationship, Allocator> result_type;
@@ -524,8 +511,8 @@ struct require_member<
asio::execution::relationship_t::fork_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::basic_system_executor<Blocking,
asio::execution::relationship_t::fork_t,
Allocator> result_type;
@@ -537,8 +524,8 @@ struct require_member<
asio::execution::relationship_t::continuation_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::basic_system_executor<Blocking,
asio::execution::relationship_t::continuation_t,
Allocator> result_type;
@@ -550,10 +537,10 @@ struct require_member<
asio::execution::allocator_t<void>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::basic_system_executor<Blocking,
- Relationship, std::allocator<void> > result_type;
+ Relationship, std::allocator<void>> result_type;
};
template <typename Blocking, typename Relationship,
@@ -563,8 +550,8 @@ struct require_member<
asio::execution::allocator_t<OtherAllocator>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::basic_system_executor<Blocking,
Relationship, OtherAllocator> result_type;
};
@@ -586,11 +573,11 @@ struct query_static_constexpr_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::mapping_t::thread_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -613,8 +600,8 @@ struct query_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::blocking_t result_type;
};
@@ -631,8 +618,8 @@ struct query_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::relationship_t result_type;
};
@@ -642,8 +629,8 @@ struct query_member<
asio::execution::context_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::system_context& result_type;
};
@@ -653,8 +640,8 @@ struct query_member<
asio::execution::allocator_t<void>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Allocator result_type;
};
@@ -664,8 +651,8 @@ struct query_member<
asio::execution::allocator_t<Allocator>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Allocator result_type;
};
diff --git a/3rdparty/asio/include/asio/system_timer.hpp b/3rdparty/asio/include/asio/system_timer.hpp
index 75425ebad55..7b5e768032f 100644
--- a/3rdparty/asio/include/asio/system_timer.hpp
+++ b/3rdparty/asio/include/asio/system_timer.hpp
@@ -2,7 +2,7 @@
// system_timer.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
-
#include "asio/basic_waitable_timer.hpp"
#include "asio/detail/chrono.hpp"
@@ -37,6 +34,4 @@ typedef basic_waitable_timer<chrono::system_clock> system_timer;
} // namespace asio
-#endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION)
-
#endif // ASIO_SYSTEM_TIMER_HPP
diff --git a/3rdparty/asio/include/asio/this_coro.hpp b/3rdparty/asio/include/asio/this_coro.hpp
index 6db27174649..37381b92abf 100644
--- a/3rdparty/asio/include/asio/this_coro.hpp
+++ b/3rdparty/asio/include/asio/this_coro.hpp
@@ -2,7 +2,7 @@
// this_coro.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -26,22 +26,18 @@ namespace this_coro {
/// Awaitable type that returns the executor of the current coroutine.
struct executor_t
{
- ASIO_CONSTEXPR executor_t()
+ constexpr executor_t()
{
}
};
/// Awaitable object that returns the executor of the current coroutine.
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr executor_t executor;
-#elif defined(ASIO_MSVC)
-__declspec(selectany) executor_t executor;
-#endif
/// Awaitable type that returns the cancellation state of the current coroutine.
struct cancellation_state_t
{
- ASIO_CONSTEXPR cancellation_state_t()
+ constexpr cancellation_state_t()
{
}
};
@@ -61,11 +57,7 @@ struct cancellation_state_t
* // ...
* } @endcode
*/
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr cancellation_state_t cancellation_state;
-#elif defined(ASIO_MSVC)
-__declspec(selectany) cancellation_state_t cancellation_state;
-#endif
#if defined(GENERATING_DOCUMENTATION)
@@ -73,7 +65,7 @@ __declspec(selectany) cancellation_state_t cancellation_state;
/// of the current coroutine.
/**
* Let <tt>P</tt> be the cancellation slot associated with the current
- * coroutine's `co_spawn` completion handler. Assigns a new
+ * coroutine's @ref co_spawn completion handler. Assigns a new
* asio::cancellation_state object <tt>S</tt>, constructed as
* <tt>S(P)</tt>, into the current coroutine's cancellation state object.
*
@@ -88,14 +80,14 @@ __declspec(selectany) cancellation_state_t cancellation_state;
* @note The cancellation state is shared by all coroutines in the same "thread
* of execution" that was created using asio::co_spawn.
*/
-ASIO_NODISCARD ASIO_CONSTEXPR unspecified
+ASIO_NODISCARD constexpr unspecified
reset_cancellation_state();
/// Returns an awaitable object that may be used to reset the cancellation state
/// of the current coroutine.
/**
* Let <tt>P</tt> be the cancellation slot associated with the current
- * coroutine's `co_spawn` completion handler. Assigns a new
+ * coroutine's @ref co_spawn completion handler. Assigns a new
* asio::cancellation_state object <tt>S</tt>, constructed as <tt>S(P,
* std::forward<Filter>(filter))</tt>, into the current coroutine's
* cancellation state object.
@@ -113,14 +105,14 @@ reset_cancellation_state();
* of execution" that was created using asio::co_spawn.
*/
template <typename Filter>
-ASIO_NODISCARD ASIO_CONSTEXPR unspecified
-reset_cancellation_state(ASIO_MOVE_ARG(Filter) filter);
+ASIO_NODISCARD constexpr unspecified
+reset_cancellation_state(Filter&& filter);
/// Returns an awaitable object that may be used to reset the cancellation state
/// of the current coroutine.
/**
* Let <tt>P</tt> be the cancellation slot associated with the current
- * coroutine's `co_spawn` completion handler. Assigns a new
+ * coroutine's @ref co_spawn completion handler. Assigns a new
* asio::cancellation_state object <tt>S</tt>, constructed as <tt>S(P,
* std::forward<InFilter>(in_filter),
* std::forward<OutFilter>(out_filter))</tt>, into the current coroutine's
@@ -140,10 +132,10 @@ reset_cancellation_state(ASIO_MOVE_ARG(Filter) filter);
* of execution" that was created using asio::co_spawn.
*/
template <typename InFilter, typename OutFilter>
-ASIO_NODISCARD ASIO_CONSTEXPR unspecified
+ASIO_NODISCARD constexpr unspecified
reset_cancellation_state(
- ASIO_MOVE_ARG(InFilter) in_filter,
- ASIO_MOVE_ARG(OutFilter) out_filter);
+ InFilter&& in_filter,
+ OutFilter&& out_filter);
/// Returns an awaitable object that may be used to determine whether the
/// coroutine throws if trying to suspend when it has been cancelled.
@@ -157,7 +149,7 @@ reset_cancellation_state(
* // ...
* } @endcode
*/
-ASIO_NODISCARD ASIO_CONSTEXPR unspecified
+ASIO_NODISCARD constexpr unspecified
throw_if_cancelled();
/// Returns an awaitable object that may be used to specify whether the
@@ -171,19 +163,19 @@ throw_if_cancelled();
* // ...
* } @endcode
*/
-ASIO_NODISCARD ASIO_CONSTEXPR unspecified
+ASIO_NODISCARD constexpr unspecified
throw_if_cancelled(bool value);
#else // defined(GENERATING_DOCUMENTATION)
struct reset_cancellation_state_0_t
{
- ASIO_CONSTEXPR reset_cancellation_state_0_t()
+ constexpr reset_cancellation_state_0_t()
{
}
};
-ASIO_NODISCARD inline ASIO_CONSTEXPR reset_cancellation_state_0_t
+ASIO_NODISCARD inline constexpr reset_cancellation_state_0_t
reset_cancellation_state()
{
return reset_cancellation_state_0_t();
@@ -193,9 +185,9 @@ template <typename Filter>
struct reset_cancellation_state_1_t
{
template <typename F>
- ASIO_CONSTEXPR reset_cancellation_state_1_t(
- ASIO_MOVE_ARG(F) filter)
- : filter(ASIO_MOVE_CAST(F)(filter))
+ explicit constexpr reset_cancellation_state_1_t(
+ F&& filt)
+ : filter(static_cast<F&&>(filt))
{
}
@@ -203,22 +195,22 @@ struct reset_cancellation_state_1_t
};
template <typename Filter>
-ASIO_NODISCARD inline ASIO_CONSTEXPR reset_cancellation_state_1_t<
- typename decay<Filter>::type>
-reset_cancellation_state(ASIO_MOVE_ARG(Filter) filter)
+ASIO_NODISCARD inline constexpr reset_cancellation_state_1_t<
+ decay_t<Filter>>
+reset_cancellation_state(Filter&& filter)
{
- return reset_cancellation_state_1_t<typename decay<Filter>::type>(
- ASIO_MOVE_CAST(Filter)(filter));
+ return reset_cancellation_state_1_t<decay_t<Filter>>(
+ static_cast<Filter&&>(filter));
}
template <typename InFilter, typename OutFilter>
struct reset_cancellation_state_2_t
{
template <typename F1, typename F2>
- ASIO_CONSTEXPR reset_cancellation_state_2_t(
- ASIO_MOVE_ARG(F1) in_filter, ASIO_MOVE_ARG(F2) out_filter)
- : in_filter(ASIO_MOVE_CAST(F1)(in_filter)),
- out_filter(ASIO_MOVE_CAST(F2)(out_filter))
+ constexpr reset_cancellation_state_2_t(
+ F1&& in_filt, F2&& out_filt)
+ : in_filter(static_cast<F1&&>(in_filt)),
+ out_filter(static_cast<F2&&>(out_filt))
{
}
@@ -227,28 +219,23 @@ struct reset_cancellation_state_2_t
};
template <typename InFilter, typename OutFilter>
-ASIO_NODISCARD inline ASIO_CONSTEXPR reset_cancellation_state_2_t<
- typename decay<InFilter>::type,
- typename decay<OutFilter>::type>
-reset_cancellation_state(
- ASIO_MOVE_ARG(InFilter) in_filter,
- ASIO_MOVE_ARG(OutFilter) out_filter)
+ASIO_NODISCARD inline constexpr
+reset_cancellation_state_2_t<decay_t<InFilter>, decay_t<OutFilter>>
+reset_cancellation_state(InFilter&& in_filter, OutFilter&& out_filter)
{
- return reset_cancellation_state_2_t<
- typename decay<InFilter>::type,
- typename decay<OutFilter>::type>(
- ASIO_MOVE_CAST(InFilter)(in_filter),
- ASIO_MOVE_CAST(OutFilter)(out_filter));
+ return reset_cancellation_state_2_t<decay_t<InFilter>, decay_t<OutFilter>>(
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter));
}
struct throw_if_cancelled_0_t
{
- ASIO_CONSTEXPR throw_if_cancelled_0_t()
+ constexpr throw_if_cancelled_0_t()
{
}
};
-ASIO_NODISCARD inline ASIO_CONSTEXPR throw_if_cancelled_0_t
+ASIO_NODISCARD inline constexpr throw_if_cancelled_0_t
throw_if_cancelled()
{
return throw_if_cancelled_0_t();
@@ -256,15 +243,15 @@ throw_if_cancelled()
struct throw_if_cancelled_1_t
{
- ASIO_CONSTEXPR throw_if_cancelled_1_t(bool value)
- : value(value)
+ explicit constexpr throw_if_cancelled_1_t(bool val)
+ : value(val)
{
}
bool value;
};
-ASIO_NODISCARD inline ASIO_CONSTEXPR throw_if_cancelled_1_t
+ASIO_NODISCARD inline constexpr throw_if_cancelled_1_t
throw_if_cancelled(bool value)
{
return throw_if_cancelled_1_t(value);
diff --git a/3rdparty/asio/include/asio/thread.hpp b/3rdparty/asio/include/asio/thread.hpp
index d15c8ad5e5d..fc57bffdd9e 100644
--- a/3rdparty/asio/include/asio/thread.hpp
+++ b/3rdparty/asio/include/asio/thread.hpp
@@ -2,7 +2,7 @@
// thread.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/thread_pool.hpp b/3rdparty/asio/include/asio/thread_pool.hpp
index f8fae0175ea..f9095d9441a 100644
--- a/3rdparty/asio/include/asio/thread_pool.hpp
+++ b/3rdparty/asio/include/asio/thread_pool.hpp
@@ -2,7 +2,7 @@
// thread_pool.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -28,11 +28,11 @@ namespace asio {
namespace detail {
struct thread_pool_bits
{
- ASIO_STATIC_CONSTEXPR(unsigned int, blocking_never = 1);
- ASIO_STATIC_CONSTEXPR(unsigned int, blocking_always = 2);
- ASIO_STATIC_CONSTEXPR(unsigned int, blocking_mask = 3);
- ASIO_STATIC_CONSTEXPR(unsigned int, relationship_continuation = 4);
- ASIO_STATIC_CONSTEXPR(unsigned int, outstanding_work_tracked = 8);
+ static constexpr unsigned int blocking_never = 1;
+ static constexpr unsigned int blocking_always = 2;
+ static constexpr unsigned int blocking_mask = 3;
+ static constexpr unsigned int relationship_continuation = 4;
+ static constexpr unsigned int outstanding_work_tracked = 8;
};
} // namespace detail
@@ -84,9 +84,6 @@ public:
/// Executor used to submit functions to a thread pool.
typedef basic_executor_type<std::allocator<void>, 0> executor_type;
- /// Scheduler used to schedule receivers on a thread pool.
- typedef basic_executor_type<std::allocator<void>, 0> scheduler_type;
-
#if !defined(ASIO_NO_TS_EXECUTORS)
/// Constructs a pool with an automatically determined number of threads.
ASIO_DECL thread_pool();
@@ -102,13 +99,10 @@ public:
ASIO_DECL ~thread_pool();
/// Obtains the executor associated with the pool.
- executor_type get_executor() ASIO_NOEXCEPT;
+ executor_type get_executor() noexcept;
/// Obtains the executor associated with the pool.
- executor_type executor() ASIO_NOEXCEPT;
-
- /// Obtains the scheduler associated with the pool.
- scheduler_type scheduler() ASIO_NOEXCEPT;
+ executor_type executor() noexcept;
/// Stops the threads.
/**
@@ -142,8 +136,8 @@ public:
ASIO_DECL void wait();
private:
- thread_pool(const thread_pool&) ASIO_DELETED;
- thread_pool& operator=(const thread_pool&) ASIO_DELETED;
+ thread_pool(const thread_pool&) = delete;
+ thread_pool& operator=(const thread_pool&) = delete;
struct thread_function;
@@ -165,32 +159,8 @@ template <typename Allocator, unsigned int Bits>
class thread_pool::basic_executor_type : detail::thread_pool_bits
{
public:
- /// The sender type, when this type is used as a scheduler.
- typedef basic_executor_type sender_type;
-
- /// The bulk execution shape type.
- typedef std::size_t shape_type;
-
- /// The bulk execution index type.
- typedef std::size_t index_type;
-
-#if defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT) \
- && defined(ASIO_HAS_STD_EXCEPTION_PTR)
- template <
- template <typename...> class Tuple,
- template <typename...> class Variant>
- using value_types = Variant<Tuple<>>;
-
- template <template <typename...> class Variant>
- using error_types = Variant<std::exception_ptr>;
-
- ASIO_STATIC_CONSTEXPR(bool, sends_done = true);
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
- // && defined(ASIO_HAS_STD_EXCEPTION_PTR)
-
/// Copy constructor.
- basic_executor_type(
- const basic_executor_type& other) ASIO_NOEXCEPT
+ basic_executor_type(const basic_executor_type& other) noexcept
: pool_(other.pool_),
allocator_(other.allocator_),
bits_(other.bits_)
@@ -200,20 +170,18 @@ public:
pool_->scheduler_.work_started();
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move constructor.
- basic_executor_type(basic_executor_type&& other) ASIO_NOEXCEPT
+ basic_executor_type(basic_executor_type&& other) noexcept
: pool_(other.pool_),
- allocator_(ASIO_MOVE_CAST(Allocator)(other.allocator_)),
+ allocator_(static_cast<Allocator&&>(other.allocator_)),
bits_(other.bits_)
{
if (Bits & outstanding_work_tracked)
other.pool_ = 0;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Destructor.
- ~basic_executor_type() ASIO_NOEXCEPT
+ ~basic_executor_type() noexcept
{
if (Bits & outstanding_work_tracked)
if (pool_)
@@ -221,14 +189,10 @@ public:
}
/// Assignment operator.
- basic_executor_type& operator=(
- const basic_executor_type& other) ASIO_NOEXCEPT;
+ basic_executor_type& operator=(const basic_executor_type& other) noexcept;
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move assignment operator.
- basic_executor_type& operator=(
- basic_executor_type&& other) ASIO_NOEXCEPT;
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+ basic_executor_type& operator=(basic_executor_type&& other) noexcept;
#if !defined(GENERATING_DOCUMENTATION)
private:
@@ -246,7 +210,7 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::blocking.possibly); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type<Allocator,
+ constexpr basic_executor_type<Allocator,
ASIO_UNSPECIFIED(Bits & ~blocking_mask)>
require(execution::blocking_t::possibly_t) const
{
@@ -264,7 +228,7 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::blocking.always); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type<Allocator,
+ constexpr basic_executor_type<Allocator,
ASIO_UNSPECIFIED((Bits & ~blocking_mask) | blocking_always)>
require(execution::blocking_t::always_t) const
{
@@ -283,7 +247,7 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::blocking.never); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type<Allocator,
+ constexpr basic_executor_type<Allocator,
ASIO_UNSPECIFIED(Bits & ~blocking_mask)>
require(execution::blocking_t::never_t) const
{
@@ -301,8 +265,7 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::relationship.fork); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type require(
- execution::relationship_t::fork_t) const
+ constexpr basic_executor_type require(execution::relationship_t::fork_t) const
{
return basic_executor_type(pool_,
allocator_, bits_ & ~relationship_continuation);
@@ -318,7 +281,7 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::relationship.continuation); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type require(
+ constexpr basic_executor_type require(
execution::relationship_t::continuation_t) const
{
return basic_executor_type(pool_,
@@ -335,7 +298,7 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::outstanding_work.tracked); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type<Allocator,
+ constexpr basic_executor_type<Allocator,
ASIO_UNSPECIFIED(Bits | outstanding_work_tracked)>
require(execution::outstanding_work_t::tracked_t) const
{
@@ -353,7 +316,7 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::outstanding_work.untracked); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type<Allocator,
+ constexpr basic_executor_type<Allocator,
ASIO_UNSPECIFIED(Bits & ~outstanding_work_tracked)>
require(execution::outstanding_work_t::untracked_t) const
{
@@ -372,7 +335,7 @@ private:
* asio::execution::allocator(my_allocator)); @endcode
*/
template <typename OtherAllocator>
- ASIO_CONSTEXPR basic_executor_type<OtherAllocator, Bits>
+ constexpr basic_executor_type<OtherAllocator, Bits>
require(execution::allocator_t<OtherAllocator> a) const
{
return basic_executor_type<OtherAllocator, Bits>(
@@ -389,7 +352,7 @@ private:
* auto ex2 = asio::require(ex1,
* asio::execution::allocator); @endcode
*/
- ASIO_CONSTEXPR basic_executor_type<std::allocator<void>, Bits>
+ constexpr basic_executor_type<std::allocator<void>, Bits>
require(execution::allocator_t<void>) const
{
return basic_executor_type<std::allocator<void>, Bits>(
@@ -403,23 +366,6 @@ private:
friend struct asio::execution::detail::outstanding_work_t<0>;
#endif // !defined(GENERATING_DOCUMENTATION)
- /// Query the current value of the @c bulk_guarantee property.
- /**
- * Do not call this function directly. It is intended for use with the
- * asio::query customisation point.
- *
- * For example:
- * @code auto ex = my_thread_pool.executor();
- * if (asio::query(ex, asio::execution::bulk_guarantee)
- * == asio::execution::bulk_guarantee.parallel)
- * ... @endcode
- */
- static ASIO_CONSTEXPR execution::bulk_guarantee_t query(
- execution::bulk_guarantee_t) ASIO_NOEXCEPT
- {
- return execution::bulk_guarantee.parallel;
- }
-
/// Query the current value of the @c mapping property.
/**
* Do not call this function directly. It is intended for use with the
@@ -431,8 +377,7 @@ private:
* == asio::execution::mapping.thread)
* ... @endcode
*/
- static ASIO_CONSTEXPR execution::mapping_t query(
- execution::mapping_t) ASIO_NOEXCEPT
+ static constexpr execution::mapping_t query(execution::mapping_t) noexcept
{
return execution::mapping.thread;
}
@@ -447,7 +392,7 @@ private:
* asio::thread_pool& pool = asio::query(
* ex, asio::execution::context); @endcode
*/
- thread_pool& query(execution::context_t) const ASIO_NOEXCEPT
+ thread_pool& query(execution::context_t) const noexcept
{
return *pool_;
}
@@ -463,8 +408,7 @@ private:
* == asio::execution::blocking.always)
* ... @endcode
*/
- ASIO_CONSTEXPR execution::blocking_t query(
- execution::blocking_t) const ASIO_NOEXCEPT
+ constexpr execution::blocking_t query(execution::blocking_t) const noexcept
{
return (bits_ & blocking_never)
? execution::blocking_t(execution::blocking.never)
@@ -484,8 +428,8 @@ private:
* == asio::execution::relationship.continuation)
* ... @endcode
*/
- ASIO_CONSTEXPR execution::relationship_t query(
- execution::relationship_t) const ASIO_NOEXCEPT
+ constexpr execution::relationship_t query(
+ execution::relationship_t) const noexcept
{
return (bits_ & relationship_continuation)
? execution::relationship_t(execution::relationship.continuation)
@@ -503,8 +447,8 @@ private:
* == asio::execution::outstanding_work.tracked)
* ... @endcode
*/
- static ASIO_CONSTEXPR execution::outstanding_work_t query(
- execution::outstanding_work_t) ASIO_NOEXCEPT
+ static constexpr execution::outstanding_work_t query(
+ execution::outstanding_work_t) noexcept
{
return (Bits & outstanding_work_tracked)
? execution::outstanding_work_t(execution::outstanding_work.tracked)
@@ -522,8 +466,8 @@ private:
* asio::execution::allocator); @endcode
*/
template <typename OtherAllocator>
- ASIO_CONSTEXPR Allocator query(
- execution::allocator_t<OtherAllocator>) const ASIO_NOEXCEPT
+ constexpr Allocator query(
+ execution::allocator_t<OtherAllocator>) const noexcept
{
return allocator_;
}
@@ -538,8 +482,7 @@ private:
* auto alloc = asio::query(ex,
* asio::execution::allocator); @endcode
*/
- ASIO_CONSTEXPR Allocator query(
- execution::allocator_t<void>) const ASIO_NOEXCEPT
+ constexpr Allocator query(execution::allocator_t<void>) const noexcept
{
return allocator_;
}
@@ -554,7 +497,7 @@ private:
* std::size_t occupancy = asio::query(
* ex, asio::execution::occupancy); @endcode
*/
- std::size_t query(execution::occupancy_t) const ASIO_NOEXCEPT
+ std::size_t query(execution::occupancy_t) const noexcept
{
return static_cast<std::size_t>(pool_->num_threads_);
}
@@ -565,14 +508,14 @@ public:
* @return @c true if the current thread is running the thread pool. Otherwise
* returns @c false.
*/
- bool running_in_this_thread() const ASIO_NOEXCEPT;
+ bool running_in_this_thread() const noexcept;
/// Compare two executors for equality.
/**
* Two executors are equal if they refer to the same underlying thread pool.
*/
friend bool operator==(const basic_executor_type& a,
- const basic_executor_type& b) ASIO_NOEXCEPT
+ const basic_executor_type& b) noexcept
{
return a.pool_ == b.pool_
&& a.allocator_ == b.allocator_
@@ -584,78 +527,25 @@ public:
* Two executors are equal if they refer to the same underlying thread pool.
*/
friend bool operator!=(const basic_executor_type& a,
- const basic_executor_type& b) ASIO_NOEXCEPT
+ const basic_executor_type& b) noexcept
{
return a.pool_ != b.pool_
|| a.allocator_ != b.allocator_
|| a.bits_ != b.bits_;
}
-#if !defined(GENERATING_DOCUMENTATION)
-private:
- friend struct asio_execution_execute_fn::impl;
-#endif // !defined(GENERATING_DOCUMENTATION)
-
/// Execution function.
- /**
- * Do not call this function directly. It is intended for use with the
- * execution::execute customisation point.
- *
- * For example:
- * @code auto ex = my_thread_pool.executor();
- * execution::execute(ex, my_function_object); @endcode
- */
template <typename Function>
- void execute(ASIO_MOVE_ARG(Function) f) const
+ void execute(Function&& f) const
{
- this->do_execute(ASIO_MOVE_CAST(Function)(f),
+ this->do_execute(static_cast<Function&&>(f),
integral_constant<bool, (Bits & blocking_always) != 0>());
}
public:
- /// Bulk execution function.
- template <typename Function>
- void bulk_execute(ASIO_MOVE_ARG(Function) f, std::size_t n) const
- {
- this->do_bulk_execute(ASIO_MOVE_CAST(Function)(f), n,
- integral_constant<bool, (Bits & blocking_always) != 0>());
- }
-
- /// Schedule function.
- /**
- * Do not call this function directly. It is intended for use with the
- * execution::schedule customisation point.
- *
- * @return An object that satisfies the sender concept.
- */
- sender_type schedule() const ASIO_NOEXCEPT
- {
- return *this;
- }
-
- /// Connect function.
- /**
- * Do not call this function directly. It is intended for use with the
- * execution::connect customisation point.
- *
- * @return An object of an unspecified type that satisfies the @c
- * operation_state concept.
- */
- template <ASIO_EXECUTION_RECEIVER_OF_0 Receiver>
-#if defined(GENERATING_DOCUMENTATION)
- unspecified
-#else // defined(GENERATING_DOCUMENTATION)
- execution::detail::as_operation<basic_executor_type, Receiver>
-#endif // defined(GENERATING_DOCUMENTATION)
- connect(ASIO_MOVE_ARG(Receiver) r) const
- {
- return execution::detail::as_operation<basic_executor_type, Receiver>(
- *this, ASIO_MOVE_CAST(Receiver)(r));
- }
-
#if !defined(ASIO_NO_TS_EXECUTORS)
/// Obtain the underlying execution context.
- thread_pool& context() const ASIO_NOEXCEPT;
+ thread_pool& context() const noexcept;
/// Inform the thread pool that it has some outstanding work to do.
/**
@@ -663,7 +553,7 @@ public:
* This ensures that the thread pool's join() function will not return while
* the work is underway.
*/
- void on_work_started() const ASIO_NOEXCEPT;
+ void on_work_started() const noexcept;
/// Inform the thread pool that some work is no longer outstanding.
/**
@@ -671,7 +561,7 @@ public:
* finished. Once the count of unfinished work reaches zero, the thread
* pool's join() function is permitted to exit.
*/
- void on_work_finished() const ASIO_NOEXCEPT;
+ void on_work_finished() const noexcept;
/// Request the thread pool to invoke the given function object.
/**
@@ -688,8 +578,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename OtherAllocator>
- void dispatch(ASIO_MOVE_ARG(Function) f,
- const OtherAllocator& a) const;
+ void dispatch(Function&& f, const OtherAllocator& a) const;
/// Request the thread pool to invoke the given function object.
/**
@@ -705,8 +594,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename OtherAllocator>
- void post(ASIO_MOVE_ARG(Function) f,
- const OtherAllocator& a) const;
+ void post(Function&& f, const OtherAllocator& a) const;
/// Request the thread pool to invoke the given function object.
/**
@@ -726,8 +614,7 @@ public:
* internal storage needed for function invocation.
*/
template <typename Function, typename OtherAllocator>
- void defer(ASIO_MOVE_ARG(Function) f,
- const OtherAllocator& a) const;
+ void defer(Function&& f, const OtherAllocator& a) const;
#endif // !defined(ASIO_NO_TS_EXECUTORS)
private:
@@ -735,7 +622,7 @@ private:
template <typename, unsigned int> friend class basic_executor_type;
// Constructor used by thread_pool::get_executor().
- explicit basic_executor_type(thread_pool& p) ASIO_NOEXCEPT
+ explicit basic_executor_type(thread_pool& p) noexcept
: pool_(&p),
allocator_(),
bits_(0)
@@ -746,7 +633,7 @@ private:
// Constructor used by require().
basic_executor_type(thread_pool* p,
- const Allocator& a, unsigned int bits) ASIO_NOEXCEPT
+ const Allocator& a, unsigned int bits) noexcept
: pool_(p),
allocator_(a),
bits_(bits)
@@ -758,21 +645,11 @@ private:
/// Execution helper implementation for possibly and never blocking.
template <typename Function>
- void do_execute(ASIO_MOVE_ARG(Function) f, false_type) const;
+ void do_execute(Function&& f, false_type) const;
/// Execution helper implementation for always blocking.
template <typename Function>
- void do_execute(ASIO_MOVE_ARG(Function) f, true_type) const;
-
- /// Bulk execution helper implementation for possibly and never blocking.
- template <typename Function>
- void do_bulk_execute(ASIO_MOVE_ARG(Function) f,
- std::size_t n, false_type) const;
-
- /// Bulk execution helper implementation for always blocking.
- template <typename Function>
- void do_bulk_execute(ASIO_MOVE_ARG(Function) f,
- std::size_t n, true_type) const;
+ void do_execute(Function&& f, true_type) const;
// The underlying thread pool.
thread_pool* pool_;
@@ -795,8 +672,8 @@ struct equality_comparable<
asio::thread_pool::basic_executor_type<Allocator, Bits>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -809,45 +686,13 @@ struct execute_member<
Function
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT)
-
-template <typename Allocator, unsigned int Bits>
-struct schedule_member<
- const asio::thread_pool::basic_executor_type<Allocator, Bits>
- >
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef asio::thread_pool::basic_executor_type<
- Allocator, Bits> result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename Allocator, unsigned int Bits, typename Receiver>
-struct connect_member<
- const asio::thread_pool::basic_executor_type<Allocator, Bits>,
- Receiver
- >
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef asio::execution::detail::as_operation<
- asio::thread_pool::basic_executor_type<Allocator, Bits>,
- Receiver> result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
template <typename Allocator, unsigned int Bits>
@@ -856,8 +701,8 @@ struct require_member<
asio::execution::blocking_t::possibly_t
> : asio::detail::thread_pool_bits
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::thread_pool::basic_executor_type<
Allocator, Bits & ~blocking_mask> result_type;
};
@@ -868,8 +713,8 @@ struct require_member<
asio::execution::blocking_t::always_t
> : asio::detail::thread_pool_bits
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::thread_pool::basic_executor_type<Allocator,
(Bits & ~blocking_mask) | blocking_always> result_type;
};
@@ -880,8 +725,8 @@ struct require_member<
asio::execution::blocking_t::never_t
> : asio::detail::thread_pool_bits
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::thread_pool::basic_executor_type<
Allocator, Bits & ~blocking_mask> result_type;
};
@@ -892,8 +737,8 @@ struct require_member<
asio::execution::relationship_t::fork_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::thread_pool::basic_executor_type<
Allocator, Bits> result_type;
};
@@ -904,8 +749,8 @@ struct require_member<
asio::execution::relationship_t::continuation_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::thread_pool::basic_executor_type<
Allocator, Bits> result_type;
};
@@ -916,8 +761,8 @@ struct require_member<
asio::execution::outstanding_work_t::tracked_t
> : asio::detail::thread_pool_bits
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::thread_pool::basic_executor_type<
Allocator, Bits | outstanding_work_tracked> result_type;
};
@@ -928,8 +773,8 @@ struct require_member<
asio::execution::outstanding_work_t::untracked_t
> : asio::detail::thread_pool_bits
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::thread_pool::basic_executor_type<
Allocator, Bits & ~outstanding_work_tracked> result_type;
};
@@ -940,8 +785,8 @@ struct require_member<
asio::execution::allocator_t<void>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::thread_pool::basic_executor_type<
std::allocator<void>, Bits> result_type;
};
@@ -953,8 +798,8 @@ struct require_member<
asio::execution::allocator_t<OtherAllocator>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef asio::thread_pool::basic_executor_type<
OtherAllocator, Bits> result_type;
};
@@ -970,38 +815,16 @@ struct query_static_constexpr_member<
typename asio::enable_if<
asio::is_convertible<
Property,
- asio::execution::bulk_guarantee_t
- >::value
- >::type
- >
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef asio::execution::bulk_guarantee_t::parallel_t result_type;
-
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
- {
- return result_type();
- }
-};
-
-template <typename Allocator, unsigned int Bits, typename Property>
-struct query_static_constexpr_member<
- asio::thread_pool::basic_executor_type<Allocator, Bits>,
- Property,
- typename asio::enable_if<
- asio::is_convertible<
- Property,
asio::execution::outstanding_work_t
>::value
>::type
> : asio::detail::thread_pool_bits
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::outstanding_work_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return (Bits & outstanding_work_tracked)
? execution::outstanding_work_t(execution::outstanding_work.tracked)
@@ -1021,11 +844,11 @@ struct query_static_constexpr_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::mapping_t::thread_t result_type;
- static ASIO_CONSTEXPR result_type value() ASIO_NOEXCEPT
+ static constexpr result_type value() noexcept
{
return result_type();
}
@@ -1047,8 +870,8 @@ struct query_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::blocking_t result_type;
};
@@ -1064,8 +887,8 @@ struct query_member<
>::type
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::execution::relationship_t result_type;
};
@@ -1075,8 +898,8 @@ struct query_member<
asio::execution::occupancy_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef std::size_t result_type;
};
@@ -1086,8 +909,8 @@ struct query_member<
asio::execution::context_t
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef asio::thread_pool& result_type;
};
@@ -1097,8 +920,8 @@ struct query_member<
asio::execution::allocator_t<void>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Allocator result_type;
};
@@ -1108,8 +931,8 @@ struct query_member<
asio::execution::allocator_t<OtherAllocator>
>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Allocator result_type;
};
@@ -1117,6 +940,15 @@ struct query_member<
} // namespace traits
+namespace execution {
+
+template <>
+struct is_executor<thread_pool> : false_type
+{
+};
+
+} // namespace execution
+
#endif // !defined(GENERATING_DOCUMENTATION)
} // namespace asio
diff --git a/3rdparty/asio/include/asio/time_traits.hpp b/3rdparty/asio/include/asio/time_traits.hpp
index 7f847e89b90..f3980233eab 100644
--- a/3rdparty/asio/include/asio/time_traits.hpp
+++ b/3rdparty/asio/include/asio/time_traits.hpp
@@ -2,7 +2,7 @@
// time_traits.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/traits/bulk_execute_free.hpp b/3rdparty/asio/include/asio/traits/bulk_execute_free.hpp
deleted file mode 100644
index 3e089bc3ac7..00000000000
--- a/3rdparty/asio/include/asio/traits/bulk_execute_free.hpp
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// traits/bulk_execute_free.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_BULK_EXECUTE_FREE_HPP
-#define ASIO_TRAITS_BULK_EXECUTE_FREE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_BULK_EXECUTE_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename F, typename N, typename = void>
-struct bulk_execute_free_default;
-
-template <typename T, typename F, typename N, typename = void>
-struct bulk_execute_free;
-
-} // namespace traits
-namespace detail {
-
-struct no_bulk_execute_free
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_BULK_EXECUTE_FREE_TRAIT)
-
-template <typename T, typename F, typename N, typename = void>
-struct bulk_execute_free_trait : no_bulk_execute_free
-{
-};
-
-template <typename T, typename F, typename N>
-struct bulk_execute_free_trait<T, F, N,
- typename void_type<
- decltype(bulk_execute(declval<T>(), declval<F>(), declval<N>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- bulk_execute(declval<T>(), declval<F>(), declval<N>()));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- bulk_execute(declval<T>(), declval<F>(), declval<N>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_BULK_EXECUTE_FREE_TRAIT)
-
-template <typename T, typename F, typename N, typename = void>
-struct bulk_execute_free_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value
- && is_same<F, typename decay<F>::type>::value
- && is_same<N, typename decay<N>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_bulk_execute_free,
- traits::bulk_execute_free<typename add_const<T>::type, F, N>
- >::type,
- traits::bulk_execute_free<
- typename remove_reference<T>::type,
- typename decay<F>::type,
- typename decay<N>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_BULK_EXECUTE_FREE_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename F, typename N, typename>
-struct bulk_execute_free_default :
- detail::bulk_execute_free_trait<T, F, N>
-{
-};
-
-template <typename T, typename F, typename N, typename>
-struct bulk_execute_free :
- bulk_execute_free_default<T, F, N>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_BULK_EXECUTE_FREE_HPP
diff --git a/3rdparty/asio/include/asio/traits/bulk_execute_member.hpp b/3rdparty/asio/include/asio/traits/bulk_execute_member.hpp
deleted file mode 100644
index f0e1e90dbac..00000000000
--- a/3rdparty/asio/include/asio/traits/bulk_execute_member.hpp
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// traits/bulk_execute_member.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_BULK_EXECUTE_MEMBER_HPP
-#define ASIO_TRAITS_BULK_EXECUTE_MEMBER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_BULK_EXECUTE_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename F, typename N, typename = void>
-struct bulk_execute_member_default;
-
-template <typename T, typename F, typename N, typename = void>
-struct bulk_execute_member;
-
-} // namespace traits
-namespace detail {
-
-struct no_bulk_execute_member
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_BULK_EXECUTE_MEMBER_TRAIT)
-
-template <typename T, typename F, typename N, typename = void>
-struct bulk_execute_member_trait : no_bulk_execute_member
-{
-};
-
-template <typename T, typename F, typename N>
-struct bulk_execute_member_trait<T, F, N,
- typename void_type<
- decltype(declval<T>().bulk_execute(declval<F>(), declval<N>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- declval<T>().bulk_execute(declval<F>(), declval<N>()));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<T>().bulk_execute(declval<F>(), declval<N>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_BULK_EXECUTE_MEMBER_TRAIT)
-
-template <typename T, typename F, typename N, typename = void>
-struct bulk_execute_member_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value
- && is_same<F, typename decay<F>::type>::value
- && is_same<N, typename decay<N>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_bulk_execute_member,
- traits::bulk_execute_member<typename add_const<T>::type, F, N>
- >::type,
- traits::bulk_execute_member<
- typename remove_reference<T>::type,
- typename decay<F>::type,
- typename decay<N>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_BULK_EXECUTE_MEMBER_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename F, typename N, typename>
-struct bulk_execute_member_default :
- detail::bulk_execute_member_trait<T, F, N>
-{
-};
-
-template <typename T, typename F, typename N, typename>
-struct bulk_execute_member :
- bulk_execute_member_default<T, F, N>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_BULK_EXECUTE_MEMBER_HPP
diff --git a/3rdparty/asio/include/asio/traits/connect_free.hpp b/3rdparty/asio/include/asio/traits/connect_free.hpp
deleted file mode 100644
index 96b3ac44078..00000000000
--- a/3rdparty/asio/include/asio/traits/connect_free.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// traits/connect_free.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_CONNECT_FREE_HPP
-#define ASIO_TRAITS_CONNECT_FREE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename S, typename R, typename = void>
-struct connect_free_default;
-
-template <typename S, typename R, typename = void>
-struct connect_free;
-
-} // namespace traits
-namespace detail {
-
-struct no_connect_free
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-template <typename S, typename R, typename = void>
-struct connect_free_trait : no_connect_free
-{
-};
-
-template <typename S, typename R>
-struct connect_free_trait<S, R,
- typename void_type<
- decltype(connect(declval<S>(), declval<R>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- connect(declval<S>(), declval<R>()));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- connect(declval<S>(), declval<R>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-template <typename S, typename R, typename = void>
-struct connect_free_trait :
- conditional<
- is_same<S, typename remove_reference<S>::type>::value
- && is_same<R, typename decay<R>::type>::value,
- typename conditional<
- is_same<S, typename add_const<S>::type>::value,
- no_connect_free,
- traits::connect_free<typename add_const<S>::type, R>
- >::type,
- traits::connect_free<
- typename remove_reference<S>::type,
- typename decay<R>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename S, typename R, typename>
-struct connect_free_default :
- detail::connect_free_trait<S, R>
-{
-};
-
-template <typename S, typename R, typename>
-struct connect_free :
- connect_free_default<S, R>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_CONNECT_FREE_HPP
diff --git a/3rdparty/asio/include/asio/traits/connect_member.hpp b/3rdparty/asio/include/asio/traits/connect_member.hpp
deleted file mode 100644
index d73beed5453..00000000000
--- a/3rdparty/asio/include/asio/traits/connect_member.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// traits/connect_member.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_CONNECT_MEMBER_HPP
-#define ASIO_TRAITS_CONNECT_MEMBER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename S, typename R, typename = void>
-struct connect_member_default;
-
-template <typename S, typename R, typename = void>
-struct connect_member;
-
-} // namespace traits
-namespace detail {
-
-struct no_connect_member
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename S, typename R, typename = void>
-struct connect_member_trait : no_connect_member
-{
-};
-
-template <typename S, typename R>
-struct connect_member_trait<S, R,
- typename void_type<
- decltype(declval<S>().connect(declval<R>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- declval<S>().connect(declval<R>()));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<S>().connect(declval<R>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename S, typename R, typename = void>
-struct connect_member_trait :
- conditional<
- is_same<S, typename remove_reference<S>::type>::value
- && is_same<R, typename decay<R>::type>::value,
- typename conditional<
- is_same<S, typename add_const<S>::type>::value,
- no_connect_member,
- traits::connect_member<typename add_const<S>::type, R>
- >::type,
- traits::connect_member<
- typename remove_reference<S>::type,
- typename decay<R>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename S, typename R, typename>
-struct connect_member_default :
- detail::connect_member_trait<S, R>
-{
-};
-
-template <typename S, typename R, typename>
-struct connect_member :
- connect_member_default<S, R>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_CONNECT_MEMBER_HPP
diff --git a/3rdparty/asio/include/asio/traits/equality_comparable.hpp b/3rdparty/asio/include/asio/traits/equality_comparable.hpp
index c8418ca3b94..0a6decf2d93 100644
--- a/3rdparty/asio/include/asio/traits/equality_comparable.hpp
+++ b/3rdparty/asio/include/asio/traits/equality_comparable.hpp
@@ -2,7 +2,7 @@
// traits/equality_comparable.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
namespace asio {
namespace traits {
@@ -40,8 +36,8 @@ namespace detail {
struct no_equality_comparable
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -53,7 +49,7 @@ struct equality_comparable_trait : no_equality_comparable
template <typename T>
struct equality_comparable_trait<T,
- typename void_type<
+ void_t<
decltype(
static_cast<void>(
static_cast<bool>(declval<const T>() == declval<const T>())
@@ -62,24 +58,24 @@ struct equality_comparable_trait<T,
static_cast<bool>(declval<const T>() != declval<const T>())
)
)
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
+ static constexpr bool is_noexcept =
noexcept(declval<const T>() == declval<const T>())
- && noexcept(declval<const T>() != declval<const T>()));
+ && noexcept(declval<const T>() != declval<const T>());
};
#else // defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename T, typename = void>
struct equality_comparable_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value,
no_equality_comparable,
- traits::equality_comparable<typename decay<T>::type>
- >::type
+ traits::equality_comparable<decay_t<T>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/execute_free.hpp b/3rdparty/asio/include/asio/traits/execute_free.hpp
deleted file mode 100644
index f66d937b021..00000000000
--- a/3rdparty/asio/include/asio/traits/execute_free.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// traits/execute_free.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_EXECUTE_FREE_HPP
-#define ASIO_TRAITS_EXECUTE_FREE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename F, typename = void>
-struct execute_free_default;
-
-template <typename T, typename F, typename = void>
-struct execute_free;
-
-} // namespace traits
-namespace detail {
-
-struct no_execute_free
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT)
-
-template <typename T, typename F, typename = void>
-struct execute_free_trait : no_execute_free
-{
-};
-
-template <typename T, typename F>
-struct execute_free_trait<T, F,
- typename void_type<
- decltype(execute(declval<T>(), declval<F>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- execute(declval<T>(), declval<F>()));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- execute(declval<T>(), declval<F>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT)
-
-template <typename T, typename F, typename = void>
-struct execute_free_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<F, typename decay<F>::type>::value,
- no_execute_free,
- traits::execute_free<
- typename decay<T>::type,
- typename decay<F>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename F, typename>
-struct execute_free_default :
- detail::execute_free_trait<T, F>
-{
-};
-
-template <typename T, typename F, typename>
-struct execute_free :
- execute_free_default<T, F>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_EXECUTE_FREE_HPP
diff --git a/3rdparty/asio/include/asio/traits/execute_member.hpp b/3rdparty/asio/include/asio/traits/execute_member.hpp
index 01f280d56b4..fc0760bef05 100644
--- a/3rdparty/asio/include/asio/traits/execute_member.hpp
+++ b/3rdparty/asio/include/asio/traits/execute_member.hpp
@@ -2,7 +2,7 @@
// traits/execute_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -42,8 +38,8 @@ namespace detail {
struct no_execute_member
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
@@ -55,31 +51,31 @@ struct execute_member_trait : no_execute_member
template <typename T, typename F>
struct execute_member_trait<T, F,
- typename void_type<
+ void_t<
decltype(declval<T>().execute(declval<F>()))
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().execute(declval<F>()));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<T>().execute(declval<F>())));
+ static constexpr bool is_noexcept =
+ noexcept(declval<T>().execute(declval<F>()));
};
#else // defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename T, typename F, typename = void>
struct execute_member_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<F, typename decay<F>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<F, decay_t<F>>::value,
no_execute_member,
traits::execute_member<
- typename decay<T>::type,
- typename decay<F>::type>
- >::type
+ decay_t<T>,
+ decay_t<F>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/prefer_free.hpp b/3rdparty/asio/include/asio/traits/prefer_free.hpp
index 6be0a363241..c6104d636ed 100644
--- a/3rdparty/asio/include/asio/traits/prefer_free.hpp
+++ b/3rdparty/asio/include/asio/traits/prefer_free.hpp
@@ -2,7 +2,7 @@
// traits/prefer_free.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -42,8 +38,8 @@ namespace detail {
struct no_prefer_free
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
@@ -55,31 +51,31 @@ struct prefer_free_trait : no_prefer_free
template <typename T, typename Property>
struct prefer_free_trait<T, Property,
- typename void_type<
+ void_t<
decltype(prefer(declval<T>(), declval<Property>()))
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
prefer(declval<T>(), declval<Property>()));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- prefer(declval<T>(), declval<Property>())));
+ static constexpr bool is_noexcept =
+ noexcept(prefer(declval<T>(), declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct prefer_free_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_prefer_free,
traits::prefer_free<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/prefer_member.hpp b/3rdparty/asio/include/asio/traits/prefer_member.hpp
index 0dbb1247830..278c25c9964 100644
--- a/3rdparty/asio/include/asio/traits/prefer_member.hpp
+++ b/3rdparty/asio/include/asio/traits/prefer_member.hpp
@@ -2,7 +2,7 @@
// traits/prefer_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -42,8 +38,8 @@ namespace detail {
struct no_prefer_member
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
@@ -55,31 +51,31 @@ struct prefer_member_trait : no_prefer_member
template <typename T, typename Property>
struct prefer_member_trait<T, Property,
- typename void_type<
+ void_t<
decltype(declval<T>().prefer(declval<Property>()))
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().prefer(declval<Property>()));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<T>().prefer(declval<Property>())));
+ static constexpr bool is_noexcept =
+ noexcept(declval<T>().prefer(declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct prefer_member_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_prefer_member,
traits::prefer_member<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/query_free.hpp b/3rdparty/asio/include/asio/traits/query_free.hpp
index 3347793bf3c..a54016adddc 100644
--- a/3rdparty/asio/include/asio/traits/query_free.hpp
+++ b/3rdparty/asio/include/asio/traits/query_free.hpp
@@ -2,7 +2,7 @@
// traits/query_free.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -42,8 +38,8 @@ namespace detail {
struct no_query_free
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
@@ -55,31 +51,31 @@ struct query_free_trait : no_query_free
template <typename T, typename Property>
struct query_free_trait<T, Property,
- typename void_type<
+ void_t<
decltype(query(declval<T>(), declval<Property>()))
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
query(declval<T>(), declval<Property>()));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- query(declval<T>(), declval<Property>())));
+ static constexpr bool is_noexcept =
+ noexcept(query(declval<T>(), declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct query_free_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_query_free,
traits::query_free<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/query_member.hpp b/3rdparty/asio/include/asio/traits/query_member.hpp
index f69461b5296..2202c9dab4b 100644
--- a/3rdparty/asio/include/asio/traits/query_member.hpp
+++ b/3rdparty/asio/include/asio/traits/query_member.hpp
@@ -2,7 +2,7 @@
// traits/query_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -42,8 +38,8 @@ namespace detail {
struct no_query_member
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
@@ -55,31 +51,31 @@ struct query_member_trait : no_query_member
template <typename T, typename Property>
struct query_member_trait<T, Property,
- typename void_type<
+ void_t<
decltype(declval<T>().query(declval<Property>()))
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().query(declval<Property>()));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<T>().query(declval<Property>())));
+ static constexpr bool is_noexcept =
+ noexcept(declval<T>().query(declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct query_member_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_query_member,
traits::query_member<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/query_static_constexpr_member.hpp b/3rdparty/asio/include/asio/traits/query_static_constexpr_member.hpp
index 2c6eb839dd9..95bdb7db376 100644
--- a/3rdparty/asio/include/asio/traits/query_static_constexpr_member.hpp
+++ b/3rdparty/asio/include/asio/traits/query_static_constexpr_member.hpp
@@ -2,7 +2,7 @@
// traits/query_static_constexpr_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,16 +18,10 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_CONSTEXPR) \
- && defined(ASIO_HAS_CONSTANT_EXPRESSION_SFINAE) \
+#if defined(ASIO_HAS_CONSTANT_EXPRESSION_SFINAE) \
&& defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_CONSTEXPR)
- // && defined(ASIO_HAS_CONSTANT_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_CONSTANT_EXPRESSION_SFINAE)
// && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -46,19 +40,19 @@ namespace detail {
struct no_query_static_constexpr_member
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
+ static constexpr bool is_valid = false;
};
template <typename T, typename Property, typename = void>
struct query_static_constexpr_member_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_query_static_constexpr_member,
traits::query_static_constexpr_member<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
@@ -66,18 +60,17 @@ struct query_static_constexpr_member_trait :
template <typename T, typename Property>
struct query_static_constexpr_member_trait<T, Property,
- typename enable_if<
+ enable_if_t<
(static_cast<void>(T::query(Property{})), true)
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(T::query(Property{}));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- noexcept(T::query(Property{})));
+ static constexpr bool is_noexcept = noexcept(T::query(Property{}));
- static ASIO_CONSTEXPR result_type value() noexcept(is_noexcept)
+ static constexpr result_type value() noexcept(is_noexcept)
{
return T::query(Property{});
}
diff --git a/3rdparty/asio/include/asio/traits/require_concept_free.hpp b/3rdparty/asio/include/asio/traits/require_concept_free.hpp
index d7ea447e39d..1ae2ad7801d 100644
--- a/3rdparty/asio/include/asio/traits/require_concept_free.hpp
+++ b/3rdparty/asio/include/asio/traits/require_concept_free.hpp
@@ -2,7 +2,7 @@
// traits/require_concept_free.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -42,8 +38,8 @@ namespace detail {
struct no_require_concept_free
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_FREE_TRAIT)
@@ -55,31 +51,31 @@ struct require_concept_free_trait : no_require_concept_free
template <typename T, typename Property>
struct require_concept_free_trait<T, Property,
- typename void_type<
+ void_t<
decltype(require_concept(declval<T>(), declval<Property>()))
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
require_concept(declval<T>(), declval<Property>()));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- require_concept(declval<T>(), declval<Property>())));
+ static constexpr bool is_noexcept =
+ noexcept(require_concept(declval<T>(), declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct require_concept_free_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_require_concept_free,
traits::require_concept_free<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/require_concept_member.hpp b/3rdparty/asio/include/asio/traits/require_concept_member.hpp
index a7e86059037..f6b6535e9bd 100644
--- a/3rdparty/asio/include/asio/traits/require_concept_member.hpp
+++ b/3rdparty/asio/include/asio/traits/require_concept_member.hpp
@@ -2,7 +2,7 @@
// traits/require_concept_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -42,8 +38,8 @@ namespace detail {
struct no_require_concept_member
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT)
@@ -55,31 +51,31 @@ struct require_concept_member_trait : no_require_concept_member
template <typename T, typename Property>
struct require_concept_member_trait<T, Property,
- typename void_type<
+ void_t<
decltype(declval<T>().require_concept(declval<Property>()))
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().require_concept(declval<Property>()));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<T>().require_concept(declval<Property>())));
+ static constexpr bool is_noexcept =
+ noexcept(declval<T>().require_concept(declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct require_concept_member_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_require_concept_member,
traits::require_concept_member<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/require_free.hpp b/3rdparty/asio/include/asio/traits/require_free.hpp
index 53cf805a316..02b558676b1 100644
--- a/3rdparty/asio/include/asio/traits/require_free.hpp
+++ b/3rdparty/asio/include/asio/traits/require_free.hpp
@@ -2,7 +2,7 @@
// traits/require_free.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -42,8 +38,8 @@ namespace detail {
struct no_require_free
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
@@ -55,31 +51,31 @@ struct require_free_trait : no_require_free
template <typename T, typename Property>
struct require_free_trait<T, Property,
- typename void_type<
+ void_t<
decltype(require(declval<T>(), declval<Property>()))
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
require(declval<T>(), declval<Property>()));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- require(declval<T>(), declval<Property>())));
+ static constexpr bool is_noexcept =
+ noexcept(require(declval<T>(), declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct require_free_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_require_free,
traits::require_free<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/require_member.hpp b/3rdparty/asio/include/asio/traits/require_member.hpp
index 2c8c4bbcbe0..af733e3b270 100644
--- a/3rdparty/asio/include/asio/traits/require_member.hpp
+++ b/3rdparty/asio/include/asio/traits/require_member.hpp
@@ -2,7 +2,7 @@
// traits/require_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,13 +18,9 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
+#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -42,8 +38,8 @@ namespace detail {
struct no_require_member
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
@@ -55,31 +51,31 @@ struct require_member_trait : no_require_member
template <typename T, typename Property>
struct require_member_trait<T, Property,
- typename void_type<
+ void_t<
decltype(declval<T>().require(declval<Property>()))
- >::type>
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().require(declval<Property>()));
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<T>().require(declval<Property>())));
+ static constexpr bool is_noexcept =
+ noexcept(declval<T>().require(declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct require_member_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_require_member,
traits::require_member<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
diff --git a/3rdparty/asio/include/asio/traits/schedule_free.hpp b/3rdparty/asio/include/asio/traits/schedule_free.hpp
deleted file mode 100644
index 36ccad32d98..00000000000
--- a/3rdparty/asio/include/asio/traits/schedule_free.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// traits/schedule_free.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SCHEDULE_FREE_HPP
-#define ASIO_TRAITS_SCHEDULE_FREE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SCHEDULE_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename = void>
-struct schedule_free_default;
-
-template <typename T, typename = void>
-struct schedule_free;
-
-} // namespace traits
-namespace detail {
-
-struct no_schedule_free
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SCHEDULE_FREE_TRAIT)
-
-template <typename T, typename = void>
-struct schedule_free_trait : no_schedule_free
-{
-};
-
-template <typename T>
-struct schedule_free_trait<T,
- typename void_type<
- decltype(schedule(declval<T>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(schedule(declval<T>()));
-
- ASIO_STATIC_CONSTEXPR(bool,
- is_noexcept = noexcept(schedule(declval<T>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_SCHEDULE_FREE_TRAIT)
-
-template <typename T, typename = void>
-struct schedule_free_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_schedule_free,
- traits::schedule_free<typename add_const<T>::type>
- >::type,
- traits::schedule_free<typename remove_reference<T>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_SCHEDULE_FREE_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename>
-struct schedule_free_default :
- detail::schedule_free_trait<T>
-{
-};
-
-template <typename T, typename>
-struct schedule_free :
- schedule_free_default<T>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SCHEDULE_FREE_HPP
diff --git a/3rdparty/asio/include/asio/traits/schedule_member.hpp b/3rdparty/asio/include/asio/traits/schedule_member.hpp
deleted file mode 100644
index b2e6d568816..00000000000
--- a/3rdparty/asio/include/asio/traits/schedule_member.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// traits/schedule_member.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SCHEDULE_MEMBER_HPP
-#define ASIO_TRAITS_SCHEDULE_MEMBER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename = void>
-struct schedule_member_default;
-
-template <typename T, typename = void>
-struct schedule_member;
-
-} // namespace traits
-namespace detail {
-
-struct no_schedule_member
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT)
-
-template <typename T, typename = void>
-struct schedule_member_trait : no_schedule_member
-{
-};
-
-template <typename T>
-struct schedule_member_trait<T,
- typename void_type<
- decltype(declval<T>().schedule())
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(declval<T>().schedule());
-
- ASIO_STATIC_CONSTEXPR(bool,
- is_noexcept = noexcept(declval<T>().schedule()));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT)
-
-template <typename T, typename = void>
-struct schedule_member_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_schedule_member,
- traits::schedule_member<typename add_const<T>::type>
- >::type,
- traits::schedule_member<typename remove_reference<T>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename>
-struct schedule_member_default :
- detail::schedule_member_trait<T>
-{
-};
-
-template <typename T, typename>
-struct schedule_member :
- schedule_member_default<T>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SCHEDULE_MEMBER_HPP
diff --git a/3rdparty/asio/include/asio/traits/set_done_free.hpp b/3rdparty/asio/include/asio/traits/set_done_free.hpp
deleted file mode 100644
index f52e02c0d84..00000000000
--- a/3rdparty/asio/include/asio/traits/set_done_free.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// traits/set_done_free.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SET_DONE_FREE_HPP
-#define ASIO_TRAITS_SET_DONE_FREE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename = void>
-struct set_done_free_default;
-
-template <typename T, typename = void>
-struct set_done_free;
-
-} // namespace traits
-namespace detail {
-
-struct no_set_done_free
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT)
-
-template <typename T, typename = void>
-struct set_done_free_trait : no_set_done_free
-{
-};
-
-template <typename T>
-struct set_done_free_trait<T,
- typename void_type<
- decltype(set_done(declval<T>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(set_done(declval<T>()));
-
- ASIO_STATIC_CONSTEXPR(bool,
- is_noexcept = noexcept(set_done(declval<T>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT)
-
-template <typename T, typename = void>
-struct set_done_free_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_set_done_free,
- traits::set_done_free<typename add_const<T>::type>
- >::type,
- traits::set_done_free<typename remove_reference<T>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename>
-struct set_done_free_default :
- detail::set_done_free_trait<T>
-{
-};
-
-template <typename T, typename>
-struct set_done_free :
- set_done_free_default<T>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SET_DONE_FREE_HPP
diff --git a/3rdparty/asio/include/asio/traits/set_done_member.hpp b/3rdparty/asio/include/asio/traits/set_done_member.hpp
deleted file mode 100644
index 1ee9cdc3067..00000000000
--- a/3rdparty/asio/include/asio/traits/set_done_member.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// traits/set_done_member.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SET_DONE_MEMBER_HPP
-#define ASIO_TRAITS_SET_DONE_MEMBER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename = void>
-struct set_done_member_default;
-
-template <typename T, typename = void>
-struct set_done_member;
-
-} // namespace traits
-namespace detail {
-
-struct no_set_done_member
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <typename T, typename = void>
-struct set_done_member_trait : no_set_done_member
-{
-};
-
-template <typename T>
-struct set_done_member_trait<T,
- typename void_type<
- decltype(declval<T>().set_done())
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(declval<T>().set_done());
-
- ASIO_STATIC_CONSTEXPR(bool,
- is_noexcept = noexcept(declval<T>().set_done()));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <typename T, typename = void>
-struct set_done_member_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_set_done_member,
- traits::set_done_member<typename add_const<T>::type>
- >::type,
- traits::set_done_member<typename remove_reference<T>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename>
-struct set_done_member_default :
- detail::set_done_member_trait<T>
-{
-};
-
-template <typename T, typename>
-struct set_done_member :
- set_done_member_default<T>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SET_DONE_MEMBER_HPP
diff --git a/3rdparty/asio/include/asio/traits/set_error_free.hpp b/3rdparty/asio/include/asio/traits/set_error_free.hpp
deleted file mode 100644
index b7455be5025..00000000000
--- a/3rdparty/asio/include/asio/traits/set_error_free.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// traits/set_error_free.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SET_ERROR_FREE_HPP
-#define ASIO_TRAITS_SET_ERROR_FREE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename E, typename = void>
-struct set_error_free_default;
-
-template <typename T, typename E, typename = void>
-struct set_error_free;
-
-} // namespace traits
-namespace detail {
-
-struct no_set_error_free
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT)
-
-template <typename T, typename E, typename = void>
-struct set_error_free_trait : no_set_error_free
-{
-};
-
-template <typename T, typename E>
-struct set_error_free_trait<T, E,
- typename void_type<
- decltype(set_error(declval<T>(), declval<E>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- set_error(declval<T>(), declval<E>()));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- set_error(declval<T>(), declval<E>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT)
-
-template <typename T, typename E, typename = void>
-struct set_error_free_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value
- && is_same<E, typename decay<E>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_set_error_free,
- traits::set_error_free<typename add_const<T>::type, E>
- >::type,
- traits::set_error_free<
- typename remove_reference<T>::type,
- typename decay<E>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename E, typename>
-struct set_error_free_default :
- detail::set_error_free_trait<T, E>
-{
-};
-
-template <typename T, typename E, typename>
-struct set_error_free :
- set_error_free_default<T, E>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SET_ERROR_FREE_HPP
diff --git a/3rdparty/asio/include/asio/traits/set_error_member.hpp b/3rdparty/asio/include/asio/traits/set_error_member.hpp
deleted file mode 100644
index b9ef63e03a0..00000000000
--- a/3rdparty/asio/include/asio/traits/set_error_member.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// traits/set_error_member.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SET_ERROR_MEMBER_HPP
-#define ASIO_TRAITS_SET_ERROR_MEMBER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename E, typename = void>
-struct set_error_member_default;
-
-template <typename T, typename E, typename = void>
-struct set_error_member;
-
-} // namespace traits
-namespace detail {
-
-struct no_set_error_member
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename T, typename E, typename = void>
-struct set_error_member_trait : no_set_error_member
-{
-};
-
-template <typename T, typename E>
-struct set_error_member_trait<T, E,
- typename void_type<
- decltype(declval<T>().set_error(declval<E>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- declval<T>().set_error(declval<E>()));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<T>().set_error(declval<E>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename T, typename E, typename = void>
-struct set_error_member_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value
- && is_same<E, typename decay<E>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_set_error_member,
- traits::set_error_member<typename add_const<T>::type, E>
- >::type,
- traits::set_error_member<
- typename remove_reference<T>::type,
- typename decay<E>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename E, typename>
-struct set_error_member_default :
- detail::set_error_member_trait<T, E>
-{
-};
-
-template <typename T, typename E, typename>
-struct set_error_member :
- set_error_member_default<T, E>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SET_ERROR_MEMBER_HPP
diff --git a/3rdparty/asio/include/asio/traits/set_value_free.hpp b/3rdparty/asio/include/asio/traits/set_value_free.hpp
deleted file mode 100644
index cb5b382754d..00000000000
--- a/3rdparty/asio/include/asio/traits/set_value_free.hpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// traits/set_value_free.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SET_VALUE_FREE_HPP
-#define ASIO_TRAITS_SET_VALUE_FREE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename Vs, typename = void>
-struct set_value_free_default;
-
-template <typename T, typename Vs, typename = void>
-struct set_value_free;
-
-} // namespace traits
-namespace detail {
-
-struct no_set_value_free
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-template <typename T, typename Vs, typename = void>
-struct set_value_free_trait : no_set_value_free
-{
-};
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename... Vs>
-struct set_value_free_trait<T, void(Vs...),
- typename void_type<
- decltype(set_value(declval<T>(), declval<Vs>()...))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- set_value(declval<T>(), declval<Vs>()...));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- set_value(declval<T>(), declval<Vs>()...)));
-};
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T>
-struct set_value_free_trait<T, void(),
- typename void_type<
- decltype(set_value(declval<T>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(set_value(declval<T>()));
-
- ASIO_STATIC_CONSTEXPR(bool,
- is_noexcept = noexcept(set_value(declval<T>())));
-};
-
-#define ASIO_PRIVATE_SET_VALUE_FREE_TRAIT_DEF(n) \
- template <typename T, ASIO_VARIADIC_TPARAMS(n)> \
- struct set_value_free_trait<T, void(ASIO_VARIADIC_TARGS(n)), \
- typename void_type< \
- decltype(set_value(declval<T>(), ASIO_VARIADIC_DECLVAL(n))) \
- >::type> \
- { \
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true); \
- \
- using result_type = decltype( \
- set_value(declval<T>(), ASIO_VARIADIC_DECLVAL(n))); \
- \
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept( \
- set_value(declval<T>(), ASIO_VARIADIC_DECLVAL(n)))); \
- }; \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SET_VALUE_FREE_TRAIT_DEF)
-#undef ASIO_PRIVATE_SET_VALUE_FREE_TRAIT_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#else // defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-template <typename T, typename Vs, typename = void>
-struct set_value_free_trait;
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename... Vs>
-struct set_value_free_trait<T, void(Vs...)> :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value
- && conjunction<is_same<Vs, typename decay<Vs>::type>...>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_set_value_free,
- traits::set_value_free<typename add_const<T>::type, void(Vs...)>
- >::type,
- traits::set_value_free<
- typename remove_reference<T>::type,
- void(typename decay<Vs>::type...)>
- >::type
-{
-};
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T>
-struct set_value_free_trait<T, void()> :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_set_value_free,
- traits::set_value_free<typename add_const<T>::type, void()>
- >::type,
- traits::set_value_free<typename remove_reference<T>::type, void()>
- >::type
-{
-};
-
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME(n) \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_##n
-
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_1 \
- && is_same<T1, typename decay<T1>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_2 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_1 \
- && is_same<T2, typename decay<T2>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_3 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_2 \
- && is_same<T3, typename decay<T3>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_4 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_3 \
- && is_same<T4, typename decay<T4>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_5 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_4 \
- && is_same<T5, typename decay<T5>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_6 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_5 \
- && is_same<T6, typename decay<T6>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_7 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_6 \
- && is_same<T7, typename decay<T7>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_8 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_7 \
- && is_same<T8, typename decay<T8>::type>::value
-
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_TRAIT_DEF(n) \
- template <typename T, ASIO_VARIADIC_TPARAMS(n)> \
- struct set_value_free_trait<T, void(ASIO_VARIADIC_TARGS(n))> : \
- conditional< \
- is_same<T, typename remove_reference<T>::type>::value \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME(n), \
- typename conditional< \
- is_same<T, typename add_const<T>::type>::value, \
- no_set_value_free, \
- traits::set_value_free< \
- typename add_const<T>::type, \
- void(ASIO_VARIADIC_TARGS(n))> \
- >::type, \
- traits::set_value_free< \
- typename remove_reference<T>::type, \
- void(ASIO_VARIADIC_DECAY(n))> \
- >::type \
- { \
- }; \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SET_VALUE_MEMBER_TRAIT_DEF)
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_TRAIT_DEF
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_1
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_2
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_3
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_4
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_5
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_6
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_7
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_8
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#endif // defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename Vs, typename>
-struct set_value_free_default :
- detail::set_value_free_trait<T, Vs>
-{
-};
-
-template <typename T, typename Vs, typename>
-struct set_value_free :
- set_value_free_default<T, Vs>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SET_VALUE_FREE_HPP
diff --git a/3rdparty/asio/include/asio/traits/set_value_member.hpp b/3rdparty/asio/include/asio/traits/set_value_member.hpp
deleted file mode 100644
index 6b0960713ee..00000000000
--- a/3rdparty/asio/include/asio/traits/set_value_member.hpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// traits/set_value_member.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SET_VALUE_MEMBER_HPP
-#define ASIO_TRAITS_SET_VALUE_MEMBER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-#include "asio/detail/variadic_templates.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename Vs, typename = void>
-struct set_value_member_default;
-
-template <typename T, typename Vs, typename = void>
-struct set_value_member;
-
-} // namespace traits
-namespace detail {
-
-struct no_set_value_member
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-template <typename T, typename Vs, typename = void>
-struct set_value_member_trait : no_set_value_member
-{
-};
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename... Vs>
-struct set_value_member_trait<T, void(Vs...),
- typename void_type<
- decltype(declval<T>().set_value(declval<Vs>()...))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- declval<T>().set_value(declval<Vs>()...));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<T>().set_value(declval<Vs>()...)));
-};
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T>
-struct set_value_member_trait<T, void(),
- typename void_type<
- decltype(declval<T>().set_value())
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(declval<T>().set_value());
-
- ASIO_STATIC_CONSTEXPR(bool,
- is_noexcept = noexcept(declval<T>().set_value()));
-};
-
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_TRAIT_DEF(n) \
- template <typename T, ASIO_VARIADIC_TPARAMS(n)> \
- struct set_value_member_trait<T, void(ASIO_VARIADIC_TARGS(n)), \
- typename void_type< \
- decltype(declval<T>().set_value(ASIO_VARIADIC_DECLVAL(n))) \
- >::type> \
- { \
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true); \
- \
- using result_type = decltype( \
- declval<T>().set_value(ASIO_VARIADIC_DECLVAL(n))); \
- \
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept( \
- declval<T>().set_value(ASIO_VARIADIC_DECLVAL(n)))); \
- }; \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SET_VALUE_MEMBER_TRAIT_DEF)
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_TRAIT_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#else // defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-template <typename T, typename Vs, typename = void>
-struct set_value_member_trait;
-
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T, typename... Vs>
-struct set_value_member_trait<T, void(Vs...)> :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value
- && conjunction<is_same<Vs, typename decay<Vs>::type>...>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_set_value_member,
- traits::set_value_member<typename add_const<T>::type, void(Vs...)>
- >::type,
- traits::set_value_member<
- typename remove_reference<T>::type,
- void(typename decay<Vs>::type...)>
- >::type
-{
-};
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename T>
-struct set_value_member_trait<T, void()> :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_set_value_member,
- traits::set_value_member<typename add_const<T>::type, void()>
- >::type,
- traits::set_value_member<typename remove_reference<T>::type, void()>
- >::type
-{
-};
-
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME(n) \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_##n
-
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_1 \
- && is_same<T1, typename decay<T1>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_2 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_1 \
- && is_same<T2, typename decay<T2>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_3 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_2 \
- && is_same<T3, typename decay<T3>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_4 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_3 \
- && is_same<T4, typename decay<T4>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_5 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_4 \
- && is_same<T5, typename decay<T5>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_6 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_5 \
- && is_same<T6, typename decay<T6>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_7 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_6 \
- && is_same<T7, typename decay<T7>::type>::value
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_8 \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_7 \
- && is_same<T8, typename decay<T8>::type>::value
-
-#define ASIO_PRIVATE_SET_VALUE_MEMBER_TRAIT_DEF(n) \
- template <typename T, ASIO_VARIADIC_TPARAMS(n)> \
- struct set_value_member_trait<T, void(ASIO_VARIADIC_TARGS(n))> : \
- conditional< \
- is_same<T, typename remove_reference<T>::type>::value \
- ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME(n), \
- typename conditional< \
- is_same<T, typename add_const<T>::type>::value, \
- no_set_value_member, \
- traits::set_value_member< \
- typename add_const<T>::type, \
- void(ASIO_VARIADIC_TARGS(n))> \
- >::type, \
- traits::set_value_member< \
- typename remove_reference<T>::type, \
- void(ASIO_VARIADIC_DECAY(n))> \
- >::type \
- { \
- }; \
- /**/
-ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SET_VALUE_MEMBER_TRAIT_DEF)
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_TRAIT_DEF
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_1
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_2
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_3
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_4
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_5
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_6
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_7
-#undef ASIO_PRIVATE_SET_VALUE_MEMBER_IS_SAME_8
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-#endif // defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename Vs, typename>
-struct set_value_member_default :
- detail::set_value_member_trait<T, Vs>
-{
-};
-
-template <typename T, typename Vs, typename>
-struct set_value_member :
- set_value_member_default<T, Vs>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SET_VALUE_MEMBER_HPP
diff --git a/3rdparty/asio/include/asio/traits/start_free.hpp b/3rdparty/asio/include/asio/traits/start_free.hpp
deleted file mode 100644
index 2489b97c60d..00000000000
--- a/3rdparty/asio/include/asio/traits/start_free.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// traits/start_free.hpp
-// ~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_START_FREE_HPP
-#define ASIO_TRAITS_START_FREE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_START_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename = void>
-struct start_free_default;
-
-template <typename T, typename = void>
-struct start_free;
-
-} // namespace traits
-namespace detail {
-
-struct no_start_free
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT)
-
-template <typename T, typename = void>
-struct start_free_trait : no_start_free
-{
-};
-
-template <typename T>
-struct start_free_trait<T,
- typename void_type<
- decltype(start(declval<T>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(start(declval<T>()));
-
- ASIO_STATIC_CONSTEXPR(bool,
- is_noexcept = noexcept(start(declval<T>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT)
-
-template <typename T, typename = void>
-struct start_free_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_start_free,
- traits::start_free<typename add_const<T>::type>
- >::type,
- traits::start_free<typename remove_reference<T>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename>
-struct start_free_default :
- detail::start_free_trait<T>
-{
-};
-
-template <typename T, typename>
-struct start_free :
- start_free_default<T>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_START_FREE_HPP
diff --git a/3rdparty/asio/include/asio/traits/start_member.hpp b/3rdparty/asio/include/asio/traits/start_member.hpp
deleted file mode 100644
index cb5d2c16736..00000000000
--- a/3rdparty/asio/include/asio/traits/start_member.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// traits/start_member.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_START_MEMBER_HPP
-#define ASIO_TRAITS_START_MEMBER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_START_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename T, typename = void>
-struct start_member_default;
-
-template <typename T, typename = void>
-struct start_member;
-
-} // namespace traits
-namespace detail {
-
-struct no_start_member
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <typename T, typename = void>
-struct start_member_trait : no_start_member
-{
-};
-
-template <typename T>
-struct start_member_trait<T,
- typename void_type<
- decltype(declval<T>().start())
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(declval<T>().start());
-
- ASIO_STATIC_CONSTEXPR(bool,
- is_noexcept = noexcept(declval<T>().start()));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <typename T, typename = void>
-struct start_member_trait :
- conditional<
- is_same<T, typename remove_reference<T>::type>::value,
- typename conditional<
- is_same<T, typename add_const<T>::type>::value,
- no_start_member,
- traits::start_member<typename add_const<T>::type>
- >::type,
- traits::start_member<typename remove_reference<T>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename T, typename>
-struct start_member_default :
- detail::start_member_trait<T>
-{
-};
-
-template <typename T, typename>
-struct start_member :
- start_member_default<T>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_START_MEMBER_HPP
diff --git a/3rdparty/asio/include/asio/traits/static_query.hpp b/3rdparty/asio/include/asio/traits/static_query.hpp
index d2a96aae85d..b177a9d5304 100644
--- a/3rdparty/asio/include/asio/traits/static_query.hpp
+++ b/3rdparty/asio/include/asio/traits/static_query.hpp
@@ -2,7 +2,7 @@
// traits/static_query.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,16 +18,10 @@
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_CONSTEXPR) \
- && defined(ASIO_HAS_VARIABLE_TEMPLATES) \
+#if defined(ASIO_HAS_VARIABLE_TEMPLATES) \
&& defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_CONSTEXPR)
- // && defined(ASIO_HAS_VARIABLE_TEMPLATES)
+#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
// && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
@@ -46,20 +40,20 @@ namespace detail {
struct no_static_query
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = false;
+ static constexpr bool is_noexcept = false;
};
template <typename T, typename Property, typename = void>
struct static_query_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_static_query,
traits::static_query<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
@@ -67,21 +61,21 @@ struct static_query_trait :
template <typename T, typename Property>
struct static_query_trait<T, Property,
- typename void_type<
- decltype(decay<Property>::type::template static_query_v<T>)
- >::type>
+ void_t<
+ decltype(decay_t<Property>::template static_query_v<T>)
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
using result_type = decltype(
- decay<Property>::type::template static_query_v<T>);
+ decay_t<Property>::template static_query_v<T>);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
- noexcept(decay<Property>::type::template static_query_v<T>));
+ static constexpr bool is_noexcept =
+ noexcept(decay_t<Property>::template static_query_v<T>);
- static ASIO_CONSTEXPR result_type value() noexcept(is_noexcept)
+ static constexpr result_type value() noexcept(is_noexcept)
{
- return decay<Property>::type::template static_query_v<T>;
+ return decay_t<Property>::template static_query_v<T>;
}
};
diff --git a/3rdparty/asio/include/asio/traits/static_require.hpp b/3rdparty/asio/include/asio/traits/static_require.hpp
index e30c2d101c5..4ef4a617390 100644
--- a/3rdparty/asio/include/asio/traits/static_require.hpp
+++ b/3rdparty/asio/include/asio/traits/static_require.hpp
@@ -2,7 +2,7 @@
// traits/static_require.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,11 +19,7 @@
#include "asio/detail/type_traits.hpp"
#include "asio/traits/static_query.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT)
-# define ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
+#define ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT 1
#include "asio/detail/push_options.hpp"
@@ -41,33 +37,31 @@ namespace detail {
struct no_static_require
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
+ static constexpr bool is_valid = false;
};
template <typename T, typename Property, typename = void>
struct static_require_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_static_require,
traits::static_require<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
-#if defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
template <typename T, typename Property>
struct static_require_trait<T, Property,
- typename enable_if<
- decay<Property>::type::value() == traits::static_query<T, Property>::value()
- >::type>
+ enable_if_t<
+ decay_t<Property>::value() == traits::static_query<T, Property>::value()
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
};
#else // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
@@ -76,32 +70,30 @@ false_type static_require_test(...);
template <typename T, typename Property>
true_type static_require_test(T*, Property*,
- typename enable_if<
+ enable_if_t<
Property::value() == traits::static_query<T, Property>::value()
- >::type* = 0);
+ >* = 0);
template <typename T, typename Property>
struct has_static_require
{
- ASIO_STATIC_CONSTEXPR(bool, value =
+ static constexpr bool value =
decltype((static_require_test)(
- static_cast<T*>(0), static_cast<Property*>(0)))::value);
+ static_cast<T*>(0), static_cast<Property*>(0)))::value;
};
template <typename T, typename Property>
struct static_require_trait<T, Property,
- typename enable_if<
- has_static_require<typename decay<T>::type,
- typename decay<Property>::type>::value
- >::type>
+ enable_if_t<
+ has_static_require<decay_t<T>,
+ decay_t<Property>>::value
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
};
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
-
} // namespace detail
namespace traits {
diff --git a/3rdparty/asio/include/asio/traits/static_require_concept.hpp b/3rdparty/asio/include/asio/traits/static_require_concept.hpp
index d35287d4db4..6861f46aa0d 100644
--- a/3rdparty/asio/include/asio/traits/static_require_concept.hpp
+++ b/3rdparty/asio/include/asio/traits/static_require_concept.hpp
@@ -2,7 +2,7 @@
// traits/static_require_concept.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,11 +19,7 @@
#include "asio/detail/type_traits.hpp"
#include "asio/traits/static_query.hpp"
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT)
-# define ASIO_HAS_DEDUCED_STATIC_REQUIRE_CONCEPT_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
+#define ASIO_HAS_DEDUCED_STATIC_REQUIRE_CONCEPT_TRAIT 1
#include "asio/detail/push_options.hpp"
@@ -41,33 +37,31 @@ namespace detail {
struct no_static_require_concept
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
+ static constexpr bool is_valid = false;
};
template <typename T, typename Property, typename = void>
struct static_require_concept_trait :
- conditional<
- is_same<T, typename decay<T>::type>::value
- && is_same<Property, typename decay<Property>::type>::value,
+ conditional_t<
+ is_same<T, decay_t<T>>::value
+ && is_same<Property, decay_t<Property>>::value,
no_static_require_concept,
traits::static_require_concept<
- typename decay<T>::type,
- typename decay<Property>::type>
- >::type
+ decay_t<T>,
+ decay_t<Property>>
+ >
{
};
-#if defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_CONCEPT_TRAIT)
-
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
template <typename T, typename Property>
struct static_require_concept_trait<T, Property,
- typename enable_if<
- decay<Property>::type::value() == traits::static_query<T, Property>::value()
- >::type>
+ enable_if_t<
+ decay_t<Property>::value() == traits::static_query<T, Property>::value()
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
};
#else // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
@@ -76,32 +70,30 @@ false_type static_require_concept_test(...);
template <typename T, typename Property>
true_type static_require_concept_test(T*, Property*,
- typename enable_if<
+ enable_if_t<
Property::value() == traits::static_query<T, Property>::value()
- >::type* = 0);
+ >* = 0);
template <typename T, typename Property>
struct has_static_require_concept
{
- ASIO_STATIC_CONSTEXPR(bool, value =
+ static constexpr bool value =
decltype((static_require_concept_test)(
- static_cast<T*>(0), static_cast<Property*>(0)))::value);
+ static_cast<T*>(0), static_cast<Property*>(0)))::value;
};
template <typename T, typename Property>
struct static_require_concept_trait<T, Property,
- typename enable_if<
- has_static_require_concept<typename decay<T>::type,
- typename decay<Property>::type>::value
- >::type>
+ enable_if_t<
+ has_static_require_concept<decay_t<T>,
+ decay_t<Property>>::value
+ >>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
+ static constexpr bool is_valid = true;
};
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-#endif // defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_CONCEPT_TRAIT)
-
} // namespace detail
namespace traits {
diff --git a/3rdparty/asio/include/asio/traits/submit_free.hpp b/3rdparty/asio/include/asio/traits/submit_free.hpp
deleted file mode 100644
index 1ea583e7109..00000000000
--- a/3rdparty/asio/include/asio/traits/submit_free.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// traits/submit_free.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SUBMIT_FREE_HPP
-#define ASIO_TRAITS_SUBMIT_FREE_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename S, typename R, typename = void>
-struct submit_free_default;
-
-template <typename S, typename R, typename = void>
-struct submit_free;
-
-} // namespace traits
-namespace detail {
-
-struct no_submit_free
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT)
-
-template <typename S, typename R, typename = void>
-struct submit_free_trait : no_submit_free
-{
-};
-
-template <typename S, typename R>
-struct submit_free_trait<S, R,
- typename void_type<
- decltype(submit(declval<S>(), declval<R>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- submit(declval<S>(), declval<R>()));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- submit(declval<S>(), declval<R>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT)
-
-template <typename S, typename R, typename = void>
-struct submit_free_trait :
- conditional<
- is_same<S, typename remove_reference<S>::type>::value
- && is_same<R, typename decay<R>::type>::value,
- typename conditional<
- is_same<S, typename add_const<S>::type>::value,
- no_submit_free,
- traits::submit_free<typename add_const<S>::type, R>
- >::type,
- traits::submit_free<
- typename remove_reference<S>::type,
- typename decay<R>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename S, typename R, typename>
-struct submit_free_default :
- detail::submit_free_trait<S, R>
-{
-};
-
-template <typename S, typename R, typename>
-struct submit_free :
- submit_free_default<S, R>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SUBMIT_FREE_HPP
diff --git a/3rdparty/asio/include/asio/traits/submit_member.hpp b/3rdparty/asio/include/asio/traits/submit_member.hpp
deleted file mode 100644
index 8aa42a02778..00000000000
--- a/3rdparty/asio/include/asio/traits/submit_member.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// traits/submit_member.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 ASIO_TRAITS_SUBMIT_MEMBER_HPP
-#define ASIO_TRAITS_SUBMIT_MEMBER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include "asio/detail/config.hpp"
-#include "asio/detail/type_traits.hpp"
-
-#if defined(ASIO_HAS_DECLTYPE) \
- && defined(ASIO_HAS_NOEXCEPT) \
- && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-# define ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT 1
-#endif // defined(ASIO_HAS_DECLTYPE)
- // && defined(ASIO_HAS_NOEXCEPT)
- // && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
-
-#include "asio/detail/push_options.hpp"
-
-namespace asio {
-namespace traits {
-
-template <typename S, typename R, typename = void>
-struct submit_member_default;
-
-template <typename S, typename R, typename = void>
-struct submit_member;
-
-} // namespace traits
-namespace detail {
-
-struct no_submit_member
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
-};
-
-#if defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-template <typename S, typename R, typename = void>
-struct submit_member_trait : no_submit_member
-{
-};
-
-template <typename S, typename R>
-struct submit_member_trait<S, R,
- typename void_type<
- decltype(declval<S>().submit(declval<R>()))
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
-
- using result_type = decltype(
- declval<S>().submit(declval<R>()));
-
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = noexcept(
- declval<S>().submit(declval<R>())));
-};
-
-#else // defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-template <typename S, typename R, typename = void>
-struct submit_member_trait :
- conditional<
- is_same<S, typename remove_reference<S>::type>::value
- && is_same<R, typename decay<R>::type>::value,
- typename conditional<
- is_same<S, typename add_const<S>::type>::value,
- no_submit_member,
- traits::submit_member<typename add_const<S>::type, R>
- >::type,
- traits::submit_member<
- typename remove_reference<S>::type,
- typename decay<R>::type>
- >::type
-{
-};
-
-#endif // defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-} // namespace detail
-namespace traits {
-
-template <typename S, typename R, typename>
-struct submit_member_default :
- detail::submit_member_trait<S, R>
-{
-};
-
-template <typename S, typename R, typename>
-struct submit_member :
- submit_member_default<S, R>
-{
-};
-
-} // namespace traits
-} // namespace asio
-
-#include "asio/detail/pop_options.hpp"
-
-#endif // ASIO_TRAITS_SUBMIT_MEMBER_HPP
diff --git a/3rdparty/asio/include/asio/ts/buffer.hpp b/3rdparty/asio/include/asio/ts/buffer.hpp
index 9c16febc79c..6c74a50ca66 100644
--- a/3rdparty/asio/include/asio/ts/buffer.hpp
+++ b/3rdparty/asio/include/asio/ts/buffer.hpp
@@ -2,7 +2,7 @@
// ts/buffer.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ts/executor.hpp b/3rdparty/asio/include/asio/ts/executor.hpp
index 66c318d3824..df28bbf44bb 100644
--- a/3rdparty/asio/include/asio/ts/executor.hpp
+++ b/3rdparty/asio/include/asio/ts/executor.hpp
@@ -2,7 +2,7 @@
// ts/executor.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ts/internet.hpp b/3rdparty/asio/include/asio/ts/internet.hpp
index a2a3212968d..eb2c35cd628 100644
--- a/3rdparty/asio/include/asio/ts/internet.hpp
+++ b/3rdparty/asio/include/asio/ts/internet.hpp
@@ -2,7 +2,7 @@
// ts/internet.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ts/io_context.hpp b/3rdparty/asio/include/asio/ts/io_context.hpp
index 7ce08f56727..c688f160e7a 100644
--- a/3rdparty/asio/include/asio/ts/io_context.hpp
+++ b/3rdparty/asio/include/asio/ts/io_context.hpp
@@ -2,7 +2,7 @@
// ts/io_context.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ts/net.hpp b/3rdparty/asio/include/asio/ts/net.hpp
index c4a1b7352ec..f82113b930a 100644
--- a/3rdparty/asio/include/asio/ts/net.hpp
+++ b/3rdparty/asio/include/asio/ts/net.hpp
@@ -2,7 +2,7 @@
// ts/net.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ts/netfwd.hpp b/3rdparty/asio/include/asio/ts/netfwd.hpp
index 1c5924d7ece..a575b6e497a 100644
--- a/3rdparty/asio/include/asio/ts/netfwd.hpp
+++ b/3rdparty/asio/include/asio/ts/netfwd.hpp
@@ -2,7 +2,7 @@
// ts/netfwd.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,10 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
-
-#if defined(ASIO_HAS_CHRONO)
-# include "asio/detail/chrono.hpp"
-#endif // defined(ASIO_HAS_CHRONO)
+#include "asio/detail/chrono.hpp"
#if defined(ASIO_HAS_BOOST_DATE_TIME)
# include "asio/detail/date_time_fwd.hpp"
@@ -66,20 +63,9 @@ namespace execution {
#if !defined(ASIO_EXECUTION_ANY_EXECUTOR_FWD_DECL)
#define ASIO_EXECUTION_ANY_EXECUTOR_FWD_DECL
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... SupportableProperties>
class any_executor;
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
-template <typename = void, typename = void, typename = void,
- typename = void, typename = void, typename = void,
- typename = void, typename = void, typename = void>
-class any_executor;
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
#endif // !defined(ASIO_EXECUTION_ANY_EXECUTOR_FWD_DECL)
template <typename U>
@@ -119,8 +105,6 @@ class basic_waitable_timer;
#endif // !defined(ASIO_BASIC_WAITABLE_TIMER_FWD_DECL)
-#if defined(ASIO_HAS_CHRONO)
-
typedef basic_waitable_timer<chrono::system_clock> system_timer;
typedef basic_waitable_timer<chrono::steady_clock> steady_timer;
@@ -128,8 +112,6 @@ typedef basic_waitable_timer<chrono::steady_clock> steady_timer;
typedef basic_waitable_timer<chrono::high_resolution_clock>
high_resolution_timer;
-#endif // defined(ASIO_HAS_CHRONO)
-
#if !defined(ASIO_BASIC_SOCKET_FWD_DECL)
#define ASIO_BASIC_SOCKET_FWD_DECL
@@ -171,10 +153,10 @@ template <typename Protocol,
#if defined(ASIO_HAS_BOOST_DATE_TIME) \
|| defined(GENERATING_DOCUMENTATION)
typename Clock = boost::posix_time::ptime,
- typename WaitTraits = time_traits<Clock> >
+ typename WaitTraits = time_traits<Clock>>
#else
typename Clock = chrono::steady_clock,
- typename WaitTraits = wait_traits<Clock> >
+ typename WaitTraits = wait_traits<Clock>>
#endif
class basic_socket_streambuf;
@@ -188,10 +170,10 @@ template <typename Protocol,
#if defined(ASIO_HAS_BOOST_DATE_TIME) \
|| defined(GENERATING_DOCUMENTATION)
typename Clock = boost::posix_time::ptime,
- typename WaitTraits = time_traits<Clock> >
+ typename WaitTraits = time_traits<Clock>>
#else
typename Clock = chrono::steady_clock,
- typename WaitTraits = wait_traits<Clock> >
+ typename WaitTraits = wait_traits<Clock>>
#endif
class basic_socket_iostream;
diff --git a/3rdparty/asio/include/asio/ts/socket.hpp b/3rdparty/asio/include/asio/ts/socket.hpp
index 62578fcb522..d54e0778264 100644
--- a/3rdparty/asio/include/asio/ts/socket.hpp
+++ b/3rdparty/asio/include/asio/ts/socket.hpp
@@ -2,7 +2,7 @@
// ts/socket.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/ts/timer.hpp b/3rdparty/asio/include/asio/ts/timer.hpp
index 4d58373430f..3b3d6facf11 100644
--- a/3rdparty/asio/include/asio/ts/timer.hpp
+++ b/3rdparty/asio/include/asio/ts/timer.hpp
@@ -2,7 +2,7 @@
// ts/timer.hpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/unyield.hpp b/3rdparty/asio/include/asio/unyield.hpp
index 983a000546e..f843d6137a2 100644
--- a/3rdparty/asio/include/asio/unyield.hpp
+++ b/3rdparty/asio/include/asio/unyield.hpp
@@ -2,7 +2,7 @@
// unyield.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/use_awaitable.hpp b/3rdparty/asio/include/asio/use_awaitable.hpp
index 14e5ec1dc4f..6dd42f3d6e3 100644
--- a/3rdparty/asio/include/asio/use_awaitable.hpp
+++ b/3rdparty/asio/include/asio/use_awaitable.hpp
@@ -2,7 +2,7 @@
// use_awaitable.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -32,7 +32,7 @@
namespace asio {
-/// A completion token that represents the currently executing coroutine.
+/// A @ref completion_token that represents the currently executing coroutine.
/**
* The @c use_awaitable_t class, with its value @c use_awaitable, is used to
* represent the currently executing coroutine. This completion token may be
@@ -53,7 +53,7 @@ template <typename Executor = any_io_executor>
struct use_awaitable_t
{
/// Default constructor.
- ASIO_CONSTEXPR use_awaitable_t(
+ constexpr use_awaitable_t(
#if defined(ASIO_ENABLE_HANDLER_TRACKING)
# if defined(ASIO_HAS_SOURCE_LOCATION)
detail::source_location location = detail::source_location::current()
@@ -75,7 +75,7 @@ struct use_awaitable_t
}
/// Constructor used to specify file name, line, and function name.
- ASIO_CONSTEXPR use_awaitable_t(const char* file_name,
+ constexpr use_awaitable_t(const char* file_name,
int line, const char* function_name)
#if defined(ASIO_ENABLE_HANDLER_TRACKING)
: file_name_(file_name),
@@ -101,13 +101,13 @@ struct use_awaitable_t
/// Construct the adapted executor from the inner executor type.
template <typename InnerExecutor1>
executor_with_default(const InnerExecutor1& ex,
- typename constraint<
- conditional<
+ constraint_t<
+ conditional_t<
!is_same<InnerExecutor1, executor_with_default>::value,
is_convertible<InnerExecutor1, InnerExecutor>,
false_type
- >::type::value
- >::type = 0) ASIO_NOEXCEPT
+ >::value
+ > = 0) noexcept
: InnerExecutor(ex)
{
}
@@ -115,25 +115,21 @@ struct use_awaitable_t
/// Type alias to adapt an I/O object to use @c use_awaitable_t as its
/// default completion token type.
-#if defined(ASIO_HAS_ALIAS_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
template <typename T>
using as_default_on_t = typename T::template rebind_executor<
- executor_with_default<typename T::executor_type> >::other;
-#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
- // || defined(GENERATING_DOCUMENTATION)
+ executor_with_default<typename T::executor_type>>::other;
/// Function helper to adapt an I/O object to use @c use_awaitable_t as its
/// default completion token type.
template <typename T>
- static typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
+ static typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
>::other
- as_default_on(ASIO_MOVE_ARG(T) object)
+ as_default_on(T&& object)
{
- return typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
- >::other(ASIO_MOVE_CAST(T)(object));
+ return typename decay_t<T>::template rebind_executor<
+ executor_with_default<typename decay_t<T>::executor_type>
+ >::other(static_cast<T&&>(object));
}
#if defined(ASIO_ENABLE_HANDLER_TRACKING)
@@ -143,16 +139,15 @@ struct use_awaitable_t
#endif // defined(ASIO_ENABLE_HANDLER_TRACKING)
};
-/// A completion token object that represents the currently executing coroutine.
+/// A @ref completion_token object that represents the currently executing
+/// coroutine.
/**
* See the documentation for asio::use_awaitable_t for a usage example.
*/
#if defined(GENERATING_DOCUMENTATION)
constexpr use_awaitable_t<> use_awaitable;
-#elif defined(ASIO_HAS_CONSTEXPR)
+#else
constexpr use_awaitable_t<> use_awaitable(0, 0, 0);
-#elif defined(ASIO_MSVC)
-__declspec(selectany) use_awaitable_t<> use_awaitable(0, 0, 0);
#endif
} // namespace asio
diff --git a/3rdparty/asio/include/asio/use_future.hpp b/3rdparty/asio/include/asio/use_future.hpp
index dfef15c89ef..26f5ae1fed0 100644
--- a/3rdparty/asio/include/asio/use_future.hpp
+++ b/3rdparty/asio/include/asio/use_future.hpp
@@ -2,7 +2,7 @@
// use_future.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -37,12 +37,14 @@ class packaged_handler;
} // namespace detail
-/// Class used to specify that an asynchronous operation should return a future.
+/// A @ref completion_token type that causes an asynchronous operation to return
+/// a future.
/**
- * The use_future_t class is used to indicate that an asynchronous operation
- * should return a std::future object. A use_future_t object may be passed as a
- * handler to an asynchronous operation, typically using the special value @c
- * asio::use_future. For example:
+ * The use_future_t class is a completion token type that is used to indicate
+ * that an asynchronous operation should return a std::future object. A
+ * use_future_t object may be passed as a completion token to an asynchronous
+ * operation, typically using the special value @c asio::use_future. For
+ * example:
*
* @code std::future<std::size_t> my_future
* = my_socket.async_read_some(my_buffer, asio::use_future); @endcode
@@ -52,7 +54,7 @@ class packaged_handler;
* completes with an error_code indicating failure, it is converted into a
* system_error and passed back to the caller via the future.
*/
-template <typename Allocator = std::allocator<void> >
+template <typename Allocator = std::allocator<void>>
class use_future_t
{
public:
@@ -61,7 +63,7 @@ public:
typedef Allocator allocator_type;
/// Construct using default-constructed allocator.
- ASIO_CONSTEXPR use_future_t()
+ constexpr use_future_t()
{
}
@@ -114,16 +116,16 @@ public:
#if defined(GENERATING_DOCUMENTATION)
unspecified
#else // defined(GENERATING_DOCUMENTATION)
- detail::packaged_token<typename decay<Function>::type, Allocator>
+ detail::packaged_token<decay_t<Function>, Allocator>
#endif // defined(GENERATING_DOCUMENTATION)
- operator()(ASIO_MOVE_ARG(Function) f) const;
+ operator()(Function&& f) const;
private:
// Helper type to ensure that use_future can be constexpr default-constructed
// even when std::allocator<void> can't be.
struct std_allocator_void
{
- ASIO_CONSTEXPR std_allocator_void()
+ constexpr std_allocator_void()
{
}
@@ -133,20 +135,17 @@ private:
}
};
- typename conditional<
+ conditional_t<
is_same<std::allocator<void>, Allocator>::value,
- std_allocator_void, Allocator>::type allocator_;
+ std_allocator_void, Allocator> allocator_;
};
-/// A special value, similar to std::nothrow.
+/// A @ref completion_token object that causes an asynchronous operation to
+/// return a future.
/**
* See the documentation for asio::use_future_t for a usage example.
*/
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr use_future_t<> use_future;
-#elif defined(ASIO_MSVC)
-__declspec(selectany) use_future_t<> use_future;
-#endif
} // namespace asio
diff --git a/3rdparty/asio/include/asio/uses_executor.hpp b/3rdparty/asio/include/asio/uses_executor.hpp
index 5232f6c203a..ff475cad4a1 100644
--- a/3rdparty/asio/include/asio/uses_executor.hpp
+++ b/3rdparty/asio/include/asio/uses_executor.hpp
@@ -2,7 +2,7 @@
// uses_executor.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -34,7 +34,7 @@ namespace asio {
struct executor_arg_t
{
/// Constructor.
- ASIO_CONSTEXPR executor_arg_t() ASIO_NOEXCEPT
+ constexpr executor_arg_t() noexcept
{
}
};
@@ -45,11 +45,7 @@ struct executor_arg_t
* See asio::executor_arg_t and asio::uses_executor
* for more information.
*/
-#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr executor_arg_t executor_arg;
-#elif defined(ASIO_MSVC)
-__declspec(selectany) executor_arg_t executor_arg;
-#endif
/// The uses_executor trait detects whether a type T has an associated executor
/// that is convertible from type Executor.
diff --git a/3rdparty/asio/include/asio/version.hpp b/3rdparty/asio/include/asio/version.hpp
index cb8bf03f5f4..c52fdd45b58 100644
--- a/3rdparty/asio/include/asio/version.hpp
+++ b/3rdparty/asio/include/asio/version.hpp
@@ -2,7 +2,7 @@
// version.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,6 +18,6 @@
// ASIO_VERSION % 100 is the sub-minor version
// ASIO_VERSION / 100 % 1000 is the minor version
// ASIO_VERSION / 100000 is the major version
-#define ASIO_VERSION 102000 // 1.20.0
+#define ASIO_VERSION 103002 // 1.30.2
#endif // ASIO_VERSION_HPP
diff --git a/3rdparty/asio/include/asio/wait_traits.hpp b/3rdparty/asio/include/asio/wait_traits.hpp
index 152fcece073..5f5e876da66 100644
--- a/3rdparty/asio/include/asio/wait_traits.hpp
+++ b/3rdparty/asio/include/asio/wait_traits.hpp
@@ -2,7 +2,7 @@
// wait_traits.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/windows/basic_object_handle.hpp b/3rdparty/asio/include/asio/windows/basic_object_handle.hpp
index f929e04e72c..bb10efc2a0a 100644
--- a/3rdparty/asio/include/asio/windows/basic_object_handle.hpp
+++ b/3rdparty/asio/include/asio/windows/basic_object_handle.hpp
@@ -2,7 +2,7 @@
// windows/basic_object_handle.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2011 Boris Schaeling (boris@highscore.de)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -21,6 +21,7 @@
#if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) \
|| defined(GENERATING_DOCUMENTATION)
+#include <utility>
#include "asio/any_io_executor.hpp"
#include "asio/async_result.hpp"
#include "asio/detail/io_object_impl.hpp"
@@ -29,10 +30,6 @@
#include "asio/error.hpp"
#include "asio/execution_context.hpp"
-#if defined(ASIO_HAS_MOVE)
-# include <utility>
-#endif // defined(ASIO_HAS_MOVE)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -50,6 +47,9 @@ namespace windows {
template <typename Executor = any_io_executor>
class basic_object_handle
{
+private:
+ class initiate_async_wait;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -96,10 +96,10 @@ public:
*/
template <typename ExecutionContext>
explicit basic_object_handle(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
}
@@ -142,9 +142,9 @@ public:
template <typename ExecutionContext>
basic_object_handle(ExecutionContext& context,
const native_handle_type& native_handle,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -152,7 +152,6 @@ public:
asio::detail::throw_error(ec, "assign");
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct an object handle from another.
/**
* This constructor moves an object handle from one object to another.
@@ -185,10 +184,55 @@ public:
impl_ = std::move(other.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+
+ // All handles have access to each other's implementations.
+ template <typename Executor1>
+ friend class basic_object_handle;
+
+ /// Move-construct an object handle from a handle of another executor type.
+ /**
+ * This constructor moves an object handle from one object to another.
+ *
+ * @param other The other object handle object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_object_handle(const executor_type&)
+ * constructor.
+ */
+ template<typename Executor1>
+ basic_object_handle(basic_object_handle<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign an object handle from a handle of another executor type.
+ /**
+ * This assignment operator moves an object handle from one object to another.
+ *
+ * @param other The other object handle object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_object_handle(const executor_type&)
+ * constructor.
+ */
+ template<typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_object_handle&
+ > operator=(basic_object_handle<Executor1>&& other)
+ {
+ impl_ = std::move(other.impl_);
+ return *this;
+ }
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return impl_.get_executor();
}
@@ -357,36 +401,42 @@ public:
/// Start an asynchronous wait on the object handle.
/**
* This function is be used to initiate an asynchronous wait against the
- * object handle. It always returns immediately.
+ * object handle. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately.
*
- * @param handler The handler to be called when the object handle is set to
- * the signalled state. Copies will be made of the handler as required. The
- * function signature of the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the wait completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
+ *
+ * @par Completion Signature
+ * @code void(asio::error_code) @endcode
*/
template <
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code))
- WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler,
- void (asio::error_code))
- async_wait(
- ASIO_MOVE_ARG(WaitHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ WaitToken = default_completion_token_t<executor_type>>
+ auto async_wait(
+ WaitToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WaitToken, void (asio::error_code)>(
+ declval<initiate_async_wait>(), token))
{
- return async_initiate<WaitHandler, void (asio::error_code)>(
- initiate_async_wait(this), handler);
+ return async_initiate<WaitToken, void (asio::error_code)>(
+ initiate_async_wait(this), token);
}
private:
// Disallow copying and assignment.
- basic_object_handle(const basic_object_handle&) ASIO_DELETED;
- basic_object_handle& operator=(const basic_object_handle&) ASIO_DELETED;
+ basic_object_handle(const basic_object_handle&) = delete;
+ basic_object_handle& operator=(const basic_object_handle&) = delete;
class initiate_async_wait
{
@@ -398,13 +448,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WaitHandler>
- void operator()(ASIO_MOVE_ARG(WaitHandler) handler) const
+ void operator()(WaitHandler&& handler) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WaitHandler.
diff --git a/3rdparty/asio/include/asio/windows/basic_overlapped_handle.hpp b/3rdparty/asio/include/asio/windows/basic_overlapped_handle.hpp
index 29154b036a3..8b8475b0006 100644
--- a/3rdparty/asio/include/asio/windows/basic_overlapped_handle.hpp
+++ b/3rdparty/asio/include/asio/windows/basic_overlapped_handle.hpp
@@ -2,7 +2,7 @@
// windows/basic_overlapped_handle.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,6 +22,7 @@
|| defined(GENERATING_DOCUMENTATION)
#include <cstddef>
+#include <utility>
#include "asio/any_io_executor.hpp"
#include "asio/async_result.hpp"
#include "asio/detail/io_object_impl.hpp"
@@ -30,10 +31,6 @@
#include "asio/error.hpp"
#include "asio/execution_context.hpp"
-#if defined(ASIO_HAS_MOVE)
-# include <utility>
-#endif // defined(ASIO_HAS_MOVE)
-
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -99,10 +96,10 @@ public:
*/
template <typename ExecutionContext>
explicit basic_overlapped_handle(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: impl_(0, 0, context)
{
}
@@ -145,9 +142,9 @@ public:
template <typename ExecutionContext>
basic_overlapped_handle(ExecutionContext& context,
const native_handle_type& native_handle,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: impl_(0, 0, context)
{
asio::error_code ec;
@@ -155,7 +152,6 @@ public:
asio::detail::throw_error(ec, "assign");
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct an overlapped handle from another.
/**
* This constructor moves a handle from one object to another.
@@ -188,10 +184,56 @@ public:
impl_ = std::move(other.impl_);
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+
+ // All overlapped handles have access to each other's implementations.
+ template <typename Executor1>
+ friend class basic_overlapped_handle;
+
+ /// Move-construct an overlapped handle from a handle of another executor
+ /// type.
+ /**
+ * This constructor moves a handle from one object to another.
+ *
+ * @param other The other overlapped handle object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c overlapped_handle(const executor_type&)
+ * constructor.
+ */
+ template<typename Executor1>
+ basic_overlapped_handle(basic_overlapped_handle<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : impl_(std::move(other.impl_))
+ {
+ }
+
+ /// Move-assign an overlapped handle from a handle of another executor type.
+ /**
+ * This assignment operator moves a handle from one object to another.
+ *
+ * @param other The other overlapped handle object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c overlapped_handle(const executor_type&)
+ * constructor.
+ */
+ template<typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_overlapped_handle&
+ > operator=(basic_overlapped_handle<Executor1>&& other)
+ {
+ impl_ = std::move(other.impl_);
+ return *this;
+ }
/// Get the executor associated with the object.
- executor_type get_executor() ASIO_NOEXCEPT
+ const executor_type& get_executor() noexcept
{
return impl_.get_executor();
}
@@ -289,6 +331,58 @@ public:
ASIO_SYNC_OP_VOID_RETURN(ec);
}
+ /// Release ownership of the underlying native handle.
+ /**
+ * This function causes all outstanding asynchronous operations to finish
+ * immediately, and the handlers for cancelled operations will be passed the
+ * asio::error::operation_aborted error. Ownership of the native handle
+ * is then transferred to the caller.
+ *
+ * @throws asio::system_error Thrown on failure.
+ *
+ * @note This function is unsupported on Windows versions prior to Windows
+ * 8.1, and will fail with asio::error::operation_not_supported on
+ * these platforms.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603)
+ __declspec(deprecated("This function always fails with "
+ "operation_not_supported when used on Windows versions "
+ "prior to Windows 8.1."))
+#endif
+ native_handle_type release()
+ {
+ asio::error_code ec;
+ native_handle_type s = impl_.get_service().release(
+ impl_.get_implementation(), ec);
+ asio::detail::throw_error(ec, "release");
+ return s;
+ }
+
+ /// Release ownership of the underlying native handle.
+ /**
+ * This function causes all outstanding asynchronous operations to finish
+ * immediately, and the handlers for cancelled operations will be passed the
+ * asio::error::operation_aborted error. Ownership of the native handle
+ * is then transferred to the caller.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note This function is unsupported on Windows versions prior to Windows
+ * 8.1, and will fail with asio::error::operation_not_supported on
+ * these platforms.
+ */
+#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0603)
+ __declspec(deprecated("This function always fails with "
+ "operation_not_supported when used on Windows versions "
+ "prior to Windows 8.1."))
+#endif
+ native_handle_type release(asio::error_code& ec)
+ {
+ return impl_.get_service().release(impl_.get_implementation(), ec);
+ }
+
/// Get the native handle representation.
/**
* This function may be used to obtain the underlying representation of the
@@ -344,9 +438,9 @@ protected:
private:
// Disallow copying and assignment.
- basic_overlapped_handle(const basic_overlapped_handle&) ASIO_DELETED;
+ basic_overlapped_handle(const basic_overlapped_handle&) = delete;
basic_overlapped_handle& operator=(
- const basic_overlapped_handle&) ASIO_DELETED;
+ const basic_overlapped_handle&) = delete;
};
} // namespace windows
diff --git a/3rdparty/asio/include/asio/windows/basic_random_access_handle.hpp b/3rdparty/asio/include/asio/windows/basic_random_access_handle.hpp
index ab7a0a5b612..e66e943c6b5 100644
--- a/3rdparty/asio/include/asio/windows/basic_random_access_handle.hpp
+++ b/3rdparty/asio/include/asio/windows/basic_random_access_handle.hpp
@@ -2,7 +2,7 @@
// windows/basic_random_access_handle.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -39,6 +39,10 @@ template <typename Executor = any_io_executor>
class basic_random_access_handle
: public basic_overlapped_handle<Executor>
{
+private:
+ class initiate_async_write_some_at;
+ class initiate_async_read_some_at;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -75,8 +79,8 @@ public:
/// Construct a random-access handle without opening it.
/**
* This constructor creates a random-access handle without opening it. The
- * handle needs to be opened or assigned before data can be sent or received
- * on it.
+ * handle needs to be opened or assigned before data can be written to or read
+ * from it.
*
* @param context An execution context which provides the I/O executor that
* the random-access handle will use, by default, to dispatch handlers for any
@@ -84,10 +88,10 @@ public:
*/
template <typename ExecutionContext>
explicit basic_random_access_handle(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: basic_overlapped_handle<Executor>(context)
{
}
@@ -127,14 +131,13 @@ public:
template <typename ExecutionContext>
basic_random_access_handle(ExecutionContext& context,
const native_handle_type& handle,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_overlapped_handle<Executor>(context, handle)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a random-access handle from another.
/**
* This constructor moves a random-access handle from one object to another.
@@ -168,7 +171,51 @@ public:
basic_overlapped_handle<Executor>::operator=(std::move(other));
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+
+ /// Move-construct a random-access handle from a handle of another executor
+ /// type.
+ /**
+ * This constructor moves a random-access handle from one object to another.
+ *
+ * @param other The other random-access handle object from which the
+ * move will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_random_access_handle(const executor_type&)
+ * constructor.
+ */
+ template<typename Executor1>
+ basic_random_access_handle(basic_random_access_handle<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_overlapped_handle<Executor>(std::move(other))
+ {
+ }
+
+ /// Move-assign a random-access handle from a handle of another executor
+ /// type.
+ /**
+ * This assignment operator moves a random-access handle from one object to
+ * another.
+ *
+ * @param other The other random-access handle object from which the
+ * move will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_random_access_handle(const executor_type&)
+ * constructor.
+ */
+ template<typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_random_access_handle&
+ > operator=(basic_random_access_handle<Executor1>&& other)
+ {
+ basic_overlapped_handle<Executor>::operator=(std::move(other));
+ return *this;
+ }
/// Write some data to the handle at the specified offset.
/**
@@ -239,27 +286,33 @@ public:
/// Start an asynchronous write at the specified offset.
/**
* This function is used to asynchronously write data to the random-access
- * handle. The function call always returns immediately.
+ * handle. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param offset The offset at which the data will be written.
*
* @param buffers One or more data buffers to be written to the handle.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes written.
+ * std::size_t bytes_transferred // Number of bytes written.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The write operation may not transmit all of the data to the peer.
* Consider using the @ref async_write_at function if you need to ensure that
* all data is written before the asynchronous operation completes.
@@ -285,18 +338,17 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_write_some_at(uint64_t offset,
- const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_write_some_at(uint64_t offset, const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_write_some_at>(), token, offset, buffers))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_write_some_at(this), handler, offset, buffers);
+ initiate_async_write_some_at(this), token, offset, buffers);
}
/// Read some data from the handle at the specified offset.
@@ -370,27 +422,33 @@ public:
/// Start an asynchronous read at the specified offset.
/**
* This function is used to asynchronously read data from the random-access
- * handle. The function call always returns immediately.
+ * handle. It is an initiating function for an @ref asynchronous_operation,
+ * and always returns immediately.
*
* @param offset The offset at which the data will be read.
*
* @param buffers One or more buffers into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes read.
+ * std::size_t bytes_transferred // Number of bytes read.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The read operation may not read all of the requested number of bytes.
* Consider using the @ref async_read_at function if you need to ensure that
* the requested amount of data is read before the asynchronous operation
@@ -417,18 +475,17 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_read_some_at(uint64_t offset,
- const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_read_some_at(uint64_t offset, const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_read_some_at>(), token, offset, buffers))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_read_some_at(this), handler, offset, buffers);
+ initiate_async_read_some_at(this), token, offset, buffers);
}
private:
@@ -442,13 +499,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
uint64_t offset, const ConstBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
@@ -475,13 +532,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
uint64_t offset, const MutableBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
diff --git a/3rdparty/asio/include/asio/windows/basic_stream_handle.hpp b/3rdparty/asio/include/asio/windows/basic_stream_handle.hpp
index 1a35224a234..0331d9dfa03 100644
--- a/3rdparty/asio/include/asio/windows/basic_stream_handle.hpp
+++ b/3rdparty/asio/include/asio/windows/basic_stream_handle.hpp
@@ -2,7 +2,7 @@
// windows/basic_stream_handle.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -42,6 +42,10 @@ template <typename Executor = any_io_executor>
class basic_stream_handle
: public basic_overlapped_handle<Executor>
{
+private:
+ class initiate_async_write_some;
+ class initiate_async_read_some;
+
public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
@@ -78,7 +82,8 @@ public:
/// Construct a stream handle without opening it.
/**
* This constructor creates a stream handle without opening it. The handle
- * needs to be opened or assigned before data can be sent or received on it.
+ * needs to be opened or assigned before data can be written to or read from
+ * it.
*
* @param context An execution context which provides the I/O executor that
* the stream handle will use, by default, to dispatch handlers for any
@@ -86,10 +91,10 @@ public:
*/
template <typename ExecutionContext>
explicit basic_stream_handle(ExecutionContext& context,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value,
defaulted_constraint
- >::type = defaulted_constraint())
+ > = defaulted_constraint())
: basic_overlapped_handle<Executor>(context)
{
}
@@ -128,14 +133,13 @@ public:
template <typename ExecutionContext>
basic_stream_handle(ExecutionContext& context,
const native_handle_type& handle,
- typename constraint<
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
: basic_overlapped_handle<Executor>(context, handle)
{
}
-#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a stream handle from another.
/**
* This constructor moves a stream handle from one object to another.
@@ -168,7 +172,48 @@ public:
basic_overlapped_handle<Executor>::operator=(std::move(other));
return *this;
}
-#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+
+ /// Move-construct a stream handle from a handle of another executor type.
+ /**
+ * This constructor moves a stream handle from one object to another.
+ *
+ * @param other The other stream handle object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_handle(const executor_type&)
+ * constructor.
+ */
+ template<typename Executor1>
+ basic_stream_handle(basic_stream_handle<Executor1>&& other,
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ defaulted_constraint
+ > = defaulted_constraint())
+ : basic_overlapped_handle<Executor>(std::move(other))
+ {
+ }
+
+ /// Move-assign a stream handle from a handle of another executor type.
+ /**
+ * This assignment operator moves a stream handle from one object to
+ * another.
+ *
+ * @param other The other stream handle object from which the move will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_handle(const executor_type&)
+ * constructor.
+ */
+ template<typename Executor1>
+ constraint_t<
+ is_convertible<Executor1, Executor>::value,
+ basic_stream_handle&
+ > operator=(basic_stream_handle<Executor1>&& other)
+ {
+ basic_overlapped_handle<Executor>::operator=(std::move(other));
+ return *this;
+ }
/// Write some data to the handle.
/**
@@ -234,25 +279,31 @@ public:
/// Start an asynchronous write.
/**
* This function is used to asynchronously write data to the stream handle.
- * The function call always returns immediately.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more data buffers to be written to the handle.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes written.
+ * std::size_t bytes_transferred // Number of bytes written.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The write operation may not transmit all of the data to the peer.
* Consider using the @ref async_write function if you need to ensure that all
* data is written before the asynchronous operation completes.
@@ -278,17 +329,17 @@ public:
*/
template <typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
- async_write_some(const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) WriteToken = default_completion_token_t<executor_type>>
+ auto async_write_some(const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_write_some>(), token, buffers))
{
- return async_initiate<WriteHandler,
+ return async_initiate<WriteToken,
void (asio::error_code, std::size_t)>(
- initiate_async_write_some(this), handler, buffers);
+ initiate_async_write_some(this), token, buffers);
}
/// Read some data from the handle.
@@ -357,25 +408,31 @@ public:
/// Start an asynchronous read.
/**
* This function is used to asynchronously read data from the stream handle.
- * The function call always returns immediately.
+ * It is an initiating function for an @ref asynchronous_operation, and always
+ * returns immediately.
*
* @param buffers One or more buffers into which the data will be read.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the read operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the read completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* const asio::error_code& error, // Result of operation.
- * std::size_t bytes_transferred // Number of bytes read.
+ * std::size_t bytes_transferred // Number of bytes read.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @note The read operation may not read all of the requested number of bytes.
* Consider using the @ref async_read function if you need to ensure that the
* requested amount of data is read before the asynchronous operation
@@ -402,17 +459,17 @@ public:
*/
template <typename MutableBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) ReadHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
- void (asio::error_code, std::size_t))
- async_read_some(const MutableBufferSequence& buffers,
- ASIO_MOVE_ARG(ReadHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
+ std::size_t)) ReadToken = default_completion_token_t<executor_type>>
+ auto async_read_some(const MutableBufferSequence& buffers,
+ ReadToken&& token = default_completion_token_t<executor_type>())
+ -> decltype(
+ async_initiate<ReadToken,
+ void (asio::error_code, std::size_t)>(
+ declval<initiate_async_read_some>(), token, buffers))
{
- return async_initiate<ReadHandler,
+ return async_initiate<ReadToken,
void (asio::error_code, std::size_t)>(
- initiate_async_read_some(this), handler, buffers);
+ initiate_async_read_some(this), token, buffers);
}
private:
@@ -426,13 +483,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
- void operator()(ASIO_MOVE_ARG(WriteHandler) handler,
+ void operator()(WriteHandler&& handler,
const ConstBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
@@ -459,13 +516,13 @@ private:
{
}
- executor_type get_executor() const ASIO_NOEXCEPT
+ const executor_type& get_executor() const noexcept
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
- void operator()(ASIO_MOVE_ARG(ReadHandler) handler,
+ void operator()(ReadHandler&& handler,
const MutableBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
diff --git a/3rdparty/asio/include/asio/windows/object_handle.hpp b/3rdparty/asio/include/asio/windows/object_handle.hpp
index 14d6801c534..243d9455ce2 100644
--- a/3rdparty/asio/include/asio/windows/object_handle.hpp
+++ b/3rdparty/asio/include/asio/windows/object_handle.hpp
@@ -2,7 +2,7 @@
// windows/object_handle.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2011 Boris Schaeling (boris@highscore.de)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/include/asio/windows/overlapped_handle.hpp b/3rdparty/asio/include/asio/windows/overlapped_handle.hpp
index b2592b92052..fc12865b48c 100644
--- a/3rdparty/asio/include/asio/windows/overlapped_handle.hpp
+++ b/3rdparty/asio/include/asio/windows/overlapped_handle.hpp
@@ -2,7 +2,7 @@
// windows/overlapped_handle.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/windows/overlapped_ptr.hpp b/3rdparty/asio/include/asio/windows/overlapped_ptr.hpp
index 5ac2ab1a5e7..e1e6f8c841f 100644
--- a/3rdparty/asio/include/asio/windows/overlapped_ptr.hpp
+++ b/3rdparty/asio/include/asio/windows/overlapped_ptr.hpp
@@ -2,7 +2,7 @@
// windows/overlapped_ptr.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -51,23 +51,23 @@ public:
/// Construct an overlapped_ptr to contain the specified handler.
template <typename ExecutionContext, typename Handler>
explicit overlapped_ptr(ExecutionContext& context,
- ASIO_MOVE_ARG(Handler) handler,
- typename constraint<
+ Handler&& handler,
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
- : impl_(context.get_executor(), ASIO_MOVE_CAST(Handler)(handler))
+ > = 0)
+ : impl_(context.get_executor(), static_cast<Handler&&>(handler))
{
}
/// Construct an overlapped_ptr to contain the specified handler.
template <typename Executor, typename Handler>
explicit overlapped_ptr(const Executor& ex,
- ASIO_MOVE_ARG(Handler) handler,
- typename constraint<
+ Handler&& handler,
+ constraint_t<
execution::is_executor<Executor>::value
|| is_executor<Executor>::value
- >::type = 0)
- : impl_(ex, ASIO_MOVE_CAST(Handler)(handler))
+ > = 0)
+ : impl_(ex, static_cast<Handler&&>(handler))
{
}
@@ -85,24 +85,24 @@ public:
/// Reset to contain the specified handler, freeing any current OVERLAPPED
/// object.
template <typename ExecutionContext, typename Handler>
- void reset(ExecutionContext& context, ASIO_MOVE_ARG(Handler) handler,
- typename constraint<
+ void reset(ExecutionContext& context, Handler&& handler,
+ constraint_t<
is_convertible<ExecutionContext&, execution_context&>::value
- >::type = 0)
+ > = 0)
{
- impl_.reset(context.get_executor(), ASIO_MOVE_CAST(Handler)(handler));
+ impl_.reset(context.get_executor(), static_cast<Handler&&>(handler));
}
/// Reset to contain the specified handler, freeing any current OVERLAPPED
/// object.
template <typename Executor, typename Handler>
- void reset(const Executor& ex, ASIO_MOVE_ARG(Handler) handler,
- typename constraint<
+ void reset(const Executor& ex, Handler&& handler,
+ constraint_t<
execution::is_executor<Executor>::value
|| is_executor<Executor>::value
- >::type = 0)
+ > = 0)
{
- impl_.reset(ex, ASIO_MOVE_CAST(Handler)(handler));
+ impl_.reset(ex, static_cast<Handler&&>(handler));
}
/// Get the contained OVERLAPPED object.
diff --git a/3rdparty/asio/include/asio/windows/random_access_handle.hpp b/3rdparty/asio/include/asio/windows/random_access_handle.hpp
index aff4529423f..88dfa36ecdd 100644
--- a/3rdparty/asio/include/asio/windows/random_access_handle.hpp
+++ b/3rdparty/asio/include/asio/windows/random_access_handle.hpp
@@ -2,7 +2,7 @@
// windows/random_access_handle.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/windows/stream_handle.hpp b/3rdparty/asio/include/asio/windows/stream_handle.hpp
index fabf8862433..4b88b8cb699 100644
--- a/3rdparty/asio/include/asio/windows/stream_handle.hpp
+++ b/3rdparty/asio/include/asio/windows/stream_handle.hpp
@@ -2,7 +2,7 @@
// windows/stream_handle.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/include/asio/writable_pipe.hpp b/3rdparty/asio/include/asio/writable_pipe.hpp
new file mode 100644
index 00000000000..27f408a4956
--- /dev/null
+++ b/3rdparty/asio/include/asio/writable_pipe.hpp
@@ -0,0 +1,35 @@
+//
+// writable_pipe.hpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 ASIO_WRITABLE_PIPE_HPP
+#define ASIO_WRITABLE_PIPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+
+#if defined(ASIO_HAS_PIPE) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#include "asio/basic_writable_pipe.hpp"
+
+namespace asio {
+
+/// Typedef for the typical usage of a writable pipe.
+typedef basic_writable_pipe<> writable_pipe;
+
+} // namespace asio
+
+#endif // defined(ASIO_HAS_PIPE)
+ // || defined(GENERATING_DOCUMENTATION)
+
+#endif // ASIO_WRITABLE_PIPE_HPP
diff --git a/3rdparty/asio/include/asio/write.hpp b/3rdparty/asio/include/asio/write.hpp
index df82e06aec1..ca3f002c025 100644
--- a/3rdparty/asio/include/asio/write.hpp
+++ b/3rdparty/asio/include/asio/write.hpp
@@ -2,7 +2,7 @@
// write.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,6 +19,7 @@
#include <cstddef>
#include "asio/async_result.hpp"
#include "asio/buffer.hpp"
+#include "asio/completion_condition.hpp"
#include "asio/error.hpp"
#if !defined(ASIO_NO_EXTENSIONS)
@@ -28,6 +29,15 @@
#include "asio/detail/push_options.hpp"
namespace asio {
+namespace detail {
+
+template <typename> class initiate_async_write;
+#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
+template <typename> class initiate_async_write_dynbuf_v1;
+#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
+template <typename> class initiate_async_write_dynbuf_v2;
+
+} // namespace detail
/**
* @defgroup write asio::write
@@ -75,9 +85,9 @@ namespace asio {
*/
template <typename SyncWriteStream, typename ConstBufferSequence>
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
- typename constraint<
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type = 0);
+ > = 0);
/// Write all of the supplied data to a stream before returning.
/**
@@ -118,9 +128,9 @@ std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
template <typename SyncWriteStream, typename ConstBufferSequence>
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type = 0);
+ > = 0);
/// Write a certain amount of data to a stream before returning.
/**
@@ -172,9 +182,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition,
- typename constraint<
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type = 0);
+ > = 0);
/// Write a certain amount of data to a stream before returning.
/**
@@ -219,9 +229,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type = 0);
+ > = 0);
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -254,13 +264,13 @@ std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
*/
template <typename SyncWriteStream, typename DynamicBuffer_v1>
std::size_t write(SyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ DynamicBuffer_v1&& buffers,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Write all of the supplied data to a stream before returning.
/**
@@ -291,14 +301,14 @@ std::size_t write(SyncWriteStream& s,
*/
template <typename SyncWriteStream, typename DynamicBuffer_v1>
std::size_t write(SyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Write a certain amount of data to a stream before returning.
/**
@@ -339,14 +349,14 @@ std::size_t write(SyncWriteStream& s,
template <typename SyncWriteStream, typename DynamicBuffer_v1,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
/// Write a certain amount of data to a stream before returning.
/**
@@ -388,14 +398,14 @@ std::size_t write(SyncWriteStream& s,
template <typename SyncWriteStream, typename DynamicBuffer_v1,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
+ DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0);
#if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM)
@@ -573,9 +583,9 @@ std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b,
*/
template <typename SyncWriteStream, typename DynamicBuffer_v2>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Write all of the supplied data to a stream before returning.
/**
@@ -607,9 +617,9 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
template <typename SyncWriteStream, typename DynamicBuffer_v2>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Write a certain amount of data to a stream before returning.
/**
@@ -651,9 +661,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/// Write a certain amount of data to a stream before returning.
/**
@@ -696,9 +706,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, asio::error_code& ec,
- typename constraint<
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0);
/*@}*/
/**
@@ -713,9 +723,9 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
/// stream.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * data to a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li All of the data in the supplied buffers has been written. That is, the
* bytes transferred is equal to the sum of the buffer sizes.
@@ -734,24 +744,29 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
* @param buffers One or more buffers containing the data to be written.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes written from the
- * // buffers. If an error occurred,
- * // this will be less than the sum
- * // of the buffer sizes.
+ * // Number of bytes written from the buffers. If an error
+ * // occurred, this will be less than the sum of the buffer sizes.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To write a single data buffer use the @ref buffer function as follows:
* @code
@@ -774,26 +789,27 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
*/
template <typename AsyncWriteStream, typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncWriteStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncWriteStream::executor_type),
- typename constraint<
+ std::size_t)) WriteToken
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>>
+auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
+ WriteToken&& token
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>(),
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write<AsyncWriteStream>>(),
+ token, buffers, transfer_all()));
/// Start an asynchronous operation to write a certain amount of data to a
/// stream.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * data to a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li All of the data in the supplied buffers has been written. That is, the
* bytes transferred is equal to the sum of the buffer sizes.
@@ -812,7 +828,7 @@ async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
* @param buffers One or more buffers containing the data to be written.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the write operation is complete. The signature of the function object
@@ -828,22 +844,27 @@ async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
* non-zero return value indicates the maximum number of bytes to be written on
* the next call to the stream's async_write_some function.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes written from the
- * // buffers. If an error occurred,
- * // this will be less than the sum
- * // of the buffer sizes.
+ * // Number of bytes written from the buffers. If an error
+ * // occurred, this will be less than the sum of the buffer sizes.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To write a single data buffer use the @ref buffer function as follows:
* @code asio::async_write(s,
@@ -868,15 +889,19 @@ async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
template <typename AsyncWriteStream,
typename ConstBufferSequence, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken>
+auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler,
- typename constraint<
+ WriteToken&& token,
+ constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write<AsyncWriteStream>>(),
+ token, buffers,
+ static_cast<CompletionCondition&&>(completion_condition)));
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -884,9 +909,9 @@ async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
/// stream.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * data to a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li All of the data in the supplied dynamic buffer sequence has been written.
*
@@ -904,25 +929,30 @@ async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
* @param buffers The dynamic buffer sequence from which data will be written.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called. Successfully written
- * data is automatically consumed from the buffers.
- *
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * that they remain valid until the completion handler is called. Successfully
+ * written data is automatically consumed from the buffers.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes written from the
- * // buffers. If an error occurred,
- * // this will be less than the sum
- * // of the buffer sizes.
+ * // Number of bytes written from the buffers. If an error
+ * // occurred, this will be less than the sum of the buffer sizes.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -936,30 +966,31 @@ async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
*/
template <typename AsyncWriteStream, typename DynamicBuffer_v1,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncWriteStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncWriteStream::executor_type),
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ std::size_t)) WriteToken
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>>
+auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
+ WriteToken&& token
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>(),
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ transfer_all()));
/// Start an asynchronous operation to write a certain amount of data to a
/// stream.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * data to a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li All of the data in the supplied dynamic buffer sequence has been written.
*
@@ -977,8 +1008,8 @@ async_write(AsyncWriteStream& s,
* @param buffers The dynamic buffer sequence from which data will be written.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called. Successfully written
- * data is automatically consumed from the buffers.
+ * that they remain valid until the completion handler is called. Successfully
+ * written data is automatically consumed from the buffers.
*
* @param completion_condition The function object to be called to determine
* whether the write operation is complete. The signature of the function object
@@ -994,22 +1025,27 @@ async_write(AsyncWriteStream& s,
* non-zero return value indicates the maximum number of bytes to be written on
* the next call to the stream's async_write_some function.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes written from the
- * // buffers. If an error occurred,
- * // this will be less than the sum
- * // of the buffer sizes.
+ * // Number of bytes written from the buffers. If an error
+ * // occurred, this will be less than the sum of the buffer sizes.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -1024,19 +1060,21 @@ async_write(AsyncWriteStream& s,
template <typename AsyncWriteStream,
typename DynamicBuffer_v1, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s,
- ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler,
- typename constraint<
- is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0,
- typename constraint<
- !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type = 0);
+ std::size_t)) WriteToken>
+auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
+ CompletionCondition completion_condition, WriteToken&& token,
+ constraint_t<
+ is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition)));
#if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM)
@@ -1045,9 +1083,9 @@ async_write(AsyncWriteStream& s,
/// stream.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * data to a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li All of the data in the supplied basic_streambuf has been written.
*
@@ -1064,24 +1102,29 @@ async_write(AsyncWriteStream& s,
*
* @param b A basic_streambuf object from which data will be written. Ownership
* of the streambuf is retained by the caller, which must guarantee that it
- * remains valid until the handler is called.
+ * remains valid until the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes written from the
- * // buffers. If an error occurred,
- * // this will be less than the sum
- * // of the buffer sizes.
+ * // Number of bytes written from the buffers. If an error
+ * // occurred, this will be less than the sum of the buffer sizes.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -1095,23 +1138,24 @@ async_write(AsyncWriteStream& s,
*/
template <typename AsyncWriteStream, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncWriteStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncWriteStream::executor_type));
+ std::size_t)) WriteToken
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>>
+auto async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
+ WriteToken&& token
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
+ token, basic_streambuf_ref<Allocator>(b), transfer_all()));
/// Start an asynchronous operation to write a certain amount of data to a
/// stream.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * data to a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li All of the data in the supplied basic_streambuf has been written.
*
@@ -1128,7 +1172,7 @@ async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
*
* @param b A basic_streambuf object from which data will be written. Ownership
* of the streambuf is retained by the caller, which must guarantee that it
- * remains valid until the handler is called.
+ * remains valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the write operation is complete. The signature of the function object
@@ -1144,22 +1188,27 @@ async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
* non-zero return value indicates the maximum number of bytes to be written on
* the next call to the stream's async_write_some function.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes written from the
- * // buffers. If an error occurred,
- * // this will be less than the sum
- * // of the buffer sizes.
+ * // Number of bytes written from the buffers. If an error
+ * // occurred, this will be less than the sum of the buffer sizes.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -1174,12 +1223,15 @@ async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
template <typename AsyncWriteStream,
typename Allocator, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler);
+ std::size_t)) WriteToken>
+auto async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
+ CompletionCondition completion_condition, WriteToken&& token)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<CompletionCondition&&>(completion_condition)));
#endif // !defined(ASIO_NO_IOSTREAM)
#endif // !defined(ASIO_NO_EXTENSIONS)
@@ -1189,9 +1241,9 @@ async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
/// stream.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * data to a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li All of the data in the supplied dynamic buffer sequence has been written.
*
@@ -1209,25 +1261,30 @@ async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
* @param buffers The dynamic buffer sequence from which data will be written.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called. Successfully written
- * data is automatically consumed from the buffers.
- *
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * that they remain valid until the completion handler is called. Successfully
+ * written data is automatically consumed from the buffers.
+ *
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes written from the
- * // buffers. If an error occurred,
- * // this will be less than the sum
- * // of the buffer sizes.
+ * // Number of bytes written from the buffers. If an error
+ * // occurred, this will be less than the sum of the buffer sizes.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -1241,26 +1298,28 @@ async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
*/
template <typename AsyncWriteStream, typename DynamicBuffer_v2,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncWriteStream::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncWriteStream::executor_type),
- typename constraint<
+ std::size_t)) WriteToken
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>>
+auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
+ WriteToken&& token
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>(),
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ transfer_all()));
/// Start an asynchronous operation to write a certain amount of data to a
/// stream.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a stream. The function call always returns immediately. The
- * asynchronous operation will continue until one of the following conditions
- * is true:
+ * data to a stream. It is an initiating function for an @ref
+ * asynchronous_operation, and always returns immediately. The asynchronous
+ * operation will continue until one of the following conditions is true:
*
* @li All of the data in the supplied dynamic buffer sequence has been written.
*
@@ -1278,8 +1337,8 @@ async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
* @param buffers The dynamic buffer sequence from which data will be written.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called. Successfully written
- * data is automatically consumed from the buffers.
+ * that they remain valid until the completion handler is called. Successfully
+ * written data is automatically consumed from the buffers.
*
* @param completion_condition The function object to be called to determine
* whether the write operation is complete. The signature of the function object
@@ -1295,22 +1354,27 @@ async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
* non-zero return value indicates the maximum number of bytes to be written on
* the next call to the stream's async_write_some function.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
- * const asio::error_code& error, // Result of operation.
+ * // Result of operation.
+ * const asio::error_code& error,
*
- * std::size_t bytes_transferred // Number of bytes written from the
- * // buffers. If an error occurred,
- * // this will be less than the sum
- * // of the buffer sizes.
+ * // Number of bytes written from the buffers. If an error
+ * // occurred, this will be less than the sum of the buffer sizes.
+ * std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -1325,15 +1389,19 @@ async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
template <typename AsyncWriteStream,
typename DynamicBuffer_v2, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
+ std::size_t)) WriteToken>
+auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler,
- typename constraint<
+ WriteToken&& token,
+ constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type = 0);
+ > = 0)
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>>(),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition)));
/*@}*/
diff --git a/3rdparty/asio/include/asio/write_at.hpp b/3rdparty/asio/include/asio/write_at.hpp
index a4c98c0264f..a33514e61a0 100644
--- a/3rdparty/asio/include/asio/write_at.hpp
+++ b/3rdparty/asio/include/asio/write_at.hpp
@@ -2,7 +2,7 @@
// write_at.hpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,6 +18,7 @@
#include "asio/detail/config.hpp"
#include <cstddef>
#include "asio/async_result.hpp"
+#include "asio/completion_condition.hpp"
#include "asio/detail/cstdint.hpp"
#include "asio/error.hpp"
@@ -28,6 +29,14 @@
#include "asio/detail/push_options.hpp"
namespace asio {
+namespace detail {
+
+template <typename> class initiate_async_write_at;
+#if !defined(ASIO_NO_IOSTREAM)
+template <typename> class initiate_async_write_at_streambuf;
+#endif // !defined(ASIO_NO_IOSTREAM)
+
+} // namespace detail
/**
* @defgroup write_at asio::write_at
@@ -403,9 +412,10 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
/// specified offset.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a random access device at a specified offset. The function call
- * always returns immediately. The asynchronous operation will continue until
- * one of the following conditions is true:
+ * data to a random access device at a specified offset. It is an initiating
+ * function for an @ref asynchronous_operation, and always returns immediately.
+ * The asynchronous operation will continue until one of the following
+ * conditions is true:
*
* @li All of the data in the supplied buffers has been written. That is, the
* bytes transferred is equal to the sum of the buffer sizes.
@@ -428,11 +438,13 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
* @param buffers One or more buffers containing the data to be written.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of
- * the handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -442,10 +454,13 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To write a single data buffer use the @ref buffer function as follows:
* @code
@@ -468,24 +483,27 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
*/
template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncRandomAccessWriteDevice::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
- const ConstBufferSequence& buffers,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncRandomAccessWriteDevice::executor_type));
+ std::size_t)) WriteToken = default_completion_token_t<
+ typename AsyncRandomAccessWriteDevice::executor_type>>
+auto async_write_at(AsyncRandomAccessWriteDevice& d,
+ uint64_t offset, const ConstBufferSequence& buffers,
+ WriteToken&& token = default_completion_token_t<
+ typename AsyncRandomAccessWriteDevice::executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_at<
+ AsyncRandomAccessWriteDevice>>(),
+ token, offset, buffers, transfer_all()));
/// Start an asynchronous operation to write a certain amount of data at the
/// specified offset.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a random access device at a specified offset. The function call
- * always returns immediately. The asynchronous operation will continue until
- * one of the following conditions is true:
+ * data to a random access device at a specified offset. It is an initiating
+ * function for an @ref asynchronous_operation, and always returns immediately.
+ * The asynchronous operation will continue until one of the following
+ * conditions is true:
*
* @li All of the data in the supplied buffers has been written. That is, the
* bytes transferred is equal to the sum of the buffer sizes.
@@ -508,7 +526,7 @@ async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
* @param buffers One or more buffers containing the data to be written.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
- * that they remain valid until the handler is called.
+ * that they remain valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the write operation is complete. The signature of the function object
@@ -524,9 +542,11 @@ async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
* non-zero return value indicates the maximum number of bytes to be written on
* the next call to the device's async_write_some_at function.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -536,10 +556,13 @@ async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Example
* To write a single data buffer use the @ref buffer function as follows:
* @code asio::async_write_at(d, 42,
@@ -564,17 +587,20 @@ async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
template <typename AsyncRandomAccessWriteDevice,
typename ConstBufferSequence, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncRandomAccessWriteDevice::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d,
+ std::size_t)) WriteToken = default_completion_token_t<
+ typename AsyncRandomAccessWriteDevice::executor_type>>
+auto async_write_at(AsyncRandomAccessWriteDevice& d,
uint64_t offset, const ConstBufferSequence& buffers,
CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncRandomAccessWriteDevice::executor_type));
+ WriteToken&& token = default_completion_token_t<
+ typename AsyncRandomAccessWriteDevice::executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_at<
+ AsyncRandomAccessWriteDevice>>(),
+ token, offset, buffers,
+ static_cast<CompletionCondition&&>(completion_condition)));
#if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM)
@@ -583,9 +609,10 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
/// specified offset.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a random access device at a specified offset. The function call
- * always returns immediately. The asynchronous operation will continue until
- * one of the following conditions is true:
+ * data to a random access device at a specified offset. It is an initiating
+ * function for an @ref asynchronous_operation, and always returns immediately.
+ * The asynchronous operation will continue until one of the following
+ * conditions is true:
*
* @li All of the data in the supplied basic_streambuf has been written.
*
@@ -606,11 +633,13 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
*
* @param b A basic_streambuf object from which data will be written. Ownership
* of the streambuf is retained by the caller, which must guarantee that it
- * remains valid until the handler is called.
+ * remains valid until the completion handler is called.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -620,10 +649,13 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -637,24 +669,27 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
*/
template <typename AsyncRandomAccessWriteDevice, typename Allocator,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncRandomAccessWriteDevice::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d,
+ std::size_t)) WriteToken = default_completion_token_t<
+ typename AsyncRandomAccessWriteDevice::executor_type>>
+auto async_write_at(AsyncRandomAccessWriteDevice& d,
uint64_t offset, basic_streambuf<Allocator>& b,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncRandomAccessWriteDevice::executor_type));
+ WriteToken&& token = default_completion_token_t<
+ typename AsyncRandomAccessWriteDevice::executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_at_streambuf<
+ AsyncRandomAccessWriteDevice>>(),
+ token, offset, &b, transfer_all()));
/// Start an asynchronous operation to write a certain amount of data at the
/// specified offset.
/**
* This function is used to asynchronously write a certain number of bytes of
- * data to a random access device at a specified offset. The function call
- * always returns immediately. The asynchronous operation will continue until
- * one of the following conditions is true:
+ * data to a random access device at a specified offset. It is an initiating
+ * function for an @ref asynchronous_operation, and always returns immediately.
+ * The asynchronous operation will continue until one of the following
+ * conditions is true:
*
* @li All of the data in the supplied basic_streambuf has been written.
*
@@ -675,7 +710,7 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
*
* @param b A basic_streambuf object from which data will be written. Ownership
* of the streambuf is retained by the caller, which must guarantee that it
- * remains valid until the handler is called.
+ * remains valid until the completion handler is called.
*
* @param completion_condition The function object to be called to determine
* whether the write operation is complete. The signature of the function object
@@ -691,9 +726,11 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
* non-zero return value indicates the maximum number of bytes to be written on
* the next call to the device's async_write_some_at function.
*
- * @param handler The handler to be called when the write operation completes.
- * Copies will be made of the handler as required. The function signature of the
- * handler must be:
+ * @param token The @ref completion_token that will be used to produce a
+ * completion handler, which will be called when the write completes.
+ * Potential completion tokens include @ref use_future, @ref use_awaitable,
+ * @ref yield_context, or a function object with the correct completion
+ * signature. The function signature of the completion handler must be:
* @code void handler(
* // Result of operation.
* const asio::error_code& error,
@@ -703,10 +740,13 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
* std::size_t bytes_transferred
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
- * not, the handler will not be invoked from within this function. On
- * immediate completion, invocation of the handler will be performed in a
+ * not, the completion handler will not be invoked from within this function.
+ * On immediate completion, invocation of the handler will be performed in a
* manner equivalent to using asio::post().
*
+ * @par Completion Signature
+ * @code void(asio::error_code, std::size_t) @endcode
+ *
* @par Per-Operation Cancellation
* This asynchronous operation supports cancellation for the following
* asio::cancellation_type values:
@@ -721,16 +761,19 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
template <typename AsyncRandomAccessWriteDevice,
typename Allocator, typename CompletionCondition,
ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code,
- std::size_t)) WriteHandler
- ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
- typename AsyncRandomAccessWriteDevice::executor_type)>
-ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
- void (asio::error_code, std::size_t))
-async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
+ std::size_t)) WriteToken = default_completion_token_t<
+ typename AsyncRandomAccessWriteDevice::executor_type>>
+auto async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
- ASIO_MOVE_ARG(WriteHandler) handler
- ASIO_DEFAULT_COMPLETION_TOKEN(
- typename AsyncRandomAccessWriteDevice::executor_type));
+ WriteToken&& token = default_completion_token_t<
+ typename AsyncRandomAccessWriteDevice::executor_type>())
+ -> decltype(
+ async_initiate<WriteToken,
+ void (asio::error_code, std::size_t)>(
+ declval<detail::initiate_async_write_at_streambuf<
+ AsyncRandomAccessWriteDevice>>(),
+ token, offset, &b,
+ static_cast<CompletionCondition&&>(completion_condition)));
#endif // !defined(ASIO_NO_IOSTREAM)
#endif // !defined(ASIO_NO_EXTENSIONS)
diff --git a/3rdparty/asio/include/asio/yield.hpp b/3rdparty/asio/include/asio/yield.hpp
index 5c090a65c4e..c180503dda9 100644
--- a/3rdparty/asio/include/asio/yield.hpp
+++ b/3rdparty/asio/include/asio/yield.hpp
@@ -2,7 +2,7 @@
// yield.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/install-sh b/3rdparty/asio/install-sh
index 377bb8687ff..ec298b53740 100755
--- a/3rdparty/asio/install-sh
+++ b/3rdparty/asio/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
# This script is compatible with the BSD install script, but was written
# from scratch.
+tab=' '
nl='
'
-IFS=" "" $nl"
+IFS=" $tab$nl"
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
-# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
@@ -68,22 +64,16 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
posix_mkdir=
# Desired mode of installed file.
mode=0755
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@@ -97,7 +87,7 @@ dir_arg=
dst_arg=
copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -114,18 +104,28 @@ Options:
--version display version info and exit.
-c (ignored)
- -C install only if different (preserve the last data modification time)
+ -C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
+ -p pass -p to $cpprog.
-s $stripprog installed files.
+ -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to bug-automake@gnu.org.
+Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
@@ -137,46 +137,62 @@ while test $# -ne 0; do
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift;;
+ shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
-o) chowncmd="$chownprog $2"
- shift;;
+ shift;;
+
+ -p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;;
- -t) dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
+ -S) backupsuffix="$2"
+ shift;;
- -T) no_target_directory=true;;
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
- --) shift
- break;;
+ --) shift
+ break;;
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
*) break;;
esac
shift
done
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@@ -208,6 +224,15 @@ if test $# -eq 0; then
fi
if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
@@ -223,16 +248,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw='% 200'
+ u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw=,u+rw
+ u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@@ -250,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
+ # Don't chown directories that already exist.
+ if test $dstdir_status = 0; then
+ chowncmd=""
+ fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -266,178 +295,148 @@ do
fi
dst=$dst_arg
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
+ # If destination is a directory, append the input filename.
if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
fi
dstdir=$dst
- dst=$dstdir/`basename "$src"`
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
dstdir_status=0
else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
+ dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ # The $RANDOM variable is not portable (e.g., dash). Use it
+ # here however when possible just to lower collision chance.
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+ trap '
+ ret=$?
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+ exit $ret
+ ' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p'.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
- mkdir_mode=
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
+ trap '' 0;;
esac
if
$posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
- # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
esac
- eval "$initialize_posix_glob"
-
oIFS=$IFS
IFS=/
- $posix_glob set -f
+ set -f
set fnord $dstdir
shift
- $posix_glob set +f
+ set +f
IFS=$oIFS
prefixes=
for d
do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
done
if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
fi
fi
fi
@@ -450,14 +449,25 @@ do
else
# Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+ (umask $cp_umask &&
+ { test -z "$stripcmd" || {
+ # Create $dsttmp read-write so that cp doesn't create it read-only,
+ # which would cause strip to fail.
+ if test -z "$doit"; then
+ : >"$dsttmp" # No need to fork-exec 'touch'.
+ else
+ $doit touch "$dsttmp"
+ fi
+ }
+ } &&
+ $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -472,20 +482,24 @@ do
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
+ set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
+ # If $backupsuffix is set, and the file being installed
+ # already exists, attempt a backup. Don't worry if it fails,
+ # e.g., if mv doesn't support -f.
+ if test -n "$backupsuffix" && test -f "$dst"; then
+ $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+ fi
+
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@@ -493,24 +507,24 @@ do
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
@@ -519,9 +533,9 @@ do
done
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/3rdparty/asio/missing b/3rdparty/asio/missing
index db98974ff5d..1fe1611f185 100755
--- a/3rdparty/asio/missing
+++ b/3rdparty/asio/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@ else
exit $st
fi
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
program_details ()
{
@@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/3rdparty/asio/src/Makefile.am b/3rdparty/asio/src/Makefile.am
index e9b20e607e9..587bb4935e8 100644
--- a/3rdparty/asio/src/Makefile.am
+++ b/3rdparty/asio/src/Makefile.am
@@ -1,7 +1,3 @@
-if !STANDALONE
-EXAMPLES_CPP03 = examples/cpp03
-endif
-
if HAVE_CXX11
EXAMPLES_CPP11 = examples/cpp11
endif
@@ -14,9 +10,23 @@ if HAVE_CXX17
EXAMPLES_CPP17 = examples/cpp17
endif
-SUBDIRS = $(EXAMPLES_CPP03) $(EXAMPLES_CPP11) $(EXAMPLES_CPP14) $(EXAMPLES_CPP17) tests
+if HAVE_CXX20
+EXAMPLES_CPP20 = examples/cpp20
+endif
+
+SUBDIRS = \
+ $(EXAMPLES_CPP11) \
+ $(EXAMPLES_CPP14) \
+ $(EXAMPLES_CPP17) \
+ $(EXAMPLES_CPP20) \
+ tests
-DIST_SUBDIRS = examples/cpp03 examples/cpp11 examples/cpp14 examples/cpp17 tests
+DIST_SUBDIRS = \
+ examples/cpp11 \
+ examples/cpp14 \
+ examples/cpp17 \
+ examples/cpp20 \
+ tests
EXTRA_DIST = \
Makefile.mgw \
diff --git a/3rdparty/asio/src/Makefile.in b/3rdparty/asio/src/Makefile.in
index 388a1533420..63e9eaf7c34 100644
--- a/3rdparty/asio/src/Makefile.in
+++ b/3rdparty/asio/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -148,8 +148,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
@@ -188,8 +186,9 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
-CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -198,9 +197,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
-GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -267,9 +265,11 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -278,12 +278,24 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-@STANDALONE_FALSE@EXAMPLES_CPP03 = examples/cpp03
@HAVE_CXX11_TRUE@EXAMPLES_CPP11 = examples/cpp11
@HAVE_CXX14_TRUE@EXAMPLES_CPP14 = examples/cpp14
@HAVE_CXX17_TRUE@EXAMPLES_CPP17 = examples/cpp17
-SUBDIRS = $(EXAMPLES_CPP03) $(EXAMPLES_CPP11) $(EXAMPLES_CPP14) $(EXAMPLES_CPP17) tests
-DIST_SUBDIRS = examples/cpp03 examples/cpp11 examples/cpp14 examples/cpp17 tests
+@HAVE_CXX20_TRUE@EXAMPLES_CPP20 = examples/cpp20
+SUBDIRS = \
+ $(EXAMPLES_CPP11) \
+ $(EXAMPLES_CPP14) \
+ $(EXAMPLES_CPP17) \
+ $(EXAMPLES_CPP20) \
+ tests
+
+DIST_SUBDIRS = \
+ examples/cpp11 \
+ examples/cpp14 \
+ examples/cpp17 \
+ examples/cpp20 \
+ tests
+
EXTRA_DIST = \
Makefile.mgw \
Makefile.msc \
@@ -425,7 +437,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/3rdparty/asio/src/Makefile.mgw b/3rdparty/asio/src/Makefile.mgw
index bcfbd4ee579..1fea10c2cdc 100644
--- a/3rdparty/asio/src/Makefile.mgw
+++ b/3rdparty/asio/src/Makefile.mgw
@@ -36,6 +36,9 @@ PERFORMANCE_TEST_EXES = \
tests/performance/server.exe
UNIT_TEST_EXES = \
+ tests/unit/any_completion_executor.exe \
+ tests/unit/any_completion_handler.exe \
+ tests/unit/any_io_executor.exe \
tests/unit/associated_allocator.exe \
tests/unit/associated_executor.exe \
tests/unit/async_result.exe \
@@ -72,27 +75,13 @@ UNIT_TEST_EXES = \
tests/unit/execution/any_executor.exe \
tests/unit/execution/blocking.exe \
tests/unit/execution/blocking_adaptation.exe \
- tests/unit/execution/bulk_execute.exe \
- tests/unit/execution/bulk_guarantee.exe \
- tests/unit/execution/connect.exe \
tests/unit/execution/context_as.exe \
- tests/unit/execution/execute.exe \
tests/unit/execution/executor.exe \
tests/unit/execution/invocable_archetype.exe \
tests/unit/execution/mapping.exe \
- tests/unit/execution/operation_state.exe \
tests/unit/execution/outstanding_work.exe \
tests/unit/execution/prefer_only.exe \
- tests/unit/execution/receiver.exe \
tests/unit/execution/relationship.exe \
- tests/unit/execution/schedule.exe \
- tests/unit/execution/scheduler.exe \
- tests/unit/execution/sender.exe \
- tests/unit/execution/set_done.exe \
- tests/unit/execution/set_error.exe \
- tests/unit/execution/set_value.exe \
- tests/unit/execution/start.exe \
- tests/unit/execution/submit.exe \
tests/unit/executor.exe \
tests/unit/executor_work_guard.exe \
tests/unit/generic/basic_endpoint.exe \
@@ -173,66 +162,67 @@ UNIT_TEST_EXES = \
tests/unit/write.exe \
tests/unit/write_at.exe
-CPP03_EXAMPLE_EXES = \
- examples/cpp03/allocation/server.exe \
- examples/cpp03/buffers/reference_counted.exe \
- examples/cpp03/chat/chat_client.exe \
- examples/cpp03/chat/chat_server.exe \
- examples/cpp03/echo/async_tcp_echo_server.exe \
- examples/cpp03/echo/async_udp_echo_server.exe \
- examples/cpp03/echo/blocking_tcp_echo_client.exe \
- examples/cpp03/echo/blocking_tcp_echo_server.exe \
- examples/cpp03/echo/blocking_udp_echo_client.exe \
- examples/cpp03/echo/blocking_udp_echo_server.exe \
- examples/cpp03/http/client/async_client.exe \
- examples/cpp03/http/client/sync_client.exe \
- examples/cpp03/http/server/http_server.exe \
- examples/cpp03/http/server2/http_server.exe \
- examples/cpp03/http/server3/http_server.exe \
- examples/cpp03/http/server4/http_server.exe \
- examples/cpp03/icmp/ping.exe \
- examples/cpp03/invocation/prioritised_handlers.exe \
- examples/cpp03/iostreams/daytime_client.exe \
- examples/cpp03/iostreams/daytime_server.exe \
- examples/cpp03/iostreams/http_client.exe \
- examples/cpp03/multicast/receiver.exe \
- examples/cpp03/multicast/sender.exe \
- examples/cpp03/nonblocking/third_party_lib.exe \
- examples/cpp03/porthopper/client.exe \
- examples/cpp03/porthopper/server.exe \
- examples/cpp03/services/daytime_client.exe \
- examples/cpp03/socks4/sync_client.exe \
- examples/cpp03/timeouts/async_tcp_client.exe \
- examples/cpp03/timeouts/blocking_tcp_client.exe \
- examples/cpp03/timeouts/blocking_token_tcp_client.exe \
- examples/cpp03/timeouts/blocking_udp_client.exe \
- examples/cpp03/timeouts/server.exe \
- examples/cpp03/timers/time_t_timer.exe \
- examples/cpp03/tutorial/timer1/timer.exe \
- examples/cpp03/tutorial/timer2/timer.exe \
- examples/cpp03/tutorial/timer3/timer.exe \
- examples/cpp03/tutorial/timer4/timer.exe \
- examples/cpp03/tutorial/timer5/timer.exe \
- examples/cpp03/tutorial/daytime1/client.exe \
- examples/cpp03/tutorial/daytime2/server.exe \
- examples/cpp03/tutorial/daytime3/server.exe \
- examples/cpp03/tutorial/daytime4/client.exe \
- examples/cpp03/tutorial/daytime5/server.exe \
- examples/cpp03/tutorial/daytime6/server.exe \
- examples/cpp03/tutorial/daytime7/server.exe \
- examples/cpp03/windows/transmit_file.exe
+CPP11_EXAMPLE_EXES = \
+ examples/cpp11/allocation/server.exe \
+ examples/cpp11/buffers/reference_counted.exe \
+ examples/cpp11/chat/chat_client.exe \
+ examples/cpp11/chat/chat_server.exe \
+ examples/cpp11/echo/async_tcp_echo_server.exe \
+ examples/cpp11/echo/async_udp_echo_server.exe \
+ examples/cpp11/echo/blocking_tcp_echo_client.exe \
+ examples/cpp11/echo/blocking_tcp_echo_server.exe \
+ examples/cpp11/echo/blocking_udp_echo_client.exe \
+ examples/cpp11/echo/blocking_udp_echo_server.exe \
+ examples/cpp11/http/client/async_client.exe \
+ examples/cpp11/http/client/sync_client.exe \
+ examples/cpp11/http/server/http_server.exe \
+ examples/cpp11/http/server2/http_server.exe \
+ examples/cpp11/http/server3/http_server.exe \
+ examples/cpp11/http/server4/http_server.exe \
+ examples/cpp11/icmp/ping.exe \
+ examples/cpp11/invocation/prioritised_handlers.exe \
+ examples/cpp11/iostreams/daytime_client.exe \
+ examples/cpp11/iostreams/daytime_server.exe \
+ examples/cpp11/iostreams/http_client.exe \
+ examples/cpp11/multicast/receiver.exe \
+ examples/cpp11/multicast/sender.exe \
+ examples/cpp11/nonblocking/third_party_lib.exe \
+ examples/cpp11/porthopper/client.exe \
+ examples/cpp11/porthopper/server.exe \
+ examples/cpp11/services/daytime_client.exe \
+ examples/cpp11/socks4/sync_client.exe \
+ examples/cpp11/timeouts/async_tcp_client.exe \
+ examples/cpp11/timeouts/blocking_tcp_client.exe \
+ examples/cpp11/timeouts/blocking_token_tcp_client.exe \
+ examples/cpp11/timeouts/blocking_udp_client.exe \
+ examples/cpp11/timeouts/server.exe \
+ examples/cpp11/timers/time_t_timer.exe \
+ examples/cpp11/tutorial/timer1/timer.exe \
+ examples/cpp11/tutorial/timer2/timer.exe \
+ examples/cpp11/tutorial/timer3/timer.exe \
+ examples/cpp11/tutorial/timer4/timer.exe \
+ examples/cpp11/tutorial/timer5/timer.exe \
+ examples/cpp11/tutorial/daytime1/client.exe \
+ examples/cpp11/tutorial/daytime2/server.exe \
+ examples/cpp11/tutorial/daytime3/server.exe \
+ examples/cpp11/tutorial/daytime4/client.exe \
+ examples/cpp11/tutorial/daytime5/server.exe \
+ examples/cpp11/tutorial/daytime6/server.exe \
+ examples/cpp11/tutorial/daytime7/server.exe \
+ examples/cpp11/windows/transmit_file.exe
ifdef STANDALONE
all: \
$(SEPARATE_COMPILATION_LIB) \
+ $(EXAMPLE_EXES) \
$(UNIT_TEST_EXES)
else
all: \
$(SEPARATE_COMPILATION_LIB) \
$(PERFORMANCE_TEST_EXES) \
- $(UNIT_TEST_EXES) \
$(EXAMPLE_EXES) \
- $(OTHER_EXAMPLE_EXES)
+ $(OTHER_EXAMPLE_EXES) \
+ $(UNIT_TEST_EXES)
endif
ifdef SEPARATE_COMPILATION
@@ -260,41 +250,41 @@ $(UNIT_TEST_EXES): %.exe: %.o
$(PERFORMANCE_TEST_EXES) $(EXAMPLE_EXES): %.exe: %.o
g++ -o$@ $(LDFLAGS) $< $(LIBS)
-examples/cpp03/http/server/http_server.exe: \
- examples/cpp03/http/server/connection.o \
- examples/cpp03/http/server/connection_manager.o \
- examples/cpp03/http/server/main.o \
- examples/cpp03/http/server/mime_types.o \
- examples/cpp03/http/server/reply.o \
- examples/cpp03/http/server/request_handler.o \
- examples/cpp03/http/server/request_parser.o \
- examples/cpp03/http/server/server.o
+examples/cpp11/http/server/http_server.exe: \
+ examples/cpp11/http/server/connection.o \
+ examples/cpp11/http/server/connection_manager.o \
+ examples/cpp11/http/server/main.o \
+ examples/cpp11/http/server/mime_types.o \
+ examples/cpp11/http/server/reply.o \
+ examples/cpp11/http/server/request_handler.o \
+ examples/cpp11/http/server/request_parser.o \
+ examples/cpp11/http/server/server.o
g++ -o$@ $(LDFLAGS) $^ $(LIBS)
-examples/cpp03/http/server2/http_server.exe: \
- examples/cpp03/http/server2/connection.o \
- examples/cpp03/http/server2/io_context_pool.o \
- examples/cpp03/http/server2/main.o \
- examples/cpp03/http/server2/mime_types.o \
- examples/cpp03/http/server2/reply.o \
- examples/cpp03/http/server2/request_handler.o \
- examples/cpp03/http/server2/request_parser.o \
- examples/cpp03/http/server2/server.o
+examples/cpp11/http/server2/http_server.exe: \
+ examples/cpp11/http/server2/connection.o \
+ examples/cpp11/http/server2/io_context_pool.o \
+ examples/cpp11/http/server2/main.o \
+ examples/cpp11/http/server2/mime_types.o \
+ examples/cpp11/http/server2/reply.o \
+ examples/cpp11/http/server2/request_handler.o \
+ examples/cpp11/http/server2/request_parser.o \
+ examples/cpp11/http/server2/server.o
g++ -o$@ $(LDFLAGS) $^ $(LIBS)
-examples/cpp03/http/server3/http_server.exe: \
- examples/cpp03/http/server3/connection.o \
- examples/cpp03/http/server3/main.o \
- examples/cpp03/http/server3/mime_types.o \
- examples/cpp03/http/server3/reply.o \
- examples/cpp03/http/server3/request_handler.o \
- examples/cpp03/http/server3/request_parser.o \
- examples/cpp03/http/server3/server.o
+examples/cpp11/http/server3/http_server.exe: \
+ examples/cpp11/http/server3/connection.o \
+ examples/cpp11/http/server3/main.o \
+ examples/cpp11/http/server3/mime_types.o \
+ examples/cpp11/http/server3/reply.o \
+ examples/cpp11/http/server3/request_handler.o \
+ examples/cpp11/http/server3/request_parser.o \
+ examples/cpp11/http/server3/server.o
g++ -o$@ $(LDFLAGS) $^ $(LIBS)
-examples/cpp03/services/daytime_client.exe: \
- examples/cpp03/services/daytime_client.o \
- examples/cpp03/services/logger_service.o
+examples/cpp11/services/daytime_client.exe: \
+ examples/cpp11/services/daytime_client.o \
+ examples/cpp11/services/logger_service.o
g++ -o$@ $(LDFLAGS) $^ $(LIBS)
.cpp.o:
diff --git a/3rdparty/asio/src/Makefile.msc b/3rdparty/asio/src/Makefile.msc
index f8de17ad40d..840dc7bebfe 100644
--- a/3rdparty/asio/src/Makefile.msc
+++ b/3rdparty/asio/src/Makefile.msc
@@ -115,6 +115,11 @@ PERFORMANCE_TEST_EXES = \
tests\performance\server.exe
UNIT_TEST_EXES = \
+ tests\unit\any_completion_executor.exe \
+ tests\unit\any_completion_handler.exe \
+ tests\unit\any_io_executor.exe \
+ tests\unit\append.exe \
+ tests\unit\as_tuple.exe \
tests\unit\associated_allocator.exe \
tests\unit\associated_cancellation_slot.exe \
tests\unit\associated_executor.exe \
@@ -123,21 +128,29 @@ UNIT_TEST_EXES = \
tests\unit\awaitable.exe \
tests\unit\basic_datagram_socket.exe \
tests\unit\basic_deadline_timer.exe \
+ tests\unit\basic_file.exe \
+ tests\unit\basic_random_access_file.exe \
tests\unit\basic_raw_socket.exe \
+ tests\unit\basic_readable_pipe.exe \
tests\unit\basic_seq_packet_socket.exe \
tests\unit\basic_serial_port.exe \
tests\unit\basic_signal_set.exe \
tests\unit\basic_socket.exe \
tests\unit\basic_socket_acceptor.exe \
+ tests\unit\basic_stream_file.exe \
tests\unit\basic_stream_socket.exe \
tests\unit\basic_streambuf.exe \
tests\unit\basic_waitable_timer.exe \
+ tests\unit\basic_writable_pipe.exe \
+ tests\unit\bind_allocator.exe \
tests\unit\bind_cancellation_slot.exe \
tests\unit\bind_executor.exe \
+ tests\unit\bind_immediate_executor.exe \
tests\unit\buffered_read_stream.exe \
tests\unit\buffered_stream.exe \
tests\unit\buffered_write_stream.exe \
tests\unit\buffer.exe \
+ tests\unit\buffer_registration.exe \
tests\unit\buffers_iterator.exe \
tests\unit\cancellation_signal.exe \
tests\unit\cancellation_state.exe \
@@ -146,9 +159,11 @@ UNIT_TEST_EXES = \
tests\unit\completion_condition.exe \
tests\unit\compose.exe \
tests\unit\connect.exe \
+ tests\unit\connect_pipe.exe \
tests\unit\coroutine.exe \
tests\unit\deadline_timer.exe \
tests\unit\defer.exe \
+ tests\unit\deferred.exe \
tests\unit\detached.exe \
tests\unit\dispatch.exe \
tests\unit\error.exe \
@@ -156,29 +171,16 @@ UNIT_TEST_EXES = \
tests\unit\execution\any_executor.exe \
tests\unit\execution\blocking.exe \
tests\unit\execution\blocking_adaptation.exe \
- tests\unit\execution\bulk_execute.exe \
- tests\unit\execution\bulk_guarantee.exe \
- tests\unit\execution\connect.exe \
tests\unit\execution\context_as.exe \
- tests\unit\execution\execute.exe \
tests\unit\execution\executor.exe \
tests\unit\execution\invocable_archetype.exe \
tests\unit\execution\mapping.exe \
- tests\unit\execution\operation_state.exe \
tests\unit\execution\outstanding_work.exe \
tests\unit\execution\prefer_only.exe \
- tests\unit\execution\receiver.exe \
tests\unit\execution\relationship.exe \
- tests\unit\execution\schedule.exe \
- tests\unit\execution\scheduler.exe \
- tests\unit\execution\sender.exe \
- tests\unit\execution\set_done.exe \
- tests\unit\execution\set_error.exe \
- tests\unit\execution\set_value.exe \
- tests\unit\execution\start.exe \
- tests\unit\execution\submit.exe \
tests\unit\executor.exe \
tests\unit\executor_work_guard.exe \
+ tests\unit\file_base.exe \
tests\unit\generic\basic_endpoint.exe \
tests\unit\generic\datagram_protocol.exe \
tests\unit\generic\raw_protocol.exe \
@@ -218,17 +220,24 @@ UNIT_TEST_EXES = \
tests\unit\packaged_task.exe \
tests\unit\placeholders.exe \
tests\unit\post.exe \
+ tests\unit\prepend.exe \
+ tests\unit\random_access_file.exe \
tests\unit\read.exe \
tests\unit\read_at.exe \
tests\unit\read_until.exe \
+ tests\unit\readable_pipe.exe \
+ tests\unit\recycling_allocator.exe \
tests\unit\redirect_error.exe \
+ tests\unit\registered_buffer.exe \
tests\unit\serial_port.exe \
tests\unit\serial_port_base.exe \
tests\unit\signal_set.exe \
+ tests\unit\signal_set_base.exe \
tests\unit\socket_base.exe \
tests\unit\static_thread_pool.exe \
tests\unit\steady_timer.exe \
tests\unit\strand.exe \
+ tests\unit\stream_file.exe \
tests\unit\streambuf.exe \
tests\unit\system_context.exe \
tests\unit\system_executor.exe \
@@ -258,57 +267,58 @@ UNIT_TEST_EXES = \
tests\unit\windows\overlapped_ptr.exe \
tests\unit\windows\random_access_handle.exe \
tests\unit\windows\stream_handle.exe \
+ tests\unit\writable_pipe.exe \
tests\unit\write.exe \
tests\unit\write_at.exe
-CPP03_EXAMPLE_EXES = \
- examples\cpp03\allocation\server.exe \
- examples\cpp03\buffers\reference_counted.exe \
- examples\cpp03\chat\chat_client.exe \
- examples\cpp03\chat\chat_server.exe \
- examples\cpp03\echo\async_tcp_echo_server.exe \
- examples\cpp03\echo\async_udp_echo_server.exe \
- examples\cpp03\echo\blocking_tcp_echo_client.exe \
- examples\cpp03\echo\blocking_tcp_echo_server.exe \
- examples\cpp03\echo\blocking_udp_echo_client.exe \
- examples\cpp03\echo\blocking_udp_echo_server.exe \
- examples\cpp03\http\client\async_client.exe \
- examples\cpp03\http\client\sync_client.exe \
- examples\cpp03\http\server\http_server.exe \
- examples\cpp03\http\server2\http_server.exe \
- examples\cpp03\http\server3\http_server.exe \
- examples\cpp03\http\server4\http_server.exe \
- examples\cpp03\icmp\ping.exe \
- examples\cpp03\invocation\prioritised_handlers.exe \
- examples\cpp03\iostreams\daytime_client.exe \
- examples\cpp03\iostreams\daytime_server.exe \
- examples\cpp03\iostreams\http_client.exe \
- examples\cpp03\multicast\receiver.exe \
- examples\cpp03\multicast\sender.exe \
- examples\cpp03\nonblocking\third_party_lib.exe \
- examples\cpp03\porthopper\client.exe \
- examples\cpp03\porthopper\server.exe \
- examples\cpp03\services\daytime_client.exe \
- examples\cpp03\socks4\sync_client.exe \
- examples\cpp03\timeouts\async_tcp_client.exe \
- examples\cpp03\timeouts\blocking_tcp_client.exe \
- examples\cpp03\timeouts\blocking_token_tcp_client.exe \
- examples\cpp03\timeouts\blocking_udp_client.exe \
- examples\cpp03\timeouts\server.exe \
- examples\cpp03\timers\time_t_timer.exe \
- examples\cpp03\tutorial\timer1\timer.exe \
- examples\cpp03\tutorial\timer2\timer.exe \
- examples\cpp03\tutorial\timer3\timer.exe \
- examples\cpp03\tutorial\timer4\timer.exe \
- examples\cpp03\tutorial\timer5\timer.exe \
- examples\cpp03\tutorial\daytime1\client.exe \
- examples\cpp03\tutorial\daytime2\server.exe \
- examples\cpp03\tutorial\daytime3\server.exe \
- examples\cpp03\tutorial\daytime4\client.exe \
- examples\cpp03\tutorial\daytime5\server.exe \
- examples\cpp03\tutorial\daytime6\server.exe \
- examples\cpp03\tutorial\daytime7\server.exe \
- examples\cpp03\windows\transmit_file.exe
+CPP11_EXAMPLE_EXES = \
+ examples\cpp11\allocation\server.exe \
+ examples\cpp11\buffers\reference_counted.exe \
+ examples\cpp11\chat\chat_client.exe \
+ examples\cpp11\chat\chat_server.exe \
+ examples\cpp11\echo\async_tcp_echo_server.exe \
+ examples\cpp11\echo\async_udp_echo_server.exe \
+ examples\cpp11\echo\blocking_tcp_echo_client.exe \
+ examples\cpp11\echo\blocking_tcp_echo_server.exe \
+ examples\cpp11\echo\blocking_udp_echo_client.exe \
+ examples\cpp11\echo\blocking_udp_echo_server.exe \
+ examples\cpp11\http\client\async_client.exe \
+ examples\cpp11\http\client\sync_client.exe \
+ examples\cpp11\http\server\http_server.exe \
+ examples\cpp11\http\server2\http_server.exe \
+ examples\cpp11\http\server3\http_server.exe \
+ examples\cpp11\http\server4\http_server.exe \
+ examples\cpp11\icmp\ping.exe \
+ examples\cpp11\invocation\prioritised_handlers.exe \
+ examples\cpp11\iostreams\daytime_client.exe \
+ examples\cpp11\iostreams\daytime_server.exe \
+ examples\cpp11\iostreams\http_client.exe \
+ examples\cpp11\multicast\receiver.exe \
+ examples\cpp11\multicast\sender.exe \
+ examples\cpp11\nonblocking\third_party_lib.exe \
+ examples\cpp11\porthopper\client.exe \
+ examples\cpp11\porthopper\server.exe \
+ examples\cpp11\services\daytime_client.exe \
+ examples\cpp11\socks4\sync_client.exe \
+ examples\cpp11\timeouts\async_tcp_client.exe \
+ examples\cpp11\timeouts\blocking_tcp_client.exe \
+ examples\cpp11\timeouts\blocking_token_tcp_client.exe \
+ examples\cpp11\timeouts\blocking_udp_client.exe \
+ examples\cpp11\timeouts\server.exe \
+ examples\cpp11\timers\time_t_timer.exe \
+ examples\cpp11\tutorial\timer1\timer.exe \
+ examples\cpp11\tutorial\timer2\timer.exe \
+ examples\cpp11\tutorial\timer3\timer.exe \
+ examples\cpp11\tutorial\timer4\timer.exe \
+ examples\cpp11\tutorial\timer5\timer.exe \
+ examples\cpp11\tutorial\daytime1\client.exe \
+ examples\cpp11\tutorial\daytime2\server.exe \
+ examples\cpp11\tutorial\daytime3\server.exe \
+ examples\cpp11\tutorial\daytime4\client.exe \
+ examples\cpp11\tutorial\daytime5\server.exe \
+ examples\cpp11\tutorial\daytime6\server.exe \
+ examples\cpp11\tutorial\daytime7\server.exe \
+ examples\cpp11\windows\transmit_file.exe
SSL_UNIT_TEST_EXES = \
tests\unit\ssl\basic_context.exe \
@@ -321,8 +331,8 @@ SSL_UNIT_TEST_EXES = \
tests\unit\ssl\stream_service.exe
SSL_EXAMPLE_EXES = \
- examples\cpp03\ssl\client.exe \
- examples\cpp03\ssl\server.exe
+ examples\cpp11\ssl\client.exe \
+ examples\cpp11\ssl\server.exe
!ifdef SEPARATE_COMPILATION
all: asio.lib
@@ -333,13 +343,14 @@ asio.lib: asio.cpp
!ifdef STANDALONE
all: \
+ $(CPP11_EXAMPLE_EXES) \
$(UNIT_TEST_EXES)
!else
all: \
$(LATENCY_TEST_EXES) \
$(PERFORMANCE_TEST_EXES) \
- $(UNIT_TEST_EXES) \
- $(CPP03_EXAMPLE_EXES)
+ $(CPP11_EXAMPLE_EXES) \
+ $(UNIT_TEST_EXES)
!endif
ssl: \
@@ -382,88 +393,88 @@ tests\unit\unit_test.obj: tests\unit\unit_test.cpp
{tests\unit\windows}.cpp{tests\unit\windows}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\allocation}.cpp{examples\cpp03\allocation}.exe:
+{examples\cpp11\allocation}.cpp{examples\cpp11\allocation}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\buffers}.cpp{examples\cpp03\buffers}.exe:
+{examples\cpp11\buffers}.cpp{examples\cpp11\buffers}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\chat}.cpp{examples\cpp03\chat}.exe:
+{examples\cpp11\chat}.cpp{examples\cpp11\chat}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\echo}.cpp{examples\cpp03\echo}.exe:
+{examples\cpp11\echo}.cpp{examples\cpp11\echo}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\http\client}.cpp{examples\cpp03\http\client}.exe:
+{examples\cpp11\http\client}.cpp{examples\cpp11\http\client}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\icmp}.cpp{examples\cpp03\icmp}.exe:
+{examples\cpp11\icmp}.cpp{examples\cpp11\icmp}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\invocation}.cpp{examples\cpp03\invocation}.exe:
+{examples\cpp11\invocation}.cpp{examples\cpp11\invocation}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\iostreams}.cpp{examples\cpp03\iostreams}.exe:
+{examples\cpp11\iostreams}.cpp{examples\cpp11\iostreams}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\multicast}.cpp{examples\cpp03\multicast}.exe:
+{examples\cpp11\multicast}.cpp{examples\cpp11\multicast}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\nonblocking}.cpp{examples\cpp03\nonblocking}.exe:
+{examples\cpp11\nonblocking}.cpp{examples\cpp11\nonblocking}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\porthopper}.cpp{examples\cpp03\porthopper}.exe:
+{examples\cpp11\porthopper}.cpp{examples\cpp11\porthopper}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\socks4}.cpp{examples\cpp03\socks4}.exe:
+{examples\cpp11\socks4}.cpp{examples\cpp11\socks4}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\ssl}.cpp{examples\cpp03\ssl}.exe:
+{examples\cpp11\ssl}.cpp{examples\cpp11\ssl}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(SSL_CXXFLAGS) $(DEFINES) $< $(SSL_LIBS) $(LIBS) -link -opt:ref
-{examples\cpp03\timeouts}.cpp{examples\cpp03\timeouts}.exe:
+{examples\cpp11\timeouts}.cpp{examples\cpp11\timeouts}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\timers}.cpp{examples\cpp03\timers}.exe:
+{examples\cpp11\timers}.cpp{examples\cpp11\timers}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\timer1}.cpp{examples\cpp03\tutorial\timer1}.exe:
+{examples\cpp11\tutorial\timer1}.cpp{examples\cpp11\tutorial\timer1}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\timer2}.cpp{examples\cpp03\tutorial\timer2}.exe:
+{examples\cpp11\tutorial\timer2}.cpp{examples\cpp11\tutorial\timer2}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\timer3}.cpp{examples\cpp03\tutorial\timer3}.exe:
+{examples\cpp11\tutorial\timer3}.cpp{examples\cpp11\tutorial\timer3}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\timer4}.cpp{examples\cpp03\tutorial\timer4}.exe:
+{examples\cpp11\tutorial\timer4}.cpp{examples\cpp11\tutorial\timer4}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\timer5}.cpp{examples\cpp03\tutorial\timer5}.exe:
+{examples\cpp11\tutorial\timer5}.cpp{examples\cpp11\tutorial\timer5}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\daytime1}.cpp{examples\cpp03\tutorial\daytime1}.exe:
+{examples\cpp11\tutorial\daytime1}.cpp{examples\cpp11\tutorial\daytime1}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\daytime2}.cpp{examples\cpp03\tutorial\daytime2}.exe:
+{examples\cpp11\tutorial\daytime2}.cpp{examples\cpp11\tutorial\daytime2}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\daytime3}.cpp{examples\cpp03\tutorial\daytime3}.exe:
+{examples\cpp11\tutorial\daytime3}.cpp{examples\cpp11\tutorial\daytime3}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\daytime4}.cpp{examples\cpp03\tutorial\daytime4}.exe:
+{examples\cpp11\tutorial\daytime4}.cpp{examples\cpp11\tutorial\daytime4}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\daytime5}.cpp{examples\cpp03\tutorial\daytime5}.exe:
+{examples\cpp11\tutorial\daytime5}.cpp{examples\cpp11\tutorial\daytime5}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\daytime6}.cpp{examples\cpp03\tutorial\daytime6}.exe:
+{examples\cpp11\tutorial\daytime6}.cpp{examples\cpp11\tutorial\daytime6}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\tutorial\daytime7}.cpp{examples\cpp03\tutorial\daytime7}.exe:
+{examples\cpp11\tutorial\daytime7}.cpp{examples\cpp11\tutorial\daytime7}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-{examples\cpp03\windows}.cpp{examples\cpp03\windows}.exe:
+{examples\cpp11\windows}.cpp{examples\cpp11\windows}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
{examples\cpp11\executors}.cpp{examples\cpp11\executors}.exe:
@@ -475,51 +486,51 @@ tests\unit\unit_test.obj: tests\unit\unit_test.cpp
{examples\cpp14\operations}.cpp{examples\cpp14\operations}.exe:
cl -Fe$@ -Fo$(<:.cpp=.obj) $(CXXFLAGS) $(DEFINES) $< $(LIBS) -link -opt:ref
-examples\cpp03\http\server\http_server.exe: \
- examples\cpp03\http\server\connection.cpp \
- examples\cpp03\http\server\connection_manager.cpp \
- examples\cpp03\http\server\main.cpp \
- examples\cpp03\http\server\mime_types.cpp \
- examples\cpp03\http\server\reply.cpp \
- examples\cpp03\http\server\request_handler.cpp \
- examples\cpp03\http\server\request_parser.cpp \
- examples\cpp03\http\server\server.cpp
- cl -Fe$@ -Foexamples\cpp03\http\server\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
-
-examples\cpp03\http\server2\http_server.exe: \
- examples\cpp03\http\server2\connection.cpp \
- examples\cpp03\http\server2\io_context_pool.cpp \
- examples\cpp03\http\server2\main.cpp \
- examples\cpp03\http\server2\mime_types.cpp \
- examples\cpp03\http\server2\reply.cpp \
- examples\cpp03\http\server2\request_handler.cpp \
- examples\cpp03\http\server2\request_parser.cpp \
- examples\cpp03\http\server2\server.cpp
- cl -Fe$@ -Foexamples\cpp03\http\server2\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
-
-examples\cpp03\http\server3\http_server.exe: \
- examples\cpp03\http\server3\connection.cpp \
- examples\cpp03\http\server3\main.cpp \
- examples\cpp03\http\server3\mime_types.cpp \
- examples\cpp03\http\server3\reply.cpp \
- examples\cpp03\http\server3\request_handler.cpp \
- examples\cpp03\http\server3\request_parser.cpp \
- examples\cpp03\http\server3\server.cpp
- cl -Fe$@ -Foexamples\cpp03\http\server3\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
-
-examples\cpp03\http\server4\http_server.exe: \
- examples\cpp03\http\server4\file_handler.cpp \
- examples\cpp03\http\server4\main.cpp \
- examples\cpp03\http\server4\mime_types.cpp \
- examples\cpp03\http\server4\reply.cpp \
- examples\cpp03\http\server4\request_parser.cpp \
- examples\cpp03\http\server4\server.cpp
- cl -Fe$@ -Foexamples\cpp03\http\server4\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
-
-examples\cpp03\services\daytime_client.exe: \
- examples\cpp03\services\daytime_client.cpp \
- examples\cpp03\services\logger_service.cpp
- cl -Fe$@ -Foexamples\cpp03\services\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
+examples\cpp11\http\server\http_server.exe: \
+ examples\cpp11\http\server\connection.cpp \
+ examples\cpp11\http\server\connection_manager.cpp \
+ examples\cpp11\http\server\main.cpp \
+ examples\cpp11\http\server\mime_types.cpp \
+ examples\cpp11\http\server\reply.cpp \
+ examples\cpp11\http\server\request_handler.cpp \
+ examples\cpp11\http\server\request_parser.cpp \
+ examples\cpp11\http\server\server.cpp
+ cl -Fe$@ -Foexamples\cpp11\http\server\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
+
+examples\cpp11\http\server2\http_server.exe: \
+ examples\cpp11\http\server2\connection.cpp \
+ examples\cpp11\http\server2\io_context_pool.cpp \
+ examples\cpp11\http\server2\main.cpp \
+ examples\cpp11\http\server2\mime_types.cpp \
+ examples\cpp11\http\server2\reply.cpp \
+ examples\cpp11\http\server2\request_handler.cpp \
+ examples\cpp11\http\server2\request_parser.cpp \
+ examples\cpp11\http\server2\server.cpp
+ cl -Fe$@ -Foexamples\cpp11\http\server2\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
+
+examples\cpp11\http\server3\http_server.exe: \
+ examples\cpp11\http\server3\connection.cpp \
+ examples\cpp11\http\server3\main.cpp \
+ examples\cpp11\http\server3\mime_types.cpp \
+ examples\cpp11\http\server3\reply.cpp \
+ examples\cpp11\http\server3\request_handler.cpp \
+ examples\cpp11\http\server3\request_parser.cpp \
+ examples\cpp11\http\server3\server.cpp
+ cl -Fe$@ -Foexamples\cpp11\http\server3\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
+
+examples\cpp11\http\server4\http_server.exe: \
+ examples\cpp11\http\server4\file_handler.cpp \
+ examples\cpp11\http\server4\main.cpp \
+ examples\cpp11\http\server4\mime_types.cpp \
+ examples\cpp11\http\server4\reply.cpp \
+ examples\cpp11\http\server4\request_parser.cpp \
+ examples\cpp11\http\server4\server.cpp
+ cl -Fe$@ -Foexamples\cpp11\http\server4\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
+
+examples\cpp11\services\daytime_client.exe: \
+ examples\cpp11\services\daytime_client.cpp \
+ examples\cpp11\services\logger_service.cpp
+ cl -Fe$@ -Foexamples\cpp11\services\ $(CXXFLAGS) $(DEFINES) $** $(LIBS) -link -opt:ref
clean:
-del /q /s asio.lib
diff --git a/3rdparty/asio/src/asio.cpp b/3rdparty/asio/src/asio.cpp
index b67266c1bff..bd919afb87c 100644
--- a/3rdparty/asio/src/asio.cpp
+++ b/3rdparty/asio/src/asio.cpp
@@ -2,7 +2,7 @@
// asio.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/asio_ssl.cpp b/3rdparty/asio/src/asio_ssl.cpp
index def7ceb2250..6a5a626a69a 100644
--- a/3rdparty/asio/src/asio_ssl.cpp
+++ b/3rdparty/asio/src/asio_ssl.cpp
@@ -2,7 +2,7 @@
// asio_ssl.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/Makefile.am b/3rdparty/asio/src/examples/cpp03/Makefile.am
deleted file mode 100644
index 0e6e0d378f2..00000000000
--- a/3rdparty/asio/src/examples/cpp03/Makefile.am
+++ /dev/null
@@ -1,251 +0,0 @@
-AUTOMAKE_OPTIONS = subdir-objects
-
-if SEPARATE_COMPILATION
-noinst_LIBRARIES = libasio.a
-libasio_a_SOURCES = ../../asio.cpp
-if HAVE_OPENSSL
-libasio_a_SOURCES += ../../asio_ssl.cpp
-endif
-LDADD = libasio.a
-endif
-
-noinst_PROGRAMS = \
- allocation/server \
- buffers/reference_counted \
- chat/chat_client \
- chat/chat_server \
- echo/async_tcp_echo_server \
- echo/async_udp_echo_server \
- echo/blocking_tcp_echo_client \
- echo/blocking_tcp_echo_server \
- echo/blocking_udp_echo_client \
- echo/blocking_udp_echo_server \
- http/client/async_client \
- http/client/sync_client \
- http/server/http_server \
- http/server2/http_server \
- http/server3/http_server \
- http/server4/http_server \
- icmp/ping \
- invocation/prioritised_handlers \
- iostreams/daytime_client \
- iostreams/daytime_server \
- iostreams/http_client \
- multicast/receiver \
- multicast/sender \
- nonblocking/third_party_lib \
- porthopper/client \
- porthopper/server \
- services/daytime_client \
- socks4/sync_client \
- timeouts/async_tcp_client \
- timeouts/blocking_tcp_client \
- timeouts/blocking_token_tcp_client \
- timeouts/blocking_udp_client \
- timeouts/server \
- timers/time_t_timer \
- tutorial/timer1/timer \
- tutorial/timer2/timer \
- tutorial/timer3/timer \
- tutorial/timer4/timer \
- tutorial/timer5/timer \
- tutorial/daytime1/client \
- tutorial/daytime2/server \
- tutorial/daytime3/server \
- tutorial/daytime4/client \
- tutorial/daytime5/server \
- tutorial/daytime6/server \
- tutorial/daytime7/server
-
-if !WINDOWS_TARGET
-noinst_PROGRAMS += \
- chat/posix_chat_client \
- fork/daemon \
- fork/process_per_connection \
- local/connect_pair \
- local/iostream_client \
- local/stream_server \
- local/stream_client
-endif
-
-if WINDOWS_TARGET
-noinst_PROGRAMS += \
- windows/transmit_file
-endif
-
-if HAVE_OPENSSL
-noinst_PROGRAMS += \
- ssl/client \
- ssl/server
-endif
-
-if HAVE_BOOST_COROUTINE
-noinst_PROGRAMS += \
- spawn/echo_server \
- spawn/parallel_grep
-endif
-
-noinst_HEADERS = \
- chat/chat_message.hpp \
- services/basic_logger.hpp \
- services/logger.hpp \
- services/logger_service.hpp
-
-AM_CXXFLAGS = -I$(srcdir)/../../../include
-
-allocation_server_SOURCES = allocation/server.cpp
-buffers_reference_counted_SOURCES = buffers/reference_counted.cpp
-chat_chat_client_SOURCES = chat/chat_client.cpp
-chat_chat_server_SOURCES = chat/chat_server.cpp
-echo_async_tcp_echo_server_SOURCES = echo/async_tcp_echo_server.cpp
-echo_async_udp_echo_server_SOURCES = echo/async_udp_echo_server.cpp
-echo_blocking_tcp_echo_client_SOURCES = echo/blocking_tcp_echo_client.cpp
-echo_blocking_tcp_echo_server_SOURCES = echo/blocking_tcp_echo_server.cpp
-echo_blocking_udp_echo_client_SOURCES = echo/blocking_udp_echo_client.cpp
-echo_blocking_udp_echo_server_SOURCES = echo/blocking_udp_echo_server.cpp
-http_client_async_client_SOURCES = http/client/async_client.cpp
-http_client_sync_client_SOURCES = http/client/sync_client.cpp
-http_server_http_server_SOURCES = \
- http/server/connection.cpp \
- http/server/connection_manager.cpp \
- http/server/main.cpp \
- http/server/mime_types.cpp \
- http/server/reply.cpp \
- http/server/request_handler.cpp \
- http/server/request_parser.cpp \
- http/server/server.cpp
-http_server2_http_server_SOURCES = \
- http/server2/connection.cpp \
- http/server2/io_context_pool.cpp \
- http/server2/main.cpp \
- http/server2/mime_types.cpp \
- http/server2/reply.cpp \
- http/server2/request_handler.cpp \
- http/server2/request_parser.cpp \
- http/server2/server.cpp
-http_server3_http_server_SOURCES = \
- http/server3/connection.cpp \
- http/server3/main.cpp \
- http/server3/mime_types.cpp \
- http/server3/reply.cpp \
- http/server3/request_handler.cpp \
- http/server3/request_parser.cpp \
- http/server3/server.cpp
-http_server4_http_server_SOURCES = \
- http/server4/file_handler.cpp \
- http/server4/main.cpp \
- http/server4/mime_types.cpp \
- http/server4/reply.cpp \
- http/server4/request_parser.cpp \
- http/server4/server.cpp
-icmp_ping_SOURCES = icmp/ping.cpp
-invocation_prioritised_handlers_SOURCES = invocation/prioritised_handlers.cpp
-iostreams_daytime_client_SOURCES = iostreams/daytime_client.cpp
-iostreams_daytime_server_SOURCES = iostreams/daytime_server.cpp
-iostreams_http_client_SOURCES = iostreams/http_client.cpp
-multicast_receiver_SOURCES = multicast/receiver.cpp
-multicast_sender_SOURCES = multicast/sender.cpp
-nonblocking_third_party_lib_SOURCES = nonblocking/third_party_lib.cpp
-porthopper_client_SOURCES = porthopper/client.cpp
-porthopper_server_SOURCES = porthopper/server.cpp
-services_daytime_client_SOURCES = \
- services/daytime_client.cpp \
- services/logger_service.cpp
-socks4_sync_client_SOURCES = socks4/sync_client.cpp
-timeouts_async_tcp_client_SOURCES = timeouts/async_tcp_client.cpp
-timeouts_blocking_tcp_client_SOURCES = timeouts/blocking_tcp_client.cpp
-timeouts_blocking_token_tcp_client_SOURCES = timeouts/blocking_token_tcp_client.cpp
-timeouts_blocking_udp_client_SOURCES = timeouts/blocking_udp_client.cpp
-timeouts_server_SOURCES = timeouts/server.cpp
-timers_time_t_timer_SOURCES = timers/time_t_timer.cpp
-tutorial_timer1_timer_SOURCES = tutorial/timer1/timer.cpp
-tutorial_timer2_timer_SOURCES = tutorial/timer2/timer.cpp
-tutorial_timer3_timer_SOURCES = tutorial/timer3/timer.cpp
-tutorial_timer4_timer_SOURCES = tutorial/timer4/timer.cpp
-tutorial_timer5_timer_SOURCES = tutorial/timer5/timer.cpp
-tutorial_daytime1_client_SOURCES = tutorial/daytime1/client.cpp
-tutorial_daytime2_server_SOURCES = tutorial/daytime2/server.cpp
-tutorial_daytime3_server_SOURCES = tutorial/daytime3/server.cpp
-tutorial_daytime4_client_SOURCES = tutorial/daytime4/client.cpp
-tutorial_daytime5_server_SOURCES = tutorial/daytime5/server.cpp
-tutorial_daytime6_server_SOURCES = tutorial/daytime6/server.cpp
-tutorial_daytime7_server_SOURCES = tutorial/daytime7/server.cpp
-
-if !WINDOWS_TARGET
-chat_posix_chat_client_SOURCES = chat/posix_chat_client.cpp
-fork_daemon_SOURCES = fork/daemon.cpp
-fork_process_per_connection_SOURCES = fork/process_per_connection.cpp
-local_connect_pair_SOURCES = local/connect_pair.cpp
-local_iostream_client_SOURCES = local/iostream_client.cpp
-local_stream_server_SOURCES = local/stream_server.cpp
-local_stream_client_SOURCES = local/stream_client.cpp
-endif
-
-if WINDOWS_TARGET
-windows_transmit_file_SOURCES = windows/transmit_file.cpp
-endif
-
-if HAVE_OPENSSL
-ssl_client_SOURCES = ssl/client.cpp
-ssl_server_SOURCES = ssl/server.cpp
-endif
-
-if HAVE_BOOST_COROUTINE
-spawn_echo_server_SOURCES = spawn/echo_server.cpp
-spawn_echo_server_LDADD = $(LDADD) -lboost_coroutine -lboost_context -lboost_thread -lboost_chrono -lboost_system
-spawn_parallel_grep_SOURCES = spawn/parallel_grep.cpp
-spawn_parallel_grep_LDADD = $(LDADD) -lboost_coroutine -lboost_context -lboost_thread -lboost_chrono -lboost_system
-endif
-
-EXTRA_DIST = \
- http/server/connection.hpp \
- http/server/connection_manager.hpp \
- http/server/header.hpp \
- http/server/mime_types.hpp \
- http/server/reply.hpp \
- http/server/request.hpp \
- http/server/request_handler.hpp \
- http/server/request_parser.hpp \
- http/server/server.hpp \
- http/server2/connection.hpp \
- http/server2/io_context_pool.hpp \
- http/server2/header.hpp \
- http/server2/mime_types.hpp \
- http/server2/reply.hpp \
- http/server2/request.hpp \
- http/server2/request_handler.hpp \
- http/server2/request_parser.hpp \
- http/server2/server.hpp \
- http/server3/connection.hpp \
- http/server3/header.hpp \
- http/server3/mime_types.hpp \
- http/server3/reply.hpp \
- http/server3/request.hpp \
- http/server3/request_handler.hpp \
- http/server3/request_parser.hpp \
- http/server3/server.hpp \
- http/server4/file_handler.hpp \
- http/server4/header.hpp \
- http/server4/mime_types.hpp \
- http/server4/reply.hpp \
- http/server4/request.hpp \
- http/server4/request_parser.hpp \
- http/server4/server.hpp \
- icmp/icmp_header.hpp \
- icmp/ipv4_header.hpp \
- porthopper/protocol.hpp \
- serialization/client.cpp \
- serialization/server.cpp \
- serialization/connection.hpp \
- serialization/stock.hpp \
- services/basic_logger.hpp \
- services/logger.hpp \
- services/logger_service.hpp \
- socks4/socks4.hpp \
- ssl/README \
- ssl/ca.pem \
- ssl/server.pem \
- ssl/dh2048.pem
-
-MAINTAINERCLEANFILES = \
- $(srcdir)/Makefile.in
diff --git a/3rdparty/asio/src/examples/cpp03/Makefile.in b/3rdparty/asio/src/examples/cpp03/Makefile.in
deleted file mode 100644
index 2fc8903af3a..00000000000
--- a/3rdparty/asio/src/examples/cpp03/Makefile.in
+++ /dev/null
@@ -1,2339 +0,0 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-
-VPATH = @srcdir@
-am__is_gnu_make = { \
- if test -z '$(MAKELEVEL)'; then \
- false; \
- elif test -n '$(MAKE_HOST)'; then \
- true; \
- elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
- true; \
- else \
- false; \
- fi; \
-}
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-@HAVE_OPENSSL_TRUE@@SEPARATE_COMPILATION_TRUE@am__append_1 = ../../asio_ssl.cpp
-noinst_PROGRAMS = allocation/server$(EXEEXT) \
- buffers/reference_counted$(EXEEXT) chat/chat_client$(EXEEXT) \
- chat/chat_server$(EXEEXT) echo/async_tcp_echo_server$(EXEEXT) \
- echo/async_udp_echo_server$(EXEEXT) \
- echo/blocking_tcp_echo_client$(EXEEXT) \
- echo/blocking_tcp_echo_server$(EXEEXT) \
- echo/blocking_udp_echo_client$(EXEEXT) \
- echo/blocking_udp_echo_server$(EXEEXT) \
- http/client/async_client$(EXEEXT) \
- http/client/sync_client$(EXEEXT) \
- http/server/http_server$(EXEEXT) \
- http/server2/http_server$(EXEEXT) \
- http/server3/http_server$(EXEEXT) \
- http/server4/http_server$(EXEEXT) icmp/ping$(EXEEXT) \
- invocation/prioritised_handlers$(EXEEXT) \
- iostreams/daytime_client$(EXEEXT) \
- iostreams/daytime_server$(EXEEXT) \
- iostreams/http_client$(EXEEXT) multicast/receiver$(EXEEXT) \
- multicast/sender$(EXEEXT) nonblocking/third_party_lib$(EXEEXT) \
- porthopper/client$(EXEEXT) porthopper/server$(EXEEXT) \
- services/daytime_client$(EXEEXT) socks4/sync_client$(EXEEXT) \
- timeouts/async_tcp_client$(EXEEXT) \
- timeouts/blocking_tcp_client$(EXEEXT) \
- timeouts/blocking_token_tcp_client$(EXEEXT) \
- timeouts/blocking_udp_client$(EXEEXT) timeouts/server$(EXEEXT) \
- timers/time_t_timer$(EXEEXT) tutorial/timer1/timer$(EXEEXT) \
- tutorial/timer2/timer$(EXEEXT) tutorial/timer3/timer$(EXEEXT) \
- tutorial/timer4/timer$(EXEEXT) tutorial/timer5/timer$(EXEEXT) \
- tutorial/daytime1/client$(EXEEXT) \
- tutorial/daytime2/server$(EXEEXT) \
- tutorial/daytime3/server$(EXEEXT) \
- tutorial/daytime4/client$(EXEEXT) \
- tutorial/daytime5/server$(EXEEXT) \
- tutorial/daytime6/server$(EXEEXT) \
- tutorial/daytime7/server$(EXEEXT) $(am__EXEEXT_1) \
- $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
-@WINDOWS_TARGET_FALSE@am__append_2 = \
-@WINDOWS_TARGET_FALSE@ chat/posix_chat_client \
-@WINDOWS_TARGET_FALSE@ fork/daemon \
-@WINDOWS_TARGET_FALSE@ fork/process_per_connection \
-@WINDOWS_TARGET_FALSE@ local/connect_pair \
-@WINDOWS_TARGET_FALSE@ local/iostream_client \
-@WINDOWS_TARGET_FALSE@ local/stream_server \
-@WINDOWS_TARGET_FALSE@ local/stream_client
-
-@WINDOWS_TARGET_TRUE@am__append_3 = \
-@WINDOWS_TARGET_TRUE@ windows/transmit_file
-
-@HAVE_OPENSSL_TRUE@am__append_4 = \
-@HAVE_OPENSSL_TRUE@ ssl/client \
-@HAVE_OPENSSL_TRUE@ ssl/server
-
-@HAVE_BOOST_COROUTINE_TRUE@am__append_5 = \
-@HAVE_BOOST_COROUTINE_TRUE@ spawn/echo_server \
-@HAVE_BOOST_COROUTINE_TRUE@ spawn/parallel_grep
-
-subdir = src/examples/cpp03
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
- $(am__DIST_COMMON)
-mkinstalldirs = $(install_sh) -d
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-@WINDOWS_TARGET_FALSE@am__EXEEXT_1 = chat/posix_chat_client$(EXEEXT) \
-@WINDOWS_TARGET_FALSE@ fork/daemon$(EXEEXT) \
-@WINDOWS_TARGET_FALSE@ fork/process_per_connection$(EXEEXT) \
-@WINDOWS_TARGET_FALSE@ local/connect_pair$(EXEEXT) \
-@WINDOWS_TARGET_FALSE@ local/iostream_client$(EXEEXT) \
-@WINDOWS_TARGET_FALSE@ local/stream_server$(EXEEXT) \
-@WINDOWS_TARGET_FALSE@ local/stream_client$(EXEEXT)
-@WINDOWS_TARGET_TRUE@am__EXEEXT_2 = windows/transmit_file$(EXEEXT)
-@HAVE_OPENSSL_TRUE@am__EXEEXT_3 = ssl/client$(EXEEXT) \
-@HAVE_OPENSSL_TRUE@ ssl/server$(EXEEXT)
-@HAVE_BOOST_COROUTINE_TRUE@am__EXEEXT_4 = spawn/echo_server$(EXEEXT) \
-@HAVE_BOOST_COROUTINE_TRUE@ spawn/parallel_grep$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
-LIBRARIES = $(noinst_LIBRARIES)
-AR = ar
-ARFLAGS = cru
-AM_V_AR = $(am__v_AR_@AM_V@)
-am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
-am__v_AR_0 = @echo " AR " $@;
-am__v_AR_1 =
-libasio_a_AR = $(AR) $(ARFLAGS)
-libasio_a_LIBADD =
-am__libasio_a_SOURCES_DIST = ../../asio.cpp ../../asio_ssl.cpp
-am__dirstamp = $(am__leading_dot)dirstamp
-@HAVE_OPENSSL_TRUE@@SEPARATE_COMPILATION_TRUE@am__objects_1 = ../../asio_ssl.$(OBJEXT)
-@SEPARATE_COMPILATION_TRUE@am_libasio_a_OBJECTS = \
-@SEPARATE_COMPILATION_TRUE@ ../../asio.$(OBJEXT) \
-@SEPARATE_COMPILATION_TRUE@ $(am__objects_1)
-libasio_a_OBJECTS = $(am_libasio_a_OBJECTS)
-am_allocation_server_OBJECTS = allocation/server.$(OBJEXT)
-allocation_server_OBJECTS = $(am_allocation_server_OBJECTS)
-allocation_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@allocation_server_DEPENDENCIES = libasio.a
-am_buffers_reference_counted_OBJECTS = \
- buffers/reference_counted.$(OBJEXT)
-buffers_reference_counted_OBJECTS = \
- $(am_buffers_reference_counted_OBJECTS)
-buffers_reference_counted_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@buffers_reference_counted_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_chat_chat_client_OBJECTS = chat/chat_client.$(OBJEXT)
-chat_chat_client_OBJECTS = $(am_chat_chat_client_OBJECTS)
-chat_chat_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@chat_chat_client_DEPENDENCIES = libasio.a
-am_chat_chat_server_OBJECTS = chat/chat_server.$(OBJEXT)
-chat_chat_server_OBJECTS = $(am_chat_chat_server_OBJECTS)
-chat_chat_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@chat_chat_server_DEPENDENCIES = libasio.a
-am__chat_posix_chat_client_SOURCES_DIST = chat/posix_chat_client.cpp
-@WINDOWS_TARGET_FALSE@am_chat_posix_chat_client_OBJECTS = \
-@WINDOWS_TARGET_FALSE@ chat/posix_chat_client.$(OBJEXT)
-chat_posix_chat_client_OBJECTS = $(am_chat_posix_chat_client_OBJECTS)
-chat_posix_chat_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@chat_posix_chat_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_echo_async_tcp_echo_server_OBJECTS = \
- echo/async_tcp_echo_server.$(OBJEXT)
-echo_async_tcp_echo_server_OBJECTS = \
- $(am_echo_async_tcp_echo_server_OBJECTS)
-echo_async_tcp_echo_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@echo_async_tcp_echo_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_echo_async_udp_echo_server_OBJECTS = \
- echo/async_udp_echo_server.$(OBJEXT)
-echo_async_udp_echo_server_OBJECTS = \
- $(am_echo_async_udp_echo_server_OBJECTS)
-echo_async_udp_echo_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@echo_async_udp_echo_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_echo_blocking_tcp_echo_client_OBJECTS = \
- echo/blocking_tcp_echo_client.$(OBJEXT)
-echo_blocking_tcp_echo_client_OBJECTS = \
- $(am_echo_blocking_tcp_echo_client_OBJECTS)
-echo_blocking_tcp_echo_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@echo_blocking_tcp_echo_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_echo_blocking_tcp_echo_server_OBJECTS = \
- echo/blocking_tcp_echo_server.$(OBJEXT)
-echo_blocking_tcp_echo_server_OBJECTS = \
- $(am_echo_blocking_tcp_echo_server_OBJECTS)
-echo_blocking_tcp_echo_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@echo_blocking_tcp_echo_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_echo_blocking_udp_echo_client_OBJECTS = \
- echo/blocking_udp_echo_client.$(OBJEXT)
-echo_blocking_udp_echo_client_OBJECTS = \
- $(am_echo_blocking_udp_echo_client_OBJECTS)
-echo_blocking_udp_echo_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@echo_blocking_udp_echo_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_echo_blocking_udp_echo_server_OBJECTS = \
- echo/blocking_udp_echo_server.$(OBJEXT)
-echo_blocking_udp_echo_server_OBJECTS = \
- $(am_echo_blocking_udp_echo_server_OBJECTS)
-echo_blocking_udp_echo_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@echo_blocking_udp_echo_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am__fork_daemon_SOURCES_DIST = fork/daemon.cpp
-@WINDOWS_TARGET_FALSE@am_fork_daemon_OBJECTS = fork/daemon.$(OBJEXT)
-fork_daemon_OBJECTS = $(am_fork_daemon_OBJECTS)
-fork_daemon_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@fork_daemon_DEPENDENCIES = libasio.a
-am__fork_process_per_connection_SOURCES_DIST = \
- fork/process_per_connection.cpp
-@WINDOWS_TARGET_FALSE@am_fork_process_per_connection_OBJECTS = \
-@WINDOWS_TARGET_FALSE@ fork/process_per_connection.$(OBJEXT)
-fork_process_per_connection_OBJECTS = \
- $(am_fork_process_per_connection_OBJECTS)
-fork_process_per_connection_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@fork_process_per_connection_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_http_client_async_client_OBJECTS = \
- http/client/async_client.$(OBJEXT)
-http_client_async_client_OBJECTS = \
- $(am_http_client_async_client_OBJECTS)
-http_client_async_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@http_client_async_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_http_client_sync_client_OBJECTS = \
- http/client/sync_client.$(OBJEXT)
-http_client_sync_client_OBJECTS = \
- $(am_http_client_sync_client_OBJECTS)
-http_client_sync_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@http_client_sync_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_http_server_http_server_OBJECTS = http/server/connection.$(OBJEXT) \
- http/server/connection_manager.$(OBJEXT) \
- http/server/main.$(OBJEXT) http/server/mime_types.$(OBJEXT) \
- http/server/reply.$(OBJEXT) \
- http/server/request_handler.$(OBJEXT) \
- http/server/request_parser.$(OBJEXT) \
- http/server/server.$(OBJEXT)
-http_server_http_server_OBJECTS = \
- $(am_http_server_http_server_OBJECTS)
-http_server_http_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@http_server_http_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_http_server2_http_server_OBJECTS = \
- http/server2/connection.$(OBJEXT) \
- http/server2/io_context_pool.$(OBJEXT) \
- http/server2/main.$(OBJEXT) http/server2/mime_types.$(OBJEXT) \
- http/server2/reply.$(OBJEXT) \
- http/server2/request_handler.$(OBJEXT) \
- http/server2/request_parser.$(OBJEXT) \
- http/server2/server.$(OBJEXT)
-http_server2_http_server_OBJECTS = \
- $(am_http_server2_http_server_OBJECTS)
-http_server2_http_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@http_server2_http_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_http_server3_http_server_OBJECTS = \
- http/server3/connection.$(OBJEXT) http/server3/main.$(OBJEXT) \
- http/server3/mime_types.$(OBJEXT) http/server3/reply.$(OBJEXT) \
- http/server3/request_handler.$(OBJEXT) \
- http/server3/request_parser.$(OBJEXT) \
- http/server3/server.$(OBJEXT)
-http_server3_http_server_OBJECTS = \
- $(am_http_server3_http_server_OBJECTS)
-http_server3_http_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@http_server3_http_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_http_server4_http_server_OBJECTS = \
- http/server4/file_handler.$(OBJEXT) \
- http/server4/main.$(OBJEXT) http/server4/mime_types.$(OBJEXT) \
- http/server4/reply.$(OBJEXT) \
- http/server4/request_parser.$(OBJEXT) \
- http/server4/server.$(OBJEXT)
-http_server4_http_server_OBJECTS = \
- $(am_http_server4_http_server_OBJECTS)
-http_server4_http_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@http_server4_http_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_icmp_ping_OBJECTS = icmp/ping.$(OBJEXT)
-icmp_ping_OBJECTS = $(am_icmp_ping_OBJECTS)
-icmp_ping_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@icmp_ping_DEPENDENCIES = libasio.a
-am_invocation_prioritised_handlers_OBJECTS = \
- invocation/prioritised_handlers.$(OBJEXT)
-invocation_prioritised_handlers_OBJECTS = \
- $(am_invocation_prioritised_handlers_OBJECTS)
-invocation_prioritised_handlers_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@invocation_prioritised_handlers_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_iostreams_daytime_client_OBJECTS = \
- iostreams/daytime_client.$(OBJEXT)
-iostreams_daytime_client_OBJECTS = \
- $(am_iostreams_daytime_client_OBJECTS)
-iostreams_daytime_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@iostreams_daytime_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_iostreams_daytime_server_OBJECTS = \
- iostreams/daytime_server.$(OBJEXT)
-iostreams_daytime_server_OBJECTS = \
- $(am_iostreams_daytime_server_OBJECTS)
-iostreams_daytime_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@iostreams_daytime_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_iostreams_http_client_OBJECTS = iostreams/http_client.$(OBJEXT)
-iostreams_http_client_OBJECTS = $(am_iostreams_http_client_OBJECTS)
-iostreams_http_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@iostreams_http_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am__local_connect_pair_SOURCES_DIST = local/connect_pair.cpp
-@WINDOWS_TARGET_FALSE@am_local_connect_pair_OBJECTS = \
-@WINDOWS_TARGET_FALSE@ local/connect_pair.$(OBJEXT)
-local_connect_pair_OBJECTS = $(am_local_connect_pair_OBJECTS)
-local_connect_pair_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@local_connect_pair_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am__local_iostream_client_SOURCES_DIST = local/iostream_client.cpp
-@WINDOWS_TARGET_FALSE@am_local_iostream_client_OBJECTS = \
-@WINDOWS_TARGET_FALSE@ local/iostream_client.$(OBJEXT)
-local_iostream_client_OBJECTS = $(am_local_iostream_client_OBJECTS)
-local_iostream_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@local_iostream_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am__local_stream_client_SOURCES_DIST = local/stream_client.cpp
-@WINDOWS_TARGET_FALSE@am_local_stream_client_OBJECTS = \
-@WINDOWS_TARGET_FALSE@ local/stream_client.$(OBJEXT)
-local_stream_client_OBJECTS = $(am_local_stream_client_OBJECTS)
-local_stream_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@local_stream_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am__local_stream_server_SOURCES_DIST = local/stream_server.cpp
-@WINDOWS_TARGET_FALSE@am_local_stream_server_OBJECTS = \
-@WINDOWS_TARGET_FALSE@ local/stream_server.$(OBJEXT)
-local_stream_server_OBJECTS = $(am_local_stream_server_OBJECTS)
-local_stream_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@local_stream_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_multicast_receiver_OBJECTS = multicast/receiver.$(OBJEXT)
-multicast_receiver_OBJECTS = $(am_multicast_receiver_OBJECTS)
-multicast_receiver_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@multicast_receiver_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_multicast_sender_OBJECTS = multicast/sender.$(OBJEXT)
-multicast_sender_OBJECTS = $(am_multicast_sender_OBJECTS)
-multicast_sender_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@multicast_sender_DEPENDENCIES = libasio.a
-am_nonblocking_third_party_lib_OBJECTS = \
- nonblocking/third_party_lib.$(OBJEXT)
-nonblocking_third_party_lib_OBJECTS = \
- $(am_nonblocking_third_party_lib_OBJECTS)
-nonblocking_third_party_lib_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@nonblocking_third_party_lib_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_porthopper_client_OBJECTS = porthopper/client.$(OBJEXT)
-porthopper_client_OBJECTS = $(am_porthopper_client_OBJECTS)
-porthopper_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@porthopper_client_DEPENDENCIES = libasio.a
-am_porthopper_server_OBJECTS = porthopper/server.$(OBJEXT)
-porthopper_server_OBJECTS = $(am_porthopper_server_OBJECTS)
-porthopper_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@porthopper_server_DEPENDENCIES = libasio.a
-am_services_daytime_client_OBJECTS = \
- services/daytime_client.$(OBJEXT) \
- services/logger_service.$(OBJEXT)
-services_daytime_client_OBJECTS = \
- $(am_services_daytime_client_OBJECTS)
-services_daytime_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@services_daytime_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_socks4_sync_client_OBJECTS = socks4/sync_client.$(OBJEXT)
-socks4_sync_client_OBJECTS = $(am_socks4_sync_client_OBJECTS)
-socks4_sync_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@socks4_sync_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am__spawn_echo_server_SOURCES_DIST = spawn/echo_server.cpp
-@HAVE_BOOST_COROUTINE_TRUE@am_spawn_echo_server_OBJECTS = \
-@HAVE_BOOST_COROUTINE_TRUE@ spawn/echo_server.$(OBJEXT)
-spawn_echo_server_OBJECTS = $(am_spawn_echo_server_OBJECTS)
-@HAVE_BOOST_COROUTINE_TRUE@spawn_echo_server_DEPENDENCIES = $(LDADD)
-am__spawn_parallel_grep_SOURCES_DIST = spawn/parallel_grep.cpp
-@HAVE_BOOST_COROUTINE_TRUE@am_spawn_parallel_grep_OBJECTS = \
-@HAVE_BOOST_COROUTINE_TRUE@ spawn/parallel_grep.$(OBJEXT)
-spawn_parallel_grep_OBJECTS = $(am_spawn_parallel_grep_OBJECTS)
-@HAVE_BOOST_COROUTINE_TRUE@spawn_parallel_grep_DEPENDENCIES = \
-@HAVE_BOOST_COROUTINE_TRUE@ $(LDADD)
-am__ssl_client_SOURCES_DIST = ssl/client.cpp
-@HAVE_OPENSSL_TRUE@am_ssl_client_OBJECTS = ssl/client.$(OBJEXT)
-ssl_client_OBJECTS = $(am_ssl_client_OBJECTS)
-ssl_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@ssl_client_DEPENDENCIES = libasio.a
-am__ssl_server_SOURCES_DIST = ssl/server.cpp
-@HAVE_OPENSSL_TRUE@am_ssl_server_OBJECTS = ssl/server.$(OBJEXT)
-ssl_server_OBJECTS = $(am_ssl_server_OBJECTS)
-ssl_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@ssl_server_DEPENDENCIES = libasio.a
-am_timeouts_async_tcp_client_OBJECTS = \
- timeouts/async_tcp_client.$(OBJEXT)
-timeouts_async_tcp_client_OBJECTS = \
- $(am_timeouts_async_tcp_client_OBJECTS)
-timeouts_async_tcp_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@timeouts_async_tcp_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_timeouts_blocking_tcp_client_OBJECTS = \
- timeouts/blocking_tcp_client.$(OBJEXT)
-timeouts_blocking_tcp_client_OBJECTS = \
- $(am_timeouts_blocking_tcp_client_OBJECTS)
-timeouts_blocking_tcp_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@timeouts_blocking_tcp_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_timeouts_blocking_token_tcp_client_OBJECTS = \
- timeouts/blocking_token_tcp_client.$(OBJEXT)
-timeouts_blocking_token_tcp_client_OBJECTS = \
- $(am_timeouts_blocking_token_tcp_client_OBJECTS)
-timeouts_blocking_token_tcp_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@timeouts_blocking_token_tcp_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_timeouts_blocking_udp_client_OBJECTS = \
- timeouts/blocking_udp_client.$(OBJEXT)
-timeouts_blocking_udp_client_OBJECTS = \
- $(am_timeouts_blocking_udp_client_OBJECTS)
-timeouts_blocking_udp_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@timeouts_blocking_udp_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_timeouts_server_OBJECTS = timeouts/server.$(OBJEXT)
-timeouts_server_OBJECTS = $(am_timeouts_server_OBJECTS)
-timeouts_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@timeouts_server_DEPENDENCIES = libasio.a
-am_timers_time_t_timer_OBJECTS = timers/time_t_timer.$(OBJEXT)
-timers_time_t_timer_OBJECTS = $(am_timers_time_t_timer_OBJECTS)
-timers_time_t_timer_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@timers_time_t_timer_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_daytime1_client_OBJECTS = \
- tutorial/daytime1/client.$(OBJEXT)
-tutorial_daytime1_client_OBJECTS = \
- $(am_tutorial_daytime1_client_OBJECTS)
-tutorial_daytime1_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_daytime1_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_daytime2_server_OBJECTS = \
- tutorial/daytime2/server.$(OBJEXT)
-tutorial_daytime2_server_OBJECTS = \
- $(am_tutorial_daytime2_server_OBJECTS)
-tutorial_daytime2_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_daytime2_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_daytime3_server_OBJECTS = \
- tutorial/daytime3/server.$(OBJEXT)
-tutorial_daytime3_server_OBJECTS = \
- $(am_tutorial_daytime3_server_OBJECTS)
-tutorial_daytime3_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_daytime3_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_daytime4_client_OBJECTS = \
- tutorial/daytime4/client.$(OBJEXT)
-tutorial_daytime4_client_OBJECTS = \
- $(am_tutorial_daytime4_client_OBJECTS)
-tutorial_daytime4_client_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_daytime4_client_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_daytime5_server_OBJECTS = \
- tutorial/daytime5/server.$(OBJEXT)
-tutorial_daytime5_server_OBJECTS = \
- $(am_tutorial_daytime5_server_OBJECTS)
-tutorial_daytime5_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_daytime5_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_daytime6_server_OBJECTS = \
- tutorial/daytime6/server.$(OBJEXT)
-tutorial_daytime6_server_OBJECTS = \
- $(am_tutorial_daytime6_server_OBJECTS)
-tutorial_daytime6_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_daytime6_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_daytime7_server_OBJECTS = \
- tutorial/daytime7/server.$(OBJEXT)
-tutorial_daytime7_server_OBJECTS = \
- $(am_tutorial_daytime7_server_OBJECTS)
-tutorial_daytime7_server_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_daytime7_server_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_timer1_timer_OBJECTS = tutorial/timer1/timer.$(OBJEXT)
-tutorial_timer1_timer_OBJECTS = $(am_tutorial_timer1_timer_OBJECTS)
-tutorial_timer1_timer_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_timer1_timer_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_timer2_timer_OBJECTS = tutorial/timer2/timer.$(OBJEXT)
-tutorial_timer2_timer_OBJECTS = $(am_tutorial_timer2_timer_OBJECTS)
-tutorial_timer2_timer_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_timer2_timer_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_timer3_timer_OBJECTS = tutorial/timer3/timer.$(OBJEXT)
-tutorial_timer3_timer_OBJECTS = $(am_tutorial_timer3_timer_OBJECTS)
-tutorial_timer3_timer_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_timer3_timer_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_timer4_timer_OBJECTS = tutorial/timer4/timer.$(OBJEXT)
-tutorial_timer4_timer_OBJECTS = $(am_tutorial_timer4_timer_OBJECTS)
-tutorial_timer4_timer_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_timer4_timer_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_tutorial_timer5_timer_OBJECTS = tutorial/timer5/timer.$(OBJEXT)
-tutorial_timer5_timer_OBJECTS = $(am_tutorial_timer5_timer_OBJECTS)
-tutorial_timer5_timer_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@tutorial_timer5_timer_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am__windows_transmit_file_SOURCES_DIST = windows/transmit_file.cpp
-@WINDOWS_TARGET_TRUE@am_windows_transmit_file_OBJECTS = \
-@WINDOWS_TARGET_TRUE@ windows/transmit_file.$(OBJEXT)
-windows_transmit_file_OBJECTS = $(am_windows_transmit_file_OBJECTS)
-windows_transmit_file_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@windows_transmit_file_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = ../../$(DEPDIR)/asio.Po \
- ../../$(DEPDIR)/asio_ssl.Po allocation/$(DEPDIR)/server.Po \
- buffers/$(DEPDIR)/reference_counted.Po \
- chat/$(DEPDIR)/chat_client.Po chat/$(DEPDIR)/chat_server.Po \
- chat/$(DEPDIR)/posix_chat_client.Po \
- echo/$(DEPDIR)/async_tcp_echo_server.Po \
- echo/$(DEPDIR)/async_udp_echo_server.Po \
- echo/$(DEPDIR)/blocking_tcp_echo_client.Po \
- echo/$(DEPDIR)/blocking_tcp_echo_server.Po \
- echo/$(DEPDIR)/blocking_udp_echo_client.Po \
- echo/$(DEPDIR)/blocking_udp_echo_server.Po \
- fork/$(DEPDIR)/daemon.Po \
- fork/$(DEPDIR)/process_per_connection.Po \
- http/client/$(DEPDIR)/async_client.Po \
- http/client/$(DEPDIR)/sync_client.Po \
- http/server/$(DEPDIR)/connection.Po \
- http/server/$(DEPDIR)/connection_manager.Po \
- http/server/$(DEPDIR)/main.Po \
- http/server/$(DEPDIR)/mime_types.Po \
- http/server/$(DEPDIR)/reply.Po \
- http/server/$(DEPDIR)/request_handler.Po \
- http/server/$(DEPDIR)/request_parser.Po \
- http/server/$(DEPDIR)/server.Po \
- http/server2/$(DEPDIR)/connection.Po \
- http/server2/$(DEPDIR)/io_context_pool.Po \
- http/server2/$(DEPDIR)/main.Po \
- http/server2/$(DEPDIR)/mime_types.Po \
- http/server2/$(DEPDIR)/reply.Po \
- http/server2/$(DEPDIR)/request_handler.Po \
- http/server2/$(DEPDIR)/request_parser.Po \
- http/server2/$(DEPDIR)/server.Po \
- http/server3/$(DEPDIR)/connection.Po \
- http/server3/$(DEPDIR)/main.Po \
- http/server3/$(DEPDIR)/mime_types.Po \
- http/server3/$(DEPDIR)/reply.Po \
- http/server3/$(DEPDIR)/request_handler.Po \
- http/server3/$(DEPDIR)/request_parser.Po \
- http/server3/$(DEPDIR)/server.Po \
- http/server4/$(DEPDIR)/file_handler.Po \
- http/server4/$(DEPDIR)/main.Po \
- http/server4/$(DEPDIR)/mime_types.Po \
- http/server4/$(DEPDIR)/reply.Po \
- http/server4/$(DEPDIR)/request_parser.Po \
- http/server4/$(DEPDIR)/server.Po icmp/$(DEPDIR)/ping.Po \
- invocation/$(DEPDIR)/prioritised_handlers.Po \
- iostreams/$(DEPDIR)/daytime_client.Po \
- iostreams/$(DEPDIR)/daytime_server.Po \
- iostreams/$(DEPDIR)/http_client.Po \
- local/$(DEPDIR)/connect_pair.Po \
- local/$(DEPDIR)/iostream_client.Po \
- local/$(DEPDIR)/stream_client.Po \
- local/$(DEPDIR)/stream_server.Po \
- multicast/$(DEPDIR)/receiver.Po multicast/$(DEPDIR)/sender.Po \
- nonblocking/$(DEPDIR)/third_party_lib.Po \
- porthopper/$(DEPDIR)/client.Po porthopper/$(DEPDIR)/server.Po \
- services/$(DEPDIR)/daytime_client.Po \
- services/$(DEPDIR)/logger_service.Po \
- socks4/$(DEPDIR)/sync_client.Po spawn/$(DEPDIR)/echo_server.Po \
- spawn/$(DEPDIR)/parallel_grep.Po ssl/$(DEPDIR)/client.Po \
- ssl/$(DEPDIR)/server.Po timeouts/$(DEPDIR)/async_tcp_client.Po \
- timeouts/$(DEPDIR)/blocking_tcp_client.Po \
- timeouts/$(DEPDIR)/blocking_token_tcp_client.Po \
- timeouts/$(DEPDIR)/blocking_udp_client.Po \
- timeouts/$(DEPDIR)/server.Po timers/$(DEPDIR)/time_t_timer.Po \
- tutorial/daytime1/$(DEPDIR)/client.Po \
- tutorial/daytime2/$(DEPDIR)/server.Po \
- tutorial/daytime3/$(DEPDIR)/server.Po \
- tutorial/daytime4/$(DEPDIR)/client.Po \
- tutorial/daytime5/$(DEPDIR)/server.Po \
- tutorial/daytime6/$(DEPDIR)/server.Po \
- tutorial/daytime7/$(DEPDIR)/server.Po \
- tutorial/timer1/$(DEPDIR)/timer.Po \
- tutorial/timer2/$(DEPDIR)/timer.Po \
- tutorial/timer3/$(DEPDIR)/timer.Po \
- tutorial/timer4/$(DEPDIR)/timer.Po \
- tutorial/timer5/$(DEPDIR)/timer.Po \
- windows/$(DEPDIR)/transmit_file.Po
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_@AM_V@)
-am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
-am__v_CXX_0 = @echo " CXX " $@;
-am__v_CXX_1 =
-CXXLD = $(CXX)
-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo " CXXLD " $@;
-am__v_CXXLD_1 =
-SOURCES = $(libasio_a_SOURCES) $(allocation_server_SOURCES) \
- $(buffers_reference_counted_SOURCES) \
- $(chat_chat_client_SOURCES) $(chat_chat_server_SOURCES) \
- $(chat_posix_chat_client_SOURCES) \
- $(echo_async_tcp_echo_server_SOURCES) \
- $(echo_async_udp_echo_server_SOURCES) \
- $(echo_blocking_tcp_echo_client_SOURCES) \
- $(echo_blocking_tcp_echo_server_SOURCES) \
- $(echo_blocking_udp_echo_client_SOURCES) \
- $(echo_blocking_udp_echo_server_SOURCES) \
- $(fork_daemon_SOURCES) $(fork_process_per_connection_SOURCES) \
- $(http_client_async_client_SOURCES) \
- $(http_client_sync_client_SOURCES) \
- $(http_server_http_server_SOURCES) \
- $(http_server2_http_server_SOURCES) \
- $(http_server3_http_server_SOURCES) \
- $(http_server4_http_server_SOURCES) $(icmp_ping_SOURCES) \
- $(invocation_prioritised_handlers_SOURCES) \
- $(iostreams_daytime_client_SOURCES) \
- $(iostreams_daytime_server_SOURCES) \
- $(iostreams_http_client_SOURCES) $(local_connect_pair_SOURCES) \
- $(local_iostream_client_SOURCES) \
- $(local_stream_client_SOURCES) $(local_stream_server_SOURCES) \
- $(multicast_receiver_SOURCES) $(multicast_sender_SOURCES) \
- $(nonblocking_third_party_lib_SOURCES) \
- $(porthopper_client_SOURCES) $(porthopper_server_SOURCES) \
- $(services_daytime_client_SOURCES) \
- $(socks4_sync_client_SOURCES) $(spawn_echo_server_SOURCES) \
- $(spawn_parallel_grep_SOURCES) $(ssl_client_SOURCES) \
- $(ssl_server_SOURCES) $(timeouts_async_tcp_client_SOURCES) \
- $(timeouts_blocking_tcp_client_SOURCES) \
- $(timeouts_blocking_token_tcp_client_SOURCES) \
- $(timeouts_blocking_udp_client_SOURCES) \
- $(timeouts_server_SOURCES) $(timers_time_t_timer_SOURCES) \
- $(tutorial_daytime1_client_SOURCES) \
- $(tutorial_daytime2_server_SOURCES) \
- $(tutorial_daytime3_server_SOURCES) \
- $(tutorial_daytime4_client_SOURCES) \
- $(tutorial_daytime5_server_SOURCES) \
- $(tutorial_daytime6_server_SOURCES) \
- $(tutorial_daytime7_server_SOURCES) \
- $(tutorial_timer1_timer_SOURCES) \
- $(tutorial_timer2_timer_SOURCES) \
- $(tutorial_timer3_timer_SOURCES) \
- $(tutorial_timer4_timer_SOURCES) \
- $(tutorial_timer5_timer_SOURCES) \
- $(windows_transmit_file_SOURCES)
-DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
- $(allocation_server_SOURCES) \
- $(buffers_reference_counted_SOURCES) \
- $(chat_chat_client_SOURCES) $(chat_chat_server_SOURCES) \
- $(am__chat_posix_chat_client_SOURCES_DIST) \
- $(echo_async_tcp_echo_server_SOURCES) \
- $(echo_async_udp_echo_server_SOURCES) \
- $(echo_blocking_tcp_echo_client_SOURCES) \
- $(echo_blocking_tcp_echo_server_SOURCES) \
- $(echo_blocking_udp_echo_client_SOURCES) \
- $(echo_blocking_udp_echo_server_SOURCES) \
- $(am__fork_daemon_SOURCES_DIST) \
- $(am__fork_process_per_connection_SOURCES_DIST) \
- $(http_client_async_client_SOURCES) \
- $(http_client_sync_client_SOURCES) \
- $(http_server_http_server_SOURCES) \
- $(http_server2_http_server_SOURCES) \
- $(http_server3_http_server_SOURCES) \
- $(http_server4_http_server_SOURCES) $(icmp_ping_SOURCES) \
- $(invocation_prioritised_handlers_SOURCES) \
- $(iostreams_daytime_client_SOURCES) \
- $(iostreams_daytime_server_SOURCES) \
- $(iostreams_http_client_SOURCES) \
- $(am__local_connect_pair_SOURCES_DIST) \
- $(am__local_iostream_client_SOURCES_DIST) \
- $(am__local_stream_client_SOURCES_DIST) \
- $(am__local_stream_server_SOURCES_DIST) \
- $(multicast_receiver_SOURCES) $(multicast_sender_SOURCES) \
- $(nonblocking_third_party_lib_SOURCES) \
- $(porthopper_client_SOURCES) $(porthopper_server_SOURCES) \
- $(services_daytime_client_SOURCES) \
- $(socks4_sync_client_SOURCES) \
- $(am__spawn_echo_server_SOURCES_DIST) \
- $(am__spawn_parallel_grep_SOURCES_DIST) \
- $(am__ssl_client_SOURCES_DIST) $(am__ssl_server_SOURCES_DIST) \
- $(timeouts_async_tcp_client_SOURCES) \
- $(timeouts_blocking_tcp_client_SOURCES) \
- $(timeouts_blocking_token_tcp_client_SOURCES) \
- $(timeouts_blocking_udp_client_SOURCES) \
- $(timeouts_server_SOURCES) $(timers_time_t_timer_SOURCES) \
- $(tutorial_daytime1_client_SOURCES) \
- $(tutorial_daytime2_server_SOURCES) \
- $(tutorial_daytime3_server_SOURCES) \
- $(tutorial_daytime4_client_SOURCES) \
- $(tutorial_daytime5_server_SOURCES) \
- $(tutorial_daytime6_server_SOURCES) \
- $(tutorial_daytime7_server_SOURCES) \
- $(tutorial_timer1_timer_SOURCES) \
- $(tutorial_timer2_timer_SOURCES) \
- $(tutorial_timer3_timer_SOURCES) \
- $(tutorial_timer4_timer_SOURCES) \
- $(tutorial_timer5_timer_SOURCES) \
- $(am__windows_transmit_file_SOURCES_DIST)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-HEADERS = $(noinst_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = subdir-objects
-@SEPARATE_COMPILATION_TRUE@noinst_LIBRARIES = libasio.a
-@SEPARATE_COMPILATION_TRUE@libasio_a_SOURCES = ../../asio.cpp \
-@SEPARATE_COMPILATION_TRUE@ $(am__append_1)
-@SEPARATE_COMPILATION_TRUE@LDADD = libasio.a
-noinst_HEADERS = \
- chat/chat_message.hpp \
- services/basic_logger.hpp \
- services/logger.hpp \
- services/logger_service.hpp
-
-AM_CXXFLAGS = -I$(srcdir)/../../../include
-allocation_server_SOURCES = allocation/server.cpp
-buffers_reference_counted_SOURCES = buffers/reference_counted.cpp
-chat_chat_client_SOURCES = chat/chat_client.cpp
-chat_chat_server_SOURCES = chat/chat_server.cpp
-echo_async_tcp_echo_server_SOURCES = echo/async_tcp_echo_server.cpp
-echo_async_udp_echo_server_SOURCES = echo/async_udp_echo_server.cpp
-echo_blocking_tcp_echo_client_SOURCES = echo/blocking_tcp_echo_client.cpp
-echo_blocking_tcp_echo_server_SOURCES = echo/blocking_tcp_echo_server.cpp
-echo_blocking_udp_echo_client_SOURCES = echo/blocking_udp_echo_client.cpp
-echo_blocking_udp_echo_server_SOURCES = echo/blocking_udp_echo_server.cpp
-http_client_async_client_SOURCES = http/client/async_client.cpp
-http_client_sync_client_SOURCES = http/client/sync_client.cpp
-http_server_http_server_SOURCES = \
- http/server/connection.cpp \
- http/server/connection_manager.cpp \
- http/server/main.cpp \
- http/server/mime_types.cpp \
- http/server/reply.cpp \
- http/server/request_handler.cpp \
- http/server/request_parser.cpp \
- http/server/server.cpp
-
-http_server2_http_server_SOURCES = \
- http/server2/connection.cpp \
- http/server2/io_context_pool.cpp \
- http/server2/main.cpp \
- http/server2/mime_types.cpp \
- http/server2/reply.cpp \
- http/server2/request_handler.cpp \
- http/server2/request_parser.cpp \
- http/server2/server.cpp
-
-http_server3_http_server_SOURCES = \
- http/server3/connection.cpp \
- http/server3/main.cpp \
- http/server3/mime_types.cpp \
- http/server3/reply.cpp \
- http/server3/request_handler.cpp \
- http/server3/request_parser.cpp \
- http/server3/server.cpp
-
-http_server4_http_server_SOURCES = \
- http/server4/file_handler.cpp \
- http/server4/main.cpp \
- http/server4/mime_types.cpp \
- http/server4/reply.cpp \
- http/server4/request_parser.cpp \
- http/server4/server.cpp
-
-icmp_ping_SOURCES = icmp/ping.cpp
-invocation_prioritised_handlers_SOURCES = invocation/prioritised_handlers.cpp
-iostreams_daytime_client_SOURCES = iostreams/daytime_client.cpp
-iostreams_daytime_server_SOURCES = iostreams/daytime_server.cpp
-iostreams_http_client_SOURCES = iostreams/http_client.cpp
-multicast_receiver_SOURCES = multicast/receiver.cpp
-multicast_sender_SOURCES = multicast/sender.cpp
-nonblocking_third_party_lib_SOURCES = nonblocking/third_party_lib.cpp
-porthopper_client_SOURCES = porthopper/client.cpp
-porthopper_server_SOURCES = porthopper/server.cpp
-services_daytime_client_SOURCES = \
- services/daytime_client.cpp \
- services/logger_service.cpp
-
-socks4_sync_client_SOURCES = socks4/sync_client.cpp
-timeouts_async_tcp_client_SOURCES = timeouts/async_tcp_client.cpp
-timeouts_blocking_tcp_client_SOURCES = timeouts/blocking_tcp_client.cpp
-timeouts_blocking_token_tcp_client_SOURCES = timeouts/blocking_token_tcp_client.cpp
-timeouts_blocking_udp_client_SOURCES = timeouts/blocking_udp_client.cpp
-timeouts_server_SOURCES = timeouts/server.cpp
-timers_time_t_timer_SOURCES = timers/time_t_timer.cpp
-tutorial_timer1_timer_SOURCES = tutorial/timer1/timer.cpp
-tutorial_timer2_timer_SOURCES = tutorial/timer2/timer.cpp
-tutorial_timer3_timer_SOURCES = tutorial/timer3/timer.cpp
-tutorial_timer4_timer_SOURCES = tutorial/timer4/timer.cpp
-tutorial_timer5_timer_SOURCES = tutorial/timer5/timer.cpp
-tutorial_daytime1_client_SOURCES = tutorial/daytime1/client.cpp
-tutorial_daytime2_server_SOURCES = tutorial/daytime2/server.cpp
-tutorial_daytime3_server_SOURCES = tutorial/daytime3/server.cpp
-tutorial_daytime4_client_SOURCES = tutorial/daytime4/client.cpp
-tutorial_daytime5_server_SOURCES = tutorial/daytime5/server.cpp
-tutorial_daytime6_server_SOURCES = tutorial/daytime6/server.cpp
-tutorial_daytime7_server_SOURCES = tutorial/daytime7/server.cpp
-@WINDOWS_TARGET_FALSE@chat_posix_chat_client_SOURCES = chat/posix_chat_client.cpp
-@WINDOWS_TARGET_FALSE@fork_daemon_SOURCES = fork/daemon.cpp
-@WINDOWS_TARGET_FALSE@fork_process_per_connection_SOURCES = fork/process_per_connection.cpp
-@WINDOWS_TARGET_FALSE@local_connect_pair_SOURCES = local/connect_pair.cpp
-@WINDOWS_TARGET_FALSE@local_iostream_client_SOURCES = local/iostream_client.cpp
-@WINDOWS_TARGET_FALSE@local_stream_server_SOURCES = local/stream_server.cpp
-@WINDOWS_TARGET_FALSE@local_stream_client_SOURCES = local/stream_client.cpp
-@WINDOWS_TARGET_TRUE@windows_transmit_file_SOURCES = windows/transmit_file.cpp
-@HAVE_OPENSSL_TRUE@ssl_client_SOURCES = ssl/client.cpp
-@HAVE_OPENSSL_TRUE@ssl_server_SOURCES = ssl/server.cpp
-@HAVE_BOOST_COROUTINE_TRUE@spawn_echo_server_SOURCES = spawn/echo_server.cpp
-@HAVE_BOOST_COROUTINE_TRUE@spawn_echo_server_LDADD = $(LDADD) -lboost_coroutine -lboost_context -lboost_thread -lboost_chrono -lboost_system
-@HAVE_BOOST_COROUTINE_TRUE@spawn_parallel_grep_SOURCES = spawn/parallel_grep.cpp
-@HAVE_BOOST_COROUTINE_TRUE@spawn_parallel_grep_LDADD = $(LDADD) -lboost_coroutine -lboost_context -lboost_thread -lboost_chrono -lboost_system
-EXTRA_DIST = \
- http/server/connection.hpp \
- http/server/connection_manager.hpp \
- http/server/header.hpp \
- http/server/mime_types.hpp \
- http/server/reply.hpp \
- http/server/request.hpp \
- http/server/request_handler.hpp \
- http/server/request_parser.hpp \
- http/server/server.hpp \
- http/server2/connection.hpp \
- http/server2/io_context_pool.hpp \
- http/server2/header.hpp \
- http/server2/mime_types.hpp \
- http/server2/reply.hpp \
- http/server2/request.hpp \
- http/server2/request_handler.hpp \
- http/server2/request_parser.hpp \
- http/server2/server.hpp \
- http/server3/connection.hpp \
- http/server3/header.hpp \
- http/server3/mime_types.hpp \
- http/server3/reply.hpp \
- http/server3/request.hpp \
- http/server3/request_handler.hpp \
- http/server3/request_parser.hpp \
- http/server3/server.hpp \
- http/server4/file_handler.hpp \
- http/server4/header.hpp \
- http/server4/mime_types.hpp \
- http/server4/reply.hpp \
- http/server4/request.hpp \
- http/server4/request_parser.hpp \
- http/server4/server.hpp \
- icmp/icmp_header.hpp \
- icmp/ipv4_header.hpp \
- porthopper/protocol.hpp \
- serialization/client.cpp \
- serialization/server.cpp \
- serialization/connection.hpp \
- serialization/stock.hpp \
- services/basic_logger.hpp \
- services/logger.hpp \
- services/logger_service.hpp \
- socks4/socks4.hpp \
- ssl/README \
- ssl/ca.pem \
- ssl/server.pem \
- ssl/dh2048.pem
-
-MAINTAINERCLEANFILES = \
- $(srcdir)/Makefile.in
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/examples/cpp03/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/examples/cpp03/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-../../$(am__dirstamp):
- @$(MKDIR_P) ../..
- @: > ../../$(am__dirstamp)
-../../$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) ../../$(DEPDIR)
- @: > ../../$(DEPDIR)/$(am__dirstamp)
-../../asio.$(OBJEXT): ../../$(am__dirstamp) \
- ../../$(DEPDIR)/$(am__dirstamp)
-../../asio_ssl.$(OBJEXT): ../../$(am__dirstamp) \
- ../../$(DEPDIR)/$(am__dirstamp)
-
-libasio.a: $(libasio_a_OBJECTS) $(libasio_a_DEPENDENCIES) $(EXTRA_libasio_a_DEPENDENCIES)
- $(AM_V_at)-rm -f libasio.a
- $(AM_V_AR)$(libasio_a_AR) libasio.a $(libasio_a_OBJECTS) $(libasio_a_LIBADD)
- $(AM_V_at)$(RANLIB) libasio.a
-allocation/$(am__dirstamp):
- @$(MKDIR_P) allocation
- @: > allocation/$(am__dirstamp)
-allocation/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) allocation/$(DEPDIR)
- @: > allocation/$(DEPDIR)/$(am__dirstamp)
-allocation/server.$(OBJEXT): allocation/$(am__dirstamp) \
- allocation/$(DEPDIR)/$(am__dirstamp)
-
-allocation/server$(EXEEXT): $(allocation_server_OBJECTS) $(allocation_server_DEPENDENCIES) $(EXTRA_allocation_server_DEPENDENCIES) allocation/$(am__dirstamp)
- @rm -f allocation/server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(allocation_server_OBJECTS) $(allocation_server_LDADD) $(LIBS)
-buffers/$(am__dirstamp):
- @$(MKDIR_P) buffers
- @: > buffers/$(am__dirstamp)
-buffers/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) buffers/$(DEPDIR)
- @: > buffers/$(DEPDIR)/$(am__dirstamp)
-buffers/reference_counted.$(OBJEXT): buffers/$(am__dirstamp) \
- buffers/$(DEPDIR)/$(am__dirstamp)
-
-buffers/reference_counted$(EXEEXT): $(buffers_reference_counted_OBJECTS) $(buffers_reference_counted_DEPENDENCIES) $(EXTRA_buffers_reference_counted_DEPENDENCIES) buffers/$(am__dirstamp)
- @rm -f buffers/reference_counted$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(buffers_reference_counted_OBJECTS) $(buffers_reference_counted_LDADD) $(LIBS)
-chat/$(am__dirstamp):
- @$(MKDIR_P) chat
- @: > chat/$(am__dirstamp)
-chat/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) chat/$(DEPDIR)
- @: > chat/$(DEPDIR)/$(am__dirstamp)
-chat/chat_client.$(OBJEXT): chat/$(am__dirstamp) \
- chat/$(DEPDIR)/$(am__dirstamp)
-
-chat/chat_client$(EXEEXT): $(chat_chat_client_OBJECTS) $(chat_chat_client_DEPENDENCIES) $(EXTRA_chat_chat_client_DEPENDENCIES) chat/$(am__dirstamp)
- @rm -f chat/chat_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(chat_chat_client_OBJECTS) $(chat_chat_client_LDADD) $(LIBS)
-chat/chat_server.$(OBJEXT): chat/$(am__dirstamp) \
- chat/$(DEPDIR)/$(am__dirstamp)
-
-chat/chat_server$(EXEEXT): $(chat_chat_server_OBJECTS) $(chat_chat_server_DEPENDENCIES) $(EXTRA_chat_chat_server_DEPENDENCIES) chat/$(am__dirstamp)
- @rm -f chat/chat_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(chat_chat_server_OBJECTS) $(chat_chat_server_LDADD) $(LIBS)
-chat/posix_chat_client.$(OBJEXT): chat/$(am__dirstamp) \
- chat/$(DEPDIR)/$(am__dirstamp)
-
-chat/posix_chat_client$(EXEEXT): $(chat_posix_chat_client_OBJECTS) $(chat_posix_chat_client_DEPENDENCIES) $(EXTRA_chat_posix_chat_client_DEPENDENCIES) chat/$(am__dirstamp)
- @rm -f chat/posix_chat_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(chat_posix_chat_client_OBJECTS) $(chat_posix_chat_client_LDADD) $(LIBS)
-echo/$(am__dirstamp):
- @$(MKDIR_P) echo
- @: > echo/$(am__dirstamp)
-echo/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) echo/$(DEPDIR)
- @: > echo/$(DEPDIR)/$(am__dirstamp)
-echo/async_tcp_echo_server.$(OBJEXT): echo/$(am__dirstamp) \
- echo/$(DEPDIR)/$(am__dirstamp)
-
-echo/async_tcp_echo_server$(EXEEXT): $(echo_async_tcp_echo_server_OBJECTS) $(echo_async_tcp_echo_server_DEPENDENCIES) $(EXTRA_echo_async_tcp_echo_server_DEPENDENCIES) echo/$(am__dirstamp)
- @rm -f echo/async_tcp_echo_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(echo_async_tcp_echo_server_OBJECTS) $(echo_async_tcp_echo_server_LDADD) $(LIBS)
-echo/async_udp_echo_server.$(OBJEXT): echo/$(am__dirstamp) \
- echo/$(DEPDIR)/$(am__dirstamp)
-
-echo/async_udp_echo_server$(EXEEXT): $(echo_async_udp_echo_server_OBJECTS) $(echo_async_udp_echo_server_DEPENDENCIES) $(EXTRA_echo_async_udp_echo_server_DEPENDENCIES) echo/$(am__dirstamp)
- @rm -f echo/async_udp_echo_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(echo_async_udp_echo_server_OBJECTS) $(echo_async_udp_echo_server_LDADD) $(LIBS)
-echo/blocking_tcp_echo_client.$(OBJEXT): echo/$(am__dirstamp) \
- echo/$(DEPDIR)/$(am__dirstamp)
-
-echo/blocking_tcp_echo_client$(EXEEXT): $(echo_blocking_tcp_echo_client_OBJECTS) $(echo_blocking_tcp_echo_client_DEPENDENCIES) $(EXTRA_echo_blocking_tcp_echo_client_DEPENDENCIES) echo/$(am__dirstamp)
- @rm -f echo/blocking_tcp_echo_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(echo_blocking_tcp_echo_client_OBJECTS) $(echo_blocking_tcp_echo_client_LDADD) $(LIBS)
-echo/blocking_tcp_echo_server.$(OBJEXT): echo/$(am__dirstamp) \
- echo/$(DEPDIR)/$(am__dirstamp)
-
-echo/blocking_tcp_echo_server$(EXEEXT): $(echo_blocking_tcp_echo_server_OBJECTS) $(echo_blocking_tcp_echo_server_DEPENDENCIES) $(EXTRA_echo_blocking_tcp_echo_server_DEPENDENCIES) echo/$(am__dirstamp)
- @rm -f echo/blocking_tcp_echo_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(echo_blocking_tcp_echo_server_OBJECTS) $(echo_blocking_tcp_echo_server_LDADD) $(LIBS)
-echo/blocking_udp_echo_client.$(OBJEXT): echo/$(am__dirstamp) \
- echo/$(DEPDIR)/$(am__dirstamp)
-
-echo/blocking_udp_echo_client$(EXEEXT): $(echo_blocking_udp_echo_client_OBJECTS) $(echo_blocking_udp_echo_client_DEPENDENCIES) $(EXTRA_echo_blocking_udp_echo_client_DEPENDENCIES) echo/$(am__dirstamp)
- @rm -f echo/blocking_udp_echo_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(echo_blocking_udp_echo_client_OBJECTS) $(echo_blocking_udp_echo_client_LDADD) $(LIBS)
-echo/blocking_udp_echo_server.$(OBJEXT): echo/$(am__dirstamp) \
- echo/$(DEPDIR)/$(am__dirstamp)
-
-echo/blocking_udp_echo_server$(EXEEXT): $(echo_blocking_udp_echo_server_OBJECTS) $(echo_blocking_udp_echo_server_DEPENDENCIES) $(EXTRA_echo_blocking_udp_echo_server_DEPENDENCIES) echo/$(am__dirstamp)
- @rm -f echo/blocking_udp_echo_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(echo_blocking_udp_echo_server_OBJECTS) $(echo_blocking_udp_echo_server_LDADD) $(LIBS)
-fork/$(am__dirstamp):
- @$(MKDIR_P) fork
- @: > fork/$(am__dirstamp)
-fork/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) fork/$(DEPDIR)
- @: > fork/$(DEPDIR)/$(am__dirstamp)
-fork/daemon.$(OBJEXT): fork/$(am__dirstamp) \
- fork/$(DEPDIR)/$(am__dirstamp)
-
-fork/daemon$(EXEEXT): $(fork_daemon_OBJECTS) $(fork_daemon_DEPENDENCIES) $(EXTRA_fork_daemon_DEPENDENCIES) fork/$(am__dirstamp)
- @rm -f fork/daemon$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(fork_daemon_OBJECTS) $(fork_daemon_LDADD) $(LIBS)
-fork/process_per_connection.$(OBJEXT): fork/$(am__dirstamp) \
- fork/$(DEPDIR)/$(am__dirstamp)
-
-fork/process_per_connection$(EXEEXT): $(fork_process_per_connection_OBJECTS) $(fork_process_per_connection_DEPENDENCIES) $(EXTRA_fork_process_per_connection_DEPENDENCIES) fork/$(am__dirstamp)
- @rm -f fork/process_per_connection$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(fork_process_per_connection_OBJECTS) $(fork_process_per_connection_LDADD) $(LIBS)
-http/client/$(am__dirstamp):
- @$(MKDIR_P) http/client
- @: > http/client/$(am__dirstamp)
-http/client/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) http/client/$(DEPDIR)
- @: > http/client/$(DEPDIR)/$(am__dirstamp)
-http/client/async_client.$(OBJEXT): http/client/$(am__dirstamp) \
- http/client/$(DEPDIR)/$(am__dirstamp)
-
-http/client/async_client$(EXEEXT): $(http_client_async_client_OBJECTS) $(http_client_async_client_DEPENDENCIES) $(EXTRA_http_client_async_client_DEPENDENCIES) http/client/$(am__dirstamp)
- @rm -f http/client/async_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(http_client_async_client_OBJECTS) $(http_client_async_client_LDADD) $(LIBS)
-http/client/sync_client.$(OBJEXT): http/client/$(am__dirstamp) \
- http/client/$(DEPDIR)/$(am__dirstamp)
-
-http/client/sync_client$(EXEEXT): $(http_client_sync_client_OBJECTS) $(http_client_sync_client_DEPENDENCIES) $(EXTRA_http_client_sync_client_DEPENDENCIES) http/client/$(am__dirstamp)
- @rm -f http/client/sync_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(http_client_sync_client_OBJECTS) $(http_client_sync_client_LDADD) $(LIBS)
-http/server/$(am__dirstamp):
- @$(MKDIR_P) http/server
- @: > http/server/$(am__dirstamp)
-http/server/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) http/server/$(DEPDIR)
- @: > http/server/$(DEPDIR)/$(am__dirstamp)
-http/server/connection.$(OBJEXT): http/server/$(am__dirstamp) \
- http/server/$(DEPDIR)/$(am__dirstamp)
-http/server/connection_manager.$(OBJEXT): http/server/$(am__dirstamp) \
- http/server/$(DEPDIR)/$(am__dirstamp)
-http/server/main.$(OBJEXT): http/server/$(am__dirstamp) \
- http/server/$(DEPDIR)/$(am__dirstamp)
-http/server/mime_types.$(OBJEXT): http/server/$(am__dirstamp) \
- http/server/$(DEPDIR)/$(am__dirstamp)
-http/server/reply.$(OBJEXT): http/server/$(am__dirstamp) \
- http/server/$(DEPDIR)/$(am__dirstamp)
-http/server/request_handler.$(OBJEXT): http/server/$(am__dirstamp) \
- http/server/$(DEPDIR)/$(am__dirstamp)
-http/server/request_parser.$(OBJEXT): http/server/$(am__dirstamp) \
- http/server/$(DEPDIR)/$(am__dirstamp)
-http/server/server.$(OBJEXT): http/server/$(am__dirstamp) \
- http/server/$(DEPDIR)/$(am__dirstamp)
-
-http/server/http_server$(EXEEXT): $(http_server_http_server_OBJECTS) $(http_server_http_server_DEPENDENCIES) $(EXTRA_http_server_http_server_DEPENDENCIES) http/server/$(am__dirstamp)
- @rm -f http/server/http_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(http_server_http_server_OBJECTS) $(http_server_http_server_LDADD) $(LIBS)
-http/server2/$(am__dirstamp):
- @$(MKDIR_P) http/server2
- @: > http/server2/$(am__dirstamp)
-http/server2/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) http/server2/$(DEPDIR)
- @: > http/server2/$(DEPDIR)/$(am__dirstamp)
-http/server2/connection.$(OBJEXT): http/server2/$(am__dirstamp) \
- http/server2/$(DEPDIR)/$(am__dirstamp)
-http/server2/io_context_pool.$(OBJEXT): http/server2/$(am__dirstamp) \
- http/server2/$(DEPDIR)/$(am__dirstamp)
-http/server2/main.$(OBJEXT): http/server2/$(am__dirstamp) \
- http/server2/$(DEPDIR)/$(am__dirstamp)
-http/server2/mime_types.$(OBJEXT): http/server2/$(am__dirstamp) \
- http/server2/$(DEPDIR)/$(am__dirstamp)
-http/server2/reply.$(OBJEXT): http/server2/$(am__dirstamp) \
- http/server2/$(DEPDIR)/$(am__dirstamp)
-http/server2/request_handler.$(OBJEXT): http/server2/$(am__dirstamp) \
- http/server2/$(DEPDIR)/$(am__dirstamp)
-http/server2/request_parser.$(OBJEXT): http/server2/$(am__dirstamp) \
- http/server2/$(DEPDIR)/$(am__dirstamp)
-http/server2/server.$(OBJEXT): http/server2/$(am__dirstamp) \
- http/server2/$(DEPDIR)/$(am__dirstamp)
-
-http/server2/http_server$(EXEEXT): $(http_server2_http_server_OBJECTS) $(http_server2_http_server_DEPENDENCIES) $(EXTRA_http_server2_http_server_DEPENDENCIES) http/server2/$(am__dirstamp)
- @rm -f http/server2/http_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(http_server2_http_server_OBJECTS) $(http_server2_http_server_LDADD) $(LIBS)
-http/server3/$(am__dirstamp):
- @$(MKDIR_P) http/server3
- @: > http/server3/$(am__dirstamp)
-http/server3/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) http/server3/$(DEPDIR)
- @: > http/server3/$(DEPDIR)/$(am__dirstamp)
-http/server3/connection.$(OBJEXT): http/server3/$(am__dirstamp) \
- http/server3/$(DEPDIR)/$(am__dirstamp)
-http/server3/main.$(OBJEXT): http/server3/$(am__dirstamp) \
- http/server3/$(DEPDIR)/$(am__dirstamp)
-http/server3/mime_types.$(OBJEXT): http/server3/$(am__dirstamp) \
- http/server3/$(DEPDIR)/$(am__dirstamp)
-http/server3/reply.$(OBJEXT): http/server3/$(am__dirstamp) \
- http/server3/$(DEPDIR)/$(am__dirstamp)
-http/server3/request_handler.$(OBJEXT): http/server3/$(am__dirstamp) \
- http/server3/$(DEPDIR)/$(am__dirstamp)
-http/server3/request_parser.$(OBJEXT): http/server3/$(am__dirstamp) \
- http/server3/$(DEPDIR)/$(am__dirstamp)
-http/server3/server.$(OBJEXT): http/server3/$(am__dirstamp) \
- http/server3/$(DEPDIR)/$(am__dirstamp)
-
-http/server3/http_server$(EXEEXT): $(http_server3_http_server_OBJECTS) $(http_server3_http_server_DEPENDENCIES) $(EXTRA_http_server3_http_server_DEPENDENCIES) http/server3/$(am__dirstamp)
- @rm -f http/server3/http_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(http_server3_http_server_OBJECTS) $(http_server3_http_server_LDADD) $(LIBS)
-http/server4/$(am__dirstamp):
- @$(MKDIR_P) http/server4
- @: > http/server4/$(am__dirstamp)
-http/server4/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) http/server4/$(DEPDIR)
- @: > http/server4/$(DEPDIR)/$(am__dirstamp)
-http/server4/file_handler.$(OBJEXT): http/server4/$(am__dirstamp) \
- http/server4/$(DEPDIR)/$(am__dirstamp)
-http/server4/main.$(OBJEXT): http/server4/$(am__dirstamp) \
- http/server4/$(DEPDIR)/$(am__dirstamp)
-http/server4/mime_types.$(OBJEXT): http/server4/$(am__dirstamp) \
- http/server4/$(DEPDIR)/$(am__dirstamp)
-http/server4/reply.$(OBJEXT): http/server4/$(am__dirstamp) \
- http/server4/$(DEPDIR)/$(am__dirstamp)
-http/server4/request_parser.$(OBJEXT): http/server4/$(am__dirstamp) \
- http/server4/$(DEPDIR)/$(am__dirstamp)
-http/server4/server.$(OBJEXT): http/server4/$(am__dirstamp) \
- http/server4/$(DEPDIR)/$(am__dirstamp)
-
-http/server4/http_server$(EXEEXT): $(http_server4_http_server_OBJECTS) $(http_server4_http_server_DEPENDENCIES) $(EXTRA_http_server4_http_server_DEPENDENCIES) http/server4/$(am__dirstamp)
- @rm -f http/server4/http_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(http_server4_http_server_OBJECTS) $(http_server4_http_server_LDADD) $(LIBS)
-icmp/$(am__dirstamp):
- @$(MKDIR_P) icmp
- @: > icmp/$(am__dirstamp)
-icmp/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) icmp/$(DEPDIR)
- @: > icmp/$(DEPDIR)/$(am__dirstamp)
-icmp/ping.$(OBJEXT): icmp/$(am__dirstamp) \
- icmp/$(DEPDIR)/$(am__dirstamp)
-
-icmp/ping$(EXEEXT): $(icmp_ping_OBJECTS) $(icmp_ping_DEPENDENCIES) $(EXTRA_icmp_ping_DEPENDENCIES) icmp/$(am__dirstamp)
- @rm -f icmp/ping$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(icmp_ping_OBJECTS) $(icmp_ping_LDADD) $(LIBS)
-invocation/$(am__dirstamp):
- @$(MKDIR_P) invocation
- @: > invocation/$(am__dirstamp)
-invocation/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) invocation/$(DEPDIR)
- @: > invocation/$(DEPDIR)/$(am__dirstamp)
-invocation/prioritised_handlers.$(OBJEXT): invocation/$(am__dirstamp) \
- invocation/$(DEPDIR)/$(am__dirstamp)
-
-invocation/prioritised_handlers$(EXEEXT): $(invocation_prioritised_handlers_OBJECTS) $(invocation_prioritised_handlers_DEPENDENCIES) $(EXTRA_invocation_prioritised_handlers_DEPENDENCIES) invocation/$(am__dirstamp)
- @rm -f invocation/prioritised_handlers$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(invocation_prioritised_handlers_OBJECTS) $(invocation_prioritised_handlers_LDADD) $(LIBS)
-iostreams/$(am__dirstamp):
- @$(MKDIR_P) iostreams
- @: > iostreams/$(am__dirstamp)
-iostreams/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) iostreams/$(DEPDIR)
- @: > iostreams/$(DEPDIR)/$(am__dirstamp)
-iostreams/daytime_client.$(OBJEXT): iostreams/$(am__dirstamp) \
- iostreams/$(DEPDIR)/$(am__dirstamp)
-
-iostreams/daytime_client$(EXEEXT): $(iostreams_daytime_client_OBJECTS) $(iostreams_daytime_client_DEPENDENCIES) $(EXTRA_iostreams_daytime_client_DEPENDENCIES) iostreams/$(am__dirstamp)
- @rm -f iostreams/daytime_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(iostreams_daytime_client_OBJECTS) $(iostreams_daytime_client_LDADD) $(LIBS)
-iostreams/daytime_server.$(OBJEXT): iostreams/$(am__dirstamp) \
- iostreams/$(DEPDIR)/$(am__dirstamp)
-
-iostreams/daytime_server$(EXEEXT): $(iostreams_daytime_server_OBJECTS) $(iostreams_daytime_server_DEPENDENCIES) $(EXTRA_iostreams_daytime_server_DEPENDENCIES) iostreams/$(am__dirstamp)
- @rm -f iostreams/daytime_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(iostreams_daytime_server_OBJECTS) $(iostreams_daytime_server_LDADD) $(LIBS)
-iostreams/http_client.$(OBJEXT): iostreams/$(am__dirstamp) \
- iostreams/$(DEPDIR)/$(am__dirstamp)
-
-iostreams/http_client$(EXEEXT): $(iostreams_http_client_OBJECTS) $(iostreams_http_client_DEPENDENCIES) $(EXTRA_iostreams_http_client_DEPENDENCIES) iostreams/$(am__dirstamp)
- @rm -f iostreams/http_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(iostreams_http_client_OBJECTS) $(iostreams_http_client_LDADD) $(LIBS)
-local/$(am__dirstamp):
- @$(MKDIR_P) local
- @: > local/$(am__dirstamp)
-local/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) local/$(DEPDIR)
- @: > local/$(DEPDIR)/$(am__dirstamp)
-local/connect_pair.$(OBJEXT): local/$(am__dirstamp) \
- local/$(DEPDIR)/$(am__dirstamp)
-
-local/connect_pair$(EXEEXT): $(local_connect_pair_OBJECTS) $(local_connect_pair_DEPENDENCIES) $(EXTRA_local_connect_pair_DEPENDENCIES) local/$(am__dirstamp)
- @rm -f local/connect_pair$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(local_connect_pair_OBJECTS) $(local_connect_pair_LDADD) $(LIBS)
-local/iostream_client.$(OBJEXT): local/$(am__dirstamp) \
- local/$(DEPDIR)/$(am__dirstamp)
-
-local/iostream_client$(EXEEXT): $(local_iostream_client_OBJECTS) $(local_iostream_client_DEPENDENCIES) $(EXTRA_local_iostream_client_DEPENDENCIES) local/$(am__dirstamp)
- @rm -f local/iostream_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(local_iostream_client_OBJECTS) $(local_iostream_client_LDADD) $(LIBS)
-local/stream_client.$(OBJEXT): local/$(am__dirstamp) \
- local/$(DEPDIR)/$(am__dirstamp)
-
-local/stream_client$(EXEEXT): $(local_stream_client_OBJECTS) $(local_stream_client_DEPENDENCIES) $(EXTRA_local_stream_client_DEPENDENCIES) local/$(am__dirstamp)
- @rm -f local/stream_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(local_stream_client_OBJECTS) $(local_stream_client_LDADD) $(LIBS)
-local/stream_server.$(OBJEXT): local/$(am__dirstamp) \
- local/$(DEPDIR)/$(am__dirstamp)
-
-local/stream_server$(EXEEXT): $(local_stream_server_OBJECTS) $(local_stream_server_DEPENDENCIES) $(EXTRA_local_stream_server_DEPENDENCIES) local/$(am__dirstamp)
- @rm -f local/stream_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(local_stream_server_OBJECTS) $(local_stream_server_LDADD) $(LIBS)
-multicast/$(am__dirstamp):
- @$(MKDIR_P) multicast
- @: > multicast/$(am__dirstamp)
-multicast/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) multicast/$(DEPDIR)
- @: > multicast/$(DEPDIR)/$(am__dirstamp)
-multicast/receiver.$(OBJEXT): multicast/$(am__dirstamp) \
- multicast/$(DEPDIR)/$(am__dirstamp)
-
-multicast/receiver$(EXEEXT): $(multicast_receiver_OBJECTS) $(multicast_receiver_DEPENDENCIES) $(EXTRA_multicast_receiver_DEPENDENCIES) multicast/$(am__dirstamp)
- @rm -f multicast/receiver$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(multicast_receiver_OBJECTS) $(multicast_receiver_LDADD) $(LIBS)
-multicast/sender.$(OBJEXT): multicast/$(am__dirstamp) \
- multicast/$(DEPDIR)/$(am__dirstamp)
-
-multicast/sender$(EXEEXT): $(multicast_sender_OBJECTS) $(multicast_sender_DEPENDENCIES) $(EXTRA_multicast_sender_DEPENDENCIES) multicast/$(am__dirstamp)
- @rm -f multicast/sender$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(multicast_sender_OBJECTS) $(multicast_sender_LDADD) $(LIBS)
-nonblocking/$(am__dirstamp):
- @$(MKDIR_P) nonblocking
- @: > nonblocking/$(am__dirstamp)
-nonblocking/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) nonblocking/$(DEPDIR)
- @: > nonblocking/$(DEPDIR)/$(am__dirstamp)
-nonblocking/third_party_lib.$(OBJEXT): nonblocking/$(am__dirstamp) \
- nonblocking/$(DEPDIR)/$(am__dirstamp)
-
-nonblocking/third_party_lib$(EXEEXT): $(nonblocking_third_party_lib_OBJECTS) $(nonblocking_third_party_lib_DEPENDENCIES) $(EXTRA_nonblocking_third_party_lib_DEPENDENCIES) nonblocking/$(am__dirstamp)
- @rm -f nonblocking/third_party_lib$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(nonblocking_third_party_lib_OBJECTS) $(nonblocking_third_party_lib_LDADD) $(LIBS)
-porthopper/$(am__dirstamp):
- @$(MKDIR_P) porthopper
- @: > porthopper/$(am__dirstamp)
-porthopper/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) porthopper/$(DEPDIR)
- @: > porthopper/$(DEPDIR)/$(am__dirstamp)
-porthopper/client.$(OBJEXT): porthopper/$(am__dirstamp) \
- porthopper/$(DEPDIR)/$(am__dirstamp)
-
-porthopper/client$(EXEEXT): $(porthopper_client_OBJECTS) $(porthopper_client_DEPENDENCIES) $(EXTRA_porthopper_client_DEPENDENCIES) porthopper/$(am__dirstamp)
- @rm -f porthopper/client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(porthopper_client_OBJECTS) $(porthopper_client_LDADD) $(LIBS)
-porthopper/server.$(OBJEXT): porthopper/$(am__dirstamp) \
- porthopper/$(DEPDIR)/$(am__dirstamp)
-
-porthopper/server$(EXEEXT): $(porthopper_server_OBJECTS) $(porthopper_server_DEPENDENCIES) $(EXTRA_porthopper_server_DEPENDENCIES) porthopper/$(am__dirstamp)
- @rm -f porthopper/server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(porthopper_server_OBJECTS) $(porthopper_server_LDADD) $(LIBS)
-services/$(am__dirstamp):
- @$(MKDIR_P) services
- @: > services/$(am__dirstamp)
-services/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) services/$(DEPDIR)
- @: > services/$(DEPDIR)/$(am__dirstamp)
-services/daytime_client.$(OBJEXT): services/$(am__dirstamp) \
- services/$(DEPDIR)/$(am__dirstamp)
-services/logger_service.$(OBJEXT): services/$(am__dirstamp) \
- services/$(DEPDIR)/$(am__dirstamp)
-
-services/daytime_client$(EXEEXT): $(services_daytime_client_OBJECTS) $(services_daytime_client_DEPENDENCIES) $(EXTRA_services_daytime_client_DEPENDENCIES) services/$(am__dirstamp)
- @rm -f services/daytime_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(services_daytime_client_OBJECTS) $(services_daytime_client_LDADD) $(LIBS)
-socks4/$(am__dirstamp):
- @$(MKDIR_P) socks4
- @: > socks4/$(am__dirstamp)
-socks4/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) socks4/$(DEPDIR)
- @: > socks4/$(DEPDIR)/$(am__dirstamp)
-socks4/sync_client.$(OBJEXT): socks4/$(am__dirstamp) \
- socks4/$(DEPDIR)/$(am__dirstamp)
-
-socks4/sync_client$(EXEEXT): $(socks4_sync_client_OBJECTS) $(socks4_sync_client_DEPENDENCIES) $(EXTRA_socks4_sync_client_DEPENDENCIES) socks4/$(am__dirstamp)
- @rm -f socks4/sync_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(socks4_sync_client_OBJECTS) $(socks4_sync_client_LDADD) $(LIBS)
-spawn/$(am__dirstamp):
- @$(MKDIR_P) spawn
- @: > spawn/$(am__dirstamp)
-spawn/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) spawn/$(DEPDIR)
- @: > spawn/$(DEPDIR)/$(am__dirstamp)
-spawn/echo_server.$(OBJEXT): spawn/$(am__dirstamp) \
- spawn/$(DEPDIR)/$(am__dirstamp)
-
-spawn/echo_server$(EXEEXT): $(spawn_echo_server_OBJECTS) $(spawn_echo_server_DEPENDENCIES) $(EXTRA_spawn_echo_server_DEPENDENCIES) spawn/$(am__dirstamp)
- @rm -f spawn/echo_server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(spawn_echo_server_OBJECTS) $(spawn_echo_server_LDADD) $(LIBS)
-spawn/parallel_grep.$(OBJEXT): spawn/$(am__dirstamp) \
- spawn/$(DEPDIR)/$(am__dirstamp)
-
-spawn/parallel_grep$(EXEEXT): $(spawn_parallel_grep_OBJECTS) $(spawn_parallel_grep_DEPENDENCIES) $(EXTRA_spawn_parallel_grep_DEPENDENCIES) spawn/$(am__dirstamp)
- @rm -f spawn/parallel_grep$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(spawn_parallel_grep_OBJECTS) $(spawn_parallel_grep_LDADD) $(LIBS)
-ssl/$(am__dirstamp):
- @$(MKDIR_P) ssl
- @: > ssl/$(am__dirstamp)
-ssl/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) ssl/$(DEPDIR)
- @: > ssl/$(DEPDIR)/$(am__dirstamp)
-ssl/client.$(OBJEXT): ssl/$(am__dirstamp) \
- ssl/$(DEPDIR)/$(am__dirstamp)
-
-ssl/client$(EXEEXT): $(ssl_client_OBJECTS) $(ssl_client_DEPENDENCIES) $(EXTRA_ssl_client_DEPENDENCIES) ssl/$(am__dirstamp)
- @rm -f ssl/client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(ssl_client_OBJECTS) $(ssl_client_LDADD) $(LIBS)
-ssl/server.$(OBJEXT): ssl/$(am__dirstamp) \
- ssl/$(DEPDIR)/$(am__dirstamp)
-
-ssl/server$(EXEEXT): $(ssl_server_OBJECTS) $(ssl_server_DEPENDENCIES) $(EXTRA_ssl_server_DEPENDENCIES) ssl/$(am__dirstamp)
- @rm -f ssl/server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(ssl_server_OBJECTS) $(ssl_server_LDADD) $(LIBS)
-timeouts/$(am__dirstamp):
- @$(MKDIR_P) timeouts
- @: > timeouts/$(am__dirstamp)
-timeouts/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) timeouts/$(DEPDIR)
- @: > timeouts/$(DEPDIR)/$(am__dirstamp)
-timeouts/async_tcp_client.$(OBJEXT): timeouts/$(am__dirstamp) \
- timeouts/$(DEPDIR)/$(am__dirstamp)
-
-timeouts/async_tcp_client$(EXEEXT): $(timeouts_async_tcp_client_OBJECTS) $(timeouts_async_tcp_client_DEPENDENCIES) $(EXTRA_timeouts_async_tcp_client_DEPENDENCIES) timeouts/$(am__dirstamp)
- @rm -f timeouts/async_tcp_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(timeouts_async_tcp_client_OBJECTS) $(timeouts_async_tcp_client_LDADD) $(LIBS)
-timeouts/blocking_tcp_client.$(OBJEXT): timeouts/$(am__dirstamp) \
- timeouts/$(DEPDIR)/$(am__dirstamp)
-
-timeouts/blocking_tcp_client$(EXEEXT): $(timeouts_blocking_tcp_client_OBJECTS) $(timeouts_blocking_tcp_client_DEPENDENCIES) $(EXTRA_timeouts_blocking_tcp_client_DEPENDENCIES) timeouts/$(am__dirstamp)
- @rm -f timeouts/blocking_tcp_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(timeouts_blocking_tcp_client_OBJECTS) $(timeouts_blocking_tcp_client_LDADD) $(LIBS)
-timeouts/blocking_token_tcp_client.$(OBJEXT): \
- timeouts/$(am__dirstamp) timeouts/$(DEPDIR)/$(am__dirstamp)
-
-timeouts/blocking_token_tcp_client$(EXEEXT): $(timeouts_blocking_token_tcp_client_OBJECTS) $(timeouts_blocking_token_tcp_client_DEPENDENCIES) $(EXTRA_timeouts_blocking_token_tcp_client_DEPENDENCIES) timeouts/$(am__dirstamp)
- @rm -f timeouts/blocking_token_tcp_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(timeouts_blocking_token_tcp_client_OBJECTS) $(timeouts_blocking_token_tcp_client_LDADD) $(LIBS)
-timeouts/blocking_udp_client.$(OBJEXT): timeouts/$(am__dirstamp) \
- timeouts/$(DEPDIR)/$(am__dirstamp)
-
-timeouts/blocking_udp_client$(EXEEXT): $(timeouts_blocking_udp_client_OBJECTS) $(timeouts_blocking_udp_client_DEPENDENCIES) $(EXTRA_timeouts_blocking_udp_client_DEPENDENCIES) timeouts/$(am__dirstamp)
- @rm -f timeouts/blocking_udp_client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(timeouts_blocking_udp_client_OBJECTS) $(timeouts_blocking_udp_client_LDADD) $(LIBS)
-timeouts/server.$(OBJEXT): timeouts/$(am__dirstamp) \
- timeouts/$(DEPDIR)/$(am__dirstamp)
-
-timeouts/server$(EXEEXT): $(timeouts_server_OBJECTS) $(timeouts_server_DEPENDENCIES) $(EXTRA_timeouts_server_DEPENDENCIES) timeouts/$(am__dirstamp)
- @rm -f timeouts/server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(timeouts_server_OBJECTS) $(timeouts_server_LDADD) $(LIBS)
-timers/$(am__dirstamp):
- @$(MKDIR_P) timers
- @: > timers/$(am__dirstamp)
-timers/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) timers/$(DEPDIR)
- @: > timers/$(DEPDIR)/$(am__dirstamp)
-timers/time_t_timer.$(OBJEXT): timers/$(am__dirstamp) \
- timers/$(DEPDIR)/$(am__dirstamp)
-
-timers/time_t_timer$(EXEEXT): $(timers_time_t_timer_OBJECTS) $(timers_time_t_timer_DEPENDENCIES) $(EXTRA_timers_time_t_timer_DEPENDENCIES) timers/$(am__dirstamp)
- @rm -f timers/time_t_timer$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(timers_time_t_timer_OBJECTS) $(timers_time_t_timer_LDADD) $(LIBS)
-tutorial/daytime1/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime1
- @: > tutorial/daytime1/$(am__dirstamp)
-tutorial/daytime1/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime1/$(DEPDIR)
- @: > tutorial/daytime1/$(DEPDIR)/$(am__dirstamp)
-tutorial/daytime1/client.$(OBJEXT): tutorial/daytime1/$(am__dirstamp) \
- tutorial/daytime1/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/daytime1/client$(EXEEXT): $(tutorial_daytime1_client_OBJECTS) $(tutorial_daytime1_client_DEPENDENCIES) $(EXTRA_tutorial_daytime1_client_DEPENDENCIES) tutorial/daytime1/$(am__dirstamp)
- @rm -f tutorial/daytime1/client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime1_client_OBJECTS) $(tutorial_daytime1_client_LDADD) $(LIBS)
-tutorial/daytime2/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime2
- @: > tutorial/daytime2/$(am__dirstamp)
-tutorial/daytime2/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime2/$(DEPDIR)
- @: > tutorial/daytime2/$(DEPDIR)/$(am__dirstamp)
-tutorial/daytime2/server.$(OBJEXT): tutorial/daytime2/$(am__dirstamp) \
- tutorial/daytime2/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/daytime2/server$(EXEEXT): $(tutorial_daytime2_server_OBJECTS) $(tutorial_daytime2_server_DEPENDENCIES) $(EXTRA_tutorial_daytime2_server_DEPENDENCIES) tutorial/daytime2/$(am__dirstamp)
- @rm -f tutorial/daytime2/server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime2_server_OBJECTS) $(tutorial_daytime2_server_LDADD) $(LIBS)
-tutorial/daytime3/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime3
- @: > tutorial/daytime3/$(am__dirstamp)
-tutorial/daytime3/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime3/$(DEPDIR)
- @: > tutorial/daytime3/$(DEPDIR)/$(am__dirstamp)
-tutorial/daytime3/server.$(OBJEXT): tutorial/daytime3/$(am__dirstamp) \
- tutorial/daytime3/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/daytime3/server$(EXEEXT): $(tutorial_daytime3_server_OBJECTS) $(tutorial_daytime3_server_DEPENDENCIES) $(EXTRA_tutorial_daytime3_server_DEPENDENCIES) tutorial/daytime3/$(am__dirstamp)
- @rm -f tutorial/daytime3/server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime3_server_OBJECTS) $(tutorial_daytime3_server_LDADD) $(LIBS)
-tutorial/daytime4/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime4
- @: > tutorial/daytime4/$(am__dirstamp)
-tutorial/daytime4/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime4/$(DEPDIR)
- @: > tutorial/daytime4/$(DEPDIR)/$(am__dirstamp)
-tutorial/daytime4/client.$(OBJEXT): tutorial/daytime4/$(am__dirstamp) \
- tutorial/daytime4/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/daytime4/client$(EXEEXT): $(tutorial_daytime4_client_OBJECTS) $(tutorial_daytime4_client_DEPENDENCIES) $(EXTRA_tutorial_daytime4_client_DEPENDENCIES) tutorial/daytime4/$(am__dirstamp)
- @rm -f tutorial/daytime4/client$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime4_client_OBJECTS) $(tutorial_daytime4_client_LDADD) $(LIBS)
-tutorial/daytime5/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime5
- @: > tutorial/daytime5/$(am__dirstamp)
-tutorial/daytime5/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime5/$(DEPDIR)
- @: > tutorial/daytime5/$(DEPDIR)/$(am__dirstamp)
-tutorial/daytime5/server.$(OBJEXT): tutorial/daytime5/$(am__dirstamp) \
- tutorial/daytime5/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/daytime5/server$(EXEEXT): $(tutorial_daytime5_server_OBJECTS) $(tutorial_daytime5_server_DEPENDENCIES) $(EXTRA_tutorial_daytime5_server_DEPENDENCIES) tutorial/daytime5/$(am__dirstamp)
- @rm -f tutorial/daytime5/server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime5_server_OBJECTS) $(tutorial_daytime5_server_LDADD) $(LIBS)
-tutorial/daytime6/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime6
- @: > tutorial/daytime6/$(am__dirstamp)
-tutorial/daytime6/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime6/$(DEPDIR)
- @: > tutorial/daytime6/$(DEPDIR)/$(am__dirstamp)
-tutorial/daytime6/server.$(OBJEXT): tutorial/daytime6/$(am__dirstamp) \
- tutorial/daytime6/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/daytime6/server$(EXEEXT): $(tutorial_daytime6_server_OBJECTS) $(tutorial_daytime6_server_DEPENDENCIES) $(EXTRA_tutorial_daytime6_server_DEPENDENCIES) tutorial/daytime6/$(am__dirstamp)
- @rm -f tutorial/daytime6/server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime6_server_OBJECTS) $(tutorial_daytime6_server_LDADD) $(LIBS)
-tutorial/daytime7/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime7
- @: > tutorial/daytime7/$(am__dirstamp)
-tutorial/daytime7/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/daytime7/$(DEPDIR)
- @: > tutorial/daytime7/$(DEPDIR)/$(am__dirstamp)
-tutorial/daytime7/server.$(OBJEXT): tutorial/daytime7/$(am__dirstamp) \
- tutorial/daytime7/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/daytime7/server$(EXEEXT): $(tutorial_daytime7_server_OBJECTS) $(tutorial_daytime7_server_DEPENDENCIES) $(EXTRA_tutorial_daytime7_server_DEPENDENCIES) tutorial/daytime7/$(am__dirstamp)
- @rm -f tutorial/daytime7/server$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime7_server_OBJECTS) $(tutorial_daytime7_server_LDADD) $(LIBS)
-tutorial/timer1/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer1
- @: > tutorial/timer1/$(am__dirstamp)
-tutorial/timer1/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer1/$(DEPDIR)
- @: > tutorial/timer1/$(DEPDIR)/$(am__dirstamp)
-tutorial/timer1/timer.$(OBJEXT): tutorial/timer1/$(am__dirstamp) \
- tutorial/timer1/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/timer1/timer$(EXEEXT): $(tutorial_timer1_timer_OBJECTS) $(tutorial_timer1_timer_DEPENDENCIES) $(EXTRA_tutorial_timer1_timer_DEPENDENCIES) tutorial/timer1/$(am__dirstamp)
- @rm -f tutorial/timer1/timer$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer1_timer_OBJECTS) $(tutorial_timer1_timer_LDADD) $(LIBS)
-tutorial/timer2/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer2
- @: > tutorial/timer2/$(am__dirstamp)
-tutorial/timer2/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer2/$(DEPDIR)
- @: > tutorial/timer2/$(DEPDIR)/$(am__dirstamp)
-tutorial/timer2/timer.$(OBJEXT): tutorial/timer2/$(am__dirstamp) \
- tutorial/timer2/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/timer2/timer$(EXEEXT): $(tutorial_timer2_timer_OBJECTS) $(tutorial_timer2_timer_DEPENDENCIES) $(EXTRA_tutorial_timer2_timer_DEPENDENCIES) tutorial/timer2/$(am__dirstamp)
- @rm -f tutorial/timer2/timer$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer2_timer_OBJECTS) $(tutorial_timer2_timer_LDADD) $(LIBS)
-tutorial/timer3/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer3
- @: > tutorial/timer3/$(am__dirstamp)
-tutorial/timer3/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer3/$(DEPDIR)
- @: > tutorial/timer3/$(DEPDIR)/$(am__dirstamp)
-tutorial/timer3/timer.$(OBJEXT): tutorial/timer3/$(am__dirstamp) \
- tutorial/timer3/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/timer3/timer$(EXEEXT): $(tutorial_timer3_timer_OBJECTS) $(tutorial_timer3_timer_DEPENDENCIES) $(EXTRA_tutorial_timer3_timer_DEPENDENCIES) tutorial/timer3/$(am__dirstamp)
- @rm -f tutorial/timer3/timer$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer3_timer_OBJECTS) $(tutorial_timer3_timer_LDADD) $(LIBS)
-tutorial/timer4/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer4
- @: > tutorial/timer4/$(am__dirstamp)
-tutorial/timer4/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer4/$(DEPDIR)
- @: > tutorial/timer4/$(DEPDIR)/$(am__dirstamp)
-tutorial/timer4/timer.$(OBJEXT): tutorial/timer4/$(am__dirstamp) \
- tutorial/timer4/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/timer4/timer$(EXEEXT): $(tutorial_timer4_timer_OBJECTS) $(tutorial_timer4_timer_DEPENDENCIES) $(EXTRA_tutorial_timer4_timer_DEPENDENCIES) tutorial/timer4/$(am__dirstamp)
- @rm -f tutorial/timer4/timer$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer4_timer_OBJECTS) $(tutorial_timer4_timer_LDADD) $(LIBS)
-tutorial/timer5/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer5
- @: > tutorial/timer5/$(am__dirstamp)
-tutorial/timer5/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) tutorial/timer5/$(DEPDIR)
- @: > tutorial/timer5/$(DEPDIR)/$(am__dirstamp)
-tutorial/timer5/timer.$(OBJEXT): tutorial/timer5/$(am__dirstamp) \
- tutorial/timer5/$(DEPDIR)/$(am__dirstamp)
-
-tutorial/timer5/timer$(EXEEXT): $(tutorial_timer5_timer_OBJECTS) $(tutorial_timer5_timer_DEPENDENCIES) $(EXTRA_tutorial_timer5_timer_DEPENDENCIES) tutorial/timer5/$(am__dirstamp)
- @rm -f tutorial/timer5/timer$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer5_timer_OBJECTS) $(tutorial_timer5_timer_LDADD) $(LIBS)
-windows/$(am__dirstamp):
- @$(MKDIR_P) windows
- @: > windows/$(am__dirstamp)
-windows/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) windows/$(DEPDIR)
- @: > windows/$(DEPDIR)/$(am__dirstamp)
-windows/transmit_file.$(OBJEXT): windows/$(am__dirstamp) \
- windows/$(DEPDIR)/$(am__dirstamp)
-
-windows/transmit_file$(EXEEXT): $(windows_transmit_file_OBJECTS) $(windows_transmit_file_DEPENDENCIES) $(EXTRA_windows_transmit_file_DEPENDENCIES) windows/$(am__dirstamp)
- @rm -f windows/transmit_file$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(windows_transmit_file_OBJECTS) $(windows_transmit_file_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
- -rm -f ../../*.$(OBJEXT)
- -rm -f allocation/*.$(OBJEXT)
- -rm -f buffers/*.$(OBJEXT)
- -rm -f chat/*.$(OBJEXT)
- -rm -f echo/*.$(OBJEXT)
- -rm -f fork/*.$(OBJEXT)
- -rm -f http/client/*.$(OBJEXT)
- -rm -f http/server/*.$(OBJEXT)
- -rm -f http/server2/*.$(OBJEXT)
- -rm -f http/server3/*.$(OBJEXT)
- -rm -f http/server4/*.$(OBJEXT)
- -rm -f icmp/*.$(OBJEXT)
- -rm -f invocation/*.$(OBJEXT)
- -rm -f iostreams/*.$(OBJEXT)
- -rm -f local/*.$(OBJEXT)
- -rm -f multicast/*.$(OBJEXT)
- -rm -f nonblocking/*.$(OBJEXT)
- -rm -f porthopper/*.$(OBJEXT)
- -rm -f services/*.$(OBJEXT)
- -rm -f socks4/*.$(OBJEXT)
- -rm -f spawn/*.$(OBJEXT)
- -rm -f ssl/*.$(OBJEXT)
- -rm -f timeouts/*.$(OBJEXT)
- -rm -f timers/*.$(OBJEXT)
- -rm -f tutorial/daytime1/*.$(OBJEXT)
- -rm -f tutorial/daytime2/*.$(OBJEXT)
- -rm -f tutorial/daytime3/*.$(OBJEXT)
- -rm -f tutorial/daytime4/*.$(OBJEXT)
- -rm -f tutorial/daytime5/*.$(OBJEXT)
- -rm -f tutorial/daytime6/*.$(OBJEXT)
- -rm -f tutorial/daytime7/*.$(OBJEXT)
- -rm -f tutorial/timer1/*.$(OBJEXT)
- -rm -f tutorial/timer2/*.$(OBJEXT)
- -rm -f tutorial/timer3/*.$(OBJEXT)
- -rm -f tutorial/timer4/*.$(OBJEXT)
- -rm -f tutorial/timer5/*.$(OBJEXT)
- -rm -f windows/*.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/asio.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/asio_ssl.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@allocation/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@buffers/$(DEPDIR)/reference_counted.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@chat/$(DEPDIR)/chat_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@chat/$(DEPDIR)/chat_server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@chat/$(DEPDIR)/posix_chat_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@echo/$(DEPDIR)/async_tcp_echo_server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@echo/$(DEPDIR)/async_udp_echo_server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@echo/$(DEPDIR)/blocking_tcp_echo_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@echo/$(DEPDIR)/blocking_tcp_echo_server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@echo/$(DEPDIR)/blocking_udp_echo_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@echo/$(DEPDIR)/blocking_udp_echo_server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@fork/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@fork/$(DEPDIR)/process_per_connection.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/client/$(DEPDIR)/async_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/client/$(DEPDIR)/sync_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/connection.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/connection_manager.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/mime_types.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/reply.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/request_handler.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/request_parser.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/connection.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/io_context_pool.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/mime_types.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/reply.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/request_handler.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/request_parser.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/connection.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/mime_types.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/reply.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/request_handler.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/request_parser.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/file_handler.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/mime_types.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/reply.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/request_parser.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@icmp/$(DEPDIR)/ping.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@invocation/$(DEPDIR)/prioritised_handlers.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@iostreams/$(DEPDIR)/daytime_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@iostreams/$(DEPDIR)/daytime_server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@iostreams/$(DEPDIR)/http_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/connect_pair.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/iostream_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/stream_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/stream_server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@multicast/$(DEPDIR)/receiver.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@multicast/$(DEPDIR)/sender.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@nonblocking/$(DEPDIR)/third_party_lib.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@porthopper/$(DEPDIR)/client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@porthopper/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@services/$(DEPDIR)/daytime_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@services/$(DEPDIR)/logger_service.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@socks4/$(DEPDIR)/sync_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@spawn/$(DEPDIR)/echo_server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@spawn/$(DEPDIR)/parallel_grep.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@ssl/$(DEPDIR)/client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@ssl/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@timeouts/$(DEPDIR)/async_tcp_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@timeouts/$(DEPDIR)/blocking_tcp_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@timeouts/$(DEPDIR)/blocking_token_tcp_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@timeouts/$(DEPDIR)/blocking_udp_client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@timeouts/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@timers/$(DEPDIR)/time_t_timer.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime1/$(DEPDIR)/client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime2/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime3/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime4/$(DEPDIR)/client.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime5/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime6/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime7/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer1/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer2/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer3/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer4/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer5/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@windows/$(DEPDIR)/transmit_file.Po@am__quote@ # am--include-marker
-
-$(am__depfiles_remade):
- @$(MKDIR_P) $(@D)
- @echo '# dummy' >$@-t && $(am__mv) $@-t $@
-
-am--depfiles: $(am__depfiles_remade)
-
-.cpp.o:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(HEADERS)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
- -rm -f ../../$(DEPDIR)/$(am__dirstamp)
- -rm -f ../../$(am__dirstamp)
- -rm -f allocation/$(DEPDIR)/$(am__dirstamp)
- -rm -f allocation/$(am__dirstamp)
- -rm -f buffers/$(DEPDIR)/$(am__dirstamp)
- -rm -f buffers/$(am__dirstamp)
- -rm -f chat/$(DEPDIR)/$(am__dirstamp)
- -rm -f chat/$(am__dirstamp)
- -rm -f echo/$(DEPDIR)/$(am__dirstamp)
- -rm -f echo/$(am__dirstamp)
- -rm -f fork/$(DEPDIR)/$(am__dirstamp)
- -rm -f fork/$(am__dirstamp)
- -rm -f http/client/$(DEPDIR)/$(am__dirstamp)
- -rm -f http/client/$(am__dirstamp)
- -rm -f http/server/$(DEPDIR)/$(am__dirstamp)
- -rm -f http/server/$(am__dirstamp)
- -rm -f http/server2/$(DEPDIR)/$(am__dirstamp)
- -rm -f http/server2/$(am__dirstamp)
- -rm -f http/server3/$(DEPDIR)/$(am__dirstamp)
- -rm -f http/server3/$(am__dirstamp)
- -rm -f http/server4/$(DEPDIR)/$(am__dirstamp)
- -rm -f http/server4/$(am__dirstamp)
- -rm -f icmp/$(DEPDIR)/$(am__dirstamp)
- -rm -f icmp/$(am__dirstamp)
- -rm -f invocation/$(DEPDIR)/$(am__dirstamp)
- -rm -f invocation/$(am__dirstamp)
- -rm -f iostreams/$(DEPDIR)/$(am__dirstamp)
- -rm -f iostreams/$(am__dirstamp)
- -rm -f local/$(DEPDIR)/$(am__dirstamp)
- -rm -f local/$(am__dirstamp)
- -rm -f multicast/$(DEPDIR)/$(am__dirstamp)
- -rm -f multicast/$(am__dirstamp)
- -rm -f nonblocking/$(DEPDIR)/$(am__dirstamp)
- -rm -f nonblocking/$(am__dirstamp)
- -rm -f porthopper/$(DEPDIR)/$(am__dirstamp)
- -rm -f porthopper/$(am__dirstamp)
- -rm -f services/$(DEPDIR)/$(am__dirstamp)
- -rm -f services/$(am__dirstamp)
- -rm -f socks4/$(DEPDIR)/$(am__dirstamp)
- -rm -f socks4/$(am__dirstamp)
- -rm -f spawn/$(DEPDIR)/$(am__dirstamp)
- -rm -f spawn/$(am__dirstamp)
- -rm -f ssl/$(DEPDIR)/$(am__dirstamp)
- -rm -f ssl/$(am__dirstamp)
- -rm -f timeouts/$(DEPDIR)/$(am__dirstamp)
- -rm -f timeouts/$(am__dirstamp)
- -rm -f timers/$(DEPDIR)/$(am__dirstamp)
- -rm -f timers/$(am__dirstamp)
- -rm -f tutorial/daytime1/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/daytime1/$(am__dirstamp)
- -rm -f tutorial/daytime2/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/daytime2/$(am__dirstamp)
- -rm -f tutorial/daytime3/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/daytime3/$(am__dirstamp)
- -rm -f tutorial/daytime4/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/daytime4/$(am__dirstamp)
- -rm -f tutorial/daytime5/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/daytime5/$(am__dirstamp)
- -rm -f tutorial/daytime6/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/daytime6/$(am__dirstamp)
- -rm -f tutorial/daytime7/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/daytime7/$(am__dirstamp)
- -rm -f tutorial/timer1/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/timer1/$(am__dirstamp)
- -rm -f tutorial/timer2/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/timer2/$(am__dirstamp)
- -rm -f tutorial/timer3/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/timer3/$(am__dirstamp)
- -rm -f tutorial/timer4/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/timer4/$(am__dirstamp)
- -rm -f tutorial/timer5/$(DEPDIR)/$(am__dirstamp)
- -rm -f tutorial/timer5/$(am__dirstamp)
- -rm -f windows/$(DEPDIR)/$(am__dirstamp)
- -rm -f windows/$(am__dirstamp)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -f ../../$(DEPDIR)/asio.Po
- -rm -f ../../$(DEPDIR)/asio_ssl.Po
- -rm -f allocation/$(DEPDIR)/server.Po
- -rm -f buffers/$(DEPDIR)/reference_counted.Po
- -rm -f chat/$(DEPDIR)/chat_client.Po
- -rm -f chat/$(DEPDIR)/chat_server.Po
- -rm -f chat/$(DEPDIR)/posix_chat_client.Po
- -rm -f echo/$(DEPDIR)/async_tcp_echo_server.Po
- -rm -f echo/$(DEPDIR)/async_udp_echo_server.Po
- -rm -f echo/$(DEPDIR)/blocking_tcp_echo_client.Po
- -rm -f echo/$(DEPDIR)/blocking_tcp_echo_server.Po
- -rm -f echo/$(DEPDIR)/blocking_udp_echo_client.Po
- -rm -f echo/$(DEPDIR)/blocking_udp_echo_server.Po
- -rm -f fork/$(DEPDIR)/daemon.Po
- -rm -f fork/$(DEPDIR)/process_per_connection.Po
- -rm -f http/client/$(DEPDIR)/async_client.Po
- -rm -f http/client/$(DEPDIR)/sync_client.Po
- -rm -f http/server/$(DEPDIR)/connection.Po
- -rm -f http/server/$(DEPDIR)/connection_manager.Po
- -rm -f http/server/$(DEPDIR)/main.Po
- -rm -f http/server/$(DEPDIR)/mime_types.Po
- -rm -f http/server/$(DEPDIR)/reply.Po
- -rm -f http/server/$(DEPDIR)/request_handler.Po
- -rm -f http/server/$(DEPDIR)/request_parser.Po
- -rm -f http/server/$(DEPDIR)/server.Po
- -rm -f http/server2/$(DEPDIR)/connection.Po
- -rm -f http/server2/$(DEPDIR)/io_context_pool.Po
- -rm -f http/server2/$(DEPDIR)/main.Po
- -rm -f http/server2/$(DEPDIR)/mime_types.Po
- -rm -f http/server2/$(DEPDIR)/reply.Po
- -rm -f http/server2/$(DEPDIR)/request_handler.Po
- -rm -f http/server2/$(DEPDIR)/request_parser.Po
- -rm -f http/server2/$(DEPDIR)/server.Po
- -rm -f http/server3/$(DEPDIR)/connection.Po
- -rm -f http/server3/$(DEPDIR)/main.Po
- -rm -f http/server3/$(DEPDIR)/mime_types.Po
- -rm -f http/server3/$(DEPDIR)/reply.Po
- -rm -f http/server3/$(DEPDIR)/request_handler.Po
- -rm -f http/server3/$(DEPDIR)/request_parser.Po
- -rm -f http/server3/$(DEPDIR)/server.Po
- -rm -f http/server4/$(DEPDIR)/file_handler.Po
- -rm -f http/server4/$(DEPDIR)/main.Po
- -rm -f http/server4/$(DEPDIR)/mime_types.Po
- -rm -f http/server4/$(DEPDIR)/reply.Po
- -rm -f http/server4/$(DEPDIR)/request_parser.Po
- -rm -f http/server4/$(DEPDIR)/server.Po
- -rm -f icmp/$(DEPDIR)/ping.Po
- -rm -f invocation/$(DEPDIR)/prioritised_handlers.Po
- -rm -f iostreams/$(DEPDIR)/daytime_client.Po
- -rm -f iostreams/$(DEPDIR)/daytime_server.Po
- -rm -f iostreams/$(DEPDIR)/http_client.Po
- -rm -f local/$(DEPDIR)/connect_pair.Po
- -rm -f local/$(DEPDIR)/iostream_client.Po
- -rm -f local/$(DEPDIR)/stream_client.Po
- -rm -f local/$(DEPDIR)/stream_server.Po
- -rm -f multicast/$(DEPDIR)/receiver.Po
- -rm -f multicast/$(DEPDIR)/sender.Po
- -rm -f nonblocking/$(DEPDIR)/third_party_lib.Po
- -rm -f porthopper/$(DEPDIR)/client.Po
- -rm -f porthopper/$(DEPDIR)/server.Po
- -rm -f services/$(DEPDIR)/daytime_client.Po
- -rm -f services/$(DEPDIR)/logger_service.Po
- -rm -f socks4/$(DEPDIR)/sync_client.Po
- -rm -f spawn/$(DEPDIR)/echo_server.Po
- -rm -f spawn/$(DEPDIR)/parallel_grep.Po
- -rm -f ssl/$(DEPDIR)/client.Po
- -rm -f ssl/$(DEPDIR)/server.Po
- -rm -f timeouts/$(DEPDIR)/async_tcp_client.Po
- -rm -f timeouts/$(DEPDIR)/blocking_tcp_client.Po
- -rm -f timeouts/$(DEPDIR)/blocking_token_tcp_client.Po
- -rm -f timeouts/$(DEPDIR)/blocking_udp_client.Po
- -rm -f timeouts/$(DEPDIR)/server.Po
- -rm -f timers/$(DEPDIR)/time_t_timer.Po
- -rm -f tutorial/daytime1/$(DEPDIR)/client.Po
- -rm -f tutorial/daytime2/$(DEPDIR)/server.Po
- -rm -f tutorial/daytime3/$(DEPDIR)/server.Po
- -rm -f tutorial/daytime4/$(DEPDIR)/client.Po
- -rm -f tutorial/daytime5/$(DEPDIR)/server.Po
- -rm -f tutorial/daytime6/$(DEPDIR)/server.Po
- -rm -f tutorial/daytime7/$(DEPDIR)/server.Po
- -rm -f tutorial/timer1/$(DEPDIR)/timer.Po
- -rm -f tutorial/timer2/$(DEPDIR)/timer.Po
- -rm -f tutorial/timer3/$(DEPDIR)/timer.Po
- -rm -f tutorial/timer4/$(DEPDIR)/timer.Po
- -rm -f tutorial/timer5/$(DEPDIR)/timer.Po
- -rm -f windows/$(DEPDIR)/transmit_file.Po
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f ../../$(DEPDIR)/asio.Po
- -rm -f ../../$(DEPDIR)/asio_ssl.Po
- -rm -f allocation/$(DEPDIR)/server.Po
- -rm -f buffers/$(DEPDIR)/reference_counted.Po
- -rm -f chat/$(DEPDIR)/chat_client.Po
- -rm -f chat/$(DEPDIR)/chat_server.Po
- -rm -f chat/$(DEPDIR)/posix_chat_client.Po
- -rm -f echo/$(DEPDIR)/async_tcp_echo_server.Po
- -rm -f echo/$(DEPDIR)/async_udp_echo_server.Po
- -rm -f echo/$(DEPDIR)/blocking_tcp_echo_client.Po
- -rm -f echo/$(DEPDIR)/blocking_tcp_echo_server.Po
- -rm -f echo/$(DEPDIR)/blocking_udp_echo_client.Po
- -rm -f echo/$(DEPDIR)/blocking_udp_echo_server.Po
- -rm -f fork/$(DEPDIR)/daemon.Po
- -rm -f fork/$(DEPDIR)/process_per_connection.Po
- -rm -f http/client/$(DEPDIR)/async_client.Po
- -rm -f http/client/$(DEPDIR)/sync_client.Po
- -rm -f http/server/$(DEPDIR)/connection.Po
- -rm -f http/server/$(DEPDIR)/connection_manager.Po
- -rm -f http/server/$(DEPDIR)/main.Po
- -rm -f http/server/$(DEPDIR)/mime_types.Po
- -rm -f http/server/$(DEPDIR)/reply.Po
- -rm -f http/server/$(DEPDIR)/request_handler.Po
- -rm -f http/server/$(DEPDIR)/request_parser.Po
- -rm -f http/server/$(DEPDIR)/server.Po
- -rm -f http/server2/$(DEPDIR)/connection.Po
- -rm -f http/server2/$(DEPDIR)/io_context_pool.Po
- -rm -f http/server2/$(DEPDIR)/main.Po
- -rm -f http/server2/$(DEPDIR)/mime_types.Po
- -rm -f http/server2/$(DEPDIR)/reply.Po
- -rm -f http/server2/$(DEPDIR)/request_handler.Po
- -rm -f http/server2/$(DEPDIR)/request_parser.Po
- -rm -f http/server2/$(DEPDIR)/server.Po
- -rm -f http/server3/$(DEPDIR)/connection.Po
- -rm -f http/server3/$(DEPDIR)/main.Po
- -rm -f http/server3/$(DEPDIR)/mime_types.Po
- -rm -f http/server3/$(DEPDIR)/reply.Po
- -rm -f http/server3/$(DEPDIR)/request_handler.Po
- -rm -f http/server3/$(DEPDIR)/request_parser.Po
- -rm -f http/server3/$(DEPDIR)/server.Po
- -rm -f http/server4/$(DEPDIR)/file_handler.Po
- -rm -f http/server4/$(DEPDIR)/main.Po
- -rm -f http/server4/$(DEPDIR)/mime_types.Po
- -rm -f http/server4/$(DEPDIR)/reply.Po
- -rm -f http/server4/$(DEPDIR)/request_parser.Po
- -rm -f http/server4/$(DEPDIR)/server.Po
- -rm -f icmp/$(DEPDIR)/ping.Po
- -rm -f invocation/$(DEPDIR)/prioritised_handlers.Po
- -rm -f iostreams/$(DEPDIR)/daytime_client.Po
- -rm -f iostreams/$(DEPDIR)/daytime_server.Po
- -rm -f iostreams/$(DEPDIR)/http_client.Po
- -rm -f local/$(DEPDIR)/connect_pair.Po
- -rm -f local/$(DEPDIR)/iostream_client.Po
- -rm -f local/$(DEPDIR)/stream_client.Po
- -rm -f local/$(DEPDIR)/stream_server.Po
- -rm -f multicast/$(DEPDIR)/receiver.Po
- -rm -f multicast/$(DEPDIR)/sender.Po
- -rm -f nonblocking/$(DEPDIR)/third_party_lib.Po
- -rm -f porthopper/$(DEPDIR)/client.Po
- -rm -f porthopper/$(DEPDIR)/server.Po
- -rm -f services/$(DEPDIR)/daytime_client.Po
- -rm -f services/$(DEPDIR)/logger_service.Po
- -rm -f socks4/$(DEPDIR)/sync_client.Po
- -rm -f spawn/$(DEPDIR)/echo_server.Po
- -rm -f spawn/$(DEPDIR)/parallel_grep.Po
- -rm -f ssl/$(DEPDIR)/client.Po
- -rm -f ssl/$(DEPDIR)/server.Po
- -rm -f timeouts/$(DEPDIR)/async_tcp_client.Po
- -rm -f timeouts/$(DEPDIR)/blocking_tcp_client.Po
- -rm -f timeouts/$(DEPDIR)/blocking_token_tcp_client.Po
- -rm -f timeouts/$(DEPDIR)/blocking_udp_client.Po
- -rm -f timeouts/$(DEPDIR)/server.Po
- -rm -f timers/$(DEPDIR)/time_t_timer.Po
- -rm -f tutorial/daytime1/$(DEPDIR)/client.Po
- -rm -f tutorial/daytime2/$(DEPDIR)/server.Po
- -rm -f tutorial/daytime3/$(DEPDIR)/server.Po
- -rm -f tutorial/daytime4/$(DEPDIR)/client.Po
- -rm -f tutorial/daytime5/$(DEPDIR)/server.Po
- -rm -f tutorial/daytime6/$(DEPDIR)/server.Po
- -rm -f tutorial/daytime7/$(DEPDIR)/server.Po
- -rm -f tutorial/timer1/$(DEPDIR)/timer.Po
- -rm -f tutorial/timer2/$(DEPDIR)/timer.Po
- -rm -f tutorial/timer3/$(DEPDIR)/timer.Po
- -rm -f tutorial/timer4/$(DEPDIR)/timer.Po
- -rm -f tutorial/timer5/$(DEPDIR)/timer.Po
- -rm -f windows/$(DEPDIR)/transmit_file.Po
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
- clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \
- cscopelist-am ctags ctags-am distclean distclean-compile \
- distclean-generic distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am
-
-.PRECIOUS: Makefile
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/3rdparty/asio/src/examples/cpp03/allocation/server.cpp b/3rdparty/asio/src/examples/cpp03/allocation/server.cpp
deleted file mode 100644
index ca69460ff14..00000000000
--- a/3rdparty/asio/src/examples/cpp03/allocation/server.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-//
-// server.cpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <iostream>
-#include <boost/aligned_storage.hpp>
-#include <boost/array.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
-#include "asio.hpp"
-
-using asio::ip::tcp;
-
-// Class to manage the memory to be used for handler-based custom allocation.
-// It contains a single block of memory which may be returned for allocation
-// requests. If the memory is in use when an allocation request is made, the
-// allocator delegates allocation to the global heap.
-class handler_memory
- : private boost::noncopyable
-{
-public:
- handler_memory()
- : in_use_(false)
- {
- }
-
- void* allocate(std::size_t size)
- {
- if (!in_use_ && size < storage_.size)
- {
- in_use_ = true;
- return storage_.address();
- }
- else
- {
- return ::operator new(size);
- }
- }
-
- void deallocate(void* pointer)
- {
- if (pointer == storage_.address())
- {
- in_use_ = false;
- }
- else
- {
- ::operator delete(pointer);
- }
- }
-
-private:
- // Storage space used for handler-based custom memory allocation.
- boost::aligned_storage<1024> storage_;
-
- // Whether the handler-based custom allocation storage has been used.
- bool in_use_;
-};
-
-// The allocator to be associated with the handler objects. This allocator only
-// needs to satisfy the C++11 minimal allocator requirements, plus rebind when
-// targeting C++03.
-template <typename T>
-class handler_allocator
-{
-public:
- typedef T value_type;
-
- explicit handler_allocator(handler_memory& mem)
- : memory_(mem)
- {
- }
-
- template <typename U>
- handler_allocator(const handler_allocator<U>& other)
- : memory_(other.memory_)
- {
- }
-
- template <typename U>
- struct rebind
- {
- typedef handler_allocator<U> other;
- };
-
- bool operator==(const handler_allocator& other) const
- {
- return &memory_ == &other.memory_;
- }
-
- bool operator!=(const handler_allocator& other) const
- {
- return &memory_ != &other.memory_;
- }
-
- T* allocate(std::size_t n) const
- {
- return static_cast<T*>(memory_.allocate(sizeof(T) * n));
- }
-
- void deallocate(T* p, std::size_t /*n*/) const
- {
- return memory_.deallocate(p);
- }
-
-//private:
- // The underlying memory.
- handler_memory& memory_;
-};
-
-// Wrapper class template for handler objects to allow handler memory
-// allocation to be customised. The allocator_type typedef and get_allocator()
-// member function are used by the asynchronous operations to obtain the
-// allocator. Calls to operator() are forwarded to the encapsulated handler.
-template <typename Handler>
-class custom_alloc_handler
-{
-public:
- typedef handler_allocator<Handler> allocator_type;
-
- custom_alloc_handler(handler_memory& m, Handler h)
- : memory_(m),
- handler_(h)
- {
- }
-
- allocator_type get_allocator() const
- {
- return allocator_type(memory_);
- }
-
- template <typename Arg1>
- void operator()(Arg1 arg1)
- {
- handler_(arg1);
- }
-
- template <typename Arg1, typename Arg2>
- void operator()(Arg1 arg1, Arg2 arg2)
- {
- handler_(arg1, arg2);
- }
-
-private:
- handler_memory& memory_;
- Handler handler_;
-};
-
-// Helper function to wrap a handler object to add custom allocation.
-template <typename Handler>
-inline custom_alloc_handler<Handler> make_custom_alloc_handler(
- handler_memory& m, Handler h)
-{
- return custom_alloc_handler<Handler>(m, h);
-}
-
-class session
- : public boost::enable_shared_from_this<session>
-{
-public:
- session(asio::io_context& io_context)
- : socket_(io_context)
- {
- }
-
- tcp::socket& socket()
- {
- return socket_;
- }
-
- void start()
- {
- socket_.async_read_some(asio::buffer(data_),
- make_custom_alloc_handler(handler_memory_,
- boost::bind(&session::handle_read,
- shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred)));
- }
-
- void handle_read(const asio::error_code& error,
- size_t bytes_transferred)
- {
- if (!error)
- {
- asio::async_write(socket_,
- asio::buffer(data_, bytes_transferred),
- make_custom_alloc_handler(handler_memory_,
- boost::bind(&session::handle_write,
- shared_from_this(),
- asio::placeholders::error)));
- }
- }
-
- void handle_write(const asio::error_code& error)
- {
- if (!error)
- {
- socket_.async_read_some(asio::buffer(data_),
- make_custom_alloc_handler(handler_memory_,
- boost::bind(&session::handle_read,
- shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred)));
- }
- }
-
-private:
- // The socket used to communicate with the client.
- tcp::socket socket_;
-
- // Buffer used to store data received from the client.
- boost::array<char, 1024> data_;
-
- // The memory to use for handler-based custom memory allocation.
- handler_memory handler_memory_;
-};
-
-typedef boost::shared_ptr<session> session_ptr;
-
-class server
-{
-public:
- server(asio::io_context& io_context, short port)
- : io_context_(io_context),
- acceptor_(io_context, tcp::endpoint(tcp::v4(), port))
- {
- session_ptr new_session(new session(io_context_));
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&server::handle_accept, this, new_session,
- asio::placeholders::error));
- }
-
- void handle_accept(session_ptr new_session,
- const asio::error_code& error)
- {
- if (!error)
- {
- new_session->start();
- }
-
- new_session.reset(new session(io_context_));
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&server::handle_accept, this, new_session,
- asio::placeholders::error));
- }
-
-private:
- asio::io_context& io_context_;
- tcp::acceptor acceptor_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: server <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- using namespace std; // For atoi.
- server s(io_context, atoi(argv[1]));
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/buffers/reference_counted.cpp b/3rdparty/asio/src/examples/cpp03/buffers/reference_counted.cpp
deleted file mode 100644
index 29750f693dc..00000000000
--- a/3rdparty/asio/src/examples/cpp03/buffers/reference_counted.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// reference_counted.cpp
-// ~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <asio.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-#include <iostream>
-#include <vector>
-
-using asio::ip::tcp;
-
-// A reference-counted non-modifiable buffer class.
-class shared_const_buffer
-{
-public:
- // Construct from a std::string.
- explicit shared_const_buffer(const std::string& data)
- : data_(new std::vector<char>(data.begin(), data.end())),
- buffer_(asio::buffer(*data_))
- {
- }
-
- // Implement the ConstBufferSequence requirements.
- typedef asio::const_buffer value_type;
- typedef const asio::const_buffer* const_iterator;
- const asio::const_buffer* begin() const { return &buffer_; }
- const asio::const_buffer* end() const { return &buffer_ + 1; }
-
-private:
- boost::shared_ptr<std::vector<char> > data_;
- asio::const_buffer buffer_;
-};
-
-class session
- : public boost::enable_shared_from_this<session>
-{
-public:
- session(asio::io_context& io_context)
- : socket_(io_context)
- {
- }
-
- tcp::socket& socket()
- {
- return socket_;
- }
-
- void start()
- {
- using namespace std; // For time_t, time and ctime.
- time_t now = time(0);
- shared_const_buffer buffer(ctime(&now));
- asio::async_write(socket_, buffer,
- boost::bind(&session::handle_write, shared_from_this()));
- }
-
- void handle_write()
- {
- }
-
-private:
- // The socket used to communicate with the client.
- tcp::socket socket_;
-};
-
-typedef boost::shared_ptr<session> session_ptr;
-
-class server
-{
-public:
- server(asio::io_context& io_context, short port)
- : io_context_(io_context),
- acceptor_(io_context, tcp::endpoint(tcp::v4(), port))
- {
- session_ptr new_session(new session(io_context_));
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&server::handle_accept, this, new_session,
- asio::placeholders::error));
- }
-
- void handle_accept(session_ptr new_session,
- const asio::error_code& error)
- {
- if (!error)
- {
- new_session->start();
- }
-
- new_session.reset(new session(io_context_));
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&server::handle_accept, this, new_session,
- asio::placeholders::error));
- }
-
-private:
- asio::io_context& io_context_;
- tcp::acceptor acceptor_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: reference_counted <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- using namespace std; // For atoi.
- server s(io_context, atoi(argv[1]));
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/chat/chat_client.cpp b/3rdparty/asio/src/examples/cpp03/chat/chat_client.cpp
deleted file mode 100644
index 868e7d7bfa3..00000000000
--- a/3rdparty/asio/src/examples/cpp03/chat/chat_client.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-//
-// chat_client.cpp
-// ~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <deque>
-#include <iostream>
-#include <boost/bind/bind.hpp>
-#include "asio.hpp"
-#include "chat_message.hpp"
-
-using asio::ip::tcp;
-
-typedef std::deque<chat_message> chat_message_queue;
-
-class chat_client
-{
-public:
- chat_client(asio::io_context& io_context,
- const tcp::resolver::results_type& endpoints)
- : io_context_(io_context),
- socket_(io_context)
- {
- asio::async_connect(socket_, endpoints,
- boost::bind(&chat_client::handle_connect, this,
- asio::placeholders::error));
- }
-
- void write(const chat_message& msg)
- {
- asio::post(io_context_,
- boost::bind(&chat_client::do_write, this, msg));
- }
-
- void close()
- {
- asio::post(io_context_,
- boost::bind(&chat_client::do_close, this));
- }
-
-private:
-
- void handle_connect(const asio::error_code& error)
- {
- if (!error)
- {
- asio::async_read(socket_,
- asio::buffer(read_msg_.data(), chat_message::header_length),
- boost::bind(&chat_client::handle_read_header, this,
- asio::placeholders::error));
- }
- }
-
- void handle_read_header(const asio::error_code& error)
- {
- if (!error && read_msg_.decode_header())
- {
- asio::async_read(socket_,
- asio::buffer(read_msg_.body(), read_msg_.body_length()),
- boost::bind(&chat_client::handle_read_body, this,
- asio::placeholders::error));
- }
- else
- {
- do_close();
- }
- }
-
- void handle_read_body(const asio::error_code& error)
- {
- if (!error)
- {
- std::cout.write(read_msg_.body(), read_msg_.body_length());
- std::cout << "\n";
- asio::async_read(socket_,
- asio::buffer(read_msg_.data(), chat_message::header_length),
- boost::bind(&chat_client::handle_read_header, this,
- asio::placeholders::error));
- }
- else
- {
- do_close();
- }
- }
-
- void do_write(chat_message msg)
- {
- bool write_in_progress = !write_msgs_.empty();
- write_msgs_.push_back(msg);
- if (!write_in_progress)
- {
- asio::async_write(socket_,
- asio::buffer(write_msgs_.front().data(),
- write_msgs_.front().length()),
- boost::bind(&chat_client::handle_write, this,
- asio::placeholders::error));
- }
- }
-
- void handle_write(const asio::error_code& error)
- {
- if (!error)
- {
- write_msgs_.pop_front();
- if (!write_msgs_.empty())
- {
- asio::async_write(socket_,
- asio::buffer(write_msgs_.front().data(),
- write_msgs_.front().length()),
- boost::bind(&chat_client::handle_write, this,
- asio::placeholders::error));
- }
- }
- else
- {
- do_close();
- }
- }
-
- void do_close()
- {
- socket_.close();
- }
-
-private:
- asio::io_context& io_context_;
- tcp::socket socket_;
- chat_message read_msg_;
- chat_message_queue write_msgs_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cerr << "Usage: chat_client <host> <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- tcp::resolver resolver(io_context);
- tcp::resolver::results_type endpoints = resolver.resolve(argv[1], argv[2]);
-
- chat_client c(io_context, endpoints);
-
- asio::thread t(boost::bind(&asio::io_context::run, &io_context));
-
- char line[chat_message::max_body_length + 1];
- while (std::cin.getline(line, chat_message::max_body_length + 1))
- {
- using namespace std; // For strlen and memcpy.
- chat_message msg;
- msg.body_length(strlen(line));
- memcpy(msg.body(), line, msg.body_length());
- msg.encode_header();
- c.write(msg);
- }
-
- c.close();
- t.join();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/chat/chat_message.hpp b/3rdparty/asio/src/examples/cpp03/chat/chat_message.hpp
deleted file mode 100644
index 26fb04357d0..00000000000
--- a/3rdparty/asio/src/examples/cpp03/chat/chat_message.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// chat_message.hpp
-// ~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 CHAT_MESSAGE_HPP
-#define CHAT_MESSAGE_HPP
-
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-
-class chat_message
-{
-public:
- enum { header_length = 4 };
- enum { max_body_length = 512 };
-
- chat_message()
- : body_length_(0)
- {
- }
-
- const char* data() const
- {
- return data_;
- }
-
- char* data()
- {
- return data_;
- }
-
- size_t length() const
- {
- return header_length + body_length_;
- }
-
- const char* body() const
- {
- return data_ + header_length;
- }
-
- char* body()
- {
- return data_ + header_length;
- }
-
- size_t body_length() const
- {
- return body_length_;
- }
-
- void body_length(size_t new_length)
- {
- body_length_ = new_length;
- if (body_length_ > max_body_length)
- body_length_ = max_body_length;
- }
-
- bool decode_header()
- {
- using namespace std; // For strncat and atoi.
- char header[header_length + 1] = "";
- strncat(header, data_, header_length);
- body_length_ = atoi(header);
- if (body_length_ > max_body_length)
- {
- body_length_ = 0;
- return false;
- }
- return true;
- }
-
- void encode_header()
- {
- using namespace std; // For sprintf and memcpy.
- char header[header_length + 1] = "";
- sprintf(header, "%4d", static_cast<int>(body_length_));
- memcpy(data_, header, header_length);
- }
-
-private:
- char data_[header_length + max_body_length];
- size_t body_length_;
-};
-
-#endif // CHAT_MESSAGE_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/chat/chat_server.cpp b/3rdparty/asio/src/examples/cpp03/chat/chat_server.cpp
deleted file mode 100644
index c8abca218f1..00000000000
--- a/3rdparty/asio/src/examples/cpp03/chat/chat_server.cpp
+++ /dev/null
@@ -1,249 +0,0 @@
-//
-// chat_server.cpp
-// ~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <algorithm>
-#include <cstdlib>
-#include <deque>
-#include <iostream>
-#include <list>
-#include <set>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include "asio.hpp"
-#include "chat_message.hpp"
-
-using asio::ip::tcp;
-
-//----------------------------------------------------------------------
-
-typedef std::deque<chat_message> chat_message_queue;
-
-//----------------------------------------------------------------------
-
-class chat_participant
-{
-public:
- virtual ~chat_participant() {}
- virtual void deliver(const chat_message& msg) = 0;
-};
-
-typedef boost::shared_ptr<chat_participant> chat_participant_ptr;
-
-//----------------------------------------------------------------------
-
-class chat_room
-{
-public:
- void join(chat_participant_ptr participant)
- {
- participants_.insert(participant);
- std::for_each(recent_msgs_.begin(), recent_msgs_.end(),
- boost::bind(&chat_participant::deliver,
- participant, boost::placeholders::_1));
- }
-
- void leave(chat_participant_ptr participant)
- {
- participants_.erase(participant);
- }
-
- void deliver(const chat_message& msg)
- {
- recent_msgs_.push_back(msg);
- while (recent_msgs_.size() > max_recent_msgs)
- recent_msgs_.pop_front();
-
- std::for_each(participants_.begin(), participants_.end(),
- boost::bind(&chat_participant::deliver,
- boost::placeholders::_1, boost::ref(msg)));
- }
-
-private:
- std::set<chat_participant_ptr> participants_;
- enum { max_recent_msgs = 100 };
- chat_message_queue recent_msgs_;
-};
-
-//----------------------------------------------------------------------
-
-class chat_session
- : public chat_participant,
- public boost::enable_shared_from_this<chat_session>
-{
-public:
- chat_session(asio::io_context& io_context, chat_room& room)
- : socket_(io_context),
- room_(room)
- {
- }
-
- tcp::socket& socket()
- {
- return socket_;
- }
-
- void start()
- {
- room_.join(shared_from_this());
- asio::async_read(socket_,
- asio::buffer(read_msg_.data(), chat_message::header_length),
- boost::bind(
- &chat_session::handle_read_header, shared_from_this(),
- asio::placeholders::error));
- }
-
- void deliver(const chat_message& msg)
- {
- bool write_in_progress = !write_msgs_.empty();
- write_msgs_.push_back(msg);
- if (!write_in_progress)
- {
- asio::async_write(socket_,
- asio::buffer(write_msgs_.front().data(),
- write_msgs_.front().length()),
- boost::bind(&chat_session::handle_write, shared_from_this(),
- asio::placeholders::error));
- }
- }
-
- void handle_read_header(const asio::error_code& error)
- {
- if (!error && read_msg_.decode_header())
- {
- asio::async_read(socket_,
- asio::buffer(read_msg_.body(), read_msg_.body_length()),
- boost::bind(&chat_session::handle_read_body, shared_from_this(),
- asio::placeholders::error));
- }
- else
- {
- room_.leave(shared_from_this());
- }
- }
-
- void handle_read_body(const asio::error_code& error)
- {
- if (!error)
- {
- room_.deliver(read_msg_);
- asio::async_read(socket_,
- asio::buffer(read_msg_.data(), chat_message::header_length),
- boost::bind(&chat_session::handle_read_header, shared_from_this(),
- asio::placeholders::error));
- }
- else
- {
- room_.leave(shared_from_this());
- }
- }
-
- void handle_write(const asio::error_code& error)
- {
- if (!error)
- {
- write_msgs_.pop_front();
- if (!write_msgs_.empty())
- {
- asio::async_write(socket_,
- asio::buffer(write_msgs_.front().data(),
- write_msgs_.front().length()),
- boost::bind(&chat_session::handle_write, shared_from_this(),
- asio::placeholders::error));
- }
- }
- else
- {
- room_.leave(shared_from_this());
- }
- }
-
-private:
- tcp::socket socket_;
- chat_room& room_;
- chat_message read_msg_;
- chat_message_queue write_msgs_;
-};
-
-typedef boost::shared_ptr<chat_session> chat_session_ptr;
-
-//----------------------------------------------------------------------
-
-class chat_server
-{
-public:
- chat_server(asio::io_context& io_context,
- const tcp::endpoint& endpoint)
- : io_context_(io_context),
- acceptor_(io_context, endpoint)
- {
- start_accept();
- }
-
- void start_accept()
- {
- chat_session_ptr new_session(new chat_session(io_context_, room_));
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&chat_server::handle_accept, this, new_session,
- asio::placeholders::error));
- }
-
- void handle_accept(chat_session_ptr session,
- const asio::error_code& error)
- {
- if (!error)
- {
- session->start();
- }
-
- start_accept();
- }
-
-private:
- asio::io_context& io_context_;
- tcp::acceptor acceptor_;
- chat_room room_;
-};
-
-typedef boost::shared_ptr<chat_server> chat_server_ptr;
-typedef std::list<chat_server_ptr> chat_server_list;
-
-//----------------------------------------------------------------------
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc < 2)
- {
- std::cerr << "Usage: chat_server <port> [<port> ...]\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- chat_server_list servers;
- for (int i = 1; i < argc; ++i)
- {
- using namespace std; // For atoi.
- tcp::endpoint endpoint(tcp::v4(), atoi(argv[i]));
- chat_server_ptr server(new chat_server(io_context, endpoint));
- servers.push_back(server);
- }
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/chat/posix_chat_client.cpp b/3rdparty/asio/src/examples/cpp03/chat/posix_chat_client.cpp
deleted file mode 100644
index 16f312de63e..00000000000
--- a/3rdparty/asio/src/examples/cpp03/chat/posix_chat_client.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// posix_chat_client.cpp
-// ~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <cstring>
-#include <iostream>
-#include <boost/array.hpp>
-#include <boost/bind/bind.hpp>
-#include "asio.hpp"
-#include "chat_message.hpp"
-
-#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
-
-using asio::ip::tcp;
-namespace posix = asio::posix;
-
-class posix_chat_client
-{
-public:
- posix_chat_client(asio::io_context& io_context,
- const tcp::resolver::results_type& endpoints)
- : socket_(io_context),
- input_(io_context, ::dup(STDIN_FILENO)),
- output_(io_context, ::dup(STDOUT_FILENO)),
- input_buffer_(chat_message::max_body_length)
- {
- asio::async_connect(socket_, endpoints,
- boost::bind(&posix_chat_client::handle_connect, this,
- asio::placeholders::error));
- }
-
-private:
-
- void handle_connect(const asio::error_code& error)
- {
- if (!error)
- {
- // Read the fixed-length header of the next message from the server.
- asio::async_read(socket_,
- asio::buffer(read_msg_.data(), chat_message::header_length),
- boost::bind(&posix_chat_client::handle_read_header, this,
- asio::placeholders::error));
-
- // Read a line of input entered by the user.
- asio::async_read_until(input_, input_buffer_, '\n',
- boost::bind(&posix_chat_client::handle_read_input, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- }
-
- void handle_read_header(const asio::error_code& error)
- {
- if (!error && read_msg_.decode_header())
- {
- // Read the variable-length body of the message from the server.
- asio::async_read(socket_,
- asio::buffer(read_msg_.body(), read_msg_.body_length()),
- boost::bind(&posix_chat_client::handle_read_body, this,
- asio::placeholders::error));
- }
- else
- {
- close();
- }
- }
-
- void handle_read_body(const asio::error_code& error)
- {
- if (!error)
- {
- // Write out the message we just received, terminated by a newline.
- static char eol[] = { '\n' };
- boost::array<asio::const_buffer, 2> buffers = {{
- asio::buffer(read_msg_.body(), read_msg_.body_length()),
- asio::buffer(eol) }};
- asio::async_write(output_, buffers,
- boost::bind(&posix_chat_client::handle_write_output, this,
- asio::placeholders::error));
- }
- else
- {
- close();
- }
- }
-
- void handle_write_output(const asio::error_code& error)
- {
- if (!error)
- {
- // Read the fixed-length header of the next message from the server.
- asio::async_read(socket_,
- asio::buffer(read_msg_.data(), chat_message::header_length),
- boost::bind(&posix_chat_client::handle_read_header, this,
- asio::placeholders::error));
- }
- else
- {
- close();
- }
- }
-
- void handle_read_input(const asio::error_code& error,
- std::size_t length)
- {
- if (!error)
- {
- // Write the message (minus the newline) to the server.
- write_msg_.body_length(length - 1);
- input_buffer_.sgetn(write_msg_.body(), length - 1);
- input_buffer_.consume(1); // Remove newline from input.
- write_msg_.encode_header();
- asio::async_write(socket_,
- asio::buffer(write_msg_.data(), write_msg_.length()),
- boost::bind(&posix_chat_client::handle_write, this,
- asio::placeholders::error));
- }
- else if (error == asio::error::not_found)
- {
- // Didn't get a newline. Send whatever we have.
- write_msg_.body_length(input_buffer_.size());
- input_buffer_.sgetn(write_msg_.body(), input_buffer_.size());
- write_msg_.encode_header();
- asio::async_write(socket_,
- asio::buffer(write_msg_.data(), write_msg_.length()),
- boost::bind(&posix_chat_client::handle_write, this,
- asio::placeholders::error));
- }
- else
- {
- close();
- }
- }
-
- void handle_write(const asio::error_code& error)
- {
- if (!error)
- {
- // Read a line of input entered by the user.
- asio::async_read_until(input_, input_buffer_, '\n',
- boost::bind(&posix_chat_client::handle_read_input, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- else
- {
- close();
- }
- }
-
- void close()
- {
- // Cancel all outstanding asynchronous operations.
- socket_.close();
- input_.close();
- output_.close();
- }
-
-private:
- tcp::socket socket_;
- posix::stream_descriptor input_;
- posix::stream_descriptor output_;
- chat_message read_msg_;
- chat_message write_msg_;
- asio::streambuf input_buffer_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cerr << "Usage: posix_chat_client <host> <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- tcp::resolver resolver(io_context);
- tcp::resolver::results_type endpoints = resolver.resolve(argv[1], argv[2]);
-
- posix_chat_client c(io_context, endpoints);
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
-
-#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
-int main() {}
-#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp b/3rdparty/asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp
deleted file mode 100644
index a0b2eabd173..00000000000
--- a/3rdparty/asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// async_tcp_echo_server.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <iostream>
-#include <boost/bind/bind.hpp>
-#include "asio.hpp"
-
-using asio::ip::tcp;
-
-class session
-{
-public:
- session(asio::io_context& io_context)
- : socket_(io_context)
- {
- }
-
- tcp::socket& socket()
- {
- return socket_;
- }
-
- void start()
- {
- socket_.async_read_some(asio::buffer(data_, max_length),
- boost::bind(&session::handle_read, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
-
-private:
- void handle_read(const asio::error_code& error,
- size_t bytes_transferred)
- {
- if (!error)
- {
- asio::async_write(socket_,
- asio::buffer(data_, bytes_transferred),
- boost::bind(&session::handle_write, this,
- asio::placeholders::error));
- }
- else
- {
- delete this;
- }
- }
-
- void handle_write(const asio::error_code& error)
- {
- if (!error)
- {
- socket_.async_read_some(asio::buffer(data_, max_length),
- boost::bind(&session::handle_read, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- else
- {
- delete this;
- }
- }
-
- tcp::socket socket_;
- enum { max_length = 1024 };
- char data_[max_length];
-};
-
-class server
-{
-public:
- server(asio::io_context& io_context, short port)
- : io_context_(io_context),
- acceptor_(io_context, tcp::endpoint(tcp::v4(), port))
- {
- start_accept();
- }
-
-private:
- void start_accept()
- {
- session* new_session = new session(io_context_);
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&server::handle_accept, this, new_session,
- asio::placeholders::error));
- }
-
- void handle_accept(session* new_session,
- const asio::error_code& error)
- {
- if (!error)
- {
- new_session->start();
- }
- else
- {
- delete new_session;
- }
-
- start_accept();
- }
-
- asio::io_context& io_context_;
- tcp::acceptor acceptor_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: async_tcp_echo_server <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- using namespace std; // For atoi.
- server s(io_context, atoi(argv[1]));
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/echo/async_udp_echo_server.cpp b/3rdparty/asio/src/examples/cpp03/echo/async_udp_echo_server.cpp
deleted file mode 100644
index a9e21d72e4b..00000000000
--- a/3rdparty/asio/src/examples/cpp03/echo/async_udp_echo_server.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// async_udp_echo_server.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <iostream>
-#include <boost/bind/bind.hpp>
-#include "asio.hpp"
-
-using asio::ip::udp;
-
-class server
-{
-public:
- server(asio::io_context& io_context, short port)
- : socket_(io_context, udp::endpoint(udp::v4(), port))
- {
- socket_.async_receive_from(
- asio::buffer(data_, max_length), sender_endpoint_,
- boost::bind(&server::handle_receive_from, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
-
- void handle_receive_from(const asio::error_code& error,
- size_t bytes_recvd)
- {
- if (!error && bytes_recvd > 0)
- {
- socket_.async_send_to(
- asio::buffer(data_, bytes_recvd), sender_endpoint_,
- boost::bind(&server::handle_send_to, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- else
- {
- socket_.async_receive_from(
- asio::buffer(data_, max_length), sender_endpoint_,
- boost::bind(&server::handle_receive_from, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- }
-
- void handle_send_to(const asio::error_code& /*error*/,
- size_t /*bytes_sent*/)
- {
- socket_.async_receive_from(
- asio::buffer(data_, max_length), sender_endpoint_,
- boost::bind(&server::handle_receive_from, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
-
-private:
- udp::socket socket_;
- udp::endpoint sender_endpoint_;
- enum { max_length = 1024 };
- char data_[max_length];
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: async_udp_echo_server <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- using namespace std; // For atoi.
- server s(io_context, atoi(argv[1]));
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp b/3rdparty/asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp
deleted file mode 100644
index 1d39b4ed2e4..00000000000
--- a/3rdparty/asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// blocking_tcp_echo_client.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <cstring>
-#include <iostream>
-#include "asio.hpp"
-
-using asio::ip::tcp;
-
-enum { max_length = 1024 };
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cerr << "Usage: blocking_tcp_echo_client <host> <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- tcp::resolver resolver(io_context);
- tcp::resolver::results_type endpoints =
- resolver.resolve(tcp::v4(), argv[1], argv[2]);
-
- tcp::socket s(io_context);
- asio::connect(s, endpoints);
-
- using namespace std; // For strlen.
- std::cout << "Enter message: ";
- char request[max_length];
- std::cin.getline(request, max_length);
- size_t request_length = strlen(request);
- asio::write(s, asio::buffer(request, request_length));
-
- char reply[max_length];
- size_t reply_length = asio::read(s,
- asio::buffer(reply, request_length));
- std::cout << "Reply is: ";
- std::cout.write(reply, reply_length);
- std::cout << "\n";
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp b/3rdparty/asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp
deleted file mode 100644
index 7828e7bd7d8..00000000000
--- a/3rdparty/asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// blocking_tcp_echo_server.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <iostream>
-#include <boost/bind/bind.hpp>
-#include <boost/smart_ptr.hpp>
-#include "asio.hpp"
-
-using asio::ip::tcp;
-
-const int max_length = 1024;
-
-typedef boost::shared_ptr<tcp::socket> socket_ptr;
-
-void session(socket_ptr sock)
-{
- try
- {
- for (;;)
- {
- char data[max_length];
-
- asio::error_code error;
- size_t length = sock->read_some(asio::buffer(data), error);
- if (error == asio::error::eof)
- break; // Connection closed cleanly by peer.
- else if (error)
- throw asio::system_error(error); // Some other error.
-
- asio::write(*sock, asio::buffer(data, length));
- }
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception in thread: " << e.what() << "\n";
- }
-}
-
-void server(asio::io_context& io_context, unsigned short port)
-{
- tcp::acceptor a(io_context, tcp::endpoint(tcp::v4(), port));
- for (;;)
- {
- socket_ptr sock(new tcp::socket(io_context));
- a.accept(*sock);
- asio::thread t(boost::bind(session, sock));
- }
-}
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: blocking_tcp_echo_server <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- using namespace std; // For atoi.
- server(io_context, atoi(argv[1]));
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp b/3rdparty/asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp
deleted file mode 100644
index ab69f4c9968..00000000000
--- a/3rdparty/asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// blocking_udp_echo_client.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <cstring>
-#include <iostream>
-#include "asio.hpp"
-
-using asio::ip::udp;
-
-enum { max_length = 1024 };
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cerr << "Usage: blocking_udp_echo_client <host> <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- udp::socket s(io_context, udp::endpoint(udp::v4(), 0));
-
- udp::resolver resolver(io_context);
- udp::resolver::results_type endpoints =
- resolver.resolve(udp::v4(), argv[1], argv[2]);
-
- using namespace std; // For strlen.
- std::cout << "Enter message: ";
- char request[max_length];
- std::cin.getline(request, max_length);
- size_t request_length = strlen(request);
- s.send_to(asio::buffer(request, request_length), *endpoints.begin());
-
- char reply[max_length];
- udp::endpoint sender_endpoint;
- size_t reply_length = s.receive_from(
- asio::buffer(reply, max_length), sender_endpoint);
- std::cout << "Reply is: ";
- std::cout.write(reply, reply_length);
- std::cout << "\n";
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp b/3rdparty/asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp
deleted file mode 100644
index 42498a15e9a..00000000000
--- a/3rdparty/asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// blocking_udp_echo_server.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <iostream>
-#include "asio.hpp"
-
-using asio::ip::udp;
-
-enum { max_length = 1024 };
-
-void server(asio::io_context& io_context, unsigned short port)
-{
- udp::socket sock(io_context, udp::endpoint(udp::v4(), port));
- for (;;)
- {
- char data[max_length];
- udp::endpoint sender_endpoint;
- size_t length = sock.receive_from(
- asio::buffer(data, max_length), sender_endpoint);
- sock.send_to(asio::buffer(data, length), sender_endpoint);
- }
-}
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: blocking_udp_echo_server <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- using namespace std; // For atoi.
- server(io_context, atoi(argv[1]));
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/fork/daemon.cpp b/3rdparty/asio/src/examples/cpp03/fork/daemon.cpp
deleted file mode 100644
index ae00d3d6aff..00000000000
--- a/3rdparty/asio/src/examples/cpp03/fork/daemon.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-//
-// daemon.cpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <asio/io_context.hpp>
-#include <asio/ip/udp.hpp>
-#include <asio/signal_set.hpp>
-#include <boost/array.hpp>
-#include <boost/bind/bind.hpp>
-#include <ctime>
-#include <iostream>
-#include <syslog.h>
-#include <unistd.h>
-
-using asio::ip::udp;
-
-class udp_daytime_server
-{
-public:
- udp_daytime_server(asio::io_context& io_context)
- : socket_(io_context, udp::endpoint(udp::v4(), 13))
- {
- start_receive();
- }
-
-private:
- void start_receive()
- {
- socket_.async_receive_from(
- asio::buffer(recv_buffer_), remote_endpoint_,
- boost::bind(&udp_daytime_server::handle_receive,
- this, boost::placeholders::_1));
- }
-
- void handle_receive(const asio::error_code& ec)
- {
- if (!ec)
- {
- using namespace std; // For time_t, time and ctime;
- time_t now = time(0);
- std::string message = ctime(&now);
-
- asio::error_code ignored_ec;
- socket_.send_to(asio::buffer(message),
- remote_endpoint_, 0, ignored_ec);
- }
-
- start_receive();
- }
-
- udp::socket socket_;
- udp::endpoint remote_endpoint_;
- boost::array<char, 1> recv_buffer_;
-};
-
-int main()
-{
- try
- {
- asio::io_context io_context;
-
- // Initialise the server before becoming a daemon. If the process is
- // started from a shell, this means any errors will be reported back to the
- // user.
- udp_daytime_server server(io_context);
-
- // Register signal handlers so that the daemon may be shut down. You may
- // also want to register for other signals, such as SIGHUP to trigger a
- // re-read of a configuration file.
- asio::signal_set signals(io_context, SIGINT, SIGTERM);
- signals.async_wait(
- boost::bind(&asio::io_context::stop, &io_context));
-
- // Inform the io_context that we are about to become a daemon. The
- // io_context cleans up any internal resources, such as threads, that may
- // interfere with forking.
- io_context.notify_fork(asio::io_context::fork_prepare);
-
- // Fork the process and have the parent exit. If the process was started
- // from a shell, this returns control to the user. Forking a new process is
- // also a prerequisite for the subsequent call to setsid().
- if (pid_t pid = fork())
- {
- if (pid > 0)
- {
- // We're in the parent process and need to exit.
- //
- // When the exit() function is used, the program terminates without
- // invoking local variables' destructors. Only global variables are
- // destroyed. As the io_context object is a local variable, this means
- // we do not have to call:
- //
- // io_context.notify_fork(asio::io_context::fork_parent);
- //
- // However, this line should be added before each call to exit() if
- // using a global io_context object. An additional call:
- //
- // io_context.notify_fork(asio::io_context::fork_prepare);
- //
- // should also precede the second fork().
- exit(0);
- }
- else
- {
- syslog(LOG_ERR | LOG_USER, "First fork failed: %m");
- return 1;
- }
- }
-
- // Make the process a new session leader. This detaches it from the
- // terminal.
- setsid();
-
- // A process inherits its working directory from its parent. This could be
- // on a mounted filesystem, which means that the running daemon would
- // prevent this filesystem from being unmounted. Changing to the root
- // directory avoids this problem.
- chdir("/");
-
- // The file mode creation mask is also inherited from the parent process.
- // We don't want to restrict the permissions on files created by the
- // daemon, so the mask is cleared.
- umask(0);
-
- // A second fork ensures the process cannot acquire a controlling terminal.
- if (pid_t pid = fork())
- {
- if (pid > 0)
- {
- exit(0);
- }
- else
- {
- syslog(LOG_ERR | LOG_USER, "Second fork failed: %m");
- return 1;
- }
- }
-
- // Close the standard streams. This decouples the daemon from the terminal
- // that started it.
- close(0);
- close(1);
- close(2);
-
- // We don't want the daemon to have any standard input.
- if (open("/dev/null", O_RDONLY) < 0)
- {
- syslog(LOG_ERR | LOG_USER, "Unable to open /dev/null: %m");
- return 1;
- }
-
- // Send standard output to a log file.
- const char* output = "/tmp/asio.daemon.out";
- const int flags = O_WRONLY | O_CREAT | O_APPEND;
- const mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
- if (open(output, flags, mode) < 0)
- {
- syslog(LOG_ERR | LOG_USER, "Unable to open output file %s: %m", output);
- return 1;
- }
-
- // Also send standard error to the same log file.
- if (dup(1) < 0)
- {
- syslog(LOG_ERR | LOG_USER, "Unable to dup output descriptor: %m");
- return 1;
- }
-
- // Inform the io_context that we have finished becoming a daemon. The
- // io_context uses this opportunity to create any internal file descriptors
- // that need to be private to the new process.
- io_context.notify_fork(asio::io_context::fork_child);
-
- // The io_context can now be used normally.
- syslog(LOG_INFO | LOG_USER, "Daemon started");
- io_context.run();
- syslog(LOG_INFO | LOG_USER, "Daemon stopped");
- }
- catch (std::exception& e)
- {
- syslog(LOG_ERR | LOG_USER, "Exception: %s", e.what());
- std::cerr << "Exception: " << e.what() << std::endl;
- }
-}
diff --git a/3rdparty/asio/src/examples/cpp03/fork/process_per_connection.cpp b/3rdparty/asio/src/examples/cpp03/fork/process_per_connection.cpp
deleted file mode 100644
index 9a54baedac4..00000000000
--- a/3rdparty/asio/src/examples/cpp03/fork/process_per_connection.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// process_per_connection.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <asio/io_context.hpp>
-#include <asio/ip/tcp.hpp>
-#include <asio/signal_set.hpp>
-#include <asio/write.hpp>
-#include <boost/array.hpp>
-#include <boost/bind/bind.hpp>
-#include <cstdlib>
-#include <iostream>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-using asio::ip::tcp;
-
-class server
-{
-public:
- server(asio::io_context& io_context, unsigned short port)
- : io_context_(io_context),
- signal_(io_context, SIGCHLD),
- acceptor_(io_context, tcp::endpoint(tcp::v4(), port)),
- socket_(io_context)
- {
- start_signal_wait();
- start_accept();
- }
-
-private:
- void start_signal_wait()
- {
- signal_.async_wait(boost::bind(&server::handle_signal_wait, this));
- }
-
- void handle_signal_wait()
- {
- // Only the parent process should check for this signal. We can determine
- // whether we are in the parent by checking if the acceptor is still open.
- if (acceptor_.is_open())
- {
- // Reap completed child processes so that we don't end up with zombies.
- int status = 0;
- while (waitpid(-1, &status, WNOHANG) > 0) {}
-
- start_signal_wait();
- }
- }
-
- void start_accept()
- {
- acceptor_.async_accept(socket_,
- boost::bind(&server::handle_accept, this, boost::placeholders::_1));
- }
-
- void handle_accept(const asio::error_code& ec)
- {
- if (!ec)
- {
- // Inform the io_context that we are about to fork. The io_context cleans
- // up any internal resources, such as threads, that may interfere with
- // forking.
- io_context_.notify_fork(asio::io_context::fork_prepare);
-
- if (fork() == 0)
- {
- // Inform the io_context that the fork is finished and that this is the
- // child process. The io_context uses this opportunity to create any
- // internal file descriptors that must be private to the new process.
- io_context_.notify_fork(asio::io_context::fork_child);
-
- // The child won't be accepting new connections, so we can close the
- // acceptor. It remains open in the parent.
- acceptor_.close();
-
- // The child process is not interested in processing the SIGCHLD signal.
- signal_.cancel();
-
- start_read();
- }
- else
- {
- // Inform the io_context that the fork is finished (or failed) and that
- // this is the parent process. The io_context uses this opportunity to
- // recreate any internal resources that were cleaned up during
- // preparation for the fork.
- io_context_.notify_fork(asio::io_context::fork_parent);
-
- socket_.close();
- start_accept();
- }
- }
- else
- {
- std::cerr << "Accept error: " << ec.message() << std::endl;
- start_accept();
- }
- }
-
- void start_read()
- {
- socket_.async_read_some(asio::buffer(data_),
- boost::bind(&server::handle_read, this,
- boost::placeholders::_1, boost::placeholders::_2));
- }
-
- void handle_read(const asio::error_code& ec, std::size_t length)
- {
- if (!ec)
- start_write(length);
- }
-
- void start_write(std::size_t length)
- {
- asio::async_write(socket_, asio::buffer(data_, length),
- boost::bind(&server::handle_write, this, boost::placeholders::_1));
- }
-
- void handle_write(const asio::error_code& ec)
- {
- if (!ec)
- start_read();
- }
-
- asio::io_context& io_context_;
- asio::signal_set signal_;
- tcp::acceptor acceptor_;
- tcp::socket socket_;
- boost::array<char, 1024> data_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: process_per_connection <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- using namespace std; // For atoi.
- server s(io_context, atoi(argv[1]));
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << std::endl;
- }
-}
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/connection.cpp b/3rdparty/asio/src/examples/cpp03/http/server/connection.cpp
deleted file mode 100644
index f9bcad8671e..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/connection.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// connection.cpp
-// ~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "connection.hpp"
-#include <vector>
-#include <boost/bind/bind.hpp>
-#include "connection_manager.hpp"
-#include "request_handler.hpp"
-
-namespace http {
-namespace server {
-
-connection::connection(asio::io_context& io_context,
- connection_manager& manager, request_handler& handler)
- : socket_(io_context),
- connection_manager_(manager),
- request_handler_(handler)
-{
-}
-
-asio::ip::tcp::socket& connection::socket()
-{
- return socket_;
-}
-
-void connection::start()
-{
- socket_.async_read_some(asio::buffer(buffer_),
- boost::bind(&connection::handle_read, shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
-}
-
-void connection::stop()
-{
- socket_.close();
-}
-
-void connection::handle_read(const asio::error_code& e,
- std::size_t bytes_transferred)
-{
- if (!e)
- {
- boost::tribool result;
- boost::tie(result, boost::tuples::ignore) = request_parser_.parse(
- request_, buffer_.data(), buffer_.data() + bytes_transferred);
-
- if (result)
- {
- request_handler_.handle_request(request_, reply_);
- asio::async_write(socket_, reply_.to_buffers(),
- boost::bind(&connection::handle_write, shared_from_this(),
- asio::placeholders::error));
- }
- else if (!result)
- {
- reply_ = reply::stock_reply(reply::bad_request);
- asio::async_write(socket_, reply_.to_buffers(),
- boost::bind(&connection::handle_write, shared_from_this(),
- asio::placeholders::error));
- }
- else
- {
- socket_.async_read_some(asio::buffer(buffer_),
- boost::bind(&connection::handle_read, shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- }
- else if (e != asio::error::operation_aborted)
- {
- connection_manager_.stop(shared_from_this());
- }
-}
-
-void connection::handle_write(const asio::error_code& e)
-{
- if (!e)
- {
- // Initiate graceful connection closure.
- asio::error_code ignored_ec;
- socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec);
- }
-
- if (e != asio::error::operation_aborted)
- {
- connection_manager_.stop(shared_from_this());
- }
-}
-
-} // namespace server
-} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/connection.hpp b/3rdparty/asio/src/examples/cpp03/http/server/connection.hpp
deleted file mode 100644
index 2c842904471..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/connection.hpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// connection.hpp
-// ~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 HTTP_CONNECTION_HPP
-#define HTTP_CONNECTION_HPP
-
-#include <asio.hpp>
-#include <boost/array.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include "reply.hpp"
-#include "request.hpp"
-#include "request_handler.hpp"
-#include "request_parser.hpp"
-
-namespace http {
-namespace server {
-
-class connection_manager;
-
-/// Represents a single connection from a client.
-class connection
- : public boost::enable_shared_from_this<connection>,
- private boost::noncopyable
-{
-public:
- /// Construct a connection with the given io_context.
- explicit connection(asio::io_context& io_context,
- connection_manager& manager, request_handler& handler);
-
- /// Get the socket associated with the connection.
- asio::ip::tcp::socket& socket();
-
- /// Start the first asynchronous operation for the connection.
- void start();
-
- /// Stop all asynchronous operations associated with the connection.
- void stop();
-
-private:
- /// Handle completion of a read operation.
- void handle_read(const asio::error_code& e,
- std::size_t bytes_transferred);
-
- /// Handle completion of a write operation.
- void handle_write(const asio::error_code& e);
-
- /// Socket for the connection.
- asio::ip::tcp::socket socket_;
-
- /// The manager for this connection.
- connection_manager& connection_manager_;
-
- /// The handler used to process the incoming request.
- request_handler& request_handler_;
-
- /// Buffer for incoming data.
- boost::array<char, 8192> buffer_;
-
- /// The incoming request.
- request request_;
-
- /// The parser for the incoming request.
- request_parser request_parser_;
-
- /// The reply to be sent back to the client.
- reply reply_;
-};
-
-typedef boost::shared_ptr<connection> connection_ptr;
-
-} // namespace server
-} // namespace http
-
-#endif // HTTP_CONNECTION_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/connection_manager.cpp b/3rdparty/asio/src/examples/cpp03/http/server/connection_manager.cpp
deleted file mode 100644
index bfcac68a6a4..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/connection_manager.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// connection_manager.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "connection_manager.hpp"
-#include <algorithm>
-#include <boost/bind/bind.hpp>
-
-namespace http {
-namespace server {
-
-void connection_manager::start(connection_ptr c)
-{
- connections_.insert(c);
- c->start();
-}
-
-void connection_manager::stop(connection_ptr c)
-{
- connections_.erase(c);
- c->stop();
-}
-
-void connection_manager::stop_all()
-{
- std::for_each(connections_.begin(), connections_.end(),
- boost::bind(&connection::stop, boost::placeholders::_1));
- connections_.clear();
-}
-
-} // namespace server
-} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/connection_manager.hpp b/3rdparty/asio/src/examples/cpp03/http/server/connection_manager.hpp
deleted file mode 100644
index 723d26e770d..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/connection_manager.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// connection_manager.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 HTTP_CONNECTION_MANAGER_HPP
-#define HTTP_CONNECTION_MANAGER_HPP
-
-#include <set>
-#include <boost/noncopyable.hpp>
-#include "connection.hpp"
-
-namespace http {
-namespace server {
-
-/// Manages open connections so that they may be cleanly stopped when the server
-/// needs to shut down.
-class connection_manager
- : private boost::noncopyable
-{
-public:
- /// Add the specified connection to the manager and start it.
- void start(connection_ptr c);
-
- /// Stop the specified connection.
- void stop(connection_ptr c);
-
- /// Stop all connections.
- void stop_all();
-
-private:
- /// The managed connections.
- std::set<connection_ptr> connections_;
-};
-
-} // namespace server
-} // namespace http
-
-#endif // HTTP_CONNECTION_MANAGER_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/header.hpp b/3rdparty/asio/src/examples/cpp03/http/server/header.hpp
deleted file mode 100644
index bccbf977a9e..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/header.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// header.hpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 HTTP_HEADER_HPP
-#define HTTP_HEADER_HPP
-
-#include <string>
-
-namespace http {
-namespace server {
-
-struct header
-{
- std::string name;
- std::string value;
-};
-
-} // namespace server
-} // namespace http
-
-#endif // HTTP_HEADER_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/main.cpp b/3rdparty/asio/src/examples/cpp03/http/server/main.cpp
deleted file mode 100644
index f66cb447a5e..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/main.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// main.cpp
-// ~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <iostream>
-#include <string>
-#include <asio.hpp>
-#include <boost/bind/bind.hpp>
-#include "server.hpp"
-
-int main(int argc, char* argv[])
-{
- try
- {
- // Check command line arguments.
- if (argc != 4)
- {
- std::cerr << "Usage: http_server <address> <port> <doc_root>\n";
- std::cerr << " For IPv4, try:\n";
- std::cerr << " receiver 0.0.0.0 80 .\n";
- std::cerr << " For IPv6, try:\n";
- std::cerr << " receiver 0::0 80 .\n";
- return 1;
- }
-
- // Initialise the server.
- http::server::server s(argv[1], argv[2], argv[3]);
-
- // Run the server until stopped.
- s.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/mime_types.cpp b/3rdparty/asio/src/examples/cpp03/http/server/mime_types.cpp
deleted file mode 100644
index 7542c690012..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/mime_types.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// mime_types.cpp
-// ~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "mime_types.hpp"
-
-namespace http {
-namespace server {
-namespace mime_types {
-
-struct mapping
-{
- const char* extension;
- const char* mime_type;
-} mappings[] =
-{
- { "gif", "image/gif" },
- { "htm", "text/html" },
- { "html", "text/html" },
- { "jpg", "image/jpeg" },
- { "png", "image/png" },
- { 0, 0 } // Marks end of list.
-};
-
-std::string extension_to_type(const std::string& extension)
-{
- for (mapping* m = mappings; m->extension; ++m)
- {
- if (m->extension == extension)
- {
- return m->mime_type;
- }
- }
-
- return "text/plain";
-}
-
-} // namespace mime_types
-} // namespace server
-} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/mime_types.hpp b/3rdparty/asio/src/examples/cpp03/http/server/mime_types.hpp
deleted file mode 100644
index aef5676104e..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/mime_types.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// mime_types.hpp
-// ~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 HTTP_MIME_TYPES_HPP
-#define HTTP_MIME_TYPES_HPP
-
-#include <string>
-
-namespace http {
-namespace server {
-namespace mime_types {
-
-/// Convert a file extension into a MIME type.
-std::string extension_to_type(const std::string& extension);
-
-} // namespace mime_types
-} // namespace server
-} // namespace http
-
-#endif // HTTP_MIME_TYPES_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/reply.cpp b/3rdparty/asio/src/examples/cpp03/http/server/reply.cpp
deleted file mode 100644
index 70219748a86..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/reply.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-//
-// reply.cpp
-// ~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "reply.hpp"
-#include <string>
-#include <boost/lexical_cast.hpp>
-
-namespace http {
-namespace server {
-
-namespace status_strings {
-
-const std::string ok =
- "HTTP/1.0 200 OK\r\n";
-const std::string created =
- "HTTP/1.0 201 Created\r\n";
-const std::string accepted =
- "HTTP/1.0 202 Accepted\r\n";
-const std::string no_content =
- "HTTP/1.0 204 No Content\r\n";
-const std::string multiple_choices =
- "HTTP/1.0 300 Multiple Choices\r\n";
-const std::string moved_permanently =
- "HTTP/1.0 301 Moved Permanently\r\n";
-const std::string moved_temporarily =
- "HTTP/1.0 302 Moved Temporarily\r\n";
-const std::string not_modified =
- "HTTP/1.0 304 Not Modified\r\n";
-const std::string bad_request =
- "HTTP/1.0 400 Bad Request\r\n";
-const std::string unauthorized =
- "HTTP/1.0 401 Unauthorized\r\n";
-const std::string forbidden =
- "HTTP/1.0 403 Forbidden\r\n";
-const std::string not_found =
- "HTTP/1.0 404 Not Found\r\n";
-const std::string internal_server_error =
- "HTTP/1.0 500 Internal Server Error\r\n";
-const std::string not_implemented =
- "HTTP/1.0 501 Not Implemented\r\n";
-const std::string bad_gateway =
- "HTTP/1.0 502 Bad Gateway\r\n";
-const std::string service_unavailable =
- "HTTP/1.0 503 Service Unavailable\r\n";
-
-asio::const_buffer to_buffer(reply::status_type status)
-{
- switch (status)
- {
- case reply::ok:
- return asio::buffer(ok);
- case reply::created:
- return asio::buffer(created);
- case reply::accepted:
- return asio::buffer(accepted);
- case reply::no_content:
- return asio::buffer(no_content);
- case reply::multiple_choices:
- return asio::buffer(multiple_choices);
- case reply::moved_permanently:
- return asio::buffer(moved_permanently);
- case reply::moved_temporarily:
- return asio::buffer(moved_temporarily);
- case reply::not_modified:
- return asio::buffer(not_modified);
- case reply::bad_request:
- return asio::buffer(bad_request);
- case reply::unauthorized:
- return asio::buffer(unauthorized);
- case reply::forbidden:
- return asio::buffer(forbidden);
- case reply::not_found:
- return asio::buffer(not_found);
- case reply::internal_server_error:
- return asio::buffer(internal_server_error);
- case reply::not_implemented:
- return asio::buffer(not_implemented);
- case reply::bad_gateway:
- return asio::buffer(bad_gateway);
- case reply::service_unavailable:
- return asio::buffer(service_unavailable);
- default:
- return asio::buffer(internal_server_error);
- }
-}
-
-} // namespace status_strings
-
-namespace misc_strings {
-
-const char name_value_separator[] = { ':', ' ' };
-const char crlf[] = { '\r', '\n' };
-
-} // namespace misc_strings
-
-std::vector<asio::const_buffer> reply::to_buffers()
-{
- std::vector<asio::const_buffer> buffers;
- buffers.push_back(status_strings::to_buffer(status));
- for (std::size_t i = 0; i < headers.size(); ++i)
- {
- header& h = headers[i];
- buffers.push_back(asio::buffer(h.name));
- buffers.push_back(asio::buffer(misc_strings::name_value_separator));
- buffers.push_back(asio::buffer(h.value));
- buffers.push_back(asio::buffer(misc_strings::crlf));
- }
- buffers.push_back(asio::buffer(misc_strings::crlf));
- buffers.push_back(asio::buffer(content));
- return buffers;
-}
-
-namespace stock_replies {
-
-const char ok[] = "";
-const char created[] =
- "<html>"
- "<head><title>Created</title></head>"
- "<body><h1>201 Created</h1></body>"
- "</html>";
-const char accepted[] =
- "<html>"
- "<head><title>Accepted</title></head>"
- "<body><h1>202 Accepted</h1></body>"
- "</html>";
-const char no_content[] =
- "<html>"
- "<head><title>No Content</title></head>"
- "<body><h1>204 Content</h1></body>"
- "</html>";
-const char multiple_choices[] =
- "<html>"
- "<head><title>Multiple Choices</title></head>"
- "<body><h1>300 Multiple Choices</h1></body>"
- "</html>";
-const char moved_permanently[] =
- "<html>"
- "<head><title>Moved Permanently</title></head>"
- "<body><h1>301 Moved Permanently</h1></body>"
- "</html>";
-const char moved_temporarily[] =
- "<html>"
- "<head><title>Moved Temporarily</title></head>"
- "<body><h1>302 Moved Temporarily</h1></body>"
- "</html>";
-const char not_modified[] =
- "<html>"
- "<head><title>Not Modified</title></head>"
- "<body><h1>304 Not Modified</h1></body>"
- "</html>";
-const char bad_request[] =
- "<html>"
- "<head><title>Bad Request</title></head>"
- "<body><h1>400 Bad Request</h1></body>"
- "</html>";
-const char unauthorized[] =
- "<html>"
- "<head><title>Unauthorized</title></head>"
- "<body><h1>401 Unauthorized</h1></body>"
- "</html>";
-const char forbidden[] =
- "<html>"
- "<head><title>Forbidden</title></head>"
- "<body><h1>403 Forbidden</h1></body>"
- "</html>";
-const char not_found[] =
- "<html>"
- "<head><title>Not Found</title></head>"
- "<body><h1>404 Not Found</h1></body>"
- "</html>";
-const char internal_server_error[] =
- "<html>"
- "<head><title>Internal Server Error</title></head>"
- "<body><h1>500 Internal Server Error</h1></body>"
- "</html>";
-const char not_implemented[] =
- "<html>"
- "<head><title>Not Implemented</title></head>"
- "<body><h1>501 Not Implemented</h1></body>"
- "</html>";
-const char bad_gateway[] =
- "<html>"
- "<head><title>Bad Gateway</title></head>"
- "<body><h1>502 Bad Gateway</h1></body>"
- "</html>";
-const char service_unavailable[] =
- "<html>"
- "<head><title>Service Unavailable</title></head>"
- "<body><h1>503 Service Unavailable</h1></body>"
- "</html>";
-
-std::string to_string(reply::status_type status)
-{
- switch (status)
- {
- case reply::ok:
- return ok;
- case reply::created:
- return created;
- case reply::accepted:
- return accepted;
- case reply::no_content:
- return no_content;
- case reply::multiple_choices:
- return multiple_choices;
- case reply::moved_permanently:
- return moved_permanently;
- case reply::moved_temporarily:
- return moved_temporarily;
- case reply::not_modified:
- return not_modified;
- case reply::bad_request:
- return bad_request;
- case reply::unauthorized:
- return unauthorized;
- case reply::forbidden:
- return forbidden;
- case reply::not_found:
- return not_found;
- case reply::internal_server_error:
- return internal_server_error;
- case reply::not_implemented:
- return not_implemented;
- case reply::bad_gateway:
- return bad_gateway;
- case reply::service_unavailable:
- return service_unavailable;
- default:
- return internal_server_error;
- }
-}
-
-} // namespace stock_replies
-
-reply reply::stock_reply(reply::status_type status)
-{
- reply rep;
- rep.status = status;
- rep.content = stock_replies::to_string(status);
- rep.headers.resize(2);
- rep.headers[0].name = "Content-Length";
- rep.headers[0].value = boost::lexical_cast<std::string>(rep.content.size());
- rep.headers[1].name = "Content-Type";
- rep.headers[1].value = "text/html";
- return rep;
-}
-
-} // namespace server
-} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/reply.hpp b/3rdparty/asio/src/examples/cpp03/http/server/reply.hpp
deleted file mode 100644
index c8f3f11040d..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/reply.hpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// reply.hpp
-// ~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 HTTP_REPLY_HPP
-#define HTTP_REPLY_HPP
-
-#include <string>
-#include <vector>
-#include <asio.hpp>
-#include "header.hpp"
-
-namespace http {
-namespace server {
-
-/// A reply to be sent to a client.
-struct reply
-{
- /// The status of the reply.
- enum status_type
- {
- ok = 200,
- created = 201,
- accepted = 202,
- no_content = 204,
- multiple_choices = 300,
- moved_permanently = 301,
- moved_temporarily = 302,
- not_modified = 304,
- bad_request = 400,
- unauthorized = 401,
- forbidden = 403,
- not_found = 404,
- internal_server_error = 500,
- not_implemented = 501,
- bad_gateway = 502,
- service_unavailable = 503
- } status;
-
- /// The headers to be included in the reply.
- std::vector<header> headers;
-
- /// The content to be sent in the reply.
- std::string content;
-
- /// Convert the reply into a vector of buffers. The buffers do not own the
- /// underlying memory blocks, therefore the reply object must remain valid and
- /// not be changed until the write operation has completed.
- std::vector<asio::const_buffer> to_buffers();
-
- /// Get a stock reply.
- static reply stock_reply(status_type status);
-};
-
-} // namespace server
-} // namespace http
-
-#endif // HTTP_REPLY_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/request_handler.cpp b/3rdparty/asio/src/examples/cpp03/http/server/request_handler.cpp
deleted file mode 100644
index d86632a9a02..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/request_handler.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// request_handler.cpp
-// ~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "request_handler.hpp"
-#include <fstream>
-#include <sstream>
-#include <string>
-#include <boost/lexical_cast.hpp>
-#include "mime_types.hpp"
-#include "reply.hpp"
-#include "request.hpp"
-
-namespace http {
-namespace server {
-
-request_handler::request_handler(const std::string& doc_root)
- : doc_root_(doc_root)
-{
-}
-
-void request_handler::handle_request(const request& req, reply& rep)
-{
- // Decode url to path.
- std::string request_path;
- if (!url_decode(req.uri, request_path))
- {
- rep = reply::stock_reply(reply::bad_request);
- return;
- }
-
- // Request path must be absolute and not contain "..".
- if (request_path.empty() || request_path[0] != '/'
- || request_path.find("..") != std::string::npos)
- {
- rep = reply::stock_reply(reply::bad_request);
- return;
- }
-
- // If path ends in slash (i.e. is a directory) then add "index.html".
- if (request_path[request_path.size() - 1] == '/')
- {
- request_path += "index.html";
- }
-
- // Determine the file extension.
- std::size_t last_slash_pos = request_path.find_last_of("/");
- std::size_t last_dot_pos = request_path.find_last_of(".");
- std::string extension;
- if (last_dot_pos != std::string::npos && last_dot_pos > last_slash_pos)
- {
- extension = request_path.substr(last_dot_pos + 1);
- }
-
- // Open the file to send back.
- std::string full_path = doc_root_ + request_path;
- std::ifstream is(full_path.c_str(), std::ios::in | std::ios::binary);
- if (!is)
- {
- rep = reply::stock_reply(reply::not_found);
- return;
- }
-
- // Fill out the reply to be sent to the client.
- rep.status = reply::ok;
- char buf[512];
- while (is.read(buf, sizeof(buf)).gcount() > 0)
- rep.content.append(buf, is.gcount());
- rep.headers.resize(2);
- rep.headers[0].name = "Content-Length";
- rep.headers[0].value = boost::lexical_cast<std::string>(rep.content.size());
- rep.headers[1].name = "Content-Type";
- rep.headers[1].value = mime_types::extension_to_type(extension);
-}
-
-bool request_handler::url_decode(const std::string& in, std::string& out)
-{
- out.clear();
- out.reserve(in.size());
- for (std::size_t i = 0; i < in.size(); ++i)
- {
- if (in[i] == '%')
- {
- if (i + 3 <= in.size())
- {
- int value = 0;
- std::istringstream is(in.substr(i + 1, 2));
- if (is >> std::hex >> value)
- {
- out += static_cast<char>(value);
- i += 2;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
- }
- else if (in[i] == '+')
- {
- out += ' ';
- }
- else
- {
- out += in[i];
- }
- }
- return true;
-}
-
-} // namespace server
-} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/request_handler.hpp b/3rdparty/asio/src/examples/cpp03/http/server/request_handler.hpp
deleted file mode 100644
index 413a69f49a5..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/request_handler.hpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// request_handler.hpp
-// ~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 HTTP_REQUEST_HANDLER_HPP
-#define HTTP_REQUEST_HANDLER_HPP
-
-#include <string>
-#include <boost/noncopyable.hpp>
-
-namespace http {
-namespace server {
-
-struct reply;
-struct request;
-
-/// The common handler for all incoming requests.
-class request_handler
- : private boost::noncopyable
-{
-public:
- /// Construct with a directory containing files to be served.
- explicit request_handler(const std::string& doc_root);
-
- /// Handle a request and produce a reply.
- void handle_request(const request& req, reply& rep);
-
-private:
- /// The directory containing the files to be served.
- std::string doc_root_;
-
- /// Perform URL-decoding on a string. Returns false if the encoding was
- /// invalid.
- static bool url_decode(const std::string& in, std::string& out);
-};
-
-} // namespace server
-} // namespace http
-
-#endif // HTTP_REQUEST_HANDLER_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/server.cpp b/3rdparty/asio/src/examples/cpp03/http/server/server.cpp
deleted file mode 100644
index 2b7d11d3323..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/server.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// server.cpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "server.hpp"
-#include <boost/bind/bind.hpp>
-#include <signal.h>
-
-namespace http {
-namespace server {
-
-server::server(const std::string& address, const std::string& port,
- const std::string& doc_root)
- : io_context_(),
- signals_(io_context_),
- acceptor_(io_context_),
- connection_manager_(),
- new_connection_(),
- request_handler_(doc_root)
-{
- // Register to handle the signals that indicate when the server should exit.
- // It is safe to register for the same signal multiple times in a program,
- // provided all registration for the specified signal is made through Asio.
- signals_.add(SIGINT);
- signals_.add(SIGTERM);
-#if defined(SIGQUIT)
- signals_.add(SIGQUIT);
-#endif // defined(SIGQUIT)
- signals_.async_wait(boost::bind(&server::handle_stop, this));
-
- // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
- asio::ip::tcp::resolver resolver(io_context_);
- asio::ip::tcp::endpoint endpoint =
- *resolver.resolve(address, port).begin();
- acceptor_.open(endpoint.protocol());
- acceptor_.set_option(asio::ip::tcp::acceptor::reuse_address(true));
- acceptor_.bind(endpoint);
- acceptor_.listen();
-
- start_accept();
-}
-
-void server::run()
-{
- // The io_context::run() call will block until all asynchronous operations
- // have finished. While the server is running, there is always at least one
- // asynchronous operation outstanding: the asynchronous accept call waiting
- // for new incoming connections.
- io_context_.run();
-}
-
-void server::start_accept()
-{
- new_connection_.reset(new connection(io_context_,
- connection_manager_, request_handler_));
- acceptor_.async_accept(new_connection_->socket(),
- boost::bind(&server::handle_accept, this,
- asio::placeholders::error));
-}
-
-void server::handle_accept(const asio::error_code& e)
-{
- // Check whether the server was stopped by a signal before this completion
- // handler had a chance to run.
- if (!acceptor_.is_open())
- {
- return;
- }
-
- if (!e)
- {
- connection_manager_.start(new_connection_);
- }
-
- start_accept();
-}
-
-void server::handle_stop()
-{
- // The server is stopped by cancelling all outstanding asynchronous
- // operations. Once all operations have finished the io_context::run() call
- // will exit.
- acceptor_.close();
- connection_manager_.stop_all();
-}
-
-} // namespace server
-} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/server.hpp b/3rdparty/asio/src/examples/cpp03/http/server/server.hpp
deleted file mode 100644
index d5d6ee4f343..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server/server.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// server.hpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 HTTP_SERVER_HPP
-#define HTTP_SERVER_HPP
-
-#include <asio.hpp>
-#include <string>
-#include <boost/noncopyable.hpp>
-#include "connection.hpp"
-#include "connection_manager.hpp"
-#include "request_handler.hpp"
-
-namespace http {
-namespace server {
-
-/// The top-level class of the HTTP server.
-class server
- : private boost::noncopyable
-{
-public:
- /// Construct the server to listen on the specified TCP address and port, and
- /// serve up files from the given directory.
- explicit server(const std::string& address, const std::string& port,
- const std::string& doc_root);
-
- /// Run the server's io_context loop.
- void run();
-
-private:
- /// Initiate an asynchronous accept operation.
- void start_accept();
-
- /// Handle completion of an asynchronous accept operation.
- void handle_accept(const asio::error_code& e);
-
- /// Handle a request to stop the server.
- void handle_stop();
-
- /// The io_context used to perform asynchronous operations.
- asio::io_context io_context_;
-
- /// The signal_set is used to register for process termination notifications.
- asio::signal_set signals_;
-
- /// Acceptor used to listen for incoming connections.
- asio::ip::tcp::acceptor acceptor_;
-
- /// The connection manager which owns all live connections.
- connection_manager connection_manager_;
-
- /// The next connection to be accepted.
- connection_ptr new_connection_;
-
- /// The handler for all incoming requests.
- request_handler request_handler_;
-};
-
-} // namespace server
-} // namespace http
-
-#endif // HTTP_SERVER_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/connection.cpp b/3rdparty/asio/src/examples/cpp03/http/server2/connection.cpp
deleted file mode 100644
index 08a99dbaf31..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server2/connection.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// connection.cpp
-// ~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "connection.hpp"
-#include <vector>
-#include <boost/bind/bind.hpp>
-#include "request_handler.hpp"
-
-namespace http {
-namespace server2 {
-
-connection::connection(asio::io_context& io_context,
- request_handler& handler)
- : socket_(io_context),
- request_handler_(handler)
-{
-}
-
-asio::ip::tcp::socket& connection::socket()
-{
- return socket_;
-}
-
-void connection::start()
-{
- socket_.async_read_some(asio::buffer(buffer_),
- boost::bind(&connection::handle_read, shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
-}
-
-void connection::handle_read(const asio::error_code& e,
- std::size_t bytes_transferred)
-{
- if (!e)
- {
- boost::tribool result;
- boost::tie(result, boost::tuples::ignore) = request_parser_.parse(
- request_, buffer_.data(), buffer_.data() + bytes_transferred);
-
- if (result)
- {
- request_handler_.handle_request(request_, reply_);
- asio::async_write(socket_, reply_.to_buffers(),
- boost::bind(&connection::handle_write, shared_from_this(),
- asio::placeholders::error));
- }
- else if (!result)
- {
- reply_ = reply::stock_reply(reply::bad_request);
- asio::async_write(socket_, reply_.to_buffers(),
- boost::bind(&connection::handle_write, shared_from_this(),
- asio::placeholders::error));
- }
- else
- {
- socket_.async_read_some(asio::buffer(buffer_),
- boost::bind(&connection::handle_read, shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- }
-
- // If an error occurs then no new asynchronous operations are started. This
- // means that all shared_ptr references to the connection object will
- // disappear and the object will be destroyed automatically after this
- // handler returns. The connection class's destructor closes the socket.
-}
-
-void connection::handle_write(const asio::error_code& e)
-{
- if (!e)
- {
- // Initiate graceful connection closure.
- asio::error_code ignored_ec;
- socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec);
- }
-
- // No new asynchronous operations are started. This means that all shared_ptr
- // references to the connection object will disappear and the object will be
- // destroyed automatically after this handler returns. The connection class's
- // destructor closes the socket.
-}
-
-} // namespace server2
-} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/connection.cpp b/3rdparty/asio/src/examples/cpp03/http/server3/connection.cpp
deleted file mode 100644
index f46b01bc373..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server3/connection.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// connection.cpp
-// ~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "connection.hpp"
-#include <vector>
-#include <boost/bind/bind.hpp>
-#include "request_handler.hpp"
-
-namespace http {
-namespace server3 {
-
-connection::connection(asio::io_context& io_context,
- request_handler& handler)
- : strand_(asio::make_strand(io_context)),
- socket_(strand_),
- request_handler_(handler)
-{
-}
-
-asio::ip::tcp::socket& connection::socket()
-{
- return socket_;
-}
-
-void connection::start()
-{
- socket_.async_read_some(asio::buffer(buffer_),
- boost::bind(&connection::handle_read, shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
-}
-
-void connection::handle_read(const asio::error_code& e,
- std::size_t bytes_transferred)
-{
- if (!e)
- {
- boost::tribool result;
- boost::tie(result, boost::tuples::ignore) = request_parser_.parse(
- request_, buffer_.data(), buffer_.data() + bytes_transferred);
-
- if (result)
- {
- request_handler_.handle_request(request_, reply_);
- asio::async_write(socket_, reply_.to_buffers(),
- boost::bind(&connection::handle_write, shared_from_this(),
- asio::placeholders::error));
- }
- else if (!result)
- {
- reply_ = reply::stock_reply(reply::bad_request);
- asio::async_write(socket_, reply_.to_buffers(),
- boost::bind(&connection::handle_write, shared_from_this(),
- asio::placeholders::error));
- }
- else
- {
- socket_.async_read_some(asio::buffer(buffer_),
- boost::bind(&connection::handle_read, shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- }
-
- // If an error occurs then no new asynchronous operations are started. This
- // means that all shared_ptr references to the connection object will
- // disappear and the object will be destroyed automatically after this
- // handler returns. The connection class's destructor closes the socket.
-}
-
-void connection::handle_write(const asio::error_code& e)
-{
- if (!e)
- {
- // Initiate graceful connection closure.
- asio::error_code ignored_ec;
- socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec);
- }
-
- // No new asynchronous operations are started. This means that all shared_ptr
- // references to the connection object will disappear and the object will be
- // destroyed automatically after this handler returns. The connection class's
- // destructor closes the socket.
-}
-
-} // namespace server3
-} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/request.hpp b/3rdparty/asio/src/examples/cpp03/http/server4/request.hpp
deleted file mode 100644
index c3642652bcc..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server4/request.hpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// request.hpp
-// ~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 HTTP_SERVER4_REQUEST_HPP
-#define HTTP_SERVER4_REQUEST_HPP
-
-#include <string>
-#include <vector>
-#include "header.hpp"
-
-namespace http {
-namespace server4 {
-
-/// A request received from a client.
-struct request
-{
- /// The request method, e.g. "GET", "POST".
- std::string method;
-
- /// The requested URI, such as a path to a file.
- std::string uri;
-
- /// Major version number, usually 1.
- int http_version_major;
-
- /// Minor version number, usually 0 or 1.
- int http_version_minor;
-
- /// The headers included with the request.
- std::vector<header> headers;
-
- /// The optional content sent with the request.
- std::string content;
-};
-
-} // namespace server4
-} // namespace http
-
-#endif // HTTP_SERVER4_REQUEST_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/request_parser.cpp b/3rdparty/asio/src/examples/cpp03/http/server4/request_parser.cpp
deleted file mode 100644
index 30dad0327fe..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server4/request_parser.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-//
-// request_parser.cpp
-// ~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "request_parser.hpp"
-#include <algorithm>
-#include <cctype>
-#include <boost/lexical_cast.hpp>
-#include "request.hpp"
-
-namespace http {
-namespace server4 {
-
-// Enable the pseudo-keywords reenter, yield and fork.
-#include <asio/yield.hpp>
-
-std::string request_parser::content_length_name_ = "Content-Length";
-
-boost::tribool request_parser::consume(request& req, char c)
-{
- reenter (this)
- {
- req.method.clear();
- req.uri.clear();
- req.http_version_major = 0;
- req.http_version_minor = 0;
- req.headers.clear();
- req.content.clear();
- content_length_ = 0;
-
- // Request method.
- while (is_char(c) && !is_ctl(c) && !is_tspecial(c) && c != ' ')
- {
- req.method.push_back(c);
- yield return boost::indeterminate;
- }
- if (req.method.empty())
- return false;
-
- // Space.
- if (c != ' ') return false;
- yield return boost::indeterminate;
-
- // URI.
- while (!is_ctl(c) && c != ' ')
- {
- req.uri.push_back(c);
- yield return boost::indeterminate;
- }
- if (req.uri.empty()) return false;
-
- // Space.
- if (c != ' ') return false;
- yield return boost::indeterminate;
-
- // HTTP protocol identifier.
- if (c != 'H') return false;
- yield return boost::indeterminate;
- if (c != 'T') return false;
- yield return boost::indeterminate;
- if (c != 'T') return false;
- yield return boost::indeterminate;
- if (c != 'P') return false;
- yield return boost::indeterminate;
-
- // Slash.
- if (c != '/') return false;
- yield return boost::indeterminate;
-
- // Major version number.
- if (!is_digit(c)) return false;
- while (is_digit(c))
- {
- req.http_version_major = req.http_version_major * 10 + c - '0';
- yield return boost::indeterminate;
- }
-
- // Dot.
- if (c != '.') return false;
- yield return boost::indeterminate;
-
- // Minor version number.
- if (!is_digit(c)) return false;
- while (is_digit(c))
- {
- req.http_version_minor = req.http_version_minor * 10 + c - '0';
- yield return boost::indeterminate;
- }
-
- // CRLF.
- if (c != '\r') return false;
- yield return boost::indeterminate;
- if (c != '\n') return false;
- yield return boost::indeterminate;
-
- // Headers.
- while ((is_char(c) && !is_ctl(c) && !is_tspecial(c) && c != '\r')
- || (c == ' ' || c == '\t'))
- {
- if (c == ' ' || c == '\t')
- {
- // Leading whitespace. Must be continuation of previous header's value.
- if (req.headers.empty()) return false;
- while (c == ' ' || c == '\t')
- yield return boost::indeterminate;
- }
- else
- {
- // Start the next header.
- req.headers.push_back(header());
-
- // Header name.
- while (is_char(c) && !is_ctl(c) && !is_tspecial(c) && c != ':')
- {
- req.headers.back().name.push_back(c);
- yield return boost::indeterminate;
- }
-
- // Colon and space separates the header name from the header value.
- if (c != ':') return false;
- yield return boost::indeterminate;
- if (c != ' ') return false;
- yield return boost::indeterminate;
- }
-
- // Header value.
- while (is_char(c) && !is_ctl(c) && c != '\r')
- {
- req.headers.back().value.push_back(c);
- yield return boost::indeterminate;
- }
-
- // CRLF.
- if (c != '\r') return false;
- yield return boost::indeterminate;
- if (c != '\n') return false;
- yield return boost::indeterminate;
- }
-
- // CRLF.
- if (c != '\r') return false;
- yield return boost::indeterminate;
- if (c != '\n') return false;
-
- // Check for optional Content-Length header.
- for (std::size_t i = 0; i < req.headers.size(); ++i)
- {
- if (headers_equal(req.headers[i].name, content_length_name_))
- {
- try
- {
- content_length_ =
- boost::lexical_cast<std::size_t>(req.headers[i].value);
- }
- catch (boost::bad_lexical_cast&)
- {
- return false;
- }
- }
- }
-
- // Content.
- while (req.content.size() < content_length_)
- {
- yield return boost::indeterminate;
- req.content.push_back(c);
- }
- }
-
- return true;
-}
-
-// Disable the pseudo-keywords reenter, yield and fork.
-#include <asio/unyield.hpp>
-
-bool request_parser::is_char(int c)
-{
- return c >= 0 && c <= 127;
-}
-
-bool request_parser::is_ctl(int c)
-{
- return (c >= 0 && c <= 31) || (c == 127);
-}
-
-bool request_parser::is_tspecial(int c)
-{
- switch (c)
- {
- case '(': case ')': case '<': case '>': case '@':
- case ',': case ';': case ':': case '\\': case '"':
- case '/': case '[': case ']': case '?': case '=':
- case '{': case '}': case ' ': case '\t':
- return true;
- default:
- return false;
- }
-}
-
-bool request_parser::is_digit(int c)
-{
- return c >= '0' && c <= '9';
-}
-
-bool request_parser::tolower_compare(char a, char b)
-{
- return std::tolower(a) == std::tolower(b);
-}
-
-bool request_parser::headers_equal(const std::string& a, const std::string& b)
-{
- if (a.length() != b.length())
- return false;
-
- return std::equal(a.begin(), a.end(), b.begin(),
- &request_parser::tolower_compare);
-}
-
-} // namespace server4
-} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/request_parser.hpp b/3rdparty/asio/src/examples/cpp03/http/server4/request_parser.hpp
deleted file mode 100644
index 57c435251c8..00000000000
--- a/3rdparty/asio/src/examples/cpp03/http/server4/request_parser.hpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// request_parser.hpp
-// ~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 HTTP_SERVER4_REQUEST_PARSER_HPP
-#define HTTP_SERVER4_REQUEST_PARSER_HPP
-
-#include <string>
-#include <boost/logic/tribool.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <asio/coroutine.hpp>
-
-namespace http {
-namespace server4 {
-
-struct request;
-
-/// Parser for incoming requests.
-class request_parser : asio::coroutine
-{
-public:
- /// Parse some data. The tribool return value is true when a complete request
- /// has been parsed, false if the data is invalid, indeterminate when more
- /// data is required. The InputIterator return value indicates how much of the
- /// input has been consumed.
- template <typename InputIterator>
- boost::tuple<boost::tribool, InputIterator> parse(request& req,
- InputIterator begin, InputIterator end)
- {
- while (begin != end)
- {
- boost::tribool result = consume(req, *begin++);
- if (result || !result)
- return boost::make_tuple(result, begin);
- }
- boost::tribool result = boost::indeterminate;
- return boost::make_tuple(result, begin);
- }
-
-private:
- /// The name of the content length header.
- static std::string content_length_name_;
-
- /// Content length as decoded from headers. Defaults to 0.
- std::size_t content_length_;
-
- /// Handle the next character of input.
- boost::tribool consume(request& req, char input);
-
- /// Check if a byte is an HTTP character.
- static bool is_char(int c);
-
- /// Check if a byte is an HTTP control character.
- static bool is_ctl(int c);
-
- /// Check if a byte is defined as an HTTP tspecial character.
- static bool is_tspecial(int c);
-
- /// Check if a byte is a digit.
- static bool is_digit(int c);
-
- /// Check if two characters are equal, without regard to case.
- static bool tolower_compare(char a, char b);
-
- /// Check whether the two request header names match.
- bool headers_equal(const std::string& a, const std::string& b);
-};
-
-} // namespace server4
-} // namespace http
-
-#endif // HTTP_SERVER4_REQUEST_PARSER_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/invocation/prioritised_handlers.cpp b/3rdparty/asio/src/examples/cpp03/invocation/prioritised_handlers.cpp
deleted file mode 100644
index 602d7b6f010..00000000000
--- a/3rdparty/asio/src/examples/cpp03/invocation/prioritised_handlers.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// prioritised_handlers.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "asio.hpp"
-#include <boost/function.hpp>
-#include <iostream>
-#include <queue>
-
-using asio::ip::tcp;
-
-class handler_priority_queue : public asio::execution_context
-{
-public:
- void add(int priority, boost::function<void()> function)
- {
- handlers_.push(queued_handler(priority, function));
- }
-
- void execute_all()
- {
- while (!handlers_.empty())
- {
- queued_handler handler = handlers_.top();
- handler.execute();
- handlers_.pop();
- }
- }
-
- class executor
- {
- public:
- executor(handler_priority_queue& q, int p)
- : context_(q), priority_(p)
- {
- }
-
- handler_priority_queue& context() const
- {
- return context_;
- }
-
- template <typename Function, typename Allocator>
- void dispatch(const Function& f, const Allocator&) const
- {
- context_.add(priority_, f);
- }
-
- template <typename Function, typename Allocator>
- void post(const Function& f, const Allocator&) const
- {
- context_.add(priority_, f);
- }
-
- template <typename Function, typename Allocator>
- void defer(const Function& f, const Allocator&) const
- {
- context_.add(priority_, f);
- }
-
- void on_work_started() const {}
- void on_work_finished() const {}
-
- bool operator==(const executor& other) const
- {
- return &context_ == &other.context_ && priority_ == other.priority_;
- }
-
- bool operator!=(const executor& other) const
- {
- return !operator==(other);
- }
-
- private:
- handler_priority_queue& context_;
- int priority_;
- };
-
- template <typename Handler>
- asio::executor_binder<Handler, executor>
- wrap(int priority, Handler handler)
- {
- return asio::bind_executor(executor(*this, priority), handler);
- }
-
-private:
- class queued_handler
- {
- public:
- queued_handler(int p, boost::function<void()> f)
- : priority_(p), function_(f)
- {
- }
-
- void execute()
- {
- function_();
- }
-
- friend bool operator<(const queued_handler& a,
- const queued_handler& b)
- {
- return a.priority_ < b.priority_;
- }
-
- private:
- int priority_;
- boost::function<void()> function_;
- };
-
- std::priority_queue<queued_handler> handlers_;
-};
-
-//----------------------------------------------------------------------
-
-void high_priority_handler(const asio::error_code& /*ec*/)
-{
- std::cout << "High priority handler\n";
-}
-
-void middle_priority_handler(const asio::error_code& /*ec*/)
-{
- std::cout << "Middle priority handler\n";
-}
-
-void low_priority_handler()
-{
- std::cout << "Low priority handler\n";
-}
-
-int main()
-{
- asio::io_context io_context;
-
- handler_priority_queue pri_queue;
-
- // Post a completion handler to be run immediately.
- asio::post(io_context, pri_queue.wrap(0, low_priority_handler));
-
- // Start an asynchronous accept that will complete immediately.
- tcp::endpoint endpoint(asio::ip::address_v4::loopback(), 0);
- tcp::acceptor acceptor(io_context, endpoint);
- tcp::socket server_socket(io_context);
- acceptor.async_accept(server_socket,
- pri_queue.wrap(100, high_priority_handler));
- tcp::socket client_socket(io_context);
- client_socket.connect(acceptor.local_endpoint());
-
- // Set a deadline timer to expire immediately.
- asio::steady_timer timer(io_context);
- timer.expires_at(asio::steady_timer::time_point::min());
- timer.async_wait(pri_queue.wrap(42, middle_priority_handler));
-
- while (io_context.run_one())
- {
- // The custom invocation hook adds the handlers to the priority queue
- // rather than executing them from within the poll_one() call.
- while (io_context.poll_one())
- ;
-
- pri_queue.execute_all();
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/iostreams/http_client.cpp b/3rdparty/asio/src/examples/cpp03/iostreams/http_client.cpp
deleted file mode 100644
index 52ed241cb9f..00000000000
--- a/3rdparty/asio/src/examples/cpp03/iostreams/http_client.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// http_client.cpp
-// ~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <iostream>
-#include <istream>
-#include <ostream>
-#include <string>
-#include <asio/ip/tcp.hpp>
-
-using asio::ip::tcp;
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cout << "Usage: http_client <server> <path>\n";
- std::cout << "Example:\n";
- std::cout << " http_client www.boost.org /LICENSE_1_0.txt\n";
- return 1;
- }
-
- asio::ip::tcp::iostream s;
-
- // The entire sequence of I/O operations must complete within 60 seconds.
- // If an expiry occurs, the socket is automatically closed and the stream
- // becomes bad.
- s.expires_after(asio::chrono::seconds(60));
-
- // Establish a connection to the server.
- s.connect(argv[1], "http");
- if (!s)
- {
- std::cout << "Unable to connect: " << s.error().message() << "\n";
- return 1;
- }
-
- // Send the request. We specify the "Connection: close" header so that the
- // server will close the socket after transmitting the response. This will
- // allow us to treat all data up until the EOF as the content.
- s << "GET " << argv[2] << " HTTP/1.0\r\n";
- s << "Host: " << argv[1] << "\r\n";
- s << "Accept: */*\r\n";
- s << "Connection: close\r\n\r\n";
-
- // By default, the stream is tied with itself. This means that the stream
- // automatically flush the buffered output before attempting a read. It is
- // not necessary not explicitly flush the stream at this point.
-
- // Check that response is OK.
- std::string http_version;
- s >> http_version;
- unsigned int status_code;
- s >> status_code;
- std::string status_message;
- std::getline(s, status_message);
- if (!s || http_version.substr(0, 5) != "HTTP/")
- {
- std::cout << "Invalid response\n";
- return 1;
- }
- if (status_code != 200)
- {
- std::cout << "Response returned with status code " << status_code << "\n";
- return 1;
- }
-
- // Process the response headers, which are terminated by a blank line.
- std::string header;
- while (std::getline(s, header) && header != "\r")
- std::cout << header << "\n";
- std::cout << "\n";
-
- // Write the remaining data to output.
- std::cout << s.rdbuf();
- }
- catch (std::exception& e)
- {
- std::cout << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/local/connect_pair.cpp b/3rdparty/asio/src/examples/cpp03/local/connect_pair.cpp
deleted file mode 100644
index a6cd4dd757e..00000000000
--- a/3rdparty/asio/src/examples/cpp03/local/connect_pair.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// connect_pair.cpp
-// ~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <iostream>
-#include <string>
-#include <cctype>
-#include <asio.hpp>
-#include <boost/array.hpp>
-#include <boost/bind/bind.hpp>
-
-#if defined(ASIO_HAS_LOCAL_SOCKETS)
-
-using asio::local::stream_protocol;
-
-class uppercase_filter
-{
-public:
- uppercase_filter(asio::io_context& io_context)
- : socket_(io_context)
- {
- }
-
- stream_protocol::socket& socket()
- {
- return socket_;
- }
-
- void start()
- {
- // Wait for request.
- socket_.async_read_some(asio::buffer(data_),
- boost::bind(&uppercase_filter::handle_read,
- this, asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
-
-private:
- void handle_read(const asio::error_code& ec, std::size_t size)
- {
- if (!ec)
- {
- // Compute result.
- for (std::size_t i = 0; i < size; ++i)
- data_[i] = std::toupper(data_[i]);
-
- // Send result.
- asio::async_write(socket_, asio::buffer(data_, size),
- boost::bind(&uppercase_filter::handle_write,
- this, asio::placeholders::error));
- }
- else
- {
- throw asio::system_error(ec);
- }
- }
-
- void handle_write(const asio::error_code& ec)
- {
- if (!ec)
- {
- // Wait for request.
- socket_.async_read_some(asio::buffer(data_),
- boost::bind(&uppercase_filter::handle_read,
- this, asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- else
- {
- throw asio::system_error(ec);
- }
- }
-
- stream_protocol::socket socket_;
- boost::array<char, 512> data_;
-};
-
-void run(asio::io_context* io_context)
-{
- try
- {
- io_context->run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception in thread: " << e.what() << "\n";
- std::exit(1);
- }
-}
-
-int main()
-{
- try
- {
- asio::io_context io_context;
-
- // Create filter and establish a connection to it.
- uppercase_filter filter(io_context);
- stream_protocol::socket socket(io_context);
- asio::local::connect_pair(socket, filter.socket());
- filter.start();
-
- // The io_context runs in a background thread to perform filtering.
- asio::thread thread(boost::bind(run, &io_context));
-
- for (;;)
- {
- // Collect request from user.
- std::cout << "Enter a string: ";
- std::string request;
- std::getline(std::cin, request);
-
- // Send request to filter.
- asio::write(socket, asio::buffer(request));
-
- // Wait for reply from filter.
- std::vector<char> reply(request.size());
- asio::read(socket, asio::buffer(reply));
-
- // Show reply to user.
- std::cout << "Result: ";
- std::cout.write(&reply[0], request.size());
- std::cout << std::endl;
- }
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- std::exit(1);
- }
-}
-
-#else // defined(ASIO_HAS_LOCAL_SOCKETS)
-# error Local sockets not available on this platform.
-#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
diff --git a/3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp b/3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp
deleted file mode 100644
index 8c6274a70ad..00000000000
--- a/3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// stream_client.cpp
-// ~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstring>
-#include <iostream>
-#include "asio.hpp"
-
-#if defined(ASIO_HAS_LOCAL_SOCKETS)
-
-using asio::local::stream_protocol;
-
-enum { max_length = 1024 };
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: iostream_client <file>\n";
- return 1;
- }
-
- stream_protocol::endpoint ep(argv[1]);
- stream_protocol::iostream s(ep);
- if (!s)
- {
- std::cerr << "Unable to connect: " << s.error().message() << std::endl;
- return 1;
- }
-
- using namespace std; // For strlen.
- std::cout << "Enter message: ";
- char request[max_length];
- std::cin.getline(request, max_length);
- size_t length = strlen(request);
- s << request;
-
- char reply[max_length];
- s.read(reply, length);
- std::cout << "Reply is: ";
- std::cout.write(reply, length);
- std::cout << "\n";
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
-
-#else // defined(ASIO_HAS_LOCAL_SOCKETS)
-# error Local sockets not available on this platform.
-#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
diff --git a/3rdparty/asio/src/examples/cpp03/local/stream_client.cpp b/3rdparty/asio/src/examples/cpp03/local/stream_client.cpp
deleted file mode 100644
index b5ef9e67940..00000000000
--- a/3rdparty/asio/src/examples/cpp03/local/stream_client.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// stream_client.cpp
-// ~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <cstring>
-#include <iostream>
-#include "asio.hpp"
-
-#if defined(ASIO_HAS_LOCAL_SOCKETS)
-
-using asio::local::stream_protocol;
-
-enum { max_length = 1024 };
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: stream_client <file>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- stream_protocol::socket s(io_context);
- s.connect(stream_protocol::endpoint(argv[1]));
-
- using namespace std; // For strlen.
- std::cout << "Enter message: ";
- char request[max_length];
- std::cin.getline(request, max_length);
- size_t request_length = strlen(request);
- asio::write(s, asio::buffer(request, request_length));
-
- char reply[max_length];
- size_t reply_length = asio::read(s,
- asio::buffer(reply, request_length));
- std::cout << "Reply is: ";
- std::cout.write(reply, reply_length);
- std::cout << "\n";
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
-
-#else // defined(ASIO_HAS_LOCAL_SOCKETS)
-# error Local sockets not available on this platform.
-#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
diff --git a/3rdparty/asio/src/examples/cpp03/local/stream_server.cpp b/3rdparty/asio/src/examples/cpp03/local/stream_server.cpp
deleted file mode 100644
index de255ef1d55..00000000000
--- a/3rdparty/asio/src/examples/cpp03/local/stream_server.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// stream_server.cpp
-// ~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdio>
-#include <iostream>
-#include <boost/array.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-#include "asio.hpp"
-
-#if defined(ASIO_HAS_LOCAL_SOCKETS)
-
-using asio::local::stream_protocol;
-
-class session
- : public boost::enable_shared_from_this<session>
-{
-public:
- session(asio::io_context& io_context)
- : socket_(io_context)
- {
- }
-
- stream_protocol::socket& socket()
- {
- return socket_;
- }
-
- void start()
- {
- socket_.async_read_some(asio::buffer(data_),
- boost::bind(&session::handle_read,
- shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
-
- void handle_read(const asio::error_code& error,
- size_t bytes_transferred)
- {
- if (!error)
- {
- asio::async_write(socket_,
- asio::buffer(data_, bytes_transferred),
- boost::bind(&session::handle_write,
- shared_from_this(),
- asio::placeholders::error));
- }
- }
-
- void handle_write(const asio::error_code& error)
- {
- if (!error)
- {
- socket_.async_read_some(asio::buffer(data_),
- boost::bind(&session::handle_read,
- shared_from_this(),
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- }
-
-private:
- // The socket used to communicate with the client.
- stream_protocol::socket socket_;
-
- // Buffer used to store data received from the client.
- boost::array<char, 1024> data_;
-};
-
-typedef boost::shared_ptr<session> session_ptr;
-
-class server
-{
-public:
- server(asio::io_context& io_context, const std::string& file)
- : io_context_(io_context),
- acceptor_(io_context, stream_protocol::endpoint(file))
- {
- session_ptr new_session(new session(io_context_));
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&server::handle_accept, this, new_session,
- asio::placeholders::error));
- }
-
- void handle_accept(session_ptr new_session,
- const asio::error_code& error)
- {
- if (!error)
- {
- new_session->start();
- }
-
- new_session.reset(new session(io_context_));
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&server::handle_accept, this, new_session,
- asio::placeholders::error));
- }
-
-private:
- asio::io_context& io_context_;
- stream_protocol::acceptor acceptor_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: stream_server <file>\n";
- std::cerr << "*** WARNING: existing file is removed ***\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- std::remove(argv[1]);
- server s(io_context, argv[1]);
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
-
-#else // defined(ASIO_HAS_LOCAL_SOCKETS)
-# error Local sockets not available on this platform.
-#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
diff --git a/3rdparty/asio/src/examples/cpp03/multicast/receiver.cpp b/3rdparty/asio/src/examples/cpp03/multicast/receiver.cpp
deleted file mode 100644
index 42ca661cea3..00000000000
--- a/3rdparty/asio/src/examples/cpp03/multicast/receiver.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// receiver.cpp
-// ~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <iostream>
-#include <string>
-#include "asio.hpp"
-#include "boost/bind/bind.hpp"
-
-const short multicast_port = 30001;
-
-class receiver
-{
-public:
- receiver(asio::io_context& io_context,
- const asio::ip::address& listen_address,
- const asio::ip::address& multicast_address)
- : socket_(io_context)
- {
- // Create the socket so that multiple may be bound to the same address.
- asio::ip::udp::endpoint listen_endpoint(
- listen_address, multicast_port);
- socket_.open(listen_endpoint.protocol());
- socket_.set_option(asio::ip::udp::socket::reuse_address(true));
- socket_.bind(listen_endpoint);
-
- // Join the multicast group.
- socket_.set_option(
- asio::ip::multicast::join_group(multicast_address));
-
- socket_.async_receive_from(
- asio::buffer(data_, max_length), sender_endpoint_,
- boost::bind(&receiver::handle_receive_from, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
-
- void handle_receive_from(const asio::error_code& error,
- size_t bytes_recvd)
- {
- if (!error)
- {
- std::cout.write(data_, bytes_recvd);
- std::cout << std::endl;
-
- socket_.async_receive_from(
- asio::buffer(data_, max_length), sender_endpoint_,
- boost::bind(&receiver::handle_receive_from, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- }
-
-private:
- asio::ip::udp::socket socket_;
- asio::ip::udp::endpoint sender_endpoint_;
- enum { max_length = 1024 };
- char data_[max_length];
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cerr << "Usage: receiver <listen_address> <multicast_address>\n";
- std::cerr << " For IPv4, try:\n";
- std::cerr << " receiver 0.0.0.0 239.255.0.1\n";
- std::cerr << " For IPv6, try:\n";
- std::cerr << " receiver 0::0 ff31::8000:1234\n";
- return 1;
- }
-
- asio::io_context io_context;
- receiver r(io_context,
- asio::ip::make_address(argv[1]),
- asio::ip::make_address(argv[2]));
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/multicast/sender.cpp b/3rdparty/asio/src/examples/cpp03/multicast/sender.cpp
deleted file mode 100644
index a20470c96b6..00000000000
--- a/3rdparty/asio/src/examples/cpp03/multicast/sender.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// sender.cpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <iostream>
-#include <sstream>
-#include <string>
-#include "asio.hpp"
-#include "boost/bind/bind.hpp"
-
-const short multicast_port = 30001;
-const int max_message_count = 10;
-
-class sender
-{
-public:
- sender(asio::io_context& io_context,
- const asio::ip::address& multicast_address)
- : endpoint_(multicast_address, multicast_port),
- socket_(io_context, endpoint_.protocol()),
- timer_(io_context),
- message_count_(0)
- {
- std::ostringstream os;
- os << "Message " << message_count_++;
- message_ = os.str();
-
- socket_.async_send_to(
- asio::buffer(message_), endpoint_,
- boost::bind(&sender::handle_send_to, this,
- asio::placeholders::error));
- }
-
- void handle_send_to(const asio::error_code& error)
- {
- if (!error && message_count_ < max_message_count)
- {
- timer_.expires_after(asio::chrono::seconds(1));
- timer_.async_wait(
- boost::bind(&sender::handle_timeout, this,
- asio::placeholders::error));
- }
- }
-
- void handle_timeout(const asio::error_code& error)
- {
- if (!error)
- {
- std::ostringstream os;
- os << "Message " << message_count_++;
- message_ = os.str();
-
- socket_.async_send_to(
- asio::buffer(message_), endpoint_,
- boost::bind(&sender::handle_send_to, this,
- asio::placeholders::error));
- }
- }
-
-private:
- asio::ip::udp::endpoint endpoint_;
- asio::ip::udp::socket socket_;
- asio::steady_timer timer_;
- int message_count_;
- std::string message_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: sender <multicast_address>\n";
- std::cerr << " For IPv4, try:\n";
- std::cerr << " sender 239.255.0.1\n";
- std::cerr << " For IPv6, try:\n";
- std::cerr << " sender ff31::8000:1234\n";
- return 1;
- }
-
- asio::io_context io_context;
- sender s(io_context, asio::ip::make_address(argv[1]));
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/nonblocking/third_party_lib.cpp b/3rdparty/asio/src/examples/cpp03/nonblocking/third_party_lib.cpp
deleted file mode 100644
index bc3d02f02f6..00000000000
--- a/3rdparty/asio/src/examples/cpp03/nonblocking/third_party_lib.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-//
-// third_party_lib.cpp
-// ~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <asio.hpp>
-#include <boost/array.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <iostream>
-
-using asio::ip::tcp;
-
-namespace third_party_lib {
-
-// Simulation of a third party library that wants to perform read and write
-// operations directly on a socket. It needs to be polled to determine whether
-// it requires a read or write operation, and notified when the socket is ready
-// for reading or writing.
-class session
-{
-public:
- session(tcp::socket& socket)
- : socket_(socket),
- state_(reading)
- {
- }
-
- // Returns true if the third party library wants to be notified when the
- // socket is ready for reading.
- bool want_read() const
- {
- return state_ == reading;
- }
-
- // Notify that third party library that it should perform its read operation.
- void do_read(asio::error_code& ec)
- {
- if (std::size_t len = socket_.read_some(asio::buffer(data_), ec))
- {
- write_buffer_ = asio::buffer(data_, len);
- state_ = writing;
- }
- }
-
- // Returns true if the third party library wants to be notified when the
- // socket is ready for writing.
- bool want_write() const
- {
- return state_ == writing;
- }
-
- // Notify that third party library that it should perform its write operation.
- void do_write(asio::error_code& ec)
- {
- if (std::size_t len = socket_.write_some(
- asio::buffer(write_buffer_), ec))
- {
- write_buffer_ = write_buffer_ + len;
- state_ = asio::buffer_size(write_buffer_) > 0 ? writing : reading;
- }
- }
-
-private:
- tcp::socket& socket_;
- enum { reading, writing } state_;
- boost::array<char, 128> data_;
- asio::const_buffer write_buffer_;
-};
-
-} // namespace third_party_lib
-
-// The glue between asio's sockets and the third party library.
-class connection
- : public boost::enable_shared_from_this<connection>
-{
-public:
- typedef boost::shared_ptr<connection> pointer;
-
- static pointer create(const asio::any_io_executor& ex)
- {
- return pointer(new connection(ex));
- }
-
- tcp::socket& socket()
- {
- return socket_;
- }
-
- void start()
- {
- // Put the socket into non-blocking mode.
- socket_.non_blocking(true);
-
- start_operations();
- }
-
-private:
- connection(const asio::any_io_executor& ex)
- : socket_(ex),
- session_impl_(socket_),
- read_in_progress_(false),
- write_in_progress_(false)
- {
- }
-
- void start_operations()
- {
- // Start a read operation if the third party library wants one.
- if (session_impl_.want_read() && !read_in_progress_)
- {
- read_in_progress_ = true;
- socket_.async_wait(tcp::socket::wait_read,
- boost::bind(&connection::handle_read,
- shared_from_this(),
- asio::placeholders::error));
- }
-
- // Start a write operation if the third party library wants one.
- if (session_impl_.want_write() && !write_in_progress_)
- {
- write_in_progress_ = true;
- socket_.async_wait(tcp::socket::wait_write,
- boost::bind(&connection::handle_write,
- shared_from_this(),
- asio::placeholders::error));
- }
- }
-
- void handle_read(asio::error_code ec)
- {
- read_in_progress_ = false;
-
- // Notify third party library that it can perform a read.
- if (!ec)
- session_impl_.do_read(ec);
-
- // The third party library successfully performed a read on the socket.
- // Start new read or write operations based on what it now wants.
- if (!ec || ec == asio::error::would_block)
- start_operations();
-
- // Otherwise, an error occurred. Closing the socket cancels any outstanding
- // asynchronous read or write operations. The connection object will be
- // destroyed automatically once those outstanding operations complete.
- else
- socket_.close();
- }
-
- void handle_write(asio::error_code ec)
- {
- write_in_progress_ = false;
-
- // Notify third party library that it can perform a write.
- if (!ec)
- session_impl_.do_write(ec);
-
- // The third party library successfully performed a write on the socket.
- // Start new read or write operations based on what it now wants.
- if (!ec || ec == asio::error::would_block)
- start_operations();
-
- // Otherwise, an error occurred. Closing the socket cancels any outstanding
- // asynchronous read or write operations. The connection object will be
- // destroyed automatically once those outstanding operations complete.
- else
- socket_.close();
- }
-
-private:
- tcp::socket socket_;
- third_party_lib::session session_impl_;
- bool read_in_progress_;
- bool write_in_progress_;
-};
-
-class server
-{
-public:
- server(asio::io_context& io_context, unsigned short port)
- : acceptor_(io_context, tcp::endpoint(tcp::v4(), port))
- {
- start_accept();
- }
-
-private:
- void start_accept()
- {
- connection::pointer new_connection =
- connection::create(acceptor_.get_executor());
-
- acceptor_.async_accept(new_connection->socket(),
- boost::bind(&server::handle_accept, this, new_connection,
- asio::placeholders::error));
- }
-
- void handle_accept(connection::pointer new_connection,
- const asio::error_code& error)
- {
- if (!error)
- {
- new_connection->start();
- }
-
- start_accept();
- }
-
- tcp::acceptor acceptor_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: third_party_lib <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- using namespace std; // For atoi.
- server s(io_context, atoi(argv[1]));
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/socks4/socks4.hpp b/3rdparty/asio/src/examples/cpp03/socks4/socks4.hpp
deleted file mode 100644
index c211b32827f..00000000000
--- a/3rdparty/asio/src/examples/cpp03/socks4/socks4.hpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// socks4.hpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 SOCKS4_HPP
-#define SOCKS4_HPP
-
-#include <string>
-#include <asio.hpp>
-#include <boost/array.hpp>
-
-namespace socks4 {
-
-const unsigned char version = 0x04;
-
-class request
-{
-public:
- enum command_type
- {
- connect = 0x01,
- bind = 0x02
- };
-
- request(command_type cmd, const asio::ip::tcp::endpoint& endpoint,
- const std::string& user_id)
- : version_(version),
- command_(cmd),
- user_id_(user_id),
- null_byte_(0)
- {
- // Only IPv4 is supported by the SOCKS 4 protocol.
- if (endpoint.protocol() != asio::ip::tcp::v4())
- {
- throw asio::system_error(
- asio::error::address_family_not_supported);
- }
-
- // Convert port number to network byte order.
- unsigned short port = endpoint.port();
- port_high_byte_ = (port >> 8) & 0xff;
- port_low_byte_ = port & 0xff;
-
- // Save IP address in network byte order.
- address_ = endpoint.address().to_v4().to_bytes();
- }
-
- boost::array<asio::const_buffer, 7> buffers() const
- {
- boost::array<asio::const_buffer, 7> bufs =
- {
- {
- asio::buffer(&version_, 1),
- asio::buffer(&command_, 1),
- asio::buffer(&port_high_byte_, 1),
- asio::buffer(&port_low_byte_, 1),
- asio::buffer(address_),
- asio::buffer(user_id_),
- asio::buffer(&null_byte_, 1)
- }
- };
- return bufs;
- }
-
-private:
- unsigned char version_;
- unsigned char command_;
- unsigned char port_high_byte_;
- unsigned char port_low_byte_;
- asio::ip::address_v4::bytes_type address_;
- std::string user_id_;
- unsigned char null_byte_;
-};
-
-class reply
-{
-public:
- enum status_type
- {
- request_granted = 0x5a,
- request_failed = 0x5b,
- request_failed_no_identd = 0x5c,
- request_failed_bad_user_id = 0x5d
- };
-
- reply()
- : null_byte_(0),
- status_()
- {
- }
-
- boost::array<asio::mutable_buffer, 5> buffers()
- {
- boost::array<asio::mutable_buffer, 5> bufs =
- {
- {
- asio::buffer(&null_byte_, 1),
- asio::buffer(&status_, 1),
- asio::buffer(&port_high_byte_, 1),
- asio::buffer(&port_low_byte_, 1),
- asio::buffer(address_)
- }
- };
- return bufs;
- }
-
- bool success() const
- {
- return null_byte_ == 0 && status_ == request_granted;
- }
-
- unsigned char status() const
- {
- return status_;
- }
-
- asio::ip::tcp::endpoint endpoint() const
- {
- unsigned short port = port_high_byte_;
- port = (port << 8) & 0xff00;
- port = port | port_low_byte_;
-
- asio::ip::address_v4 address(address_);
-
- return asio::ip::tcp::endpoint(address, port);
- }
-
-private:
- unsigned char null_byte_;
- unsigned char status_;
- unsigned char port_high_byte_;
- unsigned char port_low_byte_;
- asio::ip::address_v4::bytes_type address_;
-};
-
-} // namespace socks4
-
-#endif // SOCKS4_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/socks4/sync_client.cpp b/3rdparty/asio/src/examples/cpp03/socks4/sync_client.cpp
deleted file mode 100644
index 6a52c5edf64..00000000000
--- a/3rdparty/asio/src/examples/cpp03/socks4/sync_client.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// sync_client.cpp
-// ~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <iostream>
-#include <iomanip>
-#include <ostream>
-#include <string>
-#include <asio.hpp>
-#include <boost/array.hpp>
-#include "socks4.hpp"
-
-using asio::ip::tcp;
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 4)
- {
- std::cout << "Usage: sync_client <socks4server> <socks4port> <user>\n";
- std::cout << "Examples:\n";
- std::cout << " sync_client 127.0.0.1 1080 chris\n";
- std::cout << " sync_client localhost socks chris\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- // Get a list of endpoints corresponding to the SOCKS 4 server name.
- tcp::resolver resolver(io_context);
- tcp::resolver::results_type endpoints = resolver.resolve(argv[1], argv[2]);
-
- // Try each endpoint until we successfully establish a connection to the
- // SOCKS 4 server.
- tcp::socket socket(io_context);
- asio::connect(socket, endpoints);
-
- // Get an endpoint for the Boost website. This will be passed to the SOCKS
- // 4 server. Explicitly specify IPv4 since SOCKS 4 does not support IPv6.
- tcp::endpoint http_endpoint =
- *resolver.resolve(tcp::v4(), "www.boost.org", "http").begin();
-
- // Send the request to the SOCKS 4 server.
- socks4::request socks_request(
- socks4::request::connect, http_endpoint, argv[3]);
- asio::write(socket, socks_request.buffers());
-
- // Receive a response from the SOCKS 4 server.
- socks4::reply socks_reply;
- asio::read(socket, socks_reply.buffers());
-
- // Check whether we successfully negotiated with the SOCKS 4 server.
- if (!socks_reply.success())
- {
- std::cout << "Connection failed.\n";
- std::cout << "status = 0x" << std::hex << socks_reply.status();
- return 1;
- }
-
- // Form the HTTP request. We specify the "Connection: close" header so that
- // the server will close the socket after transmitting the response. This
- // will allow us to treat all data up until the EOF as the response.
- std::string request =
- "GET / HTTP/1.0\r\n"
- "Host: www.boost.org\r\n"
- "Accept: */*\r\n"
- "Connection: close\r\n\r\n";
-
- // Send the HTTP request.
- asio::write(socket, asio::buffer(request));
-
- // Read until EOF, writing data to output as we go.
- boost::array<char, 512> response;
- asio::error_code error;
- while (std::size_t s = socket.read_some(
- asio::buffer(response), error))
- std::cout.write(response.data(), s);
- if (error != asio::error::eof)
- throw asio::system_error(error);
- }
- catch (std::exception& e)
- {
- std::cout << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/spawn/echo_server.cpp b/3rdparty/asio/src/examples/cpp03/spawn/echo_server.cpp
deleted file mode 100644
index 4549b446245..00000000000
--- a/3rdparty/asio/src/examples/cpp03/spawn/echo_server.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// echo_server.cpp
-// ~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <asio/io_context.hpp>
-#include <asio/ip/tcp.hpp>
-#include <asio/spawn.hpp>
-#include <asio/steady_timer.hpp>
-#include <asio/write.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <iostream>
-
-using asio::ip::tcp;
-
-class session : public boost::enable_shared_from_this<session>
-{
-public:
- explicit session(asio::io_context& io_context)
- : strand_(asio::make_strand(io_context)),
- socket_(io_context),
- timer_(io_context)
- {
- }
-
- tcp::socket& socket()
- {
- return socket_;
- }
-
- void go()
- {
- asio::spawn(strand_,
- boost::bind(&session::echo,
- shared_from_this(), boost::placeholders::_1));
- asio::spawn(strand_,
- boost::bind(&session::timeout,
- shared_from_this(), boost::placeholders::_1));
- }
-
-private:
- void echo(asio::yield_context yield)
- {
- try
- {
- char data[128];
- for (;;)
- {
- timer_.expires_after(asio::chrono::seconds(10));
- std::size_t n = socket_.async_read_some(asio::buffer(data), yield);
- asio::async_write(socket_, asio::buffer(data, n), yield);
- }
- }
- catch (std::exception& e)
- {
- socket_.close();
- timer_.cancel();
- }
- }
-
- void timeout(asio::yield_context yield)
- {
- while (socket_.is_open())
- {
- asio::error_code ignored_ec;
- timer_.async_wait(yield[ignored_ec]);
- if (timer_.expiry() <= asio::steady_timer::clock_type::now())
- socket_.close();
- }
- }
-
- asio::strand<asio::io_context::executor_type> strand_;
- tcp::socket socket_;
- asio::steady_timer timer_;
-};
-
-void do_accept(asio::io_context& io_context,
- unsigned short port, asio::yield_context yield)
-{
- tcp::acceptor acceptor(io_context, tcp::endpoint(tcp::v4(), port));
-
- for (;;)
- {
- asio::error_code ec;
- boost::shared_ptr<session> new_session(new session(io_context));
- acceptor.async_accept(new_session->socket(), yield[ec]);
- if (!ec) new_session->go();
- }
-}
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: echo_server <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- asio::spawn(io_context,
- boost::bind(do_accept,
- boost::ref(io_context), atoi(argv[1]), boost::placeholders::_1));
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/spawn/parallel_grep.cpp b/3rdparty/asio/src/examples/cpp03/spawn/parallel_grep.cpp
deleted file mode 100644
index 7fe1817a25e..00000000000
--- a/3rdparty/asio/src/examples/cpp03/spawn/parallel_grep.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// parallel_grep.cpp
-// ~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <asio/dispatch.hpp>
-#include <asio/post.hpp>
-#include <asio/spawn.hpp>
-#include <asio/strand.hpp>
-#include <asio/thread_pool.hpp>
-#include <boost/bind/bind.hpp>
-#include <fstream>
-#include <iostream>
-#include <string>
-
-using asio::dispatch;
-using asio::spawn;
-using asio::strand;
-using asio::thread_pool;
-using asio::yield_context;
-
-void print_match(std::string input_file, std::string line)
-{
- std::cout << input_file << ':' << line << std::endl;
-}
-
-void search_file(std::string search_string, std::string input_file,
- strand<thread_pool::executor_type> output_strand, yield_context yield)
-{
- std::ifstream is(input_file.c_str());
- std::string line;
- std::size_t line_num = 0;
- while (std::getline(is, line))
- {
- // If we find a match, send a message to the output.
- if (line.find(search_string) != std::string::npos)
- {
- dispatch(output_strand, boost::bind(&print_match, input_file, line));
- }
-
- // Every so often we yield control to another coroutine.
- if (++line_num % 10 == 0)
- post(yield);
- }
-}
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc < 2)
- {
- std::cerr << "Usage: parallel_grep <string> <files...>\n";
- return 1;
- }
-
- // We use a fixed size pool of threads for reading the input files. The
- // number of threads is automatically determined based on the number of
- // CPUs available in the system.
- thread_pool pool;
-
- // To prevent the output from being garbled, we use a strand to synchronise
- // printing.
- strand<thread_pool::executor_type> output_strand(pool.get_executor());
-
- // Spawn a new coroutine for each file specified on the command line.
- std::string search_string = argv[1];
- for (int argn = 2; argn < argc; ++argn)
- {
- std::string input_file = argv[argn];
- spawn(pool, boost::bind(&search_file, search_string,
- input_file, output_strand, boost::placeholders::_1));
- }
-
- // Join the thread pool to wait for all the spawned tasks to complete.
- pool.join();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/ssl/ca.pem b/3rdparty/asio/src/examples/cpp03/ssl/ca.pem
deleted file mode 100644
index 1ee5f2ca43b..00000000000
--- a/3rdparty/asio/src/examples/cpp03/ssl/ca.pem
+++ /dev/null
@@ -1,49 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDlzCCAn+gAwIBAgIJAMJYU3U6A0IRMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNV
-BAYTAkFVMQwwCgYDVQQIEwNOU1cxDzANBgNVBAcTBlN5ZG5leTENMAsGA1UEChME
-YXNpbzAeFw0xNTExMTgyMjMzNDhaFw0yMDExMTYyMjMzNDhaMDsxCzAJBgNVBAYT
-AkFVMQwwCgYDVQQIEwNOU1cxDzANBgNVBAcTBlN5ZG5leTENMAsGA1UEChMEYXNp
-bzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMcRJocHdVMdLUJ/pypY
-QVSTC0t3IIgjwjazrK3kAaoIMvzPmDFxEXWcDx+nyz8kQ/E38Ir/ef2BCNGci5hu
-wkfMSuMoW9l2N4hx3QCcF46tTDEZztFxWAH7QbE2wYMlMgKZSxWimNfq0YjxEEXb
-QM0lGPLFh7Xoko29H0F3LKaaQV9u/vop3Hs0h12HeWlY4PiLp7QQTNGqbWcXycA0
-NZ/fyismireyEvPAgo6L8iXuAi7g0TVKVNlrticGGjMcMq6IMvxzEpSMkuMQ5rWj
-pZjWOoBjSYBuXdblcBRvXhOr2Ws8jJLMZfehKq9q1reQfoGV6xMnbwmumSXbWRWT
-0vkCAwEAAaOBnTCBmjAdBgNVHQ4EFgQUK/Zv/AVtfIeucJw8VEtux1dhI1YwawYD
-VR0jBGQwYoAUK/Zv/AVtfIeucJw8VEtux1dhI1ahP6Q9MDsxCzAJBgNVBAYTAkFV
-MQwwCgYDVQQIEwNOU1cxDzANBgNVBAcTBlN5ZG5leTENMAsGA1UEChMEYXNpb4IJ
-AMJYU3U6A0IRMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABLYXimq
-v/HLyIJi7Xn8AJUsICj8LKF/J24nwwiF+ibf7UkoChJURs4nN78bod/lpDVPTEVl
-gTBdV/vBJs416sCEFfsGjqB9OBYj4gb0VaJDsQd0+NMvXp0faKv2y9wgScxG9/cg
-aM7eRmyfMn1qjb6tpNxVOPpe/nFi8Vx/1orejBRaZr4zF5TkoPepfwLWQeXDUIdE
-+QHZ60jZAkR5RXTVU4u3kOKcJs839pmJYyxM4H2VxpR18vy4/YdIVWkREIUM2OgT
-5iznIQIIgR56QRGP85uef+I6n0BHzrBk6du69bkQFxrFjLVGlal4bIQqSg4KGWgx
-dEdymMWzmMxpO9s=
------END CERTIFICATE-----
------BEGIN RSA PRIVATE KEY-----
-MIIEpgIBAAKCAQEAxxEmhwd1Ux0tQn+nKlhBVJMLS3cgiCPCNrOsreQBqggy/M+Y
-MXERdZwPH6fLPyRD8Tfwiv95/YEI0ZyLmG7CR8xK4yhb2XY3iHHdAJwXjq1MMRnO
-0XFYAftBsTbBgyUyAplLFaKY1+rRiPEQRdtAzSUY8sWHteiSjb0fQXcspppBX27+
-+incezSHXYd5aVjg+IuntBBM0aptZxfJwDQ1n9/KKyaKt7IS88CCjovyJe4CLuDR
-NUpU2Wu2JwYaMxwyrogy/HMSlIyS4xDmtaOlmNY6gGNJgG5d1uVwFG9eE6vZazyM
-ksxl96Eqr2rWt5B+gZXrEydvCa6ZJdtZFZPS+QIDAQABAoIBAQCOma+SvPoDzvvU
-DiPOxqgOEMPfjHfGbm86xl0luBalGfiEd6WbjVanfGKtF4MWOUFec+chez+FJMEP
-fufVC0qrKiJfNVMOpYvEd2SMgkSx1VymM8me6WXVDYsSipn2+1cm228ZEYAR9Emj
-oqQ4loaGLlP/3RaJbhBF7ruMJvXaZZQ4fZy74Z4tyRaaE1B659ua7Rjne7eNhQE8
-cR7cQDkxsNNN3LTbfLRwEc/gcDXWgLe5JlR/K4ZrdKc3lyivm+Uew3ubKs+fgkyY
-kHmuI3RJGIjpnsZW0/So+pHm3b/fo6lmlhTXtNNd+tkkKn2K9ttbXT3Sc13Pc+4w
-c4MLyUpdAoGBAOxTtGDpeF6U4s+GPuOCzHCwKQyzfOyCL/UTZv1UJX7Kn1FYycJH
-eOjtBRtS661cGkGd1MPfjdX2VV84AmBGDUmRqJ2KfTI1NjLAEJ115ANTpmSTm3lF
-UYncgbzl6aflLpjE1mgY+JTJykYeN5jhhO0r2bsdY7S+zaMCSI5NLuznAoGBANej
-aMtqLg2qKoq+fUkNBHHLXelR5dBXFnKgSrTj++H4yeW9pYbl8bK3gTF3I5+dSjHW
-DdC4+X09iPqY7p8vm8Gq/vgO8Bu+EnKNVr80PJSj7AzFGd6mk/CVrAzoY2XJWbAp
-YFwpo1WfHjS5wBfQzBlXY7kWVB7fj32kk14PYmUfAoGBAJXfd7NGHPoOfdCSGGv8
-VV7ZuQ6+/WiYH4XS6iuaI7VHFsZmAn3dCcbeGbD8Y04r7NLUH0yhB7g7YmTihk87
-3c1cPIy8eS1QJbEFsQPK8fFSKWH7YkwEM/O0DesX+5hodaaYnkiiHXNujYLuQuAH
-lV87wfcyajsEDjFkj1L/i9TdAoGBAKYfRUQv8HqmdU+doHb+iEYCHb75UMpHzQtR
-YTwpxoo3V5Kdnz9lNeYwaF7rIY59ZgMunEYHumw5U6V625nW228/hF0lZOR6cUu+
-hu2WGHWKMvdDgMJ+IcpeA8WN4cUwcN+9gHZ/vUzg4CxOTSYLvLBpGnIkOXnvUGPC
-vaTgxTSRAoGBAOHcuZ9hcUrPuVI1HVkjQQLu5mLZ3tz6linEbe/RCdJMK8JrRX4w
-ubB7gFclMYGbLlDNAJVYkydJaCy/2NAI3rfsOda+VmDqGx6z4BbSGceHhomyU1Oo
-1H7YaXsuzDkzl23HRsyp0pKJpTdghZdbVsGF8vAB8ygK3ehM233neSln
------END RSA PRIVATE KEY-----
diff --git a/3rdparty/asio/src/examples/cpp03/ssl/client.cpp b/3rdparty/asio/src/examples/cpp03/ssl/client.cpp
deleted file mode 100644
index 3b0e9fd5c7a..00000000000
--- a/3rdparty/asio/src/examples/cpp03/ssl/client.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// client.cpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <iostream>
-#include <boost/bind/bind.hpp>
-#include "asio.hpp"
-#include "asio/ssl.hpp"
-
-enum { max_length = 1024 };
-
-class client
-{
-public:
- client(asio::io_context& io_context,
- asio::ssl::context& context,
- asio::ip::tcp::resolver::results_type endpoints)
- : socket_(io_context, context)
- {
- socket_.set_verify_mode(asio::ssl::verify_peer);
- socket_.set_verify_callback(
- boost::bind(&client::verify_certificate, this,
- boost::placeholders::_1, boost::placeholders::_2));
-
- asio::async_connect(socket_.lowest_layer(), endpoints,
- boost::bind(&client::handle_connect, this,
- asio::placeholders::error));
- }
-
- bool verify_certificate(bool preverified,
- asio::ssl::verify_context& ctx)
- {
- // The verify callback can be used to check whether the certificate that is
- // being presented is valid for the peer. For example, RFC 2818 describes
- // the steps involved in doing this for HTTPS. Consult the OpenSSL
- // documentation for more details. Note that the callback is called once
- // for each certificate in the certificate chain, starting from the root
- // certificate authority.
-
- // In this example we will simply print the certificate's subject name.
- char subject_name[256];
- X509* cert = X509_STORE_CTX_get_current_cert(ctx.native_handle());
- X509_NAME_oneline(X509_get_subject_name(cert), subject_name, 256);
- std::cout << "Verifying " << subject_name << "\n";
-
- return preverified;
- }
-
- void handle_connect(const asio::error_code& error)
- {
- if (!error)
- {
- socket_.async_handshake(asio::ssl::stream_base::client,
- boost::bind(&client::handle_handshake, this,
- asio::placeholders::error));
- }
- else
- {
- std::cout << "Connect failed: " << error.message() << "\n";
- }
- }
-
- void handle_handshake(const asio::error_code& error)
- {
- if (!error)
- {
- std::cout << "Enter message: ";
- std::cin.getline(request_, max_length);
- size_t request_length = strlen(request_);
-
- asio::async_write(socket_,
- asio::buffer(request_, request_length),
- boost::bind(&client::handle_write, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- else
- {
- std::cout << "Handshake failed: " << error.message() << "\n";
- }
- }
-
- void handle_write(const asio::error_code& error,
- size_t bytes_transferred)
- {
- if (!error)
- {
- asio::async_read(socket_,
- asio::buffer(reply_, bytes_transferred),
- boost::bind(&client::handle_read, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- else
- {
- std::cout << "Write failed: " << error.message() << "\n";
- }
- }
-
- void handle_read(const asio::error_code& error,
- size_t bytes_transferred)
- {
- if (!error)
- {
- std::cout << "Reply: ";
- std::cout.write(reply_, bytes_transferred);
- std::cout << "\n";
- }
- else
- {
- std::cout << "Read failed: " << error.message() << "\n";
- }
- }
-
-private:
- asio::ssl::stream<asio::ip::tcp::socket> socket_;
- char request_[max_length];
- char reply_[max_length];
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cerr << "Usage: client <host> <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- asio::ip::tcp::resolver resolver(io_context);
- asio::ip::tcp::resolver::results_type endpoints =
- resolver.resolve(argv[1], argv[2]);
-
- asio::ssl::context ctx(asio::ssl::context::sslv23);
- ctx.load_verify_file("ca.pem");
-
- client c(io_context, ctx, endpoints);
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/ssl/dh2048.pem b/3rdparty/asio/src/examples/cpp03/ssl/dh2048.pem
deleted file mode 100644
index 07250cca62f..00000000000
--- a/3rdparty/asio/src/examples/cpp03/ssl/dh2048.pem
+++ /dev/null
@@ -1,8 +0,0 @@
------BEGIN DH PARAMETERS-----
-MIIBCAKCAQEAyNnxZSYc6J89mDNnqOH8bnwBiAJxcaUS3PkIEcwW8D9o2BlNq6EO
-XKMIbdfwPFZi80GMpNu3YP2A2B42sAHmb7w7ZA92QDv3JjqzR0QuS/CkMv4CEjha
-QBFwBDDWnnHBSj4w/t54ii0SH34mWcjBItI2eMtnM9J6fnvNiWqJxdt4iA4mZjZD
-qZTjIRyjgKAevzkqAlBqQRoVUUgu+9Cf29wXjVl3bE+0VU5CdFeyT+Y9yunz88mq
-rGyx1uPt+zbIfxuNLH+coY67y1ht7iZEL5WLd3wGCycRT+lYy2AL/rxGBPxStFIT
-2bOkQao6sAfb4UdGEUlwHUXZrAV51oM30wIBAg==
------END DH PARAMETERS-----
diff --git a/3rdparty/asio/src/examples/cpp03/ssl/server.cpp b/3rdparty/asio/src/examples/cpp03/ssl/server.cpp
deleted file mode 100644
index 196824e5fd3..00000000000
--- a/3rdparty/asio/src/examples/cpp03/ssl/server.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-//
-// server.cpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <cstdlib>
-#include <iostream>
-#include <boost/bind/bind.hpp>
-#include "asio.hpp"
-#include "asio/ssl.hpp"
-
-typedef asio::ssl::stream<asio::ip::tcp::socket> ssl_socket;
-
-class session
-{
-public:
- session(asio::io_context& io_context,
- asio::ssl::context& context)
- : socket_(io_context, context)
- {
- }
-
- ssl_socket::lowest_layer_type& socket()
- {
- return socket_.lowest_layer();
- }
-
- void start()
- {
- socket_.async_handshake(asio::ssl::stream_base::server,
- boost::bind(&session::handle_handshake, this,
- asio::placeholders::error));
- }
-
- void handle_handshake(const asio::error_code& error)
- {
- if (!error)
- {
- socket_.async_read_some(asio::buffer(data_, max_length),
- boost::bind(&session::handle_read, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- else
- {
- delete this;
- }
- }
-
- void handle_read(const asio::error_code& error,
- size_t bytes_transferred)
- {
- if (!error)
- {
- asio::async_write(socket_,
- asio::buffer(data_, bytes_transferred),
- boost::bind(&session::handle_write, this,
- asio::placeholders::error));
- }
- else
- {
- delete this;
- }
- }
-
- void handle_write(const asio::error_code& error)
- {
- if (!error)
- {
- socket_.async_read_some(asio::buffer(data_, max_length),
- boost::bind(&session::handle_read, this,
- asio::placeholders::error,
- asio::placeholders::bytes_transferred));
- }
- else
- {
- delete this;
- }
- }
-
-private:
- ssl_socket socket_;
- enum { max_length = 1024 };
- char data_[max_length];
-};
-
-class server
-{
-public:
- server(asio::io_context& io_context, unsigned short port)
- : io_context_(io_context),
- acceptor_(io_context,
- asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port)),
- context_(asio::ssl::context::sslv23)
- {
- context_.set_options(
- asio::ssl::context::default_workarounds
- | asio::ssl::context::no_sslv2
- | asio::ssl::context::single_dh_use);
- context_.set_password_callback(boost::bind(&server::get_password, this));
- context_.use_certificate_chain_file("server.pem");
- context_.use_private_key_file("server.pem", asio::ssl::context::pem);
- context_.use_tmp_dh_file("dh2048.pem");
-
- start_accept();
- }
-
- std::string get_password() const
- {
- return "test";
- }
-
- void start_accept()
- {
- session* new_session = new session(io_context_, context_);
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&server::handle_accept, this, new_session,
- asio::placeholders::error));
- }
-
- void handle_accept(session* new_session,
- const asio::error_code& error)
- {
- if (!error)
- {
- new_session->start();
- }
- else
- {
- delete new_session;
- }
-
- start_accept();
- }
-
-private:
- asio::io_context& io_context_;
- asio::ip::tcp::acceptor acceptor_;
- asio::ssl::context context_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 2)
- {
- std::cerr << "Usage: server <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- using namespace std; // For atoi.
- server s(io_context, atoi(argv[1]));
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/ssl/server.pem b/3rdparty/asio/src/examples/cpp03/ssl/server.pem
deleted file mode 100644
index 37ea6e26715..00000000000
--- a/3rdparty/asio/src/examples/cpp03/ssl/server.pem
+++ /dev/null
@@ -1,71 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDAzCCAesCCQD9QcRiWk0y9TANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJB
-VTEMMAoGA1UECBMDTlNXMQ8wDQYDVQQHEwZTeWRuZXkxDTALBgNVBAoTBGFzaW8w
-HhcNMTUxMTE4MjIzNzMxWhcNMjAxMTE2MjIzNzMxWjBMMQswCQYDVQQGEwJBVTEM
-MAoGA1UECBMDTlNXMQ8wDQYDVQQHEwZTeWRuZXkxDTALBgNVBAoTBGFzaW8xDzAN
-BgNVBAsTBnNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALr0
-+NXSklsGJR7HYHP/H4V5+KpYrmFKva/K7iiqi+XyWEjGnj+/iImJW26phhg9GouN
-JJxdrP7/0LwpMsEC/9v09dMNAEewtYhPgD4kiUH/E/79wVmayMZZZGrpF9Rw+wWv
-q58y3L1wKge3qilX6slVDdNhqU3vBiMKEJfsjE4PKcEVjPCjVJG2562eHK9FxyjQ
-DykyH61lQKBQOiElilPQKzAO7U36yTvs+chWuUfK47B8EC+PJ5KcLEppli4ljlwE
-w01HnGxwvjDLobKm2jL6CWi3aYGWudyTsNAd7YC5C7psktBypQLBcfp7uUrrR5Bb
-PEjFHJUWIlyoYvm2OjMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAtceVW6tixFsB
-ZRhjL5aRCcbx2iMwEXd54lcP6BWe1qOcDPHoSYI1zvvGzohbEvBfqUv78S9MtzaT
-gMe5rIU9M1ZM09PyaM6ZutGpKHE8L4qcOslTt41GQFsSqPFdcbgSV20MvBzjGayR
-AI/WV0avW3oasdetJPZCR7bRbCbMbWTgclUfv5F25ENcR+BhNuilfL15owL0s4sS
-Wb4jOOHhXV9iXeS2dH0snFqv4BmQ9ZoA7zbM9lG3EU5DuxHESYkCnzJyEqqY3vWv
-PFRViCxLp5LQLmkTQ3dglVQA4x6ZaonaewdPtdhjkLUuIqDvQx5+kIaOELbSws+c
-bREYlnGrFw==
------END CERTIFICATE-----
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: AES-256-CBC,D459676347D389E9135496D8AAFA7953
-
-wbrjxr9NHur8kgxDsgXOY9qFGKpONIQLxkuahUrDD/H+s/l7ugsLWOPsOXbjNL/7
-QYUBAx85HKm9D8BQ5g78Y82qfArap3/3IIuysDfQDh4fQodhVtmGTFiCOvudlGEp
-lq1niQRLThlxeRoFphH8KKiOTO9a/d8tdL7zRmiFwnVnhK4014mgVmgcSefA1AF5
-RbJAeMclUKddG6ltQK00ptg84CDXiMWQXFBGGmQ1av2lyFzC+xLP+qDqZAYTM9lZ
-NFRo2oEZP1ozfOVNSbXTanJgZ0DSSmhGE1PcVrHSeE/v+k1kPh3oVKi9GV51kIDC
-Zd9f/XltuDOzy1Ybn6gRy4nzNpzcwjSCIHEdSD5nxU5JfHfQ3OtnsEab7qf989iP
-s2LbCSp5uGTMvfesMIkixIZAQp2FeahZTAgU2Vx+wi5Kks68rOqeywEfzACL/Um5
-7XZu8gDs4MgRRWnxK1BbJDPifICLvSJZvgB9FKX/hk4FHFF+MtcrkalehCuLooDV
-3rfHNvRSbg7J97XQ3QC+k9ZDaumpy6n+LhaVv7BIJRBnBBtZ5Eg3DmPg6flqaHAU
-Y/8d82wb/pCmbvR3B1/Ebgs84DPJ+uZnY9M5Iwx19oqlVSR2ts/Tx619LGAm+BiQ
-7YDoC4CFmpAA8Uw0xnUbNgx94NdNmlnLeLtS50b0XlWpHKbVzmVbNYEjY6NHMlLt
-aqxWHTYTa7g/c1bg2/nxF1Lbfu5VSTROGBUuer1c3yzVuyBrjcX92Jp4BJH78qOp
-N6lY6MnH4HYRXHjzlt/S0ZzO0faPPe18Q8SWvnDVuE3fYzzL772B56d2t8eodc+/
-t6M3qJ60eXdsmgYOaPRLRUovN2xT2UUr0+biuguHyqfaVfcEU/adw+b9oUVE+5Nw
-nZHI5qhPnhLxChyZqbBl68zMUyKlfff4OyLvRGpfcHwBw6DTGjduB+DDsqqkcIB9
-2VL6nps7ZVCwMPI18siUd6cttEOf6ZXrVqHg9wfDvJOlh2NNKNLxSAFubHc90Jlj
-KejrWenXo2w6YkSUeTV4t4cWu7U8rXIkTJXDl1S6NO8DWqNDo5KjgJ2SK5NlSOJ7
-jgECn390ooneJOxxytPVQO2xppXQZZS65RHrvhB+ss5xUknly9q+ICyt6xTR9nqA
-PKkeSE6qVY0J4JgFXpkgQxgwMnjSED3LKr3jlz28pr5cC6tsc5SSlekHjT2fcSrX
-uccaVahaJRigf+q+4XzmJtdwbZU+YWGZRVMlQLA5yzPHQHDYkPpOeYU4WReND8S4
-TZRkPHaxOZ2lKQwJB93V8Vbt2MvwRy392452a33S4TcQLaWzoOljXjmZjrp2rvRz
-prBaNe8LnO4V8Oliv+H+E0UWiWFDuI+HBy4X4O9plsbw/gk64Phl9qLiBwaX/AIR
-66FXvC/czABo9oSt2jekcMtJofYr8Gr2bsJlt5ZX+GEOxz4jMv7xvz5/L3W7jVav
-pHGIv4xfN9FrXzL47O7UuUF9xZg4Rp/fxwpgEDNZmX/3DnP0ewZQUcgUX0pdqNGQ
-YVqJXcRF7KqG2NSQFuwPESZQnxU0WzSgRyUae7xg1WKfSuN8NVAzKhOgeqlD2IAo
------END RSA PRIVATE KEY-----
------BEGIN CERTIFICATE-----
-MIIDlzCCAn+gAwIBAgIJAMJYU3U6A0IRMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNV
-BAYTAkFVMQwwCgYDVQQIEwNOU1cxDzANBgNVBAcTBlN5ZG5leTENMAsGA1UEChME
-YXNpbzAeFw0xNTExMTgyMjMzNDhaFw0yMDExMTYyMjMzNDhaMDsxCzAJBgNVBAYT
-AkFVMQwwCgYDVQQIEwNOU1cxDzANBgNVBAcTBlN5ZG5leTENMAsGA1UEChMEYXNp
-bzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMcRJocHdVMdLUJ/pypY
-QVSTC0t3IIgjwjazrK3kAaoIMvzPmDFxEXWcDx+nyz8kQ/E38Ir/ef2BCNGci5hu
-wkfMSuMoW9l2N4hx3QCcF46tTDEZztFxWAH7QbE2wYMlMgKZSxWimNfq0YjxEEXb
-QM0lGPLFh7Xoko29H0F3LKaaQV9u/vop3Hs0h12HeWlY4PiLp7QQTNGqbWcXycA0
-NZ/fyismireyEvPAgo6L8iXuAi7g0TVKVNlrticGGjMcMq6IMvxzEpSMkuMQ5rWj
-pZjWOoBjSYBuXdblcBRvXhOr2Ws8jJLMZfehKq9q1reQfoGV6xMnbwmumSXbWRWT
-0vkCAwEAAaOBnTCBmjAdBgNVHQ4EFgQUK/Zv/AVtfIeucJw8VEtux1dhI1YwawYD
-VR0jBGQwYoAUK/Zv/AVtfIeucJw8VEtux1dhI1ahP6Q9MDsxCzAJBgNVBAYTAkFV
-MQwwCgYDVQQIEwNOU1cxDzANBgNVBAcTBlN5ZG5leTENMAsGA1UEChMEYXNpb4IJ
-AMJYU3U6A0IRMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABLYXimq
-v/HLyIJi7Xn8AJUsICj8LKF/J24nwwiF+ibf7UkoChJURs4nN78bod/lpDVPTEVl
-gTBdV/vBJs416sCEFfsGjqB9OBYj4gb0VaJDsQd0+NMvXp0faKv2y9wgScxG9/cg
-aM7eRmyfMn1qjb6tpNxVOPpe/nFi8Vx/1orejBRaZr4zF5TkoPepfwLWQeXDUIdE
-+QHZ60jZAkR5RXTVU4u3kOKcJs839pmJYyxM4H2VxpR18vy4/YdIVWkREIUM2OgT
-5iznIQIIgR56QRGP85uef+I6n0BHzrBk6du69bkQFxrFjLVGlal4bIQqSg4KGWgx
-dEdymMWzmMxpO9s=
------END CERTIFICATE-----
diff --git a/3rdparty/asio/src/examples/cpp03/timeouts/async_tcp_client.cpp b/3rdparty/asio/src/examples/cpp03/timeouts/async_tcp_client.cpp
deleted file mode 100644
index fe2d27fac9e..00000000000
--- a/3rdparty/asio/src/examples/cpp03/timeouts/async_tcp_client.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-//
-// async_tcp_client.cpp
-// ~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "asio/buffer.hpp"
-#include "asio/io_context.hpp"
-#include "asio/ip/tcp.hpp"
-#include "asio/read_until.hpp"
-#include "asio/steady_timer.hpp"
-#include "asio/write.hpp"
-#include <boost/bind/bind.hpp>
-#include <iostream>
-#include <string>
-
-using asio::steady_timer;
-using asio::ip::tcp;
-
-//
-// This class manages socket timeouts by applying the concept of a deadline.
-// Some asynchronous operations are given deadlines by which they must complete.
-// Deadlines are enforced by an "actor" that persists for the lifetime of the
-// client object:
-//
-// +----------------+
-// | |
-// | check_deadline |<---+
-// | | |
-// +----------------+ | async_wait()
-// | |
-// +---------+
-//
-// If the deadline actor determines that the deadline has expired, the socket
-// is closed and any outstanding operations are consequently cancelled.
-//
-// Connection establishment involves trying each endpoint in turn until a
-// connection is successful, or the available endpoints are exhausted. If the
-// deadline actor closes the socket, the connect actor is woken up and moves to
-// the next endpoint.
-//
-// +---------------+
-// | |
-// | start_connect |<---+
-// | | |
-// +---------------+ |
-// | |
-// async_- | +----------------+
-// connect() | | |
-// +--->| handle_connect |
-// | |
-// +----------------+
-// :
-// Once a connection is :
-// made, the connect :
-// actor forks in two - :
-// :
-// an actor for reading : and an actor for
-// inbound messages: : sending heartbeats:
-// :
-// +------------+ : +-------------+
-// | |<- - - - -+- - - - ->| |
-// | start_read | | start_write |<---+
-// | |<---+ | | |
-// +------------+ | +-------------+ | async_wait()
-// | | | |
-// async_- | +-------------+ async_- | +--------------+
-// read_- | | | write() | | |
-// until() +--->| handle_read | +--->| handle_write |
-// | | | |
-// +-------------+ +--------------+
-//
-// The input actor reads messages from the socket, where messages are delimited
-// by the newline character. The deadline for a complete message is 30 seconds.
-//
-// The heartbeat actor sends a heartbeat (a message that consists of a single
-// newline character) every 10 seconds. In this example, no deadline is applied
-// to message sending.
-//
-class client
-{
-public:
- client(asio::io_context& io_context)
- : stopped_(false),
- socket_(io_context),
- deadline_(io_context),
- heartbeat_timer_(io_context)
- {
- }
-
- // Called by the user of the client class to initiate the connection process.
- // The endpoints will have been obtained using a tcp::resolver.
- void start(tcp::resolver::results_type endpoints)
- {
- // Start the connect actor.
- endpoints_ = endpoints;
- start_connect(endpoints_.begin());
-
- // Start the deadline actor. You will note that we're not setting any
- // particular deadline here. Instead, the connect and input actors will
- // update the deadline prior to each asynchronous operation.
- deadline_.async_wait(boost::bind(&client::check_deadline, this));
- }
-
- // This function terminates all the actors to shut down the connection. It
- // may be called by the user of the client class, or by the class itself in
- // response to graceful termination or an unrecoverable error.
- void stop()
- {
- stopped_ = true;
- asio::error_code ignored_ec;
- socket_.close(ignored_ec);
- deadline_.cancel();
- heartbeat_timer_.cancel();
- }
-
-private:
- void start_connect(tcp::resolver::results_type::iterator endpoint_iter)
- {
- if (endpoint_iter != endpoints_.end())
- {
- std::cout << "Trying " << endpoint_iter->endpoint() << "...\n";
-
- // Set a deadline for the connect operation.
- deadline_.expires_after(asio::chrono::seconds(60));
-
- // Start the asynchronous connect operation.
- socket_.async_connect(endpoint_iter->endpoint(),
- boost::bind(&client::handle_connect, this,
- boost::placeholders::_1, endpoint_iter));
- }
- else
- {
- // There are no more endpoints to try. Shut down the client.
- stop();
- }
- }
-
- void handle_connect(const asio::error_code& ec,
- tcp::resolver::results_type::iterator endpoint_iter)
- {
- if (stopped_)
- return;
-
- // The async_connect() function automatically opens the socket at the start
- // of the asynchronous operation. If the socket is closed at this time then
- // the timeout handler must have run first.
- if (!socket_.is_open())
- {
- std::cout << "Connect timed out\n";
-
- // Try the next available endpoint.
- start_connect(++endpoint_iter);
- }
-
- // Check if the connect operation failed before the deadline expired.
- else if (ec)
- {
- std::cout << "Connect error: " << ec.message() << "\n";
-
- // We need to close the socket used in the previous connection attempt
- // before starting a new one.
- socket_.close();
-
- // Try the next available endpoint.
- start_connect(++endpoint_iter);
- }
-
- // Otherwise we have successfully established a connection.
- else
- {
- std::cout << "Connected to " << endpoint_iter->endpoint() << "\n";
-
- // Start the input actor.
- start_read();
-
- // Start the heartbeat actor.
- start_write();
- }
- }
-
- void start_read()
- {
- // Set a deadline for the read operation.
- deadline_.expires_after(asio::chrono::seconds(30));
-
- // Start an asynchronous operation to read a newline-delimited message.
- asio::async_read_until(socket_,
- asio::dynamic_buffer(input_buffer_), '\n',
- boost::bind(&client::handle_read, this,
- boost::placeholders::_1, boost::placeholders::_2));
- }
-
- void handle_read(const asio::error_code& ec, std::size_t n)
- {
- if (stopped_)
- return;
-
- if (!ec)
- {
- // Extract the newline-delimited message from the buffer.
- std::string line(input_buffer_.substr(0, n - 1));
- input_buffer_.erase(0, n);
-
- // Empty messages are heartbeats and so ignored.
- if (!line.empty())
- {
- std::cout << "Received: " << line << "\n";
- }
-
- start_read();
- }
- else
- {
- std::cout << "Error on receive: " << ec.message() << "\n";
-
- stop();
- }
- }
-
- void start_write()
- {
- if (stopped_)
- return;
-
- // Start an asynchronous operation to send a heartbeat message.
- asio::async_write(socket_, asio::buffer("\n", 1),
- boost::bind(&client::handle_write, this, boost::placeholders::_1));
- }
-
- void handle_write(const asio::error_code& ec)
- {
- if (stopped_)
- return;
-
- if (!ec)
- {
- // Wait 10 seconds before sending the next heartbeat.
- heartbeat_timer_.expires_after(asio::chrono::seconds(10));
- heartbeat_timer_.async_wait(boost::bind(&client::start_write, this));
- }
- else
- {
- std::cout << "Error on heartbeat: " << ec.message() << "\n";
-
- stop();
- }
- }
-
- void check_deadline()
- {
- if (stopped_)
- return;
-
- // Check whether the deadline has passed. We compare the deadline against
- // the current time since a new asynchronous operation may have moved the
- // deadline before this actor had a chance to run.
- if (deadline_.expiry() <= steady_timer::clock_type::now())
- {
- // The deadline has passed. The socket is closed so that any outstanding
- // asynchronous operations are cancelled.
- socket_.close();
-
- // There is no longer an active deadline. The expiry is set to the
- // maximum time point so that the actor takes no action until a new
- // deadline is set.
- deadline_.expires_at(steady_timer::time_point::max());
- }
-
- // Put the actor back to sleep.
- deadline_.async_wait(boost::bind(&client::check_deadline, this));
- }
-
-private:
- bool stopped_;
- tcp::resolver::results_type endpoints_;
- tcp::socket socket_;
- std::string input_buffer_;
- steady_timer deadline_;
- steady_timer heartbeat_timer_;
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cerr << "Usage: client <host> <port>\n";
- return 1;
- }
-
- asio::io_context io_context;
- tcp::resolver r(io_context);
- client c(io_context);
-
- c.start(r.resolve(argv[1], argv[2]));
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp b/3rdparty/asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp
deleted file mode 100644
index 67d0bcc7604..00000000000
--- a/3rdparty/asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// blocking_tcp_client.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "asio/buffer.hpp"
-#include "asio/connect.hpp"
-#include "asio/io_context.hpp"
-#include "asio/ip/tcp.hpp"
-#include "asio/read_until.hpp"
-#include "asio/system_error.hpp"
-#include "asio/write.hpp"
-#include <cstdlib>
-#include <iostream>
-#include <string>
-#include <boost/lambda/bind.hpp>
-#include <boost/lambda/lambda.hpp>
-
-using asio::ip::tcp;
-using boost::lambda::bind;
-using boost::lambda::var;
-using boost::lambda::_1;
-using boost::lambda::_2;
-
-//----------------------------------------------------------------------
-
-//
-// This class manages socket timeouts by running the io_context using the timed
-// io_context::run_for() member function. Each asynchronous operation is given
-// a timeout within which it must complete. The socket operations themselves
-// use boost::lambda function objects as completion handlers. For a given
-// socket operation, the client object runs the io_context to block thread
-// execution until the operation completes or the timeout is reached. If the
-// io_context::run_for() function times out, the socket is closed and the
-// outstanding asynchronous operation is cancelled.
-//
-class client
-{
-public:
- client()
- : socket_(io_context_)
- {
- }
-
- void connect(const std::string& host, const std::string& service,
- asio::chrono::steady_clock::duration timeout)
- {
- // Resolve the host name and service to a list of endpoints.
- tcp::resolver::results_type endpoints =
- tcp::resolver(io_context_).resolve(host, service);
-
- // Start the asynchronous operation itself. The boost::lambda function
- // object is used as a callback and will update the ec variable when the
- // operation completes. The blocking_udp_client.cpp example shows how you
- // can use boost::bind rather than boost::lambda.
- asio::error_code ec;
- asio::async_connect(socket_, endpoints, var(ec) = _1);
-
- // Run the operation until it completes, or until the timeout.
- run(timeout);
-
- // Determine whether a connection was successfully established.
- if (ec)
- throw asio::system_error(ec);
- }
-
- std::string read_line(asio::chrono::steady_clock::duration timeout)
- {
- // Start the asynchronous operation. The boost::lambda function object is
- // used as a callback and will update the ec variable when the operation
- // completes. The blocking_udp_client.cpp example shows how you can use
- // boost::bind rather than boost::lambda.
- asio::error_code ec;
- std::size_t n = 0;
- asio::async_read_until(socket_,
- asio::dynamic_buffer(input_buffer_),
- '\n', (var(ec) = _1, var(n) = _2));
-
- // Run the operation until it completes, or until the timeout.
- run(timeout);
-
- // Determine whether the read completed successfully.
- if (ec)
- throw asio::system_error(ec);
-
- std::string line(input_buffer_.substr(0, n - 1));
- input_buffer_.erase(0, n);
- return line;
- }
-
- void write_line(const std::string& line,
- asio::chrono::steady_clock::duration timeout)
- {
- std::string data = line + "\n";
-
- // Start the asynchronous operation. The boost::lambda function object is
- // used as a callback and will update the ec variable when the operation
- // completes. The blocking_udp_client.cpp example shows how you can use
- // boost::bind rather than boost::lambda.
- asio::error_code ec;
- asio::async_write(socket_, asio::buffer(data), var(ec) = _1);
-
- // Run the operation until it completes, or until the timeout.
- run(timeout);
-
- // Determine whether the read completed successfully.
- if (ec)
- throw asio::system_error(ec);
- }
-
-private:
- void run(asio::chrono::steady_clock::duration timeout)
- {
- // Restart the io_context, as it may have been left in the "stopped" state
- // by a previous operation.
- io_context_.restart();
-
- // Block until the asynchronous operation has completed, or timed out. If
- // the pending asynchronous operation is a composed operation, the deadline
- // applies to the entire operation, rather than individual operations on
- // the socket.
- io_context_.run_for(timeout);
-
- // If the asynchronous operation completed successfully then the io_context
- // would have been stopped due to running out of work. If it was not
- // stopped, then the io_context::run_for call must have timed out.
- if (!io_context_.stopped())
- {
- // Close the socket to cancel the outstanding asynchronous operation.
- socket_.close();
-
- // Run the io_context again until the operation completes.
- io_context_.run();
- }
- }
-
- asio::io_context io_context_;
- tcp::socket socket_;
- std::string input_buffer_;
-};
-
-//----------------------------------------------------------------------
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 4)
- {
- std::cerr << "Usage: blocking_tcp_client <host> <port> <message>\n";
- return 1;
- }
-
- client c;
- c.connect(argv[1], argv[2], asio::chrono::seconds(10));
-
- asio::chrono::steady_clock::time_point time_sent =
- asio::chrono::steady_clock::now();
-
- c.write_line(argv[3], asio::chrono::seconds(10));
-
- for (;;)
- {
- std::string line = c.read_line(asio::chrono::seconds(10));
-
- // Keep going until we get back the line that was sent.
- if (line == argv[3])
- break;
- }
-
- asio::chrono::steady_clock::time_point time_received =
- asio::chrono::steady_clock::now();
-
- std::cout << "Round trip time: ";
- std::cout << asio::chrono::duration_cast<
- asio::chrono::microseconds>(
- time_received - time_sent).count();
- std::cout << " microseconds\n";
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp b/3rdparty/asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp
deleted file mode 100644
index 45b56cb0263..00000000000
--- a/3rdparty/asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-//
-// blocking_token_tcp_client.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "asio/connect.hpp"
-#include "asio/io_context.hpp"
-#include "asio/ip/tcp.hpp"
-#include "asio/read_until.hpp"
-#include "asio/streambuf.hpp"
-#include "asio/system_error.hpp"
-#include "asio/write.hpp"
-#include <cstdlib>
-#include <iostream>
-#include <memory>
-#include <string>
-
-using asio::ip::tcp;
-
-// We will use our sockets only with an io_context.
-typedef asio::basic_stream_socket<tcp,
- asio::io_context::executor_type> tcp_socket;
-
-//----------------------------------------------------------------------
-
-// A custom completion token that makes asynchronous operations behave as
-// though they are blocking calls with a timeout.
-struct close_after
-{
- close_after(asio::chrono::steady_clock::duration t, tcp_socket& s)
- : timeout_(t), socket_(s)
- {
- }
-
- // The maximum time to wait for an asynchronous operation to complete.
- asio::chrono::steady_clock::duration timeout_;
-
- // The socket to be closed if the operation does not complete in time.
- tcp_socket& socket_;
-};
-
-namespace asio {
-
-// The async_result template is specialised to allow the close_after token to
-// be used with asynchronous operations that have a completion signature of
-// void(error_code, T). Generalising this for all completion signature forms is
-// left as an exercise for the reader.
-template <typename T>
-class async_result<close_after, void(asio::error_code, T)>
-{
-public:
- // An asynchronous operation's initiating function automatically creates an
- // completion_handler_type object from the token. This function object is
- // then called on completion of the asynchronous operation.
- class completion_handler_type
- {
- public:
- completion_handler_type(const close_after& token)
- : token_(token)
- {
- }
-
- void operator()(asio::error_code ec, T t)
- {
- *ec_ = ec;
- *t_ = t;
- }
-
- private:
- friend class async_result;
- close_after token_;
- asio::error_code* ec_;
- T* t_;
- };
-
- // The async_result constructor associates the completion handler object with
- // the result of the initiating function.
- explicit async_result(completion_handler_type& h)
- : timeout_(h.token_.timeout_),
- socket_(h.token_.socket_)
- {
- h.ec_ = &ec_;
- h.t_ = &t_;
- }
-
- // The return_type typedef determines the result type of the asynchronous
- // operation's initiating function.
- typedef T return_type;
-
- // The get() function is used to obtain the result of the asynchronous
- // operation's initiating function. For the close_after completion token, we
- // use this function to run the io_context until the operation is complete.
- return_type get()
- {
- asio::io_context& io_context = asio::query(
- socket_.get_executor(), asio::execution::context);
-
- // Restart the io_context, as it may have been left in the "stopped" state
- // by a previous operation.
- io_context.restart();
-
- // Block until the asynchronous operation has completed, or timed out. If
- // the pending asynchronous operation is a composed operation, the deadline
- // applies to the entire operation, rather than individual operations on
- // the socket.
- io_context.run_for(timeout_);
-
- // If the asynchronous operation completed successfully then the io_context
- // would have been stopped due to running out of work. If it was not
- // stopped, then the io_context::run_for call must have timed out and the
- // operation is still incomplete.
- if (!io_context.stopped())
- {
- // Close the socket to cancel the outstanding asynchronous operation.
- socket_.close();
-
- // Run the io_context again until the operation completes.
- io_context.run();
- }
-
- // If the operation failed, throw an exception. Otherwise return the result.
- return ec_ ? throw asio::system_error(ec_) : t_;
- }
-
-private:
- asio::chrono::steady_clock::duration timeout_;
- tcp_socket& socket_;
- asio::error_code ec_;
- T t_;
-};
-
-} // namespace asio
-
-//----------------------------------------------------------------------
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 4)
- {
- std::cerr << "Usage: blocking_tcp_client <host> <port> <message>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- // Resolve the host name and service to a list of endpoints.
- tcp::resolver::results_type endpoints =
- tcp::resolver(io_context).resolve(argv[1], argv[2]);
-
- tcp_socket socket(io_context);
-
- // Run an asynchronous connect operation with a timeout.
- asio::async_connect(socket, endpoints,
- close_after(asio::chrono::seconds(10), socket));
-
- asio::chrono::steady_clock::time_point time_sent =
- asio::chrono::steady_clock::now();
-
- // Run an asynchronous write operation with a timeout.
- std::string msg = argv[3] + std::string("\n");
- asio::async_write(socket, asio::buffer(msg),
- close_after(asio::chrono::seconds(10), socket));
-
- for (std::string input_buffer;;)
- {
- // Run an asynchronous read operation with a timeout.
- std::size_t n = asio::async_read_until(socket,
- asio::dynamic_buffer(input_buffer), '\n',
- close_after(asio::chrono::seconds(10), socket));
-
- std::string line(input_buffer.substr(0, n - 1));
- input_buffer.erase(0, n);
-
- // Keep going until we get back the line that was sent.
- if (line == argv[3])
- break;
- }
-
- asio::chrono::steady_clock::time_point time_received =
- asio::chrono::steady_clock::now();
-
- std::cout << "Round trip time: ";
- std::cout << asio::chrono::duration_cast<
- asio::chrono::microseconds>(
- time_received - time_sent).count();
- std::cout << " microseconds\n";
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp b/3rdparty/asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp
deleted file mode 100644
index 43b55ef43ff..00000000000
--- a/3rdparty/asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// blocking_udp_client.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 "asio/buffer.hpp"
-#include "asio/io_context.hpp"
-#include "asio/ip/udp.hpp"
-#include <cstdlib>
-#include <boost/bind/bind.hpp>
-#include <iostream>
-
-using asio::ip::udp;
-
-//----------------------------------------------------------------------
-
-//
-// This class manages socket timeouts by running the io_context using the timed
-// io_context::run_for() member function. Each asynchronous operation is given
-// a timeout within which it must complete. The socket operations themselves
-// use boost::bind to specify the completion handler:
-//
-// +---------------+
-// | |
-// | receive |
-// | |
-// +---------------+
-// |
-// async_- | +----------------+
-// receive() | | |
-// +--->| handle_receive |
-// | |
-// +----------------+
-//
-// For a given socket operation, the client object runs the io_context to block
-// thread execution until the operation completes or the timeout is reached. If
-// the io_context::run_for() function times out, the socket is closed and the
-// outstanding asynchronous operation is cancelled.
-//
-class client
-{
-public:
- client(const udp::endpoint& listen_endpoint)
- : socket_(io_context_, listen_endpoint)
- {
- }
-
- std::size_t receive(const asio::mutable_buffer& buffer,
- asio::chrono::steady_clock::duration timeout,
- asio::error_code& ec)
- {
- // Start the asynchronous operation. The handle_receive function used as a
- // callback will update the ec and length variables.
- std::size_t length = 0;
- socket_.async_receive(asio::buffer(buffer),
- boost::bind(&client::handle_receive,
- boost::placeholders::_1, boost::placeholders::_2, &ec, &length));
-
- // Run the operation until it completes, or until the timeout.
- run(timeout);
-
- return length;
- }
-
-private:
- void run(asio::chrono::steady_clock::duration timeout)
- {
- // Restart the io_context, as it may have been left in the "stopped" state
- // by a previous operation.
- io_context_.restart();
-
- // Block until the asynchronous operation has completed, or timed out. If
- // the pending asynchronous operation is a composed operation, the deadline
- // applies to the entire operation, rather than individual operations on
- // the socket.
- io_context_.run_for(timeout);
-
- // If the asynchronous operation completed successfully then the io_context
- // would have been stopped due to running out of work. If it was not
- // stopped, then the io_context::run_for call must have timed out.
- if (!io_context_.stopped())
- {
- // Cancel the outstanding asynchronous operation.
- socket_.cancel();
-
- // Run the io_context again until the operation completes.
- io_context_.run();
- }
- }
-
- static void handle_receive(
- const asio::error_code& ec, std::size_t length,
- asio::error_code* out_ec, std::size_t* out_length)
- {
- *out_ec = ec;
- *out_length = length;
- }
-
-private:
- asio::io_context io_context_;
- udp::socket socket_;
-};
-
-//----------------------------------------------------------------------
-
-int main(int argc, char* argv[])
-{
- try
- {
- using namespace std; // For atoi.
-
- if (argc != 3)
- {
- std::cerr << "Usage: blocking_udp_client <listen_addr> <listen_port>\n";
- return 1;
- }
-
- udp::endpoint listen_endpoint(
- asio::ip::make_address(argv[1]),
- std::atoi(argv[2]));
-
- client c(listen_endpoint);
-
- for (;;)
- {
- char data[1024];
- asio::error_code ec;
- std::size_t n = c.receive(asio::buffer(data),
- asio::chrono::seconds(10), ec);
-
- if (ec)
- {
- std::cout << "Receive error: " << ec.message() << "\n";
- }
- else
- {
- std::cout << "Received: ";
- std::cout.write(data, n);
- std::cout << "\n";
- }
- }
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/timeouts/server.cpp b/3rdparty/asio/src/examples/cpp03/timeouts/server.cpp
deleted file mode 100644
index bee77d414a2..00000000000
--- a/3rdparty/asio/src/examples/cpp03/timeouts/server.cpp
+++ /dev/null
@@ -1,433 +0,0 @@
-//
-// server.cpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <algorithm>
-#include <cstdlib>
-#include <deque>
-#include <iostream>
-#include <set>
-#include <string>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include "asio/buffer.hpp"
-#include "asio/io_context.hpp"
-#include "asio/ip/tcp.hpp"
-#include "asio/ip/udp.hpp"
-#include "asio/read_until.hpp"
-#include "asio/steady_timer.hpp"
-#include "asio/write.hpp"
-
-using asio::steady_timer;
-using asio::ip::tcp;
-using asio::ip::udp;
-
-//----------------------------------------------------------------------
-
-class subscriber
-{
-public:
- virtual ~subscriber() {}
- virtual void deliver(const std::string& msg) = 0;
-};
-
-typedef boost::shared_ptr<subscriber> subscriber_ptr;
-
-//----------------------------------------------------------------------
-
-class channel
-{
-public:
- void join(subscriber_ptr subscriber)
- {
- subscribers_.insert(subscriber);
- }
-
- void leave(subscriber_ptr subscriber)
- {
- subscribers_.erase(subscriber);
- }
-
- void deliver(const std::string& msg)
- {
- std::for_each(subscribers_.begin(), subscribers_.end(),
- boost::bind(&subscriber::deliver,
- boost::placeholders::_1, boost::ref(msg)));
- }
-
-private:
- std::set<subscriber_ptr> subscribers_;
-};
-
-//----------------------------------------------------------------------
-
-//
-// This class manages socket timeouts by applying the concept of a deadline.
-// Some asynchronous operations are given deadlines by which they must complete.
-// Deadlines are enforced by two "actors" that persist for the lifetime of the
-// session object, one for input and one for output:
-//
-// +----------------+ +----------------+
-// | | | |
-// | check_deadline |<---+ | check_deadline |<---+
-// | | | async_wait() | | | async_wait()
-// +----------------+ | on input +----------------+ | on output
-// | | deadline | | deadline
-// +---------+ +---------+
-//
-// If either deadline actor determines that the corresponding deadline has
-// expired, the socket is closed and any outstanding operations are cancelled.
-//
-// The input actor reads messages from the socket, where messages are delimited
-// by the newline character:
-//
-// +------------+
-// | |
-// | start_read |<---+
-// | | |
-// +------------+ |
-// | |
-// async_- | +-------------+
-// read_- | | |
-// until() +--->| handle_read |
-// | |
-// +-------------+
-//
-// The deadline for receiving a complete message is 30 seconds. If a non-empty
-// message is received, it is delivered to all subscribers. If a heartbeat (a
-// message that consists of a single newline character) is received, a heartbeat
-// is enqueued for the client, provided there are no other messages waiting to
-// be sent.
-//
-// The output actor is responsible for sending messages to the client:
-//
-// +--------------+
-// | |<---------------------+
-// | await_output | |
-// | |<---+ |
-// +--------------+ | |
-// | | | async_wait() |
-// | +--------+ |
-// V |
-// +-------------+ +--------------+
-// | | async_write() | |
-// | start_write |-------------->| handle_write |
-// | | | |
-// +-------------+ +--------------+
-//
-// The output actor first waits for an output message to be enqueued. It does
-// this by using a steady_timer as an asynchronous condition variable. The
-// steady_timer will be signalled whenever the output queue is non-empty.
-//
-// Once a message is available, it is sent to the client. The deadline for
-// sending a complete message is 30 seconds. After the message is successfully
-// sent, the output actor again waits for the output queue to become non-empty.
-//
-class tcp_session
- : public subscriber,
- public boost::enable_shared_from_this<tcp_session>
-{
-public:
- tcp_session(asio::io_context& io_context, channel& ch)
- : channel_(ch),
- socket_(io_context),
- input_deadline_(io_context),
- non_empty_output_queue_(io_context),
- output_deadline_(io_context)
- {
- input_deadline_.expires_at(steady_timer::time_point::max());
- output_deadline_.expires_at(steady_timer::time_point::max());
-
- // The non_empty_output_queue_ steady_timer is set to the maximum time
- // point whenever the output queue is empty. This ensures that the output
- // actor stays asleep until a message is put into the queue.
- non_empty_output_queue_.expires_at(steady_timer::time_point::max());
- }
-
- tcp::socket& socket()
- {
- return socket_;
- }
-
- // Called by the server object to initiate the four actors.
- void start()
- {
- channel_.join(shared_from_this());
-
- start_read();
-
- input_deadline_.async_wait(
- boost::bind(&tcp_session::check_deadline,
- shared_from_this(), &input_deadline_));
-
- await_output();
-
- output_deadline_.async_wait(
- boost::bind(&tcp_session::check_deadline,
- shared_from_this(), &output_deadline_));
- }
-
-private:
- void stop()
- {
- channel_.leave(shared_from_this());
-
- asio::error_code ignored_ec;
- socket_.close(ignored_ec);
- input_deadline_.cancel();
- non_empty_output_queue_.cancel();
- output_deadline_.cancel();
- }
-
- bool stopped() const
- {
- return !socket_.is_open();
- }
-
- void deliver(const std::string& msg)
- {
- output_queue_.push_back(msg + "\n");
-
- // Signal that the output queue contains messages. Modifying the expiry
- // will wake the output actor, if it is waiting on the timer.
- non_empty_output_queue_.expires_at(steady_timer::time_point::min());
- }
-
- void start_read()
- {
- // Set a deadline for the read operation.
- input_deadline_.expires_after(asio::chrono::seconds(30));
-
- // Start an asynchronous operation to read a newline-delimited message.
- asio::async_read_until(socket_,
- asio::dynamic_buffer(input_buffer_), '\n',
- boost::bind(&tcp_session::handle_read, shared_from_this(),
- boost::placeholders::_1, boost::placeholders::_2));
- }
-
- void handle_read(const asio::error_code& ec, std::size_t n)
- {
- if (stopped())
- return;
-
- if (!ec)
- {
- // Extract the newline-delimited message from the buffer.
- std::string msg(input_buffer_.substr(0, n - 1));
- input_buffer_.erase(0, n);
-
- if (!msg.empty())
- {
- channel_.deliver(msg);
- }
- else
- {
- // We received a heartbeat message from the client. If there's nothing
- // else being sent or ready to be sent, send a heartbeat right back.
- if (output_queue_.empty())
- {
- output_queue_.push_back("\n");
-
- // Signal that the output queue contains messages. Modifying the
- // expiry will wake the output actor, if it is waiting on the timer.
- non_empty_output_queue_.expires_at(steady_timer::time_point::min());
- }
- }
-
- start_read();
- }
- else
- {
- stop();
- }
- }
-
- void await_output()
- {
- if (stopped())
- return;
-
- if (output_queue_.empty())
- {
- // There are no messages that are ready to be sent. The actor goes to
- // sleep by waiting on the non_empty_output_queue_ timer. When a new
- // message is added, the timer will be modified and the actor will wake.
- non_empty_output_queue_.expires_at(steady_timer::time_point::max());
- non_empty_output_queue_.async_wait(
- boost::bind(&tcp_session::await_output, shared_from_this()));
- }
- else
- {
- start_write();
- }
- }
-
- void start_write()
- {
- // Set a deadline for the write operation.
- output_deadline_.expires_after(asio::chrono::seconds(30));
-
- // Start an asynchronous operation to send a message.
- asio::async_write(socket_,
- asio::buffer(output_queue_.front()),
- boost::bind(&tcp_session::handle_write,
- shared_from_this(), boost::placeholders::_1));
- }
-
- void handle_write(const asio::error_code& ec)
- {
- if (stopped())
- return;
-
- if (!ec)
- {
- output_queue_.pop_front();
-
- await_output();
- }
- else
- {
- stop();
- }
- }
-
- void check_deadline(steady_timer* deadline)
- {
- if (stopped())
- return;
-
- // Check whether the deadline has passed. We compare the deadline against
- // the current time since a new asynchronous operation may have moved the
- // deadline before this actor had a chance to run.
- if (deadline->expiry() <= steady_timer::clock_type::now())
- {
- // The deadline has passed. Stop the session. The other actors will
- // terminate as soon as possible.
- stop();
- }
- else
- {
- // Put the actor back to sleep.
- deadline->async_wait(
- boost::bind(&tcp_session::check_deadline,
- shared_from_this(), deadline));
- }
- }
-
- channel& channel_;
- tcp::socket socket_;
- std::string input_buffer_;
- steady_timer input_deadline_;
- std::deque<std::string> output_queue_;
- steady_timer non_empty_output_queue_;
- steady_timer output_deadline_;
-};
-
-typedef boost::shared_ptr<tcp_session> tcp_session_ptr;
-
-//----------------------------------------------------------------------
-
-class udp_broadcaster
- : public subscriber
-{
-public:
- udp_broadcaster(asio::io_context& io_context,
- const udp::endpoint& broadcast_endpoint)
- : socket_(io_context)
- {
- socket_.connect(broadcast_endpoint);
- socket_.set_option(udp::socket::broadcast(true));
- }
-
-private:
- void deliver(const std::string& msg)
- {
- asio::error_code ignored_ec;
- socket_.send(asio::buffer(msg), 0, ignored_ec);
- }
-
- udp::socket socket_;
-};
-
-//----------------------------------------------------------------------
-
-class server
-{
-public:
- server(asio::io_context& io_context,
- const tcp::endpoint& listen_endpoint,
- const udp::endpoint& broadcast_endpoint)
- : io_context_(io_context),
- acceptor_(io_context, listen_endpoint)
- {
- subscriber_ptr bc(new udp_broadcaster(io_context_, broadcast_endpoint));
- channel_.join(bc);
-
- start_accept();
- }
-
- void start_accept()
- {
- tcp_session_ptr new_session(new tcp_session(io_context_, channel_));
-
- acceptor_.async_accept(new_session->socket(),
- boost::bind(&server::handle_accept,
- this, new_session, boost::placeholders::_1));
- }
-
- void handle_accept(tcp_session_ptr session,
- const asio::error_code& ec)
- {
- if (!ec)
- {
- session->start();
- }
-
- start_accept();
- }
-
-private:
- asio::io_context& io_context_;
- tcp::acceptor acceptor_;
- channel channel_;
-};
-
-//----------------------------------------------------------------------
-
-int main(int argc, char* argv[])
-{
- try
- {
- using namespace std; // For atoi.
-
- if (argc != 4)
- {
- std::cerr << "Usage: server <listen_port> <bcast_address> <bcast_port>\n";
- return 1;
- }
-
- asio::io_context io_context;
-
- tcp::endpoint listen_endpoint(tcp::v4(), atoi(argv[1]));
-
- udp::endpoint broadcast_endpoint(
- asio::ip::make_address(argv[2]), atoi(argv[3]));
-
- server s(io_context, listen_endpoint, broadcast_endpoint);
-
- io_context.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp03/timers/time_t_timer.cpp b/3rdparty/asio/src/examples/cpp03/timers/time_t_timer.cpp
deleted file mode 100644
index 74426b3c71d..00000000000
--- a/3rdparty/asio/src/examples/cpp03/timers/time_t_timer.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// time_t_timer.cpp
-// ~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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 <asio.hpp>
-#include <ctime>
-#include <iostream>
-
-// A custom implementation of the Clock concept from the standard C++ library.
-struct time_t_clock
-{
- // The duration type.
- typedef asio::chrono::steady_clock::duration duration;
-
- // The duration's underlying arithmetic representation.
- typedef duration::rep rep;
-
- // The ratio representing the duration's tick period.
- typedef duration::period period;
-
- // An absolute time point represented using the clock.
- typedef asio::chrono::time_point<time_t_clock> time_point;
-
- // The clock is not monotonically increasing.
- static const bool is_steady = false;
-
- // Get the current time.
- static time_point now()
- {
- return time_point() + asio::chrono::seconds(std::time(0));
- }
-};
-
-// The asio::basic_waitable_timer template accepts an optional WaitTraits
-// template parameter. The underlying time_t clock has one-second granularity,
-// so these traits may be customised to reduce the latency between the clock
-// ticking over and a wait operation's completion. When the timeout is near
-// (less than one second away) we poll the clock more frequently to detect the
-// time change closer to when it occurs. The user can select the appropriate
-// trade off between accuracy and the increased CPU cost of polling. In extreme
-// cases, a zero duration may be returned to make the timers as accurate as
-// possible, albeit with 100% CPU usage.
-struct time_t_wait_traits
-{
- // Determine how long until the clock should be next polled to determine
- // whether the duration has elapsed.
- static time_t_clock::duration to_wait_duration(
- const time_t_clock::duration& d)
- {
- if (d > asio::chrono::seconds(1))
- return d - asio::chrono::seconds(1);
- else if (d > asio::chrono::seconds(0))
- return asio::chrono::milliseconds(10);
- else
- return asio::chrono::seconds(0);
- }
-
- // Determine how long until the clock should be next polled to determine
- // whether the absoluate time has been reached.
- static time_t_clock::duration to_wait_duration(
- const time_t_clock::time_point& t)
- {
- return to_wait_duration(t - time_t_clock::now());
- }
-};
-
-typedef asio::basic_waitable_timer<
- time_t_clock, time_t_wait_traits> time_t_timer;
-
-void handle_timeout(const asio::error_code&)
-{
- std::cout << "handle_timeout\n";
-}
-
-int main()
-{
- try
- {
- asio::io_context io_context;
-
- time_t_timer timer(io_context);
-
- timer.expires_after(asio::chrono::seconds(5));
- std::cout << "Starting synchronous wait\n";
- timer.wait();
- std::cout << "Finished synchronous wait\n";
-
- timer.expires_after(asio::chrono::seconds(5));
- std::cout << "Starting asynchronous wait\n";
- timer.async_wait(&handle_timeout);
- io_context.run();
- std::cout << "Finished asynchronous wait\n";
- }
- catch (std::exception& e)
- {
- std::cout << "Exception: " << e.what() << "\n";
- }
-
- return 0;
-}
diff --git a/3rdparty/asio/src/examples/cpp11/Makefile.am b/3rdparty/asio/src/examples/cpp11/Makefile.am
index bc2e1034021..a132a469ff5 100644
--- a/3rdparty/asio/src/examples/cpp11/Makefile.am
+++ b/3rdparty/asio/src/examples/cpp11/Makefile.am
@@ -14,6 +14,8 @@ noinst_PROGRAMS = \
buffers/reference_counted \
chat/chat_client \
chat/chat_server \
+ deferred/deferred_1 \
+ deferred/deferred_2 \
echo/async_tcp_echo_server \
echo/async_udp_echo_server \
echo/blocking_tcp_echo_client \
@@ -26,10 +28,20 @@ noinst_PROGRAMS = \
executors/fork_join \
executors/pipeline \
executors/priority_scheduler \
+ files/blocking_file_copy \
+ files/async_file_copy \
futures/daytime_client \
handler_tracking/async_tcp_echo_server \
+ http/client/async_client \
+ http/client/sync_client \
http/server/http_server \
+ http/server2/http_server \
+ http/server3/http_server \
+ http/server4/http_server \
+ icmp/ping \
invocation/prioritised_handlers \
+ iostreams/daytime_client \
+ iostreams/daytime_server \
iostreams/http_client \
multicast/receiver \
multicast/sender \
@@ -42,22 +54,51 @@ noinst_PROGRAMS = \
operations/composed_6 \
operations/composed_7 \
operations/composed_8 \
+ parallel_group/ranged_wait_for_all \
+ parallel_group/wait_for_all \
+ parallel_group/wait_for_one \
+ parallel_group/wait_for_one_error \
+ parallel_group/wait_for_one_success \
+ porthopper/client \
+ porthopper/server \
+ services/daytime_client \
socks4/sync_client \
timeouts/async_tcp_client \
timeouts/blocking_tcp_client \
timeouts/blocking_token_tcp_client \
timeouts/blocking_udp_client \
timeouts/server \
- timers/time_t_timer
+ timers/time_t_timer \
+ tutorial/timer1/timer \
+ tutorial/timer2/timer \
+ tutorial/timer3/timer \
+ tutorial/timer4/timer \
+ tutorial/timer5/timer \
+ tutorial/daytime1/client \
+ tutorial/daytime2/server \
+ tutorial/daytime3/server \
+ tutorial/daytime4/client \
+ tutorial/daytime5/server \
+ tutorial/daytime6/server \
+ tutorial/daytime7/server \
+ type_erasure/type_erasure
if !WINDOWS_TARGET
noinst_PROGRAMS += \
+ chat/posix_chat_client \
fork/daemon \
fork/process_per_connection \
local/connect_pair \
local/iostream_client \
local/stream_server \
- local/stream_client
+ local/stream_client \
+ local/fd_passing_stream_server \
+ local/fd_passing_stream_client
+endif
+
+if WINDOWS_TARGET
+noinst_PROGRAMS += \
+ windows/transmit_file
endif
if HAVE_OPENSSL
@@ -73,8 +114,51 @@ noinst_PROGRAMS += \
endif
noinst_HEADERS = \
+ chat/chat_message.hpp \
+ handler_tracking/custom_tracking.hpp \
+ http/server/connection.hpp \
+ http/server/connection_manager.hpp \
+ http/server/header.hpp \
+ http/server/mime_types.hpp \
+ http/server/reply.hpp \
+ http/server/request.hpp \
+ http/server/request_handler.hpp \
+ http/server/request_parser.hpp \
+ http/server/server.hpp \
+ http/server2/connection.hpp \
+ http/server2/io_context_pool.hpp \
+ http/server2/header.hpp \
+ http/server2/mime_types.hpp \
+ http/server2/reply.hpp \
+ http/server2/request.hpp \
+ http/server2/request_handler.hpp \
+ http/server2/request_parser.hpp \
+ http/server2/server.hpp \
+ http/server3/connection.hpp \
+ http/server3/header.hpp \
+ http/server3/mime_types.hpp \
+ http/server3/reply.hpp \
+ http/server3/request.hpp \
+ http/server3/request_handler.hpp \
+ http/server3/request_parser.hpp \
+ http/server3/server.hpp \
+ http/server4/file_handler.hpp \
+ http/server4/header.hpp \
+ http/server4/mime_types.hpp \
+ http/server4/reply.hpp \
+ http/server4/request.hpp \
+ http/server4/request_parser.hpp \
+ http/server4/server.hpp \
+ icmp/icmp_header.hpp \
+ icmp/ipv4_header.hpp \
+ porthopper/protocol.hpp \
+ services/basic_logger.hpp \
+ services/logger.hpp \
+ services/logger_service.hpp \
socks4/socks4.hpp \
- chat/chat_message.hpp
+ type_erasure/line_reader.hpp \
+ type_erasure/stdin_line_reader.hpp \
+ type_erasure/sleep.hpp
AM_CXXFLAGS = -I$(srcdir)/../../../include
@@ -82,6 +166,8 @@ allocation_server_SOURCES = allocation/server.cpp
buffers_reference_counted_SOURCES = buffers/reference_counted.cpp
chat_chat_client_SOURCES = chat/chat_client.cpp
chat_chat_server_SOURCES = chat/chat_server.cpp
+deferred_deferred_1_SOURCES = deferred/deferred_1.cpp
+deferred_deferred_2_SOURCES = deferred/deferred_2.cpp
echo_async_tcp_echo_server_SOURCES = echo/async_tcp_echo_server.cpp
echo_async_udp_echo_server_SOURCES = echo/async_udp_echo_server.cpp
echo_blocking_tcp_echo_client_SOURCES = echo/blocking_tcp_echo_client.cpp
@@ -94,8 +180,12 @@ executors_bank_account_2_SOURCES = executors/bank_account_2.cpp
executors_fork_join_SOURCES = executors/fork_join.cpp
executors_pipeline_SOURCES = executors/pipeline.cpp
executors_priority_scheduler_SOURCES = executors/priority_scheduler.cpp
+files_blocking_file_copy_SOURCES = files/blocking_file_copy.cpp
+files_async_file_copy_SOURCES = files/async_file_copy.cpp
futures_daytime_client_SOURCES = futures/daytime_client.cpp
handler_tracking_async_tcp_echo_server_SOURCES = handler_tracking/async_tcp_echo_server.cpp
+http_client_async_client_SOURCES = http/client/async_client.cpp
+http_client_sync_client_SOURCES = http/client/sync_client.cpp
http_server_http_server_SOURCES = \
http/server/connection.cpp \
http/server/connection_manager.cpp \
@@ -105,7 +195,34 @@ http_server_http_server_SOURCES = \
http/server/request_handler.cpp \
http/server/request_parser.cpp \
http/server/server.cpp
+http_server2_http_server_SOURCES = \
+ http/server2/connection.cpp \
+ http/server2/io_context_pool.cpp \
+ http/server2/main.cpp \
+ http/server2/mime_types.cpp \
+ http/server2/reply.cpp \
+ http/server2/request_handler.cpp \
+ http/server2/request_parser.cpp \
+ http/server2/server.cpp
+http_server3_http_server_SOURCES = \
+ http/server3/connection.cpp \
+ http/server3/main.cpp \
+ http/server3/mime_types.cpp \
+ http/server3/reply.cpp \
+ http/server3/request_handler.cpp \
+ http/server3/request_parser.cpp \
+ http/server3/server.cpp
+http_server4_http_server_SOURCES = \
+ http/server4/file_handler.cpp \
+ http/server4/main.cpp \
+ http/server4/mime_types.cpp \
+ http/server4/reply.cpp \
+ http/server4/request_parser.cpp \
+ http/server4/server.cpp
+icmp_ping_SOURCES = icmp/ping.cpp
invocation_prioritised_handlers_SOURCES = invocation/prioritised_handlers.cpp
+iostreams_daytime_client_SOURCES = iostreams/daytime_client.cpp
+iostreams_daytime_server_SOURCES = iostreams/daytime_server.cpp
iostreams_http_client_SOURCES = iostreams/http_client.cpp
multicast_receiver_SOURCES = multicast/receiver.cpp
multicast_sender_SOURCES = multicast/sender.cpp
@@ -118,6 +235,16 @@ operations_composed_5_SOURCES = operations/composed_5.cpp
operations_composed_6_SOURCES = operations/composed_6.cpp
operations_composed_7_SOURCES = operations/composed_7.cpp
operations_composed_8_SOURCES = operations/composed_8.cpp
+parallel_group_ranged_wait_for_all_SOURCES = parallel_group/ranged_wait_for_all.cpp
+parallel_group_wait_for_all_SOURCES = parallel_group/wait_for_all.cpp
+parallel_group_wait_for_one_SOURCES = parallel_group/wait_for_one.cpp
+parallel_group_wait_for_one_error_SOURCES = parallel_group/wait_for_one_error.cpp
+parallel_group_wait_for_one_success_SOURCES = parallel_group/wait_for_one_success.cpp
+porthopper_client_SOURCES = porthopper/client.cpp
+porthopper_server_SOURCES = porthopper/server.cpp
+services_daytime_client_SOURCES = \
+ services/daytime_client.cpp \
+ services/logger_service.cpp
socks4_sync_client_SOURCES = socks4/sync_client.cpp
timeouts_async_tcp_client_SOURCES = timeouts/async_tcp_client.cpp
timeouts_blocking_tcp_client_SOURCES = timeouts/blocking_tcp_client.cpp
@@ -125,14 +252,34 @@ timeouts_blocking_token_tcp_client_SOURCES = timeouts/blocking_token_tcp_client.
timeouts_blocking_udp_client_SOURCES = timeouts/blocking_udp_client.cpp
timeouts_server_SOURCES = timeouts/server.cpp
timers_time_t_timer_SOURCES = timers/time_t_timer.cpp
+tutorial_timer1_timer_SOURCES = tutorial/timer1/timer.cpp
+tutorial_timer2_timer_SOURCES = tutorial/timer2/timer.cpp
+tutorial_timer3_timer_SOURCES = tutorial/timer3/timer.cpp
+tutorial_timer4_timer_SOURCES = tutorial/timer4/timer.cpp
+tutorial_timer5_timer_SOURCES = tutorial/timer5/timer.cpp
+tutorial_daytime1_client_SOURCES = tutorial/daytime1/client.cpp
+tutorial_daytime2_server_SOURCES = tutorial/daytime2/server.cpp
+tutorial_daytime3_server_SOURCES = tutorial/daytime3/server.cpp
+tutorial_daytime4_client_SOURCES = tutorial/daytime4/client.cpp
+tutorial_daytime5_server_SOURCES = tutorial/daytime5/server.cpp
+tutorial_daytime6_server_SOURCES = tutorial/daytime6/server.cpp
+tutorial_daytime7_server_SOURCES = tutorial/daytime7/server.cpp
+type_erasure_type_erasure_SOURCES = type_erasure/main.cpp type_erasure/stdin_line_reader.cpp type_erasure/sleep.cpp
if !WINDOWS_TARGET
+chat_posix_chat_client_SOURCES = chat/posix_chat_client.cpp
fork_daemon_SOURCES = fork/daemon.cpp
fork_process_per_connection_SOURCES = fork/process_per_connection.cpp
local_connect_pair_SOURCES = local/connect_pair.cpp
local_iostream_client_SOURCES = local/iostream_client.cpp
local_stream_server_SOURCES = local/stream_server.cpp
local_stream_client_SOURCES = local/stream_client.cpp
+local_fd_passing_stream_server_SOURCES = local/fd_passing_stream_server.cpp
+local_fd_passing_stream_client_SOURCES = local/fd_passing_stream_client.cpp
+endif
+
+if WINDOWS_TARGET
+windows_transmit_file_SOURCES = windows/transmit_file.cpp
endif
if HAVE_OPENSSL
@@ -148,16 +295,14 @@ spawn_parallel_grep_LDADD = $(LDADD) -lboost_coroutine -lboost_context -lboost_t
endif
EXTRA_DIST = \
- handler_tracking/custom_tracking.hpp \
- http/server/connection.hpp \
- http/server/connection_manager.hpp \
- http/server/header.hpp \
- http/server/mime_types.hpp \
- http/server/reply.hpp \
- http/server/request.hpp \
- http/server/request_handler.hpp \
- http/server/request_parser.hpp \
- http/server/server.hpp
+ serialization/client.cpp \
+ serialization/server.cpp \
+ serialization/connection.hpp \
+ serialization/stock.hpp \
+ ssl/README \
+ ssl/ca.pem \
+ ssl/server.pem \
+ ssl/dh4096.pem
MAINTAINERCLEANFILES = \
$(srcdir)/Makefile.in
diff --git a/3rdparty/asio/src/examples/cpp11/Makefile.in b/3rdparty/asio/src/examples/cpp11/Makefile.in
index beb10c2cce5..0f73bb5b85a 100644
--- a/3rdparty/asio/src/examples/cpp11/Makefile.in
+++ b/3rdparty/asio/src/examples/cpp11/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -93,7 +93,9 @@ host_triplet = @host@
@HAVE_OPENSSL_TRUE@@SEPARATE_COMPILATION_TRUE@am__append_1 = ../../asio_ssl.cpp
noinst_PROGRAMS = allocation/server$(EXEEXT) \
buffers/reference_counted$(EXEEXT) chat/chat_client$(EXEEXT) \
- chat/chat_server$(EXEEXT) echo/async_tcp_echo_server$(EXEEXT) \
+ chat/chat_server$(EXEEXT) deferred/deferred_1$(EXEEXT) \
+ deferred/deferred_2$(EXEEXT) \
+ echo/async_tcp_echo_server$(EXEEXT) \
echo/async_udp_echo_server$(EXEEXT) \
echo/blocking_tcp_echo_client$(EXEEXT) \
echo/blocking_tcp_echo_server$(EXEEXT) \
@@ -103,35 +105,66 @@ noinst_PROGRAMS = allocation/server$(EXEEXT) \
executors/bank_account_2$(EXEEXT) executors/fork_join$(EXEEXT) \
executors/pipeline$(EXEEXT) \
executors/priority_scheduler$(EXEEXT) \
- futures/daytime_client$(EXEEXT) \
+ files/blocking_file_copy$(EXEEXT) \
+ files/async_file_copy$(EXEEXT) futures/daytime_client$(EXEEXT) \
handler_tracking/async_tcp_echo_server$(EXEEXT) \
+ http/client/async_client$(EXEEXT) \
+ http/client/sync_client$(EXEEXT) \
http/server/http_server$(EXEEXT) \
+ http/server2/http_server$(EXEEXT) \
+ http/server3/http_server$(EXEEXT) \
+ http/server4/http_server$(EXEEXT) icmp/ping$(EXEEXT) \
invocation/prioritised_handlers$(EXEEXT) \
+ iostreams/daytime_client$(EXEEXT) \
+ iostreams/daytime_server$(EXEEXT) \
iostreams/http_client$(EXEEXT) multicast/receiver$(EXEEXT) \
multicast/sender$(EXEEXT) nonblocking/third_party_lib$(EXEEXT) \
operations/composed_1$(EXEEXT) operations/composed_2$(EXEEXT) \
operations/composed_3$(EXEEXT) operations/composed_4$(EXEEXT) \
operations/composed_5$(EXEEXT) operations/composed_6$(EXEEXT) \
operations/composed_7$(EXEEXT) operations/composed_8$(EXEEXT) \
- socks4/sync_client$(EXEEXT) timeouts/async_tcp_client$(EXEEXT) \
+ parallel_group/ranged_wait_for_all$(EXEEXT) \
+ parallel_group/wait_for_all$(EXEEXT) \
+ parallel_group/wait_for_one$(EXEEXT) \
+ parallel_group/wait_for_one_error$(EXEEXT) \
+ parallel_group/wait_for_one_success$(EXEEXT) \
+ porthopper/client$(EXEEXT) porthopper/server$(EXEEXT) \
+ services/daytime_client$(EXEEXT) socks4/sync_client$(EXEEXT) \
+ timeouts/async_tcp_client$(EXEEXT) \
timeouts/blocking_tcp_client$(EXEEXT) \
timeouts/blocking_token_tcp_client$(EXEEXT) \
timeouts/blocking_udp_client$(EXEEXT) timeouts/server$(EXEEXT) \
- timers/time_t_timer$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \
- $(am__EXEEXT_3)
+ timers/time_t_timer$(EXEEXT) tutorial/timer1/timer$(EXEEXT) \
+ tutorial/timer2/timer$(EXEEXT) tutorial/timer3/timer$(EXEEXT) \
+ tutorial/timer4/timer$(EXEEXT) tutorial/timer5/timer$(EXEEXT) \
+ tutorial/daytime1/client$(EXEEXT) \
+ tutorial/daytime2/server$(EXEEXT) \
+ tutorial/daytime3/server$(EXEEXT) \
+ tutorial/daytime4/client$(EXEEXT) \
+ tutorial/daytime5/server$(EXEEXT) \
+ tutorial/daytime6/server$(EXEEXT) \
+ tutorial/daytime7/server$(EXEEXT) \
+ type_erasure/type_erasure$(EXEEXT) $(am__EXEEXT_1) \
+ $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
@WINDOWS_TARGET_FALSE@am__append_2 = \
+@WINDOWS_TARGET_FALSE@ chat/posix_chat_client \
@WINDOWS_TARGET_FALSE@ fork/daemon \
@WINDOWS_TARGET_FALSE@ fork/process_per_connection \
@WINDOWS_TARGET_FALSE@ local/connect_pair \
@WINDOWS_TARGET_FALSE@ local/iostream_client \
@WINDOWS_TARGET_FALSE@ local/stream_server \
-@WINDOWS_TARGET_FALSE@ local/stream_client
+@WINDOWS_TARGET_FALSE@ local/stream_client \
+@WINDOWS_TARGET_FALSE@ local/fd_passing_stream_server \
+@WINDOWS_TARGET_FALSE@ local/fd_passing_stream_client
-@HAVE_OPENSSL_TRUE@am__append_3 = \
+@WINDOWS_TARGET_TRUE@am__append_3 = \
+@WINDOWS_TARGET_TRUE@ windows/transmit_file
+
+@HAVE_OPENSSL_TRUE@am__append_4 = \
@HAVE_OPENSSL_TRUE@ ssl/client \
@HAVE_OPENSSL_TRUE@ ssl/server
-@HAVE_BOOST_COROUTINE_TRUE@am__append_4 = \
+@HAVE_BOOST_COROUTINE_TRUE@am__append_5 = \
@HAVE_BOOST_COROUTINE_TRUE@ spawn/echo_server \
@HAVE_BOOST_COROUTINE_TRUE@ spawn/parallel_grep
@@ -145,15 +178,19 @@ DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-@WINDOWS_TARGET_FALSE@am__EXEEXT_1 = fork/daemon$(EXEEXT) \
+@WINDOWS_TARGET_FALSE@am__EXEEXT_1 = chat/posix_chat_client$(EXEEXT) \
+@WINDOWS_TARGET_FALSE@ fork/daemon$(EXEEXT) \
@WINDOWS_TARGET_FALSE@ fork/process_per_connection$(EXEEXT) \
@WINDOWS_TARGET_FALSE@ local/connect_pair$(EXEEXT) \
@WINDOWS_TARGET_FALSE@ local/iostream_client$(EXEEXT) \
@WINDOWS_TARGET_FALSE@ local/stream_server$(EXEEXT) \
-@WINDOWS_TARGET_FALSE@ local/stream_client$(EXEEXT)
-@HAVE_OPENSSL_TRUE@am__EXEEXT_2 = ssl/client$(EXEEXT) \
+@WINDOWS_TARGET_FALSE@ local/stream_client$(EXEEXT) \
+@WINDOWS_TARGET_FALSE@ local/fd_passing_stream_server$(EXEEXT) \
+@WINDOWS_TARGET_FALSE@ local/fd_passing_stream_client$(EXEEXT)
+@WINDOWS_TARGET_TRUE@am__EXEEXT_2 = windows/transmit_file$(EXEEXT)
+@HAVE_OPENSSL_TRUE@am__EXEEXT_3 = ssl/client$(EXEEXT) \
@HAVE_OPENSSL_TRUE@ ssl/server$(EXEEXT)
-@HAVE_BOOST_COROUTINE_TRUE@am__EXEEXT_3 = spawn/echo_server$(EXEEXT) \
+@HAVE_BOOST_COROUTINE_TRUE@am__EXEEXT_4 = spawn/echo_server$(EXEEXT) \
@HAVE_BOOST_COROUTINE_TRUE@ spawn/parallel_grep$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
LIBRARIES = $(noinst_LIBRARIES)
@@ -191,6 +228,23 @@ am_chat_chat_server_OBJECTS = chat/chat_server.$(OBJEXT)
chat_chat_server_OBJECTS = $(am_chat_chat_server_OBJECTS)
chat_chat_server_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@chat_chat_server_DEPENDENCIES = libasio.a
+am__chat_posix_chat_client_SOURCES_DIST = chat/posix_chat_client.cpp
+@WINDOWS_TARGET_FALSE@am_chat_posix_chat_client_OBJECTS = \
+@WINDOWS_TARGET_FALSE@ chat/posix_chat_client.$(OBJEXT)
+chat_posix_chat_client_OBJECTS = $(am_chat_posix_chat_client_OBJECTS)
+chat_posix_chat_client_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@chat_posix_chat_client_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_deferred_deferred_1_OBJECTS = deferred/deferred_1.$(OBJEXT)
+deferred_deferred_1_OBJECTS = $(am_deferred_deferred_1_OBJECTS)
+deferred_deferred_1_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@deferred_deferred_1_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_deferred_deferred_2_OBJECTS = deferred/deferred_2.$(OBJEXT)
+deferred_deferred_2_OBJECTS = $(am_deferred_deferred_2_OBJECTS)
+deferred_deferred_2_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@deferred_deferred_2_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_echo_async_tcp_echo_server_OBJECTS = \
echo/async_tcp_echo_server.$(OBJEXT)
echo_async_tcp_echo_server_OBJECTS = \
@@ -268,6 +322,18 @@ executors_priority_scheduler_OBJECTS = \
executors_priority_scheduler_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@executors_priority_scheduler_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_files_async_file_copy_OBJECTS = files/async_file_copy.$(OBJEXT)
+files_async_file_copy_OBJECTS = $(am_files_async_file_copy_OBJECTS)
+files_async_file_copy_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@files_async_file_copy_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_files_blocking_file_copy_OBJECTS = \
+ files/blocking_file_copy.$(OBJEXT)
+files_blocking_file_copy_OBJECTS = \
+ $(am_files_blocking_file_copy_OBJECTS)
+files_blocking_file_copy_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@files_blocking_file_copy_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am__fork_daemon_SOURCES_DIST = fork/daemon.cpp
@WINDOWS_TARGET_FALSE@am_fork_daemon_OBJECTS = fork/daemon.$(OBJEXT)
fork_daemon_OBJECTS = $(am_fork_daemon_OBJECTS)
@@ -294,6 +360,20 @@ handler_tracking_async_tcp_echo_server_OBJECTS = \
handler_tracking_async_tcp_echo_server_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@handler_tracking_async_tcp_echo_server_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_http_client_async_client_OBJECTS = \
+ http/client/async_client.$(OBJEXT)
+http_client_async_client_OBJECTS = \
+ $(am_http_client_async_client_OBJECTS)
+http_client_async_client_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@http_client_async_client_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_http_client_sync_client_OBJECTS = \
+ http/client/sync_client.$(OBJEXT)
+http_client_sync_client_OBJECTS = \
+ $(am_http_client_sync_client_OBJECTS)
+http_client_sync_client_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@http_client_sync_client_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_http_server_http_server_OBJECTS = http/server/connection.$(OBJEXT) \
http/server/connection_manager.$(OBJEXT) \
http/server/main.$(OBJEXT) http/server/mime_types.$(OBJEXT) \
@@ -306,6 +386,45 @@ http_server_http_server_OBJECTS = \
http_server_http_server_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@http_server_http_server_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_http_server2_http_server_OBJECTS = \
+ http/server2/connection.$(OBJEXT) \
+ http/server2/io_context_pool.$(OBJEXT) \
+ http/server2/main.$(OBJEXT) http/server2/mime_types.$(OBJEXT) \
+ http/server2/reply.$(OBJEXT) \
+ http/server2/request_handler.$(OBJEXT) \
+ http/server2/request_parser.$(OBJEXT) \
+ http/server2/server.$(OBJEXT)
+http_server2_http_server_OBJECTS = \
+ $(am_http_server2_http_server_OBJECTS)
+http_server2_http_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@http_server2_http_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_http_server3_http_server_OBJECTS = \
+ http/server3/connection.$(OBJEXT) http/server3/main.$(OBJEXT) \
+ http/server3/mime_types.$(OBJEXT) http/server3/reply.$(OBJEXT) \
+ http/server3/request_handler.$(OBJEXT) \
+ http/server3/request_parser.$(OBJEXT) \
+ http/server3/server.$(OBJEXT)
+http_server3_http_server_OBJECTS = \
+ $(am_http_server3_http_server_OBJECTS)
+http_server3_http_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@http_server3_http_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_http_server4_http_server_OBJECTS = \
+ http/server4/file_handler.$(OBJEXT) \
+ http/server4/main.$(OBJEXT) http/server4/mime_types.$(OBJEXT) \
+ http/server4/reply.$(OBJEXT) \
+ http/server4/request_parser.$(OBJEXT) \
+ http/server4/server.$(OBJEXT)
+http_server4_http_server_OBJECTS = \
+ $(am_http_server4_http_server_OBJECTS)
+http_server4_http_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@http_server4_http_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_icmp_ping_OBJECTS = icmp/ping.$(OBJEXT)
+icmp_ping_OBJECTS = $(am_icmp_ping_OBJECTS)
+icmp_ping_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@icmp_ping_DEPENDENCIES = libasio.a
am_invocation_prioritised_handlers_OBJECTS = \
invocation/prioritised_handlers.$(OBJEXT)
invocation_prioritised_handlers_OBJECTS = \
@@ -313,6 +432,20 @@ invocation_prioritised_handlers_OBJECTS = \
invocation_prioritised_handlers_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@invocation_prioritised_handlers_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_iostreams_daytime_client_OBJECTS = \
+ iostreams/daytime_client.$(OBJEXT)
+iostreams_daytime_client_OBJECTS = \
+ $(am_iostreams_daytime_client_OBJECTS)
+iostreams_daytime_client_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@iostreams_daytime_client_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_iostreams_daytime_server_OBJECTS = \
+ iostreams/daytime_server.$(OBJEXT)
+iostreams_daytime_server_OBJECTS = \
+ $(am_iostreams_daytime_server_OBJECTS)
+iostreams_daytime_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@iostreams_daytime_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_iostreams_http_client_OBJECTS = iostreams/http_client.$(OBJEXT)
iostreams_http_client_OBJECTS = $(am_iostreams_http_client_OBJECTS)
iostreams_http_client_LDADD = $(LDADD)
@@ -325,6 +458,22 @@ local_connect_pair_OBJECTS = $(am_local_connect_pair_OBJECTS)
local_connect_pair_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@local_connect_pair_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__local_fd_passing_stream_client_SOURCES_DIST = \
+ local/fd_passing_stream_client.cpp
+@WINDOWS_TARGET_FALSE@am_local_fd_passing_stream_client_OBJECTS = local/fd_passing_stream_client.$(OBJEXT)
+local_fd_passing_stream_client_OBJECTS = \
+ $(am_local_fd_passing_stream_client_OBJECTS)
+local_fd_passing_stream_client_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@local_fd_passing_stream_client_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__local_fd_passing_stream_server_SOURCES_DIST = \
+ local/fd_passing_stream_server.cpp
+@WINDOWS_TARGET_FALSE@am_local_fd_passing_stream_server_OBJECTS = local/fd_passing_stream_server.$(OBJEXT)
+local_fd_passing_stream_server_OBJECTS = \
+ $(am_local_fd_passing_stream_server_OBJECTS)
+local_fd_passing_stream_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@local_fd_passing_stream_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am__local_iostream_client_SOURCES_DIST = local/iostream_client.cpp
@WINDOWS_TARGET_FALSE@am_local_iostream_client_OBJECTS = \
@WINDOWS_TARGET_FALSE@ local/iostream_client.$(OBJEXT)
@@ -402,6 +551,57 @@ operations_composed_8_OBJECTS = $(am_operations_composed_8_OBJECTS)
operations_composed_8_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@operations_composed_8_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_parallel_group_ranged_wait_for_all_OBJECTS = \
+ parallel_group/ranged_wait_for_all.$(OBJEXT)
+parallel_group_ranged_wait_for_all_OBJECTS = \
+ $(am_parallel_group_ranged_wait_for_all_OBJECTS)
+parallel_group_ranged_wait_for_all_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@parallel_group_ranged_wait_for_all_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_parallel_group_wait_for_all_OBJECTS = \
+ parallel_group/wait_for_all.$(OBJEXT)
+parallel_group_wait_for_all_OBJECTS = \
+ $(am_parallel_group_wait_for_all_OBJECTS)
+parallel_group_wait_for_all_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@parallel_group_wait_for_all_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_parallel_group_wait_for_one_OBJECTS = \
+ parallel_group/wait_for_one.$(OBJEXT)
+parallel_group_wait_for_one_OBJECTS = \
+ $(am_parallel_group_wait_for_one_OBJECTS)
+parallel_group_wait_for_one_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@parallel_group_wait_for_one_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_parallel_group_wait_for_one_error_OBJECTS = \
+ parallel_group/wait_for_one_error.$(OBJEXT)
+parallel_group_wait_for_one_error_OBJECTS = \
+ $(am_parallel_group_wait_for_one_error_OBJECTS)
+parallel_group_wait_for_one_error_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@parallel_group_wait_for_one_error_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_parallel_group_wait_for_one_success_OBJECTS = \
+ parallel_group/wait_for_one_success.$(OBJEXT)
+parallel_group_wait_for_one_success_OBJECTS = \
+ $(am_parallel_group_wait_for_one_success_OBJECTS)
+parallel_group_wait_for_one_success_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@parallel_group_wait_for_one_success_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_porthopper_client_OBJECTS = porthopper/client.$(OBJEXT)
+porthopper_client_OBJECTS = $(am_porthopper_client_OBJECTS)
+porthopper_client_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@porthopper_client_DEPENDENCIES = libasio.a
+am_porthopper_server_OBJECTS = porthopper/server.$(OBJEXT)
+porthopper_server_OBJECTS = $(am_porthopper_server_OBJECTS)
+porthopper_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@porthopper_server_DEPENDENCIES = libasio.a
+am_services_daytime_client_OBJECTS = \
+ services/daytime_client.$(OBJEXT) \
+ services/logger_service.$(OBJEXT)
+services_daytime_client_OBJECTS = \
+ $(am_services_daytime_client_OBJECTS)
+services_daytime_client_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@services_daytime_client_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_socks4_sync_client_OBJECTS = socks4/sync_client.$(OBJEXT)
socks4_sync_client_OBJECTS = $(am_socks4_sync_client_OBJECTS)
socks4_sync_client_LDADD = $(LDADD)
@@ -465,6 +665,95 @@ timers_time_t_timer_OBJECTS = $(am_timers_time_t_timer_OBJECTS)
timers_time_t_timer_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@timers_time_t_timer_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_daytime1_client_OBJECTS = \
+ tutorial/daytime1/client.$(OBJEXT)
+tutorial_daytime1_client_OBJECTS = \
+ $(am_tutorial_daytime1_client_OBJECTS)
+tutorial_daytime1_client_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_daytime1_client_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_daytime2_server_OBJECTS = \
+ tutorial/daytime2/server.$(OBJEXT)
+tutorial_daytime2_server_OBJECTS = \
+ $(am_tutorial_daytime2_server_OBJECTS)
+tutorial_daytime2_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_daytime2_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_daytime3_server_OBJECTS = \
+ tutorial/daytime3/server.$(OBJEXT)
+tutorial_daytime3_server_OBJECTS = \
+ $(am_tutorial_daytime3_server_OBJECTS)
+tutorial_daytime3_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_daytime3_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_daytime4_client_OBJECTS = \
+ tutorial/daytime4/client.$(OBJEXT)
+tutorial_daytime4_client_OBJECTS = \
+ $(am_tutorial_daytime4_client_OBJECTS)
+tutorial_daytime4_client_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_daytime4_client_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_daytime5_server_OBJECTS = \
+ tutorial/daytime5/server.$(OBJEXT)
+tutorial_daytime5_server_OBJECTS = \
+ $(am_tutorial_daytime5_server_OBJECTS)
+tutorial_daytime5_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_daytime5_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_daytime6_server_OBJECTS = \
+ tutorial/daytime6/server.$(OBJEXT)
+tutorial_daytime6_server_OBJECTS = \
+ $(am_tutorial_daytime6_server_OBJECTS)
+tutorial_daytime6_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_daytime6_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_daytime7_server_OBJECTS = \
+ tutorial/daytime7/server.$(OBJEXT)
+tutorial_daytime7_server_OBJECTS = \
+ $(am_tutorial_daytime7_server_OBJECTS)
+tutorial_daytime7_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_daytime7_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_timer1_timer_OBJECTS = tutorial/timer1/timer.$(OBJEXT)
+tutorial_timer1_timer_OBJECTS = $(am_tutorial_timer1_timer_OBJECTS)
+tutorial_timer1_timer_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_timer1_timer_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_timer2_timer_OBJECTS = tutorial/timer2/timer.$(OBJEXT)
+tutorial_timer2_timer_OBJECTS = $(am_tutorial_timer2_timer_OBJECTS)
+tutorial_timer2_timer_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_timer2_timer_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_timer3_timer_OBJECTS = tutorial/timer3/timer.$(OBJEXT)
+tutorial_timer3_timer_OBJECTS = $(am_tutorial_timer3_timer_OBJECTS)
+tutorial_timer3_timer_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_timer3_timer_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_timer4_timer_OBJECTS = tutorial/timer4/timer.$(OBJEXT)
+tutorial_timer4_timer_OBJECTS = $(am_tutorial_timer4_timer_OBJECTS)
+tutorial_timer4_timer_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_timer4_timer_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_tutorial_timer5_timer_OBJECTS = tutorial/timer5/timer.$(OBJEXT)
+tutorial_timer5_timer_OBJECTS = $(am_tutorial_timer5_timer_OBJECTS)
+tutorial_timer5_timer_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@tutorial_timer5_timer_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_type_erasure_type_erasure_OBJECTS = type_erasure/main.$(OBJEXT) \
+ type_erasure/stdin_line_reader.$(OBJEXT) \
+ type_erasure/sleep.$(OBJEXT)
+type_erasure_type_erasure_OBJECTS = \
+ $(am_type_erasure_type_erasure_OBJECTS)
+type_erasure_type_erasure_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@type_erasure_type_erasure_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__windows_transmit_file_SOURCES_DIST = windows/transmit_file.cpp
+@WINDOWS_TARGET_TRUE@am_windows_transmit_file_OBJECTS = \
+@WINDOWS_TARGET_TRUE@ windows/transmit_file.$(OBJEXT)
+windows_transmit_file_OBJECTS = $(am_windows_transmit_file_OBJECTS)
+windows_transmit_file_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@windows_transmit_file_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -484,6 +773,9 @@ am__depfiles_remade = ../../$(DEPDIR)/asio.Po \
../../$(DEPDIR)/asio_ssl.Po allocation/$(DEPDIR)/server.Po \
buffers/$(DEPDIR)/reference_counted.Po \
chat/$(DEPDIR)/chat_client.Po chat/$(DEPDIR)/chat_server.Po \
+ chat/$(DEPDIR)/posix_chat_client.Po \
+ deferred/$(DEPDIR)/deferred_1.Po \
+ deferred/$(DEPDIR)/deferred_2.Po \
echo/$(DEPDIR)/async_tcp_echo_server.Po \
echo/$(DEPDIR)/async_udp_echo_server.Po \
echo/$(DEPDIR)/blocking_tcp_echo_client.Po \
@@ -496,10 +788,13 @@ am__depfiles_remade = ../../$(DEPDIR)/asio.Po \
executors/$(DEPDIR)/fork_join.Po \
executors/$(DEPDIR)/pipeline.Po \
executors/$(DEPDIR)/priority_scheduler.Po \
- fork/$(DEPDIR)/daemon.Po \
+ files/$(DEPDIR)/async_file_copy.Po \
+ files/$(DEPDIR)/blocking_file_copy.Po fork/$(DEPDIR)/daemon.Po \
fork/$(DEPDIR)/process_per_connection.Po \
futures/$(DEPDIR)/daytime_client.Po \
handler_tracking/$(DEPDIR)/async_tcp_echo_server.Po \
+ http/client/$(DEPDIR)/async_client.Po \
+ http/client/$(DEPDIR)/sync_client.Po \
http/server/$(DEPDIR)/connection.Po \
http/server/$(DEPDIR)/connection_manager.Po \
http/server/$(DEPDIR)/main.Po \
@@ -508,9 +803,34 @@ am__depfiles_remade = ../../$(DEPDIR)/asio.Po \
http/server/$(DEPDIR)/request_handler.Po \
http/server/$(DEPDIR)/request_parser.Po \
http/server/$(DEPDIR)/server.Po \
+ http/server2/$(DEPDIR)/connection.Po \
+ http/server2/$(DEPDIR)/io_context_pool.Po \
+ http/server2/$(DEPDIR)/main.Po \
+ http/server2/$(DEPDIR)/mime_types.Po \
+ http/server2/$(DEPDIR)/reply.Po \
+ http/server2/$(DEPDIR)/request_handler.Po \
+ http/server2/$(DEPDIR)/request_parser.Po \
+ http/server2/$(DEPDIR)/server.Po \
+ http/server3/$(DEPDIR)/connection.Po \
+ http/server3/$(DEPDIR)/main.Po \
+ http/server3/$(DEPDIR)/mime_types.Po \
+ http/server3/$(DEPDIR)/reply.Po \
+ http/server3/$(DEPDIR)/request_handler.Po \
+ http/server3/$(DEPDIR)/request_parser.Po \
+ http/server3/$(DEPDIR)/server.Po \
+ http/server4/$(DEPDIR)/file_handler.Po \
+ http/server4/$(DEPDIR)/main.Po \
+ http/server4/$(DEPDIR)/mime_types.Po \
+ http/server4/$(DEPDIR)/reply.Po \
+ http/server4/$(DEPDIR)/request_parser.Po \
+ http/server4/$(DEPDIR)/server.Po icmp/$(DEPDIR)/ping.Po \
invocation/$(DEPDIR)/prioritised_handlers.Po \
+ iostreams/$(DEPDIR)/daytime_client.Po \
+ iostreams/$(DEPDIR)/daytime_server.Po \
iostreams/$(DEPDIR)/http_client.Po \
local/$(DEPDIR)/connect_pair.Po \
+ local/$(DEPDIR)/fd_passing_stream_client.Po \
+ local/$(DEPDIR)/fd_passing_stream_server.Po \
local/$(DEPDIR)/iostream_client.Po \
local/$(DEPDIR)/stream_client.Po \
local/$(DEPDIR)/stream_server.Po \
@@ -524,13 +844,36 @@ am__depfiles_remade = ../../$(DEPDIR)/asio.Po \
operations/$(DEPDIR)/composed_6.Po \
operations/$(DEPDIR)/composed_7.Po \
operations/$(DEPDIR)/composed_8.Po \
+ parallel_group/$(DEPDIR)/ranged_wait_for_all.Po \
+ parallel_group/$(DEPDIR)/wait_for_all.Po \
+ parallel_group/$(DEPDIR)/wait_for_one.Po \
+ parallel_group/$(DEPDIR)/wait_for_one_error.Po \
+ parallel_group/$(DEPDIR)/wait_for_one_success.Po \
+ porthopper/$(DEPDIR)/client.Po porthopper/$(DEPDIR)/server.Po \
+ services/$(DEPDIR)/daytime_client.Po \
+ services/$(DEPDIR)/logger_service.Po \
socks4/$(DEPDIR)/sync_client.Po spawn/$(DEPDIR)/echo_server.Po \
spawn/$(DEPDIR)/parallel_grep.Po ssl/$(DEPDIR)/client.Po \
ssl/$(DEPDIR)/server.Po timeouts/$(DEPDIR)/async_tcp_client.Po \
timeouts/$(DEPDIR)/blocking_tcp_client.Po \
timeouts/$(DEPDIR)/blocking_token_tcp_client.Po \
timeouts/$(DEPDIR)/blocking_udp_client.Po \
- timeouts/$(DEPDIR)/server.Po timers/$(DEPDIR)/time_t_timer.Po
+ timeouts/$(DEPDIR)/server.Po timers/$(DEPDIR)/time_t_timer.Po \
+ tutorial/daytime1/$(DEPDIR)/client.Po \
+ tutorial/daytime2/$(DEPDIR)/server.Po \
+ tutorial/daytime3/$(DEPDIR)/server.Po \
+ tutorial/daytime4/$(DEPDIR)/client.Po \
+ tutorial/daytime5/$(DEPDIR)/server.Po \
+ tutorial/daytime6/$(DEPDIR)/server.Po \
+ tutorial/daytime7/$(DEPDIR)/server.Po \
+ tutorial/timer1/$(DEPDIR)/timer.Po \
+ tutorial/timer2/$(DEPDIR)/timer.Po \
+ tutorial/timer3/$(DEPDIR)/timer.Po \
+ tutorial/timer4/$(DEPDIR)/timer.Po \
+ tutorial/timer5/$(DEPDIR)/timer.Po \
+ type_erasure/$(DEPDIR)/main.Po type_erasure/$(DEPDIR)/sleep.Po \
+ type_erasure/$(DEPDIR)/stdin_line_reader.Po \
+ windows/$(DEPDIR)/transmit_file.Po
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -548,6 +891,8 @@ am__v_CXXLD_1 =
SOURCES = $(libasio_a_SOURCES) $(allocation_server_SOURCES) \
$(buffers_reference_counted_SOURCES) \
$(chat_chat_client_SOURCES) $(chat_chat_server_SOURCES) \
+ $(chat_posix_chat_client_SOURCES) \
+ $(deferred_deferred_1_SOURCES) $(deferred_deferred_2_SOURCES) \
$(echo_async_tcp_echo_server_SOURCES) \
$(echo_async_udp_echo_server_SOURCES) \
$(echo_blocking_tcp_echo_client_SOURCES) \
@@ -557,13 +902,24 @@ SOURCES = $(libasio_a_SOURCES) $(allocation_server_SOURCES) \
$(executors_actor_SOURCES) $(executors_bank_account_1_SOURCES) \
$(executors_bank_account_2_SOURCES) \
$(executors_fork_join_SOURCES) $(executors_pipeline_SOURCES) \
- $(executors_priority_scheduler_SOURCES) $(fork_daemon_SOURCES) \
+ $(executors_priority_scheduler_SOURCES) \
+ $(files_async_file_copy_SOURCES) \
+ $(files_blocking_file_copy_SOURCES) $(fork_daemon_SOURCES) \
$(fork_process_per_connection_SOURCES) \
$(futures_daytime_client_SOURCES) \
$(handler_tracking_async_tcp_echo_server_SOURCES) \
+ $(http_client_async_client_SOURCES) \
+ $(http_client_sync_client_SOURCES) \
$(http_server_http_server_SOURCES) \
+ $(http_server2_http_server_SOURCES) \
+ $(http_server3_http_server_SOURCES) \
+ $(http_server4_http_server_SOURCES) $(icmp_ping_SOURCES) \
$(invocation_prioritised_handlers_SOURCES) \
+ $(iostreams_daytime_client_SOURCES) \
+ $(iostreams_daytime_server_SOURCES) \
$(iostreams_http_client_SOURCES) $(local_connect_pair_SOURCES) \
+ $(local_fd_passing_stream_client_SOURCES) \
+ $(local_fd_passing_stream_server_SOURCES) \
$(local_iostream_client_SOURCES) \
$(local_stream_client_SOURCES) $(local_stream_server_SOURCES) \
$(multicast_receiver_SOURCES) $(multicast_sender_SOURCES) \
@@ -575,18 +931,41 @@ SOURCES = $(libasio_a_SOURCES) $(allocation_server_SOURCES) \
$(operations_composed_5_SOURCES) \
$(operations_composed_6_SOURCES) \
$(operations_composed_7_SOURCES) \
- $(operations_composed_8_SOURCES) $(socks4_sync_client_SOURCES) \
- $(spawn_echo_server_SOURCES) $(spawn_parallel_grep_SOURCES) \
- $(ssl_client_SOURCES) $(ssl_server_SOURCES) \
- $(timeouts_async_tcp_client_SOURCES) \
+ $(operations_composed_8_SOURCES) \
+ $(parallel_group_ranged_wait_for_all_SOURCES) \
+ $(parallel_group_wait_for_all_SOURCES) \
+ $(parallel_group_wait_for_one_SOURCES) \
+ $(parallel_group_wait_for_one_error_SOURCES) \
+ $(parallel_group_wait_for_one_success_SOURCES) \
+ $(porthopper_client_SOURCES) $(porthopper_server_SOURCES) \
+ $(services_daytime_client_SOURCES) \
+ $(socks4_sync_client_SOURCES) $(spawn_echo_server_SOURCES) \
+ $(spawn_parallel_grep_SOURCES) $(ssl_client_SOURCES) \
+ $(ssl_server_SOURCES) $(timeouts_async_tcp_client_SOURCES) \
$(timeouts_blocking_tcp_client_SOURCES) \
$(timeouts_blocking_token_tcp_client_SOURCES) \
$(timeouts_blocking_udp_client_SOURCES) \
- $(timeouts_server_SOURCES) $(timers_time_t_timer_SOURCES)
+ $(timeouts_server_SOURCES) $(timers_time_t_timer_SOURCES) \
+ $(tutorial_daytime1_client_SOURCES) \
+ $(tutorial_daytime2_server_SOURCES) \
+ $(tutorial_daytime3_server_SOURCES) \
+ $(tutorial_daytime4_client_SOURCES) \
+ $(tutorial_daytime5_server_SOURCES) \
+ $(tutorial_daytime6_server_SOURCES) \
+ $(tutorial_daytime7_server_SOURCES) \
+ $(tutorial_timer1_timer_SOURCES) \
+ $(tutorial_timer2_timer_SOURCES) \
+ $(tutorial_timer3_timer_SOURCES) \
+ $(tutorial_timer4_timer_SOURCES) \
+ $(tutorial_timer5_timer_SOURCES) \
+ $(type_erasure_type_erasure_SOURCES) \
+ $(windows_transmit_file_SOURCES)
DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(allocation_server_SOURCES) \
$(buffers_reference_counted_SOURCES) \
$(chat_chat_client_SOURCES) $(chat_chat_server_SOURCES) \
+ $(am__chat_posix_chat_client_SOURCES_DIST) \
+ $(deferred_deferred_1_SOURCES) $(deferred_deferred_2_SOURCES) \
$(echo_async_tcp_echo_server_SOURCES) \
$(echo_async_udp_echo_server_SOURCES) \
$(echo_blocking_tcp_echo_client_SOURCES) \
@@ -597,14 +976,25 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(executors_bank_account_2_SOURCES) \
$(executors_fork_join_SOURCES) $(executors_pipeline_SOURCES) \
$(executors_priority_scheduler_SOURCES) \
+ $(files_async_file_copy_SOURCES) \
+ $(files_blocking_file_copy_SOURCES) \
$(am__fork_daemon_SOURCES_DIST) \
$(am__fork_process_per_connection_SOURCES_DIST) \
$(futures_daytime_client_SOURCES) \
$(handler_tracking_async_tcp_echo_server_SOURCES) \
+ $(http_client_async_client_SOURCES) \
+ $(http_client_sync_client_SOURCES) \
$(http_server_http_server_SOURCES) \
+ $(http_server2_http_server_SOURCES) \
+ $(http_server3_http_server_SOURCES) \
+ $(http_server4_http_server_SOURCES) $(icmp_ping_SOURCES) \
$(invocation_prioritised_handlers_SOURCES) \
+ $(iostreams_daytime_client_SOURCES) \
+ $(iostreams_daytime_server_SOURCES) \
$(iostreams_http_client_SOURCES) \
$(am__local_connect_pair_SOURCES_DIST) \
+ $(am__local_fd_passing_stream_client_SOURCES_DIST) \
+ $(am__local_fd_passing_stream_server_SOURCES_DIST) \
$(am__local_iostream_client_SOURCES_DIST) \
$(am__local_stream_client_SOURCES_DIST) \
$(am__local_stream_server_SOURCES_DIST) \
@@ -617,7 +1007,15 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(operations_composed_5_SOURCES) \
$(operations_composed_6_SOURCES) \
$(operations_composed_7_SOURCES) \
- $(operations_composed_8_SOURCES) $(socks4_sync_client_SOURCES) \
+ $(operations_composed_8_SOURCES) \
+ $(parallel_group_ranged_wait_for_all_SOURCES) \
+ $(parallel_group_wait_for_all_SOURCES) \
+ $(parallel_group_wait_for_one_SOURCES) \
+ $(parallel_group_wait_for_one_error_SOURCES) \
+ $(parallel_group_wait_for_one_success_SOURCES) \
+ $(porthopper_client_SOURCES) $(porthopper_server_SOURCES) \
+ $(services_daytime_client_SOURCES) \
+ $(socks4_sync_client_SOURCES) \
$(am__spawn_echo_server_SOURCES_DIST) \
$(am__spawn_parallel_grep_SOURCES_DIST) \
$(am__ssl_client_SOURCES_DIST) $(am__ssl_server_SOURCES_DIST) \
@@ -625,7 +1023,21 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(timeouts_blocking_tcp_client_SOURCES) \
$(timeouts_blocking_token_tcp_client_SOURCES) \
$(timeouts_blocking_udp_client_SOURCES) \
- $(timeouts_server_SOURCES) $(timers_time_t_timer_SOURCES)
+ $(timeouts_server_SOURCES) $(timers_time_t_timer_SOURCES) \
+ $(tutorial_daytime1_client_SOURCES) \
+ $(tutorial_daytime2_server_SOURCES) \
+ $(tutorial_daytime3_server_SOURCES) \
+ $(tutorial_daytime4_client_SOURCES) \
+ $(tutorial_daytime5_server_SOURCES) \
+ $(tutorial_daytime6_server_SOURCES) \
+ $(tutorial_daytime7_server_SOURCES) \
+ $(tutorial_timer1_timer_SOURCES) \
+ $(tutorial_timer2_timer_SOURCES) \
+ $(tutorial_timer3_timer_SOURCES) \
+ $(tutorial_timer4_timer_SOURCES) \
+ $(tutorial_timer5_timer_SOURCES) \
+ $(type_erasure_type_erasure_SOURCES) \
+ $(am__windows_transmit_file_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -649,8 +1061,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -664,8 +1074,9 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
-CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -674,9 +1085,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
-GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -743,9 +1153,11 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -760,14 +1172,59 @@ AUTOMAKE_OPTIONS = subdir-objects
@SEPARATE_COMPILATION_TRUE@ $(am__append_1)
@SEPARATE_COMPILATION_TRUE@LDADD = libasio.a
noinst_HEADERS = \
+ chat/chat_message.hpp \
+ handler_tracking/custom_tracking.hpp \
+ http/server/connection.hpp \
+ http/server/connection_manager.hpp \
+ http/server/header.hpp \
+ http/server/mime_types.hpp \
+ http/server/reply.hpp \
+ http/server/request.hpp \
+ http/server/request_handler.hpp \
+ http/server/request_parser.hpp \
+ http/server/server.hpp \
+ http/server2/connection.hpp \
+ http/server2/io_context_pool.hpp \
+ http/server2/header.hpp \
+ http/server2/mime_types.hpp \
+ http/server2/reply.hpp \
+ http/server2/request.hpp \
+ http/server2/request_handler.hpp \
+ http/server2/request_parser.hpp \
+ http/server2/server.hpp \
+ http/server3/connection.hpp \
+ http/server3/header.hpp \
+ http/server3/mime_types.hpp \
+ http/server3/reply.hpp \
+ http/server3/request.hpp \
+ http/server3/request_handler.hpp \
+ http/server3/request_parser.hpp \
+ http/server3/server.hpp \
+ http/server4/file_handler.hpp \
+ http/server4/header.hpp \
+ http/server4/mime_types.hpp \
+ http/server4/reply.hpp \
+ http/server4/request.hpp \
+ http/server4/request_parser.hpp \
+ http/server4/server.hpp \
+ icmp/icmp_header.hpp \
+ icmp/ipv4_header.hpp \
+ porthopper/protocol.hpp \
+ services/basic_logger.hpp \
+ services/logger.hpp \
+ services/logger_service.hpp \
socks4/socks4.hpp \
- chat/chat_message.hpp
+ type_erasure/line_reader.hpp \
+ type_erasure/stdin_line_reader.hpp \
+ type_erasure/sleep.hpp
AM_CXXFLAGS = -I$(srcdir)/../../../include
allocation_server_SOURCES = allocation/server.cpp
buffers_reference_counted_SOURCES = buffers/reference_counted.cpp
chat_chat_client_SOURCES = chat/chat_client.cpp
chat_chat_server_SOURCES = chat/chat_server.cpp
+deferred_deferred_1_SOURCES = deferred/deferred_1.cpp
+deferred_deferred_2_SOURCES = deferred/deferred_2.cpp
echo_async_tcp_echo_server_SOURCES = echo/async_tcp_echo_server.cpp
echo_async_udp_echo_server_SOURCES = echo/async_udp_echo_server.cpp
echo_blocking_tcp_echo_client_SOURCES = echo/blocking_tcp_echo_client.cpp
@@ -780,8 +1237,12 @@ executors_bank_account_2_SOURCES = executors/bank_account_2.cpp
executors_fork_join_SOURCES = executors/fork_join.cpp
executors_pipeline_SOURCES = executors/pipeline.cpp
executors_priority_scheduler_SOURCES = executors/priority_scheduler.cpp
+files_blocking_file_copy_SOURCES = files/blocking_file_copy.cpp
+files_async_file_copy_SOURCES = files/async_file_copy.cpp
futures_daytime_client_SOURCES = futures/daytime_client.cpp
handler_tracking_async_tcp_echo_server_SOURCES = handler_tracking/async_tcp_echo_server.cpp
+http_client_async_client_SOURCES = http/client/async_client.cpp
+http_client_sync_client_SOURCES = http/client/sync_client.cpp
http_server_http_server_SOURCES = \
http/server/connection.cpp \
http/server/connection_manager.cpp \
@@ -792,7 +1253,37 @@ http_server_http_server_SOURCES = \
http/server/request_parser.cpp \
http/server/server.cpp
+http_server2_http_server_SOURCES = \
+ http/server2/connection.cpp \
+ http/server2/io_context_pool.cpp \
+ http/server2/main.cpp \
+ http/server2/mime_types.cpp \
+ http/server2/reply.cpp \
+ http/server2/request_handler.cpp \
+ http/server2/request_parser.cpp \
+ http/server2/server.cpp
+
+http_server3_http_server_SOURCES = \
+ http/server3/connection.cpp \
+ http/server3/main.cpp \
+ http/server3/mime_types.cpp \
+ http/server3/reply.cpp \
+ http/server3/request_handler.cpp \
+ http/server3/request_parser.cpp \
+ http/server3/server.cpp
+
+http_server4_http_server_SOURCES = \
+ http/server4/file_handler.cpp \
+ http/server4/main.cpp \
+ http/server4/mime_types.cpp \
+ http/server4/reply.cpp \
+ http/server4/request_parser.cpp \
+ http/server4/server.cpp
+
+icmp_ping_SOURCES = icmp/ping.cpp
invocation_prioritised_handlers_SOURCES = invocation/prioritised_handlers.cpp
+iostreams_daytime_client_SOURCES = iostreams/daytime_client.cpp
+iostreams_daytime_server_SOURCES = iostreams/daytime_server.cpp
iostreams_http_client_SOURCES = iostreams/http_client.cpp
multicast_receiver_SOURCES = multicast/receiver.cpp
multicast_sender_SOURCES = multicast/sender.cpp
@@ -805,6 +1296,17 @@ operations_composed_5_SOURCES = operations/composed_5.cpp
operations_composed_6_SOURCES = operations/composed_6.cpp
operations_composed_7_SOURCES = operations/composed_7.cpp
operations_composed_8_SOURCES = operations/composed_8.cpp
+parallel_group_ranged_wait_for_all_SOURCES = parallel_group/ranged_wait_for_all.cpp
+parallel_group_wait_for_all_SOURCES = parallel_group/wait_for_all.cpp
+parallel_group_wait_for_one_SOURCES = parallel_group/wait_for_one.cpp
+parallel_group_wait_for_one_error_SOURCES = parallel_group/wait_for_one_error.cpp
+parallel_group_wait_for_one_success_SOURCES = parallel_group/wait_for_one_success.cpp
+porthopper_client_SOURCES = porthopper/client.cpp
+porthopper_server_SOURCES = porthopper/server.cpp
+services_daytime_client_SOURCES = \
+ services/daytime_client.cpp \
+ services/logger_service.cpp
+
socks4_sync_client_SOURCES = socks4/sync_client.cpp
timeouts_async_tcp_client_SOURCES = timeouts/async_tcp_client.cpp
timeouts_blocking_tcp_client_SOURCES = timeouts/blocking_tcp_client.cpp
@@ -812,12 +1314,29 @@ timeouts_blocking_token_tcp_client_SOURCES = timeouts/blocking_token_tcp_client.
timeouts_blocking_udp_client_SOURCES = timeouts/blocking_udp_client.cpp
timeouts_server_SOURCES = timeouts/server.cpp
timers_time_t_timer_SOURCES = timers/time_t_timer.cpp
+tutorial_timer1_timer_SOURCES = tutorial/timer1/timer.cpp
+tutorial_timer2_timer_SOURCES = tutorial/timer2/timer.cpp
+tutorial_timer3_timer_SOURCES = tutorial/timer3/timer.cpp
+tutorial_timer4_timer_SOURCES = tutorial/timer4/timer.cpp
+tutorial_timer5_timer_SOURCES = tutorial/timer5/timer.cpp
+tutorial_daytime1_client_SOURCES = tutorial/daytime1/client.cpp
+tutorial_daytime2_server_SOURCES = tutorial/daytime2/server.cpp
+tutorial_daytime3_server_SOURCES = tutorial/daytime3/server.cpp
+tutorial_daytime4_client_SOURCES = tutorial/daytime4/client.cpp
+tutorial_daytime5_server_SOURCES = tutorial/daytime5/server.cpp
+tutorial_daytime6_server_SOURCES = tutorial/daytime6/server.cpp
+tutorial_daytime7_server_SOURCES = tutorial/daytime7/server.cpp
+type_erasure_type_erasure_SOURCES = type_erasure/main.cpp type_erasure/stdin_line_reader.cpp type_erasure/sleep.cpp
+@WINDOWS_TARGET_FALSE@chat_posix_chat_client_SOURCES = chat/posix_chat_client.cpp
@WINDOWS_TARGET_FALSE@fork_daemon_SOURCES = fork/daemon.cpp
@WINDOWS_TARGET_FALSE@fork_process_per_connection_SOURCES = fork/process_per_connection.cpp
@WINDOWS_TARGET_FALSE@local_connect_pair_SOURCES = local/connect_pair.cpp
@WINDOWS_TARGET_FALSE@local_iostream_client_SOURCES = local/iostream_client.cpp
@WINDOWS_TARGET_FALSE@local_stream_server_SOURCES = local/stream_server.cpp
@WINDOWS_TARGET_FALSE@local_stream_client_SOURCES = local/stream_client.cpp
+@WINDOWS_TARGET_FALSE@local_fd_passing_stream_server_SOURCES = local/fd_passing_stream_server.cpp
+@WINDOWS_TARGET_FALSE@local_fd_passing_stream_client_SOURCES = local/fd_passing_stream_client.cpp
+@WINDOWS_TARGET_TRUE@windows_transmit_file_SOURCES = windows/transmit_file.cpp
@HAVE_OPENSSL_TRUE@ssl_client_SOURCES = ssl/client.cpp
@HAVE_OPENSSL_TRUE@ssl_server_SOURCES = ssl/server.cpp
@HAVE_BOOST_COROUTINE_TRUE@spawn_echo_server_SOURCES = spawn/echo_server.cpp
@@ -825,16 +1344,14 @@ timers_time_t_timer_SOURCES = timers/time_t_timer.cpp
@HAVE_BOOST_COROUTINE_TRUE@spawn_parallel_grep_SOURCES = spawn/parallel_grep.cpp
@HAVE_BOOST_COROUTINE_TRUE@spawn_parallel_grep_LDADD = $(LDADD) -lboost_coroutine -lboost_context -lboost_thread -lboost_chrono -lboost_system
EXTRA_DIST = \
- handler_tracking/custom_tracking.hpp \
- http/server/connection.hpp \
- http/server/connection_manager.hpp \
- http/server/header.hpp \
- http/server/mime_types.hpp \
- http/server/reply.hpp \
- http/server/request.hpp \
- http/server/request_handler.hpp \
- http/server/request_parser.hpp \
- http/server/server.hpp
+ serialization/client.cpp \
+ serialization/server.cpp \
+ serialization/connection.hpp \
+ serialization/stock.hpp \
+ ssl/README \
+ ssl/ca.pem \
+ ssl/server.pem \
+ ssl/dh4096.pem
MAINTAINERCLEANFILES = \
$(srcdir)/Makefile.in
@@ -935,6 +1452,30 @@ chat/chat_server.$(OBJEXT): chat/$(am__dirstamp) \
chat/chat_server$(EXEEXT): $(chat_chat_server_OBJECTS) $(chat_chat_server_DEPENDENCIES) $(EXTRA_chat_chat_server_DEPENDENCIES) chat/$(am__dirstamp)
@rm -f chat/chat_server$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(chat_chat_server_OBJECTS) $(chat_chat_server_LDADD) $(LIBS)
+chat/posix_chat_client.$(OBJEXT): chat/$(am__dirstamp) \
+ chat/$(DEPDIR)/$(am__dirstamp)
+
+chat/posix_chat_client$(EXEEXT): $(chat_posix_chat_client_OBJECTS) $(chat_posix_chat_client_DEPENDENCIES) $(EXTRA_chat_posix_chat_client_DEPENDENCIES) chat/$(am__dirstamp)
+ @rm -f chat/posix_chat_client$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(chat_posix_chat_client_OBJECTS) $(chat_posix_chat_client_LDADD) $(LIBS)
+deferred/$(am__dirstamp):
+ @$(MKDIR_P) deferred
+ @: > deferred/$(am__dirstamp)
+deferred/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) deferred/$(DEPDIR)
+ @: > deferred/$(DEPDIR)/$(am__dirstamp)
+deferred/deferred_1.$(OBJEXT): deferred/$(am__dirstamp) \
+ deferred/$(DEPDIR)/$(am__dirstamp)
+
+deferred/deferred_1$(EXEEXT): $(deferred_deferred_1_OBJECTS) $(deferred_deferred_1_DEPENDENCIES) $(EXTRA_deferred_deferred_1_DEPENDENCIES) deferred/$(am__dirstamp)
+ @rm -f deferred/deferred_1$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(deferred_deferred_1_OBJECTS) $(deferred_deferred_1_LDADD) $(LIBS)
+deferred/deferred_2.$(OBJEXT): deferred/$(am__dirstamp) \
+ deferred/$(DEPDIR)/$(am__dirstamp)
+
+deferred/deferred_2$(EXEEXT): $(deferred_deferred_2_OBJECTS) $(deferred_deferred_2_DEPENDENCIES) $(EXTRA_deferred_deferred_2_DEPENDENCIES) deferred/$(am__dirstamp)
+ @rm -f deferred/deferred_2$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(deferred_deferred_2_OBJECTS) $(deferred_deferred_2_LDADD) $(LIBS)
echo/$(am__dirstamp):
@$(MKDIR_P) echo
@: > echo/$(am__dirstamp)
@@ -1019,6 +1560,24 @@ executors/priority_scheduler.$(OBJEXT): executors/$(am__dirstamp) \
executors/priority_scheduler$(EXEEXT): $(executors_priority_scheduler_OBJECTS) $(executors_priority_scheduler_DEPENDENCIES) $(EXTRA_executors_priority_scheduler_DEPENDENCIES) executors/$(am__dirstamp)
@rm -f executors/priority_scheduler$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(executors_priority_scheduler_OBJECTS) $(executors_priority_scheduler_LDADD) $(LIBS)
+files/$(am__dirstamp):
+ @$(MKDIR_P) files
+ @: > files/$(am__dirstamp)
+files/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) files/$(DEPDIR)
+ @: > files/$(DEPDIR)/$(am__dirstamp)
+files/async_file_copy.$(OBJEXT): files/$(am__dirstamp) \
+ files/$(DEPDIR)/$(am__dirstamp)
+
+files/async_file_copy$(EXEEXT): $(files_async_file_copy_OBJECTS) $(files_async_file_copy_DEPENDENCIES) $(EXTRA_files_async_file_copy_DEPENDENCIES) files/$(am__dirstamp)
+ @rm -f files/async_file_copy$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(files_async_file_copy_OBJECTS) $(files_async_file_copy_LDADD) $(LIBS)
+files/blocking_file_copy.$(OBJEXT): files/$(am__dirstamp) \
+ files/$(DEPDIR)/$(am__dirstamp)
+
+files/blocking_file_copy$(EXEEXT): $(files_blocking_file_copy_OBJECTS) $(files_blocking_file_copy_DEPENDENCIES) $(EXTRA_files_blocking_file_copy_DEPENDENCIES) files/$(am__dirstamp)
+ @rm -f files/blocking_file_copy$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(files_blocking_file_copy_OBJECTS) $(files_blocking_file_copy_LDADD) $(LIBS)
fork/$(am__dirstamp):
@$(MKDIR_P) fork
@: > fork/$(am__dirstamp)
@@ -1062,6 +1621,24 @@ handler_tracking/async_tcp_echo_server.$(OBJEXT): \
handler_tracking/async_tcp_echo_server$(EXEEXT): $(handler_tracking_async_tcp_echo_server_OBJECTS) $(handler_tracking_async_tcp_echo_server_DEPENDENCIES) $(EXTRA_handler_tracking_async_tcp_echo_server_DEPENDENCIES) handler_tracking/$(am__dirstamp)
@rm -f handler_tracking/async_tcp_echo_server$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(handler_tracking_async_tcp_echo_server_OBJECTS) $(handler_tracking_async_tcp_echo_server_LDADD) $(LIBS)
+http/client/$(am__dirstamp):
+ @$(MKDIR_P) http/client
+ @: > http/client/$(am__dirstamp)
+http/client/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) http/client/$(DEPDIR)
+ @: > http/client/$(DEPDIR)/$(am__dirstamp)
+http/client/async_client.$(OBJEXT): http/client/$(am__dirstamp) \
+ http/client/$(DEPDIR)/$(am__dirstamp)
+
+http/client/async_client$(EXEEXT): $(http_client_async_client_OBJECTS) $(http_client_async_client_DEPENDENCIES) $(EXTRA_http_client_async_client_DEPENDENCIES) http/client/$(am__dirstamp)
+ @rm -f http/client/async_client$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(http_client_async_client_OBJECTS) $(http_client_async_client_LDADD) $(LIBS)
+http/client/sync_client.$(OBJEXT): http/client/$(am__dirstamp) \
+ http/client/$(DEPDIR)/$(am__dirstamp)
+
+http/client/sync_client$(EXEEXT): $(http_client_sync_client_OBJECTS) $(http_client_sync_client_DEPENDENCIES) $(EXTRA_http_client_sync_client_DEPENDENCIES) http/client/$(am__dirstamp)
+ @rm -f http/client/sync_client$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(http_client_sync_client_OBJECTS) $(http_client_sync_client_LDADD) $(LIBS)
http/server/$(am__dirstamp):
@$(MKDIR_P) http/server
@: > http/server/$(am__dirstamp)
@@ -1088,6 +1665,90 @@ http/server/server.$(OBJEXT): http/server/$(am__dirstamp) \
http/server/http_server$(EXEEXT): $(http_server_http_server_OBJECTS) $(http_server_http_server_DEPENDENCIES) $(EXTRA_http_server_http_server_DEPENDENCIES) http/server/$(am__dirstamp)
@rm -f http/server/http_server$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(http_server_http_server_OBJECTS) $(http_server_http_server_LDADD) $(LIBS)
+http/server2/$(am__dirstamp):
+ @$(MKDIR_P) http/server2
+ @: > http/server2/$(am__dirstamp)
+http/server2/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) http/server2/$(DEPDIR)
+ @: > http/server2/$(DEPDIR)/$(am__dirstamp)
+http/server2/connection.$(OBJEXT): http/server2/$(am__dirstamp) \
+ http/server2/$(DEPDIR)/$(am__dirstamp)
+http/server2/io_context_pool.$(OBJEXT): http/server2/$(am__dirstamp) \
+ http/server2/$(DEPDIR)/$(am__dirstamp)
+http/server2/main.$(OBJEXT): http/server2/$(am__dirstamp) \
+ http/server2/$(DEPDIR)/$(am__dirstamp)
+http/server2/mime_types.$(OBJEXT): http/server2/$(am__dirstamp) \
+ http/server2/$(DEPDIR)/$(am__dirstamp)
+http/server2/reply.$(OBJEXT): http/server2/$(am__dirstamp) \
+ http/server2/$(DEPDIR)/$(am__dirstamp)
+http/server2/request_handler.$(OBJEXT): http/server2/$(am__dirstamp) \
+ http/server2/$(DEPDIR)/$(am__dirstamp)
+http/server2/request_parser.$(OBJEXT): http/server2/$(am__dirstamp) \
+ http/server2/$(DEPDIR)/$(am__dirstamp)
+http/server2/server.$(OBJEXT): http/server2/$(am__dirstamp) \
+ http/server2/$(DEPDIR)/$(am__dirstamp)
+
+http/server2/http_server$(EXEEXT): $(http_server2_http_server_OBJECTS) $(http_server2_http_server_DEPENDENCIES) $(EXTRA_http_server2_http_server_DEPENDENCIES) http/server2/$(am__dirstamp)
+ @rm -f http/server2/http_server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(http_server2_http_server_OBJECTS) $(http_server2_http_server_LDADD) $(LIBS)
+http/server3/$(am__dirstamp):
+ @$(MKDIR_P) http/server3
+ @: > http/server3/$(am__dirstamp)
+http/server3/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) http/server3/$(DEPDIR)
+ @: > http/server3/$(DEPDIR)/$(am__dirstamp)
+http/server3/connection.$(OBJEXT): http/server3/$(am__dirstamp) \
+ http/server3/$(DEPDIR)/$(am__dirstamp)
+http/server3/main.$(OBJEXT): http/server3/$(am__dirstamp) \
+ http/server3/$(DEPDIR)/$(am__dirstamp)
+http/server3/mime_types.$(OBJEXT): http/server3/$(am__dirstamp) \
+ http/server3/$(DEPDIR)/$(am__dirstamp)
+http/server3/reply.$(OBJEXT): http/server3/$(am__dirstamp) \
+ http/server3/$(DEPDIR)/$(am__dirstamp)
+http/server3/request_handler.$(OBJEXT): http/server3/$(am__dirstamp) \
+ http/server3/$(DEPDIR)/$(am__dirstamp)
+http/server3/request_parser.$(OBJEXT): http/server3/$(am__dirstamp) \
+ http/server3/$(DEPDIR)/$(am__dirstamp)
+http/server3/server.$(OBJEXT): http/server3/$(am__dirstamp) \
+ http/server3/$(DEPDIR)/$(am__dirstamp)
+
+http/server3/http_server$(EXEEXT): $(http_server3_http_server_OBJECTS) $(http_server3_http_server_DEPENDENCIES) $(EXTRA_http_server3_http_server_DEPENDENCIES) http/server3/$(am__dirstamp)
+ @rm -f http/server3/http_server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(http_server3_http_server_OBJECTS) $(http_server3_http_server_LDADD) $(LIBS)
+http/server4/$(am__dirstamp):
+ @$(MKDIR_P) http/server4
+ @: > http/server4/$(am__dirstamp)
+http/server4/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) http/server4/$(DEPDIR)
+ @: > http/server4/$(DEPDIR)/$(am__dirstamp)
+http/server4/file_handler.$(OBJEXT): http/server4/$(am__dirstamp) \
+ http/server4/$(DEPDIR)/$(am__dirstamp)
+http/server4/main.$(OBJEXT): http/server4/$(am__dirstamp) \
+ http/server4/$(DEPDIR)/$(am__dirstamp)
+http/server4/mime_types.$(OBJEXT): http/server4/$(am__dirstamp) \
+ http/server4/$(DEPDIR)/$(am__dirstamp)
+http/server4/reply.$(OBJEXT): http/server4/$(am__dirstamp) \
+ http/server4/$(DEPDIR)/$(am__dirstamp)
+http/server4/request_parser.$(OBJEXT): http/server4/$(am__dirstamp) \
+ http/server4/$(DEPDIR)/$(am__dirstamp)
+http/server4/server.$(OBJEXT): http/server4/$(am__dirstamp) \
+ http/server4/$(DEPDIR)/$(am__dirstamp)
+
+http/server4/http_server$(EXEEXT): $(http_server4_http_server_OBJECTS) $(http_server4_http_server_DEPENDENCIES) $(EXTRA_http_server4_http_server_DEPENDENCIES) http/server4/$(am__dirstamp)
+ @rm -f http/server4/http_server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(http_server4_http_server_OBJECTS) $(http_server4_http_server_LDADD) $(LIBS)
+icmp/$(am__dirstamp):
+ @$(MKDIR_P) icmp
+ @: > icmp/$(am__dirstamp)
+icmp/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) icmp/$(DEPDIR)
+ @: > icmp/$(DEPDIR)/$(am__dirstamp)
+icmp/ping.$(OBJEXT): icmp/$(am__dirstamp) \
+ icmp/$(DEPDIR)/$(am__dirstamp)
+
+icmp/ping$(EXEEXT): $(icmp_ping_OBJECTS) $(icmp_ping_DEPENDENCIES) $(EXTRA_icmp_ping_DEPENDENCIES) icmp/$(am__dirstamp)
+ @rm -f icmp/ping$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(icmp_ping_OBJECTS) $(icmp_ping_LDADD) $(LIBS)
invocation/$(am__dirstamp):
@$(MKDIR_P) invocation
@: > invocation/$(am__dirstamp)
@@ -1106,6 +1767,18 @@ iostreams/$(am__dirstamp):
iostreams/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) iostreams/$(DEPDIR)
@: > iostreams/$(DEPDIR)/$(am__dirstamp)
+iostreams/daytime_client.$(OBJEXT): iostreams/$(am__dirstamp) \
+ iostreams/$(DEPDIR)/$(am__dirstamp)
+
+iostreams/daytime_client$(EXEEXT): $(iostreams_daytime_client_OBJECTS) $(iostreams_daytime_client_DEPENDENCIES) $(EXTRA_iostreams_daytime_client_DEPENDENCIES) iostreams/$(am__dirstamp)
+ @rm -f iostreams/daytime_client$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(iostreams_daytime_client_OBJECTS) $(iostreams_daytime_client_LDADD) $(LIBS)
+iostreams/daytime_server.$(OBJEXT): iostreams/$(am__dirstamp) \
+ iostreams/$(DEPDIR)/$(am__dirstamp)
+
+iostreams/daytime_server$(EXEEXT): $(iostreams_daytime_server_OBJECTS) $(iostreams_daytime_server_DEPENDENCIES) $(EXTRA_iostreams_daytime_server_DEPENDENCIES) iostreams/$(am__dirstamp)
+ @rm -f iostreams/daytime_server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(iostreams_daytime_server_OBJECTS) $(iostreams_daytime_server_LDADD) $(LIBS)
iostreams/http_client.$(OBJEXT): iostreams/$(am__dirstamp) \
iostreams/$(DEPDIR)/$(am__dirstamp)
@@ -1124,6 +1797,18 @@ local/connect_pair.$(OBJEXT): local/$(am__dirstamp) \
local/connect_pair$(EXEEXT): $(local_connect_pair_OBJECTS) $(local_connect_pair_DEPENDENCIES) $(EXTRA_local_connect_pair_DEPENDENCIES) local/$(am__dirstamp)
@rm -f local/connect_pair$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(local_connect_pair_OBJECTS) $(local_connect_pair_LDADD) $(LIBS)
+local/fd_passing_stream_client.$(OBJEXT): local/$(am__dirstamp) \
+ local/$(DEPDIR)/$(am__dirstamp)
+
+local/fd_passing_stream_client$(EXEEXT): $(local_fd_passing_stream_client_OBJECTS) $(local_fd_passing_stream_client_DEPENDENCIES) $(EXTRA_local_fd_passing_stream_client_DEPENDENCIES) local/$(am__dirstamp)
+ @rm -f local/fd_passing_stream_client$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(local_fd_passing_stream_client_OBJECTS) $(local_fd_passing_stream_client_LDADD) $(LIBS)
+local/fd_passing_stream_server.$(OBJEXT): local/$(am__dirstamp) \
+ local/$(DEPDIR)/$(am__dirstamp)
+
+local/fd_passing_stream_server$(EXEEXT): $(local_fd_passing_stream_server_OBJECTS) $(local_fd_passing_stream_server_DEPENDENCIES) $(EXTRA_local_fd_passing_stream_server_DEPENDENCIES) local/$(am__dirstamp)
+ @rm -f local/fd_passing_stream_server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(local_fd_passing_stream_server_OBJECTS) $(local_fd_passing_stream_server_LDADD) $(LIBS)
local/iostream_client.$(OBJEXT): local/$(am__dirstamp) \
local/$(DEPDIR)/$(am__dirstamp)
@@ -1226,6 +1911,77 @@ operations/composed_8.$(OBJEXT): operations/$(am__dirstamp) \
operations/composed_8$(EXEEXT): $(operations_composed_8_OBJECTS) $(operations_composed_8_DEPENDENCIES) $(EXTRA_operations_composed_8_DEPENDENCIES) operations/$(am__dirstamp)
@rm -f operations/composed_8$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(operations_composed_8_OBJECTS) $(operations_composed_8_LDADD) $(LIBS)
+parallel_group/$(am__dirstamp):
+ @$(MKDIR_P) parallel_group
+ @: > parallel_group/$(am__dirstamp)
+parallel_group/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) parallel_group/$(DEPDIR)
+ @: > parallel_group/$(DEPDIR)/$(am__dirstamp)
+parallel_group/ranged_wait_for_all.$(OBJEXT): \
+ parallel_group/$(am__dirstamp) \
+ parallel_group/$(DEPDIR)/$(am__dirstamp)
+
+parallel_group/ranged_wait_for_all$(EXEEXT): $(parallel_group_ranged_wait_for_all_OBJECTS) $(parallel_group_ranged_wait_for_all_DEPENDENCIES) $(EXTRA_parallel_group_ranged_wait_for_all_DEPENDENCIES) parallel_group/$(am__dirstamp)
+ @rm -f parallel_group/ranged_wait_for_all$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(parallel_group_ranged_wait_for_all_OBJECTS) $(parallel_group_ranged_wait_for_all_LDADD) $(LIBS)
+parallel_group/wait_for_all.$(OBJEXT): parallel_group/$(am__dirstamp) \
+ parallel_group/$(DEPDIR)/$(am__dirstamp)
+
+parallel_group/wait_for_all$(EXEEXT): $(parallel_group_wait_for_all_OBJECTS) $(parallel_group_wait_for_all_DEPENDENCIES) $(EXTRA_parallel_group_wait_for_all_DEPENDENCIES) parallel_group/$(am__dirstamp)
+ @rm -f parallel_group/wait_for_all$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(parallel_group_wait_for_all_OBJECTS) $(parallel_group_wait_for_all_LDADD) $(LIBS)
+parallel_group/wait_for_one.$(OBJEXT): parallel_group/$(am__dirstamp) \
+ parallel_group/$(DEPDIR)/$(am__dirstamp)
+
+parallel_group/wait_for_one$(EXEEXT): $(parallel_group_wait_for_one_OBJECTS) $(parallel_group_wait_for_one_DEPENDENCIES) $(EXTRA_parallel_group_wait_for_one_DEPENDENCIES) parallel_group/$(am__dirstamp)
+ @rm -f parallel_group/wait_for_one$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(parallel_group_wait_for_one_OBJECTS) $(parallel_group_wait_for_one_LDADD) $(LIBS)
+parallel_group/wait_for_one_error.$(OBJEXT): \
+ parallel_group/$(am__dirstamp) \
+ parallel_group/$(DEPDIR)/$(am__dirstamp)
+
+parallel_group/wait_for_one_error$(EXEEXT): $(parallel_group_wait_for_one_error_OBJECTS) $(parallel_group_wait_for_one_error_DEPENDENCIES) $(EXTRA_parallel_group_wait_for_one_error_DEPENDENCIES) parallel_group/$(am__dirstamp)
+ @rm -f parallel_group/wait_for_one_error$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(parallel_group_wait_for_one_error_OBJECTS) $(parallel_group_wait_for_one_error_LDADD) $(LIBS)
+parallel_group/wait_for_one_success.$(OBJEXT): \
+ parallel_group/$(am__dirstamp) \
+ parallel_group/$(DEPDIR)/$(am__dirstamp)
+
+parallel_group/wait_for_one_success$(EXEEXT): $(parallel_group_wait_for_one_success_OBJECTS) $(parallel_group_wait_for_one_success_DEPENDENCIES) $(EXTRA_parallel_group_wait_for_one_success_DEPENDENCIES) parallel_group/$(am__dirstamp)
+ @rm -f parallel_group/wait_for_one_success$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(parallel_group_wait_for_one_success_OBJECTS) $(parallel_group_wait_for_one_success_LDADD) $(LIBS)
+porthopper/$(am__dirstamp):
+ @$(MKDIR_P) porthopper
+ @: > porthopper/$(am__dirstamp)
+porthopper/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) porthopper/$(DEPDIR)
+ @: > porthopper/$(DEPDIR)/$(am__dirstamp)
+porthopper/client.$(OBJEXT): porthopper/$(am__dirstamp) \
+ porthopper/$(DEPDIR)/$(am__dirstamp)
+
+porthopper/client$(EXEEXT): $(porthopper_client_OBJECTS) $(porthopper_client_DEPENDENCIES) $(EXTRA_porthopper_client_DEPENDENCIES) porthopper/$(am__dirstamp)
+ @rm -f porthopper/client$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(porthopper_client_OBJECTS) $(porthopper_client_LDADD) $(LIBS)
+porthopper/server.$(OBJEXT): porthopper/$(am__dirstamp) \
+ porthopper/$(DEPDIR)/$(am__dirstamp)
+
+porthopper/server$(EXEEXT): $(porthopper_server_OBJECTS) $(porthopper_server_DEPENDENCIES) $(EXTRA_porthopper_server_DEPENDENCIES) porthopper/$(am__dirstamp)
+ @rm -f porthopper/server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(porthopper_server_OBJECTS) $(porthopper_server_LDADD) $(LIBS)
+services/$(am__dirstamp):
+ @$(MKDIR_P) services
+ @: > services/$(am__dirstamp)
+services/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) services/$(DEPDIR)
+ @: > services/$(DEPDIR)/$(am__dirstamp)
+services/daytime_client.$(OBJEXT): services/$(am__dirstamp) \
+ services/$(DEPDIR)/$(am__dirstamp)
+services/logger_service.$(OBJEXT): services/$(am__dirstamp) \
+ services/$(DEPDIR)/$(am__dirstamp)
+
+services/daytime_client$(EXEEXT): $(services_daytime_client_OBJECTS) $(services_daytime_client_DEPENDENCIES) $(EXTRA_services_daytime_client_DEPENDENCIES) services/$(am__dirstamp)
+ @rm -f services/daytime_client$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(services_daytime_client_OBJECTS) $(services_daytime_client_LDADD) $(LIBS)
socks4/$(am__dirstamp):
@$(MKDIR_P) socks4
@: > socks4/$(am__dirstamp)
@@ -1322,6 +2078,179 @@ timers/time_t_timer.$(OBJEXT): timers/$(am__dirstamp) \
timers/time_t_timer$(EXEEXT): $(timers_time_t_timer_OBJECTS) $(timers_time_t_timer_DEPENDENCIES) $(EXTRA_timers_time_t_timer_DEPENDENCIES) timers/$(am__dirstamp)
@rm -f timers/time_t_timer$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(timers_time_t_timer_OBJECTS) $(timers_time_t_timer_LDADD) $(LIBS)
+tutorial/daytime1/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime1
+ @: > tutorial/daytime1/$(am__dirstamp)
+tutorial/daytime1/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime1/$(DEPDIR)
+ @: > tutorial/daytime1/$(DEPDIR)/$(am__dirstamp)
+tutorial/daytime1/client.$(OBJEXT): tutorial/daytime1/$(am__dirstamp) \
+ tutorial/daytime1/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/daytime1/client$(EXEEXT): $(tutorial_daytime1_client_OBJECTS) $(tutorial_daytime1_client_DEPENDENCIES) $(EXTRA_tutorial_daytime1_client_DEPENDENCIES) tutorial/daytime1/$(am__dirstamp)
+ @rm -f tutorial/daytime1/client$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime1_client_OBJECTS) $(tutorial_daytime1_client_LDADD) $(LIBS)
+tutorial/daytime2/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime2
+ @: > tutorial/daytime2/$(am__dirstamp)
+tutorial/daytime2/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime2/$(DEPDIR)
+ @: > tutorial/daytime2/$(DEPDIR)/$(am__dirstamp)
+tutorial/daytime2/server.$(OBJEXT): tutorial/daytime2/$(am__dirstamp) \
+ tutorial/daytime2/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/daytime2/server$(EXEEXT): $(tutorial_daytime2_server_OBJECTS) $(tutorial_daytime2_server_DEPENDENCIES) $(EXTRA_tutorial_daytime2_server_DEPENDENCIES) tutorial/daytime2/$(am__dirstamp)
+ @rm -f tutorial/daytime2/server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime2_server_OBJECTS) $(tutorial_daytime2_server_LDADD) $(LIBS)
+tutorial/daytime3/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime3
+ @: > tutorial/daytime3/$(am__dirstamp)
+tutorial/daytime3/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime3/$(DEPDIR)
+ @: > tutorial/daytime3/$(DEPDIR)/$(am__dirstamp)
+tutorial/daytime3/server.$(OBJEXT): tutorial/daytime3/$(am__dirstamp) \
+ tutorial/daytime3/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/daytime3/server$(EXEEXT): $(tutorial_daytime3_server_OBJECTS) $(tutorial_daytime3_server_DEPENDENCIES) $(EXTRA_tutorial_daytime3_server_DEPENDENCIES) tutorial/daytime3/$(am__dirstamp)
+ @rm -f tutorial/daytime3/server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime3_server_OBJECTS) $(tutorial_daytime3_server_LDADD) $(LIBS)
+tutorial/daytime4/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime4
+ @: > tutorial/daytime4/$(am__dirstamp)
+tutorial/daytime4/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime4/$(DEPDIR)
+ @: > tutorial/daytime4/$(DEPDIR)/$(am__dirstamp)
+tutorial/daytime4/client.$(OBJEXT): tutorial/daytime4/$(am__dirstamp) \
+ tutorial/daytime4/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/daytime4/client$(EXEEXT): $(tutorial_daytime4_client_OBJECTS) $(tutorial_daytime4_client_DEPENDENCIES) $(EXTRA_tutorial_daytime4_client_DEPENDENCIES) tutorial/daytime4/$(am__dirstamp)
+ @rm -f tutorial/daytime4/client$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime4_client_OBJECTS) $(tutorial_daytime4_client_LDADD) $(LIBS)
+tutorial/daytime5/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime5
+ @: > tutorial/daytime5/$(am__dirstamp)
+tutorial/daytime5/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime5/$(DEPDIR)
+ @: > tutorial/daytime5/$(DEPDIR)/$(am__dirstamp)
+tutorial/daytime5/server.$(OBJEXT): tutorial/daytime5/$(am__dirstamp) \
+ tutorial/daytime5/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/daytime5/server$(EXEEXT): $(tutorial_daytime5_server_OBJECTS) $(tutorial_daytime5_server_DEPENDENCIES) $(EXTRA_tutorial_daytime5_server_DEPENDENCIES) tutorial/daytime5/$(am__dirstamp)
+ @rm -f tutorial/daytime5/server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime5_server_OBJECTS) $(tutorial_daytime5_server_LDADD) $(LIBS)
+tutorial/daytime6/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime6
+ @: > tutorial/daytime6/$(am__dirstamp)
+tutorial/daytime6/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime6/$(DEPDIR)
+ @: > tutorial/daytime6/$(DEPDIR)/$(am__dirstamp)
+tutorial/daytime6/server.$(OBJEXT): tutorial/daytime6/$(am__dirstamp) \
+ tutorial/daytime6/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/daytime6/server$(EXEEXT): $(tutorial_daytime6_server_OBJECTS) $(tutorial_daytime6_server_DEPENDENCIES) $(EXTRA_tutorial_daytime6_server_DEPENDENCIES) tutorial/daytime6/$(am__dirstamp)
+ @rm -f tutorial/daytime6/server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime6_server_OBJECTS) $(tutorial_daytime6_server_LDADD) $(LIBS)
+tutorial/daytime7/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime7
+ @: > tutorial/daytime7/$(am__dirstamp)
+tutorial/daytime7/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/daytime7/$(DEPDIR)
+ @: > tutorial/daytime7/$(DEPDIR)/$(am__dirstamp)
+tutorial/daytime7/server.$(OBJEXT): tutorial/daytime7/$(am__dirstamp) \
+ tutorial/daytime7/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/daytime7/server$(EXEEXT): $(tutorial_daytime7_server_OBJECTS) $(tutorial_daytime7_server_DEPENDENCIES) $(EXTRA_tutorial_daytime7_server_DEPENDENCIES) tutorial/daytime7/$(am__dirstamp)
+ @rm -f tutorial/daytime7/server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_daytime7_server_OBJECTS) $(tutorial_daytime7_server_LDADD) $(LIBS)
+tutorial/timer1/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer1
+ @: > tutorial/timer1/$(am__dirstamp)
+tutorial/timer1/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer1/$(DEPDIR)
+ @: > tutorial/timer1/$(DEPDIR)/$(am__dirstamp)
+tutorial/timer1/timer.$(OBJEXT): tutorial/timer1/$(am__dirstamp) \
+ tutorial/timer1/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/timer1/timer$(EXEEXT): $(tutorial_timer1_timer_OBJECTS) $(tutorial_timer1_timer_DEPENDENCIES) $(EXTRA_tutorial_timer1_timer_DEPENDENCIES) tutorial/timer1/$(am__dirstamp)
+ @rm -f tutorial/timer1/timer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer1_timer_OBJECTS) $(tutorial_timer1_timer_LDADD) $(LIBS)
+tutorial/timer2/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer2
+ @: > tutorial/timer2/$(am__dirstamp)
+tutorial/timer2/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer2/$(DEPDIR)
+ @: > tutorial/timer2/$(DEPDIR)/$(am__dirstamp)
+tutorial/timer2/timer.$(OBJEXT): tutorial/timer2/$(am__dirstamp) \
+ tutorial/timer2/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/timer2/timer$(EXEEXT): $(tutorial_timer2_timer_OBJECTS) $(tutorial_timer2_timer_DEPENDENCIES) $(EXTRA_tutorial_timer2_timer_DEPENDENCIES) tutorial/timer2/$(am__dirstamp)
+ @rm -f tutorial/timer2/timer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer2_timer_OBJECTS) $(tutorial_timer2_timer_LDADD) $(LIBS)
+tutorial/timer3/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer3
+ @: > tutorial/timer3/$(am__dirstamp)
+tutorial/timer3/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer3/$(DEPDIR)
+ @: > tutorial/timer3/$(DEPDIR)/$(am__dirstamp)
+tutorial/timer3/timer.$(OBJEXT): tutorial/timer3/$(am__dirstamp) \
+ tutorial/timer3/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/timer3/timer$(EXEEXT): $(tutorial_timer3_timer_OBJECTS) $(tutorial_timer3_timer_DEPENDENCIES) $(EXTRA_tutorial_timer3_timer_DEPENDENCIES) tutorial/timer3/$(am__dirstamp)
+ @rm -f tutorial/timer3/timer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer3_timer_OBJECTS) $(tutorial_timer3_timer_LDADD) $(LIBS)
+tutorial/timer4/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer4
+ @: > tutorial/timer4/$(am__dirstamp)
+tutorial/timer4/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer4/$(DEPDIR)
+ @: > tutorial/timer4/$(DEPDIR)/$(am__dirstamp)
+tutorial/timer4/timer.$(OBJEXT): tutorial/timer4/$(am__dirstamp) \
+ tutorial/timer4/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/timer4/timer$(EXEEXT): $(tutorial_timer4_timer_OBJECTS) $(tutorial_timer4_timer_DEPENDENCIES) $(EXTRA_tutorial_timer4_timer_DEPENDENCIES) tutorial/timer4/$(am__dirstamp)
+ @rm -f tutorial/timer4/timer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer4_timer_OBJECTS) $(tutorial_timer4_timer_LDADD) $(LIBS)
+tutorial/timer5/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer5
+ @: > tutorial/timer5/$(am__dirstamp)
+tutorial/timer5/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tutorial/timer5/$(DEPDIR)
+ @: > tutorial/timer5/$(DEPDIR)/$(am__dirstamp)
+tutorial/timer5/timer.$(OBJEXT): tutorial/timer5/$(am__dirstamp) \
+ tutorial/timer5/$(DEPDIR)/$(am__dirstamp)
+
+tutorial/timer5/timer$(EXEEXT): $(tutorial_timer5_timer_OBJECTS) $(tutorial_timer5_timer_DEPENDENCIES) $(EXTRA_tutorial_timer5_timer_DEPENDENCIES) tutorial/timer5/$(am__dirstamp)
+ @rm -f tutorial/timer5/timer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tutorial_timer5_timer_OBJECTS) $(tutorial_timer5_timer_LDADD) $(LIBS)
+type_erasure/$(am__dirstamp):
+ @$(MKDIR_P) type_erasure
+ @: > type_erasure/$(am__dirstamp)
+type_erasure/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) type_erasure/$(DEPDIR)
+ @: > type_erasure/$(DEPDIR)/$(am__dirstamp)
+type_erasure/main.$(OBJEXT): type_erasure/$(am__dirstamp) \
+ type_erasure/$(DEPDIR)/$(am__dirstamp)
+type_erasure/stdin_line_reader.$(OBJEXT): \
+ type_erasure/$(am__dirstamp) \
+ type_erasure/$(DEPDIR)/$(am__dirstamp)
+type_erasure/sleep.$(OBJEXT): type_erasure/$(am__dirstamp) \
+ type_erasure/$(DEPDIR)/$(am__dirstamp)
+
+type_erasure/type_erasure$(EXEEXT): $(type_erasure_type_erasure_OBJECTS) $(type_erasure_type_erasure_DEPENDENCIES) $(EXTRA_type_erasure_type_erasure_DEPENDENCIES) type_erasure/$(am__dirstamp)
+ @rm -f type_erasure/type_erasure$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(type_erasure_type_erasure_OBJECTS) $(type_erasure_type_erasure_LDADD) $(LIBS)
+windows/$(am__dirstamp):
+ @$(MKDIR_P) windows
+ @: > windows/$(am__dirstamp)
+windows/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) windows/$(DEPDIR)
+ @: > windows/$(DEPDIR)/$(am__dirstamp)
+windows/transmit_file.$(OBJEXT): windows/$(am__dirstamp) \
+ windows/$(DEPDIR)/$(am__dirstamp)
+
+windows/transmit_file$(EXEEXT): $(windows_transmit_file_OBJECTS) $(windows_transmit_file_DEPENDENCIES) $(EXTRA_windows_transmit_file_DEPENDENCIES) windows/$(am__dirstamp)
+ @rm -f windows/transmit_file$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(windows_transmit_file_OBJECTS) $(windows_transmit_file_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -1329,23 +2258,47 @@ mostlyclean-compile:
-rm -f allocation/*.$(OBJEXT)
-rm -f buffers/*.$(OBJEXT)
-rm -f chat/*.$(OBJEXT)
+ -rm -f deferred/*.$(OBJEXT)
-rm -f echo/*.$(OBJEXT)
-rm -f executors/*.$(OBJEXT)
+ -rm -f files/*.$(OBJEXT)
-rm -f fork/*.$(OBJEXT)
-rm -f futures/*.$(OBJEXT)
-rm -f handler_tracking/*.$(OBJEXT)
+ -rm -f http/client/*.$(OBJEXT)
-rm -f http/server/*.$(OBJEXT)
+ -rm -f http/server2/*.$(OBJEXT)
+ -rm -f http/server3/*.$(OBJEXT)
+ -rm -f http/server4/*.$(OBJEXT)
+ -rm -f icmp/*.$(OBJEXT)
-rm -f invocation/*.$(OBJEXT)
-rm -f iostreams/*.$(OBJEXT)
-rm -f local/*.$(OBJEXT)
-rm -f multicast/*.$(OBJEXT)
-rm -f nonblocking/*.$(OBJEXT)
-rm -f operations/*.$(OBJEXT)
+ -rm -f parallel_group/*.$(OBJEXT)
+ -rm -f porthopper/*.$(OBJEXT)
+ -rm -f services/*.$(OBJEXT)
-rm -f socks4/*.$(OBJEXT)
-rm -f spawn/*.$(OBJEXT)
-rm -f ssl/*.$(OBJEXT)
-rm -f timeouts/*.$(OBJEXT)
-rm -f timers/*.$(OBJEXT)
+ -rm -f tutorial/daytime1/*.$(OBJEXT)
+ -rm -f tutorial/daytime2/*.$(OBJEXT)
+ -rm -f tutorial/daytime3/*.$(OBJEXT)
+ -rm -f tutorial/daytime4/*.$(OBJEXT)
+ -rm -f tutorial/daytime5/*.$(OBJEXT)
+ -rm -f tutorial/daytime6/*.$(OBJEXT)
+ -rm -f tutorial/daytime7/*.$(OBJEXT)
+ -rm -f tutorial/timer1/*.$(OBJEXT)
+ -rm -f tutorial/timer2/*.$(OBJEXT)
+ -rm -f tutorial/timer3/*.$(OBJEXT)
+ -rm -f tutorial/timer4/*.$(OBJEXT)
+ -rm -f tutorial/timer5/*.$(OBJEXT)
+ -rm -f type_erasure/*.$(OBJEXT)
+ -rm -f windows/*.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@@ -1356,6 +2309,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@buffers/$(DEPDIR)/reference_counted.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@chat/$(DEPDIR)/chat_client.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@chat/$(DEPDIR)/chat_server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@chat/$(DEPDIR)/posix_chat_client.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@deferred/$(DEPDIR)/deferred_1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@deferred/$(DEPDIR)/deferred_2.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@echo/$(DEPDIR)/async_tcp_echo_server.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@echo/$(DEPDIR)/async_udp_echo_server.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@echo/$(DEPDIR)/blocking_tcp_echo_client.Po@am__quote@ # am--include-marker
@@ -1368,10 +2324,14 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@executors/$(DEPDIR)/fork_join.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@executors/$(DEPDIR)/pipeline.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@executors/$(DEPDIR)/priority_scheduler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@files/$(DEPDIR)/async_file_copy.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@files/$(DEPDIR)/blocking_file_copy.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@fork/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@fork/$(DEPDIR)/process_per_connection.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@futures/$(DEPDIR)/daytime_client.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@handler_tracking/$(DEPDIR)/async_tcp_echo_server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/client/$(DEPDIR)/async_client.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/client/$(DEPDIR)/sync_client.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/connection.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/connection_manager.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
@@ -1380,9 +2340,35 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/request_handler.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/request_parser.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@http/server/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/connection.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/io_context_pool.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/mime_types.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/reply.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/request_handler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/request_parser.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server2/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/connection.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/mime_types.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/reply.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/request_handler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/request_parser.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server3/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/file_handler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/mime_types.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/reply.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/request_parser.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@http/server4/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@icmp/$(DEPDIR)/ping.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@invocation/$(DEPDIR)/prioritised_handlers.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@iostreams/$(DEPDIR)/daytime_client.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@iostreams/$(DEPDIR)/daytime_server.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@iostreams/$(DEPDIR)/http_client.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/connect_pair.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/fd_passing_stream_client.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/fd_passing_stream_server.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/iostream_client.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/stream_client.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@local/$(DEPDIR)/stream_server.Po@am__quote@ # am--include-marker
@@ -1397,6 +2383,15 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_6.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_7.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_8.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/ranged_wait_for_all.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/wait_for_all.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/wait_for_one.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/wait_for_one_error.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/wait_for_one_success.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@porthopper/$(DEPDIR)/client.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@porthopper/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@services/$(DEPDIR)/daytime_client.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@services/$(DEPDIR)/logger_service.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@socks4/$(DEPDIR)/sync_client.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@spawn/$(DEPDIR)/echo_server.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@spawn/$(DEPDIR)/parallel_grep.Po@am__quote@ # am--include-marker
@@ -1408,6 +2403,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@timeouts/$(DEPDIR)/blocking_udp_client.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@timeouts/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@timers/$(DEPDIR)/time_t_timer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime1/$(DEPDIR)/client.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime2/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime3/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime4/$(DEPDIR)/client.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime5/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime6/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/daytime7/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer1/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer2/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer3/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer4/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@tutorial/timer5/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@type_erasure/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@type_erasure/$(DEPDIR)/sleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@type_erasure/$(DEPDIR)/stdin_line_reader.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@windows/$(DEPDIR)/transmit_file.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@@ -1482,7 +2493,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -1554,18 +2564,32 @@ distclean-generic:
-rm -f buffers/$(am__dirstamp)
-rm -f chat/$(DEPDIR)/$(am__dirstamp)
-rm -f chat/$(am__dirstamp)
+ -rm -f deferred/$(DEPDIR)/$(am__dirstamp)
+ -rm -f deferred/$(am__dirstamp)
-rm -f echo/$(DEPDIR)/$(am__dirstamp)
-rm -f echo/$(am__dirstamp)
-rm -f executors/$(DEPDIR)/$(am__dirstamp)
-rm -f executors/$(am__dirstamp)
+ -rm -f files/$(DEPDIR)/$(am__dirstamp)
+ -rm -f files/$(am__dirstamp)
-rm -f fork/$(DEPDIR)/$(am__dirstamp)
-rm -f fork/$(am__dirstamp)
-rm -f futures/$(DEPDIR)/$(am__dirstamp)
-rm -f futures/$(am__dirstamp)
-rm -f handler_tracking/$(DEPDIR)/$(am__dirstamp)
-rm -f handler_tracking/$(am__dirstamp)
+ -rm -f http/client/$(DEPDIR)/$(am__dirstamp)
+ -rm -f http/client/$(am__dirstamp)
-rm -f http/server/$(DEPDIR)/$(am__dirstamp)
-rm -f http/server/$(am__dirstamp)
+ -rm -f http/server2/$(DEPDIR)/$(am__dirstamp)
+ -rm -f http/server2/$(am__dirstamp)
+ -rm -f http/server3/$(DEPDIR)/$(am__dirstamp)
+ -rm -f http/server3/$(am__dirstamp)
+ -rm -f http/server4/$(DEPDIR)/$(am__dirstamp)
+ -rm -f http/server4/$(am__dirstamp)
+ -rm -f icmp/$(DEPDIR)/$(am__dirstamp)
+ -rm -f icmp/$(am__dirstamp)
-rm -f invocation/$(DEPDIR)/$(am__dirstamp)
-rm -f invocation/$(am__dirstamp)
-rm -f iostreams/$(DEPDIR)/$(am__dirstamp)
@@ -1578,6 +2602,12 @@ distclean-generic:
-rm -f nonblocking/$(am__dirstamp)
-rm -f operations/$(DEPDIR)/$(am__dirstamp)
-rm -f operations/$(am__dirstamp)
+ -rm -f parallel_group/$(DEPDIR)/$(am__dirstamp)
+ -rm -f parallel_group/$(am__dirstamp)
+ -rm -f porthopper/$(DEPDIR)/$(am__dirstamp)
+ -rm -f porthopper/$(am__dirstamp)
+ -rm -f services/$(DEPDIR)/$(am__dirstamp)
+ -rm -f services/$(am__dirstamp)
-rm -f socks4/$(DEPDIR)/$(am__dirstamp)
-rm -f socks4/$(am__dirstamp)
-rm -f spawn/$(DEPDIR)/$(am__dirstamp)
@@ -1588,6 +2618,34 @@ distclean-generic:
-rm -f timeouts/$(am__dirstamp)
-rm -f timers/$(DEPDIR)/$(am__dirstamp)
-rm -f timers/$(am__dirstamp)
+ -rm -f tutorial/daytime1/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/daytime1/$(am__dirstamp)
+ -rm -f tutorial/daytime2/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/daytime2/$(am__dirstamp)
+ -rm -f tutorial/daytime3/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/daytime3/$(am__dirstamp)
+ -rm -f tutorial/daytime4/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/daytime4/$(am__dirstamp)
+ -rm -f tutorial/daytime5/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/daytime5/$(am__dirstamp)
+ -rm -f tutorial/daytime6/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/daytime6/$(am__dirstamp)
+ -rm -f tutorial/daytime7/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/daytime7/$(am__dirstamp)
+ -rm -f tutorial/timer1/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/timer1/$(am__dirstamp)
+ -rm -f tutorial/timer2/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/timer2/$(am__dirstamp)
+ -rm -f tutorial/timer3/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/timer3/$(am__dirstamp)
+ -rm -f tutorial/timer4/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/timer4/$(am__dirstamp)
+ -rm -f tutorial/timer5/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tutorial/timer5/$(am__dirstamp)
+ -rm -f type_erasure/$(DEPDIR)/$(am__dirstamp)
+ -rm -f type_erasure/$(am__dirstamp)
+ -rm -f windows/$(DEPDIR)/$(am__dirstamp)
+ -rm -f windows/$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -1605,6 +2663,9 @@ distclean: distclean-am
-rm -f buffers/$(DEPDIR)/reference_counted.Po
-rm -f chat/$(DEPDIR)/chat_client.Po
-rm -f chat/$(DEPDIR)/chat_server.Po
+ -rm -f chat/$(DEPDIR)/posix_chat_client.Po
+ -rm -f deferred/$(DEPDIR)/deferred_1.Po
+ -rm -f deferred/$(DEPDIR)/deferred_2.Po
-rm -f echo/$(DEPDIR)/async_tcp_echo_server.Po
-rm -f echo/$(DEPDIR)/async_udp_echo_server.Po
-rm -f echo/$(DEPDIR)/blocking_tcp_echo_client.Po
@@ -1617,10 +2678,14 @@ distclean: distclean-am
-rm -f executors/$(DEPDIR)/fork_join.Po
-rm -f executors/$(DEPDIR)/pipeline.Po
-rm -f executors/$(DEPDIR)/priority_scheduler.Po
+ -rm -f files/$(DEPDIR)/async_file_copy.Po
+ -rm -f files/$(DEPDIR)/blocking_file_copy.Po
-rm -f fork/$(DEPDIR)/daemon.Po
-rm -f fork/$(DEPDIR)/process_per_connection.Po
-rm -f futures/$(DEPDIR)/daytime_client.Po
-rm -f handler_tracking/$(DEPDIR)/async_tcp_echo_server.Po
+ -rm -f http/client/$(DEPDIR)/async_client.Po
+ -rm -f http/client/$(DEPDIR)/sync_client.Po
-rm -f http/server/$(DEPDIR)/connection.Po
-rm -f http/server/$(DEPDIR)/connection_manager.Po
-rm -f http/server/$(DEPDIR)/main.Po
@@ -1629,9 +2694,35 @@ distclean: distclean-am
-rm -f http/server/$(DEPDIR)/request_handler.Po
-rm -f http/server/$(DEPDIR)/request_parser.Po
-rm -f http/server/$(DEPDIR)/server.Po
+ -rm -f http/server2/$(DEPDIR)/connection.Po
+ -rm -f http/server2/$(DEPDIR)/io_context_pool.Po
+ -rm -f http/server2/$(DEPDIR)/main.Po
+ -rm -f http/server2/$(DEPDIR)/mime_types.Po
+ -rm -f http/server2/$(DEPDIR)/reply.Po
+ -rm -f http/server2/$(DEPDIR)/request_handler.Po
+ -rm -f http/server2/$(DEPDIR)/request_parser.Po
+ -rm -f http/server2/$(DEPDIR)/server.Po
+ -rm -f http/server3/$(DEPDIR)/connection.Po
+ -rm -f http/server3/$(DEPDIR)/main.Po
+ -rm -f http/server3/$(DEPDIR)/mime_types.Po
+ -rm -f http/server3/$(DEPDIR)/reply.Po
+ -rm -f http/server3/$(DEPDIR)/request_handler.Po
+ -rm -f http/server3/$(DEPDIR)/request_parser.Po
+ -rm -f http/server3/$(DEPDIR)/server.Po
+ -rm -f http/server4/$(DEPDIR)/file_handler.Po
+ -rm -f http/server4/$(DEPDIR)/main.Po
+ -rm -f http/server4/$(DEPDIR)/mime_types.Po
+ -rm -f http/server4/$(DEPDIR)/reply.Po
+ -rm -f http/server4/$(DEPDIR)/request_parser.Po
+ -rm -f http/server4/$(DEPDIR)/server.Po
+ -rm -f icmp/$(DEPDIR)/ping.Po
-rm -f invocation/$(DEPDIR)/prioritised_handlers.Po
+ -rm -f iostreams/$(DEPDIR)/daytime_client.Po
+ -rm -f iostreams/$(DEPDIR)/daytime_server.Po
-rm -f iostreams/$(DEPDIR)/http_client.Po
-rm -f local/$(DEPDIR)/connect_pair.Po
+ -rm -f local/$(DEPDIR)/fd_passing_stream_client.Po
+ -rm -f local/$(DEPDIR)/fd_passing_stream_server.Po
-rm -f local/$(DEPDIR)/iostream_client.Po
-rm -f local/$(DEPDIR)/stream_client.Po
-rm -f local/$(DEPDIR)/stream_server.Po
@@ -1646,6 +2737,15 @@ distclean: distclean-am
-rm -f operations/$(DEPDIR)/composed_6.Po
-rm -f operations/$(DEPDIR)/composed_7.Po
-rm -f operations/$(DEPDIR)/composed_8.Po
+ -rm -f parallel_group/$(DEPDIR)/ranged_wait_for_all.Po
+ -rm -f parallel_group/$(DEPDIR)/wait_for_all.Po
+ -rm -f parallel_group/$(DEPDIR)/wait_for_one.Po
+ -rm -f parallel_group/$(DEPDIR)/wait_for_one_error.Po
+ -rm -f parallel_group/$(DEPDIR)/wait_for_one_success.Po
+ -rm -f porthopper/$(DEPDIR)/client.Po
+ -rm -f porthopper/$(DEPDIR)/server.Po
+ -rm -f services/$(DEPDIR)/daytime_client.Po
+ -rm -f services/$(DEPDIR)/logger_service.Po
-rm -f socks4/$(DEPDIR)/sync_client.Po
-rm -f spawn/$(DEPDIR)/echo_server.Po
-rm -f spawn/$(DEPDIR)/parallel_grep.Po
@@ -1657,6 +2757,22 @@ distclean: distclean-am
-rm -f timeouts/$(DEPDIR)/blocking_udp_client.Po
-rm -f timeouts/$(DEPDIR)/server.Po
-rm -f timers/$(DEPDIR)/time_t_timer.Po
+ -rm -f tutorial/daytime1/$(DEPDIR)/client.Po
+ -rm -f tutorial/daytime2/$(DEPDIR)/server.Po
+ -rm -f tutorial/daytime3/$(DEPDIR)/server.Po
+ -rm -f tutorial/daytime4/$(DEPDIR)/client.Po
+ -rm -f tutorial/daytime5/$(DEPDIR)/server.Po
+ -rm -f tutorial/daytime6/$(DEPDIR)/server.Po
+ -rm -f tutorial/daytime7/$(DEPDIR)/server.Po
+ -rm -f tutorial/timer1/$(DEPDIR)/timer.Po
+ -rm -f tutorial/timer2/$(DEPDIR)/timer.Po
+ -rm -f tutorial/timer3/$(DEPDIR)/timer.Po
+ -rm -f tutorial/timer4/$(DEPDIR)/timer.Po
+ -rm -f tutorial/timer5/$(DEPDIR)/timer.Po
+ -rm -f type_erasure/$(DEPDIR)/main.Po
+ -rm -f type_erasure/$(DEPDIR)/sleep.Po
+ -rm -f type_erasure/$(DEPDIR)/stdin_line_reader.Po
+ -rm -f windows/$(DEPDIR)/transmit_file.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -1708,6 +2824,9 @@ maintainer-clean: maintainer-clean-am
-rm -f buffers/$(DEPDIR)/reference_counted.Po
-rm -f chat/$(DEPDIR)/chat_client.Po
-rm -f chat/$(DEPDIR)/chat_server.Po
+ -rm -f chat/$(DEPDIR)/posix_chat_client.Po
+ -rm -f deferred/$(DEPDIR)/deferred_1.Po
+ -rm -f deferred/$(DEPDIR)/deferred_2.Po
-rm -f echo/$(DEPDIR)/async_tcp_echo_server.Po
-rm -f echo/$(DEPDIR)/async_udp_echo_server.Po
-rm -f echo/$(DEPDIR)/blocking_tcp_echo_client.Po
@@ -1720,10 +2839,14 @@ maintainer-clean: maintainer-clean-am
-rm -f executors/$(DEPDIR)/fork_join.Po
-rm -f executors/$(DEPDIR)/pipeline.Po
-rm -f executors/$(DEPDIR)/priority_scheduler.Po
+ -rm -f files/$(DEPDIR)/async_file_copy.Po
+ -rm -f files/$(DEPDIR)/blocking_file_copy.Po
-rm -f fork/$(DEPDIR)/daemon.Po
-rm -f fork/$(DEPDIR)/process_per_connection.Po
-rm -f futures/$(DEPDIR)/daytime_client.Po
-rm -f handler_tracking/$(DEPDIR)/async_tcp_echo_server.Po
+ -rm -f http/client/$(DEPDIR)/async_client.Po
+ -rm -f http/client/$(DEPDIR)/sync_client.Po
-rm -f http/server/$(DEPDIR)/connection.Po
-rm -f http/server/$(DEPDIR)/connection_manager.Po
-rm -f http/server/$(DEPDIR)/main.Po
@@ -1732,9 +2855,35 @@ maintainer-clean: maintainer-clean-am
-rm -f http/server/$(DEPDIR)/request_handler.Po
-rm -f http/server/$(DEPDIR)/request_parser.Po
-rm -f http/server/$(DEPDIR)/server.Po
+ -rm -f http/server2/$(DEPDIR)/connection.Po
+ -rm -f http/server2/$(DEPDIR)/io_context_pool.Po
+ -rm -f http/server2/$(DEPDIR)/main.Po
+ -rm -f http/server2/$(DEPDIR)/mime_types.Po
+ -rm -f http/server2/$(DEPDIR)/reply.Po
+ -rm -f http/server2/$(DEPDIR)/request_handler.Po
+ -rm -f http/server2/$(DEPDIR)/request_parser.Po
+ -rm -f http/server2/$(DEPDIR)/server.Po
+ -rm -f http/server3/$(DEPDIR)/connection.Po
+ -rm -f http/server3/$(DEPDIR)/main.Po
+ -rm -f http/server3/$(DEPDIR)/mime_types.Po
+ -rm -f http/server3/$(DEPDIR)/reply.Po
+ -rm -f http/server3/$(DEPDIR)/request_handler.Po
+ -rm -f http/server3/$(DEPDIR)/request_parser.Po
+ -rm -f http/server3/$(DEPDIR)/server.Po
+ -rm -f http/server4/$(DEPDIR)/file_handler.Po
+ -rm -f http/server4/$(DEPDIR)/main.Po
+ -rm -f http/server4/$(DEPDIR)/mime_types.Po
+ -rm -f http/server4/$(DEPDIR)/reply.Po
+ -rm -f http/server4/$(DEPDIR)/request_parser.Po
+ -rm -f http/server4/$(DEPDIR)/server.Po
+ -rm -f icmp/$(DEPDIR)/ping.Po
-rm -f invocation/$(DEPDIR)/prioritised_handlers.Po
+ -rm -f iostreams/$(DEPDIR)/daytime_client.Po
+ -rm -f iostreams/$(DEPDIR)/daytime_server.Po
-rm -f iostreams/$(DEPDIR)/http_client.Po
-rm -f local/$(DEPDIR)/connect_pair.Po
+ -rm -f local/$(DEPDIR)/fd_passing_stream_client.Po
+ -rm -f local/$(DEPDIR)/fd_passing_stream_server.Po
-rm -f local/$(DEPDIR)/iostream_client.Po
-rm -f local/$(DEPDIR)/stream_client.Po
-rm -f local/$(DEPDIR)/stream_server.Po
@@ -1749,6 +2898,15 @@ maintainer-clean: maintainer-clean-am
-rm -f operations/$(DEPDIR)/composed_6.Po
-rm -f operations/$(DEPDIR)/composed_7.Po
-rm -f operations/$(DEPDIR)/composed_8.Po
+ -rm -f parallel_group/$(DEPDIR)/ranged_wait_for_all.Po
+ -rm -f parallel_group/$(DEPDIR)/wait_for_all.Po
+ -rm -f parallel_group/$(DEPDIR)/wait_for_one.Po
+ -rm -f parallel_group/$(DEPDIR)/wait_for_one_error.Po
+ -rm -f parallel_group/$(DEPDIR)/wait_for_one_success.Po
+ -rm -f porthopper/$(DEPDIR)/client.Po
+ -rm -f porthopper/$(DEPDIR)/server.Po
+ -rm -f services/$(DEPDIR)/daytime_client.Po
+ -rm -f services/$(DEPDIR)/logger_service.Po
-rm -f socks4/$(DEPDIR)/sync_client.Po
-rm -f spawn/$(DEPDIR)/echo_server.Po
-rm -f spawn/$(DEPDIR)/parallel_grep.Po
@@ -1760,6 +2918,22 @@ maintainer-clean: maintainer-clean-am
-rm -f timeouts/$(DEPDIR)/blocking_udp_client.Po
-rm -f timeouts/$(DEPDIR)/server.Po
-rm -f timers/$(DEPDIR)/time_t_timer.Po
+ -rm -f tutorial/daytime1/$(DEPDIR)/client.Po
+ -rm -f tutorial/daytime2/$(DEPDIR)/server.Po
+ -rm -f tutorial/daytime3/$(DEPDIR)/server.Po
+ -rm -f tutorial/daytime4/$(DEPDIR)/client.Po
+ -rm -f tutorial/daytime5/$(DEPDIR)/server.Po
+ -rm -f tutorial/daytime6/$(DEPDIR)/server.Po
+ -rm -f tutorial/daytime7/$(DEPDIR)/server.Po
+ -rm -f tutorial/timer1/$(DEPDIR)/timer.Po
+ -rm -f tutorial/timer2/$(DEPDIR)/timer.Po
+ -rm -f tutorial/timer3/$(DEPDIR)/timer.Po
+ -rm -f tutorial/timer4/$(DEPDIR)/timer.Po
+ -rm -f tutorial/timer5/$(DEPDIR)/timer.Po
+ -rm -f type_erasure/$(DEPDIR)/main.Po
+ -rm -f type_erasure/$(DEPDIR)/sleep.Po
+ -rm -f type_erasure/$(DEPDIR)/stdin_line_reader.Po
+ -rm -f windows/$(DEPDIR)/transmit_file.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/3rdparty/asio/src/examples/cpp11/allocation/server.cpp b/3rdparty/asio/src/examples/cpp11/allocation/server.cpp
index 4d0d80e6875..48bc119c1c5 100644
--- a/3rdparty/asio/src/examples/cpp11/allocation/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/allocation/server.cpp
@@ -2,7 +2,7 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -112,46 +112,6 @@ private:
handler_memory& memory_;
};
-// Wrapper class template for handler objects to allow handler memory
-// allocation to be customised. The allocator_type type and get_allocator()
-// member function are used by the asynchronous operations to obtain the
-// allocator. Calls to operator() are forwarded to the encapsulated handler.
-template <typename Handler>
-class custom_alloc_handler
-{
-public:
- using allocator_type = handler_allocator<Handler>;
-
- custom_alloc_handler(handler_memory& m, Handler h)
- : memory_(m),
- handler_(h)
- {
- }
-
- allocator_type get_allocator() const noexcept
- {
- return allocator_type(memory_);
- }
-
- template <typename ...Args>
- void operator()(Args&&... args)
- {
- handler_(std::forward<Args>(args)...);
- }
-
-private:
- handler_memory& memory_;
- Handler handler_;
-};
-
-// Helper function to wrap a handler object to add custom allocation.
-template <typename Handler>
-inline custom_alloc_handler<Handler> make_custom_alloc_handler(
- handler_memory& m, Handler h)
-{
- return custom_alloc_handler<Handler>(m, h);
-}
-
class session
: public std::enable_shared_from_this<session>
{
@@ -171,7 +131,8 @@ private:
{
auto self(shared_from_this());
socket_.async_read_some(asio::buffer(data_),
- make_custom_alloc_handler(handler_memory_,
+ asio::bind_allocator(
+ handler_allocator<int>(handler_memory_),
[this, self](std::error_code ec, std::size_t length)
{
if (!ec)
@@ -185,7 +146,8 @@ private:
{
auto self(shared_from_this());
asio::async_write(socket_, asio::buffer(data_, length),
- make_custom_alloc_handler(handler_memory_,
+ asio::bind_allocator(
+ handler_allocator<int>(handler_memory_),
[this, self](std::error_code ec, std::size_t /*length*/)
{
if (!ec)
diff --git a/3rdparty/asio/src/examples/cpp11/buffers/reference_counted.cpp b/3rdparty/asio/src/examples/cpp11/buffers/reference_counted.cpp
index d0f565faf66..cee56ff786b 100644
--- a/3rdparty/asio/src/examples/cpp11/buffers/reference_counted.cpp
+++ b/3rdparty/asio/src/examples/cpp11/buffers/reference_counted.cpp
@@ -2,7 +2,7 @@
// reference_counted.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/chat/chat_client.cpp b/3rdparty/asio/src/examples/cpp11/chat/chat_client.cpp
index 6280851a82e..c0393ee8266 100644
--- a/3rdparty/asio/src/examples/cpp11/chat/chat_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/chat/chat_client.cpp
@@ -2,7 +2,7 @@
// chat_client.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/chat/chat_message.hpp b/3rdparty/asio/src/examples/cpp11/chat/chat_message.hpp
index cdc09ea33f8..2ae82fa1257 100644
--- a/3rdparty/asio/src/examples/cpp11/chat/chat_message.hpp
+++ b/3rdparty/asio/src/examples/cpp11/chat/chat_message.hpp
@@ -2,7 +2,7 @@
// chat_message.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,8 +18,8 @@
class chat_message
{
public:
- enum { header_length = 4 };
- enum { max_body_length = 512 };
+ static constexpr std::size_t header_length = 4;
+ static constexpr std::size_t max_body_length = 512;
chat_message()
: body_length_(0)
diff --git a/3rdparty/asio/src/examples/cpp11/chat/chat_server.cpp b/3rdparty/asio/src/examples/cpp11/chat/chat_server.cpp
index edc7b44cd6a..7a5dfe33d4f 100644
--- a/3rdparty/asio/src/examples/cpp11/chat/chat_server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/chat/chat_server.cpp
@@ -2,7 +2,7 @@
// chat_server.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/chat/posix_chat_client.cpp b/3rdparty/asio/src/examples/cpp11/chat/posix_chat_client.cpp
new file mode 100644
index 00000000000..a77b8cfb001
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/chat/posix_chat_client.cpp
@@ -0,0 +1,198 @@
+//
+// posix_chat_client.cpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <array>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include "asio.hpp"
+#include "chat_message.hpp"
+
+#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+
+using asio::ip::tcp;
+namespace posix = asio::posix;
+
+class posix_chat_client
+{
+public:
+ posix_chat_client(asio::io_context& io_context,
+ const tcp::resolver::results_type& endpoints)
+ : socket_(io_context),
+ input_(io_context, ::dup(STDIN_FILENO)),
+ output_(io_context, ::dup(STDOUT_FILENO)),
+ input_buffer_(chat_message::max_body_length)
+ {
+ do_connect(endpoints);
+ }
+
+private:
+ void do_connect(const tcp::resolver::results_type& endpoints)
+ {
+ asio::async_connect(socket_, endpoints,
+ [this](std::error_code ec, tcp::endpoint)
+ {
+ if (!ec)
+ {
+ do_read_header();
+ do_read_input();
+ }
+ });
+ }
+
+ void do_read_header()
+ {
+ asio::async_read(socket_,
+ asio::buffer(read_msg_.data(), chat_message::header_length),
+ [this](std::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec && read_msg_.decode_header())
+ {
+ do_read_body();
+ }
+ else
+ {
+ close();
+ }
+ });
+ }
+
+ void do_read_body()
+ {
+ asio::async_read(socket_,
+ asio::buffer(read_msg_.body(), read_msg_.body_length()),
+ [this](std::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
+ do_write_output();
+ }
+ else
+ {
+ close();
+ }
+ });
+ }
+
+ void do_write_output()
+ {
+ // Write out the message we just received, terminated by a newline.
+ static char eol[] = { '\n' };
+ std::array<asio::const_buffer, 2> buffers = {{
+ asio::buffer(read_msg_.body(), read_msg_.body_length()),
+ asio::buffer(eol) }};
+ asio::async_write(output_, buffers,
+ [this](std::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
+ do_read_header();
+ }
+ else
+ {
+ close();
+ }
+ });
+ }
+
+ void do_read_input()
+ {
+ // Read a line of input entered by the user.
+ asio::async_read_until(input_, input_buffer_, '\n',
+ [this](std::error_code ec, std::size_t length)
+ {
+ if (!ec)
+ {
+ // Write the message (minus the newline) to the server.
+ write_msg_.body_length(length - 1);
+ input_buffer_.sgetn(write_msg_.body(), length - 1);
+ input_buffer_.consume(1); // Remove newline from input.
+ write_msg_.encode_header();
+ do_write_message();
+ }
+ else if (ec == asio::error::not_found)
+ {
+ // Didn't get a newline. Send whatever we have.
+ write_msg_.body_length(input_buffer_.size());
+ input_buffer_.sgetn(write_msg_.body(), input_buffer_.size());
+ write_msg_.encode_header();
+ do_write_message();
+ }
+ else
+ {
+ close();
+ }
+ });
+ }
+
+ void do_write_message()
+ {
+ asio::async_write(socket_,
+ asio::buffer(write_msg_.data(), write_msg_.length()),
+ [this](std::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
+ do_read_input();
+ }
+ else
+ {
+ close();
+ }
+ });
+ }
+
+ void close()
+ {
+ // Cancel all outstanding asynchronous operations.
+ socket_.close();
+ input_.close();
+ output_.close();
+ }
+
+private:
+ tcp::socket socket_;
+ posix::stream_descriptor input_;
+ posix::stream_descriptor output_;
+ chat_message read_msg_;
+ chat_message write_msg_;
+ asio::streambuf input_buffer_;
+};
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 3)
+ {
+ std::cerr << "Usage: posix_chat_client <host> <port>\n";
+ return 1;
+ }
+
+ asio::io_context io_context;
+
+ tcp::resolver resolver(io_context);
+ tcp::resolver::results_type endpoints = resolver.resolve(argv[1], argv[2]);
+
+ posix_chat_client c(io_context, endpoints);
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp11/deferred/deferred_1.cpp b/3rdparty/asio/src/examples/cpp11/deferred/deferred_1.cpp
new file mode 100644
index 00000000000..db9213eb3be
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/deferred/deferred_1.cpp
@@ -0,0 +1,35 @@
+//
+// deferred_1.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <iostream>
+
+using asio::deferred;
+
+int main()
+{
+ asio::io_context ctx;
+
+ asio::steady_timer timer(ctx);
+ timer.expires_after(std::chrono::seconds(1));
+
+ auto deferred_op = timer.async_wait(deferred);
+
+ std::move(deferred_op)(
+ [](std::error_code ec)
+ {
+ std::cout << "timer wait finished: " << ec.message() << "\n";
+ }
+ );
+
+ ctx.run();
+
+ return 0;
+}
diff --git a/3rdparty/asio/src/examples/cpp11/deferred/deferred_2.cpp b/3rdparty/asio/src/examples/cpp11/deferred/deferred_2.cpp
new file mode 100644
index 00000000000..07528282de5
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/deferred/deferred_2.cpp
@@ -0,0 +1,44 @@
+//
+// deferred_2.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <iostream>
+
+using asio::deferred;
+
+int main()
+{
+ asio::io_context ctx;
+
+ asio::steady_timer timer(ctx);
+ timer.expires_after(std::chrono::seconds(1));
+
+ auto deferred_op = timer.async_wait(
+ deferred(
+ [&](std::error_code ec)
+ {
+ std::cout << "first timer wait finished: " << ec.message() << "\n";
+ timer.expires_after(std::chrono::seconds(1));
+ return timer.async_wait(deferred);
+ }
+ )
+ );
+
+ std::move(deferred_op)(
+ [](std::error_code ec)
+ {
+ std::cout << "second timer wait finished: " << ec.message() << "\n";
+ }
+ );
+
+ ctx.run();
+
+ return 0;
+}
diff --git a/3rdparty/asio/src/examples/cpp11/echo/async_tcp_echo_server.cpp b/3rdparty/asio/src/examples/cpp11/echo/async_tcp_echo_server.cpp
index 0f776cca718..b8ba5337697 100644
--- a/3rdparty/asio/src/examples/cpp11/echo/async_tcp_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/echo/async_tcp_echo_server.cpp
@@ -2,7 +2,7 @@
// async_tcp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/echo/async_udp_echo_server.cpp b/3rdparty/asio/src/examples/cpp11/echo/async_udp_echo_server.cpp
index d09c939f72d..8e5c26fba2a 100644
--- a/3rdparty/asio/src/examples/cpp11/echo/async_udp_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/echo/async_udp_echo_server.cpp
@@ -2,7 +2,7 @@
// async_udp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_client.cpp b/3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_client.cpp
index 96a843e41ad..8a281203f89 100644
--- a/3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_client.cpp
@@ -2,7 +2,7 @@
// blocking_tcp_echo_client.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp b/3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp
index d772b5a6bf1..34e5f221695 100644
--- a/3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp
@@ -2,7 +2,7 @@
// blocking_tcp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -26,12 +26,12 @@ void session(tcp::socket sock)
{
char data[max_length];
- asio::error_code error;
+ std::error_code error;
size_t length = sock.read_some(asio::buffer(data), error);
if (error == asio::error::eof)
break; // Connection closed cleanly by peer.
else if (error)
- throw asio::system_error(error); // Some other error.
+ throw std::system_error(error); // Some other error.
asio::write(sock, asio::buffer(data, length));
}
diff --git a/3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_client.cpp b/3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_client.cpp
index 11a6c9258bd..3f2b60e3ccc 100644
--- a/3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_client.cpp
@@ -2,7 +2,7 @@
// blocking_udp_echo_client.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_server.cpp b/3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_server.cpp
index 7cf8920ec97..64c6defb885 100644
--- a/3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/echo/blocking_udp_echo_server.cpp
@@ -2,7 +2,7 @@
// blocking_udp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/executors/bank_account_1.cpp b/3rdparty/asio/src/examples/cpp11/executors/bank_account_1.cpp
index abfd16a7ee0..a63d7fc059b 100644
--- a/3rdparty/asio/src/examples/cpp11/executors/bank_account_1.cpp
+++ b/3rdparty/asio/src/examples/cpp11/executors/bank_account_1.cpp
@@ -16,8 +16,7 @@ class bank_account
public:
void deposit(int amount)
{
- execution::execute(
- pool_.executor(),
+ pool_.executor().execute(
[this, amount]
{
balance_ += amount;
@@ -26,8 +25,7 @@ public:
void withdraw(int amount)
{
- execution::execute(
- pool_.executor(),
+ pool_.executor().execute(
[this, amount]
{
if (balance_ >= amount)
@@ -37,8 +35,7 @@ public:
void print_balance() const
{
- execution::execute(
- pool_.executor(),
+ pool_.executor().execute(
[this]
{
std::cout << "balance = " << balance_ << "\n";
diff --git a/3rdparty/asio/src/examples/cpp11/executors/bank_account_2.cpp b/3rdparty/asio/src/examples/cpp11/executors/bank_account_2.cpp
index 305d0ca5b86..45a24abc352 100644
--- a/3rdparty/asio/src/examples/cpp11/executors/bank_account_2.cpp
+++ b/3rdparty/asio/src/examples/cpp11/executors/bank_account_2.cpp
@@ -16,9 +16,7 @@ class bank_account
public:
void deposit(int amount)
{
- execution::execute(
- asio::require(pool_.executor(),
- execution::blocking.always),
+ asio::require(pool_.executor(), execution::blocking.always).execute(
[this, amount]
{
balance_ += amount;
@@ -27,9 +25,7 @@ public:
void withdraw(int amount)
{
- execution::execute(
- asio::require(pool_.executor(),
- execution::blocking.always),
+ asio::require(pool_.executor(), execution::blocking.always).execute(
[this, amount]
{
if (balance_ >= amount)
@@ -40,9 +36,7 @@ public:
int balance() const
{
int result = 0;
- execution::execute(
- asio::require(pool_.executor(),
- execution::blocking.always),
+ asio::require(pool_.executor(), execution::blocking.always).execute(
[this, &result]
{
result = balance_;
diff --git a/3rdparty/asio/src/examples/cpp11/executors/fork_join.cpp b/3rdparty/asio/src/examples/cpp11/executors/fork_join.cpp
index a76437efad9..7e8a827356d 100644
--- a/3rdparty/asio/src/examples/cpp11/executors/fork_join.cpp
+++ b/3rdparty/asio/src/examples/cpp11/executors/fork_join.cpp
@@ -32,8 +32,7 @@ public:
// it is time to shut down, i.e. the use count is zero.
for (thread_count_ = 0; thread_count_ < thread_count; ++thread_count_)
{
- execution::execute(
- threads_.executor(),
+ threads_.executor().execute(
[this]
{
std::unique_lock<std::mutex> lock(mutex_);
@@ -252,8 +251,8 @@ void fork_join_sort(Iterator begin, Iterator end)
{
fork_executor fork(pool);
join_guard join(fork);
- execution::execute(fork, [=]{ fork_join_sort(begin, begin + n / 2); });
- execution::execute(fork, [=]{ fork_join_sort(begin + n / 2, end); });
+ fork.execute([=]{ fork_join_sort(begin, begin + n / 2); });
+ fork.execute([=]{ fork_join_sort(begin + n / 2, end); });
}
std::inplace_merge(begin, begin + n / 2, end);
}
diff --git a/3rdparty/asio/src/examples/cpp11/files/async_file_copy.cpp b/3rdparty/asio/src/examples/cpp11/files/async_file_copy.cpp
new file mode 100644
index 00000000000..edfb2765ed5
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/files/async_file_copy.cpp
@@ -0,0 +1,101 @@
+//
+// async_file_copy.cpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <iostream>
+#include "asio.hpp"
+
+#if defined(ASIO_HAS_FILE)
+
+class file_copier
+{
+public:
+ file_copier(asio::io_context& io_context,
+ const char* from, const char* to)
+ : from_file_(io_context, from,
+ asio::stream_file::read_only),
+ to_file_(io_context, to,
+ asio::stream_file::write_only
+ | asio::stream_file::create
+ | asio::stream_file::truncate)
+ {
+ }
+
+ void start()
+ {
+ do_read();
+ }
+
+private:
+ void do_read()
+ {
+ from_file_.async_read_some(asio::buffer(data_),
+ [this](std::error_code error, std::size_t n)
+ {
+ if (!error)
+ {
+ do_write(n);
+ }
+ else if (error != asio::error::eof)
+ {
+ std::cerr << "Error copying file: " << error.message() << "\n";
+ }
+ });
+ }
+
+ void do_write(std::size_t n)
+ {
+ asio::async_write(to_file_, asio::buffer(data_, n),
+ [this](std::error_code error, std::size_t /*n*/)
+ {
+ if (!error)
+ {
+ do_read();
+ }
+ else
+ {
+ std::cerr << "Error copying file: " << error.message() << "\n";
+ }
+ });
+ }
+
+ asio::stream_file from_file_;
+ asio::stream_file to_file_;
+ char data_[4096];
+};
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 3)
+ {
+ std::cerr << "Usage: async_file_copy <from> <to>\n";
+ return 1;
+ }
+
+ asio::io_context io_context;
+
+ file_copier copier(io_context, argv[1], argv[2]);
+ copier.start();
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ return 1;
+ }
+
+ return 0;
+}
+
+#else // defined(ASIO_HAS_FILE)
+int main() {}
+#endif // defined(ASIO_HAS_FILE)
diff --git a/3rdparty/asio/src/examples/cpp11/files/blocking_file_copy.cpp b/3rdparty/asio/src/examples/cpp11/files/blocking_file_copy.cpp
new file mode 100644
index 00000000000..6e111b4909d
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/files/blocking_file_copy.cpp
@@ -0,0 +1,65 @@
+//
+// blocking_file_copy.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <iostream>
+#include "asio.hpp"
+
+#if defined(ASIO_HAS_FILE)
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 3)
+ {
+ std::cerr << "Usage: blocking_file_copy <from> <to>\n";
+ return 1;
+ }
+
+ asio::io_context io_context;
+
+ asio::stream_file from_file(io_context, argv[1],
+ asio::stream_file::read_only);
+
+ asio::stream_file to_file(io_context, argv[2],
+ asio::stream_file::write_only
+ | asio::stream_file::create
+ | asio::stream_file::truncate);
+
+ char data[4096];
+ std::error_code error;
+ for (;;)
+ {
+ std::size_t n = from_file.read_some(asio::buffer(data), error);
+ if (error)
+ break;
+ asio::write(to_file, asio::buffer(data, n), error);
+ if (error)
+ break;
+ }
+
+ if (error && error != asio::error::eof)
+ {
+ std::cerr << "Error copying file: " << error.message() << "\n";
+ return 1;
+ }
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ return 1;
+ }
+
+ return 0;
+}
+
+#else // defined(ASIO_HAS_FILE)
+int main() {}
+#endif // defined(ASIO_HAS_FILE)
diff --git a/3rdparty/asio/src/examples/cpp11/fork/daemon.cpp b/3rdparty/asio/src/examples/cpp11/fork/daemon.cpp
index c63d5c1392f..547acb33a5a 100644
--- a/3rdparty/asio/src/examples/cpp11/fork/daemon.cpp
+++ b/3rdparty/asio/src/examples/cpp11/fork/daemon.cpp
@@ -2,7 +2,7 @@
// daemon.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/fork/process_per_connection.cpp b/3rdparty/asio/src/examples/cpp11/fork/process_per_connection.cpp
index 217d5d945ae..cad52e7ab9f 100644
--- a/3rdparty/asio/src/examples/cpp11/fork/process_per_connection.cpp
+++ b/3rdparty/asio/src/examples/cpp11/fork/process_per_connection.cpp
@@ -2,7 +2,7 @@
// process_per_connection.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/futures/daytime_client.cpp b/3rdparty/asio/src/examples/cpp11/futures/daytime_client.cpp
index 7744d630cb9..2f5314ede39 100644
--- a/3rdparty/asio/src/examples/cpp11/futures/daytime_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/futures/daytime_client.cpp
@@ -2,7 +2,7 @@
// daytime_client.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -77,8 +77,7 @@ int main(int argc, char* argv[])
// We run the io_context off in its own thread so that it operates
// completely asynchronously with respect to the rest of the program.
asio::io_context io_context;
- auto work = asio::require(io_context.get_executor(),
- asio::execution::outstanding_work.tracked);
+ auto work = asio::make_work_guard(io_context);
std::thread thread([&io_context](){ io_context.run(); });
get_daytime(io_context, argv[1]);
diff --git a/3rdparty/asio/src/examples/cpp11/handler_tracking/async_tcp_echo_server.cpp b/3rdparty/asio/src/examples/cpp11/handler_tracking/async_tcp_echo_server.cpp
index b18e4b2f19e..42a31f7b316 100644
--- a/3rdparty/asio/src/examples/cpp11/handler_tracking/async_tcp_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/handler_tracking/async_tcp_echo_server.cpp
@@ -2,7 +2,7 @@
// async_tcp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp b/3rdparty/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp
index 464663b60d2..57b162a51e8 100644
--- a/3rdparty/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp
+++ b/3rdparty/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp
@@ -2,7 +2,7 @@
// custom_tracking.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -187,7 +187,7 @@ struct custom_tracking
// Record a reactor-based operation that is associated with a handler.
static void reactor_operation(const tracked_handler& h,
- const char* op_name, const asio::error_code& ec)
+ const char* op_name, const std::error_code& ec)
{
std::printf(
"Performed operation %s.%s for native_handle = %" PRIuMAX
@@ -197,7 +197,7 @@ struct custom_tracking
// Record a reactor-based operation that is associated with a handler.
static void reactor_operation(const tracked_handler& h,
- const char* op_name, const asio::error_code& ec,
+ const char* op_name, const std::error_code& ec,
std::size_t bytes_transferred)
{
std::printf(
diff --git a/3rdparty/asio/src/examples/cpp03/http/client/async_client.cpp b/3rdparty/asio/src/examples/cpp11/http/client/async_client.cpp
index 210715bbd98..309ae252147 100644
--- a/3rdparty/asio/src/examples/cpp03/http/client/async_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/client/async_client.cpp
@@ -2,18 +2,18 @@
// async_client.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <functional>
#include <iostream>
#include <istream>
#include <ostream>
#include <string>
#include <asio.hpp>
-#include <boost/bind/bind.hpp>
using asio::ip::tcp;
@@ -37,13 +37,13 @@ public:
// Start an asynchronous resolve to translate the server and service names
// into a list of endpoints.
resolver_.async_resolve(server, "http",
- boost::bind(&client::handle_resolve, this,
+ std::bind(&client::handle_resolve, this,
asio::placeholders::error,
asio::placeholders::results));
}
private:
- void handle_resolve(const asio::error_code& err,
+ void handle_resolve(const std::error_code& err,
const tcp::resolver::results_type& endpoints)
{
if (!err)
@@ -51,7 +51,7 @@ private:
// Attempt a connection to each endpoint in the list until we
// successfully establish a connection.
asio::async_connect(socket_, endpoints,
- boost::bind(&client::handle_connect, this,
+ std::bind(&client::handle_connect, this,
asio::placeholders::error));
}
else
@@ -60,13 +60,13 @@ private:
}
}
- void handle_connect(const asio::error_code& err)
+ void handle_connect(const std::error_code& err)
{
if (!err)
{
// The connection was successful. Send the request.
asio::async_write(socket_, request_,
- boost::bind(&client::handle_write_request, this,
+ std::bind(&client::handle_write_request, this,
asio::placeholders::error));
}
else
@@ -75,7 +75,7 @@ private:
}
}
- void handle_write_request(const asio::error_code& err)
+ void handle_write_request(const std::error_code& err)
{
if (!err)
{
@@ -83,7 +83,7 @@ private:
// automatically grow to accommodate the entire line. The growth may be
// limited by passing a maximum size to the streambuf constructor.
asio::async_read_until(socket_, response_, "\r\n",
- boost::bind(&client::handle_read_status_line, this,
+ std::bind(&client::handle_read_status_line, this,
asio::placeholders::error));
}
else
@@ -92,7 +92,7 @@ private:
}
}
- void handle_read_status_line(const asio::error_code& err)
+ void handle_read_status_line(const std::error_code& err)
{
if (!err)
{
@@ -118,7 +118,7 @@ private:
// Read the response headers, which are terminated by a blank line.
asio::async_read_until(socket_, response_, "\r\n\r\n",
- boost::bind(&client::handle_read_headers, this,
+ std::bind(&client::handle_read_headers, this,
asio::placeholders::error));
}
else
@@ -127,7 +127,7 @@ private:
}
}
- void handle_read_headers(const asio::error_code& err)
+ void handle_read_headers(const std::error_code& err)
{
if (!err)
{
@@ -145,7 +145,7 @@ private:
// Start reading remaining data until EOF.
asio::async_read(socket_, response_,
asio::transfer_at_least(1),
- boost::bind(&client::handle_read_content, this,
+ std::bind(&client::handle_read_content, this,
asio::placeholders::error));
}
else
@@ -154,7 +154,7 @@ private:
}
}
- void handle_read_content(const asio::error_code& err)
+ void handle_read_content(const std::error_code& err)
{
if (!err)
{
@@ -164,7 +164,7 @@ private:
// Continue reading remaining data until EOF.
asio::async_read(socket_, response_,
asio::transfer_at_least(1),
- boost::bind(&client::handle_read_content, this,
+ std::bind(&client::handle_read_content, this,
asio::placeholders::error));
}
else if (err != asio::error::eof)
diff --git a/3rdparty/asio/src/examples/cpp03/http/client/sync_client.cpp b/3rdparty/asio/src/examples/cpp11/http/client/sync_client.cpp
index fde984a6f4f..4f5ad099317 100644
--- a/3rdparty/asio/src/examples/cpp03/http/client/sync_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/client/sync_client.cpp
@@ -2,7 +2,7 @@
// sync_client.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -90,12 +90,12 @@ int main(int argc, char* argv[])
std::cout << &response;
// Read until EOF, writing data to output as we go.
- asio::error_code error;
+ std::error_code error;
while (asio::read(socket, response,
asio::transfer_at_least(1), error))
std::cout << &response;
if (error != asio::error::eof)
- throw asio::system_error(error);
+ throw std::system_error(error);
}
catch (std::exception& e)
{
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/connection.cpp b/3rdparty/asio/src/examples/cpp11/http/server/connection.cpp
index 704ae6d1147..58d619fec76 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/connection.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/connection.cpp
@@ -2,7 +2,7 @@
// connection.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -10,7 +10,6 @@
#include "connection.hpp"
#include <utility>
-#include <vector>
#include "connection_manager.hpp"
#include "request_handler.hpp"
@@ -78,7 +77,7 @@ void connection::do_write()
if (!ec)
{
// Initiate graceful connection closure.
- asio::error_code ignored_ec;
+ std::error_code ignored_ec;
socket_.shutdown(asio::ip::tcp::socket::shutdown_both,
ignored_ec);
}
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/connection.hpp b/3rdparty/asio/src/examples/cpp11/http/server/connection.hpp
index b7bf762820a..1d671ebdcbe 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/connection.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/connection.hpp
@@ -2,7 +2,7 @@
// connection.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -11,9 +11,9 @@
#ifndef HTTP_CONNECTION_HPP
#define HTTP_CONNECTION_HPP
+#include <asio.hpp>
#include <array>
#include <memory>
-#include <asio.hpp>
#include "reply.hpp"
#include "request.hpp"
#include "request_handler.hpp"
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/connection_manager.cpp b/3rdparty/asio/src/examples/cpp11/http/server/connection_manager.cpp
index 43221162f20..88161919330 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/connection_manager.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/connection_manager.cpp
@@ -2,7 +2,7 @@
// connection_manager.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/connection_manager.hpp b/3rdparty/asio/src/examples/cpp11/http/server/connection_manager.hpp
index af57cc9ce54..0b35408fae5 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/connection_manager.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/connection_manager.hpp
@@ -2,7 +2,7 @@
// connection_manager.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/header.hpp b/3rdparty/asio/src/examples/cpp11/http/server/header.hpp
index bccbf977a9e..e91e6ff23a2 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/header.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/header.hpp
@@ -2,7 +2,7 @@
// header.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/main.cpp b/3rdparty/asio/src/examples/cpp11/http/server/main.cpp
index e23a5607791..b76044a96cd 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/main.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/main.cpp
@@ -2,7 +2,7 @@
// main.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/mime_types.cpp b/3rdparty/asio/src/examples/cpp11/http/server/mime_types.cpp
index a59955e8d5b..23153caa1df 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/mime_types.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/mime_types.cpp
@@ -2,7 +2,7 @@
// mime_types.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/mime_types.hpp b/3rdparty/asio/src/examples/cpp11/http/server/mime_types.hpp
index aef5676104e..fcefce5437b 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/mime_types.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/mime_types.hpp
@@ -2,7 +2,7 @@
// mime_types.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/reply.cpp b/3rdparty/asio/src/examples/cpp11/http/server/reply.cpp
index 301ff3a1ab9..9d8f04e2ae1 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/reply.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/reply.cpp
@@ -2,7 +2,7 @@
// reply.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/reply.hpp b/3rdparty/asio/src/examples/cpp11/http/server/reply.hpp
index c8f3f11040d..f1eee1f891b 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/reply.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/reply.hpp
@@ -2,7 +2,7 @@
// reply.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/request.hpp b/3rdparty/asio/src/examples/cpp11/http/server/request.hpp
index 8a6a2bdf824..93a96db12b4 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/request.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/request.hpp
@@ -2,7 +2,7 @@
// request.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/request_handler.cpp b/3rdparty/asio/src/examples/cpp11/http/server/request_handler.cpp
index 621a1ab22ec..97b4ac6a8e6 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/request_handler.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/request_handler.cpp
@@ -2,7 +2,7 @@
// request_handler.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/request_handler.hpp b/3rdparty/asio/src/examples/cpp11/http/server/request_handler.hpp
index dc3432d34a0..978b37ca537 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/request_handler.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/request_handler.hpp
@@ -2,7 +2,7 @@
// request_handler.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/request_parser.cpp b/3rdparty/asio/src/examples/cpp11/http/server/request_parser.cpp
index 3ab194a3ace..ff56e9c618a 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/request_parser.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/request_parser.cpp
@@ -2,7 +2,7 @@
// request_parser.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/request_parser.hpp b/3rdparty/asio/src/examples/cpp11/http/server/request_parser.hpp
index 68ac14e590f..260e8759acb 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/request_parser.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/request_parser.hpp
@@ -2,7 +2,7 @@
// request_parser.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/server.cpp b/3rdparty/asio/src/examples/cpp11/http/server/server.cpp
index d2c179ee08a..d824ebbf229 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/server.cpp
@@ -2,7 +2,7 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server/server.hpp b/3rdparty/asio/src/examples/cpp11/http/server/server.hpp
index 917fbdd3d06..c88d0149114 100644
--- a/3rdparty/asio/src/examples/cpp11/http/server/server.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server/server.hpp
@@ -2,7 +2,7 @@
// server.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/http/server2/connection.cpp b/3rdparty/asio/src/examples/cpp11/http/server2/connection.cpp
new file mode 100644
index 00000000000..ab8ab9e0524
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/connection.cpp
@@ -0,0 +1,89 @@
+//
+// connection.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 "connection.hpp"
+#include <utility>
+#include "request_handler.hpp"
+
+namespace http {
+namespace server2 {
+
+connection::connection(asio::ip::tcp::socket socket,
+ request_handler& handler)
+ : socket_(std::move(socket)),
+ request_handler_(handler)
+{
+}
+
+void connection::start()
+{
+ do_read();
+}
+
+void connection::do_read()
+{
+ auto self(shared_from_this());
+ socket_.async_read_some(asio::buffer(buffer_),
+ [this, self](std::error_code ec, std::size_t bytes_transferred)
+ {
+ if (!ec)
+ {
+ request_parser::result_type result;
+ std::tie(result, std::ignore) = request_parser_.parse(
+ request_, buffer_.data(), buffer_.data() + bytes_transferred);
+
+ if (result == request_parser::good)
+ {
+ request_handler_.handle_request(request_, reply_);
+ do_write();
+ }
+ else if (result == request_parser::bad)
+ {
+ reply_ = reply::stock_reply(reply::bad_request);
+ do_write();
+ }
+ else
+ {
+ do_read();
+ }
+ }
+
+ // If an error occurs then no new asynchronous operations are
+ // started. This means that all shared_ptr references to the
+ // connection object will disappear and the object will be
+ // destroyed automatically after this handler returns. The
+ // connection class's destructor closes the socket.
+ });
+}
+
+void connection::do_write()
+{
+ auto self(shared_from_this());
+ asio::async_write(socket_, reply_.to_buffers(),
+ [this, self](std::error_code ec, std::size_t)
+ {
+ if (!ec)
+ {
+ // Initiate graceful connection closure.
+ std::error_code ignored_ec;
+ socket_.shutdown(asio::ip::tcp::socket::shutdown_both,
+ ignored_ec);
+ }
+
+ // No new asynchronous operations are started. This means that
+ // all shared_ptr references to the connection object will
+ // disappear and the object will be destroyed automatically after
+ // this handler returns. The connection class's destructor closes
+ // the socket.
+ });
+}
+
+} // namespace server2
+} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/connection.hpp b/3rdparty/asio/src/examples/cpp11/http/server2/connection.hpp
index 3379fbb5649..7d4a4735754 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/connection.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/connection.hpp
@@ -2,7 +2,7 @@
// connection.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,10 +12,8 @@
#define HTTP_SERVER2_CONNECTION_HPP
#include <asio.hpp>
-#include <boost/array.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
+#include <array>
+#include <memory>
#include "reply.hpp"
#include "request.hpp"
#include "request_handler.hpp"
@@ -26,27 +24,25 @@ namespace server2 {
/// Represents a single connection from a client.
class connection
- : public boost::enable_shared_from_this<connection>,
- private boost::noncopyable
+ : public std::enable_shared_from_this<connection>
{
public:
- /// Construct a connection with the given io_context.
- explicit connection(asio::io_context& io_context,
- request_handler& handler);
+ connection(const connection&) = delete;
+ connection& operator=(const connection&) = delete;
- /// Get the socket associated with the connection.
- asio::ip::tcp::socket& socket();
+ /// Construct a connection with the given socket.
+ explicit connection(asio::ip::tcp::socket socket,
+ request_handler& handler);
/// Start the first asynchronous operation for the connection.
void start();
private:
- /// Handle completion of a read operation.
- void handle_read(const asio::error_code& e,
- std::size_t bytes_transferred);
+ /// Perform an asynchronous read operation.
+ void do_read();
- /// Handle completion of a write operation.
- void handle_write(const asio::error_code& e);
+ /// Perform an asynchronous write operation.
+ void do_write();
/// Socket for the connection.
asio::ip::tcp::socket socket_;
@@ -55,7 +51,7 @@ private:
request_handler& request_handler_;
/// Buffer for incoming data.
- boost::array<char, 8192> buffer_;
+ std::array<char, 8192> buffer_;
/// The incoming request.
request request_;
@@ -67,7 +63,7 @@ private:
reply reply_;
};
-typedef boost::shared_ptr<connection> connection_ptr;
+typedef std::shared_ptr<connection> connection_ptr;
} // namespace server2
} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/header.hpp b/3rdparty/asio/src/examples/cpp11/http/server2/header.hpp
index acba8ddf5ea..f888dde03c0 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/header.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/header.hpp
@@ -2,7 +2,7 @@
// header.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/io_context_pool.cpp b/3rdparty/asio/src/examples/cpp11/http/server2/io_context_pool.cpp
index 9f0ec9f1984..bea08903087 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/io_context_pool.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/io_context_pool.cpp
@@ -2,7 +2,7 @@
// io_context_pool.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -10,8 +10,7 @@
#include "server.hpp"
#include <stdexcept>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
+#include <thread>
namespace http {
namespace server2 {
@@ -28,25 +27,20 @@ io_context_pool::io_context_pool(std::size_t pool_size)
{
io_context_ptr io_context(new asio::io_context);
io_contexts_.push_back(io_context);
- work_.push_back(asio::require(io_context->get_executor(),
- asio::execution::outstanding_work.tracked));
+ work_.push_back(asio::make_work_guard(*io_context));
}
}
void io_context_pool::run()
{
// Create a pool of threads to run all of the io_contexts.
- std::vector<boost::shared_ptr<asio::thread> > threads;
+ std::vector<std::thread> threads;
for (std::size_t i = 0; i < io_contexts_.size(); ++i)
- {
- boost::shared_ptr<asio::thread> thread(new asio::thread(
- boost::bind(&asio::io_context::run, io_contexts_[i])));
- threads.push_back(thread);
- }
+ threads.emplace_back([this, i]{ io_contexts_[i]->run(); });
// Wait for all threads in the pool to exit.
for (std::size_t i = 0; i < threads.size(); ++i)
- threads[i]->join();
+ threads[i].join();
}
void io_context_pool::stop()
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/io_context_pool.hpp b/3rdparty/asio/src/examples/cpp11/http/server2/io_context_pool.hpp
index c08091dcefe..0946ba6e484 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/io_context_pool.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/io_context_pool.hpp
@@ -2,7 +2,7 @@
// io_context_pool.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -13,16 +13,14 @@
#include <asio.hpp>
#include <list>
+#include <memory>
#include <vector>
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
namespace http {
namespace server2 {
/// A pool of io_context objects.
class io_context_pool
- : private boost::noncopyable
{
public:
/// Construct the io_context pool.
@@ -38,13 +36,18 @@ public:
asio::io_context& get_io_context();
private:
- typedef boost::shared_ptr<asio::io_context> io_context_ptr;
+ io_context_pool(const io_context_pool&) = delete;
+ io_context_pool& operator=(const io_context_pool&) = delete;
+
+ typedef std::shared_ptr<asio::io_context> io_context_ptr;
+ typedef asio::executor_work_guard<
+ asio::io_context::executor_type> io_context_work;
/// The pool of io_contexts.
std::vector<io_context_ptr> io_contexts_;
- /// The work-tracking executors that keep the io_contexts running.
- std::list<asio::any_io_executor> work_;
+ /// The work that keeps the io_contexts running.
+ std::list<io_context_work> work_;
/// The next io_context to use for a connection.
std::size_t next_io_context_;
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/main.cpp b/3rdparty/asio/src/examples/cpp11/http/server2/main.cpp
index 78cf0a72618..5b6a9a36cb3 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/main.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/main.cpp
@@ -2,7 +2,7 @@
// main.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -11,8 +11,6 @@
#include <iostream>
#include <string>
#include <asio.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/lexical_cast.hpp>
#include "server.hpp"
int main(int argc, char* argv[])
@@ -31,7 +29,7 @@ int main(int argc, char* argv[])
}
// Initialise the server.
- std::size_t num_threads = boost::lexical_cast<std::size_t>(argv[3]);
+ std::size_t num_threads = std::stoi(argv[3]);
http::server2::server s(argv[1], argv[2], argv[4], num_threads);
// Run the server until stopped.
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/mime_types.cpp b/3rdparty/asio/src/examples/cpp11/http/server2/mime_types.cpp
index 67f23dc108b..03079331e93 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/mime_types.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/mime_types.cpp
@@ -2,7 +2,7 @@
// mime_types.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/mime_types.hpp b/3rdparty/asio/src/examples/cpp11/http/server2/mime_types.hpp
index 53c83470477..32985c18e59 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/mime_types.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/mime_types.hpp
@@ -2,7 +2,7 @@
// mime_types.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/reply.cpp b/3rdparty/asio/src/examples/cpp11/http/server2/reply.cpp
index c5eb79130de..d48bfd9e463 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/reply.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/reply.cpp
@@ -2,7 +2,7 @@
// reply.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -10,7 +10,6 @@
#include "reply.hpp"
#include <string>
-#include <boost/lexical_cast.hpp>
namespace http {
namespace server2 {
@@ -246,7 +245,7 @@ reply reply::stock_reply(reply::status_type status)
rep.content = stock_replies::to_string(status);
rep.headers.resize(2);
rep.headers[0].name = "Content-Length";
- rep.headers[0].value = boost::lexical_cast<std::string>(rep.content.size());
+ rep.headers[0].value = std::to_string(rep.content.size());
rep.headers[1].name = "Content-Type";
rep.headers[1].value = "text/html";
return rep;
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/reply.hpp b/3rdparty/asio/src/examples/cpp11/http/server2/reply.hpp
index 6a99edac7c0..f4be7ca94fe 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/reply.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/reply.hpp
@@ -2,7 +2,7 @@
// reply.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/request.hpp b/3rdparty/asio/src/examples/cpp11/http/server2/request.hpp
index 4c54b2028dd..b0000b00967 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/request.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/request.hpp
@@ -2,7 +2,7 @@
// request.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/request_handler.cpp b/3rdparty/asio/src/examples/cpp11/http/server2/request_handler.cpp
index 42677d3defb..c57fa9757f5 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/request_handler.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/request_handler.cpp
@@ -2,7 +2,7 @@
// request_handler.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,7 +12,6 @@
#include <fstream>
#include <sstream>
#include <string>
-#include <boost/lexical_cast.hpp>
#include "mime_types.hpp"
#include "reply.hpp"
#include "request.hpp"
@@ -74,7 +73,7 @@ void request_handler::handle_request(const request& req, reply& rep)
rep.content.append(buf, is.gcount());
rep.headers.resize(2);
rep.headers[0].name = "Content-Length";
- rep.headers[0].value = boost::lexical_cast<std::string>(rep.content.size());
+ rep.headers[0].value = std::to_string(rep.content.size());
rep.headers[1].name = "Content-Type";
rep.headers[1].value = mime_types::extension_to_type(extension);
}
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/request_handler.hpp b/3rdparty/asio/src/examples/cpp11/http/server2/request_handler.hpp
index b4d8d1b5c73..c9e9ebf418f 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/request_handler.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/request_handler.hpp
@@ -2,7 +2,7 @@
// request_handler.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,7 +12,6 @@
#define HTTP_SERVER2_REQUEST_HANDLER_HPP
#include <string>
-#include <boost/noncopyable.hpp>
namespace http {
namespace server2 {
@@ -22,9 +21,11 @@ struct request;
/// The common handler for all incoming requests.
class request_handler
- : private boost::noncopyable
{
public:
+ request_handler(const request_handler&) = delete;
+ request_handler& operator=(const request_handler&) = delete;
+
/// Construct with a directory containing files to be served.
explicit request_handler(const std::string& doc_root);
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/request_parser.cpp b/3rdparty/asio/src/examples/cpp11/http/server2/request_parser.cpp
index 5c10ec8580d..2cd8ac00b47 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/request_parser.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/request_parser.cpp
@@ -2,7 +2,7 @@
// request_parser.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -24,90 +24,90 @@ void request_parser::reset()
state_ = method_start;
}
-boost::tribool request_parser::consume(request& req, char input)
+request_parser::result_type request_parser::consume(request& req, char input)
{
switch (state_)
{
case method_start:
if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
state_ = method;
req.method.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case method:
if (input == ' ')
{
state_ = uri;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
req.method.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case uri:
if (input == ' ')
{
state_ = http_version_h;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_ctl(input))
{
- return false;
+ return bad;
}
else
{
req.uri.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case http_version_h:
if (input == 'H')
{
state_ = http_version_t_1;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_t_1:
if (input == 'T')
{
state_ = http_version_t_2;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_t_2:
if (input == 'T')
{
state_ = http_version_p;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_p:
if (input == 'P')
{
state_ = http_version_slash;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_slash:
if (input == '/')
@@ -115,170 +115,170 @@ boost::tribool request_parser::consume(request& req, char input)
req.http_version_major = 0;
req.http_version_minor = 0;
state_ = http_version_major_start;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_major_start:
if (is_digit(input))
{
req.http_version_major = req.http_version_major * 10 + input - '0';
state_ = http_version_major;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_major:
if (input == '.')
{
state_ = http_version_minor_start;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_digit(input))
{
req.http_version_major = req.http_version_major * 10 + input - '0';
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_minor_start:
if (is_digit(input))
{
req.http_version_minor = req.http_version_minor * 10 + input - '0';
state_ = http_version_minor;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_minor:
if (input == '\r')
{
state_ = expecting_newline_1;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_digit(input))
{
req.http_version_minor = req.http_version_minor * 10 + input - '0';
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case expecting_newline_1:
if (input == '\n')
{
state_ = header_line_start;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case header_line_start:
if (input == '\r')
{
state_ = expecting_newline_3;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!req.headers.empty() && (input == ' ' || input == '\t'))
{
state_ = header_lws;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
req.headers.push_back(header());
req.headers.back().name.push_back(input);
state_ = header_name;
- return boost::indeterminate;
+ return indeterminate;
}
case header_lws:
if (input == '\r')
{
state_ = expecting_newline_2;
- return boost::indeterminate;
+ return indeterminate;
}
else if (input == ' ' || input == '\t')
{
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_ctl(input))
{
- return false;
+ return bad;
}
else
{
state_ = header_value;
req.headers.back().value.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case header_name:
if (input == ':')
{
state_ = space_before_header_value;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
req.headers.back().name.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case space_before_header_value:
if (input == ' ')
{
state_ = header_value;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case header_value:
if (input == '\r')
{
state_ = expecting_newline_2;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_ctl(input))
{
- return false;
+ return bad;
}
else
{
req.headers.back().value.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case expecting_newline_2:
if (input == '\n')
{
state_ = header_line_start;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case expecting_newline_3:
- return (input == '\n');
+ return (input == '\n') ? good : bad;
default:
- return false;
+ return bad;
}
}
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/request_parser.hpp b/3rdparty/asio/src/examples/cpp11/http/server2/request_parser.hpp
index 359adc6f0b0..1d11168b72d 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/request_parser.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/request_parser.hpp
@@ -2,7 +2,7 @@
// request_parser.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -11,8 +11,7 @@
#ifndef HTTP_SERVER2_REQUEST_PARSER_HPP
#define HTTP_SERVER2_REQUEST_PARSER_HPP
-#include <boost/logic/tribool.hpp>
-#include <boost/tuple/tuple.hpp>
+#include <tuple>
namespace http {
namespace server2 {
@@ -29,27 +28,29 @@ public:
/// Reset to initial parser state.
void reset();
- /// Parse some data. The tribool return value is true when a complete request
- /// has been parsed, false if the data is invalid, indeterminate when more
- /// data is required. The InputIterator return value indicates how much of the
- /// input has been consumed.
+ /// Result of parse.
+ enum result_type { good, bad, indeterminate };
+
+ /// Parse some data. The enum return value is good when a complete request has
+ /// been parsed, bad if the data is invalid, indeterminate when more data is
+ /// required. The InputIterator return value indicates how much of the input
+ /// has been consumed.
template <typename InputIterator>
- boost::tuple<boost::tribool, InputIterator> parse(request& req,
+ std::tuple<result_type, InputIterator> parse(request& req,
InputIterator begin, InputIterator end)
{
while (begin != end)
{
- boost::tribool result = consume(req, *begin++);
- if (result || !result)
- return boost::make_tuple(result, begin);
+ result_type result = consume(req, *begin++);
+ if (result == good || result == bad)
+ return std::make_tuple(result, begin);
}
- boost::tribool result = boost::indeterminate;
- return boost::make_tuple(result, begin);
+ return std::make_tuple(indeterminate, begin);
}
private:
/// Handle the next character of input.
- boost::tribool consume(request& req, char input);
+ result_type consume(request& req, char input);
/// Check if a byte is an HTTP character.
static bool is_char(int c);
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/server.cpp b/3rdparty/asio/src/examples/cpp11/http/server2/server.cpp
index 72ebcf9f352..2ae733086a5 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/server.cpp
@@ -2,14 +2,16 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 "server.hpp"
-#include <boost/bind/bind.hpp>
+#include <signal.h>
+#include <utility>
+#include "connection.hpp"
namespace http {
namespace server2 {
@@ -19,7 +21,6 @@ server::server(const std::string& address, const std::string& port,
: io_context_pool_(io_context_pool_size),
signals_(io_context_pool_.get_io_context()),
acceptor_(io_context_pool_.get_io_context()),
- new_connection_(),
request_handler_(doc_root)
{
// Register to handle the signals that indicate when the server should exit.
@@ -30,7 +31,8 @@ server::server(const std::string& address, const std::string& port,
#if defined(SIGQUIT)
signals_.add(SIGQUIT);
#endif // defined(SIGQUIT)
- signals_.async_wait(boost::bind(&server::handle_stop, this));
+
+ do_await_stop();
// Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
asio::ip::tcp::resolver resolver(acceptor_.get_executor());
@@ -41,7 +43,7 @@ server::server(const std::string& address, const std::string& port,
acceptor_.bind(endpoint);
acceptor_.listen();
- start_accept();
+ do_accept();
}
void server::run()
@@ -49,28 +51,35 @@ void server::run()
io_context_pool_.run();
}
-void server::start_accept()
+void server::do_accept()
{
- new_connection_.reset(new connection(
- io_context_pool_.get_io_context(), request_handler_));
- acceptor_.async_accept(new_connection_->socket(),
- boost::bind(&server::handle_accept, this,
- asio::placeholders::error));
-}
+ acceptor_.async_accept(io_context_pool_.get_io_context(),
+ [this](std::error_code ec, asio::ip::tcp::socket socket)
+ {
+ // Check whether the server was stopped by a signal before this
+ // completion handler had a chance to run.
+ if (!acceptor_.is_open())
+ {
+ return;
+ }
-void server::handle_accept(const asio::error_code& e)
-{
- if (!e)
- {
- new_connection_->start();
- }
+ if (!ec)
+ {
+ std::make_shared<connection>(
+ std::move(socket), request_handler_)->start();
+ }
- start_accept();
+ do_accept();
+ });
}
-void server::handle_stop()
+void server::do_await_stop()
{
- io_context_pool_.stop();
+ signals_.async_wait(
+ [this](std::error_code /*ec*/, int /*signo*/)
+ {
+ io_context_pool_.stop();
+ });
}
} // namespace server2
diff --git a/3rdparty/asio/src/examples/cpp03/http/server2/server.hpp b/3rdparty/asio/src/examples/cpp11/http/server2/server.hpp
index 9bcdbe093aa..9d34a77ed7c 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server2/server.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server2/server.hpp
@@ -2,7 +2,7 @@
// server.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -13,10 +13,6 @@
#include <asio.hpp>
#include <string>
-#include <vector>
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
-#include "connection.hpp"
#include "io_context_pool.hpp"
#include "request_handler.hpp"
@@ -25,9 +21,11 @@ namespace server2 {
/// The top-level class of the HTTP server.
class server
- : private boost::noncopyable
{
public:
+ server(const server&) = delete;
+ server& operator=(const server&) = delete;
+
/// Construct the server to listen on the specified TCP address and port, and
/// serve up files from the given directory.
explicit server(const std::string& address, const std::string& port,
@@ -37,14 +35,11 @@ public:
void run();
private:
- /// Initiate an asynchronous accept operation.
- void start_accept();
-
- /// Handle completion of an asynchronous accept operation.
- void handle_accept(const asio::error_code& e);
+ /// Perform an asynchronous accept operation.
+ void do_accept();
- /// Handle a request to stop the server.
- void handle_stop();
+ /// Wait for a request to stop the server.
+ void do_await_stop();
/// The pool of io_context objects used to perform asynchronous operations.
io_context_pool io_context_pool_;
@@ -55,9 +50,6 @@ private:
/// Acceptor used to listen for incoming connections.
asio::ip::tcp::acceptor acceptor_;
- /// The next connection to be accepted.
- connection_ptr new_connection_;
-
/// The handler for all incoming requests.
request_handler request_handler_;
};
diff --git a/3rdparty/asio/src/examples/cpp11/http/server3/connection.cpp b/3rdparty/asio/src/examples/cpp11/http/server3/connection.cpp
new file mode 100644
index 00000000000..d4070364fb4
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/connection.cpp
@@ -0,0 +1,89 @@
+//
+// connection.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 "connection.hpp"
+#include <utility>
+#include "request_handler.hpp"
+
+namespace http {
+namespace server3 {
+
+connection::connection(asio::ip::tcp::socket socket,
+ request_handler& handler)
+ : socket_(std::move(socket)),
+ request_handler_(handler)
+{
+}
+
+void connection::start()
+{
+ do_read();
+}
+
+void connection::do_read()
+{
+ auto self(shared_from_this());
+ socket_.async_read_some(asio::buffer(buffer_),
+ [this, self](std::error_code ec, std::size_t bytes_transferred)
+ {
+ if (!ec)
+ {
+ request_parser::result_type result;
+ std::tie(result, std::ignore) = request_parser_.parse(
+ request_, buffer_.data(), buffer_.data() + bytes_transferred);
+
+ if (result == request_parser::good)
+ {
+ request_handler_.handle_request(request_, reply_);
+ do_write();
+ }
+ else if (result == request_parser::bad)
+ {
+ reply_ = reply::stock_reply(reply::bad_request);
+ do_write();
+ }
+ else
+ {
+ do_read();
+ }
+ }
+
+ // If an error occurs then no new asynchronous operations are
+ // started. This means that all shared_ptr references to the
+ // connection object will disappear and the object will be
+ // destroyed automatically after this handler returns. The
+ // connection class's destructor closes the socket.
+ });
+}
+
+void connection::do_write()
+{
+ auto self(shared_from_this());
+ asio::async_write(socket_, reply_.to_buffers(),
+ [this, self](std::error_code ec, std::size_t)
+ {
+ if (!ec)
+ {
+ // Initiate graceful connection closure.
+ std::error_code ignored_ec;
+ socket_.shutdown(asio::ip::tcp::socket::shutdown_both,
+ ignored_ec);
+ }
+
+ // No new asynchronous operations are started. This means that
+ // all shared_ptr references to the connection object will
+ // disappear and the object will be destroyed automatically after
+ // this handler returns. The connection class's destructor closes
+ // the socket.
+ });
+}
+
+} // namespace server3
+} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/connection.hpp b/3rdparty/asio/src/examples/cpp11/http/server3/connection.hpp
index 5fa129a6061..878cd45d366 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/connection.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/connection.hpp
@@ -2,7 +2,7 @@
// connection.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,10 +12,8 @@
#define HTTP_SERVER3_CONNECTION_HPP
#include <asio.hpp>
-#include <boost/array.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
+#include <array>
+#include <memory>
#include "reply.hpp"
#include "request.hpp"
#include "request_handler.hpp"
@@ -26,30 +24,25 @@ namespace server3 {
/// Represents a single connection from a client.
class connection
- : public boost::enable_shared_from_this<connection>,
- private boost::noncopyable
+ : public std::enable_shared_from_this<connection>
{
public:
- /// Construct a connection with the given io_context.
- explicit connection(asio::io_context& io_context,
- request_handler& handler);
+ connection(const connection&) = delete;
+ connection& operator=(const connection&) = delete;
- /// Get the socket associated with the connection.
- asio::ip::tcp::socket& socket();
+ /// Construct a connection with the given socket.
+ explicit connection(asio::ip::tcp::socket socket,
+ request_handler& handler);
/// Start the first asynchronous operation for the connection.
void start();
private:
- /// Handle completion of a read operation.
- void handle_read(const asio::error_code& e,
- std::size_t bytes_transferred);
-
- /// Handle completion of a write operation.
- void handle_write(const asio::error_code& e);
+ /// Perform an asynchronous read operation.
+ void do_read();
- /// Strand to ensure the connection's handlers are not called concurrently.
- asio::strand<asio::io_context::executor_type> strand_;
+ /// Perform an asynchronous write operation.
+ void do_write();
/// Socket for the connection.
asio::ip::tcp::socket socket_;
@@ -58,7 +51,7 @@ private:
request_handler& request_handler_;
/// Buffer for incoming data.
- boost::array<char, 8192> buffer_;
+ std::array<char, 8192> buffer_;
/// The incoming request.
request request_;
@@ -70,7 +63,7 @@ private:
reply reply_;
};
-typedef boost::shared_ptr<connection> connection_ptr;
+typedef std::shared_ptr<connection> connection_ptr;
} // namespace server3
} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/header.hpp b/3rdparty/asio/src/examples/cpp11/http/server3/header.hpp
index f709b1789e1..8ab5d145a6d 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/header.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/header.hpp
@@ -2,7 +2,7 @@
// header.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/main.cpp b/3rdparty/asio/src/examples/cpp11/http/server3/main.cpp
index 2daf0ee9568..243de69bc75 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/main.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/main.cpp
@@ -2,7 +2,7 @@
// main.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -11,8 +11,6 @@
#include <iostream>
#include <string>
#include <asio.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/lexical_cast.hpp>
#include "server.hpp"
int main(int argc, char* argv[])
@@ -31,7 +29,7 @@ int main(int argc, char* argv[])
}
// Initialise the server.
- std::size_t num_threads = boost::lexical_cast<std::size_t>(argv[3]);
+ std::size_t num_threads = std::stoi(argv[3]);
http::server3::server s(argv[1], argv[2], argv[4], num_threads);
// Run the server until stopped.
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/mime_types.cpp b/3rdparty/asio/src/examples/cpp11/http/server3/mime_types.cpp
index 78850acafbf..d0d804c7caa 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/mime_types.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/mime_types.cpp
@@ -2,7 +2,7 @@
// mime_types.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/mime_types.hpp b/3rdparty/asio/src/examples/cpp11/http/server3/mime_types.hpp
index a556356010f..a144c8677e6 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/mime_types.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/mime_types.hpp
@@ -2,7 +2,7 @@
// mime_types.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/reply.cpp b/3rdparty/asio/src/examples/cpp11/http/server3/reply.cpp
index fe304271d61..4695d4a8da2 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/reply.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/reply.cpp
@@ -2,7 +2,7 @@
// reply.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -10,7 +10,6 @@
#include "reply.hpp"
#include <string>
-#include <boost/lexical_cast.hpp>
namespace http {
namespace server3 {
@@ -246,7 +245,7 @@ reply reply::stock_reply(reply::status_type status)
rep.content = stock_replies::to_string(status);
rep.headers.resize(2);
rep.headers[0].name = "Content-Length";
- rep.headers[0].value = boost::lexical_cast<std::string>(rep.content.size());
+ rep.headers[0].value = std::to_string(rep.content.size());
rep.headers[1].name = "Content-Type";
rep.headers[1].value = "text/html";
return rep;
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/reply.hpp b/3rdparty/asio/src/examples/cpp11/http/server3/reply.hpp
index fe43fd8573e..fd9c7ed9ed5 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/reply.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/reply.hpp
@@ -2,7 +2,7 @@
// reply.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/request.hpp b/3rdparty/asio/src/examples/cpp11/http/server3/request.hpp
index 40fd359c173..89a2f285b7a 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/request.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/request.hpp
@@ -2,7 +2,7 @@
// request.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/request_handler.cpp b/3rdparty/asio/src/examples/cpp11/http/server3/request_handler.cpp
index 64efd8d02a5..bdc6bd60892 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/request_handler.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/request_handler.cpp
@@ -2,7 +2,7 @@
// request_handler.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,7 +12,6 @@
#include <fstream>
#include <sstream>
#include <string>
-#include <boost/lexical_cast.hpp>
#include "mime_types.hpp"
#include "reply.hpp"
#include "request.hpp"
@@ -74,7 +73,7 @@ void request_handler::handle_request(const request& req, reply& rep)
rep.content.append(buf, is.gcount());
rep.headers.resize(2);
rep.headers[0].name = "Content-Length";
- rep.headers[0].value = boost::lexical_cast<std::string>(rep.content.size());
+ rep.headers[0].value = std::to_string(rep.content.size());
rep.headers[1].name = "Content-Type";
rep.headers[1].value = mime_types::extension_to_type(extension);
}
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/request_handler.hpp b/3rdparty/asio/src/examples/cpp11/http/server3/request_handler.hpp
index e9f16d2d492..e3fe84ed0cb 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/request_handler.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/request_handler.hpp
@@ -2,7 +2,7 @@
// request_handler.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,7 +12,6 @@
#define HTTP_SERVER3_REQUEST_HANDLER_HPP
#include <string>
-#include <boost/noncopyable.hpp>
namespace http {
namespace server3 {
@@ -22,9 +21,11 @@ struct request;
/// The common handler for all incoming requests.
class request_handler
- : private boost::noncopyable
{
public:
+ request_handler(const request_handler&) = delete;
+ request_handler& operator=(const request_handler&) = delete;
+
/// Construct with a directory containing files to be served.
explicit request_handler(const std::string& doc_root);
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/request_parser.cpp b/3rdparty/asio/src/examples/cpp11/http/server3/request_parser.cpp
index 9cd46e4e5e2..9fb6424fad7 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/request_parser.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/request_parser.cpp
@@ -2,7 +2,7 @@
// request_parser.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -24,90 +24,90 @@ void request_parser::reset()
state_ = method_start;
}
-boost::tribool request_parser::consume(request& req, char input)
+request_parser::result_type request_parser::consume(request& req, char input)
{
switch (state_)
{
case method_start:
if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
state_ = method;
req.method.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case method:
if (input == ' ')
{
state_ = uri;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
req.method.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case uri:
if (input == ' ')
{
state_ = http_version_h;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_ctl(input))
{
- return false;
+ return bad;
}
else
{
req.uri.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case http_version_h:
if (input == 'H')
{
state_ = http_version_t_1;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_t_1:
if (input == 'T')
{
state_ = http_version_t_2;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_t_2:
if (input == 'T')
{
state_ = http_version_p;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_p:
if (input == 'P')
{
state_ = http_version_slash;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_slash:
if (input == '/')
@@ -115,170 +115,170 @@ boost::tribool request_parser::consume(request& req, char input)
req.http_version_major = 0;
req.http_version_minor = 0;
state_ = http_version_major_start;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_major_start:
if (is_digit(input))
{
req.http_version_major = req.http_version_major * 10 + input - '0';
state_ = http_version_major;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_major:
if (input == '.')
{
state_ = http_version_minor_start;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_digit(input))
{
req.http_version_major = req.http_version_major * 10 + input - '0';
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_minor_start:
if (is_digit(input))
{
req.http_version_minor = req.http_version_minor * 10 + input - '0';
state_ = http_version_minor;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_minor:
if (input == '\r')
{
state_ = expecting_newline_1;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_digit(input))
{
req.http_version_minor = req.http_version_minor * 10 + input - '0';
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case expecting_newline_1:
if (input == '\n')
{
state_ = header_line_start;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case header_line_start:
if (input == '\r')
{
state_ = expecting_newline_3;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!req.headers.empty() && (input == ' ' || input == '\t'))
{
state_ = header_lws;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
req.headers.push_back(header());
req.headers.back().name.push_back(input);
state_ = header_name;
- return boost::indeterminate;
+ return indeterminate;
}
case header_lws:
if (input == '\r')
{
state_ = expecting_newline_2;
- return boost::indeterminate;
+ return indeterminate;
}
else if (input == ' ' || input == '\t')
{
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_ctl(input))
{
- return false;
+ return bad;
}
else
{
state_ = header_value;
req.headers.back().value.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case header_name:
if (input == ':')
{
state_ = space_before_header_value;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
req.headers.back().name.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case space_before_header_value:
if (input == ' ')
{
state_ = header_value;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case header_value:
if (input == '\r')
{
state_ = expecting_newline_2;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_ctl(input))
{
- return false;
+ return bad;
}
else
{
req.headers.back().value.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case expecting_newline_2:
if (input == '\n')
{
state_ = header_line_start;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case expecting_newline_3:
- return (input == '\n');
+ return (input == '\n') ? good : bad;
default:
- return false;
+ return bad;
}
}
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/request_parser.hpp b/3rdparty/asio/src/examples/cpp11/http/server3/request_parser.hpp
index ff6576ef57e..a8334ed13ee 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/request_parser.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/request_parser.hpp
@@ -2,7 +2,7 @@
// request_parser.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -11,8 +11,7 @@
#ifndef HTTP_SERVER3_REQUEST_PARSER_HPP
#define HTTP_SERVER3_REQUEST_PARSER_HPP
-#include <boost/logic/tribool.hpp>
-#include <boost/tuple/tuple.hpp>
+#include <tuple>
namespace http {
namespace server3 {
@@ -29,27 +28,29 @@ public:
/// Reset to initial parser state.
void reset();
- /// Parse some data. The tribool return value is true when a complete request
- /// has been parsed, false if the data is invalid, indeterminate when more
- /// data is required. The InputIterator return value indicates how much of the
- /// input has been consumed.
+ /// Result of parse.
+ enum result_type { good, bad, indeterminate };
+
+ /// Parse some data. The enum return value is good when a complete request has
+ /// been parsed, bad if the data is invalid, indeterminate when more data is
+ /// required. The InputIterator return value indicates how much of the input
+ /// has been consumed.
template <typename InputIterator>
- boost::tuple<boost::tribool, InputIterator> parse(request& req,
+ std::tuple<result_type, InputIterator> parse(request& req,
InputIterator begin, InputIterator end)
{
while (begin != end)
{
- boost::tribool result = consume(req, *begin++);
- if (result || !result)
- return boost::make_tuple(result, begin);
+ result_type result = consume(req, *begin++);
+ if (result == good || result == bad)
+ return std::make_tuple(result, begin);
}
- boost::tribool result = boost::indeterminate;
- return boost::make_tuple(result, begin);
+ return std::make_tuple(indeterminate, begin);
}
private:
/// Handle the next character of input.
- boost::tribool consume(request& req, char input);
+ result_type consume(request& req, char input);
/// Check if a byte is an HTTP character.
static bool is_char(int c);
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/server.cpp b/3rdparty/asio/src/examples/cpp11/http/server3/server.cpp
index 469afe217da..c8da4b4f4db 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/server.cpp
@@ -2,16 +2,18 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 "server.hpp"
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
+#include <signal.h>
+#include <thread>
+#include <utility>
#include <vector>
+#include "connection.hpp"
namespace http {
namespace server3 {
@@ -21,7 +23,6 @@ server::server(const std::string& address, const std::string& port,
: thread_pool_size_(thread_pool_size),
signals_(io_context_),
acceptor_(io_context_),
- new_connection_(),
request_handler_(doc_root)
{
// Register to handle the signals that indicate when the server should exit.
@@ -32,7 +33,8 @@ server::server(const std::string& address, const std::string& port,
#if defined(SIGQUIT)
signals_.add(SIGQUIT);
#endif // defined(SIGQUIT)
- signals_.async_wait(boost::bind(&server::handle_stop, this));
+
+ do_await_stop();
// Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
asio::ip::tcp::resolver resolver(io_context_);
@@ -43,46 +45,52 @@ server::server(const std::string& address, const std::string& port,
acceptor_.bind(endpoint);
acceptor_.listen();
- start_accept();
+ do_accept();
}
void server::run()
{
- // Create a pool of threads to run all of the io_contexts.
- std::vector<boost::shared_ptr<asio::thread> > threads;
+ // Create a pool of threads to run the io_context.
+ std::vector<std::thread> threads;
for (std::size_t i = 0; i < thread_pool_size_; ++i)
- {
- boost::shared_ptr<asio::thread> thread(new asio::thread(
- boost::bind(&asio::io_context::run, &io_context_)));
- threads.push_back(thread);
- }
+ threads.emplace_back([this]{ io_context_.run(); });
// Wait for all threads in the pool to exit.
for (std::size_t i = 0; i < threads.size(); ++i)
- threads[i]->join();
+ threads[i].join();
}
-void server::start_accept()
+void server::do_accept()
{
- new_connection_.reset(new connection(io_context_, request_handler_));
- acceptor_.async_accept(new_connection_->socket(),
- boost::bind(&server::handle_accept, this,
- asio::placeholders::error));
-}
+ // The newly accepted socket is put into its own strand to ensure that all
+ // completion handlers associated with the connection do not run concurrently.
+ acceptor_.async_accept(asio::make_strand(io_context_),
+ [this](std::error_code ec, asio::ip::tcp::socket socket)
+ {
+ // Check whether the server was stopped by a signal before this
+ // completion handler had a chance to run.
+ if (!acceptor_.is_open())
+ {
+ return;
+ }
-void server::handle_accept(const asio::error_code& e)
-{
- if (!e)
- {
- new_connection_->start();
- }
+ if (!ec)
+ {
+ std::make_shared<connection>(
+ std::move(socket), request_handler_)->start();
+ }
- start_accept();
+ do_accept();
+ });
}
-void server::handle_stop()
+void server::do_await_stop()
{
- io_context_.stop();
+ signals_.async_wait(
+ [this](std::error_code /*ec*/, int /*signo*/)
+ {
+ io_context_.stop();
+ });
}
} // namespace server3
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/server.hpp b/3rdparty/asio/src/examples/cpp11/http/server3/server.hpp
index 59d20306db6..2948cadbf17 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server3/server.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server3/server.hpp
@@ -2,7 +2,7 @@
// server.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -13,10 +13,6 @@
#include <asio.hpp>
#include <string>
-#include <vector>
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
-#include "connection.hpp"
#include "request_handler.hpp"
namespace http {
@@ -24,9 +20,11 @@ namespace server3 {
/// The top-level class of the HTTP server.
class server
- : private boost::noncopyable
{
public:
+ server(const server&) = delete;
+ server& operator=(const server&) = delete;
+
/// Construct the server to listen on the specified TCP address and port, and
/// serve up files from the given directory.
explicit server(const std::string& address, const std::string& port,
@@ -36,14 +34,11 @@ public:
void run();
private:
- /// Initiate an asynchronous accept operation.
- void start_accept();
-
- /// Handle completion of an asynchronous accept operation.
- void handle_accept(const asio::error_code& e);
+ /// Perform an asynchronous accept operation.
+ void do_accept();
- /// Handle a request to stop the server.
- void handle_stop();
+ /// Wait for a request to stop the server.
+ void do_await_stop();
/// The number of threads that will call io_context::run().
std::size_t thread_pool_size_;
@@ -57,9 +52,6 @@ private:
/// Acceptor used to listen for incoming connections.
asio::ip::tcp::acceptor acceptor_;
- /// The next connection to be accepted.
- connection_ptr new_connection_;
-
/// The handler for all incoming requests.
request_handler request_handler_;
};
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/file_handler.cpp b/3rdparty/asio/src/examples/cpp11/http/server4/file_handler.cpp
index 310a518fefa..ad982e58b26 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/file_handler.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/file_handler.cpp
@@ -2,7 +2,7 @@
// file_handler.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,7 +12,6 @@
#include <fstream>
#include <sstream>
#include <string>
-#include <boost/lexical_cast.hpp>
#include "mime_types.hpp"
#include "reply.hpp"
#include "request.hpp"
@@ -74,7 +73,7 @@ void file_handler::operator()(const request& req, reply& rep)
rep.content.append(buf, is.gcount());
rep.headers.resize(2);
rep.headers[0].name = "Content-Length";
- rep.headers[0].value = boost::lexical_cast<std::string>(rep.content.size());
+ rep.headers[0].value = std::to_string(rep.content.size());
rep.headers[1].name = "Content-Type";
rep.headers[1].value = mime_types::extension_to_type(extension);
}
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/file_handler.hpp b/3rdparty/asio/src/examples/cpp11/http/server4/file_handler.hpp
index 3d898cce149..a16e5b6905c 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/file_handler.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/file_handler.hpp
@@ -2,7 +2,7 @@
// file_handler.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/header.hpp b/3rdparty/asio/src/examples/cpp11/http/server4/header.hpp
index ee5d8bf727d..a4148e5d910 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/header.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/header.hpp
@@ -2,7 +2,7 @@
// header.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/main.cpp b/3rdparty/asio/src/examples/cpp11/http/server4/main.cpp
index 58e1ae8f0af..29706e6a335 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/main.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/main.cpp
@@ -2,7 +2,7 @@
// main.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -10,7 +10,6 @@
#include <iostream>
#include <asio.hpp>
-#include <boost/bind/bind.hpp>
#include <signal.h>
#include "server.hpp"
#include "file_handler.hpp"
@@ -43,8 +42,11 @@ int main(int argc, char* argv[])
#if defined(SIGQUIT)
signals.add(SIGQUIT);
#endif // defined(SIGQUIT)
- signals.async_wait(boost::bind(
- &asio::io_context::stop, &io_context));
+ signals.async_wait(
+ [&io_context](std::error_code, int)
+ {
+ io_context.stop();
+ });
// Run the server.
io_context.run();
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/mime_types.cpp b/3rdparty/asio/src/examples/cpp11/http/server4/mime_types.cpp
index c6f421c76c3..6cf11e383d8 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/mime_types.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/mime_types.cpp
@@ -2,7 +2,7 @@
// mime_types.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/mime_types.hpp b/3rdparty/asio/src/examples/cpp11/http/server4/mime_types.hpp
index 699b7bf0051..6086fce22eb 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/mime_types.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/mime_types.hpp
@@ -2,7 +2,7 @@
// mime_types.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/reply.cpp b/3rdparty/asio/src/examples/cpp11/http/server4/reply.cpp
index e9c1eb68e97..4e5752ea7d0 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/reply.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/reply.cpp
@@ -2,7 +2,7 @@
// reply.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -10,7 +10,6 @@
#include "reply.hpp"
#include <string>
-#include <boost/lexical_cast.hpp>
namespace http {
namespace server4 {
@@ -246,7 +245,7 @@ reply reply::stock_reply(reply::status_type status)
rep.content = stock_replies::to_string(status);
rep.headers.resize(2);
rep.headers[0].name = "Content-Length";
- rep.headers[0].value = boost::lexical_cast<std::string>(rep.content.size());
+ rep.headers[0].value = std::to_string(rep.content.size());
rep.headers[1].name = "Content-Type";
rep.headers[1].value = "text/html";
return rep;
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/reply.hpp b/3rdparty/asio/src/examples/cpp11/http/server4/reply.hpp
index 5aaefae7e2a..d08579a3339 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/reply.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/reply.hpp
@@ -2,7 +2,7 @@
// reply.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/request.hpp b/3rdparty/asio/src/examples/cpp11/http/server4/request.hpp
index 8a6a2bdf824..8b20c4db0db 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server/request.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/request.hpp
@@ -2,21 +2,21 @@
// request.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 HTTP_REQUEST_HPP
-#define HTTP_REQUEST_HPP
+#ifndef HTTP_SERVER4_REQUEST_HPP
+#define HTTP_SERVER4_REQUEST_HPP
#include <string>
#include <vector>
#include "header.hpp"
namespace http {
-namespace server {
+namespace server4 {
/// A request received from a client.
struct request
@@ -28,7 +28,7 @@ struct request
std::vector<header> headers;
};
-} // namespace server
+} // namespace server4
} // namespace http
-#endif // HTTP_REQUEST_HPP
+#endif // HTTP_SERVER4_REQUEST_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/request_parser.cpp b/3rdparty/asio/src/examples/cpp11/http/server4/request_parser.cpp
index 2f502d5e023..ec557fccdd6 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server/request_parser.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/request_parser.cpp
@@ -2,7 +2,7 @@
// request_parser.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,7 +12,7 @@
#include "request.hpp"
namespace http {
-namespace server {
+namespace server4 {
request_parser::request_parser()
: state_(method_start)
@@ -24,90 +24,90 @@ void request_parser::reset()
state_ = method_start;
}
-boost::tribool request_parser::consume(request& req, char input)
+request_parser::result_type request_parser::consume(request& req, char input)
{
switch (state_)
{
case method_start:
if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
state_ = method;
req.method.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case method:
if (input == ' ')
{
state_ = uri;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
req.method.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case uri:
if (input == ' ')
{
state_ = http_version_h;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_ctl(input))
{
- return false;
+ return bad;
}
else
{
req.uri.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case http_version_h:
if (input == 'H')
{
state_ = http_version_t_1;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_t_1:
if (input == 'T')
{
state_ = http_version_t_2;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_t_2:
if (input == 'T')
{
state_ = http_version_p;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_p:
if (input == 'P')
{
state_ = http_version_slash;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_slash:
if (input == '/')
@@ -115,170 +115,170 @@ boost::tribool request_parser::consume(request& req, char input)
req.http_version_major = 0;
req.http_version_minor = 0;
state_ = http_version_major_start;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_major_start:
if (is_digit(input))
{
req.http_version_major = req.http_version_major * 10 + input - '0';
state_ = http_version_major;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_major:
if (input == '.')
{
state_ = http_version_minor_start;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_digit(input))
{
req.http_version_major = req.http_version_major * 10 + input - '0';
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_minor_start:
if (is_digit(input))
{
req.http_version_minor = req.http_version_minor * 10 + input - '0';
state_ = http_version_minor;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case http_version_minor:
if (input == '\r')
{
state_ = expecting_newline_1;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_digit(input))
{
req.http_version_minor = req.http_version_minor * 10 + input - '0';
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case expecting_newline_1:
if (input == '\n')
{
state_ = header_line_start;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case header_line_start:
if (input == '\r')
{
state_ = expecting_newline_3;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!req.headers.empty() && (input == ' ' || input == '\t'))
{
state_ = header_lws;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
req.headers.push_back(header());
req.headers.back().name.push_back(input);
state_ = header_name;
- return boost::indeterminate;
+ return indeterminate;
}
case header_lws:
if (input == '\r')
{
state_ = expecting_newline_2;
- return boost::indeterminate;
+ return indeterminate;
}
else if (input == ' ' || input == '\t')
{
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_ctl(input))
{
- return false;
+ return bad;
}
else
{
state_ = header_value;
req.headers.back().value.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case header_name:
if (input == ':')
{
state_ = space_before_header_value;
- return boost::indeterminate;
+ return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
- return false;
+ return bad;
}
else
{
req.headers.back().name.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case space_before_header_value:
if (input == ' ')
{
state_ = header_value;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case header_value:
if (input == '\r')
{
state_ = expecting_newline_2;
- return boost::indeterminate;
+ return indeterminate;
}
else if (is_ctl(input))
{
- return false;
+ return bad;
}
else
{
req.headers.back().value.push_back(input);
- return boost::indeterminate;
+ return indeterminate;
}
case expecting_newline_2:
if (input == '\n')
{
state_ = header_line_start;
- return boost::indeterminate;
+ return indeterminate;
}
else
{
- return false;
+ return bad;
}
case expecting_newline_3:
- return (input == '\n');
+ return (input == '\n') ? good : bad;
default:
- return false;
+ return bad;
}
}
@@ -311,5 +311,5 @@ bool request_parser::is_digit(int c)
return c >= '0' && c <= '9';
}
-} // namespace server
+} // namespace server4
} // namespace http
diff --git a/3rdparty/asio/src/examples/cpp03/http/server/request_parser.hpp b/3rdparty/asio/src/examples/cpp11/http/server4/request_parser.hpp
index 0c7e0f74368..4129c489b51 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server/request_parser.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/request_parser.hpp
@@ -2,20 +2,19 @@
// request_parser.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 HTTP_REQUEST_PARSER_HPP
-#define HTTP_REQUEST_PARSER_HPP
+#ifndef HTTP_SERVER4_REQUEST_PARSER_HPP
+#define HTTP_SERVER4_REQUEST_PARSER_HPP
-#include <boost/logic/tribool.hpp>
-#include <boost/tuple/tuple.hpp>
+#include <tuple>
namespace http {
-namespace server {
+namespace server4 {
struct request;
@@ -29,27 +28,29 @@ public:
/// Reset to initial parser state.
void reset();
- /// Parse some data. The tribool return value is true when a complete request
- /// has been parsed, false if the data is invalid, indeterminate when more
- /// data is required. The InputIterator return value indicates how much of the
- /// input has been consumed.
+ /// Result of parse.
+ enum result_type { good, bad, indeterminate };
+
+ /// Parse some data. The enum return value is good when a complete request has
+ /// been parsed, bad if the data is invalid, indeterminate when more data is
+ /// required. The InputIterator return value indicates how much of the input
+ /// has been consumed.
template <typename InputIterator>
- boost::tuple<boost::tribool, InputIterator> parse(request& req,
+ std::tuple<result_type, InputIterator> parse(request& req,
InputIterator begin, InputIterator end)
{
while (begin != end)
{
- boost::tribool result = consume(req, *begin++);
- if (result || !result)
- return boost::make_tuple(result, begin);
+ result_type result = consume(req, *begin++);
+ if (result == good || result == bad)
+ return std::make_tuple(result, begin);
}
- boost::tribool result = boost::indeterminate;
- return boost::make_tuple(result, begin);
+ return std::make_tuple(indeterminate, begin);
}
private:
/// Handle the next character of input.
- boost::tribool consume(request& req, char input);
+ result_type consume(request& req, char input);
/// Check if a byte is an HTTP character.
static bool is_char(int c);
@@ -89,7 +90,7 @@ private:
} state_;
};
-} // namespace server
+} // namespace server4
} // namespace http
-#endif // HTTP_REQUEST_PARSER_HPP
+#endif // HTTP_SERVER4_REQUEST_PARSER_HPP
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/server.cpp b/3rdparty/asio/src/examples/cpp11/http/server4/server.cpp
index c8abd2bddf5..9c75f75e982 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/server.cpp
@@ -2,7 +2,7 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,7 +17,7 @@ namespace server4 {
server::server(asio::io_context& io_context,
const std::string& address, const std::string& port,
- boost::function<void(const request&, reply&)> request_handler)
+ std::function<void(const request&, reply&)> request_handler)
: request_handler_(request_handler)
{
tcp::resolver resolver(io_context);
@@ -29,7 +29,7 @@ server::server(asio::io_context& io_context,
// Enable the pseudo-keywords reenter, yield and fork.
#include <asio/yield.hpp>
-void server::operator()(asio::error_code ec, std::size_t length)
+void server::operator()(std::error_code ec, std::size_t length)
{
// In this example we keep the error handling code in one place by
// hoisting it outside the coroutine. An alternative approach would be to
@@ -67,7 +67,7 @@ void server::operator()(asio::error_code ec, std::size_t length)
} while (is_parent());
// Create the objects needed to receive a request on the connection.
- buffer_.reset(new boost::array<char, 8192>);
+ buffer_.reset(new std::array<char, 8192>);
request_.reset(new request);
// Loop until a complete request (or an invalid one) has been received.
@@ -79,17 +79,17 @@ void server::operator()(asio::error_code ec, std::size_t length)
yield socket_->async_read_some(asio::buffer(*buffer_), *this);
// Parse the data we just received.
- boost::tie(valid_request_, boost::tuples::ignore)
+ std::tie(parse_result_, std::ignore)
= request_parser_.parse(*request_,
buffer_->data(), buffer_->data() + length);
// An indeterminate result means we need more data, so keep looping.
- } while (boost::indeterminate(valid_request_));
+ } while (parse_result_ == request_parser::indeterminate);
// Create the reply object that will be sent back to the client.
reply_.reset(new reply);
- if (valid_request_)
+ if (parse_result_ == request_parser::good)
{
// A valid request was received. Call the user-supplied function object
// to process the request and compose a reply.
diff --git a/3rdparty/asio/src/examples/cpp03/http/server4/server.hpp b/3rdparty/asio/src/examples/cpp11/http/server4/server.hpp
index e45cc7a3ca5..54d67832ba6 100644
--- a/3rdparty/asio/src/examples/cpp03/http/server4/server.hpp
+++ b/3rdparty/asio/src/examples/cpp11/http/server4/server.hpp
@@ -2,7 +2,7 @@
// server.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,10 +12,10 @@
#define HTTP_SERVER4_SERVER_HPP
#include <asio.hpp>
+#include <array>
+#include <functional>
+#include <memory>
#include <string>
-#include <boost/array.hpp>
-#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
#include "request_parser.hpp"
namespace http {
@@ -32,39 +32,39 @@ public:
/// serve up files from the given directory.
explicit server(asio::io_context& io_context,
const std::string& address, const std::string& port,
- boost::function<void(const request&, reply&)> request_handler);
+ std::function<void(const request&, reply&)> request_handler);
/// Perform work associated with the server.
void operator()(
- asio::error_code ec = asio::error_code(),
+ std::error_code ec = std::error_code(),
std::size_t length = 0);
private:
typedef asio::ip::tcp tcp;
/// The user-supplied handler for all incoming requests.
- boost::function<void(const request&, reply&)> request_handler_;
+ std::function<void(const request&, reply&)> request_handler_;
/// Acceptor used to listen for incoming connections.
- boost::shared_ptr<tcp::acceptor> acceptor_;
+ std::shared_ptr<tcp::acceptor> acceptor_;
/// The current connection from a client.
- boost::shared_ptr<tcp::socket> socket_;
+ std::shared_ptr<tcp::socket> socket_;
/// Buffer for incoming data.
- boost::shared_ptr<boost::array<char, 8192> > buffer_;
+ std::shared_ptr<std::array<char, 8192>> buffer_;
/// The incoming request.
- boost::shared_ptr<request> request_;
+ std::shared_ptr<request> request_;
/// Whether the request is valid or not.
- boost::tribool valid_request_;
+ request_parser::result_type parse_result_;
/// The parser for the incoming request.
request_parser request_parser_;
/// The reply to be sent back to the client.
- boost::shared_ptr<reply> reply_;
+ std::shared_ptr<reply> reply_;
};
} // namespace server4
diff --git a/3rdparty/asio/src/examples/cpp03/icmp/icmp_header.hpp b/3rdparty/asio/src/examples/cpp11/icmp/icmp_header.hpp
index 4f591341264..369511c6267 100644
--- a/3rdparty/asio/src/examples/cpp03/icmp/icmp_header.hpp
+++ b/3rdparty/asio/src/examples/cpp11/icmp/icmp_header.hpp
@@ -2,7 +2,7 @@
// icmp_header.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/icmp/ipv4_header.hpp b/3rdparty/asio/src/examples/cpp11/icmp/ipv4_header.hpp
index e9102af81a4..d296571938f 100644
--- a/3rdparty/asio/src/examples/cpp03/icmp/ipv4_header.hpp
+++ b/3rdparty/asio/src/examples/cpp11/icmp/ipv4_header.hpp
@@ -2,7 +2,7 @@
// ipv4_header.hpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/icmp/ping.cpp b/3rdparty/asio/src/examples/cpp11/icmp/ping.cpp
index 7830560e4ca..f179ea3461b 100644
--- a/3rdparty/asio/src/examples/cpp03/icmp/ping.cpp
+++ b/3rdparty/asio/src/examples/cpp11/icmp/ping.cpp
@@ -2,14 +2,13 @@
// ping.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <boost/bind/bind.hpp>
#include <istream>
#include <iostream>
#include <ostream>
@@ -59,7 +58,7 @@ private:
// Wait up to five seconds for a reply.
num_replies_ = 0;
timer_.expires_at(time_sent_ + chrono::seconds(5));
- timer_.async_wait(boost::bind(&pinger::handle_timeout, this));
+ timer_.async_wait(std::bind(&pinger::handle_timeout, this));
}
void handle_timeout()
@@ -69,7 +68,7 @@ private:
// Requests must be sent no less than one second apart.
timer_.expires_at(time_sent_ + chrono::seconds(1));
- timer_.async_wait(boost::bind(&pinger::start_send, this));
+ timer_.async_wait(std::bind(&pinger::start_send, this));
}
void start_receive()
@@ -79,7 +78,7 @@ private:
// Wait for a reply. We prepare the buffer to receive up to 64KB.
socket_.async_receive(reply_buffer_.prepare(65536),
- boost::bind(&pinger::handle_receive, this, boost::placeholders::_2));
+ std::bind(&pinger::handle_receive, this, std::placeholders::_2));
}
void handle_receive(std::size_t length)
diff --git a/3rdparty/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp b/3rdparty/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp
index 8435d6e46d6..533bfd06861 100644
--- a/3rdparty/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp
+++ b/3rdparty/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp
@@ -2,7 +2,7 @@
// prioritised_handlers.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -142,13 +142,13 @@ private:
//----------------------------------------------------------------------
-void high_priority_handler(const asio::error_code& /*ec*/,
+void high_priority_handler(const std::error_code& /*ec*/,
tcp::socket /*socket*/)
{
std::cout << "High priority handler\n";
}
-void middle_priority_handler(const asio::error_code& /*ec*/)
+void middle_priority_handler(const std::error_code& /*ec*/)
{
std::cout << "Middle priority handler\n";
}
diff --git a/3rdparty/asio/src/examples/cpp03/iostreams/daytime_client.cpp b/3rdparty/asio/src/examples/cpp11/iostreams/daytime_client.cpp
index 9ea5a592e52..0c8df192534 100644
--- a/3rdparty/asio/src/examples/cpp03/iostreams/daytime_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/iostreams/daytime_client.cpp
@@ -2,7 +2,7 @@
// daytime_client.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/iostreams/daytime_server.cpp b/3rdparty/asio/src/examples/cpp11/iostreams/daytime_server.cpp
index ff3009c30c9..1e644085ef1 100644
--- a/3rdparty/asio/src/examples/cpp03/iostreams/daytime_server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/iostreams/daytime_server.cpp
@@ -2,7 +2,7 @@
// daytime_server.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -34,7 +34,7 @@ int main()
for (;;)
{
tcp::iostream stream;
- asio::error_code ec;
+ std::error_code ec;
acceptor.accept(stream.socket(), ec);
if (!ec)
{
diff --git a/3rdparty/asio/src/examples/cpp11/iostreams/http_client.cpp b/3rdparty/asio/src/examples/cpp11/iostreams/http_client.cpp
index cd46733a397..313f177bce4 100644
--- a/3rdparty/asio/src/examples/cpp11/iostreams/http_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/iostreams/http_client.cpp
@@ -2,7 +2,7 @@
// http_client.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/local/connect_pair.cpp b/3rdparty/asio/src/examples/cpp11/local/connect_pair.cpp
index 2571ff93360..50d0a06712c 100644
--- a/3rdparty/asio/src/examples/cpp11/local/connect_pair.cpp
+++ b/3rdparty/asio/src/examples/cpp11/local/connect_pair.cpp
@@ -2,7 +2,7 @@
// connect_pair.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -44,7 +44,7 @@ private:
}
else
{
- throw asio::system_error(ec);
+ throw std::system_error(ec);
}
});
}
@@ -61,7 +61,7 @@ private:
}
else
{
- throw asio::system_error(ec);
+ throw std::system_error(ec);
}
});
}
diff --git a/3rdparty/asio/src/examples/cpp11/local/fd_passing_stream_client.cpp b/3rdparty/asio/src/examples/cpp11/local/fd_passing_stream_client.cpp
new file mode 100644
index 00000000000..229509f1c14
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/local/fd_passing_stream_client.cpp
@@ -0,0 +1,102 @@
+//
+// fd_passing_stream_client.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2021 Heiko Hund (heiko at openvpn dot net)
+//
+// 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)
+//
+
+// Demonstrates how to pass file descriptors between processes with Asio.
+// The client send a file name (destfile) to the server. The server opens
+// the file and the associated file descriptor back to the client.
+
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include "asio.hpp"
+
+#if defined(ASIO_HAS_LOCAL_SOCKETS)
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+using asio::local::stream_protocol;
+
+constexpr std::size_t max_length = 1024;
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: fd_passing_stream_client <serversocket>\n";
+ return 1;
+ }
+
+ asio::io_context io_context;
+
+ stream_protocol::socket s(io_context);
+ s.connect(stream_protocol::endpoint(argv[1]));
+
+ std::cout << "Enter path to write to: ";
+ char request[max_length];
+ std::cin.getline(request, max_length);
+ size_t request_length = std::strlen(request);
+ asio::write(s, asio::buffer(request, request_length));
+
+ char reply[max_length];
+ struct msghdr msg = {};
+ struct iovec iov = { reply, sizeof(reply) };
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+
+ union
+ {
+ struct cmsghdr align;
+ char buf[CMSG_SPACE(sizeof(int))];
+ } cmsgu;
+ msg.msg_control = cmsgu.buf;
+ msg.msg_controllen = sizeof(cmsgu.buf);
+
+ ::recvmsg(s.native_handle(), &msg, 0);
+
+ int fd = -1;
+ struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg);
+ while (cmsg != NULL)
+ {
+ if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS)
+ {
+ std::memcpy(&fd, CMSG_DATA(cmsg), sizeof(fd));
+ break;
+ }
+ cmsg = CMSG_NXTHDR(&msg, cmsg);
+ }
+
+ if (fd != -1)
+ {
+ std::cout << "File descriptor received is: " << fd << "\n";
+ FILE* f(::fdopen(fd, "w+"));
+ if (f)
+ {
+ ::fprintf(f, "stream_client writing to received fd #%d\n", fd);
+ ::fclose(f);
+ }
+ else
+ ::close(fd);
+ }
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}
+
+#else // defined(ASIO_HAS_LOCAL_SOCKETS)
+# error Local sockets not available on this platform.
+#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
diff --git a/3rdparty/asio/src/examples/cpp11/local/fd_passing_stream_server.cpp b/3rdparty/asio/src/examples/cpp11/local/fd_passing_stream_server.cpp
new file mode 100644
index 00000000000..5082185e75c
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/local/fd_passing_stream_server.cpp
@@ -0,0 +1,160 @@
+//
+// fd_passing_stream_server.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2021 Heiko Hund (heiko at openvpn dot net)
+//
+// 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)
+//
+
+// Demonstrates how to pass file descriptors between processes with Asio.
+// The client sends a file name to the server. The server opens the file and
+// passes the associated file descriptor back to the client.
+
+#include <array>
+#include <cstdio>
+#include <cassert>
+#include <iostream>
+#include <memory>
+#include "asio.hpp"
+
+#if defined(ASIO_HAS_LOCAL_SOCKETS)
+
+using asio::local::stream_protocol;
+
+class session
+ : public std::enable_shared_from_this<session>
+{
+public:
+ session(stream_protocol::socket sock)
+ : socket_(std::move(sock))
+ {
+ }
+
+ void start()
+ {
+ do_read();
+ }
+
+private:
+ void do_read()
+ {
+ auto self(shared_from_this());
+ socket_.async_read_some(asio::buffer(data_),
+ [this, self](std::error_code ec, std::size_t length)
+ {
+ if (ec)
+ return;
+
+ assert(length < data_.size());
+ data_[length] = 0;
+ do_write(data_.data());
+ });
+ }
+
+ void do_write(const char* filename)
+ {
+ auto self(shared_from_this());
+ socket_.async_wait(stream_protocol::socket::wait_write,
+ [this, self, filename](std::error_code ec)
+ {
+ if (ec)
+ return;
+
+ FILE* f(::fopen(filename, "w+"));
+ if (!f)
+ return;
+
+ struct msghdr msg = {};
+ char buf[] = { 0 };
+ struct iovec iov = { buf, sizeof(buf) };
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+
+ union
+ {
+ struct cmsghdr align;
+ char buf[CMSG_SPACE(sizeof(int))];
+ } cmsgu;
+ msg.msg_control = cmsgu.buf;
+ msg.msg_controllen = sizeof(cmsgu.buf);
+
+ struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg);
+ cmsg->cmsg_len = CMSG_LEN(sizeof(int));
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SCM_RIGHTS;
+ int fd = ::fileno(f);
+ std::memcpy(CMSG_DATA(cmsg), &fd, sizeof(int));
+
+ ssize_t s(::sendmsg(socket_.native_handle(), &msg, 0));
+ ::fclose(f);
+ if (s != -1)
+ do_read();
+ });
+ }
+
+ // The socket used to communicate with the client.
+ stream_protocol::socket socket_;
+
+ // Buffer used to store data received from the client.
+ std::array<char, 1024> data_;
+};
+
+class server
+{
+public:
+ server(asio::io_context& io_context, const std::string& file)
+ : acceptor_(io_context, stream_protocol::endpoint(file))
+ {
+ do_accept();
+ }
+
+private:
+ void do_accept()
+ {
+ acceptor_.async_accept(
+ [this](std::error_code ec, stream_protocol::socket socket)
+ {
+ if (!ec)
+ {
+ std::make_shared<session>(std::move(socket))->start();
+ }
+
+ do_accept();
+ });
+ }
+
+ stream_protocol::acceptor acceptor_;
+};
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: fd_passing_stream_server <socketfile>\n";
+ std::cerr << "*** WARNING: existing file is removed ***\n";
+ return 1;
+ }
+
+ asio::io_context io_context;
+
+ std::remove(argv[1]);
+ server s(io_context, argv[1]);
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}
+
+#else // defined(ASIO_HAS_LOCAL_SOCKETS)
+# error Local sockets not available on this platform.
+#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
diff --git a/3rdparty/asio/src/examples/cpp11/local/iostream_client.cpp b/3rdparty/asio/src/examples/cpp11/local/iostream_client.cpp
index c7549278124..932f29d3459 100644
--- a/3rdparty/asio/src/examples/cpp11/local/iostream_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/local/iostream_client.cpp
@@ -2,7 +2,7 @@
// stream_client.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/local/stream_client.cpp b/3rdparty/asio/src/examples/cpp11/local/stream_client.cpp
index 19806c92510..32f408933ca 100644
--- a/3rdparty/asio/src/examples/cpp11/local/stream_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/local/stream_client.cpp
@@ -2,7 +2,7 @@
// stream_client.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/local/stream_server.cpp b/3rdparty/asio/src/examples/cpp11/local/stream_server.cpp
index 6b590fbfbf9..85cd58f87d6 100644
--- a/3rdparty/asio/src/examples/cpp11/local/stream_server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/local/stream_server.cpp
@@ -2,7 +2,7 @@
// stream_server.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/multicast/receiver.cpp b/3rdparty/asio/src/examples/cpp11/multicast/receiver.cpp
index 9cb032c4148..5973bede5bb 100644
--- a/3rdparty/asio/src/examples/cpp11/multicast/receiver.cpp
+++ b/3rdparty/asio/src/examples/cpp11/multicast/receiver.cpp
@@ -2,7 +2,7 @@
// receiver.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/multicast/sender.cpp b/3rdparty/asio/src/examples/cpp11/multicast/sender.cpp
index cb70d46ccd4..dc3cf7fd0e7 100644
--- a/3rdparty/asio/src/examples/cpp11/multicast/sender.cpp
+++ b/3rdparty/asio/src/examples/cpp11/multicast/sender.cpp
@@ -2,7 +2,7 @@
// sender.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/nonblocking/third_party_lib.cpp b/3rdparty/asio/src/examples/cpp11/nonblocking/third_party_lib.cpp
index 5ce61536198..7239a598532 100644
--- a/3rdparty/asio/src/examples/cpp11/nonblocking/third_party_lib.cpp
+++ b/3rdparty/asio/src/examples/cpp11/nonblocking/third_party_lib.cpp
@@ -2,7 +2,7 @@
// third_party_lib.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/operations/composed_1.cpp b/3rdparty/asio/src/examples/cpp11/operations/composed_1.cpp
index cfec43c8e83..054dbdbbc88 100644
--- a/3rdparty/asio/src/examples/cpp11/operations/composed_1.cpp
+++ b/3rdparty/asio/src/examples/cpp11/operations/composed_1.cpp
@@ -2,12 +2,13 @@
// composed_1.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -31,14 +32,25 @@ template <typename CompletionToken>
auto async_write_message(tcp::socket& socket,
const char* message, CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is void. However,
- // when the completion token is asio::yield_context (used for stackful
- // coroutines) the return type would be std::size_t, and when the completion
- // token is asio::use_future it would be std::future<std::size_t>.
- -> typename asio::async_result<
- typename std::decay<CompletionToken>::type,
- void(std::error_code, std::size_t)>::return_type
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is void.
+ // However, when the completion token is asio::yield_context (used for
+ // stackful coroutines) the return type would be std::size_t, and when the
+ // completion token is asio::use_future it would be std::future<std::size_t>.
+ // When the completion token is asio::deferred, the return type differs for
+ // each asynchronous operation.
+ //
+ // In this example we are trivially delegating to an underlying asynchronous
+ // operation, so we can deduce the return type from that.
+ -> decltype(
+ asio::async_write(socket,
+ asio::buffer(message, std::strlen(message)),
+ std::forward<CompletionToken>(token)))
{
// When delegating to the underlying operation we must take care to perfectly
// forward the completion token. This ensures that our operation works
@@ -77,6 +89,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation and its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket,
+ "Testing deferred\r\n", asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error, std::size_t n)
+ {
+ if (!error)
+ {
+ std::cout << n << " bytes transferred\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -109,5 +154,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp11/operations/composed_2.cpp b/3rdparty/asio/src/examples/cpp11/operations/composed_2.cpp
index 62ddf8d9089..306d4b343b4 100644
--- a/3rdparty/asio/src/examples/cpp11/operations/composed_2.cpp
+++ b/3rdparty/asio/src/examples/cpp11/operations/composed_2.cpp
@@ -2,12 +2,13 @@
// composed_2.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -20,6 +21,10 @@
using asio::ip::tcp;
+// NOTE: This example requires the new asio::async_initiate function. For
+// an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
//------------------------------------------------------------------------------
// This next simplest example of a composed asynchronous operation involves
@@ -28,43 +33,102 @@ using asio::ip::tcp;
// asynchronous operation requirements are met by delegating responsibility to
// the underlying operations.
+// In addition to determining the mechanism by which an asynchronous operation
+// delivers its result, a completion token also determines the time when the
+// operation commences. For example, when the completion token is a simple
+// callback the operation commences before the initiating function returns.
+// However, if the completion token's delivery mechanism uses a future, we
+// might instead want to defer initiation of the operation until the returned
+// future object is waited upon.
+//
+// To enable this, when implementing an asynchronous operation we must package
+// the initiation step as a function object.
+struct async_write_message_initiation
+{
+ // The initiation function object's call operator is passed the concrete
+ // completion handler produced by the completion token. This completion
+ // handler matches the asynchronous operation's completion handler signature,
+ // which in this example is:
+ //
+ // void(std::error_code error, std::size_t)
+ //
+ // The initiation function object also receives any additional arguments
+ // required to start the operation. (Note: We could have instead passed these
+ // arguments as members in the initiaton function object. However, we should
+ // prefer to propagate them as function call arguments as this allows the
+ // completion token to optimise how they are passed. For example, a lazy
+ // future which defers initiation would need to make a decay-copy of the
+ // arguments, but when using a simple callback the arguments can be trivially
+ // forwarded straight through.)
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& completion_handler, tcp::socket& socket,
+ const char* message, bool allow_partial_write) const
+ {
+ if (allow_partial_write)
+ {
+ // When delegating to an underlying operation we must take care to
+ // perfectly forward the completion handler. This ensures that our
+ // operation works correctly with move-only function objects as
+ // callbacks.
+ return socket.async_write_some(
+ asio::buffer(message, std::strlen(message)),
+ std::forward<CompletionHandler>(completion_handler));
+ }
+ else
+ {
+ // As above, we must perfectly forward the completion handler when calling
+ // the alternate underlying operation.
+ return asio::async_write(socket,
+ asio::buffer(message, std::strlen(message)),
+ std::forward<CompletionHandler>(completion_handler));
+ }
+ }
+};
+
template <typename CompletionToken>
auto async_write_message(tcp::socket& socket,
const char* message, bool allow_partial_write,
CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is void. However,
- // when the completion token is asio::yield_context (used for stackful
- // coroutines) the return type would be std::size_t, and when the completion
- // token is asio::use_future it would be std::future<std::size_t>.
- -> typename asio::async_result<
- typename std::decay<CompletionToken>::type,
- void(std::error_code, std::size_t)>::return_type
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is void.
+ // However, when the completion token is asio::yield_context (used for
+ // stackful coroutines) the return type would be std::size_t, and when the
+ // completion token is asio::use_future it would be std::future<std::size_t>.
+ // When the completion token is asio::deferred, the return type differs for
+ // each asynchronous operation.
+ //
+ // In C++11 we deduce the type from the call to asio::async_initiate.
+ -> decltype(
+ asio::async_initiate<
+ CompletionToken, void(std::error_code, std::size_t)>(
+ async_write_message_initiation(),
+ token, std::ref(socket), message, allow_partial_write))
{
- // As the return type of the initiating function is deduced solely from the
- // CompletionToken and completion signature, we know that two different
- // asynchronous operations having the same completion signature will produce
- // the same return type, when passed the same CompletionToken. This allows us
- // to trivially delegate to alternate implementations.
- if (allow_partial_write)
- {
- // When delegating to an underlying operation we must take care to
- // perfectly forward the completion token. This ensures that our operation
- // works correctly with move-only function objects as callbacks, as well as
- // other completion token types.
- return socket.async_write_some(
- asio::buffer(message, std::strlen(message)),
- std::forward<CompletionToken>(token));
- }
- else
- {
- // As above, we must perfectly forward the completion token when calling
- // the alternate underlying operation.
- return asio::async_write(socket,
- asio::buffer(message, std::strlen(message)),
- std::forward<CompletionToken>(token));
- }
+ // The asio::async_initiate function takes:
+ //
+ // - our initiation function object,
+ // - the completion token,
+ // - the completion handler signature, and
+ // - any additional arguments we need to initiate the operation.
+ //
+ // It then asks the completion token to create a completion handler (i.e. a
+ // callback) with the specified signature, and invoke the initiation function
+ // object with this completion handler as well as the additional arguments.
+ // The return value of async_initiate is the result of our operation's
+ // initiating function.
+ //
+ // Note that we wrap non-const reference arguments in std::reference_wrapper
+ // to prevent incorrect decay-copies of these objects.
+ return asio::async_initiate<
+ CompletionToken, void(std::error_code, std::size_t)>(
+ async_write_message_initiation(),
+ token, std::ref(socket), message, allow_partial_write);
}
//------------------------------------------------------------------------------
@@ -95,6 +159,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation and its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket,
+ "Testing deferred\r\n", false, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error, std::size_t n)
+ {
+ if (!error)
+ {
+ std::cout << n << " bytes transferred\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -127,5 +224,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp11/operations/composed_3.cpp b/3rdparty/asio/src/examples/cpp11/operations/composed_3.cpp
index c821041336f..e0b5ddca85b 100644
--- a/3rdparty/asio/src/examples/cpp11/operations/composed_3.cpp
+++ b/3rdparty/asio/src/examples/cpp11/operations/composed_3.cpp
@@ -2,13 +2,14 @@
// composed_3.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/bind_executor.hpp>
+#include <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -96,15 +97,26 @@ template <typename CompletionToken>
auto async_write_message(tcp::socket& socket,
const char* message, CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
- -> typename asio::async_result<
- typename std::decay<CompletionToken>::type,
- void(std::error_code)>::return_type
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++11 we deduce the type from the call to asio::async_initiate.
+ -> decltype(
+ asio::async_initiate<
+ CompletionToken, void(std::error_code)>(
+ async_write_message_initiation(),
+ token, std::ref(socket), message))
{
// The asio::async_initiate function takes:
//
@@ -155,6 +167,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation and its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket,
+ "Testing deferred\r\n", asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -188,5 +233,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp11/operations/composed_4.cpp b/3rdparty/asio/src/examples/cpp11/operations/composed_4.cpp
index e4c6264b625..29fe26966e5 100644
--- a/3rdparty/asio/src/examples/cpp11/operations/composed_4.cpp
+++ b/3rdparty/asio/src/examples/cpp11/operations/composed_4.cpp
@@ -2,13 +2,14 @@
// composed_4.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/bind_executor.hpp>
+#include <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -112,15 +113,26 @@ template <typename CompletionToken>
auto async_write_message(tcp::socket& socket,
const char* message, CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
- -> typename asio::async_result<
- typename std::decay<CompletionToken>::type,
- void(std::error_code)>::return_type
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++11 we deduce the type from the call to asio::async_initiate.
+ -> decltype(
+ asio::async_initiate<
+ CompletionToken, void(std::error_code)>(
+ async_write_message_initiation(),
+ token, std::ref(socket), message))
{
// The asio::async_initiate function takes:
//
@@ -171,6 +183,38 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation and its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket, "", asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -203,5 +247,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp11/operations/composed_5.cpp b/3rdparty/asio/src/examples/cpp11/operations/composed_5.cpp
index 9f7901da512..06a7af40f41 100644
--- a/3rdparty/asio/src/examples/cpp11/operations/composed_5.cpp
+++ b/3rdparty/asio/src/examples/cpp11/operations/composed_5.cpp
@@ -2,12 +2,13 @@
// composed_5.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -142,15 +143,26 @@ template <typename T, typename CompletionToken>
auto async_write_message(tcp::socket& socket,
const T& message, CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
- -> typename asio::async_result<
- typename std::decay<CompletionToken>::type,
- void(std::error_code)>::return_type
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++11 we deduce the type from the call to asio::async_initiate.
+ -> decltype(
+ asio::async_initiate<
+ CompletionToken, void(std::error_code)>(
+ async_write_message_initiation(), token,
+ std::ref(socket), std::declval<std::unique_ptr<std::string>>()))
{
// Encode the message and copy it into an allocated buffer. The buffer will
// be maintained for the lifetime of the asynchronous operation.
@@ -207,6 +219,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation and its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket,
+ std::string("abcdef"), asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -239,5 +284,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp11/operations/composed_6.cpp b/3rdparty/asio/src/examples/cpp11/operations/composed_6.cpp
index b55a553d07a..b948758d83a 100644
--- a/3rdparty/asio/src/examples/cpp11/operations/composed_6.cpp
+++ b/3rdparty/asio/src/examples/cpp11/operations/composed_6.cpp
@@ -2,12 +2,13 @@
// composed_6.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/deferred.hpp>
#include <asio/executor_work_guard.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
@@ -97,9 +98,7 @@ struct async_write_message_initiation
// As our composed operation performs multiple underlying I/O operations,
// we should maintain a work object against the I/O executor. This tells
// the I/O executor that there is still more work to come in the future.
- typename std::decay<decltype(asio::prefer(
- std::declval<tcp::socket::executor_type>(),
- asio::execution::outstanding_work.tracked))>::type io_work_;
+ asio::executor_work_guard<tcp::socket::executor_type> io_work_;
// The user-supplied completion handler, called once only on completion
// of the entire composed operation.
@@ -136,6 +135,9 @@ struct async_write_message_initiation
// This point is reached only on completion of the entire composed
// operation.
+ // We no longer have any future work coming for the I/O executor.
+ io_work_.reset();
+
// Deallocate the encoded message before calling the user-supplied
// completion handler.
encoded_message_.reset();
@@ -186,8 +188,7 @@ struct async_write_message_initiation
socket, std::move(encoded_message),
repeat_count, std::move(delay_timer),
intermediate_completion_handler::starting,
- asio::prefer(socket.get_executor(),
- asio::execution::outstanding_work.tracked),
+ asio::make_work_guard(socket.get_executor()),
std::forward<CompletionHandler>(completion_handler)});
}
};
@@ -197,15 +198,27 @@ auto async_write_messages(tcp::socket& socket,
const T& message, std::size_t repeat_count,
CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
- -> typename asio::async_result<
- typename std::decay<CompletionToken>::type,
- void(std::error_code)>::return_type
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++11 we deduce the type from the call to asio::async_initiate.
+ -> decltype(
+ asio::async_initiate<
+ CompletionToken, void(std::error_code)>(
+ async_write_message_initiation(), token, std::ref(socket),
+ std::declval<std::unique_ptr<std::string>>(), repeat_count,
+ std::declval<std::unique_ptr<asio::steady_timer>>()))
{
// Encode the message and copy it into an allocated buffer. The buffer will
// be maintained for the lifetime of the composed asynchronous operation.
@@ -266,6 +279,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation and its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_messages(socket,
+ "Testing deferred\r\n", 5, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -298,5 +344,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp11/operations/composed_7.cpp b/3rdparty/asio/src/examples/cpp11/operations/composed_7.cpp
index 92c8e321c01..8eb83dc7679 100644
--- a/3rdparty/asio/src/examples/cpp11/operations/composed_7.cpp
+++ b/3rdparty/asio/src/examples/cpp11/operations/composed_7.cpp
@@ -2,13 +2,14 @@
// composed_7.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/compose.hpp>
+#include <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/steady_timer.hpp>
@@ -118,15 +119,26 @@ auto async_write_messages(tcp::socket& socket,
const T& message, std::size_t repeat_count,
CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
- -> typename asio::async_result<
- typename std::decay<CompletionToken>::type,
- void(std::error_code)>::return_type
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++11 we deduce the type from the call to asio::async_compose.
+ -> decltype(
+ asio::async_compose<
+ CompletionToken, void(std::error_code)>(
+ std::declval<async_write_messages_implementation>(),
+ token, socket))
{
// Encode the message and copy it into an allocated buffer. The buffer will
// be maintained for the lifetime of the composed asynchronous operation.
@@ -186,6 +198,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation and its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_messages(socket,
+ "Testing deferred\r\n", 5, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -218,5 +263,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp11/operations/composed_8.cpp b/3rdparty/asio/src/examples/cpp11/operations/composed_8.cpp
index 7c24c7251c6..ce22a5b418d 100644
--- a/3rdparty/asio/src/examples/cpp11/operations/composed_8.cpp
+++ b/3rdparty/asio/src/examples/cpp11/operations/composed_8.cpp
@@ -2,13 +2,14 @@
// composed_8.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/compose.hpp>
+#include <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/steady_timer.hpp>
@@ -114,15 +115,26 @@ auto async_write_messages(tcp::socket& socket,
const T& message, std::size_t repeat_count,
CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
- -> typename asio::async_result<
- typename std::decay<CompletionToken>::type,
- void(std::error_code)>::return_type
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++11 we deduce the type from the call to asio::async_compose.
+ -> decltype(
+ asio::async_compose<
+ CompletionToken, void(std::error_code)>(
+ std::declval<async_write_messages_implementation>(),
+ token, socket))
{
// Encode the message and copy it into an allocated buffer. The buffer will
// be maintained for the lifetime of the composed asynchronous operation.
@@ -181,6 +193,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation and its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_messages(socket,
+ "Testing deferred\r\n", 5, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -213,5 +258,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp11/parallel_group/ranged_wait_for_all.cpp b/3rdparty/asio/src/examples/cpp11/parallel_group/ranged_wait_for_all.cpp
new file mode 100644
index 00000000000..18772884072
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/parallel_group/ranged_wait_for_all.cpp
@@ -0,0 +1,70 @@
+//
+// ranged_wait_for_all.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/parallel_group.hpp>
+#include <iostream>
+#include <vector>
+
+#ifdef ASIO_HAS_POSIX_STREAM_DESCRIPTOR
+
+int main()
+{
+ asio::io_context ctx;
+
+ asio::posix::stream_descriptor out(ctx, ::dup(STDOUT_FILENO));
+ asio::posix::stream_descriptor err(ctx, ::dup(STDERR_FILENO));
+
+ using op_type = decltype(
+ out.async_write_some(
+ asio::buffer("", 0),
+ asio::deferred
+ )
+ );
+
+ std::vector<op_type> ops;
+
+ ops.push_back(
+ out.async_write_some(
+ asio::buffer("first\r\n", 7),
+ asio::deferred
+ )
+ );
+
+ ops.push_back(
+ err.async_write_some(
+ asio::buffer("second\r\n", 8),
+ asio::deferred
+ )
+ );
+
+ asio::experimental::make_parallel_group(ops).async_wait(
+ asio::experimental::wait_for_all(),
+ [](
+ std::vector<std::size_t> completion_order,
+ std::vector<std::error_code> ec,
+ std::vector<std::size_t> n
+ )
+ {
+ for (std::size_t i = 0; i < completion_order.size(); ++i)
+ {
+ std::size_t idx = completion_order[i];
+ std::cout << "operation " << idx << " finished: ";
+ std::cout << ec[idx] << ", " << n[idx] << "\n";
+ }
+ }
+ );
+
+ ctx.run();
+}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_all.cpp b/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_all.cpp
new file mode 100644
index 00000000000..a489a2966da
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_all.cpp
@@ -0,0 +1,62 @@
+//
+// wait_for_all.cpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/deferred.hpp>
+#include <asio/experimental/parallel_group.hpp>
+#include <iostream>
+
+#ifdef ASIO_HAS_POSIX_STREAM_DESCRIPTOR
+
+int main()
+{
+ asio::io_context ctx;
+
+ asio::posix::stream_descriptor in(ctx, ::dup(STDIN_FILENO));
+ asio::steady_timer timer(ctx, std::chrono::seconds(5));
+
+ char data[1024];
+
+ asio::experimental::make_parallel_group(
+ in.async_read_some(
+ asio::buffer(data),
+ asio::deferred),
+ timer.async_wait(
+ asio::deferred)
+ ).async_wait(
+ asio::experimental::wait_for_all(),
+ [](
+ std::array<std::size_t, 2> completion_order,
+ std::error_code ec1, std::size_t n1,
+ std::error_code ec2
+ )
+ {
+ switch (completion_order[0])
+ {
+ case 0:
+ {
+ std::cout << "descriptor finished: " << ec1 << ", " << n1 << "\n";
+ }
+ break;
+ case 1:
+ {
+ std::cout << "timer finished: " << ec2 << "\n";
+ }
+ break;
+ }
+ }
+ );
+
+ ctx.run();
+}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one.cpp b/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one.cpp
new file mode 100644
index 00000000000..499684af69f
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one.cpp
@@ -0,0 +1,62 @@
+//
+// wait_for_one.cpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/deferred.hpp>
+#include <asio/experimental/parallel_group.hpp>
+#include <iostream>
+
+#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+
+int main()
+{
+ asio::io_context ctx;
+
+ asio::posix::stream_descriptor in(ctx, ::dup(STDIN_FILENO));
+ asio::steady_timer timer(ctx, std::chrono::seconds(5));
+
+ char data[1024];
+
+ asio::experimental::make_parallel_group(
+ in.async_read_some(
+ asio::buffer(data),
+ asio::deferred),
+ timer.async_wait(
+ asio::deferred)
+ ).async_wait(
+ asio::experimental::wait_for_one(),
+ [](
+ std::array<std::size_t, 2> completion_order,
+ std::error_code ec1, std::size_t n1,
+ std::error_code ec2
+ )
+ {
+ switch (completion_order[0])
+ {
+ case 0:
+ {
+ std::cout << "descriptor finished: " << ec1 << ", " << n1 << "\n";
+ }
+ break;
+ case 1:
+ {
+ std::cout << "timer finished: " << ec2 << "\n";
+ }
+ break;
+ }
+ }
+ );
+
+ ctx.run();
+}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one_error.cpp b/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one_error.cpp
new file mode 100644
index 00000000000..f6e52d6ca0e
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one_error.cpp
@@ -0,0 +1,62 @@
+//
+// wait_for_one_error.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/deferred.hpp>
+#include <asio/experimental/parallel_group.hpp>
+#include <iostream>
+
+#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+
+int main()
+{
+ asio::io_context ctx;
+
+ asio::posix::stream_descriptor in(ctx, ::dup(STDIN_FILENO));
+ asio::steady_timer timer(ctx, std::chrono::seconds(5));
+
+ char data[1024];
+
+ asio::experimental::make_parallel_group(
+ in.async_read_some(
+ asio::buffer(data),
+ asio::deferred),
+ timer.async_wait(
+ asio::deferred)
+ ).async_wait(
+ asio::experimental::wait_for_one_error(),
+ [](
+ std::array<std::size_t, 2> completion_order,
+ std::error_code ec1, std::size_t n1,
+ std::error_code ec2
+ )
+ {
+ switch (completion_order[0])
+ {
+ case 0:
+ {
+ std::cout << "descriptor finished: " << ec1 << ", " << n1 << "\n";
+ }
+ break;
+ case 1:
+ {
+ std::cout << "timer finished: " << ec2 << "\n";
+ }
+ break;
+ }
+ }
+ );
+
+ ctx.run();
+}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one_success.cpp b/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one_success.cpp
new file mode 100644
index 00000000000..16fd2130ab8
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/parallel_group/wait_for_one_success.cpp
@@ -0,0 +1,62 @@
+//
+// wait_for_one_error.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/deferred.hpp>
+#include <asio/experimental/parallel_group.hpp>
+#include <iostream>
+
+#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+
+int main()
+{
+ asio::io_context ctx;
+
+ asio::posix::stream_descriptor in(ctx, ::dup(STDIN_FILENO));
+ asio::steady_timer timer(ctx, std::chrono::seconds(5));
+
+ char data[1024];
+
+ asio::experimental::make_parallel_group(
+ in.async_read_some(
+ asio::buffer(data),
+ asio::deferred),
+ timer.async_wait(
+ asio::deferred)
+ ).async_wait(
+ asio::experimental::wait_for_one_success(),
+ [](
+ std::array<std::size_t, 2> completion_order,
+ std::error_code ec1, std::size_t n1,
+ std::error_code ec2
+ )
+ {
+ switch (completion_order[0])
+ {
+ case 0:
+ {
+ std::cout << "descriptor finished: " << ec1 << ", " << n1 << "\n";
+ }
+ break;
+ case 1:
+ {
+ std::cout << "timer finished: " << ec2 << "\n";
+ }
+ break;
+ }
+ }
+ );
+
+ ctx.run();
+}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp03/porthopper/client.cpp b/3rdparty/asio/src/examples/cpp11/porthopper/client.cpp
index 19b2fbfe499..e0936128d72 100644
--- a/3rdparty/asio/src/examples/cpp03/porthopper/client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/porthopper/client.cpp
@@ -2,25 +2,22 @@
// client.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <boost/lambda/lambda.hpp>
-#include <boost/lambda/bind.hpp>
-#include <boost/lambda/if.hpp>
-#include <boost/shared_ptr.hpp>
#include <algorithm>
#include <cstdlib>
#include <exception>
#include <iostream>
+#include <memory>
#include <string>
+#include <utility>
#include "protocol.hpp"
-using namespace boost;
using asio::ip::tcp;
using asio::ip::udp;
@@ -48,11 +45,10 @@ int main(int argc, char* argv[])
control_socket.connect(remote_endpoint);
// Create a datagram socket to receive data from the server.
- boost::shared_ptr<udp::socket> data_socket(
- new udp::socket(io_context, udp::endpoint(udp::v4(), 0)));
+ udp::socket data_socket(io_context, udp::endpoint(udp::v4(), 0));
// Determine what port we will receive data on.
- udp::endpoint data_endpoint = data_socket->local_endpoint();
+ udp::endpoint data_endpoint = data_socket.local_endpoint();
// Ask the server to start sending us data.
control_request start = control_request::start(data_endpoint.port());
@@ -66,7 +62,7 @@ int main(int argc, char* argv[])
{
// Receive a frame from the server.
frame f;
- data_socket->receive(f.to_buffers(), 0);
+ data_socket.receive(f.to_buffers(), 0);
if (f.number() > last_frame_number)
{
last_frame_number = f.number();
@@ -80,20 +76,20 @@ int main(int argc, char* argv[])
std::cout << " Starting renegotiation";
// Create the new data socket.
- boost::shared_ptr<udp::socket> new_data_socket(
- new udp::socket(io_context, udp::endpoint(udp::v4(), 0)));
+ udp::socket new_data_socket(io_context, udp::endpoint(udp::v4(), 0));
// Determine the new port we will use to receive data.
- udp::endpoint new_data_endpoint = new_data_socket->local_endpoint();
+ udp::endpoint new_data_endpoint = new_data_socket.local_endpoint();
// Ask the server to switch over to the new port.
control_request change = control_request::change(
data_endpoint.port(), new_data_endpoint.port());
- asio::error_code control_result;
+ std::error_code control_result;
asio::async_write(control_socket, change.to_buffers(),
- (
- lambda::var(control_result) = lambda::_1
- ));
+ [&](std::error_code ec, std::size_t /*length*/)
+ {
+ control_result = ec;
+ });
// Try to receive a frame from the server on the new data socket. If we
// successfully receive a frame on this new data socket we can consider
@@ -101,20 +97,19 @@ int main(int argc, char* argv[])
// socket, which will cause any outstanding receive operation on it to be
// cancelled.
frame f1;
- asio::error_code new_data_socket_result;
- new_data_socket->async_receive(f1.to_buffers(),
- (
- // Note: lambda::_1 is the first argument to the callback handler,
- // which in this case is the error code for the operation.
- lambda::var(new_data_socket_result) = lambda::_1,
- lambda::if_(!lambda::_1)
- [
+ std::error_code new_data_socket_result;
+ new_data_socket.async_receive(f1.to_buffers(),
+ [&](std::error_code ec, std::size_t /*length*/)
+ {
+ new_data_socket_result = ec;
+ if (!ec)
+ {
// We have successfully received a frame on the new data socket,
// so we can close the old data socket. This will cancel any
// outstanding receive operation on the old data socket.
- lambda::var(data_socket) = boost::shared_ptr<udp::socket>()
- ]
- ));
+ data_socket.close();
+ }
+ });
// This loop will continue until we have successfully completed the
// renegotiation (i.e. received a frame on the new data socket), or some
@@ -130,18 +125,19 @@ int main(int argc, char* argv[])
// complete.
frame f2;
done = true; // Let's be optimistic.
- if (data_socket) // Might have been closed by new_data_socket's handler.
+ if (data_socket.is_open()) // May have been closed by receive handler.
{
- data_socket->async_receive(f2.to_buffers(), 0,
- (
- lambda::if_(!lambda::_1)
- [
+ data_socket.async_receive(f2.to_buffers(), 0,
+ [&](std::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
// We have successfully received a frame on the old data
// socket. Stop the io_context so that we can print it.
- lambda::bind(&asio::io_context::stop, &io_context),
- lambda::var(done) = false
- ]
- ));
+ io_context.stop();
+ done = false;
+ }
+ });
}
// Run the operations in parallel. This will block until all operations
@@ -166,15 +162,15 @@ int main(int argc, char* argv[])
// the renegotation, or an error has occurred. First we'll check for
// errors.
if (control_result)
- throw asio::system_error(control_result);
+ throw std::system_error(control_result);
if (new_data_socket_result)
- throw asio::system_error(new_data_socket_result);
+ throw std::system_error(new_data_socket_result);
// If we get here it means we have successfully started receiving data on
// the new data socket. This new data socket will be used from now on
// (until the next time we renegotiate).
std::cout << " Renegotiation complete";
- data_socket = new_data_socket;
+ data_socket = std::move(new_data_socket);
data_endpoint = new_data_endpoint;
if (f1.number() > last_frame_number)
{
diff --git a/3rdparty/asio/src/examples/cpp03/porthopper/protocol.hpp b/3rdparty/asio/src/examples/cpp11/porthopper/protocol.hpp
index d9dcb2e13eb..46f9938cad5 100644
--- a/3rdparty/asio/src/examples/cpp03/porthopper/protocol.hpp
+++ b/3rdparty/asio/src/examples/cpp11/porthopper/protocol.hpp
@@ -2,7 +2,7 @@
// protocol.hpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -11,8 +11,8 @@
#ifndef PORTHOPPER_PROTOCOL_HPP
#define PORTHOPPER_PROTOCOL_HPP
-#include <boost/array.hpp>
#include <asio.hpp>
+#include <array>
#include <cstring>
#include <iomanip>
#include <string>
@@ -69,9 +69,9 @@ public:
}
// Obtain buffers for reading from or writing to a socket.
- boost::array<asio::mutable_buffer, 1> to_buffers()
+ std::array<asio::mutable_buffer, 1> to_buffers()
{
- boost::array<asio::mutable_buffer, 1> buffers
+ std::array<asio::mutable_buffer, 1> buffers
= { { asio::buffer(data_) } };
return buffers;
}
@@ -134,9 +134,9 @@ public:
}
// Obtain buffers for reading from or writing to a socket.
- boost::array<asio::mutable_buffer, 1> to_buffers()
+ std::array<asio::mutable_buffer, 1> to_buffers()
{
- boost::array<asio::mutable_buffer, 1> buffers
+ std::array<asio::mutable_buffer, 1> buffers
= { { asio::buffer(data_) } };
return buffers;
}
diff --git a/3rdparty/asio/src/examples/cpp03/porthopper/server.cpp b/3rdparty/asio/src/examples/cpp11/porthopper/server.cpp
index 3b8f3b000cf..4a77622e593 100644
--- a/3rdparty/asio/src/examples/cpp03/porthopper/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/porthopper/server.cpp
@@ -2,28 +2,28 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <cmath>
#include <cstdlib>
#include <exception>
+#include <functional>
#include <iostream>
+#include <memory>
#include <set>
#include "protocol.hpp"
using asio::ip::tcp;
using asio::ip::udp;
-typedef boost::shared_ptr<tcp::socket> tcp_socket_ptr;
-typedef boost::shared_ptr<asio::steady_timer> timer_ptr;
-typedef boost::shared_ptr<control_request> control_request_ptr;
+typedef std::shared_ptr<tcp::socket> tcp_socket_ptr;
+typedef std::shared_ptr<asio::steady_timer> timer_ptr;
+typedef std::shared_ptr<control_request> control_request_ptr;
class server
{
@@ -38,35 +38,35 @@ public:
// Start waiting for a new control connection.
tcp_socket_ptr new_socket(new tcp::socket(acceptor_.get_executor()));
acceptor_.async_accept(*new_socket,
- boost::bind(&server::handle_accept, this,
+ std::bind(&server::handle_accept, this,
asio::placeholders::error, new_socket));
// Start the timer used to generate outgoing frames.
timer_.expires_after(asio::chrono::milliseconds(100));
- timer_.async_wait(boost::bind(&server::handle_timer, this));
+ timer_.async_wait(std::bind(&server::handle_timer, this));
}
// Handle a new control connection.
- void handle_accept(const asio::error_code& ec, tcp_socket_ptr socket)
+ void handle_accept(const std::error_code& ec, tcp_socket_ptr socket)
{
if (!ec)
{
// Start receiving control requests on the connection.
control_request_ptr request(new control_request);
asio::async_read(*socket, request->to_buffers(),
- boost::bind(&server::handle_control_request, this,
+ std::bind(&server::handle_control_request, this,
asio::placeholders::error, socket, request));
}
// Start waiting for a new control connection.
tcp_socket_ptr new_socket(new tcp::socket(acceptor_.get_executor()));
acceptor_.async_accept(*new_socket,
- boost::bind(&server::handle_accept, this,
+ std::bind(&server::handle_accept, this,
asio::placeholders::error, new_socket));
}
// Handle a new control request.
- void handle_control_request(const asio::error_code& ec,
+ void handle_control_request(const std::error_code& ec,
tcp_socket_ptr socket, control_request_ptr request)
{
if (!ec)
@@ -76,7 +76,7 @@ public:
new asio::steady_timer(acceptor_.get_executor()));
delay_timer->expires_after(asio::chrono::seconds(2));
delay_timer->async_wait(
- boost::bind(&server::handle_control_request_timer, this,
+ std::bind(&server::handle_control_request_timer, this,
socket, request, delay_timer));
}
}
@@ -88,7 +88,7 @@ public:
// subscriptions must be stored on the server as a complete endpoint, not
// just a port. We use the non-throwing overload of remote_endpoint() since
// it may fail if the socket is no longer connected.
- asio::error_code ec;
+ std::error_code ec;
tcp::endpoint remote_endpoint = socket->remote_endpoint(ec);
if (!ec)
{
@@ -111,7 +111,7 @@ public:
// Wait for next control request on this connection.
asio::async_read(*socket, request->to_buffers(),
- boost::bind(&server::handle_control_request, this,
+ std::bind(&server::handle_control_request, this,
asio::placeholders::error, socket, request));
}
@@ -135,13 +135,13 @@ public:
std::set<udp::endpoint>::iterator j;
for (j = subscribers_.begin(); j != subscribers_.end(); ++j)
{
- asio::error_code ec;
+ std::error_code ec;
udp_socket_.send_to(f.to_buffers(), *j, 0, ec);
}
// Wait for next timeout.
timer_.expires_after(asio::chrono::milliseconds(100));
- timer_.async_wait(boost::bind(&server::handle_timer, this));
+ timer_.async_wait(std::bind(&server::handle_timer, this));
}
private:
diff --git a/3rdparty/asio/src/examples/cpp03/serialization/client.cpp b/3rdparty/asio/src/examples/cpp11/serialization/client.cpp
index 802bc755b40..10ec87f6da4 100644
--- a/3rdparty/asio/src/examples/cpp03/serialization/client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/serialization/client.cpp
@@ -2,14 +2,14 @@
// client.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <boost/bind/bind.hpp>
+#include <functional>
#include <iostream>
#include <vector>
#include "connection.hpp" // Must come before boost/serialization headers.
@@ -35,7 +35,7 @@ public:
// Start an asynchronous connect operation.
asio::async_connect(connection_.socket(), endpoint_iterator,
- boost::bind(&client::handle_connect, this,
+ std::bind(&client::handle_connect, this,
asio::placeholders::error));
}
@@ -48,7 +48,7 @@ public:
// of stocks. The connection::async_read() function will automatically
// decode the data that is read from the underlying socket.
connection_.async_read(stocks_,
- boost::bind(&client::handle_read, this,
+ std::bind(&client::handle_read, this,
asio::placeholders::error));
}
else
diff --git a/3rdparty/asio/src/examples/cpp03/serialization/connection.hpp b/3rdparty/asio/src/examples/cpp11/serialization/connection.hpp
index ac45287025b..14d96f7597b 100644
--- a/3rdparty/asio/src/examples/cpp03/serialization/connection.hpp
+++ b/3rdparty/asio/src/examples/cpp11/serialization/connection.hpp
@@ -2,7 +2,7 @@
// connection.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -14,12 +14,12 @@
#include <asio.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/tuple/tuple.hpp>
+#include <functional>
#include <iomanip>
+#include <memory>
#include <string>
#include <sstream>
+#include <tuple>
#include <vector>
namespace s11n_example {
@@ -35,7 +35,7 @@ class connection
{
public:
/// Constructor.
- connection(const asio::executor& ex)
+ connection(const asio::any_io_executor& ex)
: socket_(ex)
{
}
@@ -64,8 +64,8 @@ public:
if (!header_stream || header_stream.str().size() != header_length)
{
// Something went wrong, inform the caller.
- asio::error_code error(asio::error::invalid_argument);
- asio::post(socket_.get_executor(), boost::bind(handler, error));
+ std::error_code error(asio::error::invalid_argument);
+ asio::post(socket_.get_executor(), std::bind(handler, error));
return;
}
outbound_header_ = header_stream.str();
@@ -83,26 +83,22 @@ public:
void async_read(T& t, Handler handler)
{
// Issue a read operation to read exactly the number of bytes in a header.
- void (connection::*f)(
- const asio::error_code&,
- T&, boost::tuple<Handler>)
+ void (connection::*f)(const std::error_code&, T&, std::tuple<Handler>)
= &connection::handle_read_header<T, Handler>;
asio::async_read(socket_, asio::buffer(inbound_header_),
- boost::bind(f,
- this, asio::placeholders::error, boost::ref(t),
- boost::make_tuple(handler)));
+ std::bind(f,
+ this, asio::placeholders::error, std::ref(t),
+ std::make_tuple(handler)));
}
- /// Handle a completed read of a message header. The handler is passed using
- /// a tuple since boost::bind seems to have trouble binding a function object
- /// created using boost::bind as a parameter.
+ /// Handle a completed read of a message header.
template <typename T, typename Handler>
- void handle_read_header(const asio::error_code& e,
- T& t, boost::tuple<Handler> handler)
+ void handle_read_header(const std::error_code& e,
+ T& t, std::tuple<Handler> handler)
{
if (e)
{
- boost::get<0>(handler)(e);
+ std::get<0>(handler)(e);
}
else
{
@@ -112,31 +108,31 @@ public:
if (!(is >> std::hex >> inbound_data_size))
{
// Header doesn't seem to be valid. Inform the caller.
- asio::error_code error(asio::error::invalid_argument);
- boost::get<0>(handler)(error);
+ std::error_code error(asio::error::invalid_argument);
+ std::get<0>(handler)(error);
return;
}
// Start an asynchronous call to receive the data.
inbound_data_.resize(inbound_data_size);
void (connection::*f)(
- const asio::error_code&,
- T&, boost::tuple<Handler>)
+ const std::error_code&,
+ T&, std::tuple<Handler>)
= &connection::handle_read_data<T, Handler>;
asio::async_read(socket_, asio::buffer(inbound_data_),
- boost::bind(f, this,
- asio::placeholders::error, boost::ref(t), handler));
+ std::bind(f, this,
+ asio::placeholders::error, std::ref(t), handler));
}
}
/// Handle a completed read of message data.
template <typename T, typename Handler>
- void handle_read_data(const asio::error_code& e,
- T& t, boost::tuple<Handler> handler)
+ void handle_read_data(const std::error_code& e,
+ T& t, std::tuple<Handler> handler)
{
if (e)
{
- boost::get<0>(handler)(e);
+ std::get<0>(handler)(e);
}
else
{
@@ -151,13 +147,13 @@ public:
catch (std::exception& e)
{
// Unable to decode data.
- asio::error_code error(asio::error::invalid_argument);
- boost::get<0>(handler)(error);
+ std::error_code error(asio::error::invalid_argument);
+ std::get<0>(handler)(error);
return;
}
// Inform caller that data has been received ok.
- boost::get<0>(handler)(e);
+ std::get<0>(handler)(e);
}
}
@@ -181,7 +177,7 @@ private:
std::vector<char> inbound_data_;
};
-typedef boost::shared_ptr<connection> connection_ptr;
+typedef std::shared_ptr<connection> connection_ptr;
} // namespace s11n_example
diff --git a/3rdparty/asio/src/examples/cpp03/serialization/server.cpp b/3rdparty/asio/src/examples/cpp11/serialization/server.cpp
index 7818cfed6aa..a032e86dc78 100644
--- a/3rdparty/asio/src/examples/cpp03/serialization/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/serialization/server.cpp
@@ -2,15 +2,14 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/lexical_cast.hpp>
+#include <functional>
#include <iostream>
#include <vector>
#include "connection.hpp" // Must come before boost/serialization headers.
@@ -57,12 +56,12 @@ public:
// Start an accept operation for a new connection.
connection_ptr new_conn(new connection(acceptor_.get_executor()));
acceptor_.async_accept(new_conn->socket(),
- boost::bind(&server::handle_accept, this,
+ std::bind(&server::handle_accept, this,
asio::placeholders::error, new_conn));
}
/// Handle completion of a accept operation.
- void handle_accept(const asio::error_code& e, connection_ptr conn)
+ void handle_accept(const std::error_code& e, connection_ptr conn)
{
if (!e)
{
@@ -70,19 +69,19 @@ public:
// client. The connection::async_write() function will automatically
// serialize the data structure for us.
conn->async_write(stocks_,
- boost::bind(&server::handle_write, this,
+ std::bind(&server::handle_write, this,
asio::placeholders::error, conn));
}
// Start an accept operation for a new connection.
connection_ptr new_conn(new connection(acceptor_.get_executor()));
acceptor_.async_accept(new_conn->socket(),
- boost::bind(&server::handle_accept, this,
+ std::bind(&server::handle_accept, this,
asio::placeholders::error, new_conn));
}
/// Handle completion of a write operation.
- void handle_write(const asio::error_code& e, connection_ptr conn)
+ void handle_write(const std::error_code& e, connection_ptr conn)
{
// Nothing to do. The socket will be closed automatically when the last
// reference to the connection object goes away.
@@ -108,7 +107,7 @@ int main(int argc, char* argv[])
std::cerr << "Usage: server <port>" << std::endl;
return 1;
}
- unsigned short port = boost::lexical_cast<unsigned short>(argv[1]);
+ unsigned short port = std::stoi(argv[1]);
asio::io_context io_context;
s11n_example::server server(io_context, port);
diff --git a/3rdparty/asio/src/examples/cpp03/serialization/stock.hpp b/3rdparty/asio/src/examples/cpp11/serialization/stock.hpp
index 02cadcac7a3..bb305518cae 100644
--- a/3rdparty/asio/src/examples/cpp03/serialization/stock.hpp
+++ b/3rdparty/asio/src/examples/cpp11/serialization/stock.hpp
@@ -2,7 +2,7 @@
// stock.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/services/basic_logger.hpp b/3rdparty/asio/src/examples/cpp11/services/basic_logger.hpp
index b9114d0e6d7..6e4d7a0b05d 100644
--- a/3rdparty/asio/src/examples/cpp03/services/basic_logger.hpp
+++ b/3rdparty/asio/src/examples/cpp11/services/basic_logger.hpp
@@ -2,7 +2,7 @@
// basic_logger.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,7 +12,6 @@
#define SERVICES_BASIC_LOGGER_HPP
#include <asio.hpp>
-#include <boost/noncopyable.hpp>
#include <string>
namespace services {
@@ -21,7 +20,6 @@ namespace services {
/// typedef.
template <typename Service>
class basic_logger
- : private boost::noncopyable
{
public:
/// The type of the service that will be used to provide timer operations.
@@ -46,6 +44,9 @@ public:
service_.create(impl_, identifier);
}
+ basic_logger(const basic_logger&) = delete;
+ basic_logger& operator=(basic_logger&) = delete;
+
/// Destructor.
~basic_logger()
{
diff --git a/3rdparty/asio/src/examples/cpp03/services/daytime_client.cpp b/3rdparty/asio/src/examples/cpp11/services/daytime_client.cpp
index b4e7ea602d7..360134f64c2 100644
--- a/3rdparty/asio/src/examples/cpp03/services/daytime_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/services/daytime_client.cpp
@@ -2,14 +2,14 @@
// daytime_client.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <boost/bind/bind.hpp>
+#include <functional>
#include <iostream>
#include "logger.hpp"
@@ -25,7 +25,7 @@ void read_handler(const asio::error_code& e,
std::cout.write(read_buffer, bytes_transferred);
s->async_read_some(asio::buffer(read_buffer),
- boost::bind(read_handler, asio::placeholders::error,
+ std::bind(read_handler, asio::placeholders::error,
asio::placeholders::bytes_transferred, s));
}
else
@@ -51,7 +51,7 @@ void connect_handler(const asio::error_code& e, tcp::socket* s)
logger.log("Connection established");
s->async_read_some(asio::buffer(read_buffer),
- boost::bind(read_handler, asio::placeholders::error,
+ std::bind(read_handler, asio::placeholders::error,
asio::placeholders::bytes_transferred, s));
}
else
@@ -86,7 +86,7 @@ int main(int argc, char* argv[])
// Start an asynchronous connect.
tcp::socket socket(io_context);
asio::async_connect(socket, endpoints,
- boost::bind(connect_handler,
+ std::bind(connect_handler,
asio::placeholders::error, &socket));
// Run the io_context until all operations have finished.
diff --git a/3rdparty/asio/src/examples/cpp03/services/logger.hpp b/3rdparty/asio/src/examples/cpp11/services/logger.hpp
index 9ebbbd6992a..2ab366c83c6 100644
--- a/3rdparty/asio/src/examples/cpp03/services/logger.hpp
+++ b/3rdparty/asio/src/examples/cpp11/services/logger.hpp
@@ -2,7 +2,7 @@
// logger.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/services/logger_service.cpp b/3rdparty/asio/src/examples/cpp11/services/logger_service.cpp
index 4123d7bb92e..74d67c75241 100644
--- a/3rdparty/asio/src/examples/cpp03/services/logger_service.cpp
+++ b/3rdparty/asio/src/examples/cpp11/services/logger_service.cpp
@@ -2,7 +2,7 @@
// logger_service.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/services/logger_service.hpp b/3rdparty/asio/src/examples/cpp11/services/logger_service.hpp
index 9ec99d93419..d0beaf1d6c2 100644
--- a/3rdparty/asio/src/examples/cpp03/services/logger_service.hpp
+++ b/3rdparty/asio/src/examples/cpp11/services/logger_service.hpp
@@ -2,7 +2,7 @@
// logger_service.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,13 +12,11 @@
#define SERVICES_LOGGER_SERVICE_HPP
#include <asio.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/scoped_ptr.hpp>
+#include <functional>
#include <fstream>
#include <sstream>
#include <string>
+#include <thread>
namespace services {
@@ -44,21 +42,22 @@ public:
logger_service(asio::execution_context& context)
: asio::execution_context::service(context),
work_io_context_(),
- work_(asio::require(work_io_context_.get_executor(),
- asio::execution::outstanding_work.tracked)),
- work_thread_(new asio::thread(
- boost::bind(&asio::io_context::run, &work_io_context_)))
+ work_(asio::make_work_guard(work_io_context_)),
+ work_thread_([this]{ work_io_context_.run(); })
{
}
+ logger_service(const logger_service&) = delete;
+ logger_service& operator=(const logger_service&) = delete;;
+
/// Destructor shuts down the private io_context.
~logger_service()
{
/// Indicate that we have finished with the private io_context. Its
/// io_context::run() function will exit once all other work has completed.
- work_ = asio::any_io_executor();
- if (work_thread_)
- work_thread_->join();
+ work_.reset();
+ if (work_thread_.joinable())
+ work_thread_.join();
}
/// Destroy all user-defined handler objects owned by the service.
@@ -92,8 +91,8 @@ public:
void use_file(impl_type& /*impl*/, const std::string& file)
{
// Pass the work of opening the file to the background thread.
- asio::post(work_io_context_, boost::bind(
- &logger_service::use_file_impl, this, file));
+ asio::post(work_io_context_,
+ std::bind(&logger_service::use_file_impl, this, file));
}
/// Log a message.
@@ -104,8 +103,8 @@ public:
os << impl->identifier << ": " << message;
// Pass the work of writing to the file to the background thread.
- asio::post(work_io_context_, boost::bind(
- &logger_service::log_impl, this, os.str()));
+ asio::post(work_io_context_,
+ std::bind(&logger_service::log_impl, this, os.str()));
}
private:
@@ -128,13 +127,14 @@ private:
/// Private io_context used for performing logging operations.
asio::io_context work_io_context_;
- /// A work-tracking executor giving work for the private io_context to
- /// perform. If we do not give the io_context some work to do then the
- /// io_context::run() function will exit immediately.
- asio::any_io_executor work_;
+ /// Work for the private io_context to perform. If we do not give the
+ /// io_context some work to do then the io_context::run() function will exit
+ /// immediately.
+ asio::executor_work_guard<
+ asio::io_context::executor_type> work_;
/// Thread used for running the work io_context's run loop.
- boost::scoped_ptr<asio::thread> work_thread_;
+ std::thread work_thread_;
/// The file to which log messages will be written.
std::ofstream ofstream_;
diff --git a/3rdparty/asio/src/examples/cpp11/socks4/socks4.hpp b/3rdparty/asio/src/examples/cpp11/socks4/socks4.hpp
index 4287b3f1948..ed7994021fc 100644
--- a/3rdparty/asio/src/examples/cpp11/socks4/socks4.hpp
+++ b/3rdparty/asio/src/examples/cpp11/socks4/socks4.hpp
@@ -2,7 +2,7 @@
// socks4.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -39,7 +39,7 @@ public:
// Only IPv4 is supported by the SOCKS 4 protocol.
if (endpoint.protocol() != asio::ip::tcp::v4())
{
- throw asio::system_error(
+ throw std::system_error(
asio::error::address_family_not_supported);
}
diff --git a/3rdparty/asio/src/examples/cpp11/socks4/sync_client.cpp b/3rdparty/asio/src/examples/cpp11/socks4/sync_client.cpp
index e0d20992fe2..f661aca8da5 100644
--- a/3rdparty/asio/src/examples/cpp11/socks4/sync_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/socks4/sync_client.cpp
@@ -2,7 +2,7 @@
// sync_client.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/spawn/echo_server.cpp b/3rdparty/asio/src/examples/cpp11/spawn/echo_server.cpp
index 95adffd604e..ae949d60bef 100644
--- a/3rdparty/asio/src/examples/cpp11/spawn/echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/spawn/echo_server.cpp
@@ -2,12 +2,13 @@
// echo_server.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/detached.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/spawn.hpp>
@@ -39,7 +40,7 @@ public:
char data[128];
for (;;)
{
- timer_.expires_from_now(std::chrono::seconds(10));
+ timer_.expires_after(std::chrono::seconds(10));
std::size_t n = socket_.async_read_some(asio::buffer(data), yield);
asio::async_write(socket_, asio::buffer(data, n), yield);
}
@@ -49,19 +50,19 @@ public:
socket_.close();
timer_.cancel();
}
- });
+ }, asio::detached);
asio::spawn(strand_,
[this, self](asio::yield_context yield)
{
while (socket_.is_open())
{
- asio::error_code ignored_ec;
+ std::error_code ignored_ec;
timer_.async_wait(yield[ignored_ec]);
- if (timer_.expires_from_now() <= std::chrono::seconds(0))
+ if (timer_.expiry() <= asio::steady_timer::clock_type::now())
socket_.close();
}
- });
+ }, asio::detached);
}
private:
@@ -90,7 +91,7 @@ int main(int argc, char* argv[])
for (;;)
{
- asio::error_code ec;
+ std::error_code ec;
tcp::socket socket(io_context);
acceptor.async_accept(socket, yield[ec]);
if (!ec)
@@ -98,6 +99,11 @@ int main(int argc, char* argv[])
std::make_shared<session>(io_context, std::move(socket))->go();
}
}
+ },
+ [](std::exception_ptr e)
+ {
+ if (e)
+ std::rethrow_exception(e);
});
io_context.run();
diff --git a/3rdparty/asio/src/examples/cpp11/spawn/parallel_grep.cpp b/3rdparty/asio/src/examples/cpp11/spawn/parallel_grep.cpp
index fc2c6ecd1c2..f4a5b1136dc 100644
--- a/3rdparty/asio/src/examples/cpp11/spawn/parallel_grep.cpp
+++ b/3rdparty/asio/src/examples/cpp11/spawn/parallel_grep.cpp
@@ -2,12 +2,13 @@
// parallel_grep.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/detached.hpp>
#include <asio/dispatch.hpp>
#include <asio/post.hpp>
#include <asio/spawn.hpp>
@@ -17,6 +18,7 @@
#include <iostream>
#include <string>
+using asio::detached;
using asio::dispatch;
using asio::spawn;
using asio::strand;
@@ -69,7 +71,7 @@ int main(int argc, char* argv[])
if (++line_num % 10 == 0)
post(yield);
}
- });
+ }, detached);
}
// Join the thread pool to wait for all the spawned tasks to complete.
diff --git a/3rdparty/asio/src/examples/cpp03/ssl/README b/3rdparty/asio/src/examples/cpp11/ssl/README
index b04fc30c559..8304d0603b6 100644
--- a/3rdparty/asio/src/examples/cpp03/ssl/README
+++ b/3rdparty/asio/src/examples/cpp11/ssl/README
@@ -2,7 +2,7 @@ The passphrase for both the CA and server private keys is "test".
-------------------------------------------------------------------------------
-Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
diff --git a/3rdparty/asio/src/examples/cpp11/ssl/ca.pem b/3rdparty/asio/src/examples/cpp11/ssl/ca.pem
new file mode 100644
index 00000000000..4580bc11bcf
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/ssl/ca.pem
@@ -0,0 +1,50 @@
+-----BEGIN CERTIFICATE-----
+MIIDVDCCAjygAwIBAgIUX3cVQ47QyJp7SOy0RPzP743W9MwwDQYJKoZIhvcNAQEL
+BQAwOzELMAkGA1UEBhMCQVUxDDAKBgNVBAgMA05TVzEPMA0GA1UEBwwGU3lkbmV5
+MQ0wCwYDVQQKDARhc2lvMB4XDTIxMTExMTIxMTA1MloXDTI2MTExMDIxMTA1Mlow
+OzELMAkGA1UEBhMCQVUxDDAKBgNVBAgMA05TVzEPMA0GA1UEBwwGU3lkbmV5MQ0w
+CwYDVQQKDARhc2lvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyURD
+LjKxTCkapmWhY0bP1NaaOPzIJTTB0dzREOlmRmBmiHpW7DaRx7qBm6jYDKQ7OCbz
+30/j8K4TjHOLIwxzXhXMYTJOcN2giPHNUBvm9oEuDAhYgltArJQnBBEH+3C1hCIv
+1+uhTWo0HpGXTeJnvboTZ1YgmbOgr6lMhNiu9QmPX885DxWf6sDq8mRgCDX2x8sk
+Ls0HuLSo88Osjx532yEhnrZgexsByhoRD3yrKHV5mWpaunk5BMsP/XMuQHayFmbO
+siqnHJoL1znGVH003PcBGmEDmoIUqhLiBi2gWGu1pmckP9loqQUTEn0aLOVclHf4
+slWq344zh4tJCpQMfQIDAQABo1AwTjAdBgNVHQ4EFgQUfiX1CMQrGDi9mIBAg9cg
+m0RwLJUwHwYDVR0jBBgwFoAUfiX1CMQrGDi9mIBAg9cgm0RwLJUwDAYDVR0TBAUw
+AwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAnDnVNSb8z/pNFaZ6YAZ+ukfNT3jjbGm1
+10BOLqJj8s5A8/JkwjaWhky/DuGXDywgEvzXC18aNAxASeqO8h9pAZtszu6NWB4s
+h3r+dEQakMacxrZ+jBL/cYLrUv9r3KMPKxaDnplkamqFA/9eNmoV7vDyGtGPZuD6
+oTROtQqqDSrxthCkqnibAfusi7RmlCdvJa0kVK7krKJZAhi8W9f32+lBPv9oq3Ns
+dAxnOj/D3UnhNoIt0EdjqUdLo2U39dt5s5Syj2rFUAgfbc02Rwx65kq8AjTRlW/M
+KDpGsifwIB8b7wActMUO8c3GptptNVWmFm5+Mmk54P//P3tIAx9KXw==
+-----END CERTIFICATE-----
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIPcVUeQ7ZElgCAggA
+MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECGKlFVN6/gIlBIIEyJPeknsA5dvV
+WK27AZzs4wM6WrsD6ba+kPJyZTpon5pn4eoTiw4UCvo7C+21G9jCqbIbDrgTWHwH
+zu6YrBFTZgRUpdLkLsyUsp4UJrZ8xJ7N/jWlG763CyluFE5oBFLz2Vt/DSDSaWdA
+sKdxua/1kvw+KYoDqlObMFIspM5TrndcMnWkOgyvQAvnH0NZXFFBa4QGFrwWDrCo
+m12CzMLwaPMrNFBffCTqZnL1AajT+EYqPTi+cQ5mkRpZ2cuzhdug2eki1KkD12ZN
+3d8Ehl8bfbLEqRE/HnggleRRt7ia1xkzruqQp14JA2UsrioGMF5nvWgWrbyHfpui
+KrCsDwDelrArW/GCki53QBQMuH8Q1YmoNrRZwlG257eA1LiJvmxRyIjKYu0RP+Q8
+EOldycy51VsPVPApUbv9r4IJldrIJiwlmRxxM36uKtFhfojnsWzJORDYI8C37uKi
+UEPiD4GSEH6C0lGO94IoZPjl9z/rZ0qZx1VRHl3nxZc0AQvvj9bWMbyRwsgb6wod
+P8JSy6uEib9UxuenNHzTd48GcNhJbhOqd4IV0XKhi8W1Kil3mMdc3QAwKaLTx12/
+1GrbMui061uyeM6Rf6Xao0PApDnUNmxcFSTsoarG0yH7Q0WZMgKTDCCGhhtZKlE6
+x7pRsnxiFaIpoh32EVIRI+ZXh2rXBcwa2ew0aEccRXtPFvcmdjevkrHuCggc+M+Y
+seFqTHVGWf8eS6o08w095DboD0vFpZXZMRfycTbA7BiE4NYE/uc7v5cH3Ax9l2ef
+zG7o9idDt+/RX7OcetxDFw4eQbq7PfjvrfXS1DcRUEyJ04emh7oxlkAUUNsFtabN
+T0ggvHxcQWkYRE5oPlkbgpwKpK4LDcApXKFwCDKPur2W5Q7KHRfDLtSvZvYarJum
+8j2pGpEis/bdTih29ofNsX6a0Yo5Tlj+9+1c/6/Xi7XvRk/Vbgkoa3iVQ3ckdCuZ
+vO7cRYZBBs6W/Ti3hWFzPEX9FfcnSUp9bEnH4ASnmUcp8PDBJYeaI6HqpO3XbkbF
+l70eDNakd2cDNjQzkFpBT7HO+HtqU3xNt9K0z2gMB7iTDVFyIzh26joCR2O8tiqS
+wUJFkoLPb74GSB7WzE+gb4jXX6n9609PUoR3f896mM34uX3CsY8lA+/0ZGpHnFDA
+ToKdmz6WKIAw0E20nyzLuLwPZgj7HLcR7zza4raipe9QxIdyJr5O+jzGt+OjSM9b
+K1agibRE5DChqQ+P+ikOc6nG7UNyn+lKSjGEbwuzi8F0iugMgcTc/vYO8OWDNGpd
+D1euA5OuVPdfatFa16Fyr4MJJIfE83C4/kSj05fdoyb6pJkOjHhUppVMe+ES5kwl
+YI8RES2XVJzUSxnWsIM613YlMgIZ9xgcuIADnO7gaKJ4RQG+9wJ853Uo4+n89K7F
+Y6KzihuYAUkbAw1pPo1TODom7A/gB9stqRUSQlZWmIgtnJ8wPjt/we0gzPM8LQzb
+ye4KOLjH5iquFc4MU4TtN3gvp9P5R9UFrGeMImS5eMUmBQHckDNdIAtMj7M1wUpR
+JVrzDXWDjC21sLn95NtNMPb+FRlt/biTV3IE3ZmX0kbuCRoH7b7hhR41Zpoajwl0
+FqYigB5gnVodGUWuBgDUqA==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/3rdparty/asio/src/examples/cpp11/ssl/client.cpp b/3rdparty/asio/src/examples/cpp11/ssl/client.cpp
index 0ff7b00d0fd..6799d2a98e1 100644
--- a/3rdparty/asio/src/examples/cpp11/ssl/client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/ssl/client.cpp
@@ -2,7 +2,7 @@
// client.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/ssl/dh4096.pem b/3rdparty/asio/src/examples/cpp11/ssl/dh4096.pem
new file mode 100644
index 00000000000..dc2559c5f82
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/ssl/dh4096.pem
@@ -0,0 +1,25 @@
+-----BEGIN X9.42 DH PARAMETERS-----
+MIIELQKCAgEA8eEBgatlTk0QKIwUqHsteHJXzEr0xAW7RLeNid8DdGjTnFw68eV+
+s1YbipEqQVTFG+VZPaof9v0CH2KOdbgWD0KRPC49HB8O/wARFKpy5eJltVe1r07w
++V1Vjciqkh/vGq/yFQsbqwyWJy6AelsbHdSC9Bg9pmu4+pbVGW15zK7PkfjfoO9V
+JYbhdqFIPg+9NRRWsl/U9UoyeeIGImI9I4k3fqtv311C6VVErFZylCj7nn45L7IY
+GfPcCO5E8FD6EqBv5WnhMNYHMJu9brRvOoAyAyWprqR+aVzHd+DFamDQdsuQjKTk
+3+r07znWJfjp6FVTzR5SvjrKg1knK5TibIksoKOlsFZ06bGkFWHjqXNAKhnSpCiU
+GJd0qe7pTD+TGQJGWskJpoph+tkICUa+6MyzP9+U6T9hISIY/BpVuWn/iwdLqsvV
+s5bg2RjRraww/4Rjm0NyEOTk2MxaLB9gcyu6zcrhX5XRiMgt+jhKwEMwJCEJYkxn
+C0yv08A5v6RceFm1jY+8FT0IzRqsWIGV7beNdqtE0B4LBTuN1yQ6x8CKEb6mbIHG
+d0XLGppELhD8QUwAr5HiVGTAsS9JlMGgXVkyDtxrVSeS1zHWt77skRQ9UlfJfYMm
+5wxHj5QCdQ7ma3oMMZBZutNlkevMzYHIxwqhZstf4ud0j0VMftwZ3GMCggIBAJL7
+cU6/YSxzYDGUcPc6WGT+FAghR0LdhT3Q3Xz1rQRBwSSMPm9NZhyJC3fb+hBl/44X
+AHOu1/3dYIWlXPMuHZZdtlt+hkD/sIob16By20Z0p81Kvh3HQglVDJGlFzTmQbTd
+CM/EP8eJFiNeMcJB0RgeKyzikRsV4r/acZZM56swTlsRvSDFMh3v9YyYTZbCTwxm
+PIVOsxI8uBoWRCzY3yWzjmlZ2u5TR+Z0IVonmNqk6XAKRgxV12YfQVXzzpPZQA9S
+GHoD/NQoMdBAi3p4pLEYJ5qMRLYPQbBfSNu5eP9e5uZOiBp/28bVnzEelDGuFupr
+lvywkZEVL1KaYtZ/dGkPFXt+A7mNsw5xeDTRjgL4uUJvCNIkjgVEfIrLdUf5IVsU
+V8BgunAvgfH+Hy6Tx89v/QGsUWJPhjkSZnXwJ7Ipcsm+Zg0zAZwKDZEQtDLXVPRL
+OfCfXMXvlw2u6OHlhSbqO69zZG3dJTlcnjy06n4JYcUim7Mj3Kduige6VWofeEk9
+M/kHrPqNdFE5tHLh2nHcw9yExKHN+l/OUGAvNDfOVS+S+fNSKT0RfC9dMpHLN+Ok
+fGuskGzLQAVYF+DYEcnJ++0LEFtd0J381ndSc0iJuH60rKDTqxoRqv7lcdwLFlEV
+sQSRoas8s+y+b3FfSu7j0p44qLG9oxZ/WFcWnuUyAiEAjvAD9p3bw8AH0s7dUrX/
+RT1Ge+J/n0tlsgw+LY3zafE=
+-----END X9.42 DH PARAMETERS-----
diff --git a/3rdparty/asio/src/examples/cpp11/ssl/server.cpp b/3rdparty/asio/src/examples/cpp11/ssl/server.cpp
index 26ef44a31a5..15e0d9eaf03 100644
--- a/3rdparty/asio/src/examples/cpp11/ssl/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/ssl/server.cpp
@@ -2,7 +2,7 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -88,7 +88,7 @@ public:
context_.set_password_callback(std::bind(&server::get_password, this));
context_.use_certificate_chain_file("server.pem");
context_.use_private_key_file("server.pem", asio::ssl::context::pem);
- context_.use_tmp_dh_file("dh2048.pem");
+ context_.use_tmp_dh_file("dh4096.pem");
do_accept();
}
diff --git a/3rdparty/asio/src/examples/cpp11/ssl/server.pem b/3rdparty/asio/src/examples/cpp11/ssl/server.pem
new file mode 100644
index 00000000000..a7bcba738a0
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/ssl/server.pem
@@ -0,0 +1,99 @@
+-----BEGIN CERTIFICATE-----
+MIIDDjCCAfYCFGGcJXlIeQHiq/qOakbISU5cihPvMA0GCSqGSIb3DQEBCwUAMDsx
+CzAJBgNVBAYTAkFVMQwwCgYDVQQIDANOU1cxDzANBgNVBAcMBlN5ZG5leTENMAsG
+A1UECgwEYXNpbzAeFw0yMTExMTEyMTExNDRaFw0yNjExMTAyMTExNDRaMEwxCzAJ
+BgNVBAYTAkFVMQwwCgYDVQQIDANOU1cxDzANBgNVBAcMBlN5ZG5leTENMAsGA1UE
+CgwEYXNpbzEPMA0GA1UECwwGc2VydmVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
+MIIBCgKCAQEAu67TzZCFNTZ5c1gKwXfdTH3bP0OB5n6dqXGK6jkPb699dyM4oPtY
+2f+OyxJspk8D5pX6HuZ+hLGAsHxfCN+A3RegVZJCR/gXrrMPl/6PfDxtkeFXWy+6
+NAPxqppMj8gbX/czTdNFwgW4J8/RLyH53utjAGQtCRr97EbBOsTSeOmyAxbw4mRt
+EvHjacKFcSZzJDlyxCia37791MulZ4lwOZZlke5NzoOqkBIAusQgg7fMWDvH27PD
+T+taIyBsYTVJWHf5kMklAlWYXZvNjZp/QGt13lDORg2aSc/P2pE4iLyhbZcpuW+W
+nHB7IY1wjDL55/ORCjz3VlNIAMXHP5YQxwIDAQABMA0GCSqGSIb3DQEBCwUAA4IB
+AQC3iiwQTgDP4ixulisYIGlJb8iuhxH9G41hm8dF/1qlIfXWxsbjb+g7M5U/3JCb
+fwCGoz7uBdj/CKkIb5wx83GVC1yVLbNSvCIS827qxic4GACEYGGAy4Ub5tUCQrLr
+JUQTP1WVJcgiKvk7OAcXdA+k/CcNXH153gUPDZz+/BedXe2VbM6LDsqPeSxXfbZN
+AWXARAuly7cQk/xkYkPldRRhx4htNCbnkG1qyEqNcYQN1SY9Qhbrm2HkAUntzQ7G
+umo4JdbIX6MJ5fYNs+yN/lJB7PiJP8Mz1AtOz4x9JxcLyuB6sapT8Tj53n9g/+m1
+Tqd8lHpWe6oM0sgdWfzdBNir
+-----END CERTIFICATE-----
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,9E0E6B9970E055F1
+
+oFvN3t50B2TSeNsRo1vwhVYlMmt0w3MD3Ar75fti4fRhBrWoH4rBPrSouWK4OMDK
+CakfVhzJIEvaMav843grS4V+ooAsfnAtiQiQj+5xjZ8PlCuWir5gyjgqeN4zN6ZT
+2s/oEy5Kx7Ru5AWMkv+NPW5l3iS3c+Hupfb/auITwECSCCsCBxgNtJ8z0iXjv9Dr
+hqvqcI+4F5DSiol3QhitbpQ/k2PKu92AZhPcr9e5HrqeUD7aqfX2q3i+tnJvxC93
+0mvy133bX2ZAGAKMheW/GuzcETfwU80wvmrwHXI9rnuAUaJhrDiIZQ79gubZ0Pcm
+w4Y6Z5xxeErb7zKBi+pHKst8MJ7rfSz/N878su6cpESRC/w1paVX7m8/q61kzBkj
++h2qe9DupXBejQkriN+Z858nFtBKbWlFsmAg1FLZonworTUfV2c7S9yzMV/29VOE
+T0Bt8BU1Hp+bCjreF4JGbnUJnRQoASpisfUkrD6Ar4GI56Edkkx6hkF0cXdcvfCN
+qyhxzcvf/aV1M2kcpBRX9mIfjoFMFNz7uRIxyqPLaDkigwJemoaBo3n9/W5F7N7B
+AGNEZ3QhUlc8EyWpGRZRzMevu5wdz1b2+MqItOhPXUo2XcLEj2iFkVDdbj/d9jQH
+9ZIe4hQTSf784tAzt2Jp2RHmm22390GB1jdzG/CzbGlAKmaTTEe4FJcd/eLOEZuD
+4+iFsEb/bWcCyXkBKkdEoDDMJW8xi5d/1ezJM03nqhvkekDqyhJUJPCbmY1SCX1X
+4AO40jJmWQxwj26Pnnncacz4tuecZNqovz+POpKQSIctrQSV4wgf35137KBt7/O7
+EU0N7Qj4xTigyGkEHCZt7BgD8fFrxiP1OkUmFRHEE7Dxiagz6omJV8ien+p9wIgS
+QcqkJlgKMwVepjuCuEyvg5oIkAPvp24yhePSJkEvvoDLvM2Kub/CM+UkN8dSgsZk
++ZBE9Oi62AWWow8/ib8Um5DNIEZsq+5CQLeBG7f5kTIBAoA9UceaEgbxzOVUCBcX
+L7QsJ3pZ/ei1qx/9tChO/OXa9tleXcjGg7/q/6i6pUyZuqZlt+hk+3HtFmTXIjsM
+chbUSMEJ2isv9MDamTtunt9N92A6OxUkAs68kCO/bzotldXMKZVjOohNnML5q/3U
+vpsuN8NNwaNHCAM7pjols4V7ebX1lDZFR1hbj+szKMhVKzFfig1lRHafgRrR6H6P
+mUK16lKzUbmvwv2IU/3wck+4UNeB/+lRmfAfBasQytnbt+5fwwNkVSrDY2Kxe0nz
+2k3eIYST+ygxGuNrW9rnFbBpTJb0OE5cpgun8xxDE91AmL550AcZff+9ulDBhZg1
+eMoKUALlEdDNPffVTH8Iupn0jMnJsjXynztcEVhx4h2aA5X6/2i035uEybCn33qP
+J7g30oe2C69BSC0YmkT3MjF6Wrhy+M8dU0dDggRhY6JSS8wESvwGenaPi7SZlbxb
+Elmc44bHros1YfGl/xDdhju134/aMBG1GlZlReI+Rwnp9DCp04xiiJb9YKyUNaGY
+7BTGWyie/WYYKbX1ZlxqWA9jxow8PM1XYHuanau1/aYT16L7E83HG3qkyuFIlLJh
+-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIIDVDCCAjygAwIBAgIUX3cVQ47QyJp7SOy0RPzP743W9MwwDQYJKoZIhvcNAQEL
+BQAwOzELMAkGA1UEBhMCQVUxDDAKBgNVBAgMA05TVzEPMA0GA1UEBwwGU3lkbmV5
+MQ0wCwYDVQQKDARhc2lvMB4XDTIxMTExMTIxMTA1MloXDTI2MTExMDIxMTA1Mlow
+OzELMAkGA1UEBhMCQVUxDDAKBgNVBAgMA05TVzEPMA0GA1UEBwwGU3lkbmV5MQ0w
+CwYDVQQKDARhc2lvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyURD
+LjKxTCkapmWhY0bP1NaaOPzIJTTB0dzREOlmRmBmiHpW7DaRx7qBm6jYDKQ7OCbz
+30/j8K4TjHOLIwxzXhXMYTJOcN2giPHNUBvm9oEuDAhYgltArJQnBBEH+3C1hCIv
+1+uhTWo0HpGXTeJnvboTZ1YgmbOgr6lMhNiu9QmPX885DxWf6sDq8mRgCDX2x8sk
+Ls0HuLSo88Osjx532yEhnrZgexsByhoRD3yrKHV5mWpaunk5BMsP/XMuQHayFmbO
+siqnHJoL1znGVH003PcBGmEDmoIUqhLiBi2gWGu1pmckP9loqQUTEn0aLOVclHf4
+slWq344zh4tJCpQMfQIDAQABo1AwTjAdBgNVHQ4EFgQUfiX1CMQrGDi9mIBAg9cg
+m0RwLJUwHwYDVR0jBBgwFoAUfiX1CMQrGDi9mIBAg9cgm0RwLJUwDAYDVR0TBAUw
+AwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAnDnVNSb8z/pNFaZ6YAZ+ukfNT3jjbGm1
+10BOLqJj8s5A8/JkwjaWhky/DuGXDywgEvzXC18aNAxASeqO8h9pAZtszu6NWB4s
+h3r+dEQakMacxrZ+jBL/cYLrUv9r3KMPKxaDnplkamqFA/9eNmoV7vDyGtGPZuD6
+oTROtQqqDSrxthCkqnibAfusi7RmlCdvJa0kVK7krKJZAhi8W9f32+lBPv9oq3Ns
+dAxnOj/D3UnhNoIt0EdjqUdLo2U39dt5s5Syj2rFUAgfbc02Rwx65kq8AjTRlW/M
+KDpGsifwIB8b7wActMUO8c3GptptNVWmFm5+Mmk54P//P3tIAx9KXw==
+-----END CERTIFICATE-----
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIPcVUeQ7ZElgCAggA
+MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECGKlFVN6/gIlBIIEyJPeknsA5dvV
+WK27AZzs4wM6WrsD6ba+kPJyZTpon5pn4eoTiw4UCvo7C+21G9jCqbIbDrgTWHwH
+zu6YrBFTZgRUpdLkLsyUsp4UJrZ8xJ7N/jWlG763CyluFE5oBFLz2Vt/DSDSaWdA
+sKdxua/1kvw+KYoDqlObMFIspM5TrndcMnWkOgyvQAvnH0NZXFFBa4QGFrwWDrCo
+m12CzMLwaPMrNFBffCTqZnL1AajT+EYqPTi+cQ5mkRpZ2cuzhdug2eki1KkD12ZN
+3d8Ehl8bfbLEqRE/HnggleRRt7ia1xkzruqQp14JA2UsrioGMF5nvWgWrbyHfpui
+KrCsDwDelrArW/GCki53QBQMuH8Q1YmoNrRZwlG257eA1LiJvmxRyIjKYu0RP+Q8
+EOldycy51VsPVPApUbv9r4IJldrIJiwlmRxxM36uKtFhfojnsWzJORDYI8C37uKi
+UEPiD4GSEH6C0lGO94IoZPjl9z/rZ0qZx1VRHl3nxZc0AQvvj9bWMbyRwsgb6wod
+P8JSy6uEib9UxuenNHzTd48GcNhJbhOqd4IV0XKhi8W1Kil3mMdc3QAwKaLTx12/
+1GrbMui061uyeM6Rf6Xao0PApDnUNmxcFSTsoarG0yH7Q0WZMgKTDCCGhhtZKlE6
+x7pRsnxiFaIpoh32EVIRI+ZXh2rXBcwa2ew0aEccRXtPFvcmdjevkrHuCggc+M+Y
+seFqTHVGWf8eS6o08w095DboD0vFpZXZMRfycTbA7BiE4NYE/uc7v5cH3Ax9l2ef
+zG7o9idDt+/RX7OcetxDFw4eQbq7PfjvrfXS1DcRUEyJ04emh7oxlkAUUNsFtabN
+T0ggvHxcQWkYRE5oPlkbgpwKpK4LDcApXKFwCDKPur2W5Q7KHRfDLtSvZvYarJum
+8j2pGpEis/bdTih29ofNsX6a0Yo5Tlj+9+1c/6/Xi7XvRk/Vbgkoa3iVQ3ckdCuZ
+vO7cRYZBBs6W/Ti3hWFzPEX9FfcnSUp9bEnH4ASnmUcp8PDBJYeaI6HqpO3XbkbF
+l70eDNakd2cDNjQzkFpBT7HO+HtqU3xNt9K0z2gMB7iTDVFyIzh26joCR2O8tiqS
+wUJFkoLPb74GSB7WzE+gb4jXX6n9609PUoR3f896mM34uX3CsY8lA+/0ZGpHnFDA
+ToKdmz6WKIAw0E20nyzLuLwPZgj7HLcR7zza4raipe9QxIdyJr5O+jzGt+OjSM9b
+K1agibRE5DChqQ+P+ikOc6nG7UNyn+lKSjGEbwuzi8F0iugMgcTc/vYO8OWDNGpd
+D1euA5OuVPdfatFa16Fyr4MJJIfE83C4/kSj05fdoyb6pJkOjHhUppVMe+ES5kwl
+YI8RES2XVJzUSxnWsIM613YlMgIZ9xgcuIADnO7gaKJ4RQG+9wJ853Uo4+n89K7F
+Y6KzihuYAUkbAw1pPo1TODom7A/gB9stqRUSQlZWmIgtnJ8wPjt/we0gzPM8LQzb
+ye4KOLjH5iquFc4MU4TtN3gvp9P5R9UFrGeMImS5eMUmBQHckDNdIAtMj7M1wUpR
+JVrzDXWDjC21sLn95NtNMPb+FRlt/biTV3IE3ZmX0kbuCRoH7b7hhR41Zpoajwl0
+FqYigB5gnVodGUWuBgDUqA==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/3rdparty/asio/src/examples/cpp11/timeouts/async_tcp_client.cpp b/3rdparty/asio/src/examples/cpp11/timeouts/async_tcp_client.cpp
index 9ded9309f60..b8f2cbe77d2 100644
--- a/3rdparty/asio/src/examples/cpp11/timeouts/async_tcp_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/timeouts/async_tcp_client.cpp
@@ -2,7 +2,7 @@
// async_tcp_client.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/timeouts/blocking_tcp_client.cpp b/3rdparty/asio/src/examples/cpp11/timeouts/blocking_tcp_client.cpp
index 96b7b52a074..e29edc2895f 100644
--- a/3rdparty/asio/src/examples/cpp11/timeouts/blocking_tcp_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/timeouts/blocking_tcp_client.cpp
@@ -2,7 +2,7 @@
// blocking_tcp_client.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp b/3rdparty/asio/src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp
index 6379642665a..085570d8b78 100644
--- a/3rdparty/asio/src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp
@@ -2,7 +2,7 @@
// blocking_token_tcp_client.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -22,6 +22,10 @@
using asio::ip::tcp;
+// NOTE: This example uses the new form of the asio::async_result trait.
+// For an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
// We will use our sockets only with an io_context.
using tcp_socket = asio::basic_stream_socket<
tcp, asio::io_context::executor_type>;
@@ -54,51 +58,26 @@ template <typename T>
class async_result<close_after, void(std::error_code, T)>
{
public:
- // An asynchronous operation's initiating function automatically creates an
- // completion_handler_type object from the token. This function object is
- // then called on completion of the asynchronous operation.
- class completion_handler_type
- {
- public:
- completion_handler_type(const close_after& token)
- : token_(token)
- {
- }
-
- void operator()(const std::error_code& error, T t)
- {
- *error_ = error;
- *t_ = t;
- }
-
- private:
- friend class async_result;
- close_after token_;
- std::error_code* error_;
- T* t_;
- };
-
- // The async_result constructor associates the completion handler object with
- // the result of the initiating function.
- explicit async_result(completion_handler_type& h)
- : timeout_(h.token_.timeout_),
- socket_(h.token_.socket_)
- {
- h.error_ = &error_;
- h.t_ = &t_;
- }
-
- // The return_type typedef determines the result type of the asynchronous
- // operation's initiating function.
- typedef T return_type;
-
- // The get() function is used to obtain the result of the asynchronous
- // operation's initiating function. For the close_after completion token, we
- // use this function to run the io_context until the operation is complete.
- return_type get()
+ // The initiate() function is used to launch the asynchronous operation by
+ // calling the operation's initiation function object. For the close_after
+ // completion token, we use this function to run the io_context until the
+ // operation is complete.
+ template <typename Init, typename... Args>
+ static T initiate(Init init, close_after token, Args&&... args)
{
asio::io_context& io_context = asio::query(
- socket_.get_executor(), asio::execution::context);
+ token.socket_.get_executor(), asio::execution::context);
+
+ // Call the operation's initiation function object to start the operation.
+ // A lambda is supplied as the completion handler, to be called when the
+ // operation completes.
+ std::error_code error;
+ T result;
+ init([&](std::error_code e, T t)
+ {
+ error = e;
+ result = t;
+ }, std::forward<Args>(args)...);
// Restart the io_context, as it may have been left in the "stopped" state
// by a previous operation.
@@ -108,7 +87,7 @@ public:
// the pending asynchronous operation is a composed operation, the deadline
// applies to the entire operation, rather than individual operations on
// the socket.
- io_context.run_for(timeout_);
+ io_context.run_for(token.timeout_);
// If the asynchronous operation completed successfully then the io_context
// would have been stopped due to running out of work. If it was not
@@ -117,21 +96,15 @@ public:
if (!io_context.stopped())
{
// Close the socket to cancel the outstanding asynchronous operation.
- socket_.close();
+ token.socket_.close();
// Run the io_context again until the operation completes.
io_context.run();
}
// If the operation failed, throw an exception. Otherwise return the result.
- return error_ ? throw std::system_error(error_) : t_;
+ return error ? throw std::system_error(error) : result;
}
-
-private:
- std::chrono::steady_clock::duration timeout_;
- tcp_socket& socket_;
- std::error_code error_;
- T t_;
};
} // namespace asio
diff --git a/3rdparty/asio/src/examples/cpp11/timeouts/blocking_udp_client.cpp b/3rdparty/asio/src/examples/cpp11/timeouts/blocking_udp_client.cpp
index 01eece472f4..312f21ab656 100644
--- a/3rdparty/asio/src/examples/cpp11/timeouts/blocking_udp_client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/timeouts/blocking_udp_client.cpp
@@ -2,7 +2,7 @@
// blocking_udp_client.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/timeouts/server.cpp b/3rdparty/asio/src/examples/cpp11/timeouts/server.cpp
index ac1f37f140f..6e18fc60c2b 100644
--- a/3rdparty/asio/src/examples/cpp11/timeouts/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/timeouts/server.cpp
@@ -2,7 +2,7 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp11/timers/time_t_timer.cpp b/3rdparty/asio/src/examples/cpp11/timers/time_t_timer.cpp
index 764ca586d1b..bca436d31e7 100644
--- a/3rdparty/asio/src/examples/cpp11/timers/time_t_timer.cpp
+++ b/3rdparty/asio/src/examples/cpp11/timers/time_t_timer.cpp
@@ -2,7 +2,7 @@
// time_t_timer.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/daytime1/client.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/daytime1/client.cpp
index 292a05ef039..9d927759f5c 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/daytime1/client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/daytime1/client.cpp
@@ -2,14 +2,14 @@
// client.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <array>
#include <iostream>
-#include <boost/array.hpp>
#include <asio.hpp>
using asio::ip::tcp;
@@ -35,15 +35,15 @@ int main(int argc, char* argv[])
for (;;)
{
- boost::array<char, 128> buf;
- asio::error_code error;
+ std::array<char, 128> buf;
+ std::error_code error;
size_t len = socket.read_some(asio::buffer(buf), error);
if (error == asio::error::eof)
break; // Connection closed cleanly by peer.
else if (error)
- throw asio::system_error(error); // Some other error.
+ throw std::system_error(error); // Some other error.
std::cout.write(buf.data(), len);
}
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/daytime2/server.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/daytime2/server.cpp
index 16dfa0101a0..971149d6e8d 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/daytime2/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/daytime2/server.cpp
@@ -2,7 +2,7 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -37,7 +37,7 @@ int main()
std::string message = make_daytime_string();
- asio::error_code ignored_error;
+ std::error_code ignored_error;
asio::write(socket, asio::buffer(message), ignored_error);
}
}
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/daytime3/server.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/daytime3/server.cpp
index 268401ffc6a..339de72d4a7 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/daytime3/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/daytime3/server.cpp
@@ -2,18 +2,17 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <ctime>
+#include <functional>
#include <iostream>
+#include <memory>
#include <string>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
#include <asio.hpp>
using asio::ip::tcp;
@@ -26,10 +25,10 @@ std::string make_daytime_string()
}
class tcp_connection
- : public boost::enable_shared_from_this<tcp_connection>
+ : public std::enable_shared_from_this<tcp_connection>
{
public:
- typedef boost::shared_ptr<tcp_connection> pointer;
+ typedef std::shared_ptr<tcp_connection> pointer;
static pointer create(asio::io_context& io_context)
{
@@ -46,7 +45,7 @@ public:
message_ = make_daytime_string();
asio::async_write(socket_, asio::buffer(message_),
- boost::bind(&tcp_connection::handle_write, shared_from_this(),
+ std::bind(&tcp_connection::handle_write, shared_from_this(),
asio::placeholders::error,
asio::placeholders::bytes_transferred));
}
@@ -57,7 +56,7 @@ private:
{
}
- void handle_write(const asio::error_code& /*error*/,
+ void handle_write(const std::error_code& /*error*/,
size_t /*bytes_transferred*/)
{
}
@@ -83,12 +82,12 @@ private:
tcp_connection::create(io_context_);
acceptor_.async_accept(new_connection->socket(),
- boost::bind(&tcp_server::handle_accept, this, new_connection,
+ std::bind(&tcp_server::handle_accept, this, new_connection,
asio::placeholders::error));
}
void handle_accept(tcp_connection::pointer new_connection,
- const asio::error_code& error)
+ const std::error_code& error)
{
if (!error)
{
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/daytime4/client.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/daytime4/client.cpp
index 24a325e0e88..15f3d5d4e98 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/daytime4/client.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/daytime4/client.cpp
@@ -2,14 +2,14 @@
// client.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <array>
#include <iostream>
-#include <boost/array.hpp>
#include <asio.hpp>
using asio::ip::udp;
@@ -33,10 +33,10 @@ int main(int argc, char* argv[])
udp::socket socket(io_context);
socket.open(udp::v4());
- boost::array<char, 1> send_buf = {{ 0 }};
+ std::array<char, 1> send_buf = {{ 0 }};
socket.send_to(asio::buffer(send_buf), receiver_endpoint);
- boost::array<char, 128> recv_buf;
+ std::array<char, 128> recv_buf;
udp::endpoint sender_endpoint;
size_t len = socket.receive_from(
asio::buffer(recv_buf), sender_endpoint);
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/daytime5/server.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/daytime5/server.cpp
index 0634b067ada..f47c9fa713b 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/daytime5/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/daytime5/server.cpp
@@ -2,16 +2,16 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <array>
#include <ctime>
#include <iostream>
#include <string>
-#include <boost/array.hpp>
#include <asio.hpp>
using asio::ip::udp;
@@ -33,13 +33,13 @@ int main()
for (;;)
{
- boost::array<char, 1> recv_buf;
+ std::array<char, 1> recv_buf;
udp::endpoint remote_endpoint;
socket.receive_from(asio::buffer(recv_buf), remote_endpoint);
std::string message = make_daytime_string();
- asio::error_code ignored_error;
+ std::error_code ignored_error;
socket.send_to(asio::buffer(message),
remote_endpoint, 0, ignored_error);
}
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/daytime6/server.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/daytime6/server.cpp
index ccf8b54e41c..42c80795a9e 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/daytime6/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/daytime6/server.cpp
@@ -2,18 +2,18 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <array>
#include <ctime>
+#include <functional>
#include <iostream>
+#include <memory>
#include <string>
-#include <boost/array.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <asio.hpp>
using asio::ip::udp;
@@ -39,21 +39,21 @@ private:
{
socket_.async_receive_from(
asio::buffer(recv_buffer_), remote_endpoint_,
- boost::bind(&udp_server::handle_receive, this,
+ std::bind(&udp_server::handle_receive, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred));
}
- void handle_receive(const asio::error_code& error,
+ void handle_receive(const std::error_code& error,
std::size_t /*bytes_transferred*/)
{
if (!error)
{
- boost::shared_ptr<std::string> message(
+ std::shared_ptr<std::string> message(
new std::string(make_daytime_string()));
socket_.async_send_to(asio::buffer(*message), remote_endpoint_,
- boost::bind(&udp_server::handle_send, this, message,
+ std::bind(&udp_server::handle_send, this, message,
asio::placeholders::error,
asio::placeholders::bytes_transferred));
@@ -61,15 +61,15 @@ private:
}
}
- void handle_send(boost::shared_ptr<std::string> /*message*/,
- const asio::error_code& /*error*/,
+ void handle_send(std::shared_ptr<std::string> /*message*/,
+ const std::error_code& /*error*/,
std::size_t /*bytes_transferred*/)
{
}
udp::socket socket_;
udp::endpoint remote_endpoint_;
- boost::array<char, 1> recv_buffer_;
+ std::array<char, 1> recv_buffer_;
};
int main()
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/daytime7/server.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/daytime7/server.cpp
index 2fec1084dbf..9c9c22edeb2 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/daytime7/server.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/daytime7/server.cpp
@@ -2,19 +2,18 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <array>
#include <ctime>
+#include <functional>
#include <iostream>
+#include <memory>
#include <string>
-#include <boost/array.hpp>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
#include <asio.hpp>
using asio::ip::tcp;
@@ -28,10 +27,10 @@ std::string make_daytime_string()
}
class tcp_connection
- : public boost::enable_shared_from_this<tcp_connection>
+ : public std::enable_shared_from_this<tcp_connection>
{
public:
- typedef boost::shared_ptr<tcp_connection> pointer;
+ typedef std::shared_ptr<tcp_connection> pointer;
static pointer create(asio::io_context& io_context)
{
@@ -48,7 +47,7 @@ public:
message_ = make_daytime_string();
asio::async_write(socket_, asio::buffer(message_),
- boost::bind(&tcp_connection::handle_write, shared_from_this()));
+ std::bind(&tcp_connection::handle_write, shared_from_this()));
}
private:
@@ -82,12 +81,12 @@ private:
tcp_connection::create(io_context_);
acceptor_.async_accept(new_connection->socket(),
- boost::bind(&tcp_server::handle_accept, this, new_connection,
+ std::bind(&tcp_server::handle_accept, this, new_connection,
asio::placeholders::error));
}
void handle_accept(tcp_connection::pointer new_connection,
- const asio::error_code& error)
+ const std::error_code& error)
{
if (!error)
{
@@ -115,31 +114,31 @@ private:
{
socket_.async_receive_from(
asio::buffer(recv_buffer_), remote_endpoint_,
- boost::bind(&udp_server::handle_receive, this,
+ std::bind(&udp_server::handle_receive, this,
asio::placeholders::error));
}
- void handle_receive(const asio::error_code& error)
+ void handle_receive(const std::error_code& error)
{
if (!error)
{
- boost::shared_ptr<std::string> message(
+ std::shared_ptr<std::string> message(
new std::string(make_daytime_string()));
socket_.async_send_to(asio::buffer(*message), remote_endpoint_,
- boost::bind(&udp_server::handle_send, this, message));
+ std::bind(&udp_server::handle_send, this, message));
start_receive();
}
}
- void handle_send(boost::shared_ptr<std::string> /*message*/)
+ void handle_send(std::shared_ptr<std::string> /*message*/)
{
}
udp::socket socket_;
udp::endpoint remote_endpoint_;
- boost::array<char, 1> recv_buffer_;
+ std::array<char, 1> recv_buffer_;
};
int main()
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/timer1/timer.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/timer1/timer.cpp
index 35ad17c6496..37577dcb65f 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/timer1/timer.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/timer1/timer.cpp
@@ -2,7 +2,7 @@
// timer.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/timer2/timer.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/timer2/timer.cpp
index 10f0b528a44..c1620d78fa5 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/timer2/timer.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/timer2/timer.cpp
@@ -2,7 +2,7 @@
// timer.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -11,7 +11,7 @@
#include <iostream>
#include <asio.hpp>
-void print(const asio::error_code& /*e*/)
+void print(const std::error_code& /*e*/)
{
std::cout << "Hello, world!" << std::endl;
}
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/timer3/timer.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/timer3/timer.cpp
index b2e27b73dc5..990ea069739 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/timer3/timer.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/timer3/timer.cpp
@@ -2,17 +2,17 @@
// timer.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <functional>
#include <iostream>
#include <asio.hpp>
-#include <boost/bind/bind.hpp>
-void print(const asio::error_code& /*e*/,
+void print(const std::error_code& /*e*/,
asio::steady_timer* t, int* count)
{
if (*count < 5)
@@ -21,7 +21,7 @@ void print(const asio::error_code& /*e*/,
++(*count);
t->expires_at(t->expiry() + asio::chrono::seconds(1));
- t->async_wait(boost::bind(print,
+ t->async_wait(std::bind(print,
asio::placeholders::error, t, count));
}
}
@@ -32,7 +32,7 @@ int main()
int count = 0;
asio::steady_timer t(io, asio::chrono::seconds(1));
- t.async_wait(boost::bind(print,
+ t.async_wait(std::bind(print,
asio::placeholders::error, &t, &count));
io.run();
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/timer4/timer.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/timer4/timer.cpp
index ebc6d0999dd..7bfdd3e43a8 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/timer4/timer.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/timer4/timer.cpp
@@ -2,15 +2,15 @@
// timer.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <functional>
#include <iostream>
#include <asio.hpp>
-#include <boost/bind/bind.hpp>
class printer
{
@@ -19,7 +19,7 @@ public:
: timer_(io, asio::chrono::seconds(1)),
count_(0)
{
- timer_.async_wait(boost::bind(&printer::print, this));
+ timer_.async_wait(std::bind(&printer::print, this));
}
~printer()
@@ -35,7 +35,7 @@ public:
++count_;
timer_.expires_at(timer_.expiry() + asio::chrono::seconds(1));
- timer_.async_wait(boost::bind(&printer::print, this));
+ timer_.async_wait(std::bind(&printer::print, this));
}
}
diff --git a/3rdparty/asio/src/examples/cpp03/tutorial/timer5/timer.cpp b/3rdparty/asio/src/examples/cpp11/tutorial/timer5/timer.cpp
index f17c9d67f94..61830691e7a 100644
--- a/3rdparty/asio/src/examples/cpp03/tutorial/timer5/timer.cpp
+++ b/3rdparty/asio/src/examples/cpp11/tutorial/timer5/timer.cpp
@@ -2,15 +2,16 @@
// timer.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <functional>
#include <iostream>
+#include <thread>
#include <asio.hpp>
-#include <boost/bind/bind.hpp>
class printer
{
@@ -22,10 +23,10 @@ public:
count_(0)
{
timer1_.async_wait(asio::bind_executor(strand_,
- boost::bind(&printer::print1, this)));
+ std::bind(&printer::print1, this)));
timer2_.async_wait(asio::bind_executor(strand_,
- boost::bind(&printer::print2, this)));
+ std::bind(&printer::print2, this)));
}
~printer()
@@ -43,7 +44,7 @@ public:
timer1_.expires_at(timer1_.expiry() + asio::chrono::seconds(1));
timer1_.async_wait(asio::bind_executor(strand_,
- boost::bind(&printer::print1, this)));
+ std::bind(&printer::print1, this)));
}
}
@@ -57,7 +58,7 @@ public:
timer2_.expires_at(timer2_.expiry() + asio::chrono::seconds(1));
timer2_.async_wait(asio::bind_executor(strand_,
- boost::bind(&printer::print2, this)));
+ std::bind(&printer::print2, this)));
}
}
@@ -72,7 +73,7 @@ int main()
{
asio::io_context io;
printer p(io);
- asio::thread t(boost::bind(&asio::io_context::run, &io));
+ std::thread t([&]{ io.run(); });
io.run();
t.join();
diff --git a/3rdparty/asio/src/examples/cpp11/type_erasure/line_reader.hpp b/3rdparty/asio/src/examples/cpp11/type_erasure/line_reader.hpp
new file mode 100644
index 00000000000..87f05486b79
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/type_erasure/line_reader.hpp
@@ -0,0 +1,48 @@
+//
+// line_reader.hpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 LINE_READER_HPP
+#define LINE_READER_HPP
+
+#include <asio/any_completion_handler.hpp>
+#include <asio/async_result.hpp>
+#include <asio/error.hpp>
+#include <string>
+
+class line_reader
+{
+private:
+ virtual void async_read_line_impl(std::string prompt,
+ asio::any_completion_handler<void(std::error_code, std::string)> handler) = 0;
+
+ struct initiate_read_line
+ {
+ template <typename Handler>
+ void operator()(Handler handler, line_reader* self, std::string prompt)
+ {
+ self->async_read_line_impl(std::move(prompt), std::move(handler));
+ }
+ };
+
+public:
+ virtual ~line_reader() {}
+
+ template <typename CompletionToken>
+ auto async_read_line(std::string prompt, CompletionToken&& token)
+ -> decltype(
+ asio::async_initiate<CompletionToken, void(std::error_code, std::string)>(
+ initiate_read_line(), token, this, prompt))
+ {
+ return asio::async_initiate<CompletionToken, void(std::error_code, std::string)>(
+ initiate_read_line(), token, this, prompt);
+ }
+};
+
+#endif // LINE_READER_HPP
diff --git a/3rdparty/asio/src/examples/cpp11/type_erasure/main.cpp b/3rdparty/asio/src/examples/cpp11/type_erasure/main.cpp
new file mode 100644
index 00000000000..2111de6853b
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/type_erasure/main.cpp
@@ -0,0 +1,60 @@
+//
+// main.cpp
+// ~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 "line_reader.hpp"
+#include "sleep.hpp"
+#include "stdin_line_reader.hpp"
+#include <asio/coroutine.hpp>
+#include <asio/detached.hpp>
+#include <asio/io_context.hpp>
+#include <asio/use_awaitable.hpp>
+#include <iostream>
+
+#include <asio/yield.hpp>
+
+class read_loop : asio::coroutine
+{
+public:
+ read_loop(asio::any_io_executor e, line_reader& r)
+ : executor(std::move(e)),
+ reader(r)
+ {
+ }
+
+ void operator()(std::error_code ec = {}, std::string line = {})
+ {
+ reenter (this)
+ {
+ for (i = 0; i < 10; ++i)
+ {
+ yield reader.async_read_line("Enter something: ", *this);
+ if (ec) break;
+ std::cout << line;
+ yield async_sleep(executor, std::chrono::seconds(1), *this);
+ if (ec) break;
+ }
+ }
+ }
+
+private:
+ asio::any_io_executor executor;
+ line_reader& reader;
+ int i;
+};
+
+#include <asio/unyield.hpp>
+
+int main()
+{
+ asio::io_context ctx{1};
+ stdin_line_reader reader{ctx.get_executor()};
+ read_loop(ctx.get_executor(), reader)();
+ ctx.run();
+}
diff --git a/3rdparty/asio/src/examples/cpp11/type_erasure/sleep.cpp b/3rdparty/asio/src/examples/cpp11/type_erasure/sleep.cpp
new file mode 100644
index 00000000000..b605866ebd7
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/type_erasure/sleep.cpp
@@ -0,0 +1,22 @@
+//
+// sleep.cpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 "sleep.hpp"
+#include <asio/consign.hpp>
+#include <asio/steady_timer.hpp>
+#include <memory>
+
+void async_sleep_impl(
+ asio::any_completion_handler<void(std::error_code)> handler,
+ asio::any_io_executor ex, std::chrono::nanoseconds duration)
+{
+ auto timer = std::make_shared<asio::steady_timer>(ex, duration);
+ timer->async_wait(asio::consign(std::move(handler), timer));
+}
diff --git a/3rdparty/asio/src/examples/cpp11/type_erasure/sleep.hpp b/3rdparty/asio/src/examples/cpp11/type_erasure/sleep.hpp
new file mode 100644
index 00000000000..299397a833c
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/type_erasure/sleep.hpp
@@ -0,0 +1,35 @@
+//
+// sleep.hpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 SLEEP_HPP
+#define SLEEP_HPP
+
+#include <asio/any_completion_handler.hpp>
+#include <asio/any_io_executor.hpp>
+#include <asio/async_result.hpp>
+#include <asio/error.hpp>
+#include <chrono>
+
+void async_sleep_impl(
+ asio::any_completion_handler<void(std::error_code)> handler,
+ asio::any_io_executor ex, std::chrono::nanoseconds duration);
+
+template <typename CompletionToken>
+inline auto async_sleep(asio::any_io_executor ex,
+ std::chrono::nanoseconds duration, CompletionToken&& token)
+ -> decltype(
+ asio::async_initiate<CompletionToken, void(std::error_code)>(
+ async_sleep_impl, token, std::move(ex), duration))
+{
+ return asio::async_initiate<CompletionToken, void(std::error_code)>(
+ async_sleep_impl, token, std::move(ex), duration);
+}
+
+#endif // SLEEP_HPP
diff --git a/3rdparty/asio/src/examples/cpp11/type_erasure/stdin_line_reader.cpp b/3rdparty/asio/src/examples/cpp11/type_erasure/stdin_line_reader.cpp
new file mode 100644
index 00000000000..d2e25e437a6
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/type_erasure/stdin_line_reader.cpp
@@ -0,0 +1,44 @@
+//
+// stdin_line_reader.cpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 "stdin_line_reader.hpp"
+#include <asio/deferred.hpp>
+#include <asio/read_until.hpp>
+#include <iostream>
+
+stdin_line_reader::stdin_line_reader(asio::any_io_executor ex)
+ : stdin_(ex, ::dup(STDIN_FILENO))
+{
+}
+
+void stdin_line_reader::async_read_line_impl(std::string prompt,
+ asio::any_completion_handler<void(std::error_code, std::string)> handler)
+{
+ std::cout << prompt;
+ std::cout.flush();
+
+ asio::async_read_until(stdin_, asio::dynamic_buffer(buffer_), '\n',
+ asio::deferred(
+ [this](std::error_code ec, std::size_t n)
+ {
+ if (!ec)
+ {
+ std::string result = buffer_.substr(0, n);
+ buffer_.erase(0, n);
+ return asio::deferred.values(ec, std::move(result));
+ }
+ else
+ {
+ return asio::deferred.values(ec, std::string{});
+ }
+ }
+ )
+ )(std::move(handler));
+}
diff --git a/3rdparty/asio/src/examples/cpp11/type_erasure/stdin_line_reader.hpp b/3rdparty/asio/src/examples/cpp11/type_erasure/stdin_line_reader.hpp
new file mode 100644
index 00000000000..43e67424367
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp11/type_erasure/stdin_line_reader.hpp
@@ -0,0 +1,30 @@
+//
+// stdin_line_reader.hpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 STDIN_LINE_READER_HPP
+#define STDIN_LINE_READER_HPP
+
+#include "line_reader.hpp"
+#include <asio/posix/stream_descriptor.hpp>
+
+class stdin_line_reader : public line_reader
+{
+public:
+ explicit stdin_line_reader(asio::any_io_executor ex);
+
+private:
+ void async_read_line_impl(std::string prompt,
+ asio::any_completion_handler<void(std::error_code, std::string)> handler) override;
+
+ asio::posix::stream_descriptor stdin_;
+ std::string buffer_;
+};
+
+#endif
diff --git a/3rdparty/asio/src/examples/cpp03/windows/transmit_file.cpp b/3rdparty/asio/src/examples/cpp11/windows/transmit_file.cpp
index 6026f02ea48..0ffd0486c43 100644
--- a/3rdparty/asio/src/examples/cpp03/windows/transmit_file.cpp
+++ b/3rdparty/asio/src/examples/cpp11/windows/transmit_file.cpp
@@ -2,18 +2,17 @@
// transmit_file.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <ctime>
+#include <functional>
#include <iostream>
+#include <memory>
#include <string>
-#include <boost/bind/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
#include "asio.hpp"
#if defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
@@ -47,7 +46,7 @@ void transmit_file(tcp_socket& socket,
// The operation completed immediately, so a completion notification needs
// to be posted. When complete() is called, ownership of the OVERLAPPED-
// derived object passes to the io_context.
- asio::error_code ec(last_error,
+ std::error_code ec(last_error,
asio::error::get_system_category());
overlapped.complete(ec, 0);
}
@@ -60,10 +59,10 @@ void transmit_file(tcp_socket& socket,
}
class connection
- : public boost::enable_shared_from_this<connection>
+ : public std::enable_shared_from_this<connection>
{
public:
- typedef boost::shared_ptr<connection> pointer;
+ typedef std::shared_ptr<connection> pointer;
static pointer create(asio::io_context& io_context,
const std::string& filename)
@@ -78,13 +77,13 @@ public:
void start()
{
- asio::error_code ec;
+ std::error_code ec;
file_.assign(::CreateFile(filename_.c_str(), GENERIC_READ, 0, 0,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, 0), ec);
if (file_.is_open())
{
transmit_file(socket_, file_,
- boost::bind(&connection::handle_write, shared_from_this(),
+ std::bind(&connection::handle_write, shared_from_this(),
asio::placeholders::error,
asio::placeholders::bytes_transferred));
}
@@ -98,10 +97,10 @@ private:
{
}
- void handle_write(const asio::error_code& /*error*/,
+ void handle_write(const std::error_code& /*error*/,
size_t /*bytes_transferred*/)
{
- asio::error_code ignored_ec;
+ std::error_code ignored_ec;
socket_.shutdown(tcp_socket::shutdown_both, ignored_ec);
}
@@ -128,12 +127,12 @@ private:
connection::create(acceptor_.get_executor().context(), filename_);
acceptor_.async_accept(new_connection->socket(),
- boost::bind(&server::handle_accept, this, new_connection,
+ std::bind(&server::handle_accept, this, new_connection,
asio::placeholders::error));
}
void handle_accept(connection::pointer new_connection,
- const asio::error_code& error)
+ const std::error_code& error)
{
if (!error)
{
diff --git a/3rdparty/asio/src/examples/cpp14/Makefile.am b/3rdparty/asio/src/examples/cpp14/Makefile.am
index 50aca20a357..2ddf12a8a2f 100644
--- a/3rdparty/asio/src/examples/cpp14/Makefile.am
+++ b/3rdparty/asio/src/examples/cpp14/Makefile.am
@@ -32,6 +32,9 @@ noinst_PROGRAMS = \
executors/pipeline \
executors/priority_scheduler \
iostreams/http_client \
+ operations/c_callback_wrapper \
+ operations/callback_wrapper \
+ operations/composed_1 \
operations/composed_1 \
operations/composed_2 \
operations/composed_3 \
@@ -41,6 +44,7 @@ noinst_PROGRAMS = \
operations/composed_7 \
operations/composed_8 \
parallel_group/parallel_sort \
+ parallel_group/ranged_wait_for_all \
parallel_group/wait_for_all \
parallel_group/wait_for_one \
parallel_group/wait_for_one_error \
@@ -70,6 +74,8 @@ executors_fork_join_SOURCES = executors/fork_join.cpp
executors_pipeline_SOURCES = executors/pipeline.cpp
executors_priority_scheduler_SOURCES = executors/priority_scheduler.cpp
iostreams_http_client_SOURCES = iostreams/http_client.cpp
+operations_c_callback_wrapper_SOURCES = operations/c_callback_wrapper.cpp
+operations_callback_wrapper_SOURCES = operations/callback_wrapper.cpp
operations_composed_1_SOURCES = operations/composed_1.cpp
operations_composed_2_SOURCES = operations/composed_2.cpp
operations_composed_3_SOURCES = operations/composed_3.cpp
@@ -79,6 +85,7 @@ operations_composed_6_SOURCES = operations/composed_6.cpp
operations_composed_7_SOURCES = operations/composed_7.cpp
operations_composed_8_SOURCES = operations/composed_8.cpp
parallel_group_parallel_sort_SOURCES = parallel_group/parallel_sort.cpp
+parallel_group_ranged_wait_for_all_SOURCES = parallel_group/ranged_wait_for_all.cpp
parallel_group_wait_for_all_SOURCES = parallel_group/wait_for_all.cpp
parallel_group_wait_for_one_SOURCES = parallel_group/wait_for_one.cpp
parallel_group_wait_for_one_error_SOURCES = parallel_group/wait_for_one_error.cpp
diff --git a/3rdparty/asio/src/examples/cpp14/Makefile.in b/3rdparty/asio/src/examples/cpp14/Makefile.in
index a6e79dc8e7e..23fdb3fc1e2 100644
--- a/3rdparty/asio/src/examples/cpp14/Makefile.in
+++ b/3rdparty/asio/src/examples/cpp14/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -105,12 +105,16 @@ noinst_PROGRAMS = deferred/deferred_1$(EXEEXT) \
executors/bank_account_2$(EXEEXT) executors/fork_join$(EXEEXT) \
executors/pipeline$(EXEEXT) \
executors/priority_scheduler$(EXEEXT) \
- iostreams/http_client$(EXEEXT) operations/composed_1$(EXEEXT) \
+ iostreams/http_client$(EXEEXT) \
+ operations/c_callback_wrapper$(EXEEXT) \
+ operations/callback_wrapper$(EXEEXT) \
+ operations/composed_1$(EXEEXT) operations/composed_1$(EXEEXT) \
operations/composed_2$(EXEEXT) operations/composed_3$(EXEEXT) \
operations/composed_4$(EXEEXT) operations/composed_5$(EXEEXT) \
operations/composed_6$(EXEEXT) operations/composed_7$(EXEEXT) \
operations/composed_8$(EXEEXT) \
parallel_group/parallel_sort$(EXEEXT) \
+ parallel_group/ranged_wait_for_all$(EXEEXT) \
parallel_group/wait_for_all$(EXEEXT) \
parallel_group/wait_for_one$(EXEEXT) \
parallel_group/wait_for_one_error$(EXEEXT) \
@@ -266,6 +270,20 @@ iostreams_http_client_OBJECTS = $(am_iostreams_http_client_OBJECTS)
iostreams_http_client_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@iostreams_http_client_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_c_callback_wrapper_OBJECTS = \
+ operations/c_callback_wrapper.$(OBJEXT)
+operations_c_callback_wrapper_OBJECTS = \
+ $(am_operations_c_callback_wrapper_OBJECTS)
+operations_c_callback_wrapper_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_c_callback_wrapper_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_callback_wrapper_OBJECTS = \
+ operations/callback_wrapper.$(OBJEXT)
+operations_callback_wrapper_OBJECTS = \
+ $(am_operations_callback_wrapper_OBJECTS)
+operations_callback_wrapper_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_callback_wrapper_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_operations_composed_1_OBJECTS = operations/composed_1.$(OBJEXT)
operations_composed_1_OBJECTS = $(am_operations_composed_1_OBJECTS)
operations_composed_1_LDADD = $(LDADD)
@@ -313,6 +331,13 @@ parallel_group_parallel_sort_OBJECTS = \
parallel_group_parallel_sort_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@parallel_group_parallel_sort_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_parallel_group_ranged_wait_for_all_OBJECTS = \
+ parallel_group/ranged_wait_for_all.$(OBJEXT)
+parallel_group_ranged_wait_for_all_OBJECTS = \
+ $(am_parallel_group_ranged_wait_for_all_OBJECTS)
+parallel_group_ranged_wait_for_all_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@parallel_group_ranged_wait_for_all_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_parallel_group_wait_for_all_OBJECTS = \
parallel_group/wait_for_all.$(OBJEXT)
parallel_group_wait_for_all_OBJECTS = \
@@ -378,6 +403,8 @@ am__depfiles_remade = ../../$(DEPDIR)/asio.Po \
executors/$(DEPDIR)/pipeline.Po \
executors/$(DEPDIR)/priority_scheduler.Po \
iostreams/$(DEPDIR)/http_client.Po \
+ operations/$(DEPDIR)/c_callback_wrapper.Po \
+ operations/$(DEPDIR)/callback_wrapper.Po \
operations/$(DEPDIR)/composed_1.Po \
operations/$(DEPDIR)/composed_2.Po \
operations/$(DEPDIR)/composed_3.Po \
@@ -387,6 +414,7 @@ am__depfiles_remade = ../../$(DEPDIR)/asio.Po \
operations/$(DEPDIR)/composed_7.Po \
operations/$(DEPDIR)/composed_8.Po \
parallel_group/$(DEPDIR)/parallel_sort.Po \
+ parallel_group/$(DEPDIR)/ranged_wait_for_all.Po \
parallel_group/$(DEPDIR)/wait_for_all.Po \
parallel_group/$(DEPDIR)/wait_for_one.Po \
parallel_group/$(DEPDIR)/wait_for_one_error.Po \
@@ -422,6 +450,8 @@ SOURCES = $(libasio_a_SOURCES) $(deferred_deferred_1_SOURCES) \
$(executors_fork_join_SOURCES) $(executors_pipeline_SOURCES) \
$(executors_priority_scheduler_SOURCES) \
$(iostreams_http_client_SOURCES) \
+ $(operations_c_callback_wrapper_SOURCES) \
+ $(operations_callback_wrapper_SOURCES) \
$(operations_composed_1_SOURCES) \
$(operations_composed_2_SOURCES) \
$(operations_composed_3_SOURCES) \
@@ -431,6 +461,7 @@ SOURCES = $(libasio_a_SOURCES) $(deferred_deferred_1_SOURCES) \
$(operations_composed_7_SOURCES) \
$(operations_composed_8_SOURCES) \
$(parallel_group_parallel_sort_SOURCES) \
+ $(parallel_group_ranged_wait_for_all_SOURCES) \
$(parallel_group_wait_for_all_SOURCES) \
$(parallel_group_wait_for_one_SOURCES) \
$(parallel_group_wait_for_one_error_SOURCES) \
@@ -453,6 +484,8 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(executors_fork_join_SOURCES) $(executors_pipeline_SOURCES) \
$(executors_priority_scheduler_SOURCES) \
$(iostreams_http_client_SOURCES) \
+ $(operations_c_callback_wrapper_SOURCES) \
+ $(operations_callback_wrapper_SOURCES) \
$(operations_composed_1_SOURCES) \
$(operations_composed_2_SOURCES) \
$(operations_composed_3_SOURCES) \
@@ -462,6 +495,7 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(operations_composed_7_SOURCES) \
$(operations_composed_8_SOURCES) \
$(parallel_group_parallel_sort_SOURCES) \
+ $(parallel_group_ranged_wait_for_all_SOURCES) \
$(parallel_group_wait_for_all_SOURCES) \
$(parallel_group_wait_for_one_SOURCES) \
$(parallel_group_wait_for_one_error_SOURCES) \
@@ -488,8 +522,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -503,8 +535,9 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
-CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -513,9 +546,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
-GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -582,9 +614,11 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -621,6 +655,8 @@ executors_fork_join_SOURCES = executors/fork_join.cpp
executors_pipeline_SOURCES = executors/pipeline.cpp
executors_priority_scheduler_SOURCES = executors/priority_scheduler.cpp
iostreams_http_client_SOURCES = iostreams/http_client.cpp
+operations_c_callback_wrapper_SOURCES = operations/c_callback_wrapper.cpp
+operations_callback_wrapper_SOURCES = operations/callback_wrapper.cpp
operations_composed_1_SOURCES = operations/composed_1.cpp
operations_composed_2_SOURCES = operations/composed_2.cpp
operations_composed_3_SOURCES = operations/composed_3.cpp
@@ -630,6 +666,7 @@ operations_composed_6_SOURCES = operations/composed_6.cpp
operations_composed_7_SOURCES = operations/composed_7.cpp
operations_composed_8_SOURCES = operations/composed_8.cpp
parallel_group_parallel_sort_SOURCES = parallel_group/parallel_sort.cpp
+parallel_group_ranged_wait_for_all_SOURCES = parallel_group/ranged_wait_for_all.cpp
parallel_group_wait_for_all_SOURCES = parallel_group/wait_for_all.cpp
parallel_group_wait_for_one_SOURCES = parallel_group/wait_for_one.cpp
parallel_group_wait_for_one_error_SOURCES = parallel_group/wait_for_one_error.cpp
@@ -853,6 +890,18 @@ operations/$(am__dirstamp):
operations/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) operations/$(DEPDIR)
@: > operations/$(DEPDIR)/$(am__dirstamp)
+operations/c_callback_wrapper.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/c_callback_wrapper$(EXEEXT): $(operations_c_callback_wrapper_OBJECTS) $(operations_c_callback_wrapper_DEPENDENCIES) $(EXTRA_operations_c_callback_wrapper_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/c_callback_wrapper$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_c_callback_wrapper_OBJECTS) $(operations_c_callback_wrapper_LDADD) $(LIBS)
+operations/callback_wrapper.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/callback_wrapper$(EXEEXT): $(operations_callback_wrapper_OBJECTS) $(operations_callback_wrapper_DEPENDENCIES) $(EXTRA_operations_callback_wrapper_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/callback_wrapper$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_callback_wrapper_OBJECTS) $(operations_callback_wrapper_LDADD) $(LIBS)
operations/composed_1.$(OBJEXT): operations/$(am__dirstamp) \
operations/$(DEPDIR)/$(am__dirstamp)
@@ -914,6 +963,13 @@ parallel_group/parallel_sort.$(OBJEXT): \
parallel_group/parallel_sort$(EXEEXT): $(parallel_group_parallel_sort_OBJECTS) $(parallel_group_parallel_sort_DEPENDENCIES) $(EXTRA_parallel_group_parallel_sort_DEPENDENCIES) parallel_group/$(am__dirstamp)
@rm -f parallel_group/parallel_sort$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(parallel_group_parallel_sort_OBJECTS) $(parallel_group_parallel_sort_LDADD) $(LIBS)
+parallel_group/ranged_wait_for_all.$(OBJEXT): \
+ parallel_group/$(am__dirstamp) \
+ parallel_group/$(DEPDIR)/$(am__dirstamp)
+
+parallel_group/ranged_wait_for_all$(EXEEXT): $(parallel_group_ranged_wait_for_all_OBJECTS) $(parallel_group_ranged_wait_for_all_DEPENDENCIES) $(EXTRA_parallel_group_ranged_wait_for_all_DEPENDENCIES) parallel_group/$(am__dirstamp)
+ @rm -f parallel_group/ranged_wait_for_all$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(parallel_group_ranged_wait_for_all_OBJECTS) $(parallel_group_ranged_wait_for_all_LDADD) $(LIBS)
parallel_group/wait_for_all.$(OBJEXT): parallel_group/$(am__dirstamp) \
parallel_group/$(DEPDIR)/$(am__dirstamp)
@@ -978,6 +1034,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@executors/$(DEPDIR)/pipeline.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@executors/$(DEPDIR)/priority_scheduler.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@iostreams/$(DEPDIR)/http_client.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/c_callback_wrapper.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/callback_wrapper.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_1.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_2.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_3.Po@am__quote@ # am--include-marker
@@ -987,6 +1045,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_7.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_8.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/parallel_sort.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/ranged_wait_for_all.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/wait_for_all.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/wait_for_one.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@parallel_group/$(DEPDIR)/wait_for_one_error.Po@am__quote@ # am--include-marker
@@ -1065,7 +1124,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -1178,6 +1236,8 @@ distclean: distclean-am
-rm -f executors/$(DEPDIR)/pipeline.Po
-rm -f executors/$(DEPDIR)/priority_scheduler.Po
-rm -f iostreams/$(DEPDIR)/http_client.Po
+ -rm -f operations/$(DEPDIR)/c_callback_wrapper.Po
+ -rm -f operations/$(DEPDIR)/callback_wrapper.Po
-rm -f operations/$(DEPDIR)/composed_1.Po
-rm -f operations/$(DEPDIR)/composed_2.Po
-rm -f operations/$(DEPDIR)/composed_3.Po
@@ -1187,6 +1247,7 @@ distclean: distclean-am
-rm -f operations/$(DEPDIR)/composed_7.Po
-rm -f operations/$(DEPDIR)/composed_8.Po
-rm -f parallel_group/$(DEPDIR)/parallel_sort.Po
+ -rm -f parallel_group/$(DEPDIR)/ranged_wait_for_all.Po
-rm -f parallel_group/$(DEPDIR)/wait_for_all.Po
-rm -f parallel_group/$(DEPDIR)/wait_for_one.Po
-rm -f parallel_group/$(DEPDIR)/wait_for_one_error.Po
@@ -1260,6 +1321,8 @@ maintainer-clean: maintainer-clean-am
-rm -f executors/$(DEPDIR)/pipeline.Po
-rm -f executors/$(DEPDIR)/priority_scheduler.Po
-rm -f iostreams/$(DEPDIR)/http_client.Po
+ -rm -f operations/$(DEPDIR)/c_callback_wrapper.Po
+ -rm -f operations/$(DEPDIR)/callback_wrapper.Po
-rm -f operations/$(DEPDIR)/composed_1.Po
-rm -f operations/$(DEPDIR)/composed_2.Po
-rm -f operations/$(DEPDIR)/composed_3.Po
@@ -1269,6 +1332,7 @@ maintainer-clean: maintainer-clean-am
-rm -f operations/$(DEPDIR)/composed_7.Po
-rm -f operations/$(DEPDIR)/composed_8.Po
-rm -f parallel_group/$(DEPDIR)/parallel_sort.Po
+ -rm -f parallel_group/$(DEPDIR)/ranged_wait_for_all.Po
-rm -f parallel_group/$(DEPDIR)/wait_for_all.Po
-rm -f parallel_group/$(DEPDIR)/wait_for_one.Po
-rm -f parallel_group/$(DEPDIR)/wait_for_one_error.Po
diff --git a/3rdparty/asio/src/examples/cpp14/deferred/deferred_1.cpp b/3rdparty/asio/src/examples/cpp14/deferred/deferred_1.cpp
index 732fa4fa9b5..db9213eb3be 100644
--- a/3rdparty/asio/src/examples/cpp14/deferred/deferred_1.cpp
+++ b/3rdparty/asio/src/examples/cpp14/deferred/deferred_1.cpp
@@ -2,17 +2,16 @@
// deferred_1.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <asio/experimental/deferred.hpp>
#include <iostream>
-using asio::experimental::deferred;
+using asio::deferred;
int main()
{
diff --git a/3rdparty/asio/src/examples/cpp14/deferred/deferred_2.cpp b/3rdparty/asio/src/examples/cpp14/deferred/deferred_2.cpp
index c33bbc2a5ed..07528282de5 100644
--- a/3rdparty/asio/src/examples/cpp14/deferred/deferred_2.cpp
+++ b/3rdparty/asio/src/examples/cpp14/deferred/deferred_2.cpp
@@ -2,17 +2,16 @@
// deferred_2.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <asio/experimental/deferred.hpp>
#include <iostream>
-using asio::experimental::deferred;
+using asio::deferred;
int main()
{
diff --git a/3rdparty/asio/src/examples/cpp14/deferred/deferred_3.cpp b/3rdparty/asio/src/examples/cpp14/deferred/deferred_3.cpp
index 484dfca638f..396e40840a1 100644
--- a/3rdparty/asio/src/examples/cpp14/deferred/deferred_3.cpp
+++ b/3rdparty/asio/src/examples/cpp14/deferred/deferred_3.cpp
@@ -2,17 +2,16 @@
// deferred_3.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <asio/experimental/deferred.hpp>
#include <iostream>
-using asio::experimental::deferred;
+using asio::deferred;
template <typename CompletionToken>
auto async_wait_twice(asio::steady_timer& timer, CompletionToken&& token)
diff --git a/3rdparty/asio/src/examples/cpp14/deferred/deferred_4.cpp b/3rdparty/asio/src/examples/cpp14/deferred/deferred_4.cpp
index 1f70821eaa5..a8ea73336d2 100644
--- a/3rdparty/asio/src/examples/cpp14/deferred/deferred_4.cpp
+++ b/3rdparty/asio/src/examples/cpp14/deferred/deferred_4.cpp
@@ -2,17 +2,16 @@
// deferred_4.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <asio/experimental/deferred.hpp>
#include <iostream>
-using asio::experimental::deferred;
+using asio::deferred;
template <typename CompletionToken>
auto async_wait_twice(asio::steady_timer& timer, CompletionToken&& token)
diff --git a/3rdparty/asio/src/examples/cpp14/deferred/deferred_5.cpp b/3rdparty/asio/src/examples/cpp14/deferred/deferred_5.cpp
index b48056bd66d..d262b977811 100644
--- a/3rdparty/asio/src/examples/cpp14/deferred/deferred_5.cpp
+++ b/3rdparty/asio/src/examples/cpp14/deferred/deferred_5.cpp
@@ -2,17 +2,16 @@
// deferred_5.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <asio/experimental/deferred.hpp>
#include <iostream>
-using asio::experimental::deferred;
+using asio::deferred;
template <typename CompletionToken>
auto async_wait_twice(asio::steady_timer& timer, CompletionToken&& token)
diff --git a/3rdparty/asio/src/examples/cpp14/deferred/deferred_6.cpp b/3rdparty/asio/src/examples/cpp14/deferred/deferred_6.cpp
index 502d43bc67c..7ccef58cc5c 100644
--- a/3rdparty/asio/src/examples/cpp14/deferred/deferred_6.cpp
+++ b/3rdparty/asio/src/examples/cpp14/deferred/deferred_6.cpp
@@ -2,19 +2,17 @@
// deferred_6.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <asio/experimental/append.hpp>
-#include <asio/experimental/deferred.hpp>
#include <iostream>
-using asio::experimental::append;
-using asio::experimental::deferred;
+using asio::append;
+using asio::deferred;
template <typename CompletionToken>
auto async_wait_twice(asio::steady_timer& timer, CompletionToken&& token)
diff --git a/3rdparty/asio/src/examples/cpp14/deferred/deferred_7.cpp b/3rdparty/asio/src/examples/cpp14/deferred/deferred_7.cpp
index da49fc7040e..b0734542c79 100644
--- a/3rdparty/asio/src/examples/cpp14/deferred/deferred_7.cpp
+++ b/3rdparty/asio/src/examples/cpp14/deferred/deferred_7.cpp
@@ -2,19 +2,17 @@
// deferred_7.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <asio/experimental/append.hpp>
-#include <asio/experimental/deferred.hpp>
#include <iostream>
-using asio::experimental::append;
-using asio::experimental::deferred;
+using asio::append;
+using asio::deferred;
template <typename CompletionToken>
auto async_wait_twice(asio::steady_timer& timer, CompletionToken&& token)
diff --git a/3rdparty/asio/src/examples/cpp14/echo/async_tcp_echo_server.cpp b/3rdparty/asio/src/examples/cpp14/echo/async_tcp_echo_server.cpp
index 49f17c2a3c1..9bd1b727500 100644
--- a/3rdparty/asio/src/examples/cpp14/echo/async_tcp_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp14/echo/async_tcp_echo_server.cpp
@@ -2,7 +2,7 @@
// async_tcp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp14/echo/async_udp_echo_server.cpp b/3rdparty/asio/src/examples/cpp14/echo/async_udp_echo_server.cpp
index ea9a1da88a0..b059af95b82 100644
--- a/3rdparty/asio/src/examples/cpp14/echo/async_udp_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp14/echo/async_udp_echo_server.cpp
@@ -2,7 +2,7 @@
// async_udp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_client.cpp b/3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_client.cpp
index 96a843e41ad..8a281203f89 100644
--- a/3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_client.cpp
+++ b/3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_client.cpp
@@ -2,7 +2,7 @@
// blocking_tcp_echo_client.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_server.cpp b/3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_server.cpp
index bcc5d4bb682..2116712616a 100644
--- a/3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp14/echo/blocking_tcp_echo_server.cpp
@@ -2,7 +2,7 @@
// blocking_tcp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_client.cpp b/3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_client.cpp
index 855f9e14e2a..4c8a2849d5b 100644
--- a/3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_client.cpp
+++ b/3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_client.cpp
@@ -2,7 +2,7 @@
// blocking_udp_echo_client.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_server.cpp b/3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_server.cpp
index 816f6aeab6b..c3098bdb8fc 100644
--- a/3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp14/echo/blocking_udp_echo_server.cpp
@@ -2,7 +2,7 @@
// blocking_udp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp14/executors/async_1.cpp b/3rdparty/asio/src/examples/cpp14/executors/async_1.cpp
index 2fb8ba56548..0d1bdfcb8bd 100644
--- a/3rdparty/asio/src/examples/cpp14/executors/async_1.cpp
+++ b/3rdparty/asio/src/examples/cpp14/executors/async_1.cpp
@@ -20,16 +20,14 @@ void async_getline(IoExecutor io_ex, std::istream& is, Handler handler)
execution::outstanding_work.tracked);
// Post a function object to do the work asynchronously.
- execution::execute(
- asio::require(io_ex, execution::blocking.never),
+ asio::require(io_ex, execution::blocking.never).execute(
[&is, work_ex, handler=std::move(handler)]() mutable
{
std::string line;
std::getline(is, line);
// Pass the result to the handler, via the associated executor.
- execution::execute(
- asio::prefer(work_ex, execution::blocking.possibly),
+ asio::prefer(work_ex, execution::blocking.possibly).execute(
[line=std::move(line), handler=std::move(handler)]() mutable
{
handler(std::move(line));
diff --git a/3rdparty/asio/src/examples/cpp14/executors/async_2.cpp b/3rdparty/asio/src/examples/cpp14/executors/async_2.cpp
index b8a28e68b87..ee4a72e80c3 100644
--- a/3rdparty/asio/src/examples/cpp14/executors/async_2.cpp
+++ b/3rdparty/asio/src/examples/cpp14/executors/async_2.cpp
@@ -20,16 +20,14 @@ void async_getline(IoExecutor io_ex, std::istream& is, Handler handler)
execution::outstanding_work.tracked);
// Post a function object to do the work asynchronously.
- execution::execute(
- asio::require(io_ex, execution::blocking.never),
+ asio::require(io_ex, execution::blocking.never).execute(
[&is, work_ex, handler=std::move(handler)]() mutable
{
std::string line;
std::getline(is, line);
// Pass the result to the handler, via the associated executor.
- execution::execute(
- asio::prefer(work_ex, execution::blocking.possibly),
+ asio::prefer(work_ex, execution::blocking.possibly).execute(
[line=std::move(line), handler=std::move(handler)]() mutable
{
handler(std::move(line));
diff --git a/3rdparty/asio/src/examples/cpp14/executors/bank_account_1.cpp b/3rdparty/asio/src/examples/cpp14/executors/bank_account_1.cpp
index abfd16a7ee0..a63d7fc059b 100644
--- a/3rdparty/asio/src/examples/cpp14/executors/bank_account_1.cpp
+++ b/3rdparty/asio/src/examples/cpp14/executors/bank_account_1.cpp
@@ -16,8 +16,7 @@ class bank_account
public:
void deposit(int amount)
{
- execution::execute(
- pool_.executor(),
+ pool_.executor().execute(
[this, amount]
{
balance_ += amount;
@@ -26,8 +25,7 @@ public:
void withdraw(int amount)
{
- execution::execute(
- pool_.executor(),
+ pool_.executor().execute(
[this, amount]
{
if (balance_ >= amount)
@@ -37,8 +35,7 @@ public:
void print_balance() const
{
- execution::execute(
- pool_.executor(),
+ pool_.executor().execute(
[this]
{
std::cout << "balance = " << balance_ << "\n";
diff --git a/3rdparty/asio/src/examples/cpp14/executors/bank_account_2.cpp b/3rdparty/asio/src/examples/cpp14/executors/bank_account_2.cpp
index 305d0ca5b86..c2de05156e8 100644
--- a/3rdparty/asio/src/examples/cpp14/executors/bank_account_2.cpp
+++ b/3rdparty/asio/src/examples/cpp14/executors/bank_account_2.cpp
@@ -16,9 +16,7 @@ class bank_account
public:
void deposit(int amount)
{
- execution::execute(
- asio::require(pool_.executor(),
- execution::blocking.always),
+ asio::require(pool_.executor(), execution::blocking.always).execute(
[this, amount]
{
balance_ += amount;
@@ -27,9 +25,8 @@ public:
void withdraw(int amount)
{
- execution::execute(
- asio::require(pool_.executor(),
- execution::blocking.always),
+ asio::require(pool_.executor(),
+ execution::blocking.always).execute(
[this, amount]
{
if (balance_ >= amount)
@@ -40,9 +37,7 @@ public:
int balance() const
{
int result = 0;
- execution::execute(
- asio::require(pool_.executor(),
- execution::blocking.always),
+ asio::require(pool_.executor(), execution::blocking.always).execute(
[this, &result]
{
result = balance_;
diff --git a/3rdparty/asio/src/examples/cpp14/executors/fork_join.cpp b/3rdparty/asio/src/examples/cpp14/executors/fork_join.cpp
index a76437efad9..7e8a827356d 100644
--- a/3rdparty/asio/src/examples/cpp14/executors/fork_join.cpp
+++ b/3rdparty/asio/src/examples/cpp14/executors/fork_join.cpp
@@ -32,8 +32,7 @@ public:
// it is time to shut down, i.e. the use count is zero.
for (thread_count_ = 0; thread_count_ < thread_count; ++thread_count_)
{
- execution::execute(
- threads_.executor(),
+ threads_.executor().execute(
[this]
{
std::unique_lock<std::mutex> lock(mutex_);
@@ -252,8 +251,8 @@ void fork_join_sort(Iterator begin, Iterator end)
{
fork_executor fork(pool);
join_guard join(fork);
- execution::execute(fork, [=]{ fork_join_sort(begin, begin + n / 2); });
- execution::execute(fork, [=]{ fork_join_sort(begin + n / 2, end); });
+ fork.execute([=]{ fork_join_sort(begin, begin + n / 2); });
+ fork.execute([=]{ fork_join_sort(begin + n / 2, end); });
}
std::inplace_merge(begin, begin + n / 2, end);
}
diff --git a/3rdparty/asio/src/examples/cpp14/executors/pipeline.cpp b/3rdparty/asio/src/examples/cpp14/executors/pipeline.cpp
index 2d75e04fc0c..9754a27d425 100644
--- a/3rdparty/asio/src/examples/cpp14/executors/pipeline.cpp
+++ b/3rdparty/asio/src/examples/cpp14/executors/pipeline.cpp
@@ -169,9 +169,7 @@ std::future<void> pipeline(queue_back<T> in, F f)
f(in);
});
std::future<void> fut = task.get_future();
- execution::execute(
- asio::require(ex, execution::blocking.never),
- std::move(task));
+ asio::require(ex, execution::blocking.never).execute(std::move(task));
return fut;
}
@@ -191,8 +189,7 @@ std::future<void> pipeline(queue_back<T> in, F f, Tail... t)
auto ex = get_associated_executor(f, thread_executor());
// Run the function.
- execution::execute(
- asio::require(ex, execution::blocking.never),
+ asio::require(ex, execution::blocking.never).execute(
[in, out, f = std::move(f)]() mutable
{
f(in, out);
@@ -219,8 +216,7 @@ std::future<void> pipeline(F f, Tail... t)
auto ex = get_associated_executor(f, thread_executor());
// Run the function.
- execution::execute(
- asio::require(ex, execution::blocking.never),
+ asio::require(ex, execution::blocking.never).execute(
[out, f = std::move(f)]() mutable
{
f(out);
diff --git a/3rdparty/asio/src/examples/cpp14/executors/priority_scheduler.cpp b/3rdparty/asio/src/examples/cpp14/executors/priority_scheduler.cpp
index da4caf0d0ef..20d36db933a 100644
--- a/3rdparty/asio/src/examples/cpp14/executors/priority_scheduler.cpp
+++ b/3rdparty/asio/src/examples/cpp14/executors/priority_scheduler.cpp
@@ -166,16 +166,16 @@ int main()
auto med = asio::require(ex, custom_props::normal_priority);
auto high = asio::require(ex, custom_props::high_priority);
execution::any_executor<custom_props::priority> poly_high(high);
- execution::execute(prefer_low, []{ std::cout << "1\n"; });
- execution::execute(low, []{ std::cout << "11\n"; });
- execution::execute(low, []{ std::cout << "111\n"; });
- execution::execute(med, []{ std::cout << "2\n"; });
- execution::execute(med, []{ std::cout << "22\n"; });
- execution::execute(high, []{ std::cout << "3\n"; });
- execution::execute(high, []{ std::cout << "33\n"; });
- execution::execute(high, []{ std::cout << "333\n"; });
- execution::execute(poly_high, []{ std::cout << "3333\n"; });
- execution::execute(asio::require(ex, custom_props::priority{-1}), [&]{ sched.stop(); });
+ prefer_low.execute([]{ std::cout << "1\n"; });
+ low.execute([]{ std::cout << "11\n"; });
+ low.execute([]{ std::cout << "111\n"; });
+ med.execute([]{ std::cout << "2\n"; });
+ med.execute([]{ std::cout << "22\n"; });
+ high.execute([]{ std::cout << "3\n"; });
+ high.execute([]{ std::cout << "33\n"; });
+ high.execute([]{ std::cout << "333\n"; });
+ poly_high.execute([]{ std::cout << "3333\n"; });
+ asio::require(ex, custom_props::priority{-1}).execute([&]{ sched.stop(); });
sched.run();
std::cout << "polymorphic query result = " << asio::query(poly_high, custom_props::priority{}) << "\n";
}
diff --git a/3rdparty/asio/src/examples/cpp14/iostreams/http_client.cpp b/3rdparty/asio/src/examples/cpp14/iostreams/http_client.cpp
index da64259bb50..3ae02e4f825 100644
--- a/3rdparty/asio/src/examples/cpp14/iostreams/http_client.cpp
+++ b/3rdparty/asio/src/examples/cpp14/iostreams/http_client.cpp
@@ -2,7 +2,7 @@
// http_client.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp14/operations/c_callback_wrapper.cpp b/3rdparty/asio/src/examples/cpp14/operations/c_callback_wrapper.cpp
new file mode 100644
index 00000000000..33b1c26e8ae
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp14/operations/c_callback_wrapper.cpp
@@ -0,0 +1,230 @@
+//
+// c_callback_wrapper.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <iostream>
+#include <memory>
+#include <new>
+
+//------------------------------------------------------------------------------
+
+// This is a mock implementation of a C-based API that uses the function pointer
+// plus void* context idiom for exposing a callback.
+
+void read_input(const char* prompt, void (*cb)(void*, const char*), void* arg)
+{
+ std::thread(
+ [prompt = std::string(prompt), cb, arg]
+ {
+ std::cout << prompt << ": ";
+ std::cout.flush();
+ std::string line;
+ std::getline(std::cin, line);
+ cb(arg, line.c_str());
+ }).detach();
+}
+
+//------------------------------------------------------------------------------
+
+// This is an asynchronous operation that wraps the C-based API.
+
+// To map our completion handler into a function pointer / void* callback, we
+// need to allocate some state that will live for the duration of the
+// operation. A pointer to this state will be passed to the C-based API.
+template <typename Handler>
+class read_input_state
+{
+public:
+ read_input_state(Handler&& handler)
+ : handler_(std::move(handler)),
+ work_(asio::make_work_guard(handler_))
+ {
+ }
+
+ // Create the state using the handler's associated allocator.
+ static read_input_state* create(Handler&& handler)
+ {
+ // A unique_ptr deleter that is used to destroy uninitialised objects.
+ struct deleter
+ {
+ // Get the handler's associated allocator type. If the handler does not
+ // specify an associated allocator, we will use a recycling allocator as
+ // the default. As the associated allocator is a proto-allocator, we must
+ // rebind it to the correct type before we can use it to allocate objects.
+ typename std::allocator_traits<
+ asio::associated_allocator_t<Handler,
+ asio::recycling_allocator<void>>>::template
+ rebind_alloc<read_input_state> alloc;
+
+ void operator()(read_input_state* ptr)
+ {
+ std::allocator_traits<decltype(alloc)>::deallocate(alloc, ptr, 1);
+ }
+ } d{asio::get_associated_allocator(handler,
+ asio::recycling_allocator<void>())};
+
+ // Allocate memory for the state.
+ std::unique_ptr<read_input_state, deleter> uninit_ptr(
+ std::allocator_traits<decltype(d.alloc)>::allocate(d.alloc, 1), d);
+
+ // Construct the state into the newly allocated memory. This might throw.
+ read_input_state* ptr =
+ new (uninit_ptr.get()) read_input_state(std::move(handler));
+
+ // Release ownership of the memory and return the newly allocated state.
+ uninit_ptr.release();
+ return ptr;
+ }
+
+ static void callback(void* arg, const char* result)
+ {
+ read_input_state* self = static_cast<read_input_state*>(arg);
+
+ // A unique_ptr deleter that is used to destroy initialised objects.
+ struct deleter
+ {
+ // Get the handler's associated allocator type. If the handler does not
+ // specify an associated allocator, we will use a recycling allocator as
+ // the default. As the associated allocator is a proto-allocator, we must
+ // rebind it to the correct type before we can use it to allocate objects.
+ typename std::allocator_traits<
+ asio::associated_allocator_t<Handler,
+ asio::recycling_allocator<void>>>::template
+ rebind_alloc<read_input_state> alloc;
+
+ void operator()(read_input_state* ptr)
+ {
+ std::allocator_traits<decltype(alloc)>::destroy(alloc, ptr);
+ std::allocator_traits<decltype(alloc)>::deallocate(alloc, ptr, 1);
+ }
+ } d{asio::get_associated_allocator(self->handler_,
+ asio::recycling_allocator<void>())};
+
+ // To conform to the rules regarding asynchronous operations and memory
+ // allocation, we must make a copy of the state and deallocate the memory
+ // before dispatching the completion handler.
+ std::unique_ptr<read_input_state, deleter> state_ptr(self, d);
+ read_input_state state(std::move(*self));
+ state_ptr.reset();
+
+ // Dispatch the completion handler through the handler's associated
+ // executor, using the handler's associated allocator.
+ asio::dispatch(state.work_.get_executor(),
+ asio::bind_allocator(d.alloc,
+ [
+ handler = std::move(state.handler_),
+ result = std::string(result)
+ ]() mutable
+ {
+ std::move(handler)(result);
+ }));
+ }
+
+private:
+ Handler handler_;
+
+ // According to the rules for asynchronous operations, we need to track
+ // outstanding work against the handler's associated executor until the
+ // asynchronous operation is complete.
+ asio::executor_work_guard<
+ asio::associated_executor_t<Handler>> work_;
+};
+
+// The initiating function for the asynchronous operation.
+template <typename CompletionToken>
+auto async_read_input(const std::string& prompt, CompletionToken&& token)
+{
+ // Define a function object that contains the code to launch the asynchronous
+ // operation. This is passed the concrete completion handler, followed by any
+ // additional arguments that were passed through the call to async_initiate.
+ auto init = [](auto handler, const std::string& prompt)
+ {
+ // The body of the initiation function object creates the long-lived state
+ // and passes it to the C-based API, along with the function pointer.
+ using state_type = read_input_state<decltype(handler)>;
+ read_input(prompt.c_str(), &state_type::callback,
+ state_type::create(std::move(handler)));
+ };
+
+ // The async_initiate function is used to transform the supplied completion
+ // token to the completion handler. When calling this function we explicitly
+ // specify the completion signature of the operation. We must also return the
+ // result of the call since the completion token may produce a return value,
+ // such as a future.
+ return asio::async_initiate<CompletionToken, void(std::string)>(
+ init, // First, pass the function object that launches the operation,
+ token, // then the completion token that will be transformed to a handler,
+ prompt); // and, finally, any additional arguments to the function object.
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ // Test our asynchronous operation using a lambda as a callback. We will use
+ // an io_context to obtain an associated executor.
+ async_read_input("Enter your name",
+ asio::bind_executor(io_context,
+ [](const std::string& result)
+ {
+ std::cout << "Hello " << result << "\n";
+ }));
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_read_input("Enter your name", asio::deferred);
+
+ // Launch our asynchronous operation using a lambda as a callback. We will use
+ // an io_context to obtain an associated executor.
+ std::move(op)(
+ asio::bind_executor(io_context,
+ [](const std::string& result)
+ {
+ std::cout << "Hello " << result << "\n";
+ }));
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<std::string> f =
+ async_read_input("Enter your name", asio::use_future);
+
+ std::string result = f.get();
+ std::cout << "Hello " << result << "\n";
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp14/operations/callback_wrapper.cpp b/3rdparty/asio/src/examples/cpp14/operations/callback_wrapper.cpp
new file mode 100644
index 00000000000..3d5774c7421
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp14/operations/callback_wrapper.cpp
@@ -0,0 +1,152 @@
+//
+// callback_wrapper.cpp
+// ~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <iostream>
+
+//------------------------------------------------------------------------------
+
+// This is a mock implementation of an API that uses a move-only function object
+// for exposing a callback. The callback has the signature void(std::string).
+
+template <typename Callback>
+void read_input(const std::string& prompt, Callback cb)
+{
+ std::thread(
+ [prompt, cb = std::move(cb)]() mutable
+ {
+ std::cout << prompt << ": ";
+ std::cout.flush();
+ std::string line;
+ std::getline(std::cin, line);
+ std::move(cb)(std::move(line));
+ }).detach();
+}
+
+//------------------------------------------------------------------------------
+
+// This is an asynchronous operation that wraps the callback-based API.
+
+// The initiating function for the asynchronous operation.
+template <typename CompletionToken>
+auto async_read_input(const std::string& prompt, CompletionToken&& token)
+{
+ // Define a function object that contains the code to launch the asynchronous
+ // operation. This is passed the concrete completion handler, followed by any
+ // additional arguments that were passed through the call to async_initiate.
+ auto init = [](auto handler, const std::string& prompt)
+ {
+ // According to the rules for asynchronous operations, we need to track
+ // outstanding work against the handler's associated executor until the
+ // asynchronous operation is complete.
+ auto work = asio::make_work_guard(handler);
+
+ // Launch the operation with a callback that will receive the result and
+ // pass it through to the asynchronous operation's completion handler.
+ read_input(prompt,
+ [
+ handler = std::move(handler),
+ work = std::move(work)
+ ](std::string result) mutable
+ {
+ // Get the handler's associated allocator. If the handler does not
+ // specify an allocator, use the recycling allocator as the default.
+ auto alloc = asio::get_associated_allocator(
+ handler, asio::recycling_allocator<void>());
+
+ // Dispatch the completion handler through the handler's associated
+ // executor, using the handler's associated allocator.
+ asio::dispatch(work.get_executor(),
+ asio::bind_allocator(alloc,
+ [
+ handler = std::move(handler),
+ result = std::string(result)
+ ]() mutable
+ {
+ std::move(handler)(result);
+ }));
+ });
+ };
+
+ // The async_initiate function is used to transform the supplied completion
+ // token to the completion handler. When calling this function we explicitly
+ // specify the completion signature of the operation. We must also return the
+ // result of the call since the completion token may produce a return value,
+ // such as a future.
+ return asio::async_initiate<CompletionToken, void(std::string)>(
+ init, // First, pass the function object that launches the operation,
+ token, // then the completion token that will be transformed to a handler,
+ prompt); // and, finally, any additional arguments to the function object.
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ // Test our asynchronous operation using a lambda as a callback. We will use
+ // an io_context to specify an associated executor.
+ async_read_input("Enter your name",
+ asio::bind_executor(io_context,
+ [](const std::string& result)
+ {
+ std::cout << "Hello " << result << "\n";
+ }));
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_read_input("Enter your name", asio::deferred);
+
+ // Launch our asynchronous operation using a lambda as a callback. We will use
+ // an io_context to obtain an associated executor.
+ std::move(op)(
+ asio::bind_executor(io_context,
+ [](const std::string& result)
+ {
+ std::cout << "Hello " << result << "\n";
+ }));
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<std::string> f =
+ async_read_input("Enter your name", asio::use_future);
+
+ std::string result = f.get();
+ std::cout << "Hello " << result << "\n";
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp14/operations/composed_1.cpp b/3rdparty/asio/src/examples/cpp14/operations/composed_1.cpp
index 05b1479f2ff..80eaceddf71 100644
--- a/3rdparty/asio/src/examples/cpp14/operations/composed_1.cpp
+++ b/3rdparty/asio/src/examples/cpp14/operations/composed_1.cpp
@@ -2,12 +2,13 @@
// composed_1.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -31,14 +32,21 @@ template <typename CompletionToken>
auto async_write_message(tcp::socket& socket,
const char* message, CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is void. However,
- // when the completion token is asio::yield_context (used for stackful
- // coroutines) the return type would be std::size_t, and when the completion
- // token is asio::use_future it would be std::future<std::size_t>.
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is void.
+ // However, when the completion token is asio::yield_context (used for
+ // stackful coroutines) the return type would be std::size_t, and when the
+ // completion token is asio::use_future it would be std::future<std::size_t>.
+ // When the completion token is asio::deferred, the return type differs for
+ // each asynchronous operation.
//
// In C++14 we can omit the return type as it is automatically deduced from
- // the return type of our underlying asynchronous operation
+ // the return type of our underlying asynchronous operation.
{
// When delegating to the underlying operation we must take care to perfectly
// forward the completion token. This ensures that our operation works
@@ -77,6 +85,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket,
+ "Testing deferred\r\n", asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error, std::size_t n)
+ {
+ if (!error)
+ {
+ std::cout << n << " bytes transferred\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -109,5 +150,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp14/operations/composed_2.cpp b/3rdparty/asio/src/examples/cpp14/operations/composed_2.cpp
index 15422454c40..18086bd0627 100644
--- a/3rdparty/asio/src/examples/cpp14/operations/composed_2.cpp
+++ b/3rdparty/asio/src/examples/cpp14/operations/composed_2.cpp
@@ -2,12 +2,13 @@
// composed_2.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -20,6 +21,10 @@
using asio::ip::tcp;
+// NOTE: This example requires the new asio::async_initiate function. For
+// an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
//------------------------------------------------------------------------------
// This next simplest example of a composed asynchronous operation involves
@@ -33,38 +38,87 @@ auto async_write_message(tcp::socket& socket,
const char* message, bool allow_partial_write,
CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is void. However,
- // when the completion token is asio::yield_context (used for stackful
- // coroutines) the return type would be std::size_t, and when the completion
- // token is asio::use_future it would be std::future<std::size_t>.
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is void.
+ // However, when the completion token is asio::yield_context (used for
+ // stackful coroutines) the return type would be std::size_t, and when the
+ // completion token is asio::use_future it would be std::future<std::size_t>.
+ // When the completion token is asio::deferred, the return type differs for
+ // each asynchronous operation.
//
// In C++14 we can omit the return type as it is automatically deduced from
- // the return type of our underlying asynchronous operation
+ // the return type of asio::async_initiate.
{
- // As the return type of the initiating function is deduced solely from the
- // CompletionToken and completion signature, we know that two different
- // asynchronous operations having the same completion signature will produce
- // the same return type, when passed the same CompletionToken. This allows us
- // to trivially delegate to alternate implementations.
- if (allow_partial_write)
- {
- // When delegating to an underlying operation we must take care to
- // perfectly forward the completion token. This ensures that our operation
- // works correctly with move-only function objects as callbacks, as well as
- // other completion token types.
- return socket.async_write_some(
- asio::buffer(message, std::strlen(message)),
- std::forward<CompletionToken>(token));
- }
- else
+ // In addition to determining the mechanism by which an asynchronous
+ // operation delivers its result, a completion token also determines the time
+ // when the operation commences. For example, when the completion token is a
+ // simple callback the operation commences before the initiating function
+ // returns. However, if the completion token's delivery mechanism uses a
+ // future, we might instead want to defer initiation of the operation until
+ // the returned future object is waited upon.
+ //
+ // To enable this, when implementing an asynchronous operation we must
+ // package the initiation step as a function object. The initiation function
+ // object's call operator is passed the concrete completion handler produced
+ // by the completion token. This completion handler matches the asynchronous
+ // operation's completion handler signature, which in this example is:
+ //
+ // void(std::error_code error, std::size_t)
+ //
+ // The initiation function object also receives any additional arguments
+ // required to start the operation. (Note: We could have instead passed these
+ // arguments in the lambda capture set. However, we should prefer to
+ // propagate them as function call arguments as this allows the completion
+ // token to optimise how they are passed. For example, a lazy future which
+ // defers initiation would need to make a decay-copy of the arguments, but
+ // when using a simple callback the arguments can be trivially forwarded
+ // straight through.)
+ auto initiation = [](auto&& completion_handler, tcp::socket& socket,
+ const char* message, bool allow_partial_write)
{
- // As above, we must perfectly forward the completion token when calling
- // the alternate underlying operation.
- return asio::async_write(socket,
- asio::buffer(message, std::strlen(message)),
- std::forward<CompletionToken>(token));
- }
+ if (allow_partial_write)
+ {
+ // When delegating to an underlying operation we must take care to
+ // perfectly forward the completion handler. This ensures that our
+ // operation works correctly with move-only function objects as
+ // callbacks.
+ return socket.async_write_some(
+ asio::buffer(message, std::strlen(message)),
+ std::forward<decltype(completion_handler)>(completion_handler));
+ }
+ else
+ {
+ // As above, we must perfectly forward the completion handler when calling
+ // the alternate underlying operation.
+ return asio::async_write(socket,
+ asio::buffer(message, std::strlen(message)),
+ std::forward<decltype(completion_handler)>(completion_handler));
+ }
+ };
+
+ // The asio::async_initiate function takes:
+ //
+ // - our initiation function object,
+ // - the completion token,
+ // - the completion handler signature, and
+ // - any additional arguments we need to initiate the operation.
+ //
+ // It then asks the completion token to create a completion handler (i.e. a
+ // callback) with the specified signature, and invoke the initiation function
+ // object with this completion handler as well as the additional arguments.
+ // The return value of async_initiate is the result of our operation's
+ // initiating function.
+ //
+ // Note that we wrap non-const reference arguments in std::reference_wrapper
+ // to prevent incorrect decay-copies of these objects.
+ return asio::async_initiate<
+ CompletionToken, void(std::error_code, std::size_t)>(
+ initiation, token, std::ref(socket), message, allow_partial_write);
}
//------------------------------------------------------------------------------
@@ -95,6 +149,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket,
+ "Testing deferred\r\n", false, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error, std::size_t n)
+ {
+ if (!error)
+ {
+ std::cout << n << " bytes transferred\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -127,5 +214,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp14/operations/composed_3.cpp b/3rdparty/asio/src/examples/cpp14/operations/composed_3.cpp
index 0ac277f1e34..7b347944768 100644
--- a/3rdparty/asio/src/examples/cpp14/operations/composed_3.cpp
+++ b/3rdparty/asio/src/examples/cpp14/operations/composed_3.cpp
@@ -2,13 +2,14 @@
// composed_3.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/bind_executor.hpp>
+#include <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -37,12 +38,19 @@ template <typename CompletionToken>
auto async_write_message(tcp::socket& socket,
const char* message, CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
//
// In C++14 we can omit the return type as it is automatically deduced from
// the return type of asio::async_initiate.
@@ -149,6 +157,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket,
+ "Testing deferred\r\n", asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -182,5 +223,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp14/operations/composed_4.cpp b/3rdparty/asio/src/examples/cpp14/operations/composed_4.cpp
index 879e38ca0db..808a179e2d3 100644
--- a/3rdparty/asio/src/examples/cpp14/operations/composed_4.cpp
+++ b/3rdparty/asio/src/examples/cpp14/operations/composed_4.cpp
@@ -2,13 +2,14 @@
// composed_4.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/bind_executor.hpp>
+#include <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -38,12 +39,19 @@ template <typename CompletionToken>
auto async_write_message(tcp::socket& socket,
const char* message, CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
//
// In C++14 we can omit the return type as it is automatically deduced from
// the return type of asio::async_initiate.
@@ -165,6 +173,38 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket, "", asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -197,5 +237,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp14/operations/composed_5.cpp b/3rdparty/asio/src/examples/cpp14/operations/composed_5.cpp
index 560773217f6..c28cc8af129 100644
--- a/3rdparty/asio/src/examples/cpp14/operations/composed_5.cpp
+++ b/3rdparty/asio/src/examples/cpp14/operations/composed_5.cpp
@@ -2,12 +2,13 @@
// composed_5.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/use_future.hpp>
@@ -37,12 +38,19 @@ template <typename T, typename CompletionToken>
auto async_write_message(tcp::socket& socket,
const T& message, CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
//
// In C++14 we can omit the return type as it is automatically deduced from
// the return type of asio::async_initiate.
@@ -202,6 +210,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_message(socket,
+ std::string("abcdef"), asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -234,5 +275,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp14/operations/composed_6.cpp b/3rdparty/asio/src/examples/cpp14/operations/composed_6.cpp
index d0304de6a99..82c0cd72237 100644
--- a/3rdparty/asio/src/examples/cpp14/operations/composed_6.cpp
+++ b/3rdparty/asio/src/examples/cpp14/operations/composed_6.cpp
@@ -2,12 +2,13 @@
// composed_6.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/deferred.hpp>
#include <asio/executor_work_guard.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
@@ -42,12 +43,19 @@ auto async_write_messages(tcp::socket& socket,
const T& message, std::size_t repeat_count,
CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
//
// In C++14 we can omit the return type as it is automatically deduced from
// the return type of asio::async_initiate.
@@ -108,9 +116,7 @@ auto async_write_messages(tcp::socket& socket,
// As our composed operation performs multiple underlying I/O operations,
// we should maintain a work object against the I/O executor. This tells
// the I/O executor that there is still more work to come in the future.
- typename std::decay<decltype(asio::prefer(
- std::declval<tcp::socket::executor_type>(),
- asio::execution::outstanding_work.tracked))>::type io_work_;
+ asio::executor_work_guard<tcp::socket::executor_type> io_work_;
// The user-supplied completion handler, called once only on completion
// of the entire composed operation.
@@ -147,6 +153,9 @@ auto async_write_messages(tcp::socket& socket,
// This point is reached only on completion of the entire composed
// operation.
+ // We no longer have any future work coming for the I/O executor.
+ io_work_.reset();
+
// Deallocate the encoded message before calling the user-supplied
// completion handler.
encoded_message_.reset();
@@ -197,8 +206,7 @@ auto async_write_messages(tcp::socket& socket,
socket, std::move(encoded_message),
repeat_count, std::move(delay_timer),
intermediate_completion_handler::starting,
- asio::prefer(socket.get_executor(),
- asio::execution::outstanding_work.tracked),
+ asio::make_work_guard(socket.get_executor()),
std::forward<decltype(completion_handler)>(completion_handler)});
};
@@ -262,6 +270,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_messages(socket,
+ "Testing deferred\r\n", 5, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -294,5 +335,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp14/operations/composed_7.cpp b/3rdparty/asio/src/examples/cpp14/operations/composed_7.cpp
index 0158292e9d9..841249bef5b 100644
--- a/3rdparty/asio/src/examples/cpp14/operations/composed_7.cpp
+++ b/3rdparty/asio/src/examples/cpp14/operations/composed_7.cpp
@@ -2,13 +2,14 @@
// composed_7.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/compose.hpp>
+#include <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/steady_timer.hpp>
@@ -42,15 +43,22 @@ auto async_write_messages(tcp::socket& socket,
const T& message, std::size_t repeat_count,
CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
//
// In C++14 we can omit the return type as it is automatically deduced from
- // the return type of asio::async_initiate.
+ // the return type of asio::async_compose.
{
// Encode the message and copy it into an allocated buffer. The buffer will
// be maintained for the lifetime of the composed asynchronous operation.
@@ -183,6 +191,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_messages(socket,
+ "Testing deferred\r\n", 5, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -215,5 +256,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp14/operations/composed_8.cpp b/3rdparty/asio/src/examples/cpp14/operations/composed_8.cpp
index a22a500b67e..d1f46ddce54 100644
--- a/3rdparty/asio/src/examples/cpp14/operations/composed_8.cpp
+++ b/3rdparty/asio/src/examples/cpp14/operations/composed_8.cpp
@@ -2,7 +2,7 @@
// composed_8.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -10,6 +10,7 @@
#include <asio/compose.hpp>
#include <asio/coroutine.hpp>
+#include <asio/deferred.hpp>
#include <asio/io_context.hpp>
#include <asio/ip/tcp.hpp>
#include <asio/steady_timer.hpp>
@@ -46,15 +47,22 @@ auto async_write_messages(tcp::socket& socket,
const T& message, std::size_t repeat_count,
CompletionToken&& token)
// The return type of the initiating function is deduced from the combination
- // of CompletionToken type and the completion handler's signature. When the
- // completion token is a simple callback, the return type is always void.
- // In this example, when the completion token is asio::yield_context
- // (used for stackful coroutines) the return type would be also be void, as
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
// there is no non-error argument to the completion handler. When the
- // completion token is asio::use_future it would be std::future<void>.
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
//
// In C++14 we can omit the return type as it is automatically deduced from
- // the return type of asio::async_initiate.
+ // the return type of asio::async_compose.
{
// Encode the message and copy it into an allocated buffer. The buffer will
// be maintained for the lifetime of the composed asynchronous operation.
@@ -176,6 +184,39 @@ void test_callback()
//------------------------------------------------------------------------------
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_write_messages(socket,
+ "Testing deferred\r\n", 5, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
void test_future()
{
asio::io_context io_context;
@@ -208,5 +249,6 @@ void test_future()
int main()
{
test_callback();
+ test_deferred();
test_future();
}
diff --git a/3rdparty/asio/src/examples/cpp14/parallel_group/parallel_sort.cpp b/3rdparty/asio/src/examples/cpp14/parallel_group/parallel_sort.cpp
index 4df92a0467d..8bb7cdfd719 100644
--- a/3rdparty/asio/src/examples/cpp14/parallel_group/parallel_sort.cpp
+++ b/3rdparty/asio/src/examples/cpp14/parallel_group/parallel_sort.cpp
@@ -2,14 +2,13 @@
// parallel_sort.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio.hpp>
-#include <asio/experimental/append.hpp>
#include <asio/experimental/parallel_group.hpp>
#include <algorithm>
#include <chrono>
@@ -89,7 +88,7 @@ auto parallel_sort(
[self = std::make_shared<self_type>(std::move(self))]
{
asio::dispatch(
- asio::experimental::append(
+ asio::append(
std::move(*self), 0));
}
);
diff --git a/3rdparty/asio/src/examples/cpp14/parallel_group/ranged_wait_for_all.cpp b/3rdparty/asio/src/examples/cpp14/parallel_group/ranged_wait_for_all.cpp
new file mode 100644
index 00000000000..18772884072
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp14/parallel_group/ranged_wait_for_all.cpp
@@ -0,0 +1,70 @@
+//
+// ranged_wait_for_all.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/parallel_group.hpp>
+#include <iostream>
+#include <vector>
+
+#ifdef ASIO_HAS_POSIX_STREAM_DESCRIPTOR
+
+int main()
+{
+ asio::io_context ctx;
+
+ asio::posix::stream_descriptor out(ctx, ::dup(STDOUT_FILENO));
+ asio::posix::stream_descriptor err(ctx, ::dup(STDERR_FILENO));
+
+ using op_type = decltype(
+ out.async_write_some(
+ asio::buffer("", 0),
+ asio::deferred
+ )
+ );
+
+ std::vector<op_type> ops;
+
+ ops.push_back(
+ out.async_write_some(
+ asio::buffer("first\r\n", 7),
+ asio::deferred
+ )
+ );
+
+ ops.push_back(
+ err.async_write_some(
+ asio::buffer("second\r\n", 8),
+ asio::deferred
+ )
+ );
+
+ asio::experimental::make_parallel_group(ops).async_wait(
+ asio::experimental::wait_for_all(),
+ [](
+ std::vector<std::size_t> completion_order,
+ std::vector<std::error_code> ec,
+ std::vector<std::size_t> n
+ )
+ {
+ for (std::size_t i = 0; i < completion_order.size(); ++i)
+ {
+ std::size_t idx = completion_order[i];
+ std::cout << "operation " << idx << " finished: ";
+ std::cout << ec[idx] << ", " << n[idx] << "\n";
+ }
+ }
+ );
+
+ ctx.run();
+}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_all.cpp b/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_all.cpp
index b216c37d7cc..f007326326b 100644
--- a/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_all.cpp
+++ b/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_all.cpp
@@ -2,7 +2,7 @@
// wait_for_all.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,6 +12,8 @@
#include <asio/experimental/parallel_group.hpp>
#include <iostream>
+#ifdef ASIO_HAS_POSIX_STREAM_DESCRIPTOR
+
int main()
{
asio::io_context ctx;
@@ -56,3 +58,7 @@ int main()
ctx.run();
}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one.cpp b/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one.cpp
index aa83f4922c3..7b25e26d678 100644
--- a/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one.cpp
+++ b/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one.cpp
@@ -2,7 +2,7 @@
// wait_for_one.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,6 +12,8 @@
#include <asio/experimental/parallel_group.hpp>
#include <iostream>
+#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+
int main()
{
asio::io_context ctx;
@@ -56,3 +58,7 @@ int main()
ctx.run();
}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_error.cpp b/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_error.cpp
index 584c5c3fc00..c157d0b3355 100644
--- a/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_error.cpp
+++ b/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_error.cpp
@@ -2,7 +2,7 @@
// wait_for_one_error.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,6 +12,8 @@
#include <asio/experimental/parallel_group.hpp>
#include <iostream>
+#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+
int main()
{
asio::io_context ctx;
@@ -56,3 +58,7 @@ int main()
ctx.run();
}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_success.cpp b/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_success.cpp
index 45700024423..a328600a9fc 100644
--- a/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_success.cpp
+++ b/3rdparty/asio/src/examples/cpp14/parallel_group/wait_for_one_success.cpp
@@ -2,7 +2,7 @@
// wait_for_one_error.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,6 +12,8 @@
#include <asio/experimental/parallel_group.hpp>
#include <iostream>
+#if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+
int main()
{
asio::io_context ctx;
@@ -56,3 +58,7 @@ int main()
ctx.run();
}
+
+#else // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+int main() {}
+#endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
diff --git a/3rdparty/asio/src/examples/cpp17/Makefile.in b/3rdparty/asio/src/examples/cpp17/Makefile.in
index 9e2fd3202dc..db35ec4f320 100644
--- a/3rdparty/asio/src/examples/cpp17/Makefile.in
+++ b/3rdparty/asio/src/examples/cpp17/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -244,8 +244,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -259,8 +257,9 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
-CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -269,9 +268,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
-GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -338,9 +336,11 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -558,7 +558,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/3rdparty/asio/src/examples/cpp17/coroutines_ts/chat_server.cpp b/3rdparty/asio/src/examples/cpp17/coroutines_ts/chat_server.cpp
index 052f6706e3b..cd5fba32486 100644
--- a/3rdparty/asio/src/examples/cpp17/coroutines_ts/chat_server.cpp
+++ b/3rdparty/asio/src/examples/cpp17/coroutines_ts/chat_server.cpp
@@ -2,7 +2,7 @@
// chat_server.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server.cpp b/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server.cpp
index 29dd889497b..a9532459f77 100644
--- a/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server.cpp
@@ -2,7 +2,7 @@
// echo_server.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_single_default.cpp b/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_single_default.cpp
index a733bed3b50..4a692acc872 100644
--- a/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_single_default.cpp
+++ b/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_single_default.cpp
@@ -2,7 +2,7 @@
// echo_server_with_as_single_default.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_tuple_default.cpp b/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_tuple_default.cpp
index 29cb2191fdb..de162cad78e 100644
--- a/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_tuple_default.cpp
+++ b/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_as_tuple_default.cpp
@@ -2,13 +2,13 @@
// echo_server_with_as_tuple_default.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <asio/experimental/as_tuple.hpp>
+#include <asio/as_tuple.hpp>
#include <asio/co_spawn.hpp>
#include <asio/detached.hpp>
#include <asio/io_context.hpp>
@@ -17,7 +17,7 @@
#include <asio/write.hpp>
#include <cstdio>
-using asio::experimental::as_tuple_t;
+using asio::as_tuple_t;
using asio::ip::tcp;
using asio::awaitable;
using asio::co_spawn;
diff --git a/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_default.cpp b/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_default.cpp
index b78b1c89090..54344d94d56 100644
--- a/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_default.cpp
+++ b/3rdparty/asio/src/examples/cpp17/coroutines_ts/echo_server_with_default.cpp
@@ -2,7 +2,7 @@
// echo_server_with_default.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp17/coroutines_ts/range_based_for.cpp b/3rdparty/asio/src/examples/cpp17/coroutines_ts/range_based_for.cpp
index 74210afe1a3..599ed80cd3f 100644
--- a/3rdparty/asio/src/examples/cpp17/coroutines_ts/range_based_for.cpp
+++ b/3rdparty/asio/src/examples/cpp17/coroutines_ts/range_based_for.cpp
@@ -2,7 +2,7 @@
// range_based_for.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp17/coroutines_ts/refactored_echo_server.cpp b/3rdparty/asio/src/examples/cpp17/coroutines_ts/refactored_echo_server.cpp
index 42130093c1c..dc7b03d86e2 100644
--- a/3rdparty/asio/src/examples/cpp17/coroutines_ts/refactored_echo_server.cpp
+++ b/3rdparty/asio/src/examples/cpp17/coroutines_ts/refactored_echo_server.cpp
@@ -2,7 +2,7 @@
// refactored_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/examples/cpp20/Makefile.am b/3rdparty/asio/src/examples/cpp20/Makefile.am
new file mode 100644
index 00000000000..619893c208e
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/Makefile.am
@@ -0,0 +1,79 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
+if SEPARATE_COMPILATION
+noinst_LIBRARIES = libasio.a
+libasio_a_SOURCES = ../../asio.cpp
+if HAVE_OPENSSL
+libasio_a_SOURCES += ../../asio_ssl.cpp
+endif
+LDADD = libasio.a
+endif
+
+noinst_PROGRAMS = \
+ invocation/completion_executor \
+ operations/c_callback_wrapper \
+ operations/callback_wrapper \
+ operations/composed_1 \
+ operations/composed_1 \
+ operations/composed_2 \
+ operations/composed_3 \
+ operations/composed_4 \
+ operations/composed_5 \
+ operations/composed_6 \
+ operations/composed_7 \
+ operations/composed_8
+
+if HAVE_COROUTINES
+noinst_PROGRAMS += \
+ channels/mutual_exclusion_1 \
+ channels/mutual_exclusion_2 \
+ channels/throttling_proxy \
+ coroutines/chat_server \
+ coroutines/echo_server \
+ coroutines/echo_server_with_default \
+ coroutines/echo_server_with_deferred \
+ coroutines/echo_server_with_deferred_default \
+ coroutines/echo_server_with_as_single_default \
+ coroutines/echo_server_with_as_tuple_default \
+ coroutines/refactored_echo_server \
+ coroutines/timeout \
+ type_erasure/type_erasure
+endif
+
+AM_CXXFLAGS = -I$(srcdir)/../../../include
+
+invocation_completion_executor_SOURCES = invocation/completion_executor.cpp
+operations_c_callback_wrapper_SOURCES = operations/c_callback_wrapper.cpp
+operations_callback_wrapper_SOURCES = operations/callback_wrapper.cpp
+operations_composed_1_SOURCES = operations/composed_1.cpp
+operations_composed_2_SOURCES = operations/composed_2.cpp
+operations_composed_3_SOURCES = operations/composed_3.cpp
+operations_composed_4_SOURCES = operations/composed_4.cpp
+operations_composed_5_SOURCES = operations/composed_5.cpp
+operations_composed_6_SOURCES = operations/composed_6.cpp
+operations_composed_7_SOURCES = operations/composed_7.cpp
+operations_composed_8_SOURCES = operations/composed_8.cpp
+
+if HAVE_COROUTINES
+channels_mutual_exclusion_1_SOURCES = channels/mutual_exclusion_1.cpp
+channels_mutual_exclusion_2_SOURCES = channels/mutual_exclusion_2.cpp
+channels_throttling_proxy_SOURCES = channels/throttling_proxy.cpp
+coroutines_chat_server_SOURCES = coroutines/chat_server.cpp
+coroutines_echo_server_SOURCES = coroutines/echo_server.cpp
+coroutines_echo_server_with_default_SOURCES = coroutines/echo_server_with_default.cpp
+coroutines_echo_server_with_deferred_SOURCES = coroutines/echo_server_with_deferred.cpp
+coroutines_echo_server_with_deferred_default_SOURCES = coroutines/echo_server_with_deferred_default.cpp
+coroutines_echo_server_with_as_single_default_SOURCES = coroutines/echo_server_with_as_single_default.cpp
+coroutines_echo_server_with_as_tuple_default_SOURCES = coroutines/echo_server_with_as_tuple_default.cpp
+coroutines_refactored_echo_server_SOURCES = coroutines/refactored_echo_server.cpp
+coroutines_timeout_SOURCES = coroutines/timeout.cpp
+type_erasure_type_erasure_SOURCES = type_erasure/main.cpp type_erasure/stdin_line_reader.cpp type_erasure/sleep.cpp
+endif
+
+EXTRA_DIST = \
+ type_erasure/line_reader.hpp \
+ type_erasure/stdin_line_reader.hpp \
+ type_erasure/sleep.hpp
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
diff --git a/3rdparty/asio/src/examples/cpp20/Makefile.in b/3rdparty/asio/src/examples/cpp20/Makefile.in
new file mode 100644
index 00000000000..87311465ece
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/Makefile.in
@@ -0,0 +1,1173 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@HAVE_OPENSSL_TRUE@@SEPARATE_COMPILATION_TRUE@am__append_1 = ../../asio_ssl.cpp
+noinst_PROGRAMS = invocation/completion_executor$(EXEEXT) \
+ operations/c_callback_wrapper$(EXEEXT) \
+ operations/callback_wrapper$(EXEEXT) \
+ operations/composed_1$(EXEEXT) operations/composed_1$(EXEEXT) \
+ operations/composed_2$(EXEEXT) operations/composed_3$(EXEEXT) \
+ operations/composed_4$(EXEEXT) operations/composed_5$(EXEEXT) \
+ operations/composed_6$(EXEEXT) operations/composed_7$(EXEEXT) \
+ operations/composed_8$(EXEEXT) $(am__EXEEXT_1)
+@HAVE_COROUTINES_TRUE@am__append_2 = \
+@HAVE_COROUTINES_TRUE@ channels/mutual_exclusion_1 \
+@HAVE_COROUTINES_TRUE@ channels/mutual_exclusion_2 \
+@HAVE_COROUTINES_TRUE@ channels/throttling_proxy \
+@HAVE_COROUTINES_TRUE@ coroutines/chat_server \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_default \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_deferred \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_deferred_default \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_as_single_default \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_as_tuple_default \
+@HAVE_COROUTINES_TRUE@ coroutines/refactored_echo_server \
+@HAVE_COROUTINES_TRUE@ coroutines/timeout \
+@HAVE_COROUTINES_TRUE@ type_erasure/type_erasure
+
+subdir = src/examples/cpp20
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+@HAVE_COROUTINES_TRUE@am__EXEEXT_1 = \
+@HAVE_COROUTINES_TRUE@ channels/mutual_exclusion_1$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ channels/mutual_exclusion_2$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ channels/throttling_proxy$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ coroutines/chat_server$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_default$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_deferred$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_deferred_default$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_as_single_default$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server_with_as_tuple_default$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ coroutines/refactored_echo_server$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ coroutines/timeout$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@ type_erasure/type_erasure$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+LIBRARIES = $(noinst_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libasio_a_AR = $(AR) $(ARFLAGS)
+libasio_a_LIBADD =
+am__libasio_a_SOURCES_DIST = ../../asio.cpp ../../asio_ssl.cpp
+am__dirstamp = $(am__leading_dot)dirstamp
+@HAVE_OPENSSL_TRUE@@SEPARATE_COMPILATION_TRUE@am__objects_1 = ../../asio_ssl.$(OBJEXT)
+@SEPARATE_COMPILATION_TRUE@am_libasio_a_OBJECTS = \
+@SEPARATE_COMPILATION_TRUE@ ../../asio.$(OBJEXT) \
+@SEPARATE_COMPILATION_TRUE@ $(am__objects_1)
+libasio_a_OBJECTS = $(am_libasio_a_OBJECTS)
+am__channels_mutual_exclusion_1_SOURCES_DIST = \
+ channels/mutual_exclusion_1.cpp
+@HAVE_COROUTINES_TRUE@am_channels_mutual_exclusion_1_OBJECTS = \
+@HAVE_COROUTINES_TRUE@ channels/mutual_exclusion_1.$(OBJEXT)
+channels_mutual_exclusion_1_OBJECTS = \
+ $(am_channels_mutual_exclusion_1_OBJECTS)
+channels_mutual_exclusion_1_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@channels_mutual_exclusion_1_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__channels_mutual_exclusion_2_SOURCES_DIST = \
+ channels/mutual_exclusion_2.cpp
+@HAVE_COROUTINES_TRUE@am_channels_mutual_exclusion_2_OBJECTS = \
+@HAVE_COROUTINES_TRUE@ channels/mutual_exclusion_2.$(OBJEXT)
+channels_mutual_exclusion_2_OBJECTS = \
+ $(am_channels_mutual_exclusion_2_OBJECTS)
+channels_mutual_exclusion_2_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@channels_mutual_exclusion_2_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__channels_throttling_proxy_SOURCES_DIST = \
+ channels/throttling_proxy.cpp
+@HAVE_COROUTINES_TRUE@am_channels_throttling_proxy_OBJECTS = \
+@HAVE_COROUTINES_TRUE@ channels/throttling_proxy.$(OBJEXT)
+channels_throttling_proxy_OBJECTS = \
+ $(am_channels_throttling_proxy_OBJECTS)
+channels_throttling_proxy_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@channels_throttling_proxy_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__coroutines_chat_server_SOURCES_DIST = coroutines/chat_server.cpp
+@HAVE_COROUTINES_TRUE@am_coroutines_chat_server_OBJECTS = \
+@HAVE_COROUTINES_TRUE@ coroutines/chat_server.$(OBJEXT)
+coroutines_chat_server_OBJECTS = $(am_coroutines_chat_server_OBJECTS)
+coroutines_chat_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@coroutines_chat_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__coroutines_echo_server_SOURCES_DIST = coroutines/echo_server.cpp
+@HAVE_COROUTINES_TRUE@am_coroutines_echo_server_OBJECTS = \
+@HAVE_COROUTINES_TRUE@ coroutines/echo_server.$(OBJEXT)
+coroutines_echo_server_OBJECTS = $(am_coroutines_echo_server_OBJECTS)
+coroutines_echo_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@coroutines_echo_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__coroutines_echo_server_with_as_single_default_SOURCES_DIST = \
+ coroutines/echo_server_with_as_single_default.cpp
+@HAVE_COROUTINES_TRUE@am_coroutines_echo_server_with_as_single_default_OBJECTS = coroutines/echo_server_with_as_single_default.$(OBJEXT)
+coroutines_echo_server_with_as_single_default_OBJECTS = \
+ $(am_coroutines_echo_server_with_as_single_default_OBJECTS)
+coroutines_echo_server_with_as_single_default_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@coroutines_echo_server_with_as_single_default_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__coroutines_echo_server_with_as_tuple_default_SOURCES_DIST = \
+ coroutines/echo_server_with_as_tuple_default.cpp
+@HAVE_COROUTINES_TRUE@am_coroutines_echo_server_with_as_tuple_default_OBJECTS = coroutines/echo_server_with_as_tuple_default.$(OBJEXT)
+coroutines_echo_server_with_as_tuple_default_OBJECTS = \
+ $(am_coroutines_echo_server_with_as_tuple_default_OBJECTS)
+coroutines_echo_server_with_as_tuple_default_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@coroutines_echo_server_with_as_tuple_default_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__coroutines_echo_server_with_default_SOURCES_DIST = \
+ coroutines/echo_server_with_default.cpp
+@HAVE_COROUTINES_TRUE@am_coroutines_echo_server_with_default_OBJECTS = coroutines/echo_server_with_default.$(OBJEXT)
+coroutines_echo_server_with_default_OBJECTS = \
+ $(am_coroutines_echo_server_with_default_OBJECTS)
+coroutines_echo_server_with_default_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@coroutines_echo_server_with_default_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__coroutines_echo_server_with_deferred_SOURCES_DIST = \
+ coroutines/echo_server_with_deferred.cpp
+@HAVE_COROUTINES_TRUE@am_coroutines_echo_server_with_deferred_OBJECTS = coroutines/echo_server_with_deferred.$(OBJEXT)
+coroutines_echo_server_with_deferred_OBJECTS = \
+ $(am_coroutines_echo_server_with_deferred_OBJECTS)
+coroutines_echo_server_with_deferred_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@coroutines_echo_server_with_deferred_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__coroutines_echo_server_with_deferred_default_SOURCES_DIST = \
+ coroutines/echo_server_with_deferred_default.cpp
+@HAVE_COROUTINES_TRUE@am_coroutines_echo_server_with_deferred_default_OBJECTS = coroutines/echo_server_with_deferred_default.$(OBJEXT)
+coroutines_echo_server_with_deferred_default_OBJECTS = \
+ $(am_coroutines_echo_server_with_deferred_default_OBJECTS)
+coroutines_echo_server_with_deferred_default_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@coroutines_echo_server_with_deferred_default_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__coroutines_refactored_echo_server_SOURCES_DIST = \
+ coroutines/refactored_echo_server.cpp
+@HAVE_COROUTINES_TRUE@am_coroutines_refactored_echo_server_OBJECTS = coroutines/refactored_echo_server.$(OBJEXT)
+coroutines_refactored_echo_server_OBJECTS = \
+ $(am_coroutines_refactored_echo_server_OBJECTS)
+coroutines_refactored_echo_server_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@coroutines_refactored_echo_server_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__coroutines_timeout_SOURCES_DIST = coroutines/timeout.cpp
+@HAVE_COROUTINES_TRUE@am_coroutines_timeout_OBJECTS = \
+@HAVE_COROUTINES_TRUE@ coroutines/timeout.$(OBJEXT)
+coroutines_timeout_OBJECTS = $(am_coroutines_timeout_OBJECTS)
+coroutines_timeout_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@coroutines_timeout_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_invocation_completion_executor_OBJECTS = \
+ invocation/completion_executor.$(OBJEXT)
+invocation_completion_executor_OBJECTS = \
+ $(am_invocation_completion_executor_OBJECTS)
+invocation_completion_executor_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@invocation_completion_executor_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_c_callback_wrapper_OBJECTS = \
+ operations/c_callback_wrapper.$(OBJEXT)
+operations_c_callback_wrapper_OBJECTS = \
+ $(am_operations_c_callback_wrapper_OBJECTS)
+operations_c_callback_wrapper_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_c_callback_wrapper_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_callback_wrapper_OBJECTS = \
+ operations/callback_wrapper.$(OBJEXT)
+operations_callback_wrapper_OBJECTS = \
+ $(am_operations_callback_wrapper_OBJECTS)
+operations_callback_wrapper_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_callback_wrapper_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_composed_1_OBJECTS = operations/composed_1.$(OBJEXT)
+operations_composed_1_OBJECTS = $(am_operations_composed_1_OBJECTS)
+operations_composed_1_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_composed_1_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_composed_2_OBJECTS = operations/composed_2.$(OBJEXT)
+operations_composed_2_OBJECTS = $(am_operations_composed_2_OBJECTS)
+operations_composed_2_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_composed_2_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_composed_3_OBJECTS = operations/composed_3.$(OBJEXT)
+operations_composed_3_OBJECTS = $(am_operations_composed_3_OBJECTS)
+operations_composed_3_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_composed_3_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_composed_4_OBJECTS = operations/composed_4.$(OBJEXT)
+operations_composed_4_OBJECTS = $(am_operations_composed_4_OBJECTS)
+operations_composed_4_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_composed_4_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_composed_5_OBJECTS = operations/composed_5.$(OBJEXT)
+operations_composed_5_OBJECTS = $(am_operations_composed_5_OBJECTS)
+operations_composed_5_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_composed_5_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_composed_6_OBJECTS = operations/composed_6.$(OBJEXT)
+operations_composed_6_OBJECTS = $(am_operations_composed_6_OBJECTS)
+operations_composed_6_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_composed_6_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_composed_7_OBJECTS = operations/composed_7.$(OBJEXT)
+operations_composed_7_OBJECTS = $(am_operations_composed_7_OBJECTS)
+operations_composed_7_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_composed_7_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_operations_composed_8_OBJECTS = operations/composed_8.$(OBJEXT)
+operations_composed_8_OBJECTS = $(am_operations_composed_8_OBJECTS)
+operations_composed_8_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@operations_composed_8_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__type_erasure_type_erasure_SOURCES_DIST = type_erasure/main.cpp \
+ type_erasure/stdin_line_reader.cpp type_erasure/sleep.cpp
+@HAVE_COROUTINES_TRUE@am_type_erasure_type_erasure_OBJECTS = \
+@HAVE_COROUTINES_TRUE@ type_erasure/main.$(OBJEXT) \
+@HAVE_COROUTINES_TRUE@ type_erasure/stdin_line_reader.$(OBJEXT) \
+@HAVE_COROUTINES_TRUE@ type_erasure/sleep.$(OBJEXT)
+type_erasure_type_erasure_OBJECTS = \
+ $(am_type_erasure_type_erasure_OBJECTS)
+type_erasure_type_erasure_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@type_erasure_type_erasure_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ../../$(DEPDIR)/asio.Po \
+ ../../$(DEPDIR)/asio_ssl.Po \
+ channels/$(DEPDIR)/mutual_exclusion_1.Po \
+ channels/$(DEPDIR)/mutual_exclusion_2.Po \
+ channels/$(DEPDIR)/throttling_proxy.Po \
+ coroutines/$(DEPDIR)/chat_server.Po \
+ coroutines/$(DEPDIR)/echo_server.Po \
+ coroutines/$(DEPDIR)/echo_server_with_as_single_default.Po \
+ coroutines/$(DEPDIR)/echo_server_with_as_tuple_default.Po \
+ coroutines/$(DEPDIR)/echo_server_with_default.Po \
+ coroutines/$(DEPDIR)/echo_server_with_deferred.Po \
+ coroutines/$(DEPDIR)/echo_server_with_deferred_default.Po \
+ coroutines/$(DEPDIR)/refactored_echo_server.Po \
+ coroutines/$(DEPDIR)/timeout.Po \
+ invocation/$(DEPDIR)/completion_executor.Po \
+ operations/$(DEPDIR)/c_callback_wrapper.Po \
+ operations/$(DEPDIR)/callback_wrapper.Po \
+ operations/$(DEPDIR)/composed_1.Po \
+ operations/$(DEPDIR)/composed_2.Po \
+ operations/$(DEPDIR)/composed_3.Po \
+ operations/$(DEPDIR)/composed_4.Po \
+ operations/$(DEPDIR)/composed_5.Po \
+ operations/$(DEPDIR)/composed_6.Po \
+ operations/$(DEPDIR)/composed_7.Po \
+ operations/$(DEPDIR)/composed_8.Po \
+ type_erasure/$(DEPDIR)/main.Po type_erasure/$(DEPDIR)/sleep.Po \
+ type_erasure/$(DEPDIR)/stdin_line_reader.Po
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+ -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+SOURCES = $(libasio_a_SOURCES) $(channels_mutual_exclusion_1_SOURCES) \
+ $(channels_mutual_exclusion_2_SOURCES) \
+ $(channels_throttling_proxy_SOURCES) \
+ $(coroutines_chat_server_SOURCES) \
+ $(coroutines_echo_server_SOURCES) \
+ $(coroutines_echo_server_with_as_single_default_SOURCES) \
+ $(coroutines_echo_server_with_as_tuple_default_SOURCES) \
+ $(coroutines_echo_server_with_default_SOURCES) \
+ $(coroutines_echo_server_with_deferred_SOURCES) \
+ $(coroutines_echo_server_with_deferred_default_SOURCES) \
+ $(coroutines_refactored_echo_server_SOURCES) \
+ $(coroutines_timeout_SOURCES) \
+ $(invocation_completion_executor_SOURCES) \
+ $(operations_c_callback_wrapper_SOURCES) \
+ $(operations_callback_wrapper_SOURCES) \
+ $(operations_composed_1_SOURCES) \
+ $(operations_composed_2_SOURCES) \
+ $(operations_composed_3_SOURCES) \
+ $(operations_composed_4_SOURCES) \
+ $(operations_composed_5_SOURCES) \
+ $(operations_composed_6_SOURCES) \
+ $(operations_composed_7_SOURCES) \
+ $(operations_composed_8_SOURCES) \
+ $(type_erasure_type_erasure_SOURCES)
+DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
+ $(am__channels_mutual_exclusion_1_SOURCES_DIST) \
+ $(am__channels_mutual_exclusion_2_SOURCES_DIST) \
+ $(am__channels_throttling_proxy_SOURCES_DIST) \
+ $(am__coroutines_chat_server_SOURCES_DIST) \
+ $(am__coroutines_echo_server_SOURCES_DIST) \
+ $(am__coroutines_echo_server_with_as_single_default_SOURCES_DIST) \
+ $(am__coroutines_echo_server_with_as_tuple_default_SOURCES_DIST) \
+ $(am__coroutines_echo_server_with_default_SOURCES_DIST) \
+ $(am__coroutines_echo_server_with_deferred_SOURCES_DIST) \
+ $(am__coroutines_echo_server_with_deferred_default_SOURCES_DIST) \
+ $(am__coroutines_refactored_echo_server_SOURCES_DIST) \
+ $(am__coroutines_timeout_SOURCES_DIST) \
+ $(invocation_completion_executor_SOURCES) \
+ $(operations_c_callback_wrapper_SOURCES) \
+ $(operations_callback_wrapper_SOURCES) \
+ $(operations_composed_1_SOURCES) \
+ $(operations_composed_2_SOURCES) \
+ $(operations_composed_3_SOURCES) \
+ $(operations_composed_4_SOURCES) \
+ $(operations_composed_5_SOURCES) \
+ $(operations_composed_6_SOURCES) \
+ $(operations_composed_7_SOURCES) \
+ $(operations_composed_8_SOURCES) \
+ $(am__type_erasure_type_erasure_SOURCES_DIST)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = subdir-objects
+@SEPARATE_COMPILATION_TRUE@noinst_LIBRARIES = libasio.a
+@SEPARATE_COMPILATION_TRUE@libasio_a_SOURCES = ../../asio.cpp \
+@SEPARATE_COMPILATION_TRUE@ $(am__append_1)
+@SEPARATE_COMPILATION_TRUE@LDADD = libasio.a
+AM_CXXFLAGS = -I$(srcdir)/../../../include
+invocation_completion_executor_SOURCES = invocation/completion_executor.cpp
+operations_c_callback_wrapper_SOURCES = operations/c_callback_wrapper.cpp
+operations_callback_wrapper_SOURCES = operations/callback_wrapper.cpp
+operations_composed_1_SOURCES = operations/composed_1.cpp
+operations_composed_2_SOURCES = operations/composed_2.cpp
+operations_composed_3_SOURCES = operations/composed_3.cpp
+operations_composed_4_SOURCES = operations/composed_4.cpp
+operations_composed_5_SOURCES = operations/composed_5.cpp
+operations_composed_6_SOURCES = operations/composed_6.cpp
+operations_composed_7_SOURCES = operations/composed_7.cpp
+operations_composed_8_SOURCES = operations/composed_8.cpp
+@HAVE_COROUTINES_TRUE@channels_mutual_exclusion_1_SOURCES = channels/mutual_exclusion_1.cpp
+@HAVE_COROUTINES_TRUE@channels_mutual_exclusion_2_SOURCES = channels/mutual_exclusion_2.cpp
+@HAVE_COROUTINES_TRUE@channels_throttling_proxy_SOURCES = channels/throttling_proxy.cpp
+@HAVE_COROUTINES_TRUE@coroutines_chat_server_SOURCES = coroutines/chat_server.cpp
+@HAVE_COROUTINES_TRUE@coroutines_echo_server_SOURCES = coroutines/echo_server.cpp
+@HAVE_COROUTINES_TRUE@coroutines_echo_server_with_default_SOURCES = coroutines/echo_server_with_default.cpp
+@HAVE_COROUTINES_TRUE@coroutines_echo_server_with_deferred_SOURCES = coroutines/echo_server_with_deferred.cpp
+@HAVE_COROUTINES_TRUE@coroutines_echo_server_with_deferred_default_SOURCES = coroutines/echo_server_with_deferred_default.cpp
+@HAVE_COROUTINES_TRUE@coroutines_echo_server_with_as_single_default_SOURCES = coroutines/echo_server_with_as_single_default.cpp
+@HAVE_COROUTINES_TRUE@coroutines_echo_server_with_as_tuple_default_SOURCES = coroutines/echo_server_with_as_tuple_default.cpp
+@HAVE_COROUTINES_TRUE@coroutines_refactored_echo_server_SOURCES = coroutines/refactored_echo_server.cpp
+@HAVE_COROUTINES_TRUE@coroutines_timeout_SOURCES = coroutines/timeout.cpp
+@HAVE_COROUTINES_TRUE@type_erasure_type_erasure_SOURCES = type_erasure/main.cpp type_erasure/stdin_line_reader.cpp type_erasure/sleep.cpp
+EXTRA_DIST = \
+ type_erasure/line_reader.hpp \
+ type_erasure/stdin_line_reader.hpp \
+ type_erasure/sleep.hpp
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/examples/cpp20/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/examples/cpp20/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+../../$(am__dirstamp):
+ @$(MKDIR_P) ../..
+ @: > ../../$(am__dirstamp)
+../../$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../../$(DEPDIR)
+ @: > ../../$(DEPDIR)/$(am__dirstamp)
+../../asio.$(OBJEXT): ../../$(am__dirstamp) \
+ ../../$(DEPDIR)/$(am__dirstamp)
+../../asio_ssl.$(OBJEXT): ../../$(am__dirstamp) \
+ ../../$(DEPDIR)/$(am__dirstamp)
+
+libasio.a: $(libasio_a_OBJECTS) $(libasio_a_DEPENDENCIES) $(EXTRA_libasio_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libasio.a
+ $(AM_V_AR)$(libasio_a_AR) libasio.a $(libasio_a_OBJECTS) $(libasio_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libasio.a
+channels/$(am__dirstamp):
+ @$(MKDIR_P) channels
+ @: > channels/$(am__dirstamp)
+channels/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) channels/$(DEPDIR)
+ @: > channels/$(DEPDIR)/$(am__dirstamp)
+channels/mutual_exclusion_1.$(OBJEXT): channels/$(am__dirstamp) \
+ channels/$(DEPDIR)/$(am__dirstamp)
+
+channels/mutual_exclusion_1$(EXEEXT): $(channels_mutual_exclusion_1_OBJECTS) $(channels_mutual_exclusion_1_DEPENDENCIES) $(EXTRA_channels_mutual_exclusion_1_DEPENDENCIES) channels/$(am__dirstamp)
+ @rm -f channels/mutual_exclusion_1$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(channels_mutual_exclusion_1_OBJECTS) $(channels_mutual_exclusion_1_LDADD) $(LIBS)
+channels/mutual_exclusion_2.$(OBJEXT): channels/$(am__dirstamp) \
+ channels/$(DEPDIR)/$(am__dirstamp)
+
+channels/mutual_exclusion_2$(EXEEXT): $(channels_mutual_exclusion_2_OBJECTS) $(channels_mutual_exclusion_2_DEPENDENCIES) $(EXTRA_channels_mutual_exclusion_2_DEPENDENCIES) channels/$(am__dirstamp)
+ @rm -f channels/mutual_exclusion_2$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(channels_mutual_exclusion_2_OBJECTS) $(channels_mutual_exclusion_2_LDADD) $(LIBS)
+channels/throttling_proxy.$(OBJEXT): channels/$(am__dirstamp) \
+ channels/$(DEPDIR)/$(am__dirstamp)
+
+channels/throttling_proxy$(EXEEXT): $(channels_throttling_proxy_OBJECTS) $(channels_throttling_proxy_DEPENDENCIES) $(EXTRA_channels_throttling_proxy_DEPENDENCIES) channels/$(am__dirstamp)
+ @rm -f channels/throttling_proxy$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(channels_throttling_proxy_OBJECTS) $(channels_throttling_proxy_LDADD) $(LIBS)
+coroutines/$(am__dirstamp):
+ @$(MKDIR_P) coroutines
+ @: > coroutines/$(am__dirstamp)
+coroutines/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) coroutines/$(DEPDIR)
+ @: > coroutines/$(DEPDIR)/$(am__dirstamp)
+coroutines/chat_server.$(OBJEXT): coroutines/$(am__dirstamp) \
+ coroutines/$(DEPDIR)/$(am__dirstamp)
+
+coroutines/chat_server$(EXEEXT): $(coroutines_chat_server_OBJECTS) $(coroutines_chat_server_DEPENDENCIES) $(EXTRA_coroutines_chat_server_DEPENDENCIES) coroutines/$(am__dirstamp)
+ @rm -f coroutines/chat_server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(coroutines_chat_server_OBJECTS) $(coroutines_chat_server_LDADD) $(LIBS)
+coroutines/echo_server.$(OBJEXT): coroutines/$(am__dirstamp) \
+ coroutines/$(DEPDIR)/$(am__dirstamp)
+
+coroutines/echo_server$(EXEEXT): $(coroutines_echo_server_OBJECTS) $(coroutines_echo_server_DEPENDENCIES) $(EXTRA_coroutines_echo_server_DEPENDENCIES) coroutines/$(am__dirstamp)
+ @rm -f coroutines/echo_server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(coroutines_echo_server_OBJECTS) $(coroutines_echo_server_LDADD) $(LIBS)
+coroutines/echo_server_with_as_single_default.$(OBJEXT): \
+ coroutines/$(am__dirstamp) \
+ coroutines/$(DEPDIR)/$(am__dirstamp)
+
+coroutines/echo_server_with_as_single_default$(EXEEXT): $(coroutines_echo_server_with_as_single_default_OBJECTS) $(coroutines_echo_server_with_as_single_default_DEPENDENCIES) $(EXTRA_coroutines_echo_server_with_as_single_default_DEPENDENCIES) coroutines/$(am__dirstamp)
+ @rm -f coroutines/echo_server_with_as_single_default$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(coroutines_echo_server_with_as_single_default_OBJECTS) $(coroutines_echo_server_with_as_single_default_LDADD) $(LIBS)
+coroutines/echo_server_with_as_tuple_default.$(OBJEXT): \
+ coroutines/$(am__dirstamp) \
+ coroutines/$(DEPDIR)/$(am__dirstamp)
+
+coroutines/echo_server_with_as_tuple_default$(EXEEXT): $(coroutines_echo_server_with_as_tuple_default_OBJECTS) $(coroutines_echo_server_with_as_tuple_default_DEPENDENCIES) $(EXTRA_coroutines_echo_server_with_as_tuple_default_DEPENDENCIES) coroutines/$(am__dirstamp)
+ @rm -f coroutines/echo_server_with_as_tuple_default$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(coroutines_echo_server_with_as_tuple_default_OBJECTS) $(coroutines_echo_server_with_as_tuple_default_LDADD) $(LIBS)
+coroutines/echo_server_with_default.$(OBJEXT): \
+ coroutines/$(am__dirstamp) \
+ coroutines/$(DEPDIR)/$(am__dirstamp)
+
+coroutines/echo_server_with_default$(EXEEXT): $(coroutines_echo_server_with_default_OBJECTS) $(coroutines_echo_server_with_default_DEPENDENCIES) $(EXTRA_coroutines_echo_server_with_default_DEPENDENCIES) coroutines/$(am__dirstamp)
+ @rm -f coroutines/echo_server_with_default$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(coroutines_echo_server_with_default_OBJECTS) $(coroutines_echo_server_with_default_LDADD) $(LIBS)
+coroutines/echo_server_with_deferred.$(OBJEXT): \
+ coroutines/$(am__dirstamp) \
+ coroutines/$(DEPDIR)/$(am__dirstamp)
+
+coroutines/echo_server_with_deferred$(EXEEXT): $(coroutines_echo_server_with_deferred_OBJECTS) $(coroutines_echo_server_with_deferred_DEPENDENCIES) $(EXTRA_coroutines_echo_server_with_deferred_DEPENDENCIES) coroutines/$(am__dirstamp)
+ @rm -f coroutines/echo_server_with_deferred$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(coroutines_echo_server_with_deferred_OBJECTS) $(coroutines_echo_server_with_deferred_LDADD) $(LIBS)
+coroutines/echo_server_with_deferred_default.$(OBJEXT): \
+ coroutines/$(am__dirstamp) \
+ coroutines/$(DEPDIR)/$(am__dirstamp)
+
+coroutines/echo_server_with_deferred_default$(EXEEXT): $(coroutines_echo_server_with_deferred_default_OBJECTS) $(coroutines_echo_server_with_deferred_default_DEPENDENCIES) $(EXTRA_coroutines_echo_server_with_deferred_default_DEPENDENCIES) coroutines/$(am__dirstamp)
+ @rm -f coroutines/echo_server_with_deferred_default$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(coroutines_echo_server_with_deferred_default_OBJECTS) $(coroutines_echo_server_with_deferred_default_LDADD) $(LIBS)
+coroutines/refactored_echo_server.$(OBJEXT): \
+ coroutines/$(am__dirstamp) \
+ coroutines/$(DEPDIR)/$(am__dirstamp)
+
+coroutines/refactored_echo_server$(EXEEXT): $(coroutines_refactored_echo_server_OBJECTS) $(coroutines_refactored_echo_server_DEPENDENCIES) $(EXTRA_coroutines_refactored_echo_server_DEPENDENCIES) coroutines/$(am__dirstamp)
+ @rm -f coroutines/refactored_echo_server$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(coroutines_refactored_echo_server_OBJECTS) $(coroutines_refactored_echo_server_LDADD) $(LIBS)
+coroutines/timeout.$(OBJEXT): coroutines/$(am__dirstamp) \
+ coroutines/$(DEPDIR)/$(am__dirstamp)
+
+coroutines/timeout$(EXEEXT): $(coroutines_timeout_OBJECTS) $(coroutines_timeout_DEPENDENCIES) $(EXTRA_coroutines_timeout_DEPENDENCIES) coroutines/$(am__dirstamp)
+ @rm -f coroutines/timeout$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(coroutines_timeout_OBJECTS) $(coroutines_timeout_LDADD) $(LIBS)
+invocation/$(am__dirstamp):
+ @$(MKDIR_P) invocation
+ @: > invocation/$(am__dirstamp)
+invocation/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) invocation/$(DEPDIR)
+ @: > invocation/$(DEPDIR)/$(am__dirstamp)
+invocation/completion_executor.$(OBJEXT): invocation/$(am__dirstamp) \
+ invocation/$(DEPDIR)/$(am__dirstamp)
+
+invocation/completion_executor$(EXEEXT): $(invocation_completion_executor_OBJECTS) $(invocation_completion_executor_DEPENDENCIES) $(EXTRA_invocation_completion_executor_DEPENDENCIES) invocation/$(am__dirstamp)
+ @rm -f invocation/completion_executor$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(invocation_completion_executor_OBJECTS) $(invocation_completion_executor_LDADD) $(LIBS)
+operations/$(am__dirstamp):
+ @$(MKDIR_P) operations
+ @: > operations/$(am__dirstamp)
+operations/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) operations/$(DEPDIR)
+ @: > operations/$(DEPDIR)/$(am__dirstamp)
+operations/c_callback_wrapper.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/c_callback_wrapper$(EXEEXT): $(operations_c_callback_wrapper_OBJECTS) $(operations_c_callback_wrapper_DEPENDENCIES) $(EXTRA_operations_c_callback_wrapper_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/c_callback_wrapper$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_c_callback_wrapper_OBJECTS) $(operations_c_callback_wrapper_LDADD) $(LIBS)
+operations/callback_wrapper.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/callback_wrapper$(EXEEXT): $(operations_callback_wrapper_OBJECTS) $(operations_callback_wrapper_DEPENDENCIES) $(EXTRA_operations_callback_wrapper_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/callback_wrapper$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_callback_wrapper_OBJECTS) $(operations_callback_wrapper_LDADD) $(LIBS)
+operations/composed_1.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/composed_1$(EXEEXT): $(operations_composed_1_OBJECTS) $(operations_composed_1_DEPENDENCIES) $(EXTRA_operations_composed_1_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/composed_1$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_composed_1_OBJECTS) $(operations_composed_1_LDADD) $(LIBS)
+operations/composed_2.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/composed_2$(EXEEXT): $(operations_composed_2_OBJECTS) $(operations_composed_2_DEPENDENCIES) $(EXTRA_operations_composed_2_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/composed_2$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_composed_2_OBJECTS) $(operations_composed_2_LDADD) $(LIBS)
+operations/composed_3.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/composed_3$(EXEEXT): $(operations_composed_3_OBJECTS) $(operations_composed_3_DEPENDENCIES) $(EXTRA_operations_composed_3_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/composed_3$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_composed_3_OBJECTS) $(operations_composed_3_LDADD) $(LIBS)
+operations/composed_4.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/composed_4$(EXEEXT): $(operations_composed_4_OBJECTS) $(operations_composed_4_DEPENDENCIES) $(EXTRA_operations_composed_4_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/composed_4$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_composed_4_OBJECTS) $(operations_composed_4_LDADD) $(LIBS)
+operations/composed_5.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/composed_5$(EXEEXT): $(operations_composed_5_OBJECTS) $(operations_composed_5_DEPENDENCIES) $(EXTRA_operations_composed_5_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/composed_5$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_composed_5_OBJECTS) $(operations_composed_5_LDADD) $(LIBS)
+operations/composed_6.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/composed_6$(EXEEXT): $(operations_composed_6_OBJECTS) $(operations_composed_6_DEPENDENCIES) $(EXTRA_operations_composed_6_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/composed_6$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_composed_6_OBJECTS) $(operations_composed_6_LDADD) $(LIBS)
+operations/composed_7.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/composed_7$(EXEEXT): $(operations_composed_7_OBJECTS) $(operations_composed_7_DEPENDENCIES) $(EXTRA_operations_composed_7_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/composed_7$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_composed_7_OBJECTS) $(operations_composed_7_LDADD) $(LIBS)
+operations/composed_8.$(OBJEXT): operations/$(am__dirstamp) \
+ operations/$(DEPDIR)/$(am__dirstamp)
+
+operations/composed_8$(EXEEXT): $(operations_composed_8_OBJECTS) $(operations_composed_8_DEPENDENCIES) $(EXTRA_operations_composed_8_DEPENDENCIES) operations/$(am__dirstamp)
+ @rm -f operations/composed_8$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(operations_composed_8_OBJECTS) $(operations_composed_8_LDADD) $(LIBS)
+type_erasure/$(am__dirstamp):
+ @$(MKDIR_P) type_erasure
+ @: > type_erasure/$(am__dirstamp)
+type_erasure/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) type_erasure/$(DEPDIR)
+ @: > type_erasure/$(DEPDIR)/$(am__dirstamp)
+type_erasure/main.$(OBJEXT): type_erasure/$(am__dirstamp) \
+ type_erasure/$(DEPDIR)/$(am__dirstamp)
+type_erasure/stdin_line_reader.$(OBJEXT): \
+ type_erasure/$(am__dirstamp) \
+ type_erasure/$(DEPDIR)/$(am__dirstamp)
+type_erasure/sleep.$(OBJEXT): type_erasure/$(am__dirstamp) \
+ type_erasure/$(DEPDIR)/$(am__dirstamp)
+
+type_erasure/type_erasure$(EXEEXT): $(type_erasure_type_erasure_OBJECTS) $(type_erasure_type_erasure_DEPENDENCIES) $(EXTRA_type_erasure_type_erasure_DEPENDENCIES) type_erasure/$(am__dirstamp)
+ @rm -f type_erasure/type_erasure$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(type_erasure_type_erasure_OBJECTS) $(type_erasure_type_erasure_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../../*.$(OBJEXT)
+ -rm -f channels/*.$(OBJEXT)
+ -rm -f coroutines/*.$(OBJEXT)
+ -rm -f invocation/*.$(OBJEXT)
+ -rm -f operations/*.$(OBJEXT)
+ -rm -f type_erasure/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/asio.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/asio_ssl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@channels/$(DEPDIR)/mutual_exclusion_1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@channels/$(DEPDIR)/mutual_exclusion_2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@channels/$(DEPDIR)/throttling_proxy.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@coroutines/$(DEPDIR)/chat_server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@coroutines/$(DEPDIR)/echo_server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@coroutines/$(DEPDIR)/echo_server_with_as_single_default.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@coroutines/$(DEPDIR)/echo_server_with_as_tuple_default.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@coroutines/$(DEPDIR)/echo_server_with_default.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@coroutines/$(DEPDIR)/echo_server_with_deferred.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@coroutines/$(DEPDIR)/echo_server_with_deferred_default.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@coroutines/$(DEPDIR)/refactored_echo_server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@coroutines/$(DEPDIR)/timeout.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@invocation/$(DEPDIR)/completion_executor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/c_callback_wrapper.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/callback_wrapper.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_4.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_5.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_6.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_7.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@operations/$(DEPDIR)/composed_8.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@type_erasure/$(DEPDIR)/main.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@type_erasure/$(DEPDIR)/sleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@type_erasure/$(DEPDIR)/stdin_line_reader.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(LIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f ../../$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../../$(am__dirstamp)
+ -rm -f channels/$(DEPDIR)/$(am__dirstamp)
+ -rm -f channels/$(am__dirstamp)
+ -rm -f coroutines/$(DEPDIR)/$(am__dirstamp)
+ -rm -f coroutines/$(am__dirstamp)
+ -rm -f invocation/$(DEPDIR)/$(am__dirstamp)
+ -rm -f invocation/$(am__dirstamp)
+ -rm -f operations/$(DEPDIR)/$(am__dirstamp)
+ -rm -f operations/$(am__dirstamp)
+ -rm -f type_erasure/$(DEPDIR)/$(am__dirstamp)
+ -rm -f type_erasure/$(am__dirstamp)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ../../$(DEPDIR)/asio.Po
+ -rm -f ../../$(DEPDIR)/asio_ssl.Po
+ -rm -f channels/$(DEPDIR)/mutual_exclusion_1.Po
+ -rm -f channels/$(DEPDIR)/mutual_exclusion_2.Po
+ -rm -f channels/$(DEPDIR)/throttling_proxy.Po
+ -rm -f coroutines/$(DEPDIR)/chat_server.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_as_single_default.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_as_tuple_default.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_default.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_deferred.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_deferred_default.Po
+ -rm -f coroutines/$(DEPDIR)/refactored_echo_server.Po
+ -rm -f coroutines/$(DEPDIR)/timeout.Po
+ -rm -f invocation/$(DEPDIR)/completion_executor.Po
+ -rm -f operations/$(DEPDIR)/c_callback_wrapper.Po
+ -rm -f operations/$(DEPDIR)/callback_wrapper.Po
+ -rm -f operations/$(DEPDIR)/composed_1.Po
+ -rm -f operations/$(DEPDIR)/composed_2.Po
+ -rm -f operations/$(DEPDIR)/composed_3.Po
+ -rm -f operations/$(DEPDIR)/composed_4.Po
+ -rm -f operations/$(DEPDIR)/composed_5.Po
+ -rm -f operations/$(DEPDIR)/composed_6.Po
+ -rm -f operations/$(DEPDIR)/composed_7.Po
+ -rm -f operations/$(DEPDIR)/composed_8.Po
+ -rm -f type_erasure/$(DEPDIR)/main.Po
+ -rm -f type_erasure/$(DEPDIR)/sleep.Po
+ -rm -f type_erasure/$(DEPDIR)/stdin_line_reader.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ../../$(DEPDIR)/asio.Po
+ -rm -f ../../$(DEPDIR)/asio_ssl.Po
+ -rm -f channels/$(DEPDIR)/mutual_exclusion_1.Po
+ -rm -f channels/$(DEPDIR)/mutual_exclusion_2.Po
+ -rm -f channels/$(DEPDIR)/throttling_proxy.Po
+ -rm -f coroutines/$(DEPDIR)/chat_server.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_as_single_default.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_as_tuple_default.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_default.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_deferred.Po
+ -rm -f coroutines/$(DEPDIR)/echo_server_with_deferred_default.Po
+ -rm -f coroutines/$(DEPDIR)/refactored_echo_server.Po
+ -rm -f coroutines/$(DEPDIR)/timeout.Po
+ -rm -f invocation/$(DEPDIR)/completion_executor.Po
+ -rm -f operations/$(DEPDIR)/c_callback_wrapper.Po
+ -rm -f operations/$(DEPDIR)/callback_wrapper.Po
+ -rm -f operations/$(DEPDIR)/composed_1.Po
+ -rm -f operations/$(DEPDIR)/composed_2.Po
+ -rm -f operations/$(DEPDIR)/composed_3.Po
+ -rm -f operations/$(DEPDIR)/composed_4.Po
+ -rm -f operations/$(DEPDIR)/composed_5.Po
+ -rm -f operations/$(DEPDIR)/composed_6.Po
+ -rm -f operations/$(DEPDIR)/composed_7.Po
+ -rm -f operations/$(DEPDIR)/composed_8.Po
+ -rm -f type_erasure/$(DEPDIR)/main.Po
+ -rm -f type_erasure/$(DEPDIR)/sleep.Po
+ -rm -f type_erasure/$(DEPDIR)/stdin_line_reader.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/3rdparty/asio/src/examples/cpp20/channels/mutual_exclusion_1.cpp b/3rdparty/asio/src/examples/cpp20/channels/mutual_exclusion_1.cpp
new file mode 100644
index 00000000000..79654f1e8f1
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/channels/mutual_exclusion_1.cpp
@@ -0,0 +1,182 @@
+//
+// mutual_exclusion_1.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/channel.hpp>
+#include <iostream>
+#include <memory>
+
+using asio::as_tuple;
+using asio::awaitable;
+using asio::dynamic_buffer;
+using asio::co_spawn;
+using asio::deferred;
+using asio::detached;
+using asio::experimental::channel;
+using asio::io_context;
+using asio::ip::tcp;
+using asio::steady_timer;
+using namespace asio::buffer_literals;
+using namespace std::literals::chrono_literals;
+
+// This class implements a simple line-based protocol:
+//
+// * For event line that is received from the client, the session sends a
+// message header followed by the content of the line as the message body.
+//
+// * The session generates heartbeat messages once a second.
+//
+// This protocol is implemented using two actors, handle_messages() and
+// send_heartbeats(), each written as a coroutine.
+class line_based_echo_session :
+ public std::enable_shared_from_this<line_based_echo_session>
+{
+ // The socket used to read from and write to the client. This socket is a
+ // data member as it is shared between the two actors.
+ tcp::socket socket_;
+
+ // As both of the actors will write to the socket, we need a lock to prevent
+ // these writes from overlapping. To achieve this, we use a channel with a
+ // buffer size of one. The lock is claimed by sending a message to the
+ // channel, and then released by receiving this message back again. If the
+ // lock is not held then the channel's buffer is empty, and the send will
+ // complete without delay. Otherwise, if the lock is held by the other actor,
+ // then the send operation will not complete until the lock is released.
+ channel<void()> write_lock_{socket_.get_executor(), 1};
+
+public:
+ line_based_echo_session(tcp::socket socket)
+ : socket_{std::move(socket)}
+ {
+ socket_.set_option(tcp::no_delay(true));
+ }
+
+ void start()
+ {
+ co_spawn(socket_.get_executor(),
+ [self = shared_from_this()]{ return self->handle_messages(); },
+ detached);
+
+ co_spawn(socket_.get_executor(),
+ [self = shared_from_this()]{ return self->send_heartbeats(); },
+ detached);
+ }
+
+private:
+ void stop()
+ {
+ socket_.close();
+ write_lock_.cancel();
+ }
+
+ awaitable<void> handle_messages()
+ {
+ try
+ {
+ constexpr std::size_t max_line_length = 1024;
+ std::string data;
+ for (;;)
+ {
+ // Read an entire line from the client.
+ std::size_t length = co_await async_read_until(socket_,
+ dynamic_buffer(data, max_line_length), '\n', deferred);
+
+ // Claim the write lock by sending a message to the channel. Since the
+ // channel signature is void(), there are no arguments to send in the
+ // message itself.
+ co_await write_lock_.async_send(deferred);
+
+ // Respond to the client with a message, echoing the line they sent.
+ co_await async_write(socket_, "<line>"_buf, deferred);
+ co_await async_write(socket_, dynamic_buffer(data, length), deferred);
+
+ // Release the lock by receiving the message back again.
+ write_lock_.try_receive([](auto...){});
+ }
+ }
+ catch (const std::exception&)
+ {
+ stop();
+ }
+ }
+
+ awaitable<void> send_heartbeats()
+ {
+ steady_timer timer{socket_.get_executor()};
+ try
+ {
+ for (;;)
+ {
+ // Wait one second before trying to send the next heartbeat.
+ timer.expires_after(1s);
+ co_await timer.async_wait(deferred);
+
+ // Claim the write lock by sending a message to the channel. Since the
+ // channel signature is void(), there are no arguments to send in the
+ // message itself.
+ co_await write_lock_.async_send(deferred);
+
+ // Send a heartbeat to the client. As the content of the heartbeat
+ // message never varies, a buffer literal can be used to specify the
+ // bytes of the message. The memory associated with a buffer literal is
+ // valid for the lifetime of the program, which mean that the buffer
+ // can be safely passed as-is to the asynchronous operation.
+ co_await async_write(socket_, "<heartbeat>\n"_buf, deferred);
+
+ // Release the lock by receiving the message back again.
+ write_lock_.try_receive([](auto...){});
+ }
+ }
+ catch (const std::exception&)
+ {
+ stop();
+ }
+ }
+
+};
+
+awaitable<void> listen(tcp::acceptor& acceptor)
+{
+ for (;;)
+ {
+ auto [e, socket] = co_await acceptor.async_accept(as_tuple(deferred));
+ if (!e)
+ {
+ std::make_shared<line_based_echo_session>(std::move(socket))->start();
+ }
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 3)
+ {
+ std::cerr << "Usage: mutual_exclusion_1";
+ std::cerr << " <listen_address> <listen_port>\n";
+ return 1;
+ }
+
+ io_context ctx;
+
+ auto listen_endpoint =
+ *tcp::resolver(ctx).resolve(argv[1], argv[2],
+ tcp::resolver::passive).begin();
+
+ tcp::acceptor acceptor(ctx, listen_endpoint);
+ co_spawn(ctx, listen(acceptor), detached);
+ ctx.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/channels/mutual_exclusion_2.cpp b/3rdparty/asio/src/examples/cpp20/channels/mutual_exclusion_2.cpp
new file mode 100644
index 00000000000..46cfeb647a2
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/channels/mutual_exclusion_2.cpp
@@ -0,0 +1,192 @@
+//
+// mutual_exclusion_2.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/channel.hpp>
+#include <iostream>
+#include <memory>
+
+using asio::as_tuple;
+using asio::awaitable;
+using asio::dynamic_buffer;
+using asio::co_spawn;
+using asio::deferred;
+using asio::detached;
+using asio::experimental::channel;
+using asio::io_context;
+using asio::ip::tcp;
+using asio::steady_timer;
+using namespace asio::buffer_literals;
+using namespace std::literals::chrono_literals;
+
+// This class implements a simple line-based protocol:
+//
+// * For event line that is received from the client, the session sends a
+// message header followed by the content of the line as the message body.
+//
+// * The session generates heartbeat messages once a second.
+//
+// This protocol is implemented using two actors, handle_messages() and
+// send_heartbeats(), each written as a coroutine.
+class line_based_echo_session :
+ public std::enable_shared_from_this<line_based_echo_session>
+{
+ // The socket used to read from and write to the client. This socket is a
+ // data member as it is shared between the two actors.
+ tcp::socket socket_;
+
+ // As both of the actors will write to the socket, we need a lock to prevent
+ // these writes from overlapping. To achieve this, we use a channel with a
+ // buffer size of one. The lock is claimed by sending a message to the
+ // channel, and then released by receiving this message back again. If the
+ // lock is not held then the channel's buffer is empty, and the send will
+ // complete without delay. Otherwise, if the lock is held by the other actor,
+ // then the send operation will not complete until the lock is released.
+ channel<void()> write_lock_{socket_.get_executor(), 1};
+
+public:
+ line_based_echo_session(tcp::socket socket)
+ : socket_{std::move(socket)}
+ {
+ socket_.set_option(tcp::no_delay(true));
+ }
+
+ void start()
+ {
+ co_spawn(socket_.get_executor(),
+ [self = shared_from_this()]{ return self->handle_messages(); },
+ detached);
+
+ co_spawn(socket_.get_executor(),
+ [self = shared_from_this()]{ return self->send_heartbeats(); },
+ detached);
+ }
+
+private:
+ void stop()
+ {
+ socket_.close();
+ write_lock_.cancel();
+ }
+
+ awaitable<void> handle_messages()
+ {
+ try
+ {
+ constexpr std::size_t max_line_length = 1024;
+ std::string data;
+ for (;;)
+ {
+ // Read an entire line from the client.
+ std::size_t length = co_await async_read_until(socket_,
+ dynamic_buffer(data, max_line_length), '\n', deferred);
+
+ // Claim the write lock by sending a message to the channel. Since the
+ // channel signature is void(), there are no arguments to send in the
+ // message itself. In this example we optimise for the common case,
+ // where the lock is not held by the other actor, by first trying a
+ // non-blocking send.
+ if (!write_lock_.try_send())
+ {
+ co_await write_lock_.async_send(deferred);
+ }
+
+ // Respond to the client with a message, echoing the line they sent.
+ co_await async_write(socket_, "<line>"_buf, deferred);
+ co_await async_write(socket_, dynamic_buffer(data, length), deferred);
+
+ // Release the lock by receiving the message back again.
+ write_lock_.try_receive([](auto...){});
+ }
+ }
+ catch (const std::exception&)
+ {
+ stop();
+ }
+ }
+
+ awaitable<void> send_heartbeats()
+ {
+ steady_timer timer{socket_.get_executor()};
+ try
+ {
+ for (;;)
+ {
+ // Wait one second before trying to send the next heartbeat.
+ timer.expires_after(1s);
+ co_await timer.async_wait(deferred);
+
+ // Claim the write lock by sending a message to the channel. Since the
+ // channel signature is void(), there are no arguments to send in the
+ // message itself. In this example we optimise for the common case,
+ // where the lock is not held by the other actor, by first trying a
+ // non-blocking send.
+ if (!write_lock_.try_send())
+ {
+ co_await write_lock_.async_send(deferred);
+ }
+
+ // Send a heartbeat to the client. As the content of the heartbeat
+ // message never varies, a buffer literal can be used to specify the
+ // bytes of the message. The memory associated with a buffer literal is
+ // valid for the lifetime of the program, which mean that the buffer
+ // can be safely passed as-is to the asynchronous operation.
+ co_await async_write(socket_, "<heartbeat>\n"_buf, deferred);
+
+ // Release the lock by receiving the message back again.
+ write_lock_.try_receive([](auto...){});
+ }
+ }
+ catch (const std::exception&)
+ {
+ stop();
+ }
+ }
+
+};
+
+awaitable<void> listen(tcp::acceptor& acceptor)
+{
+ for (;;)
+ {
+ auto [e, socket] = co_await acceptor.async_accept(as_tuple(deferred));
+ if (!e)
+ {
+ std::make_shared<line_based_echo_session>(std::move(socket))->start();
+ }
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 3)
+ {
+ std::cerr << "Usage: mutual_exclusion_1";
+ std::cerr << " <listen_address> <listen_port>\n";
+ return 1;
+ }
+
+ io_context ctx;
+
+ auto listen_endpoint =
+ *tcp::resolver(ctx).resolve(argv[1], argv[2],
+ tcp::resolver::passive).begin();
+
+ tcp::acceptor acceptor(ctx, listen_endpoint);
+ co_spawn(ctx, listen(acceptor), detached);
+ ctx.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/channels/throttling_proxy.cpp b/3rdparty/asio/src/examples/cpp20/channels/throttling_proxy.cpp
new file mode 100644
index 00000000000..c54d2986af7
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/channels/throttling_proxy.cpp
@@ -0,0 +1,135 @@
+//
+// throttling_proxy.cpp
+// ~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/awaitable_operators.hpp>
+#include <asio/experimental/channel.hpp>
+#include <iostream>
+
+using asio::as_tuple;
+using asio::awaitable;
+using asio::buffer;
+using asio::co_spawn;
+using asio::detached;
+using asio::experimental::channel;
+using asio::io_context;
+using asio::ip::tcp;
+using asio::steady_timer;
+using asio::use_awaitable;
+namespace this_coro = asio::this_coro;
+using namespace asio::experimental::awaitable_operators;
+using namespace std::literals::chrono_literals;
+
+using token_channel = channel<void(asio::error_code, std::size_t)>;
+
+awaitable<void> produce_tokens(std::size_t bytes_per_token,
+ steady_timer::duration token_interval, token_channel& tokens)
+{
+ steady_timer timer(co_await this_coro::executor);
+ for (;;)
+ {
+ co_await tokens.async_send(
+ asio::error_code{}, bytes_per_token,
+ use_awaitable);
+
+ timer.expires_after(token_interval);
+ co_await timer.async_wait(use_awaitable);
+ }
+}
+
+awaitable<void> transfer(tcp::socket& from,
+ tcp::socket& to, token_channel& tokens)
+{
+ std::array<unsigned char, 4096> data;
+ for (;;)
+ {
+ std::size_t bytes_available = co_await tokens.async_receive(use_awaitable);
+ while (bytes_available > 0)
+ {
+ std::size_t n = co_await from.async_read_some(
+ buffer(data, bytes_available), use_awaitable);
+
+ co_await async_write(to, buffer(data, n), use_awaitable);
+
+ bytes_available -= n;
+ }
+ }
+}
+
+awaitable<void> proxy(tcp::socket client, tcp::endpoint target)
+{
+ constexpr std::size_t number_of_tokens = 100;
+ constexpr size_t bytes_per_token = 20 * 1024;
+ constexpr steady_timer::duration token_interval = 100ms;
+
+ auto ex = client.get_executor();
+ tcp::socket server(ex);
+ token_channel client_tokens(ex, number_of_tokens);
+ token_channel server_tokens(ex, number_of_tokens);
+
+ co_await server.async_connect(target, use_awaitable);
+ co_await (
+ produce_tokens(bytes_per_token, token_interval, client_tokens) &&
+ transfer(client, server, client_tokens) &&
+ produce_tokens(bytes_per_token, token_interval, server_tokens) &&
+ transfer(server, client, server_tokens)
+ );
+}
+
+awaitable<void> listen(tcp::acceptor& acceptor, tcp::endpoint target)
+{
+ for (;;)
+ {
+ auto [e, client] = co_await acceptor.async_accept(as_tuple(use_awaitable));
+ if (!e)
+ {
+ auto ex = client.get_executor();
+ co_spawn(ex, proxy(std::move(client), target), detached);
+ }
+ else
+ {
+ std::cerr << "Accept failed: " << e.message() << "\n";
+ steady_timer timer(co_await this_coro::executor);
+ timer.expires_after(100ms);
+ co_await timer.async_wait(use_awaitable);
+ }
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 5)
+ {
+ std::cerr << "Usage: throttling_proxy";
+ std::cerr << " <listen_address> <listen_port>";
+ std::cerr << " <target_address> <target_port>\n";
+ return 1;
+ }
+
+ io_context ctx;
+
+ auto listen_endpoint =
+ *tcp::resolver(ctx).resolve(argv[1], argv[2],
+ tcp::resolver::passive).begin();
+
+ auto target_endpoint =
+ *tcp::resolver(ctx).resolve(argv[3], argv[4]).begin();
+
+ tcp::acceptor acceptor(ctx, listen_endpoint);
+ co_spawn(ctx, listen(acceptor, target_endpoint), detached);
+ ctx.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/coroutines/chat_server.cpp b/3rdparty/asio/src/examples/cpp20/coroutines/chat_server.cpp
new file mode 100644
index 00000000000..cd5fba32486
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/coroutines/chat_server.cpp
@@ -0,0 +1,222 @@
+//
+// chat_server.cpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <cstdlib>
+#include <deque>
+#include <iostream>
+#include <list>
+#include <memory>
+#include <set>
+#include <string>
+#include <utility>
+#include <asio/awaitable.hpp>
+#include <asio/detached.hpp>
+#include <asio/co_spawn.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/read_until.hpp>
+#include <asio/redirect_error.hpp>
+#include <asio/signal_set.hpp>
+#include <asio/steady_timer.hpp>
+#include <asio/use_awaitable.hpp>
+#include <asio/write.hpp>
+
+using asio::ip::tcp;
+using asio::awaitable;
+using asio::co_spawn;
+using asio::detached;
+using asio::redirect_error;
+using asio::use_awaitable;
+
+//----------------------------------------------------------------------
+
+class chat_participant
+{
+public:
+ virtual ~chat_participant() {}
+ virtual void deliver(const std::string& msg) = 0;
+};
+
+typedef std::shared_ptr<chat_participant> chat_participant_ptr;
+
+//----------------------------------------------------------------------
+
+class chat_room
+{
+public:
+ void join(chat_participant_ptr participant)
+ {
+ participants_.insert(participant);
+ for (auto msg: recent_msgs_)
+ participant->deliver(msg);
+ }
+
+ void leave(chat_participant_ptr participant)
+ {
+ participants_.erase(participant);
+ }
+
+ void deliver(const std::string& msg)
+ {
+ recent_msgs_.push_back(msg);
+ while (recent_msgs_.size() > max_recent_msgs)
+ recent_msgs_.pop_front();
+
+ for (auto participant: participants_)
+ participant->deliver(msg);
+ }
+
+private:
+ std::set<chat_participant_ptr> participants_;
+ enum { max_recent_msgs = 100 };
+ std::deque<std::string> recent_msgs_;
+};
+
+//----------------------------------------------------------------------
+
+class chat_session
+ : public chat_participant,
+ public std::enable_shared_from_this<chat_session>
+{
+public:
+ chat_session(tcp::socket socket, chat_room& room)
+ : socket_(std::move(socket)),
+ timer_(socket_.get_executor()),
+ room_(room)
+ {
+ timer_.expires_at(std::chrono::steady_clock::time_point::max());
+ }
+
+ void start()
+ {
+ room_.join(shared_from_this());
+
+ co_spawn(socket_.get_executor(),
+ [self = shared_from_this()]{ return self->reader(); },
+ detached);
+
+ co_spawn(socket_.get_executor(),
+ [self = shared_from_this()]{ return self->writer(); },
+ detached);
+ }
+
+ void deliver(const std::string& msg)
+ {
+ write_msgs_.push_back(msg);
+ timer_.cancel_one();
+ }
+
+private:
+ awaitable<void> reader()
+ {
+ try
+ {
+ for (std::string read_msg;;)
+ {
+ std::size_t n = co_await asio::async_read_until(socket_,
+ asio::dynamic_buffer(read_msg, 1024), "\n", use_awaitable);
+
+ room_.deliver(read_msg.substr(0, n));
+ read_msg.erase(0, n);
+ }
+ }
+ catch (std::exception&)
+ {
+ stop();
+ }
+ }
+
+ awaitable<void> writer()
+ {
+ try
+ {
+ while (socket_.is_open())
+ {
+ if (write_msgs_.empty())
+ {
+ asio::error_code ec;
+ co_await timer_.async_wait(redirect_error(use_awaitable, ec));
+ }
+ else
+ {
+ co_await asio::async_write(socket_,
+ asio::buffer(write_msgs_.front()), use_awaitable);
+ write_msgs_.pop_front();
+ }
+ }
+ }
+ catch (std::exception&)
+ {
+ stop();
+ }
+ }
+
+ void stop()
+ {
+ room_.leave(shared_from_this());
+ socket_.close();
+ timer_.cancel();
+ }
+
+ tcp::socket socket_;
+ asio::steady_timer timer_;
+ chat_room& room_;
+ std::deque<std::string> write_msgs_;
+};
+
+//----------------------------------------------------------------------
+
+awaitable<void> listener(tcp::acceptor acceptor)
+{
+ chat_room room;
+
+ for (;;)
+ {
+ std::make_shared<chat_session>(
+ co_await acceptor.async_accept(use_awaitable),
+ room
+ )->start();
+ }
+}
+
+//----------------------------------------------------------------------
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc < 2)
+ {
+ std::cerr << "Usage: chat_server <port> [<port> ...]\n";
+ return 1;
+ }
+
+ asio::io_context io_context(1);
+
+ for (int i = 1; i < argc; ++i)
+ {
+ unsigned short port = std::atoi(argv[i]);
+ co_spawn(io_context,
+ listener(tcp::acceptor(io_context, {tcp::v4(), port})),
+ detached);
+ }
+
+ asio::signal_set signals(io_context, SIGINT, SIGTERM);
+ signals.async_wait([&](auto, auto){ io_context.stop(); });
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}
diff --git a/3rdparty/asio/src/examples/cpp20/coroutines/echo_server.cpp b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server.cpp
new file mode 100644
index 00000000000..a9532459f77
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server.cpp
@@ -0,0 +1,76 @@
+//
+// echo_server.cpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/co_spawn.hpp>
+#include <asio/detached.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/signal_set.hpp>
+#include <asio/write.hpp>
+#include <cstdio>
+
+using asio::ip::tcp;
+using asio::awaitable;
+using asio::co_spawn;
+using asio::detached;
+using asio::use_awaitable;
+namespace this_coro = asio::this_coro;
+
+#if defined(ASIO_ENABLE_HANDLER_TRACKING)
+# define use_awaitable \
+ asio::use_awaitable_t(__FILE__, __LINE__, __PRETTY_FUNCTION__)
+#endif
+
+awaitable<void> echo(tcp::socket socket)
+{
+ try
+ {
+ char data[1024];
+ for (;;)
+ {
+ std::size_t n = co_await socket.async_read_some(asio::buffer(data), use_awaitable);
+ co_await async_write(socket, asio::buffer(data, n), use_awaitable);
+ }
+ }
+ catch (std::exception& e)
+ {
+ std::printf("echo Exception: %s\n", e.what());
+ }
+}
+
+awaitable<void> listener()
+{
+ auto executor = co_await this_coro::executor;
+ tcp::acceptor acceptor(executor, {tcp::v4(), 55555});
+ for (;;)
+ {
+ tcp::socket socket = co_await acceptor.async_accept(use_awaitable);
+ co_spawn(executor, echo(std::move(socket)), detached);
+ }
+}
+
+int main()
+{
+ try
+ {
+ asio::io_context io_context(1);
+
+ asio::signal_set signals(io_context, SIGINT, SIGTERM);
+ signals.async_wait([&](auto, auto){ io_context.stop(); });
+
+ co_spawn(io_context, listener(), detached);
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::printf("Exception: %s\n", e.what());
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_as_single_default.cpp b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_as_single_default.cpp
new file mode 100644
index 00000000000..4a692acc872
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_as_single_default.cpp
@@ -0,0 +1,71 @@
+//
+// echo_server_with_as_single_default.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/experimental/as_single.hpp>
+#include <asio/co_spawn.hpp>
+#include <asio/detached.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/signal_set.hpp>
+#include <asio/write.hpp>
+#include <cstdio>
+
+using asio::experimental::as_single_t;
+using asio::ip::tcp;
+using asio::awaitable;
+using asio::co_spawn;
+using asio::detached;
+using asio::use_awaitable_t;
+using default_token = as_single_t<use_awaitable_t<>>;
+using tcp_acceptor = default_token::as_default_on_t<tcp::acceptor>;
+using tcp_socket = default_token::as_default_on_t<tcp::socket>;
+namespace this_coro = asio::this_coro;
+
+awaitable<void> echo(tcp_socket socket)
+{
+ char data[1024];
+ for (;;)
+ {
+ auto [e1, nread] = co_await socket.async_read_some(asio::buffer(data));
+ if (nread == 0) break;
+ auto [e2, nwritten] = co_await async_write(socket, asio::buffer(data, nread));
+ if (nwritten != nread) break;
+ }
+}
+
+awaitable<void> listener()
+{
+ auto executor = co_await this_coro::executor;
+ tcp_acceptor acceptor(executor, {tcp::v4(), 55555});
+ for (;;)
+ {
+ if (auto [e, socket] = co_await acceptor.async_accept(); socket.is_open())
+ co_spawn(executor, echo(std::move(socket)), detached);
+ }
+}
+
+int main()
+{
+ try
+ {
+ asio::io_context io_context(1);
+
+ asio::signal_set signals(io_context, SIGINT, SIGTERM);
+ signals.async_wait([&](auto, auto){ io_context.stop(); });
+
+ co_spawn(io_context, listener(), detached);
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::printf("Exception: %s\n", e.what());
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_as_tuple_default.cpp b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_as_tuple_default.cpp
new file mode 100644
index 00000000000..de162cad78e
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_as_tuple_default.cpp
@@ -0,0 +1,71 @@
+//
+// echo_server_with_as_tuple_default.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/as_tuple.hpp>
+#include <asio/co_spawn.hpp>
+#include <asio/detached.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/signal_set.hpp>
+#include <asio/write.hpp>
+#include <cstdio>
+
+using asio::as_tuple_t;
+using asio::ip::tcp;
+using asio::awaitable;
+using asio::co_spawn;
+using asio::detached;
+using asio::use_awaitable_t;
+using default_token = as_tuple_t<use_awaitable_t<>>;
+using tcp_acceptor = default_token::as_default_on_t<tcp::acceptor>;
+using tcp_socket = default_token::as_default_on_t<tcp::socket>;
+namespace this_coro = asio::this_coro;
+
+awaitable<void> echo(tcp_socket socket)
+{
+ char data[1024];
+ for (;;)
+ {
+ auto [e1, nread] = co_await socket.async_read_some(asio::buffer(data));
+ if (nread == 0) break;
+ auto [e2, nwritten] = co_await async_write(socket, asio::buffer(data, nread));
+ if (nwritten != nread) break;
+ }
+}
+
+awaitable<void> listener()
+{
+ auto executor = co_await this_coro::executor;
+ tcp_acceptor acceptor(executor, {tcp::v4(), 55555});
+ for (;;)
+ {
+ if (auto [e, socket] = co_await acceptor.async_accept(); socket.is_open())
+ co_spawn(executor, echo(std::move(socket)), detached);
+ }
+}
+
+int main()
+{
+ try
+ {
+ asio::io_context io_context(1);
+
+ asio::signal_set signals(io_context, SIGINT, SIGTERM);
+ signals.async_wait([&](auto, auto){ io_context.stop(); });
+
+ co_spawn(io_context, listener(), detached);
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::printf("Exception: %s\n", e.what());
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_default.cpp b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_default.cpp
new file mode 100644
index 00000000000..54344d94d56
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_default.cpp
@@ -0,0 +1,73 @@
+//
+// echo_server_with_default.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/co_spawn.hpp>
+#include <asio/detached.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/signal_set.hpp>
+#include <asio/write.hpp>
+#include <cstdio>
+
+using asio::ip::tcp;
+using asio::awaitable;
+using asio::co_spawn;
+using asio::detached;
+using asio::use_awaitable_t;
+using tcp_acceptor = use_awaitable_t<>::as_default_on_t<tcp::acceptor>;
+using tcp_socket = use_awaitable_t<>::as_default_on_t<tcp::socket>;
+namespace this_coro = asio::this_coro;
+
+awaitable<void> echo(tcp_socket socket)
+{
+ try
+ {
+ char data[1024];
+ for (;;)
+ {
+ std::size_t n = co_await socket.async_read_some(asio::buffer(data));
+ co_await async_write(socket, asio::buffer(data, n));
+ }
+ }
+ catch (std::exception& e)
+ {
+ std::printf("echo Exception: %s\n", e.what());
+ }
+}
+
+awaitable<void> listener()
+{
+ auto executor = co_await this_coro::executor;
+ tcp_acceptor acceptor(executor, {tcp::v4(), 55555});
+ for (;;)
+ {
+ auto socket = co_await acceptor.async_accept();
+ co_spawn(executor, echo(std::move(socket)), detached);
+ }
+}
+
+int main()
+{
+ try
+ {
+ asio::io_context io_context(1);
+
+ asio::signal_set signals(io_context, SIGINT, SIGTERM);
+ signals.async_wait([&](auto, auto){ io_context.stop(); });
+
+ co_spawn(io_context, listener(), detached);
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::printf("Exception: %s\n", e.what());
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_deferred.cpp b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_deferred.cpp
new file mode 100644
index 00000000000..54469ba7aba
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_deferred.cpp
@@ -0,0 +1,72 @@
+//
+// echo_server.cpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/co_spawn.hpp>
+#include <asio/deferred.hpp>
+#include <asio/detached.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/signal_set.hpp>
+#include <asio/write.hpp>
+#include <cstdio>
+
+using asio::ip::tcp;
+using asio::awaitable;
+using asio::co_spawn;
+using asio::deferred;
+using asio::detached;
+namespace this_coro = asio::this_coro;
+
+awaitable<void> echo(tcp::socket socket)
+{
+ try
+ {
+ char data[1024];
+ for (;;)
+ {
+ std::size_t n = co_await socket.async_read_some(asio::buffer(data), deferred);
+ co_await async_write(socket, asio::buffer(data, n), deferred);
+ }
+ }
+ catch (std::exception& e)
+ {
+ std::printf("echo Exception: %s\n", e.what());
+ }
+}
+
+awaitable<void> listener()
+{
+ auto executor = co_await this_coro::executor;
+ tcp::acceptor acceptor(executor, {tcp::v4(), 55555});
+ for (;;)
+ {
+ tcp::socket socket = co_await acceptor.async_accept(deferred);
+ co_spawn(executor, echo(std::move(socket)), detached);
+ }
+}
+
+int main()
+{
+ try
+ {
+ asio::io_context io_context(1);
+
+ asio::signal_set signals(io_context, SIGINT, SIGTERM);
+ signals.async_wait([&](auto, auto){ io_context.stop(); });
+
+ co_spawn(io_context, listener(), detached);
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::printf("Exception: %s\n", e.what());
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_deferred_default.cpp b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_deferred_default.cpp
new file mode 100644
index 00000000000..33c383311d2
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/coroutines/echo_server_with_deferred_default.cpp
@@ -0,0 +1,74 @@
+//
+// echo_server.cpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/co_spawn.hpp>
+#include <asio/deferred.hpp>
+#include <asio/detached.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/signal_set.hpp>
+#include <asio/write.hpp>
+#include <cstdio>
+
+using asio::ip::tcp;
+using asio::awaitable;
+using asio::co_spawn;
+using asio::detached;
+using default_token = asio::deferred_t;
+using tcp_acceptor = default_token::as_default_on_t<tcp::acceptor>;
+using tcp_socket = default_token::as_default_on_t<tcp::socket>;
+namespace this_coro = asio::this_coro;
+
+awaitable<void> echo(tcp_socket socket)
+{
+ try
+ {
+ char data[1024];
+ for (;;)
+ {
+ std::size_t n = co_await socket.async_read_some(asio::buffer(data));
+ co_await async_write(socket, asio::buffer(data, n));
+ }
+ }
+ catch (std::exception& e)
+ {
+ std::printf("echo Exception: %s\n", e.what());
+ }
+}
+
+awaitable<void> listener()
+{
+ auto executor = co_await this_coro::executor;
+ tcp_acceptor acceptor(executor, {tcp::v4(), 55555});
+ for (;;)
+ {
+ tcp::socket socket = co_await acceptor.async_accept();
+ co_spawn(executor, echo(std::move(socket)), detached);
+ }
+}
+
+int main()
+{
+ try
+ {
+ asio::io_context io_context(1);
+
+ asio::signal_set signals(io_context, SIGINT, SIGTERM);
+ signals.async_wait([&](auto, auto){ io_context.stop(); });
+
+ co_spawn(io_context, listener(), detached);
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::printf("Exception: %s\n", e.what());
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/coroutines/refactored_echo_server.cpp b/3rdparty/asio/src/examples/cpp20/coroutines/refactored_echo_server.cpp
new file mode 100644
index 00000000000..dc7b03d86e2
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/coroutines/refactored_echo_server.cpp
@@ -0,0 +1,80 @@
+//
+// refactored_echo_server.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/co_spawn.hpp>
+#include <asio/detached.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/signal_set.hpp>
+#include <asio/write.hpp>
+#include <cstdio>
+
+using asio::ip::tcp;
+using asio::awaitable;
+using asio::co_spawn;
+using asio::detached;
+using asio::use_awaitable;
+namespace this_coro = asio::this_coro;
+
+awaitable<void> echo_once(tcp::socket& socket)
+{
+ char data[128];
+ std::size_t n = co_await socket.async_read_some(asio::buffer(data), use_awaitable);
+ co_await async_write(socket, asio::buffer(data, n), use_awaitable);
+}
+
+awaitable<void> echo(tcp::socket socket)
+{
+ try
+ {
+ for (;;)
+ {
+ // The asynchronous operations to echo a single chunk of data have been
+ // refactored into a separate function. When this function is called, the
+ // operations are still performed in the context of the current
+ // coroutine, and the behaviour is functionally equivalent.
+ co_await echo_once(socket);
+ }
+ }
+ catch (std::exception& e)
+ {
+ std::printf("echo Exception: %s\n", e.what());
+ }
+}
+
+awaitable<void> listener()
+{
+ auto executor = co_await this_coro::executor;
+ tcp::acceptor acceptor(executor, {tcp::v4(), 55555});
+ for (;;)
+ {
+ tcp::socket socket = co_await acceptor.async_accept(use_awaitable);
+ co_spawn(executor, echo(std::move(socket)), detached);
+ }
+}
+
+int main()
+{
+ try
+ {
+ asio::io_context io_context(1);
+
+ asio::signal_set signals(io_context, SIGINT, SIGTERM);
+ signals.async_wait([&](auto, auto){ io_context.stop(); });
+
+ co_spawn(io_context, listener(), detached);
+
+ io_context.run();
+ }
+ catch (std::exception& e)
+ {
+ std::printf("Exception: %s\n", e.what());
+ }
+}
diff --git a/3rdparty/asio/src/examples/cpp20/coroutines/timeout.cpp b/3rdparty/asio/src/examples/cpp20/coroutines/timeout.cpp
new file mode 100644
index 00000000000..2ffcab7ad35
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/coroutines/timeout.cpp
@@ -0,0 +1,66 @@
+//
+// timeout.cpp
+// ~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <asio/experimental/awaitable_operators.hpp>
+
+using namespace asio;
+using namespace asio::experimental::awaitable_operators;
+using time_point = std::chrono::steady_clock::time_point;
+using ip::tcp;
+
+awaitable<void> echo(tcp::socket& sock, time_point& deadline)
+{
+ char data[4196];
+ for (;;)
+ {
+ deadline = std::chrono::steady_clock::now() + std::chrono::seconds(10);
+ auto n = co_await sock.async_read_some(buffer(data), use_awaitable);
+ co_await async_write(sock, buffer(data, n), use_awaitable);
+ }
+}
+
+awaitable<void> watchdog(time_point& deadline)
+{
+ steady_timer timer(co_await this_coro::executor);
+ auto now = std::chrono::steady_clock::now();
+ while (deadline > now)
+ {
+ timer.expires_at(deadline);
+ co_await timer.async_wait(use_awaitable);
+ now = std::chrono::steady_clock::now();
+ }
+ throw std::system_error(std::make_error_code(std::errc::timed_out));
+}
+
+awaitable<void> handle_connection(tcp::socket sock)
+{
+ time_point deadline{};
+ co_await (echo(sock, deadline) && watchdog(deadline));
+}
+
+awaitable<void> listen(tcp::acceptor& acceptor)
+{
+ for (;;)
+ {
+ co_spawn(
+ acceptor.get_executor(),
+ handle_connection(co_await acceptor.async_accept(use_awaitable)),
+ detached);
+ }
+}
+
+int main()
+{
+ io_context ctx;
+ tcp::acceptor acceptor(ctx, {tcp::v4(), 54321});
+ co_spawn(ctx, listen(acceptor), detached);
+ ctx.run();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/invocation/completion_executor.cpp b/3rdparty/asio/src/examples/cpp20/invocation/completion_executor.cpp
new file mode 100644
index 00000000000..409be96d0f4
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/invocation/completion_executor.cpp
@@ -0,0 +1,83 @@
+//
+// completion_executor.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 "asio.hpp"
+#include <concepts>
+#include <iostream>
+
+using asio::ip::tcp;
+
+//----------------------------------------------------------------------
+
+// The logging_executor class implements a minimal executor that satisfies the
+// requirements for use as a completion executor. This means it may be bound to
+// a handler using bind_executor.
+class logging_executor
+{
+public:
+ // All executors must be no-throw equality comparable.
+ bool operator==(const logging_executor&) const noexcept = default;
+
+ // All executors must provide a const member function execute().
+ void execute(std::invocable auto handler) const
+ {
+ try
+ {
+ std::cout << "handler invocation starting\n";
+ std::move(handler)();
+ std::cout << "handler invocation complete\n";
+ }
+ catch (...)
+ {
+ std::cout << "handler invocation completed with exception\n";
+ throw;
+ }
+ }
+};
+
+// Confirm that a logging_executor satisfies the executor requirements.
+static_assert(asio::execution::executor<logging_executor>);
+
+// Confirm that a logging_executor can be used as a completion executor.
+static_assert(std::convertible_to<
+ logging_executor, asio::any_completion_executor>);
+
+//----------------------------------------------------------------------
+
+int main()
+{
+ asio::io_context io_context(1);
+
+ // Post a completion handler to be run immediately.
+ asio::post(io_context,
+ asio::bind_executor(logging_executor{},
+ []{ std::cout << "post complete\n"; }));
+
+ // Start an asynchronous accept that will complete immediately.
+ tcp::endpoint endpoint(asio::ip::address_v4::loopback(), 0);
+ tcp::acceptor acceptor(io_context, endpoint);
+ tcp::socket server_socket(io_context);
+ acceptor.async_accept(
+ asio::bind_executor(logging_executor{},
+ [](auto...){ std::cout << "async_accept complete\n"; }));
+ tcp::socket client_socket(io_context);
+ client_socket.connect(acceptor.local_endpoint());
+
+ // Set a timer to expire immediately.
+ asio::steady_timer timer(io_context);
+ timer.expires_at(asio::steady_timer::clock_type::time_point::min());
+ timer.async_wait(
+ asio::bind_executor(logging_executor{},
+ [](auto){ std::cout << "async_wait complete\n"; }));
+
+ io_context.run();
+
+ return 0;
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/c_callback_wrapper.cpp b/3rdparty/asio/src/examples/cpp20/operations/c_callback_wrapper.cpp
new file mode 100644
index 00000000000..f4fbe2617ea
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/c_callback_wrapper.cpp
@@ -0,0 +1,232 @@
+//
+// c_callback_wrapper.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <iostream>
+#include <memory>
+#include <new>
+
+//------------------------------------------------------------------------------
+
+// This is a mock implementation of a C-based API that uses the function pointer
+// plus void* context idiom for exposing a callback.
+
+void read_input(const char* prompt, void (*cb)(void*, const char*), void* arg)
+{
+ std::thread(
+ [prompt = std::string(prompt), cb, arg]
+ {
+ std::cout << prompt << ": ";
+ std::cout.flush();
+ std::string line;
+ std::getline(std::cin, line);
+ cb(arg, line.c_str());
+ }).detach();
+}
+
+//------------------------------------------------------------------------------
+
+// This is an asynchronous operation that wraps the C-based API.
+
+// To map our completion handler into a function pointer / void* callback, we
+// need to allocate some state that will live for the duration of the
+// operation. A pointer to this state will be passed to the C-based API.
+template <asio::completion_handler_for<void(std::string)> Handler>
+class read_input_state
+{
+public:
+ read_input_state(Handler&& handler)
+ : handler_(std::move(handler)),
+ work_(asio::make_work_guard(handler_))
+ {
+ }
+
+ // Create the state using the handler's associated allocator.
+ static read_input_state* create(Handler&& handler)
+ {
+ // A unique_ptr deleter that is used to destroy uninitialised objects.
+ struct deleter
+ {
+ // Get the handler's associated allocator type. If the handler does not
+ // specify an associated allocator, we will use a recycling allocator as
+ // the default. As the associated allocator is a proto-allocator, we must
+ // rebind it to the correct type before we can use it to allocate objects.
+ typename std::allocator_traits<
+ asio::associated_allocator_t<Handler,
+ asio::recycling_allocator<void>>>::template
+ rebind_alloc<read_input_state> alloc;
+
+ void operator()(read_input_state* ptr)
+ {
+ std::allocator_traits<decltype(alloc)>::deallocate(alloc, ptr, 1);
+ }
+ } d{asio::get_associated_allocator(handler,
+ asio::recycling_allocator<void>())};
+
+ // Allocate memory for the state.
+ std::unique_ptr<read_input_state, deleter> uninit_ptr(
+ std::allocator_traits<decltype(d.alloc)>::allocate(d.alloc, 1), d);
+
+ // Construct the state into the newly allocated memory. This might throw.
+ read_input_state* ptr =
+ new (uninit_ptr.get()) read_input_state(std::move(handler));
+
+ // Release ownership of the memory and return the newly allocated state.
+ uninit_ptr.release();
+ return ptr;
+ }
+
+ static void callback(void* arg, const char* result)
+ {
+ read_input_state* self = static_cast<read_input_state*>(arg);
+
+ // A unique_ptr deleter that is used to destroy initialised objects.
+ struct deleter
+ {
+ // Get the handler's associated allocator type. If the handler does not
+ // specify an associated allocator, we will use a recycling allocator as
+ // the default. As the associated allocator is a proto-allocator, we must
+ // rebind it to the correct type before we can use it to allocate objects.
+ typename std::allocator_traits<
+ asio::associated_allocator_t<Handler,
+ asio::recycling_allocator<void>>>::template
+ rebind_alloc<read_input_state> alloc;
+
+ void operator()(read_input_state* ptr)
+ {
+ std::allocator_traits<decltype(alloc)>::destroy(alloc, ptr);
+ std::allocator_traits<decltype(alloc)>::deallocate(alloc, ptr, 1);
+ }
+ } d{asio::get_associated_allocator(self->handler_,
+ asio::recycling_allocator<void>())};
+
+ // To conform to the rules regarding asynchronous operations and memory
+ // allocation, we must make a copy of the state and deallocate the memory
+ // before dispatching the completion handler.
+ std::unique_ptr<read_input_state, deleter> state_ptr(self, d);
+ read_input_state state(std::move(*self));
+ state_ptr.reset();
+
+ // Dispatch the completion handler through the handler's associated
+ // executor, using the handler's associated allocator.
+ asio::dispatch(state.work_.get_executor(),
+ asio::bind_allocator(d.alloc,
+ [
+ handler = std::move(state.handler_),
+ result = std::string(result)
+ ]() mutable
+ {
+ std::move(handler)(result);
+ }));
+ }
+
+private:
+ Handler handler_;
+
+ // According to the rules for asynchronous operations, we need to track
+ // outstanding work against the handler's associated executor until the
+ // asynchronous operation is complete.
+ asio::executor_work_guard<
+ asio::associated_executor_t<Handler>> work_;
+};
+
+// The initiating function for the asynchronous operation.
+template <asio::completion_token_for<void(std::string)> CompletionToken>
+auto async_read_input(const std::string& prompt, CompletionToken&& token)
+{
+ // Define a function object that contains the code to launch the asynchronous
+ // operation. This is passed the concrete completion handler, followed by any
+ // additional arguments that were passed through the call to async_initiate.
+ auto init = [](
+ asio::completion_handler_for<void(std::string)> auto handler,
+ const std::string& prompt)
+ {
+ // The body of the initiation function object creates the long-lived state
+ // and passes it to the C-based API, along with the function pointer.
+ using state_type = read_input_state<decltype(handler)>;
+ read_input(prompt.c_str(), &state_type::callback,
+ state_type::create(std::move(handler)));
+ };
+
+ // The async_initiate function is used to transform the supplied completion
+ // token to the completion handler. When calling this function we explicitly
+ // specify the completion signature of the operation. We must also return the
+ // result of the call since the completion token may produce a return value,
+ // such as a future.
+ return asio::async_initiate<CompletionToken, void(std::string)>(
+ init, // First, pass the function object that launches the operation,
+ token, // then the completion token that will be transformed to a handler,
+ prompt); // and, finally, any additional arguments to the function object.
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ // Test our asynchronous operation using a lambda as a callback. We will use
+ // an io_context to obtain an associated executor.
+ async_read_input("Enter your name",
+ asio::bind_executor(io_context,
+ [](const std::string& result)
+ {
+ std::cout << "Hello " << result << "\n";
+ }));
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_read_input("Enter your name", asio::deferred);
+
+ // Launch our asynchronous operation using a lambda as a callback. We will use
+ // an io_context to obtain an associated executor.
+ std::move(op)(
+ asio::bind_executor(io_context,
+ [](const std::string& result)
+ {
+ std::cout << "Hello " << result << "\n";
+ }));
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<std::string> f =
+ async_read_input("Enter your name", asio::use_future);
+
+ std::string result = f.get();
+ std::cout << "Hello " << result << "\n";
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/callback_wrapper.cpp b/3rdparty/asio/src/examples/cpp20/operations/callback_wrapper.cpp
new file mode 100644
index 00000000000..f8f37b48944
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/callback_wrapper.cpp
@@ -0,0 +1,154 @@
+//
+// callback_wrapper.cpp
+// ~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio.hpp>
+#include <iostream>
+
+//------------------------------------------------------------------------------
+
+// This is a mock implementation of an API that uses a move-only function object
+// for exposing a callback. The callback has the signature void(std::string).
+
+template <typename Callback>
+void read_input(const std::string& prompt, Callback cb)
+{
+ std::thread(
+ [prompt, cb = std::move(cb)]() mutable
+ {
+ std::cout << prompt << ": ";
+ std::cout.flush();
+ std::string line;
+ std::getline(std::cin, line);
+ std::move(cb)(std::move(line));
+ }).detach();
+}
+
+//------------------------------------------------------------------------------
+
+// This is an asynchronous operation that wraps the callback-based API.
+
+// The initiating function for the asynchronous operation.
+template <asio::completion_token_for<void(std::string)> CompletionToken>
+auto async_read_input(const std::string& prompt, CompletionToken&& token)
+{
+ // Define a function object that contains the code to launch the asynchronous
+ // operation. This is passed the concrete completion handler, followed by any
+ // additional arguments that were passed through the call to async_initiate.
+ auto init = [](
+ asio::completion_handler_for<void(std::string)> auto handler,
+ const std::string& prompt)
+ {
+ // According to the rules for asynchronous operations, we need to track
+ // outstanding work against the handler's associated executor until the
+ // asynchronous operation is complete.
+ auto work = asio::make_work_guard(handler);
+
+ // Launch the operation with a callback that will receive the result and
+ // pass it through to the asynchronous operation's completion handler.
+ read_input(prompt,
+ [
+ handler = std::move(handler),
+ work = std::move(work)
+ ](std::string result) mutable
+ {
+ // Get the handler's associated allocator. If the handler does not
+ // specify an allocator, use the recycling allocator as the default.
+ auto alloc = asio::get_associated_allocator(
+ handler, asio::recycling_allocator<void>());
+
+ // Dispatch the completion handler through the handler's associated
+ // executor, using the handler's associated allocator.
+ asio::dispatch(work.get_executor(),
+ asio::bind_allocator(alloc,
+ [
+ handler = std::move(handler),
+ result = std::string(result)
+ ]() mutable
+ {
+ std::move(handler)(result);
+ }));
+ });
+ };
+
+ // The async_initiate function is used to transform the supplied completion
+ // token to the completion handler. When calling this function we explicitly
+ // specify the completion signature of the operation. We must also return the
+ // result of the call since the completion token may produce a return value,
+ // such as a future.
+ return asio::async_initiate<CompletionToken, void(std::string)>(
+ init, // First, pass the function object that launches the operation,
+ token, // then the completion token that will be transformed to a handler,
+ prompt); // and, finally, any additional arguments to the function object.
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ // Test our asynchronous operation using a lambda as a callback. We will use
+ // an io_context to specify an associated executor.
+ async_read_input("Enter your name",
+ asio::bind_executor(io_context,
+ [](const std::string& result)
+ {
+ std::cout << "Hello " << result << "\n";
+ }));
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ auto op = async_read_input("Enter your name", asio::deferred);
+
+ // Launch our asynchronous operation using a lambda as a callback. We will use
+ // an io_context to obtain an associated executor.
+ std::move(op)(
+ asio::bind_executor(io_context,
+ [](const std::string& result)
+ {
+ std::cout << "Hello " << result << "\n";
+ }));
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<std::string> f =
+ async_read_input("Enter your name", asio::use_future);
+
+ std::string result = f.get();
+ std::cout << "Hello " << result << "\n";
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/composed_1.cpp b/3rdparty/asio/src/examples/cpp20/operations/composed_1.cpp
new file mode 100644
index 00000000000..e7f795e1756
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/composed_1.cpp
@@ -0,0 +1,157 @@
+//
+// composed_1.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/deferred.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/use_future.hpp>
+#include <asio/write.hpp>
+#include <cstring>
+#include <iostream>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using asio::ip::tcp;
+
+//------------------------------------------------------------------------------
+
+// This is the simplest example of a composed asynchronous operation, where we
+// simply repackage an existing operation. The asynchronous operation
+// requirements are met by delegating responsibility to the underlying
+// operation.
+
+template <
+ asio::completion_token_for<void(std::error_code, std::size_t)>
+ CompletionToken>
+auto async_write_message(tcp::socket& socket,
+ const char* message, CompletionToken&& token)
+ // The return type of the initiating function is deduced from the combination
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is void.
+ // However, when the completion token is asio::yield_context (used for
+ // stackful coroutines) the return type would be std::size_t, and when the
+ // completion token is asio::use_future it would be std::future<std::size_t>.
+ // When the completion token is asio::deferred, the return type differs for
+ // each asynchronous operation.
+ //
+ // In C++20 we can omit the return type as it is automatically deduced from
+ // the return type of our underlying asynchronous operation.
+{
+ // When delegating to the underlying operation we must take care to perfectly
+ // forward the completion token. This ensures that our operation works
+ // correctly with move-only function objects as callbacks, as well as other
+ // completion token types.
+ return asio::async_write(socket,
+ asio::buffer(message, std::strlen(message)),
+ std::forward<CompletionToken>(token));
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using a lambda as a callback.
+ async_write_message(socket, "Testing callback\r\n",
+ [](const std::error_code& error, std::size_t n)
+ {
+ if (!error)
+ {
+ std::cout << n << " bytes transferred\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ asio::async_operation auto op = async_write_message(
+ socket, "Testing deferred\r\n", asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error, std::size_t n)
+ {
+ if (!error)
+ {
+ std::cout << n << " bytes transferred\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<std::size_t> f = async_write_message(
+ socket, "Testing future\r\n", asio::use_future);
+
+ io_context.run();
+
+ try
+ {
+ // Get the result of the operation.
+ std::size_t n = f.get();
+ std::cout << n << " bytes transferred\n";
+ }
+ catch (const std::exception& e)
+ {
+ std::cout << "Error: " << e.what() << "\n";
+ }
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/composed_2.cpp b/3rdparty/asio/src/examples/cpp20/operations/composed_2.cpp
new file mode 100644
index 00000000000..ada029d38f0
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/composed_2.cpp
@@ -0,0 +1,225 @@
+//
+// composed_2.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/deferred.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/use_future.hpp>
+#include <asio/write.hpp>
+#include <cstring>
+#include <iostream>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using asio::ip::tcp;
+
+// NOTE: This example requires the new asio::async_initiate function. For
+// an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
+//------------------------------------------------------------------------------
+
+// This next simplest example of a composed asynchronous operation involves
+// repackaging multiple operations but choosing to invoke just one of them. All
+// of these underlying operations have the same completion signature. The
+// asynchronous operation requirements are met by delegating responsibility to
+// the underlying operations.
+
+template <
+ asio::completion_token_for<void(std::error_code, std::size_t)>
+ CompletionToken>
+auto async_write_message(tcp::socket& socket,
+ const char* message, bool allow_partial_write,
+ CompletionToken&& token)
+ // The return type of the initiating function is deduced from the combination
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is void.
+ // However, when the completion token is asio::yield_context (used for
+ // stackful coroutines) the return type would be std::size_t, and when the
+ // completion token is asio::use_future it would be std::future<std::size_t>.
+ // When the completion token is asio::deferred, the return type differs for
+ // each asynchronous operation.
+ //
+ // In C++20 we can omit the return type as it is automatically deduced from
+ // the return type of asio::async_initiate.
+{
+ // In addition to determining the mechanism by which an asynchronous
+ // operation delivers its result, a completion token also determines the time
+ // when the operation commences. For example, when the completion token is a
+ // simple callback the operation commences before the initiating function
+ // returns. However, if the completion token's delivery mechanism uses a
+ // future, we might instead want to defer initiation of the operation until
+ // the returned future object is waited upon.
+ //
+ // To enable this, when implementing an asynchronous operation we must
+ // package the initiation step as a function object. The initiation function
+ // object's call operator is passed the concrete completion handler produced
+ // by the completion token. This completion handler matches the asynchronous
+ // operation's completion handler signature, which in this example is:
+ //
+ // void(std::error_code error, std::size_t)
+ //
+ // The initiation function object also receives any additional arguments
+ // required to start the operation. (Note: We could have instead passed these
+ // arguments in the lambda capture set. However, we should prefer to
+ // propagate them as function call arguments as this allows the completion
+ // token to optimise how they are passed. For example, a lazy future which
+ // defers initiation would need to make a decay-copy of the arguments, but
+ // when using a simple callback the arguments can be trivially forwarded
+ // straight through.)
+ auto initiation = [](
+ asio::completion_handler_for<void(std::error_code, std::size_t)>
+ auto&& completion_handler,
+ tcp::socket& socket,
+ const char* message,
+ bool allow_partial_write)
+ {
+ if (allow_partial_write)
+ {
+ // When delegating to an underlying operation we must take care to
+ // perfectly forward the completion handler. This ensures that our
+ // operation works correctly with move-only function objects as
+ // callbacks.
+ return socket.async_write_some(
+ asio::buffer(message, std::strlen(message)),
+ std::forward<decltype(completion_handler)>(completion_handler));
+ }
+ else
+ {
+ // As above, we must perfectly forward the completion handler when calling
+ // the alternate underlying operation.
+ return asio::async_write(socket,
+ asio::buffer(message, std::strlen(message)),
+ std::forward<decltype(completion_handler)>(completion_handler));
+ }
+ };
+
+ // The asio::async_initiate function takes:
+ //
+ // - our initiation function object,
+ // - the completion token,
+ // - the completion handler signature, and
+ // - any additional arguments we need to initiate the operation.
+ //
+ // It then asks the completion token to create a completion handler (i.e. a
+ // callback) with the specified signature, and invoke the initiation function
+ // object with this completion handler as well as the additional arguments.
+ // The return value of async_initiate is the result of our operation's
+ // initiating function.
+ //
+ // Note that we wrap non-const reference arguments in std::reference_wrapper
+ // to prevent incorrect decay-copies of these objects.
+ return asio::async_initiate<
+ CompletionToken, void(std::error_code, std::size_t)>(
+ initiation, token, std::ref(socket), message, allow_partial_write);
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using a lambda as a callback.
+ async_write_message(socket, "Testing callback\r\n", false,
+ [](const std::error_code& error, std::size_t n)
+ {
+ if (!error)
+ {
+ std::cout << n << " bytes transferred\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ asio::async_operation auto op = async_write_message(
+ socket, "Testing deferred\r\n", false, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error, std::size_t n)
+ {
+ if (!error)
+ {
+ std::cout << n << " bytes transferred\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<std::size_t> f = async_write_message(
+ socket, "Testing future\r\n", false, asio::use_future);
+
+ io_context.run();
+
+ try
+ {
+ // Get the result of the operation.
+ std::size_t n = f.get();
+ std::cout << n << " bytes transferred\n";
+ }
+ catch (const std::exception& e)
+ {
+ std::cout << "Error: " << e.what() << "\n";
+ }
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/composed_3.cpp b/3rdparty/asio/src/examples/cpp20/operations/composed_3.cpp
new file mode 100644
index 00000000000..46436a68e28
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/composed_3.cpp
@@ -0,0 +1,232 @@
+//
+// composed_3.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/bind_executor.hpp>
+#include <asio/deferred.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/use_future.hpp>
+#include <asio/write.hpp>
+#include <cstring>
+#include <functional>
+#include <iostream>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using asio::ip::tcp;
+
+// NOTE: This example requires the new asio::async_initiate function. For
+// an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
+//------------------------------------------------------------------------------
+
+// In this composed operation we repackage an existing operation, but with a
+// different completion handler signature. The asynchronous operation
+// requirements are met by delegating responsibility to the underlying
+// operation.
+
+template <
+ asio::completion_token_for<void(std::error_code)> CompletionToken>
+auto async_write_message(tcp::socket& socket,
+ const char* message, CompletionToken&& token)
+ // The return type of the initiating function is deduced from the combination
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
+ // there is no non-error argument to the completion handler. When the
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++20 we can omit the return type as it is automatically deduced from
+ // the return type of asio::async_initiate.
+{
+ // In addition to determining the mechanism by which an asynchronous
+ // operation delivers its result, a completion token also determines the time
+ // when the operation commences. For example, when the completion token is a
+ // simple callback the operation commences before the initiating function
+ // returns. However, if the completion token's delivery mechanism uses a
+ // future, we might instead want to defer initiation of the operation until
+ // the returned future object is waited upon.
+ //
+ // To enable this, when implementing an asynchronous operation we must
+ // package the initiation step as a function object. The initiation function
+ // object's call operator is passed the concrete completion handler produced
+ // by the completion token. This completion handler matches the asynchronous
+ // operation's completion handler signature, which in this example is:
+ //
+ // void(std::error_code error)
+ //
+ // The initiation function object also receives any additional arguments
+ // required to start the operation. (Note: We could have instead passed these
+ // arguments in the lambda capture set. However, we should prefer to
+ // propagate them as function call arguments as this allows the completion
+ // token to optimise how they are passed. For example, a lazy future which
+ // defers initiation would need to make a decay-copy of the arguments, but
+ // when using a simple callback the arguments can be trivially forwarded
+ // straight through.)
+ auto initiation = [](
+ asio::completion_handler_for<void(std::error_code)>
+ auto&& completion_handler,
+ tcp::socket& socket,
+ const char* message)
+ {
+ // The async_write operation has a completion handler signature of:
+ //
+ // void(std::error_code error, std::size n)
+ //
+ // This differs from our operation's signature in that it is also passed
+ // the number of bytes transferred as an argument of type std::size_t. We
+ // will adapt our completion handler to async_write's completion handler
+ // signature by using std::bind, which drops the additional argument.
+ //
+ // However, it is essential to the correctness of our composed operation
+ // that we preserve the executor of the user-supplied completion handler.
+ // The std::bind function will not do this for us, so we must do this by
+ // first obtaining the completion handler's associated executor (defaulting
+ // to the I/O executor - in this case the executor of the socket - if the
+ // completion handler does not have its own) ...
+ auto executor = asio::get_associated_executor(
+ completion_handler, socket.get_executor());
+
+ // ... and then binding this executor to our adapted completion handler
+ // using the asio::bind_executor function.
+ asio::async_write(socket,
+ asio::buffer(message, std::strlen(message)),
+ asio::bind_executor(executor,
+ std::bind(std::forward<decltype(completion_handler)>(
+ completion_handler), std::placeholders::_1)));
+ };
+
+ // The asio::async_initiate function takes:
+ //
+ // - our initiation function object,
+ // - the completion token,
+ // - the completion handler signature, and
+ // - any additional arguments we need to initiate the operation.
+ //
+ // It then asks the completion token to create a completion handler (i.e. a
+ // callback) with the specified signature, and invoke the initiation function
+ // object with this completion handler as well as the additional arguments.
+ // The return value of async_initiate is the result of our operation's
+ // initiating function.
+ //
+ // Note that we wrap non-const reference arguments in std::reference_wrapper
+ // to prevent incorrect decay-copies of these objects.
+ return asio::async_initiate<
+ CompletionToken, void(std::error_code)>(
+ initiation, token, std::ref(socket), message);
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using a lambda as a callback.
+ async_write_message(socket, "Testing callback\r\n",
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ asio::async_operation auto op = async_write_message(
+ socket, "Testing deferred\r\n", asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<void> f = async_write_message(
+ socket, "Testing future\r\n", asio::use_future);
+
+ io_context.run();
+
+ // Get the result of the operation.
+ try
+ {
+ // Get the result of the operation.
+ f.get();
+ std::cout << "Message sent\n";
+ }
+ catch (const std::exception& e)
+ {
+ std::cout << "Error: " << e.what() << "\n";
+ }
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/composed_4.cpp b/3rdparty/asio/src/examples/cpp20/operations/composed_4.cpp
new file mode 100644
index 00000000000..069f57ce1ac
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/composed_4.cpp
@@ -0,0 +1,247 @@
+//
+// composed_4.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/bind_executor.hpp>
+#include <asio/deferred.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/use_future.hpp>
+#include <asio/write.hpp>
+#include <cstring>
+#include <functional>
+#include <iostream>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using asio::ip::tcp;
+
+// NOTE: This example requires the new asio::async_initiate function. For
+// an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
+//------------------------------------------------------------------------------
+
+// In this composed operation we repackage an existing operation, but with a
+// different completion handler signature. We will also intercept an empty
+// message as an invalid argument, and propagate the corresponding error to the
+// user. The asynchronous operation requirements are met by delegating
+// responsibility to the underlying operation.
+
+template <
+ asio::completion_token_for<void(std::error_code)> CompletionToken>
+auto async_write_message(tcp::socket& socket,
+ const char* message, CompletionToken&& token)
+ // The return type of the initiating function is deduced from the combination
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
+ // there is no non-error argument to the completion handler. When the
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++20 we can omit the return type as it is automatically deduced from
+ // the return type of asio::async_initiate.
+{
+ // In addition to determining the mechanism by which an asynchronous
+ // operation delivers its result, a completion token also determines the time
+ // when the operation commences. For example, when the completion token is a
+ // simple callback the operation commences before the initiating function
+ // returns. However, if the completion token's delivery mechanism uses a
+ // future, we might instead want to defer initiation of the operation until
+ // the returned future object is waited upon.
+ //
+ // To enable this, when implementing an asynchronous operation we must
+ // package the initiation step as a function object. The initiation function
+ // object's call operator is passed the concrete completion handler produced
+ // by the completion token. This completion handler matches the asynchronous
+ // operation's completion handler signature, which in this example is:
+ //
+ // void(std::error_code error)
+ //
+ // The initiation function object also receives any additional arguments
+ // required to start the operation. (Note: We could have instead passed these
+ // arguments in the lambda capture set. However, we should prefer to
+ // propagate them as function call arguments as this allows the completion
+ // token to optimise how they are passed. For example, a lazy future which
+ // defers initiation would need to make a decay-copy of the arguments, but
+ // when using a simple callback the arguments can be trivially forwarded
+ // straight through.)
+ auto initiation = [](
+ asio::completion_handler_for<void(std::error_code)>
+ auto&& completion_handler,
+ tcp::socket& socket,
+ const char* message)
+ {
+ // The post operation has a completion handler signature of:
+ //
+ // void()
+ //
+ // and the async_write operation has a completion handler signature of:
+ //
+ // void(std::error_code error, std::size n)
+ //
+ // Both of these operations' completion handler signatures differ from our
+ // operation's completion handler signature. We will adapt our completion
+ // handler to these signatures by using std::bind, which drops the
+ // additional arguments.
+ //
+ // However, it is essential to the correctness of our composed operation
+ // that we preserve the executor of the user-supplied completion handler.
+ // The std::bind function will not do this for us, so we must do this by
+ // first obtaining the completion handler's associated executor (defaulting
+ // to the I/O executor - in this case the executor of the socket - if the
+ // completion handler does not have its own) ...
+ auto executor = asio::get_associated_executor(
+ completion_handler, socket.get_executor());
+
+ // ... and then binding this executor to our adapted completion handler
+ // using the asio::bind_executor function.
+ std::size_t length = std::strlen(message);
+ if (length == 0)
+ {
+ asio::post(
+ asio::bind_executor(executor,
+ std::bind(std::forward<decltype(completion_handler)>(
+ completion_handler), asio::error::invalid_argument)));
+ }
+ else
+ {
+ asio::async_write(socket,
+ asio::buffer(message, length),
+ asio::bind_executor(executor,
+ std::bind(std::forward<decltype(completion_handler)>(
+ completion_handler), std::placeholders::_1)));
+ }
+ };
+
+ // The asio::async_initiate function takes:
+ //
+ // - our initiation function object,
+ // - the completion token,
+ // - the completion handler signature, and
+ // - any additional arguments we need to initiate the operation.
+ //
+ // It then asks the completion token to create a completion handler (i.e. a
+ // callback) with the specified signature, and invoke the initiation function
+ // object with this completion handler as well as the additional arguments.
+ // The return value of async_initiate is the result of our operation's
+ // initiating function.
+ //
+ // Note that we wrap non-const reference arguments in std::reference_wrapper
+ // to prevent incorrect decay-copies of these objects.
+ return asio::async_initiate<
+ CompletionToken, void(std::error_code)>(
+ initiation, token, std::ref(socket), message);
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using a lambda as a callback.
+ async_write_message(socket, "",
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ asio::async_operation auto op =
+ async_write_message(socket, "", asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<void> f = async_write_message(
+ socket, "", asio::use_future);
+
+ io_context.run();
+
+ try
+ {
+ // Get the result of the operation.
+ f.get();
+ std::cout << "Message sent\n";
+ }
+ catch (const std::exception& e)
+ {
+ std::cout << "Exception: " << e.what() << "\n";
+ }
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/composed_5.cpp b/3rdparty/asio/src/examples/cpp20/operations/composed_5.cpp
new file mode 100644
index 00000000000..bec83ec3a59
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/composed_5.cpp
@@ -0,0 +1,284 @@
+//
+// composed_5.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/deferred.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/use_future.hpp>
+#include <asio/write.hpp>
+#include <functional>
+#include <iostream>
+#include <memory>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using asio::ip::tcp;
+
+// NOTE: This example requires the new asio::async_initiate function. For
+// an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
+//------------------------------------------------------------------------------
+
+// This composed operation automatically serialises a message, using its I/O
+// streams insertion operator, before sending it on the socket. To do this, it
+// must allocate a buffer for the encoded message and ensure this buffer's
+// validity until the underlying async_write operation completes.
+
+template <typename T,
+ asio::completion_token_for<void(std::error_code)> CompletionToken>
+auto async_write_message(tcp::socket& socket,
+ const T& message, CompletionToken&& token)
+ // The return type of the initiating function is deduced from the combination
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
+ // there is no non-error argument to the completion handler. When the
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++20 we can omit the return type as it is automatically deduced from
+ // the return type of asio::async_initiate.
+{
+ // In addition to determining the mechanism by which an asynchronous
+ // operation delivers its result, a completion token also determines the time
+ // when the operation commences. For example, when the completion token is a
+ // simple callback the operation commences before the initiating function
+ // returns. However, if the completion token's delivery mechanism uses a
+ // future, we might instead want to defer initiation of the operation until
+ // the returned future object is waited upon.
+ //
+ // To enable this, when implementing an asynchronous operation we must
+ // package the initiation step as a function object. The initiation function
+ // object's call operator is passed the concrete completion handler produced
+ // by the completion token. This completion handler matches the asynchronous
+ // operation's completion handler signature, which in this example is:
+ //
+ // void(std::error_code error)
+ //
+ // The initiation function object also receives any additional arguments
+ // required to start the operation. (Note: We could have instead passed these
+ // arguments in the lambda capture set. However, we should prefer to
+ // propagate them as function call arguments as this allows the completion
+ // token to optimise how they are passed. For example, a lazy future which
+ // defers initiation would need to make a decay-copy of the arguments, but
+ // when using a simple callback the arguments can be trivially forwarded
+ // straight through.)
+ auto initiation = [](
+ asio::completion_handler_for<void(std::error_code)>
+ auto&& completion_handler,
+ tcp::socket& socket,
+ std::unique_ptr<std::string> encoded_message)
+ {
+ // In this example, the composed operation's intermediate completion
+ // handler is implemented as a hand-crafted function object, rather than
+ // using a lambda or std::bind.
+ struct intermediate_completion_handler
+ {
+ // The intermediate completion handler holds a reference to the socket so
+ // that it can obtain the I/O executor (see get_executor below).
+ tcp::socket& socket_;
+
+ // The allocated buffer for the encoded message. The std::unique_ptr
+ // smart pointer is move-only, and as a consequence our intermediate
+ // completion handler is also move-only.
+ std::unique_ptr<std::string> encoded_message_;
+
+ // The user-supplied completion handler.
+ typename std::decay<decltype(completion_handler)>::type handler_;
+
+ // The function call operator matches the completion signature of the
+ // async_write operation.
+ void operator()(const std::error_code& error, std::size_t /*n*/)
+ {
+ // Deallocate the encoded message before calling the user-supplied
+ // completion handler.
+ encoded_message_.reset();
+
+ // Call the user-supplied handler with the result of the operation.
+ // The arguments must match the completion signature of our composed
+ // operation.
+ handler_(error);
+ }
+
+ // It is essential to the correctness of our composed operation that we
+ // preserve the executor of the user-supplied completion handler. With a
+ // hand-crafted function object we can do this by defining a nested type
+ // executor_type and member function get_executor. These obtain the
+ // completion handler's associated executor, and default to the I/O
+ // executor - in this case the executor of the socket - if the completion
+ // handler does not have its own.
+ using executor_type = asio::associated_executor_t<
+ typename std::decay<decltype(completion_handler)>::type,
+ tcp::socket::executor_type>;
+
+ executor_type get_executor() const noexcept
+ {
+ return asio::get_associated_executor(
+ handler_, socket_.get_executor());
+ }
+
+ // Although not necessary for correctness, we may also preserve the
+ // allocator of the user-supplied completion handler. This is achieved by
+ // defining a nested type allocator_type and member function
+ // get_allocator. These obtain the completion handler's associated
+ // allocator, and default to std::allocator<void> if the completion
+ // handler does not have its own.
+ using allocator_type = asio::associated_allocator_t<
+ typename std::decay<decltype(completion_handler)>::type,
+ std::allocator<void>>;
+
+ allocator_type get_allocator() const noexcept
+ {
+ return asio::get_associated_allocator(
+ handler_, std::allocator<void>{});
+ }
+ };
+
+ // Initiate the underlying async_write operation using our intermediate
+ // completion handler.
+ auto encoded_message_buffer = asio::buffer(*encoded_message);
+ asio::async_write(socket, encoded_message_buffer,
+ intermediate_completion_handler{socket, std::move(encoded_message),
+ std::forward<decltype(completion_handler)>(completion_handler)});
+ };
+
+ // Encode the message and copy it into an allocated buffer. The buffer will
+ // be maintained for the lifetime of the asynchronous operation.
+ std::ostringstream os;
+ os << message;
+ std::unique_ptr<std::string> encoded_message(new std::string(os.str()));
+
+ // The asio::async_initiate function takes:
+ //
+ // - our initiation function object,
+ // - the completion token,
+ // - the completion handler signature, and
+ // - any additional arguments we need to initiate the operation.
+ //
+ // It then asks the completion token to create a completion handler (i.e. a
+ // callback) with the specified signature, and invoke the initiation function
+ // object with this completion handler as well as the additional arguments.
+ // The return value of async_initiate is the result of our operation's
+ // initiating function.
+ //
+ // Note that we wrap non-const reference arguments in std::reference_wrapper
+ // to prevent incorrect decay-copies of these objects.
+ return asio::async_initiate<
+ CompletionToken, void(std::error_code)>(
+ initiation, token, std::ref(socket),
+ std::move(encoded_message));
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using a lambda as a callback.
+ async_write_message(socket, 123456,
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ asio::async_operation auto op = async_write_message(
+ socket, std::string("abcdef"), asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Message sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<void> f = async_write_message(
+ socket, 654.321, asio::use_future);
+
+ io_context.run();
+
+ try
+ {
+ // Get the result of the operation.
+ f.get();
+ std::cout << "Message sent\n";
+ }
+ catch (const std::exception& e)
+ {
+ std::cout << "Exception: " << e.what() << "\n";
+ }
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/composed_6.cpp b/3rdparty/asio/src/examples/cpp20/operations/composed_6.cpp
new file mode 100644
index 00000000000..77e2f50f93e
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/composed_6.cpp
@@ -0,0 +1,345 @@
+//
+// composed_6.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/deferred.hpp>
+#include <asio/executor_work_guard.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/steady_timer.hpp>
+#include <asio/use_future.hpp>
+#include <asio/write.hpp>
+#include <functional>
+#include <iostream>
+#include <memory>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using asio::ip::tcp;
+
+// NOTE: This example requires the new asio::async_initiate function. For
+// an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
+//------------------------------------------------------------------------------
+
+// This composed operation shows composition of multiple underlying operations.
+// It automatically serialises a message, using its I/O streams insertion
+// operator, before sending it N times on the socket. To do this, it must
+// allocate a buffer for the encoded message and ensure this buffer's validity
+// until all underlying async_write operation complete. A one second delay is
+// inserted prior to each write operation, using a steady_timer.
+
+template <typename T,
+ asio::completion_token_for<void(std::error_code)> CompletionToken>
+auto async_write_messages(tcp::socket& socket,
+ const T& message, std::size_t repeat_count,
+ CompletionToken&& token)
+ // The return type of the initiating function is deduced from the combination
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
+ // there is no non-error argument to the completion handler. When the
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++20 we can omit the return type as it is automatically deduced from
+ // the return type of asio::async_initiate.
+{
+ // In addition to determining the mechanism by which an asynchronous
+ // operation delivers its result, a completion token also determines the time
+ // when the operation commences. For example, when the completion token is a
+ // simple callback the operation commences before the initiating function
+ // returns. However, if the completion token's delivery mechanism uses a
+ // future, we might instead want to defer initiation of the operation until
+ // the returned future object is waited upon.
+ //
+ // To enable this, when implementing an asynchronous operation we must
+ // package the initiation step as a function object. The initiation function
+ // object's call operator is passed the concrete completion handler produced
+ // by the completion token. This completion handler matches the asynchronous
+ // operation's completion handler signature, which in this example is:
+ //
+ // void(std::error_code error)
+ //
+ // The initiation function object also receives any additional arguments
+ // required to start the operation. (Note: We could have instead passed these
+ // arguments in the lambda capture set. However, we should prefer to
+ // propagate them as function call arguments as this allows the completion
+ // token to optimise how they are passed. For example, a lazy future which
+ // defers initiation would need to make a decay-copy of the arguments, but
+ // when using a simple callback the arguments can be trivially forwarded
+ // straight through.)
+ auto initiation = [](
+ asio::completion_handler_for<void(std::error_code)>
+ auto&& completion_handler,
+ tcp::socket& socket,
+ std::unique_ptr<std::string> encoded_message,
+ std::size_t repeat_count,
+ std::unique_ptr<asio::steady_timer> delay_timer)
+ {
+ // In this example, the composed operation's intermediate completion
+ // handler is implemented as a hand-crafted function object.
+ struct intermediate_completion_handler
+ {
+ // The intermediate completion handler holds a reference to the socket as
+ // it is used for multiple async_write operations, as well as for
+ // obtaining the I/O executor (see get_executor below).
+ tcp::socket& socket_;
+
+ // The allocated buffer for the encoded message. The std::unique_ptr
+ // smart pointer is move-only, and as a consequence our intermediate
+ // completion handler is also move-only.
+ std::unique_ptr<std::string> encoded_message_;
+
+ // The repeat count remaining.
+ std::size_t repeat_count_;
+
+ // A steady timer used for introducing a delay.
+ std::unique_ptr<asio::steady_timer> delay_timer_;
+
+ // To manage the cycle between the multiple underlying asychronous
+ // operations, our intermediate completion handler is implemented as a
+ // state machine.
+ enum { starting, waiting, writing } state_;
+
+ // As our composed operation performs multiple underlying I/O operations,
+ // we should maintain a work object against the I/O executor. This tells
+ // the I/O executor that there is still more work to come in the future.
+ asio::executor_work_guard<tcp::socket::executor_type> io_work_;
+
+ // The user-supplied completion handler, called once only on completion
+ // of the entire composed operation.
+ typename std::decay<decltype(completion_handler)>::type handler_;
+
+ // By having a default value for the second argument, this function call
+ // operator matches the completion signature of both the async_write and
+ // steady_timer::async_wait operations.
+ void operator()(const std::error_code& error, std::size_t = 0)
+ {
+ if (!error)
+ {
+ switch (state_)
+ {
+ case starting:
+ case writing:
+ if (repeat_count_ > 0)
+ {
+ --repeat_count_;
+ state_ = waiting;
+ delay_timer_->expires_after(std::chrono::seconds(1));
+ delay_timer_->async_wait(std::move(*this));
+ return; // Composed operation not yet complete.
+ }
+ break; // Composed operation complete, continue below.
+ case waiting:
+ state_ = writing;
+ asio::async_write(socket_,
+ asio::buffer(*encoded_message_), std::move(*this));
+ return; // Composed operation not yet complete.
+ }
+ }
+
+ // This point is reached only on completion of the entire composed
+ // operation.
+
+ // We no longer have any future work coming for the I/O executor.
+ io_work_.reset();
+
+ // Deallocate the encoded message before calling the user-supplied
+ // completion handler.
+ encoded_message_.reset();
+
+ // Call the user-supplied handler with the result of the operation.
+ handler_(error);
+ }
+
+ // It is essential to the correctness of our composed operation that we
+ // preserve the executor of the user-supplied completion handler. With a
+ // hand-crafted function object we can do this by defining a nested type
+ // executor_type and member function get_executor. These obtain the
+ // completion handler's associated executor, and default to the I/O
+ // executor - in this case the executor of the socket - if the completion
+ // handler does not have its own.
+ using executor_type = asio::associated_executor_t<
+ typename std::decay<decltype(completion_handler)>::type,
+ tcp::socket::executor_type>;
+
+ executor_type get_executor() const noexcept
+ {
+ return asio::get_associated_executor(
+ handler_, socket_.get_executor());
+ }
+
+ // Although not necessary for correctness, we may also preserve the
+ // allocator of the user-supplied completion handler. This is achieved by
+ // defining a nested type allocator_type and member function
+ // get_allocator. These obtain the completion handler's associated
+ // allocator, and default to std::allocator<void> if the completion
+ // handler does not have its own.
+ using allocator_type = asio::associated_allocator_t<
+ typename std::decay<decltype(completion_handler)>::type,
+ std::allocator<void>>;
+
+ allocator_type get_allocator() const noexcept
+ {
+ return asio::get_associated_allocator(
+ handler_, std::allocator<void>{});
+ }
+ };
+
+ // Initiate the underlying async_write operation using our intermediate
+ // completion handler.
+ auto encoded_message_buffer = asio::buffer(*encoded_message);
+ asio::async_write(socket, encoded_message_buffer,
+ intermediate_completion_handler{
+ socket, std::move(encoded_message),
+ repeat_count, std::move(delay_timer),
+ intermediate_completion_handler::starting,
+ asio::make_work_guard(socket.get_executor()),
+ std::forward<decltype(completion_handler)>(completion_handler)});
+ };
+
+ // Encode the message and copy it into an allocated buffer. The buffer will
+ // be maintained for the lifetime of the composed asynchronous operation.
+ std::ostringstream os;
+ os << message;
+ std::unique_ptr<std::string> encoded_message(new std::string(os.str()));
+
+ // Create a steady_timer to be used for the delay between messages.
+ std::unique_ptr<asio::steady_timer> delay_timer(
+ new asio::steady_timer(socket.get_executor()));
+
+ // The asio::async_initiate function takes:
+ //
+ // - our initiation function object,
+ // - the completion token,
+ // - the completion handler signature, and
+ // - any additional arguments we need to initiate the operation.
+ //
+ // It then asks the completion token to create a completion handler (i.e. a
+ // callback) with the specified signature, and invoke the initiation function
+ // object with this completion handler as well as the additional arguments.
+ // The return value of async_initiate is the result of our operation's
+ // initiating function.
+ //
+ // Note that we wrap non-const reference arguments in std::reference_wrapper
+ // to prevent incorrect decay-copies of these objects.
+ return asio::async_initiate<
+ CompletionToken, void(std::error_code)>(
+ initiation, token, std::ref(socket),
+ std::move(encoded_message), repeat_count,
+ std::move(delay_timer));
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using a lambda as a callback.
+ async_write_messages(socket, "Testing callback\r\n", 5,
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ asio::async_operation auto op = async_write_messages(
+ socket, "Testing deferred\r\n", 5, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<void> f = async_write_messages(
+ socket, "Testing future\r\n", 5, asio::use_future);
+
+ io_context.run();
+
+ try
+ {
+ // Get the result of the operation.
+ f.get();
+ std::cout << "Messages sent\n";
+ }
+ catch (const std::exception& e)
+ {
+ std::cout << "Error: " << e.what() << "\n";
+ }
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/composed_7.cpp b/3rdparty/asio/src/examples/cpp20/operations/composed_7.cpp
new file mode 100644
index 00000000000..9ae44c797fb
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/composed_7.cpp
@@ -0,0 +1,262 @@
+//
+// composed_7.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/compose.hpp>
+#include <asio/deferred.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/steady_timer.hpp>
+#include <asio/use_future.hpp>
+#include <asio/write.hpp>
+#include <functional>
+#include <iostream>
+#include <memory>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using asio::ip::tcp;
+
+// NOTE: This example requires the new asio::async_compose function. For
+// an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
+//------------------------------------------------------------------------------
+
+// This composed operation shows composition of multiple underlying operations.
+// It automatically serialises a message, using its I/O streams insertion
+// operator, before sending it N times on the socket. To do this, it must
+// allocate a buffer for the encoded message and ensure this buffer's validity
+// until all underlying async_write operation complete. A one second delay is
+// inserted prior to each write operation, using a steady_timer.
+
+template <typename T,
+ asio::completion_token_for<void(std::error_code)> CompletionToken>
+auto async_write_messages(tcp::socket& socket,
+ const T& message, std::size_t repeat_count,
+ CompletionToken&& token)
+ // The return type of the initiating function is deduced from the combination
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
+ // there is no non-error argument to the completion handler. When the
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++20 we can omit the return type as it is automatically deduced from
+ // the return type of asio::async_compose.
+{
+ // Encode the message and copy it into an allocated buffer. The buffer will
+ // be maintained for the lifetime of the composed asynchronous operation.
+ std::ostringstream os;
+ os << message;
+ std::unique_ptr<std::string> encoded_message(new std::string(os.str()));
+
+ // Create a steady_timer to be used for the delay between messages.
+ std::unique_ptr<asio::steady_timer> delay_timer(
+ new asio::steady_timer(socket.get_executor()));
+
+ // To manage the cycle between the multiple underlying asychronous
+ // operations, our implementation is a state machine.
+ enum { starting, waiting, writing };
+
+ // The asio::async_compose function takes:
+ //
+ // - our asynchronous operation implementation,
+ // - the completion token,
+ // - the completion handler signature, and
+ // - any I/O objects (or executors) used by the operation
+ //
+ // It then wraps our implementation, which is implemented here as a state
+ // machine in a lambda, in an intermediate completion handler that meets the
+ // requirements of a conforming asynchronous operation. This includes
+ // tracking outstanding work against the I/O executors associated with the
+ // operation (in this example, this is the socket's executor).
+ //
+ // The first argument to our lambda is a reference to the enclosing
+ // intermediate completion handler. This intermediate completion handler is
+ // provided for us by the asio::async_compose function, and takes care
+ // of all the details required to implement a conforming asynchronous
+ // operation. When calling an underlying asynchronous operation, we pass it
+ // this enclosing intermediate completion handler as the completion token.
+ //
+ // All arguments to our lambda after the first must be defaulted to allow the
+ // state machine to be started, as well as to allow the completion handler to
+ // match the completion signature of both the async_write and
+ // steady_timer::async_wait operations.
+ return asio::async_compose<
+ CompletionToken, void(std::error_code)>(
+ [
+ // The implementation holds a reference to the socket as it is used for
+ // multiple async_write operations.
+ &socket,
+
+ // The allocated buffer for the encoded message. The std::unique_ptr
+ // smart pointer is move-only, and as a consequence our lambda
+ // implementation is also move-only.
+ encoded_message = std::move(encoded_message),
+
+ // The repeat count remaining.
+ repeat_count,
+
+ // A steady timer used for introducing a delay.
+ delay_timer = std::move(delay_timer),
+
+ // To manage the cycle between the multiple underlying asychronous
+ // operations, our implementation is a state machine.
+ state = starting
+ ]
+ (
+ auto& self,
+ const std::error_code& error = {},
+ std::size_t = 0
+ ) mutable
+ {
+ if (!error)
+ {
+ switch (state)
+ {
+ case starting:
+ case writing:
+ if (repeat_count > 0)
+ {
+ --repeat_count;
+ state = waiting;
+ delay_timer->expires_after(std::chrono::seconds(1));
+ delay_timer->async_wait(std::move(self));
+ return; // Composed operation not yet complete.
+ }
+ break; // Composed operation complete, continue below.
+ case waiting:
+ state = writing;
+ asio::async_write(socket,
+ asio::buffer(*encoded_message), std::move(self));
+ return; // Composed operation not yet complete.
+ }
+ }
+
+ // This point is reached only on completion of the entire composed
+ // operation.
+
+ // Deallocate the encoded message and delay timer before calling the
+ // user-supplied completion handler.
+ encoded_message.reset();
+ delay_timer.reset();
+
+ // Call the user-supplied handler with the result of the operation.
+ self.complete(error);
+ },
+ token, socket);
+}
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using a lambda as a callback.
+ async_write_messages(socket, "Testing callback\r\n", 5,
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ asio::async_operation auto op = async_write_messages(
+ socket, "Testing deferred\r\n", 5, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<void> f = async_write_messages(
+ socket, "Testing future\r\n", 5, asio::use_future);
+
+ io_context.run();
+
+ try
+ {
+ // Get the result of the operation.
+ f.get();
+ std::cout << "Messages sent\n";
+ }
+ catch (const std::exception& e)
+ {
+ std::cout << "Error: " << e.what() << "\n";
+ }
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/operations/composed_8.cpp b/3rdparty/asio/src/examples/cpp20/operations/composed_8.cpp
new file mode 100644
index 00000000000..2735d74d047
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/operations/composed_8.cpp
@@ -0,0 +1,255 @@
+//
+// composed_8.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 <asio/compose.hpp>
+#include <asio/coroutine.hpp>
+#include <asio/deferred.hpp>
+#include <asio/io_context.hpp>
+#include <asio/ip/tcp.hpp>
+#include <asio/steady_timer.hpp>
+#include <asio/use_future.hpp>
+#include <asio/write.hpp>
+#include <functional>
+#include <iostream>
+#include <memory>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using asio::ip::tcp;
+
+// NOTE: This example requires the new asio::async_compose function. For
+// an example that works with the Networking TS style of completion tokens,
+// please see an older version of asio.
+
+//------------------------------------------------------------------------------
+
+// This composed operation shows composition of multiple underlying operations,
+// using asio's stackless coroutines support to express the flow of control. It
+// automatically serialises a message, using its I/O streams insertion
+// operator, before sending it N times on the socket. To do this, it must
+// allocate a buffer for the encoded message and ensure this buffer's validity
+// until all underlying async_write operation complete. A one second delay is
+// inserted prior to each write operation, using a steady_timer.
+
+#include <asio/yield.hpp>
+
+template <typename T,
+ asio::completion_token_for<void(std::error_code)> CompletionToken>
+auto async_write_messages(tcp::socket& socket,
+ const T& message, std::size_t repeat_count,
+ CompletionToken&& token)
+ // The return type of the initiating function is deduced from the combination
+ // of:
+ //
+ // - the CompletionToken type,
+ // - the completion handler signature, and
+ // - the asynchronous operation's initiation function object.
+ //
+ // When the completion token is a simple callback, the return type is always
+ // void. In this example, when the completion token is asio::yield_context
+ // (used for stackful coroutines) the return type would also be void, as
+ // there is no non-error argument to the completion handler. When the
+ // completion token is asio::use_future it would be std::future<void>. When
+ // the completion token is asio::deferred, the return type differs for each
+ // asynchronous operation.
+ //
+ // In C++20 we can omit the return type as it is automatically deduced from
+ // the return type of asio::async_compose.
+{
+ // Encode the message and copy it into an allocated buffer. The buffer will
+ // be maintained for the lifetime of the composed asynchronous operation.
+ std::ostringstream os;
+ os << message;
+ std::unique_ptr<std::string> encoded_message(new std::string(os.str()));
+
+ // Create a steady_timer to be used for the delay between messages.
+ std::unique_ptr<asio::steady_timer> delay_timer(
+ new asio::steady_timer(socket.get_executor()));
+
+ // The asio::async_compose function takes:
+ //
+ // - our asynchronous operation implementation,
+ // - the completion token,
+ // - the completion handler signature, and
+ // - any I/O objects (or executors) used by the operation
+ //
+ // It then wraps our implementation, which is implemented here as a stackless
+ // coroutine in a lambda, in an intermediate completion handler that meets the
+ // requirements of a conforming asynchronous operation. This includes
+ // tracking outstanding work against the I/O executors associated with the
+ // operation (in this example, this is the socket's executor).
+ //
+ // The first argument to our lambda is a reference to the enclosing
+ // intermediate completion handler. This intermediate completion handler is
+ // provided for us by the asio::async_compose function, and takes care
+ // of all the details required to implement a conforming asynchronous
+ // operation. When calling an underlying asynchronous operation, we pass it
+ // this enclosing intermediate completion handler as the completion token.
+ //
+ // All arguments to our lambda after the first must be defaulted to allow the
+ // state machine to be started, as well as to allow the completion handler to
+ // match the completion signature of both the async_write and
+ // steady_timer::async_wait operations.
+ return asio::async_compose<
+ CompletionToken, void(std::error_code)>(
+ [
+ // The implementation holds a reference to the socket as it is used for
+ // multiple async_write operations.
+ &socket,
+
+ // The allocated buffer for the encoded message. The std::unique_ptr
+ // smart pointer is move-only, and as a consequence our lambda
+ // implementation is also move-only.
+ encoded_message = std::move(encoded_message),
+
+ // The repeat count remaining.
+ repeat_count,
+
+ // A steady timer used for introducing a delay.
+ delay_timer = std::move(delay_timer),
+
+ // The coroutine state.
+ coro = asio::coroutine()
+ ]
+ (
+ auto& self,
+ const std::error_code& error = {},
+ std::size_t = 0
+ ) mutable
+ {
+ reenter (coro)
+ {
+ while (repeat_count > 0)
+ {
+ --repeat_count;
+
+ delay_timer->expires_after(std::chrono::seconds(1));
+ yield delay_timer->async_wait(std::move(self));
+ if (error)
+ break;
+
+ yield asio::async_write(socket,
+ asio::buffer(*encoded_message), std::move(self));
+ if (error)
+ break;
+ }
+
+ // Deallocate the encoded message and delay timer before calling the
+ // user-supplied completion handler.
+ encoded_message.reset();
+ delay_timer.reset();
+
+ // Call the user-supplied handler with the result of the operation.
+ self.complete(error);
+ }
+ },
+ token, socket);
+}
+
+#include <asio/unyield.hpp>
+
+//------------------------------------------------------------------------------
+
+void test_callback()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using a lambda as a callback.
+ async_write_messages(socket, "Testing callback\r\n", 5,
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_deferred()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the deferred completion token. This
+ // token causes the operation's initiating function to package up the
+ // operation with its arguments to return a function object, which may then be
+ // used to launch the asynchronous operation.
+ asio::async_operation auto op = async_write_messages(
+ socket, "Testing deferred\r\n", 5, asio::deferred);
+
+ // Launch the operation using a lambda as a callback.
+ std::move(op)(
+ [](const std::error_code& error)
+ {
+ if (!error)
+ {
+ std::cout << "Messages sent\n";
+ }
+ else
+ {
+ std::cout << "Error: " << error.message() << "\n";
+ }
+ });
+
+ io_context.run();
+}
+
+//------------------------------------------------------------------------------
+
+void test_future()
+{
+ asio::io_context io_context;
+
+ tcp::acceptor acceptor(io_context, {tcp::v4(), 55555});
+ tcp::socket socket = acceptor.accept();
+
+ // Test our asynchronous operation using the use_future completion token.
+ // This token causes the operation's initiating function to return a future,
+ // which may be used to synchronously wait for the result of the operation.
+ std::future<void> f = async_write_messages(
+ socket, "Testing future\r\n", 5, asio::use_future);
+
+ io_context.run();
+
+ try
+ {
+ // Get the result of the operation.
+ f.get();
+ std::cout << "Messages sent\n";
+ }
+ catch (const std::exception& e)
+ {
+ std::cout << "Error: " << e.what() << "\n";
+ }
+}
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+ test_callback();
+ test_deferred();
+ test_future();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/type_erasure/line_reader.hpp b/3rdparty/asio/src/examples/cpp20/type_erasure/line_reader.hpp
new file mode 100644
index 00000000000..fa19aec6b13
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/type_erasure/line_reader.hpp
@@ -0,0 +1,39 @@
+//
+// line_reader.hpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 LINE_READER_HPP
+#define LINE_READER_HPP
+
+#include <asio/any_completion_handler.hpp>
+#include <asio/async_result.hpp>
+#include <asio/error.hpp>
+#include <string>
+
+class line_reader
+{
+public:
+ virtual ~line_reader() {}
+
+ template <typename CompletionToken>
+ auto async_read_line(std::string prompt, CompletionToken&& token)
+ {
+ return asio::async_initiate<CompletionToken, void(asio::error_code, std::string)>(
+ [](auto handler, line_reader* self, std::string prompt)
+ {
+ self->async_read_line_impl(std::move(prompt), std::move(handler));
+ }, token, this, prompt);
+ }
+
+private:
+ virtual void async_read_line_impl(std::string prompt,
+ asio::any_completion_handler<void(asio::error_code, std::string)> handler) = 0;
+};
+
+#endif // LINE_READER_HPP
diff --git a/3rdparty/asio/src/examples/cpp20/type_erasure/main.cpp b/3rdparty/asio/src/examples/cpp20/type_erasure/main.cpp
new file mode 100644
index 00000000000..1b80dcd23ee
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/type_erasure/main.cpp
@@ -0,0 +1,35 @@
+//
+// main.cpp
+// ~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 "line_reader.hpp"
+#include "sleep.hpp"
+#include "stdin_line_reader.hpp"
+#include <asio/co_spawn.hpp>
+#include <asio/detached.hpp>
+#include <asio/io_context.hpp>
+#include <asio/use_awaitable.hpp>
+#include <iostream>
+
+asio::awaitable<void> do_read(line_reader& reader)
+{
+ for (int i = 0; i < 10; ++i)
+ {
+ std::cout << co_await reader.async_read_line("Enter something: ", asio::use_awaitable);
+ co_await async_sleep(co_await asio::this_coro::executor, std::chrono::seconds(1), asio::use_awaitable);
+ }
+}
+
+int main()
+{
+ asio::io_context ctx{1};
+ stdin_line_reader reader{ctx.get_executor()};
+ co_spawn(ctx, do_read(reader), asio::detached);
+ ctx.run();
+}
diff --git a/3rdparty/asio/src/examples/cpp20/type_erasure/sleep.cpp b/3rdparty/asio/src/examples/cpp20/type_erasure/sleep.cpp
new file mode 100644
index 00000000000..b605866ebd7
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/type_erasure/sleep.cpp
@@ -0,0 +1,22 @@
+//
+// sleep.cpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 "sleep.hpp"
+#include <asio/consign.hpp>
+#include <asio/steady_timer.hpp>
+#include <memory>
+
+void async_sleep_impl(
+ asio::any_completion_handler<void(std::error_code)> handler,
+ asio::any_io_executor ex, std::chrono::nanoseconds duration)
+{
+ auto timer = std::make_shared<asio::steady_timer>(ex, duration);
+ timer->async_wait(asio::consign(std::move(handler), timer));
+}
diff --git a/3rdparty/asio/src/examples/cpp20/type_erasure/sleep.hpp b/3rdparty/asio/src/examples/cpp20/type_erasure/sleep.hpp
new file mode 100644
index 00000000000..7e057fc5862
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/type_erasure/sleep.hpp
@@ -0,0 +1,32 @@
+//
+// sleep.hpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 SLEEP_HPP
+#define SLEEP_HPP
+
+#include <asio/any_completion_handler.hpp>
+#include <asio/any_io_executor.hpp>
+#include <asio/async_result.hpp>
+#include <asio/error.hpp>
+#include <chrono>
+
+void async_sleep_impl(
+ asio::any_completion_handler<void(std::error_code)> handler,
+ asio::any_io_executor ex, std::chrono::nanoseconds duration);
+
+template <typename CompletionToken>
+inline auto async_sleep(asio::any_io_executor ex,
+ std::chrono::nanoseconds duration, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void(std::error_code)>(
+ async_sleep_impl, token, std::move(ex), duration);
+}
+
+#endif // SLEEP_HPP
diff --git a/3rdparty/asio/src/examples/cpp20/type_erasure/stdin_line_reader.cpp b/3rdparty/asio/src/examples/cpp20/type_erasure/stdin_line_reader.cpp
new file mode 100644
index 00000000000..7467e820e7a
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/type_erasure/stdin_line_reader.cpp
@@ -0,0 +1,44 @@
+//
+// stdin_line_reader.cpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 "stdin_line_reader.hpp"
+#include <asio/deferred.hpp>
+#include <asio/read_until.hpp>
+#include <iostream>
+
+stdin_line_reader::stdin_line_reader(asio::any_io_executor ex)
+ : stdin_(ex, ::dup(STDIN_FILENO))
+{
+}
+
+void stdin_line_reader::async_read_line_impl(std::string prompt,
+ asio::any_completion_handler<void(asio::error_code, std::string)> handler)
+{
+ std::cout << prompt;
+ std::cout.flush();
+
+ asio::async_read_until(stdin_, asio::dynamic_buffer(buffer_), '\n',
+ asio::deferred(
+ [this](asio::error_code ec, std::size_t n)
+ {
+ if (!ec)
+ {
+ std::string result = buffer_.substr(0, n);
+ buffer_.erase(0, n);
+ return asio::deferred.values(ec, std::move(result));
+ }
+ else
+ {
+ return asio::deferred.values(ec, std::string{});
+ }
+ }
+ )
+ )(std::move(handler));
+}
diff --git a/3rdparty/asio/src/examples/cpp20/type_erasure/stdin_line_reader.hpp b/3rdparty/asio/src/examples/cpp20/type_erasure/stdin_line_reader.hpp
new file mode 100644
index 00000000000..fd54f707da0
--- /dev/null
+++ b/3rdparty/asio/src/examples/cpp20/type_erasure/stdin_line_reader.hpp
@@ -0,0 +1,30 @@
+//
+// stdin_line_reader.hpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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 STDIN_LINE_READER_HPP
+#define STDIN_LINE_READER_HPP
+
+#include "line_reader.hpp"
+#include <asio/posix/stream_descriptor.hpp>
+
+class stdin_line_reader : public line_reader
+{
+public:
+ explicit stdin_line_reader(asio::any_io_executor ex);
+
+private:
+ void async_read_line_impl(std::string prompt,
+ asio::any_completion_handler<void(asio::error_code, std::string)> handler) override;
+
+ asio::posix::stream_descriptor stdin_;
+ std::string buffer_;
+};
+
+#endif
diff --git a/3rdparty/asio/src/tests/Makefile.am b/3rdparty/asio/src/tests/Makefile.am
index 71616985fb1..04f8a03a4ec 100644
--- a/3rdparty/asio/src/tests/Makefile.am
+++ b/3rdparty/asio/src/tests/Makefile.am
@@ -12,29 +12,43 @@ endif
SUBDIRS = properties
check_PROGRAMS = \
+ unit/any_completion_executor \
+ unit/any_completion_handler \
+ unit/any_io_executor \
+ unit/append \
+ unit/as_tuple \
unit/associated_allocator \
unit/associated_cancellation_slot \
unit/associated_executor \
+ unit/associated_immediate_executor \
unit/associator \
unit/async_result \
unit/awaitable \
unit/basic_datagram_socket \
unit/basic_deadline_timer \
+ unit/basic_file \
+ unit/basic_random_access_file \
unit/basic_raw_socket \
+ unit/basic_readable_pipe \
unit/basic_seq_packet_socket \
unit/basic_serial_port \
unit/basic_signal_set \
unit/basic_socket \
unit/basic_socket_acceptor \
+ unit/basic_stream_file \
unit/basic_stream_socket \
unit/basic_streambuf \
unit/basic_waitable_timer \
+ unit/basic_writable_pipe \
+ unit/bind_allocator \
unit/bind_cancellation_slot \
unit/bind_executor \
+ unit/bind_immediate_executor \
unit/buffered_read_stream \
unit/buffered_stream \
unit/buffered_write_stream \
unit/buffer \
+ unit/buffer_registration \
unit/buffers_iterator \
unit/cancellation_signal \
unit/cancellation_state \
@@ -43,39 +57,29 @@ check_PROGRAMS = \
unit/completion_condition \
unit/compose \
unit/connect \
+ unit/connect_pipe \
+ unit/consign \
unit/coroutine \
unit/deadline_timer \
unit/defer \
+ unit/deferred \
unit/detached \
unit/dispatch \
unit/error \
unit/execution/any_executor \
unit/execution/blocking \
unit/execution/blocking_adaptation \
- unit/execution/bulk_execute \
- unit/execution/bulk_guarantee \
- unit/execution/connect \
unit/execution/context_as \
- unit/execution/execute \
unit/execution/executor \
unit/execution/invocable_archetype \
unit/execution/mapping \
- unit/execution/operation_state \
unit/execution/outstanding_work \
unit/execution/prefer_only \
- unit/execution/receiver \
unit/execution/relationship \
- unit/execution/schedule \
- unit/execution/scheduler \
- unit/execution/sender \
- unit/execution/set_done \
- unit/execution/set_error \
- unit/execution/set_value \
- unit/execution/start \
- unit/execution/submit \
unit/execution_context \
unit/executor \
unit/executor_work_guard \
+ unit/file_base \
unit/generic/basic_endpoint \
unit/generic/datagram_protocol \
unit/generic/raw_protocol \
@@ -111,6 +115,7 @@ check_PROGRAMS = \
unit/local/basic_endpoint \
unit/local/connect_pair \
unit/local/datagram_protocol \
+ unit/local/seq_packet_protocol \
unit/local/stream_protocol \
unit/packaged_task \
unit/placeholders \
@@ -120,17 +125,24 @@ check_PROGRAMS = \
unit/posix/descriptor_base \
unit/posix/stream_descriptor \
unit/post \
+ unit/prepend \
+ unit/random_access_file \
unit/read \
unit/read_at \
unit/read_until \
+ unit/readable_pipe \
+ unit/recycling_allocator \
unit/redirect_error \
+ unit/registered_buffer \
unit/serial_port \
unit/serial_port_base \
unit/signal_set \
+ unit/signal_set_base \
unit/socket_base \
unit/static_thread_pool \
unit/steady_timer \
unit/strand \
+ unit/stream_file \
unit/streambuf \
unit/system_context \
unit/system_executor \
@@ -160,6 +172,7 @@ check_PROGRAMS = \
unit/windows/overlapped_ptr \
unit/windows/random_access_handle \
unit/windows/stream_handle \
+ unit/writable_pipe \
unit/write \
unit/write_at
@@ -173,9 +186,14 @@ noinst_PROGRAMS = \
performance/server
endif
-if HAVE_CXX14
+if HAVE_CXX11
check_PROGRAMS += \
- unit/experimental/deferred
+ unit/experimental/basic_channel \
+ unit/experimental/basic_concurrent_channel \
+ unit/experimental/channel \
+ unit/experimental/channel_traits \
+ unit/experimental/concurrent_channel \
+ unit/experimental/parallel_group
endif
if HAVE_CXX20
@@ -185,8 +203,12 @@ check_PROGRAMS += \
if HAVE_COROUTINES
check_PROGRAMS += \
unit/experimental/awaitable_operators \
+ unit/experimental/co_composed \
+ unit/experimental/coro/allocator \
unit/experimental/coro/cancel \
+ unit/experimental/coro/co_spawn \
unit/experimental/coro/exception \
+ unit/experimental/coro/executor \
unit/experimental/coro/partial \
unit/experimental/coro/simple_test \
unit/experimental/coro/stack_test \
@@ -206,29 +228,43 @@ check_PROGRAMS += \
endif
TESTS = \
+ unit/any_completion_executor \
+ unit/any_completion_handler \
+ unit/any_io_executor \
+ unit/append \
+ unit/as_tuple \
unit/associated_allocator \
unit/associated_cancellation_slot \
unit/associated_executor \
+ unit/associated_immediate_executor \
unit/associator \
unit/async_result \
unit/awaitable \
unit/basic_datagram_socket \
unit/basic_deadline_timer \
+ unit/basic_file \
+ unit/basic_random_access_file \
unit/basic_raw_socket \
+ unit/basic_readable_pipe \
unit/basic_seq_packet_socket \
unit/basic_serial_port \
unit/basic_signal_set \
unit/basic_socket \
unit/basic_socket_acceptor \
+ unit/basic_stream_file \
unit/basic_stream_socket \
unit/basic_streambuf \
unit/basic_waitable_timer \
+ unit/basic_writable_pipe \
+ unit/bind_allocator \
unit/bind_cancellation_slot \
unit/bind_executor \
+ unit/bind_immediate_executor \
unit/buffered_read_stream \
unit/buffered_stream \
unit/buffered_write_stream \
unit/buffer \
+ unit/buffer_registration \
unit/buffers_iterator \
unit/cancellation_signal \
unit/cancellation_state \
@@ -237,38 +273,28 @@ TESTS = \
unit/completion_condition \
unit/compose \
unit/connect \
+ unit/connect_pipe \
+ unit/consign \
unit/deadline_timer \
unit/defer \
+ unit/deferred \
unit/detached \
unit/dispatch \
unit/error \
unit/execution/any_executor \
unit/execution/blocking \
unit/execution/blocking_adaptation \
- unit/execution/bulk_execute \
- unit/execution/bulk_guarantee \
- unit/execution/connect \
unit/execution/context_as \
- unit/execution/execute \
unit/execution/executor \
unit/execution/invocable_archetype \
unit/execution/mapping \
- unit/execution/operation_state \
unit/execution/outstanding_work \
unit/execution/prefer_only \
- unit/execution/receiver \
unit/execution/relationship \
- unit/execution/schedule \
- unit/execution/scheduler \
- unit/execution/sender \
- unit/execution/set_done \
- unit/execution/set_error \
- unit/execution/set_value \
- unit/execution/start \
- unit/execution/submit \
unit/execution_context \
unit/executor \
unit/executor_work_guard \
+ unit/file_base \
unit/high_resolution_timer \
unit/io_context \
unit/io_context_strand \
@@ -299,6 +325,7 @@ TESTS = \
unit/local/basic_endpoint \
unit/local/connect_pair \
unit/local/datagram_protocol \
+ unit/local/seq_packet_protocol \
unit/local/stream_protocol \
unit/packaged_task \
unit/placeholders \
@@ -308,17 +335,24 @@ TESTS = \
unit/posix/descriptor_base \
unit/posix/stream_descriptor \
unit/post \
+ unit/prepend \
+ unit/random_access_file \
unit/read \
unit/read_at \
unit/read_until \
+ unit/readable_pipe \
+ unit/recycling_allocator \
unit/redirect_error \
+ unit/registered_buffer \
unit/serial_port \
unit/serial_port_base \
unit/signal_set \
+ unit/signal_set_base \
unit/socket_base \
unit/static_thread_pool \
unit/steady_timer \
unit/strand \
+ unit/stream_file \
unit/streambuf \
unit/system_context \
unit/system_executor \
@@ -348,12 +382,18 @@ TESTS = \
unit/windows/overlapped_ptr \
unit/windows/random_access_handle \
unit/windows/stream_handle \
+ unit/writable_pipe \
unit/write \
unit/write_at
-if HAVE_CXX14
+if HAVE_CXX11
TESTS += \
- unit/experimental/deferred
+ unit/experimental/basic_channel \
+ unit/experimental/basic_concurrent_channel \
+ unit/experimental/channel \
+ unit/experimental/channel_traits \
+ unit/experimental/concurrent_channel \
+ unit/experimental/parallel_group
endif
if HAVE_CXX20
@@ -363,8 +403,12 @@ TESTS += \
if HAVE_COROUTINES
TESTS += \
unit/experimental/awaitable_operators \
+ unit/experimental/co_composed \
+ unit/experimental/coro/allocator \
unit/experimental/coro/cancel \
+ unit/experimental/coro/co_spawn \
unit/experimental/coro/exception \
+ unit/experimental/coro/executor \
unit/experimental/coro/partial \
unit/experimental/coro/simple_test \
unit/experimental/coro/stack_test \
@@ -398,26 +442,40 @@ performance_client_SOURCES = performance/client.cpp
performance_server_SOURCES = performance/server.cpp
endif
+unit_any_completion_executor_SOURCES = unit/any_completion_executor.cpp
+unit_any_completion_handler_SOURCES = unit/any_completion_handler.cpp
+unit_any_io_executor_SOURCES = unit/any_io_executor.cpp
+unit_append_SOURCES = unit/append.cpp
+unit_as_tuple_SOURCES = unit/as_tuple.cpp
unit_associated_allocator_SOURCES = unit/associated_allocator.cpp
unit_associated_cancellation_slot_SOURCES = unit/associated_cancellation_slot.cpp
unit_associated_executor_SOURCES = unit/associated_executor.cpp
+unit_associated_immediate_executor_SOURCES = unit/associated_immediate_executor.cpp
unit_associator_SOURCES = unit/associator.cpp
unit_async_result_SOURCES = unit/async_result.cpp
unit_awaitable_SOURCES = unit/awaitable.cpp
unit_basic_datagram_socket_SOURCES = unit/basic_datagram_socket.cpp
unit_basic_deadline_timer_SOURCES = unit/basic_deadline_timer.cpp
+unit_basic_file_SOURCES = unit/basic_file.cpp
+unit_basic_random_access_file_SOURCES = unit/basic_random_access_file.cpp
unit_basic_raw_socket_SOURCES = unit/basic_raw_socket.cpp
+unit_basic_readable_pipe_SOURCES = unit/basic_readable_pipe.cpp
unit_basic_seq_packet_socket_SOURCES = unit/basic_seq_packet_socket.cpp
unit_basic_serial_port_SOURCES = unit/basic_serial_port.cpp
unit_basic_signal_set_SOURCES = unit/basic_signal_set.cpp
unit_basic_socket_SOURCES = unit/basic_socket.cpp
unit_basic_socket_acceptor_SOURCES = unit/basic_socket_acceptor.cpp
+unit_basic_stream_file_SOURCES = unit/basic_stream_file.cpp
unit_basic_stream_socket_SOURCES = unit/basic_stream_socket.cpp
unit_basic_streambuf_SOURCES = unit/basic_streambuf.cpp
unit_basic_waitable_timer_SOURCES = unit/basic_waitable_timer.cpp
+unit_basic_writable_pipe_SOURCES = unit/basic_writable_pipe.cpp
+unit_bind_allocator_SOURCES = unit/bind_allocator.cpp
unit_bind_cancellation_slot_SOURCES = unit/bind_cancellation_slot.cpp
unit_bind_executor_SOURCES = unit/bind_executor.cpp
+unit_bind_immediate_executor_SOURCES = unit/bind_immediate_executor.cpp
unit_buffer_SOURCES = unit/buffer.cpp
+unit_buffer_registration_SOURCES = unit/buffer_registration.cpp
unit_buffers_iterator_SOURCES = unit/buffers_iterator.cpp
unit_buffered_read_stream_SOURCES = unit/buffered_read_stream.cpp
unit_buffered_stream_SOURCES = unit/buffered_stream.cpp
@@ -429,39 +487,29 @@ unit_co_spawn_SOURCES = unit/co_spawn.cpp
unit_completion_condition_SOURCES = unit/completion_condition.cpp
unit_compose_SOURCES = unit/compose.cpp
unit_connect_SOURCES = unit/connect.cpp
+unit_connect_pipe_SOURCES = unit/connect_pipe.cpp
+unit_consign_SOURCES = unit/consign.cpp
unit_coroutine_SOURCES = unit/coroutine.cpp
unit_deadline_timer_SOURCES = unit/deadline_timer.cpp
unit_defer_SOURCES = unit/defer.cpp
+unit_deferred_SOURCES = unit/deferred.cpp
unit_detached_SOURCES = unit/detached.cpp
unit_dispatch_SOURCES = unit/dispatch.cpp
unit_error_SOURCES = unit/error.cpp
unit_execution_any_executor_SOURCES = unit/execution/any_executor.cpp
unit_execution_blocking_SOURCES = unit/execution/blocking.cpp
unit_execution_blocking_adaptation_SOURCES = unit/execution/blocking_adaptation.cpp
-unit_execution_bulk_execute_SOURCES = unit/execution/bulk_execute.cpp
-unit_execution_bulk_guarantee_SOURCES = unit/execution/bulk_guarantee.cpp
-unit_execution_connect_SOURCES = unit/execution/connect.cpp
unit_execution_context_as_SOURCES = unit/execution/context_as.cpp
-unit_execution_execute_SOURCES = unit/execution/execute.cpp
unit_execution_executor_SOURCES = unit/execution/executor.cpp
unit_execution_invocable_archetype_SOURCES = unit/execution/invocable_archetype.cpp
unit_execution_mapping_SOURCES = unit/execution/mapping.cpp
unit_execution_outstanding_work_SOURCES = unit/execution/outstanding_work.cpp
-unit_execution_operation_state_SOURCES = unit/execution/operation_state.cpp
unit_execution_prefer_only_SOURCES = unit/execution/prefer_only.cpp
-unit_execution_receiver_SOURCES = unit/execution/receiver.cpp
unit_execution_relationship_SOURCES = unit/execution/relationship.cpp
-unit_execution_schedule_SOURCES = unit/execution/schedule.cpp
-unit_execution_scheduler_SOURCES = unit/execution/scheduler.cpp
-unit_execution_sender_SOURCES = unit/execution/sender.cpp
-unit_execution_set_done_SOURCES = unit/execution/set_done.cpp
-unit_execution_set_error_SOURCES = unit/execution/set_error.cpp
-unit_execution_set_value_SOURCES = unit/execution/set_value.cpp
-unit_execution_start_SOURCES = unit/execution/start.cpp
-unit_execution_submit_SOURCES = unit/execution/submit.cpp
unit_execution_context_SOURCES = unit/execution_context.cpp
unit_executor_SOURCES = unit/executor.cpp
unit_executor_work_guard_SOURCES = unit/executor_work_guard.cpp
+unit_file_base_SOURCES = unit/file_base.cpp
unit_generic_basic_endpoint_SOURCES = unit/generic/basic_endpoint.cpp
unit_generic_datagram_protocol_SOURCES = unit/generic/datagram_protocol.cpp
unit_generic_raw_protocol_SOURCES = unit/generic/raw_protocol.cpp
@@ -497,6 +545,7 @@ unit_is_write_buffered_SOURCES = unit/is_write_buffered.cpp
unit_local_basic_endpoint_SOURCES = unit/local/basic_endpoint.cpp
unit_local_connect_pair_SOURCES = unit/local/connect_pair.cpp
unit_local_datagram_protocol_SOURCES = unit/local/datagram_protocol.cpp
+unit_local_seq_packet_protocol_SOURCES = unit/local/seq_packet_protocol.cpp
unit_local_stream_protocol_SOURCES = unit/local/stream_protocol.cpp
unit_packaged_task_SOURCES = unit/packaged_task.cpp
unit_placeholders_SOURCES = unit/placeholders.cpp
@@ -506,17 +555,24 @@ unit_posix_descriptor_SOURCES = unit/posix/descriptor.cpp
unit_posix_descriptor_base_SOURCES = unit/posix/descriptor_base.cpp
unit_posix_stream_descriptor_SOURCES = unit/posix/stream_descriptor.cpp
unit_post_SOURCES = unit/post.cpp
+unit_prepend_SOURCES = unit/prepend.cpp
+unit_random_access_file_SOURCES = unit/random_access_file.cpp
unit_read_SOURCES = unit/read.cpp
unit_read_at_SOURCES = unit/read_at.cpp
unit_read_until_SOURCES = unit/read_until.cpp
+unit_readable_pipe_SOURCES = unit/readable_pipe.cpp
+unit_recycling_allocator_SOURCES = unit/recycling_allocator.cpp
unit_redirect_error_SOURCES = unit/redirect_error.cpp
+unit_registered_buffer_SOURCES = unit/registered_buffer.cpp
unit_serial_port_SOURCES = unit/serial_port.cpp
unit_serial_port_base_SOURCES = unit/serial_port_base.cpp
unit_signal_set_SOURCES = unit/signal_set.cpp
+unit_signal_set_base_SOURCES = unit/signal_set_base.cpp
unit_socket_base_SOURCES = unit/socket_base.cpp
unit_static_thread_pool_SOURCES = unit/static_thread_pool.cpp
unit_steady_timer_SOURCES = unit/steady_timer.cpp
unit_strand_SOURCES = unit/strand.cpp
+unit_stream_file_SOURCES = unit/stream_file.cpp
unit_streambuf_SOURCES = unit/streambuf.cpp
unit_system_context_SOURCES = unit/system_context.cpp
unit_system_executor_SOURCES = unit/system_executor.cpp
@@ -546,11 +602,17 @@ unit_windows_overlapped_handle_SOURCES = unit/windows/overlapped_handle.cpp
unit_windows_overlapped_ptr_SOURCES = unit/windows/overlapped_ptr.cpp
unit_windows_random_access_handle_SOURCES = unit/windows/random_access_handle.cpp
unit_windows_stream_handle_SOURCES = unit/windows/stream_handle.cpp
+unit_writable_pipe_SOURCES = unit/writable_pipe.cpp
unit_write_SOURCES = unit/write.cpp
unit_write_at_SOURCES = unit/write_at.cpp
-if HAVE_CXX14
-unit_experimental_deferred_SOURCES = unit/experimental/deferred.cpp
+if HAVE_CXX11
+unit_experimental_basic_channel_SOURCES = unit/experimental/basic_channel.cpp
+unit_experimental_basic_concurrent_channel_SOURCES = unit/experimental/basic_concurrent_channel.cpp
+unit_experimental_channel_SOURCES = unit/experimental/channel.cpp
+unit_experimental_channel_traits_SOURCES = unit/experimental/channel_traits.cpp
+unit_experimental_concurrent_channel_SOURCES = unit/experimental/concurrent_channel.cpp
+unit_experimental_parallel_group_SOURCES = unit/experimental/parallel_group.cpp
endif
if HAVE_CXX20
@@ -558,8 +620,12 @@ unit_experimental_promise_SOURCES = unit/experimental/promise.cpp
if HAVE_COROUTINES
unit_experimental_awaitable_operators_SOURCES = unit/experimental/awaitable_operators.cpp
+unit_experimental_co_composed_SOURCES = unit/experimental/co_composed.cpp
+unit_experimental_coro_allocator_SOURCES = unit/experimental/coro/allocator.cpp
unit_experimental_coro_cancel_SOURCES = unit/experimental/coro/cancel.cpp
+unit_experimental_coro_co_spawn_SOURCES = unit/experimental/coro/co_spawn.cpp
unit_experimental_coro_exception_SOURCES = unit/experimental/coro/exception.cpp
+unit_experimental_coro_executor_SOURCES = unit/experimental/coro/executor.cpp
unit_experimental_coro_partial_SOURCES = unit/experimental/coro/partial.cpp
unit_experimental_coro_simple_test_SOURCES = unit/experimental/coro/simple_test.cpp
unit_experimental_coro_stack_test_SOURCES = unit/experimental/coro/stack_test.cpp
diff --git a/3rdparty/asio/src/tests/Makefile.in b/3rdparty/asio/src/tests/Makefile.in
index 792e3875566..a88bd89fec5 100644
--- a/3rdparty/asio/src/tests/Makefile.in
+++ b/3rdparty/asio/src/tests/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -91,56 +91,56 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@HAVE_OPENSSL_TRUE@@SEPARATE_COMPILATION_TRUE@am__append_1 = ../asio_ssl.cpp
-check_PROGRAMS = unit/associated_allocator$(EXEEXT) \
+check_PROGRAMS = unit/any_completion_executor$(EXEEXT) \
+ unit/any_completion_handler$(EXEEXT) \
+ unit/any_io_executor$(EXEEXT) unit/append$(EXEEXT) \
+ unit/as_tuple$(EXEEXT) unit/associated_allocator$(EXEEXT) \
unit/associated_cancellation_slot$(EXEEXT) \
- unit/associated_executor$(EXEEXT) unit/associator$(EXEEXT) \
- unit/async_result$(EXEEXT) unit/awaitable$(EXEEXT) \
- unit/basic_datagram_socket$(EXEEXT) \
- unit/basic_deadline_timer$(EXEEXT) \
+ unit/associated_executor$(EXEEXT) \
+ unit/associated_immediate_executor$(EXEEXT) \
+ unit/associator$(EXEEXT) unit/async_result$(EXEEXT) \
+ unit/awaitable$(EXEEXT) unit/basic_datagram_socket$(EXEEXT) \
+ unit/basic_deadline_timer$(EXEEXT) unit/basic_file$(EXEEXT) \
+ unit/basic_random_access_file$(EXEEXT) \
unit/basic_raw_socket$(EXEEXT) \
+ unit/basic_readable_pipe$(EXEEXT) \
unit/basic_seq_packet_socket$(EXEEXT) \
unit/basic_serial_port$(EXEEXT) unit/basic_signal_set$(EXEEXT) \
unit/basic_socket$(EXEEXT) unit/basic_socket_acceptor$(EXEEXT) \
+ unit/basic_stream_file$(EXEEXT) \
unit/basic_stream_socket$(EXEEXT) \
unit/basic_streambuf$(EXEEXT) \
unit/basic_waitable_timer$(EXEEXT) \
+ unit/basic_writable_pipe$(EXEEXT) unit/bind_allocator$(EXEEXT) \
unit/bind_cancellation_slot$(EXEEXT) \
- unit/bind_executor$(EXEEXT) unit/buffered_read_stream$(EXEEXT) \
+ unit/bind_executor$(EXEEXT) \
+ unit/bind_immediate_executor$(EXEEXT) \
+ unit/buffered_read_stream$(EXEEXT) \
unit/buffered_stream$(EXEEXT) \
unit/buffered_write_stream$(EXEEXT) unit/buffer$(EXEEXT) \
+ unit/buffer_registration$(EXEEXT) \
unit/buffers_iterator$(EXEEXT) \
unit/cancellation_signal$(EXEEXT) \
unit/cancellation_state$(EXEEXT) \
unit/cancellation_type$(EXEEXT) unit/co_spawn$(EXEEXT) \
unit/completion_condition$(EXEEXT) unit/compose$(EXEEXT) \
- unit/connect$(EXEEXT) unit/coroutine$(EXEEXT) \
+ unit/connect$(EXEEXT) unit/connect_pipe$(EXEEXT) \
+ unit/consign$(EXEEXT) unit/coroutine$(EXEEXT) \
unit/deadline_timer$(EXEEXT) unit/defer$(EXEEXT) \
- unit/detached$(EXEEXT) unit/dispatch$(EXEEXT) \
- unit/error$(EXEEXT) unit/execution/any_executor$(EXEEXT) \
+ unit/deferred$(EXEEXT) unit/detached$(EXEEXT) \
+ unit/dispatch$(EXEEXT) unit/error$(EXEEXT) \
+ unit/execution/any_executor$(EXEEXT) \
unit/execution/blocking$(EXEEXT) \
unit/execution/blocking_adaptation$(EXEEXT) \
- unit/execution/bulk_execute$(EXEEXT) \
- unit/execution/bulk_guarantee$(EXEEXT) \
- unit/execution/connect$(EXEEXT) \
unit/execution/context_as$(EXEEXT) \
- unit/execution/execute$(EXEEXT) \
unit/execution/executor$(EXEEXT) \
unit/execution/invocable_archetype$(EXEEXT) \
unit/execution/mapping$(EXEEXT) \
- unit/execution/operation_state$(EXEEXT) \
unit/execution/outstanding_work$(EXEEXT) \
unit/execution/prefer_only$(EXEEXT) \
- unit/execution/receiver$(EXEEXT) \
unit/execution/relationship$(EXEEXT) \
- unit/execution/schedule$(EXEEXT) \
- unit/execution/scheduler$(EXEEXT) \
- unit/execution/sender$(EXEEXT) \
- unit/execution/set_done$(EXEEXT) \
- unit/execution/set_error$(EXEEXT) \
- unit/execution/set_value$(EXEEXT) \
- unit/execution/start$(EXEEXT) unit/execution/submit$(EXEEXT) \
unit/execution_context$(EXEEXT) unit/executor$(EXEEXT) \
- unit/executor_work_guard$(EXEEXT) \
+ unit/executor_work_guard$(EXEEXT) unit/file_base$(EXEEXT) \
unit/generic/basic_endpoint$(EXEEXT) \
unit/generic/datagram_protocol$(EXEEXT) \
unit/generic/raw_protocol$(EXEEXT) \
@@ -168,6 +168,7 @@ check_PROGRAMS = unit/associated_allocator$(EXEEXT) \
unit/local/basic_endpoint$(EXEEXT) \
unit/local/connect_pair$(EXEEXT) \
unit/local/datagram_protocol$(EXEEXT) \
+ unit/local/seq_packet_protocol$(EXEEXT) \
unit/local/stream_protocol$(EXEEXT) \
unit/packaged_task$(EXEEXT) unit/placeholders$(EXEEXT) \
unit/posix/basic_descriptor$(EXEEXT) \
@@ -175,22 +176,25 @@ check_PROGRAMS = unit/associated_allocator$(EXEEXT) \
unit/posix/descriptor$(EXEEXT) \
unit/posix/descriptor_base$(EXEEXT) \
unit/posix/stream_descriptor$(EXEEXT) unit/post$(EXEEXT) \
+ unit/prepend$(EXEEXT) unit/random_access_file$(EXEEXT) \
unit/read$(EXEEXT) unit/read_at$(EXEEXT) \
- unit/read_until$(EXEEXT) unit/redirect_error$(EXEEXT) \
- unit/serial_port$(EXEEXT) unit/serial_port_base$(EXEEXT) \
- unit/signal_set$(EXEEXT) unit/socket_base$(EXEEXT) \
+ unit/read_until$(EXEEXT) unit/readable_pipe$(EXEEXT) \
+ unit/recycling_allocator$(EXEEXT) unit/redirect_error$(EXEEXT) \
+ unit/registered_buffer$(EXEEXT) unit/serial_port$(EXEEXT) \
+ unit/serial_port_base$(EXEEXT) unit/signal_set$(EXEEXT) \
+ unit/signal_set_base$(EXEEXT) unit/socket_base$(EXEEXT) \
unit/static_thread_pool$(EXEEXT) unit/steady_timer$(EXEEXT) \
- unit/strand$(EXEEXT) unit/streambuf$(EXEEXT) \
- unit/system_context$(EXEEXT) unit/system_executor$(EXEEXT) \
- unit/system_timer$(EXEEXT) unit/this_coro$(EXEEXT) \
- unit/thread$(EXEEXT) unit/thread_pool$(EXEEXT) \
- unit/time_traits$(EXEEXT) unit/ts/buffer$(EXEEXT) \
- unit/ts/executor$(EXEEXT) unit/ts/internet$(EXEEXT) \
- unit/ts/io_context$(EXEEXT) unit/ts/net$(EXEEXT) \
- unit/ts/netfwd$(EXEEXT) unit/ts/socket$(EXEEXT) \
- unit/ts/timer$(EXEEXT) unit/use_awaitable$(EXEEXT) \
- unit/use_future$(EXEEXT) unit/uses_executor$(EXEEXT) \
- unit/wait_traits$(EXEEXT) \
+ unit/strand$(EXEEXT) unit/stream_file$(EXEEXT) \
+ unit/streambuf$(EXEEXT) unit/system_context$(EXEEXT) \
+ unit/system_executor$(EXEEXT) unit/system_timer$(EXEEXT) \
+ unit/this_coro$(EXEEXT) unit/thread$(EXEEXT) \
+ unit/thread_pool$(EXEEXT) unit/time_traits$(EXEEXT) \
+ unit/ts/buffer$(EXEEXT) unit/ts/executor$(EXEEXT) \
+ unit/ts/internet$(EXEEXT) unit/ts/io_context$(EXEEXT) \
+ unit/ts/net$(EXEEXT) unit/ts/netfwd$(EXEEXT) \
+ unit/ts/socket$(EXEEXT) unit/ts/timer$(EXEEXT) \
+ unit/use_awaitable$(EXEEXT) unit/use_future$(EXEEXT) \
+ unit/uses_executor$(EXEEXT) unit/wait_traits$(EXEEXT) \
unit/windows/basic_object_handle$(EXEEXT) \
unit/windows/basic_overlapped_handle$(EXEEXT) \
unit/windows/basic_random_access_handle$(EXEEXT) \
@@ -199,7 +203,8 @@ check_PROGRAMS = unit/associated_allocator$(EXEEXT) \
unit/windows/overlapped_handle$(EXEEXT) \
unit/windows/overlapped_ptr$(EXEEXT) \
unit/windows/random_access_handle$(EXEEXT) \
- unit/windows/stream_handle$(EXEEXT) unit/write$(EXEEXT) \
+ unit/windows/stream_handle$(EXEEXT) \
+ unit/writable_pipe$(EXEEXT) unit/write$(EXEEXT) \
unit/write_at$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \
$(am__EXEEXT_3) $(am__EXEEXT_4)
@STANDALONE_FALSE@noinst_PROGRAMS = latency/tcp_client$(EXEEXT) \
@@ -208,16 +213,25 @@ check_PROGRAMS = unit/associated_allocator$(EXEEXT) \
@STANDALONE_FALSE@ latency/udp_server$(EXEEXT) \
@STANDALONE_FALSE@ performance/client$(EXEEXT) \
@STANDALONE_FALSE@ performance/server$(EXEEXT)
-@HAVE_CXX14_TRUE@am__append_2 = \
-@HAVE_CXX14_TRUE@ unit/experimental/deferred
+@HAVE_CXX11_TRUE@am__append_2 = \
+@HAVE_CXX11_TRUE@ unit/experimental/basic_channel \
+@HAVE_CXX11_TRUE@ unit/experimental/basic_concurrent_channel \
+@HAVE_CXX11_TRUE@ unit/experimental/channel \
+@HAVE_CXX11_TRUE@ unit/experimental/channel_traits \
+@HAVE_CXX11_TRUE@ unit/experimental/concurrent_channel \
+@HAVE_CXX11_TRUE@ unit/experimental/parallel_group
@HAVE_CXX20_TRUE@am__append_3 = \
@HAVE_CXX20_TRUE@ unit/experimental/promise
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am__append_4 = \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/awaitable_operators \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/co_composed \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/allocator \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/cancel \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/co_spawn \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/exception \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/executor \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/partial \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/simple_test \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/stack_test \
@@ -232,56 +246,55 @@ check_PROGRAMS = unit/associated_allocator$(EXEEXT) \
@HAVE_OPENSSL_TRUE@ unit/ssl/stream_base \
@HAVE_OPENSSL_TRUE@ unit/ssl/stream
-TESTS = unit/associated_allocator$(EXEEXT) \
+TESTS = unit/any_completion_executor$(EXEEXT) \
+ unit/any_completion_handler$(EXEEXT) \
+ unit/any_io_executor$(EXEEXT) unit/append$(EXEEXT) \
+ unit/as_tuple$(EXEEXT) unit/associated_allocator$(EXEEXT) \
unit/associated_cancellation_slot$(EXEEXT) \
- unit/associated_executor$(EXEEXT) unit/associator$(EXEEXT) \
- unit/async_result$(EXEEXT) unit/awaitable$(EXEEXT) \
- unit/basic_datagram_socket$(EXEEXT) \
- unit/basic_deadline_timer$(EXEEXT) \
+ unit/associated_executor$(EXEEXT) \
+ unit/associated_immediate_executor$(EXEEXT) \
+ unit/associator$(EXEEXT) unit/async_result$(EXEEXT) \
+ unit/awaitable$(EXEEXT) unit/basic_datagram_socket$(EXEEXT) \
+ unit/basic_deadline_timer$(EXEEXT) unit/basic_file$(EXEEXT) \
+ unit/basic_random_access_file$(EXEEXT) \
unit/basic_raw_socket$(EXEEXT) \
+ unit/basic_readable_pipe$(EXEEXT) \
unit/basic_seq_packet_socket$(EXEEXT) \
unit/basic_serial_port$(EXEEXT) unit/basic_signal_set$(EXEEXT) \
unit/basic_socket$(EXEEXT) unit/basic_socket_acceptor$(EXEEXT) \
+ unit/basic_stream_file$(EXEEXT) \
unit/basic_stream_socket$(EXEEXT) \
unit/basic_streambuf$(EXEEXT) \
unit/basic_waitable_timer$(EXEEXT) \
+ unit/basic_writable_pipe$(EXEEXT) unit/bind_allocator$(EXEEXT) \
unit/bind_cancellation_slot$(EXEEXT) \
- unit/bind_executor$(EXEEXT) unit/buffered_read_stream$(EXEEXT) \
+ unit/bind_executor$(EXEEXT) \
+ unit/bind_immediate_executor$(EXEEXT) \
+ unit/buffered_read_stream$(EXEEXT) \
unit/buffered_stream$(EXEEXT) \
unit/buffered_write_stream$(EXEEXT) unit/buffer$(EXEEXT) \
+ unit/buffer_registration$(EXEEXT) \
unit/buffers_iterator$(EXEEXT) \
unit/cancellation_signal$(EXEEXT) \
unit/cancellation_state$(EXEEXT) \
unit/cancellation_type$(EXEEXT) unit/co_spawn$(EXEEXT) \
unit/completion_condition$(EXEEXT) unit/compose$(EXEEXT) \
- unit/connect$(EXEEXT) unit/deadline_timer$(EXEEXT) \
- unit/defer$(EXEEXT) unit/detached$(EXEEXT) \
- unit/dispatch$(EXEEXT) unit/error$(EXEEXT) \
- unit/execution/any_executor$(EXEEXT) \
+ unit/connect$(EXEEXT) unit/connect_pipe$(EXEEXT) \
+ unit/consign$(EXEEXT) unit/deadline_timer$(EXEEXT) \
+ unit/defer$(EXEEXT) unit/deferred$(EXEEXT) \
+ unit/detached$(EXEEXT) unit/dispatch$(EXEEXT) \
+ unit/error$(EXEEXT) unit/execution/any_executor$(EXEEXT) \
unit/execution/blocking$(EXEEXT) \
unit/execution/blocking_adaptation$(EXEEXT) \
- unit/execution/bulk_execute$(EXEEXT) \
- unit/execution/bulk_guarantee$(EXEEXT) \
- unit/execution/connect$(EXEEXT) \
unit/execution/context_as$(EXEEXT) \
- unit/execution/execute$(EXEEXT) \
unit/execution/executor$(EXEEXT) \
unit/execution/invocable_archetype$(EXEEXT) \
unit/execution/mapping$(EXEEXT) \
- unit/execution/operation_state$(EXEEXT) \
unit/execution/outstanding_work$(EXEEXT) \
unit/execution/prefer_only$(EXEEXT) \
- unit/execution/receiver$(EXEEXT) \
unit/execution/relationship$(EXEEXT) \
- unit/execution/schedule$(EXEEXT) \
- unit/execution/scheduler$(EXEEXT) \
- unit/execution/sender$(EXEEXT) \
- unit/execution/set_done$(EXEEXT) \
- unit/execution/set_error$(EXEEXT) \
- unit/execution/set_value$(EXEEXT) \
- unit/execution/start$(EXEEXT) unit/execution/submit$(EXEEXT) \
unit/execution_context$(EXEEXT) unit/executor$(EXEEXT) \
- unit/executor_work_guard$(EXEEXT) \
+ unit/executor_work_guard$(EXEEXT) unit/file_base$(EXEEXT) \
unit/high_resolution_timer$(EXEEXT) unit/io_context$(EXEEXT) \
unit/io_context_strand$(EXEEXT) unit/ip/address$(EXEEXT) \
unit/ip/address_v4$(EXEEXT) \
@@ -304,6 +317,7 @@ TESTS = unit/associated_allocator$(EXEEXT) \
unit/local/basic_endpoint$(EXEEXT) \
unit/local/connect_pair$(EXEEXT) \
unit/local/datagram_protocol$(EXEEXT) \
+ unit/local/seq_packet_protocol$(EXEEXT) \
unit/local/stream_protocol$(EXEEXT) \
unit/packaged_task$(EXEEXT) unit/placeholders$(EXEEXT) \
unit/posix/basic_descriptor$(EXEEXT) \
@@ -311,22 +325,25 @@ TESTS = unit/associated_allocator$(EXEEXT) \
unit/posix/descriptor$(EXEEXT) \
unit/posix/descriptor_base$(EXEEXT) \
unit/posix/stream_descriptor$(EXEEXT) unit/post$(EXEEXT) \
+ unit/prepend$(EXEEXT) unit/random_access_file$(EXEEXT) \
unit/read$(EXEEXT) unit/read_at$(EXEEXT) \
- unit/read_until$(EXEEXT) unit/redirect_error$(EXEEXT) \
- unit/serial_port$(EXEEXT) unit/serial_port_base$(EXEEXT) \
- unit/signal_set$(EXEEXT) unit/socket_base$(EXEEXT) \
+ unit/read_until$(EXEEXT) unit/readable_pipe$(EXEEXT) \
+ unit/recycling_allocator$(EXEEXT) unit/redirect_error$(EXEEXT) \
+ unit/registered_buffer$(EXEEXT) unit/serial_port$(EXEEXT) \
+ unit/serial_port_base$(EXEEXT) unit/signal_set$(EXEEXT) \
+ unit/signal_set_base$(EXEEXT) unit/socket_base$(EXEEXT) \
unit/static_thread_pool$(EXEEXT) unit/steady_timer$(EXEEXT) \
- unit/strand$(EXEEXT) unit/streambuf$(EXEEXT) \
- unit/system_context$(EXEEXT) unit/system_executor$(EXEEXT) \
- unit/system_timer$(EXEEXT) unit/this_coro$(EXEEXT) \
- unit/thread$(EXEEXT) unit/thread_pool$(EXEEXT) \
- unit/time_traits$(EXEEXT) unit/ts/buffer$(EXEEXT) \
- unit/ts/executor$(EXEEXT) unit/ts/internet$(EXEEXT) \
- unit/ts/io_context$(EXEEXT) unit/ts/net$(EXEEXT) \
- unit/ts/netfwd$(EXEEXT) unit/ts/socket$(EXEEXT) \
- unit/ts/timer$(EXEEXT) unit/use_awaitable$(EXEEXT) \
- unit/use_future$(EXEEXT) unit/uses_executor$(EXEEXT) \
- unit/wait_traits$(EXEEXT) \
+ unit/strand$(EXEEXT) unit/stream_file$(EXEEXT) \
+ unit/streambuf$(EXEEXT) unit/system_context$(EXEEXT) \
+ unit/system_executor$(EXEEXT) unit/system_timer$(EXEEXT) \
+ unit/this_coro$(EXEEXT) unit/thread$(EXEEXT) \
+ unit/thread_pool$(EXEEXT) unit/time_traits$(EXEEXT) \
+ unit/ts/buffer$(EXEEXT) unit/ts/executor$(EXEEXT) \
+ unit/ts/internet$(EXEEXT) unit/ts/io_context$(EXEEXT) \
+ unit/ts/net$(EXEEXT) unit/ts/netfwd$(EXEEXT) \
+ unit/ts/socket$(EXEEXT) unit/ts/timer$(EXEEXT) \
+ unit/use_awaitable$(EXEEXT) unit/use_future$(EXEEXT) \
+ unit/uses_executor$(EXEEXT) unit/wait_traits$(EXEEXT) \
unit/windows/basic_object_handle$(EXEEXT) \
unit/windows/basic_overlapped_handle$(EXEEXT) \
unit/windows/basic_random_access_handle$(EXEEXT) \
@@ -335,19 +352,29 @@ TESTS = unit/associated_allocator$(EXEEXT) \
unit/windows/overlapped_handle$(EXEEXT) \
unit/windows/overlapped_ptr$(EXEEXT) \
unit/windows/random_access_handle$(EXEEXT) \
- unit/windows/stream_handle$(EXEEXT) unit/write$(EXEEXT) \
+ unit/windows/stream_handle$(EXEEXT) \
+ unit/writable_pipe$(EXEEXT) unit/write$(EXEEXT) \
unit/write_at$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \
$(am__EXEEXT_3) $(am__EXEEXT_4)
-@HAVE_CXX14_TRUE@am__append_6 = \
-@HAVE_CXX14_TRUE@ unit/experimental/deferred
+@HAVE_CXX11_TRUE@am__append_6 = \
+@HAVE_CXX11_TRUE@ unit/experimental/basic_channel \
+@HAVE_CXX11_TRUE@ unit/experimental/basic_concurrent_channel \
+@HAVE_CXX11_TRUE@ unit/experimental/channel \
+@HAVE_CXX11_TRUE@ unit/experimental/channel_traits \
+@HAVE_CXX11_TRUE@ unit/experimental/concurrent_channel \
+@HAVE_CXX11_TRUE@ unit/experimental/parallel_group
@HAVE_CXX20_TRUE@am__append_7 = \
@HAVE_CXX20_TRUE@ unit/experimental/promise
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am__append_8 = \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/awaitable_operators \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/co_composed \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/allocator \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/cancel \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/co_spawn \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/exception \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/executor \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/partial \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/simple_test \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/stack_test \
@@ -372,11 +399,21 @@ DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-@HAVE_CXX14_TRUE@am__EXEEXT_1 = unit/experimental/deferred$(EXEEXT)
+@HAVE_CXX11_TRUE@am__EXEEXT_1 = \
+@HAVE_CXX11_TRUE@ unit/experimental/basic_channel$(EXEEXT) \
+@HAVE_CXX11_TRUE@ unit/experimental/basic_concurrent_channel$(EXEEXT) \
+@HAVE_CXX11_TRUE@ unit/experimental/channel$(EXEEXT) \
+@HAVE_CXX11_TRUE@ unit/experimental/channel_traits$(EXEEXT) \
+@HAVE_CXX11_TRUE@ unit/experimental/concurrent_channel$(EXEEXT) \
+@HAVE_CXX11_TRUE@ unit/experimental/parallel_group$(EXEEXT)
@HAVE_CXX20_TRUE@am__EXEEXT_2 = unit/experimental/promise$(EXEEXT)
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am__EXEEXT_3 = unit/experimental/awaitable_operators$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/co_composed$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/allocator$(EXEEXT) \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/cancel$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/co_spawn$(EXEEXT) \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/exception$(EXEEXT) \
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/executor$(EXEEXT) \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/partial$(EXEEXT) \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/simple_test$(EXEEXT) \
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@ unit/experimental/coro/stack_test$(EXEEXT) \
@@ -446,6 +483,33 @@ performance_server_OBJECTS = $(am_performance_server_OBJECTS)
performance_server_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@performance_server_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_any_completion_executor_OBJECTS = \
+ unit/any_completion_executor.$(OBJEXT)
+unit_any_completion_executor_OBJECTS = \
+ $(am_unit_any_completion_executor_OBJECTS)
+unit_any_completion_executor_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_any_completion_executor_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_any_completion_handler_OBJECTS = \
+ unit/any_completion_handler.$(OBJEXT)
+unit_any_completion_handler_OBJECTS = \
+ $(am_unit_any_completion_handler_OBJECTS)
+unit_any_completion_handler_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_any_completion_handler_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_any_io_executor_OBJECTS = unit/any_io_executor.$(OBJEXT)
+unit_any_io_executor_OBJECTS = $(am_unit_any_io_executor_OBJECTS)
+unit_any_io_executor_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_any_io_executor_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_append_OBJECTS = unit/append.$(OBJEXT)
+unit_append_OBJECTS = $(am_unit_append_OBJECTS)
+unit_append_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_append_DEPENDENCIES = libasio.a
+am_unit_as_tuple_OBJECTS = unit/as_tuple.$(OBJEXT)
+unit_as_tuple_OBJECTS = $(am_unit_as_tuple_OBJECTS)
+unit_as_tuple_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_as_tuple_DEPENDENCIES = libasio.a
am_unit_associated_allocator_OBJECTS = \
unit/associated_allocator.$(OBJEXT)
unit_associated_allocator_OBJECTS = \
@@ -467,6 +531,13 @@ unit_associated_executor_OBJECTS = \
unit_associated_executor_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_associated_executor_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_associated_immediate_executor_OBJECTS = \
+ unit/associated_immediate_executor.$(OBJEXT)
+unit_associated_immediate_executor_OBJECTS = \
+ $(am_unit_associated_immediate_executor_OBJECTS)
+unit_associated_immediate_executor_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_associated_immediate_executor_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_associator_OBJECTS = unit/associator.$(OBJEXT)
unit_associator_OBJECTS = $(am_unit_associator_OBJECTS)
unit_associator_LDADD = $(LDADD)
@@ -493,11 +564,29 @@ unit_basic_deadline_timer_OBJECTS = \
unit_basic_deadline_timer_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_basic_deadline_timer_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_basic_file_OBJECTS = unit/basic_file.$(OBJEXT)
+unit_basic_file_OBJECTS = $(am_unit_basic_file_OBJECTS)
+unit_basic_file_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_basic_file_DEPENDENCIES = libasio.a
+am_unit_basic_random_access_file_OBJECTS = \
+ unit/basic_random_access_file.$(OBJEXT)
+unit_basic_random_access_file_OBJECTS = \
+ $(am_unit_basic_random_access_file_OBJECTS)
+unit_basic_random_access_file_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_basic_random_access_file_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_basic_raw_socket_OBJECTS = unit/basic_raw_socket.$(OBJEXT)
unit_basic_raw_socket_OBJECTS = $(am_unit_basic_raw_socket_OBJECTS)
unit_basic_raw_socket_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_basic_raw_socket_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_basic_readable_pipe_OBJECTS = \
+ unit/basic_readable_pipe.$(OBJEXT)
+unit_basic_readable_pipe_OBJECTS = \
+ $(am_unit_basic_readable_pipe_OBJECTS)
+unit_basic_readable_pipe_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_basic_readable_pipe_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_basic_seq_packet_socket_OBJECTS = \
unit/basic_seq_packet_socket.$(OBJEXT)
unit_basic_seq_packet_socket_OBJECTS = \
@@ -526,6 +615,11 @@ unit_basic_socket_acceptor_OBJECTS = \
unit_basic_socket_acceptor_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_basic_socket_acceptor_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_basic_stream_file_OBJECTS = unit/basic_stream_file.$(OBJEXT)
+unit_basic_stream_file_OBJECTS = $(am_unit_basic_stream_file_OBJECTS)
+unit_basic_stream_file_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_basic_stream_file_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_basic_stream_socket_OBJECTS = \
unit/basic_stream_socket.$(OBJEXT)
unit_basic_stream_socket_OBJECTS = \
@@ -545,6 +639,18 @@ unit_basic_waitable_timer_OBJECTS = \
unit_basic_waitable_timer_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_basic_waitable_timer_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_basic_writable_pipe_OBJECTS = \
+ unit/basic_writable_pipe.$(OBJEXT)
+unit_basic_writable_pipe_OBJECTS = \
+ $(am_unit_basic_writable_pipe_OBJECTS)
+unit_basic_writable_pipe_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_basic_writable_pipe_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_bind_allocator_OBJECTS = unit/bind_allocator.$(OBJEXT)
+unit_bind_allocator_OBJECTS = $(am_unit_bind_allocator_OBJECTS)
+unit_bind_allocator_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_bind_allocator_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_bind_cancellation_slot_OBJECTS = \
unit/bind_cancellation_slot.$(OBJEXT)
unit_bind_cancellation_slot_OBJECTS = \
@@ -557,10 +663,24 @@ unit_bind_executor_OBJECTS = $(am_unit_bind_executor_OBJECTS)
unit_bind_executor_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_bind_executor_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_bind_immediate_executor_OBJECTS = \
+ unit/bind_immediate_executor.$(OBJEXT)
+unit_bind_immediate_executor_OBJECTS = \
+ $(am_unit_bind_immediate_executor_OBJECTS)
+unit_bind_immediate_executor_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_bind_immediate_executor_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_buffer_OBJECTS = unit/buffer.$(OBJEXT)
unit_buffer_OBJECTS = $(am_unit_buffer_OBJECTS)
unit_buffer_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_buffer_DEPENDENCIES = libasio.a
+am_unit_buffer_registration_OBJECTS = \
+ unit/buffer_registration.$(OBJEXT)
+unit_buffer_registration_OBJECTS = \
+ $(am_unit_buffer_registration_OBJECTS)
+unit_buffer_registration_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_buffer_registration_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_buffered_read_stream_OBJECTS = \
unit/buffered_read_stream.$(OBJEXT)
unit_buffered_read_stream_OBJECTS = \
@@ -623,6 +743,14 @@ am_unit_connect_OBJECTS = unit/connect.$(OBJEXT)
unit_connect_OBJECTS = $(am_unit_connect_OBJECTS)
unit_connect_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_connect_DEPENDENCIES = libasio.a
+am_unit_connect_pipe_OBJECTS = unit/connect_pipe.$(OBJEXT)
+unit_connect_pipe_OBJECTS = $(am_unit_connect_pipe_OBJECTS)
+unit_connect_pipe_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_connect_pipe_DEPENDENCIES = libasio.a
+am_unit_consign_OBJECTS = unit/consign.$(OBJEXT)
+unit_consign_OBJECTS = $(am_unit_consign_OBJECTS)
+unit_consign_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_consign_DEPENDENCIES = libasio.a
am_unit_coroutine_OBJECTS = unit/coroutine.$(OBJEXT)
unit_coroutine_OBJECTS = $(am_unit_coroutine_OBJECTS)
unit_coroutine_LDADD = $(LDADD)
@@ -636,6 +764,10 @@ am_unit_defer_OBJECTS = unit/defer.$(OBJEXT)
unit_defer_OBJECTS = $(am_unit_defer_OBJECTS)
unit_defer_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_defer_DEPENDENCIES = libasio.a
+am_unit_deferred_OBJECTS = unit/deferred.$(OBJEXT)
+unit_deferred_OBJECTS = $(am_unit_deferred_OBJECTS)
+unit_deferred_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_deferred_DEPENDENCIES = libasio.a
am_unit_detached_OBJECTS = unit/detached.$(OBJEXT)
unit_detached_OBJECTS = $(am_unit_detached_OBJECTS)
unit_detached_LDADD = $(LDADD)
@@ -669,25 +801,6 @@ unit_execution_blocking_adaptation_OBJECTS = \
unit_execution_blocking_adaptation_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_execution_blocking_adaptation_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_bulk_execute_OBJECTS = \
- unit/execution/bulk_execute.$(OBJEXT)
-unit_execution_bulk_execute_OBJECTS = \
- $(am_unit_execution_bulk_execute_OBJECTS)
-unit_execution_bulk_execute_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_bulk_execute_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_bulk_guarantee_OBJECTS = \
- unit/execution/bulk_guarantee.$(OBJEXT)
-unit_execution_bulk_guarantee_OBJECTS = \
- $(am_unit_execution_bulk_guarantee_OBJECTS)
-unit_execution_bulk_guarantee_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_bulk_guarantee_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_connect_OBJECTS = unit/execution/connect.$(OBJEXT)
-unit_execution_connect_OBJECTS = $(am_unit_execution_connect_OBJECTS)
-unit_execution_connect_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_connect_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_execution_context_as_OBJECTS = \
unit/execution/context_as.$(OBJEXT)
unit_execution_context_as_OBJECTS = \
@@ -695,11 +808,6 @@ unit_execution_context_as_OBJECTS = \
unit_execution_context_as_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_execution_context_as_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_execute_OBJECTS = unit/execution/execute.$(OBJEXT)
-unit_execution_execute_OBJECTS = $(am_unit_execution_execute_OBJECTS)
-unit_execution_execute_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_execute_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_execution_executor_OBJECTS = \
unit/execution/executor.$(OBJEXT)
unit_execution_executor_OBJECTS = \
@@ -719,13 +827,6 @@ unit_execution_mapping_OBJECTS = $(am_unit_execution_mapping_OBJECTS)
unit_execution_mapping_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_execution_mapping_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_operation_state_OBJECTS = \
- unit/execution/operation_state.$(OBJEXT)
-unit_execution_operation_state_OBJECTS = \
- $(am_unit_execution_operation_state_OBJECTS)
-unit_execution_operation_state_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_operation_state_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_execution_outstanding_work_OBJECTS = \
unit/execution/outstanding_work.$(OBJEXT)
unit_execution_outstanding_work_OBJECTS = \
@@ -740,13 +841,6 @@ unit_execution_prefer_only_OBJECTS = \
unit_execution_prefer_only_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_execution_prefer_only_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_receiver_OBJECTS = \
- unit/execution/receiver.$(OBJEXT)
-unit_execution_receiver_OBJECTS = \
- $(am_unit_execution_receiver_OBJECTS)
-unit_execution_receiver_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_receiver_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_execution_relationship_OBJECTS = \
unit/execution/relationship.$(OBJEXT)
unit_execution_relationship_OBJECTS = \
@@ -754,56 +848,6 @@ unit_execution_relationship_OBJECTS = \
unit_execution_relationship_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_execution_relationship_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_schedule_OBJECTS = \
- unit/execution/schedule.$(OBJEXT)
-unit_execution_schedule_OBJECTS = \
- $(am_unit_execution_schedule_OBJECTS)
-unit_execution_schedule_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_schedule_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_scheduler_OBJECTS = \
- unit/execution/scheduler.$(OBJEXT)
-unit_execution_scheduler_OBJECTS = \
- $(am_unit_execution_scheduler_OBJECTS)
-unit_execution_scheduler_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_scheduler_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_sender_OBJECTS = unit/execution/sender.$(OBJEXT)
-unit_execution_sender_OBJECTS = $(am_unit_execution_sender_OBJECTS)
-unit_execution_sender_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_sender_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_set_done_OBJECTS = \
- unit/execution/set_done.$(OBJEXT)
-unit_execution_set_done_OBJECTS = \
- $(am_unit_execution_set_done_OBJECTS)
-unit_execution_set_done_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_set_done_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_set_error_OBJECTS = \
- unit/execution/set_error.$(OBJEXT)
-unit_execution_set_error_OBJECTS = \
- $(am_unit_execution_set_error_OBJECTS)
-unit_execution_set_error_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_set_error_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_set_value_OBJECTS = \
- unit/execution/set_value.$(OBJEXT)
-unit_execution_set_value_OBJECTS = \
- $(am_unit_execution_set_value_OBJECTS)
-unit_execution_set_value_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_set_value_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_start_OBJECTS = unit/execution/start.$(OBJEXT)
-unit_execution_start_OBJECTS = $(am_unit_execution_start_OBJECTS)
-unit_execution_start_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_start_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
-am_unit_execution_submit_OBJECTS = unit/execution/submit.$(OBJEXT)
-unit_execution_submit_OBJECTS = $(am_unit_execution_submit_OBJECTS)
-unit_execution_submit_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_execution_submit_DEPENDENCIES = \
-@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_execution_context_OBJECTS = unit/execution_context.$(OBJEXT)
unit_execution_context_OBJECTS = $(am_unit_execution_context_OBJECTS)
unit_execution_context_LDADD = $(LDADD)
@@ -828,6 +872,65 @@ unit_experimental_awaitable_operators_OBJECTS = \
unit_experimental_awaitable_operators_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_experimental_awaitable_operators_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__unit_experimental_basic_channel_SOURCES_DIST = \
+ unit/experimental/basic_channel.cpp
+@HAVE_CXX11_TRUE@am_unit_experimental_basic_channel_OBJECTS = \
+@HAVE_CXX11_TRUE@ unit/experimental/basic_channel.$(OBJEXT)
+unit_experimental_basic_channel_OBJECTS = \
+ $(am_unit_experimental_basic_channel_OBJECTS)
+unit_experimental_basic_channel_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_basic_channel_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__unit_experimental_basic_concurrent_channel_SOURCES_DIST = \
+ unit/experimental/basic_concurrent_channel.cpp
+@HAVE_CXX11_TRUE@am_unit_experimental_basic_concurrent_channel_OBJECTS = unit/experimental/basic_concurrent_channel.$(OBJEXT)
+unit_experimental_basic_concurrent_channel_OBJECTS = \
+ $(am_unit_experimental_basic_concurrent_channel_OBJECTS)
+unit_experimental_basic_concurrent_channel_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_basic_concurrent_channel_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__unit_experimental_channel_SOURCES_DIST = \
+ unit/experimental/channel.cpp
+@HAVE_CXX11_TRUE@am_unit_experimental_channel_OBJECTS = \
+@HAVE_CXX11_TRUE@ unit/experimental/channel.$(OBJEXT)
+unit_experimental_channel_OBJECTS = \
+ $(am_unit_experimental_channel_OBJECTS)
+unit_experimental_channel_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_channel_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__unit_experimental_channel_traits_SOURCES_DIST = \
+ unit/experimental/channel_traits.cpp
+@HAVE_CXX11_TRUE@am_unit_experimental_channel_traits_OBJECTS = \
+@HAVE_CXX11_TRUE@ unit/experimental/channel_traits.$(OBJEXT)
+unit_experimental_channel_traits_OBJECTS = \
+ $(am_unit_experimental_channel_traits_OBJECTS)
+unit_experimental_channel_traits_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_channel_traits_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__unit_experimental_co_composed_SOURCES_DIST = \
+ unit/experimental/co_composed.cpp
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am_unit_experimental_co_composed_OBJECTS = unit/experimental/co_composed.$(OBJEXT)
+unit_experimental_co_composed_OBJECTS = \
+ $(am_unit_experimental_co_composed_OBJECTS)
+unit_experimental_co_composed_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_co_composed_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__unit_experimental_concurrent_channel_SOURCES_DIST = \
+ unit/experimental/concurrent_channel.cpp
+@HAVE_CXX11_TRUE@am_unit_experimental_concurrent_channel_OBJECTS = unit/experimental/concurrent_channel.$(OBJEXT)
+unit_experimental_concurrent_channel_OBJECTS = \
+ $(am_unit_experimental_concurrent_channel_OBJECTS)
+unit_experimental_concurrent_channel_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_concurrent_channel_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__unit_experimental_coro_allocator_SOURCES_DIST = \
+ unit/experimental/coro/allocator.cpp
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am_unit_experimental_coro_allocator_OBJECTS = unit/experimental/coro/allocator.$(OBJEXT)
+unit_experimental_coro_allocator_OBJECTS = \
+ $(am_unit_experimental_coro_allocator_OBJECTS)
+unit_experimental_coro_allocator_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_coro_allocator_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am__unit_experimental_coro_cancel_SOURCES_DIST = \
unit/experimental/coro/cancel.cpp
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am_unit_experimental_coro_cancel_OBJECTS = unit/experimental/coro/cancel.$(OBJEXT)
@@ -836,6 +939,14 @@ unit_experimental_coro_cancel_OBJECTS = \
unit_experimental_coro_cancel_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_experimental_coro_cancel_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__unit_experimental_coro_co_spawn_SOURCES_DIST = \
+ unit/experimental/coro/co_spawn.cpp
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am_unit_experimental_coro_co_spawn_OBJECTS = unit/experimental/coro/co_spawn.$(OBJEXT)
+unit_experimental_coro_co_spawn_OBJECTS = \
+ $(am_unit_experimental_coro_co_spawn_OBJECTS)
+unit_experimental_coro_co_spawn_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_coro_co_spawn_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am__unit_experimental_coro_exception_SOURCES_DIST = \
unit/experimental/coro/exception.cpp
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am_unit_experimental_coro_exception_OBJECTS = unit/experimental/coro/exception.$(OBJEXT)
@@ -844,6 +955,14 @@ unit_experimental_coro_exception_OBJECTS = \
unit_experimental_coro_exception_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_experimental_coro_exception_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am__unit_experimental_coro_executor_SOURCES_DIST = \
+ unit/experimental/coro/executor.cpp
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am_unit_experimental_coro_executor_OBJECTS = unit/experimental/coro/executor.$(OBJEXT)
+unit_experimental_coro_executor_OBJECTS = \
+ $(am_unit_experimental_coro_executor_OBJECTS)
+unit_experimental_coro_executor_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_coro_executor_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am__unit_experimental_coro_partial_SOURCES_DIST = \
unit/experimental/coro/partial.cpp
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@am_unit_experimental_coro_partial_OBJECTS = unit/experimental/coro/partial.$(OBJEXT)
@@ -876,14 +995,14 @@ unit_experimental_coro_use_coro_OBJECTS = \
unit_experimental_coro_use_coro_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_experimental_coro_use_coro_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
-am__unit_experimental_deferred_SOURCES_DIST = \
- unit/experimental/deferred.cpp
-@HAVE_CXX14_TRUE@am_unit_experimental_deferred_OBJECTS = \
-@HAVE_CXX14_TRUE@ unit/experimental/deferred.$(OBJEXT)
-unit_experimental_deferred_OBJECTS = \
- $(am_unit_experimental_deferred_OBJECTS)
-unit_experimental_deferred_LDADD = $(LDADD)
-@SEPARATE_COMPILATION_TRUE@unit_experimental_deferred_DEPENDENCIES = \
+am__unit_experimental_parallel_group_SOURCES_DIST = \
+ unit/experimental/parallel_group.cpp
+@HAVE_CXX11_TRUE@am_unit_experimental_parallel_group_OBJECTS = \
+@HAVE_CXX11_TRUE@ unit/experimental/parallel_group.$(OBJEXT)
+unit_experimental_parallel_group_OBJECTS = \
+ $(am_unit_experimental_parallel_group_OBJECTS)
+unit_experimental_parallel_group_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_experimental_parallel_group_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
am__unit_experimental_promise_SOURCES_DIST = \
unit/experimental/promise.cpp
@@ -894,6 +1013,10 @@ unit_experimental_promise_OBJECTS = \
unit_experimental_promise_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_experimental_promise_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_file_base_OBJECTS = unit/file_base.$(OBJEXT)
+unit_file_base_OBJECTS = $(am_unit_file_base_OBJECTS)
+unit_file_base_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_file_base_DEPENDENCIES = libasio.a
am_unit_generic_basic_endpoint_OBJECTS = \
unit/generic/basic_endpoint.$(OBJEXT)
unit_generic_basic_endpoint_OBJECTS = \
@@ -1094,6 +1217,13 @@ unit_local_datagram_protocol_OBJECTS = \
unit_local_datagram_protocol_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_local_datagram_protocol_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_local_seq_packet_protocol_OBJECTS = \
+ unit/local/seq_packet_protocol.$(OBJEXT)
+unit_local_seq_packet_protocol_OBJECTS = \
+ $(am_unit_local_seq_packet_protocol_OBJECTS)
+unit_local_seq_packet_protocol_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_local_seq_packet_protocol_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_local_stream_protocol_OBJECTS = \
unit/local/stream_protocol.$(OBJEXT)
unit_local_stream_protocol_OBJECTS = \
@@ -1147,6 +1277,17 @@ am_unit_post_OBJECTS = unit/post.$(OBJEXT)
unit_post_OBJECTS = $(am_unit_post_OBJECTS)
unit_post_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_post_DEPENDENCIES = libasio.a
+am_unit_prepend_OBJECTS = unit/prepend.$(OBJEXT)
+unit_prepend_OBJECTS = $(am_unit_prepend_OBJECTS)
+unit_prepend_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_prepend_DEPENDENCIES = libasio.a
+am_unit_random_access_file_OBJECTS = \
+ unit/random_access_file.$(OBJEXT)
+unit_random_access_file_OBJECTS = \
+ $(am_unit_random_access_file_OBJECTS)
+unit_random_access_file_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_random_access_file_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_read_OBJECTS = unit/read.$(OBJEXT)
unit_read_OBJECTS = $(am_unit_read_OBJECTS)
unit_read_LDADD = $(LDADD)
@@ -1159,11 +1300,28 @@ am_unit_read_until_OBJECTS = unit/read_until.$(OBJEXT)
unit_read_until_OBJECTS = $(am_unit_read_until_OBJECTS)
unit_read_until_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_read_until_DEPENDENCIES = libasio.a
+am_unit_readable_pipe_OBJECTS = unit/readable_pipe.$(OBJEXT)
+unit_readable_pipe_OBJECTS = $(am_unit_readable_pipe_OBJECTS)
+unit_readable_pipe_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_readable_pipe_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_recycling_allocator_OBJECTS = \
+ unit/recycling_allocator.$(OBJEXT)
+unit_recycling_allocator_OBJECTS = \
+ $(am_unit_recycling_allocator_OBJECTS)
+unit_recycling_allocator_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_recycling_allocator_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_redirect_error_OBJECTS = unit/redirect_error.$(OBJEXT)
unit_redirect_error_OBJECTS = $(am_unit_redirect_error_OBJECTS)
unit_redirect_error_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_redirect_error_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_registered_buffer_OBJECTS = unit/registered_buffer.$(OBJEXT)
+unit_registered_buffer_OBJECTS = $(am_unit_registered_buffer_OBJECTS)
+unit_registered_buffer_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_registered_buffer_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_serial_port_OBJECTS = unit/serial_port.$(OBJEXT)
unit_serial_port_OBJECTS = $(am_unit_serial_port_OBJECTS)
unit_serial_port_LDADD = $(LDADD)
@@ -1177,6 +1335,11 @@ am_unit_signal_set_OBJECTS = unit/signal_set.$(OBJEXT)
unit_signal_set_OBJECTS = $(am_unit_signal_set_OBJECTS)
unit_signal_set_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_signal_set_DEPENDENCIES = libasio.a
+am_unit_signal_set_base_OBJECTS = unit/signal_set_base.$(OBJEXT)
+unit_signal_set_base_OBJECTS = $(am_unit_signal_set_base_OBJECTS)
+unit_signal_set_base_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_signal_set_base_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_socket_base_OBJECTS = unit/socket_base.$(OBJEXT)
unit_socket_base_OBJECTS = $(am_unit_socket_base_OBJECTS)
unit_socket_base_LDADD = $(LDADD)
@@ -1246,6 +1409,10 @@ am_unit_strand_OBJECTS = unit/strand.$(OBJEXT)
unit_strand_OBJECTS = $(am_unit_strand_OBJECTS)
unit_strand_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_strand_DEPENDENCIES = libasio.a
+am_unit_stream_file_OBJECTS = unit/stream_file.$(OBJEXT)
+unit_stream_file_OBJECTS = $(am_unit_stream_file_OBJECTS)
+unit_stream_file_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_stream_file_DEPENDENCIES = libasio.a
am_unit_streambuf_OBJECTS = unit/streambuf.$(OBJEXT)
unit_streambuf_OBJECTS = $(am_unit_streambuf_OBJECTS)
unit_streambuf_LDADD = $(LDADD)
@@ -1394,6 +1561,11 @@ unit_windows_stream_handle_OBJECTS = \
unit_windows_stream_handle_LDADD = $(LDADD)
@SEPARATE_COMPILATION_TRUE@unit_windows_stream_handle_DEPENDENCIES = \
@SEPARATE_COMPILATION_TRUE@ libasio.a
+am_unit_writable_pipe_OBJECTS = unit/writable_pipe.$(OBJEXT)
+unit_writable_pipe_OBJECTS = $(am_unit_writable_pipe_OBJECTS)
+unit_writable_pipe_LDADD = $(LDADD)
+@SEPARATE_COMPILATION_TRUE@unit_writable_pipe_DEPENDENCIES = \
+@SEPARATE_COMPILATION_TRUE@ libasio.a
am_unit_write_OBJECTS = unit/write.$(OBJEXT)
unit_write_OBJECTS = $(am_unit_write_OBJECTS)
unit_write_LDADD = $(LDADD)
@@ -1424,24 +1596,37 @@ am__depfiles_remade = ../$(DEPDIR)/asio.Po ../$(DEPDIR)/asio_ssl.Po \
latency/$(DEPDIR)/udp_server.Po \
performance/$(DEPDIR)/client.Po \
performance/$(DEPDIR)/server.Po \
+ unit/$(DEPDIR)/any_completion_executor.Po \
+ unit/$(DEPDIR)/any_completion_handler.Po \
+ unit/$(DEPDIR)/any_io_executor.Po unit/$(DEPDIR)/append.Po \
+ unit/$(DEPDIR)/as_tuple.Po \
unit/$(DEPDIR)/associated_allocator.Po \
unit/$(DEPDIR)/associated_cancellation_slot.Po \
unit/$(DEPDIR)/associated_executor.Po \
+ unit/$(DEPDIR)/associated_immediate_executor.Po \
unit/$(DEPDIR)/associator.Po unit/$(DEPDIR)/async_result.Po \
unit/$(DEPDIR)/awaitable.Po \
unit/$(DEPDIR)/basic_datagram_socket.Po \
unit/$(DEPDIR)/basic_deadline_timer.Po \
+ unit/$(DEPDIR)/basic_file.Po \
+ unit/$(DEPDIR)/basic_random_access_file.Po \
unit/$(DEPDIR)/basic_raw_socket.Po \
+ unit/$(DEPDIR)/basic_readable_pipe.Po \
unit/$(DEPDIR)/basic_seq_packet_socket.Po \
unit/$(DEPDIR)/basic_serial_port.Po \
unit/$(DEPDIR)/basic_signal_set.Po \
unit/$(DEPDIR)/basic_socket.Po \
unit/$(DEPDIR)/basic_socket_acceptor.Po \
+ unit/$(DEPDIR)/basic_stream_file.Po \
unit/$(DEPDIR)/basic_stream_socket.Po \
unit/$(DEPDIR)/basic_streambuf.Po \
unit/$(DEPDIR)/basic_waitable_timer.Po \
+ unit/$(DEPDIR)/basic_writable_pipe.Po \
+ unit/$(DEPDIR)/bind_allocator.Po \
unit/$(DEPDIR)/bind_cancellation_slot.Po \
- unit/$(DEPDIR)/bind_executor.Po unit/$(DEPDIR)/buffer.Po \
+ unit/$(DEPDIR)/bind_executor.Po \
+ unit/$(DEPDIR)/bind_immediate_executor.Po \
+ unit/$(DEPDIR)/buffer.Po unit/$(DEPDIR)/buffer_registration.Po \
unit/$(DEPDIR)/buffered_read_stream.Po \
unit/$(DEPDIR)/buffered_stream.Po \
unit/$(DEPDIR)/buffered_write_stream.Po \
@@ -1451,61 +1636,66 @@ am__depfiles_remade = ../$(DEPDIR)/asio.Po ../$(DEPDIR)/asio_ssl.Po \
unit/$(DEPDIR)/cancellation_type.Po unit/$(DEPDIR)/co_spawn.Po \
unit/$(DEPDIR)/completion_condition.Po \
unit/$(DEPDIR)/compose.Po unit/$(DEPDIR)/connect.Po \
+ unit/$(DEPDIR)/connect_pipe.Po unit/$(DEPDIR)/consign.Po \
unit/$(DEPDIR)/coroutine.Po unit/$(DEPDIR)/deadline_timer.Po \
- unit/$(DEPDIR)/defer.Po unit/$(DEPDIR)/detached.Po \
- unit/$(DEPDIR)/dispatch.Po unit/$(DEPDIR)/error.Po \
- unit/$(DEPDIR)/execution_context.Po unit/$(DEPDIR)/executor.Po \
+ unit/$(DEPDIR)/defer.Po unit/$(DEPDIR)/deferred.Po \
+ unit/$(DEPDIR)/detached.Po unit/$(DEPDIR)/dispatch.Po \
+ unit/$(DEPDIR)/error.Po unit/$(DEPDIR)/execution_context.Po \
+ unit/$(DEPDIR)/executor.Po \
unit/$(DEPDIR)/executor_work_guard.Po \
+ unit/$(DEPDIR)/file_base.Po \
unit/$(DEPDIR)/high_resolution_timer.Po \
unit/$(DEPDIR)/io_context.Po \
unit/$(DEPDIR)/io_context_strand.Po \
unit/$(DEPDIR)/is_read_buffered.Po \
unit/$(DEPDIR)/is_write_buffered.Po \
unit/$(DEPDIR)/packaged_task.Po unit/$(DEPDIR)/placeholders.Po \
- unit/$(DEPDIR)/post.Po unit/$(DEPDIR)/read.Po \
+ unit/$(DEPDIR)/post.Po unit/$(DEPDIR)/prepend.Po \
+ unit/$(DEPDIR)/random_access_file.Po unit/$(DEPDIR)/read.Po \
unit/$(DEPDIR)/read_at.Po unit/$(DEPDIR)/read_until.Po \
- unit/$(DEPDIR)/redirect_error.Po unit/$(DEPDIR)/serial_port.Po \
+ unit/$(DEPDIR)/readable_pipe.Po \
+ unit/$(DEPDIR)/recycling_allocator.Po \
+ unit/$(DEPDIR)/redirect_error.Po \
+ unit/$(DEPDIR)/registered_buffer.Po \
+ unit/$(DEPDIR)/serial_port.Po \
unit/$(DEPDIR)/serial_port_base.Po \
- unit/$(DEPDIR)/signal_set.Po unit/$(DEPDIR)/socket_base.Po \
+ unit/$(DEPDIR)/signal_set.Po unit/$(DEPDIR)/signal_set_base.Po \
+ unit/$(DEPDIR)/socket_base.Po \
unit/$(DEPDIR)/static_thread_pool.Po \
unit/$(DEPDIR)/steady_timer.Po unit/$(DEPDIR)/strand.Po \
- unit/$(DEPDIR)/streambuf.Po unit/$(DEPDIR)/system_context.Po \
+ unit/$(DEPDIR)/stream_file.Po unit/$(DEPDIR)/streambuf.Po \
+ unit/$(DEPDIR)/system_context.Po \
unit/$(DEPDIR)/system_executor.Po \
unit/$(DEPDIR)/system_timer.Po unit/$(DEPDIR)/this_coro.Po \
unit/$(DEPDIR)/thread.Po unit/$(DEPDIR)/thread_pool.Po \
unit/$(DEPDIR)/time_traits.Po unit/$(DEPDIR)/use_awaitable.Po \
unit/$(DEPDIR)/use_future.Po unit/$(DEPDIR)/uses_executor.Po \
- unit/$(DEPDIR)/wait_traits.Po unit/$(DEPDIR)/write.Po \
- unit/$(DEPDIR)/write_at.Po \
+ unit/$(DEPDIR)/wait_traits.Po unit/$(DEPDIR)/writable_pipe.Po \
+ unit/$(DEPDIR)/write.Po unit/$(DEPDIR)/write_at.Po \
unit/execution/$(DEPDIR)/any_executor.Po \
unit/execution/$(DEPDIR)/blocking.Po \
unit/execution/$(DEPDIR)/blocking_adaptation.Po \
- unit/execution/$(DEPDIR)/bulk_execute.Po \
- unit/execution/$(DEPDIR)/bulk_guarantee.Po \
- unit/execution/$(DEPDIR)/connect.Po \
unit/execution/$(DEPDIR)/context_as.Po \
- unit/execution/$(DEPDIR)/execute.Po \
unit/execution/$(DEPDIR)/executor.Po \
unit/execution/$(DEPDIR)/invocable_archetype.Po \
unit/execution/$(DEPDIR)/mapping.Po \
- unit/execution/$(DEPDIR)/operation_state.Po \
unit/execution/$(DEPDIR)/outstanding_work.Po \
unit/execution/$(DEPDIR)/prefer_only.Po \
- unit/execution/$(DEPDIR)/receiver.Po \
unit/execution/$(DEPDIR)/relationship.Po \
- unit/execution/$(DEPDIR)/schedule.Po \
- unit/execution/$(DEPDIR)/scheduler.Po \
- unit/execution/$(DEPDIR)/sender.Po \
- unit/execution/$(DEPDIR)/set_done.Po \
- unit/execution/$(DEPDIR)/set_error.Po \
- unit/execution/$(DEPDIR)/set_value.Po \
- unit/execution/$(DEPDIR)/start.Po \
- unit/execution/$(DEPDIR)/submit.Po \
unit/experimental/$(DEPDIR)/awaitable_operators.Po \
- unit/experimental/$(DEPDIR)/deferred.Po \
+ unit/experimental/$(DEPDIR)/basic_channel.Po \
+ unit/experimental/$(DEPDIR)/basic_concurrent_channel.Po \
+ unit/experimental/$(DEPDIR)/channel.Po \
+ unit/experimental/$(DEPDIR)/channel_traits.Po \
+ unit/experimental/$(DEPDIR)/co_composed.Po \
+ unit/experimental/$(DEPDIR)/concurrent_channel.Po \
+ unit/experimental/$(DEPDIR)/parallel_group.Po \
unit/experimental/$(DEPDIR)/promise.Po \
+ unit/experimental/coro/$(DEPDIR)/allocator.Po \
unit/experimental/coro/$(DEPDIR)/cancel.Po \
+ unit/experimental/coro/$(DEPDIR)/co_spawn.Po \
unit/experimental/coro/$(DEPDIR)/exception.Po \
+ unit/experimental/coro/$(DEPDIR)/executor.Po \
unit/experimental/coro/$(DEPDIR)/partial.Po \
unit/experimental/coro/$(DEPDIR)/simple_test.Po \
unit/experimental/coro/$(DEPDIR)/stack_test.Po \
@@ -1535,6 +1725,7 @@ am__depfiles_remade = ../$(DEPDIR)/asio.Po ../$(DEPDIR)/asio_ssl.Po \
unit/local/$(DEPDIR)/basic_endpoint.Po \
unit/local/$(DEPDIR)/connect_pair.Po \
unit/local/$(DEPDIR)/datagram_protocol.Po \
+ unit/local/$(DEPDIR)/seq_packet_protocol.Po \
unit/local/$(DEPDIR)/stream_protocol.Po \
unit/posix/$(DEPDIR)/basic_descriptor.Po \
unit/posix/$(DEPDIR)/basic_stream_descriptor.Po \
@@ -1577,22 +1768,35 @@ SOURCES = $(libasio_a_SOURCES) $(latency_tcp_client_SOURCES) \
$(latency_tcp_server_SOURCES) $(latency_udp_client_SOURCES) \
$(latency_udp_server_SOURCES) $(performance_client_SOURCES) \
$(performance_server_SOURCES) \
- $(unit_associated_allocator_SOURCES) \
+ $(unit_any_completion_executor_SOURCES) \
+ $(unit_any_completion_handler_SOURCES) \
+ $(unit_any_io_executor_SOURCES) $(unit_append_SOURCES) \
+ $(unit_as_tuple_SOURCES) $(unit_associated_allocator_SOURCES) \
$(unit_associated_cancellation_slot_SOURCES) \
- $(unit_associated_executor_SOURCES) $(unit_associator_SOURCES) \
- $(unit_async_result_SOURCES) $(unit_awaitable_SOURCES) \
+ $(unit_associated_executor_SOURCES) \
+ $(unit_associated_immediate_executor_SOURCES) \
+ $(unit_associator_SOURCES) $(unit_async_result_SOURCES) \
+ $(unit_awaitable_SOURCES) \
$(unit_basic_datagram_socket_SOURCES) \
$(unit_basic_deadline_timer_SOURCES) \
+ $(unit_basic_file_SOURCES) \
+ $(unit_basic_random_access_file_SOURCES) \
$(unit_basic_raw_socket_SOURCES) \
+ $(unit_basic_readable_pipe_SOURCES) \
$(unit_basic_seq_packet_socket_SOURCES) \
$(unit_basic_serial_port_SOURCES) \
$(unit_basic_signal_set_SOURCES) $(unit_basic_socket_SOURCES) \
$(unit_basic_socket_acceptor_SOURCES) \
+ $(unit_basic_stream_file_SOURCES) \
$(unit_basic_stream_socket_SOURCES) \
$(unit_basic_streambuf_SOURCES) \
$(unit_basic_waitable_timer_SOURCES) \
+ $(unit_basic_writable_pipe_SOURCES) \
+ $(unit_bind_allocator_SOURCES) \
$(unit_bind_cancellation_slot_SOURCES) \
- $(unit_bind_executor_SOURCES) $(unit_buffer_SOURCES) \
+ $(unit_bind_executor_SOURCES) \
+ $(unit_bind_immediate_executor_SOURCES) $(unit_buffer_SOURCES) \
+ $(unit_buffer_registration_SOURCES) \
$(unit_buffered_read_stream_SOURCES) \
$(unit_buffered_stream_SOURCES) \
$(unit_buffered_write_stream_SOURCES) \
@@ -1601,44 +1805,41 @@ SOURCES = $(libasio_a_SOURCES) $(latency_tcp_client_SOURCES) \
$(unit_cancellation_state_SOURCES) \
$(unit_cancellation_type_SOURCES) $(unit_co_spawn_SOURCES) \
$(unit_completion_condition_SOURCES) $(unit_compose_SOURCES) \
- $(unit_connect_SOURCES) $(unit_coroutine_SOURCES) \
+ $(unit_connect_SOURCES) $(unit_connect_pipe_SOURCES) \
+ $(unit_consign_SOURCES) $(unit_coroutine_SOURCES) \
$(unit_deadline_timer_SOURCES) $(unit_defer_SOURCES) \
- $(unit_detached_SOURCES) $(unit_dispatch_SOURCES) \
- $(unit_error_SOURCES) $(unit_execution_any_executor_SOURCES) \
+ $(unit_deferred_SOURCES) $(unit_detached_SOURCES) \
+ $(unit_dispatch_SOURCES) $(unit_error_SOURCES) \
+ $(unit_execution_any_executor_SOURCES) \
$(unit_execution_blocking_SOURCES) \
$(unit_execution_blocking_adaptation_SOURCES) \
- $(unit_execution_bulk_execute_SOURCES) \
- $(unit_execution_bulk_guarantee_SOURCES) \
- $(unit_execution_connect_SOURCES) \
$(unit_execution_context_as_SOURCES) \
- $(unit_execution_execute_SOURCES) \
$(unit_execution_executor_SOURCES) \
$(unit_execution_invocable_archetype_SOURCES) \
$(unit_execution_mapping_SOURCES) \
- $(unit_execution_operation_state_SOURCES) \
$(unit_execution_outstanding_work_SOURCES) \
$(unit_execution_prefer_only_SOURCES) \
- $(unit_execution_receiver_SOURCES) \
$(unit_execution_relationship_SOURCES) \
- $(unit_execution_schedule_SOURCES) \
- $(unit_execution_scheduler_SOURCES) \
- $(unit_execution_sender_SOURCES) \
- $(unit_execution_set_done_SOURCES) \
- $(unit_execution_set_error_SOURCES) \
- $(unit_execution_set_value_SOURCES) \
- $(unit_execution_start_SOURCES) \
- $(unit_execution_submit_SOURCES) \
$(unit_execution_context_SOURCES) $(unit_executor_SOURCES) \
$(unit_executor_work_guard_SOURCES) \
$(unit_experimental_awaitable_operators_SOURCES) \
+ $(unit_experimental_basic_channel_SOURCES) \
+ $(unit_experimental_basic_concurrent_channel_SOURCES) \
+ $(unit_experimental_channel_SOURCES) \
+ $(unit_experimental_channel_traits_SOURCES) \
+ $(unit_experimental_co_composed_SOURCES) \
+ $(unit_experimental_concurrent_channel_SOURCES) \
+ $(unit_experimental_coro_allocator_SOURCES) \
$(unit_experimental_coro_cancel_SOURCES) \
+ $(unit_experimental_coro_co_spawn_SOURCES) \
$(unit_experimental_coro_exception_SOURCES) \
+ $(unit_experimental_coro_executor_SOURCES) \
$(unit_experimental_coro_partial_SOURCES) \
$(unit_experimental_coro_simple_test_SOURCES) \
$(unit_experimental_coro_stack_test_SOURCES) \
$(unit_experimental_coro_use_coro_SOURCES) \
- $(unit_experimental_deferred_SOURCES) \
- $(unit_experimental_promise_SOURCES) \
+ $(unit_experimental_parallel_group_SOURCES) \
+ $(unit_experimental_promise_SOURCES) $(unit_file_base_SOURCES) \
$(unit_generic_basic_endpoint_SOURCES) \
$(unit_generic_datagram_protocol_SOURCES) \
$(unit_generic_raw_protocol_SOURCES) \
@@ -1667,6 +1868,7 @@ SOURCES = $(libasio_a_SOURCES) $(latency_tcp_client_SOURCES) \
$(unit_local_basic_endpoint_SOURCES) \
$(unit_local_connect_pair_SOURCES) \
$(unit_local_datagram_protocol_SOURCES) \
+ $(unit_local_seq_packet_protocol_SOURCES) \
$(unit_local_stream_protocol_SOURCES) \
$(unit_packaged_task_SOURCES) $(unit_placeholders_SOURCES) \
$(unit_posix_basic_descriptor_SOURCES) \
@@ -1674,10 +1876,14 @@ SOURCES = $(libasio_a_SOURCES) $(latency_tcp_client_SOURCES) \
$(unit_posix_descriptor_SOURCES) \
$(unit_posix_descriptor_base_SOURCES) \
$(unit_posix_stream_descriptor_SOURCES) $(unit_post_SOURCES) \
+ $(unit_prepend_SOURCES) $(unit_random_access_file_SOURCES) \
$(unit_read_SOURCES) $(unit_read_at_SOURCES) \
- $(unit_read_until_SOURCES) $(unit_redirect_error_SOURCES) \
- $(unit_serial_port_SOURCES) $(unit_serial_port_base_SOURCES) \
- $(unit_signal_set_SOURCES) $(unit_socket_base_SOURCES) \
+ $(unit_read_until_SOURCES) $(unit_readable_pipe_SOURCES) \
+ $(unit_recycling_allocator_SOURCES) \
+ $(unit_redirect_error_SOURCES) \
+ $(unit_registered_buffer_SOURCES) $(unit_serial_port_SOURCES) \
+ $(unit_serial_port_base_SOURCES) $(unit_signal_set_SOURCES) \
+ $(unit_signal_set_base_SOURCES) $(unit_socket_base_SOURCES) \
$(unit_ssl_context_SOURCES) $(unit_ssl_context_base_SOURCES) \
$(unit_ssl_error_SOURCES) \
$(unit_ssl_host_name_verification_SOURCES) \
@@ -1685,16 +1891,17 @@ SOURCES = $(libasio_a_SOURCES) $(latency_tcp_client_SOURCES) \
$(unit_ssl_stream_SOURCES) $(unit_ssl_stream_base_SOURCES) \
$(unit_static_thread_pool_SOURCES) \
$(unit_steady_timer_SOURCES) $(unit_strand_SOURCES) \
- $(unit_streambuf_SOURCES) $(unit_system_context_SOURCES) \
- $(unit_system_executor_SOURCES) $(unit_system_timer_SOURCES) \
- $(unit_this_coro_SOURCES) $(unit_thread_SOURCES) \
- $(unit_thread_pool_SOURCES) $(unit_time_traits_SOURCES) \
- $(unit_ts_buffer_SOURCES) $(unit_ts_executor_SOURCES) \
- $(unit_ts_internet_SOURCES) $(unit_ts_io_context_SOURCES) \
- $(unit_ts_net_SOURCES) $(unit_ts_netfwd_SOURCES) \
- $(unit_ts_socket_SOURCES) $(unit_ts_timer_SOURCES) \
- $(unit_use_awaitable_SOURCES) $(unit_use_future_SOURCES) \
- $(unit_uses_executor_SOURCES) $(unit_wait_traits_SOURCES) \
+ $(unit_stream_file_SOURCES) $(unit_streambuf_SOURCES) \
+ $(unit_system_context_SOURCES) $(unit_system_executor_SOURCES) \
+ $(unit_system_timer_SOURCES) $(unit_this_coro_SOURCES) \
+ $(unit_thread_SOURCES) $(unit_thread_pool_SOURCES) \
+ $(unit_time_traits_SOURCES) $(unit_ts_buffer_SOURCES) \
+ $(unit_ts_executor_SOURCES) $(unit_ts_internet_SOURCES) \
+ $(unit_ts_io_context_SOURCES) $(unit_ts_net_SOURCES) \
+ $(unit_ts_netfwd_SOURCES) $(unit_ts_socket_SOURCES) \
+ $(unit_ts_timer_SOURCES) $(unit_use_awaitable_SOURCES) \
+ $(unit_use_future_SOURCES) $(unit_uses_executor_SOURCES) \
+ $(unit_wait_traits_SOURCES) \
$(unit_windows_basic_object_handle_SOURCES) \
$(unit_windows_basic_overlapped_handle_SOURCES) \
$(unit_windows_basic_random_access_handle_SOURCES) \
@@ -1703,7 +1910,8 @@ SOURCES = $(libasio_a_SOURCES) $(latency_tcp_client_SOURCES) \
$(unit_windows_overlapped_handle_SOURCES) \
$(unit_windows_overlapped_ptr_SOURCES) \
$(unit_windows_random_access_handle_SOURCES) \
- $(unit_windows_stream_handle_SOURCES) $(unit_write_SOURCES) \
+ $(unit_windows_stream_handle_SOURCES) \
+ $(unit_writable_pipe_SOURCES) $(unit_write_SOURCES) \
$(unit_write_at_SOURCES)
DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(am__latency_tcp_client_SOURCES_DIST) \
@@ -1712,22 +1920,35 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(am__latency_udp_server_SOURCES_DIST) \
$(am__performance_client_SOURCES_DIST) \
$(am__performance_server_SOURCES_DIST) \
- $(unit_associated_allocator_SOURCES) \
+ $(unit_any_completion_executor_SOURCES) \
+ $(unit_any_completion_handler_SOURCES) \
+ $(unit_any_io_executor_SOURCES) $(unit_append_SOURCES) \
+ $(unit_as_tuple_SOURCES) $(unit_associated_allocator_SOURCES) \
$(unit_associated_cancellation_slot_SOURCES) \
- $(unit_associated_executor_SOURCES) $(unit_associator_SOURCES) \
- $(unit_async_result_SOURCES) $(unit_awaitable_SOURCES) \
+ $(unit_associated_executor_SOURCES) \
+ $(unit_associated_immediate_executor_SOURCES) \
+ $(unit_associator_SOURCES) $(unit_async_result_SOURCES) \
+ $(unit_awaitable_SOURCES) \
$(unit_basic_datagram_socket_SOURCES) \
$(unit_basic_deadline_timer_SOURCES) \
+ $(unit_basic_file_SOURCES) \
+ $(unit_basic_random_access_file_SOURCES) \
$(unit_basic_raw_socket_SOURCES) \
+ $(unit_basic_readable_pipe_SOURCES) \
$(unit_basic_seq_packet_socket_SOURCES) \
$(unit_basic_serial_port_SOURCES) \
$(unit_basic_signal_set_SOURCES) $(unit_basic_socket_SOURCES) \
$(unit_basic_socket_acceptor_SOURCES) \
+ $(unit_basic_stream_file_SOURCES) \
$(unit_basic_stream_socket_SOURCES) \
$(unit_basic_streambuf_SOURCES) \
$(unit_basic_waitable_timer_SOURCES) \
+ $(unit_basic_writable_pipe_SOURCES) \
+ $(unit_bind_allocator_SOURCES) \
$(unit_bind_cancellation_slot_SOURCES) \
- $(unit_bind_executor_SOURCES) $(unit_buffer_SOURCES) \
+ $(unit_bind_executor_SOURCES) \
+ $(unit_bind_immediate_executor_SOURCES) $(unit_buffer_SOURCES) \
+ $(unit_buffer_registration_SOURCES) \
$(unit_buffered_read_stream_SOURCES) \
$(unit_buffered_stream_SOURCES) \
$(unit_buffered_write_stream_SOURCES) \
@@ -1736,44 +1957,42 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(unit_cancellation_state_SOURCES) \
$(unit_cancellation_type_SOURCES) $(unit_co_spawn_SOURCES) \
$(unit_completion_condition_SOURCES) $(unit_compose_SOURCES) \
- $(unit_connect_SOURCES) $(unit_coroutine_SOURCES) \
+ $(unit_connect_SOURCES) $(unit_connect_pipe_SOURCES) \
+ $(unit_consign_SOURCES) $(unit_coroutine_SOURCES) \
$(unit_deadline_timer_SOURCES) $(unit_defer_SOURCES) \
- $(unit_detached_SOURCES) $(unit_dispatch_SOURCES) \
- $(unit_error_SOURCES) $(unit_execution_any_executor_SOURCES) \
+ $(unit_deferred_SOURCES) $(unit_detached_SOURCES) \
+ $(unit_dispatch_SOURCES) $(unit_error_SOURCES) \
+ $(unit_execution_any_executor_SOURCES) \
$(unit_execution_blocking_SOURCES) \
$(unit_execution_blocking_adaptation_SOURCES) \
- $(unit_execution_bulk_execute_SOURCES) \
- $(unit_execution_bulk_guarantee_SOURCES) \
- $(unit_execution_connect_SOURCES) \
$(unit_execution_context_as_SOURCES) \
- $(unit_execution_execute_SOURCES) \
$(unit_execution_executor_SOURCES) \
$(unit_execution_invocable_archetype_SOURCES) \
$(unit_execution_mapping_SOURCES) \
- $(unit_execution_operation_state_SOURCES) \
$(unit_execution_outstanding_work_SOURCES) \
$(unit_execution_prefer_only_SOURCES) \
- $(unit_execution_receiver_SOURCES) \
$(unit_execution_relationship_SOURCES) \
- $(unit_execution_schedule_SOURCES) \
- $(unit_execution_scheduler_SOURCES) \
- $(unit_execution_sender_SOURCES) \
- $(unit_execution_set_done_SOURCES) \
- $(unit_execution_set_error_SOURCES) \
- $(unit_execution_set_value_SOURCES) \
- $(unit_execution_start_SOURCES) \
- $(unit_execution_submit_SOURCES) \
$(unit_execution_context_SOURCES) $(unit_executor_SOURCES) \
$(unit_executor_work_guard_SOURCES) \
$(am__unit_experimental_awaitable_operators_SOURCES_DIST) \
+ $(am__unit_experimental_basic_channel_SOURCES_DIST) \
+ $(am__unit_experimental_basic_concurrent_channel_SOURCES_DIST) \
+ $(am__unit_experimental_channel_SOURCES_DIST) \
+ $(am__unit_experimental_channel_traits_SOURCES_DIST) \
+ $(am__unit_experimental_co_composed_SOURCES_DIST) \
+ $(am__unit_experimental_concurrent_channel_SOURCES_DIST) \
+ $(am__unit_experimental_coro_allocator_SOURCES_DIST) \
$(am__unit_experimental_coro_cancel_SOURCES_DIST) \
+ $(am__unit_experimental_coro_co_spawn_SOURCES_DIST) \
$(am__unit_experimental_coro_exception_SOURCES_DIST) \
+ $(am__unit_experimental_coro_executor_SOURCES_DIST) \
$(am__unit_experimental_coro_partial_SOURCES_DIST) \
$(am__unit_experimental_coro_simple_test_SOURCES_DIST) \
$(am__unit_experimental_coro_stack_test_SOURCES_DIST) \
$(am__unit_experimental_coro_use_coro_SOURCES_DIST) \
- $(am__unit_experimental_deferred_SOURCES_DIST) \
+ $(am__unit_experimental_parallel_group_SOURCES_DIST) \
$(am__unit_experimental_promise_SOURCES_DIST) \
+ $(unit_file_base_SOURCES) \
$(unit_generic_basic_endpoint_SOURCES) \
$(unit_generic_datagram_protocol_SOURCES) \
$(unit_generic_raw_protocol_SOURCES) \
@@ -1802,6 +2021,7 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(unit_local_basic_endpoint_SOURCES) \
$(unit_local_connect_pair_SOURCES) \
$(unit_local_datagram_protocol_SOURCES) \
+ $(unit_local_seq_packet_protocol_SOURCES) \
$(unit_local_stream_protocol_SOURCES) \
$(unit_packaged_task_SOURCES) $(unit_placeholders_SOURCES) \
$(unit_posix_basic_descriptor_SOURCES) \
@@ -1809,10 +2029,14 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(unit_posix_descriptor_SOURCES) \
$(unit_posix_descriptor_base_SOURCES) \
$(unit_posix_stream_descriptor_SOURCES) $(unit_post_SOURCES) \
+ $(unit_prepend_SOURCES) $(unit_random_access_file_SOURCES) \
$(unit_read_SOURCES) $(unit_read_at_SOURCES) \
- $(unit_read_until_SOURCES) $(unit_redirect_error_SOURCES) \
- $(unit_serial_port_SOURCES) $(unit_serial_port_base_SOURCES) \
- $(unit_signal_set_SOURCES) $(unit_socket_base_SOURCES) \
+ $(unit_read_until_SOURCES) $(unit_readable_pipe_SOURCES) \
+ $(unit_recycling_allocator_SOURCES) \
+ $(unit_redirect_error_SOURCES) \
+ $(unit_registered_buffer_SOURCES) $(unit_serial_port_SOURCES) \
+ $(unit_serial_port_base_SOURCES) $(unit_signal_set_SOURCES) \
+ $(unit_signal_set_base_SOURCES) $(unit_socket_base_SOURCES) \
$(am__unit_ssl_context_SOURCES_DIST) \
$(am__unit_ssl_context_base_SOURCES_DIST) \
$(am__unit_ssl_error_SOURCES_DIST) \
@@ -1822,16 +2046,17 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(am__unit_ssl_stream_base_SOURCES_DIST) \
$(unit_static_thread_pool_SOURCES) \
$(unit_steady_timer_SOURCES) $(unit_strand_SOURCES) \
- $(unit_streambuf_SOURCES) $(unit_system_context_SOURCES) \
- $(unit_system_executor_SOURCES) $(unit_system_timer_SOURCES) \
- $(unit_this_coro_SOURCES) $(unit_thread_SOURCES) \
- $(unit_thread_pool_SOURCES) $(unit_time_traits_SOURCES) \
- $(unit_ts_buffer_SOURCES) $(unit_ts_executor_SOURCES) \
- $(unit_ts_internet_SOURCES) $(unit_ts_io_context_SOURCES) \
- $(unit_ts_net_SOURCES) $(unit_ts_netfwd_SOURCES) \
- $(unit_ts_socket_SOURCES) $(unit_ts_timer_SOURCES) \
- $(unit_use_awaitable_SOURCES) $(unit_use_future_SOURCES) \
- $(unit_uses_executor_SOURCES) $(unit_wait_traits_SOURCES) \
+ $(unit_stream_file_SOURCES) $(unit_streambuf_SOURCES) \
+ $(unit_system_context_SOURCES) $(unit_system_executor_SOURCES) \
+ $(unit_system_timer_SOURCES) $(unit_this_coro_SOURCES) \
+ $(unit_thread_SOURCES) $(unit_thread_pool_SOURCES) \
+ $(unit_time_traits_SOURCES) $(unit_ts_buffer_SOURCES) \
+ $(unit_ts_executor_SOURCES) $(unit_ts_internet_SOURCES) \
+ $(unit_ts_io_context_SOURCES) $(unit_ts_net_SOURCES) \
+ $(unit_ts_netfwd_SOURCES) $(unit_ts_socket_SOURCES) \
+ $(unit_ts_timer_SOURCES) $(unit_use_awaitable_SOURCES) \
+ $(unit_use_future_SOURCES) $(unit_uses_executor_SOURCES) \
+ $(unit_wait_traits_SOURCES) \
$(unit_windows_basic_object_handle_SOURCES) \
$(unit_windows_basic_overlapped_handle_SOURCES) \
$(unit_windows_basic_random_access_handle_SOURCES) \
@@ -1840,7 +2065,8 @@ DIST_SOURCES = $(am__libasio_a_SOURCES_DIST) \
$(unit_windows_overlapped_handle_SOURCES) \
$(unit_windows_overlapped_ptr_SOURCES) \
$(unit_windows_random_access_handle_SOURCES) \
- $(unit_windows_stream_handle_SOURCES) $(unit_write_SOURCES) \
+ $(unit_windows_stream_handle_SOURCES) \
+ $(unit_writable_pipe_SOURCES) $(unit_write_SOURCES) \
$(unit_write_at_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
@@ -1881,8 +2107,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
@@ -2065,6 +2289,7 @@ am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
RECHECK_LOGS = $(TEST_LOGS)
TEST_SUITE_LOG = test-suite.log
TEST_EXTENSIONS = @EXEEXT@ .test
@@ -2126,8 +2351,9 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
-CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -2136,9 +2362,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
-GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -2205,9 +2430,11 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -2233,26 +2460,40 @@ AM_CXXFLAGS = -I$(srcdir)/../../include
@STANDALONE_FALSE@latency_udp_server_SOURCES = latency/udp_server.cpp
@STANDALONE_FALSE@performance_client_SOURCES = performance/client.cpp
@STANDALONE_FALSE@performance_server_SOURCES = performance/server.cpp
+unit_any_completion_executor_SOURCES = unit/any_completion_executor.cpp
+unit_any_completion_handler_SOURCES = unit/any_completion_handler.cpp
+unit_any_io_executor_SOURCES = unit/any_io_executor.cpp
+unit_append_SOURCES = unit/append.cpp
+unit_as_tuple_SOURCES = unit/as_tuple.cpp
unit_associated_allocator_SOURCES = unit/associated_allocator.cpp
unit_associated_cancellation_slot_SOURCES = unit/associated_cancellation_slot.cpp
unit_associated_executor_SOURCES = unit/associated_executor.cpp
+unit_associated_immediate_executor_SOURCES = unit/associated_immediate_executor.cpp
unit_associator_SOURCES = unit/associator.cpp
unit_async_result_SOURCES = unit/async_result.cpp
unit_awaitable_SOURCES = unit/awaitable.cpp
unit_basic_datagram_socket_SOURCES = unit/basic_datagram_socket.cpp
unit_basic_deadline_timer_SOURCES = unit/basic_deadline_timer.cpp
+unit_basic_file_SOURCES = unit/basic_file.cpp
+unit_basic_random_access_file_SOURCES = unit/basic_random_access_file.cpp
unit_basic_raw_socket_SOURCES = unit/basic_raw_socket.cpp
+unit_basic_readable_pipe_SOURCES = unit/basic_readable_pipe.cpp
unit_basic_seq_packet_socket_SOURCES = unit/basic_seq_packet_socket.cpp
unit_basic_serial_port_SOURCES = unit/basic_serial_port.cpp
unit_basic_signal_set_SOURCES = unit/basic_signal_set.cpp
unit_basic_socket_SOURCES = unit/basic_socket.cpp
unit_basic_socket_acceptor_SOURCES = unit/basic_socket_acceptor.cpp
+unit_basic_stream_file_SOURCES = unit/basic_stream_file.cpp
unit_basic_stream_socket_SOURCES = unit/basic_stream_socket.cpp
unit_basic_streambuf_SOURCES = unit/basic_streambuf.cpp
unit_basic_waitable_timer_SOURCES = unit/basic_waitable_timer.cpp
+unit_basic_writable_pipe_SOURCES = unit/basic_writable_pipe.cpp
+unit_bind_allocator_SOURCES = unit/bind_allocator.cpp
unit_bind_cancellation_slot_SOURCES = unit/bind_cancellation_slot.cpp
unit_bind_executor_SOURCES = unit/bind_executor.cpp
+unit_bind_immediate_executor_SOURCES = unit/bind_immediate_executor.cpp
unit_buffer_SOURCES = unit/buffer.cpp
+unit_buffer_registration_SOURCES = unit/buffer_registration.cpp
unit_buffers_iterator_SOURCES = unit/buffers_iterator.cpp
unit_buffered_read_stream_SOURCES = unit/buffered_read_stream.cpp
unit_buffered_stream_SOURCES = unit/buffered_stream.cpp
@@ -2264,39 +2505,29 @@ unit_co_spawn_SOURCES = unit/co_spawn.cpp
unit_completion_condition_SOURCES = unit/completion_condition.cpp
unit_compose_SOURCES = unit/compose.cpp
unit_connect_SOURCES = unit/connect.cpp
+unit_connect_pipe_SOURCES = unit/connect_pipe.cpp
+unit_consign_SOURCES = unit/consign.cpp
unit_coroutine_SOURCES = unit/coroutine.cpp
unit_deadline_timer_SOURCES = unit/deadline_timer.cpp
unit_defer_SOURCES = unit/defer.cpp
+unit_deferred_SOURCES = unit/deferred.cpp
unit_detached_SOURCES = unit/detached.cpp
unit_dispatch_SOURCES = unit/dispatch.cpp
unit_error_SOURCES = unit/error.cpp
unit_execution_any_executor_SOURCES = unit/execution/any_executor.cpp
unit_execution_blocking_SOURCES = unit/execution/blocking.cpp
unit_execution_blocking_adaptation_SOURCES = unit/execution/blocking_adaptation.cpp
-unit_execution_bulk_execute_SOURCES = unit/execution/bulk_execute.cpp
-unit_execution_bulk_guarantee_SOURCES = unit/execution/bulk_guarantee.cpp
-unit_execution_connect_SOURCES = unit/execution/connect.cpp
unit_execution_context_as_SOURCES = unit/execution/context_as.cpp
-unit_execution_execute_SOURCES = unit/execution/execute.cpp
unit_execution_executor_SOURCES = unit/execution/executor.cpp
unit_execution_invocable_archetype_SOURCES = unit/execution/invocable_archetype.cpp
unit_execution_mapping_SOURCES = unit/execution/mapping.cpp
unit_execution_outstanding_work_SOURCES = unit/execution/outstanding_work.cpp
-unit_execution_operation_state_SOURCES = unit/execution/operation_state.cpp
unit_execution_prefer_only_SOURCES = unit/execution/prefer_only.cpp
-unit_execution_receiver_SOURCES = unit/execution/receiver.cpp
unit_execution_relationship_SOURCES = unit/execution/relationship.cpp
-unit_execution_schedule_SOURCES = unit/execution/schedule.cpp
-unit_execution_scheduler_SOURCES = unit/execution/scheduler.cpp
-unit_execution_sender_SOURCES = unit/execution/sender.cpp
-unit_execution_set_done_SOURCES = unit/execution/set_done.cpp
-unit_execution_set_error_SOURCES = unit/execution/set_error.cpp
-unit_execution_set_value_SOURCES = unit/execution/set_value.cpp
-unit_execution_start_SOURCES = unit/execution/start.cpp
-unit_execution_submit_SOURCES = unit/execution/submit.cpp
unit_execution_context_SOURCES = unit/execution_context.cpp
unit_executor_SOURCES = unit/executor.cpp
unit_executor_work_guard_SOURCES = unit/executor_work_guard.cpp
+unit_file_base_SOURCES = unit/file_base.cpp
unit_generic_basic_endpoint_SOURCES = unit/generic/basic_endpoint.cpp
unit_generic_datagram_protocol_SOURCES = unit/generic/datagram_protocol.cpp
unit_generic_raw_protocol_SOURCES = unit/generic/raw_protocol.cpp
@@ -2332,6 +2563,7 @@ unit_is_write_buffered_SOURCES = unit/is_write_buffered.cpp
unit_local_basic_endpoint_SOURCES = unit/local/basic_endpoint.cpp
unit_local_connect_pair_SOURCES = unit/local/connect_pair.cpp
unit_local_datagram_protocol_SOURCES = unit/local/datagram_protocol.cpp
+unit_local_seq_packet_protocol_SOURCES = unit/local/seq_packet_protocol.cpp
unit_local_stream_protocol_SOURCES = unit/local/stream_protocol.cpp
unit_packaged_task_SOURCES = unit/packaged_task.cpp
unit_placeholders_SOURCES = unit/placeholders.cpp
@@ -2341,17 +2573,24 @@ unit_posix_descriptor_SOURCES = unit/posix/descriptor.cpp
unit_posix_descriptor_base_SOURCES = unit/posix/descriptor_base.cpp
unit_posix_stream_descriptor_SOURCES = unit/posix/stream_descriptor.cpp
unit_post_SOURCES = unit/post.cpp
+unit_prepend_SOURCES = unit/prepend.cpp
+unit_random_access_file_SOURCES = unit/random_access_file.cpp
unit_read_SOURCES = unit/read.cpp
unit_read_at_SOURCES = unit/read_at.cpp
unit_read_until_SOURCES = unit/read_until.cpp
+unit_readable_pipe_SOURCES = unit/readable_pipe.cpp
+unit_recycling_allocator_SOURCES = unit/recycling_allocator.cpp
unit_redirect_error_SOURCES = unit/redirect_error.cpp
+unit_registered_buffer_SOURCES = unit/registered_buffer.cpp
unit_serial_port_SOURCES = unit/serial_port.cpp
unit_serial_port_base_SOURCES = unit/serial_port_base.cpp
unit_signal_set_SOURCES = unit/signal_set.cpp
+unit_signal_set_base_SOURCES = unit/signal_set_base.cpp
unit_socket_base_SOURCES = unit/socket_base.cpp
unit_static_thread_pool_SOURCES = unit/static_thread_pool.cpp
unit_steady_timer_SOURCES = unit/steady_timer.cpp
unit_strand_SOURCES = unit/strand.cpp
+unit_stream_file_SOURCES = unit/stream_file.cpp
unit_streambuf_SOURCES = unit/streambuf.cpp
unit_system_context_SOURCES = unit/system_context.cpp
unit_system_executor_SOURCES = unit/system_executor.cpp
@@ -2381,13 +2620,23 @@ unit_windows_overlapped_handle_SOURCES = unit/windows/overlapped_handle.cpp
unit_windows_overlapped_ptr_SOURCES = unit/windows/overlapped_ptr.cpp
unit_windows_random_access_handle_SOURCES = unit/windows/random_access_handle.cpp
unit_windows_stream_handle_SOURCES = unit/windows/stream_handle.cpp
+unit_writable_pipe_SOURCES = unit/writable_pipe.cpp
unit_write_SOURCES = unit/write.cpp
unit_write_at_SOURCES = unit/write_at.cpp
-@HAVE_CXX14_TRUE@unit_experimental_deferred_SOURCES = unit/experimental/deferred.cpp
+@HAVE_CXX11_TRUE@unit_experimental_basic_channel_SOURCES = unit/experimental/basic_channel.cpp
+@HAVE_CXX11_TRUE@unit_experimental_basic_concurrent_channel_SOURCES = unit/experimental/basic_concurrent_channel.cpp
+@HAVE_CXX11_TRUE@unit_experimental_channel_SOURCES = unit/experimental/channel.cpp
+@HAVE_CXX11_TRUE@unit_experimental_channel_traits_SOURCES = unit/experimental/channel_traits.cpp
+@HAVE_CXX11_TRUE@unit_experimental_concurrent_channel_SOURCES = unit/experimental/concurrent_channel.cpp
+@HAVE_CXX11_TRUE@unit_experimental_parallel_group_SOURCES = unit/experimental/parallel_group.cpp
@HAVE_CXX20_TRUE@unit_experimental_promise_SOURCES = unit/experimental/promise.cpp
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_awaitable_operators_SOURCES = unit/experimental/awaitable_operators.cpp
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_co_composed_SOURCES = unit/experimental/co_composed.cpp
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_coro_allocator_SOURCES = unit/experimental/coro/allocator.cpp
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_coro_cancel_SOURCES = unit/experimental/coro/cancel.cpp
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_coro_co_spawn_SOURCES = unit/experimental/coro/co_spawn.cpp
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_coro_exception_SOURCES = unit/experimental/coro/exception.cpp
+@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_coro_executor_SOURCES = unit/experimental/coro/executor.cpp
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_coro_partial_SOURCES = unit/experimental/coro/partial.cpp
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_coro_simple_test_SOURCES = unit/experimental/coro/simple_test.cpp
@HAVE_COROUTINES_TRUE@@HAVE_CXX20_TRUE@unit_experimental_coro_stack_test_SOURCES = unit/experimental/coro/stack_test.cpp
@@ -2520,6 +2769,36 @@ unit/$(am__dirstamp):
unit/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) unit/$(DEPDIR)
@: > unit/$(DEPDIR)/$(am__dirstamp)
+unit/any_completion_executor.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/any_completion_executor$(EXEEXT): $(unit_any_completion_executor_OBJECTS) $(unit_any_completion_executor_DEPENDENCIES) $(EXTRA_unit_any_completion_executor_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/any_completion_executor$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_any_completion_executor_OBJECTS) $(unit_any_completion_executor_LDADD) $(LIBS)
+unit/any_completion_handler.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/any_completion_handler$(EXEEXT): $(unit_any_completion_handler_OBJECTS) $(unit_any_completion_handler_DEPENDENCIES) $(EXTRA_unit_any_completion_handler_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/any_completion_handler$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_any_completion_handler_OBJECTS) $(unit_any_completion_handler_LDADD) $(LIBS)
+unit/any_io_executor.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/any_io_executor$(EXEEXT): $(unit_any_io_executor_OBJECTS) $(unit_any_io_executor_DEPENDENCIES) $(EXTRA_unit_any_io_executor_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/any_io_executor$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_any_io_executor_OBJECTS) $(unit_any_io_executor_LDADD) $(LIBS)
+unit/append.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/append$(EXEEXT): $(unit_append_OBJECTS) $(unit_append_DEPENDENCIES) $(EXTRA_unit_append_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/append$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_append_OBJECTS) $(unit_append_LDADD) $(LIBS)
+unit/as_tuple.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/as_tuple$(EXEEXT): $(unit_as_tuple_OBJECTS) $(unit_as_tuple_DEPENDENCIES) $(EXTRA_unit_as_tuple_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/as_tuple$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_as_tuple_OBJECTS) $(unit_as_tuple_LDADD) $(LIBS)
unit/associated_allocator.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -2538,6 +2817,12 @@ unit/associated_executor.$(OBJEXT): unit/$(am__dirstamp) \
unit/associated_executor$(EXEEXT): $(unit_associated_executor_OBJECTS) $(unit_associated_executor_DEPENDENCIES) $(EXTRA_unit_associated_executor_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/associated_executor$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_associated_executor_OBJECTS) $(unit_associated_executor_LDADD) $(LIBS)
+unit/associated_immediate_executor.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/associated_immediate_executor$(EXEEXT): $(unit_associated_immediate_executor_OBJECTS) $(unit_associated_immediate_executor_DEPENDENCIES) $(EXTRA_unit_associated_immediate_executor_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/associated_immediate_executor$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_associated_immediate_executor_OBJECTS) $(unit_associated_immediate_executor_LDADD) $(LIBS)
unit/associator.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -2568,12 +2853,30 @@ unit/basic_deadline_timer.$(OBJEXT): unit/$(am__dirstamp) \
unit/basic_deadline_timer$(EXEEXT): $(unit_basic_deadline_timer_OBJECTS) $(unit_basic_deadline_timer_DEPENDENCIES) $(EXTRA_unit_basic_deadline_timer_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/basic_deadline_timer$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_basic_deadline_timer_OBJECTS) $(unit_basic_deadline_timer_LDADD) $(LIBS)
+unit/basic_file.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/basic_file$(EXEEXT): $(unit_basic_file_OBJECTS) $(unit_basic_file_DEPENDENCIES) $(EXTRA_unit_basic_file_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/basic_file$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_basic_file_OBJECTS) $(unit_basic_file_LDADD) $(LIBS)
+unit/basic_random_access_file.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/basic_random_access_file$(EXEEXT): $(unit_basic_random_access_file_OBJECTS) $(unit_basic_random_access_file_DEPENDENCIES) $(EXTRA_unit_basic_random_access_file_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/basic_random_access_file$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_basic_random_access_file_OBJECTS) $(unit_basic_random_access_file_LDADD) $(LIBS)
unit/basic_raw_socket.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
unit/basic_raw_socket$(EXEEXT): $(unit_basic_raw_socket_OBJECTS) $(unit_basic_raw_socket_DEPENDENCIES) $(EXTRA_unit_basic_raw_socket_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/basic_raw_socket$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_basic_raw_socket_OBJECTS) $(unit_basic_raw_socket_LDADD) $(LIBS)
+unit/basic_readable_pipe.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/basic_readable_pipe$(EXEEXT): $(unit_basic_readable_pipe_OBJECTS) $(unit_basic_readable_pipe_DEPENDENCIES) $(EXTRA_unit_basic_readable_pipe_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/basic_readable_pipe$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_basic_readable_pipe_OBJECTS) $(unit_basic_readable_pipe_LDADD) $(LIBS)
unit/basic_seq_packet_socket.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -2604,6 +2907,12 @@ unit/basic_socket_acceptor.$(OBJEXT): unit/$(am__dirstamp) \
unit/basic_socket_acceptor$(EXEEXT): $(unit_basic_socket_acceptor_OBJECTS) $(unit_basic_socket_acceptor_DEPENDENCIES) $(EXTRA_unit_basic_socket_acceptor_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/basic_socket_acceptor$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_basic_socket_acceptor_OBJECTS) $(unit_basic_socket_acceptor_LDADD) $(LIBS)
+unit/basic_stream_file.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/basic_stream_file$(EXEEXT): $(unit_basic_stream_file_OBJECTS) $(unit_basic_stream_file_DEPENDENCIES) $(EXTRA_unit_basic_stream_file_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/basic_stream_file$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_basic_stream_file_OBJECTS) $(unit_basic_stream_file_LDADD) $(LIBS)
unit/basic_stream_socket.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -2622,6 +2931,18 @@ unit/basic_waitable_timer.$(OBJEXT): unit/$(am__dirstamp) \
unit/basic_waitable_timer$(EXEEXT): $(unit_basic_waitable_timer_OBJECTS) $(unit_basic_waitable_timer_DEPENDENCIES) $(EXTRA_unit_basic_waitable_timer_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/basic_waitable_timer$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_basic_waitable_timer_OBJECTS) $(unit_basic_waitable_timer_LDADD) $(LIBS)
+unit/basic_writable_pipe.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/basic_writable_pipe$(EXEEXT): $(unit_basic_writable_pipe_OBJECTS) $(unit_basic_writable_pipe_DEPENDENCIES) $(EXTRA_unit_basic_writable_pipe_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/basic_writable_pipe$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_basic_writable_pipe_OBJECTS) $(unit_basic_writable_pipe_LDADD) $(LIBS)
+unit/bind_allocator.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/bind_allocator$(EXEEXT): $(unit_bind_allocator_OBJECTS) $(unit_bind_allocator_DEPENDENCIES) $(EXTRA_unit_bind_allocator_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/bind_allocator$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_bind_allocator_OBJECTS) $(unit_bind_allocator_LDADD) $(LIBS)
unit/bind_cancellation_slot.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -2634,12 +2955,24 @@ unit/bind_executor.$(OBJEXT): unit/$(am__dirstamp) \
unit/bind_executor$(EXEEXT): $(unit_bind_executor_OBJECTS) $(unit_bind_executor_DEPENDENCIES) $(EXTRA_unit_bind_executor_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/bind_executor$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_bind_executor_OBJECTS) $(unit_bind_executor_LDADD) $(LIBS)
+unit/bind_immediate_executor.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/bind_immediate_executor$(EXEEXT): $(unit_bind_immediate_executor_OBJECTS) $(unit_bind_immediate_executor_DEPENDENCIES) $(EXTRA_unit_bind_immediate_executor_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/bind_immediate_executor$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_bind_immediate_executor_OBJECTS) $(unit_bind_immediate_executor_LDADD) $(LIBS)
unit/buffer.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
unit/buffer$(EXEEXT): $(unit_buffer_OBJECTS) $(unit_buffer_DEPENDENCIES) $(EXTRA_unit_buffer_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/buffer$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_buffer_OBJECTS) $(unit_buffer_LDADD) $(LIBS)
+unit/buffer_registration.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/buffer_registration$(EXEEXT): $(unit_buffer_registration_OBJECTS) $(unit_buffer_registration_DEPENDENCIES) $(EXTRA_unit_buffer_registration_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/buffer_registration$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_buffer_registration_OBJECTS) $(unit_buffer_registration_LDADD) $(LIBS)
unit/buffered_read_stream.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -2706,6 +3039,18 @@ unit/connect.$(OBJEXT): unit/$(am__dirstamp) \
unit/connect$(EXEEXT): $(unit_connect_OBJECTS) $(unit_connect_DEPENDENCIES) $(EXTRA_unit_connect_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/connect$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_connect_OBJECTS) $(unit_connect_LDADD) $(LIBS)
+unit/connect_pipe.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/connect_pipe$(EXEEXT): $(unit_connect_pipe_OBJECTS) $(unit_connect_pipe_DEPENDENCIES) $(EXTRA_unit_connect_pipe_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/connect_pipe$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_connect_pipe_OBJECTS) $(unit_connect_pipe_LDADD) $(LIBS)
+unit/consign.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/consign$(EXEEXT): $(unit_consign_OBJECTS) $(unit_consign_DEPENDENCIES) $(EXTRA_unit_consign_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/consign$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_consign_OBJECTS) $(unit_consign_LDADD) $(LIBS)
unit/coroutine.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -2724,6 +3069,12 @@ unit/defer.$(OBJEXT): unit/$(am__dirstamp) \
unit/defer$(EXEEXT): $(unit_defer_OBJECTS) $(unit_defer_DEPENDENCIES) $(EXTRA_unit_defer_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/defer$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_defer_OBJECTS) $(unit_defer_LDADD) $(LIBS)
+unit/deferred.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/deferred$(EXEEXT): $(unit_deferred_OBJECTS) $(unit_deferred_DEPENDENCIES) $(EXTRA_unit_deferred_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/deferred$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_deferred_OBJECTS) $(unit_deferred_LDADD) $(LIBS)
unit/detached.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -2767,37 +3118,12 @@ unit/execution/blocking_adaptation.$(OBJEXT): \
unit/execution/blocking_adaptation$(EXEEXT): $(unit_execution_blocking_adaptation_OBJECTS) $(unit_execution_blocking_adaptation_DEPENDENCIES) $(EXTRA_unit_execution_blocking_adaptation_DEPENDENCIES) unit/execution/$(am__dirstamp)
@rm -f unit/execution/blocking_adaptation$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_execution_blocking_adaptation_OBJECTS) $(unit_execution_blocking_adaptation_LDADD) $(LIBS)
-unit/execution/bulk_execute.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/bulk_execute$(EXEEXT): $(unit_execution_bulk_execute_OBJECTS) $(unit_execution_bulk_execute_DEPENDENCIES) $(EXTRA_unit_execution_bulk_execute_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/bulk_execute$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_bulk_execute_OBJECTS) $(unit_execution_bulk_execute_LDADD) $(LIBS)
-unit/execution/bulk_guarantee.$(OBJEXT): \
- unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/bulk_guarantee$(EXEEXT): $(unit_execution_bulk_guarantee_OBJECTS) $(unit_execution_bulk_guarantee_DEPENDENCIES) $(EXTRA_unit_execution_bulk_guarantee_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/bulk_guarantee$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_bulk_guarantee_OBJECTS) $(unit_execution_bulk_guarantee_LDADD) $(LIBS)
-unit/execution/connect.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/connect$(EXEEXT): $(unit_execution_connect_OBJECTS) $(unit_execution_connect_DEPENDENCIES) $(EXTRA_unit_execution_connect_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/connect$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_connect_OBJECTS) $(unit_execution_connect_LDADD) $(LIBS)
unit/execution/context_as.$(OBJEXT): unit/execution/$(am__dirstamp) \
unit/execution/$(DEPDIR)/$(am__dirstamp)
unit/execution/context_as$(EXEEXT): $(unit_execution_context_as_OBJECTS) $(unit_execution_context_as_DEPENDENCIES) $(EXTRA_unit_execution_context_as_DEPENDENCIES) unit/execution/$(am__dirstamp)
@rm -f unit/execution/context_as$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_execution_context_as_OBJECTS) $(unit_execution_context_as_LDADD) $(LIBS)
-unit/execution/execute.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/execute$(EXEEXT): $(unit_execution_execute_OBJECTS) $(unit_execution_execute_DEPENDENCIES) $(EXTRA_unit_execution_execute_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/execute$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_execute_OBJECTS) $(unit_execution_execute_LDADD) $(LIBS)
unit/execution/executor.$(OBJEXT): unit/execution/$(am__dirstamp) \
unit/execution/$(DEPDIR)/$(am__dirstamp)
@@ -2817,13 +3143,6 @@ unit/execution/mapping.$(OBJEXT): unit/execution/$(am__dirstamp) \
unit/execution/mapping$(EXEEXT): $(unit_execution_mapping_OBJECTS) $(unit_execution_mapping_DEPENDENCIES) $(EXTRA_unit_execution_mapping_DEPENDENCIES) unit/execution/$(am__dirstamp)
@rm -f unit/execution/mapping$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_execution_mapping_OBJECTS) $(unit_execution_mapping_LDADD) $(LIBS)
-unit/execution/operation_state.$(OBJEXT): \
- unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/operation_state$(EXEEXT): $(unit_execution_operation_state_OBJECTS) $(unit_execution_operation_state_DEPENDENCIES) $(EXTRA_unit_execution_operation_state_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/operation_state$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_operation_state_OBJECTS) $(unit_execution_operation_state_LDADD) $(LIBS)
unit/execution/outstanding_work.$(OBJEXT): \
unit/execution/$(am__dirstamp) \
unit/execution/$(DEPDIR)/$(am__dirstamp)
@@ -2837,66 +3156,12 @@ unit/execution/prefer_only.$(OBJEXT): unit/execution/$(am__dirstamp) \
unit/execution/prefer_only$(EXEEXT): $(unit_execution_prefer_only_OBJECTS) $(unit_execution_prefer_only_DEPENDENCIES) $(EXTRA_unit_execution_prefer_only_DEPENDENCIES) unit/execution/$(am__dirstamp)
@rm -f unit/execution/prefer_only$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_execution_prefer_only_OBJECTS) $(unit_execution_prefer_only_LDADD) $(LIBS)
-unit/execution/receiver.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/receiver$(EXEEXT): $(unit_execution_receiver_OBJECTS) $(unit_execution_receiver_DEPENDENCIES) $(EXTRA_unit_execution_receiver_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/receiver$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_receiver_OBJECTS) $(unit_execution_receiver_LDADD) $(LIBS)
unit/execution/relationship.$(OBJEXT): unit/execution/$(am__dirstamp) \
unit/execution/$(DEPDIR)/$(am__dirstamp)
unit/execution/relationship$(EXEEXT): $(unit_execution_relationship_OBJECTS) $(unit_execution_relationship_DEPENDENCIES) $(EXTRA_unit_execution_relationship_DEPENDENCIES) unit/execution/$(am__dirstamp)
@rm -f unit/execution/relationship$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_execution_relationship_OBJECTS) $(unit_execution_relationship_LDADD) $(LIBS)
-unit/execution/schedule.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/schedule$(EXEEXT): $(unit_execution_schedule_OBJECTS) $(unit_execution_schedule_DEPENDENCIES) $(EXTRA_unit_execution_schedule_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/schedule$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_schedule_OBJECTS) $(unit_execution_schedule_LDADD) $(LIBS)
-unit/execution/scheduler.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/scheduler$(EXEEXT): $(unit_execution_scheduler_OBJECTS) $(unit_execution_scheduler_DEPENDENCIES) $(EXTRA_unit_execution_scheduler_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/scheduler$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_scheduler_OBJECTS) $(unit_execution_scheduler_LDADD) $(LIBS)
-unit/execution/sender.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/sender$(EXEEXT): $(unit_execution_sender_OBJECTS) $(unit_execution_sender_DEPENDENCIES) $(EXTRA_unit_execution_sender_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/sender$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_sender_OBJECTS) $(unit_execution_sender_LDADD) $(LIBS)
-unit/execution/set_done.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/set_done$(EXEEXT): $(unit_execution_set_done_OBJECTS) $(unit_execution_set_done_DEPENDENCIES) $(EXTRA_unit_execution_set_done_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/set_done$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_set_done_OBJECTS) $(unit_execution_set_done_LDADD) $(LIBS)
-unit/execution/set_error.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/set_error$(EXEEXT): $(unit_execution_set_error_OBJECTS) $(unit_execution_set_error_DEPENDENCIES) $(EXTRA_unit_execution_set_error_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/set_error$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_set_error_OBJECTS) $(unit_execution_set_error_LDADD) $(LIBS)
-unit/execution/set_value.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/set_value$(EXEEXT): $(unit_execution_set_value_OBJECTS) $(unit_execution_set_value_DEPENDENCIES) $(EXTRA_unit_execution_set_value_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/set_value$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_set_value_OBJECTS) $(unit_execution_set_value_LDADD) $(LIBS)
-unit/execution/start.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/start$(EXEEXT): $(unit_execution_start_OBJECTS) $(unit_execution_start_DEPENDENCIES) $(EXTRA_unit_execution_start_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/start$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_start_OBJECTS) $(unit_execution_start_LDADD) $(LIBS)
-unit/execution/submit.$(OBJEXT): unit/execution/$(am__dirstamp) \
- unit/execution/$(DEPDIR)/$(am__dirstamp)
-
-unit/execution/submit$(EXEEXT): $(unit_execution_submit_OBJECTS) $(unit_execution_submit_DEPENDENCIES) $(EXTRA_unit_execution_submit_DEPENDENCIES) unit/execution/$(am__dirstamp)
- @rm -f unit/execution/submit$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_execution_submit_OBJECTS) $(unit_execution_submit_LDADD) $(LIBS)
unit/execution_context.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -2928,12 +3193,61 @@ unit/experimental/awaitable_operators.$(OBJEXT): \
unit/experimental/awaitable_operators$(EXEEXT): $(unit_experimental_awaitable_operators_OBJECTS) $(unit_experimental_awaitable_operators_DEPENDENCIES) $(EXTRA_unit_experimental_awaitable_operators_DEPENDENCIES) unit/experimental/$(am__dirstamp)
@rm -f unit/experimental/awaitable_operators$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_awaitable_operators_OBJECTS) $(unit_experimental_awaitable_operators_LDADD) $(LIBS)
+unit/experimental/basic_channel.$(OBJEXT): \
+ unit/experimental/$(am__dirstamp) \
+ unit/experimental/$(DEPDIR)/$(am__dirstamp)
+
+unit/experimental/basic_channel$(EXEEXT): $(unit_experimental_basic_channel_OBJECTS) $(unit_experimental_basic_channel_DEPENDENCIES) $(EXTRA_unit_experimental_basic_channel_DEPENDENCIES) unit/experimental/$(am__dirstamp)
+ @rm -f unit/experimental/basic_channel$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_basic_channel_OBJECTS) $(unit_experimental_basic_channel_LDADD) $(LIBS)
+unit/experimental/basic_concurrent_channel.$(OBJEXT): \
+ unit/experimental/$(am__dirstamp) \
+ unit/experimental/$(DEPDIR)/$(am__dirstamp)
+
+unit/experimental/basic_concurrent_channel$(EXEEXT): $(unit_experimental_basic_concurrent_channel_OBJECTS) $(unit_experimental_basic_concurrent_channel_DEPENDENCIES) $(EXTRA_unit_experimental_basic_concurrent_channel_DEPENDENCIES) unit/experimental/$(am__dirstamp)
+ @rm -f unit/experimental/basic_concurrent_channel$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_basic_concurrent_channel_OBJECTS) $(unit_experimental_basic_concurrent_channel_LDADD) $(LIBS)
+unit/experimental/channel.$(OBJEXT): \
+ unit/experimental/$(am__dirstamp) \
+ unit/experimental/$(DEPDIR)/$(am__dirstamp)
+
+unit/experimental/channel$(EXEEXT): $(unit_experimental_channel_OBJECTS) $(unit_experimental_channel_DEPENDENCIES) $(EXTRA_unit_experimental_channel_DEPENDENCIES) unit/experimental/$(am__dirstamp)
+ @rm -f unit/experimental/channel$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_channel_OBJECTS) $(unit_experimental_channel_LDADD) $(LIBS)
+unit/experimental/channel_traits.$(OBJEXT): \
+ unit/experimental/$(am__dirstamp) \
+ unit/experimental/$(DEPDIR)/$(am__dirstamp)
+
+unit/experimental/channel_traits$(EXEEXT): $(unit_experimental_channel_traits_OBJECTS) $(unit_experimental_channel_traits_DEPENDENCIES) $(EXTRA_unit_experimental_channel_traits_DEPENDENCIES) unit/experimental/$(am__dirstamp)
+ @rm -f unit/experimental/channel_traits$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_channel_traits_OBJECTS) $(unit_experimental_channel_traits_LDADD) $(LIBS)
+unit/experimental/co_composed.$(OBJEXT): \
+ unit/experimental/$(am__dirstamp) \
+ unit/experimental/$(DEPDIR)/$(am__dirstamp)
+
+unit/experimental/co_composed$(EXEEXT): $(unit_experimental_co_composed_OBJECTS) $(unit_experimental_co_composed_DEPENDENCIES) $(EXTRA_unit_experimental_co_composed_DEPENDENCIES) unit/experimental/$(am__dirstamp)
+ @rm -f unit/experimental/co_composed$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_co_composed_OBJECTS) $(unit_experimental_co_composed_LDADD) $(LIBS)
+unit/experimental/concurrent_channel.$(OBJEXT): \
+ unit/experimental/$(am__dirstamp) \
+ unit/experimental/$(DEPDIR)/$(am__dirstamp)
+
+unit/experimental/concurrent_channel$(EXEEXT): $(unit_experimental_concurrent_channel_OBJECTS) $(unit_experimental_concurrent_channel_DEPENDENCIES) $(EXTRA_unit_experimental_concurrent_channel_DEPENDENCIES) unit/experimental/$(am__dirstamp)
+ @rm -f unit/experimental/concurrent_channel$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_concurrent_channel_OBJECTS) $(unit_experimental_concurrent_channel_LDADD) $(LIBS)
unit/experimental/coro/$(am__dirstamp):
@$(MKDIR_P) unit/experimental/coro
@: > unit/experimental/coro/$(am__dirstamp)
unit/experimental/coro/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) unit/experimental/coro/$(DEPDIR)
@: > unit/experimental/coro/$(DEPDIR)/$(am__dirstamp)
+unit/experimental/coro/allocator.$(OBJEXT): \
+ unit/experimental/coro/$(am__dirstamp) \
+ unit/experimental/coro/$(DEPDIR)/$(am__dirstamp)
+
+unit/experimental/coro/allocator$(EXEEXT): $(unit_experimental_coro_allocator_OBJECTS) $(unit_experimental_coro_allocator_DEPENDENCIES) $(EXTRA_unit_experimental_coro_allocator_DEPENDENCIES) unit/experimental/coro/$(am__dirstamp)
+ @rm -f unit/experimental/coro/allocator$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_coro_allocator_OBJECTS) $(unit_experimental_coro_allocator_LDADD) $(LIBS)
unit/experimental/coro/cancel.$(OBJEXT): \
unit/experimental/coro/$(am__dirstamp) \
unit/experimental/coro/$(DEPDIR)/$(am__dirstamp)
@@ -2941,6 +3255,13 @@ unit/experimental/coro/cancel.$(OBJEXT): \
unit/experimental/coro/cancel$(EXEEXT): $(unit_experimental_coro_cancel_OBJECTS) $(unit_experimental_coro_cancel_DEPENDENCIES) $(EXTRA_unit_experimental_coro_cancel_DEPENDENCIES) unit/experimental/coro/$(am__dirstamp)
@rm -f unit/experimental/coro/cancel$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_coro_cancel_OBJECTS) $(unit_experimental_coro_cancel_LDADD) $(LIBS)
+unit/experimental/coro/co_spawn.$(OBJEXT): \
+ unit/experimental/coro/$(am__dirstamp) \
+ unit/experimental/coro/$(DEPDIR)/$(am__dirstamp)
+
+unit/experimental/coro/co_spawn$(EXEEXT): $(unit_experimental_coro_co_spawn_OBJECTS) $(unit_experimental_coro_co_spawn_DEPENDENCIES) $(EXTRA_unit_experimental_coro_co_spawn_DEPENDENCIES) unit/experimental/coro/$(am__dirstamp)
+ @rm -f unit/experimental/coro/co_spawn$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_coro_co_spawn_OBJECTS) $(unit_experimental_coro_co_spawn_LDADD) $(LIBS)
unit/experimental/coro/exception.$(OBJEXT): \
unit/experimental/coro/$(am__dirstamp) \
unit/experimental/coro/$(DEPDIR)/$(am__dirstamp)
@@ -2948,6 +3269,13 @@ unit/experimental/coro/exception.$(OBJEXT): \
unit/experimental/coro/exception$(EXEEXT): $(unit_experimental_coro_exception_OBJECTS) $(unit_experimental_coro_exception_DEPENDENCIES) $(EXTRA_unit_experimental_coro_exception_DEPENDENCIES) unit/experimental/coro/$(am__dirstamp)
@rm -f unit/experimental/coro/exception$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_coro_exception_OBJECTS) $(unit_experimental_coro_exception_LDADD) $(LIBS)
+unit/experimental/coro/executor.$(OBJEXT): \
+ unit/experimental/coro/$(am__dirstamp) \
+ unit/experimental/coro/$(DEPDIR)/$(am__dirstamp)
+
+unit/experimental/coro/executor$(EXEEXT): $(unit_experimental_coro_executor_OBJECTS) $(unit_experimental_coro_executor_DEPENDENCIES) $(EXTRA_unit_experimental_coro_executor_DEPENDENCIES) unit/experimental/coro/$(am__dirstamp)
+ @rm -f unit/experimental/coro/executor$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_coro_executor_OBJECTS) $(unit_experimental_coro_executor_LDADD) $(LIBS)
unit/experimental/coro/partial.$(OBJEXT): \
unit/experimental/coro/$(am__dirstamp) \
unit/experimental/coro/$(DEPDIR)/$(am__dirstamp)
@@ -2976,13 +3304,13 @@ unit/experimental/coro/use_coro.$(OBJEXT): \
unit/experimental/coro/use_coro$(EXEEXT): $(unit_experimental_coro_use_coro_OBJECTS) $(unit_experimental_coro_use_coro_DEPENDENCIES) $(EXTRA_unit_experimental_coro_use_coro_DEPENDENCIES) unit/experimental/coro/$(am__dirstamp)
@rm -f unit/experimental/coro/use_coro$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_coro_use_coro_OBJECTS) $(unit_experimental_coro_use_coro_LDADD) $(LIBS)
-unit/experimental/deferred.$(OBJEXT): \
+unit/experimental/parallel_group.$(OBJEXT): \
unit/experimental/$(am__dirstamp) \
unit/experimental/$(DEPDIR)/$(am__dirstamp)
-unit/experimental/deferred$(EXEEXT): $(unit_experimental_deferred_OBJECTS) $(unit_experimental_deferred_DEPENDENCIES) $(EXTRA_unit_experimental_deferred_DEPENDENCIES) unit/experimental/$(am__dirstamp)
- @rm -f unit/experimental/deferred$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_deferred_OBJECTS) $(unit_experimental_deferred_LDADD) $(LIBS)
+unit/experimental/parallel_group$(EXEEXT): $(unit_experimental_parallel_group_OBJECTS) $(unit_experimental_parallel_group_DEPENDENCIES) $(EXTRA_unit_experimental_parallel_group_DEPENDENCIES) unit/experimental/$(am__dirstamp)
+ @rm -f unit/experimental/parallel_group$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_parallel_group_OBJECTS) $(unit_experimental_parallel_group_LDADD) $(LIBS)
unit/experimental/promise.$(OBJEXT): \
unit/experimental/$(am__dirstamp) \
unit/experimental/$(DEPDIR)/$(am__dirstamp)
@@ -2990,6 +3318,12 @@ unit/experimental/promise.$(OBJEXT): \
unit/experimental/promise$(EXEEXT): $(unit_experimental_promise_OBJECTS) $(unit_experimental_promise_DEPENDENCIES) $(EXTRA_unit_experimental_promise_DEPENDENCIES) unit/experimental/$(am__dirstamp)
@rm -f unit/experimental/promise$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_experimental_promise_OBJECTS) $(unit_experimental_promise_LDADD) $(LIBS)
+unit/file_base.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/file_base$(EXEEXT): $(unit_file_base_OBJECTS) $(unit_file_base_DEPENDENCIES) $(EXTRA_unit_file_base_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/file_base$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_file_base_OBJECTS) $(unit_file_base_LDADD) $(LIBS)
unit/generic/$(am__dirstamp):
@$(MKDIR_P) unit/generic
@: > unit/generic/$(am__dirstamp)
@@ -3220,6 +3554,12 @@ unit/local/datagram_protocol.$(OBJEXT): unit/local/$(am__dirstamp) \
unit/local/datagram_protocol$(EXEEXT): $(unit_local_datagram_protocol_OBJECTS) $(unit_local_datagram_protocol_DEPENDENCIES) $(EXTRA_unit_local_datagram_protocol_DEPENDENCIES) unit/local/$(am__dirstamp)
@rm -f unit/local/datagram_protocol$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_local_datagram_protocol_OBJECTS) $(unit_local_datagram_protocol_LDADD) $(LIBS)
+unit/local/seq_packet_protocol.$(OBJEXT): unit/local/$(am__dirstamp) \
+ unit/local/$(DEPDIR)/$(am__dirstamp)
+
+unit/local/seq_packet_protocol$(EXEEXT): $(unit_local_seq_packet_protocol_OBJECTS) $(unit_local_seq_packet_protocol_DEPENDENCIES) $(EXTRA_unit_local_seq_packet_protocol_DEPENDENCIES) unit/local/$(am__dirstamp)
+ @rm -f unit/local/seq_packet_protocol$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_local_seq_packet_protocol_OBJECTS) $(unit_local_seq_packet_protocol_LDADD) $(LIBS)
unit/local/stream_protocol.$(OBJEXT): unit/local/$(am__dirstamp) \
unit/local/$(DEPDIR)/$(am__dirstamp)
@@ -3281,6 +3621,18 @@ unit/post.$(OBJEXT): unit/$(am__dirstamp) \
unit/post$(EXEEXT): $(unit_post_OBJECTS) $(unit_post_DEPENDENCIES) $(EXTRA_unit_post_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/post$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_post_OBJECTS) $(unit_post_LDADD) $(LIBS)
+unit/prepend.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/prepend$(EXEEXT): $(unit_prepend_OBJECTS) $(unit_prepend_DEPENDENCIES) $(EXTRA_unit_prepend_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/prepend$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_prepend_OBJECTS) $(unit_prepend_LDADD) $(LIBS)
+unit/random_access_file.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/random_access_file$(EXEEXT): $(unit_random_access_file_OBJECTS) $(unit_random_access_file_DEPENDENCIES) $(EXTRA_unit_random_access_file_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/random_access_file$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_random_access_file_OBJECTS) $(unit_random_access_file_LDADD) $(LIBS)
unit/read.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -3299,12 +3651,30 @@ unit/read_until.$(OBJEXT): unit/$(am__dirstamp) \
unit/read_until$(EXEEXT): $(unit_read_until_OBJECTS) $(unit_read_until_DEPENDENCIES) $(EXTRA_unit_read_until_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/read_until$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_read_until_OBJECTS) $(unit_read_until_LDADD) $(LIBS)
+unit/readable_pipe.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/readable_pipe$(EXEEXT): $(unit_readable_pipe_OBJECTS) $(unit_readable_pipe_DEPENDENCIES) $(EXTRA_unit_readable_pipe_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/readable_pipe$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_readable_pipe_OBJECTS) $(unit_readable_pipe_LDADD) $(LIBS)
+unit/recycling_allocator.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/recycling_allocator$(EXEEXT): $(unit_recycling_allocator_OBJECTS) $(unit_recycling_allocator_DEPENDENCIES) $(EXTRA_unit_recycling_allocator_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/recycling_allocator$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_recycling_allocator_OBJECTS) $(unit_recycling_allocator_LDADD) $(LIBS)
unit/redirect_error.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
unit/redirect_error$(EXEEXT): $(unit_redirect_error_OBJECTS) $(unit_redirect_error_DEPENDENCIES) $(EXTRA_unit_redirect_error_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/redirect_error$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_redirect_error_OBJECTS) $(unit_redirect_error_LDADD) $(LIBS)
+unit/registered_buffer.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/registered_buffer$(EXEEXT): $(unit_registered_buffer_OBJECTS) $(unit_registered_buffer_DEPENDENCIES) $(EXTRA_unit_registered_buffer_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/registered_buffer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_registered_buffer_OBJECTS) $(unit_registered_buffer_LDADD) $(LIBS)
unit/serial_port.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -3323,6 +3693,12 @@ unit/signal_set.$(OBJEXT): unit/$(am__dirstamp) \
unit/signal_set$(EXEEXT): $(unit_signal_set_OBJECTS) $(unit_signal_set_DEPENDENCIES) $(EXTRA_unit_signal_set_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/signal_set$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_signal_set_OBJECTS) $(unit_signal_set_LDADD) $(LIBS)
+unit/signal_set_base.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/signal_set_base$(EXEEXT): $(unit_signal_set_base_OBJECTS) $(unit_signal_set_base_DEPENDENCIES) $(EXTRA_unit_signal_set_base_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/signal_set_base$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_signal_set_base_OBJECTS) $(unit_signal_set_base_LDADD) $(LIBS)
unit/socket_base.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -3395,6 +3771,12 @@ unit/strand.$(OBJEXT): unit/$(am__dirstamp) \
unit/strand$(EXEEXT): $(unit_strand_OBJECTS) $(unit_strand_DEPENDENCIES) $(EXTRA_unit_strand_DEPENDENCIES) unit/$(am__dirstamp)
@rm -f unit/strand$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_strand_OBJECTS) $(unit_strand_LDADD) $(LIBS)
+unit/stream_file.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/stream_file$(EXEEXT): $(unit_stream_file_OBJECTS) $(unit_stream_file_DEPENDENCIES) $(EXTRA_unit_stream_file_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/stream_file$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_stream_file_OBJECTS) $(unit_stream_file_LDADD) $(LIBS)
unit/streambuf.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -3587,6 +3969,12 @@ unit/windows/stream_handle.$(OBJEXT): unit/windows/$(am__dirstamp) \
unit/windows/stream_handle$(EXEEXT): $(unit_windows_stream_handle_OBJECTS) $(unit_windows_stream_handle_DEPENDENCIES) $(EXTRA_unit_windows_stream_handle_DEPENDENCIES) unit/windows/$(am__dirstamp)
@rm -f unit/windows/stream_handle$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(unit_windows_stream_handle_OBJECTS) $(unit_windows_stream_handle_LDADD) $(LIBS)
+unit/writable_pipe.$(OBJEXT): unit/$(am__dirstamp) \
+ unit/$(DEPDIR)/$(am__dirstamp)
+
+unit/writable_pipe$(EXEEXT): $(unit_writable_pipe_OBJECTS) $(unit_writable_pipe_DEPENDENCIES) $(EXTRA_unit_writable_pipe_DEPENDENCIES) unit/$(am__dirstamp)
+ @rm -f unit/writable_pipe$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(unit_writable_pipe_OBJECTS) $(unit_writable_pipe_LDADD) $(LIBS)
unit/write.$(OBJEXT): unit/$(am__dirstamp) \
unit/$(DEPDIR)/$(am__dirstamp)
@@ -3628,26 +4016,40 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@latency/$(DEPDIR)/udp_server.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@performance/$(DEPDIR)/client.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@performance/$(DEPDIR)/server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/any_completion_executor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/any_completion_handler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/any_io_executor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/append.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/as_tuple.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/associated_allocator.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/associated_cancellation_slot.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/associated_executor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/associated_immediate_executor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/associator.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/async_result.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/awaitable.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_datagram_socket.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_deadline_timer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_file.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_random_access_file.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_raw_socket.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_readable_pipe.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_seq_packet_socket.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_serial_port.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_signal_set.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_socket.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_socket_acceptor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_stream_file.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_stream_socket.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_streambuf.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_waitable_timer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/basic_writable_pipe.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/bind_allocator.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/bind_cancellation_slot.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/bind_executor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/bind_immediate_executor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/buffer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/buffer_registration.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/buffered_read_stream.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/buffered_stream.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/buffered_write_stream.Po@am__quote@ # am--include-marker
@@ -3659,15 +4061,19 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/completion_condition.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/compose.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/connect.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/connect_pipe.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/consign.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/coroutine.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/deadline_timer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/defer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/deferred.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/detached.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/dispatch.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/error.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/execution_context.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/executor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/executor_work_guard.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/file_base.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/high_resolution_timer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/io_context.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/io_context_strand.Po@am__quote@ # am--include-marker
@@ -3676,17 +4082,24 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/packaged_task.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/placeholders.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/post.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/prepend.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/random_access_file.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/read.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/read_at.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/read_until.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/readable_pipe.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/recycling_allocator.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/redirect_error.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/registered_buffer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/serial_port.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/serial_port_base.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/signal_set.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/signal_set_base.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/socket_base.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/static_thread_pool.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/steady_timer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/strand.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/stream_file.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/streambuf.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/system_context.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/system_executor.Po@am__quote@ # am--include-marker
@@ -3699,37 +4112,33 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/use_future.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/uses_executor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/wait_traits.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/writable_pipe.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/write.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/write_at.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/any_executor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/blocking.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/blocking_adaptation.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/bulk_execute.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/bulk_guarantee.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/connect.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/context_as.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/execute.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/executor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/invocable_archetype.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/mapping.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/operation_state.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/outstanding_work.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/prefer_only.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/receiver.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/relationship.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/schedule.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/scheduler.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/sender.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/set_done.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/set_error.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/set_value.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/start.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/execution/$(DEPDIR)/submit.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/awaitable_operators.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/deferred.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/basic_channel.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/basic_concurrent_channel.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/channel.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/channel_traits.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/co_composed.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/concurrent_channel.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/parallel_group.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/$(DEPDIR)/promise.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/coro/$(DEPDIR)/allocator.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/coro/$(DEPDIR)/cancel.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/coro/$(DEPDIR)/co_spawn.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/coro/$(DEPDIR)/exception.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/coro/$(DEPDIR)/executor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/coro/$(DEPDIR)/partial.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/coro/$(DEPDIR)/simple_test.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/experimental/coro/$(DEPDIR)/stack_test.Po@am__quote@ # am--include-marker
@@ -3764,6 +4173,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@unit/local/$(DEPDIR)/basic_endpoint.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/local/$(DEPDIR)/connect_pair.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/local/$(DEPDIR)/datagram_protocol.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unit/local/$(DEPDIR)/seq_packet_protocol.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/local/$(DEPDIR)/stream_protocol.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/posix/$(DEPDIR)/basic_descriptor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@unit/posix/$(DEPDIR)/basic_stream_descriptor.Po@am__quote@ # am--include-marker
@@ -4023,7 +4433,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
echo "$${col}$$br$${std}"; \
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
@@ -4057,6 +4467,41 @@ recheck: all $(check_PROGRAMS)
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
+unit/any_completion_executor.log: unit/any_completion_executor$(EXEEXT)
+ @p='unit/any_completion_executor$(EXEEXT)'; \
+ b='unit/any_completion_executor'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/any_completion_handler.log: unit/any_completion_handler$(EXEEXT)
+ @p='unit/any_completion_handler$(EXEEXT)'; \
+ b='unit/any_completion_handler'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/any_io_executor.log: unit/any_io_executor$(EXEEXT)
+ @p='unit/any_io_executor$(EXEEXT)'; \
+ b='unit/any_io_executor'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/append.log: unit/append$(EXEEXT)
+ @p='unit/append$(EXEEXT)'; \
+ b='unit/append'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/as_tuple.log: unit/as_tuple$(EXEEXT)
+ @p='unit/as_tuple$(EXEEXT)'; \
+ b='unit/as_tuple'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/associated_allocator.log: unit/associated_allocator$(EXEEXT)
@p='unit/associated_allocator$(EXEEXT)'; \
b='unit/associated_allocator'; \
@@ -4078,6 +4523,13 @@ unit/associated_executor.log: unit/associated_executor$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/associated_immediate_executor.log: unit/associated_immediate_executor$(EXEEXT)
+ @p='unit/associated_immediate_executor$(EXEEXT)'; \
+ b='unit/associated_immediate_executor'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/associator.log: unit/associator$(EXEEXT)
@p='unit/associator$(EXEEXT)'; \
b='unit/associator'; \
@@ -4113,6 +4565,20 @@ unit/basic_deadline_timer.log: unit/basic_deadline_timer$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/basic_file.log: unit/basic_file$(EXEEXT)
+ @p='unit/basic_file$(EXEEXT)'; \
+ b='unit/basic_file'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/basic_random_access_file.log: unit/basic_random_access_file$(EXEEXT)
+ @p='unit/basic_random_access_file$(EXEEXT)'; \
+ b='unit/basic_random_access_file'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/basic_raw_socket.log: unit/basic_raw_socket$(EXEEXT)
@p='unit/basic_raw_socket$(EXEEXT)'; \
b='unit/basic_raw_socket'; \
@@ -4120,6 +4586,13 @@ unit/basic_raw_socket.log: unit/basic_raw_socket$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/basic_readable_pipe.log: unit/basic_readable_pipe$(EXEEXT)
+ @p='unit/basic_readable_pipe$(EXEEXT)'; \
+ b='unit/basic_readable_pipe'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/basic_seq_packet_socket.log: unit/basic_seq_packet_socket$(EXEEXT)
@p='unit/basic_seq_packet_socket$(EXEEXT)'; \
b='unit/basic_seq_packet_socket'; \
@@ -4155,6 +4628,13 @@ unit/basic_socket_acceptor.log: unit/basic_socket_acceptor$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/basic_stream_file.log: unit/basic_stream_file$(EXEEXT)
+ @p='unit/basic_stream_file$(EXEEXT)'; \
+ b='unit/basic_stream_file'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/basic_stream_socket.log: unit/basic_stream_socket$(EXEEXT)
@p='unit/basic_stream_socket$(EXEEXT)'; \
b='unit/basic_stream_socket'; \
@@ -4176,6 +4656,20 @@ unit/basic_waitable_timer.log: unit/basic_waitable_timer$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/basic_writable_pipe.log: unit/basic_writable_pipe$(EXEEXT)
+ @p='unit/basic_writable_pipe$(EXEEXT)'; \
+ b='unit/basic_writable_pipe'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/bind_allocator.log: unit/bind_allocator$(EXEEXT)
+ @p='unit/bind_allocator$(EXEEXT)'; \
+ b='unit/bind_allocator'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/bind_cancellation_slot.log: unit/bind_cancellation_slot$(EXEEXT)
@p='unit/bind_cancellation_slot$(EXEEXT)'; \
b='unit/bind_cancellation_slot'; \
@@ -4190,6 +4684,13 @@ unit/bind_executor.log: unit/bind_executor$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/bind_immediate_executor.log: unit/bind_immediate_executor$(EXEEXT)
+ @p='unit/bind_immediate_executor$(EXEEXT)'; \
+ b='unit/bind_immediate_executor'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/buffered_read_stream.log: unit/buffered_read_stream$(EXEEXT)
@p='unit/buffered_read_stream$(EXEEXT)'; \
b='unit/buffered_read_stream'; \
@@ -4218,6 +4719,13 @@ unit/buffer.log: unit/buffer$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/buffer_registration.log: unit/buffer_registration$(EXEEXT)
+ @p='unit/buffer_registration$(EXEEXT)'; \
+ b='unit/buffer_registration'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/buffers_iterator.log: unit/buffers_iterator$(EXEEXT)
@p='unit/buffers_iterator$(EXEEXT)'; \
b='unit/buffers_iterator'; \
@@ -4274,6 +4782,20 @@ unit/connect.log: unit/connect$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/connect_pipe.log: unit/connect_pipe$(EXEEXT)
+ @p='unit/connect_pipe$(EXEEXT)'; \
+ b='unit/connect_pipe'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/consign.log: unit/consign$(EXEEXT)
+ @p='unit/consign$(EXEEXT)'; \
+ b='unit/consign'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/deadline_timer.log: unit/deadline_timer$(EXEEXT)
@p='unit/deadline_timer$(EXEEXT)'; \
b='unit/deadline_timer'; \
@@ -4288,6 +4810,13 @@ unit/defer.log: unit/defer$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/deferred.log: unit/deferred$(EXEEXT)
+ @p='unit/deferred$(EXEEXT)'; \
+ b='unit/deferred'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/detached.log: unit/detached$(EXEEXT)
@p='unit/detached$(EXEEXT)'; \
b='unit/detached'; \
@@ -4330,27 +4859,6 @@ unit/execution/blocking_adaptation.log: unit/execution/blocking_adaptation$(EXEE
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/bulk_execute.log: unit/execution/bulk_execute$(EXEEXT)
- @p='unit/execution/bulk_execute$(EXEEXT)'; \
- b='unit/execution/bulk_execute'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/bulk_guarantee.log: unit/execution/bulk_guarantee$(EXEEXT)
- @p='unit/execution/bulk_guarantee$(EXEEXT)'; \
- b='unit/execution/bulk_guarantee'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/connect.log: unit/execution/connect$(EXEEXT)
- @p='unit/execution/connect$(EXEEXT)'; \
- b='unit/execution/connect'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/execution/context_as.log: unit/execution/context_as$(EXEEXT)
@p='unit/execution/context_as$(EXEEXT)'; \
b='unit/execution/context_as'; \
@@ -4358,13 +4866,6 @@ unit/execution/context_as.log: unit/execution/context_as$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/execute.log: unit/execution/execute$(EXEEXT)
- @p='unit/execution/execute$(EXEEXT)'; \
- b='unit/execution/execute'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/execution/executor.log: unit/execution/executor$(EXEEXT)
@p='unit/execution/executor$(EXEEXT)'; \
b='unit/execution/executor'; \
@@ -4386,13 +4887,6 @@ unit/execution/mapping.log: unit/execution/mapping$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/operation_state.log: unit/execution/operation_state$(EXEEXT)
- @p='unit/execution/operation_state$(EXEEXT)'; \
- b='unit/execution/operation_state'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/execution/outstanding_work.log: unit/execution/outstanding_work$(EXEEXT)
@p='unit/execution/outstanding_work$(EXEEXT)'; \
b='unit/execution/outstanding_work'; \
@@ -4407,13 +4901,6 @@ unit/execution/prefer_only.log: unit/execution/prefer_only$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/receiver.log: unit/execution/receiver$(EXEEXT)
- @p='unit/execution/receiver$(EXEEXT)'; \
- b='unit/execution/receiver'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/execution/relationship.log: unit/execution/relationship$(EXEEXT)
@p='unit/execution/relationship$(EXEEXT)'; \
b='unit/execution/relationship'; \
@@ -4421,62 +4908,6 @@ unit/execution/relationship.log: unit/execution/relationship$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/schedule.log: unit/execution/schedule$(EXEEXT)
- @p='unit/execution/schedule$(EXEEXT)'; \
- b='unit/execution/schedule'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/scheduler.log: unit/execution/scheduler$(EXEEXT)
- @p='unit/execution/scheduler$(EXEEXT)'; \
- b='unit/execution/scheduler'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/sender.log: unit/execution/sender$(EXEEXT)
- @p='unit/execution/sender$(EXEEXT)'; \
- b='unit/execution/sender'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/set_done.log: unit/execution/set_done$(EXEEXT)
- @p='unit/execution/set_done$(EXEEXT)'; \
- b='unit/execution/set_done'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/set_error.log: unit/execution/set_error$(EXEEXT)
- @p='unit/execution/set_error$(EXEEXT)'; \
- b='unit/execution/set_error'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/set_value.log: unit/execution/set_value$(EXEEXT)
- @p='unit/execution/set_value$(EXEEXT)'; \
- b='unit/execution/set_value'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/start.log: unit/execution/start$(EXEEXT)
- @p='unit/execution/start$(EXEEXT)'; \
- b='unit/execution/start'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/execution/submit.log: unit/execution/submit$(EXEEXT)
- @p='unit/execution/submit$(EXEEXT)'; \
- b='unit/execution/submit'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/execution_context.log: unit/execution_context$(EXEEXT)
@p='unit/execution_context$(EXEEXT)'; \
b='unit/execution_context'; \
@@ -4498,6 +4929,13 @@ unit/executor_work_guard.log: unit/executor_work_guard$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/file_base.log: unit/file_base$(EXEEXT)
+ @p='unit/file_base$(EXEEXT)'; \
+ b='unit/file_base'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/high_resolution_timer.log: unit/high_resolution_timer$(EXEEXT)
@p='unit/high_resolution_timer$(EXEEXT)'; \
b='unit/high_resolution_timer'; \
@@ -4708,6 +5146,13 @@ unit/local/datagram_protocol.log: unit/local/datagram_protocol$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/local/seq_packet_protocol.log: unit/local/seq_packet_protocol$(EXEEXT)
+ @p='unit/local/seq_packet_protocol$(EXEEXT)'; \
+ b='unit/local/seq_packet_protocol'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/local/stream_protocol.log: unit/local/stream_protocol$(EXEEXT)
@p='unit/local/stream_protocol$(EXEEXT)'; \
b='unit/local/stream_protocol'; \
@@ -4771,6 +5216,20 @@ unit/post.log: unit/post$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/prepend.log: unit/prepend$(EXEEXT)
+ @p='unit/prepend$(EXEEXT)'; \
+ b='unit/prepend'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/random_access_file.log: unit/random_access_file$(EXEEXT)
+ @p='unit/random_access_file$(EXEEXT)'; \
+ b='unit/random_access_file'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/read.log: unit/read$(EXEEXT)
@p='unit/read$(EXEEXT)'; \
b='unit/read'; \
@@ -4792,6 +5251,20 @@ unit/read_until.log: unit/read_until$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/readable_pipe.log: unit/readable_pipe$(EXEEXT)
+ @p='unit/readable_pipe$(EXEEXT)'; \
+ b='unit/readable_pipe'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/recycling_allocator.log: unit/recycling_allocator$(EXEEXT)
+ @p='unit/recycling_allocator$(EXEEXT)'; \
+ b='unit/recycling_allocator'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/redirect_error.log: unit/redirect_error$(EXEEXT)
@p='unit/redirect_error$(EXEEXT)'; \
b='unit/redirect_error'; \
@@ -4799,6 +5272,13 @@ unit/redirect_error.log: unit/redirect_error$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/registered_buffer.log: unit/registered_buffer$(EXEEXT)
+ @p='unit/registered_buffer$(EXEEXT)'; \
+ b='unit/registered_buffer'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/serial_port.log: unit/serial_port$(EXEEXT)
@p='unit/serial_port$(EXEEXT)'; \
b='unit/serial_port'; \
@@ -4820,6 +5300,13 @@ unit/signal_set.log: unit/signal_set$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/signal_set_base.log: unit/signal_set_base$(EXEEXT)
+ @p='unit/signal_set_base$(EXEEXT)'; \
+ b='unit/signal_set_base'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/socket_base.log: unit/socket_base$(EXEEXT)
@p='unit/socket_base$(EXEEXT)'; \
b='unit/socket_base'; \
@@ -4848,6 +5335,13 @@ unit/strand.log: unit/strand$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/stream_file.log: unit/stream_file$(EXEEXT)
+ @p='unit/stream_file$(EXEEXT)'; \
+ b='unit/stream_file'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/streambuf.log: unit/streambuf$(EXEEXT)
@p='unit/streambuf$(EXEEXT)'; \
b='unit/streambuf'; \
@@ -5051,6 +5545,13 @@ unit/windows/stream_handle.log: unit/windows/stream_handle$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/writable_pipe.log: unit/writable_pipe$(EXEEXT)
+ @p='unit/writable_pipe$(EXEEXT)'; \
+ b='unit/writable_pipe'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/write.log: unit/write$(EXEEXT)
@p='unit/write$(EXEEXT)'; \
b='unit/write'; \
@@ -5065,9 +5566,44 @@ unit/write_at.log: unit/write_at$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-unit/experimental/deferred.log: unit/experimental/deferred$(EXEEXT)
- @p='unit/experimental/deferred$(EXEEXT)'; \
- b='unit/experimental/deferred'; \
+unit/experimental/basic_channel.log: unit/experimental/basic_channel$(EXEEXT)
+ @p='unit/experimental/basic_channel$(EXEEXT)'; \
+ b='unit/experimental/basic_channel'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/experimental/basic_concurrent_channel.log: unit/experimental/basic_concurrent_channel$(EXEEXT)
+ @p='unit/experimental/basic_concurrent_channel$(EXEEXT)'; \
+ b='unit/experimental/basic_concurrent_channel'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/experimental/channel.log: unit/experimental/channel$(EXEEXT)
+ @p='unit/experimental/channel$(EXEEXT)'; \
+ b='unit/experimental/channel'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/experimental/channel_traits.log: unit/experimental/channel_traits$(EXEEXT)
+ @p='unit/experimental/channel_traits$(EXEEXT)'; \
+ b='unit/experimental/channel_traits'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/experimental/concurrent_channel.log: unit/experimental/concurrent_channel$(EXEEXT)
+ @p='unit/experimental/concurrent_channel$(EXEEXT)'; \
+ b='unit/experimental/concurrent_channel'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/experimental/parallel_group.log: unit/experimental/parallel_group$(EXEEXT)
+ @p='unit/experimental/parallel_group$(EXEEXT)'; \
+ b='unit/experimental/parallel_group'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
@@ -5086,6 +5622,20 @@ unit/experimental/awaitable_operators.log: unit/experimental/awaitable_operators
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/experimental/co_composed.log: unit/experimental/co_composed$(EXEEXT)
+ @p='unit/experimental/co_composed$(EXEEXT)'; \
+ b='unit/experimental/co_composed'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/experimental/coro/allocator.log: unit/experimental/coro/allocator$(EXEEXT)
+ @p='unit/experimental/coro/allocator$(EXEEXT)'; \
+ b='unit/experimental/coro/allocator'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/experimental/coro/cancel.log: unit/experimental/coro/cancel$(EXEEXT)
@p='unit/experimental/coro/cancel$(EXEEXT)'; \
b='unit/experimental/coro/cancel'; \
@@ -5093,6 +5643,13 @@ unit/experimental/coro/cancel.log: unit/experimental/coro/cancel$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/experimental/coro/co_spawn.log: unit/experimental/coro/co_spawn$(EXEEXT)
+ @p='unit/experimental/coro/co_spawn$(EXEEXT)'; \
+ b='unit/experimental/coro/co_spawn'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/experimental/coro/exception.log: unit/experimental/coro/exception$(EXEEXT)
@p='unit/experimental/coro/exception$(EXEEXT)'; \
b='unit/experimental/coro/exception'; \
@@ -5100,6 +5657,13 @@ unit/experimental/coro/exception.log: unit/experimental/coro/exception$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+unit/experimental/coro/executor.log: unit/experimental/coro/executor$(EXEEXT)
+ @p='unit/experimental/coro/executor$(EXEEXT)'; \
+ b='unit/experimental/coro/executor'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
unit/experimental/coro/partial.log: unit/experimental/coro/partial$(EXEEXT)
@p='unit/experimental/coro/partial$(EXEEXT)'; \
b='unit/experimental/coro/partial'; \
@@ -5191,7 +5755,6 @@ unit/ssl/stream.log: unit/ssl/stream$(EXEEXT)
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -5333,26 +5896,40 @@ distclean: distclean-recursive
-rm -f latency/$(DEPDIR)/udp_server.Po
-rm -f performance/$(DEPDIR)/client.Po
-rm -f performance/$(DEPDIR)/server.Po
+ -rm -f unit/$(DEPDIR)/any_completion_executor.Po
+ -rm -f unit/$(DEPDIR)/any_completion_handler.Po
+ -rm -f unit/$(DEPDIR)/any_io_executor.Po
+ -rm -f unit/$(DEPDIR)/append.Po
+ -rm -f unit/$(DEPDIR)/as_tuple.Po
-rm -f unit/$(DEPDIR)/associated_allocator.Po
-rm -f unit/$(DEPDIR)/associated_cancellation_slot.Po
-rm -f unit/$(DEPDIR)/associated_executor.Po
+ -rm -f unit/$(DEPDIR)/associated_immediate_executor.Po
-rm -f unit/$(DEPDIR)/associator.Po
-rm -f unit/$(DEPDIR)/async_result.Po
-rm -f unit/$(DEPDIR)/awaitable.Po
-rm -f unit/$(DEPDIR)/basic_datagram_socket.Po
-rm -f unit/$(DEPDIR)/basic_deadline_timer.Po
+ -rm -f unit/$(DEPDIR)/basic_file.Po
+ -rm -f unit/$(DEPDIR)/basic_random_access_file.Po
-rm -f unit/$(DEPDIR)/basic_raw_socket.Po
+ -rm -f unit/$(DEPDIR)/basic_readable_pipe.Po
-rm -f unit/$(DEPDIR)/basic_seq_packet_socket.Po
-rm -f unit/$(DEPDIR)/basic_serial_port.Po
-rm -f unit/$(DEPDIR)/basic_signal_set.Po
-rm -f unit/$(DEPDIR)/basic_socket.Po
-rm -f unit/$(DEPDIR)/basic_socket_acceptor.Po
+ -rm -f unit/$(DEPDIR)/basic_stream_file.Po
-rm -f unit/$(DEPDIR)/basic_stream_socket.Po
-rm -f unit/$(DEPDIR)/basic_streambuf.Po
-rm -f unit/$(DEPDIR)/basic_waitable_timer.Po
+ -rm -f unit/$(DEPDIR)/basic_writable_pipe.Po
+ -rm -f unit/$(DEPDIR)/bind_allocator.Po
-rm -f unit/$(DEPDIR)/bind_cancellation_slot.Po
-rm -f unit/$(DEPDIR)/bind_executor.Po
+ -rm -f unit/$(DEPDIR)/bind_immediate_executor.Po
-rm -f unit/$(DEPDIR)/buffer.Po
+ -rm -f unit/$(DEPDIR)/buffer_registration.Po
-rm -f unit/$(DEPDIR)/buffered_read_stream.Po
-rm -f unit/$(DEPDIR)/buffered_stream.Po
-rm -f unit/$(DEPDIR)/buffered_write_stream.Po
@@ -5364,15 +5941,19 @@ distclean: distclean-recursive
-rm -f unit/$(DEPDIR)/completion_condition.Po
-rm -f unit/$(DEPDIR)/compose.Po
-rm -f unit/$(DEPDIR)/connect.Po
+ -rm -f unit/$(DEPDIR)/connect_pipe.Po
+ -rm -f unit/$(DEPDIR)/consign.Po
-rm -f unit/$(DEPDIR)/coroutine.Po
-rm -f unit/$(DEPDIR)/deadline_timer.Po
-rm -f unit/$(DEPDIR)/defer.Po
+ -rm -f unit/$(DEPDIR)/deferred.Po
-rm -f unit/$(DEPDIR)/detached.Po
-rm -f unit/$(DEPDIR)/dispatch.Po
-rm -f unit/$(DEPDIR)/error.Po
-rm -f unit/$(DEPDIR)/execution_context.Po
-rm -f unit/$(DEPDIR)/executor.Po
-rm -f unit/$(DEPDIR)/executor_work_guard.Po
+ -rm -f unit/$(DEPDIR)/file_base.Po
-rm -f unit/$(DEPDIR)/high_resolution_timer.Po
-rm -f unit/$(DEPDIR)/io_context.Po
-rm -f unit/$(DEPDIR)/io_context_strand.Po
@@ -5381,17 +5962,24 @@ distclean: distclean-recursive
-rm -f unit/$(DEPDIR)/packaged_task.Po
-rm -f unit/$(DEPDIR)/placeholders.Po
-rm -f unit/$(DEPDIR)/post.Po
+ -rm -f unit/$(DEPDIR)/prepend.Po
+ -rm -f unit/$(DEPDIR)/random_access_file.Po
-rm -f unit/$(DEPDIR)/read.Po
-rm -f unit/$(DEPDIR)/read_at.Po
-rm -f unit/$(DEPDIR)/read_until.Po
+ -rm -f unit/$(DEPDIR)/readable_pipe.Po
+ -rm -f unit/$(DEPDIR)/recycling_allocator.Po
-rm -f unit/$(DEPDIR)/redirect_error.Po
+ -rm -f unit/$(DEPDIR)/registered_buffer.Po
-rm -f unit/$(DEPDIR)/serial_port.Po
-rm -f unit/$(DEPDIR)/serial_port_base.Po
-rm -f unit/$(DEPDIR)/signal_set.Po
+ -rm -f unit/$(DEPDIR)/signal_set_base.Po
-rm -f unit/$(DEPDIR)/socket_base.Po
-rm -f unit/$(DEPDIR)/static_thread_pool.Po
-rm -f unit/$(DEPDIR)/steady_timer.Po
-rm -f unit/$(DEPDIR)/strand.Po
+ -rm -f unit/$(DEPDIR)/stream_file.Po
-rm -f unit/$(DEPDIR)/streambuf.Po
-rm -f unit/$(DEPDIR)/system_context.Po
-rm -f unit/$(DEPDIR)/system_executor.Po
@@ -5404,37 +5992,33 @@ distclean: distclean-recursive
-rm -f unit/$(DEPDIR)/use_future.Po
-rm -f unit/$(DEPDIR)/uses_executor.Po
-rm -f unit/$(DEPDIR)/wait_traits.Po
+ -rm -f unit/$(DEPDIR)/writable_pipe.Po
-rm -f unit/$(DEPDIR)/write.Po
-rm -f unit/$(DEPDIR)/write_at.Po
-rm -f unit/execution/$(DEPDIR)/any_executor.Po
-rm -f unit/execution/$(DEPDIR)/blocking.Po
-rm -f unit/execution/$(DEPDIR)/blocking_adaptation.Po
- -rm -f unit/execution/$(DEPDIR)/bulk_execute.Po
- -rm -f unit/execution/$(DEPDIR)/bulk_guarantee.Po
- -rm -f unit/execution/$(DEPDIR)/connect.Po
-rm -f unit/execution/$(DEPDIR)/context_as.Po
- -rm -f unit/execution/$(DEPDIR)/execute.Po
-rm -f unit/execution/$(DEPDIR)/executor.Po
-rm -f unit/execution/$(DEPDIR)/invocable_archetype.Po
-rm -f unit/execution/$(DEPDIR)/mapping.Po
- -rm -f unit/execution/$(DEPDIR)/operation_state.Po
-rm -f unit/execution/$(DEPDIR)/outstanding_work.Po
-rm -f unit/execution/$(DEPDIR)/prefer_only.Po
- -rm -f unit/execution/$(DEPDIR)/receiver.Po
-rm -f unit/execution/$(DEPDIR)/relationship.Po
- -rm -f unit/execution/$(DEPDIR)/schedule.Po
- -rm -f unit/execution/$(DEPDIR)/scheduler.Po
- -rm -f unit/execution/$(DEPDIR)/sender.Po
- -rm -f unit/execution/$(DEPDIR)/set_done.Po
- -rm -f unit/execution/$(DEPDIR)/set_error.Po
- -rm -f unit/execution/$(DEPDIR)/set_value.Po
- -rm -f unit/execution/$(DEPDIR)/start.Po
- -rm -f unit/execution/$(DEPDIR)/submit.Po
-rm -f unit/experimental/$(DEPDIR)/awaitable_operators.Po
- -rm -f unit/experimental/$(DEPDIR)/deferred.Po
+ -rm -f unit/experimental/$(DEPDIR)/basic_channel.Po
+ -rm -f unit/experimental/$(DEPDIR)/basic_concurrent_channel.Po
+ -rm -f unit/experimental/$(DEPDIR)/channel.Po
+ -rm -f unit/experimental/$(DEPDIR)/channel_traits.Po
+ -rm -f unit/experimental/$(DEPDIR)/co_composed.Po
+ -rm -f unit/experimental/$(DEPDIR)/concurrent_channel.Po
+ -rm -f unit/experimental/$(DEPDIR)/parallel_group.Po
-rm -f unit/experimental/$(DEPDIR)/promise.Po
+ -rm -f unit/experimental/coro/$(DEPDIR)/allocator.Po
-rm -f unit/experimental/coro/$(DEPDIR)/cancel.Po
+ -rm -f unit/experimental/coro/$(DEPDIR)/co_spawn.Po
-rm -f unit/experimental/coro/$(DEPDIR)/exception.Po
+ -rm -f unit/experimental/coro/$(DEPDIR)/executor.Po
-rm -f unit/experimental/coro/$(DEPDIR)/partial.Po
-rm -f unit/experimental/coro/$(DEPDIR)/simple_test.Po
-rm -f unit/experimental/coro/$(DEPDIR)/stack_test.Po
@@ -5469,6 +6053,7 @@ distclean: distclean-recursive
-rm -f unit/local/$(DEPDIR)/basic_endpoint.Po
-rm -f unit/local/$(DEPDIR)/connect_pair.Po
-rm -f unit/local/$(DEPDIR)/datagram_protocol.Po
+ -rm -f unit/local/$(DEPDIR)/seq_packet_protocol.Po
-rm -f unit/local/$(DEPDIR)/stream_protocol.Po
-rm -f unit/posix/$(DEPDIR)/basic_descriptor.Po
-rm -f unit/posix/$(DEPDIR)/basic_stream_descriptor.Po
@@ -5552,26 +6137,40 @@ maintainer-clean: maintainer-clean-recursive
-rm -f latency/$(DEPDIR)/udp_server.Po
-rm -f performance/$(DEPDIR)/client.Po
-rm -f performance/$(DEPDIR)/server.Po
+ -rm -f unit/$(DEPDIR)/any_completion_executor.Po
+ -rm -f unit/$(DEPDIR)/any_completion_handler.Po
+ -rm -f unit/$(DEPDIR)/any_io_executor.Po
+ -rm -f unit/$(DEPDIR)/append.Po
+ -rm -f unit/$(DEPDIR)/as_tuple.Po
-rm -f unit/$(DEPDIR)/associated_allocator.Po
-rm -f unit/$(DEPDIR)/associated_cancellation_slot.Po
-rm -f unit/$(DEPDIR)/associated_executor.Po
+ -rm -f unit/$(DEPDIR)/associated_immediate_executor.Po
-rm -f unit/$(DEPDIR)/associator.Po
-rm -f unit/$(DEPDIR)/async_result.Po
-rm -f unit/$(DEPDIR)/awaitable.Po
-rm -f unit/$(DEPDIR)/basic_datagram_socket.Po
-rm -f unit/$(DEPDIR)/basic_deadline_timer.Po
+ -rm -f unit/$(DEPDIR)/basic_file.Po
+ -rm -f unit/$(DEPDIR)/basic_random_access_file.Po
-rm -f unit/$(DEPDIR)/basic_raw_socket.Po
+ -rm -f unit/$(DEPDIR)/basic_readable_pipe.Po
-rm -f unit/$(DEPDIR)/basic_seq_packet_socket.Po
-rm -f unit/$(DEPDIR)/basic_serial_port.Po
-rm -f unit/$(DEPDIR)/basic_signal_set.Po
-rm -f unit/$(DEPDIR)/basic_socket.Po
-rm -f unit/$(DEPDIR)/basic_socket_acceptor.Po
+ -rm -f unit/$(DEPDIR)/basic_stream_file.Po
-rm -f unit/$(DEPDIR)/basic_stream_socket.Po
-rm -f unit/$(DEPDIR)/basic_streambuf.Po
-rm -f unit/$(DEPDIR)/basic_waitable_timer.Po
+ -rm -f unit/$(DEPDIR)/basic_writable_pipe.Po
+ -rm -f unit/$(DEPDIR)/bind_allocator.Po
-rm -f unit/$(DEPDIR)/bind_cancellation_slot.Po
-rm -f unit/$(DEPDIR)/bind_executor.Po
+ -rm -f unit/$(DEPDIR)/bind_immediate_executor.Po
-rm -f unit/$(DEPDIR)/buffer.Po
+ -rm -f unit/$(DEPDIR)/buffer_registration.Po
-rm -f unit/$(DEPDIR)/buffered_read_stream.Po
-rm -f unit/$(DEPDIR)/buffered_stream.Po
-rm -f unit/$(DEPDIR)/buffered_write_stream.Po
@@ -5583,15 +6182,19 @@ maintainer-clean: maintainer-clean-recursive
-rm -f unit/$(DEPDIR)/completion_condition.Po
-rm -f unit/$(DEPDIR)/compose.Po
-rm -f unit/$(DEPDIR)/connect.Po
+ -rm -f unit/$(DEPDIR)/connect_pipe.Po
+ -rm -f unit/$(DEPDIR)/consign.Po
-rm -f unit/$(DEPDIR)/coroutine.Po
-rm -f unit/$(DEPDIR)/deadline_timer.Po
-rm -f unit/$(DEPDIR)/defer.Po
+ -rm -f unit/$(DEPDIR)/deferred.Po
-rm -f unit/$(DEPDIR)/detached.Po
-rm -f unit/$(DEPDIR)/dispatch.Po
-rm -f unit/$(DEPDIR)/error.Po
-rm -f unit/$(DEPDIR)/execution_context.Po
-rm -f unit/$(DEPDIR)/executor.Po
-rm -f unit/$(DEPDIR)/executor_work_guard.Po
+ -rm -f unit/$(DEPDIR)/file_base.Po
-rm -f unit/$(DEPDIR)/high_resolution_timer.Po
-rm -f unit/$(DEPDIR)/io_context.Po
-rm -f unit/$(DEPDIR)/io_context_strand.Po
@@ -5600,17 +6203,24 @@ maintainer-clean: maintainer-clean-recursive
-rm -f unit/$(DEPDIR)/packaged_task.Po
-rm -f unit/$(DEPDIR)/placeholders.Po
-rm -f unit/$(DEPDIR)/post.Po
+ -rm -f unit/$(DEPDIR)/prepend.Po
+ -rm -f unit/$(DEPDIR)/random_access_file.Po
-rm -f unit/$(DEPDIR)/read.Po
-rm -f unit/$(DEPDIR)/read_at.Po
-rm -f unit/$(DEPDIR)/read_until.Po
+ -rm -f unit/$(DEPDIR)/readable_pipe.Po
+ -rm -f unit/$(DEPDIR)/recycling_allocator.Po
-rm -f unit/$(DEPDIR)/redirect_error.Po
+ -rm -f unit/$(DEPDIR)/registered_buffer.Po
-rm -f unit/$(DEPDIR)/serial_port.Po
-rm -f unit/$(DEPDIR)/serial_port_base.Po
-rm -f unit/$(DEPDIR)/signal_set.Po
+ -rm -f unit/$(DEPDIR)/signal_set_base.Po
-rm -f unit/$(DEPDIR)/socket_base.Po
-rm -f unit/$(DEPDIR)/static_thread_pool.Po
-rm -f unit/$(DEPDIR)/steady_timer.Po
-rm -f unit/$(DEPDIR)/strand.Po
+ -rm -f unit/$(DEPDIR)/stream_file.Po
-rm -f unit/$(DEPDIR)/streambuf.Po
-rm -f unit/$(DEPDIR)/system_context.Po
-rm -f unit/$(DEPDIR)/system_executor.Po
@@ -5623,37 +6233,33 @@ maintainer-clean: maintainer-clean-recursive
-rm -f unit/$(DEPDIR)/use_future.Po
-rm -f unit/$(DEPDIR)/uses_executor.Po
-rm -f unit/$(DEPDIR)/wait_traits.Po
+ -rm -f unit/$(DEPDIR)/writable_pipe.Po
-rm -f unit/$(DEPDIR)/write.Po
-rm -f unit/$(DEPDIR)/write_at.Po
-rm -f unit/execution/$(DEPDIR)/any_executor.Po
-rm -f unit/execution/$(DEPDIR)/blocking.Po
-rm -f unit/execution/$(DEPDIR)/blocking_adaptation.Po
- -rm -f unit/execution/$(DEPDIR)/bulk_execute.Po
- -rm -f unit/execution/$(DEPDIR)/bulk_guarantee.Po
- -rm -f unit/execution/$(DEPDIR)/connect.Po
-rm -f unit/execution/$(DEPDIR)/context_as.Po
- -rm -f unit/execution/$(DEPDIR)/execute.Po
-rm -f unit/execution/$(DEPDIR)/executor.Po
-rm -f unit/execution/$(DEPDIR)/invocable_archetype.Po
-rm -f unit/execution/$(DEPDIR)/mapping.Po
- -rm -f unit/execution/$(DEPDIR)/operation_state.Po
-rm -f unit/execution/$(DEPDIR)/outstanding_work.Po
-rm -f unit/execution/$(DEPDIR)/prefer_only.Po
- -rm -f unit/execution/$(DEPDIR)/receiver.Po
-rm -f unit/execution/$(DEPDIR)/relationship.Po
- -rm -f unit/execution/$(DEPDIR)/schedule.Po
- -rm -f unit/execution/$(DEPDIR)/scheduler.Po
- -rm -f unit/execution/$(DEPDIR)/sender.Po
- -rm -f unit/execution/$(DEPDIR)/set_done.Po
- -rm -f unit/execution/$(DEPDIR)/set_error.Po
- -rm -f unit/execution/$(DEPDIR)/set_value.Po
- -rm -f unit/execution/$(DEPDIR)/start.Po
- -rm -f unit/execution/$(DEPDIR)/submit.Po
-rm -f unit/experimental/$(DEPDIR)/awaitable_operators.Po
- -rm -f unit/experimental/$(DEPDIR)/deferred.Po
+ -rm -f unit/experimental/$(DEPDIR)/basic_channel.Po
+ -rm -f unit/experimental/$(DEPDIR)/basic_concurrent_channel.Po
+ -rm -f unit/experimental/$(DEPDIR)/channel.Po
+ -rm -f unit/experimental/$(DEPDIR)/channel_traits.Po
+ -rm -f unit/experimental/$(DEPDIR)/co_composed.Po
+ -rm -f unit/experimental/$(DEPDIR)/concurrent_channel.Po
+ -rm -f unit/experimental/$(DEPDIR)/parallel_group.Po
-rm -f unit/experimental/$(DEPDIR)/promise.Po
+ -rm -f unit/experimental/coro/$(DEPDIR)/allocator.Po
-rm -f unit/experimental/coro/$(DEPDIR)/cancel.Po
+ -rm -f unit/experimental/coro/$(DEPDIR)/co_spawn.Po
-rm -f unit/experimental/coro/$(DEPDIR)/exception.Po
+ -rm -f unit/experimental/coro/$(DEPDIR)/executor.Po
-rm -f unit/experimental/coro/$(DEPDIR)/partial.Po
-rm -f unit/experimental/coro/$(DEPDIR)/simple_test.Po
-rm -f unit/experimental/coro/$(DEPDIR)/stack_test.Po
@@ -5688,6 +6294,7 @@ maintainer-clean: maintainer-clean-recursive
-rm -f unit/local/$(DEPDIR)/basic_endpoint.Po
-rm -f unit/local/$(DEPDIR)/connect_pair.Po
-rm -f unit/local/$(DEPDIR)/datagram_protocol.Po
+ -rm -f unit/local/$(DEPDIR)/seq_packet_protocol.Po
-rm -f unit/local/$(DEPDIR)/stream_protocol.Po
-rm -f unit/posix/$(DEPDIR)/basic_descriptor.Po
-rm -f unit/posix/$(DEPDIR)/basic_stream_descriptor.Po
diff --git a/3rdparty/asio/src/tests/latency/allocator.hpp b/3rdparty/asio/src/tests/latency/allocator.hpp
index ec437013eb7..2b186aef8ec 100644
--- a/3rdparty/asio/src/tests/latency/allocator.hpp
+++ b/3rdparty/asio/src/tests/latency/allocator.hpp
@@ -2,7 +2,7 @@
// allocator.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/latency/high_res_clock.hpp b/3rdparty/asio/src/tests/latency/high_res_clock.hpp
index 1467f86cb80..a497834d6d8 100644
--- a/3rdparty/asio/src/tests/latency/high_res_clock.hpp
+++ b/3rdparty/asio/src/tests/latency/high_res_clock.hpp
@@ -2,7 +2,7 @@
// high_res_clock.hpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/latency/tcp_client.cpp b/3rdparty/asio/src/tests/latency/tcp_client.cpp
index eb4c96d6d3b..2a4c5b7640f 100644
--- a/3rdparty/asio/src/tests/latency/tcp_client.cpp
+++ b/3rdparty/asio/src/tests/latency/tcp_client.cpp
@@ -2,7 +2,7 @@
// tcp_client.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/latency/tcp_server.cpp b/3rdparty/asio/src/tests/latency/tcp_server.cpp
index 59569509b24..c26c8509a45 100644
--- a/3rdparty/asio/src/tests/latency/tcp_server.cpp
+++ b/3rdparty/asio/src/tests/latency/tcp_server.cpp
@@ -2,7 +2,7 @@
// tcp_server.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/latency/udp_client.cpp b/3rdparty/asio/src/tests/latency/udp_client.cpp
index cb55cfdb210..484ba085cd8 100644
--- a/3rdparty/asio/src/tests/latency/udp_client.cpp
+++ b/3rdparty/asio/src/tests/latency/udp_client.cpp
@@ -2,7 +2,7 @@
// udp_client.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/latency/udp_server.cpp b/3rdparty/asio/src/tests/latency/udp_server.cpp
index 0bf333cfc4f..13483fab76f 100644
--- a/3rdparty/asio/src/tests/latency/udp_server.cpp
+++ b/3rdparty/asio/src/tests/latency/udp_server.cpp
@@ -2,7 +2,7 @@
// udp_server.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/performance/client.cpp b/3rdparty/asio/src/tests/performance/client.cpp
index 720b909ad4a..b42a6c50930 100644
--- a/3rdparty/asio/src/tests/performance/client.cpp
+++ b/3rdparty/asio/src/tests/performance/client.cpp
@@ -2,7 +2,7 @@
// client.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/performance/handler_allocator.hpp b/3rdparty/asio/src/tests/performance/handler_allocator.hpp
index 4f4a94e9195..6c1b98532ab 100644
--- a/3rdparty/asio/src/tests/performance/handler_allocator.hpp
+++ b/3rdparty/asio/src/tests/performance/handler_allocator.hpp
@@ -2,7 +2,7 @@
// handler_allocator.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/performance/server.cpp b/3rdparty/asio/src/tests/performance/server.cpp
index 374992178b3..9de3c1294f8 100644
--- a/3rdparty/asio/src/tests/performance/server.cpp
+++ b/3rdparty/asio/src/tests/performance/server.cpp
@@ -2,7 +2,7 @@
// server.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/Makefile.in b/3rdparty/asio/src/tests/properties/Makefile.in
index 344bf54cf0e..fb6b500f02e 100644
--- a/3rdparty/asio/src/tests/properties/Makefile.in
+++ b/3rdparty/asio/src/tests/properties/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1898,8 +1898,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
@@ -2082,6 +2080,7 @@ am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check recheck
TEST_SUITE_LOG = test-suite.log
@@ -2118,8 +2117,9 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
-CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -2128,9 +2128,8 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
-EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
-GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -2197,9 +2196,11 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -3828,7 +3829,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
echo "$${col}$$br$${std}"; \
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
@@ -5073,7 +5074,6 @@ cpp14/can_prefer_not_preferable_unsupported.log: cpp14/can_prefer_not_preferable
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_prefer.cpp
index e24f31bb0c1..e9784f60661 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_require.cpp
index ef2d216581a..693a46150d1 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_require.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_prefer.cpp
index 968e252aad5..011a34764dc 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_require.cpp
index d388248b142..9364391c935 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_require.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_prefer.cpp
index 1f87fa26591..8fd11c6f659 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_applicable_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_require.cpp
index 03816adb6a8..5c205ada2e7 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_require.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_applicable_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_prefer.cpp
index f86fa17cea9..15e93fd3a51 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_applicable_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_require.cpp
index 9f99138e175..0a0f1f6ecf0 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_require.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_applicable_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_static.cpp
index 493405acdac..f564d2fae01 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_unsupported.cpp
index 4699ef77b51..0711d7c4a4d 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_prefer.cpp
index 1d49f4c2c7b..3a522e5bed4 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_preferable_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_require.cpp
index 47fa9662103..39ea91fefcb 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_require.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_preferable_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_prefer.cpp
index 31d460f6057..e61f89872d0 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_preferable_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_require.cpp
index b6be9cac436..0052cc3ee50 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_require.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_preferable_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_static.cpp
index d634c64a517..f3428066587 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_static.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_preferable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_unsupported.cpp
index 3fb6f0bc14c..14695938c99 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_not_preferable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_static.cpp
index 3adeb26d02c..ac1f5c186aa 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_static.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_unsupported.cpp
index c3d95841f17..e59e5d098f8 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/can_prefer_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_free.cpp
index 9664a989e7d..d0d42fe7bdd 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_query_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_free.cpp
@@ -2,7 +2,7 @@
// cpp03/can_query_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_member.cpp
index 040dbba8baf..9ead9be9751 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_query_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_member.cpp
@@ -2,7 +2,7 @@
// cpp03/can_query_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_free.cpp
index 3a0344320f5..b360327c132 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_free.cpp
@@ -2,7 +2,7 @@
// cpp03/can_query_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_member.cpp
index b846c332943..be339d05522 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_member.cpp
@@ -2,7 +2,7 @@
// cpp03/can_query_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_static.cpp
index 4f41e2c2d6c..127e2ace42e 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp03/can_query_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_unsupported.cpp
index a59edd14b2b..ec1c07affc1 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/can_query_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_static.cpp
index a8c5e95d24d..9a305712f1d 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_query_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_static.cpp
@@ -2,7 +2,7 @@
// cpp03/can_query_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_unsupported.cpp
index bebd3cb3201..8eefbe9bd14 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_query_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/can_query_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_free.cpp
index a8cb9bbea0c..810dfc240a2 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_free.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_concept_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_member.cpp
index ca478809cfc..615e8a09cd7 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_member.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_concept_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_free.cpp
index 67b4b5fb245..c076dd416cd 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_free.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_concept_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_member.cpp
index e76a9838587..e6e258e8424 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_member.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_concept_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_static.cpp
index 171a7d254c4..c42a1b3fca4 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_concept_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_unsupported.cpp
index 02a6ff17515..261c4be3728 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_concept_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_static.cpp
index f2c328bf355..3c7d7bf4508 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_static.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_concept_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_unsupported.cpp
index 0d71c25c32c..0fbcbd36525 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_concept_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_free.cpp
index e8eb9788268..fdd9241efa0 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_free.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_member.cpp
index 9a89c4146c8..3f9a427333a 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_member.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_free.cpp
index afa26616096..4bf8ca32a2c 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_free.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_member.cpp
index 1a3bbdd3819..842c8d4bee9 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_member.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_static.cpp
index f35a5a10fc2..e8d9ac63aa2 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_unsupported.cpp
index f8aa00678eb..6fe234731dc 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_static.cpp
index 858c685d37f..5d4a65749b2 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_static.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_unsupported.cpp
index a58f47c64c9..f3bf74b0499 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/can_require_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/can_require_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_free_prefer.cpp
index b663bbcd9ca..dcf89c7f4af 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/prefer_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp03/prefer_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_free_require.cpp
index 357e25c9654..223d3a60921 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/prefer_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_free_require.cpp
@@ -2,7 +2,7 @@
// cpp03/prefer_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_member_prefer.cpp
index 8b814d049ab..538f7b2662a 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/prefer_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp03/prefer_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_member_require.cpp
index ee0b5efb090..f659b6fc2bd 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/prefer_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_member_require.cpp
@@ -2,7 +2,7 @@
// cpp03/prefer_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_static.cpp
index e75139966a8..f5fcb7f89a0 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/prefer_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_static.cpp
@@ -2,7 +2,7 @@
// cpp03/prefer_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_unsupported.cpp
index 7fad5253acc..25e0f308a4a 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/prefer_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp03/prefer_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/query_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/query_free.cpp
index 8611f725972..a9aae563293 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/query_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/query_free.cpp
@@ -2,7 +2,7 @@
// cpp03/query_free.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/query_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/query_member.cpp
index 71be73d58a6..a1ab83e0200 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/query_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/query_member.cpp
@@ -2,7 +2,7 @@
// cpp03/query_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/query_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/query_static.cpp
index aab3f4e8ac4..b0e0b4040e4 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/query_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/query_static.cpp
@@ -2,7 +2,7 @@
// cpp03/query_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_concept_free.cpp
index 5476d5cb69c..6cccdd2774e 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/require_concept_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/require_concept_free.cpp
@@ -2,7 +2,7 @@
// cpp03/require_concept_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_concept_member.cpp
index e3359eb11cf..673493292be 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/require_concept_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/require_concept_member.cpp
@@ -2,7 +2,7 @@
// cpp03/require_concept_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_concept_static.cpp
index 7f514cf052e..e92ffa1ef61 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/require_concept_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/require_concept_static.cpp
@@ -2,7 +2,7 @@
// cpp03/require_concept_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_free.cpp
index 50e99283f14..04734ac3192 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/require_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/require_free.cpp
@@ -2,7 +2,7 @@
// cpp03/require_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_member.cpp
index b3fea49348b..fc6bdc2c9c9 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/require_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/require_member.cpp
@@ -2,7 +2,7 @@
// cpp03/require_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_static.cpp
index 25e9e1d4ef1..33512b32924 100644
--- a/3rdparty/asio/src/tests/properties/cpp03/require_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp03/require_static.cpp
@@ -2,7 +2,7 @@
// cpp03/require_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_prefer.cpp
index 2ccdf2c7574..860fa6fad5b 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_require.cpp
index f5179ffb170..b842e9aa4e9 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_free_require.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_prefer.cpp
index 6c8d00a9b73..9f00cbcaf38 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_require.cpp
index 9ce08fa5cb7..a81bae1ae1c 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_member_require.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_prefer.cpp
index 766ba61c76a..9079c1fc832 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_applicable_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_require.cpp
index 29b19d39f7c..52fc618ac97 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_free_require.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_applicable_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_prefer.cpp
index 2774f1f29ef..93f0c85c934 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_applicable_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_require.cpp
index de3feb9e444..e17ec93f80a 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_member_require.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_applicable_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_static.cpp
index 73ddc0c3f11..9087ed42332 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_unsupported.cpp
index f3fd5a6e3e0..b09d15708a1 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_prefer.cpp
index 1d1dc98e199..28a1d151b2d 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_preferable_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_require.cpp
index ca4d5c3c8df..cbb105416a4 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_free_require.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_preferable_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_prefer.cpp
index a568e8b048b..2d460503b79 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_preferable_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_require.cpp
index 29eede3bd64..4e03c02d895 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_member_require.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_preferable_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_static.cpp
index 88d7fffd390..0791d8a02f5 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_static.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_preferable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_unsupported.cpp
index d1de18a0a81..059944ece37 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_not_preferable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_not_preferable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_static.cpp
index a7dd5dc3051..c928f7ffd63 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_static.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_unsupported.cpp
index cd3fc009075..32d6ac5c0d3 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_prefer_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_prefer_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/can_prefer_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_query_free.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_query_free.cpp
index 525c1111d80..330493ba328 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_query_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_query_free.cpp
@@ -2,7 +2,7 @@
// cpp11/can_query_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_query_member.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_query_member.cpp
index c4e562d16e8..e1442d9f296 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_query_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_query_member.cpp
@@ -2,7 +2,7 @@
// cpp11/can_query_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_free.cpp
index 76da584f8d6..2be49af0c64 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_free.cpp
@@ -2,7 +2,7 @@
// cpp11/can_query_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_member.cpp
index 8ae6d284998..788148df4a9 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_member.cpp
@@ -2,7 +2,7 @@
// cpp11/can_query_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_static.cpp
index 3f70747cb25..c57848c7a9f 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp11/can_query_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_unsupported.cpp
index 0eab9f9e0dd..79bff6231ab 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_query_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/can_query_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_query_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_query_static.cpp
index 1aae961ac63..6dc25819a43 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_query_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_query_static.cpp
@@ -2,7 +2,7 @@
// cpp11/can_query_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_query_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_query_unsupported.cpp
index 4d5bb401b7d..369955e474a 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_query_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_query_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/can_query_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_free.cpp
index 250bdce7df7..3dd617097a2 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_free.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_concept_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_member.cpp
index 81aaeadcc91..55ac468247b 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_member.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_concept_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_free.cpp
index 5a5acbbb962..af40b48bdec 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_free.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_concept_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_member.cpp
index dfa1d367d90..baf6b9f482f 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_member.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_concept_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_static.cpp
index ed1dbff5d45..7d7f13876d8 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_concept_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_unsupported.cpp
index 05ae9ff923a..13e05b231b5 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_concept_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_static.cpp
index 898f132f18b..07973a5bd14 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_static.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_concept_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_unsupported.cpp
index 878f16268f2..4a4fee1f705 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_concept_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_concept_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_free.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_free.cpp
index e248e9338f4..b66965e60e1 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_free.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_member.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_member.cpp
index 8f9fd03a97c..cac464174f1 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_member.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_free.cpp
index 20ed4ed0e8d..9705b87b244 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_free.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_member.cpp
index e896ad061a7..cd7f75fef34 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_member.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_static.cpp
index 6bb8faa0f75..f852e451513 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_unsupported.cpp
index 2dd98405224..e6286aba02c 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_static.cpp
index ee8d5555a67..4c1b38fc2c0 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_static.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/can_require_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/can_require_unsupported.cpp
index 0426abd46a6..bc9c4ed2072 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/can_require_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/can_require_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/can_require_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp11/prefer_free_prefer.cpp
index 0c42fdfc80b..3faf0019399 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/prefer_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/prefer_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp11/prefer_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp11/prefer_free_require.cpp
index 8597c0d38c1..f30d0fbb06f 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/prefer_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/prefer_free_require.cpp
@@ -2,7 +2,7 @@
// cpp11/prefer_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp11/prefer_member_prefer.cpp
index b97c45ff9ae..9803d5e5e95 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/prefer_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/prefer_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp11/prefer_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp11/prefer_member_require.cpp
index a896efd7437..701fb2dec81 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/prefer_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/prefer_member_require.cpp
@@ -2,7 +2,7 @@
// cpp11/prefer_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/prefer_static.cpp
index 721ff7ae037..18cd713d9d0 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/prefer_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/prefer_static.cpp
@@ -2,7 +2,7 @@
// cpp11/prefer_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp11/prefer_unsupported.cpp
index 0eaaf9105c5..8eb542301ec 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/prefer_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/prefer_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp11/prefer_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/query_free.cpp b/3rdparty/asio/src/tests/properties/cpp11/query_free.cpp
index 0a872cd0233..17a14dc3f5a 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/query_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/query_free.cpp
@@ -2,7 +2,7 @@
// cpp11/query_free.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/query_member.cpp b/3rdparty/asio/src/tests/properties/cpp11/query_member.cpp
index 0c9a576f8ea..18ea24171ab 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/query_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/query_member.cpp
@@ -2,7 +2,7 @@
// cpp11/query_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/query_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/query_static.cpp
index c7cde46cb01..3290ab0971f 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/query_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/query_static.cpp
@@ -2,7 +2,7 @@
// cpp11/query_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp11/require_concept_free.cpp
index 5179852e1ae..3f422988d2a 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/require_concept_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/require_concept_free.cpp
@@ -2,7 +2,7 @@
// cpp11/require_concept_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp11/require_concept_member.cpp
index 4f71dc0c22a..1f8bbf65b42 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/require_concept_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/require_concept_member.cpp
@@ -2,7 +2,7 @@
// cpp11/require_concept_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/require_concept_static.cpp
index 7f57963fb3d..b2a6f9dde39 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/require_concept_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/require_concept_static.cpp
@@ -2,7 +2,7 @@
// cpp11/require_concept_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/require_free.cpp b/3rdparty/asio/src/tests/properties/cpp11/require_free.cpp
index bd1569f361c..1acd5bc78ce 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/require_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/require_free.cpp
@@ -2,7 +2,7 @@
// cpp11/require_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/require_member.cpp b/3rdparty/asio/src/tests/properties/cpp11/require_member.cpp
index 545d2c3a112..e9192830811 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/require_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/require_member.cpp
@@ -2,7 +2,7 @@
// cpp11/require_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp11/require_static.cpp b/3rdparty/asio/src/tests/properties/cpp11/require_static.cpp
index 7ea70271312..e752dac10a4 100644
--- a/3rdparty/asio/src/tests/properties/cpp11/require_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp11/require_static.cpp
@@ -2,7 +2,7 @@
// cpp11/require_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_prefer.cpp
index 30e8a97bbdf..f7f2854233c 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_require.cpp
index 3f18f1c4f6e..a2a01e4d739 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_require.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_prefer.cpp
index 2140e3175c3..b0d9622bd5b 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_require.cpp
index 99b1cff35fa..9d1146ad323 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_require.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_prefer.cpp
index b1290243f7b..1a305fc3ae6 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_applicable_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_require.cpp
index e71bf759aa9..c5d732441d7 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_require.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_applicable_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_prefer.cpp
index 6caced35383..66af105ead3 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_applicable_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_require.cpp
index 3fb4c48c74a..a2bf20b6e89 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_require.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_applicable_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_static.cpp
index d5c275ee61d..123fd863f48 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_unsupported.cpp
index 2e9f78e7fed..ed67b39d6a2 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_prefer.cpp
index 7dc29e0d8a6..99cb8074746 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_preferable_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_require.cpp
index 964c259f883..0e3329de423 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_require.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_preferable_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_prefer.cpp
index 2f61538ea96..12213cd57e9 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_preferable_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_require.cpp
index 0bb32d97c5e..d801a808b4d 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_require.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_preferable_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_static.cpp
index 38c4309e9a0..cbaf4eecc46 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_static.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_preferable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_unsupported.cpp
index e9b18bf297f..aa37aedd3c6 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_not_preferable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_static.cpp
index 8437f9b62ec..3933a78839b 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_static.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_unsupported.cpp
index 0bf1ce07d9d..09ce8e02f18 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/can_prefer_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_free.cpp
index 1a6c19e9766..7654a78a06a 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_query_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_free.cpp
@@ -2,7 +2,7 @@
// cpp14/can_query_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_member.cpp
index 49bf42c387e..6bd6c02c98b 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_query_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_member.cpp
@@ -2,7 +2,7 @@
// cpp14/can_query_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_free.cpp
index c1b7ed540e7..bda1770699b 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_free.cpp
@@ -2,7 +2,7 @@
// cpp14/can_query_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_member.cpp
index 56e2dc5342d..25b6ab9c793 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_member.cpp
@@ -2,7 +2,7 @@
// cpp14/can_query_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_static.cpp
index 28e27c3529d..299a5e1f2a5 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp14/can_query_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_unsupported.cpp
index 1b89d2b02a6..cec0aea9167 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/can_query_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_static.cpp
index 7d1bb34fd7c..67b19ac74ed 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_query_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_static.cpp
@@ -2,7 +2,7 @@
// cpp14/can_query_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_unsupported.cpp
index 34c752c367d..7e8f63f1405 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_query_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/can_query_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_free.cpp
index ff5163bc02b..e0dea96edf0 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_free.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_concept_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_member.cpp
index 8d2d1b16a53..7da0a580a6f 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_member.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_concept_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_free.cpp
index 80b857747ca..f6d48165356 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_free.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_concept_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_member.cpp
index 9e6691030b8..5252cb77447 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_member.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_concept_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_static.cpp
index 304acf95bdf..7da83a988fb 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_concept_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_unsupported.cpp
index d6154dc4e3b..939b450be73 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_concept_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_static.cpp
index 845e800d64c..577363a0eea 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_static.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_concept_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_unsupported.cpp
index 2b68ec48e3f..2bcdc6c7606 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_concept_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_free.cpp
index 1d1bfe3cbda..f0bda074d5a 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_free.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_member.cpp
index 0bb144c24a6..0eeb0aa45c5 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_member.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_free.cpp
index ce377e825e3..f68576e2f1c 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_free.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_member.cpp
index 2e4479ee6a7..1c7aa953aeb 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_member.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_static.cpp
index 19fe61e0c12..ba7b5a80ccc 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_static.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_unsupported.cpp
index b86790f8269..25d71e35d48 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_static.cpp
index 27f802e4c52..f92c0b56c8a 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_static.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_unsupported.cpp
index 9c06f0dc905..4cf2756d40b 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/can_require_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/can_require_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_free_prefer.cpp
index 5c49b9d56bb..fce83ed6b9f 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/prefer_free_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_free_prefer.cpp
@@ -2,7 +2,7 @@
// cpp14/prefer_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_free_require.cpp
index 9244a030554..349aebeb515 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/prefer_free_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_free_require.cpp
@@ -2,7 +2,7 @@
// cpp14/prefer_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_member_prefer.cpp
index 0b0b03055d5..56d29efd34c 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/prefer_member_prefer.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_member_prefer.cpp
@@ -2,7 +2,7 @@
// cpp14/prefer_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_member_require.cpp
index cdcad780c91..7b88df406e8 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/prefer_member_require.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_member_require.cpp
@@ -2,7 +2,7 @@
// cpp14/prefer_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_static.cpp
index 874f64673d6..8fd537ae74b 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/prefer_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_static.cpp
@@ -2,7 +2,7 @@
// cpp14/prefer_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_unsupported.cpp
index 34f7e0eb330..50b8da0f9d3 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/prefer_unsupported.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_unsupported.cpp
@@ -2,7 +2,7 @@
// cpp14/prefer_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/query_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/query_free.cpp
index 128e0d184c3..24be8dbe945 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/query_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/query_free.cpp
@@ -2,7 +2,7 @@
// cpp14/query_free.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/query_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/query_member.cpp
index 8c61f5405d9..fab0bed9d03 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/query_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/query_member.cpp
@@ -2,7 +2,7 @@
// cpp14/query_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/query_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/query_static.cpp
index c277fffaa54..d13ad85c3c6 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/query_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/query_static.cpp
@@ -2,7 +2,7 @@
// cpp14/query_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_concept_free.cpp
index 43ecc9c2328..d7323db95ba 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/require_concept_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/require_concept_free.cpp
@@ -2,7 +2,7 @@
// cpp14/require_concept_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_concept_member.cpp
index 99c43d336ed..e21dda3f6e4 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/require_concept_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/require_concept_member.cpp
@@ -2,7 +2,7 @@
// cpp14/require_concept_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_concept_static.cpp
index 1cb7c35d68c..523ed758061 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/require_concept_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/require_concept_static.cpp
@@ -2,7 +2,7 @@
// cpp14/require_concept_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_free.cpp
index a139175f032..32893ff26ee 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/require_free.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/require_free.cpp
@@ -2,7 +2,7 @@
// cpp14/require_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_member.cpp
index 80bde893291..f2e58aa2f76 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/require_member.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/require_member.cpp
@@ -2,7 +2,7 @@
// cpp14/require_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_static.cpp
index 86403d5c6d6..acdd7fbf499 100644
--- a/3rdparty/asio/src/tests/properties/cpp14/require_static.cpp
+++ b/3rdparty/asio/src/tests/properties/cpp14/require_static.cpp
@@ -2,7 +2,7 @@
// cpp14/require_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/any_completion_executor.cpp b/3rdparty/asio/src/tests/unit/any_completion_executor.cpp
new file mode 100644
index 00000000000..5d1d5b1e271
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/any_completion_executor.cpp
@@ -0,0 +1,463 @@
+//
+// any_completion_executor.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/any_completion_executor.hpp"
+
+#include <cstring>
+#include <functional>
+#include "asio/system_executor.hpp"
+#include "asio/thread_pool.hpp"
+#include "unit_test.hpp"
+
+using namespace asio;
+namespace bindns = std;
+
+static bool next_nothrow_new_fails = false;
+
+void* operator new(std::size_t n,
+ const std::nothrow_t&) noexcept
+{
+ if (next_nothrow_new_fails)
+ {
+ next_nothrow_new_fails = false;
+ return 0;
+ }
+ return ::operator new(n);
+}
+
+struct fat_executor
+{
+ fat_executor(int id)
+ : id_(id)
+ {
+ std::memset(data_, 0, sizeof(data_));
+ }
+
+ template <typename F>
+ void execute(const F&) const
+ {
+ }
+
+ friend bool operator==(const fat_executor& a,
+ const fat_executor& b) noexcept
+ {
+ return a.id_ == b.id_;
+ }
+
+ friend bool operator!=(const fat_executor& a,
+ const fat_executor& b) noexcept
+ {
+ return a.id_ != b.id_;
+ }
+
+ int id_;
+ unsigned char data_[1024];
+};
+
+namespace asio {
+namespace traits {
+
+#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
+
+template <typename F>
+struct execute_member<fat_executor, F>
+{
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
+ typedef void result_type;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
+
+#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
+
+template <>
+struct equality_comparable<fat_executor>
+{
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
+
+} // namespace traits
+} // namespace asio
+
+void increment(int* count)
+{
+ ++(*count);
+}
+
+void any_completion_executor_construction_test()
+{
+ thread_pool pool(1);
+ asio::nullptr_t null_ptr = asio::nullptr_t();
+
+ asio::any_completion_executor ex1;
+
+ ASIO_CHECK(ex1.target<void>() == 0);
+ ASIO_CHECK(ex1 == null_ptr);
+
+ asio::any_completion_executor ex2(null_ptr);
+
+ ASIO_CHECK(ex2.target<void>() == 0);
+ ASIO_CHECK(ex2 == null_ptr);
+ ASIO_CHECK(ex2 == ex1);
+
+ asio::any_completion_executor ex3(pool.executor());
+
+ ASIO_CHECK(ex3.target<void>() != 0);
+ ASIO_CHECK(ex3 != null_ptr);
+ ASIO_CHECK(ex3 != ex1);
+
+ asio::any_completion_executor ex4(ex1);
+
+ ASIO_CHECK(ex4.target<void>() == 0);
+ ASIO_CHECK(ex4 == null_ptr);
+ ASIO_CHECK(ex4 == ex1);
+
+ asio::any_completion_executor ex5(ex3);
+
+ ASIO_CHECK(ex5.target<void>() != 0);
+ ASIO_CHECK(ex5 != null_ptr);
+ ASIO_CHECK(ex5 == ex3);
+
+ asio::any_completion_executor ex6 = fat_executor(1);
+
+ ASIO_CHECK(ex6.target<void>() != 0);
+ ASIO_CHECK(ex6 != null_ptr);
+ ASIO_CHECK(ex6 != ex1);
+
+ asio::any_completion_executor ex7 = fat_executor(1);
+
+ ASIO_CHECK(ex7.target<void>() != 0);
+ ASIO_CHECK(ex7 != null_ptr);
+ ASIO_CHECK(ex7 != ex1);
+ ASIO_CHECK(ex7 == ex6);
+
+ asio::any_completion_executor ex8 = fat_executor(2);
+
+ ASIO_CHECK(ex8.target<void>() != 0);
+ ASIO_CHECK(ex8 != null_ptr);
+ ASIO_CHECK(ex8 != ex1);
+ ASIO_CHECK(ex8 != ex6);
+ ASIO_CHECK(ex8 != ex7);
+
+ asio::any_completion_executor ex9(ex6);
+
+ ASIO_CHECK(ex9.target<void>() != 0);
+ ASIO_CHECK(ex9 != null_ptr);
+ ASIO_CHECK(ex9 != ex1);
+ ASIO_CHECK(ex9 == ex6);
+ ASIO_CHECK(ex9 == ex7);
+ ASIO_CHECK(ex9 != ex8);
+
+ asio::any_completion_executor ex10(std::move(ex1));
+
+ ASIO_CHECK(ex10.target<void>() == 0);
+ ASIO_CHECK(ex10 == null_ptr);
+ ASIO_CHECK(ex1.target<void>() == 0);
+ ASIO_CHECK(ex1 == null_ptr);
+
+ asio::any_completion_executor ex11(std::move(ex3));
+
+ ASIO_CHECK(ex11.target<void>() != 0);
+ ASIO_CHECK(ex11 != null_ptr);
+ ASIO_CHECK(ex3.target<void>() == 0);
+ ASIO_CHECK(ex3 == null_ptr);
+ ASIO_CHECK(ex11 == ex5);
+
+ asio::any_completion_executor ex12(std::move(ex7));
+
+ ASIO_CHECK(ex12.target<void>() != 0);
+ ASIO_CHECK(ex12 != null_ptr);
+ ASIO_CHECK(ex7.target<void>() == 0);
+ ASIO_CHECK(ex7 == null_ptr);
+ ASIO_CHECK(ex12 == ex6);
+ ASIO_CHECK(ex12 != ex8);
+}
+
+void any_completion_executor_nothrow_construction_test()
+{
+ thread_pool pool(1);
+ asio::nullptr_t null_ptr = asio::nullptr_t();
+
+ asio::any_completion_executor ex1;
+
+ ASIO_CHECK(ex1.target<void>() == 0);
+ ASIO_CHECK(ex1 == null_ptr);
+
+ asio::any_completion_executor ex2(null_ptr);
+
+ ASIO_CHECK(ex2.target<void>() == 0);
+ ASIO_CHECK(ex2 == null_ptr);
+ ASIO_CHECK(ex2 == ex1);
+
+ asio::any_completion_executor ex3(std::nothrow, pool.executor());
+
+ ASIO_CHECK(ex3.target<void>() != 0);
+ ASIO_CHECK(ex3 != null_ptr);
+ ASIO_CHECK(ex3 != ex1);
+
+ asio::any_completion_executor ex4(std::nothrow, ex1);
+
+ ASIO_CHECK(ex4.target<void>() == 0);
+ ASIO_CHECK(ex4 == null_ptr);
+ ASIO_CHECK(ex4 == ex1);
+
+ asio::any_completion_executor ex5(std::nothrow, ex3);
+
+ ASIO_CHECK(ex5.target<void>() != 0);
+ ASIO_CHECK(ex5 != null_ptr);
+ ASIO_CHECK(ex5 == ex3);
+
+ asio::any_completion_executor ex6(std::nothrow, fat_executor(1));
+
+ ASIO_CHECK(ex6.target<void>() != 0);
+ ASIO_CHECK(ex6 != null_ptr);
+ ASIO_CHECK(ex6 != ex1);
+
+ asio::any_completion_executor ex7(std::nothrow, fat_executor(1));
+
+ ASIO_CHECK(ex7.target<void>() != 0);
+ ASIO_CHECK(ex7 != null_ptr);
+ ASIO_CHECK(ex7 != ex1);
+ ASIO_CHECK(ex7 == ex6);
+
+ asio::any_completion_executor ex8(std::nothrow, fat_executor(2));
+
+ ASIO_CHECK(ex8.target<void>() != 0);
+ ASIO_CHECK(ex8 != null_ptr);
+ ASIO_CHECK(ex8 != ex1);
+ ASIO_CHECK(ex8 != ex6);
+ ASIO_CHECK(ex8 != ex7);
+
+ asio::any_completion_executor ex9(std::nothrow, ex6);
+
+ ASIO_CHECK(ex9.target<void>() != 0);
+ ASIO_CHECK(ex9 != null_ptr);
+ ASIO_CHECK(ex9 != ex1);
+ ASIO_CHECK(ex9 == ex6);
+ ASIO_CHECK(ex9 == ex7);
+ ASIO_CHECK(ex9 != ex8);
+
+ asio::any_completion_executor ex10(std::nothrow, std::move(ex1));
+
+ ASIO_CHECK(ex10.target<void>() == 0);
+ ASIO_CHECK(ex10 == null_ptr);
+ ASIO_CHECK(ex1.target<void>() == 0);
+ ASIO_CHECK(ex1 == null_ptr);
+
+ asio::any_completion_executor ex11(std::nothrow, std::move(ex3));
+
+ ASIO_CHECK(ex11.target<void>() != 0);
+ ASIO_CHECK(ex11 != null_ptr);
+ ASIO_CHECK(ex3.target<void>() == 0);
+ ASIO_CHECK(ex3 == null_ptr);
+ ASIO_CHECK(ex11 == ex5);
+
+ asio::any_completion_executor ex12(std::nothrow, std::move(ex7));
+
+ ASIO_CHECK(ex12.target<void>() != 0);
+ ASIO_CHECK(ex12 != null_ptr);
+ ASIO_CHECK(ex7.target<void>() == 0);
+ ASIO_CHECK(ex7 == null_ptr);
+ ASIO_CHECK(ex12 == ex6);
+ ASIO_CHECK(ex12 != ex8);
+
+ next_nothrow_new_fails = true;
+ asio::any_completion_executor ex13(std::nothrow, fat_executor(3));
+
+ ASIO_CHECK(ex13.target<void>() == 0);
+ ASIO_CHECK(ex13 == null_ptr);
+ ASIO_CHECK(ex13 == ex1);
+}
+
+void any_completion_executor_assignment_test()
+{
+ thread_pool pool(1);
+ asio::nullptr_t null_ptr = asio::nullptr_t();
+
+ asio::any_completion_executor ex1;
+
+ asio::any_completion_executor ex2;
+ ex2 = null_ptr;
+
+ ASIO_CHECK(ex2.target<void>() == 0);
+
+ asio::any_completion_executor ex3;
+ ex3 = pool.executor();
+
+ ASIO_CHECK(ex3.target<void>() != 0);
+
+ asio::any_completion_executor ex4;
+ ex4 = ex1;
+
+ ASIO_CHECK(ex4.target<void>() == 0);
+ ASIO_CHECK(ex4 == ex1);
+
+ ex4 = ex3;
+
+ ASIO_CHECK(ex4.target<void>() != 0);
+ ASIO_CHECK(ex4 == ex3);
+
+ asio::any_completion_executor ex5;
+ ex5 = fat_executor(1);
+
+ ASIO_CHECK(ex5.target<void>() != 0);
+ ASIO_CHECK(ex5 != null_ptr);
+ ASIO_CHECK(ex5 != ex1);
+
+ asio::any_completion_executor ex6;
+ ex6 = fat_executor(1);
+
+ ASIO_CHECK(ex6.target<void>() != 0);
+ ASIO_CHECK(ex6 != null_ptr);
+ ASIO_CHECK(ex6 != ex1);
+ ASIO_CHECK(ex6 == ex5);
+
+ ex6 = fat_executor(2);
+
+ ASIO_CHECK(ex6.target<void>() != 0);
+ ASIO_CHECK(ex6 != null_ptr);
+ ASIO_CHECK(ex6 != ex1);
+ ASIO_CHECK(ex6 != ex5);
+
+ asio::any_completion_executor ex7;
+ ex7 = ex5;
+
+ ASIO_CHECK(ex7.target<void>() != 0);
+ ASIO_CHECK(ex7 != null_ptr);
+ ASIO_CHECK(ex7 != ex1);
+ ASIO_CHECK(ex7 == ex5);
+ ASIO_CHECK(ex7 != ex6);
+
+ asio::any_completion_executor ex8;
+ ex8 = std::move(ex1);
+
+ ASIO_CHECK(ex8.target<void>() == 0);
+ ASIO_CHECK(ex1.target<void>() == 0);
+
+ ex8 = std::move(ex3);
+
+ ASIO_CHECK(ex8.target<void>() != 0);
+ ASIO_CHECK(ex3.target<void>() == 0);
+ ASIO_CHECK(ex8 == ex4);
+
+ ex8 = std::move(ex5);
+
+ ASIO_CHECK(ex8.target<void>() != 0);
+ ASIO_CHECK(ex5.target<void>() == 0);
+ ASIO_CHECK(ex8 == ex7);
+}
+
+void any_completion_executor_swap_test()
+{
+ thread_pool pool1(1);
+ thread_pool pool2(1);
+
+ asio::any_completion_executor ex1(pool1.executor());
+ asio::any_completion_executor ex2(pool2.executor());
+
+ asio::any_completion_executor ex3(ex1);
+ asio::any_completion_executor ex4(ex2);
+
+ ASIO_CHECK(ex3 == ex1);
+ ASIO_CHECK(ex4 == ex2);
+
+ ex3.swap(ex4);
+
+ ASIO_CHECK(ex3 == ex2);
+ ASIO_CHECK(ex4 == ex1);
+
+ execution::swap(ex3, ex4);
+
+ ASIO_CHECK(ex3 == ex1);
+ ASIO_CHECK(ex4 == ex2);
+}
+
+void any_completion_executor_query_test()
+{
+ thread_pool pool(1);
+ asio::any_completion_executor ex(pool.executor());
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::blocking)
+ == asio::execution::blocking.possibly);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::blocking.possibly)
+ == asio::execution::blocking.possibly);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::outstanding_work)
+ == asio::execution::outstanding_work.untracked);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::outstanding_work.untracked)
+ == asio::execution::outstanding_work.untracked);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::relationship)
+ == asio::execution::relationship.fork);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::relationship.fork)
+ == asio::execution::relationship.fork);
+}
+
+void any_completion_executor_execute_test()
+{
+ int count = 0;
+ thread_pool pool(1);
+ asio::any_completion_executor ex(pool.executor());
+
+ ex.execute(bindns::bind(increment, &count));
+
+ asio::prefer(ex, asio::execution::blocking.possibly).execute(
+ bindns::bind(increment, &count));
+
+ asio::prefer(ex,
+ asio::execution::blocking.possibly,
+ asio::execution::outstanding_work.tracked
+ ).execute(bindns::bind(increment, &count));
+
+ asio::prefer(ex,
+ asio::execution::blocking.possibly,
+ asio::execution::outstanding_work.untracked
+ ).execute(bindns::bind(increment, &count));
+
+ asio::prefer(ex,
+ asio::execution::blocking.possibly,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation
+ ).execute(bindns::bind(increment, &count));
+
+ pool.wait();
+
+ ASIO_CHECK(count == 5);
+}
+
+ASIO_TEST_SUITE
+(
+ "any_completion_executor",
+ ASIO_TEST_CASE(any_completion_executor_construction_test)
+ ASIO_TEST_CASE(any_completion_executor_nothrow_construction_test)
+ ASIO_TEST_CASE(any_completion_executor_assignment_test)
+ ASIO_TEST_CASE(any_completion_executor_swap_test)
+ ASIO_TEST_CASE(any_completion_executor_query_test)
+ ASIO_TEST_CASE(any_completion_executor_execute_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/any_completion_handler.cpp b/3rdparty/asio/src/tests/unit/any_completion_handler.cpp
new file mode 100644
index 00000000000..887402de8d3
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/any_completion_handler.cpp
@@ -0,0 +1,260 @@
+//
+// any_completion_handler.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/any_completion_handler.hpp"
+
+#include "unit_test.hpp"
+
+#include <functional>
+#include "asio/bind_allocator.hpp"
+#include "asio/bind_cancellation_slot.hpp"
+#include "asio/bind_executor.hpp"
+#include "asio/bind_immediate_executor.hpp"
+#include "asio/error.hpp"
+#include "asio/thread_pool.hpp"
+
+namespace bindns = std;
+
+void increment(int* count)
+{
+ ++(*count);
+}
+
+void any_completion_handler_construction_test()
+{
+ int count = 0;
+ asio::nullptr_t null_ptr = asio::nullptr_t();
+
+ asio::any_completion_handler<void()> h1;
+
+ ASIO_CHECK(!h1);
+ ASIO_CHECK(h1 == null_ptr);
+
+ asio::any_completion_handler<void()> h2(null_ptr);
+
+ ASIO_CHECK(!h2);
+ ASIO_CHECK(h2 == null_ptr);
+
+ asio::any_completion_handler<void()> h3(
+ bindns::bind(&increment, &count));
+
+ ASIO_CHECK(!!h3);
+ ASIO_CHECK(h3 != null_ptr);
+
+ asio::any_completion_handler<void()> h4(std::move(h1));
+
+ ASIO_CHECK(!h4);
+ ASIO_CHECK(h4 == null_ptr);
+ ASIO_CHECK(!h1);
+ ASIO_CHECK(h1 == null_ptr);
+
+ asio::any_completion_handler<void()> h5(std::move(h3));
+
+ ASIO_CHECK(!!h5);
+ ASIO_CHECK(h5 != null_ptr);
+ ASIO_CHECK(!h3);
+ ASIO_CHECK(h3 == null_ptr);
+
+ asio::any_completion_handler<void()> h6(std::move(h5));
+
+ ASIO_CHECK(!!h6);
+ ASIO_CHECK(h6 != null_ptr);
+ ASIO_CHECK(!h5);
+ ASIO_CHECK(h5 == null_ptr);
+}
+
+void any_completion_handler_assignment_test()
+{
+ int count = 0;
+ asio::nullptr_t null_ptr = asio::nullptr_t();
+
+ asio::any_completion_handler<void()> h1;
+
+ asio::any_completion_handler<void()> h2;
+ h2 = null_ptr;
+
+ ASIO_CHECK(!h2);
+
+ asio::any_completion_handler<void()> h3;
+ h3 = bindns::bind(&increment, &count);
+
+ ASIO_CHECK(!!h3);
+
+ asio::any_completion_handler<void()> h4;
+ h4 = std::move(h1);
+
+ ASIO_CHECK(!h4);
+ ASIO_CHECK(!h1);
+
+ h4 = std::move(h3);
+
+ ASIO_CHECK(!!h4);
+ ASIO_CHECK(!h3);
+}
+
+template <typename T>
+class handler_allocator
+{
+public:
+ using value_type = T;
+
+ explicit handler_allocator(int* count)
+ : count_(count)
+ {
+ }
+
+ template <typename U>
+ handler_allocator(const handler_allocator<U>& other) noexcept
+ : count_(other.count_)
+ {
+ }
+
+ bool operator==(const handler_allocator& other) const noexcept
+ {
+ return &count_ == &other.count_;
+ }
+
+ bool operator!=(const handler_allocator& other) const noexcept
+ {
+ return &count_ != &other.count_;
+ }
+
+ T* allocate(std::size_t n) const
+ {
+ ++(*count_);
+ return static_cast<T*>(::operator new(sizeof(T) * n));
+ }
+
+ void deallocate(T* p, std::size_t /*n*/) const
+ {
+ ::operator delete(p);
+ }
+
+private:
+ template <typename> friend class handler_allocator;
+
+ int* count_;
+};
+
+class cancel_handler
+{
+public:
+ explicit cancel_handler(int* count)
+ : count_(count)
+ {
+ }
+
+ void operator()(asio::cancellation_type_t)
+ {
+ ++(*count_);
+ }
+
+private:
+ int* count_;
+};
+
+void any_completion_handler_associator_test()
+{
+ typedef asio::any_completion_handler<void()> handler_type;
+
+ int count = 0;
+ int alloc_count = 0;
+ int cancel_count = 0;
+ asio::thread_pool pool(1);
+ asio::cancellation_signal sig;
+
+ asio::any_completion_handler<void()> h1(
+ asio::bind_allocator(handler_allocator<char>(&alloc_count),
+ asio::bind_cancellation_slot(sig.slot(),
+ asio::bind_executor(pool.get_executor(),
+ asio::bind_immediate_executor(asio::system_executor(),
+ bindns::bind(&increment, &count))))));
+
+ ASIO_CHECK(alloc_count == 1);
+
+ ASIO_REBIND_ALLOC(asio::associated_allocator<handler_type>::type,
+ char) alloc1(asio::get_associated_allocator(h1));
+ alloc1.deallocate(alloc1.allocate(1), 1);
+
+ ASIO_CHECK(alloc_count == 2);
+
+ asio::associated_cancellation_slot<handler_type>::type slot1
+ = asio::get_associated_cancellation_slot(h1);
+
+ ASIO_CHECK(slot1.is_connected());
+
+ slot1.emplace<cancel_handler>(&cancel_count);
+
+ ASIO_CHECK(cancel_count == 0);
+
+ sig.emit(asio::cancellation_type::terminal);
+
+ ASIO_CHECK(cancel_count == 1);
+
+ asio::associated_executor<handler_type>::type ex1
+ = asio::get_associated_executor(h1);
+
+ ASIO_CHECK(ex1 == pool.get_executor());
+
+ asio::associated_immediate_executor<
+ handler_type, asio::thread_pool::executor_type>::type ex2
+ = asio::get_associated_immediate_executor(h1, pool.get_executor());
+
+ ASIO_CHECK(ex2 == asio::system_executor());
+}
+
+void increment_with_error(asio::error_code ec,
+ asio::error_code* out_ec, int* count)
+{
+ *out_ec = ec;
+ ++(*count);
+}
+
+void any_completion_handler_invocation_test()
+{
+ int count = 0;
+ asio::error_code ec;
+
+ asio::any_completion_handler<void()> h1(
+ bindns::bind(&increment, &count));
+
+ ASIO_CHECK(count == 0);
+
+ std::move(h1)();
+
+ ASIO_CHECK(count == 1);
+
+ asio::any_completion_handler<void(asio::error_code)> h2(
+ bindns::bind(&increment_with_error,
+ bindns::placeholders::_1, &ec, &count));
+
+ ASIO_CHECK(!ec);
+ ASIO_CHECK(count == 1);
+
+ std::move(h2)(asio::error::eof);
+
+ ASIO_CHECK(ec == asio::error::eof);
+ ASIO_CHECK(count == 2);
+}
+
+ASIO_TEST_SUITE
+(
+ "any_completion_handler",
+ ASIO_TEST_CASE(any_completion_handler_construction_test)
+ ASIO_TEST_CASE(any_completion_handler_assignment_test)
+ ASIO_TEST_CASE(any_completion_handler_associator_test)
+ ASIO_TEST_CASE(any_completion_handler_invocation_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/any_io_executor.cpp b/3rdparty/asio/src/tests/unit/any_io_executor.cpp
new file mode 100644
index 00000000000..e0a32ba3838
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/any_io_executor.cpp
@@ -0,0 +1,515 @@
+//
+// any_io_executor.cpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/any_io_executor.hpp"
+
+#include <cstring>
+#include <functional>
+#include "asio/system_executor.hpp"
+#include "asio/thread_pool.hpp"
+#include "unit_test.hpp"
+
+using namespace asio;
+namespace bindns = std;
+
+static bool next_nothrow_new_fails = false;
+
+void* operator new(std::size_t n,
+ const std::nothrow_t&) noexcept
+{
+ if (next_nothrow_new_fails)
+ {
+ next_nothrow_new_fails = false;
+ return 0;
+ }
+ return ::operator new(n);
+}
+
+struct fat_executor
+{
+ fat_executor(int id)
+ : id_(id)
+ {
+ std::memset(data_, 0, sizeof(data_));
+ }
+
+ template <typename F>
+ void execute(const F&) const
+ {
+ }
+
+ execution_context& query(execution::context_t) const noexcept
+ {
+ return asio::query(system_executor(), execution::context);
+ }
+
+ constexpr static execution::blocking_t::never_t query(
+ execution::blocking_t) noexcept
+ {
+ return execution::blocking.never;
+ }
+
+ friend bool operator==(const fat_executor& a,
+ const fat_executor& b) noexcept
+ {
+ return a.id_ == b.id_;
+ }
+
+ friend bool operator!=(const fat_executor& a,
+ const fat_executor& b) noexcept
+ {
+ return a.id_ != b.id_;
+ }
+
+ int id_;
+ unsigned char data_[1024];
+};
+
+namespace asio {
+namespace traits {
+
+#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
+
+template <typename F>
+struct execute_member<fat_executor, F>
+{
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
+ typedef void result_type;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
+
+#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
+
+template <>
+struct query_member<fat_executor, execution::context_t>
+{
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
+ typedef execution_context& result_type;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
+
+#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
+
+template <typename Property>
+struct query_static_constexpr_member<fat_executor, Property,
+ typename asio::enable_if<
+ asio::is_convertible<
+ Property,
+ asio::execution::blocking_t
+ >::value
+ >::type
+ >
+{
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
+ typedef execution::blocking_t::never_t result_type;
+
+ static constexpr result_type value() noexcept
+ {
+ return result_type();
+ }
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
+
+#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
+
+template <>
+struct equality_comparable<fat_executor>
+{
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
+};
+
+#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
+
+} // namespace traits
+} // namespace asio
+
+void increment(int* count)
+{
+ ++(*count);
+}
+
+void any_io_executor_construction_test()
+{
+ thread_pool pool(1);
+ asio::nullptr_t null_ptr = asio::nullptr_t();
+
+ asio::any_io_executor ex1;
+
+ ASIO_CHECK(ex1.target<void>() == 0);
+ ASIO_CHECK(ex1 == null_ptr);
+
+ asio::any_io_executor ex2(null_ptr);
+
+ ASIO_CHECK(ex2.target<void>() == 0);
+ ASIO_CHECK(ex2 == null_ptr);
+ ASIO_CHECK(ex2 == ex1);
+
+ asio::any_io_executor ex3(pool.executor());
+
+ ASIO_CHECK(ex3.target<void>() != 0);
+ ASIO_CHECK(ex3 != null_ptr);
+ ASIO_CHECK(ex3 != ex1);
+
+ asio::any_io_executor ex4(ex1);
+
+ ASIO_CHECK(ex4.target<void>() == 0);
+ ASIO_CHECK(ex4 == null_ptr);
+ ASIO_CHECK(ex4 == ex1);
+
+ asio::any_io_executor ex5(ex3);
+
+ ASIO_CHECK(ex5.target<void>() != 0);
+ ASIO_CHECK(ex5 != null_ptr);
+ ASIO_CHECK(ex5 == ex3);
+
+ asio::any_io_executor ex6 = fat_executor(1);
+
+ ASIO_CHECK(ex6.target<void>() != 0);
+ ASIO_CHECK(ex6 != null_ptr);
+ ASIO_CHECK(ex6 != ex1);
+
+ asio::any_io_executor ex7 = fat_executor(1);
+
+ ASIO_CHECK(ex7.target<void>() != 0);
+ ASIO_CHECK(ex7 != null_ptr);
+ ASIO_CHECK(ex7 != ex1);
+ ASIO_CHECK(ex7 == ex6);
+
+ asio::any_io_executor ex8 = fat_executor(2);
+
+ ASIO_CHECK(ex8.target<void>() != 0);
+ ASIO_CHECK(ex8 != null_ptr);
+ ASIO_CHECK(ex8 != ex1);
+ ASIO_CHECK(ex8 != ex6);
+ ASIO_CHECK(ex8 != ex7);
+
+ asio::any_io_executor ex9(ex6);
+
+ ASIO_CHECK(ex9.target<void>() != 0);
+ ASIO_CHECK(ex9 != null_ptr);
+ ASIO_CHECK(ex9 != ex1);
+ ASIO_CHECK(ex9 == ex6);
+ ASIO_CHECK(ex9 == ex7);
+ ASIO_CHECK(ex9 != ex8);
+
+ asio::any_io_executor ex10(std::move(ex1));
+
+ ASIO_CHECK(ex10.target<void>() == 0);
+ ASIO_CHECK(ex10 == null_ptr);
+ ASIO_CHECK(ex1.target<void>() == 0);
+ ASIO_CHECK(ex1 == null_ptr);
+
+ asio::any_io_executor ex11(std::move(ex3));
+
+ ASIO_CHECK(ex11.target<void>() != 0);
+ ASIO_CHECK(ex11 != null_ptr);
+ ASIO_CHECK(ex3.target<void>() == 0);
+ ASIO_CHECK(ex3 == null_ptr);
+ ASIO_CHECK(ex11 == ex5);
+
+ asio::any_io_executor ex12(std::move(ex7));
+
+ ASIO_CHECK(ex12.target<void>() != 0);
+ ASIO_CHECK(ex12 != null_ptr);
+ ASIO_CHECK(ex7.target<void>() == 0);
+ ASIO_CHECK(ex7 == null_ptr);
+ ASIO_CHECK(ex12 == ex6);
+ ASIO_CHECK(ex12 != ex8);
+}
+
+void any_io_executor_nothrow_construction_test()
+{
+ thread_pool pool(1);
+ asio::nullptr_t null_ptr = asio::nullptr_t();
+
+ asio::any_io_executor ex1;
+
+ ASIO_CHECK(ex1.target<void>() == 0);
+ ASIO_CHECK(ex1 == null_ptr);
+
+ asio::any_io_executor ex2(null_ptr);
+
+ ASIO_CHECK(ex2.target<void>() == 0);
+ ASIO_CHECK(ex2 == null_ptr);
+ ASIO_CHECK(ex2 == ex1);
+
+ asio::any_io_executor ex3(std::nothrow, pool.executor());
+
+ ASIO_CHECK(ex3.target<void>() != 0);
+ ASIO_CHECK(ex3 != null_ptr);
+ ASIO_CHECK(ex3 != ex1);
+
+ asio::any_io_executor ex4(std::nothrow, ex1);
+
+ ASIO_CHECK(ex4.target<void>() == 0);
+ ASIO_CHECK(ex4 == null_ptr);
+ ASIO_CHECK(ex4 == ex1);
+
+ asio::any_io_executor ex5(std::nothrow, ex3);
+
+ ASIO_CHECK(ex5.target<void>() != 0);
+ ASIO_CHECK(ex5 != null_ptr);
+ ASIO_CHECK(ex5 == ex3);
+
+ asio::any_io_executor ex6(std::nothrow, fat_executor(1));
+
+ ASIO_CHECK(ex6.target<void>() != 0);
+ ASIO_CHECK(ex6 != null_ptr);
+ ASIO_CHECK(ex6 != ex1);
+
+ asio::any_io_executor ex7(std::nothrow, fat_executor(1));
+
+ ASIO_CHECK(ex7.target<void>() != 0);
+ ASIO_CHECK(ex7 != null_ptr);
+ ASIO_CHECK(ex7 != ex1);
+ ASIO_CHECK(ex7 == ex6);
+
+ asio::any_io_executor ex8(std::nothrow, fat_executor(2));
+
+ ASIO_CHECK(ex8.target<void>() != 0);
+ ASIO_CHECK(ex8 != null_ptr);
+ ASIO_CHECK(ex8 != ex1);
+ ASIO_CHECK(ex8 != ex6);
+ ASIO_CHECK(ex8 != ex7);
+
+ asio::any_io_executor ex9(std::nothrow, ex6);
+
+ ASIO_CHECK(ex9.target<void>() != 0);
+ ASIO_CHECK(ex9 != null_ptr);
+ ASIO_CHECK(ex9 != ex1);
+ ASIO_CHECK(ex9 == ex6);
+ ASIO_CHECK(ex9 == ex7);
+ ASIO_CHECK(ex9 != ex8);
+
+ asio::any_io_executor ex10(std::nothrow, std::move(ex1));
+
+ ASIO_CHECK(ex10.target<void>() == 0);
+ ASIO_CHECK(ex10 == null_ptr);
+ ASIO_CHECK(ex1.target<void>() == 0);
+ ASIO_CHECK(ex1 == null_ptr);
+
+ asio::any_io_executor ex11(std::nothrow, std::move(ex3));
+
+ ASIO_CHECK(ex11.target<void>() != 0);
+ ASIO_CHECK(ex11 != null_ptr);
+ ASIO_CHECK(ex3.target<void>() == 0);
+ ASIO_CHECK(ex3 == null_ptr);
+ ASIO_CHECK(ex11 == ex5);
+
+ asio::any_io_executor ex12(std::nothrow, std::move(ex7));
+
+ ASIO_CHECK(ex12.target<void>() != 0);
+ ASIO_CHECK(ex12 != null_ptr);
+ ASIO_CHECK(ex7.target<void>() == 0);
+ ASIO_CHECK(ex7 == null_ptr);
+ ASIO_CHECK(ex12 == ex6);
+ ASIO_CHECK(ex12 != ex8);
+
+ next_nothrow_new_fails = true;
+ asio::any_io_executor ex13(std::nothrow, fat_executor(3));
+
+ ASIO_CHECK(ex13.target<void>() == 0);
+ ASIO_CHECK(ex13 == null_ptr);
+ ASIO_CHECK(ex13 == ex1);
+}
+
+void any_io_executor_assignment_test()
+{
+ thread_pool pool(1);
+ asio::nullptr_t null_ptr = asio::nullptr_t();
+
+ asio::any_io_executor ex1;
+
+ asio::any_io_executor ex2;
+ ex2 = null_ptr;
+
+ ASIO_CHECK(ex2.target<void>() == 0);
+
+ asio::any_io_executor ex3;
+ ex3 = pool.executor();
+
+ ASIO_CHECK(ex3.target<void>() != 0);
+
+ asio::any_io_executor ex4;
+ ex4 = ex1;
+
+ ASIO_CHECK(ex4.target<void>() == 0);
+ ASIO_CHECK(ex4 == ex1);
+
+ ex4 = ex3;
+
+ ASIO_CHECK(ex4.target<void>() != 0);
+ ASIO_CHECK(ex4 == ex3);
+
+ asio::any_io_executor ex5;
+ ex5 = fat_executor(1);
+
+ ASIO_CHECK(ex5.target<void>() != 0);
+ ASIO_CHECK(ex5 != null_ptr);
+ ASIO_CHECK(ex5 != ex1);
+
+ asio::any_io_executor ex6;
+ ex6 = fat_executor(1);
+
+ ASIO_CHECK(ex6.target<void>() != 0);
+ ASIO_CHECK(ex6 != null_ptr);
+ ASIO_CHECK(ex6 != ex1);
+ ASIO_CHECK(ex6 == ex5);
+
+ ex6 = fat_executor(2);
+
+ ASIO_CHECK(ex6.target<void>() != 0);
+ ASIO_CHECK(ex6 != null_ptr);
+ ASIO_CHECK(ex6 != ex1);
+ ASIO_CHECK(ex6 != ex5);
+
+ asio::any_io_executor ex7;
+ ex7 = ex5;
+
+ ASIO_CHECK(ex7.target<void>() != 0);
+ ASIO_CHECK(ex7 != null_ptr);
+ ASIO_CHECK(ex7 != ex1);
+ ASIO_CHECK(ex7 == ex5);
+ ASIO_CHECK(ex7 != ex6);
+
+ asio::any_io_executor ex8;
+ ex8 = std::move(ex1);
+
+ ASIO_CHECK(ex8.target<void>() == 0);
+ ASIO_CHECK(ex1.target<void>() == 0);
+
+ ex8 = std::move(ex3);
+
+ ASIO_CHECK(ex8.target<void>() != 0);
+ ASIO_CHECK(ex3.target<void>() == 0);
+ ASIO_CHECK(ex8 == ex4);
+
+ ex8 = std::move(ex5);
+
+ ASIO_CHECK(ex8.target<void>() != 0);
+ ASIO_CHECK(ex5.target<void>() == 0);
+ ASIO_CHECK(ex8 == ex7);
+}
+
+void any_io_executor_swap_test()
+{
+ thread_pool pool1(1);
+ thread_pool pool2(1);
+
+ asio::any_io_executor ex1(pool1.executor());
+ asio::any_io_executor ex2(pool2.executor());
+
+ asio::any_io_executor ex3(ex1);
+ asio::any_io_executor ex4(ex2);
+
+ ASIO_CHECK(ex3 == ex1);
+ ASIO_CHECK(ex4 == ex2);
+
+ ex3.swap(ex4);
+
+ ASIO_CHECK(ex3 == ex2);
+ ASIO_CHECK(ex4 == ex1);
+
+ execution::swap(ex3, ex4);
+
+ ASIO_CHECK(ex3 == ex1);
+ ASIO_CHECK(ex4 == ex2);
+}
+
+void any_io_executor_query_test()
+{
+ thread_pool pool(1);
+ asio::any_io_executor ex(pool.executor());
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::blocking)
+ == asio::execution::blocking.possibly);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::blocking.possibly)
+ == asio::execution::blocking.possibly);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::outstanding_work)
+ == asio::execution::outstanding_work.untracked);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::outstanding_work.untracked)
+ == asio::execution::outstanding_work.untracked);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::relationship)
+ == asio::execution::relationship.fork);
+
+ ASIO_CHECK(
+ asio::query(ex, asio::execution::relationship.fork)
+ == asio::execution::relationship.fork);
+}
+
+void any_io_executor_execute_test()
+{
+ int count = 0;
+ thread_pool pool(1);
+ asio::any_io_executor ex(pool.executor());
+
+ ex.execute(bindns::bind(increment, &count));
+
+ asio::prefer(ex, asio::execution::blocking.possibly).execute(
+ bindns::bind(increment, &count));
+
+ asio::require(ex, asio::execution::blocking.never).execute(
+ bindns::bind(increment, &count));
+
+ asio::require(
+ asio::prefer(ex, asio::execution::outstanding_work.tracked),
+ asio::execution::blocking.never
+ ).execute(bindns::bind(increment, &count));
+
+ asio::require(
+ asio::prefer(ex,
+ asio::execution::outstanding_work.untracked),
+ asio::execution::blocking.never
+ ).execute(bindns::bind(increment, &count));
+
+ asio::require(
+ asio::prefer(ex,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation),
+ asio::execution::blocking.never
+ ).execute(bindns::bind(increment, &count));
+
+ pool.wait();
+
+ ASIO_CHECK(count == 6);
+}
+
+ASIO_TEST_SUITE
+(
+ "any_io_executor",
+ ASIO_TEST_CASE(any_io_executor_construction_test)
+ ASIO_TEST_CASE(any_io_executor_nothrow_construction_test)
+ ASIO_TEST_CASE(any_io_executor_assignment_test)
+ ASIO_TEST_CASE(any_io_executor_swap_test)
+ ASIO_TEST_CASE(any_io_executor_query_test)
+ ASIO_TEST_CASE(any_io_executor_execute_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/append.cpp b/3rdparty/asio/src/tests/unit/append.cpp
new file mode 100644
index 00000000000..9aa00e3bfa4
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/append.cpp
@@ -0,0 +1,58 @@
+//
+// append.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/append.hpp"
+
+#include "asio/bind_executor.hpp"
+#include "asio/io_context.hpp"
+#include "asio/post.hpp"
+#include "asio/system_timer.hpp"
+#include "unit_test.hpp"
+
+void append_test()
+{
+ asio::io_context io1;
+ asio::io_context io2;
+ asio::system_timer timer1(io1);
+ int count = 0;
+
+ timer1.expires_after(asio::chrono::seconds(0));
+ timer1.async_wait(
+ asio::append(
+ asio::bind_executor(io2.get_executor(),
+ [&count](asio::error_code, int a, int b)
+ {
+ ++count;
+ ASIO_CHECK(a == 123);
+ ASIO_CHECK(b == 321);
+ }), 123, 321));
+
+ ASIO_CHECK(count == 0);
+
+ io1.run();
+
+ ASIO_CHECK(count == 0);
+
+ io2.run();
+
+ ASIO_CHECK(count == 1);
+}
+
+ASIO_TEST_SUITE
+(
+ "append",
+ ASIO_TEST_CASE(append_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/archetypes/async_ops.hpp b/3rdparty/asio/src/tests/unit/archetypes/async_ops.hpp
index 80364af575b..3c2b1308bd8 100644
--- a/3rdparty/asio/src/tests/unit/archetypes/async_ops.hpp
+++ b/3rdparty/asio/src/tests/unit/archetypes/async_ops.hpp
@@ -1,8 +1,8 @@
//
-// async_ops.hpp
-// ~~~~~~~~~~~~~
+// archetypes/async_ops.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -11,30 +11,22 @@
#ifndef ARCHETYPES_ASYNC_OPS_HPP
#define ARCHETYPES_ASYNC_OPS_HPP
-#include <asio/associated_allocator.hpp>
-#include <asio/associated_executor.hpp>
-#include <asio/async_result.hpp>
-#include <asio/error.hpp>
-
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
+#include <functional>
+#include "asio/associated_allocator.hpp"
+#include "asio/associated_executor.hpp"
+#include "asio/async_result.hpp"
+#include "asio/error.hpp"
namespace archetypes {
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken, void())
-async_op_0(ASIO_MOVE_ARG(CompletionToken) token)
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void()>::return_type
+async_op_0(CompletionToken&& token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void()>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
@@ -46,16 +38,17 @@ async_op_0(ASIO_MOVE_ARG(CompletionToken) token)
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
- ex.post(ASIO_MOVE_CAST(handler_type)(completion.completion_handler), a);
+ ex.post(static_cast<handler_type&&>(completion.completion_handler), a);
return completion.result.get();
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken, void(asio::error_code))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(asio::error_code)>::return_type
async_op_ec_0(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
@@ -71,14 +64,14 @@ async_op_ec_0(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
asio::error_code()), a);
}
else
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(asio::error::operation_aborted)), a);
}
@@ -86,10 +79,11 @@ async_op_ec_0(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken, void(std::exception_ptr))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(std::exception_ptr)>::return_type
async_op_ex_0(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
@@ -105,14 +99,14 @@ async_op_ex_0(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
std::exception_ptr()), a);
}
else
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
std::make_exception_ptr(std::runtime_error("blah"))), a);
}
@@ -120,10 +114,11 @@ async_op_ex_0(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken, void(int))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(int)>::return_type
async_op_1(ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(int)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
@@ -137,18 +132,18 @@ async_op_1(ASIO_MOVE_ARG(CompletionToken) token)
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
42), a);
return completion.result.get();
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken,
- void(asio::error_code, int))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(asio::error_code, int)>::return_type
async_op_ec_1(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code, int)>::completion_handler_type
handler_type;
@@ -165,14 +160,14 @@ async_op_ec_1(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(), 42), a);
}
else
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(asio::error::operation_aborted),
0), a);
}
@@ -181,10 +176,11 @@ async_op_ec_1(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken, void(std::exception_ptr, int))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(std::exception_ptr, int)>::return_type
async_op_ex_1(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr, int)>::completion_handler_type
handler_type;
@@ -201,14 +197,14 @@ async_op_ex_1(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
std::exception_ptr(), 42), a);
}
else
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
std::make_exception_ptr(std::runtime_error("blah")), 0), a);
}
@@ -216,10 +212,11 @@ async_op_ex_1(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken, void(int, double))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(int, double)>::return_type
async_op_2(ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(int, double)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
@@ -233,18 +230,18 @@ async_op_2(ASIO_MOVE_ARG(CompletionToken) token)
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
42, 2.0), a);
return completion.result.get();
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken,
- void(asio::error_code, int, double))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(asio::error_code, int, double)>::return_type
async_op_ec_2(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code, int, double)>::completion_handler_type
handler_type;
@@ -261,14 +258,14 @@ async_op_ec_2(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(), 42, 2.0), a);
}
else
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(asio::error::operation_aborted),
0, 0.0), a);
}
@@ -277,11 +274,11 @@ async_op_ec_2(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken,
- void(std::exception_ptr, int, double))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(std::exception_ptr, int, double)>::return_type
async_op_ex_2(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr, int, double)>::completion_handler_type
handler_type;
@@ -298,14 +295,14 @@ async_op_ex_2(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
std::exception_ptr(), 42, 2.0), a);
}
else
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
std::make_exception_ptr(std::runtime_error("blah")), 0, 0.0), a);
}
@@ -313,10 +310,11 @@ async_op_ex_2(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken, void(int, double, char))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(int, double, char)>::return_type
async_op_3(ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(int, double, char)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
@@ -330,18 +328,18 @@ async_op_3(ASIO_MOVE_ARG(CompletionToken) token)
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
42, 2.0, 'a'), a);
return completion.result.get();
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken,
- void(asio::error_code, int, double, char))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(asio::error_code, int, double, char)>::return_type
async_op_ec_3(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code, int, double, char)>::completion_handler_type
handler_type;
@@ -358,14 +356,14 @@ async_op_ec_3(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(), 42, 2.0, 'a'), a);
}
else
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(asio::error::operation_aborted),
0, 0.0, 'z'), a);
}
@@ -374,11 +372,11 @@ async_op_ec_3(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
}
template <typename CompletionToken>
-ASIO_INITFN_RESULT_TYPE(CompletionToken,
- void(std::exception_ptr, int, double, char))
+typename asio::async_result<asio::decay_t<CompletionToken>,
+ void(std::exception_ptr, int, double, char)>::return_type
async_op_ex_3(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
- typedef typename asio::async_completion<CompletionToken,
+ typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr, int, double, char)>::completion_handler_type
handler_type;
@@ -395,14 +393,14 @@ async_op_ex_3(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
std::exception_ptr(), 42, 2.0, 'a'), a);
}
else
{
ex.post(
bindns::bind(
- ASIO_MOVE_CAST(handler_type)(completion.completion_handler),
+ static_cast<handler_type&&>(completion.completion_handler),
std::make_exception_ptr(std::runtime_error("blah")),
0, 0.0, 'z'), a);
}
diff --git a/3rdparty/asio/src/tests/unit/archetypes/async_result.hpp b/3rdparty/asio/src/tests/unit/archetypes/async_result.hpp
index 4c26a3f0c61..bfd9cf1aac2 100644
--- a/3rdparty/asio/src/tests/unit/archetypes/async_result.hpp
+++ b/3rdparty/asio/src/tests/unit/archetypes/async_result.hpp
@@ -2,7 +2,7 @@
// async_result.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -12,9 +12,14 @@
#define ARCHETYPES_ASYNC_RESULT_HPP
#include <asio/async_result.hpp>
+#include <asio/system_executor.hpp>
namespace archetypes {
+struct immediate_handler
+{
+};
+
struct lazy_handler
{
};
@@ -25,7 +30,7 @@ struct concrete_handler;
template <typename R, typename Arg1>
struct concrete_handler<R(Arg1)>
{
- concrete_handler(lazy_handler)
+ concrete_handler()
{
}
@@ -33,29 +38,53 @@ struct concrete_handler<R(Arg1)>
{
}
-#if defined(ASIO_HAS_MOVE)
concrete_handler(concrete_handler&&) {}
private:
concrete_handler(const concrete_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
template <typename R, typename Arg1, typename Arg2>
struct concrete_handler<R(Arg1, Arg2)>
{
- concrete_handler(lazy_handler)
+ concrete_handler()
{
}
- void operator()(typename asio::decay<Arg1>::type, typename asio::decay<Arg2>::type)
+ void operator()(typename asio::decay<Arg1>::type,
+ typename asio::decay<Arg2>::type)
{
}
+};
-#if defined(ASIO_HAS_MOVE)
- concrete_handler(concrete_handler&&) {}
+template <typename Signature>
+struct immediate_concrete_handler : concrete_handler<Signature>
+{
+ typedef asio::system_executor immediate_executor_type;
+
+ immediate_concrete_handler(immediate_handler)
+ {
+ }
+
+ immediate_executor_type get_immediate_executor() const noexcept
+ {
+ return immediate_executor_type();
+ }
+
+ immediate_concrete_handler(immediate_concrete_handler&&) {}
private:
- concrete_handler(const concrete_handler&);
-#endif // defined(ASIO_HAS_MOVE)
+ immediate_concrete_handler(const immediate_concrete_handler&);
+};
+
+template <typename Signature>
+struct lazy_concrete_handler : concrete_handler<Signature>
+{
+ lazy_concrete_handler(lazy_handler)
+ {
+ }
+
+ lazy_concrete_handler(lazy_concrete_handler&&) {}
+private:
+ lazy_concrete_handler(const lazy_concrete_handler&);
};
} // namespace archetypes
@@ -63,11 +92,38 @@ private:
namespace asio {
template <typename Signature>
+class async_result<archetypes::immediate_handler, Signature>
+{
+public:
+ // The concrete completion handler type.
+ typedef archetypes::immediate_concrete_handler<Signature>
+ completion_handler_type;
+
+ // The return type of the initiating function.
+ typedef void return_type;
+
+ // Construct an async_result from a given handler.
+ explicit async_result(completion_handler_type&)
+ {
+ }
+
+ // Obtain the value to be returned from the initiating function.
+ void get()
+ {
+ }
+
+private:
+ // Disallow copying and assignment.
+ async_result(const async_result&) = delete;
+ async_result& operator=(const async_result&) = delete;
+};
+
+template <typename Signature>
class async_result<archetypes::lazy_handler, Signature>
{
public:
// The concrete completion handler type.
- typedef archetypes::concrete_handler<Signature> completion_handler_type;
+ typedef archetypes::lazy_concrete_handler<Signature> completion_handler_type;
// The return type of the initiating function.
typedef int return_type;
@@ -85,8 +141,8 @@ public:
private:
// Disallow copying and assignment.
- async_result(const async_result&) ASIO_DELETED;
- async_result& operator=(const async_result&) ASIO_DELETED;
+ async_result(const async_result&) = delete;
+ async_result& operator=(const async_result&) = delete;
};
} // namespace asio
diff --git a/3rdparty/asio/src/tests/unit/archetypes/gettable_socket_option.hpp b/3rdparty/asio/src/tests/unit/archetypes/gettable_socket_option.hpp
index 17f1518f3ba..e1c2d3f0d4e 100644
--- a/3rdparty/asio/src/tests/unit/archetypes/gettable_socket_option.hpp
+++ b/3rdparty/asio/src/tests/unit/archetypes/gettable_socket_option.hpp
@@ -2,7 +2,7 @@
// gettable_socket_option.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/archetypes/io_control_command.hpp b/3rdparty/asio/src/tests/unit/archetypes/io_control_command.hpp
index 00bdd657079..45ed07cf481 100644
--- a/3rdparty/asio/src/tests/unit/archetypes/io_control_command.hpp
+++ b/3rdparty/asio/src/tests/unit/archetypes/io_control_command.hpp
@@ -2,7 +2,7 @@
// io_control_command.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/archetypes/settable_socket_option.hpp b/3rdparty/asio/src/tests/unit/archetypes/settable_socket_option.hpp
index 50b33d3ffad..7a5867ba800 100644
--- a/3rdparty/asio/src/tests/unit/archetypes/settable_socket_option.hpp
+++ b/3rdparty/asio/src/tests/unit/archetypes/settable_socket_option.hpp
@@ -2,7 +2,7 @@
// settable_socket_option.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/as_tuple.cpp b/3rdparty/asio/src/tests/unit/as_tuple.cpp
new file mode 100644
index 00000000000..a176d95bb2e
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/as_tuple.cpp
@@ -0,0 +1,122 @@
+//
+// as_tuple.cpp
+// ~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/as_tuple.hpp"
+
+#include "asio/bind_executor.hpp"
+#include "asio/deferred.hpp"
+#include "asio/io_context.hpp"
+#include "asio/post.hpp"
+#include "asio/system_timer.hpp"
+#include "asio/use_future.hpp"
+#include "unit_test.hpp"
+
+void as_tuple_test()
+{
+ asio::io_context io1;
+ asio::io_context io2;
+ asio::system_timer timer1(io1);
+ int count = 0;
+
+ timer1.expires_after(asio::chrono::seconds(0));
+ timer1.async_wait(
+ asio::as_tuple(
+ asio::bind_executor(io2.get_executor(),
+ [&count](std::tuple<asio::error_code>)
+ {
+ ++count;
+ })));
+
+ ASIO_CHECK(count == 0);
+
+ io1.run();
+
+ ASIO_CHECK(count == 0);
+
+ io2.run();
+
+ ASIO_CHECK(count == 1);
+
+ timer1.async_wait(
+ asio::as_tuple(
+ asio::bind_executor(io2.get_executor(),
+ asio::deferred)))(
+ [&count](std::tuple<asio::error_code>)
+ {
+ ++count;
+ });
+
+ ASIO_CHECK(count == 1);
+
+ io1.restart();
+ io1.run();
+
+ ASIO_CHECK(count == 1);
+
+ io2.restart();
+ io2.run();
+
+ ASIO_CHECK(count == 2);
+
+# if defined(ASIO_HAS_STD_FUTURE_CLASS)
+ std::future<std::tuple<asio::error_code> > f = timer1.async_wait(
+ asio::as_tuple(
+ asio::bind_executor(io2.get_executor(),
+ asio::use_future)));
+
+ ASIO_CHECK(f.wait_for(std::chrono::seconds(0))
+ == std::future_status::timeout);
+
+ io1.restart();
+ io1.run();
+
+ ASIO_CHECK(f.wait_for(std::chrono::seconds(0))
+ == std::future_status::timeout);
+
+ io2.restart();
+ io2.run();
+
+ ASIO_CHECK(f.wait_for(std::chrono::seconds(0))
+ == std::future_status::ready);
+# endif // defined(ASIO_HAS_STD_FUTURE_CLASS)
+}
+
+void as_tuple_constness_test()
+{
+# if defined(ASIO_HAS_STD_FUTURE_CLASS)
+ asio::io_context io1;
+ asio::system_timer timer1(io1);
+
+ auto tok1 = asio::as_tuple(asio::use_future);
+ (void)timer1.async_wait(tok1);
+ (void)timer1.async_wait(std::move(tok1));
+
+ const auto tok2 = asio::as_tuple(asio::use_future);
+ (void)timer1.async_wait(tok2);
+ (void)timer1.async_wait(std::move(tok2));
+
+ constexpr auto tok3 = asio::as_tuple(asio::use_future);
+ (void)timer1.async_wait(tok3);
+ (void)timer1.async_wait(std::move(tok3));
+# endif // defined(ASIO_HAS_STD_FUTURE_CLASS)
+}
+
+ASIO_TEST_SUITE
+(
+ "as_tuple",
+ ASIO_TEST_CASE(as_tuple_test)
+ ASIO_COMPILE_TEST_CASE(as_tuple_constness_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/associated_allocator.cpp b/3rdparty/asio/src/tests/unit/associated_allocator.cpp
index 63ee6828ed2..69a8afb0d41 100644
--- a/3rdparty/asio/src/tests/unit/associated_allocator.cpp
+++ b/3rdparty/asio/src/tests/unit/associated_allocator.cpp
@@ -2,7 +2,7 @@
// associated_allocator.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/associated_cancellation_slot.cpp b/3rdparty/asio/src/tests/unit/associated_cancellation_slot.cpp
index 9e1105d5332..96d488458cb 100644
--- a/3rdparty/asio/src/tests/unit/associated_cancellation_slot.cpp
+++ b/3rdparty/asio/src/tests/unit/associated_cancellation_slot.cpp
@@ -2,7 +2,7 @@
// associated_cancellation_slot.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/associated_executor.cpp b/3rdparty/asio/src/tests/unit/associated_executor.cpp
index c9533a84609..60b1f00657f 100644
--- a/3rdparty/asio/src/tests/unit/associated_executor.cpp
+++ b/3rdparty/asio/src/tests/unit/associated_executor.cpp
@@ -2,7 +2,7 @@
// associated_executor.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/associated_immediate_executor.cpp b/3rdparty/asio/src/tests/unit/associated_immediate_executor.cpp
new file mode 100644
index 00000000000..f085a2cfcee
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/associated_immediate_executor.cpp
@@ -0,0 +1,25 @@
+//
+// associated_immediate_executor.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/associated_immediate_executor.hpp"
+
+#include "unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "associated_immediate_executor",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/associator.cpp b/3rdparty/asio/src/tests/unit/associator.cpp
index e79fe677fe2..a35d95c66e0 100644
--- a/3rdparty/asio/src/tests/unit/associator.cpp
+++ b/3rdparty/asio/src/tests/unit/associator.cpp
@@ -2,7 +2,7 @@
// associator.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/async_result.cpp b/3rdparty/asio/src/tests/unit/async_result.cpp
index 5002559dd12..75a4e91b71e 100644
--- a/3rdparty/asio/src/tests/unit/async_result.cpp
+++ b/3rdparty/asio/src/tests/unit/async_result.cpp
@@ -2,7 +2,7 @@
// async_result.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/awaitable.cpp b/3rdparty/asio/src/tests/unit/awaitable.cpp
index a1e9077765d..39ca8ddfdbe 100644
--- a/3rdparty/asio/src/tests/unit/awaitable.cpp
+++ b/3rdparty/asio/src/tests/unit/awaitable.cpp
@@ -2,7 +2,7 @@
// awaitable.cpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_datagram_socket.cpp b/3rdparty/asio/src/tests/unit/basic_datagram_socket.cpp
index 28e78c10194..44fa2561646 100644
--- a/3rdparty/asio/src/tests/unit/basic_datagram_socket.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_datagram_socket.cpp
@@ -2,7 +2,7 @@
// basic_datagram_socket.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_deadline_timer.cpp b/3rdparty/asio/src/tests/unit/basic_deadline_timer.cpp
index 2ea478da3b3..ec6a6e37d18 100644
--- a/3rdparty/asio/src/tests/unit/basic_deadline_timer.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_deadline_timer.cpp
@@ -2,7 +2,7 @@
// basic_deadline_timer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_file.cpp b/3rdparty/asio/src/tests/unit/basic_file.cpp
new file mode 100644
index 00000000000..5308d1268b0
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/basic_file.cpp
@@ -0,0 +1,25 @@
+//
+// basic_file.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/basic_file.hpp"
+
+#include "unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "basic_file",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/basic_random_access_file.cpp b/3rdparty/asio/src/tests/unit/basic_random_access_file.cpp
new file mode 100644
index 00000000000..fffaee3e8a2
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/basic_random_access_file.cpp
@@ -0,0 +1,25 @@
+//
+// basic_random_access_file.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/basic_random_access_file.hpp"
+
+#include "unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "basic_random_access_file",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/basic_raw_socket.cpp b/3rdparty/asio/src/tests/unit/basic_raw_socket.cpp
index 3e87d6dd915..127df060b0c 100644
--- a/3rdparty/asio/src/tests/unit/basic_raw_socket.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_raw_socket.cpp
@@ -2,7 +2,7 @@
// basic_raw_socket.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_readable_pipe.cpp b/3rdparty/asio/src/tests/unit/basic_readable_pipe.cpp
new file mode 100644
index 00000000000..f390acf4f98
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/basic_readable_pipe.cpp
@@ -0,0 +1,25 @@
+//
+// basic_readable_pipe.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/basic_readable_pipe.hpp"
+
+#include "unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "basic_readable_pipe",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/basic_seq_packet_socket.cpp b/3rdparty/asio/src/tests/unit/basic_seq_packet_socket.cpp
index 3c48c0353e1..c8b9bfa67bc 100644
--- a/3rdparty/asio/src/tests/unit/basic_seq_packet_socket.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_seq_packet_socket.cpp
@@ -2,7 +2,7 @@
// basic_seq_packet_socket.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_serial_port.cpp b/3rdparty/asio/src/tests/unit/basic_serial_port.cpp
index 519c04df421..1a64348a989 100644
--- a/3rdparty/asio/src/tests/unit/basic_serial_port.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_serial_port.cpp
@@ -2,7 +2,7 @@
// basic_serial_port.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/3rdparty/asio/src/tests/unit/basic_signal_set.cpp b/3rdparty/asio/src/tests/unit/basic_signal_set.cpp
index d2880b544f2..01340178e69 100644
--- a/3rdparty/asio/src/tests/unit/basic_signal_set.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_signal_set.cpp
@@ -2,7 +2,7 @@
// basic_signal_set.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_socket.cpp b/3rdparty/asio/src/tests/unit/basic_socket.cpp
index def16e0fab2..c2814e6b96d 100644
--- a/3rdparty/asio/src/tests/unit/basic_socket.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_socket.cpp
@@ -2,7 +2,7 @@
// basic_socket.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_socket_acceptor.cpp b/3rdparty/asio/src/tests/unit/basic_socket_acceptor.cpp
index 49cb72a953c..021a81628ae 100644
--- a/3rdparty/asio/src/tests/unit/basic_socket_acceptor.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_socket_acceptor.cpp
@@ -2,7 +2,7 @@
// basic_socket_acceptor.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_stream_file.cpp b/3rdparty/asio/src/tests/unit/basic_stream_file.cpp
new file mode 100644
index 00000000000..9902122c9cb
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/basic_stream_file.cpp
@@ -0,0 +1,25 @@
+//
+// basic_stream_file.cpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/basic_stream_file.hpp"
+
+#include "unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "basic_stream_file",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/basic_stream_socket.cpp b/3rdparty/asio/src/tests/unit/basic_stream_socket.cpp
index ab0e6d0759a..1edbe5a530c 100644
--- a/3rdparty/asio/src/tests/unit/basic_stream_socket.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_stream_socket.cpp
@@ -2,7 +2,7 @@
// basic_stream_socket.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_streambuf.cpp b/3rdparty/asio/src/tests/unit/basic_streambuf.cpp
index 8172bef62b6..9529dd801fe 100644
--- a/3rdparty/asio/src/tests/unit/basic_streambuf.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_streambuf.cpp
@@ -2,7 +2,7 @@
// basic_streambuf.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_waitable_timer.cpp b/3rdparty/asio/src/tests/unit/basic_waitable_timer.cpp
index 8cb0ca0ffb1..9d6be41b754 100644
--- a/3rdparty/asio/src/tests/unit/basic_waitable_timer.cpp
+++ b/3rdparty/asio/src/tests/unit/basic_waitable_timer.cpp
@@ -2,7 +2,7 @@
// basic_waitable_timer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/basic_writable_pipe.cpp b/3rdparty/asio/src/tests/unit/basic_writable_pipe.cpp
new file mode 100644
index 00000000000..fc0d0fdd955
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/basic_writable_pipe.cpp
@@ -0,0 +1,25 @@
+//
+// basic_writable_pipe.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/basic_writable_pipe.hpp"
+
+#include "unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "basic_writable_pipe",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/bind_allocator.cpp b/3rdparty/asio/src/tests/unit/bind_allocator.cpp
new file mode 100644
index 00000000000..b7c11ffb53c
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/bind_allocator.cpp
@@ -0,0 +1,237 @@
+//
+// bind_allocator.cpp
+// ~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/bind_allocator.hpp"
+
+#include <functional>
+#include "asio/io_context.hpp"
+#include "asio/steady_timer.hpp"
+#include "unit_test.hpp"
+
+#if defined(ASIO_HAS_BOOST_DATE_TIME)
+# include "asio/deadline_timer.hpp"
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
+# include "asio/steady_timer.hpp"
+#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
+
+using namespace asio;
+namespace bindns = std;
+
+#if defined(ASIO_HAS_BOOST_DATE_TIME)
+typedef deadline_timer timer;
+namespace chronons = boost::posix_time;
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
+typedef steady_timer timer;
+namespace chronons = asio::chrono;
+#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
+
+template <typename T>
+class test_allocator
+{
+public:
+ typedef T value_type;
+
+ explicit test_allocator(int* allocations)
+ : allocations_(allocations)
+ {
+ }
+
+ template <typename U>
+ test_allocator(const test_allocator<U>& other)
+ : allocations_(other.allocations_)
+ {
+ }
+
+ template <typename U>
+ struct rebind
+ {
+ typedef test_allocator<U> other;
+ };
+
+ bool operator==(const test_allocator&) const
+ {
+ return true;
+ }
+
+ bool operator!=(const test_allocator&) const
+ {
+ return false;
+ }
+
+ T* allocate(std::size_t n) const
+ {
+ ++(*allocations_);
+ return static_cast<T*>(::operator new(sizeof(T) * n));
+ }
+
+ void deallocate(T* p, std::size_t /*n*/) const
+ {
+ --(*allocations_);
+ ::operator delete(p);
+ }
+
+//private:
+ int* allocations_;
+};
+
+void increment(int* count)
+{
+ ++(*count);
+}
+
+void bind_allocator_to_function_object_test()
+{
+ io_context ioc;
+
+ int count = 0;
+ int allocations = 0;
+
+ timer t(ioc, chronons::seconds(1));
+ t.async_wait(
+ bind_allocator(
+ test_allocator<int>(&allocations),
+ bindns::bind(&increment, &count)));
+
+ ASIO_CHECK(count == 0);
+ ASIO_CHECK(allocations == 1);
+
+ ioc.run();
+
+ ASIO_CHECK(count == 1);
+ ASIO_CHECK(allocations == 0);
+
+ t.async_wait(
+ bind_allocator(
+ test_allocator<int>(&allocations),
+ bind_allocator(
+ std::allocator<void>(),
+ bindns::bind(&increment, &count))));
+
+ ASIO_CHECK(count == 1);
+ ASIO_CHECK(allocations == 1);
+
+ ioc.restart();
+ ioc.run();
+
+ ASIO_CHECK(count == 2);
+ ASIO_CHECK(allocations == 0);
+}
+
+struct incrementer_token_v1
+{
+ explicit incrementer_token_v1(int* c) : count(c) {}
+ int* count;
+};
+
+struct incrementer_handler_v1
+{
+ explicit incrementer_handler_v1(incrementer_token_v1 t) : count(t.count) {}
+ void operator()(asio::error_code){ increment(count); }
+ int* count;
+};
+
+namespace asio {
+
+template <>
+class async_result<incrementer_token_v1, void(asio::error_code)>
+{
+public:
+ typedef incrementer_handler_v1 completion_handler_type;
+ typedef void return_type;
+ explicit async_result(completion_handler_type&) {}
+ return_type get() {}
+};
+
+} // namespace asio
+
+void bind_allocator_to_completion_token_v1_test()
+{
+ io_context ioc;
+
+ int count = 0;
+ int allocations = 0;
+
+ timer t(ioc, chronons::seconds(1));
+ t.async_wait(
+ bind_allocator(
+ test_allocator<int>(&allocations),
+ incrementer_token_v1(&count)));
+
+ ASIO_CHECK(count == 0);
+ ASIO_CHECK(allocations == 1);
+
+ ioc.run();
+
+ ASIO_CHECK(count == 1);
+ ASIO_CHECK(allocations == 0);
+}
+
+struct incrementer_token_v2
+{
+ explicit incrementer_token_v2(int* c) : count(c) {}
+ int* count;
+};
+
+namespace asio {
+
+template <>
+class async_result<incrementer_token_v2, void(asio::error_code)>
+{
+public:
+#if !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
+ typedef void return_type;
+#endif // !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
+
+ template <typename Initiation, typename... Args>
+ static void initiate(Initiation initiation,
+ incrementer_token_v2 token, Args&&... args)
+ {
+ initiation(bindns::bind(&increment, token.count),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+} // namespace asio
+
+void bind_allocator_to_completion_token_v2_test()
+{
+ io_context ioc;
+
+ int count = 0;
+ int allocations = 0;
+
+ timer t(ioc, chronons::seconds(1));
+ t.async_wait(
+ bind_allocator(
+ test_allocator<int>(&allocations),
+ incrementer_token_v2(&count)));
+
+ ASIO_CHECK(count == 0);
+ ASIO_CHECK(allocations == 1);
+
+ ioc.run();
+
+ ASIO_CHECK(count == 1);
+ ASIO_CHECK(allocations == 0);
+}
+
+ASIO_TEST_SUITE
+(
+ "bind_allocator",
+ ASIO_TEST_CASE(bind_allocator_to_function_object_test)
+ ASIO_TEST_CASE(bind_allocator_to_completion_token_v1_test)
+ ASIO_TEST_CASE(bind_allocator_to_completion_token_v2_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/bind_cancellation_slot.cpp b/3rdparty/asio/src/tests/unit/bind_cancellation_slot.cpp
index 48cc1baf17b..25b0ff1c995 100644
--- a/3rdparty/asio/src/tests/unit/bind_cancellation_slot.cpp
+++ b/3rdparty/asio/src/tests/unit/bind_cancellation_slot.cpp
@@ -2,7 +2,7 @@
// bind_cancellation_slot.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,6 +16,7 @@
// Test that header file is self-contained.
#include "asio/bind_cancellation_slot.hpp"
+#include <functional>
#include "asio/cancellation_signal.hpp"
#include "asio/io_context.hpp"
#include "asio/steady_timer.hpp"
@@ -27,24 +28,13 @@
# include "asio/steady_timer.hpp"
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
#if defined(ASIO_HAS_BOOST_DATE_TIME)
typedef deadline_timer timer;
namespace chronons = boost::posix_time;
-#elif defined(ASIO_HAS_CHRONO)
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
typedef steady_timer timer;
namespace chronons = asio::chrono;
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
@@ -77,64 +67,110 @@ void bind_cancellation_slot_to_function_object_test()
ioc.run();
ASIO_CHECK(count == 1);
+
+ t.async_wait(
+ bind_cancellation_slot(sig.slot(),
+ bind_cancellation_slot(sig.slot(),
+ bindns::bind(&increment_on_cancel,
+ &count, bindns::placeholders::_1))));
+
+ ioc.restart();
+ ioc.poll();
+
+ ASIO_CHECK(count == 1);
+
+ sig.emit(asio::cancellation_type::all);
+
+ ioc.run();
+
+ ASIO_CHECK(count == 2);
}
-struct incrementer_token
+struct incrementer_token_v1
+{
+ explicit incrementer_token_v1(int* c) : count(c) {}
+ int* count;
+};
+
+struct incrementer_handler_v1
{
- explicit incrementer_token(int* c) : count(c) {}
+ explicit incrementer_handler_v1(incrementer_token_v1 t) : count(t.count) {}
+
+ void operator()(asio::error_code error)
+ {
+ increment_on_cancel(count, error);
+ }
+
int* count;
};
namespace asio {
template <>
-class async_result<incrementer_token, void(asio::error_code)>
+class async_result<incrementer_token_v1, void(asio::error_code)>
{
public:
+ typedef incrementer_handler_v1 completion_handler_type;
typedef void return_type;
+ explicit async_result(completion_handler_type&) {}
+ return_type get() {}
+};
+
+} // namespace asio
+
+void bind_cancellation_slot_to_completion_token_v1_test()
+{
+ io_context ioc;
+ cancellation_signal sig;
+
+ int count = 0;
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
+ timer t(ioc, chronons::seconds(5));
+ t.async_wait(
+ bind_cancellation_slot(sig.slot(),
+ incrementer_token_v1(&count)));
+
+ ioc.poll();
+
+ ASIO_CHECK(count == 0);
+
+ sig.emit(asio::cancellation_type::all);
+
+ ioc.run();
+
+ ASIO_CHECK(count == 1);
+}
+
+struct incrementer_token_v2
+{
+ explicit incrementer_token_v2(int* c) : count(c) {}
+ int* count;
+};
+
+namespace asio {
+
+template <>
+class async_result<incrementer_token_v2, void(asio::error_code)>
+{
+public:
+#if !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
+ typedef void return_type;
+#endif // !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
template <typename Initiation, typename... Args>
static void initiate(Initiation initiation,
- incrementer_token token, ASIO_MOVE_ARG(Args)... args)
+ incrementer_token_v2 token, Args&&... args)
{
initiation(
bindns::bind(&increment_on_cancel,
token.count, bindns::placeholders::_1),
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Initiation>
- static void initiate(Initiation initiation, incrementer_token token)
- {
- initiation(
- bindns::bind(&increment_on_cancel,
- token.count, bindns::placeholders::_1));
+ static_cast<Args&&>(args)...);
}
-
-#define ASIO_PRIVATE_INITIATE_DEF(n) \
- template <typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
- static return_type initiate(Initiation initiation, \
- incrementer_token token, ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- initiation( \
- bindns::bind(&increment_on_cancel, \
- token.count, bindns::placeholders::_1), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF)
-#undef ASIO_PRIVATE_INITIATE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
} // namespace asio
-void bind_cancellation_slot_to_completion_token_test()
+void bind_cancellation_slot_to_completion_token_v2_test()
{
io_context ioc;
cancellation_signal sig;
@@ -144,7 +180,7 @@ void bind_cancellation_slot_to_completion_token_test()
timer t(ioc, chronons::seconds(5));
t.async_wait(
bind_cancellation_slot(sig.slot(),
- incrementer_token(&count)));
+ incrementer_token_v2(&count)));
ioc.poll();
@@ -161,5 +197,6 @@ ASIO_TEST_SUITE
(
"bind_cancellation_slot",
ASIO_TEST_CASE(bind_cancellation_slot_to_function_object_test)
- ASIO_TEST_CASE(bind_cancellation_slot_to_completion_token_test)
+ ASIO_TEST_CASE(bind_cancellation_slot_to_completion_token_v1_test)
+ ASIO_TEST_CASE(bind_cancellation_slot_to_completion_token_v2_test)
)
diff --git a/3rdparty/asio/src/tests/unit/bind_executor.cpp b/3rdparty/asio/src/tests/unit/bind_executor.cpp
index 8b1ea70f6b2..59be1cd14f3 100644
--- a/3rdparty/asio/src/tests/unit/bind_executor.cpp
+++ b/3rdparty/asio/src/tests/unit/bind_executor.cpp
@@ -2,7 +2,7 @@
// bind_executor.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,6 +16,7 @@
// Test that header file is self-contained.
#include "asio/bind_executor.hpp"
+#include <functional>
#include "asio/io_context.hpp"
#include "asio/steady_timer.hpp"
#include "unit_test.hpp"
@@ -26,24 +27,13 @@
# include "asio/steady_timer.hpp"
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
#if defined(ASIO_HAS_BOOST_DATE_TIME)
typedef deadline_timer timer;
namespace chronons = boost::posix_time;
-#elif defined(ASIO_HAS_CHRONO)
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
typedef steady_timer timer;
namespace chronons = asio::chrono;
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
@@ -73,58 +63,102 @@ void bind_executor_to_function_object_test()
ioc2.run();
ASIO_CHECK(count == 1);
+
+ t.async_wait(
+ bind_executor(
+ ioc2.get_executor(),
+ bind_executor(
+ asio::system_executor(),
+ bindns::bind(&increment, &count))));
+
+ ioc1.restart();
+ ioc1.run();
+
+ ASIO_CHECK(count == 1);
+
+ ioc2.restart();
+ ioc2.run();
+
+ ASIO_CHECK(count == 2);
}
-struct incrementer_token
+struct incrementer_token_v1
{
- explicit incrementer_token(int* c) : count(c) {}
+ explicit incrementer_token_v1(int* c) : count(c) {}
+ int* count;
+};
+
+struct incrementer_handler_v1
+{
+ explicit incrementer_handler_v1(incrementer_token_v1 t) : count(t.count) {}
+ void operator()(asio::error_code){ increment(count); }
int* count;
};
namespace asio {
template <>
-class async_result<incrementer_token, void(asio::error_code)>
+class async_result<incrementer_token_v1, void(asio::error_code)>
{
public:
+ typedef incrementer_handler_v1 completion_handler_type;
typedef void return_type;
+ explicit async_result(completion_handler_type&) {}
+ return_type get() {}
+};
+
+} // namespace asio
+
+void bind_executor_to_completion_token_v1_test()
+{
+ io_context ioc1;
+ io_context ioc2;
+
+ int count = 0;
+
+ timer t(ioc1, chronons::seconds(1));
+ t.async_wait(
+ bind_executor(
+ ioc2.get_executor(),
+ incrementer_token_v1(&count)));
+
+ ioc1.run();
+
+ ASIO_CHECK(count == 0);
+
+ ioc2.run();
+
+ ASIO_CHECK(count == 1);
+}
+
+struct incrementer_token_v2
+{
+ explicit incrementer_token_v2(int* c) : count(c) {}
+ int* count;
+};
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
+namespace asio {
+
+template <>
+class async_result<incrementer_token_v2, void(asio::error_code)>
+{
+public:
+#if !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
+ typedef void return_type;
+#endif // !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
template <typename Initiation, typename... Args>
static void initiate(Initiation initiation,
- incrementer_token token, ASIO_MOVE_ARG(Args)... args)
+ incrementer_token_v2 token, Args&&... args)
{
initiation(bindns::bind(&increment, token.count),
- ASIO_MOVE_CAST(Args)(args)...);
+ static_cast<Args&&>(args)...);
}
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Initiation>
- static void initiate(Initiation initiation, incrementer_token token)
- {
- initiation(bindns::bind(&increment, token.count));
- }
-
-#define ASIO_PRIVATE_INITIATE_DEF(n) \
- template <typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
- static return_type initiate(Initiation initiation, \
- incrementer_token token, ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- initiation(bindns::bind(&increment, token.count), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF)
-#undef ASIO_PRIVATE_INITIATE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
} // namespace asio
-void bind_executor_to_completion_token_test()
+void bind_executor_to_completion_token_v2_test()
{
io_context ioc1;
io_context ioc2;
@@ -135,7 +169,7 @@ void bind_executor_to_completion_token_test()
t.async_wait(
bind_executor(
ioc2.get_executor(),
- incrementer_token(&count)));
+ incrementer_token_v2(&count)));
ioc1.run();
@@ -150,5 +184,6 @@ ASIO_TEST_SUITE
(
"bind_executor",
ASIO_TEST_CASE(bind_executor_to_function_object_test)
- ASIO_TEST_CASE(bind_executor_to_completion_token_test)
+ ASIO_TEST_CASE(bind_executor_to_completion_token_v1_test)
+ ASIO_TEST_CASE(bind_executor_to_completion_token_v2_test)
)
diff --git a/3rdparty/asio/src/tests/unit/bind_immediate_executor.cpp b/3rdparty/asio/src/tests/unit/bind_immediate_executor.cpp
new file mode 100644
index 00000000000..ecf82de7470
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/bind_immediate_executor.cpp
@@ -0,0 +1,199 @@
+//
+// bind_immediate_executor.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/bind_immediate_executor.hpp"
+
+#include <functional>
+#include "asio/dispatch.hpp"
+#include "asio/io_context.hpp"
+#include "unit_test.hpp"
+
+#if defined(ASIO_HAS_BOOST_DATE_TIME)
+# include "asio/deadline_timer.hpp"
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
+# include "asio/steady_timer.hpp"
+#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
+
+using namespace asio;
+namespace bindns = std;
+
+struct initiate_immediate
+{
+ template <typename Handler>
+ void operator()(Handler&& handler, io_context* ctx) const
+ {
+ typename associated_immediate_executor<
+ Handler, io_context::executor_type>::type ex =
+ get_associated_immediate_executor(handler, ctx->get_executor());
+ dispatch(ex, static_cast<Handler&&>(handler));
+ }
+};
+
+template <ASIO_COMPLETION_TOKEN_FOR(void()) Token>
+ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(Token, void())
+async_immediate(io_context& ctx, Token&& token)
+ ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX((
+ async_initiate<Token, void()>(declval<initiate_immediate>(), token)))
+{
+ return async_initiate<Token, void()>(initiate_immediate(), token, &ctx);
+}
+
+void increment(int* count)
+{
+ ++(*count);
+}
+
+void bind_immediate_executor_to_function_object_test()
+{
+ io_context ioc1;
+ io_context ioc2;
+
+ int count = 0;
+
+ async_immediate(ioc1,
+ bind_immediate_executor(
+ ioc2.get_executor(),
+ bindns::bind(&increment, &count)));
+
+ ioc1.run();
+
+ ASIO_CHECK(count == 0);
+
+ ioc2.run();
+
+ ASIO_CHECK(count == 1);
+
+ async_immediate(ioc1,
+ bind_immediate_executor(
+ ioc2.get_executor(),
+ bind_immediate_executor(
+ asio::system_executor(),
+ bindns::bind(&increment, &count))));
+
+ ioc1.restart();
+ ioc1.run();
+
+ ASIO_CHECK(count == 1);
+
+ ioc2.restart();
+ ioc2.run();
+
+ ASIO_CHECK(count == 2);
+}
+
+struct incrementer_token_v1
+{
+ explicit incrementer_token_v1(int* c) : count(c) {}
+ int* count;
+};
+
+struct incrementer_handler_v1
+{
+ explicit incrementer_handler_v1(incrementer_token_v1 t) : count(t.count) {}
+ void operator()(){ increment(count); }
+ int* count;
+};
+
+namespace asio {
+
+template <>
+class async_result<incrementer_token_v1, void()>
+{
+public:
+ typedef incrementer_handler_v1 completion_handler_type;
+ typedef void return_type;
+ explicit async_result(completion_handler_type&) {}
+ return_type get() {}
+};
+
+} // namespace asio
+
+void bind_immediate_executor_to_completion_token_v1_test()
+{
+ io_context ioc1;
+ io_context ioc2;
+
+ int count = 0;
+
+ async_immediate(ioc1,
+ bind_immediate_executor(
+ ioc2.get_executor(),
+ incrementer_token_v1(&count)));
+
+ ioc1.run();
+
+ ASIO_CHECK(count == 0);
+
+ ioc2.run();
+
+ ASIO_CHECK(count == 1);
+}
+
+struct incrementer_token_v2
+{
+ explicit incrementer_token_v2(int* c) : count(c) {}
+ int* count;
+};
+
+namespace asio {
+
+template <>
+class async_result<incrementer_token_v2, void()>
+{
+public:
+#if !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
+ typedef void return_type;
+#endif // !defined(ASIO_HAS_RETURN_TYPE_DEDUCTION)
+
+ template <typename Initiation, typename... Args>
+ static void initiate(Initiation initiation,
+ incrementer_token_v2 token, Args&&... args)
+ {
+ initiation(bindns::bind(&increment, token.count),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+} // namespace asio
+
+void bind_immediate_executor_to_completion_token_v2_test()
+{
+ io_context ioc1;
+ io_context ioc2;
+
+ int count = 0;
+
+ async_immediate(ioc1,
+ bind_immediate_executor(
+ ioc2.get_executor(),
+ incrementer_token_v2(&count)));
+
+ ioc1.run();
+
+ ASIO_CHECK(count == 0);
+
+ ioc2.run();
+
+ ASIO_CHECK(count == 1);
+}
+
+ASIO_TEST_SUITE
+(
+ "bind_immediate_executor",
+ ASIO_TEST_CASE(bind_immediate_executor_to_function_object_test)
+ ASIO_TEST_CASE(bind_immediate_executor_to_completion_token_v1_test)
+ ASIO_TEST_CASE(bind_immediate_executor_to_completion_token_v2_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/buffer.cpp b/3rdparty/asio/src/tests/unit/buffer.cpp
index f66a8f0122e..9fa1db6e67f 100644
--- a/3rdparty/asio/src/tests/unit/buffer.cpp
+++ b/3rdparty/asio/src/tests/unit/buffer.cpp
@@ -2,7 +2,7 @@
// buffer.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,16 +16,14 @@
// Test that header file is self-contained.
#include "asio/buffer.hpp"
+#include <array>
+#include <cstring>
#include "unit_test.hpp"
#if defined(ASIO_HAS_BOOST_ARRAY)
# include <boost/array.hpp>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
//------------------------------------------------------------------------------
// buffer_compile test
@@ -37,6 +35,42 @@ namespace buffer_compile {
using namespace asio;
+template <typename T>
+class mutable_contiguous_container
+{
+public:
+ typedef T value_type;
+ typedef T* iterator;
+ typedef const T* const_iterator;
+ typedef T& reference;
+ typedef const T& const_reference;
+
+ mutable_contiguous_container() {}
+ std::size_t size() const { return 0; }
+ iterator begin() { return 0; }
+ const_iterator begin() const { return 0; }
+ iterator end() { return 0; }
+ const_iterator end() const { return 0; }
+};
+
+template <typename T>
+class const_contiguous_container
+{
+public:
+ typedef const T value_type;
+ typedef const T* iterator;
+ typedef const T* const_iterator;
+ typedef const T& reference;
+ typedef const T& const_reference;
+
+ const_contiguous_container() {}
+ std::size_t size() const { return 0; }
+ iterator begin() { return 0; }
+ const_iterator begin() const { return 0; }
+ iterator end() { return 0; }
+ const_iterator end() const { return 0; }
+};
+
void test()
{
try
@@ -50,11 +84,9 @@ void test()
const boost::array<char, 1024>& const_array_data_1 = array_data;
boost::array<const char, 1024> const_array_data_2 = { { 0 } };
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_STD_ARRAY)
std::array<char, 1024> std_array_data;
const std::array<char, 1024>& const_std_array_data_1 = std_array_data;
std::array<const char, 1024> const_std_array_data_2 = { { 0 } };
-#endif // defined(ASIO_HAS_STD_ARRAY)
std::vector<char> vector_data(1024);
const std::vector<char>& const_vector_data = vector_data;
std::string string_data(1024, ' ');
@@ -66,6 +98,10 @@ void test()
#elif defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
std::experimental::string_view string_view_data(string_data);
#endif // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+ mutable_contiguous_container<char> mutable_contiguous_data;
+ const mutable_contiguous_container<char> const_mutable_contiguous_data;
+ const_contiguous_container<char> const_contiguous_data;
+ const const_contiguous_container<char> const_const_contiguous_data;
// mutable_buffer constructors.
@@ -189,14 +225,12 @@ void test()
cb1 = buffer(const_array_data_2);
cb1 = buffer(const_array_data_2, 1024);
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_STD_ARRAY)
mb1 = buffer(std_array_data);
mb1 = buffer(std_array_data, 1024);
cb1 = buffer(const_std_array_data_1);
cb1 = buffer(const_std_array_data_1, 1024);
cb1 = buffer(const_std_array_data_2);
cb1 = buffer(const_std_array_data_2, 1024);
-#endif // defined(ASIO_HAS_STD_ARRAY)
mb1 = buffer(vector_data);
mb1 = buffer(vector_data, 1024);
cb1 = buffer(const_vector_data);
@@ -209,6 +243,14 @@ void test()
cb1 = buffer(string_view_data);
cb1 = buffer(string_view_data, 1024);
#endif // defined(ASIO_HAS_STRING_VIEW)
+ mb1 = buffer(mutable_contiguous_data);
+ mb1 = buffer(mutable_contiguous_data, 1024);
+ cb1 = buffer(const_mutable_contiguous_data);
+ cb1 = buffer(const_mutable_contiguous_data, 1024);
+ cb1 = buffer(const_contiguous_data);
+ cb1 = buffer(const_contiguous_data, 1024);
+ cb1 = buffer(const_const_contiguous_data);
+ cb1 = buffer(const_const_contiguous_data, 1024);
// buffer_copy function overloads.
@@ -600,13 +642,11 @@ struct valid_const_a
const_buffer* end() const { return 0; }
};
-#if defined(ASIO_HAS_DECLTYPE)
struct valid_const_b
{
const_buffer* begin() const { return 0; }
const_buffer* end() const { return 0; }
};
-#endif // defined(ASIO_HAS_DECLTYPE)
struct valid_mutable_a
{
@@ -616,13 +656,11 @@ struct valid_mutable_a
mutable_buffer* end() const { return 0; }
};
-#if defined(ASIO_HAS_DECLTYPE)
struct valid_mutable_b
{
mutable_buffer* begin() const { return 0; }
mutable_buffer* end() const { return 0; }
};
-#endif // defined(ASIO_HAS_DECLTYPE)
struct invalid_const_a
{
@@ -643,7 +681,6 @@ struct invalid_const_c
const_buffer* end() const { return 0; }
};
-#if defined(ASIO_HAS_DECLTYPE)
struct invalid_const_d
{
int* begin() const { return 0; }
@@ -659,7 +696,6 @@ struct invalid_const_f
{
const_buffer* end() const { return 0; }
};
-#endif // defined(ASIO_HAS_DECLTYPE)
struct invalid_mutable_a
{
@@ -680,7 +716,6 @@ struct invalid_mutable_c
mutable_buffer* end() const { return 0; }
};
-#if defined(ASIO_HAS_DECLTYPE)
struct invalid_mutable_d
{
int* begin() const { return 0; }
@@ -696,7 +731,6 @@ struct invalid_mutable_f
{
mutable_buffer* end() const { return 0; }
};
-#endif // defined(ASIO_HAS_DECLTYPE)
void test()
{
@@ -751,14 +785,12 @@ void test()
ASIO_CHECK(buffer_sequence_begin(b7) == b7.begin());
ASIO_CHECK(buffer_sequence_end(b7) == b7.end());
-#if defined(ASIO_HAS_DECLTYPE)
ASIO_CHECK(is_const_buffer_sequence<valid_const_b>::value);
ASIO_CHECK(!is_mutable_buffer_sequence<valid_const_b>::value);
valid_const_b b8;
ASIO_CHECK(buffer_sequence_begin(b8) == b8.begin());
ASIO_CHECK(buffer_sequence_end(b8) == b8.end());
-#endif // defined(ASIO_HAS_DECLTYPE)
ASIO_CHECK(is_const_buffer_sequence<valid_mutable_a>::value);
ASIO_CHECK(is_mutable_buffer_sequence<valid_mutable_a>::value);
@@ -767,14 +799,12 @@ void test()
ASIO_CHECK(buffer_sequence_begin(b9) == b9.begin());
ASIO_CHECK(buffer_sequence_end(b9) == b9.end());
-#if defined(ASIO_HAS_DECLTYPE)
ASIO_CHECK(is_const_buffer_sequence<valid_mutable_b>::value);
ASIO_CHECK(is_mutable_buffer_sequence<valid_mutable_b>::value);
valid_mutable_b b10;
ASIO_CHECK(buffer_sequence_begin(b10) == b10.begin());
ASIO_CHECK(buffer_sequence_end(b10) == b10.end());
-#endif // defined(ASIO_HAS_DECLTYPE)
ASIO_CHECK(!is_const_buffer_sequence<invalid_const_a>::value);
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_const_a>::value);
@@ -785,7 +815,6 @@ void test()
ASIO_CHECK(!is_const_buffer_sequence<invalid_const_c>::value);
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_const_c>::value);
-#if defined(ASIO_HAS_DECLTYPE)
ASIO_CHECK(!is_const_buffer_sequence<invalid_const_d>::value);
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_const_d>::value);
@@ -794,7 +823,6 @@ void test()
ASIO_CHECK(!is_const_buffer_sequence<invalid_const_f>::value);
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_const_f>::value);
-#endif // defined(ASIO_HAS_DECLTYPE)
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_mutable_a>::value);
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_mutable_a>::value);
@@ -805,7 +833,6 @@ void test()
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_mutable_c>::value);
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_mutable_c>::value);
-#if defined(ASIO_HAS_DECLTYPE)
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_mutable_d>::value);
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_mutable_d>::value);
@@ -814,11 +841,66 @@ void test()
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_mutable_f>::value);
ASIO_CHECK(!is_mutable_buffer_sequence<invalid_mutable_f>::value);
-#endif // defined(ASIO_HAS_DECLTYPE)
}
} // namespace buffer_sequence
+namespace buffer_literals {
+
+void test()
+{
+#if defined(ASIO_HAS_USER_DEFINED_LITERALS)
+ using namespace asio::buffer_literals;
+ using namespace std; // For memcmp.
+
+ asio::const_buffer b1 = ""_buf;
+ ASIO_CHECK(b1.size() == 0);
+
+ asio::const_buffer b2 = "hello"_buf;
+ ASIO_CHECK(b2.size() == 5);
+ ASIO_CHECK(memcmp(b2.data(), "hello", 5) == 0);
+
+ asio::const_buffer b3 = 0x00_buf;
+ ASIO_CHECK(b3.size() == 1);
+ ASIO_CHECK(memcmp(b3.data(), "\x00", 1) == 0);
+
+ asio::const_buffer b4 = 0X01_buf;
+ ASIO_CHECK(b4.size() == 1);
+ ASIO_CHECK(memcmp(b4.data(), "\x01", 1) == 0);
+
+ asio::const_buffer b5 = 0xaB_buf;
+ ASIO_CHECK(b5.size() == 1);
+ ASIO_CHECK(memcmp(b5.data(), "\xab", 1) == 0);
+
+ asio::const_buffer b6 = 0xABcd_buf;
+ ASIO_CHECK(b6.size() == 2);
+ ASIO_CHECK(memcmp(b6.data(), "\xab\xcd", 2) == 0);
+
+ asio::const_buffer b7 = 0x01ab01cd01ef01ba01dc01fe_buf;
+ ASIO_CHECK(b7.size() == 12);
+ ASIO_CHECK(memcmp(b7.data(),
+ "\x01\xab\x01\xcd\x01\xef\x01\xba\x01\xdc\x01\xfe", 12) == 0);
+
+ asio::const_buffer b8 = 0b00000000_buf;
+ ASIO_CHECK(b8.size() == 1);
+ ASIO_CHECK(memcmp(b8.data(), "\x00", 1) == 0);
+
+ asio::const_buffer b9 = 0B00000001_buf;
+ ASIO_CHECK(b9.size() == 1);
+ ASIO_CHECK(memcmp(b9.data(), "\x01", 1) == 0);
+
+ asio::const_buffer b10 = 0B11111111_buf;
+ ASIO_CHECK(b10.size() == 1);
+ ASIO_CHECK(memcmp(b10.data(), "\xFF", 1) == 0);
+
+ asio::const_buffer b11 = 0b1111000000001111_buf;
+ ASIO_CHECK(b11.size() == 2);
+ ASIO_CHECK(memcmp(b11.data(), "\xF0\x0F", 2) == 0);
+#endif // (defined(ASIO_HAS_USER_DEFINED_LITERALS)
+}
+
+} // namespace buffer_literals
+
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
@@ -827,4 +909,5 @@ ASIO_TEST_SUITE
ASIO_COMPILE_TEST_CASE(buffer_compile::test)
ASIO_TEST_CASE(buffer_copy_runtime::test)
ASIO_TEST_CASE(buffer_sequence::test)
+ ASIO_TEST_CASE(buffer_literals::test)
)
diff --git a/3rdparty/asio/src/tests/unit/buffer_registration.cpp b/3rdparty/asio/src/tests/unit/buffer_registration.cpp
new file mode 100644
index 00000000000..72826a394cc
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/buffer_registration.cpp
@@ -0,0 +1,25 @@
+//
+// buffer_registration.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/buffer_registration.hpp"
+
+#include "unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "buffer_registration",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/buffered_read_stream.cpp b/3rdparty/asio/src/tests/unit/buffered_read_stream.cpp
index d517dbb96ea..21b4abc0bbb 100644
--- a/3rdparty/asio/src/tests/unit/buffered_read_stream.cpp
+++ b/3rdparty/asio/src/tests/unit/buffered_read_stream.cpp
@@ -2,7 +2,7 @@
// buffered_read_stream.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,6 +17,7 @@
#include "asio/buffered_read_stream.hpp"
#include <cstring>
+#include <functional>
#include "archetypes/async_result.hpp"
#include "asio/buffer.hpp"
#include "asio/io_context.hpp"
@@ -30,12 +31,6 @@
# include <array>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
typedef asio::buffered_read_stream<
asio::ip::tcp::socket> stream_type;
@@ -247,11 +242,7 @@ void test_async_operations()
{
using namespace std; // For memcmp.
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -332,7 +323,7 @@ void test_async_operations()
ASIO_TEST_SUITE
(
"buffered_read_stream",
- ASIO_TEST_CASE(test_compile)
+ ASIO_COMPILE_TEST_CASE(test_compile)
ASIO_TEST_CASE(test_sync_operations)
ASIO_TEST_CASE(test_async_operations)
)
diff --git a/3rdparty/asio/src/tests/unit/buffered_stream.cpp b/3rdparty/asio/src/tests/unit/buffered_stream.cpp
index d9cf845c0d0..4830ec277de 100644
--- a/3rdparty/asio/src/tests/unit/buffered_stream.cpp
+++ b/3rdparty/asio/src/tests/unit/buffered_stream.cpp
@@ -2,7 +2,7 @@
// buffered_stream.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,6 +17,7 @@
#include "asio/buffered_stream.hpp"
#include <cstring>
+#include <functional>
#include "archetypes/async_result.hpp"
#include "asio/buffer.hpp"
#include "asio/io_context.hpp"
@@ -30,12 +31,6 @@
# include <array>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
typedef asio::buffered_stream<
asio::ip::tcp::socket> stream_type;
@@ -265,11 +260,7 @@ void test_async_operations()
{
using namespace std; // For memcmp.
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -358,7 +349,7 @@ void test_async_operations()
ASIO_TEST_SUITE
(
"buffered_stream",
- ASIO_TEST_CASE(test_compile)
+ ASIO_COMPILE_TEST_CASE(test_compile)
ASIO_TEST_CASE(test_sync_operations)
ASIO_TEST_CASE(test_async_operations)
)
diff --git a/3rdparty/asio/src/tests/unit/buffered_write_stream.cpp b/3rdparty/asio/src/tests/unit/buffered_write_stream.cpp
index 8ddbec7abb1..635ff984b8d 100644
--- a/3rdparty/asio/src/tests/unit/buffered_write_stream.cpp
+++ b/3rdparty/asio/src/tests/unit/buffered_write_stream.cpp
@@ -2,7 +2,7 @@
// buffered_write_stream.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,6 +17,7 @@
#include "asio/buffered_write_stream.hpp"
#include <cstring>
+#include <functional>
#include "archetypes/async_result.hpp"
#include "asio/buffer.hpp"
#include "asio/io_context.hpp"
@@ -30,12 +31,6 @@
# include <array>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
typedef asio::buffered_write_stream<
asio::ip::tcp::socket> stream_type;
@@ -254,11 +249,7 @@ void test_async_operations()
{
using namespace std; // For memcmp.
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -347,7 +338,7 @@ void test_async_operations()
ASIO_TEST_SUITE
(
"buffered_write_stream",
- ASIO_TEST_CASE(test_compile)
+ ASIO_COMPILE_TEST_CASE(test_compile)
ASIO_TEST_CASE(test_sync_operations)
ASIO_TEST_CASE(test_async_operations)
)
diff --git a/3rdparty/asio/src/tests/unit/buffers_iterator.cpp b/3rdparty/asio/src/tests/unit/buffers_iterator.cpp
index 27df26340a4..071dc1bb8b3 100644
--- a/3rdparty/asio/src/tests/unit/buffers_iterator.cpp
+++ b/3rdparty/asio/src/tests/unit/buffers_iterator.cpp
@@ -2,7 +2,7 @@
// buffers_iterator.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,17 +16,10 @@
// Test that header file is self-contained.
#include "asio/buffers_iterator.hpp"
+#include <array>
#include "asio/buffer.hpp"
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_ARRAY)
-# include <boost/array.hpp>
-#endif // defined(ASIO_HAS_BOOST_ARRAY)
-
-#if defined(ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
//------------------------------------------------------------------------------
// buffers_iterator_compile test
@@ -36,11 +29,7 @@
namespace buffers_iterator_compile {
-#if defined(ASIO_HAS_BOOST_ARRAY)
-using boost::array;
-#elif defined(ASIO_HAS_STD_ARRAY)
using std::array;
-#endif // defined(ASIO_HAS_BOOST_ARRAY)
using std::vector;
using namespace asio;
@@ -288,5 +277,5 @@ void test()
ASIO_TEST_SUITE
(
"buffers_iterator",
- ASIO_TEST_CASE(buffers_iterator_compile::test)
+ ASIO_COMPILE_TEST_CASE(buffers_iterator_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/cancellation_signal.cpp b/3rdparty/asio/src/tests/unit/cancellation_signal.cpp
index 50ca93221d0..0b0f72fcbcb 100644
--- a/3rdparty/asio/src/tests/unit/cancellation_signal.cpp
+++ b/3rdparty/asio/src/tests/unit/cancellation_signal.cpp
@@ -2,7 +2,7 @@
// cancellation_signal.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/cancellation_state.cpp b/3rdparty/asio/src/tests/unit/cancellation_state.cpp
index 3e6023f4182..74bc6566916 100644
--- a/3rdparty/asio/src/tests/unit/cancellation_state.cpp
+++ b/3rdparty/asio/src/tests/unit/cancellation_state.cpp
@@ -2,7 +2,7 @@
// cancellation_state.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/cancellation_type.cpp b/3rdparty/asio/src/tests/unit/cancellation_type.cpp
index edf6ccf0c4c..fd6accb0a05 100644
--- a/3rdparty/asio/src/tests/unit/cancellation_type.cpp
+++ b/3rdparty/asio/src/tests/unit/cancellation_type.cpp
@@ -2,7 +2,7 @@
// cancellation_type.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/co_spawn.cpp b/3rdparty/asio/src/tests/unit/co_spawn.cpp
index e902e1f2d0a..c5d1fbf776d 100644
--- a/3rdparty/asio/src/tests/unit/co_spawn.cpp
+++ b/3rdparty/asio/src/tests/unit/co_spawn.cpp
@@ -2,7 +2,7 @@
// co_spawn.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -18,8 +18,116 @@
#include "unit_test.hpp"
+#if defined(ASIO_HAS_CO_AWAIT)
+
+#include <stdexcept>
+#include "asio/any_completion_handler.hpp"
+#include "asio/bind_cancellation_slot.hpp"
+#include "asio/io_context.hpp"
+
+asio::awaitable<void> void_returning_coroutine()
+{
+ co_return;
+}
+
+asio::awaitable<int> int_returning_coroutine()
+{
+ co_return 42;
+}
+
+void test_co_spawn_with_any_completion_handler()
+{
+ asio::io_context ctx;
+
+ bool called = false;
+ asio::co_spawn(ctx, void_returning_coroutine(),
+ asio::any_completion_handler<void(std::exception_ptr)>(
+ [&](std::exception_ptr)
+ {
+ called = true;
+ }));
+
+ ASIO_CHECK(!called);
+
+ ctx.run();
+
+ ASIO_CHECK(called);
+
+ int result = 0;
+ asio::co_spawn(ctx, int_returning_coroutine(),
+ asio::any_completion_handler<void(std::exception_ptr, int)>(
+ [&](std::exception_ptr, int i)
+ {
+ result = i;
+ }));
+
+ ASIO_CHECK(result == 0);
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(result == 42);
+}
+
+void test_co_spawn_immediate_cancel()
+{
+ asio::cancellation_signal sig;
+ asio::io_context ctx;
+
+ std::exception_ptr result = nullptr;
+ bool called = false;
+ asio::co_spawn(ctx, void_returning_coroutine(),
+ asio::bind_cancellation_slot(sig.slot(),
+ [&](std::exception_ptr e)
+ {
+ result = e;
+ called = true;
+ }));
+
+ ASIO_CHECK(!called);
+ ASIO_CHECK(result == nullptr);
+
+ sig.emit(asio::cancellation_type::all);
+ ctx.run();
+
+ ASIO_CHECK(called);
+ ASIO_CHECK(result != nullptr);
+
+ result = nullptr;
+ called = false;
+ asio::co_spawn(ctx, int_returning_coroutine(),
+ asio::bind_cancellation_slot(sig.slot(),
+ [&](std::exception_ptr e, int i)
+ {
+ ASIO_CHECK(i != 42);
+ result = e;
+ called = true;
+ }));
+
+ ASIO_CHECK(!called);
+ ASIO_CHECK(result == nullptr);
+
+ sig.emit(asio::cancellation_type::all);
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(called);
+ ASIO_CHECK(result != nullptr);
+}
+
+ASIO_TEST_SUITE
+(
+ "co_spawn",
+ ASIO_TEST_CASE(test_co_spawn_with_any_completion_handler)
+ ASIO_TEST_CASE(test_co_spawn_immediate_cancel)
+)
+
+#else // defined(ASIO_HAS_CO_AWAIT)
+
ASIO_TEST_SUITE
(
"co_spawn",
ASIO_TEST_CASE(null_test)
)
+
+#endif // defined(ASIO_HAS_CO_AWAIT)
diff --git a/3rdparty/asio/src/tests/unit/completion_condition.cpp b/3rdparty/asio/src/tests/unit/completion_condition.cpp
index 3986b5a545a..106789e5e3c 100644
--- a/3rdparty/asio/src/tests/unit/completion_condition.cpp
+++ b/3rdparty/asio/src/tests/unit/completion_condition.cpp
@@ -2,7 +2,7 @@
// completion_condition.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/compose.cpp b/3rdparty/asio/src/tests/unit/compose.cpp
index faf515fa184..c9820af2fd3 100644
--- a/3rdparty/asio/src/tests/unit/compose.cpp
+++ b/3rdparty/asio/src/tests/unit/compose.cpp
@@ -2,7 +2,7 @@
// compose.cpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,19 +16,13 @@
// Test that header file is self-contained.
#include "asio/compose.hpp"
-#include "unit_test.hpp"
-
+#include <functional>
#include "asio/bind_cancellation_slot.hpp"
#include "asio/cancellation_signal.hpp"
#include "asio/io_context.hpp"
#include "asio/post.hpp"
#include "asio/system_timer.hpp"
-
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
+#include "unit_test.hpp"
//------------------------------------------------------------------------------
@@ -48,7 +42,7 @@ public:
{
case starting:
state_ = posting;
- asio::post(ioc_, ASIO_MOVE_CAST(Self)(self));
+ asio::post(ioc_, static_cast<Self&&>(self));
break;
case posting:
self.complete();
@@ -66,7 +60,7 @@ private:
template <typename CompletionToken>
ASIO_INITFN_RESULT_TYPE(CompletionToken, void())
async_0_completion_args(asio::io_context& ioc,
- ASIO_MOVE_ARG(CompletionToken) token)
+ CompletionToken&& token)
{
return asio::async_compose<CompletionToken, void()>(
impl_0_completion_args(ioc), token);
@@ -89,11 +83,7 @@ struct compose_0_args_lvalue_handler
void compose_0_completion_args_test()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
asio::io_context ioc;
int count = 0;
@@ -145,7 +135,7 @@ public:
{
case starting:
state_ = posting;
- asio::post(ioc_, ASIO_MOVE_CAST(Self)(self));
+ asio::post(ioc_, static_cast<Self&&>(self));
break;
case posting:
self.complete(42);
@@ -163,7 +153,7 @@ private:
template <typename CompletionToken>
ASIO_INITFN_RESULT_TYPE(CompletionToken, void(int))
async_1_completion_arg(asio::io_context& ioc,
- ASIO_MOVE_ARG(CompletionToken) token)
+ CompletionToken&& token)
{
return asio::async_compose<CompletionToken, void(int)>(
impl_1_completion_arg(ioc), token);
@@ -189,11 +179,7 @@ struct compose_1_arg_lvalue_handler
void compose_1_completion_arg_test()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
asio::io_context ioc;
@@ -262,7 +248,7 @@ public:
self.reset_cancellation_state(cancellation_filter_);
state_ = waiting;
timer_.expires_after(asio::chrono::milliseconds(100));
- timer_.async_wait(ASIO_MOVE_CAST(Self)(self));
+ timer_.async_wait(static_cast<Self&&>(self));
break;
case waiting:
self.complete(!ec);
@@ -282,7 +268,7 @@ template <typename CancellationFilter, typename CompletionToken>
ASIO_INITFN_RESULT_TYPE(CompletionToken, void(bool))
async_cancellable(CancellationFilter cancellation_filter,
asio::system_timer& timer,
- ASIO_MOVE_ARG(CompletionToken) token)
+ CompletionToken&& token)
{
return asio::async_compose<CompletionToken, void(bool)>(
impl_cancellable<CancellationFilter>(cancellation_filter, timer), token);
@@ -297,11 +283,7 @@ void compose_partial_cancellation_handler(
void compose_default_cancellation_test()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
asio::io_context ioc;
@@ -379,11 +361,7 @@ void compose_default_cancellation_test()
void compose_partial_cancellation_test()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
asio::io_context ioc;
@@ -461,11 +439,7 @@ void compose_partial_cancellation_test()
void compose_total_cancellation_test()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
asio::io_context ioc;
diff --git a/3rdparty/asio/src/tests/unit/connect.cpp b/3rdparty/asio/src/tests/unit/connect.cpp
index b7306b02abe..16c0331b4a3 100644
--- a/3rdparty/asio/src/tests/unit/connect.cpp
+++ b/3rdparty/asio/src/tests/unit/connect.cpp
@@ -2,7 +2,7 @@
// connect.cpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,23 +16,13 @@
// Test that header file is self-contained.
#include "asio/connect.hpp"
+#include <functional>
#include <vector>
#include "asio/detail/thread.hpp"
#include "asio/ip/tcp.hpp"
-
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
diff --git a/3rdparty/asio/src/tests/unit/connect_pipe.cpp b/3rdparty/asio/src/tests/unit/connect_pipe.cpp
new file mode 100644
index 00000000000..8c71a5d093c
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/connect_pipe.cpp
@@ -0,0 +1,154 @@
+//
+// connect_pipe.cpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/connect_pipe.hpp"
+
+#include <functional>
+#include <string>
+#include "asio/io_context.hpp"
+#include "asio/read.hpp"
+#include "asio/readable_pipe.hpp"
+#include "asio/writable_pipe.hpp"
+#include "asio/write.hpp"
+#include "unit_test.hpp"
+
+//------------------------------------------------------------------------------
+
+// connect_pipe_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all connect_pipe functions compile and link
+// correctly. Runtime failures are ignored.
+
+namespace connect_pipe_compile {
+
+void test()
+{
+#if defined(ASIO_HAS_PIPE)
+ using namespace asio;
+
+ try
+ {
+ asio::io_context io_context;
+ asio::error_code ec1;
+
+ readable_pipe p1(io_context);
+ writable_pipe p2(io_context);
+ connect_pipe(p1, p2);
+
+ readable_pipe p3(io_context);
+ writable_pipe p4(io_context);
+ connect_pipe(p3, p4, ec1);
+ }
+ catch (std::exception&)
+ {
+ }
+#endif // defined(ASIO_HAS_PIPE)
+}
+
+} // namespace connect_pipe_compile
+
+//------------------------------------------------------------------------------
+
+// connect_pipe_runtime test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that connect_pipe operates correctly at runtime.
+
+namespace connect_pipe_runtime {
+
+static const char write_data[]
+ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+
+void handle_read(const asio::error_code& err,
+ size_t bytes_transferred, bool* called)
+{
+ *called = true;
+ ASIO_CHECK(!err);
+ ASIO_CHECK(bytes_transferred == sizeof(write_data));
+}
+
+void handle_write(const asio::error_code& err,
+ size_t bytes_transferred, bool* called)
+{
+ *called = true;
+ ASIO_CHECK(!err);
+ ASIO_CHECK(bytes_transferred == sizeof(write_data));
+}
+
+void test()
+{
+#if defined(ASIO_HAS_PIPE)
+ using namespace std; // For memcmp.
+ using namespace asio;
+
+ namespace bindns = std;
+ using bindns::placeholders::_1;
+ using bindns::placeholders::_2;
+
+ try
+ {
+ asio::io_context io_context;
+ asio::error_code ec1;
+ asio::error_code ec2;
+
+ readable_pipe p1(io_context);
+ writable_pipe p2(io_context);
+ connect_pipe(p1, p2);
+
+ std::string data1 = write_data;
+ asio::write(p2, asio::buffer(data1));
+
+ std::string data2;
+ data2.resize(data1.size());
+ asio::read(p1, asio::buffer(data2));
+
+ ASIO_CHECK(data1 == data2);
+
+ char read_buffer[sizeof(write_data)];
+ bool read_completed = false;
+ asio::async_read(p1,
+ asio::buffer(read_buffer),
+ bindns::bind(handle_read,
+ _1, _2, &read_completed));
+
+ bool write_completed = false;
+ asio::async_write(p2,
+ asio::buffer(write_data),
+ bindns::bind(handle_write,
+ _1, _2, &write_completed));
+
+ io_context.run();
+
+ ASIO_CHECK(read_completed);
+ ASIO_CHECK(write_completed);
+ ASIO_CHECK(memcmp(read_buffer, write_data, sizeof(write_data)) == 0);
+ }
+ catch (std::exception&)
+ {
+ ASIO_CHECK(false);
+ }
+#endif // defined(ASIO_HAS_PIPE)
+}
+
+} // namespace connect_pipe_compile
+
+//------------------------------------------------------------------------------
+
+ASIO_TEST_SUITE
+(
+ "connect_pipe",
+ ASIO_COMPILE_TEST_CASE(connect_pipe_compile::test)
+ ASIO_TEST_CASE(connect_pipe_runtime::test)
+)
diff --git a/3rdparty/asio/src/tests/unit/consign.cpp b/3rdparty/asio/src/tests/unit/consign.cpp
new file mode 100644
index 00000000000..b24f5281c75
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/consign.cpp
@@ -0,0 +1,56 @@
+//
+// consign.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/consign.hpp"
+
+#include "asio/bind_executor.hpp"
+#include "asio/io_context.hpp"
+#include "asio/post.hpp"
+#include "asio/system_timer.hpp"
+#include "unit_test.hpp"
+
+void consign_test()
+{
+ asio::io_context io1;
+ asio::io_context io2;
+ asio::system_timer timer1(io1);
+ int count = 0;
+
+ timer1.expires_after(asio::chrono::seconds(0));
+ timer1.async_wait(
+ asio::consign(
+ asio::bind_executor(io2.get_executor(),
+ [&count](asio::error_code)
+ {
+ ++count;
+ }), 123, 321));
+
+ ASIO_CHECK(count == 0);
+
+ io1.run();
+
+ ASIO_CHECK(count == 0);
+
+ io2.run();
+
+ ASIO_CHECK(count == 1);
+}
+
+ASIO_TEST_SUITE
+(
+ "consign",
+ ASIO_TEST_CASE(consign_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/coroutine.cpp b/3rdparty/asio/src/tests/unit/coroutine.cpp
index cd8fc9c12ba..72e6953a31a 100644
--- a/3rdparty/asio/src/tests/unit/coroutine.cpp
+++ b/3rdparty/asio/src/tests/unit/coroutine.cpp
@@ -2,7 +2,7 @@
// coroutine.cpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/deadline_timer.cpp b/3rdparty/asio/src/tests/unit/deadline_timer.cpp
index 15d00b0d83b..9bc7f16fcd2 100644
--- a/3rdparty/asio/src/tests/unit/deadline_timer.cpp
+++ b/3rdparty/asio/src/tests/unit/deadline_timer.cpp
@@ -2,7 +2,7 @@
// deadline_timer.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -268,18 +268,18 @@ struct custom_allocation_timer_handler
typedef allocator<U> other;
};
- explicit allocator(int* count) ASIO_NOEXCEPT
+ explicit allocator(int* count) noexcept
: count_(count)
{
}
- allocator(const allocator& other) ASIO_NOEXCEPT
+ allocator(const allocator& other) noexcept
: count_(other.count_)
{
}
template <typename U>
- allocator(const allocator<U>& other) ASIO_NOEXCEPT
+ allocator(const allocator<U>& other) noexcept
: count_(other.count_)
{
}
@@ -316,7 +316,7 @@ struct custom_allocation_timer_handler
typedef allocator<int> allocator_type;
- allocator_type get_allocator() const ASIO_NOEXCEPT
+ allocator_type get_allocator() const noexcept
{
return allocator_type(count_);
}
@@ -396,7 +396,6 @@ void deadline_timer_async_result_test()
ioc.run();
}
-#if defined(ASIO_HAS_MOVE)
asio::deadline_timer make_timer(asio::io_context& ioc, int* count)
{
asio::deadline_timer t(ioc);
@@ -404,11 +403,9 @@ asio::deadline_timer make_timer(asio::io_context& ioc, int* count)
t.async_wait(boost::bind(increment, count));
return t;
}
-#endif // defined(ASIO_HAS_MOVE)
void deadline_timer_move_test()
{
-#if defined(ASIO_HAS_MOVE)
asio::io_context io_context1;
asio::io_context io_context2;
int count = 0;
@@ -426,7 +423,6 @@ void deadline_timer_move_test()
io_context1.run();
ASIO_CHECK(count == 2);
-#endif // defined(ASIO_HAS_MOVE)
}
ASIO_TEST_SUITE
diff --git a/3rdparty/asio/src/tests/unit/defer.cpp b/3rdparty/asio/src/tests/unit/defer.cpp
index f7f03b326bf..f41c1b9f025 100644
--- a/3rdparty/asio/src/tests/unit/defer.cpp
+++ b/3rdparty/asio/src/tests/unit/defer.cpp
@@ -2,7 +2,7 @@
// defer.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/experimental/deferred.cpp b/3rdparty/asio/src/tests/unit/deferred.cpp
index a5ae8ed85e5..b2db70d4b3d 100644
--- a/3rdparty/asio/src/tests/unit/experimental/deferred.cpp
+++ b/3rdparty/asio/src/tests/unit/deferred.cpp
@@ -1,8 +1,8 @@
//
-// experimental/deferred.cpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~
+// deferred.cpp
+// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -14,9 +14,9 @@
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
-#include "asio/experimental/deferred.hpp"
+#include "asio/deferred.hpp"
-#include "../unit_test.hpp"
+#include "unit_test.hpp"
ASIO_TEST_SUITE
(
diff --git a/3rdparty/asio/src/tests/unit/detached.cpp b/3rdparty/asio/src/tests/unit/detached.cpp
index 2ccd619cef0..506c13d8773 100644
--- a/3rdparty/asio/src/tests/unit/detached.cpp
+++ b/3rdparty/asio/src/tests/unit/detached.cpp
@@ -2,7 +2,7 @@
// detached.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/dispatch.cpp b/3rdparty/asio/src/tests/unit/dispatch.cpp
index 4d67530f5ba..f6fb84d4f91 100644
--- a/3rdparty/asio/src/tests/unit/dispatch.cpp
+++ b/3rdparty/asio/src/tests/unit/dispatch.cpp
@@ -2,7 +2,7 @@
// dispatch.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/error.cpp b/3rdparty/asio/src/tests/unit/error.cpp
index 79c0c75336c..3f8aa75efbe 100644
--- a/3rdparty/asio/src/tests/unit/error.cpp
+++ b/3rdparty/asio/src/tests/unit/error.cpp
@@ -2,7 +2,7 @@
// error.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/execution/any_executor.cpp b/3rdparty/asio/src/tests/unit/execution/any_executor.cpp
index d18c58c2843..3e2dabdc5a5 100644
--- a/3rdparty/asio/src/tests/unit/execution/any_executor.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/any_executor.cpp
@@ -2,7 +2,7 @@
// any_executor.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,22 +17,25 @@
#include "asio/execution/any_executor.hpp"
#include <cstring>
+#include <functional>
#include "asio/thread_pool.hpp"
#include "../unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
+
+static bool next_nothrow_new_fails = false;
+
+void* operator new(std::size_t n,
+ const std::nothrow_t&) noexcept
+{
+ if (next_nothrow_new_fails)
+ {
+ next_nothrow_new_fails = false;
+ return 0;
+ }
+ return ::operator new(n);
+}
struct fat_executor
{
@@ -53,13 +56,13 @@ struct fat_executor
}
friend bool operator==(const fat_executor& a,
- const fat_executor& b) ASIO_NOEXCEPT
+ const fat_executor& b) noexcept
{
return a.id_ == b.id_;
}
friend bool operator!=(const fat_executor& a,
- const fat_executor& b) ASIO_NOEXCEPT
+ const fat_executor& b) noexcept
{
return a.id_ != b.id_;
}
@@ -76,8 +79,8 @@ namespace traits {
template <typename F>
struct execute_member<fat_executor, F>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef void result_type;
};
@@ -88,8 +91,8 @@ struct execute_member<fat_executor, F>
template <>
struct query_member<fat_executor, execution::occupancy_t>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef std::size_t result_type;
};
@@ -100,8 +103,8 @@ struct query_member<fat_executor, execution::occupancy_t>
template <>
struct equality_comparable<fat_executor>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -189,7 +192,6 @@ void any_executor_construction_test()
ASIO_CHECK(ex_two_props_9 == ex_two_props_7);
ASIO_CHECK(ex_two_props_9 != ex_two_props_8);
-#if defined(ASIO_HAS_MOVE)
ex_two_props_t ex_two_props_10(std::move(ex_two_props_1));
ASIO_CHECK(ex_two_props_10.target<void>() == 0);
@@ -213,7 +215,6 @@ void any_executor_construction_test()
ASIO_CHECK(ex_two_props_7 == null_ptr);
ASIO_CHECK(ex_two_props_12 == ex_two_props_6);
ASIO_CHECK(ex_two_props_12 != ex_two_props_8);
-#endif // defined(ASIO_HAS_MOVE)
ex_one_prop_t ex_one_prop_1;
@@ -274,7 +275,6 @@ void any_executor_construction_test()
ASIO_CHECK(ex_one_prop_9 == ex_one_prop_7);
ASIO_CHECK(ex_one_prop_9 != ex_one_prop_8);
-#if defined(ASIO_HAS_MOVE)
ex_one_prop_t ex_one_prop_10(std::move(ex_one_prop_1));
ASIO_CHECK(ex_one_prop_10.target<void>() == 0);
@@ -298,7 +298,6 @@ void any_executor_construction_test()
ASIO_CHECK(ex_one_prop_7 == null_ptr);
ASIO_CHECK(ex_one_prop_12 == ex_one_prop_6);
ASIO_CHECK(ex_one_prop_12 != ex_one_prop_8);
-#endif // defined(ASIO_HAS_MOVE)
ex_one_prop_t ex_one_prop_13(ex_two_props_1);
@@ -374,7 +373,6 @@ void any_executor_construction_test()
ASIO_CHECK(ex_no_props_9 == ex_no_props_7);
ASIO_CHECK(ex_no_props_9 != ex_no_props_8);
-#if defined(ASIO_HAS_MOVE)
ex_no_props_t ex_no_props_10(std::move(ex_no_props_1));
ASIO_CHECK(ex_no_props_10.target<void>() == 0);
@@ -398,7 +396,6 @@ void any_executor_construction_test()
ASIO_CHECK(ex_no_props_7 == null_ptr);
ASIO_CHECK(ex_no_props_12 == ex_no_props_6);
ASIO_CHECK(ex_no_props_12 != ex_no_props_8);
-#endif // defined(ASIO_HAS_MOVE)
ex_no_props_t ex_no_props_13(ex_two_props_1);
@@ -431,6 +428,338 @@ void any_executor_construction_test()
ASIO_CHECK(ex_no_props_18 != null_ptr);
}
+void any_executor_nothrow_construction_test()
+{
+ typedef execution::any_executor<> ex_no_props_t;
+
+ typedef execution::any_executor<
+ execution::blocking_t
+ > ex_one_prop_t;
+
+ typedef execution::any_executor<
+ execution::blocking_t,
+ execution::occupancy_t
+ > ex_two_props_t;
+
+ thread_pool pool(1);
+ asio::nullptr_t null_ptr = asio::nullptr_t();
+
+ ex_two_props_t ex_two_props_1;
+
+ ASIO_CHECK(ex_two_props_1.target<void>() == 0);
+ ASIO_CHECK(ex_two_props_1 == null_ptr);
+
+ ex_two_props_t ex_two_props_2(null_ptr);
+
+ ASIO_CHECK(ex_two_props_2.target<void>() == 0);
+ ASIO_CHECK(ex_two_props_2 == null_ptr);
+ ASIO_CHECK(ex_two_props_2 == ex_two_props_1);
+
+ ex_two_props_t ex_two_props_3(std::nothrow, pool.executor());
+
+ ASIO_CHECK(ex_two_props_3.target<void>() != 0);
+ ASIO_CHECK(ex_two_props_3 != null_ptr);
+ ASIO_CHECK(ex_two_props_3 != ex_two_props_1);
+
+ ex_two_props_t ex_two_props_4(std::nothrow, ex_two_props_1);
+
+ ASIO_CHECK(ex_two_props_4.target<void>() == 0);
+ ASIO_CHECK(ex_two_props_4 == null_ptr);
+ ASIO_CHECK(ex_two_props_4 == ex_two_props_1);
+
+ ex_two_props_t ex_two_props_5(std::nothrow, ex_two_props_3);
+
+ ASIO_CHECK(ex_two_props_5.target<void>() != 0);
+ ASIO_CHECK(ex_two_props_5 != null_ptr);
+ ASIO_CHECK(ex_two_props_5 == ex_two_props_3);
+
+ ex_two_props_t ex_two_props_6(std::nothrow, fat_executor(1));
+
+ ASIO_CHECK(ex_two_props_6.target<void>() != 0);
+ ASIO_CHECK(ex_two_props_6 != null_ptr);
+ ASIO_CHECK(ex_two_props_6 != ex_two_props_1);
+
+ ex_two_props_t ex_two_props_7(std::nothrow, fat_executor(1));
+
+ ASIO_CHECK(ex_two_props_7.target<void>() != 0);
+ ASIO_CHECK(ex_two_props_7 != null_ptr);
+ ASIO_CHECK(ex_two_props_7 != ex_two_props_1);
+ ASIO_CHECK(ex_two_props_7 == ex_two_props_6);
+
+ ex_two_props_t ex_two_props_8(std::nothrow, fat_executor(2));
+
+ ASIO_CHECK(ex_two_props_8.target<void>() != 0);
+ ASIO_CHECK(ex_two_props_8 != null_ptr);
+ ASIO_CHECK(ex_two_props_8 != ex_two_props_1);
+ ASIO_CHECK(ex_two_props_8 != ex_two_props_6);
+ ASIO_CHECK(ex_two_props_8 != ex_two_props_7);
+
+ ex_two_props_t ex_two_props_9(std::nothrow, ex_two_props_6);
+
+ ASIO_CHECK(ex_two_props_9.target<void>() != 0);
+ ASIO_CHECK(ex_two_props_9 != null_ptr);
+ ASIO_CHECK(ex_two_props_9 != ex_two_props_1);
+ ASIO_CHECK(ex_two_props_9 == ex_two_props_6);
+ ASIO_CHECK(ex_two_props_9 == ex_two_props_7);
+ ASIO_CHECK(ex_two_props_9 != ex_two_props_8);
+
+ ex_two_props_t ex_two_props_10(std::nothrow, std::move(ex_two_props_1));
+
+ ASIO_CHECK(ex_two_props_10.target<void>() == 0);
+ ASIO_CHECK(ex_two_props_10 == null_ptr);
+ ASIO_CHECK(ex_two_props_1.target<void>() == 0);
+ ASIO_CHECK(ex_two_props_1 == null_ptr);
+
+ ex_two_props_t ex_two_props_11(std::nothrow, std::move(ex_two_props_3));
+
+ ASIO_CHECK(ex_two_props_11.target<void>() != 0);
+ ASIO_CHECK(ex_two_props_11 != null_ptr);
+ ASIO_CHECK(ex_two_props_3.target<void>() == 0);
+ ASIO_CHECK(ex_two_props_3 == null_ptr);
+ ASIO_CHECK(ex_two_props_11 == ex_two_props_5);
+
+ ex_two_props_t ex_two_props_12(std::nothrow, std::move(ex_two_props_7));
+
+ ASIO_CHECK(ex_two_props_12.target<void>() != 0);
+ ASIO_CHECK(ex_two_props_12 != null_ptr);
+ ASIO_CHECK(ex_two_props_7.target<void>() == 0);
+ ASIO_CHECK(ex_two_props_7 == null_ptr);
+ ASIO_CHECK(ex_two_props_12 == ex_two_props_6);
+ ASIO_CHECK(ex_two_props_12 != ex_two_props_8);
+
+ next_nothrow_new_fails = true;
+ ex_two_props_t ex_two_props_13(std::nothrow, fat_executor(3));
+
+ ASIO_CHECK(ex_two_props_13.target<void>() == 0);
+ ASIO_CHECK(ex_two_props_13 == null_ptr);
+ ASIO_CHECK(ex_two_props_13 == ex_two_props_1);
+
+ ex_one_prop_t ex_one_prop_1;
+
+ ASIO_CHECK(ex_one_prop_1.target<void>() == 0);
+ ASIO_CHECK(ex_one_prop_1 == null_ptr);
+
+ ex_one_prop_t ex_one_prop_2(null_ptr);
+
+ ASIO_CHECK(ex_one_prop_2.target<void>() == 0);
+ ASIO_CHECK(ex_one_prop_2 == null_ptr);
+ ASIO_CHECK(ex_one_prop_2 == ex_one_prop_1);
+
+ ex_one_prop_t ex_one_prop_3(std::nothrow, pool.executor());
+
+ ASIO_CHECK(ex_one_prop_3.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_3 != null_ptr);
+ ASIO_CHECK(ex_one_prop_3 != ex_one_prop_1);
+
+ ex_one_prop_t ex_one_prop_4(std::nothrow, ex_one_prop_1);
+
+ ASIO_CHECK(ex_one_prop_4.target<void>() == 0);
+ ASIO_CHECK(ex_one_prop_4 == null_ptr);
+ ASIO_CHECK(ex_one_prop_4 == ex_one_prop_1);
+
+ ex_one_prop_t ex_one_prop_5(std::nothrow, ex_one_prop_3);
+
+ ASIO_CHECK(ex_one_prop_5.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_5 != null_ptr);
+ ASIO_CHECK(ex_one_prop_5 == ex_one_prop_3);
+
+ ex_one_prop_t ex_one_prop_6 = fat_executor(1);
+
+ ASIO_CHECK(ex_one_prop_6.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_6 != null_ptr);
+ ASIO_CHECK(ex_one_prop_6 != ex_one_prop_1);
+
+ ex_one_prop_t ex_one_prop_7(std::nothrow, fat_executor(1));
+
+ ASIO_CHECK(ex_one_prop_7.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_7 != null_ptr);
+ ASIO_CHECK(ex_one_prop_7 != ex_one_prop_1);
+ ASIO_CHECK(ex_one_prop_7 == ex_one_prop_6);
+
+ ex_one_prop_t ex_one_prop_8(std::nothrow, fat_executor(2));
+
+ ASIO_CHECK(ex_one_prop_8.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_8 != null_ptr);
+ ASIO_CHECK(ex_one_prop_8 != ex_one_prop_1);
+ ASIO_CHECK(ex_one_prop_8 != ex_one_prop_6);
+ ASIO_CHECK(ex_one_prop_8 != ex_one_prop_7);
+
+ ex_one_prop_t ex_one_prop_9(std::nothrow, ex_one_prop_6);
+
+ ASIO_CHECK(ex_one_prop_9.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_9 != null_ptr);
+ ASIO_CHECK(ex_one_prop_9 != ex_one_prop_1);
+ ASIO_CHECK(ex_one_prop_9 == ex_one_prop_6);
+ ASIO_CHECK(ex_one_prop_9 == ex_one_prop_7);
+ ASIO_CHECK(ex_one_prop_9 != ex_one_prop_8);
+
+ ex_one_prop_t ex_one_prop_10(std::nothrow, std::move(ex_one_prop_1));
+
+ ASIO_CHECK(ex_one_prop_10.target<void>() == 0);
+ ASIO_CHECK(ex_one_prop_10 == null_ptr);
+ ASIO_CHECK(ex_one_prop_1.target<void>() == 0);
+ ASIO_CHECK(ex_one_prop_1 == null_ptr);
+
+ ex_one_prop_t ex_one_prop_11(std::nothrow, std::move(ex_one_prop_3));
+
+ ASIO_CHECK(ex_one_prop_11.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_11 != null_ptr);
+ ASIO_CHECK(ex_one_prop_3.target<void>() == 0);
+ ASIO_CHECK(ex_one_prop_3 == null_ptr);
+ ASIO_CHECK(ex_one_prop_11 == ex_one_prop_5);
+
+ ex_one_prop_t ex_one_prop_12(std::nothrow, std::move(ex_one_prop_7));
+
+ ASIO_CHECK(ex_one_prop_12.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_12 != null_ptr);
+ ASIO_CHECK(ex_one_prop_7.target<void>() == 0);
+ ASIO_CHECK(ex_one_prop_7 == null_ptr);
+ ASIO_CHECK(ex_one_prop_12 == ex_one_prop_6);
+ ASIO_CHECK(ex_one_prop_12 != ex_one_prop_8);
+
+ ex_one_prop_t ex_one_prop_13(std::nothrow, ex_two_props_1);
+
+ ASIO_CHECK(ex_one_prop_13.target<void>() == 0);
+ ASIO_CHECK(ex_one_prop_13 == null_ptr);
+
+ ex_one_prop_t ex_one_prop_14(std::nothrow, ex_two_props_5);
+
+ ASIO_CHECK(ex_one_prop_14.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_14 != null_ptr);
+
+ ex_one_prop_t ex_one_prop_15(std::nothrow, ex_two_props_9);
+
+ ASIO_CHECK(ex_one_prop_15.target<void>() != 0);
+ ASIO_CHECK(ex_one_prop_15 != null_ptr);
+
+ next_nothrow_new_fails = true;
+ ex_one_prop_t ex_one_prop_16(std::nothrow, fat_executor(3));
+
+ ASIO_CHECK(ex_one_prop_16.target<void>() == 0);
+ ASIO_CHECK(ex_one_prop_16 == null_ptr);
+ ASIO_CHECK(ex_one_prop_16 == ex_one_prop_1);
+
+ ex_no_props_t ex_no_props_1;
+
+ ASIO_CHECK(ex_no_props_1.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_1 == null_ptr);
+
+ ex_no_props_t ex_no_props_2(null_ptr);
+
+ ASIO_CHECK(ex_no_props_2.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_2 == null_ptr);
+ ASIO_CHECK(ex_no_props_2 == ex_no_props_1);
+
+ ex_no_props_t ex_no_props_3(std::nothrow, pool.executor());
+
+ ASIO_CHECK(ex_no_props_3.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_3 != null_ptr);
+ ASIO_CHECK(ex_no_props_3 != ex_no_props_1);
+
+ ex_no_props_t ex_no_props_4(std::nothrow, ex_no_props_1);
+
+ ASIO_CHECK(ex_no_props_4.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_4 == null_ptr);
+ ASIO_CHECK(ex_no_props_4 == ex_no_props_1);
+
+ ex_no_props_t ex_no_props_5(std::nothrow, ex_no_props_3);
+
+ ASIO_CHECK(ex_no_props_5.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_5 != null_ptr);
+ ASIO_CHECK(ex_no_props_5 == ex_no_props_3);
+
+ ex_no_props_t ex_no_props_6(std::nothrow, fat_executor(1));
+
+ ASIO_CHECK(ex_no_props_6.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_6 != null_ptr);
+ ASIO_CHECK(ex_no_props_6 != ex_no_props_1);
+
+ ex_no_props_t ex_no_props_7(std::nothrow, fat_executor(1));
+
+ ASIO_CHECK(ex_no_props_7.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_7 != null_ptr);
+ ASIO_CHECK(ex_no_props_7 != ex_no_props_1);
+ ASIO_CHECK(ex_no_props_7 == ex_no_props_6);
+
+ ex_no_props_t ex_no_props_8(std::nothrow, fat_executor(2));
+
+ ASIO_CHECK(ex_no_props_8.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_8 != null_ptr);
+ ASIO_CHECK(ex_no_props_8 != ex_no_props_1);
+ ASIO_CHECK(ex_no_props_8 != ex_no_props_6);
+ ASIO_CHECK(ex_no_props_8 != ex_no_props_7);
+
+ ex_no_props_t ex_no_props_9(std::nothrow, ex_no_props_6);
+
+ ASIO_CHECK(ex_no_props_9.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_9 != null_ptr);
+ ASIO_CHECK(ex_no_props_9 != ex_no_props_1);
+ ASIO_CHECK(ex_no_props_9 == ex_no_props_6);
+ ASIO_CHECK(ex_no_props_9 == ex_no_props_7);
+ ASIO_CHECK(ex_no_props_9 != ex_no_props_8);
+
+ ex_no_props_t ex_no_props_10(std::nothrow, std::move(ex_no_props_1));
+
+ ASIO_CHECK(ex_no_props_10.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_10 == null_ptr);
+ ASIO_CHECK(ex_no_props_1.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_1 == null_ptr);
+
+ ex_no_props_t ex_no_props_11(std::nothrow, std::move(ex_no_props_3));
+
+ ASIO_CHECK(ex_no_props_11.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_11 != null_ptr);
+ ASIO_CHECK(ex_no_props_3.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_3 == null_ptr);
+ ASIO_CHECK(ex_no_props_11 == ex_no_props_5);
+
+ ex_no_props_t ex_no_props_12(std::nothrow, std::move(ex_no_props_7));
+
+ ASIO_CHECK(ex_no_props_12.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_12 != null_ptr);
+ ASIO_CHECK(ex_no_props_7.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_7 == null_ptr);
+ ASIO_CHECK(ex_no_props_12 == ex_no_props_6);
+ ASIO_CHECK(ex_no_props_12 != ex_no_props_8);
+
+ ex_no_props_t ex_no_props_13(std::nothrow, ex_two_props_1);
+
+ ASIO_CHECK(ex_no_props_13.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_13 == null_ptr);
+
+ ex_no_props_t ex_no_props_14(std::nothrow, ex_two_props_5);
+
+ ASIO_CHECK(ex_no_props_14.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_14 != null_ptr);
+
+ ex_no_props_t ex_no_props_15(std::nothrow, ex_two_props_9);
+
+ ASIO_CHECK(ex_no_props_15.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_15 != null_ptr);
+
+ ex_no_props_t ex_no_props_16(std::nothrow, ex_one_prop_1);
+
+ ASIO_CHECK(ex_no_props_16.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_16 == null_ptr);
+
+ ex_no_props_t ex_no_props_17(std::nothrow, ex_one_prop_5);
+
+ ASIO_CHECK(ex_no_props_17.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_17 != null_ptr);
+
+ ex_no_props_t ex_no_props_18(std::nothrow, ex_one_prop_9);
+
+ ASIO_CHECK(ex_no_props_18.target<void>() != 0);
+ ASIO_CHECK(ex_no_props_18 != null_ptr);
+
+ next_nothrow_new_fails = true;
+ ex_no_props_t ex_no_props_19(std::nothrow, fat_executor(3));
+
+ ASIO_CHECK(ex_no_props_19.target<void>() == 0);
+ ASIO_CHECK(ex_no_props_19 == null_ptr);
+ ASIO_CHECK(ex_no_props_19 == ex_no_props_1);
+}
+
void any_executor_assignment_test()
{
typedef execution::any_executor<> ex_no_props_t;
@@ -501,7 +830,6 @@ void any_executor_assignment_test()
ASIO_CHECK(ex_two_props_7 == ex_two_props_5);
ASIO_CHECK(ex_two_props_7 != ex_two_props_6);
-#if defined(ASIO_HAS_MOVE)
ex_two_props_t ex_two_props_8;
ex_two_props_8 = std::move(ex_two_props_1);
@@ -519,7 +847,6 @@ void any_executor_assignment_test()
ASIO_CHECK(ex_two_props_8.target<void>() != 0);
ASIO_CHECK(ex_two_props_5.target<void>() == 0);
ASIO_CHECK(ex_two_props_8 == ex_two_props_7);
-#endif // defined(ASIO_HAS_MOVE)
ex_one_prop_t ex_one_prop_1;
@@ -575,7 +902,6 @@ void any_executor_assignment_test()
ASIO_CHECK(ex_one_prop_7 == ex_one_prop_5);
ASIO_CHECK(ex_one_prop_7 != ex_one_prop_6);
-#if defined(ASIO_HAS_MOVE)
ex_one_prop_t ex_one_prop_8;
ex_one_prop_8 = std::move(ex_one_prop_1);
@@ -593,7 +919,6 @@ void any_executor_assignment_test()
ASIO_CHECK(ex_one_prop_8.target<void>() != 0);
ASIO_CHECK(ex_one_prop_5.target<void>() == 0);
ASIO_CHECK(ex_one_prop_8 == ex_one_prop_7);
-#endif // defined(ASIO_HAS_MOVE)
ex_one_prop_t ex_one_prop_9;
ex_one_prop_9 = ex_two_props_1;
@@ -662,7 +987,6 @@ void any_executor_assignment_test()
ASIO_CHECK(ex_no_props_7 == ex_no_props_5);
ASIO_CHECK(ex_no_props_7 != ex_no_props_6);
-#if defined(ASIO_HAS_MOVE)
ex_no_props_t ex_no_props_8;
ex_no_props_8 = std::move(ex_no_props_1);
@@ -680,7 +1004,6 @@ void any_executor_assignment_test()
ASIO_CHECK(ex_no_props_8.target<void>() != 0);
ASIO_CHECK(ex_no_props_5.target<void>() == 0);
ASIO_CHECK(ex_no_props_8 == ex_no_props_7);
-#endif // defined(ASIO_HAS_MOVE)
ex_no_props_t ex_no_props_9;
ex_no_props_9 = ex_two_props_1;
@@ -838,37 +1161,29 @@ void any_executor_execute_test()
execution::relationship_t::continuation_t>
ex(pool.executor());
- asio::execution::execute(pool.executor(),
- bindns::bind(increment, &count));
+ ex.execute(bindns::bind(increment, &count));
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.possibly),
+ asio::require(ex, asio::execution::blocking.possibly).execute(
bindns::bind(increment, &count));
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.never),
+ asio::require(ex, asio::execution::blocking.never).execute(
bindns::bind(increment, &count));
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.tracked),
- bindns::bind(increment, &count));
+ asio::require(ex,
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.tracked
+ ).execute(bindns::bind(increment, &count));
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked),
- bindns::bind(increment, &count));
+ asio::require(ex,
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked
+ ).execute(bindns::bind(increment, &count));
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- bindns::bind(increment, &count));
+ asio::require(ex,
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation
+ ).execute(bindns::bind(increment, &count));
pool.wait();
@@ -879,6 +1194,7 @@ ASIO_TEST_SUITE
(
"any_executor",
ASIO_TEST_CASE(any_executor_construction_test)
+ ASIO_TEST_CASE(any_executor_nothrow_construction_test)
ASIO_TEST_CASE(any_executor_assignment_test)
ASIO_TEST_CASE(any_executor_swap_test)
ASIO_TEST_CASE(any_executor_query_test)
diff --git a/3rdparty/asio/src/tests/unit/execution/blocking.cpp b/3rdparty/asio/src/tests/unit/execution/blocking.cpp
index 848841b6278..ce2ba2f8ea5 100644
--- a/3rdparty/asio/src/tests/unit/execution/blocking.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/blocking.cpp
@@ -2,7 +2,7 @@
// blocking.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -35,12 +35,12 @@ struct ex_nq_nr
{
}
- friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
@@ -64,7 +64,7 @@ struct is_executor<ex_nq_nr> : asio::true_type
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
- static ASIO_CONSTEXPR ResultType query(ParamType) ASIO_NOEXCEPT
+ static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
@@ -74,12 +74,12 @@ struct ex_cq_nr
{
}
- friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
@@ -114,12 +114,12 @@ struct query_static_constexpr_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return Result();
}
@@ -133,7 +133,7 @@ struct query_static_constexpr_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
- ResultType query(ParamType) const ASIO_NOEXCEPT
+ ResultType query(ParamType) const noexcept
{
return Result();
}
@@ -143,12 +143,12 @@ struct ex_mq_nr
{
}
- friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
@@ -183,8 +183,8 @@ struct query_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -197,7 +197,7 @@ struct query_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
- friend ResultType query(const ex_fq_nr&, ParamType) ASIO_NOEXCEPT
+ friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
@@ -207,12 +207,12 @@ struct ex_fq_nr
{
}
- friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
@@ -247,8 +247,8 @@ struct query_free<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -261,24 +261,24 @@ struct query_free<
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
- CurrentType query(OtherType) const ASIO_NOEXCEPT
+ CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
- OtherType) const ASIO_NOEXCEPT
+ OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
@@ -288,12 +288,12 @@ struct ex_mq_mr
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -302,13 +302,13 @@ struct ex_mq_mr
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
@@ -318,12 +318,12 @@ struct ex_mq_mr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -358,8 +358,8 @@ struct query_member<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -375,8 +375,8 @@ struct require_member<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
@@ -389,8 +389,8 @@ struct require_member<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
@@ -403,36 +403,36 @@ struct require_member<
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
- friend CurrentType query(const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
@@ -442,12 +442,12 @@ struct ex_fq_fr
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -456,19 +456,19 @@ struct ex_fq_fr
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
@@ -478,12 +478,12 @@ struct ex_fq_fr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -518,8 +518,8 @@ struct query_free<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -535,8 +535,8 @@ struct require_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -549,8 +549,8 @@ struct require_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -566,8 +566,8 @@ struct prefer_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -580,8 +580,8 @@ struct prefer_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -594,19 +594,19 @@ struct prefer_free<
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -629,29 +629,27 @@ void test_query()
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
-#if defined(ASIO_HAS_CONSTEXPR)
constexpr Executor ex1 = {};
constexpr exec::blocking_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
-#endif // defined(ASIO_HAS_CONSTEXPR)
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -680,19 +678,19 @@ void test_require()
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -721,9 +719,18 @@ void test_prefer()
void test_vars()
{
ASIO_CHECK(s() == exec::blocking);
+ ASIO_CHECK(s() != exec::blocking.possibly);
+ ASIO_CHECK(s() != exec::blocking.always);
+ ASIO_CHECK(s() != exec::blocking.never);
ASIO_CHECK(n1() == exec::blocking.possibly);
+ ASIO_CHECK(n1() != exec::blocking.always);
+ ASIO_CHECK(n1() != exec::blocking.never);
ASIO_CHECK(n2() == exec::blocking.always);
+ ASIO_CHECK(n2() != exec::blocking.possibly);
+ ASIO_CHECK(n2() != exec::blocking.never);
ASIO_CHECK(n3() == exec::blocking.never);
+ ASIO_CHECK(n3() != exec::blocking.possibly);
+ ASIO_CHECK(n3() != exec::blocking.always);
}
ASIO_TEST_SUITE
diff --git a/3rdparty/asio/src/tests/unit/execution/blocking_adaptation.cpp b/3rdparty/asio/src/tests/unit/execution/blocking_adaptation.cpp
index d16650ae799..b6e77dd31a9 100644
--- a/3rdparty/asio/src/tests/unit/execution/blocking_adaptation.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/blocking_adaptation.cpp
@@ -2,7 +2,7 @@
// blocking_adaptation.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -34,12 +34,12 @@ struct ex_nq_nr
{
}
- friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
@@ -53,8 +53,8 @@ namespace traits {
template <>
struct equality_comparable<ex_nq_nr>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -64,8 +64,8 @@ struct equality_comparable<ex_nq_nr>
template <typename Function>
struct execute_member<ex_nq_nr, Function>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -78,7 +78,7 @@ struct execute_member<ex_nq_nr, Function>
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
- static ASIO_CONSTEXPR ResultType query(ParamType) ASIO_NOEXCEPT
+ static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
@@ -88,12 +88,12 @@ struct ex_cq_nr
{
}
- friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
@@ -107,8 +107,8 @@ namespace traits {
template <typename ResultType, typename ParamType, typename Result>
struct equality_comparable<ex_cq_nr<ResultType, ParamType, Result> >
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -119,8 +119,8 @@ template <typename ResultType, typename ParamType,
typename Result, typename Function>
struct execute_member<ex_cq_nr<ResultType, ParamType, Result>, Function>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -137,12 +137,12 @@ struct query_static_constexpr_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return Result();
}
@@ -156,7 +156,7 @@ struct query_static_constexpr_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
- ResultType query(ParamType) const ASIO_NOEXCEPT
+ ResultType query(ParamType) const noexcept
{
return Result();
}
@@ -166,12 +166,12 @@ struct ex_mq_nr
{
}
- friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
@@ -185,8 +185,8 @@ namespace traits {
template <typename ResultType, typename ParamType, typename Result>
struct equality_comparable<ex_mq_nr<ResultType, ParamType, Result> >
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -197,8 +197,8 @@ template <typename ResultType, typename ParamType,
typename Result, typename Function>
struct execute_member<ex_mq_nr<ResultType, ParamType, Result>, Function>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -215,8 +215,8 @@ struct query_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -229,7 +229,7 @@ struct query_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
- friend ResultType query(const ex_fq_nr&, ParamType) ASIO_NOEXCEPT
+ friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
@@ -239,12 +239,12 @@ struct ex_fq_nr
{
}
- friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
@@ -258,8 +258,8 @@ namespace traits {
template <typename ResultType, typename ParamType, typename Result>
struct equality_comparable<ex_fq_nr<ResultType, ParamType, Result> >
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -270,8 +270,8 @@ template <typename ResultType, typename ParamType,
typename Result, typename Function>
struct execute_member<ex_fq_nr<ResultType, ParamType, Result>, Function>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -288,8 +288,8 @@ struct query_free<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -302,24 +302,24 @@ struct query_free<
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
- CurrentType query(OtherType) const ASIO_NOEXCEPT
+ CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
- OtherType) const ASIO_NOEXCEPT
+ OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
@@ -329,12 +329,12 @@ struct ex_mq_mr
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -343,13 +343,13 @@ struct ex_mq_mr
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
@@ -359,12 +359,12 @@ struct ex_mq_mr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -378,8 +378,8 @@ namespace traits {
template <typename CurrentType, typename OtherType>
struct equality_comparable<ex_mq_mr<CurrentType, OtherType> >
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -389,8 +389,8 @@ struct equality_comparable<ex_mq_mr<CurrentType, OtherType> >
template <typename CurrentType, typename OtherType, typename Function>
struct execute_member<ex_mq_mr<CurrentType, OtherType>, Function>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -407,8 +407,8 @@ struct query_member<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -424,8 +424,8 @@ struct require_member<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
@@ -438,8 +438,8 @@ struct require_member<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
@@ -452,36 +452,36 @@ struct require_member<
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
- friend CurrentType query(const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
@@ -491,12 +491,12 @@ struct ex_fq_fr
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -505,19 +505,19 @@ struct ex_fq_fr
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
@@ -527,12 +527,12 @@ struct ex_fq_fr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -546,8 +546,8 @@ namespace traits {
template <typename CurrentType, typename OtherType>
struct equality_comparable<ex_fq_fr<CurrentType, OtherType> >
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -557,8 +557,8 @@ struct equality_comparable<ex_fq_fr<CurrentType, OtherType> >
template <typename CurrentType, typename OtherType, typename Function>
struct execute_member<ex_fq_fr<CurrentType, OtherType>, Function>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef void result_type;
};
@@ -575,8 +575,8 @@ struct query_free<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -592,8 +592,8 @@ struct require_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -606,8 +606,8 @@ struct require_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -623,8 +623,8 @@ struct prefer_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -637,8 +637,8 @@ struct prefer_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -651,19 +651,19 @@ struct prefer_free<
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -686,29 +686,27 @@ void test_query()
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
-#if defined(ASIO_HAS_CONSTEXPR)
constexpr Executor ex1 = {};
constexpr exec::blocking_adaptation_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
-#endif // defined(ASIO_HAS_CONSTEXPR)
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -757,19 +755,19 @@ void test_require()
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -798,8 +796,12 @@ void test_prefer()
void test_vars()
{
ASIO_CHECK(s() == exec::blocking_adaptation);
+ ASIO_CHECK(s() != exec::blocking_adaptation.disallowed);
+ ASIO_CHECK(s() != exec::blocking_adaptation.allowed);
ASIO_CHECK(n1() == exec::blocking_adaptation.disallowed);
+ ASIO_CHECK(n1() != exec::blocking_adaptation.allowed);
ASIO_CHECK(n2() == exec::blocking_adaptation.allowed);
+ ASIO_CHECK(n2() != exec::blocking_adaptation.disallowed);
}
ASIO_TEST_SUITE
diff --git a/3rdparty/asio/src/tests/unit/execution/bulk_execute.cpp b/3rdparty/asio/src/tests/unit/execution/bulk_execute.cpp
deleted file mode 100644
index 55a2118e955..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/bulk_execute.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-//
-// bulk_execute.cpp
-// ~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/bulk_execute.hpp"
-
-#include "asio/execution.hpp"
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-int call_count = 0;
-
-struct operation_state
-{
- void start() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <>
-struct start_member<operation_state>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct sender : exec::sender_base
-{
- sender()
- {
- }
-
- template <typename R>
- operation_state connect(ASIO_MOVE_ARG(R) r) const
- {
- (void)r;
- return operation_state();
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename R>
-struct connect_member<const sender, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct no_bulk_execute
-{
-};
-
-struct const_member_bulk_execute
-{
- const_member_bulk_execute()
- {
- }
-
- template <typename F>
- sender bulk_execute(ASIO_MOVE_ARG(F), std::size_t) const
- {
- ++call_count;
- return sender();
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-template <typename F, typename N>
-struct bulk_execute_member<const const_member_bulk_execute, F, N>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef sender result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct free_bulk_execute
-{
- free_bulk_execute()
- {
- }
-
- template <typename F>
- friend sender bulk_execute(const free_bulk_execute&,
- ASIO_MOVE_ARG(F), std::size_t)
- {
- ++call_count;
- return sender();
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT)
-
-template <typename F, typename N>
-struct bulk_execute_free<const free_bulk_execute, F, N>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef sender result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct executor
-{
- executor()
- {
- }
-
- executor(const executor&) ASIO_NOEXCEPT
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- executor(executor&&) ASIO_NOEXCEPT
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const ASIO_NOEXCEPT
- {
- typename asio::decay<F>::type tmp(ASIO_MOVE_CAST(F)(f));
- tmp();
- }
-
- bool operator==(const executor&) const ASIO_NOEXCEPT
- {
- return true;
- }
-
- bool operator!=(const executor&) const ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-template <typename F>
-struct execute_member<executor, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-template <>
-struct equality_comparable<executor>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void test_can_bulk_execute()
-{
- ASIO_CONSTEXPR bool b1 = exec::can_bulk_execute<
- no_bulk_execute&, exec::invocable_archetype, std::size_t>::value;
- ASIO_CHECK(b1 == false);
-
- ASIO_CONSTEXPR bool b2 = exec::can_bulk_execute<
- const no_bulk_execute&, exec::invocable_archetype, std::size_t>::value;
- ASIO_CHECK(b2 == false);
-
- ASIO_CONSTEXPR bool b3 = exec::can_bulk_execute<
- const_member_bulk_execute&, exec::invocable_archetype, std::size_t>::value;
- ASIO_CHECK(b3 == true);
-
- ASIO_CONSTEXPR bool b4 = exec::can_bulk_execute<
- const const_member_bulk_execute&,
- exec::invocable_archetype, std::size_t>::value;
- ASIO_CHECK(b4 == true);
-
- ASIO_CONSTEXPR bool b5 = exec::can_bulk_execute<
- free_bulk_execute&, exec::invocable_archetype, std::size_t>::value;
- ASIO_CHECK(b5 == true);
-
- ASIO_CONSTEXPR bool b6 = exec::can_bulk_execute<
- const free_bulk_execute&, exec::invocable_archetype, std::size_t>::value;
- ASIO_CHECK(b6 == true);
-
- ASIO_CONSTEXPR bool b7 = exec::can_bulk_execute<
- executor&, exec::invocable_archetype, std::size_t>::value;
- ASIO_CHECK(b7 == true);
-
- ASIO_CONSTEXPR bool b8 = exec::can_bulk_execute<
- const executor&, exec::invocable_archetype, std::size_t>::value;
- ASIO_CHECK(b8 == true);
-}
-
-void handler(std::size_t)
-{
-}
-
-void counting_handler(std::size_t)
-{
- ++call_count;
-}
-
-void completion_handler()
-{
- ++call_count;
-}
-
-void test_bulk_execute()
-{
- call_count = 0;
- const_member_bulk_execute ex1;
- exec::bulk_execute(ex1, handler, 2);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const const_member_bulk_execute ex2;
- exec::bulk_execute(ex2, handler, 2);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::bulk_execute(const_member_bulk_execute(), handler, 2);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_bulk_execute ex3;
- exec::bulk_execute(ex3, handler, 2);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const free_bulk_execute ex4;
- exec::bulk_execute(ex4, handler, 2);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::bulk_execute(free_bulk_execute(), handler, 2);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- executor ex5;
- exec::execute(
- exec::bulk_execute(ex5, counting_handler, 10u),
- completion_handler);
- ASIO_CHECK(call_count == 11);
-
- call_count = 0;
- const executor ex6;
- exec::execute(
- exec::bulk_execute(ex6, counting_handler, 10u),
- completion_handler);
- ASIO_CHECK(call_count == 11);
-
- call_count = 0;
- exec::execute(
- exec::bulk_execute(executor(), counting_handler, 10u),
- completion_handler);
- ASIO_CHECK(call_count == 11);
-}
-
-ASIO_TEST_SUITE
-(
- "bulk_execute",
- ASIO_TEST_CASE(test_can_bulk_execute)
- ASIO_TEST_CASE(test_bulk_execute)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/bulk_guarantee.cpp b/3rdparty/asio/src/tests/unit/execution/bulk_guarantee.cpp
deleted file mode 100644
index 3127ff89db3..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/bulk_guarantee.cpp
+++ /dev/null
@@ -1,1978 +0,0 @@
-//
-// bulk_guarantee.cpp
-// ~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/bulk_guarantee.hpp"
-
-#include "asio/prefer.hpp"
-#include "asio/query.hpp"
-#include "asio/require.hpp"
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-typedef exec::bulk_guarantee_t s;
-typedef exec::bulk_guarantee_t::unsequenced_t n1;
-typedef exec::bulk_guarantee_t::sequenced_t n2;
-typedef exec::bulk_guarantee_t::parallel_t n3;
-
-struct ex_nq_nr
-{
- template <typename F>
- void execute(const F&) const
- {
- }
-
- friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
- {
- return true;
- }
-
- friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace execution {
-
-template <>
-struct is_executor<ex_nq_nr> : asio::true_type
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-template <typename ResultType, typename ParamType, typename Result>
-struct ex_cq_nr
-{
- static ASIO_CONSTEXPR ResultType query(ParamType) ASIO_NOEXCEPT
- {
- return Result();
- }
-
- template <typename F>
- void execute(const F&) const
- {
- }
-
- friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
- {
- return true;
- }
-
- friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace execution {
-
-template <typename ResultType, typename ParamType, typename Result>
-struct is_executor<ex_cq_nr<ResultType, ParamType, Result> >
- : asio::true_type
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
-
-template <typename ResultType, typename ParamType,
- typename Result, typename Param>
-struct query_static_constexpr_member<
- ex_cq_nr<ResultType, ParamType, Result>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, ParamType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef Result result_type; // Must return raw result type.
-
- static ASIO_CONSTEXPR result_type value()
- {
- return Result();
- }
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-template <typename ResultType, typename ParamType, typename Result>
-struct ex_mq_nr
-{
- ResultType query(ParamType) const ASIO_NOEXCEPT
- {
- return Result();
- }
-
- template <typename F>
- void execute(const F&) const
- {
- }
-
- friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
- {
- return true;
- }
-
- friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace execution {
-
-template <typename ResultType, typename ParamType, typename Result>
-struct is_executor<ex_mq_nr<ResultType, ParamType, Result> >
- : asio::true_type
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
-
-template <typename ResultType, typename ParamType,
- typename Result, typename Param>
-struct query_member<
- ex_mq_nr<ResultType, ParamType, Result>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, ParamType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef ResultType result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-template <typename ResultType, typename ParamType, typename Result>
-struct ex_fq_nr
-{
- friend ResultType query(const ex_fq_nr&, ParamType) ASIO_NOEXCEPT
- {
- return Result();
- }
-
- template <typename F>
- void execute(const F&) const
- {
- }
-
- friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
- {
- return true;
- }
-
- friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace execution {
-
-template <typename ResultType, typename ParamType, typename Result>
-struct is_executor<ex_fq_nr<ResultType, ParamType, Result> >
- : asio::true_type
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
-
-template <typename ResultType, typename ParamType,
- typename Result, typename Param>
-struct query_free<
- ex_fq_nr<ResultType, ParamType, Result>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, ParamType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef ResultType result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-template <typename CurrentType, typename OtherType>
-struct ex_mq_mr
-{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
- {
- return CurrentType();
- }
-
- CurrentType query(OtherType) const ASIO_NOEXCEPT
- {
- return CurrentType();
- }
-
- ex_mq_mr<CurrentType, OtherType> require(
- CurrentType) const ASIO_NOEXCEPT
- {
- return ex_mq_mr<CurrentType, OtherType>();
- }
-
- ex_mq_mr<OtherType, CurrentType> require(
- OtherType) const ASIO_NOEXCEPT
- {
- return ex_mq_mr<OtherType, CurrentType>();
- }
-
- template <typename F>
- void execute(const F&) const
- {
- }
-
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
- {
- return true;
- }
-
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-template <typename CurrentType>
-struct ex_mq_mr<CurrentType, CurrentType>
-{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
- {
- return CurrentType();
- }
-
- ex_mq_mr<CurrentType, CurrentType> require(
- CurrentType) const ASIO_NOEXCEPT
- {
- return ex_mq_mr<CurrentType, CurrentType>();
- }
-
- template <typename F>
- void execute(const F&) const
- {
- }
-
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
- {
- return true;
- }
-
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace execution {
-
-template <typename CurrentType, typename OtherType>
-struct is_executor<ex_mq_mr<CurrentType, OtherType> >
- : asio::true_type
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
-
-template <typename CurrentType, typename OtherType, typename Param>
-struct query_member<
- ex_mq_mr<CurrentType, OtherType>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, CurrentType>::value
- || asio::is_convertible<Param, OtherType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef CurrentType result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
-
-template <typename CurrentType, typename OtherType, typename Param>
-struct require_member<
- ex_mq_mr<CurrentType, OtherType>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, CurrentType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef ex_mq_mr<CurrentType, OtherType> result_type;
-};
-
-template <typename CurrentType, typename OtherType, typename Param>
-struct require_member<
- ex_mq_mr<CurrentType, OtherType>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, OtherType>::value
- && !asio::is_same<CurrentType, OtherType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef ex_mq_mr<OtherType, CurrentType> result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-template <typename CurrentType, typename OtherType>
-struct ex_fq_fr
-{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
- {
- return CurrentType();
- }
-
- friend CurrentType query(const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
- {
- return CurrentType();
- }
-
- friend ex_fq_fr<CurrentType, OtherType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
- {
- return ex_fq_fr<CurrentType, OtherType>();
- }
-
- friend ex_fq_fr<OtherType, CurrentType> require(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
- {
- return ex_fq_fr<OtherType, CurrentType>();
- }
-
- friend ex_fq_fr<CurrentType, OtherType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
- {
- return ex_fq_fr<CurrentType, OtherType>();
- }
-
- friend ex_fq_fr<OtherType, CurrentType> prefer(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
- {
- return ex_fq_fr<OtherType, CurrentType>();
- }
-
- template <typename F>
- void execute(const F&) const
- {
- }
-
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
- {
- return true;
- }
-
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-template <typename CurrentType>
-struct ex_fq_fr<CurrentType, CurrentType>
-{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
- {
- return CurrentType();
- }
-
- friend ex_fq_fr<CurrentType, CurrentType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
- {
- return ex_fq_fr<CurrentType, CurrentType>();
- }
-
- friend ex_fq_fr<CurrentType, CurrentType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
- {
- return ex_fq_fr<CurrentType, CurrentType>();
- }
-
- template <typename F>
- void execute(const F&) const
- {
- }
-
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
- {
- return true;
- }
-
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace execution {
-
-template <typename CurrentType, typename OtherType>
-struct is_executor<ex_fq_fr<CurrentType, OtherType> >
- : asio::true_type
-{
-};
-
-} // namespace execution
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
-
-template <typename CurrentType, typename OtherType, typename Param>
-struct query_free<
- ex_fq_fr<CurrentType, OtherType>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, CurrentType>::value
- || asio::is_convertible<Param, OtherType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef CurrentType result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
-
-template <typename CurrentType, typename OtherType, typename Param>
-struct require_free<
- ex_fq_fr<CurrentType, OtherType>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, CurrentType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef ex_fq_fr<CurrentType, OtherType> result_type;
-};
-
-template <typename CurrentType, typename OtherType, typename Param>
-struct require_free<
- ex_fq_fr<CurrentType, OtherType>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, OtherType>::value
- && !asio::is_same<CurrentType, OtherType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef ex_fq_fr<OtherType, CurrentType> result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
-
-template <typename CurrentType, typename OtherType, typename Param>
-struct prefer_free<
- ex_fq_fr<CurrentType, OtherType>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, CurrentType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef ex_fq_fr<CurrentType, OtherType> result_type;
-};
-
-template <typename CurrentType, typename OtherType, typename Param>
-struct prefer_free<
- ex_fq_fr<CurrentType, OtherType>, Param,
- typename asio::enable_if<
- asio::is_convertible<Param, OtherType>::value
- && !asio::is_same<CurrentType, OtherType>::value
- >::type>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-
- typedef ex_fq_fr<OtherType, CurrentType> result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-template <typename Executor, typename Param, bool ExpectedResult>
-void test_can_query()
-{
- ASIO_CONSTEXPR bool b1 =
- asio::can_query<Executor, Param>::value;
- ASIO_CHECK(b1 == ExpectedResult);
-
- ASIO_CONSTEXPR bool b2 =
- asio::can_query<const Executor, Param>::value;
- ASIO_CHECK(b2 == ExpectedResult);
-
- ASIO_CONSTEXPR bool b3 =
- asio::can_query<Executor&, Param>::value;
- ASIO_CHECK(b3 == ExpectedResult);
-
- ASIO_CONSTEXPR bool b4 =
- asio::can_query<const Executor&, Param>::value;
- ASIO_CHECK(b4 == ExpectedResult);
-}
-
-template <typename Executor, typename Param, typename ExpectedResult>
-void test_query()
-{
- exec::bulk_guarantee_t result1 = asio::query(Executor(), Param());
- ASIO_CHECK(result1 == ExpectedResult());
-
- Executor ex1 = {};
- exec::bulk_guarantee_t result2 = asio::query(ex1, Param());
- ASIO_CHECK(result2 == ExpectedResult());
-
- const Executor ex2 = {};
- exec::bulk_guarantee_t result3 = asio::query(ex2, Param());
- ASIO_CHECK(result3 == ExpectedResult());
-}
-
-template <typename Executor, typename Param, typename ExpectedResult>
-void test_constexpr_query()
-{
-#if defined(ASIO_HAS_CONSTEXPR)
- constexpr Executor ex1 = {};
- constexpr exec::bulk_guarantee_t result1 = asio::query(ex1, Param());
- ASIO_CHECK(result1 == ExpectedResult());
-#endif // defined(ASIO_HAS_CONSTEXPR)
-}
-
-template <typename Executor, typename Param, bool ExpectedResult>
-void test_can_require()
-{
- ASIO_CONSTEXPR bool b1 =
- asio::can_require<Executor, Param>::value;
- ASIO_CHECK(b1 == ExpectedResult);
-
- ASIO_CONSTEXPR bool b2 =
- asio::can_require<const Executor, Param>::value;
- ASIO_CHECK(b2 == ExpectedResult);
-
- ASIO_CONSTEXPR bool b3 =
- asio::can_require<Executor&, Param>::value;
- ASIO_CHECK(b3 == ExpectedResult);
-
- ASIO_CONSTEXPR bool b4 =
- asio::can_require<const Executor&, Param>::value;
- ASIO_CHECK(b4 == ExpectedResult);
-}
-
-template <typename Executor, typename Param, typename ExpectedResult>
-void test_require()
-{
- ASIO_CHECK(
- asio::query(
- asio::require(Executor(), Param()),
- Param()) == ExpectedResult());
-
- Executor ex1 = {};
- ASIO_CHECK(
- asio::query(
- asio::require(ex1, Param()),
- Param()) == ExpectedResult());
-
- const Executor ex2 = {};
- ASIO_CHECK(
- asio::query(
- asio::require(ex2, Param()),
- Param()) == ExpectedResult());
-}
-
-template <typename Executor, typename Param, bool ExpectedResult>
-void test_can_prefer()
-{
- ASIO_CONSTEXPR bool b1 =
- asio::can_prefer<Executor, Param>::value;
- ASIO_CHECK(b1 == ExpectedResult);
-
- ASIO_CONSTEXPR bool b2 =
- asio::can_prefer<const Executor, Param>::value;
- ASIO_CHECK(b2 == ExpectedResult);
-
- ASIO_CONSTEXPR bool b3 =
- asio::can_prefer<Executor&, Param>::value;
- ASIO_CHECK(b3 == ExpectedResult);
-
- ASIO_CONSTEXPR bool b4 =
- asio::can_prefer<const Executor&, Param>::value;
- ASIO_CHECK(b4 == ExpectedResult);
-}
-
-template <typename Executor, typename Param, typename ExpectedResult>
-void test_prefer()
-{
- ASIO_CHECK(
- s(asio::query(
- asio::prefer(Executor(), Param()),
- s())) == s(ExpectedResult()));
-
- Executor ex1 = {};
- ASIO_CHECK(
- s(asio::query(
- asio::prefer(ex1, Param()),
- s())) == s(ExpectedResult()));
-
- const Executor ex2 = {};
- ASIO_CHECK(
- s(asio::query(
- asio::prefer(ex2, Param()),
- s())) == s(ExpectedResult()));
-}
-
-void test_vars()
-{
- ASIO_CHECK(s() == exec::bulk_guarantee);
- ASIO_CHECK(n1() == exec::bulk_guarantee.unsequenced);
- ASIO_CHECK(n2() == exec::bulk_guarantee.sequenced);
- ASIO_CHECK(n3() == exec::bulk_guarantee.parallel);
-}
-
-ASIO_TEST_SUITE
-(
- "bulk_guarantee",
-
- ASIO_TEST_CASE3(test_can_query<ex_nq_nr, s, true>)
- ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n1, true>)
- ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n2, false>)
- ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n3, false>)
-
- ASIO_TEST_CASE3(test_query<ex_nq_nr, s, n1>)
- ASIO_TEST_CASE3(test_query<ex_nq_nr, n1, n1>)
-
- ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, s, n1>)
- ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, n1, n1>)
-
- ASIO_TEST_CASE3(test_can_require<ex_nq_nr, s, false>)
- ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n1, true>)
- ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n2, false>)
- ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n3, false>)
-
- ASIO_TEST_CASE3(test_require<ex_nq_nr, n1, n1>)
-
- ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, s, false>)
- ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n1, true>)
- ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n2, true>)
- ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n3, true>)
-
- ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n1, n1>)
- ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n2, n1>)
- ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n3, n1>)
-
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, n3, true>)
-
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, n3, n3>)
-
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, s, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, s, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, s, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, s, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, s, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n3>, s, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, s, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, s, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n3>, s, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n1>, s, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n2>, s, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n3>, s, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, s, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, s, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, s, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, n3, n3>)
-
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, n3, true>)
-
- ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n1, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n2, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n3, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_require<ex_cq_nr<n1, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_require<ex_cq_nr<n2, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_require<ex_cq_nr<n3, s, n3>, n3, n3>)
-
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, n3, true>)
-
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n3, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n3, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n3, s, n3>, n3, n3>)
-
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, n3, true>)
-
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, n3, n3>)
-
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, n3, false>)
-
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, n3, true>)
-
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n3, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n3, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n3, s, n3>, n3, n3>)
-
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, s, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, n3, true>)
-
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, s, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, s, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, s, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, n3, n3>)
-
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n3, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, n1, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, n2, false>)
- ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, n3, false>)
-
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n3, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, s, false>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, n1, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, n2, true>)
- ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, n3, true>)
-
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n3>, n3, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n1, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n2, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n3, n1>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n1, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n2, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n3, n2>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n3, s, n3>, n1, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n3, s, n3>, n2, n3>)
- ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n3, s, n3>, n3, n3>)
-
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n2, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n3, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n3, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, n2, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n3, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n1, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n3, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, n1, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, n2, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, n1, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, n1, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, n2, false>)
- ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, n3, true>)
-
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, s, n1>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, s, n1>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, n1, n1>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n3>, s, n1>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n3>, n1, n1>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, s, n2>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, n2, n2>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, s, n2>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n3>, s, n2>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n3>, n2, n2>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n1>, s, n3>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n1>, n3, n3>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n2>, s, n3>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n2>, n3, n3>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n3>, s, n3>)
- ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n3>, n3, n3>)
-
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n2, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n3, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n3, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, n2, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n3, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n1, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n3, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, n1, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, n2, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, n1, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, n1, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, n2, false>)
- ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, n3, true>)
-
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n3>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n3>, n3, n3>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n3>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n3>, n3, n3>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n1>, n3, n3>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n2>, n3, n3>)
- ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n3>, n3, n3>)
-
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, n3, true>)
-
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n2, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n3, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n3, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n3>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n3>, n2, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n3>, n3, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n3, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n1, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n3, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n3>, n1, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n3>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n3>, n3, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n1>, n2, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n1>, n3, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n2>, n1, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n2>, n3, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n3>, n1, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n3>, n2, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n3>, n3, n3>)
-
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n2, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n3, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n3, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, n2, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n3, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n1, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n3, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, n1, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, n2, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, n1, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, s, true>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, n1, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, n2, false>)
- ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, n3, true>)
-
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, s, n1>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, s, n1>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, n1, n1>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n3>, s, n1>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n3>, n1, n1>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, s, n2>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, n2, n2>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, s, n2>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n3>, s, n2>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n3>, n2, n2>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n1>, s, n3>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n1>, n3, n3>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n2>, s, n3>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n2>, n3, n3>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n3>, s, n3>)
- ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n3>, n3, n3>)
-
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n2, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n3, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n3, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, n2, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n3, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n1, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n3, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, n1, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, n2, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, n1, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, n1, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, n2, false>)
- ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, n3, true>)
-
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n3>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n3>, n3, n3>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n3>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n3>, n3, n3>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n1>, n3, n3>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n2>, n3, n3>)
- ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n3>, n3, n3>)
-
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, n3, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, s, false>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, n1, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, n2, true>)
- ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, n3, true>)
-
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n2, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n3, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n3, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n3>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n3>, n2, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n3>, n3, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n3, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n1, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n3, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n3>, n1, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n3>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n3>, n3, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n1>, n1, n1>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n1>, n2, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n1>, n3, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n2>, n1, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n2>, n2, n2>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n2>, n3, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n3>, n1, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n3>, n2, n3>)
- ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n3>, n3, n3>)
-
- ASIO_TEST_CASE(test_vars)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/connect.cpp b/3rdparty/asio/src/tests/unit/execution/connect.cpp
deleted file mode 100644
index 1f32e77cbe8..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/connect.cpp
+++ /dev/null
@@ -1,481 +0,0 @@
-//
-// connect.cpp
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/connect.hpp"
-
-#include "asio/error_code.hpp"
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-static int call_count = 0;
-
-struct operation_state
-{
- void start() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <>
-struct start_member<operation_state>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct no_connect_1
-{
-};
-
-struct no_connect_2 : exec::sender_base
-{
-};
-
-struct no_connect_3
-{
- template <typename R>
- operation_state connect(ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- return operation_state();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename R>
-struct connect_member<no_connect_3, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-struct const_member_connect : exec::sender_base
-{
- const_member_connect()
- {
- }
-
- template <typename R>
- operation_state connect(ASIO_MOVE_ARG(R) r) const
- {
- (void)r;
- ++call_count;
- return operation_state();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename R>
-struct connect_member<const const_member_connect, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-struct free_connect_const_receiver : exec::sender_base
-{
- free_connect_const_receiver()
- {
- }
-
- template <typename R>
- friend operation_state connect(
- const free_connect_const_receiver&, ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- ++call_count;
- return operation_state();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename R>
-struct connect_free<const free_connect_const_receiver, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-struct non_const_member_connect : exec::sender_base
-{
- template <typename R>
- operation_state connect(ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- ++call_count;
- return operation_state();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename R>
-struct connect_member<non_const_member_connect, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-struct free_connect_non_const_receiver : exec::sender_base
-{
- free_connect_non_const_receiver()
- {
- }
-
- template <typename R>
- friend operation_state connect(
- free_connect_non_const_receiver&, ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- ++call_count;
- return operation_state();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename R>
-struct connect_free<free_connect_non_const_receiver, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-struct receiver
-{
- receiver()
- {
- }
-
- receiver(const receiver&)
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- receiver(receiver&&) ASIO_NOEXCEPT
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- (void)e;
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename E>
-struct set_error_member<receiver, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_done_member<receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct executor
-{
- executor()
- {
- }
-
- executor(const executor&) ASIO_NOEXCEPT
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- executor(executor&&) ASIO_NOEXCEPT
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const ASIO_NOEXCEPT
- {
- (void)f;
- }
-
- bool operator==(const executor&) const ASIO_NOEXCEPT
- {
- return true;
- }
-
- bool operator!=(const executor&) const ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-template <typename F>
-struct execute_member<executor, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-template <>
-struct equality_comparable<executor>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void test_can_connect()
-{
- ASIO_CONSTEXPR bool b1 = exec::can_connect<
- no_connect_1&, receiver>::value;
- ASIO_CHECK(b1 == false);
-
- ASIO_CONSTEXPR bool b2 = exec::can_connect<
- const no_connect_1&, receiver>::value;
- ASIO_CHECK(b2 == false);
-
- ASIO_CONSTEXPR bool b3 = exec::can_connect<
- no_connect_2&, receiver>::value;
- ASIO_CHECK(b3 == false);
-
- ASIO_CONSTEXPR bool b4 = exec::can_connect<
- const no_connect_2&, receiver>::value;
- ASIO_CHECK(b4 == false);
-
- ASIO_CONSTEXPR bool b5 = exec::can_connect<
- no_connect_3&, receiver>::value;
- ASIO_CHECK(b5 == false);
-
- ASIO_CONSTEXPR bool b6 = exec::can_connect<
- const no_connect_3&, receiver>::value;
- ASIO_CHECK(b6 == false);
-
- ASIO_CONSTEXPR bool b7 = exec::can_connect<
- const_member_connect&, receiver>::value;
- ASIO_CHECK(b7 == true);
-
- ASIO_CONSTEXPR bool b8 = exec::can_connect<
- const const_member_connect&, receiver>::value;
- ASIO_CHECK(b8 == true);
-
- ASIO_CONSTEXPR bool b9 = exec::can_connect<
- free_connect_const_receiver&, receiver>::value;
- ASIO_CHECK(b9 == true);
-
- ASIO_CONSTEXPR bool b10 = exec::can_connect<
- const free_connect_const_receiver&, receiver>::value;
- ASIO_CHECK(b10 == true);
-
- ASIO_CONSTEXPR bool b11 = exec::can_connect<
- non_const_member_connect&, receiver>::value;
- ASIO_CHECK(b11 == true);
-
- ASIO_CONSTEXPR bool b12 = exec::can_connect<
- const non_const_member_connect&, receiver>::value;
- ASIO_CHECK(b12 == false);
-
- ASIO_CONSTEXPR bool b13 = exec::can_connect<
- free_connect_non_const_receiver&, receiver>::value;
- ASIO_CHECK(b13 == true);
-
- ASIO_CONSTEXPR bool b14 = exec::can_connect<
- const free_connect_non_const_receiver&, receiver>::value;
- ASIO_CHECK(b14 == false);
-
- ASIO_CONSTEXPR bool b15 = exec::can_connect<
- executor&, receiver>::value;
- ASIO_CHECK(b15 == true);
-
- ASIO_CONSTEXPR bool b16 = exec::can_connect<
- const executor&, receiver>::value;
- ASIO_CHECK(b16 == true);
-}
-
-void increment(int* count)
-{
- ++(*count);
-}
-
-void test_connect()
-{
- receiver r;
-
- call_count = 0;
- const_member_connect s1;
- operation_state o1 = exec::connect(s1, r);
- ASIO_CHECK(call_count == 1);
- (void)o1;
-
- call_count = 0;
- const const_member_connect s2;
- operation_state o2 = exec::connect(s2, r);
- ASIO_CHECK(call_count == 1);
- (void)o2;
-
- call_count = 0;
- operation_state o3 = exec::connect(const_member_connect(), r);
- ASIO_CHECK(call_count == 1);
- (void)o3;
-
- call_count = 0;
- free_connect_const_receiver s3;
- operation_state o4 = exec::connect(s3, r);
- ASIO_CHECK(call_count == 1);
- (void)o4;
-
- call_count = 0;
- const free_connect_const_receiver s4;
- operation_state o5 = exec::connect(s4, r);
- ASIO_CHECK(call_count == 1);
- (void)o5;
-
- call_count = 0;
- operation_state o6 = exec::connect(free_connect_const_receiver(), r);
- ASIO_CHECK(call_count == 1);
- (void)o6;
-
- call_count = 0;
- non_const_member_connect s5;
- operation_state o7 = exec::connect(s5, r);
- ASIO_CHECK(call_count == 1);
- (void)o7;
-
- call_count = 0;
- free_connect_non_const_receiver s6;
- operation_state o8 = exec::connect(s6, r);
- ASIO_CHECK(call_count == 1);
- (void)o8;
-
- executor s7;
- exec::connect_result<executor&,
- receiver&>::type o9 = exec::connect(s7, r);
- ASIO_CHECK((
- exec::is_operation_state<
- exec::connect_result<executor&, receiver&>::type
- >::value));
- (void)o9;
-
- const executor s8;
- exec::connect_result<const executor&,
- receiver&>::type o10 = exec::connect(s8, r);
- (void)exec::connect(s8, r);
- ASIO_CHECK((
- exec::is_operation_state<
- exec::connect_result<const executor&, receiver&>::type
- >::value));
- (void)o10;
-}
-
-ASIO_TEST_SUITE
-(
- "connect",
- ASIO_TEST_CASE(test_can_connect)
- ASIO_TEST_CASE(test_connect)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/context_as.cpp b/3rdparty/asio/src/tests/unit/execution/context_as.cpp
index d2bd956c1c9..13311ba262b 100644
--- a/3rdparty/asio/src/tests/unit/execution/context_as.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/context_as.cpp
@@ -2,7 +2,7 @@
// context_as.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,24 +16,14 @@
// Test that header file is self-contained.
#include "asio/execution/context_as.hpp"
+#include <functional>
#include "asio/execution/any_executor.hpp"
#include "asio/io_context.hpp"
#include "asio/static_thread_pool.hpp"
#include "../unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
void context_as_executor_query_test()
{
diff --git a/3rdparty/asio/src/tests/unit/execution/execute.cpp b/3rdparty/asio/src/tests/unit/execution/execute.cpp
deleted file mode 100644
index 409233ed0e6..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/execute.cpp
+++ /dev/null
@@ -1,388 +0,0 @@
-//
-// execute.cpp
-// ~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/execute.hpp"
-#include "asio/execution/sender.hpp"
-#include "asio/execution/submit.hpp"
-
-#include "asio/execution/invocable_archetype.hpp"
-#include "../unit_test.hpp"
-
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
-namespace exec = asio::execution;
-
-struct no_execute
-{
-};
-
-struct const_member_execute
-{
- template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const
- {
- typename asio::decay<F>::type tmp(ASIO_MOVE_CAST(F)(f));
- tmp();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename F>
-struct execute_member<const_member_execute, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-struct free_execute_const_executor
-{
- template <typename F>
- friend void execute(const free_execute_const_executor&,
- ASIO_MOVE_ARG(F) f)
- {
- typename asio::decay<F>::type tmp(ASIO_MOVE_CAST(F)(f));
- tmp();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename F>
-struct execute_free<free_execute_const_executor, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT)
-
-#if defined(ASIO_HAS_MOVE)
-
-// Support for rvalue references is required in order to use the execute
-// customisation point with non-const member functions and free functions
-// taking non-const arguments.
-
-struct non_const_member_execute
-{
- template <typename F>
- void execute(ASIO_MOVE_ARG(F) f)
- {
- typename asio::decay<F>::type tmp(ASIO_MOVE_CAST(F)(f));
- tmp();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename F>
-struct execute_member<non_const_member_execute, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename F>
-struct execute_member<const non_const_member_execute, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename F>
-struct execute_member<const non_const_member_execute&, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-struct free_execute_non_const_executor
-{
- template <typename F>
- friend void execute(free_execute_non_const_executor&,
- ASIO_MOVE_ARG(F) f)
- {
- typename asio::decay<F>::type tmp(ASIO_MOVE_CAST(F)(f));
- tmp();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename F>
-struct execute_free<free_execute_non_const_executor, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename F>
-struct execute_free<const free_execute_non_const_executor, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-template <typename F>
-struct execute_free<const free_execute_non_const_executor&, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = false);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_FREE_TRAIT)
-
-#endif // defined(ASIO_HAS_MOVE)
-
-struct operation_state
-{
- void start() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <>
-struct start_member<operation_state>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct sender : exec::sender_base
-{
- sender()
- {
- }
-
- template <typename R>
- operation_state connect(ASIO_MOVE_ARG(R) r) const
- {
- (void)r;
- return operation_state();
- }
-
- template <typename R>
- void submit(ASIO_MOVE_ARG(R) r) const
- {
- exec::set_value(ASIO_MOVE_CAST(R)(r));
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename R>
-struct connect_member<const sender, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-template <typename R>
-struct submit_member<const sender, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void test_can_execute()
-{
- ASIO_CONSTEXPR bool b1 = exec::can_execute<
- no_execute&, exec::invocable_archetype>::value;
- ASIO_CHECK(b1 == false);
-
- ASIO_CONSTEXPR bool b2 = exec::can_execute<
- const no_execute&, exec::invocable_archetype>::value;
- ASIO_CHECK(b2 == false);
-
- ASIO_CONSTEXPR bool b3 = exec::can_execute<
- const_member_execute&, exec::invocable_archetype>::value;
- ASIO_CHECK(b3 == true);
-
- ASIO_CONSTEXPR bool b4 = exec::can_execute<
- const const_member_execute&, exec::invocable_archetype>::value;
- ASIO_CHECK(b4 == true);
-
- ASIO_CONSTEXPR bool b5 = exec::can_execute<
- free_execute_const_executor&, exec::invocable_archetype>::value;
- ASIO_CHECK(b5 == true);
-
- ASIO_CONSTEXPR bool b6 = exec::can_execute<
- const free_execute_const_executor&, exec::invocable_archetype>::value;
- ASIO_CHECK(b6 == true);
-
-#if defined(ASIO_HAS_MOVE)
- ASIO_CONSTEXPR bool b7 = exec::can_execute<
- non_const_member_execute&, exec::invocable_archetype>::value;
- ASIO_CHECK(b7 == true);
-
- ASIO_CONSTEXPR bool b8 = exec::can_execute<
- const non_const_member_execute&, exec::invocable_archetype>::value;
- ASIO_CHECK(b8 == false);
-
- ASIO_CONSTEXPR bool b9 = exec::can_execute<
- free_execute_non_const_executor&, exec::invocable_archetype>::value;
- ASIO_CHECK(b9 == true);
-
- ASIO_CONSTEXPR bool b10 = exec::can_execute<
- const free_execute_non_const_executor&, exec::invocable_archetype>::value;
- ASIO_CHECK(b10 == false);
-#endif // defined(ASIO_HAS_MOVE)
-
- ASIO_CONSTEXPR bool b11 = exec::can_execute<
- sender&, exec::invocable_archetype>::value;
- ASIO_CHECK(b11 == true);
-
- ASIO_CONSTEXPR bool b12 = exec::can_execute<
- const sender&, exec::invocable_archetype>::value;
- ASIO_CHECK(b12 == true);
-}
-
-void increment(int* count)
-{
- ++(*count);
-}
-
-void test_execute()
-{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
- int count = 0;
- const_member_execute ex1 = {};
- exec::execute(ex1, bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- const const_member_execute ex2 = {};
- exec::execute(ex2, bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- exec::execute(const_member_execute(), bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- free_execute_const_executor ex3 = {};
- exec::execute(ex3, bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- const free_execute_const_executor ex4 = {};
- exec::execute(ex4, bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- exec::execute(free_execute_const_executor(),
- bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-
-#if defined(ASIO_HAS_MOVE)
- count = 0;
- non_const_member_execute ex5 = {};
- exec::execute(ex5, bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- free_execute_non_const_executor ex6 = {};
- exec::execute(ex6, bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-#endif // defined(ASIO_HAS_MOVE)
-
- count = 0;
- sender ex7;
- exec::execute(ex3, bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- const sender ex8;
- exec::execute(ex4, bindns::bind(&increment, &count));
- ASIO_CHECK(count == 1);
-}
-
-ASIO_TEST_SUITE
-(
- "blocking",
- ASIO_TEST_CASE(test_can_execute)
- ASIO_TEST_CASE(test_execute)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/executor.cpp b/3rdparty/asio/src/tests/unit/execution/executor.cpp
index 497c5835684..8b02622bdca 100644
--- a/3rdparty/asio/src/tests/unit/execution/executor.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/executor.cpp
@@ -2,7 +2,7 @@
// executor.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -28,28 +28,26 @@ struct executor
{
}
- executor(const executor&) ASIO_NOEXCEPT
+ executor(const executor&) noexcept
{
}
-#if defined(ASIO_HAS_MOVE)
- executor(executor&&) ASIO_NOEXCEPT
+ executor(executor&&) noexcept
{
}
-#endif // defined(ASIO_HAS_MOVE)
template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const ASIO_NOEXCEPT
+ void execute(F&& f) const noexcept
{
(void)f;
}
- bool operator==(const executor&) const ASIO_NOEXCEPT
+ bool operator==(const executor&) const noexcept
{
return true;
}
- bool operator!=(const executor&) const ASIO_NOEXCEPT
+ bool operator!=(const executor&) const noexcept
{
return false;
}
@@ -63,8 +61,8 @@ namespace traits {
template <typename F>
struct execute_member<executor, F>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef void result_type;
};
@@ -74,8 +72,8 @@ struct execute_member<executor, F>
template <>
struct equality_comparable<executor>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -101,84 +99,8 @@ void is_executor_test()
>::value));
}
-void is_executor_of_test()
-{
- ASIO_CHECK((
- !asio::execution::is_executor_of<
- void,
- void(*)()
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_executor_of<
- not_an_executor,
- void(*)()
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_executor_of<
- executor,
- void(*)()
- >::value));
-}
-
-struct executor_with_other_shape_type
-{
- typedef double shape_type;
-};
-
-void executor_shape_test()
-{
- ASIO_CHECK((
- asio::is_same<
- asio::execution::executor_shape<executor>::type,
- std::size_t
- >::value));
-
- ASIO_CHECK((
- asio::is_same<
- asio::execution::executor_shape<
- executor_with_other_shape_type
- >::type,
- double
- >::value));
-}
-
-struct executor_with_other_index_type
-{
- typedef unsigned char index_type;
-};
-
-void executor_index_test()
-{
- ASIO_CHECK((
- asio::is_same<
- asio::execution::executor_index<executor>::type,
- std::size_t
- >::value));
-
- ASIO_CHECK((
- asio::is_same<
- asio::execution::executor_index<
- executor_with_other_shape_type
- >::type,
- double
- >::value));
-
- ASIO_CHECK((
- asio::is_same<
- asio::execution::executor_index<
- executor_with_other_index_type
- >::type,
- unsigned char
- >::value));
-}
-
ASIO_TEST_SUITE
(
"executor",
ASIO_TEST_CASE(is_executor_test)
- ASIO_TEST_CASE(is_executor_of_test)
- ASIO_TEST_CASE(executor_shape_test)
- ASIO_TEST_CASE(executor_index_test)
)
diff --git a/3rdparty/asio/src/tests/unit/execution/invocable_archetype.cpp b/3rdparty/asio/src/tests/unit/execution/invocable_archetype.cpp
index 7ef66d9cdd2..5dbfb94d9f4 100644
--- a/3rdparty/asio/src/tests/unit/execution/invocable_archetype.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/invocable_archetype.cpp
@@ -2,7 +2,7 @@
// invocable_archetype.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/execution/mapping.cpp b/3rdparty/asio/src/tests/unit/execution/mapping.cpp
index ca2deefe0ad..399aae3ea90 100644
--- a/3rdparty/asio/src/tests/unit/execution/mapping.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/mapping.cpp
@@ -2,7 +2,7 @@
// mapping.cpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -35,12 +35,12 @@ struct ex_nq_nr
{
}
- friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
@@ -64,7 +64,7 @@ struct is_executor<ex_nq_nr> : asio::true_type
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
- static ASIO_CONSTEXPR ResultType query(ParamType) ASIO_NOEXCEPT
+ static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
@@ -74,12 +74,12 @@ struct ex_cq_nr
{
}
- friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
@@ -114,12 +114,12 @@ struct query_static_constexpr_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return Result();
}
@@ -133,7 +133,7 @@ struct query_static_constexpr_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
- ResultType query(ParamType) const ASIO_NOEXCEPT
+ ResultType query(ParamType) const noexcept
{
return Result();
}
@@ -143,12 +143,12 @@ struct ex_mq_nr
{
}
- friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
@@ -183,8 +183,8 @@ struct query_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -197,7 +197,7 @@ struct query_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
- friend ResultType query(const ex_fq_nr&, ParamType) ASIO_NOEXCEPT
+ friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
@@ -207,12 +207,12 @@ struct ex_fq_nr
{
}
- friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
@@ -247,8 +247,8 @@ struct query_free<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -261,24 +261,24 @@ struct query_free<
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
- CurrentType query(OtherType) const ASIO_NOEXCEPT
+ CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
- OtherType) const ASIO_NOEXCEPT
+ OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
@@ -288,12 +288,12 @@ struct ex_mq_mr
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -302,13 +302,13 @@ struct ex_mq_mr
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
@@ -318,12 +318,12 @@ struct ex_mq_mr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -358,8 +358,8 @@ struct query_member<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -375,8 +375,8 @@ struct require_member<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
@@ -389,8 +389,8 @@ struct require_member<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
@@ -403,36 +403,36 @@ struct require_member<
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
- friend CurrentType query(const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
@@ -442,12 +442,12 @@ struct ex_fq_fr
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -456,19 +456,19 @@ struct ex_fq_fr
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
@@ -478,12 +478,12 @@ struct ex_fq_fr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -518,8 +518,8 @@ struct query_free<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -535,8 +535,8 @@ struct require_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -549,8 +549,8 @@ struct require_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -566,8 +566,8 @@ struct prefer_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -580,8 +580,8 @@ struct prefer_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -594,19 +594,19 @@ struct prefer_free<
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -629,29 +629,27 @@ void test_query()
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
-#if defined(ASIO_HAS_CONSTEXPR)
constexpr Executor ex1 = {};
constexpr exec::mapping_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
-#endif // defined(ASIO_HAS_CONSTEXPR)
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -680,19 +678,19 @@ void test_require()
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -721,9 +719,18 @@ void test_prefer()
void test_vars()
{
ASIO_CHECK(s() == exec::mapping);
+ ASIO_CHECK(s() != exec::mapping.thread);
+ ASIO_CHECK(s() != exec::mapping.new_thread);
+ ASIO_CHECK(s() != exec::mapping.other);
ASIO_CHECK(n1() == exec::mapping.thread);
+ ASIO_CHECK(n1() != exec::mapping.new_thread);
+ ASIO_CHECK(n1() != exec::mapping.other);
ASIO_CHECK(n2() == exec::mapping.new_thread);
+ ASIO_CHECK(n2() != exec::mapping.thread);
+ ASIO_CHECK(n2() != exec::mapping.other);
ASIO_CHECK(n3() == exec::mapping.other);
+ ASIO_CHECK(n3() != exec::mapping.thread);
+ ASIO_CHECK(n3() != exec::mapping.new_thread);
}
ASIO_TEST_SUITE
diff --git a/3rdparty/asio/src/tests/unit/execution/operation_state.cpp b/3rdparty/asio/src/tests/unit/execution/operation_state.cpp
deleted file mode 100644
index d492816a158..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/operation_state.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// operation_state.cpp
-// ~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/operation_state.hpp"
-
-#include <string>
-#include "asio/error_code.hpp"
-#include "../unit_test.hpp"
-
-struct not_an_operation_state_1
-{
-};
-
-struct not_an_operation_state_2
-{
- void start()
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <>
-struct start_member<not_an_operation_state_2>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct operation_state
-{
- void start() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <>
-struct start_member<operation_state>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void is_operation_state_test()
-{
- ASIO_CHECK((
- !asio::execution::is_operation_state<
- void
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_operation_state<
- not_an_operation_state_1
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_operation_state<
- not_an_operation_state_2
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_operation_state<
- operation_state
- >::value));
-}
-
-ASIO_TEST_SUITE
-(
- "operation_state",
- ASIO_TEST_CASE(is_operation_state_test)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/outstanding_work.cpp b/3rdparty/asio/src/tests/unit/execution/outstanding_work.cpp
index 3546a6b1d6a..cddd0b52c23 100644
--- a/3rdparty/asio/src/tests/unit/execution/outstanding_work.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/outstanding_work.cpp
@@ -2,7 +2,7 @@
// outstanding_work.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -34,12 +34,12 @@ struct ex_nq_nr
{
}
- friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
@@ -63,7 +63,7 @@ struct is_executor<ex_nq_nr> : asio::true_type
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
- static ASIO_CONSTEXPR ResultType query(ParamType) ASIO_NOEXCEPT
+ static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
@@ -73,12 +73,12 @@ struct ex_cq_nr
{
}
- friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
@@ -113,12 +113,12 @@ struct query_static_constexpr_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return Result();
}
@@ -132,7 +132,7 @@ struct query_static_constexpr_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
- ResultType query(ParamType) const ASIO_NOEXCEPT
+ ResultType query(ParamType) const noexcept
{
return Result();
}
@@ -142,12 +142,12 @@ struct ex_mq_nr
{
}
- friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
@@ -182,8 +182,8 @@ struct query_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -196,7 +196,7 @@ struct query_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
- friend ResultType query(const ex_fq_nr&, ParamType) ASIO_NOEXCEPT
+ friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
@@ -206,12 +206,12 @@ struct ex_fq_nr
{
}
- friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
@@ -246,8 +246,8 @@ struct query_free<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -260,24 +260,24 @@ struct query_free<
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
- CurrentType query(OtherType) const ASIO_NOEXCEPT
+ CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
- OtherType) const ASIO_NOEXCEPT
+ OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
@@ -287,12 +287,12 @@ struct ex_mq_mr
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -301,13 +301,13 @@ struct ex_mq_mr
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
@@ -317,12 +317,12 @@ struct ex_mq_mr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -357,8 +357,8 @@ struct query_member<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -374,8 +374,8 @@ struct require_member<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
@@ -388,8 +388,8 @@ struct require_member<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
@@ -402,36 +402,36 @@ struct require_member<
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
- friend CurrentType query(const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
@@ -441,12 +441,12 @@ struct ex_fq_fr
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -455,19 +455,19 @@ struct ex_fq_fr
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
@@ -477,12 +477,12 @@ struct ex_fq_fr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -517,8 +517,8 @@ struct query_free<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -534,8 +534,8 @@ struct require_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -548,8 +548,8 @@ struct require_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -565,8 +565,8 @@ struct prefer_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -579,8 +579,8 @@ struct prefer_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -593,19 +593,19 @@ struct prefer_free<
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -628,29 +628,27 @@ void test_query()
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
-#if defined(ASIO_HAS_CONSTEXPR)
constexpr Executor ex1 = {};
constexpr exec::outstanding_work_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
-#endif // defined(ASIO_HAS_CONSTEXPR)
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -679,19 +677,19 @@ void test_require()
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -720,8 +718,12 @@ void test_prefer()
void test_vars()
{
ASIO_CHECK(s() == exec::outstanding_work);
+ ASIO_CHECK(s() != exec::outstanding_work.untracked);
+ ASIO_CHECK(s() != exec::outstanding_work.tracked);
ASIO_CHECK(n1() == exec::outstanding_work.untracked);
+ ASIO_CHECK(n1() != exec::outstanding_work.tracked);
ASIO_CHECK(n2() == exec::outstanding_work.tracked);
+ ASIO_CHECK(n2() != exec::outstanding_work.untracked);
}
ASIO_TEST_SUITE
diff --git a/3rdparty/asio/src/tests/unit/execution/prefer_only.cpp b/3rdparty/asio/src/tests/unit/execution/prefer_only.cpp
index d7467d81114..60500002475 100644
--- a/3rdparty/asio/src/tests/unit/execution/prefer_only.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/prefer_only.cpp
@@ -2,7 +2,7 @@
// prefer_only.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,22 +16,12 @@
// Test that header file is self-contained.
#include "asio/execution/prefer_only.hpp"
+#include <functional>
#include "asio/execution/any_executor.hpp"
#include "../unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
static int possibly_blocking_count = 0;
static int never_blocking_count = 0;
@@ -45,13 +35,13 @@ struct possibly_blocking_executor
}
friend bool operator==(const possibly_blocking_executor&,
- const possibly_blocking_executor&) ASIO_NOEXCEPT
+ const possibly_blocking_executor&) noexcept
{
return true;
}
friend bool operator!=(const possibly_blocking_executor&,
- const possibly_blocking_executor&) ASIO_NOEXCEPT
+ const possibly_blocking_executor&) noexcept
{
return false;
}
@@ -65,8 +55,8 @@ namespace traits {
template <typename F>
struct execute_member<possibly_blocking_executor, F>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef void result_type;
};
@@ -77,8 +67,8 @@ struct execute_member<possibly_blocking_executor, F>
template <>
struct equality_comparable<possibly_blocking_executor>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -88,8 +78,8 @@ struct equality_comparable<possibly_blocking_executor>
struct never_blocking_executor
{
- static ASIO_CONSTEXPR execution::blocking_t::never_t
- query(execution::blocking_t) ASIO_NOEXCEPT
+ static constexpr execution::blocking_t::never_t
+ query(execution::blocking_t) noexcept
{
return execution::blocking_t::never_t();
}
@@ -101,13 +91,13 @@ struct never_blocking_executor
}
friend bool operator==(const never_blocking_executor&,
- const never_blocking_executor&) ASIO_NOEXCEPT
+ const never_blocking_executor&) noexcept
{
return true;
}
friend bool operator!=(const never_blocking_executor&,
- const never_blocking_executor&) ASIO_NOEXCEPT
+ const never_blocking_executor&) noexcept
{
return false;
}
@@ -121,8 +111,8 @@ namespace traits {
template <typename F>
struct execute_member<never_blocking_executor, F>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef void result_type;
};
@@ -133,8 +123,8 @@ struct execute_member<never_blocking_executor, F>
template <>
struct equality_comparable<never_blocking_executor>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -148,12 +138,12 @@ struct query_static_constexpr_member<
asio::is_convertible<Param, execution::blocking_t>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_t::never_t result_type;
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return result_type();
}
@@ -173,7 +163,7 @@ struct either_blocking_executor
{
}
- execution::blocking_t query(execution::blocking_t) const ASIO_NOEXCEPT
+ execution::blocking_t query(execution::blocking_t) const noexcept
{
return blocking_;
}
@@ -198,13 +188,13 @@ struct either_blocking_executor
}
friend bool operator==(const either_blocking_executor& a,
- const either_blocking_executor& b) ASIO_NOEXCEPT
+ const either_blocking_executor& b) noexcept
{
return a.blocking_ == b.blocking_;
}
friend bool operator!=(const either_blocking_executor& a,
- const either_blocking_executor& b) ASIO_NOEXCEPT
+ const either_blocking_executor& b) noexcept
{
return a.blocking_ != b.blocking_;
}
@@ -218,8 +208,8 @@ namespace traits {
template <typename F>
struct execute_member<either_blocking_executor, F>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef void result_type;
};
@@ -230,8 +220,8 @@ struct execute_member<either_blocking_executor, F>
template <>
struct equality_comparable<either_blocking_executor>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -245,8 +235,8 @@ struct query_member<
asio::is_convertible<Param, execution::blocking_t>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef execution::blocking_t result_type;
};
@@ -262,8 +252,8 @@ struct require_member<
asio::is_convertible<Param, execution::blocking_t>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = false;
typedef either_blocking_executor result_type;
};
@@ -464,73 +454,73 @@ void prefer_only_executor_execute_test()
executor_type ex1 = possibly_blocking_executor();
- execution::execute(ex1, &do_nothing);
+ ex1.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 1);
ASIO_CHECK(never_blocking_count == 0);
executor_type ex2 = asio::prefer(ex1, execution::blocking.possibly);
- execution::execute(ex2, &do_nothing);
+ ex2.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 2);
ASIO_CHECK(never_blocking_count == 0);
executor_type ex3 = asio::prefer(ex1, execution::blocking.never);
- execution::execute(ex3, &do_nothing);
+ ex3.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 3);
ASIO_CHECK(never_blocking_count == 0);
executor_type ex4 = never_blocking_executor();
- execution::execute(ex4, &do_nothing);
+ ex4.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 3);
ASIO_CHECK(never_blocking_count == 1);
executor_type ex5 = asio::prefer(ex4, execution::blocking.possibly);
- execution::execute(ex5, &do_nothing);
+ ex5.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 3);
ASIO_CHECK(never_blocking_count == 2);
executor_type ex6 = asio::prefer(ex4, execution::blocking.never);
- execution::execute(ex6, &do_nothing);
+ ex6.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 3);
ASIO_CHECK(never_blocking_count == 3);
executor_type ex7 = either_blocking_executor(execution::blocking.possibly);
- execution::execute(ex7, &do_nothing);
+ ex7.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 4);
ASIO_CHECK(never_blocking_count == 3);
executor_type ex8 = asio::prefer(ex7, execution::blocking.possibly);
- execution::execute(ex8, &do_nothing);
+ ex8.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 5);
ASIO_CHECK(never_blocking_count == 3);
executor_type ex9 = asio::prefer(ex7, execution::blocking.never);
- execution::execute(ex9, &do_nothing);
+ ex9.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 5);
ASIO_CHECK(never_blocking_count == 4);
executor_type ex10 = either_blocking_executor(execution::blocking.never);
- execution::execute(ex10, &do_nothing);
+ ex10.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 5);
ASIO_CHECK(never_blocking_count == 5);
executor_type ex11 = asio::prefer(ex7, execution::blocking.possibly);
- execution::execute(ex11, &do_nothing);
+ ex11.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 6);
ASIO_CHECK(never_blocking_count == 5);
executor_type ex12 = asio::prefer(ex7, execution::blocking.never);
- execution::execute(ex12, &do_nothing);
+ ex12.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 6);
ASIO_CHECK(never_blocking_count == 6);
}
diff --git a/3rdparty/asio/src/tests/unit/execution/receiver.cpp b/3rdparty/asio/src/tests/unit/execution/receiver.cpp
deleted file mode 100644
index ec373866e80..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/receiver.cpp
+++ /dev/null
@@ -1,549 +0,0 @@
-//
-// receiver.cpp
-// ~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/receiver.hpp"
-
-#include <string>
-#include "asio/error_code.hpp"
-#include "../unit_test.hpp"
-
-struct not_a_receiver
-{
-};
-
-struct receiver
-{
- receiver()
- {
- }
-
- receiver(const receiver&)
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- receiver(receiver&&)
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- (void)e;
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename E>
-struct set_error_member<receiver, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_done_member<receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct receiver_of_0
-{
- receiver_of_0()
- {
- }
-
- receiver_of_0(const receiver_of_0&)
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- receiver_of_0(receiver_of_0&&)
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- (void)e;
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-
- void set_value()
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename E>
-struct set_error_member<receiver_of_0, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_done_member<receiver_of_0>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_value_member<receiver_of_0, void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct receiver_of_1
-{
- receiver_of_1()
- {
- }
-
- receiver_of_1(const receiver_of_1&)
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- receiver_of_1(receiver_of_1&&)
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- (void)e;
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-
- void set_value(int) ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename E>
-struct set_error_member<receiver_of_1, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_done_member<receiver_of_1>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_value_member<receiver_of_1, void(int)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct receiver_of_2
-{
- receiver_of_2()
- {
- }
-
- receiver_of_2(const receiver_of_2&)
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- receiver_of_2(receiver_of_2&&)
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- (void)e;
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-
- void set_value(int, std::string)
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename E>
-struct set_error_member<receiver_of_2, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_done_member<receiver_of_2>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_value_member<receiver_of_2, void(int, std::string)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void is_receiver_test()
-{
- ASIO_CHECK((
- !asio::execution::is_receiver<
- void,
- asio::error_code
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver<
- not_a_receiver,
- asio::error_code
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_receiver<
- receiver,
- asio::error_code
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_receiver<
- receiver_of_0,
- asio::error_code
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_receiver<
- receiver_of_1,
- asio::error_code
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_receiver<
- receiver_of_2,
- asio::error_code
- >::value));
-}
-
-void is_receiver_of_test()
-{
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- void
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- void,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- not_a_receiver
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- not_a_receiver,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- not_a_receiver,
- int,
- std::string
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- receiver
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- receiver,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- receiver,
- int,
- std::string
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_receiver_of<
- receiver_of_0
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- receiver_of_0,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- receiver_of_0,
- int,
- std::string
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- receiver_of_1
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_receiver_of<
- receiver_of_1,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- receiver_of_1,
- int,
- std::string
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- receiver_of_2
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_receiver_of<
- receiver_of_2,
- int
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_receiver_of<
- receiver_of_2,
- int,
- std::string
- >::value));
-}
-
-void is_nothrow_receiver_of_test()
-{
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- void
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- void,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- not_a_receiver
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- not_a_receiver,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- not_a_receiver,
- int,
- std::string
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver,
- int,
- std::string
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver_of_0
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver_of_0,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver_of_0,
- int,
- std::string
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver_of_1
- >::value));
-
- ASIO_CHECK((
- asio::execution::is_nothrow_receiver_of<
- receiver_of_1,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver_of_1,
- int,
- std::string
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver_of_2
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver_of_2,
- int
- >::value));
-
- ASIO_CHECK((
- !asio::execution::is_nothrow_receiver_of<
- receiver_of_2,
- int,
- std::string
- >::value));
-}
-
-ASIO_TEST_SUITE
-(
- "receiver",
- ASIO_TEST_CASE(is_receiver_test)
- ASIO_TEST_CASE(is_receiver_of_test)
- ASIO_TEST_CASE(is_nothrow_receiver_of_test)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/relationship.cpp b/3rdparty/asio/src/tests/unit/execution/relationship.cpp
index 3c3f2c3900e..a91144e8125 100644
--- a/3rdparty/asio/src/tests/unit/execution/relationship.cpp
+++ b/3rdparty/asio/src/tests/unit/execution/relationship.cpp
@@ -2,7 +2,7 @@
// relationship.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -34,12 +34,12 @@ struct ex_nq_nr
{
}
- friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
@@ -63,7 +63,7 @@ struct is_executor<ex_nq_nr> : asio::true_type
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
- static ASIO_CONSTEXPR ResultType query(ParamType) ASIO_NOEXCEPT
+ static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
@@ -73,12 +73,12 @@ struct ex_cq_nr
{
}
- friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
@@ -113,12 +113,12 @@ struct query_static_constexpr_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
- static ASIO_CONSTEXPR result_type value()
+ static constexpr result_type value()
{
return Result();
}
@@ -132,7 +132,7 @@ struct query_static_constexpr_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
- ResultType query(ParamType) const ASIO_NOEXCEPT
+ ResultType query(ParamType) const noexcept
{
return Result();
}
@@ -142,12 +142,12 @@ struct ex_mq_nr
{
}
- friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
@@ -182,8 +182,8 @@ struct query_member<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -196,7 +196,7 @@ struct query_member<
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
- friend ResultType query(const ex_fq_nr&, ParamType) ASIO_NOEXCEPT
+ friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
@@ -206,12 +206,12 @@ struct ex_fq_nr
{
}
- friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
@@ -246,8 +246,8 @@ struct query_free<
asio::is_convertible<Param, ParamType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
@@ -260,24 +260,24 @@ struct query_free<
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
- CurrentType query(OtherType) const ASIO_NOEXCEPT
+ CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
- OtherType) const ASIO_NOEXCEPT
+ OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
@@ -287,12 +287,12 @@ struct ex_mq_mr
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -301,13 +301,13 @@ struct ex_mq_mr
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
- CurrentType query(CurrentType) const ASIO_NOEXCEPT
+ CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
- CurrentType) const ASIO_NOEXCEPT
+ CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
@@ -317,12 +317,12 @@ struct ex_mq_mr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
@@ -357,8 +357,8 @@ struct query_member<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -374,8 +374,8 @@ struct require_member<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
@@ -388,8 +388,8 @@ struct require_member<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
@@ -402,36 +402,36 @@ struct require_member<
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
- friend CurrentType query(const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
- const ex_fq_fr&, OtherType) ASIO_NOEXCEPT
+ const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
@@ -441,12 +441,12 @@ struct ex_fq_fr
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -455,19 +455,19 @@ struct ex_fq_fr
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
- friend CurrentType query(const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
- const ex_fq_fr&, CurrentType) ASIO_NOEXCEPT
+ const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
@@ -477,12 +477,12 @@ struct ex_fq_fr<CurrentType, CurrentType>
{
}
- friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
- friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) ASIO_NOEXCEPT
+ friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
@@ -517,8 +517,8 @@ struct query_free<
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
@@ -534,8 +534,8 @@ struct require_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -548,8 +548,8 @@ struct require_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -565,8 +565,8 @@ struct prefer_free<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
@@ -579,8 +579,8 @@ struct prefer_free<
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
+ static constexpr bool is_valid = true;
+ static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
@@ -593,19 +593,19 @@ struct prefer_free<
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -628,29 +628,27 @@ void test_query()
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
-#if defined(ASIO_HAS_CONSTEXPR)
constexpr Executor ex1 = {};
constexpr exec::relationship_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
-#endif // defined(ASIO_HAS_CONSTEXPR)
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -679,19 +677,19 @@ void test_require()
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
- ASIO_CONSTEXPR bool b1 =
+ constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
- ASIO_CONSTEXPR bool b2 =
+ constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
- ASIO_CONSTEXPR bool b3 =
+ constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
- ASIO_CONSTEXPR bool b4 =
+ constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
@@ -720,8 +718,12 @@ void test_prefer()
void test_vars()
{
ASIO_CHECK(s() == exec::relationship);
+ ASIO_CHECK(s() != exec::relationship.fork);
+ ASIO_CHECK(s() != exec::relationship.continuation);
ASIO_CHECK(n1() == exec::relationship.fork);
+ ASIO_CHECK(n1() != exec::relationship.continuation);
ASIO_CHECK(n2() == exec::relationship.continuation);
+ ASIO_CHECK(n2() != exec::relationship.fork);
}
ASIO_TEST_SUITE
diff --git a/3rdparty/asio/src/tests/unit/execution/schedule.cpp b/3rdparty/asio/src/tests/unit/execution/schedule.cpp
deleted file mode 100644
index a18b9520c2e..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/schedule.cpp
+++ /dev/null
@@ -1,490 +0,0 @@
-//
-// schedule.cpp
-// ~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/schedule.hpp"
-
-#include "asio/error_code.hpp"
-#include "asio/execution/sender.hpp"
-#include "asio/execution/submit.hpp"
-#include "asio/traits/connect_member.hpp"
-#include "asio/traits/start_member.hpp"
-#include "asio/traits/submit_member.hpp"
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-struct operation_state
-{
- void start() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <>
-struct start_member<operation_state>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct sender : exec::sender_base
-{
- sender()
- {
- }
-
- template <typename R>
- operation_state connect(ASIO_MOVE_ARG(R) r) const
- {
- (void)r;
- return operation_state();
- }
-
- template <typename R>
- void submit(ASIO_MOVE_ARG(R) r) const
- {
- typename asio::decay<R>::type tmp(ASIO_MOVE_CAST(R)(r));
- exec::set_value(tmp);
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename R>
-struct connect_member<const sender, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-template <typename R>
-struct submit_member<const sender, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct no_schedule
-{
-};
-
-struct const_member_schedule
-{
- sender schedule() const ASIO_NOEXCEPT
- {
- return sender();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct schedule_member<const const_member_schedule>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef sender result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT)
-
-struct free_schedule_const_receiver
-{
- friend sender schedule(
- const free_schedule_const_receiver&) ASIO_NOEXCEPT
- {
- return sender();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SCHEDULE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct schedule_free<const free_schedule_const_receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef sender result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SCHEDULE_FREE_TRAIT)
-
-struct non_const_member_schedule
-{
- sender schedule() ASIO_NOEXCEPT
- {
- return sender();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct schedule_member<non_const_member_schedule>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef sender result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SCHEDULE_MEMBER_TRAIT)
-
-struct free_schedule_non_const_receiver
-{
- friend sender schedule(
- free_schedule_non_const_receiver&) ASIO_NOEXCEPT
- {
- return sender();
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SCHEDULE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct schedule_free<free_schedule_non_const_receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef sender result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SCHEDULE_FREE_TRAIT)
-
-struct executor
-{
- executor()
- {
- }
-
- executor(const executor&) ASIO_NOEXCEPT
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- executor(executor&&) ASIO_NOEXCEPT
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const ASIO_NOEXCEPT
- {
- typename asio::decay<F>::type tmp(ASIO_MOVE_CAST(F)(f));
- tmp();
- }
-
- bool operator==(const executor&) const ASIO_NOEXCEPT
- {
- return true;
- }
-
- bool operator!=(const executor&) const ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-template <typename F>
-struct execute_member<executor, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-template <>
-struct equality_comparable<executor>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void test_can_schedule()
-{
- ASIO_CONSTEXPR bool b1 = exec::can_schedule<
- no_schedule&>::value;
- ASIO_CHECK(b1 == false);
-
- ASIO_CONSTEXPR bool b2 = exec::can_schedule<
- const no_schedule&>::value;
- ASIO_CHECK(b2 == false);
-
- ASIO_CONSTEXPR bool b3 = exec::can_schedule<
- const_member_schedule&>::value;
- ASIO_CHECK(b3 == true);
-
- ASIO_CONSTEXPR bool b4 = exec::can_schedule<
- const const_member_schedule&>::value;
- ASIO_CHECK(b4 == true);
-
- ASIO_CONSTEXPR bool b5 = exec::can_schedule<
- free_schedule_const_receiver&>::value;
- ASIO_CHECK(b5 == true);
-
- ASIO_CONSTEXPR bool b6 = exec::can_schedule<
- const free_schedule_const_receiver&>::value;
- ASIO_CHECK(b6 == true);
-
- ASIO_CONSTEXPR bool b7 = exec::can_schedule<
- non_const_member_schedule&>::value;
- ASIO_CHECK(b7 == true);
-
- ASIO_CONSTEXPR bool b8 = exec::can_schedule<
- const non_const_member_schedule&>::value;
- ASIO_CHECK(b8 == false);
-
- ASIO_CONSTEXPR bool b9 = exec::can_schedule<
- free_schedule_non_const_receiver&>::value;
- ASIO_CHECK(b9 == true);
-
- ASIO_CONSTEXPR bool b10 = exec::can_schedule<
- const free_schedule_non_const_receiver&>::value;
- ASIO_CHECK(b10 == false);
-
- ASIO_CONSTEXPR bool b11 = exec::can_schedule<
- executor&>::value;
- ASIO_CHECK(b11 == true);
-
- ASIO_CONSTEXPR bool b12 = exec::can_schedule<
- const executor&>::value;
- ASIO_CHECK(b12 == true);
-}
-
-struct receiver
-{
- int* count_;
-
- receiver(int* count)
- : count_(count)
- {
- }
-
- receiver(const receiver& other) ASIO_NOEXCEPT
- : count_(other.count_)
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- receiver(receiver&& other) ASIO_NOEXCEPT
- : count_(other.count_)
- {
- other.count_ = 0;
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- void set_value() ASIO_NOEXCEPT
- {
- ++(*count_);
- }
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- (void)e;
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-template <>
-struct set_value_member<receiver, void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename E>
-struct set_error_member<receiver, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_done_member<receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void test_schedule()
-{
- int count = 0;
- const_member_schedule ex1 = {};
- exec::submit(
- exec::schedule(ex1),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- const const_member_schedule ex2 = {};
- exec::submit(
- exec::schedule(ex2),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- exec::submit(
- exec::schedule(const_member_schedule()),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- free_schedule_const_receiver ex3 = {};
- exec::submit(
- exec::schedule(ex3),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- const free_schedule_const_receiver ex4 = {};
- exec::submit(
- exec::schedule(ex4),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- exec::submit(
- exec::schedule(free_schedule_const_receiver()),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- non_const_member_schedule ex5 = {};
- exec::submit(
- exec::schedule(ex5),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- free_schedule_non_const_receiver ex6 = {};
- exec::submit(
- exec::schedule(ex6),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- executor ex7;
- exec::submit(
- exec::schedule(ex7),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- const executor ex8;
- exec::submit(
- exec::schedule(ex8),
- receiver(&count));
- ASIO_CHECK(count == 1);
-
- count = 0;
- exec::submit(
- exec::schedule(executor()),
- receiver(&count));
- ASIO_CHECK(count == 1);
-}
-
-ASIO_TEST_SUITE
-(
- "schedule",
- ASIO_TEST_CASE(test_can_schedule)
- ASIO_TEST_CASE(test_schedule)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/scheduler.cpp b/3rdparty/asio/src/tests/unit/execution/scheduler.cpp
deleted file mode 100644
index bdcab4dac25..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/scheduler.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// scheduler.cpp
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/scheduler.hpp"
-
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-struct not_a_scheduler
-{
-};
-
-struct executor
-{
- executor()
- {
- }
-
- executor(const executor&) ASIO_NOEXCEPT
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- executor(executor&&) ASIO_NOEXCEPT
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const ASIO_NOEXCEPT
- {
- (void)f;
- }
-
- bool operator==(const executor&) const ASIO_NOEXCEPT
- {
- return true;
- }
-
- bool operator!=(const executor&) const ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-template <typename F>
-struct execute_member<executor, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-template <>
-struct equality_comparable<executor>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void test_is_scheduler()
-{
- ASIO_CHECK(!exec::is_scheduler<void>::value);
- ASIO_CHECK(!exec::is_scheduler<not_a_scheduler>::value);
- ASIO_CHECK(exec::is_scheduler<executor>::value);
-}
-
-ASIO_TEST_SUITE
-(
- "scheduler",
- ASIO_TEST_CASE(test_is_scheduler)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/sender.cpp b/3rdparty/asio/src/tests/unit/execution/sender.cpp
deleted file mode 100644
index 4a497e819f7..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/sender.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-// sender.cpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/sender.hpp"
-
-#include "asio/error_code.hpp"
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-struct not_a_sender
-{
-};
-
-struct sender_using_base :
- asio::execution::sender_base
-{
- sender_using_base()
- {
- }
-};
-
-struct executor
-{
- executor()
- {
- }
-
- executor(const executor&) ASIO_NOEXCEPT
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- executor(executor&&) ASIO_NOEXCEPT
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const ASIO_NOEXCEPT
- {
- (void)f;
- }
-
- bool operator==(const executor&) const ASIO_NOEXCEPT
- {
- return true;
- }
-
- bool operator!=(const executor&) const ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-template <typename F>
-struct execute_member<executor, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-template <>
-struct equality_comparable<executor>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-#if defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
-
-struct operation_state
-{
- void start() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <>
-struct start_member<operation_state>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct typed_sender
-{
- template <
- template <typename...> class Tuple,
- template <typename...> class Variant>
- using value_types = Variant<Tuple<int>>;
-
- template <template <typename...> class Variant>
- using error_types = Variant<asio::error_code>;
-
- ASIO_STATIC_CONSTEXPR(bool, sends_done = true);
-
- typed_sender()
- {
- }
-
- template <typename R>
- operation_state connect(ASIO_MOVE_ARG(R) r) const
- {
- (void)r;
- return operation_state();
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename R>
-struct connect_member<const typed_sender, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
-
-template <typename T>
-bool is_unspecialised(T*, ...)
-{
- return false;
-}
-
-template <typename T>
-bool is_unspecialised(T*,
- typename asio::void_type<
- typename exec::sender_traits<
- T>::asio_execution_sender_traits_base_is_unspecialised
- >::type*)
-{
- return true;
-}
-
-void test_sender_traits()
-{
- not_a_sender s1;
- ASIO_CHECK(is_unspecialised(&s1, static_cast<void*>(0)));
-
- sender_using_base s2;
- ASIO_CHECK(!is_unspecialised(&s2, static_cast<void*>(0)));
-
- executor s3;
- ASIO_CHECK(!is_unspecialised(&s3, static_cast<void*>(0)));
-
-#if defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
- typed_sender s4;
- ASIO_CHECK(!is_unspecialised(&s4, static_cast<void*>(0)));
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
-}
-
-void test_is_sender()
-{
- ASIO_CHECK(!exec::is_sender<void>::value);
- ASIO_CHECK(!exec::is_sender<not_a_sender>::value);
- ASIO_CHECK(exec::is_sender<sender_using_base>::value);
- ASIO_CHECK(exec::is_sender<executor>::value);
-
-#if defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
- ASIO_CHECK(exec::is_sender<typed_sender>::value);
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
-}
-
-void test_is_typed_sender()
-{
- ASIO_CHECK(!exec::is_typed_sender<void>::value);
- ASIO_CHECK(!exec::is_typed_sender<not_a_sender>::value);
- ASIO_CHECK(!exec::is_typed_sender<sender_using_base>::value);
-
-#if defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
- ASIO_CHECK(exec::is_typed_sender<executor>::value);
- ASIO_CHECK(exec::is_typed_sender<typed_sender>::value);
-#endif // defined(ASIO_HAS_DEDUCED_EXECUTION_IS_TYPED_SENDER_TRAIT)
-}
-
-ASIO_TEST_SUITE
-(
- "sender",
- ASIO_TEST_CASE(test_sender_traits)
- ASIO_TEST_CASE(test_is_sender)
- ASIO_TEST_CASE(test_is_typed_sender)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/set_done.cpp b/3rdparty/asio/src/tests/unit/execution/set_done.cpp
deleted file mode 100644
index 723a8fc515d..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/set_done.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// set_done.cpp
-// ~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/set_done.hpp"
-
-#include "asio/error_code.hpp"
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-static int call_count = 0;
-
-struct no_set_done
-{
-};
-
-struct const_member_set_done
-{
- void set_done() const ASIO_NOEXCEPT
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct set_done_member<const const_member_set_done>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-struct free_set_done_const_receiver
-{
- friend void set_done(const free_set_done_const_receiver&) ASIO_NOEXCEPT
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct set_done_free<const free_set_done_const_receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT)
-
-struct non_const_member_set_done
-{
- void set_done() ASIO_NOEXCEPT
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct set_done_member<non_const_member_set_done>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-struct free_set_done_non_const_receiver
-{
- friend void set_done(free_set_done_non_const_receiver&) ASIO_NOEXCEPT
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct set_done_free<free_set_done_non_const_receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_FREE_TRAIT)
-
-void test_can_set_done()
-{
- ASIO_CONSTEXPR bool b1 = exec::can_set_done<
- no_set_done&>::value;
- ASIO_CHECK(b1 == false);
-
- ASIO_CONSTEXPR bool b2 = exec::can_set_done<
- const no_set_done&>::value;
- ASIO_CHECK(b2 == false);
-
- ASIO_CONSTEXPR bool b3 = exec::can_set_done<
- const_member_set_done&>::value;
- ASIO_CHECK(b3 == true);
-
- ASIO_CONSTEXPR bool b4 = exec::can_set_done<
- const const_member_set_done&>::value;
- ASIO_CHECK(b4 == true);
-
- ASIO_CONSTEXPR bool b5 = exec::can_set_done<
- free_set_done_const_receiver&>::value;
- ASIO_CHECK(b5 == true);
-
- ASIO_CONSTEXPR bool b6 = exec::can_set_done<
- const free_set_done_const_receiver&>::value;
- ASIO_CHECK(b6 == true);
-
- ASIO_CONSTEXPR bool b7 = exec::can_set_done<
- non_const_member_set_done&>::value;
- ASIO_CHECK(b7 == true);
-
- ASIO_CONSTEXPR bool b8 = exec::can_set_done<
- const non_const_member_set_done&>::value;
- ASIO_CHECK(b8 == false);
-
- ASIO_CONSTEXPR bool b9 = exec::can_set_done<
- free_set_done_non_const_receiver&>::value;
- ASIO_CHECK(b9 == true);
-
- ASIO_CONSTEXPR bool b10 = exec::can_set_done<
- const free_set_done_non_const_receiver&>::value;
- ASIO_CHECK(b10 == false);
-}
-
-void increment(int* count)
-{
- ++(*count);
-}
-
-void test_set_done()
-{
- call_count = 0;
- const_member_set_done ex1 = {};
- exec::set_done(ex1);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const const_member_set_done ex2 = {};
- exec::set_done(ex2);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_done(const_member_set_done());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_done_const_receiver ex3 = {};
- exec::set_done(ex3);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const free_set_done_const_receiver ex4 = {};
- exec::set_done(ex4);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_done(free_set_done_const_receiver());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- non_const_member_set_done ex5 = {};
- exec::set_done(ex5);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_done_non_const_receiver ex6 = {};
- exec::set_done(ex6);
- ASIO_CHECK(call_count == 1);
-}
-
-ASIO_TEST_SUITE
-(
- "set_done",
- ASIO_TEST_CASE(test_can_set_done)
- ASIO_TEST_CASE(test_set_done)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/set_error.cpp b/3rdparty/asio/src/tests/unit/execution/set_error.cpp
deleted file mode 100644
index 3b5924053b2..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/set_error.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// set_error.cpp
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/set_error.hpp"
-
-#include "asio/error_code.hpp"
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-static int call_count = 0;
-
-struct no_set_error
-{
-};
-
-struct const_member_set_error
-{
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) const ASIO_NOEXCEPT
- {
- typename asio::decay<E>::type tmp(ASIO_MOVE_CAST(E)(e));
- (void)tmp;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename E>
-struct set_error_member<const const_member_set_error, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-struct free_set_error_const_receiver
-{
- template <typename E>
- friend void set_error(const free_set_error_const_receiver&,
- ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- typename asio::decay<E>::type tmp(ASIO_MOVE_CAST(E)(e));
- (void)tmp;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename E>
-struct set_error_free<const free_set_error_const_receiver, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT)
-
-struct non_const_member_set_error
-{
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- typename asio::decay<E>::type tmp(ASIO_MOVE_CAST(E)(e));
- (void)tmp;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename E>
-struct set_error_member<non_const_member_set_error, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-struct free_set_error_non_const_receiver
-{
- template <typename E>
- friend void set_error(free_set_error_non_const_receiver&,
- ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- typename asio::decay<E>::type tmp(ASIO_MOVE_CAST(E)(e));
- (void)tmp;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename E>
-struct set_error_free<free_set_error_non_const_receiver, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_FREE_TRAIT)
-
-void test_can_set_error()
-{
- ASIO_CONSTEXPR bool b1 = exec::can_set_error<
- no_set_error&, asio::error_code>::value;
- ASIO_CHECK(b1 == false);
-
- ASIO_CONSTEXPR bool b2 = exec::can_set_error<
- const no_set_error&, asio::error_code>::value;
- ASIO_CHECK(b2 == false);
-
- ASIO_CONSTEXPR bool b3 = exec::can_set_error<
- const_member_set_error&, asio::error_code>::value;
- ASIO_CHECK(b3 == true);
-
- ASIO_CONSTEXPR bool b4 = exec::can_set_error<
- const const_member_set_error&, asio::error_code>::value;
- ASIO_CHECK(b4 == true);
-
- ASIO_CONSTEXPR bool b5 = exec::can_set_error<
- free_set_error_const_receiver&, asio::error_code>::value;
- ASIO_CHECK(b5 == true);
-
- ASIO_CONSTEXPR bool b6 = exec::can_set_error<
- const free_set_error_const_receiver&, asio::error_code>::value;
- ASIO_CHECK(b6 == true);
-
- ASIO_CONSTEXPR bool b7 = exec::can_set_error<
- non_const_member_set_error&, asio::error_code>::value;
- ASIO_CHECK(b7 == true);
-
- ASIO_CONSTEXPR bool b8 = exec::can_set_error<
- const non_const_member_set_error&, asio::error_code>::value;
- ASIO_CHECK(b8 == false);
-
- ASIO_CONSTEXPR bool b9 = exec::can_set_error<
- free_set_error_non_const_receiver&, asio::error_code>::value;
- ASIO_CHECK(b9 == true);
-
- ASIO_CONSTEXPR bool b10 = exec::can_set_error<
- const free_set_error_non_const_receiver&, asio::error_code>::value;
- ASIO_CHECK(b10 == false);
-}
-
-void increment(int* count)
-{
- ++(*count);
-}
-
-void test_set_error()
-{
- asio::error_code ec;
-
- call_count = 0;
- const_member_set_error ex1 = {};
- exec::set_error(ex1, ec);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const const_member_set_error ex2 = {};
- exec::set_error(ex2, ec);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_error(const_member_set_error(), ec);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_error_const_receiver ex3 = {};
- exec::set_error(ex3, ec);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const free_set_error_const_receiver ex4 = {};
- exec::set_error(ex4, ec);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_error(free_set_error_const_receiver(), ec);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- non_const_member_set_error ex5 = {};
- exec::set_error(ex5, ec);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_error_non_const_receiver ex6 = {};
- exec::set_error(ex6, ec);
- ASIO_CHECK(call_count == 1);
-}
-
-ASIO_TEST_SUITE
-(
- "set_error",
- ASIO_TEST_CASE(test_can_set_error)
- ASIO_TEST_CASE(test_set_error)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/set_value.cpp b/3rdparty/asio/src/tests/unit/execution/set_value.cpp
deleted file mode 100644
index ed22478b3c9..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/set_value.cpp
+++ /dev/null
@@ -1,820 +0,0 @@
-//
-// set_value.cpp
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/set_value.hpp"
-
-#include <string>
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-static int call_count = 0;
-
-struct no_set_value
-{
-};
-
-struct const_member_set_value_0
-{
- void set_value() const
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct set_value_member<const const_member_set_value_0, void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-struct const_member_set_value_1
-{
- template <typename V1>
- void set_value(ASIO_MOVE_ARG(V1) v1) const
- {
- typename asio::decay<V1>::type tmp(ASIO_MOVE_CAST(V1)(v1));
- (void)tmp;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename V1>
-struct set_value_member<const const_member_set_value_1, void(V1)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-struct const_member_set_value_2
-{
- template <typename V1, typename V2>
- void set_value(ASIO_MOVE_ARG(V1) v1, ASIO_MOVE_ARG(V2) v2) const
- {
- typename asio::decay<V1>::type tmp1(ASIO_MOVE_CAST(V1)(v1));
- (void)tmp1;
- typename asio::decay<V2>::type tmp2(ASIO_MOVE_CAST(V2)(v2));
- (void)tmp2;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename V1, typename V2>
-struct set_value_member<const const_member_set_value_2, void(V1, V2)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-struct free_set_value_const_receiver_0
-{
- friend void set_value(const free_set_value_const_receiver_0&)
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct set_value_free<const free_set_value_const_receiver_0, void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-struct free_set_value_const_receiver_1
-{
- template <typename V1>
- friend void set_value(const free_set_value_const_receiver_1&,
- ASIO_MOVE_ARG(V1) v1)
- {
- typename asio::decay<V1>::type tmp(ASIO_MOVE_CAST(V1)(v1));
- (void)tmp;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename V1>
-struct set_value_free<const free_set_value_const_receiver_1, void(V1)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-struct free_set_value_const_receiver_2
-{
- template <typename V1, typename V2>
- friend void set_value(const free_set_value_const_receiver_2&,
- ASIO_MOVE_ARG(V1) v1, ASIO_MOVE_ARG(V2) v2)
- {
- typename asio::decay<V1>::type tmp1(ASIO_MOVE_CAST(V1)(v1));
- (void)tmp1;
- typename asio::decay<V2>::type tmp2(ASIO_MOVE_CAST(V2)(v2));
- (void)tmp2;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename V1, typename V2>
-struct set_value_free<const free_set_value_const_receiver_2, void(V1, V2)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-struct non_const_member_set_value_0
-{
- void set_value()
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct set_value_member<non_const_member_set_value_0, void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-struct non_const_member_set_value_1
-{
- template <typename V1>
- void set_value(ASIO_MOVE_ARG(V1) v1)
- {
- typename asio::decay<V1>::type tmp(ASIO_MOVE_CAST(V1)(v1));
- (void)tmp;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename V1>
-struct set_value_member<non_const_member_set_value_1, void(V1)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-struct non_const_member_set_value_2
-{
- template <typename V1, typename V2>
- void set_value(ASIO_MOVE_ARG(V1) v1, ASIO_MOVE_ARG(V2) v2)
- {
- typename asio::decay<V1>::type tmp1(ASIO_MOVE_CAST(V1)(v1));
- (void)tmp1;
- typename asio::decay<V2>::type tmp2(ASIO_MOVE_CAST(V2)(v2));
- (void)tmp2;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename V1, typename V2>
-struct set_value_member<non_const_member_set_value_2, void(V1, V2)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-struct free_set_value_non_const_receiver_0
-{
- friend void set_value(free_set_value_non_const_receiver_0&)
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct set_value_free<free_set_value_non_const_receiver_0, void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-struct free_set_value_non_const_receiver_1
-{
- template <typename V1>
- friend void set_value(free_set_value_non_const_receiver_1&,
- ASIO_MOVE_ARG(V1) v1)
- {
- typename asio::decay<V1>::type tmp(ASIO_MOVE_CAST(V1)(v1));
- (void)tmp;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename V1>
-struct set_value_free<free_set_value_non_const_receiver_1, void(V1)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-struct free_set_value_non_const_receiver_2
-{
- template <typename V1, typename V2>
- friend void set_value(free_set_value_non_const_receiver_2&,
- ASIO_MOVE_ARG(V1) v1, ASIO_MOVE_ARG(V2) v2)
- {
- typename asio::decay<V1>::type tmp1(ASIO_MOVE_CAST(V1)(v1));
- (void)tmp1;
- typename asio::decay<V2>::type tmp2(ASIO_MOVE_CAST(V2)(v2));
- (void)tmp2;
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename V1, typename V2>
-struct set_value_free<free_set_value_non_const_receiver_2, void(V1, V2)>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_FREE_TRAIT)
-
-void test_can_set_value()
-{
- ASIO_CONSTEXPR bool b1 = exec::can_set_value<
- no_set_value&>::value;
- ASIO_CHECK(b1 == false);
-
- ASIO_CONSTEXPR bool b2 = exec::can_set_value<
- const no_set_value&>::value;
- ASIO_CHECK(b2 == false);
-
- ASIO_CONSTEXPR bool b3 = exec::can_set_value<
- no_set_value&, int>::value;
- ASIO_CHECK(b3 == false);
-
- ASIO_CONSTEXPR bool b4 = exec::can_set_value<
- const no_set_value&, int>::value;
- ASIO_CHECK(b4 == false);
-
- ASIO_CONSTEXPR bool b5 = exec::can_set_value<
- no_set_value&, int, std::string>::value;
- ASIO_CHECK(b5 == false);
-
- ASIO_CONSTEXPR bool b6 = exec::can_set_value<
- const no_set_value&, int, std::string>::value;
- ASIO_CHECK(b6 == false);
-
- ASIO_CONSTEXPR bool b7 = exec::can_set_value<
- const_member_set_value_0&>::value;
- ASIO_CHECK(b7 == true);
-
- ASIO_CONSTEXPR bool b8 = exec::can_set_value<
- const const_member_set_value_0&>::value;
- ASIO_CHECK(b8 == true);
-
- ASIO_CONSTEXPR bool b9 = exec::can_set_value<
- const_member_set_value_0&, int>::value;
- ASIO_CHECK(b9 == false);
-
- ASIO_CONSTEXPR bool b10 = exec::can_set_value<
- const const_member_set_value_0&, int>::value;
- ASIO_CHECK(b10 == false);
-
- ASIO_CONSTEXPR bool b11 = exec::can_set_value<
- const_member_set_value_0&, int, std::string>::value;
- ASIO_CHECK(b11 == false);
-
- ASIO_CONSTEXPR bool b12 = exec::can_set_value<
- const const_member_set_value_0&, int, std::string>::value;
- ASIO_CHECK(b12 == false);
-
- ASIO_CONSTEXPR bool b13 = exec::can_set_value<
- const_member_set_value_1&>::value;
- ASIO_CHECK(b13 == false);
-
- ASIO_CONSTEXPR bool b14 = exec::can_set_value<
- const const_member_set_value_1&>::value;
- ASIO_CHECK(b14 == false);
-
- ASIO_CONSTEXPR bool b15 = exec::can_set_value<
- const_member_set_value_1&, int>::value;
- ASIO_CHECK(b15 == true);
-
- ASIO_CONSTEXPR bool b16 = exec::can_set_value<
- const const_member_set_value_1&, int>::value;
- ASIO_CHECK(b16 == true);
-
- ASIO_CONSTEXPR bool b17 = exec::can_set_value<
- const_member_set_value_1&, int, std::string>::value;
- ASIO_CHECK(b17 == false);
-
- ASIO_CONSTEXPR bool b18 = exec::can_set_value<
- const const_member_set_value_1&, int, std::string>::value;
- ASIO_CHECK(b18 == false);
-
- ASIO_CONSTEXPR bool b19 = exec::can_set_value<
- const_member_set_value_2&>::value;
- ASIO_CHECK(b19 == false);
-
- ASIO_CONSTEXPR bool b20 = exec::can_set_value<
- const const_member_set_value_2&>::value;
- ASIO_CHECK(b20 == false);
-
- ASIO_CONSTEXPR bool b21 = exec::can_set_value<
- const_member_set_value_2&, int>::value;
- ASIO_CHECK(b21 == false);
-
- ASIO_CONSTEXPR bool b22 = exec::can_set_value<
- const const_member_set_value_2&, int>::value;
- ASIO_CHECK(b22 == false);
-
- ASIO_CONSTEXPR bool b23 = exec::can_set_value<
- const_member_set_value_2&, int, std::string>::value;
- ASIO_CHECK(b23 == true);
-
- ASIO_CONSTEXPR bool b24 = exec::can_set_value<
- const const_member_set_value_2&, int, std::string>::value;
- ASIO_CHECK(b24 == true);
-
- ASIO_CONSTEXPR bool b25 = exec::can_set_value<
- free_set_value_const_receiver_0&>::value;
- ASIO_CHECK(b25 == true);
-
- ASIO_CONSTEXPR bool b26 = exec::can_set_value<
- const free_set_value_const_receiver_0&>::value;
- ASIO_CHECK(b26 == true);
-
- ASIO_CONSTEXPR bool b27 = exec::can_set_value<
- free_set_value_const_receiver_0&, int>::value;
- ASIO_CHECK(b27 == false);
-
- ASIO_CONSTEXPR bool b28 = exec::can_set_value<
- const free_set_value_const_receiver_0&, int>::value;
- ASIO_CHECK(b28 == false);
-
- ASIO_CONSTEXPR bool b29 = exec::can_set_value<
- free_set_value_const_receiver_0&, int, std::string>::value;
- ASIO_CHECK(b29 == false);
-
- ASIO_CONSTEXPR bool b30 = exec::can_set_value<
- const free_set_value_const_receiver_0&, int, std::string>::value;
- ASIO_CHECK(b30 == false);
-
- ASIO_CONSTEXPR bool b31 = exec::can_set_value<
- free_set_value_const_receiver_1&>::value;
- ASIO_CHECK(b31 == false);
-
- ASIO_CONSTEXPR bool b32 = exec::can_set_value<
- const free_set_value_const_receiver_1&>::value;
- ASIO_CHECK(b32 == false);
-
- ASIO_CONSTEXPR bool b33 = exec::can_set_value<
- free_set_value_const_receiver_1&, int>::value;
- ASIO_CHECK(b33 == true);
-
- ASIO_CONSTEXPR bool b34 = exec::can_set_value<
- const free_set_value_const_receiver_1&, int>::value;
- ASIO_CHECK(b34 == true);
-
- ASIO_CONSTEXPR bool b35 = exec::can_set_value<
- free_set_value_const_receiver_1&, int, std::string>::value;
- ASIO_CHECK(b35 == false);
-
- ASIO_CONSTEXPR bool b36 = exec::can_set_value<
- const free_set_value_const_receiver_1&, int, std::string>::value;
- ASIO_CHECK(b36 == false);
-
- ASIO_CONSTEXPR bool b37 = exec::can_set_value<
- free_set_value_const_receiver_2&>::value;
- ASIO_CHECK(b37 == false);
-
- ASIO_CONSTEXPR bool b38 = exec::can_set_value<
- const free_set_value_const_receiver_2&>::value;
- ASIO_CHECK(b38 == false);
-
- ASIO_CONSTEXPR bool b39 = exec::can_set_value<
- free_set_value_const_receiver_2&, int>::value;
- ASIO_CHECK(b39 == false);
-
- ASIO_CONSTEXPR bool b40 = exec::can_set_value<
- const free_set_value_const_receiver_2&, int>::value;
- ASIO_CHECK(b40 == false);
-
- ASIO_CONSTEXPR bool b41 = exec::can_set_value<
- free_set_value_const_receiver_2&, int, std::string>::value;
- ASIO_CHECK(b41 == true);
-
- ASIO_CONSTEXPR bool b42 = exec::can_set_value<
- const free_set_value_const_receiver_2&, int, std::string>::value;
- ASIO_CHECK(b42 == true);
-
- ASIO_CONSTEXPR bool b43 = exec::can_set_value<
- non_const_member_set_value_0&>::value;
- ASIO_CHECK(b43 == true);
-
- ASIO_CONSTEXPR bool b44 = exec::can_set_value<
- const non_const_member_set_value_0&>::value;
- ASIO_CHECK(b44 == false);
-
- ASIO_CONSTEXPR bool b45 = exec::can_set_value<
- non_const_member_set_value_0&, int>::value;
- ASIO_CHECK(b45 == false);
-
- ASIO_CONSTEXPR bool b46 = exec::can_set_value<
- const non_const_member_set_value_0&, int>::value;
- ASIO_CHECK(b46 == false);
-
- ASIO_CONSTEXPR bool b47 = exec::can_set_value<
- non_const_member_set_value_0&, int, std::string>::value;
- ASIO_CHECK(b47 == false);
-
- ASIO_CONSTEXPR bool b48 = exec::can_set_value<
- const non_const_member_set_value_0&, int, std::string>::value;
- ASIO_CHECK(b48 == false);
-
- ASIO_CONSTEXPR bool b49 = exec::can_set_value<
- non_const_member_set_value_1&>::value;
- ASIO_CHECK(b49 == false);
-
- ASIO_CONSTEXPR bool b50 = exec::can_set_value<
- const non_const_member_set_value_1&>::value;
- ASIO_CHECK(b50 == false);
-
- ASIO_CONSTEXPR bool b51 = exec::can_set_value<
- non_const_member_set_value_1&, int>::value;
- ASIO_CHECK(b51 == true);
-
- ASIO_CONSTEXPR bool b52 = exec::can_set_value<
- const non_const_member_set_value_1&, int>::value;
- ASIO_CHECK(b52 == false);
-
- ASIO_CONSTEXPR bool b53 = exec::can_set_value<
- non_const_member_set_value_1&, int, std::string>::value;
- ASIO_CHECK(b53 == false);
-
- ASIO_CONSTEXPR bool b54 = exec::can_set_value<
- const non_const_member_set_value_1&, int, std::string>::value;
- ASIO_CHECK(b54 == false);
-
- ASIO_CONSTEXPR bool b55 = exec::can_set_value<
- non_const_member_set_value_2&>::value;
- ASIO_CHECK(b55 == false);
-
- ASIO_CONSTEXPR bool b56 = exec::can_set_value<
- const non_const_member_set_value_2&>::value;
- ASIO_CHECK(b56 == false);
-
- ASIO_CONSTEXPR bool b57 = exec::can_set_value<
- non_const_member_set_value_2&, int>::value;
- ASIO_CHECK(b57 == false);
-
- ASIO_CONSTEXPR bool b58 = exec::can_set_value<
- const non_const_member_set_value_2&, int>::value;
- ASIO_CHECK(b58 == false);
-
- ASIO_CONSTEXPR bool b59 = exec::can_set_value<
- non_const_member_set_value_2&, int, std::string>::value;
- ASIO_CHECK(b59 == true);
-
- ASIO_CONSTEXPR bool b60 = exec::can_set_value<
- const non_const_member_set_value_2&, int, std::string>::value;
- ASIO_CHECK(b60 == false);
-
- ASIO_CONSTEXPR bool b61 = exec::can_set_value<
- free_set_value_non_const_receiver_0&>::value;
- ASIO_CHECK(b61 == true);
-
- ASIO_CONSTEXPR bool b62 = exec::can_set_value<
- const free_set_value_non_const_receiver_0&>::value;
- ASIO_CHECK(b62 == false);
-
- ASIO_CONSTEXPR bool b63 = exec::can_set_value<
- free_set_value_non_const_receiver_0&, int>::value;
- ASIO_CHECK(b63 == false);
-
- ASIO_CONSTEXPR bool b64 = exec::can_set_value<
- const free_set_value_non_const_receiver_0&, int>::value;
- ASIO_CHECK(b64 == false);
-
- ASIO_CONSTEXPR bool b65 = exec::can_set_value<
- free_set_value_non_const_receiver_0&, int, std::string>::value;
- ASIO_CHECK(b65 == false);
-
- ASIO_CONSTEXPR bool b66 = exec::can_set_value<
- const free_set_value_non_const_receiver_0&, int, std::string>::value;
- ASIO_CHECK(b66 == false);
-
- ASIO_CONSTEXPR bool b67 = exec::can_set_value<
- free_set_value_non_const_receiver_1&>::value;
- ASIO_CHECK(b67 == false);
-
- ASIO_CONSTEXPR bool b68 = exec::can_set_value<
- const free_set_value_non_const_receiver_1&>::value;
- ASIO_CHECK(b68 == false);
-
- ASIO_CONSTEXPR bool b69 = exec::can_set_value<
- free_set_value_non_const_receiver_1&, int>::value;
- ASIO_CHECK(b69 == true);
-
- ASIO_CONSTEXPR bool b70 = exec::can_set_value<
- const free_set_value_non_const_receiver_1&, int>::value;
- ASIO_CHECK(b70 == false);
-
- ASIO_CONSTEXPR bool b71 = exec::can_set_value<
- free_set_value_non_const_receiver_1&, int, std::string>::value;
- ASIO_CHECK(b71 == false);
-
- ASIO_CONSTEXPR bool b72 = exec::can_set_value<
- const free_set_value_non_const_receiver_1&, int, std::string>::value;
- ASIO_CHECK(b72 == false);
-
- ASIO_CONSTEXPR bool b73 = exec::can_set_value<
- free_set_value_non_const_receiver_2&>::value;
- ASIO_CHECK(b73 == false);
-
- ASIO_CONSTEXPR bool b74 = exec::can_set_value<
- const free_set_value_non_const_receiver_2&>::value;
- ASIO_CHECK(b74 == false);
-
- ASIO_CONSTEXPR bool b75 = exec::can_set_value<
- free_set_value_non_const_receiver_2&, int>::value;
- ASIO_CHECK(b75 == false);
-
- ASIO_CONSTEXPR bool b76 = exec::can_set_value<
- const free_set_value_non_const_receiver_2&, int>::value;
- ASIO_CHECK(b76 == false);
-
- ASIO_CONSTEXPR bool b77 = exec::can_set_value<
- free_set_value_non_const_receiver_2&, int, std::string>::value;
- ASIO_CHECK(b77 == true);
-
- ASIO_CONSTEXPR bool b78 = exec::can_set_value<
- const free_set_value_non_const_receiver_2&, int, std::string>::value;
- ASIO_CHECK(b78 == false);
-}
-
-void increment(int* count)
-{
- ++(*count);
-}
-
-void test_set_value()
-{
- call_count = 0;
- const_member_set_value_0 ex1 = {};
- exec::set_value(ex1);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const const_member_set_value_0 ex2 = {};
- exec::set_value(ex2);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_value(const_member_set_value_0());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const_member_set_value_1 ex3 = {};
- exec::set_value(ex3, 123);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const const_member_set_value_1 ex4 = {};
- exec::set_value(ex4, 123);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_value(const_member_set_value_1(), 123);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const_member_set_value_2 ex5 = {};
- exec::set_value(ex5, 123, std::string());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const const_member_set_value_2 ex6 = {};
- exec::set_value(ex6, 123, std::string());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_value(const_member_set_value_2(), 123, std::string());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_value_const_receiver_0 ex7 = {};
- exec::set_value(ex7);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const free_set_value_const_receiver_0 ex8 = {};
- exec::set_value(ex8);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_value(free_set_value_const_receiver_0());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_value_const_receiver_1 ex9 = {};
- exec::set_value(ex9, 123);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const free_set_value_const_receiver_1 ex10 = {};
- exec::set_value(ex10, 123);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_value(free_set_value_const_receiver_1(), 123);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_value_const_receiver_2 ex11 = {};
- exec::set_value(ex11, 123, std::string());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const free_set_value_const_receiver_2 ex12 = {};
- exec::set_value(ex12, 123, std::string());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::set_value(free_set_value_const_receiver_2(), 123, std::string());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- non_const_member_set_value_0 ex13 = {};
- exec::set_value(ex13);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- non_const_member_set_value_1 ex14 = {};
- exec::set_value(ex14, 123);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- non_const_member_set_value_2 ex15 = {};
- exec::set_value(ex15, 123, std::string());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_value_non_const_receiver_0 ex16 = {};
- exec::set_value(ex16);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_value_non_const_receiver_1 ex17 = {};
- exec::set_value(ex17, 123);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_set_value_non_const_receiver_2 ex18 = {};
- exec::set_value(ex18, 123, std::string());
- ASIO_CHECK(call_count == 1);
-}
-
-ASIO_TEST_SUITE
-(
- "set_value",
- ASIO_TEST_CASE(test_can_set_value)
- ASIO_TEST_CASE(test_set_value)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/start.cpp b/3rdparty/asio/src/tests/unit/execution/start.cpp
deleted file mode 100644
index 8faae16d961..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/start.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// start.cpp
-// ~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/start.hpp"
-
-#include "asio/error_code.hpp"
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-static int call_count = 0;
-
-struct no_start
-{
-};
-
-struct const_member_start
-{
- void start() const ASIO_NOEXCEPT
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct start_member<const const_member_start>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-struct free_start_const_receiver
-{
- friend void start(const free_start_const_receiver&) ASIO_NOEXCEPT
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct start_free<const free_start_const_receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT)
-
-struct non_const_member_start
-{
- void start() ASIO_NOEXCEPT
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct start_member<non_const_member_start>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-struct free_start_non_const_receiver
-{
- friend void start(free_start_non_const_receiver&) ASIO_NOEXCEPT
- {
- ++call_count;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <>
-struct start_free<free_start_non_const_receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT)
-
-void test_can_start()
-{
- ASIO_CONSTEXPR bool b1 = exec::can_start<
- no_start&>::value;
- ASIO_CHECK(b1 == false);
-
- ASIO_CONSTEXPR bool b2 = exec::can_start<
- const no_start&>::value;
- ASIO_CHECK(b2 == false);
-
- ASIO_CONSTEXPR bool b3 = exec::can_start<
- const_member_start&>::value;
- ASIO_CHECK(b3 == true);
-
- ASIO_CONSTEXPR bool b4 = exec::can_start<
- const const_member_start&>::value;
- ASIO_CHECK(b4 == true);
-
- ASIO_CONSTEXPR bool b5 = exec::can_start<
- free_start_const_receiver&>::value;
- ASIO_CHECK(b5 == true);
-
- ASIO_CONSTEXPR bool b6 = exec::can_start<
- const free_start_const_receiver&>::value;
- ASIO_CHECK(b6 == true);
-
- ASIO_CONSTEXPR bool b7 = exec::can_start<
- non_const_member_start&>::value;
- ASIO_CHECK(b7 == true);
-
- ASIO_CONSTEXPR bool b8 = exec::can_start<
- const non_const_member_start&>::value;
- ASIO_CHECK(b8 == false);
-
- ASIO_CONSTEXPR bool b9 = exec::can_start<
- free_start_non_const_receiver&>::value;
- ASIO_CHECK(b9 == true);
-
- ASIO_CONSTEXPR bool b10 = exec::can_start<
- const free_start_non_const_receiver&>::value;
- ASIO_CHECK(b10 == false);
-}
-
-void increment(int* count)
-{
- ++(*count);
-}
-
-void test_start()
-{
- call_count = 0;
- const_member_start ex1 = {};
- exec::start(ex1);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const const_member_start ex2 = {};
- exec::start(ex2);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::start(const_member_start());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_start_const_receiver ex3 = {};
- exec::start(ex3);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const free_start_const_receiver ex4 = {};
- exec::start(ex4);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::start(free_start_const_receiver());
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- non_const_member_start ex5 = {};
- exec::start(ex5);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_start_non_const_receiver ex6 = {};
- exec::start(ex6);
- ASIO_CHECK(call_count == 1);
-}
-
-ASIO_TEST_SUITE
-(
- "start",
- ASIO_TEST_CASE(test_can_start)
- ASIO_TEST_CASE(test_start)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution/submit.cpp b/3rdparty/asio/src/tests/unit/execution/submit.cpp
deleted file mode 100644
index 6042ef18f1e..00000000000
--- a/3rdparty/asio/src/tests/unit/execution/submit.cpp
+++ /dev/null
@@ -1,546 +0,0 @@
-//
-// submit.cpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// 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)
-//
-
-// Disable autolinking for unit tests.
-#if !defined(BOOST_ALL_NO_LIB)
-#define BOOST_ALL_NO_LIB 1
-#endif // !defined(BOOST_ALL_NO_LIB)
-
-// Test that header file is self-contained.
-#include "asio/execution/submit.hpp"
-
-#include "asio/error_code.hpp"
-#include "../unit_test.hpp"
-
-namespace exec = asio::execution;
-
-static int call_count = 0;
-
-struct operation_state
-{
- void start() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-template <>
-struct start_member<operation_state>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct no_submit_1
-{
-};
-
-struct no_submit_2 : exec::sender_base
-{
-};
-
-struct no_submit_3
-{
- template <typename R>
- void submit(ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- }
-};
-
-#if !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-namespace asio {
-namespace traits {
-
-template <typename R>
-struct submit_member<no_submit_3, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-} // namespace traits
-} // namespace asio
-
-#endif // !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-struct const_member_submit : exec::sender_base
-{
- const_member_submit()
- {
- }
-
- template <typename R>
- operation_state connect(ASIO_MOVE_ARG(R) r) const
- {
- (void)r;
- return operation_state();
- }
-
- template <typename R>
- void submit(ASIO_MOVE_ARG(R) r) const
- {
- (void)r;
- ++call_count;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename R>
-struct connect_member<const const_member_submit, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-template <typename R>
-struct submit_member<const const_member_submit, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct free_submit_const_receiver : exec::sender_base
-{
- free_submit_const_receiver()
- {
- }
-
- template <typename R>
- friend operation_state connect(
- const free_submit_const_receiver&, ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- return operation_state();
- }
-
- template <typename R>
- friend void submit(
- const free_submit_const_receiver&, ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- ++call_count;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-template <typename R>
-struct connect_free<const free_submit_const_receiver, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT)
-
-template <typename R>
-struct submit_free<const free_submit_const_receiver, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct non_const_member_submit : exec::sender_base
-{
- non_const_member_submit()
- {
- }
-
- template <typename R>
- operation_state connect(ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- return operation_state();
- }
-
- template <typename R>
- void submit(ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- ++call_count;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-template <typename R>
-struct connect_member<non_const_member_submit, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-template <typename R>
-struct submit_member<non_const_member_submit, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SUBMIT_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct free_submit_non_const_receiver : exec::sender_base
-{
- free_submit_non_const_receiver()
- {
- }
-
- template <typename R>
- friend operation_state connect(
- free_submit_non_const_receiver&, ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- return operation_state();
- }
-
- template <typename R>
- friend void submit(
- free_submit_non_const_receiver&, ASIO_MOVE_ARG(R) r)
- {
- (void)r;
- ++call_count;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-template <typename R>
-struct connect_free<free_submit_non_const_receiver, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef operation_state result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_CONNECT_FREE_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT)
-
-template <typename R>
-struct submit_free<free_submit_non_const_receiver, R>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SUBMIT_FREE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct receiver
-{
- receiver()
- {
- }
-
- receiver(const receiver&)
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- receiver(receiver&&) ASIO_NOEXCEPT
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- (void)e;
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename E>
-struct set_error_member<receiver, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_done_member<receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-struct executor
-{
- executor()
- {
- }
-
- executor(const executor&) ASIO_NOEXCEPT
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- executor(executor&&) ASIO_NOEXCEPT
- {
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- template <typename F>
- void execute(ASIO_MOVE_ARG(F) f) const ASIO_NOEXCEPT
- {
- (void)f;
- ++call_count;
- }
-
- bool operator==(const executor&) const ASIO_NOEXCEPT
- {
- return true;
- }
-
- bool operator!=(const executor&) const ASIO_NOEXCEPT
- {
- return false;
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
-
-template <typename F>
-struct execute_member<executor, F>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-template <>
-struct equality_comparable<executor>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void test_can_submit()
-{
- ASIO_CONSTEXPR bool b1 = exec::can_submit<
- no_submit_1&, receiver>::value;
- ASIO_CHECK(b1 == false);
-
- ASIO_CONSTEXPR bool b2 = exec::can_submit<
- const no_submit_1&, receiver>::value;
- ASIO_CHECK(b2 == false);
-
- ASIO_CONSTEXPR bool b3 = exec::can_submit<
- no_submit_2&, receiver>::value;
- ASIO_CHECK(b3 == false);
-
- ASIO_CONSTEXPR bool b4 = exec::can_submit<
- const no_submit_2&, receiver>::value;
- ASIO_CHECK(b4 == false);
-
- ASIO_CONSTEXPR bool b5 = exec::can_submit<
- no_submit_3&, receiver>::value;
- ASIO_CHECK(b5 == false);
-
- ASIO_CONSTEXPR bool b6 = exec::can_submit<
- const no_submit_3&, receiver>::value;
- ASIO_CHECK(b6 == false);
-
- ASIO_CONSTEXPR bool b7 = exec::can_submit<
- const_member_submit&, receiver>::value;
- ASIO_CHECK(b7 == true);
-
- ASIO_CONSTEXPR bool b8 = exec::can_submit<
- const const_member_submit&, receiver>::value;
- ASIO_CHECK(b8 == true);
-
- ASIO_CONSTEXPR bool b9 = exec::can_submit<
- free_submit_const_receiver&, receiver>::value;
- ASIO_CHECK(b9 == true);
-
- ASIO_CONSTEXPR bool b10 = exec::can_submit<
- const free_submit_const_receiver&, receiver>::value;
- ASIO_CHECK(b10 == true);
-
- ASIO_CONSTEXPR bool b11 = exec::can_submit<
- non_const_member_submit&, receiver>::value;
- ASIO_CHECK(b11 == true);
-
- ASIO_CONSTEXPR bool b12 = exec::can_submit<
- const non_const_member_submit&, receiver>::value;
- ASIO_CHECK(b12 == false);
-
- ASIO_CONSTEXPR bool b13 = exec::can_submit<
- free_submit_non_const_receiver&, receiver>::value;
- ASIO_CHECK(b13 == true);
-
- ASIO_CONSTEXPR bool b14 = exec::can_submit<
- const free_submit_non_const_receiver&, receiver>::value;
- ASIO_CHECK(b14 == false);
-
- ASIO_CONSTEXPR bool b15 = exec::can_submit<
- executor&, receiver>::value;
- ASIO_CHECK(b15 == true);
-
- ASIO_CONSTEXPR bool b16 = exec::can_submit<
- const executor&, receiver>::value;
- ASIO_CHECK(b16 == true);
-}
-
-void increment(int* count)
-{
- ++(*count);
-}
-
-void test_submit()
-{
- receiver r;
-
- call_count = 0;
- const_member_submit s1;
- exec::submit(s1, r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const const_member_submit s2;
- exec::submit(s2, r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::submit(const_member_submit(), r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_submit_const_receiver s3;
- exec::submit(s3, r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const free_submit_const_receiver s4;
- exec::submit(s4, r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::submit(free_submit_const_receiver(), r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- non_const_member_submit s5;
- exec::submit(s5, r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- free_submit_non_const_receiver s6;
- exec::submit(s6, r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- executor s7;
- exec::submit(s7, r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- const executor s8;
- exec::submit(s8, r);
- ASIO_CHECK(call_count == 1);
-
- call_count = 0;
- exec::submit(executor(), r);
- ASIO_CHECK(call_count == 1);
-}
-
-ASIO_TEST_SUITE
-(
- "submit",
- ASIO_TEST_CASE(test_can_submit)
- ASIO_TEST_CASE(test_submit)
-)
diff --git a/3rdparty/asio/src/tests/unit/execution_context.cpp b/3rdparty/asio/src/tests/unit/execution_context.cpp
index fff86c98a73..cf5a499e256 100644
--- a/3rdparty/asio/src/tests/unit/execution_context.cpp
+++ b/3rdparty/asio/src/tests/unit/execution_context.cpp
@@ -2,7 +2,7 @@
// execution_context.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/executor.cpp b/3rdparty/asio/src/tests/unit/executor.cpp
index 4ec2258c2fd..7ea75055aa4 100644
--- a/3rdparty/asio/src/tests/unit/executor.cpp
+++ b/3rdparty/asio/src/tests/unit/executor.cpp
@@ -2,7 +2,7 @@
// executor.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/executor_work_guard.cpp b/3rdparty/asio/src/tests/unit/executor_work_guard.cpp
index 9fb0b08da61..5d7aecd5c7c 100644
--- a/3rdparty/asio/src/tests/unit/executor_work_guard.cpp
+++ b/3rdparty/asio/src/tests/unit/executor_work_guard.cpp
@@ -2,7 +2,7 @@
// executor_work_guard.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/experimental/awaitable_operators.cpp b/3rdparty/asio/src/tests/unit/experimental/awaitable_operators.cpp
index 2323f0d7932..e79eeae3eea 100644
--- a/3rdparty/asio/src/tests/unit/experimental/awaitable_operators.cpp
+++ b/3rdparty/asio/src/tests/unit/experimental/awaitable_operators.cpp
@@ -2,7 +2,7 @@
// experimental/awaitable_operators.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/experimental/basic_channel.cpp b/3rdparty/asio/src/tests/unit/experimental/basic_channel.cpp
new file mode 100644
index 00000000000..a277efeb27c
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/basic_channel.cpp
@@ -0,0 +1,25 @@
+//
+// experimental/basic_channel.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/experimental/basic_channel.hpp"
+
+#include "../unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "experimental/basic_channel",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/basic_concurrent_channel.cpp b/3rdparty/asio/src/tests/unit/experimental/basic_concurrent_channel.cpp
new file mode 100644
index 00000000000..413d1870bd9
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/basic_concurrent_channel.cpp
@@ -0,0 +1,25 @@
+//
+// experimental/basic_concurrent_channel.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/experimental/basic_concurrent_channel.hpp"
+
+#include "../unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "experimental/basic_concurrent_channel",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/channel.cpp b/3rdparty/asio/src/tests/unit/experimental/channel.cpp
new file mode 100644
index 00000000000..6c5b67fe570
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/channel.cpp
@@ -0,0 +1,888 @@
+//
+// experimental/channel.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/experimental/channel.hpp"
+
+#include <utility>
+#include "asio/any_completion_handler.hpp"
+#include "asio/bind_executor.hpp"
+#include "asio/bind_immediate_executor.hpp"
+#include "asio/error.hpp"
+#include "asio/io_context.hpp"
+#include "asio/system_executor.hpp"
+#include "../unit_test.hpp"
+
+using namespace asio;
+using namespace asio::experimental;
+
+void unbuffered_channel_test()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ ASIO_CHECK(ch1.is_open());
+ ASIO_CHECK(!ch1.ready());
+
+ bool b1 = ch1.try_send(asio::error::eof, "hello");
+
+ ASIO_CHECK(!b1);
+
+ std::string s1 = "abcdefghijklmnopqrstuvwxyz";
+ bool b2 = ch1.try_send(asio::error::eof, std::move(s1));
+
+ ASIO_CHECK(!b2);
+ ASIO_CHECK(!s1.empty());
+
+ asio::error_code ec1;
+ std::string s2;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s2 = std::move(s);
+ });
+
+ bool b3 = ch1.try_send(asio::error::eof, std::move(s1));
+
+ ASIO_CHECK(b3);
+ ASIO_CHECK(s1.empty());
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s2 == "abcdefghijklmnopqrstuvwxyz");
+
+ bool b4 = ch1.try_receive([](asio::error_code, std::string){});
+
+ ASIO_CHECK(!b4);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s3 = "zyxwvutsrqponmlkjihgfedcba";
+ ch1.async_send(asio::error::eof, std::move(s3),
+ [&](asio::error_code ec)
+ {
+ ec2 = ec;
+ });
+
+ asio::error_code ec3;
+ std::string s4;
+ bool b5 = ch1.try_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec3 = ec;
+ s4 = s;
+ });
+
+ ASIO_CHECK(b5);
+ ASIO_CHECK(ec3 == asio::error::eof);
+ ASIO_CHECK(s4 == "zyxwvutsrqponmlkjihgfedcba");
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(!ec2);
+}
+
+void buffered_channel_test()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx, 1);
+
+ ASIO_CHECK(ch1.is_open());
+ ASIO_CHECK(!ch1.ready());
+
+ bool b1 = ch1.try_send(asio::error::eof, "hello");
+
+ ASIO_CHECK(b1);
+
+ std::string s1 = "abcdefghijklmnopqrstuvwxyz";
+ bool b2 = ch1.try_send(asio::error::eof, std::move(s1));
+
+ ASIO_CHECK(!b2);
+ ASIO_CHECK(!s1.empty());
+
+ asio::error_code ec1;
+ std::string s2;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s2 = std::move(s);
+ });
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s2 == "hello");
+
+ bool b4 = ch1.try_receive([](asio::error_code, std::string){});
+
+ ASIO_CHECK(!b4);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s3 = "zyxwvutsrqponmlkjihgfedcba";
+ ch1.async_send(asio::error::eof, std::move(s3),
+ [&](asio::error_code ec)
+ {
+ ec2 = ec;
+ });
+
+ asio::error_code ec3;
+ std::string s4;
+ bool b5 = ch1.try_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec3 = ec;
+ s4 = s;
+ });
+
+ ASIO_CHECK(b5);
+ ASIO_CHECK(ec3 == asio::error::eof);
+ ASIO_CHECK(s4 == "zyxwvutsrqponmlkjihgfedcba");
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(!ec2);
+
+ bool b6 = ch1.try_send(asio::error_code(), "goodbye");
+
+ ASIO_CHECK(b6);
+
+ ch1.close();
+
+ asio::error_code ec4;
+ std::string s5;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec4 = ec;
+ s5 = std::move(s);
+ });
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(!ec4);
+ ASIO_CHECK(s5 == "goodbye");
+
+ asio::error_code ec5;
+ std::string s6;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec5 = ec;
+ s6 = std::move(s);
+ });
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(ec5 == asio::experimental::channel_errc::channel_closed);
+ ASIO_CHECK(s6.empty());
+}
+
+void buffered_error_channel_test()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code)> ch1(ctx, 1);
+
+ ASIO_CHECK(ch1.is_open());
+ ASIO_CHECK(!ch1.ready());
+
+ bool b1 = ch1.try_send(asio::error::eof);
+
+ ASIO_CHECK(b1);
+
+ bool b2 = ch1.try_send(asio::error::eof);
+
+ ASIO_CHECK(!b2);
+
+ asio::error_code ec1;
+ ch1.async_receive(
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ });
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+
+ bool b4 = ch1.try_receive([](asio::error_code){});
+
+ ASIO_CHECK(!b4);
+
+ asio::error_code ec2 = asio::error::would_block;
+ ch1.async_send(asio::error::eof,
+ [&](asio::error_code ec)
+ {
+ ec2 = ec;
+ });
+
+ asio::error_code ec3;
+ bool b5 = ch1.try_receive(
+ [&](asio::error_code ec)
+ {
+ ec3 = ec;
+ });
+
+ ASIO_CHECK(b5);
+ ASIO_CHECK(ec3 == asio::error::eof);
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(!ec2);
+}
+
+void unbuffered_non_immediate_receive()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s1),
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec2 = ec;
+ s2 = std::move(s);
+ });
+
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(!ec1);
+ ASIO_CHECK(ec2 == asio::error::eof);
+ ASIO_CHECK(s2 == "0123456789");
+}
+
+void unbuffered_immediate_receive()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s1),
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2;
+ ch1.async_receive(
+ bind_immediate_executor(system_executor(),
+ [&](asio::error_code ec, std::string s)
+ {
+ ec2 = ec;
+ s2 = std::move(s);
+ }));
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+ ASIO_CHECK(ec2 == asio::error::eof);
+ ASIO_CHECK(s2 == "0123456789");
+
+ ctx.run();
+
+ ASIO_CHECK(!ec1);
+}
+
+void unbuffered_executor_receive()
+{
+ io_context ctx;
+ io_context ctx2;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s1),
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2;
+ ch1.async_receive(
+ bind_executor(ctx2,
+ [&](asio::error_code ec, std::string s)
+ {
+ ec2 = ec;
+ s2 = std::move(s);
+ }));
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(!ec1);
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx2.run();
+
+ ASIO_CHECK(ec2 == asio::error::eof);
+ ASIO_CHECK(s2 == "0123456789");
+}
+
+void unbuffered_non_immediate_send()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s1 = std::move(s);
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s2),
+ [&](asio::error_code ec)
+ {
+ ec2 = ec;
+ });
+
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s1 == "0123456789");
+ ASIO_CHECK(!ec2);
+}
+
+void unbuffered_immediate_send()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s1 = std::move(s);
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s2),
+ bind_immediate_executor(system_executor(),
+ [&](asio::error_code ec)
+ {
+ ec2 = ec;
+ }));
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+ ASIO_CHECK(!ec2);
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s1 == "0123456789");
+}
+
+void unbuffered_executor_send()
+{
+ io_context ctx;
+ io_context ctx2;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s1 = std::move(s);
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s2),
+ bind_executor(ctx2,
+ [&](asio::error_code ec)
+ {
+ ec2 = ec;
+ }));
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s1 == "0123456789");
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx2.run();
+
+ ASIO_CHECK(!ec2);
+}
+
+void buffered_non_immediate_receive()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx, 1);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s1),
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(!ec1);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec2 = ec;
+ s2 = std::move(s);
+ });
+
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(ec2 == asio::error::eof);
+ ASIO_CHECK(s2 == "0123456789");
+}
+
+void buffered_immediate_receive()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx, 1);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s1),
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(!ec1);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2;
+ ch1.async_receive(
+ bind_immediate_executor(system_executor(),
+ [&](asio::error_code ec, std::string s)
+ {
+ ec2 = ec;
+ s2 = std::move(s);
+ }));
+
+ ASIO_CHECK(ec2 == asio::error::eof);
+ ASIO_CHECK(s2 == "0123456789");
+
+ ctx.restart();
+ ctx.run();
+}
+
+void buffered_executor_receive()
+{
+ io_context ctx;
+ io_context ctx2;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx, 1);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s1),
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(!ec1);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2;
+ ch1.async_receive(
+ bind_executor(ctx2,
+ [&](asio::error_code ec, std::string s)
+ {
+ ec2 = ec;
+ s2 = std::move(s);
+ }));
+
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx2.run();
+
+ ASIO_CHECK(ec2 == asio::error::eof);
+ ASIO_CHECK(s2 == "0123456789");
+}
+
+void buffered_non_immediate_send()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx, 1);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s1),
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ });
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(!ec1);
+}
+
+void buffered_immediate_send()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx, 1);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s1),
+ bind_immediate_executor(system_executor(),
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ }));
+
+ ASIO_CHECK(!ec1);
+
+ ctx.run();
+}
+
+void buffered_executor_send()
+{
+ io_context ctx;
+ io_context ctx2;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx, 1);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1 = "0123456789";
+ ch1.async_send(asio::error::eof, std::move(s1),
+ bind_executor(ctx2,
+ [&](asio::error_code ec)
+ {
+ ec1 = ec;
+ }));
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ ctx2.run();
+
+ ASIO_CHECK(!ec1);
+}
+
+void try_send_via_dispatch()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1;
+ ch1.async_receive(
+ bind_executor(asio::system_executor(),
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s1 = std::move(s);
+ }));
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ ctx.poll();
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ std::string s2 = "0123456789";
+ ch1.try_send_via_dispatch(asio::error::eof, std::move(s2));
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s1 == "0123456789");
+ ASIO_CHECK(s2.empty());
+}
+
+void try_send_n_via_dispatch()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1;
+ ch1.async_receive(
+ bind_executor(asio::system_executor(),
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s1 = std::move(s);
+ }));
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2;
+ ch1.async_receive(
+ bind_executor(asio::system_executor(),
+ [&](asio::error_code ec, std::string s)
+ {
+ ec2 = ec;
+ s2 = std::move(s);
+ }));
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ ctx.poll();
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ std::string s3 = "0123456789";
+ ch1.try_send_n_via_dispatch(2, asio::error::eof, std::move(s3));
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s1 == "0123456789");
+ ASIO_CHECK(ec2 == asio::error::eof);
+ ASIO_CHECK(s2 == "0123456789");
+ ASIO_CHECK(s3.empty());
+}
+
+struct multi_signature_handler
+{
+ std::string* s_;
+ asio::error_code* ec_;
+
+ void operator()(std::string s)
+ {
+ *s_ = s;
+ }
+
+ void operator()(asio::error_code ec)
+ {
+ *ec_ = ec;
+ }
+};
+
+void implicit_error_signature_channel_test()
+{
+ io_context ctx;
+
+ channel<void(std::string)> ch1(ctx);
+
+ ASIO_CHECK(ch1.is_open());
+ ASIO_CHECK(!ch1.ready());
+
+ bool b1 = ch1.try_send("hello");
+
+ ASIO_CHECK(!b1);
+
+ std::string s1 = "abcdefghijklmnopqrstuvwxyz";
+ bool b2 = ch1.try_send(std::move(s1));
+
+ ASIO_CHECK(!b2);
+ ASIO_CHECK(!s1.empty());
+
+ std::string s2;
+ asio::error_code ec1 = asio::error::would_block;
+ multi_signature_handler h1 = {&s2, &ec1};
+ ch1.async_receive(h1);
+
+ bool b3 = ch1.try_send(std::move(s1));
+
+ ASIO_CHECK(b3);
+ ASIO_CHECK(s1.empty());
+
+ ctx.run();
+
+ ASIO_CHECK(s2 == "abcdefghijklmnopqrstuvwxyz");
+ ASIO_CHECK(ec1 == asio::error::would_block);
+
+ std::string s3;
+ asio::error_code ec2;
+ multi_signature_handler h2 = {&s3, &ec2};
+ bool b4 = ch1.try_receive(h2);
+
+ ASIO_CHECK(!b4);
+
+ std::string s4 = "zyxwvutsrqponmlkjihgfedcba";
+ asio::error_code ec3;
+ ch1.async_send(std::move(s4),
+ [&](asio::error_code ec)
+ {
+ ec3 = ec;
+ });
+
+ std::string s5;
+ asio::error_code ec4 = asio::error::would_block;
+ multi_signature_handler h3 = {&s5, &ec4};
+ bool b5 = ch1.try_receive(h3);
+
+ ASIO_CHECK(b5);
+ ASIO_CHECK(ec4 == asio::error::would_block);
+ ASIO_CHECK(s5 == "zyxwvutsrqponmlkjihgfedcba");
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(!ec3);
+
+ std::string s6;
+ asio::error_code ec5 = asio::error::would_block;
+ multi_signature_handler h4 = {&s6, &ec5};
+ ch1.async_receive(h4);
+
+ ch1.close();
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(s6.empty());
+ ASIO_CHECK(ec5 == asio::experimental::channel_errc::channel_closed);
+}
+
+void channel_with_any_completion_handler_test()
+{
+ io_context ctx;
+
+ channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ asio::error_code ec1 = asio::error::would_block;
+ std::string s1;
+ ch1.async_receive(
+ asio::any_completion_handler<
+ void(asio::error_code, std::string)>(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s1 = std::move(s);
+ }));
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s2 = "zyxwvutsrqponmlkjihgfedcba";
+ ch1.async_send(asio::error::eof, std::move(s2),
+ asio::any_completion_handler<void(asio::error_code)>(
+ [&](asio::error_code ec)
+ {
+ ec2 = ec;
+ }));
+
+ ASIO_CHECK(ec1 == asio::error::would_block);
+ ASIO_CHECK(ec2 == asio::error::would_block);
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s1 == "zyxwvutsrqponmlkjihgfedcba");
+ ASIO_CHECK(!ec2);
+}
+
+ASIO_TEST_SUITE
+(
+ "experimental/channel",
+ ASIO_TEST_CASE(unbuffered_channel_test)
+ ASIO_TEST_CASE(buffered_channel_test)
+ ASIO_TEST_CASE(buffered_error_channel_test)
+ ASIO_TEST_CASE(unbuffered_non_immediate_receive)
+ ASIO_TEST_CASE(unbuffered_immediate_receive)
+ ASIO_TEST_CASE(unbuffered_executor_receive)
+ ASIO_TEST_CASE(unbuffered_non_immediate_send)
+ ASIO_TEST_CASE(unbuffered_immediate_send)
+ ASIO_TEST_CASE(unbuffered_executor_send)
+ ASIO_TEST_CASE(buffered_non_immediate_receive)
+ ASIO_TEST_CASE(buffered_immediate_receive)
+ ASIO_TEST_CASE(buffered_executor_receive)
+ ASIO_TEST_CASE(buffered_non_immediate_send)
+ ASIO_TEST_CASE(buffered_immediate_send)
+ ASIO_TEST_CASE(buffered_executor_send)
+ ASIO_TEST_CASE(try_send_via_dispatch)
+ ASIO_TEST_CASE(try_send_n_via_dispatch)
+ ASIO_TEST_CASE(implicit_error_signature_channel_test)
+ ASIO_TEST_CASE(channel_with_any_completion_handler_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/channel_traits.cpp b/3rdparty/asio/src/tests/unit/experimental/channel_traits.cpp
new file mode 100644
index 00000000000..b1c326f874d
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/channel_traits.cpp
@@ -0,0 +1,25 @@
+//
+// experimental/channel_traits.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/experimental/channel_traits.hpp"
+
+#include "../unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "experimental/channel_traits",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/co_composed.cpp b/3rdparty/asio/src/tests/unit/experimental/co_composed.cpp
new file mode 100644
index 00000000000..755cd46d788
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/co_composed.cpp
@@ -0,0 +1,518 @@
+//
+// experimental/co_composed.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Prevent link dependency on the Boost.System library.
+#if !defined(BOOST_SYSTEM_NO_DEPRECATED)
+#define BOOST_SYSTEM_NO_DEPRECATED
+#endif // !defined(BOOST_SYSTEM_NO_DEPRECATED)
+
+// Test that header file is self-contained.
+#include "asio/experimental/co_composed.hpp"
+
+#include "asio/bind_cancellation_slot.hpp"
+#include "asio/deferred.hpp"
+#include "asio/detached.hpp"
+#include "asio/io_context.hpp"
+#include "asio/post.hpp"
+#include "../unit_test.hpp"
+
+template <typename CompletionToken>
+auto async_throw(CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void()>(
+ [](auto) { throw 42; }, token);
+}
+
+template <typename CompletionToken>
+auto throw_first(CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void()>(
+ asio::experimental::co_composed(
+ [](auto state) -> void
+ {
+ throw 42;
+ co_yield state.complete();
+ }), token);
+}
+
+void test_throw_first()
+{
+ try
+ {
+ throw_first(asio::detached);
+ ASIO_CHECK(0);
+ }
+ catch (int)
+ {
+ }
+}
+
+template <typename CompletionToken>
+auto throw_after_await(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void()>(
+ asio::experimental::co_composed(
+ [](auto state, asio::io_context& ctx) -> void
+ {
+ co_await asio::post(ctx, asio::deferred);
+ throw 42;
+ co_yield state.complete();
+ }), token, std::ref(ctx));
+}
+
+void test_throw_after_await()
+{
+ try
+ {
+ asio::io_context ctx(1);
+ throw_after_await(ctx, asio::detached);
+ ctx.run();
+ ASIO_CHECK(0);
+ }
+ catch (int)
+ {
+ }
+}
+
+template <typename CompletionToken>
+auto throw_in_first_suspend(CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void()>(
+ asio::experimental::co_composed(
+ [](auto state) -> void
+ {
+ co_await async_throw(asio::deferred);
+ co_yield state.complete();
+ }), token);
+}
+
+void test_throw_in_first_suspend()
+{
+ try
+ {
+ throw_in_first_suspend(asio::detached);
+ ASIO_CHECK(0);
+ }
+ catch (int)
+ {
+ }
+}
+
+template <typename CompletionToken>
+auto throw_in_suspend_after_await(
+ asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void()>(
+ asio::experimental::co_composed(
+ [](auto state, asio::io_context& ctx) -> void
+ {
+ co_await asio::post(ctx, asio::deferred);
+ co_await async_throw(asio::deferred);
+ co_yield state.complete();
+ }), token, std::ref(ctx));
+}
+
+void test_throw_in_suspend_after_await()
+{
+ try
+ {
+ asio::io_context ctx(1);
+ throw_in_suspend_after_await(ctx, asio::detached);
+ ctx.run();
+ ASIO_CHECK(0);
+ }
+ catch (int)
+ {
+ }
+}
+
+template <typename CompletionToken>
+auto post_loop(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void(int)>(
+ asio::experimental::co_composed(
+ [](auto state, asio::io_context& ctx) -> void
+ {
+ int i = 0;
+ for (; i < 100; ++i)
+ co_await asio::post(ctx, asio::deferred);
+ co_yield state.complete(i);
+ }, ctx), token, std::ref(ctx));
+}
+
+void test_post_loop()
+{
+ asio::io_context ctx(1);
+ int count = 0;
+ post_loop(ctx, [&](int i){ count = i; });
+ ctx.run();
+ ASIO_CHECK(count == 100);
+}
+
+template <typename CompletionToken>
+auto nested_post(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void()>(
+ asio::experimental::co_composed(
+ [](auto state, asio::io_context& ctx) -> void
+ {
+ co_await asio::post(ctx, asio::deferred);
+ co_yield state.complete();
+ }, ctx), token, std::ref(ctx));
+}
+
+template <typename CompletionToken>
+auto nested_post_loop(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void(int)>(
+ asio::experimental::co_composed(
+ [](auto state, asio::io_context& ctx) -> void
+ {
+ int i = 0;
+ for (; i < 100; ++i)
+ co_await nested_post(ctx, asio::deferred);
+ co_yield state.complete(i);
+ }, ctx), token, std::ref(ctx));
+}
+
+void test_nested_post_loop()
+{
+ asio::io_context ctx(1);
+ int count = 0;
+ nested_post_loop(ctx, [&](int i){ count = i; });
+ ctx.run();
+ ASIO_CHECK(count == 100);
+}
+
+template <typename CompletionToken>
+auto post_loop_return_1_0(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void()>(
+ asio::experimental::co_composed<void()>(
+ [](auto, asio::io_context& ctx) -> void
+ {
+ int i = 0;
+ for (; i < 100; ++i)
+ co_await asio::post(ctx, asio::deferred);
+ co_return {};
+ }, ctx), token, std::ref(ctx));
+}
+
+void test_post_loop_return_1_0()
+{
+ asio::io_context ctx(1);
+ bool done = false;
+ post_loop_return_1_0(ctx, [&]{ done = true; });
+ ctx.run();
+ ASIO_CHECK(done);
+}
+
+template <typename CompletionToken>
+auto post_loop_return_1_1(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void(int)>(
+ asio::experimental::co_composed<void(int)>(
+ [](auto, asio::io_context& ctx) -> void
+ {
+ int i = 0;
+ for (; i < 100; ++i)
+ co_await asio::post(ctx, asio::deferred);
+ co_return {i};
+ }, ctx), token, std::ref(ctx));
+}
+
+void test_post_loop_return_1_1()
+{
+ asio::io_context ctx(1);
+ int count = 0;
+ post_loop_return_1_1(ctx, [&](int i){ count = i; });
+ ctx.run();
+ ASIO_CHECK(count == 100);
+}
+
+template <typename CompletionToken>
+auto post_loop_return_1_2(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void(int, char)>(
+ asio::experimental::co_composed<void(int, char)>(
+ [](auto, asio::io_context& ctx) -> void
+ {
+ int i = 0;
+ for (; i < 100; ++i)
+ co_await asio::post(ctx, asio::deferred);
+ co_return {i, 'A'};
+ }, ctx), token, std::ref(ctx));
+}
+
+void test_post_loop_return_1_2()
+{
+ asio::io_context ctx(1);
+ int count = 0;
+ char ch = 0;
+ post_loop_return_1_2(ctx, [&](int i, char c){ count = i, ch = c; });
+ ctx.run();
+ ASIO_CHECK(count == 100);
+ ASIO_CHECK(ch == 'A');
+}
+
+template <typename CompletionToken>
+auto post_loop_return_2(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<CompletionToken, void(), void(int)>(
+ asio::experimental::co_composed<void(), void(int)>(
+ [](auto, asio::io_context& ctx) -> void
+ {
+ int i = 0;
+ for (; i < 100; ++i)
+ co_await asio::post(ctx, asio::deferred);
+ co_return {i};
+ }, ctx), token, std::ref(ctx));
+}
+
+void test_post_loop_return_2()
+{
+ asio::io_context ctx(1);
+ int count = 0;
+ post_loop_return_2(ctx, [&](int i = 0){ count = i; });
+ ctx.run();
+ ASIO_CHECK(count == 100);
+}
+
+template <typename CompletionToken>
+auto complete_on_cancel(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<
+ CompletionToken, void(asio::error_code, int)>(
+ asio::experimental::co_composed<
+ void(asio::error_code, int)>(
+ [](auto state, asio::io_context& ctx) -> void
+ {
+ state.on_cancellation_complete_with(
+ asio::error::invalid_argument, 42);
+ int i = 0;
+ for (; i < 100; ++i)
+ co_await asio::post(ctx, asio::deferred);
+ co_return {asio::error::eof, i};
+ }, ctx), token, std::ref(ctx));
+}
+
+void test_complete_on_cancel()
+{
+ asio::io_context ctx(1);
+ int count = 0;
+ asio::error_code ec;
+ asio::cancellation_signal cancel;
+
+ complete_on_cancel(ctx,
+ [&](asio::error_code e, int i)
+ {
+ ec = e;
+ count = i;
+ });
+
+ ctx.run();
+
+ ASIO_CHECK(ec == asio::error::eof);
+ ASIO_CHECK(count == 100);
+
+ complete_on_cancel(ctx,
+ asio::bind_cancellation_slot(cancel.slot(),
+ [&](asio::error_code e, int i)
+ {
+ ec = e;
+ count = i;
+ }));
+
+ ctx.restart();
+ ctx.run_one();
+ cancel.emit(asio::cancellation_type::all);
+ ctx.run();
+
+ ASIO_CHECK(ec == asio::error::invalid_argument);
+ ASIO_CHECK(count == 42);
+
+ complete_on_cancel(ctx,
+ asio::bind_cancellation_slot(cancel.slot(),
+ [&](asio::error_code e, int i)
+ {
+ ec = e;
+ count = i;
+ }));
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(ec == asio::error::eof);
+ ASIO_CHECK(count == 100);
+}
+
+template <typename CompletionToken>
+auto complete_with_default_on_cancel(
+ asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<
+ CompletionToken, void(asio::error_code, int)>(
+ asio::experimental::co_composed<
+ void(asio::error_code, int)>(
+ [](auto, asio::io_context& ctx) -> void
+ {
+ int i = 0;
+ for (; i < 100; ++i)
+ co_await asio::post(ctx, asio::deferred);
+ co_return {asio::error::eof, i};
+ }, ctx), token, std::ref(ctx));
+}
+
+void test_complete_with_default_on_cancel()
+{
+ asio::io_context ctx(1);
+ int count = 0;
+ asio::error_code ec;
+ asio::cancellation_signal cancel;
+
+ complete_with_default_on_cancel(ctx,
+ [&](asio::error_code e, int i)
+ {
+ ec = e;
+ count = i;
+ });
+
+ ctx.run();
+
+ ASIO_CHECK(ec == asio::error::eof);
+ ASIO_CHECK(count == 100);
+
+ complete_with_default_on_cancel(ctx,
+ asio::bind_cancellation_slot(cancel.slot(),
+ [&](asio::error_code e, int i)
+ {
+ ec = e;
+ count = i;
+ }));
+
+ ctx.restart();
+ ctx.run_one();
+ cancel.emit(asio::cancellation_type::all);
+ ctx.run();
+
+ ASIO_CHECK(ec == asio::error::operation_aborted);
+ ASIO_CHECK(count == 0);
+
+ complete_with_default_on_cancel(ctx,
+ asio::bind_cancellation_slot(cancel.slot(),
+ [&](asio::error_code e, int i)
+ {
+ ec = e;
+ count = i;
+ }));
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(ec == asio::error::eof);
+ ASIO_CHECK(count == 100);
+}
+
+template <typename CompletionToken>
+auto throw_on_cancel(asio::io_context& ctx, CompletionToken&& token)
+{
+ return asio::async_initiate<
+ CompletionToken, void(asio::error_code, int)>(
+ asio::experimental::co_composed<
+ void(asio::error_code, int)>(
+ [](auto state, asio::io_context& ctx) -> void
+ {
+ try
+ {
+ state.throw_if_cancelled(true);
+ int i = 0;
+ for (; i < 100; ++i)
+ co_await asio::post(ctx, asio::deferred);
+ co_return {asio::error::eof, i};
+ }
+ catch (...)
+ {
+ co_return {asio::error::invalid_argument, 42};
+ }
+ }, ctx), token, std::ref(ctx));
+}
+
+void test_throw_on_cancel()
+{
+ asio::io_context ctx(1);
+ int count = 0;
+ asio::error_code ec;
+ asio::cancellation_signal cancel;
+
+ throw_on_cancel(ctx,
+ [&](asio::error_code e, int i)
+ {
+ ec = e;
+ count = i;
+ });
+
+ ctx.run();
+
+ ASIO_CHECK(ec == asio::error::eof);
+ ASIO_CHECK(count == 100);
+
+ throw_on_cancel(ctx,
+ asio::bind_cancellation_slot(cancel.slot(),
+ [&](asio::error_code e, int i)
+ {
+ ec = e;
+ count = i;
+ }));
+
+ ctx.restart();
+ ctx.run_one();
+ cancel.emit(asio::cancellation_type::all);
+ ctx.run();
+
+ ASIO_CHECK(ec == asio::error::invalid_argument);
+ ASIO_CHECK(count == 42);
+
+ throw_on_cancel(ctx,
+ asio::bind_cancellation_slot(cancel.slot(),
+ [&](asio::error_code e, int i)
+ {
+ ec = e;
+ count = i;
+ }));
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(ec == asio::error::eof);
+ ASIO_CHECK(count == 100);
+}
+
+ASIO_TEST_SUITE
+(
+ "experimental/co_composed",
+ ASIO_TEST_CASE(test_throw_first)
+ ASIO_TEST_CASE(test_throw_after_await)
+ ASIO_TEST_CASE(test_throw_in_first_suspend)
+ ASIO_TEST_CASE(test_throw_in_suspend_after_await)
+ ASIO_TEST_CASE(test_post_loop)
+ ASIO_TEST_CASE(test_nested_post_loop)
+ ASIO_TEST_CASE(test_post_loop_return_1_0)
+ ASIO_TEST_CASE(test_post_loop_return_1_1)
+ ASIO_TEST_CASE(test_post_loop_return_1_2)
+ ASIO_TEST_CASE(test_post_loop_return_2)
+ ASIO_TEST_CASE(test_complete_on_cancel)
+ ASIO_TEST_CASE(test_complete_with_default_on_cancel)
+ ASIO_TEST_CASE(test_throw_on_cancel)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/concurrent_channel.cpp b/3rdparty/asio/src/tests/unit/experimental/concurrent_channel.cpp
new file mode 100644
index 00000000000..e64e9051638
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/concurrent_channel.cpp
@@ -0,0 +1,165 @@
+//
+// experimental/concurrent_channel.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/experimental/concurrent_channel.hpp"
+
+#include <utility>
+#include "asio/error.hpp"
+#include "asio/io_context.hpp"
+#include "../unit_test.hpp"
+
+using namespace asio;
+using namespace asio::experimental;
+
+void unbuffered_concurrent_channel_test()
+{
+ io_context ctx;
+
+ concurrent_channel<void(asio::error_code, std::string)> ch1(ctx);
+
+ ASIO_CHECK(ch1.is_open());
+ ASIO_CHECK(!ch1.ready());
+
+ bool b1 = ch1.try_send(asio::error::eof, "hello");
+
+ ASIO_CHECK(!b1);
+
+ std::string s1 = "abcdefghijklmnopqrstuvwxyz";
+ bool b2 = ch1.try_send(asio::error::eof, std::move(s1));
+
+ ASIO_CHECK(!b2);
+ ASIO_CHECK(!s1.empty());
+
+ asio::error_code ec1;
+ std::string s2;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s2 = std::move(s);
+ });
+
+ bool b3 = ch1.try_send(asio::error::eof, std::move(s1));
+
+ ASIO_CHECK(b3);
+ ASIO_CHECK(s1.empty());
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s2 == "abcdefghijklmnopqrstuvwxyz");
+
+ bool b4 = ch1.try_receive([](asio::error_code, std::string){});
+
+ ASIO_CHECK(!b4);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s3 = "zyxwvutsrqponmlkjihgfedcba";
+ ch1.async_send(asio::error::eof, std::move(s3),
+ [&](asio::error_code ec)
+ {
+ ec2 = ec;
+ });
+
+ asio::error_code ec3;
+ std::string s4;
+ bool b5 = ch1.try_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec3 = ec;
+ s4 = s;
+ });
+
+ ASIO_CHECK(b5);
+ ASIO_CHECK(ec3 == asio::error::eof);
+ ASIO_CHECK(s4 == "zyxwvutsrqponmlkjihgfedcba");
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(!ec2);
+};
+
+void buffered_concurrent_channel_test()
+{
+ io_context ctx;
+
+ concurrent_channel<void(asio::error_code, std::string)> ch1(ctx, 1);
+
+ ASIO_CHECK(ch1.is_open());
+ ASIO_CHECK(!ch1.ready());
+
+ bool b1 = ch1.try_send(asio::error::eof, "hello");
+
+ ASIO_CHECK(b1);
+
+ std::string s1 = "abcdefghijklmnopqrstuvwxyz";
+ bool b2 = ch1.try_send(asio::error::eof, std::move(s1));
+
+ ASIO_CHECK(!b2);
+ ASIO_CHECK(!s1.empty());
+
+ asio::error_code ec1;
+ std::string s2;
+ ch1.async_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec1 = ec;
+ s2 = std::move(s);
+ });
+
+ ctx.run();
+
+ ASIO_CHECK(ec1 == asio::error::eof);
+ ASIO_CHECK(s2 == "hello");
+
+ bool b4 = ch1.try_receive([](asio::error_code, std::string){});
+
+ ASIO_CHECK(!b4);
+
+ asio::error_code ec2 = asio::error::would_block;
+ std::string s3 = "zyxwvutsrqponmlkjihgfedcba";
+ ch1.async_send(asio::error::eof, std::move(s3),
+ [&](asio::error_code ec)
+ {
+ ec2 = ec;
+ });
+
+ asio::error_code ec3;
+ std::string s4;
+ bool b5 = ch1.try_receive(
+ [&](asio::error_code ec, std::string s)
+ {
+ ec3 = ec;
+ s4 = s;
+ });
+
+ ASIO_CHECK(b5);
+ ASIO_CHECK(ec3 == asio::error::eof);
+ ASIO_CHECK(s4 == "zyxwvutsrqponmlkjihgfedcba");
+
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(!ec2);
+};
+
+ASIO_TEST_SUITE
+(
+ "experimental/concurrent_channel",
+ ASIO_TEST_CASE(unbuffered_concurrent_channel_test)
+ ASIO_TEST_CASE(buffered_concurrent_channel_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/coro/allocator.cpp b/3rdparty/asio/src/tests/unit/experimental/coro/allocator.cpp
new file mode 100644
index 00000000000..845906df853
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/coro/allocator.cpp
@@ -0,0 +1,113 @@
+//
+// experimental/coro/partial.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/experimental/coro.hpp"
+
+#include <vector>
+#include "asio/io_context.hpp"
+#include "../../unit_test.hpp"
+
+namespace exp = asio::experimental;
+
+namespace coro {
+
+template<typename Value = void>
+struct tracked_allocator
+{
+ using value_type = Value;
+ std::vector<std::pair<void*, std::size_t>> & allocs, &deallocs;
+
+ tracked_allocator(std::vector<std::pair<void*, std::size_t>> & allocs,
+ std::vector<std::pair<void*, std::size_t>> & deallocs) : allocs(allocs), deallocs(deallocs) {}
+
+
+ template<typename T>
+ tracked_allocator(const tracked_allocator<T> & a) : allocs(a.allocs), deallocs(a.deallocs) {}
+
+ value_type* allocate(std::size_t n)
+ {
+ auto p = new char[n * sizeof(Value)];
+ allocs.emplace_back(p, n);
+ return reinterpret_cast<value_type*>(p);
+ }
+
+ void deallocate(void* p, std::size_t n)
+ {
+ deallocs.emplace_back(p, n);
+ delete[] static_cast<char*>(p);
+// ASIO_CHECK(allocs.back() == deallocs.back());
+ }
+
+ bool operator==(const tracked_allocator & rhs) const
+ {
+ return &allocs == &rhs.allocs
+ && &deallocs == &rhs.deallocs;
+ }
+};
+
+exp::coro<void, void, asio::any_io_executor, tracked_allocator<void>>
+ alloc_test_impl(asio::io_context & ctx, int, std::allocator_arg_t, tracked_allocator<void> ta, double)
+{
+ co_return ;
+}
+
+void alloc_test()
+{
+ std::vector<std::pair<void*, std::size_t>> allocs, deallocs;
+ asio::io_context ctx;
+ bool ran = false;
+
+ {
+ auto pp = alloc_test_impl(ctx, 42, std::allocator_arg, {allocs, deallocs}, 42.);
+
+ ASIO_CHECK(allocs.size() == 1u);
+ ASIO_CHECK(deallocs.empty());
+
+ pp.async_resume([&](auto e){ran = true; ASIO_CHECK(!e);});
+ ctx.run();
+ ASIO_CHECK(deallocs.size() == 0u);
+ }
+ ctx.restart();
+ ctx.run();
+ ASIO_CHECK(deallocs.size() == 1u);
+ ASIO_CHECK(allocs == deallocs);
+
+ ASIO_CHECK(ran);
+
+ ran = false;
+
+ auto p = asio::experimental::detail::post_coroutine(
+ ctx,
+ asio::bind_allocator(tracked_allocator{allocs, deallocs}, [&]{ran = true;})).handle;
+ ASIO_CHECK(allocs.size() == 2u);
+ ASIO_CHECK(deallocs.size() == 1u);
+ p.resume();
+ ASIO_CHECK(allocs.size() == 3u);
+ ASIO_CHECK(deallocs.size() == 2u);
+ ctx.restart();
+ ctx.run();
+
+ ASIO_CHECK(allocs == deallocs);
+}
+
+} // namespace coro
+
+ASIO_TEST_SUITE
+(
+ "coro/allocate",
+ ASIO_TEST_CASE(::coro::alloc_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/coro/cancel.cpp b/3rdparty/asio/src/tests/unit/experimental/coro/cancel.cpp
index 4f99ebd580d..38cf1067908 100644
--- a/3rdparty/asio/src/tests/unit/experimental/coro/cancel.cpp
+++ b/3rdparty/asio/src/tests/unit/experimental/coro/cancel.cpp
@@ -2,8 +2,8 @@
// experimental/coro/cancel.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -17,10 +17,10 @@
// Test that header file is self-contained.
#include "asio/experimental/coro.hpp"
#include <iostream>
+#include "asio/bind_cancellation_slot.hpp"
#include "asio/io_context.hpp"
#include "asio/steady_timer.hpp"
#include "asio/this_coro.hpp"
-#include <boost/scope_exit.hpp>
#include "../../unit_test.hpp"
using namespace asio::experimental;
@@ -32,6 +32,9 @@ namespace coro {
auto coro_simple_cancel_impl(asio::io_context& ) noexcept
-> asio::experimental::coro<void() noexcept, asio::error_code>
{
+ ASIO_CHECK(
+ !(co_await this_coro::cancellation_state).cancelled());
+
asio::steady_timer timer{
co_await this_coro::executor,
std::chrono::seconds(1)};
@@ -50,12 +53,15 @@ auto coro_simple_cancel_impl(asio::io_context& ) noexcept
void coro_simple_cancel()
{
asio::io_context ctx;
+ asio::cancellation_signal sig;
auto k = coro_simple_cancel_impl(ctx);
asio::error_code res_ec;
- k.async_resume([&](asio::error_code ec) {res_ec = ec;});
- asio::post(ctx, [&]{k.cancel();});
+ k.async_resume(
+ asio::bind_cancellation_slot(sig.slot(),
+ [&](asio::error_code ec) {res_ec = ec;}));
+ asio::post(ctx, [&]{sig.emit(asio::cancellation_type::all);});
ASIO_CHECK(!res_ec);
@@ -76,12 +82,15 @@ auto coro_throw_cancel_impl(asio::io_context& )
void coro_throw_cancel()
{
asio::io_context ctx;
+ asio::cancellation_signal sig;
auto k = coro_throw_cancel_impl(ctx);
std::exception_ptr res_ex;
- k.async_resume([&](std::exception_ptr ex) {res_ex = ex;});
- asio::post(ctx, [&]{k.cancel();});
+ k.async_resume(
+ asio::bind_cancellation_slot(sig.slot(),
+ [&](std::exception_ptr ex) {res_ex = ex;}));
+ asio::post(ctx, [&]{sig.emit(asio::cancellation_type::all);});
ASIO_CHECK(!res_ex);
@@ -90,7 +99,8 @@ void coro_throw_cancel()
ASIO_CHECK(res_ex);
try
{
- std::rethrow_exception(res_ex);
+ if (res_ex)
+ std::rethrow_exception(res_ex);
}
catch (asio::system_error& se)
{
@@ -132,21 +142,26 @@ auto coro_simple_cancel_nested_kouter(
void coro_simple_cancel_nested()
{
asio::io_context ctx;
+ asio::cancellation_signal sig;
int cnt = 0;
auto kouter = coro_simple_cancel_nested_kouter(ctx, cnt);
asio::error_code res_ec;
- kouter.async_resume([&](asio::error_code ec) {res_ec = ec;});
- asio::post(ctx, [&]{kouter.cancel();});
+ kouter.async_resume(
+ asio::bind_cancellation_slot(sig.slot(),
+ [&](asio::error_code ec) {res_ec = ec;}));
+ asio::post(ctx, [&]{sig.emit(asio::cancellation_type::all);});
ASIO_CHECK(!res_ec);
ctx.run();
ASIO_CHECK(res_ec == asio::error::operation_aborted);
ctx.restart();
res_ec = {};
- kouter.async_resume([&](asio::error_code ec) {res_ec = ec;});
- asio::post(ctx, [&]{kouter.cancel();});
+ kouter.async_resume(
+ asio::bind_cancellation_slot(sig.slot(),
+ [&](asio::error_code ec) {res_ec = ec;}));
+ asio::post(ctx, [&]{sig.emit(asio::cancellation_type::all);});
ASIO_CHECK(!res_ec);
ctx.run();
ASIO_CHECK(res_ec == asio::error::operation_aborted);
diff --git a/3rdparty/asio/src/tests/unit/experimental/coro/co_spawn.cpp b/3rdparty/asio/src/tests/unit/experimental/coro/co_spawn.cpp
new file mode 100644
index 00000000000..8e6586252f2
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/coro/co_spawn.cpp
@@ -0,0 +1,67 @@
+//
+// experimental/coro/co_spawn.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/experimental/co_spawn.hpp"
+
+#include <iostream>
+#include "asio/io_context.hpp"
+#include "asio/steady_timer.hpp"
+#include "asio/this_coro.hpp"
+#include "../../unit_test.hpp"
+
+using namespace asio::experimental;
+namespace this_coro = asio::this_coro;
+
+namespace coro {
+
+auto coro_simple_co_spawn_impl(asio::io_context& , bool &done) noexcept
+ -> asio::experimental::coro<void() noexcept, int>
+{
+ asio::steady_timer timer(
+ co_await this_coro::executor,
+ std::chrono::milliseconds(10));
+
+ done = true;
+
+ co_return 42;
+}
+
+void coro_co_spawn()
+{
+ asio::io_context ctx;
+
+ bool done1 = false;
+ bool done2 = false;
+ int res = 0;
+
+ co_spawn(coro_simple_co_spawn_impl(ctx, done1),
+ [&](int r){done2= true; res = r;});
+
+ ctx.run();
+
+ ASIO_CHECK(done1);
+ ASIO_CHECK(done2);
+ ASIO_CHECK(res == 42);
+}
+
+} // namespace coro
+
+ASIO_TEST_SUITE
+(
+ "coro/co_spawn",
+ ASIO_TEST_CASE(::coro::coro_co_spawn)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/coro/exception.cpp b/3rdparty/asio/src/tests/unit/experimental/coro/exception.cpp
index 49a91dc32e2..f4d782e9903 100644
--- a/3rdparty/asio/src/tests/unit/experimental/coro/exception.cpp
+++ b/3rdparty/asio/src/tests/unit/experimental/coro/exception.cpp
@@ -2,8 +2,8 @@
// experimental/coro/exception.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -109,6 +109,8 @@ asio::experimental::coro<int(int)> throwing_stacked(
asio::any_io_executor exec, int &val,
bool &destroyed_inner, bool &destroyed)
{
+ ASIO_CHECK((co_await asio::this_coro::throw_if_cancelled()));
+
on_scope_exit x = [&]() noexcept { destroyed = true; };
(void)x;
diff --git a/3rdparty/asio/src/tests/unit/experimental/coro/executor.cpp b/3rdparty/asio/src/tests/unit/experimental/coro/executor.cpp
new file mode 100644
index 00000000000..e0893da2e50
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/coro/executor.cpp
@@ -0,0 +1,116 @@
+//
+// experimental/coro/executor.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/experimental/coro.hpp"
+
+#include "asio/thread_pool.hpp"
+#include "asio/io_context.hpp"
+#include "../../unit_test.hpp"
+
+using namespace asio::experimental;
+
+namespace coro {
+
+#define ASIO_CHECKPOINT() \
+ ASIO_TEST_IOSTREAM << __FILE__ << "(" << __LINE__ << "): " \
+ << asio::detail::test_name() << ": " \
+ << "Checkpoint" << std::endl;
+
+template <typename T>
+void different_execs()
+{
+ asio::thread_pool th_ctx{1u};
+ asio::io_context ctx;
+
+ auto o = std::make_optional(
+ asio::prefer(th_ctx.get_executor(),
+ asio::execution::outstanding_work.tracked));
+
+ static bool ran_inner = false, ran_outer = false;
+
+ struct c_inner_t
+ {
+ auto operator()(asio::any_io_executor e) -> asio::experimental::coro<T>
+ {
+ auto p = e.target<asio::thread_pool::executor_type>();
+ ASIO_CHECKPOINT();
+ ASIO_CHECK(p);
+ ASIO_CHECK(p->running_in_this_thread());
+ ran_inner = true;
+ co_return;
+ };
+
+ };
+
+ c_inner_t c_inner;
+
+ struct c_outer_t
+ {
+
+ auto operator()(asio::any_io_executor e, int,
+ asio::experimental::coro<T> tp)
+ -> asio::experimental::coro<void>
+ {
+ auto p = e.target<asio::io_context::executor_type>();
+
+ ASIO_CHECK(p);
+ ASIO_CHECK(p->running_in_this_thread());
+ ASIO_CHECKPOINT();
+
+ co_await tp;
+
+ ASIO_CHECKPOINT();
+ ASIO_CHECK(p->running_in_this_thread());
+
+ ran_outer = true;
+ };
+ };
+
+ c_outer_t c_outer;
+
+ bool ran = false;
+ std::exception_ptr ex;
+
+ auto c = c_outer(ctx.get_executor(), 10, c_inner(th_ctx.get_executor()));
+ c.async_resume(
+ [&](std::exception_ptr e)
+ {
+ ASIO_CHECK(!e);
+ ASIO_CHECKPOINT();
+ ran = true;
+ });
+
+ ASIO_CHECK(!ran);
+ ctx.run();
+ o.reset();
+ ASIO_CHECK(ran);
+ ASIO_CHECK(ran_inner);
+ ASIO_CHECK(ran_outer);
+ ASIO_CHECK(!ex);
+
+ th_ctx.stop();
+ th_ctx.join();
+}
+
+} // namespace coro
+
+ASIO_TEST_SUITE
+(
+ "coro/partial",
+ ASIO_TEST_CASE(::coro::different_execs<void>)
+ ASIO_TEST_CASE(::coro::different_execs<int()>)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/coro/partial.cpp b/3rdparty/asio/src/tests/unit/experimental/coro/partial.cpp
index 6a615a47461..651b8292204 100644
--- a/3rdparty/asio/src/tests/unit/experimental/coro/partial.cpp
+++ b/3rdparty/asio/src/tests/unit/experimental/coro/partial.cpp
@@ -2,8 +2,8 @@
// experimental/coro/partial.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -28,7 +28,7 @@ void partial()
{
asio::io_context ctx;
bool ran = false;
- auto p = detail::post_coroutine(ctx, [&]{ran = true;});
+ auto p = detail::post_coroutine(ctx, [&]{ran = true;}).handle;
ASIO_CHECK(!ran);
p.resume();
ASIO_CHECK(!ran);
diff --git a/3rdparty/asio/src/tests/unit/experimental/coro/simple_test.cpp b/3rdparty/asio/src/tests/unit/experimental/coro/simple_test.cpp
index 92eecd1d95a..5eac0688548 100644
--- a/3rdparty/asio/src/tests/unit/experimental/coro/simple_test.cpp
+++ b/3rdparty/asio/src/tests/unit/experimental/coro/simple_test.cpp
@@ -2,8 +2,8 @@
// experimental/coro/simple_test.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/experimental/coro/stack_test.cpp b/3rdparty/asio/src/tests/unit/experimental/coro/stack_test.cpp
index 8b06587028e..9177161afcf 100644
--- a/3rdparty/asio/src/tests/unit/experimental/coro/stack_test.cpp
+++ b/3rdparty/asio/src/tests/unit/experimental/coro/stack_test.cpp
@@ -2,8 +2,8 @@
// experimental/coro/stack_test.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/experimental/coro/use_coro.cpp b/3rdparty/asio/src/tests/unit/experimental/coro/use_coro.cpp
index e8d13afeacf..f2cb7adfcdd 100644
--- a/3rdparty/asio/src/tests/unit/experimental/coro/use_coro.cpp
+++ b/3rdparty/asio/src/tests/unit/experimental/coro/use_coro.cpp
@@ -2,8 +2,8 @@
// experimental/coro/use_coro.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -37,7 +37,7 @@ asio::experimental::coro<void() noexcept, int>
awaiter_noexcept(asio::any_io_executor exec)
{
asio::steady_timer timer{exec};
- auto ec = co_await timer.async_wait(use_coro);
+ auto ec = co_await timer.async_wait(asio::deferred);
ASIO_CHECK(ec == asio::error_code{});
co_return 42;
}
diff --git a/3rdparty/asio/src/tests/unit/experimental/parallel_group.cpp b/3rdparty/asio/src/tests/unit/experimental/parallel_group.cpp
new file mode 100644
index 00000000000..c91c95f157d
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/experimental/parallel_group.cpp
@@ -0,0 +1,25 @@
+//
+// experimental/parallel_group.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/experimental/parallel_group.hpp"
+
+#include "../unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "experimental/parallel_group",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/experimental/promise.cpp b/3rdparty/asio/src/tests/unit/experimental/promise.cpp
index 540cae2008b..67923a4c726 100644
--- a/3rdparty/asio/src/tests/unit/experimental/promise.cpp
+++ b/3rdparty/asio/src/tests/unit/experimental/promise.cpp
@@ -2,8 +2,8 @@
// promise.cpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2021 Klemens D. Morgenstern
-// (klemens dot morgenstern at gmx dot net)
+// Copyright (c) 2021-2023 Klemens D. Morgenstern
+// (klemens dot morgenstern at gmx dot net)
//
// 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)
@@ -17,6 +17,11 @@
// Test that header file is self-contained.
#include "asio/experimental/promise.hpp"
+#include "asio/append.hpp"
+#include "asio/bind_cancellation_slot.hpp"
+#include "asio/compose.hpp"
+#include "asio/deferred.hpp"
+#include "asio/experimental/use_promise.hpp"
#include "asio/steady_timer.hpp"
#include "../unit_test.hpp"
@@ -25,7 +30,6 @@ namespace promise {
void promise_tester()
{
using namespace asio;
- using asio::error_code;
using namespace std::chrono;
io_context ctx;
@@ -33,16 +37,15 @@ void promise_tester()
steady_timer timer1{ctx}, timer2{ctx};
const auto started_when = steady_clock::now();
- timer1.expires_at(started_when + milliseconds(2000));
+ timer1.expires_at(started_when + milliseconds(5000));
timer2.expires_at(started_when + milliseconds(1000));
- auto p = timer1.async_wait(experimental::use_promise);
+ auto p1 = timer1.async_wait(experimental::use_promise);
steady_clock::time_point completed_when;
- error_code ec;
+ asio::error_code ec;
bool called = false;
- p.async_wait(
- [&](auto ec_)
+ p1([&](asio::error_code ec_)
{
ec = ec_;
called = true;
@@ -50,271 +53,174 @@ void promise_tester()
});
steady_clock::time_point timer2_done;
- timer2.async_wait([&](auto) {
- timer2_done = steady_clock::now();;
- p.cancel();
- });
+ timer2.async_wait(
+ [&](asio::error_code)
+ {
+ timer2_done = steady_clock::now();
+ p1.cancel();
+ });
ctx.run();
- ASIO_CHECK(timer2_done + milliseconds(1) > completed_when);
+ static_assert(
+ asio::is_async_operation<decltype(p1)>::value,
+ "promise is async_op");
+
+ ASIO_CHECK(timer2_done + milliseconds(1) > started_when);
+ ASIO_CHECK(completed_when > timer2_done);
ASIO_CHECK(called);
ASIO_CHECK(ec == error::operation_aborted);
-}
-void promise_race_tester()
-{
- using namespace asio;
- using asio::error_code;
- using namespace std::chrono;
-
- io_context ctx;
+ timer1.expires_after(milliseconds(0));
+ auto p2 = timer1.async_wait(
+ asio::append(experimental::use_promise, 123));
- steady_timer timer1{ctx}, timer2{ctx};
+ ec = asio::error::would_block;
+ called = false;
- const auto started_when = steady_clock::now();
- timer1.expires_at(started_when + milliseconds(2000));
- timer2.expires_at(started_when + milliseconds(1000));
-
- experimental::promise<void(std::variant<error_code, error_code>)> p =
- experimental::promise<>::race(
- timer1.async_wait(experimental::use_promise),
- timer2.async_wait(experimental::use_promise));
-
- auto called = false;
- error_code ec;
- steady_clock::time_point completed_when;
- p.async_wait(
- [&](auto v)
+ p2([&](asio::error_code ec_, int i)
{
- ASIO_CHECK(v.index() == 1);
- ec = get<1>(v);
+ ASIO_CHECK(i == 123);
+ ec = ec_;
called = true;
- completed_when = steady_clock::now();
});
+ ASIO_CHECK(ec == asio::error::would_block);
+ ASIO_CHECK(!called);
+
+ ctx.restart();
ctx.run();
- ASIO_CHECK(started_when + milliseconds(1000) <= completed_when);
- ASIO_CHECK(started_when + milliseconds(1500) > completed_when);
- ASIO_CHECK(called);
+ static_assert(
+ asio::is_async_operation<decltype(p2)>::value,
+ "promise is async_op");
+
ASIO_CHECK(!ec);
+ ASIO_CHECK(called);
}
-void promise_all_tester()
+void promise_slot_tester()
{
using namespace asio;
- using asio::error_code;
using namespace std::chrono;
io_context ctx;
- steady_timer timer1{ctx},
- timer2{ctx};
+ steady_timer timer1{ctx}, timer2{ctx};
const auto started_when = steady_clock::now();
- timer1.expires_at(started_when + milliseconds(2000));
+ timer1.expires_at(started_when + milliseconds(2500));
timer2.expires_at(started_when + milliseconds(1000));
+ auto p = timer1.async_wait(experimental::use_promise);
- experimental::promise<void(error_code, error_code)> p =
- experimental::promise<>::all(
- timer1.async_wait(experimental::use_promise),
- timer2.async_wait(experimental::use_promise));
-
- bool called = false;
steady_clock::time_point completed_when;
+ asio::error_code ec;
+ bool called = false;
- p.async_wait(
- [&](auto ec1, auto ec2)
- {
- ASIO_CHECK(!ec1);
- ASIO_CHECK(!ec2);
- called = true;
- completed_when = steady_clock::now();
- });
-
- ctx.run();
-
- ASIO_CHECK(started_when + milliseconds(2000) <= completed_when);
- ASIO_CHECK(started_when + milliseconds(2500) > completed_when);
- ASIO_CHECK(called);
-}
-
-void promise_race_ranged_tester()
-{
- using namespace asio;
- using asio::error_code;
- using namespace std::chrono;
-
- io_context ctx;
-
- steady_timer timer1{ctx}, timer2{ctx};
+ asio::cancellation_signal sig;
- const auto started_when = steady_clock::now();
- timer1.expires_at(started_when + milliseconds(2000));
- timer2.expires_at(started_when + milliseconds(1000));
+ p(asio::bind_cancellation_slot(
+ sig.slot(),
+ [&](asio::error_code ec_)
+ {
+ ec = ec_;
+ called = true;
+ completed_when = steady_clock::now();
+ }));
- // promise<
- // std::variant<
- // tuple<error_code, std::size_t>,
- // tuple<error_code, std::size_t>>>
- experimental::promise<void(std::size_t, error_code)> p =
- experimental::promise<>::race(
- std::array{
- timer1.async_wait(experimental::use_promise),
- timer2.async_wait(experimental::use_promise)
- });
-
- auto called = false;
- auto completed_when = steady_clock::time_point();
-
- p.async_wait([&](auto idx, auto ec )
+ steady_clock::time_point timer2_done;
+ timer2.async_wait(
+ [&](asio::error_code)
{
- ASIO_CHECK(idx == 1);
- called = true;
- completed_when = steady_clock::now();
- ASIO_CHECK(!ec);
+ timer2_done = steady_clock::now();
+ sig.emit(asio::cancellation_type::all);
});
- std::array<experimental::promise<void()>, 0u> arr;
-
- experimental::promise<>::race(
- ctx.get_executor(), std::move(arr)
- ).async_wait(
- [](std::size_t idx) {ASIO_CHECK(idx == std::size_t(-1));}
- );
-
ctx.run();
- ASIO_CHECK(started_when + milliseconds(1000) <= completed_when);
- ASIO_CHECK(started_when + milliseconds(1500) > completed_when);
- ASIO_CHECK(called);
-
- std::exception_ptr ex;
-
- try
- {
- experimental::promise<>::race(std::move(arr));
- }
- catch (...)
- {
- ex = std::current_exception();
- }
+ static_assert(
+ asio::is_async_operation<decltype(p)>::value,
+ "promise is async_op");
- ASIO_CHECK(ex);
+ ASIO_CHECK(timer2_done + milliseconds(1) > started_when);
+ ASIO_CHECK(completed_when > timer2_done);
+ ASIO_CHECK(called);
+ ASIO_CHECK(ec == error::operation_aborted);
}
-void promise_all_ranged_tester()
+void early_completion()
{
using namespace asio;
- using asio::error_code;
using namespace std::chrono;
io_context ctx;
+ auto p = asio::post(ctx, asio::experimental::use_promise);
+ ctx.run();
- steady_timer timer1{ctx}, timer2{ctx};
-
- const auto started_when = steady_clock::now();
- timer1.expires_at(started_when + milliseconds(2000));
- timer2.expires_at(started_when + milliseconds(1000));
-
- // promise<
- // std::variant<
- // tuple<error_code, std::size_t>,
- // tuple<error_code, std::size_t>>>
- experimental::promise<void(std::vector<error_code>)> p =
- experimental::promise<>::all(
- std::array{
- timer1.async_wait(experimental::use_promise),
- timer2.async_wait(experimental::use_promise)
- });
-
- auto called = false;
- auto completed_when = steady_clock::time_point();
-
- p.async_wait(
- [&](auto v){
- ASIO_CHECK(v.size() == 2u);
- completed_when = steady_clock::now();
- ASIO_CHECK(!v[0]);
- ASIO_CHECK(!v[1]);
- called = true;
- });
-
- std::array<experimental::promise<void()>, 0u> arr;
- experimental::promise<>::all(
- ctx.get_executor(), std::move(arr)
- ).async_wait(
- [](auto v) {ASIO_CHECK(v.size() == 0);}
- );
+ ASIO_CHECK(p.completed());
+ bool completed = false;
+ p([&]{completed = true;});
+ ASIO_CHECK(!completed);
+ ctx.restart();
ctx.run();
+ ASIO_CHECK(completed);
+}
- ASIO_CHECK(started_when + milliseconds(2000) <= completed_when);
- ASIO_CHECK(started_when + milliseconds(2500) > completed_when);
- ASIO_CHECK(called == true);
-
- std::exception_ptr ex;
- try
+struct test_cancel_impl_op
+{
+ asio::steady_timer & tim;
+ asio::error_code &ec;
+ template<typename Self>
+ void operator()(Self& self)
{
- experimental::promise<>::all(std::move(arr));
+ tim.async_wait(std::forward<Self>(self));
}
- catch (...)
+
+ template<typename Self>
+ void operator()(Self& self, asio::error_code ec_)
{
- ex = std::current_exception();
+ ec = ec_;
+ self.complete(ec_);
}
-
- ASIO_CHECK(ex);
+};
+
+template <typename CompletionToken>
+ASIO_INITFN_AUTO_RESULT_TYPE(
+ CompletionToken, void(asio::error_code))
+test_cancel_impl(asio::steady_timer & tim,
+ asio::error_code &ec,
+ CompletionToken&& token)
+{
+ return asio::async_compose<CompletionToken, void(asio::error_code)>(
+ test_cancel_impl_op{tim, ec}, token, tim);
}
-void promise_cancel_tester()
+void test_cancel()
{
- using namespace asio;
- using asio::error_code;
- using namespace std::chrono;
-
- io_context ctx;
-
- steady_timer timer1{ctx}, timer2{ctx};
+ asio::io_context ctx;
+ asio::steady_timer tim{ctx, std::chrono::seconds(10)};
+ asio::error_code ec;
- const auto started_when = steady_clock::now();
- timer1.expires_at(started_when + milliseconds(2000));
- timer2.expires_at(started_when + milliseconds(1000));
-
- // promise<
- // std::variant<
- // tuple<error_code, std::size_t>,
- // tuple<error_code, std::size_t>>>
- experimental::promise<void(error_code, error_code)> p =
- experimental::promise<>::all(
- timer1.async_wait(experimental::use_promise),
- timer2.async_wait(experimental::use_promise));
-
- bool called = false;
- p.async_wait(
- [&](auto ec1, auto ec2)
- {
- called = true;
- ASIO_CHECK(ec1 == error::operation_aborted);
- ASIO_CHECK(ec2 == error::operation_aborted);
- });
-
- post(ctx, [&]{p.cancel();});
+ {
+ auto p = test_cancel_impl(
+ tim, ec, asio::experimental::use_promise);
+ }
ctx.run();
- ASIO_CHECK(called);
+ ASIO_CHECK_MESSAGE(
+ ec == asio::error::operation_aborted,
+ ec.message());
}
} // namespace promise
ASIO_TEST_SUITE
(
- "promise",
- ASIO_TEST_CASE(promise::promise_tester)
- ASIO_TEST_CASE(promise::promise_race_tester)
- ASIO_TEST_CASE(promise::promise_all_tester)
- ASIO_TEST_CASE(promise::promise_race_ranged_tester)
- ASIO_TEST_CASE(promise::promise_all_ranged_tester)
- ASIO_TEST_CASE(promise::promise_cancel_tester)
+ "promise",
+ ASIO_TEST_CASE(promise::promise_tester)
+ ASIO_TEST_CASE(promise::promise_slot_tester)
+ ASIO_TEST_CASE(promise::early_completion)
+ ASIO_TEST_CASE(promise::test_cancel)
)
diff --git a/3rdparty/asio/src/tests/unit/file_base.cpp b/3rdparty/asio/src/tests/unit/file_base.cpp
new file mode 100644
index 00000000000..9f517fd8e37
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/file_base.cpp
@@ -0,0 +1,25 @@
+//
+// file_base.cpp
+// ~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/post.hpp"
+
+#include "unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "file_base",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/generic/basic_endpoint.cpp b/3rdparty/asio/src/tests/unit/generic/basic_endpoint.cpp
index 72d9d428184..c02f32b8c73 100644
--- a/3rdparty/asio/src/tests/unit/generic/basic_endpoint.cpp
+++ b/3rdparty/asio/src/tests/unit/generic/basic_endpoint.cpp
@@ -2,7 +2,7 @@
// generic/basic_endpoint.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/generic/datagram_protocol.cpp b/3rdparty/asio/src/tests/unit/generic/datagram_protocol.cpp
index c072a8bc0a2..23957a7a15d 100644
--- a/3rdparty/asio/src/tests/unit/generic/datagram_protocol.cpp
+++ b/3rdparty/asio/src/tests/unit/generic/datagram_protocol.cpp
@@ -2,7 +2,7 @@
// generic/datagram_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,6 +20,7 @@
#include "asio/io_context.hpp"
#include "asio/ip/udp.hpp"
#include "../unit_test.hpp"
+#include "../archetypes/async_result.hpp"
#if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
# define generic cpp_generic
@@ -65,6 +66,7 @@ void test()
socket_base::message_flags in_flags = 0;
socket_base::send_buffer_size socket_option;
socket_base::bytes_readable io_control_command;
+ archetypes::immediate_handler immediate;
asio::error_code ec;
// basic_datagram_socket constructors.
@@ -78,19 +80,15 @@ void test()
dp::socket socket4(ioc, dp(af_inet, ipproto_udp), native_socket1);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
-#if defined(ASIO_HAS_MOVE)
dp::socket socket5(std::move(socket4));
asio::ip::udp::socket udp_socket(ioc);
dp::socket socket6(std::move(udp_socket));
-#endif // defined(ASIO_HAS_MOVE)
// basic_datagram_socket operators.
-#if defined(ASIO_HAS_MOVE)
socket1 = dp::socket(ioc);
socket1 = std::move(socket2);
socket1 = asio::ip::udp::socket(ioc);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -143,6 +141,7 @@ void test()
socket1.connect(dp::endpoint(), ec);
socket1.async_connect(dp::endpoint(), connect_handler);
+ socket1.async_connect(dp::endpoint(), immediate);
socket1.set_option(socket_option);
socket1.set_option(socket_option, ec);
@@ -184,6 +183,12 @@ void test()
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), immediate);
+ socket1.async_send(buffer(const_char_buffer), immediate);
+ socket1.async_send(null_buffers(), immediate);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
+ socket1.async_send(null_buffers(), in_flags, immediate);
socket1.send_to(buffer(mutable_char_buffer),
dp::endpoint());
@@ -216,6 +221,18 @@ void test()
dp::endpoint(), in_flags, send_handler);
socket1.async_send_to(null_buffers(),
dp::endpoint(), in_flags, send_handler);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ dp::endpoint(), immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ dp::endpoint(), immediate);
+ socket1.async_send_to(null_buffers(),
+ dp::endpoint(), immediate);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ dp::endpoint(), in_flags, immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ dp::endpoint(), in_flags, immediate);
+ socket1.async_send_to(null_buffers(),
+ dp::endpoint(), in_flags, immediate);
socket1.receive(buffer(mutable_char_buffer));
socket1.receive(null_buffers());
@@ -229,6 +246,10 @@ void test()
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
receive_handler);
socket1.async_receive(null_buffers(), in_flags, receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), immediate);
+ socket1.async_receive(null_buffers(), immediate);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_receive(null_buffers(), in_flags, immediate);
dp::endpoint endpoint;
socket1.receive_from(buffer(mutable_char_buffer), endpoint);
@@ -246,6 +267,14 @@ void test()
endpoint, in_flags, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, in_flags, receive_handler);
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, immediate);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, immediate);
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, in_flags, immediate);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, in_flags, immediate);
}
catch (std::exception&)
{
@@ -259,5 +288,5 @@ void test()
ASIO_TEST_SUITE
(
"generic/datagram_protocol",
- ASIO_TEST_CASE(generic_datagram_protocol_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(generic_datagram_protocol_socket_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/generic/raw_protocol.cpp b/3rdparty/asio/src/tests/unit/generic/raw_protocol.cpp
index afe17cf7065..d20ef5ba870 100644
--- a/3rdparty/asio/src/tests/unit/generic/raw_protocol.cpp
+++ b/3rdparty/asio/src/tests/unit/generic/raw_protocol.cpp
@@ -2,7 +2,7 @@
// generic/raw_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,6 +20,7 @@
#include "asio/io_context.hpp"
#include "asio/ip/icmp.hpp"
#include "../unit_test.hpp"
+#include "../archetypes/async_result.hpp"
#if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
# define generic cpp_generic
@@ -65,6 +66,7 @@ void test()
socket_base::message_flags in_flags = 0;
socket_base::send_buffer_size socket_option;
socket_base::bytes_readable io_control_command;
+ archetypes::immediate_handler immediate;
asio::error_code ec;
// basic_raw_socket constructors.
@@ -78,19 +80,15 @@ void test()
rp::socket socket4(ioc, rp(af_inet, ipproto_icmp), native_socket1);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
-#if defined(ASIO_HAS_MOVE)
rp::socket socket5(std::move(socket4));
asio::ip::icmp::socket icmp_socket(ioc);
rp::socket socket6(std::move(icmp_socket));
-#endif // defined(ASIO_HAS_MOVE)
// basic_datagram_socket operators.
-#if defined(ASIO_HAS_MOVE)
socket1 = rp::socket(ioc);
socket1 = std::move(socket2);
socket1 = asio::ip::icmp::socket(ioc);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -143,6 +141,7 @@ void test()
socket1.connect(rp::endpoint(), ec);
socket1.async_connect(rp::endpoint(), connect_handler);
+ socket1.async_connect(rp::endpoint(), immediate);
socket1.set_option(socket_option);
socket1.set_option(socket_option, ec);
@@ -184,6 +183,12 @@ void test()
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), immediate);
+ socket1.async_send(buffer(const_char_buffer), immediate);
+ socket1.async_send(null_buffers(), immediate);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
+ socket1.async_send(null_buffers(), in_flags, immediate);
socket1.send_to(buffer(mutable_char_buffer),
rp::endpoint());
@@ -216,6 +221,18 @@ void test()
rp::endpoint(), in_flags, send_handler);
socket1.async_send_to(null_buffers(),
rp::endpoint(), in_flags, send_handler);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ rp::endpoint(), immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ rp::endpoint(), immediate);
+ socket1.async_send_to(null_buffers(),
+ rp::endpoint(), immediate);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ rp::endpoint(), in_flags, immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ rp::endpoint(), in_flags, immediate);
+ socket1.async_send_to(null_buffers(),
+ rp::endpoint(), in_flags, immediate);
socket1.receive(buffer(mutable_char_buffer));
socket1.receive(null_buffers());
@@ -229,6 +246,11 @@ void test()
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
receive_handler);
socket1.async_receive(null_buffers(), in_flags, receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), immediate);
+ socket1.async_receive(null_buffers(), immediate);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ immediate);
+ socket1.async_receive(null_buffers(), in_flags, immediate);
rp::endpoint endpoint;
socket1.receive_from(buffer(mutable_char_buffer), endpoint);
@@ -246,6 +268,14 @@ void test()
endpoint, in_flags, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, in_flags, receive_handler);
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, immediate);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, immediate);
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, in_flags, immediate);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, in_flags, immediate);
}
catch (std::exception&)
{
@@ -259,5 +289,5 @@ void test()
ASIO_TEST_SUITE
(
"generic/raw_protocol",
- ASIO_TEST_CASE(generic_raw_protocol_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(generic_raw_protocol_socket_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp b/3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp
index c4de03bc58b..587445b1f05 100644
--- a/3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp
+++ b/3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp
@@ -2,7 +2,7 @@
// generic/seq_packet_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,6 +19,7 @@
#include <cstring>
#include "asio/io_context.hpp"
#include "../unit_test.hpp"
+#include "../archetypes/async_result.hpp"
#if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
# define generic cpp_generic
@@ -64,6 +65,7 @@ void test()
socket_base::message_flags out_flags = 0;
socket_base::send_buffer_size socket_option;
socket_base::bytes_readable io_control_command;
+ archetypes::immediate_handler immediate;
asio::error_code ec;
// basic_seq_packet_socket constructors.
@@ -77,16 +79,12 @@ void test()
spp::socket socket4(ioc, spp(af_inet, 0), native_socket1);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
-#if defined(ASIO_HAS_MOVE)
spp::socket socket5(std::move(socket4));
-#endif // defined(ASIO_HAS_MOVE)
// basic_seq_packet_socket operators.
-#if defined(ASIO_HAS_MOVE)
socket1 = spp::socket(ioc);
socket1 = std::move(socket2);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -139,6 +137,7 @@ void test()
socket1.connect(spp::endpoint(), ec);
socket1.async_connect(spp::endpoint(), connect_handler);
+ socket1.async_connect(spp::endpoint(), immediate);
socket1.set_option(socket_option);
socket1.set_option(socket_option, ec);
@@ -174,6 +173,9 @@ void test()
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
+ socket1.async_send(null_buffers(), in_flags, immediate);
socket1.receive(buffer(mutable_char_buffer), out_flags);
socket1.receive(null_buffers(), out_flags);
@@ -188,6 +190,11 @@ void test()
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
out_flags, receive_handler);
socket1.async_receive(null_buffers(), in_flags, out_flags, receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), out_flags, immediate);
+ socket1.async_receive(null_buffers(), out_flags, immediate);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ out_flags, immediate);
+ socket1.async_receive(null_buffers(), in_flags, out_flags, immediate);
}
catch (std::exception&)
{
@@ -201,5 +208,5 @@ void test()
ASIO_TEST_SUITE
(
"generic/seq_packet_protocol",
- ASIO_TEST_CASE(generic_seq_packet_protocol_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(generic_seq_packet_protocol_socket_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/generic/stream_protocol.cpp b/3rdparty/asio/src/tests/unit/generic/stream_protocol.cpp
index 48c681db9f7..dedf6d76cee 100644
--- a/3rdparty/asio/src/tests/unit/generic/stream_protocol.cpp
+++ b/3rdparty/asio/src/tests/unit/generic/stream_protocol.cpp
@@ -2,7 +2,7 @@
// generic/stream_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,6 +20,7 @@
#include "asio/io_context.hpp"
#include "asio/ip/tcp.hpp"
#include "../unit_test.hpp"
+#include "../archetypes/async_result.hpp"
#if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
# define generic cpp_generic
@@ -73,6 +74,7 @@ void test()
socket_base::message_flags in_flags = 0;
socket_base::keep_alive socket_option;
socket_base::bytes_readable io_control_command;
+ archetypes::immediate_handler immediate;
asio::error_code ec;
// basic_stream_socket constructors.
@@ -88,19 +90,15 @@ void test()
#endif // defined(ASIO_WINDOWS_RUNTIME)
sp::socket socket4(ioc, sp(af_inet, ipproto_tcp), native_socket1);
-#if defined(ASIO_HAS_MOVE)
sp::socket socket5(std::move(socket4));
asio::ip::tcp::socket tcp_socket(ioc);
sp::socket socket6(std::move(tcp_socket));
-#endif // defined(ASIO_HAS_MOVE)
// basic_stream_socket operators.
-#if defined(ASIO_HAS_MOVE)
socket1 = sp::socket(ioc);
socket1 = std::move(socket2);
socket1 = asio::ip::tcp::socket(ioc);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -159,6 +157,7 @@ void test()
socket1.connect(sp::endpoint(), ec);
socket1.async_connect(sp::endpoint(), connect_handler);
+ socket1.async_connect(sp::endpoint(), immediate);
socket1.set_option(socket_option);
socket1.set_option(socket_option, ec);
@@ -200,6 +199,12 @@ void test()
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), immediate);
+ socket1.async_send(buffer(const_char_buffer), immediate);
+ socket1.async_send(null_buffers(), immediate);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
+ socket1.async_send(null_buffers(), in_flags, immediate);
socket1.receive(buffer(mutable_char_buffer));
socket1.receive(null_buffers());
@@ -213,6 +218,11 @@ void test()
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
receive_handler);
socket1.async_receive(null_buffers(), in_flags, receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), immediate);
+ socket1.async_receive(null_buffers(), immediate);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ immediate);
+ socket1.async_receive(null_buffers(), in_flags, immediate);
socket1.write_some(buffer(mutable_char_buffer));
socket1.write_some(buffer(const_char_buffer));
@@ -224,6 +234,9 @@ void test()
socket1.async_write_some(buffer(mutable_char_buffer), write_some_handler);
socket1.async_write_some(buffer(const_char_buffer), write_some_handler);
socket1.async_write_some(null_buffers(), write_some_handler);
+ socket1.async_write_some(buffer(mutable_char_buffer), immediate);
+ socket1.async_write_some(buffer(const_char_buffer), immediate);
+ socket1.async_write_some(null_buffers(), immediate);
socket1.read_some(buffer(mutable_char_buffer));
socket1.read_some(buffer(mutable_char_buffer), ec);
@@ -231,6 +244,8 @@ void test()
socket1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
socket1.async_read_some(null_buffers(), read_some_handler);
+ socket1.async_read_some(buffer(mutable_char_buffer), immediate);
+ socket1.async_read_some(null_buffers(), immediate);
}
catch (std::exception&)
{
@@ -244,5 +259,5 @@ void test()
ASIO_TEST_SUITE
(
"generic/stream_protocol",
- ASIO_TEST_CASE(generic_stream_protocol_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(generic_stream_protocol_socket_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/high_resolution_timer.cpp b/3rdparty/asio/src/tests/unit/high_resolution_timer.cpp
index d47717c98ab..b8dd448c321 100644
--- a/3rdparty/asio/src/tests/unit/high_resolution_timer.cpp
+++ b/3rdparty/asio/src/tests/unit/high_resolution_timer.cpp
@@ -2,7 +2,7 @@
// high_resolution_timer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/io_context.cpp b/3rdparty/asio/src/tests/unit/io_context.cpp
index 9e05fd9f78f..4341fb62e1e 100644
--- a/3rdparty/asio/src/tests/unit/io_context.cpp
+++ b/3rdparty/asio/src/tests/unit/io_context.cpp
@@ -2,7 +2,7 @@
// io_context.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,6 +16,7 @@
// Test that header file is self-contained.
#include "asio/io_context.hpp"
+#include <functional>
#include <sstream>
#include "asio/bind_executor.hpp"
#include "asio/dispatch.hpp"
@@ -29,24 +30,13 @@
# include "asio/steady_timer.hpp"
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
#if defined(ASIO_HAS_BOOST_DATE_TIME)
typedef deadline_timer timer;
namespace chronons = boost::posix_time;
-#elif defined(ASIO_HAS_CHRONO)
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
typedef steady_timer timer;
namespace chronons = asio::chrono;
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
@@ -409,8 +399,7 @@ void io_context_executor_execute_test()
io_context ioc;
int count = 0;
- asio::execution::execute(ioc.get_executor(),
- bindns::bind(increment, &count));
+ ioc.get_executor().execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -424,10 +413,9 @@ void io_context_executor_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(ioc.get_executor(),
- asio::execution::blocking.possibly),
- bindns::bind(increment, &count));
+ asio::require(ioc.get_executor(),
+ asio::execution::blocking.possibly
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -441,10 +429,9 @@ void io_context_executor_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(ioc.get_executor(),
- asio::execution::blocking.never),
- bindns::bind(increment, &count));
+ asio::require(ioc.get_executor(),
+ asio::execution::blocking.never
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -460,11 +447,10 @@ void io_context_executor_execute_test()
ioc.restart();
ASIO_CHECK(!ioc.stopped());
- asio::execution::execute(
- asio::require(ioc.get_executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.tracked),
- bindns::bind(increment, &count));
+ asio::require(ioc.get_executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.tracked
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -478,11 +464,10 @@ void io_context_executor_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(ioc.get_executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked),
- bindns::bind(increment, &count));
+ asio::require(ioc.get_executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -496,12 +481,11 @@ void io_context_executor_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(ioc.get_executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.fork),
- bindns::bind(increment, &count));
+ asio::require(ioc.get_executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.fork
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -515,12 +499,11 @@ void io_context_executor_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(ioc.get_executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- bindns::bind(increment, &count));
+ asio::require(ioc.get_executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -534,14 +517,13 @@ void io_context_executor_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::prefer(
- asio::require(ioc.get_executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator(std::allocator<void>())),
- bindns::bind(increment, &count));
+ asio::prefer(
+ asio::require(ioc.get_executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation),
+ asio::execution::allocator(std::allocator<void>())
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -555,14 +537,13 @@ void io_context_executor_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::prefer(
- asio::require(ioc.get_executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator),
- bindns::bind(increment, &count));
+ asio::prefer(
+ asio::require(ioc.get_executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation),
+ asio::execution::allocator
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
diff --git a/3rdparty/asio/src/tests/unit/io_context_strand.cpp b/3rdparty/asio/src/tests/unit/io_context_strand.cpp
index 45cb943eb23..be03eb40dd2 100644
--- a/3rdparty/asio/src/tests/unit/io_context_strand.cpp
+++ b/3rdparty/asio/src/tests/unit/io_context_strand.cpp
@@ -2,7 +2,7 @@
// io_context_strand.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,6 +16,7 @@
// Test that header file is self-contained.
#include "asio/io_context_strand.hpp"
+#include <functional>
#include <sstream>
#include "asio/io_context.hpp"
#include "asio/dispatch.hpp"
@@ -29,24 +30,14 @@
# include "asio/steady_timer.hpp"
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
#if defined(ASIO_HAS_BOOST_DATE_TIME)
typedef deadline_timer timer;
namespace chronons = boost::posix_time;
-#elif defined(ASIO_HAS_CHRONO)
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
typedef steady_timer timer;
namespace chronons = asio::chrono;
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
diff --git a/3rdparty/asio/src/tests/unit/ip/address.cpp b/3rdparty/asio/src/tests/unit/ip/address.cpp
index 1a7024d5d53..a13a343c8e9 100644
--- a/3rdparty/asio/src/tests/unit/ip/address.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/address.cpp
@@ -2,7 +2,7 @@
// address.cpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -128,10 +128,8 @@ void test()
wos << addr1;
#endif // !defined(BOOST_NO_STD_WSTREAMBUF)
-#if defined(ASIO_HAS_STD_HASH)
std::size_t hash1 = std::hash<ip::address>()(addr1);
(void)hash1;
-#endif // defined(ASIO_HAS_STD_HASH)
}
catch (std::exception&)
{
@@ -145,5 +143,5 @@ void test()
ASIO_TEST_SUITE
(
"ip/address",
- ASIO_TEST_CASE(ip_address_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_address_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/address_v4.cpp b/3rdparty/asio/src/tests/unit/ip/address_v4.cpp
index 8885f469d48..6fb361b9544 100644
--- a/3rdparty/asio/src/tests/unit/ip/address_v4.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/address_v4.cpp
@@ -2,7 +2,7 @@
// address_v4.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -324,6 +324,6 @@ void test()
ASIO_TEST_SUITE
(
"ip/address_v4",
- ASIO_TEST_CASE(ip_address_v4_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_address_v4_compile::test)
ASIO_TEST_CASE(ip_address_v4_runtime::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/address_v4_iterator.cpp b/3rdparty/asio/src/tests/unit/ip/address_v4_iterator.cpp
index babcaeae268..8b651b52582 100644
--- a/3rdparty/asio/src/tests/unit/ip/address_v4_iterator.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/address_v4_iterator.cpp
@@ -2,7 +2,7 @@
// address_v4_iterator.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/address_v4_range.cpp b/3rdparty/asio/src/tests/unit/ip/address_v4_range.cpp
index 0733c18d089..1b36744cb53 100644
--- a/3rdparty/asio/src/tests/unit/ip/address_v4_range.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/address_v4_range.cpp
@@ -2,7 +2,7 @@
// address_v4_range.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/address_v6.cpp b/3rdparty/asio/src/tests/unit/ip/address_v6.cpp
index 8d5ee8a0965..026c5fa4f9a 100644
--- a/3rdparty/asio/src/tests/unit/ip/address_v6.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/address_v6.cpp
@@ -2,7 +2,7 @@
// address_v6.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -409,6 +409,6 @@ void test()
ASIO_TEST_SUITE
(
"ip/address_v6",
- ASIO_TEST_CASE(ip_address_v6_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_address_v6_compile::test)
ASIO_TEST_CASE(ip_address_v6_runtime::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/address_v6_iterator.cpp b/3rdparty/asio/src/tests/unit/ip/address_v6_iterator.cpp
index c2a37dea8e2..ef62dc645c2 100644
--- a/3rdparty/asio/src/tests/unit/ip/address_v6_iterator.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/address_v6_iterator.cpp
@@ -2,7 +2,7 @@
// address_v6_iterator.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/address_v6_range.cpp b/3rdparty/asio/src/tests/unit/ip/address_v6_range.cpp
index 1dbc6808c5c..b0477214d7e 100644
--- a/3rdparty/asio/src/tests/unit/ip/address_v6_range.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/address_v6_range.cpp
@@ -2,7 +2,7 @@
// address_v6_range.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/basic_endpoint.cpp b/3rdparty/asio/src/tests/unit/ip/basic_endpoint.cpp
index 7fc95dc246d..d4aadb6febc 100644
--- a/3rdparty/asio/src/tests/unit/ip/basic_endpoint.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/basic_endpoint.cpp
@@ -2,7 +2,7 @@
// basic_endpoint.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/basic_resolver.cpp b/3rdparty/asio/src/tests/unit/ip/basic_resolver.cpp
index a0d6d3e3353..698a2bad25f 100644
--- a/3rdparty/asio/src/tests/unit/ip/basic_resolver.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/basic_resolver.cpp
@@ -2,7 +2,7 @@
// basic_resolver.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/basic_resolver_entry.cpp b/3rdparty/asio/src/tests/unit/ip/basic_resolver_entry.cpp
index cdd4e567757..7de5b6fc2c0 100644
--- a/3rdparty/asio/src/tests/unit/ip/basic_resolver_entry.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/basic_resolver_entry.cpp
@@ -2,7 +2,7 @@
// basic_resolver_entry.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/basic_resolver_iterator.cpp b/3rdparty/asio/src/tests/unit/ip/basic_resolver_iterator.cpp
index 7fcf85732d7..df7a54a79af 100644
--- a/3rdparty/asio/src/tests/unit/ip/basic_resolver_iterator.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/basic_resolver_iterator.cpp
@@ -2,7 +2,7 @@
// basic_resolver_iterator.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/basic_resolver_query.cpp b/3rdparty/asio/src/tests/unit/ip/basic_resolver_query.cpp
index ebdb6aa5f2f..6d10e449482 100644
--- a/3rdparty/asio/src/tests/unit/ip/basic_resolver_query.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/basic_resolver_query.cpp
@@ -2,7 +2,7 @@
// basic_resolver_query.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/host_name.cpp b/3rdparty/asio/src/tests/unit/ip/host_name.cpp
index 61a2d8a24d1..6972cbf6f4a 100644
--- a/3rdparty/asio/src/tests/unit/ip/host_name.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/host_name.cpp
@@ -2,7 +2,7 @@
// host_name.cpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -51,5 +51,5 @@ void test()
ASIO_TEST_SUITE
(
"ip/host_name",
- ASIO_TEST_CASE(ip_host_name_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_host_name_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/icmp.cpp b/3rdparty/asio/src/tests/unit/ip/icmp.cpp
index 644e7bb9cde..ec60267b30f 100644
--- a/3rdparty/asio/src/tests/unit/ip/icmp.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/icmp.cpp
@@ -2,7 +2,7 @@
// icmp.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -38,33 +38,27 @@ struct connect_handler
{
connect_handler() {}
void operator()(const asio::error_code&) {}
-#if defined(ASIO_HAS_MOVE)
connect_handler(connect_handler&&) {}
private:
connect_handler(const connect_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct send_handler
{
send_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
send_handler(send_handler&&) {}
private:
send_handler(const send_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct receive_handler
{
receive_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
receive_handler(receive_handler&&) {}
private:
receive_handler(const receive_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
void test()
@@ -86,6 +80,7 @@ void test()
archetypes::gettable_socket_option<int> gettable_socket_option2;
archetypes::gettable_socket_option<double> gettable_socket_option3;
archetypes::io_control_command io_control_command;
+ archetypes::immediate_handler immediate;
archetypes::lazy_handler lazy;
asio::error_code ec;
@@ -113,16 +108,12 @@ void test()
ip::icmp::socket socket12(ioc_ex, ip::icmp::v4(), native_socket2);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
-#if defined(ASIO_HAS_MOVE)
ip::icmp::socket socket13(std::move(socket6));
-#endif // defined(ASIO_HAS_MOVE)
// basic_datagram_socket operators.
-#if defined(ASIO_HAS_MOVE)
socket1 = ip::icmp::socket(ioc);
socket1 = std::move(socket2);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -193,6 +184,8 @@ void test()
connect_handler());
socket1.async_connect(ip::icmp::endpoint(ip::icmp::v6(), 0),
connect_handler());
+ socket1.async_connect(ip::icmp::endpoint(ip::icmp::v4(), 0), immediate);
+ socket1.async_connect(ip::icmp::endpoint(ip::icmp::v6(), 0), immediate);
int i1 = socket1.async_connect(ip::icmp::endpoint(ip::icmp::v4(), 0), lazy);
(void)i1;
int i2 = socket1.async_connect(ip::icmp::endpoint(ip::icmp::v6(), 0), lazy);
@@ -256,6 +249,12 @@ void test()
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler());
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler());
socket1.async_send(null_buffers(), in_flags, send_handler());
+ socket1.async_send(buffer(mutable_char_buffer), immediate);
+ socket1.async_send(buffer(const_char_buffer), immediate);
+ socket1.async_send(null_buffers(), immediate);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
+ socket1.async_send(null_buffers(), in_flags, immediate);
int i3 = socket1.async_send(buffer(mutable_char_buffer), lazy);
(void)i3;
int i4 = socket1.async_send(buffer(const_char_buffer), lazy);
@@ -330,6 +329,30 @@ void test()
ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, send_handler());
socket1.async_send_to(null_buffers(),
ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, send_handler());
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), immediate);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), immediate);
+ socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), immediate);
+ socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), immediate);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, immediate);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, immediate);
+ socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, immediate);
+ socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, immediate);
int i9 = socket1.async_send_to(buffer(mutable_char_buffer),
ip::icmp::endpoint(ip::icmp::v4(), 0), lazy);
(void)i9;
@@ -379,6 +402,10 @@ void test()
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
receive_handler());
socket1.async_receive(null_buffers(), in_flags, receive_handler());
+ socket1.async_receive(buffer(mutable_char_buffer), immediate);
+ socket1.async_receive(null_buffers(), immediate);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_receive(null_buffers(), in_flags, immediate);
int i21 = socket1.async_receive(buffer(mutable_char_buffer), lazy);
(void)i21;
int i22 = socket1.async_receive(null_buffers(), lazy);
@@ -405,6 +432,14 @@ void test()
endpoint, in_flags, receive_handler());
socket1.async_receive_from(null_buffers(),
endpoint, in_flags, receive_handler());
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, immediate);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, immediate);
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, in_flags, immediate);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, in_flags, immediate);
int i25 = socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, lazy);
(void)i25;
@@ -439,11 +474,9 @@ struct resolve_handler
resolve_handler() {}
void operator()(const asio::error_code&,
asio::ip::icmp::resolver::results_type) {}
-#if defined(ASIO_HAS_MOVE)
resolve_handler(resolve_handler&&) {}
private:
resolve_handler(const resolve_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
void test()
@@ -467,16 +500,12 @@ void test()
ip::icmp::resolver resolver(ioc);
ip::icmp::resolver resolver2(ioc_ex);
-#if defined(ASIO_HAS_MOVE)
ip::icmp::resolver resolver3(std::move(resolver));
-#endif // defined(ASIO_HAS_MOVE)
// basic_resolver operators.
-#if defined(ASIO_HAS_MOVE)
resolver = ip::icmp::resolver(ioc);
resolver = std::move(resolver3);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -572,6 +601,6 @@ void test()
ASIO_TEST_SUITE
(
"ip/icmp",
- ASIO_TEST_CASE(ip_icmp_socket_compile::test)
- ASIO_TEST_CASE(ip_icmp_resolver_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_icmp_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_icmp_resolver_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/multicast.cpp b/3rdparty/asio/src/tests/unit/ip/multicast.cpp
index 7d8a9e7bc33..4f0b3f45e14 100644
--- a/3rdparty/asio/src/tests/unit/ip/multicast.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/multicast.cpp
@@ -2,7 +2,7 @@
// multicast.cpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -358,6 +358,6 @@ void test()
ASIO_TEST_SUITE
(
"ip/multicast",
- ASIO_TEST_CASE(ip_multicast_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_multicast_compile::test)
ASIO_TEST_CASE(ip_multicast_runtime::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/network_v4.cpp b/3rdparty/asio/src/tests/unit/ip/network_v4.cpp
index 06fb34d0dbd..0b7a7a9c783 100644
--- a/3rdparty/asio/src/tests/unit/ip/network_v4.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/network_v4.cpp
@@ -2,7 +2,7 @@
// network_v4.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -309,6 +309,6 @@ void test()
ASIO_TEST_SUITE
(
"ip/network_v4",
- ASIO_TEST_CASE(ip_network_v4_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_network_v4_compile::test)
ASIO_TEST_CASE(ip_network_v4_runtime::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/network_v6.cpp b/3rdparty/asio/src/tests/unit/ip/network_v6.cpp
index e1c7bcff6b4..d80b1d447b6 100644
--- a/3rdparty/asio/src/tests/unit/ip/network_v6.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/network_v6.cpp
@@ -2,7 +2,7 @@
// network_v6.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2014 Oliver Kowalke (oliver dot kowalke at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -233,6 +233,6 @@ void test()
ASIO_TEST_SUITE
(
"ip/network_v6",
- ASIO_TEST_CASE(ip_network_v6_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_network_v6_compile::test)
ASIO_TEST_CASE(ip_network_v6_runtime::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/resolver_query_base.cpp b/3rdparty/asio/src/tests/unit/ip/resolver_query_base.cpp
index c59d75237ed..b38f5091b53 100644
--- a/3rdparty/asio/src/tests/unit/ip/resolver_query_base.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/resolver_query_base.cpp
@@ -2,7 +2,7 @@
// resolver_query_base.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ip/tcp.cpp b/3rdparty/asio/src/tests/unit/ip/tcp.cpp
index 4b7208a221b..2bbdc3a1071 100644
--- a/3rdparty/asio/src/tests/unit/ip/tcp.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/tcp.cpp
@@ -2,7 +2,7 @@
// tcp.cpp
// ~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -20,6 +20,7 @@
#include "asio/ip/tcp.hpp"
#include <cstring>
+#include <functional>
#include "asio/io_context.hpp"
#include "asio/read.hpp"
#include "asio/write.hpp"
@@ -35,12 +36,6 @@
# include <array>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
//------------------------------------------------------------------------------
// ip_tcp_compile test
@@ -71,10 +66,8 @@ void test()
(void)static_cast<bool>(!no_delay1);
(void)static_cast<bool>(no_delay1.value());
-#if defined(ASIO_HAS_STD_HASH)
ip::tcp::endpoint ep;
(void)static_cast<std::size_t>(std::hash<ip::tcp::endpoint>()(ep));
-#endif // defined(ASIO_HAS_STD_HASH)
}
catch (std::exception&)
{
@@ -146,66 +139,54 @@ struct connect_handler
{
connect_handler() {}
void operator()(const asio::error_code&) {}
-#if defined(ASIO_HAS_MOVE)
connect_handler(connect_handler&&) {}
private:
connect_handler(const connect_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct wait_handler
{
wait_handler() {}
void operator()(const asio::error_code&) {}
-#if defined(ASIO_HAS_MOVE)
wait_handler(wait_handler&&) {}
private:
wait_handler(const wait_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct send_handler
{
send_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
send_handler(send_handler&&) {}
private:
send_handler(const send_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct receive_handler
{
receive_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
receive_handler(receive_handler&&) {}
private:
receive_handler(const receive_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct write_some_handler
{
write_some_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
write_some_handler(write_some_handler&&) {}
private:
write_some_handler(const write_some_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct read_some_handler
{
read_some_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
read_some_handler(read_some_handler&&) {}
private:
read_some_handler(const read_some_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
void test()
@@ -239,6 +220,7 @@ void test()
archetypes::gettable_socket_option<int> gettable_socket_option2;
archetypes::gettable_socket_option<double> gettable_socket_option3;
archetypes::io_control_command io_control_command;
+ archetypes::immediate_handler immediate;
archetypes::lazy_handler lazy;
asio::error_code ec;
@@ -266,16 +248,12 @@ void test()
ip::tcp::socket socket12(ioc_ex, ip::tcp::v4(), native_socket2);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
-#if defined(ASIO_HAS_MOVE)
ip::tcp::socket socket13(std::move(socket5));
-#endif // defined(ASIO_HAS_MOVE)
// basic_stream_socket operators.
-#if defined(ASIO_HAS_MOVE)
socket1 = ip::tcp::socket(ioc);
socket1 = std::move(socket2);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -346,6 +324,8 @@ void test()
connect_handler());
socket1.async_connect(ip::tcp::endpoint(ip::tcp::v6(), 0),
connect_handler());
+ socket1.async_connect(ip::tcp::endpoint(ip::tcp::v4(), 0), immediate);
+ socket1.async_connect(ip::tcp::endpoint(ip::tcp::v6(), 0), immediate);
int i1 = socket1.async_connect(ip::tcp::endpoint(ip::tcp::v4(), 0), lazy);
(void)i1;
int i2 = socket1.async_connect(ip::tcp::endpoint(ip::tcp::v6(), 0), lazy);
@@ -395,6 +375,7 @@ void test()
socket1.wait(socket_base::wait_write, ec);
socket1.async_wait(socket_base::wait_read, wait_handler());
+ socket1.async_wait(socket_base::wait_read, immediate);
int i3 = socket1.async_wait(socket_base::wait_write, lazy);
(void)i3;
@@ -426,6 +407,16 @@ void test()
socket1.async_send(mutable_buffers, in_flags, send_handler());
socket1.async_send(const_buffers, in_flags, send_handler());
socket1.async_send(null_buffers(), in_flags, send_handler());
+ socket1.async_send(buffer(mutable_char_buffer), immediate);
+ socket1.async_send(buffer(const_char_buffer), immediate);
+ socket1.async_send(mutable_buffers, immediate);
+ socket1.async_send(const_buffers, immediate);
+ socket1.async_send(null_buffers(), immediate);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
+ socket1.async_send(mutable_buffers, in_flags, immediate);
+ socket1.async_send(const_buffers, in_flags, immediate);
+ socket1.async_send(null_buffers(), in_flags, immediate);
int i4 = socket1.async_send(buffer(mutable_char_buffer), lazy);
(void)i4;
int i5 = socket1.async_send(buffer(const_char_buffer), lazy);
@@ -464,6 +455,12 @@ void test()
receive_handler());
socket1.async_receive(mutable_buffers, in_flags, receive_handler());
socket1.async_receive(null_buffers(), in_flags, receive_handler());
+ socket1.async_receive(buffer(mutable_char_buffer), immediate);
+ socket1.async_receive(mutable_buffers, immediate);
+ socket1.async_receive(null_buffers(), immediate);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_receive(mutable_buffers, in_flags, immediate);
+ socket1.async_receive(null_buffers(), in_flags, immediate);
int i14 = socket1.async_receive(buffer(mutable_char_buffer), lazy);
(void)i14;
int i15 = socket1.async_receive(mutable_buffers, lazy);
@@ -494,6 +491,11 @@ void test()
socket1.async_write_some(mutable_buffers, write_some_handler());
socket1.async_write_some(const_buffers, write_some_handler());
socket1.async_write_some(null_buffers(), write_some_handler());
+ socket1.async_write_some(buffer(mutable_char_buffer), immediate);
+ socket1.async_write_some(buffer(const_char_buffer), immediate);
+ socket1.async_write_some(mutable_buffers, immediate);
+ socket1.async_write_some(const_buffers, immediate);
+ socket1.async_write_some(null_buffers(), immediate);
int i20 = socket1.async_write_some(buffer(mutable_char_buffer), lazy);
(void)i20;
int i21 = socket1.async_write_some(buffer(const_char_buffer), lazy);
@@ -515,6 +517,9 @@ void test()
socket1.async_read_some(buffer(mutable_char_buffer), read_some_handler());
socket1.async_read_some(mutable_buffers, read_some_handler());
socket1.async_read_some(null_buffers(), read_some_handler());
+ socket1.async_read_some(buffer(mutable_char_buffer), immediate);
+ socket1.async_read_some(mutable_buffers, immediate);
+ socket1.async_read_some(null_buffers(), immediate);
int i25 = socket1.async_read_some(buffer(mutable_char_buffer), lazy);
(void)i25;
int i26 = socket1.async_read_some(mutable_buffers, lazy);
@@ -594,11 +599,7 @@ void test()
using namespace asio;
namespace ip = asio::ip;
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -706,25 +707,20 @@ struct wait_handler
{
wait_handler() {}
void operator()(const asio::error_code&) {}
-#if defined(ASIO_HAS_MOVE)
wait_handler(wait_handler&&) {}
private:
wait_handler(const wait_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct accept_handler
{
accept_handler() {}
void operator()(const asio::error_code&) {}
-#if defined(ASIO_HAS_MOVE)
accept_handler(accept_handler&&) {}
private:
accept_handler(const accept_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
-#if defined(ASIO_HAS_MOVE)
struct move_accept_handler
{
move_accept_handler() {}
@@ -745,7 +741,6 @@ struct move_accept_ioc_handler
private:
move_accept_ioc_handler(const move_accept_handler&) {}
};
-#endif // defined(ASIO_HAS_MOVE)
void test()
{
@@ -767,6 +762,7 @@ void test()
archetypes::gettable_socket_option<int> gettable_socket_option2;
archetypes::gettable_socket_option<double> gettable_socket_option3;
archetypes::io_control_command io_control_command;
+ archetypes::immediate_handler immediate;
archetypes::lazy_handler lazy;
asio::error_code ec;
@@ -794,16 +790,12 @@ void test()
ip::tcp::acceptor acceptor12(ioc_ex, ip::tcp::v4(), native_acceptor2);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
-#if defined(ASIO_HAS_MOVE)
ip::tcp::acceptor acceptor13(std::move(acceptor5));
-#endif // defined(ASIO_HAS_MOVE)
// basic_socket_acceptor operators.
-#if defined(ASIO_HAS_MOVE)
acceptor1 = ip::tcp::acceptor(ioc);
acceptor1 = std::move(acceptor2);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -883,6 +875,7 @@ void test()
acceptor1.wait(socket_base::wait_write, ec);
acceptor1.async_wait(socket_base::wait_read, wait_handler());
+ acceptor1.async_wait(socket_base::wait_read, immediate);
int i1 = acceptor1.async_wait(socket_base::wait_write, lazy);
(void)i1;
@@ -896,7 +889,6 @@ void test()
acceptor1.accept(peer_socket2, peer_endpoint);
acceptor1.accept(peer_socket2, peer_endpoint, ec);
-#if defined(ASIO_HAS_MOVE)
peer_socket1 = acceptor1.accept();
peer_socket1 = acceptor1.accept(ioc);
peer_socket1 = acceptor1.accept(ioc_ex);
@@ -910,10 +902,11 @@ void test()
peer_socket2 = acceptor1.accept(ioc, peer_endpoint);
peer_socket2 = acceptor1.accept(ioc_ex, peer_endpoint);
(void)peer_socket2;
-#endif // defined(ASIO_HAS_MOVE)
acceptor1.async_accept(peer_socket1, accept_handler());
acceptor1.async_accept(peer_socket1, peer_endpoint, accept_handler());
+ acceptor1.async_accept(peer_socket1, immediate);
+ acceptor1.async_accept(peer_socket1, peer_endpoint, immediate);
int i2 = acceptor1.async_accept(peer_socket1, lazy);
(void)i2;
int i3 = acceptor1.async_accept(peer_socket1, peer_endpoint, lazy);
@@ -921,12 +914,13 @@ void test()
acceptor1.async_accept(peer_socket2, accept_handler());
acceptor1.async_accept(peer_socket2, peer_endpoint, accept_handler());
+ acceptor1.async_accept(peer_socket2, immediate);
+ acceptor1.async_accept(peer_socket2, peer_endpoint, immediate);
int i4 = acceptor1.async_accept(peer_socket2, lazy);
(void)i4;
int i5 = acceptor1.async_accept(peer_socket2, peer_endpoint, lazy);
(void)i5;
-#if defined(ASIO_HAS_MOVE)
acceptor1.async_accept(move_accept_handler());
acceptor1.async_accept(ioc, move_accept_handler());
acceptor1.async_accept(ioc_ex, move_accept_handler());
@@ -935,7 +929,12 @@ void test()
acceptor1.async_accept(ioc, peer_endpoint, move_accept_handler());
acceptor1.async_accept(ioc_ex, peer_endpoint, move_accept_handler());
acceptor1.async_accept(ioc_ex, peer_endpoint, move_accept_ioc_handler());
-#endif // defined(ASIO_HAS_MOVE)
+ acceptor1.async_accept(immediate);
+ acceptor1.async_accept(ioc, immediate);
+ acceptor1.async_accept(ioc_ex, immediate);
+ acceptor1.async_accept(peer_endpoint, immediate);
+ acceptor1.async_accept(ioc, peer_endpoint, immediate);
+ acceptor1.async_accept(ioc_ex, peer_endpoint, immediate);
}
catch (std::exception&)
{
@@ -1037,11 +1036,9 @@ struct resolve_handler
resolve_handler() {}
void operator()(const asio::error_code&,
asio::ip::tcp::resolver::results_type) {}
-#if defined(ASIO_HAS_MOVE)
resolve_handler(resolve_handler&&) {}
private:
resolve_handler(const resolve_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
#if !defined(ASIO_NO_DEPRECATED)
@@ -1050,11 +1047,9 @@ struct legacy_resolve_handler
legacy_resolve_handler() {}
void operator()(const asio::error_code&,
asio::ip::tcp::resolver::iterator) {}
-#if defined(ASIO_HAS_MOVE)
legacy_resolve_handler(legacy_resolve_handler&&) {}
private:
legacy_resolve_handler(const legacy_resolve_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
#endif // !defined(ASIO_NO_DEPRECATED)
@@ -1079,16 +1074,12 @@ void test()
ip::tcp::resolver resolver(ioc);
ip::tcp::resolver resolver2(ioc_ex);
-#if defined(ASIO_HAS_MOVE)
ip::tcp::resolver resolver3(std::move(resolver));
-#endif // defined(ASIO_HAS_MOVE)
// basic_resolver operators.
-#if defined(ASIO_HAS_MOVE)
resolver = ip::tcp::resolver(ioc);
resolver = std::move(resolver3);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -1224,9 +1215,7 @@ void test()
const ip::basic_resolver_entry<ip::tcp> entry1;
ip::basic_resolver_entry<ip::tcp> entry2(endpoint, host_name, service_name);
ip::basic_resolver_entry<ip::tcp> entry3(entry1);
-#if defined(ASIO_HAS_MOVE)
ip::basic_resolver_entry<ip::tcp> entry4(std::move(entry2));
-#endif // defined(ASIO_HAS_MOVE)
// basic_resolver_entry functions.
@@ -1287,19 +1276,15 @@ void test()
ip::tcp::iostream ios1;
-#if defined(ASIO_HAS_STD_IOSTREAM_MOVE)
ip::tcp::iostream ios2(std::move(sock));
-#endif // defined(ASIO_HAS_STD_IOSTREAM_MOVE)
ip::tcp::iostream ios3("hostname", "service");
// basic_socket_iostream operators.
-#if defined(ASIO_HAS_STD_IOSTREAM_MOVE)
ios1 = ip::tcp::iostream();
ios2 = std::move(ios1);
-#endif // defined(ASIO_HAS_STD_IOSTREAM_MOVE)
// basic_socket_iostream members.
@@ -1338,14 +1323,14 @@ void test()
ASIO_TEST_SUITE
(
"ip/tcp",
- ASIO_TEST_CASE(ip_tcp_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_tcp_compile::test)
ASIO_TEST_CASE(ip_tcp_runtime::test)
- ASIO_TEST_CASE(ip_tcp_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_tcp_socket_compile::test)
ASIO_TEST_CASE(ip_tcp_socket_runtime::test)
- ASIO_TEST_CASE(ip_tcp_acceptor_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_tcp_acceptor_compile::test)
ASIO_TEST_CASE(ip_tcp_acceptor_runtime::test)
- ASIO_TEST_CASE(ip_tcp_resolver_compile::test)
- ASIO_TEST_CASE(ip_tcp_resolver_entry_compile::test)
- ASIO_TEST_CASE(ip_tcp_resolver_entry_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_tcp_resolver_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_tcp_resolver_entry_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_tcp_resolver_entry_compile::test)
ASIO_COMPILE_TEST_CASE(ip_tcp_iostream_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/udp.cpp b/3rdparty/asio/src/tests/unit/ip/udp.cpp
index 507931d098e..ae67f9c9c73 100644
--- a/3rdparty/asio/src/tests/unit/ip/udp.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/udp.cpp
@@ -2,7 +2,7 @@
// udp.cpp
// ~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,6 +17,7 @@
#include "asio/ip/udp.hpp"
#include <cstring>
+#include <functional>
#include "asio/io_context.hpp"
#include "../unit_test.hpp"
#include "../archetypes/async_result.hpp"
@@ -24,12 +25,6 @@
#include "../archetypes/io_control_command.hpp"
#include "../archetypes/settable_socket_option.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
//------------------------------------------------------------------------------
// ip_udp_socket_compile test
@@ -43,44 +38,36 @@ struct connect_handler
{
connect_handler() {}
void operator()(const asio::error_code&) {}
-#if defined(ASIO_HAS_MOVE)
connect_handler(connect_handler&&) {}
private:
connect_handler(const connect_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct wait_handler
{
wait_handler() {}
void operator()(const asio::error_code&) {}
-#if defined(ASIO_HAS_MOVE)
wait_handler(wait_handler&&) {}
private:
wait_handler(const wait_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct send_handler
{
send_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
send_handler(send_handler&&) {}
private:
send_handler(const send_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct receive_handler
{
receive_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
receive_handler(receive_handler&&) {}
private:
receive_handler(const receive_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
void test()
@@ -102,6 +89,7 @@ void test()
archetypes::gettable_socket_option<int> gettable_socket_option2;
archetypes::gettable_socket_option<double> gettable_socket_option3;
archetypes::io_control_command io_control_command;
+ archetypes::immediate_handler immediate;
archetypes::lazy_handler lazy;
asio::error_code ec;
@@ -129,16 +117,12 @@ void test()
ip::udp::socket socket12(ioc_ex, ip::udp::v4(), native_socket2);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
-#if defined(ASIO_HAS_MOVE)
ip::udp::socket socket13(std::move(socket6));
-#endif // defined(ASIO_HAS_MOVE)
// basic_datagram_socket operators.
-#if defined(ASIO_HAS_MOVE)
socket1 = ip::udp::socket(ioc);
socket1 = std::move(socket2);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -209,6 +193,8 @@ void test()
connect_handler());
socket1.async_connect(ip::udp::endpoint(ip::udp::v6(), 0),
connect_handler());
+ socket1.async_connect(ip::udp::endpoint(ip::udp::v4(), 0), immediate);
+ socket1.async_connect(ip::udp::endpoint(ip::udp::v6(), 0), immediate);
int i1 = socket1.async_connect(ip::udp::endpoint(ip::udp::v4(), 0), lazy);
(void)i1;
int i2 = socket1.async_connect(ip::udp::endpoint(ip::udp::v6(), 0), lazy);
@@ -258,6 +244,7 @@ void test()
socket1.wait(socket_base::wait_write, ec);
socket1.async_wait(socket_base::wait_read, wait_handler());
+ socket1.async_wait(socket_base::wait_read, immediate);
int i3 = socket1.async_wait(socket_base::wait_write, lazy);
(void)i3;
@@ -279,6 +266,12 @@ void test()
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler());
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler());
socket1.async_send(null_buffers(), in_flags, send_handler());
+ socket1.async_send(buffer(mutable_char_buffer), immediate);
+ socket1.async_send(buffer(const_char_buffer), immediate);
+ socket1.async_send(null_buffers(), immediate);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
+ socket1.async_send(null_buffers(), in_flags, immediate);
int i4 = socket1.async_send(buffer(mutable_char_buffer), lazy);
(void)i4;
int i5 = socket1.async_send(buffer(const_char_buffer), lazy);
@@ -353,6 +346,30 @@ void test()
ip::udp::endpoint(ip::udp::v4(), 0), in_flags, send_handler());
socket1.async_send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v6(), 0), in_flags, send_handler());
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::udp::endpoint(ip::udp::v4(), 0), immediate);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::udp::endpoint(ip::udp::v6(), 0), immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::udp::endpoint(ip::udp::v4(), 0), immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::udp::endpoint(ip::udp::v6(), 0), immediate);
+ socket1.async_send_to(null_buffers(),
+ ip::udp::endpoint(ip::udp::v4(), 0), immediate);
+ socket1.async_send_to(null_buffers(),
+ ip::udp::endpoint(ip::udp::v6(), 0), immediate);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::udp::endpoint(ip::udp::v4(), 0), in_flags, immediate);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::udp::endpoint(ip::udp::v6(), 0), in_flags, immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::udp::endpoint(ip::udp::v4(), 0), in_flags, immediate);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::udp::endpoint(ip::udp::v6(), 0), in_flags, immediate);
+ socket1.async_send_to(null_buffers(),
+ ip::udp::endpoint(ip::udp::v4(), 0), in_flags, immediate);
+ socket1.async_send_to(null_buffers(),
+ ip::udp::endpoint(ip::udp::v6(), 0), in_flags, immediate);
int i10 = socket1.async_send_to(buffer(mutable_char_buffer),
ip::udp::endpoint(ip::udp::v4(), 0), lazy);
(void)i10;
@@ -402,6 +419,10 @@ void test()
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
receive_handler());
socket1.async_receive(null_buffers(), in_flags, receive_handler());
+ socket1.async_receive(buffer(mutable_char_buffer), immediate);
+ socket1.async_receive(null_buffers(), immediate);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_receive(null_buffers(), in_flags, immediate);
int i22 = socket1.async_receive(buffer(mutable_char_buffer), lazy);
(void)i22;
int i23 = socket1.async_receive(null_buffers(), lazy);
@@ -428,6 +449,14 @@ void test()
endpoint, in_flags, receive_handler());
socket1.async_receive_from(null_buffers(),
endpoint, in_flags, receive_handler());
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, immediate);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, immediate);
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, in_flags, immediate);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, in_flags, immediate);
int i26 = socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, lazy);
(void)i26;
@@ -476,11 +505,7 @@ void test()
using namespace asio;
namespace ip = asio::ip;
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -533,11 +558,9 @@ struct resolve_handler
resolve_handler() {}
void operator()(const asio::error_code&,
asio::ip::udp::resolver::results_type) {}
-#if defined(ASIO_HAS_MOVE)
resolve_handler(resolve_handler&&) {}
private:
resolve_handler(const resolve_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
void test()
@@ -561,16 +584,12 @@ void test()
ip::udp::resolver resolver(ioc);
ip::udp::resolver resolver2(ioc_ex);
-#if defined(ASIO_HAS_MOVE)
ip::udp::resolver resolver3(std::move(resolver));
-#endif // defined(ASIO_HAS_MOVE)
// basic_resolver operators.
-#if defined(ASIO_HAS_MOVE)
resolver = ip::udp::resolver(ioc);
resolver = std::move(resolver3);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -667,7 +686,7 @@ void test()
ASIO_TEST_SUITE
(
"ip/udp",
- ASIO_TEST_CASE(ip_udp_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_udp_socket_compile::test)
ASIO_TEST_CASE(ip_udp_socket_runtime::test)
- ASIO_TEST_CASE(ip_udp_resolver_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_udp_resolver_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/unicast.cpp b/3rdparty/asio/src/tests/unit/ip/unicast.cpp
index 84f1a8dc8b0..db3497f6e1c 100644
--- a/3rdparty/asio/src/tests/unit/ip/unicast.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/unicast.cpp
@@ -2,7 +2,7 @@
// unicast.cpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -166,6 +166,6 @@ void test()
ASIO_TEST_SUITE
(
"ip/unicast",
- ASIO_TEST_CASE(ip_unicast_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_unicast_compile::test)
ASIO_TEST_CASE(ip_unicast_runtime::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ip/v6_only.cpp b/3rdparty/asio/src/tests/unit/ip/v6_only.cpp
index 9a6bb69c250..ba37fdb3954 100644
--- a/3rdparty/asio/src/tests/unit/ip/v6_only.cpp
+++ b/3rdparty/asio/src/tests/unit/ip/v6_only.cpp
@@ -2,7 +2,7 @@
// v6_only.cpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -130,6 +130,6 @@ void test()
ASIO_TEST_SUITE
(
"ip/v6_only",
- ASIO_TEST_CASE(ip_v6_only_compile::test)
+ ASIO_COMPILE_TEST_CASE(ip_v6_only_compile::test)
ASIO_TEST_CASE(ip_v6_only_runtime::test)
)
diff --git a/3rdparty/asio/src/tests/unit/is_read_buffered.cpp b/3rdparty/asio/src/tests/unit/is_read_buffered.cpp
index 9f1d2069dc1..031cd0fb34d 100644
--- a/3rdparty/asio/src/tests/unit/is_read_buffered.cpp
+++ b/3rdparty/asio/src/tests/unit/is_read_buffered.cpp
@@ -2,7 +2,7 @@
// is_read_buffered.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/is_write_buffered.cpp b/3rdparty/asio/src/tests/unit/is_write_buffered.cpp
index eff1a35a0f7..df7a9c86d79 100644
--- a/3rdparty/asio/src/tests/unit/is_write_buffered.cpp
+++ b/3rdparty/asio/src/tests/unit/is_write_buffered.cpp
@@ -2,7 +2,7 @@
// is_write_buffered.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/local/basic_endpoint.cpp b/3rdparty/asio/src/tests/unit/local/basic_endpoint.cpp
index 163bb7a1c1d..855888e52c9 100644
--- a/3rdparty/asio/src/tests/unit/local/basic_endpoint.cpp
+++ b/3rdparty/asio/src/tests/unit/local/basic_endpoint.cpp
@@ -2,7 +2,7 @@
// basic_endpoint.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/local/connect_pair.cpp b/3rdparty/asio/src/tests/unit/local/connect_pair.cpp
index 8dfb38e3083..095a0d89696 100644
--- a/3rdparty/asio/src/tests/unit/local/connect_pair.cpp
+++ b/3rdparty/asio/src/tests/unit/local/connect_pair.cpp
@@ -2,7 +2,7 @@
// connect_pair.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -72,5 +72,5 @@ void test()
ASIO_TEST_SUITE
(
"local/connect_pair",
- ASIO_TEST_CASE(local_connect_pair_compile::test)
+ ASIO_COMPILE_TEST_CASE(local_connect_pair_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/local/datagram_protocol.cpp b/3rdparty/asio/src/tests/unit/local/datagram_protocol.cpp
index b73a67f02a2..23f677d6723 100644
--- a/3rdparty/asio/src/tests/unit/local/datagram_protocol.cpp
+++ b/3rdparty/asio/src/tests/unit/local/datagram_protocol.cpp
@@ -2,7 +2,7 @@
// datagram_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -238,5 +238,5 @@ void test()
ASIO_TEST_SUITE
(
"local/datagram_protocol",
- ASIO_TEST_CASE(local_datagram_protocol_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(local_datagram_protocol_socket_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/local/seq_packet_protocol.cpp b/3rdparty/asio/src/tests/unit/local/seq_packet_protocol.cpp
new file mode 100644
index 00000000000..00934827aa6
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/local/seq_packet_protocol.cpp
@@ -0,0 +1,209 @@
+//
+// local/seq_packet_protocol.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/local/seq_packet_protocol.hpp"
+
+#include <cstring>
+#include "asio/io_context.hpp"
+#include "../unit_test.hpp"
+#include "../archetypes/async_result.hpp"
+
+#if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
+# define local cpp_local
+#endif
+
+//------------------------------------------------------------------------------
+
+// local_seq_packet_protocol_socket_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// local::seq_packet_socket::socket compile and link correctly. Runtime
+// failures are ignored.
+
+namespace local_seq_packet_protocol_socket_compile {
+
+void connect_handler(const asio::error_code&)
+{
+}
+
+void send_handler(const asio::error_code&, std::size_t)
+{
+}
+
+void receive_handler(const asio::error_code&, std::size_t)
+{
+}
+
+void test()
+{
+ using namespace asio;
+ namespace local = asio::local;
+ typedef local::seq_packet_protocol spp;
+
+ try
+ {
+ io_context ioc;
+ char mutable_char_buffer[128] = "";
+ const char const_char_buffer[128] = "";
+ const socket_base::message_flags in_flags = 0;
+ socket_base::message_flags out_flags = 0;
+ socket_base::send_buffer_size socket_option;
+ socket_base::bytes_readable io_control_command;
+ archetypes::immediate_handler immediate;
+ asio::error_code ec;
+
+ // basic_seq_packet_socket constructors.
+
+ spp::socket socket1(ioc);
+ spp::socket socket2(ioc, spp());
+ spp::socket socket3(ioc, spp::endpoint());
+#if !defined(ASIO_WINDOWS_RUNTIME)
+ spp::socket::native_handle_type native_socket1
+ = ::socket(AF_UNIX, SOCK_SEQPACKET, 0);
+ spp::socket socket4(ioc, spp(), native_socket1);
+#endif // !defined(ASIO_WINDOWS_RUNTIME)
+
+ spp::socket socket5(std::move(socket4));
+
+ // basic_seq_packet_socket operators.
+
+ socket1 = spp::socket(ioc);
+ socket1 = std::move(socket2);
+
+ // basic_io_object functions.
+
+ spp::socket::executor_type ex = socket1.get_executor();
+ (void)ex;
+
+ // basic_socket functions.
+
+ spp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
+ (void)lowest_layer;
+
+ socket1.open(spp());
+ socket1.open(spp(), ec);
+
+#if !defined(ASIO_WINDOWS_RUNTIME)
+ spp::socket::native_handle_type native_socket2
+ = ::socket(AF_UNIX, SOCK_SEQPACKET, 0);
+ socket1.assign(spp(), native_socket2);
+ spp::socket::native_handle_type native_socket3
+ = ::socket(AF_UNIX, SOCK_SEQPACKET, 0);
+ socket1.assign(spp(), native_socket3, ec);
+#endif // !defined(ASIO_WINDOWS_RUNTIME)
+
+ bool is_open = socket1.is_open();
+ (void)is_open;
+
+ socket1.close();
+ socket1.close(ec);
+
+ spp::socket::native_handle_type native_socket4 = socket1.native_handle();
+ (void)native_socket4;
+
+ socket1.cancel();
+ socket1.cancel(ec);
+
+ bool at_mark1 = socket1.at_mark();
+ (void)at_mark1;
+ bool at_mark2 = socket1.at_mark(ec);
+ (void)at_mark2;
+
+ std::size_t available1 = socket1.available();
+ (void)available1;
+ std::size_t available2 = socket1.available(ec);
+ (void)available2;
+
+ socket1.bind(spp::endpoint());
+ socket1.bind(spp::endpoint(), ec);
+
+ socket1.connect(spp::endpoint());
+ socket1.connect(spp::endpoint(), ec);
+
+ socket1.async_connect(spp::endpoint(), connect_handler);
+ socket1.async_connect(spp::endpoint(), immediate);
+
+ socket1.set_option(socket_option);
+ socket1.set_option(socket_option, ec);
+
+ socket1.get_option(socket_option);
+ socket1.get_option(socket_option, ec);
+
+ socket1.io_control(io_control_command);
+ socket1.io_control(io_control_command, ec);
+
+ spp::endpoint endpoint1 = socket1.local_endpoint();
+ (void)endpoint1;
+ spp::endpoint endpoint2 = socket1.local_endpoint(ec);
+ (void)endpoint2;
+
+ spp::endpoint endpoint3 = socket1.remote_endpoint();
+ (void)endpoint3;
+ spp::endpoint endpoint4 = socket1.remote_endpoint(ec);
+ (void)endpoint4;
+
+ socket1.shutdown(socket_base::shutdown_both);
+ socket1.shutdown(socket_base::shutdown_both, ec);
+
+ // basic_seq_packet_socket functions.
+
+ socket1.send(buffer(mutable_char_buffer), in_flags);
+ socket1.send(buffer(const_char_buffer), in_flags);
+ socket1.send(null_buffers(), in_flags);
+ socket1.send(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.send(buffer(const_char_buffer), in_flags, ec);
+ socket1.send(null_buffers(), in_flags, ec);
+
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
+ socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
+ socket1.async_send(null_buffers(), in_flags, send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
+ socket1.async_send(null_buffers(), in_flags, immediate);
+
+ socket1.receive(buffer(mutable_char_buffer), out_flags);
+ socket1.receive(null_buffers(), out_flags);
+ socket1.receive(buffer(mutable_char_buffer), in_flags, out_flags);
+ socket1.receive(null_buffers(), in_flags, out_flags);
+ socket1.receive(buffer(mutable_char_buffer), in_flags, out_flags, ec);
+ socket1.receive(null_buffers(), in_flags, out_flags, ec);
+
+ socket1.async_receive(buffer(mutable_char_buffer), out_flags,
+ receive_handler);
+ socket1.async_receive(null_buffers(), out_flags, receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ out_flags, receive_handler);
+ socket1.async_receive(null_buffers(), in_flags, out_flags, receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), out_flags, immediate);
+ socket1.async_receive(null_buffers(), out_flags, immediate);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ out_flags, immediate);
+ socket1.async_receive(null_buffers(), in_flags, out_flags, immediate);
+ }
+ catch (std::exception&)
+ {
+ }
+}
+
+} // namespace local_seq_packet_protocol_socket_compile
+
+//------------------------------------------------------------------------------
+
+ASIO_TEST_SUITE
+(
+ "local/seq_packet_protocol",
+ ASIO_COMPILE_TEST_CASE(local_seq_packet_protocol_socket_compile::test)
+)
diff --git a/3rdparty/asio/src/tests/unit/local/stream_protocol.cpp b/3rdparty/asio/src/tests/unit/local/stream_protocol.cpp
index 18a3f63c158..985d143e412 100644
--- a/3rdparty/asio/src/tests/unit/local/stream_protocol.cpp
+++ b/3rdparty/asio/src/tests/unit/local/stream_protocol.cpp
@@ -2,7 +2,7 @@
// stream_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -215,5 +215,5 @@ void test()
ASIO_TEST_SUITE
(
"local/stream_protocol",
- ASIO_TEST_CASE(local_stream_protocol_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(local_stream_protocol_socket_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/packaged_task.cpp b/3rdparty/asio/src/tests/unit/packaged_task.cpp
index fb1b3e8a82c..90b36d9f335 100644
--- a/3rdparty/asio/src/tests/unit/packaged_task.cpp
+++ b/3rdparty/asio/src/tests/unit/packaged_task.cpp
@@ -2,7 +2,7 @@
// packaged_task.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/placeholders.cpp b/3rdparty/asio/src/tests/unit/placeholders.cpp
index 1d75daf6bf1..4f27d319b73 100644
--- a/3rdparty/asio/src/tests/unit/placeholders.cpp
+++ b/3rdparty/asio/src/tests/unit/placeholders.cpp
@@ -2,7 +2,7 @@
// placeholders.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/posix/basic_descriptor.cpp b/3rdparty/asio/src/tests/unit/posix/basic_descriptor.cpp
index 0f1d4944168..f05ed3153cc 100644
--- a/3rdparty/asio/src/tests/unit/posix/basic_descriptor.cpp
+++ b/3rdparty/asio/src/tests/unit/posix/basic_descriptor.cpp
@@ -2,7 +2,7 @@
// basic_descriptor.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/posix/basic_stream_descriptor.cpp b/3rdparty/asio/src/tests/unit/posix/basic_stream_descriptor.cpp
index 65c99df2c37..8ea66857eae 100644
--- a/3rdparty/asio/src/tests/unit/posix/basic_stream_descriptor.cpp
+++ b/3rdparty/asio/src/tests/unit/posix/basic_stream_descriptor.cpp
@@ -2,7 +2,7 @@
// basic_stream_descriptor.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/posix/descriptor.cpp b/3rdparty/asio/src/tests/unit/posix/descriptor.cpp
index 5a26f307f21..c08ef8f4963 100644
--- a/3rdparty/asio/src/tests/unit/posix/descriptor.cpp
+++ b/3rdparty/asio/src/tests/unit/posix/descriptor.cpp
@@ -2,7 +2,7 @@
// descriptor.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/posix/descriptor_base.cpp b/3rdparty/asio/src/tests/unit/posix/descriptor_base.cpp
index 0c28c029a7a..0437c9f852c 100644
--- a/3rdparty/asio/src/tests/unit/posix/descriptor_base.cpp
+++ b/3rdparty/asio/src/tests/unit/posix/descriptor_base.cpp
@@ -2,7 +2,7 @@
// descriptor_base.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp b/3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp
index 8826c937a9f..a8fdc4b2c19 100644
--- a/3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp
+++ b/3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp
@@ -2,7 +2,7 @@
// stream_descriptor.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -55,6 +55,7 @@ void test()
char mutable_char_buffer[128] = "";
const char const_char_buffer[128] = "";
posix::descriptor_base::bytes_readable io_control_command;
+ archetypes::immediate_handler immediate;
archetypes::lazy_handler lazy;
asio::error_code ec;
@@ -66,16 +67,16 @@ void test()
posix::stream_descriptor descriptor3(ioc, native_descriptor1);
posix::stream_descriptor descriptor4(ioc_ex, native_descriptor1);
-#if defined(ASIO_HAS_MOVE)
posix::stream_descriptor descriptor5(std::move(descriptor2));
-#endif // defined(ASIO_HAS_MOVE)
+
+ posix::basic_stream_descriptor<io_context::executor_type> descriptor6(ioc);
+ posix::stream_descriptor descriptor7(std::move(descriptor6));
// basic_stream_descriptor operators.
-#if defined(ASIO_HAS_MOVE)
descriptor1 = posix::stream_descriptor(ioc);
descriptor1 = std::move(descriptor2);
-#endif // defined(ASIO_HAS_MOVE)
+ descriptor1 = std::move(descriptor6);
// basic_io_object functions.
@@ -88,9 +89,9 @@ void test()
= descriptor1.lowest_layer();
(void)lowest_layer;
- const posix::stream_descriptor& descriptor6 = descriptor1;
+ const posix::stream_descriptor& descriptor8 = descriptor1;
const posix::stream_descriptor::lowest_layer_type& lowest_layer2
- = descriptor6.lowest_layer();
+ = descriptor8.lowest_layer();
(void)lowest_layer2;
int native_descriptor2 = -1;
@@ -130,6 +131,7 @@ void test()
descriptor1.wait(posix::descriptor_base::wait_write, ec);
descriptor1.async_wait(posix::descriptor_base::wait_read, &wait_handler);
+ descriptor1.async_wait(posix::descriptor_base::wait_read, immediate);
int i1 = descriptor1.async_wait(posix::descriptor_base::wait_write, lazy);
(void)i1;
@@ -148,6 +150,9 @@ void test()
write_some_handler);
descriptor1.async_write_some(null_buffers(),
write_some_handler);
+ descriptor1.async_write_some(buffer(mutable_char_buffer), immediate);
+ descriptor1.async_write_some(buffer(const_char_buffer), immediate);
+ descriptor1.async_write_some(null_buffers(), immediate);
int i2 = descriptor1.async_write_some(buffer(mutable_char_buffer), lazy);
(void)i2;
int i3 = descriptor1.async_write_some(buffer(const_char_buffer), lazy);
@@ -161,6 +166,8 @@ void test()
descriptor1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
descriptor1.async_read_some(null_buffers(), read_some_handler);
+ descriptor1.async_read_some(buffer(mutable_char_buffer), immediate);
+ descriptor1.async_read_some(null_buffers(), immediate);
int i5 = descriptor1.async_read_some(buffer(mutable_char_buffer), lazy);
(void)i5;
int i6 = descriptor1.async_read_some(null_buffers(), lazy);
@@ -179,5 +186,5 @@ void test()
ASIO_TEST_SUITE
(
"posix/stream_descriptor",
- ASIO_TEST_CASE(posix_stream_descriptor_compile::test)
+ ASIO_COMPILE_TEST_CASE(posix_stream_descriptor_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/post.cpp b/3rdparty/asio/src/tests/unit/post.cpp
index 550c38201b5..d2ef2352299 100644
--- a/3rdparty/asio/src/tests/unit/post.cpp
+++ b/3rdparty/asio/src/tests/unit/post.cpp
@@ -2,7 +2,7 @@
// post.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/prepend.cpp b/3rdparty/asio/src/tests/unit/prepend.cpp
new file mode 100644
index 00000000000..cc26bf9835c
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/prepend.cpp
@@ -0,0 +1,58 @@
+//
+// prepend.cpp
+// ~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/prepend.hpp"
+
+#include "asio/bind_executor.hpp"
+#include "asio/io_context.hpp"
+#include "asio/post.hpp"
+#include "asio/system_timer.hpp"
+#include "unit_test.hpp"
+
+void prepend_test()
+{
+ asio::io_context io1;
+ asio::io_context io2;
+ asio::system_timer timer1(io1);
+ int count = 0;
+
+ timer1.expires_after(asio::chrono::seconds(0));
+ timer1.async_wait(
+ asio::prepend(
+ asio::bind_executor(io2.get_executor(),
+ [&count](int a, int b, asio::error_code)
+ {
+ ++count;
+ ASIO_CHECK(a == 123);
+ ASIO_CHECK(b == 321);
+ }), 123, 321));
+
+ ASIO_CHECK(count == 0);
+
+ io1.run();
+
+ ASIO_CHECK(count == 0);
+
+ io2.run();
+
+ ASIO_CHECK(count == 1);
+}
+
+ASIO_TEST_SUITE
+(
+ "prepend",
+ ASIO_TEST_CASE(prepend_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/random_access_file.cpp b/3rdparty/asio/src/tests/unit/random_access_file.cpp
new file mode 100644
index 00000000000..be703cd395e
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/random_access_file.cpp
@@ -0,0 +1,171 @@
+//
+// random_access_file.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/random_access_file.hpp"
+
+#include "archetypes/async_result.hpp"
+#include "asio/io_context.hpp"
+#include "unit_test.hpp"
+
+// random_access_file_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// random_access_file compile and link correctly. Runtime failures are ignored.
+
+namespace random_access_file_compile {
+
+struct write_some_at_handler
+{
+ write_some_at_handler() {}
+ void operator()(const asio::error_code&, std::size_t) {}
+ write_some_at_handler(write_some_at_handler&&) {}
+private:
+ write_some_at_handler(const write_some_at_handler&);
+};
+
+struct read_some_at_handler
+{
+ read_some_at_handler() {}
+ void operator()(const asio::error_code&, std::size_t) {}
+ read_some_at_handler(read_some_at_handler&&) {}
+private:
+ read_some_at_handler(const read_some_at_handler&);
+};
+
+void test()
+{
+#if defined(ASIO_HAS_FILE)
+ using namespace asio;
+
+ try
+ {
+ io_context ioc;
+ const io_context::executor_type ioc_ex = ioc.get_executor();
+ char mutable_char_buffer[128] = "";
+ const char const_char_buffer[128] = "";
+ archetypes::lazy_handler lazy;
+ asio::error_code ec;
+ const std::string path;
+
+ // basic_random_access_file constructors.
+
+ random_access_file file1(ioc);
+ random_access_file file2(ioc, "", random_access_file::read_only);
+ random_access_file file3(ioc, path, random_access_file::read_only);
+ random_access_file::native_handle_type native_file1 = file1.native_handle();
+ random_access_file file4(ioc, native_file1);
+
+ random_access_file file5(ioc_ex);
+ random_access_file file6(ioc_ex, "", random_access_file::read_only);
+ random_access_file file7(ioc_ex, path, random_access_file::read_only);
+ random_access_file::native_handle_type native_file2 = file1.native_handle();
+ random_access_file file8(ioc_ex, native_file2);
+
+ random_access_file file9(std::move(file8));
+
+ basic_random_access_file<io_context::executor_type> file10(ioc);
+ random_access_file file11(std::move(file10));
+
+ // basic_random_access_file operators.
+
+ file1 = random_access_file(ioc);
+ file1 = std::move(file2);
+ file1 = std::move(file10);
+
+ // basic_io_object functions.
+
+ random_access_file::executor_type ex = file1.get_executor();
+ (void)ex;
+
+ // basic_random_access_file functions.
+
+ file1.open("", random_access_file::read_only);
+ file1.open("", random_access_file::read_only, ec);
+
+ file1.open(path, random_access_file::read_only);
+ file1.open(path, random_access_file::read_only, ec);
+
+ random_access_file::native_handle_type native_file3 = file1.native_handle();
+ file1.assign(native_file3);
+ random_access_file::native_handle_type native_file4 = file1.native_handle();
+ file1.assign(native_file4, ec);
+
+ bool is_open = file1.is_open();
+ (void)is_open;
+
+ file1.close();
+ file1.close(ec);
+
+ random_access_file::native_handle_type native_file5 = file1.native_handle();
+ (void)native_file5;
+
+ random_access_file::native_handle_type native_file6 = file1.release();
+ (void)native_file6;
+ random_access_file::native_handle_type native_file7 = file1.release(ec);
+ (void)native_file7;
+
+ file1.cancel();
+ file1.cancel(ec);
+
+ asio::uint64_t s1 = file1.size();
+ (void)s1;
+ asio::uint64_t s2 = file1.size(ec);
+ (void)s2;
+
+ file1.resize(asio::uint64_t(0));
+ file1.resize(asio::uint64_t(0), ec);
+
+ file1.sync_all();
+ file1.sync_all(ec);
+
+ file1.sync_data();
+ file1.sync_data(ec);
+
+ file1.write_some_at(0, buffer(mutable_char_buffer));
+ file1.write_some_at(0, buffer(const_char_buffer));
+ file1.write_some_at(0, buffer(mutable_char_buffer), ec);
+ file1.write_some_at(0, buffer(const_char_buffer), ec);
+
+ file1.async_write_some_at(0, buffer(mutable_char_buffer),
+ write_some_at_handler());
+ file1.async_write_some_at(0, buffer(const_char_buffer),
+ write_some_at_handler());
+ int i1 = file1.async_write_some_at(0, buffer(mutable_char_buffer), lazy);
+ (void)i1;
+ int i2 = file1.async_write_some_at(0, buffer(const_char_buffer), lazy);
+ (void)i2;
+
+ file1.read_some_at(0, buffer(mutable_char_buffer));
+ file1.read_some_at(0, buffer(mutable_char_buffer), ec);
+
+ file1.async_read_some_at(0, buffer(mutable_char_buffer),
+ read_some_at_handler());
+ int i3 = file1.async_read_some_at(0, buffer(mutable_char_buffer), lazy);
+ (void)i3;
+ }
+ catch (std::exception&)
+ {
+ }
+#endif // defined(ASIO_HAS_FILE)
+}
+
+} // namespace random_access_file_compile
+
+ASIO_TEST_SUITE
+(
+ "random_access_file",
+ ASIO_COMPILE_TEST_CASE(random_access_file_compile::test)
+)
diff --git a/3rdparty/asio/src/tests/unit/read.cpp b/3rdparty/asio/src/tests/unit/read.cpp
index bd0e9592ca9..a268c041d9b 100644
--- a/3rdparty/asio/src/tests/unit/read.cpp
+++ b/3rdparty/asio/src/tests/unit/read.cpp
@@ -2,7 +2,7 @@
// read.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,7 +16,9 @@
// Test that header file is self-contained.
#include "asio/read.hpp"
+#include <array>
#include <cstring>
+#include <functional>
#include <vector>
#include "archetypes/async_result.hpp"
#include "asio/io_context.hpp"
@@ -24,20 +26,10 @@
#include "asio/streambuf.hpp"
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
#if defined(ASIO_HAS_BOOST_ARRAY)
#include <boost/array.hpp>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
using namespace std; // For memcmp, memcpy and memset.
class test_stream
@@ -53,7 +45,7 @@ public:
{
}
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return io_context_.get_executor();
}
@@ -121,12 +113,12 @@ public:
template <typename Mutable_Buffers, typename Handler>
void async_read_some(const Mutable_Buffers& buffers,
- ASIO_MOVE_ARG(Handler) handler)
+ Handler&& handler)
{
size_t bytes_transferred = read_some(buffers);
asio::post(get_executor(),
asio::detail::bind_handler(
- ASIO_MOVE_CAST(Handler)(handler),
+ static_cast<Handler&&>(handler),
asio::error_code(), bytes_transferred));
}
@@ -439,11 +431,7 @@ bool old_style_transfer_all(const asio::error_code& ec,
struct short_transfer
{
short_transfer() {}
-#if defined(ASIO_HAS_MOVE)
short_transfer(short_transfer&&) {}
-#else // defined(ASIO_HAS_MOVE)
- short_transfer(const short_transfer&) {}
-#endif // defined(ASIO_HAS_MOVE)
size_t operator()(const asio::error_code& ec,
size_t /*bytes_transferred*/)
{
@@ -2475,11 +2463,7 @@ void async_read_handler(const asio::error_code& e,
void test_3_arg_mutable_buffer_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2535,11 +2519,7 @@ void test_3_arg_mutable_buffer_async_read()
void test_3_arg_boost_array_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2598,15 +2578,10 @@ void test_3_arg_boost_array_buffers_async_read()
void test_3_arg_std_array_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_stream s(ioc);
char read_buf[sizeof(read_data)];
@@ -2656,16 +2631,11 @@ void test_3_arg_std_array_buffers_async_read()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_3_arg_vector_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2723,11 +2693,7 @@ void test_3_arg_vector_buffers_async_read()
void test_3_arg_dynamic_string_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2789,11 +2755,7 @@ void test_3_arg_dynamic_string_async_read()
void test_3_arg_streambuf_async_read()
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2852,11 +2814,7 @@ void test_3_arg_streambuf_async_read()
void test_4_arg_mutable_buffer_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3193,11 +3151,7 @@ void test_4_arg_mutable_buffer_async_read()
void test_4_arg_boost_array_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3537,15 +3491,10 @@ void test_4_arg_boost_array_buffers_async_read()
void test_4_arg_std_array_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_stream s(ioc);
char read_buf[sizeof(read_data)];
@@ -3876,16 +3825,11 @@ void test_4_arg_std_array_buffers_async_read()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_4_arg_vector_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -4224,11 +4168,7 @@ void test_4_arg_vector_buffers_async_read()
void test_4_arg_dynamic_string_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -4595,11 +4535,7 @@ void test_4_arg_dynamic_string_async_read()
void test_4_arg_streambuf_async_read()
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
diff --git a/3rdparty/asio/src/tests/unit/read_at.cpp b/3rdparty/asio/src/tests/unit/read_at.cpp
index bfe4af75d29..72d21bc3236 100644
--- a/3rdparty/asio/src/tests/unit/read_at.cpp
+++ b/3rdparty/asio/src/tests/unit/read_at.cpp
@@ -2,7 +2,7 @@
// read_at.cpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,27 +16,19 @@
// Test that header file is self-contained.
#include "asio/read_at.hpp"
+#include <array>
#include <cstring>
+#include <functional>
#include "archetypes/async_result.hpp"
#include "asio/io_context.hpp"
#include "asio/post.hpp"
#include "asio/streambuf.hpp"
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
#if defined(ASIO_HAS_BOOST_ARRAY)
#include <boost/array.hpp>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
using namespace std; // For memcmp, memcpy and memset.
class test_random_access_device
@@ -51,7 +43,7 @@ public:
{
}
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return io_context_.get_executor();
}
@@ -125,12 +117,12 @@ public:
template <typename Mutable_Buffers, typename Handler>
void async_read_some_at(asio::uint64_t offset,
- const Mutable_Buffers& buffers, ASIO_MOVE_ARG(Handler) handler)
+ const Mutable_Buffers& buffers, Handler&& handler)
{
size_t bytes_transferred = read_some_at(offset, buffers);
asio::post(get_executor(),
asio::detail::bind_handler(
- ASIO_MOVE_CAST(Handler)(handler),
+ static_cast<Handler&&>(handler),
asio::error_code(), bytes_transferred));
}
@@ -479,11 +471,7 @@ bool old_style_transfer_all(const asio::error_code& ec,
struct short_transfer
{
short_transfer() {}
-#if defined(ASIO_HAS_MOVE)
short_transfer(short_transfer&&) {}
-#else // defined(ASIO_HAS_MOVE)
- short_transfer(const short_transfer&) {}
-#endif // defined(ASIO_HAS_MOVE)
size_t operator()(const asio::error_code& ec,
size_t /*bytes_transferred*/)
{
@@ -3436,11 +3424,7 @@ void async_read_handler(const asio::error_code& e,
void test_4_arg_mutable_buffer_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3532,11 +3516,7 @@ void test_4_arg_mutable_buffer_async_read_at()
void test_4_arg_boost_array_buffers_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3631,15 +3611,10 @@ void test_4_arg_boost_array_buffers_async_read_at()
void test_4_arg_std_array_buffers_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_random_access_device s(ioc);
char read_buf[sizeof(read_data)];
@@ -3725,16 +3700,11 @@ void test_4_arg_std_array_buffers_async_read_at()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_4_arg_vector_buffers_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3827,11 +3797,7 @@ void test_4_arg_vector_buffers_async_read_at()
void test_4_arg_streambuf_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3927,11 +3893,7 @@ void test_4_arg_streambuf_async_read_at()
void test_5_arg_mutable_buffer_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -4625,11 +4587,7 @@ void test_5_arg_mutable_buffer_async_read_at()
void test_5_arg_boost_array_buffers_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -5326,15 +5284,10 @@ void test_5_arg_boost_array_buffers_async_read_at()
void test_5_arg_std_array_buffers_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_random_access_device s(ioc);
char read_buf[sizeof(read_data)];
@@ -6022,16 +5975,11 @@ void test_5_arg_std_array_buffers_async_read_at()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_5_arg_vector_buffers_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -6726,11 +6674,7 @@ void test_5_arg_vector_buffers_async_read_at()
void test_5_arg_streambuf_async_read_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
diff --git a/3rdparty/asio/src/tests/unit/read_until.cpp b/3rdparty/asio/src/tests/unit/read_until.cpp
index 0b9979ed629..139fcf6f0a9 100644
--- a/3rdparty/asio/src/tests/unit/read_until.cpp
+++ b/3rdparty/asio/src/tests/unit/read_until.cpp
@@ -2,7 +2,7 @@
// read_until.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -17,18 +17,13 @@
#include "asio/read_until.hpp"
#include <cstring>
+#include <functional>
#include "archetypes/async_result.hpp"
#include "asio/io_context.hpp"
#include "asio/post.hpp"
#include "asio/streambuf.hpp"
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
class test_stream
{
public:
@@ -42,7 +37,7 @@ public:
{
}
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return io_context_.get_executor();
}
@@ -88,7 +83,7 @@ public:
size_t bytes_transferred = read_some(buffers);
asio::post(get_executor(),
asio::detail::bind_handler(
- ASIO_MOVE_CAST(Handler)(handler),
+ static_cast<Handler&&>(handler),
asio::error_code(), bytes_transferred));
}
@@ -673,11 +668,7 @@ void async_read_handler(
void test_dynamic_string_async_read_until_char()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -836,11 +827,7 @@ void test_dynamic_string_async_read_until_char()
void test_streambuf_async_read_until_char()
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -996,11 +983,7 @@ void test_streambuf_async_read_until_char()
void test_dynamic_string_async_read_until_string()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -1159,11 +1142,7 @@ void test_dynamic_string_async_read_until_string()
void test_streambuf_async_read_until_string()
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -1319,11 +1298,7 @@ void test_streambuf_async_read_until_string()
void test_dynamic_string_async_read_until_match_condition()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -1482,11 +1457,7 @@ void test_dynamic_string_async_read_until_match_condition()
void test_streambuf_async_read_until_match_condition()
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
diff --git a/3rdparty/asio/src/tests/unit/readable_pipe.cpp b/3rdparty/asio/src/tests/unit/readable_pipe.cpp
new file mode 100644
index 00000000000..6f29710e3da
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/readable_pipe.cpp
@@ -0,0 +1,131 @@
+//
+// readable_pipe.cpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header pipe is self-contained.
+#include "asio/readable_pipe.hpp"
+
+#include "archetypes/async_result.hpp"
+#include "asio/io_context.hpp"
+#include "unit_test.hpp"
+
+// readable_pipe_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// readable_pipe compile and link correctly. Runtime failures are ignored.
+
+namespace readable_pipe_compile {
+
+struct write_some_handler
+{
+ write_some_handler() {}
+ void operator()(const asio::error_code&, std::size_t) {}
+ write_some_handler(write_some_handler&&) {}
+private:
+ write_some_handler(const write_some_handler&);
+};
+
+struct read_some_handler
+{
+ read_some_handler() {}
+ void operator()(const asio::error_code&, std::size_t) {}
+ read_some_handler(read_some_handler&&) {}
+private:
+ read_some_handler(const read_some_handler&);
+};
+
+void test()
+{
+#if defined(ASIO_HAS_PIPE)
+ using namespace asio;
+
+ try
+ {
+ io_context ioc;
+ const io_context::executor_type ioc_ex = ioc.get_executor();
+ char mutable_char_buffer[128] = "";
+ archetypes::lazy_handler lazy;
+ asio::error_code ec;
+ const std::string path;
+
+ // basic_readable_pipe constructors.
+
+ readable_pipe pipe1(ioc);
+ readable_pipe::native_handle_type native_pipe1 = pipe1.native_handle();
+ readable_pipe pipe2(ioc, native_pipe1);
+
+ readable_pipe pipe3(ioc_ex);
+ readable_pipe::native_handle_type native_pipe2 = pipe1.native_handle();
+ readable_pipe pipe4(ioc_ex, native_pipe2);
+
+ readable_pipe pipe5(std::move(pipe4));
+
+ basic_readable_pipe<io_context::executor_type> pipe6(ioc);
+ readable_pipe pipe7(std::move(pipe6));
+
+ // basic_readable_pipe operators.
+
+ pipe1 = readable_pipe(ioc);
+ pipe1 = std::move(pipe2);
+ pipe1 = std::move(pipe6);
+
+ // basic_io_object functions.
+
+ readable_pipe::executor_type ex = pipe1.get_executor();
+ (void)ex;
+
+ // basic_readable_pipe functions.
+
+ readable_pipe::native_handle_type native_pipe3 = pipe1.native_handle();
+ pipe1.assign(native_pipe3);
+ readable_pipe::native_handle_type native_pipe4 = pipe1.native_handle();
+ pipe1.assign(native_pipe4, ec);
+
+ bool is_open = pipe1.is_open();
+ (void)is_open;
+
+ pipe1.close();
+ pipe1.close(ec);
+
+ readable_pipe::native_handle_type native_pipe5 = pipe1.release();
+ (void)native_pipe5;
+ readable_pipe::native_handle_type native_pipe6 = pipe1.release(ec);
+ (void)native_pipe6;
+
+ readable_pipe::native_handle_type native_pipe7 = pipe1.native_handle();
+ (void)native_pipe7;
+
+ pipe1.cancel();
+ pipe1.cancel(ec);
+
+ pipe1.read_some(buffer(mutable_char_buffer));
+ pipe1.read_some(buffer(mutable_char_buffer), ec);
+
+ pipe1.async_read_some(buffer(mutable_char_buffer), read_some_handler());
+ int i3 = pipe1.async_read_some(buffer(mutable_char_buffer), lazy);
+ (void)i3;
+ }
+ catch (std::exception&)
+ {
+ }
+#endif // defined(ASIO_HAS_PIPE)
+}
+
+} // namespace readable_pipe_compile
+
+ASIO_TEST_SUITE
+(
+ "readable_pipe",
+ ASIO_COMPILE_TEST_CASE(readable_pipe_compile::test)
+)
diff --git a/3rdparty/asio/src/tests/unit/recycling_allocator.cpp b/3rdparty/asio/src/tests/unit/recycling_allocator.cpp
new file mode 100644
index 00000000000..cc4654fc9f0
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/recycling_allocator.cpp
@@ -0,0 +1,80 @@
+//
+// recycling_allocator.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/recycling_allocator.hpp"
+
+#include "unit_test.hpp"
+#include <vector>
+#include "asio/detail/type_traits.hpp"
+
+void recycling_allocator_test()
+{
+ ASIO_CHECK((
+ asio::is_same<
+ asio::recycling_allocator<int>::value_type,
+ int
+ >::value));
+
+ ASIO_CHECK((
+ asio::is_same<
+ asio::recycling_allocator<void>::value_type,
+ void
+ >::value));
+
+ ASIO_CHECK((
+ asio::is_same<
+ asio::recycling_allocator<int>::rebind<char>::other,
+ asio::recycling_allocator<char>
+ >::value));
+
+ ASIO_CHECK((
+ asio::is_same<
+ asio::recycling_allocator<void>::rebind<char>::other,
+ asio::recycling_allocator<char>
+ >::value));
+
+ asio::recycling_allocator<int> a1;
+ asio::recycling_allocator<int> a2(a1);
+
+ ASIO_CHECK(a1 == a2);
+ ASIO_CHECK(!(a1 != a2));
+
+ asio::recycling_allocator<void> a3;
+ asio::recycling_allocator<void> a4(a3);
+
+ ASIO_CHECK(a3 == a4);
+ ASIO_CHECK(!(a3 != a4));
+
+ asio::recycling_allocator<int> a5(a4);
+ (void)a5;
+
+ asio::recycling_allocator<void> a6(a5);
+ (void)a6;
+
+ int* p = a1.allocate(42);
+ ASIO_CHECK(p != 0);
+
+ a1.deallocate(p, 42);
+
+ std::vector<int, asio::recycling_allocator<int> > v(42);
+ ASIO_CHECK(v.size() == 42);
+}
+
+ASIO_TEST_SUITE
+(
+ "recycling_allocator",
+ ASIO_TEST_CASE(recycling_allocator_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/redirect_error.cpp b/3rdparty/asio/src/tests/unit/redirect_error.cpp
index 219a5c5b355..7a581495566 100644
--- a/3rdparty/asio/src/tests/unit/redirect_error.cpp
+++ b/3rdparty/asio/src/tests/unit/redirect_error.cpp
@@ -2,7 +2,7 @@
// redirect_error.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,10 +16,106 @@
// Test that header file is self-contained.
#include "asio/redirect_error.hpp"
+#include "asio/bind_executor.hpp"
+#include "asio/deferred.hpp"
+#include "asio/io_context.hpp"
+#include "asio/post.hpp"
+#include "asio/system_timer.hpp"
+#include "asio/use_future.hpp"
#include "unit_test.hpp"
+struct redirect_error_handler
+{
+ int* count_;
+
+ explicit redirect_error_handler(int* c)
+ : count_(c)
+ {
+ }
+
+ void operator()()
+ {
+ ++(*count_);
+ }
+};
+
+void redirect_error_test()
+{
+ asio::io_context io1;
+ asio::io_context io2;
+ asio::system_timer timer1(io1);
+ asio::error_code ec = asio::error::would_block;
+ int count = 0;
+
+ timer1.expires_after(asio::chrono::seconds(0));
+ timer1.async_wait(
+ asio::redirect_error(
+ asio::bind_executor(io2.get_executor(),
+ redirect_error_handler(&count)), ec));
+
+ ASIO_CHECK(ec == asio::error::would_block);
+ ASIO_CHECK(count == 0);
+
+ io1.run();
+
+ ASIO_CHECK(ec == asio::error::would_block);
+ ASIO_CHECK(count == 0);
+
+ io2.run();
+
+ ASIO_CHECK(!ec);
+ ASIO_CHECK(count == 1);
+
+ ec = asio::error::would_block;
+ timer1.async_wait(
+ asio::redirect_error(
+ asio::bind_executor(io2.get_executor(),
+ asio::deferred), ec))(redirect_error_handler(&count));
+
+ ASIO_CHECK(ec == asio::error::would_block);
+ ASIO_CHECK(count == 1);
+
+ io1.restart();
+ io1.run();
+
+ ASIO_CHECK(ec == asio::error::would_block);
+ ASIO_CHECK(count == 1);
+
+ io2.restart();
+ io2.run();
+
+ ASIO_CHECK(!ec);
+ ASIO_CHECK(count == 2);
+
+#if defined(ASIO_HAS_STD_FUTURE_CLASS)
+ ec = asio::error::would_block;
+ std::future<void> f = timer1.async_wait(
+ asio::redirect_error(
+ asio::bind_executor(io2.get_executor(),
+ asio::use_future), ec));
+
+ ASIO_CHECK(ec == asio::error::would_block);
+ ASIO_CHECK(f.wait_for(std::chrono::seconds(0))
+ == std::future_status::timeout);
+
+ io1.restart();
+ io1.run();
+
+ ASIO_CHECK(ec == asio::error::would_block);
+ ASIO_CHECK(f.wait_for(std::chrono::seconds(0))
+ == std::future_status::timeout);
+
+ io2.restart();
+ io2.run();
+
+ ASIO_CHECK(!ec);
+ ASIO_CHECK(f.wait_for(std::chrono::seconds(0))
+ == std::future_status::ready);
+#endif // defined(ASIO_HAS_STD_FUTURE_CLASS)
+}
+
ASIO_TEST_SUITE
(
"redirect_error",
- ASIO_TEST_CASE(null_test)
+ ASIO_TEST_CASE(redirect_error_test)
)
diff --git a/3rdparty/asio/src/tests/unit/registered_buffer.cpp b/3rdparty/asio/src/tests/unit/registered_buffer.cpp
new file mode 100644
index 00000000000..09c33415a14
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/registered_buffer.cpp
@@ -0,0 +1,111 @@
+//
+// registered_buffer.cpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/registered_buffer.hpp"
+
+#include "unit_test.hpp"
+
+//------------------------------------------------------------------------------
+
+// registered_buffer_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all the mutable_registered_buffer and
+// const_registered_buffer classes compile and link correctly. Runtime
+// failures are ignored.
+
+namespace registered_buffer_compile {
+
+using namespace asio;
+
+void test()
+{
+ try
+ {
+ // mutable_registered_buffer constructors.
+
+ mutable_registered_buffer mb1;
+ mutable_registered_buffer mb2(mb1);
+ (void)mb2;
+
+ // mutable_registered_buffer functions.
+
+ mutable_buffer b1 = mb1.buffer();
+ (void)b1;
+
+ void* ptr1 = mb1.data();
+ (void)ptr1;
+
+ std::size_t n1 = mb1.size();
+ (void)n1;
+
+ registered_buffer_id id1 = mb1.id();
+ (void)id1;
+
+ // mutable_registered_buffer operators.
+
+ mb1 += 128;
+ mb1 = mb2 + 128;
+ mb1 = 128 + mb2;
+
+ // const_registered_buffer constructors.
+
+ const_registered_buffer cb1;
+ const_registered_buffer cb2(cb1);
+ (void)cb2;
+ const_registered_buffer cb3(mb1);
+ (void)cb3;
+
+ // const_registered_buffer functions.
+
+ const_buffer b2 = cb1.buffer();
+ (void)b2;
+
+ const void* ptr2 = cb1.data();
+ (void)ptr2;
+
+ std::size_t n2 = cb1.size();
+ (void)n2;
+
+ registered_buffer_id id2 = cb1.id();
+ (void)id2;
+
+ // const_registered_buffer operators.
+
+ cb1 += 128;
+ cb1 = cb2 + 128;
+ cb1 = 128 + cb2;
+
+ // buffer function overloads.
+
+ mb1 = buffer(mb2);
+ mb1 = buffer(mb2, 128);
+ cb1 = buffer(cb2);
+ cb1 = buffer(cb2, 128);
+ }
+ catch (std::exception&)
+ {
+ }
+}
+
+} // namespace buffer_compile
+
+//------------------------------------------------------------------------------
+
+ASIO_TEST_SUITE
+(
+ "registered_buffer",
+ ASIO_COMPILE_TEST_CASE(registered_buffer_compile::test)
+)
diff --git a/3rdparty/asio/src/tests/unit/serial_port.cpp b/3rdparty/asio/src/tests/unit/serial_port.cpp
index 23f9610f982..9bbafd34d9b 100644
--- a/3rdparty/asio/src/tests/unit/serial_port.cpp
+++ b/3rdparty/asio/src/tests/unit/serial_port.cpp
@@ -2,7 +2,7 @@
// serial_port.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -34,22 +34,18 @@ struct write_some_handler
{
write_some_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
write_some_handler(write_some_handler&&) {}
private:
write_some_handler(const write_some_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
struct read_some_handler
{
read_some_handler() {}
void operator()(const asio::error_code&, std::size_t) {}
-#if defined(ASIO_HAS_MOVE)
read_some_handler(read_some_handler&&) {}
private:
read_some_handler(const read_some_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
void test()
@@ -83,16 +79,16 @@ void test()
serial_port::native_handle_type native_port2 = port1.native_handle();
serial_port port6(ioc_ex, native_port2);
-#if defined(ASIO_HAS_MOVE)
serial_port port7(std::move(port6));
-#endif // defined(ASIO_HAS_MOVE)
+
+ basic_serial_port<io_context::executor_type> port8(ioc);
+ serial_port port9(std::move(port8));
// basic_serial_port operators.
-#if defined(ASIO_HAS_MOVE)
port1 = serial_port(ioc);
port1 = std::move(port2);
-#endif // defined(ASIO_HAS_MOVE)
+ port1 = std::move(port8);
// basic_io_object functions.
@@ -104,8 +100,8 @@ void test()
serial_port::lowest_layer_type& lowest_layer = port1.lowest_layer();
(void)lowest_layer;
- const serial_port& port8 = port1;
- const serial_port::lowest_layer_type& lowest_layer2 = port8.lowest_layer();
+ const serial_port& port10 = port1;
+ const serial_port::lowest_layer_type& lowest_layer2 = port10.lowest_layer();
(void)lowest_layer2;
port1.open("null");
@@ -169,5 +165,5 @@ void test()
ASIO_TEST_SUITE
(
"serial_port",
- ASIO_TEST_CASE(serial_port_compile::test)
+ ASIO_COMPILE_TEST_CASE(serial_port_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/serial_port_base.cpp b/3rdparty/asio/src/tests/unit/serial_port_base.cpp
index 1575a6d3a3d..1c888ef661c 100644
--- a/3rdparty/asio/src/tests/unit/serial_port_base.cpp
+++ b/3rdparty/asio/src/tests/unit/serial_port_base.cpp
@@ -2,7 +2,7 @@
// serial_port_base.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -95,5 +95,5 @@ void test()
ASIO_TEST_SUITE
(
"serial_port_base",
- ASIO_TEST_CASE(serial_port_base_compile::test)
+ ASIO_COMPILE_TEST_CASE(serial_port_base_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/signal_set.cpp b/3rdparty/asio/src/tests/unit/signal_set.cpp
index cd8bd004154..962be8ba92e 100644
--- a/3rdparty/asio/src/tests/unit/signal_set.cpp
+++ b/3rdparty/asio/src/tests/unit/signal_set.cpp
@@ -2,7 +2,7 @@
// signal_set.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -66,6 +66,9 @@ void test()
set1.add(1);
set1.add(1, ec);
+ set1.add(1, signal_set::flags::dont_care);
+ set1.add(1, signal_set::flags::dont_care, ec);
+
set1.remove(1);
set1.remove(1, ec);
@@ -91,5 +94,5 @@ void test()
ASIO_TEST_SUITE
(
"signal_set",
- ASIO_TEST_CASE(signal_set_compile::test)
+ ASIO_COMPILE_TEST_CASE(signal_set_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/signal_set_base.cpp b/3rdparty/asio/src/tests/unit/signal_set_base.cpp
new file mode 100644
index 00000000000..7f27e8ccc2e
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/signal_set_base.cpp
@@ -0,0 +1,30 @@
+//
+// signal_set_base.cpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Prevent link dependency on the Boost.System library.
+#if !defined(BOOST_SYSTEM_NO_DEPRECATED)
+#define BOOST_SYSTEM_NO_DEPRECATED
+#endif // !defined(BOOST_SYSTEM_NO_DEPRECATED)
+
+// Test that header file is self-contained.
+#include "asio/signal_set_base.hpp"
+
+#include "unit_test.hpp"
+
+ASIO_TEST_SUITE
+(
+ "signal_set_base",
+ ASIO_TEST_CASE(null_test)
+)
diff --git a/3rdparty/asio/src/tests/unit/socket_base.cpp b/3rdparty/asio/src/tests/unit/socket_base.cpp
index e6eb96b2351..21f63ab433c 100644
--- a/3rdparty/asio/src/tests/unit/socket_base.cpp
+++ b/3rdparty/asio/src/tests/unit/socket_base.cpp
@@ -2,7 +2,7 @@
// socket_base.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -645,6 +645,6 @@ void test()
ASIO_TEST_SUITE
(
"socket_base",
- ASIO_TEST_CASE(socket_base_compile::test)
+ ASIO_COMPILE_TEST_CASE(socket_base_compile::test)
ASIO_TEST_CASE(socket_base_runtime::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ssl/context.cpp b/3rdparty/asio/src/tests/unit/ssl/context.cpp
index 4ba3aa98c02..621bf11c4a0 100644
--- a/3rdparty/asio/src/tests/unit/ssl/context.cpp
+++ b/3rdparty/asio/src/tests/unit/ssl/context.cpp
@@ -2,7 +2,7 @@
// context.cpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ssl/context_base.cpp b/3rdparty/asio/src/tests/unit/ssl/context_base.cpp
index 40f07ca3850..9ddddad3a8e 100644
--- a/3rdparty/asio/src/tests/unit/ssl/context_base.cpp
+++ b/3rdparty/asio/src/tests/unit/ssl/context_base.cpp
@@ -2,7 +2,7 @@
// context_base.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ssl/error.cpp b/3rdparty/asio/src/tests/unit/ssl/error.cpp
index 90286d681bc..633d7b61e8f 100644
--- a/3rdparty/asio/src/tests/unit/ssl/error.cpp
+++ b/3rdparty/asio/src/tests/unit/ssl/error.cpp
@@ -2,7 +2,7 @@
// error.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ssl/host_name_verification.cpp b/3rdparty/asio/src/tests/unit/ssl/host_name_verification.cpp
index fc16dbe0426..7126e4b083a 100644
--- a/3rdparty/asio/src/tests/unit/ssl/host_name_verification.cpp
+++ b/3rdparty/asio/src/tests/unit/ssl/host_name_verification.cpp
@@ -2,7 +2,7 @@
// host_name_verification.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ssl/rfc2818_verification.cpp b/3rdparty/asio/src/tests/unit/ssl/rfc2818_verification.cpp
index 21cf82f1f4e..adcfa95ded8 100644
--- a/3rdparty/asio/src/tests/unit/ssl/rfc2818_verification.cpp
+++ b/3rdparty/asio/src/tests/unit/ssl/rfc2818_verification.cpp
@@ -2,7 +2,7 @@
// rfc2818_verification.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ssl/stream.cpp b/3rdparty/asio/src/tests/unit/ssl/stream.cpp
index 7a6eeb1f1f1..467115169b9 100644
--- a/3rdparty/asio/src/tests/unit/ssl/stream.cpp
+++ b/3rdparty/asio/src/tests/unit/ssl/stream.cpp
@@ -2,7 +2,7 @@
// stream.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -75,17 +75,13 @@ void test()
ip::tcp::socket socket1(ioc, ip::tcp::v4());
ssl::stream<ip::tcp::socket&> stream2(socket1, context);
-#if defined(ASIO_HAS_MOVE)
ssl::stream<ip::tcp::socket> stream3
= ssl::stream<ip::tcp::socket>(ioc, context);
ssl::stream<ip::tcp::socket> stream4(std::move(stream3));
-#endif // defined(ASIO_HAS_MOVE)
// ssl::stream assignment.
-#if defined(ASIO_HAS_MOVE)
stream3 = std::move(stream4);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -199,5 +195,5 @@ void test()
ASIO_TEST_SUITE
(
"ssl/stream",
- ASIO_TEST_CASE(ssl_stream_compile::test)
+ ASIO_COMPILE_TEST_CASE(ssl_stream_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/ssl/stream_base.cpp b/3rdparty/asio/src/tests/unit/ssl/stream_base.cpp
index 03573e17aed..7e6a1e62ef0 100644
--- a/3rdparty/asio/src/tests/unit/ssl/stream_base.cpp
+++ b/3rdparty/asio/src/tests/unit/ssl/stream_base.cpp
@@ -2,7 +2,7 @@
// stream_base.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/static_thread_pool.cpp b/3rdparty/asio/src/tests/unit/static_thread_pool.cpp
index 64071223942..b9b050bf7ee 100644
--- a/3rdparty/asio/src/tests/unit/static_thread_pool.cpp
+++ b/3rdparty/asio/src/tests/unit/static_thread_pool.cpp
@@ -2,7 +2,7 @@
// static_thread_pool.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/steady_timer.cpp b/3rdparty/asio/src/tests/unit/steady_timer.cpp
index 054e80c961d..fe2c041db4e 100644
--- a/3rdparty/asio/src/tests/unit/steady_timer.cpp
+++ b/3rdparty/asio/src/tests/unit/steady_timer.cpp
@@ -2,7 +2,7 @@
// steady_timer.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/strand.cpp b/3rdparty/asio/src/tests/unit/strand.cpp
index bf801049654..90ae2bc22a8 100644
--- a/3rdparty/asio/src/tests/unit/strand.cpp
+++ b/3rdparty/asio/src/tests/unit/strand.cpp
@@ -2,7 +2,7 @@
// strand.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,6 +16,7 @@
// Test that header file is self-contained.
#include "asio/strand.hpp"
+#include <functional>
#include <sstream>
#include "asio/executor.hpp"
#include "asio/io_context.hpp"
@@ -30,24 +31,13 @@
# include "asio/steady_timer.hpp"
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
#if defined(ASIO_HAS_BOOST_DATE_TIME)
typedef deadline_timer timer;
namespace chronons = boost::posix_time;
-#elif defined(ASIO_HAS_CHRONO)
+#else // defined(ASIO_HAS_BOOST_DATE_TIME)
typedef steady_timer timer;
namespace chronons = asio::chrono;
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
@@ -303,7 +293,7 @@ void strand_execute_test()
strand<io_context::executor_type> s1 = make_strand(ioc);
int count = 0;
- asio::execution::execute(s1, bindns::bind(increment, &count));
+ s1.execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -317,8 +307,7 @@ void strand_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(s1, asio::execution::blocking.possibly),
+ asio::require(s1, asio::execution::blocking.possibly).execute(
bindns::bind(increment, &count));
// No handlers can be called until run() is called.
@@ -333,8 +322,7 @@ void strand_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(s1, asio::execution::blocking.never),
+ asio::require(s1, asio::execution::blocking.never).execute(
bindns::bind(increment, &count));
// No handlers can be called until run() is called.
@@ -351,11 +339,10 @@ void strand_execute_test()
ioc.restart();
ASIO_CHECK(!ioc.stopped());
- asio::execution::execute(
- asio::require(s1,
- asio::execution::blocking.never,
- asio::execution::outstanding_work.tracked),
- bindns::bind(increment, &count));
+ asio::require(s1,
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.tracked
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -369,11 +356,10 @@ void strand_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(s1,
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked),
- bindns::bind(increment, &count));
+ asio::require(s1,
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -387,12 +373,11 @@ void strand_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(s1,
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.fork),
- bindns::bind(increment, &count));
+ asio::require(s1,
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.fork
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -406,12 +391,11 @@ void strand_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::require(s1,
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- bindns::bind(increment, &count));
+ asio::require(s1,
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -425,14 +409,13 @@ void strand_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::prefer(
- asio::require(s1,
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator(std::allocator<void>())),
- bindns::bind(increment, &count));
+ asio::prefer(
+ asio::require(s1,
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation),
+ asio::execution::allocator(std::allocator<void>())
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
@@ -446,14 +429,13 @@ void strand_execute_test()
count = 0;
ioc.restart();
- asio::execution::execute(
- asio::prefer(
- asio::require(s1,
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator),
- bindns::bind(increment, &count));
+ asio::prefer(
+ asio::require(s1,
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation),
+ asio::execution::allocator
+ ).execute(bindns::bind(increment, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
diff --git a/3rdparty/asio/src/tests/unit/stream_file.cpp b/3rdparty/asio/src/tests/unit/stream_file.cpp
new file mode 100644
index 00000000000..a4416751cd2
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/stream_file.cpp
@@ -0,0 +1,173 @@
+//
+// stream_file.cpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include "asio/stream_file.hpp"
+
+#include "archetypes/async_result.hpp"
+#include "asio/io_context.hpp"
+#include "unit_test.hpp"
+
+// stream_file_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// stream_file compile and link correctly. Runtime failures are ignored.
+
+namespace stream_file_compile {
+
+struct write_some_handler
+{
+ write_some_handler() {}
+ void operator()(const asio::error_code&, std::size_t) {}
+ write_some_handler(write_some_handler&&) {}
+private:
+ write_some_handler(const write_some_handler&);
+};
+
+struct read_some_handler
+{
+ read_some_handler() {}
+ void operator()(const asio::error_code&, std::size_t) {}
+ read_some_handler(read_some_handler&&) {}
+private:
+ read_some_handler(const read_some_handler&);
+};
+
+void test()
+{
+#if defined(ASIO_HAS_FILE)
+ using namespace asio;
+
+ try
+ {
+ io_context ioc;
+ const io_context::executor_type ioc_ex = ioc.get_executor();
+ char mutable_char_buffer[128] = "";
+ const char const_char_buffer[128] = "";
+ archetypes::lazy_handler lazy;
+ asio::error_code ec;
+ const std::string path;
+
+ // basic_stream_file constructors.
+
+ stream_file file1(ioc);
+ stream_file file2(ioc, "", stream_file::read_only);
+ stream_file file3(ioc, path, stream_file::read_only);
+ stream_file::native_handle_type native_file1 = file1.native_handle();
+ stream_file file4(ioc, native_file1);
+
+ stream_file file5(ioc_ex);
+ stream_file file6(ioc_ex, "", stream_file::read_only);
+ stream_file file7(ioc_ex, path, stream_file::read_only);
+ stream_file::native_handle_type native_file2 = file1.native_handle();
+ stream_file file8(ioc_ex, native_file2);
+
+ stream_file file9(std::move(file8));
+
+ basic_stream_file<io_context::executor_type> file10(ioc);
+ stream_file file11(std::move(file10));
+
+ // basic_stream_file operators.
+
+ file1 = stream_file(ioc);
+ file1 = std::move(file2);
+ file1 = std::move(file10);
+
+ // basic_io_object functions.
+
+ stream_file::executor_type ex = file1.get_executor();
+ (void)ex;
+
+ // basic_stream_file functions.
+
+ file1.open("", stream_file::read_only);
+ file1.open("", stream_file::read_only, ec);
+
+ file1.open(path, stream_file::read_only);
+ file1.open(path, stream_file::read_only, ec);
+
+ stream_file::native_handle_type native_file3 = file1.native_handle();
+ file1.assign(native_file3);
+ stream_file::native_handle_type native_file4 = file1.native_handle();
+ file1.assign(native_file4, ec);
+
+ bool is_open = file1.is_open();
+ (void)is_open;
+
+ file1.close();
+ file1.close(ec);
+
+ stream_file::native_handle_type native_file5 = file1.native_handle();
+ (void)native_file5;
+
+ stream_file::native_handle_type native_file6 = file1.release();
+ (void)native_file6;
+ stream_file::native_handle_type native_file7 = file1.release(ec);
+ (void)native_file7;
+
+ file1.cancel();
+ file1.cancel(ec);
+
+ asio::uint64_t s1 = file1.size();
+ (void)s1;
+ asio::uint64_t s2 = file1.size(ec);
+ (void)s2;
+
+ file1.resize(asio::uint64_t(0));
+ file1.resize(asio::uint64_t(0), ec);
+
+ file1.sync_all();
+ file1.sync_all(ec);
+
+ file1.sync_data();
+ file1.sync_data(ec);
+
+ asio::uint64_t s3 = file1.seek(0, stream_file::seek_set);
+ (void)s3;
+ asio::uint64_t s4 = file1.seek(0, stream_file::seek_set, ec);
+ (void)s4;
+
+ file1.write_some(buffer(mutable_char_buffer));
+ file1.write_some(buffer(const_char_buffer));
+ file1.write_some(buffer(mutable_char_buffer), ec);
+ file1.write_some(buffer(const_char_buffer), ec);
+
+ file1.async_write_some(buffer(mutable_char_buffer), write_some_handler());
+ file1.async_write_some(buffer(const_char_buffer), write_some_handler());
+ int i1 = file1.async_write_some(buffer(mutable_char_buffer), lazy);
+ (void)i1;
+ int i2 = file1.async_write_some(buffer(const_char_buffer), lazy);
+ (void)i2;
+
+ file1.read_some(buffer(mutable_char_buffer));
+ file1.read_some(buffer(mutable_char_buffer), ec);
+
+ file1.async_read_some(buffer(mutable_char_buffer), read_some_handler());
+ int i3 = file1.async_read_some(buffer(mutable_char_buffer), lazy);
+ (void)i3;
+ }
+ catch (std::exception&)
+ {
+ }
+#endif // defined(ASIO_HAS_FILE)
+}
+
+} // namespace stream_file_compile
+
+ASIO_TEST_SUITE
+(
+ "stream_file",
+ ASIO_COMPILE_TEST_CASE(stream_file_compile::test)
+)
diff --git a/3rdparty/asio/src/tests/unit/streambuf.cpp b/3rdparty/asio/src/tests/unit/streambuf.cpp
index 7409fce07dc..c1c8477a242 100644
--- a/3rdparty/asio/src/tests/unit/streambuf.cpp
+++ b/3rdparty/asio/src/tests/unit/streambuf.cpp
@@ -2,7 +2,7 @@
// streambuf.cpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/system_context.cpp b/3rdparty/asio/src/tests/unit/system_context.cpp
index 9d4adad4b20..297ab6bd7c1 100644
--- a/3rdparty/asio/src/tests/unit/system_context.cpp
+++ b/3rdparty/asio/src/tests/unit/system_context.cpp
@@ -2,7 +2,7 @@
// system_context.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/system_executor.cpp b/3rdparty/asio/src/tests/unit/system_executor.cpp
index 68d9236ba89..7b811ccac0c 100644
--- a/3rdparty/asio/src/tests/unit/system_executor.cpp
+++ b/3rdparty/asio/src/tests/unit/system_executor.cpp
@@ -2,7 +2,7 @@
// system_executor.cpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -21,23 +21,14 @@
// Test that header file is self-contained.
#include "asio/system_executor.hpp"
+#include <functional>
#include "asio/dispatch.hpp"
#include "asio/post.hpp"
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
void increment(asio::detail::atomic_count* count)
{
@@ -83,11 +74,6 @@ void system_executor_query_test()
ASIO_CHECK(
asio::query(system_executor(),
- asio::execution::bulk_guarantee)
- == asio::execution::bulk_guarantee.unsequenced);
-
- ASIO_CHECK(
- asio::query(system_executor(),
asio::execution::mapping)
== asio::execution::mapping.thread);
@@ -101,61 +87,52 @@ void system_executor_execute_test()
{
asio::detail::atomic_count count(0);
- asio::execution::execute(system_executor(),
- bindns::bind(increment, &count));
+ system_executor().execute(bindns::bind(increment, &count));
- asio::execution::execute(
- asio::require(system_executor(),
- asio::execution::blocking.possibly),
- bindns::bind(increment, &count));
+ asio::require(system_executor(),
+ asio::execution::blocking.possibly
+ ).execute(bindns::bind(increment, &count));
- asio::execution::execute(
- asio::require(system_executor(),
- asio::execution::blocking.always),
- bindns::bind(increment, &count));
+ asio::require(system_executor(),
+ asio::execution::blocking.always
+ ).execute(bindns::bind(increment, &count));
- asio::execution::execute(
- asio::require(system_executor(),
- asio::execution::blocking.never),
- bindns::bind(increment, &count));
+ asio::require(system_executor(),
+ asio::execution::blocking.never
+ ).execute(bindns::bind(increment, &count));
- asio::execution::execute(
- asio::require(system_executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked),
- bindns::bind(increment, &count));
+ asio::require(system_executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked
+ ).execute(bindns::bind(increment, &count));
- asio::execution::execute(
+ asio::require(system_executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.fork
+ ).execute(bindns::bind(increment, &count));
+
+ asio::require(system_executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation
+ ).execute(bindns::bind(increment, &count));
+
+ asio::prefer(
asio::require(system_executor(),
asio::execution::blocking.never,
asio::execution::outstanding_work.untracked,
- asio::execution::relationship.fork),
- bindns::bind(increment, &count));
+ asio::execution::relationship.continuation),
+ asio::execution::allocator(std::allocator<void>())
+ ).execute(bindns::bind(increment, &count));
- asio::execution::execute(
+ asio::prefer(
asio::require(system_executor(),
asio::execution::blocking.never,
asio::execution::outstanding_work.untracked,
asio::execution::relationship.continuation),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::prefer(
- asio::require(system_executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator(std::allocator<void>())),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::prefer(
- asio::require(system_executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator),
- bindns::bind(increment, &count));
+ asio::execution::allocator
+ ).execute(bindns::bind(increment, &count));
asio::query(system_executor(), execution::context).join();
diff --git a/3rdparty/asio/src/tests/unit/system_timer.cpp b/3rdparty/asio/src/tests/unit/system_timer.cpp
index 864a9f2e7fb..26a5720129f 100644
--- a/3rdparty/asio/src/tests/unit/system_timer.cpp
+++ b/3rdparty/asio/src/tests/unit/system_timer.cpp
@@ -2,7 +2,7 @@
// system_timer.cpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -21,27 +21,15 @@
// Test that header file is self-contained.
#include "asio/system_timer.hpp"
-#include "unit_test.hpp"
-
-#if defined(ASIO_HAS_STD_CHRONO)
-
+#include <functional>
#include "asio/bind_cancellation_slot.hpp"
#include "asio/cancellation_signal.hpp"
#include "asio/executor_work_guard.hpp"
#include "asio/io_context.hpp"
#include "asio/thread.hpp"
+#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
void increment(int* count)
{
@@ -237,11 +225,9 @@ struct timer_handler
{
timer_handler() {}
void operator()(const asio::error_code&) {}
-#if defined(ASIO_HAS_MOVE)
timer_handler(timer_handler&&) {}
private:
timer_handler(const timer_handler&);
-#endif // defined(ASIO_HAS_MOVE)
};
void system_timer_cancel_test()
@@ -290,18 +276,18 @@ struct custom_allocation_timer_handler
typedef allocator<U> other;
};
- explicit allocator(int* count) ASIO_NOEXCEPT
+ explicit allocator(int* count) noexcept
: count_(count)
{
}
- allocator(const allocator& other) ASIO_NOEXCEPT
+ allocator(const allocator& other) noexcept
: count_(other.count_)
{
}
template <typename U>
- allocator(const allocator<U>& other) ASIO_NOEXCEPT
+ allocator(const allocator<U>& other) noexcept
: count_(other.count_)
{
}
@@ -338,7 +324,7 @@ struct custom_allocation_timer_handler
typedef allocator<int> allocator_type;
- allocator_type get_allocator() const ASIO_NOEXCEPT
+ allocator_type get_allocator() const noexcept
{
return allocator_type(count_);
}
@@ -406,7 +392,6 @@ void system_timer_thread_test()
ASIO_CHECK(count == 1);
}
-#if defined(ASIO_HAS_MOVE)
asio::system_timer make_timer(asio::io_context& ioc, int* count)
{
asio::system_timer t(ioc);
@@ -427,11 +412,9 @@ io_context_system_timer make_convertible_timer(asio::io_context& ioc, int* count
t.async_wait(bindns::bind(increment, count));
return t;
}
-#endif
void system_timer_move_test()
{
-#if defined(ASIO_HAS_MOVE)
asio::io_context io_context1;
asio::io_context io_context2;
int count = 0;
@@ -465,7 +448,6 @@ void system_timer_move_test()
io_context1.run();
ASIO_CHECK(count == 4);
-#endif // defined(ASIO_HAS_MOVE)
}
void system_timer_op_cancel_test()
@@ -516,10 +498,3 @@ ASIO_TEST_SUITE
ASIO_TEST_CASE(system_timer_move_test)
ASIO_TEST_CASE(system_timer_op_cancel_test)
)
-#else // defined(ASIO_HAS_STD_CHRONO)
-ASIO_TEST_SUITE
-(
- "system_timer",
- ASIO_TEST_CASE(null_test)
-)
-#endif // defined(ASIO_HAS_STD_CHRONO)
diff --git a/3rdparty/asio/src/tests/unit/this_coro.cpp b/3rdparty/asio/src/tests/unit/this_coro.cpp
index ef8f67b918f..d1e0fc677c5 100644
--- a/3rdparty/asio/src/tests/unit/this_coro.cpp
+++ b/3rdparty/asio/src/tests/unit/this_coro.cpp
@@ -2,7 +2,7 @@
// this_coro.cpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/thread.cpp b/3rdparty/asio/src/tests/unit/thread.cpp
index a99ef219bb0..b84db72158e 100644
--- a/3rdparty/asio/src/tests/unit/thread.cpp
+++ b/3rdparty/asio/src/tests/unit/thread.cpp
@@ -2,7 +2,7 @@
// thread.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/thread_pool.cpp b/3rdparty/asio/src/tests/unit/thread_pool.cpp
index aec68023367..f65d7963c26 100644
--- a/3rdparty/asio/src/tests/unit/thread_pool.cpp
+++ b/3rdparty/asio/src/tests/unit/thread_pool.cpp
@@ -2,7 +2,7 @@
// thread_pool.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,23 +16,13 @@
// Test that header file is self-contained.
#include "asio/thread_pool.hpp"
+#include <functional>
#include "asio/dispatch.hpp"
#include "asio/post.hpp"
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
using namespace asio;
-
-#if defined(ASIO_HAS_BOOST_BIND)
-namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif
void increment(int* count)
{
@@ -207,11 +197,6 @@ void thread_pool_executor_query_test()
ASIO_CHECK(
asio::query(pool.executor(),
- asio::execution::bulk_guarantee)
- == asio::execution::bulk_guarantee.parallel);
-
- ASIO_CHECK(
- asio::query(pool.executor(),
asio::execution::mapping)
== asio::execution::mapping.thread);
@@ -231,287 +216,61 @@ void thread_pool_executor_execute_test()
int count = 0;
thread_pool pool(1);
- asio::execution::execute(pool.executor(),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.possibly),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.always),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.never),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.tracked),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.fork),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::prefer(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator(std::allocator<void>())),
- bindns::bind(increment, &count));
-
- asio::execution::execute(
- asio::prefer(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator),
- bindns::bind(increment, &count));
-
- pool.wait();
-
- ASIO_CHECK(count == 10);
-}
-
-struct receiver
-{
- int* count_;
-
- receiver(int* count)
- : count_(count)
- {
- }
-
- receiver(const receiver& other) ASIO_NOEXCEPT
- : count_(other.count_)
- {
- }
-
-#if defined(ASIO_HAS_MOVE)
- receiver(receiver&& other) ASIO_NOEXCEPT
- : count_(other.count_)
- {
- other.count_ = 0;
- }
-#endif // defined(ASIO_HAS_MOVE)
-
- void set_value() ASIO_NOEXCEPT
- {
- ++(*count_);
- }
-
- template <typename E>
- void set_error(ASIO_MOVE_ARG(E) e) ASIO_NOEXCEPT
- {
- (void)e;
- }
-
- void set_done() ASIO_NOEXCEPT
- {
- }
-};
-
-namespace asio {
-namespace traits {
-
-#if !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-template <>
-struct set_value_member<receiver, void()>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-template <typename E>
-struct set_error_member<receiver, E>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
-
-#if !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-template <>
-struct set_done_member<receiver>
-{
- ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
- ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
- typedef void result_type;
-};
-
-#endif // !defined(ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
-
-} // namespace traits
-} // namespace asio
-
-void thread_pool_scheduler_test()
-{
- int count = 0;
- receiver r(&count);
- thread_pool pool(1);
-
- asio::execution::submit(
- asio::execution::schedule(pool.scheduler()), r);
-
- asio::execution::submit(
- asio::require(
- asio::execution::schedule(pool.executor()),
- asio::execution::blocking.possibly), r);
-
- asio::execution::submit(
- asio::require(
- asio::execution::schedule(pool.executor()),
- asio::execution::blocking.always), r);
-
- asio::execution::submit(
- asio::require(
- asio::execution::schedule(pool.executor()),
- asio::execution::blocking.never), r);
-
- asio::execution::submit(
- asio::require(
- asio::execution::schedule(pool.executor()),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.tracked), r);
-
- asio::execution::submit(
- asio::require(
- asio::execution::schedule(pool.executor()),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked), r);
-
- asio::execution::submit(
- asio::require(
- asio::execution::schedule(pool.executor()),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.fork), r);
-
- asio::execution::submit(
- asio::require(
- asio::execution::schedule(pool.executor()),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation), r);
-
- asio::execution::submit(
- asio::prefer(
- asio::require(
- asio::execution::schedule(pool.executor()),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator(std::allocator<void>())), r);
-
- asio::execution::submit(
- asio::prefer(
- asio::require(
- asio::execution::schedule(pool.executor()),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator), r);
-
- pool.wait();
-
- ASIO_CHECK(count == 10);
-}
-
-void thread_pool_executor_bulk_execute_test()
-{
- int count = 0;
- thread_pool pool(1);
-
- pool.executor().bulk_execute(
- bindns::bind(increment, &count), 2);
+ pool.executor().execute(bindns::bind(increment, &count));
asio::require(pool.executor(),
- asio::execution::blocking.possibly).bulk_execute(
- bindns::bind(increment, &count), 2);
+ asio::execution::blocking.possibly
+ ).execute(bindns::bind(increment, &count));
asio::require(pool.executor(),
- asio::execution::blocking.always).bulk_execute(
- bindns::bind(increment, &count), 2);
+ asio::execution::blocking.always
+ ).execute(bindns::bind(increment, &count));
asio::require(pool.executor(),
- asio::execution::blocking.never).bulk_execute(
- bindns::bind(increment, &count), 2);
+ asio::execution::blocking.never
+ ).execute(bindns::bind(increment, &count));
asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.tracked).bulk_execute(
- bindns::bind(increment, &count), 2);
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.tracked
+ ).execute(bindns::bind(increment, &count));
asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked).bulk_execute(
- bindns::bind(increment, &count), 2);
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked
+ ).execute(bindns::bind(increment, &count));
asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.fork).bulk_execute(
- bindns::bind(increment, &count), 2);
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.fork
+ ).execute(bindns::bind(increment, &count));
asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation).bulk_execute(
- bindns::bind(increment, &count), 2);
-
- asio::prefer(
- asio::require(pool.executor(),
asio::execution::blocking.never,
asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator(std::allocator<void>())).bulk_execute(
- bindns::bind(increment, &count), 2);
+ asio::execution::relationship.continuation
+ ).execute(bindns::bind(increment, &count));
asio::prefer(
- asio::require(pool.executor(),
- asio::execution::blocking.never,
- asio::execution::outstanding_work.untracked,
- asio::execution::relationship.continuation),
- asio::execution::allocator).bulk_execute(
- bindns::bind(increment, &count), 2);
+ asio::require(pool.executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation),
+ asio::execution::allocator(std::allocator<void>())
+ ).execute(bindns::bind(increment, &count));
+
+ asio::prefer(
+ asio::require(pool.executor(),
+ asio::execution::blocking.never,
+ asio::execution::outstanding_work.untracked,
+ asio::execution::relationship.continuation),
+ asio::execution::allocator
+ ).execute(bindns::bind(increment, &count));
pool.wait();
- ASIO_CHECK(count == 20);
+ ASIO_CHECK(count == 10);
}
ASIO_TEST_SUITE
@@ -521,6 +280,4 @@ ASIO_TEST_SUITE
ASIO_TEST_CASE(thread_pool_service_test)
ASIO_TEST_CASE(thread_pool_executor_query_test)
ASIO_TEST_CASE(thread_pool_executor_execute_test)
- ASIO_TEST_CASE(thread_pool_executor_bulk_execute_test)
- ASIO_TEST_CASE(thread_pool_scheduler_test)
)
diff --git a/3rdparty/asio/src/tests/unit/time_traits.cpp b/3rdparty/asio/src/tests/unit/time_traits.cpp
index b64a75b0018..2763d9ecc30 100644
--- a/3rdparty/asio/src/tests/unit/time_traits.cpp
+++ b/3rdparty/asio/src/tests/unit/time_traits.cpp
@@ -2,7 +2,7 @@
// time_traits.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ts/buffer.cpp b/3rdparty/asio/src/tests/unit/ts/buffer.cpp
index a2ad558945a..8f09c4fecc9 100644
--- a/3rdparty/asio/src/tests/unit/ts/buffer.cpp
+++ b/3rdparty/asio/src/tests/unit/ts/buffer.cpp
@@ -2,7 +2,7 @@
// buffer.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ts/executor.cpp b/3rdparty/asio/src/tests/unit/ts/executor.cpp
index 840850370df..9e318d93dbd 100644
--- a/3rdparty/asio/src/tests/unit/ts/executor.cpp
+++ b/3rdparty/asio/src/tests/unit/ts/executor.cpp
@@ -2,7 +2,7 @@
// executor.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ts/internet.cpp b/3rdparty/asio/src/tests/unit/ts/internet.cpp
index 8680be6a46f..1ee8320d9d7 100644
--- a/3rdparty/asio/src/tests/unit/ts/internet.cpp
+++ b/3rdparty/asio/src/tests/unit/ts/internet.cpp
@@ -2,7 +2,7 @@
// internet.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ts/io_context.cpp b/3rdparty/asio/src/tests/unit/ts/io_context.cpp
index 616e911183f..365e2579e8c 100644
--- a/3rdparty/asio/src/tests/unit/ts/io_context.cpp
+++ b/3rdparty/asio/src/tests/unit/ts/io_context.cpp
@@ -2,7 +2,7 @@
// io_context.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ts/net.cpp b/3rdparty/asio/src/tests/unit/ts/net.cpp
index c59d1586c6f..25f65030994 100644
--- a/3rdparty/asio/src/tests/unit/ts/net.cpp
+++ b/3rdparty/asio/src/tests/unit/ts/net.cpp
@@ -2,7 +2,7 @@
// net.cpp
// ~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ts/netfwd.cpp b/3rdparty/asio/src/tests/unit/ts/netfwd.cpp
index 67523c4ceb0..55af93c87c3 100644
--- a/3rdparty/asio/src/tests/unit/ts/netfwd.cpp
+++ b/3rdparty/asio/src/tests/unit/ts/netfwd.cpp
@@ -2,7 +2,7 @@
// netfwd.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ts/socket.cpp b/3rdparty/asio/src/tests/unit/ts/socket.cpp
index d1e5df95c0d..4656fa2eb5a 100644
--- a/3rdparty/asio/src/tests/unit/ts/socket.cpp
+++ b/3rdparty/asio/src/tests/unit/ts/socket.cpp
@@ -2,7 +2,7 @@
// socket.cpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/ts/timer.cpp b/3rdparty/asio/src/tests/unit/ts/timer.cpp
index 8a6e855b9e6..e956bd463d5 100644
--- a/3rdparty/asio/src/tests/unit/ts/timer.cpp
+++ b/3rdparty/asio/src/tests/unit/ts/timer.cpp
@@ -2,7 +2,7 @@
// timer.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/unit_test.hpp b/3rdparty/asio/src/tests/unit/unit_test.hpp
index 5b2123e2030..8efae9987e6 100644
--- a/3rdparty/asio/src/tests/unit/unit_test.hpp
+++ b/3rdparty/asio/src/tests/unit/unit_test.hpp
@@ -2,7 +2,7 @@
// unit_test.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/use_awaitable.cpp b/3rdparty/asio/src/tests/unit/use_awaitable.cpp
index 84702c25e5b..815f57ebb1c 100644
--- a/3rdparty/asio/src/tests/unit/use_awaitable.cpp
+++ b/3rdparty/asio/src/tests/unit/use_awaitable.cpp
@@ -2,7 +2,7 @@
// use_awaitable.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/use_future.cpp b/3rdparty/asio/src/tests/unit/use_future.cpp
index 5c2bda5b577..ac12f7caa23 100644
--- a/3rdparty/asio/src/tests/unit/use_future.cpp
+++ b/3rdparty/asio/src/tests/unit/use_future.cpp
@@ -2,7 +2,7 @@
// use_future.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -19,7 +19,7 @@
#include <string>
#include "unit_test.hpp"
-#if defined(ASIO_HAS_STD_FUTURE)
+#if defined(ASIO_HAS_STD_FUTURE_CLASS)
#include "archetypes/async_ops.hpp"
@@ -659,7 +659,7 @@ ASIO_TEST_SUITE
ASIO_TEST_CASE(use_future_package_3_test)
)
-#else // defined(ASIO_HAS_STD_FUTURE)
+#else // defined(ASIO_HAS_STD_FUTURE_CLASS)
ASIO_TEST_SUITE
(
@@ -667,4 +667,4 @@ ASIO_TEST_SUITE
ASIO_TEST_CASE(null_test)
)
-#endif // defined(ASIO_HAS_STD_FUTURE)
+#endif // defined(ASIO_HAS_STD_FUTURE_CLASS)
diff --git a/3rdparty/asio/src/tests/unit/uses_executor.cpp b/3rdparty/asio/src/tests/unit/uses_executor.cpp
index 76d2fdbf0d9..f3d52c1d8fc 100644
--- a/3rdparty/asio/src/tests/unit/uses_executor.cpp
+++ b/3rdparty/asio/src/tests/unit/uses_executor.cpp
@@ -2,7 +2,7 @@
// uses_executor.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/wait_traits.cpp b/3rdparty/asio/src/tests/unit/wait_traits.cpp
index 2cea19a50ae..4bdb498d7bf 100644
--- a/3rdparty/asio/src/tests/unit/wait_traits.cpp
+++ b/3rdparty/asio/src/tests/unit/wait_traits.cpp
@@ -2,7 +2,7 @@
// wait_traits.cpp
// ~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/windows/basic_object_handle.cpp b/3rdparty/asio/src/tests/unit/windows/basic_object_handle.cpp
index 87cfb15b2c0..d4d6def159a 100644
--- a/3rdparty/asio/src/tests/unit/windows/basic_object_handle.cpp
+++ b/3rdparty/asio/src/tests/unit/windows/basic_object_handle.cpp
@@ -2,7 +2,7 @@
// basic_object_handle.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/windows/basic_overlapped_handle.cpp b/3rdparty/asio/src/tests/unit/windows/basic_overlapped_handle.cpp
index 668742a5f50..62b5419c69f 100644
--- a/3rdparty/asio/src/tests/unit/windows/basic_overlapped_handle.cpp
+++ b/3rdparty/asio/src/tests/unit/windows/basic_overlapped_handle.cpp
@@ -2,7 +2,7 @@
// basic_overlapped_handle.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/windows/basic_random_access_handle.cpp b/3rdparty/asio/src/tests/unit/windows/basic_random_access_handle.cpp
index 6fa7a02a00e..4a2605ea335 100644
--- a/3rdparty/asio/src/tests/unit/windows/basic_random_access_handle.cpp
+++ b/3rdparty/asio/src/tests/unit/windows/basic_random_access_handle.cpp
@@ -2,7 +2,7 @@
// basic_random_access_handle.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/windows/basic_stream_handle.cpp b/3rdparty/asio/src/tests/unit/windows/basic_stream_handle.cpp
index fdde859da95..9cdf0bd5c20 100644
--- a/3rdparty/asio/src/tests/unit/windows/basic_stream_handle.cpp
+++ b/3rdparty/asio/src/tests/unit/windows/basic_stream_handle.cpp
@@ -2,7 +2,7 @@
// basic_stream_handle.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/windows/object_handle.cpp b/3rdparty/asio/src/tests/unit/windows/object_handle.cpp
index 6fdde1d7940..0784ba9fdb7 100644
--- a/3rdparty/asio/src/tests/unit/windows/object_handle.cpp
+++ b/3rdparty/asio/src/tests/unit/windows/object_handle.cpp
@@ -2,7 +2,7 @@
// object_handle.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -61,16 +61,16 @@ void test()
HANDLE native_handle2 = INVALID_HANDLE_VALUE;
win::object_handle handle4(ioc_ex, native_handle2);
-#if defined(ASIO_HAS_MOVE)
win::object_handle handle5(std::move(handle4));
-#endif // defined(ASIO_HAS_MOVE)
+
+ win::basic_object_handle<io_context::executor_type> handle6(ioc);
+ win::object_handle handle7(std::move(handle6));
// basic_object_handle operators.
-#if defined(ASIO_HAS_MOVE)
handle1 = win::object_handle(ioc);
handle1 = std::move(handle3);
-#endif // defined(ASIO_HAS_MOVE)
+ handle1 = std::move(handle6);
// basic_io_object functions.
@@ -83,9 +83,9 @@ void test()
= handle1.lowest_layer();
(void)lowest_layer;
- const win::object_handle& handle6 = handle1;
+ const win::object_handle& handle8 = handle1;
const win::object_handle::lowest_layer_type& lowest_layer3
- = handle6.lowest_layer();
+ = handle8.lowest_layer();
(void)lowest_layer3;
HANDLE native_handle4 = INVALID_HANDLE_VALUE;
@@ -126,5 +126,5 @@ void test()
ASIO_TEST_SUITE
(
"windows/object_handle",
- ASIO_TEST_CASE(windows_object_handle_compile::test)
+ ASIO_COMPILE_TEST_CASE(windows_object_handle_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/windows/overlapped_handle.cpp b/3rdparty/asio/src/tests/unit/windows/overlapped_handle.cpp
index 629299b7567..5cdd3da2db1 100644
--- a/3rdparty/asio/src/tests/unit/windows/overlapped_handle.cpp
+++ b/3rdparty/asio/src/tests/unit/windows/overlapped_handle.cpp
@@ -2,7 +2,7 @@
// overlapped_handle.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
diff --git a/3rdparty/asio/src/tests/unit/windows/overlapped_ptr.cpp b/3rdparty/asio/src/tests/unit/windows/overlapped_ptr.cpp
index ff4173dcdf2..fda1b2cbd98 100644
--- a/3rdparty/asio/src/tests/unit/windows/overlapped_ptr.cpp
+++ b/3rdparty/asio/src/tests/unit/windows/overlapped_ptr.cpp
@@ -2,7 +2,7 @@
// overlapped_ptr.cpp
// ~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -115,5 +115,5 @@ void test()
ASIO_TEST_SUITE
(
"windows/overlapped_ptr",
- ASIO_TEST_CASE(windows_overlapped_ptr_compile::test)
+ ASIO_COMPILE_TEST_CASE(windows_overlapped_ptr_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/windows/random_access_handle.cpp b/3rdparty/asio/src/tests/unit/windows/random_access_handle.cpp
index 94fa29f2d96..613732c5128 100644
--- a/3rdparty/asio/src/tests/unit/windows/random_access_handle.cpp
+++ b/3rdparty/asio/src/tests/unit/windows/random_access_handle.cpp
@@ -2,7 +2,7 @@
// random_access_handle.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -68,16 +68,16 @@ void test()
HANDLE native_handle2 = INVALID_HANDLE_VALUE;
win::random_access_handle handle4(ioc_ex, native_handle2);
-#if defined(ASIO_HAS_MOVE)
win::random_access_handle handle5(std::move(handle4));
-#endif // defined(ASIO_HAS_MOVE)
+
+ win::basic_random_access_handle<io_context::executor_type> handle6(ioc);
+ win::random_access_handle handle7(std::move(handle6));
// basic_random_access_handle operators.
-#if defined(ASIO_HAS_MOVE)
handle1 = win::random_access_handle(ioc);
handle1 = std::move(handle4);
-#endif // defined(ASIO_HAS_MOVE)
+ handle1 = std::move(handle6);
// basic_io_object functions.
@@ -90,9 +90,9 @@ void test()
= handle1.lowest_layer();
(void)lowest_layer;
- const win::random_access_handle& handle6 = handle1;
+ const win::random_access_handle& handle8 = handle1;
const win::random_access_handle::lowest_layer_type& lowest_layer2
- = handle6.lowest_layer();
+ = handle8.lowest_layer();
(void)lowest_layer2;
HANDLE native_handle3 = INVALID_HANDLE_VALUE;
@@ -105,8 +105,15 @@ void test()
handle1.close(ec);
win::random_access_handle::native_handle_type native_handle4
- = handle1.native_handle();
+ = handle1.release();
(void)native_handle4;
+ win::random_access_handle::native_handle_type native_handle5
+ = handle1.release(ec);
+ (void)native_handle5;
+
+ win::random_access_handle::native_handle_type native_handle6
+ = handle1.native_handle();
+ (void)native_handle6;
handle1.cancel();
handle1.cancel(ec);
@@ -151,5 +158,5 @@ void test()
ASIO_TEST_SUITE
(
"windows/random_access_handle",
- ASIO_TEST_CASE(windows_random_access_handle_compile::test)
+ ASIO_COMPILE_TEST_CASE(windows_random_access_handle_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/windows/stream_handle.cpp b/3rdparty/asio/src/tests/unit/windows/stream_handle.cpp
index 6bb2d668ad8..1668dcea69a 100644
--- a/3rdparty/asio/src/tests/unit/windows/stream_handle.cpp
+++ b/3rdparty/asio/src/tests/unit/windows/stream_handle.cpp
@@ -2,7 +2,7 @@
// stream_handle.cpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -67,16 +67,16 @@ void test()
HANDLE native_handle2 = INVALID_HANDLE_VALUE;
win::stream_handle handle4(ioc_ex, native_handle2);
-#if defined(ASIO_HAS_MOVE)
win::stream_handle handle5(std::move(handle4));
-#endif // defined(ASIO_HAS_MOVE)
+
+ win::basic_stream_handle<io_context::executor_type> handle6(ioc);
+ win::stream_handle handle7(std::move(handle6));
// basic_stream_handle operators.
-#if defined(ASIO_HAS_MOVE)
handle1 = win::stream_handle(ioc);
handle1 = std::move(handle4);
-#endif // defined(ASIO_HAS_MOVE)
+ handle1 = std::move(handle6);
// basic_io_object functions.
@@ -89,9 +89,9 @@ void test()
= handle1.lowest_layer();
(void)lowest_layer;
- const win::stream_handle& handle6 = handle1;
+ const win::stream_handle& handle8 = handle1;
const win::stream_handle::lowest_layer_type& lowest_layer2
- = handle6.lowest_layer();
+ = handle8.lowest_layer();
(void)lowest_layer2;
HANDLE native_handle3 = INVALID_HANDLE_VALUE;
@@ -104,8 +104,15 @@ void test()
handle1.close(ec);
win::stream_handle::native_handle_type native_handle4
- = handle1.native_handle();
+ = handle1.release();
(void)native_handle4;
+ win::stream_handle::native_handle_type native_handle5
+ = handle1.release(ec);
+ (void)native_handle5;
+
+ win::stream_handle::native_handle_type native_handle6
+ = handle1.native_handle();
+ (void)native_handle6;
handle1.cancel();
handle1.cancel(ec);
@@ -144,5 +151,5 @@ void test()
ASIO_TEST_SUITE
(
"windows/stream_handle",
- ASIO_TEST_CASE(windows_stream_handle_compile::test)
+ ASIO_COMPILE_TEST_CASE(windows_stream_handle_compile::test)
)
diff --git a/3rdparty/asio/src/tests/unit/writable_pipe.cpp b/3rdparty/asio/src/tests/unit/writable_pipe.cpp
new file mode 100644
index 00000000000..0cea7547aa2
--- /dev/null
+++ b/3rdparty/asio/src/tests/unit/writable_pipe.cpp
@@ -0,0 +1,136 @@
+//
+// writable_pipe.cpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// 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)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header pipe is self-contained.
+#include "asio/writable_pipe.hpp"
+
+#include "archetypes/async_result.hpp"
+#include "asio/io_context.hpp"
+#include "unit_test.hpp"
+
+// writable_pipe_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// writable_pipe compile and link correctly. Runtime failures are ignored.
+
+namespace writable_pipe_compile {
+
+struct write_some_handler
+{
+ write_some_handler() {}
+ void operator()(const asio::error_code&, std::size_t) {}
+ write_some_handler(write_some_handler&&) {}
+private:
+ write_some_handler(const write_some_handler&);
+};
+
+struct read_some_handler
+{
+ read_some_handler() {}
+ void operator()(const asio::error_code&, std::size_t) {}
+ read_some_handler(read_some_handler&&) {}
+private:
+ read_some_handler(const read_some_handler&);
+};
+
+void test()
+{
+#if defined(ASIO_HAS_PIPE)
+ using namespace asio;
+
+ try
+ {
+ io_context ioc;
+ const io_context::executor_type ioc_ex = ioc.get_executor();
+ char mutable_char_buffer[128] = "";
+ const char const_char_buffer[128] = "";
+ archetypes::lazy_handler lazy;
+ asio::error_code ec;
+
+ // basic_writable_pipe constructors.
+
+ writable_pipe pipe1(ioc);
+ writable_pipe::native_handle_type native_pipe1 = pipe1.native_handle();
+ writable_pipe pipe2(ioc, native_pipe1);
+
+ writable_pipe pipe3(ioc_ex);
+ writable_pipe::native_handle_type native_pipe2 = pipe1.native_handle();
+ writable_pipe pipe4(ioc_ex, native_pipe2);
+
+ writable_pipe pipe5(std::move(pipe4));
+
+ basic_writable_pipe<io_context::executor_type> pipe6(ioc);
+ writable_pipe pipe7(std::move(pipe6));
+
+ // basic_writable_pipe operators.
+
+ pipe1 = writable_pipe(ioc);
+ pipe1 = std::move(pipe2);
+ pipe1 = std::move(pipe6);
+
+ // basic_io_object functions.
+
+ writable_pipe::executor_type ex = pipe1.get_executor();
+ (void)ex;
+
+ // basic_writable_pipe functions.
+
+ writable_pipe::native_handle_type native_pipe3 = pipe1.native_handle();
+ pipe1.assign(native_pipe3);
+ writable_pipe::native_handle_type native_pipe4 = pipe1.native_handle();
+ pipe1.assign(native_pipe4, ec);
+
+ bool is_open = pipe1.is_open();
+ (void)is_open;
+
+ pipe1.close();
+ pipe1.close(ec);
+
+ writable_pipe::native_handle_type native_pipe5 = pipe1.release();
+ (void)native_pipe5;
+ writable_pipe::native_handle_type native_pipe6 = pipe1.release(ec);
+ (void)native_pipe6;
+
+ writable_pipe::native_handle_type native_pipe7 = pipe1.native_handle();
+ (void)native_pipe7;
+
+ pipe1.cancel();
+ pipe1.cancel(ec);
+
+ pipe1.write_some(buffer(mutable_char_buffer));
+ pipe1.write_some(buffer(const_char_buffer));
+ pipe1.write_some(buffer(mutable_char_buffer), ec);
+ pipe1.write_some(buffer(const_char_buffer), ec);
+
+ pipe1.async_write_some(buffer(mutable_char_buffer), write_some_handler());
+ pipe1.async_write_some(buffer(const_char_buffer), write_some_handler());
+ int i1 = pipe1.async_write_some(buffer(mutable_char_buffer), lazy);
+ (void)i1;
+ int i2 = pipe1.async_write_some(buffer(const_char_buffer), lazy);
+ (void)i2;
+ }
+ catch (std::exception&)
+ {
+ }
+#endif // defined(ASIO_HAS_PIPE)
+}
+
+} // namespace writable_pipe_compile
+
+ASIO_TEST_SUITE
+(
+ "writable_pipe",
+ ASIO_COMPILE_TEST_CASE(writable_pipe_compile::test)
+)
diff --git a/3rdparty/asio/src/tests/unit/write.cpp b/3rdparty/asio/src/tests/unit/write.cpp
index 0343c02c71e..470972217c1 100644
--- a/3rdparty/asio/src/tests/unit/write.cpp
+++ b/3rdparty/asio/src/tests/unit/write.cpp
@@ -2,7 +2,7 @@
// write.cpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,7 +16,9 @@
// Test that header file is self-contained.
#include "asio/write.hpp"
+#include <array>
#include <cstring>
+#include <functional>
#include <vector>
#include "archetypes/async_result.hpp"
#include "asio/io_context.hpp"
@@ -24,20 +26,10 @@
#include "asio/streambuf.hpp"
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
#if defined(ASIO_HAS_BOOST_ARRAY)
#include <boost/array.hpp>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
using namespace std; // For memcmp, memcpy and memset.
class test_stream
@@ -54,7 +46,7 @@ public:
memset(data_, 0, max_length);
}
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return io_context_.get_executor();
}
@@ -121,12 +113,12 @@ public:
template <typename Const_Buffers, typename Handler>
void async_write_some(const Const_Buffers& buffers,
- ASIO_MOVE_ARG(Handler) handler)
+ Handler&& handler)
{
size_t bytes_transferred = write_some(buffers);
asio::post(get_executor(),
asio::detail::bind_handler(
- ASIO_MOVE_CAST(Handler)(handler),
+ static_cast<Handler&&>(handler),
asio::error_code(), bytes_transferred));
}
@@ -409,11 +401,7 @@ bool old_style_transfer_all(const asio::error_code& ec,
struct short_transfer
{
short_transfer() {}
-#if defined(ASIO_HAS_MOVE)
short_transfer(short_transfer&&) {}
-#else // defined(ASIO_HAS_MOVE)
- short_transfer(const short_transfer&) {}
-#endif // defined(ASIO_HAS_MOVE)
size_t operator()(const asio::error_code& ec,
size_t /*bytes_transferred*/)
{
@@ -2173,11 +2161,7 @@ void async_write_handler(const asio::error_code& e,
void test_3_arg_const_buffer_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2228,11 +2212,7 @@ void test_3_arg_const_buffer_async_write()
void test_3_arg_mutable_buffer_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2283,11 +2263,7 @@ void test_3_arg_mutable_buffer_async_write()
void test_3_arg_boost_array_buffers_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2341,15 +2317,10 @@ void test_3_arg_boost_array_buffers_async_write()
void test_3_arg_std_array_buffers_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_stream s(ioc);
std::array<asio::const_buffer, 2> buffers = { {
@@ -2394,16 +2365,11 @@ void test_3_arg_std_array_buffers_async_write()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_3_arg_vector_buffers_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2456,11 +2422,7 @@ void test_3_arg_vector_buffers_async_write()
void test_3_arg_dynamic_string_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2520,11 +2482,7 @@ void test_3_arg_dynamic_string_async_write()
void test_3_arg_streambuf_async_write()
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2585,11 +2543,7 @@ void test_3_arg_streambuf_async_write()
void test_4_arg_const_buffer_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2897,11 +2851,7 @@ void test_4_arg_const_buffer_async_write()
void test_4_arg_mutable_buffer_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3209,11 +3159,7 @@ void test_4_arg_mutable_buffer_async_write()
void test_4_arg_boost_array_buffers_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3524,15 +3470,10 @@ void test_4_arg_boost_array_buffers_async_write()
void test_4_arg_std_array_buffers_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_stream s(ioc);
std::array<asio::const_buffer, 2> buffers = { {
@@ -3834,16 +3775,11 @@ void test_4_arg_std_array_buffers_async_write()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_4_arg_vector_buffers_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -4153,11 +4089,7 @@ void test_4_arg_vector_buffers_async_write()
void test_4_arg_dynamic_string_async_write()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -4498,11 +4430,7 @@ void test_4_arg_dynamic_string_async_write()
void test_4_arg_streambuf_async_write()
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
diff --git a/3rdparty/asio/src/tests/unit/write_at.cpp b/3rdparty/asio/src/tests/unit/write_at.cpp
index c3760b0bf46..adc684d0e4f 100644
--- a/3rdparty/asio/src/tests/unit/write_at.cpp
+++ b/3rdparty/asio/src/tests/unit/write_at.cpp
@@ -2,7 +2,7 @@
// write_at.cpp
// ~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
@@ -16,27 +16,19 @@
// Test that header file is self-contained.
#include "asio/write_at.hpp"
+#include <array>
#include <cstring>
+#include <functional>
#include "archetypes/async_result.hpp"
#include "asio/io_context.hpp"
#include "asio/post.hpp"
#include "asio/streambuf.hpp"
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
#if defined(ASIO_HAS_BOOST_ARRAY)
#include <boost/array.hpp>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
using namespace std; // For memcmp, memcpy and memset.
class test_random_access_device
@@ -52,7 +44,7 @@ public:
memset(data_, 0, max_length);
}
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return io_context_.get_executor();
}
@@ -118,12 +110,12 @@ public:
template <typename Const_Buffers, typename Handler>
void async_write_some_at(asio::uint64_t offset,
- const Const_Buffers& buffers, ASIO_MOVE_ARG(Handler) handler)
+ const Const_Buffers& buffers, Handler&& handler)
{
size_t bytes_transferred = write_some_at(offset, buffers);
asio::post(get_executor(),
asio::detail::bind_handler(
- ASIO_MOVE_CAST(Handler)(handler),
+ static_cast<Handler&&>(handler),
asio::error_code(), bytes_transferred));
}
@@ -424,11 +416,7 @@ bool old_style_transfer_all(const asio::error_code& ec,
struct short_transfer
{
short_transfer() {}
-#if defined(ASIO_HAS_MOVE)
short_transfer(short_transfer&&) {}
-#else // defined(ASIO_HAS_MOVE)
- short_transfer(const short_transfer&) {}
-#endif // defined(ASIO_HAS_MOVE)
size_t operator()(const asio::error_code& ec,
size_t /*bytes_transferred*/)
{
@@ -2947,11 +2935,7 @@ void async_write_handler(const asio::error_code& e,
void test_4_arg_const_buffer_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3046,11 +3030,7 @@ void test_4_arg_const_buffer_async_write_at()
void test_4_arg_mutable_buffer_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3145,11 +3125,7 @@ void test_4_arg_mutable_buffer_async_write_at()
void test_4_arg_boost_array_buffers_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3247,15 +3223,10 @@ void test_4_arg_boost_array_buffers_async_write_at()
void test_4_arg_std_array_buffers_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_random_access_device s(ioc);
std::array<asio::const_buffer, 2> buffers = { {
@@ -3344,16 +3315,11 @@ void test_4_arg_std_array_buffers_async_write_at()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_4_arg_vector_buffers_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3449,11 +3415,7 @@ void test_4_arg_vector_buffers_async_write_at()
void test_4_arg_streambuf_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3565,11 +3527,7 @@ void test_4_arg_streambuf_async_write_at()
void test_5_arg_const_buffer_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -4207,11 +4165,7 @@ void test_5_arg_const_buffer_async_write_at()
void test_5_arg_mutable_buffer_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -4849,11 +4803,7 @@ void test_5_arg_mutable_buffer_async_write_at()
void test_5_arg_boost_array_buffers_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -5494,15 +5444,10 @@ void test_5_arg_boost_array_buffers_async_write_at()
void test_5_arg_std_array_buffers_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_random_access_device s(ioc);
std::array<asio::const_buffer, 2> buffers = { {
@@ -6134,16 +6079,11 @@ void test_5_arg_std_array_buffers_async_write_at()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_5_arg_vector_buffers_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -6782,11 +6722,7 @@ void test_5_arg_vector_buffers_async_write_at()
void test_5_arg_streambuf_async_write_at()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
diff --git a/3rdparty/asio/src/tools/handlerlive.pl b/3rdparty/asio/src/tools/handlerlive.pl
index f298075fb7f..e24b8acafba 100755
--- a/3rdparty/asio/src/tools/handlerlive.pl
+++ b/3rdparty/asio/src/tools/handlerlive.pl
@@ -9,7 +9,7 @@
# not yet finished their execution. Programs write this output to the standard
# error stream when compiled with the define `ASIO_ENABLE_HANDLER_TRACKING'.
#
-# Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
#
# 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)
diff --git a/3rdparty/asio/src/tools/handlertree.pl b/3rdparty/asio/src/tools/handlertree.pl
index 64e120f2716..83e95496699 100755
--- a/3rdparty/asio/src/tools/handlertree.pl
+++ b/3rdparty/asio/src/tools/handlertree.pl
@@ -7,7 +7,7 @@
# Programs write this output to the standard error stream when compiled with
# the define `ASIO_ENABLE_HANDLER_TRACKING'.
#
-# Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
#
# 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)
diff --git a/3rdparty/asio/src/tools/handlerviz.pl b/3rdparty/asio/src/tools/handlerviz.pl
index dcc364cffc8..6bef1b700bd 100755
--- a/3rdparty/asio/src/tools/handlerviz.pl
+++ b/3rdparty/asio/src/tools/handlerviz.pl
@@ -16,7 +16,7 @@
#
# perl handlerviz.pl < output.txt | dot -Tpdf > output.pdf
#
-# Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
#
# 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)
diff --git a/3rdparty/asio/test-driver b/3rdparty/asio/test-driver
index d30605660a0..be73b80adf9 100755
--- a/3rdparty/asio/test-driver
+++ b/3rdparty/asio/test-driver
@@ -1,9 +1,9 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2013-07-13.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-07-13.22; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -42,11 +42,13 @@ print_usage ()
{
cat <<END
Usage:
- test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
- [--expect-failure={yes|no}] [--color-tests={yes|no}]
- [--enable-hard-errors={yes|no}] [--]
+ test-driver --test-name NAME --log-file PATH --trs-file PATH
+ [--expect-failure {yes|no}] [--color-tests {yes|no}]
+ [--enable-hard-errors {yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+See the GNU Automake documentation for information.
END
}
@@ -103,14 +105,20 @@ trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
-# Test script is run here.
-"$@" >$log_file 2>&1
+# Test script is run here. We create the file first, then append to it,
+# to ameliorate tests themselves also writing to the log file. Our tests
+# don't, but others can (automake bug#35762).
+: >"$log_file"
+"$@" >>"$log_file" 2>&1
estatus=$?
+
if test $enable_hard_errors = no && test $estatus -eq 99; then
- estatus=1
+ tweaked_estatus=1
+else
+ tweaked_estatus=$estatus
fi
-case $estatus:$expect_failure in
+case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
@@ -119,6 +127,12 @@ case $estatus:$expect_failure in
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>"$log_file"
+
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
@@ -131,9 +145,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/3rdparty/asmjit/.gitignore b/3rdparty/asmjit/.gitignore
index 75d36d09cd0..7847c1c2beb 100644
--- a/3rdparty/asmjit/.gitignore
+++ b/3rdparty/asmjit/.gitignore
@@ -1,6 +1,3 @@
/build
/build_*
-/tools/asmdb
.vscode
-.kdev4
-*.kdev4
diff --git a/3rdparty/asmjit/CMakeLists.txt b/3rdparty/asmjit/CMakeLists.txt
index 5d4648efbe3..aa6df9d6111 100644
--- a/3rdparty/asmjit/CMakeLists.txt
+++ b/3rdparty/asmjit/CMakeLists.txt
@@ -1,39 +1,18 @@
-cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
-cmake_policy(PUSH)
-
-if(POLICY CMP0063)
- cmake_policy(SET CMP0063 NEW) # Honor visibility properties.
-endif()
-
-if(POLICY CMP0092)
- cmake_policy(SET CMP0092 NEW) # Don't add -W3 warning level by default.
-endif()
-
-# Don't create a project if it was already created by another CMakeLists.txt.
-# This allows one library to embed another library without making a collision.
+# Don't create a project if it was already created by another CMakeLists.txt. This makes
+# it possible to support both add_subdirectory() and include() ways of using AsmJit as a
+# dependency.
if (NOT CMAKE_PROJECT_NAME OR "${CMAKE_PROJECT_NAME}" STREQUAL "asmjit")
project(asmjit CXX)
endif()
include(CheckCXXCompilerFlag)
+include(CheckCXXSourceCompiles)
include(GNUInstallDirs)
-# AsmJit - Deprecated
-# ===================
-
-if (DEFINED ASMJIT_BUILD_EMBED)
- message(DEPRECATION "ASMJIT_BUILD_EMBED is deprecated, use ASMJIT_EMBED")
- set(ASMJIT_EMBED "${ASMJIT_BUILD_EMBED}")
-endif()
-
-if (DEFINED ASMJIT_BUILD_STATIC)
- message(DEPRECATION "ASMJIT_BUILD_STATIC is deprecated, use ASMJIT_STATIC")
- set(ASMJIT_STATIC "${ASMJIT_BUILD_STATIC}")
-endif()
-
-# AsmJit - Configuration
-# ======================
+# AsmJit - Configuration - Build
+# ==============================
if (NOT DEFINED ASMJIT_TEST)
set(ASMJIT_TEST FALSE)
@@ -51,12 +30,24 @@ if (NOT DEFINED ASMJIT_SANITIZE)
set(ASMJIT_SANITIZE FALSE)
endif()
-if (NOT DEFINED ASMJIT_NO_X86)
- set(ASMJIT_NO_X86 FALSE)
+if (NOT DEFINED ASMJIT_NO_CUSTOM_FLAGS)
+ set(ASMJIT_NO_CUSTOM_FLAGS FALSE)
+endif()
+
+if (NOT DEFINED ASMJIT_NO_NATVIS)
+ set(ASMJIT_NO_NATVIS FALSE)
+endif()
+
+# EMBED implies STATIC.
+if (ASMJIT_EMBED AND NOT ASMJIT_STATIC)
+ set(ASMJIT_STATIC TRUE)
endif()
-if (NOT DEFINED ASMJIT_NO_AARCH32)
- set(ASMJIT_NO_AARCH32 FALSE)
+# AsmJit - Configuration - Backend
+# ================================
+
+if (NOT DEFINED ASMJIT_NO_X86)
+ set(ASMJIT_NO_X86 FALSE)
endif()
if (NOT DEFINED ASMJIT_NO_AARCH64)
@@ -67,30 +58,73 @@ if (NOT DEFINED ASMJIT_NO_FOREIGN)
set(ASMJIT_NO_FOREIGN FALSE)
endif()
-if (NOT DEFINED ASMJIT_NO_NATVIS)
- set(ASMJIT_NO_NATVIS FALSE)
+# AsmJit - Configuration - Features
+# =================================
+
+if (NOT DEFINED ASMJIT_NO_DEPRECATED)
+ set(ASMJIT_NO_DEPRECATED FALSE)
endif()
-if (NOT DEFINED ASMJIT_NO_CUSTOM_FLAGS)
- set(ASMJIT_NO_CUSTOM_FLAGS FALSE)
+if (NOT DEFINED ASMJIT_NO_SHM_OPEN)
+ set(ASMJIT_NO_SHM_OPEN FALSE)
endif()
-# EMBED implies STATIC.
-if (ASMJIT_EMBED AND NOT ASMJIT_STATIC)
- set(ASMJIT_STATIC TRUE)
+if (NOT DEFINED ASMJIT_NO_JIT)
+ set(ASMJIT_NO_JIT FALSE)
+endif()
+
+if (NOT DEFINED ASMJIT_NO_TEXT)
+ set(ASMJIT_NO_TEXT FALSE)
+endif()
+
+if (NOT DEFINED ASMJIT_NO_LOGGING)
+ set(ASMJIT_NO_LOGGING ${ASMJIT_NO_TEXT})
endif()
-set(ASMJIT_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Location of 'asmjit'")
-set(ASMJIT_TEST "${ASMJIT_TEST}" CACHE BOOL "Build 'asmjit' test applications")
-set(ASMJIT_EMBED "${ASMJIT_EMBED}" CACHE BOOL "Embed 'asmjit' library (no targets)")
-set(ASMJIT_STATIC "${ASMJIT_STATIC}" CACHE BOOL "Build 'asmjit' library as static")
-set(ASMJIT_SANITIZE "${ASMJIT_SANITIZE}" CACHE STRING "Build with sanitizers: 'address', 'undefined', etc...")
-set(ASMJIT_NO_X86 "${ASMJIT_NO_X86}" CACHE BOOL "Disable X86/X64 backend")
-set(ASMJIT_NO_AARCH32 "${ASMJIT_NO_AARCH32}" CACHE BOOL "Disable AArch32 backend (ARM and THUMB)")
-set(ASMJIT_NO_AARCH64 "${ASMJIT_NO_AARCH64}" CACHE BOOL "Disable AArch64 backend")
-set(ASMJIT_NO_FOREIGN "${ASMJIT_NO_FOREIGN}" CACHE BOOL "Disable all foreign architectures (enables only a native architecture)")
-set(ASMJIT_NO_NATVIS "${ASMJIT_NO_NATVIS}" CACHE BOOL "Disable natvis support (embedding asmjit.natvis in PDB)")
-set(ASMJIT_NO_CUSTOM_FLAGS "${ASMJIT_NO_CUSTOM_FLAGS}" CACHE BOOL "Disable extra compilation flags added by AsmJit to its targets")
+if (NOT DEFINED ASMJIT_NO_VALIDATION)
+ set(ASMJIT_NO_VALIDATION FALSE)
+endif()
+
+if (NOT DEFINED ASMJIT_NO_INTROSPECTION)
+ set(ASMJIT_NO_INTROSPECTION FALSE)
+endif()
+
+if (NOT DEFINED ASMJIT_NO_BUILDER)
+ set(ASMJIT_NO_BUILDER FALSE)
+endif()
+
+if (NOT DEFINED ASMJIT_NO_COMPILER)
+ if (ASMJIT_NO_BUILDER OR ASMJIT_NO_INTROSPECTION)
+ set(ASMJIT_NO_COMPILER TRUE)
+ else()
+ set(ASMJIT_NO_COMPILER FALSE)
+ endif()
+endif()
+
+# AsmJit - Configuration - CMake Introspection
+# ============================================
+
+set(ASMJIT_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Location of 'asmjit'")
+set(ASMJIT_TEST "${ASMJIT_TEST}" CACHE BOOL "Build 'asmjit' test applications")
+set(ASMJIT_EMBED "${ASMJIT_EMBED}" CACHE BOOL "Embed 'asmjit' library (no targets)")
+set(ASMJIT_STATIC "${ASMJIT_STATIC}" CACHE BOOL "Build 'asmjit' library as static")
+set(ASMJIT_SANITIZE "${ASMJIT_SANITIZE}" CACHE STRING "Build with sanitizers: 'address', 'undefined', etc...")
+set(ASMJIT_NO_NATVIS "${ASMJIT_NO_NATVIS}" CACHE BOOL "Disable natvis support (embedding asmjit.natvis in PDB)")
+set(ASMJIT_NO_CUSTOM_FLAGS "${ASMJIT_NO_CUSTOM_FLAGS}" CACHE BOOL "Disable extra compilation flags added by AsmJit to its targets")
+
+set(ASMJIT_NO_X86 "${ASMJIT_NO_X86}" CACHE BOOL "Disable X86/X64 backend")
+set(ASMJIT_NO_AARCH64 "${ASMJIT_NO_AARCH64}" CACHE BOOL "Disable AArch64 backend")
+set(ASMJIT_NO_FOREIGN "${ASMJIT_NO_FOREIGN}" CACHE BOOL "Disable all foreign architectures (enables only a target architecture)")
+
+set(ASMJIT_NO_DEPRECATED "${ASMJIT_NO_DEPRECATED}" CACHE BOOL "Disable deprecated API at build time")
+set(ASMJIT_NO_SHM_OPEN "${ASMJIT_NO_SHM_OPEN}" CACHE BOOL "Disable the use of shm_open() even on platforms where it's supported")
+set(ASMJIT_NO_JIT "${ASMJIT_NO_JIT}" CACHE BOOL "Disable VirtMem, JitAllocator, and JitRuntime at build time")
+set(ASMJIT_NO_TEXT "${ASMJIT_NO_TEXT}" CACHE BOOL "Disable textual representation of instructions, enums, cpu features, ...")
+set(ASMJIT_NO_LOGGING "${ASMJIT_NO_LOGGING}" CACHE BOOL "Disable logging features at build time")
+set(ASMJIT_NO_VALIDATION "${ASMJIT_NO_VALIDATION}" CACHE BOOL "Disable instruction validation API at build time")
+set(ASMJIT_NO_INTROSPECTION "${ASMJIT_NO_INTROSPECTION}" CACHE BOOL "Disable instruction introspection API at build time")
+set(ASMJIT_NO_BUILDER "${ASMJIT_NO_BUILDER}" CACHE BOOL "Disable Builder emitter at build time")
+set(ASMJIT_NO_COMPILER "${ASMJIT_NO_COMPILER}" CACHE BOOL "Disable Compiler emitter at build time")
# AsmJit - Project
# ================
@@ -156,22 +190,14 @@ function(asmjit_add_target target target_type)
add_library(${target} ${target_type} ${X_SOURCES})
endif()
- set_target_properties(${target} PROPERTIES DEFINE_SYMBOL "")
- target_link_libraries(${target} PRIVATE ${X_LIBRARIES})
-
- # target_link_options was added in cmake v3.13, don't use it for now...
- foreach(link_flag ${ASMJIT_SANITIZE_LFLAGS})
- set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${link_flag}")
- endforeach()
-
- if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
- set_property(TARGET ${target} PROPERTY CXX_STANDARD 11)
- else()
- target_compile_features(${target} PUBLIC cxx_std_11)
- endif()
- set_property(TARGET ${target} PROPERTY CXX_EXTENSIONS NO)
- set_property(TARGET ${target} PROPERTY CXX_VISIBILITY_PRESET hidden)
+ set_target_properties(${target}
+ PROPERTIES
+ DEFINE_SYMBOL ""
+ CXX_VISIBILITY_PRESET hidden)
target_compile_options(${target} PRIVATE ${X_CFLAGS} ${ASMJIT_SANITIZE_CFLAGS} $<$<CONFIG:Debug>:${X_CFLAGS_DBG}> $<$<NOT:$<CONFIG:Debug>>:${X_CFLAGS_REL}>)
+ target_compile_features(${target} PUBLIC cxx_std_11)
+ target_link_options(${target} PRIVATE ${ASMJIT_PRIVATE_LFLAGS})
+ target_link_libraries(${target} PRIVATE ${X_LIBRARIES})
if ("${target_type}" STREQUAL "TEST")
add_test(NAME ${target} COMMAND ${target})
@@ -181,21 +207,11 @@ endfunction()
# AsmJit - Compiler Support
# =========================
-set(ASMJIT_INCLUDE_DIRS "${ASMJIT_DIR}/src") # Include directory is the same as source dir.
-set(ASMJIT_DEPS "") # AsmJit dependencies (libraries) for the linker.
-set(ASMJIT_LIBS "") # Dependencies of libs/apps that want to use AsmJit.
-set(ASMJIT_CFLAGS "") # Public compiler flags.
-set(ASMJIT_PRIVATE_CFLAGS "") # Private compiler flags independent of build type.
-set(ASMJIT_PRIVATE_CFLAGS_DBG "") # Private compiler flags used by debug builds.
-set(ASMJIT_PRIVATE_CFLAGS_REL "") # Private compiler flags used by release builds.
-set(ASMJIT_SANITIZE_CFLAGS "") # Compiler flags required by currently enabled sanitizers.
-set(ASMJIT_SANITIZE_LFLAGS "") # Linker flags required by currently enabled sanitizers.
-
# We will have to keep this most likely forever as some users may still be using it.
set(ASMJIT_INCLUDE_DIR "${ASMJIT_INCLUDE_DIRS}")
if (NOT ASMJIT_NO_CUSTOM_FLAGS)
- if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
list(APPEND ASMJIT_PRIVATE_CFLAGS
-MP # [+] Multi-Process Compilation.
-GF # [+] Eliminate duplicate strings.
@@ -217,9 +233,12 @@ if (NOT ASMJIT_NO_CUSTOM_FLAGS)
list(APPEND ASMJIT_PRIVATE_CFLAGS -fno-math-errno)
list(APPEND ASMJIT_PRIVATE_CFLAGS_REL -O2)
- asmjit_detect_cflags(ASMJIT_PRIVATE_CFLAGS
- -fno-threadsafe-statics
- -fno-semantic-interposition)
+ # -fno-semantic-interposition is not available on apple - the compiler issues a warning, which is not detected.
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
+ asmjit_detect_cflags(ASMJIT_PRIVATE_CFLAGS -fno-threadsafe-statics)
+ else()
+ asmjit_detect_cflags(ASMJIT_PRIVATE_CFLAGS -fno-threadsafe-statics -fno-semantic-interposition)
+ endif()
# The following flags can save few bytes in the resulting binary.
asmjit_detect_cflags(ASMJIT_PRIVATE_CFLAGS_REL
@@ -230,7 +249,7 @@ endif()
# Support for sanitizers.
if (ASMJIT_SANITIZE)
- ASMJIT_detect_sanitizers(ASMJIT_SANITIZE_CFLAGS ${ASMJIT_SANITIZE})
+ asmjit_detect_sanitizers(ASMJIT_SANITIZE_CFLAGS ${ASMJIT_SANITIZE})
if (ASMJIT_SANITIZE_CFLAGS)
message("-- Enabling sanitizers: '${ASMJIT_SANITIZE_CFLAGS}'")
@@ -238,7 +257,7 @@ if (ASMJIT_SANITIZE)
set(ASMJIT_SANITIZE_LFLAGS ${ASMJIT_SANITIZE_CFLAGS})
# Don't omit frame pointer if sanitizers are enabled.
- if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
list(APPEND ASMJIT_SANITIZE_CFLAGS -Oy-)
else()
list(APPEND ASMJIT_SANITIZE_CFLAGS -fno-omit-frame-pointer -g)
@@ -249,13 +268,53 @@ if (ASMJIT_SANITIZE)
endif()
endif()
-# Do not link to pthread on Android as it's part of C runtime.
-if (NOT WIN32 AND NOT ANDROID)
- list(APPEND ASMJIT_DEPS pthread)
-endif()
+if (WIN32)
+ # Dependency: nothing extra at the moment.
+elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
+ # Dependency: libc is the only required library on Android as it also provides libthread.
+ message("-- Dependency: adding libc (Android target detected)")
+ list(APPEND ASMJIT_DEPS c)
+elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku")
+ # Dependency: libroot is used by Haiku instead of libc, so link to libroot and libpthread.
+ message("-- Dependency: adding libroot and libpthread (Haiku target detected)")
+ list(APPEND ASMJIT_DEPS root pthread)
+else()
+ # Dependency: libc is always required.
+ message("-- Dependency: adding libc (Linux, BSD, or other UNIX/POSIX environment)")
+ list(APPEND ASMJIT_DEPS c)
+
+ # Dependency: pthread (required so AsmJit can use pthread_lock).
+ check_cxx_source_compiles("
+ #include <pthread.h>
+ int main() {
+ pthread_mutex_t m;
+ pthread_mutex_init(&m, nullptr);
+ return pthread_mutex_destroy(&m);
+ }
+ " ASMJIT_LIBC_HAS_LIBPTHREAD)
+ if (ASMJIT_LIBC_HAS_LIBPTHREAD)
+ message("-- Dependency: libpthread provided by libc (not linking to libpthread)")
+ else()
+ message("-- Dependency: libpthread not provided by libc, linking to libpthread")
+ list(APPEND ASMJIT_DEPS pthread)
+ endif()
-if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux" OR "${CMAKE_SYSTEM_NAME}" MATCHES "NetBSD")
- list(APPEND ASMJIT_DEPS rt)
+ # Dependency: shm_open (required so AsmJit can use shm_open on supported platforms).
+ if ("${CMAKE_SYSTEM_NAME}" MATCHES "^(Linux|NetBSD)$" AND NOT ASMJIT_NO_SHM_OPEN)
+ check_cxx_source_compiles("
+ #include <sys/mman.h>
+ int main() {
+ const char file_name[1] {};
+ return shm_open(file_name, 0, 0);
+ }
+ " ASMJIT_LIBC_HAS_LIBRT)
+ if (ASMJIT_LIBC_HAS_LIBRT)
+ message("-- Dependency: shm_open provided by libc (not linking to librt)")
+ else()
+ message("-- Dependency: shm_open not provided by libc, linking to librt")
+ list(APPEND ASMJIT_DEPS rt)
+ endif()
+ endif()
endif()
set(ASMJIT_LIBS ${ASMJIT_DEPS})
@@ -271,21 +330,21 @@ else()
set(ASMJIT_TARGET_TYPE "SHARED")
endif()
-foreach(build_option ASMJIT_STATIC
+foreach(build_option # AsmJit build options.
+ ASMJIT_STATIC
+ ASMJIT_NO_DEPRECATED
# AsmJit backends selection.
ASMJIT_NO_X86
- ASMJIT_NO_AARCH32
ASMJIT_NO_AARCH64
ASMJIT_NO_FOREIGN
# AsmJit features selection.
- ASMJIT_NO_DEPRECATED
ASMJIT_NO_JIT
- ASMJIT_NO_LOGGING
- ASMJIT_NO_BUILDER
- ASMJIT_NO_COMPILER
ASMJIT_NO_TEXT
+ ASMJIT_NO_LOGGING
+ ASMJIT_NO_INTROSPECTION
ASMJIT_NO_VALIDATION
- ASMJIT_NO_INTROSPECTION)
+ ASMJIT_NO_BUILDER
+ ASMJIT_NO_COMPILER)
if (${build_option})
List(APPEND ASMJIT_CFLAGS "-D${build_option}")
List(APPEND ASMJIT_PRIVATE_CFLAGS "-D${build_option}")
@@ -296,7 +355,7 @@ endforeach()
# =======================
if (WIN32)
- if(CMAKE_LINKER MATCHES "link\\.exe" OR CMAKE_LINKER MATCHES "lld-link\\.exe")
+ if (CMAKE_LINKER MATCHES "link\\.exe" OR CMAKE_LINKER MATCHES "lld-link\\.exe")
set(ASMJIT_LINKER_SUPPORTS_NATVIS TRUE)
endif()
endif()
@@ -351,6 +410,8 @@ set(ASMJIT_SRC_LIST
asmjit/core/globals.h
asmjit/core/inst.cpp
asmjit/core/inst.h
+ asmjit/core/instdb.cpp
+ asmjit/core/instdb_p.h
asmjit/core/jitallocator.cpp
asmjit/core/jitallocator.h
asmjit/core/jitruntime.cpp
@@ -362,6 +423,7 @@ set(ASMJIT_SRC_LIST
asmjit/core/operand.h
asmjit/core/osutils.cpp
asmjit/core/osutils.h
+ asmjit/core/osutils_p.h
asmjit/core/raassignment_p.h
asmjit/core/rabuilders_p.h
asmjit/core/radefs_p.h
@@ -395,11 +457,13 @@ set(ASMJIT_SRC_LIST
asmjit/core/zonevector.cpp
asmjit/core/zonevector.h
+ asmjit/a64.h
asmjit/arm.h
asmjit/arm/armformatter.cpp
asmjit/arm/armformatter_p.h
asmjit/arm/armglobals.h
asmjit/arm/armoperand.h
+ asmjit/arm/armutils.h
asmjit/arm/a64archtraits_p.h
asmjit/arm/a64assembler.cpp
asmjit/arm/a64assembler.h
@@ -423,7 +487,6 @@ set(ASMJIT_SRC_LIST
asmjit/arm/a64operand.h
asmjit/arm/a64rapass.cpp
asmjit/arm/a64rapass_p.h
- asmjit/arm/a64utils.h
asmjit/x86.h
asmjit/x86/x86archtraits_p.h
@@ -468,9 +531,7 @@ foreach(src_file ${ASMJIT_SRC_LIST})
endif()
endforeach()
-if (NOT ${CMAKE_VERSION} VERSION_LESS "3.8.0")
- source_group(TREE "${ASMJIT_DIR}" FILES ${ASMJIT_SRC})
-endif()
+source_group(TREE "${ASMJIT_DIR}" FILES ${ASMJIT_SRC})
# AsmJit - Summary
# ================
@@ -503,10 +564,8 @@ if (NOT ASMJIT_EMBED)
$<BUILD_INTERFACE:${ASMJIT_INCLUDE_DIRS}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
- # Add blend2d::blend2d alias.
+ # Create an asmjit::asmjit alias.
add_library(asmjit::asmjit ALIAS asmjit)
- # TODO: [CMAKE] Deprecated alias - we use projectname::libraryname convention now.
- add_library(AsmJit::AsmJit ALIAS asmjit)
# Add AsmJit install instructions (library and public headers).
if (NOT ASMJIT_NO_INSTALL)
@@ -568,6 +627,7 @@ if (NOT ASMJIT_EMBED)
CFLAGS_REL ${ASMJIT_PRIVATE_CFLAGS_REL})
foreach(_target asmjit_test_emitters
+ asmjit_test_execute
asmjit_test_x86_sections)
asmjit_add_target(${_target} TEST
SOURCES test/${_target}.cpp
@@ -588,11 +648,29 @@ if (NOT ASMJIT_EMBED)
if (NOT (ASMJIT_NO_BUILDER OR ASMJIT_NO_COMPILER))
# Vectorcall tests and XMM tests require at least SSE2 in 32-bit mode (in 64-bit mode it's implicit).
- set(sse2_flags "")
- if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
- asmjit_detect_cflags(sse2_flags "-arch:SSE2")
- else()
- asmjit_detect_cflags(sse2_flags "-msse2")
+ # Some compilers don't like passing -msse2 for 64-bit targets, and some compilers targeting non-x86
+ # would pass "-msse2" compile flag check, but with a warning not detected by CMake. Thus, verify that
+ # our target is really 32-bit X86 and only use -msse2 or -arch:SSE2 flags when necessary.
+ set(ASMJIT_SSE2_CFLAGS "")
+
+ check_cxx_source_compiles("
+ #if defined(_M_IX86) || defined(__X86__) || defined(__i386__)
+ int target_is_32_bit_x86() { return 1; }
+ #else
+ // Compile error...
+ #endif
+
+ int main() {
+ return target_is_32_bit_x86();
+ }
+ " ASMJIT_TARGET_IS_32_BIT_X86)
+
+ if (ASMJIT_TARGET_IS_32_BIT_X86)
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+ asmjit_detect_cflags(ASMJIT_SSE2_CFLAGS "-arch:SSE2")
+ else()
+ asmjit_detect_cflags(ASMJIT_SSE2_CFLAGS "-msse2")
+ endif()
endif()
asmjit_add_target(asmjit_test_compiler TEST
SOURCES test/asmjit_test_compiler.cpp
@@ -600,12 +678,10 @@ if (NOT ASMJIT_EMBED)
test/asmjit_test_compiler_a64.cpp
test/asmjit_test_compiler_x86.cpp
LIBRARIES asmjit::asmjit
- CFLAGS ${ASMJIT_PRIVATE_CFLAGS} ${sse2_flags}
+ CFLAGS ${ASMJIT_PRIVATE_CFLAGS} ${ASMJIT_SSE2_CFLAGS}
CFLAGS_DBG ${ASMJIT_PRIVATE_CFLAGS_DBG}
CFLAGS_REL ${ASMJIT_PRIVATE_CFLAGS_REL})
endif()
endif()
endif()
-
-cmake_policy(POP)
diff --git a/3rdparty/asmjit/CONTRIBUTING.md b/3rdparty/asmjit/CONTRIBUTING.md
new file mode 100644
index 00000000000..54f5047b223
--- /dev/null
+++ b/3rdparty/asmjit/CONTRIBUTING.md
@@ -0,0 +1,102 @@
+## How to Contribute to AsmJit
+
+### Did you find a bug or something isn't working as expected?
+
+ * Please use [Issues](https://github.com/asmjit/asmjit/issues) page to report bugs or create a [pull request](https://github.com/asmjit/asmjit/pulls) if you have already fixed it.
+
+ * Make sure that when a bug is reported it provides as much information as possible to make it easy to either reproduce it locally or to at least guess where the problem could be. AsmJit is a low-level tool, which makes it very easy to emit code that would crash or not work as intended when executed. Always use AsmJit's [Logging](https://asmjit.com/doc/group__asmjit__logging.html) and [Error Handling](https://asmjit.com/doc/group__asmjit__error__handling.html) features first to analyze whether there is not a simple to catch bug in your own code.
+
+ * Don't be afraid to ask for help if you don't know how to solve a particular problem or in case it's unclear how to do it. The community would help if the problem is well described and has a solution. In general we always try to at least improve the documentation in case it doesn't provide enough information and users must ask for help.
+
+### Asking questions
+
+ * We prefer GitHub issues to be used for reporting bugs or feature requests, but it's still okay to ask questions there as well. However, please consider joining our [Gitter Chat](https://app.gitter.im/#/room/#asmjit:gitter.im) to ask questions; it has an active community that can quickly respond.
+
+### Suggesting feature requests
+
+ * It's very likely that when using AsmJit you have found something that AsmJit doesn't provide, which would be handy to have as a built-in. The [Issues](https://github.com/asmjit/asmjit/issues) page can be used to submit feature requests, but please keep in mind that AsmJit is a relatively small project and not all requested features will be accepted, especially if they are non-trivial, time consuming to implement, or the scope of the feature doesn't match AsmJit goals.
+
+ * If you have already implemented the feature you are suggesting, please open a [pull request](https://github.com/asmjit/asmjit/pulls).
+
+ * Ports (requesting new AsmJit backends) can be reported as feature requests, but only by people that are willing to work on them as creating new ports takes a lot of time.
+
+### Suggesting a documentation enhancement
+
+ * [AsmJit's documentation](https://asmjit.com/doc/index.html) is auto-generated from source code, so if you would like to improve it just open a [pull request](https://github.com/asmjit/asmjit/pulls) with your changes. The documentation uses [Doxygen](https://www.doxygen.nl/) as a front-end, so you can use `\ref` keyword to create links and other Doxygen keywords to enhance the documentation.
+
+### Suggesting a website content enhancement
+
+ * [AsmJit's website](https://asmjit.com) is also generated, but not from public sources at the moment. If you did find an issue on the website you can either use contact information on the [support page](https://asmjit.com/support.html) or to discuss the change on our [Gitter Chat](https://app.gitter.im/#/room/#asmjit:gitter.im). Alternatively, opening a regular issue is also okay.
+
+
+## Coding Style & Consistency
+
+ * If you decide to open a pull request, make sure that the code you submit uses the same convention as the rest of the code. We prefer keeping the code consistent.
+
+ * [.editorconfig](./.editorconfig) should help with basic settings.
+
+ * Initially, AsmJit coding style was based on Google C++ Style Guide, but it has diverged from it.
+
+ * Include guards use `<PATH_TO_SRC>_H_INCLUDED` format.
+
+ * `asmjit` namespace must be open by `ASMJIT_BEGIN_NAMESPACE` and closed by `ASMJIT_END_NAMESPACE`
+
+ * `asmjit::xxx` (backend specific) nested namespace must be open by `ASMJIT_BEGIN_SUB_NAMESPACE(xxx)` and closed by `ASMJIT_END_SUB_NAMESPACE`.
+
+ * Opening bracket is on the same line, like `struct Something {`, `if (condition) {`, etc...
+
+ * The code uses a soft limit of 120 characters per line (including documentation), but it's not enforced and it's okay to use more when it makes sense (for example defining tables, etc...).
+
+ * Since AsmJit doesn't use Exceptions nor RTTI the code cannot use containers provided by the C++ standard library. In general, we try to only use a bare minimum from the C++ standard library to make it viable to use AsmJit even in C code bases where JIT complier is implemented in C++ ([Erlang](https://www.erlang.org/) can be seen as a great example).
+
+## Testing
+
+ * AsmJit uses a minimalist unit testing framework to write unit tests to avoid third-party dependencies.
+
+ * At the moment tests are in the same file as the implementation and are only compiled when `ASMJIT_TEST` macro is defined.
+
+ * Use `-DASMJIT_TEST=1` when invoking [CMake](https://cmake.org/) to compile AsmJit tests.
+
+ * Unit tests are compiled to a single `asmjit_test_unit[.exe]` executable.
+
+ * Other tests have their own executables based on what is tested.
+
+ * Always add assembler tests when adding new instructions, see [asmjit_test_assembler_x64.cpp](./test/asmjit_test_assembler_x64.cpp) and [asmjit_test_assembler_a64.cpp](./test/asmjit_test_assembler_a64.cpp) for more details.
+
+## Pull Request Messages
+
+ * If a change fixes a bug the message should should start with `[bug]`.
+
+ * If a change fixes or enhances documentation it should start with `[doc]`.
+
+ * If a change fixes or enhances our CI it should start with `[ci]`.
+
+ * If a change breaks ABI it must start with `[abi]`.
+
+ * Otherwise there is no suggested prefix.
+
+## ABI Changes
+
+ * ABI changes happen, but they are usually accumulated and committed within a short time window to not break it often. In general we prefer to break ABI once a year, or once 6 months if there is something that has a high priority. There are no hard rules though.
+
+ * AsmJit uses an `inline namespace`, which should make it impossible to link to AsmJit library that is ABI incompatible. When ABI break happens both AsmJit version and ABI namespace are changed, see [asmjit/core/api-config.h](./src/asmjit/core/api-config.h) for more details.
+
+ * What is an ABI break?
+
+ * Modifying a public struct/class in a way that its functionality is altered and/or its size is changed
+
+ * Adding/removing virtual functions to/from classes, respectively
+
+ * Changing a signature of a public function or a class member function (for example adding a parameter).
+
+ * Changing the value of an enum or global constant (for example instructions are now sorted by name, so adding a new instruction breaks ABI)
+
+ * Possibly more, but these were the most common...
+
+ * What is not ABI break?
+
+ * Extending the functionality by using reserved members of a struct/class
+
+ * Adding new API including new structs and classes
+
+ * Changing anything that is internal and that doesn't leak to public headers
diff --git a/3rdparty/asmjit/LICENSE.md b/3rdparty/asmjit/LICENSE.md
index 020a569dbde..d87dbf9bca2 100644
--- a/3rdparty/asmjit/LICENSE.md
+++ b/3rdparty/asmjit/LICENSE.md
@@ -1,4 +1,4 @@
-Copyright (c) 2008-2020 The AsmJit Authors
+Copyright (c) 2008-2024 The AsmJit Authors
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff --git a/3rdparty/asmjit/README.md b/3rdparty/asmjit/README.md
index c683989c656..ee0c7200ed3 100644
--- a/3rdparty/asmjit/README.md
+++ b/3rdparty/asmjit/README.md
@@ -5,7 +5,7 @@ AsmJit is a lightweight library for machine code generation written in C++ langu
* [Official Home Page (asmjit.com)](https://asmjit.com)
* [Official Repository (asmjit/asmjit)](https://github.com/asmjit/asmjit)
- * [Public Chat Channel](https://gitter.im/asmjit/asmjit)
+ * [Public Chat Channel](https://app.gitter.im/#/room/#asmjit:gitter.im)
* [Zlib License](./LICENSE.md)
See [asmjit.com](https://asmjit.com) page for more details, examples, and documentation.
@@ -16,41 +16,42 @@ Documentation
* [Documentation Index](https://asmjit.com/doc/index.html)
* [Build Instructions](https://asmjit.com/doc/group__asmjit__build.html)
+Contributing
+------------
+
+ * See [CONTRIBUTING](./CONTRIBUTING.md) page for more details
+
Breaking Changes
----------------
Breaking the API is sometimes inevitable, what to do?
- * See [Breaking Changes Guide](https://asmjit.com/doc/group__asmjit__breaking__changes.html), which is now part of AsmJit documentation.
+ * See [Breaking Changes Guide](https://asmjit.com/doc/group__asmjit__breaking__changes.html), which is now part of AsmJit documentation
* See asmjit tests, they always compile and provide implementation of many use-cases:
- * [asmjit_test_emitters.cpp](./test/asmjit_test_emitters.cpp) - Tests that demonstrate the purpose of emitters.
- * [asmjit_test_assembler_x86.cpp](./test/asmjit_test_assembler_x86.cpp) - Tests targeting AsmJit's Assembler (x86/x64).
- * [asmjit_test_compiler_x86.cpp](./test/asmjit_test_compiler_x86.cpp) - Tests targeting AsmJit's Compiler (x86/x64).
- * [asmjit_test_instinfo.cpp](./test/asmjit_test_instinfo.cpp) - Tests that query instruction information.
+ * [asmjit_test_emitters.cpp](./test/asmjit_test_emitters.cpp) - Tests that demonstrate the purpose of emitters
+ * [asmjit_test_assembler_x86.cpp](./test/asmjit_test_assembler_x86.cpp) - Tests targeting AsmJit's Assembler (x86/x64)
+ * [asmjit_test_compiler_x86.cpp](./test/asmjit_test_compiler_x86.cpp) - Tests targeting AsmJit's Compiler (x86/x64)
+ * [asmjit_test_instinfo.cpp](./test/asmjit_test_instinfo.cpp) - Tests that query instruction information
* [asmjit_test_x86_sections.cpp](./test/asmjit_test_x86_sections.cpp) - Multiple sections test.
- * Visit our [Official Chat](https://gitter.im/asmjit/asmjit) if you need a quick help.
+ * Visit our [Gitter Chat](https://app.gitter.im/#/room/#asmjit:gitter.im) if you need a quick help
Project Organization
--------------------
- * **`/`** - Project root.
- * **src** - Source code.
- * **asmjit** - Source code and headers (always point include path in here).
- * **core** - Core API, backend independent except relocations.
- * **arm** - ARM specific API, used only by ARM and AArch64 backends.
- * **x86** - X86 specific API, used only by X86 and X64 backends.
- * **test** - Unit and integration tests (don't embed in your project).
- * **tools** - Tools used for configuring, documenting, and generating files.
-
-TODO
-----
-
- * [ ] Core:
- * [ ] Add support for user external buffers in CodeBuffer / CodeHolder.
- * [ ] Ports:
- * [ ] 32-bit ARM/Thumb port.
- * [ ] 64-bit ARM (AArch64) port.
- * [ ] RISC-V port.
+ * **`/`** - Project root
+ * **src** - Source code
+ * **asmjit** - Source code and headers (always point include path in here)
+ * **core** - Core API, backend independent except relocations
+ * **arm** - ARM specific API, used only by ARM and AArch64 backends
+ * **x86** - X86 specific API, used only by X86 and X64 backends
+ * **test** - Unit and integration tests (don't embed in your project)
+ * **tools** - Tools used for configuring, documenting, and generating files
+
+Ports
+-----
+
+ * [ ] 32-bit ARM/Thumb port (work in progress)
+ * [ ] RISC-V port (not in progress, help welcome)
Support
-------
diff --git a/3rdparty/asmjit/src/asmjit/a64.h b/3rdparty/asmjit/src/asmjit/a64.h
index ea4d304f058..e849eb3a8ca 100644
--- a/3rdparty/asmjit/src/asmjit/a64.h
+++ b/3rdparty/asmjit/src/asmjit/a64.h
@@ -18,25 +18,24 @@
//! ### Supported Instructions
//!
//! - Emitters:
-//! - \ref a64::EmitterExplicitT - Provides all instructions that use explicit
-//! operands, provides also utility functions. The member functions provided
-//! are part of all ARM/AArch64 emitters.
+//! - \ref a64::EmitterExplicitT - Provides all instructions that use explicit operands, provides also utility
+//! functions. The member functions provided are part of all AArch64 emitters.
//!
//! - Instruction representation:
//! - \ref a64::Inst::Id - instruction identifiers.
//!
//! ### Register Operands
//!
-//! - \ref arm::Reg - Base class for any AArch32/AArch64 register.
-//! - \ref arm::Gp - General purpose register:
-//! - \ref arm::GpW - 32-bit register.
-//! - \ref arm::GpX - 64-bit register.
-//! - \ref arm::Vec - Vector (SIMD) register:
-//! - \ref arm::VecB - 8-bit SIMD register (AArch64 only).
-//! - \ref arm::VecH - 16-bit SIMD register (AArch64 only).
-//! - \ref arm::VecS - 32-bit SIMD register.
-//! - \ref arm::VecD - 64-bit SIMD register.
-//! - \ref arm::VecV - 128-bit SIMD register.
+//! - \ref arm::Reg - Base class of all AArch32/AArch64 registers.
+//! - \ref a64::Gp - General purpose register (AArch64):
+//! - \ref a64::GpW - 32-bit general purpose register (AArch64).
+//! - \ref a64::GpX - 64-bit general purpose register (AArch64).
+//! - \ref a64::Vec - Vector (SIMD) register:
+//! - \ref a64::VecB - 8-bit SIMD register.
+//! - \ref a64::VecH - 16-bit SIMD register.
+//! - \ref a64::VecS - 32-bit SIMD register.
+//! - \ref a64::VecD - 64-bit SIMD register.
+//! - \ref a64::VecV - 128-bit SIMD register.
//!
//! ### Memory Operands
//!
@@ -46,7 +45,7 @@
//! ### Other
//!
//! - \ref arm::Shift - Shift operation and value.
-//! - \ref a64::Utils - Utilities that can help during code generation for AArch64.
+//! - \ref arm::Utils - Utilities that can help during code generation for AArch32 and AArch64.
#include "./arm.h"
#include "./arm/a64assembler.h"
@@ -56,7 +55,6 @@
#include "./arm/a64globals.h"
#include "./arm/a64instdb.h"
#include "./arm/a64operand.h"
-#include "./arm/a64utils.h"
#endif // ASMJIT_A64_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/arm.h b/3rdparty/asmjit/src/asmjit/arm.h
index 57ffa815b8c..e4a3e3d3ac5 100644
--- a/3rdparty/asmjit/src/asmjit/arm.h
+++ b/3rdparty/asmjit/src/asmjit/arm.h
@@ -11,11 +11,19 @@
//! ### Namespaces
//!
//! - \ref arm - arm namespace provides common functionality for both AArch32 and AArch64 backends.
+//! - \ref a32 - a32 namespace provides support for AArch32 architecture. In addition it includes
+//! \ref arm namespace, so you can only use a single namespace when targeting AArch32 architecture.
//! - \ref a64 - a64 namespace provides support for AArch64 architecture. In addition it includes
//! \ref arm namespace, so you can only use a single namespace when targeting AArch64 architecture.
//!
//! ### Emitters
//!
+//! - AArch32
+//! - \ref a32::Assembler - AArch32 assembler (must read, provides examples).
+//! - \ref a32::Builder - AArch32 builder.
+//! - \ref a32::Compiler - AArch32 compiler.
+//! - \ref a32::Emitter - AArch32 emitter (abstract).
+//!
//! - AArch64
//! - \ref a64::Assembler - AArch64 assembler (must read, provides examples).
//! - \ref a64::Builder - AArch64 builder.
@@ -24,6 +32,13 @@
//!
//! ### Supported Instructions
//!
+//! - AArch32:
+//! - Emitters:
+//! - \ref a32::EmitterExplicitT - Provides all instructions that use explicit operands, provides also
+//! utility functions. The member functions provided are part of all AArch32 emitters.
+//! - Instruction representation:
+//! - \ref a32::Inst::Id - instruction identifiers.
+//!
//! - AArch64:
//! - Emitters:
//! - \ref a64::EmitterExplicitT - Provides all instructions that use explicit operands, provides also
@@ -33,16 +48,22 @@
//!
//! ### Register Operands
//!
-//! - \ref arm::Reg - Base class for any AArch32/AArch64 register.
-//! - \ref arm::Gp - General purpose register:
-//! - \ref arm::GpW - 32-bit register.
-//! - \ref arm::GpX - 64-bit register.
-//! - \ref arm::Vec - Vector (SIMD) register:
-//! - \ref arm::VecB - 8-bit SIMD register (AArch64 only).
-//! - \ref arm::VecH - 16-bit SIMD register (AArch64 only).
-//! - \ref arm::VecS - 32-bit SIMD register.
-//! - \ref arm::VecD - 64-bit SIMD register.
-//! - \ref arm::VecV - 128-bit SIMD register.
+//! - \ref arm::Reg - Base class of all AArch32/AArch64 registers.
+//! - \ref a32::Gp - 32-bit general purpose register used by AArch32:
+//! - \ref a64::Gp - 32-bit or 64-bit general purpose register used by AArch64:
+//! - \ref a64::GpW - 32-bit register (AArch64).
+//! - \ref a64::GpX - 64-bit register (AArch64).
+//! - \ref arm::BaseVec - Base vector (SIMD) register.
+//! - \ref a32::Vec - Vector (SIMD) register (AArch32):
+//! - \ref a32::VecS - 32-bit SIMD register (AArch32).
+//! - \ref a32::VecD - 64-bit SIMD register (AArch32).
+//! - \ref a32::VecV - 128-bit SIMD register (AArch32).
+//! - \ref a64::Vec - Vector (SIMD) register (AArch64):
+//! - \ref a64::VecB - 8-bit SIMD register (AArch64).
+//! - \ref a64::VecH - 16-bit SIMD register (AArch64).
+//! - \ref a64::VecS - 32-bit SIMD register (AArch64).
+//! - \ref a64::VecD - 64-bit SIMD register (AArch64).
+//! - \ref a64::VecV - 128-bit SIMD register (AArch64).
//!
//! ### Memory Operands
//!
@@ -53,10 +74,11 @@
//!
//! - \ref arm::Shift - Shift operation and value (both AArch32 and AArch64).
//! - \ref arm::DataType - Data type that is part of an instruction in AArch32 mode.
-//! - \ref a64::Utils - Utilities that can help during code generation for AArch64.
+//! - \ref arm::Utils - Utilities that can help during code generation for AArch32 and AArch64.
#include "./core.h"
#include "./arm/armglobals.h"
#include "./arm/armoperand.h"
+#include "./arm/armutils.h"
#endif // ASMJIT_ARM_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64archtraits_p.h b/3rdparty/asmjit/src/asmjit/arm/a64archtraits_p.h
index 87559c71d5a..4b5bde68a9e 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64archtraits_p.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64archtraits_p.h
@@ -9,6 +9,7 @@
#include "../core/archtraits.h"
#include "../core/misc_p.h"
#include "../core/type.h"
+#include "../arm/a64globals.h"
#include "../arm/a64operand.h"
ASMJIT_BEGIN_SUB_NAMESPACE(a64)
@@ -24,7 +25,7 @@ static const constexpr ArchTraits a64ArchTraits = {
// Reserved.
{ 0, 0, 0 },
- // HW stack alignment (AArch64 requires stack aligned to 64 bytes).
+ // HW stack alignment (AArch64 requires stack aligned to 16 bytes at HW level).
16,
// Min/max stack offset - byte addressing is the worst, VecQ addressing the best.
@@ -39,12 +40,12 @@ static const constexpr ArchTraits a64ArchTraits = {
}},
// RegInfo.
- #define V(index) OperandSignature{arm::RegTraits<RegType(index)>::kSignature}
+ #define V(index) OperandSignature{RegTraits<RegType(index)>::kSignature}
{{ ASMJIT_LOOKUP_TABLE_32(V, 0) }},
#undef V
// RegTypeToTypeId.
- #define V(index) TypeId(arm::RegTraits<RegType(index)>::kTypeId)
+ #define V(index) TypeId(RegTraits<RegType(index)>::kTypeId)
{{ ASMJIT_LOOKUP_TABLE_32(V, 0) }},
#undef V
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64assembler.cpp b/3rdparty/asmjit/src/asmjit/arm/a64assembler.cpp
index 485f05f491f..32514b9bad9 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64assembler.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64assembler.cpp
@@ -14,19 +14,23 @@
#include "../core/misc_p.h"
#include "../core/support.h"
#include "../arm/armformatter_p.h"
+#include "../arm/armutils.h"
#include "../arm/a64assembler.h"
#include "../arm/a64emithelper_p.h"
#include "../arm/a64instdb_p.h"
-#include "../arm/a64utils.h"
ASMJIT_BEGIN_SUB_NAMESPACE(a64)
+// a64::Assembler - Utils
+// ======================
+
+static ASMJIT_FORCE_INLINE constexpr uint32_t diff(RegType a, RegType b) noexcept { return uint32_t(a) - uint32_t(b); }
+static ASMJIT_FORCE_INLINE constexpr uint32_t diff(VecElementType elementType, VecElementType baseType) noexcept { return uint32_t(elementType) - uint32_t(baseType); }
+
// a64::Assembler - Cond
// =====================
-static inline uint32_t condCodeToOpcodeCond(uint32_t cond) noexcept {
- return (uint32_t(cond) - 2u) & 0xFu;
-}
+static inline uint32_t condCodeToOpcodeCond(uint32_t cond) noexcept { return (uint32_t(cond) - 2u) & 0xFu; }
// a64::Assembler - Bits
// =====================
@@ -49,8 +53,19 @@ static constexpr uint32_t kWX = InstDB::kWX;
static const uint8_t armShiftOpToLdStOptMap[] = { ASMJIT_LOOKUP_TABLE_16(VALUE, 0) };
#undef VALUE
-static inline constexpr uint32_t diff(RegType a, RegType b) noexcept {
- return uint32_t(a) - uint32_t(b);
+// a64::Assembler - ExtendOpToRegType
+// ==================================
+
+static inline RegType extendOptionToRegType(uint32_t option) noexcept {
+ uint32_t pred = (uint32_t(RegType::kARM_GpW) << (0x0 * 4)) | // 0b000 - UXTB.
+ (uint32_t(RegType::kARM_GpW) << (0x1 * 4)) | // 0b001 - UXTH.
+ (uint32_t(RegType::kARM_GpW) << (0x2 * 4)) | // 0b010 - UXTW.
+ (uint32_t(RegType::kARM_GpX) << (0x3 * 4)) | // 0b011 - UXTX|LSL.
+ (uint32_t(RegType::kARM_GpW) << (0x4 * 4)) | // 0b100 - SXTB.
+ (uint32_t(RegType::kARM_GpW) << (0x5 * 4)) | // 0b101 - SXTH.
+ (uint32_t(RegType::kARM_GpW) << (0x6 * 4)) | // 0b110 - SXTW.
+ (uint32_t(RegType::kARM_GpX) << (0x7 * 4)) ; // 0b111 - SXTX.
+ return RegType((pred >> (option * 4u)) & 0xFu);
}
// asmjit::a64::Assembler - SizeOp
@@ -118,25 +133,25 @@ struct SizeOpTable {
};
#define VALUE_BIN(x) { \
- x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeNone)) ? SizeOp::k00 : \
- x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeNone)) ? SizeOp::k00Q : \
- x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeB )) ? SizeOp::k00 : \
- x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeB )) ? SizeOp::k00Q : SizeOp::kInvalid \
+ x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kNone)) ? SizeOp::k00 : \
+ x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kNone)) ? SizeOp::k00Q : \
+ x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kB )) ? SizeOp::k00 : \
+ x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kB )) ? SizeOp::k00Q : SizeOp::kInvalid \
}
#define VALUE_ANY(x) { \
- x == (((uint32_t(RegType::kARM_VecB) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeNone)) ? SizeOp::k00S : \
- x == (((uint32_t(RegType::kARM_VecH) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeNone)) ? SizeOp::k01S : \
- x == (((uint32_t(RegType::kARM_VecS) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeNone)) ? SizeOp::k10S : \
- x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeNone)) ? SizeOp::k11S : \
- x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeB )) ? SizeOp::k00 : \
- x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeB )) ? SizeOp::k00Q : \
- x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeH )) ? SizeOp::k01 : \
- x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeH )) ? SizeOp::k01Q : \
- x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeS )) ? SizeOp::k10 : \
- x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeS )) ? SizeOp::k10Q : \
- x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeD )) ? SizeOp::k11S : \
- x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | (Vec::kElementTypeD )) ? SizeOp::k11Q : SizeOp::kInvalid \
+ x == (((uint32_t(RegType::kARM_VecB) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kNone)) ? SizeOp::k00S : \
+ x == (((uint32_t(RegType::kARM_VecH) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kNone)) ? SizeOp::k01S : \
+ x == (((uint32_t(RegType::kARM_VecS) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kNone)) ? SizeOp::k10S : \
+ x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kNone)) ? SizeOp::k11S : \
+ x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kB )) ? SizeOp::k00 : \
+ x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kB )) ? SizeOp::k00Q : \
+ x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kH )) ? SizeOp::k01 : \
+ x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kH )) ? SizeOp::k01Q : \
+ x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kS )) ? SizeOp::k10 : \
+ x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kS )) ? SizeOp::k10Q : \
+ x == (((uint32_t(RegType::kARM_VecD) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kD )) ? SizeOp::k11S : \
+ x == (((uint32_t(RegType::kARM_VecV) - uint32_t(RegType::kARM_VecB)) << 3) | uint32_t(VecElementType::kD )) ? SizeOp::k11Q : SizeOp::kInvalid \
}
static const SizeOpTable sizeOpTable[SizeOpTable::kCount] = {
@@ -254,16 +269,16 @@ static const Operand_& significantSimdOp(const Operand_& o0, const Operand_& o1,
return !(instFlags & InstDB::kInstFlagLong) ? o0 : o1;
}
-static inline SizeOp armElementTypeToSizeOp(uint32_t vecOpType, RegType regType, uint32_t elementType) noexcept {
+static inline SizeOp armElementTypeToSizeOp(uint32_t vecOpType, RegType regType, VecElementType elementType) noexcept {
// Instruction data or Assembler is wrong if this triggers an assertion failure.
ASMJIT_ASSERT(vecOpType < InstDB::kVO_Count);
// ElementType uses 3 bits in the operand signature, it should never overflow.
- ASMJIT_ASSERT(elementType <= 0x7u);
+ ASMJIT_ASSERT(uint32_t(elementType) <= 0x7u);
const SizeOpMap& map = sizeOpMap[vecOpType];
const SizeOpTable& table = sizeOpTable[map.tableId];
- size_t index = (Support::min<uint32_t>(diff(regType, RegType::kARM_VecB), diff(RegType::kARM_VecV, RegType::kARM_VecB) + 1) << 3) | elementType;
+ size_t index = (Support::min<uint32_t>(diff(regType, RegType::kARM_VecB), diff(RegType::kARM_VecV, RegType::kARM_VecB) + 1) << 3) | uint32_t(elementType);
SizeOp op = table.array[index];
SizeOp modifiedOp { uint8_t(op.value & map.sizeOpMask) };
@@ -398,14 +413,6 @@ static inline bool encodeLMH(uint32_t sizeField, uint32_t elementIndex, LMHImm*
return elementIndex <= maxElementIndex;
}
-// [.......A|B.......|.......C|D.......|.......E|F.......|.......G|H.......]
-static inline uint32_t encodeImm64ByteMaskToImm8(uint64_t imm) noexcept {
- return uint32_t(((imm >> (7 - 0)) & 0b00000011) | // [.......G|H.......]
- ((imm >> (23 - 2)) & 0b00001100) | // [.......E|F.......]
- ((imm >> (39 - 4)) & 0b00110000) | // [.......C|D.......]
- ((imm >> (55 - 6)) & 0b11000000)); // [.......A|B.......]
-}
-
// a64::Assembler - Opcode
// =======================
@@ -475,7 +482,7 @@ static inline bool matchSignature(const Operand_& o0, const Operand_& o1, const
}
static inline bool matchSignature(const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3, uint32_t instFlags) noexcept {
- return matchSignature(o0, o1, instFlags) && o1.signature() == o2.signature() && o2.signature() == o3.signature();;
+ return matchSignature(o0, o1, instFlags) && o1.signature() == o2.signature() && o2.signature() == o3.signature();
}
// Memory must be either:
@@ -545,7 +552,7 @@ static inline bool pickFpOpcode(const Vec& reg, uint32_t sOp, uint32_t sHf, uint
else {
// Vector operation [HSD].
uint32_t q = diff(reg.type(), RegType::kARM_VecD);
- uint32_t sz = reg.elementType() - Vec::kElementTypeH;
+ uint32_t sz = diff(reg.elementType(), VecElementType::kH);
if (q > 1u || sz > 2u || !Support::bitTest(szBits[vHf].sizeMask, sz))
return false;
@@ -698,25 +705,25 @@ static const Support::Array<uint8_t, 32> commonHiRegIdOfType = {{
#undef V
static inline bool checkValidRegs(const Operand_& o0) noexcept {
- return ((o0.id() < 31) | (o0.id() == commonHiRegIdOfType[o0.as<Reg>().type()]));
+ return bool(unsigned(o0.id() < 31) | unsigned(o0.id() == commonHiRegIdOfType[o0.as<Reg>().type()]));
}
static inline bool checkValidRegs(const Operand_& o0, const Operand_& o1) noexcept {
- return ((o0.id() < 31) | (o0.id() == commonHiRegIdOfType[o0.as<Reg>().type()])) &
- ((o1.id() < 31) | (o1.id() == commonHiRegIdOfType[o1.as<Reg>().type()])) ;
+ return bool((unsigned(o0.id() < 31) | unsigned(o0.id() == commonHiRegIdOfType[o0.as<Reg>().type()])) &
+ (unsigned(o1.id() < 31) | unsigned(o1.id() == commonHiRegIdOfType[o1.as<Reg>().type()])));
}
static inline bool checkValidRegs(const Operand_& o0, const Operand_& o1, const Operand_& o2) noexcept {
- return ((o0.id() < 31) | (o0.id() == commonHiRegIdOfType[o0.as<Reg>().type()])) &
- ((o1.id() < 31) | (o1.id() == commonHiRegIdOfType[o1.as<Reg>().type()])) &
- ((o2.id() < 31) | (o2.id() == commonHiRegIdOfType[o2.as<Reg>().type()])) ;
+ return bool((unsigned(o0.id() < 31) | unsigned(o0.id() == commonHiRegIdOfType[o0.as<Reg>().type()])) &
+ (unsigned(o1.id() < 31) | unsigned(o1.id() == commonHiRegIdOfType[o1.as<Reg>().type()])) &
+ (unsigned(o2.id() < 31) | unsigned(o2.id() == commonHiRegIdOfType[o2.as<Reg>().type()])));
}
static inline bool checkValidRegs(const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3) noexcept {
- return ((o0.id() < 31) | (o0.id() == commonHiRegIdOfType[o0.as<Reg>().type()])) &
- ((o1.id() < 31) | (o1.id() == commonHiRegIdOfType[o1.as<Reg>().type()])) &
- ((o2.id() < 31) | (o2.id() == commonHiRegIdOfType[o2.as<Reg>().type()])) &
- ((o3.id() < 31) | (o3.id() == commonHiRegIdOfType[o3.as<Reg>().type()])) ;
+ return bool((unsigned(o0.id() < 31) | unsigned(o0.id() == commonHiRegIdOfType[o0.as<Reg>().type()])) &
+ (unsigned(o1.id() < 31) | unsigned(o1.id() == commonHiRegIdOfType[o1.as<Reg>().type()])) &
+ (unsigned(o2.id() < 31) | unsigned(o2.id() == commonHiRegIdOfType[o2.as<Reg>().type()])) &
+ (unsigned(o3.id() < 31) | unsigned(o3.id() == commonHiRegIdOfType[o3.as<Reg>().type()])));
}
// a64::Assembler - Construction & Destruction
@@ -724,8 +731,6 @@ static inline bool checkValidRegs(const Operand_& o0, const Operand_& o1, const
Assembler::Assembler(CodeHolder* code) noexcept : BaseAssembler() {
_archMask = uint64_t(1) << uint32_t(Arch::kAArch64);
- assignEmitterFuncs(this);
-
if (code)
code->attach(this);
}
@@ -811,7 +816,7 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
Operand_ opArray[Globals::kMaxOpCount];
EmitterUtils::opArrayFromEmitArgs(opArray, o0, o1, o2, opExt);
- err = _funcs.validate(arch(), BaseInst(instId, options, _extraReg), opArray, Globals::kMaxOpCount, ValidationFlags::kNone);
+ err = _funcs.validate(BaseInst(instId, options, _extraReg), opArray, Globals::kMaxOpCount, ValidationFlags::kNone);
if (ASMJIT_UNLIKELY(err))
goto Failed;
}
@@ -1238,9 +1243,6 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
}
if (isign4 == ENC_OPS3(Reg, Reg, Reg) || isign4 == ENC_OPS4(Reg, Reg, Reg, Imm)) {
- if (!checkSignature(o1, o2))
- goto InvalidInstruction;
-
uint32_t opSize = x ? 64 : 32;
uint64_t shift = 0;
uint32_t sType = uint32_t(ShiftOp::kLSL);
@@ -1257,11 +1259,17 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
if (sType <= uint32_t(ShiftOp::kASR)) {
bool hasSP = o0.as<Gp>().isSP() || o1.as<Gp>().isSP();
if (!hasSP) {
- if (!checkGpId(o0, o1, kZR))
+ if (!checkSignature(o1, o2)) {
+ goto InvalidInstruction;
+ }
+
+ if (!checkGpId(o0, o1, kZR)) {
goto InvalidPhysId;
+ }
- if (shift >= opSize)
+ if (shift >= opSize) {
goto InvalidImmediate;
+ }
opcode.reset(uint32_t(opData.shiftedOp) << 21);
opcode.addImm(x, 31);
@@ -1274,8 +1282,10 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
}
// SP register can only be used with LSL or Extend.
- if (sType != uint32_t(ShiftOp::kLSL))
+ if (sType != uint32_t(ShiftOp::kLSL)) {
goto InvalidImmediate;
+ }
+
sType = x ? uint32_t(ShiftOp::kUXTX) : uint32_t(ShiftOp::kUXTW);
}
@@ -1283,8 +1293,9 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
opcode.reset(uint32_t(opData.extendedOp) << 21);
sType -= uint32_t(ShiftOp::kUXTB);
- if (sType > 7 || shift > 4)
+ if (sType > 7 || shift > 4) {
goto InvalidImmediate;
+ }
if (!(opcode.get() & B(29))) {
// ADD|SUB (extend) - ZR is not allowed.
@@ -1297,6 +1308,11 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
goto InvalidPhysId;
}
+ // Validate whether the register operands match extend option.
+ if (o2.as<Reg>().type() != extendOptionToRegType(sType) || o1.as<Reg>().type() < o2.as<Reg>().type()) {
+ goto InvalidInstruction;
+ }
+
opcode.addImm(x, 31);
opcode.addReg(o2, 16);
opcode.addImm(sType, 13);
@@ -1422,9 +1438,6 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
}
if (isign4 == ENC_OPS2(Reg, Reg) || isign4 == ENC_OPS3(Reg, Reg, Imm)) {
- if (!checkSignature(o0, o1))
- goto InvalidInstruction;
-
uint32_t opSize = x ? 64 : 32;
uint32_t sType = 0;
uint64_t shift = 0;
@@ -1439,8 +1452,13 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
// Shift operation - LSL, LSR, ASR.
if (sType <= uint32_t(ShiftOp::kASR)) {
if (!hasSP) {
- if (shift >= opSize)
+ if (!checkSignature(o0, o1)) {
+ goto InvalidInstruction;
+ }
+
+ if (shift >= opSize) {
goto InvalidImmediate;
+ }
opcode.reset(uint32_t(opData.shiftedOp) << 21);
opcode.addImm(x, 31);
@@ -1461,8 +1479,14 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
// Extend operation - UXTB, UXTH, UXTW, UXTX, SXTB, SXTH, SXTW, SXTX.
sType -= uint32_t(ShiftOp::kUXTB);
- if (sType > 7 || shift > 4)
+ if (sType > 7 || shift > 4) {
goto InvalidImmediate;
+ }
+
+ // Validate whether the register operands match extend option.
+ if (o1.as<Reg>().type() != extendOptionToRegType(sType) || o0.as<Reg>().type() < o1.as<Reg>().type()) {
+ goto InvalidInstruction;
+ }
opcode.reset(uint32_t(opData.extendedOp) << 21);
opcode.addImm(x, 31);
@@ -2250,6 +2274,86 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
}
// ------------------------------------------------------------------------
+ // [Base - Prefetch]
+ // ------------------------------------------------------------------------
+
+ case InstDB::kEncodingBasePrfm: {
+ const InstDB::EncodingData::BasePrfm& opData = InstDB::EncodingData::basePrfm[encodingIndex];
+
+ if (isign4 == ENC_OPS2(Imm, Mem)) {
+ const Mem& m = o1.as<Mem>();
+ rmRel = &m;
+
+ uint32_t immShift = 3u;
+
+ if (o0.as<Imm>().valueAs<uint64_t>() > 0x1Fu)
+ goto InvalidImmediate;
+
+ if (!armCheckMemBaseIndexRel(m))
+ goto InvalidAddress;
+
+ int64_t offset = m.offset();
+ uint32_t prfop = o0.as<Imm>().valueAs<uint32_t>();
+
+ if (m.hasBaseReg()) {
+ // [Base {Offset | Index}]
+ if (m.hasIndex()) {
+ uint32_t opt = armShiftOpToLdStOptMap[size_t(m.shiftOp())];
+ if (opt == 0xFF)
+ goto InvalidAddress;
+
+ uint32_t shift = m.shift();
+ uint32_t s = shift != 0;
+
+ if (s && shift != immShift)
+ goto InvalidAddressScale;
+
+ opcode.reset(uint32_t(opData.registerOp) << 21);
+ opcode.addImm(opt, 13);
+ opcode.addImm(s, 12);
+ opcode |= B(11);
+ opcode.addImm(prfop, 0);
+ goto EmitOp_MemBaseIndex_Rn5_Rm16;
+ }
+
+ if (!Support::isInt32(offset))
+ goto InvalidDisplacement;
+
+ int32_t offset32 = int32_t(offset);
+
+ if (m.isPreOrPost())
+ goto InvalidAddress;
+
+ uint32_t imm12 = uint32_t(offset32) >> immShift;
+
+ if (Support::isUInt12(imm12) && (imm12 << immShift) == uint32_t(offset32)) {
+ opcode.reset(uint32_t(opData.sOffsetOp) << 22);
+ opcode.addImm(imm12, 10);
+ opcode.addImm(prfop, 0);
+ goto EmitOp_MemBase_Rn5;
+ }
+
+ if (Support::isInt9(offset32)) {
+ opcode.reset(uint32_t(opData.uOffsetOp) << 21);
+ opcode.addImm(uint32_t(offset32) & 0x1FFu, 12);
+ opcode.addImm(prfop, 0);
+ goto EmitOp_MemBase_Rn5;
+ }
+
+ goto InvalidAddress;
+ }
+ else {
+ opcode.reset(uint32_t(opData.literalOp) << 24);
+ opcode.addImm(prfop, 0);
+ offsetFormat.resetToImmValue(OffsetType::kSignedOffset, 4, 5, 19, 2);
+ goto EmitOp_Rel;
+ }
+ }
+
+ break;
+ }
+
+ // ------------------------------------------------------------------------
// [Base - Load / Store]
// ------------------------------------------------------------------------
@@ -2280,7 +2384,7 @@ Error Assembler::_emit(InstId instId, const Operand_& o0, const Operand_& o1, co
if (m.hasBaseReg()) {
// [Base {Offset | Index}]
if (m.hasIndex()) {
- uint32_t opt = armShiftOpToLdStOptMap[m.predicate()];
+ uint32_t opt = armShiftOpToLdStOptMap[size_t(m.shiftOp())];
if (opt == 0xFF)
goto InvalidAddress;
@@ -2698,7 +2802,7 @@ Case_BaseLdurStur:
// hD, vS.{4|8}h (16-bit)
// sD, vS.4s (32-bit)
uint32_t sz = diff(o0.as<Reg>().type(), RegType::kARM_VecH);
- uint32_t elementSz = o1.as<Vec>().elementType() - Vec::kElementTypeH;
+ uint32_t elementSz = diff(o1.as<Vec>().elementType(), VecElementType::kH);
// Size greater than 1 means 64-bit elements, not supported.
if ((sz | elementSz) > 1 || sz != elementSz)
@@ -2820,7 +2924,7 @@ Case_BaseLdurStur:
if (q > 1)
goto InvalidInstruction;
- uint32_t sz = o0.as<Vec>().elementType() - Vec::kElementTypeB;
+ uint32_t sz = diff(o0.as<Vec>().elementType(), VecElementType::kB);
if (sz == 0 || sz > 3)
goto InvalidInstruction;
@@ -2912,7 +3016,7 @@ Case_BaseLdurStur:
if (q > 1)
goto InvalidInstruction;
- uint32_t sz = o0.as<Vec>().elementType() - Vec::kElementTypeB;
+ uint32_t sz = diff(o0.as<Vec>().elementType(), VecElementType::kB);
if (sz == 0 || sz > 3)
goto InvalidInstruction;
@@ -3094,11 +3198,11 @@ Case_BaseLdurStur:
if (uint32_t(opcode.hasQ()) != q)
goto InvalidInstruction;
- if (rL.isVecS4() && rN.elementType() == Vec::kElementTypeH && !opData.isCvtxn()) {
+ if (rL.isVecS4() && rN.elementType() == VecElementType::kH && !opData.isCvtxn()) {
goto EmitOp_Rd0_Rn5;
}
- if (rL.isVecD2() && rN.elementType() == Vec::kElementTypeS) {
+ if (rL.isVecD2() && rN.elementType() == VecElementType::kS) {
opcode |= B(22);
goto EmitOp_Rd0_Rn5;
}
@@ -3209,8 +3313,8 @@ Case_BaseLdurStur:
}
if (uint32_t(o0.as<Reg>().type()) != uint32_t(o1.as<Reg>().type()) + qIsOptional ||
- o0.as<Vec>().elementType() != opData.tA ||
- o1.as<Vec>().elementType() != opData.tB)
+ uint32_t(o0.as<Vec>().elementType()) != opData.tA ||
+ uint32_t(o1.as<Vec>().elementType()) != opData.tB)
goto InvalidInstruction;
if (!o2.as<Vec>().hasElementIndex()) {
@@ -3222,7 +3326,7 @@ Case_BaseLdurStur:
goto EmitOp_Rd0_Rn5_Rm16;
}
else {
- if (o2.as<Vec>().elementType() != opData.tElement)
+ if (uint32_t(o2.as<Vec>().elementType()) != opData.tElement)
goto InvalidInstruction;
if (o2.as<Reg>().id() > 15)
@@ -3372,7 +3476,7 @@ Case_BaseLdurStur:
}
else {
uint32_t q = diff(o0.as<Vec>().type(), RegType::kARM_VecD);
- uint32_t sz = o0.as<Vec>().elementType() - Vec::kElementTypeH;
+ uint32_t sz = diff(o0.as<Vec>().elementType(), VecElementType::kH);
if (q > 1 || sz > 2)
goto InvalidInstruction;
@@ -3426,7 +3530,7 @@ Case_BaseLdurStur:
if (q > 1)
goto InvalidInstruction;
- uint32_t sz = o0.as<Vec>().elementType() - Vec::kElementTypeH;
+ uint32_t sz = diff(o0.as<Vec>().elementType(), VecElementType::kH);
if (sz > 2)
goto InvalidInstruction;
@@ -3450,7 +3554,7 @@ Case_BaseLdurStur:
if (isign4 == ENC_OPS2(Reg, Reg)) {
// The first destination operand is scalar, which matches element-type of source vectors.
uint32_t L = (instFlags & InstDB::kInstFlagLong) != 0;
- if (diff(o0.as<Vec>().type(), RegType::kARM_VecB) != o1.as<Vec>().elementType() - Vec::kElementTypeB + L)
+ if (diff(o0.as<Vec>().type(), RegType::kARM_VecB) != diff(o1.as<Vec>().elementType(), VecElementType::kB) + L)
goto InvalidInstruction;
SizeOp sizeOp = armElementTypeToSizeOp(opData.vecOpType, o1.as<Reg>().type(), o1.as<Vec>().elementType());
@@ -3550,7 +3654,7 @@ Case_BaseLdurStur:
if (!sizeOp.isValid())
goto InvalidInstruction;
- if (!checkSignature(o0, o1) || !o0.as<Reg>().isVecV() || o0.as<Vec>().elementType() != o2.as<Vec>().elementType() + 1)
+ if (!checkSignature(o0, o1) || !o0.as<Reg>().isVecV() || uint32_t(o0.as<Vec>().elementType()) != uint32_t(o2.as<Vec>().elementType()) + 1u)
goto InvalidInstruction;
opcode.reset(opData.opcode());
@@ -3753,7 +3857,7 @@ Case_BaseLdurStur:
goto InvalidImmediate;
}
else if (imm) {
- shift = Support::ctz(imm) & 0x7u;
+ shift = Support::ctz(imm) & ~0x7u;
imm >>= shift;
if (imm > 0xFFu || shift > maxShift)
@@ -3835,9 +3939,9 @@ Case_BaseLdurStur:
if (o0.as<Reg>().type() != o1.as<Reg>().type() || o1.as<Reg>().type() != o2.as<Reg>().type())
goto InvalidInstruction;
- if (o0.as<Vec>().elementType() != opData.tA ||
- o1.as<Vec>().elementType() != opData.tB ||
- o2.as<Vec>().elementType() != opData.tB)
+ if (uint32_t(o0.as<Vec>().elementType()) != opData.tA ||
+ uint32_t(o1.as<Vec>().elementType()) != opData.tB ||
+ uint32_t(o2.as<Vec>().elementType()) != opData.tB)
goto InvalidInstruction;
opcode.reset(uint32_t(opData.vectorOp) << 10);
@@ -3851,9 +3955,9 @@ Case_BaseLdurStur:
if (o0.as<Reg>().type() != o1.as<Reg>().type() || !o2.as<Reg>().isVecV())
goto InvalidInstruction;
- if (o0.as<Vec>().elementType() != opData.tA ||
- o1.as<Vec>().elementType() != opData.tB ||
- o2.as<Vec>().elementType() != opData.tElement)
+ if (uint32_t(o0.as<Vec>().elementType()) != opData.tA ||
+ uint32_t(o1.as<Vec>().elementType()) != opData.tB ||
+ uint32_t(o2.as<Vec>().elementType()) != opData.tElement)
goto InvalidInstruction;
uint32_t elementIndex = o2.as<Vec>().elementIndex();
@@ -3879,13 +3983,13 @@ Case_BaseLdurStur:
case InstDB::kEncodingSimdDup: SimdDup: {
if (isign4 == ENC_OPS2(Reg, Reg)) {
// Truth table of valid encodings of `Q:1|ElementType:3`
- uint32_t kValidEncodings = B(Vec::kElementTypeB + 0) |
- B(Vec::kElementTypeH + 0) |
- B(Vec::kElementTypeS + 0) |
- B(Vec::kElementTypeB + 8) |
- B(Vec::kElementTypeH + 8) |
- B(Vec::kElementTypeS + 8) |
- B(Vec::kElementTypeD + 8) ;
+ uint32_t kValidEncodings = B(uint32_t(VecElementType::kB) + 0) |
+ B(uint32_t(VecElementType::kH) + 0) |
+ B(uint32_t(VecElementType::kS) + 0) |
+ B(uint32_t(VecElementType::kB) + 8) |
+ B(uint32_t(VecElementType::kH) + 8) |
+ B(uint32_t(VecElementType::kS) + 8) |
+ B(uint32_t(VecElementType::kD) + 8) ;
uint32_t q = diff(o0.as<Reg>().type(), RegType::kARM_VecD);
@@ -3894,7 +3998,7 @@ Case_BaseLdurStur:
//
// NOTE: This is only scalar for `dup d, x` case, otherwise the value
// would be duplicated across all vector elements (1, 2, 4, 8, or 16).
- uint32_t elementType = o0.as<Vec>().elementType();
+ uint32_t elementType = uint32_t(o0.as<Vec>().elementType());
if (q > 1 || !Support::bitTest(kValidEncodings, (q << 3) | elementType))
goto InvalidInstruction;
@@ -3915,7 +4019,7 @@ Case_BaseLdurStur:
// DUP - Vec (scalar) <- Vec[N].
uint32_t lsbIndex = diff(o0.as<Reg>().type(), RegType::kARM_VecB);
- if (lsbIndex != o1.as<Vec>().elementType() - Vec::kElementTypeB || lsbIndex > 3)
+ if (lsbIndex != diff(o1.as<Vec>().elementType(), VecElementType::kB) || lsbIndex > 3)
goto InvalidInstruction;
uint32_t imm5 = ((dstIndex << 1) | 1u) << lsbIndex;
@@ -3928,7 +4032,7 @@ Case_BaseLdurStur:
}
else {
// DUP - Vec (all) <- Vec[N].
- uint32_t elementType = o0.as<Vec>().elementType();
+ uint32_t elementType = uint32_t(o0.as<Vec>().elementType());
if (q > 1 || !Support::bitTest(kValidEncodings, (q << 3) | elementType))
goto InvalidInstruction;
@@ -3953,7 +4057,7 @@ Case_BaseLdurStur:
if (!o0.as<Vec>().hasElementIndex())
goto InvalidInstruction;
- uint32_t elementType = o0.as<Vec>().elementType();
+ uint32_t elementType = uint32_t(o0.as<Vec>().elementType());
uint32_t dstIndex = o0.as<Vec>().elementIndex();
uint32_t lsbIndex = elementType - 1u;
@@ -4056,7 +4160,7 @@ Case_BaseLdurStur:
goto InvalidImmediate;
if (Utils::isByteMaskImm8(imm64)) {
- imm8 = encodeImm64ByteMaskToImm8(imm64);
+ imm8 = Utils::encodeImm64ByteMaskToImm8(imm64);
}
else {
// Change from D to S and from 64-bit imm to 32-bit imm if this
@@ -4122,7 +4226,6 @@ Case_BaseLdurStur:
if (inverted) {
imm8 = ~imm8 & 0xFFu;
- inverted = 0;
}
cmode = B(3) | B(2) | B(1);
@@ -4155,7 +4258,6 @@ Case_BaseLdurStur:
case 3:
if (inverted) {
imm8 = ~imm8 & 0xFFu;
- inverted = 0;
}
op = 1;
@@ -4443,7 +4545,7 @@ Case_BaseLdurStur:
if (m.hasBaseReg()) {
// [Base {Offset | Index}]
if (m.hasIndex()) {
- uint32_t opt = armShiftOpToLdStOptMap[m.predicate()];
+ uint32_t opt = armShiftOpToLdStOptMap[size_t(m.shiftOp())];
if (opt == 0xFFu)
goto InvalidAddress;
@@ -4667,7 +4769,7 @@ Case_SimdLdurStur:
uint32_t q = 0;
uint32_t rm = 0;
uint32_t rn = m.baseId();
- uint32_t sz = v.elementType() - Vec::kElementTypeB;
+ uint32_t sz = diff(v.elementType(), VecElementType::kB);
uint32_t opcSsize = sz;
uint32_t offsetPossibility = 0;
@@ -4997,9 +5099,7 @@ EmitDone:
#endif
}
- resetExtraReg();
- resetInstOptions();
- resetInlineComment();
+ resetState();
writer.done(this);
return kErrorOk;
@@ -5025,9 +5125,7 @@ Failed:
#ifndef ASMJIT_NO_LOGGING
return EmitterUtils::logInstructionFailed(this, err, instId, options, o0, o1, o2, opExt);
#else
- resetExtraReg();
- resetInstOptions();
- resetInlineComment();
+ resetState();
return reportError(err);
#endif
}
@@ -5103,6 +5201,10 @@ Error Assembler::align(AlignMode alignMode, uint32_t alignment) {
Error Assembler::onAttach(CodeHolder* code) noexcept {
ASMJIT_PROPAGATE(Base::onAttach(code));
+
+ _instructionAlignment = uint8_t(4);
+ assignEmitterFuncs(this);
+
return kErrorOk;
}
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64assembler.h b/3rdparty/asmjit/src/asmjit/arm/a64assembler.h
index f1ac72b8d56..319321576d8 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64assembler.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64assembler.h
@@ -23,22 +23,11 @@ class ASMJIT_VIRTAPI Assembler
public:
typedef BaseAssembler Base;
- //! \name Construction / Destruction
+ //! \name Construction & Destruction
//! \{
ASMJIT_API Assembler(CodeHolder* code = nullptr) noexcept;
- ASMJIT_API virtual ~Assembler() noexcept;
-
- //! \}
-
- //! \name Accessors
- //! \{
-
- //! Gets whether the current ARM mode is THUMB (alternative to 32-bit ARM encoding).
- inline bool isInThumbMode() const noexcept { return _environment.isArchThumb(); }
-
- //! Gets the current code alignment of the current mode (ARM vs THUMB).
- inline uint32_t codeAlignment() const noexcept { return isInThumbMode() ? 2 : 4; }
+ ASMJIT_API ~Assembler() noexcept override;
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64builder.cpp b/3rdparty/asmjit/src/asmjit/arm/a64builder.cpp
index 3a52b2a578c..d29b0a498b9 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64builder.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64builder.cpp
@@ -17,8 +17,6 @@ ASMJIT_BEGIN_SUB_NAMESPACE(a64)
Builder::Builder(CodeHolder* code) noexcept : BaseBuilder() {
_archMask = uint64_t(1) << uint32_t(Arch::kAArch64);
- assignEmitterFuncs(this);
-
if (code)
code->attach(this);
}
@@ -28,13 +26,19 @@ Builder::~Builder() noexcept {}
// =====================
Error Builder::onAttach(CodeHolder* code) noexcept {
- return Base::onAttach(code);
+ ASMJIT_PROPAGATE(Base::onAttach(code));
+
+ _instructionAlignment = uint8_t(4);
+ assignEmitterFuncs(this);
+
+ return kErrorOk;
}
Error Builder::onDetach(CodeHolder* code) noexcept {
return Base::onDetach(code);
}
+
// a64::Builder - Finalize
// =======================
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64builder.h b/3rdparty/asmjit/src/asmjit/arm/a64builder.h
index adc99aafc8c..cab1083172b 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64builder.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64builder.h
@@ -29,7 +29,7 @@ public:
//! \{
ASMJIT_API explicit Builder(CodeHolder* code = nullptr) noexcept;
- ASMJIT_API virtual ~Builder() noexcept;
+ ASMJIT_API ~Builder() noexcept override;
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64compiler.cpp b/3rdparty/asmjit/src/asmjit/arm/a64compiler.cpp
index d6c4ed28ff2..765fd4b9dee 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64compiler.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64compiler.cpp
@@ -18,8 +18,6 @@ ASMJIT_BEGIN_SUB_NAMESPACE(a64)
Compiler::Compiler(CodeHolder* code) noexcept : BaseCompiler() {
_archMask = uint64_t(1) << uint32_t(Arch::kAArch64);
- assignEmitterFuncs(this);
-
if (code)
code->attach(this);
}
@@ -37,6 +35,9 @@ Error Compiler::onAttach(CodeHolder* code) noexcept {
return err;
}
+ _instructionAlignment = uint8_t(4);
+ assignEmitterFuncs(this);
+
return kErrorOk;
}
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64compiler.h b/3rdparty/asmjit/src/asmjit/arm/a64compiler.h
index bed408a98fd..64f82f62538 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64compiler.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64compiler.h
@@ -3,8 +3,8 @@
// See asmjit.h or LICENSE.md for license and copyright information
// SPDX-License-Identifier: Zlib
-#ifndef ASMJIT_ARM_ARMCOMPILER_H_INCLUDED
-#define ASMJIT_ARM_ARMCOMPILER_H_INCLUDED
+#ifndef ASMJIT_ARM_A64COMPILER_H_INCLUDED
+#define ASMJIT_ARM_A64COMPILER_H_INCLUDED
#include "../core/api-config.h"
#ifndef ASMJIT_NO_COMPILER
@@ -30,7 +30,7 @@ public:
//! \{
ASMJIT_API explicit Compiler(CodeHolder* code = nullptr) noexcept;
- ASMJIT_API virtual ~Compiler() noexcept;
+ ASMJIT_API ~Compiler() noexcept override;
//! \}
@@ -39,74 +39,81 @@ public:
//! \cond INTERNAL
template<typename RegT, typename Type>
- inline RegT _newRegInternal(const Type& type) {
+ ASMJIT_INLINE_NODEBUG RegT _newRegInternal(const Type& type) {
RegT reg(Globals::NoInit);
_newReg(&reg, type, nullptr);
return reg;
}
- template<typename RegT, typename Type, typename... Args>
- inline RegT _newRegInternal(const Type& type, const char* s, Args&&... args) {
+ template<typename RegT, typename Type>
+ ASMJIT_INLINE_NODEBUG RegT _newRegInternal(const Type& type, const char* s) {
#ifndef ASMJIT_NO_LOGGING
RegT reg(Globals::NoInit);
- if (sizeof...(Args) == 0)
- _newReg(&reg, type, s);
- else
- _newRegFmt(&reg, type, s, std::forward<Args>(args)...);
+ _newReg(&reg, type, s);
return reg;
#else
- DebugUtils::unused(std::forward<Args>(args)...);
+ DebugUtils::unused(s);
+ return _newRegInternal<RegT>(type);
+#endif
+ }
+
+ template<typename RegT, typename Type, typename... Args>
+ ASMJIT_INLINE_NODEBUG RegT _newRegInternal(const Type& type, const char* s, Args&&... args) {
+#ifndef ASMJIT_NO_LOGGING
RegT reg(Globals::NoInit);
- _newReg(&reg, type, nullptr);
+ _newRegFmt(&reg, type, s, std::forward<Args>(args)...);
return reg;
+#else
+ DebugUtils::unused(s, std::forward<Args>(args)...);
+ return _newRegInternal<RegT>(type);
#endif
}
//! \endcond
template<typename RegT, typename... Args>
- inline RegT newSimilarReg(const RegT& ref, Args&&... args) {
+ ASMJIT_INLINE_NODEBUG RegT newSimilarReg(const RegT& ref, Args&&... args) {
return _newRegInternal<RegT>(ref, std::forward<Args>(args)...);
}
template<typename... Args>
- inline Reg newReg(TypeId typeId, Args&&... args) { return _newRegInternal<Reg>(typeId, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Reg newReg(TypeId typeId, Args&&... args) { return _newRegInternal<Reg>(typeId, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newGp(TypeId typeId, Args&&... args) { return _newRegInternal<Gp>(typeId, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newGp(TypeId typeId, Args&&... args) { return _newRegInternal<Gp>(typeId, std::forward<Args>(args)...); }
template<typename... Args>
- inline Vec newVec(TypeId typeId, Args&&... args) { return _newRegInternal<Vec>(typeId, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Vec newVec(TypeId typeId, Args&&... args) { return _newRegInternal<Vec>(typeId, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newInt32(Args&&... args) { return _newRegInternal<Gp>(TypeId::kInt32, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newInt32(Args&&... args) { return _newRegInternal<Gp>(TypeId::kInt32, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newUInt32(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUInt32, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newUInt32(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUInt32, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newInt64(Args&&... args) { return _newRegInternal<Gp>(TypeId::kInt64, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newInt64(Args&&... args) { return _newRegInternal<Gp>(TypeId::kInt64, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newUInt64(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUInt64, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newUInt64(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUInt64, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newIntPtr(Args&&... args) { return _newRegInternal<Gp>(TypeId::kIntPtr, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newIntPtr(Args&&... args) { return _newRegInternal<Gp>(TypeId::kIntPtr, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newUIntPtr(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUIntPtr, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newUIntPtr(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUIntPtr, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newGpw(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUInt32, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newGpw(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUInt32, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newGpx(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUInt64, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newGpx(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUInt64, std::forward<Args>(args)...); }
template<typename... Args>
- inline Gp newGpz(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUIntPtr, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Gp newGpz(Args&&... args) { return _newRegInternal<Gp>(TypeId::kUIntPtr, std::forward<Args>(args)...); }
template<typename... Args>
- inline Vec newVecS(Args&&... args) { return _newRegInternal<Vec>(TypeId::kFloat32, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Vec newVecS(Args&&... args) { return _newRegInternal<Vec>(TypeId::kFloat32, std::forward<Args>(args)...); }
template<typename... Args>
- inline Vec newVecD(Args&&... args) { return _newRegInternal<Vec>(TypeId::kFloat64, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Vec newVecD(Args&&... args) { return _newRegInternal<Vec>(TypeId::kFloat64, std::forward<Args>(args)...); }
template<typename... Args>
- inline Vec newVecQ(Args&&... args) { return _newRegInternal<Vec>(TypeId::kUInt8x16, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG Vec newVecQ(Args&&... args) { return _newRegInternal<Vec>(TypeId::kUInt8x16, std::forward<Args>(args)...); }
//! \}
@@ -114,7 +121,7 @@ public:
//! \{
//! Creates a new memory chunk allocated on the current function's stack.
- inline Mem newStack(uint32_t size, uint32_t alignment, const char* name = nullptr) {
+ ASMJIT_INLINE_NODEBUG Mem newStack(uint32_t size, uint32_t alignment, const char* name = nullptr) {
Mem m(Globals::NoInit);
_newStack(&m, size, alignment, name);
return m;
@@ -126,38 +133,38 @@ public:
//! \{
//! Put data to a constant-pool and get a memory reference to it.
- inline Mem newConst(ConstPoolScope scope, const void* data, size_t size) {
+ ASMJIT_INLINE_NODEBUG Mem newConst(ConstPoolScope scope, const void* data, size_t size) {
Mem m(Globals::NoInit);
_newConst(&m, scope, data, size);
return m;
}
//! Put a BYTE `val` to a constant-pool (8 bits).
- inline Mem newByteConst(ConstPoolScope scope, uint8_t val) noexcept { return newConst(scope, &val, 1); }
+ ASMJIT_INLINE_NODEBUG Mem newByteConst(ConstPoolScope scope, uint8_t val) noexcept { return newConst(scope, &val, 1); }
//! Put a HWORD `val` to a constant-pool (16 bits).
- inline Mem newHWordConst(ConstPoolScope scope, uint16_t val) noexcept { return newConst(scope, &val, 2); }
+ ASMJIT_INLINE_NODEBUG Mem newHWordConst(ConstPoolScope scope, uint16_t val) noexcept { return newConst(scope, &val, 2); }
//! Put a WORD `val` to a constant-pool (32 bits).
- inline Mem newWordConst(ConstPoolScope scope, uint32_t val) noexcept { return newConst(scope, &val, 4); }
+ ASMJIT_INLINE_NODEBUG Mem newWordConst(ConstPoolScope scope, uint32_t val) noexcept { return newConst(scope, &val, 4); }
//! Put a DWORD `val` to a constant-pool (64 bits).
- inline Mem newDWordConst(ConstPoolScope scope, uint64_t val) noexcept { return newConst(scope, &val, 8); }
+ ASMJIT_INLINE_NODEBUG Mem newDWordConst(ConstPoolScope scope, uint64_t val) noexcept { return newConst(scope, &val, 8); }
//! Put a WORD `val` to a constant-pool.
- inline Mem newInt16Const(ConstPoolScope scope, int16_t val) noexcept { return newConst(scope, &val, 2); }
+ ASMJIT_INLINE_NODEBUG Mem newInt16Const(ConstPoolScope scope, int16_t val) noexcept { return newConst(scope, &val, 2); }
//! Put a WORD `val` to a constant-pool.
- inline Mem newUInt16Const(ConstPoolScope scope, uint16_t val) noexcept { return newConst(scope, &val, 2); }
+ ASMJIT_INLINE_NODEBUG Mem newUInt16Const(ConstPoolScope scope, uint16_t val) noexcept { return newConst(scope, &val, 2); }
//! Put a DWORD `val` to a constant-pool.
- inline Mem newInt32Const(ConstPoolScope scope, int32_t val) noexcept { return newConst(scope, &val, 4); }
+ ASMJIT_INLINE_NODEBUG Mem newInt32Const(ConstPoolScope scope, int32_t val) noexcept { return newConst(scope, &val, 4); }
//! Put a DWORD `val` to a constant-pool.
- inline Mem newUInt32Const(ConstPoolScope scope, uint32_t val) noexcept { return newConst(scope, &val, 4); }
+ ASMJIT_INLINE_NODEBUG Mem newUInt32Const(ConstPoolScope scope, uint32_t val) noexcept { return newConst(scope, &val, 4); }
//! Put a QWORD `val` to a constant-pool.
- inline Mem newInt64Const(ConstPoolScope scope, int64_t val) noexcept { return newConst(scope, &val, 8); }
+ ASMJIT_INLINE_NODEBUG Mem newInt64Const(ConstPoolScope scope, int64_t val) noexcept { return newConst(scope, &val, 8); }
//! Put a QWORD `val` to a constant-pool.
- inline Mem newUInt64Const(ConstPoolScope scope, uint64_t val) noexcept { return newConst(scope, &val, 8); }
+ ASMJIT_INLINE_NODEBUG Mem newUInt64Const(ConstPoolScope scope, uint64_t val) noexcept { return newConst(scope, &val, 8); }
//! Put a SP-FP `val` to a constant-pool.
- inline Mem newFloatConst(ConstPoolScope scope, float val) noexcept { return newConst(scope, &val, 4); }
+ ASMJIT_INLINE_NODEBUG Mem newFloatConst(ConstPoolScope scope, float val) noexcept { return newConst(scope, &val, 4); }
//! Put a DP-FP `val` to a constant-pool.
- inline Mem newDoubleConst(ConstPoolScope scope, double val) noexcept { return newConst(scope, &val, 8); }
+ ASMJIT_INLINE_NODEBUG Mem newDoubleConst(ConstPoolScope scope, double val) noexcept { return newConst(scope, &val, 8); }
//! \}
@@ -165,7 +172,7 @@ public:
//! \{
//! Force the compiler to not follow the conditional or unconditional jump.
- inline Compiler& unfollow() noexcept { _instOptions |= InstOptions::kUnfollow; return *this; }
+ ASMJIT_INLINE_NODEBUG Compiler& unfollow() noexcept { _instOptions |= InstOptions::kUnfollow; return *this; }
//! \}
@@ -177,7 +184,7 @@ public:
//! \note At the moment this instruction is only useful to load a stack allocated address into a GP register
//! for further use. It makes very little sense to use it for anything else. The semantics of this instruction
//! is the same as X86 `LEA` (load effective address) instruction.
- inline Error loadAddressOf(const Gp& o0, const Mem& o1) { return _emitter()->_emitI(Inst::kIdAdr, o0, o1); }
+ ASMJIT_INLINE_NODEBUG Error loadAddressOf(const Gp& o0, const Mem& o1) { return _emitter()->_emitI(Inst::kIdAdr, o0, o1); }
//! \}
@@ -185,7 +192,7 @@ public:
//! \{
//! Invoke a function call without `target` type enforcement.
- inline Error invoke_(InvokeNode** out, const Operand_& target, const FuncSignature& signature) {
+ ASMJIT_INLINE_NODEBUG Error invoke_(InvokeNode** out, const Operand_& target, const FuncSignature& signature) {
return addInvokeNode(out, Inst::kIdBlr, target, signature);
}
@@ -194,22 +201,22 @@ public:
//! Creates a new \ref InvokeNode, initializes all the necessary members to match the given function `signature`,
//! adds the node to the compiler, and stores its pointer to `out`. The operation is atomic, if anything fails
//! nullptr is stored in `out` and error code is returned.
- inline Error invoke(InvokeNode** out, const Gp& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, const Gp& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
//! \overload
- inline Error invoke(InvokeNode** out, const Mem& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, const Mem& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
//! \overload
- inline Error invoke(InvokeNode** out, const Label& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, const Label& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
//! \overload
- inline Error invoke(InvokeNode** out, const Imm& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, const Imm& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
//! \overload
- inline Error invoke(InvokeNode** out, uint64_t target, const FuncSignature& signature) { return invoke_(out, Imm(int64_t(target)), signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, uint64_t target, const FuncSignature& signature) { return invoke_(out, Imm(int64_t(target)), signature); }
//! Return.
- inline Error ret() { return addRet(Operand(), Operand()); }
+ ASMJIT_INLINE_NODEBUG Error ret() { return addRet(Operand(), Operand()); }
//! \overload
- inline Error ret(const BaseReg& o0) { return addRet(o0, Operand()); }
+ ASMJIT_INLINE_NODEBUG Error ret(const BaseReg& o0) { return addRet(o0, Operand()); }
//! \overload
- inline Error ret(const BaseReg& o0, const BaseReg& o1) { return addRet(o0, o1); }
+ ASMJIT_INLINE_NODEBUG Error ret(const BaseReg& o0, const BaseReg& o1) { return addRet(o0, o1); }
//! \}
@@ -219,7 +226,7 @@ public:
using EmitterExplicitT<Compiler>::br;
//! Adds a jump to the given `target` with the provided jump `annotation`.
- inline Error br(const BaseReg& target, JumpAnnotation* annotation) { return emitAnnotatedJump(Inst::kIdBr, target, annotation); }
+ ASMJIT_INLINE_NODEBUG Error br(const BaseReg& target, JumpAnnotation* annotation) { return emitAnnotatedJump(Inst::kIdBr, target, annotation); }
//! \}
@@ -244,4 +251,4 @@ public:
ASMJIT_END_SUB_NAMESPACE
#endif // !ASMJIT_NO_COMPILER
-#endif // ASMJIT_ARM_ARMCOMPILER_H_INCLUDED
+#endif // ASMJIT_ARM_A64COMPILER_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64emithelper.cpp b/3rdparty/asmjit/src/asmjit/arm/a64emithelper.cpp
index 1e8da619a6b..0cf098250a3 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64emithelper.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64emithelper.cpp
@@ -169,7 +169,7 @@ Error EmitHelper::emitArgMove(
if (TypeUtils::isInt(dstTypeId)) {
if (TypeUtils::isInt(srcTypeId)) {
- uint32_t x = dstSize == 8;
+ uint32_t x = uint32_t(dstSize == 8);
dst.setSignature(OperandSignature{x ? uint32_t(GpX::kSignature) : uint32_t(GpW::kSignature)});
_emitter->setInlineComment(comment);
@@ -186,7 +186,7 @@ Error EmitHelper::emitArgMove(
case TypeId::kInt16: instId = Inst::kIdLdrsh; break;
case TypeId::kUInt16: instId = Inst::kIdLdrh; break;
case TypeId::kInt32: instId = x ? Inst::kIdLdrsw : Inst::kIdLdr; break;
- case TypeId::kUInt32: instId = Inst::kIdLdr; x = 0; break;
+ case TypeId::kUInt32: instId = Inst::kIdLdr; break;
case TypeId::kInt64: instId = Inst::kIdLdr; break;
case TypeId::kUInt64: instId = Inst::kIdLdr; break;
default:
@@ -312,6 +312,12 @@ ASMJIT_FAVOR_SIZE Error EmitHelper::emitProlog(const FuncFrame& frame) {
{ Inst::kIdStr_v, Inst::kIdStp_v }
}};
+ // Emit: 'bti' (indirect branch protection).
+ if (frame.hasIndirectBranchProtection()) {
+ // TODO: The instruction is not available at the moment (would be ABI break).
+ // ASMJIT_PROPAGATE(emitter->bti());
+ }
+
uint32_t adjustInitialOffset = pei.sizeTotal;
for (RegGroup group : Support::EnumValues<RegGroup, RegGroup::kGp, RegGroup::kVec>{}) {
@@ -339,7 +345,7 @@ ASMJIT_FAVOR_SIZE Error EmitHelper::emitProlog(const FuncFrame& frame) {
else
ASMJIT_PROPAGATE(emitter->emit(insts.pairInstId, regs[0], regs[1], mem));
- mem.resetToFixedOffset();
+ mem.resetOffsetMode();
if (i == 0 && frame.hasPreservedFP()) {
ASMJIT_PROPAGATE(emitter->mov(x29, sp));
@@ -421,7 +427,7 @@ ASMJIT_FAVOR_SIZE Error EmitHelper::emitEpilog(const FuncFrame& frame) {
else
ASMJIT_PROPAGATE(emitter->emit(insts.pairInstId, regs[0], regs[1], mem));
- mem.resetToFixedOffset();
+ mem.resetOffsetMode();
}
}
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64emithelper_p.h b/3rdparty/asmjit/src/asmjit/arm/a64emithelper_p.h
index b1ba1a92960..6e10f9eaabe 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64emithelper_p.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64emithelper_p.h
@@ -3,8 +3,8 @@
// See asmjit.h or LICENSE.md for license and copyright information
// SPDX-License-Identifier: Zlib
-#ifndef ASMJIT_ARM_ARMEMITHELPER_P_H_INCLUDED
-#define ASMJIT_ARM_ARMEMITHELPER_P_H_INCLUDED
+#ifndef ASMJIT_ARM_A64EMITHELPER_P_H_INCLUDED
+#define ASMJIT_ARM_A64EMITHELPER_P_H_INCLUDED
#include "../core/api-config.h"
@@ -21,7 +21,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(a64)
class EmitHelper : public BaseEmitHelper {
public:
- inline explicit EmitHelper(BaseEmitter* emitter = nullptr) noexcept
+ ASMJIT_INLINE_NODEBUG explicit EmitHelper(BaseEmitter* emitter = nullptr) noexcept
: BaseEmitHelper(emitter) {}
Error emitRegMove(
@@ -47,4 +47,4 @@ void assignEmitterFuncs(BaseEmitter* emitter);
ASMJIT_END_SUB_NAMESPACE
-#endif // ASMJIT_ARM_ARMEMITHELPER_P_H_INCLUDED
+#endif // ASMJIT_ARM_A64EMITHELPER_P_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64emitter.h b/3rdparty/asmjit/src/asmjit/arm/a64emitter.h
index 54354eaca84..15c91e0ba4a 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64emitter.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64emitter.h
@@ -11,6 +11,14 @@
#include "../arm/a64instdb.h"
#include "../arm/a64operand.h"
+// MSVC targeting AArch64 defines a lot of macros without underscores clashing
+// with AArch64 instruction names. We have to workaround until it's fixed in SDK.
+#if defined(_MSC_VER) && defined(mvn)
+ #define ASMJIT_RESTORE_MSVC_AARCH64_MACROS
+ #pragma push_macro("mvn")
+ #undef mvn
+#endif
+
ASMJIT_BEGIN_SUB_NAMESPACE(a64)
#define ASMJIT_INST_0x(NAME, ID) \
@@ -63,7 +71,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(a64)
//! ARM emitter.
//!
//! NOTE: This class cannot be instantiated, you can only cast to it and use it as emitter that emits to either
-//! \ref Assembler, \ref Builder, or \ref Compiler (use withcaution with \ref Compiler as it expects virtual
+//! \ref Assembler, \ref Builder, or \ref Compiler (use with caution with \ref Compiler as it expects virtual
//! registers to be used).
template<typename This>
struct EmitterExplicitT {
@@ -71,22 +79,22 @@ struct EmitterExplicitT {
// These two are unfortunately reported by the sanitizer. We know what we do, however, the sanitizer doesn't.
// I have tried to use reinterpret_cast instead, but that would generate bad code when compiled by MSC.
- ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF inline This* _emitter() noexcept { return static_cast<This*>(this); }
- ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF inline const This* _emitter() const noexcept { return static_cast<const This*>(this); }
+ ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF ASMJIT_INLINE_NODEBUG This* _emitter() noexcept { return static_cast<This*>(this); }
+ ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF ASMJIT_INLINE_NODEBUG const This* _emitter() const noexcept { return static_cast<const This*>(this); }
//! \endcond
- // --------------------------------------------------------------------------
- // [Options]
- // --------------------------------------------------------------------------
-protected:
- inline This& _addInstOptions(InstOptions options) noexcept {
- static_cast<This*>(this)->addInstOptions(options);
- return *static_cast<This*>(this);
- }
+ //! \name Native Registers
+ //! \{
+
+ //! Returns either 32-bit or 64-bit GP register of the given `id` depending on the emitter's architecture.
+ inline Gp gpz(uint32_t id) const noexcept { return Gp(_emitter()->_gpSignature, id); }
+ //! Clones the given `reg` to either 32-bit or 64-bit GP register depending on the emitter's architecture.
+ inline Gp gpz(const Gp& reg) const noexcept { return Gp(_emitter()->_gpSignature, reg.id()); }
+
+ //! \}
-public:
//! \name General Purpose Instructions
//! \{
@@ -517,6 +525,8 @@ public:
ASMJIT_INST_2x(ldxrb, Ldxrb, Gp, Mem)
ASMJIT_INST_2x(ldxrh, Ldxrh, Gp, Mem)
+ ASMJIT_INST_2x(prfm, Prfm, Imm, Mem)
+
ASMJIT_INST_2x(stadd, Stadd, Gp, Mem)
ASMJIT_INST_2x(staddb, Staddb, Gp, Mem)
ASMJIT_INST_2x(staddh, Staddh, Gp, Mem)
@@ -1111,14 +1121,14 @@ public:
//! \}
- //! \name FJCVTZS Instruction (ARMv8.3-A)
+ //! \name JSCVT Instruction (ARMv8.3-A)
//! \{
ASMJIT_INST_2x(fjcvtzs, Fjcvtzs_v, Gp, Vec);
//! \}
- //! \name FP16FML Instructions (ARMv8.4-A, optional in ARMv8.2-A)
+ //! \name FHM Instructions
//! \{
ASMJIT_INST_3x(fmlal, Fmlal_v, Vec, Vec, Vec);
@@ -1225,4 +1235,9 @@ class Emitter : public BaseEmitter, public EmitterExplicitT<Emitter> {
ASMJIT_END_SUB_NAMESPACE
+// Restore undefined MSVC AArch64 macros.
+#if defined(ASMJIT_RESTORE_MSVC_AARCH64_MACROS)
+ #pragma pop_macro("mvn")
+#endif
+
#endif // ASMJIT_ARM_A64EMITTER_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64formatter.cpp b/3rdparty/asmjit/src/asmjit/arm/a64formatter.cpp
index bccb68b99b0..94ef3ee59e9 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64formatter.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64formatter.cpp
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: Zlib
#include "../core/api-build_p.h"
-#ifndef ASMJIT_NO_LOGGING
+#if !defined(ASMJIT_NO_AARCH64) && !defined(ASMJIT_NO_LOGGING)
#include "../core/misc_p.h"
#include "../core/support.h"
@@ -19,243 +19,6 @@
ASMJIT_BEGIN_SUB_NAMESPACE(a64)
-// a64::FormatterInternal - Format Register
-// ========================================
-
-ASMJIT_FAVOR_SIZE Error FormatterInternal::formatRegister(
- String& sb,
- FormatFlags flags,
- const BaseEmitter* emitter,
- Arch arch,
- RegType regType,
- uint32_t rId,
- uint32_t elementType,
- uint32_t elementIndex) noexcept {
-
- DebugUtils::unused(flags);
- DebugUtils::unused(arch);
-
- static const char bhsdq[] = "bhsdq";
-
- bool virtRegFormatted = false;
-
-#ifndef ASMJIT_NO_COMPILER
- if (Operand::isVirtId(rId)) {
- if (emitter && emitter->isCompiler()) {
- const BaseCompiler* cc = static_cast<const BaseCompiler*>(emitter);
- if (cc->isVirtIdValid(rId)) {
- VirtReg* vReg = cc->virtRegById(rId);
- ASMJIT_ASSERT(vReg != nullptr);
-
- const char* name = vReg->name();
- if (name && name[0] != '\0')
- ASMJIT_PROPAGATE(sb.append(name));
- else
- ASMJIT_PROPAGATE(sb.appendFormat("%%%u", unsigned(Operand::virtIdToIndex(rId))));
-
- virtRegFormatted = true;
- }
- }
- }
-#else
- DebugUtils::unused(emitter, flags);
-#endif
-
- if (!virtRegFormatted) {
- char letter = '\0';
- switch (regType) {
- case RegType::kARM_GpW:
- if (rId == Gp::kIdZr)
- return sb.append("wzr");
- if (rId == Gp::kIdSp)
- return sb.append("wsp");
-
- letter = 'w';
- break;
-
- case RegType::kARM_GpX:
- if (rId == Gp::kIdZr)
- return sb.append("xzr");
- if (rId == Gp::kIdSp)
- return sb.append("sp");
-
- letter = 'x';
- break;
-
- case RegType::kARM_VecB:
- case RegType::kARM_VecH:
- case RegType::kARM_VecS:
- case RegType::kARM_VecD:
- case RegType::kARM_VecV:
- letter = bhsdq[uint32_t(regType) - uint32_t(RegType::kARM_VecB)];
- if (elementType)
- letter = 'v';
- break;
-
- default:
- ASMJIT_PROPAGATE(sb.appendFormat("<Reg-%u>?$u", uint32_t(regType), rId));
- break;
- }
-
- if (letter)
- ASMJIT_PROPAGATE(sb.appendFormat("%c%u", letter, rId));
- }
-
- if (elementType) {
- char elementLetter = '\0';
- uint32_t elementCount = 0;
-
- switch (elementType) {
- case Vec::kElementTypeB:
- elementLetter = 'b';
- elementCount = 16;
- break;
-
- case Vec::kElementTypeH:
- elementLetter = 'h';
- elementCount = 8;
- break;
-
- case Vec::kElementTypeS:
- elementLetter = 's';
- elementCount = 4;
- break;
-
- case Vec::kElementTypeD:
- elementLetter = 'd';
- elementCount = 2;
- break;
-
- default:
- return sb.append(".<Unknown>");
- }
-
- if (elementLetter) {
- if (elementIndex == 0xFFFFFFFFu) {
- if (regType == RegType::kARM_VecD)
- elementCount /= 2u;
- ASMJIT_PROPAGATE(sb.appendFormat(".%u%c", elementCount, elementLetter));
- }
- else {
- ASMJIT_PROPAGATE(sb.appendFormat(".%c[%u]", elementLetter, elementIndex));
- }
- }
- }
-
- return kErrorOk;
-}
-
-// a64::FormatterInternal - Format Operand
-// =======================================
-
-ASMJIT_FAVOR_SIZE Error FormatterInternal::formatOperand(
- String& sb,
- FormatFlags flags,
- const BaseEmitter* emitter,
- Arch arch,
- const Operand_& op) noexcept {
-
- if (op.isReg()) {
- const BaseReg& reg = op.as<BaseReg>();
-
- uint32_t elementType = op.as<Vec>().elementType();
- uint32_t elementIndex = op.as<Vec>().elementIndex();
-
- if (!op.as<Vec>().hasElementIndex())
- elementIndex = 0xFFFFFFFFu;
-
- return formatRegister(sb, flags, emitter, arch, reg.type(), reg.id(), elementType, elementIndex);
- }
-
- if (op.isMem()) {
- const Mem& m = op.as<Mem>();
- ASMJIT_PROPAGATE(sb.append('['));
-
- if (m.hasBase()) {
- if (m.hasBaseLabel()) {
- ASMJIT_PROPAGATE(Formatter::formatLabel(sb, flags, emitter, m.baseId()));
- }
- else {
- FormatFlags modifiedFlags = flags;
- if (m.isRegHome()) {
- ASMJIT_PROPAGATE(sb.append('&'));
- modifiedFlags &= ~FormatFlags::kRegCasts;
- }
- ASMJIT_PROPAGATE(formatRegister(sb, modifiedFlags, emitter, arch, m.baseType(), m.baseId()));
- }
- }
- else {
- // ARM really requires base.
- if (m.hasIndex() || m.hasOffset()) {
- ASMJIT_PROPAGATE(sb.append("<None>"));
- }
- }
-
- // The post index makes it look like there was another operand, but it's
- // still the part of AsmJit's `arm::Mem` operand so it's consistent with
- // other architectures.
- if (m.isPostIndex())
- ASMJIT_PROPAGATE(sb.append(']'));
-
- if (m.hasIndex()) {
- ASMJIT_PROPAGATE(sb.append(", "));
- ASMJIT_PROPAGATE(formatRegister(sb, flags, emitter, arch, m.indexType(), m.indexId()));
- }
-
- if (m.hasOffset()) {
- ASMJIT_PROPAGATE(sb.append(", "));
-
- int64_t off = int64_t(m.offset());
- uint32_t base = 10;
-
- if (Support::test(flags, FormatFlags::kHexOffsets) && uint64_t(off) > 9)
- base = 16;
-
- if (base == 10) {
- ASMJIT_PROPAGATE(sb.appendInt(off, base));
- }
- else {
- ASMJIT_PROPAGATE(sb.append("0x"));
- ASMJIT_PROPAGATE(sb.appendUInt(uint64_t(off), base));
- }
- }
-
- if (m.hasShift()) {
- ASMJIT_PROPAGATE(sb.append(' '));
- if (!m.isPreOrPost())
- ASMJIT_PROPAGATE(formatShiftOp(sb, (ShiftOp)m.predicate()));
- ASMJIT_PROPAGATE(sb.appendFormat(" %u", m.shift()));
- }
-
- if (!m.isPostIndex())
- ASMJIT_PROPAGATE(sb.append(']'));
-
- if (m.isPreIndex())
- ASMJIT_PROPAGATE(sb.append('!'));
-
- return kErrorOk;
- }
-
- if (op.isImm()) {
- const Imm& i = op.as<Imm>();
- int64_t val = i.value();
-
- if (Support::test(flags, FormatFlags::kHexImms) && uint64_t(val) > 9) {
- ASMJIT_PROPAGATE(sb.append("0x"));
- return sb.appendUInt(uint64_t(val), 16);
- }
- else {
- return sb.appendInt(val, 10);
- }
- }
-
- if (op.isLabel()) {
- return Formatter::formatLabel(sb, flags, emitter, op.id());
- }
-
- return sb.append("<None>");
-}
-
// a64::FormatterInternal - Format Instruction
// ===========================================
@@ -266,12 +29,10 @@ ASMJIT_FAVOR_SIZE Error FormatterInternal::formatInstruction(
Arch arch,
const BaseInst& inst, const Operand_* operands, size_t opCount) noexcept {
- DebugUtils::unused(arch);
-
// Format instruction options and instruction mnemonic.
InstId instId = inst.realId();
- if (instId < Inst::_kIdCount)
- ASMJIT_PROPAGATE(InstInternal::instIdToString(arch, instId, sb));
+ if (instId != Inst::kIdNone && instId < Inst::_kIdCount)
+ ASMJIT_PROPAGATE(InstInternal::instIdToString(instId, sb));
else
ASMJIT_PROPAGATE(sb.appendFormat("[InstId=#%u]", unsigned(instId)));
@@ -295,4 +56,4 @@ ASMJIT_FAVOR_SIZE Error FormatterInternal::formatInstruction(
ASMJIT_END_SUB_NAMESPACE
-#endif // !ASMJIT_NO_LOGGING
+#endif // !ASMJIT_NO_AARCH64 && !ASMJIT_NO_LOGGING
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64formatter_p.h b/3rdparty/asmjit/src/asmjit/arm/a64formatter_p.h
index bd7a1440cb0..d0adde3ce0d 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64formatter_p.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64formatter_p.h
@@ -24,23 +24,6 @@ namespace FormatterInternal {
using namespace arm::FormatterInternal;
-Error ASMJIT_CDECL formatRegister(
- String& sb,
- FormatFlags flags,
- const BaseEmitter* emitter,
- Arch arch,
- RegType regType,
- uint32_t regId,
- uint32_t elementType = 0,
- uint32_t elementIndex = 0xFFFFFFFFu) noexcept;
-
-Error ASMJIT_CDECL formatOperand(
- String& sb,
- FormatFlags flags,
- const BaseEmitter* emitter,
- Arch arch,
- const Operand_& op) noexcept;
-
Error ASMJIT_CDECL formatInstruction(
String& sb,
FormatFlags flags,
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64func.cpp b/3rdparty/asmjit/src/asmjit/arm/a64func.cpp
index 55e3f2e71ec..a33a2f2d9d7 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64func.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64func.cpp
@@ -13,7 +13,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(a64)
namespace FuncInternal {
-static inline bool shouldThreatAsCDecl(CallConvId ccId) noexcept {
+static inline bool shouldTreatAsCDecl(CallConvId ccId) noexcept {
return ccId == CallConvId::kCDecl ||
ccId == CallConvId::kStdCall ||
ccId == CallConvId::kFastCall ||
@@ -41,18 +41,19 @@ static RegType regTypeFromFpOrVecTypeId(TypeId typeId) noexcept {
ASMJIT_FAVOR_SIZE Error initCallConv(CallConv& cc, CallConvId ccId, const Environment& environment) noexcept {
cc.setArch(environment.arch());
+ cc.setStrategy(environment.isDarwin() ? CallConvStrategy::kAArch64Apple : CallConvStrategy::kDefault);
cc.setSaveRestoreRegSize(RegGroup::kGp, 8);
cc.setSaveRestoreRegSize(RegGroup::kVec, 8);
cc.setSaveRestoreAlignment(RegGroup::kGp, 16);
cc.setSaveRestoreAlignment(RegGroup::kVec, 16);
- cc.setSaveRestoreAlignment(RegGroup::kExtraVirt2, 1);
+ cc.setSaveRestoreAlignment(RegGroup::kMask, 1);
cc.setSaveRestoreAlignment(RegGroup::kExtraVirt3, 1);
cc.setPassedOrder(RegGroup::kGp, 0, 1, 2, 3, 4, 5, 6, 7);
cc.setPassedOrder(RegGroup::kVec, 0, 1, 2, 3, 4, 5, 6, 7);
cc.setNaturalStackAlignment(16);
- if (shouldThreatAsCDecl(ccId)) {
+ if (shouldTreatAsCDecl(ccId)) {
// ARM doesn't have that many calling conventions as we can find in X86 world, treat most conventions as __cdecl.
cc.setId(CallConvId::kCDecl);
cc.setPreservedRegs(RegGroup::kGp, Support::bitMask(Gp::kIdOs, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30));
@@ -68,7 +69,7 @@ ASMJIT_FAVOR_SIZE Error initCallConv(CallConv& cc, CallConvId ccId, const Enviro
return kErrorOk;
}
-ASMJIT_FAVOR_SIZE Error initFuncDetail(FuncDetail& func, const FuncSignature& signature, uint32_t registerSize) noexcept {
+ASMJIT_FAVOR_SIZE Error initFuncDetail(FuncDetail& func, const FuncSignature& signature) noexcept {
DebugUtils::unused(signature);
const CallConv& cc = func.callConv();
@@ -77,6 +78,13 @@ ASMJIT_FAVOR_SIZE Error initFuncDetail(FuncDetail& func, const FuncSignature& si
uint32_t i;
uint32_t argCount = func.argCount();
+ // Minimum stack size of a single argument passed via stack. The standard AArch64 calling convention
+ // specifies 8 bytes, so each function argument would occupy at least 8 bytes even if it needs less.
+ // However, Apple has decided to not follow this rule and function argument can occupy less, for
+ // example two consecutive 32-bit arguments would occupy 8 bytes total, instead of 16 as specified
+ // by ARM.
+ uint32_t minStackArgSize = cc.strategy() == CallConvStrategy::kAArch64Apple ? 4u : 8u;
+
if (func.hasRet()) {
for (uint32_t valueIndex = 0; valueIndex < Globals::kMaxValuePack; valueIndex++) {
TypeId typeId = func._rets[valueIndex].typeId();
@@ -119,7 +127,8 @@ ASMJIT_FAVOR_SIZE Error initFuncDetail(FuncDetail& func, const FuncSignature& si
}
switch (cc.strategy()) {
- case CallConvStrategy::kDefault: {
+ case CallConvStrategy::kDefault:
+ case CallConvStrategy::kAArch64Apple: {
uint32_t gpzPos = 0;
uint32_t vecPos = 0;
@@ -140,7 +149,9 @@ ASMJIT_FAVOR_SIZE Error initFuncDetail(FuncDetail& func, const FuncSignature& si
gpzPos++;
}
else {
- uint32_t size = Support::max<uint32_t>(TypeUtils::sizeOf(typeId), registerSize);
+ uint32_t size = Support::max<uint32_t>(TypeUtils::sizeOf(typeId), minStackArgSize);
+ if (size >= 8)
+ stackOffset = Support::alignUp(stackOffset, 8);
arg.assignStackOffset(int32_t(stackOffset));
stackOffset += size;
}
@@ -164,7 +175,9 @@ ASMJIT_FAVOR_SIZE Error initFuncDetail(FuncDetail& func, const FuncSignature& si
vecPos++;
}
else {
- uint32_t size = TypeUtils::sizeOf(typeId);
+ uint32_t size = Support::max<uint32_t>(TypeUtils::sizeOf(typeId), minStackArgSize);
+ if (size >= 8)
+ stackOffset = Support::alignUp(stackOffset, 8);
arg.assignStackOffset(int32_t(stackOffset));
stackOffset += size;
}
@@ -178,7 +191,7 @@ ASMJIT_FAVOR_SIZE Error initFuncDetail(FuncDetail& func, const FuncSignature& si
return DebugUtils::errored(kErrorInvalidState);
}
- func._argStackSize = stackOffset;
+ func._argStackSize = Support::alignUp(stackOffset, 8u);
return kErrorOk;
}
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64func_p.h b/3rdparty/asmjit/src/asmjit/arm/a64func_p.h
index 9f531fc5a23..7f2221c7059 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64func_p.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64func_p.h
@@ -21,7 +21,7 @@ namespace FuncInternal {
Error initCallConv(CallConv& cc, CallConvId ccId, const Environment& environment) noexcept;
//! Initialize `FuncDetail` (AArch64 specific).
-Error initFuncDetail(FuncDetail& func, const FuncSignature& signature, uint32_t registerSize) noexcept;
+Error initFuncDetail(FuncDetail& func, const FuncSignature& signature) noexcept;
} // {FuncInternal}
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64globals.h b/3rdparty/asmjit/src/asmjit/arm/a64globals.h
index 2b6b6f0ce91..720b6f151ce 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64globals.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64globals.h
@@ -15,16 +15,13 @@
ASMJIT_BEGIN_SUB_NAMESPACE(a64)
-// a64 uses everything from arm namespace and adds into it.
-using namespace arm;
-
//! \addtogroup asmjit_a64
//! \{
//! AArch64 instruction.
//!
//! \note Only used to hold ARM-specific enumerations and static functions.
-struct Inst {
+namespace Inst {
//! Instruction id.
enum Id : uint32_t {
// ${InstId:Begin}
@@ -293,6 +290,7 @@ struct Inst {
kIdPacdza, //!< Instruction 'pacdza'.
kIdPacdzb, //!< Instruction 'pacdzb'.
kIdPacga, //!< Instruction 'pacga'.
+ kIdPrfm, //!< Instruction 'prfm'.
kIdPssbb, //!< Instruction 'pssbb'.
kIdRbit, //!< Instruction 'rbit'.
kIdRet, //!< Instruction 'ret'.
@@ -797,14 +795,14 @@ struct Inst {
};
//! Tests whether the `instId` is defined (counts also Inst::kIdNone, which must be zero).
- static inline bool isDefinedId(InstId instId) noexcept { return (instId & uint32_t(InstIdParts::kRealId)) < _kIdCount; }
+ static ASMJIT_INLINE_NODEBUG bool isDefinedId(InstId instId) noexcept { return (instId & uint32_t(InstIdParts::kRealId)) < _kIdCount; }
};
namespace Predicate {
//! Address translate options (AT).
namespace AT {
- static inline constexpr uint32_t encode(uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr uint32_t encode(uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
return (op1 << 11) | (cRn << 7) | (cRm << 3) | (op2 << 0);
}
@@ -862,7 +860,7 @@ namespace DB {
//! Data cache maintenance options.
namespace DC {
- static inline constexpr uint32_t encode(uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr uint32_t encode(uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
return (op1 << 11) | (cRn << 7) | (cRm << 3) | (op2 << 0);
}
@@ -901,7 +899,7 @@ namespace DC {
//! Instruction cache maintenance options.
namespace IC {
- static inline constexpr uint32_t encode(uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr uint32_t encode(uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
return (op1 << 11) | (cRn << 7) | (cRm << 3) | (op2 << 0);
}
@@ -955,7 +953,7 @@ namespace PSB {
}
namespace TLBI {
- static inline constexpr uint32_t encode(uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr uint32_t encode(uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
return (op1 << 11) | (cRn << 7) | (cRm << 3) | (op2 << 0);
}
@@ -1054,7 +1052,7 @@ namespace TSB {
//! Processor state access through MSR.
namespace PState {
//! Encodes a pstate from `op0` and `op1`.
- static inline constexpr uint32_t encode(uint32_t op0, uint32_t op1) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr uint32_t encode(uint32_t op0, uint32_t op1) noexcept {
return (op0 << 3) | (op1 << 0);
}
@@ -1083,17 +1081,17 @@ namespace SysReg {
};
//! Encodes a system register from `op0`, `op1`, `cRn`, `cRm`, and `op2` fields.
- static inline constexpr uint32_t encode(uint32_t op0, uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr uint32_t encode(uint32_t op0, uint32_t op1, uint32_t cRn, uint32_t cRm, uint32_t op2) noexcept {
return (op0 << 14) | (op1 << 11) | (cRn << 7) | (cRm << 3) | (op2 << 0);
}
//! Encodes a system register from `fields`.
- static inline constexpr uint32_t encode(const Fields& fields) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr uint32_t encode(const Fields& fields) noexcept {
return encode(fields.op0, fields.op1, fields.cRn, fields.cRm, fields.op2);
}
//! Decodes a system register to \ref Fields.
- static inline constexpr Fields decode(uint32_t id) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr Fields decode(uint32_t id) noexcept {
return Fields {
uint8_t((id >> 14) & 0x3u),
uint8_t((id >> 11) & 0x7u),
@@ -1417,9 +1415,12 @@ namespace SysReg {
kID_AA64DFR1_EL1 = encode(0b11, 0b000, 0b0000, 0b0101, 0b001), // RO
kID_AA64ISAR0_EL1 = encode(0b11, 0b000, 0b0000, 0b0110, 0b000), // RO
kID_AA64ISAR1_EL1 = encode(0b11, 0b000, 0b0000, 0b0110, 0b001), // RO
+ kID_AA64ISAR2_EL1 = encode(0b11, 0b000, 0b0000, 0b0110, 0b010), // RO
kID_AA64MMFR0_EL1 = encode(0b11, 0b000, 0b0000, 0b0111, 0b000), // RO
kID_AA64MMFR1_EL1 = encode(0b11, 0b000, 0b0000, 0b0111, 0b001), // RO
kID_AA64MMFR2_EL1 = encode(0b11, 0b000, 0b0000, 0b0111, 0b010), // RO
+ kID_AA64MMFR3_EL1 = encode(0b11, 0b000, 0b0000, 0b0111, 0b011), // RO
+ kID_AA64MMFR4_EL1 = encode(0b11, 0b000, 0b0000, 0b0111, 0b100), // RO
kID_AA64PFR0_EL1 = encode(0b11, 0b000, 0b0000, 0b0100, 0b000), // RO
kID_AA64PFR1_EL1 = encode(0b11, 0b000, 0b0000, 0b0100, 0b001), // RO
kID_AA64ZFR0_EL1 = encode(0b11, 0b000, 0b0000, 0b0100, 0b100), // RO
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64instapi.cpp b/3rdparty/asmjit/src/asmjit/arm/a64instapi.cpp
index d933d4bd7f7..023be05573e 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64instapi.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64instapi.cpp
@@ -8,71 +8,29 @@
#include "../core/cpuinfo.h"
#include "../core/misc_p.h"
-#include "../core/support.h"
+#include "../core/support_p.h"
#include "../arm/a64instapi_p.h"
#include "../arm/a64instdb_p.h"
#include "../arm/a64operand.h"
ASMJIT_BEGIN_SUB_NAMESPACE(a64)
+namespace InstInternal {
+
// a64::InstInternal - Text
// ========================
#ifndef ASMJIT_NO_TEXT
-Error InstInternal::instIdToString(Arch arch, InstId instId, String& output) noexcept {
+Error instIdToString(InstId instId, String& output) noexcept {
uint32_t realId = instId & uint32_t(InstIdParts::kRealId);
- DebugUtils::unused(arch);
-
if (ASMJIT_UNLIKELY(!Inst::isDefinedId(realId)))
return DebugUtils::errored(kErrorInvalidInstruction);
- const InstDB::InstInfo& info = InstDB::infoById(realId);
- return output.append(InstDB::_nameData + info._nameDataIndex);
+ return InstNameUtils::decode(output, InstDB::_instNameIndexTable[realId], InstDB::_instNameStringTable);
}
-InstId InstInternal::stringToInstId(Arch arch, const char* s, size_t len) noexcept {
- DebugUtils::unused(arch);
-
- if (ASMJIT_UNLIKELY(!s))
- return Inst::kIdNone;
-
- if (len == SIZE_MAX)
- len = strlen(s);
-
- if (ASMJIT_UNLIKELY(len == 0 || len > InstDB::kMaxNameSize))
- return Inst::kIdNone;
-
- uint32_t prefix = uint32_t(s[0]) - 'a';
- if (ASMJIT_UNLIKELY(prefix > 'z' - 'a'))
- return Inst::kIdNone;
-
- uint32_t index = InstDB::instNameIndex[prefix].start;
- if (ASMJIT_UNLIKELY(!index))
- return Inst::kIdNone;
-
- const char* nameData = InstDB::_nameData;
- const InstDB::InstInfo* table = InstDB::_instInfoTable;
-
- const InstDB::InstInfo* base = table + index;
- const InstDB::InstInfo* end = table + InstDB::instNameIndex[prefix].end;
-
- for (size_t lim = (size_t)(end - base); lim != 0; lim >>= 1) {
- const InstDB::InstInfo* cur = base + (lim >> 1);
- int result = Support::cmpInstName(nameData + cur[0]._nameDataIndex, s, len);
-
- if (result < 0) {
- base = cur + 1;
- lim--;
- continue;
- }
-
- if (result > 0)
- continue;
-
- return uint32_t((size_t)(cur - table));
- }
-
- return Inst::kIdNone;
+InstId stringToInstId(const char* s, size_t len) noexcept {
+ return InstNameUtils::find(s, len, InstDB::instNameIndex, InstDB::_instNameIndexTable, InstDB::_instNameStringTable);
}
#endif // !ASMJIT_NO_TEXT
@@ -80,9 +38,9 @@ InstId InstInternal::stringToInstId(Arch arch, const char* s, size_t len) noexce
// ============================
#ifndef ASMJIT_NO_VALIDATION
-ASMJIT_FAVOR_SIZE Error InstInternal::validate(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept {
+ASMJIT_FAVOR_SIZE Error validate(const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept {
// TODO:
- DebugUtils::unused(arch, inst, operands, opCount, validationFlags);
+ DebugUtils::unused(inst, operands, opCount, validationFlags);
return kErrorOk;
}
#endif // !ASMJIT_NO_VALIDATION
@@ -126,13 +84,7 @@ static const InstRWInfoData instRWInfoData[] = {
static const uint8_t elementTypeSize[8] = { 0, 1, 2, 4, 8, 4, 4, 0 };
-Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, InstRWInfo* out) noexcept {
- // Unused in Release configuration as the assert is not compiled in.
- DebugUtils::unused(arch);
-
- // Only called when `arch` matches X86 family.
- ASMJIT_ASSERT(Environment::isFamilyARM(arch));
-
+Error queryRWInfo(const BaseInst& inst, const Operand_* operands, size_t opCount, InstRWInfo* out) noexcept {
// Get the instruction data.
uint32_t realId = inst.id() & uint32_t(InstIdParts::kRealId);
@@ -185,11 +137,13 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
if (memOp.hasBase()) {
op.addOpFlags(OpRWFlags::kMemBaseRead);
+ if ((memOp.hasIndex() || memOp.hasOffset()) && memOp.isPreOrPost()) {
+ op.addOpFlags(OpRWFlags::kMemBaseWrite);
+ }
}
if (memOp.hasIndex()) {
op.addOpFlags(OpRWFlags::kMemIndexRead);
- op.addOpFlags(memOp.isPreOrPost() ? OpRWFlags::kMemIndexWrite : OpRWFlags::kNone);
}
}
}
@@ -222,10 +176,10 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
if (srcOp.isReg()) {
if (srcOp.as<Vec>().hasElementIndex()) {
// Only part of the vector is accessed if element index [] is used.
- uint32_t elementType = srcOp.as<Vec>().elementType();
+ VecElementType elementType = srcOp.as<Vec>().elementType();
uint32_t elementIndex = srcOp.as<Vec>().elementIndex();
- uint32_t elementSize = elementTypeSize[elementType];
+ uint32_t elementSize = elementTypeSize[size_t(elementType)];
uint64_t accessMask = uint64_t(Support::lsbMask<uint32_t>(elementSize)) << (elementIndex * elementSize);
op._readByteMask &= accessMask;
@@ -239,11 +193,13 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
if (memOp.hasBase()) {
op.addOpFlags(OpRWFlags::kMemBaseRead);
+ if ((memOp.hasIndex() || memOp.hasOffset()) && memOp.isPreOrPost()) {
+ op.addOpFlags(OpRWFlags::kMemBaseWrite);
+ }
}
if (memOp.hasIndex()) {
op.addOpFlags(OpRWFlags::kMemIndexRead);
- op.addOpFlags(memOp.isPreOrPost() ? OpRWFlags::kMemIndexWrite : OpRWFlags::kNone);
}
}
}
@@ -257,13 +213,15 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
// =================================
#ifndef ASMJIT_NO_INTROSPECTION
-Error InstInternal::queryFeatures(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, CpuFeatures* out) noexcept {
+Error queryFeatures(const BaseInst& inst, const Operand_* operands, size_t opCount, CpuFeatures* out) noexcept {
// TODO: [ARM] QueryFeatures not implemented yet.
- DebugUtils::unused(arch, inst, operands, opCount, out);
+ DebugUtils::unused(inst, operands, opCount, out);
return kErrorOk;
}
#endif // !ASMJIT_NO_INTROSPECTION
+} // {InstInternal}
+
// a64::InstInternal - Unit
// ========================
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64instapi_p.h b/3rdparty/asmjit/src/asmjit/arm/a64instapi_p.h
index 320a3e881d9..535e4bd71f8 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64instapi_p.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64instapi_p.h
@@ -18,17 +18,17 @@ ASMJIT_BEGIN_SUB_NAMESPACE(a64)
namespace InstInternal {
#ifndef ASMJIT_NO_TEXT
-Error ASMJIT_CDECL instIdToString(Arch arch, InstId instId, String& output) noexcept;
-InstId ASMJIT_CDECL stringToInstId(Arch arch, const char* s, size_t len) noexcept;
+Error ASMJIT_CDECL instIdToString(InstId instId, String& output) noexcept;
+InstId ASMJIT_CDECL stringToInstId(const char* s, size_t len) noexcept;
#endif // !ASMJIT_NO_TEXT
#ifndef ASMJIT_NO_VALIDATION
-Error ASMJIT_CDECL validate(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept;
+Error ASMJIT_CDECL validate(const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept;
#endif // !ASMJIT_NO_VALIDATION
#ifndef ASMJIT_NO_INTROSPECTION
-Error ASMJIT_CDECL queryRWInfo(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, InstRWInfo* out) noexcept;
-Error ASMJIT_CDECL queryFeatures(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, CpuFeatures* out) noexcept;
+Error ASMJIT_CDECL queryRWInfo(const BaseInst& inst, const Operand_* operands, size_t opCount, InstRWInfo* out) noexcept;
+Error ASMJIT_CDECL queryFeatures(const BaseInst& inst, const Operand_* operands, size_t opCount, CpuFeatures* out) noexcept;
#endif // !ASMJIT_NO_INTROSPECTION
} // {InstInternal}
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64instdb.cpp b/3rdparty/asmjit/src/asmjit/arm/a64instdb.cpp
index 64709b5db03..bc6646e895e 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64instdb.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64instdb.cpp
@@ -18,20 +18,11 @@ namespace InstDB {
// a64::InstDB - InstInfoTable
// ===========================
-// Don't store `_nameDataIndex` if instruction names are disabled. Since some
-// APIs can use `_nameDataIndex` it's much safer if it's zero if it's not used.
-#if defined(ASMJIT_NO_TEXT)
- #define NAME_DATA_INDEX(x) 0
-#else
- #define NAME_DATA_INDEX(x) x
-#endif
-
// Defines an ARM/AArch64 instruction.
-#define INST(id, opcodeEncoding, opcodeData, rwInfoIndex, flags, opcodeDataIndex, nameDataIndex) { \
+#define INST(id, opcodeEncoding, opcodeData, rwInfoIndex, flags, opcodeDataIndex) { \
uint32_t(kEncoding##opcodeEncoding), \
uint32_t(opcodeDataIndex), \
0, \
- uint32_t(NAME_DATA_INDEX(nameDataIndex)), \
uint16_t(rwInfoIndex), \
uint16_t(flags) \
}
@@ -63,774 +54,775 @@ IRG: Insert Random Tag.
INST_(Irg , BaseRRR , (0b1001101011000000000100, kX , kSP, kX , kSP, kX , kZR, true) , kRWI_W , 0 , 0 , 1 ), // #1
*/
const InstInfo _instInfoTable[] = {
- // +------------------+---------------------+--------------------------------------------------------------------------------------+-----------+---------------------------+----+-----+
- // | Instruction Id | Encoding | Opcode Data | RW Info | Instruction Flags |DatX|NameX|
- // +------------------+---------------------+--------------------------------------------------------------------------------------+-----------+---------------------------+----+-----+
+ // +------------------+---------------------+--------------------------------------------------------------------------------------+-----------+---------------------------+----+
+ // | Instruction Id | Encoding | Opcode Data | RW Info | Instruction Flags |DatX|
+ // +------------------+---------------------+--------------------------------------------------------------------------------------+-----------+---------------------------+----+
// ${InstInfo:Begin}
- INST(None , None , (_) , 0 , 0 , 0 , 0 ), // #0
- INST(Adc , BaseRRR , (0b0001101000000000000000, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 0 , 1 ), // #1
- INST(Adcs , BaseRRR , (0b0011101000000000000000, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 1 , 5 ), // #2
- INST(Add , BaseAddSub , (0b0001011000, 0b0001011001, 0b0010001) , kRWI_W , 0 , 0 , 978 ), // #3
- INST(Addg , BaseRRII , (0b1001000110000000000000, kX, kSP, kX, kSP, 6, 4, 16, 4, 0, 10) , kRWI_W , 0 , 0 , 10 ), // #4
- INST(Adds , BaseAddSub , (0b0101011000, 0b0101011001, 0b0110001) , kRWI_W , 0 , 1 , 15 ), // #5
- INST(Adr , BaseAdr , (0b0001000000000000000000, OffsetType::kAArch64_ADR) , kRWI_W , 0 , 0 , 25 ), // #6
- INST(Adrp , BaseAdr , (0b1001000000000000000000, OffsetType::kAArch64_ADRP) , kRWI_W , 0 , 1 , 29 ), // #7
- INST(And , BaseLogical , (0b0001010000, 0b00100100, 0) , kRWI_W , 0 , 0 , 57 ), // #8
- INST(Ands , BaseLogical , (0b1101010000, 0b11100100, 0) , kRWI_W , 0 , 1 , 61 ), // #9
- INST(Asr , BaseShift , (0b0001101011000000001010, 0b0001001100000000011111, 0) , kRWI_W , 0 , 0 , 66 ), // #10
- INST(Asrv , BaseShift , (0b0001101011000000001010, 0b0000000000000000000000, 0) , kRWI_W , 0 , 1 , 70 ), // #11
- INST(At , BaseAtDcIcTlbi , (0b00011111110000, 0b00001111000000, true) , kRWI_RX , 0 , 0 , 75 ), // #12
- INST(Autda , BaseRR , (0b11011010110000010001100000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 0 , 78 ), // #13
- INST(Autdza , BaseR , (0b11011010110000010011101111100000, kX, kZR, 0) , kRWI_X , 0 , 0 , 90 ), // #14
- INST(Autdb , BaseRR , (0b11011010110000010001110000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 1 , 84 ), // #15
- INST(Autdzb , BaseR , (0b11011010110000010011111111100000, kX, kZR, 0) , kRWI_X , 0 , 1 , 97 ), // #16
- INST(Autia , BaseRR , (0b11011010110000010001000000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 2 , 104 ), // #17
- INST(Autia1716 , BaseOp , (0b11010101000000110010000110011111) , 0 , 0 , 0 , 110 ), // #18
- INST(Autiasp , BaseOp , (0b11010101000000110010001110111111) , 0 , 0 , 1 , 120 ), // #19
- INST(Autiaz , BaseOp , (0b11010101000000110010001110011111) , 0 , 0 , 2 , 128 ), // #20
- INST(Autib , BaseRR , (0b11011010110000010001010000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 3 , 135 ), // #21
- INST(Autib1716 , BaseOp , (0b11010101000000110010000111011111) , 0 , 0 , 3 , 141 ), // #22
- INST(Autibsp , BaseOp , (0b11010101000000110010001111111111) , 0 , 0 , 4 , 151 ), // #23
- INST(Autibz , BaseOp , (0b11010101000000110010001111011111) , 0 , 0 , 5 , 159 ), // #24
- INST(Autiza , BaseR , (0b11011010110000010011001111100000, kX, kZR, 0) , kRWI_X , 0 , 2 , 166 ), // #25
- INST(Autizb , BaseR , (0b11011010110000010011011111100000, kX, kZR, 0) , kRWI_X , 0 , 3 , 173 ), // #26
- INST(Axflag , BaseOp , (0b11010101000000000100000001011111) , 0 , 0 , 6 , 180 ), // #27
- INST(B , BaseBranchRel , (0b00010100000000000000000000000000) , 0 , F(Cond) , 0 , 1738), // #28
- INST(Bfc , BaseBfc , (0b00110011000000000000001111100000) , kRWI_X , 0 , 0 , 192 ), // #29
- INST(Bfi , BaseBfi , (0b00110011000000000000000000000000) , kRWI_X , 0 , 0 , 223 ), // #30
- INST(Bfm , BaseBfm , (0b00110011000000000000000000000000) , kRWI_X , 0 , 0 , 2514), // #31
- INST(Bfxil , BaseBfx , (0b00110011000000000000000000000000) , kRWI_X , 0 , 0 , 250 ), // #32
- INST(Bic , BaseLogical , (0b0001010001, 0b00100100, 1) , kRWI_W , 0 , 2 , 256 ), // #33
- INST(Bics , BaseLogical , (0b1101010001, 0b11100100, 1) , kRWI_W , 0 , 3 , 260 ), // #34
- INST(Bl , BaseBranchRel , (0b10010100000000000000000000000000) , 0 , 0 , 1 , 2831), // #35
- INST(Blr , BaseBranchReg , (0b11010110001111110000000000000000) , kRWI_R , 0 , 0 , 269 ), // #36
- INST(Br , BaseBranchReg , (0b11010110000111110000000000000000) , kRWI_R , 0 , 1 , 273 ), // #37
- INST(Brk , BaseOpImm , (0b11010100001000000000000000000000, 16, 5) , 0 , 0 , 0 , 276 ), // #38
- INST(Cas , BaseAtomicOp , (0b1000100010100000011111, kWX, 30, 0) , kRWI_XRX , 0 , 0 , 284 ), // #39
- INST(Casa , BaseAtomicOp , (0b1000100011100000011111, kWX, 30, 1) , kRWI_XRX , 0 , 1 , 288 ), // #40
- INST(Casab , BaseAtomicOp , (0b0000100011100000011111, kW , 0 , 1) , kRWI_XRX , 0 , 2 , 293 ), // #41
- INST(Casah , BaseAtomicOp , (0b0100100011100000011111, kW , 0 , 1) , kRWI_XRX , 0 , 3 , 299 ), // #42
- INST(Casal , BaseAtomicOp , (0b1000100011100000111111, kWX, 30, 1) , kRWI_XRX , 0 , 4 , 305 ), // #43
- INST(Casalb , BaseAtomicOp , (0b0000100011100000111111, kW , 0 , 1) , kRWI_XRX , 0 , 5 , 311 ), // #44
- INST(Casalh , BaseAtomicOp , (0b0100100011100000111111, kW , 0 , 1) , kRWI_XRX , 0 , 6 , 318 ), // #45
- INST(Casb , BaseAtomicOp , (0b0000100010100000011111, kW , 0 , 0) , kRWI_XRX , 0 , 7 , 325 ), // #46
- INST(Cash , BaseAtomicOp , (0b0100100010100000011111, kW , 0 , 0) , kRWI_XRX , 0 , 8 , 330 ), // #47
- INST(Casl , BaseAtomicOp , (0b1000100010100000111111, kWX, 30, 0) , kRWI_XRX , 0 , 9 , 335 ), // #48
- INST(Caslb , BaseAtomicOp , (0b0000100010100000111111, kW , 0 , 0) , kRWI_XRX , 0 , 10 , 340 ), // #49
- INST(Caslh , BaseAtomicOp , (0b0100100010100000111111, kW , 0 , 0) , kRWI_XRX , 0 , 11 , 346 ), // #50
- INST(Casp , BaseAtomicCasp , (0b0000100000100000011111, kWX, 30) , kRWI_XXRRX, 0 , 0 , 352 ), // #51
- INST(Caspa , BaseAtomicCasp , (0b0000100001100000011111, kWX, 30) , kRWI_XXRRX, 0 , 1 , 357 ), // #52
- INST(Caspal , BaseAtomicCasp , (0b0000100001100000111111, kWX, 30) , kRWI_XXRRX, 0 , 2 , 363 ), // #53
- INST(Caspl , BaseAtomicCasp , (0b0000100000100000111111, kWX, 30) , kRWI_XXRRX, 0 , 3 , 370 ), // #54
- INST(Cbnz , BaseBranchCmp , (0b00110101000000000000000000000000) , kRWI_R , 0 , 0 , 376 ), // #55
- INST(Cbz , BaseBranchCmp , (0b00110100000000000000000000000000) , kRWI_R , 0 , 1 , 381 ), // #56
- INST(Ccmn , BaseCCmp , (0b00111010010000000000000000000000) , kRWI_R , 0 , 0 , 385 ), // #57
- INST(Ccmp , BaseCCmp , (0b01111010010000000000000000000000) , kRWI_R , 0 , 1 , 650 ), // #58
- INST(Cfinv , BaseOp , (0b11010101000000000100000000011111) , 0 , 0 , 7 , 390 ), // #59
- INST(Cinc , BaseCInc , (0b00011010100000000000010000000000) , kRWI_W , 0 , 0 , 396 ), // #60
- INST(Cinv , BaseCInc , (0b01011010100000000000000000000000) , kRWI_W , 0 , 1 , 401 ), // #61
- INST(Clrex , BaseOpImm , (0b11010101000000110011000001011111, 4, 8) , 0 , 0 , 1 , 406 ), // #62
- INST(Cls , BaseRR , (0b01011010110000000001010000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 4 , 412 ), // #63
- INST(Clz , BaseRR , (0b01011010110000000001000000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 5 , 416 ), // #64
- INST(Cmn , BaseCmpCmn , (0b0101011000, 0b0101011001, 0b0110001) , kRWI_R , 0 , 0 , 386 ), // #65
- INST(Cmp , BaseCmpCmn , (0b1101011000, 0b1101011001, 0b1110001) , kRWI_R , 0 , 1 , 651 ), // #66
- INST(Cmpp , BaseRR , (0b10111010110000000000000000011111, kX, kSP, 5, kX, kSP, 16, true) , kRWI_R , 0 , 6 , 430 ), // #67
- INST(Cneg , BaseCInc , (0b01011010100000000000010000000000) , kRWI_W , 0 , 2 , 441 ), // #68
- INST(Crc32b , BaseRRR , (0b0001101011000000010000, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 2 , 450 ), // #69
- INST(Crc32cb , BaseRRR , (0b0001101011000000010100, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 3 , 457 ), // #70
- INST(Crc32ch , BaseRRR , (0b0001101011000000010101, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 4 , 465 ), // #71
- INST(Crc32cw , BaseRRR , (0b0001101011000000010110, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 5 , 473 ), // #72
- INST(Crc32cx , BaseRRR , (0b1001101011000000010111, kW, kZR, kW, kZR, kX, kZR, false) , kRWI_W , 0 , 6 , 481 ), // #73
- INST(Crc32h , BaseRRR , (0b0001101011000000010001, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 7 , 489 ), // #74
- INST(Crc32w , BaseRRR , (0b0001101011000000010010, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 8 , 496 ), // #75
- INST(Crc32x , BaseRRR , (0b1001101011000000010011, kW, kZR, kW, kZR, kX, kZR, false) , kRWI_W , 0 , 9 , 503 ), // #76
- INST(Csdb , BaseOp , (0b11010101000000110010001010011111) , 0 , 0 , 8 , 510 ), // #77
- INST(Csel , BaseCSel , (0b00011010100000000000000000000000) , kRWI_W , 0 , 0 , 710 ), // #78
- INST(Cset , BaseCSet , (0b00011010100111110000011111100000) , kRWI_W , 0 , 0 , 515 ), // #79
- INST(Csetm , BaseCSet , (0b01011010100111110000001111100000) , kRWI_W , 0 , 1 , 520 ), // #80
- INST(Csinc , BaseCSel , (0b00011010100000000000010000000000) , kRWI_W , 0 , 1 , 526 ), // #81
- INST(Csinv , BaseCSel , (0b01011010100000000000000000000000) , kRWI_W , 0 , 2 , 532 ), // #82
- INST(Csneg , BaseCSel , (0b01011010100000000000010000000000) , kRWI_W , 0 , 3 , 538 ), // #83
- INST(Dc , BaseAtDcIcTlbi , (0b00011110000000, 0b00001110000000, true) , kRWI_RX , 0 , 1 , 2 ), // #84
- INST(Dcps1 , BaseOpImm , (0b11010100101000000000000000000001, 16, 5) , 0 , 0 , 2 , 544 ), // #85
- INST(Dcps2 , BaseOpImm , (0b11010100101000000000000000000010, 16, 5) , 0 , 0 , 3 , 550 ), // #86
- INST(Dcps3 , BaseOpImm , (0b11010100101000000000000000000011, 16, 5) , 0 , 0 , 4 , 556 ), // #87
- INST(Dgh , BaseOp , (0b11010101000000110010000011011111) , 0 , 0 , 9 , 562 ), // #88
- INST(Dmb , BaseOpImm , (0b11010101000000110011000010111111, 4, 8) , 0 , 0 , 5 , 566 ), // #89
- INST(Drps , BaseOp , (0b11010110101111110000001111100000) , 0 , 0 , 10 , 570 ), // #90
- INST(Dsb , BaseOpImm , (0b11010101000000110011000010011111, 4, 8) , 0 , 0 , 6 , 575 ), // #91
- INST(Eon , BaseLogical , (0b1001010001, 0b10100100, 1) , kRWI_W , 0 , 4 , 583 ), // #92
- INST(Eor , BaseLogical , (0b1001010000, 0b10100100, 0) , kRWI_W , 0 , 5 , 1418), // #93
- INST(Esb , BaseOp , (0b11010101000000110010001000011111) , 0 , 0 , 11 , 597 ), // #94
- INST(Extr , BaseExtract , (0b00010011100000000000000000000000) , kRWI_W , 0 , 0 , 605 ), // #95
- INST(Eret , BaseOp , (0b11010110100111110000001111100000) , 0 , 0 , 12 , 592 ), // #96
- INST(Gmi , BaseRRR , (0b1001101011000000000101, kX , kZR, kX , kSP, kX , kZR, true) , kRWI_W , 0 , 10 , 1128), // #97
- INST(Hint , BaseOpImm , (0b11010101000000110010000000011111, 7, 5) , 0 , 0 , 7 , 1132), // #98
- INST(Hlt , BaseOpImm , (0b11010100010000000000000000000000, 16, 5) , 0 , 0 , 8 , 1137), // #99
- INST(Hvc , BaseOpImm , (0b11010100000000000000000000000010, 16, 5) , 0 , 0 , 9 , 1141), // #100
- INST(Ic , BaseAtDcIcTlbi , (0b00011110000000, 0b00001110000000, false) , kRWI_RX , 0 , 2 , 257 ), // #101
- INST(Isb , BaseOpImm , (0b11010101000000110011000011011111, 4, 8) , 0 , 0 , 10 , 1149), // #102
- INST(Ldadd , BaseAtomicOp , (0b1011100000100000000000, kWX, 30, 0) , kRWI_WRX , 0 , 12 , 1189), // #103
- INST(Ldadda , BaseAtomicOp , (0b1011100010100000000000, kWX, 30, 1) , kRWI_WRX , 0 , 13 , 1195), // #104
- INST(Ldaddab , BaseAtomicOp , (0b0011100010100000000000, kW , 0 , 1) , kRWI_WRX , 0 , 14 , 1202), // #105
- INST(Ldaddah , BaseAtomicOp , (0b0111100010100000000000, kW , 0 , 1) , kRWI_WRX , 0 , 15 , 1210), // #106
- INST(Ldaddal , BaseAtomicOp , (0b1011100011100000000000, kWX, 30, 1) , kRWI_WRX , 0 , 16 , 1218), // #107
- INST(Ldaddalb , BaseAtomicOp , (0b0011100011100000000000, kW , 0 , 1) , kRWI_WRX , 0 , 17 , 1226), // #108
- INST(Ldaddalh , BaseAtomicOp , (0b0111100011100000000000, kW , 0 , 1) , kRWI_WRX , 0 , 18 , 1235), // #109
- INST(Ldaddb , BaseAtomicOp , (0b0011100000100000000000, kW , 0 , 0) , kRWI_WRX , 0 , 19 , 1244), // #110
- INST(Ldaddh , BaseAtomicOp , (0b0111100000100000000000, kW , 0 , 0) , kRWI_WRX , 0 , 20 , 1251), // #111
- INST(Ldaddl , BaseAtomicOp , (0b1011100001100000000000, kWX, 30, 0) , kRWI_WRX , 0 , 21 , 1258), // #112
- INST(Ldaddlb , BaseAtomicOp , (0b0011100001100000000000, kW , 0 , 0) , kRWI_WRX , 0 , 22 , 1265), // #113
- INST(Ldaddlh , BaseAtomicOp , (0b0111100001100000000000, kW , 0 , 0) , kRWI_WRX , 0 , 23 , 1273), // #114
- INST(Ldar , BaseRM_NoImm , (0b1000100011011111111111, kWX, kZR, 30) , kRWI_W , 0 , 0 , 1281), // #115
- INST(Ldarb , BaseRM_NoImm , (0b0000100011011111111111, kW , kZR, 0 ) , kRWI_W , 0 , 1 , 1286), // #116
- INST(Ldarh , BaseRM_NoImm , (0b0100100011011111111111, kW , kZR, 0 ) , kRWI_W , 0 , 2 , 1292), // #117
- INST(Ldaxp , BaseLdxp , (0b1000100001111111100000, kWX, 30) , kRWI_WW , 0 , 0 , 1298), // #118
- INST(Ldaxr , BaseRM_NoImm , (0b1000100001011111111111, kWX, kZR, 30) , kRWI_W , 0 , 3 , 1304), // #119
- INST(Ldaxrb , BaseRM_NoImm , (0b0000100001011111111111, kW , kZR, 0 ) , kRWI_W , 0 , 4 , 1310), // #120
- INST(Ldaxrh , BaseRM_NoImm , (0b0100100001011111111111, kW , kZR, 0 ) , kRWI_W , 0 , 5 , 1317), // #121
- INST(Ldclr , BaseAtomicOp , (0b1011100000100000000100, kWX, 30, 0) , kRWI_WRX , 0 , 24 , 1324), // #122
- INST(Ldclra , BaseAtomicOp , (0b1011100010100000000100, kWX, 30, 1) , kRWI_WRX , 0 , 25 , 1330), // #123
- INST(Ldclrab , BaseAtomicOp , (0b0011100010100000000100, kW , 0 , 1) , kRWI_WRX , 0 , 26 , 1337), // #124
- INST(Ldclrah , BaseAtomicOp , (0b0111100010100000000100, kW , 0 , 1) , kRWI_WRX , 0 , 27 , 1345), // #125
- INST(Ldclral , BaseAtomicOp , (0b1011100011100000000100, kWX, 30, 1) , kRWI_WRX , 0 , 28 , 1353), // #126
- INST(Ldclralb , BaseAtomicOp , (0b0011100011100000000100, kW , 0 , 1) , kRWI_WRX , 0 , 29 , 1361), // #127
- INST(Ldclralh , BaseAtomicOp , (0b0111100011100000000100, kW , 0 , 1) , kRWI_WRX , 0 , 30 , 1370), // #128
- INST(Ldclrb , BaseAtomicOp , (0b0011100000100000000100, kW , 0 , 0) , kRWI_WRX , 0 , 31 , 1379), // #129
- INST(Ldclrh , BaseAtomicOp , (0b0111100000100000000100, kW , 0 , 0) , kRWI_WRX , 0 , 32 , 1386), // #130
- INST(Ldclrl , BaseAtomicOp , (0b1011100001100000000100, kWX, 30, 0) , kRWI_WRX , 0 , 33 , 1393), // #131
- INST(Ldclrlb , BaseAtomicOp , (0b0011100001100000000100, kW , 0 , 0) , kRWI_WRX , 0 , 34 , 1400), // #132
- INST(Ldclrlh , BaseAtomicOp , (0b0111100001100000000100, kW , 0 , 0) , kRWI_WRX , 0 , 35 , 1408), // #133
- INST(Ldeor , BaseAtomicOp , (0b1011100000100000001000, kWX, 30, 0) , kRWI_WRX , 0 , 36 , 1416), // #134
- INST(Ldeora , BaseAtomicOp , (0b1011100010100000001000, kWX, 30, 1) , kRWI_WRX , 0 , 37 , 1422), // #135
- INST(Ldeorab , BaseAtomicOp , (0b0011100010100000001000, kW , 0 , 1) , kRWI_WRX , 0 , 38 , 1429), // #136
- INST(Ldeorah , BaseAtomicOp , (0b0111100010100000001000, kW , 0 , 1) , kRWI_WRX , 0 , 39 , 1437), // #137
- INST(Ldeoral , BaseAtomicOp , (0b1011100011100000001000, kWX, 30, 1) , kRWI_WRX , 0 , 40 , 1445), // #138
- INST(Ldeoralb , BaseAtomicOp , (0b0011100011100000001000, kW , 0 , 1) , kRWI_WRX , 0 , 41 , 1453), // #139
- INST(Ldeoralh , BaseAtomicOp , (0b0111100011100000001000, kW , 0 , 1) , kRWI_WRX , 0 , 42 , 1462), // #140
- INST(Ldeorb , BaseAtomicOp , (0b0011100000100000001000, kW , 0 , 0) , kRWI_WRX , 0 , 43 , 1471), // #141
- INST(Ldeorh , BaseAtomicOp , (0b0111100000100000001000, kW , 0 , 0) , kRWI_WRX , 0 , 44 , 1478), // #142
- INST(Ldeorl , BaseAtomicOp , (0b1011100001100000001000, kWX, 30, 0) , kRWI_WRX , 0 , 45 , 1485), // #143
- INST(Ldeorlb , BaseAtomicOp , (0b0011100001100000001000, kW , 0 , 0) , kRWI_WRX , 0 , 46 , 1492), // #144
- INST(Ldeorlh , BaseAtomicOp , (0b0111100001100000001000, kW , 0 , 0) , kRWI_WRX , 0 , 47 , 1500), // #145
- INST(Ldg , BaseRM_SImm9 , (0b1101100101100000000000, 0b0000000000000000000000, kX , kZR, 0, 4) , kRWI_W , 0 , 0 , 1508), // #146
- INST(Ldgm , BaseRM_NoImm , (0b1101100111100000000000, kX , kZR, 0 ) , kRWI_W , 0 , 6 , 1512), // #147
- INST(Ldlar , BaseRM_NoImm , (0b1000100011011111011111, kWX, kZR, 30) , kRWI_W , 0 , 7 , 1517), // #148
- INST(Ldlarb , BaseRM_NoImm , (0b0000100011011111011111, kW , kZR, 0 ) , kRWI_W , 0 , 8 , 1523), // #149
- INST(Ldlarh , BaseRM_NoImm , (0b0100100011011111011111, kW , kZR, 0 ) , kRWI_W , 0 , 9 , 1530), // #150
- INST(Ldnp , BaseLdpStp , (0b0010100001, 0 , kWX, 31, 2) , kRWI_WW , 0 , 0 , 1537), // #151
- INST(Ldp , BaseLdpStp , (0b0010100101, 0b0010100011, kWX, 31, 2) , kRWI_W , 0 , 1 , 1542), // #152
- INST(Ldpsw , BaseLdpStp , (0b0110100101, 0b0110100011, kX , 0 , 2) , kRWI_WW , 0 , 2 , 1546), // #153
- INST(Ldr , BaseLdSt , (0b1011100101, 0b10111000010, 0b10111000011, 0b00011000, kWX, 30, 2, Inst::kIdLdur) , kRWI_W , 0 , 0 , 1552), // #154
- INST(Ldraa , BaseRM_SImm10 , (0b1111100000100000000001, kX , kZR, 0, 3) , kRWI_W , 0 , 0 , 1556), // #155
- INST(Ldrab , BaseRM_SImm10 , (0b1111100010100000000001, kX , kZR, 0, 3) , kRWI_W , 0 , 1 , 1562), // #156
- INST(Ldrb , BaseLdSt , (0b0011100101, 0b00111000010, 0b00111000011, 0 , kW , 0 , 0, Inst::kIdLdurb) , kRWI_W , 0 , 1 , 1568), // #157
- INST(Ldrh , BaseLdSt , (0b0111100101, 0b01111000010, 0b01111000011, 0 , kW , 0 , 1, Inst::kIdLdurh) , kRWI_W , 0 , 2 , 1573), // #158
- INST(Ldrsb , BaseLdSt , (0b0011100111, 0b00111000100, 0b00111000101, 0 , kWX, 22, 0, Inst::kIdLdursb) , kRWI_W , 0 , 3 , 1578), // #159
- INST(Ldrsh , BaseLdSt , (0b0111100110, 0b01111000100, 0b01111000101, 0 , kWX, 22, 1, Inst::kIdLdursh) , kRWI_W , 0 , 4 , 1584), // #160
- INST(Ldrsw , BaseLdSt , (0b1011100110, 0b10111000100, 0b10111000101, 0b10011000, kX , 0 , 2, Inst::kIdLdursw) , kRWI_W , 0 , 5 , 1590), // #161
- INST(Ldset , BaseAtomicOp , (0b1011100000100000001100, kWX, 30, 0) , kRWI_WRX , 0 , 48 , 1596), // #162
- INST(Ldseta , BaseAtomicOp , (0b1011100010100000001100, kWX, 30, 1) , kRWI_WRX , 0 , 49 , 1602), // #163
- INST(Ldsetab , BaseAtomicOp , (0b0011100010100000001100, kW , 0 , 1) , kRWI_WRX , 0 , 50 , 1609), // #164
- INST(Ldsetah , BaseAtomicOp , (0b0111100010100000001100, kW , 0 , 1) , kRWI_WRX , 0 , 51 , 1617), // #165
- INST(Ldsetal , BaseAtomicOp , (0b1011100011100000001100, kWX, 30, 1) , kRWI_WRX , 0 , 52 , 1625), // #166
- INST(Ldsetalb , BaseAtomicOp , (0b0011100011100000001100, kW , 0 , 1) , kRWI_WRX , 0 , 53 , 1633), // #167
- INST(Ldsetalh , BaseAtomicOp , (0b0111100011100000001100, kW , 0 , 1) , kRWI_WRX , 0 , 54 , 1642), // #168
- INST(Ldsetb , BaseAtomicOp , (0b0011100000100000001100, kW , 0 , 0) , kRWI_WRX , 0 , 55 , 1651), // #169
- INST(Ldseth , BaseAtomicOp , (0b0111100000100000001100, kW , 0 , 0) , kRWI_WRX , 0 , 56 , 1658), // #170
- INST(Ldsetl , BaseAtomicOp , (0b1011100001100000001100, kWX, 30, 0) , kRWI_WRX , 0 , 57 , 1665), // #171
- INST(Ldsetlb , BaseAtomicOp , (0b0011100001100000001100, kW , 0 , 0) , kRWI_WRX , 0 , 58 , 1672), // #172
- INST(Ldsetlh , BaseAtomicOp , (0b0111100001100000001100, kW , 0 , 0) , kRWI_WRX , 0 , 59 , 1680), // #173
- INST(Ldsmax , BaseAtomicOp , (0b1011100000100000010000, kWX, 30, 0) , kRWI_WRX , 0 , 60 , 1688), // #174
- INST(Ldsmaxa , BaseAtomicOp , (0b1011100010100000010000, kWX, 30, 1) , kRWI_WRX , 0 , 61 , 1695), // #175
- INST(Ldsmaxab , BaseAtomicOp , (0b0011100010100000010000, kW , 0 , 1) , kRWI_WRX , 0 , 62 , 1703), // #176
- INST(Ldsmaxah , BaseAtomicOp , (0b0111100010100000010000, kW , 0 , 1) , kRWI_WRX , 0 , 63 , 1712), // #177
- INST(Ldsmaxal , BaseAtomicOp , (0b1011100011100000010000, kWX, 30, 1) , kRWI_WRX , 0 , 64 , 1721), // #178
- INST(Ldsmaxalb , BaseAtomicOp , (0b0011100011100000010000, kW , 0 , 1) , kRWI_WRX , 0 , 65 , 1730), // #179
- INST(Ldsmaxalh , BaseAtomicOp , (0b0111100011100000010000, kW , 0 , 1) , kRWI_WRX , 0 , 66 , 1740), // #180
- INST(Ldsmaxb , BaseAtomicOp , (0b0011100000100000010000, kW , 0 , 0) , kRWI_WRX , 0 , 67 , 1750), // #181
- INST(Ldsmaxh , BaseAtomicOp , (0b0111100000100000010000, kW , 0 , 0) , kRWI_WRX , 0 , 68 , 1758), // #182
- INST(Ldsmaxl , BaseAtomicOp , (0b1011100001100000010000, kWX, 30, 0) , kRWI_WRX , 0 , 69 , 1766), // #183
- INST(Ldsmaxlb , BaseAtomicOp , (0b0011100001100000010000, kW , 0 , 0) , kRWI_WRX , 0 , 70 , 1774), // #184
- INST(Ldsmaxlh , BaseAtomicOp , (0b0111100001100000010000, kW , 0 , 0) , kRWI_WRX , 0 , 71 , 1783), // #185
- INST(Ldsmin , BaseAtomicOp , (0b1011100000100000010100, kWX, 30, 0) , kRWI_WRX , 0 , 72 , 1792), // #186
- INST(Ldsmina , BaseAtomicOp , (0b1011100010100000010100, kWX, 30, 1) , kRWI_WRX , 0 , 73 , 1799), // #187
- INST(Ldsminab , BaseAtomicOp , (0b0011100010100000010100, kW , 0 , 1) , kRWI_WRX , 0 , 74 , 1807), // #188
- INST(Ldsminah , BaseAtomicOp , (0b0111100010100000010100, kW , 0 , 1) , kRWI_WRX , 0 , 75 , 1816), // #189
- INST(Ldsminal , BaseAtomicOp , (0b1011100011100000010100, kWX, 30, 1) , kRWI_WRX , 0 , 76 , 1825), // #190
- INST(Ldsminalb , BaseAtomicOp , (0b0011100011100000010100, kW , 0 , 1) , kRWI_WRX , 0 , 77 , 1834), // #191
- INST(Ldsminalh , BaseAtomicOp , (0b0111100011100000010100, kW , 0 , 1) , kRWI_WRX , 0 , 78 , 1844), // #192
- INST(Ldsminb , BaseAtomicOp , (0b0011100000100000010100, kW , 0 , 0) , kRWI_WRX , 0 , 79 , 1854), // #193
- INST(Ldsminh , BaseAtomicOp , (0b0111100000100000010100, kW , 0 , 0) , kRWI_WRX , 0 , 80 , 1862), // #194
- INST(Ldsminl , BaseAtomicOp , (0b1011100001100000010100, kWX, 30, 0) , kRWI_WRX , 0 , 81 , 1870), // #195
- INST(Ldsminlb , BaseAtomicOp , (0b0011100001100000010100, kW , 0 , 0) , kRWI_WRX , 0 , 82 , 1878), // #196
- INST(Ldsminlh , BaseAtomicOp , (0b0111100001100000010100, kW , 0 , 0) , kRWI_WRX , 0 , 83 , 1887), // #197
- INST(Ldtr , BaseRM_SImm9 , (0b1011100001000000000010, 0b0000000000000000000000, kWX, kZR, 30, 0) , kRWI_W , 0 , 1 , 1896), // #198
- INST(Ldtrb , BaseRM_SImm9 , (0b0011100001000000000010, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_W , 0 , 2 , 1901), // #199
- INST(Ldtrh , BaseRM_SImm9 , (0b0111100001000000000010, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_W , 0 , 3 , 1907), // #200
- INST(Ldtrsb , BaseRM_SImm9 , (0b0011100011000000000010, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 4 , 1913), // #201
- INST(Ldtrsh , BaseRM_SImm9 , (0b0111100011000000000010, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 5 , 1920), // #202
- INST(Ldtrsw , BaseRM_SImm9 , (0b1011100010000000000010, 0b0000000000000000000000, kX , kZR, 0 , 0) , kRWI_W , 0 , 6 , 1927), // #203
- INST(Ldumax , BaseAtomicOp , (0b1011100000100000011000, kWX, 30, 0) , kRWI_WRX , 0 , 84 , 1934), // #204
- INST(Ldumaxa , BaseAtomicOp , (0b1011100010100000011000, kWX, 30, 1) , kRWI_WRX , 0 , 85 , 1941), // #205
- INST(Ldumaxab , BaseAtomicOp , (0b0011100010100000011000, kW , 0 , 1) , kRWI_WRX , 0 , 86 , 1949), // #206
- INST(Ldumaxah , BaseAtomicOp , (0b0111100010100000011000, kW , 0 , 1) , kRWI_WRX , 0 , 87 , 1958), // #207
- INST(Ldumaxal , BaseAtomicOp , (0b1011100011100000011000, kWX, 30, 1) , kRWI_WRX , 0 , 88 , 1967), // #208
- INST(Ldumaxalb , BaseAtomicOp , (0b0011100011100000011000, kW , 0 , 1) , kRWI_WRX , 0 , 89 , 1976), // #209
- INST(Ldumaxalh , BaseAtomicOp , (0b0111100011100000011000, kW , 0 , 1) , kRWI_WRX , 0 , 90 , 1986), // #210
- INST(Ldumaxb , BaseAtomicOp , (0b0011100000100000011000, kW , 0 , 0) , kRWI_WRX , 0 , 91 , 1996), // #211
- INST(Ldumaxh , BaseAtomicOp , (0b0111100000100000011000, kW , 0 , 0) , kRWI_WRX , 0 , 92 , 2004), // #212
- INST(Ldumaxl , BaseAtomicOp , (0b1011100001100000011000, kWX, 30, 0) , kRWI_WRX , 0 , 93 , 2012), // #213
- INST(Ldumaxlb , BaseAtomicOp , (0b0011100001100000011000, kW , 0 , 0) , kRWI_WRX , 0 , 94 , 2020), // #214
- INST(Ldumaxlh , BaseAtomicOp , (0b0111100001100000011000, kW , 0 , 0) , kRWI_WRX , 0 , 95 , 2029), // #215
- INST(Ldumin , BaseAtomicOp , (0b1011100000100000011100, kWX, 30, 0) , kRWI_WRX , 0 , 96 , 2038), // #216
- INST(Ldumina , BaseAtomicOp , (0b1011100010100000011100, kWX, 30, 1) , kRWI_WRX , 0 , 97 , 2045), // #217
- INST(Lduminab , BaseAtomicOp , (0b0011100010100000011100, kW , 0 , 1) , kRWI_WRX , 0 , 98 , 2053), // #218
- INST(Lduminah , BaseAtomicOp , (0b0111100010100000011100, kW , 0 , 1) , kRWI_WRX , 0 , 99 , 2062), // #219
- INST(Lduminal , BaseAtomicOp , (0b1011100011100000011100, kWX, 30, 1) , kRWI_WRX , 0 , 100, 2071), // #220
- INST(Lduminalb , BaseAtomicOp , (0b0011100011100000011100, kW , 0 , 1) , kRWI_WRX , 0 , 101, 2080), // #221
- INST(Lduminalh , BaseAtomicOp , (0b0111100011100000011100, kW , 0 , 1) , kRWI_WRX , 0 , 102, 2090), // #222
- INST(Lduminb , BaseAtomicOp , (0b0011100000100000011100, kW , 0 , 0) , kRWI_WRX , 0 , 103, 2100), // #223
- INST(Lduminh , BaseAtomicOp , (0b0111100000100000011100, kW , 0 , 0) , kRWI_WRX , 0 , 104, 2108), // #224
- INST(Lduminl , BaseAtomicOp , (0b1011100001100000011100, kWX, 30, 0) , kRWI_WRX , 0 , 105, 2116), // #225
- INST(Lduminlb , BaseAtomicOp , (0b0011100001100000011100, kW , 0 , 0) , kRWI_WRX , 0 , 106, 2124), // #226
- INST(Lduminlh , BaseAtomicOp , (0b0111100001100000011100, kW , 0 , 0) , kRWI_WRX , 0 , 107, 2133), // #227
- INST(Ldur , BaseRM_SImm9 , (0b1011100001000000000000, 0b0000000000000000000000, kWX, kZR, 30, 0) , kRWI_W , 0 , 7 , 2142), // #228
- INST(Ldurb , BaseRM_SImm9 , (0b0011100001000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_W , 0 , 8 , 2147), // #229
- INST(Ldurh , BaseRM_SImm9 , (0b0111100001000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_W , 0 , 9 , 2153), // #230
- INST(Ldursb , BaseRM_SImm9 , (0b0011100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 10 , 2159), // #231
- INST(Ldursh , BaseRM_SImm9 , (0b0111100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 11 , 2166), // #232
- INST(Ldursw , BaseRM_SImm9 , (0b1011100010000000000000, 0b0000000000000000000000, kWX, kZR, 0 , 0) , kRWI_W , 0 , 12 , 2173), // #233
- INST(Ldxp , BaseLdxp , (0b1000100001111111000000, kWX, 30) , kRWI_WW , 0 , 1 , 2180), // #234
- INST(Ldxr , BaseRM_NoImm , (0b1000100001011111011111, kWX, kZR, 30) , kRWI_W , 0 , 10 , 2185), // #235
- INST(Ldxrb , BaseRM_NoImm , (0b0000100001011111011111, kW , kZR, 0 ) , kRWI_W , 0 , 11 , 2190), // #236
- INST(Ldxrh , BaseRM_NoImm , (0b0100100001011111011111, kW , kZR, 0 ) , kRWI_W , 0 , 12 , 2196), // #237
- INST(Lsl , BaseShift , (0b0001101011000000001000, 0b0101001100000000000000, 0) , kRWI_W , 0 , 2 , 2880), // #238
- INST(Lslv , BaseShift , (0b0001101011000000001000, 0b0000000000000000000000, 0) , kRWI_W , 0 , 3 , 2202), // #239
- INST(Lsr , BaseShift , (0b0001101011000000001001, 0b0101001100000000011111, 0) , kRWI_W , 0 , 4 , 2207), // #240
- INST(Lsrv , BaseShift , (0b0001101011000000001001, 0b0000000000000000000000, 0) , kRWI_W , 0 , 5 , 2211), // #241
- INST(Madd , BaseRRRR , (0b0001101100000000000000, kWX, kZR, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 0 , 977 ), // #242
- INST(Mneg , BaseRRR , (0b0001101100000000111111, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 11 , 2216), // #243
- INST(Mov , BaseMov , (_) , kRWI_W , 0 , 0 , 949 ), // #244
- INST(Movk , BaseMovKNZ , (0b01110010100000000000000000000000) , kRWI_X , 0 , 0 , 2226), // #245
- INST(Movn , BaseMovKNZ , (0b00010010100000000000000000000000) , kRWI_W , 0 , 1 , 2231), // #246
- INST(Movz , BaseMovKNZ , (0b01010010100000000000000000000000) , kRWI_W , 0 , 2 , 2236), // #247
- INST(Mrs , BaseMrs , (_) , kRWI_W , 0 , 0 , 2241), // #248
- INST(Msr , BaseMsr , (_) , kRWI_W , 0 , 0 , 2245), // #249
- INST(Msub , BaseRRRR , (0b0001101100000000100000, kWX, kZR, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 1 , 984 ), // #250
- INST(Mul , BaseRRR , (0b0001101100000000011111, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 12 , 991 ), // #251
- INST(Mvn , BaseMvnNeg , (0b00101010001000000000001111100000) , kRWI_W , 0 , 0 , 2249), // #252
- INST(Neg , BaseMvnNeg , (0b01001011000000000000001111100000) , kRWI_W , 0 , 1 , 540 ), // #253
- INST(Negs , BaseMvnNeg , (0b01101011000000000000001111100000) , kRWI_W , 0 , 2 , 2258), // #254
- INST(Ngc , BaseRR , (0b01011010000000000000001111100000, kWX, kZR, 0, kWX, kZR, 16, true) , kRWI_W , 0 , 7 , 2263), // #255
- INST(Ngcs , BaseRR , (0b01111010000000000000001111100000, kWX, kZR, 0, kWX, kZR, 16, true) , kRWI_W , 0 , 8 , 2267), // #256
- INST(Nop , BaseOp , (0b11010101000000110010000000011111) , 0 , 0 , 13 , 2272), // #257
- INST(Orn , BaseLogical , (0b0101010001, 0b01100100, 1) , kRWI_W , 0 , 6 , 2280), // #258
- INST(Orr , BaseLogical , (0b0101010000, 0b01100100, 0) , kRWI_W , 0 , 7 , 2284), // #259
- INST(Pacda , BaseRR , (0b11011010110000010000100000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 9 , 2288), // #260
- INST(Pacdb , BaseRR , (0b11011010110000010000110000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 10 , 2294), // #261
- INST(Pacdza , BaseR , (0b11011010110000010010101111100000, kX, kZR, 0) , kRWI_X , 0 , 4 , 2300), // #262
- INST(Pacdzb , BaseR , (0b11011010110000010010111111100000, kX, kZR, 0) , kRWI_X , 0 , 5 , 2307), // #263
- INST(Pacga , BaseRRR , (0b1001101011000000001100, kX, kZR, kX, kZR, kX, kSP, false) , kRWI_W , 0 , 13 , 2314), // #264
- INST(Pssbb , BaseOp , (0b11010101000000110011010010011111) , 0 , 0 , 14 , 2338), // #265
- INST(Rbit , BaseRR , (0b01011010110000000000000000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 11 , 2364), // #266
- INST(Ret , BaseBranchReg , (0b11010110010111110000000000000000) , kRWI_R , 0 , 2 , 593 ), // #267
- INST(Rev , BaseRev , (_) , kRWI_W , 0 , 0 , 2369), // #268
- INST(Rev16 , BaseRR , (0b01011010110000000000010000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 12 , 2373), // #269
- INST(Rev32 , BaseRR , (0b11011010110000000000100000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 13 , 2379), // #270
- INST(Rev64 , BaseRR , (0b11011010110000000000110000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 14 , 2385), // #271
- INST(Ror , BaseShift , (0b0001101011000000001011, 0b0001001110000000000000, 1) , kRWI_W , 0 , 6 , 2391), // #272
- INST(Rorv , BaseShift , (0b0001101011000000001011, 0b0000000000000000000000, 1) , kRWI_W , 0 , 7 , 2395), // #273
- INST(Sbc , BaseRRR , (0b0101101000000000000000, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 14 , 2498), // #274
- INST(Sbcs , BaseRRR , (0b0111101000000000000000, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 15 , 2502), // #275
- INST(Sbfiz , BaseBfi , (0b00010011000000000000000000000000) , kRWI_W , 0 , 1 , 2507), // #276
- INST(Sbfm , BaseBfm , (0b00010011000000000000000000000000) , kRWI_W , 0 , 1 , 2513), // #277
- INST(Sbfx , BaseBfx , (0b00010011000000000000000000000000) , kRWI_W , 0 , 1 , 2518), // #278
- INST(Sdiv , BaseRRR , (0b0001101011000000000011, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 16 , 2529), // #279
- INST(Setf8 , BaseR , (0b00111010000000000000100000001101, kW, kZR, 5) , 0 , 0 , 6 , 2541), // #280
- INST(Setf16 , BaseR , (0b00111010000000000100100000001101, kW, kZR, 5) , 0 , 0 , 7 , 2534), // #281
- INST(Sev , BaseOp , (0b11010101000000110010000010011111) , 0 , 0 , 15 , 2547), // #282
- INST(Sevl , BaseOp , (0b11010101000000110010000010111111) , 0 , 0 , 16 , 2551), // #283
- INST(Smaddl , BaseRRRR , (0b1001101100100000000000, kX , kZR, kW , kZR, kW , kZR, kX , kZR, false) , kRWI_W , 0 , 2 , 2758), // #284
- INST(Smc , BaseOpImm , (0b11010100000000000000000000000011, 16, 5) , 0 , 0 , 11 , 53 ), // #285
- INST(Smnegl , BaseRRR , (0b1001101100100000111111, kX , kZR, kW , kZR, kW , kZR, false) , kRWI_W , 0 , 17 , 2815), // #286
- INST(Smsubl , BaseRRRR , (0b1001101100100000100000, kX , kZR, kW , kZR, kW , kZR, kX , kZR, false) , kRWI_W , 0 , 3 , 2827), // #287
- INST(Smulh , BaseRRR , (0b1001101101000000011111, kX , kZR, kX , kZR, kX , kZR, true) , kRWI_W , 0 , 18 , 2834), // #288
- INST(Smull , BaseRRR , (0b1001101100100000011111, kX , kZR, kW , kZR, kW , kZR, false) , kRWI_W , 0 , 19 , 2840), // #289
- INST(Ssbb , BaseOp , (0b11010101000000110011000010011111) , 0 , 0 , 17 , 2339), // #290
- INST(St2g , BaseRM_SImm9 , (0b1101100110100000000010, 0b1101100110100000000001, kX, kSP, 0, 4) , kRWI_RW , 0 , 13 , 3164), // #291
- INST(Stadd , BaseAtomicSt , (0b1011100000100000000000, kWX, 30) , kRWI_RX , 0 , 0 , 3177), // #292
- INST(Staddl , BaseAtomicSt , (0b1011100001100000000000, kWX, 30) , kRWI_RX , 0 , 1 , 3197), // #293
- INST(Staddb , BaseAtomicSt , (0b0011100000100000000000, kW , 0 ) , kRWI_RX , 0 , 2 , 3183), // #294
- INST(Staddlb , BaseAtomicSt , (0b0011100001100000000000, kW , 0 ) , kRWI_RX , 0 , 3 , 3204), // #295
- INST(Staddh , BaseAtomicSt , (0b0111100000100000000000, kW , 0 ) , kRWI_RX , 0 , 4 , 3190), // #296
- INST(Staddlh , BaseAtomicSt , (0b0111100001100000000000, kW , 0 ) , kRWI_RX , 0 , 5 , 3212), // #297
- INST(Stclr , BaseAtomicSt , (0b1011100000100000000100, kWX, 30) , kRWI_RX , 0 , 6 , 3220), // #298
- INST(Stclrl , BaseAtomicSt , (0b1011100001100000000100, kWX, 30) , kRWI_RX , 0 , 7 , 3240), // #299
- INST(Stclrb , BaseAtomicSt , (0b0011100000100000000100, kW , 0 ) , kRWI_RX , 0 , 8 , 3226), // #300
- INST(Stclrlb , BaseAtomicSt , (0b0011100001100000000100, kW , 0 ) , kRWI_RX , 0 , 9 , 3247), // #301
- INST(Stclrh , BaseAtomicSt , (0b0111100000100000000100, kW , 0 ) , kRWI_RX , 0 , 10 , 3233), // #302
- INST(Stclrlh , BaseAtomicSt , (0b0111100001100000000100, kW , 0 ) , kRWI_RX , 0 , 11 , 3255), // #303
- INST(Steor , BaseAtomicSt , (0b1011100000100000001000, kWX, 30) , kRWI_RX , 0 , 12 , 3263), // #304
- INST(Steorl , BaseAtomicSt , (0b1011100001100000001000, kWX, 30) , kRWI_RX , 0 , 13 , 3283), // #305
- INST(Steorb , BaseAtomicSt , (0b0011100000100000001000, kW , 0 ) , kRWI_RX , 0 , 14 , 3269), // #306
- INST(Steorlb , BaseAtomicSt , (0b0011100001100000001000, kW , 0 ) , kRWI_RX , 0 , 15 , 3290), // #307
- INST(Steorh , BaseAtomicSt , (0b0111100000100000001000, kW , 0 ) , kRWI_RX , 0 , 16 , 3276), // #308
- INST(Steorlh , BaseAtomicSt , (0b0111100001100000001000, kW , 0 ) , kRWI_RX , 0 , 17 , 3298), // #309
- INST(Stg , BaseRM_SImm9 , (0b1101100100100000000010, 0b1101100100100000000001, kX, kSP, 0, 4) , kRWI_RW , 0 , 14 , 3306), // #310
- INST(Stgm , BaseRM_NoImm , (0b1101100110100000000000, kX , kZR, 0 ) , kRWI_RW , 0 , 13 , 3310), // #311
- INST(Stgp , BaseLdpStp , (0b0110100100, 0b0110100010, kX, 0, 4) , kRWI_RRW , 0 , 3 , 3315), // #312
- INST(Stllr , BaseRM_NoImm , (0b1000100010011111011111, kWX, kZR, 30) , kRWI_RW , 0 , 14 , 3320), // #313
- INST(Stllrb , BaseRM_NoImm , (0b0000100010011111011111, kW , kZR, 0 ) , kRWI_RW , 0 , 15 , 3326), // #314
- INST(Stllrh , BaseRM_NoImm , (0b0100100010011111011111, kW , kZR, 0 ) , kRWI_RW , 0 , 16 , 3333), // #315
- INST(Stlr , BaseRM_NoImm , (0b1000100010011111111111, kWX, kZR, 30) , kRWI_RW , 0 , 17 , 3340), // #316
- INST(Stlrb , BaseRM_NoImm , (0b0000100010011111111111, kW , kZR, 0 ) , kRWI_RW , 0 , 18 , 3345), // #317
- INST(Stlrh , BaseRM_NoImm , (0b0100100010011111111111, kW , kZR, 0 ) , kRWI_RW , 0 , 19 , 3351), // #318
- INST(Stlxp , BaseStxp , (0b1000100000100000100000, kWX, 30) , kRWI_WRRX , 0 , 0 , 3357), // #319
- INST(Stlxr , BaseAtomicOp , (0b1000100000000000111111, kWX, 30, 1) , kRWI_WRX , 0 , 108, 3363), // #320
- INST(Stlxrb , BaseAtomicOp , (0b0000100000000000111111, kW , 0 , 1) , kRWI_WRX , 0 , 109, 3369), // #321
- INST(Stlxrh , BaseAtomicOp , (0b0100100000000000111111, kW , 0 , 1) , kRWI_WRX , 0 , 110, 3376), // #322
- INST(Stnp , BaseLdpStp , (0b0010100000, 0 , kWX, 31, 2) , kRWI_RRW , 0 , 4 , 3383), // #323
- INST(Stp , BaseLdpStp , (0b0010100100, 0b0010100010, kWX, 31, 2) , kRWI_RRW , 0 , 5 , 3388), // #324
- INST(Str , BaseLdSt , (0b1011100100, 0b10111000000, 0b10111000001, 0 , kWX, 30, 2, Inst::kIdStur) , kRWI_RW , 0 , 6 , 3392), // #325
- INST(Strb , BaseLdSt , (0b0011100100, 0b00111000000, 0b00111000001, 0 , kW , 30, 0, Inst::kIdSturb) , kRWI_RW , 0 , 7 , 3396), // #326
- INST(Strh , BaseLdSt , (0b0111100100, 0b01111000000, 0b01111000001, 0 , kWX, 30, 1, Inst::kIdSturh) , kRWI_RW , 0 , 8 , 3401), // #327
- INST(Stset , BaseAtomicSt , (0b1011100000100000001100, kWX, 30) , kRWI_RX , 0 , 18 , 3406), // #328
- INST(Stsetl , BaseAtomicSt , (0b1011100001100000001100, kWX, 30) , kRWI_RX , 0 , 19 , 3426), // #329
- INST(Stsetb , BaseAtomicSt , (0b0011100000100000001100, kW , 0 ) , kRWI_RX , 0 , 20 , 3412), // #330
- INST(Stsetlb , BaseAtomicSt , (0b0011100001100000001100, kW , 0 ) , kRWI_RX , 0 , 21 , 3433), // #331
- INST(Stseth , BaseAtomicSt , (0b0111100000100000001100, kW , 0 ) , kRWI_RX , 0 , 22 , 3419), // #332
- INST(Stsetlh , BaseAtomicSt , (0b0111100001100000001100, kW , 0 ) , kRWI_RX , 0 , 23 , 3441), // #333
- INST(Stsmax , BaseAtomicSt , (0b1011100000100000010000, kWX, 30) , kRWI_RX , 0 , 24 , 3449), // #334
- INST(Stsmaxl , BaseAtomicSt , (0b1011100001100000010000, kWX, 30) , kRWI_RX , 0 , 25 , 3472), // #335
- INST(Stsmaxb , BaseAtomicSt , (0b0011100000100000010000, kW , 0 ) , kRWI_RX , 0 , 26 , 3456), // #336
- INST(Stsmaxlb , BaseAtomicSt , (0b0011100001100000010000, kW , 0 ) , kRWI_RX , 0 , 27 , 3480), // #337
- INST(Stsmaxh , BaseAtomicSt , (0b0111100000100000010000, kW , 0 ) , kRWI_RX , 0 , 28 , 3464), // #338
- INST(Stsmaxlh , BaseAtomicSt , (0b0111100001100000010000, kW , 0 ) , kRWI_RX , 0 , 29 , 3489), // #339
- INST(Stsmin , BaseAtomicSt , (0b1011100000100000010100, kWX, 30) , kRWI_RX , 0 , 30 , 3498), // #340
- INST(Stsminl , BaseAtomicSt , (0b1011100001100000010100, kWX, 30) , kRWI_RX , 0 , 31 , 3521), // #341
- INST(Stsminb , BaseAtomicSt , (0b0011100000100000010100, kW , 0 ) , kRWI_RX , 0 , 32 , 3505), // #342
- INST(Stsminlb , BaseAtomicSt , (0b0011100001100000010100, kW , 0 ) , kRWI_RX , 0 , 33 , 3529), // #343
- INST(Stsminh , BaseAtomicSt , (0b0111100000100000010100, kW , 0 ) , kRWI_RX , 0 , 34 , 3513), // #344
- INST(Stsminlh , BaseAtomicSt , (0b0111100001100000010100, kW , 0 ) , kRWI_RX , 0 , 35 , 3538), // #345
- INST(Sttr , BaseRM_SImm9 , (0b1011100000000000000010, 0b0000000000000000000000, kWX, kZR, 30, 0) , kRWI_RW , 0 , 15 , 3547), // #346
- INST(Sttrb , BaseRM_SImm9 , (0b0011100000000000000010, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_RW , 0 , 16 , 3552), // #347
- INST(Sttrh , BaseRM_SImm9 , (0b0111100000000000000010, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_RW , 0 , 17 , 3558), // #348
- INST(Stumax , BaseAtomicSt , (0b1011100000100000011000, kWX, 30) , kRWI_RX , 0 , 36 , 3564), // #349
- INST(Stumaxl , BaseAtomicSt , (0b1011100001100000011000, kWX, 30) , kRWI_RX , 0 , 37 , 3587), // #350
- INST(Stumaxb , BaseAtomicSt , (0b0011100000100000011000, kW , 0 ) , kRWI_RX , 0 , 38 , 3571), // #351
- INST(Stumaxlb , BaseAtomicSt , (0b0011100001100000011000, kW , 0 ) , kRWI_RX , 0 , 39 , 3595), // #352
- INST(Stumaxh , BaseAtomicSt , (0b0111100000100000011000, kW , 0 ) , kRWI_RX , 0 , 40 , 3579), // #353
- INST(Stumaxlh , BaseAtomicSt , (0b0111100001100000011000, kW , 0 ) , kRWI_RX , 0 , 41 , 3604), // #354
- INST(Stumin , BaseAtomicSt , (0b1011100000100000011100, kWX, 30) , kRWI_RX , 0 , 42 , 3613), // #355
- INST(Stuminl , BaseAtomicSt , (0b1011100001100000011100, kWX, 30) , kRWI_RX , 0 , 43 , 3636), // #356
- INST(Stuminb , BaseAtomicSt , (0b0011100000100000011100, kW , 0 ) , kRWI_RX , 0 , 44 , 3620), // #357
- INST(Stuminlb , BaseAtomicSt , (0b0011100001100000011100, kW , 0 ) , kRWI_RX , 0 , 45 , 3644), // #358
- INST(Stuminh , BaseAtomicSt , (0b0111100000100000011100, kW , 0 ) , kRWI_RX , 0 , 46 , 3628), // #359
- INST(Stuminlh , BaseAtomicSt , (0b0111100001100000011100, kW , 0 ) , kRWI_RX , 0 , 47 , 3653), // #360
- INST(Stur , BaseRM_SImm9 , (0b1011100000000000000000, 0b0000000000000000000000, kWX, kZR, 30, 0) , kRWI_RW , 0 , 18 , 3662), // #361
- INST(Sturb , BaseRM_SImm9 , (0b0011100000000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_RW , 0 , 19 , 3667), // #362
- INST(Sturh , BaseRM_SImm9 , (0b0111100000000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_RW , 0 , 20 , 3673), // #363
- INST(Stxp , BaseStxp , (0b1000100000100000000000, kWX, 30) , kRWI_WRRW , 0 , 1 , 3679), // #364
- INST(Stxr , BaseStx , (0b1000100000000000011111, kWX, 30) , kRWI_WRW , 0 , 0 , 3684), // #365
- INST(Stxrb , BaseStx , (0b0000100000000000011111, kW , 0 ) , kRWI_WRW , 0 , 1 , 3689), // #366
- INST(Stxrh , BaseStx , (0b0100100000000000011111, kW , 0 ) , kRWI_WRW , 0 , 2 , 3695), // #367
- INST(Stz2g , BaseRM_SImm9 , (0b1101100111100000000010, 0b1101100111100000000001, kX , kSP, 0, 4) , kRWI_RW , 0 , 21 , 3701), // #368
- INST(Stzg , BaseRM_SImm9 , (0b1101100101100000000010, 0b1101100101100000000001, kX , kSP, 0, 4) , kRWI_RW , 0 , 22 , 3707), // #369
- INST(Stzgm , BaseRM_NoImm , (0b1101100100100000000000, kX , kZR, 0) , kRWI_RW , 0 , 20 , 3712), // #370
- INST(Sub , BaseAddSub , (0b1001011000, 0b1001011001, 0b1010001) , kRWI_X , 0 , 2 , 985 ), // #371
- INST(Subg , BaseRRII , (0b1101000110000000000000, kX, kSP, kX, kSP, 6, 4, 16, 4, 0, 10) , kRWI_W , 0 , 1 , 3718), // #372
- INST(Subp , BaseRRR , (0b1001101011000000000000, kX, kZR, kX, kSP, kX, kSP, false) , kRWI_W , 0 , 20 , 3723), // #373
- INST(Subps , BaseRRR , (0b1011101011000000000000, kX, kZR, kX, kSP, kX, kSP, false) , kRWI_W , 0 , 21 , 3728), // #374
- INST(Subs , BaseAddSub , (0b1101011000, 0b1101011001, 0b1110001) , kRWI_X , 0 , 3 , 3734), // #375
- INST(Svc , BaseOpImm , (0b11010100000000000000000000000001, 16, 5) , 0 , 0 , 12 , 3752), // #376
- INST(Swp , BaseAtomicOp , (0b1011100000100000100000, kWX, 30, 1) , kRWI_RWX , 0 , 111, 3756), // #377
- INST(Swpa , BaseAtomicOp , (0b1011100010100000100000, kWX, 30, 1) , kRWI_RWX , 0 , 112, 3760), // #378
- INST(Swpab , BaseAtomicOp , (0b0011100010100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 113, 3765), // #379
- INST(Swpah , BaseAtomicOp , (0b0111100010100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 114, 3771), // #380
- INST(Swpal , BaseAtomicOp , (0b1011100011100000100000, kWX, 30, 1) , kRWI_RWX , 0 , 115, 3777), // #381
- INST(Swpalb , BaseAtomicOp , (0b0011100011100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 116, 3783), // #382
- INST(Swpalh , BaseAtomicOp , (0b0111100011100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 117, 3790), // #383
- INST(Swpb , BaseAtomicOp , (0b0011100000100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 118, 3797), // #384
- INST(Swph , BaseAtomicOp , (0b0111100000100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 119, 3802), // #385
- INST(Swpl , BaseAtomicOp , (0b1011100001100000100000, kWX, 30, 1) , kRWI_RWX , 0 , 120, 3807), // #386
- INST(Swplb , BaseAtomicOp , (0b0011100001100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 121, 3812), // #387
- INST(Swplh , BaseAtomicOp , (0b0111100001100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 122, 3818), // #388
- INST(Sxtb , BaseExtend , (0b0001001100000000000111, kWX, 0) , kRWI_W , 0 , 0 , 3824), // #389
- INST(Sxth , BaseExtend , (0b0001001100000000001111, kWX, 0) , kRWI_W , 0 , 1 , 3829), // #390
- INST(Sxtw , BaseExtend , (0b1001001101000000011111, kX , 0) , kRWI_W , 0 , 2 , 3845), // #391
- INST(Sys , BaseSys , (_) , kRWI_W , 0 , 0 , 3850), // #392
- INST(Tlbi , BaseAtDcIcTlbi , (0b00011110000000, 0b00010000000000, false) , kRWI_RX , 0 , 3 , 3871), // #393
- INST(Tst , BaseTst , (0b1101010000, 0b111001000) , kRWI_R , 0 , 0 , 437 ), // #394
- INST(Tbnz , BaseBranchTst , (0b00110111000000000000000000000000) , kRWI_R , 0 , 0 , 3858), // #395
- INST(Tbz , BaseBranchTst , (0b00110110000000000000000000000000) , kRWI_R , 0 , 1 , 3867), // #396
- INST(Ubfiz , BaseBfi , (0b01010011000000000000000000000000) , kRWI_W , 0 , 2 , 3969), // #397
- INST(Ubfm , BaseBfm , (0b01010011000000000000000000000000) , kRWI_W , 0 , 2 , 3975), // #398
- INST(Ubfx , BaseBfx , (0b01010011000000000000000000000000) , kRWI_W , 0 , 2 , 3980), // #399
- INST(Udf , BaseOpImm , (0b00000000000000000000000000000000, 16, 0) , 0 , 0 , 13 , 3991), // #400
- INST(Udiv , BaseRRR , (0b0001101011000000000010, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 22 , 3995), // #401
- INST(Umaddl , BaseRRRR , (0b1001101110100000000000, kX , kZR, kW , kZR, kW , kZR, kX , kZR, false) , kRWI_W , 0 , 4 , 4012), // #402
- INST(Umnegl , BaseRRR , (0b1001101110100000111111, kX , kZR, kW , kZR, kW , kZR, false) , kRWI_W , 0 , 23 , 4075), // #403
- INST(Umull , BaseRRR , (0b1001101110100000011111, kX , kZR, kW , kZR, kW , kZR, false) , kRWI_W , 0 , 24 , 4100), // #404
- INST(Umulh , BaseRRR , (0b1001101111000000011111, kX , kZR, kX , kZR, kX , kZR, false) , kRWI_W , 0 , 25 , 4094), // #405
- INST(Umsubl , BaseRRRR , (0b1001101110100000100000, kX , kZR, kW , kZR, kW , kZR, kX , kZR, false) , kRWI_W , 0 , 5 , 4087), // #406
- INST(Uxtb , BaseExtend , (0b0101001100000000000111, kW, 1) , kRWI_W , 0 , 3 , 4291), // #407
- INST(Uxth , BaseExtend , (0b0101001100000000001111, kW, 1) , kRWI_W , 0 , 4 , 4296), // #408
- INST(Wfe , BaseOp , (0b11010101000000110010000001011111) , 0 , 0 , 18 , 4322), // #409
- INST(Wfi , BaseOp , (0b11010101000000110010000001111111) , 0 , 0 , 19 , 4326), // #410
- INST(Xaflag , BaseOp , (0b11010101000000000100000000111111) , 0 , 0 , 20 , 4330), // #411
- INST(Xpacd , BaseR , (0b11011010110000010100011111100000, kX, kZR, 0) , kRWI_X , 0 , 8 , 4341), // #412
- INST(Xpaci , BaseR , (0b11011010110000010100001111100000, kX, kZR, 0) , kRWI_X , 0 , 9 , 4347), // #413
- INST(Xpaclri , BaseOp , (0b11010101000000110010000011111111) , kRWI_X , 0 , 21 , 4353), // #414
- INST(Yield , BaseOp , (0b11010101000000110010000000111111) , 0 , 0 , 22 , 4361), // #415
- INST(Abs_v , ISimdVV , (0b0000111000100000101110, kVO_V_Any) , kRWI_W , 0 , 0 , 2855), // #416
- INST(Add_v , ISimdVVV , (0b0000111000100000100001, kVO_V_Any) , kRWI_W , 0 , 0 , 978 ), // #417
- INST(Addhn_v , ISimdVVV , (0b0000111000100000010000, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 1 , 2345), // #418
- INST(Addhn2_v , ISimdVVV , (0b0100111000100000010000, kVO_V_B16H8S4) , kRWI_W , F(Narrow) , 2 , 2352), // #419
- INST(Addp_v , ISimdPair , (0b0101111000110001101110, 0b0000111000100000101111, kVO_V_Any) , kRWI_W , F(Pair) , 0 , 638 ), // #420
- INST(Addv_v , ISimdSV , (0b0000111000110001101110, kVO_V_BH_4S) , kRWI_W , 0 , 0 , 20 ), // #421
- INST(Aesd_v , ISimdVVx , (0b0100111000101000010110, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 0 , 34 ), // #422
- INST(Aese_v , ISimdVVx , (0b0100111000101000010010, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 1 , 39 ), // #423
- INST(Aesimc_v , ISimdVVx , (0b0100111000101000011110, kOp_V16B, kOp_V16B) , kRWI_W , 0 , 2 , 44 ), // #424
- INST(Aesmc_v , ISimdVVx , (0b0100111000101000011010, kOp_V16B, kOp_V16B) , kRWI_W , 0 , 3 , 51 ), // #425
- INST(And_v , ISimdVVV , (0b0000111000100000000111, kVO_V_B) , kRWI_W , 0 , 3 , 57 ), // #426
- INST(Bcax_v , ISimdVVVV , (0b1100111000100000000000, kVO_V_B16) , kRWI_W , 0 , 0 , 187 ), // #427
- INST(Bfcvt_v , ISimdVVx , (0b0001111001100011010000, kOp_H, kOp_S) , kRWI_W , 0 , 4 , 196 ), // #428
- INST(Bfcvtn_v , ISimdVVx , (0b0000111010100001011010, kOp_V4H, kOp_V4S) , kRWI_W , F(Narrow) , 5 , 202 ), // #429
- INST(Bfcvtn2_v , ISimdVVx , (0b0100111010100001011010, kOp_V8H, kOp_V4S) , kRWI_W , F(Narrow) , 6 , 209 ), // #430
- INST(Bfdot_v , SimdDot , (0b0010111001000000111111, 0b0000111101000000111100, kET_S, kET_H, kET_2H) , kRWI_X , 0 , 0 , 217 ), // #431
- INST(Bfmlalb_v , SimdFmlal , (0b0010111011000000111111, 0b0000111111000000111100, 0, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 0 , 227 ), // #432
- INST(Bfmlalt_v , SimdFmlal , (0b0110111011000000111111, 0b0100111111000000111100, 0, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 1 , 235 ), // #433
- INST(Bfmmla_v , ISimdVVVx , (0b0110111001000000111011, kOp_V4S, kOp_V8H, kOp_V8H) , kRWI_X , F(Long) , 0 , 243 ), // #434
- INST(Bic_v , SimdBicOrr , (0b0000111001100000000111, 0b0010111100000000000001) , kRWI_W , 0 , 0 , 256 ), // #435
- INST(Bif_v , ISimdVVV , (0b0010111011100000000111, kVO_V_B) , kRWI_X , 0 , 4 , 265 ), // #436
- INST(Bit_v , ISimdVVV , (0b0010111010100000000111, kVO_V_B) , kRWI_X , 0 , 5 , 2365), // #437
- INST(Bsl_v , ISimdVVV , (0b0010111001100000000111, kVO_V_B) , kRWI_X , 0 , 6 , 280 ), // #438
- INST(Cls_v , ISimdVV , (0b0000111000100000010010, kVO_V_BHS) , kRWI_W , 0 , 1 , 412 ), // #439
- INST(Clz_v , ISimdVV , (0b0010111000100000010010, kVO_V_BHS) , kRWI_W , 0 , 2 , 416 ), // #440
- INST(Cmeq_v , SimdCmp , (0b0010111000100000100011, 0b0000111000100000100110, kVO_V_Any) , kRWI_W , 0 , 0 , 663 ), // #441
- INST(Cmge_v , SimdCmp , (0b0000111000100000001111, 0b0010111000100000100010, kVO_V_Any) , kRWI_W , 0 , 1 , 669 ), // #442
- INST(Cmgt_v , SimdCmp , (0b0000111000100000001101, 0b0000111000100000100010, kVO_V_Any) , kRWI_W , 0 , 2 , 675 ), // #443
- INST(Cmhi_v , SimdCmp , (0b0010111000100000001101, 0b0000000000000000000000, kVO_V_Any) , kRWI_W , 0 , 3 , 420 ), // #444
- INST(Cmhs_v , SimdCmp , (0b0010111000100000001111, 0b0000000000000000000000, kVO_V_Any) , kRWI_W , 0 , 4 , 425 ), // #445
- INST(Cmle_v , SimdCmp , (0b0000000000000000000000, 0b0010111000100000100110, kVO_V_Any) , kRWI_W , 0 , 5 , 687 ), // #446
- INST(Cmlt_v , SimdCmp , (0b0000000000000000000000, 0b0000111000100000101010, kVO_V_Any) , kRWI_W , 0 , 6 , 693 ), // #447
- INST(Cmtst_v , ISimdVVV , (0b0000111000100000100011, kVO_V_Any) , kRWI_W , 0 , 7 , 435 ), // #448
- INST(Cnt_v , ISimdVV , (0b0000111000100000010110, kVO_V_B) , kRWI_W , 0 , 3 , 446 ), // #449
- INST(Dup_v , SimdDup , (_) , kRWI_W , 0 , 0 , 579 ), // #450
- INST(Eor_v , ISimdVVV , (0b0010111000100000000111, kVO_V_B) , kRWI_W , 0 , 8 , 1418), // #451
- INST(Eor3_v , ISimdVVVV , (0b1100111000000000000000, kVO_V_B16) , kRWI_W , 0 , 1 , 587 ), // #452
- INST(Ext_v , ISimdVVVI , (0b0010111000000000000000, kVO_V_B, 4, 11, 1) , kRWI_W , 0 , 0 , 601 ), // #453
- INST(Fabd_v , FSimdVVV , (0b0111111010100000110101, kHF_C, 0b0010111010100000110101, kHF_C) , kRWI_W , 0 , 0 , 610 ), // #454
- INST(Fabs_v , FSimdVV , (0b0001111000100000110000, kHF_A, 0b0000111010100000111110, kHF_B) , kRWI_W , 0 , 0 , 615 ), // #455
- INST(Facge_v , FSimdVVV , (0b0111111000100000111011, kHF_C, 0b0010111000100000111011, kHF_C) , kRWI_W , 0 , 1 , 620 ), // #456
- INST(Facgt_v , FSimdVVV , (0b0111111010100000111011, kHF_C, 0b0010111010100000111011, kHF_C) , kRWI_W , 0 , 2 , 626 ), // #457
- INST(Fadd_v , FSimdVVV , (0b0001111000100000001010, kHF_A, 0b0000111000100000110101, kHF_C) , kRWI_W , 0 , 3 , 632 ), // #458
- INST(Faddp_v , FSimdPair , (0b0111111000110000110110, 0b0010111000100000110101) , kRWI_W , 0 , 0 , 637 ), // #459
- INST(Fcadd_v , SimdFcadd , (0b0010111000000000111001) , kRWI_W , 0 , 0 , 643 ), // #460
- INST(Fccmp_v , SimdFccmpFccmpe , (0b00011110001000000000010000000000) , kRWI_R , 0 , 0 , 649 ), // #461
- INST(Fccmpe_v , SimdFccmpFccmpe , (0b00011110001000000000010000010000) , kRWI_R , 0 , 1 , 655 ), // #462
- INST(Fcmeq_v , SimdFcm , (0b0000111000100000111001, kHF_C, 0b0000111010100000110110) , kRWI_W , 0 , 0 , 662 ), // #463
- INST(Fcmge_v , SimdFcm , (0b0010111000100000111001, kHF_C, 0b0010111010100000110010) , kRWI_W , 0 , 1 , 668 ), // #464
- INST(Fcmgt_v , SimdFcm , (0b0010111010100000111001, kHF_C, 0b0000111010100000110010) , kRWI_W , 0 , 2 , 674 ), // #465
- INST(Fcmla_v , SimdFcmla , (0b0010111000000000110001, 0b0010111100000000000100) , kRWI_X , 0 , 0 , 680 ), // #466
- INST(Fcmle_v , SimdFcm , (0b0000000000000000000000, kHF_C, 0b0010111010100000110110) , kRWI_W , 0 , 3 , 686 ), // #467
- INST(Fcmlt_v , SimdFcm , (0b0000000000000000000000, kHF_C, 0b0000111010100000111010) , kRWI_W , 0 , 4 , 692 ), // #468
- INST(Fcmp_v , SimdFcmpFcmpe , (0b00011110001000000010000000000000) , kRWI_R , 0 , 0 , 698 ), // #469
- INST(Fcmpe_v , SimdFcmpFcmpe , (0b00011110001000000010000000010000) , kRWI_R , 0 , 1 , 703 ), // #470
- INST(Fcsel_v , SimdFcsel , (_) , kRWI_W , 0 , 0 , 709 ), // #471
- INST(Fcvt_v , SimdFcvt , (_) , kRWI_W , 0 , 0 , 197 ), // #472
- INST(Fcvtas_v , SimdFcvtSV , (0b0000111000100001110010, 0b0000000000000000000000, 0b0001111000100100000000, 1) , kRWI_W , 0 , 0 , 715 ), // #473
- INST(Fcvtau_v , SimdFcvtSV , (0b0010111000100001110010, 0b0000000000000000000000, 0b0001111000100101000000, 1) , kRWI_W , 0 , 1 , 722 ), // #474
- INST(Fcvtl_v , SimdFcvtLN , (0b0000111000100001011110, 0, 0) , kRWI_W , F(Long) , 0 , 729 ), // #475
- INST(Fcvtl2_v , SimdFcvtLN , (0b0100111000100001011110, 0, 0) , kRWI_W , F(Long) , 1 , 735 ), // #476
- INST(Fcvtms_v , SimdFcvtSV , (0b0000111000100001101110, 0b0000000000000000000000, 0b0001111000110000000000, 1) , kRWI_W , 0 , 2 , 742 ), // #477
- INST(Fcvtmu_v , SimdFcvtSV , (0b0010111000100001101110, 0b0000000000000000000000, 0b0001111000110001000000, 1) , kRWI_W , 0 , 3 , 749 ), // #478
- INST(Fcvtn_v , SimdFcvtLN , (0b0000111000100001011010, 0, 0) , kRWI_W , F(Narrow) , 2 , 203 ), // #479
- INST(Fcvtn2_v , SimdFcvtLN , (0b0100111000100001011010, 0, 0) , kRWI_X , F(Narrow) , 3 , 210 ), // #480
- INST(Fcvtns_v , SimdFcvtSV , (0b0000111000100001101010, 0b0000000000000000000000, 0b0001111000100000000000, 1) , kRWI_W , 0 , 4 , 756 ), // #481
- INST(Fcvtnu_v , SimdFcvtSV , (0b0010111000100001101010, 0b0000000000000000000000, 0b0001111000100001000000, 1) , kRWI_W , 0 , 5 , 763 ), // #482
- INST(Fcvtps_v , SimdFcvtSV , (0b0000111010100001101010, 0b0000000000000000000000, 0b0001111000101000000000, 1) , kRWI_W , 0 , 6 , 770 ), // #483
- INST(Fcvtpu_v , SimdFcvtSV , (0b0010111010100001101010, 0b0000000000000000000000, 0b0001111000101001000000, 1) , kRWI_W , 0 , 7 , 777 ), // #484
- INST(Fcvtxn_v , SimdFcvtLN , (0b0010111000100001011010, 1, 1) , kRWI_W , F(Narrow) , 4 , 784 ), // #485
- INST(Fcvtxn2_v , SimdFcvtLN , (0b0110111000100001011010, 1, 0) , kRWI_X , F(Narrow) , 5 , 791 ), // #486
- INST(Fcvtzs_v , SimdFcvtSV , (0b0000111010100001101110, 0b0000111100000000111111, 0b0001111000111000000000, 1) , kRWI_W , 0 , 8 , 799 ), // #487
- INST(Fcvtzu_v , SimdFcvtSV , (0b0010111010100001101110, 0b0010111100000000111111, 0b0001111000111001000000, 1) , kRWI_W , 0 , 9 , 806 ), // #488
- INST(Fdiv_v , FSimdVVV , (0b0001111000100000000110, kHF_A, 0b0010111000100000111111, kHF_C) , kRWI_W , 0 , 4 , 813 ), // #489
- INST(Fjcvtzs_v , ISimdVVx , (0b0001111001111110000000, kOp_GpW, kOp_D) , kRWI_W , 0 , 7 , 818 ), // #490
- INST(Fmadd_v , FSimdVVVV , (0b0001111100000000000000, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 0 , 826 ), // #491
- INST(Fmax_v , FSimdVVV , (0b0001111000100000010010, kHF_A, 0b0000111000100000111101, kHF_C) , kRWI_W , 0 , 5 , 832 ), // #492
- INST(Fmaxnm_v , FSimdVVV , (0b0001111000100000011010, kHF_A, 0b0000111000100000110001, kHF_C) , kRWI_W , 0 , 6 , 837 ), // #493
- INST(Fmaxnmp_v , FSimdPair , (0b0111111000110000110010, 0b0010111000100000110001) , kRWI_W , 0 , 1 , 844 ), // #494
- INST(Fmaxnmv_v , FSimdSV , (0b0010111000110000110010) , kRWI_W , 0 , 0 , 852 ), // #495
- INST(Fmaxp_v , FSimdPair , (0b0111111000110000111110, 0b0010111000100000111101) , kRWI_W , 0 , 2 , 860 ), // #496
- INST(Fmaxv_v , FSimdSV , (0b0010111000110000111110) , kRWI_W , 0 , 1 , 866 ), // #497
- INST(Fmin_v , FSimdVVV , (0b0001111000100000010110, kHF_A, 0b0000111010100000111101, kHF_C) , kRWI_W , 0 , 7 , 872 ), // #498
- INST(Fminnm_v , FSimdVVV , (0b0001111000100000011110, kHF_A, 0b0000111010100000110001, kHF_C) , kRWI_W , 0 , 8 , 877 ), // #499
- INST(Fminnmp_v , FSimdPair , (0b0111111010110000110010, 0b0010111010100000110001) , kRWI_W , 0 , 3 , 884 ), // #500
- INST(Fminnmv_v , FSimdSV , (0b0010111010110000110010) , kRWI_W , 0 , 2 , 892 ), // #501
- INST(Fminp_v , FSimdPair , (0b0111111010110000111110, 0b0010111010100000111101) , kRWI_W , 0 , 4 , 900 ), // #502
- INST(Fminv_v , FSimdSV , (0b0010111010110000111110) , kRWI_W , 0 , 3 , 906 ), // #503
- INST(Fmla_v , FSimdVVVe , (0b0000000000000000000000, kHF_N, 0b0000111000100000110011, 0b0000111110000000000100) , kRWI_X , F(VH0_15) , 0 , 912 ), // #504
- INST(Fmlal_v , SimdFmlal , (0b0000111000100000111011, 0b0000111110000000000000, 1, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 2 , 917 ), // #505
- INST(Fmlal2_v , SimdFmlal , (0b0010111000100000110011, 0b0010111110000000100000, 1, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 3 , 923 ), // #506
- INST(Fmls_v , FSimdVVVe , (0b0000000000000000000000, kHF_N, 0b0000111010100000110011, 0b0000111110000000010100) , kRWI_X , F(VH0_15) , 1 , 930 ), // #507
- INST(Fmlsl_v , SimdFmlal , (0b0000111010100000111011, 0b0000111110000000010000, 1, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 4 , 935 ), // #508
- INST(Fmlsl2_v , SimdFmlal , (0b0010111010100000110011, 0b0010111110000000110000, 1, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 5 , 941 ), // #509
- INST(Fmov_v , SimdFmov , (_) , kRWI_W , 0 , 0 , 948 ), // #510
- INST(Fmsub_v , FSimdVVVV , (0b0001111100000000100000, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 1 , 953 ), // #511
- INST(Fmul_v , FSimdVVVe , (0b0001111000100000000010, kHF_A, 0b0010111000100000110111, 0b0000111110000000100100) , kRWI_W , F(VH0_15) , 2 , 959 ), // #512
- INST(Fmulx_v , FSimdVVVe , (0b0101111000100000110111, kHF_C, 0b0000111000100000110111, 0b0010111110000000100100) , kRWI_W , F(VH0_15) , 3 , 964 ), // #513
- INST(Fneg_v , FSimdVV , (0b0001111000100001010000, kHF_A, 0b0010111010100000111110, kHF_B) , kRWI_W , 0 , 1 , 970 ), // #514
- INST(Fnmadd_v , FSimdVVVV , (0b0001111100100000000000, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 2 , 975 ), // #515
- INST(Fnmsub_v , FSimdVVVV , (0b0001111100100000100000, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 3 , 982 ), // #516
- INST(Fnmul_v , FSimdVVV , (0b0001111000100000100010, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 9 , 989 ), // #517
- INST(Frecpe_v , FSimdVV , (0b0101111010100001110110, kHF_B, 0b0000111010100001110110, kHF_B) , kRWI_W , 0 , 2 , 995 ), // #518
- INST(Frecps_v , FSimdVVV , (0b0101111000100000111111, kHF_C, 0b0000111000100000111111, kHF_C) , kRWI_W , 0 , 10 , 1002), // #519
- INST(Frecpx_v , FSimdVV , (0b0101111010100001111110, kHF_B, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 3 , 1009), // #520
- INST(Frint32x_v , FSimdVV , (0b0001111000101000110000, kHF_N, 0b0010111000100001111010, kHF_N) , kRWI_W , 0 , 4 , 1016), // #521
- INST(Frint32z_v , FSimdVV , (0b0001111000101000010000, kHF_N, 0b0000111000100001111010, kHF_N) , kRWI_W , 0 , 5 , 1025), // #522
- INST(Frint64x_v , FSimdVV , (0b0001111000101001110000, kHF_N, 0b0010111000100001111110, kHF_N) , kRWI_W , 0 , 6 , 1034), // #523
- INST(Frint64z_v , FSimdVV , (0b0001111000101001010000, kHF_N, 0b0000111000100001111110, kHF_N) , kRWI_W , 0 , 7 , 1043), // #524
- INST(Frinta_v , FSimdVV , (0b0001111000100110010000, kHF_A, 0b0010111000100001100010, kHF_B) , kRWI_W , 0 , 8 , 1052), // #525
- INST(Frinti_v , FSimdVV , (0b0001111000100111110000, kHF_A, 0b0010111010100001100110, kHF_B) , kRWI_W , 0 , 9 , 1059), // #526
- INST(Frintm_v , FSimdVV , (0b0001111000100101010000, kHF_A, 0b0000111000100001100110, kHF_B) , kRWI_W , 0 , 10 , 1066), // #527
- INST(Frintn_v , FSimdVV , (0b0001111000100100010000, kHF_A, 0b0000111000100001100010, kHF_B) , kRWI_W , 0 , 11 , 1073), // #528
- INST(Frintp_v , FSimdVV , (0b0001111000100100110000, kHF_A, 0b0000111010100001100010, kHF_B) , kRWI_W , 0 , 12 , 1080), // #529
- INST(Frintx_v , FSimdVV , (0b0001111000100111010000, kHF_A, 0b0010111000100001100110, kHF_B) , kRWI_W , 0 , 13 , 1087), // #530
- INST(Frintz_v , FSimdVV , (0b0001111000100101110000, kHF_A, 0b0000111010100001100110, kHF_B) , kRWI_W , 0 , 14 , 1094), // #531
- INST(Frsqrte_v , FSimdVV , (0b0111111010100001110110, kHF_B, 0b0010111010100001110110, kHF_B) , kRWI_W , 0 , 15 , 1101), // #532
- INST(Frsqrts_v , FSimdVVV , (0b0101111010100000111111, kHF_C, 0b0000111010100000111111, kHF_C) , kRWI_W , 0 , 11 , 1109), // #533
- INST(Fsqrt_v , FSimdVV , (0b0001111000100001110000, kHF_A, 0b0010111010100001111110, kHF_B) , kRWI_W , 0 , 16 , 1117), // #534
- INST(Fsub_v , FSimdVVV , (0b0001111000100000001110, kHF_A, 0b0000111010100000110101, kHF_C) , kRWI_W , 0 , 12 , 1123), // #535
- INST(Ins_v , SimdIns , (_) , kRWI_X , 0 , 0 , 1145), // #536
- INST(Ld1_v , SimdLdNStN , (0b0000110101000000000000, 0b0000110001000000001000, 1, 0) , kRWI_LDn , F(Consecutive) , 0 , 1153), // #537
- INST(Ld1r_v , SimdLdNStN , (0b0000110101000000110000, 0b0000000000000000000000, 1, 1) , kRWI_LDn , F(Consecutive) , 1 , 1157), // #538
- INST(Ld2_v , SimdLdNStN , (0b0000110101100000000000, 0b0000110001000000100000, 2, 0) , kRWI_LDn , F(Consecutive) , 2 , 1162), // #539
- INST(Ld2r_v , SimdLdNStN , (0b0000110101100000110000, 0b0000000000000000000000, 2, 1) , kRWI_LDn , F(Consecutive) , 3 , 1166), // #540
- INST(Ld3_v , SimdLdNStN , (0b0000110101000000001000, 0b0000110001000000010000, 3, 0) , kRWI_LDn , F(Consecutive) , 4 , 1171), // #541
- INST(Ld3r_v , SimdLdNStN , (0b0000110101000000111000, 0b0000000000000000000000, 3, 1) , kRWI_LDn , F(Consecutive) , 5 , 1175), // #542
- INST(Ld4_v , SimdLdNStN , (0b0000110101100000001000, 0b0000110001000000000000, 4, 0) , kRWI_LDn , F(Consecutive) , 6 , 1180), // #543
- INST(Ld4r_v , SimdLdNStN , (0b0000110101100000111000, 0b0000000000000000000000, 4, 1) , kRWI_LDn , F(Consecutive) , 7 , 1184), // #544
- INST(Ldnp_v , SimdLdpStp , (0b0010110001, 0b0000000000) , kRWI_WW , 0 , 0 , 1537), // #545
- INST(Ldp_v , SimdLdpStp , (0b0010110101, 0b0010110011) , kRWI_WW , 0 , 1 , 1542), // #546
- INST(Ldr_v , SimdLdSt , (0b0011110101, 0b00111100010, 0b00111100011, 0b00011100, Inst::kIdLdur_v) , kRWI_W , 0 , 0 , 1552), // #547
- INST(Ldur_v , SimdLdurStur , (0b0011110001000000000000) , kRWI_W , 0 , 0 , 2142), // #548
- INST(Mla_v , ISimdVVVe , (0b0000111000100000100101, kVO_V_BHS, 0b0010111100000000000000, kVO_V_HS) , kRWI_X , F(VH0_15) , 0 , 246 ), // #549
- INST(Mls_v , ISimdVVVe , (0b0010111000100000100101, kVO_V_BHS, 0b0010111100000000010000, kVO_V_HS) , kRWI_X , F(VH0_15) , 1 , 931 ), // #550
- INST(Mov_v , SimdMov , (_) , kRWI_W , 0 , 0 , 949 ), // #551
- INST(Movi_v , SimdMoviMvni , (0b0000111100000000000001, 0) , kRWI_W , 0 , 0 , 2221), // #552
- INST(Mul_v , ISimdVVVe , (0b0000111000100000100111, kVO_V_BHS, 0b0000111100000000100000, kVO_V_HS) , kRWI_W , F(VH0_15) , 2 , 991 ), // #553
- INST(Mvn_v , ISimdVV , (0b0010111000100000010110, kVO_V_B) , kRWI_W , 0 , 4 , 2249), // #554
- INST(Mvni_v , SimdMoviMvni , (0b0000111100000000000001, 1) , kRWI_W , 0 , 1 , 2253), // #555
- INST(Neg_v , ISimdVV , (0b0010111000100000101110, kVO_V_Any) , kRWI_W , 0 , 5 , 540 ), // #556
- INST(Not_v , ISimdVV , (0b0010111000100000010110, kVO_V_B) , kRWI_W , 0 , 6 , 2276), // #557
- INST(Orn_v , ISimdVVV , (0b0000111011100000000111, kVO_V_B) , kRWI_W , 0 , 9 , 2280), // #558
- INST(Orr_v , SimdBicOrr , (0b0000111010100000000111, 0b0000111100000000000001) , kRWI_W , 0 , 1 , 2284), // #559
- INST(Pmul_v , ISimdVVV , (0b0010111000100000100111, kVO_V_B) , kRWI_W , 0 , 10 , 2320), // #560
- INST(Pmull_v , ISimdVVV , (0b0000111000100000111000, kVO_V_B8D1) , kRWI_W , F(Long) , 11 , 2325), // #561
- INST(Pmull2_v , ISimdVVV , (0b0100111000100000111000, kVO_V_B16D2) , kRWI_W , F(Long) , 12 , 2331), // #562
- INST(Raddhn_v , ISimdVVV , (0b0010111000100000010000, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 13 , 2344), // #563
- INST(Raddhn2_v , ISimdVVV , (0b0110111000100000010000, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 14 , 2351), // #564
- INST(Rax1_v , ISimdVVV , (0b1100111001100000100011, kVO_V_D2) , kRWI_W , 0 , 15 , 2359), // #565
- INST(Rbit_v , ISimdVV , (0b0010111001100000010110, kVO_V_B) , kRWI_W , 0 , 7 , 2364), // #566
- INST(Rev16_v , ISimdVV , (0b0000111000100000000110, kVO_V_B) , kRWI_W , 0 , 8 , 2373), // #567
- INST(Rev32_v , ISimdVV , (0b0010111000100000000010, kVO_V_BH) , kRWI_W , 0 , 9 , 2379), // #568
- INST(Rev64_v , ISimdVV , (0b0000111000100000000010, kVO_V_BHS) , kRWI_W , 0 , 10 , 2385), // #569
- INST(Rshrn_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000100011, 1, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 0 , 2960), // #570
- INST(Rshrn2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000100011, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 1 , 2968), // #571
- INST(Rsubhn_v , ISimdVVV , (0b0010111000100000011000, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 16 , 2400), // #572
- INST(Rsubhn2_v , ISimdVVV , (0b0110111000100000011000, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 17 , 2407), // #573
- INST(Saba_v , ISimdVVV , (0b0000111000100000011111, kVO_V_BHS) , kRWI_X , 0 , 18 , 2415), // #574
- INST(Sabal_v , ISimdVVV , (0b0000111000100000010100, kVO_V_B8H4S2) , kRWI_X , F(Long) , 19 , 2420), // #575
- INST(Sabal2_v , ISimdVVV , (0b0100111000100000010100, kVO_V_B16H8S4) , kRWI_X , F(Long) , 20 , 2426), // #576
- INST(Sabd_v , ISimdVVV , (0b0000111000100000011101, kVO_V_BHS) , kRWI_W , 0 , 21 , 2433), // #577
- INST(Sabdl_v , ISimdVVV , (0b0000111000100000011100, kVO_V_B8H4S2) , kRWI_W , F(Long) , 22 , 2438), // #578
- INST(Sabdl2_v , ISimdVVV , (0b0100111000100000011100, kVO_V_B16H8S4) , kRWI_W , F(Long) , 23 , 2444), // #579
- INST(Sadalp_v , ISimdVV , (0b0000111000100000011010, kVO_V_BHS) , kRWI_X , F(Long) | F(Pair) , 11 , 2451), // #580
- INST(Saddl_v , ISimdVVV , (0b0000111000100000000000, kVO_V_B8H4S2) , kRWI_W , F(Long) , 24 , 2458), // #581
- INST(Saddl2_v , ISimdVVV , (0b0100111000100000000000, kVO_V_B16H8S4) , kRWI_W , F(Long) , 25 , 2464), // #582
- INST(Saddlp_v , ISimdVV , (0b0000111000100000001010, kVO_V_BHS) , kRWI_W , F(Long) | F(Pair) , 12 , 2471), // #583
- INST(Saddlv_v , ISimdSV , (0b0000111000110000001110, kVO_V_BH_4S) , kRWI_W , F(Long) , 1 , 2478), // #584
- INST(Saddw_v , ISimdWWV , (0b0000111000100000000100, kVO_V_B8H4S2) , kRWI_W , 0 , 0 , 2485), // #585
- INST(Saddw2_v , ISimdWWV , (0b0000111000100000000100, kVO_V_B16H8S4) , kRWI_W , 0 , 1 , 2491), // #586
- INST(Scvtf_v , SimdFcvtSV , (0b0000111000100001110110, 0b0000111100000000111001, 0b0001111000100010000000, 0) , kRWI_W , 0 , 10 , 2523), // #587
- INST(Sdot_v , SimdDot , (0b0000111010000000100101, 0b0000111110000000111000, kET_S, kET_B, kET_4B) , kRWI_X , 0 , 1 , 4218), // #588
- INST(Sha1c_v , ISimdVVVx , (0b0101111000000000000000, kOp_Q, kOp_S, kOp_V4S) , kRWI_X , 0 , 1 , 2556), // #589
- INST(Sha1h_v , ISimdVVx , (0b0101111000101000000010, kOp_S, kOp_S) , kRWI_W , 0 , 8 , 2562), // #590
- INST(Sha1m_v , ISimdVVVx , (0b0101111000000000001000, kOp_Q, kOp_S, kOp_V4S) , kRWI_X , 0 , 2 , 2568), // #591
- INST(Sha1p_v , ISimdVVVx , (0b0101111000000000000100, kOp_Q, kOp_S, kOp_V4S) , kRWI_X , 0 , 3 , 2574), // #592
- INST(Sha1su0_v , ISimdVVVx , (0b0101111000000000001100, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 4 , 2580), // #593
- INST(Sha1su1_v , ISimdVVx , (0b0101111000101000000110, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 9 , 2588), // #594
- INST(Sha256h_v , ISimdVVVx , (0b0101111000000000010000, kOp_Q, kOp_Q, kOp_V4S) , kRWI_X , 0 , 5 , 2596), // #595
- INST(Sha256h2_v , ISimdVVVx , (0b0101111000000000010100, kOp_Q, kOp_Q, kOp_V4S) , kRWI_X , 0 , 6 , 2604), // #596
- INST(Sha256su0_v , ISimdVVx , (0b0101111000101000001010, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 10 , 2613), // #597
- INST(Sha256su1_v , ISimdVVVx , (0b0101111000000000011000, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 7 , 2623), // #598
- INST(Sha512h_v , ISimdVVVx , (0b1100111001100000100000, kOp_Q, kOp_Q, kOp_V2D) , kRWI_X , 0 , 8 , 2633), // #599
- INST(Sha512h2_v , ISimdVVVx , (0b1100111001100000100001, kOp_Q, kOp_Q, kOp_V2D) , kRWI_X , 0 , 9 , 2641), // #600
- INST(Sha512su0_v , ISimdVVx , (0b1100111011000000100000, kOp_V2D, kOp_V2D) , kRWI_X , 0 , 11 , 2650), // #601
- INST(Sha512su1_v , ISimdVVVx , (0b1100111001100000100010, kOp_V2D, kOp_V2D, kOp_V2D) , kRWI_X , 0 , 10 , 2660), // #602
- INST(Shadd_v , ISimdVVV , (0b0000111000100000000001, kVO_V_BHS) , kRWI_W , 0 , 26 , 2670), // #603
- INST(Shl_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000010101, 0, kVO_V_Any) , kRWI_W , 0 , 2 , 2954), // #604
- INST(Shll_v , SimdShiftES , (0b0010111000100001001110, kVO_V_B8H4S2) , kRWI_W , F(Long) , 0 , 3108), // #605
- INST(Shll2_v , SimdShiftES , (0b0110111000100001001110, kVO_V_B16H8S4) , kRWI_W , F(Long) , 1 , 3114), // #606
- INST(Shrn_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000100001, 1, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 3 , 2961), // #607
- INST(Shrn2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000100001, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 4 , 2969), // #608
- INST(Shsub_v , ISimdVVV , (0b0000111000100000001001, kVO_V_BHS) , kRWI_W , 0 , 27 , 2676), // #609
- INST(Sli_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000010101, 0, kVO_V_Any) , kRWI_X , 0 , 5 , 2682), // #610
- INST(Sm3partw1_v , ISimdVVVx , (0b1100111001100000110000, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 11 , 2686), // #611
- INST(Sm3partw2_v , ISimdVVVx , (0b1100111001100000110001, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 12 , 2696), // #612
- INST(Sm3ss1_v , ISimdVVVVx , (0b1100111001000000000000, kOp_V4S, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_W , 0 , 0 , 2706), // #613
- INST(Sm3tt1a_v , SimdSm3tt , (0b1100111001000000100000) , kRWI_X , 0 , 0 , 2713), // #614
- INST(Sm3tt1b_v , SimdSm3tt , (0b1100111001000000100001) , kRWI_X , 0 , 1 , 2721), // #615
- INST(Sm3tt2a_v , SimdSm3tt , (0b1100111001000000100010) , kRWI_X , 0 , 2 , 2729), // #616
- INST(Sm3tt2b_v , SimdSm3tt , (0b1100111001000000100011) , kRWI_X , 0 , 3 , 2737), // #617
- INST(Sm4e_v , ISimdVVx , (0b1100111011000000100001, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 12 , 2745), // #618
- INST(Sm4ekey_v , ISimdVVVx , (0b1100111001100000110010, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 13 , 2750), // #619
- INST(Smax_v , ISimdVVV , (0b0000111000100000011001, kVO_V_BHS) , kRWI_W , 0 , 28 , 1690), // #620
- INST(Smaxp_v , ISimdVVV , (0b0000111000100000101001, kVO_V_BHS) , kRWI_W , 0 , 29 , 2765), // #621
- INST(Smaxv_v , ISimdSV , (0b0000111000110000101010, kVO_V_BH_4S) , kRWI_W , 0 , 2 , 2771), // #622
- INST(Smin_v , ISimdVVV , (0b0000111000100000011011, kVO_V_BHS) , kRWI_W , 0 , 30 , 1794), // #623
- INST(Sminp_v , ISimdVVV , (0b0000111000100000101011, kVO_V_BHS) , kRWI_W , 0 , 31 , 2777), // #624
- INST(Sminv_v , ISimdSV , (0b0000111000110001101010, kVO_V_BH_4S) , kRWI_W , 0 , 3 , 2783), // #625
- INST(Smlal_v , ISimdVVVe , (0b0000111000100000100000, kVO_V_B8H4S2, 0b0000111100000000001000, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 3 , 2789), // #626
- INST(Smlal2_v , ISimdVVVe , (0b0100111000100000100000, kVO_V_B16H8S4, 0b0100111100000000001000, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 4 , 2795), // #627
- INST(Smlsl_v , ISimdVVVe , (0b0000111000100000101000, kVO_V_B8H4S2, 0b0000111100000000011000, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 5 , 2802), // #628
- INST(Smlsl2_v , ISimdVVVe , (0b0100111000100000101000, kVO_V_B16H8S4, 0b0100111100000000011000, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 6 , 2808), // #629
- INST(Smmla_v , ISimdVVVx , (0b0100111010000000101001, kOp_V4S, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 14 , 4247), // #630
- INST(Smov_v , SimdSmovUmov , (0b0000111000000000001011, kVO_V_BHS, 1) , kRWI_W , 0 , 0 , 2822), // #631
- INST(Smull_v , ISimdVVVe , (0b0000111000100000110000, kVO_V_B8H4S2, 0b0000111100000000101000, kVO_V_H4S2) , kRWI_W , F(Long) | F(VH0_15) , 7 , 2840), // #632
- INST(Smull2_v , ISimdVVVe , (0b0100111000100000110000, kVO_V_B16H8S4, 0b0100111100000000101000, kVO_V_H8S4) , kRWI_W , F(Long) | F(VH0_15) , 8 , 2846), // #633
- INST(Sqabs_v , ISimdVV , (0b0000111000100000011110, kVO_SV_Any) , kRWI_W , 0 , 13 , 2853), // #634
- INST(Sqadd_v , ISimdVVV , (0b0000111000100000000011, kVO_SV_Any) , kRWI_W , 0 , 32 , 4254), // #635
- INST(Sqdmlal_v , ISimdVVVe , (0b0000111000100000100100, kVO_SV_BHS, 0b0000111100000000001100, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 9 , 2859), // #636
- INST(Sqdmlal2_v , ISimdVVVe , (0b0100111000100000100100, kVO_V_B16H8S4, 0b0100111100000000001100, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 10 , 2867), // #637
- INST(Sqdmlsl_v , ISimdVVVe , (0b0000111000100000101100, kVO_SV_BHS, 0b0000111100000000011100, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 11 , 2876), // #638
- INST(Sqdmlsl2_v , ISimdVVVe , (0b0100111000100000101100, kVO_V_B16H8S4, 0b0100111100000000011100, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 12 , 2884), // #639
- INST(Sqdmulh_v , ISimdVVVe , (0b0000111000100000101101, kVO_SV_HS, 0b0000111100000000110000, kVO_SV_HS) , kRWI_W , F(VH0_15) , 13 , 2893), // #640
- INST(Sqdmull_v , ISimdVVVe , (0b0000111000100000110100, kVO_SV_BHS, 0b0000111100000000101100, kVO_V_H4S2) , kRWI_W , F(Long) | F(VH0_15) , 14 , 2901), // #641
- INST(Sqdmull2_v , ISimdVVVe , (0b0100111000100000110100, kVO_V_B16H8S4, 0b0100111100000000101100, kVO_V_H8S4) , kRWI_W , F(Long) | F(VH0_15) , 15 , 2909), // #642
- INST(Sqneg_v , ISimdVV , (0b0010111000100000011110, kVO_SV_Any) , kRWI_W , 0 , 14 , 2918), // #643
- INST(Sqrdmlah_v , ISimdVVVe , (0b0010111000000000100001, kVO_SV_HS, 0b0010111100000000110100, kVO_SV_HS) , kRWI_X , F(VH0_15) , 16 , 2924), // #644
- INST(Sqrdmlsh_v , ISimdVVVe , (0b0010111000000000100011, kVO_SV_HS, 0b0010111100000000111100, kVO_SV_HS) , kRWI_X , F(VH0_15) , 17 , 2933), // #645
- INST(Sqrdmulh_v , ISimdVVVe , (0b0010111000100000101101, kVO_SV_HS, 0b0000111100000000110100, kVO_SV_HS) , kRWI_W , F(VH0_15) , 18 , 2942), // #646
- INST(Sqrshl_v , SimdShift , (0b0000111000100000010111, 0b0000000000000000000000, 1, kVO_SV_Any) , kRWI_W , 0 , 6 , 2951), // #647
- INST(Sqrshrn_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000100111, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 7 , 2958), // #648
- INST(Sqrshrn2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000100111, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 8 , 2966), // #649
- INST(Sqrshrun_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000100011, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 9 , 2975), // #650
- INST(Sqrshrun2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000100011, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 10 , 2984), // #651
- INST(Sqshl_v , SimdShift , (0b0000111000100000010011, 0b0000111100000000011101, 0, kVO_SV_Any) , kRWI_W , 0 , 11 , 2994), // #652
- INST(Sqshlu_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000011001, 0, kVO_SV_Any) , kRWI_W , 0 , 12 , 3000), // #653
- INST(Sqshrn_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000100101, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 13 , 3007), // #654
- INST(Sqshrn2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000100101, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 14 , 3014), // #655
- INST(Sqshrun_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000100001, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 15 , 3022), // #656
- INST(Sqshrun2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000100001, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 16 , 3030), // #657
- INST(Sqsub_v , ISimdVVV , (0b0000111000100000001011, kVO_SV_Any) , kRWI_W , 0 , 33 , 3039), // #658
- INST(Sqxtn_v , ISimdVV , (0b0000111000100001010010, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 15 , 3045), // #659
- INST(Sqxtn2_v , ISimdVV , (0b0100111000100001010010, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 16 , 3051), // #660
- INST(Sqxtun_v , ISimdVV , (0b0010111000100001001010, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 17 , 3058), // #661
- INST(Sqxtun2_v , ISimdVV , (0b0110111000100001001010, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 18 , 3065), // #662
- INST(Srhadd_v , ISimdVVV , (0b0000111000100000000101, kVO_V_BHS) , kRWI_W , 0 , 34 , 3073), // #663
- INST(Sri_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000010001, 1, kVO_V_Any) , kRWI_W , 0 , 17 , 3080), // #664
- INST(Srshl_v , SimdShift , (0b0000111000100000010101, 0b0000000000000000000000, 0, kVO_V_Any) , kRWI_W , 0 , 18 , 3084), // #665
- INST(Srshr_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000001001, 1, kVO_V_Any) , kRWI_W , 0 , 19 , 3090), // #666
- INST(Srsra_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000001101, 1, kVO_V_Any) , kRWI_X , 0 , 20 , 3096), // #667
- INST(Sshl_v , SimdShift , (0b0000111000100000010001, 0b0000000000000000000000, 0, kVO_V_Any) , kRWI_W , 0 , 21 , 3102), // #668
- INST(Sshll_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000101001, 0, kVO_V_B8H4S2) , kRWI_W , F(Long) , 22 , 3107), // #669
- INST(Sshll2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000101001, 0, kVO_V_B16H8S4) , kRWI_W , F(Long) , 23 , 3113), // #670
- INST(Sshr_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000000001, 1, kVO_V_Any) , kRWI_W , 0 , 24 , 3120), // #671
- INST(Ssra_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000000101, 1, kVO_V_Any) , kRWI_X , 0 , 25 , 3125), // #672
- INST(Ssubl_v , ISimdVVV , (0b0000111000100000001000, kVO_V_B8H4S2) , kRWI_W , F(Long) , 35 , 3130), // #673
- INST(Ssubl2_v , ISimdVVV , (0b0100111000100000001000, kVO_V_B16H8S4) , kRWI_W , F(Long) , 36 , 3136), // #674
- INST(Ssubw_v , ISimdWWV , (0b0000111000100000001100, kVO_V_B8H4S2) , kRWI_W , 0 , 2 , 3143), // #675
- INST(Ssubw2_v , ISimdWWV , (0b0000111000100000001100, kVO_V_B16H8S4) , kRWI_X , 0 , 3 , 3149), // #676
- INST(St1_v , SimdLdNStN , (0b0000110100000000000000, 0b0000110000000000001000, 1, 0) , kRWI_STn , F(Consecutive) , 8 , 3156), // #677
- INST(St2_v , SimdLdNStN , (0b0000110100100000000000, 0b0000110000000000100000, 2, 0) , kRWI_STn , F(Consecutive) , 9 , 3160), // #678
- INST(St3_v , SimdLdNStN , (0b0000110100000000001000, 0b0000110000000000010000, 3, 0) , kRWI_STn , F(Consecutive) , 10 , 3169), // #679
- INST(St4_v , SimdLdNStN , (0b0000110100100000001000, 0b0000110000000000000000, 4, 0) , kRWI_STn , F(Consecutive) , 11 , 3173), // #680
- INST(Stnp_v , SimdLdpStp , (0b0010110000, 0b0000000000) , kRWI_RRW , 0 , 2 , 3383), // #681
- INST(Stp_v , SimdLdpStp , (0b0010110100, 0b0010110010) , kRWI_RRW , 0 , 3 , 3388), // #682
- INST(Str_v , SimdLdSt , (0b0011110100, 0b00111100000, 0b00111100001, 0b00000000, Inst::kIdStur_v) , kRWI_RW , 0 , 1 , 3392), // #683
- INST(Stur_v , SimdLdurStur , (0b0011110000000000000000) , kRWI_RW , 0 , 1 , 3662), // #684
- INST(Sub_v , ISimdVVV , (0b0010111000100000100001, kVO_V_Any) , kRWI_W , 0 , 37 , 985 ), // #685
- INST(Subhn_v , ISimdVVV , (0b0000111000100000011000, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 38 , 2401), // #686
- INST(Subhn2_v , ISimdVVV , (0b0000111000100000011000, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 39 , 2408), // #687
- INST(Sudot_v , SimdDot , (0b0000000000000000000000, 0b0000111100000000111100, kET_S, kET_B, kET_4B) , kRWI_X , 0 , 2 , 3739), // #688
- INST(Suqadd_v , ISimdVV , (0b0000111000100000001110, kVO_SV_Any) , kRWI_X , 0 , 19 , 3745), // #689
- INST(Sxtl_v , SimdSxtlUxtl , (0b0000111100000000101001, kVO_V_B8H4S2) , kRWI_W , F(Long) , 0 , 3834), // #690
- INST(Sxtl2_v , SimdSxtlUxtl , (0b0100111100000000101001, kVO_V_B16H8S4) , kRWI_W , F(Long) , 1 , 3839), // #691
- INST(Tbl_v , SimdTblTbx , (0b0000111000000000000000) , kRWI_W , 0 , 0 , 3854), // #692
- INST(Tbx_v , SimdTblTbx , (0b0000111000000000000100) , kRWI_W , 0 , 1 , 3863), // #693
- INST(Trn1_v , ISimdVVV , (0b0000111000000000001010, kVO_V_BHS_D2) , kRWI_W , 0 , 40 , 3876), // #694
- INST(Trn2_v , ISimdVVV , (0b0000111000000000011010, kVO_V_BHS_D2) , kRWI_W , 0 , 41 , 3881), // #695
- INST(Uaba_v , ISimdVVV , (0b0010111000100000011111, kVO_V_BHS) , kRWI_X , 0 , 42 , 3886), // #696
- INST(Uabal_v , ISimdVVV , (0b0010111000100000010100, kVO_V_B8H4S2) , kRWI_X , F(Long) , 43 , 3891), // #697
- INST(Uabal2_v , ISimdVVV , (0b0110111000100000010100, kVO_V_B16H8S4) , kRWI_X , F(Long) , 44 , 3897), // #698
- INST(Uabd_v , ISimdVVV , (0b0010111000100000011101, kVO_V_BHS) , kRWI_W , 0 , 45 , 3904), // #699
- INST(Uabdl_v , ISimdVVV , (0b0010111000100000011100, kVO_V_B8H4S2) , kRWI_W , F(Long) , 46 , 3909), // #700
- INST(Uabdl2_v , ISimdVVV , (0b0110111000100000011100, kVO_V_B16H8S4) , kRWI_W , F(Long) , 47 , 3915), // #701
- INST(Uadalp_v , ISimdVV , (0b0010111000100000011010, kVO_V_BHS) , kRWI_X , F(Long) | F(Pair) , 20 , 3922), // #702
- INST(Uaddl_v , ISimdVVV , (0b0010111000100000000000, kVO_V_B8H4S2) , kRWI_W , F(Long) , 48 , 3929), // #703
- INST(Uaddl2_v , ISimdVVV , (0b0110111000100000000000, kVO_V_B16H8S4) , kRWI_W , F(Long) , 49 , 3935), // #704
- INST(Uaddlp_v , ISimdVV , (0b0010111000100000001010, kVO_V_BHS) , kRWI_W , F(Long) | F(Pair) , 21 , 3942), // #705
- INST(Uaddlv_v , ISimdSV , (0b0010111000110000001110, kVO_V_BH_4S) , kRWI_W , F(Long) , 4 , 3949), // #706
- INST(Uaddw_v , ISimdWWV , (0b0010111000100000000100, kVO_V_B8H4S2) , kRWI_W , 0 , 4 , 3956), // #707
- INST(Uaddw2_v , ISimdWWV , (0b0010111000100000000100, kVO_V_B16H8S4) , kRWI_W , 0 , 5 , 3962), // #708
- INST(Ucvtf_v , SimdFcvtSV , (0b0010111000100001110110, 0b0010111100000000111001, 0b0001111000100011000000, 0) , kRWI_W , 0 , 11 , 3985), // #709
- INST(Udot_v , SimdDot , (0b0010111010000000100101, 0b0010111110000000111000, kET_S, kET_B, kET_4B) , kRWI_X , 0 , 3 , 3740), // #710
- INST(Uhadd_v , ISimdVVV , (0b0010111000100000000001, kVO_V_BHS) , kRWI_W , 0 , 50 , 4000), // #711
- INST(Uhsub_v , ISimdVVV , (0b0010111000100000001001, kVO_V_BHS) , kRWI_W , 0 , 51 , 4006), // #712
- INST(Umax_v , ISimdVVV , (0b0010111000100000011001, kVO_V_BHS) , kRWI_W , 0 , 52 , 1936), // #713
- INST(Umaxp_v , ISimdVVV , (0b0010111000100000101001, kVO_V_BHS) , kRWI_W , 0 , 53 , 4019), // #714
- INST(Umaxv_v , ISimdSV , (0b0010111000110000101010, kVO_V_BH_4S) , kRWI_W , 0 , 5 , 4025), // #715
- INST(Umin_v , ISimdVVV , (0b0010111000100000011011, kVO_V_BHS) , kRWI_W , 0 , 54 , 2040), // #716
- INST(Uminp_v , ISimdVVV , (0b0010111000100000101011, kVO_V_BHS) , kRWI_W , 0 , 55 , 4031), // #717
- INST(Uminv_v , ISimdSV , (0b0010111000110001101010, kVO_V_BH_4S) , kRWI_W , 0 , 6 , 4037), // #718
- INST(Umlal_v , ISimdVVVe , (0b0010111000100000100000, kVO_V_B8H4S2, 0b0010111100000000001000, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 19 , 4043), // #719
- INST(Umlal2_v , ISimdVVVe , (0b0110111000100000100000, kVO_V_B16H8S4, 0b0010111100000000001000, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 20 , 4049), // #720
- INST(Umlsl_v , ISimdVVVe , (0b0010111000100000101000, kVO_V_B8H4S2, 0b0010111100000000011000, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 21 , 4056), // #721
- INST(Umlsl2_v , ISimdVVVe , (0b0110111000100000101000, kVO_V_B16H8S4, 0b0110111100000000011000, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 22 , 4062), // #722
- INST(Ummla_v , ISimdVVVx , (0b0110111010000000101001, kOp_V4S, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 15 , 4069), // #723
- INST(Umov_v , SimdSmovUmov , (0b0000111000000000001111, kVO_V_Any, 0) , kRWI_W , 0 , 1 , 4082), // #724
- INST(Umull_v , ISimdVVVe , (0b0010111000100000110000, kVO_V_B8H4S2, 0b0010111100000000101000, kVO_V_H4S2) , kRWI_W , F(Long) | F(VH0_15) , 23 , 4100), // #725
- INST(Umull2_v , ISimdVVVe , (0b0110111000100000110000, kVO_V_B16H8S4, 0b0110111100000000101000, kVO_V_H8S4) , kRWI_W , F(Long) | F(VH0_15) , 24 , 4106), // #726
- INST(Uqadd_v , ISimdVVV , (0b0010111000100000000011, kVO_SV_Any) , kRWI_W , 0 , 56 , 3746), // #727
- INST(Uqrshl_v , SimdShift , (0b0010111000100000010111, 0b0000000000000000000000, 0, kVO_SV_Any) , kRWI_W , 0 , 26 , 4113), // #728
- INST(Uqrshrn_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000100111, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 27 , 4120), // #729
- INST(Uqrshrn2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000100111, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 28 , 4128), // #730
- INST(Uqshl_v , SimdShift , (0b0010111000100000010011, 0b0010111100000000011101, 0, kVO_SV_Any) , kRWI_W , 0 , 29 , 4137), // #731
- INST(Uqshrn_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000100101, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 30 , 4143), // #732
- INST(Uqshrn2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000100101, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 31 , 4150), // #733
- INST(Uqsub_v , ISimdVVV , (0b0010111000100000001011, kVO_SV_Any) , kRWI_W , 0 , 57 , 4158), // #734
- INST(Uqxtn_v , ISimdVV , (0b0010111000100001010010, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 22 , 4164), // #735
- INST(Uqxtn2_v , ISimdVV , (0b0110111000100001010010, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 23 , 4170), // #736
- INST(Urecpe_v , ISimdVV , (0b0000111010100001110010, kVO_V_S) , kRWI_W , 0 , 24 , 4177), // #737
- INST(Urhadd_v , ISimdVVV , (0b0010111000100000000101, kVO_V_BHS) , kRWI_W , 0 , 58 , 4184), // #738
- INST(Urshl_v , SimdShift , (0b0010111000100000010101, 0b0000000000000000000000, 0, kVO_V_Any) , kRWI_W , 0 , 32 , 4191), // #739
- INST(Urshr_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000001001, 1, kVO_V_Any) , kRWI_W , 0 , 33 , 4197), // #740
- INST(Ursqrte_v , ISimdVV , (0b0010111010100001110010, kVO_V_S) , kRWI_W , 0 , 25 , 4203), // #741
- INST(Ursra_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000001101, 1, kVO_V_Any) , kRWI_X , 0 , 34 , 4211), // #742
- INST(Usdot_v , SimdDot , (0b0000111010000000100111, 0b0000111110000000111100, kET_S, kET_B, kET_4B) , kRWI_X , 0 , 4 , 4217), // #743
- INST(Ushl_v , SimdShift , (0b0010111000100000010001, 0b0000000000000000000000, 0, kVO_V_Any) , kRWI_W , 0 , 35 , 4223), // #744
- INST(Ushll_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000101001, 0, kVO_V_B8H4S2) , kRWI_W , F(Long) , 36 , 4228), // #745
- INST(Ushll2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000101001, 0, kVO_V_B16H8S4) , kRWI_W , F(Long) , 37 , 4234), // #746
- INST(Ushr_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000000001, 1, kVO_V_Any) , kRWI_W , 0 , 38 , 4241), // #747
- INST(Usmmla_v , ISimdVVVx , (0b0100111010000000101011, kOp_V4S, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 16 , 4246), // #748
- INST(Usqadd_v , ISimdVV , (0b0010111000100000001110, kVO_SV_Any) , kRWI_X , 0 , 26 , 4253), // #749
- INST(Usra_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000000101, 1, kVO_V_Any) , kRWI_X , 0 , 39 , 4260), // #750
- INST(Usubl_v , ISimdVVV , (0b0010111000100000001000, kVO_V_B8H4S2) , kRWI_W , F(Long) , 59 , 4265), // #751
- INST(Usubl2_v , ISimdVVV , (0b0110111000100000001000, kVO_V_B16H8S4) , kRWI_W , F(Long) , 60 , 4271), // #752
- INST(Usubw_v , ISimdWWV , (0b0010111000100000001100, kVO_V_B8H4S2) , kRWI_W , 0 , 6 , 4278), // #753
- INST(Usubw2_v , ISimdWWV , (0b0010111000100000001100, kVO_V_B16H8S4) , kRWI_W , 0 , 7 , 4284), // #754
- INST(Uxtl_v , SimdSxtlUxtl , (0b0010111100000000101001, kVO_V_B8H4S2) , kRWI_W , F(Long) , 2 , 4301), // #755
- INST(Uxtl2_v , SimdSxtlUxtl , (0b0110111100000000101001, kVO_V_B16H8S4) , kRWI_W , F(Long) , 3 , 4306), // #756
- INST(Uzp1_v , ISimdVVV , (0b0000111000000000000110, kVO_V_BHS_D2) , kRWI_W , 0 , 61 , 4312), // #757
- INST(Uzp2_v , ISimdVVV , (0b0000111000000000010110, kVO_V_BHS_D2) , kRWI_W , 0 , 62 , 4317), // #758
- INST(Xar_v , ISimdVVVI , (0b1100111001100000100011, kVO_V_D2, 6, 10, 0) , kRWI_W , 0 , 1 , 4337), // #759
- INST(Xtn_v , ISimdVV , (0b0000111000100001001010, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 27 , 3047), // #760
- INST(Xtn2_v , ISimdVV , (0b0100111000100001001010, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 28 , 3053), // #761
- INST(Zip1_v , ISimdVVV , (0b0000111000000000001110, kVO_V_BHS_D2) , kRWI_W , 0 , 63 , 4367), // #762
- INST(Zip2_v , ISimdVVV , (0b0000111000000000011110, kVO_V_BHS_D2) , kRWI_W , 0 , 64 , 4372) // #763
+ INST(None , None , (_) , 0 , 0 , 0 ), // #0
+ INST(Adc , BaseRRR , (0b0001101000000000000000, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 0 ), // #1
+ INST(Adcs , BaseRRR , (0b0011101000000000000000, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 1 ), // #2
+ INST(Add , BaseAddSub , (0b0001011000, 0b0001011001, 0b0010001) , kRWI_W , 0 , 0 ), // #3
+ INST(Addg , BaseRRII , (0b1001000110000000000000, kX, kSP, kX, kSP, 6, 4, 16, 4, 0, 10) , kRWI_W , 0 , 0 ), // #4
+ INST(Adds , BaseAddSub , (0b0101011000, 0b0101011001, 0b0110001) , kRWI_W , 0 , 1 ), // #5
+ INST(Adr , BaseAdr , (0b0001000000000000000000, OffsetType::kAArch64_ADR) , kRWI_W , 0 , 0 ), // #6
+ INST(Adrp , BaseAdr , (0b1001000000000000000000, OffsetType::kAArch64_ADRP) , kRWI_W , 0 , 1 ), // #7
+ INST(And , BaseLogical , (0b0001010000, 0b00100100, 0) , kRWI_W , 0 , 0 ), // #8
+ INST(Ands , BaseLogical , (0b1101010000, 0b11100100, 0) , kRWI_W , 0 , 1 ), // #9
+ INST(Asr , BaseShift , (0b0001101011000000001010, 0b0001001100000000011111, 0) , kRWI_W , 0 , 0 ), // #10
+ INST(Asrv , BaseShift , (0b0001101011000000001010, 0b0000000000000000000000, 0) , kRWI_W , 0 , 1 ), // #11
+ INST(At , BaseAtDcIcTlbi , (0b00011111110000, 0b00001111000000, true) , kRWI_RX , 0 , 0 ), // #12
+ INST(Autda , BaseRR , (0b11011010110000010001100000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 0 ), // #13
+ INST(Autdza , BaseR , (0b11011010110000010011101111100000, kX, kZR, 0) , kRWI_X , 0 , 0 ), // #14
+ INST(Autdb , BaseRR , (0b11011010110000010001110000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 1 ), // #15
+ INST(Autdzb , BaseR , (0b11011010110000010011111111100000, kX, kZR, 0) , kRWI_X , 0 , 1 ), // #16
+ INST(Autia , BaseRR , (0b11011010110000010001000000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 2 ), // #17
+ INST(Autia1716 , BaseOp , (0b11010101000000110010000110011111) , 0 , 0 , 0 ), // #18
+ INST(Autiasp , BaseOp , (0b11010101000000110010001110111111) , 0 , 0 , 1 ), // #19
+ INST(Autiaz , BaseOp , (0b11010101000000110010001110011111) , 0 , 0 , 2 ), // #20
+ INST(Autib , BaseRR , (0b11011010110000010001010000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 3 ), // #21
+ INST(Autib1716 , BaseOp , (0b11010101000000110010000111011111) , 0 , 0 , 3 ), // #22
+ INST(Autibsp , BaseOp , (0b11010101000000110010001111111111) , 0 , 0 , 4 ), // #23
+ INST(Autibz , BaseOp , (0b11010101000000110010001111011111) , 0 , 0 , 5 ), // #24
+ INST(Autiza , BaseR , (0b11011010110000010011001111100000, kX, kZR, 0) , kRWI_X , 0 , 2 ), // #25
+ INST(Autizb , BaseR , (0b11011010110000010011011111100000, kX, kZR, 0) , kRWI_X , 0 , 3 ), // #26
+ INST(Axflag , BaseOp , (0b11010101000000000100000001011111) , 0 , 0 , 6 ), // #27
+ INST(B , BaseBranchRel , (0b00010100000000000000000000000000) , 0 , F(Cond) , 0 ), // #28
+ INST(Bfc , BaseBfc , (0b00110011000000000000001111100000) , kRWI_X , 0 , 0 ), // #29
+ INST(Bfi , BaseBfi , (0b00110011000000000000000000000000) , kRWI_X , 0 , 0 ), // #30
+ INST(Bfm , BaseBfm , (0b00110011000000000000000000000000) , kRWI_X , 0 , 0 ), // #31
+ INST(Bfxil , BaseBfx , (0b00110011000000000000000000000000) , kRWI_X , 0 , 0 ), // #32
+ INST(Bic , BaseLogical , (0b0001010001, 0b00100100, 1) , kRWI_W , 0 , 2 ), // #33
+ INST(Bics , BaseLogical , (0b1101010001, 0b11100100, 1) , kRWI_W , 0 , 3 ), // #34
+ INST(Bl , BaseBranchRel , (0b10010100000000000000000000000000) , 0 , 0 , 1 ), // #35
+ INST(Blr , BaseBranchReg , (0b11010110001111110000000000000000) , kRWI_R , 0 , 0 ), // #36
+ INST(Br , BaseBranchReg , (0b11010110000111110000000000000000) , kRWI_R , 0 , 1 ), // #37
+ INST(Brk , BaseOpImm , (0b11010100001000000000000000000000, 16, 5) , 0 , 0 , 0 ), // #38
+ INST(Cas , BaseAtomicOp , (0b1000100010100000011111, kWX, 30, 0) , kRWI_XRX , 0 , 0 ), // #39
+ INST(Casa , BaseAtomicOp , (0b1000100011100000011111, kWX, 30, 1) , kRWI_XRX , 0 , 1 ), // #40
+ INST(Casab , BaseAtomicOp , (0b0000100011100000011111, kW , 0 , 1) , kRWI_XRX , 0 , 2 ), // #41
+ INST(Casah , BaseAtomicOp , (0b0100100011100000011111, kW , 0 , 1) , kRWI_XRX , 0 , 3 ), // #42
+ INST(Casal , BaseAtomicOp , (0b1000100011100000111111, kWX, 30, 1) , kRWI_XRX , 0 , 4 ), // #43
+ INST(Casalb , BaseAtomicOp , (0b0000100011100000111111, kW , 0 , 1) , kRWI_XRX , 0 , 5 ), // #44
+ INST(Casalh , BaseAtomicOp , (0b0100100011100000111111, kW , 0 , 1) , kRWI_XRX , 0 , 6 ), // #45
+ INST(Casb , BaseAtomicOp , (0b0000100010100000011111, kW , 0 , 0) , kRWI_XRX , 0 , 7 ), // #46
+ INST(Cash , BaseAtomicOp , (0b0100100010100000011111, kW , 0 , 0) , kRWI_XRX , 0 , 8 ), // #47
+ INST(Casl , BaseAtomicOp , (0b1000100010100000111111, kWX, 30, 0) , kRWI_XRX , 0 , 9 ), // #48
+ INST(Caslb , BaseAtomicOp , (0b0000100010100000111111, kW , 0 , 0) , kRWI_XRX , 0 , 10 ), // #49
+ INST(Caslh , BaseAtomicOp , (0b0100100010100000111111, kW , 0 , 0) , kRWI_XRX , 0 , 11 ), // #50
+ INST(Casp , BaseAtomicCasp , (0b0000100000100000011111, kWX, 30) , kRWI_XXRRX, 0 , 0 ), // #51
+ INST(Caspa , BaseAtomicCasp , (0b0000100001100000011111, kWX, 30) , kRWI_XXRRX, 0 , 1 ), // #52
+ INST(Caspal , BaseAtomicCasp , (0b0000100001100000111111, kWX, 30) , kRWI_XXRRX, 0 , 2 ), // #53
+ INST(Caspl , BaseAtomicCasp , (0b0000100000100000111111, kWX, 30) , kRWI_XXRRX, 0 , 3 ), // #54
+ INST(Cbnz , BaseBranchCmp , (0b00110101000000000000000000000000) , kRWI_R , 0 , 0 ), // #55
+ INST(Cbz , BaseBranchCmp , (0b00110100000000000000000000000000) , kRWI_R , 0 , 1 ), // #56
+ INST(Ccmn , BaseCCmp , (0b00111010010000000000000000000000) , kRWI_R , 0 , 0 ), // #57
+ INST(Ccmp , BaseCCmp , (0b01111010010000000000000000000000) , kRWI_R , 0 , 1 ), // #58
+ INST(Cfinv , BaseOp , (0b11010101000000000100000000011111) , 0 , 0 , 7 ), // #59
+ INST(Cinc , BaseCInc , (0b00011010100000000000010000000000) , kRWI_W , 0 , 0 ), // #60
+ INST(Cinv , BaseCInc , (0b01011010100000000000000000000000) , kRWI_W , 0 , 1 ), // #61
+ INST(Clrex , BaseOpImm , (0b11010101000000110011000001011111, 4, 8) , 0 , 0 , 1 ), // #62
+ INST(Cls , BaseRR , (0b01011010110000000001010000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 4 ), // #63
+ INST(Clz , BaseRR , (0b01011010110000000001000000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 5 ), // #64
+ INST(Cmn , BaseCmpCmn , (0b0101011000, 0b0101011001, 0b0110001) , kRWI_R , 0 , 0 ), // #65
+ INST(Cmp , BaseCmpCmn , (0b1101011000, 0b1101011001, 0b1110001) , kRWI_R , 0 , 1 ), // #66
+ INST(Cmpp , BaseRR , (0b10111010110000000000000000011111, kX, kSP, 5, kX, kSP, 16, true) , kRWI_R , 0 , 6 ), // #67
+ INST(Cneg , BaseCInc , (0b01011010100000000000010000000000) , kRWI_W , 0 , 2 ), // #68
+ INST(Crc32b , BaseRRR , (0b0001101011000000010000, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 2 ), // #69
+ INST(Crc32cb , BaseRRR , (0b0001101011000000010100, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 3 ), // #70
+ INST(Crc32ch , BaseRRR , (0b0001101011000000010101, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 4 ), // #71
+ INST(Crc32cw , BaseRRR , (0b0001101011000000010110, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 5 ), // #72
+ INST(Crc32cx , BaseRRR , (0b1001101011000000010111, kW, kZR, kW, kZR, kX, kZR, false) , kRWI_W , 0 , 6 ), // #73
+ INST(Crc32h , BaseRRR , (0b0001101011000000010001, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 7 ), // #74
+ INST(Crc32w , BaseRRR , (0b0001101011000000010010, kW, kZR, kW, kZR, kW, kZR, false) , kRWI_W , 0 , 8 ), // #75
+ INST(Crc32x , BaseRRR , (0b1001101011000000010011, kW, kZR, kW, kZR, kX, kZR, false) , kRWI_W , 0 , 9 ), // #76
+ INST(Csdb , BaseOp , (0b11010101000000110010001010011111) , 0 , 0 , 8 ), // #77
+ INST(Csel , BaseCSel , (0b00011010100000000000000000000000) , kRWI_W , 0 , 0 ), // #78
+ INST(Cset , BaseCSet , (0b00011010100111110000011111100000) , kRWI_W , 0 , 0 ), // #79
+ INST(Csetm , BaseCSet , (0b01011010100111110000001111100000) , kRWI_W , 0 , 1 ), // #80
+ INST(Csinc , BaseCSel , (0b00011010100000000000010000000000) , kRWI_W , 0 , 1 ), // #81
+ INST(Csinv , BaseCSel , (0b01011010100000000000000000000000) , kRWI_W , 0 , 2 ), // #82
+ INST(Csneg , BaseCSel , (0b01011010100000000000010000000000) , kRWI_W , 0 , 3 ), // #83
+ INST(Dc , BaseAtDcIcTlbi , (0b00011110000000, 0b00001110000000, true) , kRWI_RX , 0 , 1 ), // #84
+ INST(Dcps1 , BaseOpImm , (0b11010100101000000000000000000001, 16, 5) , 0 , 0 , 2 ), // #85
+ INST(Dcps2 , BaseOpImm , (0b11010100101000000000000000000010, 16, 5) , 0 , 0 , 3 ), // #86
+ INST(Dcps3 , BaseOpImm , (0b11010100101000000000000000000011, 16, 5) , 0 , 0 , 4 ), // #87
+ INST(Dgh , BaseOp , (0b11010101000000110010000011011111) , 0 , 0 , 9 ), // #88
+ INST(Dmb , BaseOpImm , (0b11010101000000110011000010111111, 4, 8) , 0 , 0 , 5 ), // #89
+ INST(Drps , BaseOp , (0b11010110101111110000001111100000) , 0 , 0 , 10 ), // #90
+ INST(Dsb , BaseOpImm , (0b11010101000000110011000010011111, 4, 8) , 0 , 0 , 6 ), // #91
+ INST(Eon , BaseLogical , (0b1001010001, 0b10100100, 1) , kRWI_W , 0 , 4 ), // #92
+ INST(Eor , BaseLogical , (0b1001010000, 0b10100100, 0) , kRWI_W , 0 , 5 ), // #93
+ INST(Esb , BaseOp , (0b11010101000000110010001000011111) , 0 , 0 , 11 ), // #94
+ INST(Extr , BaseExtract , (0b00010011100000000000000000000000) , kRWI_W , 0 , 0 ), // #95
+ INST(Eret , BaseOp , (0b11010110100111110000001111100000) , 0 , 0 , 12 ), // #96
+ INST(Gmi , BaseRRR , (0b1001101011000000000101, kX , kZR, kX , kSP, kX , kZR, true) , kRWI_W , 0 , 10 ), // #97
+ INST(Hint , BaseOpImm , (0b11010101000000110010000000011111, 7, 5) , 0 , 0 , 7 ), // #98
+ INST(Hlt , BaseOpImm , (0b11010100010000000000000000000000, 16, 5) , 0 , 0 , 8 ), // #99
+ INST(Hvc , BaseOpImm , (0b11010100000000000000000000000010, 16, 5) , 0 , 0 , 9 ), // #100
+ INST(Ic , BaseAtDcIcTlbi , (0b00011110000000, 0b00001110000000, false) , kRWI_RX , 0 , 2 ), // #101
+ INST(Isb , BaseOpImm , (0b11010101000000110011000011011111, 4, 8) , 0 , 0 , 10 ), // #102
+ INST(Ldadd , BaseAtomicOp , (0b1011100000100000000000, kWX, 30, 0) , kRWI_WRX , 0 , 12 ), // #103
+ INST(Ldadda , BaseAtomicOp , (0b1011100010100000000000, kWX, 30, 1) , kRWI_WRX , 0 , 13 ), // #104
+ INST(Ldaddab , BaseAtomicOp , (0b0011100010100000000000, kW , 0 , 1) , kRWI_WRX , 0 , 14 ), // #105
+ INST(Ldaddah , BaseAtomicOp , (0b0111100010100000000000, kW , 0 , 1) , kRWI_WRX , 0 , 15 ), // #106
+ INST(Ldaddal , BaseAtomicOp , (0b1011100011100000000000, kWX, 30, 1) , kRWI_WRX , 0 , 16 ), // #107
+ INST(Ldaddalb , BaseAtomicOp , (0b0011100011100000000000, kW , 0 , 1) , kRWI_WRX , 0 , 17 ), // #108
+ INST(Ldaddalh , BaseAtomicOp , (0b0111100011100000000000, kW , 0 , 1) , kRWI_WRX , 0 , 18 ), // #109
+ INST(Ldaddb , BaseAtomicOp , (0b0011100000100000000000, kW , 0 , 0) , kRWI_WRX , 0 , 19 ), // #110
+ INST(Ldaddh , BaseAtomicOp , (0b0111100000100000000000, kW , 0 , 0) , kRWI_WRX , 0 , 20 ), // #111
+ INST(Ldaddl , BaseAtomicOp , (0b1011100001100000000000, kWX, 30, 0) , kRWI_WRX , 0 , 21 ), // #112
+ INST(Ldaddlb , BaseAtomicOp , (0b0011100001100000000000, kW , 0 , 0) , kRWI_WRX , 0 , 22 ), // #113
+ INST(Ldaddlh , BaseAtomicOp , (0b0111100001100000000000, kW , 0 , 0) , kRWI_WRX , 0 , 23 ), // #114
+ INST(Ldar , BaseRM_NoImm , (0b1000100011011111111111, kWX, kZR, 30) , kRWI_W , 0 , 0 ), // #115
+ INST(Ldarb , BaseRM_NoImm , (0b0000100011011111111111, kW , kZR, 0 ) , kRWI_W , 0 , 1 ), // #116
+ INST(Ldarh , BaseRM_NoImm , (0b0100100011011111111111, kW , kZR, 0 ) , kRWI_W , 0 , 2 ), // #117
+ INST(Ldaxp , BaseLdxp , (0b1000100001111111100000, kWX, 30) , kRWI_WW , 0 , 0 ), // #118
+ INST(Ldaxr , BaseRM_NoImm , (0b1000100001011111111111, kWX, kZR, 30) , kRWI_W , 0 , 3 ), // #119
+ INST(Ldaxrb , BaseRM_NoImm , (0b0000100001011111111111, kW , kZR, 0 ) , kRWI_W , 0 , 4 ), // #120
+ INST(Ldaxrh , BaseRM_NoImm , (0b0100100001011111111111, kW , kZR, 0 ) , kRWI_W , 0 , 5 ), // #121
+ INST(Ldclr , BaseAtomicOp , (0b1011100000100000000100, kWX, 30, 0) , kRWI_WRX , 0 , 24 ), // #122
+ INST(Ldclra , BaseAtomicOp , (0b1011100010100000000100, kWX, 30, 1) , kRWI_WRX , 0 , 25 ), // #123
+ INST(Ldclrab , BaseAtomicOp , (0b0011100010100000000100, kW , 0 , 1) , kRWI_WRX , 0 , 26 ), // #124
+ INST(Ldclrah , BaseAtomicOp , (0b0111100010100000000100, kW , 0 , 1) , kRWI_WRX , 0 , 27 ), // #125
+ INST(Ldclral , BaseAtomicOp , (0b1011100011100000000100, kWX, 30, 1) , kRWI_WRX , 0 , 28 ), // #126
+ INST(Ldclralb , BaseAtomicOp , (0b0011100011100000000100, kW , 0 , 1) , kRWI_WRX , 0 , 29 ), // #127
+ INST(Ldclralh , BaseAtomicOp , (0b0111100011100000000100, kW , 0 , 1) , kRWI_WRX , 0 , 30 ), // #128
+ INST(Ldclrb , BaseAtomicOp , (0b0011100000100000000100, kW , 0 , 0) , kRWI_WRX , 0 , 31 ), // #129
+ INST(Ldclrh , BaseAtomicOp , (0b0111100000100000000100, kW , 0 , 0) , kRWI_WRX , 0 , 32 ), // #130
+ INST(Ldclrl , BaseAtomicOp , (0b1011100001100000000100, kWX, 30, 0) , kRWI_WRX , 0 , 33 ), // #131
+ INST(Ldclrlb , BaseAtomicOp , (0b0011100001100000000100, kW , 0 , 0) , kRWI_WRX , 0 , 34 ), // #132
+ INST(Ldclrlh , BaseAtomicOp , (0b0111100001100000000100, kW , 0 , 0) , kRWI_WRX , 0 , 35 ), // #133
+ INST(Ldeor , BaseAtomicOp , (0b1011100000100000001000, kWX, 30, 0) , kRWI_WRX , 0 , 36 ), // #134
+ INST(Ldeora , BaseAtomicOp , (0b1011100010100000001000, kWX, 30, 1) , kRWI_WRX , 0 , 37 ), // #135
+ INST(Ldeorab , BaseAtomicOp , (0b0011100010100000001000, kW , 0 , 1) , kRWI_WRX , 0 , 38 ), // #136
+ INST(Ldeorah , BaseAtomicOp , (0b0111100010100000001000, kW , 0 , 1) , kRWI_WRX , 0 , 39 ), // #137
+ INST(Ldeoral , BaseAtomicOp , (0b1011100011100000001000, kWX, 30, 1) , kRWI_WRX , 0 , 40 ), // #138
+ INST(Ldeoralb , BaseAtomicOp , (0b0011100011100000001000, kW , 0 , 1) , kRWI_WRX , 0 , 41 ), // #139
+ INST(Ldeoralh , BaseAtomicOp , (0b0111100011100000001000, kW , 0 , 1) , kRWI_WRX , 0 , 42 ), // #140
+ INST(Ldeorb , BaseAtomicOp , (0b0011100000100000001000, kW , 0 , 0) , kRWI_WRX , 0 , 43 ), // #141
+ INST(Ldeorh , BaseAtomicOp , (0b0111100000100000001000, kW , 0 , 0) , kRWI_WRX , 0 , 44 ), // #142
+ INST(Ldeorl , BaseAtomicOp , (0b1011100001100000001000, kWX, 30, 0) , kRWI_WRX , 0 , 45 ), // #143
+ INST(Ldeorlb , BaseAtomicOp , (0b0011100001100000001000, kW , 0 , 0) , kRWI_WRX , 0 , 46 ), // #144
+ INST(Ldeorlh , BaseAtomicOp , (0b0111100001100000001000, kW , 0 , 0) , kRWI_WRX , 0 , 47 ), // #145
+ INST(Ldg , BaseRM_SImm9 , (0b1101100101100000000000, 0b0000000000000000000000, kX , kZR, 0, 4) , kRWI_W , 0 , 0 ), // #146
+ INST(Ldgm , BaseRM_NoImm , (0b1101100111100000000000, kX , kZR, 0 ) , kRWI_W , 0 , 6 ), // #147
+ INST(Ldlar , BaseRM_NoImm , (0b1000100011011111011111, kWX, kZR, 30) , kRWI_W , 0 , 7 ), // #148
+ INST(Ldlarb , BaseRM_NoImm , (0b0000100011011111011111, kW , kZR, 0 ) , kRWI_W , 0 , 8 ), // #149
+ INST(Ldlarh , BaseRM_NoImm , (0b0100100011011111011111, kW , kZR, 0 ) , kRWI_W , 0 , 9 ), // #150
+ INST(Ldnp , BaseLdpStp , (0b0010100001, 0 , kWX, 31, 2) , kRWI_WW , 0 , 0 ), // #151
+ INST(Ldp , BaseLdpStp , (0b0010100101, 0b0010100011, kWX, 31, 2) , kRWI_WW , 0 , 1 ), // #152
+ INST(Ldpsw , BaseLdpStp , (0b0110100101, 0b0110100011, kX , 0 , 2) , kRWI_WW , 0 , 2 ), // #153
+ INST(Ldr , BaseLdSt , (0b1011100101, 0b10111000010, 0b10111000011, 0b00011000, kWX, 30, 2, Inst::kIdLdur) , kRWI_W , 0 , 0 ), // #154
+ INST(Ldraa , BaseRM_SImm10 , (0b1111100000100000000001, kX , kZR, 0, 3) , kRWI_W , 0 , 0 ), // #155
+ INST(Ldrab , BaseRM_SImm10 , (0b1111100010100000000001, kX , kZR, 0, 3) , kRWI_W , 0 , 1 ), // #156
+ INST(Ldrb , BaseLdSt , (0b0011100101, 0b00111000010, 0b00111000011, 0 , kW , 0 , 0, Inst::kIdLdurb) , kRWI_W , 0 , 1 ), // #157
+ INST(Ldrh , BaseLdSt , (0b0111100101, 0b01111000010, 0b01111000011, 0 , kW , 0 , 1, Inst::kIdLdurh) , kRWI_W , 0 , 2 ), // #158
+ INST(Ldrsb , BaseLdSt , (0b0011100111, 0b00111000100, 0b00111000111, 0 , kWX, 22, 0, Inst::kIdLdursb) , kRWI_W , 0 , 3 ), // #159
+ INST(Ldrsh , BaseLdSt , (0b0111100111, 0b01111000100, 0b01111000111, 0 , kWX, 22, 1, Inst::kIdLdursh) , kRWI_W , 0 , 4 ), // #160
+ INST(Ldrsw , BaseLdSt , (0b1011100110, 0b10111000100, 0b10111000101, 0b10011000, kX , 0 , 2, Inst::kIdLdursw) , kRWI_W , 0 , 5 ), // #161
+ INST(Ldset , BaseAtomicOp , (0b1011100000100000001100, kWX, 30, 0) , kRWI_WRX , 0 , 48 ), // #162
+ INST(Ldseta , BaseAtomicOp , (0b1011100010100000001100, kWX, 30, 1) , kRWI_WRX , 0 , 49 ), // #163
+ INST(Ldsetab , BaseAtomicOp , (0b0011100010100000001100, kW , 0 , 1) , kRWI_WRX , 0 , 50 ), // #164
+ INST(Ldsetah , BaseAtomicOp , (0b0111100010100000001100, kW , 0 , 1) , kRWI_WRX , 0 , 51 ), // #165
+ INST(Ldsetal , BaseAtomicOp , (0b1011100011100000001100, kWX, 30, 1) , kRWI_WRX , 0 , 52 ), // #166
+ INST(Ldsetalb , BaseAtomicOp , (0b0011100011100000001100, kW , 0 , 1) , kRWI_WRX , 0 , 53 ), // #167
+ INST(Ldsetalh , BaseAtomicOp , (0b0111100011100000001100, kW , 0 , 1) , kRWI_WRX , 0 , 54 ), // #168
+ INST(Ldsetb , BaseAtomicOp , (0b0011100000100000001100, kW , 0 , 0) , kRWI_WRX , 0 , 55 ), // #169
+ INST(Ldseth , BaseAtomicOp , (0b0111100000100000001100, kW , 0 , 0) , kRWI_WRX , 0 , 56 ), // #170
+ INST(Ldsetl , BaseAtomicOp , (0b1011100001100000001100, kWX, 30, 0) , kRWI_WRX , 0 , 57 ), // #171
+ INST(Ldsetlb , BaseAtomicOp , (0b0011100001100000001100, kW , 0 , 0) , kRWI_WRX , 0 , 58 ), // #172
+ INST(Ldsetlh , BaseAtomicOp , (0b0111100001100000001100, kW , 0 , 0) , kRWI_WRX , 0 , 59 ), // #173
+ INST(Ldsmax , BaseAtomicOp , (0b1011100000100000010000, kWX, 30, 0) , kRWI_WRX , 0 , 60 ), // #174
+ INST(Ldsmaxa , BaseAtomicOp , (0b1011100010100000010000, kWX, 30, 1) , kRWI_WRX , 0 , 61 ), // #175
+ INST(Ldsmaxab , BaseAtomicOp , (0b0011100010100000010000, kW , 0 , 1) , kRWI_WRX , 0 , 62 ), // #176
+ INST(Ldsmaxah , BaseAtomicOp , (0b0111100010100000010000, kW , 0 , 1) , kRWI_WRX , 0 , 63 ), // #177
+ INST(Ldsmaxal , BaseAtomicOp , (0b1011100011100000010000, kWX, 30, 1) , kRWI_WRX , 0 , 64 ), // #178
+ INST(Ldsmaxalb , BaseAtomicOp , (0b0011100011100000010000, kW , 0 , 1) , kRWI_WRX , 0 , 65 ), // #179
+ INST(Ldsmaxalh , BaseAtomicOp , (0b0111100011100000010000, kW , 0 , 1) , kRWI_WRX , 0 , 66 ), // #180
+ INST(Ldsmaxb , BaseAtomicOp , (0b0011100000100000010000, kW , 0 , 0) , kRWI_WRX , 0 , 67 ), // #181
+ INST(Ldsmaxh , BaseAtomicOp , (0b0111100000100000010000, kW , 0 , 0) , kRWI_WRX , 0 , 68 ), // #182
+ INST(Ldsmaxl , BaseAtomicOp , (0b1011100001100000010000, kWX, 30, 0) , kRWI_WRX , 0 , 69 ), // #183
+ INST(Ldsmaxlb , BaseAtomicOp , (0b0011100001100000010000, kW , 0 , 0) , kRWI_WRX , 0 , 70 ), // #184
+ INST(Ldsmaxlh , BaseAtomicOp , (0b0111100001100000010000, kW , 0 , 0) , kRWI_WRX , 0 , 71 ), // #185
+ INST(Ldsmin , BaseAtomicOp , (0b1011100000100000010100, kWX, 30, 0) , kRWI_WRX , 0 , 72 ), // #186
+ INST(Ldsmina , BaseAtomicOp , (0b1011100010100000010100, kWX, 30, 1) , kRWI_WRX , 0 , 73 ), // #187
+ INST(Ldsminab , BaseAtomicOp , (0b0011100010100000010100, kW , 0 , 1) , kRWI_WRX , 0 , 74 ), // #188
+ INST(Ldsminah , BaseAtomicOp , (0b0111100010100000010100, kW , 0 , 1) , kRWI_WRX , 0 , 75 ), // #189
+ INST(Ldsminal , BaseAtomicOp , (0b1011100011100000010100, kWX, 30, 1) , kRWI_WRX , 0 , 76 ), // #190
+ INST(Ldsminalb , BaseAtomicOp , (0b0011100011100000010100, kW , 0 , 1) , kRWI_WRX , 0 , 77 ), // #191
+ INST(Ldsminalh , BaseAtomicOp , (0b0111100011100000010100, kW , 0 , 1) , kRWI_WRX , 0 , 78 ), // #192
+ INST(Ldsminb , BaseAtomicOp , (0b0011100000100000010100, kW , 0 , 0) , kRWI_WRX , 0 , 79 ), // #193
+ INST(Ldsminh , BaseAtomicOp , (0b0111100000100000010100, kW , 0 , 0) , kRWI_WRX , 0 , 80 ), // #194
+ INST(Ldsminl , BaseAtomicOp , (0b1011100001100000010100, kWX, 30, 0) , kRWI_WRX , 0 , 81 ), // #195
+ INST(Ldsminlb , BaseAtomicOp , (0b0011100001100000010100, kW , 0 , 0) , kRWI_WRX , 0 , 82 ), // #196
+ INST(Ldsminlh , BaseAtomicOp , (0b0111100001100000010100, kW , 0 , 0) , kRWI_WRX , 0 , 83 ), // #197
+ INST(Ldtr , BaseRM_SImm9 , (0b1011100001000000000010, 0b0000000000000000000000, kWX, kZR, 30, 0) , kRWI_W , 0 , 1 ), // #198
+ INST(Ldtrb , BaseRM_SImm9 , (0b0011100001000000000010, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_W , 0 , 2 ), // #199
+ INST(Ldtrh , BaseRM_SImm9 , (0b0111100001000000000010, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_W , 0 , 3 ), // #200
+ INST(Ldtrsb , BaseRM_SImm9 , (0b0011100011000000000010, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 4 ), // #201
+ INST(Ldtrsh , BaseRM_SImm9 , (0b0111100011000000000010, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 5 ), // #202
+ INST(Ldtrsw , BaseRM_SImm9 , (0b1011100010000000000010, 0b0000000000000000000000, kX , kZR, 0 , 0) , kRWI_W , 0 , 6 ), // #203
+ INST(Ldumax , BaseAtomicOp , (0b1011100000100000011000, kWX, 30, 0) , kRWI_WRX , 0 , 84 ), // #204
+ INST(Ldumaxa , BaseAtomicOp , (0b1011100010100000011000, kWX, 30, 1) , kRWI_WRX , 0 , 85 ), // #205
+ INST(Ldumaxab , BaseAtomicOp , (0b0011100010100000011000, kW , 0 , 1) , kRWI_WRX , 0 , 86 ), // #206
+ INST(Ldumaxah , BaseAtomicOp , (0b0111100010100000011000, kW , 0 , 1) , kRWI_WRX , 0 , 87 ), // #207
+ INST(Ldumaxal , BaseAtomicOp , (0b1011100011100000011000, kWX, 30, 1) , kRWI_WRX , 0 , 88 ), // #208
+ INST(Ldumaxalb , BaseAtomicOp , (0b0011100011100000011000, kW , 0 , 1) , kRWI_WRX , 0 , 89 ), // #209
+ INST(Ldumaxalh , BaseAtomicOp , (0b0111100011100000011000, kW , 0 , 1) , kRWI_WRX , 0 , 90 ), // #210
+ INST(Ldumaxb , BaseAtomicOp , (0b0011100000100000011000, kW , 0 , 0) , kRWI_WRX , 0 , 91 ), // #211
+ INST(Ldumaxh , BaseAtomicOp , (0b0111100000100000011000, kW , 0 , 0) , kRWI_WRX , 0 , 92 ), // #212
+ INST(Ldumaxl , BaseAtomicOp , (0b1011100001100000011000, kWX, 30, 0) , kRWI_WRX , 0 , 93 ), // #213
+ INST(Ldumaxlb , BaseAtomicOp , (0b0011100001100000011000, kW , 0 , 0) , kRWI_WRX , 0 , 94 ), // #214
+ INST(Ldumaxlh , BaseAtomicOp , (0b0111100001100000011000, kW , 0 , 0) , kRWI_WRX , 0 , 95 ), // #215
+ INST(Ldumin , BaseAtomicOp , (0b1011100000100000011100, kWX, 30, 0) , kRWI_WRX , 0 , 96 ), // #216
+ INST(Ldumina , BaseAtomicOp , (0b1011100010100000011100, kWX, 30, 1) , kRWI_WRX , 0 , 97 ), // #217
+ INST(Lduminab , BaseAtomicOp , (0b0011100010100000011100, kW , 0 , 1) , kRWI_WRX , 0 , 98 ), // #218
+ INST(Lduminah , BaseAtomicOp , (0b0111100010100000011100, kW , 0 , 1) , kRWI_WRX , 0 , 99 ), // #219
+ INST(Lduminal , BaseAtomicOp , (0b1011100011100000011100, kWX, 30, 1) , kRWI_WRX , 0 , 100), // #220
+ INST(Lduminalb , BaseAtomicOp , (0b0011100011100000011100, kW , 0 , 1) , kRWI_WRX , 0 , 101), // #221
+ INST(Lduminalh , BaseAtomicOp , (0b0111100011100000011100, kW , 0 , 1) , kRWI_WRX , 0 , 102), // #222
+ INST(Lduminb , BaseAtomicOp , (0b0011100000100000011100, kW , 0 , 0) , kRWI_WRX , 0 , 103), // #223
+ INST(Lduminh , BaseAtomicOp , (0b0111100000100000011100, kW , 0 , 0) , kRWI_WRX , 0 , 104), // #224
+ INST(Lduminl , BaseAtomicOp , (0b1011100001100000011100, kWX, 30, 0) , kRWI_WRX , 0 , 105), // #225
+ INST(Lduminlb , BaseAtomicOp , (0b0011100001100000011100, kW , 0 , 0) , kRWI_WRX , 0 , 106), // #226
+ INST(Lduminlh , BaseAtomicOp , (0b0111100001100000011100, kW , 0 , 0) , kRWI_WRX , 0 , 107), // #227
+ INST(Ldur , BaseRM_SImm9 , (0b1011100001000000000000, 0b0000000000000000000000, kWX, kZR, 30, 0) , kRWI_W , 0 , 7 ), // #228
+ INST(Ldurb , BaseRM_SImm9 , (0b0011100001000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_W , 0 , 8 ), // #229
+ INST(Ldurh , BaseRM_SImm9 , (0b0111100001000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_W , 0 , 9 ), // #230
+ INST(Ldursb , BaseRM_SImm9 , (0b0011100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 10 ), // #231
+ INST(Ldursh , BaseRM_SImm9 , (0b0111100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0) , kRWI_W , 0 , 11 ), // #232
+ INST(Ldursw , BaseRM_SImm9 , (0b1011100010000000000000, 0b0000000000000000000000, kX , kZR, 0 , 0) , kRWI_W , 0 , 12 ), // #233
+ INST(Ldxp , BaseLdxp , (0b1000100001111111000000, kWX, 30) , kRWI_WW , 0 , 1 ), // #234
+ INST(Ldxr , BaseRM_NoImm , (0b1000100001011111011111, kWX, kZR, 30) , kRWI_W , 0 , 10 ), // #235
+ INST(Ldxrb , BaseRM_NoImm , (0b0000100001011111011111, kW , kZR, 0 ) , kRWI_W , 0 , 11 ), // #236
+ INST(Ldxrh , BaseRM_NoImm , (0b0100100001011111011111, kW , kZR, 0 ) , kRWI_W , 0 , 12 ), // #237
+ INST(Lsl , BaseShift , (0b0001101011000000001000, 0b0101001100000000000000, 0) , kRWI_W , 0 , 2 ), // #238
+ INST(Lslv , BaseShift , (0b0001101011000000001000, 0b0000000000000000000000, 0) , kRWI_W , 0 , 3 ), // #239
+ INST(Lsr , BaseShift , (0b0001101011000000001001, 0b0101001100000000011111, 0) , kRWI_W , 0 , 4 ), // #240
+ INST(Lsrv , BaseShift , (0b0001101011000000001001, 0b0000000000000000000000, 0) , kRWI_W , 0 , 5 ), // #241
+ INST(Madd , BaseRRRR , (0b0001101100000000000000, kWX, kZR, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 0 ), // #242
+ INST(Mneg , BaseRRR , (0b0001101100000000111111, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 11 ), // #243
+ INST(Mov , BaseMov , (_) , kRWI_W , 0 , 0 ), // #244
+ INST(Movk , BaseMovKNZ , (0b01110010100000000000000000000000) , kRWI_X , 0 , 0 ), // #245
+ INST(Movn , BaseMovKNZ , (0b00010010100000000000000000000000) , kRWI_W , 0 , 1 ), // #246
+ INST(Movz , BaseMovKNZ , (0b01010010100000000000000000000000) , kRWI_W , 0 , 2 ), // #247
+ INST(Mrs , BaseMrs , (_) , kRWI_W , 0 , 0 ), // #248
+ INST(Msr , BaseMsr , (_) , kRWI_W , 0 , 0 ), // #249
+ INST(Msub , BaseRRRR , (0b0001101100000000100000, kWX, kZR, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 1 ), // #250
+ INST(Mul , BaseRRR , (0b0001101100000000011111, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 12 ), // #251
+ INST(Mvn , BaseMvnNeg , (0b00101010001000000000001111100000) , kRWI_W , 0 , 0 ), // #252
+ INST(Neg , BaseMvnNeg , (0b01001011000000000000001111100000) , kRWI_W , 0 , 1 ), // #253
+ INST(Negs , BaseMvnNeg , (0b01101011000000000000001111100000) , kRWI_W , 0 , 2 ), // #254
+ INST(Ngc , BaseRR , (0b01011010000000000000001111100000, kWX, kZR, 0, kWX, kZR, 16, true) , kRWI_W , 0 , 7 ), // #255
+ INST(Ngcs , BaseRR , (0b01111010000000000000001111100000, kWX, kZR, 0, kWX, kZR, 16, true) , kRWI_W , 0 , 8 ), // #256
+ INST(Nop , BaseOp , (0b11010101000000110010000000011111) , 0 , 0 , 13 ), // #257
+ INST(Orn , BaseLogical , (0b0101010001, 0b01100100, 1) , kRWI_W , 0 , 6 ), // #258
+ INST(Orr , BaseLogical , (0b0101010000, 0b01100100, 0) , kRWI_W , 0 , 7 ), // #259
+ INST(Pacda , BaseRR , (0b11011010110000010000100000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 9 ), // #260
+ INST(Pacdb , BaseRR , (0b11011010110000010000110000000000, kX, kZR, 0, kX, kSP, 5, true) , kRWI_X , 0 , 10 ), // #261
+ INST(Pacdza , BaseR , (0b11011010110000010010101111100000, kX, kZR, 0) , kRWI_X , 0 , 4 ), // #262
+ INST(Pacdzb , BaseR , (0b11011010110000010010111111100000, kX, kZR, 0) , kRWI_X , 0 , 5 ), // #263
+ INST(Pacga , BaseRRR , (0b1001101011000000001100, kX, kZR, kX, kZR, kX, kSP, false) , kRWI_W , 0 , 13 ), // #264
+ INST(Prfm , BasePrfm , (0b11111000101, 0b1111100110, 0b11111000100, 0b11011000) , kRWI_R , 0 , 0 ), // #265
+ INST(Pssbb , BaseOp , (0b11010101000000110011010010011111) , 0 , 0 , 14 ), // #266
+ INST(Rbit , BaseRR , (0b01011010110000000000000000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 11 ), // #267
+ INST(Ret , BaseBranchReg , (0b11010110010111110000000000000000) , kRWI_R , 0 , 2 ), // #268
+ INST(Rev , BaseRev , (_) , kRWI_W , 0 , 0 ), // #269
+ INST(Rev16 , BaseRR , (0b01011010110000000000010000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 12 ), // #270
+ INST(Rev32 , BaseRR , (0b11011010110000000000100000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 13 ), // #271
+ INST(Rev64 , BaseRR , (0b11011010110000000000110000000000, kWX, kZR, 0, kWX, kZR, 5, true) , kRWI_W , 0 , 14 ), // #272
+ INST(Ror , BaseShift , (0b0001101011000000001011, 0b0001001110000000000000, 1) , kRWI_W , 0 , 6 ), // #273
+ INST(Rorv , BaseShift , (0b0001101011000000001011, 0b0000000000000000000000, 1) , kRWI_W , 0 , 7 ), // #274
+ INST(Sbc , BaseRRR , (0b0101101000000000000000, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 14 ), // #275
+ INST(Sbcs , BaseRRR , (0b0111101000000000000000, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 15 ), // #276
+ INST(Sbfiz , BaseBfi , (0b00010011000000000000000000000000) , kRWI_W , 0 , 1 ), // #277
+ INST(Sbfm , BaseBfm , (0b00010011000000000000000000000000) , kRWI_W , 0 , 1 ), // #278
+ INST(Sbfx , BaseBfx , (0b00010011000000000000000000000000) , kRWI_W , 0 , 1 ), // #279
+ INST(Sdiv , BaseRRR , (0b0001101011000000000011, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 16 ), // #280
+ INST(Setf8 , BaseR , (0b00111010000000000000100000001101, kW, kZR, 5) , 0 , 0 , 6 ), // #281
+ INST(Setf16 , BaseR , (0b00111010000000000100100000001101, kW, kZR, 5) , 0 , 0 , 7 ), // #282
+ INST(Sev , BaseOp , (0b11010101000000110010000010011111) , 0 , 0 , 15 ), // #283
+ INST(Sevl , BaseOp , (0b11010101000000110010000010111111) , 0 , 0 , 16 ), // #284
+ INST(Smaddl , BaseRRRR , (0b1001101100100000000000, kX , kZR, kW , kZR, kW , kZR, kX , kZR, false) , kRWI_W , 0 , 2 ), // #285
+ INST(Smc , BaseOpImm , (0b11010100000000000000000000000011, 16, 5) , 0 , 0 , 11 ), // #286
+ INST(Smnegl , BaseRRR , (0b1001101100100000111111, kX , kZR, kW , kZR, kW , kZR, false) , kRWI_W , 0 , 17 ), // #287
+ INST(Smsubl , BaseRRRR , (0b1001101100100000100000, kX , kZR, kW , kZR, kW , kZR, kX , kZR, false) , kRWI_W , 0 , 3 ), // #288
+ INST(Smulh , BaseRRR , (0b1001101101000000011111, kX , kZR, kX , kZR, kX , kZR, true) , kRWI_W , 0 , 18 ), // #289
+ INST(Smull , BaseRRR , (0b1001101100100000011111, kX , kZR, kW , kZR, kW , kZR, false) , kRWI_W , 0 , 19 ), // #290
+ INST(Ssbb , BaseOp , (0b11010101000000110011000010011111) , 0 , 0 , 17 ), // #291
+ INST(St2g , BaseRM_SImm9 , (0b1101100110100000000010, 0b1101100110100000000001, kX, kSP, 0, 4) , kRWI_RW , 0 , 13 ), // #292
+ INST(Stadd , BaseAtomicSt , (0b1011100000100000000000, kWX, 30) , kRWI_RX , 0 , 0 ), // #293
+ INST(Staddl , BaseAtomicSt , (0b1011100001100000000000, kWX, 30) , kRWI_RX , 0 , 1 ), // #294
+ INST(Staddb , BaseAtomicSt , (0b0011100000100000000000, kW , 0 ) , kRWI_RX , 0 , 2 ), // #295
+ INST(Staddlb , BaseAtomicSt , (0b0011100001100000000000, kW , 0 ) , kRWI_RX , 0 , 3 ), // #296
+ INST(Staddh , BaseAtomicSt , (0b0111100000100000000000, kW , 0 ) , kRWI_RX , 0 , 4 ), // #297
+ INST(Staddlh , BaseAtomicSt , (0b0111100001100000000000, kW , 0 ) , kRWI_RX , 0 , 5 ), // #298
+ INST(Stclr , BaseAtomicSt , (0b1011100000100000000100, kWX, 30) , kRWI_RX , 0 , 6 ), // #299
+ INST(Stclrl , BaseAtomicSt , (0b1011100001100000000100, kWX, 30) , kRWI_RX , 0 , 7 ), // #300
+ INST(Stclrb , BaseAtomicSt , (0b0011100000100000000100, kW , 0 ) , kRWI_RX , 0 , 8 ), // #301
+ INST(Stclrlb , BaseAtomicSt , (0b0011100001100000000100, kW , 0 ) , kRWI_RX , 0 , 9 ), // #302
+ INST(Stclrh , BaseAtomicSt , (0b0111100000100000000100, kW , 0 ) , kRWI_RX , 0 , 10 ), // #303
+ INST(Stclrlh , BaseAtomicSt , (0b0111100001100000000100, kW , 0 ) , kRWI_RX , 0 , 11 ), // #304
+ INST(Steor , BaseAtomicSt , (0b1011100000100000001000, kWX, 30) , kRWI_RX , 0 , 12 ), // #305
+ INST(Steorl , BaseAtomicSt , (0b1011100001100000001000, kWX, 30) , kRWI_RX , 0 , 13 ), // #306
+ INST(Steorb , BaseAtomicSt , (0b0011100000100000001000, kW , 0 ) , kRWI_RX , 0 , 14 ), // #307
+ INST(Steorlb , BaseAtomicSt , (0b0011100001100000001000, kW , 0 ) , kRWI_RX , 0 , 15 ), // #308
+ INST(Steorh , BaseAtomicSt , (0b0111100000100000001000, kW , 0 ) , kRWI_RX , 0 , 16 ), // #309
+ INST(Steorlh , BaseAtomicSt , (0b0111100001100000001000, kW , 0 ) , kRWI_RX , 0 , 17 ), // #310
+ INST(Stg , BaseRM_SImm9 , (0b1101100100100000000010, 0b1101100100100000000001, kX, kSP, 0, 4) , kRWI_RW , 0 , 14 ), // #311
+ INST(Stgm , BaseRM_NoImm , (0b1101100110100000000000, kX , kZR, 0 ) , kRWI_RW , 0 , 13 ), // #312
+ INST(Stgp , BaseLdpStp , (0b0110100100, 0b0110100010, kX, 0, 4) , kRWI_RRW , 0 , 3 ), // #313
+ INST(Stllr , BaseRM_NoImm , (0b1000100010011111011111, kWX, kZR, 30) , kRWI_RW , 0 , 14 ), // #314
+ INST(Stllrb , BaseRM_NoImm , (0b0000100010011111011111, kW , kZR, 0 ) , kRWI_RW , 0 , 15 ), // #315
+ INST(Stllrh , BaseRM_NoImm , (0b0100100010011111011111, kW , kZR, 0 ) , kRWI_RW , 0 , 16 ), // #316
+ INST(Stlr , BaseRM_NoImm , (0b1000100010011111111111, kWX, kZR, 30) , kRWI_RW , 0 , 17 ), // #317
+ INST(Stlrb , BaseRM_NoImm , (0b0000100010011111111111, kW , kZR, 0 ) , kRWI_RW , 0 , 18 ), // #318
+ INST(Stlrh , BaseRM_NoImm , (0b0100100010011111111111, kW , kZR, 0 ) , kRWI_RW , 0 , 19 ), // #319
+ INST(Stlxp , BaseStxp , (0b1000100000100000100000, kWX, 30) , kRWI_WRRX , 0 , 0 ), // #320
+ INST(Stlxr , BaseAtomicOp , (0b1000100000000000111111, kWX, 30, 1) , kRWI_WRX , 0 , 108), // #321
+ INST(Stlxrb , BaseAtomicOp , (0b0000100000000000111111, kW , 0 , 1) , kRWI_WRX , 0 , 109), // #322
+ INST(Stlxrh , BaseAtomicOp , (0b0100100000000000111111, kW , 0 , 1) , kRWI_WRX , 0 , 110), // #323
+ INST(Stnp , BaseLdpStp , (0b0010100000, 0 , kWX, 31, 2) , kRWI_RRW , 0 , 4 ), // #324
+ INST(Stp , BaseLdpStp , (0b0010100100, 0b0010100010, kWX, 31, 2) , kRWI_RRW , 0 , 5 ), // #325
+ INST(Str , BaseLdSt , (0b1011100100, 0b10111000000, 0b10111000001, 0 , kWX, 30, 2, Inst::kIdStur) , kRWI_RW , 0 , 6 ), // #326
+ INST(Strb , BaseLdSt , (0b0011100100, 0b00111000000, 0b00111000001, 0 , kW , 30, 0, Inst::kIdSturb) , kRWI_RW , 0 , 7 ), // #327
+ INST(Strh , BaseLdSt , (0b0111100100, 0b01111000000, 0b01111000001, 0 , kWX, 30, 1, Inst::kIdSturh) , kRWI_RW , 0 , 8 ), // #328
+ INST(Stset , BaseAtomicSt , (0b1011100000100000001100, kWX, 30) , kRWI_RX , 0 , 18 ), // #329
+ INST(Stsetl , BaseAtomicSt , (0b1011100001100000001100, kWX, 30) , kRWI_RX , 0 , 19 ), // #330
+ INST(Stsetb , BaseAtomicSt , (0b0011100000100000001100, kW , 0 ) , kRWI_RX , 0 , 20 ), // #331
+ INST(Stsetlb , BaseAtomicSt , (0b0011100001100000001100, kW , 0 ) , kRWI_RX , 0 , 21 ), // #332
+ INST(Stseth , BaseAtomicSt , (0b0111100000100000001100, kW , 0 ) , kRWI_RX , 0 , 22 ), // #333
+ INST(Stsetlh , BaseAtomicSt , (0b0111100001100000001100, kW , 0 ) , kRWI_RX , 0 , 23 ), // #334
+ INST(Stsmax , BaseAtomicSt , (0b1011100000100000010000, kWX, 30) , kRWI_RX , 0 , 24 ), // #335
+ INST(Stsmaxl , BaseAtomicSt , (0b1011100001100000010000, kWX, 30) , kRWI_RX , 0 , 25 ), // #336
+ INST(Stsmaxb , BaseAtomicSt , (0b0011100000100000010000, kW , 0 ) , kRWI_RX , 0 , 26 ), // #337
+ INST(Stsmaxlb , BaseAtomicSt , (0b0011100001100000010000, kW , 0 ) , kRWI_RX , 0 , 27 ), // #338
+ INST(Stsmaxh , BaseAtomicSt , (0b0111100000100000010000, kW , 0 ) , kRWI_RX , 0 , 28 ), // #339
+ INST(Stsmaxlh , BaseAtomicSt , (0b0111100001100000010000, kW , 0 ) , kRWI_RX , 0 , 29 ), // #340
+ INST(Stsmin , BaseAtomicSt , (0b1011100000100000010100, kWX, 30) , kRWI_RX , 0 , 30 ), // #341
+ INST(Stsminl , BaseAtomicSt , (0b1011100001100000010100, kWX, 30) , kRWI_RX , 0 , 31 ), // #342
+ INST(Stsminb , BaseAtomicSt , (0b0011100000100000010100, kW , 0 ) , kRWI_RX , 0 , 32 ), // #343
+ INST(Stsminlb , BaseAtomicSt , (0b0011100001100000010100, kW , 0 ) , kRWI_RX , 0 , 33 ), // #344
+ INST(Stsminh , BaseAtomicSt , (0b0111100000100000010100, kW , 0 ) , kRWI_RX , 0 , 34 ), // #345
+ INST(Stsminlh , BaseAtomicSt , (0b0111100001100000010100, kW , 0 ) , kRWI_RX , 0 , 35 ), // #346
+ INST(Sttr , BaseRM_SImm9 , (0b1011100000000000000010, 0b0000000000000000000000, kWX, kZR, 30, 0) , kRWI_RW , 0 , 15 ), // #347
+ INST(Sttrb , BaseRM_SImm9 , (0b0011100000000000000010, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_RW , 0 , 16 ), // #348
+ INST(Sttrh , BaseRM_SImm9 , (0b0111100000000000000010, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_RW , 0 , 17 ), // #349
+ INST(Stumax , BaseAtomicSt , (0b1011100000100000011000, kWX, 30) , kRWI_RX , 0 , 36 ), // #350
+ INST(Stumaxl , BaseAtomicSt , (0b1011100001100000011000, kWX, 30) , kRWI_RX , 0 , 37 ), // #351
+ INST(Stumaxb , BaseAtomicSt , (0b0011100000100000011000, kW , 0 ) , kRWI_RX , 0 , 38 ), // #352
+ INST(Stumaxlb , BaseAtomicSt , (0b0011100001100000011000, kW , 0 ) , kRWI_RX , 0 , 39 ), // #353
+ INST(Stumaxh , BaseAtomicSt , (0b0111100000100000011000, kW , 0 ) , kRWI_RX , 0 , 40 ), // #354
+ INST(Stumaxlh , BaseAtomicSt , (0b0111100001100000011000, kW , 0 ) , kRWI_RX , 0 , 41 ), // #355
+ INST(Stumin , BaseAtomicSt , (0b1011100000100000011100, kWX, 30) , kRWI_RX , 0 , 42 ), // #356
+ INST(Stuminl , BaseAtomicSt , (0b1011100001100000011100, kWX, 30) , kRWI_RX , 0 , 43 ), // #357
+ INST(Stuminb , BaseAtomicSt , (0b0011100000100000011100, kW , 0 ) , kRWI_RX , 0 , 44 ), // #358
+ INST(Stuminlb , BaseAtomicSt , (0b0011100001100000011100, kW , 0 ) , kRWI_RX , 0 , 45 ), // #359
+ INST(Stuminh , BaseAtomicSt , (0b0111100000100000011100, kW , 0 ) , kRWI_RX , 0 , 46 ), // #360
+ INST(Stuminlh , BaseAtomicSt , (0b0111100001100000011100, kW , 0 ) , kRWI_RX , 0 , 47 ), // #361
+ INST(Stur , BaseRM_SImm9 , (0b1011100000000000000000, 0b0000000000000000000000, kWX, kZR, 30, 0) , kRWI_RW , 0 , 18 ), // #362
+ INST(Sturb , BaseRM_SImm9 , (0b0011100000000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_RW , 0 , 19 ), // #363
+ INST(Sturh , BaseRM_SImm9 , (0b0111100000000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0) , kRWI_RW , 0 , 20 ), // #364
+ INST(Stxp , BaseStxp , (0b1000100000100000000000, kWX, 30) , kRWI_WRRW , 0 , 1 ), // #365
+ INST(Stxr , BaseStx , (0b1000100000000000011111, kWX, 30) , kRWI_WRW , 0 , 0 ), // #366
+ INST(Stxrb , BaseStx , (0b0000100000000000011111, kW , 0 ) , kRWI_WRW , 0 , 1 ), // #367
+ INST(Stxrh , BaseStx , (0b0100100000000000011111, kW , 0 ) , kRWI_WRW , 0 , 2 ), // #368
+ INST(Stz2g , BaseRM_SImm9 , (0b1101100111100000000010, 0b1101100111100000000001, kX , kSP, 0, 4) , kRWI_RW , 0 , 21 ), // #369
+ INST(Stzg , BaseRM_SImm9 , (0b1101100101100000000010, 0b1101100101100000000001, kX , kSP, 0, 4) , kRWI_RW , 0 , 22 ), // #370
+ INST(Stzgm , BaseRM_NoImm , (0b1101100100100000000000, kX , kZR, 0) , kRWI_RW , 0 , 20 ), // #371
+ INST(Sub , BaseAddSub , (0b1001011000, 0b1001011001, 0b1010001) , kRWI_W , 0 , 2 ), // #372
+ INST(Subg , BaseRRII , (0b1101000110000000000000, kX, kSP, kX, kSP, 6, 4, 16, 4, 0, 10) , kRWI_W , 0 , 1 ), // #373
+ INST(Subp , BaseRRR , (0b1001101011000000000000, kX, kZR, kX, kSP, kX, kSP, false) , kRWI_W , 0 , 20 ), // #374
+ INST(Subps , BaseRRR , (0b1011101011000000000000, kX, kZR, kX, kSP, kX, kSP, false) , kRWI_W , 0 , 21 ), // #375
+ INST(Subs , BaseAddSub , (0b1101011000, 0b1101011001, 0b1110001) , kRWI_W , 0 , 3 ), // #376
+ INST(Svc , BaseOpImm , (0b11010100000000000000000000000001, 16, 5) , 0 , 0 , 12 ), // #377
+ INST(Swp , BaseAtomicOp , (0b1011100000100000100000, kWX, 30, 1) , kRWI_RWX , 0 , 111), // #378
+ INST(Swpa , BaseAtomicOp , (0b1011100010100000100000, kWX, 30, 1) , kRWI_RWX , 0 , 112), // #379
+ INST(Swpab , BaseAtomicOp , (0b0011100010100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 113), // #380
+ INST(Swpah , BaseAtomicOp , (0b0111100010100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 114), // #381
+ INST(Swpal , BaseAtomicOp , (0b1011100011100000100000, kWX, 30, 1) , kRWI_RWX , 0 , 115), // #382
+ INST(Swpalb , BaseAtomicOp , (0b0011100011100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 116), // #383
+ INST(Swpalh , BaseAtomicOp , (0b0111100011100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 117), // #384
+ INST(Swpb , BaseAtomicOp , (0b0011100000100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 118), // #385
+ INST(Swph , BaseAtomicOp , (0b0111100000100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 119), // #386
+ INST(Swpl , BaseAtomicOp , (0b1011100001100000100000, kWX, 30, 1) , kRWI_RWX , 0 , 120), // #387
+ INST(Swplb , BaseAtomicOp , (0b0011100001100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 121), // #388
+ INST(Swplh , BaseAtomicOp , (0b0111100001100000100000, kW , 0 , 1) , kRWI_RWX , 0 , 122), // #389
+ INST(Sxtb , BaseExtend , (0b0001001100000000000111, kWX, 0) , kRWI_W , 0 , 0 ), // #390
+ INST(Sxth , BaseExtend , (0b0001001100000000001111, kWX, 0) , kRWI_W , 0 , 1 ), // #391
+ INST(Sxtw , BaseExtend , (0b1001001101000000011111, kX , 0) , kRWI_W , 0 , 2 ), // #392
+ INST(Sys , BaseSys , (_) , kRWI_W , 0 , 0 ), // #393
+ INST(Tlbi , BaseAtDcIcTlbi , (0b00011110000000, 0b00010000000000, false) , kRWI_RX , 0 , 3 ), // #394
+ INST(Tst , BaseTst , (0b1101010000, 0b111001000) , kRWI_R , 0 , 0 ), // #395
+ INST(Tbnz , BaseBranchTst , (0b00110111000000000000000000000000) , kRWI_R , 0 , 0 ), // #396
+ INST(Tbz , BaseBranchTst , (0b00110110000000000000000000000000) , kRWI_R , 0 , 1 ), // #397
+ INST(Ubfiz , BaseBfi , (0b01010011000000000000000000000000) , kRWI_W , 0 , 2 ), // #398
+ INST(Ubfm , BaseBfm , (0b01010011000000000000000000000000) , kRWI_W , 0 , 2 ), // #399
+ INST(Ubfx , BaseBfx , (0b01010011000000000000000000000000) , kRWI_W , 0 , 2 ), // #400
+ INST(Udf , BaseOpImm , (0b00000000000000000000000000000000, 16, 0) , 0 , 0 , 13 ), // #401
+ INST(Udiv , BaseRRR , (0b0001101011000000000010, kWX, kZR, kWX, kZR, kWX, kZR, true) , kRWI_W , 0 , 22 ), // #402
+ INST(Umaddl , BaseRRRR , (0b1001101110100000000000, kX , kZR, kW , kZR, kW , kZR, kX , kZR, false) , kRWI_W , 0 , 4 ), // #403
+ INST(Umnegl , BaseRRR , (0b1001101110100000111111, kX , kZR, kW , kZR, kW , kZR, false) , kRWI_W , 0 , 23 ), // #404
+ INST(Umull , BaseRRR , (0b1001101110100000011111, kX , kZR, kW , kZR, kW , kZR, false) , kRWI_W , 0 , 24 ), // #405
+ INST(Umulh , BaseRRR , (0b1001101111000000011111, kX , kZR, kX , kZR, kX , kZR, false) , kRWI_W , 0 , 25 ), // #406
+ INST(Umsubl , BaseRRRR , (0b1001101110100000100000, kX , kZR, kW , kZR, kW , kZR, kX , kZR, false) , kRWI_W , 0 , 5 ), // #407
+ INST(Uxtb , BaseExtend , (0b0101001100000000000111, kW, 1) , kRWI_W , 0 , 3 ), // #408
+ INST(Uxth , BaseExtend , (0b0101001100000000001111, kW, 1) , kRWI_W , 0 , 4 ), // #409
+ INST(Wfe , BaseOp , (0b11010101000000110010000001011111) , 0 , 0 , 18 ), // #410
+ INST(Wfi , BaseOp , (0b11010101000000110010000001111111) , 0 , 0 , 19 ), // #411
+ INST(Xaflag , BaseOp , (0b11010101000000000100000000111111) , 0 , 0 , 20 ), // #412
+ INST(Xpacd , BaseR , (0b11011010110000010100011111100000, kX, kZR, 0) , kRWI_X , 0 , 8 ), // #413
+ INST(Xpaci , BaseR , (0b11011010110000010100001111100000, kX, kZR, 0) , kRWI_X , 0 , 9 ), // #414
+ INST(Xpaclri , BaseOp , (0b11010101000000110010000011111111) , kRWI_X , 0 , 21 ), // #415
+ INST(Yield , BaseOp , (0b11010101000000110010000000111111) , 0 , 0 , 22 ), // #416
+ INST(Abs_v , ISimdVV , (0b0000111000100000101110, kVO_V_Any) , kRWI_W , 0 , 0 ), // #417
+ INST(Add_v , ISimdVVV , (0b0000111000100000100001, kVO_V_Any) , kRWI_W , 0 , 0 ), // #418
+ INST(Addhn_v , ISimdVVV , (0b0000111000100000010000, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 1 ), // #419
+ INST(Addhn2_v , ISimdVVV , (0b0100111000100000010000, kVO_V_B16H8S4) , kRWI_W , F(Narrow) , 2 ), // #420
+ INST(Addp_v , ISimdPair , (0b0101111000110001101110, 0b0000111000100000101111, kVO_V_Any) , kRWI_W , F(Pair) , 0 ), // #421
+ INST(Addv_v , ISimdSV , (0b0000111000110001101110, kVO_V_BH_4S) , kRWI_W , 0 , 0 ), // #422
+ INST(Aesd_v , ISimdVVx , (0b0100111000101000010110, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 0 ), // #423
+ INST(Aese_v , ISimdVVx , (0b0100111000101000010010, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 1 ), // #424
+ INST(Aesimc_v , ISimdVVx , (0b0100111000101000011110, kOp_V16B, kOp_V16B) , kRWI_W , 0 , 2 ), // #425
+ INST(Aesmc_v , ISimdVVx , (0b0100111000101000011010, kOp_V16B, kOp_V16B) , kRWI_W , 0 , 3 ), // #426
+ INST(And_v , ISimdVVV , (0b0000111000100000000111, kVO_V_B) , kRWI_W , 0 , 3 ), // #427
+ INST(Bcax_v , ISimdVVVV , (0b1100111000100000000000, kVO_V_B16) , kRWI_W , 0 , 0 ), // #428
+ INST(Bfcvt_v , ISimdVVx , (0b0001111001100011010000, kOp_H, kOp_S) , kRWI_W , 0 , 4 ), // #429
+ INST(Bfcvtn_v , ISimdVVx , (0b0000111010100001011010, kOp_V4H, kOp_V4S) , kRWI_W , F(Narrow) , 5 ), // #430
+ INST(Bfcvtn2_v , ISimdVVx , (0b0100111010100001011010, kOp_V8H, kOp_V4S) , kRWI_W , F(Narrow) , 6 ), // #431
+ INST(Bfdot_v , SimdDot , (0b0010111001000000111111, 0b0000111101000000111100, kET_S, kET_H, kET_2H) , kRWI_X , 0 , 0 ), // #432
+ INST(Bfmlalb_v , SimdFmlal , (0b0010111011000000111111, 0b0000111111000000111100, 0, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 0 ), // #433
+ INST(Bfmlalt_v , SimdFmlal , (0b0110111011000000111111, 0b0100111111000000111100, 0, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 1 ), // #434
+ INST(Bfmmla_v , ISimdVVVx , (0b0110111001000000111011, kOp_V4S, kOp_V8H, kOp_V8H) , kRWI_X , F(Long) , 0 ), // #435
+ INST(Bic_v , SimdBicOrr , (0b0000111001100000000111, 0b0010111100000000000001) , kRWI_W , 0 , 0 ), // #436
+ INST(Bif_v , ISimdVVV , (0b0010111011100000000111, kVO_V_B) , kRWI_X , 0 , 4 ), // #437
+ INST(Bit_v , ISimdVVV , (0b0010111010100000000111, kVO_V_B) , kRWI_X , 0 , 5 ), // #438
+ INST(Bsl_v , ISimdVVV , (0b0010111001100000000111, kVO_V_B) , kRWI_X , 0 , 6 ), // #439
+ INST(Cls_v , ISimdVV , (0b0000111000100000010010, kVO_V_BHS) , kRWI_W , 0 , 1 ), // #440
+ INST(Clz_v , ISimdVV , (0b0010111000100000010010, kVO_V_BHS) , kRWI_W , 0 , 2 ), // #441
+ INST(Cmeq_v , SimdCmp , (0b0010111000100000100011, 0b0000111000100000100110, kVO_V_Any) , kRWI_W , 0 , 0 ), // #442
+ INST(Cmge_v , SimdCmp , (0b0000111000100000001111, 0b0010111000100000100010, kVO_V_Any) , kRWI_W , 0 , 1 ), // #443
+ INST(Cmgt_v , SimdCmp , (0b0000111000100000001101, 0b0000111000100000100010, kVO_V_Any) , kRWI_W , 0 , 2 ), // #444
+ INST(Cmhi_v , SimdCmp , (0b0010111000100000001101, 0b0000000000000000000000, kVO_V_Any) , kRWI_W , 0 , 3 ), // #445
+ INST(Cmhs_v , SimdCmp , (0b0010111000100000001111, 0b0000000000000000000000, kVO_V_Any) , kRWI_W , 0 , 4 ), // #446
+ INST(Cmle_v , SimdCmp , (0b0000000000000000000000, 0b0010111000100000100110, kVO_V_Any) , kRWI_W , 0 , 5 ), // #447
+ INST(Cmlt_v , SimdCmp , (0b0000000000000000000000, 0b0000111000100000101010, kVO_V_Any) , kRWI_W , 0 , 6 ), // #448
+ INST(Cmtst_v , ISimdVVV , (0b0000111000100000100011, kVO_V_Any) , kRWI_W , 0 , 7 ), // #449
+ INST(Cnt_v , ISimdVV , (0b0000111000100000010110, kVO_V_B) , kRWI_W , 0 , 3 ), // #450
+ INST(Dup_v , SimdDup , (_) , kRWI_W , 0 , 0 ), // #451
+ INST(Eor_v , ISimdVVV , (0b0010111000100000000111, kVO_V_B) , kRWI_W , 0 , 8 ), // #452
+ INST(Eor3_v , ISimdVVVV , (0b1100111000000000000000, kVO_V_B16) , kRWI_W , 0 , 1 ), // #453
+ INST(Ext_v , ISimdVVVI , (0b0010111000000000000000, kVO_V_B, 4, 11, 1) , kRWI_W , 0 , 0 ), // #454
+ INST(Fabd_v , FSimdVVV , (0b0111111010100000110101, kHF_C, 0b0010111010100000110101, kHF_C) , kRWI_W , 0 , 0 ), // #455
+ INST(Fabs_v , FSimdVV , (0b0001111000100000110000, kHF_A, 0b0000111010100000111110, kHF_B) , kRWI_W , 0 , 0 ), // #456
+ INST(Facge_v , FSimdVVV , (0b0111111000100000111011, kHF_C, 0b0010111000100000111011, kHF_C) , kRWI_W , 0 , 1 ), // #457
+ INST(Facgt_v , FSimdVVV , (0b0111111010100000111011, kHF_C, 0b0010111010100000111011, kHF_C) , kRWI_W , 0 , 2 ), // #458
+ INST(Fadd_v , FSimdVVV , (0b0001111000100000001010, kHF_A, 0b0000111000100000110101, kHF_C) , kRWI_W , 0 , 3 ), // #459
+ INST(Faddp_v , FSimdPair , (0b0111111000110000110110, 0b0010111000100000110101) , kRWI_W , 0 , 0 ), // #460
+ INST(Fcadd_v , SimdFcadd , (0b0010111000000000111001) , kRWI_W , 0 , 0 ), // #461
+ INST(Fccmp_v , SimdFccmpFccmpe , (0b00011110001000000000010000000000) , kRWI_R , 0 , 0 ), // #462
+ INST(Fccmpe_v , SimdFccmpFccmpe , (0b00011110001000000000010000010000) , kRWI_R , 0 , 1 ), // #463
+ INST(Fcmeq_v , SimdFcm , (0b0000111000100000111001, kHF_C, 0b0000111010100000110110) , kRWI_W , 0 , 0 ), // #464
+ INST(Fcmge_v , SimdFcm , (0b0010111000100000111001, kHF_C, 0b0010111010100000110010) , kRWI_W , 0 , 1 ), // #465
+ INST(Fcmgt_v , SimdFcm , (0b0010111010100000111001, kHF_C, 0b0000111010100000110010) , kRWI_W , 0 , 2 ), // #466
+ INST(Fcmla_v , SimdFcmla , (0b0010111000000000110001, 0b0010111100000000000100) , kRWI_X , 0 , 0 ), // #467
+ INST(Fcmle_v , SimdFcm , (0b0000000000000000000000, kHF_C, 0b0010111010100000110110) , kRWI_W , 0 , 3 ), // #468
+ INST(Fcmlt_v , SimdFcm , (0b0000000000000000000000, kHF_C, 0b0000111010100000111010) , kRWI_W , 0 , 4 ), // #469
+ INST(Fcmp_v , SimdFcmpFcmpe , (0b00011110001000000010000000000000) , kRWI_R , 0 , 0 ), // #470
+ INST(Fcmpe_v , SimdFcmpFcmpe , (0b00011110001000000010000000010000) , kRWI_R , 0 , 1 ), // #471
+ INST(Fcsel_v , SimdFcsel , (_) , kRWI_W , 0 , 0 ), // #472
+ INST(Fcvt_v , SimdFcvt , (_) , kRWI_W , 0 , 0 ), // #473
+ INST(Fcvtas_v , SimdFcvtSV , (0b0000111000100001110010, 0b0000000000000000000000, 0b0001111000100100000000, 1) , kRWI_W , 0 , 0 ), // #474
+ INST(Fcvtau_v , SimdFcvtSV , (0b0010111000100001110010, 0b0000000000000000000000, 0b0001111000100101000000, 1) , kRWI_W , 0 , 1 ), // #475
+ INST(Fcvtl_v , SimdFcvtLN , (0b0000111000100001011110, 0, 0) , kRWI_W , F(Long) , 0 ), // #476
+ INST(Fcvtl2_v , SimdFcvtLN , (0b0100111000100001011110, 0, 0) , kRWI_W , F(Long) , 1 ), // #477
+ INST(Fcvtms_v , SimdFcvtSV , (0b0000111000100001101110, 0b0000000000000000000000, 0b0001111000110000000000, 1) , kRWI_W , 0 , 2 ), // #478
+ INST(Fcvtmu_v , SimdFcvtSV , (0b0010111000100001101110, 0b0000000000000000000000, 0b0001111000110001000000, 1) , kRWI_W , 0 , 3 ), // #479
+ INST(Fcvtn_v , SimdFcvtLN , (0b0000111000100001011010, 0, 0) , kRWI_W , F(Narrow) , 2 ), // #480
+ INST(Fcvtn2_v , SimdFcvtLN , (0b0100111000100001011010, 0, 0) , kRWI_X , F(Narrow) , 3 ), // #481
+ INST(Fcvtns_v , SimdFcvtSV , (0b0000111000100001101010, 0b0000000000000000000000, 0b0001111000100000000000, 1) , kRWI_W , 0 , 4 ), // #482
+ INST(Fcvtnu_v , SimdFcvtSV , (0b0010111000100001101010, 0b0000000000000000000000, 0b0001111000100001000000, 1) , kRWI_W , 0 , 5 ), // #483
+ INST(Fcvtps_v , SimdFcvtSV , (0b0000111010100001101010, 0b0000000000000000000000, 0b0001111000101000000000, 1) , kRWI_W , 0 , 6 ), // #484
+ INST(Fcvtpu_v , SimdFcvtSV , (0b0010111010100001101010, 0b0000000000000000000000, 0b0001111000101001000000, 1) , kRWI_W , 0 , 7 ), // #485
+ INST(Fcvtxn_v , SimdFcvtLN , (0b0010111000100001011010, 1, 1) , kRWI_W , F(Narrow) , 4 ), // #486
+ INST(Fcvtxn2_v , SimdFcvtLN , (0b0110111000100001011010, 1, 0) , kRWI_X , F(Narrow) , 5 ), // #487
+ INST(Fcvtzs_v , SimdFcvtSV , (0b0000111010100001101110, 0b0000111100000000111111, 0b0001111000111000000000, 1) , kRWI_W , 0 , 8 ), // #488
+ INST(Fcvtzu_v , SimdFcvtSV , (0b0010111010100001101110, 0b0010111100000000111111, 0b0001111000111001000000, 1) , kRWI_W , 0 , 9 ), // #489
+ INST(Fdiv_v , FSimdVVV , (0b0001111000100000000110, kHF_A, 0b0010111000100000111111, kHF_C) , kRWI_W , 0 , 4 ), // #490
+ INST(Fjcvtzs_v , ISimdVVx , (0b0001111001111110000000, kOp_GpW, kOp_D) , kRWI_W , 0 , 7 ), // #491
+ INST(Fmadd_v , FSimdVVVV , (0b0001111100000000000000, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 0 ), // #492
+ INST(Fmax_v , FSimdVVV , (0b0001111000100000010010, kHF_A, 0b0000111000100000111101, kHF_C) , kRWI_W , 0 , 5 ), // #493
+ INST(Fmaxnm_v , FSimdVVV , (0b0001111000100000011010, kHF_A, 0b0000111000100000110001, kHF_C) , kRWI_W , 0 , 6 ), // #494
+ INST(Fmaxnmp_v , FSimdPair , (0b0111111000110000110010, 0b0010111000100000110001) , kRWI_W , 0 , 1 ), // #495
+ INST(Fmaxnmv_v , FSimdSV , (0b0010111000110000110010) , kRWI_W , 0 , 0 ), // #496
+ INST(Fmaxp_v , FSimdPair , (0b0111111000110000111110, 0b0010111000100000111101) , kRWI_W , 0 , 2 ), // #497
+ INST(Fmaxv_v , FSimdSV , (0b0010111000110000111110) , kRWI_W , 0 , 1 ), // #498
+ INST(Fmin_v , FSimdVVV , (0b0001111000100000010110, kHF_A, 0b0000111010100000111101, kHF_C) , kRWI_W , 0 , 7 ), // #499
+ INST(Fminnm_v , FSimdVVV , (0b0001111000100000011110, kHF_A, 0b0000111010100000110001, kHF_C) , kRWI_W , 0 , 8 ), // #500
+ INST(Fminnmp_v , FSimdPair , (0b0111111010110000110010, 0b0010111010100000110001) , kRWI_W , 0 , 3 ), // #501
+ INST(Fminnmv_v , FSimdSV , (0b0010111010110000110010) , kRWI_W , 0 , 2 ), // #502
+ INST(Fminp_v , FSimdPair , (0b0111111010110000111110, 0b0010111010100000111101) , kRWI_W , 0 , 4 ), // #503
+ INST(Fminv_v , FSimdSV , (0b0010111010110000111110) , kRWI_W , 0 , 3 ), // #504
+ INST(Fmla_v , FSimdVVVe , (0b0000000000000000000000, kHF_N, 0b0000111000100000110011, 0b0000111110000000000100) , kRWI_X , F(VH0_15) , 0 ), // #505
+ INST(Fmlal_v , SimdFmlal , (0b0000111000100000111011, 0b0000111110000000000000, 1, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 2 ), // #506
+ INST(Fmlal2_v , SimdFmlal , (0b0010111000100000110011, 0b0010111110000000100000, 1, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 3 ), // #507
+ INST(Fmls_v , FSimdVVVe , (0b0000000000000000000000, kHF_N, 0b0000111010100000110011, 0b0000111110000000010100) , kRWI_X , F(VH0_15) , 1 ), // #508
+ INST(Fmlsl_v , SimdFmlal , (0b0000111010100000111011, 0b0000111110000000010000, 1, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 4 ), // #509
+ INST(Fmlsl2_v , SimdFmlal , (0b0010111010100000110011, 0b0010111110000000110000, 1, kET_S, kET_H, kET_H) , kRWI_X , F(VH0_15) , 5 ), // #510
+ INST(Fmov_v , SimdFmov , (_) , kRWI_W , 0 , 0 ), // #511
+ INST(Fmsub_v , FSimdVVVV , (0b0001111100000000100000, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 1 ), // #512
+ INST(Fmul_v , FSimdVVVe , (0b0001111000100000000010, kHF_A, 0b0010111000100000110111, 0b0000111110000000100100) , kRWI_W , F(VH0_15) , 2 ), // #513
+ INST(Fmulx_v , FSimdVVVe , (0b0101111000100000110111, kHF_C, 0b0000111000100000110111, 0b0010111110000000100100) , kRWI_W , F(VH0_15) , 3 ), // #514
+ INST(Fneg_v , FSimdVV , (0b0001111000100001010000, kHF_A, 0b0010111010100000111110, kHF_B) , kRWI_W , 0 , 1 ), // #515
+ INST(Fnmadd_v , FSimdVVVV , (0b0001111100100000000000, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 2 ), // #516
+ INST(Fnmsub_v , FSimdVVVV , (0b0001111100100000100000, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 3 ), // #517
+ INST(Fnmul_v , FSimdVVV , (0b0001111000100000100010, kHF_A, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 9 ), // #518
+ INST(Frecpe_v , FSimdVV , (0b0101111010100001110110, kHF_B, 0b0000111010100001110110, kHF_B) , kRWI_W , 0 , 2 ), // #519
+ INST(Frecps_v , FSimdVVV , (0b0101111000100000111111, kHF_C, 0b0000111000100000111111, kHF_C) , kRWI_W , 0 , 10 ), // #520
+ INST(Frecpx_v , FSimdVV , (0b0101111010100001111110, kHF_B, 0b0000000000000000000000, kHF_N) , kRWI_W , 0 , 3 ), // #521
+ INST(Frint32x_v , FSimdVV , (0b0001111000101000110000, kHF_N, 0b0010111000100001111010, kHF_N) , kRWI_W , 0 , 4 ), // #522
+ INST(Frint32z_v , FSimdVV , (0b0001111000101000010000, kHF_N, 0b0000111000100001111010, kHF_N) , kRWI_W , 0 , 5 ), // #523
+ INST(Frint64x_v , FSimdVV , (0b0001111000101001110000, kHF_N, 0b0010111000100001111110, kHF_N) , kRWI_W , 0 , 6 ), // #524
+ INST(Frint64z_v , FSimdVV , (0b0001111000101001010000, kHF_N, 0b0000111000100001111110, kHF_N) , kRWI_W , 0 , 7 ), // #525
+ INST(Frinta_v , FSimdVV , (0b0001111000100110010000, kHF_A, 0b0010111000100001100010, kHF_B) , kRWI_W , 0 , 8 ), // #526
+ INST(Frinti_v , FSimdVV , (0b0001111000100111110000, kHF_A, 0b0010111010100001100110, kHF_B) , kRWI_W , 0 , 9 ), // #527
+ INST(Frintm_v , FSimdVV , (0b0001111000100101010000, kHF_A, 0b0000111000100001100110, kHF_B) , kRWI_W , 0 , 10 ), // #528
+ INST(Frintn_v , FSimdVV , (0b0001111000100100010000, kHF_A, 0b0000111000100001100010, kHF_B) , kRWI_W , 0 , 11 ), // #529
+ INST(Frintp_v , FSimdVV , (0b0001111000100100110000, kHF_A, 0b0000111010100001100010, kHF_B) , kRWI_W , 0 , 12 ), // #530
+ INST(Frintx_v , FSimdVV , (0b0001111000100111010000, kHF_A, 0b0010111000100001100110, kHF_B) , kRWI_W , 0 , 13 ), // #531
+ INST(Frintz_v , FSimdVV , (0b0001111000100101110000, kHF_A, 0b0000111010100001100110, kHF_B) , kRWI_W , 0 , 14 ), // #532
+ INST(Frsqrte_v , FSimdVV , (0b0111111010100001110110, kHF_B, 0b0010111010100001110110, kHF_B) , kRWI_W , 0 , 15 ), // #533
+ INST(Frsqrts_v , FSimdVVV , (0b0101111010100000111111, kHF_C, 0b0000111010100000111111, kHF_C) , kRWI_W , 0 , 11 ), // #534
+ INST(Fsqrt_v , FSimdVV , (0b0001111000100001110000, kHF_A, 0b0010111010100001111110, kHF_B) , kRWI_W , 0 , 16 ), // #535
+ INST(Fsub_v , FSimdVVV , (0b0001111000100000001110, kHF_A, 0b0000111010100000110101, kHF_C) , kRWI_W , 0 , 12 ), // #536
+ INST(Ins_v , SimdIns , (_) , kRWI_X , 0 , 0 ), // #537
+ INST(Ld1_v , SimdLdNStN , (0b0000110101000000000000, 0b0000110001000000001000, 1, 0) , kRWI_LDn , F(Consecutive) , 0 ), // #538
+ INST(Ld1r_v , SimdLdNStN , (0b0000110101000000110000, 0b0000000000000000000000, 1, 1) , kRWI_LDn , F(Consecutive) , 1 ), // #539
+ INST(Ld2_v , SimdLdNStN , (0b0000110101100000000000, 0b0000110001000000100000, 2, 0) , kRWI_LDn , F(Consecutive) , 2 ), // #540
+ INST(Ld2r_v , SimdLdNStN , (0b0000110101100000110000, 0b0000000000000000000000, 2, 1) , kRWI_LDn , F(Consecutive) , 3 ), // #541
+ INST(Ld3_v , SimdLdNStN , (0b0000110101000000001000, 0b0000110001000000010000, 3, 0) , kRWI_LDn , F(Consecutive) , 4 ), // #542
+ INST(Ld3r_v , SimdLdNStN , (0b0000110101000000111000, 0b0000000000000000000000, 3, 1) , kRWI_LDn , F(Consecutive) , 5 ), // #543
+ INST(Ld4_v , SimdLdNStN , (0b0000110101100000001000, 0b0000110001000000000000, 4, 0) , kRWI_LDn , F(Consecutive) , 6 ), // #544
+ INST(Ld4r_v , SimdLdNStN , (0b0000110101100000111000, 0b0000000000000000000000, 4, 1) , kRWI_LDn , F(Consecutive) , 7 ), // #545
+ INST(Ldnp_v , SimdLdpStp , (0b0010110001, 0b0000000000) , kRWI_WW , 0 , 0 ), // #546
+ INST(Ldp_v , SimdLdpStp , (0b0010110101, 0b0010110011) , kRWI_WW , 0 , 1 ), // #547
+ INST(Ldr_v , SimdLdSt , (0b0011110101, 0b00111100010, 0b00111100011, 0b00011100, Inst::kIdLdur_v) , kRWI_W , 0 , 0 ), // #548
+ INST(Ldur_v , SimdLdurStur , (0b0011110001000000000000) , kRWI_W , 0 , 0 ), // #549
+ INST(Mla_v , ISimdVVVe , (0b0000111000100000100101, kVO_V_BHS, 0b0010111100000000000000, kVO_V_HS) , kRWI_X , F(VH0_15) , 0 ), // #550
+ INST(Mls_v , ISimdVVVe , (0b0010111000100000100101, kVO_V_BHS, 0b0010111100000000010000, kVO_V_HS) , kRWI_X , F(VH0_15) , 1 ), // #551
+ INST(Mov_v , SimdMov , (_) , kRWI_W , 0 , 0 ), // #552
+ INST(Movi_v , SimdMoviMvni , (0b0000111100000000000001, 0) , kRWI_W , 0 , 0 ), // #553
+ INST(Mul_v , ISimdVVVe , (0b0000111000100000100111, kVO_V_BHS, 0b0000111100000000100000, kVO_V_HS) , kRWI_W , F(VH0_15) , 2 ), // #554
+ INST(Mvn_v , ISimdVV , (0b0010111000100000010110, kVO_V_B) , kRWI_W , 0 , 4 ), // #555
+ INST(Mvni_v , SimdMoviMvni , (0b0000111100000000000001, 1) , kRWI_W , 0 , 1 ), // #556
+ INST(Neg_v , ISimdVV , (0b0010111000100000101110, kVO_V_Any) , kRWI_W , 0 , 5 ), // #557
+ INST(Not_v , ISimdVV , (0b0010111000100000010110, kVO_V_B) , kRWI_W , 0 , 6 ), // #558
+ INST(Orn_v , ISimdVVV , (0b0000111011100000000111, kVO_V_B) , kRWI_W , 0 , 9 ), // #559
+ INST(Orr_v , SimdBicOrr , (0b0000111010100000000111, 0b0000111100000000000001) , kRWI_W , 0 , 1 ), // #560
+ INST(Pmul_v , ISimdVVV , (0b0010111000100000100111, kVO_V_B) , kRWI_W , 0 , 10 ), // #561
+ INST(Pmull_v , ISimdVVV , (0b0000111000100000111000, kVO_V_B8D1) , kRWI_W , F(Long) , 11 ), // #562
+ INST(Pmull2_v , ISimdVVV , (0b0100111000100000111000, kVO_V_B16D2) , kRWI_W , F(Long) , 12 ), // #563
+ INST(Raddhn_v , ISimdVVV , (0b0010111000100000010000, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 13 ), // #564
+ INST(Raddhn2_v , ISimdVVV , (0b0110111000100000010000, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 14 ), // #565
+ INST(Rax1_v , ISimdVVV , (0b1100111001100000100011, kVO_V_D2) , kRWI_W , 0 , 15 ), // #566
+ INST(Rbit_v , ISimdVV , (0b0010111001100000010110, kVO_V_B) , kRWI_W , 0 , 7 ), // #567
+ INST(Rev16_v , ISimdVV , (0b0000111000100000000110, kVO_V_B) , kRWI_W , 0 , 8 ), // #568
+ INST(Rev32_v , ISimdVV , (0b0010111000100000000010, kVO_V_BH) , kRWI_W , 0 , 9 ), // #569
+ INST(Rev64_v , ISimdVV , (0b0000111000100000000010, kVO_V_BHS) , kRWI_W , 0 , 10 ), // #570
+ INST(Rshrn_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000100011, 1, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 0 ), // #571
+ INST(Rshrn2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000100011, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 1 ), // #572
+ INST(Rsubhn_v , ISimdVVV , (0b0010111000100000011000, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 16 ), // #573
+ INST(Rsubhn2_v , ISimdVVV , (0b0110111000100000011000, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 17 ), // #574
+ INST(Saba_v , ISimdVVV , (0b0000111000100000011111, kVO_V_BHS) , kRWI_X , 0 , 18 ), // #575
+ INST(Sabal_v , ISimdVVV , (0b0000111000100000010100, kVO_V_B8H4S2) , kRWI_X , F(Long) , 19 ), // #576
+ INST(Sabal2_v , ISimdVVV , (0b0100111000100000010100, kVO_V_B16H8S4) , kRWI_X , F(Long) , 20 ), // #577
+ INST(Sabd_v , ISimdVVV , (0b0000111000100000011101, kVO_V_BHS) , kRWI_W , 0 , 21 ), // #578
+ INST(Sabdl_v , ISimdVVV , (0b0000111000100000011100, kVO_V_B8H4S2) , kRWI_W , F(Long) , 22 ), // #579
+ INST(Sabdl2_v , ISimdVVV , (0b0100111000100000011100, kVO_V_B16H8S4) , kRWI_W , F(Long) , 23 ), // #580
+ INST(Sadalp_v , ISimdVV , (0b0000111000100000011010, kVO_V_BHS) , kRWI_X , F(Long) | F(Pair) , 11 ), // #581
+ INST(Saddl_v , ISimdVVV , (0b0000111000100000000000, kVO_V_B8H4S2) , kRWI_W , F(Long) , 24 ), // #582
+ INST(Saddl2_v , ISimdVVV , (0b0100111000100000000000, kVO_V_B16H8S4) , kRWI_W , F(Long) , 25 ), // #583
+ INST(Saddlp_v , ISimdVV , (0b0000111000100000001010, kVO_V_BHS) , kRWI_W , F(Long) | F(Pair) , 12 ), // #584
+ INST(Saddlv_v , ISimdSV , (0b0000111000110000001110, kVO_V_BH_4S) , kRWI_W , F(Long) , 1 ), // #585
+ INST(Saddw_v , ISimdWWV , (0b0000111000100000000100, kVO_V_B8H4S2) , kRWI_W , 0 , 0 ), // #586
+ INST(Saddw2_v , ISimdWWV , (0b0000111000100000000100, kVO_V_B16H8S4) , kRWI_W , 0 , 1 ), // #587
+ INST(Scvtf_v , SimdFcvtSV , (0b0000111000100001110110, 0b0000111100000000111001, 0b0001111000100010000000, 0) , kRWI_W , 0 , 10 ), // #588
+ INST(Sdot_v , SimdDot , (0b0000111010000000100101, 0b0000111110000000111000, kET_S, kET_B, kET_4B) , kRWI_X , 0 , 1 ), // #589
+ INST(Sha1c_v , ISimdVVVx , (0b0101111000000000000000, kOp_Q, kOp_S, kOp_V4S) , kRWI_X , 0 , 1 ), // #590
+ INST(Sha1h_v , ISimdVVx , (0b0101111000101000000010, kOp_S, kOp_S) , kRWI_W , 0 , 8 ), // #591
+ INST(Sha1m_v , ISimdVVVx , (0b0101111000000000001000, kOp_Q, kOp_S, kOp_V4S) , kRWI_X , 0 , 2 ), // #592
+ INST(Sha1p_v , ISimdVVVx , (0b0101111000000000000100, kOp_Q, kOp_S, kOp_V4S) , kRWI_X , 0 , 3 ), // #593
+ INST(Sha1su0_v , ISimdVVVx , (0b0101111000000000001100, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 4 ), // #594
+ INST(Sha1su1_v , ISimdVVx , (0b0101111000101000000110, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 9 ), // #595
+ INST(Sha256h_v , ISimdVVVx , (0b0101111000000000010000, kOp_Q, kOp_Q, kOp_V4S) , kRWI_X , 0 , 5 ), // #596
+ INST(Sha256h2_v , ISimdVVVx , (0b0101111000000000010100, kOp_Q, kOp_Q, kOp_V4S) , kRWI_X , 0 , 6 ), // #597
+ INST(Sha256su0_v , ISimdVVx , (0b0101111000101000001010, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 10 ), // #598
+ INST(Sha256su1_v , ISimdVVVx , (0b0101111000000000011000, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 7 ), // #599
+ INST(Sha512h_v , ISimdVVVx , (0b1100111001100000100000, kOp_Q, kOp_Q, kOp_V2D) , kRWI_X , 0 , 8 ), // #600
+ INST(Sha512h2_v , ISimdVVVx , (0b1100111001100000100001, kOp_Q, kOp_Q, kOp_V2D) , kRWI_X , 0 , 9 ), // #601
+ INST(Sha512su0_v , ISimdVVx , (0b1100111011000000100000, kOp_V2D, kOp_V2D) , kRWI_X , 0 , 11 ), // #602
+ INST(Sha512su1_v , ISimdVVVx , (0b1100111001100000100010, kOp_V2D, kOp_V2D, kOp_V2D) , kRWI_X , 0 , 10 ), // #603
+ INST(Shadd_v , ISimdVVV , (0b0000111000100000000001, kVO_V_BHS) , kRWI_W , 0 , 26 ), // #604
+ INST(Shl_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000010101, 0, kVO_V_Any) , kRWI_W , 0 , 2 ), // #605
+ INST(Shll_v , SimdShiftES , (0b0010111000100001001110, kVO_V_B8H4S2) , kRWI_W , F(Long) , 0 ), // #606
+ INST(Shll2_v , SimdShiftES , (0b0110111000100001001110, kVO_V_B16H8S4) , kRWI_W , F(Long) , 1 ), // #607
+ INST(Shrn_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000100001, 1, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 3 ), // #608
+ INST(Shrn2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000100001, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 4 ), // #609
+ INST(Shsub_v , ISimdVVV , (0b0000111000100000001001, kVO_V_BHS) , kRWI_W , 0 , 27 ), // #610
+ INST(Sli_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000010101, 0, kVO_V_Any) , kRWI_X , 0 , 5 ), // #611
+ INST(Sm3partw1_v , ISimdVVVx , (0b1100111001100000110000, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 11 ), // #612
+ INST(Sm3partw2_v , ISimdVVVx , (0b1100111001100000110001, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 12 ), // #613
+ INST(Sm3ss1_v , ISimdVVVVx , (0b1100111001000000000000, kOp_V4S, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_W , 0 , 0 ), // #614
+ INST(Sm3tt1a_v , SimdSm3tt , (0b1100111001000000100000) , kRWI_X , 0 , 0 ), // #615
+ INST(Sm3tt1b_v , SimdSm3tt , (0b1100111001000000100001) , kRWI_X , 0 , 1 ), // #616
+ INST(Sm3tt2a_v , SimdSm3tt , (0b1100111001000000100010) , kRWI_X , 0 , 2 ), // #617
+ INST(Sm3tt2b_v , SimdSm3tt , (0b1100111001000000100011) , kRWI_X , 0 , 3 ), // #618
+ INST(Sm4e_v , ISimdVVx , (0b1100111011000000100001, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 12 ), // #619
+ INST(Sm4ekey_v , ISimdVVVx , (0b1100111001100000110010, kOp_V4S, kOp_V4S, kOp_V4S) , kRWI_X , 0 , 13 ), // #620
+ INST(Smax_v , ISimdVVV , (0b0000111000100000011001, kVO_V_BHS) , kRWI_W , 0 , 28 ), // #621
+ INST(Smaxp_v , ISimdVVV , (0b0000111000100000101001, kVO_V_BHS) , kRWI_W , 0 , 29 ), // #622
+ INST(Smaxv_v , ISimdSV , (0b0000111000110000101010, kVO_V_BH_4S) , kRWI_W , 0 , 2 ), // #623
+ INST(Smin_v , ISimdVVV , (0b0000111000100000011011, kVO_V_BHS) , kRWI_W , 0 , 30 ), // #624
+ INST(Sminp_v , ISimdVVV , (0b0000111000100000101011, kVO_V_BHS) , kRWI_W , 0 , 31 ), // #625
+ INST(Sminv_v , ISimdSV , (0b0000111000110001101010, kVO_V_BH_4S) , kRWI_W , 0 , 3 ), // #626
+ INST(Smlal_v , ISimdVVVe , (0b0000111000100000100000, kVO_V_B8H4S2, 0b0000111100000000001000, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 3 ), // #627
+ INST(Smlal2_v , ISimdVVVe , (0b0100111000100000100000, kVO_V_B16H8S4, 0b0100111100000000001000, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 4 ), // #628
+ INST(Smlsl_v , ISimdVVVe , (0b0000111000100000101000, kVO_V_B8H4S2, 0b0000111100000000011000, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 5 ), // #629
+ INST(Smlsl2_v , ISimdVVVe , (0b0100111000100000101000, kVO_V_B16H8S4, 0b0100111100000000011000, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 6 ), // #630
+ INST(Smmla_v , ISimdVVVx , (0b0100111010000000101001, kOp_V4S, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 14 ), // #631
+ INST(Smov_v , SimdSmovUmov , (0b0000111000000000001011, kVO_V_BHS, 1) , kRWI_W , 0 , 0 ), // #632
+ INST(Smull_v , ISimdVVVe , (0b0000111000100000110000, kVO_V_B8H4S2, 0b0000111100000000101000, kVO_V_H4S2) , kRWI_W , F(Long) | F(VH0_15) , 7 ), // #633
+ INST(Smull2_v , ISimdVVVe , (0b0100111000100000110000, kVO_V_B16H8S4, 0b0100111100000000101000, kVO_V_H8S4) , kRWI_W , F(Long) | F(VH0_15) , 8 ), // #634
+ INST(Sqabs_v , ISimdVV , (0b0000111000100000011110, kVO_SV_Any) , kRWI_W , 0 , 13 ), // #635
+ INST(Sqadd_v , ISimdVVV , (0b0000111000100000000011, kVO_SV_Any) , kRWI_W , 0 , 32 ), // #636
+ INST(Sqdmlal_v , ISimdVVVe , (0b0000111000100000100100, kVO_SV_BHS, 0b0000111100000000001100, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 9 ), // #637
+ INST(Sqdmlal2_v , ISimdVVVe , (0b0100111000100000100100, kVO_V_B16H8S4, 0b0100111100000000001100, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 10 ), // #638
+ INST(Sqdmlsl_v , ISimdVVVe , (0b0000111000100000101100, kVO_SV_BHS, 0b0000111100000000011100, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 11 ), // #639
+ INST(Sqdmlsl2_v , ISimdVVVe , (0b0100111000100000101100, kVO_V_B16H8S4, 0b0100111100000000011100, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 12 ), // #640
+ INST(Sqdmulh_v , ISimdVVVe , (0b0000111000100000101101, kVO_SV_HS, 0b0000111100000000110000, kVO_SV_HS) , kRWI_W , F(VH0_15) , 13 ), // #641
+ INST(Sqdmull_v , ISimdVVVe , (0b0000111000100000110100, kVO_SV_BHS, 0b0000111100000000101100, kVO_V_H4S2) , kRWI_W , F(Long) | F(VH0_15) , 14 ), // #642
+ INST(Sqdmull2_v , ISimdVVVe , (0b0100111000100000110100, kVO_V_B16H8S4, 0b0100111100000000101100, kVO_V_H8S4) , kRWI_W , F(Long) | F(VH0_15) , 15 ), // #643
+ INST(Sqneg_v , ISimdVV , (0b0010111000100000011110, kVO_SV_Any) , kRWI_W , 0 , 14 ), // #644
+ INST(Sqrdmlah_v , ISimdVVVe , (0b0010111000000000100001, kVO_SV_HS, 0b0010111100000000110100, kVO_SV_HS) , kRWI_X , F(VH0_15) , 16 ), // #645
+ INST(Sqrdmlsh_v , ISimdVVVe , (0b0010111000000000100011, kVO_SV_HS, 0b0010111100000000111100, kVO_SV_HS) , kRWI_X , F(VH0_15) , 17 ), // #646
+ INST(Sqrdmulh_v , ISimdVVVe , (0b0010111000100000101101, kVO_SV_HS, 0b0000111100000000110100, kVO_SV_HS) , kRWI_W , F(VH0_15) , 18 ), // #647
+ INST(Sqrshl_v , SimdShift , (0b0000111000100000010111, 0b0000000000000000000000, 1, kVO_SV_Any) , kRWI_W , 0 , 6 ), // #648
+ INST(Sqrshrn_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000100111, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 7 ), // #649
+ INST(Sqrshrn2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000100111, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 8 ), // #650
+ INST(Sqrshrun_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000100011, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 9 ), // #651
+ INST(Sqrshrun2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000100011, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 10 ), // #652
+ INST(Sqshl_v , SimdShift , (0b0000111000100000010011, 0b0000111100000000011101, 0, kVO_SV_Any) , kRWI_W , 0 , 11 ), // #653
+ INST(Sqshlu_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000011001, 0, kVO_SV_Any) , kRWI_W , 0 , 12 ), // #654
+ INST(Sqshrn_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000100101, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 13 ), // #655
+ INST(Sqshrn2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000100101, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 14 ), // #656
+ INST(Sqshrun_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000100001, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 15 ), // #657
+ INST(Sqshrun2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000100001, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 16 ), // #658
+ INST(Sqsub_v , ISimdVVV , (0b0000111000100000001011, kVO_SV_Any) , kRWI_W , 0 , 33 ), // #659
+ INST(Sqxtn_v , ISimdVV , (0b0000111000100001010010, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 15 ), // #660
+ INST(Sqxtn2_v , ISimdVV , (0b0100111000100001010010, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 16 ), // #661
+ INST(Sqxtun_v , ISimdVV , (0b0010111000100001001010, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 17 ), // #662
+ INST(Sqxtun2_v , ISimdVV , (0b0110111000100001001010, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 18 ), // #663
+ INST(Srhadd_v , ISimdVVV , (0b0000111000100000000101, kVO_V_BHS) , kRWI_W , 0 , 34 ), // #664
+ INST(Sri_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000010001, 1, kVO_V_Any) , kRWI_W , 0 , 17 ), // #665
+ INST(Srshl_v , SimdShift , (0b0000111000100000010101, 0b0000000000000000000000, 0, kVO_V_Any) , kRWI_W , 0 , 18 ), // #666
+ INST(Srshr_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000001001, 1, kVO_V_Any) , kRWI_W , 0 , 19 ), // #667
+ INST(Srsra_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000001101, 1, kVO_V_Any) , kRWI_X , 0 , 20 ), // #668
+ INST(Sshl_v , SimdShift , (0b0000111000100000010001, 0b0000000000000000000000, 0, kVO_V_Any) , kRWI_W , 0 , 21 ), // #669
+ INST(Sshll_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000101001, 0, kVO_V_B8H4S2) , kRWI_W , F(Long) , 22 ), // #670
+ INST(Sshll2_v , SimdShift , (0b0000000000000000000000, 0b0100111100000000101001, 0, kVO_V_B16H8S4) , kRWI_W , F(Long) , 23 ), // #671
+ INST(Sshr_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000000001, 1, kVO_V_Any) , kRWI_W , 0 , 24 ), // #672
+ INST(Ssra_v , SimdShift , (0b0000000000000000000000, 0b0000111100000000000101, 1, kVO_V_Any) , kRWI_X , 0 , 25 ), // #673
+ INST(Ssubl_v , ISimdVVV , (0b0000111000100000001000, kVO_V_B8H4S2) , kRWI_W , F(Long) , 35 ), // #674
+ INST(Ssubl2_v , ISimdVVV , (0b0100111000100000001000, kVO_V_B16H8S4) , kRWI_W , F(Long) , 36 ), // #675
+ INST(Ssubw_v , ISimdWWV , (0b0000111000100000001100, kVO_V_B8H4S2) , kRWI_W , 0 , 2 ), // #676
+ INST(Ssubw2_v , ISimdWWV , (0b0000111000100000001100, kVO_V_B16H8S4) , kRWI_X , 0 , 3 ), // #677
+ INST(St1_v , SimdLdNStN , (0b0000110100000000000000, 0b0000110000000000001000, 1, 0) , kRWI_STn , F(Consecutive) , 8 ), // #678
+ INST(St2_v , SimdLdNStN , (0b0000110100100000000000, 0b0000110000000000100000, 2, 0) , kRWI_STn , F(Consecutive) , 9 ), // #679
+ INST(St3_v , SimdLdNStN , (0b0000110100000000001000, 0b0000110000000000010000, 3, 0) , kRWI_STn , F(Consecutive) , 10 ), // #680
+ INST(St4_v , SimdLdNStN , (0b0000110100100000001000, 0b0000110000000000000000, 4, 0) , kRWI_STn , F(Consecutive) , 11 ), // #681
+ INST(Stnp_v , SimdLdpStp , (0b0010110000, 0b0000000000) , kRWI_RRW , 0 , 2 ), // #682
+ INST(Stp_v , SimdLdpStp , (0b0010110100, 0b0010110010) , kRWI_RRW , 0 , 3 ), // #683
+ INST(Str_v , SimdLdSt , (0b0011110100, 0b00111100000, 0b00111100001, 0b00000000, Inst::kIdStur_v) , kRWI_RW , 0 , 1 ), // #684
+ INST(Stur_v , SimdLdurStur , (0b0011110000000000000000) , kRWI_RW , 0 , 1 ), // #685
+ INST(Sub_v , ISimdVVV , (0b0010111000100000100001, kVO_V_Any) , kRWI_W , 0 , 37 ), // #686
+ INST(Subhn_v , ISimdVVV , (0b0000111000100000011000, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 38 ), // #687
+ INST(Subhn2_v , ISimdVVV , (0b0000111000100000011000, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 39 ), // #688
+ INST(Sudot_v , SimdDot , (0b0000000000000000000000, 0b0000111100000000111100, kET_S, kET_B, kET_4B) , kRWI_X , 0 , 2 ), // #689
+ INST(Suqadd_v , ISimdVV , (0b0000111000100000001110, kVO_SV_Any) , kRWI_X , 0 , 19 ), // #690
+ INST(Sxtl_v , SimdSxtlUxtl , (0b0000111100000000101001, kVO_V_B8H4S2) , kRWI_W , F(Long) , 0 ), // #691
+ INST(Sxtl2_v , SimdSxtlUxtl , (0b0100111100000000101001, kVO_V_B16H8S4) , kRWI_W , F(Long) , 1 ), // #692
+ INST(Tbl_v , SimdTblTbx , (0b0000111000000000000000) , kRWI_W , 0 , 0 ), // #693
+ INST(Tbx_v , SimdTblTbx , (0b0000111000000000000100) , kRWI_W , 0 , 1 ), // #694
+ INST(Trn1_v , ISimdVVV , (0b0000111000000000001010, kVO_V_BHS_D2) , kRWI_W , 0 , 40 ), // #695
+ INST(Trn2_v , ISimdVVV , (0b0000111000000000011010, kVO_V_BHS_D2) , kRWI_W , 0 , 41 ), // #696
+ INST(Uaba_v , ISimdVVV , (0b0010111000100000011111, kVO_V_BHS) , kRWI_X , 0 , 42 ), // #697
+ INST(Uabal_v , ISimdVVV , (0b0010111000100000010100, kVO_V_B8H4S2) , kRWI_X , F(Long) , 43 ), // #698
+ INST(Uabal2_v , ISimdVVV , (0b0110111000100000010100, kVO_V_B16H8S4) , kRWI_X , F(Long) , 44 ), // #699
+ INST(Uabd_v , ISimdVVV , (0b0010111000100000011101, kVO_V_BHS) , kRWI_W , 0 , 45 ), // #700
+ INST(Uabdl_v , ISimdVVV , (0b0010111000100000011100, kVO_V_B8H4S2) , kRWI_W , F(Long) , 46 ), // #701
+ INST(Uabdl2_v , ISimdVVV , (0b0110111000100000011100, kVO_V_B16H8S4) , kRWI_W , F(Long) , 47 ), // #702
+ INST(Uadalp_v , ISimdVV , (0b0010111000100000011010, kVO_V_BHS) , kRWI_X , F(Long) | F(Pair) , 20 ), // #703
+ INST(Uaddl_v , ISimdVVV , (0b0010111000100000000000, kVO_V_B8H4S2) , kRWI_W , F(Long) , 48 ), // #704
+ INST(Uaddl2_v , ISimdVVV , (0b0110111000100000000000, kVO_V_B16H8S4) , kRWI_W , F(Long) , 49 ), // #705
+ INST(Uaddlp_v , ISimdVV , (0b0010111000100000001010, kVO_V_BHS) , kRWI_W , F(Long) | F(Pair) , 21 ), // #706
+ INST(Uaddlv_v , ISimdSV , (0b0010111000110000001110, kVO_V_BH_4S) , kRWI_W , F(Long) , 4 ), // #707
+ INST(Uaddw_v , ISimdWWV , (0b0010111000100000000100, kVO_V_B8H4S2) , kRWI_W , 0 , 4 ), // #708
+ INST(Uaddw2_v , ISimdWWV , (0b0010111000100000000100, kVO_V_B16H8S4) , kRWI_W , 0 , 5 ), // #709
+ INST(Ucvtf_v , SimdFcvtSV , (0b0010111000100001110110, 0b0010111100000000111001, 0b0001111000100011000000, 0) , kRWI_W , 0 , 11 ), // #710
+ INST(Udot_v , SimdDot , (0b0010111010000000100101, 0b0010111110000000111000, kET_S, kET_B, kET_4B) , kRWI_X , 0 , 3 ), // #711
+ INST(Uhadd_v , ISimdVVV , (0b0010111000100000000001, kVO_V_BHS) , kRWI_W , 0 , 50 ), // #712
+ INST(Uhsub_v , ISimdVVV , (0b0010111000100000001001, kVO_V_BHS) , kRWI_W , 0 , 51 ), // #713
+ INST(Umax_v , ISimdVVV , (0b0010111000100000011001, kVO_V_BHS) , kRWI_W , 0 , 52 ), // #714
+ INST(Umaxp_v , ISimdVVV , (0b0010111000100000101001, kVO_V_BHS) , kRWI_W , 0 , 53 ), // #715
+ INST(Umaxv_v , ISimdSV , (0b0010111000110000101010, kVO_V_BH_4S) , kRWI_W , 0 , 5 ), // #716
+ INST(Umin_v , ISimdVVV , (0b0010111000100000011011, kVO_V_BHS) , kRWI_W , 0 , 54 ), // #717
+ INST(Uminp_v , ISimdVVV , (0b0010111000100000101011, kVO_V_BHS) , kRWI_W , 0 , 55 ), // #718
+ INST(Uminv_v , ISimdSV , (0b0010111000110001101010, kVO_V_BH_4S) , kRWI_W , 0 , 6 ), // #719
+ INST(Umlal_v , ISimdVVVe , (0b0010111000100000100000, kVO_V_B8H4S2, 0b0010111100000000001000, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 19 ), // #720
+ INST(Umlal2_v , ISimdVVVe , (0b0110111000100000100000, kVO_V_B16H8S4, 0b0010111100000000001000, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 20 ), // #721
+ INST(Umlsl_v , ISimdVVVe , (0b0010111000100000101000, kVO_V_B8H4S2, 0b0010111100000000011000, kVO_V_H4S2) , kRWI_X , F(Long) | F(VH0_15) , 21 ), // #722
+ INST(Umlsl2_v , ISimdVVVe , (0b0110111000100000101000, kVO_V_B16H8S4, 0b0110111100000000011000, kVO_V_H8S4) , kRWI_X , F(Long) | F(VH0_15) , 22 ), // #723
+ INST(Ummla_v , ISimdVVVx , (0b0110111010000000101001, kOp_V4S, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 15 ), // #724
+ INST(Umov_v , SimdSmovUmov , (0b0000111000000000001111, kVO_V_Any, 0) , kRWI_W , 0 , 1 ), // #725
+ INST(Umull_v , ISimdVVVe , (0b0010111000100000110000, kVO_V_B8H4S2, 0b0010111100000000101000, kVO_V_H4S2) , kRWI_W , F(Long) | F(VH0_15) , 23 ), // #726
+ INST(Umull2_v , ISimdVVVe , (0b0110111000100000110000, kVO_V_B16H8S4, 0b0110111100000000101000, kVO_V_H8S4) , kRWI_W , F(Long) | F(VH0_15) , 24 ), // #727
+ INST(Uqadd_v , ISimdVVV , (0b0010111000100000000011, kVO_SV_Any) , kRWI_W , 0 , 56 ), // #728
+ INST(Uqrshl_v , SimdShift , (0b0010111000100000010111, 0b0000000000000000000000, 0, kVO_SV_Any) , kRWI_W , 0 , 26 ), // #729
+ INST(Uqrshrn_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000100111, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 27 ), // #730
+ INST(Uqrshrn2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000100111, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 28 ), // #731
+ INST(Uqshl_v , SimdShift , (0b0010111000100000010011, 0b0010111100000000011101, 0, kVO_SV_Any) , kRWI_W , 0 , 29 ), // #732
+ INST(Uqshrn_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000100101, 1, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 30 ), // #733
+ INST(Uqshrn2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000100101, 1, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 31 ), // #734
+ INST(Uqsub_v , ISimdVVV , (0b0010111000100000001011, kVO_SV_Any) , kRWI_W , 0 , 57 ), // #735
+ INST(Uqxtn_v , ISimdVV , (0b0010111000100001010010, kVO_SV_B8H4S2) , kRWI_W , F(Narrow) , 22 ), // #736
+ INST(Uqxtn2_v , ISimdVV , (0b0110111000100001010010, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 23 ), // #737
+ INST(Urecpe_v , ISimdVV , (0b0000111010100001110010, kVO_V_S) , kRWI_W , 0 , 24 ), // #738
+ INST(Urhadd_v , ISimdVVV , (0b0010111000100000000101, kVO_V_BHS) , kRWI_W , 0 , 58 ), // #739
+ INST(Urshl_v , SimdShift , (0b0010111000100000010101, 0b0000000000000000000000, 0, kVO_V_Any) , kRWI_W , 0 , 32 ), // #740
+ INST(Urshr_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000001001, 1, kVO_V_Any) , kRWI_W , 0 , 33 ), // #741
+ INST(Ursqrte_v , ISimdVV , (0b0010111010100001110010, kVO_V_S) , kRWI_W , 0 , 25 ), // #742
+ INST(Ursra_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000001101, 1, kVO_V_Any) , kRWI_X , 0 , 34 ), // #743
+ INST(Usdot_v , SimdDot , (0b0000111010000000100111, 0b0000111110000000111100, kET_S, kET_B, kET_4B) , kRWI_X , 0 , 4 ), // #744
+ INST(Ushl_v , SimdShift , (0b0010111000100000010001, 0b0000000000000000000000, 0, kVO_V_Any) , kRWI_W , 0 , 35 ), // #745
+ INST(Ushll_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000101001, 0, kVO_V_B8H4S2) , kRWI_W , F(Long) , 36 ), // #746
+ INST(Ushll2_v , SimdShift , (0b0000000000000000000000, 0b0110111100000000101001, 0, kVO_V_B16H8S4) , kRWI_W , F(Long) , 37 ), // #747
+ INST(Ushr_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000000001, 1, kVO_V_Any) , kRWI_W , 0 , 38 ), // #748
+ INST(Usmmla_v , ISimdVVVx , (0b0100111010000000101011, kOp_V4S, kOp_V16B, kOp_V16B) , kRWI_X , 0 , 16 ), // #749
+ INST(Usqadd_v , ISimdVV , (0b0010111000100000001110, kVO_SV_Any) , kRWI_X , 0 , 26 ), // #750
+ INST(Usra_v , SimdShift , (0b0000000000000000000000, 0b0010111100000000000101, 1, kVO_V_Any) , kRWI_X , 0 , 39 ), // #751
+ INST(Usubl_v , ISimdVVV , (0b0010111000100000001000, kVO_V_B8H4S2) , kRWI_W , F(Long) , 59 ), // #752
+ INST(Usubl2_v , ISimdVVV , (0b0110111000100000001000, kVO_V_B16H8S4) , kRWI_W , F(Long) , 60 ), // #753
+ INST(Usubw_v , ISimdWWV , (0b0010111000100000001100, kVO_V_B8H4S2) , kRWI_W , 0 , 6 ), // #754
+ INST(Usubw2_v , ISimdWWV , (0b0010111000100000001100, kVO_V_B16H8S4) , kRWI_W , 0 , 7 ), // #755
+ INST(Uxtl_v , SimdSxtlUxtl , (0b0010111100000000101001, kVO_V_B8H4S2) , kRWI_W , F(Long) , 2 ), // #756
+ INST(Uxtl2_v , SimdSxtlUxtl , (0b0110111100000000101001, kVO_V_B16H8S4) , kRWI_W , F(Long) , 3 ), // #757
+ INST(Uzp1_v , ISimdVVV , (0b0000111000000000000110, kVO_V_BHS_D2) , kRWI_W , 0 , 61 ), // #758
+ INST(Uzp2_v , ISimdVVV , (0b0000111000000000010110, kVO_V_BHS_D2) , kRWI_W , 0 , 62 ), // #759
+ INST(Xar_v , ISimdVVVI , (0b1100111001100000100011, kVO_V_D2, 6, 10, 0) , kRWI_W , 0 , 1 ), // #760
+ INST(Xtn_v , ISimdVV , (0b0000111000100001001010, kVO_V_B8H4S2) , kRWI_W , F(Narrow) , 27 ), // #761
+ INST(Xtn2_v , ISimdVV , (0b0100111000100001001010, kVO_V_B16H8S4) , kRWI_X , F(Narrow) , 28 ), // #762
+ INST(Zip1_v , ISimdVVV , (0b0000111000000000001110, kVO_V_BHS_D2) , kRWI_W , 0 , 63 ), // #763
+ INST(Zip2_v , ISimdVVV , (0b0000111000000000011110, kVO_V_BHS_D2) , kRWI_W , 0 , 64 ) // #764
// ${InstInfo:End}
};
@@ -1132,8 +1124,8 @@ const BaseLdSt baseLdSt[9] = {
{ 0b1011100101, 0b10111000010, 0b10111000011, 0b00011000, kWX, 30, 2, Inst::kIdLdur }, // ldr
{ 0b0011100101, 0b00111000010, 0b00111000011, 0 , kW , 0 , 0, Inst::kIdLdurb }, // ldrb
{ 0b0111100101, 0b01111000010, 0b01111000011, 0 , kW , 0 , 1, Inst::kIdLdurh }, // ldrh
- { 0b0011100111, 0b00111000100, 0b00111000101, 0 , kWX, 22, 0, Inst::kIdLdursb }, // ldrsb
- { 0b0111100110, 0b01111000100, 0b01111000101, 0 , kWX, 22, 1, Inst::kIdLdursh }, // ldrsh
+ { 0b0011100111, 0b00111000100, 0b00111000111, 0 , kWX, 22, 0, Inst::kIdLdursb }, // ldrsb
+ { 0b0111100111, 0b01111000100, 0b01111000111, 0 , kWX, 22, 1, Inst::kIdLdursh }, // ldrsh
{ 0b1011100110, 0b10111000100, 0b10111000101, 0b10011000, kX , 0 , 2, Inst::kIdLdursw }, // ldrsw
{ 0b1011100100, 0b10111000000, 0b10111000001, 0 , kWX, 30, 2, Inst::kIdStur }, // str
{ 0b0011100100, 0b00111000000, 0b00111000001, 0 , kW , 30, 0, Inst::kIdSturb }, // strb
@@ -1220,6 +1212,10 @@ const BaseOpImm baseOpImm[14] = {
{ 0b00000000000000000000000000000000, 16, 0 } // udf
};
+const BasePrfm basePrfm[1] = {
+ { 0b11111000101, 0b1111100110, 0b11111000100, 0b11011000 } // prfm
+};
+
const BaseR baseR[10] = {
{ 0b11011010110000010011101111100000, kX, kZR, 0 }, // autdza
{ 0b11011010110000010011111111100000, kX, kZR, 0 }, // autdzb
@@ -1275,7 +1271,7 @@ const BaseRM_SImm9 baseRM_SImm9[23] = {
{ 0b0111100001000000000000, 0b0000000000000000000000, kW , kZR, 0 , 0 }, // ldurh
{ 0b0011100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0 }, // ldursb
{ 0b0111100011000000000000, 0b0000000000000000000000, kWX, kZR, 22, 0 }, // ldursh
- { 0b1011100010000000000000, 0b0000000000000000000000, kWX, kZR, 0 , 0 }, // ldursw
+ { 0b1011100010000000000000, 0b0000000000000000000000, kX , kZR, 0 , 0 }, // ldursw
{ 0b1101100110100000000010, 0b1101100110100000000001, kX, kSP, 0, 4 }, // st2g
{ 0b1101100100100000000010, 0b1101100100100000000001, kX, kSP, 0, 4 }, // stg
{ 0b1011100000000000000010, 0b0000000000000000000000, kWX, kZR, 30, 0 }, // sttr
@@ -1852,75 +1848,10 @@ const InstDB::CommonInfo InstDB::commonData[] = {
// ArmUtil - Id <-> Name
// =====================
-#ifndef ASMJIT_DISABLE_TEXT
+#ifndef ASMJIT_NO_TEXT
// ${NameData:Begin}
// ------------------- Automatically generated, do not edit -------------------
-const char InstDB::_nameData[] =
- "\0" "adc\0" "adcs\0" "addg\0" "adds\0" "addv\0" "adr\0" "adrp\0" "aesd\0" "aese\0" "aesimc\0" "aesmc\0" "and\0"
- "ands\0" "asr\0" "asrv\0" "at\0" "autda\0" "autdb\0" "autdza\0" "autdzb\0" "autia\0" "autia1716\0" "autiasp\0"
- "autiaz\0" "autib\0" "autib1716\0" "autibsp\0" "autibz\0" "autiza\0" "autizb\0" "axflag\0" "bcax\0" "bfc\0" "bfcvt\0"
- "bfcvtn\0" "bfcvtn2\0" "bfdot\0" "bfi\0" "bfmlalb\0" "bfmlalt\0" "bfmmla\0" "bfxil\0" "bic\0" "bics\0" "bif\0"
- "blr\0" "br\0" "brk\0" "bsl\0" "cas\0" "casa\0" "casab\0" "casah\0" "casal\0" "casalb\0" "casalh\0" "casb\0" "cash\0"
- "casl\0" "caslb\0" "caslh\0" "casp\0" "caspa\0" "caspal\0" "caspl\0" "cbnz\0" "cbz\0" "ccmn\0" "cfinv\0" "cinc\0"
- "cinv\0" "clrex\0" "cls\0" "clz\0" "cmhi\0" "cmhs\0" "cmpp\0" "cmtst\0" "cneg\0" "cnt\0" "crc32b\0" "crc32cb\0"
- "crc32ch\0" "crc32cw\0" "crc32cx\0" "crc32h\0" "crc32w\0" "crc32x\0" "csdb\0" "cset\0" "csetm\0" "csinc\0" "csinv\0"
- "csneg\0" "dcps1\0" "dcps2\0" "dcps3\0" "dgh\0" "dmb\0" "drps\0" "dsb\0" "dup\0" "eon\0" "eor3\0" "eret\0" "esb\0"
- "ext\0" "extr\0" "fabd\0" "fabs\0" "facge\0" "facgt\0" "fadd\0" "faddp\0" "fcadd\0" "fccmp\0" "fccmpe\0" "fcmeq\0"
- "fcmge\0" "fcmgt\0" "fcmla\0" "fcmle\0" "fcmlt\0" "fcmp\0" "fcmpe\0" "fcsel\0" "fcvtas\0" "fcvtau\0" "fcvtl\0"
- "fcvtl2\0" "fcvtms\0" "fcvtmu\0" "fcvtns\0" "fcvtnu\0" "fcvtps\0" "fcvtpu\0" "fcvtxn\0" "fcvtxn2\0" "fcvtzs\0"
- "fcvtzu\0" "fdiv\0" "fjcvtzs\0" "fmadd\0" "fmax\0" "fmaxnm\0" "fmaxnmp\0" "fmaxnmv\0" "fmaxp\0" "fmaxv\0" "fmin\0"
- "fminnm\0" "fminnmp\0" "fminnmv\0" "fminp\0" "fminv\0" "fmla\0" "fmlal\0" "fmlal2\0" "fmls\0" "fmlsl\0" "fmlsl2\0"
- "fmov\0" "fmsub\0" "fmul\0" "fmulx\0" "fneg\0" "fnmadd\0" "fnmsub\0" "fnmul\0" "frecpe\0" "frecps\0" "frecpx\0"
- "frint32x\0" "frint32z\0" "frint64x\0" "frint64z\0" "frinta\0" "frinti\0" "frintm\0" "frintn\0" "frintp\0" "frintx\0"
- "frintz\0" "frsqrte\0" "frsqrts\0" "fsqrt\0" "fsub\0" "gmi\0" "hint\0" "hlt\0" "hvc\0" "ins\0" "isb\0" "ld1\0"
- "ld1r\0" "ld2\0" "ld2r\0" "ld3\0" "ld3r\0" "ld4\0" "ld4r\0" "ldadd\0" "ldadda\0" "ldaddab\0" "ldaddah\0" "ldaddal\0"
- "ldaddalb\0" "ldaddalh\0" "ldaddb\0" "ldaddh\0" "ldaddl\0" "ldaddlb\0" "ldaddlh\0" "ldar\0" "ldarb\0" "ldarh\0"
- "ldaxp\0" "ldaxr\0" "ldaxrb\0" "ldaxrh\0" "ldclr\0" "ldclra\0" "ldclrab\0" "ldclrah\0" "ldclral\0" "ldclralb\0"
- "ldclralh\0" "ldclrb\0" "ldclrh\0" "ldclrl\0" "ldclrlb\0" "ldclrlh\0" "ldeor\0" "ldeora\0" "ldeorab\0" "ldeorah\0"
- "ldeoral\0" "ldeoralb\0" "ldeoralh\0" "ldeorb\0" "ldeorh\0" "ldeorl\0" "ldeorlb\0" "ldeorlh\0" "ldg\0" "ldgm\0"
- "ldlar\0" "ldlarb\0" "ldlarh\0" "ldnp\0" "ldp\0" "ldpsw\0" "ldr\0" "ldraa\0" "ldrab\0" "ldrb\0" "ldrh\0" "ldrsb\0"
- "ldrsh\0" "ldrsw\0" "ldset\0" "ldseta\0" "ldsetab\0" "ldsetah\0" "ldsetal\0" "ldsetalb\0" "ldsetalh\0" "ldsetb\0"
- "ldseth\0" "ldsetl\0" "ldsetlb\0" "ldsetlh\0" "ldsmax\0" "ldsmaxa\0" "ldsmaxab\0" "ldsmaxah\0" "ldsmaxal\0"
- "ldsmaxalb\0" "ldsmaxalh\0" "ldsmaxb\0" "ldsmaxh\0" "ldsmaxl\0" "ldsmaxlb\0" "ldsmaxlh\0" "ldsmin\0" "ldsmina\0"
- "ldsminab\0" "ldsminah\0" "ldsminal\0" "ldsminalb\0" "ldsminalh\0" "ldsminb\0" "ldsminh\0" "ldsminl\0" "ldsminlb\0"
- "ldsminlh\0" "ldtr\0" "ldtrb\0" "ldtrh\0" "ldtrsb\0" "ldtrsh\0" "ldtrsw\0" "ldumax\0" "ldumaxa\0" "ldumaxab\0"
- "ldumaxah\0" "ldumaxal\0" "ldumaxalb\0" "ldumaxalh\0" "ldumaxb\0" "ldumaxh\0" "ldumaxl\0" "ldumaxlb\0" "ldumaxlh\0"
- "ldumin\0" "ldumina\0" "lduminab\0" "lduminah\0" "lduminal\0" "lduminalb\0" "lduminalh\0" "lduminb\0" "lduminh\0"
- "lduminl\0" "lduminlb\0" "lduminlh\0" "ldur\0" "ldurb\0" "ldurh\0" "ldursb\0" "ldursh\0" "ldursw\0" "ldxp\0" "ldxr\0"
- "ldxrb\0" "ldxrh\0" "lslv\0" "lsr\0" "lsrv\0" "mneg\0" "movi\0" "movk\0" "movn\0" "movz\0" "mrs\0" "msr\0" "mvn\0"
- "mvni\0" "negs\0" "ngc\0" "ngcs\0" "nop\0" "not\0" "orn\0" "orr\0" "pacda\0" "pacdb\0" "pacdza\0" "pacdzb\0"
- "pacga\0" "pmul\0" "pmull\0" "pmull2\0" "pssbb\0" "raddhn\0" "raddhn2\0" "rax1\0" "rbit\0" "rev\0" "rev16\0"
- "rev32\0" "rev64\0" "ror\0" "rorv\0" "rsubhn\0" "rsubhn2\0" "saba\0" "sabal\0" "sabal2\0" "sabd\0" "sabdl\0"
- "sabdl2\0" "sadalp\0" "saddl\0" "saddl2\0" "saddlp\0" "saddlv\0" "saddw\0" "saddw2\0" "sbc\0" "sbcs\0" "sbfiz\0"
- "sbfm\0" "sbfx\0" "scvtf\0" "sdiv\0" "setf16\0" "setf8\0" "sev\0" "sevl\0" "sha1c\0" "sha1h\0" "sha1m\0" "sha1p\0"
- "sha1su0\0" "sha1su1\0" "sha256h\0" "sha256h2\0" "sha256su0\0" "sha256su1\0" "sha512h\0" "sha512h2\0" "sha512su0\0"
- "sha512su1\0" "shadd\0" "shsub\0" "sli\0" "sm3partw1\0" "sm3partw2\0" "sm3ss1\0" "sm3tt1a\0" "sm3tt1b\0" "sm3tt2a\0"
- "sm3tt2b\0" "sm4e\0" "sm4ekey\0" "smaddl\0" "smaxp\0" "smaxv\0" "sminp\0" "sminv\0" "smlal\0" "smlal2\0" "smlsl\0"
- "smlsl2\0" "smnegl\0" "smov\0" "smsubl\0" "smulh\0" "smull\0" "smull2\0" "sqabs\0" "sqdmlal\0" "sqdmlal2\0"
- "sqdmlsl\0" "sqdmlsl2\0" "sqdmulh\0" "sqdmull\0" "sqdmull2\0" "sqneg\0" "sqrdmlah\0" "sqrdmlsh\0" "sqrdmulh\0"
- "sqrshl\0" "sqrshrn\0" "sqrshrn2\0" "sqrshrun\0" "sqrshrun2\0" "sqshl\0" "sqshlu\0" "sqshrn\0" "sqshrn2\0"
- "sqshrun\0" "sqshrun2\0" "sqsub\0" "sqxtn\0" "sqxtn2\0" "sqxtun\0" "sqxtun2\0" "srhadd\0" "sri\0" "srshl\0" "srshr\0"
- "srsra\0" "sshl\0" "sshll\0" "sshll2\0" "sshr\0" "ssra\0" "ssubl\0" "ssubl2\0" "ssubw\0" "ssubw2\0" "st1\0" "st2\0"
- "st2g\0" "st3\0" "st4\0" "stadd\0" "staddb\0" "staddh\0" "staddl\0" "staddlb\0" "staddlh\0" "stclr\0" "stclrb\0"
- "stclrh\0" "stclrl\0" "stclrlb\0" "stclrlh\0" "steor\0" "steorb\0" "steorh\0" "steorl\0" "steorlb\0" "steorlh\0"
- "stg\0" "stgm\0" "stgp\0" "stllr\0" "stllrb\0" "stllrh\0" "stlr\0" "stlrb\0" "stlrh\0" "stlxp\0" "stlxr\0" "stlxrb\0"
- "stlxrh\0" "stnp\0" "stp\0" "str\0" "strb\0" "strh\0" "stset\0" "stsetb\0" "stseth\0" "stsetl\0" "stsetlb\0"
- "stsetlh\0" "stsmax\0" "stsmaxb\0" "stsmaxh\0" "stsmaxl\0" "stsmaxlb\0" "stsmaxlh\0" "stsmin\0" "stsminb\0"
- "stsminh\0" "stsminl\0" "stsminlb\0" "stsminlh\0" "sttr\0" "sttrb\0" "sttrh\0" "stumax\0" "stumaxb\0" "stumaxh\0"
- "stumaxl\0" "stumaxlb\0" "stumaxlh\0" "stumin\0" "stuminb\0" "stuminh\0" "stuminl\0" "stuminlb\0" "stuminlh\0"
- "stur\0" "sturb\0" "sturh\0" "stxp\0" "stxr\0" "stxrb\0" "stxrh\0" "stz2g\0" "stzg\0" "stzgm\0" "subg\0" "subp\0"
- "subps\0" "subs\0" "sudot\0" "suqadd\0" "svc\0" "swp\0" "swpa\0" "swpab\0" "swpah\0" "swpal\0" "swpalb\0" "swpalh\0"
- "swpb\0" "swph\0" "swpl\0" "swplb\0" "swplh\0" "sxtb\0" "sxth\0" "sxtl\0" "sxtl2\0" "sxtw\0" "sys\0" "tbl\0" "tbnz\0"
- "tbx\0" "tbz\0" "tlbi\0" "trn1\0" "trn2\0" "uaba\0" "uabal\0" "uabal2\0" "uabd\0" "uabdl\0" "uabdl2\0" "uadalp\0"
- "uaddl\0" "uaddl2\0" "uaddlp\0" "uaddlv\0" "uaddw\0" "uaddw2\0" "ubfiz\0" "ubfm\0" "ubfx\0" "ucvtf\0" "udf\0"
- "udiv\0" "uhadd\0" "uhsub\0" "umaddl\0" "umaxp\0" "umaxv\0" "uminp\0" "uminv\0" "umlal\0" "umlal2\0" "umlsl\0"
- "umlsl2\0" "ummla\0" "umnegl\0" "umov\0" "umsubl\0" "umulh\0" "umull\0" "umull2\0" "uqrshl\0" "uqrshrn\0"
- "uqrshrn2\0" "uqshl\0" "uqshrn\0" "uqshrn2\0" "uqsub\0" "uqxtn\0" "uqxtn2\0" "urecpe\0" "urhadd\0" "urshl\0"
- "urshr\0" "ursqrte\0" "ursra\0" "usdot\0" "ushl\0" "ushll\0" "ushll2\0" "ushr\0" "usmmla\0" "usqadd\0" "usra\0"
- "usubl\0" "usubl2\0" "usubw\0" "usubw2\0" "uxtb\0" "uxth\0" "uxtl\0" "uxtl2\0" "uzp1\0" "uzp2\0" "wfe\0" "wfi\0"
- "xaflag\0" "xar\0" "xpacd\0" "xpaci\0" "xpaclri\0" "yield\0" "zip1\0" "zip2";
-
-const InstDB::InstNameIndex InstDB::instNameIndex[26] = {
+const InstNameIndex InstDB::instNameIndex = {{
{ Inst::kIdAdc , Inst::kIdAnd_v + 1 },
{ Inst::kIdB , Inst::kIdBsl_v + 1 },
{ Inst::kIdCas , Inst::kIdCnt_v + 1 },
@@ -1947,10 +1878,785 @@ const InstDB::InstNameIndex InstDB::instNameIndex[26] = {
{ Inst::kIdXaflag , Inst::kIdXtn2_v + 1 },
{ Inst::kIdYield , Inst::kIdYield + 1 },
{ Inst::kIdZip1_v , Inst::kIdZip2_v + 1 }
+}, uint16_t(9)};
+
+const char InstDB::_instNameStringTable[] =
+ "autia1716autibldsmaxalhldsminalldumaxallduminalsha256su0sha512su1sm3partwsqrshru"
+ "nldaddalldclralldeoralldsetallbstsmaxstsminstumaxstuminfrint32z64x64zh2sqdmlalsl"
+ "2sqdmulsqrdmlaulhn2sqshruuqrshrspcrc32cstaddstclrsteorstsetxpaclbfcvtbfmlaltfcvt"
+ "xfjcvtzfmaxnmfminnmfrsqrraddrsubsha1sm3tt12a2bsm4ekeysqxtuuqshrursqrsetfrev8";
+
+
+const uint32_t InstDB::_instNameIndexTable[] = {
+ 0x80000000, // Small ''.
+ 0x80000C81, // Small 'adc'.
+ 0x80098C81, // Small 'adcs'.
+ 0x80001081, // Small 'add'.
+ 0x80039081, // Small 'addg'.
+ 0x80099081, // Small 'adds'.
+ 0x80004881, // Small 'adr'.
+ 0x80084881, // Small 'adrp'.
+ 0x800011C1, // Small 'and'.
+ 0x800991C1, // Small 'ands'.
+ 0x80004A61, // Small 'asr'.
+ 0x800B4A61, // Small 'asrv'.
+ 0x80000281, // Small 'at'.
+ 0x801252A1, // Small 'autda'.
+ 0x83A252A1, // Small 'autdza'.
+ 0x802252A1, // Small 'autdb'.
+ 0x85A252A1, // Small 'autdzb'.
+ 0x8014D2A1, // Small 'autia'.
+ 0x00009000, // Large 'autia1716'.
+ 0x20BF5000, // Large 'autia|sp'.
+ 0xB414D2A1, // Small 'autiaz'.
+ 0x8024D2A1, // Small 'autib'.
+ 0x40055009, // Large 'autib|1716'.
+ 0x20BF5009, // Large 'autib|sp'.
+ 0xB424D2A1, // Small 'autibz'.
+ 0x83A4D2A1, // Small 'autiza'.
+ 0x85A4D2A1, // Small 'autizb'.
+ 0x8E161B01, // Small 'axflag'.
+ 0x80000002, // Small 'b'.
+ 0x80000CC2, // Small 'bfc'.
+ 0x800024C2, // Small 'bfi'.
+ 0x800034C2, // Small 'bfm'.
+ 0x80C4E0C2, // Small 'bfxil'.
+ 0x80000D22, // Small 'bic'.
+ 0x80098D22, // Small 'bics'.
+ 0x80000182, // Small 'bl'.
+ 0x80004982, // Small 'blr'.
+ 0x80000242, // Small 'br'.
+ 0x80002E42, // Small 'brk'.
+ 0x80004C23, // Small 'cas'.
+ 0x8000CC23, // Small 'casa'.
+ 0x8020CC23, // Small 'casab'.
+ 0x8080CC23, // Small 'casah'.
+ 0x80C0CC23, // Small 'casal'.
+ 0x84C0CC23, // Small 'casalb'.
+ 0x90C0CC23, // Small 'casalh'.
+ 0x80014C23, // Small 'casb'.
+ 0x80044C23, // Small 'cash'.
+ 0x80064C23, // Small 'casl'.
+ 0x80264C23, // Small 'caslb'.
+ 0x80864C23, // Small 'caslh'.
+ 0x80084C23, // Small 'casp'.
+ 0x80184C23, // Small 'caspa'.
+ 0x98184C23, // Small 'caspal'.
+ 0x80C84C23, // Small 'caspl'.
+ 0x800D3843, // Small 'cbnz'.
+ 0x80006843, // Small 'cbz'.
+ 0x80073463, // Small 'ccmn'.
+ 0x80083463, // Small 'ccmp'.
+ 0x816724C3, // Small 'cfinv'.
+ 0x8001B923, // Small 'cinc'.
+ 0x800B3923, // Small 'cinv'.
+ 0x8182C983, // Small 'clrex'.
+ 0x80004D83, // Small 'cls'.
+ 0x80006983, // Small 'clz'.
+ 0x800039A3, // Small 'cmn'.
+ 0x800041A3, // Small 'cmp'.
+ 0x800841A3, // Small 'cmpp'.
+ 0x800395C3, // Small 'cneg'.
+ 0x85DF0E43, // Small 'crc32b'.
+ 0x100D60C1, // Large 'crc32c|b'.
+ 0x101660C1, // Large 'crc32c|h'.
+ 0x104860C1, // Large 'crc32c|w'.
+ 0x101360C1, // Large 'crc32c|x'.
+ 0x91DF0E43, // Small 'crc32h'.
+ 0xAFDF0E43, // Small 'crc32w'.
+ 0xB1DF0E43, // Small 'crc32x'.
+ 0x80011263, // Small 'csdb'.
+ 0x80061663, // Small 'csel'.
+ 0x800A1663, // Small 'cset'.
+ 0x80DA1663, // Small 'csetm'.
+ 0x80372663, // Small 'csinc'.
+ 0x81672663, // Small 'csinv'.
+ 0x8072BA63, // Small 'csneg'.
+ 0x80000064, // Small 'dc'.
+ 0x81C9C064, // Small 'dcps1'.
+ 0x81D9C064, // Small 'dcps2'.
+ 0x81E9C064, // Small 'dcps3'.
+ 0x800020E4, // Small 'dgh'.
+ 0x800009A4, // Small 'dmb'.
+ 0x8009C244, // Small 'drps'.
+ 0x80000A64, // Small 'dsb'.
+ 0x800039E5, // Small 'eon'.
+ 0x800049E5, // Small 'eor'.
+ 0x80000A65, // Small 'esb'.
+ 0x80095305, // Small 'extr'.
+ 0x800A1645, // Small 'eret'.
+ 0x800025A7, // Small 'gmi'.
+ 0x800A3928, // Small 'hint'.
+ 0x80005188, // Small 'hlt'.
+ 0x80000EC8, // Small 'hvc'.
+ 0x80000069, // Small 'ic'.
+ 0x80000A69, // Small 'isb'.
+ 0x8042048C, // Small 'ldadd'.
+ 0x8242048C, // Small 'ldadda'.
+ 0x100D6051, // Large 'ldadda|b'.
+ 0x10166051, // Large 'ldadda|h'.
+ 0x00007051, // Large 'ldaddal'.
+ 0x100D7051, // Large 'ldaddal|b'.
+ 0x10167051, // Large 'ldaddal|h'.
+ 0x8442048C, // Small 'ldaddb'.
+ 0x9042048C, // Small 'ldaddh'.
+ 0x9842048C, // Small 'ldaddl'.
+ 0x206D5051, // Large 'ldadd|lb'.
+ 0x20155051, // Large 'ldadd|lh'.
+ 0x8009048C, // Small 'ldar'.
+ 0x8029048C, // Small 'ldarb'.
+ 0x8089048C, // Small 'ldarh'.
+ 0x810C048C, // Small 'ldaxp'.
+ 0x812C048C, // Small 'ldaxr'.
+ 0x852C048C, // Small 'ldaxrb'.
+ 0x912C048C, // Small 'ldaxrh'.
+ 0x81260C8C, // Small 'ldclr'.
+ 0x83260C8C, // Small 'ldclra'.
+ 0x100D6058, // Large 'ldclra|b'.
+ 0x10166058, // Large 'ldclra|h'.
+ 0x00007058, // Large 'ldclral'.
+ 0x100D7058, // Large 'ldclral|b'.
+ 0x10167058, // Large 'ldclral|h'.
+ 0x85260C8C, // Small 'ldclrb'.
+ 0x91260C8C, // Small 'ldclrh'.
+ 0x99260C8C, // Small 'ldclrl'.
+ 0x206D5058, // Large 'ldclr|lb'.
+ 0x20155058, // Large 'ldclr|lh'.
+ 0x8127948C, // Small 'ldeor'.
+ 0x8327948C, // Small 'ldeora'.
+ 0x100D605F, // Large 'ldeora|b'.
+ 0x1016605F, // Large 'ldeora|h'.
+ 0x0000705F, // Large 'ldeoral'.
+ 0x100D705F, // Large 'ldeoral|b'.
+ 0x1016705F, // Large 'ldeoral|h'.
+ 0x8527948C, // Small 'ldeorb'.
+ 0x9127948C, // Small 'ldeorh'.
+ 0x9927948C, // Small 'ldeorl'.
+ 0x206D505F, // Large 'ldeor|lb'.
+ 0x2015505F, // Large 'ldeor|lh'.
+ 0x80001C8C, // Small 'ldg'.
+ 0x80069C8C, // Small 'ldgm'.
+ 0x8120B08C, // Small 'ldlar'.
+ 0x8520B08C, // Small 'ldlarb'.
+ 0x9120B08C, // Small 'ldlarh'.
+ 0x8008388C, // Small 'ldnp'.
+ 0x8000408C, // Small 'ldp'.
+ 0x8179C08C, // Small 'ldpsw'.
+ 0x8000488C, // Small 'ldr'.
+ 0x8010C88C, // Small 'ldraa'.
+ 0x8020C88C, // Small 'ldrab'.
+ 0x8001488C, // Small 'ldrb'.
+ 0x8004488C, // Small 'ldrh'.
+ 0x8029C88C, // Small 'ldrsb'.
+ 0x8089C88C, // Small 'ldrsh'.
+ 0x8179C88C, // Small 'ldrsw'.
+ 0x8142CC8C, // Small 'ldset'.
+ 0x8342CC8C, // Small 'ldseta'.
+ 0x100D6066, // Large 'ldseta|b'.
+ 0x10166066, // Large 'ldseta|h'.
+ 0x00007066, // Large 'ldsetal'.
+ 0x100D7066, // Large 'ldsetal|b'.
+ 0x10167066, // Large 'ldsetal|h'.
+ 0x8542CC8C, // Small 'ldsetb'.
+ 0x9142CC8C, // Small 'ldseth'.
+ 0x9942CC8C, // Small 'ldsetl'.
+ 0x206D5066, // Large 'ldset|lb'.
+ 0x20155066, // Large 'ldset|lh'.
+ 0xB016CC8C, // Small 'ldsmax'.
+ 0x0000700E, // Large 'ldsmaxa'.
+ 0x100D700E, // Large 'ldsmaxa|b'.
+ 0x1016700E, // Large 'ldsmaxa|h'.
+ 0x0000800E, // Large 'ldsmaxal'.
+ 0x100D800E, // Large 'ldsmaxal|b'.
+ 0x1016800E, // Large 'ldsmaxal|h'.
+ 0x100D600E, // Large 'ldsmax|b'.
+ 0x1016600E, // Large 'ldsmax|h'.
+ 0x100E600E, // Large 'ldsmax|l'.
+ 0x206D600E, // Large 'ldsmax|lb'.
+ 0x2015600E, // Large 'ldsmax|lh'.
+ 0x9C96CC8C, // Small 'ldsmin'.
+ 0x00007017, // Large 'ldsmina'.
+ 0x100D7017, // Large 'ldsmina|b'.
+ 0x10167017, // Large 'ldsmina|h'.
+ 0x00008017, // Large 'ldsminal'.
+ 0x100D8017, // Large 'ldsminal|b'.
+ 0x10168017, // Large 'ldsminal|h'.
+ 0x100D6017, // Large 'ldsmin|b'.
+ 0x10166017, // Large 'ldsmin|h'.
+ 0x100E6017, // Large 'ldsmin|l'.
+ 0x206D6017, // Large 'ldsmin|lb'.
+ 0x20156017, // Large 'ldsmin|lh'.
+ 0x8009508C, // Small 'ldtr'.
+ 0x8029508C, // Small 'ldtrb'.
+ 0x8089508C, // Small 'ldtrh'.
+ 0x8539508C, // Small 'ldtrsb'.
+ 0x9139508C, // Small 'ldtrsh'.
+ 0xAF39508C, // Small 'ldtrsw'.
+ 0xB016D48C, // Small 'ldumax'.
+ 0x0000701F, // Large 'ldumaxa'.
+ 0x100D701F, // Large 'ldumaxa|b'.
+ 0x1016701F, // Large 'ldumaxa|h'.
+ 0x0000801F, // Large 'ldumaxal'.
+ 0x100D801F, // Large 'ldumaxal|b'.
+ 0x1016801F, // Large 'ldumaxal|h'.
+ 0x100D601F, // Large 'ldumax|b'.
+ 0x1016601F, // Large 'ldumax|h'.
+ 0x100E601F, // Large 'ldumax|l'.
+ 0x206D601F, // Large 'ldumax|lb'.
+ 0x2015601F, // Large 'ldumax|lh'.
+ 0x9C96D48C, // Small 'ldumin'.
+ 0x00007027, // Large 'ldumina'.
+ 0x100D7027, // Large 'ldumina|b'.
+ 0x10167027, // Large 'ldumina|h'.
+ 0x00008027, // Large 'lduminal'.
+ 0x100D8027, // Large 'lduminal|b'.
+ 0x10168027, // Large 'lduminal|h'.
+ 0x100D6027, // Large 'ldumin|b'.
+ 0x10166027, // Large 'ldumin|h'.
+ 0x100E6027, // Large 'ldumin|l'.
+ 0x206D6027, // Large 'ldumin|lb'.
+ 0x20156027, // Large 'ldumin|lh'.
+ 0x8009548C, // Small 'ldur'.
+ 0x8029548C, // Small 'ldurb'.
+ 0x8089548C, // Small 'ldurh'.
+ 0x8539548C, // Small 'ldursb'.
+ 0x9139548C, // Small 'ldursh'.
+ 0xAF39548C, // Small 'ldursw'.
+ 0x8008608C, // Small 'ldxp'.
+ 0x8009608C, // Small 'ldxr'.
+ 0x8029608C, // Small 'ldxrb'.
+ 0x8089608C, // Small 'ldxrh'.
+ 0x8000326C, // Small 'lsl'.
+ 0x800B326C, // Small 'lslv'.
+ 0x80004A6C, // Small 'lsr'.
+ 0x800B4A6C, // Small 'lsrv'.
+ 0x8002102D, // Small 'madd'.
+ 0x800395CD, // Small 'mneg'.
+ 0x800059ED, // Small 'mov'.
+ 0x8005D9ED, // Small 'movk'.
+ 0x800759ED, // Small 'movn'.
+ 0x800D59ED, // Small 'movz'.
+ 0x80004E4D, // Small 'mrs'.
+ 0x80004A6D, // Small 'msr'.
+ 0x8001566D, // Small 'msub'.
+ 0x800032AD, // Small 'mul'.
+ 0x80003ACD, // Small 'mvn'.
+ 0x80001CAE, // Small 'neg'.
+ 0x80099CAE, // Small 'negs'.
+ 0x80000CEE, // Small 'ngc'.
+ 0x80098CEE, // Small 'ngcs'.
+ 0x800041EE, // Small 'nop'.
+ 0x80003A4F, // Small 'orn'.
+ 0x80004A4F, // Small 'orr'.
+ 0x80120C30, // Small 'pacda'.
+ 0x80220C30, // Small 'pacdb'.
+ 0x83A20C30, // Small 'pacdza'.
+ 0x85A20C30, // Small 'pacdzb'.
+ 0x80138C30, // Small 'pacga'.
+ 0x80069A50, // Small 'prfm'.
+ 0x80214E70, // Small 'pssbb'.
+ 0x800A2452, // Small 'rbit'.
+ 0x800050B2, // Small 'ret'.
+ 0x800058B2, // Small 'rev'.
+ 0x20073138, // Large 'rev|16'.
+ 0x81DF58B2, // Small 'rev32'.
+ 0x208F3138, // Large 'rev|64'.
+ 0x800049F2, // Small 'ror'.
+ 0x800B49F2, // Small 'rorv'.
+ 0x80000C53, // Small 'sbc'.
+ 0x80098C53, // Small 'sbcs'.
+ 0x81A49853, // Small 'sbfiz'.
+ 0x80069853, // Small 'sbfm'.
+ 0x800C1853, // Small 'sbfx'.
+ 0x800B2493, // Small 'sdiv'.
+ 0x113B4134, // Large 'setf|8'.
+ 0x20074134, // Large 'setf|16'.
+ 0x800058B3, // Small 'sev'.
+ 0x800658B3, // Small 'sevl'.
+ 0x984205B3, // Small 'smaddl'.
+ 0x80000DB3, // Small 'smc'.
+ 0x9872B9B3, // Small 'smnegl'.
+ 0x982ACDB3, // Small 'smsubl'.
+ 0x808655B3, // Small 'smulh'.
+ 0x80C655B3, // Small 'smull'.
+ 0x80010A73, // Small 'ssbb'.
+ 0x8003F693, // Small 'st2g'.
+ 0x80420693, // Small 'stadd'.
+ 0x98420693, // Small 'staddl'.
+ 0x84420693, // Small 'staddb'.
+ 0x206D50C7, // Large 'stadd|lb'.
+ 0x90420693, // Small 'staddh'.
+ 0x201550C7, // Large 'stadd|lh'.
+ 0x81260E93, // Small 'stclr'.
+ 0x99260E93, // Small 'stclrl'.
+ 0x85260E93, // Small 'stclrb'.
+ 0x206D50CC, // Large 'stclr|lb'.
+ 0x91260E93, // Small 'stclrh'.
+ 0x201550CC, // Large 'stclr|lh'.
+ 0x81279693, // Small 'steor'.
+ 0x99279693, // Small 'steorl'.
+ 0x85279693, // Small 'steorb'.
+ 0x206D50D1, // Large 'steor|lb'.
+ 0x91279693, // Small 'steorh'.
+ 0x201550D1, // Large 'steor|lh'.
+ 0x80001E93, // Small 'stg'.
+ 0x80069E93, // Small 'stgm'.
+ 0x80081E93, // Small 'stgp'.
+ 0x81263293, // Small 'stllr'.
+ 0x85263293, // Small 'stllrb'.
+ 0x91263293, // Small 'stllrh'.
+ 0x80093293, // Small 'stlr'.
+ 0x80293293, // Small 'stlrb'.
+ 0x80893293, // Small 'stlrh'.
+ 0x810C3293, // Small 'stlxp'.
+ 0x812C3293, // Small 'stlxr'.
+ 0x852C3293, // Small 'stlxrb'.
+ 0x912C3293, // Small 'stlxrh'.
+ 0x80083A93, // Small 'stnp'.
+ 0x80004293, // Small 'stp'.
+ 0x80004A93, // Small 'str'.
+ 0x80014A93, // Small 'strb'.
+ 0x80044A93, // Small 'strh'.
+ 0x8142CE93, // Small 'stset'.
+ 0x9942CE93, // Small 'stsetl'.
+ 0x8542CE93, // Small 'stsetb'.
+ 0x206D50D6, // Large 'stset|lb'.
+ 0x9142CE93, // Small 'stseth'.
+ 0x201550D6, // Large 'stset|lh'.
+ 0xB016CE93, // Small 'stsmax'.
+ 0x100E606F, // Large 'stsmax|l'.
+ 0x100D606F, // Large 'stsmax|b'.
+ 0x206D606F, // Large 'stsmax|lb'.
+ 0x1016606F, // Large 'stsmax|h'.
+ 0x2015606F, // Large 'stsmax|lh'.
+ 0x9C96CE93, // Small 'stsmin'.
+ 0x100E6075, // Large 'stsmin|l'.
+ 0x100D6075, // Large 'stsmin|b'.
+ 0x206D6075, // Large 'stsmin|lb'.
+ 0x10166075, // Large 'stsmin|h'.
+ 0x20156075, // Large 'stsmin|lh'.
+ 0x80095293, // Small 'sttr'.
+ 0x80295293, // Small 'sttrb'.
+ 0x80895293, // Small 'sttrh'.
+ 0xB016D693, // Small 'stumax'.
+ 0x100E607B, // Large 'stumax|l'.
+ 0x100D607B, // Large 'stumax|b'.
+ 0x206D607B, // Large 'stumax|lb'.
+ 0x1016607B, // Large 'stumax|h'.
+ 0x2015607B, // Large 'stumax|lh'.
+ 0x9C96D693, // Small 'stumin'.
+ 0x100E6081, // Large 'stumin|l'.
+ 0x100D6081, // Large 'stumin|b'.
+ 0x206D6081, // Large 'stumin|lb'.
+ 0x10166081, // Large 'stumin|h'.
+ 0x20156081, // Large 'stumin|lh'.
+ 0x80095693, // Small 'stur'.
+ 0x80295693, // Small 'sturb'.
+ 0x80895693, // Small 'sturh'.
+ 0x80086293, // Small 'stxp'.
+ 0x80096293, // Small 'stxr'.
+ 0x80296293, // Small 'stxrb'.
+ 0x80896293, // Small 'stxrh'.
+ 0x807EEA93, // Small 'stz2g'.
+ 0x8003EA93, // Small 'stzg'.
+ 0x80D3EA93, // Small 'stzgm'.
+ 0x80000AB3, // Small 'sub'.
+ 0x80038AB3, // Small 'subg'.
+ 0x80080AB3, // Small 'subp'.
+ 0x81380AB3, // Small 'subps'.
+ 0x80098AB3, // Small 'subs'.
+ 0x80000ED3, // Small 'svc'.
+ 0x800042F3, // Small 'swp'.
+ 0x8000C2F3, // Small 'swpa'.
+ 0x8020C2F3, // Small 'swpab'.
+ 0x8080C2F3, // Small 'swpah'.
+ 0x80C0C2F3, // Small 'swpal'.
+ 0x84C0C2F3, // Small 'swpalb'.
+ 0x90C0C2F3, // Small 'swpalh'.
+ 0x800142F3, // Small 'swpb'.
+ 0x800442F3, // Small 'swph'.
+ 0x800642F3, // Small 'swpl'.
+ 0x802642F3, // Small 'swplb'.
+ 0x808642F3, // Small 'swplh'.
+ 0x80015313, // Small 'sxtb'.
+ 0x80045313, // Small 'sxth'.
+ 0x800BD313, // Small 'sxtw'.
+ 0x80004F33, // Small 'sys'.
+ 0x80048994, // Small 'tlbi'.
+ 0x80005274, // Small 'tst'.
+ 0x800D3854, // Small 'tbnz'.
+ 0x80006854, // Small 'tbz'.
+ 0x81A49855, // Small 'ubfiz'.
+ 0x80069855, // Small 'ubfm'.
+ 0x800C1855, // Small 'ubfx'.
+ 0x80001895, // Small 'udf'.
+ 0x800B2495, // Small 'udiv'.
+ 0x984205B5, // Small 'umaddl'.
+ 0x9872B9B5, // Small 'umnegl'.
+ 0x80C655B5, // Small 'umull'.
+ 0x808655B5, // Small 'umulh'.
+ 0x982ACDB5, // Small 'umsubl'.
+ 0x80015315, // Small 'uxtb'.
+ 0x80045315, // Small 'uxth'.
+ 0x800014D7, // Small 'wfe'.
+ 0x800024D7, // Small 'wfi'.
+ 0x8E161838, // Small 'xaflag'.
+ 0x80418618, // Small 'xpacd'.
+ 0x80918618, // Small 'xpaci'.
+ 0x208850DB, // Large 'xpacl|ri'.
+ 0x80461539, // Small 'yield'.
+ 0x80004C41, // Small 'abs'.
+ 0x80001081, // Small 'add'.
+ 0x80E41081, // Small 'addhn'.
+ 0xBAE41081, // Small 'addhn2'.
+ 0x80081081, // Small 'addp'.
+ 0x800B1081, // Small 'addv'.
+ 0x80024CA1, // Small 'aesd'.
+ 0x8002CCA1, // Small 'aese'.
+ 0x86D4CCA1, // Small 'aesimc'.
+ 0x8036CCA1, // Small 'aesmc'.
+ 0x800011C1, // Small 'and'.
+ 0x800C0462, // Small 'bcax'.
+ 0x814B0CC2, // Small 'bfcvt'.
+ 0x9D4B0CC2, // Small 'bfcvtn'.
+ 0x20B150E0, // Large 'bfcvt|n2'.
+ 0x814790C2, // Small 'bfdot'.
+ 0x206D50E5, // Large 'bfmla|lb'.
+ 0x20EA50E5, // Large 'bfmla|lt'.
+ 0x82C6B4C2, // Small 'bfmmla'.
+ 0x80000D22, // Small 'bic'.
+ 0x80001922, // Small 'bif'.
+ 0x80005122, // Small 'bit'.
+ 0x80003262, // Small 'bsl'.
+ 0x80004D83, // Small 'cls'.
+ 0x80006983, // Small 'clz'.
+ 0x800895A3, // Small 'cmeq'.
+ 0x80029DA3, // Small 'cmge'.
+ 0x800A1DA3, // Small 'cmgt'.
+ 0x8004A1A3, // Small 'cmhi'.
+ 0x8009A1A3, // Small 'cmhs'.
+ 0x8002B1A3, // Small 'cmle'.
+ 0x800A31A3, // Small 'cmlt'.
+ 0x8149D1A3, // Small 'cmtst'.
+ 0x800051C3, // Small 'cnt'.
+ 0x800042A4, // Small 'dup'.
+ 0x800049E5, // Small 'eor'.
+ 0x800F49E5, // Small 'eor3'.
+ 0x80005305, // Small 'ext'.
+ 0x80020826, // Small 'fabd'.
+ 0x80098826, // Small 'fabs'.
+ 0x80538C26, // Small 'facge'.
+ 0x81438C26, // Small 'facgt'.
+ 0x80021026, // Small 'fadd'.
+ 0x81021026, // Small 'faddp'.
+ 0x80420466, // Small 'fcadd'.
+ 0x81068C66, // Small 'fccmp'.
+ 0x8B068C66, // Small 'fccmpe'.
+ 0x8112B466, // Small 'fcmeq'.
+ 0x8053B466, // Small 'fcmge'.
+ 0x8143B466, // Small 'fcmgt'.
+ 0x80163466, // Small 'fcmla'.
+ 0x80563466, // Small 'fcmle'.
+ 0x81463466, // Small 'fcmlt'.
+ 0x80083466, // Small 'fcmp'.
+ 0x80583466, // Small 'fcmpe'.
+ 0x80C2CC66, // Small 'fcsel'.
+ 0x800A5866, // Small 'fcvt'.
+ 0xA61A5866, // Small 'fcvtas'.
+ 0xAA1A5866, // Small 'fcvtau'.
+ 0x80CA5866, // Small 'fcvtl'.
+ 0xBACA5866, // Small 'fcvtl2'.
+ 0xA6DA5866, // Small 'fcvtms'.
+ 0xAADA5866, // Small 'fcvtmu'.
+ 0x80EA5866, // Small 'fcvtn'.
+ 0xBAEA5866, // Small 'fcvtn2'.
+ 0xA6EA5866, // Small 'fcvtns'.
+ 0xAAEA5866, // Small 'fcvtnu'.
+ 0xA70A5866, // Small 'fcvtps'.
+ 0xAB0A5866, // Small 'fcvtpu'.
+ 0x9D8A5866, // Small 'fcvtxn'.
+ 0x20B150EC, // Large 'fcvtx|n2'.
+ 0xA7AA5866, // Small 'fcvtzs'.
+ 0xABAA5866, // Small 'fcvtzu'.
+ 0x800B2486, // Small 'fdiv'.
+ 0x101060F1, // Large 'fjcvtz|s'.
+ 0x804205A6, // Small 'fmadd'.
+ 0x800C05A6, // Small 'fmax'.
+ 0x9AEC05A6, // Small 'fmaxnm'.
+ 0x104460F7, // Large 'fmaxnm|p'.
+ 0x10E360F7, // Large 'fmaxnm|v'.
+ 0x810C05A6, // Small 'fmaxp'.
+ 0x816C05A6, // Small 'fmaxv'.
+ 0x800725A6, // Small 'fmin'.
+ 0x9AE725A6, // Small 'fminnm'.
+ 0x104460FD, // Large 'fminnm|p'.
+ 0x10E360FD, // Large 'fminnm|v'.
+ 0x810725A6, // Small 'fminp'.
+ 0x816725A6, // Small 'fminv'.
+ 0x8000B1A6, // Small 'fmla'.
+ 0x80C0B1A6, // Small 'fmlal'.
+ 0xBAC0B1A6, // Small 'fmlal2'.
+ 0x8009B1A6, // Small 'fmls'.
+ 0x80C9B1A6, // Small 'fmlsl'.
+ 0xBAC9B1A6, // Small 'fmlsl2'.
+ 0x800B3DA6, // Small 'fmov'.
+ 0x802ACDA6, // Small 'fmsub'.
+ 0x800655A6, // Small 'fmul'.
+ 0x818655A6, // Small 'fmulx'.
+ 0x800395C6, // Small 'fneg'.
+ 0x8840B5C6, // Small 'fnmadd'.
+ 0x8559B5C6, // Small 'fnmsub'.
+ 0x80CAB5C6, // Small 'fnmul'.
+ 0x8B019646, // Small 'frecpe'.
+ 0xA7019646, // Small 'frecps'.
+ 0xB1019646, // Small 'frecpx'.
+ 0x10137087, // Large 'frint32|x'.
+ 0x108E7087, // Large 'frint32|z'.
+ 0x308F5087, // Large 'frint|64x'.
+ 0x30925087, // Large 'frint|64z'.
+ 0x83472646, // Small 'frinta'.
+ 0x93472646, // Small 'frinti'.
+ 0x9B472646, // Small 'frintm'.
+ 0x9D472646, // Small 'frintn'.
+ 0xA1472646, // Small 'frintp'.
+ 0xB1472646, // Small 'frintx'.
+ 0xB5472646, // Small 'frintz'.
+ 0x20D25103, // Large 'frsqr|te'.
+ 0x20705103, // Large 'frsqr|ts'.
+ 0x81494666, // Small 'fsqrt'.
+ 0x80015666, // Small 'fsub'.
+ 0x80004DC9, // Small 'ins'.
+ 0x8000708C, // Small 'ld1'.
+ 0x8009708C, // Small 'ld1r'.
+ 0x8000748C, // Small 'ld2'.
+ 0x8009748C, // Small 'ld2r'.
+ 0x8000788C, // Small 'ld3'.
+ 0x8009788C, // Small 'ld3r'.
+ 0x80007C8C, // Small 'ld4'.
+ 0x80097C8C, // Small 'ld4r'.
+ 0x8008388C, // Small 'ldnp'.
+ 0x8000408C, // Small 'ldp'.
+ 0x8000488C, // Small 'ldr'.
+ 0x8009548C, // Small 'ldur'.
+ 0x8000058D, // Small 'mla'.
+ 0x80004D8D, // Small 'mls'.
+ 0x800059ED, // Small 'mov'.
+ 0x8004D9ED, // Small 'movi'.
+ 0x800032AD, // Small 'mul'.
+ 0x80003ACD, // Small 'mvn'.
+ 0x8004BACD, // Small 'mvni'.
+ 0x80001CAE, // Small 'neg'.
+ 0x800051EE, // Small 'not'.
+ 0x80003A4F, // Small 'orn'.
+ 0x80004A4F, // Small 'orr'.
+ 0x800655B0, // Small 'pmul'.
+ 0x80C655B0, // Small 'pmull'.
+ 0xBAC655B0, // Small 'pmull2'.
+ 0x9C821032, // Small 'raddhn'.
+ 0x30B04108, // Large 'radd|hn2'.
+ 0x800E6032, // Small 'rax1'.
+ 0x800A2452, // Small 'rbit'.
+ 0x20073138, // Large 'rev|16'.
+ 0x81DF58B2, // Small 'rev32'.
+ 0x208F3138, // Large 'rev|64'.
+ 0x80E92272, // Small 'rshrn'.
+ 0xBAE92272, // Small 'rshrn2'.
+ 0x9C815672, // Small 'rsubhn'.
+ 0x30B0410C, // Large 'rsub|hn2'.
+ 0x80008833, // Small 'saba'.
+ 0x80C08833, // Small 'sabal'.
+ 0xBAC08833, // Small 'sabal2'.
+ 0x80020833, // Small 'sabd'.
+ 0x80C20833, // Small 'sabdl'.
+ 0xBAC20833, // Small 'sabdl2'.
+ 0xA0C09033, // Small 'sadalp'.
+ 0x80C21033, // Small 'saddl'.
+ 0xBAC21033, // Small 'saddl2'.
+ 0xA0C21033, // Small 'saddlp'.
+ 0xACC21033, // Small 'saddlv'.
+ 0x81721033, // Small 'saddw'.
+ 0xBB721033, // Small 'saddw2'.
+ 0x806A5873, // Small 'scvtf'.
+ 0x800A3C93, // Small 'sdot'.
+ 0x803E0513, // Small 'sha1c'.
+ 0x808E0513, // Small 'sha1h'.
+ 0x80DE0513, // Small 'sha1m'.
+ 0x810E0513, // Small 'sha1p'.
+ 0x30354110, // Large 'sha1|su0'.
+ 0x303E4110, // Large 'sha1|su1'.
+ 0x1016602F, // Large 'sha256|h'.
+ 0x2095602F, // Large 'sha256|h2'.
+ 0x0000902F, // Large 'sha256su0'.
+ 0x1005802F, // Large 'sha256su|1'.
+ 0x10166038, // Large 'sha512|h'.
+ 0x20956038, // Large 'sha512|h2'.
+ 0x30356038, // Large 'sha512|su0'.
+ 0x303E6038, // Large 'sha512|su1'.
+ 0x80420513, // Small 'shadd'.
+ 0x80003113, // Small 'shl'.
+ 0x80063113, // Small 'shll'.
+ 0x81D63113, // Small 'shll2'.
+ 0x80074913, // Small 'shrn'.
+ 0x81D74913, // Small 'shrn2'.
+ 0x802ACD13, // Small 'shsub'.
+ 0x80002593, // Small 'sli'.
+ 0x10058041, // Large 'sm3partw|1'.
+ 0x10328041, // Large 'sm3partw|2'.
+ 0xB939F9B3, // Small 'sm3ss1'.
+ 0x10006114, // Large 'sm3tt1|a'.
+ 0x100D6114, // Large 'sm3tt1|b'.
+ 0x211A5114, // Large 'sm3tt|2a'.
+ 0x211C5114, // Large 'sm3tt|2b'.
+ 0x8002FDB3, // Small 'sm4e'.
+ 0x0000711E, // Large 'sm4ekey'.
+ 0x800C05B3, // Small 'smax'.
+ 0x810C05B3, // Small 'smaxp'.
+ 0x816C05B3, // Small 'smaxv'.
+ 0x800725B3, // Small 'smin'.
+ 0x810725B3, // Small 'sminp'.
+ 0x816725B3, // Small 'sminv'.
+ 0x80C0B1B3, // Small 'smlal'.
+ 0xBAC0B1B3, // Small 'smlal2'.
+ 0x80C9B1B3, // Small 'smlsl'.
+ 0xBAC9B1B3, // Small 'smlsl2'.
+ 0x801635B3, // Small 'smmla'.
+ 0x800B3DB3, // Small 'smov'.
+ 0x80C655B3, // Small 'smull'.
+ 0xBAC655B3, // Small 'smull2'.
+ 0x81310633, // Small 'sqabs'.
+ 0x80420633, // Small 'sqadd'.
+ 0x00007097, // Large 'sqdmlal'.
+ 0x10327097, // Large 'sqdmlal|2'.
+ 0x209E5097, // Large 'sqdml|sl'.
+ 0x309E5097, // Large 'sqdml|sl2'.
+ 0x101660A1, // Large 'sqdmul|h'.
+ 0x100E60A1, // Large 'sqdmul|l'.
+ 0x209F60A1, // Large 'sqdmul|l2'.
+ 0x8072BA33, // Small 'sqneg'.
+ 0x101670A7, // Large 'sqrdmla|h'.
+ 0x202F60A7, // Large 'sqrdml|sh'.
+ 0x30AE50A7, // Large 'sqrdm|ulh'.
+ 0x9889CA33, // Small 'sqrshl'.
+ 0x101C6049, // Large 'sqrshr|n'.
+ 0x20B16049, // Large 'sqrshr|n2'.
+ 0x00008049, // Large 'sqrshrun'.
+ 0x10328049, // Large 'sqrshrun|2'.
+ 0x80C44E33, // Small 'sqshl'.
+ 0xAAC44E33, // Small 'sqshlu'.
+ 0x9D244E33, // Small 'sqshrn'.
+ 0x20B150B3, // Large 'sqshr|n2'.
+ 0x101C60B3, // Large 'sqshru|n'.
+ 0x20B160B3, // Large 'sqshru|n2'.
+ 0x802ACE33, // Small 'sqsub'.
+ 0x80EA6233, // Small 'sqxtn'.
+ 0xBAEA6233, // Small 'sqxtn2'.
+ 0x9D5A6233, // Small 'sqxtun'.
+ 0x20B15125, // Large 'sqxtu|n2'.
+ 0x8840A253, // Small 'srhadd'.
+ 0x80002653, // Small 'sri'.
+ 0x80C44E53, // Small 'srshl'.
+ 0x81244E53, // Small 'srshr'.
+ 0x80194E53, // Small 'srsra'.
+ 0x80062273, // Small 'sshl'.
+ 0x80C62273, // Small 'sshll'.
+ 0xBAC62273, // Small 'sshll2'.
+ 0x80092273, // Small 'sshr'.
+ 0x8000CA73, // Small 'ssra'.
+ 0x80C15673, // Small 'ssubl'.
+ 0xBAC15673, // Small 'ssubl2'.
+ 0x81715673, // Small 'ssubw'.
+ 0xBB715673, // Small 'ssubw2'.
+ 0x80007293, // Small 'st1'.
+ 0x80007693, // Small 'st2'.
+ 0x80007A93, // Small 'st3'.
+ 0x80007E93, // Small 'st4'.
+ 0x80083A93, // Small 'stnp'.
+ 0x80004293, // Small 'stp'.
+ 0x80004A93, // Small 'str'.
+ 0x80095693, // Small 'stur'.
+ 0x80000AB3, // Small 'sub'.
+ 0x80E40AB3, // Small 'subhn'.
+ 0xBAE40AB3, // Small 'subhn2'.
+ 0x814792B3, // Small 'sudot'.
+ 0x8840C6B3, // Small 'suqadd'.
+ 0x80065313, // Small 'sxtl'.
+ 0x81D65313, // Small 'sxtl2'.
+ 0x80003054, // Small 'tbl'.
+ 0x80006054, // Small 'tbx'.
+ 0x800E3A54, // Small 'trn1'.
+ 0x800EBA54, // Small 'trn2'.
+ 0x80008835, // Small 'uaba'.
+ 0x80C08835, // Small 'uabal'.
+ 0xBAC08835, // Small 'uabal2'.
+ 0x80020835, // Small 'uabd'.
+ 0x80C20835, // Small 'uabdl'.
+ 0xBAC20835, // Small 'uabdl2'.
+ 0xA0C09035, // Small 'uadalp'.
+ 0x80C21035, // Small 'uaddl'.
+ 0xBAC21035, // Small 'uaddl2'.
+ 0xA0C21035, // Small 'uaddlp'.
+ 0xACC21035, // Small 'uaddlv'.
+ 0x81721035, // Small 'uaddw'.
+ 0xBB721035, // Small 'uaddw2'.
+ 0x806A5875, // Small 'ucvtf'.
+ 0x800A3C95, // Small 'udot'.
+ 0x80420515, // Small 'uhadd'.
+ 0x802ACD15, // Small 'uhsub'.
+ 0x800C05B5, // Small 'umax'.
+ 0x810C05B5, // Small 'umaxp'.
+ 0x816C05B5, // Small 'umaxv'.
+ 0x800725B5, // Small 'umin'.
+ 0x810725B5, // Small 'uminp'.
+ 0x816725B5, // Small 'uminv'.
+ 0x80C0B1B5, // Small 'umlal'.
+ 0xBAC0B1B5, // Small 'umlal2'.
+ 0x80C9B1B5, // Small 'umlsl'.
+ 0xBAC9B1B5, // Small 'umlsl2'.
+ 0x801635B5, // Small 'ummla'.
+ 0x800B3DB5, // Small 'umov'.
+ 0x80C655B5, // Small 'umull'.
+ 0xBAC655B5, // Small 'umull2'.
+ 0x80420635, // Small 'uqadd'.
+ 0x9889CA35, // Small 'uqrshl'.
+ 0x101C60B9, // Large 'uqrshr|n'.
+ 0x20B160B9, // Large 'uqrshr|n2'.
+ 0x80C44E35, // Small 'uqshl'.
+ 0x9D244E35, // Small 'uqshrn'.
+ 0x20B1512A, // Large 'uqshr|n2'.
+ 0x802ACE35, // Small 'uqsub'.
+ 0x80EA6235, // Small 'uqxtn'.
+ 0xBAEA6235, // Small 'uqxtn2'.
+ 0x8B019655, // Small 'urecpe'.
+ 0x8840A255, // Small 'urhadd'.
+ 0x80C44E55, // Small 'urshl'.
+ 0x81244E55, // Small 'urshr'.
+ 0x20D2512F, // Large 'ursqr|te'.
+ 0x80194E55, // Small 'ursra'.
+ 0x81479275, // Small 'usdot'.
+ 0x80062275, // Small 'ushl'.
+ 0x80C62275, // Small 'ushll'.
+ 0xBAC62275, // Small 'ushll2'.
+ 0x80092275, // Small 'ushr'.
+ 0x82C6B675, // Small 'usmmla'.
+ 0x8840C675, // Small 'usqadd'.
+ 0x8000CA75, // Small 'usra'.
+ 0x80C15675, // Small 'usubl'.
+ 0xBAC15675, // Small 'usubl2'.
+ 0x81715675, // Small 'usubw'.
+ 0xBB715675, // Small 'usubw2'.
+ 0x80065315, // Small 'uxtl'.
+ 0x81D65315, // Small 'uxtl2'.
+ 0x800E4355, // Small 'uzp1'.
+ 0x800EC355, // Small 'uzp2'.
+ 0x80004838, // Small 'xar'.
+ 0x80003A98, // Small 'xtn'.
+ 0x800EBA98, // Small 'xtn2'.
+ 0x800E413A, // Small 'zip1'.
+ 0x800EC13A // Small 'zip2'.
};
// ----------------------------------------------------------------------------
// ${NameData:End}
-#endif
+#endif // !ASMJIT_NO_TEXT
ASMJIT_END_SUB_NAMESPACE
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64instdb.h b/3rdparty/asmjit/src/asmjit/arm/a64instdb.h
index 0575d1a2fa6..a03125401ad 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64instdb.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64instdb.h
@@ -29,7 +29,7 @@ enum InstFlags : uint32_t {
//! SIMD element access of half-words can only be used with v0..15.
kInstFlagVH0_15 = 0x00000010u,
- //! Instruction may consecutive registers if the number of operands is greater than 2.
+ //! Instruction uses consecutive registers if the number of operands is greater than 2.
kInstFlagConsecutive = 0x00000080u
};
@@ -39,9 +39,7 @@ struct InstInfo {
uint32_t _encoding : 8;
//! Index to data specific to each encoding type.
uint32_t _encodingDataIndex : 8;
- uint32_t _reserved : 2;
- //! Index to \ref _nameData.
- uint32_t _nameDataIndex : 14;
+ uint32_t _reserved : 16;
uint16_t _rwInfoIndex;
uint16_t _flags;
@@ -49,10 +47,10 @@ struct InstInfo {
//! \name Accessors
//! \{
- inline uint32_t rwInfoIndex() const noexcept { return _rwInfoIndex; }
- inline uint32_t flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG uint32_t rwInfoIndex() const noexcept { return _rwInfoIndex; }
+ ASMJIT_INLINE_NODEBUG uint32_t flags() const noexcept { return _flags; }
- inline bool hasFlag(uint32_t flag) const { return (_flags & flag) != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(uint32_t flag) const { return (_flags & flag) != 0; }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64instdb_p.h b/3rdparty/asmjit/src/asmjit/arm/a64instdb_p.h
index eb4f3f83766..5c3da7e1f9f 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64instdb_p.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64instdb_p.h
@@ -7,6 +7,7 @@
#define ASMJIT_ARM_A64INSTDB_H_P_INCLUDED
#include "../core/codeholder.h"
+#include "../core/instdb_p.h"
#include "../arm/a64instdb.h"
#include "../arm/a64operand.h"
@@ -58,14 +59,14 @@ enum RWInfoType : uint32_t {
// a64::InstDB - ElementType
// =========================
-enum ElementType : uint8_t {
- kET_None = Vec::kElementTypeNone,
- kET_B = Vec::kElementTypeB,
- kET_H = Vec::kElementTypeH,
- kET_S = Vec::kElementTypeS,
- kET_D = Vec::kElementTypeD,
- kET_2H = Vec::kElementTypeH2,
- kET_4B = Vec::kElementTypeB4
+enum InstElementType : uint8_t {
+ kET_None = uint8_t(VecElementType::kNone),
+ kET_B = uint8_t(VecElementType::kB),
+ kET_H = uint8_t(VecElementType::kH),
+ kET_S = uint8_t(VecElementType::kS),
+ kET_D = uint8_t(VecElementType::kD),
+ kET_2H = uint8_t(VecElementType::kH2),
+ kET_4B = uint8_t(VecElementType::kB4)
};
// a64::InstDB - GpType
@@ -192,6 +193,7 @@ enum EncodingId : uint32_t {
kEncodingBaseMvnNeg,
kEncodingBaseOp,
kEncodingBaseOpImm,
+ kEncodingBasePrfm,
kEncodingBaseR,
kEncodingBaseRM_NoImm,
kEncodingBaseRM_SImm10,
@@ -262,7 +264,7 @@ namespace EncodingData {
#define M_OPCODE(field, bits) \
uint32_t _##field : bits; \
- inline constexpr uint32_t field() const noexcept { return uint32_t(_##field) << (32 - bits); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t field() const noexcept { return uint32_t(_##field) << (32 - bits); }
struct BaseOp {
uint32_t opcode;
@@ -412,6 +414,13 @@ struct BaseRM_SImm10 {
uint32_t immShift : 4;
};
+struct BasePrfm {
+ uint32_t registerOp : 11;
+ uint32_t sOffsetOp : 10;
+ uint32_t uOffsetOp : 11;
+ uint32_t literalOp;
+};
+
struct BaseLdSt {
uint32_t uOffsetOp : 10;
uint32_t prePostOp : 11;
@@ -787,6 +796,7 @@ extern const BaseMovKNZ baseMovKNZ[3];
extern const BaseMvnNeg baseMvnNeg[3];
extern const BaseOp baseOp[23];
extern const BaseOpImm baseOpImm[14];
+extern const BasePrfm basePrfm[1];
extern const BaseR baseR[10];
extern const BaseRM_NoImm baseRM_NoImm[21];
extern const BaseRM_SImm10 baseRM_SImm10[2];
@@ -843,26 +853,13 @@ extern const SimdTblTbx simdTblTbx[2];
} // {EncodingData}
-// a64::InstDB - InstNameIndex
-// ===========================
-
-// ${NameLimits:Begin}
-// ------------------- Automatically generated, do not edit -------------------
-enum : uint32_t { kMaxNameSize = 9 };
-// ----------------------------------------------------------------------------
-// ${NameLimits:End}
-
-struct InstNameIndex {
- uint16_t start;
- uint16_t end;
-};
-
// a64::InstDB - Tables
// ====================
#ifndef ASMJIT_NO_TEXT
-extern const char _nameData[];
-extern const InstNameIndex instNameIndex[26];
+extern const InstNameIndex instNameIndex;
+extern const char _instNameStringTable[];
+extern const uint32_t _instNameIndexTable[];
#endif // !ASMJIT_NO_TEXT
} // {InstDB}
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64operand.cpp b/3rdparty/asmjit/src/asmjit/arm/a64operand.cpp
index 40a4a7952bc..e8c6100fa68 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64operand.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64operand.cpp
@@ -17,66 +17,66 @@ ASMJIT_BEGIN_SUB_NAMESPACE(a64)
#if defined(ASMJIT_TEST)
UNIT(a64_operand) {
INFO("Checking if a64::reg(...) matches built-in IDs");
- EXPECT(w(5) == w5);
- EXPECT(x(5) == x5);
+ EXPECT_EQ(w(5), w5);
+ EXPECT_EQ(x(5), x5);
INFO("Checking Gp register properties");
- EXPECT(Gp().isReg() == true);
- EXPECT(w0.isReg() == true);
- EXPECT(x0.isReg() == true);
- EXPECT(w0.id() == 0);
- EXPECT(x0.id() == 0);
- EXPECT(wzr.id() == Gp::kIdZr);
- EXPECT(xzr.id() == Gp::kIdZr);
- EXPECT(wsp.id() == Gp::kIdSp);
- EXPECT(sp.id() == Gp::kIdSp);
- EXPECT(w0.size() == 4);
- EXPECT(x0.size() == 8);
- EXPECT(w0.type() == RegType::kARM_GpW);
- EXPECT(x0.type() == RegType::kARM_GpX);
- EXPECT(w0.group() == RegGroup::kGp);
- EXPECT(x0.group() == RegGroup::kGp);
+ EXPECT_TRUE(Gp().isReg());
+ EXPECT_TRUE(w0.isReg());
+ EXPECT_TRUE(x0.isReg());
+ EXPECT_EQ(w0.id(), 0u);
+ EXPECT_EQ(x0.id(), 0u);
+ EXPECT_EQ(wzr.id(), Gp::kIdZr);
+ EXPECT_EQ(xzr.id(), Gp::kIdZr);
+ EXPECT_EQ(wsp.id(), Gp::kIdSp);
+ EXPECT_EQ(sp.id(), Gp::kIdSp);
+ EXPECT_EQ(w0.size(), 4u);
+ EXPECT_EQ(x0.size(), 8u);
+ EXPECT_EQ(w0.type(), RegType::kARM_GpW);
+ EXPECT_EQ(x0.type(), RegType::kARM_GpX);
+ EXPECT_EQ(w0.group(), RegGroup::kGp);
+ EXPECT_EQ(x0.group(), RegGroup::kGp);
INFO("Checking Vec register properties");
- EXPECT(v0.type() == RegType::kARM_VecV);
- EXPECT(d0.type() == RegType::kARM_VecD);
- EXPECT(s0.type() == RegType::kARM_VecS);
- EXPECT(h0.type() == RegType::kARM_VecH);
- EXPECT(b0.type() == RegType::kARM_VecB);
+ EXPECT_EQ(v0.type(), RegType::kARM_VecV);
+ EXPECT_EQ(d0.type(), RegType::kARM_VecD);
+ EXPECT_EQ(s0.type(), RegType::kARM_VecS);
+ EXPECT_EQ(h0.type(), RegType::kARM_VecH);
+ EXPECT_EQ(b0.type(), RegType::kARM_VecB);
- EXPECT(v0.group() == RegGroup::kVec);
- EXPECT(d0.group() == RegGroup::kVec);
- EXPECT(s0.group() == RegGroup::kVec);
- EXPECT(h0.group() == RegGroup::kVec);
- EXPECT(b0.group() == RegGroup::kVec);
+ EXPECT_EQ(v0.group(), RegGroup::kVec);
+ EXPECT_EQ(d0.group(), RegGroup::kVec);
+ EXPECT_EQ(s0.group(), RegGroup::kVec);
+ EXPECT_EQ(h0.group(), RegGroup::kVec);
+ EXPECT_EQ(b0.group(), RegGroup::kVec);
INFO("Checking Vec register element[] access");
Vec vd_1 = v15.d(1);
- EXPECT(vd_1.type() == RegType::kARM_VecV);
- EXPECT(vd_1.group() == RegGroup::kVec);
- EXPECT(vd_1.id() == 15);
- EXPECT(vd_1.isVecD2());
- EXPECT(vd_1.elementType() == Vec::kElementTypeD);
- EXPECT(vd_1.hasElementIndex());
- EXPECT(vd_1.elementIndex() == 1);
+ EXPECT_EQ(vd_1.type(), RegType::kARM_VecV);
+ EXPECT_EQ(vd_1.group(), RegGroup::kVec);
+ EXPECT_EQ(vd_1.id(), 15u);
+ EXPECT_TRUE(vd_1.isVecD2());
+ EXPECT_EQ(vd_1.elementType(), VecElementType::kD);
+ EXPECT_TRUE(vd_1.hasElementIndex());
+ EXPECT_EQ(vd_1.elementIndex(), 1u);
Vec vs_3 = v15.s(3);
- EXPECT(vs_3.type() == RegType::kARM_VecV);
- EXPECT(vs_3.group() == RegGroup::kVec);
- EXPECT(vs_3.id() == 15);
- EXPECT(vs_3.isVecS4());
- EXPECT(vs_3.elementType() == Vec::kElementTypeS);
- EXPECT(vs_3.hasElementIndex());
- EXPECT(vs_3.elementIndex() == 3);
+ EXPECT_EQ(vs_3.type(), RegType::kARM_VecV);
+ EXPECT_EQ(vs_3.group(), RegGroup::kVec);
+ EXPECT_EQ(vs_3.id(), 15u);
+ EXPECT_TRUE(vs_3.isVecS4());
+ EXPECT_EQ(vs_3.elementType(), VecElementType::kS);
+ EXPECT_TRUE(vs_3.hasElementIndex());
+ EXPECT_EQ(vs_3.elementIndex(), 3u);
Vec vb_4 = v15.b4(3);
- EXPECT(vb_4.type() == RegType::kARM_VecV);
- EXPECT(vb_4.group() == RegGroup::kVec);
- EXPECT(vb_4.id() == 15);
- EXPECT(vb_4.isVecB4x4());
- EXPECT(vb_4.elementType() == Vec::kElementTypeB4);
- EXPECT(vb_4.hasElementIndex());
- EXPECT(vb_4.elementIndex() == 3);
+ EXPECT_EQ(vb_4.type(), RegType::kARM_VecV);
+ EXPECT_EQ(vb_4.group(), RegGroup::kVec);
+ EXPECT_EQ(vb_4.id(), 15u);
+ EXPECT_TRUE(vb_4.isVecB4x4());
+ EXPECT_EQ(vb_4.elementType(), VecElementType::kB4);
+ EXPECT_TRUE(vb_4.hasElementIndex());
+ EXPECT_EQ(vb_4.elementIndex(), 3u);
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64operand.h b/3rdparty/asmjit/src/asmjit/arm/a64operand.h
index c2d3c179a86..9e233062b69 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64operand.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64operand.h
@@ -13,24 +13,304 @@ ASMJIT_BEGIN_SUB_NAMESPACE(a64)
//! \addtogroup asmjit_a64
//! \{
-using arm::Reg;
-using arm::Mem;
-using arm::Gp;
-using arm::GpW;
-using arm::GpX;
-
-using arm::Vec;
-using arm::VecB;
-using arm::VecH;
-using arm::VecS;
-using arm::VecD;
-using arm::VecV;
+class GpW;
+class GpX;
+
+class VecB;
+class VecH;
+class VecS;
+class VecD;
+class VecV;
+
+//! General purpose register (AArch64).
+class Gp : public Reg {
+public:
+ ASMJIT_DEFINE_ABSTRACT_REG(Gp, Reg)
+
+ //! Special register id.
+ enum Id : uint32_t {
+ //! Register that depends on OS, could be used as TLS offset.
+ kIdOs = 18,
+ //! Frame pointer register id.
+ kIdFp = 29,
+ //! Link register id.
+ kIdLr = 30,
+ //! Stack register id.
+ kIdSp = 31,
+ //! Zero register id.
+ //!
+ //! Although zero register has the same id as stack register it has a special treatment, because we need to be
+ //! able to distinguish between these two at API level. Some instructions were designed to be used with SP and
+ //! some other with ZR - so we need a way to distinguish these two to make sure we emit the right thing.
+ //!
+ //! The number 63 is not random, when you perform `id & 31` you would always get 31 for both SP and ZR inputs,
+ //! which is the identifier used by AArch64 ISA to encode either SP or ZR depending on the instruction.
+ kIdZr = 63
+ };
+
+ //! Test whether this register is ZR register.
+ ASMJIT_INLINE_NODEBUG constexpr bool isZR() const noexcept { return id() == kIdZr; }
+ //! Test whether this register is SP register.
+ ASMJIT_INLINE_NODEBUG constexpr bool isSP() const noexcept { return id() == kIdSp; }
+
+ //! Cast this register to a 32-bit W register (returns a new operand).
+ ASMJIT_INLINE_NODEBUG GpW w() const noexcept;
+ //! \overload
+ ASMJIT_INLINE_NODEBUG GpW r32() const noexcept;
+ //! Cast this register to a 64-bit X register (returns a new operand).
+ ASMJIT_INLINE_NODEBUG GpX x() const noexcept;
+ //! \overload
+ ASMJIT_INLINE_NODEBUG GpX r64() const noexcept;
+};
+
+//! 32-bit general purpose W register (AArch64).
+class GpW : public Gp { ASMJIT_DEFINE_FINAL_REG(GpW, Gp, RegTraits<RegType::kARM_GpW>); };
+//! 64-bit general purpose X register (AArch64).
+class GpX : public Gp { ASMJIT_DEFINE_FINAL_REG(GpX, Gp, RegTraits<RegType::kARM_GpX>); };
+
+#ifndef _DOXYGEN
+ASMJIT_INLINE_NODEBUG GpW Gp::w() const noexcept { return GpW(id()); }
+ASMJIT_INLINE_NODEBUG GpX Gp::x() const noexcept { return GpX(id()); }
+ASMJIT_INLINE_NODEBUG GpW Gp::r32() const noexcept { return GpW(id()); }
+ASMJIT_INLINE_NODEBUG GpX Gp::r64() const noexcept { return GpX(id()); }
+#endif
+
+//! Vector element type (AArch64).
+enum class VecElementType : uint32_t {
+ //! No element type specified.
+ kNone = 0,
+ //! Byte elements (B8 or B16).
+ kB,
+ //! Halfword elements (H4 or H8).
+ kH,
+ //! Singleword elements (S2 or S4).
+ kS,
+ //! Doubleword elements (D2).
+ kD,
+ //! Byte elements grouped by 4 bytes (B4).
+ //!
+ //! \note This element-type is only used by few instructions.
+ kB4,
+ //! Halfword elements grouped by 2 halfwords (H2).
+ //!
+ //! \note This element-type is only used by few instructions.
+ kH2,
+
+ //! Maximum value of \ref VecElementType
+ kMaxValue = kH2
+};
+
+//! Vector register (AArch64).
+class Vec : public BaseVec {
+public:
+ ASMJIT_DEFINE_ABSTRACT_REG(Vec, BaseVec)
+
+ //! \cond
+ //! Shortcuts.
+ enum SignatureReg : uint32_t {
+ kSignatureElementB = uint32_t(VecElementType::kB) << kSignatureRegElementTypeShift,
+ kSignatureElementH = uint32_t(VecElementType::kH) << kSignatureRegElementTypeShift,
+ kSignatureElementS = uint32_t(VecElementType::kS) << kSignatureRegElementTypeShift,
+ kSignatureElementD = uint32_t(VecElementType::kD) << kSignatureRegElementTypeShift,
+ kSignatureElementB4 = uint32_t(VecElementType::kB4) << kSignatureRegElementTypeShift,
+ kSignatureElementH2 = uint32_t(VecElementType::kH2) << kSignatureRegElementTypeShift
+ };
+ //! \endcond
+
+ //! Returns whether the register has element type or element index (or both).
+ ASMJIT_INLINE_NODEBUG constexpr bool hasElementTypeOrIndex() const noexcept { return _signature.hasField<kSignatureRegElementTypeMask | kSignatureRegElementFlagMask>(); }
+
+ //! Returns whether the vector register has associated a vector element type.
+ ASMJIT_INLINE_NODEBUG constexpr bool hasElementType() const noexcept { return _signature.hasField<kSignatureRegElementTypeMask>(); }
+ //! Returns vector element type of the register.
+ ASMJIT_INLINE_NODEBUG constexpr VecElementType elementType() const noexcept { return VecElementType(_signature.getField<kSignatureRegElementTypeMask>()); }
+ //! Sets vector element type of the register to `elementType`.
+ ASMJIT_INLINE_NODEBUG void setElementType(VecElementType elementType) noexcept { _signature.setField<kSignatureRegElementTypeMask>(uint32_t(elementType)); }
+ //! Resets vector element type to none.
+ ASMJIT_INLINE_NODEBUG void resetElementType() noexcept { _signature.setField<kSignatureRegElementTypeMask>(0); }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecB8() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementB);
+ }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecH4() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementH);
+ }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecS2() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementS);
+ }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecD1() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecD>::kSignature);
+ }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecB16() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementB);
+ }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecH8() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementH);
+ }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecS4() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementS);
+ }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecD2() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementD);
+ }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecB4x4() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementB4);
+ }
+
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecH2x4() const noexcept {
+ return _signature.subset(uint32_t(kBaseSignatureMask) | uint32_t(kSignatureRegElementTypeMask)) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementH2);
+ }
+
+ //! Creates a cloned register with element access.
+ ASMJIT_INLINE_NODEBUG Vec at(uint32_t elementIndex) const noexcept {
+ return Vec((signature() & ~kSignatureRegElementIndexMask) | (elementIndex << kSignatureRegElementIndexShift) | kSignatureRegElementFlagMask, id());
+ }
+
+ //! Cast this register to an 8-bit B register (AArch64 only).
+ ASMJIT_INLINE_NODEBUG VecB b() const noexcept;
+ //! Cast this register to a 16-bit H register (AArch64 only).
+ ASMJIT_INLINE_NODEBUG VecH h() const noexcept;
+ //! Cast this register to a 32-bit S register.
+ ASMJIT_INLINE_NODEBUG VecS s() const noexcept;
+ //! Cast this register to a 64-bit D register.
+ ASMJIT_INLINE_NODEBUG VecD d() const noexcept;
+ //! Cast this register to a 128-bit Q register.
+ ASMJIT_INLINE_NODEBUG VecV q() const noexcept;
+ //! Cast this register to a 128-bit V register.
+ ASMJIT_INLINE_NODEBUG VecV v() const noexcept;
+
+ //! Casts this register to b (clone).
+ ASMJIT_INLINE_NODEBUG Vec v8() const noexcept;
+ //! Casts this register to h (clone).
+ ASMJIT_INLINE_NODEBUG Vec v16() const noexcept;
+ //! Casts this register to s (clone).
+ ASMJIT_INLINE_NODEBUG Vec v32() const noexcept;
+ //! Casts this register to d (clone).
+ ASMJIT_INLINE_NODEBUG Vec v64() const noexcept;
+ //! Casts this register to q (clone).
+ ASMJIT_INLINE_NODEBUG Vec v128() const noexcept;
+
+ //! Cast this register to a 128-bit V.B[elementIndex] register.
+ ASMJIT_INLINE_NODEBUG VecV b(uint32_t elementIndex) const noexcept;
+ //! Cast this register to a 128-bit V.H[elementIndex] register.
+ ASMJIT_INLINE_NODEBUG VecV h(uint32_t elementIndex) const noexcept;
+ //! Cast this register to a 128-bit V.S[elementIndex] register.
+ ASMJIT_INLINE_NODEBUG VecV s(uint32_t elementIndex) const noexcept;
+ //! Cast this register to a 128-bit V.D[elementIndex] register.
+ ASMJIT_INLINE_NODEBUG VecV d(uint32_t elementIndex) const noexcept;
+ //! Cast this register to a 128-bit V.H2[elementIndex] register.
+ ASMJIT_INLINE_NODEBUG VecV h2(uint32_t elementIndex) const noexcept;
+ //! Cast this register to a 128-bit V.B4[elementIndex] register.
+ ASMJIT_INLINE_NODEBUG VecV b4(uint32_t elementIndex) const noexcept;
+
+ //! Cast this register to V.8B.
+ ASMJIT_INLINE_NODEBUG VecD b8() const noexcept;
+ //! Cast this register to V.16B.
+ ASMJIT_INLINE_NODEBUG VecV b16() const noexcept;
+ //! Cast this register to V.2H.
+ ASMJIT_INLINE_NODEBUG VecS h2() const noexcept;
+ //! Cast this register to V.4H.
+ ASMJIT_INLINE_NODEBUG VecD h4() const noexcept;
+ //! Cast this register to V.8H.
+ ASMJIT_INLINE_NODEBUG VecV h8() const noexcept;
+ //! Cast this register to V.2S.
+ ASMJIT_INLINE_NODEBUG VecD s2() const noexcept;
+ //! Cast this register to V.4S.
+ ASMJIT_INLINE_NODEBUG VecV s4() const noexcept;
+ //! Cast this register to V.2D.
+ ASMJIT_INLINE_NODEBUG VecV d2() const noexcept;
+
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature _makeElementAccessSignature(VecElementType elementType, uint32_t elementIndex) noexcept {
+ return OperandSignature{
+ uint32_t(RegTraits<RegType::kARM_VecV>::kSignature) |
+ uint32_t(kSignatureRegElementFlagMask) |
+ (uint32_t(elementType) << kSignatureRegElementTypeShift) |
+ (uint32_t(elementIndex << kSignatureRegElementIndexShift))};
+ }
+};
+
+//! 8-bit view (S) of VFP/SIMD register.
+class VecB : public Vec {
+public:
+ ASMJIT_DEFINE_FINAL_REG(VecB, Vec, RegTraits<RegType::kARM_VecB>)
+};
+
+//! 16-bit view (S) of VFP/SIMD register.
+class VecH : public Vec {
+public:
+ ASMJIT_DEFINE_FINAL_REG(VecH, Vec, RegTraits<RegType::kARM_VecH>)
+};
+
+//! 32-bit view (S) of VFP/SIMD register.
+class VecS : public Vec {
+public:
+ ASMJIT_DEFINE_FINAL_REG(VecS, Vec, RegTraits<RegType::kARM_VecS>)
+};
+
+//! 64-bit view (D) of VFP/SIMD register.
+class VecD : public Vec {
+public:
+ ASMJIT_DEFINE_FINAL_REG(VecD, Vec, RegTraits<RegType::kARM_VecD>)
+};
+
+//! 128-bit vector register (Q or V).
+class VecV : public Vec {
+public:
+ ASMJIT_DEFINE_FINAL_REG(VecV, Vec, RegTraits<RegType::kARM_VecV>)
+};
+
+ASMJIT_INLINE_NODEBUG VecB Vec::b() const noexcept { return VecB(id()); }
+ASMJIT_INLINE_NODEBUG VecH Vec::h() const noexcept { return VecH(id()); }
+ASMJIT_INLINE_NODEBUG VecS Vec::s() const noexcept { return VecS(id()); }
+ASMJIT_INLINE_NODEBUG VecD Vec::d() const noexcept { return VecD(id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::q() const noexcept { return VecV(id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::v() const noexcept { return VecV(id()); }
+
+ASMJIT_INLINE_NODEBUG Vec Vec::v8() const noexcept { return VecB(id()); }
+ASMJIT_INLINE_NODEBUG Vec Vec::v16() const noexcept { return VecH(id()); }
+ASMJIT_INLINE_NODEBUG Vec Vec::v32() const noexcept { return VecS(id()); }
+ASMJIT_INLINE_NODEBUG Vec Vec::v64() const noexcept { return VecD(id()); }
+ASMJIT_INLINE_NODEBUG Vec Vec::v128() const noexcept { return VecV(id()); }
+
+ASMJIT_INLINE_NODEBUG VecV Vec::b(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(VecElementType::kB, elementIndex), id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::h(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(VecElementType::kH, elementIndex), id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::s(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(VecElementType::kS, elementIndex), id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::d(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(VecElementType::kD, elementIndex), id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::h2(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(VecElementType::kH2, elementIndex), id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::b4(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(VecElementType::kB4, elementIndex), id()); }
+
+ASMJIT_INLINE_NODEBUG VecD Vec::b8() const noexcept { return VecD(OperandSignature{VecD::kSignature | kSignatureElementB}, id()); }
+ASMJIT_INLINE_NODEBUG VecS Vec::h2() const noexcept { return VecS(OperandSignature{VecS::kSignature | kSignatureElementH}, id()); }
+ASMJIT_INLINE_NODEBUG VecD Vec::h4() const noexcept { return VecD(OperandSignature{VecD::kSignature | kSignatureElementH}, id()); }
+ASMJIT_INLINE_NODEBUG VecD Vec::s2() const noexcept { return VecD(OperandSignature{VecD::kSignature | kSignatureElementS}, id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::b16() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementB}, id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::h8() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementH}, id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::s4() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementS}, id()); }
+ASMJIT_INLINE_NODEBUG VecV Vec::d2() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementD}, id()); }
#ifndef _DOXYGEN
namespace regs {
#endif
-using namespace ::asmjit::arm::regs;
+//! Creates a 32-bit W register operand.
+static ASMJIT_INLINE_NODEBUG constexpr GpW w(uint32_t id) noexcept { return GpW(id); }
+//! Creates a 64-bit X register operand.
+static ASMJIT_INLINE_NODEBUG constexpr GpX x(uint32_t id) noexcept { return GpX(id); }
+
+//! Creates a 32-bit S register operand.
+static ASMJIT_INLINE_NODEBUG constexpr VecS s(uint32_t id) noexcept { return VecS(id); }
+//! Creates a 64-bit D register operand.
+static ASMJIT_INLINE_NODEBUG constexpr VecD d(uint32_t id) noexcept { return VecD(id); }
+//! Creates a 1282-bit V register operand.
+static ASMJIT_INLINE_NODEBUG constexpr VecV v(uint32_t id) noexcept { return VecV(id); }
static constexpr GpW w0 = GpW(0);
static constexpr GpW w1 = GpW(1);
@@ -305,8 +585,94 @@ static constexpr VecV v31 = VecV(31);
using namespace regs;
#endif
+//! \name Shift Operation Construction
+//! \{
+
+//! Constructs a `UXTB #value` extend and shift (unsigned byte extend) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Shift uxtb(uint32_t value) noexcept { return Shift(ShiftOp::kUXTB, value); }
+//! Constructs a `UXTH #value` extend and shift (unsigned hword extend) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Shift uxth(uint32_t value) noexcept { return Shift(ShiftOp::kUXTH, value); }
+//! Constructs a `UXTW #value` extend and shift (unsigned word extend) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Shift uxtw(uint32_t value) noexcept { return Shift(ShiftOp::kUXTW, value); }
+//! Constructs a `UXTX #value` extend and shift (unsigned dword extend) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Shift uxtx(uint32_t value) noexcept { return Shift(ShiftOp::kUXTX, value); }
+
+//! Constructs a `SXTB #value` extend and shift (signed byte extend) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Shift sxtb(uint32_t value) noexcept { return Shift(ShiftOp::kSXTB, value); }
+//! Constructs a `SXTH #value` extend and shift (signed hword extend) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Shift sxth(uint32_t value) noexcept { return Shift(ShiftOp::kSXTH, value); }
+//! Constructs a `SXTW #value` extend and shift (signed word extend) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Shift sxtw(uint32_t value) noexcept { return Shift(ShiftOp::kSXTW, value); }
+//! Constructs a `SXTX #value` extend and shift (signed dword extend) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Shift sxtx(uint32_t value) noexcept { return Shift(ShiftOp::kSXTX, value); }
+
+//! \}
+
+//! \name Memory Operand Construction
+//! \{
+
+//! Creates `[base, offset]` memory operand (offset mode) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Gp& base, int32_t offset = 0) noexcept {
+ return Mem(base, offset);
+}
+
+//! Creates `[base, offset]!` memory operand (pre-index mode) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_pre(const Gp& base, int32_t offset = 0) noexcept {
+ return Mem(base, offset, OperandSignature::fromValue<Mem::kSignatureMemOffsetModeMask>(OffsetMode::kPreIndex));
+}
+
+//! Creates `[base], offset` memory operand (post-index mode) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_post(const Gp& base, int32_t offset = 0) noexcept {
+ return Mem(base, offset, OperandSignature::fromValue<Mem::kSignatureMemOffsetModeMask>(OffsetMode::kPostIndex));
+}
+
+//! Creates `[base, index]` memory operand (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Gp& base, const Gp& index) noexcept {
+ return Mem(base, index);
+}
+
+//! Creates `[base, index]!` memory operand (pre-index mode) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_pre(const Gp& base, const Gp& index) noexcept {
+ return Mem(base, index, OperandSignature::fromValue<Mem::kSignatureMemOffsetModeMask>(OffsetMode::kPreIndex));
+}
+
+//! Creates `[base], index` memory operand (post-index mode) (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_post(const Gp& base, const Gp& index) noexcept {
+ return Mem(base, index, OperandSignature::fromValue<Mem::kSignatureMemOffsetModeMask>(OffsetMode::kPostIndex));
+}
+
+//! Creates `[base, index, SHIFT_OP #shift]` memory operand (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Gp& base, const Gp& index, const Shift& shift) noexcept {
+ return Mem(base, index, shift);
+}
+
+//! Creates `[base, offset]` memory operand (AArch64).
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Label& base, int32_t offset = 0) noexcept {
+ return Mem(base, offset);
+}
+
+// TODO: [ARM] PC + offset address.
+#if 0
+//! Creates `[PC + offset]` (relative) memory operand.
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const PC& pc, int32_t offset = 0) noexcept {
+ return Mem(pc, offset);
+}
+#endif
+
+//! \}
+
//! \}
ASMJIT_END_SUB_NAMESPACE
+//! \cond INTERNAL
+ASMJIT_BEGIN_NAMESPACE
+ASMJIT_DEFINE_TYPE_ID(a64::GpW, TypeId::kInt32);
+ASMJIT_DEFINE_TYPE_ID(a64::GpX, TypeId::kInt64);
+ASMJIT_DEFINE_TYPE_ID(a64::VecS, TypeId::kFloat32x1);
+ASMJIT_DEFINE_TYPE_ID(a64::VecD, TypeId::kFloat64x1);
+ASMJIT_DEFINE_TYPE_ID(a64::VecV, TypeId::kInt32x4);
+ASMJIT_END_NAMESPACE
+//! \endcond
+
#endif // ASMJIT_ARM_A64OPERAND_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64rapass.cpp b/3rdparty/asmjit/src/asmjit/arm/a64rapass.cpp
index aaec1c90f99..b97f259efa0 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64rapass.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/a64rapass.cpp
@@ -131,7 +131,7 @@ Error RACFGBuilder::onInst(InstNode* inst, InstControlFlow& controlType, RAInstB
InstId instId = inst->id();
uint32_t opCount = inst->opCount();
const Operand* opArray = inst->operands();
- ASMJIT_PROPAGATE(InstInternal::queryRWInfo(_arch, inst->baseInst(), opArray, opCount, &rwInfo));
+ ASMJIT_PROPAGATE(InstInternal::queryRWInfo(inst->baseInst(), opArray, opCount, &rwInfo));
const InstDB::InstInfo& instInfo = InstDB::infoById(instId);
uint32_t singleRegOps = 0;
@@ -230,7 +230,7 @@ Error RACFGBuilder::onInst(InstNode* inst, InstControlFlow& controlType, RAInstB
if (reg.as<Vec>().hasElementIndex()) {
// Only the first 0..15 registers can be used if the register uses
// element accessor that accesses half-words (h[0..7] elements).
- if (instInfo.hasFlag(InstDB::kInstFlagVH0_15) && reg.as<Vec>().elementType() == Vec::kElementTypeH) {
+ if (instInfo.hasFlag(InstDB::kInstFlagVH0_15) && reg.as<Vec>().elementType() == VecElementType::kH) {
if (Support::test(flags, RATiedFlags::kUse))
useId &= 0x0000FFFFu;
else
@@ -595,14 +595,14 @@ void ARMRAPass::onInit() noexcept {
_archTraits = &ArchTraits::byArch(arch);
_physRegCount.set(RegGroup::kGp, 32);
_physRegCount.set(RegGroup::kVec, 32);
- _physRegCount.set(RegGroup::kExtraVirt2, 0);
+ _physRegCount.set(RegGroup::kMask, 0);
_physRegCount.set(RegGroup::kExtraVirt3, 0);
_buildPhysIndex();
_availableRegCount = _physRegCount;
_availableRegs[RegGroup::kGp] = Support::lsbMask<uint32_t>(_physRegCount.get(RegGroup::kGp));
_availableRegs[RegGroup::kVec] = Support::lsbMask<uint32_t>(_physRegCount.get(RegGroup::kVec));
- _availableRegs[RegGroup::kExtraVirt3] = Support::lsbMask<uint32_t>(_physRegCount.get(RegGroup::kExtraVirt2));
+ _availableRegs[RegGroup::kMask] = Support::lsbMask<uint32_t>(_physRegCount.get(RegGroup::kMask));
_availableRegs[RegGroup::kExtraVirt3] = Support::lsbMask<uint32_t>(_physRegCount.get(RegGroup::kExtraVirt3));
_scratchRegIndexes[0] = uint8_t(27);
@@ -612,7 +612,9 @@ void ARMRAPass::onInit() noexcept {
// make unavailable all registers that are special and cannot be used in general.
bool hasFP = _func->frame().hasPreservedFP();
- if (hasFP)
+ // Apple ABI requires that the frame-pointer register is not changed by leaf functions and properly updated
+ // by non-leaf functions. So, let's make this register unavailable as it's just not safe to update it.
+ if (hasFP || cc()->environment().isDarwin())
makeUnavailable(RegGroup::kGp, Gp::kIdFp);
makeUnavailable(RegGroup::kGp, Gp::kIdSp);
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64rapass_p.h b/3rdparty/asmjit/src/asmjit/arm/a64rapass_p.h
index e1a90ab8df7..73130873f44 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64rapass_p.h
+++ b/3rdparty/asmjit/src/asmjit/arm/a64rapass_p.h
@@ -37,7 +37,7 @@ public:
//! \{
ARMRAPass() noexcept;
- virtual ~ARMRAPass() noexcept;
+ ~ARMRAPass() noexcept override;
//! \}
@@ -45,10 +45,10 @@ public:
//! \{
//! Returns the compiler casted to `arm::Compiler`.
- inline Compiler* cc() const noexcept { return static_cast<Compiler*>(_cb); }
+ ASMJIT_INLINE_NODEBUG Compiler* cc() const noexcept { return static_cast<Compiler*>(_cb); }
//! Returns emit helper.
- inline EmitHelper* emitHelper() noexcept { return &_emitHelper; }
+ ASMJIT_INLINE_NODEBUG EmitHelper* emitHelper() noexcept { return &_emitHelper; }
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/arm/armformatter.cpp b/3rdparty/asmjit/src/asmjit/arm/armformatter.cpp
index 0432043106a..3fe2c6b911c 100644
--- a/3rdparty/asmjit/src/asmjit/arm/armformatter.cpp
+++ b/3rdparty/asmjit/src/asmjit/arm/armformatter.cpp
@@ -9,7 +9,7 @@
#include "../core/misc_p.h"
#include "../core/support.h"
#include "../arm/armformatter_p.h"
-#include "../arm/armoperand.h"
+#include "../arm/a64operand.h"
#include "../arm/a64instapi_p.h"
#include "../arm/a64instdb_p.h"
@@ -26,78 +26,225 @@ Error FormatterInternal::formatFeature(String& sb, uint32_t featureId) noexcept
// @EnumStringBegin{"enum": "CpuFeatures::ARM", "output": "sFeature", "strip": "k"}@
static const char sFeatureString[] =
"None\0"
- "THUMB\0"
- "THUMBv2\0"
"ARMv6\0"
"ARMv7\0"
"ARMv8a\0"
- "ARMv8_1a\0"
- "ARMv8_2a\0"
- "ARMv8_3a\0"
- "ARMv8_4a\0"
- "ARMv8_5a\0"
- "ARMv8_6a\0"
- "ARMv8_7a\0"
- "VFPv2\0"
- "VFPv3\0"
- "VFPv4\0"
- "VFP_D32\0"
+ "THUMB\0"
+ "THUMBv2\0"
+ "ABLE\0"
+ "ADERR\0"
"AES\0"
- "ALTNZCV\0"
+ "AFP\0"
+ "AIE\0"
+ "AMU1\0"
+ "AMU1_1\0"
+ "ANERR\0"
"ASIMD\0"
"BF16\0"
+ "BRBE\0"
"BTI\0"
+ "BWE\0"
+ "CCIDX\0"
+ "CHK\0"
+ "CLRBHB\0"
+ "CMOW\0"
+ "CONSTPACFIELD\0"
+ "CPA\0"
+ "CPA2\0"
"CPUID\0"
"CRC32\0"
+ "CSSC\0"
+ "CSV2\0"
+ "CSV2_3\0"
+ "CSV3\0"
+ "D128\0"
"DGH\0"
"DIT\0"
"DOTPROD\0"
+ "DPB\0"
+ "DPB2\0"
+ "EBEP\0"
+ "EBF16\0"
+ "ECBHB\0"
+ "ECV\0"
+ "EDHSR\0"
"EDSP\0"
+ "FAMINMAX\0"
"FCMA\0"
- "FJCVTZS\0"
+ "FGT\0"
+ "FGT2\0"
+ "FHM\0"
"FLAGM\0"
+ "FLAGM2\0"
+ "FMAC\0"
+ "FP\0"
+ "FP16\0"
"FP16CONV\0"
- "FP16FML\0"
- "FP16FULL\0"
- "FRINT\0"
+ "FP8\0"
+ "FP8DOT2\0"
+ "FP8DOT4\0"
+ "FP8FMA\0"
+ "FPMR\0"
+ "FRINTTS\0"
+ "GCS\0"
+ "HACDBS\0"
+ "HAFDBS\0"
+ "HAFT\0"
+ "HDBSS\0"
+ "HBC\0"
+ "HCX\0"
+ "HPDS\0"
+ "HPDS2\0"
"I8MM\0"
"IDIVA\0"
"IDIVT\0"
+ "ITE\0"
+ "JSCVT\0"
+ "LOR\0"
+ "LRCPC\0"
+ "LRCPC2\0"
+ "LRCPC3\0"
+ "LS64\0"
+ "LS64_ACCDATA\0"
+ "LS64_V\0"
"LSE\0"
+ "LSE128\0"
+ "LSE2\0"
+ "LUT\0"
+ "LVA\0"
+ "LVA3\0"
+ "MEC\0"
+ "MOPS\0"
+ "MPAM\0"
"MTE\0"
- "RCPC_IMMO\0"
- "RDM\0"
+ "MTE2\0"
+ "MTE3\0"
+ "MTE4\0"
+ "MTE_ASYM_FAULT\0"
+ "MTE_ASYNC\0"
+ "MTE_CANONICAL_TAGS\0"
+ "MTE_NO_ADDRESS_TAGS\0"
+ "MTE_PERM_S1\0"
+ "MTE_STORE_ONLY\0"
+ "MTE_TAGGED_FAR\0"
+ "MTPMU\0"
+ "NMI\0"
+ "NV\0"
+ "NV2\0"
+ "PAN\0"
+ "PAN2\0"
+ "PAN3\0"
+ "PAUTH\0"
+ "PFAR\0"
"PMU\0"
"PMULL\0"
+ "PRFMSLC\0"
+ "RAS\0"
+ "RAS1_1\0"
+ "RAS2\0"
+ "RASSA2\0"
+ "RDM\0"
+ "RME\0"
"RNG\0"
+ "RNG_TRAP\0"
+ "RPRES\0"
+ "RPRFM\0"
+ "S1PIE\0"
+ "S1POE\0"
+ "S2PIE\0"
+ "S2POE\0"
"SB\0"
+ "SCTLR2\0"
+ "SEBEP\0"
+ "SEL2\0"
"SHA1\0"
- "SHA2\0"
+ "SHA256\0"
"SHA3\0"
"SHA512\0"
"SM3\0"
"SM4\0"
+ "SME\0"
+ "SME2\0"
+ "SME2_1\0"
+ "SME_B16B16\0"
+ "SME_B16F32\0"
+ "SME_BI32I32\0"
+ "SME_F16F16\0"
+ "SME_F16F32\0"
+ "SME_F32F32\0"
+ "SME_F64F64\0"
+ "SME_F8F16\0"
+ "SME_F8F32\0"
+ "SME_FA64\0"
+ "SME_I16I32\0"
+ "SME_I16I64\0"
+ "SME_I8I32\0"
+ "SME_LUTv2\0"
+ "SPE\0"
+ "SPE1_1\0"
+ "SPE1_2\0"
+ "SPE1_3\0"
+ "SPE1_4\0"
+ "SPE_ALTCLK\0"
+ "SPE_CRR\0"
+ "SPE_EFT\0"
+ "SPE_FDS\0"
+ "SPE_FPF\0"
+ "SPE_SME\0"
+ "SPECRES\0"
+ "SPECRES2\0"
+ "SPMU\0"
"SSBS\0"
+ "SSBS2\0"
+ "SSVE_FP8DOT2\0"
+ "SSVE_FP8DOT4\0"
+ "SSVE_FP8FMA\0"
"SVE\0"
+ "SVE2\0"
+ "SVE2_1\0"
+ "SVE_AES\0"
+ "SVE_B16B16\0"
"SVE_BF16\0"
+ "SVE_BITPERM\0"
+ "SVE_EBF16\0"
"SVE_F32MM\0"
"SVE_F64MM\0"
"SVE_I8MM\0"
- "SVE_PMULL\0"
- "SVE2\0"
- "SVE2_AES\0"
- "SVE2_BITPERM\0"
- "SVE2_SHA3\0"
- "SVE2_SM4\0"
+ "SVE_PMULL128\0"
+ "SVE_SHA3\0"
+ "SVE_SM4\0"
+ "SYSINSTR128\0"
+ "SYSREG128\0"
+ "THE\0"
+ "TLBIOS\0"
+ "TLBIRANGE\0"
+ "TLBIW\0"
"TME\0"
+ "TRF\0"
+ "UAO\0"
+ "VFP_D32\0"
+ "VHE\0"
+ "VMID16\0"
+ "WFXT\0"
+ "XNX\0"
+ "XS\0"
"<Unknown>\0";
static const uint16_t sFeatureIndex[] = {
- 0, 5, 11, 19, 25, 31, 38, 47, 56, 65, 74, 83, 92, 101, 107, 113, 119, 127,
- 131, 139, 145, 150, 154, 160, 166, 170, 174, 182, 187, 192, 200, 206, 215,
- 223, 232, 238, 243, 249, 255, 259, 263, 273, 277, 281, 287, 291, 294, 299,
- 304, 309, 316, 320, 324, 329, 333, 342, 352, 362, 371, 381, 386, 395, 408,
- 418, 427, 431
+ 0, 5, 11, 17, 24, 30, 38, 43, 49, 53, 57, 61, 66, 73, 79, 85, 90, 95, 99,
+ 103, 109, 113, 120, 125, 139, 143, 148, 154, 160, 165, 170, 177, 182, 187,
+ 191, 195, 203, 207, 212, 217, 223, 229, 233, 239, 244, 253, 258, 262, 267,
+ 271, 277, 284, 289, 292, 297, 306, 310, 318, 326, 333, 338, 346, 350, 357,
+ 364, 369, 375, 379, 383, 388, 394, 399, 405, 411, 415, 421, 425, 431, 438,
+ 445, 450, 463, 470, 474, 481, 486, 490, 494, 499, 503, 508, 513, 517, 522,
+ 527, 532, 547, 557, 576, 596, 608, 623, 638, 644, 648, 651, 655, 659, 664,
+ 669, 675, 680, 684, 690, 698, 702, 709, 714, 721, 725, 729, 733, 742, 748,
+ 754, 760, 766, 772, 778, 781, 788, 794, 799, 804, 811, 816, 823, 827, 831,
+ 835, 840, 847, 858, 869, 881, 892, 903, 914, 925, 935, 945, 954, 965, 976,
+ 986, 996, 1000, 1007, 1014, 1021, 1028, 1039, 1047, 1055, 1063, 1071, 1079,
+ 1087, 1096, 1101, 1106, 1112, 1125, 1138, 1150, 1154, 1159, 1166, 1174, 1185,
+ 1194, 1206, 1216, 1226, 1236, 1245, 1258, 1267, 1275, 1287, 1297, 1301, 1308,
+ 1318, 1324, 1328, 1332, 1336, 1344, 1348, 1355, 1360, 1364, 1367
};
// @EnumStringEnd@
@@ -111,14 +258,14 @@ ASMJIT_FAVOR_SIZE Error FormatterInternal::formatCondCode(String& sb, CondCode c
static const char condCodeData[] =
"al\0" "na\0"
"eq\0" "ne\0"
- "cs\0" "cc\0" "mi\0" "pl\0" "vs\0" "vc\0"
+ "hs\0" "lo\0" "mi\0" "pl\0" "vs\0" "vc\0"
"hi\0" "ls\0" "ge\0" "lt\0" "gt\0" "le\0"
"<Unknown>";
return sb.append(condCodeData + Support::min<uint32_t>(uint32_t(cc), 16u) * 3);
}
ASMJIT_FAVOR_SIZE Error FormatterInternal::formatShiftOp(String& sb, ShiftOp shiftOp) noexcept {
- const char* str = "<Unknown>";
+ const char* str = nullptr;
switch (shiftOp) {
case ShiftOp::kLSL: str = "lsl"; break;
case ShiftOp::kLSR: str = "lsr"; break;
@@ -134,10 +281,308 @@ ASMJIT_FAVOR_SIZE Error FormatterInternal::formatShiftOp(String& sb, ShiftOp shi
case ShiftOp::kSXTH: str = "sxth"; break;
case ShiftOp::kSXTW: str = "sxtw"; break;
case ShiftOp::kSXTX: str = "sxtx"; break;
+ default: str = "<Unknown>"; break;
}
return sb.append(str);
}
+// arm::FormatterInternal - Format Register
+// ========================================
+
+struct FormatElementData {
+ char letter;
+ uint8_t elementCount;
+ uint8_t onlyIndex;
+ uint8_t reserved;
+};
+
+static constexpr FormatElementData formatElementDataTable[9] = {
+ { '?' , 0 , 0, 0 }, // None
+ { 'b' , 16, 0, 0 }, // bX or b[index]
+ { 'h' , 8 , 0, 0 }, // hX or h[index]
+ { 's' , 4 , 0, 0 }, // sX or s[index]
+ { 'd' , 2 , 0, 0 }, // dX or d[index]
+ { 'b' , 4 , 1, 0 }, // ?? or b4[index]
+ { 'h' , 2 , 1, 0 }, // ?? or h2[index]
+ { '?' , 0 , 0, 0 }, // invalid (possibly stored in Operand)
+ { '?' , 0 , 0, 0 } // invalid (never stored in Operand, bug...)
+};
+
+ASMJIT_FAVOR_SIZE Error FormatterInternal::formatRegister(
+ String& sb,
+ FormatFlags flags,
+ const BaseEmitter* emitter,
+ Arch arch,
+ RegType regType,
+ uint32_t rId,
+ uint32_t elementType,
+ uint32_t elementIndex) noexcept {
+
+ DebugUtils::unused(flags);
+ DebugUtils::unused(arch);
+
+ static const char bhsdq[] = "bhsdq";
+
+ bool virtRegFormatted = false;
+
+#ifndef ASMJIT_NO_COMPILER
+ if (Operand::isVirtId(rId)) {
+ if (emitter && emitter->isCompiler()) {
+ const BaseCompiler* cc = static_cast<const BaseCompiler*>(emitter);
+ if (cc->isVirtIdValid(rId)) {
+ VirtReg* vReg = cc->virtRegById(rId);
+ ASMJIT_ASSERT(vReg != nullptr);
+
+ const char* name = vReg->name();
+ if (name && name[0] != '\0')
+ ASMJIT_PROPAGATE(sb.append(name));
+ else
+ ASMJIT_PROPAGATE(sb.appendFormat("%%%u", unsigned(Operand::virtIdToIndex(rId))));
+
+ virtRegFormatted = true;
+ }
+ }
+ }
+#else
+ DebugUtils::unused(emitter, flags);
+#endif
+
+ if (!virtRegFormatted) {
+ char letter = '\0';
+ switch (regType) {
+ case RegType::kARM_VecB:
+ case RegType::kARM_VecH:
+ case RegType::kARM_VecS:
+ case RegType::kARM_VecD:
+ case RegType::kARM_VecV:
+ letter = bhsdq[uint32_t(regType) - uint32_t(RegType::kARM_VecB)];
+ if (elementType)
+ letter = 'v';
+ break;
+
+ case RegType::kARM_GpW:
+ if (Environment::is64Bit(arch)) {
+ letter = 'w';
+
+ if (rId == a64::Gp::kIdZr)
+ return sb.append("wzr", 3);
+
+ if (rId == a64::Gp::kIdSp)
+ return sb.append("wsp", 3);
+ }
+ else {
+ letter = 'r';
+ }
+ break;
+
+ case RegType::kARM_GpX:
+ if (Environment::is64Bit(arch)) {
+ if (rId == a64::Gp::kIdZr)
+ return sb.append("xzr", 3);
+ if (rId == a64::Gp::kIdSp)
+ return sb.append("sp", 2);
+
+ letter = 'x';
+ break;
+ }
+
+ // X registers are undefined in 32-bit mode.
+ ASMJIT_FALLTHROUGH;
+
+ default:
+ ASMJIT_PROPAGATE(sb.appendFormat("<Reg-%u>?%u", uint32_t(regType), rId));
+ break;
+ }
+
+ if (letter)
+ ASMJIT_PROPAGATE(sb.appendFormat("%c%u", letter, rId));
+ }
+
+ constexpr uint32_t kElementTypeCount = uint32_t(a64::VecElementType::kMaxValue) + 1;
+ if (elementType) {
+ elementType = Support::min(elementType, kElementTypeCount);
+
+ FormatElementData elementData = formatElementDataTable[elementType];
+ uint32_t elementCount = elementData.elementCount;
+
+ if (regType == RegType::kARM_VecD) {
+ elementCount /= 2u;
+ }
+
+ ASMJIT_PROPAGATE(sb.append('.'));
+ if (elementCount) {
+ ASMJIT_PROPAGATE(sb.appendUInt(elementCount));
+ }
+ ASMJIT_PROPAGATE(sb.append(elementData.letter));
+ }
+
+ if (elementIndex != 0xFFFFFFFFu) {
+ ASMJIT_PROPAGATE(sb.appendFormat("[%u]", elementIndex));
+ }
+
+ return kErrorOk;
+}
+
+ASMJIT_FAVOR_SIZE Error FormatterInternal::formatRegisterList(
+ String& sb,
+ FormatFlags flags,
+ const BaseEmitter* emitter,
+ Arch arch,
+ RegType regType,
+ uint32_t rMask) noexcept {
+
+ bool first = true;
+
+ ASMJIT_PROPAGATE(sb.append('{'));
+ while (rMask != 0u) {
+ uint32_t start = Support::ctz(rMask);
+ uint32_t count = 0u;
+
+ uint32_t mask = 1u << start;
+ do {
+ rMask &= ~mask;
+ mask <<= 1u;
+ count++;
+ } while (rMask & mask);
+
+ if (!first)
+ ASMJIT_PROPAGATE(sb.append(", "));
+
+ ASMJIT_PROPAGATE(formatRegister(sb, flags, emitter, arch, regType, start, 0, 0xFFFFFFFFu));
+ if (count >= 2u) {
+ ASMJIT_PROPAGATE(sb.append('-'));
+ ASMJIT_PROPAGATE(formatRegister(sb, flags, emitter, arch, regType, start + count - 1, 0, 0xFFFFFFFFu));
+ }
+
+ first = false;
+ }
+ ASMJIT_PROPAGATE(sb.append('}'));
+
+ return kErrorOk;
+}
+
+// a64::FormatterInternal - Format Operand
+// =======================================
+
+ASMJIT_FAVOR_SIZE Error FormatterInternal::formatOperand(
+ String& sb,
+ FormatFlags flags,
+ const BaseEmitter* emitter,
+ Arch arch,
+ const Operand_& op) noexcept {
+
+ if (op.isReg()) {
+ const BaseReg& reg = op.as<BaseReg>();
+
+ uint32_t elementType = op._signature.getField<BaseVec::kSignatureRegElementTypeMask>();
+ uint32_t elementIndex = op.as<BaseVec>().elementIndex();
+
+ if (!op.as<BaseVec>().hasElementIndex())
+ elementIndex = 0xFFFFFFFFu;
+
+ return formatRegister(sb, flags, emitter, arch, reg.type(), reg.id(), elementType, elementIndex);
+ }
+
+ if (op.isMem()) {
+ const Mem& m = op.as<Mem>();
+ ASMJIT_PROPAGATE(sb.append('['));
+
+ if (m.hasBase()) {
+ if (m.hasBaseLabel()) {
+ ASMJIT_PROPAGATE(Formatter::formatLabel(sb, flags, emitter, m.baseId()));
+ }
+ else {
+ FormatFlags modifiedFlags = flags;
+ if (m.isRegHome()) {
+ ASMJIT_PROPAGATE(sb.append('&'));
+ modifiedFlags &= ~FormatFlags::kRegCasts;
+ }
+ ASMJIT_PROPAGATE(formatRegister(sb, modifiedFlags, emitter, arch, m.baseType(), m.baseId()));
+ }
+ }
+ else {
+ // ARM really requires base.
+ if (m.hasIndex() || m.hasOffset()) {
+ ASMJIT_PROPAGATE(sb.append("<None>"));
+ }
+ }
+
+ // The post index makes it look like there was another operand, but it's
+ // still the part of AsmJit's `arm::Mem` operand so it's consistent with
+ // other architectures.
+ if (m.isPostIndex())
+ ASMJIT_PROPAGATE(sb.append(']'));
+
+ if (m.hasIndex()) {
+ ASMJIT_PROPAGATE(sb.append(", "));
+ ASMJIT_PROPAGATE(formatRegister(sb, flags, emitter, arch, m.indexType(), m.indexId()));
+ }
+
+ if (m.hasOffset()) {
+ ASMJIT_PROPAGATE(sb.append(", "));
+
+ int64_t off = int64_t(m.offset());
+ uint32_t base = 10;
+
+ if (Support::test(flags, FormatFlags::kHexOffsets) && uint64_t(off) > 9)
+ base = 16;
+
+ if (base == 10) {
+ ASMJIT_PROPAGATE(sb.appendInt(off, base));
+ }
+ else {
+ ASMJIT_PROPAGATE(sb.append("0x"));
+ ASMJIT_PROPAGATE(sb.appendUInt(uint64_t(off), base));
+ }
+ }
+
+ if (m.hasShift()) {
+ ASMJIT_PROPAGATE(sb.append(' '));
+ if (!m.isPreOrPost())
+ ASMJIT_PROPAGATE(formatShiftOp(sb, m.shiftOp()));
+ ASMJIT_PROPAGATE(sb.appendFormat(" %u", m.shift()));
+ }
+
+ if (!m.isPostIndex())
+ ASMJIT_PROPAGATE(sb.append(']'));
+
+ if (m.isPreIndex())
+ ASMJIT_PROPAGATE(sb.append('!'));
+
+ return kErrorOk;
+ }
+
+ if (op.isImm()) {
+ const Imm& i = op.as<Imm>();
+ int64_t val = i.value();
+ uint32_t predicate = i.predicate();
+
+ if (predicate) {
+ ASMJIT_PROPAGATE(formatShiftOp(sb, ShiftOp(predicate)));
+ ASMJIT_PROPAGATE(sb.append(' '));
+ }
+
+ if (Support::test(flags, FormatFlags::kHexImms) && uint64_t(val) > 9) {
+ ASMJIT_PROPAGATE(sb.append("0x"));
+ return sb.appendUInt(uint64_t(val), 16);
+ }
+ else {
+ return sb.appendInt(val, 10);
+ }
+ }
+
+ if (op.isLabel()) {
+ return Formatter::formatLabel(sb, flags, emitter, op.id());
+ }
+
+ if (op.isRegList()) {
+ const BaseRegList& regList = op.as<BaseRegList>();
+ return formatRegisterList(sb, flags, emitter, arch, regList.type(), regList.list());
+ }
+
+ return sb.append("<None>");
+}
+
ASMJIT_END_SUB_NAMESPACE
#endif // !ASMJIT_NO_LOGGING
diff --git a/3rdparty/asmjit/src/asmjit/arm/armformatter_p.h b/3rdparty/asmjit/src/asmjit/arm/armformatter_p.h
index 582173054a8..20b4812e913 100644
--- a/3rdparty/asmjit/src/asmjit/arm/armformatter_p.h
+++ b/3rdparty/asmjit/src/asmjit/arm/armformatter_p.h
@@ -33,6 +33,31 @@ Error ASMJIT_CDECL formatShiftOp(
String& sb,
ShiftOp shiftOp) noexcept;
+Error ASMJIT_CDECL formatRegister(
+ String& sb,
+ FormatFlags flags,
+ const BaseEmitter* emitter,
+ Arch arch,
+ RegType regType,
+ uint32_t rId,
+ uint32_t elementType = 0,
+ uint32_t elementIndex = 0xFFFFFFFF) noexcept;
+
+Error ASMJIT_CDECL formatRegisterList(
+ String& sb,
+ FormatFlags flags,
+ const BaseEmitter* emitter,
+ Arch arch,
+ RegType regType,
+ uint32_t rMask) noexcept;
+
+Error ASMJIT_CDECL formatOperand(
+ String& sb,
+ FormatFlags flags,
+ const BaseEmitter* emitter,
+ Arch arch,
+ const Operand_& op) noexcept;
+
} // {FormatterInternal}
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/arm/armglobals.h b/3rdparty/asmjit/src/asmjit/arm/armglobals.h
index 506646f8068..851f6708601 100644
--- a/3rdparty/asmjit/src/asmjit/arm/armglobals.h
+++ b/3rdparty/asmjit/src/asmjit/arm/armglobals.h
@@ -14,8 +14,4 @@
//!
//! API shared between AArch32 & AArch64 backends.
-ASMJIT_BEGIN_SUB_NAMESPACE(arm)
-
-ASMJIT_END_SUB_NAMESPACE
-
#endif // ASMJIT_ARM_ARMGLOBALS_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/arm/armoperand.h b/3rdparty/asmjit/src/asmjit/arm/armoperand.h
index ede829d9c18..583a3d8c326 100644
--- a/3rdparty/asmjit/src/asmjit/arm/armoperand.h
+++ b/3rdparty/asmjit/src/asmjit/arm/armoperand.h
@@ -19,18 +19,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(arm)
class Reg;
class Mem;
-class Gp;
-class GpW;
-class GpX;
-
-class Vec;
-class VecB;
-class VecH;
-class VecS;
-class VecD;
-class VecV;
-
-//! Register traits (ARM/AArch64).
+//! Register traits (AArch32/AArch64).
//!
//! Register traits contains information about a particular register type. It's used by asmjit to setup register
//! information on-the-fly and to populate tables that contain register information (this way it's possible to
@@ -39,128 +28,106 @@ template<RegType kRegType>
struct RegTraits : public BaseRegTraits {};
//! \cond
-// <--------------------+-----+-------------------------+------------------------+---+---+------------------+
-// | Reg | Reg-Type | Reg-Group |Sz |Cnt| TypeId |
-// <--------------------+-----+-------------------------+------------------------+---+---+------------------+
-ASMJIT_DEFINE_REG_TRAITS(GpW , RegType::kARM_GpW , RegGroup::kGp , 4 , 32, TypeId::kInt32 );
-ASMJIT_DEFINE_REG_TRAITS(GpX , RegType::kARM_GpX , RegGroup::kGp , 8 , 32, TypeId::kInt64 );
-ASMJIT_DEFINE_REG_TRAITS(VecB , RegType::kARM_VecB , RegGroup::kVec , 1 , 32, TypeId::kVoid );
-ASMJIT_DEFINE_REG_TRAITS(VecH , RegType::kARM_VecH , RegGroup::kVec , 2 , 32, TypeId::kVoid );
-ASMJIT_DEFINE_REG_TRAITS(VecS , RegType::kARM_VecS , RegGroup::kVec , 4 , 32, TypeId::kInt32x1 );
-ASMJIT_DEFINE_REG_TRAITS(VecD , RegType::kARM_VecD , RegGroup::kVec , 8 , 32, TypeId::kInt32x2 );
-ASMJIT_DEFINE_REG_TRAITS(VecV , RegType::kARM_VecV , RegGroup::kVec , 16, 32, TypeId::kInt32x4 );
+// <--------------------+------------------------+------------------------+---+------------------+
+// | Reg-Type | Reg-Group |Sz | TypeId |
+// <--------------------+------------------------+------------------------+---+------------------+
+ASMJIT_DEFINE_REG_TRAITS(RegType::kARM_GpW , RegGroup::kGp , 4 , TypeId::kInt32 ); // AArch32 & AArch64
+ASMJIT_DEFINE_REG_TRAITS(RegType::kARM_GpX , RegGroup::kGp , 8 , TypeId::kInt64 ); // AArch64
+ASMJIT_DEFINE_REG_TRAITS(RegType::kARM_VecB , RegGroup::kVec , 1 , TypeId::kVoid ); // AArch64
+ASMJIT_DEFINE_REG_TRAITS(RegType::kARM_VecH , RegGroup::kVec , 2 , TypeId::kVoid ); // AArch64
+ASMJIT_DEFINE_REG_TRAITS(RegType::kARM_VecS , RegGroup::kVec , 4 , TypeId::kInt32x1 ); // AArch32 & AArch64
+ASMJIT_DEFINE_REG_TRAITS(RegType::kARM_VecD , RegGroup::kVec , 8 , TypeId::kInt32x2 ); // AArch32 & AArch64
+ASMJIT_DEFINE_REG_TRAITS(RegType::kARM_VecQ , RegGroup::kVec , 16, TypeId::kInt32x4 ); // AArch32 & AArch64
+ASMJIT_DEFINE_REG_TRAITS(RegType::kARM_PC , RegGroup::kPC , 8 , TypeId::kInt64 ); // AArch64
//! \endcond
-//! Register (ARM).
+//! Register operand that can represent AArch32 and AArch64 registers.
class Reg : public BaseReg {
public:
ASMJIT_DEFINE_ABSTRACT_REG(Reg, BaseReg)
- //! Gets whether the register is a `R|W` register (32-bit).
- inline constexpr bool isGpW() const noexcept { return baseSignature() == RegTraits<RegType::kARM_GpW>::kSignature; }
+ //! Gets whether the register is either `R` or `W` register (32-bit).
+ ASMJIT_INLINE_NODEBUG constexpr bool isGpR() const noexcept { return baseSignature() == RegTraits<RegType::kARM_GpW>::kSignature; }
+ //! Gets whether the register is either `R` or `W` register (32-bit).
+ ASMJIT_INLINE_NODEBUG constexpr bool isGpW() const noexcept { return baseSignature() == RegTraits<RegType::kARM_GpW>::kSignature; }
//! Gets whether the register is an `X` register (64-bit).
- inline constexpr bool isGpX() const noexcept { return baseSignature() == RegTraits<RegType::kARM_GpX>::kSignature; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isGpX() const noexcept { return baseSignature() == RegTraits<RegType::kARM_GpX>::kSignature; }
+
//! Gets whether the register is a VEC-B register (8-bit).
- inline constexpr bool isVecB() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecB>::kSignature; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecB() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecB>::kSignature; }
//! Gets whether the register is a VEC-H register (16-bit).
- inline constexpr bool isVecH() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecH>::kSignature; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecH() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecH>::kSignature; }
//! Gets whether the register is a VEC-S register (32-bit).
- inline constexpr bool isVecS() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecS>::kSignature; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecS() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecS>::kSignature; }
//! Gets whether the register is a VEC-D register (64-bit).
- inline constexpr bool isVecD() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecD>::kSignature; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecD() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecD>::kSignature; }
//! Gets whether the register is a VEC-Q register (128-bit).
- inline constexpr bool isVecQ() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecV>::kSignature; }
-
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecQ() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecV>::kSignature; }
//! Gets whether the register is either VEC-D (64-bit) or VEC-Q (128-bit).
- inline constexpr bool isVecDOrQ() const noexcept { return uint32_t(type()) - uint32_t(RegType::kARM_VecD) <= 1u; }
-
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecDOrQ() const noexcept { return uint32_t(type()) - uint32_t(RegType::kARM_VecD) <= 1u; }
//! Gets whether the register is a VEC-V register (128-bit).
- inline constexpr bool isVecV() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecV>::kSignature; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isVecV() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecV>::kSignature; }
+
+ //! Gets whether the register is an 8-bit vector register or view, alias if \ref isVecB().
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec8() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecB>::kSignature; }
+ //! Gets whether the register is a 16-bit vector register or view, alias if \ref isVecH().
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec16() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecH>::kSignature; }
+ //! Gets whether the register is a 32-bit vector register or view, alias if \ref isVecS().
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec32() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecS>::kSignature; }
+ //! Gets whether the register is a 64-bit vector register or view, alias if \ref isVecD().
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec64() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecD>::kSignature; }
+ //! Gets whether the register is a 128-bit vector register or view, alias if \ref isVecQ().
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec128() const noexcept { return baseSignature() == RegTraits<RegType::kARM_VecV>::kSignature; }
template<RegType kRegType>
- inline void setRegT(uint32_t id) noexcept {
+ ASMJIT_INLINE_NODEBUG void setRegT(uint32_t id) noexcept {
setSignature(RegTraits<kRegType>::kSignature);
setId(id);
}
- inline void setTypeAndId(RegType type, uint32_t id) noexcept {
+ ASMJIT_INLINE_NODEBUG void setTypeAndId(RegType type, uint32_t id) noexcept {
setSignature(signatureOf(type));
setId(id);
}
- static inline RegGroup groupOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kAArch64).regTypeToGroup(type); }
- static inline TypeId typeIdOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kAArch64).regTypeToTypeId(type); }
- static inline OperandSignature signatureOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kAArch64).regTypeToSignature(type); }
+ static ASMJIT_INLINE_NODEBUG RegGroup groupOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kAArch64).regTypeToGroup(type); }
+ static ASMJIT_INLINE_NODEBUG TypeId typeIdOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kAArch64).regTypeToTypeId(type); }
+ static ASMJIT_INLINE_NODEBUG OperandSignature signatureOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kAArch64).regTypeToSignature(type); }
template<RegType kRegType>
- static inline RegGroup groupOfT() noexcept { return RegTraits<kRegType>::kGroup; }
+ static ASMJIT_INLINE_NODEBUG RegGroup groupOfT() noexcept { return RegTraits<kRegType>::kGroup; }
template<RegType kRegType>
- static inline TypeId typeIdOfT() noexcept { return RegTraits<kRegType>::kTypeId; }
+ static ASMJIT_INLINE_NODEBUG TypeId typeIdOfT() noexcept { return RegTraits<kRegType>::kTypeId; }
template<RegType kRegType>
- static inline OperandSignature signatureOfT() noexcept { return RegTraits<kRegType>::kSignature; }
-
- static inline bool isGpW(const Operand_& op) noexcept { return op.as<Reg>().isGpW(); }
- static inline bool isGpX(const Operand_& op) noexcept { return op.as<Reg>().isGpX(); }
- static inline bool isVecB(const Operand_& op) noexcept { return op.as<Reg>().isVecB(); }
- static inline bool isVecH(const Operand_& op) noexcept { return op.as<Reg>().isVecH(); }
- static inline bool isVecS(const Operand_& op) noexcept { return op.as<Reg>().isVecS(); }
- static inline bool isVecD(const Operand_& op) noexcept { return op.as<Reg>().isVecD(); }
- static inline bool isVecQ(const Operand_& op) noexcept { return op.as<Reg>().isVecQ(); }
- static inline bool isVecV(const Operand_& op) noexcept { return op.as<Reg>().isVecV(); }
-
- static inline bool isGpW(const Operand_& op, uint32_t id) noexcept { return isGpW(op) & (op.id() == id); }
- static inline bool isGpX(const Operand_& op, uint32_t id) noexcept { return isGpX(op) & (op.id() == id); }
- static inline bool isVecB(const Operand_& op, uint32_t id) noexcept { return isVecB(op) & (op.id() == id); }
- static inline bool isVecH(const Operand_& op, uint32_t id) noexcept { return isVecH(op) & (op.id() == id); }
- static inline bool isVecS(const Operand_& op, uint32_t id) noexcept { return isVecS(op) & (op.id() == id); }
- static inline bool isVecD(const Operand_& op, uint32_t id) noexcept { return isVecD(op) & (op.id() == id); }
- static inline bool isVecQ(const Operand_& op, uint32_t id) noexcept { return isVecQ(op) & (op.id() == id); }
- static inline bool isVecV(const Operand_& op, uint32_t id) noexcept { return isVecV(op) & (op.id() == id); }
-};
-
-//! General purpose register (ARM).
-class Gp : public Reg {
-public:
- ASMJIT_DEFINE_ABSTRACT_REG(Gp, Reg)
-
- //! Special register id.
- enum Id : uint32_t {
- //! Register that depends on OS, could be used as TLS offset.
- kIdOs = 18,
- //! Frame pointer.
- kIdFp = 29,
- //! Link register.
- kIdLr = 30,
- //! Stack register id.
- kIdSp = 31,
- //! Zero register id.
- //!
- //! Although zero register has the same id as stack register it has a special treatment, because we need to be
- //! able to distinguish between these two at API level. Some intructions were designed to be used with SP and
- //! some other with ZR - so we need a way to distinguish these two to make sure we emit the right thing.
- //!
- //! The number 63 is not random, when you perform `id & 31` you would always get 31 for both SP and ZR inputs,
- //! which is the identifier used by AArch64 ISA to encode either SP or ZR depending on the instruction.
- kIdZr = 63
- };
-
- inline constexpr bool isZR() const noexcept { return id() == kIdZr; }
- inline constexpr bool isSP() const noexcept { return id() == kIdSp; }
-
- //! Cast this register to a 32-bit R|W.
- inline GpW w() const noexcept;
- //! Cast this register to a 64-bit X.
- inline GpX x() const noexcept;
+ static ASMJIT_INLINE_NODEBUG OperandSignature signatureOfT() noexcept { return OperandSignature{RegTraits<kRegType>::kSignature}; }
+
+ static ASMJIT_INLINE_NODEBUG bool isGpW(const Operand_& op) noexcept { return op.as<Reg>().isGpW(); }
+ static ASMJIT_INLINE_NODEBUG bool isGpX(const Operand_& op) noexcept { return op.as<Reg>().isGpX(); }
+ static ASMJIT_INLINE_NODEBUG bool isVecB(const Operand_& op) noexcept { return op.as<Reg>().isVecB(); }
+ static ASMJIT_INLINE_NODEBUG bool isVecH(const Operand_& op) noexcept { return op.as<Reg>().isVecH(); }
+ static ASMJIT_INLINE_NODEBUG bool isVecS(const Operand_& op) noexcept { return op.as<Reg>().isVecS(); }
+ static ASMJIT_INLINE_NODEBUG bool isVecD(const Operand_& op) noexcept { return op.as<Reg>().isVecD(); }
+ static ASMJIT_INLINE_NODEBUG bool isVecQ(const Operand_& op) noexcept { return op.as<Reg>().isVecQ(); }
+ static ASMJIT_INLINE_NODEBUG bool isVecV(const Operand_& op) noexcept { return op.as<Reg>().isVecV(); }
+
+ static ASMJIT_INLINE_NODEBUG bool isGpW(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isGpW(op)) & unsigned(op.id() == id)); }
+ static ASMJIT_INLINE_NODEBUG bool isGpX(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isGpX(op)) & unsigned(op.id() == id)); }
+ static ASMJIT_INLINE_NODEBUG bool isVecB(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isVecB(op)) & unsigned(op.id() == id)); }
+ static ASMJIT_INLINE_NODEBUG bool isVecH(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isVecH(op)) & unsigned(op.id() == id)); }
+ static ASMJIT_INLINE_NODEBUG bool isVecS(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isVecS(op)) & unsigned(op.id() == id)); }
+ static ASMJIT_INLINE_NODEBUG bool isVecD(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isVecD(op)) & unsigned(op.id() == id)); }
+ static ASMJIT_INLINE_NODEBUG bool isVecQ(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isVecQ(op)) & unsigned(op.id() == id)); }
+ static ASMJIT_INLINE_NODEBUG bool isVecV(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isVecV(op)) & unsigned(op.id() == id)); }
};
-//! Vector register (ARM).
-class Vec : public Reg {
+//! Vector register base - a common base for both AArch32 & AArch64 vector register.
+class BaseVec : public Reg {
public:
- ASMJIT_DEFINE_ABSTRACT_REG(Vec, Reg)
+ ASMJIT_DEFINE_ABSTRACT_REG(BaseVec, Reg)
- //! Additional signature bits used by arm::Vec.
+ //! Additional signature bits used by a vector register.
enum AdditionalBits : uint32_t {
// Register element type (3 bits).
// |........|........|.XXX....|........|
@@ -178,202 +145,21 @@ public:
kSignatureRegElementIndexMask = 0x0F << kSignatureRegElementIndexShift
};
- //! Element type.
- enum ElementType : uint32_t {
- //! No element type specified.
- kElementTypeNone = 0,
- //! Byte elements (B8 or B16).
- kElementTypeB,
- //! Halfword elements (H4 or H8).
- kElementTypeH,
- //! Singleword elements (S2 or S4).
- kElementTypeS,
- //! Doubleword elements (D2).
- kElementTypeD,
- //! Byte elements grouped by 4 bytes (B4).
- //!
- //! \note This element-type is only used by few instructions.
- kElementTypeB4,
- //! Halfword elements grouped by 2 halfwords (H2).
- //!
- //! \note This element-type is only used by few instructions.
- kElementTypeH2,
-
- //! Count of element types.
- kElementTypeCount
- };
-
- //! \cond
- //! Shortcuts.
- enum SignatureReg : uint32_t {
- kSignatureElementB = kElementTypeB << kSignatureRegElementTypeShift,
- kSignatureElementH = kElementTypeH << kSignatureRegElementTypeShift,
- kSignatureElementS = kElementTypeS << kSignatureRegElementTypeShift,
- kSignatureElementD = kElementTypeD << kSignatureRegElementTypeShift,
- kSignatureElementB4 = kElementTypeB4 << kSignatureRegElementTypeShift,
- kSignatureElementH2 = kElementTypeH2 << kSignatureRegElementTypeShift
- };
- //! \endcond
-
- //! Returns whether the register has associated an element type.
- inline constexpr bool hasElementType() const noexcept { return _signature.hasField<kSignatureRegElementTypeMask>(); }
//! Returns whether the register has element index (it's an element index access).
- inline constexpr bool hasElementIndex() const noexcept { return _signature.hasField<kSignatureRegElementFlagMask>(); }
- //! Returns whether the reggister has element type or element index (or both).
- inline constexpr bool hasElementTypeOrIndex() const noexcept { return _signature.hasField<kSignatureRegElementTypeMask | kSignatureRegElementFlagMask>(); }
-
- //! Returns element type of the register.
- inline constexpr uint32_t elementType() const noexcept { return _signature.getField<kSignatureRegElementTypeMask>(); }
- //! Sets element type of the register to `elementType`.
- inline void setElementType(uint32_t elementType) noexcept { _signature.setField<kSignatureRegElementTypeMask>(elementType); }
- //! Resets element type to none.
- inline void resetElementType() noexcept { _signature.setField<kSignatureRegElementTypeMask>(0); }
-
+ ASMJIT_INLINE_NODEBUG constexpr bool hasElementIndex() const noexcept { return _signature.hasField<kSignatureRegElementFlagMask>(); }
//! Returns element index of the register.
- inline constexpr uint32_t elementIndex() const noexcept { return _signature.getField<kSignatureRegElementIndexMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t elementIndex() const noexcept { return _signature.getField<kSignatureRegElementIndexMask>(); }
//! Sets element index of the register to `elementType`.
- inline void setElementIndex(uint32_t elementIndex) noexcept {
+ ASMJIT_INLINE_NODEBUG void setElementIndex(uint32_t elementIndex) noexcept {
_signature |= kSignatureRegElementFlagMask;
_signature.setField<kSignatureRegElementIndexMask>(elementIndex);
}
//! Resets element index of the register.
- inline void resetElementIndex() noexcept {
+ ASMJIT_INLINE_NODEBUG void resetElementIndex() noexcept {
_signature &= ~(kSignatureRegElementFlagMask | kSignatureRegElementIndexMask);
}
-
- inline constexpr bool isVecB8() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementB); }
- inline constexpr bool isVecH4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementH); }
- inline constexpr bool isVecS2() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature | kSignatureElementS); }
- inline constexpr bool isVecD1() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecD>::kSignature); }
-
- inline constexpr bool isVecB16() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementB); }
- inline constexpr bool isVecH8() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementH); }
- inline constexpr bool isVecS4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementS); }
- inline constexpr bool isVecD2() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementD); }
- inline constexpr bool isVecB4x4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementB4); }
- inline constexpr bool isVecH2x4() const noexcept { return _signature.subset(kBaseSignatureMask | kSignatureRegElementTypeMask) == (RegTraits<RegType::kARM_VecV>::kSignature | kSignatureElementH2); }
-
- //! Creates a cloned register with element access.
- inline Vec at(uint32_t elementIndex) const noexcept {
- return Vec((signature() & ~kSignatureRegElementIndexMask) | (elementIndex << kSignatureRegElementIndexShift) | kSignatureRegElementFlagMask, id());
- }
-
- //! Cast this register to an 8-bit B register (scalar).
- inline VecB b() const noexcept;
- //! Cast this register to a 16-bit H register (scalar).
- inline VecH h() const noexcept;
- //! Cast this register to a 32-bit S register (scalar).
- inline VecS s() const noexcept;
- //! Cast this register to a 64-bit D register (scalar).
- inline VecD d() const noexcept;
- //! Cast this register to a 128-bit Q register (scalar).
- inline VecV q() const noexcept;
- //! Cast this register to a 128-bit V register.
- inline VecV v() const noexcept;
-
- //! Cast this register to a 128-bit V.B[elementIndex] register.
- inline VecV b(uint32_t elementIndex) const noexcept;
- //! Cast this register to a 128-bit V.H[elementIndex] register.
- inline VecV h(uint32_t elementIndex) const noexcept;
- //! Cast this register to a 128-bit V.S[elementIndex] register.
- inline VecV s(uint32_t elementIndex) const noexcept;
- //! Cast this register to a 128-bit V.D[elementIndex] register.
- inline VecV d(uint32_t elementIndex) const noexcept;
- //! Cast this register to a 128-bit V.H2[elementIndex] register.
- inline VecV h2(uint32_t elementIndex) const noexcept;
- //! Cast this register to a 128-bit V.B4[elementIndex] register.
- inline VecV b4(uint32_t elementIndex) const noexcept;
-
- //! Cast this register to V.8B.
- inline VecD b8() const noexcept;
- //! Cast this register to V.16B.
- inline VecV b16() const noexcept;
- //! Cast this register to V.2H.
- inline VecS h2() const noexcept;
- //! Cast this register to V.4H.
- inline VecD h4() const noexcept;
- //! Cast this register to V.8H.
- inline VecV h8() const noexcept;
- //! Cast this register to V.2S.
- inline VecD s2() const noexcept;
- //! Cast this register to V.4S.
- inline VecV s4() const noexcept;
- //! Cast this register to V.2D.
- inline VecV d2() const noexcept;
-
- static inline constexpr OperandSignature _makeElementAccessSignature(uint32_t elementType, uint32_t elementIndex) noexcept {
- return OperandSignature{
- uint32_t(RegTraits<RegType::kARM_VecV>::kSignature) |
- uint32_t(kSignatureRegElementFlagMask) |
- uint32_t(elementType << kSignatureRegElementTypeShift) |
- uint32_t(elementIndex << kSignatureRegElementIndexShift)};
- }
};
-//! 32-bit GPW (AArch64) and/or GPR (ARM/AArch32) register.
-class GpW : public Gp { ASMJIT_DEFINE_FINAL_REG(GpW, Gp, RegTraits<RegType::kARM_GpW>) };
-//! 64-bit GPX (AArch64) register.
-class GpX : public Gp { ASMJIT_DEFINE_FINAL_REG(GpX, Gp, RegTraits<RegType::kARM_GpX>) };
-
-//! 8-bit view (S) of VFP/SIMD register.
-class VecB : public Vec { ASMJIT_DEFINE_FINAL_REG(VecB, Vec, RegTraits<RegType::kARM_VecB>) };
-//! 16-bit view (S) of VFP/SIMD register.
-class VecH : public Vec { ASMJIT_DEFINE_FINAL_REG(VecH, Vec, RegTraits<RegType::kARM_VecH>) };
-//! 32-bit view (S) of VFP/SIMD register.
-class VecS : public Vec { ASMJIT_DEFINE_FINAL_REG(VecS, Vec, RegTraits<RegType::kARM_VecS>) };
-//! 64-bit view (D) of VFP/SIMD register.
-class VecD : public Vec { ASMJIT_DEFINE_FINAL_REG(VecD, Vec, RegTraits<RegType::kARM_VecD>) };
-//! 128-bit vector register (Q or V).
-class VecV : public Vec { ASMJIT_DEFINE_FINAL_REG(VecV, Vec, RegTraits<RegType::kARM_VecV>) };
-
-inline GpW Gp::w() const noexcept { return GpW(id()); }
-inline GpX Gp::x() const noexcept { return GpX(id()); }
-
-inline VecB Vec::b() const noexcept { return VecB(id()); }
-inline VecH Vec::h() const noexcept { return VecH(id()); }
-inline VecS Vec::s() const noexcept { return VecS(id()); }
-inline VecD Vec::d() const noexcept { return VecD(id()); }
-inline VecV Vec::q() const noexcept { return VecV(id()); }
-inline VecV Vec::v() const noexcept { return VecV(id()); }
-
-inline VecV Vec::b(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(kElementTypeB, elementIndex), id()); }
-inline VecV Vec::h(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(kElementTypeH, elementIndex), id()); }
-inline VecV Vec::s(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(kElementTypeS, elementIndex), id()); }
-inline VecV Vec::d(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(kElementTypeD, elementIndex), id()); }
-inline VecV Vec::h2(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(kElementTypeH2, elementIndex), id()); }
-inline VecV Vec::b4(uint32_t elementIndex) const noexcept { return VecV(_makeElementAccessSignature(kElementTypeB4, elementIndex), id()); }
-
-inline VecD Vec::b8() const noexcept { return VecD(OperandSignature{VecD::kSignature | kSignatureElementB}, id()); }
-inline VecS Vec::h2() const noexcept { return VecS(OperandSignature{VecS::kSignature | kSignatureElementH}, id()); }
-inline VecD Vec::h4() const noexcept { return VecD(OperandSignature{VecD::kSignature | kSignatureElementH}, id()); }
-inline VecD Vec::s2() const noexcept { return VecD(OperandSignature{VecD::kSignature | kSignatureElementS}, id()); }
-inline VecV Vec::b16() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementB}, id()); }
-inline VecV Vec::h8() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementH}, id()); }
-inline VecV Vec::s4() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementS}, id()); }
-inline VecV Vec::d2() const noexcept { return VecV(OperandSignature{VecV::kSignature | kSignatureElementD}, id()); }
-
-#ifndef _DOXYGEN
-namespace regs {
-#endif
-
-//! Creates a 32-bit W register operand (ARM/AArch64).
-static inline constexpr GpW w(uint32_t id) noexcept { return GpW(id); }
-//! Creates a 64-bit X register operand (AArch64).
-static inline constexpr GpX x(uint32_t id) noexcept { return GpX(id); }
-//! Creates a 32-bit S register operand (ARM/AArch64).
-static inline constexpr VecS s(uint32_t id) noexcept { return VecS(id); }
-//! Creates a 64-bit D register operand (ARM/AArch64).
-static inline constexpr VecD d(uint32_t id) noexcept { return VecD(id); }
-//! Creates a 1282-bit V register operand (ARM/AArch64).
-static inline constexpr VecV v(uint32_t id) noexcept { return VecV(id); }
-
-#ifndef _DOXYGEN
-} // {regs}
-
-// Make `arm::regs` accessible through `arm` namespace as well.
-using namespace regs;
-#endif
-
//! Memory operand (ARM).
class Mem : public BaseMem {
public:
@@ -385,64 +171,59 @@ public:
kSignatureMemShiftValueShift = 14,
kSignatureMemShiftValueMask = 0x1Fu << kSignatureMemShiftValueShift,
- // Shift operation type (4 bits).
+ // Index shift operation (4 bits).
// |........|XXXX....|........|........|
- kSignatureMemPredicateShift = 20,
- kSignatureMemPredicateMask = 0x0Fu << kSignatureMemPredicateShift
- };
- //! \endcond
+ kSignatureMemShiftOpShift = 20,
+ kSignatureMemShiftOpMask = 0x0Fu << kSignatureMemShiftOpShift,
- //! Memory offset mode.
- //!
- //! Additional constants that can be used with the `predicate`.
- enum OffsetMode : uint32_t {
- //! Pre-index "[BASE, #Offset {, <shift>}]!" with write-back.
- kOffsetPreIndex = 0xE,
- //! Post-index "[BASE], #Offset {, <shift>}" with write-back.
- kOffsetPostIndex = 0xF
+ // Offset mode type (2 bits).
+ // |......XX|........|........|........|
+ kSignatureMemOffsetModeShift = 24,
+ kSignatureMemOffsetModeMask = 0x03u << kSignatureMemOffsetModeShift
};
+ //! \endcond
//! \name Construction & Destruction
//! \{
//! Construct a default `Mem` operand, that points to [0].
- inline constexpr Mem() noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem() noexcept
: BaseMem() {}
- inline constexpr Mem(const Mem& other) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const Mem& other) noexcept
: BaseMem(other) {}
- inline explicit Mem(Globals::NoInit_) noexcept
+ ASMJIT_INLINE_NODEBUG explicit Mem(Globals::NoInit_) noexcept
: BaseMem(Globals::NoInit) {}
- inline constexpr Mem(const Signature& signature, uint32_t baseId, uint32_t indexId, int32_t offset) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const Signature& signature, uint32_t baseId, uint32_t indexId, int32_t offset) noexcept
: BaseMem(signature, baseId, indexId, offset) {}
- inline constexpr explicit Mem(const Label& base, int32_t off = 0, Signature signature = Signature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr explicit Mem(const Label& base, int32_t off = 0, Signature signature = Signature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromMemBaseType(RegType::kLabelTag) |
signature, base.id(), 0, off) {}
- inline constexpr explicit Mem(const BaseReg& base, int32_t off = 0, Signature signature = Signature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr explicit Mem(const BaseReg& base, int32_t off = 0, Signature signature = Signature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromMemBaseType(base.type()) |
signature, base.id(), 0, off) {}
- inline constexpr Mem(const BaseReg& base, const BaseReg& index, Signature signature = Signature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const BaseReg& base, const BaseReg& index, Signature signature = Signature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromMemBaseType(base.type()) |
Signature::fromMemIndexType(index.type()) |
signature, base.id(), index.id(), 0) {}
- inline constexpr Mem(const BaseReg& base, const BaseReg& index, const Shift& shift, Signature signature = Signature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const BaseReg& base, const BaseReg& index, const Shift& shift, Signature signature = Signature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromMemBaseType(base.type()) |
Signature::fromMemIndexType(index.type()) |
- Signature::fromValue<kSignatureMemPredicateMask>(uint32_t(shift.op())) |
+ Signature::fromValue<kSignatureMemShiftOpMask>(uint32_t(shift.op())) |
Signature::fromValue<kSignatureMemShiftValueMask>(shift.value()) |
signature, base.id(), index.id(), 0) {}
- inline constexpr Mem(uint64_t base, Signature signature = Signature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr explicit Mem(uint64_t base, Signature signature = Signature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
signature, uint32_t(base >> 32), 0, int32_t(uint32_t(base & 0xFFFFFFFFu))) {}
@@ -451,7 +232,7 @@ public:
//! \name Overloaded Operators
//! \{
- inline Mem& operator=(const Mem& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG Mem& operator=(const Mem& other) noexcept = default;
//! \}
@@ -459,41 +240,41 @@ public:
//! \{
//! Clones the memory operand.
- inline constexpr Mem clone() const noexcept { return Mem(*this); }
+ ASMJIT_INLINE_NODEBUG constexpr Mem clone() const noexcept { return Mem(*this); }
//! Gets new memory operand adjusted by `off`.
- inline Mem cloneAdjusted(int64_t off) const noexcept {
+ ASMJIT_INLINE_NODEBUG Mem cloneAdjusted(int64_t off) const noexcept {
Mem result(*this);
result.addOffset(off);
return result;
}
//! Clones the memory operand and makes it pre-index.
- inline Mem pre() const noexcept {
+ ASMJIT_INLINE_NODEBUG Mem pre() const noexcept {
Mem result(*this);
- result.setPredicate(kOffsetPreIndex);
+ result.setOffsetMode(OffsetMode::kPreIndex);
return result;
}
//! Clones the memory operand, applies a given offset `off` and makes it pre-index.
- inline Mem pre(int64_t off) const noexcept {
+ ASMJIT_INLINE_NODEBUG Mem pre(int64_t off) const noexcept {
Mem result(*this);
- result.setPredicate(kOffsetPreIndex);
+ result.setOffsetMode(OffsetMode::kPreIndex);
result.addOffset(off);
return result;
}
//! Clones the memory operand and makes it post-index.
- inline Mem post() const noexcept {
+ ASMJIT_INLINE_NODEBUG Mem post() const noexcept {
Mem result(*this);
- result.setPredicate(kOffsetPreIndex);
+ result.setOffsetMode(OffsetMode::kPostIndex);
return result;
}
//! Clones the memory operand, applies a given offset `off` and makes it post-index.
- inline Mem post(int64_t off) const noexcept {
+ ASMJIT_INLINE_NODEBUG Mem post(int64_t off) const noexcept {
Mem result(*this);
- result.setPredicate(kOffsetPostIndex);
+ result.setOffsetMode(OffsetMode::kPostIndex);
result.addOffset(off);
return result;
}
@@ -506,16 +287,21 @@ public:
//! Converts memory `baseType` and `baseId` to `arm::Reg` instance.
//!
//! The memory must have a valid base register otherwise the result will be wrong.
- inline Reg baseReg() const noexcept { return Reg::fromTypeAndId(baseType(), baseId()); }
+ ASMJIT_INLINE_NODEBUG Reg baseReg() const noexcept { return Reg::fromTypeAndId(baseType(), baseId()); }
//! Converts memory `indexType` and `indexId` to `arm::Reg` instance.
//!
//! The memory must have a valid index register otherwise the result will be wrong.
- inline Reg indexReg() const noexcept { return Reg::fromTypeAndId(indexType(), indexId()); }
+ ASMJIT_INLINE_NODEBUG Reg indexReg() const noexcept { return Reg::fromTypeAndId(indexType(), indexId()); }
using BaseMem::setIndex;
- inline void setIndex(const BaseReg& index, uint32_t shift) noexcept {
+ ASMJIT_INLINE_NODEBUG void setIndex(const BaseReg& index, uint32_t shift) noexcept {
+ setIndex(index);
+ setShift(shift);
+ }
+
+ ASMJIT_INLINE_NODEBUG void setIndex(const BaseReg& index, Shift shift) noexcept {
setIndex(index);
setShift(shift);
}
@@ -525,97 +311,86 @@ public:
//! \name ARM Specific Features
//! \{
+ //! Gets offset mode.
+ ASMJIT_INLINE_NODEBUG constexpr OffsetMode offsetMode() const noexcept { return OffsetMode(_signature.getField<kSignatureMemOffsetModeMask>()); }
+ //! Sets offset mode to `mode`.
+ ASMJIT_INLINE_NODEBUG void setOffsetMode(OffsetMode mode) noexcept { _signature.setField<kSignatureMemOffsetModeMask>(uint32_t(mode)); }
+ //! Resets offset mode to default (fixed offset, without write-back).
+ ASMJIT_INLINE_NODEBUG void resetOffsetMode() noexcept { _signature.setField<kSignatureMemOffsetModeMask>(uint32_t(OffsetMode::kFixed)); }
+
+ //! Tests whether the current memory offset mode is fixed (see \ref OffsetMode::kFixed).
+ ASMJIT_INLINE_NODEBUG constexpr bool isFixedOffset() const noexcept { return offsetMode() == OffsetMode::kFixed; }
+ //! Tests whether the current memory offset mode is either pre-index or post-index (write-back is used).
+ ASMJIT_INLINE_NODEBUG constexpr bool isPreOrPost() const noexcept { return offsetMode() != OffsetMode::kFixed; }
+ //! Tests whether the current memory offset mode is pre-index (write-back is used).
+ ASMJIT_INLINE_NODEBUG constexpr bool isPreIndex() const noexcept { return offsetMode() == OffsetMode::kPreIndex; }
+ //! Tests whether the current memory offset mode is post-index (write-back is used).
+ ASMJIT_INLINE_NODEBUG constexpr bool isPostIndex() const noexcept { return offsetMode() == OffsetMode::kPostIndex; }
+
+ //! Sets offset mode of this memory operand to pre-index (write-back is used).
+ ASMJIT_INLINE_NODEBUG void makePreIndex() noexcept { setOffsetMode(OffsetMode::kPreIndex); }
+ //! Sets offset mode of this memory operand to post-index (write-back is used).
+ ASMJIT_INLINE_NODEBUG void makePostIndex() noexcept { setOffsetMode(OffsetMode::kPostIndex); }
+
+ //! Gets shift operation that is used by index register.
+ ASMJIT_INLINE_NODEBUG constexpr ShiftOp shiftOp() const noexcept { return ShiftOp(_signature.getField<kSignatureMemShiftOpMask>()); }
+ //! Sets shift operation that is used by index register.
+ ASMJIT_INLINE_NODEBUG void setShiftOp(ShiftOp sop) noexcept { _signature.setField<kSignatureMemShiftOpMask>(uint32_t(sop)); }
+ //! Resets shift operation that is used by index register to LSL (default value).
+ ASMJIT_INLINE_NODEBUG void resetShiftOp() noexcept { _signature.setField<kSignatureMemShiftOpMask>(uint32_t(ShiftOp::kLSL)); }
+
//! Gets whether the memory operand has shift (aka scale) constant.
- inline constexpr bool hasShift() const noexcept { return _signature.hasField<kSignatureMemShiftValueMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr bool hasShift() const noexcept { return _signature.hasField<kSignatureMemShiftValueMask>(); }
//! Gets the memory operand's shift (aka scale) constant.
- inline constexpr uint32_t shift() const noexcept { return _signature.getField<kSignatureMemShiftValueMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t shift() const noexcept { return _signature.getField<kSignatureMemShiftValueMask>(); }
//! Sets the memory operand's shift (aka scale) constant.
- inline void setShift(uint32_t shift) noexcept { _signature.setField<kSignatureMemShiftValueMask>(shift); }
- //! Resets the memory operand's shift (aka scale) constant to zero.
- inline void resetShift() noexcept { _signature.setField<kSignatureMemShiftValueMask>(0); }
-
- //! Gets memory predicate (shift mode or offset mode), see \ref ShiftOp and \ref OffsetMode.
- inline constexpr uint32_t predicate() const noexcept { return _signature.getField<kSignatureMemPredicateMask>(); }
- //! Sets memory predicate to `predicate`, see `Mem::ShiftOp`.
- inline void setPredicate(uint32_t predicate) noexcept { _signature.setField<kSignatureMemPredicateMask>(predicate); }
- //! Resets shift mode to LSL (default).
- inline void resetPredicate() noexcept { _signature.setField<kSignatureMemPredicateMask>(0); }
+ ASMJIT_INLINE_NODEBUG void setShift(uint32_t shift) noexcept { _signature.setField<kSignatureMemShiftValueMask>(shift); }
- inline constexpr bool isFixedOffset() const noexcept { return predicate() < kOffsetPreIndex; }
- inline constexpr bool isPreOrPost() const noexcept { return predicate() >= kOffsetPreIndex; }
- inline constexpr bool isPreIndex() const noexcept { return predicate() == kOffsetPreIndex; }
- inline constexpr bool isPostIndex() const noexcept { return predicate() == kOffsetPostIndex; }
+ //! Sets the memory operand's shift and shift operation.
+ ASMJIT_INLINE_NODEBUG void setShift(Shift shift) noexcept {
+ _signature.setField<kSignatureMemShiftOpMask>(uint32_t(shift.op()));
+ _signature.setField<kSignatureMemShiftValueMask>(shift.value());
+ }
- inline void resetToFixedOffset() noexcept { resetPredicate(); }
- inline void makePreIndex() noexcept { setPredicate(kOffsetPreIndex); }
- inline void makePostIndex() noexcept { setPredicate(kOffsetPostIndex); }
+ //! Resets the memory operand's shift (aka scale) constant to zero.
+ ASMJIT_INLINE_NODEBUG void resetShift() noexcept { _signature.setField<kSignatureMemShiftValueMask>(0); }
//! \}
};
-//! Creates `[base.reg, offset]` memory operand (offset mode).
-static inline constexpr Mem ptr(const Gp& base, int32_t offset = 0) noexcept {
- return Mem(base, offset);
-}
-
-//! Creates `[base.reg, offset]!` memory operand (pre-index mode).
-static inline constexpr Mem ptr_pre(const Gp& base, int32_t offset = 0) noexcept {
- return Mem(base, offset, OperandSignature::fromValue<Mem::kSignatureMemPredicateMask>(Mem::kOffsetPreIndex));
-}
-
-//! Creates `[base.reg], offset` memory operand (post-index mode).
-static inline constexpr Mem ptr_post(const Gp& base, int32_t offset = 0) noexcept {
- return Mem(base, offset, OperandSignature::fromValue<Mem::kSignatureMemPredicateMask>(Mem::kOffsetPostIndex));
-}
-
-//! Creates `[base.reg, index]` memory operand.
-static inline constexpr Mem ptr(const Gp& base, const Gp& index) noexcept {
- return Mem(base, index);
-}
-
-//! Creates `[base.reg], index` memory operand (post-index mode).
-static inline constexpr Mem ptr_post(const Gp& base, const Gp& index) noexcept {
- return Mem(base, index, OperandSignature::fromValue<Mem::kSignatureMemPredicateMask>(Mem::kOffsetPostIndex));
-}
-
-//! Creates `[base.reg, index, SHIFT_OP #shift]` memory operand.
-static inline constexpr Mem ptr(const Gp& base, const Gp& index, const Shift& shift) noexcept {
- return Mem(base, index, shift);
-}
-
-//! Creates `[base + offset]` memory operand.
-static inline constexpr Mem ptr(const Label& base, int32_t offset = 0) noexcept {
- return Mem(base, offset);
-}
-
-// TODO: [ARM] PC + offset address.
-#if 0
-//! Creates `[PC + offset]` (relative) memory operand.
-static inline constexpr Mem ptr(const PC& pc, int32_t offset = 0) noexcept {
- return Mem(pc, offset);
-}
-#endif
-
-//! Creates `[base]` absolute memory operand.
+//! \name Shift Operation Construction
+//! \{
+
+//! Constructs a `LSL #value` shift (logical shift left).
+static ASMJIT_INLINE_NODEBUG constexpr Shift lsl(uint32_t value) noexcept { return Shift(ShiftOp::kLSL, value); }
+//! Constructs a `LSR #value` shift (logical shift right).
+static ASMJIT_INLINE_NODEBUG constexpr Shift lsr(uint32_t value) noexcept { return Shift(ShiftOp::kLSR, value); }
+//! Constructs a `ASR #value` shift (arithmetic shift right).
+static ASMJIT_INLINE_NODEBUG constexpr Shift asr(uint32_t value) noexcept { return Shift(ShiftOp::kASR, value); }
+//! Constructs a `ROR #value` shift (rotate right).
+static ASMJIT_INLINE_NODEBUG constexpr Shift ror(uint32_t value) noexcept { return Shift(ShiftOp::kROR, value); }
+//! Constructs a `RRX` shift (rotate with carry by 1).
+static ASMJIT_INLINE_NODEBUG constexpr Shift rrx() noexcept { return Shift(ShiftOp::kRRX, 0); }
+//! Constructs a `MSL #value` shift (logical shift left filling ones).
+static ASMJIT_INLINE_NODEBUG constexpr Shift msl(uint32_t value) noexcept { return Shift(ShiftOp::kMSL, value); }
+
+//! \}
+
+//! \name Memory Operand Construction
+//! \{
+
+//! Creates `[base]` absolute memory operand (AArch32 or AArch64).
//!
//! \note The concept of absolute memory operands doesn't exist on ARM, the ISA only provides PC relative addressing.
//! Absolute memory operands can only be used if it's known that the PC relative offset is encodable and that it
-//! would be within the limits. Absolute address is also often output from disassemblers, so AsmJit support it so it
-//! can assemble it back.
-static inline constexpr Mem ptr(uint64_t base) noexcept { return Mem(base); }
+//! would be within the limits. Absolute address is also often output from disassemblers, so AsmJit supports it to
+//! make it possible to assemble such output back.
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(uint64_t base) noexcept { return Mem(base); }
//! \}
-ASMJIT_END_SUB_NAMESPACE
+//! \}
-//! \cond INTERNAL
-ASMJIT_BEGIN_NAMESPACE
-ASMJIT_DEFINE_TYPE_ID(arm::GpW, TypeId::kInt32);
-ASMJIT_DEFINE_TYPE_ID(arm::GpX, TypeId::kInt64);
-ASMJIT_DEFINE_TYPE_ID(arm::VecS, TypeId::kFloat32x1);
-ASMJIT_DEFINE_TYPE_ID(arm::VecD, TypeId::kFloat64x1);
-ASMJIT_DEFINE_TYPE_ID(arm::VecV, TypeId::kInt32x4);
-ASMJIT_END_NAMESPACE
-//! \endcond
+ASMJIT_END_SUB_NAMESPACE
#endif // ASMJIT_ARM_ARMOPERAND_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/arm/a64utils.h b/3rdparty/asmjit/src/asmjit/arm/armutils.h
index 4a88ca51724..8241eda052e 100644
--- a/3rdparty/asmjit/src/asmjit/arm/a64utils.h
+++ b/3rdparty/asmjit/src/asmjit/arm/armutils.h
@@ -3,20 +3,53 @@
// See asmjit.h or LICENSE.md for license and copyright information
// SPDX-License-Identifier: Zlib
-#ifndef ASMJIT_ARM_A64UTILS_H_INCLUDED
-#define ASMJIT_ARM_A64UTILS_H_INCLUDED
+#ifndef ASMJIT_ARM_ARMUTILS_H_INCLUDED
+#define ASMJIT_ARM_ARMUTILS_H_INCLUDED
-#include "../arm/a64globals.h"
+#include "../core/support.h"
+#include "../arm/armglobals.h"
-ASMJIT_BEGIN_SUB_NAMESPACE(a64)
+ASMJIT_BEGIN_SUB_NAMESPACE(arm)
-//! \addtogroup asmjit_a64
+//! \addtogroup asmjit_arm
//! \{
-//! Public utilities and helpers for targeting AArch64 architecture.
+//! Public utilities and helpers for targeting AArch32 and AArch64 architectures.
namespace Utils {
-//! Decomposed fields of a logical immediate value (AArch64).
+//! Encodes a 12-bit immediate part of opcode that ise used by a standard 32-bit ARM encoding.
+ASMJIT_MAYBE_UNUSED
+static inline bool encodeAArch32Imm(uint64_t imm, uint32_t* encodedImmOut) noexcept {
+ if (imm & 0xFFFFFFFF00000000u)
+ return false;
+
+ uint32_t v = uint32_t(imm);
+ uint32_t r = 0;
+
+ if (v <= 0xFFu) {
+ *encodedImmOut = v;
+ return true;
+ }
+
+ // Rotate if there are bits on both ends (LSB and MSB)
+ // (otherwise we would not be able to calculate the rotation with ctz).
+ if (v & 0xFF0000FFu) {
+ v = Support::ror(v, 16);
+ r = 16u;
+ }
+
+ uint32_t n = Support::ctz(v) & ~0x1u;
+ r = (r - n) & 0x1Eu;
+ v = Support::ror(v, n);
+
+ if (v > 0xFFu)
+ return false;
+
+ *encodedImmOut = v | (r << 7);
+ return true;
+}
+
+//! Decomposed fields of a logical immediate value.
struct LogicalImm {
uint32_t n;
uint32_t s;
@@ -41,7 +74,7 @@ struct LogicalImm {
//! +---+--------+--------+------+
//! ```
ASMJIT_MAYBE_UNUSED
-static bool encodeLogicalImm(uint64_t imm, uint32_t width, a64::Utils::LogicalImm* out) noexcept {
+static bool encodeLogicalImm(uint64_t imm, uint32_t width, LogicalImm* out) noexcept {
// Determine the element width, which must be 2, 4, 8, 16, 32, or 64 bits.
do {
width /= 2;
@@ -89,24 +122,38 @@ static bool encodeLogicalImm(uint64_t imm, uint32_t width, a64::Utils::LogicalIm
//! width of the operation, and must be either 32 or 64. This function can be used to test whether an immediate
//! value can be used with AND, ANDS, BIC, BICS, EON, EOR, ORN, and ORR instruction.
ASMJIT_MAYBE_UNUSED
-static inline bool isLogicalImm(uint64_t imm, uint32_t width) noexcept {
+static ASMJIT_INLINE_NODEBUG bool isLogicalImm(uint64_t imm, uint32_t width) noexcept {
LogicalImm dummy;
return encodeLogicalImm(imm, width, &dummy);
}
+//! Returns true if the given `imm` value is encodable as an immediate with `add` and `sub` instructions on AArch64.
+//! These two instructions can encode 12-bit immediate value optionally shifted left by 12 bits.
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_INLINE_NODEBUG bool isAddSubImm(uint64_t imm) noexcept {
+ return imm <= 0xFFFu || (imm & ~uint64_t(0xFFFu << 12)) == 0;
+}
+
//! Returns true if the given `imm` value is a byte mask. Byte mask has each byte part of the value set to either
//! 0x00 or 0xFF. Some ARM instructions accept immediates that form a byte-mask and this function can be used to
//! verify that the immediate is encodable before using the value.
template<typename T>
-static inline bool isByteMaskImm8(const T& imm) noexcept {
+static ASMJIT_INLINE_NODEBUG bool isByteMaskImm8(const T& imm) noexcept {
constexpr T kMask = T(0x0101010101010101 & Support::allOnes<T>());
return imm == (imm & kMask) * T(255);
}
+// [.......A|B.......|.......C|D.......|.......E|F.......|.......G|H.......]
+static ASMJIT_INLINE_NODEBUG uint32_t encodeImm64ByteMaskToImm8(uint64_t imm) noexcept {
+ return uint32_t(((imm >> (7 - 0)) & 0b00000011) | // [.......G|H.......]
+ ((imm >> (23 - 2)) & 0b00001100) | // [.......E|F.......]
+ ((imm >> (39 - 4)) & 0b00110000) | // [.......C|D.......]
+ ((imm >> (55 - 6)) & 0b11000000)); // [.......A|B.......]
+}
//! \cond
//! A generic implementation that checjs whether a floating point value can be converted to ARM Imm8.
template<typename T, uint32_t kNumBBits, uint32_t kNumCDEFGHBits, uint32_t kNumZeroBits>
-static inline bool isFPImm8Generic(T val) noexcept {
+static ASMJIT_FORCE_INLINE bool isFPImm8Generic(T val) noexcept {
constexpr uint32_t kAllBsMask = Support::lsbMask<uint32_t>(kNumBBits);
constexpr uint32_t kB0Pattern = Support::bitMask(kNumBBits - 1);
constexpr uint32_t kB1Pattern = kAllBsMask ^ kB0Pattern;
@@ -127,7 +174,7 @@ static inline bool isFPImm8Generic(T val) noexcept {
//! ```
//! [aBbbcdef|gh000000]
//! ```
-static inline bool isFP16Imm8(uint32_t val) noexcept { return isFPImm8Generic<uint32_t, 3, 6, 6>(val); }
+static ASMJIT_INLINE_NODEBUG bool isFP16Imm8(uint32_t val) noexcept { return isFPImm8Generic<uint32_t, 3, 6, 6>(val); }
//! Returns true if the given single precision floating point `val` can be encoded as ARM IMM8 value, which represents
//! a limited set of floating point immediate values, which can be used with FMOV instruction.
@@ -137,9 +184,9 @@ static inline bool isFP16Imm8(uint32_t val) noexcept { return isFPImm8Generic<ui
//! ```
//! [aBbbbbbc|defgh000|00000000|00000000]
//! ```
-static inline bool isFP32Imm8(uint32_t val) noexcept { return isFPImm8Generic<uint32_t, 6, 6, 19>(val); }
+static ASMJIT_INLINE_NODEBUG bool isFP32Imm8(uint32_t val) noexcept { return isFPImm8Generic<uint32_t, 6, 6, 19>(val); }
//! \overload
-static inline bool isFP32Imm8(float val) noexcept { return isFP32Imm8(Support::bitCast<uint32_t>(val)); }
+static ASMJIT_INLINE_NODEBUG bool isFP32Imm8(float val) noexcept { return isFP32Imm8(Support::bitCast<uint32_t>(val)); }
//! Returns true if the given double precision floating point `val` can be encoded as ARM IMM8 value, which represents
//! a limited set of floating point immediate values, which can be used with FMOV instruction.
@@ -149,13 +196,13 @@ static inline bool isFP32Imm8(float val) noexcept { return isFP32Imm8(Support::b
//! ```
//! [aBbbbbbb|bbcdefgh|00000000|00000000|00000000|00000000|00000000|00000000]
//! ```
-static inline bool isFP64Imm8(uint64_t val) noexcept { return isFPImm8Generic<uint64_t, 9, 6, 48>(val); }
+static ASMJIT_INLINE_NODEBUG bool isFP64Imm8(uint64_t val) noexcept { return isFPImm8Generic<uint64_t, 9, 6, 48>(val); }
//! \overload
-static inline bool isFP64Imm8(double val) noexcept { return isFP64Imm8(Support::bitCast<uint64_t>(val)); }
+static ASMJIT_INLINE_NODEBUG bool isFP64Imm8(double val) noexcept { return isFP64Imm8(Support::bitCast<uint64_t>(val)); }
//! \cond
template<typename T, uint32_t kNumBBits, uint32_t kNumCDEFGHBits, uint32_t kNumZeroBits>
-static inline uint32_t encodeFPToImm8Generic(T val) noexcept {
+static ASMJIT_INLINE_NODEBUG uint32_t encodeFPToImm8Generic(T val) noexcept {
uint32_t bits = uint32_t(val >> kNumZeroBits);
return ((bits >> (kNumBBits + kNumCDEFGHBits - 7)) & 0x80u) | (bits & 0x7F);
}
@@ -165,9 +212,9 @@ static inline uint32_t encodeFPToImm8Generic(T val) noexcept {
//!
//! \note This function expects that `isFP64Imm8(val) == true` so it doesn't perform any checks of the value and just
//! rearranges some bits into Imm8 order.
-static inline uint32_t encodeFP64ToImm8(uint64_t val) noexcept { return encodeFPToImm8Generic<uint64_t, 9, 6, 48>(val); }
+static ASMJIT_INLINE_NODEBUG uint32_t encodeFP64ToImm8(uint64_t val) noexcept { return encodeFPToImm8Generic<uint64_t, 9, 6, 48>(val); }
//! \overload
-static inline uint32_t encodeFP64ToImm8(double val) noexcept { return encodeFP64ToImm8(Support::bitCast<uint64_t>(val)); }
+static ASMJIT_INLINE_NODEBUG uint32_t encodeFP64ToImm8(double val) noexcept { return encodeFP64ToImm8(Support::bitCast<uint64_t>(val)); }
} // {Utils}
@@ -175,5 +222,5 @@ static inline uint32_t encodeFP64ToImm8(double val) noexcept { return encodeFP64
ASMJIT_END_SUB_NAMESPACE
-#endif // ASMJIT_ARM_A64UTILS_H_INCLUDED
+#endif // ASMJIT_ARM_ARMUTILS_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/asmjit.h b/3rdparty/asmjit/src/asmjit/asmjit.h
index 1cd0651ffe1..f5184eb5777 100644
--- a/3rdparty/asmjit/src/asmjit/asmjit.h
+++ b/3rdparty/asmjit/src/asmjit/asmjit.h
@@ -3,7 +3,7 @@
// SPDX-License-Identifier: Zlib
// Official GitHub Repository: https://github.com/asmjit/asmjit
//
-// Copyright (c) 2008-2021 The AsmJit Authors
+// Copyright (c) 2008-2024 The AsmJit Authors
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
diff --git a/3rdparty/asmjit/src/asmjit/core.h b/3rdparty/asmjit/src/asmjit/core.h
index 4406ed89f30..cb19333ac38 100644
--- a/3rdparty/asmjit/src/asmjit/core.h
+++ b/3rdparty/asmjit/src/asmjit/core.h
@@ -105,40 +105,37 @@ namespace asmjit {
//!
//! - Tested:
//!
-//! - **Clang** - Tested by GitHub Actions - Clang 3.9+ (with C++11 enabled) is officially supported (older Clang
-//! versions having C++11 support are probably fine, but are not regularly tested).
+//! - **Clang** - Tested by GitHub Actions - Clang 10+ is officially supported and tested by CI, older Clang versions
+//! having C++11 should work, but are not tested anymore due to upgraded CI images.
//!
-//! - **GNU** - Tested by GitHub Actions - GCC 4.8+ (with C++11 enabled) is officially supported.
+//! - **GNU** - Tested by GitHub Actions - GCC 7+ is officially supported, older GCC versions from 4.8+ having C++11
+//! enabled should also work, but are not tested anymore due to upgraded CI images.
//!
-//! - **MINGW** - Should work, but it's not tested in our CI environment.
+//! - **MINGW** - Reported to work, but not tested in our CI environment (help welcome).
//!
-//! - **MSVC** - Tested by GitHub Actions - VS2017+ is officially supported, VS2015 is reported to work.
-//!
-//! - Untested:
-//!
-//! - **Intel** - No maintainers and no CI environment to regularly test this compiler.
-//!
-//! - **Other** C++ compilers would require basic support in
-//! [core/api-config.h](https://github.com/asmjit/asmjit/tree/master/src/asmjit/core/api-config.h).
+//! - **MSVC** - Tested by GitHub Actions - VS2019+ is officially supported, VS2015 and VS2017 is reported to work,
+//! but not tested by CI anymore.
//!
//! ### Supported Operating Systems and Platforms
//!
//! - Tested:
//!
-//! - **Linux** - Tested by GitHub Actions (any distribution is generally supported).
+//! - **BSD** - FreeBSD, NetBSD, and OpenBSD tested by GitHub Actions (only recent images are tested by CI). BSD
+//! runners only test BSD images with clang compiler.
//!
-//! - **Mac OS** - Tested by GitHub Actions (any version is supported).
+//! - **Linux** - Tested by GitHub Actions (only recent Ubuntu images are tested by CI, in general any distribution
+//! should be supported as AsmJit has no dependencies).
+//!
+//! - **Mac OS** - Tested by GitHub Actions.
//!
//! - **Windows** - Tested by GitHub Actions - (Windows 7+ is officially supported).
//!
//! - **Emscripten** - Works if compiled with \ref ASMJIT_NO_JIT. AsmJit cannot generate WASM code, but can be
-//! used to generate X86/X64 code within a browser, for example.
+//! used to generate X86/X64/AArch64 code within a browser, for example.
//!
//! - Untested:
//!
-//! - **BSDs** - No maintainers, no CI environment to regularly test BSDs, but they should work out of box.
-//!
-//! - **Haiku** - Not regularly tested, but reported to work.
+//! - **Haiku** - Reported to work, not tested by CI.
//!
//! - **Other** operating systems would require some testing and support in the following files:
//! - [core/api-config.h](https://github.com/asmjit/asmjit/tree/master/src/asmjit/core/api-config.h)
@@ -148,8 +145,7 @@ namespace asmjit {
//! ### Supported Backends / Architectures
//!
//! - **X86** and **X86_64** - Both 32-bit and 64-bit backends tested on CI.
-//! - **AArch64** - AArch64 backend is currently only partially tested (there is no native AArch64 runner to test
-//! AsmJit Builder/Compiler)
+//! - **AArch64** - Tested on CI (Native Apple runners and Linux emulated via QEMU).
//!
//! ### Static Builds and Embedding
//!
@@ -180,40 +176,49 @@ namespace asmjit {
//! ### AsmJit Backends
//!
//! AsmJit currently supports only X86/X64 backend, but the plan is to add more backends in the future. By default
-//! AsmJit builds only the host backend, which is autodetected at compile-time, but this can be overridden.
+//! AsmJit builds only the host backend, which is auto-detected at compile-time, but this can be overridden.
//!
-//! - \ref ASMJIT_NO_X86 - Disable X86/X64 backends.
-//! - \ref ASMJIT_NO_FOREIGN - Disables the support for foreign architectures.
-//!
-//! ### Features Selection
+//! - \ref ASMJIT_NO_X86 - Disables both X86 and X86_64 backends.
+//! - \ref ASMJIT_NO_AARCH64 - Disables AArch64 backend.
+//! - \ref ASMJIT_NO_FOREIGN - Disables the support for foreign architecture backends, only keeps a native backend.
//!
-//! AsmJit builds by defaults all supported features, which includes all emitters, logging, instruction validation and
-//! introspection, and JIT memory allocation. Features can be disabled at compile time by using `ASMJIT_NO_...`
-//! definitions.
+//! ### AsmJit Compilation Options
//!
//! - \ref ASMJIT_NO_DEPRECATED - Disables deprecated API at compile time so it won't be available and the
//! compilation will fail if there is attempt to use such API. This includes deprecated classes, namespaces,
//! enumerations, and functions.
//!
-//! - \ref ASMJIT_NO_BUILDER - Disables \ref asmjit_builder functionality completely. This implies \ref
-//! ASMJIT_NO_COMPILER as \ref asmjit_compiler cannot be used without \ref asmjit_builder.
+//! - \ref ASMJIT_NO_SHM_OPEN - Disables functionality that uses `shm_open()`.
//!
-//! - \ref ASMJIT_NO_COMPILER - Disables \ref asmjit_compiler functionality completely.
+//! - \ref ASMJIT_NO_ABI_NAMESPACE - Disables inline ABI namespace within `asmjit` namespace. This is only provided
+//! for users that control all the dependencies (even transitive ones) and that make sure that no two AsmJit
+//! versions are used at the same time. This option can be debugging a little simpler as there would not be ABI
+//! tag after `asmjit::` namespace. Otherwise asmjit would look like `asmjit::_abi_1_13::`, for example.
//!
-//! - \ref ASMJIT_NO_JIT - Disables JIT memory management and \ref JitRuntime.
+//! ### Features Selection
//!
-//! - \ref ASMJIT_NO_LOGGING - Disables \ref Logger and \ref Formatter.
+//! AsmJit builds by defaults all supported features, which includes all emitters, logging, instruction validation and
+//! introspection, and JIT memory allocation. Features can be disabled at compile time by using `ASMJIT_NO_...`
+//! definitions.
+//! - \ref ASMJIT_NO_JIT - Disables JIT memory management and \ref JitRuntime.
//!
//! - \ref ASMJIT_NO_TEXT - Disables everything that contains string representation of AsmJit constants, should
//! be used together with \ref ASMJIT_NO_LOGGING as logging doesn't make sense without the ability to query
//! instruction names, register names, etc...
//!
+//! - \ref ASMJIT_NO_LOGGING - Disables \ref Logger and \ref Formatter.
+//!
//! - \ref ASMJIT_NO_VALIDATION - Disables validation API.
//!
//! - \ref ASMJIT_NO_INTROSPECTION - Disables instruction introspection API, must be used together with \ref
//! ASMJIT_NO_COMPILER as \ref asmjit_compiler requires introspection for its liveness analysis and register
//! allocation.
//!
+//! - \ref ASMJIT_NO_BUILDER - Disables \ref asmjit_builder functionality completely. This implies \ref
+//! ASMJIT_NO_COMPILER as \ref asmjit_compiler cannot be used without \ref asmjit_builder.
+//!
+//! - \ref ASMJIT_NO_COMPILER - Disables \ref asmjit_compiler functionality completely.
+//!
//! \note It's not recommended to disable features if you plan to build AsmJit as a shared library that will be
//! used by multiple projects that you don't control how AsmJit was built (for example AsmJit in a Linux distribution).
//! The possibility to disable certain features exists mainly for customized AsmJit builds.
@@ -234,7 +239,7 @@ namespace asmjit {
//!
//! Useful tips before you start:
//!
-//! - Visit our [Public Gitter Channel](https://gitter.im/asmjit/asmjit) if you need a quick help.
+//! - Visit our [Public Gitter Chat](https://app.gitter.im/#/room/#asmjit:gitter.im) if you need a quick help.
//!
//! - Build AsmJit with `ASMJIT_NO_DEPRECATED` macro defined to make sure that you are not using deprecated
//! functionality at all. Deprecated functions are decorated with `ASMJIT_DEPRECATED()` macro, but sometimes
@@ -242,6 +247,77 @@ namespace asmjit {
//! because some compilers would warn about that. If your project compiles fine with `ASMJIT_NO_DEPRECATED`
//! it's not using anything, which was deprecated.
//!
+//! ### Changes committed at 2024-01-01
+//!
+//! Core changes:
+//!
+//! - Renamed equality functions `eq()` to `equals()` - Only related to `String`, `ZoneVector`, and `CpuFeatures`.
+//! Old function names were deprecated.
+//!
+//! - Removed `CallConvId::kNone` in favor of `CallConvId::kCDecl`, which is now the default calling convention.
+//!
+//! - Deprecated `CallConvId::kHost` in favor of `CallConvId::kCDecl` - host calling convention is now not part
+//! of CallConvId, it can be calculated from CallConvId and Environment instead.
+//!
+//! ### Changes committed at 2023-12-27
+//!
+//! Core changes:
+//!
+//! - Renamed `a64::Vec::ElementType` to `a64::VecElementType` and made it a typed enum. This enum was used mostly
+//! internally, but there is a public API using it, so it's a breaking change.
+//!
+//! - Refactored `FuncSignature`, `FuncSignatureT`, and `FuncSignatureBuilder`. There is only `FuncSignature` now,
+//! which acts as a function signature holder and builder. Replace `FuncSignatureBuilder` with `FuncSignature`
+//! and use `FuncSignature::build<args>` instead of `FuncSignatureT<args>`. The old API has been deprecated.
+//!
+//! - The maximum number of function arguments was raised from 16 to 32.
+//!
+//! ### Changes committed at 2023-12-26
+//!
+//! Core changes:
+//!
+//! - Reworked InstNode and InstExNode to be friendlier to static analysis and to not cause undefined behavior.
+//! InstNode has no operands visually embedded within the struct so there is no _opArray (which was internal).
+//! This means that sizeof(InstNode) changed, but since it's allocated by AsmJit this should be fine. Moreover,
+//! there is no longer InstExNode as that was more a hack, instead there is now InstNodeWithOperands, which is
+//! a template and specifies the number of operands embedded (InstNode accesses these). All nodes that inherited
+//! InstExNode now just inherit InstNodeWithOperands<InstNode::kBaseOpCapacity>, which would provide the same
+//! number of nodes as InstNode.
+//!
+//! - Moved GP and Vec registers from asmjit::arm namespace to asmjit::a64 namespace. At this time there was
+//! no prior deprecation as having arm::Vec would collide with a64::Vec as arm namespace is used within a64
+//! namespace. Just change `arm::Gp` to `a64::Gp` and `arm::Vec` to `a64::Vec`.
+//!
+//! ### Changes committed at 2023-09-10
+//!
+//! Core changes:
+//!
+//! - Changed allocation API to work with spans (JitAllocator).
+//!
+//! - This change is required to support more hardened platforms in the future that make it very difficult
+//! to write JIT compilers.
+//! - `JitAllocator::Span` now represents a memory that the user can access. It abstracts both regular and
+//! dual mappings.
+//! - The `Span` is mostly designed to make it possible to write into it, so in general the read+execute
+//! pointer is what user is intended to keep. Use `span.rx()` to access RX pointer. `Span` is not needed
+//! after the memory it references has been modified, only remember `span.rx()` pointer, which is then
+//! used to deallocate or change the memory the span references.
+//! - Use a new `JitAllocator::alloc()` to allocate a `Span`, then pass the populated Span to `JitAllocator`
+//! write API such as `JitAllocator::write()` - note that JitAllocator can also establish a scope, so you
+//! can use a lambda function that would perform the write, but since it's going through JitAllocator it's
+//! able to ensure that the memory is actually writable.
+//! - If you need to repopulate a `Span` from rx pointer, use `JitAllocator::query(<span-out>, rx)` to get it.
+//! - Study what JitRuntime is doing to better understand how this new API works in detail.
+//! - Users of JitRuntime do not have to do anything as JitRuntime properly abstracts the allocation.
+//!
+//! - Renamed some X86 CPU features to make them compatible with architecture manuals:
+//!
+//! - Changed `AVX512_CDI` to `AVX512_CD`.
+//! - Changed `AVX512_ERI` to `AVX512_ER`.
+//! - Changed `AVX512_PFI` to `AVX512_PF`.
+//!
+//! - Old names were deprecated.
+//!
//! ### Changes committed at 2021-12-13
//!
//! Core changes:
@@ -309,7 +385,7 @@ namespace asmjit {
//! However, `gpCount()` was removed - at the moment `ArchTraits` can be used to access such properties.
//!
//! Some other functions were renamed, like `ArchInfo::isX86Family()` is now `Environment::isFamilyX86()`, etc.
-//! The reason for changing the order was support for more propertries and all the accessors now start with the
+//! The reason for changing the order was support for more properties and all the accessors now start with the
//! type of the property, like `Environment::isPlatformWindows()`.
//!
//! This function causes many other classes to provide `environment()` getter instead of `archInfo()` getter.
@@ -392,7 +468,7 @@ namespace asmjit {
//! // Calling a function (Compiler) changed - use invoke() instead of call().
//! void functionInvocation(x86::Compiler& cc) {
//! InvokeNode* invokeNode;
-//! cc.invoke(&invokeNode, targetOperand, FuncSignatureT<...>(...));
+//! cc.invoke(&invokeNode, targetOperand, FuncSignature::build<...>(...));
//! }
//! ```
@@ -454,7 +530,8 @@ namespace asmjit {
//! JitRuntime rt; // Runtime specialized for JIT code execution.
//!
//! CodeHolder code; // Holds code and relocation information.
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
//!
//! x86::Assembler a(&code); // Create and attach x86::Assembler to code.
//! a.mov(x86::eax, 1); // Move one to eax register.
@@ -599,9 +676,10 @@ namespace asmjit {
//! int main() {
//! // Create a custom environment that matches the current host environment.
//! Environment env = Environment::host();
+//! CpuFeatures cpuFeatures = CpuInfo::host().features();
//!
//! CodeHolder code; // Create a CodeHolder.
-//! code.init(env); // Initialize CodeHolder with environment.
+//! code.init(env, cpuFeatures); // Initialize CodeHolder with environment.
//!
//! x86::Assembler a(&code); // Create and attach x86::Assembler to `code`.
//!
@@ -661,15 +739,17 @@ namespace asmjit {
//! JitAllocator allocator;
//!
//! // Allocate an executable virtual memory and handle a possible failure.
-//! void* p = allocator.alloc(estimatedSize);
-//! if (!p)
+//! JitAllocator::Span span;
+//! Error err = allocator.alloc(span, estimatedSize);
+//!
+//! if (err != kErrorOk) // <- NOTE: This must be checked, always!
//! return 0;
//!
//! // Now relocate the code to the address provided by the memory allocator.
-//! // Please note that this DOESN'T COPY anything to `p`. This function will
-//! // store the address in CodeHolder and use relocation entries to patch the
-//! // existing code in all sections to respect the base address provided.
-//! code.relocateToBase((uint64_t)p);
+//! // Please note that this DOESN'T COPY anything to it. This function will
+//! // store the address in CodeHolder and use relocation entries to patch
+//! // the existing code in all sections to respect the base address provided.
+//! code.relocateToBase((uint64_t)span.rx());
//!
//! // This is purely optional. There are cases in which the relocation can omit
//! // unneeded data, which would shrink the size of address table. If that
@@ -682,12 +762,17 @@ namespace asmjit {
//! // additional options that can be used to also zero pad sections' virtual
//! // size, etc.
//! //
-//! // With some additional features, copyFlattenData() does roughly this:
-//! // for (Section* section : code.sections())
-//! // memcpy((uint8_t*)p + section->offset(),
-//! // section->data(),
-//! // section->bufferSize());
-//! code.copyFlattenedData(p, codeSize, CopySectionFlags::kPadSectionBuffer);
+//! // With some additional features, copyFlattenData() does roughly the following:
+//! //
+//! // allocator.write([&](JitAllocator::Span& span) {
+//! // for (Section* section : code.sections()) {
+//! // uint8_t* p = (uint8_t*)span.rw() + section->offset();
+//! // memcpy(p, section->data(), section->bufferSize());
+//! // }
+//! // }
+//! allocator.write([&](JitAllocator::Span& span) {
+//! code.copyFlattenedData(span.rw(), codeSize, CopySectionFlags::kPadSectionBuffer);
+//! });
//!
//! // Execute the generated function.
//! int inA[4] = { 4, 3, 2, 1 };
@@ -722,10 +807,11 @@ namespace asmjit {
//!
//! void initializeCodeHolder(CodeHolder& code) {
//! Environment env = Environment::host();
+//! CpuFeatures cpuFeatures = CpuInfo::host().features();
//! uint64_t baseAddress = uint64_t(0x1234);
//!
//! // initialize CodeHolder with environment and custom base address.
-//! code.init(env, baseAddress);
+//! code.init(env, cpuFeatures, baseAddress);
//! }
//! ```
//!
@@ -757,7 +843,7 @@ namespace asmjit {
//!
//! There is no function that would return the number of unbound labels as this is completely unimportant from
//! CodeHolder's perspective. If a label is not used then it doesn't matter whether it's bound or not, only actually
-//! used labels matter. After a Label is bound it's possible to query its offset offset relative to the start of the
+//! used labels matter. After a Label is bound it's possible to query its offset relative to the start of the
//! section where it was bound:
//!
//! ```
@@ -870,7 +956,7 @@ namespace asmjit {
//!
//! if (code.hasUnresolvedLinks()) {
//! // This would mean either unbound label or some other issue.
-//! printf("The code has %zu unbound labels\n", code.unresovedLinkCount());
+//! printf("The code has %zu unbound labels\n", code.unresolvedLinkCount());
//! exit(1);
//! }
//! }
@@ -886,12 +972,15 @@ namespace asmjit {
//! with assembler requires the knowledge of the following:
//!
//! - \ref BaseAssembler and architecture-specific assemblers:
-//! - \ref x86::Assembler - Assembler specific to X86 architecture
+//! - \ref x86::Assembler - Assembler implementation targeting X86 and X86_64 architectures.
+//! - \ref a64::Assembler - Assembler implementation targeting AArch64 architecture.
//! - \ref Operand and its variations:
//! - \ref BaseReg - Base class for a register operand, inherited by:
-//! - \ref x86::Reg - Register operand specific to X86 architecture.
+//! - \ref x86::Reg - Register operand specific to X86 and X86_64 architectures.
+//! - \ref arm::Reg - Register operand specific to AArch64 architecture.
//! - \ref BaseMem - Base class for a memory operand, inherited by:
//! - \ref x86::Mem - Memory operand specific to X86 architecture.
+//! - \ref arm::Mem - Memory operand specific to AArch64 architecture.
//! - \ref Imm - Immediate (value) operand.
//! - \ref Label - Label operand.
//!
@@ -999,7 +1088,7 @@ namespace asmjit {
//!
//! // Type-unsafe, but possible.
//! a.emit(x86::Inst::kIdMov, dst, m);
-//! // Also possible, `emit()` is typeless and can be used with raw Operand.
+//! // Also possible, `emit()` is type-less and can be used with raw Operand.
//! a.emit(x86::Inst::kIdMov, dst, op);
//! }
//! ```
@@ -1070,10 +1159,10 @@ namespace asmjit {
//!
//! void testX86Mem() {
//! // The same as: dword ptr [rax + rbx].
-//! x86::Mem a = x86::dword_ptr(rax, rbx);
+//! x86::Mem a = x86::dword_ptr(x86::rax, x86::rbx);
//!
//! // The same as: qword ptr [rdx + rsi << 0 + 1].
-//! x86::Mem b = x86::qword_ptr(rdx, rsi, 0, 1);
+//! x86::Mem b = x86::qword_ptr(x86::rdx, x86::rsi, 0, 1);
//! }
//! ```
//!
@@ -1086,18 +1175,18 @@ namespace asmjit {
//!
//! void testX86Mem() {
//! // The same as: dword ptr [rax + 12].
-//! x86::Mem mem = x86::dword_ptr(rax, 12);
+//! x86::Mem mem = x86::dword_ptr(x86::rax, 12);
//!
//! mem.hasBase(); // true.
//! mem.hasIndex(); // false.
//! mem.size(); // 4.
//! mem.offset(); // 12.
//!
-//! mem.setSize(0); // Sets the size to 0 (makes it sizeless).
+//! mem.setSize(0); // Sets the size to 0 (makes it size-less).
//! mem.addOffset(-1); // Adds -1 to the offset and makes it 11.
//! mem.setOffset(0); // Sets the offset to 0.
-//! mem.setBase(rcx); // Changes BASE to RCX.
-//! mem.setIndex(rax); // Changes INDEX to RAX.
+//! mem.setBase(x86::rcx); // Changes BASE to RCX.
+//! mem.setIndex(x86::rax); // Changes INDEX to RAX.
//! mem.hasIndex(); // true.
//! }
//! // ...
@@ -1189,7 +1278,8 @@ namespace asmjit {
//!
//! ### Builder Examples
//!
-//! - \ref x86::Builder provides many X86/X64 examples.
+//! - \ref x86::Builder - Builder implementation targeting X86 and X86_64 architectures.
+//! - \ref a64::Builder - Builder implementation targeting AArch64 architecture.
//! \defgroup asmjit_compiler Compiler
@@ -1226,7 +1316,8 @@ namespace asmjit {
//!
//! ### Compiler Examples
//!
-//! - \ref x86::Compiler provides many X86/X64 examples.
+//! - \ref x86::Compiler - Compiler implementation targeting X86 and X86_64 architectures.
+//! - \ref a64::Compiler - Compiler implementation targeting AArch64 architecture.
//!
//! ### Compiler Tips
//!
@@ -1346,7 +1437,8 @@ namespace asmjit {
//! FileLogger logger(stdout); // Logger should always survive CodeHolder.
//!
//! CodeHolder code; // Holds code and relocation information.
-//! code.init(rt.environment()); // Initialize to the same arch as JIT runtime.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
//! code.setLogger(&logger); // Attach the `logger` to `code` holder.
//!
//! // ... code as usual, everything emitted will be logged to `stdout` ...
@@ -1369,7 +1461,8 @@ namespace asmjit {
//! StringLogger logger; // Logger should always survive CodeHolder.
//!
//! CodeHolder code; // Holds code and relocation information.
-//! code.init(rt.environment()); // Initialize to the same arch as JIT runtime.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
//! code.setLogger(&logger); // Attach the `logger` to `code` holder.
//!
//! // ... code as usual, logging will be concatenated to logger string ...
@@ -1396,7 +1489,7 @@ namespace asmjit {
//! The first example illustrates how to format operands:
//!
//! ```
-//! #include <asmjit/core.h>
+//! #include <asmjit/x86.h>
//! #include <stdio.h>
//!
//! using namespace asmjit;
@@ -1421,17 +1514,17 @@ namespace asmjit {
//! // compatible with what AsmJit normally does.
//! Arch arch = Arch::kX64;
//!
-//! log(arch, rax); // Prints 'rax'.
-//! log(arch, ptr(rax, rbx, 2)); // Prints '[rax + rbx * 4]`.
-//! log(arch, dword_ptr(rax, rbx, 2)); // Prints 'dword [rax + rbx * 4]`.
-//! log(arch, imm(42)); // Prints '42'.
+//! logOperand(arch, rax); // Prints 'rax'.
+//! logOperand(arch, ptr(rax, rbx, 2)); // Prints '[rax + rbx * 4]`.
+//! logOperand(arch, dword_ptr(rax, rbx, 2)); // Prints 'dword [rax + rbx * 4]`.
+//! logOperand(arch, imm(42)); // Prints '42'.
//! }
//! ```
//!
//! Next example illustrates how to format whole instructions:
//!
//! ```
-//! #include <asmjit/core.h>
+//! #include <asmjit/x86.h>
//! #include <stdio.h>
//! #include <utility>
//!
@@ -1446,7 +1539,7 @@ namespace asmjit {
//! FormatFlags formatFlags = FormatFlags::kNone;
//!
//! // The formatter expects operands in an array.
-//! Operand_ operands { std::forward<Args>(args)... };
+//! Operand_ operands[] { std::forward<Args>(args)... };
//!
//! StringTmp<128> sb;
//! Formatter::formatInstruction(
@@ -1468,13 +1561,13 @@ namespace asmjit {
//! // Prints 'vaddpd zmm0, zmm1, [rax] {1to8}'.
//! logInstruction(arch,
//! BaseInst(Inst::kIdVaddpd),
-//! zmm0, zmm1, ptr(rax)._1toN());
+//! zmm0, zmm1, ptr(rax)._1to8());
//!
//! // BaseInst abstracts instruction id, instruction options, and extraReg.
//! // Prints 'lock add [rax], rcx'.
//! logInstruction(arch,
//! BaseInst(Inst::kIdAdd, InstOptions::kX86_Lock),
-//! x86::ptr(rax), rcx);
+//! ptr(rax), rcx);
//!
//! // Similarly an extra register (like AVX-512 selector) can be used.
//! // Prints 'vaddpd zmm0 {k2} {z}, zmm1, [rax]'.
@@ -1494,7 +1587,7 @@ namespace asmjit {
//! using namespace asmjit;
//!
//! void formattingExample(BaseBuilder* builder) {
-//! FormatFlags formatFlags = FormatFlags::kNone;
+//! FormatOptions formatOptions {};
//!
//! // This also shows how temporary strings can be used.
//! StringTmp<512> sb;
@@ -1503,7 +1596,7 @@ namespace asmjit {
//! // were zero (no extra flags), and the builder instance, which we have
//! // provided. An overloaded version also exists, which accepts begin and
//! // and end nodes, which can be used to only format a range of nodes.
-//! Formatter::formatNodeList(sb, formatFlags, builder);
+//! Formatter::formatNodeList(sb, formatOptions, builder);
//!
//! // You can do whatever else with the string, it's always null terminated,
//! // so it can be passed to C functions like printf().
@@ -1522,7 +1615,7 @@ namespace asmjit {
//! override \ref ErrorHandler::handleError() to throw, in that case no error will be returned and exception will be
//! thrown instead. All functions where this can happen are not marked `noexcept`.
//!
-//! Errors should never be ignored, however, checking errors after each AsmJit API call would simply overcomplicate
+//! Errors should never be ignored, however, checking errors after each AsmJit API call would simply over-complicate
//! the whole code generation experience. \ref ErrorHandler exists to make the use of AsmJit API simpler as it allows
//! to customize how errors can be handled:
//!
@@ -1560,7 +1653,7 @@ namespace asmjit {
//! MyErrorHandler myErrorHandler;
//! CodeHolder code;
//!
-//! code.init(rt.environment());
+//! code.init(rt.environment(), rt.cpuFeatures());
//! code.setErrorHandler(&myErrorHandler);
//!
//! x86::Assembler a(&code);
@@ -1592,7 +1685,7 @@ namespace asmjit {
//!
//! Each instruction can be then queried for the following information:
//!
-//! - \ref InstRWInfo - Read/write information of instruction and its oprands (includes \ref OpRWInfo).
+//! - \ref InstRWInfo - Read/write information of instruction and its operands (includes \ref OpRWInfo).
//!
//! - \ref CpuFeatures - CPU features required to execute the instruction.
//!
@@ -1631,14 +1724,57 @@ namespace asmjit {
//!
//! ### Overview
//!
-//! AsmJit's virtual memory management is divided into two main categories:
-//!
-//! - Low level API that provides cross-platform abstractions for virtual memory allocation. Implemented in
-//! \ref VirtMem namespace.
-//!
-//! - High level API that makes it very easy to store generated code for execution. See \ref JitRuntime, which is
-//! used by many examples for its simplicity and easy integration with \ref CodeHolder. There is also \ref
-//! JitAllocator, which lays somewhere between RAW memory allocation and \ref JitRuntime.
+//! AsmJit's virtual memory management is divided into three main categories:
+//!
+//! - Low level interface that provides cross-platform abstractions for virtual memory allocation. Implemented in
+//! \ref VirtMem namespace. This API is a thin wrapper around operating system specific calls such as
+//! `VirtualAlloc()` and `mmap()` and it's intended to be used by AsmJit's higher level API. Low-level virtual
+//! memory functions can be used to allocate virtual memory, change its permissions, and to release it.
+//! Additionally, an API that allows to create dual mapping (to support hardened environments) is provided.
+//!
+//! - Middle level API that is provided by \ref JitAllocator, which uses \ref VirtMem internally and offers nicer
+//! API that can be used by users to allocate executable memory conveniently. \ref JitAllocator tries to be smart,
+//! for example automatically using dual mapping or `MAP_JIT` on hardened environments.
+//!
+//! - High level API that is provided by \ref JitRuntime, which implements \ref Target interface and uses \ref
+//! JitAllocator under the hood. Since \ref JitRuntime inherits from \ref Target it makes it easy to use with
+//! \ref CodeHolder. Many AsmJit examples use \ref JitRuntime for its simplicity and easy integration.
+//!
+//! The main difference between \ref VirtMem and \ref JitAllocator is that \ref VirtMem can only be used to allocate
+//! whole pages, whereas \ref JitAllocator has `malloc()` like API that allows to allocate smaller quantities that
+//! usually represent the size of an assembled function or a chunk of functions that can represent a module, for
+//! example. \ref JitAllocator then tracks used space of each page it maintains. Internally, \ref JitAllocator uses
+//! two bit arrays to track occupied regions in each allocated block of pages.
+//!
+//! ### Hardened Environments
+//!
+//! In the past, allocating virtual memory with Read+Write+Execute (RWX) access permissions was easy. However, modern
+//! operating systems and runtime environments often use hardening, which typically prohibits mapping pages with both
+//! Write and Execute permissions (known as the W^X policy). This presents a challenge for JIT compilers because
+//! generated code for a single function is unlikely to fit in exactly N pages without leaving some space empty. To
+//! accommodate this, the execution environment may need to temporarily change the permissions of existing pages to
+//! read+write (RW) to insert new code into them, however, sometimes it's not possible to ensure that no thread is
+//! executing code in such affected pages in a multithreaded environment, in which multiple threads may be executing
+//! generated code.
+//!
+//! Such restrictions leave a lot of complexity on the application, so AsmJit implements a dual mapping technique to
+//! make the life of AsmJit users easier. In this technique, a region of memory is mapped to two different virtual
+//! addresses with different access permissions. One virtual address is mapped with read and write (RW) access, which
+//! is used by the JIT compiler to write generated code. The other virtual address is mapped with read and execute (RX)
+//! access, which is used by the application to execute the generated code.
+//!
+//! However, implementing dual mapping can be challenging because it typically requires obtaining an anonymous file
+//! descriptor on most Unix-like operating systems. This file descriptor is then passed to mmap() twice to create
+//! the two mappings. AsmJit handles this challenge by using system-specific techniques such as `memfd_create()` on
+//! Linux, `shm_open(SHM_ANON)` on BSD, and `MAP_REMAPDUP` with `mremap()` on NetBSD. The latter approach does not
+//! require a file descriptor. If none of these options are available, AsmJit uses a plain `open()` call followed by
+//! `unlink()`.
+//!
+//! The most challenging part is actually obtaining a file descriptor that can be passed to `mmap()` with `PROT_EXEC`.
+//! This is still something that may fail, for example the environment could be hardened in a way that this would
+//! not be possible at all, and thus dual mapping would not work.
+//!
+//! Dual mapping is provided by both \ref VirtMem and \ref JitAllocator.
//! \defgroup asmjit_zone Zone Memory
diff --git a/3rdparty/asmjit/src/asmjit/core/api-build_p.h b/3rdparty/asmjit/src/asmjit/core/api-build_p.h
index 6eca971037e..3ddc9e78d22 100644
--- a/3rdparty/asmjit/src/asmjit/core/api-build_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/api-build_p.h
@@ -27,6 +27,25 @@
#define NOMINMAX
#endif
#include <windows.h>
+#else
+ // Most production code is compiled with large file support, so do the same.
+ #if !defined(_WIN32) && !defined(_LARGEFILE64_SOURCE)
+ #define _LARGEFILE64_SOURCE 1
+ #endif
+
+ // These OSes use 64-bit API by default.
+ #if defined(__APPLE__ ) || \
+ defined(__HAIKU__ ) || \
+ defined(__bsdi__ ) || \
+ defined(__DragonFly__) || \
+ defined(__FreeBSD__ ) || \
+ defined(__NetBSD__ ) || \
+ defined(__OpenBSD__ )
+ #define ASMJIT_FILE64_API(NAME) NAME
+ #else
+ #define ASMJIT_FILE64_API(NAME) NAME##64
+ #endif
+
#endif
#include "./api-config.h"
diff --git a/3rdparty/asmjit/src/asmjit/core/api-config.h b/3rdparty/asmjit/src/asmjit/core/api-config.h
index 6bd5beecc0a..bbc35067778 100644
--- a/3rdparty/asmjit/src/asmjit/core/api-config.h
+++ b/3rdparty/asmjit/src/asmjit/core/api-config.h
@@ -12,20 +12,23 @@
//! \addtogroup asmjit_core
//! \{
-//! AsmJit library version in `(Major << 16) | (Minor << 8) | (Patch)` format.
-#define ASMJIT_LIBRARY_VERSION 0x010900 /* 1.9.0 */
+//! Makes a 32-bit integer that represents AsmJit version in `(major << 16) | (minor << 8) | patch` form.
+#define ASMJIT_LIBRARY_MAKE_VERSION(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
+
+//! AsmJit library version, see \ref ASMJIT_LIBRARY_MAKE_VERSION for a version format reference.
+#define ASMJIT_LIBRARY_VERSION ASMJIT_LIBRARY_MAKE_VERSION(1, 13, 0)
//! \def ASMJIT_ABI_NAMESPACE
//!
//! AsmJit ABI namespace is an inline namespace within \ref asmjit namespace.
//!
-//! It's used to make sure that when user links to an incompatible version of AsmJit, it won't link. It has also some
-//! additional properties as well. When `ASMJIT_ABI_NAMESPACE` is defined by the user it would override the AsmJit
-//! default, which makes it possible to use use multiple AsmJit libraries within a single project, totally controlled
-//! by the users. This is useful especially in cases in which some of such library comes from a third party.
-#ifndef ASMJIT_ABI_NAMESPACE
- #define ASMJIT_ABI_NAMESPACE _abi_1_9
-#endif
+//! It's used to make sure that when user links to an incompatible version of AsmJit, it won't link. It has also
+//! some additional properties as well. When `ASMJIT_ABI_NAMESPACE` is defined by the user it would override the
+//! AsmJit default, which makes it possible to use multiple AsmJit libraries within a single project, totally
+//! controlled by users. This is useful especially in cases in which some of such library comes from third party.
+#if !defined(ASMJIT_ABI_NAMESPACE)
+ #define ASMJIT_ABI_NAMESPACE _abi_1_13
+#endif // !ASMJIT_ABI_NAMESPACE
//! \}
@@ -39,9 +42,8 @@
#include <stdlib.h>
#include <string.h>
-#include <iterator>
+#include <initializer_list>
#include <limits>
-#include <new>
#include <type_traits>
#include <utility>
@@ -52,8 +54,6 @@
// Build Options
// =============
-#define ASMJIT_STATIC
-
// NOTE: Doxygen cannot document macros that are not defined, that's why we have to define them and then undefine
// them immediately, so it won't use the macros with its own preprocessor.
#ifdef _DOXYGEN
@@ -70,20 +70,17 @@ namespace asmjit {
//! Defined when AsmJit's build configuration is 'Debug'.
//!
-//! \note Can be defined explicitly to bypass autodetection.
+//! \note Can be defined explicitly to bypass auto-detection.
#define ASMJIT_BUILD_DEBUG
//! Defined when AsmJit's build configuration is 'Release'.
//!
-//! \note Can be defined explicitly to bypass autodetection.
+//! \note Can be defined explicitly to bypass auto-detection.
#define ASMJIT_BUILD_RELEASE
//! Disables X86/X64 backends.
#define ASMJIT_NO_X86
-//! Disables AArch32 backends (both ARM and Thumb).
-#define ASMJIT_NO_AARCH32
-
//! Disables AArch64 backend.
#define ASMJIT_NO_AARCH64
@@ -115,7 +112,7 @@ namespace asmjit {
#define ASMJIT_NO_INTROSPECTION
// Avoid doxygen preprocessor using feature-selection definitions.
-#undef ASMJIT_BUILD_EMBNED
+#undef ASMJIT_BUILD_EMBED
#undef ASMJIT_BUILD_STATIC
#undef ASMJIT_BUILD_DEBUG
#undef ASMJIT_BUILD_RELEASE
@@ -166,6 +163,41 @@ namespace asmjit {
// Target Architecture Detection
// =============================
+//! \addtogroup asmjit_core
+//! \{
+
+//! \def ASMJIT_ARCH_X86
+//!
+//! Defined to either 0, 32, or 64 depending on whether the target CPU is X86 (32) or X86_64 (64).
+
+//! \def ASMJIT_ARCH_ARM
+//!
+//! Defined to either 0, 32, or 64 depending on whether the target CPU is ARM (32) or AArch64 (64).
+
+//! \def ASMJIT_ARCH_MIPS
+//!
+//! Defined to either 0, 32, or 64 depending on whether the target CPU is MIPS (32) or MISP64 (64).
+
+//! \def ASMJIT_ARCH_RISCV
+//!
+//! Defined to either 0, 32, or 64 depending on whether the target CPU is RV32 (32) or RV64 (64).
+
+//! \def ASMJIT_ARCH_BITS
+//!
+//! Defined to either 32 or 64 depending on the target.
+
+//! \def ASMJIT_ARCH_LE
+//!
+//! Defined to 1 if the target architecture is little endian.
+
+//! \def ASMJIT_ARCH_BE
+//!
+//! Defined to 1 if the target architecture is big endian.
+
+//! \}
+
+//! \cond NONE
+
#if defined(_M_X64) || defined(__x86_64__)
#define ASMJIT_ARCH_X86 64
#elif defined(_M_IX86) || defined(__X86__) || defined(__i386__)
@@ -174,7 +206,7 @@ namespace asmjit {
#define ASMJIT_ARCH_X86 0
#endif
-#if defined(__arm64__) || defined(__aarch64__)
+#if defined(_M_ARM64) || defined(__arm64__) || defined(__aarch64__)
# define ASMJIT_ARCH_ARM 64
#elif defined(_M_ARM) || defined(_M_ARMT) || defined(__arm__) || defined(__thumb__) || defined(__thumb2__)
#define ASMJIT_ARCH_ARM 32
@@ -190,10 +222,17 @@ namespace asmjit {
#define ASMJIT_ARCH_MIPS 0
#endif
-#define ASMJIT_ARCH_BITS (ASMJIT_ARCH_X86 | ASMJIT_ARCH_ARM | ASMJIT_ARCH_MIPS)
+// NOTE `__riscv` is the correct macro in this case as specified by "RISC-V Toolchain Conventions".
+#if (defined(__riscv) || defined(__riscv__)) && defined(__riscv_xlen)
+ #define ASMJIT_ARCH_RISCV __riscv_xlen
+#else
+ #define ASMJIT_ARCH_RISCV 0
+#endif
+
+#define ASMJIT_ARCH_BITS (ASMJIT_ARCH_X86 | ASMJIT_ARCH_ARM | ASMJIT_ARCH_MIPS | ASMJIT_ARCH_RISCV)
#if ASMJIT_ARCH_BITS == 0
#undef ASMJIT_ARCH_BITS
- #if defined (__LP64__) || defined(_LP64)
+ #if defined(__LP64__) || defined(_LP64)
#define ASMJIT_ARCH_BITS 64
#else
#define ASMJIT_ARCH_BITS 32
@@ -215,62 +254,88 @@ namespace asmjit {
#define ASMJIT_NO_X86
#endif
- #if !ASMJIT_ARCH_ARM && !defined(ASMJIT_NO_AARCH64)
+ #if ASMJIT_ARCH_ARM != 64 && !defined(ASMJIT_NO_AARCH64)
#define ASMJIT_NO_AARCH64
#endif
#endif
+//! \endcond
// C++ Compiler and Features Detection
// ===================================
-#define ASMJIT_CXX_GNU 0
-#define ASMJIT_CXX_MAKE_VER(MAJOR, MINOR) ((MAJOR) * 1000 + (MINOR))
-
-// Intel Compiler [pretends to be GNU or MSC, so it must be checked first]:
-// - https://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler
-// - https://software.intel.com/en-us/articles/c14-features-supported-by-intel-c-compiler
-// - https://software.intel.com/en-us/articles/c17-features-supported-by-intel-c-compiler
-#if defined(__INTEL_COMPILER)
-
-// MSC Compiler:
-// - https://msdn.microsoft.com/en-us/library/hh567368.aspx
-//
-// Version List:
-// - 16.00.0 == VS2010
-// - 17.00.0 == VS2012
-// - 18.00.0 == VS2013
-// - 19.00.0 == VS2015
-// - 19.10.0 == VS2017
-#elif defined(_MSC_VER) && defined(_MSC_FULL_VER)
-
-// Clang Compiler [Pretends to be GNU, so it must be checked before]:
-// - https://clang.llvm.org/cxx_status.html
-#elif defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
-
-// GNU Compiler:
-// - https://gcc.gnu.org/projects/cxx-status.html
-#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
-
- #undef ASMJIT_CXX_GNU
- #define ASMJIT_CXX_GNU ASMJIT_CXX_MAKE_VER(__GNUC__, __GNUC_MINOR__)
-
-#endif
-
-// Compiler features detection macros.
-#if defined(__clang__) && defined(__has_attribute)
+#if defined(__GNUC__) && defined(__has_attribute)
#define ASMJIT_CXX_HAS_ATTRIBUTE(NAME, CHECK) (__has_attribute(NAME))
#else
#define ASMJIT_CXX_HAS_ATTRIBUTE(NAME, CHECK) (!(!(CHECK)))
-#endif
+#endif // !ASMJIT_CXX_HAS_ATTRIBUTE
// API Decorators & C++ Extensions
// ===============================
+//! \addtogroup asmjit_core
+//! \{
+
//! \def ASMJIT_API
//!
//! A decorator that is used to decorate API that AsmJit exports when built as a shared library.
+//! \def ASMJIT_VIRTAPI
+//!
+//! This is basically a workaround. When using MSVC and marking class as DLL export everything gets exported, which
+//! is unwanted in most projects. MSVC automatically exports typeinfo and vtable if at least one symbol of the class
+//! is exported. However, GCC has some strange behavior that even if one or more symbol is exported it doesn't export
+//! typeinfo unless the class itself is decorated with "visibility(default)" (i.e. ASMJIT_API).
+
+//! \def ASMJIT_FORCE_INLINE
+//!
+//! Decorator to force inlining of functions, uses either `__attribute__((__always_inline__))` or __forceinline,
+//! depending on C++ compiler.
+
+//! \def ASMJIT_INLINE_NODEBUG
+//!
+//! Like \ref ASMJIT_FORCE_INLINE, but uses additionally `__nodebug__` or `__artificial__` attribute to make the
+//! debugging of some AsmJit functions easier, especially getters and one-line abstractions where usually you don't
+//! want to step in.
+
+//! \def ASMJIT_NOINLINE
+//!
+//! Decorator to avoid inlining of functions, uses either `__attribute__((__noinline__))` or `__declspec(noinline)`
+//! depending on C++ compiler.
+
+//! \def ASMJIT_NORETURN
+//!
+//! Decorator that marks functions that should never return. Typically used to implement assertion handlers that
+//! terminate, so the function never returns.
+
+//! \def ASMJIT_CDECL
+//!
+//! CDECL function attribute - either `__attribute__((__cdecl__))` or `__cdecl`.
+
+//! \def ASMJIT_STDCALL
+//!
+//! STDCALL function attribute - either `__attribute__((__stdcall__))` or `__stdcall`.
+//!
+//! \note This expands to nothing on non-x86 targets as STDCALL is X86 specific.
+
+//! \def ASMJIT_FASTCALL
+//!
+//! FASTCALL function attribute - either `__attribute__((__fastcall__))` or `__fastcall`.
+//!
+//! \note Expands to nothing on non-x86 targets as FASTCALL is X86 specific.
+
+//! \def ASMJIT_REGPARM(N)
+//!
+//! Expands to `__attribute__((__regparm__(N)))` when compiled by GCC or clang, nothing otherwise.
+
+//! \def ASMJIT_VECTORCALL
+//!
+//! VECTORCALL function attribute - either `__attribute__((__vectorcall__))` or `__vectorcall`.
+//!
+//! \note Expands to nothing on non-x86 targets as VECTORCALL is X86 specific.
+
+//! \}
+
// API (Export / Import).
#if !defined(ASMJIT_STATIC)
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__MINGW32__))
@@ -298,13 +363,7 @@ namespace asmjit {
#define ASMJIT_VARAPI extern ASMJIT_API
#endif
-//! \def ASMJIT_VIRTAPI
-//!
-//! This is basically a workaround. When using MSVC and marking class as DLL export everything gets exported, which
-//! is unwanted in most projects. MSVC automatically exports typeinfo and vtable if at least one symbol of the class
-//! is exported. However, GCC has some strange behavior that even if one or more symbol is exported it doesn't export
-//! typeinfo unless the class itself is decorated with "visibility(default)" (i.e. ASMJIT_API).
-#if !defined(_WIN32) && defined(__GNUC__)
+#if defined(__GNUC__) && !defined(_WIN32)
#define ASMJIT_VIRTAPI ASMJIT_API
#else
#define ASMJIT_VIRTAPI
@@ -319,6 +378,15 @@ namespace asmjit {
#define ASMJIT_FORCE_INLINE inline
#endif
+
+#if defined(__clang__)
+ #define ASMJIT_INLINE_NODEBUG inline __attribute__((__always_inline__, __nodebug__))
+#elif defined(__GNUC__)
+ #define ASMJIT_INLINE_NODEBUG inline __attribute__((__always_inline__, __artificial__))
+#else
+ #define ASMJIT_INLINE_NODEBUG inline
+#endif
+
#if defined(__GNUC__)
#define ASMJIT_NOINLINE __attribute__((__noinline__))
#define ASMJIT_NORETURN __attribute__((__noreturn__))
@@ -452,17 +520,10 @@ namespace asmjit {
//! Marks function, class, struct, enum, or anything else as deprecated.
#if defined(__GNUC__)
#define ASMJIT_DEPRECATED(MESSAGE) __attribute__((__deprecated__(MESSAGE)))
- #if defined(__clang__)
- #define ASMJIT_DEPRECATED_STRUCT(MESSAGE) __attribute__((__deprecated__(MESSAGE)))
- #else
- #define ASMJIT_DEPRECATED_STRUCT(MESSAGE) /* not usable if a deprecated function uses it */
- #endif
#elif defined(_MSC_VER)
#define ASMJIT_DEPRECATED(MESSAGE) __declspec(deprecated(MESSAGE))
- #define ASMJIT_DEPRECATED_STRUCT(MESSAGE) /* not usable if a deprecated function uses it */
#else
#define ASMJIT_DEPRECATED(MESSAGE)
- #define ASMJIT_DEPRECATED_STRUCT(MESSAGE)
#endif
// Utilities.
@@ -471,66 +532,60 @@ namespace asmjit {
#if ASMJIT_CXX_HAS_ATTRIBUTE(no_sanitize, 0)
#define ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF __attribute__((__no_sanitize__("undefined")))
-#elif ASMJIT_CXX_GNU >= ASMJIT_CXX_MAKE_VER(4, 9)
+#elif defined(__GNUC__) && __GNUC__ >= 5
#define ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF __attribute__((__no_sanitize_undefined__))
#else
#define ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF
#endif
-// Begin-Namespace & End-Namespace Macros
+// Diagnostic Macros
// ======================================
-#if defined _DOXYGEN
- #define ASMJIT_BEGIN_NAMESPACE namespace asmjit {
- #define ASMJIT_END_NAMESPACE }
-#elif defined(__clang__)
- #define ASMJIT_BEGIN_NAMESPACE \
- namespace asmjit { inline namespace ASMJIT_ABI_NAMESPACE { \
- _Pragma("clang diagnostic push") \
- _Pragma("clang diagnostic ignored \"-Wconstant-logical-operand\"") \
- _Pragma("clang diagnostic ignored \"-Wunnamed-type-template-args\"")
- #define ASMJIT_END_NAMESPACE \
- _Pragma("clang diagnostic pop") \
- }}
-#elif defined(__GNUC__) && __GNUC__ == 4
- #define ASMJIT_BEGIN_NAMESPACE \
- namespace asmjit { inline namespace ASMJIT_ABI_NAMESPACE { \
+#if !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(_DOXYGEN)
+ #if defined(__GNUC__) && __GNUC__ == 4
+ // There is a bug in GCC 4.X that has been fixed in GCC 5+, so just silence the warning.
+ #define ASMJIT_BEGIN_DIAGNOSTIC_SCOPE \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"")
- #define ASMJIT_END_NAMESPACE \
- _Pragma("GCC diagnostic pop") \
- }}
-#elif defined(__GNUC__) && __GNUC__ >= 8
- #define ASMJIT_BEGIN_NAMESPACE \
- namespace asmjit { inline namespace ASMJIT_ABI_NAMESPACE { \
- _Pragma("GCC diagnostic push") \
- _Pragma("GCC diagnostic ignored \"-Wclass-memaccess\"")
- #define ASMJIT_END_NAMESPACE \
- _Pragma("GCC diagnostic pop") \
- }}
-#elif defined(_MSC_VER) && !defined(__INTEL_COMPILER)
- #define ASMJIT_BEGIN_NAMESPACE \
- namespace asmjit { inline namespace ASMJIT_ABI_NAMESPACE { \
+ #define ASMJIT_END_DIAGNOSTIC_SCOPE \
+ _Pragma("GCC diagnostic pop")
+ #elif defined(_MSC_VER)
+ #define ASMJIT_BEGIN_DIAGNOSTIC_SCOPE \
__pragma(warning(push)) \
__pragma(warning(disable: 4127)) /* conditional expression is const */ \
__pragma(warning(disable: 4201)) /* nameless struct/union */
- #define ASMJIT_END_NAMESPACE \
- __pragma(warning(pop)) \
- }}
+ #define ASMJIT_END_DIAGNOSTIC_SCOPE \
+ __pragma(warning(pop))
+ #endif
#endif
-#if !defined(ASMJIT_BEGIN_NAMESPACE) && !defined(ASMJIT_END_NAMESPACE)
- #define ASMJIT_BEGIN_NAMESPACE namespace asmjit { inline namespace ASMJIT_ABI_NAMESPACE {
- #define ASMJIT_END_NAMESPACE }}
+#if !defined(ASMJIT_BEGIN_DIAGNOSTIC_SCOPE) && !defined(ASMJIT_END_DIAGNOSTIC_SCOPE)
+ #define ASMJIT_BEGIN_DIAGNOSTIC_SCOPE
+ #define ASMJIT_END_DIAGNOSTIC_SCOPE
#endif
-#define ASMJIT_BEGIN_SUB_NAMESPACE(NAMESPACE) \
- ASMJIT_BEGIN_NAMESPACE \
- namespace NAMESPACE {
+// Begin-Namespace & End-Namespace Macros
+// ======================================
-#define ASMJIT_END_SUB_NAMESPACE \
- } \
- ASMJIT_END_NAMESPACE
+#if !defined(ASMJIT_NO_ABI_NAMESPACE) && !defined(_DOXYGEN)
+ #define ASMJIT_BEGIN_NAMESPACE \
+ ASMJIT_BEGIN_DIAGNOSTIC_SCOPE \
+ namespace asmjit { \
+ inline namespace ASMJIT_ABI_NAMESPACE {
+ #define ASMJIT_END_NAMESPACE \
+ }} \
+ ASMJIT_END_DIAGNOSTIC_SCOPE
+#else
+ #define ASMJIT_BEGIN_NAMESPACE \
+ ASMJIT_BEGIN_DIAGNOSTIC_SCOPE \
+ namespace asmjit {
+ #define ASMJIT_END_NAMESPACE \
+ } \
+ ASMJIT_END_DIAGNOSTIC_SCOPE
+#endif
+
+#define ASMJIT_BEGIN_SUB_NAMESPACE(NAMESPACE) ASMJIT_BEGIN_NAMESPACE namespace NAMESPACE {
+#define ASMJIT_END_SUB_NAMESPACE } ASMJIT_END_NAMESPACE
// C++ Utilities
// =============
@@ -551,34 +606,34 @@ namespace asmjit {
#define ASMJIT_DEFINE_ENUM_FLAGS(T)
#else
#define ASMJIT_DEFINE_ENUM_FLAGS(T) \
- static ASMJIT_FORCE_INLINE constexpr T operator~(T a) noexcept { \
+ static ASMJIT_INLINE_NODEBUG constexpr T operator~(T a) noexcept { \
return T(~(std::underlying_type<T>::type)(a)); \
} \
\
- static ASMJIT_FORCE_INLINE constexpr T operator|(T a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG constexpr T operator|(T a, T b) noexcept { \
return T((std::underlying_type<T>::type)(a) | \
(std::underlying_type<T>::type)(b)); \
} \
- static ASMJIT_FORCE_INLINE constexpr T operator&(T a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG constexpr T operator&(T a, T b) noexcept { \
return T((std::underlying_type<T>::type)(a) & \
(std::underlying_type<T>::type)(b)); \
} \
- static ASMJIT_FORCE_INLINE constexpr T operator^(T a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG constexpr T operator^(T a, T b) noexcept { \
return T((std::underlying_type<T>::type)(a) ^ \
(std::underlying_type<T>::type)(b)); \
} \
\
- static ASMJIT_FORCE_INLINE T& operator|=(T& a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG T& operator|=(T& a, T b) noexcept { \
a = T((std::underlying_type<T>::type)(a) | \
(std::underlying_type<T>::type)(b)); \
return a; \
} \
- static ASMJIT_FORCE_INLINE T& operator&=(T& a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG T& operator&=(T& a, T b) noexcept { \
a = T((std::underlying_type<T>::type)(a) & \
(std::underlying_type<T>::type)(b)); \
return a; \
} \
- static ASMJIT_FORCE_INLINE T& operator^=(T& a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG T& operator^=(T& a, T b) noexcept { \
a = T((std::underlying_type<T>::type)(a) ^ \
(std::underlying_type<T>::type)(b)); \
return a; \
@@ -588,28 +643,22 @@ namespace asmjit {
//! \def ASMJIT_DEFINE_ENUM_COMPARE(T)
//!
//! Defines comparison operations for enumeration flags.
-#ifdef _DOXYGEN
+#if defined(_DOXYGEN) || (defined(_MSC_VER) && _MSC_VER <= 1900)
#define ASMJIT_DEFINE_ENUM_COMPARE(T)
#else
#define ASMJIT_DEFINE_ENUM_COMPARE(T) \
- static ASMJIT_FORCE_INLINE bool operator<(T a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG bool operator<(T a, T b) noexcept { \
return (std::underlying_type<T>::type)(a) < (std::underlying_type<T>::type)(b); \
} \
- static ASMJIT_FORCE_INLINE bool operator<=(T a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG bool operator<=(T a, T b) noexcept { \
return (std::underlying_type<T>::type)(a) <= (std::underlying_type<T>::type)(b); \
} \
- static ASMJIT_FORCE_INLINE bool operator>(T a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG bool operator>(T a, T b) noexcept { \
return (std::underlying_type<T>::type)(a) > (std::underlying_type<T>::type)(b); \
} \
- static ASMJIT_FORCE_INLINE bool operator>=(T a, T b) noexcept { \
+ static ASMJIT_INLINE_NODEBUG bool operator>=(T a, T b) noexcept { \
return (std::underlying_type<T>::type)(a) >= (std::underlying_type<T>::type)(b); \
}
#endif
-// Cleanup Api-Config Specific Macros
-// ==================================
-
-#undef ASMJIT_CXX_GNU
-#undef ASMJIT_CXX_MAKE_VER
-
#endif // ASMJIT_CORE_API_CONFIG_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/core/archcommons.h b/3rdparty/asmjit/src/asmjit/core/archcommons.h
index e9d2c84d722..2b47d17c1b4 100644
--- a/3rdparty/asmjit/src/asmjit/core/archcommons.h
+++ b/3rdparty/asmjit/src/asmjit/core/archcommons.h
@@ -29,8 +29,8 @@ enum class CondCode : uint8_t {
kNE = 0x03u, //!< Z==0 (any_sign !=)
kCS = 0x04u, //!< C==1 (unsigned >=)
kHS = 0x04u, //!< C==1 (unsigned >=)
- kCC = 0x05u, //!< C==0 (unsigned < )
kLO = 0x05u, //!< C==0 (unsigned < )
+ kCC = 0x05u, //!< C==0 (unsigned < )
kMI = 0x06u, //!< N==1 (is negative)
kPL = 0x07u, //!< N==0 (is positive or zero)
kVS = 0x08u, //!< V==1 (is overflow)
@@ -42,21 +42,24 @@ enum class CondCode : uint8_t {
kGT = 0x0Eu, //!< Z==0 & N==V (signed > )
kLE = 0x0Fu, //!< Z==1 | N!=V (signed <=)
- kSign = kMI, //!< Sign.
- kNotSign = kPL, //!< Not sign.
-
- kOverflow = kVS, //!< Signed overflow.
- kNotOverflow = kVC, //!< Not signed overflow.
+ kZero = kEQ, //!< Zero flag (alias to equal).
+ kNotZero = kNE, //!< Not zero (alias to Not Equal).
kEqual = kEQ, //!< Equal `a == b`.
kNotEqual = kNE, //!< Not Equal `a != b`.
- kZero = kEQ, //!< Zero (alias to equal).
- kNotZero = kNE, //!< Not Zero (alias to Not Equal).
+ kCarry = kCS, //!< Carry flag.
+ kNotCarry = kCC, //!< Not carry.
+
+ kSign = kMI, //!< Sign flag.
+ kNotSign = kPL, //!< Not sign.
kNegative = kMI, //!< Negative.
kPositive = kPL, //!< Positive or zero.
+ kOverflow = kVS, //!< Signed overflow.
+ kNotOverflow = kVC, //!< Not signed overflow.
+
kSignedLT = kLT, //!< Signed `a < b`.
kSignedLE = kLE, //!< Signed `a <= b`.
kSignedGT = kGT, //!< Signed `a > b`.
@@ -67,47 +70,51 @@ enum class CondCode : uint8_t {
kUnsignedGT = kHI, //!< Unsigned `a > b`.
kUnsignedGE = kHS, //!< Unsigned `a >= b`.
+ kBTZero = kZero, //!< Tested bit is zero.
+ kBTNotZero = kNotZero, //!< Tested bit is not zero.
+
kAlways = kAL, //!< No condition code (always).
kMaxValue = 0x0Fu //!< Maximum value of `CondCode`.
};
-//! Negates a condition code.
-static inline constexpr CondCode negateCond(CondCode cond) noexcept { return CondCode(uint8_t(cond) ^ uint8_t(1)); }
-//! Data type that can be encoded with the instruction (AArch32 only).
-enum class DataType : uint32_t {
- //! No data type specified (default for all general purpose instructions).
- kNone = 0,
- //! 8-bit signed integer, specified as `.s8` in assembly.
- kS8 = 1,
- //! 16-bit signed integer, specified as `.s16` in assembly.
- kS16 = 2,
- //! 32-bit signed integer, specified as `.s32` in assembly.
- kS32 = 3,
- //! 64-bit signed integer, specified as `.s64` in assembly.
- kS64 = 4,
- //! 8-bit unsigned integer, specified as `.u8` in assembly.
- kU8 = 5,
- //! 16-bit unsigned integer, specified as `.u16` in assembly.
- kU16 = 6,
- //! 32-bit unsigned integer, specified as `.u32` in assembly.
- kU32 = 7,
- //! 64-bit unsigned integer, specified as `.u64` in assembly.
- kU64 = 8,
- //! 16-bit floating point (half precision), specified as `.f16` in assembly.
- kF16 = 10,
- //! 32-bit floating point (single precision), specified as `.f32` in assembly.
- kF32 = 11,
- //! 64-bit floating point (double precision), specified as `.f64` in assembly.
- kF64 = 12,
- //! 8-bit polynomial.
- kP8 = 13,
- //! 64-bit polynomial.
- kP64 = 15,
+//! \cond
+static constexpr CondCode _reverseCondTable[] = {
+ CondCode::kAL, // AL <- AL
+ CondCode::kNA, // NA <- NA
+ CondCode::kEQ, // EQ <- EQ
+ CondCode::kNE, // NE <- NE
+ CondCode::kLS, // LS <- CS
+ CondCode::kHI, // HI <- LO
+ CondCode::kMI, // MI <- MI
+ CondCode::kPL, // PL <- PL
+ CondCode::kVS, // VS <- VS
+ CondCode::kVC, // VC <- VC
+ CondCode::kLO, // LO <- HI
+ CondCode::kCS, // CS <- LS
+ CondCode::kLE, // LE <- GE
+ CondCode::kGT, // GT <- LT
+ CondCode::kLT, // LT <- GT
+ CondCode::kGE // GE <- LE
+};
+//! \endcond
- //! Maximum value of `DataType`.
- kMaxValue = 15
+//! Reverses a condition code (reverses the corresponding operands of a comparison).
+static ASMJIT_INLINE_NODEBUG constexpr CondCode reverseCond(CondCode cond) noexcept { return _reverseCondTable[uint8_t(cond)]; }
+//! Negates a condition code.
+static ASMJIT_INLINE_NODEBUG constexpr CondCode negateCond(CondCode cond) noexcept { return CondCode(uint8_t(cond) ^ uint8_t(1)); }
+
+//! Memory offset mode.
+//!
+//! Describes either fixed, pre-index, or post-index offset modes.
+enum class OffsetMode : uint32_t {
+ //! Fixed offset mode (either no index at all or a regular index without a write-back).
+ kFixed = 0u,
+ //! Pre-index "[BASE, #Offset {, <shift>}]!" with write-back.
+ kPreIndex = 1u,
+ //! Post-index "[BASE], #Offset {, <shift>}" with write-back.
+ kPostIndex = 2u
};
//! Shift operation predicate (ARM) describes either SHIFT or EXTEND operation.
@@ -170,60 +177,85 @@ public:
uint32_t _value;
//! Default constructed Shift is not initialized.
- inline Shift() noexcept = default;
+ ASMJIT_INLINE_NODEBUG Shift() noexcept = default;
//! Copy constructor (default)
- constexpr Shift(const Shift& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG constexpr Shift(const Shift& other) noexcept = default;
//! Constructs Shift from operation `op` and shift `value`.
- constexpr Shift(ShiftOp op, uint32_t value) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Shift(ShiftOp op, uint32_t value) noexcept
: _op(op),
_value(value) {}
//! Returns the shift operation.
- constexpr ShiftOp op() const noexcept { return _op; }
+ ASMJIT_INLINE_NODEBUG constexpr ShiftOp op() const noexcept { return _op; }
//! Sets shift operation to `op`.
- inline void setOp(ShiftOp op) noexcept { _op = op; }
+ ASMJIT_INLINE_NODEBUG void setOp(ShiftOp op) noexcept { _op = op; }
- //! Returns the shift smount.
- constexpr uint32_t value() const noexcept { return _value; }
+ //! Returns the shift amount.
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t value() const noexcept { return _value; }
//! Sets shift amount to `value`.
- inline void setValue(uint32_t value) noexcept { _value = value; }
+ ASMJIT_INLINE_NODEBUG void setValue(uint32_t value) noexcept { _value = value; }
};
-//! Constructs a `LSL #value` shift (logical shift left).
-static constexpr Shift lsl(uint32_t value) noexcept { return Shift(ShiftOp::kLSL, value); }
-//! Constructs a `LSR #value` shift (logical shift right).
-static constexpr Shift lsr(uint32_t value) noexcept { return Shift(ShiftOp::kLSR, value); }
-//! Constructs a `ASR #value` shift (arithmetic shift right).
-static constexpr Shift asr(uint32_t value) noexcept { return Shift(ShiftOp::kASR, value); }
-//! Constructs a `ROR #value` shift (rotate right).
-static constexpr Shift ror(uint32_t value) noexcept { return Shift(ShiftOp::kROR, value); }
-//! Constructs a `RRX` shift (rotate with carry by 1).
-static constexpr Shift rrx() noexcept { return Shift(ShiftOp::kRRX, 0); }
-//! Constructs a `MSL #value` shift (logical shift left filling ones).
-static constexpr Shift msl(uint32_t value) noexcept { return Shift(ShiftOp::kMSL, value); }
-
-//! Constructs a `UXTB #value` extend and shift (unsigned byte extend).
-static constexpr Shift uxtb(uint32_t value) noexcept { return Shift(ShiftOp::kUXTB, value); }
-//! Constructs a `UXTH #value` extend and shift (unsigned hword extend).
-static constexpr Shift uxth(uint32_t value) noexcept { return Shift(ShiftOp::kUXTH, value); }
-//! Constructs a `UXTW #value` extend and shift (unsigned word extend).
-static constexpr Shift uxtw(uint32_t value) noexcept { return Shift(ShiftOp::kUXTW, value); }
-//! Constructs a `UXTX #value` extend and shift (unsigned dword extend).
-static constexpr Shift uxtx(uint32_t value) noexcept { return Shift(ShiftOp::kUXTX, value); }
-
-//! Constructs a `SXTB #value` extend and shift (signed byte extend).
-static constexpr Shift sxtb(uint32_t value) noexcept { return Shift(ShiftOp::kSXTB, value); }
-//! Constructs a `SXTH #value` extend and shift (signed hword extend).
-static constexpr Shift sxth(uint32_t value) noexcept { return Shift(ShiftOp::kSXTH, value); }
-//! Constructs a `SXTW #value` extend and shift (signed word extend).
-static constexpr Shift sxtw(uint32_t value) noexcept { return Shift(ShiftOp::kSXTW, value); }
-//! Constructs a `SXTX #value` extend and shift (signed dword extend).
-static constexpr Shift sxtx(uint32_t value) noexcept { return Shift(ShiftOp::kSXTX, value); }
-
//! \}
ASMJIT_END_SUB_NAMESPACE
+ASMJIT_BEGIN_SUB_NAMESPACE(a32)
+
+using namespace arm;
+
+//! Data type that can be encoded with AArch32 instruction identifier.
+//!
+//! \note Data types are frequently used with AArch32 SIMD instructions. For example `VMAX` instruction can
+//! use almost all datatypes in a form `VMAX.F32`, `VMAX.S16`, `VMAX.U32`, etc... Emitter automatically adds
+//! the required data type at emit level.
+enum class DataType : uint32_t {
+ //! No data type specified (default for all general purpose instructions).
+ kNone = 0,
+ //! 8-bit signed integer, specified as `.s8` in assembly.
+ kS8 = 1,
+ //! 16-bit signed integer, specified as `.s16` in assembly.
+ kS16 = 2,
+ //! 32-bit signed integer, specified as `.s32` in assembly.
+ kS32 = 3,
+ //! 64-bit signed integer, specified as `.s64` in assembly.
+ kS64 = 4,
+ //! 8-bit unsigned integer, specified as `.u8` in assembly.
+ kU8 = 5,
+ //! 16-bit unsigned integer, specified as `.u16` in assembly.
+ kU16 = 6,
+ //! 32-bit unsigned integer, specified as `.u32` in assembly.
+ kU32 = 7,
+ //! 64-bit unsigned integer, specified as `.u64` in assembly.
+ kU64 = 8,
+ //! 16-bit floating point (half precision), specified as `.f16` in assembly.
+ kF16 = 10,
+ //! 32-bit floating point (single precision), specified as `.f32` in assembly.
+ kF32 = 11,
+ //! 64-bit floating point (double precision), specified as `.f64` in assembly.
+ kF64 = 12,
+ //! 8-bit polynomial.
+ kP8 = 13,
+ //! 16-bit BF16 floating point.
+ kBF16 = 14,
+ //! 64-bit polynomial.
+ kP64 = 15,
+
+ //! Maximum value of `DataType`.
+ kMaxValue = 15
+};
+
+static ASMJIT_INLINE_NODEBUG uint32_t dataTypeSize(DataType dt) noexcept {
+ static constexpr uint8_t table[] = { 0, 1, 2, 4, 8, 1, 2, 4, 8, 2, 4, 8, 1, 2, 8 };
+ return table[size_t(dt)];
+}
+
+ASMJIT_END_SUB_NAMESPACE
+
+ASMJIT_BEGIN_SUB_NAMESPACE(a64)
+using namespace arm;
+ASMJIT_END_SUB_NAMESPACE
+
#endif // ASMJIT_CORE_ARCHCOMMONS_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/core/archtraits.cpp b/3rdparty/asmjit/src/asmjit/core/archtraits.cpp
index fc825df8009..a15a00c048b 100644
--- a/3rdparty/asmjit/src/asmjit/core/archtraits.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/archtraits.cpp
@@ -5,6 +5,7 @@
#include "../core/api-build_p.h"
#include "../core/archtraits.h"
+#include "../core/environment.h"
#include "../core/misc_p.h"
#if !defined(ASMJIT_NO_X86)
diff --git a/3rdparty/asmjit/src/asmjit/core/archtraits.h b/3rdparty/asmjit/src/asmjit/core/archtraits.h
index 192a826e511..9f08dea523f 100644
--- a/3rdparty/asmjit/src/asmjit/core/archtraits.h
+++ b/3rdparty/asmjit/src/asmjit/core/archtraits.h
@@ -74,6 +74,9 @@ enum class Arch : uint8_t {
ASMJIT_ARCH_X86 == 32 ? kX86 :
ASMJIT_ARCH_X86 == 64 ? kX64 :
+ ASMJIT_ARCH_RISCV == 32 ? kRISCV32 :
+ ASMJIT_ARCH_RISCV == 64 ? kRISCV64 :
+
ASMJIT_ARCH_ARM == 32 && ASMJIT_ARCH_LE ? kARM :
ASMJIT_ARCH_ARM == 32 && ASMJIT_ARCH_BE ? kARM_BE :
ASMJIT_ARCH_ARM == 64 && ASMJIT_ARCH_LE ? kAArch64 :
@@ -202,50 +205,50 @@ struct ArchTraits {
//! \{
//! Returns stack pointer register id.
- inline uint32_t spRegId() const noexcept { return _spRegId; }
+ ASMJIT_INLINE_NODEBUG uint32_t spRegId() const noexcept { return _spRegId; }
//! Returns stack frame register id.
- inline uint32_t fpRegId() const noexcept { return _fpRegId; }
+ ASMJIT_INLINE_NODEBUG uint32_t fpRegId() const noexcept { return _fpRegId; }
//! Returns link register id, if the architecture provides it.
- inline uint32_t linkRegId() const noexcept { return _linkRegId; }
+ ASMJIT_INLINE_NODEBUG uint32_t linkRegId() const noexcept { return _linkRegId; }
//! Returns instruction pointer register id, if the architecture provides it.
- inline uint32_t ipRegId() const noexcept { return _ipRegId; }
+ ASMJIT_INLINE_NODEBUG uint32_t ipRegId() const noexcept { return _ipRegId; }
//! Returns a hardware stack alignment requirement.
//!
//! \note This is a hardware constraint. Architectures that don't constrain it would return the lowest alignment
//! (1), however, some architectures may constrain the alignment, for example AArch64 requires 16-byte alignment.
- inline uint32_t hwStackAlignment() const noexcept { return _hwStackAlignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t hwStackAlignment() const noexcept { return _hwStackAlignment; }
//! Tests whether the architecture provides link register, which is used across function calls. If the link
//! register is not provided then a function call pushes the return address on stack (X86/X64).
- inline bool hasLinkReg() const noexcept { return _linkRegId != BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG bool hasLinkReg() const noexcept { return _linkRegId != BaseReg::kIdBad; }
//! Returns minimum addressable offset on stack guaranteed for all instructions.
- inline uint32_t minStackOffset() const noexcept { return _minStackOffset; }
+ ASMJIT_INLINE_NODEBUG uint32_t minStackOffset() const noexcept { return _minStackOffset; }
//! Returns maximum addressable offset on stack depending on specific instruction.
- inline uint32_t maxStackOffset() const noexcept { return _maxStackOffset; }
+ ASMJIT_INLINE_NODEBUG uint32_t maxStackOffset() const noexcept { return _maxStackOffset; }
//! Returns ISA flags of the given register `group`.
- inline InstHints instFeatureHints(RegGroup group) const noexcept { return _instHints[group]; }
+ ASMJIT_INLINE_NODEBUG InstHints instFeatureHints(RegGroup group) const noexcept { return _instHints[group]; }
//! Tests whether the given register `group` has the given `flag` set.
- inline bool hasInstHint(RegGroup group, InstHints feature) const noexcept { return Support::test(_instHints[group], feature); }
+ ASMJIT_INLINE_NODEBUG bool hasInstHint(RegGroup group, InstHints feature) const noexcept { return Support::test(_instHints[group], feature); }
//! Tests whether the ISA provides register swap instruction for the given register `group`.
- inline bool hasInstRegSwap(RegGroup group) const noexcept { return hasInstHint(group, InstHints::kRegSwap); }
+ ASMJIT_INLINE_NODEBUG bool hasInstRegSwap(RegGroup group) const noexcept { return hasInstHint(group, InstHints::kRegSwap); }
//! Tests whether the ISA provides push/pop instructions for the given register `group`.
- inline bool hasInstPushPop(RegGroup group) const noexcept { return hasInstHint(group, InstHints::kPushPop); }
+ ASMJIT_INLINE_NODEBUG bool hasInstPushPop(RegGroup group) const noexcept { return hasInstHint(group, InstHints::kPushPop); }
- inline bool hasRegType(RegType type) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool hasRegType(RegType type) const noexcept {
return type <= RegType::kMaxValue && _regSignature[type].isValid();
}
//! Returns an operand signature from the given register `type` of this architecture.
- inline OperandSignature regTypeToSignature(RegType type) const noexcept { return _regSignature[type]; }
+ ASMJIT_INLINE_NODEBUG OperandSignature regTypeToSignature(RegType type) const noexcept { return _regSignature[type]; }
//! Returns a register from the given register `type` of this architecture.
- inline RegGroup regTypeToGroup(RegType type) const noexcept { return _regSignature[type].regGroup(); }
+ ASMJIT_INLINE_NODEBUG RegGroup regTypeToGroup(RegType type) const noexcept { return _regSignature[type].regGroup(); }
//! Returns a register size the given register `type` of this architecture.
- inline uint32_t regTypeToSize(RegType type) const noexcept { return _regSignature[type].size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t regTypeToSize(RegType type) const noexcept { return _regSignature[type].size(); }
//! Returns a corresponding `TypeId` from the given register `type` of this architecture.
- inline TypeId regTypeToTypeId(RegType type) const noexcept { return _regTypeToTypeId[type]; }
+ ASMJIT_INLINE_NODEBUG TypeId regTypeToTypeId(RegType type) const noexcept { return _regTypeToTypeId[type]; }
//! Returns a table of ISA word names that appear in formatted text. Word names are ISA dependent.
//!
@@ -254,10 +257,10 @@ struct ArchTraits {
//! - [1] 16-bits
//! - [2] 32-bits
//! - [3] 64-bits
- inline const ArchTypeNameId* typeNameIdTable() const noexcept { return _typeNameIdTable; }
+ ASMJIT_INLINE_NODEBUG const ArchTypeNameId* typeNameIdTable() const noexcept { return _typeNameIdTable; }
//! Returns an ISA word name identifier of the given `index`, see \ref typeNameIdTable() for more details.
- inline ArchTypeNameId typeNameIdByIndex(uint32_t index) const noexcept { return _typeNameIdTable[index]; }
+ ASMJIT_INLINE_NODEBUG ArchTypeNameId typeNameIdByIndex(uint32_t index) const noexcept { return _typeNameIdTable[index]; }
//! \}
@@ -265,7 +268,7 @@ struct ArchTraits {
//! \{
//! Returns a const reference to `ArchTraits` for the given architecture `arch`.
- static inline const ArchTraits& byArch(Arch arch) noexcept;
+ static ASMJIT_INLINE_NODEBUG const ArchTraits& byArch(Arch arch) noexcept;
//! \}
};
@@ -273,7 +276,7 @@ struct ArchTraits {
ASMJIT_VARAPI const ArchTraits _archTraits[uint32_t(Arch::kMaxValue) + 1];
//! \cond
-inline const ArchTraits& ArchTraits::byArch(Arch arch) noexcept { return _archTraits[uint32_t(arch)]; }
+ASMJIT_INLINE_NODEBUG const ArchTraits& ArchTraits::byArch(Arch arch) noexcept { return _archTraits[uint32_t(arch)]; }
//! \endcond
//! Architecture utilities.
diff --git a/3rdparty/asmjit/src/asmjit/core/assembler.h b/3rdparty/asmjit/src/asmjit/core/assembler.h
index 7ea2505f046..d53d9e53764 100644
--- a/3rdparty/asmjit/src/asmjit/core/assembler.h
+++ b/3rdparty/asmjit/src/asmjit/core/assembler.h
@@ -25,6 +25,7 @@ ASMJIT_BEGIN_NAMESPACE
//! Check out architecture specific assemblers for more details and examples:
//!
//! - \ref x86::Assembler - X86/X64 assembler implementation.
+//! - \ref a64::Assembler - AArch64 assembler implementation.
class ASMJIT_VIRTAPI BaseAssembler : public BaseEmitter {
public:
ASMJIT_NONCOPYABLE(BaseAssembler)
@@ -45,7 +46,7 @@ public:
//! Creates a new `BaseAssembler` instance.
ASMJIT_API BaseAssembler() noexcept;
//! Destroys the `BaseAssembler` instance.
- ASMJIT_API virtual ~BaseAssembler() noexcept;
+ ASMJIT_API ~BaseAssembler() noexcept override;
//! \}
@@ -53,12 +54,12 @@ public:
//! \{
//! Returns the capacity of the current CodeBuffer.
- inline size_t bufferCapacity() const noexcept { return (size_t)(_bufferEnd - _bufferData); }
+ ASMJIT_INLINE_NODEBUG size_t bufferCapacity() const noexcept { return (size_t)(_bufferEnd - _bufferData); }
//! Returns the number of remaining bytes in the current CodeBuffer.
- inline size_t remainingSpace() const noexcept { return (size_t)(_bufferEnd - _bufferPtr); }
+ ASMJIT_INLINE_NODEBUG size_t remainingSpace() const noexcept { return (size_t)(_bufferEnd - _bufferPtr); }
//! Returns the current position in the CodeBuffer.
- inline size_t offset() const noexcept { return (size_t)(_bufferPtr - _bufferData); }
+ ASMJIT_INLINE_NODEBUG size_t offset() const noexcept { return (size_t)(_bufferPtr - _bufferData); }
//! Sets the current position in the CodeBuffer to `offset`.
//!
@@ -67,11 +68,11 @@ public:
ASMJIT_API Error setOffset(size_t offset);
//! Returns the start of the CodeBuffer in the current section.
- inline uint8_t* bufferData() const noexcept { return _bufferData; }
+ ASMJIT_INLINE_NODEBUG uint8_t* bufferData() const noexcept { return _bufferData; }
//! Returns the end (first invalid byte) in the current section.
- inline uint8_t* bufferEnd() const noexcept { return _bufferEnd; }
+ ASMJIT_INLINE_NODEBUG uint8_t* bufferEnd() const noexcept { return _bufferEnd; }
//! Returns the current pointer in the CodeBuffer in the current section.
- inline uint8_t* bufferPtr() const noexcept { return _bufferPtr; }
+ ASMJIT_INLINE_NODEBUG uint8_t* bufferPtr() const noexcept { return _bufferPtr; }
//! \}
@@ -79,7 +80,7 @@ public:
//! \{
//! Returns the current section.
- inline Section* currentSection() const noexcept { return _section; }
+ ASMJIT_INLINE_NODEBUG Section* currentSection() const noexcept { return _section; }
ASMJIT_API Error section(Section* section) override;
diff --git a/3rdparty/asmjit/src/asmjit/core/builder.cpp b/3rdparty/asmjit/src/asmjit/core/builder.cpp
index 5df243e7b8a..25433b9a0d8 100644
--- a/3rdparty/asmjit/src/asmjit/core/builder.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/builder.cpp
@@ -65,7 +65,7 @@ Error BaseBuilder::newInstNode(InstNode** out, InstId instId, InstOptions instOp
if (ASMJIT_UNLIKELY(!node))
return reportError(DebugUtils::errored(kErrorOutOfMemory));
- *out = new(node) InstNode(this, instId, instOptions, opCount, opCapacity);
+ *out = new(Support::PlacementNew{node}) InstNode(this, instId, instOptions, opCount, opCapacity);
return kErrorOk;
}
@@ -151,14 +151,13 @@ BaseNode* BaseBuilder::addNode(BaseNode* node) noexcept {
ASMJIT_ASSERT(!node->isActive());
if (!_cursor) {
- if (!_firstNode) {
- _firstNode = node;
- _lastNode = node;
+ if (_nodeList.empty()) {
+ _nodeList.reset(node, node);
}
else {
- node->_next = _firstNode;
- _firstNode->_prev = node;
- _firstNode = node;
+ node->_next = _nodeList.first();
+ _nodeList._first->_prev = node;
+ _nodeList._first = node;
}
}
else {
@@ -172,7 +171,7 @@ BaseNode* BaseBuilder::addNode(BaseNode* node) noexcept {
if (next)
next->_prev = node;
else
- _lastNode = node;
+ _nodeList._last = node;
}
node->addFlags(NodeFlags::kIsActive);
@@ -201,7 +200,7 @@ BaseNode* BaseBuilder::addAfter(BaseNode* node, BaseNode* ref) noexcept {
if (next)
next->_prev = node;
else
- _lastNode = node;
+ _nodeList._last = node;
return node;
}
@@ -226,7 +225,7 @@ BaseNode* BaseBuilder::addBefore(BaseNode* node, BaseNode* ref) noexcept {
if (prev)
prev->_next = node;
else
- _firstNode = node;
+ _nodeList._first = node;
return node;
}
@@ -238,13 +237,13 @@ BaseNode* BaseBuilder::removeNode(BaseNode* node) noexcept {
BaseNode* prev = node->prev();
BaseNode* next = node->next();
- if (_firstNode == node)
- _firstNode = next;
+ if (_nodeList._first == node)
+ _nodeList._first = next;
else
prev->_next = next;
- if (_lastNode == node)
- _lastNode = prev;
+ if (_nodeList._last == node)
+ _nodeList._last = prev;
else
next->_prev = prev;
@@ -272,13 +271,13 @@ void BaseBuilder::removeNodes(BaseNode* first, BaseNode* last) noexcept {
BaseNode* prev = first->prev();
BaseNode* next = last->next();
- if (_firstNode == first)
- _firstNode = next;
+ if (_nodeList._first == first)
+ _nodeList._first = next;
else
prev->_next = next;
- if (_lastNode == last)
- _lastNode = prev;
+ if (_nodeList._last == last)
+ _nodeList._last = prev;
else
next->_prev = prev;
@@ -368,7 +367,7 @@ Error BaseBuilder::section(Section* section) {
if (node->_nextSection)
_cursor = node->_nextSection->_prev;
else
- _cursor = _lastNode;
+ _cursor = _nodeList.last();
}
return kErrorOk;
@@ -378,7 +377,7 @@ void BaseBuilder::updateSectionLinks() noexcept {
if (!_dirtySectionLinks)
return;
- BaseNode* node_ = _firstNode;
+ BaseNode* node_ = _nodeList.first();
SectionNode* currentSection = nullptr;
while (node_) {
@@ -591,13 +590,15 @@ Error BaseBuilder::_emit(InstId instId, const Operand_& o0, const Operand_& o1,
EmitterUtils::opArrayFromEmitArgs(opArray, o0, o1, o2, opExt);
ValidationFlags validationFlags = isCompiler() ? ValidationFlags::kEnableVirtRegs : ValidationFlags::kNone;
- Error err = _funcs.validate(arch(), BaseInst(instId, options, _extraReg), opArray, opCount, validationFlags);
+ Error err = _funcs.validate(BaseInst(instId, options, _extraReg), opArray, opCount, validationFlags);
if (ASMJIT_UNLIKELY(err)) {
- resetInstOptions();
- resetExtraReg();
- resetInlineComment();
+#ifndef ASMJIT_NO_LOGGING
+ return EmitterUtils::logInstructionFailed(this, err, instId, options, o0, o1, o2, opExt);
+#else
+ resetState();
return reportError(err);
+#endif
}
}
#endif
@@ -620,7 +621,7 @@ Error BaseBuilder::_emit(InstId instId, const Operand_& o0, const Operand_& o1,
return reportError(DebugUtils::errored(kErrorOutOfMemory));
}
- node = new(node) InstNode(this, instId, options, opCount, opCapacity);
+ node = new(Support::PlacementNew{node}) InstNode(this, instId, options, opCount, opCapacity);
node->setExtraReg(extraReg());
node->setOp(0, o0);
node->setOp(1, o1);
@@ -756,7 +757,7 @@ Error BaseBuilder::comment(const char* data, size_t size) {
Error BaseBuilder::serializeTo(BaseEmitter* dst) {
Error err = kErrorOk;
- BaseNode* node_ = _firstNode;
+ BaseNode* node_ = _nodeList.first();
Operand_ opArray[Globals::kMaxOpCount];
@@ -852,8 +853,7 @@ Error BaseBuilder::onAttach(CodeHolder* code) noexcept {
ASMJIT_ASSUME(initialSection != nullptr);
_cursor = initialSection;
- _firstNode = initialSection;
- _lastNode = initialSection;
+ _nodeList.reset(initialSection, initialSection);
initialSection->setFlags(NodeFlags::kIsActive);
return kErrorOk;
@@ -871,8 +871,7 @@ Error BaseBuilder::onDetach(CodeHolder* code) noexcept {
_nodeFlags = NodeFlags::kNone;
_cursor = nullptr;
- _firstNode = nullptr;
- _lastNode = nullptr;
+ _nodeList.reset();
return Base::onDetach(code);
}
@@ -884,6 +883,15 @@ Pass::Pass(const char* name) noexcept
: _name(name) {}
Pass::~Pass() noexcept {}
+// Pass - Interface
+// ================
+
+// [[pure virtual]]
+Error Pass::run(Zone* zone, Logger* logger) {
+ DebugUtils::unused(zone, logger);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
ASMJIT_END_NAMESPACE
#endif // !ASMJIT_NO_BUILDER
diff --git a/3rdparty/asmjit/src/asmjit/core/builder.h b/3rdparty/asmjit/src/asmjit/core/builder.h
index 3575de2fbb8..0de19234cb6 100644
--- a/3rdparty/asmjit/src/asmjit/core/builder.h
+++ b/3rdparty/asmjit/src/asmjit/core/builder.h
@@ -48,7 +48,7 @@ enum class NodeType : uint8_t {
// [BaseBuilder]
- //! Node is \ref InstNode or \ref InstExNode.
+ //! Node is \ref InstNode.
kInst = 1,
//! Node is \ref SectionNode.
kSection = 2,
@@ -109,7 +109,7 @@ enum class NodeFlags : uint8_t {
};
ASMJIT_DEFINE_ENUM_FLAGS(NodeFlags)
-//! Type of the sentinel (purery informative purpose).
+//! Type of the sentinel (purely informative purpose).
enum class SentinelType : uint8_t {
//! Type of the sentinel is not known.
kUnknown = 0u,
@@ -117,6 +117,60 @@ enum class SentinelType : uint8_t {
kFuncEnd = 1u
};
+//! Node list.
+//!
+//! A double-linked list of pointers to \ref BaseNode, managed by \ref BaseBuilder or \ref BaseCompiler.
+//!
+//! \note At the moment NodeList is just a view, but it's planned that it will get more functionality in the future.
+class NodeList {
+public:
+ //! \name Members
+ //! \{
+
+ //! First node in the list or nullptr if there are no nodes in the list.
+ BaseNode* _first = nullptr;
+ //! Last node in the list or nullptr if there are no nodes in the list.
+ BaseNode* _last = nullptr;
+
+ //! \}
+
+ //! \name Construction & Destruction
+ //! \{
+
+ ASMJIT_INLINE_NODEBUG NodeList() noexcept {}
+
+ ASMJIT_INLINE_NODEBUG NodeList(BaseNode* first, BaseNode* last) noexcept
+ : _first(first),
+ _last(last) {}
+
+ //! \}
+
+ //! \name Reset
+ //! \{
+
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
+ _first = nullptr;
+ _last = nullptr;
+ }
+
+ ASMJIT_INLINE_NODEBUG void reset(BaseNode* first, BaseNode* last) noexcept {
+ _first = first;
+ _last = last;
+ }
+
+ //! \}
+
+ //! \name Accessors
+ //! \{
+
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _first == nullptr; }
+
+ ASMJIT_INLINE_NODEBUG BaseNode* first() const noexcept { return _first; }
+ ASMJIT_INLINE_NODEBUG BaseNode* last() const noexcept { return _last; }
+
+ //! \}
+};
+
//! Builder interface.
//!
//! `BaseBuilder` interface was designed to be used as a \ref BaseAssembler replacement in case pre-processing or
@@ -127,6 +181,7 @@ enum class SentinelType : uint8_t {
//! Check out architecture specific builders for more details and examples:
//!
//! - \ref x86::Builder - X86/X64 builder implementation.
+//! - \ref a64::Builder - AArch64 builder implementation.
class ASMJIT_VIRTAPI BaseBuilder : public BaseEmitter {
public:
ASMJIT_NONCOPYABLE(BaseBuilder)
@@ -153,10 +208,8 @@ public:
//! Current node (cursor).
BaseNode* _cursor = nullptr;
- //! First node of the current section.
- BaseNode* _firstNode = nullptr;
- //! Last node of the current section.
- BaseNode* _lastNode = nullptr;
+ //! First and last nodes.
+ NodeList _nodeList;
//! Flags assigned to each new node.
NodeFlags _nodeFlags = NodeFlags::kNone;
@@ -171,17 +224,19 @@ public:
//! Creates a new `BaseBuilder` instance.
ASMJIT_API BaseBuilder() noexcept;
//! Destroys the `BaseBuilder` instance.
- ASMJIT_API virtual ~BaseBuilder() noexcept;
+ ASMJIT_API ~BaseBuilder() noexcept override;
//! \}
//! \name Node Management
//! \{
+ ASMJIT_INLINE_NODEBUG NodeList nodeList() const noexcept { return _nodeList; }
+
//! Returns the first node.
- inline BaseNode* firstNode() const noexcept { return _firstNode; }
+ ASMJIT_INLINE_NODEBUG BaseNode* firstNode() const noexcept { return _nodeList.first(); }
//! Returns the last node.
- inline BaseNode* lastNode() const noexcept { return _lastNode; }
+ ASMJIT_INLINE_NODEBUG BaseNode* lastNode() const noexcept { return _nodeList.last(); }
//! Allocates and instantiates a new node of type `T` and returns its instance. If the allocation fails `nullptr`
//! is returned.
@@ -227,7 +282,7 @@ public:
//! When the Builder/Compiler is created it automatically creates a '.text' \ref SectionNode, which will be the
//! initial one. When instructions are added they are always added after the cursor and the cursor is changed
//! to be that newly added node. Use `setCursor()` to change where new nodes are inserted.
- inline BaseNode* cursor() const noexcept { return _cursor; }
+ ASMJIT_INLINE_NODEBUG BaseNode* cursor() const noexcept { return _cursor; }
//! Sets the current node to `node` and return the previous one.
ASMJIT_API BaseNode* setCursor(BaseNode* node) noexcept;
@@ -236,7 +291,7 @@ public:
//!
//! Only use this function if you are concerned about performance and want this inlined (for example if you set
//! the cursor in a loop, etc...).
- inline void _setCursor(BaseNode* node) noexcept { _cursor = node; }
+ ASMJIT_INLINE_NODEBUG void _setCursor(BaseNode* node) noexcept { _cursor = node; }
//! \}
@@ -247,12 +302,12 @@ public:
//!
//! \note If a section of some id is not associated with the Builder/Compiler it would be null, so always check
//! for nulls if you iterate over the vector.
- inline const ZoneVector<SectionNode*>& sectionNodes() const noexcept {
+ ASMJIT_INLINE_NODEBUG const ZoneVector<SectionNode*>& sectionNodes() const noexcept {
return _sectionNodes;
}
//! Tests whether the `SectionNode` of the given `sectionId` was registered.
- inline bool hasRegisteredSectionNode(uint32_t sectionId) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool hasRegisteredSectionNode(uint32_t sectionId) const noexcept {
return sectionId < _sectionNodes.size() && _sectionNodes[sectionId] != nullptr;
}
@@ -266,7 +321,7 @@ public:
//! Returns whether the section links of active section nodes are dirty. You can update these links by calling
//! `updateSectionLinks()` in such case.
- inline bool hasDirtySectionLinks() const noexcept { return _dirtySectionLinks; }
+ ASMJIT_INLINE_NODEBUG bool hasDirtySectionLinks() const noexcept { return _dirtySectionLinks; }
//! Updates links of all active section nodes.
ASMJIT_API void updateSectionLinks() noexcept;
@@ -280,15 +335,15 @@ public:
//!
//! \note If a label of some id is not associated with the Builder/Compiler it would be null, so always check for
//! nulls if you iterate over the vector.
- inline const ZoneVector<LabelNode*>& labelNodes() const noexcept { return _labelNodes; }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<LabelNode*>& labelNodes() const noexcept { return _labelNodes; }
//! Tests whether the `LabelNode` of the given `labelId` was registered.
- inline bool hasRegisteredLabelNode(uint32_t labelId) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool hasRegisteredLabelNode(uint32_t labelId) const noexcept {
return labelId < _labelNodes.size() && _labelNodes[labelId] != nullptr;
}
//! \overload
- inline bool hasRegisteredLabelNode(const Label& label) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool hasRegisteredLabelNode(const Label& label) const noexcept {
return hasRegisteredLabelNode(label.id());
}
@@ -299,7 +354,7 @@ public:
ASMJIT_API Error labelNodeOf(LabelNode** ASMJIT_NONNULL(out), uint32_t labelId);
//! \overload
- inline Error labelNodeOf(LabelNode** ASMJIT_NONNULL(out), const Label& label) {
+ ASMJIT_INLINE_NODEBUG Error labelNodeOf(LabelNode** ASMJIT_NONNULL(out), const Label& label) {
return labelNodeOf(out, label.id());
}
@@ -319,7 +374,7 @@ public:
//! \{
//! Returns a vector of `Pass` instances that will be executed by `runPasses()`.
- inline const ZoneVector<Pass*>& passes() const noexcept { return _passes; }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<Pass*>& passes() const noexcept { return _passes; }
//! Allocates and instantiates a new pass of type `T` and returns its instance. If the allocation fails `nullptr` is
//! returned.
@@ -492,7 +547,7 @@ public:
uint8_t _reserved1;
};
- //! Data that can have different meaning dependning on \ref NodeType.
+ //! Data that can have different meaning depending on \ref NodeType.
union {
//! Data useful by any node type.
AnyData _any;
@@ -529,7 +584,7 @@ public:
//! \{
//! Creates a new `BaseNode` - always use `BaseBuilder` to allocate nodes.
- inline BaseNode(BaseBuilder* cb, NodeType nodeType, NodeFlags nodeFlags = NodeFlags::kNone) noexcept {
+ ASMJIT_INLINE_NODEBUG BaseNode(BaseBuilder* cb, NodeType nodeType, NodeFlags nodeFlags = NodeFlags::kNone) noexcept {
_prev = nullptr;
_next = nullptr;
_any._nodeType = nodeType;
@@ -549,85 +604,85 @@ public:
//! Casts this node to `T*`.
template<typename T>
- inline T* as() noexcept { return static_cast<T*>(this); }
+ ASMJIT_INLINE_NODEBUG T* as() noexcept { return static_cast<T*>(this); }
//! Casts this node to `const T*`.
template<typename T>
- inline const T* as() const noexcept { return static_cast<const T*>(this); }
+ ASMJIT_INLINE_NODEBUG const T* as() const noexcept { return static_cast<const T*>(this); }
//! Returns previous node or `nullptr` if this node is either first or not
//! part of Builder/Compiler node-list.
- inline BaseNode* prev() const noexcept { return _prev; }
+ ASMJIT_INLINE_NODEBUG BaseNode* prev() const noexcept { return _prev; }
//! Returns next node or `nullptr` if this node is either last or not part
//! of Builder/Compiler node-list.
- inline BaseNode* next() const noexcept { return _next; }
+ ASMJIT_INLINE_NODEBUG BaseNode* next() const noexcept { return _next; }
//! Returns the type of the node, see `NodeType`.
- inline NodeType type() const noexcept { return _any._nodeType; }
+ ASMJIT_INLINE_NODEBUG NodeType type() const noexcept { return _any._nodeType; }
//! Sets the type of the node, see `NodeType` (internal).
//!
//! \remarks You should never set a type of a node to anything else than the initial value. This function is only
//! provided for users that use custom nodes and need to change the type either during construction or later.
- inline void setType(NodeType type) noexcept { _any._nodeType = type; }
+ ASMJIT_INLINE_NODEBUG void setType(NodeType type) noexcept { _any._nodeType = type; }
//! Tests whether this node is either `InstNode` or extends it.
- inline bool isInst() const noexcept { return hasFlag(NodeFlags::kActsAsInst); }
+ ASMJIT_INLINE_NODEBUG bool isInst() const noexcept { return hasFlag(NodeFlags::kActsAsInst); }
//! Tests whether this node is `SectionNode`.
- inline bool isSection() const noexcept { return type() == NodeType::kSection; }
+ ASMJIT_INLINE_NODEBUG bool isSection() const noexcept { return type() == NodeType::kSection; }
//! Tests whether this node is either `LabelNode` or extends it.
- inline bool isLabel() const noexcept { return hasFlag(NodeFlags::kActsAsLabel); }
+ ASMJIT_INLINE_NODEBUG bool isLabel() const noexcept { return hasFlag(NodeFlags::kActsAsLabel); }
//! Tests whether this node is `AlignNode`.
- inline bool isAlign() const noexcept { return type() == NodeType::kAlign; }
+ ASMJIT_INLINE_NODEBUG bool isAlign() const noexcept { return type() == NodeType::kAlign; }
//! Tests whether this node is `EmbedDataNode`.
- inline bool isEmbedData() const noexcept { return type() == NodeType::kEmbedData; }
+ ASMJIT_INLINE_NODEBUG bool isEmbedData() const noexcept { return type() == NodeType::kEmbedData; }
//! Tests whether this node is `EmbedLabelNode`.
- inline bool isEmbedLabel() const noexcept { return type() == NodeType::kEmbedLabel; }
+ ASMJIT_INLINE_NODEBUG bool isEmbedLabel() const noexcept { return type() == NodeType::kEmbedLabel; }
//! Tests whether this node is `EmbedLabelDeltaNode`.
- inline bool isEmbedLabelDelta() const noexcept { return type() == NodeType::kEmbedLabelDelta; }
+ ASMJIT_INLINE_NODEBUG bool isEmbedLabelDelta() const noexcept { return type() == NodeType::kEmbedLabelDelta; }
//! Tests whether this node is `ConstPoolNode`.
- inline bool isConstPool() const noexcept { return type() == NodeType::kConstPool; }
+ ASMJIT_INLINE_NODEBUG bool isConstPool() const noexcept { return type() == NodeType::kConstPool; }
//! Tests whether this node is `CommentNode`.
- inline bool isComment() const noexcept { return type() == NodeType::kComment; }
+ ASMJIT_INLINE_NODEBUG bool isComment() const noexcept { return type() == NodeType::kComment; }
//! Tests whether this node is `SentinelNode`.
- inline bool isSentinel() const noexcept { return type() == NodeType::kSentinel; }
+ ASMJIT_INLINE_NODEBUG bool isSentinel() const noexcept { return type() == NodeType::kSentinel; }
//! Tests whether this node is `FuncNode`.
- inline bool isFunc() const noexcept { return type() == NodeType::kFunc; }
+ ASMJIT_INLINE_NODEBUG bool isFunc() const noexcept { return type() == NodeType::kFunc; }
//! Tests whether this node is `FuncRetNode`.
- inline bool isFuncRet() const noexcept { return type() == NodeType::kFuncRet; }
+ ASMJIT_INLINE_NODEBUG bool isFuncRet() const noexcept { return type() == NodeType::kFuncRet; }
//! Tests whether this node is `InvokeNode`.
- inline bool isInvoke() const noexcept { return type() == NodeType::kInvoke; }
+ ASMJIT_INLINE_NODEBUG bool isInvoke() const noexcept { return type() == NodeType::kInvoke; }
//! Returns the node flags.
- inline NodeFlags flags() const noexcept { return _any._nodeFlags; }
+ ASMJIT_INLINE_NODEBUG NodeFlags flags() const noexcept { return _any._nodeFlags; }
//! Tests whether the node has the given `flag` set.
- inline bool hasFlag(NodeFlags flag) const noexcept { return Support::test(_any._nodeFlags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(NodeFlags flag) const noexcept { return Support::test(_any._nodeFlags, flag); }
//! Replaces node flags with `flags`.
- inline void setFlags(NodeFlags flags) noexcept { _any._nodeFlags = flags; }
+ ASMJIT_INLINE_NODEBUG void setFlags(NodeFlags flags) noexcept { _any._nodeFlags = flags; }
//! Adds the given `flags` to node flags.
- inline void addFlags(NodeFlags flags) noexcept { _any._nodeFlags |= flags; }
+ ASMJIT_INLINE_NODEBUG void addFlags(NodeFlags flags) noexcept { _any._nodeFlags |= flags; }
//! Clears the given `flags` from node flags.
- inline void clearFlags(NodeFlags flags) noexcept { _any._nodeFlags &= ~flags; }
+ ASMJIT_INLINE_NODEBUG void clearFlags(NodeFlags flags) noexcept { _any._nodeFlags &= ~flags; }
//! Tests whether the node is code that can be executed.
- inline bool isCode() const noexcept { return hasFlag(NodeFlags::kIsCode); }
+ ASMJIT_INLINE_NODEBUG bool isCode() const noexcept { return hasFlag(NodeFlags::kIsCode); }
//! Tests whether the node is data that cannot be executed.
- inline bool isData() const noexcept { return hasFlag(NodeFlags::kIsData); }
+ ASMJIT_INLINE_NODEBUG bool isData() const noexcept { return hasFlag(NodeFlags::kIsData); }
//! Tests whether the node is informative only (is never encoded like comment, etc...).
- inline bool isInformative() const noexcept { return hasFlag(NodeFlags::kIsInformative); }
+ ASMJIT_INLINE_NODEBUG bool isInformative() const noexcept { return hasFlag(NodeFlags::kIsInformative); }
//! Tests whether the node is removable if it's in an unreachable code block.
- inline bool isRemovable() const noexcept { return hasFlag(NodeFlags::kIsRemovable); }
+ ASMJIT_INLINE_NODEBUG bool isRemovable() const noexcept { return hasFlag(NodeFlags::kIsRemovable); }
//! Tests whether the node has no effect when executed (label, .align, nop, ...).
- inline bool hasNoEffect() const noexcept { return hasFlag(NodeFlags::kHasNoEffect); }
+ ASMJIT_INLINE_NODEBUG bool hasNoEffect() const noexcept { return hasFlag(NodeFlags::kHasNoEffect); }
//! Tests whether the node is part of the code.
- inline bool isActive() const noexcept { return hasFlag(NodeFlags::kIsActive); }
+ ASMJIT_INLINE_NODEBUG bool isActive() const noexcept { return hasFlag(NodeFlags::kIsActive); }
//! Tests whether the node has a position assigned.
//!
//! \remarks Returns `true` if node position is non-zero.
- inline bool hasPosition() const noexcept { return _position != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasPosition() const noexcept { return _position != 0; }
//! Returns node position.
- inline uint32_t position() const noexcept { return _position; }
+ ASMJIT_INLINE_NODEBUG uint32_t position() const noexcept { return _position; }
//! Sets node position.
//!
//! Node position is a 32-bit unsigned integer that is used by Compiler to track where the node is relatively to
@@ -636,49 +691,50 @@ public:
//!
//! If you don't use Compiler then you may use `position()` and `setPosition()` freely for your own purposes if
//! the 32-bit value limit is okay for you.
- inline void setPosition(uint32_t position) noexcept { _position = position; }
+ ASMJIT_INLINE_NODEBUG void setPosition(uint32_t position) noexcept { _position = position; }
//! Returns user data casted to `T*`.
//!
- //! User data is decicated to be used only by AsmJit users and not touched by the library. The data has a pointer
- //! size so you can either store a pointer or `intptr_t` value through `setUserDataAsIntPtr()`.
+ //! User data is dedicated to be used only by AsmJit users and not touched by the library. The data is of a pointer
+ //! size so you can either store a pointer or `int64_t` value through `setUserDataAsPtr()`, `setUserDataAsInt64()`
+ //! and `setUserDataAsUInt64()`.
template<typename T>
- inline T* userDataAsPtr() const noexcept { return static_cast<T*>(_userDataPtr); }
+ ASMJIT_INLINE_NODEBUG T* userDataAsPtr() const noexcept { return static_cast<T*>(_userDataPtr); }
//! Returns user data casted to `int64_t`.
- inline int64_t userDataAsInt64() const noexcept { return int64_t(_userDataU64); }
+ ASMJIT_INLINE_NODEBUG int64_t userDataAsInt64() const noexcept { return int64_t(_userDataU64); }
//! Returns user data casted to `uint64_t`.
- inline uint64_t userDataAsUInt64() const noexcept { return _userDataU64; }
+ ASMJIT_INLINE_NODEBUG uint64_t userDataAsUInt64() const noexcept { return _userDataU64; }
//! Sets user data to `data`.
template<typename T>
- inline void setUserDataAsPtr(T* data) noexcept { _userDataPtr = static_cast<void*>(data); }
+ ASMJIT_INLINE_NODEBUG void setUserDataAsPtr(T* data) noexcept { _userDataPtr = static_cast<void*>(data); }
//! Sets used data to the given 64-bit signed `value`.
- inline void setUserDataAsInt64(int64_t value) noexcept { _userDataU64 = uint64_t(value); }
+ ASMJIT_INLINE_NODEBUG void setUserDataAsInt64(int64_t value) noexcept { _userDataU64 = uint64_t(value); }
//! Sets used data to the given 64-bit unsigned `value`.
- inline void setUserDataAsUInt64(uint64_t value) noexcept { _userDataU64 = value; }
+ ASMJIT_INLINE_NODEBUG void setUserDataAsUInt64(uint64_t value) noexcept { _userDataU64 = value; }
//! Resets user data to zero / nullptr.
- inline void resetUserData() noexcept { _userDataU64 = 0; }
+ ASMJIT_INLINE_NODEBUG void resetUserData() noexcept { _userDataU64 = 0; }
//! Tests whether the node has an associated pass data.
- inline bool hasPassData() const noexcept { return _passData != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasPassData() const noexcept { return _passData != nullptr; }
//! Returns the node pass data - data used during processing & transformations.
template<typename T>
- inline T* passData() const noexcept { return (T*)_passData; }
+ ASMJIT_INLINE_NODEBUG T* passData() const noexcept { return (T*)_passData; }
//! Sets the node pass data to `data`.
template<typename T>
- inline void setPassData(T* data) noexcept { _passData = (void*)data; }
+ ASMJIT_INLINE_NODEBUG void setPassData(T* data) noexcept { _passData = (void*)data; }
//! Resets the node pass data to nullptr.
- inline void resetPassData() noexcept { _passData = nullptr; }
+ ASMJIT_INLINE_NODEBUG void resetPassData() noexcept { _passData = nullptr; }
//! Tests whether the node has an inline comment/annotation.
- inline bool hasInlineComment() const noexcept { return _inlineComment != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasInlineComment() const noexcept { return _inlineComment != nullptr; }
//! Returns an inline comment/annotation string.
- inline const char* inlineComment() const noexcept { return _inlineComment; }
+ ASMJIT_INLINE_NODEBUG const char* inlineComment() const noexcept { return _inlineComment; }
//! Sets an inline comment/annotation string to `s`.
- inline void setInlineComment(const char* s) noexcept { _inlineComment = s; }
+ ASMJIT_INLINE_NODEBUG void setInlineComment(const char* s) noexcept { _inlineComment = s; }
//! Resets an inline comment/annotation string to nullptr.
- inline void resetInlineComment() noexcept { _inlineComment = nullptr; }
+ ASMJIT_INLINE_NODEBUG void resetInlineComment() noexcept { _inlineComment = nullptr; }
//! \}
};
@@ -693,12 +749,15 @@ public:
//! \name Constants
//! \{
- enum : uint32_t {
- //! Count of embedded operands per `InstNode` that are always allocated as a part of the instruction. Minimum
- //! embedded operands is 4, but in 32-bit more pointers are smaller and we can embed 5. The rest (up to 6 operands)
- //! is always stored in `InstExNode`.
- kBaseOpCapacity = uint32_t((128 - sizeof(BaseNode) - sizeof(BaseInst)) / sizeof(Operand_))
- };
+ //! The number of embedded operands for a default \ref InstNode instance that are always allocated as a part of
+ //! the instruction itself. Minimum embedded operands is 4, but in 32-bit more pointers are smaller and we can
+ //! embed 5. The rest (up to 6 operands) is considered extended.
+ //!
+ //! The number of operands InstNode holds is decided when \ref InstNode is created.
+ static constexpr uint32_t kBaseOpCapacity = uint32_t((128 - sizeof(BaseNode) - sizeof(BaseInst)) / sizeof(Operand_));
+
+ //! Count of maximum number of operands \ref InstNode can hold.
+ static constexpr uint32_t kFullOpCapacity = Globals::kMaxOpCount;
//! \}
@@ -707,8 +766,6 @@ public:
//! Base instruction data.
BaseInst _baseInst;
- //! First 4 or 5 operands (indexed from 0).
- Operand_ _opArray[kBaseOpCapacity];
//! \}
@@ -716,7 +773,7 @@ public:
//! \{
//! Creates a new `InstNode` instance.
- inline InstNode(BaseBuilder* cb, InstId instId, InstOptions options, uint32_t opCount, uint32_t opCapacity = kBaseOpCapacity) noexcept
+ ASMJIT_INLINE_NODEBUG InstNode(BaseBuilder* cb, InstId instId, InstOptions options, uint32_t opCount, uint32_t opCapacity = kBaseOpCapacity) noexcept
: BaseNode(cb, NodeType::kInst, NodeFlags::kIsCode | NodeFlags::kIsRemovable | NodeFlags::kActsAsInst),
_baseInst(instId, options) {
_inst._opCapacity = uint8_t(opCapacity);
@@ -725,7 +782,7 @@ public:
//! \cond INTERNAL
//! Reset all built-in operands, including `extraReg`.
- inline void _resetOps() noexcept {
+ ASMJIT_INLINE_NODEBUG void _resetOps() noexcept {
_baseInst.resetExtraReg();
resetOpRange(0, opCapacity());
}
@@ -736,8 +793,8 @@ public:
//! \name Instruction Object
//! \{
- inline BaseInst& baseInst() noexcept { return _baseInst; }
- inline const BaseInst& baseInst() const noexcept { return _baseInst; }
+ ASMJIT_INLINE_NODEBUG BaseInst& baseInst() noexcept { return _baseInst; }
+ ASMJIT_INLINE_NODEBUG const BaseInst& baseInst() const noexcept { return _baseInst; }
//! \}
@@ -745,24 +802,30 @@ public:
//! \{
//! Returns the instruction id, see `BaseInst::Id`.
- inline InstId id() const noexcept { return _baseInst.id(); }
+ ASMJIT_INLINE_NODEBUG InstId id() const noexcept { return _baseInst.id(); }
//! Returns the instruction real id, see `BaseInst::Id`.
- inline InstId realId() const noexcept { return _baseInst.realId(); }
+ ASMJIT_INLINE_NODEBUG InstId realId() const noexcept { return _baseInst.realId(); }
//! Sets the instruction id to `id`, see `BaseInst::Id`.
- inline void setId(InstId id) noexcept { _baseInst.setId(id); }
+ ASMJIT_INLINE_NODEBUG void setId(InstId id) noexcept { _baseInst.setId(id); }
//! \}
//! \name Instruction Options
//! \{
- inline InstOptions options() const noexcept { return _baseInst.options(); }
- inline bool hasOption(InstOptions option) const noexcept { return _baseInst.hasOption(option); }
- inline void setOptions(InstOptions options) noexcept { _baseInst.setOptions(options); }
- inline void addOptions(InstOptions options) noexcept { _baseInst.addOptions(options); }
- inline void clearOptions(InstOptions options) noexcept { _baseInst.clearOptions(options); }
- inline void resetOptions() noexcept { _baseInst.resetOptions(); }
+ //! Returns instruction options, see \ref InstOptions for more details.
+ ASMJIT_INLINE_NODEBUG InstOptions options() const noexcept { return _baseInst.options(); }
+ //! Tests whether instruction has the given \option` set/enabled.
+ ASMJIT_INLINE_NODEBUG bool hasOption(InstOptions option) const noexcept { return _baseInst.hasOption(option); }
+ //! Sets instruction `options` to the provided value, resetting all others.
+ ASMJIT_INLINE_NODEBUG void setOptions(InstOptions options) noexcept { _baseInst.setOptions(options); }
+ //! Adds instruction `options` to the instruction.
+ ASMJIT_INLINE_NODEBUG void addOptions(InstOptions options) noexcept { _baseInst.addOptions(options); }
+ //! Clears instruction `options` of the instruction (disables the given options).
+ ASMJIT_INLINE_NODEBUG void clearOptions(InstOptions options) noexcept { _baseInst.clearOptions(options); }
+ //! Resets instruction options to none - disabling all instruction options.
+ ASMJIT_INLINE_NODEBUG void resetOptions() noexcept { _baseInst.resetOptions(); }
//! \}
@@ -770,17 +833,17 @@ public:
//! \{
//! Tests whether the node has an extra register operand.
- inline bool hasExtraReg() const noexcept { return _baseInst.hasExtraReg(); }
+ ASMJIT_INLINE_NODEBUG bool hasExtraReg() const noexcept { return _baseInst.hasExtraReg(); }
//! Returns extra register operand.
- inline RegOnly& extraReg() noexcept { return _baseInst.extraReg(); }
+ ASMJIT_INLINE_NODEBUG RegOnly& extraReg() noexcept { return _baseInst.extraReg(); }
//! \overload
- inline const RegOnly& extraReg() const noexcept { return _baseInst.extraReg(); }
+ ASMJIT_INLINE_NODEBUG const RegOnly& extraReg() const noexcept { return _baseInst.extraReg(); }
//! Sets extra register operand to `reg`.
- inline void setExtraReg(const BaseReg& reg) noexcept { _baseInst.setExtraReg(reg); }
+ ASMJIT_INLINE_NODEBUG void setExtraReg(const BaseReg& reg) noexcept { _baseInst.setExtraReg(reg); }
//! Sets extra register operand to `reg`.
- inline void setExtraReg(const RegOnly& reg) noexcept { _baseInst.setExtraReg(reg); }
+ ASMJIT_INLINE_NODEBUG void setExtraReg(const RegOnly& reg) noexcept { _baseInst.setExtraReg(reg); }
//! Resets extra register operand.
- inline void resetExtraReg() noexcept { _baseInst.resetExtraReg(); }
+ ASMJIT_INLINE_NODEBUG void resetExtraReg() noexcept { _baseInst.resetExtraReg(); }
//! \}
@@ -788,46 +851,60 @@ public:
//! \{
//! Returns operand count.
- inline uint32_t opCount() const noexcept { return _inst._opCount; }
+ ASMJIT_INLINE_NODEBUG uint32_t opCount() const noexcept { return _inst._opCount; }
//! Returns operand capacity.
- inline uint32_t opCapacity() const noexcept { return _inst._opCapacity; }
+ ASMJIT_INLINE_NODEBUG uint32_t opCapacity() const noexcept { return _inst._opCapacity; }
//! Sets operand count.
- inline void setOpCount(uint32_t opCount) noexcept { _inst._opCount = uint8_t(opCount); }
+ ASMJIT_INLINE_NODEBUG void setOpCount(uint32_t opCount) noexcept { _inst._opCount = uint8_t(opCount); }
//! Returns operands array.
- inline Operand* operands() noexcept { return (Operand*)_opArray; }
+ ASMJIT_INLINE_NODEBUG Operand* operands() noexcept {
+ return reinterpret_cast<Operand*>(reinterpret_cast<uint8_t*>(this) + sizeof(InstNode));
+ }
+
//! Returns operands array (const).
- inline const Operand* operands() const noexcept { return (const Operand*)_opArray; }
+ ASMJIT_INLINE_NODEBUG const Operand* operands() const noexcept {
+ return reinterpret_cast<const Operand*>(reinterpret_cast<const uint8_t*>(this) + sizeof(InstNode));
+ }
//! Returns operand at the given `index`.
inline Operand& op(uint32_t index) noexcept {
ASMJIT_ASSERT(index < opCapacity());
- return _opArray[index].as<Operand>();
+
+ Operand* ops = operands();
+ return ops[index].as<Operand>();
}
//! Returns operand at the given `index` (const).
inline const Operand& op(uint32_t index) const noexcept {
ASMJIT_ASSERT(index < opCapacity());
- return _opArray[index].as<Operand>();
+
+ const Operand* ops = operands();
+ return ops[index].as<Operand>();
}
//! Sets operand at the given `index` to `op`.
inline void setOp(uint32_t index, const Operand_& op) noexcept {
ASMJIT_ASSERT(index < opCapacity());
- _opArray[index].copyFrom(op);
+
+ Operand* ops = operands();
+ ops[index].copyFrom(op);
}
//! Resets operand at the given `index` to none.
inline void resetOp(uint32_t index) noexcept {
ASMJIT_ASSERT(index < opCapacity());
- _opArray[index].reset();
+
+ Operand* ops = operands();
+ ops[index].reset();
}
//! Resets operands at `[start, end)` range.
inline void resetOpRange(uint32_t start, uint32_t end) noexcept {
+ Operand* ops = operands();
for (uint32_t i = start; i < end; i++)
- _opArray[i].reset();
+ ops[i].reset();
}
//! \}
@@ -835,33 +912,47 @@ public:
//! \name Utilities
//! \{
+ //! Tests whether the given operand type `opType` is used by the instruction.
inline bool hasOpType(OperandType opType) const noexcept {
+ const Operand* ops = operands();
for (uint32_t i = 0, count = opCount(); i < count; i++)
- if (_opArray[i].opType() == opType)
+ if (ops[i].opType() == opType)
return true;
return false;
}
+ //! Tests whether the instruction uses at least one register operand.
inline bool hasRegOp() const noexcept { return hasOpType(OperandType::kReg); }
+ //! Tests whether the instruction uses at least one memory operand.
inline bool hasMemOp() const noexcept { return hasOpType(OperandType::kMem); }
+ //! Tests whether the instruction uses at least one immediate operand.
inline bool hasImmOp() const noexcept { return hasOpType(OperandType::kImm); }
+ //! Tests whether the instruction uses at least one label operand.
inline bool hasLabelOp() const noexcept { return hasOpType(OperandType::kLabel); }
+ //! Returns the index of the given operand type `opType`.
+ //!
+ //! \note If the operand type wa found, the value returned represents its index in \ref operands()
+ //! array, otherwise \ref Globals::kNotFound is returned to signalize that the operand was not found.
inline uint32_t indexOfOpType(OperandType opType) const noexcept {
uint32_t i = 0;
uint32_t count = opCount();
+ const Operand* ops = operands();
while (i < count) {
- if (_opArray[i].opType() == opType)
- break;
+ if (ops[i].opType() == opType)
+ return i;
i++;
}
- return i;
+ return Globals::kNotFound;
}
+ //! A shortcut that calls `indexOfOpType(OperandType::kMem)`.
inline uint32_t indexOfMemOp() const noexcept { return indexOfOpType(OperandType::kMem); }
+ //! A shortcut that calls `indexOfOpType(OperandType::kImm)`.
inline uint32_t indexOfImmOp() const noexcept { return indexOfOpType(OperandType::kImm); }
+ //! A shortcut that calls `indexOfOpType(OperandType::kLabel)`.
inline uint32_t indexOfLabelOp() const noexcept { return indexOfOpType(OperandType::kLabel); }
//! \}
@@ -870,20 +961,40 @@ public:
//! \{
//! \cond INTERNAL
- inline uint32_t* _getRewriteArray() noexcept { return &_baseInst._extraReg._id; }
- inline const uint32_t* _getRewriteArray() const noexcept { return &_baseInst._extraReg._id; }
+ //! Returns uint32_t[] view that represents BaseInst::RegOnly and instruction operands.
+ ASMJIT_INLINE_NODEBUG uint32_t* _getRewriteArray() noexcept { return &_baseInst._extraReg._id; }
+ //! \overload
+ ASMJIT_INLINE_NODEBUG const uint32_t* _getRewriteArray() const noexcept { return &_baseInst._extraReg._id; }
+
+ //! Maximum value of rewrite id - 6 operands each having 4 slots is 24, one RegOnly having 2 slots => 26.
+ static constexpr uint32_t kMaxRewriteId = 26 - 1;
+
+ //! Returns a rewrite index of the given pointer to `id`.
+ //!
+ //! This function returns a value that can be then passed to `\ref rewriteIdAtIndex() function. It can address
+ //! any id from any operand that is used by the instruction in addition to \ref BaseInst::regOnly field, which
+ //! can also be used by the register allocator.
inline uint32_t getRewriteIndex(const uint32_t* id) const noexcept {
const uint32_t* array = _getRewriteArray();
ASMJIT_ASSERT(array <= id);
size_t index = (size_t)(id - array);
- ASMJIT_ASSERT(index < 32);
+ ASMJIT_ASSERT(index <= kMaxRewriteId);
return uint32_t(index);
}
+ //! Rewrites the given `index` to the provided identifier `id`.
+ //!
+ //! \note This is an internal function that is used by a \ref BaseCompiler implementation to rewrite virtual
+ //! registers to physical registers. The rewriter in this case sees all operands as array of uint32 values
+ //! and the given `index` describes a position in this array. For example a single \ref Operand would be
+ //! decomposed to 4 uint32_t values, where the first at index 0 would be operand signature, next would be
+ //! base id, etc... This is a comfortable way of patching operands without having to check for their types.
inline void rewriteIdAtIndex(uint32_t index, uint32_t id) noexcept {
+ ASMJIT_ASSERT(index <= kMaxRewriteId);
+
uint32_t* array = _getRewriteArray();
array[index] = id;
}
@@ -895,43 +1006,40 @@ public:
//! \{
//! \cond INTERNAL
- static inline uint32_t capacityOfOpCount(uint32_t opCount) noexcept {
- return opCount <= kBaseOpCapacity ? kBaseOpCapacity : Globals::kMaxOpCount;
+
+ //! Returns the capacity required for the given operands count `opCount`.
+ //!
+ //! There are only two capacities used - \ref kBaseOpCapacity and \ref kFullOpCapacity, so this function
+ //! is used to decide between these two. The general rule is that instructions that can be represented with
+ //! \ref kBaseOpCapacity would use this value, and all others would take \ref kFullOpCapacity.
+ static ASMJIT_INLINE_NODEBUG constexpr uint32_t capacityOfOpCount(uint32_t opCount) noexcept {
+ return opCount <= kBaseOpCapacity ? kBaseOpCapacity : kFullOpCapacity;
}
- static inline size_t nodeSizeOfOpCapacity(uint32_t opCapacity) noexcept {
- size_t base = sizeof(InstNode) - kBaseOpCapacity * sizeof(Operand);
- return base + opCapacity * sizeof(Operand);
+ //! Calculates the size of \ref InstNode required to hold at most `opCapacity` operands.
+ //!
+ //! This function is used internally to allocate \ref InstNode.
+ static ASMJIT_INLINE_NODEBUG constexpr size_t nodeSizeOfOpCapacity(uint32_t opCapacity) noexcept {
+ return sizeof(InstNode) + opCapacity * sizeof(Operand);
}
//! \endcond
//! \}
};
-//! Instruction node with maximum number of operands.
+//! Instruction node with embedded operands following \ref InstNode layout.
//!
-//! This node is created automatically by Builder/Compiler in case that the required number of operands exceeds
-//! the default capacity of `InstNode`.
-class InstExNode : public InstNode {
+//! \note This is used to make tools such as static analysis and compilers happy about the layout. There were two
+//! instruction nodes in the past, having the second extend the operand array of the first, but that has caused
+//! undefined behavior and made recent tools unhappy about that.
+template<uint32_t kN>
+class InstNodeWithOperands : public InstNode {
public:
- ASMJIT_NONCOPYABLE(InstExNode)
-
- //! \name Members
- //! \{
+ Operand_ _operands[kN];
- //! Continued `_opArray[]` to hold up to `kMaxOpCount` operands.
- Operand_ _opArrayEx[Globals::kMaxOpCount - kBaseOpCapacity];
-
- //! \}
-
- //! \name Construction & Destruction
- //! \{
-
- //! Creates a new `InstExNode` instance.
- inline InstExNode(BaseBuilder* cb, InstId instId, InstOptions options, uint32_t opCapacity = Globals::kMaxOpCount) noexcept
- : InstNode(cb, instId, options, opCapacity) {}
-
- //! \}
+ //! Creates a new `InstNodeWithOperands` instance.
+ ASMJIT_INLINE_NODEBUG InstNodeWithOperands(BaseBuilder* cb, InstId instId, InstOptions options, uint32_t opCount) noexcept
+ : InstNode(cb, instId, options, opCount, kN) {}
};
//! Section node.
@@ -958,9 +1066,9 @@ public:
//! \{
//! Creates a new `SectionNode` instance.
- inline SectionNode(BaseBuilder* cb, uint32_t secionId = 0) noexcept
+ ASMJIT_INLINE_NODEBUG SectionNode(BaseBuilder* cb, uint32_t sectionId = 0) noexcept
: BaseNode(cb, NodeType::kSection, NodeFlags::kHasNoEffect),
- _id(secionId),
+ _id(sectionId),
_nextSection(nullptr) {}
//! \}
@@ -969,7 +1077,7 @@ public:
//! \{
//! Returns the section id.
- inline uint32_t id() const noexcept { return _id; }
+ ASMJIT_INLINE_NODEBUG uint32_t id() const noexcept { return _id; }
//! \}
};
@@ -991,7 +1099,7 @@ public:
//! \{
//! Creates a new `LabelNode` instance.
- inline LabelNode(BaseBuilder* cb, uint32_t labelId = 0) noexcept
+ ASMJIT_INLINE_NODEBUG LabelNode(BaseBuilder* cb, uint32_t labelId = 0) noexcept
: BaseNode(cb, NodeType::kLabel, NodeFlags::kHasNoEffect | NodeFlags::kActsAsLabel),
_labelId(labelId) {}
@@ -1001,9 +1109,9 @@ public:
//! \{
//! Returns \ref Label representation of the \ref LabelNode.
- inline Label label() const noexcept { return Label(_labelId); }
+ ASMJIT_INLINE_NODEBUG Label label() const noexcept { return Label(_labelId); }
//! Returns the id of the label.
- inline uint32_t labelId() const noexcept { return _labelId; }
+ ASMJIT_INLINE_NODEBUG uint32_t labelId() const noexcept { return _labelId; }
//! \}
};
@@ -1027,7 +1135,7 @@ public:
//! \{
//! Creates a new `AlignNode` instance.
- inline AlignNode(BaseBuilder* cb, AlignMode alignMode, uint32_t alignment) noexcept
+ ASMJIT_INLINE_NODEBUG AlignNode(BaseBuilder* cb, AlignMode alignMode, uint32_t alignment) noexcept
: BaseNode(cb, NodeType::kAlign, NodeFlags::kIsCode | NodeFlags::kHasNoEffect) {
_alignData._alignMode = alignMode;
@@ -1040,14 +1148,14 @@ public:
//! \{
//! Returns align mode.
- inline AlignMode alignMode() const noexcept { return _alignData._alignMode; }
+ ASMJIT_INLINE_NODEBUG AlignMode alignMode() const noexcept { return _alignData._alignMode; }
//! Sets align mode to `alignMode`.
- inline void setAlignMode(AlignMode alignMode) noexcept { _alignData._alignMode = alignMode; }
+ ASMJIT_INLINE_NODEBUG void setAlignMode(AlignMode alignMode) noexcept { _alignData._alignMode = alignMode; }
//! Returns align offset in bytes.
- inline uint32_t alignment() const noexcept { return _alignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t alignment() const noexcept { return _alignment; }
//! Sets align offset in bytes to `offset`.
- inline void setAlignment(uint32_t alignment) noexcept { _alignment = alignment; }
+ ASMJIT_INLINE_NODEBUG void setAlignment(uint32_t alignment) noexcept { _alignment = alignment; }
//! \}
};
@@ -1083,7 +1191,7 @@ public:
//! \{
//! Creates a new `EmbedDataNode` instance.
- inline EmbedDataNode(BaseBuilder* cb) noexcept
+ ASMJIT_INLINE_NODEBUG EmbedDataNode(BaseBuilder* cb) noexcept
: BaseNode(cb, NodeType::kEmbedData, NodeFlags::kIsData),
_itemCount(0),
_repeatCount(0) {
@@ -1098,31 +1206,31 @@ public:
//! \{
//! Returns data type as \ref TypeId.
- inline TypeId typeId() const noexcept { return _embed._typeId; }
+ ASMJIT_INLINE_NODEBUG TypeId typeId() const noexcept { return _embed._typeId; }
//! Returns the size of a single data element.
- inline uint32_t typeSize() const noexcept { return _embed._typeSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t typeSize() const noexcept { return _embed._typeSize; }
//! Returns a pointer to the data casted to `uint8_t`.
- inline uint8_t* data() const noexcept {
+ ASMJIT_INLINE_NODEBUG uint8_t* data() const noexcept {
return dataSize() <= kInlineBufferSize ? const_cast<uint8_t*>(_inlineData) : _externalData;
}
//! Returns a pointer to the data casted to `T`.
template<typename T>
- inline T* dataAs() const noexcept { return reinterpret_cast<T*>(data()); }
+ ASMJIT_INLINE_NODEBUG T* dataAs() const noexcept { return reinterpret_cast<T*>(data()); }
//! Returns the number of (typed) items in the array.
- inline size_t itemCount() const noexcept { return _itemCount; }
+ ASMJIT_INLINE_NODEBUG size_t itemCount() const noexcept { return _itemCount; }
//! Returns how many times the data is repeated (default 1).
//!
//! Repeated data is useful when defining constants for SIMD, for example.
- inline size_t repeatCount() const noexcept { return _repeatCount; }
+ ASMJIT_INLINE_NODEBUG size_t repeatCount() const noexcept { return _repeatCount; }
//! Returns the size of the data, not considering the number of times it repeats.
//!
//! \note The returned value is the same as `typeSize() * itemCount()`.
- inline size_t dataSize() const noexcept { return typeSize() * _itemCount; }
+ ASMJIT_INLINE_NODEBUG size_t dataSize() const noexcept { return typeSize() * _itemCount; }
//! \}
};
@@ -1144,7 +1252,7 @@ public:
//! \{
//! Creates a new `EmbedLabelNode` instance.
- inline EmbedLabelNode(BaseBuilder* cb, uint32_t labelId = 0, uint32_t dataSize = 0) noexcept
+ ASMJIT_INLINE_NODEBUG EmbedLabelNode(BaseBuilder* cb, uint32_t labelId = 0, uint32_t dataSize = 0) noexcept
: BaseNode(cb, NodeType::kEmbedLabel, NodeFlags::kIsData),
_labelId(labelId),
_dataSize(dataSize) {}
@@ -1155,19 +1263,19 @@ public:
//! \{
//! Returns the label to embed as \ref Label operand.
- inline Label label() const noexcept { return Label(_labelId); }
+ ASMJIT_INLINE_NODEBUG Label label() const noexcept { return Label(_labelId); }
//! Returns the id of the label.
- inline uint32_t labelId() const noexcept { return _labelId; }
+ ASMJIT_INLINE_NODEBUG uint32_t labelId() const noexcept { return _labelId; }
//! Sets the label id from `label` operand.
- inline void setLabel(const Label& label) noexcept { setLabelId(label.id()); }
+ ASMJIT_INLINE_NODEBUG void setLabel(const Label& label) noexcept { setLabelId(label.id()); }
//! Sets the label id (use with caution, improper use can break a lot of things).
- inline void setLabelId(uint32_t labelId) noexcept { _labelId = labelId; }
+ ASMJIT_INLINE_NODEBUG void setLabelId(uint32_t labelId) noexcept { _labelId = labelId; }
//! Returns the data size.
- inline uint32_t dataSize() const noexcept { return _dataSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t dataSize() const noexcept { return _dataSize; }
//! Sets the data size.
- inline void setDataSize(uint32_t dataSize) noexcept { _dataSize = dataSize; }
+ ASMJIT_INLINE_NODEBUG void setDataSize(uint32_t dataSize) noexcept { _dataSize = dataSize; }
//! \}
};
@@ -1190,7 +1298,7 @@ public:
//! \{
//! Creates a new `EmbedLabelDeltaNode` instance.
- inline EmbedLabelDeltaNode(BaseBuilder* cb, uint32_t labelId = 0, uint32_t baseLabelId = 0, uint32_t dataSize = 0) noexcept
+ ASMJIT_INLINE_NODEBUG EmbedLabelDeltaNode(BaseBuilder* cb, uint32_t labelId = 0, uint32_t baseLabelId = 0, uint32_t dataSize = 0) noexcept
: BaseNode(cb, NodeType::kEmbedLabelDelta, NodeFlags::kIsData),
_labelId(labelId),
_baseLabelId(baseLabelId),
@@ -1202,29 +1310,29 @@ public:
//! \{
//! Returns the label as `Label` operand.
- inline Label label() const noexcept { return Label(_labelId); }
+ ASMJIT_INLINE_NODEBUG Label label() const noexcept { return Label(_labelId); }
//! Returns the id of the label.
- inline uint32_t labelId() const noexcept { return _labelId; }
+ ASMJIT_INLINE_NODEBUG uint32_t labelId() const noexcept { return _labelId; }
//! Sets the label id from `label` operand.
- inline void setLabel(const Label& label) noexcept { setLabelId(label.id()); }
+ ASMJIT_INLINE_NODEBUG void setLabel(const Label& label) noexcept { setLabelId(label.id()); }
//! Sets the label id.
- inline void setLabelId(uint32_t labelId) noexcept { _labelId = labelId; }
+ ASMJIT_INLINE_NODEBUG void setLabelId(uint32_t labelId) noexcept { _labelId = labelId; }
//! Returns the base label as `Label` operand.
- inline Label baseLabel() const noexcept { return Label(_baseLabelId); }
+ ASMJIT_INLINE_NODEBUG Label baseLabel() const noexcept { return Label(_baseLabelId); }
//! Returns the id of the base label.
- inline uint32_t baseLabelId() const noexcept { return _baseLabelId; }
+ ASMJIT_INLINE_NODEBUG uint32_t baseLabelId() const noexcept { return _baseLabelId; }
//! Sets the base label id from `label` operand.
- inline void setBaseLabel(const Label& baseLabel) noexcept { setBaseLabelId(baseLabel.id()); }
+ ASMJIT_INLINE_NODEBUG void setBaseLabel(const Label& baseLabel) noexcept { setBaseLabelId(baseLabel.id()); }
//! Sets the base label id.
- inline void setBaseLabelId(uint32_t baseLabelId) noexcept { _baseLabelId = baseLabelId; }
+ ASMJIT_INLINE_NODEBUG void setBaseLabelId(uint32_t baseLabelId) noexcept { _baseLabelId = baseLabelId; }
//! Returns the size of the embedded label address.
- inline uint32_t dataSize() const noexcept { return _dataSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t dataSize() const noexcept { return _dataSize; }
//! Sets the size of the embedded label address.
- inline void setDataSize(uint32_t dataSize) noexcept { _dataSize = dataSize; }
+ ASMJIT_INLINE_NODEBUG void setDataSize(uint32_t dataSize) noexcept { _dataSize = dataSize; }
//! \}
};
@@ -1245,7 +1353,7 @@ public:
//! \{
//! Creates a new `ConstPoolNode` instance.
- inline ConstPoolNode(BaseBuilder* cb, uint32_t id = 0) noexcept
+ ASMJIT_INLINE_NODEBUG ConstPoolNode(BaseBuilder* cb, uint32_t id = 0) noexcept
: LabelNode(cb, id),
_constPool(&cb->_codeZone) {
@@ -1260,16 +1368,16 @@ public:
//! \{
//! Tests whether the constant-pool is empty.
- inline bool empty() const noexcept { return _constPool.empty(); }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _constPool.empty(); }
//! Returns the size of the constant-pool in bytes.
- inline size_t size() const noexcept { return _constPool.size(); }
+ ASMJIT_INLINE_NODEBUG size_t size() const noexcept { return _constPool.size(); }
//! Returns minimum alignment.
- inline size_t alignment() const noexcept { return _constPool.alignment(); }
+ ASMJIT_INLINE_NODEBUG size_t alignment() const noexcept { return _constPool.alignment(); }
//! Returns the wrapped `ConstPool` instance.
- inline ConstPool& constPool() noexcept { return _constPool; }
+ ASMJIT_INLINE_NODEBUG ConstPool& constPool() noexcept { return _constPool; }
//! Returns the wrapped `ConstPool` instance (const).
- inline const ConstPool& constPool() const noexcept { return _constPool; }
+ ASMJIT_INLINE_NODEBUG const ConstPool& constPool() const noexcept { return _constPool; }
//! \}
@@ -1277,7 +1385,7 @@ public:
//! \{
//! See `ConstPool::add()`.
- inline Error add(const void* data, size_t size, size_t& dstOffset) noexcept {
+ ASMJIT_INLINE_NODEBUG Error add(const void* data, size_t size, size_t& dstOffset) noexcept {
return _constPool.add(data, size, dstOffset);
}
@@ -1293,7 +1401,7 @@ public:
//! \{
//! Creates a new `CommentNode` instance.
- inline CommentNode(BaseBuilder* cb, const char* comment) noexcept
+ ASMJIT_INLINE_NODEBUG CommentNode(BaseBuilder* cb, const char* comment) noexcept
: BaseNode(cb, NodeType::kComment, NodeFlags::kIsInformative | NodeFlags::kHasNoEffect | NodeFlags::kIsRemovable) {
_inlineComment = comment;
}
@@ -1313,7 +1421,7 @@ public:
//! \{
//! Creates a new `SentinelNode` instance.
- inline SentinelNode(BaseBuilder* cb, SentinelType sentinelType = SentinelType::kUnknown) noexcept
+ ASMJIT_INLINE_NODEBUG SentinelNode(BaseBuilder* cb, SentinelType sentinelType = SentinelType::kUnknown) noexcept
: BaseNode(cb, NodeType::kSentinel, NodeFlags::kIsInformative | NodeFlags::kHasNoEffect) {
_sentinel._sentinelType = sentinelType;
@@ -1325,12 +1433,12 @@ public:
//! \{
//! Returns the type of the sentinel.
- inline SentinelType sentinelType() const noexcept {
+ ASMJIT_INLINE_NODEBUG SentinelType sentinelType() const noexcept {
return _sentinel._sentinelType;
}
//! Sets the type of the sentinel.
- inline void setSentinelType(SentinelType type) noexcept {
+ ASMJIT_INLINE_NODEBUG void setSentinelType(SentinelType type) noexcept {
_sentinel._sentinelType = type;
}
@@ -1365,9 +1473,9 @@ public:
//! \{
//! Returns \ref BaseBuilder associated with the pass.
- inline const BaseBuilder* cb() const noexcept { return _cb; }
+ ASMJIT_INLINE_NODEBUG const BaseBuilder* cb() const noexcept { return _cb; }
//! Returns the name of the pass.
- inline const char* name() const noexcept { return _name; }
+ ASMJIT_INLINE_NODEBUG const char* name() const noexcept { return _name; }
//! \}
@@ -1378,7 +1486,7 @@ public:
//!
//! This is the only function that is called by the `BaseBuilder` to process the code. It passes `zone`,
//! which will be reset after the `run()` finishes.
- virtual Error run(Zone* zone, Logger* logger) = 0;
+ ASMJIT_API virtual Error run(Zone* zone, Logger* logger);
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/builder_p.h b/3rdparty/asmjit/src/asmjit/core/builder_p.h
new file mode 100644
index 00000000000..98790fdf95f
--- /dev/null
+++ b/3rdparty/asmjit/src/asmjit/core/builder_p.h
@@ -0,0 +1,37 @@
+// This file is part of AsmJit project <https://asmjit.com>
+//
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
+
+#ifndef ASMJIT_CORE_BUILDER_P_H_INCLUDED
+#define ASMJIT_CORE_BUILDER_P_H_INCLUDED
+
+#include "../core/api-config.h"
+#ifndef ASMJIT_NO_BUILDER
+
+#include "../core/builder.h"
+
+ASMJIT_BEGIN_NAMESPACE
+
+//! \cond INTERNAL
+//! \addtogroup asmjit_builder
+//! \{
+
+static inline void BaseBuilder_assignInlineComment(BaseBuilder* self, BaseNode* node, const char* comment) noexcept {
+ if (comment)
+ node->setInlineComment(static_cast<char*>(self->_dataZone.dup(comment, strlen(comment), true)));
+}
+
+static inline void BaseBuilder_assignInstState(BaseBuilder* self, InstNode* node, const BaseEmitter::State& state) noexcept {
+ node->setOptions(state.options);
+ node->setExtraReg(state.extraReg);
+ BaseBuilder_assignInlineComment(self, node, state.comment);
+}
+
+//! \}
+//! \endcond
+
+ASMJIT_END_NAMESPACE
+
+#endif // !ASMJIT_NO_BUILDER
+#endif // ASMJIT_CORE_BUILDER_P_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/core/codebuffer.h b/3rdparty/asmjit/src/asmjit/core/codebuffer.h
index 4946e7a06a1..d4b7cebbcef 100644
--- a/3rdparty/asmjit/src/asmjit/core/codebuffer.h
+++ b/3rdparty/asmjit/src/asmjit/core/codebuffer.h
@@ -44,7 +44,7 @@ struct CodeBuffer {
//! \name Overloaded Operators
//! \{
- //! Returns a referebce to the byte at the given `index`.
+ //! Returns a reference to the byte at the given `index`.
inline uint8_t& operator[](size_t index) noexcept {
ASMJIT_ASSERT(index < _size);
return _data[index];
@@ -61,46 +61,46 @@ struct CodeBuffer {
//! \{
//! Returns code buffer flags.
- inline CodeBufferFlags flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG CodeBufferFlags flags() const noexcept { return _flags; }
//! Tests whether the code buffer has the given `flag` set.
- inline bool hasFlag(CodeBufferFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(CodeBufferFlags flag) const noexcept { return Support::test(_flags, flag); }
//! Tests whether this code buffer has a fixed size.
//!
//! Fixed size means that the code buffer is fixed and cannot grow.
- inline bool isFixed() const noexcept { return hasFlag(CodeBufferFlags::kIsFixed); }
+ ASMJIT_INLINE_NODEBUG bool isFixed() const noexcept { return hasFlag(CodeBufferFlags::kIsFixed); }
//! Tests whether the data in this code buffer is external.
//!
//! External data can only be provided by users, it's never used by AsmJit.
- inline bool isExternal() const noexcept { return hasFlag(CodeBufferFlags::kIsExternal); }
+ ASMJIT_INLINE_NODEBUG bool isExternal() const noexcept { return hasFlag(CodeBufferFlags::kIsExternal); }
//! Tests whether the data in this code buffer is allocated (non-null).
- inline bool isAllocated() const noexcept { return _data != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool isAllocated() const noexcept { return _data != nullptr; }
//! Tests whether the code buffer is empty.
- inline bool empty() const noexcept { return !_size; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return !_size; }
//! Returns the size of the data.
- inline size_t size() const noexcept { return _size; }
+ ASMJIT_INLINE_NODEBUG size_t size() const noexcept { return _size; }
//! Returns the capacity of the data.
- inline size_t capacity() const noexcept { return _capacity; }
+ ASMJIT_INLINE_NODEBUG size_t capacity() const noexcept { return _capacity; }
//! Returns the pointer to the data the buffer references.
- inline uint8_t* data() noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG uint8_t* data() noexcept { return _data; }
//! \overload
- inline const uint8_t* data() const noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG const uint8_t* data() const noexcept { return _data; }
//! \}
//! \name Iterators
//! \{
- inline uint8_t* begin() noexcept { return _data; }
- inline const uint8_t* begin() const noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG uint8_t* begin() noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG const uint8_t* begin() const noexcept { return _data; }
- inline uint8_t* end() noexcept { return _data + _size; }
- inline const uint8_t* end() const noexcept { return _data + _size; }
+ ASMJIT_INLINE_NODEBUG uint8_t* end() noexcept { return _data + _size; }
+ ASMJIT_INLINE_NODEBUG const uint8_t* end() const noexcept { return _data + _size; }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/codeholder.cpp b/3rdparty/asmjit/src/asmjit/core/codeholder.cpp
index cf763cfff12..63b15a3ada3 100644
--- a/3rdparty/asmjit/src/asmjit/core/codeholder.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/codeholder.cpp
@@ -74,6 +74,7 @@ static void CodeHolder_resetInternal(CodeHolder* self, ResetPolicy resetPolicy)
// Reset everything into its construction state.
self->_environment.reset();
+ self->_cpuFeatures.reset();
self->_baseAddress = Globals::kNoBaseAddress;
self->_logger = nullptr;
self->_errorHandler = nullptr;
@@ -118,6 +119,7 @@ static void CodeHolder_onSettingsUpdated(CodeHolder* self) noexcept {
CodeHolder::CodeHolder(const Support::Temporary* temporary) noexcept
: _environment(),
+ _cpuFeatures{},
_baseAddress(Globals::kNoBaseAddress),
_logger(nullptr),
_errorHandler(nullptr),
@@ -130,8 +132,8 @@ CodeHolder::~CodeHolder() noexcept {
CodeHolder_resetInternal(this, ResetPolicy::kHard);
}
-// CodeHolder - Init & Reset
-// =========================
+// CodeHolder - Initialization & Reset
+// ===================================
inline void CodeHolder_setSectionDefaultName(
Section* section,
@@ -143,6 +145,10 @@ inline void CodeHolder_setSectionDefaultName(
}
Error CodeHolder::init(const Environment& environment, uint64_t baseAddress) noexcept {
+ return init(environment, CpuFeatures{}, baseAddress);
+}
+
+Error CodeHolder::init(const Environment& environment, const CpuFeatures& cpuFeatures, uint64_t baseAddress) noexcept {
// Cannot reinitialize if it's locked or there is one or more emitter attached.
if (isInitialized())
return DebugUtils::errored(kErrorAlreadyInitialized);
@@ -172,6 +178,7 @@ Error CodeHolder::init(const Environment& environment, uint64_t baseAddress) noe
}
else {
_environment = environment;
+ _cpuFeatures = cpuFeatures;
_baseAddress = baseAddress;
return kErrorOk;
}
@@ -901,7 +908,7 @@ size_t CodeHolder::codeSize() const noexcept {
}
}
- if ((sizeof(uint64_t) > sizeof(size_t) && offset > SIZE_MAX) || of)
+ if ((sizeof(uint64_t) > sizeof(size_t) && offset > uint64_t(SIZE_MAX)) || of)
return SIZE_MAX;
return size_t(offset);
@@ -1119,30 +1126,30 @@ UNIT(code_holder) {
env.init(Arch::kX86);
code.init(env);
- EXPECT(code.arch() == Arch::kX86);
+ EXPECT_EQ(code.arch(), Arch::kX86);
INFO("Verifying named labels");
LabelEntry* le;
- EXPECT(code.newNamedLabelEntry(&le, "NamedLabel", SIZE_MAX, LabelType::kGlobal) == kErrorOk);
- EXPECT(strcmp(le->name(), "NamedLabel") == 0);
- EXPECT(code.labelIdByName("NamedLabel") == le->id());
+ EXPECT_EQ(code.newNamedLabelEntry(&le, "NamedLabel", SIZE_MAX, LabelType::kGlobal), kErrorOk);
+ EXPECT_EQ(strcmp(le->name(), "NamedLabel"), 0);
+ EXPECT_EQ(code.labelIdByName("NamedLabel"), le->id());
INFO("Verifying section ordering");
Section* section1;
- EXPECT(code.newSection(&section1, "high-priority", SIZE_MAX, SectionFlags::kNone, 1, -1) == kErrorOk);
- EXPECT(code.sections()[1] == section1);
- EXPECT(code.sectionsByOrder()[0] == section1);
+ EXPECT_EQ(code.newSection(&section1, "high-priority", SIZE_MAX, SectionFlags::kNone, 1, -1), kErrorOk);
+ EXPECT_EQ(code.sections()[1], section1);
+ EXPECT_EQ(code.sectionsByOrder()[0], section1);
Section* section0;
- EXPECT(code.newSection(&section0, "higher-priority", SIZE_MAX, SectionFlags::kNone, 1, -2) == kErrorOk);
- EXPECT(code.sections()[2] == section0);
- EXPECT(code.sectionsByOrder()[0] == section0);
- EXPECT(code.sectionsByOrder()[1] == section1);
+ EXPECT_EQ(code.newSection(&section0, "higher-priority", SIZE_MAX, SectionFlags::kNone, 1, -2), kErrorOk);
+ EXPECT_EQ(code.sections()[2], section0);
+ EXPECT_EQ(code.sectionsByOrder()[0], section0);
+ EXPECT_EQ(code.sectionsByOrder()[1], section1);
Section* section3;
- EXPECT(code.newSection(&section3, "low-priority", SIZE_MAX, SectionFlags::kNone, 1, 2) == kErrorOk);
- EXPECT(code.sections()[3] == section3);
- EXPECT(code.sectionsByOrder()[3] == section3);
+ EXPECT_EQ(code.newSection(&section3, "low-priority", SIZE_MAX, SectionFlags::kNone, 1, 2), kErrorOk);
+ EXPECT_EQ(code.sections()[3], section3);
+ EXPECT_EQ(code.sectionsByOrder()[3], section3);
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/core/codeholder.h b/3rdparty/asmjit/src/asmjit/core/codeholder.h
index 6ed2ddf9426..3f2d1d70745 100644
--- a/3rdparty/asmjit/src/asmjit/core/codeholder.h
+++ b/3rdparty/asmjit/src/asmjit/core/codeholder.h
@@ -45,7 +45,7 @@ enum class ExpressionOpType : uint8_t {
kSra = 5
};
-//! Value tyoe that can be used within an \ref Expression.
+//! Value type that can be used within an \ref Expression.
enum class ExpressionValueType : uint8_t {
//! No value or invalid.
kNone = 0,
@@ -89,22 +89,22 @@ struct Expression {
//! Resets the whole expression.
//!
//! Changes both values to \ref ExpressionValueType::kNone.
- inline void reset() noexcept { memset(this, 0, sizeof(*this)); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = Expression{}; }
//! Sets the value type at `index` to \ref ExpressionValueType::kConstant and its content to `constant`.
- inline void setValueAsConstant(size_t index, uint64_t constant) noexcept {
+ ASMJIT_INLINE_NODEBUG void setValueAsConstant(size_t index, uint64_t constant) noexcept {
valueType[index] = ExpressionValueType::kConstant;
value[index].constant = constant;
}
//! Sets the value type at `index` to \ref ExpressionValueType::kLabel and its content to `labelEntry`.
- inline void setValueAsLabel(size_t index, LabelEntry* labelEntry) noexcept {
+ ASMJIT_INLINE_NODEBUG void setValueAsLabel(size_t index, LabelEntry* labelEntry) noexcept {
valueType[index] = ExpressionValueType::kLabel;
value[index].label = labelEntry;
}
//! Sets the value type at `index` to \ref ExpressionValueType::kExpression and its content to `expression`.
- inline void setValueAsExpression(size_t index, Expression* expression) noexcept {
+ ASMJIT_INLINE_NODEBUG void setValueAsExpression(size_t index, Expression* expression) noexcept {
valueType[index] = ExpressionValueType::kExpression;
value[index].expression = expression;
}
@@ -175,36 +175,36 @@ public:
//! \{
//! Returns the section id.
- inline uint32_t id() const noexcept { return _id; }
+ ASMJIT_INLINE_NODEBUG uint32_t id() const noexcept { return _id; }
//! Returns the section name, as a null terminated string.
- inline const char* name() const noexcept { return _name.str; }
+ ASMJIT_INLINE_NODEBUG const char* name() const noexcept { return _name.str; }
//! Returns the section data.
- inline uint8_t* data() noexcept { return _buffer.data(); }
+ ASMJIT_INLINE_NODEBUG uint8_t* data() noexcept { return _buffer.data(); }
//! \overload
- inline const uint8_t* data() const noexcept { return _buffer.data(); }
+ ASMJIT_INLINE_NODEBUG const uint8_t* data() const noexcept { return _buffer.data(); }
//! Returns the section flags.
- inline SectionFlags flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG SectionFlags flags() const noexcept { return _flags; }
//! Tests whether the section has the given `flag`.
- inline bool hasFlag(SectionFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(SectionFlags flag) const noexcept { return Support::test(_flags, flag); }
//! Adds `flags` to the section flags.
- inline void addFlags(SectionFlags flags) noexcept { _flags |= flags; }
+ ASMJIT_INLINE_NODEBUG void addFlags(SectionFlags flags) noexcept { _flags |= flags; }
//! Removes `flags` from the section flags.
- inline void clearFlags(SectionFlags flags) noexcept { _flags &= ~flags; }
+ ASMJIT_INLINE_NODEBUG void clearFlags(SectionFlags flags) noexcept { _flags &= ~flags; }
//! Returns the minimum section alignment
- inline uint32_t alignment() const noexcept { return _alignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t alignment() const noexcept { return _alignment; }
//! Sets the minimum section alignment
- inline void setAlignment(uint32_t alignment) noexcept { _alignment = alignment; }
+ ASMJIT_INLINE_NODEBUG void setAlignment(uint32_t alignment) noexcept { _alignment = alignment; }
//! Returns the section order, which has a higher priority than section id.
- inline int32_t order() const noexcept { return _order; }
+ ASMJIT_INLINE_NODEBUG int32_t order() const noexcept { return _order; }
//! Returns the section offset, relative to base.
- inline uint64_t offset() const noexcept { return _offset; }
+ ASMJIT_INLINE_NODEBUG uint64_t offset() const noexcept { return _offset; }
//! Set the section offset.
- inline void setOffset(uint64_t offset) noexcept { _offset = offset; }
+ ASMJIT_INLINE_NODEBUG void setOffset(uint64_t offset) noexcept { _offset = offset; }
//! Returns the virtual size of the section.
//!
@@ -212,19 +212,19 @@ public:
//! size returned by `bufferSize()` as the buffer stores real data emitted by assemblers or appended by users.
//!
//! Use `realSize()` to get the real and final size of this section.
- inline uint64_t virtualSize() const noexcept { return _virtualSize; }
+ ASMJIT_INLINE_NODEBUG uint64_t virtualSize() const noexcept { return _virtualSize; }
//! Sets the virtual size of the section.
- inline void setVirtualSize(uint64_t virtualSize) noexcept { _virtualSize = virtualSize; }
+ ASMJIT_INLINE_NODEBUG void setVirtualSize(uint64_t virtualSize) noexcept { _virtualSize = virtualSize; }
//! Returns the buffer size of the section.
- inline size_t bufferSize() const noexcept { return _buffer.size(); }
+ ASMJIT_INLINE_NODEBUG size_t bufferSize() const noexcept { return _buffer.size(); }
//! Returns the real size of the section calculated from virtual and buffer sizes.
- inline uint64_t realSize() const noexcept { return Support::max<uint64_t>(virtualSize(), bufferSize()); }
+ ASMJIT_INLINE_NODEBUG uint64_t realSize() const noexcept { return Support::max<uint64_t>(virtualSize(), bufferSize()); }
//! Returns the `CodeBuffer` used by this section.
- inline CodeBuffer& buffer() noexcept { return _buffer; }
+ ASMJIT_INLINE_NODEBUG CodeBuffer& buffer() noexcept { return _buffer; }
//! Returns the `CodeBuffer` used by this section (const).
- inline const CodeBuffer& buffer() const noexcept { return _buffer; }
+ ASMJIT_INLINE_NODEBUG const CodeBuffer& buffer() const noexcept { return _buffer; }
//! \}
};
@@ -247,7 +247,7 @@ public:
//! \name Construction & Destruction
//! \{
- inline explicit AddressTableEntry(uint64_t address) noexcept
+ ASMJIT_INLINE_NODEBUG explicit AddressTableEntry(uint64_t address) noexcept
: _address(address),
_slot(0xFFFFFFFFu) {}
@@ -256,22 +256,25 @@ public:
//! \name Accessors
//! \{
- inline uint64_t address() const noexcept { return _address; }
- inline uint32_t slot() const noexcept { return _slot; }
+ ASMJIT_INLINE_NODEBUG uint64_t address() const noexcept { return _address; }
+ ASMJIT_INLINE_NODEBUG uint32_t slot() const noexcept { return _slot; }
- inline bool hasAssignedSlot() const noexcept { return _slot != 0xFFFFFFFFu; }
+ ASMJIT_INLINE_NODEBUG bool hasAssignedSlot() const noexcept { return _slot != 0xFFFFFFFFu; }
- inline bool operator<(const AddressTableEntry& other) const noexcept { return _address < other._address; }
- inline bool operator>(const AddressTableEntry& other) const noexcept { return _address > other._address; }
+ ASMJIT_INLINE_NODEBUG bool operator<(const AddressTableEntry& other) const noexcept { return _address < other._address; }
+ ASMJIT_INLINE_NODEBUG bool operator>(const AddressTableEntry& other) const noexcept { return _address > other._address; }
- inline bool operator<(uint64_t queryAddress) const noexcept { return _address < queryAddress; }
- inline bool operator>(uint64_t queryAddress) const noexcept { return _address > queryAddress; }
+ ASMJIT_INLINE_NODEBUG bool operator<(uint64_t queryAddress) const noexcept { return _address < queryAddress; }
+ ASMJIT_INLINE_NODEBUG bool operator>(uint64_t queryAddress) const noexcept { return _address > queryAddress; }
//! \}
};
//! Offset format type, used by \ref OffsetFormat.
enum class OffsetType : uint8_t {
+ // Common Offset Formats
+ // ---------------------
+
//! A value having `_immBitCount` bits and shifted by `_immBitShift`.
//!
//! This offset type is sufficient for many targets that store offset as a continuous set bits within an
@@ -284,14 +287,82 @@ enum class OffsetType : uint8_t {
// AArch64 Specific Offset Formats
// -------------------------------
- //! AARCH64 ADR format of `[.|immlo:2|.....|immhi:19|.....]`.
+ //! AArch64 ADR format of `[.|immlo:2|.....|immhi:19|.....]`.
kAArch64_ADR,
- //! AARCH64 ADRP format of `[.|immlo:2|.....|immhi:19|.....]` (4kB pages).
+ //! AArch64 ADRP format of `[.|immlo:2|.....|immhi:19|.....]` (4kB pages).
kAArch64_ADRP,
+ // AArch32 Specific Offset Formats (T16 & T32)
+ // -------------------------------------------
+
+ //! AArch32 THUMBv2 immediate encoding of 'ADR' instruction (12-bit payload and sign bit):
+ //!
+ //! `|.....|imm:1|..N.N|......|imm:3|....|imm:8|`
+ //!
+ //! Where `N` is one if the offset is negative. The immediate is encoded as absolute value of the offset if negative.
+ kThumb32_ADR,
+
+ //! AArch32 THUMBv2 immediate encoding of 'BLX' instruction (23-bit immediate payload, multiplied by 4):
+ //!
+ //! `|.....|imm[22]|imm[19:10]|..|ja|1|jb|imm[9:0]|0`
+ //!
+ //! Where:
+ //!
+ //! - `ja` is calculated as imm[22] ^ imm[21] ^ 1.
+ //! - `jb` is calculated as imm[22] ^ imm[20] ^ 1.
+ kThumb32_BLX,
+
+ //! AArch32 THUMBv2 immediate encoding of 'B' instruction without `<cond>` (24-bit immediate payload, multiplied by 2):
+ //!
+ //! `|.....|imm[23]|imm[20:11]|..|ja|1|jb|imm[10:0]`
+ //!
+ //! Where:
+ //!
+ //! - `ja` is calculated as imm[23] ^ imm[22] ^ 1.
+ //! - `jb` is calculated as imm[23] ^ imm[21] ^ 1.
+ kThumb32_B,
+
+ //! AArch32 THUMBv2 immediate encoding of 'B' instruction with `<cond>` (20-bit immediate payload, multiplied by 2).
+ //!
+ //! `|.....|imm[19]|....|imm[16:11]|..|ja|1|jb|imm[10:0]`
+ //!
+ //! Where:
+ //!
+ //! - `ja` is calculated as imm[19] ^ imm[18] ^ 1.
+ //! - `jb` is calculated as imm[19] ^ imm[17] ^ 1.
+ kThumb32_BCond,
+
+ // AArch32 Specific Offset Formats (A32)
+ // -------------------------------------
+
+ //! AArch32 ADR instruction, which uses a standard 12-bit immediate encoding that is used by other ARM instructions.
+ kAArch32_ADR,
+
+ //! AArch32 signed offset that is similar to `kSignedOffset`, however it uses absolute value of the offset and its
+ //! sign is encoded in 23rd bit of the opcode.
+ //!
+ //! `|........|U.......|........|........|`
+ //!
+ kAArch32_U23_SignedOffset,
+
+ //! AArch32 offset format that encodes 8-bit offset as:
+ //!
+ //! `|........|U.......|....|imm[7:4]|....|imm[3:0]|`
+ //!
+ //! in a 32-bit word, where U is a sign of the displacement and the displacement itself is encoded as its absolute
+ //! value.
+ kAArch32_U23_0To3At0_4To7At8,
+
+ //! AArch32 offset format that encodes a signed 25-bit offset as:
+ //!
+ //! `|.......|imm[0]|imm[24:1]|`
+ //!
+ //! in a 32-bit word.
+ kAArch32_1To24At0_0At24,
+
//! Maximum value of `OffsetFormatType`.
- kMaxValue = kAArch64_ADRP
+ kMaxValue = kAArch32_1To24At0_0At24
};
//! Provides information about formatting offsets, absolute addresses, or their parts. Offset format is used by both
@@ -348,26 +419,35 @@ struct OffsetFormat {
//! \{
//! Returns the type of the offset.
- inline OffsetType type() const noexcept { return _type; }
+ ASMJIT_INLINE_NODEBUG OffsetType type() const noexcept { return _type; }
- //! Returns flags.
- inline uint32_t flags() const noexcept { return _flags; }
+ //! Returns whether the offset is encoded as an absolute value of the offset with additional field(s) that represent
+ //! the sign (AArch32 U/N fields in the opcode).
+ //!
+ //! If true, the offset itself is always positive and a separate U/N field is used to indicate the sign of the offset
+ //! (usually `U==1` means ADD, but sometimes `N==1` means negative offset, which implies SUB).
+ ASMJIT_INLINE_NODEBUG bool hasSignBit() const noexcept {
+ return _type == OffsetType::kThumb32_ADR ||
+ _type == OffsetType::kAArch32_ADR ||
+ _type == OffsetType::kAArch32_U23_SignedOffset ||
+ _type == OffsetType::kAArch32_U23_0To3At0_4To7At8;
+ }
+ //! Returns flags.
+ ASMJIT_INLINE_NODEBUG uint32_t flags() const noexcept { return _flags; }
//! Returns the size of the region/instruction where the offset is encoded.
- inline uint32_t regionSize() const noexcept { return _regionSize; }
-
+ ASMJIT_INLINE_NODEBUG uint32_t regionSize() const noexcept { return _regionSize; }
//! Returns the offset of the word relative to the start of the region where the offset is.
- inline uint32_t valueOffset() const noexcept { return _valueOffset; }
-
+ ASMJIT_INLINE_NODEBUG uint32_t valueOffset() const noexcept { return _valueOffset; }
//! Returns the size of the data-type (word) that contains the offset, in bytes.
- inline uint32_t valueSize() const noexcept { return _valueSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t valueSize() const noexcept { return _valueSize; }
//! Returns the count of bits of the offset value in the data it's stored in.
- inline uint32_t immBitCount() const noexcept { return _immBitCount; }
+ ASMJIT_INLINE_NODEBUG uint32_t immBitCount() const noexcept { return _immBitCount; }
//! Returns the bit-shift of the offset value in the data it's stored in.
- inline uint32_t immBitShift() const noexcept { return _immBitShift; }
+ ASMJIT_INLINE_NODEBUG uint32_t immBitShift() const noexcept { return _immBitShift; }
//! Returns the number of least significant bits of the offset value, that must be zero and that are not part of
//! the encoded data.
- inline uint32_t immDiscardLsb() const noexcept { return _immDiscardLsb; }
+ ASMJIT_INLINE_NODEBUG uint32_t immDiscardLsb() const noexcept { return _immDiscardLsb; }
//! Resets this offset format to a simple data value of `dataSize` bytes.
//!
@@ -456,18 +536,18 @@ struct RelocEntry {
//! \name Accessors
//! \{
- inline uint32_t id() const noexcept { return _id; }
+ ASMJIT_INLINE_NODEBUG uint32_t id() const noexcept { return _id; }
- inline RelocType relocType() const noexcept { return _relocType; }
- inline const OffsetFormat& format() const noexcept { return _format; }
+ ASMJIT_INLINE_NODEBUG RelocType relocType() const noexcept { return _relocType; }
+ ASMJIT_INLINE_NODEBUG const OffsetFormat& format() const noexcept { return _format; }
- inline uint32_t sourceSectionId() const noexcept { return _sourceSectionId; }
- inline uint32_t targetSectionId() const noexcept { return _targetSectionId; }
+ ASMJIT_INLINE_NODEBUG uint32_t sourceSectionId() const noexcept { return _sourceSectionId; }
+ ASMJIT_INLINE_NODEBUG uint32_t targetSectionId() const noexcept { return _targetSectionId; }
- inline uint64_t sourceOffset() const noexcept { return _sourceOffset; }
- inline uint64_t payload() const noexcept { return _payload; }
+ ASMJIT_INLINE_NODEBUG uint64_t sourceOffset() const noexcept { return _sourceOffset; }
+ ASMJIT_INLINE_NODEBUG uint64_t payload() const noexcept { return _payload; }
- Expression* payloadAsExpression() const noexcept {
+ ASMJIT_INLINE_NODEBUG Expression* payloadAsExpression() const noexcept {
return reinterpret_cast<Expression*>(uintptr_t(_payload));
}
@@ -562,53 +642,53 @@ public:
// compiler targeting 64-bit CPU will add to align the structure to 64-bits.
//! Returns label id.
- inline uint32_t id() const noexcept { return _customData; }
+ ASMJIT_INLINE_NODEBUG uint32_t id() const noexcept { return _customData; }
//! Sets label id (internal, used only by `CodeHolder`).
- inline void _setId(uint32_t id) noexcept { _customData = id; }
+ ASMJIT_INLINE_NODEBUG void _setId(uint32_t id) noexcept { _customData = id; }
//! Returns label type.
- inline LabelType type() const noexcept { return _type; }
+ ASMJIT_INLINE_NODEBUG LabelType type() const noexcept { return _type; }
//! Tests whether the label has a parent label.
- inline bool hasParent() const noexcept { return _parentId != Globals::kInvalidId; }
+ ASMJIT_INLINE_NODEBUG bool hasParent() const noexcept { return _parentId != Globals::kInvalidId; }
//! Returns label's parent id.
- inline uint32_t parentId() const noexcept { return _parentId; }
+ ASMJIT_INLINE_NODEBUG uint32_t parentId() const noexcept { return _parentId; }
//! Returns the section where the label was bound.
//!
//! If the label was not yet bound the return value is `nullptr`.
- inline Section* section() const noexcept { return _section; }
+ ASMJIT_INLINE_NODEBUG Section* section() const noexcept { return _section; }
//! Tests whether the label has name.
- inline bool hasName() const noexcept { return !_name.empty(); }
+ ASMJIT_INLINE_NODEBUG bool hasName() const noexcept { return !_name.empty(); }
//! Returns the label's name.
//!
//! \note Local labels will return their local name without their parent part, for example ".L1".
- inline const char* name() const noexcept { return _name.data(); }
+ ASMJIT_INLINE_NODEBUG const char* name() const noexcept { return _name.data(); }
//! Returns size of label's name.
//!
//! \note Label name is always null terminated, so you can use `strlen()` to get it, however, it's also cached in
//! `LabelEntry` itself, so if you want to know the size the fastest way is to call `LabelEntry::nameSize()`.
- inline uint32_t nameSize() const noexcept { return _name.size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t nameSize() const noexcept { return _name.size(); }
//! Returns links associated with this label.
- inline LabelLink* links() const noexcept { return _links; }
+ ASMJIT_INLINE_NODEBUG LabelLink* links() const noexcept { return _links; }
//! Tests whether the label is bound.
- inline bool isBound() const noexcept { return _section != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool isBound() const noexcept { return _section != nullptr; }
//! Tests whether the label is bound to a the given `sectionId`.
- inline bool isBoundTo(Section* section) const noexcept { return _section == section; }
+ ASMJIT_INLINE_NODEBUG bool isBoundTo(Section* section) const noexcept { return _section == section; }
//! Returns the label offset (only useful if the label is bound).
- inline uint64_t offset() const noexcept { return _offset; }
+ ASMJIT_INLINE_NODEBUG uint64_t offset() const noexcept { return _offset; }
//! Returns the hash-value of label's name and its parent label (if any).
//!
//! Label hash is calculated as `HASH(Name) ^ ParentId`. The hash function is implemented in `Support::hashString()`
//! and `Support::hashRound()`.
- inline uint32_t hashCode() const noexcept { return _hashCode; }
+ ASMJIT_INLINE_NODEBUG uint32_t hashCode() const noexcept { return _hashCode; }
//! \}
};
@@ -640,6 +720,8 @@ public:
//! Environment information.
Environment _environment;
+ //! CPU features of the target architecture.
+ CpuFeatures _cpuFeatures;
//! Base address or \ref Globals::kNoBaseAddress.
uint64_t _baseAddress;
@@ -685,7 +767,7 @@ public:
ASMJIT_API explicit CodeHolder(const Support::Temporary* temporary = nullptr) noexcept;
//! \overload
- inline explicit CodeHolder(const Support::Temporary& temporary) noexcept
+ ASMJIT_INLINE_NODEBUG explicit CodeHolder(const Support::Temporary& temporary) noexcept
: CodeHolder(&temporary) {}
//! Destroys the CodeHolder and frees all resources it has allocated.
@@ -694,10 +776,12 @@ public:
//! Tests whether the `CodeHolder` has been initialized.
//!
//! Emitters can be only attached to initialized `CodeHolder` instances.
- inline bool isInitialized() const noexcept { return _environment.isInitialized(); }
+ ASMJIT_INLINE_NODEBUG bool isInitialized() const noexcept { return _environment.isInitialized(); }
//! Initializes CodeHolder to hold code described by the given `environment` and `baseAddress`.
ASMJIT_API Error init(const Environment& environment, uint64_t baseAddress = Globals::kNoBaseAddress) noexcept;
+ //! Initializes CodeHolder to hold code described by the given `environment`, `cpuFeatures`, and `baseAddress`.
+ ASMJIT_API Error init(const Environment& environment, const CpuFeatures& cpuFeatures, uint64_t baseAddress = Globals::kNoBaseAddress) noexcept;
//! Detaches all code-generators attached and resets the `CodeHolder`.
ASMJIT_API void reset(ResetPolicy resetPolicy = ResetPolicy::kSoft) noexcept;
@@ -721,7 +805,7 @@ public:
//! \note This should be only used for AsmJit's purposes. Code holder uses arena allocator to allocate everything,
//! so anything allocated through this allocator will be invalidated by \ref CodeHolder::reset() or by CodeHolder's
//! destructor.
- inline ZoneAllocator* allocator() const noexcept { return const_cast<ZoneAllocator*>(&_allocator); }
+ ASMJIT_INLINE_NODEBUG ZoneAllocator* allocator() const noexcept { return const_cast<ZoneAllocator*>(&_allocator); }
//! \}
@@ -729,17 +813,20 @@ public:
//! \{
//! Returns the target environment information.
- inline const Environment& environment() const noexcept { return _environment; }
+ ASMJIT_INLINE_NODEBUG const Environment& environment() const noexcept { return _environment; }
//! Returns the target architecture.
- inline Arch arch() const noexcept { return environment().arch(); }
+ ASMJIT_INLINE_NODEBUG Arch arch() const noexcept { return environment().arch(); }
//! Returns the target sub-architecture.
- inline SubArch subArch() const noexcept { return environment().subArch(); }
+ ASMJIT_INLINE_NODEBUG SubArch subArch() const noexcept { return environment().subArch(); }
+
+ //! Returns the minimum CPU features of the target architecture.
+ ASMJIT_INLINE_NODEBUG const CpuFeatures& cpuFeatures() const noexcept { return _cpuFeatures; }
//! Tests whether a static base-address is set.
- inline bool hasBaseAddress() const noexcept { return _baseAddress != Globals::kNoBaseAddress; }
+ ASMJIT_INLINE_NODEBUG bool hasBaseAddress() const noexcept { return _baseAddress != Globals::kNoBaseAddress; }
//! Returns a static base-address or \ref Globals::kNoBaseAddress, if not set.
- inline uint64_t baseAddress() const noexcept { return _baseAddress; }
+ ASMJIT_INLINE_NODEBUG uint64_t baseAddress() const noexcept { return _baseAddress; }
//! \}
@@ -747,7 +834,7 @@ public:
//! \{
//! Returns a vector of attached emitters.
- inline const ZoneVector<BaseEmitter*>& emitters() const noexcept { return _emitters; }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<BaseEmitter*>& emitters() const noexcept { return _emitters; }
//! \}
@@ -755,23 +842,23 @@ public:
//! \{
//! Returns the attached logger.
- inline Logger* logger() const noexcept { return _logger; }
+ ASMJIT_INLINE_NODEBUG Logger* logger() const noexcept { return _logger; }
//! Attaches a `logger` to CodeHolder and propagates it to all attached emitters.
ASMJIT_API void setLogger(Logger* logger) noexcept;
//! Resets the logger to none.
- inline void resetLogger() noexcept { setLogger(nullptr); }
+ ASMJIT_INLINE_NODEBUG void resetLogger() noexcept { setLogger(nullptr); }
//! \name Error Handling
//! \{
//! Tests whether the CodeHolder has an attached error handler, see \ref ErrorHandler.
- inline bool hasErrorHandler() const noexcept { return _errorHandler != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasErrorHandler() const noexcept { return _errorHandler != nullptr; }
//! Returns the attached error handler.
- inline ErrorHandler* errorHandler() const noexcept { return _errorHandler; }
+ ASMJIT_INLINE_NODEBUG ErrorHandler* errorHandler() const noexcept { return _errorHandler; }
//! Attach an error handler to this `CodeHolder`.
ASMJIT_API void setErrorHandler(ErrorHandler* errorHandler) noexcept;
//! Resets the error handler to none.
- inline void resetErrorHandler() noexcept { setErrorHandler(nullptr); }
+ ASMJIT_INLINE_NODEBUG void resetErrorHandler() noexcept { setErrorHandler(nullptr); }
//! \}
@@ -794,14 +881,14 @@ public:
//! \{
//! Returns an array of `Section*` records.
- inline const ZoneVector<Section*>& sections() const noexcept { return _sections; }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<Section*>& sections() const noexcept { return _sections; }
//! Returns an array of `Section*` records sorted according to section order first, then section id.
- inline const ZoneVector<Section*>& sectionsByOrder() const noexcept { return _sectionsByOrder; }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<Section*>& sectionsByOrder() const noexcept { return _sectionsByOrder; }
//! Returns the number of sections.
- inline uint32_t sectionCount() const noexcept { return _sections.size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t sectionCount() const noexcept { return _sections.size(); }
//! Tests whether the given `sectionId` is valid.
- inline bool isSectionValid(uint32_t sectionId) const noexcept { return sectionId < _sections.size(); }
+ ASMJIT_INLINE_NODEBUG bool isSectionValid(uint32_t sectionId) const noexcept { return sectionId < _sections.size(); }
//! Creates a new section and return its pointer in `sectionOut`.
//!
@@ -809,7 +896,7 @@ public:
ASMJIT_API Error newSection(Section** sectionOut, const char* name, size_t nameSize = SIZE_MAX, SectionFlags flags = SectionFlags::kNone, uint32_t alignment = 1, int32_t order = 0) noexcept;
//! Returns a section entry of the given index.
- inline Section* sectionById(uint32_t sectionId) const noexcept { return _sections[sectionId]; }
+ ASMJIT_INLINE_NODEBUG Section* sectionById(uint32_t sectionId) const noexcept { return _sections[sectionId]; }
//! Returns section-id that matches the given `name`.
//!
@@ -819,10 +906,10 @@ public:
//! Returns '.text' section (section that commonly represents code).
//!
//! \note Text section is always the first section in \ref CodeHolder::sections() array.
- inline Section* textSection() const noexcept { return _sections[0]; }
+ ASMJIT_INLINE_NODEBUG Section* textSection() const noexcept { return _sections[0]; }
//! Tests whether '.addrtab' section exists.
- inline bool hasAddressTable() const noexcept { return _addressTableSection != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasAddressTable() const noexcept { return _addressTableSection != nullptr; }
//! Returns '.addrtab' section.
//!
@@ -830,7 +917,7 @@ public:
//! addresses that cannot be encoded in instructions like 'jmp' or 'call'.
//!
//! \note This section is created on demand, the returned pointer can be null.
- inline Section* addressTableSection() const noexcept { return _addressTableSection; }
+ ASMJIT_INLINE_NODEBUG Section* addressTableSection() const noexcept { return _addressTableSection; }
//! Ensures that '.addrtab' section exists (creates it if it doesn't) and
//! returns it. Can return `nullptr` on out of memory condition.
@@ -843,7 +930,7 @@ public:
//! use the same slot.
//!
//! This function should be considered internal as it's used by assemblers to insert an absolute address into the
- //! address table. Inserting address into address table without creating a particula relocation entry makes no sense.
+ //! address table. Inserting address into address table without creating a particular relocation entry makes no sense.
ASMJIT_API Error addAddressToAddressTable(uint64_t address) noexcept;
//! \}
@@ -852,40 +939,40 @@ public:
//! \{
//! Returns array of `LabelEntry*` records.
- inline const ZoneVector<LabelEntry*>& labelEntries() const noexcept { return _labelEntries; }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<LabelEntry*>& labelEntries() const noexcept { return _labelEntries; }
//! Returns number of labels created.
- inline uint32_t labelCount() const noexcept { return _labelEntries.size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t labelCount() const noexcept { return _labelEntries.size(); }
//! Tests whether the label having `id` is valid (i.e. created by `newLabelEntry()`).
- inline bool isLabelValid(uint32_t labelId) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isLabelValid(uint32_t labelId) const noexcept {
return labelId < _labelEntries.size();
}
//! Tests whether the `label` is valid (i.e. created by `newLabelEntry()`).
- inline bool isLabelValid(const Label& label) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isLabelValid(const Label& label) const noexcept {
return label.id() < _labelEntries.size();
}
//! \overload
- inline bool isLabelBound(uint32_t labelId) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isLabelBound(uint32_t labelId) const noexcept {
return isLabelValid(labelId) && _labelEntries[labelId]->isBound();
}
//! Tests whether the `label` is already bound.
//!
//! Returns `false` if the `label` is not valid.
- inline bool isLabelBound(const Label& label) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isLabelBound(const Label& label) const noexcept {
return isLabelBound(label.id());
}
//! Returns LabelEntry of the given label `id`.
- inline LabelEntry* labelEntry(uint32_t labelId) const noexcept {
+ ASMJIT_INLINE_NODEBUG LabelEntry* labelEntry(uint32_t labelId) const noexcept {
return isLabelValid(labelId) ? _labelEntries[labelId] : static_cast<LabelEntry*>(nullptr);
}
//! Returns LabelEntry of the given `label`.
- inline LabelEntry* labelEntry(const Label& label) const noexcept {
+ ASMJIT_INLINE_NODEBUG LabelEntry* labelEntry(const Label& label) const noexcept {
return labelEntry(label.id());
}
@@ -893,13 +980,13 @@ public:
//!
//! The offset returned is relative to the start of the section. Zero offset is returned for unbound labels,
//! which is their initial offset value.
- inline uint64_t labelOffset(uint32_t labelId) const noexcept {
+ ASMJIT_INLINE_NODEBUG uint64_t labelOffset(uint32_t labelId) const noexcept {
ASMJIT_ASSERT(isLabelValid(labelId));
return _labelEntries[labelId]->offset();
}
//! \overload
- inline uint64_t labelOffset(const Label& label) const noexcept {
+ ASMJIT_INLINE_NODEBUG uint64_t labelOffset(const Label& label) const noexcept {
return labelOffset(label.id());
}
@@ -944,7 +1031,7 @@ public:
//!
//! If the named label doesn't a default constructed \ref Label is returned,
//! which has its id set to \ref Globals::kInvalidId.
- inline Label labelByName(const char* name, size_t nameSize = SIZE_MAX, uint32_t parentId = Globals::kInvalidId) noexcept {
+ ASMJIT_INLINE_NODEBUG Label labelByName(const char* name, size_t nameSize = SIZE_MAX, uint32_t parentId = Globals::kInvalidId) noexcept {
return Label(labelIdByName(name, nameSize, parentId));
}
@@ -954,9 +1041,9 @@ public:
ASMJIT_API uint32_t labelIdByName(const char* name, size_t nameSize = SIZE_MAX, uint32_t parentId = Globals::kInvalidId) noexcept;
//! Tests whether there are any unresolved label links.
- inline bool hasUnresolvedLinks() const noexcept { return _unresolvedLinkCount != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasUnresolvedLinks() const noexcept { return _unresolvedLinkCount != 0; }
//! Returns the number of label links, which are unresolved.
- inline size_t unresolvedLinkCount() const noexcept { return _unresolvedLinkCount; }
+ ASMJIT_INLINE_NODEBUG size_t unresolvedLinkCount() const noexcept { return _unresolvedLinkCount; }
//! Creates a new label-link used to store information about yet unbound labels.
//!
@@ -979,12 +1066,12 @@ public:
//! \{
//! Tests whether the code contains relocation entries.
- inline bool hasRelocEntries() const noexcept { return !_relocations.empty(); }
+ ASMJIT_INLINE_NODEBUG bool hasRelocEntries() const noexcept { return !_relocations.empty(); }
//! Returns array of `RelocEntry*` records.
- inline const ZoneVector<RelocEntry*>& relocEntries() const noexcept { return _relocations; }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<RelocEntry*>& relocEntries() const noexcept { return _relocations; }
//! Returns a RelocEntry of the given `id`.
- inline RelocEntry* relocEntry(uint32_t id) const noexcept { return _relocations[id]; }
+ ASMJIT_INLINE_NODEBUG RelocEntry* relocEntry(uint32_t id) const noexcept { return _relocations[id]; }
//! Creates a new relocation entry of type `relocType`.
//!
@@ -1011,7 +1098,8 @@ public:
//! Relocates the code to the given `baseAddress`.
//!
//! \param baseAddress Absolute base address where the code will be relocated to. Please note that nothing is
- //! copied to such base address, it's just an absolute value used by the relocator to resolve all stored relocations.
+ //! copied to such base address, it's just an absolute value used by the relocation code to resolve all stored
+ //! relocations.
//!
//! \note This should never be called more than once.
ASMJIT_API Error relocateToBase(uint64_t baseAddress) noexcept;
diff --git a/3rdparty/asmjit/src/asmjit/core/codewriter.cpp b/3rdparty/asmjit/src/asmjit/core/codewriter.cpp
index 1babc5f172e..2ee5b38cda5 100644
--- a/3rdparty/asmjit/src/asmjit/core/codewriter.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/codewriter.cpp
@@ -6,6 +6,7 @@
#include "../core/api-build_p.h"
#include "../core/codeholder.h"
#include "../core/codewriter_p.h"
+#include "../arm/armutils.h"
ASMJIT_BEGIN_NAMESPACE
@@ -19,9 +20,20 @@ bool CodeWriterUtils::encodeOffset32(uint32_t* dst, int64_t offset64, const Offs
return false;
uint32_t value;
+ uint32_t u = 0;
+ bool unsignedLogic = format.type() == OffsetType::kUnsignedOffset;
+
+ // First handle all offsets that use additional field for their sign and the offset is encoded as its
+ // absolute value.
+ if (format.hasSignBit()) {
+ u = uint32_t(offset64 >= 0);
+ if (u == 0)
+ offset64 = -offset64;
+ unsignedLogic = true;
+ }
// First handle all unsigned offset types.
- if (format.type() == OffsetType::kUnsignedOffset) {
+ if (unsignedLogic) {
if (discardLsb) {
ASMJIT_ASSERT(discardLsb <= 32);
if ((offset64 & Support::lsbMask<uint32_t>(discardLsb)) != 0)
@@ -57,6 +69,97 @@ bool CodeWriterUtils::encodeOffset32(uint32_t* dst, int64_t offset64, const Offs
return true;
}
+ // Opcode: {.....|imm:1|..N.N|......|imm:3|....|imm:8}
+ case OffsetType::kThumb32_ADR: {
+ // Sanity checks.
+ if (format.valueSize() != 4 || bitCount != 12 || bitShift != 0)
+ return false;
+
+ uint32_t imm8 = (value & 0x00FFu);
+ uint32_t imm3 = (value & 0x0700u) << (12 - 8);
+ uint32_t imm1 = (value & 0x0800u) << (26 - 11);
+ uint32_t n = u ^ 1u;
+
+ *dst = imm8 | imm3 | imm1 | (n << 21) | (n << 23);
+ return true;
+ }
+
+ // Opcode: {....|.|imm[22]|imm[19:10]|..|ja|.|jb|imm[9:0]|.}
+ case OffsetType::kThumb32_BLX:
+ // The calculation is the same as `B`, but the first LSB bit must be zero, so account for that.
+ value <<= 1;
+ ASMJIT_FALLTHROUGH;
+
+ // Opcode: {....|.|imm[23]|imm[20:11]|..|ja|.|jb|imm[10:0]}
+ case OffsetType::kThumb32_B: {
+ // Sanity checks.
+ if (format.valueSize() != 4)
+ return false;
+
+ uint32_t ia = (value & 0x0007FFu);
+ uint32_t ib = (value & 0x1FF800u) << (16 - 11);
+ uint32_t ic = (value & 0x800000u) << (26 - 23);
+ uint32_t ja = ((~value >> 23) ^ (value >> 22)) & 1u;
+ uint32_t jb = ((~value >> 23) ^ (value >> 21)) & 1u;
+
+ *dst = ia | ib | ic | (ja << 14) | (jb << 11);
+ return true;
+ }
+
+ // Opcode: {....|.|imm[19]|....|imm[16:11]|..|ja|.|jb|imm[10:0]}
+ case OffsetType::kThumb32_BCond: {
+ // Sanity checks.
+ if (format.valueSize() != 4 || bitCount != 20 || bitShift != 0)
+ return false;
+
+ uint32_t ia = (value & 0x0007FFu);
+ uint32_t ib = (value & 0x01F800u) << (16 - 11);
+ uint32_t ic = (value & 0x080000u) << (26 - 19);
+ uint32_t ja = ((~value >> 19) ^ (value >> 22)) & 1u;
+ uint32_t jb = ((~value >> 19) ^ (value >> 21)) & 1u;
+
+ *dst = ia | ib | ic | (ja << 14) | (jb << 11);
+ return true;
+ }
+
+ case OffsetType::kAArch32_ADR: {
+ uint32_t encodedImm;
+ if (!arm::Utils::encodeAArch32Imm(value, &encodedImm))
+ return false;
+
+ *dst = (Support::bitMask(22) << u) | (encodedImm << bitShift);
+ return true;
+ }
+
+ case OffsetType::kAArch32_U23_SignedOffset: {
+ *dst = (value << bitShift) | (u << 23);
+ return true;
+ }
+
+ case OffsetType::kAArch32_U23_0To3At0_4To7At8: {
+ // Sanity checks.
+ if (format.valueSize() != 4 || bitCount != 8 || bitShift != 0)
+ return false;
+
+ uint32_t immLo = (value & 0x0Fu);
+ uint32_t immHi = (value & 0xF0u) << (8 - 4);
+
+ *dst = immLo | immHi | (u << 23);
+ return true;
+ }
+
+ case OffsetType::kAArch32_1To24At0_0At24: {
+ // Sanity checks.
+ if (format.valueSize() != 4 || bitCount != 25 || bitShift != 0)
+ return false;
+
+ uint32_t immLo = (value & 0x0000001u) << 24;
+ uint32_t immHi = (value & 0x1FFFFFEu) >> 1;
+
+ *dst = immLo | immHi;
+ return true;
+ }
+
case OffsetType::kAArch64_ADR:
case OffsetType::kAArch64_ADRP: {
// Sanity checks.
diff --git a/3rdparty/asmjit/src/asmjit/core/compiler.cpp b/3rdparty/asmjit/src/asmjit/core/compiler.cpp
index b1c6b803b29..b09ae396608 100644
--- a/3rdparty/asmjit/src/asmjit/core/compiler.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/compiler.cpp
@@ -7,6 +7,7 @@
#ifndef ASMJIT_NO_COMPILER
#include "../core/assembler.h"
+#include "../core/builder_p.h"
#include "../core/compiler.h"
#include "../core/cpuinfo.h"
#include "../core/logger.h"
@@ -103,9 +104,13 @@ Error BaseCompiler::newFuncNode(FuncNode** out, const FuncSignature& signature)
}
Error BaseCompiler::addFuncNode(FuncNode** out, const FuncSignature& signature) {
+ State state = _grabState();
+
ASMJIT_PROPAGATE(newFuncNode(out, signature));
ASMJIT_ASSUME(*out != nullptr);
+ BaseBuilder_assignInlineComment(this, *out, state.comment);
+
addFunc(*out);
return kErrorOk;
}
@@ -127,7 +132,13 @@ Error BaseCompiler::newFuncRetNode(FuncRetNode** out, const Operand_& o0, const
}
Error BaseCompiler::addFuncRetNode(FuncRetNode** out, const Operand_& o0, const Operand_& o1) {
+ State state = _grabState();
+
ASMJIT_PROPAGATE(newFuncRetNode(out, o0, o1));
+ ASMJIT_ASSUME(*out != nullptr);
+
+ BaseBuilder_assignInlineComment(this, *out, state.comment);
+
addNode(*out);
return kErrorOk;
}
@@ -146,6 +157,7 @@ FuncNode* BaseCompiler::addFunc(FuncNode* func) {
Error BaseCompiler::endFunc() {
FuncNode* func = _func;
+ resetState();
if (ASMJIT_UNLIKELY(!func))
return reportError(DebugUtils::errored(kErrorInvalidState));
@@ -196,7 +208,12 @@ Error BaseCompiler::newInvokeNode(InvokeNode** out, InstId instId, const Operand
}
Error BaseCompiler::addInvokeNode(InvokeNode** out, InstId instId, const Operand_& o0, const FuncSignature& signature) {
+ State state = _grabState();
+
ASMJIT_PROPAGATE(newInvokeNode(out, instId, o0, signature));
+ ASMJIT_ASSUME(*out != nullptr);
+
+ BaseBuilder_assignInstState(this, *out, state);
addNode(*out);
return kErrorOk;
}
@@ -231,7 +248,7 @@ Error BaseCompiler::newVirtReg(VirtReg** out, TypeId typeId, OperandSignature si
uint32_t size = TypeUtils::sizeOf(typeId);
uint32_t alignment = Support::min<uint32_t>(size, 64);
- vReg = new(vReg) VirtReg(signature, Operand::indexToVirtId(index), size, alignment, typeId);
+ vReg = new(Support::PlacementNew{vReg}) VirtReg(signature, Operand::indexToVirtId(index), size, alignment, typeId);
#ifndef ASMJIT_NO_LOGGING
if (name && name[0] != '\0')
@@ -473,7 +490,7 @@ Error BaseCompiler::newJumpNode(JumpNode** out, InstId instId, InstOptions instO
if (ASMJIT_UNLIKELY(!node))
return reportError(DebugUtils::errored(kErrorOutOfMemory));
- node = new(node) JumpNode(this, instId, instOptions, opCount, annotation);
+ node = new(Support::PlacementNew{node}) JumpNode(this, instId, instOptions, opCount, annotation);
node->setOp(0, o0);
node->resetOpRange(opCount, JumpNode::kBaseOpCapacity);
@@ -481,20 +498,13 @@ Error BaseCompiler::newJumpNode(JumpNode** out, InstId instId, InstOptions instO
}
Error BaseCompiler::emitAnnotatedJump(InstId instId, const Operand_& o0, JumpAnnotation* annotation) {
- InstOptions options = instOptions() | forcedInstOptions();
- RegOnly extra = extraReg();
- const char* comment = inlineComment();
-
- resetInstOptions();
- resetInlineComment();
- resetExtraReg();
+ State state = _grabState();
JumpNode* node;
- ASMJIT_PROPAGATE(newJumpNode(&node, instId, options, o0, annotation));
+ ASMJIT_PROPAGATE(newJumpNode(&node, instId, state.options, o0, annotation));
- node->setExtraReg(extra);
- if (comment)
- node->setInlineComment(static_cast<char*>(_dataZone.dup(comment, strlen(comment), true)));
+ node->setExtraReg(state.extraReg);
+ BaseBuilder_assignInlineComment(this, node, state.comment);
addNode(node);
return kErrorOk;
@@ -577,6 +587,12 @@ Error FuncPass::run(Zone* zone, Logger* logger) {
return kErrorOk;
}
+// [[pure virtual]]
+Error FuncPass::runOnFunction(Zone* zone, Logger* logger, FuncNode* func) {
+ DebugUtils::unused(zone, logger, func);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
ASMJIT_END_NAMESPACE
#endif // !ASMJIT_NO_COMPILER
diff --git a/3rdparty/asmjit/src/asmjit/core/compiler.h b/3rdparty/asmjit/src/asmjit/core/compiler.h
index 709fd952acc..7d4b47c4597 100644
--- a/3rdparty/asmjit/src/asmjit/core/compiler.h
+++ b/3rdparty/asmjit/src/asmjit/core/compiler.h
@@ -47,6 +47,7 @@ class InvokeNode;
//! Check out architecture specific compilers for more details and examples:
//!
//! - \ref x86::Compiler - X86/X64 compiler implementation.
+//! - \ref a64::Compiler - AArch64 compiler implementation.
class ASMJIT_VIRTAPI BaseCompiler : public BaseBuilder {
public:
ASMJIT_NONCOPYABLE(BaseCompiler)
@@ -77,7 +78,7 @@ public:
//! Creates a new `BaseCompiler` instance.
ASMJIT_API BaseCompiler() noexcept;
//! Destroys the `BaseCompiler` instance.
- ASMJIT_API virtual ~BaseCompiler() noexcept;
+ ASMJIT_API ~BaseCompiler() noexcept override;
//! \}
@@ -95,7 +96,7 @@ public:
ASMJIT_API Error addFuncRetNode(FuncRetNode** ASMJIT_NONNULL(out), const Operand_& o0, const Operand_& o1);
//! Returns the current function.
- inline FuncNode* func() const noexcept { return _func; }
+ ASMJIT_INLINE_NODEBUG FuncNode* func() const noexcept { return _func; }
//! Creates a new \ref FuncNode with the given `signature` and returns it.
inline FuncNode* newFunc(const FuncSignature& signature) {
@@ -162,6 +163,8 @@ public:
//!
//! \note This version accepts a snprintf() format `fmt` followed by a variadic arguments.
ASMJIT_API Error _newRegFmt(BaseReg* ASMJIT_NONNULL(out), TypeId typeId, const char* fmt, ...);
+ //! \overload
+ inline Error _newRegFmt(BaseReg* ASMJIT_NONNULL(out), TypeId typeId) { return _newRegFmt(out, typeId, nullptr); }
//! Creates a new virtual register compatible with the provided reference register `ref`.
ASMJIT_API Error _newReg(BaseReg* ASMJIT_NONNULL(out), const BaseReg& ref, const char* name = nullptr);
@@ -172,12 +175,12 @@ public:
ASMJIT_API Error _newRegFmt(BaseReg* ASMJIT_NONNULL(out), const BaseReg& ref, const char* fmt, ...);
//! Tests whether the given `id` is a valid virtual register id.
- inline bool isVirtIdValid(uint32_t id) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isVirtIdValid(uint32_t id) const noexcept {
uint32_t index = Operand::virtIdToIndex(id);
return index < _vRegArray.size();
}
//! Tests whether the given `reg` is a virtual register having a valid id.
- inline bool isVirtRegValid(const BaseReg& reg) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isVirtRegValid(const BaseReg& reg) const noexcept {
return isVirtIdValid(reg.id());
}
@@ -188,16 +191,16 @@ public:
}
//! Returns \ref VirtReg associated with the given `reg`.
- inline VirtReg* virtRegByReg(const BaseReg& reg) const noexcept { return virtRegById(reg.id()); }
+ ASMJIT_INLINE_NODEBUG VirtReg* virtRegByReg(const BaseReg& reg) const noexcept { return virtRegById(reg.id()); }
//! Returns \ref VirtReg associated with the given virtual register `index`.
//!
//! \note This is not the same as virtual register id. The conversion between id and its index is implemented
//! by \ref Operand_::virtIdToIndex() and \ref Operand_::indexToVirtId() functions.
- inline VirtReg* virtRegByIndex(uint32_t index) const noexcept { return _vRegArray[index]; }
+ ASMJIT_INLINE_NODEBUG VirtReg* virtRegByIndex(uint32_t index) const noexcept { return _vRegArray[index]; }
//! Returns an array of all virtual registers managed by the Compiler.
- inline const ZoneVector<VirtReg*>& virtRegs() const noexcept { return _vRegArray; }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<VirtReg*>& virtRegs() const noexcept { return _vRegArray; }
//! \name Stack
//! \{
@@ -211,7 +214,7 @@ public:
ASMJIT_API Error setStackSize(uint32_t virtId, uint32_t newSize, uint32_t newAlignment = 0);
//! Updates the stack size of a stack created by `_newStack()`.
- inline Error setStackSize(const BaseMem& mem, uint32_t newSize, uint32_t newAlignment = 0) {
+ ASMJIT_INLINE_NODEBUG Error setStackSize(const BaseMem& mem, uint32_t newSize, uint32_t newAlignment = 0) {
return setStackSize(mem.id(), newSize, newAlignment);
}
@@ -239,7 +242,7 @@ public:
//! \name Jump Annotations
//! \{
- inline const ZoneVector<JumpAnnotation*>& jumpAnnotations() const noexcept {
+ ASMJIT_INLINE_NODEBUG const ZoneVector<JumpAnnotation*>& jumpAnnotations() const noexcept {
return _jumpAnnotations;
}
@@ -286,7 +289,7 @@ public:
//! \name Construction & Destruction
//! \{
- inline JumpAnnotation(BaseCompiler* ASMJIT_NONNULL(compiler), uint32_t annotationId) noexcept
+ ASMJIT_INLINE_NODEBUG JumpAnnotation(BaseCompiler* ASMJIT_NONNULL(compiler), uint32_t annotationId) noexcept
: _compiler(compiler),
_annotationId(annotationId) {}
@@ -296,16 +299,16 @@ public:
//! \{
//! Returns the compiler that owns this JumpAnnotation.
- inline BaseCompiler* compiler() const noexcept { return _compiler; }
+ ASMJIT_INLINE_NODEBUG BaseCompiler* compiler() const noexcept { return _compiler; }
//! Returns the annotation id.
- inline uint32_t annotationId() const noexcept { return _annotationId; }
+ ASMJIT_INLINE_NODEBUG uint32_t annotationId() const noexcept { return _annotationId; }
//! Returns a vector of label identifiers that lists all targets of the jump.
- const ZoneVector<uint32_t>& labelIds() const noexcept { return _labelIds; }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<uint32_t>& labelIds() const noexcept { return _labelIds; }
//! Tests whether the given `label` is a target of this JumpAnnotation.
- inline bool hasLabel(const Label& label) const noexcept { return hasLabelId(label.id()); }
+ ASMJIT_INLINE_NODEBUG bool hasLabel(const Label& label) const noexcept { return hasLabelId(label.id()); }
//! Tests whether the given `labelId` is a target of this JumpAnnotation.
- inline bool hasLabelId(uint32_t labelId) const noexcept { return _labelIds.contains(labelId); }
+ ASMJIT_INLINE_NODEBUG bool hasLabelId(uint32_t labelId) const noexcept { return _labelIds.contains(labelId); }
//! \}
@@ -313,9 +316,9 @@ public:
//! \{
//! Adds the `label` to the list of targets of this JumpAnnotation.
- inline Error addLabel(const Label& label) noexcept { return addLabelId(label.id()); }
+ ASMJIT_INLINE_NODEBUG Error addLabel(const Label& label) noexcept { return addLabelId(label.id()); }
//! Adds the `labelId` to the list of targets of this JumpAnnotation.
- inline Error addLabelId(uint32_t labelId) noexcept { return _labelIds.append(&_compiler->_allocator, labelId); }
+ ASMJIT_INLINE_NODEBUG Error addLabelId(uint32_t labelId) noexcept { return _labelIds.append(&_compiler->_allocator, labelId); }
//! \}
};
@@ -325,7 +328,7 @@ public:
//! \note This node should be only used to represent jump where the jump target cannot be deduced by examining
//! instruction operands. For example if the jump target is register or memory location. This pattern is often
//! used to perform indirect jumps that use jump table, e.g. to implement `switch{}` statement.
-class JumpNode : public InstNode {
+class JumpNode : public InstNodeWithOperands<InstNode::kBaseOpCapacity> {
public:
ASMJIT_NONCOPYABLE(JumpNode)
@@ -340,7 +343,7 @@ public:
//! \{
inline JumpNode(BaseCompiler* ASMJIT_NONNULL(cc), InstId instId, InstOptions options, uint32_t opCount, JumpAnnotation* annotation) noexcept
- : InstNode(cc, instId, options, opCount, kBaseOpCapacity),
+ : InstNodeWithOperands(cc, instId, options, opCount),
_annotation(annotation) {
setType(NodeType::kJump);
}
@@ -351,11 +354,11 @@ public:
//! \{
//! Tests whether this JumpNode has associated a \ref JumpAnnotation.
- inline bool hasAnnotation() const noexcept { return _annotation != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasAnnotation() const noexcept { return _annotation != nullptr; }
//! Returns the \ref JumpAnnotation associated with this jump, or `nullptr`.
- inline JumpAnnotation* annotation() const noexcept { return _annotation; }
+ ASMJIT_INLINE_NODEBUG JumpAnnotation* annotation() const noexcept { return _annotation; }
//! Sets the \ref JumpAnnotation associated with this jump to `annotation`.
- inline void setAnnotation(JumpAnnotation* annotation) noexcept { _annotation = annotation; }
+ ASMJIT_INLINE_NODEBUG void setAnnotation(JumpAnnotation* annotation) noexcept { _annotation = annotation; }
//! \}
};
@@ -455,35 +458,35 @@ public:
//! \name Accessors
//! Returns function exit `LabelNode`.
- inline LabelNode* exitNode() const noexcept { return _exitNode; }
+ ASMJIT_INLINE_NODEBUG LabelNode* exitNode() const noexcept { return _exitNode; }
//! Returns function exit label.
- inline Label exitLabel() const noexcept { return _exitNode->label(); }
+ ASMJIT_INLINE_NODEBUG Label exitLabel() const noexcept { return _exitNode->label(); }
//! Returns "End of Func" sentinel node.
- inline SentinelNode* endNode() const noexcept { return _end; }
+ ASMJIT_INLINE_NODEBUG SentinelNode* endNode() const noexcept { return _end; }
//! Returns function detail.
- inline FuncDetail& detail() noexcept { return _funcDetail; }
+ ASMJIT_INLINE_NODEBUG FuncDetail& detail() noexcept { return _funcDetail; }
//! Returns function detail.
- inline const FuncDetail& detail() const noexcept { return _funcDetail; }
+ ASMJIT_INLINE_NODEBUG const FuncDetail& detail() const noexcept { return _funcDetail; }
//! Returns function frame.
- inline FuncFrame& frame() noexcept { return _frame; }
+ ASMJIT_INLINE_NODEBUG FuncFrame& frame() noexcept { return _frame; }
//! Returns function frame.
- inline const FuncFrame& frame() const noexcept { return _frame; }
+ ASMJIT_INLINE_NODEBUG const FuncFrame& frame() const noexcept { return _frame; }
//! Returns function attributes.
- inline FuncAttributes attributes() const noexcept { return _frame.attributes(); }
+ ASMJIT_INLINE_NODEBUG FuncAttributes attributes() const noexcept { return _frame.attributes(); }
//! Adds `attrs` to the function attributes.
- inline void addAttributes(FuncAttributes attrs) noexcept { _frame.addAttributes(attrs); }
+ ASMJIT_INLINE_NODEBUG void addAttributes(FuncAttributes attrs) noexcept { _frame.addAttributes(attrs); }
//! Returns arguments count.
- inline uint32_t argCount() const noexcept { return _funcDetail.argCount(); }
+ ASMJIT_INLINE_NODEBUG uint32_t argCount() const noexcept { return _funcDetail.argCount(); }
//! Returns argument packs.
- inline ArgPack* argPacks() const noexcept { return _args; }
+ ASMJIT_INLINE_NODEBUG ArgPack* argPacks() const noexcept { return _args; }
//! Tests whether the function has a return value.
- inline bool hasRet() const noexcept { return _funcDetail.hasRet(); }
+ ASMJIT_INLINE_NODEBUG bool hasRet() const noexcept { return _funcDetail.hasRet(); }
//! Returns argument pack at `argIndex`.
inline ArgPack& argPack(size_t argIndex) const noexcept {
@@ -531,7 +534,7 @@ public:
};
//! Function return, used by \ref BaseCompiler.
-class FuncRetNode : public InstNode {
+class FuncRetNode : public InstNodeWithOperands<InstNode::kBaseOpCapacity> {
public:
ASMJIT_NONCOPYABLE(FuncRetNode)
@@ -539,7 +542,8 @@ public:
//! \{
//! Creates a new `FuncRetNode` instance.
- inline FuncRetNode(BaseBuilder* ASMJIT_NONNULL(cb)) noexcept : InstNode(cb, BaseInst::kIdAbstract, InstOptions::kNone, 0) {
+ inline FuncRetNode(BaseBuilder* ASMJIT_NONNULL(cb)) noexcept
+ : InstNodeWithOperands(cb, BaseInst::kIdAbstract, InstOptions::kNone, 0) {
_any._nodeType = NodeType::kFuncRet;
}
@@ -547,12 +551,12 @@ public:
};
//! Function invocation, used by \ref BaseCompiler.
-class InvokeNode : public InstNode {
+class InvokeNode : public InstNodeWithOperands<InstNode::kBaseOpCapacity> {
public:
ASMJIT_NONCOPYABLE(InvokeNode)
//! Operand pack provides multiple operands that can be associated with a single return value of function
- //! argument. Sometims this is necessary to express an argument or return value that requires multiple
+ //! argument. Sometimes this is necessary to express an argument or return value that requires multiple
//! registers, for example 64-bit value in 32-bit mode or passing / returning homogeneous data structures.
struct OperandPack {
//! Operands.
@@ -594,7 +598,7 @@ public:
//! Creates a new `InvokeNode` instance.
inline InvokeNode(BaseBuilder* ASMJIT_NONNULL(cb), InstId instId, InstOptions options) noexcept
- : InstNode(cb, instId, options, kBaseOpCapacity),
+ : InstNodeWithOperands(cb, instId, options, 0),
_funcDetail(),
_args(nullptr) {
setType(NodeType::kInvoke);
@@ -614,29 +618,29 @@ public:
}
//! Returns the function detail.
- inline FuncDetail& detail() noexcept { return _funcDetail; }
+ ASMJIT_INLINE_NODEBUG FuncDetail& detail() noexcept { return _funcDetail; }
//! Returns the function detail.
- inline const FuncDetail& detail() const noexcept { return _funcDetail; }
+ ASMJIT_INLINE_NODEBUG const FuncDetail& detail() const noexcept { return _funcDetail; }
//! Returns the target operand.
- inline Operand& target() noexcept { return _opArray[0].as<Operand>(); }
+ ASMJIT_INLINE_NODEBUG Operand& target() noexcept { return op(0); }
//! \overload
- inline const Operand& target() const noexcept { return _opArray[0].as<Operand>(); }
+ ASMJIT_INLINE_NODEBUG const Operand& target() const noexcept { return op(0); }
//! Returns the number of function return values.
- inline bool hasRet() const noexcept { return _funcDetail.hasRet(); }
+ ASMJIT_INLINE_NODEBUG bool hasRet() const noexcept { return _funcDetail.hasRet(); }
//! Returns the number of function arguments.
- inline uint32_t argCount() const noexcept { return _funcDetail.argCount(); }
+ ASMJIT_INLINE_NODEBUG uint32_t argCount() const noexcept { return _funcDetail.argCount(); }
//! Returns operand pack representing function return value(s).
- inline OperandPack& retPack() noexcept { return _rets; }
+ ASMJIT_INLINE_NODEBUG OperandPack& retPack() noexcept { return _rets; }
//! Returns operand pack representing function return value(s).
- inline const OperandPack& retPack() const noexcept { return _rets; }
+ ASMJIT_INLINE_NODEBUG const OperandPack& retPack() const noexcept { return _rets; }
//! Returns the return value at the given `valueIndex`.
- inline Operand& ret(size_t valueIndex = 0) noexcept { return _rets[valueIndex]; }
+ ASMJIT_INLINE_NODEBUG Operand& ret(size_t valueIndex = 0) noexcept { return _rets[valueIndex]; }
//! \overload
- inline const Operand& ret(size_t valueIndex = 0) const noexcept { return _rets[valueIndex]; }
+ ASMJIT_INLINE_NODEBUG const Operand& ret(size_t valueIndex = 0) const noexcept { return _rets[valueIndex]; }
//! Returns operand pack representing function return value(s).
inline OperandPack& argPack(size_t argIndex) noexcept {
@@ -669,17 +673,17 @@ public:
}
//! Sets the function return value at `valueIndex` to `reg`.
- inline void setRet(size_t valueIndex, const BaseReg& reg) noexcept { _setRet(valueIndex, reg); }
+ ASMJIT_INLINE_NODEBUG void setRet(size_t valueIndex, const BaseReg& reg) noexcept { _setRet(valueIndex, reg); }
//! Sets the first function argument in a value-pack at `argIndex` to `reg`.
- inline void setArg(size_t argIndex, const BaseReg& reg) noexcept { _setArg(argIndex, 0, reg); }
+ ASMJIT_INLINE_NODEBUG void setArg(size_t argIndex, const BaseReg& reg) noexcept { _setArg(argIndex, 0, reg); }
//! Sets the first function argument in a value-pack at `argIndex` to `imm`.
- inline void setArg(size_t argIndex, const Imm& imm) noexcept { _setArg(argIndex, 0, imm); }
+ ASMJIT_INLINE_NODEBUG void setArg(size_t argIndex, const Imm& imm) noexcept { _setArg(argIndex, 0, imm); }
//! Sets the function argument at `argIndex` and `valueIndex` to `reg`.
- inline void setArg(size_t argIndex, size_t valueIndex, const BaseReg& reg) noexcept { _setArg(argIndex, valueIndex, reg); }
+ ASMJIT_INLINE_NODEBUG void setArg(size_t argIndex, size_t valueIndex, const BaseReg& reg) noexcept { _setArg(argIndex, valueIndex, reg); }
//! Sets the function argument at `argIndex` and `valueIndex` to `imm`.
- inline void setArg(size_t argIndex, size_t valueIndex, const Imm& imm) noexcept { _setArg(argIndex, valueIndex, imm); }
+ ASMJIT_INLINE_NODEBUG void setArg(size_t argIndex, size_t valueIndex, const Imm& imm) noexcept { _setArg(argIndex, valueIndex, imm); }
//! \}
};
@@ -701,7 +705,7 @@ public:
//! \{
//! Returns the associated `BaseCompiler`.
- inline BaseCompiler* cc() const noexcept { return static_cast<BaseCompiler*>(_cb); }
+ ASMJIT_INLINE_NODEBUG BaseCompiler* cc() const noexcept { return static_cast<BaseCompiler*>(_cb); }
//! \}
@@ -712,7 +716,7 @@ public:
ASMJIT_API Error run(Zone* zone, Logger* logger) override;
//! Called once per `FuncNode`.
- virtual Error runOnFunction(Zone* zone, Logger* logger, FuncNode* func) = 0;
+ ASMJIT_API virtual Error runOnFunction(Zone* zone, Logger* logger, FuncNode* func);
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/compilerdefs.h b/3rdparty/asmjit/src/asmjit/core/compilerdefs.h
index 1870e688bc9..e2e74ce6790 100644
--- a/3rdparty/asmjit/src/asmjit/core/compilerdefs.h
+++ b/3rdparty/asmjit/src/asmjit/core/compilerdefs.h
@@ -66,18 +66,16 @@ public:
//! \name Construction & Destruction
//! \{
- inline VirtReg(OperandSignature signature, uint32_t id, uint32_t virtSize, uint32_t alignment, TypeId typeId) noexcept
+ ASMJIT_INLINE_NODEBUG VirtReg(OperandSignature signature, uint32_t id, uint32_t virtSize, uint32_t alignment, TypeId typeId) noexcept
: _signature(signature),
_id(id),
_virtSize(virtSize),
_alignment(uint8_t(alignment)),
_typeId(typeId),
- _isFixed(false),
- _isStack(false),
- _hasStackSlot(false),
- _reservedBits(0),
- _stackOffset(0),
- _reservedU32(0) {}
+ _isFixed(0),
+ _isStack(0),
+ _hasStackSlot(0),
+ _reservedBits(0) {}
//! \}
@@ -85,64 +83,64 @@ public:
//! \{
//! Returns the virtual register id.
- inline uint32_t id() const noexcept { return _id; }
+ ASMJIT_INLINE_NODEBUG uint32_t id() const noexcept { return _id; }
//! Returns the virtual register name.
- inline const char* name() const noexcept { return _name.data(); }
+ ASMJIT_INLINE_NODEBUG const char* name() const noexcept { return _name.data(); }
//! Returns the size of the virtual register name.
- inline uint32_t nameSize() const noexcept { return _name.size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t nameSize() const noexcept { return _name.size(); }
//! Returns a register signature of this virtual register.
- inline OperandSignature signature() const noexcept { return _signature; }
+ ASMJIT_INLINE_NODEBUG OperandSignature signature() const noexcept { return _signature; }
//! Returns a virtual register type (maps to the physical register type as well).
- inline RegType type() const noexcept { return _signature.regType(); }
+ ASMJIT_INLINE_NODEBUG RegType type() const noexcept { return _signature.regType(); }
//! Returns a virtual register group (maps to the physical register group as well).
- inline RegGroup group() const noexcept { return _signature.regGroup(); }
+ ASMJIT_INLINE_NODEBUG RegGroup group() const noexcept { return _signature.regGroup(); }
//! Returns a real size of the register this virtual register maps to.
//!
//! For example if this is a 128-bit SIMD register used for a scalar single precision floating point value then
//! its virtSize would be 4, however, the `regSize` would still say 16 (128-bits), because it's the smallest size
//! of that register type.
- inline uint32_t regSize() const noexcept { return _signature.size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t regSize() const noexcept { return _signature.size(); }
//! Returns the virtual register size.
//!
//! The virtual register size describes how many bytes the virtual register needs to store its content. It can be
//! smaller than the physical register size, see `regSize()`.
- inline uint32_t virtSize() const noexcept { return _virtSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t virtSize() const noexcept { return _virtSize; }
//! Returns the virtual register alignment.
- inline uint32_t alignment() const noexcept { return _alignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t alignment() const noexcept { return _alignment; }
//! Returns the virtual register type id.
- inline TypeId typeId() const noexcept { return _typeId; }
+ ASMJIT_INLINE_NODEBUG TypeId typeId() const noexcept { return _typeId; }
//! Returns the virtual register weight - the register allocator can use it as explicit hint for alloc/spill
//! decisions.
- inline uint32_t weight() const noexcept { return _weight; }
+ ASMJIT_INLINE_NODEBUG uint32_t weight() const noexcept { return _weight; }
//! Sets the virtual register weight (0 to 255) - the register allocator can use it as explicit hint for
//! alloc/spill decisions and initial bin-packing.
- inline void setWeight(uint32_t weight) noexcept { _weight = uint8_t(weight); }
+ ASMJIT_INLINE_NODEBUG void setWeight(uint32_t weight) noexcept { _weight = uint8_t(weight); }
//! Returns whether the virtual register is always allocated to a fixed physical register (and never reallocated).
//!
//! \note This is only used for special purposes and it's mostly internal.
- inline bool isFixed() const noexcept { return bool(_isFixed); }
+ ASMJIT_INLINE_NODEBUG bool isFixed() const noexcept { return bool(_isFixed); }
//! Tests whether the virtual register is in fact a stack that only uses the virtual register id.
//!
//! \note It's an error if a stack is accessed as a register.
- inline bool isStack() const noexcept { return bool(_isStack); }
+ ASMJIT_INLINE_NODEBUG bool isStack() const noexcept { return bool(_isStack); }
//! Tests whether this virtual register (or stack) has assigned a stack offset.
//!
//! If this is a virtual register that was never allocated on stack, it would return false, otherwise if
//! it's a virtual register that was spilled or explicitly allocated stack, the return value would be true.
- inline bool hasStackSlot() const noexcept { return bool(_hasStackSlot); }
+ ASMJIT_INLINE_NODEBUG bool hasStackSlot() const noexcept { return bool(_hasStackSlot); }
//! Assigns a stack offset of this virtual register to `stackOffset` and sets `_hasStackSlot` to true.
- inline void assignStackSlot(int32_t stackOffset) noexcept {
+ ASMJIT_INLINE_NODEBUG void assignStackSlot(int32_t stackOffset) noexcept {
_hasStackSlot = 1;
_stackOffset = stackOffset;
}
@@ -151,16 +149,16 @@ public:
//!
//! \note Always verify that the stack offset has been assigned by calling \ref hasStackSlot(). The return
//! value will be zero when the stack offset was not assigned.
- inline int32_t stackOffset() const noexcept { return _stackOffset; }
+ ASMJIT_INLINE_NODEBUG int32_t stackOffset() const noexcept { return _stackOffset; }
//! Tests whether the virtual register has an associated `RAWorkReg` at the moment.
- inline bool hasWorkReg() const noexcept { return _workReg != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasWorkReg() const noexcept { return _workReg != nullptr; }
//! Returns an associated RAWorkReg with this virtual register (only valid during register allocation).
- inline RAWorkReg* workReg() const noexcept { return _workReg; }
+ ASMJIT_INLINE_NODEBUG RAWorkReg* workReg() const noexcept { return _workReg; }
//! Associates a RAWorkReg with this virtual register (used by register allocator).
- inline void setWorkReg(RAWorkReg* workReg) noexcept { _workReg = workReg; }
+ ASMJIT_INLINE_NODEBUG void setWorkReg(RAWorkReg* workReg) noexcept { _workReg = workReg; }
//! Reset the RAWorkReg association (used by register allocator).
- inline void resetWorkReg() noexcept { _workReg = nullptr; }
+ ASMJIT_INLINE_NODEBUG void resetWorkReg() noexcept { _workReg = nullptr; }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/constpool.cpp b/3rdparty/asmjit/src/asmjit/core/constpool.cpp
index ad5fe4f2fc0..2ac5edf33c6 100644
--- a/3rdparty/asmjit/src/asmjit/core/constpool.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/constpool.cpp
@@ -252,18 +252,18 @@ UNIT(const_pool) {
size_t curOffset;
uint64_t c = 0x0101010101010101u;
- EXPECT(pool.add(&c, 8, prevOffset) == kErrorOk);
- EXPECT(prevOffset == 0);
+ EXPECT_EQ(pool.add(&c, 8, prevOffset), kErrorOk);
+ EXPECT_EQ(prevOffset, 0u);
for (i = 1; i < kCount; i++) {
c++;
- EXPECT(pool.add(&c, 8, curOffset) == kErrorOk);
- EXPECT(prevOffset + 8 == curOffset);
- EXPECT(pool.size() == (i + 1) * 8);
+ EXPECT_EQ(pool.add(&c, 8, curOffset), kErrorOk);
+ EXPECT_EQ(prevOffset + 8, curOffset);
+ EXPECT_EQ(pool.size(), (i + 1) * 8);
prevOffset = curOffset;
}
- EXPECT(pool.alignment() == 8);
+ EXPECT_EQ(pool.alignment(), 8u);
}
INFO("Retrieving %u constants from the pool", kCount);
@@ -272,20 +272,27 @@ UNIT(const_pool) {
for (i = 0; i < kCount; i++) {
size_t offset;
- EXPECT(pool.add(&c, 8, offset) == kErrorOk);
- EXPECT(offset == i * 8);
+ EXPECT_EQ(pool.add(&c, 8, offset), kErrorOk);
+ EXPECT_EQ(offset, i * 8);
c++;
}
}
INFO("Checking if the constants were split into 4-byte patterns");
{
- uint32_t c = 0x01010101;
- for (i = 0; i < kCount; i++) {
- size_t offset;
- EXPECT(pool.add(&c, 4, offset) == kErrorOk);
- EXPECT(offset == i * 8);
+ uint32_t c = 0x01010101u;
+ size_t offset;
+
+ EXPECT_EQ(pool.add(&c, 4, offset), kErrorOk);
+ EXPECT_EQ(offset, 0u);
+
+ // NOTE: We have to adjust the offset to successfully test this on big endian architectures.
+ size_t baseOffset = size_t(ASMJIT_ARCH_BE ? 4 : 0);
+
+ for (i = 1; i < kCount; i++) {
c++;
+ EXPECT_EQ(pool.add(&c, 4, offset), kErrorOk);
+ EXPECT_EQ(offset, baseOffset + i * 8);
}
}
@@ -294,9 +301,9 @@ UNIT(const_pool) {
uint16_t c = 0xFFFF;
size_t offset;
- EXPECT(pool.add(&c, 2, offset) == kErrorOk);
- EXPECT(offset == kCount * 8);
- EXPECT(pool.alignment() == 8);
+ EXPECT_EQ(pool.add(&c, 2, offset), kErrorOk);
+ EXPECT_EQ(offset, kCount * 8);
+ EXPECT_EQ(pool.alignment(), 8u);
}
INFO("Adding 8 byte constant to check if pool gets aligned again");
@@ -304,8 +311,8 @@ UNIT(const_pool) {
uint64_t c = 0xFFFFFFFFFFFFFFFFu;
size_t offset;
- EXPECT(pool.add(&c, 8, offset) == kErrorOk);
- EXPECT(offset == kCount * 8 + 8);
+ EXPECT_EQ(pool.add(&c, 8, offset), kErrorOk);
+ EXPECT_EQ(offset, kCount * 8 + 8u);
}
INFO("Adding 2 byte constant to verify the gap is filled");
@@ -313,9 +320,9 @@ UNIT(const_pool) {
uint16_t c = 0xFFFE;
size_t offset;
- EXPECT(pool.add(&c, 2, offset) == kErrorOk);
- EXPECT(offset == kCount * 8 + 2);
- EXPECT(pool.alignment() == 8);
+ EXPECT_EQ(pool.add(&c, 2, offset), kErrorOk);
+ EXPECT_EQ(offset, kCount * 8 + 2);
+ EXPECT_EQ(pool.alignment(), 8u);
}
INFO("Checking reset functionality");
@@ -323,8 +330,8 @@ UNIT(const_pool) {
pool.reset(&zone);
zone.reset();
- EXPECT(pool.size() == 0);
- EXPECT(pool.alignment() == 0);
+ EXPECT_EQ(pool.size(), 0u);
+ EXPECT_EQ(pool.alignment(), 0u);
}
INFO("Checking pool alignment when combined constants are added");
@@ -333,29 +340,29 @@ UNIT(const_pool) {
size_t offset;
pool.add(bytes, 1, offset);
- EXPECT(pool.size() == 1);
- EXPECT(pool.alignment() == 1);
- EXPECT(offset == 0);
+ EXPECT_EQ(pool.size(), 1u);
+ EXPECT_EQ(pool.alignment(), 1u);
+ EXPECT_EQ(offset, 0u);
pool.add(bytes, 2, offset);
- EXPECT(pool.size() == 4);
- EXPECT(pool.alignment() == 2);
- EXPECT(offset == 2);
+ EXPECT_EQ(pool.size(), 4u);
+ EXPECT_EQ(pool.alignment(), 2u);
+ EXPECT_EQ(offset, 2u);
pool.add(bytes, 4, offset);
- EXPECT(pool.size() == 8);
- EXPECT(pool.alignment() == 4);
- EXPECT(offset == 4);
+ EXPECT_EQ(pool.size(), 8u);
+ EXPECT_EQ(pool.alignment(), 4u);
+ EXPECT_EQ(offset, 4u);
pool.add(bytes, 4, offset);
- EXPECT(pool.size() == 8);
- EXPECT(pool.alignment() == 4);
- EXPECT(offset == 4);
+ EXPECT_EQ(pool.size(), 8u);
+ EXPECT_EQ(pool.alignment(), 4u);
+ EXPECT_EQ(offset, 4u);
pool.add(bytes, 32, offset);
- EXPECT(pool.size() == 64);
- EXPECT(pool.alignment() == 32);
- EXPECT(offset == 32);
+ EXPECT_EQ(pool.size(), 64u);
+ EXPECT_EQ(pool.alignment(), 32u);
+ EXPECT_EQ(offset, 32u);
}
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/core/constpool.h b/3rdparty/asmjit/src/asmjit/core/constpool.h
index 32b84b1065d..673c11d6a93 100644
--- a/3rdparty/asmjit/src/asmjit/core/constpool.h
+++ b/3rdparty/asmjit/src/asmjit/core/constpool.h
@@ -27,6 +27,9 @@ enum class ConstPoolScope : uint32_t {
};
//! Constant pool.
+//!
+//! Constant pool is designed to hold 1, 2, 4, 8, 16, 32, and 64 byte constants. It's not designed to hold constants
+//! having arbitrary length like strings and arrays.
class ConstPool {
public:
ASMJIT_NONCOPYABLE(ConstPool)
@@ -65,12 +68,12 @@ public:
//! Data offset from the beginning of the pool.
uint32_t _offset;
- inline Node(size_t offset, bool shared) noexcept
+ ASMJIT_INLINE_NODEBUG Node(size_t offset, bool shared) noexcept
: ZoneTreeNodeT<Node>(),
_shared(shared),
_offset(uint32_t(offset)) {}
- inline void* data() const noexcept {
+ ASMJIT_INLINE_NODEBUG void* data() const noexcept {
return static_cast<void*>(const_cast<ConstPool::Node*>(this) + 1);
}
};
@@ -80,14 +83,14 @@ public:
public:
size_t _dataSize;
- inline Compare(size_t dataSize) noexcept
+ ASMJIT_INLINE_NODEBUG Compare(size_t dataSize) noexcept
: _dataSize(dataSize) {}
- inline int operator()(const Node& a, const Node& b) const noexcept {
+ ASMJIT_INLINE_NODEBUG int operator()(const Node& a, const Node& b) const noexcept {
return ::memcmp(a.data(), b.data(), _dataSize);
}
- inline int operator()(const Node& a, const void* data) const noexcept {
+ ASMJIT_INLINE_NODEBUG int operator()(const Node& a, const void* data) const noexcept {
return ::memcmp(a.data(), data, _dataSize);
}
};
@@ -101,30 +104,30 @@ public:
//! Size of the data.
size_t _dataSize;
- inline explicit Tree(size_t dataSize = 0) noexcept
+ ASMJIT_INLINE_NODEBUG explicit Tree(size_t dataSize = 0) noexcept
: _tree(),
_size(0),
_dataSize(dataSize) {}
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_tree.reset();
_size = 0;
}
- inline bool empty() const noexcept { return _size == 0; }
- inline size_t size() const noexcept { return _size; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _size == 0; }
+ ASMJIT_INLINE_NODEBUG size_t size() const noexcept { return _size; }
inline void setDataSize(size_t dataSize) noexcept {
ASMJIT_ASSERT(empty());
_dataSize = dataSize;
}
- inline Node* get(const void* data) noexcept {
+ ASMJIT_INLINE_NODEBUG Node* get(const void* data) noexcept {
Compare cmp(_dataSize);
return _tree.get(data, cmp);
}
- inline void insert(Node* node) noexcept {
+ ASMJIT_INLINE_NODEBUG void insert(Node* node) noexcept {
Compare cmp(_dataSize);
_tree.insert(node, cmp);
_size++;
@@ -167,7 +170,7 @@ public:
Node* node = zone->allocT<Node>(sizeof(Node) + size);
if (ASMJIT_UNLIKELY(!node)) return nullptr;
- node = new(node) Node(offset, shared);
+ node = new(Support::PlacementNew{node}) Node(offset, shared);
memcpy(node->data(), data, size);
return node;
}
@@ -199,9 +202,17 @@ public:
//! \name Construction & Destruction
//! \{
- ASMJIT_API ConstPool(Zone* zone) noexcept;
+ //! Creates a new constant pool that would use `zone` as a memory allocator.
+ ASMJIT_API explicit ConstPool(Zone* zone) noexcept;
+ //! Destroys this constant pool.
ASMJIT_API ~ConstPool() noexcept;
+ //! \}
+
+ //! \name Reset
+ //! \{
+
+ //! Resets this constant pool and its allocator to `zone`.
ASMJIT_API void reset(Zone* zone) noexcept;
//! \}
@@ -210,13 +221,13 @@ public:
//! \{
//! Tests whether the constant-pool is empty.
- inline bool empty() const noexcept { return _size == 0; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _size == 0; }
//! Returns the size of the constant-pool in bytes.
- inline size_t size() const noexcept { return _size; }
+ ASMJIT_INLINE_NODEBUG size_t size() const noexcept { return _size; }
//! Returns minimum alignment.
- inline size_t alignment() const noexcept { return _alignment; }
+ ASMJIT_INLINE_NODEBUG size_t alignment() const noexcept { return _alignment; }
//! Returns the minimum size of all items added to the constant pool.
- inline size_t minItemSize() const noexcept { return _minItemSize; }
+ ASMJIT_INLINE_NODEBUG size_t minItemSize() const noexcept { return _minItemSize; }
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/core/cpuinfo.cpp b/3rdparty/asmjit/src/asmjit/core/cpuinfo.cpp
index 7bf7407f005..88f85e0f82e 100644
--- a/3rdparty/asmjit/src/asmjit/core/cpuinfo.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/cpuinfo.cpp
@@ -7,31 +7,93 @@
#include "../core/cpuinfo.h"
#include "../core/support.h"
-#if !defined(_WIN32)
- #include <errno.h>
- #include <sys/utsname.h>
- #include <unistd.h>
-#endif
+#include <atomic>
-// Required by `getauxval()` on Linux.
-#if defined(__linux__)
- #include <sys/auxv.h>
-#endif
+// Required by `__cpuidex()` and `_xgetbv()`.
+#if ASMJIT_ARCH_X86
+ #if defined(_MSC_VER)
+ #include <intrin.h>
+ #endif
+#endif // ASMJIT_ARCH_X86
-//! Required to detect CPU and features on Apple platforms.
-#if defined(__APPLE__)
- #include <mach/machine.h>
- #include <sys/types.h>
- #include <sys/sysctl.h>
+#if ASMJIT_ARCH_ARM
+ // Required by various utilities that are required by features detection.
+ #if !defined(_WIN32)
+ #include <errno.h>
+ #include <sys/utsname.h>
+ #endif
+
+ //! Required to detect CPU and features on Apple platforms.
+ #if defined(__APPLE__)
+ #include <mach/machine.h>
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+ #endif
+
+ #if (defined(__linux__) || defined(__FreeBSD__))
+ // Required by `getauxval()` on Linux and FreeBSD.
+ #include <sys/auxv.h>
+ #define ASMJIT_ARM_DETECT_VIA_HWCAPS
+ #endif
+
+ #if ASMJIT_ARCH_ARM >= 64 && defined(__GNUC__) && defined(__linux__) && 0
+ // This feature is disabled at the moment - it works, but it seems linux supports ARM features
+ // via HWCAPS pretty well and the most recent features need to access more registers that were
+ // not originally accessible, which would break on some systems.
+ #define ASMJIT_ARM_DETECT_VIA_CPUID
+ #endif
+
+ #if ASMJIT_ARCH_ARM >= 64 && defined(__OpenBSD__)
+ #include <sys/sysctl.h>
+ #include <machine/cpu.h>
+ #endif
+#endif // ASMJIT_ARCH_ARM
+
+#if !defined(_WIN32) && (ASMJIT_ARCH_X86 || ASMJIT_ARCH_ARM)
+ #include <unistd.h>
#endif
-// Required by `__cpuidex()` and `_xgetbv()`.
+// Unfortunately when compiling in C++11 mode MSVC would warn about unused functions as
+// [[maybe_unused]] attribute is not used in that case (it's used only by C++17 mode and later).
#if defined(_MSC_VER)
- #include <intrin.h>
-#endif
+ #pragma warning(push)
+ #pragma warning(disable: 4505) // unreferenced local function has been removed.
+#endif // _MSC_VER
ASMJIT_BEGIN_NAMESPACE
+// CpuInfo - Detect - Compatibility
+// ================================
+
+// CPU features detection is a minefield on non-X86 platforms. The following list describes which
+// operating systems and architectures are supported and the status of the implementation:
+//
+// * X86, X86_64:
+// - All OSes supported
+// - Detection is based on using a CPUID instruction, which is a user-space instruction, so there
+// is no need to use any OS specific APIs or syscalls to detect all features provided by the CPU.
+//
+// * ARM32:
+// - Linux - HWCAPS based detection.
+// - FreeBSD - HWCAPS based detection (shared with Linux code).
+// - NetBSD - NOT IMPLEMENTED!
+// - OpenBSD - NOT IMPLEMENTED!
+// - Apple - sysctlbyname() based detection (this architecture is deprecated on Apple HW).
+// - Windows - IsProcessorFeaturePresent() based detection (only detects a subset of features).
+// - Others - NOT IMPLEMENTED!
+//
+// * ARM64:
+// - Linux - HWCAPS and CPUID based detection.
+// - FreeBSD - HWCAPS and CPUID based detection (shared with Linux code).
+// - NetBSD - NOT IMPLEMENTED!
+// - OpenBSD - CPUID based detection (reading CPUID via sysctl's CTL_MACHDEP).
+// - Apple - sysctlbyname() based detection with FamilyId matrix (record for each family id).
+// - Windows - IsProcessorFeaturePresent() based detection (only detects a subset of features).
+// - Others - NOT IMPLEMENTED!
+//
+// * Others
+// - NOT IMPLEMENTED!
+
// CpuInfo - Detect - HW-Thread Count
// ==================================
@@ -55,8 +117,14 @@ static inline uint32_t detectHWThreadCount() noexcept {
// CpuInfo - Detect - X86
// ======================
+// X86 and X86_64 detection is based on CPUID.
+
#if ASMJIT_ARCH_X86
+namespace x86 {
+
+typedef CpuFeatures::X86 Ext;
+
struct cpuid_t { uint32_t eax, ebx, ecx, edx; };
struct xgetbv_t { uint32_t eax, edx; };
@@ -137,7 +205,7 @@ static ASMJIT_FAVOR_SIZE void simplifyCpuBrand(char* s) noexcept {
if (!c)
break;
- if (!(c == ' ' && (prev == '@' || s[1] == ' ' || s[1] == '@'))) {
+ if (!(c == ' ' && (prev == '@' || s[1] == ' ' || s[1] == '@' || s[1] == '\0'))) {
*d++ = c;
prev = c;
}
@@ -160,7 +228,7 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
cpu._maxLogicalProcessors = 1;
// We are gonna execute CPUID, which was introduced by I486, so it's the requirement.
- features.add(CpuFeatures::X86::kI486);
+ features.add(Ext::kI486);
// CPUID EAX=0
// -----------
@@ -191,40 +259,40 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
if (familyId == 0x0Fu)
familyId += ((regs.eax >> 20) & 0xFFu);
- cpu._modelId = modelId;
- cpu._familyId = familyId;
- cpu._brandId = ((regs.ebx ) & 0xFF);
- cpu._processorType = ((regs.eax >> 12) & 0x03);
- cpu._maxLogicalProcessors = ((regs.ebx >> 16) & 0xFF);
- cpu._stepping = ((regs.eax ) & 0x0F);
- cpu._cacheLineSize = ((regs.ebx >> 8) & 0xFF) * 8;
-
- features.addIf(bitTest(regs.ecx, 0), CpuFeatures::X86::kSSE3);
- features.addIf(bitTest(regs.ecx, 1), CpuFeatures::X86::kPCLMULQDQ);
- features.addIf(bitTest(regs.ecx, 3), CpuFeatures::X86::kMONITOR);
- features.addIf(bitTest(regs.ecx, 5), CpuFeatures::X86::kVMX);
- features.addIf(bitTest(regs.ecx, 6), CpuFeatures::X86::kSMX);
- features.addIf(bitTest(regs.ecx, 9), CpuFeatures::X86::kSSSE3);
- features.addIf(bitTest(regs.ecx, 13), CpuFeatures::X86::kCMPXCHG16B);
- features.addIf(bitTest(regs.ecx, 19), CpuFeatures::X86::kSSE4_1);
- features.addIf(bitTest(regs.ecx, 20), CpuFeatures::X86::kSSE4_2);
- features.addIf(bitTest(regs.ecx, 22), CpuFeatures::X86::kMOVBE);
- features.addIf(bitTest(regs.ecx, 23), CpuFeatures::X86::kPOPCNT);
- features.addIf(bitTest(regs.ecx, 25), CpuFeatures::X86::kAESNI);
- features.addIf(bitTest(regs.ecx, 26), CpuFeatures::X86::kXSAVE);
- features.addIf(bitTest(regs.ecx, 27), CpuFeatures::X86::kOSXSAVE);
- features.addIf(bitTest(regs.ecx, 30), CpuFeatures::X86::kRDRAND);
- features.addIf(bitTest(regs.edx, 0), CpuFeatures::X86::kFPU);
- features.addIf(bitTest(regs.edx, 4), CpuFeatures::X86::kRDTSC);
- features.addIf(bitTest(regs.edx, 5), CpuFeatures::X86::kMSR);
- features.addIf(bitTest(regs.edx, 8), CpuFeatures::X86::kCMPXCHG8B);
- features.addIf(bitTest(regs.edx, 15), CpuFeatures::X86::kCMOV);
- features.addIf(bitTest(regs.edx, 19), CpuFeatures::X86::kCLFLUSH);
- features.addIf(bitTest(regs.edx, 23), CpuFeatures::X86::kMMX);
- features.addIf(bitTest(regs.edx, 24), CpuFeatures::X86::kFXSR);
- features.addIf(bitTest(regs.edx, 25), CpuFeatures::X86::kSSE);
- features.addIf(bitTest(regs.edx, 25), CpuFeatures::X86::kSSE, CpuFeatures::X86::kSSE2);
- features.addIf(bitTest(regs.edx, 28), CpuFeatures::X86::kMT);
+ cpu._modelId = modelId;
+ cpu._familyId = familyId;
+ cpu._brandId = (regs.ebx) & 0xFF;
+ cpu._processorType = (regs.eax >> 12) & 0x03;
+ cpu._maxLogicalProcessors = (regs.ebx >> 16) & 0xFF;
+ cpu._stepping = (regs.eax) & 0x0F;
+ cpu._cacheLineSize = ((regs.ebx >> 8) & 0xFF) * 8;
+
+ features.addIf(bitTest(regs.ecx, 0), Ext::kSSE3);
+ features.addIf(bitTest(regs.ecx, 1), Ext::kPCLMULQDQ);
+ features.addIf(bitTest(regs.ecx, 3), Ext::kMONITOR);
+ features.addIf(bitTest(regs.ecx, 5), Ext::kVMX);
+ features.addIf(bitTest(regs.ecx, 6), Ext::kSMX);
+ features.addIf(bitTest(regs.ecx, 9), Ext::kSSSE3);
+ features.addIf(bitTest(regs.ecx, 13), Ext::kCMPXCHG16B);
+ features.addIf(bitTest(regs.ecx, 19), Ext::kSSE4_1);
+ features.addIf(bitTest(regs.ecx, 20), Ext::kSSE4_2);
+ features.addIf(bitTest(regs.ecx, 22), Ext::kMOVBE);
+ features.addIf(bitTest(regs.ecx, 23), Ext::kPOPCNT);
+ features.addIf(bitTest(regs.ecx, 25), Ext::kAESNI);
+ features.addIf(bitTest(regs.ecx, 26), Ext::kXSAVE);
+ features.addIf(bitTest(regs.ecx, 27), Ext::kOSXSAVE);
+ features.addIf(bitTest(regs.ecx, 30), Ext::kRDRAND);
+ features.addIf(bitTest(regs.edx, 0), Ext::kFPU);
+ features.addIf(bitTest(regs.edx, 4), Ext::kRDTSC);
+ features.addIf(bitTest(regs.edx, 5), Ext::kMSR);
+ features.addIf(bitTest(regs.edx, 8), Ext::kCMPXCHG8B);
+ features.addIf(bitTest(regs.edx, 15), Ext::kCMOV);
+ features.addIf(bitTest(regs.edx, 19), Ext::kCLFLUSH);
+ features.addIf(bitTest(regs.edx, 23), Ext::kMMX);
+ features.addIf(bitTest(regs.edx, 24), Ext::kFXSR);
+ features.addIf(bitTest(regs.edx, 25), Ext::kSSE, Ext::kMMX2);
+ features.addIf(bitTest(regs.edx, 26), Ext::kSSE2, Ext::kSSE);
+ features.addIf(bitTest(regs.edx, 28), Ext::kMT);
// Get the content of XCR0 if supported by the CPU and enabled by the OS.
if (features.hasXSAVE() && features.hasOSXSAVE()) {
@@ -236,9 +304,9 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
// - XCR0[2:1] == 11b
// XMM & YMM states need to be enabled by OS.
if ((xcr0.eax & 0x00000006u) == 0x00000006u) {
- features.add(CpuFeatures::X86::kAVX);
- features.addIf(bitTest(regs.ecx, 12), CpuFeatures::X86::kFMA);
- features.addIf(bitTest(regs.ecx, 29), CpuFeatures::X86::kF16C);
+ features.add(Ext::kAVX);
+ features.addIf(bitTest(regs.ecx, 12), Ext::kFMA);
+ features.addIf(bitTest(regs.ecx, 29), Ext::kF16C);
}
}
}
@@ -270,84 +338,114 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
maybeMPX = bitTest(regs.ebx, 14);
maxSubLeafId_0x7 = regs.eax;
- features.addIf(bitTest(regs.ebx, 0), CpuFeatures::X86::kFSGSBASE);
- features.addIf(bitTest(regs.ebx, 3), CpuFeatures::X86::kBMI);
- features.addIf(bitTest(regs.ebx, 4), CpuFeatures::X86::kHLE);
- features.addIf(bitTest(regs.ebx, 7), CpuFeatures::X86::kSMEP);
- features.addIf(bitTest(regs.ebx, 8), CpuFeatures::X86::kBMI2);
- features.addIf(bitTest(regs.ebx, 9), CpuFeatures::X86::kERMS);
- features.addIf(bitTest(regs.ebx, 11), CpuFeatures::X86::kRTM);
- features.addIf(bitTest(regs.ebx, 18), CpuFeatures::X86::kRDSEED);
- features.addIf(bitTest(regs.ebx, 19), CpuFeatures::X86::kADX);
- features.addIf(bitTest(regs.ebx, 20), CpuFeatures::X86::kSMAP);
- features.addIf(bitTest(regs.ebx, 23), CpuFeatures::X86::kCLFLUSHOPT);
- features.addIf(bitTest(regs.ebx, 24), CpuFeatures::X86::kCLWB);
- features.addIf(bitTest(regs.ebx, 29), CpuFeatures::X86::kSHA);
- features.addIf(bitTest(regs.ecx, 0), CpuFeatures::X86::kPREFETCHWT1);
- features.addIf(bitTest(regs.ecx, 4), CpuFeatures::X86::kOSPKE);
- features.addIf(bitTest(regs.ecx, 5), CpuFeatures::X86::kWAITPKG);
- features.addIf(bitTest(regs.ecx, 7), CpuFeatures::X86::kCET_SS);
- features.addIf(bitTest(regs.ecx, 8), CpuFeatures::X86::kGFNI);
- features.addIf(bitTest(regs.ecx, 9), CpuFeatures::X86::kVAES);
- features.addIf(bitTest(regs.ecx, 10), CpuFeatures::X86::kVPCLMULQDQ);
- features.addIf(bitTest(regs.ecx, 22), CpuFeatures::X86::kRDPID);
- features.addIf(bitTest(regs.ecx, 25), CpuFeatures::X86::kCLDEMOTE);
- features.addIf(bitTest(regs.ecx, 27), CpuFeatures::X86::kMOVDIRI);
- features.addIf(bitTest(regs.ecx, 28), CpuFeatures::X86::kMOVDIR64B);
- features.addIf(bitTest(regs.ecx, 29), CpuFeatures::X86::kENQCMD);
- features.addIf(bitTest(regs.edx, 5), CpuFeatures::X86::kUINTR);
- features.addIf(bitTest(regs.edx, 14), CpuFeatures::X86::kSERIALIZE);
- features.addIf(bitTest(regs.edx, 16), CpuFeatures::X86::kTSXLDTRK);
- features.addIf(bitTest(regs.edx, 18), CpuFeatures::X86::kPCONFIG);
- features.addIf(bitTest(regs.edx, 20), CpuFeatures::X86::kCET_IBT);
+ features.addIf(bitTest(regs.ebx, 0), Ext::kFSGSBASE);
+ features.addIf(bitTest(regs.ebx, 3), Ext::kBMI);
+ features.addIf(bitTest(regs.ebx, 4), Ext::kHLE);
+ features.addIf(bitTest(regs.ebx, 7), Ext::kSMEP);
+ features.addIf(bitTest(regs.ebx, 8), Ext::kBMI2);
+ features.addIf(bitTest(regs.ebx, 9), Ext::kERMS);
+ features.addIf(bitTest(regs.ebx, 11), Ext::kRTM);
+ features.addIf(bitTest(regs.ebx, 18), Ext::kRDSEED);
+ features.addIf(bitTest(regs.ebx, 19), Ext::kADX);
+ features.addIf(bitTest(regs.ebx, 20), Ext::kSMAP);
+ features.addIf(bitTest(regs.ebx, 23), Ext::kCLFLUSHOPT);
+ features.addIf(bitTest(regs.ebx, 24), Ext::kCLWB);
+ features.addIf(bitTest(regs.ebx, 29), Ext::kSHA);
+ features.addIf(bitTest(regs.ecx, 0), Ext::kPREFETCHWT1);
+ features.addIf(bitTest(regs.ecx, 4), Ext::kOSPKE);
+ features.addIf(bitTest(regs.ecx, 5), Ext::kWAITPKG);
+ features.addIf(bitTest(regs.ecx, 7), Ext::kCET_SS);
+ features.addIf(bitTest(regs.ecx, 8), Ext::kGFNI);
+ features.addIf(bitTest(regs.ecx, 9), Ext::kVAES);
+ features.addIf(bitTest(regs.ecx, 10), Ext::kVPCLMULQDQ);
+ features.addIf(bitTest(regs.ecx, 22), Ext::kRDPID);
+ features.addIf(bitTest(regs.ecx, 25), Ext::kCLDEMOTE);
+ features.addIf(bitTest(regs.ecx, 27), Ext::kMOVDIRI);
+ features.addIf(bitTest(regs.ecx, 28), Ext::kMOVDIR64B);
+ features.addIf(bitTest(regs.ecx, 29), Ext::kENQCMD);
+ features.addIf(bitTest(regs.edx, 4), Ext::kFSRM);
+ features.addIf(bitTest(regs.edx, 5), Ext::kUINTR);
+ features.addIf(bitTest(regs.edx, 14), Ext::kSERIALIZE);
+ features.addIf(bitTest(regs.edx, 16), Ext::kTSXLDTRK);
+ features.addIf(bitTest(regs.edx, 18), Ext::kPCONFIG);
+ features.addIf(bitTest(regs.edx, 20), Ext::kCET_IBT);
// Detect 'TSX' - Requires at least one of `HLE` and `RTM` features.
- if (features.hasHLE() || features.hasRTM())
- features.add(CpuFeatures::X86::kTSX);
+ if (features.hasHLE() || features.hasRTM()) {
+ features.add(Ext::kTSX);
+ }
- // Detect 'AVX2' - Requires AVX as well.
- if (bitTest(regs.ebx, 5) && features.hasAVX())
- features.add(CpuFeatures::X86::kAVX2);
+ if (bitTest(regs.ebx, 5) && features.hasAVX()) {
+ features.add(Ext::kAVX2);
+ }
- // Detect 'AVX512'.
if (avx512EnabledByOS && bitTest(regs.ebx, 16)) {
- features.add(CpuFeatures::X86::kAVX512_F);
-
- features.addIf(bitTest(regs.ebx, 17), CpuFeatures::X86::kAVX512_DQ);
- features.addIf(bitTest(regs.ebx, 21), CpuFeatures::X86::kAVX512_IFMA);
- features.addIf(bitTest(regs.ebx, 26), CpuFeatures::X86::kAVX512_PFI);
- features.addIf(bitTest(regs.ebx, 27), CpuFeatures::X86::kAVX512_ERI);
- features.addIf(bitTest(regs.ebx, 28), CpuFeatures::X86::kAVX512_CDI);
- features.addIf(bitTest(regs.ebx, 30), CpuFeatures::X86::kAVX512_BW);
- features.addIf(bitTest(regs.ebx, 31), CpuFeatures::X86::kAVX512_VL);
- features.addIf(bitTest(regs.ecx, 1), CpuFeatures::X86::kAVX512_VBMI);
- features.addIf(bitTest(regs.ecx, 6), CpuFeatures::X86::kAVX512_VBMI2);
- features.addIf(bitTest(regs.ecx, 11), CpuFeatures::X86::kAVX512_VNNI);
- features.addIf(bitTest(regs.ecx, 12), CpuFeatures::X86::kAVX512_BITALG);
- features.addIf(bitTest(regs.ecx, 14), CpuFeatures::X86::kAVX512_VPOPCNTDQ);
- features.addIf(bitTest(regs.edx, 2), CpuFeatures::X86::kAVX512_4VNNIW);
- features.addIf(bitTest(regs.edx, 3), CpuFeatures::X86::kAVX512_4FMAPS);
- features.addIf(bitTest(regs.edx, 8), CpuFeatures::X86::kAVX512_VP2INTERSECT);
- features.addIf(bitTest(regs.edx, 23), CpuFeatures::X86::kAVX512_FP16);
+ features.add(Ext::kAVX512_F);
+
+ features.addIf(bitTest(regs.ebx, 17), Ext::kAVX512_DQ);
+ features.addIf(bitTest(regs.ebx, 21), Ext::kAVX512_IFMA);
+ features.addIf(bitTest(regs.ebx, 26), Ext::kAVX512_PF);
+ features.addIf(bitTest(regs.ebx, 27), Ext::kAVX512_ER);
+ features.addIf(bitTest(regs.ebx, 28), Ext::kAVX512_CD);
+ features.addIf(bitTest(regs.ebx, 30), Ext::kAVX512_BW);
+ features.addIf(bitTest(regs.ebx, 31), Ext::kAVX512_VL);
+ features.addIf(bitTest(regs.ecx, 1), Ext::kAVX512_VBMI);
+ features.addIf(bitTest(regs.ecx, 6), Ext::kAVX512_VBMI2);
+ features.addIf(bitTest(regs.ecx, 11), Ext::kAVX512_VNNI);
+ features.addIf(bitTest(regs.ecx, 12), Ext::kAVX512_BITALG);
+ features.addIf(bitTest(regs.ecx, 14), Ext::kAVX512_VPOPCNTDQ);
+ features.addIf(bitTest(regs.edx, 2), Ext::kAVX512_4VNNIW);
+ features.addIf(bitTest(regs.edx, 3), Ext::kAVX512_4FMAPS);
+ features.addIf(bitTest(regs.edx, 8), Ext::kAVX512_VP2INTERSECT);
+ features.addIf(bitTest(regs.edx, 23), Ext::kAVX512_FP16);
}
- // Detect 'AMX'.
if (amxEnabledByOS) {
- features.addIf(bitTest(regs.edx, 22), CpuFeatures::X86::kAMX_BF16);
- features.addIf(bitTest(regs.edx, 24), CpuFeatures::X86::kAMX_TILE);
- features.addIf(bitTest(regs.edx, 25), CpuFeatures::X86::kAMX_INT8);
+ features.addIf(bitTest(regs.edx, 22), Ext::kAMX_BF16);
+ features.addIf(bitTest(regs.edx, 24), Ext::kAMX_TILE);
+ features.addIf(bitTest(regs.edx, 25), Ext::kAMX_INT8);
}
}
// CPUID EAX=7 ECX=1
// -----------------
- if (features.hasAVX512_F() && maxSubLeafId_0x7 >= 1) {
+ if (maxSubLeafId_0x7 >= 1) {
cpuidQuery(&regs, 0x7, 1);
- features.addIf(bitTest(regs.eax, 3), CpuFeatures::X86::kAVX_VNNI);
- features.addIf(bitTest(regs.eax, 5), CpuFeatures::X86::kAVX512_BF16);
- features.addIf(bitTest(regs.eax, 22), CpuFeatures::X86::kHRESET);
+ features.addIf(bitTest(regs.eax, 0), Ext::kSHA512);
+ features.addIf(bitTest(regs.eax, 1), Ext::kSM3);
+ features.addIf(bitTest(regs.eax, 2), Ext::kSM4);
+ features.addIf(bitTest(regs.eax, 3), Ext::kRAO_INT);
+ features.addIf(bitTest(regs.eax, 7), Ext::kCMPCCXADD);
+ features.addIf(bitTest(regs.eax, 10), Ext::kFZRM);
+ features.addIf(bitTest(regs.eax, 11), Ext::kFSRS);
+ features.addIf(bitTest(regs.eax, 12), Ext::kFSRC);
+ features.addIf(bitTest(regs.eax, 19), Ext::kWRMSRNS);
+ features.addIf(bitTest(regs.eax, 22), Ext::kHRESET);
+ features.addIf(bitTest(regs.eax, 26), Ext::kLAM);
+ features.addIf(bitTest(regs.eax, 27), Ext::kMSRLIST);
+ features.addIf(bitTest(regs.ebx, 1), Ext::kTSE);
+ features.addIf(bitTest(regs.edx, 14), Ext::kPREFETCHI);
+ features.addIf(bitTest(regs.edx, 18), Ext::kCET_SSS);
+ features.addIf(bitTest(regs.edx, 21), Ext::kAPX_F);
+
+ if (features.hasAVX2()) {
+ features.addIf(bitTest(regs.eax, 4), Ext::kAVX_VNNI);
+ features.addIf(bitTest(regs.eax, 23), Ext::kAVX_IFMA);
+ features.addIf(bitTest(regs.edx, 4), Ext::kAVX_VNNI_INT8);
+ features.addIf(bitTest(regs.edx, 5), Ext::kAVX_NE_CONVERT);
+ features.addIf(bitTest(regs.edx, 10), Ext::kAVX_VNNI_INT16);
+ }
+
+ if (features.hasAVX512_F()) {
+ features.addIf(bitTest(regs.eax, 5), Ext::kAVX512_BF16);
+ }
+
+ if (amxEnabledByOS) {
+ features.addIf(bitTest(regs.eax, 21), Ext::kAMX_FP16);
+ features.addIf(bitTest(regs.edx, 8), Ext::kAMX_COMPLEX);
+ }
}
// CPUID EAX=13 ECX=0
@@ -358,13 +456,13 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
// Both CPUID result and XCR0 has to be enabled to have support for MPX.
if (((regs.eax & xcr0.eax) & 0x00000018u) == 0x00000018u && maybeMPX)
- features.add(CpuFeatures::X86::kMPX);
+ features.add(Ext::kMPX);
cpuidQuery(&regs, 0xD, 1);
- features.addIf(bitTest(regs.eax, 0), CpuFeatures::X86::kXSAVEOPT);
- features.addIf(bitTest(regs.eax, 1), CpuFeatures::X86::kXSAVEC);
- features.addIf(bitTest(regs.eax, 3), CpuFeatures::X86::kXSAVES);
+ features.addIf(bitTest(regs.eax, 0), Ext::kXSAVEOPT);
+ features.addIf(bitTest(regs.eax, 1), Ext::kXSAVEC);
+ features.addIf(bitTest(regs.eax, 3), Ext::kXSAVES);
}
// CPUID EAX=14 ECX=0
@@ -373,7 +471,7 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
if (maxId >= 0xE) {
cpuidQuery(&regs, 0xE, 0);
- features.addIf(bitTest(regs.ebx, 4), CpuFeatures::X86::kPTWRITE);
+ features.addIf(bitTest(regs.ebx, 4), Ext::kPTWRITE);
}
// CPUID EAX=0x80000000...maxId
@@ -396,32 +494,32 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
break;
case 0x80000001u:
- features.addIf(bitTest(regs.ecx, 0), CpuFeatures::X86::kLAHFSAHF);
- features.addIf(bitTest(regs.ecx, 2), CpuFeatures::X86::kSVM);
- features.addIf(bitTest(regs.ecx, 5), CpuFeatures::X86::kLZCNT);
- features.addIf(bitTest(regs.ecx, 6), CpuFeatures::X86::kSSE4A);
- features.addIf(bitTest(regs.ecx, 7), CpuFeatures::X86::kMSSE);
- features.addIf(bitTest(regs.ecx, 8), CpuFeatures::X86::kPREFETCHW);
- features.addIf(bitTest(regs.ecx, 12), CpuFeatures::X86::kSKINIT);
- features.addIf(bitTest(regs.ecx, 15), CpuFeatures::X86::kLWP);
- features.addIf(bitTest(regs.ecx, 21), CpuFeatures::X86::kTBM);
- features.addIf(bitTest(regs.ecx, 29), CpuFeatures::X86::kMONITORX);
- features.addIf(bitTest(regs.edx, 20), CpuFeatures::X86::kNX);
- features.addIf(bitTest(regs.edx, 21), CpuFeatures::X86::kFXSROPT);
- features.addIf(bitTest(regs.edx, 22), CpuFeatures::X86::kMMX2);
- features.addIf(bitTest(regs.edx, 27), CpuFeatures::X86::kRDTSCP);
- features.addIf(bitTest(regs.edx, 29), CpuFeatures::X86::kPREFETCHW);
- features.addIf(bitTest(regs.edx, 30), CpuFeatures::X86::k3DNOW2, CpuFeatures::X86::kMMX2);
- features.addIf(bitTest(regs.edx, 31), CpuFeatures::X86::kPREFETCHW);
+ features.addIf(bitTest(regs.ecx, 0), Ext::kLAHFSAHF);
+ features.addIf(bitTest(regs.ecx, 2), Ext::kSVM);
+ features.addIf(bitTest(regs.ecx, 5), Ext::kLZCNT);
+ features.addIf(bitTest(regs.ecx, 6), Ext::kSSE4A);
+ features.addIf(bitTest(regs.ecx, 7), Ext::kMSSE);
+ features.addIf(bitTest(regs.ecx, 8), Ext::kPREFETCHW);
+ features.addIf(bitTest(regs.ecx, 12), Ext::kSKINIT);
+ features.addIf(bitTest(regs.ecx, 15), Ext::kLWP);
+ features.addIf(bitTest(regs.ecx, 21), Ext::kTBM);
+ features.addIf(bitTest(regs.ecx, 29), Ext::kMONITORX);
+ features.addIf(bitTest(regs.edx, 20), Ext::kNX);
+ features.addIf(bitTest(regs.edx, 21), Ext::kFXSROPT);
+ features.addIf(bitTest(regs.edx, 22), Ext::kMMX2);
+ features.addIf(bitTest(regs.edx, 27), Ext::kRDTSCP);
+ features.addIf(bitTest(regs.edx, 29), Ext::kPREFETCHW);
+ features.addIf(bitTest(regs.edx, 30), Ext::k3DNOW2, Ext::kMMX2);
+ features.addIf(bitTest(regs.edx, 31), Ext::kPREFETCHW);
if (features.hasAVX()) {
- features.addIf(bitTest(regs.ecx, 11), CpuFeatures::X86::kXOP);
- features.addIf(bitTest(regs.ecx, 16), CpuFeatures::X86::kFMA4);
+ features.addIf(bitTest(regs.ecx, 11), Ext::kXOP);
+ features.addIf(bitTest(regs.ecx, 16), Ext::kFMA4);
}
// This feature seems to be only supported by AMD.
if (cpu.isVendor("AMD")) {
- features.addIf(bitTest(regs.ecx, 4), CpuFeatures::X86::kALTMOVCR8);
+ features.addIf(bitTest(regs.ecx, 4), Ext::kALTMOVCR8);
}
break;
@@ -439,17 +537,21 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
break;
case 0x80000008u:
- features.addIf(bitTest(regs.ebx, 0), CpuFeatures::X86::kCLZERO);
- features.addIf(bitTest(regs.ebx, 0), CpuFeatures::X86::kRDPRU);
- features.addIf(bitTest(regs.ebx, 8), CpuFeatures::X86::kMCOMMIT);
- features.addIf(bitTest(regs.ebx, 9), CpuFeatures::X86::kWBNOINVD);
+ features.addIf(bitTest(regs.ebx, 0), Ext::kCLZERO);
+ features.addIf(bitTest(regs.ebx, 0), Ext::kRDPRU);
+ features.addIf(bitTest(regs.ebx, 8), Ext::kMCOMMIT);
+ features.addIf(bitTest(regs.ebx, 9), Ext::kWBNOINVD);
// Go directly to the next one we are interested in.
i = 0x8000001Fu - 1;
break;
case 0x8000001Fu:
- features.addIf(bitTest(regs.eax, 4), CpuFeatures::X86::kSNP);
+ features.addIf(bitTest(regs.eax, 0), Ext::kSME);
+ features.addIf(bitTest(regs.eax, 1), Ext::kSEV);
+ features.addIf(bitTest(regs.eax, 3), Ext::kSEV_ES);
+ features.addIf(bitTest(regs.eax, 4), Ext::kSEV_SNP);
+ features.addIf(bitTest(regs.eax, 6), Ext::kRMPQUERY);
break;
}
} while (++i <= maxId);
@@ -458,11 +560,17 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
simplifyCpuBrand(cpu._brand.str);
}
+} // {x86}
+
#endif // ASMJIT_ARCH_X86
// CpuInfo - Detect - ARM
// ======================
+// Implement the most code outside the platform specific #ifdefs to minimize breaking the detection on
+// platforms that don't run on our CI infrastructure. The problem with the detection is that every OS
+// requires a specific implementation as ARM features cannot be detected in user-mode without OS enablement.
+
// The most relevant and accurate information can be found here:
// https://github.com/llvm-project/llvm/blob/master/lib/Target/AArch64/AArch64.td
// https://github.com/apple/llvm-project/blob/apple/main/llvm/lib/Target/AArch64/AArch64.td (Apple fork)
@@ -470,277 +578,921 @@ static ASMJIT_FAVOR_SIZE void detectX86Cpu(CpuInfo& cpu) noexcept {
// Other resources:
// https://en.wikipedia.org/wiki/AArch64
// https://en.wikipedia.org/wiki/Apple_silicon#List_of_Apple_processors
+// https://developer.arm.com/downloads/-/exploration-tools/feature-names-for-a-profile
// https://developer.arm.com/architectures/learn-the-architecture/understanding-the-armv8-x-extensions/single-page
#if ASMJIT_ARCH_ARM
+namespace arm {
+
+// ARM commonly refers to CPU features using FEAT_ prefix, we use Ext:: to make it compatible with other parts.
+typedef CpuFeatures::ARM Ext;
+
+// CpuInfo - Detect - ARM - OS Kernel Version
+// ==========================================
+
+#if defined(__linux__)
+struct UNameKernelVersion {
+ int parts[3];
+
+ inline bool atLeast(int major, int minor, int patch = 0) const noexcept {
+ if (parts[0] >= major) {
+ if (parts[0] > major)
+ return true;
+
+ if (parts[1] >= minor) {
+ if (parts[1] > minor)
+ return true;
+
+ return parts[2] >= patch;
+ }
+ }
+
+ return false;
+ }
+};
+
+ASMJIT_MAYBE_UNUSED
+static UNameKernelVersion getUNameKernelVersion() noexcept {
+ UNameKernelVersion ver{};
+ ver.parts[0] = -1;
+
+ utsname buffer;
+ if (uname(&buffer) != 0)
+ return ver;
+
+ size_t count = 0;
+ char* p = buffer.release;
+ while (*p) {
+ uint32_t c = uint8_t(*p);
+ if (c >= uint32_t('0') && c <= uint32_t('9')) {
+ ver.parts[count] = int(strtol(p, &p, 10));
+ if (++count == 3)
+ break;
+ }
+ else if (c == '.' || c == '-') {
+ p++;
+ }
+ else {
+ break;
+ }
+ }
+
+ return ver;
+}
+#endif // __linux__
+
+// CpuInfo - Detect - ARM - Baseline Features of ARM Architectures
+// ===============================================================
+
+ASMJIT_MAYBE_UNUSED
+static inline void populateBaseAArch32Features(CpuFeatures::ARM& features) noexcept {
+ // No baseline flags at the moment.
+ DebugUtils::unused(features);
+}
+
+ASMJIT_MAYBE_UNUSED
+static inline void populateBaseAArch64Features(CpuFeatures::ARM& features) noexcept {
+ // AArch64 is based on ARMv8.0 and later.
+ features.add(Ext::kARMv6);
+ features.add(Ext::kARMv7);
+ features.add(Ext::kARMv8a);
+
+ // AArch64 comes with these features by default.
+ features.add(Ext::kASIMD);
+ features.add(Ext::kFP);
+ features.add(Ext::kIDIVA);
+}
+
static inline void populateBaseARMFeatures(CpuInfo& cpu) noexcept {
#if ASMJIT_ARCH_ARM == 32
- // No baseline flags at the moment.
- DebugUtils::unused(cpu);
+ populateBaseAArch32Features(cpu.features().arm());
#else
- // AArch64 is based on ARMv8-A and later.
- cpu.addFeature(CpuFeatures::ARM::kARMv6);
- cpu.addFeature(CpuFeatures::ARM::kARMv7);
- cpu.addFeature(CpuFeatures::ARM::kARMv8a);
+ populateBaseAArch64Features(cpu.features().arm());
+#endif
+}
- // AArch64 comes with these features by default.
- cpu.addFeature(CpuFeatures::ARM::kVFPv2);
- cpu.addFeature(CpuFeatures::ARM::kVFPv3);
- cpu.addFeature(CpuFeatures::ARM::kVFPv4);
- cpu.addFeature(CpuFeatures::ARM::kASIMD);
- cpu.addFeature(CpuFeatures::ARM::kIDIVA);
+// CpuInfo - Detect - ARM - Mandatory Features of ARM Architectures
+// ================================================================
+
+// Populates mandatory ARMv8.[v]A features.
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FAVOR_SIZE void populateARMv8AFeatures(CpuFeatures::ARM& features, uint32_t v) noexcept {
+ switch (v) {
+ default:
+ ASMJIT_FALLTHROUGH;
+ case 9: // ARMv8.9
+ features.add(Ext::kCLRBHB, Ext::kCSSC, Ext::kPRFMSLC, Ext::kSPECRES2, Ext::kRAS2);
+ ASMJIT_FALLTHROUGH;
+ case 8: // ARMv8.8
+ features.add(Ext::kHBC, Ext::kMOPS, Ext::kNMI);
+ ASMJIT_FALLTHROUGH;
+ case 7: // ARMv8.7
+ features.add(Ext::kHCX, Ext::kPAN3, Ext::kWFXT, Ext::kXS);
+ ASMJIT_FALLTHROUGH;
+ case 6: // ARMv8.6
+ features.add(Ext::kAMU1_1, Ext::kBF16, Ext::kECV, Ext::kFGT, Ext::kI8MM);
+ ASMJIT_FALLTHROUGH;
+ case 5: // ARMv8.5
+ features.add(Ext::kBTI, Ext::kCSV2, Ext::kDPB2, Ext::kFLAGM2, Ext::kFRINTTS, Ext::kSB, Ext::kSPECRES, Ext::kSSBS);
+ ASMJIT_FALLTHROUGH;
+ case 4: // ARMv8.4
+ features.add(Ext::kAMU1, Ext::kDIT, Ext::kDOTPROD, Ext::kFLAGM,
+ Ext::kLRCPC2, Ext::kLSE2, Ext::kMPAM, Ext::kNV,
+ Ext::kSEL2, Ext::kTLBIOS, Ext::kTLBIRANGE, Ext::kTRF);
+ ASMJIT_FALLTHROUGH;
+ case 3: // ARMv8.3
+ features.add(Ext::kCCIDX, Ext::kFCMA, Ext::kJSCVT, Ext::kLRCPC, Ext::kPAUTH);
+ ASMJIT_FALLTHROUGH;
+ case 2: // ARMv8.2
+ features.add(Ext::kDPB, Ext::kPAN2, Ext::kRAS, Ext::kUAO);
+ ASMJIT_FALLTHROUGH;
+ case 1: // ARMv8.1
+ features.add(Ext::kCRC32, Ext::kLOR, Ext::kLSE, Ext::kPAN, Ext::kRDM, Ext::kVHE);
+ ASMJIT_FALLTHROUGH;
+ case 0: // ARMv8.0
+ features.add(Ext::kASIMD, Ext::kFP, Ext::kIDIVA, Ext::kVFP_D32);
+ break;
+ }
+}
+
+// Populates mandatory ARMv9.[v] features.
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FAVOR_SIZE void populateARMv9AFeatures(CpuFeatures::ARM& features, uint32_t v) noexcept {
+ populateARMv8AFeatures(features, v <= 4u ? 5u + v : 9u);
+
+ switch (v) {
+ default:
+ ASMJIT_FALLTHROUGH;
+ case 4: // ARMv9.4 - based on ARMv8.9.
+ ASMJIT_FALLTHROUGH;
+ case 3: // ARMv9.3 - based on ARMv8.8.
+ ASMJIT_FALLTHROUGH;
+ case 2: // ARMv9.2 - based on ARMv8.7.
+ ASMJIT_FALLTHROUGH;
+ case 1: // ARMv9.1 - based on ARMv8.6.
+ ASMJIT_FALLTHROUGH;
+ case 0: // ARMv9.0 - based on ARMv8.5.
+ features.add(Ext::kRME, Ext::kSVE, Ext::kSVE2);
+ break;
+ }
+}
+
+// CpuInfo - Detect - ARM - CPUID Based Features
+// =============================================
+
+// This implements detection based on the content of CPUID registers. The following code doesn't actually read any
+// of the registers so it's an implementation that can theoretically be tested / used in mocks.
+
+// Merges a feature that contains 0b1111 when it doesn't exist and starts at 0b0000 when it does.
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FORCE_INLINE void mergeAArch64CPUIDFeatureNA(CpuFeatures::ARM& features, uint64_t regBits, uint32_t offset,
+ Ext::Id f0,
+ Ext::Id f1 = Ext::kNone,
+ Ext::Id f2 = Ext::kNone,
+ Ext::Id f3 = Ext::kNone) noexcept {
+
+ uint32_t val = uint32_t((regBits >> offset) & 0xFu);
+
+ // If val == 0b1111 then the feature is not implemented in this case (some early extensions).
+ if (val == 0xFu)
+ return;
+
+ if (f0 != Ext::kNone) features.add(f0);
+ if (f1 != Ext::kNone) features.addIf(val >= 1, f1);
+ if (f2 != Ext::kNone) features.addIf(val >= 2, f2);
+ if (f3 != Ext::kNone) features.addIf(val >= 3, f3);
+}
+
+// Merges a feature identified by a single bit at `offset`.
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FORCE_INLINE void mergeAArch64CPUIDFeature1B(CpuFeatures::ARM& features, uint64_t regBits, uint32_t offset, Ext::Id f1) noexcept {
+ features.addIf((regBits & (uint64_t(1) << offset)) != 0, f1);
+}
+
+// Merges a feature-list starting from 0b01 when it does (0b00 means feature not supported).
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FORCE_INLINE void mergeAArch64CPUIDFeature2B(CpuFeatures::ARM& features, uint64_t regBits, uint32_t offset, Ext::Id f1, Ext::Id f2, Ext::Id f3) noexcept {
+ uint32_t val = uint32_t((regBits >> offset) & 0x3u);
+
+ if (f1 != Ext::kNone) features.addIf(val >= 1, f1);
+ if (f2 != Ext::kNone) features.addIf(val >= 2, f2);
+ if (f3 != Ext::kNone) features.addIf(val == 3, f3);
+}
+
+// Merges a feature-list starting from 0b0001 when it does (0b0000 means feature not supported).
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FORCE_INLINE void mergeAArch64CPUIDFeature4B(CpuFeatures::ARM& features, uint64_t regBits, uint32_t offset,
+ Ext::Id f1,
+ Ext::Id f2 = Ext::kNone,
+ Ext::Id f3 = Ext::kNone,
+ Ext::Id f4 = Ext::kNone) noexcept {
+
+ uint32_t val = uint32_t((regBits >> offset) & 0xFu);
+
+ // if val == 0 it means that this feature is not supported.
+
+ if (f1 != Ext::kNone) features.addIf(val >= 1, f1);
+ if (f2 != Ext::kNone) features.addIf(val >= 2, f2);
+ if (f3 != Ext::kNone) features.addIf(val >= 3, f3);
+ if (f4 != Ext::kNone) features.addIf(val >= 4, f4);
+}
+
+// Merges a feature that is identified by an exact bit-combination of 4 bits.
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FORCE_INLINE void mergeAArch64CPUIDFeature4S(CpuFeatures::ARM& features, uint64_t regBits, uint32_t offset, uint32_t value, Ext::Id f1) noexcept {
+ features.addIf(uint32_t((regBits >> offset) & 0xFu) == value, f1);
+}
+
+#define MERGE_FEATURE_NA(identifier, reg, offset, ...) mergeAArch64CPUIDFeatureNA(cpu.features().arm(), reg, offset, __VA_ARGS__)
+#define MERGE_FEATURE_1B(identifier, reg, offset, ...) mergeAArch64CPUIDFeature1B(cpu.features().arm(), reg, offset, __VA_ARGS__)
+#define MERGE_FEATURE_2B(identifier, reg, offset, ...) mergeAArch64CPUIDFeature2B(cpu.features().arm(), reg, offset, __VA_ARGS__)
+#define MERGE_FEATURE_4B(identifier, reg, offset, ...) mergeAArch64CPUIDFeature4B(cpu.features().arm(), reg, offset, __VA_ARGS__)
+#define MERGE_FEATURE_4S(identifier, reg, offset, ...) mergeAArch64CPUIDFeature4S(cpu.features().arm(), reg, offset, __VA_ARGS__)
+
+// Detects features based on the content of ID_AA64PFR0_EL1 and ID_AA64PFR1_EL1 registers.
+ASMJIT_MAYBE_UNUSED
+static inline void detectAArch64FeaturesViaCPUID_AA64PFR0_AA64PFR1(CpuInfo& cpu, uint64_t fpr0, uint64_t fpr1) noexcept {
+ // ID_AA64PFR0_EL1
+ // ===============
+
+ // FP and AdvSIMD bits should match (i.e. if FP features FP16, ASIMD must feature it too).
+ MERGE_FEATURE_NA("FP bits [19:16]" , fpr0, 16, Ext::kFP, Ext::kFP16);
+ MERGE_FEATURE_NA("AdvSIMD bits [23:20]" , fpr0, 20, Ext::kASIMD, Ext::kFP16);
+ /*
+ MERGE_FEATURE_4B("GIC bits [27:24]" , fpr0, 24, ...);
+ */
+ MERGE_FEATURE_4B("RAS bits [31:28]" , fpr0, 28, Ext::kRAS, Ext::kRAS1_1, Ext::kRAS2);
+ MERGE_FEATURE_4B("SVE bits [35:32]" , fpr0, 32, Ext::kSVE);
+ MERGE_FEATURE_4B("SEL2 bits [39:36]" , fpr0, 36, Ext::kSEL2);
+ MERGE_FEATURE_4B("MPAM bits [43:40]" , fpr0, 40, Ext::kMPAM);
+ MERGE_FEATURE_4B("AMU bits [47:44]" , fpr0, 44, Ext::kAMU1, Ext::kAMU1_1);
+ MERGE_FEATURE_4B("DIT bits [51:48]" , fpr0, 48, Ext::kDIT);
+ MERGE_FEATURE_4B("RME bits [55:52]" , fpr0, 52, Ext::kRME);
+ MERGE_FEATURE_4B("CSV2 bits [59:56]" , fpr0, 56, Ext::kCSV2, Ext::kCSV2, Ext::kCSV2, Ext::kCSV2_3);
+ MERGE_FEATURE_4B("CSV3 bits [63:60]" , fpr0, 60, Ext::kCSV3);
+
+ // ID_AA64PFR1_EL1
+ // ===============
+
+ MERGE_FEATURE_4B("BT bits [3:0]" , fpr1, 0, Ext::kBTI);
+ MERGE_FEATURE_4B("SSBS bits [7:4]" , fpr1, 4, Ext::kSSBS, Ext::kSSBS2);
+ MERGE_FEATURE_4B("MTE bits [11:8]" , fpr1, 8, Ext::kMTE, Ext::kMTE2, Ext::kMTE3);
+ /*
+ MERGE_FEATURE_4B("RAS_frac bits [15:12]" , fpr1, 12, ...);
+ MERGE_FEATURE_4B("MPAM_frac bits [19:16]" , fpr1, 16, ...);
+ */
+ MERGE_FEATURE_4B("SME bits [27:24]" , fpr1, 24, Ext::kSME, Ext::kSME2);
+ MERGE_FEATURE_4B("RNDR_trap bits [31:28]" , fpr1, 28, Ext::kRNG_TRAP);
+ /*
+ MERGE_FEATURE_4B("CSV2_frac bits [35:32]" , fpr1, 32, ...);
+ */
+ MERGE_FEATURE_4B("NMI bits [39:36]" , fpr1, 36, Ext::kNMI);
+ /*
+ MERGE_FEATURE_4B("MTE_frac bits [43:40]" , fpr1, 40, ...);
+ */
+ MERGE_FEATURE_4B("GCS bits [47:44]" , fpr1, 44, Ext::kGCS);
+ MERGE_FEATURE_4B("THE bits [51:48]" , fpr1, 48, Ext::kTHE);
+
+ // MTEX extensions are only available when MTE3 is available.
+ if (cpu.features().arm().hasMTE3())
+ MERGE_FEATURE_4B("MTEX bits [55:52]" , fpr1, 52, Ext::kMTE4);
+
+ /*
+ MERGE_FEATURE_4B("DF2 bits [59:56]" , fpr1, 56, ...);
+ */
+ MERGE_FEATURE_4B("PFAR bits [63:60]" , fpr1, 60, Ext::kPFAR);
+
+ // ID_AA64PFR0_EL1 + ID_AA64PFR1_EL1
+ // =================================
+
+ uint32_t rasMain = uint32_t((fpr0 >> 28) & 0xFu);
+ uint32_t rasFrac = uint32_t((fpr1 >> 12) & 0xFu);
+
+ if (rasMain == 1 && rasFrac == 1) {
+ cpu.features().arm().add(Ext::kRAS1_1);
+ }
+
+ uint32_t mpamMain = uint32_t((fpr0 >> 40) & 0xFu);
+ uint32_t mpamFrac = uint32_t((fpr1 >> 16) & 0xFu);
+
+ if (mpamMain || mpamFrac)
+ cpu.features().arm().add(Ext::kMPAM);
+}
+
+// Detects features based on the content of ID_AA64ISAR0_EL1 and ID_AA64ISAR1_EL1 registers.
+ASMJIT_MAYBE_UNUSED
+static inline void detectAArch64FeaturesViaCPUID_AA64ISAR0_AA64ISAR1(CpuInfo& cpu, uint64_t isar0, uint64_t isar1) noexcept {
+ // ID_AA64ISAR0_EL1
+ // ================
+
+ MERGE_FEATURE_4B("AES bits [7:4]" , isar0, 4, Ext::kAES, Ext::kPMULL);
+ MERGE_FEATURE_4B("SHA1 bits [11:8]" , isar0, 8, Ext::kSHA1);
+ MERGE_FEATURE_4B("SHA2 bits [15:12]" , isar0, 12, Ext::kSHA256, Ext::kSHA512);
+ MERGE_FEATURE_4B("CRC32 bits [19:16]" , isar0, 16, Ext::kCRC32);
+ MERGE_FEATURE_4B("Atomic bits [23:20]" , isar0, 20, Ext::kNone, Ext::kLSE, Ext::kLSE128);
+ MERGE_FEATURE_4B("TME bits [27:24]" , isar0, 24, Ext::kTME);
+ MERGE_FEATURE_4B("RDM bits [31:28]" , isar0, 28, Ext::kRDM);
+ MERGE_FEATURE_4B("SHA3 bits [35:32]" , isar0, 32, Ext::kSHA3);
+ MERGE_FEATURE_4B("SM3 bits [39:36]" , isar0, 36, Ext::kSM3);
+ MERGE_FEATURE_4B("SM4 bits [43:40]" , isar0, 40, Ext::kSM4);
+ MERGE_FEATURE_4B("DP bits [47:44]" , isar0, 44, Ext::kDOTPROD);
+ MERGE_FEATURE_4B("FHM bits [51:48]" , isar0, 48, Ext::kFHM);
+ MERGE_FEATURE_4B("TS bits [55:52]" , isar0, 52, Ext::kFLAGM, Ext::kFLAGM2);
+ /*
+ MERGE_FEATURE_4B("TLB bits [59:56]" , isar0, 56, ...);
+ */
+ MERGE_FEATURE_4B("RNDR bits [63:60]" , isar0, 60, Ext::kFLAGM, Ext::kRNG);
+
+ // ID_AA64ISAR1_EL1
+ // ================
+
+ MERGE_FEATURE_4B("DPB bits [3:0]" , isar1, 0, Ext::kDPB, Ext::kDPB2);
+ /*
+ MERGE_FEATURE_4B("APA bits [7:4]" , isar1, 4, ...);
+ MERGE_FEATURE_4B("API bits [11:8]" , isar1, 8, ...);
+ */
+ MERGE_FEATURE_4B("JSCVT bits [15:12]" , isar1, 12, Ext::kJSCVT);
+ MERGE_FEATURE_4B("FCMA bits [19:16]" , isar1, 16, Ext::kFCMA);
+ MERGE_FEATURE_4B("LRCPC bits [23:20]" , isar1, 20, Ext::kLRCPC, Ext::kLRCPC2, Ext::kLRCPC3);
+ /*
+ MERGE_FEATURE_4B("GPA bits [27:24]" , isar1, 24, ...);
+ MERGE_FEATURE_4B("GPI bits [31:28]" , isar1, 28, ...);
+ */
+ MERGE_FEATURE_4B("FRINTTS bits [35:32]" , isar1, 32, Ext::kFRINTTS);
+ MERGE_FEATURE_4B("SB bits [39:36]" , isar1, 36, Ext::kSB);
+ MERGE_FEATURE_4B("SPECRES bits [43:40]" , isar1, 40, Ext::kSPECRES, Ext::kSPECRES2);
+ MERGE_FEATURE_4B("BF16 bits [47:44]" , isar1, 44, Ext::kBF16, Ext::kEBF16);
+ MERGE_FEATURE_4B("DGH bits [51:48]" , isar1, 48, Ext::kDGH);
+ MERGE_FEATURE_4B("I8MM bits [55:52]" , isar1, 52, Ext::kI8MM);
+ MERGE_FEATURE_4B("XS bits [59:56]" , isar1, 56, Ext::kXS);
+ MERGE_FEATURE_4B("LS64 bits [63:60]" , isar1, 60, Ext::kLS64, Ext::kLS64_V, Ext::kLS64_ACCDATA);
+}
+
+// Detects features based on the content of ID_AA64ISAR2_EL1 register.
+ASMJIT_MAYBE_UNUSED
+static inline void detectAArch64FeaturesViaCPUID_AA64ISAR2(CpuInfo& cpu, uint64_t isar2) noexcept {
+ MERGE_FEATURE_4B("WFxT bits [3:0]" , isar2, 0, Ext::kNone, Ext::kWFXT);
+ MERGE_FEATURE_4B("RPRES bits [7:4]" , isar2, 4, Ext::kRPRES);
+ /*
+ MERGE_FEATURE_4B("GPA3 bits [11:8]" , isar2, 8, ...);
+ MERGE_FEATURE_4B("APA3 bits [15:12]" , isar2, 12, ...);
+ */
+ MERGE_FEATURE_4B("MOPS bits [19:16]" , isar2, 16, Ext::kMOPS);
+ MERGE_FEATURE_4B("BC bits [23:20]" , isar2, 20, Ext::kHBC);
+ MERGE_FEATURE_4B("PAC_frac bits [27:24]" , isar2, 24, Ext::kCONSTPACFIELD);
+ MERGE_FEATURE_4B("CLRBHB bits [31:28]" , isar2, 28, Ext::kCLRBHB);
+ MERGE_FEATURE_4B("SYSREG128 bits [35:32]" , isar2, 32, Ext::kSYSREG128);
+ MERGE_FEATURE_4B("SYSINSTR128 bits [39:36]" , isar2, 36, Ext::kSYSINSTR128);
+ MERGE_FEATURE_4B("PRFMSLC bits [43:40]" , isar2, 40, Ext::kPRFMSLC);
+ MERGE_FEATURE_4B("RPRFM bits [51:48]" , isar2, 48, Ext::kRPRFM);
+ MERGE_FEATURE_4B("CSSC bits [55:52]" , isar2, 52, Ext::kCSSC);
+ MERGE_FEATURE_4B("LUT bits [59:56]" , isar2, 56, Ext::kLUT);
+}
+
+// TODO: This register is not accessed at the moment.
+#if 0
+// Detects features based on the content of ID_AA64ISAR3_EL1register.
+ASMJIT_MAYBE_UNUSED
+static inline void detectAArch64FeaturesViaCPUID_AA64ISAR3(CpuInfo& cpu, uint64_t isar3) noexcept {
+ // ID_AA64ISAR3_EL1
+ // ================
+
+ MERGE_FEATURE_4B("CPA bits [3:0]" , isar3, 0, Ext::kCPA, Ext::kCPA2);
+ MERGE_FEATURE_4B("FAMINMAX bits [7:4]" , isar3, 4, Ext::kFAMINMAX);
+ MERGE_FEATURE_4B("TLBIW bits [11:8]" , isar3, 8, Ext::kTLBIW);
+}
#endif
+
+ASMJIT_MAYBE_UNUSED
+static inline void detectAArch64FeaturesViaCPUID_AA64MMFR0(CpuInfo& cpu, uint64_t mmfr0) noexcept {
+ // ID_AA64MMFR0_EL1
+ // ================
+
+ /*
+ MERGE_FEATURE_4B("PARange bits [3:0]" , mmfr0, 0, ...);
+ MERGE_FEATURE_4B("ASIDBits bits [7:4]" , mmfr0, 4, ...);
+ MERGE_FEATURE_4B("BigEnd bits [11:8]" , mmfr0, 8, ...);
+ MERGE_FEATURE_4B("SNSMem bits [15:12]" , mmfr0, 12, ...);
+ MERGE_FEATURE_4B("BigEndEL0 bits [19:16]" , mmfr0, 16, ...);
+ MERGE_FEATURE_4B("TGran16 bits [23:20]" , mmfr0, 20, ...);
+ MERGE_FEATURE_4B("TGran64 bits [27:24]" , mmfr0, 24, ...);
+ MERGE_FEATURE_4B("TGran4 bits [31:28]" , mmfr0, 28, ...);
+ MERGE_FEATURE_4B("TGran16_2 bits [35:32]" , mmfr0, 32, ...);
+ MERGE_FEATURE_4B("TGran64_2 bits [39:36]" , mmfr0, 36, ...);
+ MERGE_FEATURE_4B("TGran4_2 bits [43:40]" , mmfr0, 40, ...);
+ MERGE_FEATURE_4B("ExS bits [47:44]" , mmfr0, 44, ...);
+ */
+ MERGE_FEATURE_4B("FGT bits [59:56]" , mmfr0, 56, Ext::kFGT, Ext::kFGT2);
+ MERGE_FEATURE_4B("ECV bits [63:60]" , mmfr0, 60, Ext::kECV);
+}
+
+ASMJIT_MAYBE_UNUSED
+static inline void detectAArch64FeaturesViaCPUID_AA64MMFR1(CpuInfo& cpu, uint64_t mmfr1) noexcept {
+ // ID_AA64MMFR1_EL1
+ // ================
+
+ MERGE_FEATURE_4B("HAFDBS bits [3:0]" , mmfr1, 0, Ext::kHAFDBS, Ext::kNone, Ext::kHAFT, Ext::kHDBSS);
+ MERGE_FEATURE_4B("VMIDBits bits [7:4]" , mmfr1, 4, Ext::kVMID16);
+ MERGE_FEATURE_4B("VH bits [11:8]" , mmfr1, 8, Ext::kVHE);
+ MERGE_FEATURE_4B("HPDS bits [15:12]" , mmfr1, 12, Ext::kHPDS, Ext::kHPDS2);
+ MERGE_FEATURE_4B("LO bits [19:16]" , mmfr1, 16, Ext::kLOR);
+ MERGE_FEATURE_4B("PAN bits [23:20]" , mmfr1, 20, Ext::kPAN, Ext::kPAN2, Ext::kPAN3);
+ /*
+ MERGE_FEATURE_4B("SpecSEI bits [27:24]" , mmfr1, 24, ...);
+ */
+ MERGE_FEATURE_4B("XNX bits [31:28]" , mmfr1, 28, Ext::kXNX);
+ /*
+ MERGE_FEATURE_4B("TWED bits [35:32]" , mmfr1, 32, ...);
+ MERGE_FEATURE_4B("ETS bits [39:36]" , mmfr1, 36, ...);
+ */
+ MERGE_FEATURE_4B("HCX bits [43:40]" , mmfr1, 40, Ext::kHCX);
+ MERGE_FEATURE_4B("AFP bits [47:44]" , mmfr1, 44, Ext::kAFP);
+ /*
+ MERGE_FEATURE_4B("nTLBPA bits [51:48]" , mmfr1, 48, ...);
+ MERGE_FEATURE_4B("TIDCP1 bits [55:52]" , mmfr1, 52, ...);
+ */
+ MERGE_FEATURE_4B("CMOW bits [59:56]" , mmfr1, 56, Ext::kCMOW);
+ MERGE_FEATURE_4B("ECBHB bits [63:60]" , mmfr1, 60, Ext::kECBHB);
+}
+
+ASMJIT_MAYBE_UNUSED
+static inline void detectAArch64FeaturesViaCPUID_AA64MMFR2(CpuInfo& cpu, uint64_t mmfr2) noexcept {
+ // ID_AA64MMFR2_EL1
+ // ================
+
+ /*
+ MERGE_FEATURE_4B("CnP bits [3:0]" , mmfr2, 0, ...);
+ */
+ MERGE_FEATURE_4B("UAO bits [7:4]" , mmfr2, 4, Ext::kUAO);
+ /*
+ MERGE_FEATURE_4B("LSM bits [11:8]" , mmfr2, 8, ...);
+ MERGE_FEATURE_4B("IESB bits [15:12]" , mmfr2, 12, ...);
+ */
+ MERGE_FEATURE_4B("VARange bits [19:16]" , mmfr2, 16, Ext::kLVA, Ext::kLVA3);
+ MERGE_FEATURE_4B("CCIDX bits [23:20]" , mmfr2, 20, Ext::kCCIDX);
+ MERGE_FEATURE_4B("NV bits [27:24]" , mmfr2, 24, Ext::kNV, Ext::kNV2);
+ /*
+ MERGE_FEATURE_4B("ST bits [31:28]" , mmfr2, 28, ...);
+ */
+ MERGE_FEATURE_4B("AT bits [35:32]" , mmfr2, 32, Ext::kLSE2);
+ /*
+ MERGE_FEATURE_4B("IDS bits [39:36]" , mmfr2, 36, ...);
+ MERGE_FEATURE_4B("FWB bits [43:40]" , mmfr2, 40, ...);
+ MERGE_FEATURE_4B("TTL bits [51:48]" , mmfr2, 48, ...);
+ MERGE_FEATURE_4B("BBM bits [55:52]" , mmfr2, 52, ...);
+ MERGE_FEATURE_4B("EVT bits [59:56]" , mmfr2, 56, ...);
+ MERGE_FEATURE_4B("E0PD bits [63:60]" , mmfr2, 60, ...);
+ */
+}
+
+// Detects features based on the content of ID_AA64ZFR0_EL1 register.
+ASMJIT_MAYBE_UNUSED
+static inline void detectAArch64FeaturesViaCPUID_AA64ZFR0(CpuInfo& cpu, uint64_t zfr0) noexcept {
+ MERGE_FEATURE_4B("SVEver bits [3:0]" , zfr0, 0, Ext::kSVE2, Ext::kSVE2_1);
+ MERGE_FEATURE_4B("AES bits [7:4]" , zfr0, 4, Ext::kSVE_AES, Ext::kSVE_PMULL128);
+ MERGE_FEATURE_4B("BitPerm bits [19:16]" , zfr0, 16, Ext::kSVE_BITPERM);
+ MERGE_FEATURE_4B("BF16 bits [23:20]" , zfr0, 20, Ext::kSVE_BF16, Ext::kSVE_EBF16);
+ MERGE_FEATURE_4B("B16B16 bits [27:24]" , zfr0, 24, Ext::kSVE_B16B16);
+ MERGE_FEATURE_4B("SHA3 bits [35:32]" , zfr0, 32, Ext::kSVE_SHA3);
+ MERGE_FEATURE_4B("SM4 bits [43:40]" , zfr0, 40, Ext::kSVE_SM4);
+ MERGE_FEATURE_4B("I8MM bits [47:44]" , zfr0, 44, Ext::kSVE_I8MM);
+ MERGE_FEATURE_4B("F32MM bits [55:52]" , zfr0, 52, Ext::kSVE_F32MM);
+ MERGE_FEATURE_4B("F64MM bits [59:56]" , zfr0, 56, Ext::kSVE_F64MM);
+}
+
+ASMJIT_MAYBE_UNUSED
+static inline void detectAArch64FeaturesViaCPUID_AA64SMFR0(CpuInfo& cpu, uint64_t smfr0) noexcept {
+ MERGE_FEATURE_1B("SF8DP2 bit [28]" , smfr0, 29, Ext::kSSVE_FP8DOT2);
+ MERGE_FEATURE_1B("SF8DP4 bit [29]" , smfr0, 29, Ext::kSSVE_FP8DOT4);
+ MERGE_FEATURE_1B("SF8FMA bit [30]" , smfr0, 30, Ext::kSSVE_FP8FMA);
+ MERGE_FEATURE_1B("F32F32 bit [32]" , smfr0, 32, Ext::kSME_F32F32);
+ MERGE_FEATURE_1B("BI32I32 bit [33]" , smfr0, 33, Ext::kSME_BI32I32);
+ MERGE_FEATURE_1B("B16F32 bit [34]" , smfr0, 34, Ext::kSME_B16F32);
+ MERGE_FEATURE_1B("F16F32 bit [35]" , smfr0, 35, Ext::kSME_F16F32);
+ MERGE_FEATURE_4S("I8I32 bits [39:36]" , smfr0, 36, 0xF, Ext::kSME_I8I32);
+ MERGE_FEATURE_1B("F8F32 bit [40]" , smfr0, 40, Ext::kSME_F8F32);
+ MERGE_FEATURE_1B("F8F16 bit [41]" , smfr0, 41, Ext::kSME_F8F16);
+ MERGE_FEATURE_1B("F16F16 bit [42]" , smfr0, 42, Ext::kSME_F16F16);
+ MERGE_FEATURE_1B("B16B16 bit [43]" , smfr0, 43, Ext::kSME_B16B16);
+ MERGE_FEATURE_4S("I16I32 bits [47:44]" , smfr0, 44, 0x5, Ext::kSME_I16I32);
+ MERGE_FEATURE_1B("F64F64 bit [48]" , smfr0, 48, Ext::kSME_F64F64);
+ MERGE_FEATURE_4S("I16I64 bits [55:52]" , smfr0, 52, 0xF, Ext::kSME_I16I64);
+ MERGE_FEATURE_4B("SMEver bits [59:56]" , smfr0, 56, Ext::kSME2, Ext::kSME2_1);
+ MERGE_FEATURE_1B("LUTv2 bit [60]" , smfr0, 60, Ext::kSME_LUTv2);
+ MERGE_FEATURE_1B("FA64 bit [63]" , smfr0, 63, Ext::kSME_FA64);
+}
+
+#undef MERGE_FEATURE_4S
+#undef MERGE_FEATURE_4B
+#undef MERGE_FEATURE_2B
+#undef MERGE_FEATURE_1B
+#undef MERGE_FEATURE_NA
+
+// CpuInfo - Detect - ARM - CPU Vendor Features
+// ============================================
+
+// CPU features detection based on Apple family ID.
+enum class AppleFamilyId : uint32_t {
+ // Apple design.
+ kSWIFT = 0x1E2D6381u, // Apple A6/A6X (ARMv7s).
+ kCYCLONE = 0x37A09642u, // Apple A7 (ARMv8.0-A).
+ kTYPHOON = 0x2C91A47Eu, // Apple A8 (ARMv8.0-A).
+ kTWISTER = 0x92FB37C8u, // Apple A9 (ARMv8.0-A).
+ kHURRICANE = 0x67CEEE93u, // Apple A10 (ARMv8.1-A).
+ kMONSOON_MISTRAL = 0xE81E7EF6u, // Apple A11 (ARMv8.2-A).
+ kVORTEX_TEMPEST = 0x07D34B9Fu, // Apple A12 (ARMv8.3-A).
+ kLIGHTNING_THUNDER = 0x462504D2u, // Apple A13 (ARMv8.4-A).
+ kFIRESTORM_ICESTORM = 0x1B588BB3u, // Apple A14/M1 (ARMv8.5-A).
+ kAVALANCHE_BLIZZARD = 0XDA33D83Du, // Apple A15/M2.
+ kEVEREST_SAWTOOTH = 0X8765EDEAu // Apple A16.
+};
+
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FAVOR_SIZE bool detectARMFeaturesViaAppleFamilyId(CpuInfo& cpu) noexcept {
+ typedef AppleFamilyId Id;
+ CpuFeatures::ARM& features = cpu.features().arm();
+
+ switch (cpu.familyId()) {
+ // Apple A7-A9 (ARMv8.0-A).
+ case uint32_t(Id::kCYCLONE):
+ case uint32_t(Id::kTYPHOON):
+ case uint32_t(Id::kTWISTER):
+ populateARMv8AFeatures(features, 0);
+ features.add(Ext::kAES, Ext::kPMU, Ext::kPMULL, Ext::kSHA1, Ext::kSHA256);
+ return true;
+
+ // Apple A10 (ARMv8.0-A).
+ case uint32_t(Id::kHURRICANE):
+ populateARMv8AFeatures(features, 0);
+ features.add(Ext::kAES, Ext::kCRC32, Ext::kLOR, Ext::kPAN, Ext::kPMU, Ext::kPMULL, Ext::kRDM, Ext::kSHA1,
+ Ext::kSHA256, Ext::kVHE);
+ return true;
+
+ // Apple A11 (ARMv8.2-A).
+ case uint32_t(Id::kMONSOON_MISTRAL):
+ populateARMv8AFeatures(features, 2);
+ features.add(Ext::kAES, Ext::kFP16, Ext::kFP16CONV, Ext::kPMU, Ext::kPMULL, Ext::kSHA1, Ext::kSHA256);
+ return true;
+
+ // Apple A12 (ARMv8.3-A).
+ case uint32_t(Id::kVORTEX_TEMPEST):
+ populateARMv8AFeatures(features, 3);
+ features.add(Ext::kAES, Ext::kFP16, Ext::kFP16CONV, Ext::kPMU, Ext::kPMULL, Ext::kSHA1, Ext::kSHA256);
+ return true;
+
+ // Apple A13 (ARMv8.4-A).
+ case uint32_t(Id::kLIGHTNING_THUNDER):
+ populateARMv8AFeatures(features, 4);
+ features.add(Ext::kAES, Ext::kFHM, Ext::kFP16, Ext::kFP16CONV, Ext::kPMU, Ext::kPMULL, Ext::kSHA1,
+ Ext::kSHA256, Ext::kSHA3, Ext::kSHA512);
+ return true;
+
+ // Apple A14/M1 (ARMv8.5-A).
+ case uint32_t(Id::kFIRESTORM_ICESTORM):
+ populateARMv8AFeatures(features, 4);
+ features.add(Ext::kAES, Ext::kCSV2, Ext::kCSV3, Ext::kDPB2, Ext::kECV, Ext::kFHM, Ext::kFLAGM2,
+ Ext::kFP16, Ext::kFP16CONV, Ext::kFRINTTS, Ext::kPMU, Ext::kPMULL, Ext::kSB,
+ Ext::kSHA1, Ext::kSHA256, Ext::kSHA3, Ext::kSHA512, Ext::kSSBS);
+ return true;
+
+ // Apple A15/M2.
+ case uint32_t(Id::kAVALANCHE_BLIZZARD):
+ populateARMv8AFeatures(features, 6);
+ features.add(Ext::kAES, Ext::kFHM, Ext::kFP16, Ext::kFP16CONV, Ext::kPMU, Ext::kPMULL, Ext::kSHA1,
+ Ext::kSHA256, Ext::kSHA3, Ext::kSHA512);
+ return true;
+
+ // Apple A16.
+ case uint32_t(Id::kEVEREST_SAWTOOTH):
+ populateARMv8AFeatures(features, 6);
+ features.add(Ext::kAES, Ext::kFHM, Ext::kFP16, Ext::kFP16CONV, Ext::kHCX, Ext::kPMU, Ext::kPMULL,
+ Ext::kSHA1, Ext::kSHA256, Ext::kSHA3, Ext::kSHA512);
+ return true;
+
+ default:
+ return false;
+ }
}
+// CpuInfo - Detect - ARM - Compile Flags Features
+// ===============================================
+
// Detects ARM version by macros defined at compile time. This means that AsmJit will report features forced at
// compile time that should always be provided by the target CPU. This also means that if we don't provide any
// means to detect CPU features the features reported by AsmJit will at least not report less features than the
// target it was compiled to.
-ASMJIT_MAYBE_UNUSED
-static ASMJIT_FAVOR_SIZE void detectARMFeaturesViaCompilerFlags(CpuInfo& cpu) noexcept {
- DebugUtils::unused(cpu);
#if ASMJIT_ARCH_ARM == 32
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FAVOR_SIZE void detectAArch32FeaturesViaCompilerFlags(CpuInfo& cpu) noexcept {
+ DebugUtils::unused(cpu);
// ARM targets have no baseline at the moment.
-# if defined(__ARM_ARCH_7A__)
+#if defined(__ARM_ARCH_7A__)
cpu.addFeature(CpuFeatures::ARM::kARMv7);
-# endif
-# if defined(__ARM_ARCH_8A__)
+#endif
+
+#if defined(__ARM_ARCH_8A__)
cpu.addFeature(CpuFeatures::ARM::kARMv8a);
-# endif
+#endif
-# if defined(__TARGET_ARCH_THUMB)
+#if defined(__TARGET_ARCH_THUMB)
cpu.addFeature(CpuFeatures::ARM::kTHUMB);
-# if __TARGET_ARCH_THUMB >= 4
+#if __TARGET_ARCH_THUMB >= 4
cpu.addFeature(CpuFeatures::ARM::kTHUMBv2);
-# endif
-# endif
-
-# if defined(__ARM_FEATURE_FMA)
- cpu.addFeature(CpuFeatures::ARM::kVFPv3);
- cpu.addFeature(CpuFeatures::ARM::kVFPv4);
-# endif
-
-# if defined(__ARM_NEON)
- cpu.addFeature(CpuFeatures::ARM::kASIMD);
-# endif
-
-# if defined(__ARM_FEATURE_IDIV) && defined(__TARGET_ARCH_THUMB)
- cpu.addFeature(CpuFeatures::ARM::kIDIVT);
#endif
-# if defined(__ARM_FEATURE_IDIV) && !defined(__TARGET_ARCH_THUMB)
- cpu.addFeature(CpuFeatures::ARM::kIDIVA);
-# endif
-
#endif
-#if defined(__ARM_ARCH_8_1A__)
- cpu.addFeature(CpuFeatures::ARM::kARMv8_1a);
+#if defined(__ARM_FEATURE_FMA)
+ cpu.addFeature(Ext::kFP);
#endif
-#if defined(__ARM_ARCH_8_2A__)
- cpu.addFeature(CpuFeatures::ARM::kARMv8_2a);
-#endif
-#if defined(__ARM_ARCH_8_3A__)
- cpu.addFeature(CpuFeatures::ARM::kARMv8_3a);
-#endif
-#if defined(__ARM_ARCH_8_4A__)
- cpu.addFeature(CpuFeatures::ARM::kARMv8_4a);
+
+#if defined(__ARM_NEON)
+ cpu.addFeature(Ext::kASIMD);
#endif
-#if defined(__ARM_ARCH_8_5A__)
- cpu.addFeature(CpuFeatures::ARM::kARMv8_5a);
+
+#if defined(__ARM_FEATURE_IDIV) && defined(__TARGET_ARCH_THUMB)
+ cpu.addFeature(Ext::kIDIVT);
#endif
-#if defined(__ARM_ARCH_8_6A__)
- cpu.addFeature(CpuFeatures::ARM::kARMv8_6a);
+#if defined(__ARM_FEATURE_IDIV) && !defined(__TARGET_ARCH_THUMB)
+ cpu.addFeature(Ext::kIDIVA);
#endif
-#if defined(__ARM_ARCH_8_7A__)
- cpu.addFeature(CpuFeatures::ARM::kARMv8_7a);
+}
+#endif // ASMJIT_ARCH_ARM == 32
+
+#if ASMJIT_ARCH_ARM == 64
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FAVOR_SIZE void detectAArch64FeaturesViaCompilerFlags(CpuInfo& cpu) noexcept {
+ DebugUtils::unused(cpu);
+
+#if defined(__ARM_ARCH_9_5A__)
+ populateARMv9AFeatures(cpu.features().arm(), 5);
+#elif defined(__ARM_ARCH_9_4A__)
+ populateARMv9AFeatures(cpu.features().arm(), 4);
+#elif defined(__ARM_ARCH_9_3A__)
+ populateARMv9AFeatures(cpu.features().arm(), 3);
+#elif defined(__ARM_ARCH_9_2A__)
+ populateARMv9AFeatures(cpu.features().arm(), 2);
+#elif defined(__ARM_ARCH_9_1A__)
+ populateARMv9AFeatures(cpu.features().arm(), 1);
+#elif defined(__ARM_ARCH_9A__)
+ populateARMv9AFeatures(cpu.features().arm(), 0);
+#elif defined(__ARM_ARCH_8_9A__)
+ populateARMv8AFeatures(cpu.features().arm(), 9);
+#elif defined(__ARM_ARCH_8_8A__)
+ populateARMv8AFeatures(cpu.features().arm(), 8);
+#elif defined(__ARM_ARCH_8_7A__)
+ populateARMv8AFeatures(cpu.features().arm(), 7);
+#elif defined(__ARM_ARCH_8_6A__)
+ populateARMv8AFeatures(cpu.features().arm(), 6);
+#elif defined(__ARM_ARCH_8_5A__)
+ populateARMv8AFeatures(cpu.features().arm(), 5);
+#elif defined(__ARM_ARCH_8_4A__)
+ populateARMv8AFeatures(cpu.features().arm(), 4);
+#elif defined(__ARM_ARCH_8_3A__)
+ populateARMv8AFeatures(cpu.features().arm(), 3);
+#elif defined(__ARM_ARCH_8_2A__)
+ populateARMv8AFeatures(cpu.features().arm(), 2);
+#elif defined(__ARM_ARCH_8_1A__)
+ populateARMv8AFeatures(cpu.features().arm(), 1);
+#else
+ populateARMv8AFeatures(cpu.features().arm(), 0);
#endif
#if defined(__ARM_FEATURE_AES)
- cpu.addFeature(CpuFeatures::ARM::kAES);
+ cpu.addFeature(Ext::kAES);
#endif
#if defined(__ARM_FEATURE_BF16_SCALAR_ARITHMETIC) && defined(__ARM_FEATURE_BF16_VECTOR_ARITHMETIC)
- cpu.addFeature(CpuFeatures::ARM::kBF16);
+ cpu.addFeature(Ext::kBF16);
#endif
#if defined(__ARM_FEATURE_CRC32)
- cpu.addFeature(CpuFeatures::ARM::kCRC32);
+ cpu.addFeature(Ext::kCRC32);
#endif
#if defined(__ARM_FEATURE_CRYPTO)
- cpu.addFeature(CpuFeatures::ARM::kAES,
- CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2);
+ cpu.addFeature(Ext::kAES, Ext::kSHA1, Ext::kSHA256);
#endif
#if defined(__ARM_FEATURE_DOTPROD)
- cpu.addFeature(CpuFeatures::ARM::kDOTPROD);
+ cpu.addFeature(Ext::kDOTPROD);
#endif
#if defined(__ARM_FEATURE_FP16FML) || defined(__ARM_FEATURE_FP16_FML)
- cpu.addFeature(CpuFeatures::ARM::kFP16FML);
+ cpu.addFeature(Ext::kFHM);
#endif
#if defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC)
- cpu.addFeature(CpuFeatures::ARM::kFP16FULL);
+ cpu.addFeature(Ext::kFP16);
#endif
#if defined(__ARM_FEATURE_FRINT)
- cpu.addFeature(CpuFeatures::ARM::kFRINT);
+ cpu.addFeature(Ext::kFRINTTS);
#endif
#if defined(__ARM_FEATURE_JCVT)
- cpu.addFeature(CpuFeatures::ARM::kFJCVTZS);
+ cpu.addFeature(Ext::kJSCVT);
#endif
#if defined(__ARM_FEATURE_MATMUL_INT8)
- cpu.addFeature(CpuFeatures::ARM::kI8MM);
+ cpu.addFeature(Ext::kI8MM);
#endif
#if defined(__ARM_FEATURE_ATOMICS)
- cpu.addFeature(CpuFeatures::ARM::kLSE);
+ cpu.addFeature(Ext::kLSE);
#endif
#if defined(__ARM_FEATURE_MEMORY_TAGGING)
- cpu.addFeature(CpuFeatures::ARM::kMTE);
+ cpu.addFeature(Ext::kMTE);
#endif
#if defined(__ARM_FEATURE_QRDMX)
- cpu.addFeature(CpuFeatures::ARM::kRDM);
+ cpu.addFeature(Ext::kRDM);
#endif
#if defined(__ARM_FEATURE_RNG)
- cpu.addFeature(CpuFeatures::ARM::kRNG);
+ cpu.addFeature(Ext::kRNG);
#endif
#if defined(__ARM_FEATURE_SHA2)
- cpu.addFeature(CpuFeatures::ARM::kSHA2);
+ cpu.addFeature(Ext::kSHA256);
#endif
#if defined(__ARM_FEATURE_SHA3)
- cpu.addFeature(CpuFeatures::ARM::kSHA3);
+ cpu.addFeature(Ext::kSHA3);
#endif
#if defined(__ARM_FEATURE_SHA512)
- cpu.addFeature(CpuFeatures::ARM::kSHA512);
+ cpu.addFeature(Ext::kSHA512);
#endif
#if defined(__ARM_FEATURE_SM3)
- cpu.addFeature(CpuFeatures::ARM::kSM3);
+ cpu.addFeature(Ext::kSM3);
#endif
#if defined(__ARM_FEATURE_SM4)
- cpu.addFeature(CpuFeatures::ARM::kSM4);
+ cpu.addFeature(Ext::kSM4);
#endif
#if defined(__ARM_FEATURE_SVE) || defined(__ARM_FEATURE_SVE_VECTOR_OPERATORS)
- cpu.addFeature(CpuFeatures::ARM::kSVE);
+ cpu.addFeature(Ext::kSVE);
#endif
#if defined(__ARM_FEATURE_SVE_MATMUL_INT8)
- cpu.addFeature(CpuFeatures::ARM::kSVE_I8MM);
+ cpu.addFeature(Ext::kSVE_I8MM);
#endif
#if defined(__ARM_FEATURE_SVE_MATMUL_FP32)
- cpu.addFeature(CpuFeatures::ARM::kSVE_F32MM);
+ cpu.addFeature(Ext::kSVE_F32MM);
#endif
#if defined(__ARM_FEATURE_SVE_MATMUL_FP64)
- cpu.addFeature(CpuFeatures::ARM::kSVE_F64MM);
+ cpu.addFeature(Ext::kSVE_F64MM);
#endif
#if defined(__ARM_FEATURE_SVE2)
- cpu.addFeature(CpuFeatures::ARM::kSVE2);
+ cpu.addFeature(Ext::kSVE2);
#endif
#if defined(__ARM_FEATURE_SVE2_AES)
- cpu.addFeature(CpuFeatures::ARM::kSVE2_AES);
+ cpu.addFeature(Ext::kSVE_AES);
#endif
#if defined(__ARM_FEATURE_SVE2_BITPERM)
- cpu.addFeature(CpuFeatures::ARM::kSVE2_BITPERM);
+ cpu.addFeature(Ext::kSVE_BITPERM);
#endif
#if defined(__ARM_FEATURE_SVE2_SHA3)
- cpu.addFeature(CpuFeatures::ARM::kSVE2_SHA3);
+ cpu.addFeature(Ext::kSVE_SHA3);
#endif
#if defined(__ARM_FEATURE_SVE2_SM4)
- cpu.addFeature(CpuFeatures::ARM::kSVE2_SM4);
+ cpu.addFeature(Ext::kSVE_SM4);
#endif
#if defined(__ARM_FEATURE_TME)
- cpu.addFeature(CpuFeatures::ARM::kTME);
+ cpu.addFeature(Ext::kTME);
#endif
}
+#endif // ASMJIT_ARCH_ARM == 64
ASMJIT_MAYBE_UNUSED
-static ASMJIT_FAVOR_SIZE void expandARMFeaturesByVersion(CpuInfo& cpu) noexcept {
- CpuFeatures::ARM& features = cpu.features().arm();
+static ASMJIT_FAVOR_SIZE void detectARMFeaturesViaCompilerFlags(CpuInfo& cpu) noexcept {
+#if ASMJIT_ARCH_ARM == 32
+ detectAArch32FeaturesViaCompilerFlags(cpu);
+#else
+ detectAArch64FeaturesViaCompilerFlags(cpu);
+#endif // ASMJIT_ARCH_ARM
+}
- if (features.hasARMv8_7a()) {
- features.add(CpuFeatures::ARM::kARMv8_6a);
- }
+// CpuInfo - Detect - ARM - Post Processing ARM Features
+// =====================================================
- if (features.hasARMv8_6a()) {
- features.add(CpuFeatures::ARM::kARMv8_5a,
- CpuFeatures::ARM::kBF16);
+// Postprocesses AArch32 features.
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FAVOR_SIZE void postProcessAArch32Features(CpuFeatures::ARM& features) noexcept {
+ DebugUtils::unused(features);
+}
- if (features.hasSVE())
- features.add(CpuFeatures::ARM::kSVE_I8MM);
- }
+// Postprocesses AArch64 features.
+//
+// The only reason to use this function is to deduce some flags from others.
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FAVOR_SIZE void postProcessAArch64Features(CpuFeatures::ARM& features) noexcept {
+ if (features.hasFP16())
+ features.add(Ext::kFP16CONV);
- if (features.hasARMv8_5a()) {
- features.add(CpuFeatures::ARM::kARMv8_4a,
- CpuFeatures::ARM::kALTNZCV,
- CpuFeatures::ARM::kBTI,
- CpuFeatures::ARM::kFRINT,
- CpuFeatures::ARM::kSB,
- CpuFeatures::ARM::kSSBS);
- }
+ if (features.hasMTE3())
+ features.add(Ext::kMTE2);
- if (features.hasARMv8_4a()) {
- features.add(CpuFeatures::ARM::kARMv8_3a,
- CpuFeatures::ARM::kDIT,
- CpuFeatures::ARM::kDOTPROD,
- CpuFeatures::ARM::kFLAGM,
- CpuFeatures::ARM::kPMU,
- CpuFeatures::ARM::kRCPC_IMMO);
- }
+ if (features.hasMTE2())
+ features.add(Ext::kMTE);
- if (features.hasARMv8_3a()) {
- features.add(CpuFeatures::ARM::kARMv8_2a,
- CpuFeatures::ARM::kFCMA,
- CpuFeatures::ARM::kFJCVTZS);
- }
+ if (features.hasSSBS2())
+ features.add(Ext::kSSBS);
+}
- if (features.hasARMv8_2a()) {
- features.add(CpuFeatures::ARM::kARMv8_1a);
- }
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FAVOR_SIZE void postProcessARMCpuInfo(CpuInfo& cpu) noexcept {
+#if ASMJIT_ARCH_ARM == 32
+ postProcessAArch32Features(cpu.features().arm());
+#else
+ postProcessAArch64Features(cpu.features().arm());
+#endif // ASMJIT_ARCH_ARM
+}
+
+// CpuInfo - Detect - ARM - Detect by Reading CPUID Registers
+// ==========================================================
- if (features.hasARMv8_1a()) {
- features.add(CpuFeatures::ARM::kARMv8a,
- CpuFeatures::ARM::kCRC32,
- CpuFeatures::ARM::kLSE,
- CpuFeatures::ARM::kRDM);
+// Support CPUID-based detection on AArch64.
+#if defined(ASMJIT_ARM_DETECT_VIA_CPUID)
+
+// Since the register ID is encoded with the instruction we have to create a function for each register ID to read.
+#define ASMJIT_AARCH64_DEFINE_CPUID_READ_FN(func, regId) \
+ASMJIT_MAYBE_UNUSED \
+static inline uint64_t func() noexcept { \
+ uint64_t output; \
+ __asm__ __volatile__("mrs %0, " #regId : "=r"(output)); \
+ return output; \
+}
+
+// NOTE: Older tools don't know the IDs. For example Ubuntu on RPI (GCC 9) won't compile ID_AA64ISAR2_EL1 in 2023.
+ASMJIT_AARCH64_DEFINE_CPUID_READ_FN(aarch64ReadPFR0, ID_AA64PFR0_EL1)
+ASMJIT_AARCH64_DEFINE_CPUID_READ_FN(aarch64ReadPFR1, ID_AA64PFR1_EL1)
+ASMJIT_AARCH64_DEFINE_CPUID_READ_FN(aarch64ReadISAR0, ID_AA64ISAR0_EL1)
+ASMJIT_AARCH64_DEFINE_CPUID_READ_FN(aarch64ReadISAR1, ID_AA64ISAR1_EL1)
+ASMJIT_AARCH64_DEFINE_CPUID_READ_FN(aarch64ReadISAR2, S3_0_C0_C6_2) // ID_AA64ISAR2_EL1
+ASMJIT_AARCH64_DEFINE_CPUID_READ_FN(aarch64ReadZFR0, S3_0_C0_C4_4) // ID_AA64ZFR0_EL1
+
+#undef ASMJIT_AARCH64_DEFINE_CPUID_READ_FN
+
+// Detects AArch64 features by reading CPUID bits directly from CPUID registers. This is the most reliable method
+// as the OS doesn't have to know all supported extensions this way (if there is something missing in HWCAPS then
+// there is no way to detect such feature without reading CPUID bits).
+//
+// This function uses MSR instructions, which means that it reads registers that cannot be read in user-mode. The
+// OS typically implements this feature by handling SIGILL internally and providing a filtered content of these
+// registers back to the user - at least this is what Linux documentation states - everything implementation
+// dependent is zeroed, only the bits that are used for CPU feature identification would be present.
+//
+// References:
+// - https://docs.kernel.org/arch/arm64/cpu-feature-registers.html
+ASMJIT_MAYBE_UNUSED
+static ASMJIT_FAVOR_SIZE void detectAArch64FeaturesViaCPUID(CpuInfo& cpu) noexcept {
+ populateBaseARMFeatures(cpu);
+
+ detectAArch64FeaturesViaCPUID_AA64PFR0_AA64PFR1(cpu,
+ aarch64ReadPFR0(),
+ aarch64ReadPFR1());
+
+ detectAArch64FeaturesViaCPUID_AA64ISAR0_AA64ISAR1(cpu,
+ aarch64ReadISAR0(),
+ aarch64ReadISAR1());
+
+ // TODO: Fix this on FreeBSD - I don't know what kernel version allows to access the registers below...
+
+#if defined(__linux__)
+ UNameKernelVersion kVer = getUNameKernelVersion();
+
+ // Introduced in Linux 4.19 by "arm64: add ID_AA64ISAR2_EL1 sys register"), so we want at least 4.20.
+ if (kVer.atLeast(4, 20)) {
+ detectAArch64FeaturesViaCPUID_AA64ISAR2(cpu, aarch64ReadISAR2());
}
- if (features.hasARMv8a()) {
- features.add(CpuFeatures::ARM::kARMv7,
- CpuFeatures::ARM::kVFPv2,
- CpuFeatures::ARM::kVFPv3,
- CpuFeatures::ARM::kVFPv4,
- CpuFeatures::ARM::kVFP_D32,
- CpuFeatures::ARM::kASIMD,
- CpuFeatures::ARM::kIDIVA);
+ // Introduced in Linux 5.10 by "arm64: Expose SVE2 features for userspace", so we want at least 5.11.
+ if (kVer.atLeast(5, 11) && cpu.features().arm().hasAny(Ext::kSVE, Ext::kSME)) {
+ // Only read CPU_ID_AA64ZFR0 when either SVE or SME is available.
+ detectAArch64FeaturesViaCPUID_AA64ZFR0(cpu, aarch64ReadZFR0());
}
+#endif
}
-// CpuInfo - Detect - ARM [Windows]
-// ================================
+#endif // ASMJIT_ARM_DETECT_VIA_CPUID
+
+// CpuInfo - Detect - ARM - Detect by Windows API
+// ==============================================
#if defined(_WIN32)
struct WinPFPMapping {
@@ -749,9 +1501,11 @@ struct WinPFPMapping {
};
static ASMJIT_FAVOR_SIZE void detectPFPFeatures(CpuInfo& cpu, const WinPFPMapping* mapping, size_t size) noexcept {
- for (size_t i = 0; i < size; i++)
- if (::IsProcessorFeaturePresent(mapping[i].pfpFeatureId))
+ for (size_t i = 0; i < size; i++) {
+ if (::IsProcessorFeaturePresent(mapping[i].pfpFeatureId)) {
cpu.addFeature(mapping[i].featureId);
+ }
+ }
}
//! Detect ARM CPU features on Windows.
@@ -763,400 +1517,495 @@ static ASMJIT_FAVOR_SIZE void detectARMCpu(CpuInfo& cpu) noexcept {
CpuFeatures::ARM& features = cpu.features().arm();
- // Win32 for ARM requires ARMv7 with DSP extensions, VFPv3, and uses THUMBv2 by default.
+ // Win32 for ARM requires ARMv7 with DSP extensions, VFPv3 (FP), and uses THUMBv2 by default.
#if ASMJIT_ARCH_ARM == 32
- features.add(CpuFeatures::ARM::kTHUMB);
- features.add(CpuFeatures::ARM::kTHUMBv2);
- features.add(CpuFeatures::ARM::kARMv6);
- features.add(CpuFeatures::ARM::kARMv7);
- features.add(CpuFeatures::ARM::kEDSP);
- features.add(CpuFeatures::ARM::kVFPv2);
- features.add(CpuFeatures::ARM::kVFPv3);
+ features.add(Ext::kTHUMB);
+ features.add(Ext::kTHUMBv2);
+ features.add(Ext::kARMv6);
+ features.add(Ext::kARMv7);
+ features.add(Ext::kEDSP);
#endif
- // Windows for ARM requires ASIMD.
- features.add(CpuFeatures::ARM::kASIMD);
+ // Windows for ARM requires FP and ASIMD.
+ features.add(Ext::kFP);
+ features.add(Ext::kASIMD);
// Detect additional CPU features by calling `IsProcessorFeaturePresent()`.
static const WinPFPMapping mapping[] = {
#if ASMJIT_ARCH_ARM == 32
- { uint8_t(CpuFeatures::ARM::kVFP_D32) , 18 }, // PF_ARM_VFP_32_REGISTERS_AVAILABLE
- { uint8_t(CpuFeatures::ARM::kIDIVT) , 24 }, // PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE
- { uint8_t(CpuFeatures::ARM::kVFPv4) , 27 }, // PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE
- { uint8_t(CpuFeatures::ARM::kARMv8a) , 29 }, // PF_ARM_V8_INSTRUCTIONS_AVAILABLE
+ { uint8_t(Ext::kVFP_D32) , 18 }, // PF_ARM_VFP_32_REGISTERS_AVAILABLE
+ { uint8_t(Ext::kIDIVT) , 24 }, // PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE
+ { uint8_t(Ext::kFMAC) , 27 }, // PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE
+ { uint8_t(Ext::kARMv8a) , 29 }, // PF_ARM_V8_INSTRUCTIONS_AVAILABLE
#endif
- { uint8_t(CpuFeatures::ARM::kAES) , 30 }, // PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE
- { uint8_t(CpuFeatures::ARM::kCRC32) , 31 }, // PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE
- { uint8_t(CpuFeatures::ARM::kLSE) , 34 } // PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE
-
+ { uint8_t(Ext::kAES) , 30 }, // PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE
+ { uint8_t(Ext::kCRC32) , 31 }, // PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE
+ { uint8_t(Ext::kLSE) , 34 }, // PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE
+ { uint8_t(Ext::kDOTPROD) , 43 }, // PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE
+ { uint8_t(Ext::kJSCVT) , 44 }, // PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE
+ { uint8_t(Ext::kLRCPC) , 45 } // PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE
};
detectPFPFeatures(cpu, mapping, ASMJIT_ARRAY_SIZE(mapping));
+ // Windows can only report ARMv8A at the moment.
+ if (features.hasARMv8a()) {
+ populateARMv8AFeatures(cpu.features().arm(), 0);
+ }
+
// Windows provides several instructions under a single flag:
if (features.hasAES()) {
- features.add(CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2);
+ features.add(Ext::kPMULL, Ext::kSHA1, Ext::kSHA256);
}
- expandARMFeaturesByVersion(cpu);
+ postProcessARMCpuInfo(cpu);
}
-// CpuInfo - Detect - ARM [Linux]
-// ==============================
+// CpuInfo - Detect - ARM - Detect by Reading HWCAPS
+// =================================================
+
+#elif defined(ASMJIT_ARM_DETECT_VIA_HWCAPS)
+
+#ifndef AT_HWCAP
+ #define AT_HWCAP 16
+#endif // !AT_HWCAP
-#elif defined(__linux__)
+#ifndef AT_HWCAP2
+ #define AT_HWCAP2 26
+#endif // !AT_HWCAP2
+
+#if defined(__linux__)
+static void getAuxValues(unsigned long* vals, const unsigned long* tags, size_t count) noexcept {
+ for (size_t i = 0; i < count; i++) {
+ vals[i] = getauxval(tags[i]);
+ }
+}
+#elif defined(__FreeBSD__)
+static void getAuxValues(unsigned long* vals, const unsigned long* tags, size_t count) noexcept {
+ for (size_t i = 0; i < count; i++) {
+ unsigned long result = 0;
+ if (elf_aux_info(int(tags[i]), &result, int(sizeof(unsigned long))) != 0)
+ result = 0;
+ vals[i] = result;
+ }
+}
+#else
+#error "[asmjit] getAuxValues() - Unsupported OS."
+#endif
-struct LinuxHWCapMapping {
+struct HWCapMapping {
uint8_t featureId;
uint8_t hwCapBit;
};
-static ASMJIT_FAVOR_SIZE void detectHWCaps(CpuInfo& cpu, unsigned long type, const LinuxHWCapMapping* mapping, size_t size) noexcept {
- unsigned long mask = getauxval(type);
- for (size_t i = 0; i < size; i++)
+static const unsigned long hwCapTags[2] = { AT_HWCAP, AT_HWCAP2 };
+
+static ASMJIT_FAVOR_SIZE void mergeHWCaps(CpuInfo& cpu, unsigned long mask, const HWCapMapping* mapping, size_t size) noexcept {
+ for (size_t i = 0; i < size; i++) {
cpu.features().addIf(Support::bitTest(mask, mapping[i].hwCapBit), mapping[i].featureId);
+ }
}
#if ASMJIT_ARCH_ARM == 32
-// `AT_HWCAP` provides ARMv7 (and less) related flags.
-static const LinuxHWCapMapping hwCapMapping[] = {
- { uint8_t(CpuFeatures::ARM::kVFPv2) , 6 }, // HWCAP_VFP
- { uint8_t(CpuFeatures::ARM::kEDSP) , 7 }, // HWCAP_EDSP
- { uint8_t(CpuFeatures::ARM::kASIMD) , 12 }, // HWCAP_NEON
- { uint8_t(CpuFeatures::ARM::kVFPv3) , 13 }, // HWCAP_VFPv3
- { uint8_t(CpuFeatures::ARM::kVFPv4) , 16 }, // HWCAP_VFPv4
- { uint8_t(CpuFeatures::ARM::kIDIVA) , 17 }, // HWCAP_IDIVA
- { uint8_t(CpuFeatures::ARM::kIDIVT) , 18 }, // HWCAP_IDIVT
- { uint8_t(CpuFeatures::ARM::kVFP_D32) , 19 } // HWCAP_VFPD32
+// Reference:
+// - https://github.com/torvalds/linux/blob/master/arch/arm/include/uapi/asm/hwcap.h
+static const HWCapMapping hwCapMapping[] = {
+ { uint8_t(Ext::kEDSP) , 7 }, // HWCAP_EDSP
+ { uint8_t(Ext::kASIMD) , 12 }, // HWCAP_NEON
+ { uint8_t(Ext::kFP) , 13 }, // HWCAP_VFPv3
+ { uint8_t(Ext::kFMAC) , 16 }, // HWCAP_VFPv4
+ { uint8_t(Ext::kIDIVA) , 17 }, // HWCAP_IDIVA
+ { uint8_t(Ext::kIDIVT) , 18 }, // HWCAP_IDIVT
+ { uint8_t(Ext::kVFP_D32) , 19 }, // HWCAP_VFPD32
+ { uint8_t(Ext::kFP16CONV) , 22 }, // HWCAP_FPHP
+ { uint8_t(Ext::kFP16) , 23 }, // HWCAP_ASIMDHP
+ { uint8_t(Ext::kDOTPROD) , 24 }, // HWCAP_ASIMDDP
+ { uint8_t(Ext::kFHM) , 25 }, // HWCAP_ASIMDFHM
+ { uint8_t(Ext::kBF16) , 26 }, // HWCAP_ASIMDBF16
+ { uint8_t(Ext::kI8MM) , 27 } // HWCAP_I8MM
};
-// `AT_HWCAP2` provides ARMv8+ related flags.
-static const LinuxHWCapMapping hwCap2Mapping[] = {
- { uint8_t(CpuFeatures::ARM::kAES) , 0 }, // HWCAP2_AES
- { uint8_t(CpuFeatures::ARM::kPMULL) , 1 }, // HWCAP2_PMULL
- { uint8_t(CpuFeatures::ARM::kSHA1) , 2 }, // HWCAP2_SHA1
- { uint8_t(CpuFeatures::ARM::kSHA2) , 3 }, // HWCAP2_SHA2
- { uint8_t(CpuFeatures::ARM::kCRC32) , 4 } // HWCAP2_CRC32
+static const HWCapMapping hwCap2Mapping[] = {
+ { uint8_t(Ext::kAES) , 0 }, // HWCAP2_AES
+ { uint8_t(Ext::kPMULL) , 1 }, // HWCAP2_PMULL
+ { uint8_t(Ext::kSHA1) , 2 }, // HWCAP2_SHA1
+ { uint8_t(Ext::kSHA256) , 3 }, // HWCAP2_SHA2
+ { uint8_t(Ext::kCRC32) , 4 }, // HWCAP2_CRC32
+ { uint8_t(Ext::kSB) , 5 }, // HWCAP2_SB
+ { uint8_t(Ext::kSSBS) , 6 } // HWCAP2_SSBS
};
static ASMJIT_FAVOR_SIZE void detectARMCpu(CpuInfo& cpu) noexcept {
cpu._wasDetected = true;
-
populateBaseARMFeatures(cpu);
- CpuFeatures::ARM& features = cpu.features().arm();
-
- detectHWCaps(cpu, AT_HWCAP, hwCapMapping, ASMJIT_ARRAY_SIZE(hwCapMapping));
- detectHWCaps(cpu, AT_HWCAP2, hwCap2Mapping, ASMJIT_ARRAY_SIZE(hwCap2Mapping));
+ unsigned long hwCapMasks[2] {};
+ getAuxValues(hwCapMasks, hwCapTags, 2u);
- // VFPv3 implies VFPv2.
- if (features.hasVFPv3())
- features.add(CpuFeatures::ARM::kVFPv2);
+ mergeHWCaps(cpu, hwCapMasks[0], hwCapMapping, ASMJIT_ARRAY_SIZE(hwCapMapping));
+ mergeHWCaps(cpu, hwCapMasks[1], hwCap2Mapping, ASMJIT_ARRAY_SIZE(hwCap2Mapping));
- // VFPv2 implies ARMv6.
- if (features.hasVFPv2())
- features.add(CpuFeatures::ARM::kARMv6);
+ CpuFeatures::ARM& features = cpu.features().arm();
- // ARMv7 provides VFPv3|ASIMD.
- if (features.hasVFPv3() || features.hasASIMD())
+ // ARMv7 provides FP|ASIMD.
+ if (features.hasFP() || features.hasASIMD())
features.add(CpuFeatures::ARM::kARMv7);
- // ARMv8 provives AES, CRC32, PMULL, SHA1, and SHA2.
- if (features.hasAES() || features.hasCRC32() || features.hasPMULL() || features.hasSHA1() || features.hasSHA2())
+ // ARMv8 provives AES, CRC32, PMULL, SHA1, and SHA256.
+ if (features.hasAES() || features.hasCRC32() || features.hasPMULL() || features.hasSHA1() || features.hasSHA256())
features.add(CpuFeatures::ARM::kARMv8a);
+
+ postProcessARMCpuInfo(cpu);
}
#else
-// `AT_HWCAP` provides ARMv8+ related flags.
-static const LinuxHWCapMapping hwCapMapping[] = {
+// Reference:
+// - https://docs.kernel.org/arch/arm64/elf_hwcaps.html
+// - https://github.com/torvalds/linux/blob/master/arch/arm64/include/uapi/asm/hwcap.h
+static const HWCapMapping hwCapMapping[] = {
+ { uint8_t(Ext::kFP) , 0 }, // HWCAP_FP
+ { uint8_t(Ext::kASIMD) , 1 }, // HWCAP_ASIMD
/*
- { uint8_t(CpuFeatures::ARM::k) , 0 }, // HWCAP_FP
+ { uint8_t(Ext::k) , 2 }, // HWCAP_EVTSTRM
*/
- { uint8_t(CpuFeatures::ARM::kASIMD) , 1 }, // HWCAP_ASIMD
+ { uint8_t(Ext::kAES) , 3 }, // HWCAP_AES
+ { uint8_t(Ext::kPMULL) , 4 }, // HWCAP_PMULL
+ { uint8_t(Ext::kSHA1) , 5 }, // HWCAP_SHA1
+ { uint8_t(Ext::kSHA256) , 6 }, // HWCAP_SHA2
+ { uint8_t(Ext::kCRC32) , 7 }, // HWCAP_CRC32
+ { uint8_t(Ext::kLSE) , 8 }, // HWCAP_ATOMICS
+ { uint8_t(Ext::kFP16CONV) , 9 }, // HWCAP_FPHP
+ { uint8_t(Ext::kFP16) , 10 }, // HWCAP_ASIMDHP
+ { uint8_t(Ext::kCPUID) , 11 }, // HWCAP_CPUID
+ { uint8_t(Ext::kRDM) , 12 }, // HWCAP_ASIMDRDM
+ { uint8_t(Ext::kJSCVT) , 13 }, // HWCAP_JSCVT
+ { uint8_t(Ext::kFCMA) , 14 }, // HWCAP_FCMA
+ { uint8_t(Ext::kLRCPC) , 15 }, // HWCAP_LRCPC
+ { uint8_t(Ext::kDPB) , 16 }, // HWCAP_DCPOP
+ { uint8_t(Ext::kSHA3) , 17 }, // HWCAP_SHA3
+ { uint8_t(Ext::kSM3) , 18 }, // HWCAP_SM3
+ { uint8_t(Ext::kSM4) , 19 }, // HWCAP_SM4
+ { uint8_t(Ext::kDOTPROD) , 20 }, // HWCAP_ASIMDDP
+ { uint8_t(Ext::kSHA512) , 21 }, // HWCAP_SHA512
+ { uint8_t(Ext::kSVE) , 22 }, // HWCAP_SVE
+ { uint8_t(Ext::kFHM) , 23 }, // HWCAP_ASIMDFHM
+ { uint8_t(Ext::kDIT) , 24 }, // HWCAP_DIT
+ { uint8_t(Ext::kLSE2) , 25 }, // HWCAP_USCAT
+ { uint8_t(Ext::kLRCPC2) , 26 }, // HWCAP_ILRCPC
+ { uint8_t(Ext::kFLAGM) , 27 }, // HWCAP_FLAGM
+ { uint8_t(Ext::kSSBS) , 28 }, // HWCAP_SSBS
+ { uint8_t(Ext::kSB) , 29 } // HWCAP_SB
/*
- { uint8_t(CpuFeatures::ARM::k) , 2 }, // HWCAP_EVTSTRM
- */
- { uint8_t(CpuFeatures::ARM::kAES) , 3 }, // HWCAP_AES
- { uint8_t(CpuFeatures::ARM::kPMULL) , 4 }, // HWCAP_PMULL
- { uint8_t(CpuFeatures::ARM::kSHA1) , 5 }, // HWCAP_SHA1
- { uint8_t(CpuFeatures::ARM::kSHA2) , 6 }, // HWCAP_SHA2
- { uint8_t(CpuFeatures::ARM::kCRC32) , 7 }, // HWCAP_CRC32
- { uint8_t(CpuFeatures::ARM::kLSE) , 8 }, // HWCAP_ATOMICS
- { uint8_t(CpuFeatures::ARM::kFP16CONV) , 9 }, // HWCAP_FPHP
- { uint8_t(CpuFeatures::ARM::kFP16FULL) , 10 }, // HWCAP_ASIMDHP
- { uint8_t(CpuFeatures::ARM::kCPUID) , 11 }, // HWCAP_CPUID
- { uint8_t(CpuFeatures::ARM::kRDM) , 12 }, // HWCAP_ASIMDRDM
- { uint8_t(CpuFeatures::ARM::kFJCVTZS) , 13 }, // HWCAP_JSCVT
- { uint8_t(CpuFeatures::ARM::kFCMA) , 14 }, // HWCAP_FCMA
- /*
- { uint8_t(CpuFeatures::ARM::k) , 15 }, // HWCAP_LRCPC
- { uint8_t(CpuFeatures::ARM::k) , 16 }, // HWCAP_DCPOP
- */
- { uint8_t(CpuFeatures::ARM::kSHA3) , 17 }, // HWCAP_SHA3
- { uint8_t(CpuFeatures::ARM::kSM3) , 18 }, // HWCAP_SM3
- { uint8_t(CpuFeatures::ARM::kSM4) , 19 }, // HWCAP_SM4
- { uint8_t(CpuFeatures::ARM::kDOTPROD) , 20 }, // HWCAP_ASIMDDP
- { uint8_t(CpuFeatures::ARM::kSHA512) , 21 }, // HWCAP_SHA512
- { uint8_t(CpuFeatures::ARM::kSVE) , 22 }, // HWCAP_SVE
- { uint8_t(CpuFeatures::ARM::kFP16FML) , 23 }, // HWCAP_ASIMDFHM
- { uint8_t(CpuFeatures::ARM::kDIT) , 24 }, // HWCAP_DIT
- /*
- { uint8_t(CpuFeatures::ARM::k) , 25 }, // HWCAP_USCAT
- { uint8_t(CpuFeatures::ARM::k) , 26 }, // HWCAP_ILRCPC
- */
- { uint8_t(CpuFeatures::ARM::kFLAGM) , 27 }, // HWCAP_FLAGM
- { uint8_t(CpuFeatures::ARM::kSSBS) , 28 }, // HWCAP_SSBS
- { uint8_t(CpuFeatures::ARM::kSB) , 29 } // HWCAP_SB
- /*
- { uint8_t(CpuFeatures::ARM::k) , 30 }, // HWCAP_PACA
- { uint8_t(CpuFeatures::ARM::k) , 31 } // HWCAP_PACG
+ { uint8_t(Ext::k) , 30 }, // HWCAP_PACA
+ { uint8_t(Ext::k) , 31 } // HWCAP_PACG
*/
};
-// `AT_HWCAP2` provides ARMv8+ related flags.
-static const LinuxHWCapMapping hwCapMapping2[] = {
- /*
- { uint8_t(CpuFeatures::ARM::k) , 0 }, // HWCAP2_DCPODP
- */
- { uint8_t(CpuFeatures::ARM::kSVE2) , 1 }, // HWCAP2_SVE2
- { uint8_t(CpuFeatures::ARM::kSVE2_AES) , 2 }, // HWCAP2_SVEAES
- { uint8_t(CpuFeatures::ARM::kSVE_PMULL) , 3 }, // HWCAP2_SVEPMULL
- { uint8_t(CpuFeatures::ARM::kSVE2_BITPERM), 4 }, // HWCAP2_SVEBITPERM
- { uint8_t(CpuFeatures::ARM::kSVE2_SHA3) , 5 }, // HWCAP2_SVESHA3
- { uint8_t(CpuFeatures::ARM::kSVE2_SM4) , 6 }, // HWCAP2_SVESM4
- { uint8_t(CpuFeatures::ARM::kALTNZCV) , 7 }, // HWCAP2_FLAGM2
- { uint8_t(CpuFeatures::ARM::kFRINT) , 8 }, // HWCAP2_FRINT
- { uint8_t(CpuFeatures::ARM::kSVE_I8MM) , 9 }, // HWCAP2_SVEI8MM
- { uint8_t(CpuFeatures::ARM::kSVE_F32MM) , 10 }, // HWCAP2_SVEF32MM
- { uint8_t(CpuFeatures::ARM::kSVE_F64MM) , 11 }, // HWCAP2_SVEF64MM
- { uint8_t(CpuFeatures::ARM::kSVE_BF16) , 12 }, // HWCAP2_SVEBF16
- { uint8_t(CpuFeatures::ARM::kI8MM) , 13 }, // HWCAP2_I8MM
- { uint8_t(CpuFeatures::ARM::kBF16) , 14 }, // HWCAP2_BF16
- { uint8_t(CpuFeatures::ARM::kDGH) , 15 }, // HWCAP2_DGH
- { uint8_t(CpuFeatures::ARM::kRNG) , 16 }, // HWCAP2_RNG
- { uint8_t(CpuFeatures::ARM::kBTI) , 17 }, // HWCAP2_BTI
- { uint8_t(CpuFeatures::ARM::kMTE) , 18 } // HWCAP2_MTE
+static const HWCapMapping hwCap2Mapping[] = {
+ { uint8_t(Ext::kDPB2) , 0 }, // HWCAP2_DCPODP
+ { uint8_t(Ext::kSVE2) , 1 }, // HWCAP2_SVE2
+ { uint8_t(Ext::kSVE_AES) , 2 }, // HWCAP2_SVEAES
+ { uint8_t(Ext::kSVE_PMULL128) , 3 }, // HWCAP2_SVEPMULL
+ { uint8_t(Ext::kSVE_BITPERM) , 4 }, // HWCAP2_SVEBITPERM
+ { uint8_t(Ext::kSVE_SHA3) , 5 }, // HWCAP2_SVESHA3
+ { uint8_t(Ext::kSVE_SM4) , 6 }, // HWCAP2_SVESM4
+ { uint8_t(Ext::kFLAGM2) , 7 }, // HWCAP2_FLAGM2
+ { uint8_t(Ext::kFRINTTS) , 8 }, // HWCAP2_FRINT
+ { uint8_t(Ext::kSVE_I8MM) , 9 }, // HWCAP2_SVEI8MM
+ { uint8_t(Ext::kSVE_F32MM) , 10 }, // HWCAP2_SVEF32MM
+ { uint8_t(Ext::kSVE_F64MM) , 11 }, // HWCAP2_SVEF64MM
+ { uint8_t(Ext::kSVE_BF16) , 12 }, // HWCAP2_SVEBF16
+ { uint8_t(Ext::kI8MM) , 13 }, // HWCAP2_I8MM
+ { uint8_t(Ext::kBF16) , 14 }, // HWCAP2_BF16
+ { uint8_t(Ext::kDGH) , 15 }, // HWCAP2_DGH
+ { uint8_t(Ext::kRNG) , 16 }, // HWCAP2_RNG
+ { uint8_t(Ext::kBTI) , 17 }, // HWCAP2_BTI
+ { uint8_t(Ext::kMTE) , 18 }, // HWCAP2_MTE
+ { uint8_t(Ext::kECV) , 19 }, // HWCAP2_ECV
+ { uint8_t(Ext::kAFP) , 20 }, // HWCAP2_AFP
+ { uint8_t(Ext::kRPRES) , 21 }, // HWCAP2_RPRES
+ { uint8_t(Ext::kMTE3) , 22 }, // HWCAP2_MTE3
+ { uint8_t(Ext::kSME) , 23 }, // HWCAP2_SME
+ { uint8_t(Ext::kSME_I16I64) , 24 }, // HWCAP2_SME_I16I64
+ { uint8_t(Ext::kSME_F64F64) , 25 }, // HWCAP2_SME_F64F64
+ { uint8_t(Ext::kSME_I8I32) , 26 }, // HWCAP2_SME_I8I32
+ { uint8_t(Ext::kSME_F16F32) , 27 }, // HWCAP2_SME_F16F32
+ { uint8_t(Ext::kSME_B16F32) , 28 }, // HWCAP2_SME_B16F32
+ { uint8_t(Ext::kSME_F32F32) , 29 }, // HWCAP2_SME_F32F32
+ { uint8_t(Ext::kSME_FA64) , 30 }, // HWCAP2_SME_FA64
+ { uint8_t(Ext::kWFXT) , 31 }, // HWCAP2_WFXT
+ { uint8_t(Ext::kEBF16) , 32 }, // HWCAP2_EBF16
+ { uint8_t(Ext::kSVE_EBF16) , 33 }, // HWCAP2_SVE_EBF16
+ { uint8_t(Ext::kCSSC) , 34 }, // HWCAP2_CSSC
+ { uint8_t(Ext::kRPRFM) , 35 }, // HWCAP2_RPRFM
+ { uint8_t(Ext::kSVE2_1) , 36 }, // HWCAP2_SVE2P1
+ { uint8_t(Ext::kSME2) , 37 }, // HWCAP2_SME2
+ { uint8_t(Ext::kSME2_1) , 38 }, // HWCAP2_SME2P1
+ { uint8_t(Ext::kSME_I16I32) , 39 }, // HWCAP2_SME_I16I32
+ { uint8_t(Ext::kSME_BI32I32) , 40 }, // HWCAP2_SME_BI32I32
+ { uint8_t(Ext::kSME_B16B16) , 41 }, // HWCAP2_SME_B16B16
+ { uint8_t(Ext::kSME_F16F16) , 42 }, // HWCAP2_SME_F16F16
+ { uint8_t(Ext::kMOPS) , 43 }, // HWCAP2_MOPS
+ { uint8_t(Ext::kHBC) , 44 }, // HWCAP2_HBC
+ { uint8_t(Ext::kSVE_B16B16) , 45 }, // HWCAP2_SVE_B16B16
+ { uint8_t(Ext::kLRCPC3) , 46 }, // HWCAP2_LRCPC3
+ { uint8_t(Ext::kLSE128) , 47 }, // HWCAP2_LSE128
};
static ASMJIT_FAVOR_SIZE void detectARMCpu(CpuInfo& cpu) noexcept {
cpu._wasDetected = true;
populateBaseARMFeatures(cpu);
- detectHWCaps(cpu, AT_HWCAP, hwCapMapping, ASMJIT_ARRAY_SIZE(hwCapMapping));
- detectHWCaps(cpu, AT_HWCAP2, hwCapMapping2, ASMJIT_ARRAY_SIZE(hwCapMapping2));
-}
+ unsigned long hwCapMasks[2] {};
+ getAuxValues(hwCapMasks, hwCapTags, 2u);
-#endif
+ mergeHWCaps(cpu, hwCapMasks[0], hwCapMapping, ASMJIT_ARRAY_SIZE(hwCapMapping));
+ mergeHWCaps(cpu, hwCapMasks[1], hwCap2Mapping, ASMJIT_ARRAY_SIZE(hwCap2Mapping));
-// CpuInfo - Detect - ARM [Apple]
-// ==============================
+#if defined(ASMJIT_ARM_DETECT_VIA_CPUID)
+ if (cpu.features().arm().hasCPUID()) {
+ detectAArch64FeaturesViaCPUID(cpu);
+ return;
+ }
+#endif // ASMJIT_ARM_DETECT_VIA_CPUID
-#elif defined(__APPLE__)
+ postProcessARMCpuInfo(cpu);
+}
-namespace AppleHWId {
- enum CpuFamily : uint32_t {
- // Generic ARM.
- kCpuFamily_ARM_9 = 0xE73283AEu,
- kCpuFamily_ARM_11 = 0x8FF620D8u,
- kCpuFamily_ARM_12 = 0xBD1B0AE9u,
- kCpuFamily_ARM_13 = 0x0CC90E64u,
- kCpuFamily_ARM_14 = 0x96077EF1u,
- kCpuFamily_ARM_15 = 0xA8511BCAu,
-
- // Apple design.
- kCpuFamily_SWIFT = 0x1E2D6381u,
- kCpuFamily_CYCLONE = 0x37A09642u,
- kCpuFamily_TYPHOON = 0x2C91A47Eu,
- kCpuFamily_TWISTER = 0x92FB37C8u,
- kCpuFamily_HURRICANE = 0x67CEEE93u,
- kCpuFamily_MONSOON_MISTRAL = 0xE81E7EF6u,
- kCpuFamily_VORTEX_TEMPEST = 0x07D34B9Fu,
- kCpuFamily_LIGHTNING_THUNDER = 0x462504D2u,
- kCpuFamily_FIRESTORM_ICESTORM = 0x1B588BB3u
- };
+#endif // ASMJIT_ARCH_ARM
+
+// CpuInfo - Detect - ARM - Detect by OpenBSD API That Reads CPUID
+// ===============================================================
+
+#elif defined(__OpenBSD__) && ASMJIT_ARCH_ARM >= 64
+
+// Supported CPUID registers on OpenBSD (CTL_MACHDEP definitions):
+// - https://github.com/openbsd/src/blob/master/sys/arch/arm64/include/cpu.h
+enum class OpenBSDAArch64CPUID {
+ kAA64ISAR0 = 2,
+ kAA64ISAR1 = 3,
+ kAA64ISAR2 = 4,
+ kAA64MMFR0 = 5,
+ kAA64MMFR1 = 6,
+ kAA64MMFR2 = 7,
+ kAA64PFR0 = 8,
+ kAA64PFR1 = 9,
+ kAA64SMFR0 = 10,
+ kAA64ZFR0 = 11
};
-static ASMJIT_FAVOR_SIZE uint32_t queryARMCpuFamilyId() noexcept {
- uint32_t result = 0;
- size_t size = sizeof(result);
+static uint64_t openbsdReadAArch64CPUID(OpenBSDAArch64CPUID id) noexcept {
+ uint64_t bits = 0;
+ size_t size = sizeof(bits);
+ int name[2] = { CTL_MACHDEP, int(id) };
- int res = sysctlbyname("hw.cpufamily", &result, &size, nullptr, 0);
- if (res != 0)
- return 0;
- else
- return result;
+ return (sysctl(name, 2, &bits, &size, NULL, 0) < 0) ? uint64_t(0) : bits;
}
static ASMJIT_FAVOR_SIZE void detectARMCpu(CpuInfo& cpu) noexcept {
- cpu._wasDetected = true;
+ typedef OpenBSDAArch64CPUID ID;
+
populateBaseARMFeatures(cpu);
- uint32_t cpuFamilyId = queryARMCpuFamilyId();
- CpuFeatures::ARM& features = cpu.features().arm();
+ detectAArch64FeaturesViaCPUID_AA64PFR0_AA64PFR1(cpu,
+ openbsdReadAArch64CPUID(ID::kAA64PFR0),
+ openbsdReadAArch64CPUID(ID::kAA64PFR1));
- switch (cpuFamilyId) {
- case AppleHWId::kCpuFamily_ARM_9:
- case AppleHWId::kCpuFamily_ARM_11:
- case AppleHWId::kCpuFamily_ARM_12:
- break;
+ detectAArch64FeaturesViaCPUID_AA64ISAR0_AA64ISAR1(cpu,
+ openbsdReadAArch64CPUID(ID::kAA64ISAR0),
+ openbsdReadAArch64CPUID(ID::kAA64ISAR1));
- // ARM Cortex A8.
- case AppleHWId::kCpuFamily_ARM_13:
- break;
+ detectAArch64FeaturesViaCPUID_AA64ISAR2(cpu, openbsdReadAArch64CPUID(ID::kAA64ISAR2));
+ detectAArch64FeaturesViaCPUID_AA64MMFR0(cpu, openbsdReadAArch64CPUID(ID::kAA64MMFR0));
+ detectAArch64FeaturesViaCPUID_AA64MMFR1(cpu, openbsdReadAArch64CPUID(ID::kAA64MMFR1));
+ detectAArch64FeaturesViaCPUID_AA64MMFR2(cpu, openbsdReadAArch64CPUID(ID::kAA64MMFR2));
- // ARM Cortex A9.
- case AppleHWId::kCpuFamily_ARM_14:
- break;
+ // Only read CPU_ID_AA64ZFR0 when either SVE or SME is available.
+ if (cpu.features().arm().hasAny(Ext::kSVE, Ext::kSME)) {
+ detectAArch64FeaturesViaCPUID_AA64ZFR0(cpu, openbsdReadAArch64CPUID(ID::kAA64ZFR0));
- // ARM Cortex A7 - ARMv7k.
- case AppleHWId::kCpuFamily_ARM_15:
- features.add(CpuFeatures::ARM::kARMv7);
- break;
+ if (cpu.features().arm().hasSME())
+ detectAArch64FeaturesViaCPUID_AA64SMFR0(cpu, openbsdReadAArch64CPUID(ID::kAA64SMFR0));
+ }
- // Apple A6/A6X - ARMv7s.
- case AppleHWId::kCpuFamily_SWIFT:
- features.add(CpuFeatures::ARM::kARMv7);
- break;
+ postProcessARMCpuInfo(cpu);
+}
- // Apple A7 - ARMv8.0-A.
- case AppleHWId::kCpuFamily_CYCLONE:
- features.add(CpuFeatures::ARM::kARMv8a,
- CpuFeatures::ARM::kAES,
- CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2);
- break;
+// CpuInfo - Detect - ARM - Detect by Apple API (sysctlbyname)
+// ===========================================================
- // Apple A8 - ARMv8.0-A.
- case AppleHWId::kCpuFamily_TYPHOON:
- features.add(CpuFeatures::ARM::kARMv8a,
- CpuFeatures::ARM::kAES,
- CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2);
- break;
+#elif defined(__APPLE__)
- // Apple A9 - ARMv8.0-A.
- case AppleHWId::kCpuFamily_TWISTER:
- features.add(CpuFeatures::ARM::kARMv8a,
- CpuFeatures::ARM::kAES,
- CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2);
- break;
+enum class AppleFeatureType : uint8_t {
+ kHWOptional,
+ kHWOptionalArmFEAT
+};
- // Apple A10 - ARMv8.1-A.
- case AppleHWId::kCpuFamily_HURRICANE:
- features.add(CpuFeatures::ARM::kARMv8_1a,
- CpuFeatures::ARM::kAES,
- CpuFeatures::ARM::kRDM,
- CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2);
+struct AppleFeatureMapping {
+ AppleFeatureType type;
+ char name[18];
+ uint8_t featureId;
+};
- break;
+template<typename T>
+static inline bool appleSysctlByName(const char* sysctlName, T* dst, size_t size = sizeof(T)) noexcept {
+ return sysctlbyname(sysctlName, dst, &size, nullptr, 0) == 0;
+}
- // Apple A11 - ARMv8.2-A.
- case AppleHWId::kCpuFamily_MONSOON_MISTRAL:
- features.add(CpuFeatures::ARM::kARMv8_2a,
- CpuFeatures::ARM::kAES,
- CpuFeatures::ARM::kFP16FULL,
- CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2);
- break;
+static ASMJIT_FAVOR_SIZE long appleDetectARMFeatureViaSysctl(AppleFeatureType type, const char* featureName) noexcept {
+ static const char hwOptionalPrefix[] = "hw.optional.";
+ static const char hwOptionalArmFeatPrefix[] = "hw.optional.arm.FEAT_";
- // Apple A12 - ARMv8.3-A.
- case AppleHWId::kCpuFamily_VORTEX_TEMPEST:
- features.add(CpuFeatures::ARM::kARMv8_3a,
- CpuFeatures::ARM::kAES,
- CpuFeatures::ARM::kFP16FULL,
- CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2);
- break;
+ char sysctlName[128];
- // Apple A13 - ARMv8.4-A.
- case AppleHWId::kCpuFamily_LIGHTNING_THUNDER:
- features.add(CpuFeatures::ARM::kARMv8_4a,
- CpuFeatures::ARM::kAES,
- CpuFeatures::ARM::kFP16FML,
- CpuFeatures::ARM::kFP16FULL,
- CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2,
- CpuFeatures::ARM::kSHA3,
- CpuFeatures::ARM::kSHA512);
- break;
+ const char* prefix = type == AppleFeatureType::kHWOptional ? hwOptionalPrefix : hwOptionalArmFeatPrefix;
+ size_t prefixSize = (type == AppleFeatureType::kHWOptional ? sizeof(hwOptionalPrefix) : sizeof(hwOptionalArmFeatPrefix)) - 1u;
+ size_t featureNameSize = strlen(featureName);
- // Apple A14/M1 - ARMv8.5-A.
- case AppleHWId::kCpuFamily_FIRESTORM_ICESTORM:
- features.add(CpuFeatures::ARM::kARMv8_4a,
- CpuFeatures::ARM::kAES,
- CpuFeatures::ARM::kALTNZCV,
- CpuFeatures::ARM::kFP16FML,
- CpuFeatures::ARM::kFP16FULL,
- CpuFeatures::ARM::kFRINT,
- CpuFeatures::ARM::kSB,
- CpuFeatures::ARM::kSHA1,
- CpuFeatures::ARM::kSHA2,
- CpuFeatures::ARM::kSHA3,
- CpuFeatures::ARM::kSHA512,
- CpuFeatures::ARM::kSSBS);
- break;
+ if (featureNameSize < 128 - prefixSize) {
+ memcpy(sysctlName, prefix, prefixSize);
+ memcpy(sysctlName + prefixSize, featureName, featureNameSize + 1u); // Include NULL terminator.
- default:
- cpu._wasDetected = false;
- break;
+ long val = 0;
+ if (appleSysctlByName<long>(sysctlName, &val))
+ return val;
}
- expandARMFeaturesByVersion(cpu);
+ return 0;
}
-// CpuInfo - Detect - ARM [Unknown]
-// ================================
+static ASMJIT_FAVOR_SIZE void appleDetectARMFeaturesViaSysctl(CpuInfo& cpu) noexcept {
+ typedef AppleFeatureType FT;
+
+ // Based on:
+ // - https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics
+ static const AppleFeatureMapping mappings[] = {
+ // Determine Advanced SIMD and Floating Point Capabilities:
+ { FT::kHWOptional , "AdvSIMD_HPFPCvt", uint8_t(Ext::kFP16CONV) },
+ { FT::kHWOptional , "neon_hpfp" , uint8_t(Ext::kFP16CONV) },
+ { FT::kHWOptionalArmFEAT, "BF16" , uint8_t(Ext::kBF16) },
+ { FT::kHWOptionalArmFEAT, "DotProd" , uint8_t(Ext::kDOTPROD) },
+ { FT::kHWOptionalArmFEAT, "FCMA" , uint8_t(Ext::kFCMA) },
+ { FT::kHWOptional , "armv8_3_compnum", uint8_t(Ext::kFCMA) },
+ { FT::kHWOptionalArmFEAT, "FHM" , uint8_t(Ext::kFHM) },
+ { FT::kHWOptional , "armv8_2_fhm" , uint8_t(Ext::kFHM) },
+ { FT::kHWOptionalArmFEAT, "FP16" , uint8_t(Ext::kFP16) },
+ { FT::kHWOptional , "neon_fp16" , uint8_t(Ext::kFP16) },
+ { FT::kHWOptionalArmFEAT, "FRINTTS" , uint8_t(Ext::kFRINTTS) },
+ { FT::kHWOptionalArmFEAT, "I8MM" , uint8_t(Ext::kI8MM) },
+ { FT::kHWOptionalArmFEAT, "JSCVT" , uint8_t(Ext::kJSCVT) },
+ { FT::kHWOptionalArmFEAT, "RDM" , uint8_t(Ext::kRDM) },
+
+ // Determine Integer Capabilities:
+ { FT::kHWOptional , "armv8_crc32" , uint8_t(Ext::kCRC32) },
+ { FT::kHWOptionalArmFEAT, "FlagM" , uint8_t(Ext::kFLAGM) },
+ { FT::kHWOptionalArmFEAT, "FlagM2" , uint8_t(Ext::kFLAGM2) },
+
+ // Determine Atomic and Memory Ordering Instruction Capabilities:
+ { FT::kHWOptionalArmFEAT, "LRCPC" , uint8_t(Ext::kLRCPC) },
+ { FT::kHWOptionalArmFEAT, "LRCPC2" , uint8_t(Ext::kLRCPC2) },
+ { FT::kHWOptional , "armv8_1_atomics", uint8_t(Ext::kLSE) },
+ { FT::kHWOptionalArmFEAT, "LSE" , uint8_t(Ext::kLSE) },
+ { FT::kHWOptionalArmFEAT, "LSE2" , uint8_t(Ext::kLSE2) },
+
+ // Determine Encryption Capabilities:
+ { FT::kHWOptionalArmFEAT, "AES" , uint8_t(Ext::kAES) },
+ { FT::kHWOptionalArmFEAT, "PMULL" , uint8_t(Ext::kPMULL) },
+ { FT::kHWOptionalArmFEAT, "SHA1" , uint8_t(Ext::kSHA1) },
+ { FT::kHWOptionalArmFEAT, "SHA256" , uint8_t(Ext::kSHA256) },
+ { FT::kHWOptionalArmFEAT, "SHA512" , uint8_t(Ext::kSHA512) },
+ { FT::kHWOptional , "armv8_2_sha512" , uint8_t(Ext::kSHA512) },
+ { FT::kHWOptionalArmFEAT, "SHA3" , uint8_t(Ext::kSHA3) },
+ { FT::kHWOptional , "armv8_2_sha3" , uint8_t(Ext::kSHA3) },
+
+ // Determine General Capabilities:
+ { FT::kHWOptionalArmFEAT, "BTI" , uint8_t(Ext::kBTI) },
+ { FT::kHWOptionalArmFEAT, "DPB" , uint8_t(Ext::kDPB) },
+ { FT::kHWOptionalArmFEAT, "DPB2" , uint8_t(Ext::kDPB2) },
+ { FT::kHWOptionalArmFEAT, "ECV" , uint8_t(Ext::kECV) },
+ { FT::kHWOptionalArmFEAT, "SB" , uint8_t(Ext::kSB) },
+ { FT::kHWOptionalArmFEAT, "SSBS" , uint8_t(Ext::kSSBS) }
+ };
+
+ for (size_t i = 0; i < ASMJIT_ARRAY_SIZE(mappings); i++) {
+ const AppleFeatureMapping& mapping = mappings[i];
+ if (!cpu.features().arm().has(mapping.featureId) && appleDetectARMFeatureViaSysctl(mapping.type, mapping.name)) {
+ cpu.features().arm().add(mapping.featureId);
+ }
+ }
+}
+
+static ASMJIT_FAVOR_SIZE void detectARMCpu(CpuInfo& cpu) noexcept {
+ cpu._wasDetected = true;
+ populateBaseARMFeatures(cpu);
+
+ appleSysctlByName<uint32_t>("hw.cpufamily", &cpu._familyId);
+ appleSysctlByName<uint32_t>("hw.cachelinesize", &cpu._cacheLineSize);
+ appleSysctlByName<uint32_t>("machdep.cpu.logical_per_package", &cpu._maxLogicalProcessors);
+ appleSysctlByName<char>("machdep.cpu.brand_string", cpu._brand.str, sizeof(cpu._brand.str));
+
+ memcpy(cpu._vendor.str, "APPLE", 6);
+
+ bool cpuFeaturesPopulated = detectARMFeaturesViaAppleFamilyId(cpu);
+ if (!cpuFeaturesPopulated)
+ appleDetectARMFeaturesViaSysctl(cpu);
+ postProcessARMCpuInfo(cpu);
+}
+
+// CpuInfo - Detect - ARM - Detect by Fallback (Using Compiler Flags)
+// ==================================================================
#else
-#if ASMJIT_ARCH_ARM == 64
- #pragma message("[asmjit] Disabling runtime CPU detection - unsupported OS/CPU combination (Unknown OS with AArch64 CPU)")
+#if ASMJIT_ARCH_ARM == 32
+ #pragma message("[asmjit] Disabling runtime CPU detection - unsupported OS/CPU combination (Unknown OS with AArch32 CPU)")
#else
- #pragma message("[asmjit] Disabling runtime CPU detection - unsupported OS/CPU combination (Unknown OS with ARM CPU)")
+ #pragma message("[asmjit] Disabling runtime CPU detection - unsupported OS/CPU combination (Unknown OS with AArch64 CPU)")
#endif
static ASMJIT_FAVOR_SIZE void detectARMCpu(CpuInfo& cpu) noexcept {
populateBaseARMFeatures(cpu);
detectARMFeaturesViaCompilerFlags(cpu);
- expandARMFeaturesByVersion(cpu);
+ postProcessARMCpuInfo(cpu);
}
#endif
+} // {arm}
+
#endif
// CpuInfo - Detect - Host
// =======================
-static uint32_t cpuInfoInitialized;
-static CpuInfo cpuInfoGlobal(Globals::NoInit);
-
const CpuInfo& CpuInfo::host() noexcept {
- // This should never cause a problem as the resulting information should always be the same. In the worst case we
- // would just overwrite it non-atomically.
- if (!cpuInfoInitialized) {
+ static std::atomic<uint32_t> cpuInfoInitialized;
+ static CpuInfo cpuInfoGlobal(Globals::NoInit);
+
+ // This should never cause a problem as the resulting information should always
+ // be the same. In the worst case it would just be overwritten non-atomically.
+ if (!cpuInfoInitialized.load(std::memory_order_relaxed)) {
CpuInfo cpuInfoLocal;
cpuInfoLocal._arch = Arch::kHost;
cpuInfoLocal._subArch = SubArch::kHost;
#if ASMJIT_ARCH_X86
- detectX86Cpu(cpuInfoLocal);
+ x86::detectX86Cpu(cpuInfoLocal);
#elif ASMJIT_ARCH_ARM
- detectARMCpu(cpuInfoLocal);
-#else
- #pragma message("[asmjit] Disabling runtime CPU detection - unsupported OS/CPU combination (Unknown CPU)")
+ arm::detectARMCpu(cpuInfoLocal);
#endif
cpuInfoLocal._hwThreadCount = detectHWThreadCount();
cpuInfoGlobal = cpuInfoLocal;
- cpuInfoInitialized = 1;
+ cpuInfoInitialized.store(1, std::memory_order_seq_cst);
}
return cpuInfoGlobal;
}
+#if defined(_MSC_VER)
+ #pragma warning(pop)
+#endif // _MSC_VER
+
ASMJIT_END_NAMESPACE
diff --git a/3rdparty/asmjit/src/asmjit/core/cpuinfo.h b/3rdparty/asmjit/src/asmjit/core/cpuinfo.h
index 4af5c3a82f9..2638146a4cc 100644
--- a/3rdparty/asmjit/src/asmjit/core/cpuinfo.h
+++ b/3rdparty/asmjit/src/asmjit/core/cpuinfo.h
@@ -22,11 +22,6 @@ ASMJIT_BEGIN_NAMESPACE
//! Each feature is represented by a single bit in an embedded bit array.
class CpuFeatures {
public:
- //! A word that is used to represents feature bits.
- typedef Support::BitWord BitWord;
- //! Iterator that can iterate all CPU features set.
- typedef Support::BitVectorIterator<BitWord> Iterator;
-
//! \name Constants
//! \{
@@ -37,6 +32,13 @@ public:
};
//! \endcond
+ //! A word that is used to represents feature bits.
+ typedef Support::BitWord BitWord;
+ //! Iterator that can iterate all CPU features set.
+ typedef Support::BitVectorIterator<BitWord> Iterator;
+
+ typedef Support::Array<BitWord, kNumBitWords> Bits;
+
//! \}
//! \name Data
@@ -48,15 +50,15 @@ public:
//! \{
//! Data bits.
- Support::Array<BitWord, kNumBitWords> _bits;
+ Bits _bits;
//! \}
//! \name Overloaded Operators
//! \{
- inline bool operator==(const Data& other) noexcept { return eq(other); }
- inline bool operator!=(const Data& other) noexcept { return !eq(other); }
+ ASMJIT_INLINE_NODEBUG bool operator==(const Data& other) const noexcept { return equals(other); }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const Data& other) const noexcept { return !equals(other); }
//! \}
@@ -64,22 +66,22 @@ public:
//! \{
//! Returns true if there are no features set.
- inline bool empty() const noexcept { return _bits.aggregate<Support::Or>(0) == 0; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _bits.aggregate<Support::Or>(0) == 0; }
//! Returns all features as array of bitwords (see \ref Support::BitWord).
- inline BitWord* bits() noexcept { return _bits.data(); }
+ ASMJIT_INLINE_NODEBUG BitWord* bits() noexcept { return _bits.data(); }
//! Returns all features as array of bitwords (const).
- inline const BitWord* bits() const noexcept { return _bits.data(); }
+ ASMJIT_INLINE_NODEBUG const BitWord* bits() const noexcept { return _bits.data(); }
//! Returns the number of BitWords returned by \ref bits().
- inline size_t bitWordCount() const noexcept { return kNumBitWords; }
+ ASMJIT_INLINE_NODEBUG size_t bitWordCount() const noexcept { return kNumBitWords; }
//! Returns \ref Support::BitVectorIterator, that can be used to iterate over all features efficiently.
- inline Iterator iterator() const noexcept { return Iterator(_bits.data(), kNumBitWords); }
+ ASMJIT_INLINE_NODEBUG Iterator iterator() const noexcept { return Iterator(_bits.data(), kNumBitWords); }
//! Tests whether the feature `featureId` is present.
template<typename FeatureId>
- ASMJIT_FORCE_INLINE bool has(const FeatureId& featureId) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool has(const FeatureId& featureId) const noexcept {
ASMJIT_ASSERT(uint32_t(featureId) < kMaxFeatures);
uint32_t idx = uint32_t(featureId) / Support::kBitWordSizeInBits;
@@ -88,12 +90,27 @@ public:
return bool((_bits[idx] >> bit) & 0x1);
}
+ //! \cond NONE
+ template<typename FeatureId>
+ ASMJIT_INLINE_NODEBUG bool hasAny(const FeatureId& featureId) const noexcept {
+ return has(featureId);
+ }
+ //! \endcond
+
+ //! Tests whether any feature given is present.
+ //!
+ //! \note This is a variadic function template that can be used with multiple features.
+ template<typename FeatureId, typename... Args>
+ ASMJIT_INLINE_NODEBUG bool hasAny(const FeatureId& featureId, Args&&... otherFeatureIds) const noexcept {
+ return bool(unsigned(has(featureId)) | unsigned(hasAny(std::forward<Args>(otherFeatureIds)...)));
+ }
+
//! Tests whether all features as defined by `other` are present.
- ASMJIT_FORCE_INLINE bool hasAll(const Data& other) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool hasAll(const Data& other) const noexcept {
+ uint32_t result = 1;
for (uint32_t i = 0; i < kNumBitWords; i++)
- if ((_bits[i] & other._bits[i]) != other._bits[i])
- return false;
- return true;
+ result &= uint32_t((_bits[i] & other._bits[i]) == other._bits[i]);
+ return bool(result);
}
//! \}
@@ -101,11 +118,12 @@ public:
//! \name Manipulation
//! \{
- inline void reset() noexcept { _bits.fill(0); }
+ //! Clears all features set.
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _bits.fill(0); }
//! Adds the given CPU `featureId` to the list of features.
template<typename FeatureId>
- ASMJIT_FORCE_INLINE void add(const FeatureId& featureId) noexcept {
+ ASMJIT_INLINE_NODEBUG void add(const FeatureId& featureId) noexcept {
ASMJIT_ASSERT(uint32_t(featureId) < kMaxFeatures);
uint32_t idx = uint32_t(featureId) / Support::kBitWordSizeInBits;
@@ -115,13 +133,13 @@ public:
}
template<typename FeatureId, typename... Args>
- ASMJIT_FORCE_INLINE void add(const FeatureId& featureId, Args&&... otherFeatureIds) noexcept {
+ ASMJIT_INLINE_NODEBUG void add(const FeatureId& featureId, Args&&... otherFeatureIds) noexcept {
add(featureId);
add(std::forward<Args>(otherFeatureIds)...);
}
template<typename FeatureId>
- ASMJIT_FORCE_INLINE void addIf(bool condition, const FeatureId& featureId) noexcept {
+ ASMJIT_INLINE_NODEBUG void addIf(bool condition, const FeatureId& featureId) noexcept {
ASMJIT_ASSERT(uint32_t(featureId) < kMaxFeatures);
uint32_t idx = uint32_t(featureId) / Support::kBitWordSizeInBits;
@@ -131,14 +149,14 @@ public:
}
template<typename FeatureId, typename... Args>
- ASMJIT_FORCE_INLINE void addIf(bool condition, const FeatureId& featureId, Args&&... otherFeatureIds) noexcept {
+ ASMJIT_INLINE_NODEBUG void addIf(bool condition, const FeatureId& featureId, Args&&... otherFeatureIds) noexcept {
addIf(condition, featureId);
addIf(condition, std::forward<Args>(otherFeatureIds)...);
}
//! Removes the given CPU `featureId` from the list of features.
template<typename FeatureId>
- ASMJIT_FORCE_INLINE void remove(const FeatureId& featureId) noexcept {
+ ASMJIT_INLINE_NODEBUG void remove(const FeatureId& featureId) noexcept {
ASMJIT_ASSERT(uint32_t(featureId) < kMaxFeatures);
uint32_t idx = uint32_t(featureId) / Support::kBitWordSizeInBits;
@@ -148,17 +166,21 @@ public:
}
template<typename FeatureId, typename... Args>
- ASMJIT_FORCE_INLINE void remove(const FeatureId& featureId, Args&&... otherFeatureIds) noexcept {
+ ASMJIT_INLINE_NODEBUG void remove(const FeatureId& featureId, Args&&... otherFeatureIds) noexcept {
remove(featureId);
remove(std::forward<Args>(otherFeatureIds)...);
}
//! Tests whether this CPU features data matches `other`.
- ASMJIT_FORCE_INLINE bool eq(const Data& other) const noexcept { return _bits == other._bits; }
+ ASMJIT_INLINE_NODEBUG bool equals(const Data& other) const noexcept { return _bits == other._bits; }
- //! \}
+#if !defined(ASMJIT_NO_DEPRECATED)
+ ASMJIT_DEPRECATED("Use CpuFeatures::Data::equals() instead")
+ ASMJIT_INLINE_NODEBUG bool eq(const Data& other) const noexcept { return equals(other); }
+#endif // !ASMJIT_NO_DEPRECATED
- };
+ //! \}
+ };
//! X86 specific features data.
struct X86 : public Data {
@@ -169,68 +191,83 @@ public:
kMT, //!< CPU has multi-threading capabilities.
kNX, //!< CPU has Not-Execute-Bit aka DEP (data-execution prevention).
- k3DNOW, //!< CPU has 3DNOW (3DNOW base instructions) [AMD].
- k3DNOW2, //!< CPU has 3DNOW2 (enhanced 3DNOW) [AMD].
+ k3DNOW, //!< CPU has 3DNOW (3DNOW base instructions) {AMD} (deprecated).
+ k3DNOW2, //!< CPU has 3DNOW2 (enhanced 3DNOW) {AMD} (deprecated).
kADX, //!< CPU has ADX (multi-precision add-carry instruction extensions).
kAESNI, //!< CPU has AESNI (AES encode/decode instructions).
- kALTMOVCR8, //!< CPU has LOCK MOV R<->CR0 (supports `MOV R<->CR8` via `LOCK MOV R<->CR0` in 32-bit mode) [AMD].
- kAMX_BF16, //!< CPU has AMX_BF16 (advanced matrix extensions - BF16 instructions).
- kAMX_INT8, //!< CPU has AMX_INT8 (advanced matrix extensions - INT8 instructions).
+ kALTMOVCR8, //!< CPU has LOCK MOV R<->CR0 (supports `MOV R<->CR8` via `LOCK MOV R<->CR0` in 32-bit mode) {AMD}.
+ kAMX_BF16, //!< CPU has AMX_BF16 (AMX-BF16 instructions).
+ kAMX_COMPLEX, //!< CPU has AMX_COMPLEX (AMX-COMPLEX instructions).
+ kAMX_FP16, //!< CPU has AMX_FP16 (AMX-FP16 instructions).
+ kAMX_INT8, //!< CPU has AMX_INT8 (AMX-INT8 instructions).
kAMX_TILE, //!< CPU has AMX_TILE (advanced matrix extensions).
+ kAPX_F, //!< CPU has APX_F (advanced performance extensions - 32 GP registers, REX2 prefix, ...) {X86_64}.
kAVX, //!< CPU has AVX (advanced vector extensions).
kAVX2, //!< CPU has AVX2 (advanced vector extensions 2).
kAVX512_4FMAPS, //!< CPU has AVX512_FMAPS (FMA packed single).
kAVX512_4VNNIW, //!< CPU has AVX512_VNNIW (vector NN instructions word variable precision).
- kAVX512_BF16, //!< CPU has AVX512_BF16 (BFLOAT16 support instruction).
- kAVX512_BITALG, //!< CPU has AVX512_BITALG (VPOPCNT[B|W], VPSHUFBITQMB).
- kAVX512_BW, //!< CPU has AVX512_BW (packed BYTE|WORD).
- kAVX512_CDI, //!< CPU has AVX512_CDI (conflict detection).
- kAVX512_DQ, //!< CPU has AVX512_DQ (packed DWORD|QWORD).
- kAVX512_ERI, //!< CPU has AVX512_ERI (exponential and reciprocal).
+ kAVX512_BF16, //!< CPU has AVX512_BF16 (AVX512 BFLOAT16 support instructions).
+ kAVX512_BITALG, //!< CPU has AVX512_BITALG (AVX512 VPOPCNT[B|W] and VPSHUFBITQMB instructions).
+ kAVX512_BW, //!< CPU has AVX512_BW (AVX512 integer BYTE|WORD instructions).
+ kAVX512_CD, //!< CPU has AVX512_CD (AVX512 conflict detection DWORD|QWORD instructions).
+ kAVX512_DQ, //!< CPU has AVX512_DQ (AVX512 integer DWORD|QWORD instructions).
+ kAVX512_ER, //!< CPU has AVX512_ER (AVX512 exponential and reciprocal instructions).
kAVX512_F, //!< CPU has AVX512_F (AVX512 foundation).
- kAVX512_FP16, //!< CPU has AVX512_FP16 (FP16 extensions).
- kAVX512_IFMA, //!< CPU has AVX512_IFMA (integer fused-multiply-add using 52-bit precision).
- kAVX512_PFI, //!< CPU has AVX512_PFI (prefetch instructions).
- kAVX512_VBMI, //!< CPU has AVX512_VBMI (vector byte manipulation).
- kAVX512_VBMI2, //!< CPU has AVX512_VBMI2 (vector byte manipulation 2).
- kAVX512_VL, //!< CPU has AVX512_VL (vector length extensions).
- kAVX512_VNNI, //!< CPU has AVX512_VNNI (vector neural network instructions).
+ kAVX512_FP16, //!< CPU has AVX512_FP16 (AVX512 FP16 instructions).
+ kAVX512_IFMA, //!< CPU has AVX512_IFMA (AVX512 integer fused-multiply-add using 52-bit precision).
+ kAVX512_PF, //!< CPU has AVX512_PF (AVX512 prefetch instructions).
+ kAVX512_VBMI, //!< CPU has AVX512_VBMI (AVX152 vector byte manipulation instructions).
+ kAVX512_VBMI2, //!< CPU has AVX512_VBMI2 (AVX512 vector byte manipulation instructions v2).
+ kAVX512_VL, //!< CPU has AVX512_VL (AVX512 vector length extensions).
+ kAVX512_VNNI, //!< CPU has AVX512_VNNI (AVX512 vector neural network instructions).
kAVX512_VP2INTERSECT, //!< CPU has AVX512_VP2INTERSECT
- kAVX512_VPOPCNTDQ, //!< CPU has AVX512_VPOPCNTDQ (VPOPCNT[D|Q] instructions).
- kAVX_VNNI, //!< CPU has AVX_VNNI (VEX encoding of vpdpbusd/vpdpbusds/vpdpwssd/vpdpwssds).
+ kAVX512_VPOPCNTDQ, //!< CPU has AVX512_VPOPCNTDQ (AVX512 VPOPCNT[D|Q] instructions).
+ kAVX_IFMA, //!< CPU has AVX_IFMA (AVX/VEX encoding of vpmadd52huq/vpmadd52luq).
+ kAVX_NE_CONVERT, //!< CPU has AVX_NE_CONVERT.
+ kAVX_VNNI, //!< CPU has AVX_VNNI (AVX/VEX encoding of vpdpbusd/vpdpbusds/vpdpwssd/vpdpwssds).
+ kAVX_VNNI_INT16, //!< CPU has AVX_VNNI_INT16.
+ kAVX_VNNI_INT8, //!< CPU has AVX_VNNI_INT8.
kBMI, //!< CPU has BMI (bit manipulation instructions #1).
kBMI2, //!< CPU has BMI2 (bit manipulation instructions #2).
kCET_IBT, //!< CPU has CET-IBT (indirect branch tracking).
kCET_SS, //!< CPU has CET-SS.
+ kCET_SSS, //!< CPU has CET-SSS.
kCLDEMOTE, //!< CPU has CLDEMOTE (cache line demote).
- kCLFLUSH, //!< CPU has CLFUSH (Cache Line flush).
- kCLFLUSHOPT, //!< CPU has CLFUSHOPT (Cache Line flush - optimized).
+ kCLFLUSH, //!< CPU has CLFUSH (cache Line flush).
+ kCLFLUSHOPT, //!< CPU has CLFUSHOPT (cache Line flush - optimized).
kCLWB, //!< CPU has CLWB.
kCLZERO, //!< CPU has CLZERO.
kCMOV, //!< CPU has CMOV (CMOV and FCMOV instructions).
- kCMPXCHG16B, //!< CPU has CMPXCHG16B (compare-exchange 16 bytes) [X86_64].
+ kCMPCCXADD, //!< CPU has CMPCCXADD.
+ kCMPXCHG16B, //!< CPU has CMPXCHG16B (compare-exchange 16 bytes) {X86_64}.
kCMPXCHG8B, //!< CPU has CMPXCHG8B (compare-exchange 8 bytes).
kENCLV, //!< CPU has ENCLV.
kENQCMD, //!< CPU has ENQCMD (enqueue stores).
kERMS, //!< CPU has ERMS (enhanced REP MOVSB/STOSB).
- kF16C, //!< CPU has F16C.
- kFMA, //!< CPU has FMA (fused-multiply-add 3 operand form).
- kFMA4, //!< CPU has FMA4 (fused-multiply-add 4 operand form).
+ kF16C, //!< CPU has F16C (AVX FP16 conversion instructions).
+ kFMA, //!< CPU has FMA (AVX fused-multiply-add - 3 operand form).
+ kFMA4, //!< CPU has FMA4 (AVX fused-multiply-add - 4 operand form) (deprecated).
kFPU, //!< CPU has FPU (FPU support).
kFSGSBASE, //!< CPU has FSGSBASE.
+ kFSRM, //!< CPU has FSRM (fast short REP MOVSB).
+ kFSRC, //!< CPU has FSRC (fast short REP CMPSB|SCASB).
+ kFSRS, //!< CPU has FSRS (fast short REP STOSB)
kFXSR, //!< CPU has FXSR (FXSAVE/FXRSTOR instructions).
kFXSROPT, //!< CPU has FXSROTP (FXSAVE/FXRSTOR is optimized).
- kGEODE, //!< CPU has GEODE extensions (3DNOW additions).
- kGFNI, //!< CPU has GFNI (Galois field instructions).
+ kFZRM, //!< CPU has FZRM (fast zero-length REP MOVSB).
+ kGEODE, //!< CPU has GEODE extensions (GEODE 3DNOW additions) (deprecated).
+ kGFNI, //!< CPU has GFNI (galois field instructions).
kHLE, //!< CPU has HLE.
kHRESET, //!< CPU has HRESET.
kI486, //!< CPU has I486 features (I486+ support).
- kLAHFSAHF, //!< CPU has LAHF/SAHF (LAHF/SAHF in 64-bit mode) [X86_64].
- kLWP, //!< CPU has LWP (lightweight profiling) [AMD].
+ kINVLPGB, //!< CPU has INVLPGB.
+ kLAHFSAHF, //!< CPU has LAHF/SAHF (LAHF/SAHF in 64-bit mode) {X86_64}.
+ kLAM, //!< CPU has LAM (linear address masking) {X86_64}.
+ kLWP, //!< CPU has LWP (lightweight profiling) {AMD}.
kLZCNT, //!< CPU has LZCNT (LZCNT instruction).
kMCOMMIT, //!< CPU has MCOMMIT (MCOMMIT instruction).
- kMMX, //!< CPU has MMX (MMX base instructions).
- kMMX2, //!< CPU has MMX2 (MMX extensions or MMX2).
+ kMMX, //!< CPU has MMX (MMX base instructions) (deprecated).
+ kMMX2, //!< CPU has MMX2 (MMX2 extensions or initial SSE extensions) (deprecated).
kMONITOR, //!< CPU has MONITOR (MONITOR/MWAIT instructions).
kMONITORX, //!< CPU has MONITORX (MONITORX/MWAITX instructions).
kMOVBE, //!< CPU has MOVBE (move with byte-order swap).
@@ -238,58 +275,78 @@ public:
kMOVDIRI, //!< CPU has MOVDIRI (move dword/qword as direct store).
kMPX, //!< CPU has MPX (memory protection extensions).
kMSR, //!< CPU has MSR (RDMSR/WRMSR instructions).
+ kMSRLIST, //!< CPU has MSRLIST.
kMSSE, //!< CPU has MSSE (misaligned SSE support).
kOSXSAVE, //!< CPU has OSXSAVE (XSAVE enabled by OS).
kOSPKE, //!< CPU has OSPKE (PKE enabled by OS).
kPCLMULQDQ, //!< CPU has PCLMULQDQ (packed carry-less multiplication).
kPCONFIG, //!< CPU has PCONFIG (PCONFIG instruction).
kPOPCNT, //!< CPU has POPCNT (POPCNT instruction).
+ kPREFETCHI, //!< CPU has PREFETCHI.
kPREFETCHW, //!< CPU has PREFETCHW.
kPREFETCHWT1, //!< CPU has PREFETCHWT1.
kPTWRITE, //!< CPU has PTWRITE.
- kRDPID, //!< CPU has RDPID.
- kRDPRU, //!< CPU has RDPRU.
- kRDRAND, //!< CPU has RDRAND.
- kRDSEED, //!< CPU has RDSEED.
+ kRAO_INT, //!< CPU has RAO_INT (AADD, AAND, AOR, AXOR instructions).
+ kRMPQUERY, //!< CPU has RMPQUERY (RMPQUERY instruction).
+ kRDPID, //!< CPU has RDPID (RDPID instruction).
+ kRDPRU, //!< CPU has RDPRU (RDPRU instruction).
+ kRDRAND, //!< CPU has RDRAND (RDRAND instruction).
+ kRDSEED, //!< CPU has RDSEED (RDSEED instruction).
kRDTSC, //!< CPU has RDTSC.
kRDTSCP, //!< CPU has RDTSCP.
kRTM, //!< CPU has RTM.
+ kSEAM, //!< CPU has SEAM.
kSERIALIZE, //!< CPU has SERIALIZE.
+ kSEV, //!< CPU has SEV (secure encrypted virtualization).
+ kSEV_ES, //!< CPU has SEV_ES (SEV encrypted state).
+ kSEV_SNP, //!< CPU has SEV_SNP (SEV secure nested paging).
kSHA, //!< CPU has SHA (SHA-1 and SHA-256 instructions).
- kSKINIT, //!< CPU has SKINIT (SKINIT/STGI instructions) [AMD].
+ kSHA512, //!< CPU has SHA512 (SHA-512 instructions).
+ kSKINIT, //!< CPU has SKINIT (SKINIT/STGI instructions) {AMD}.
+ kSM3, //!< CPU has SM3 (SM3 hash extensions).
+ kSM4, //!< CPU has SM4 (SM4 cipher extensions).
kSMAP, //!< CPU has SMAP (supervisor-mode access prevention).
+ kSME , //!< CPU has SME (secure memory encryption).
kSMEP, //!< CPU has SMEP (supervisor-mode execution prevention).
kSMX, //!< CPU has SMX (safer mode extensions).
- kSNP, //!< CPU has SNP.
- kSSE, //!< CPU has SSE.
- kSSE2, //!< CPU has SSE2.
- kSSE3, //!< CPU has SSE3.
- kSSE4_1, //!< CPU has SSE4.1.
- kSSE4_2, //!< CPU has SSE4.2.
- kSSE4A, //!< CPU has SSE4A [AMD].
- kSSSE3, //!< CPU has SSSE3.
- kSVM, //!< CPU has SVM (virtualization) [AMD].
- kTBM, //!< CPU has TBM (trailing bit manipulation) [AMD].
+ kSSE, //!< CPU has SSE (SSE instructions).
+ kSSE2, //!< CPU has SSE2 (SSE2 instructions).
+ kSSE3, //!< CPU has SSE3 (SSE3 instructions).
+ kSSE4_1, //!< CPU has SSE4.1 (SSE4.1 instructions).
+ kSSE4_2, //!< CPU has SSE4.2 (SSE4.2 instructions).
+ kSSE4A, //!< CPU has SSE4A (SSE4.A instructions) {AMD} (deprecated).
+ kSSSE3, //!< CPU has SSSE3 (SSSE3 instructions).
+ kSVM, //!< CPU has SVM (virtualization) {AMD}.
+ kTBM, //!< CPU has TBM (trailing bit manipulation) {AMD}.
+ kTSE, //!< CPU has TSE.
kTSX, //!< CPU has TSX.
kTSXLDTRK, //!< CPU has TSXLDTRK.
kUINTR, //!< CPU has UINTR (user interrupts).
kVAES, //!< CPU has VAES (vector AES 256|512 bit support).
- kVMX, //!< CPU has VMX (virtualization) [INTEL].
+ kVMX, //!< CPU has VMX (virtualization) {INTEL}.
kVPCLMULQDQ, //!< CPU has VPCLMULQDQ (vector PCLMULQDQ 256|512-bit support).
kWAITPKG, //!< CPU has WAITPKG (UMONITOR, UMWAIT, TPAUSE).
kWBNOINVD, //!< CPU has WBNOINVD.
- kXOP, //!< CPU has XOP (XOP instructions) [AMD].
+ kWRMSRNS, //!< CPU has WRMSRNS.
+ kXOP, //!< CPU has XOP (XOP instructions) {AMD} (deprecated).
kXSAVE, //!< CPU has XSAVE.
kXSAVEC, //!< CPU has XSAVEC.
kXSAVEOPT, //!< CPU has XSAVEOPT.
kXSAVES, //!< CPU has XSAVES.
// @EnumValuesEnd@
+#ifndef ASMJIT_NO_DEPRECATED
+ kAVX512_CDI = kAVX512_CD,
+ kAVX512_ERI = kAVX512_ER,
+ kAVX512_PFI = kAVX512_PF,
+#endif
+
kMaxValue = kXSAVES
};
#define ASMJIT_X86_FEATURE(FEATURE) \
- inline bool has##FEATURE() const noexcept { return has(X86::k##FEATURE); }
+ /*! Tests whether FEATURE is present. */ \
+ ASMJIT_INLINE_NODEBUG bool has##FEATURE() const noexcept { return has(X86::k##FEATURE); }
ASMJIT_X86_FEATURE(MT)
ASMJIT_X86_FEATURE(NX)
@@ -299,8 +356,11 @@ public:
ASMJIT_X86_FEATURE(AESNI)
ASMJIT_X86_FEATURE(ALTMOVCR8)
ASMJIT_X86_FEATURE(AMX_BF16)
+ ASMJIT_X86_FEATURE(AMX_COMPLEX)
+ ASMJIT_X86_FEATURE(AMX_FP16)
ASMJIT_X86_FEATURE(AMX_INT8)
ASMJIT_X86_FEATURE(AMX_TILE)
+ ASMJIT_X86_FEATURE(APX_F)
ASMJIT_X86_FEATURE(AVX)
ASMJIT_X86_FEATURE(AVX2)
ASMJIT_X86_FEATURE(AVX512_4FMAPS)
@@ -308,24 +368,29 @@ public:
ASMJIT_X86_FEATURE(AVX512_BF16)
ASMJIT_X86_FEATURE(AVX512_BITALG)
ASMJIT_X86_FEATURE(AVX512_BW)
- ASMJIT_X86_FEATURE(AVX512_CDI)
+ ASMJIT_X86_FEATURE(AVX512_CD)
ASMJIT_X86_FEATURE(AVX512_DQ)
- ASMJIT_X86_FEATURE(AVX512_ERI)
+ ASMJIT_X86_FEATURE(AVX512_ER)
ASMJIT_X86_FEATURE(AVX512_F)
ASMJIT_X86_FEATURE(AVX512_FP16)
ASMJIT_X86_FEATURE(AVX512_IFMA)
- ASMJIT_X86_FEATURE(AVX512_PFI)
+ ASMJIT_X86_FEATURE(AVX512_PF)
ASMJIT_X86_FEATURE(AVX512_VBMI)
ASMJIT_X86_FEATURE(AVX512_VBMI2)
ASMJIT_X86_FEATURE(AVX512_VL)
ASMJIT_X86_FEATURE(AVX512_VNNI)
ASMJIT_X86_FEATURE(AVX512_VP2INTERSECT)
ASMJIT_X86_FEATURE(AVX512_VPOPCNTDQ)
+ ASMJIT_X86_FEATURE(AVX_IFMA)
+ ASMJIT_X86_FEATURE(AVX_NE_CONVERT)
ASMJIT_X86_FEATURE(AVX_VNNI)
+ ASMJIT_X86_FEATURE(AVX_VNNI_INT16)
+ ASMJIT_X86_FEATURE(AVX_VNNI_INT8)
ASMJIT_X86_FEATURE(BMI)
ASMJIT_X86_FEATURE(BMI2)
ASMJIT_X86_FEATURE(CET_IBT)
ASMJIT_X86_FEATURE(CET_SS)
+ ASMJIT_X86_FEATURE(CET_SSS)
ASMJIT_X86_FEATURE(CLDEMOTE)
ASMJIT_X86_FEATURE(CLFLUSH)
ASMJIT_X86_FEATURE(CLFLUSHOPT)
@@ -342,14 +407,20 @@ public:
ASMJIT_X86_FEATURE(FMA4)
ASMJIT_X86_FEATURE(FPU)
ASMJIT_X86_FEATURE(FSGSBASE)
+ ASMJIT_X86_FEATURE(FSRM)
+ ASMJIT_X86_FEATURE(FSRC)
+ ASMJIT_X86_FEATURE(FSRS)
ASMJIT_X86_FEATURE(FXSR)
ASMJIT_X86_FEATURE(FXSROPT)
+ ASMJIT_X86_FEATURE(FZRM)
ASMJIT_X86_FEATURE(GEODE)
ASMJIT_X86_FEATURE(GFNI)
ASMJIT_X86_FEATURE(HLE)
ASMJIT_X86_FEATURE(HRESET)
ASMJIT_X86_FEATURE(I486)
+ ASMJIT_X86_FEATURE(INVLPGB)
ASMJIT_X86_FEATURE(LAHFSAHF)
+ ASMJIT_X86_FEATURE(LAM)
ASMJIT_X86_FEATURE(LWP)
ASMJIT_X86_FEATURE(LZCNT)
ASMJIT_X86_FEATURE(MCOMMIT)
@@ -362,15 +433,19 @@ public:
ASMJIT_X86_FEATURE(MOVDIRI)
ASMJIT_X86_FEATURE(MPX)
ASMJIT_X86_FEATURE(MSR)
+ ASMJIT_X86_FEATURE(MSRLIST)
ASMJIT_X86_FEATURE(MSSE)
ASMJIT_X86_FEATURE(OSXSAVE)
ASMJIT_X86_FEATURE(OSPKE)
ASMJIT_X86_FEATURE(PCLMULQDQ)
ASMJIT_X86_FEATURE(PCONFIG)
ASMJIT_X86_FEATURE(POPCNT)
+ ASMJIT_X86_FEATURE(PREFETCHI)
ASMJIT_X86_FEATURE(PREFETCHW)
ASMJIT_X86_FEATURE(PREFETCHWT1)
ASMJIT_X86_FEATURE(PTWRITE)
+ ASMJIT_X86_FEATURE(RAO_INT)
+ ASMJIT_X86_FEATURE(RMPQUERY)
ASMJIT_X86_FEATURE(RDPID)
ASMJIT_X86_FEATURE(RDPRU)
ASMJIT_X86_FEATURE(RDRAND)
@@ -378,13 +453,16 @@ public:
ASMJIT_X86_FEATURE(RDTSC)
ASMJIT_X86_FEATURE(RDTSCP)
ASMJIT_X86_FEATURE(RTM)
+ ASMJIT_X86_FEATURE(SEAM)
ASMJIT_X86_FEATURE(SERIALIZE)
+ ASMJIT_X86_FEATURE(SEV)
+ ASMJIT_X86_FEATURE(SEV_ES)
+ ASMJIT_X86_FEATURE(SEV_SNP)
ASMJIT_X86_FEATURE(SHA)
ASMJIT_X86_FEATURE(SKINIT)
ASMJIT_X86_FEATURE(SMAP)
ASMJIT_X86_FEATURE(SMEP)
ASMJIT_X86_FEATURE(SMX)
- ASMJIT_X86_FEATURE(SNP)
ASMJIT_X86_FEATURE(SSE)
ASMJIT_X86_FEATURE(SSE2)
ASMJIT_X86_FEATURE(SSE3)
@@ -394,6 +472,7 @@ public:
ASMJIT_X86_FEATURE(SSSE3)
ASMJIT_X86_FEATURE(SVM)
ASMJIT_X86_FEATURE(TBM)
+ ASMJIT_X86_FEATURE(TSE)
ASMJIT_X86_FEATURE(TSX)
ASMJIT_X86_FEATURE(TSXLDTRK)
ASMJIT_X86_FEATURE(UINTR)
@@ -402,95 +481,248 @@ public:
ASMJIT_X86_FEATURE(VPCLMULQDQ)
ASMJIT_X86_FEATURE(WAITPKG)
ASMJIT_X86_FEATURE(WBNOINVD)
+ ASMJIT_X86_FEATURE(WRMSRNS)
ASMJIT_X86_FEATURE(XOP)
ASMJIT_X86_FEATURE(XSAVE)
ASMJIT_X86_FEATURE(XSAVEC)
ASMJIT_X86_FEATURE(XSAVEOPT)
ASMJIT_X86_FEATURE(XSAVES)
+#ifndef ASMJIT_NO_DEPRECATED
+ ASMJIT_DEPRECATED("Use hasAVX512_CD() instead")
+ ASMJIT_X86_FEATURE(AVX512_CDI)
+
+ ASMJIT_DEPRECATED("Use hasAVX512_ER() instead")
+ ASMJIT_X86_FEATURE(AVX512_ERI)
+
+ ASMJIT_DEPRECATED("Use hasAVX512_PF() instead")
+ ASMJIT_X86_FEATURE(AVX512_PFI)
+#endif
+
#undef ASMJIT_X86_FEATURE
};
//! ARM specific features data.
+ //!
+ //! Naming reference:
+ //! - https://developer.arm.com/downloads/-/exploration-tools/feature-names-for-a-profile
struct ARM : public Data {
//! ARM CPU feature identifiers.
enum Id : uint8_t {
// @EnumValuesBegin{"enum": "CpuFeatures::ARM"}@
kNone = 0, //!< No feature (never set, used internally).
- kTHUMB, //!< THUMB v1 ISA.
- kTHUMBv2, //!< THUMB v2 ISA.
-
- kARMv6, //!< ARMv6 ISA.
- kARMv7, //!< ARMv7 ISA.
- kARMv8a, //!< ARMv8-A ISA.
- kARMv8_1a, //!< ARMv8.1-A ISA.
- kARMv8_2a, //!< ARMv8.2-A ISA.
- kARMv8_3a, //!< ARMv8.3-A ISA.
- kARMv8_4a, //!< ARMv8.4-A ISA.
- kARMv8_5a, //!< ARMv8.5-A ISA.
- kARMv8_6a, //!< ARMv8.6-A ISA.
- kARMv8_7a, //!< ARMv8.7-A ISA.
-
- kVFPv2, //!< CPU has VFPv2 instruction set.
- kVFPv3, //!< CPU has VFPv3 instruction set.
- kVFPv4, //!< CPU has VFPv4 instruction set.
- kVFP_D32, //!< CPU has 32 VFP-D (64-bit) registers.
-
- kAES, //!< CPU has AES (AArch64 only).
- kALTNZCV, //!< CPU has ALTNZCV (AArch64 only).
- kASIMD, //!< CPU has Advanced SIMD (NEON on ARM/THUMB).
- kBF16, //!< CPU has BF16 (AArch64 only).
- kBTI, //!< CPU has BTI (branch target identification).
- kCPUID, //!< CPU has accessible CPUID register (ID_AA64ZFR0_EL1).
- kCRC32, //!< CPU has CRC32 .
- kDGH, //!< CPU has DGH (AArch64 only).
- kDIT, //!< CPU has data independent timing instructions (DIT).
- kDOTPROD, //!< CPU has DOTPROD (SDOT/UDOT).
- kEDSP, //!< CPU has EDSP (ARM/THUMB only).
- kFCMA, //!< CPU has FCMA (FCADD/FCMLA).
- kFJCVTZS, //!< CPU has FJCVTZS (AArch64 only).
- kFLAGM, //!< CPU has FLAGM (AArch64 only).
- kFP16CONV, //!< CPU has FP16 (half-float) conversion.
- kFP16FML, //!< CPU has FMLAL{2}/FMLSL{2}
- kFP16FULL, //!< CPU has full support for FP16.
- kFRINT, //!< CPU has FRINT[32|64][X|Z] (AArch64 only).
- kI8MM, //!< CPU has I8MM (AArch64 only).
- kIDIVA, //!< CPU has hardware SDIV and UDIV (ARM mode).
- kIDIVT, //!< CPU has hardware SDIV and UDIV (THUMB mode).
- kLSE, //!< CPU has large system extensions (LSE) (AArch64 only).
- kMTE, //!< CPU has MTE (AArch64 only).
- kRCPC_IMMO, //!< CPU has RCPC_IMMO (AArch64 only).
- kRDM, //!< CPU has RDM (AArch64 only).
- kPMU, //!< CPU has PMU (AArch64 only).
- kPMULL, //!< CPU has PMULL (AArch64 only).
- kRNG, //!< CPU has random number generation (RNG).
- kSB, //!< CPU has speculative barrier SB (AArch64 only).
- kSHA1, //!< CPU has SHA1.
- kSHA2, //!< CPU has SHA2.
- kSHA3, //!< CPU has SHA3.
- kSHA512, //!< CPU has SHA512.
- kSM3, //!< CPU has SM3.
- kSM4, //!< CPU has SM4.
- kSSBS, //!< CPU has SSBS.
- kSVE, //!< CPU has SVE (AArch64 only).
- kSVE_BF16, //!< CPU has SVE-BF16 (AArch64 only).
- kSVE_F32MM, //!< CPU has SVE-F32MM (AArch64 only).
- kSVE_F64MM, //!< CPU has SVE-F64MM (AArch64 only).
- kSVE_I8MM, //!< CPU has SVE-I8MM (AArch64 only).
- kSVE_PMULL, //!< CPU has SVE-PMULL (AArch64 only).
- kSVE2, //!< CPU has SVE2 (AArch64 only).
- kSVE2_AES, //!< CPU has SVE2-AES (AArch64 only).
- kSVE2_BITPERM, //!< CPU has SVE2-BITPERM (AArch64 only).
- kSVE2_SHA3, //!< CPU has SVE2-SHA3 (AArch64 only).
- kSVE2_SM4, //!< CPU has SVE2-SM4 (AArch64 only).
- kTME, //!< CPU has transactional memory extensions (TME).
+
+ kARMv6, //!< CPU is at least ARMv6 {A32}.
+ kARMv7, //!< CPU is at least ARMv7 {A32}.
+ kARMv8a, //!< CPU is at least ARMv8A.
+ kTHUMB, //!< CPU has THUMB (16-bit THUMB encoding) {A32}.
+ kTHUMBv2, //!< CPU has THUMBv2 (32-bit THUMB encoding) {A32}.
+
+ kABLE, //!< CPU has ABLE (address breakpoint linking extension) {A64}.
+ kADERR, //!< CPU has ADERR (asynchronous device error exceptions) {A64}.
+ kAES, //!< CPU has AES (ASIMD AES instructions).
+ kAFP, //!< CPU has AFP (alternate floating-point behavior) {A64}.
+ kAIE, //!< CPU has AIE (memory attribute index enhancement) {A64}.
+ kAMU1, //!< CPU has AMUv1 (activity monitors extension version 1) {A64}.
+ kAMU1_1, //!< CPU has AMUv1p1 (activity monitors extension version 1.1) {A64}.
+ kANERR, //!< CPU has ANERR (asynchronous normal error exception) {A64}.
+ kASIMD, //!< CPU has ASIMD (NEON on ARM/THUMB).
+ kBF16, //!< CPU has BF16 (BFloat16 instructions) {A64}.
+ kBRBE, //!< CPU has BRBE (branch record buffer extension) {A64}.
+ kBTI, //!< CPU has BTI (branch target identification).
+ kBWE, //!< CPU has BWE (breakpoint mismatch and range extension) {A64}.
+ kCCIDX, //!< CPU has CCIDX (extend of the CCSIDR number of sets).
+ kCHK, //!< CPU has CHK (check feature status - CHKFEAT instruction) {A64}.
+ kCLRBHB, //!< CPU has CLRBHB (clear BHB instruction).
+ kCMOW, //!< CPU has CMOW (control for cache maintenance permission) {A64}.
+ kCONSTPACFIELD, //!< CPU has CONSTPACFIELD (PAC algorithm enhancement) {A64}.
+ kCPA, //!< CPU has CPA (instruction-only Checked Pointer Arithmetic) {A64}.
+ kCPA2, //!< CPU has CPA2 (checked Pointer Arithmetic) {A64}.
+ kCPUID, //!< CPU has CPUID (CPUID registers accessible in user-space).
+ kCRC32, //!< CPU has CRC32 (CRC32 instructions).
+ kCSSC, //!< CPU has CSSC (common short sequence compression) {A64}.
+ kCSV2, //!< CPU has CSV2 (cache speculation variant 2 version 2.1) {A64}.
+ kCSV2_3, //!< CPU has CSV2_3 (cache speculation variant 2 version 3) {A64}.
+ kCSV3, //!< CPU has CSV3 (cache speculation Variant 3) {A64}.
+ kD128, //!< CPU has D128 (128-bit translation tables, 56 bit PA) {A64}.
+ kDGH, //!< CPU has DGH (data gathering hint) {A64}.
+ kDIT, //!< CPU has DIT (data independent timing of instructions).
+ kDOTPROD, //!< CPU has DOTPROD (ASIMD Int8 dot product instructions).
+ kDPB, //!< CPU has DPB (DC CVAP instruction) {A64}.
+ kDPB2, //!< CPU has DPB2 (DC CVADP instruction) {A64}.
+ kEBEP, //!< CPU has EBEP (exception-based event profiling) {A64}.
+ kEBF16, //!< CPU has EBF16 (extended BFloat16 mode) {A64}.
+ kECBHB, //!< CPU has ECBHB (exploitative control using branch history information) {A64}.
+ kECV, //!< CPU has ECV (enhanced counter virtualization).
+ kEDHSR, //!< CPU has EDHSR (support for EDHSR) {A64}.
+ kEDSP, //!< CPU has EDSP (ARM/THUMB only).
+ kFAMINMAX, //!< CPU has FAMINMAX (floating-point maximum and minimum absolute value instructions) {A64}.
+ kFCMA, //!< CPU has FCMA (FCADD/FCMLA).
+ kFGT, //!< CPU has FGT (fine-grained traps).
+ kFGT2, //!< CPU has FGT2 (fine-grained traps 2).
+ kFHM, //!< CPU has FHM (half-precision floating-point FMLAL instructions).
+ kFLAGM, //!< CPU has FLAGM (condition flag manipulation) {A64}.
+ kFLAGM2, //!< CPU has FLAGM2 (condition flag manipulation version v2) {A64}.
+ kFMAC, //!< CPU has FMAC (ARM/THUMB only).
+ kFP, //!< CPU has FP (floating-point) (on 32-bit ARM this means VFPv3).
+ kFP16, //!< CPU has FP16 (half-precision floating-point data processing).
+ kFP16CONV, //!< CPU has FP16CONV (half-precision float conversion).
+ kFP8, //!< CPU has FP8 (FP8 convert instructions) {A64}.
+ kFP8DOT2, //!< CPU has FP8DOT2 (FP8 2-way dot product to half-precision instructions) {A64}.
+ kFP8DOT4, //!< CPU has FP8DOT4 (FP8 4-way dot product to single-precision instructions) {A64}.
+ kFP8FMA, //!< CPU has FP8FMA (FP8 multiply-accumulate to half-precision and single-precision instructions) {A64}.
+ kFPMR, //!< CPU has FPMR (floating-point Mode Register) {A64}.
+ kFRINTTS, //!< CPU has FRINTTS (FRINT[32|64][X|Z] instructions) {A64}.
+ kGCS, //!< CPU has GCS (guarded control stack extension) {A64}.
+ kHACDBS, //!< CPU has HACDBS (hardware accelerator for cleaning Dirty state) {A64}.
+ kHAFDBS, //!< CPU has HAFDBS (hardware management of the access flag and dirty state) {A64}.
+ kHAFT, //!< CPU has HAFT (hardware managed access flag for table descriptors) {A64}.
+ kHDBSS, //!< CPU has HDBSS (hardware Dirty state tracking Structure) {A64}.
+ kHBC, //!< CPU has HBC (hinted conditional branches) {A64}.
+ kHCX, //!< CPU has HCX (support for the HCRX_EL2 register) {A64}.
+ kHPDS, //!< CPU has HPDS (hierarchical permission disables in translation tables ) {A64}.
+ kHPDS2, //!< CPU has HPDS2 (hierarchical permission disables) {A64}.
+ kI8MM, //!< CPU has I8MM (int8 matrix multiplication) {A64}.
+ kIDIVA, //!< CPU has IDIV (hardware SDIV and UDIV in ARM mode).
+ kIDIVT, //!< CPU has IDIV (hardware SDIV and UDIV in THUMB mode).
+ kITE, //!< CPU has ITE (instrumentation extension) {A64}.
+ kJSCVT, //!< CPU has JSCVT (JavaScript FJCVTS conversion instruction) {A64}.
+ kLOR, //!< CPU has LOR (limited ordering regions extension).
+ kLRCPC, //!< CPU has LRCPC (load-acquire RCpc instructions) {A64}.
+ kLRCPC2, //!< CPU has LRCPC2 (load-acquire RCpc instructions v2) {A64}.
+ kLRCPC3, //!< CPU has LRCPC3 (load-Acquire RCpc instructions v3) {A64}.
+ kLS64, //!< CPU has LS64 (64 byte loads/stores without return) {A64}.
+ kLS64_ACCDATA, //!< CPU has LS64_ACCDATA (64-byte EL0 stores with return) {A64}.
+ kLS64_V, //!< CPU has LS64_V (64-byte stores with return) {A64}.
+ kLSE, //!< CPU has LSE (large system extensions) {A64}.
+ kLSE128, //!< CPU has LSE128 (128-bit atomics) {A64}.
+ kLSE2, //!< CPU has LSE2 (large system extensions v2) {A64}.
+ kLUT, //!< CPU has LUT (lookup table instructions with 2-bit and 4-bit indices) {A64}.
+ kLVA, //!< CPU has LVA (large VA support) {A64}.
+ kLVA3, //!< CPU has LVA3 (56-bit VA) {A64}.
+ kMEC, //!< CPU has MEC (memory encryption contexts) {A64}.
+ kMOPS, //!< CPU has MOPS (memcpy and memset acceleration instructions) {A64}.
+ kMPAM, //!< CPU has MPAM (memory system partitioning and monitoring extension) {A64}.
+ kMTE, //!< CPU has MTE (instruction-only memory tagging extension) {A64}.
+ kMTE2, //!< CPU has MTE2 (full memory tagging extension) {A64}.
+ kMTE3, //!< CPU has MTE3 (MTE asymmetric fault handling) {A64}.
+ kMTE4, //!< CPU has MTE4 (MTE v4) {A64}.
+ kMTE_ASYM_FAULT, //!< CPU has MTE_ASYM_FAULT (memory tagging asymmetric faults) {A64}.
+ kMTE_ASYNC, //!< CPU has MTE_ASYNC (memory tagging asynchronous faulting) {A64}.
+ kMTE_CANONICAL_TAGS, //!< CPU has MTE_CANONICAL_TAGS (canonical tag checking for untagged memory) {A64}.
+ kMTE_NO_ADDRESS_TAGS, //!< CPU has MTE_NO_ADDRESS_TAGS (memory tagging with address tagging disabled) {A64}.
+ kMTE_PERM_S1, //!< CPU has MTE_PERM_S1 (allocation tag access permission) {A64}.
+ kMTE_STORE_ONLY, //!< CPU has MTE_STORE_ONLY (store-only tag checking) {A64}.
+ kMTE_TAGGED_FAR, //!< CPU has MTE_TAGGED_FAR (FAR_ELx on a tag check fault) {A64}.
+ kMTPMU, //!< CPU has MTPMU (multi-threaded PMU extensions) {A64}.
+ kNMI, //!< CPU has NMI (non-maskable Interrupt) {A64}.
+ kNV, //!< CPU has NV (nested virtualization enchancement) {A64}.
+ kNV2, //!< CPU has NV2 (enhanced support for nested virtualization) {A64}.
+ kPAN, //!< CPU has PAN (privileged access-never extension) {A64}.
+ kPAN2, //!< CPU has PAN2 (PAN s1e1R and s1e1W variants) {A64}.
+ kPAN3, //!< CPU has PAN3 (support for SCTLR_ELx.EPAN) {A64}.
+ kPAUTH, //!< CPU has PAUTH (pointer authentication extension) {A64}.
+ kPFAR, //!< CPU has PFAR (physical fault address registers) {A64}.
+ kPMU, //!< CPU has PMU {A64}.
+ kPMULL, //!< CPU has PMULL (ASIMD PMULL instructions) {A64}.
+ kPRFMSLC, //!< CPU has PRFMSLC (PRFM instructions support the SLC target) {A64}.
+ kRAS, //!< CPU has RAS (reliability, availability and serviceability extensions).
+ kRAS1_1, //!< CPU has RASv1p1 (RAS v1.1).
+ kRAS2, //!< CPU has RASv2 (RAS v2).
+ kRASSA2, //!< CPU has RASSAv2 (RAS v2 system architecture).
+ kRDM, //!< CPU has RDM (rounding double multiply accumulate) {A64}.
+ kRME, //!< CPU has RME (memory encryption contexts extension) {A64}.
+ kRNG, //!< CPU has RNG (random number generation).
+ kRNG_TRAP, //!< CPU has RNG_TRAP (random number trap to EL3 field) {A64}.
+ kRPRES, //!< CPU has RPRES (increased precision of reciprocal estimate and RSQRT estimate) {A64}.
+ kRPRFM, //!< CPU has RPRFM (range prefetch hint instruction).
+ kS1PIE, //!< CPU has S1PIE (permission model enhancements) {A64}.
+ kS1POE, //!< CPU has S1POE (permission model enhancements) {A64}.
+ kS2PIE, //!< CPU has S2PIE (permission model enhancements) {A64}.
+ kS2POE, //!< CPU has S2POE (permission model enhancements) {A64}.
+ kSB, //!< CPU has SB (speculative barrier).
+ kSCTLR2, //!< CPU has SCTLR2 (extension to SCTLR_ELx) {A64}.
+ kSEBEP, //!< CPU has SEBEP (synchronous exception-based event profiling) {A64}.
+ kSEL2, //!< CPU has SEL2 (secure EL2) {A64}.
+ kSHA1, //!< CPU has SHA1 (ASIMD SHA1 instructions).
+ kSHA256, //!< CPU has SHA256 (ASIMD SHA256 instructions).
+ kSHA3, //!< CPU has SHA3 (ASIMD EOR3, RAX1, XAR, and BCAX instructions).
+ kSHA512, //!< CPU has SHA512 (ASIMD SHA512 instructions).
+ kSM3, //!< CPU has SM3 (ASIMD SM3 instructions).
+ kSM4, //!< CPU has SM4 (ASIMD SM4 instructions).
+ kSME, //!< CPU has SME (SME v1 - scalable matrix extension) {A64}.
+ kSME2, //!< CPU has SME2 (SME v2) {A64}.
+ kSME2_1, //!< CPU has SME2p1 (SME v2.1) {A64}.
+ kSME_B16B16, //!< CPU has SME_B16B16 (SME non-widening BFloat16 to BFloat16 arithmetic) {A64}.
+ kSME_B16F32, //!< CPU has SME_B16F32 (BFMOPA and BFMOPS instructions that accumulate BFloat16 outer products into single-precision tiles) {A64}.
+ kSME_BI32I32, //!< CPU has SME_BI32I32 (BMOPA and BMOPS instructions that accumulate 1-bit binary outer products into 32-bit integer tiles) {A64}.
+ kSME_F16F16, //!< CPU has SME_F16F16 (SME2.1 non-widening half-precision FP16 to FP16 arithmetic) {A64}.
+ kSME_F16F32, //!< CPU has SME_F16F32 {A64}.
+ kSME_F32F32, //!< CPU has SME_F32F32 {A64}.
+ kSME_F64F64, //!< CPU has SME_F64F64 {A64}.
+ kSME_F8F16, //!< CPU has SME_F8F16 (SME2 ZA-targeting FP8 multiply-accumulate, dot product, and outer product to half-precision instructions) {A64}.
+ kSME_F8F32, //!< CPU has SME_F8F32 (SME2 ZA-targeting FP8 multiply-accumulate, dot product, and outer product to single-precision instructions) {A64}.
+ kSME_FA64, //!< CPU has SME_FA64 {A64}.
+ kSME_I16I32, //!< CPU has SME_I16I32 {A64}.
+ kSME_I16I64, //!< CPU has SME_I16I64 {A64}.
+ kSME_I8I32, //!< CPU has SME_I8I32 {A64}.
+ kSME_LUTv2, //!< CPU has SME_LUTv2 (lookup table instructions with 4-bit indices and 8-bit elements) {A64}.
+ kSPE, //!< CPU has SPE (statistical profiling extension) {A64}.
+ kSPE1_1, //!< CPU has SPEv1p1 (statistical profiling extensions version 1.1) {A64}.
+ kSPE1_2, //!< CPU has SPEv1p2 (statistical profiling extensions version 1.2) {A64}.
+ kSPE1_3, //!< CPU has SPEv1p3 (statistical profiling extensions version 1.3) {A64}.
+ kSPE1_4, //!< CPU has SPEv1p4 (statistical profiling extensions version 1.4) {A64}.
+ kSPE_ALTCLK, //!< CPU has SPE_ALTCLK (statistical profiling alternate clock domain extension) {A64}.
+ kSPE_CRR, //!< CPU has SPE_CRR (statistical profiling call return branch records) {A64}.
+ kSPE_EFT, //!< CPU has SPE_EFT (statistical profiling extended filtering by type) {A64}.
+ kSPE_FDS, //!< CPU has SPE_FDS (statistical profiling data source filtering) {A64}.
+ kSPE_FPF, //!< CPU has SPE_FPF (statistical profiling floating-point flag extension) {A64}.
+ kSPE_SME, //!< CPU has SPE_SME (statistical profiling extensions for SME) {A64}.
+ kSPECRES, //!< CPU has SPECRES (speculation restriction instructions).
+ kSPECRES2, //!< CPU has SPECRES2 (clear other speculative predictions).
+ kSPMU, //!< CPU has SPMU (system performance monitors extension) {A64}.
+ kSSBS, //!< CPU has SSBS (speculative store bypass safe instruction).
+ kSSBS2, //!< CPU has SSBS2 (MRS and MSR instructions for SSBS).
+ kSSVE_FP8DOT2, //!< CPU has SSVE_FP8DOT2 (SVE2 FP8 2-way dot product to half-precision instructions in Streaming SVE mode) {A64}.
+ kSSVE_FP8DOT4, //!< CPU has SSVE_FP8DOT4 (SVE2 FP8 4-way dot product to single-precision instructions in Streaming SVE mode) {A64}.
+ kSSVE_FP8FMA, //!< CPU has SSVE_FP8FMA (SVE2 FP8 multiply-accumulate to half-precision and single-precision instructions in Streaming SVE mode) {A64}.
+ kSVE, //!< CPU has SVE (SVE v1 - scalable vector extension) {A64}.
+ kSVE2, //!< CPU has SVE2 (SVE v2) {A64}.
+ kSVE2_1, //!< CPU has SVE2p1 (SVE v2.1) {A64}.
+ kSVE_AES, //!< CPU has SVE_AES (SVE AES instructions) {A64}.
+ kSVE_B16B16, //!< CPU has SVE_B16B16 (SVE non-widening BFloat16 to BFloat16 arithmetic) {A64}.
+ kSVE_BF16, //!< CPU has SVE_BF16 (SVE BF16 instructions) {A64}.
+ kSVE_BITPERM, //!< CPU has SVE_BITPERM (SVE bit permute) {A64}.
+ kSVE_EBF16, //!< CPU has SVE_EBF16 (SVE extended BFloat16 mode) {A64}.
+ kSVE_F32MM, //!< CPU has SVE_F32MM (SVE single-precision floating-point matrix multiply instruction) {A64}.
+ kSVE_F64MM, //!< CPU has SVE_F64MM (SVE double-precision floating-point matrix multiply instruction) {A64}.
+ kSVE_I8MM, //!< CPU has SVE_I8MM (SVE int8 matrix multiplication) {A64}.
+ kSVE_PMULL128, //!< CPU has SVE_PMULL128 (SVE PMULL instructions) {A64}.
+ kSVE_SHA3, //!< CPU has SVE_SHA3 (SVE SHA-3 instructions) {A64}.
+ kSVE_SM4, //!< CPU has SVE_SM4 (SVE SM4 instructions {A64}.
+ kSYSINSTR128, //!< CPU has SYSINSTR128 (128-bit system instructions) {A64}.
+ kSYSREG128, //!< CPU has SYSREG128 (128-bit system registers) {A64}.
+ kTHE, //!< CPU has THE (translation hardening extension).
+ kTLBIOS, //!< CPU has TLBIOS (TLBI instructions in Outer Shareable domain) {A64}.
+ kTLBIRANGE, //!< CPU has TLBIRANGE (TLBI range instructions) {A64}.
+ kTLBIW, //!< CPU has TLBIW (TLBI VMALL for dirty state) {A64}.
+ kTME, //!< CPU has TME (transactional memory extensions).
+ kTRF, //!< CPU has TRF (self-hosted trace extensions).
+ kUAO, //!< CPU has UAO (AArch64 v8.2 UAO PState) {A64}.
+ kVFP_D32, //!< CPU has VFP_D32 (32 VFP-D registers) (ARM/THUMB only).
+ kVHE, //!< CPU has VHE (virtual host extension).
+ kVMID16, //!< CPU has VMID16 (16-bit VMID) {A64}.
+ kWFXT, //!< CPU has WFxT (WFE and WFI instructions with timeout) {A64}.
+ kXNX, //!< CPU has XNX (translation table stage 2 unprivileged execute-never) {A64}.
+ kXS, //!< CPU has XS (XS attribute in TLBI and DSB instructions) {A64}.
// @EnumValuesEnd@
- kMaxValue = kTME
+ kMaxValue = kXS
};
#define ASMJIT_ARM_FEATURE(FEATURE) \
- inline bool has##FEATURE() const noexcept { return has(ARM::k##FEATURE); }
+ /*! Tests whether FEATURE is present. */ \
+ ASMJIT_INLINE_NODEBUG bool has##FEATURE() const noexcept { return has(ARM::k##FEATURE); }
ASMJIT_ARM_FEATURE(THUMB)
ASMJIT_ARM_FEATURE(THUMBv2)
@@ -498,67 +730,204 @@ public:
ASMJIT_ARM_FEATURE(ARMv6)
ASMJIT_ARM_FEATURE(ARMv7)
ASMJIT_ARM_FEATURE(ARMv8a)
- ASMJIT_ARM_FEATURE(ARMv8_1a)
- ASMJIT_ARM_FEATURE(ARMv8_2a)
- ASMJIT_ARM_FEATURE(ARMv8_3a)
- ASMJIT_ARM_FEATURE(ARMv8_4a)
- ASMJIT_ARM_FEATURE(ARMv8_5a)
- ASMJIT_ARM_FEATURE(ARMv8_6a)
- ASMJIT_ARM_FEATURE(ARMv8_7a)
-
- ASMJIT_ARM_FEATURE(VFPv2)
- ASMJIT_ARM_FEATURE(VFPv3)
- ASMJIT_ARM_FEATURE(VFPv4)
- ASMJIT_ARM_FEATURE(VFP_D32)
+ ASMJIT_ARM_FEATURE(ABLE)
+ ASMJIT_ARM_FEATURE(ADERR)
ASMJIT_ARM_FEATURE(AES)
- ASMJIT_ARM_FEATURE(ALTNZCV)
+ ASMJIT_ARM_FEATURE(AFP)
+ ASMJIT_ARM_FEATURE(AIE)
+ ASMJIT_ARM_FEATURE(AMU1)
+ ASMJIT_ARM_FEATURE(AMU1_1)
+ ASMJIT_ARM_FEATURE(ANERR)
ASMJIT_ARM_FEATURE(ASIMD)
ASMJIT_ARM_FEATURE(BF16)
+ ASMJIT_ARM_FEATURE(BRBE)
ASMJIT_ARM_FEATURE(BTI)
+ ASMJIT_ARM_FEATURE(BWE)
+ ASMJIT_ARM_FEATURE(CCIDX)
+ ASMJIT_ARM_FEATURE(CHK)
+ ASMJIT_ARM_FEATURE(CLRBHB)
+ ASMJIT_ARM_FEATURE(CMOW)
+ ASMJIT_ARM_FEATURE(CONSTPACFIELD)
+ ASMJIT_ARM_FEATURE(CPA)
+ ASMJIT_ARM_FEATURE(CPA2)
ASMJIT_ARM_FEATURE(CPUID)
ASMJIT_ARM_FEATURE(CRC32)
+ ASMJIT_ARM_FEATURE(CSSC)
+ ASMJIT_ARM_FEATURE(CSV2)
+ ASMJIT_ARM_FEATURE(CSV2_3)
+ ASMJIT_ARM_FEATURE(CSV3)
+ ASMJIT_ARM_FEATURE(D128)
ASMJIT_ARM_FEATURE(DGH)
ASMJIT_ARM_FEATURE(DIT)
ASMJIT_ARM_FEATURE(DOTPROD)
+ ASMJIT_ARM_FEATURE(DPB)
+ ASMJIT_ARM_FEATURE(DPB2)
+ ASMJIT_ARM_FEATURE(EBEP)
+ ASMJIT_ARM_FEATURE(EBF16)
+ ASMJIT_ARM_FEATURE(ECBHB)
+ ASMJIT_ARM_FEATURE(ECV)
+ ASMJIT_ARM_FEATURE(EDHSR)
ASMJIT_ARM_FEATURE(EDSP)
+ ASMJIT_ARM_FEATURE(FAMINMAX)
ASMJIT_ARM_FEATURE(FCMA)
+ ASMJIT_ARM_FEATURE(FGT)
+ ASMJIT_ARM_FEATURE(FGT2)
+ ASMJIT_ARM_FEATURE(FHM)
ASMJIT_ARM_FEATURE(FLAGM)
+ ASMJIT_ARM_FEATURE(FLAGM2)
+ ASMJIT_ARM_FEATURE(FMAC)
+ ASMJIT_ARM_FEATURE(FP)
+ ASMJIT_ARM_FEATURE(FP16)
ASMJIT_ARM_FEATURE(FP16CONV)
- ASMJIT_ARM_FEATURE(FP16FML)
- ASMJIT_ARM_FEATURE(FP16FULL)
- ASMJIT_ARM_FEATURE(FRINT)
+ ASMJIT_ARM_FEATURE(FP8)
+ ASMJIT_ARM_FEATURE(FP8DOT2)
+ ASMJIT_ARM_FEATURE(FP8DOT4)
+ ASMJIT_ARM_FEATURE(FP8FMA)
+ ASMJIT_ARM_FEATURE(FPMR)
+ ASMJIT_ARM_FEATURE(FRINTTS)
+ ASMJIT_ARM_FEATURE(GCS)
+ ASMJIT_ARM_FEATURE(HACDBS)
+ ASMJIT_ARM_FEATURE(HAFDBS)
+ ASMJIT_ARM_FEATURE(HAFT)
+ ASMJIT_ARM_FEATURE(HDBSS)
+ ASMJIT_ARM_FEATURE(HBC)
+ ASMJIT_ARM_FEATURE(HCX)
+ ASMJIT_ARM_FEATURE(HPDS)
+ ASMJIT_ARM_FEATURE(HPDS2)
+ ASMJIT_ARM_FEATURE(I8MM)
ASMJIT_ARM_FEATURE(IDIVA)
ASMJIT_ARM_FEATURE(IDIVT)
+ ASMJIT_ARM_FEATURE(ITE)
+ ASMJIT_ARM_FEATURE(JSCVT)
+ ASMJIT_ARM_FEATURE(LOR)
+ ASMJIT_ARM_FEATURE(LRCPC)
+ ASMJIT_ARM_FEATURE(LRCPC2)
+ ASMJIT_ARM_FEATURE(LRCPC3)
+ ASMJIT_ARM_FEATURE(LS64)
+ ASMJIT_ARM_FEATURE(LS64_ACCDATA)
+ ASMJIT_ARM_FEATURE(LS64_V)
ASMJIT_ARM_FEATURE(LSE)
+ ASMJIT_ARM_FEATURE(LSE128)
+ ASMJIT_ARM_FEATURE(LSE2)
+ ASMJIT_ARM_FEATURE(LUT)
+ ASMJIT_ARM_FEATURE(LVA)
+ ASMJIT_ARM_FEATURE(LVA3)
+ ASMJIT_ARM_FEATURE(MEC)
+ ASMJIT_ARM_FEATURE(MOPS)
+ ASMJIT_ARM_FEATURE(MPAM)
ASMJIT_ARM_FEATURE(MTE)
- ASMJIT_ARM_FEATURE(FJCVTZS)
- ASMJIT_ARM_FEATURE(I8MM)
- ASMJIT_ARM_FEATURE(RCPC_IMMO)
- ASMJIT_ARM_FEATURE(RDM)
+ ASMJIT_ARM_FEATURE(MTE2)
+ ASMJIT_ARM_FEATURE(MTE3)
+ ASMJIT_ARM_FEATURE(MTE4)
+ ASMJIT_ARM_FEATURE(MTE_ASYM_FAULT)
+ ASMJIT_ARM_FEATURE(MTE_ASYNC)
+ ASMJIT_ARM_FEATURE(MTE_CANONICAL_TAGS)
+ ASMJIT_ARM_FEATURE(MTE_NO_ADDRESS_TAGS)
+ ASMJIT_ARM_FEATURE(MTE_PERM_S1)
+ ASMJIT_ARM_FEATURE(MTE_STORE_ONLY)
+ ASMJIT_ARM_FEATURE(MTE_TAGGED_FAR)
+ ASMJIT_ARM_FEATURE(MTPMU)
+ ASMJIT_ARM_FEATURE(NMI)
+ ASMJIT_ARM_FEATURE(NV)
+ ASMJIT_ARM_FEATURE(NV2)
+ ASMJIT_ARM_FEATURE(PAN)
+ ASMJIT_ARM_FEATURE(PAN2)
+ ASMJIT_ARM_FEATURE(PAN3)
+ ASMJIT_ARM_FEATURE(PAUTH)
+ ASMJIT_ARM_FEATURE(PFAR)
ASMJIT_ARM_FEATURE(PMU)
ASMJIT_ARM_FEATURE(PMULL)
+ ASMJIT_ARM_FEATURE(PRFMSLC)
+ ASMJIT_ARM_FEATURE(RAS)
+ ASMJIT_ARM_FEATURE(RAS1_1)
+ ASMJIT_ARM_FEATURE(RAS2)
+ ASMJIT_ARM_FEATURE(RASSA2)
+ ASMJIT_ARM_FEATURE(RDM)
+ ASMJIT_ARM_FEATURE(RME)
ASMJIT_ARM_FEATURE(RNG)
+ ASMJIT_ARM_FEATURE(RNG_TRAP)
+ ASMJIT_ARM_FEATURE(RPRES)
+ ASMJIT_ARM_FEATURE(RPRFM)
+ ASMJIT_ARM_FEATURE(S1PIE)
+ ASMJIT_ARM_FEATURE(S1POE)
+ ASMJIT_ARM_FEATURE(S2PIE)
+ ASMJIT_ARM_FEATURE(S2POE)
ASMJIT_ARM_FEATURE(SB)
+ ASMJIT_ARM_FEATURE(SCTLR2)
+ ASMJIT_ARM_FEATURE(SEBEP)
+ ASMJIT_ARM_FEATURE(SEL2)
ASMJIT_ARM_FEATURE(SHA1)
- ASMJIT_ARM_FEATURE(SHA2)
+ ASMJIT_ARM_FEATURE(SHA256)
ASMJIT_ARM_FEATURE(SHA3)
ASMJIT_ARM_FEATURE(SHA512)
ASMJIT_ARM_FEATURE(SM3)
ASMJIT_ARM_FEATURE(SM4)
+ ASMJIT_ARM_FEATURE(SME)
+ ASMJIT_ARM_FEATURE(SME2)
+ ASMJIT_ARM_FEATURE(SME2_1)
+ ASMJIT_ARM_FEATURE(SME_B16B16)
+ ASMJIT_ARM_FEATURE(SME_B16F32)
+ ASMJIT_ARM_FEATURE(SME_BI32I32)
+ ASMJIT_ARM_FEATURE(SME_F16F16)
+ ASMJIT_ARM_FEATURE(SME_F16F32)
+ ASMJIT_ARM_FEATURE(SME_F32F32)
+ ASMJIT_ARM_FEATURE(SME_F64F64)
+ ASMJIT_ARM_FEATURE(SME_F8F16)
+ ASMJIT_ARM_FEATURE(SME_F8F32)
+ ASMJIT_ARM_FEATURE(SME_FA64)
+ ASMJIT_ARM_FEATURE(SME_I16I32)
+ ASMJIT_ARM_FEATURE(SME_I16I64)
+ ASMJIT_ARM_FEATURE(SME_I8I32)
+ ASMJIT_ARM_FEATURE(SME_LUTv2)
+ ASMJIT_ARM_FEATURE(SPE)
+ ASMJIT_ARM_FEATURE(SPE1_1)
+ ASMJIT_ARM_FEATURE(SPE1_2)
+ ASMJIT_ARM_FEATURE(SPE1_3)
+ ASMJIT_ARM_FEATURE(SPE1_4)
+ ASMJIT_ARM_FEATURE(SPE_ALTCLK)
+ ASMJIT_ARM_FEATURE(SPE_CRR)
+ ASMJIT_ARM_FEATURE(SPE_EFT)
+ ASMJIT_ARM_FEATURE(SPE_FDS)
+ ASMJIT_ARM_FEATURE(SPE_FPF)
+ ASMJIT_ARM_FEATURE(SPE_SME)
+ ASMJIT_ARM_FEATURE(SPECRES)
+ ASMJIT_ARM_FEATURE(SPECRES2)
+ ASMJIT_ARM_FEATURE(SPMU)
ASMJIT_ARM_FEATURE(SSBS)
+ ASMJIT_ARM_FEATURE(SSBS2)
+ ASMJIT_ARM_FEATURE(SSVE_FP8DOT2)
+ ASMJIT_ARM_FEATURE(SSVE_FP8DOT4)
+ ASMJIT_ARM_FEATURE(SSVE_FP8FMA)
ASMJIT_ARM_FEATURE(SVE)
+ ASMJIT_ARM_FEATURE(SVE2)
+ ASMJIT_ARM_FEATURE(SVE2_1)
+ ASMJIT_ARM_FEATURE(SVE_AES)
+ ASMJIT_ARM_FEATURE(SVE_B16B16)
ASMJIT_ARM_FEATURE(SVE_BF16)
+ ASMJIT_ARM_FEATURE(SVE_BITPERM)
+ ASMJIT_ARM_FEATURE(SVE_EBF16)
ASMJIT_ARM_FEATURE(SVE_F32MM)
ASMJIT_ARM_FEATURE(SVE_F64MM)
ASMJIT_ARM_FEATURE(SVE_I8MM)
- ASMJIT_ARM_FEATURE(SVE_PMULL)
- ASMJIT_ARM_FEATURE(SVE2)
- ASMJIT_ARM_FEATURE(SVE2_AES)
- ASMJIT_ARM_FEATURE(SVE2_BITPERM)
- ASMJIT_ARM_FEATURE(SVE2_SHA3)
- ASMJIT_ARM_FEATURE(SVE2_SM4)
+ ASMJIT_ARM_FEATURE(SVE_PMULL128)
+ ASMJIT_ARM_FEATURE(SVE_SHA3)
+ ASMJIT_ARM_FEATURE(SVE_SM4)
+ ASMJIT_ARM_FEATURE(SYSINSTR128)
+ ASMJIT_ARM_FEATURE(SYSREG128)
+ ASMJIT_ARM_FEATURE(THE)
+ ASMJIT_ARM_FEATURE(TLBIOS)
+ ASMJIT_ARM_FEATURE(TLBIRANGE)
+ ASMJIT_ARM_FEATURE(TLBIW)
ASMJIT_ARM_FEATURE(TME)
+ ASMJIT_ARM_FEATURE(TRF)
+ ASMJIT_ARM_FEATURE(UAO)
+ ASMJIT_ARM_FEATURE(VFP_D32)
+ ASMJIT_ARM_FEATURE(VHE)
+ ASMJIT_ARM_FEATURE(VMID16)
+ ASMJIT_ARM_FEATURE(WFXT)
+ ASMJIT_ARM_FEATURE(XNX)
+ ASMJIT_ARM_FEATURE(XS)
#undef ASMJIT_ARM_FEATURE
};
@@ -578,19 +947,20 @@ public:
//! \name Construction & Destruction
//! \{
- inline CpuFeatures() noexcept {}
- inline CpuFeatures(const CpuFeatures& other) noexcept = default;
- inline explicit CpuFeatures(Globals::NoInit_) noexcept {}
+ ASMJIT_INLINE_NODEBUG CpuFeatures() noexcept {}
+ ASMJIT_INLINE_NODEBUG CpuFeatures(const CpuFeatures& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG explicit CpuFeatures(const Data& other) noexcept : _data{other._bits} {}
+ ASMJIT_INLINE_NODEBUG explicit CpuFeatures(Globals::NoInit_) noexcept {}
//! \}
//! \name Overloaded Operators
//! \{
- inline CpuFeatures& operator=(const CpuFeatures& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG CpuFeatures& operator=(const CpuFeatures& other) noexcept = default;
- inline bool operator==(const CpuFeatures& other) noexcept { return eq(other); }
- inline bool operator!=(const CpuFeatures& other) noexcept { return !eq(other); }
+ ASMJIT_INLINE_NODEBUG bool operator==(const CpuFeatures& other) const noexcept { return equals(other); }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const CpuFeatures& other) const noexcept { return !equals(other); }
//! \}
@@ -598,64 +968,74 @@ public:
//! \{
//! Returns true if there are no features set.
- inline bool empty() const noexcept { return _data.empty(); }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _data.empty(); }
//! Casts this base class into a derived type `T`.
template<typename T = Data>
- inline T& data() noexcept { return static_cast<T&>(_data); }
+ ASMJIT_INLINE_NODEBUG T& data() noexcept { return static_cast<T&>(_data); }
//! Casts this base class into a derived type `T` (const).
template<typename T = Data>
- inline const T& data() const noexcept { return static_cast<const T&>(_data); }
+ ASMJIT_INLINE_NODEBUG const T& data() const noexcept { return static_cast<const T&>(_data); }
//! Returns CpuFeatures::Data as \ref CpuFeatures::X86.
- inline X86& x86() noexcept { return data<X86>(); }
+ ASMJIT_INLINE_NODEBUG X86& x86() noexcept { return data<X86>(); }
//! Returns CpuFeatures::Data as \ref CpuFeatures::X86 (const).
- inline const X86& x86() const noexcept { return data<X86>(); }
+ ASMJIT_INLINE_NODEBUG const X86& x86() const noexcept { return data<X86>(); }
//! Returns CpuFeatures::Data as \ref CpuFeatures::ARM.
- inline ARM& arm() noexcept { return data<ARM>(); }
+ ASMJIT_INLINE_NODEBUG ARM& arm() noexcept { return data<ARM>(); }
//! Returns CpuFeatures::Data as \ref CpuFeatures::ARM (const).
- inline const ARM& arm() const noexcept { return data<ARM>(); }
+ ASMJIT_INLINE_NODEBUG const ARM& arm() const noexcept { return data<ARM>(); }
//! Returns all features as array of bitwords (see \ref Support::BitWord).
- inline BitWord* bits() noexcept { return _data.bits(); }
+ ASMJIT_INLINE_NODEBUG BitWord* bits() noexcept { return _data.bits(); }
//! Returns all features as array of bitwords (const).
- inline const BitWord* bits() const noexcept { return _data.bits(); }
+ ASMJIT_INLINE_NODEBUG const BitWord* bits() const noexcept { return _data.bits(); }
//! Returns the number of BitWords returned by \ref bits().
- inline size_t bitWordCount() const noexcept { return _data.bitWordCount(); }
+ ASMJIT_INLINE_NODEBUG size_t bitWordCount() const noexcept { return _data.bitWordCount(); }
//! Returns \ref Support::BitVectorIterator, that can be used to iterate over all features efficiently.
- inline Iterator iterator() const noexcept { return _data.iterator(); }
+ ASMJIT_INLINE_NODEBUG Iterator iterator() const noexcept { return _data.iterator(); }
//! Tests whether the feature `featureId` is present.
template<typename FeatureId>
- inline bool has(const FeatureId& featureId) const noexcept { return _data.has(featureId); }
+ ASMJIT_INLINE_NODEBUG bool has(const FeatureId& featureId) const noexcept { return _data.has(featureId); }
+
+ //! Tests whether any of the features is present.
+ template<typename... Args>
+ ASMJIT_INLINE_NODEBUG bool hasAny(Args&&... args) const noexcept { return _data.hasAny(std::forward<Args>(args)...); }
//! Tests whether all features as defined by `other` are present.
- inline bool hasAll(const CpuFeatures& other) const noexcept { return _data.hasAll(other._data); }
+ ASMJIT_INLINE_NODEBUG bool hasAll(const CpuFeatures& other) const noexcept { return _data.hasAll(other._data); }
//! \}
//! \name Manipulation
//! \{
- inline void reset() noexcept { _data.reset(); }
+ //! Clears all features set.
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _data.reset(); }
//! Adds the given CPU `featureId` to the list of features.
template<typename... Args>
- inline void add(Args&&... args) noexcept { return _data.add(std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG void add(Args&&... args) noexcept { return _data.add(std::forward<Args>(args)...); }
//! Adds the given CPU `featureId` to the list of features if `condition` is true.
template<typename... Args>
- inline void addIf(bool condition, Args&&... args) noexcept { return _data.addIf(condition, std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG void addIf(bool condition, Args&&... args) noexcept { return _data.addIf(condition, std::forward<Args>(args)...); }
//! Removes the given CPU `featureId` from the list of features.
template<typename... Args>
- inline void remove(Args&&... args) noexcept { return _data.remove(std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG void remove(Args&&... args) noexcept { return _data.remove(std::forward<Args>(args)...); }
//! Tests whether this CPU features matches `other`.
- inline bool eq(const CpuFeatures& other) const noexcept { return _data.eq(other._data); }
+ ASMJIT_INLINE_NODEBUG bool equals(const CpuFeatures& other) const noexcept { return _data.equals(other._data); }
+
+#if !defined(ASMJIT_NO_DEPRECATED)
+ ASMJIT_DEPRECATED("Use CpuFeatures::equals() instead")
+ ASMJIT_INLINE_NODEBUG bool eq(const CpuFeatures& other) const noexcept { return equals(other); }
+#endif // !ASMJIT_NO_DEPRECATED
//! \}
};
@@ -667,65 +1047,82 @@ public:
//! \{
//! Architecture.
- Arch _arch;
+ Arch _arch {};
//! Sub-architecture.
- SubArch _subArch;
+ SubArch _subArch {};
//! True if the CPU was detected, false if the detection failed or it's not available.
- bool _wasDetected;
+ bool _wasDetected {};
//! Reserved for future use.
- uint8_t _reserved;
+ uint8_t _reserved {};
//! CPU family ID.
- uint32_t _familyId;
+ uint32_t _familyId {};
//! CPU model ID.
- uint32_t _modelId;
+ uint32_t _modelId {};
//! CPU brand ID.
- uint32_t _brandId;
+ uint32_t _brandId {};
//! CPU stepping.
- uint32_t _stepping;
+ uint32_t _stepping {};
//! Processor type.
- uint32_t _processorType;
+ uint32_t _processorType {};
//! Maximum number of addressable IDs for logical processors.
- uint32_t _maxLogicalProcessors;
+ uint32_t _maxLogicalProcessors {};
//! Cache line size (in bytes).
- uint32_t _cacheLineSize;
+ uint32_t _cacheLineSize {};
//! Number of hardware threads.
- uint32_t _hwThreadCount;
+ uint32_t _hwThreadCount {};
//! CPU vendor string.
- FixedString<16> _vendor;
+ FixedString<16> _vendor {};
//! CPU brand string.
- FixedString<64> _brand;
+ FixedString<64> _brand {};
//! CPU features.
- CpuFeatures _features;
+ CpuFeatures _features {};
//! \}
//! \name Construction & Destruction
//! \{
- inline CpuInfo() noexcept { reset(); }
- inline CpuInfo(const CpuInfo& other) noexcept = default;
+ //! Creates a new CpuInfo instance.
+ ASMJIT_INLINE_NODEBUG CpuInfo() noexcept {}
+ //! Creates a copy of `other` instance.
+ ASMJIT_INLINE_NODEBUG CpuInfo(const CpuInfo& other) noexcept = default;
- inline explicit CpuInfo(Globals::NoInit_) noexcept
+ //! Creates an unitialized `CpuInfo` instance.
+ ASMJIT_INLINE_NODEBUG explicit CpuInfo(Globals::NoInit_) noexcept
: _features(Globals::NoInit) {};
+ //! \}
+
+ //! \name CPU Information Detection
+ //! \{
+
//! Returns the host CPU information.
+ //!
+ //! \note The returned reference is global - it's setup only once and then shared.
ASMJIT_API static const CpuInfo& host() noexcept;
- //! Initializes CpuInfo architecture and sub-architecture members to `arch` and `subArch`, respectively.
- inline void initArch(Arch arch, SubArch subArch = SubArch::kUnknown) noexcept {
- _arch = arch;
- _subArch = subArch;
- }
+ //! \}
+
+ //! \name Overloaded Operators
+ //! \{
- inline void reset() noexcept { memset(this, 0, sizeof(*this)); }
+ //! Copy assignment.
+ ASMJIT_INLINE_NODEBUG CpuInfo& operator=(const CpuInfo& other) noexcept = default;
//! \}
- //! \name Overloaded Operators
+ //! \name Initialization & Reset
//! \{
- inline CpuInfo& operator=(const CpuInfo& other) noexcept = default;
+ //! Initializes CpuInfo architecture and sub-architecture members to `arch` and `subArch`, respectively.
+ ASMJIT_INLINE_NODEBUG void initArch(Arch arch, SubArch subArch = SubArch::kUnknown) noexcept {
+ _arch = arch;
+ _subArch = subArch;
+ }
+
+ //! Resets this \ref CpuInfo to a default constructed state.
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = CpuInfo{}; }
//! \}
@@ -733,75 +1130,89 @@ public:
//! \{
//! Returns the CPU architecture this information relates to.
- inline Arch arch() const noexcept { return _arch; }
+ ASMJIT_INLINE_NODEBUG Arch arch() const noexcept { return _arch; }
//! Returns the CPU sub-architecture this information relates to.
- inline SubArch subArch() const noexcept { return _subArch; }
+ ASMJIT_INLINE_NODEBUG SubArch subArch() const noexcept { return _subArch; }
//! Returns whether the CPU was detected successfully.
//!
//! If the returned value is false it means that AsmJit either failed to detect the CPU or it doesn't have
//! implementation targeting the host architecture and operating system.
- inline bool wasDetected() const noexcept { return _wasDetected; }
+ ASMJIT_INLINE_NODEBUG bool wasDetected() const noexcept { return _wasDetected; }
//! Returns the CPU family ID.
//!
- //! Family identifier matches the FamilyId read by using CPUID on X86 architecture.
- inline uint32_t familyId() const noexcept { return _familyId; }
+ //! The information provided depends on architecture and OS:
+ //! - X86:
+ //! - Family identifier matches the FamilyId read by using CPUID.
+ //! - ARM:
+ //! - Apple - returns Apple Family identifier returned by sysctlbyname("hw.cpufamily").
+ ASMJIT_INLINE_NODEBUG uint32_t familyId() const noexcept { return _familyId; }
//! Returns the CPU model ID.
//!
- //! Family identifier matches the ModelId read by using CPUID on X86 architecture.
+ //! The information provided depends on architecture and OS:
+ //! - X86:
+ //! - Model identifier matches the ModelId read by using CPUID.
+ ASMJIT_INLINE_NODEBUG uint32_t modelId() const noexcept { return _modelId; }
- inline uint32_t modelId() const noexcept { return _modelId; }
//! Returns the CPU brand id.
//!
- //! Family identifier matches the BrandId read by using CPUID on X86 architecture.
- inline uint32_t brandId() const noexcept { return _brandId; }
+ //! The information provided depends on architecture and OS:
+ //! - X86:
+ //! - Brand identifier matches the BrandId read by using CPUID.
+ ASMJIT_INLINE_NODEBUG uint32_t brandId() const noexcept { return _brandId; }
//! Returns the CPU stepping.
//!
- //! Family identifier matches the Stepping information read by using CPUID on X86 architecture.
- inline uint32_t stepping() const noexcept { return _stepping; }
+ //! The information provided depends on architecture and OS:
+ //! - X86:
+ //! - Stepping identifier matches the Stepping information read by using CPUID.
+ ASMJIT_INLINE_NODEBUG uint32_t stepping() const noexcept { return _stepping; }
//! Returns the processor type.
//!
- //! Family identifier matches the ProcessorType read by using CPUID on X86 architecture.
- inline uint32_t processorType() const noexcept { return _processorType; }
+ //! The information provided depends on architecture and OS:
+ //! - X86:
+ //! - Processor type identifier matches the ProcessorType read by using CPUID.
+ ASMJIT_INLINE_NODEBUG uint32_t processorType() const noexcept { return _processorType; }
//! Returns the maximum number of logical processors.
- inline uint32_t maxLogicalProcessors() const noexcept { return _maxLogicalProcessors; }
+ ASMJIT_INLINE_NODEBUG uint32_t maxLogicalProcessors() const noexcept { return _maxLogicalProcessors; }
- //! Returns the size of a cache line flush.
- inline uint32_t cacheLineSize() const noexcept { return _cacheLineSize; }
+ //! Returns the size of a CPU cache line.
+ //!
+ //! On a multi-architecture system this should return the smallest cache line of all CPUs.
+ ASMJIT_INLINE_NODEBUG uint32_t cacheLineSize() const noexcept { return _cacheLineSize; }
//! Returns number of hardware threads available.
- inline uint32_t hwThreadCount() const noexcept { return _hwThreadCount; }
+ ASMJIT_INLINE_NODEBUG uint32_t hwThreadCount() const noexcept { return _hwThreadCount; }
//! Returns a CPU vendor string.
- inline const char* vendor() const noexcept { return _vendor.str; }
+ ASMJIT_INLINE_NODEBUG const char* vendor() const noexcept { return _vendor.str; }
//! Tests whether the CPU vendor string is equal to `s`.
- inline bool isVendor(const char* s) const noexcept { return _vendor.eq(s); }
+ ASMJIT_INLINE_NODEBUG bool isVendor(const char* s) const noexcept { return _vendor.equals(s); }
//! Returns a CPU brand string.
- inline const char* brand() const noexcept { return _brand.str; }
+ ASMJIT_INLINE_NODEBUG const char* brand() const noexcept { return _brand.str; }
//! Returns CPU features.
- inline CpuFeatures& features() noexcept { return _features; }
+ ASMJIT_INLINE_NODEBUG CpuFeatures& features() noexcept { return _features; }
//! Returns CPU features (const).
- inline const CpuFeatures& features() const noexcept { return _features; }
+ ASMJIT_INLINE_NODEBUG const CpuFeatures& features() const noexcept { return _features; }
//! Tests whether the CPU has the given `feature`.
template<typename FeatureId>
- inline bool hasFeature(const FeatureId& featureId) const noexcept { return _features.has(featureId); }
+ ASMJIT_INLINE_NODEBUG bool hasFeature(const FeatureId& featureId) const noexcept { return _features.has(featureId); }
//! Adds the given CPU `featureId` to the list of features.
template<typename... Args>
- inline void addFeature(Args&&... args) noexcept { return _features.add(std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG void addFeature(Args&&... args) noexcept { return _features.add(std::forward<Args>(args)...); }
//! Removes the given CPU `featureId` from the list of features.
template<typename... Args>
- inline void removeFeature(Args&&... args) noexcept { return _features.remove(std::forward<Args>(args)...); }
+ ASMJIT_INLINE_NODEBUG void removeFeature(Args&&... args) noexcept { return _features.remove(std::forward<Args>(args)...); }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/emithelper.cpp b/3rdparty/asmjit/src/asmjit/core/emithelper.cpp
index bcdf098f48b..36b984f832f 100644
--- a/3rdparty/asmjit/src/asmjit/core/emithelper.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/emithelper.cpp
@@ -61,6 +61,24 @@ static void dumpAssignment(String& sb, const FuncArgsContext& ctx) noexcept {
}
#endif
+// BaseEmitHelper - Abstract
+// =========================
+
+Error BaseEmitHelper::emitRegMove(const Operand_& dst_, const Operand_& src_, TypeId typeId, const char* comment) {
+ DebugUtils::unused(dst_, src_, typeId, comment);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+Error BaseEmitHelper::emitRegSwap(const BaseReg& a, const BaseReg& b, const char* comment) {
+ DebugUtils::unused(a, b, comment);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+Error BaseEmitHelper::emitArgMove(const BaseReg& dst_, TypeId dstTypeId, const Operand_& src_, TypeId srcTypeId, const char* comment) {
+ DebugUtils::unused(dst_, dstTypeId, src_, srcTypeId, comment);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
// BaseEmitHelper - EmitArgsAssignment
// ===================================
@@ -198,14 +216,17 @@ ASMJIT_FAVOR_SIZE Error BaseEmitHelper::emitArgsAssignment(const FuncFrame& fram
}
else {
WorkData& wd = workData[outGroup];
- if (!wd.isAssigned(outId)) {
+ if (!wd.isAssigned(outId) || curId == outId) {
EmitMove:
ASMJIT_PROPAGATE(
emitArgMove(
BaseReg(archTraits.regTypeToSignature(out.regType()), outId), out.typeId(),
BaseReg(archTraits.regTypeToSignature(cur.regType()), curId), cur.typeId()));
- wd.reassign(varId, outId, curId);
+ // Only reassign if this is not a sign/zero extension that happens on the same in/out register.
+ if (curId != outId)
+ wd.reassign(varId, outId, curId);
+
cur.initReg(out.regType(), outId, out.typeId());
if (outId == out.regId())
diff --git a/3rdparty/asmjit/src/asmjit/core/emithelper_p.h b/3rdparty/asmjit/src/asmjit/core/emithelper_p.h
index 0333959e144..0f4a2f3ece4 100644
--- a/3rdparty/asmjit/src/asmjit/core/emithelper_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/emithelper_p.h
@@ -21,22 +21,22 @@ class BaseEmitHelper {
public:
BaseEmitter* _emitter;
- inline explicit BaseEmitHelper(BaseEmitter* emitter = nullptr) noexcept
+ ASMJIT_INLINE_NODEBUG explicit BaseEmitHelper(BaseEmitter* emitter = nullptr) noexcept
: _emitter(emitter) {}
- inline BaseEmitter* emitter() const noexcept { return _emitter; }
- inline void setEmitter(BaseEmitter* emitter) noexcept { _emitter = emitter; }
+ ASMJIT_INLINE_NODEBUG BaseEmitter* emitter() const noexcept { return _emitter; }
+ ASMJIT_INLINE_NODEBUG void setEmitter(BaseEmitter* emitter) noexcept { _emitter = emitter; }
//! Emits a pure move operation between two registers or the same type or between a register and its home
//! slot. This function does not handle register conversion.
virtual Error emitRegMove(
const Operand_& dst_,
- const Operand_& src_, TypeId typeId, const char* comment = nullptr) = 0;
+ const Operand_& src_, TypeId typeId, const char* comment = nullptr);
//! Emits swap between two registers.
virtual Error emitRegSwap(
const BaseReg& a,
- const BaseReg& b, const char* comment = nullptr) = 0;
+ const BaseReg& b, const char* comment = nullptr);
//! Emits move from a function argument (either register or stack) to a register.
//!
@@ -45,7 +45,7 @@ public:
//! (for example conversion from K to MMX on X86/X64) will fail.
virtual Error emitArgMove(
const BaseReg& dst_, TypeId dstTypeId,
- const Operand_& src_, TypeId srcTypeId, const char* comment = nullptr) = 0;
+ const Operand_& src_, TypeId srcTypeId, const char* comment = nullptr);
Error emitArgsAssignment(const FuncFrame& frame, const FuncArgsAssignment& args);
};
diff --git a/3rdparty/asmjit/src/asmjit/core/emitter.cpp b/3rdparty/asmjit/src/asmjit/core/emitter.cpp
index 92d67a7e5b5..4c855ea5688 100644
--- a/3rdparty/asmjit/src/asmjit/core/emitter.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/emitter.cpp
@@ -125,13 +125,39 @@ Error BaseEmitter::reportError(Error err, const char* message) {
return err;
}
+// BaseEmitter - Sections
+// ======================
+
+// [[pure virtual]]
+Error BaseEmitter::section(Section* section) {
+ DebugUtils::unused(section);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
// BaseEmitter - Labels
// ====================
+// [[pure virtual]]
+Label BaseEmitter::newLabel() {
+ return Label(Globals::kInvalidId);
+}
+
+// [[pure virtual]]
+Label BaseEmitter::newNamedLabel(const char* name, size_t nameSize, LabelType type, uint32_t parentId) {
+ DebugUtils::unused(name, nameSize, type, parentId);
+ return Label(Globals::kInvalidId);
+}
+
Label BaseEmitter::labelByName(const char* name, size_t nameSize, uint32_t parentId) noexcept {
return Label(_code ? _code->labelIdByName(name, nameSize, parentId) : Globals::kInvalidId);
}
+// [[pure virtual]]
+Error BaseEmitter::bind(const Label& label) {
+ DebugUtils::unused(label);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
bool BaseEmitter::isLabelValid(uint32_t labelId) const noexcept {
return _code && labelId < _code->labelCount();
}
@@ -172,6 +198,12 @@ Error BaseEmitter::_emitI(InstId instId, const Operand_& o0, const Operand_& o1,
return _emit(instId, o0, o1, o2, opExt);
}
+// [[pure virtual]]
+Error BaseEmitter::_emit(InstId instId, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_* oExt) {
+ DebugUtils::unused(instId, o0, o1, o2, oExt);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
Error BaseEmitter::_emitOpArray(InstId instId, const Operand_* operands, size_t opCount) {
const Operand_* op = operands;
Operand_ opExt[3];
@@ -233,9 +265,57 @@ Error BaseEmitter::emitArgsAssignment(const FuncFrame& frame, const FuncArgsAssi
return _funcs.emitArgsAssignment(this, frame, args);
}
+// BaseEmitter - Align
+// ===================
+
+// [[pure virtual]]
+Error BaseEmitter::align(AlignMode alignMode, uint32_t alignment) {
+ DebugUtils::unused(alignMode, alignment);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// BaseEmitter - Embed
+// ===================
+
+// [[pure virtual]]
+Error BaseEmitter::embed(const void* data, size_t dataSize) {
+ DebugUtils::unused(data, dataSize);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// [[pure virtual]]
+Error BaseEmitter::embedDataArray(TypeId typeId, const void* data, size_t itemCount, size_t repeatCount) {
+ DebugUtils::unused(typeId, data, itemCount, repeatCount);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// [[pure virtual]]
+Error BaseEmitter::embedConstPool(const Label& label, const ConstPool& pool) {
+ DebugUtils::unused(label, pool);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// [[pure virtual]]
+Error BaseEmitter::embedLabel(const Label& label, size_t dataSize) {
+ DebugUtils::unused(label, dataSize);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// [[pure virtual]]
+Error BaseEmitter::embedLabelDelta(const Label& label, const Label& base, size_t dataSize) {
+ DebugUtils::unused(label, base, dataSize);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
// BaseEmitter - Comment
// =====================
+// [[pure virtual]]
+Error BaseEmitter::comment(const char* data, size_t size) {
+ DebugUtils::unused(data, size);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
Error BaseEmitter::commentf(const char* fmt, ...) {
if (!hasEmitterFlag(EmitterFlags::kLogComments)) {
if (!hasEmitterFlag(EmitterFlags::kAttached))
@@ -304,6 +384,7 @@ Error BaseEmitter::onDetach(CodeHolder* code) noexcept {
_errorHandler = nullptr;
_clearEmitterFlags(~kEmitterPreservedFlags);
+ _instructionAlignment = uint8_t(0);
_forcedInstOptions = InstOptions::kReserved;
_privateData = 0;
@@ -313,6 +394,7 @@ Error BaseEmitter::onDetach(CodeHolder* code) noexcept {
_instOptions = InstOptions::kNone;
_extraReg.reset();
_inlineComment = nullptr;
+ _funcs.reset();
return kErrorOk;
}
diff --git a/3rdparty/asmjit/src/asmjit/core/emitter.h b/3rdparty/asmjit/src/asmjit/core/emitter.h
index b8afd6b8e06..3053721c9c6 100644
--- a/3rdparty/asmjit/src/asmjit/core/emitter.h
+++ b/3rdparty/asmjit/src/asmjit/core/emitter.h
@@ -194,6 +194,7 @@ ASMJIT_DEFINE_ENUM_FLAGS(DiagnosticOptions)
class ASMJIT_VIRTAPI BaseEmitter {
public:
ASMJIT_BASE_CLASS(BaseEmitter)
+ ASMJIT_NONCOPYABLE(BaseEmitter)
//! \name Members
//! \{
@@ -202,6 +203,11 @@ public:
EmitterType _emitterType = EmitterType::kNone;
//! See \ref EmitterFlags.
EmitterFlags _emitterFlags = EmitterFlags::kNone;
+ //! Instruction alignment.
+ uint8_t _instructionAlignment = 0u;
+ //! \cond
+ uint8_t _reservedBaseEmitter = 0u;
+ //! \endcond
//! Validation flags in case validation is used.
//!
//! \note Validation flags are specific to the emitter and they are setup at construction time and then never
@@ -233,6 +239,13 @@ public:
//! Native GP register signature and signature related information.
OperandSignature _gpSignature {};
+ //! Emitter state that can be used to specify options and inline comment of a next node or instruction.
+ struct State {
+ InstOptions options;
+ RegOnly extraReg;
+ const char* comment;
+ };
+
//! Next instruction options (affects the next instruction).
InstOptions _instOptions = InstOptions::kNone;
//! Extra register (op-mask {k} on AVX-512) (affects the next instruction).
@@ -255,7 +268,7 @@ public:
Arch arch,
const BaseInst& inst, const Operand_* operands, size_t opCount) ASMJIT_NOEXCEPT_TYPE;
- typedef Error (ASMJIT_CDECL* ValidateFunc)(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) ASMJIT_NOEXCEPT_TYPE;
+ typedef Error (ASMJIT_CDECL* ValidateFunc)(const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) ASMJIT_NOEXCEPT_TYPE;
//! Emit prolog implementation.
EmitProlog emitProlog;
@@ -269,7 +282,7 @@ public:
ValidateFunc validate;
//! Resets all functions to nullptr.
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
emitProlog = nullptr;
emitEpilog = nullptr;
emitArgsAssignment = nullptr;
@@ -293,10 +306,10 @@ public:
//! \{
template<typename T>
- inline T* as() noexcept { return reinterpret_cast<T*>(this); }
+ ASMJIT_INLINE_NODEBUG T* as() noexcept { return reinterpret_cast<T*>(this); }
template<typename T>
- inline const T* as() const noexcept { return reinterpret_cast<const T*>(this); }
+ ASMJIT_INLINE_NODEBUG const T* as() const noexcept { return reinterpret_cast<const T*>(this); }
//! \}
@@ -304,54 +317,72 @@ public:
//! \{
//! Returns the type of this emitter, see `EmitterType`.
- inline EmitterType emitterType() const noexcept { return _emitterType; }
+ ASMJIT_INLINE_NODEBUG EmitterType emitterType() const noexcept { return _emitterType; }
//! Returns emitter flags , see `Flags`.
- inline EmitterFlags emitterFlags() const noexcept { return _emitterFlags; }
+ ASMJIT_INLINE_NODEBUG EmitterFlags emitterFlags() const noexcept { return _emitterFlags; }
//! Tests whether the emitter inherits from `BaseAssembler`.
- inline bool isAssembler() const noexcept { return _emitterType == EmitterType::kAssembler; }
+ ASMJIT_INLINE_NODEBUG bool isAssembler() const noexcept { return _emitterType == EmitterType::kAssembler; }
//! Tests whether the emitter inherits from `BaseBuilder`.
//!
//! \note Both Builder and Compiler emitters would return `true`.
- inline bool isBuilder() const noexcept { return uint32_t(_emitterType) >= uint32_t(EmitterType::kBuilder); }
+ ASMJIT_INLINE_NODEBUG bool isBuilder() const noexcept { return uint32_t(_emitterType) >= uint32_t(EmitterType::kBuilder); }
//! Tests whether the emitter inherits from `BaseCompiler`.
- inline bool isCompiler() const noexcept { return _emitterType == EmitterType::kCompiler; }
+ ASMJIT_INLINE_NODEBUG bool isCompiler() const noexcept { return _emitterType == EmitterType::kCompiler; }
//! Tests whether the emitter has the given `flag` enabled.
- inline bool hasEmitterFlag(EmitterFlags flag) const noexcept { return Support::test(_emitterFlags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasEmitterFlag(EmitterFlags flag) const noexcept { return Support::test(_emitterFlags, flag); }
//! Tests whether the emitter is finalized.
- inline bool isFinalized() const noexcept { return hasEmitterFlag(EmitterFlags::kFinalized); }
+ ASMJIT_INLINE_NODEBUG bool isFinalized() const noexcept { return hasEmitterFlag(EmitterFlags::kFinalized); }
//! Tests whether the emitter is destroyed (only used during destruction).
- inline bool isDestroyed() const noexcept { return hasEmitterFlag(EmitterFlags::kDestroyed); }
+ ASMJIT_INLINE_NODEBUG bool isDestroyed() const noexcept { return hasEmitterFlag(EmitterFlags::kDestroyed); }
+
+ //! \}
+
+ //! \cond INTERNAL
+ //! \name Internal Functions
+ //! \{
- inline void _addEmitterFlags(EmitterFlags flags) noexcept { _emitterFlags |= flags; }
- inline void _clearEmitterFlags(EmitterFlags flags) noexcept { _emitterFlags &= _emitterFlags & ~flags; }
+ ASMJIT_INLINE_NODEBUG void _addEmitterFlags(EmitterFlags flags) noexcept { _emitterFlags |= flags; }
+ ASMJIT_INLINE_NODEBUG void _clearEmitterFlags(EmitterFlags flags) noexcept { _emitterFlags &= _emitterFlags & ~flags; }
//! \}
+ //! \endcond
//! \name Target Information
//! \{
//! Returns the CodeHolder this emitter is attached to.
- inline CodeHolder* code() const noexcept { return _code; }
+ ASMJIT_INLINE_NODEBUG CodeHolder* code() const noexcept { return _code; }
//! Returns the target environment.
//!
//! The returned \ref Environment reference matches \ref CodeHolder::environment().
- inline const Environment& environment() const noexcept { return _environment; }
+ ASMJIT_INLINE_NODEBUG const Environment& environment() const noexcept { return _environment; }
//! Tests whether the target architecture is 32-bit.
- inline bool is32Bit() const noexcept { return environment().is32Bit(); }
+ ASMJIT_INLINE_NODEBUG bool is32Bit() const noexcept { return environment().is32Bit(); }
//! Tests whether the target architecture is 64-bit.
- inline bool is64Bit() const noexcept { return environment().is64Bit(); }
+ ASMJIT_INLINE_NODEBUG bool is64Bit() const noexcept { return environment().is64Bit(); }
//! Returns the target architecture type.
- inline Arch arch() const noexcept { return environment().arch(); }
+ ASMJIT_INLINE_NODEBUG Arch arch() const noexcept { return environment().arch(); }
//! Returns the target architecture sub-type.
- inline SubArch subArch() const noexcept { return environment().subArch(); }
+ ASMJIT_INLINE_NODEBUG SubArch subArch() const noexcept { return environment().subArch(); }
//! Returns the target architecture's GP register size (4 or 8 bytes).
- inline uint32_t registerSize() const noexcept { return environment().registerSize(); }
+ ASMJIT_INLINE_NODEBUG uint32_t registerSize() const noexcept { return environment().registerSize(); }
+
+ //! Returns a signature of a native general purpose register (either 32-bit or 64-bit depending on the architecture).
+ ASMJIT_INLINE_NODEBUG OperandSignature gpSignature() const noexcept { return _gpSignature; }
+
+ //! Returns instruction alignment.
+ //!
+ //! The following values are returned based on the target architecture:
+ //! - X86 and X86_64 - instruction alignment is 1
+ //! - AArch32 - instruction alignment is 4 in A32 mode and 2 in THUMB mode.
+ //! - AArch64 - instruction alignment is 4
+ ASMJIT_INLINE_NODEBUG uint32_t instructionAlignment() const noexcept { return _instructionAlignment; }
//! \}
@@ -359,7 +390,7 @@ public:
//! \{
//! Tests whether the emitter is initialized (i.e. attached to \ref CodeHolder).
- inline bool isInitialized() const noexcept { return _code != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool isInitialized() const noexcept { return _code != nullptr; }
//! Finalizes this emitter.
//!
@@ -376,19 +407,19 @@ public:
//! \{
//! Tests whether the emitter has a logger.
- inline bool hasLogger() const noexcept { return _logger != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasLogger() const noexcept { return _logger != nullptr; }
//! Tests whether the emitter has its own logger.
//!
//! Own logger means that it overrides the possible logger that may be used by \ref CodeHolder this emitter is
//! attached to.
- inline bool hasOwnLogger() const noexcept { return hasEmitterFlag(EmitterFlags::kOwnLogger); }
+ ASMJIT_INLINE_NODEBUG bool hasOwnLogger() const noexcept { return hasEmitterFlag(EmitterFlags::kOwnLogger); }
//! Returns the logger this emitter uses.
//!
//! The returned logger is either the emitter's own logger or it's logger used by \ref CodeHolder this emitter
//! is attached to.
- inline Logger* logger() const noexcept { return _logger; }
+ ASMJIT_INLINE_NODEBUG Logger* logger() const noexcept { return _logger; }
//! Sets or resets the logger of the emitter.
//!
@@ -401,7 +432,7 @@ public:
//!
//! The emitter will bail to using a logger attached to \ref CodeHolder this emitter is attached to, or no logger
//! at all if \ref CodeHolder doesn't have one.
- inline void resetLogger() noexcept { return setLogger(nullptr); }
+ ASMJIT_INLINE_NODEBUG void resetLogger() noexcept { return setLogger(nullptr); }
//! \}
@@ -409,25 +440,25 @@ public:
//! \{
//! Tests whether the emitter has an error handler attached.
- inline bool hasErrorHandler() const noexcept { return _errorHandler != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasErrorHandler() const noexcept { return _errorHandler != nullptr; }
//! Tests whether the emitter has its own error handler.
//!
//! Own error handler means that it overrides the possible error handler that may be used by \ref CodeHolder this
//! emitter is attached to.
- inline bool hasOwnErrorHandler() const noexcept { return hasEmitterFlag(EmitterFlags::kOwnErrorHandler); }
+ ASMJIT_INLINE_NODEBUG bool hasOwnErrorHandler() const noexcept { return hasEmitterFlag(EmitterFlags::kOwnErrorHandler); }
//! Returns the error handler this emitter uses.
//!
//! The returned error handler is either the emitter's own error handler or it's error handler used by
//! \ref CodeHolder this emitter is attached to.
- inline ErrorHandler* errorHandler() const noexcept { return _errorHandler; }
+ ASMJIT_INLINE_NODEBUG ErrorHandler* errorHandler() const noexcept { return _errorHandler; }
//! Sets or resets the error handler of the emitter.
ASMJIT_API void setErrorHandler(ErrorHandler* errorHandler) noexcept;
//! Resets the error handler.
- inline void resetErrorHandler() noexcept { setErrorHandler(nullptr); }
+ ASMJIT_INLINE_NODEBUG void resetErrorHandler() noexcept { setErrorHandler(nullptr); }
//! Handles the given error in the following way:
//! 1. If the emitter has \ref ErrorHandler attached, it calls its \ref ErrorHandler::handleError() member function
@@ -441,14 +472,14 @@ public:
//! \{
//! Returns encoding options.
- inline EncodingOptions encodingOptions() const noexcept { return _encodingOptions; }
+ ASMJIT_INLINE_NODEBUG EncodingOptions encodingOptions() const noexcept { return _encodingOptions; }
//! Tests whether the encoding `option` is set.
- inline bool hasEncodingOption(EncodingOptions option) const noexcept { return Support::test(_encodingOptions, option); }
+ ASMJIT_INLINE_NODEBUG bool hasEncodingOption(EncodingOptions option) const noexcept { return Support::test(_encodingOptions, option); }
//! Enables the given encoding `options`.
- inline void addEncodingOptions(EncodingOptions options) noexcept { _encodingOptions |= options; }
+ ASMJIT_INLINE_NODEBUG void addEncodingOptions(EncodingOptions options) noexcept { _encodingOptions |= options; }
//! Disables the given encoding `options`.
- inline void clearEncodingOptions(EncodingOptions options) noexcept { _encodingOptions &= ~options; }
+ ASMJIT_INLINE_NODEBUG void clearEncodingOptions(EncodingOptions options) noexcept { _encodingOptions &= ~options; }
//! \}
@@ -456,10 +487,10 @@ public:
//! \{
//! Returns the emitter's diagnostic options.
- inline DiagnosticOptions diagnosticOptions() const noexcept { return _diagnosticOptions; }
+ ASMJIT_INLINE_NODEBUG DiagnosticOptions diagnosticOptions() const noexcept { return _diagnosticOptions; }
//! Tests whether the given `option` is present in the emitter's diagnostic options.
- inline bool hasDiagnosticOption(DiagnosticOptions option) const noexcept { return Support::test(_diagnosticOptions, option); }
+ ASMJIT_INLINE_NODEBUG bool hasDiagnosticOption(DiagnosticOptions option) const noexcept { return Support::test(_diagnosticOptions, option); }
//! Activates the given diagnostic `options`.
//!
@@ -496,44 +527,76 @@ public:
//! Forced instruction options are merged with next instruction options before the instruction is encoded. These
//! options have some bits reserved that are used by error handling, logging, and instruction validation purposes.
//! Other options are globals that affect each instruction.
- inline InstOptions forcedInstOptions() const noexcept { return _forcedInstOptions; }
+ ASMJIT_INLINE_NODEBUG InstOptions forcedInstOptions() const noexcept { return _forcedInstOptions; }
//! Returns options of the next instruction.
- inline InstOptions instOptions() const noexcept { return _instOptions; }
+ ASMJIT_INLINE_NODEBUG InstOptions instOptions() const noexcept { return _instOptions; }
//! Returns options of the next instruction.
- inline void setInstOptions(InstOptions options) noexcept { _instOptions = options; }
+ ASMJIT_INLINE_NODEBUG void setInstOptions(InstOptions options) noexcept { _instOptions = options; }
//! Adds options of the next instruction.
- inline void addInstOptions(InstOptions options) noexcept { _instOptions |= options; }
+ ASMJIT_INLINE_NODEBUG void addInstOptions(InstOptions options) noexcept { _instOptions |= options; }
//! Resets options of the next instruction.
- inline void resetInstOptions() noexcept { _instOptions = InstOptions::kNone; }
+ ASMJIT_INLINE_NODEBUG void resetInstOptions() noexcept { _instOptions = InstOptions::kNone; }
//! Tests whether the extra register operand is valid.
- inline bool hasExtraReg() const noexcept { return _extraReg.isReg(); }
+ ASMJIT_INLINE_NODEBUG bool hasExtraReg() const noexcept { return _extraReg.isReg(); }
//! Returns an extra operand that will be used by the next instruction (architecture specific).
- inline const RegOnly& extraReg() const noexcept { return _extraReg; }
+ ASMJIT_INLINE_NODEBUG const RegOnly& extraReg() const noexcept { return _extraReg; }
//! Sets an extra operand that will be used by the next instruction (architecture specific).
- inline void setExtraReg(const BaseReg& reg) noexcept { _extraReg.init(reg); }
+ ASMJIT_INLINE_NODEBUG void setExtraReg(const BaseReg& reg) noexcept { _extraReg.init(reg); }
//! Sets an extra operand that will be used by the next instruction (architecture specific).
- inline void setExtraReg(const RegOnly& reg) noexcept { _extraReg.init(reg); }
+ ASMJIT_INLINE_NODEBUG void setExtraReg(const RegOnly& reg) noexcept { _extraReg.init(reg); }
//! Resets an extra operand that will be used by the next instruction (architecture specific).
- inline void resetExtraReg() noexcept { _extraReg.reset(); }
+ ASMJIT_INLINE_NODEBUG void resetExtraReg() noexcept { _extraReg.reset(); }
//! Returns comment/annotation of the next instruction.
- inline const char* inlineComment() const noexcept { return _inlineComment; }
+ ASMJIT_INLINE_NODEBUG const char* inlineComment() const noexcept { return _inlineComment; }
//! Sets comment/annotation of the next instruction.
//!
//! \note This string is set back to null by `_emit()`, but until that it has to remain valid as the Emitter is not
//! required to make a copy of it (and it would be slow to do that for each instruction).
- inline void setInlineComment(const char* s) noexcept { _inlineComment = s; }
+ ASMJIT_INLINE_NODEBUG void setInlineComment(const char* s) noexcept { _inlineComment = s; }
//! Resets the comment/annotation to nullptr.
- inline void resetInlineComment() noexcept { _inlineComment = nullptr; }
+ ASMJIT_INLINE_NODEBUG void resetInlineComment() noexcept { _inlineComment = nullptr; }
+
+ //! \}
+
+ //! \name Emitter State
+ //! \{
+
+ //! Resets the emitter state, which contains instruction options, extra register, and inline comment.
+ //!
+ //! Emitter can have a state that describes instruction options and extra register used by the instruction. Most
+ //! instructions don't need nor use the state, however, if an instruction uses a prefix such as REX or REP prefix,
+ //! which is set explicitly, then the state would contain it. This allows to mimic the syntax of assemblers such
+ //! as X86. For example `rep().movs(...)` would map to a `REP MOVS` instuction on X86. The same applies to various
+ //! hints and the use of a mask register in AVX-512 mode.
+ ASMJIT_INLINE_NODEBUG void resetState() noexcept {
+ resetInstOptions();
+ resetExtraReg();
+ resetInlineComment();
+ }
+
+ //! \cond INTERNAL
+
+ //! Grabs the current emitter state and resets the emitter state at the same time, returning the state the emitter
+ //! had before the state was reset.
+ ASMJIT_INLINE_NODEBUG State _grabState() noexcept {
+ State s{_instOptions | _forcedInstOptions, _extraReg, _inlineComment};
+ resetState();
+ return s;
+ }
+ //! \endcond
//! \}
//! \name Sections
//! \{
- virtual Error section(Section* section) = 0;
+ //! Switches the given `section`.
+ //!
+ //! Once switched, everything is added to the given `section`.
+ ASMJIT_API virtual Error section(Section* section);
//! \}
@@ -541,14 +604,14 @@ public:
//! \{
//! Creates a new label.
- virtual Label newLabel() = 0;
+ ASMJIT_API virtual Label newLabel();
//! Creates a new named label.
- virtual Label newNamedLabel(const char* name, size_t nameSize = SIZE_MAX, LabelType type = LabelType::kGlobal, uint32_t parentId = Globals::kInvalidId) = 0;
+ ASMJIT_API virtual Label newNamedLabel(const char* name, size_t nameSize = SIZE_MAX, LabelType type = LabelType::kGlobal, uint32_t parentId = Globals::kInvalidId);
//! Creates a new anonymous label with a name, which can only be used for debugging purposes.
- inline Label newAnonymousLabel(const char* name, size_t nameSize = SIZE_MAX) { return newNamedLabel(name, nameSize, LabelType::kAnonymous); }
+ ASMJIT_INLINE_NODEBUG Label newAnonymousLabel(const char* name, size_t nameSize = SIZE_MAX) { return newNamedLabel(name, nameSize, LabelType::kAnonymous); }
//! Creates a new external label.
- inline Label newExternalLabel(const char* name, size_t nameSize = SIZE_MAX) { return newNamedLabel(name, nameSize, LabelType::kExternal); }
+ ASMJIT_INLINE_NODEBUG Label newExternalLabel(const char* name, size_t nameSize = SIZE_MAX) { return newNamedLabel(name, nameSize, LabelType::kExternal); }
//! Returns `Label` by `name`.
//!
@@ -561,12 +624,12 @@ public:
//! Binds the `label` to the current position of the current section.
//!
//! \note Attempt to bind the same label multiple times will return an error.
- virtual Error bind(const Label& label) = 0;
+ ASMJIT_API virtual Error bind(const Label& label);
//! Tests whether the label `id` is valid (i.e. registered).
ASMJIT_API bool isLabelValid(uint32_t labelId) const noexcept;
//! Tests whether the `label` is valid (i.e. registered).
- inline bool isLabelValid(const Label& label) const noexcept { return isLabelValid(label.id()); }
+ ASMJIT_INLINE_NODEBUG bool isLabelValid(const Label& label) const noexcept { return isLabelValid(label.id()); }
//! \}
@@ -596,35 +659,51 @@ public:
ASMJIT_API Error _emitI(InstId instId, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3, const Operand_& o4, const Operand_& o5);
//! Emits an instruction `instId` with the given `operands`.
+ //!
+ //! This is the most universal way of emitting code, which accepts an instruction identifier and instruction
+ //! operands. This is called an "unchecked" API as emit doesn't provide any type checks at compile-time. This
+ //! allows to emit instruction with just \ref Operand instances, which could be handy in some cases - for
+ //! example emitting generic code where you don't know whether some operand is register, memory, or immediate.
template<typename... Args>
- ASMJIT_FORCE_INLINE Error emit(InstId instId, Args&&... operands) {
+ ASMJIT_INLINE_NODEBUG Error emit(InstId instId, Args&&... operands) {
return _emitI(instId, Support::ForwardOp<Args>::forward(operands)...);
}
- ASMJIT_FORCE_INLINE Error emitOpArray(InstId instId, const Operand_* operands, size_t opCount) {
+ //! Similar to \ref emit(), but uses array of `operands` instead.
+ ASMJIT_INLINE_NODEBUG Error emitOpArray(InstId instId, const Operand_* operands, size_t opCount) {
return _emitOpArray(instId, operands, opCount);
}
+ //! Similar to \ref emit(), but emits instruction with both instruction options and extra register, followed
+ //! by an array of `operands`.
ASMJIT_FORCE_INLINE Error emitInst(const BaseInst& inst, const Operand_* operands, size_t opCount) {
setInstOptions(inst.options());
setExtraReg(inst.extraReg());
return _emitOpArray(inst.id(), operands, opCount);
}
+ //! \}
+
//! \cond INTERNAL
+ //! \name Emit Internals
+ //! \{
+
//! Emits an instruction - all 6 operands must be defined.
- virtual Error _emit(InstId instId, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_* oExt) = 0;
+ ASMJIT_API virtual Error _emit(InstId instId, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_* oExt);
//! Emits instruction having operands stored in array.
ASMJIT_API virtual Error _emitOpArray(InstId instId, const Operand_* operands, size_t opCount);
- //! \endcond
//! \}
+ //! \endcond
//! \name Emit Utilities
//! \{
+ //! Emits a function prolog described by the given function `frame`.
ASMJIT_API Error emitProlog(const FuncFrame& frame);
+ //! Emits a function epilog described by the given function `frame`.
ASMJIT_API Error emitEpilog(const FuncFrame& frame);
+ //! Emits code that reassigns function `frame` arguments to the given `args`.
ASMJIT_API Error emitArgsAssignment(const FuncFrame& frame, const FuncArgsAssignment& args);
//! \}
@@ -637,7 +716,7 @@ public:
//! The sequence that is used to fill the gap between the aligned location and the current location depends on the
//! align `mode`, see \ref AlignMode. The `alignment` argument specifies alignment in bytes, so for example when
//! it's `32` it means that the code buffer will be aligned to `32` bytes.
- virtual Error align(AlignMode alignMode, uint32_t alignment) = 0;
+ ASMJIT_API virtual Error align(AlignMode alignMode, uint32_t alignment);
//! \}
@@ -645,7 +724,7 @@ public:
//! \{
//! Embeds raw data into the \ref CodeBuffer.
- virtual Error embed(const void* data, size_t dataSize) = 0;
+ ASMJIT_API virtual Error embed(const void* data, size_t dataSize);
//! Embeds a typed data array.
//!
@@ -656,44 +735,44 @@ public:
//!
//! - Repeat the given data `repeatCount` times, so the data can be used as a fill pattern for example, or as a
//! pattern used by SIMD instructions.
- virtual Error embedDataArray(TypeId typeId, const void* data, size_t itemCount, size_t repeatCount = 1) = 0;
+ ASMJIT_API virtual Error embedDataArray(TypeId typeId, const void* data, size_t itemCount, size_t repeatCount = 1);
//! Embeds int8_t `value` repeated by `repeatCount`.
- inline Error embedInt8(int8_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kInt8, &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedInt8(int8_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kInt8, &value, 1, repeatCount); }
//! Embeds uint8_t `value` repeated by `repeatCount`.
- inline Error embedUInt8(uint8_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kUInt8, &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedUInt8(uint8_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kUInt8, &value, 1, repeatCount); }
//! Embeds int16_t `value` repeated by `repeatCount`.
- inline Error embedInt16(int16_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kInt16, &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedInt16(int16_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kInt16, &value, 1, repeatCount); }
//! Embeds uint16_t `value` repeated by `repeatCount`.
- inline Error embedUInt16(uint16_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kUInt16, &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedUInt16(uint16_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kUInt16, &value, 1, repeatCount); }
//! Embeds int32_t `value` repeated by `repeatCount`.
- inline Error embedInt32(int32_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kInt32, &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedInt32(int32_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kInt32, &value, 1, repeatCount); }
//! Embeds uint32_t `value` repeated by `repeatCount`.
- inline Error embedUInt32(uint32_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kUInt32, &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedUInt32(uint32_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kUInt32, &value, 1, repeatCount); }
//! Embeds int64_t `value` repeated by `repeatCount`.
- inline Error embedInt64(int64_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kInt64, &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedInt64(int64_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kInt64, &value, 1, repeatCount); }
//! Embeds uint64_t `value` repeated by `repeatCount`.
- inline Error embedUInt64(uint64_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kUInt64, &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedUInt64(uint64_t value, size_t repeatCount = 1) { return embedDataArray(TypeId::kUInt64, &value, 1, repeatCount); }
//! Embeds a floating point `value` repeated by `repeatCount`.
- inline Error embedFloat(float value, size_t repeatCount = 1) { return embedDataArray(TypeId(TypeUtils::TypeIdOfT<float>::kTypeId), &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedFloat(float value, size_t repeatCount = 1) { return embedDataArray(TypeId(TypeUtils::TypeIdOfT<float>::kTypeId), &value, 1, repeatCount); }
//! Embeds a floating point `value` repeated by `repeatCount`.
- inline Error embedDouble(double value, size_t repeatCount = 1) { return embedDataArray(TypeId(TypeUtils::TypeIdOfT<double>::kTypeId), &value, 1, repeatCount); }
+ ASMJIT_INLINE_NODEBUG Error embedDouble(double value, size_t repeatCount = 1) { return embedDataArray(TypeId(TypeUtils::TypeIdOfT<double>::kTypeId), &value, 1, repeatCount); }
//! Embeds a constant pool at the current offset by performing the following:
//! 1. Aligns by using AlignMode::kData to the minimum `pool` alignment.
//! 2. Binds the ConstPool label so it's bound to an aligned location.
//! 3. Emits ConstPool content.
- virtual Error embedConstPool(const Label& label, const ConstPool& pool) = 0;
+ ASMJIT_API virtual Error embedConstPool(const Label& label, const ConstPool& pool);
//! Embeds an absolute `label` address as data.
//!
//! The `dataSize` is an optional argument that can be used to specify the size of the address data. If it's zero
//! (default) the address size is deduced from the target architecture (either 4 or 8 bytes).
- virtual Error embedLabel(const Label& label, size_t dataSize = 0) = 0;
+ ASMJIT_API virtual Error embedLabel(const Label& label, size_t dataSize = 0);
//! Embeds a delta (distance) between the `label` and `base` calculating it as `label - base`. This function was
//! designed to make it easier to embed lookup tables where each index is a relative distance of two labels.
- virtual Error embedLabelDelta(const Label& label, const Label& base, size_t dataSize = 0) = 0;
+ ASMJIT_API virtual Error embedLabelDelta(const Label& label, const Label& base, size_t dataSize = 0);
//! \}
@@ -701,7 +780,7 @@ public:
//! \{
//! Emits a comment stored in `data` with an optional `size` parameter.
- virtual Error comment(const char* data, size_t size = SIZE_MAX) = 0;
+ ASMJIT_API virtual Error comment(const char* data, size_t size = SIZE_MAX);
//! Emits a formatted comment specified by `fmt` and variable number of arguments.
ASMJIT_API Error commentf(const char* fmt, ...);
@@ -714,9 +793,9 @@ public:
//! \{
//! Called after the emitter was attached to `CodeHolder`.
- virtual Error onAttach(CodeHolder* ASMJIT_NONNULL(code)) noexcept = 0;
+ ASMJIT_API virtual Error onAttach(CodeHolder* ASMJIT_NONNULL(code)) noexcept;
//! Called after the emitter was detached from `CodeHolder`.
- virtual Error onDetach(CodeHolder* ASMJIT_NONNULL(code)) noexcept = 0;
+ ASMJIT_API virtual Error onDetach(CodeHolder* ASMJIT_NONNULL(code)) noexcept;
//! Called when \ref CodeHolder has updated an important setting, which involves the following:
//!
diff --git a/3rdparty/asmjit/src/asmjit/core/emitterutils.cpp b/3rdparty/asmjit/src/asmjit/core/emitterutils.cpp
index f36a1b37745..d0a687244b3 100644
--- a/3rdparty/asmjit/src/asmjit/core/emitterutils.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/emitterutils.cpp
@@ -96,7 +96,7 @@ void logInstructionEmitted(
}
Error logInstructionFailed(
- BaseAssembler* self,
+ BaseEmitter* self,
Error err,
InstId instId,
InstOptions options,
@@ -109,16 +109,14 @@ Error logInstructionFailed(
Operand_ opArray[Globals::kMaxOpCount];
opArrayFromEmitArgs(opArray, o0, o1, o2, opExt);
- self->_funcs.formatInstruction(sb, FormatFlags::kNone, self, self->arch(), BaseInst(instId, options, self->extraReg()), opArray, Globals::kMaxOpCount);
+ self->_funcs.formatInstruction(sb, FormatFlags::kRegType, self, self->arch(), BaseInst(instId, options, self->extraReg()), opArray, Globals::kMaxOpCount);
if (self->inlineComment()) {
sb.append(" ; ");
sb.append(self->inlineComment());
}
- self->resetInstOptions();
- self->resetExtraReg();
- self->resetInlineComment();
+ self->resetState();
return self->reportError(err, sb.data());
}
diff --git a/3rdparty/asmjit/src/asmjit/core/emitterutils_p.h b/3rdparty/asmjit/src/asmjit/core/emitterutils_p.h
index b7610e70261..8b6e1e0547e 100644
--- a/3rdparty/asmjit/src/asmjit/core/emitterutils_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/emitterutils_p.h
@@ -23,7 +23,7 @@ namespace EmitterUtils {
//! Default paddings used by Emitter utils and Formatter.
-static constexpr Operand noExt[3];
+static constexpr Operand noExt[3] = { {}, {}, {} };
enum kOpIndex : uint32_t {
kOp3 = 0,
@@ -71,7 +71,7 @@ void logInstructionEmitted(
uint32_t relSize, uint32_t immSize, uint8_t* afterCursor);
Error logInstructionFailed(
- BaseAssembler* self,
+ BaseEmitter* self,
Error err,
InstId instId,
InstOptions options,
diff --git a/3rdparty/asmjit/src/asmjit/core/environment.h b/3rdparty/asmjit/src/asmjit/core/environment.h
index 7e328a97c8e..c3678dc65bc 100644
--- a/3rdparty/asmjit/src/asmjit/core/environment.h
+++ b/3rdparty/asmjit/src/asmjit/core/environment.h
@@ -24,7 +24,7 @@ enum class Vendor : uint8_t {
//! Unknown or uninitialized platform vendor.
kUnknown = 0,
- //! Maximum value of `PlatformVendor`.
+ //! Maximum value of `Vendor`.
kMaxValue = kUnknown,
//! Platform vendor detected at compile-time.
@@ -116,7 +116,7 @@ enum class Platform : uint8_t {
//! Platform ABI (application binary interface).
enum class PlatformABI : uint8_t {
- //! Unknown or uninitialied environment.
+ //! Unknown or uninitialized environment.
kUnknown = 0,
//! Microsoft ABI.
kMSVC,
@@ -126,6 +126,8 @@ enum class PlatformABI : uint8_t {
kAndroid,
//! Cygwin ABI.
kCygwin,
+ //! Darwin ABI.
+ kDarwin,
//! Maximum value of `PlatformABI`.
kMaxValue,
@@ -142,11 +144,26 @@ enum class PlatformABI : uint8_t {
kGNU
#elif defined(__ANDROID__)
kAndroid
+#elif defined(__APPLE__)
+ kDarwin
#else
kUnknown
#endif
};
+//! Floating point ABI (ARM).
+enum class FloatABI : uint8_t {
+ kHardFloat = 0,
+ kSoftFloat,
+
+ kHost =
+#if ASMJIT_ARCH_ARM == 32 && defined(__SOFTFP__)
+ kSoftFloat
+#else
+ kHardFloat
+#endif
+};
+
//! Object format.
//!
//! \note AsmJit doesn't really use anything except \ref ObjectFormat::kUnknown and \ref ObjectFormat::kJIT at
@@ -186,53 +203,56 @@ public:
//! \{
//! Architecture.
- Arch _arch;
+ Arch _arch = Arch::kUnknown;
//! Sub-architecture type.
- SubArch _subArch;
+ SubArch _subArch = SubArch::kUnknown;
//! Vendor type.
- Vendor _vendor;
+ Vendor _vendor = Vendor::kUnknown;
//! Platform.
- Platform _platform;
+ Platform _platform = Platform::kUnknown;
//! Platform ABI.
- PlatformABI _platformABI;
+ PlatformABI _platformABI = PlatformABI::kUnknown;
//! Object format.
- ObjectFormat _objectFormat;
+ ObjectFormat _objectFormat = ObjectFormat::kUnknown;
+ //! Floating point ABI.
+ FloatABI _floatABI = FloatABI::kHardFloat;
//! Reserved for future use, must be zero.
- uint8_t _reserved[2];
+ uint8_t _reserved = 0;
//! \}
//! \name Construction & Destruction
//! \{
- inline Environment() noexcept :
- _arch(Arch::kUnknown),
- _subArch(SubArch::kUnknown),
- _vendor(Vendor::kUnknown),
- _platform(Platform::kUnknown),
- _platformABI(PlatformABI::kUnknown),
- _objectFormat(ObjectFormat::kUnknown),
- _reserved { 0, 0 } {}
+ //! Creates a default initialized environment (all values either unknown or set to safe defaults).
+ ASMJIT_INLINE_NODEBUG constexpr Environment() noexcept = default;
+ //! Creates a copy of `other` instance.
+ ASMJIT_INLINE_NODEBUG constexpr Environment(const Environment& other) noexcept = default;
- inline explicit Environment(
+ //! Creates \ref Environment initialized to `arch`, `subArch`, `vendor`, `platform`, `platformABI`, `objectFormat`,
+ //! and `floatABI`.
+ ASMJIT_INLINE_NODEBUG constexpr explicit Environment(
Arch arch,
SubArch subArch = SubArch::kUnknown,
Vendor vendor = Vendor::kUnknown,
Platform platform = Platform::kUnknown,
- PlatformABI abi = PlatformABI::kUnknown,
- ObjectFormat objectFormat = ObjectFormat::kUnknown) noexcept {
-
- init(arch, subArch, vendor, platform, abi, objectFormat);
- }
-
- inline Environment(const Environment& other) noexcept = default;
+ PlatformABI platformABI = PlatformABI::kUnknown,
+ ObjectFormat objectFormat = ObjectFormat::kUnknown,
+ FloatABI floatABI = FloatABI::kHardFloat) noexcept
+ : _arch(arch),
+ _subArch(subArch),
+ _vendor(vendor),
+ _platform(platform),
+ _platformABI(platformABI),
+ _objectFormat(objectFormat),
+ _floatABI(floatABI) {}
//! Returns the host environment constructed from preprocessor macros defined by the compiler.
//!
//! The returned environment should precisely match the target host architecture, sub-architecture, platform,
//! and ABI.
- static inline Environment host() noexcept {
- return Environment(Arch::kHost, SubArch::kHost, Vendor::kHost, Platform::kHost, PlatformABI::kHost, ObjectFormat::kUnknown);
+ static ASMJIT_INLINE_NODEBUG Environment host() noexcept {
+ return Environment(Arch::kHost, SubArch::kHost, Vendor::kHost, Platform::kHost, PlatformABI::kHost, ObjectFormat::kUnknown, FloatABI::kHost);
}
//! \}
@@ -240,10 +260,10 @@ public:
//! \name Overloaded Operators
//! \{
- inline Environment& operator=(const Environment& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG Environment& operator=(const Environment& other) noexcept = default;
- inline bool operator==(const Environment& other) const noexcept { return equals(other); }
- inline bool operator!=(const Environment& other) const noexcept { return !equals(other); }
+ ASMJIT_INLINE_NODEBUG bool operator==(const Environment& other) const noexcept { return equals(other); }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const Environment& other) const noexcept { return !equals(other); }
//! \}
@@ -253,59 +273,54 @@ public:
//! Tests whether the environment is not set up.
//!
//! Returns true if all members are zero, and thus unknown.
- inline bool empty() const noexcept {
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept {
// Unfortunately compilers won't optimize fields are checked one by one...
return _packed() == 0;
}
//! Tests whether the environment is initialized, which means it must have
//! a valid architecture.
- inline bool isInitialized() const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isInitialized() const noexcept {
return _arch != Arch::kUnknown;
}
- inline uint64_t _packed() const noexcept {
+ ASMJIT_INLINE_NODEBUG uint64_t _packed() const noexcept {
uint64_t x;
memcpy(&x, this, 8);
return x;
}
//! Resets all members of the environment to zero / unknown.
- inline void reset() noexcept {
- _arch = Arch::kUnknown;
- _subArch = SubArch::kUnknown;
- _vendor = Vendor::kUnknown;
- _platform = Platform::kUnknown;
- _platformABI = PlatformABI::kUnknown;
- _objectFormat = ObjectFormat::kUnknown;
- _reserved[0] = 0;
- _reserved[1] = 0;
- }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = Environment{}; }
- inline bool equals(const Environment& other) const noexcept {
- return _packed() == other._packed();
- }
+ //! Tests whether this environment is equal to `other`.
+ ASMJIT_INLINE_NODEBUG bool equals(const Environment& other) const noexcept { return _packed() == other._packed(); }
//! Returns the architecture.
- inline Arch arch() const noexcept { return _arch; }
+ ASMJIT_INLINE_NODEBUG Arch arch() const noexcept { return _arch; }
//! Returns the sub-architecture.
- inline SubArch subArch() const noexcept { return _subArch; }
+ ASMJIT_INLINE_NODEBUG SubArch subArch() const noexcept { return _subArch; }
//! Returns vendor.
- inline Vendor vendor() const noexcept { return _vendor; }
+ ASMJIT_INLINE_NODEBUG Vendor vendor() const noexcept { return _vendor; }
//! Returns target's platform or operating system.
- inline Platform platform() const noexcept { return _platform; }
+ ASMJIT_INLINE_NODEBUG Platform platform() const noexcept { return _platform; }
//! Returns target's ABI.
- inline PlatformABI platformABI() const noexcept { return _platformABI; }
+ ASMJIT_INLINE_NODEBUG PlatformABI platformABI() const noexcept { return _platformABI; }
//! Returns target's object format.
- inline ObjectFormat objectFormat() const noexcept { return _objectFormat; }
+ ASMJIT_INLINE_NODEBUG ObjectFormat objectFormat() const noexcept { return _objectFormat; }
+ //! Returns floating point ABI.
+ ASMJIT_INLINE_NODEBUG FloatABI floatABI() const noexcept { return _floatABI; }
+ //! Initializes \ref Environment to `arch`, `subArch`, `vendor`, `platform`, `platformABI`, `objectFormat`,
+ //! and `floatABI`.
inline void init(
Arch arch,
SubArch subArch = SubArch::kUnknown,
Vendor vendor = Vendor::kUnknown,
Platform platform = Platform::kUnknown,
PlatformABI platformABI = PlatformABI::kUnknown,
- ObjectFormat objectFormat = ObjectFormat::kUnknown) noexcept {
+ ObjectFormat objectFormat = ObjectFormat::kUnknown,
+ FloatABI floatABI = FloatABI::kHardFloat) noexcept {
_arch = arch;
_subArch = subArch;
@@ -313,57 +328,63 @@ public:
_platform = platform;
_platformABI = platformABI;
_objectFormat = objectFormat;
- _reserved[0] = 0;
- _reserved[1] = 0;
+ _floatABI = floatABI;
+ _reserved = 0;
}
- inline bool isArchX86() const noexcept { return _arch == Arch::kX86; }
- inline bool isArchX64() const noexcept { return _arch == Arch::kX64; }
- inline bool isArchARM() const noexcept { return isArchARM(_arch); }
- inline bool isArchThumb() const noexcept { return isArchThumb(_arch); }
- inline bool isArchAArch64() const noexcept { return isArchAArch64(_arch); }
- inline bool isArchMIPS32() const noexcept { return isArchMIPS32(_arch); }
- inline bool isArchMIPS64() const noexcept { return isArchMIPS64(_arch); }
- inline bool isArchRISCV32() const noexcept { return _arch == Arch::kRISCV32; }
- inline bool isArchRISCV64() const noexcept { return _arch == Arch::kRISCV64; }
+ //! Tests whether this environment describes a 32-bit X86.
+ ASMJIT_INLINE_NODEBUG bool isArchX86() const noexcept { return _arch == Arch::kX86; }
+ //! Tests whether this environment describes a 64-bit X86.
+ ASMJIT_INLINE_NODEBUG bool isArchX64() const noexcept { return _arch == Arch::kX64; }
+ //! Tests whether this environment describes a 32-bit ARM.
+ ASMJIT_INLINE_NODEBUG bool isArchARM() const noexcept { return isArchARM(_arch); }
+ //! Tests whether this environment describes a 32-bit ARM in THUMB mode.
+ ASMJIT_INLINE_NODEBUG bool isArchThumb() const noexcept { return isArchThumb(_arch); }
+ //! Tests whether this environment describes a 64-bit X86.
+ ASMJIT_INLINE_NODEBUG bool isArchAArch64() const noexcept { return isArchAArch64(_arch); }
+ //! Tests whether this environment describes a 32-bit MIPS.
+ ASMJIT_INLINE_NODEBUG bool isArchMIPS32() const noexcept { return isArchMIPS32(_arch); }
+ //! Tests whether this environment describes a 64-bit MIPS.
+ ASMJIT_INLINE_NODEBUG bool isArchMIPS64() const noexcept { return isArchMIPS64(_arch); }
+ //! Tests whether this environment describes a 32-bit RISC-V.
+ ASMJIT_INLINE_NODEBUG bool isArchRISCV32() const noexcept { return _arch == Arch::kRISCV32; }
+ //! Tests whether this environment describes a 64-bit RISC-V.
+ ASMJIT_INLINE_NODEBUG bool isArchRISCV64() const noexcept { return _arch == Arch::kRISCV64; }
//! Tests whether the architecture is 32-bit.
- inline bool is32Bit() const noexcept { return is32Bit(_arch); }
+ ASMJIT_INLINE_NODEBUG bool is32Bit() const noexcept { return is32Bit(_arch); }
//! Tests whether the architecture is 64-bit.
- inline bool is64Bit() const noexcept { return is64Bit(_arch); }
+ ASMJIT_INLINE_NODEBUG bool is64Bit() const noexcept { return is64Bit(_arch); }
//! Tests whether the architecture is little endian.
- inline bool isLittleEndian() const noexcept { return isLittleEndian(_arch); }
+ ASMJIT_INLINE_NODEBUG bool isLittleEndian() const noexcept { return isLittleEndian(_arch); }
//! Tests whether the architecture is big endian.
- inline bool isBigEndian() const noexcept { return isBigEndian(_arch); }
+ ASMJIT_INLINE_NODEBUG bool isBigEndian() const noexcept { return isBigEndian(_arch); }
//! Tests whether this architecture is of X86 family.
- inline bool isFamilyX86() const noexcept { return isFamilyX86(_arch); }
+ ASMJIT_INLINE_NODEBUG bool isFamilyX86() const noexcept { return isFamilyX86(_arch); }
//! Tests whether this architecture family is ARM, THUMB, or AArch64.
- inline bool isFamilyARM() const noexcept { return isFamilyARM(_arch); }
+ ASMJIT_INLINE_NODEBUG bool isFamilyARM() const noexcept { return isFamilyARM(_arch); }
//! Tests whether this architecture family is AArch32 (ARM or THUMB).
- inline bool isFamilyAArch32() const noexcept { return isFamilyAArch32(_arch); }
+ ASMJIT_INLINE_NODEBUG bool isFamilyAArch32() const noexcept { return isFamilyAArch32(_arch); }
//! Tests whether this architecture family is AArch64.
- inline bool isFamilyAArch64() const noexcept { return isFamilyAArch64(_arch); }
+ ASMJIT_INLINE_NODEBUG bool isFamilyAArch64() const noexcept { return isFamilyAArch64(_arch); }
//! Tests whether this architecture family is MISP or MIPS64.
- inline bool isFamilyMIPS() const noexcept { return isFamilyMIPS(_arch); }
+ ASMJIT_INLINE_NODEBUG bool isFamilyMIPS() const noexcept { return isFamilyMIPS(_arch); }
//! Tests whether this architecture family is RISC-V (both 32-bit and 64-bit).
- inline bool isFamilyRISCV() const noexcept { return isFamilyRISCV(_arch); }
+ ASMJIT_INLINE_NODEBUG bool isFamilyRISCV() const noexcept { return isFamilyRISCV(_arch); }
//! Tests whether the environment platform is Windows.
- inline bool isPlatformWindows() const noexcept { return _platform == Platform::kWindows; }
-
+ ASMJIT_INLINE_NODEBUG bool isPlatformWindows() const noexcept { return _platform == Platform::kWindows; }
//! Tests whether the environment platform is Linux.
- inline bool isPlatformLinux() const noexcept { return _platform == Platform::kLinux; }
-
+ ASMJIT_INLINE_NODEBUG bool isPlatformLinux() const noexcept { return _platform == Platform::kLinux; }
//! Tests whether the environment platform is Hurd.
- inline bool isPlatformHurd() const noexcept { return _platform == Platform::kHurd; }
-
+ ASMJIT_INLINE_NODEBUG bool isPlatformHurd() const noexcept { return _platform == Platform::kHurd; }
//! Tests whether the environment platform is Haiku.
- inline bool isPlatformHaiku() const noexcept { return _platform == Platform::kHaiku; }
+ ASMJIT_INLINE_NODEBUG bool isPlatformHaiku() const noexcept { return _platform == Platform::kHaiku; }
//! Tests whether the environment platform is any BSD.
- inline bool isPlatformBSD() const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isPlatformBSD() const noexcept {
return _platform == Platform::kFreeBSD ||
_platform == Platform::kOpenBSD ||
_platform == Platform::kNetBSD ||
@@ -371,7 +392,7 @@ public:
}
//! Tests whether the environment platform is any Apple platform (OSX, iOS, TVOS, WatchOS).
- inline bool isPlatformApple() const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isPlatformApple() const noexcept {
return _platform == Platform::kOSX ||
_platform == Platform::kIOS ||
_platform == Platform::kTVOS ||
@@ -379,119 +400,124 @@ public:
}
//! Tests whether the ABI is MSVC.
- inline bool isMSVC() const noexcept { return _platformABI == PlatformABI::kMSVC; }
+ ASMJIT_INLINE_NODEBUG bool isMSVC() const noexcept { return _platformABI == PlatformABI::kMSVC; }
//! Tests whether the ABI is GNU.
- inline bool isGNU() const noexcept { return _platformABI == PlatformABI::kGNU; }
+ ASMJIT_INLINE_NODEBUG bool isGNU() const noexcept { return _platformABI == PlatformABI::kGNU; }
+ //! Tests whether the ABI is GNU.
+ ASMJIT_INLINE_NODEBUG bool isDarwin() const noexcept { return _platformABI == PlatformABI::kDarwin; }
//! Returns a calculated stack alignment for this environment.
ASMJIT_API uint32_t stackAlignment() const noexcept;
//! Returns a native register size of this architecture.
- uint32_t registerSize() const noexcept { return registerSizeFromArch(_arch); }
+ ASMJIT_INLINE_NODEBUG uint32_t registerSize() const noexcept { return registerSizeFromArch(_arch); }
//! Sets the architecture to `arch`.
- inline void setArch(Arch arch) noexcept { _arch = arch; }
+ ASMJIT_INLINE_NODEBUG void setArch(Arch arch) noexcept { _arch = arch; }
//! Sets the sub-architecture to `subArch`.
- inline void setSubArch(SubArch subArch) noexcept { _subArch = subArch; }
+ ASMJIT_INLINE_NODEBUG void setSubArch(SubArch subArch) noexcept { _subArch = subArch; }
//! Sets the vendor to `vendor`.
- inline void setVendor(Vendor vendor) noexcept { _vendor = vendor; }
+ ASMJIT_INLINE_NODEBUG void setVendor(Vendor vendor) noexcept { _vendor = vendor; }
//! Sets the platform to `platform`.
- inline void setPlatform(Platform platform) noexcept { _platform = platform; }
+ ASMJIT_INLINE_NODEBUG void setPlatform(Platform platform) noexcept { _platform = platform; }
//! Sets the ABI to `platformABI`.
- inline void setPlatformABI(PlatformABI platformABI) noexcept { _platformABI = platformABI; }
+ ASMJIT_INLINE_NODEBUG void setPlatformABI(PlatformABI platformABI) noexcept { _platformABI = platformABI; }
//! Sets the object format to `objectFormat`.
- inline void setObjectFormat(ObjectFormat objectFormat) noexcept { _objectFormat = objectFormat; }
+ ASMJIT_INLINE_NODEBUG void setObjectFormat(ObjectFormat objectFormat) noexcept { _objectFormat = objectFormat; }
+
+ //! Sets floating point ABI to `floatABI`.
+ ASMJIT_INLINE_NODEBUG void setFloatABI(FloatABI floatABI) noexcept { _floatABI = floatABI; }
//! \}
//! \name Static Utilities
//! \{
- static inline bool isDefinedArch(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isDefinedArch(Arch arch) noexcept {
return uint32_t(arch) <= uint32_t(Arch::kMaxValue);
}
- static inline bool isValidArch(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isValidArch(Arch arch) noexcept {
return arch != Arch::kUnknown && uint32_t(arch) <= uint32_t(Arch::kMaxValue);
}
//! Tests whether the given architecture `arch` is 32-bit.
- static inline bool is32Bit(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool is32Bit(Arch arch) noexcept {
return (uint32_t(arch) & uint32_t(Arch::k32BitMask)) == uint32_t(Arch::k32BitMask);
}
//! Tests whether the given architecture `arch` is 64-bit.
- static inline bool is64Bit(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool is64Bit(Arch arch) noexcept {
return (uint32_t(arch) & uint32_t(Arch::k32BitMask)) == 0;
}
//! Tests whether the given architecture `arch` is little endian.
- static inline bool isLittleEndian(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isLittleEndian(Arch arch) noexcept {
return uint32_t(arch) < uint32_t(Arch::kBigEndian);
}
//! Tests whether the given architecture `arch` is big endian.
- static inline bool isBigEndian(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isBigEndian(Arch arch) noexcept {
return uint32_t(arch) >= uint32_t(Arch::kBigEndian);
}
//! Tests whether the given architecture is Thumb or Thumb_BE.
- static inline bool isArchThumb(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isArchThumb(Arch arch) noexcept {
return arch == Arch::kThumb || arch == Arch::kThumb_BE;
}
//! Tests whether the given architecture is ARM or ARM_BE.
- static inline bool isArchARM(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isArchARM(Arch arch) noexcept {
return arch == Arch::kARM || arch == Arch::kARM_BE;
}
//! Tests whether the given architecture is AArch64 or AArch64_BE.
- static inline bool isArchAArch64(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isArchAArch64(Arch arch) noexcept {
return arch == Arch::kAArch64 || arch == Arch::kAArch64_BE;
}
//! Tests whether the given architecture is MIPS32_LE or MIPS32_BE.
- static inline bool isArchMIPS32(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isArchMIPS32(Arch arch) noexcept {
return arch == Arch::kMIPS32_LE || arch == Arch::kMIPS32_BE;
}
//! Tests whether the given architecture is MIPS64_LE or MIPS64_BE.
- static inline bool isArchMIPS64(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isArchMIPS64(Arch arch) noexcept {
return arch == Arch::kMIPS64_LE || arch == Arch::kMIPS64_BE;
}
//! Tests whether the given architecture family is X86 or X64.
- static inline bool isFamilyX86(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isFamilyX86(Arch arch) noexcept {
return arch == Arch::kX86 || arch == Arch::kX64;
}
- //! Tests whether the given architecture family is ARM, THUMB, or AArch64.
- static inline bool isFamilyARM(Arch arch) noexcept {
- return isArchARM(arch) || isArchAArch64(arch) || isArchThumb(arch);
- }
-
//! Tests whether the given architecture family is AArch32 (ARM or THUMB).
- static inline bool isFamilyAArch32(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isFamilyAArch32(Arch arch) noexcept {
return isArchARM(arch) || isArchThumb(arch);
}
//! Tests whether the given architecture family is AArch64.
- static inline bool isFamilyAArch64(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isFamilyAArch64(Arch arch) noexcept {
return isArchAArch64(arch);
}
- //! Tests whether the given architecture family is MISP or MIPS64.
- static inline bool isFamilyMIPS(Arch arch) noexcept {
+ //! Tests whether the given architecture family is ARM, THUMB, or AArch64.
+ static ASMJIT_INLINE_NODEBUG bool isFamilyARM(Arch arch) noexcept {
+ return isFamilyAArch32(arch) || isFamilyAArch64(arch);
+ }
+
+ //! Tests whether the given architecture family is MIPS or MIPS64.
+ static ASMJIT_INLINE_NODEBUG bool isFamilyMIPS(Arch arch) noexcept {
return isArchMIPS32(arch) || isArchMIPS64(arch);
}
//! Tests whether the given architecture family is RISC-V (both 32-bit and 64-bit).
- static inline bool isFamilyRISCV(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isFamilyRISCV(Arch arch) noexcept {
return arch == Arch::kRISCV32 || arch == Arch::kRISCV64;
}
//! Returns a native general purpose register size from the given architecture.
- static inline uint32_t registerSizeFromArch(Arch arch) noexcept {
+ static ASMJIT_INLINE_NODEBUG uint32_t registerSizeFromArch(Arch arch) noexcept {
return is32Bit(arch) ? 4u : 8u;
}
diff --git a/3rdparty/asmjit/src/asmjit/core/errorhandler.cpp b/3rdparty/asmjit/src/asmjit/core/errorhandler.cpp
index 5a7dac52356..ce2ad016af1 100644
--- a/3rdparty/asmjit/src/asmjit/core/errorhandler.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/errorhandler.cpp
@@ -11,4 +11,8 @@ ASMJIT_BEGIN_NAMESPACE
ErrorHandler::ErrorHandler() noexcept {}
ErrorHandler::~ErrorHandler() noexcept {}
+void ErrorHandler::handleError(Error err, const char* message, BaseEmitter* origin) {
+ DebugUtils::unused(err, message, origin);
+}
+
ASMJIT_END_NAMESPACE
diff --git a/3rdparty/asmjit/src/asmjit/core/errorhandler.h b/3rdparty/asmjit/src/asmjit/core/errorhandler.h
index 5151d43304e..a1a2dd2d5db 100644
--- a/3rdparty/asmjit/src/asmjit/core/errorhandler.h
+++ b/3rdparty/asmjit/src/asmjit/core/errorhandler.h
@@ -61,7 +61,7 @@ class BaseEmitter;
//! SimpleErrorHandler eh;
//!
//! CodeHolder code;
-//! code.init(rt.environment());
+//! code.init(rt.environment(), rt.cpuFeatures());
//! code.setErrorHandler(&eh);
//!
//! // Try to emit instruction that doesn't exist.
@@ -117,7 +117,7 @@ class BaseEmitter;
//! ThrowableErrorHandler eh;
//!
//! CodeHolder code;
-//! code.init(rt.environment());
+//! code.init(rt.environment(), rt.cpuFeatures());
//! code.setErrorHandler(&eh);
//!
//! x86::Assembler a(&code);
@@ -166,7 +166,7 @@ class BaseEmitter;
//! LongJmpErrorHandler eh;
//!
//! CodeHolder code;
-//! code.init(rt.rt.environment());
+//! code.init(rt.environment(), rt.cpuFeatures());
//! code.setErrorHandler(&eh);
//!
//! x86::Assembler a(&code);
@@ -215,7 +215,7 @@ public:
//! calling `handleError()` so `longjmp()` can be used without any issues to cancel the code generation if an
//! error occurred. There is no difference between exceptions and `longjmp()` from AsmJit's perspective, however,
//! never jump outside of `CodeHolder` and `BaseEmitter` scope as you would leak memory.
- virtual void handleError(Error err, const char* message, BaseEmitter* origin) = 0;
+ ASMJIT_API virtual void handleError(Error err, const char* message, BaseEmitter* origin);
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/formatter.cpp b/3rdparty/asmjit/src/asmjit/core/formatter.cpp
index 1a9a386e3f3..0f12e416364 100644
--- a/3rdparty/asmjit/src/asmjit/core/formatter.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/formatter.cpp
@@ -57,7 +57,7 @@ Error formatTypeId(String& sb, TypeId typeId) noexcept {
if (!TypeUtils::isValid(typeId))
return sb.append("unknown");
- const char* typeName = "unknown";
+ const char* typeName = nullptr;
uint32_t typeSize = TypeUtils::sizeOf(typeId);
TypeId scalarType = TypeUtils::scalarOf(typeId);
@@ -107,7 +107,7 @@ Error formatFeature(
return x86::FormatterInternal::formatFeature(sb, featureId);
#endif
-#if !defined(ASMJIT_NO_AARCH32) && !defined(ASMJIT_NO_AARCH64)
+#if !defined(ASMJIT_NO_AARCH64)
if (Environment::isFamilyARM(arch))
return arm::FormatterInternal::formatFeature(sb, featureId);
#endif
@@ -123,32 +123,33 @@ Error formatLabel(
DebugUtils::unused(formatFlags);
- const LabelEntry* le = emitter->code()->labelEntry(labelId);
- if (ASMJIT_UNLIKELY(!le))
- return sb.appendFormat("<InvalidLabel:%u>", labelId);
+ if (emitter && emitter->code()) {
+ const LabelEntry* le = emitter->code()->labelEntry(labelId);
+ if (ASMJIT_UNLIKELY(!le))
+ return sb.appendFormat("<InvalidLabel:%u>", labelId);
- if (le->hasName()) {
- if (le->hasParent()) {
- uint32_t parentId = le->parentId();
- const LabelEntry* pe = emitter->code()->labelEntry(parentId);
+ if (le->hasName()) {
+ if (le->hasParent()) {
+ uint32_t parentId = le->parentId();
+ const LabelEntry* pe = emitter->code()->labelEntry(parentId);
- if (ASMJIT_UNLIKELY(!pe))
- ASMJIT_PROPAGATE(sb.appendFormat("<InvalidLabel:%u>", labelId));
- else if (ASMJIT_UNLIKELY(!pe->hasName()))
- ASMJIT_PROPAGATE(sb.appendFormat("L%u", parentId));
- else
- ASMJIT_PROPAGATE(sb.append(pe->name()));
+ if (ASMJIT_UNLIKELY(!pe))
+ ASMJIT_PROPAGATE(sb.appendFormat("<InvalidLabel:%u>", labelId));
+ else if (ASMJIT_UNLIKELY(!pe->hasName()))
+ ASMJIT_PROPAGATE(sb.appendFormat("L%u", parentId));
+ else
+ ASMJIT_PROPAGATE(sb.append(pe->name()));
- ASMJIT_PROPAGATE(sb.append('.'));
- }
+ ASMJIT_PROPAGATE(sb.append('.'));
+ }
- if (le->type() == LabelType::kAnonymous)
- ASMJIT_PROPAGATE(sb.appendFormat("L%u@", labelId));
- return sb.append(le->name());
- }
- else {
- return sb.appendFormat("L%u", labelId);
+ if (le->type() == LabelType::kAnonymous)
+ ASMJIT_PROPAGATE(sb.appendFormat("L%u@", labelId));
+ return sb.append(le->name());
+ }
}
+
+ return sb.appendFormat("L%u", labelId);
}
Error formatRegister(
@@ -165,8 +166,8 @@ Error formatRegister(
#endif
#if !defined(ASMJIT_NO_AARCH64)
- if (Environment::isFamilyAArch64(arch))
- return a64::FormatterInternal::formatRegister(sb, formatFlags, emitter, arch, regType, regId);
+ if (Environment::isFamilyARM(arch))
+ return arm::FormatterInternal::formatRegister(sb, formatFlags, emitter, arch, regType, regId);
#endif
return kErrorInvalidArch;
@@ -185,8 +186,8 @@ Error formatOperand(
#endif
#if !defined(ASMJIT_NO_AARCH64)
- if (Environment::isFamilyAArch64(arch))
- return a64::FormatterInternal::formatOperand(sb, formatFlags, emitter, arch, op);
+ if (Environment::isFamilyARM(arch))
+ return arm::FormatterInternal::formatOperand(sb, formatFlags, emitter, arch, op);
#endif
return kErrorInvalidArch;
@@ -283,7 +284,7 @@ Error formatInstruction(
#endif
#if !defined(ASMJIT_NO_AARCH64)
- if (Environment::isFamilyARM(arch))
+ if (Environment::isFamilyAArch64(arch))
return a64::FormatterInternal::formatInstruction(sb, formatFlags, emitter, arch, inst, operands, opCount);
#endif
@@ -471,8 +472,7 @@ Error formatNode(
case NodeType::kComment: {
const CommentNode* commentNode = node->as<CommentNode>();
- ASMJIT_PROPAGATE(sb.appendFormat("; %s", commentNode->inlineComment()));
- break;
+ return sb.appendFormat("; %s", commentNode->inlineComment());
}
case NodeType::kSentinel: {
@@ -514,7 +514,7 @@ Error formatNode(
ASMJIT_PROPAGATE(sb.append("[FuncRet]"));
for (uint32_t i = 0; i < 2; i++) {
- const Operand_& op = retNode->_opArray[i];
+ const Operand_& op = retNode->op(i);
if (!op.isNone()) {
ASMJIT_PROPAGATE(sb.append(i == 0 ? " " : ", "));
ASMJIT_PROPAGATE(formatOperand(sb, formatOptions.flags(), builder, builder->arch(), op));
diff --git a/3rdparty/asmjit/src/asmjit/core/formatter.h b/3rdparty/asmjit/src/asmjit/core/formatter.h
index d7a4b93476a..392e4787302 100644
--- a/3rdparty/asmjit/src/asmjit/core/formatter.h
+++ b/3rdparty/asmjit/src/asmjit/core/formatter.h
@@ -37,7 +37,9 @@ enum class FormatFlags : uint32_t {
//! Show casts between virtual register types (Compiler output).
kRegCasts = 0x00000010u,
//! Show positions associated with nodes (Compiler output).
- kPositions = 0x00000020u
+ kPositions = 0x00000020u,
+ //! Always format a register type (Compiler output).
+ kRegType = 0x00000040u
};
ASMJIT_DEFINE_ENUM_FLAGS(FormatFlags)
@@ -89,7 +91,7 @@ public:
//! \{
//! Resets FormatOptions to its default initialized state.
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_flags = FormatFlags::kNone;
_indentation.fill(uint8_t(0));
_padding.fill(uint16_t(0));
@@ -101,31 +103,31 @@ public:
//! \{
//! Returns format flags.
- inline FormatFlags flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG FormatFlags flags() const noexcept { return _flags; }
//! Tests whether the given `flag` is set in format flags.
- inline bool hasFlag(FormatFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(FormatFlags flag) const noexcept { return Support::test(_flags, flag); }
//! Resets all format flags to `flags`.
- inline void setFlags(FormatFlags flags) noexcept { _flags = flags; }
+ ASMJIT_INLINE_NODEBUG void setFlags(FormatFlags flags) noexcept { _flags = flags; }
//! Adds `flags` to format flags.
- inline void addFlags(FormatFlags flags) noexcept { _flags |= flags; }
+ ASMJIT_INLINE_NODEBUG void addFlags(FormatFlags flags) noexcept { _flags |= flags; }
//! Removes `flags` from format flags.
- inline void clearFlags(FormatFlags flags) noexcept { _flags &= ~flags; }
+ ASMJIT_INLINE_NODEBUG void clearFlags(FormatFlags flags) noexcept { _flags &= ~flags; }
//! Returns indentation for the given indentation `group`.
- inline uint8_t indentation(FormatIndentationGroup group) const noexcept { return _indentation[group]; }
+ ASMJIT_INLINE_NODEBUG uint8_t indentation(FormatIndentationGroup group) const noexcept { return _indentation[group]; }
//! Sets indentation for the given indentation `group`.
- inline void setIndentation(FormatIndentationGroup group, uint32_t n) noexcept { _indentation[group] = uint8_t(n); }
+ ASMJIT_INLINE_NODEBUG void setIndentation(FormatIndentationGroup group, uint32_t n) noexcept { _indentation[group] = uint8_t(n); }
//! Resets indentation for the given indentation `group` to zero.
- inline void resetIndentation(FormatIndentationGroup group) noexcept { _indentation[group] = uint8_t(0); }
+ ASMJIT_INLINE_NODEBUG void resetIndentation(FormatIndentationGroup group) noexcept { _indentation[group] = uint8_t(0); }
- //! Returns pading for the given padding `group`.
- inline size_t padding(FormatPaddingGroup group) const noexcept { return _padding[group]; }
- //! Sets pading for the given padding `group`.
- inline void setPadding(FormatPaddingGroup group, size_t n) noexcept { _padding[group] = uint16_t(n); }
- //! Resets pading for the given padding `group` to zero, which means that a default padding will be used
+ //! Returns padding for the given padding `group`.
+ ASMJIT_INLINE_NODEBUG size_t padding(FormatPaddingGroup group) const noexcept { return _padding[group]; }
+ //! Sets padding for the given padding `group`.
+ ASMJIT_INLINE_NODEBUG void setPadding(FormatPaddingGroup group, size_t n) noexcept { _padding[group] = uint16_t(n); }
+ //! Resets padding for the given padding `group` to zero, which means that a default padding will be used
//! based on the target architecture properties.
- inline void resetPadding(FormatPaddingGroup group) noexcept { _padding[group] = uint16_t(0); }
+ ASMJIT_INLINE_NODEBUG void resetPadding(FormatPaddingGroup group) noexcept { _padding[group] = uint16_t(0); }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/func.cpp b/3rdparty/asmjit/src/asmjit/core/func.cpp
index 04dc2aaf208..a8a6d3ab932 100644
--- a/3rdparty/asmjit/src/asmjit/core/func.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/func.cpp
@@ -20,8 +20,8 @@
ASMJIT_BEGIN_NAMESPACE
-// CallConv - Init & Reset
-// =======================
+// CallConv - Initialization & Reset
+// =================================
ASMJIT_FAVOR_SIZE Error CallConv::init(CallConvId ccId, const Environment& environment) noexcept {
reset();
@@ -75,7 +75,7 @@ ASMJIT_FAVOR_SIZE Error FuncDetail::init(const FuncSignature& signature, const E
#if !defined(ASMJIT_NO_AARCH64)
if (environment.isFamilyAArch64())
- return a64::FuncInternal::initFuncDetail(*this, signature, registerSize);
+ return a64::FuncInternal::initFuncDetail(*this, signature);
#endif
// We should never bubble here as if `cc.init()` succeeded then there has to be an implementation for the current
@@ -283,4 +283,18 @@ ASMJIT_FAVOR_SIZE Error FuncArgsAssignment::updateFuncFrame(FuncFrame& frame) co
return kErrorOk;
}
+// Func API - Tests
+// ================
+
+#if defined(ASMJIT_TEST)
+UNIT(func_signature) {
+ FuncSignature signature;
+ signature.setRetT<int8_t>();
+ signature.addArgT<int16_t>();
+ signature.addArg(TypeId::kInt32);
+
+ EXPECT_EQ(signature, FuncSignature::build<int8_t, int16_t, int32_t>());
+}
+#endif
+
ASMJIT_END_NAMESPACE
diff --git a/3rdparty/asmjit/src/asmjit/core/func.h b/3rdparty/asmjit/src/asmjit/core/func.h
index 78a41f98f65..695a23bbcf0 100644
--- a/3rdparty/asmjit/src/asmjit/core/func.h
+++ b/3rdparty/asmjit/src/asmjit/core/func.h
@@ -28,58 +28,45 @@ ASMJIT_BEGIN_NAMESPACE
//! - Target specific - calling conventions that are used by a particular architecture and ABI. For example
//! Windows 64-bit calling convention and AMD64 SystemV calling convention.
enum class CallConvId : uint8_t {
- //! None or invalid (can't be used).
- kNone = 0,
-
// Universal Calling Conventions
// -----------------------------
//! Standard function call or explicit `__cdecl` where it can be specified.
//!
- //! This is a universal calling convention, which is used to initialize specific calling connventions based on
+ //! This is a universal calling convention, which is used to initialize specific calling conventions based on
//! architecture, platform, and its ABI.
- kCDecl = 1,
+ kCDecl = 0,
//! `__stdcall` on targets that support this calling convention (X86).
//!
//! \note This calling convention is only supported on 32-bit X86. If used on environment that doesn't support
//! this calling convention it will be replaced by \ref CallConvId::kCDecl.
- kStdCall = 2,
+ kStdCall = 1,
//! `__fastcall` on targets that support this calling convention (X86).
//!
//! \note This calling convention is only supported on 32-bit X86. If used on environment that doesn't support
//! this calling convention it will be replaced by \ref CallConvId::kCDecl.
- kFastCall = 3,
+ kFastCall = 2,
//! `__vectorcall` on targets that support this calling convention (X86/X64).
//!
//! \note This calling convention is only supported on 32-bit and 64-bit X86 architecture on Windows platform.
//! If used on environment that doesn't support this calling it will be replaced by \ref CallConvId::kCDecl.
- kVectorCall = 4,
+ kVectorCall = 3,
//! `__thiscall` on targets that support this calling convention (X86).
//!
//! \note This calling convention is only supported on 32-bit X86 Windows platform. If used on environment that
//! doesn't support this calling convention it will be replaced by \ref CallConvId::kCDecl.
- kThisCall = 5,
+ kThisCall = 4,
//! `__attribute__((regparm(1)))` convention (GCC and Clang).
- kRegParm1 = 6,
+ kRegParm1 = 5,
//! `__attribute__((regparm(2)))` convention (GCC and Clang).
- kRegParm2 = 7,
+ kRegParm2 = 6,
//! `__attribute__((regparm(3)))` convention (GCC and Clang).
- kRegParm3 = 8,
-
- //! Soft-float calling convention (ARM).
- //!
- //! Floating point arguments are passed via general purpose registers.
- kSoftFloat = 9,
-
- //! Hard-float calling convention (ARM).
- //!
- //! Floating point arguments are passed via SIMD registers.
- kHardFloat = 10,
+ kRegParm3 = 7,
//! AsmJit specific calling convention designed for calling functions inside a multimedia code that don't use many
//! registers internally, but are long enough to be called and not inlined. These functions are usually used to
@@ -91,28 +78,32 @@ enum class CallConvId : uint8_t {
// ABI-Specific Calling Conventions
// --------------------------------
+ //! Soft-float calling convention (AArch32).
+ //!
+ //! Floating point arguments are passed via general purpose registers.
+ kSoftFloat = 30,
+
+ //! Hard-float calling convention (AArch32).
+ //!
+ //! Floating point arguments are passed via SIMD registers.
+ kHardFloat = 31,
+
//! X64 System-V calling convention.
kX64SystemV = 32,
//! X64 Windows calling convention.
kX64Windows = 33,
//! Maximum value of `CallConvId`.
- kMaxValue = kX64Windows,
-
- // Host Calling Conventions
- // ------------------------
-
- //! Host calling convention detected at compile-time.
- kHost =
-#if defined(_DOXYGEN)
- DETECTED_AT_COMPILE_TIME
-#elif ASMJIT_ARCH_ARM == 32 && defined(__SOFTFP__)
- kSoftFloat
-#elif ASMJIT_ARCH_ARM == 32 && !defined(__SOFTFP__)
- kHardFloat
-#else
- kCDecl
-#endif
+ kMaxValue = kX64Windows
+
+ // Deprecated Aliases
+ // ------------------
+
+#if !defined(ASMJIT_NO_DEPRECATED)
+ ,
+ kNone = kCDecl,
+ kHost = kCDecl
+#endif // !ASMJIT_NO_DEPRECATED
};
//! Strategy used by calling conventions to assign registers to function arguments.
@@ -128,6 +119,8 @@ enum class CallConvStrategy : uint8_t {
kX64Windows = 1,
//! Windows 64-bit __vectorcall register assignment strategy.
kX64VectorCall = 2,
+ //! Apple's AArch64 calling convention (differs compared to AArch64 calling convention used by Linux).
+ kAArch64Apple = 3,
//! Maximum value of `CallConvStrategy`.
kMaxValue = kX64VectorCall
@@ -163,14 +156,12 @@ struct CallConv {
//! \name Constants
//! \{
- enum : uint32_t {
- //! Maximum number of register arguments per register group.
- //!
- //! \note This is not really AsmJit's limitatation, it's just the number that makes sense considering all common
- //! calling conventions. Usually even conventions that use registers to pass function arguments are limited to 8
- //! and less arguments passed via registers per group.
- kMaxRegArgsPerGroup = 16
- };
+ //! Maximum number of register arguments per register group.
+ //!
+ //! \note This is not really AsmJit's limitation, it's just the number that makes sense considering all common
+ //! calling conventions. Usually even conventions that use registers to pass function arguments are limited to 8
+ //! and less arguments passed via registers per group.
+ static constexpr uint32_t kMaxRegArgsPerGroup = 16;
//! \}
@@ -191,6 +182,11 @@ struct CallConv {
//! Natural stack alignment as defined by OS/ABI.
uint8_t _naturalStackAlignment;
+ //! \cond INTERNAL
+ //! Reserved for future use.
+ uint8_t _reserved[2];
+ //! \endcond
+
//! Calling convention flags.
CallConvFlags _flags;
@@ -230,8 +226,8 @@ struct CallConv {
//! It's recommended to reset the \ref CallConv struct in case you would like create a custom calling convention
//! as it prevents from using an uninitialized data (CallConv doesn't have a constructor that would initialize it,
//! it's just a struct).
- inline void reset() noexcept {
- memset(this, 0, sizeof(*this));
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
+ *this = CallConv{};
memset(_passedOrder.data(), 0xFF, sizeof(_passedOrder));
}
@@ -241,61 +237,61 @@ struct CallConv {
//! \{
//! Returns the target architecture of this calling convention.
- inline Arch arch() const noexcept { return _arch; }
+ ASMJIT_INLINE_NODEBUG Arch arch() const noexcept { return _arch; }
//! Sets the target architecture of this calling convention.
- inline void setArch(Arch arch) noexcept { _arch = arch; }
+ ASMJIT_INLINE_NODEBUG void setArch(Arch arch) noexcept { _arch = arch; }
//! Returns the calling convention id.
- inline CallConvId id() const noexcept { return _id; }
+ ASMJIT_INLINE_NODEBUG CallConvId id() const noexcept { return _id; }
//! Sets the calling convention id.
- inline void setId(CallConvId ccId) noexcept { _id = ccId; }
+ ASMJIT_INLINE_NODEBUG void setId(CallConvId ccId) noexcept { _id = ccId; }
//! Returns the strategy used to assign registers to arguments.
- inline CallConvStrategy strategy() const noexcept { return _strategy; }
+ ASMJIT_INLINE_NODEBUG CallConvStrategy strategy() const noexcept { return _strategy; }
//! Sets the strategy used to assign registers to arguments.
- inline void setStrategy(CallConvStrategy ccStrategy) noexcept { _strategy = ccStrategy; }
+ ASMJIT_INLINE_NODEBUG void setStrategy(CallConvStrategy ccStrategy) noexcept { _strategy = ccStrategy; }
//! Tests whether the calling convention has the given `flag` set.
- inline bool hasFlag(CallConvFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(CallConvFlags flag) const noexcept { return Support::test(_flags, flag); }
//! Returns the calling convention flags, see `Flags`.
- inline CallConvFlags flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG CallConvFlags flags() const noexcept { return _flags; }
//! Adds the calling convention flags, see `Flags`.
- inline void setFlags(CallConvFlags flag) noexcept { _flags = flag; };
+ ASMJIT_INLINE_NODEBUG void setFlags(CallConvFlags flag) noexcept { _flags = flag; };
//! Adds the calling convention flags, see `Flags`.
- inline void addFlags(CallConvFlags flags) noexcept { _flags |= flags; };
+ ASMJIT_INLINE_NODEBUG void addFlags(CallConvFlags flags) noexcept { _flags |= flags; };
//! Tests whether this calling convention specifies 'RedZone'.
- inline bool hasRedZone() const noexcept { return _redZoneSize != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasRedZone() const noexcept { return _redZoneSize != 0; }
//! Tests whether this calling convention specifies 'SpillZone'.
- inline bool hasSpillZone() const noexcept { return _spillZoneSize != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasSpillZone() const noexcept { return _spillZoneSize != 0; }
//! Returns size of 'RedZone'.
- inline uint32_t redZoneSize() const noexcept { return _redZoneSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t redZoneSize() const noexcept { return _redZoneSize; }
//! Returns size of 'SpillZone'.
- inline uint32_t spillZoneSize() const noexcept { return _spillZoneSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t spillZoneSize() const noexcept { return _spillZoneSize; }
//! Sets size of 'RedZone'.
- inline void setRedZoneSize(uint32_t size) noexcept { _redZoneSize = uint8_t(size); }
+ ASMJIT_INLINE_NODEBUG void setRedZoneSize(uint32_t size) noexcept { _redZoneSize = uint8_t(size); }
//! Sets size of 'SpillZone'.
- inline void setSpillZoneSize(uint32_t size) noexcept { _spillZoneSize = uint8_t(size); }
+ ASMJIT_INLINE_NODEBUG void setSpillZoneSize(uint32_t size) noexcept { _spillZoneSize = uint8_t(size); }
//! Returns a natural stack alignment.
- inline uint32_t naturalStackAlignment() const noexcept { return _naturalStackAlignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t naturalStackAlignment() const noexcept { return _naturalStackAlignment; }
//! Sets a natural stack alignment.
//!
//! This function can be used to override the default stack alignment in case that you know that it's alignment is
//! different. For example it allows to implement custom calling conventions that guarantee higher stack alignment.
- inline void setNaturalStackAlignment(uint32_t value) noexcept { _naturalStackAlignment = uint8_t(value); }
+ ASMJIT_INLINE_NODEBUG void setNaturalStackAlignment(uint32_t value) noexcept { _naturalStackAlignment = uint8_t(value); }
//! Returns the size of a register (or its part) to be saved and restored of the given `group`.
- inline uint32_t saveRestoreRegSize(RegGroup group) const noexcept { return _saveRestoreRegSize[group]; }
+ ASMJIT_INLINE_NODEBUG uint32_t saveRestoreRegSize(RegGroup group) const noexcept { return _saveRestoreRegSize[group]; }
//! Sets the size of a vector register (or its part) to be saved and restored.
- inline void setSaveRestoreRegSize(RegGroup group, uint32_t size) noexcept { _saveRestoreRegSize[group] = uint8_t(size); }
+ ASMJIT_INLINE_NODEBUG void setSaveRestoreRegSize(RegGroup group, uint32_t size) noexcept { _saveRestoreRegSize[group] = uint8_t(size); }
//! Returns the alignment of a save-restore area of the given `group`.
- inline uint32_t saveRestoreAlignment(RegGroup group) const noexcept { return _saveRestoreAlignment[group]; }
+ ASMJIT_INLINE_NODEBUG uint32_t saveRestoreAlignment(RegGroup group) const noexcept { return _saveRestoreAlignment[group]; }
//! Sets the alignment of a save-restore area of the given `group`.
- inline void setSaveRestoreAlignment(RegGroup group, uint32_t alignment) noexcept { _saveRestoreAlignment[group] = uint8_t(alignment); }
+ ASMJIT_INLINE_NODEBUG void setSaveRestoreAlignment(RegGroup group, uint32_t alignment) noexcept { _saveRestoreAlignment[group] = uint8_t(alignment); }
//! Returns the order of passed registers of the given `group`.
inline const uint8_t* passedOrder(RegGroup group) const noexcept {
@@ -364,16 +360,21 @@ struct CallConv {
//! Function signature.
//!
-//! Contains information about function return type, count of arguments and their TypeIds. Function signature is
-//! a low level structure which doesn't contain platform specific or calling convention specific information.
+//! Contains information about a function return type, count of arguments, and their TypeIds. Function signature
+//! is a low level structure which doesn't contain platform specific or calling convention specific information.
+//! It's typically used to describe function arguments in a C-API like form, which is then used to calculate a
+//! \ref FuncDetail instance, which then maps function signature into a platform and calling convention specific
+//! format.
+//!
+//! Function signature can be built either dynamically by using \ref addArg() and \ref addArgT() functionality,
+//! or dynamically by using a template-based \ref FuncSignature::build() function, which maps template types
+//! into a function signature.
struct FuncSignature {
//! \name Constants
//! \{
- enum : uint8_t {
- //! Doesn't have variable number of arguments (`...`).
- kNoVarArgs = 0xFFu
- };
+ //! Doesn't have variable number of arguments (`...`).
+ static constexpr uint8_t kNoVarArgs = 0xFFu;
//! \}
@@ -381,90 +382,87 @@ struct FuncSignature {
//! \{
//! Calling convention id.
- CallConvId _ccId;
+ CallConvId _ccId = CallConvId::kCDecl;
//! Count of arguments.
- uint8_t _argCount;
+ uint8_t _argCount = 0;
//! Index of a first VA or `kNoVarArgs`.
- uint8_t _vaIndex;
+ uint8_t _vaIndex = kNoVarArgs;
//! Return value TypeId.
- TypeId _ret;
- //! Function arguments TypeIds.
- const TypeId* _args;
+ TypeId _ret = TypeId::kVoid;
+ //! Reserved for future use.
+ uint8_t _reserved[4] {};
+ //! Function argument TypeIds.
+ TypeId _args[Globals::kMaxFuncArgs] {};
//! \}
- //! \name Initializtion & Reset
+ //! \name Construction & Destruction
//! \{
- //! Initializes the function signature.
- inline void init(CallConvId ccId, uint32_t vaIndex, TypeId ret, const TypeId* args, uint32_t argCount) noexcept {
- ASMJIT_ASSERT(argCount <= 0xFF);
+ //! Default constructed function signature, initialized to \ref CallConvId::kCDecl, having no return value and no arguments.
+ ASMJIT_FORCE_INLINE constexpr FuncSignature() = default;
- _ccId = ccId;
- _argCount = uint8_t(argCount);
- _vaIndex = uint8_t(vaIndex);
- _ret = ret;
- _args = args;
- }
+ //! Copy constructor, which is initialized to the same function signature as `other`.
+ ASMJIT_FORCE_INLINE constexpr FuncSignature(const FuncSignature& other) = default;
+
+ //! Initializes the function signature with calling convention id `ccId` and variable argument's index `vaIndex`.
+ ASMJIT_FORCE_INLINE constexpr FuncSignature(CallConvId ccId, uint32_t vaIndex = kNoVarArgs) noexcept
+ : _ccId(ccId),
+ _vaIndex(uint8_t(vaIndex)) {}
- inline void reset() noexcept { memset(this, 0, sizeof(*this)); }
+ //! Initializes the function signature with calling convention id `ccId`, `vaIndex`, return value, and function arguments.
+ template<typename... Args>
+ ASMJIT_FORCE_INLINE constexpr FuncSignature(CallConvId ccId, uint32_t vaIndex, TypeId ret, Args&&...args) noexcept
+ : _ccId(ccId),
+ _argCount(uint8_t(sizeof...(args))),
+ _vaIndex(uint8_t(vaIndex)),
+ _ret(ret),
+ _args{std::forward<Args>(args)...} {}
+
+ //! Builds a function signature based on `RetValueAndArgs`. The first template argument is a function return type,
+ //! and function arguments follow.
+ //!
+ //! \note This function returns a new function signature, which can be passed to functions where it's required. It's
+ //! a convenience function that allows to build function signature statically based on types known at compile time,
+ //! which is common in JIT code generation.
+ template<typename... RetValueAndArgs>
+ static ASMJIT_INLINE_NODEBUG constexpr FuncSignature build(CallConvId ccId = CallConvId::kCDecl, uint32_t vaIndex = kNoVarArgs) noexcept {
+ return FuncSignature(ccId, vaIndex, (TypeId(TypeUtils::TypeIdOfT<RetValueAndArgs>::kTypeId))... );
+ }
//! \}
- //! \name Accessors
+ //! \name Overloaded Operators
//! \{
- //! Returns the calling convention.
- inline CallConvId callConvId() const noexcept { return _ccId; }
- //! Sets the calling convention to `ccId`;
- inline void setCallConvId(CallConvId ccId) noexcept { _ccId = ccId; }
+ //! Copy assignment - function signature can be copied by value.
+ ASMJIT_FORCE_INLINE FuncSignature& operator=(const FuncSignature& other) noexcept = default;
- //! Tests whether the function has variable number of arguments (...).
- inline bool hasVarArgs() const noexcept { return _vaIndex != kNoVarArgs; }
- //! Returns the variable arguments (...) index, `kNoVarArgs` if none.
- inline uint32_t vaIndex() const noexcept { return _vaIndex; }
- //! Sets the variable arguments (...) index to `index`.
- inline void setVaIndex(uint32_t index) noexcept { _vaIndex = uint8_t(index); }
- //! Resets the variable arguments index (making it a non-va function).
- inline void resetVaIndex() noexcept { _vaIndex = kNoVarArgs; }
+ //! Compares this function signature with `other` for equality..
+ ASMJIT_FORCE_INLINE bool operator==(const FuncSignature& other) const noexcept { return equals(other); }
+ //! Compares this function signature with `other` for inequality..
+ ASMJIT_FORCE_INLINE bool operator!=(const FuncSignature& other) const noexcept { return !equals(other); }
- //! Returns the number of function arguments.
- inline uint32_t argCount() const noexcept { return _argCount; }
+ //! \}
- inline bool hasRet() const noexcept { return _ret != TypeId::kVoid; }
- //! Returns the return value type.
- inline TypeId ret() const noexcept { return _ret; }
+ //! \name Initialization & Reset
+ //! \{
- //! Returns the type of the argument at index `i`.
- inline TypeId arg(uint32_t i) const noexcept {
- ASMJIT_ASSERT(i < _argCount);
- return _args[i];
- }
- //! Returns the array of function arguments' types.
- inline const TypeId* args() const noexcept { return _args; }
+ //! Resets this function signature to a default constructed state.
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = FuncSignature{}; }
//! \}
-};
-template<typename... RET_ARGS>
-class FuncSignatureT : public FuncSignature {
-public:
- inline FuncSignatureT(CallConvId ccId = CallConvId::kHost, uint32_t vaIndex = kNoVarArgs) noexcept {
- static constexpr TypeId ret_args[] = { (TypeId(TypeUtils::TypeIdOfT<RET_ARGS>::kTypeId))... };
- init(ccId, vaIndex, ret_args[0], ret_args + 1, uint32_t(ASMJIT_ARRAY_SIZE(ret_args) - 1));
- }
-};
-
-//! Function signature builder.
-class FuncSignatureBuilder : public FuncSignature {
-public:
- TypeId _builderArgList[Globals::kMaxFuncArgs];
-
- //! \name Initializtion & Reset
+ //! \name Equality & Comparison
//! \{
- inline FuncSignatureBuilder(CallConvId ccId = CallConvId::kHost, uint32_t vaIndex = kNoVarArgs) noexcept {
- init(ccId, vaIndex, TypeId::kVoid, _builderArgList, 0);
+ //! Compares this function signature with `other` for equality..
+ ASMJIT_INLINE_NODEBUG bool equals(const FuncSignature& other) const noexcept {
+ return _ccId == other._ccId &&
+ _argCount == other._argCount &&
+ _vaIndex == other._vaIndex &&
+ _ret == other._ret &&
+ memcmp(_args, other._args, sizeof(_args)) == 0;
}
//! \}
@@ -472,33 +470,85 @@ public:
//! \name Accessors
//! \{
+ //! Returns the calling convention.
+ ASMJIT_INLINE_NODEBUG CallConvId callConvId() const noexcept { return _ccId; }
+ //! Sets the calling convention to `ccId`;
+ ASMJIT_INLINE_NODEBUG void setCallConvId(CallConvId ccId) noexcept { _ccId = ccId; }
+
+ //! Tests whether the function signature has a return value.
+ ASMJIT_INLINE_NODEBUG bool hasRet() const noexcept { return _ret != TypeId::kVoid; }
+ //! Returns the type of the return value.
+ ASMJIT_INLINE_NODEBUG TypeId ret() const noexcept { return _ret; }
//! Sets the return type to `retType`.
- inline void setRet(TypeId retType) noexcept { _ret = retType; }
+ ASMJIT_INLINE_NODEBUG void setRet(TypeId retType) noexcept { _ret = retType; }
//! Sets the return type based on `T`.
template<typename T>
- inline void setRetT() noexcept { setRet(TypeId(TypeUtils::TypeIdOfT<T>::kTypeId)); }
+ ASMJIT_INLINE_NODEBUG void setRetT() noexcept { setRet(TypeId(TypeUtils::TypeIdOfT<T>::kTypeId)); }
+
+
+ //! Returns the array of function arguments' types.
+ ASMJIT_INLINE_NODEBUG const TypeId* args() const noexcept { return _args; }
+ //! Returns the number of function arguments.
+ ASMJIT_INLINE_NODEBUG uint32_t argCount() const noexcept { return _argCount; }
+
+ //! Returns the type of the argument at index `i`.
+ inline TypeId arg(uint32_t i) const noexcept {
+ ASMJIT_ASSERT(i < _argCount);
+ return _args[i];
+ }
//! Sets the argument at index `index` to `argType`.
inline void setArg(uint32_t index, TypeId argType) noexcept {
ASMJIT_ASSERT(index < _argCount);
- _builderArgList[index] = argType;
+ _args[index] = argType;
}
//! Sets the argument at index `i` to the type based on `T`.
template<typename T>
inline void setArgT(uint32_t index) noexcept { setArg(index, TypeId(TypeUtils::TypeIdOfT<T>::kTypeId)); }
+ //! Tests whether an argument can be added to the signature, use before calling \ref addArg() and \ref addArgT().
+ //!
+ //! \note If you know that you are not adding more arguments than \ref Globals::kMaxFuncArgs then it's not necessary
+ //! to use this function. However, if you are adding arguments based on user input, for example, then either check
+ //! the number of arguments before using function signature or use \ref canAddArg() before actually adding them to
+ //! the function signature.
+ inline bool canAddArg() const noexcept { return _argCount < Globals::kMaxFuncArgs; }
+
//! Appends an argument of `type` to the function prototype.
inline void addArg(TypeId type) noexcept {
ASMJIT_ASSERT(_argCount < Globals::kMaxFuncArgs);
- _builderArgList[_argCount++] = type;
+ _args[_argCount++] = type;
}
+
//! Appends an argument of type based on `T` to the function prototype.
template<typename T>
inline void addArgT() noexcept { addArg(TypeId(TypeUtils::TypeIdOfT<T>::kTypeId)); }
+ //! Tests whether the function has variable number of arguments (...).
+ ASMJIT_INLINE_NODEBUG bool hasVarArgs() const noexcept { return _vaIndex != kNoVarArgs; }
+ //! Returns the variable arguments (...) index, `kNoVarArgs` if none.
+ ASMJIT_INLINE_NODEBUG uint32_t vaIndex() const noexcept { return _vaIndex; }
+ //! Sets the variable arguments (...) index to `index`.
+ ASMJIT_INLINE_NODEBUG void setVaIndex(uint32_t index) noexcept { _vaIndex = uint8_t(index); }
+ //! Resets the variable arguments index (making it a non-va function).
+ ASMJIT_INLINE_NODEBUG void resetVaIndex() noexcept { _vaIndex = kNoVarArgs; }
+
//! \}
};
+#if !defined(ASMJIT_NO_DEPRECATED)
+template<typename... RetValueAndArgs>
+class FuncSignatureT : public FuncSignature {
+public:
+ ASMJIT_DEPRECATED("Use FuncSignature::build<RetValueAndArgs>() instead")
+ ASMJIT_INLINE_NODEBUG constexpr FuncSignatureT(CallConvId ccId = CallConvId::kCDecl, uint32_t vaIndex = kNoVarArgs) noexcept
+ : FuncSignature(ccId, vaIndex, (TypeId(TypeUtils::TypeIdOfT<RetValueAndArgs>::kTypeId))... ) {}
+};
+
+ASMJIT_DEPRECATED("Use FuncSignature instead of FuncSignatureBuilder")
+typedef FuncSignature FuncSignatureBuilder;
+#endif // !ASMJIT_NO_DEPRECATED
+
//! Argument or return value (or its part) as defined by `FuncSignature`, but with register or stack address
//! (and other metadata) assigned.
struct FuncValue {
@@ -533,43 +583,47 @@ struct FuncValue {
//! \}
- //! \name Initializtion & Reset
+ //! \name Initialization & Reset
//!
//! These initialize the whole `FuncValue` to either register or stack. Useful when you know all of these
//! properties and wanna just set it up.
//!
//! \{
- //! Initializes the `typeId` of this `FuncValue`.
- inline void initTypeId(TypeId typeId) noexcept {
+ //! Initializes this `FuncValue` only to the `typeId` provided - the rest of the values will be cleared.
+ ASMJIT_INLINE_NODEBUG void initTypeId(TypeId typeId) noexcept {
_data = uint32_t(typeId) << kTypeIdShift;
}
- inline void initReg(RegType regType, uint32_t regId, TypeId typeId, uint32_t flags = 0) noexcept {
+ //! Initializes this `FuncValue` to a register of `regType`, `regId`, and assigns its `typeId` and `flags`.
+ ASMJIT_INLINE_NODEBUG void initReg(RegType regType, uint32_t regId, TypeId typeId, uint32_t flags = 0) noexcept {
_data = (uint32_t(regType) << kRegTypeShift) | (regId << kRegIdShift) | (uint32_t(typeId) << kTypeIdShift) | kFlagIsReg | flags;
}
- inline void initStack(int32_t offset, TypeId typeId) noexcept {
+ //! Initializes this `FuncValue` to a stack at the given `offset` and assigns its `typeId`.
+ ASMJIT_INLINE_NODEBUG void initStack(int32_t offset, TypeId typeId) noexcept {
_data = (uint32_t(offset) << kStackOffsetShift) | (uint32_t(typeId) << kTypeIdShift) | kFlagIsStack;
}
//! Resets the value to its unassigned state.
- inline void reset() noexcept { _data = 0; }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _data = 0; }
//! \}
//! \name Assign
//!
//! These initialize only part of `FuncValue`, useful when building `FuncValue` incrementally. The caller
- //! should first init the type-id by caliing `initTypeId` and then continue building either register or stack.
+ //! should first init the type-id by calling `initTypeId` and then continue building either register or stack.
//!
//! \{
+ //! Assigns a register of `regType` and `regId`.
inline void assignRegData(RegType regType, uint32_t regId) noexcept {
ASMJIT_ASSERT((_data & (kRegTypeMask | kRegIdMask)) == 0);
_data |= (uint32_t(regType) << kRegTypeShift) | (regId << kRegIdShift) | kFlagIsReg;
}
+ //! Assigns a stack location at `offset`.
inline void assignStackOffset(int32_t offset) noexcept {
ASMJIT_ASSERT((_data & kStackOffsetMask) == 0);
_data |= (uint32_t(offset) << kStackOffsetShift) | kFlagIsStack;
@@ -581,52 +635,54 @@ struct FuncValue {
//! \{
//! Returns true if the value is initialized (explicit bool cast).
- inline explicit operator bool() const noexcept { return _data != 0; }
+ ASMJIT_INLINE_NODEBUG explicit operator bool() const noexcept { return _data != 0; }
- inline void _replaceValue(uint32_t mask, uint32_t value) noexcept { _data = (_data & ~mask) | value; }
+ //! \cond INTERNAL
+ ASMJIT_INLINE_NODEBUG void _replaceValue(uint32_t mask, uint32_t value) noexcept { _data = (_data & ~mask) | value; }
+ //! \endcond
//! Tests whether the `FuncValue` has a flag `flag` set.
- inline bool hasFlag(uint32_t flag) const noexcept { return Support::test(_data, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(uint32_t flag) const noexcept { return Support::test(_data, flag); }
//! Adds `flags` to `FuncValue`.
- inline void addFlags(uint32_t flags) noexcept { _data |= flags; }
+ ASMJIT_INLINE_NODEBUG void addFlags(uint32_t flags) noexcept { _data |= flags; }
//! Clears `flags` of `FuncValue`.
- inline void clearFlags(uint32_t flags) noexcept { _data &= ~flags; }
+ ASMJIT_INLINE_NODEBUG void clearFlags(uint32_t flags) noexcept { _data &= ~flags; }
//! Tests whether the value is initialized (i.e. contains a valid data).
- inline bool isInitialized() const noexcept { return _data != 0; }
+ ASMJIT_INLINE_NODEBUG bool isInitialized() const noexcept { return _data != 0; }
//! Tests whether the argument is passed by register.
- inline bool isReg() const noexcept { return hasFlag(kFlagIsReg); }
+ ASMJIT_INLINE_NODEBUG bool isReg() const noexcept { return hasFlag(kFlagIsReg); }
//! Tests whether the argument is passed by stack.
- inline bool isStack() const noexcept { return hasFlag(kFlagIsStack); }
+ ASMJIT_INLINE_NODEBUG bool isStack() const noexcept { return hasFlag(kFlagIsStack); }
//! Tests whether the argument is passed by register.
- inline bool isAssigned() const noexcept { return hasFlag(kFlagIsReg | kFlagIsStack); }
+ ASMJIT_INLINE_NODEBUG bool isAssigned() const noexcept { return hasFlag(kFlagIsReg | kFlagIsStack); }
//! Tests whether the argument is passed through a pointer (used by WIN64 to pass XMM|YMM|ZMM).
- inline bool isIndirect() const noexcept { return hasFlag(kFlagIsIndirect); }
+ ASMJIT_INLINE_NODEBUG bool isIndirect() const noexcept { return hasFlag(kFlagIsIndirect); }
//! Tests whether the argument was already processed (used internally).
- inline bool isDone() const noexcept { return hasFlag(kFlagIsDone); }
+ ASMJIT_INLINE_NODEBUG bool isDone() const noexcept { return hasFlag(kFlagIsDone); }
//! Returns a register type of the register used to pass function argument or return value.
- inline RegType regType() const noexcept { return RegType((_data & kRegTypeMask) >> kRegTypeShift); }
+ ASMJIT_INLINE_NODEBUG RegType regType() const noexcept { return RegType((_data & kRegTypeMask) >> kRegTypeShift); }
//! Sets a register type of the register used to pass function argument or return value.
- inline void setRegType(RegType regType) noexcept { _replaceValue(kRegTypeMask, uint32_t(regType) << kRegTypeShift); }
+ ASMJIT_INLINE_NODEBUG void setRegType(RegType regType) noexcept { _replaceValue(kRegTypeMask, uint32_t(regType) << kRegTypeShift); }
//! Returns a physical id of the register used to pass function argument or return value.
- inline uint32_t regId() const noexcept { return (_data & kRegIdMask) >> kRegIdShift; }
+ ASMJIT_INLINE_NODEBUG uint32_t regId() const noexcept { return (_data & kRegIdMask) >> kRegIdShift; }
//! Sets a physical id of the register used to pass function argument or return value.
- inline void setRegId(uint32_t regId) noexcept { _replaceValue(kRegIdMask, regId << kRegIdShift); }
+ ASMJIT_INLINE_NODEBUG void setRegId(uint32_t regId) noexcept { _replaceValue(kRegIdMask, regId << kRegIdShift); }
//! Returns a stack offset of this argument.
- inline int32_t stackOffset() const noexcept { return int32_t(_data & kStackOffsetMask) >> kStackOffsetShift; }
+ ASMJIT_INLINE_NODEBUG int32_t stackOffset() const noexcept { return int32_t(_data & kStackOffsetMask) >> kStackOffsetShift; }
//! Sets a stack offset of this argument.
- inline void setStackOffset(int32_t offset) noexcept { _replaceValue(kStackOffsetMask, uint32_t(offset) << kStackOffsetShift); }
+ ASMJIT_INLINE_NODEBUG void setStackOffset(int32_t offset) noexcept { _replaceValue(kStackOffsetMask, uint32_t(offset) << kStackOffsetShift); }
//! Tests whether the argument or return value has associated `TypeId`.
- inline bool hasTypeId() const noexcept { return Support::test(_data, kTypeIdMask); }
+ ASMJIT_INLINE_NODEBUG bool hasTypeId() const noexcept { return Support::test(_data, kTypeIdMask); }
//! Returns a TypeId of this argument or return value.
- inline TypeId typeId() const noexcept { return TypeId((_data & kTypeIdMask) >> kTypeIdShift); }
+ ASMJIT_INLINE_NODEBUG TypeId typeId() const noexcept { return TypeId((_data & kTypeIdMask) >> kTypeIdShift); }
//! Sets a TypeId of this argument or return value.
- inline void setTypeId(TypeId typeId) noexcept { _replaceValue(kTypeIdMask, uint32_t(typeId) << kTypeIdShift); }
+ ASMJIT_INLINE_NODEBUG void setTypeId(TypeId typeId) noexcept { _replaceValue(kTypeIdMask, uint32_t(typeId) << kTypeIdShift); }
//! \}
};
@@ -665,40 +721,52 @@ public:
return n;
}
- inline FuncValue* values() noexcept { return _values; }
- inline const FuncValue* values() const noexcept { return _values; }
+ //! Returns values in this value in the pack.
+ //!
+ //! \note The returned array has exactly \ref Globals::kMaxValuePack elements.
+ ASMJIT_INLINE_NODEBUG FuncValue* values() noexcept { return _values; }
+ //! \overload
+ ASMJIT_INLINE_NODEBUG const FuncValue* values() const noexcept { return _values; }
+ //! Resets a value at the given `index` in the pack, which makes it unassigned.
inline void resetValue(size_t index) noexcept {
ASMJIT_ASSERT(index < Globals::kMaxValuePack);
_values[index].reset();
}
+ //! Tests whether the value at the given `index` in the pack is assigned.
inline bool hasValue(size_t index) noexcept {
ASMJIT_ASSERT(index < Globals::kMaxValuePack);
return _values[index].isInitialized();
}
+ //! Assigns a register at the given `index` to `reg` and an optional `typeId`.
inline void assignReg(size_t index, const BaseReg& reg, TypeId typeId = TypeId::kVoid) noexcept {
ASMJIT_ASSERT(index < Globals::kMaxValuePack);
ASMJIT_ASSERT(reg.isPhysReg());
_values[index].initReg(reg.type(), reg.id(), typeId);
}
+ //! Assigns a register at the given `index` to `regType`, `regId`, and an optional `typeId`.
inline void assignReg(size_t index, RegType regType, uint32_t regId, TypeId typeId = TypeId::kVoid) noexcept {
ASMJIT_ASSERT(index < Globals::kMaxValuePack);
_values[index].initReg(regType, regId, typeId);
}
+ //! Assigns a stack location at the given `index` to `offset` and an optional `typeId`.
inline void assignStack(size_t index, int32_t offset, TypeId typeId = TypeId::kVoid) noexcept {
ASMJIT_ASSERT(index < Globals::kMaxValuePack);
_values[index].initStack(offset, typeId);
}
+ //! Accesses the value in the pack at the given `index`.
+ //!
+ //! \note The maximum index value is `Globals::kMaxValuePack - 1`.
inline FuncValue& operator[](size_t index) {
ASMJIT_ASSERT(index < Globals::kMaxValuePack);
return _values[index];
}
-
+ //! \overload
inline const FuncValue& operator[](size_t index) const {
ASMJIT_ASSERT(index < Globals::kMaxValuePack);
return _values[index];
@@ -721,6 +789,11 @@ enum class FuncAttributes : uint32_t {
kHasFuncCalls = 0x00000020u,
//! Function has aligned save/restore of vector registers.
kAlignedVecSR = 0x00000040u,
+ //! Function must begin with an instruction that marks a start of a branch or function.
+ //!
+ //! * `ENDBR32/ENDBR64` instruction is inserted at the beginning of the function (X86, X86_64).
+ //! * `BTI` instruction is inserted at the beginning of the function (AArch64)
+ kIndirectBranchProtection = 0x00000080u,
//! FuncFrame is finalized and can be used by prolog/epilog inserter (PEI).
kIsFinalized = 0x00000800u,
@@ -757,10 +830,8 @@ public:
//! \name Constants
//! \{
- enum : uint8_t {
- //! Doesn't have variable number of arguments (`...`).
- kNoVarArgs = 0xFFu
- };
+ //! Function doesn't have a variable number of arguments (`...`).
+ static constexpr uint8_t kNoVarArgs = 0xFFu;
//! \}
@@ -768,33 +839,53 @@ public:
//! \{
//! Calling convention.
- CallConv _callConv;
+ CallConv _callConv {};
//! Number of function arguments.
- uint8_t _argCount;
+ uint8_t _argCount = 0;
//! Variable arguments index of `kNoVarArgs`.
- uint8_t _vaIndex;
+ uint8_t _vaIndex = 0;
//! Reserved for future use.
- uint16_t _reserved;
+ uint16_t _reserved = 0;
//! Registers that contain arguments.
- Support::Array<RegMask, Globals::kNumVirtGroups> _usedRegs;
+ Support::Array<RegMask, Globals::kNumVirtGroups> _usedRegs {};
//! Size of arguments passed by stack.
- uint32_t _argStackSize;
+ uint32_t _argStackSize = 0;
//! Function return value(s).
- FuncValuePack _rets;
+ FuncValuePack _rets {};
//! Function arguments.
- FuncValuePack _args[Globals::kMaxFuncArgs];
+ FuncValuePack _args[Globals::kMaxFuncArgs] {};
//! \}
//! \name Construction & Destruction
//! \{
- inline FuncDetail() noexcept { reset(); }
- inline FuncDetail(const FuncDetail& other) noexcept = default;
+ //! Creates a default constructed \ref FuncDetail.
+ ASMJIT_INLINE_NODEBUG FuncDetail() noexcept {}
+
+ //! Copy constructor.
+ //!
+ //! Function details are copyable.
+ ASMJIT_INLINE_NODEBUG FuncDetail(const FuncDetail& other) noexcept = default;
//! Initializes this `FuncDetail` to the given signature.
ASMJIT_API Error init(const FuncSignature& signature, const Environment& environment) noexcept;
- inline void reset() noexcept { memset(this, 0, sizeof(*this)); }
+
+ //! \}
+
+ //! \name Overloaded Operators
+ //! \{
+
+ //! Assignment operator, copies `other` to this \ref FuncDetail.
+ ASMJIT_INLINE_NODEBUG FuncDetail& operator=(const FuncDetail& other) noexcept = default;
+
+ //! \}
+
+ //! \name Reset
+ //! \{
+
+ //! Resets the function detail to its default constructed state.
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = FuncDetail{}; }
//! \}
@@ -802,32 +893,32 @@ public:
//! \{
//! Returns the function's calling convention, see `CallConv`.
- inline const CallConv& callConv() const noexcept { return _callConv; }
+ ASMJIT_INLINE_NODEBUG const CallConv& callConv() const noexcept { return _callConv; }
//! Returns the associated calling convention flags, see `CallConv::Flags`.
- inline CallConvFlags flags() const noexcept { return _callConv.flags(); }
+ ASMJIT_INLINE_NODEBUG CallConvFlags flags() const noexcept { return _callConv.flags(); }
//! Checks whether a CallConv `flag` is set, see `CallConv::Flags`.
- inline bool hasFlag(CallConvFlags ccFlag) const noexcept { return _callConv.hasFlag(ccFlag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(CallConvFlags ccFlag) const noexcept { return _callConv.hasFlag(ccFlag); }
//! Tests whether the function has a return value.
- inline bool hasRet() const noexcept { return bool(_rets[0]); }
+ ASMJIT_INLINE_NODEBUG bool hasRet() const noexcept { return bool(_rets[0]); }
//! Returns the number of function arguments.
- inline uint32_t argCount() const noexcept { return _argCount; }
+ ASMJIT_INLINE_NODEBUG uint32_t argCount() const noexcept { return _argCount; }
//! Returns function return values.
- inline FuncValuePack& retPack() noexcept { return _rets; }
+ ASMJIT_INLINE_NODEBUG FuncValuePack& retPack() noexcept { return _rets; }
//! Returns function return values.
- inline const FuncValuePack& retPack() const noexcept { return _rets; }
+ ASMJIT_INLINE_NODEBUG const FuncValuePack& retPack() const noexcept { return _rets; }
//! Returns a function return value associated with the given `valueIndex`.
- inline FuncValue& ret(size_t valueIndex = 0) noexcept { return _rets[valueIndex]; }
+ ASMJIT_INLINE_NODEBUG FuncValue& ret(size_t valueIndex = 0) noexcept { return _rets[valueIndex]; }
//! Returns a function return value associated with the given `valueIndex` (const).
- inline const FuncValue& ret(size_t valueIndex = 0) const noexcept { return _rets[valueIndex]; }
+ ASMJIT_INLINE_NODEBUG const FuncValue& ret(size_t valueIndex = 0) const noexcept { return _rets[valueIndex]; }
//! Returns function argument packs array.
- inline FuncValuePack* argPacks() noexcept { return _args; }
+ ASMJIT_INLINE_NODEBUG FuncValuePack* argPacks() noexcept { return _args; }
//! Returns function argument packs array (const).
- inline const FuncValuePack* argPacks() const noexcept { return _args; }
+ ASMJIT_INLINE_NODEBUG const FuncValuePack* argPacks() const noexcept { return _args; }
//! Returns function argument pack at the given `argIndex`.
inline FuncValuePack& argPack(size_t argIndex) noexcept {
@@ -862,26 +953,26 @@ public:
}
//! Tests whether the function has variable arguments.
- inline bool hasVarArgs() const noexcept { return _vaIndex != kNoVarArgs; }
+ ASMJIT_INLINE_NODEBUG bool hasVarArgs() const noexcept { return _vaIndex != kNoVarArgs; }
//! Returns an index of a first variable argument.
- inline uint32_t vaIndex() const noexcept { return _vaIndex; }
+ ASMJIT_INLINE_NODEBUG uint32_t vaIndex() const noexcept { return _vaIndex; }
//! Tests whether the function passes one or more argument by stack.
- inline bool hasStackArgs() const noexcept { return _argStackSize != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasStackArgs() const noexcept { return _argStackSize != 0; }
//! Returns stack size needed for function arguments passed on the stack.
- inline uint32_t argStackSize() const noexcept { return _argStackSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t argStackSize() const noexcept { return _argStackSize; }
//! Returns red zone size.
- inline uint32_t redZoneSize() const noexcept { return _callConv.redZoneSize(); }
+ ASMJIT_INLINE_NODEBUG uint32_t redZoneSize() const noexcept { return _callConv.redZoneSize(); }
//! Returns spill zone size.
- inline uint32_t spillZoneSize() const noexcept { return _callConv.spillZoneSize(); }
+ ASMJIT_INLINE_NODEBUG uint32_t spillZoneSize() const noexcept { return _callConv.spillZoneSize(); }
//! Returns natural stack alignment.
- inline uint32_t naturalStackAlignment() const noexcept { return _callConv.naturalStackAlignment(); }
+ ASMJIT_INLINE_NODEBUG uint32_t naturalStackAlignment() const noexcept { return _callConv.naturalStackAlignment(); }
//! Returns a mask of all passed registers of the given register `group`.
- inline RegMask passedRegs(RegGroup group) const noexcept { return _callConv.passedRegs(group); }
+ ASMJIT_INLINE_NODEBUG RegMask passedRegs(RegGroup group) const noexcept { return _callConv.passedRegs(group); }
//! Returns a mask of all preserved registers of the given register `group`.
- inline RegMask preservedRegs(RegGroup group) const noexcept { return _callConv.preservedRegs(group); }
+ ASMJIT_INLINE_NODEBUG RegMask preservedRegs(RegGroup group) const noexcept { return _callConv.preservedRegs(group); }
//! Returns a mask of all used registers of the given register `group`.
inline RegMask usedRegs(RegGroup group) const noexcept {
@@ -901,7 +992,7 @@ public:
//! Function frame.
//!
//! Function frame is used directly by prolog and epilog insertion (PEI) utils. It provides information necessary to
-//! insert a proper and ABI comforming prolog and epilog. Function frame calculation is based on `CallConv` and
+//! insert a proper and ABI conforming prolog and epilog. Function frame calculation is based on `CallConv` and
//! other function attributes.
//!
//! SSE vs AVX vs AVX-512
@@ -954,87 +1045,98 @@ public:
//! \{
//! Function attributes.
- FuncAttributes _attributes;
+ FuncAttributes _attributes {};
//! Target architecture.
- Arch _arch;
+ Arch _arch {};
//! SP register ID (to access call stack and local stack).
- uint8_t _spRegId;
+ uint8_t _spRegId = uint8_t(BaseReg::kIdBad);
//! SA register ID (to access stack arguments).
- uint8_t _saRegId;
+ uint8_t _saRegId = uint8_t(BaseReg::kIdBad);
//! Red zone size (copied from CallConv).
- uint8_t _redZoneSize;
+ uint8_t _redZoneSize = 0;
//! Spill zone size (copied from CallConv).
- uint8_t _spillZoneSize;
+ uint8_t _spillZoneSize = 0;
//! Natural stack alignment (copied from CallConv).
- uint8_t _naturalStackAlignment;
+ uint8_t _naturalStackAlignment = 0;
//! Minimum stack alignment to turn on dynamic alignment.
- uint8_t _minDynamicAlignment;
+ uint8_t _minDynamicAlignment = 0;
//! Call stack alignment.
- uint8_t _callStackAlignment;
+ uint8_t _callStackAlignment = 0;
//! Local stack alignment.
- uint8_t _localStackAlignment;
+ uint8_t _localStackAlignment = 0;
//! Final stack alignment.
- uint8_t _finalStackAlignment;
+ uint8_t _finalStackAlignment = 0;
//! Adjustment of the stack before returning (X86-STDCALL).
- uint16_t _calleeStackCleanup;
+ uint16_t _calleeStackCleanup = 0;
//! Call stack size.
- uint32_t _callStackSize;
+ uint32_t _callStackSize = 0;
//! Local stack size.
- uint32_t _localStackSize;
+ uint32_t _localStackSize = 0;
//! Final stack size (sum of call stack and local stack).
- uint32_t _finalStackSize;
+ uint32_t _finalStackSize = 0;
//! Local stack offset (non-zero only if call stack is used).
- uint32_t _localStackOffset;
+ uint32_t _localStackOffset = 0;
//! Offset relative to SP that contains previous SP (before alignment).
- uint32_t _daOffset;
+ uint32_t _daOffset = 0;
//! Offset of the first stack argument relative to SP.
- uint32_t _saOffsetFromSP;
+ uint32_t _saOffsetFromSP = 0;
//! Offset of the first stack argument relative to SA (_saRegId or FP).
- uint32_t _saOffsetFromSA;
+ uint32_t _saOffsetFromSA = 0;
//! Local stack adjustment in prolog/epilog.
- uint32_t _stackAdjustment;
+ uint32_t _stackAdjustment = 0;
//! Registers that are dirty.
- Support::Array<RegMask, Globals::kNumVirtGroups> _dirtyRegs;
+ Support::Array<RegMask, Globals::kNumVirtGroups> _dirtyRegs {};
//! Registers that must be preserved (copied from CallConv).
- Support::Array<RegMask, Globals::kNumVirtGroups> _preservedRegs;
+ Support::Array<RegMask, Globals::kNumVirtGroups> _preservedRegs {};
//! Size to save/restore per register group.
- Support::Array<uint8_t, Globals::kNumVirtGroups> _saveRestoreRegSize;
+ Support::Array<uint8_t, Globals::kNumVirtGroups> _saveRestoreRegSize {};
//! Alignment of save/restore area per register group.
- Support::Array<uint8_t, Globals::kNumVirtGroups> _saveRestoreAlignment;
+ Support::Array<uint8_t, Globals::kNumVirtGroups> _saveRestoreAlignment {};
//! Stack size required to save registers with push/pop.
- uint16_t _pushPopSaveSize;
+ uint16_t _pushPopSaveSize = 0;
//! Stack size required to save extra registers that cannot use push/pop.
- uint16_t _extraRegSaveSize;
+ uint16_t _extraRegSaveSize = 0;
//! Offset where registers saved/restored via push/pop are stored
- uint32_t _pushPopSaveOffset;
- //! Offset where extra ragisters that cannot use push/pop are stored.
- uint32_t _extraRegSaveOffset;
+ uint32_t _pushPopSaveOffset = 0;
+ //! Offset where extra registers that cannot use push/pop are stored.
+ uint32_t _extraRegSaveOffset = 0;
//! \}
//! \name Construction & Destruction
//! \{
- inline FuncFrame() noexcept { reset(); }
- inline FuncFrame(const FuncFrame& other) noexcept = default;
+ //! Creates a default constructed function frame, which has initialized all members to their default values.
+ ASMJIT_INLINE_NODEBUG FuncFrame() noexcept = default;
+ //! Creates a copy of `other` function frame.
+ ASMJIT_INLINE_NODEBUG FuncFrame(const FuncFrame& other) noexcept = default;
+ //! \}
+
+ //! \name Initialization & Reset
+ //! \{
+
+ //! Initializes the function frame based on `func` detail.
ASMJIT_API Error init(const FuncDetail& func) noexcept;
+ //! Resets the function frame into its default constructed state.
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = FuncFrame{}; }
- inline void reset() noexcept {
- memset(this, 0, sizeof(FuncFrame));
- _spRegId = BaseReg::kIdBad;
- _saRegId = BaseReg::kIdBad;
- _daOffset = kTagInvalidOffset;
- }
+ //! \}
+
+ //! \name Overloaded Operators
+ //! \{
+
+ //! Copy assignment - function frame is copy assignable.
+ ASMJIT_INLINE_NODEBUG FuncFrame& operator=(const FuncFrame& other) noexcept = default;
//! \}
@@ -1042,100 +1144,116 @@ public:
//! \{
//! Returns the target architecture of the function frame.
- inline Arch arch() const noexcept { return _arch; }
+ ASMJIT_INLINE_NODEBUG Arch arch() const noexcept { return _arch; }
//! Returns function frame attributes, see `Attributes`.
- inline FuncAttributes attributes() const noexcept { return _attributes; }
+ ASMJIT_INLINE_NODEBUG FuncAttributes attributes() const noexcept { return _attributes; }
//! Checks whether the FuncFame contains an attribute `attr`.
- inline bool hasAttribute(FuncAttributes attr) const noexcept { return Support::test(_attributes, attr); }
+ ASMJIT_INLINE_NODEBUG bool hasAttribute(FuncAttributes attr) const noexcept { return Support::test(_attributes, attr); }
//! Adds attributes `attrs` to the FuncFrame.
- inline void addAttributes(FuncAttributes attrs) noexcept { _attributes |= attrs; }
+ ASMJIT_INLINE_NODEBUG void addAttributes(FuncAttributes attrs) noexcept { _attributes |= attrs; }
//! Clears attributes `attrs` from the FrameFrame.
- inline void clearAttributes(FuncAttributes attrs) noexcept { _attributes &= ~attrs; }
+ ASMJIT_INLINE_NODEBUG void clearAttributes(FuncAttributes attrs) noexcept { _attributes &= ~attrs; }
//! Tests whether the function has variable number of arguments.
- inline bool hasVarArgs() const noexcept { return hasAttribute(FuncAttributes::kHasVarArgs); }
+ ASMJIT_INLINE_NODEBUG bool hasVarArgs() const noexcept { return hasAttribute(FuncAttributes::kHasVarArgs); }
//! Sets the variable arguments flag.
- inline void setVarArgs() noexcept { addAttributes(FuncAttributes::kHasVarArgs); }
+ ASMJIT_INLINE_NODEBUG void setVarArgs() noexcept { addAttributes(FuncAttributes::kHasVarArgs); }
//! Resets variable arguments flag.
- inline void resetVarArgs() noexcept { clearAttributes(FuncAttributes::kHasVarArgs); }
+ ASMJIT_INLINE_NODEBUG void resetVarArgs() noexcept { clearAttributes(FuncAttributes::kHasVarArgs); }
//! Tests whether the function preserves frame pointer (EBP|ESP on X86).
- inline bool hasPreservedFP() const noexcept { return hasAttribute(FuncAttributes::kHasPreservedFP); }
+ ASMJIT_INLINE_NODEBUG bool hasPreservedFP() const noexcept { return hasAttribute(FuncAttributes::kHasPreservedFP); }
//! Enables preserved frame pointer.
- inline void setPreservedFP() noexcept { addAttributes(FuncAttributes::kHasPreservedFP); }
+ ASMJIT_INLINE_NODEBUG void setPreservedFP() noexcept { addAttributes(FuncAttributes::kHasPreservedFP); }
//! Disables preserved frame pointer.
- inline void resetPreservedFP() noexcept { clearAttributes(FuncAttributes::kHasPreservedFP); }
+ ASMJIT_INLINE_NODEBUG void resetPreservedFP() noexcept { clearAttributes(FuncAttributes::kHasPreservedFP); }
//! Tests whether the function calls other functions.
- inline bool hasFuncCalls() const noexcept { return hasAttribute(FuncAttributes::kHasFuncCalls); }
- //! Sets `kFlagHasCalls` to true.
- inline void setFuncCalls() noexcept { addAttributes(FuncAttributes::kHasFuncCalls); }
- //! Sets `kFlagHasCalls` to false.
- inline void resetFuncCalls() noexcept { clearAttributes(FuncAttributes::kHasFuncCalls); }
+ ASMJIT_INLINE_NODEBUG bool hasFuncCalls() const noexcept { return hasAttribute(FuncAttributes::kHasFuncCalls); }
+ //! Sets `FuncAttributes::kHasFuncCalls` to true.
+ ASMJIT_INLINE_NODEBUG void setFuncCalls() noexcept { addAttributes(FuncAttributes::kHasFuncCalls); }
+ //! Sets `FuncAttributes::kHasFuncCalls` to false.
+ ASMJIT_INLINE_NODEBUG void resetFuncCalls() noexcept { clearAttributes(FuncAttributes::kHasFuncCalls); }
+
+ //! Tests whether the function uses indirect branch protection, see \ref FuncAttributes::kIndirectBranchProtection.
+ ASMJIT_INLINE_NODEBUG bool hasIndirectBranchProtection() const noexcept { return hasAttribute(FuncAttributes::kIndirectBranchProtection); }
+ //! Enabled indirect branch protection (sets `FuncAttributes::kIndirectBranchProtection` attribute to true).
+ ASMJIT_INLINE_NODEBUG void setIndirectBranchProtection() noexcept { addAttributes(FuncAttributes::kIndirectBranchProtection); }
+ //! Disables indirect branch protection (sets `FuncAttributes::kIndirectBranchProtection` attribute to false).
+ ASMJIT_INLINE_NODEBUG void resetIndirectBranchProtection() noexcept { clearAttributes(FuncAttributes::kIndirectBranchProtection); }
//! Tests whether the function has AVX enabled.
- inline bool isAvxEnabled() const noexcept { return hasAttribute(FuncAttributes::kX86_AVXEnabled); }
+ ASMJIT_INLINE_NODEBUG bool isAvxEnabled() const noexcept { return hasAttribute(FuncAttributes::kX86_AVXEnabled); }
//! Enables AVX use.
- inline void setAvxEnabled() noexcept { addAttributes(FuncAttributes::kX86_AVXEnabled); }
+ ASMJIT_INLINE_NODEBUG void setAvxEnabled() noexcept { addAttributes(FuncAttributes::kX86_AVXEnabled); }
//! Disables AVX use.
- inline void resetAvxEnabled() noexcept { clearAttributes(FuncAttributes::kX86_AVXEnabled); }
+ ASMJIT_INLINE_NODEBUG void resetAvxEnabled() noexcept { clearAttributes(FuncAttributes::kX86_AVXEnabled); }
//! Tests whether the function has AVX-512 enabled.
- inline bool isAvx512Enabled() const noexcept { return hasAttribute(FuncAttributes::kX86_AVX512Enabled); }
+ ASMJIT_INLINE_NODEBUG bool isAvx512Enabled() const noexcept { return hasAttribute(FuncAttributes::kX86_AVX512Enabled); }
//! Enables AVX-512 use.
- inline void setAvx512Enabled() noexcept { addAttributes(FuncAttributes::kX86_AVX512Enabled); }
+ ASMJIT_INLINE_NODEBUG void setAvx512Enabled() noexcept { addAttributes(FuncAttributes::kX86_AVX512Enabled); }
//! Disables AVX-512 use.
- inline void resetAvx512Enabled() noexcept { clearAttributes(FuncAttributes::kX86_AVX512Enabled); }
+ ASMJIT_INLINE_NODEBUG void resetAvx512Enabled() noexcept { clearAttributes(FuncAttributes::kX86_AVX512Enabled); }
//! Tests whether the function has MMX cleanup - 'emms' instruction in epilog.
- inline bool hasMmxCleanup() const noexcept { return hasAttribute(FuncAttributes::kX86_MMXCleanup); }
+ ASMJIT_INLINE_NODEBUG bool hasMmxCleanup() const noexcept { return hasAttribute(FuncAttributes::kX86_MMXCleanup); }
//! Enables MMX cleanup.
- inline void setMmxCleanup() noexcept { addAttributes(FuncAttributes::kX86_MMXCleanup); }
+ ASMJIT_INLINE_NODEBUG void setMmxCleanup() noexcept { addAttributes(FuncAttributes::kX86_MMXCleanup); }
//! Disables MMX cleanup.
- inline void resetMmxCleanup() noexcept { clearAttributes(FuncAttributes::kX86_MMXCleanup); }
+ ASMJIT_INLINE_NODEBUG void resetMmxCleanup() noexcept { clearAttributes(FuncAttributes::kX86_MMXCleanup); }
//! Tests whether the function has AVX cleanup - 'vzeroupper' instruction in epilog.
- inline bool hasAvxCleanup() const noexcept { return hasAttribute(FuncAttributes::kX86_AVXCleanup); }
+ ASMJIT_INLINE_NODEBUG bool hasAvxCleanup() const noexcept { return hasAttribute(FuncAttributes::kX86_AVXCleanup); }
//! Enables AVX cleanup.
- inline void setAvxCleanup() noexcept { addAttributes(FuncAttributes::kX86_AVXCleanup); }
+ ASMJIT_INLINE_NODEBUG void setAvxCleanup() noexcept { addAttributes(FuncAttributes::kX86_AVXCleanup); }
//! Disables AVX cleanup.
- inline void resetAvxCleanup() noexcept { clearAttributes(FuncAttributes::kX86_AVXCleanup); }
+ ASMJIT_INLINE_NODEBUG void resetAvxCleanup() noexcept { clearAttributes(FuncAttributes::kX86_AVXCleanup); }
//! Tests whether the function uses call stack.
- inline bool hasCallStack() const noexcept { return _callStackSize != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasCallStack() const noexcept { return _callStackSize != 0; }
//! Tests whether the function uses local stack.
- inline bool hasLocalStack() const noexcept { return _localStackSize != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasLocalStack() const noexcept { return _localStackSize != 0; }
//! Tests whether vector registers can be saved and restored by using aligned reads and writes.
- inline bool hasAlignedVecSR() const noexcept { return hasAttribute(FuncAttributes::kAlignedVecSR); }
+ ASMJIT_INLINE_NODEBUG bool hasAlignedVecSR() const noexcept { return hasAttribute(FuncAttributes::kAlignedVecSR); }
//! Tests whether the function has to align stack dynamically.
- inline bool hasDynamicAlignment() const noexcept { return _finalStackAlignment >= _minDynamicAlignment; }
+ ASMJIT_INLINE_NODEBUG bool hasDynamicAlignment() const noexcept { return _finalStackAlignment >= _minDynamicAlignment; }
//! Tests whether the calling convention specifies 'RedZone'.
- inline bool hasRedZone() const noexcept { return _redZoneSize != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasRedZone() const noexcept { return _redZoneSize != 0; }
//! Tests whether the calling convention specifies 'SpillZone'.
- inline bool hasSpillZone() const noexcept { return _spillZoneSize != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasSpillZone() const noexcept { return _spillZoneSize != 0; }
//! Returns the size of 'RedZone'.
- inline uint32_t redZoneSize() const noexcept { return _redZoneSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t redZoneSize() const noexcept { return _redZoneSize; }
//! Returns the size of 'SpillZone'.
- inline uint32_t spillZoneSize() const noexcept { return _spillZoneSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t spillZoneSize() const noexcept { return _spillZoneSize; }
+
+ //! Resets the size of red zone, which would disable it entirely.
+ //!
+ //! \note Red zone is currently only used by an AMD64 SystemV calling convention, which expects 128
+ //! bytes of stack to be accessible below stack pointer. These bytes are then accessible within the
+ //! function and Compiler can use this space as a spill area. However, sometimes it's better to
+ //! disallow the use of red zone in case that a user wants to use this stack for a custom purpose.
+ ASMJIT_INLINE_NODEBUG void resetRedZone() noexcept { _redZoneSize = 0; }
+
//! Returns natural stack alignment (guaranteed stack alignment upon entry).
- inline uint32_t naturalStackAlignment() const noexcept { return _naturalStackAlignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t naturalStackAlignment() const noexcept { return _naturalStackAlignment; }
//! Returns natural stack alignment (guaranteed stack alignment upon entry).
- inline uint32_t minDynamicAlignment() const noexcept { return _minDynamicAlignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t minDynamicAlignment() const noexcept { return _minDynamicAlignment; }
//! Tests whether the callee must adjust SP before returning (X86-STDCALL only)
- inline bool hasCalleeStackCleanup() const noexcept { return _calleeStackCleanup != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasCalleeStackCleanup() const noexcept { return _calleeStackCleanup != 0; }
//! Returns home many bytes of the stack the callee must adjust before returning (X86-STDCALL only)
- inline uint32_t calleeStackCleanup() const noexcept { return _calleeStackCleanup; }
+ ASMJIT_INLINE_NODEBUG uint32_t calleeStackCleanup() const noexcept { return _calleeStackCleanup; }
//! Returns call stack alignment.
- inline uint32_t callStackAlignment() const noexcept { return _callStackAlignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t callStackAlignment() const noexcept { return _callStackAlignment; }
//! Returns local stack alignment.
- inline uint32_t localStackAlignment() const noexcept { return _localStackAlignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t localStackAlignment() const noexcept { return _localStackAlignment; }
//! Returns final stack alignment (the maximum value of call, local, and natural stack alignments).
- inline uint32_t finalStackAlignment() const noexcept { return _finalStackAlignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t finalStackAlignment() const noexcept { return _finalStackAlignment; }
//! Sets call stack alignment.
//!
@@ -1170,38 +1288,38 @@ public:
}
//! Returns call stack size.
- inline uint32_t callStackSize() const noexcept { return _callStackSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t callStackSize() const noexcept { return _callStackSize; }
//! Returns local stack size.
- inline uint32_t localStackSize() const noexcept { return _localStackSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t localStackSize() const noexcept { return _localStackSize; }
//! Sets call stack size.
- inline void setCallStackSize(uint32_t size) noexcept { _callStackSize = size; }
+ ASMJIT_INLINE_NODEBUG void setCallStackSize(uint32_t size) noexcept { _callStackSize = size; }
//! Sets local stack size.
- inline void setLocalStackSize(uint32_t size) noexcept { _localStackSize = size; }
+ ASMJIT_INLINE_NODEBUG void setLocalStackSize(uint32_t size) noexcept { _localStackSize = size; }
//! Combines call stack size with `size`, updating it to the greater value.
- inline void updateCallStackSize(uint32_t size) noexcept { _callStackSize = Support::max(_callStackSize, size); }
+ ASMJIT_INLINE_NODEBUG void updateCallStackSize(uint32_t size) noexcept { _callStackSize = Support::max(_callStackSize, size); }
//! Combines local stack size with `size`, updating it to the greater value.
- inline void updateLocalStackSize(uint32_t size) noexcept { _localStackSize = Support::max(_localStackSize, size); }
+ ASMJIT_INLINE_NODEBUG void updateLocalStackSize(uint32_t size) noexcept { _localStackSize = Support::max(_localStackSize, size); }
//! Returns final stack size (only valid after the FuncFrame is finalized).
- inline uint32_t finalStackSize() const noexcept { return _finalStackSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t finalStackSize() const noexcept { return _finalStackSize; }
//! Returns an offset to access the local stack (non-zero only if call stack is used).
- inline uint32_t localStackOffset() const noexcept { return _localStackOffset; }
+ ASMJIT_INLINE_NODEBUG uint32_t localStackOffset() const noexcept { return _localStackOffset; }
//! Tests whether the function prolog/epilog requires a memory slot for storing unaligned SP.
- inline bool hasDAOffset() const noexcept { return _daOffset != kTagInvalidOffset; }
+ ASMJIT_INLINE_NODEBUG bool hasDAOffset() const noexcept { return _daOffset != kTagInvalidOffset; }
//! Returns a memory offset used to store DA (dynamic alignment) slot (relative to SP).
- inline uint32_t daOffset() const noexcept { return _daOffset; }
+ ASMJIT_INLINE_NODEBUG uint32_t daOffset() const noexcept { return _daOffset; }
- inline uint32_t saOffset(uint32_t regId) const noexcept {
+ ASMJIT_INLINE_NODEBUG uint32_t saOffset(uint32_t regId) const noexcept {
return regId == _spRegId ? saOffsetFromSP()
: saOffsetFromSA();
}
- inline uint32_t saOffsetFromSP() const noexcept { return _saOffsetFromSP; }
- inline uint32_t saOffsetFromSA() const noexcept { return _saOffsetFromSA; }
+ ASMJIT_INLINE_NODEBUG uint32_t saOffsetFromSP() const noexcept { return _saOffsetFromSP; }
+ ASMJIT_INLINE_NODEBUG uint32_t saOffsetFromSA() const noexcept { return _saOffsetFromSA; }
//! Returns mask of registers of the given register `group` that are modified by the function. The engine would
//! then calculate which registers must be saved & restored by the function by using the data provided by the
@@ -1239,11 +1357,16 @@ public:
addDirtyRegs(std::forward<Args>(args)...);
}
- inline void setAllDirty() noexcept {
+ //! A helper function to set all registers from all register groups dirty.
+ //!
+ //! \note This should not be used in general as it's the most pessimistic case. However, it can be used for testing
+ //! or in cases in which all registers are considered clobbered.
+ ASMJIT_INLINE_NODEBUG void setAllDirty() noexcept {
for (size_t i = 0; i < ASMJIT_ARRAY_SIZE(_dirtyRegs); i++)
_dirtyRegs[i] = 0xFFFFFFFFu;
}
+ //! A helper function to set all registers from the given register `group` dirty.
inline void setAllDirty(RegGroup group) noexcept {
ASMJIT_ASSERT(group <= RegGroup::kMaxVirt);
_dirtyRegs[group] = 0xFFFFFFFFu;
@@ -1260,12 +1383,13 @@ public:
//! Returns the mask of preserved registers of the given register `group`.
//!
//! Preserved registers are those that must survive the function call unmodified. The function can only modify
- //! preserved registers it they are saved and restored in funciton's prolog and epilog, respectively.
+ //! preserved registers it they are saved and restored in function's prolog and epilog, respectively.
inline RegMask preservedRegs(RegGroup group) const noexcept {
ASMJIT_ASSERT(group <= RegGroup::kMaxVirt);
return _preservedRegs[group];
}
+ //! Returns the size of a save-restore are for the required register `group`.
inline uint32_t saveRestoreRegSize(RegGroup group) const noexcept {
ASMJIT_ASSERT(group <= RegGroup::kMaxVirt);
return _saveRestoreRegSize[group];
@@ -1276,35 +1400,35 @@ public:
return _saveRestoreAlignment[group];
}
- inline bool hasSARegId() const noexcept { return _saRegId != BaseReg::kIdBad; }
- inline uint32_t saRegId() const noexcept { return _saRegId; }
- inline void setSARegId(uint32_t regId) { _saRegId = uint8_t(regId); }
- inline void resetSARegId() { setSARegId(BaseReg::kIdBad); }
+ ASMJIT_INLINE_NODEBUG bool hasSARegId() const noexcept { return _saRegId != BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG uint32_t saRegId() const noexcept { return _saRegId; }
+ ASMJIT_INLINE_NODEBUG void setSARegId(uint32_t regId) { _saRegId = uint8_t(regId); }
+ ASMJIT_INLINE_NODEBUG void resetSARegId() { setSARegId(BaseReg::kIdBad); }
//! Returns stack size required to save/restore registers via push/pop.
- inline uint32_t pushPopSaveSize() const noexcept { return _pushPopSaveSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t pushPopSaveSize() const noexcept { return _pushPopSaveSize; }
//! Returns an offset to the stack where registers are saved via push/pop.
- inline uint32_t pushPopSaveOffset() const noexcept { return _pushPopSaveOffset; }
+ ASMJIT_INLINE_NODEBUG uint32_t pushPopSaveOffset() const noexcept { return _pushPopSaveOffset; }
//! Returns stack size required to save/restore extra registers that don't use push/pop/
//!
//! \note On X86 this covers all registers except GP registers, on other architectures it can be always
//! zero (for example AArch64 saves all registers via push/pop like instructions, so this would be zero).
- inline uint32_t extraRegSaveSize() const noexcept { return _extraRegSaveSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t extraRegSaveSize() const noexcept { return _extraRegSaveSize; }
//! Returns an offset to the stack where extra registers are saved.
- inline uint32_t extraRegSaveOffset() const noexcept { return _extraRegSaveOffset; }
+ ASMJIT_INLINE_NODEBUG uint32_t extraRegSaveOffset() const noexcept { return _extraRegSaveOffset; }
//! Tests whether the functions contains stack adjustment.
- inline bool hasStackAdjustment() const noexcept { return _stackAdjustment != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasStackAdjustment() const noexcept { return _stackAdjustment != 0; }
//! Returns function's stack adjustment used in function's prolog and epilog.
//!
//! If the returned value is zero it means that the stack is not adjusted. This can mean both that the stack
//! is not used and/or the stack is only adjusted by instructions that pust/pop registers into/from stack.
- inline uint32_t stackAdjustment() const noexcept { return _stackAdjustment; }
+ ASMJIT_INLINE_NODEBUG uint32_t stackAdjustment() const noexcept { return _stackAdjustment; }
//! \}
- //! \name Finaliztion
+ //! \name Finalization
//! \{
ASMJIT_API Error finalize() noexcept;
@@ -1320,25 +1444,27 @@ public:
//! \{
//! Function detail.
- const FuncDetail* _funcDetail;
+ const FuncDetail* _funcDetail {};
//! Register that can be used to access arguments passed by stack.
- uint8_t _saRegId;
+ uint8_t _saRegId = uint8_t(BaseReg::kIdBad);
//! Reserved for future use.
- uint8_t _reserved[3];
+ uint8_t _reserved[3] {};
//! Mapping of each function argument.
- FuncValuePack _argPacks[Globals::kMaxFuncArgs];
+ FuncValuePack _argPacks[Globals::kMaxFuncArgs] {};
//! \}
//! \name Construction & Destruction
//! \{
- inline explicit FuncArgsAssignment(const FuncDetail* fd = nullptr) noexcept { reset(fd); }
+ //! Creates either a default initialized `FuncArgsAssignment` or to assignment that links to `fd`, if non-null.
+ ASMJIT_INLINE_NODEBUG explicit FuncArgsAssignment(const FuncDetail* fd = nullptr) noexcept { reset(fd); }
- inline FuncArgsAssignment(const FuncArgsAssignment& other) noexcept {
- memcpy(this, &other, sizeof(*this));
- }
+ //! Copy constructor.
+ ASMJIT_INLINE_NODEBUG FuncArgsAssignment(const FuncArgsAssignment& other) noexcept = default;
+ //! Resets this `FuncArgsAssignment` to either default constructed state or to assignment that links to `fd`,
+ //! if non-null.
inline void reset(const FuncDetail* fd = nullptr) noexcept {
_funcDetail = fd;
_saRegId = uint8_t(BaseReg::kIdBad);
@@ -1348,58 +1474,80 @@ public:
//! \}
+ //! \name Overloaded Operators
+ //! \{
+
+ //! Copy assignment.
+ ASMJIT_INLINE_NODEBUG FuncArgsAssignment& operator=(const FuncArgsAssignment& other) noexcept = default;
+
+ //! \}
+
//! \name Accessors
//! \{
- inline const FuncDetail* funcDetail() const noexcept { return _funcDetail; }
- inline void setFuncDetail(const FuncDetail* fd) noexcept { _funcDetail = fd; }
+ //! Returns the associated \ref FuncDetail of this `FuncArgsAssignment`.
+ ASMJIT_INLINE_NODEBUG const FuncDetail* funcDetail() const noexcept { return _funcDetail; }
+ //! Associates \ref FuncDetails with this `FuncArgsAssignment`.
+ ASMJIT_INLINE_NODEBUG void setFuncDetail(const FuncDetail* fd) noexcept { _funcDetail = fd; }
- inline bool hasSARegId() const noexcept { return _saRegId != BaseReg::kIdBad; }
- inline uint32_t saRegId() const noexcept { return _saRegId; }
- inline void setSARegId(uint32_t regId) { _saRegId = uint8_t(regId); }
- inline void resetSARegId() { _saRegId = uint8_t(BaseReg::kIdBad); }
+ ASMJIT_INLINE_NODEBUG bool hasSARegId() const noexcept { return _saRegId != BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG uint32_t saRegId() const noexcept { return _saRegId; }
+ ASMJIT_INLINE_NODEBUG void setSARegId(uint32_t regId) { _saRegId = uint8_t(regId); }
+ ASMJIT_INLINE_NODEBUG void resetSARegId() { _saRegId = uint8_t(BaseReg::kIdBad); }
+ //! Returns assigned argument at `argIndex` and `valueIndex`.
+ //!
+ //! \note `argIndex` refers to he function argument and `valueIndex` refers to a value pack (in case multiple
+ //! values are passed as a single argument).
inline FuncValue& arg(size_t argIndex, size_t valueIndex) noexcept {
ASMJIT_ASSERT(argIndex < ASMJIT_ARRAY_SIZE(_argPacks));
return _argPacks[argIndex][valueIndex];
}
+ //! \overload
inline const FuncValue& arg(size_t argIndex, size_t valueIndex) const noexcept {
ASMJIT_ASSERT(argIndex < ASMJIT_ARRAY_SIZE(_argPacks));
return _argPacks[argIndex][valueIndex];
}
+ //! Tests whether argument at `argIndex` and `valueIndex` has been assigned.
inline bool isAssigned(size_t argIndex, size_t valueIndex) const noexcept {
ASMJIT_ASSERT(argIndex < ASMJIT_ARRAY_SIZE(_argPacks));
return _argPacks[argIndex][valueIndex].isAssigned();
}
+ //! Assigns register at `argIndex` and value index of 0 to `reg` and an optional `typeId`.
inline void assignReg(size_t argIndex, const BaseReg& reg, TypeId typeId = TypeId::kVoid) noexcept {
ASMJIT_ASSERT(argIndex < ASMJIT_ARRAY_SIZE(_argPacks));
ASMJIT_ASSERT(reg.isPhysReg());
_argPacks[argIndex][0].initReg(reg.type(), reg.id(), typeId);
}
+ //! Assigns register at `argIndex` and value index of 0 to `regType`, `regId`, and an optional `typeId`.
inline void assignReg(size_t argIndex, RegType regType, uint32_t regId, TypeId typeId = TypeId::kVoid) noexcept {
ASMJIT_ASSERT(argIndex < ASMJIT_ARRAY_SIZE(_argPacks));
_argPacks[argIndex][0].initReg(regType, regId, typeId);
}
+ //! Assigns stack at `argIndex` and value index of 0 to `offset` and an optional `typeId`.
inline void assignStack(size_t argIndex, int32_t offset, TypeId typeId = TypeId::kVoid) noexcept {
ASMJIT_ASSERT(argIndex < ASMJIT_ARRAY_SIZE(_argPacks));
_argPacks[argIndex][0].initStack(offset, typeId);
}
+ //! Assigns register at `argIndex` and `valueIndex` to `reg` and an optional `typeId`.
inline void assignRegInPack(size_t argIndex, size_t valueIndex, const BaseReg& reg, TypeId typeId = TypeId::kVoid) noexcept {
ASMJIT_ASSERT(argIndex < ASMJIT_ARRAY_SIZE(_argPacks));
ASMJIT_ASSERT(reg.isPhysReg());
_argPacks[argIndex][valueIndex].initReg(reg.type(), reg.id(), typeId);
}
+ //! Assigns register at `argIndex` and `valueIndex` to `regType`, `regId`, and an optional `typeId`.
inline void assignRegInPack(size_t argIndex, size_t valueIndex, RegType regType, uint32_t regId, TypeId typeId = TypeId::kVoid) noexcept {
ASMJIT_ASSERT(argIndex < ASMJIT_ARRAY_SIZE(_argPacks));
_argPacks[argIndex][valueIndex].initReg(regType, regId, typeId);
}
+ //! Assigns stack at `argIndex` and `valueIndex` to `offset` and an optional `typeId`.
inline void assignStackInPack(size_t argIndex, size_t valueIndex, int32_t offset, TypeId typeId = TypeId::kVoid) noexcept {
ASMJIT_ASSERT(argIndex < ASMJIT_ARRAY_SIZE(_argPacks));
_argPacks[argIndex][valueIndex].initStack(offset, typeId);
@@ -1418,6 +1566,9 @@ public:
_assignAllInternal(argIndex + 1, std::forward<Args>(args)...);
}
+ //! Assigns all argument at once.
+ //!
+ //! \note This function can be only used if the arguments don't contain value packs (multiple values per argument).
template<typename... Args>
inline void assignAll(Args&&... args) noexcept {
_assignAllInternal(0, std::forward<Args>(args)...);
@@ -1430,8 +1581,8 @@ public:
//! Update `FuncFrame` based on function's arguments assignment.
//!
- //! \note You MUST call this in orher to use `BaseEmitter::emitArgsAssignment()`, otherwise the FuncFrame would
- //! not contain the information necessary to assign all arguments into the registers and/or stack specified.
+ //! \note This function must be called in order to use `BaseEmitter::emitArgsAssignment()`, otherwise the \ref FuncFrame
+ //! would not contain the information necessary to assign all arguments into the registers and/or stack specified.
ASMJIT_API Error updateFuncFrame(FuncFrame& frame) const noexcept;
//! \}
@@ -1442,4 +1593,3 @@ public:
ASMJIT_END_NAMESPACE
#endif // ASMJIT_CORE_FUNC_H_INCLUDED
-
diff --git a/3rdparty/asmjit/src/asmjit/core/funcargscontext.cpp b/3rdparty/asmjit/src/asmjit/core/funcargscontext.cpp
index 1db50a7082a..a6580874089 100644
--- a/3rdparty/asmjit/src/asmjit/core/funcargscontext.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/funcargscontext.cpp
@@ -102,9 +102,23 @@ ASMJIT_FAVOR_SIZE Error FuncArgsContext::initWorkData(const FuncFrame& frame, co
ASMJIT_ASSERT(dstWd != nullptr);
dstWd->assign(varId, srcId);
- // The best case, register is allocated where it is expected to be.
- if (dstId == srcId)
- var.markDone();
+ // The best case, register is allocated where it is expected to be. However, we should
+ // not mark this as done if both registers are GP and sign or zero extension is required.
+ if (dstId == srcId) {
+ if (dstGroup != RegGroup::kGp) {
+ var.markDone();
+ }
+ else {
+ TypeId dt = dst.typeId();
+ TypeId st = src.typeId();
+
+ uint32_t dstSize = TypeUtils::sizeOf(dt);
+ uint32_t srcSize = TypeUtils::sizeOf(st);
+
+ if (dt == TypeId::kVoid || st == TypeId::kVoid || dstSize <= srcSize)
+ var.markDone();
+ }
+ }
}
else {
if (ASMJIT_UNLIKELY(srcGroup > RegGroup::kMaxVirt))
diff --git a/3rdparty/asmjit/src/asmjit/core/funcargscontext_p.h b/3rdparty/asmjit/src/asmjit/core/funcargscontext_p.h
index 72ee10585a4..a8ad6b47dcd 100644
--- a/3rdparty/asmjit/src/asmjit/core/funcargscontext_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/funcargscontext_p.h
@@ -176,14 +176,14 @@ public:
FuncArgsContext() noexcept;
- inline const ArchTraits& archTraits() const noexcept { return *_archTraits; }
- inline Arch arch() const noexcept { return _arch; }
+ ASMJIT_INLINE_NODEBUG const ArchTraits& archTraits() const noexcept { return *_archTraits; }
+ ASMJIT_INLINE_NODEBUG Arch arch() const noexcept { return _arch; }
- inline uint32_t varCount() const noexcept { return _varCount; }
- inline size_t indexOf(const Var* var) const noexcept { return (size_t)(var - _vars); }
+ ASMJIT_INLINE_NODEBUG uint32_t varCount() const noexcept { return _varCount; }
+ ASMJIT_INLINE_NODEBUG size_t indexOf(const Var* var) const noexcept { return (size_t)(var - _vars); }
- inline Var& var(size_t varId) noexcept { return _vars[varId]; }
- inline const Var& var(size_t varId) const noexcept { return _vars[varId]; }
+ ASMJIT_INLINE_NODEBUG Var& var(size_t varId) noexcept { return _vars[varId]; }
+ ASMJIT_INLINE_NODEBUG const Var& var(size_t varId) const noexcept { return _vars[varId]; }
Error initWorkData(const FuncFrame& frame, const FuncArgsAssignment& args, const RAConstraints* constraints) noexcept;
Error markScratchRegs(FuncFrame& frame) noexcept;
diff --git a/3rdparty/asmjit/src/asmjit/core/globals.cpp b/3rdparty/asmjit/src/asmjit/core/globals.cpp
index 2bbd0c0577d..4a98431b6d5 100644
--- a/3rdparty/asmjit/src/asmjit/core/globals.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/globals.cpp
@@ -86,6 +86,8 @@ ASMJIT_FAVOR_SIZE const char* DebugUtils::errorAsString(Error err) noexcept {
"ExpressionLabelNotBound\0"
"ExpressionOverflow\0"
"FailedToOpenAnonymousMemory\0"
+ "FailedToOpenFile\0"
+ "ProtectionFailure\0"
"<Unknown>\0";
static const uint16_t sErrorIndex[] = {
@@ -93,7 +95,7 @@ ASMJIT_FAVOR_SIZE const char* DebugUtils::errorAsString(Error err) noexcept {
247, 264, 283, 298, 314, 333, 352, 370, 392, 410, 429, 444, 460, 474, 488,
508, 533, 551, 573, 595, 612, 629, 645, 661, 677, 694, 709, 724, 744, 764,
784, 817, 837, 852, 869, 888, 909, 929, 943, 964, 978, 996, 1012, 1028, 1047,
- 1073, 1088, 1104, 1119, 1134, 1164, 1188, 1207, 1235
+ 1073, 1088, 1104, 1119, 1134, 1164, 1188, 1207, 1235, 1252, 1270
};
// @EnumStringEnd@
diff --git a/3rdparty/asmjit/src/asmjit/core/globals.h b/3rdparty/asmjit/src/asmjit/core/globals.h
index f2d3c6e63df..db921cfc6e1 100644
--- a/3rdparty/asmjit/src/asmjit/core/globals.h
+++ b/3rdparty/asmjit/src/asmjit/core/globals.h
@@ -14,9 +14,14 @@ ASMJIT_BEGIN_NAMESPACE
//! \addtogroup asmjit_utilities
//! \{
namespace Support {
- //! Cast designed to cast between function and void* pointers.
- template<typename Dst, typename Src>
- static inline Dst ptr_cast_impl(Src p) noexcept { return (Dst)p; }
+
+//! Cast designed to cast between function and void* pointers.
+template<typename Dst, typename Src>
+static inline Dst ptr_cast_impl(Src p) noexcept { return (Dst)p; }
+
+//! Helper to implement placement new/delete without relying on `<new>` header.
+struct PlacementNew { void* ptr; };
+
} // {Support}
#if defined(ASMJIT_NO_STDCXX)
@@ -25,17 +30,15 @@ namespace Support {
ASMJIT_FORCE_INLINE void operatorDelete(void* p) noexcept { if (p) free(p); }
} // {Support}
-#define ASMJIT_BASE_CLASS(TYPE) \
- ASMJIT_FORCE_INLINE void* operator new(size_t n) noexcept { \
- return Support::operatorNew(n); \
- } \
- \
- ASMJIT_FORCE_INLINE void operator delete(void* p) noexcept { \
- Support::operatorDelete(p); \
- } \
- \
- ASMJIT_FORCE_INLINE void* operator new(size_t, void* p) noexcept { return p; } \
- ASMJIT_FORCE_INLINE void operator delete(void*, void*) noexcept {}
+#define ASMJIT_BASE_CLASS(TYPE) \
+ ASMJIT_FORCE_INLINE void* operator new(size_t n) noexcept { return Support::operatorNew(n); } \
+ ASMJIT_FORCE_INLINE void operator delete(void* ptr) noexcept { Support::operatorDelete(ptr); } \
+ \
+ ASMJIT_FORCE_INLINE void* operator new(size_t, void* ptr) noexcept { return ptr; } \
+ ASMJIT_FORCE_INLINE void operator delete(void*, void*) noexcept {} \
+ \
+ ASMJIT_FORCE_INLINE void* operator new(size_t, Support::PlacementNew ptr) noexcept { return ptr.ptr; } \
+ ASMJIT_FORCE_INLINE void operator delete(void*, Support::PlacementNew) noexcept {}
#else
#define ASMJIT_BASE_CLASS(TYPE)
#endif
@@ -93,10 +96,9 @@ static constexpr uint32_t kMaxTreeHeight = (ASMJIT_ARCH_BITS == 32 ? 30 : 61) +
static constexpr uint32_t kMaxOpCount = 6;
//! Maximum arguments of a function supported by the Compiler / Function API.
-static constexpr uint32_t kMaxFuncArgs = 16;
+static constexpr uint32_t kMaxFuncArgs = 32;
-//! The number of values that can be assigned to a single function argument or
-//! return value.
+//! The number of values that can be assigned to a single function argument or return value.
static constexpr uint32_t kMaxValuePack = 4;
//! Maximum number of physical registers AsmJit can use per register group.
@@ -129,16 +131,20 @@ static constexpr uint32_t kNumVirtGroups = 4;
struct Init_ {};
struct NoInit_ {};
+//! A decorator used to initialize.
static const constexpr Init_ Init {};
+//! A decorator used to not initialize.
static const constexpr NoInit_ NoInit {};
} // {Globals}
+//! Casts a `void*` pointer `func` to a function pointer `Func`.
template<typename Func>
-static inline Func ptr_as_func(void* func) noexcept { return Support::ptr_cast_impl<Func, void*>(func); }
+static ASMJIT_INLINE_NODEBUG Func ptr_as_func(void* func) noexcept { return Support::ptr_cast_impl<Func, void*>(func); }
+//! Casts a function pointer `func` to a void pointer `void*`.
template<typename Func>
-static inline void* func_as_ptr(Func func) noexcept { return Support::ptr_cast_impl<void*, Func>(func); }
+static ASMJIT_INLINE_NODEBUG void* func_as_ptr(Func func) noexcept { return Support::ptr_cast_impl<void*, Func>(func); }
//! \}
@@ -175,7 +181,10 @@ enum ErrorCode : uint32_t {
//! The object is already initialized.
kErrorAlreadyInitialized,
- //! Built-in feature was disabled at compile time and it's not available.
+ //! Either a built-in feature was disabled at compile time and it's not available or the feature is not
+ //! available on the target platform.
+ //!
+ //! For example trying to allocate large pages on unsupported platform would return this error.
kErrorFeatureNotEnabled,
//! Too many handles (Windows) or file descriptors (Unix/Posix).
@@ -320,6 +329,15 @@ enum ErrorCode : uint32_t {
//! Failed to open anonymous memory handle or file descriptor.
kErrorFailedToOpenAnonymousMemory,
+ //! Failed to open a file.
+ //!
+ //! \note This is a generic error that is used by internal filesystem API.
+ kErrorFailedToOpenFile,
+
+ //! Protection failure can be returned from a virtual memory allocator or when trying to change memory access
+ //! permissions.
+ kErrorProtectionFailure,
+
// @EnumValuesEnd@
//! Count of AsmJit error codes.
@@ -332,7 +350,7 @@ namespace DebugUtils {
//! \cond INTERNAL
//! Used to silence warnings about unused arguments or variables.
template<typename... Args>
-static inline void unused(Args&&...) noexcept {}
+static ASMJIT_INLINE_NODEBUG void unused(Args&&...) noexcept {}
//! \endcond
//! Returns the error `err` passed.
@@ -390,4 +408,14 @@ ASMJIT_API void ASMJIT_NORETURN assertionFailed(const char* file, int line, cons
ASMJIT_END_NAMESPACE
+//! Implementation of a placement new so we don't have to depend on `<new>`.
+ASMJIT_INLINE_NODEBUG void* operator new(size_t, const asmjit::Support::PlacementNew& p) noexcept {
+#if defined(_MSC_VER) && !defined(__clang__)
+ __assume(p.ptr != nullptr); // Otherwise MSVC would emit a nullptr check.
+#endif
+ return p.ptr;
+}
+
+ASMJIT_INLINE_NODEBUG void operator delete(void*, const asmjit::Support::PlacementNew&) noexcept {}
+
#endif // ASMJIT_CORE_GLOBALS_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/core/inst.cpp b/3rdparty/asmjit/src/asmjit/core/inst.cpp
index 8f29d8b7585..ade4ae001f2 100644
--- a/3rdparty/asmjit/src/asmjit/core/inst.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/inst.cpp
@@ -24,12 +24,12 @@ ASMJIT_BEGIN_NAMESPACE
Error InstAPI::instIdToString(Arch arch, InstId instId, String& output) noexcept {
#if !defined(ASMJIT_NO_X86)
if (Environment::isFamilyX86(arch))
- return x86::InstInternal::instIdToString(arch, instId, output);
+ return x86::InstInternal::instIdToString(instId, output);
#endif
#if !defined(ASMJIT_NO_AARCH64)
if (Environment::isFamilyAArch64(arch))
- return a64::InstInternal::instIdToString(arch, instId, output);
+ return a64::InstInternal::instIdToString(instId, output);
#endif
return DebugUtils::errored(kErrorInvalidArch);
@@ -38,12 +38,12 @@ Error InstAPI::instIdToString(Arch arch, InstId instId, String& output) noexcept
InstId InstAPI::stringToInstId(Arch arch, const char* s, size_t len) noexcept {
#if !defined(ASMJIT_NO_X86)
if (Environment::isFamilyX86(arch))
- return x86::InstInternal::stringToInstId(arch, s, len);
+ return x86::InstInternal::stringToInstId(s, len);
#endif
#if !defined(ASMJIT_NO_AARCH64)
if (Environment::isFamilyAArch64(arch))
- return a64::InstInternal::stringToInstId(arch, s, len);
+ return a64::InstInternal::stringToInstId(s, len);
#endif
return 0;
@@ -56,13 +56,17 @@ InstId InstAPI::stringToInstId(Arch arch, const char* s, size_t len) noexcept {
#ifndef ASMJIT_NO_VALIDATION
Error InstAPI::validate(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept {
#if !defined(ASMJIT_NO_X86)
- if (Environment::isFamilyX86(arch))
- return x86::InstInternal::validate(arch, inst, operands, opCount, validationFlags);
+ if (Environment::isFamilyX86(arch)) {
+ if (arch == Arch::kX86)
+ return x86::InstInternal::validateX86(inst, operands, opCount, validationFlags);
+ else
+ return x86::InstInternal::validateX64(inst, operands, opCount, validationFlags);
+ }
#endif
#if !defined(ASMJIT_NO_AARCH64)
if (Environment::isFamilyAArch64(arch))
- return a64::InstInternal::validate(arch, inst, operands, opCount, validationFlags);
+ return a64::InstInternal::validate(inst, operands, opCount, validationFlags);
#endif
return DebugUtils::errored(kErrorInvalidArch);
@@ -84,7 +88,7 @@ Error InstAPI::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_* oper
#if !defined(ASMJIT_NO_AARCH64)
if (Environment::isFamilyAArch64(arch))
- return a64::InstInternal::queryRWInfo(arch, inst, operands, opCount, out);
+ return a64::InstInternal::queryRWInfo(inst, operands, opCount, out);
#endif
return DebugUtils::errored(kErrorInvalidArch);
@@ -103,7 +107,7 @@ Error InstAPI::queryFeatures(Arch arch, const BaseInst& inst, const Operand_* op
#if !defined(ASMJIT_NO_AARCH64)
if (Environment::isFamilyAArch64(arch))
- return a64::InstInternal::queryFeatures(arch, inst, operands, opCount, out);
+ return a64::InstInternal::queryFeatures(inst, operands, opCount, out);
#endif
return DebugUtils::errored(kErrorInvalidArch);
diff --git a/3rdparty/asmjit/src/asmjit/core/inst.h b/3rdparty/asmjit/src/asmjit/core/inst.h
index 643678971a7..a653fe8e4cc 100644
--- a/3rdparty/asmjit/src/asmjit/core/inst.h
+++ b/3rdparty/asmjit/src/asmjit/core/inst.h
@@ -20,7 +20,7 @@ ASMJIT_BEGIN_NAMESPACE
//!
//! Each architecture has a set of valid instructions indexed from 0. Instruction with 0 id is, however, a special
//! instruction that describes a "no instruction" or "invalid instruction". Different architectures can assign a.
-//! different instruction to the same id, each architecture typicall has its own instructions indexed from 1.
+//! different instruction to the same id, each architecture typically has its own instructions indexed from 1.
//!
//! Instruction identifiers listed by architecture:
//!
@@ -189,7 +189,7 @@ enum class InstControlFlow : uint32_t {
//! Hint that is used when both input operands to the instruction are the same.
//!
-//! Provides hints to the instrution RW query regarding special cases in which two or more operands are the same
+//! Provides hints to the instruction RW query regarding special cases in which two or more operands are the same
//! registers. This is required by instructions such as XOR, AND, OR, SUB, etc... These hints will influence the
//! RW operations query.
enum class InstSameRegHint : uint8_t {
@@ -231,17 +231,17 @@ public:
//!
//! Default values of `id` and `options` are zero, which means 'none' instruction. Such instruction is guaranteed
//! to never exist for any architecture supported by AsmJit.
- inline explicit BaseInst(InstId instId = 0, InstOptions options = InstOptions::kNone) noexcept
+ ASMJIT_INLINE_NODEBUG explicit BaseInst(InstId instId = 0, InstOptions options = InstOptions::kNone) noexcept
: _id(instId),
_options(options),
_extraReg() {}
- inline BaseInst(InstId instId, InstOptions options, const RegOnly& extraReg) noexcept
+ ASMJIT_INLINE_NODEBUG BaseInst(InstId instId, InstOptions options, const RegOnly& extraReg) noexcept
: _id(instId),
_options(options),
_extraReg(extraReg) {}
- inline BaseInst(InstId instId, InstOptions options, const BaseReg& extraReg) noexcept
+ ASMJIT_INLINE_NODEBUG BaseInst(InstId instId, InstOptions options, const BaseReg& extraReg) noexcept
: _id(instId),
_options(options),
_extraReg { extraReg.signature(), extraReg.id() } {}
@@ -252,22 +252,22 @@ public:
//! \{
//! Returns the instruction id with modifiers.
- inline InstId id() const noexcept { return _id; }
+ ASMJIT_INLINE_NODEBUG InstId id() const noexcept { return _id; }
//! Sets the instruction id and modiiers from `id`.
- inline void setId(InstId id) noexcept { _id = id; }
+ ASMJIT_INLINE_NODEBUG void setId(InstId id) noexcept { _id = id; }
//! Resets the instruction id and modifiers to zero, see \ref kIdNone.
- inline void resetId() noexcept { _id = 0; }
+ ASMJIT_INLINE_NODEBUG void resetId() noexcept { _id = 0; }
//! Returns a real instruction id that doesn't contain any modifiers.
- inline InstId realId() const noexcept { return _id & uint32_t(InstIdParts::kRealId); }
+ ASMJIT_INLINE_NODEBUG InstId realId() const noexcept { return _id & uint32_t(InstIdParts::kRealId); }
template<InstIdParts kPart>
- inline uint32_t getInstIdPart() const noexcept {
+ ASMJIT_INLINE_NODEBUG uint32_t getInstIdPart() const noexcept {
return (uint32_t(_id) & uint32_t(kPart)) >> Support::ConstCTZ<uint32_t(kPart)>::value;
}
template<InstIdParts kPart>
- inline void setInstIdPart(uint32_t value) noexcept {
+ ASMJIT_INLINE_NODEBUG void setInstIdPart(uint32_t value) noexcept {
_id = (_id & ~uint32_t(kPart)) | (value << Support::ConstCTZ<uint32_t(kPart)>::value);
}
@@ -276,47 +276,61 @@ public:
//! \name Instruction Options
//! \{
- inline InstOptions options() const noexcept { return _options; }
- inline bool hasOption(InstOptions option) const noexcept { return Support::test(_options, option); }
- inline void setOptions(InstOptions options) noexcept { _options = options; }
- inline void addOptions(InstOptions options) noexcept { _options |= options; }
- inline void clearOptions(InstOptions options) noexcept { _options &= ~options; }
- inline void resetOptions() noexcept { _options = InstOptions::kNone; }
+ ASMJIT_INLINE_NODEBUG InstOptions options() const noexcept { return _options; }
+ ASMJIT_INLINE_NODEBUG bool hasOption(InstOptions option) const noexcept { return Support::test(_options, option); }
+ ASMJIT_INLINE_NODEBUG void setOptions(InstOptions options) noexcept { _options = options; }
+ ASMJIT_INLINE_NODEBUG void addOptions(InstOptions options) noexcept { _options |= options; }
+ ASMJIT_INLINE_NODEBUG void clearOptions(InstOptions options) noexcept { _options &= ~options; }
+ ASMJIT_INLINE_NODEBUG void resetOptions() noexcept { _options = InstOptions::kNone; }
//! \}
//! \name Extra Register
//! \{
- inline bool hasExtraReg() const noexcept { return _extraReg.isReg(); }
- inline RegOnly& extraReg() noexcept { return _extraReg; }
- inline const RegOnly& extraReg() const noexcept { return _extraReg; }
- inline void setExtraReg(const BaseReg& reg) noexcept { _extraReg.init(reg); }
- inline void setExtraReg(const RegOnly& reg) noexcept { _extraReg.init(reg); }
- inline void resetExtraReg() noexcept { _extraReg.reset(); }
+ ASMJIT_INLINE_NODEBUG bool hasExtraReg() const noexcept { return _extraReg.isReg(); }
+ ASMJIT_INLINE_NODEBUG RegOnly& extraReg() noexcept { return _extraReg; }
+ ASMJIT_INLINE_NODEBUG const RegOnly& extraReg() const noexcept { return _extraReg; }
+ ASMJIT_INLINE_NODEBUG void setExtraReg(const BaseReg& reg) noexcept { _extraReg.init(reg); }
+ ASMJIT_INLINE_NODEBUG void setExtraReg(const RegOnly& reg) noexcept { _extraReg.init(reg); }
+ ASMJIT_INLINE_NODEBUG void resetExtraReg() noexcept { _extraReg.reset(); }
//! \}
//! \name ARM Specific
//! \{
- inline arm::CondCode armCondCode() const noexcept { return (arm::CondCode)getInstIdPart<InstIdParts::kARM_Cond>(); }
- inline void setArmCondCode(arm::CondCode cc) noexcept { setInstIdPart<InstIdParts::kARM_Cond>(uint32_t(cc)); }
+ ASMJIT_INLINE_NODEBUG arm::CondCode armCondCode() const noexcept { return (arm::CondCode)getInstIdPart<InstIdParts::kARM_Cond>(); }
+ ASMJIT_INLINE_NODEBUG void setArmCondCode(arm::CondCode cc) noexcept { setInstIdPart<InstIdParts::kARM_Cond>(uint32_t(cc)); }
+
+ ASMJIT_INLINE_NODEBUG a32::DataType armDt() const noexcept { return (a32::DataType)getInstIdPart<InstIdParts::kA32_DT>(); }
+ ASMJIT_INLINE_NODEBUG a32::DataType armDt2() const noexcept { return (a32::DataType)getInstIdPart<InstIdParts::kA32_DT2>(); }
//! \}
//! \name Statics
//! \{
- static inline constexpr InstId composeARMInstId(uint32_t id, arm::CondCode cc) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr InstId composeARMInstId(uint32_t id, arm::CondCode cc) noexcept {
return id | (uint32_t(cc) << Support::ConstCTZ<uint32_t(InstIdParts::kARM_Cond)>::value);
}
- static inline constexpr InstId extractRealId(uint32_t id) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr InstId composeARMInstId(uint32_t id, a32::DataType dt, arm::CondCode cc = arm::CondCode::kAL) noexcept {
+ return id | (uint32_t(dt) << Support::ConstCTZ<uint32_t(InstIdParts::kA32_DT)>::value)
+ | (uint32_t(cc) << Support::ConstCTZ<uint32_t(InstIdParts::kARM_Cond)>::value);
+ }
+
+ static ASMJIT_INLINE_NODEBUG constexpr InstId composeARMInstId(uint32_t id, a32::DataType dt, a32::DataType dt2, arm::CondCode cc = arm::CondCode::kAL) noexcept {
+ return id | (uint32_t(dt) << Support::ConstCTZ<uint32_t(InstIdParts::kA32_DT)>::value)
+ | (uint32_t(dt2) << Support::ConstCTZ<uint32_t(InstIdParts::kA32_DT2)>::value)
+ | (uint32_t(cc) << Support::ConstCTZ<uint32_t(InstIdParts::kARM_Cond)>::value);
+ }
+
+ static ASMJIT_INLINE_NODEBUG constexpr InstId extractRealId(uint32_t id) noexcept {
return id & uint32_t(InstIdParts::kRealId);
}
- static inline constexpr arm::CondCode extractARMCondCode(uint32_t id) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr arm::CondCode extractARMCondCode(uint32_t id) noexcept {
return (arm::CondCode)((uint32_t(id) & uint32_t(InstIdParts::kARM_Cond)) >> Support::ConstCTZ<uint32_t(InstIdParts::kARM_Cond)>::value);
}
@@ -333,16 +347,16 @@ enum class CpuRWFlags : uint32_t {
// Common RW Flags (0x000000FF)
// ----------------------------
- //! Carry flag.
- kCF = 0x00000001u,
//! Signed overflow flag.
- kOF = 0x00000002u,
- //! Sign flag (negative/sign, if set).
- kSF = 0x00000004u,
+ kOF = 0x00000001u,
+ //! Carry flag.
+ kCF = 0x00000002u,
//! Zero and/or equality flag (1 if zero/equal).
- kZF = 0x00000008u,
+ kZF = 0x00000004u,
+ //! Sign flag (negative/sign, if set).
+ kSF = 0x00000008u,
- // X86 Specific RW Flags (0xFFFFFF00)
+ // X86 Specific RW Flags
// ----------------------------------
//! Carry flag (X86, X86_64).
@@ -373,12 +387,22 @@ enum class CpuRWFlags : uint32_t {
//! FPU C2 status flag (X86, X86_64).
kX86_C2 = 0x00040000u,
//! FPU C3 status flag (X86, X86_64).
- kX86_C3 = 0x00080000u
+ kX86_C3 = 0x00080000u,
+
+ // ARM Specific RW Flags
+ // ----------------------------------
+
+ kARM_V = kOF,
+ kARM_C = kCF,
+ kARM_Z = kZF,
+ kARM_N = kSF,
+ kARM_Q = 0x00000100u,
+ kARM_GE = 0x00000200u
};
ASMJIT_DEFINE_ENUM_FLAGS(CpuRWFlags)
//! Operand read/write flags describe how the operand is accessed and some additional features.
-enum class OpRWFlags {
+enum class OpRWFlags : uint32_t {
//! No flags.
kNone = 0,
@@ -406,6 +430,9 @@ enum class OpRWFlags {
//! The `extendByteMask()` represents a zero extension.
kZExt = 0x00000010u,
+ //! The register must have assigned a unique physical ID, which cannot be assigned to any other register.
+ kUnique = 0x00000080u,
+
//! Register operand must use \ref OpRWInfo::physId().
kRegPhysId = 0x00000100u,
//! Base register of a memory operand must use \ref OpRWInfo::physId().
@@ -474,7 +501,7 @@ struct OpRWInfo {
//! \{
//! Resets this operand information to all zeros.
- inline void reset() noexcept { memset(this, 0, sizeof(*this)); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = OpRWInfo{}; }
//! Resets this operand info (resets all members) and set common information
//! to the given `opFlags`, `regSize`, and possibly `physId`.
@@ -485,13 +512,14 @@ struct OpRWInfo {
_consecutiveLeadCount = 0;
_resetReserved();
- uint64_t mask = Support::lsbMask<uint64_t>(regSize);
+ uint64_t mask = Support::lsbMask<uint64_t>(Support::min<uint32_t>(regSize, 64));
+
_readByteMask = Support::test(opFlags, OpRWFlags::kRead) ? mask : uint64_t(0);
_writeByteMask = Support::test(opFlags, OpRWFlags::kWrite) ? mask : uint64_t(0);
_extendByteMask = 0;
}
- inline void _resetReserved() noexcept {
+ ASMJIT_INLINE_NODEBUG void _resetReserved() noexcept {
_reserved[0] = 0;
}
@@ -501,36 +529,40 @@ struct OpRWInfo {
//! \{
//! Returns operand flags.
- inline OpRWFlags opFlags() const noexcept { return _opFlags; }
+ ASMJIT_INLINE_NODEBUG OpRWFlags opFlags() const noexcept { return _opFlags; }
//! Tests whether operand flags contain the given `flag`.
- inline bool hasOpFlag(OpRWFlags flag) const noexcept { return Support::test(_opFlags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasOpFlag(OpRWFlags flag) const noexcept { return Support::test(_opFlags, flag); }
//! Adds the given `flags` to operand flags.
- inline void addOpFlags(OpRWFlags flags) noexcept { _opFlags |= flags; }
+ ASMJIT_INLINE_NODEBUG void addOpFlags(OpRWFlags flags) noexcept { _opFlags |= flags; }
//! Removes the given `flags` from operand flags.
- inline void clearOpFlags(OpRWFlags flags) noexcept { _opFlags &= ~flags; }
+ ASMJIT_INLINE_NODEBUG void clearOpFlags(OpRWFlags flags) noexcept { _opFlags &= ~flags; }
//! Tests whether this operand is read from.
- inline bool isRead() const noexcept { return hasOpFlag(OpRWFlags::kRead); }
+ ASMJIT_INLINE_NODEBUG bool isRead() const noexcept { return hasOpFlag(OpRWFlags::kRead); }
//! Tests whether this operand is written to.
- inline bool isWrite() const noexcept { return hasOpFlag(OpRWFlags::kWrite); }
+ ASMJIT_INLINE_NODEBUG bool isWrite() const noexcept { return hasOpFlag(OpRWFlags::kWrite); }
//! Tests whether this operand is both read and write.
- inline bool isReadWrite() const noexcept { return (_opFlags & OpRWFlags::kRW) == OpRWFlags::kRW; }
+ ASMJIT_INLINE_NODEBUG bool isReadWrite() const noexcept { return (_opFlags & OpRWFlags::kRW) == OpRWFlags::kRW; }
//! Tests whether this operand is read only.
- inline bool isReadOnly() const noexcept { return (_opFlags & OpRWFlags::kRW) == OpRWFlags::kRead; }
+ ASMJIT_INLINE_NODEBUG bool isReadOnly() const noexcept { return (_opFlags & OpRWFlags::kRW) == OpRWFlags::kRead; }
//! Tests whether this operand is write only.
- inline bool isWriteOnly() const noexcept { return (_opFlags & OpRWFlags::kRW) == OpRWFlags::kWrite; }
+ ASMJIT_INLINE_NODEBUG bool isWriteOnly() const noexcept { return (_opFlags & OpRWFlags::kRW) == OpRWFlags::kWrite; }
//! Returns the type of a lead register, which is followed by consecutive registers.
- inline uint32_t consecutiveLeadCount() const noexcept { return _consecutiveLeadCount; }
+ ASMJIT_INLINE_NODEBUG uint32_t consecutiveLeadCount() const noexcept { return _consecutiveLeadCount; }
//! Tests whether this operand is Reg/Mem
//!
//! Reg/Mem operands can use either register or memory.
- inline bool isRm() const noexcept { return hasOpFlag(OpRWFlags::kRegMem); }
+ ASMJIT_INLINE_NODEBUG bool isRm() const noexcept { return hasOpFlag(OpRWFlags::kRegMem); }
//! Tests whether the operand will be zero extended.
- inline bool isZExt() const noexcept { return hasOpFlag(OpRWFlags::kZExt); }
+ ASMJIT_INLINE_NODEBUG bool isZExt() const noexcept { return hasOpFlag(OpRWFlags::kZExt); }
+
+ //! Tests whether the operand must have allocated a unique physical id that cannot be shared with other register
+ //! operands.
+ ASMJIT_INLINE_NODEBUG bool isUnique() const noexcept { return hasOpFlag(OpRWFlags::kUnique); }
//! \}
@@ -539,38 +571,38 @@ struct OpRWInfo {
//! Tests whether this is a fake memory operand, which is only used, because of encoding. Fake memory operands do
//! not access any memory, they are only used to encode registers.
- inline bool isMemFake() const noexcept { return hasOpFlag(OpRWFlags::kMemFake); }
+ ASMJIT_INLINE_NODEBUG bool isMemFake() const noexcept { return hasOpFlag(OpRWFlags::kMemFake); }
//! Tests whether the instruction's memory BASE register is used.
- inline bool isMemBaseUsed() const noexcept { return hasOpFlag(OpRWFlags::kMemBaseRW); }
+ ASMJIT_INLINE_NODEBUG bool isMemBaseUsed() const noexcept { return hasOpFlag(OpRWFlags::kMemBaseRW); }
//! Tests whether the instruction reads from its BASE registers.
- inline bool isMemBaseRead() const noexcept { return hasOpFlag(OpRWFlags::kMemBaseRead); }
+ ASMJIT_INLINE_NODEBUG bool isMemBaseRead() const noexcept { return hasOpFlag(OpRWFlags::kMemBaseRead); }
//! Tests whether the instruction writes to its BASE registers.
- inline bool isMemBaseWrite() const noexcept { return hasOpFlag(OpRWFlags::kMemBaseWrite); }
+ ASMJIT_INLINE_NODEBUG bool isMemBaseWrite() const noexcept { return hasOpFlag(OpRWFlags::kMemBaseWrite); }
//! Tests whether the instruction reads and writes from/to its BASE registers.
- inline bool isMemBaseReadWrite() const noexcept { return (_opFlags & OpRWFlags::kMemBaseRW) == OpRWFlags::kMemBaseRW; }
+ ASMJIT_INLINE_NODEBUG bool isMemBaseReadWrite() const noexcept { return (_opFlags & OpRWFlags::kMemBaseRW) == OpRWFlags::kMemBaseRW; }
//! Tests whether the instruction only reads from its BASE registers.
- inline bool isMemBaseReadOnly() const noexcept { return (_opFlags & OpRWFlags::kMemBaseRW) == OpRWFlags::kMemBaseRead; }
+ ASMJIT_INLINE_NODEBUG bool isMemBaseReadOnly() const noexcept { return (_opFlags & OpRWFlags::kMemBaseRW) == OpRWFlags::kMemBaseRead; }
//! Tests whether the instruction only writes to its BASE registers.
- inline bool isMemBaseWriteOnly() const noexcept { return (_opFlags & OpRWFlags::kMemBaseRW) == OpRWFlags::kMemBaseWrite; }
+ ASMJIT_INLINE_NODEBUG bool isMemBaseWriteOnly() const noexcept { return (_opFlags & OpRWFlags::kMemBaseRW) == OpRWFlags::kMemBaseWrite; }
//! Tests whether the instruction modifies the BASE register before it uses it to calculate the target address.
- inline bool isMemBasePreModify() const noexcept { return hasOpFlag(OpRWFlags::kMemBasePreModify); }
+ ASMJIT_INLINE_NODEBUG bool isMemBasePreModify() const noexcept { return hasOpFlag(OpRWFlags::kMemBasePreModify); }
//! Tests whether the instruction modifies the BASE register after it uses it to calculate the target address.
- inline bool isMemBasePostModify() const noexcept { return hasOpFlag(OpRWFlags::kMemBasePostModify); }
+ ASMJIT_INLINE_NODEBUG bool isMemBasePostModify() const noexcept { return hasOpFlag(OpRWFlags::kMemBasePostModify); }
//! Tests whether the instruction's memory INDEX register is used.
- inline bool isMemIndexUsed() const noexcept { return hasOpFlag(OpRWFlags::kMemIndexRW); }
+ ASMJIT_INLINE_NODEBUG bool isMemIndexUsed() const noexcept { return hasOpFlag(OpRWFlags::kMemIndexRW); }
//! Tests whether the instruction reads the INDEX registers.
- inline bool isMemIndexRead() const noexcept { return hasOpFlag(OpRWFlags::kMemIndexRead); }
+ ASMJIT_INLINE_NODEBUG bool isMemIndexRead() const noexcept { return hasOpFlag(OpRWFlags::kMemIndexRead); }
//! Tests whether the instruction writes to its INDEX registers.
- inline bool isMemIndexWrite() const noexcept { return hasOpFlag(OpRWFlags::kMemIndexWrite); }
+ ASMJIT_INLINE_NODEBUG bool isMemIndexWrite() const noexcept { return hasOpFlag(OpRWFlags::kMemIndexWrite); }
//! Tests whether the instruction reads and writes from/to its INDEX registers.
- inline bool isMemIndexReadWrite() const noexcept { return (_opFlags & OpRWFlags::kMemIndexRW) == OpRWFlags::kMemIndexRW; }
+ ASMJIT_INLINE_NODEBUG bool isMemIndexReadWrite() const noexcept { return (_opFlags & OpRWFlags::kMemIndexRW) == OpRWFlags::kMemIndexRW; }
//! Tests whether the instruction only reads from its INDEX registers.
- inline bool isMemIndexReadOnly() const noexcept { return (_opFlags & OpRWFlags::kMemIndexRW) == OpRWFlags::kMemIndexRead; }
+ ASMJIT_INLINE_NODEBUG bool isMemIndexReadOnly() const noexcept { return (_opFlags & OpRWFlags::kMemIndexRW) == OpRWFlags::kMemIndexRead; }
//! Tests whether the instruction only writes to its INDEX registers.
- inline bool isMemIndexWriteOnly() const noexcept { return (_opFlags & OpRWFlags::kMemIndexRW) == OpRWFlags::kMemIndexWrite; }
+ ASMJIT_INLINE_NODEBUG bool isMemIndexWriteOnly() const noexcept { return (_opFlags & OpRWFlags::kMemIndexRW) == OpRWFlags::kMemIndexWrite; }
//! \}
@@ -580,11 +612,11 @@ struct OpRWInfo {
//! Returns a physical id of the register that is fixed for this operand.
//!
//! Returns \ref BaseReg::kIdBad if any register can be used.
- inline uint32_t physId() const noexcept { return _physId; }
+ ASMJIT_INLINE_NODEBUG uint32_t physId() const noexcept { return _physId; }
//! Tests whether \ref physId() would return a valid physical register id.
- inline bool hasPhysId() const noexcept { return _physId != BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG bool hasPhysId() const noexcept { return _physId != BaseReg::kIdBad; }
//! Sets physical register id, which would be fixed for this operand.
- inline void setPhysId(uint32_t physId) noexcept { _physId = uint8_t(physId); }
+ ASMJIT_INLINE_NODEBUG void setPhysId(uint32_t physId) noexcept { _physId = uint8_t(physId); }
//! \}
@@ -592,9 +624,9 @@ struct OpRWInfo {
//! \{
//! Returns Reg/Mem size of the operand.
- inline uint32_t rmSize() const noexcept { return _rmSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t rmSize() const noexcept { return _rmSize; }
//! Sets Reg/Mem size of the operand.
- inline void setRmSize(uint32_t rmSize) noexcept { _rmSize = uint8_t(rmSize); }
+ ASMJIT_INLINE_NODEBUG void setRmSize(uint32_t rmSize) noexcept { _rmSize = uint8_t(rmSize); }
//! \}
@@ -602,18 +634,18 @@ struct OpRWInfo {
//! \{
//! Returns read mask.
- inline uint64_t readByteMask() const noexcept { return _readByteMask; }
+ ASMJIT_INLINE_NODEBUG uint64_t readByteMask() const noexcept { return _readByteMask; }
//! Returns write mask.
- inline uint64_t writeByteMask() const noexcept { return _writeByteMask; }
+ ASMJIT_INLINE_NODEBUG uint64_t writeByteMask() const noexcept { return _writeByteMask; }
//! Returns extend mask.
- inline uint64_t extendByteMask() const noexcept { return _extendByteMask; }
+ ASMJIT_INLINE_NODEBUG uint64_t extendByteMask() const noexcept { return _extendByteMask; }
//! Sets read mask.
- inline void setReadByteMask(uint64_t mask) noexcept { _readByteMask = mask; }
+ ASMJIT_INLINE_NODEBUG void setReadByteMask(uint64_t mask) noexcept { _readByteMask = mask; }
//! Sets write mask.
- inline void setWriteByteMask(uint64_t mask) noexcept { _writeByteMask = mask; }
- //! Sets externd mask.
- inline void setExtendByteMask(uint64_t mask) noexcept { _extendByteMask = mask; }
+ ASMJIT_INLINE_NODEBUG void setWriteByteMask(uint64_t mask) noexcept { _writeByteMask = mask; }
+ //! Sets extend mask.
+ ASMJIT_INLINE_NODEBUG void setExtendByteMask(uint64_t mask) noexcept { _extendByteMask = mask; }
//! \}
};
@@ -647,7 +679,7 @@ struct InstRWInfo {
uint8_t _rmFeature;
//! Reserved for future use.
uint8_t _reserved[18];
- //! Read/Write onfo of extra register (rep{} or kz{}).
+ //! Read/Write info of extra register (rep{} or kz{}).
OpRWInfo _extraReg;
//! Read/Write info of instruction operands.
OpRWInfo _operands[Globals::kMaxOpCount];
@@ -658,7 +690,7 @@ struct InstRWInfo {
//! \{
//! Resets this RW information to all zeros.
- inline void reset() noexcept { memset(this, 0, sizeof(*this)); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = InstRWInfo{}; }
//! \}
@@ -666,13 +698,13 @@ struct InstRWInfo {
//! \{
//! Returns flags associated with the instruction, see \ref InstRWFlags.
- inline InstRWFlags instFlags() const noexcept { return _instFlags; }
+ ASMJIT_INLINE_NODEBUG InstRWFlags instFlags() const noexcept { return _instFlags; }
//! Tests whether the instruction flags contain `flag`.
- inline bool hasInstFlag(InstRWFlags flag) const noexcept { return Support::test(_instFlags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasInstFlag(InstRWFlags flag) const noexcept { return Support::test(_instFlags, flag); }
//! Tests whether the instruction flags contain \ref InstRWFlags::kMovOp.
- inline bool isMovOp() const noexcept { return hasInstFlag(InstRWFlags::kMovOp); }
+ ASMJIT_INLINE_NODEBUG bool isMovOp() const noexcept { return hasInstFlag(InstRWFlags::kMovOp); }
//! \}
@@ -680,9 +712,9 @@ struct InstRWInfo {
//! \{
//! Returns a mask of CPU flags read.
- inline CpuRWFlags readFlags() const noexcept { return _readFlags; }
+ ASMJIT_INLINE_NODEBUG CpuRWFlags readFlags() const noexcept { return _readFlags; }
//! Returns a mask of CPU flags written.
- inline CpuRWFlags writeFlags() const noexcept { return _writeFlags; }
+ ASMJIT_INLINE_NODEBUG CpuRWFlags writeFlags() const noexcept { return _writeFlags; }
//! \}
@@ -699,7 +731,7 @@ struct InstRWInfo {
//! Some AVX+ instructions may require extra features for replacing registers with memory operands, for example
//! VPSLLDQ instruction only supports `vpslldq reg, reg, imm` combination on AVX/AVX2 capable CPUs and requires
//! AVX-512 for `vpslldq reg, mem, imm` combination.
- inline uint32_t rmFeature() const noexcept { return _rmFeature; }
+ ASMJIT_INLINE_NODEBUG uint32_t rmFeature() const noexcept { return _rmFeature; }
//! \}
@@ -707,10 +739,10 @@ struct InstRWInfo {
//! \{
//! Returns RW information of extra register operand (extraReg).
- inline const OpRWInfo& extraReg() const noexcept { return _extraReg; }
+ ASMJIT_INLINE_NODEBUG const OpRWInfo& extraReg() const noexcept { return _extraReg; }
//! Returns RW information of all instruction's operands.
- inline const OpRWInfo* operands() const noexcept { return _operands; }
+ ASMJIT_INLINE_NODEBUG const OpRWInfo* operands() const noexcept { return _operands; }
//! Returns RW information of the operand at the given `index`.
inline const OpRWInfo& operand(size_t index) const noexcept {
@@ -719,7 +751,7 @@ struct InstRWInfo {
}
//! Returns the number of operands this instruction has.
- inline uint32_t opCount() const noexcept { return _opCount; }
+ ASMJIT_INLINE_NODEBUG uint32_t opCount() const noexcept { return _opCount; }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/instdb.cpp b/3rdparty/asmjit/src/asmjit/core/instdb.cpp
new file mode 100644
index 00000000000..cde369f6a18
--- /dev/null
+++ b/3rdparty/asmjit/src/asmjit/core/instdb.cpp
@@ -0,0 +1,101 @@
+// This file is part of AsmJit project <https://asmjit.com>
+//
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
+
+#include "../core/api-build_p.h"
+#include "../core/instdb_p.h"
+
+ASMJIT_BEGIN_NAMESPACE
+
+namespace InstNameUtils {
+
+static constexpr uint32_t kBufferSize = 32;
+
+static ASMJIT_FORCE_INLINE char decode5BitChar(uint32_t c) noexcept {
+ uint32_t base = c <= 26 ? uint32_t('a') - 1u : uint32_t('0') - 27u;
+ return char(base + c);
+}
+
+static ASMJIT_FORCE_INLINE size_t decodeToBuffer(char nameOut[kBufferSize], uint32_t nameValue, const char* stringTable) noexcept {
+ size_t i;
+
+ if (nameValue & 0x80000000u) {
+ // Small string of 5-bit characters.
+ for (i = 0; i < 6; i++, nameValue >>= 5) {
+ uint32_t c = nameValue & 0x1F;
+ if (c == 0)
+ break;
+ nameOut[i] = decode5BitChar(c);
+ }
+ return i;
+ }
+ else {
+ size_t prefixBase = nameValue & 0xFFFu;
+ size_t prefixSize = (nameValue >> 12) & 0xFu;
+
+ size_t suffixBase = (nameValue >> 16) & 0xFFFu;
+ size_t suffixSize = (nameValue >> 28) & 0x7u;
+
+ for (i = 0; i < prefixSize; i++)
+ nameOut[i] = stringTable[prefixBase + i];
+
+ char* suffixOut = nameOut + prefixSize;
+ for (i = 0; i < suffixSize; i++)
+ suffixOut[i] = stringTable[suffixBase + i];
+
+ return prefixSize + suffixSize;
+ }
+}
+
+Error decode(String& output, uint32_t nameValue, const char* stringTable) noexcept {
+ char nameData[kBufferSize];
+ size_t nameSize = decodeToBuffer(nameData, nameValue, stringTable);
+
+ return output.append(nameData, nameSize);
+}
+
+InstId find(const char* s, size_t len, const InstNameIndex& nameIndex, const uint32_t* nameTable, const char* stringTable) noexcept {
+ if (ASMJIT_UNLIKELY(!s))
+ return BaseInst::kIdNone;
+
+ if (len == SIZE_MAX)
+ len = strlen(s);
+
+ if (ASMJIT_UNLIKELY(len == 0 || len > nameIndex.maxNameLength))
+ return BaseInst::kIdNone;
+
+ uint32_t prefix = uint32_t(s[0]) - 'a';
+ if (ASMJIT_UNLIKELY(prefix > 'z' - 'a'))
+ return BaseInst::kIdNone;
+
+ size_t base = nameIndex.data[prefix].start;
+ size_t end = nameIndex.data[prefix].end;
+
+ if (ASMJIT_UNLIKELY(!base))
+ return BaseInst::kIdNone;
+
+ char nameData[kBufferSize];
+ for (size_t lim = end - base; lim != 0; lim >>= 1) {
+ size_t instId = base + (lim >> 1);
+ size_t nameSize = decodeToBuffer(nameData, nameTable[instId], stringTable);
+
+ int result = Support::compareStringViews(s, len, nameData, nameSize);
+ if (result < 0)
+ continue;
+
+ if (result > 0) {
+ base = instId + 1;
+ lim--;
+ continue;
+ }
+
+ return InstId(instId);
+ }
+
+ return BaseInst::kIdNone;
+}
+
+} // {InstNameUtils}
+
+ASMJIT_END_NAMESPACE
diff --git a/3rdparty/asmjit/src/asmjit/core/instdb_p.h b/3rdparty/asmjit/src/asmjit/core/instdb_p.h
new file mode 100644
index 00000000000..b5afb72cb36
--- /dev/null
+++ b/3rdparty/asmjit/src/asmjit/core/instdb_p.h
@@ -0,0 +1,40 @@
+// This file is part of AsmJit project <https://asmjit.com>
+//
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
+
+#ifndef ASMJIT_CORE_INSTDB_P_H_INCLUDED
+#define ASMJIT_CORE_INSTDB_P_H_INCLUDED
+
+#include "../core/inst.h"
+#include "../core/string.h"
+
+ASMJIT_BEGIN_NAMESPACE
+
+//! \cond INTERNAL
+//! \addtogroup asmjit_instruction_db
+//! \{
+
+struct InstNameIndex {
+ struct Span {
+ uint16_t start;
+ uint16_t end;
+ };
+
+ Span data[26];
+ uint16_t maxNameLength;
+};
+
+namespace InstNameUtils {
+
+Error decode(String& output, uint32_t nameValue, const char* stringTable) noexcept;
+InstId find(const char* s, size_t len, const InstNameIndex& nameIndex, const uint32_t* nameTable, const char* stringTable) noexcept;
+
+} // {InstNameUtils}
+
+//! \}
+//! \endcond
+
+ASMJIT_END_NAMESPACE
+
+#endif // ASMJIT_CORE_INSTDB_P_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/core/jitallocator.cpp b/3rdparty/asmjit/src/asmjit/core/jitallocator.cpp
index 19fbe4b2338..44e864105fe 100644
--- a/3rdparty/asmjit/src/asmjit/core/jitallocator.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/jitallocator.cpp
@@ -31,18 +31,19 @@ static constexpr uint32_t kJitAllocatorMultiPoolCount = 3;
static constexpr uint32_t kJitAllocatorBaseGranularity = 64;
//! Maximum block size (32MB).
-static constexpr uint32_t kJitAllocatorMaxBlockSize = 1024 * 1024 * 32;
+static constexpr uint32_t kJitAllocatorMaxBlockSize = 1024 * 1024 * 64;
// JitAllocator - Fill Pattern
// ===========================
static inline uint32_t JitAllocator_defaultFillPattern() noexcept {
+#if ASMJIT_ARCH_X86
// X86 and X86_64 - 4x 'int3' instruction.
- if (ASMJIT_ARCH_X86)
- return 0xCCCCCCCCu;
-
+ return 0xCCCCCCCCu;
+#else
// Unknown...
return 0u;
+#endif
}
// JitAllocator - BitVectorRangeIterator
@@ -146,42 +147,38 @@ public:
//! Double linked list of blocks.
ZoneList<JitAllocatorBlock> blocks;
//! Where to start looking first.
- JitAllocatorBlock* cursor;
+ JitAllocatorBlock* cursor = nullptr;
//! Count of blocks.
- uint32_t blockCount;
+ uint32_t blockCount = 0;
//! Allocation granularity.
- uint16_t granularity;
+ uint16_t granularity = 0;
//! Log2(granularity).
- uint8_t granularityLog2;
+ uint8_t granularityLog2 = 0;
//! Count of empty blocks (either 0 or 1 as we won't keep more blocks empty).
- uint8_t emptyBlockCount;
+ uint8_t emptyBlockCount = 0;
//! Number of bits reserved across all blocks.
- size_t totalAreaSize;
+ size_t totalAreaSize[2] {};
//! Number of bits used across all blocks.
- size_t totalAreaUsed;
+ size_t totalAreaUsed[2] {};
//! Overhead of all blocks (in bytes).
- size_t totalOverheadBytes;
+ size_t totalOverheadBytes = 0;
inline JitAllocatorPool(uint32_t granularity) noexcept
: blocks(),
- cursor(nullptr),
- blockCount(0),
granularity(uint16_t(granularity)),
- granularityLog2(uint8_t(Support::ctz(granularity))),
- emptyBlockCount(0),
- totalAreaSize(0),
- totalAreaUsed(0),
- totalOverheadBytes(0) {}
+ granularityLog2(uint8_t(Support::ctz(granularity))) {}
inline void reset() noexcept {
blocks.reset();
cursor = nullptr;
- blockCount = 0;
- totalAreaSize = 0;
- totalAreaUsed = 0;
- totalOverheadBytes = 0;
+ blockCount = 0u;
+ totalAreaSize[0] = 0u;
+ totalAreaSize[1] = 0u;
+ totalAreaUsed[0] = 0u;
+ totalAreaUsed[1] = 0u;
+ totalOverheadBytes = 0u;
}
inline size_t byteSizeFromAreaSize(uint32_t areaSize) const noexcept { return size_t(areaSize) * granularity; }
@@ -202,39 +199,47 @@ public:
ASMJIT_NONCOPYABLE(JitAllocatorBlock)
enum Flags : uint32_t {
+ //! Block has initial padding, see \ref JitAllocatorOptions::kDisableInitialPadding.
+ kFlagInitialPadding = 0x00000001u,
//! Block is empty.
- kFlagEmpty = 0x00000001u,
+ kFlagEmpty = 0x00000002u,
//! Block is dirty (largestUnusedArea, searchStart, searchEnd).
- kFlagDirty = 0x00000002u,
- //! Block is dual-mapped.
- kFlagDualMapped = 0x00000004u
+ kFlagDirty = 0x00000004u,
+ //! Block represents memory that is using large pages.
+ kFlagLargePages = 0x00000008u,
+ //! Block represents memory that is dual-mapped.
+ kFlagDualMapped = 0x00000010u
};
+ static_assert(kFlagInitialPadding == 1, "JitAllocatorBlock::kFlagInitialPadding must be equal to 1");
+
+ static inline uint32_t initialAreaStartByFlags(uint32_t flags) noexcept { return flags & kFlagInitialPadding; }
+
//! Link to the pool that owns this block.
- JitAllocatorPool* _pool;
+ JitAllocatorPool* _pool {};
//! Virtual memory mapping - either single mapping (both pointers equal) or
//! dual mapping, where one pointer is Read+Execute and the second Read+Write.
- VirtMem::DualMapping _mapping;
+ VirtMem::DualMapping _mapping {};
//! Virtual memory size (block size) [bytes].
- size_t _blockSize;
+ size_t _blockSize = 0;
//! Block flags.
- uint32_t _flags;
+ uint32_t _flags = 0;
//! Size of the whole block area (bit-vector size).
- uint32_t _areaSize;
+ uint32_t _areaSize = 0;
//! Used area (number of bits in bit-vector used).
- uint32_t _areaUsed;
+ uint32_t _areaUsed = 0;
//! The largest unused continuous area in the bit-vector (or `areaSize` to initiate rescan).
- uint32_t _largestUnusedArea;
+ uint32_t _largestUnusedArea = 0;
//! Start of a search range (for unused bits).
- uint32_t _searchStart;
+ uint32_t _searchStart = 0;
//! End of a search range (for unused bits).
- uint32_t _searchEnd;
+ uint32_t _searchEnd = 0;
//! Used bit-vector (0 = unused, 1 = used).
- Support::BitWord* _usedBitVector;
+ Support::BitWord* _usedBitVector {};
//! Stop bit-vector (0 = don't care, 1 = stop).
- Support::BitWord* _stopBitVector;
+ Support::BitWord* _stopBitVector {};
inline JitAllocatorBlock(
JitAllocatorPool* pool,
@@ -250,12 +255,15 @@ public:
_blockSize(blockSize),
_flags(blockFlags),
_areaSize(areaSize),
- _areaUsed(0),
- _largestUnusedArea(areaSize),
- _searchStart(0),
- _searchEnd(areaSize),
+ _areaUsed(0), // Will be initialized by clearBlock().
+ _largestUnusedArea(0), // Will be initialized by clearBlock().
+ _searchStart(0), // Will be initialized by clearBlock().
+ _searchEnd(0), // Will be initialized by clearBlock().
_usedBitVector(usedBitVector),
- _stopBitVector(stopBitVector) {}
+ _stopBitVector(stopBitVector) {
+
+ clearBlock();
+ }
inline JitAllocatorPool* pool() const noexcept { return _pool; }
@@ -266,9 +274,15 @@ public:
inline void addFlags(uint32_t f) noexcept { _flags |= f; }
inline void clearFlags(uint32_t f) noexcept { _flags &= ~f; }
+ inline bool empty() const noexcept { return hasFlag(kFlagEmpty); }
inline bool isDirty() const noexcept { return hasFlag(kFlagDirty); }
inline void makeDirty() noexcept { addFlags(kFlagDirty); }
+ inline bool hasLargePages() const noexcept { return hasFlag(kFlagLargePages); }
+ inline bool hasInitialPadding() const noexcept { return hasFlag(kFlagInitialPadding); }
+
+ inline uint32_t initialAreaStart() const noexcept { return initialAreaStartByFlags(_flags); }
+
inline size_t blockSize() const noexcept { return _blockSize; }
inline uint32_t areaSize() const noexcept { return _areaSize; }
@@ -278,7 +292,27 @@ public:
inline void decreaseUsedArea(uint32_t value) noexcept {
_areaUsed -= value;
- _pool->totalAreaUsed -= value;
+ _pool->totalAreaUsed[size_t(hasLargePages())] -= value;
+ }
+
+ inline void clearBlock() noexcept {
+ bool bit = hasInitialPadding();
+ size_t numBitWords = _pool->bitWordCountFromAreaSize(_areaSize);
+
+ memset(_usedBitVector, 0, numBitWords * sizeof(Support::BitWord));
+ memset(_stopBitVector, 0, numBitWords * sizeof(Support::BitWord));
+
+ Support::bitVectorSetBit(_usedBitVector, 0, bit);
+ Support::bitVectorSetBit(_stopBitVector, 0, bit);
+
+ uint32_t start = initialAreaStartByFlags(_flags);
+ _areaUsed = start;
+ _largestUnusedArea = _areaSize - start;
+ _searchStart = start;
+ _searchEnd = _areaSize;
+
+ addFlags(JitAllocatorBlock::kFlagEmpty);
+ clearFlags(JitAllocatorBlock::kFlagDirty);
}
inline void markAllocatedArea(uint32_t allocatedAreaStart, uint32_t allocatedAreaEnd) noexcept {
@@ -289,21 +323,24 @@ public:
Support::bitVectorSetBit(_stopBitVector, allocatedAreaEnd - 1, true);
// Update search region and statistics.
- _pool->totalAreaUsed += allocatedAreaSize;
+ _pool->totalAreaUsed[size_t(hasLargePages())] += allocatedAreaSize;
_areaUsed += allocatedAreaSize;
if (areaAvailable() == 0) {
_searchStart = _areaSize;
_searchEnd = 0;
_largestUnusedArea = 0;
- clearFlags(kFlagDirty);
+
+ clearFlags(kFlagDirty | kFlagEmpty);
}
else {
if (_searchStart == allocatedAreaStart)
_searchStart = allocatedAreaEnd;
if (_searchEnd == allocatedAreaEnd)
_searchEnd = allocatedAreaStart;
+
addFlags(kFlagDirty);
+ clearFlags(kFlagEmpty);
}
}
@@ -311,7 +348,7 @@ public:
uint32_t releasedAreaSize = releasedAreaEnd - releasedAreaStart;
// Update the search region and statistics.
- _pool->totalAreaUsed -= releasedAreaSize;
+ _pool->totalAreaUsed[size_t(hasLargePages())] -= releasedAreaSize;
_areaUsed -= releasedAreaSize;
_searchStart = Support::min(_searchStart, releasedAreaStart);
_searchEnd = Support::max(_searchEnd, releasedAreaEnd);
@@ -320,10 +357,10 @@ public:
Support::bitVectorClear(_usedBitVector, releasedAreaStart, releasedAreaSize);
Support::bitVectorSetBit(_stopBitVector, releasedAreaEnd - 1, false);
- if (areaUsed() == 0) {
- _searchStart = 0;
+ if (areaUsed() == initialAreaStart()) {
+ _searchStart = initialAreaStart();
_searchEnd = _areaSize;
- _largestUnusedArea = _areaSize;
+ _largestUnusedArea = _areaSize - initialAreaStart();
addFlags(kFlagEmpty);
clearFlags(kFlagDirty);
}
@@ -341,7 +378,7 @@ public:
ASMJIT_ASSERT(shrunkAreaSize != 0);
// Update the search region and statistics.
- _pool->totalAreaUsed -= shrunkAreaSize;
+ _pool->totalAreaUsed[size_t(hasLargePages())] -= shrunkAreaSize;
_areaUsed -= shrunkAreaSize;
_searchStart = Support::min(_searchStart, shrunkAreaStart);
_searchEnd = Support::max(_searchEnd, shrunkAreaEnd);
@@ -411,7 +448,7 @@ static inline JitAllocatorPrivateImpl* JitAllocatorImpl_new(const JitAllocator::
// Setup pool count to [1..3].
size_t poolCount = 1;
if (Support::test(options, JitAllocatorOptions::kUseMultiplePools))
- poolCount = kJitAllocatorMultiPoolCount;;
+ poolCount = kJitAllocatorMultiPoolCount;
// Setup block size [64kB..256MB].
if (blockSize < 64 * 1024 || blockSize > 256 * 1024 * 1024 || !Support::isPowerOf2(blockSize))
@@ -430,8 +467,17 @@ static inline JitAllocatorPrivateImpl* JitAllocatorImpl_new(const JitAllocator::
if (ASMJIT_UNLIKELY(!p))
return nullptr;
+ VirtMem::HardenedRuntimeInfo hardenedRtInfo = VirtMem::hardenedRuntimeInfo();
+ if (Support::test(hardenedRtInfo.flags, VirtMem::HardenedRuntimeFlags::kEnabled)) {
+ // If we are running within a hardened environment (mapping RWX is not allowed) then we have to use dual mapping
+ // or other runtime capabilities like Apple specific MAP_JIT. There is no point in not enabling these as otherwise
+ // the allocation would fail and JitAllocator would not be able to allocate memory.
+ if (!Support::test(hardenedRtInfo.flags, VirtMem::HardenedRuntimeFlags::kMapJit))
+ options |= JitAllocatorOptions::kUseDualMapping;
+ }
+
JitAllocatorPool* pools = reinterpret_cast<JitAllocatorPool*>((uint8_t*)p + sizeof(JitAllocatorPrivateImpl));
- JitAllocatorPrivateImpl* impl = new(p) JitAllocatorPrivateImpl(pools, poolCount);
+ JitAllocatorPrivateImpl* impl = new(Support::PlacementNew{p}) JitAllocatorPrivateImpl(pools, poolCount);
impl->options = options;
impl->blockSize = blockSize;
@@ -440,7 +486,7 @@ static inline JitAllocatorPrivateImpl* JitAllocatorImpl_new(const JitAllocator::
impl->pageSize = vmInfo.pageSize;
for (size_t poolId = 0; poolId < poolCount; poolId++)
- new(&pools[poolId]) JitAllocatorPool(granularity << poolId);
+ new(Support::PlacementNew{&pools[poolId]}) JitAllocatorPool(granularity << poolId);
return impl;
}
@@ -473,6 +519,14 @@ static inline size_t JitAllocatorImpl_calculateIdealBlockSize(JitAllocatorPrivat
JitAllocatorBlock* last = pool->blocks.last();
size_t blockSize = last ? last->blockSize() : size_t(impl->blockSize);
+ // We have to increase the allocationSize if we know that the block must provide padding.
+ if (!Support::test(impl->options, JitAllocatorOptions::kDisableInitialPadding)) {
+ size_t granularity = pool->granularity;
+ if (SIZE_MAX - allocationSize < granularity)
+ return 0; // Overflown
+ allocationSize += granularity;
+ }
+
if (blockSize < kJitAllocatorMaxBlockSize)
blockSize *= 2u;
@@ -485,64 +539,102 @@ static inline size_t JitAllocatorImpl_calculateIdealBlockSize(JitAllocatorPrivat
return blockSize;
}
-ASMJIT_FAVOR_SPEED static void JitAllocatorImpl_fillPattern(void* mem, uint32_t pattern, size_t sizeInBytes) noexcept {
- size_t n = sizeInBytes / 4u;
- uint32_t* p = static_cast<uint32_t*>(mem);
+ASMJIT_NOINLINE
+ASMJIT_FAVOR_SPEED static void JitAllocatorImpl_fillPattern(void* mem, uint32_t pattern, size_t byteSize) noexcept {
+ // NOTE: This is always used to fill a pattern in allocated / freed memory. The allocation has always
+ // a granularity that is greater than the pattern, however, when shrink() is used, we may end up having
+ // an unaligned start, so deal with it here and then copy aligned pattern in the loop.
+ if ((uintptr_t(mem) & 0x1u) && byteSize >= 1u) {
+ static_cast<uint8_t*>(mem)[0] = uint8_t(pattern & 0xFF);
+ mem = static_cast<uint8_t*>(mem) + 1;
+ byteSize--;
+ }
+
+ if ((uintptr_t(mem) & 0x2u) && byteSize >= 2u) {
+ static_cast<uint16_t*>(mem)[0] = uint16_t(pattern & 0xFFFF);
+ mem = static_cast<uint16_t*>(mem) + 1;
+ byteSize -= 2;
+ }
+
+ // Something would be seriously broken if we end up with aligned `mem`, but unaligned `byteSize`.
+ ASMJIT_ASSERT((byteSize & 0x3u) == 0u);
+
+ uint32_t* mem32 = static_cast<uint32_t*>(mem);
+ size_t n = byteSize / 4u;
for (size_t i = 0; i < n; i++)
- p[i] = pattern;
+ mem32[i] = pattern;
}
// Allocate a new `JitAllocatorBlock` for the given `blockSize`.
//
// NOTE: The block doesn't have `kFlagEmpty` flag set, because the new block
// is only allocated when it's actually needed, so it would be cleared anyway.
-static JitAllocatorBlock* JitAllocatorImpl_newBlock(JitAllocatorPrivateImpl* impl, JitAllocatorPool* pool, size_t blockSize) noexcept {
+static Error JitAllocatorImpl_newBlock(JitAllocatorPrivateImpl* impl, JitAllocatorBlock** dst, JitAllocatorPool* pool, size_t blockSize) noexcept {
using Support::BitWord;
using Support::kBitWordSizeInBits;
- uint32_t areaSize = uint32_t((blockSize + pool->granularity - 1) >> pool->granularityLog2);
- uint32_t numBitWords = (areaSize + kBitWordSizeInBits - 1u) / kBitWordSizeInBits;
+ uint32_t blockFlags = 0;
+ if (!Support::test(impl->options, JitAllocatorOptions::kDisableInitialPadding))
+ blockFlags |= JitAllocatorBlock::kFlagInitialPadding;
- JitAllocatorBlock* block = static_cast<JitAllocatorBlock*>(::malloc(sizeof(JitAllocatorBlock)));
- BitWord* bitWords = nullptr;
VirtMem::DualMapping virtMem {};
- Error err = kErrorOutOfMemory;
-
- if (block != nullptr)
- bitWords = static_cast<BitWord*>(::malloc(size_t(numBitWords) * 2 * sizeof(BitWord)));
+ VirtMem::MemoryFlags memFlags = VirtMem::MemoryFlags::kAccessRWX;
- uint32_t blockFlags = 0;
- if (bitWords != nullptr) {
- if (Support::test(impl->options, JitAllocatorOptions::kUseDualMapping)) {
- err = VirtMem::allocDualMapping(&virtMem, blockSize, VirtMem::MemoryFlags::kAccessRWX);
- blockFlags |= JitAllocatorBlock::kFlagDualMapped;
- }
- else {
- err = VirtMem::alloc(&virtMem.rx, blockSize, VirtMem::MemoryFlags::kAccessRWX);
- virtMem.rw = virtMem.rx;
- }
+ if (Support::test(impl->options, JitAllocatorOptions::kUseDualMapping)) {
+ ASMJIT_PROPAGATE(VirtMem::allocDualMapping(&virtMem, blockSize, memFlags));
+ blockFlags |= JitAllocatorBlock::kFlagDualMapped;
}
+ else {
+ bool allocateRegularPages = true;
+ if (Support::test(impl->options, JitAllocatorOptions::kUseLargePages)) {
+ size_t largePageSize = VirtMem::largePageSize();
+ bool tryLargePage = blockSize >= largePageSize || Support::test(impl->options, JitAllocatorOptions::kAlignBlockSizeToLargePage);
+
+ // Only proceed if we can actually allocate large pages.
+ if (largePageSize && tryLargePage) {
+ size_t largeBlockSize = Support::alignUp(blockSize, largePageSize);
+ Error err = VirtMem::alloc(&virtMem.rx, largeBlockSize, memFlags | VirtMem::MemoryFlags::kMMapLargePages);
+
+ // Fallback to regular pages if large page(s) allocation failed.
+ if (err == kErrorOk) {
+ allocateRegularPages = false;
+ blockSize = largeBlockSize;
+ blockFlags |= JitAllocatorBlock::kFlagLargePages;
+ }
+ }
+ }
- // Out of memory.
- if (ASMJIT_UNLIKELY(!block || !bitWords || err != kErrorOk)) {
- if (bitWords)
- ::free(bitWords);
+ // Called either if large pages were not requested or large page(s) allocation failed.
+ if (allocateRegularPages) {
+ ASMJIT_PROPAGATE(VirtMem::alloc(&virtMem.rx, blockSize, memFlags));
+ }
- if (block)
- ::free(block);
+ virtMem.rw = virtMem.rx;
+ }
- return nullptr;
+ uint32_t areaSize = uint32_t((blockSize + pool->granularity - 1) >> pool->granularityLog2);
+ uint32_t numBitWords = (areaSize + kBitWordSizeInBits - 1u) / kBitWordSizeInBits;
+ uint8_t* blockPtr = static_cast<uint8_t*>(::malloc(sizeof(JitAllocatorBlock) + size_t(numBitWords) * 2u * sizeof(BitWord)));
+
+ // Out of memory...
+ if (ASMJIT_UNLIKELY(blockPtr == nullptr)) {
+ if (Support::test(impl->options, JitAllocatorOptions::kUseDualMapping))
+ VirtMem::releaseDualMapping(&virtMem, blockSize);
+ else
+ VirtMem::release(virtMem.rx, blockSize);
+ return DebugUtils::errored(kErrorOutOfMemory);
}
- // Fill the memory if the secure mode is enabled.
+ // Fill the allocated virtual memory if secure mode is enabled.
if (Support::test(impl->options, JitAllocatorOptions::kFillUnusedMemory)) {
VirtMem::ProtectJitReadWriteScope scope(virtMem.rw, blockSize);
JitAllocatorImpl_fillPattern(virtMem.rw, impl->fillPattern, blockSize);
}
- memset(bitWords, 0, size_t(numBitWords) * 2 * sizeof(BitWord));
- return new(block) JitAllocatorBlock(pool, virtMem, blockSize, blockFlags, bitWords, bitWords + numBitWords, areaSize);
+ BitWord* bitWords = reinterpret_cast<BitWord*>(blockPtr + sizeof(JitAllocatorBlock));
+ *dst = new(Support::PlacementNew{blockPtr}) JitAllocatorBlock(pool, virtMem, blockSize, blockFlags, bitWords, bitWords + numBitWords, areaSize);
+ return kErrorOk;
}
static void JitAllocatorImpl_deleteBlock(JitAllocatorPrivateImpl* impl, JitAllocatorBlock* block) noexcept {
@@ -553,7 +645,6 @@ static void JitAllocatorImpl_deleteBlock(JitAllocatorPrivateImpl* impl, JitAlloc
else
VirtMem::release(block->rxPtr(), block->blockSize());
- ::free(block->_usedBitVector);
::free(block);
}
@@ -568,8 +659,10 @@ static void JitAllocatorImpl_insertBlock(JitAllocatorPrivateImpl* impl, JitAlloc
pool->blocks.append(block);
// Update statistics.
+ size_t statIndex = size_t(block->hasLargePages());
pool->blockCount++;
- pool->totalAreaSize += block->areaSize();
+ pool->totalAreaSize[statIndex] += block->areaSize();
+ pool->totalAreaUsed[statIndex] += block->areaUsed();
pool->totalOverheadBytes += sizeof(JitAllocatorBlock) + JitAllocatorImpl_bitVectorSizeToByteSize(block->areaSize()) * 2u;
}
@@ -584,8 +677,10 @@ static void JitAllocatorImpl_removeBlock(JitAllocatorPrivateImpl* impl, JitAlloc
pool->blocks.unlink(block);
// Update statistics.
+ size_t statIndex = size_t(block->hasLargePages());
pool->blockCount--;
- pool->totalAreaSize -= block->areaSize();
+ pool->totalAreaSize[statIndex] -= block->areaSize();
+ pool->totalAreaUsed[statIndex] -= block->areaUsed();
pool->totalOverheadBytes -= sizeof(JitAllocatorBlock) + JitAllocatorImpl_bitVectorSizeToByteSize(block->areaSize()) * 2u;
}
@@ -594,12 +689,10 @@ static void JitAllocatorImpl_wipeOutBlock(JitAllocatorPrivateImpl* impl, JitAllo
return;
JitAllocatorPool* pool = block->pool();
- uint32_t areaSize = block->areaSize();
- uint32_t granularity = pool->granularity;
- size_t numBitWords = pool->bitWordCountFromAreaSize(areaSize);
-
- VirtMem::protectJitMemory(VirtMem::ProtectJitAccess::kReadWrite);
if (Support::test(impl->options, JitAllocatorOptions::kFillUnusedMemory)) {
+ VirtMem::protectJitMemory(VirtMem::ProtectJitAccess::kReadWrite);
+
+ uint32_t granularity = pool->granularity;
uint8_t* rwPtr = block->rwPtr();
BitVectorRangeIterator<Support::BitWord, 0> it(block->_usedBitVector, pool->bitWordCountFromAreaSize(block->areaSize()));
@@ -613,18 +706,10 @@ static void JitAllocatorImpl_wipeOutBlock(JitAllocatorPrivateImpl* impl, JitAllo
JitAllocatorImpl_fillPattern(spanPtr, impl->fillPattern, spanSize);
VirtMem::flushInstructionCache(spanPtr, spanSize);
}
+ VirtMem::protectJitMemory(VirtMem::ProtectJitAccess::kReadExecute);
}
- VirtMem::protectJitMemory(VirtMem::ProtectJitAccess::kReadExecute);
- memset(block->_usedBitVector, 0, size_t(numBitWords) * sizeof(Support::BitWord));
- memset(block->_stopBitVector, 0, size_t(numBitWords) * sizeof(Support::BitWord));
-
- block->_areaUsed = 0;
- block->_largestUnusedArea = areaSize;
- block->_searchStart = 0;
- block->_searchEnd = areaSize;
- block->addFlags(JitAllocatorBlock::kFlagEmpty);
- block->clearFlags(JitAllocatorBlock::kFlagDirty);
+ block->clearBlock();
}
// JitAllocator - Construction & Destruction
@@ -659,26 +744,28 @@ void JitAllocator::reset(ResetPolicy resetPolicy) noexcept {
JitAllocatorPool& pool = impl->pools[poolId];
JitAllocatorBlock* block = pool.blocks.first();
- JitAllocatorBlock* blockToKeep = nullptr;
- if (resetPolicy != ResetPolicy::kHard && uint32_t(impl->options & JitAllocatorOptions::kImmediateRelease) == 0) {
- blockToKeep = block;
- block = block->next();
- }
+ pool.reset();
- while (block) {
- JitAllocatorBlock* next = block->next();
- JitAllocatorImpl_deleteBlock(impl, block);
- block = next;
- }
+ if (block) {
+ JitAllocatorBlock* blockToKeep = nullptr;
+ if (resetPolicy != ResetPolicy::kHard && uint32_t(impl->options & JitAllocatorOptions::kImmediateRelease) == 0) {
+ blockToKeep = block;
+ block = block->next();
+ }
- pool.reset();
+ while (block) {
+ JitAllocatorBlock* next = block->next();
+ JitAllocatorImpl_deleteBlock(impl, block);
+ block = next;
+ }
- if (blockToKeep) {
- blockToKeep->_listNodes[0] = nullptr;
- blockToKeep->_listNodes[1] = nullptr;
- JitAllocatorImpl_wipeOutBlock(impl, blockToKeep);
- JitAllocatorImpl_insertBlock(impl, blockToKeep);
- pool.emptyBlockCount = 1;
+ if (blockToKeep) {
+ blockToKeep->_listNodes[0] = nullptr;
+ blockToKeep->_listNodes[1] = nullptr;
+ JitAllocatorImpl_wipeOutBlock(impl, blockToKeep);
+ JitAllocatorImpl_insertBlock(impl, blockToKeep);
+ pool.emptyBlockCount = 1;
+ }
}
}
}
@@ -698,8 +785,8 @@ JitAllocator::Statistics JitAllocator::statistics() const noexcept {
for (size_t poolId = 0; poolId < poolCount; poolId++) {
const JitAllocatorPool& pool = impl->pools[poolId];
statistics._blockCount += size_t(pool.blockCount);
- statistics._reservedSize += size_t(pool.totalAreaSize) * pool.granularity;
- statistics._usedSize += size_t(pool.totalAreaUsed) * pool.granularity;
+ statistics._reservedSize += size_t(pool.totalAreaSize[0] + pool.totalAreaSize[1]) * pool.granularity;
+ statistics._usedSize += size_t(pool.totalAreaUsed[0] + pool.totalAreaUsed[1]) * pool.granularity;
statistics._overheadSize += size_t(pool.totalOverheadBytes);
}
@@ -712,16 +799,15 @@ JitAllocator::Statistics JitAllocator::statistics() const noexcept {
// JitAllocator - Alloc & Release
// ==============================
-Error JitAllocator::alloc(void** rxPtrOut, void** rwPtrOut, size_t size) noexcept {
+Error JitAllocator::alloc(Span& out, size_t size) noexcept {
+ out = Span{};
+
if (ASMJIT_UNLIKELY(_impl == &JitAllocatorImpl_none))
return DebugUtils::errored(kErrorNotInitialized);
JitAllocatorPrivateImpl* impl = static_cast<JitAllocatorPrivateImpl*>(_impl);
constexpr uint32_t kNoIndex = std::numeric_limits<uint32_t>::max();
- *rxPtrOut = nullptr;
- *rwPtrOut = nullptr;
-
// Align to the minimum granularity by default.
size = Support::alignUp<size_t>(size, impl->granularity);
if (ASMJIT_UNLIKELY(size == 0))
@@ -783,21 +869,18 @@ Error JitAllocator::alloc(void** rxPtrOut, void** rwPtrOut, size_t size) noexcep
} while (block != initial);
}
- // Allocate a new block if there is no region of a required width.
+ // Allocate a new block if there is no region of a required size.
if (areaIndex == kNoIndex) {
size_t blockSize = JitAllocatorImpl_calculateIdealBlockSize(impl, pool, size);
if (ASMJIT_UNLIKELY(!blockSize))
return DebugUtils::errored(kErrorOutOfMemory);
- block = JitAllocatorImpl_newBlock(impl, pool, blockSize);
- areaIndex = 0;
-
- if (ASMJIT_UNLIKELY(!block))
- return DebugUtils::errored(kErrorOutOfMemory);
+ ASMJIT_PROPAGATE(JitAllocatorImpl_newBlock(impl, &block, pool, blockSize));
+ areaIndex = block->initialAreaStart();
JitAllocatorImpl_insertBlock(impl, block);
- block->_searchStart = areaSize;
- block->_largestUnusedArea = block->areaSize() - areaSize;
+ block->_searchStart += areaSize;
+ block->_largestUnusedArea -= areaSize;
}
else if (block->hasFlag(JitAllocatorBlock::kFlagEmpty)) {
pool->emptyBlockCount--;
@@ -808,32 +891,35 @@ Error JitAllocator::alloc(void** rxPtrOut, void** rwPtrOut, size_t size) noexcep
impl->allocationCount++;
block->markAllocatedArea(areaIndex, areaIndex + areaSize);
- // Return a pointer to the allocated memory.
+ // Return a span referencing the allocated memory.
size_t offset = pool->byteSizeFromAreaSize(areaIndex);
ASMJIT_ASSERT(offset <= block->blockSize() - size);
- *rxPtrOut = block->rxPtr() + offset;
- *rwPtrOut = block->rwPtr() + offset;
+ out._rx = block->rxPtr() + offset;
+ out._rw = block->rwPtr() + offset;
+ out._size = size;
+ out._block = static_cast<void*>(block);
+
return kErrorOk;
}
-Error JitAllocator::release(void* rxPtr) noexcept {
+Error JitAllocator::release(void* rx) noexcept {
if (ASMJIT_UNLIKELY(_impl == &JitAllocatorImpl_none))
return DebugUtils::errored(kErrorNotInitialized);
- if (ASMJIT_UNLIKELY(!rxPtr))
+ if (ASMJIT_UNLIKELY(!rx))
return DebugUtils::errored(kErrorInvalidArgument);
JitAllocatorPrivateImpl* impl = static_cast<JitAllocatorPrivateImpl*>(_impl);
LockGuard guard(impl->lock);
- JitAllocatorBlock* block = impl->tree.get(static_cast<uint8_t*>(rxPtr));
+ JitAllocatorBlock* block = impl->tree.get(static_cast<uint8_t*>(rx));
if (ASMJIT_UNLIKELY(!block))
return DebugUtils::errored(kErrorInvalidState);
// Offset relative to the start of the block.
JitAllocatorPool* pool = block->pool();
- size_t offset = (size_t)((uint8_t*)rxPtr - block->rxPtr());
+ size_t offset = (size_t)((uint8_t*)rx - block->rxPtr());
// The first bit representing the allocated area and its size.
uint32_t areaIndex = uint32_t(offset >> pool->granularityLog2);
@@ -853,7 +939,7 @@ Error JitAllocator::release(void* rxPtr) noexcept {
}
// Release the whole block if it became empty.
- if (block->areaUsed() == 0) {
+ if (block->empty()) {
if (pool->emptyBlockCount || Support::test(impl->options, JitAllocatorOptions::kImmediateRelease)) {
JitAllocatorImpl_removeBlock(impl, block);
JitAllocatorImpl_deleteBlock(impl, block);
@@ -866,49 +952,196 @@ Error JitAllocator::release(void* rxPtr) noexcept {
return kErrorOk;
}
-Error JitAllocator::shrink(void* rxPtr, size_t newSize) noexcept {
+static Error JitAllocatorImpl_shrink(JitAllocatorPrivateImpl* impl, JitAllocator::Span& span, size_t newSize, bool alreadyUnderWriteScope) noexcept {
+ JitAllocatorBlock* block = static_cast<JitAllocatorBlock*>(span._block);
+ if (ASMJIT_UNLIKELY(!block))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ LockGuard guard(impl->lock);
+
+ // Offset relative to the start of the block.
+ JitAllocatorPool* pool = block->pool();
+ size_t offset = (size_t)((uint8_t*)span.rx() - block->rxPtr());
+
+ // The first bit representing the allocated area and its size.
+ uint32_t areaStart = uint32_t(offset >> pool->granularityLog2);
+
+ // Don't trust `span.size()` - if it has been already truncated we would be off...
+ bool isUsed = Support::bitVectorGetBit(block->_usedBitVector, areaStart);
+ if (ASMJIT_UNLIKELY(!isUsed))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ uint32_t areaEnd = uint32_t(Support::bitVectorIndexOf(block->_stopBitVector, areaStart, true)) + 1;
+ uint32_t areaPrevSize = areaEnd - areaStart;
+ uint32_t spanPrevSize = areaPrevSize * pool->granularity;
+ uint32_t areaShrunkSize = pool->areaSizeFromByteSize(newSize);
+
+ if (ASMJIT_UNLIKELY(areaShrunkSize > areaPrevSize))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ uint32_t areaDiff = areaPrevSize - areaShrunkSize;
+ if (areaDiff) {
+ block->markShrunkArea(areaStart + areaShrunkSize, areaEnd);
+ span._size = pool->byteSizeFromAreaSize(areaShrunkSize);
+ }
+
+ // Fill released memory if the secure mode is enabled.
+ if (newSize < spanPrevSize && Support::test(impl->options, JitAllocatorOptions::kFillUnusedMemory)) {
+ uint8_t* spanPtr = block->rwPtr() + (areaStart + areaShrunkSize) * pool->granularity;
+ size_t spanSize = areaDiff * pool->granularity;
+
+ if (!alreadyUnderWriteScope) {
+ VirtMem::ProtectJitReadWriteScope scope(spanPtr, spanSize, VirtMem::CachePolicy::kNeverFlush);
+ JitAllocatorImpl_fillPattern(spanPtr, impl->fillPattern, spanSize);
+ }
+ else {
+ JitAllocatorImpl_fillPattern(spanPtr, impl->fillPattern, spanSize);
+ }
+ }
+
+ return kErrorOk;
+}
+
+Error JitAllocator::shrink(Span& span, size_t newSize) noexcept {
if (ASMJIT_UNLIKELY(_impl == &JitAllocatorImpl_none))
return DebugUtils::errored(kErrorNotInitialized);
- if (ASMJIT_UNLIKELY(!rxPtr))
+ if (ASMJIT_UNLIKELY(!span.rx()))
return DebugUtils::errored(kErrorInvalidArgument);
- if (ASMJIT_UNLIKELY(newSize == 0))
- return release(rxPtr);
+ if (ASMJIT_UNLIKELY(newSize == 0)) {
+ Error err = release(span.rx());
+ span = Span{};
+ return err;
+ }
+
+ return JitAllocatorImpl_shrink(static_cast<JitAllocatorPrivateImpl*>(_impl), span, newSize, false);
+}
+
+Error JitAllocator::query(Span& out, void* rx) const noexcept {
+ out = Span{};
+
+ if (ASMJIT_UNLIKELY(_impl == &JitAllocatorImpl_none))
+ return DebugUtils::errored(kErrorNotInitialized);
JitAllocatorPrivateImpl* impl = static_cast<JitAllocatorPrivateImpl*>(_impl);
LockGuard guard(impl->lock);
- JitAllocatorBlock* block = impl->tree.get(static_cast<uint8_t*>(rxPtr));
+ JitAllocatorBlock* block = impl->tree.get(static_cast<uint8_t*>(rx));
if (ASMJIT_UNLIKELY(!block))
return DebugUtils::errored(kErrorInvalidArgument);
// Offset relative to the start of the block.
JitAllocatorPool* pool = block->pool();
- size_t offset = (size_t)((uint8_t*)rxPtr - block->rxPtr());
+ size_t offset = (size_t)((uint8_t*)rx - block->rxPtr());
// The first bit representing the allocated area and its size.
uint32_t areaStart = uint32_t(offset >> pool->granularityLog2);
+
+ bool isUsed = Support::bitVectorGetBit(block->_usedBitVector, areaStart);
+ if (ASMJIT_UNLIKELY(!isUsed))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
uint32_t areaEnd = uint32_t(Support::bitVectorIndexOf(block->_stopBitVector, areaStart, true)) + 1;
+ size_t byteOffset = pool->byteSizeFromAreaSize(areaStart);
+ size_t byteSize = pool->byteSizeFromAreaSize(areaEnd - areaStart);
- uint32_t areaPrevSize = areaEnd - areaStart;
- uint32_t areaShrunkSize = pool->areaSizeFromByteSize(newSize);
+ out._rx = static_cast<uint8_t*>(block->_mapping.rx) + byteOffset;
+ out._rw = static_cast<uint8_t*>(block->_mapping.rw) + byteOffset;
+ out._size = byteSize;
+ out._block = static_cast<void*>(block);
- if (ASMJIT_UNLIKELY(areaShrunkSize > areaPrevSize))
- return DebugUtils::errored(kErrorInvalidState);
+ return kErrorOk;
+}
- uint32_t areaDiff = areaPrevSize - areaShrunkSize;
- if (areaDiff) {
- block->markShrunkArea(areaStart + areaShrunkSize, areaEnd);
+// JitAllocator - Write
+// ====================
- // Fill released memory if the secure mode is enabled.
- if (Support::test(impl->options, JitAllocatorOptions::kFillUnusedMemory))
- JitAllocatorImpl_fillPattern(block->rwPtr() + (areaStart + areaShrunkSize) * pool->granularity, fillPattern(), areaDiff * pool->granularity);
+static ASMJIT_FORCE_INLINE VirtMem::CachePolicy JitAllocator_defaultPolicyForSpan(const JitAllocator::Span& span) noexcept {
+ if (Support::test(span.flags(), JitAllocator::Span::Flags::kInstructionCacheClean))
+ return VirtMem::CachePolicy::kNeverFlush;
+ else
+ return VirtMem::CachePolicy::kFlushAfterWrite;
+}
+
+Error JitAllocator::write(Span& span, size_t offset, const void* src, size_t size, VirtMem::CachePolicy policy) noexcept {
+ if (ASMJIT_UNLIKELY(span._block == nullptr || offset > span.size() || span.size() - offset < size))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ if (ASMJIT_UNLIKELY(size == 0))
+ return kErrorOk;
+
+ if (policy == VirtMem::CachePolicy::kDefault)
+ policy = JitAllocator_defaultPolicyForSpan(span);
+
+ VirtMem::ProtectJitReadWriteScope writeScope(span.rx(), span.size(), policy);
+ memcpy(static_cast<uint8_t*>(span.rw()) + offset, src, size);
+ return kErrorOk;
+}
+
+Error JitAllocator::write(Span& span, WriteFunc writeFunc, void* userData, VirtMem::CachePolicy policy) noexcept {
+ if (ASMJIT_UNLIKELY(span._block == nullptr) || span.size() == 0)
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ size_t size = span.size();
+ if (ASMJIT_UNLIKELY(size == 0))
+ return kErrorOk;
+
+ if (policy == VirtMem::CachePolicy::kDefault)
+ policy = JitAllocator_defaultPolicyForSpan(span);
+
+ VirtMem::ProtectJitReadWriteScope writeScope(span.rx(), span.size(), policy);
+ ASMJIT_PROPAGATE(writeFunc(span, userData));
+
+ // Check whether span.truncate() has been called.
+ if (span.size() != size) {
+ // OK, this is a bit awkward... However, shrink wants the original span and newSize, so we have to swap.
+ std::swap(span._size, size);
+ return JitAllocatorImpl_shrink(static_cast<JitAllocatorPrivateImpl*>(_impl), span, size, true);
}
return kErrorOk;
}
+// JitAllocator - Write Scope
+// ==========================
+
+Error JitAllocator::beginWriteScope(WriteScopeData& scope, VirtMem::CachePolicy policy) noexcept {
+ scope._allocator = this;
+ scope._data[0] = size_t(policy);
+ return kErrorOk;
+}
+
+Error JitAllocator::endWriteScope(WriteScopeData& scope) noexcept {
+ if (ASMJIT_UNLIKELY(!scope._allocator))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ return kErrorOk;
+}
+
+Error JitAllocator::flushWriteScope(WriteScopeData& scope) noexcept {
+ if (ASMJIT_UNLIKELY(!scope._allocator))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ return kErrorOk;
+}
+
+Error JitAllocator::scopedWrite(WriteScopeData& scope, Span& span, size_t offset, const void* src, size_t size) noexcept {
+ if (ASMJIT_UNLIKELY(!scope._allocator))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ VirtMem::CachePolicy policy = VirtMem::CachePolicy(scope._data[0]);
+ return scope._allocator->write(span, offset, src, size, policy);
+}
+
+Error JitAllocator::scopedWrite(WriteScopeData& scope, Span& span, WriteFunc writeFunc, void* userData) noexcept {
+ if (ASMJIT_UNLIKELY(!scope._allocator))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ VirtMem::CachePolicy policy = VirtMem::CachePolicy(scope._data[0]);
+ return scope._allocator->write(span, writeFunc, userData, policy);
+}
+
// JitAllocator - Tests
// ====================
@@ -963,6 +1196,34 @@ public:
uint64_t _state[2];
};
+namespace JitAllocatorUtils {
+ static void fillPattern64(void* p_, uint64_t pattern, size_t sizeInBytes) noexcept {
+ uint64_t* p = static_cast<uint64_t*>(p_);
+ size_t n = sizeInBytes / 8u;
+
+ for (size_t i = 0; i < n; i++)
+ p[i] = pattern;
+ }
+
+ static bool verifyPattern64(const void* p_, uint64_t pattern, size_t sizeInBytes) noexcept {
+ const uint64_t* p = static_cast<const uint64_t*>(p_);
+ size_t n = sizeInBytes / 8u;
+
+ for (size_t i = 0; i < n; i++) {
+ if (p[i] != pattern) {
+ INFO("Pattern verification failed at 0x%p [%zu * 8]: value(0x%016llX) != expected(0x%016llX)",
+ p,
+ i,
+ (unsigned long long)p[i],
+ (unsigned long long)pattern);
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
+
// Helper class to verify that JitAllocator doesn't return addresses that overlap.
class JitAllocatorWrapper {
public:
@@ -980,9 +1241,19 @@ public:
class Record : public ZoneTreeNodeT<Record>,
public Range {
public:
- inline Record(uint8_t* addr, size_t size)
+ //! Read/write address, in case this is a dual mapping.
+ void* _rw;
+ //! Describes a pattern used to fill the allocated memory.
+ uint64_t pattern;
+
+ inline Record(void* rx, void* rw, size_t size, uint64_t pattern)
: ZoneTreeNodeT<Record>(),
- Range(addr, size) {}
+ Range(static_cast<uint8_t*>(rx), size),
+ _rw(rw),
+ pattern(pattern) {}
+
+ inline void* rx() const noexcept { return addr; }
+ inline void* rw() const noexcept { return _rw; }
inline bool operator<(const Record& other) const noexcept { return addr < other.addr; }
inline bool operator>(const Record& other) const noexcept { return addr > other.addr; }
@@ -995,65 +1266,82 @@ public:
ZoneAllocator _heap;
ZoneTree<Record> _records;
JitAllocator _allocator;
+ Random _rng;
explicit JitAllocatorWrapper(const JitAllocator::CreateParams* params) noexcept
: _zone(1024 * 1024),
_heap(&_zone),
- _allocator(params) {}
+ _allocator(params),
+ _rng(0x123456789u) {}
- void _insert(void* p_, size_t size) noexcept {
- uint8_t* p = static_cast<uint8_t*>(p_);
+ void _insert(void* pRX, void* pRW, size_t size) noexcept {
+ uint8_t* p = static_cast<uint8_t*>(pRX);
uint8_t* pEnd = p + size - 1;
Record* record;
record = _records.get(p);
- if (record)
- EXPECT(record == nullptr, "Address [%p:%p] collides with a newly allocated [%p:%p]\n", record->addr, record->addr + record->size, p, p + size);
+ EXPECT_NULL(record)
+ .message("Address [%p:%p] collides with a newly allocated [%p:%p]\n", record->addr, record->addr + record->size, p, p + size);
record = _records.get(pEnd);
- if (record)
- EXPECT(record == nullptr, "Address [%p:%p] collides with a newly allocated [%p:%p]\n", record->addr, record->addr + record->size, p, p + size);
+ EXPECT_NULL(record)
+ .message("Address [%p:%p] collides with a newly allocated [%p:%p]\n", record->addr, record->addr + record->size, p, p + size);
+
+ uint64_t pattern = _rng.nextUInt64();
+ record = _heap.newT<Record>(pRX, pRW, size, pattern);
+ EXPECT_NOT_NULL(record);
+
+ {
+ VirtMem::ProtectJitReadWriteScope scope(pRW, size);
+ JitAllocatorUtils::fillPattern64(pRW, pattern, size);
+ }
- record = _heap.newT<Record>(p, size);
- EXPECT(record != nullptr, "Out of memory, cannot allocate 'Record'");
+ VirtMem::flushInstructionCache(pRX, size);
+ EXPECT_TRUE(JitAllocatorUtils::verifyPattern64(pRX, pattern, size));
_records.insert(record);
}
void _remove(void* p) noexcept {
Record* record = _records.get(static_cast<uint8_t*>(p));
- EXPECT(record != nullptr, "Address [%p] doesn't exist\n", p);
+ EXPECT_NOT_NULL(record);
+
+ EXPECT_TRUE(JitAllocatorUtils::verifyPattern64(record->rx(), record->pattern, record->size));
+ EXPECT_TRUE(JitAllocatorUtils::verifyPattern64(record->rw(), record->pattern, record->size));
_records.remove(record);
_heap.release(record, sizeof(Record));
}
void* alloc(size_t size) noexcept {
- void* rxPtr;
- void* rwPtr;
-
- Error err = _allocator.alloc(&rxPtr, &rwPtr, size);
- EXPECT(err == kErrorOk, "JitAllocator failed to allocate %zu bytes\n", size);
+ JitAllocator::Span span;
+ Error err = _allocator.alloc(span, size);
+ EXPECT_EQ(err, kErrorOk)
+ .message("JitAllocator failed to allocate %zu bytes\n", size);
- _insert(rxPtr, size);
- return rxPtr;
+ _insert(span.rx(), span.rw(), size);
+ return span.rx();
}
void release(void* p) noexcept {
_remove(p);
- EXPECT(_allocator.release(p) == kErrorOk, "JitAllocator failed to release '%p'\n", p);
+ EXPECT_EQ(_allocator.release(p), kErrorOk)
+ .message("JitAllocator failed to release '%p'\n", p);
}
void shrink(void* p, size_t newSize) noexcept {
Record* record = _records.get(static_cast<uint8_t*>(p));
- EXPECT(record != nullptr, "Address [%p] doesn't exist\n", p);
+ EXPECT_NOT_NULL(record);
if (!newSize)
return release(p);
- Error err = _allocator.shrink(p, newSize);
- EXPECT(err == kErrorOk, "JitAllocator failed to shrink %p to %zu bytes\n", p, newSize);
+ JitAllocator::Span span;
+ EXPECT_EQ(_allocator.query(span, p), kErrorOk);
+ Error err = _allocator.shrink(span, newSize);
+ EXPECT_EQ(err, kErrorOk)
+ .message("JitAllocator failed to shrink %p to %zu bytes\n", p, newSize);
record->size = newSize;
}
@@ -1095,13 +1383,19 @@ static void BitVectorRangeIterator_testRandom(Random& rnd, size_t count) noexcep
}
for (size_t j = 0; j < kPatternSize; j++) {
- EXPECT(in[j] == out[j], "Invalid pattern detected at [%zu] (%llX != %llX)", j, (unsigned long long)in[j], (unsigned long long)out[j]);
+ EXPECT_EQ(in[j], out[j])
+ .message("Invalid pattern detected at [%zu] (%llX != %llX)", j, (unsigned long long)in[j], (unsigned long long)out[j]);
}
}
}
-UNIT(jit_allocator) {
- size_t kCount = BrokenAPI::hasArg("--quick") ? 1000 : 100000;
+static void test_jit_allocator_reset_empty() noexcept {
+ JitAllocator allocator;
+ allocator.reset(ResetPolicy::kSoft);
+}
+
+static void test_jit_allocator_alloc_release() noexcept {
+ size_t kCount = BrokenAPI::hasArg("--quick") ? 20000 : 100000;
struct TestParams {
const char* name;
@@ -1110,15 +1404,23 @@ UNIT(jit_allocator) {
uint32_t granularity;
};
- static TestParams testParams[] = {
- { "Default", JitAllocatorOptions::kNone, 0, 0 },
- { "16MB blocks", JitAllocatorOptions::kNone, 16 * 1024 * 1024, 0 },
- { "256B granularity", JitAllocatorOptions::kNone, 0, 256 },
- { "kUseDualMapping", JitAllocatorOptions::kUseDualMapping, 0, 0 },
- { "kUseMultiplePools", JitAllocatorOptions::kUseMultiplePools, 0, 0 },
- { "kFillUnusedMemory", JitAllocatorOptions::kFillUnusedMemory, 0, 0 },
- { "kImmediateRelease", JitAllocatorOptions::kImmediateRelease, 0, 0 },
- { "kUseDualMapping | kFillUnusedMemory", JitAllocatorOptions::kUseDualMapping | JitAllocatorOptions::kFillUnusedMemory, 0, 0 }
+ using Opt = JitAllocatorOptions;
+
+ VirtMem::HardenedRuntimeInfo hri = VirtMem::hardenedRuntimeInfo();
+
+ TestParams testParams[] = {
+ { "Default" , Opt::kNone, 0, 0 },
+ { "16MB blocks" , Opt::kNone, 16 * 1024 * 1024, 0 },
+ { "256B granularity" , Opt::kNone, 0, 256 },
+ { "kUseMultiplePools" , Opt::kUseMultiplePools, 0, 0 },
+ { "kFillUnusedMemory" , Opt::kFillUnusedMemory, 0, 0 },
+ { "kImmediateRelease" , Opt::kImmediateRelease, 0, 0 },
+ { "kDisableInitialPadding" , Opt::kDisableInitialPadding, 0, 0 },
+ { "kUseLargePages" , Opt::kUseLargePages, 0, 0 },
+ { "kUseLargePages | kFillUnusedMemory" , Opt::kUseLargePages | Opt::kFillUnusedMemory, 0, 0 },
+ { "kUseLargePages | kAlignBlockSizeToLargePage", Opt::kUseLargePages | Opt::kAlignBlockSizeToLargePage, 0, 0 },
+ { "kUseDualMapping" , Opt::kUseDualMapping , 0, 0 },
+ { "kUseDualMapping | kFillUnusedMemory" , Opt::kUseDualMapping | Opt::kFillUnusedMemory, 0, 0 }
};
INFO("BitVectorRangeIterator<uint32_t>");
@@ -1134,6 +1436,12 @@ UNIT(jit_allocator) {
}
for (uint32_t testId = 0; testId < ASMJIT_ARRAY_SIZE(testParams); testId++) {
+ // Don't try to allocate dual-mapping if dual mapping is not possible - it would fail the test.
+ if (Support::test(testParams[testId].options, JitAllocatorOptions::kUseDualMapping) &&
+ !Support::test(hri.flags, VirtMem::HardenedRuntimeFlags::kDualMapping)) {
+ continue;
+ }
+
INFO("JitAllocator(%s)", testParams[testId].name);
JitAllocator::CreateParams params {};
@@ -1151,8 +1459,7 @@ UNIT(jit_allocator) {
INFO(" Memory alloc/release test - %d allocations", kCount);
void** ptrArray = (void**)::malloc(sizeof(void*) * size_t(kCount));
- EXPECT(ptrArray != nullptr,
- "Couldn't allocate '%u' bytes for pointer-array", unsigned(sizeof(void*) * size_t(kCount)));
+ EXPECT_NOT_NULL(ptrArray);
// Random blocks tests...
INFO(" Allocating random blocks...");
@@ -1235,8 +1542,30 @@ UNIT(jit_allocator) {
::free(ptrArray);
}
}
-#endif
+
+static void test_jit_allocator_query() noexcept {
+ JitAllocator allocator;
+ size_t allocatedSize = 100;
+
+ JitAllocator::Span allocatedSpan;
+ EXPECT_EQ(allocator.alloc(allocatedSpan, allocatedSize), kErrorOk);
+ EXPECT_NOT_NULL(allocatedSpan.rx());
+ EXPECT_GE(allocatedSpan.size(), allocatedSize);
+
+ JitAllocator::Span queriedSpan;
+ EXPECT_EQ(allocator.query(queriedSpan, allocatedSpan.rx()), kErrorOk);
+ EXPECT_EQ(allocatedSpan.rx(), queriedSpan.rx());
+ EXPECT_EQ(allocatedSpan.rw(), queriedSpan.rw());
+ EXPECT_EQ(allocatedSpan.size(), queriedSpan.size());
+}
+
+UNIT(jit_allocator) {
+ test_jit_allocator_reset_empty();
+ test_jit_allocator_alloc_release();
+ test_jit_allocator_query();
+}
+#endif // ASMJIT_TEST
ASMJIT_END_NAMESPACE
-#endif
+#endif // !ASMJIT_NO_JIT
diff --git a/3rdparty/asmjit/src/asmjit/core/jitallocator.h b/3rdparty/asmjit/src/asmjit/core/jitallocator.h
index e8fe69519ee..b694f8cd535 100644
--- a/3rdparty/asmjit/src/asmjit/core/jitallocator.h
+++ b/3rdparty/asmjit/src/asmjit/core/jitallocator.h
@@ -10,6 +10,7 @@
#ifndef ASMJIT_NO_JIT
#include "../core/globals.h"
+#include "../core/support.h"
#include "../core/virtmem.h"
ASMJIT_BEGIN_NAMESPACE
@@ -26,6 +27,10 @@ enum class JitAllocatorOptions : uint32_t {
//! The first buffer has read and execute permissions and the second buffer has read+write permissions.
//!
//! See \ref VirtMem::allocDualMapping() for more details about this feature.
+ //!
+ //! \remarks Dual mapping would be automatically turned on by \ref JitAllocator in case of hardened runtime that
+ //! enforces `W^X` policy, so specifying this flag is essentially forcing to use dual mapped pages even when RWX
+ //! pages can be allocated and dual mapping is not necessary.
kUseDualMapping = 0x00000001u,
//! Enables the use of multiple pools with increasing granularity instead of a single pool. This flag would enable
@@ -50,6 +55,40 @@ enum class JitAllocatorOptions : uint32_t {
//! or have all blocks fully occupied.
kImmediateRelease = 0x00000008u,
+ //! This flag enables placing functions (or allocating memory) at the very beginning of each memory mapped region.
+ //!
+ //! Initially, this was the default behavior. However, LLVM developers working on undefined behavior sanitizer
+ //! (UBSAN) decided that they want to store metadata before each function and to access such metadata before an
+ //! indirect function call. This means that the instrumented code always reads from `[fnPtr - 8]` to decode whether
+ //! the function has his metadata present. However, reading 8 bytes below a function means that if a function is
+ //! placed at the very beginning of a memory mapped region, it could try to read bytes that are inaccessible. And
+ //! since AsmJit can be compiled as a shared library and used by applications instrumented by UBSAN, it's not
+ //! possible to conditionally compile the support only when necessary.
+ //!
+ //! \remarks This flag controls a workaround to make it possible to use LLVM UBSAN with AsmJit's \ref JitAllocator.
+ //! There is no undefined behavior even when `kDisableInitialPadding` is used, however, that doesn't really matter
+ //! as LLVM's UBSAN introduces one, and according to LLVM developers it's a "trade-off". This flag is safe to use
+ //! when the code is not instrumented with LLVM's UBSAN.
+ kDisableInitialPadding = 0x00000010u,
+
+ //! Enables the use of large pages, if they are supported and the process can actually allocate them.
+ //!
+ //! \remarks This flag is a hint - if large pages can be allocated, JitAllocator would try to allocate them.
+ //! However, if the allocation fails, it will still try to fallback to use regular pages as \ref JitAllocator
+ //! is designed to minimize allocation failures, so a regular page is better than no page at all. Also, if a
+ //! block \ref JitAllocator wants to allocate is too small to consume a whole large page, regular page(s) will
+ //! be allocated as well.
+ kUseLargePages = 0x00000020u,
+
+ //! Forces \ref JitAllocator to always align block size to be at least as big as a large page, if large pages are
+ //! enabled. This option does nothing if large pages are disabled.
+ //!
+ //! \remarks If \ref kUseLargePages option is used, the allocator would prefer large pages only when allocating a
+ //! block that has a sufficient size. Usually the allocator first allocates smaller block and when more requests
+ //! come it will start increasing the block size of next allocations. This option makes it sure that even the first
+ //! allocation would be the same as a minimum large page when large pages are enabled and can be allocated.
+ kAlignBlockSizeToLargePage = 0x00000040u,
+
//! Use a custom fill pattern, must be combined with `kFlagFillUnusedMemory`.
kCustomFillPattern = 0x10000000u
};
@@ -75,6 +114,7 @@ class JitAllocator {
public:
ASMJIT_NONCOPYABLE(JitAllocator)
+ //! Visible \ref JitAllocator implementation data.
struct Impl {
//! Allocator options.
JitAllocatorOptions options;
@@ -86,9 +126,14 @@ public:
uint32_t fillPattern;
};
+ //! \name Members
+ //! \{
+
//! Allocator implementation (private).
Impl* _impl;
+ //! \}
+
//! \name Construction & Destruction
//! \{
@@ -129,7 +174,7 @@ public:
uint32_t fillPattern = 0;
// Reset the content of `CreateParams`.
- inline void reset() noexcept { memset(this, 0, sizeof(*this)); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = CreateParams{}; }
};
//! Creates a `JitAllocator` instance.
@@ -137,7 +182,7 @@ public:
//! Destroys the `JitAllocator` instance and release all blocks held.
ASMJIT_API ~JitAllocator() noexcept;
- inline bool isInitialized() const noexcept { return _impl->blockSize == 0; }
+ ASMJIT_INLINE_NODEBUG bool isInitialized() const noexcept { return _impl->blockSize == 0; }
//! Free all allocated memory - makes all pointers returned by `alloc()` invalid.
//!
@@ -151,47 +196,315 @@ public:
//! \{
//! Returns allocator options, see `Flags`.
- inline JitAllocatorOptions options() const noexcept { return _impl->options; }
+ ASMJIT_INLINE_NODEBUG JitAllocatorOptions options() const noexcept { return _impl->options; }
//! Tests whether the allocator has the given `option` set.
- inline bool hasOption(JitAllocatorOptions option) const noexcept { return uint32_t(_impl->options & option) != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasOption(JitAllocatorOptions option) const noexcept { return uint32_t(_impl->options & option) != 0; }
//! Returns a base block size (a minimum size of block that the allocator would allocate).
- inline uint32_t blockSize() const noexcept { return _impl->blockSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t blockSize() const noexcept { return _impl->blockSize; }
//! Returns granularity of the allocator.
- inline uint32_t granularity() const noexcept { return _impl->granularity; }
+ ASMJIT_INLINE_NODEBUG uint32_t granularity() const noexcept { return _impl->granularity; }
//! Returns pattern that is used to fill unused memory if `kFlagUseFillPattern` is set.
- inline uint32_t fillPattern() const noexcept { return _impl->fillPattern; }
+ ASMJIT_INLINE_NODEBUG uint32_t fillPattern() const noexcept { return _impl->fillPattern; }
//! \}
//! \name Alloc & Release
//! \{
- //! Allocates a new memory block of the requested `size`.
+ //! A memory reference returned by \ref JitAllocator::alloc().
//!
- //! When the function is successful it stores two pointers in `rxPtrOut` and `rwPtrOut`. The pointers will be
- //! different only if `kOptionUseDualMapping` was used to setup the allocator (in that case the `rxPtrOut` would
- //! point to a Read+Execute region and `rwPtrOut` would point to a Read+Write region of the same memory-mapped block.
- ASMJIT_API Error alloc(void** rxPtrOut, void** rwPtrOut, size_t size) noexcept;
+ //! Span contains everything needed to actually write new code to the memory chunk it references.
+ class Span {
+ public:
+ //! \name Constants
+ //! \{
+
+ //! Span flags
+ enum class Flags : uint32_t {
+ //! No flags.
+ kNone = 0u,
+
+ //! The process has never executed the region of the span.
+ //!
+ //! If this flag is set on a \ref Span it would mean that the allocator can avoid flushing
+ //! instruction cache after a code has been written to it.
+ kInstructionCacheClean = 0x00000001u
+ };
+
+ //! \}
+
+ //! \name Members
+ //! \{
+
+ //! Address of memory that has Read and Execute permissions.
+ void* _rx = nullptr;
+
+ //! Address of memory that has Read and Write permissions.
+ void* _rw = nullptr;
+
+ //! Size of the span in bytes (rounded up to the allocation granularity).
+ size_t _size = 0;
+
+ //! Pointer that references a memory block maintained by \ref JitAllocator.
+ //!
+ //! This pointer is considered private and should never be used nor inspected outside of AsmJit.
+ void* _block = nullptr;
+
+ //! Span flags.
+ Flags _flags = Flags::kNone;
+
+ //! Reserved for future use.
+ uint32_t _reserved = 0;
+
+ //! \}
+
+ //! \name Accessors
+ //! \{
+
+ //! Returns a pointer having Read & Execute permissions (references executable memory).
+ //!
+ //! This pointer is never NULL if the allocation succeeded, it points to an executable memory.
+ ASMJIT_INLINE_NODEBUG void* rx() const noexcept { return _rx; }
+
+ //! Returns a pointer having Read & Write permissions (references writable memory).
+ //!
+ //! Depending on the type of the allocation strategy this could either be:
+ //!
+ //! - the same address as returned by `rx()` if the allocator uses RWX mapping (pages have all of Read, Write,
+ //! and Execute permissions) or MAP_JIT, which requires either \ref VirtMem::ProtectJitReadWriteScope or to
+ //! call \ref VirtMem::protectJitMemory() manually.
+ //! - a valid pointer, but not the same as `rx` - this would be valid if dual mapping is used.
+ //! - NULL pointer, in case that the allocation strategy doesn't use RWX, MAP_JIT, or dual mapping. In this
+ //! case only \ref JitAllocator can copy new code into the executable memory referenced by \ref Span.
+ //!
+ //! \note If `rw()` returns a non-null pointer it's important to use either VirtMem::protectJitMemory() or
+ //! \ref VirtMem::ProtectJitReadWriteScope to guard the write, because in case of `MAP_JIT` it would temporarily
+ //! switch the permissions of the pointer to RW (that's per thread permissions).
+ //!
+ //! If \ref VirtMem::ProtectJitReadWriteScope is not used it's important to clear the instruction cache via
+ //! \ref VirtMem::flushInstructionCache() after the write is done.
+ ASMJIT_INLINE_NODEBUG void* rw() const noexcept { return _rw; }
+
+ //! Returns size of this span, aligned to the allocator granularity.
+ ASMJIT_INLINE_NODEBUG size_t size() const noexcept { return _size; }
+
+ //! Returns span flags.
+ ASMJIT_INLINE_NODEBUG Flags flags() const noexcept { return _flags; }
+
+ //! Shrinks this span to `newSize`.
+ //!
+ //! \note This is the only function that is able to change the size of a span, and it's only use case is to
+ //! shrink the span size during \ref JitAllocator::write(). When the writer detects that the span size shrunk,
+ //! it will automatically shrink the memory used by the span, and propagate the new aligned size to the caller.
+ ASMJIT_INLINE_NODEBUG void shrink(size_t newSize) noexcept { _size = Support::min(_size, newSize); }
+
+ //! Returns whether \ref rw() returns a non-null pointer.
+ ASMJIT_INLINE_NODEBUG bool isDirectlyWritable() const noexcept { return _rw != nullptr; }
+
+ //! \}
+ };
+
+ //! Allocates a new memory span of the requested `size`.
+ ASMJIT_API Error alloc(Span& out, size_t size) noexcept;
//! Releases a memory block returned by `alloc()`.
//!
//! \remarks This function is thread-safe.
- ASMJIT_API Error release(void* rxPtr) noexcept;
+ ASMJIT_API Error release(void* rx) noexcept;
- //! Frees extra memory allocated with `rxPtr` by shrinking it to the given `newSize`.
+ //! Frees extra memory allocated with `rx` by shrinking it to the given `newSize`.
//!
//! \remarks This function is thread-safe.
- ASMJIT_API Error shrink(void* rxPtr, size_t newSize) noexcept;
+ ASMJIT_API Error shrink(Span& span, size_t newSize) noexcept;
- //! Queries information about an allocated memory block that contains the given `rxPtr`.
+ //! Queries information about an allocated memory block that contains the given `rx`, and writes it to `out`.
//!
- //! The function returns `kErrorOk` when `rxPtr` is matched and fills `rxPtrOut`, `rwPtrOut`, and `sizeOut` output
- //! arguments. The returned `rxPtrOut` and `rwPtrOut` pointers point to the beginning of the block, and `sizeOut`
- //! describes the total amount of bytes this allocation uses - `sizeOut` will always be aligned to the allocation
- //! granularity, so for example if an allocation was 1 byte and the size granularity is 64, the returned `sizeOut`
- //! will be 64 bytes, because that's what the allocator sees.
- ASMJIT_API Error query(void* rxPtr, void** rxPtrOut, void** rwPtrOut, size_t* sizeOut) const noexcept;
+ //! If the pointer is matched, the function returns `kErrorOk` and fills `out` with the corresponding span.
+ ASMJIT_API Error query(Span& out, void* rx) const noexcept;
+
+#if !defined(ASMJIT_NO_DEPRECATED)
+ //! Allocates a new memory block of the requested `size`.
+ ASMJIT_DEPRECATED("Use alloc(Span& out, size_t size) instead")
+ ASMJIT_FORCE_INLINE Error alloc(void** rxPtrOut, void** rwPtrOut, size_t size) noexcept {
+ Span span;
+ Error err = alloc(span, size);
+ *rwPtrOut = span.rw();
+ *rxPtrOut = span.rx();
+ return err;
+ }
+
+ ASMJIT_DEPRECATED("Use shrink(Span& span, size_t newSize) instead")
+ ASMJIT_FORCE_INLINE Error shrink(void* rxPtr, size_t newSize) noexcept {
+ Span span;
+ ASMJIT_PROPAGATE(query(span, rxPtr));
+ return (span.size() > newSize) ? shrink(span, newSize) : Error(kErrorOk);
+ }
+
+ ASMJIT_DEPRECATED("Use query(Span& out, void* rx) instead")
+ ASMJIT_FORCE_INLINE Error query(void* rxPtr, void** rxPtrOut, void** rwPtrOut, size_t* sizeOut) const noexcept {
+ Span span;
+ Error err = query(span, rxPtr);
+ *rxPtrOut = span.rx();
+ *rwPtrOut = span.rw();
+ *sizeOut = span.size();
+ return err;
+ }
+#endif
+
+ //! \}
+
+ //! \name Write Operations
+ //! \{
+
+ typedef Error (ASMJIT_CDECL* WriteFunc)(Span& span, void* userData) ASMJIT_NOEXCEPT_TYPE;
+
+ ASMJIT_API Error write(
+ Span& span,
+ size_t offset,
+ const void* src,
+ size_t size,
+ VirtMem::CachePolicy policy = VirtMem::CachePolicy::kDefault) noexcept;
+
+ ASMJIT_API Error write(
+ Span& span,
+ WriteFunc writeFunc,
+ void* userData,
+ VirtMem::CachePolicy policy = VirtMem::CachePolicy::kDefault) noexcept;
+
+ template<class Lambda>
+ ASMJIT_FORCE_INLINE Error write(
+ Span& span,
+ Lambda&& lambdaFunc,
+ VirtMem::CachePolicy policy = VirtMem::CachePolicy::kDefault) noexcept {
+
+ WriteFunc wrapperFunc = [](Span& span, void* userData) noexcept -> Error {
+ Lambda& lambdaFunc = *static_cast<Lambda*>(userData);
+ return lambdaFunc(span);
+ };
+ return write(span, wrapperFunc, (void*)(&lambdaFunc), policy);
+ }
+
+ //! \}
+
+ //! \name Write Operations with Scope
+ //! \{
+
+ //! \cond INTERNAL
+
+ //! Write scope data.
+ //!
+ //! This is mostly for internal purposes, please use \ref WriteScope instead.
+ struct WriteScopeData {
+ //! \name Members
+ //! \{
+
+ //! Link to the allocator.
+ JitAllocator* _allocator;
+ //! Cache policy passed to \ref JitAllocator::beginWriteScope().
+ VirtMem::CachePolicy _policy;
+ //! Internal flags used by the implementation.
+ uint32_t _flags;
+ //! Internal data used by the implementation.
+ size_t _data[64];
+
+ //! \}
+ };
+
+ //! Begins a write `scope`.
+ //!
+ //! This is mostly for internal purposes, please use \ref WriteScope constructor instead.
+ ASMJIT_API Error beginWriteScope(WriteScopeData& scope, VirtMem::CachePolicy policy = VirtMem::CachePolicy::kDefault) noexcept;
+
+ //! Ends a write `scope`.
+ //!
+ //! This is mostly for internal purposes, please use \ref WriteScope destructor instead.
+ ASMJIT_API Error endWriteScope(WriteScopeData& scope) noexcept;
+
+ //! Flushes accumulated changes in a write `scope`.
+ //!
+ //! This is mostly for internal purposes, please use \ref WriteScope destructor or \ref WriteScope::flush() instead.
+ ASMJIT_API Error flushWriteScope(WriteScopeData& scope) noexcept;
+
+ //! Alternative to `JitAllocator::write(span, offset, src, size)`, but under a write `scope`.
+ //!
+ //! This is mostly for internal purposes, please use \ref WriteScope::write() instead.
+ ASMJIT_API Error scopedWrite(WriteScopeData& scope, Span& span, size_t offset, const void* src, size_t size) noexcept;
+
+ //! Alternative to `JitAllocator::write(span, writeFunc, userData)`, but under a write `scope`.
+ //!
+ //! This is mostly for internal purposes, please use \ref WriteScope::write() instead.
+ ASMJIT_API Error scopedWrite(WriteScopeData& scope, Span& span, WriteFunc writeFunc, void* userData) noexcept;
+
+ //! Alternative to `JitAllocator::write(span, [lambda])`, but under a write `scope`.
+ //!
+ //! This is mostly for internal purposes, please use \ref WriteScope::write() instead.
+ template<class Lambda>
+ inline Error scopedWrite(WriteScopeData& scope, Span& span, Lambda&& lambdaFunc) noexcept {
+ WriteFunc wrapperFunc = [](Span& span, void* userData) noexcept -> Error {
+ Lambda& lambdaFunc = *static_cast<Lambda*>(userData);
+ return lambdaFunc(span);
+ };
+ return scopedWrite(scope, span, wrapperFunc, (void*)(&lambdaFunc));
+ }
+
+ //! \endcond
+
+ //! Write scope can be used to create a single scope that is optimized for writing multiple spans.
+ class WriteScope : public WriteScopeData {
+ public:
+ ASMJIT_NONCOPYABLE(WriteScope)
+
+ //! \name Construction & Destruction
+ //! \{
+
+ // Begins a write scope.
+ inline explicit WriteScope(JitAllocator* allocator, VirtMem::CachePolicy policy = VirtMem::CachePolicy::kDefault) noexcept {
+ allocator->beginWriteScope(*this, policy);
+ }
+
+ // Ends a write scope.
+ inline ~WriteScope() noexcept {
+ if (_allocator)
+ _allocator->endWriteScope(*this);
+ }
+
+ //! \}
+
+ //! \name Accessors
+ //! \{
+
+ ASMJIT_INLINE_NODEBUG JitAllocator* allocator() const noexcept { return _allocator; }
+ ASMJIT_INLINE_NODEBUG VirtMem::CachePolicy policy() const noexcept { return _policy; }
+
+ //! \}
+
+ //! \name Operations
+ //! \{
+
+ //! Similar to `JitAllocator::write(span, offset, src, size)`, but under a write scope.
+ ASMJIT_INLINE_NODEBUG Error write(Span& span, size_t offset, const void* src, size_t size) noexcept {
+ return _allocator->scopedWrite(*this, span, offset, src, size);
+ }
+
+ //! Similar to `JitAllocator::write(span, writeFunc, userData)`, but under a write scope.
+ ASMJIT_INLINE_NODEBUG Error write(Span& span, WriteFunc writeFunc, void* userData) noexcept {
+ return _allocator->scopedWrite(*this, span, writeFunc, userData);
+ }
+
+ //! Similar to `JitAllocator::write(span, <lambda>)`, but under a write scope.
+ template<class Lambda>
+ ASMJIT_INLINE_NODEBUG Error write(Span& span, Lambda&& lambdaFunc) noexcept {
+ return _allocator->scopedWrite(*this, span, lambdaFunc);
+ }
+
+ //! Flushes accumulated changes in this write scope.
+ ASMJIT_INLINE_NODEBUG Error flush() noexcept {
+ return _allocator->flushWriteScope(*this);
+ }
+
+ //! \}
+ };
//! \}
@@ -211,36 +524,32 @@ public:
//! Allocation overhead (in bytes) required to maintain all blocks.
size_t _overheadSize;
- inline void reset() noexcept {
- _blockCount = 0;
- _usedSize = 0;
- _reservedSize = 0;
- _overheadSize = 0;
- }
+ //! Resets the statistics to all zeros.
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { *this = Statistics{}; }
//! Returns count of blocks managed by `JitAllocator` at the moment.
- inline size_t blockCount() const noexcept { return _blockCount; }
+ ASMJIT_INLINE_NODEBUG size_t blockCount() const noexcept { return _blockCount; }
//! Returns the number of active allocations.
- inline size_t allocationCount() const noexcept { return _allocationCount; }
+ ASMJIT_INLINE_NODEBUG size_t allocationCount() const noexcept { return _allocationCount; }
//! Returns how many bytes are currently used.
- inline size_t usedSize() const noexcept { return _usedSize; }
+ ASMJIT_INLINE_NODEBUG size_t usedSize() const noexcept { return _usedSize; }
//! Returns the number of bytes unused by the allocator at the moment.
- inline size_t unusedSize() const noexcept { return _reservedSize - _usedSize; }
- //! Returns the total number of bytes bytes reserved by the allocator (sum of sizes of all blocks).
- inline size_t reservedSize() const noexcept { return _reservedSize; }
+ ASMJIT_INLINE_NODEBUG size_t unusedSize() const noexcept { return _reservedSize - _usedSize; }
+ //! Returns the total number of bytes reserved by the allocator (sum of sizes of all blocks).
+ ASMJIT_INLINE_NODEBUG size_t reservedSize() const noexcept { return _reservedSize; }
//! Returns the number of bytes the allocator needs to manage the allocated memory.
- inline size_t overheadSize() const noexcept { return _overheadSize; }
+ ASMJIT_INLINE_NODEBUG size_t overheadSize() const noexcept { return _overheadSize; }
- inline double usedSizeAsPercent() const noexcept {
+ ASMJIT_INLINE_NODEBUG double usedSizeAsPercent() const noexcept {
return (double(usedSize()) / (double(reservedSize()) + 1e-16)) * 100.0;
}
- inline double unusedSizeAsPercent() const noexcept {
+ ASMJIT_INLINE_NODEBUG double unusedSizeAsPercent() const noexcept {
return (double(unusedSize()) / (double(reservedSize()) + 1e-16)) * 100.0;
}
- inline double overheadSizeAsPercent() const noexcept {
+ ASMJIT_INLINE_NODEBUG double overheadSizeAsPercent() const noexcept {
return (double(overheadSize()) / (double(reservedSize()) + 1e-16)) * 100.0;
}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/jitruntime.cpp b/3rdparty/asmjit/src/asmjit/core/jitruntime.cpp
index 491c2040fbe..0cc026987a2 100644
--- a/3rdparty/asmjit/src/asmjit/core/jitruntime.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/jitruntime.cpp
@@ -15,6 +15,7 @@ JitRuntime::JitRuntime(const JitAllocator::CreateParams* params) noexcept
: _allocator(params) {
_environment = Environment::host();
_environment.setObjectFormat(ObjectFormat::kJIT);
+ _cpuFeatures = CpuInfo::host().features();
}
JitRuntime::~JitRuntime() noexcept {}
@@ -29,45 +30,43 @@ Error JitRuntime::_add(void** dst, CodeHolder* code) noexcept {
if (ASMJIT_UNLIKELY(estimatedCodeSize == 0))
return DebugUtils::errored(kErrorNoCodeGenerated);
- uint8_t* rx;
- uint8_t* rw;
- ASMJIT_PROPAGATE(_allocator.alloc((void**)&rx, (void**)&rw, estimatedCodeSize));
+ JitAllocator::Span span;
+ ASMJIT_PROPAGATE(_allocator.alloc(span, estimatedCodeSize));
// Relocate the code.
- Error err = code->relocateToBase(uintptr_t((void*)rx));
+ Error err = code->relocateToBase(uintptr_t(span.rx()));
if (ASMJIT_UNLIKELY(err)) {
- _allocator.release(rx);
+ _allocator.release(span.rx());
return err;
}
// Recalculate the final code size and shrink the memory we allocated for it
// in case that some relocations didn't require records in an address table.
size_t codeSize = code->codeSize();
- if (codeSize < estimatedCodeSize)
- _allocator.shrink(rx, codeSize);
+ ASMJIT_ASSERT(codeSize <= estimatedCodeSize);
- if (codeSize < estimatedCodeSize)
- _allocator.shrink(rx, codeSize);
-
- {
- VirtMem::ProtectJitReadWriteScope rwScope(rx, codeSize);
+ _allocator.write(span, [&](JitAllocator::Span& span) noexcept -> Error {
+ uint8_t* rw = static_cast<uint8_t*>(span.rw());
for (Section* section : code->_sections) {
size_t offset = size_t(section->offset());
size_t bufferSize = size_t(section->bufferSize());
size_t virtualSize = size_t(section->virtualSize());
- ASMJIT_ASSERT(offset + bufferSize <= codeSize);
+ ASMJIT_ASSERT(offset + bufferSize <= span.size());
memcpy(rw + offset, section->data(), bufferSize);
if (virtualSize > bufferSize) {
- ASMJIT_ASSERT(offset + virtualSize <= codeSize);
+ ASMJIT_ASSERT(offset + virtualSize <= span.size());
memset(rw + offset + bufferSize, 0, virtualSize - bufferSize);
}
}
- }
- *dst = rx;
+ span.shrink(codeSize);
+ return kErrorOk;
+ });
+
+ *dst = span.rx();
return kErrorOk;
}
diff --git a/3rdparty/asmjit/src/asmjit/core/jitruntime.h b/3rdparty/asmjit/src/asmjit/core/jitruntime.h
index 6f35e21277a..717a6b58d6b 100644
--- a/3rdparty/asmjit/src/asmjit/core/jitruntime.h
+++ b/3rdparty/asmjit/src/asmjit/core/jitruntime.h
@@ -20,8 +20,10 @@ class CodeHolder;
//! \addtogroup asmjit_virtual_memory
//! \{
-//! JIT execution runtime is a special `Target` that is designed to store and
-//! execute the generated code.
+//! JIT execution runtime is a special `Target` that is designed to store and execute a generated code.
+//!
+//! JIT runtime is the easiest way of using AsmJit as it abstracts allocation and deallocation of virtual memory
+//! where executable code can be placed and from which it can be executed as well.
class ASMJIT_VIRTAPI JitRuntime : public Target {
public:
ASMJIT_NONCOPYABLE(JitRuntime)
@@ -35,9 +37,19 @@ public:
//! Creates a `JitRuntime` instance.
ASMJIT_API explicit JitRuntime(const JitAllocator::CreateParams* params = nullptr) noexcept;
//! Destroys the `JitRuntime` instance.
- ASMJIT_API virtual ~JitRuntime() noexcept;
+ ASMJIT_API ~JitRuntime() noexcept override;
- inline void reset(ResetPolicy resetPolicy = ResetPolicy::kSoft) noexcept {
+ //! \}
+
+ //! \name Accessors
+ //! \{
+
+ //! Resets the \ref JitRuntime, freeing everything that was allocated by it.
+ //!
+ //! Depending on `resetPolicy` the currently held memory can be either freed entirely when ResetPolicy::kHard is used,
+ //! or the allocator can keep some of it for next allocations when ResetPolicy::kSoft is used, which is the default
+ //! behavior.
+ ASMJIT_INLINE_NODEBUG void reset(ResetPolicy resetPolicy = ResetPolicy::kSoft) noexcept {
_allocator.reset(resetPolicy);
}
@@ -47,7 +59,7 @@ public:
//! \{
//! Returns the associated `JitAllocator`.
- inline JitAllocator* allocator() const noexcept { return const_cast<JitAllocator*>(&_allocator); }
+ ASMJIT_INLINE_NODEBUG JitAllocator* allocator() const noexcept { return const_cast<JitAllocator*>(&_allocator); }
//! \}
@@ -62,13 +74,13 @@ public:
//! The beginning of the memory allocated for the function is returned in `dst`. If failed `Error` code is returned
//! and `dst` is explicitly set to `nullptr` (this means that you don't have to set it to null before calling `add()`).
template<typename Func>
- inline Error add(Func* dst, CodeHolder* code) noexcept {
+ ASMJIT_INLINE_NODEBUG Error add(Func* dst, CodeHolder* code) noexcept {
return _add(Support::ptr_cast_impl<void**, Func*>(dst), code);
}
//! Releases `p` which was obtained by calling `add()`.
template<typename Func>
- inline Error release(Func p) noexcept {
+ ASMJIT_INLINE_NODEBUG Error release(Func p) noexcept {
return _release(Support::ptr_cast_impl<void*, Func>(p));
}
diff --git a/3rdparty/asmjit/src/asmjit/core/logger.cpp b/3rdparty/asmjit/src/asmjit/core/logger.cpp
index 4567b3c9389..9bc14bae5fd 100644
--- a/3rdparty/asmjit/src/asmjit/core/logger.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/logger.cpp
@@ -19,6 +19,14 @@ Logger::Logger() noexcept
: _options() {}
Logger::~Logger() noexcept {}
+// [[pure virtual]]
+Error Logger::_log(const char* data, size_t size) noexcept {
+ DebugUtils::unused(data, size);
+
+ // Do not error in this case - the logger would just sink to /dev/null.
+ return kErrorOk;
+}
+
Error Logger::logf(const char* fmt, ...) noexcept {
Error err;
va_list ap;
diff --git a/3rdparty/asmjit/src/asmjit/core/logger.h b/3rdparty/asmjit/src/asmjit/core/logger.h
index d416a50d84d..54c169f52fe 100644
--- a/3rdparty/asmjit/src/asmjit/core/logger.h
+++ b/3rdparty/asmjit/src/asmjit/core/logger.h
@@ -47,38 +47,38 @@ public:
//! \{
//! Returns \ref FormatOptions of this logger.
- inline FormatOptions& options() noexcept { return _options; }
+ ASMJIT_INLINE_NODEBUG FormatOptions& options() noexcept { return _options; }
//! \overload
- inline const FormatOptions& options() const noexcept { return _options; }
+ ASMJIT_INLINE_NODEBUG const FormatOptions& options() const noexcept { return _options; }
//! Sets formatting options of this Logger to `options`.
- inline void setOptions(const FormatOptions& options) noexcept { _options = options; }
+ ASMJIT_INLINE_NODEBUG void setOptions(const FormatOptions& options) noexcept { _options = options; }
//! Resets formatting options of this Logger to defaults.
- inline void resetOptions() noexcept { _options.reset(); }
+ ASMJIT_INLINE_NODEBUG void resetOptions() noexcept { _options.reset(); }
//! Returns formatting flags.
- inline FormatFlags flags() const noexcept { return _options.flags(); }
+ ASMJIT_INLINE_NODEBUG FormatFlags flags() const noexcept { return _options.flags(); }
//! Tests whether the logger has the given `flag` enabled.
- inline bool hasFlag(FormatFlags flag) const noexcept { return _options.hasFlag(flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(FormatFlags flag) const noexcept { return _options.hasFlag(flag); }
//! Sets formatting flags to `flags`.
- inline void setFlags(FormatFlags flags) noexcept { _options.setFlags(flags); }
+ ASMJIT_INLINE_NODEBUG void setFlags(FormatFlags flags) noexcept { _options.setFlags(flags); }
//! Enables the given formatting `flags`.
- inline void addFlags(FormatFlags flags) noexcept { _options.addFlags(flags); }
+ ASMJIT_INLINE_NODEBUG void addFlags(FormatFlags flags) noexcept { _options.addFlags(flags); }
//! Disables the given formatting `flags`.
- inline void clearFlags(FormatFlags flags) noexcept { _options.clearFlags(flags); }
+ ASMJIT_INLINE_NODEBUG void clearFlags(FormatFlags flags) noexcept { _options.clearFlags(flags); }
//! Returns indentation of a given indentation `group`.
- inline uint32_t indentation(FormatIndentationGroup type) const noexcept { return _options.indentation(type); }
+ ASMJIT_INLINE_NODEBUG uint32_t indentation(FormatIndentationGroup type) const noexcept { return _options.indentation(type); }
//! Sets indentation of the given indentation `group` to `n` spaces.
- inline void setIndentation(FormatIndentationGroup type, uint32_t n) noexcept { _options.setIndentation(type, n); }
+ ASMJIT_INLINE_NODEBUG void setIndentation(FormatIndentationGroup type, uint32_t n) noexcept { _options.setIndentation(type, n); }
//! Resets indentation of the given indentation `group` to 0 spaces.
- inline void resetIndentation(FormatIndentationGroup type) noexcept { _options.resetIndentation(type); }
+ ASMJIT_INLINE_NODEBUG void resetIndentation(FormatIndentationGroup type) noexcept { _options.resetIndentation(type); }
//! Returns padding of a given padding `group`.
- inline size_t padding(FormatPaddingGroup type) const noexcept { return _options.padding(type); }
+ ASMJIT_INLINE_NODEBUG size_t padding(FormatPaddingGroup type) const noexcept { return _options.padding(type); }
//! Sets padding of a given padding `group` to `n`.
- inline void setPadding(FormatPaddingGroup type, uint32_t n) noexcept { _options.setPadding(type, n); }
+ ASMJIT_INLINE_NODEBUG void setPadding(FormatPaddingGroup type, uint32_t n) noexcept { _options.setPadding(type, n); }
//! Resets padding of a given padding `group` to 0, which means that a default will be used.
- inline void resetPadding(FormatPaddingGroup type) noexcept { _options.resetPadding(type); }
+ ASMJIT_INLINE_NODEBUG void resetPadding(FormatPaddingGroup type) noexcept { _options.resetPadding(type); }
//! \}
@@ -90,12 +90,12 @@ public:
//! The function can accept either a null terminated string if `size` is `SIZE_MAX` or a non-null terminated
//! string of the given `size`. The function cannot assume that the data is null terminated and must handle
//! non-null terminated inputs.
- virtual Error _log(const char* data, size_t size) noexcept = 0;
+ ASMJIT_API virtual Error _log(const char* data, size_t size) noexcept;
//! Logs string `str`, which is either null terminated or having size `size`.
- inline Error log(const char* data, size_t size = SIZE_MAX) noexcept { return _log(data, size); }
+ ASMJIT_INLINE_NODEBUG Error log(const char* data, size_t size = SIZE_MAX) noexcept { return _log(data, size); }
//! Logs content of a string `str`.
- inline Error log(const String& str) noexcept { return _log(str.data(), str.size()); }
+ ASMJIT_INLINE_NODEBUG Error log(const String& str) noexcept { return _log(str.data(), str.size()); }
//! Formats the message by using `snprintf()` and then passes the formatted string to \ref _log().
ASMJIT_API Error logf(const char* fmt, ...) noexcept;
@@ -119,7 +119,7 @@ public:
//! Creates a new `FileLogger` that logs to `FILE*`.
ASMJIT_API FileLogger(FILE* file = nullptr) noexcept;
//! Destroys the `FileLogger`.
- ASMJIT_API virtual ~FileLogger() noexcept;
+ ASMJIT_API ~FileLogger() noexcept override;
//! \}
@@ -127,14 +127,14 @@ public:
//! \{
//! Returns the logging output stream or null if the logger has no output stream.
- inline FILE* file() const noexcept { return _file; }
+ ASMJIT_INLINE_NODEBUG FILE* file() const noexcept { return _file; }
//! Sets the logging output stream to `stream` or null.
//!
//! \note If the `file` is null the logging will be disabled. When a logger is attached to `CodeHolder` or any
//! emitter the logging API will always be called regardless of the output file. This means that if you really
//! want to disable logging at emitter level you must not attach a logger to it.
- inline void setFile(FILE* file) noexcept { _file = file; }
+ ASMJIT_INLINE_NODEBUG void setFile(FILE* file) noexcept { _file = file; }
//! \}
@@ -155,7 +155,7 @@ public:
//! Create new `StringLogger`.
ASMJIT_API StringLogger() noexcept;
//! Destroys the `StringLogger`.
- ASMJIT_API virtual ~StringLogger() noexcept;
+ ASMJIT_API ~StringLogger() noexcept override;
//! \}
@@ -165,16 +165,16 @@ public:
//! Returns the content of the logger as \ref String.
//!
//! It can be moved, if desired.
- inline String& content() noexcept { return _content; }
+ ASMJIT_INLINE_NODEBUG String& content() noexcept { return _content; }
//! \overload
- inline const String& content() const noexcept { return _content; }
+ ASMJIT_INLINE_NODEBUG const String& content() const noexcept { return _content; }
//! Returns aggregated logger data as `char*` pointer.
//!
//! The pointer is owned by `StringLogger`, it can't be modified or freed.
- inline const char* data() const noexcept { return _content.data(); }
+ ASMJIT_INLINE_NODEBUG const char* data() const noexcept { return _content.data(); }
//! Returns size of the data returned by `data()`.
- inline size_t dataSize() const noexcept { return _content.size(); }
+ ASMJIT_INLINE_NODEBUG size_t dataSize() const noexcept { return _content.size(); }
//! \}
@@ -182,7 +182,7 @@ public:
//! \{
//! Clears the accumulated logger data.
- inline void clear() noexcept { _content.clear(); }
+ ASMJIT_INLINE_NODEBUG void clear() noexcept { _content.clear(); }
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/core/operand.cpp b/3rdparty/asmjit/src/asmjit/core/operand.cpp
index ee026817f8e..b78dc54678a 100644
--- a/3rdparty/asmjit/src/asmjit/core/operand.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/operand.cpp
@@ -19,36 +19,36 @@ enum class StrongEnumForImmTests : uint32_t {
UNIT(operand) {
INFO("Checking operand sizes");
- EXPECT(sizeof(Operand) == 16);
- EXPECT(sizeof(BaseReg) == 16);
- EXPECT(sizeof(BaseMem) == 16);
- EXPECT(sizeof(Imm) == 16);
- EXPECT(sizeof(Label) == 16);
+ EXPECT_EQ(sizeof(Operand), 16u);
+ EXPECT_EQ(sizeof(BaseReg), 16u);
+ EXPECT_EQ(sizeof(BaseMem), 16u);
+ EXPECT_EQ(sizeof(Imm), 16u);
+ EXPECT_EQ(sizeof(Label), 16u);
INFO("Checking basic functionality of Operand");
Operand a, b;
Operand dummy;
- EXPECT(a.isNone() == true);
- EXPECT(a.isReg() == false);
- EXPECT(a.isMem() == false);
- EXPECT(a.isImm() == false);
- EXPECT(a.isLabel() == false);
- EXPECT(a == b);
- EXPECT(a._data[0] == 0);
- EXPECT(a._data[1] == 0);
+ EXPECT_TRUE(a.isNone());
+ EXPECT_FALSE(a.isReg());
+ EXPECT_FALSE(a.isMem());
+ EXPECT_FALSE(a.isImm());
+ EXPECT_FALSE(a.isLabel());
+ EXPECT_EQ(a, b);
+ EXPECT_EQ(a._data[0], 0u);
+ EXPECT_EQ(a._data[1], 0u);
INFO("Checking basic functionality of Label");
Label label;
- EXPECT(label.isValid() == false);
- EXPECT(label.id() == Globals::kInvalidId);
+ EXPECT_FALSE(label.isValid());
+ EXPECT_EQ(label.id(), Globals::kInvalidId);
INFO("Checking basic functionality of BaseReg");
- EXPECT(BaseReg().isReg() == true);
- EXPECT(BaseReg().isValid() == false);
- EXPECT(BaseReg()._data[0] == 0);
- EXPECT(BaseReg()._data[1] == 0);
- EXPECT(dummy.as<BaseReg>().isValid() == false);
+ EXPECT_TRUE(BaseReg().isReg());
+ EXPECT_FALSE(BaseReg().isValid());
+ EXPECT_EQ(BaseReg()._data[0], 0u);
+ EXPECT_EQ(BaseReg()._data[1], 0u);
+ EXPECT_FALSE(dummy.as<BaseReg>().isValid());
// Create some register (not specific to any architecture).
OperandSignature rSig = OperandSignature::fromOpType(OperandType::kReg) |
@@ -57,75 +57,75 @@ UNIT(operand) {
OperandSignature::fromSize(8);
BaseReg r1(rSig, 5);
- EXPECT(r1.isValid() == true);
- EXPECT(r1.isReg() == true);
- EXPECT(r1.isReg(RegType::kVec128) == true);
- EXPECT(r1.isPhysReg() == true);
- EXPECT(r1.isVirtReg() == false);
- EXPECT(r1.signature() == rSig);
- EXPECT(r1.type() == RegType::kVec128);
- EXPECT(r1.group() == RegGroup::kVec);
- EXPECT(r1.size() == 8);
- EXPECT(r1.id() == 5);
- EXPECT(r1.isReg(RegType::kVec128, 5) == true); // RegType and Id.
- EXPECT(r1._data[0] == 0);
- EXPECT(r1._data[1] == 0);
+ EXPECT_TRUE(r1.isValid());
+ EXPECT_TRUE(r1.isReg());
+ EXPECT_TRUE(r1.isReg(RegType::kVec128));
+ EXPECT_TRUE(r1.isPhysReg());
+ EXPECT_FALSE(r1.isVirtReg());
+ EXPECT_EQ(r1.signature(), rSig);
+ EXPECT_EQ(r1.type(), RegType::kVec128);
+ EXPECT_EQ(r1.group(), RegGroup::kVec);
+ EXPECT_EQ(r1.size(), 8u);
+ EXPECT_EQ(r1.id(), 5u);
+ EXPECT_TRUE(r1.isReg(RegType::kVec128, 5)); // RegType and Id.
+ EXPECT_EQ(r1._data[0], 0u);
+ EXPECT_EQ(r1._data[1], 0u);
// The same type of register having different id.
BaseReg r2(r1, 6);
- EXPECT(r2.isValid() == true);
- EXPECT(r2.isReg() == true);
- EXPECT(r2.isReg(RegType::kVec128) == true);
- EXPECT(r2.isPhysReg() == true);
- EXPECT(r2.isVirtReg() == false);
- EXPECT(r2.signature() == rSig);
- EXPECT(r2.type() == r1.type());
- EXPECT(r2.group() == r1.group());
- EXPECT(r2.size() == r1.size());
- EXPECT(r2.id() == 6);
- EXPECT(r2.isReg(RegType::kVec128, 6) == true);
+ EXPECT_TRUE(r2.isValid());
+ EXPECT_TRUE(r2.isReg());
+ EXPECT_TRUE(r2.isReg(RegType::kVec128));
+ EXPECT_TRUE(r2.isPhysReg());
+ EXPECT_FALSE(r2.isVirtReg());
+ EXPECT_EQ(r2.signature(), rSig);
+ EXPECT_EQ(r2.type(), r1.type());
+ EXPECT_EQ(r2.group(), r1.group());
+ EXPECT_EQ(r2.size(), r1.size());
+ EXPECT_EQ(r2.id(), 6u);
+ EXPECT_TRUE(r2.isReg(RegType::kVec128, 6));
r1.reset();
- EXPECT(!r1.isReg());
- EXPECT(!r1.isValid());
+ EXPECT_FALSE(r1.isReg());
+ EXPECT_FALSE(r1.isValid());
INFO("Checking basic functionality of BaseMem");
BaseMem m;
- EXPECT(m.isMem());
- EXPECT(m == BaseMem());
- EXPECT(m.hasBase() == false);
- EXPECT(m.hasIndex() == false);
- EXPECT(m.hasOffset() == false);
- EXPECT(m.isOffset64Bit() == true);
- EXPECT(m.offset() == 0);
+ EXPECT_TRUE(m.isMem());
+ EXPECT_EQ(m, BaseMem());
+ EXPECT_FALSE(m.hasBase());
+ EXPECT_FALSE(m.hasIndex());
+ EXPECT_FALSE(m.hasOffset());
+ EXPECT_TRUE(m.isOffset64Bit());
+ EXPECT_EQ(m.offset(), 0);
m.setOffset(-1);
- EXPECT(m.offsetLo32() == -1);
- EXPECT(m.offset() == -1);
+ EXPECT_EQ(m.offsetLo32(), -1);
+ EXPECT_EQ(m.offset(), -1);
int64_t x = int64_t(0xFF00FF0000000001u);
int32_t xHi = int32_t(0xFF00FF00u);
m.setOffset(x);
- EXPECT(m.offset() == x);
- EXPECT(m.offsetLo32() == 1);
- EXPECT(m.offsetHi32() == xHi);
+ EXPECT_EQ(m.offset(), x);
+ EXPECT_EQ(m.offsetLo32(), 1);
+ EXPECT_EQ(m.offsetHi32(), xHi);
INFO("Checking basic functionality of Imm");
Imm immValue(-42);
- EXPECT(immValue.type() == ImmType::kInt);
- EXPECT(Imm(-1).value() == -1);
- EXPECT(imm(-1).value() == -1);
- EXPECT(immValue.value() == -42);
- EXPECT(imm(0xFFFFFFFF).value() == int64_t(0xFFFFFFFF));
+ EXPECT_EQ(immValue.type(), ImmType::kInt);
+ EXPECT_EQ(Imm(-1).value(), -1);
+ EXPECT_EQ(imm(-1).value(), -1);
+ EXPECT_EQ(immValue.value(), -42);
+ EXPECT_EQ(imm(0xFFFFFFFF).value(), int64_t(0xFFFFFFFF));
Imm immDouble(0.4);
- EXPECT(immDouble.type() == ImmType::kDouble);
- EXPECT(immDouble.valueAs<double>() == 0.4);
- EXPECT(immDouble == imm(0.4));
+ EXPECT_EQ(immDouble.type(), ImmType::kDouble);
+ EXPECT_EQ(immDouble.valueAs<double>(), 0.4);
+ EXPECT_EQ(immDouble, imm(0.4));
- EXPECT(Imm(StrongEnumForImmTests::kValue0).value() == 0);
- EXPECT(Imm(StrongEnumForImmTests::kValue0xFFFFFFFF).value() == 0xFFFFFFFFu);
+ EXPECT_EQ(Imm(StrongEnumForImmTests::kValue0).value(), 0);
+ EXPECT_EQ(Imm(StrongEnumForImmTests::kValue0xFFFFFFFF).value(), 0xFFFFFFFFu);
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/core/operand.h b/3rdparty/asmjit/src/asmjit/core/operand.h
index 2f81a217f1b..3626779316d 100644
--- a/3rdparty/asmjit/src/asmjit/core/operand.h
+++ b/3rdparty/asmjit/src/asmjit/core/operand.h
@@ -23,13 +23,15 @@ enum class OperandType : uint32_t {
kReg = 1,
//! Operand is a memory.
kMem = 2,
+ //! Operand is a register-list.
+ kRegList = 3,
//! Operand is an immediate value.
- kImm = 3,
+ kImm = 4,
//! Operand is a label.
- kLabel = 4,
+ kLabel = 5,
//! Maximum value of `OperandType`.
- kMaxValue = kLabel
+ kMaxValue = kRegList
};
static_assert(uint32_t(OperandType::kMem) == uint32_t(OperandType::kReg) + 1,
@@ -47,7 +49,7 @@ enum class RegType : uint8_t {
//! No register - unused, invalid, multiple meanings.
kNone = 0,
- //! This is not a register type. This value is reserved for a \ref Label that used in \ref BaseMem as a base.
+ //! This is not a register type. This value is reserved for a \ref Label that's used in \ref BaseMem as a base.
//!
//! Label tag is used as a sub-type, forming a unique signature across all operand types as 0x1 is never associated
//! with any register type. This means that a memory operand's BASE register can be constructed from virtually any
@@ -55,7 +57,7 @@ enum class RegType : uint8_t {
kLabelTag = 1,
//! Universal type describing program counter (PC) or instruction pointer (IP) register, if the target architecture
- //! actually exposes it as a separate register type, which most modern targets do.
+ //! actually exposes it as a separate register type, which most modern architectures do.
kPC = 2,
//! 8-bit low general purpose register (X86).
@@ -64,21 +66,21 @@ enum class RegType : uint8_t {
kGp8Hi = 4,
//! 16-bit general purpose register (X86).
kGp16 = 5,
- //! 32-bit general purpose register (X86|ARM).
+ //! 32-bit general purpose register (X86|AArch32|AArch64).
kGp32 = 6,
- //! 64-bit general purpose register (X86|ARM).
+ //! 64-bit general purpose register (X86|AArch64).
kGp64 = 7,
- //! 8-bit view of a vector register (ARM).
+ //! 8-bit view of a vector register (AArch64).
kVec8 = 8,
- //! 16-bit view of a vector register (ARM).
+ //! 16-bit view of a vector register (AArch64).
kVec16 = 9,
- //! 32-bit view of a vector register (ARM).
+ //! 32-bit view of a vector register (AArch32|AArch64).
kVec32 = 10,
- //! 64-bit view of a vector register (ARM).
+ //! 64-bit view of a vector register (AArch32|AArch64).
//!
//! \note This is never used for MMX registers on X86, MMX registers have its own category.
kVec64 = 11,
- //! 128-bit view of a vector register (X86|ARM).
+ //! 128-bit view of a vector register (X86|AArch32|AArch64).
kVec128 = 12,
//! 256-bit view of a vector register (X86).
kVec256 = 13,
@@ -98,9 +100,6 @@ enum class RegType : uint8_t {
// X86 Specific Register Types
// ---------------------------
- // X86 Specific Register Types
- // ===========================
-
//! Instruction pointer (RIP), only addressable in \ref x86::Mem in 64-bit targets.
kX86_Rip = kPC,
//! Low GPB register (AL, BL, CL, DL, ...).
@@ -137,7 +136,7 @@ enum class RegType : uint8_t {
kX86_Tmm = kExtra + 6,
// ARM Specific Register Types
- // ===========================
+ // ---------------------------
//! Program pointer (PC) register (AArch64).
kARM_PC = kPC,
@@ -153,7 +152,9 @@ enum class RegType : uint8_t {
kARM_VecS = kVec32,
//! 64-bit view of VFP/ASIMD register (D).
kARM_VecD = kVec64,
- //! 128-bit view of VFP/ASIMD register (Q|V).
+ //! 128-bit view of VFP/ASIMD register (Q).
+ kARM_VecQ = kVec128,
+ //! 128-bit view of VFP/ASIMD register (V).
kARM_VecV = kVec128,
//! Maximum value of `RegType`.
@@ -172,8 +173,8 @@ enum class RegGroup : uint8_t {
//! Describes X86 XMM|YMM|ZMM registers ARM/AArch64 V registers.
kVec = 1,
- //! Extra virtual group #2 that can be used by Compiler for register allocation.
- kExtraVirt2 = 2,
+ //! Mask register group compatible with all backends that can use masking.
+ kMask = 2,
//! Extra virtual group #3 that can be used by Compiler for register allocation.
kExtraVirt3 = 3,
@@ -186,8 +187,8 @@ enum class RegGroup : uint8_t {
// X86 Specific Register Groups
// ----------------------------
- //! K register group (KReg) - maps to \ref RegGroup::kExtraVirt2 (X86, X86_64).
- kX86_K = kExtraVirt2,
+ //! K register group (KReg) - maps to \ref RegGroup::kMask (X86, X86_64).
+ kX86_K = kMask,
//! MMX register group (MM) - maps to \ref RegGroup::kExtraVirt3 (X86, X86_64).
kX86_MM = kExtraVirt3,
@@ -294,147 +295,150 @@ struct OperandSignature {
//!
//! \{
- inline constexpr bool operator!() const noexcept { return _bits != 0; }
- inline constexpr explicit operator bool() const noexcept { return _bits != 0; }
+ ASMJIT_INLINE_NODEBUG constexpr bool operator!() const noexcept { return _bits == 0; }
+ ASMJIT_INLINE_NODEBUG constexpr explicit operator bool() const noexcept { return _bits != 0; }
- inline OperandSignature& operator|=(uint32_t x) noexcept { _bits |= x; return *this; }
- inline OperandSignature& operator&=(uint32_t x) noexcept { _bits &= x; return *this; }
- inline OperandSignature& operator^=(uint32_t x) noexcept { _bits ^= x; return *this; }
+ ASMJIT_INLINE_NODEBUG OperandSignature& operator|=(uint32_t x) noexcept { _bits |= x; return *this; }
+ ASMJIT_INLINE_NODEBUG OperandSignature& operator&=(uint32_t x) noexcept { _bits &= x; return *this; }
+ ASMJIT_INLINE_NODEBUG OperandSignature& operator^=(uint32_t x) noexcept { _bits ^= x; return *this; }
- inline OperandSignature& operator|=(const OperandSignature& other) noexcept { return operator|=(other._bits); }
- inline OperandSignature& operator&=(const OperandSignature& other) noexcept { return operator&=(other._bits); }
- inline OperandSignature& operator^=(const OperandSignature& other) noexcept { return operator^=(other._bits); }
+ ASMJIT_INLINE_NODEBUG OperandSignature& operator|=(const OperandSignature& other) noexcept { return operator|=(other._bits); }
+ ASMJIT_INLINE_NODEBUG OperandSignature& operator&=(const OperandSignature& other) noexcept { return operator&=(other._bits); }
+ ASMJIT_INLINE_NODEBUG OperandSignature& operator^=(const OperandSignature& other) noexcept { return operator^=(other._bits); }
- inline constexpr OperandSignature operator~() const noexcept { return OperandSignature{~_bits}; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature operator~() const noexcept { return OperandSignature{~_bits}; }
- inline constexpr OperandSignature operator|(uint32_t x) const noexcept { return OperandSignature{_bits | x}; }
- inline constexpr OperandSignature operator&(uint32_t x) const noexcept { return OperandSignature{_bits & x}; }
- inline constexpr OperandSignature operator^(uint32_t x) const noexcept { return OperandSignature{_bits ^ x}; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature operator|(uint32_t x) const noexcept { return OperandSignature{_bits | x}; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature operator&(uint32_t x) const noexcept { return OperandSignature{_bits & x}; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature operator^(uint32_t x) const noexcept { return OperandSignature{_bits ^ x}; }
- inline constexpr OperandSignature operator|(const OperandSignature& other) const noexcept { return OperandSignature{_bits | other._bits}; }
- inline constexpr OperandSignature operator&(const OperandSignature& other) const noexcept { return OperandSignature{_bits & other._bits}; }
- inline constexpr OperandSignature operator^(const OperandSignature& other) const noexcept { return OperandSignature{_bits ^ other._bits}; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature operator|(const OperandSignature& other) const noexcept { return OperandSignature{_bits | other._bits}; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature operator&(const OperandSignature& other) const noexcept { return OperandSignature{_bits & other._bits}; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature operator^(const OperandSignature& other) const noexcept { return OperandSignature{_bits ^ other._bits}; }
- inline constexpr bool operator==(uint32_t x) const noexcept { return _bits == x; }
- inline constexpr bool operator!=(uint32_t x) const noexcept { return _bits != x; }
+ ASMJIT_INLINE_NODEBUG constexpr bool operator==(uint32_t x) const noexcept { return _bits == x; }
+ ASMJIT_INLINE_NODEBUG constexpr bool operator!=(uint32_t x) const noexcept { return _bits != x; }
- inline constexpr bool operator==(const OperandSignature& other) const noexcept { return _bits == other._bits; }
- inline constexpr bool operator!=(const OperandSignature& other) const noexcept { return _bits != other._bits; }
+ ASMJIT_INLINE_NODEBUG constexpr bool operator==(const OperandSignature& other) const noexcept { return _bits == other._bits; }
+ ASMJIT_INLINE_NODEBUG constexpr bool operator!=(const OperandSignature& other) const noexcept { return _bits != other._bits; }
//! \}
//! \name Accessors
//! \{
- inline void reset() noexcept { _bits = 0; }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _bits = 0; }
- inline constexpr uint32_t bits() const noexcept { return _bits; }
- inline void setBits(uint32_t bits) noexcept { _bits = bits; }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t bits() const noexcept { return _bits; }
+ ASMJIT_INLINE_NODEBUG void setBits(uint32_t bits) noexcept { _bits = bits; }
- template<uint32_t kFieldMask, uint32_t kFieldShift = Support::ConstCTZ<kFieldMask>::value>
- inline constexpr bool hasField() const noexcept {
+ template<uint32_t kFieldMask>
+ ASMJIT_INLINE_NODEBUG constexpr bool hasField() const noexcept {
return (_bits & kFieldMask) != 0;
}
- template<uint32_t kFieldMask, uint32_t kFieldShift = Support::ConstCTZ<kFieldMask>::value>
- inline constexpr bool hasField(uint32_t value) const noexcept {
- return (_bits & kFieldMask) != value << kFieldShift;
+ template<uint32_t kFieldMask>
+ ASMJIT_INLINE_NODEBUG constexpr bool hasField(uint32_t value) const noexcept {
+ return (_bits & kFieldMask) != value << Support::ConstCTZ<kFieldMask>::value;
}
- template<uint32_t kFieldMask, uint32_t kFieldShift = Support::ConstCTZ<kFieldMask>::value>
- inline constexpr uint32_t getField() const noexcept {
- return (_bits >> kFieldShift) & (kFieldMask >> kFieldShift);
+ template<uint32_t kFieldMask>
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t getField() const noexcept {
+ return (_bits >> Support::ConstCTZ<kFieldMask>::value) & (kFieldMask >> Support::ConstCTZ<kFieldMask>::value);
}
- template<uint32_t kFieldMask, uint32_t kFieldShift = Support::ConstCTZ<kFieldMask>::value>
- inline void setField(uint32_t value) noexcept {
- ASMJIT_ASSERT((value & ~(kFieldMask >> kFieldShift)) == 0);
- _bits = (_bits & ~kFieldMask) | (value << kFieldShift);
+ template<uint32_t kFieldMask>
+ ASMJIT_INLINE_NODEBUG void setField(uint32_t value) noexcept {
+ ASMJIT_ASSERT(((value << Support::ConstCTZ<kFieldMask>::value) & ~kFieldMask) == 0);
+ _bits = (_bits & ~kFieldMask) | (value << Support::ConstCTZ<kFieldMask>::value);
}
- inline constexpr OperandSignature subset(uint32_t mask) const noexcept { return OperandSignature{_bits & mask}; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature subset(uint32_t mask) const noexcept { return OperandSignature{_bits & mask}; }
+
+ template<uint32_t kFieldMask, uint32_t kFieldShift = Support::ConstCTZ<kFieldMask>::value>
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature replacedValue(uint32_t value) const noexcept { return OperandSignature{(_bits & ~kFieldMask) | (value << kFieldShift)}; }
template<uint32_t kFieldMask>
- inline constexpr bool matchesSignature(const OperandSignature& signature) const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool matchesSignature(const OperandSignature& signature) const noexcept {
return (_bits & kFieldMask) == signature._bits;
}
template<uint32_t kFieldMask>
- inline constexpr bool matchesFields(uint32_t bits) const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool matchesFields(uint32_t bits) const noexcept {
return (_bits & kFieldMask) == bits;
}
template<uint32_t kFieldMask>
- inline constexpr bool matchesFields(const OperandSignature& fields) const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool matchesFields(const OperandSignature& fields) const noexcept {
return (_bits & kFieldMask) == fields._bits;
}
- inline constexpr bool isValid() const noexcept { return _bits != 0; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isValid() const noexcept { return _bits != 0; }
- inline constexpr OperandType opType() const noexcept { return (OperandType)getField<kOpTypeMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr OperandType opType() const noexcept { return (OperandType)getField<kOpTypeMask>(); }
- inline constexpr RegType regType() const noexcept { return (RegType)getField<kRegTypeMask>(); }
- inline constexpr RegGroup regGroup() const noexcept { return (RegGroup)getField<kRegGroupMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegType regType() const noexcept { return (RegType)getField<kRegTypeMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegGroup regGroup() const noexcept { return (RegGroup)getField<kRegGroupMask>(); }
- inline constexpr RegType memBaseType() const noexcept { return (RegType)getField<kMemBaseTypeMask>(); }
- inline constexpr RegType memIndexType() const noexcept { return (RegType)getField<kMemIndexTypeMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegType memBaseType() const noexcept { return (RegType)getField<kMemBaseTypeMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegType memIndexType() const noexcept { return (RegType)getField<kMemIndexTypeMask>(); }
- inline constexpr uint32_t predicate() const noexcept { return getField<kPredicateMask>(); }
- inline constexpr uint32_t size() const noexcept { return getField<kSizeMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t predicate() const noexcept { return getField<kPredicateMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t size() const noexcept { return getField<kSizeMask>(); }
- inline void setOpType(OperandType opType) noexcept { setField<kOpTypeMask>(uint32_t(opType)); }
- inline void setRegType(RegType regType) noexcept { setField<kRegTypeMask>(uint32_t(regType)); }
- inline void setRegGroup(RegGroup regGroup) noexcept { setField<kRegGroupMask>(uint32_t(regGroup)); }
+ ASMJIT_INLINE_NODEBUG void setOpType(OperandType opType) noexcept { setField<kOpTypeMask>(uint32_t(opType)); }
+ ASMJIT_INLINE_NODEBUG void setRegType(RegType regType) noexcept { setField<kRegTypeMask>(uint32_t(regType)); }
+ ASMJIT_INLINE_NODEBUG void setRegGroup(RegGroup regGroup) noexcept { setField<kRegGroupMask>(uint32_t(regGroup)); }
- inline void setMemBaseType(RegGroup baseType) noexcept { setField<kMemBaseTypeMask>(uint32_t(baseType)); }
- inline void setMemIndexType(RegGroup indexType) noexcept { setField<kMemIndexTypeMask>(uint32_t(indexType)); }
+ ASMJIT_INLINE_NODEBUG void setMemBaseType(RegType baseType) noexcept { setField<kMemBaseTypeMask>(uint32_t(baseType)); }
+ ASMJIT_INLINE_NODEBUG void setMemIndexType(RegType indexType) noexcept { setField<kMemIndexTypeMask>(uint32_t(indexType)); }
- inline void setPredicate(uint32_t predicate) noexcept { setField<kPredicateMask>(predicate); }
- inline void setSize(uint32_t size) noexcept { setField<kSizeMask>(size); }
+ ASMJIT_INLINE_NODEBUG void setPredicate(uint32_t predicate) noexcept { setField<kPredicateMask>(predicate); }
+ ASMJIT_INLINE_NODEBUG void setSize(uint32_t size) noexcept { setField<kSizeMask>(size); }
//! \}
//! \name Static Constructors
//! \{
- static inline constexpr OperandSignature fromBits(uint32_t bits) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromBits(uint32_t bits) noexcept {
return OperandSignature{bits};
}
template<uint32_t kFieldMask, typename T>
- static inline constexpr OperandSignature fromValue(const T& value) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromValue(const T& value) noexcept {
return OperandSignature{uint32_t(value) << Support::ConstCTZ<kFieldMask>::value};
}
- static inline constexpr OperandSignature fromOpType(OperandType opType) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromOpType(OperandType opType) noexcept {
return OperandSignature{uint32_t(opType) << kOpTypeShift};
}
- static inline constexpr OperandSignature fromRegType(RegType regType) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromRegType(RegType regType) noexcept {
return OperandSignature{uint32_t(regType) << kRegTypeShift};
}
- static inline constexpr OperandSignature fromRegGroup(RegGroup regGroup) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromRegGroup(RegGroup regGroup) noexcept {
return OperandSignature{uint32_t(regGroup) << kRegGroupShift};
}
- static inline constexpr OperandSignature fromRegTypeAndGroup(RegType regType, RegGroup regGroup) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromRegTypeAndGroup(RegType regType, RegGroup regGroup) noexcept {
return fromRegType(regType) | fromRegGroup(regGroup);
}
- static inline constexpr OperandSignature fromMemBaseType(RegType baseType) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromMemBaseType(RegType baseType) noexcept {
return OperandSignature{uint32_t(baseType) << kMemBaseTypeShift};
}
- static inline constexpr OperandSignature fromMemIndexType(RegType indexType) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromMemIndexType(RegType indexType) noexcept {
return OperandSignature{uint32_t(indexType) << kMemIndexTypeShift};
}
- static inline constexpr OperandSignature fromPredicate(uint32_t predicate) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromPredicate(uint32_t predicate) noexcept {
return OperandSignature{predicate << kPredicateShift};
}
- static inline constexpr OperandSignature fromSize(uint32_t size) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr OperandSignature fromSize(uint32_t size) noexcept {
return OperandSignature{size << kSizeShift};
}
@@ -506,18 +510,18 @@ struct Operand_ {
//! Tests whether the given `id` is a valid virtual register id. Since AsmJit supports both physical and virtual
//! registers it must be able to distinguish between these two. The idea is that physical registers are always
//! limited in size, so virtual identifiers start from `kVirtIdMin` and end at `kVirtIdMax`.
- static inline bool isVirtId(uint32_t id) noexcept { return id - kVirtIdMin < uint32_t(kVirtIdCount); }
+ static ASMJIT_INLINE_NODEBUG bool isVirtId(uint32_t id) noexcept { return id - kVirtIdMin < uint32_t(kVirtIdCount); }
//! Converts a real-id into a packed-id that can be stored in Operand.
- static inline uint32_t indexToVirtId(uint32_t id) noexcept { return id + kVirtIdMin; }
+ static ASMJIT_INLINE_NODEBUG uint32_t indexToVirtId(uint32_t id) noexcept { return id + kVirtIdMin; }
//! Converts a packed-id back to real-id.
- static inline uint32_t virtIdToIndex(uint32_t id) noexcept { return id - kVirtIdMin; }
+ static ASMJIT_INLINE_NODEBUG uint32_t virtIdToIndex(uint32_t id) noexcept { return id - kVirtIdMin; }
//! \name Construction & Destruction
//! \{
//! \cond INTERNAL
//! Initializes a `BaseReg` operand from `signature` and register `id`.
- inline void _initReg(const Signature& signature, uint32_t id) noexcept {
+ ASMJIT_INLINE_NODEBUG void _initReg(const Signature& signature, uint32_t id) noexcept {
_signature = signature;
_baseId = id;
_data[0] = 0;
@@ -526,7 +530,12 @@ struct Operand_ {
//! \endcond
//! Initializes the operand from `other` operand (used by operator overloads).
- inline void copyFrom(const Operand_& other) noexcept { memcpy(this, &other, sizeof(Operand_)); }
+ ASMJIT_INLINE_NODEBUG void copyFrom(const Operand_& other) noexcept {
+ _signature._bits = other._signature._bits;
+ _baseId = other._baseId;
+ _data[0] = other._data[0];
+ _data[1] = other._data[1];
+ }
//! Resets the `Operand` to none.
//!
@@ -555,7 +564,7 @@ struct Operand_ {
//! memset(&b, 0, sizeof(Operand));
//! assert(a == b);
//! ```
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_signature.reset();
_baseId = 0;
_data[0] = 0;
@@ -568,9 +577,9 @@ struct Operand_ {
//! \{
//! Tests whether this operand is the same as `other`.
- inline constexpr bool operator==(const Operand_& other) const noexcept { return equals(other); }
+ ASMJIT_INLINE_NODEBUG constexpr bool operator==(const Operand_& other) const noexcept { return equals(other); }
//! Tests whether this operand is not the same as `other`.
- inline constexpr bool operator!=(const Operand_& other) const noexcept { return !equals(other); }
+ ASMJIT_INLINE_NODEBUG constexpr bool operator!=(const Operand_& other) const noexcept { return !equals(other); }
//! \}
@@ -579,11 +588,27 @@ struct Operand_ {
//! Casts this operand to `T` type.
template<typename T>
- inline T& as() noexcept { return static_cast<T&>(*this); }
+ ASMJIT_INLINE_NODEBUG T& as() noexcept { return static_cast<T&>(*this); }
//! Casts this operand to `T` type (const).
template<typename T>
- inline const T& as() const noexcept { return static_cast<const T&>(*this); }
+ ASMJIT_INLINE_NODEBUG const T& as() const noexcept { return static_cast<const T&>(*this); }
+
+ //! \}
+
+ //! \name Equality
+ //! \{
+
+ //! Tests whether the operand is 100% equal to `other` operand.
+ //!
+ //! \note This basically performs a binary comparison, if aby bit is
+ //! different the operands are not equal.
+ ASMJIT_INLINE_NODEBUG constexpr bool equals(const Operand_& other) const noexcept {
+ return bool(unsigned(_signature == other._signature) &
+ unsigned(_baseId == other._baseId ) &
+ unsigned(_data[0] == other._data[0] ) &
+ unsigned(_data[1] == other._data[1] ));
+ }
//! \}
@@ -591,55 +616,44 @@ struct Operand_ {
//! \{
//! Tests whether the operand's signature matches the signature of the `other` operand.
- inline constexpr bool hasSignature(const Operand_& other) const noexcept { return _signature == other._signature; }
+ ASMJIT_INLINE_NODEBUG constexpr bool hasSignature(const Operand_& other) const noexcept { return _signature == other._signature; }
//! Tests whether the operand's signature matches the given signature `sign`.
- inline constexpr bool hasSignature(const Signature& other) const noexcept { return _signature == other; }
+ ASMJIT_INLINE_NODEBUG constexpr bool hasSignature(const Signature& other) const noexcept { return _signature == other; }
//! Returns operand signature as unsigned 32-bit integer.
//!
//! Signature is first 4 bytes of the operand data. It's used mostly for operand checking as it's
//! much faster to check packed 4 bytes at once than having to check these bytes individually.
- inline constexpr Signature signature() const noexcept { return _signature; }
+ ASMJIT_INLINE_NODEBUG constexpr Signature signature() const noexcept { return _signature; }
//! Sets the operand signature, see `signature()`.
//!
//! \note Improper use of `setSignature()` can lead to hard-to-debug errors.
- inline void setSignature(const Signature& signature) noexcept { _signature = signature; }
+ ASMJIT_INLINE_NODEBUG void setSignature(const Signature& signature) noexcept { _signature = signature; }
+ //! \overload
+ ASMJIT_INLINE_NODEBUG void setSignature(uint32_t signature) noexcept { _signature._bits = signature; }
//! Returns the type of the operand, see `OpType`.
- inline constexpr OperandType opType() const noexcept { return _signature.opType(); }
+ ASMJIT_INLINE_NODEBUG constexpr OperandType opType() const noexcept { return _signature.opType(); }
//! Tests whether the operand is none (`OperandType::kNone`).
- inline constexpr bool isNone() const noexcept { return _signature == Signature::fromBits(0); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isNone() const noexcept { return _signature == Signature::fromBits(0); }
//! Tests whether the operand is a register (`OperandType::kReg`).
- inline constexpr bool isReg() const noexcept { return opType() == OperandType::kReg; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isReg() const noexcept { return opType() == OperandType::kReg; }
+ //! Tests whether the operand is a register-list.
+ //!
+ //! \note Register-list is currently only used by 32-bit ARM architecture.
+ ASMJIT_INLINE_NODEBUG constexpr bool isRegList() const noexcept { return opType() == OperandType::kRegList; }
//! Tests whether the operand is a memory location (`OperandType::kMem`).
- inline constexpr bool isMem() const noexcept { return opType() == OperandType::kMem; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isMem() const noexcept { return opType() == OperandType::kMem; }
//! Tests whether the operand is an immediate (`OperandType::kImm`).
- inline constexpr bool isImm() const noexcept { return opType() == OperandType::kImm; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isImm() const noexcept { return opType() == OperandType::kImm; }
//! Tests whether the operand is a label (`OperandType::kLabel`).
- inline constexpr bool isLabel() const noexcept { return opType() == OperandType::kLabel; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isLabel() const noexcept { return opType() == OperandType::kLabel; }
//! Tests whether the operand is a physical register.
- inline constexpr bool isPhysReg() const noexcept { return isReg() && _baseId < 0xFFu; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isPhysReg() const noexcept { return isReg() && _baseId < 0xFFu; }
//! Tests whether the operand is a virtual register.
- inline constexpr bool isVirtReg() const noexcept { return isReg() && _baseId > 0xFFu; }
-
- //! Tests whether the operand specifies a size (i.e. the size is not zero).
- inline constexpr bool hasSize() const noexcept { return _signature.hasField<Signature::kSizeMask>(); }
- //! Tests whether the size of the operand matches `size`.
- inline constexpr bool hasSize(uint32_t s) const noexcept { return size() == s; }
-
- //! Returns the size of the operand in bytes.
- //!
- //! The value returned depends on the operand type:
- //! * None - Should always return zero size.
- //! * Reg - Should always return the size of the register. If the register size depends on architecture
- //! (like `x86::CReg` and `x86::DReg`) the size returned should be the greatest possible (so it
- //! should return 64-bit size in such case).
- //! * Mem - Size is optional and will be in most cases zero.
- //! * Imm - Should always return zero size.
- //! * Label - Should always return zero size.
- inline constexpr uint32_t size() const noexcept { return _signature.getField<Signature::kSizeMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isVirtReg() const noexcept { return isReg() && _baseId > 0xFFu; }
//! Returns the operand id.
//!
@@ -650,35 +664,98 @@ struct Operand_ {
//! * Imm - Should be `0`.
//! * Label - Label id if it was created by using `newLabel()` or `Globals::kInvalidId` if the label is invalid or
//! not initialized.
- inline constexpr uint32_t id() const noexcept { return _baseId; }
-
- //! Tests whether the operand is 100% equal to `other` operand.
- //!
- //! \note This basically performs a binary comparison, if aby bit is
- //! different the operands are not equal.
- inline constexpr bool equals(const Operand_& other) const noexcept {
- return (_signature == other._signature) &
- (_baseId == other._baseId ) &
- (_data[0] == other._data[0] ) &
- (_data[1] == other._data[1] ) ;
- }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t id() const noexcept { return _baseId; }
//! Tests whether the operand is a register matching the given register `type`.
- inline constexpr bool isReg(RegType type) const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool isReg(RegType type) const noexcept {
return _signature.subset(Signature::kOpTypeMask | Signature::kRegTypeMask) == (Signature::fromOpType(OperandType::kReg) | Signature::fromRegType(type));
}
- //! Tests whether the operand is register and of register `type` and `id`.
- inline constexpr bool isReg(RegType type, uint32_t id) const noexcept {
- return isReg(type) && this->id() == id;
+ //! Tests whether the operand is a register of the provided register group `regGroup`.
+ ASMJIT_INLINE_NODEBUG constexpr bool isReg(RegGroup regGroup) const noexcept {
+ return _signature.subset(Signature::kOpTypeMask | Signature::kRegGroupMask) == (Signature::fromOpType(OperandType::kReg) | Signature::fromRegGroup(regGroup));
+ }
+
+ //! Tests whether the operand is register and of register type `regType` and `regId`.
+ ASMJIT_INLINE_NODEBUG constexpr bool isReg(RegType regType, uint32_t regId) const noexcept { return isReg(regType) && _baseId == regId; }
+ //! Tests whether the operand is register and of register group `regGroup` and `regId`.
+ ASMJIT_INLINE_NODEBUG constexpr bool isReg(RegGroup regGroup, uint32_t regId) const noexcept { return isReg(regGroup) && _baseId == regId; }
+
+ //! Tests whether the register is a general purpose register (any size).
+ ASMJIT_INLINE_NODEBUG constexpr bool isGp() const noexcept { return isReg(RegGroup::kGp); }
+ //! Tests whether the register is a 32-bit general purpose register.
+ ASMJIT_INLINE_NODEBUG constexpr bool isGp32() const noexcept { return isReg(RegType::kGp32); }
+ //! Tests whether the register is a 64-bit general purpose register.
+ ASMJIT_INLINE_NODEBUG constexpr bool isGp64() const noexcept { return isReg(RegType::kGp64); }
+
+ //! Tests whether the register is a vector register of any size.
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec() const noexcept { return isReg(RegGroup::kVec); }
+ //! Tests whether the register is an 8-bit vector register or view (AArch64).
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec8() const noexcept { return isReg(RegType::kVec8); }
+ //! Tests whether the register is a 16-bit vector register or view (AArch64).
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec16() const noexcept { return isReg(RegType::kVec16); }
+ //! Tests whether the register is a 32-bit vector register or view (AArch32, AArch64).
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec32() const noexcept { return isReg(RegType::kVec32); }
+ //! Tests whether the register is a 64-bit vector register or view (AArch32, AArch64).
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec64() const noexcept { return isReg(RegType::kVec64); }
+ //! Tests whether the register is a 128-bit vector register or view (AArch32, AArch64, X86, X86_64).
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec128() const noexcept { return isReg(RegType::kVec128); }
+ //! Tests whether the register is a 256-bit vector register or view (X86, X86_64).
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec256() const noexcept { return isReg(RegType::kVec256); }
+ //! Tests whether the register is a 512-bit vector register or view (X86, X86_64).
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec512() const noexcept { return isReg(RegType::kVec512); }
+
+ //! Tests whether the register is a mask register of any size.
+ ASMJIT_INLINE_NODEBUG constexpr bool isMask() const noexcept { return isReg(RegGroup::kMask); }
+
+ //! Tests whether the operand is a register matching the given register `type`.
+ ASMJIT_INLINE_NODEBUG constexpr bool isRegList(RegType type) const noexcept {
+ return _signature.subset(Signature::kOpTypeMask | Signature::kRegTypeMask) == (Signature::fromOpType(OperandType::kRegList) | Signature::fromRegType(type));
}
//! Tests whether the operand is a register or memory.
- inline constexpr bool isRegOrMem() const noexcept {
+ //!
+ //! \note This is useful on X86 and X86_64 architectures as many instructions support Reg/Mem operand combination.
+ //! So if the user code works with just \ref Operand, it's possible to check whether the operand is either a register
+ //! or memory location with a single check.
+ ASMJIT_INLINE_NODEBUG constexpr bool isRegOrMem() const noexcept {
return Support::isBetween<uint32_t>(uint32_t(opType()), uint32_t(OperandType::kReg), uint32_t(OperandType::kMem));
}
+ //! Tests whether the operand is a register, register-list, or memory.
+ //!
+ //! \note This is useful on 32-bit ARM architecture to check whether an operand references a register. It can be
+ //! used in other architectures too, but it would work identically to \ref isRegOrMem() as other architectures
+ //! don't provide register lists.
+ ASMJIT_INLINE_NODEBUG constexpr bool isRegOrRegListOrMem() const noexcept {
+ return Support::isBetween<uint32_t>(uint32_t(opType()), uint32_t(OperandType::kReg), uint32_t(OperandType::kRegList));
+ }
+
//! \}
+
+ //! \name Accessors (X86 Specific)
+ //! \{
+
+ //! Returns a size of a register or an X86 memory operand.
+ //!
+ //! \remarks At the moment only X86 and X86_64 memory operands have a size - other memory operands can use bits
+ //! that represent size as an additional payload. This means that memory size is architecture specific and should
+ //! be accessed via \ref x86::Mem::size(). Sometimes when the user knows that the operand is either a register or
+ //! memory operand this function can be helpful as it avoids casting, but it only works when it targets X86 and X86_64.
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t x86RmSize() const noexcept { return _signature.size(); }
+
+ //! \}
+
+#if !defined(ASMJIT_NO_DEPRECATED)
+ ASMJIT_DEPRECATED("hasSize() is no longer portable - use x86RmSize() or x86::Mem::hasSize() instead, if your target is X86/X86_64")
+ ASMJIT_INLINE_NODEBUG constexpr bool hasSize() const noexcept { return x86RmSize() != 0u; }
+
+ ASMJIT_DEPRECATED("hasSize() is no longer portable - use x86RmSize() or x86::Mem::hasSize() instead, if your target is X86/X86_64")
+ ASMJIT_INLINE_NODEBUG constexpr bool hasSize(uint32_t s) const noexcept { return x86RmSize() == s; }
+
+ ASMJIT_DEPRECATED("size() is no longer portable - use x86RmSize() or x86::Mem::size() instead, if your target is X86/X86_64")
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t size() const noexcept { return _signature.getField<Signature::kSizeMask>(); }
+#endif
};
//! Base class representing an operand in AsmJit (default constructed version).
@@ -688,30 +765,30 @@ public:
//! \{
//! Creates `kOpNone` operand having all members initialized to zero.
- inline constexpr Operand() noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Operand() noexcept
: Operand_{ Signature::fromOpType(OperandType::kNone), 0u, { 0u, 0u }} {}
//! Creates a cloned `other` operand.
- inline constexpr Operand(const Operand& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG constexpr Operand(const Operand& other) noexcept = default;
//! Creates a cloned `other` operand.
- inline constexpr explicit Operand(const Operand_& other)
+ ASMJIT_INLINE_NODEBUG constexpr explicit Operand(const Operand_& other)
: Operand_(other) {}
//! Creates an operand initialized to raw `[u0, u1, u2, u3]` values.
- inline constexpr Operand(Globals::Init_, const Signature& u0, uint32_t u1, uint32_t u2, uint32_t u3) noexcept
- : Operand_{ u0, u1, { u2, u3 }} {}
+ ASMJIT_INLINE_NODEBUG constexpr Operand(Globals::Init_, const Signature& u0, uint32_t u1, uint32_t u2, uint32_t u3) noexcept
+ : Operand_{{u0._bits}, u1, {u2, u3}} {}
//! Creates an uninitialized operand (dangerous).
- inline explicit Operand(Globals::NoInit_) noexcept {}
+ ASMJIT_INLINE_NODEBUG explicit Operand(Globals::NoInit_) noexcept {}
//! \}
//! \name Overloaded Operators
//! \{
- inline Operand& operator=(const Operand& other) noexcept = default;
- inline Operand& operator=(const Operand_& other) noexcept { return operator=(static_cast<const Operand&>(other)); }
+ ASMJIT_INLINE_NODEBUG Operand& operator=(const Operand& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG Operand& operator=(const Operand_& other) noexcept { return operator=(static_cast<const Operand&>(other)); }
//! \}
@@ -719,7 +796,7 @@ public:
//! \{
//! Clones this operand and returns its copy.
- inline constexpr Operand clone() const noexcept { return Operand(*this); }
+ ASMJIT_INLINE_NODEBUG constexpr Operand clone() const noexcept { return Operand(*this); }
//! \}
};
@@ -756,22 +833,22 @@ public:
//! \{
//! Creates a label operand without ID (you must set the ID to make it valid).
- inline constexpr Label() noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Label() noexcept
: Operand(Globals::Init, Signature::fromOpType(OperandType::kLabel), Globals::kInvalidId, 0, 0) {}
//! Creates a cloned label operand of `other`.
- inline constexpr Label(const Label& other) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Label(const Label& other) noexcept
: Operand(other) {}
//! Creates a label operand of the given `id`.
- inline constexpr explicit Label(uint32_t id) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr explicit Label(uint32_t id) noexcept
: Operand(Globals::Init, Signature::fromOpType(OperandType::kLabel), id, 0, 0) {}
- inline explicit Label(Globals::NoInit_) noexcept
+ ASMJIT_INLINE_NODEBUG explicit Label(Globals::NoInit_) noexcept
: Operand(Globals::NoInit) {}
//! Resets the label, will reset all properties and set its ID to `Globals::kInvalidId`.
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_signature = Signature::fromOpType(OperandType::kLabel);
_baseId = Globals::kInvalidId;
_data[0] = 0;
@@ -783,7 +860,7 @@ public:
//! \name Overloaded Operators
//! \{
- inline Label& operator=(const Label& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG Label& operator=(const Label& other) noexcept = default;
//! \}
@@ -791,9 +868,9 @@ public:
//! \{
//! Tests whether the label was created by CodeHolder and/or an attached emitter.
- inline constexpr bool isValid() const noexcept { return _baseId != Globals::kInvalidId; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isValid() const noexcept { return _baseId != Globals::kInvalidId; }
//! Sets the label `id`.
- inline void setId(uint32_t id) noexcept { _baseId = id; }
+ ASMJIT_INLINE_NODEBUG void setId(uint32_t id) noexcept { _baseId = id; }
//! \}
};
@@ -806,10 +883,8 @@ struct BaseRegTraits {
kTypeId = uint32_t(TypeId::kVoid),
//! RegType is not valid by default.
kValid = 0,
- //! Count of registers (0 if none).
- kCount = 0,
- //! Zero type by default (defeaults to None).
+ //! Zero type by default (defaults to None).
kType = uint32_t(RegType::kNone),
//! Zero group by default (defaults to GP).
kGroup = uint32_t(RegGroup::kGp),
@@ -822,7 +897,7 @@ struct BaseRegTraits {
};
//! \endcond
-//! Physical or virtual register operand.
+//! Physical or virtual register operand (base).
class BaseReg : public Operand {
public:
//! \name Constants
@@ -848,22 +923,22 @@ public:
//! \{
//! Creates a dummy register operand.
- inline constexpr BaseReg() noexcept
+ ASMJIT_INLINE_NODEBUG constexpr BaseReg() noexcept
: Operand(Globals::Init, Signature::fromOpType(OperandType::kReg), kIdBad, 0, 0) {}
//! Creates a new register operand which is the same as `other` .
- inline constexpr BaseReg(const BaseReg& other) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr BaseReg(const BaseReg& other) noexcept
: Operand(other) {}
//! Creates a new register operand compatible with `other`, but with a different `id`.
- inline constexpr BaseReg(const BaseReg& other, uint32_t id) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr BaseReg(const BaseReg& other, uint32_t id) noexcept
: Operand(Globals::Init, other._signature, id, 0, 0) {}
//! Creates a register initialized to the given `signature` and `id`.
- inline constexpr BaseReg(const Signature& signature, uint32_t id) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr BaseReg(const Signature& signature, uint32_t id) noexcept
: Operand(Globals::Init, signature, id, 0, 0) {}
- inline explicit BaseReg(Globals::NoInit_) noexcept
+ ASMJIT_INLINE_NODEBUG explicit BaseReg(Globals::NoInit_) noexcept
: Operand(Globals::NoInit) {}
//! \}
@@ -871,7 +946,7 @@ public:
//! \name Overloaded Operators
//! \{
- inline BaseReg& operator=(const BaseReg& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG BaseReg& operator=(const BaseReg& other) noexcept = default;
//! \}
@@ -883,14 +958,14 @@ public:
//! Base signature only contains the operand type, register type, register group, and register size. It doesn't
//! contain element type, predicate, or other architecture-specific data. Base signature is a signature that is
//! provided by architecture-specific `RegTraits`, like \ref x86::RegTraits.
- inline constexpr OperandSignature baseSignature() const noexcept { return _signature & kBaseSignatureMask; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature baseSignature() const noexcept { return _signature & kBaseSignatureMask; }
//! Tests whether the operand's base signature matches the given signature `sign`.
- inline constexpr bool hasBaseSignature(uint32_t signature) const noexcept { return baseSignature() == signature; }
+ ASMJIT_INLINE_NODEBUG constexpr bool hasBaseSignature(uint32_t signature) const noexcept { return baseSignature() == signature; }
//! Tests whether the operand's base signature matches the given signature `sign`.
- inline constexpr bool hasBaseSignature(const OperandSignature& signature) const noexcept { return baseSignature() == signature; }
+ ASMJIT_INLINE_NODEBUG constexpr bool hasBaseSignature(const OperandSignature& signature) const noexcept { return baseSignature() == signature; }
//! Tests whether the operand's base signature matches the base signature of the `other` operand.
- inline constexpr bool hasBaseSignature(const BaseReg& other) const noexcept { return baseSignature() == other.baseSignature(); }
+ ASMJIT_INLINE_NODEBUG constexpr bool hasBaseSignature(const BaseReg& other) const noexcept { return baseSignature() == other.baseSignature(); }
//! Tests whether this register is the same as `other`.
//!
@@ -899,79 +974,90 @@ public:
//! both \ref equals() and \ref isSame() should give the same answer, however, if any of these two contains garbage
//! or other metadata in the upper 8 bytes then \ref isSame() may return `true` in cases in which \ref equals()
//! returns false.
- inline constexpr bool isSame(const BaseReg& other) const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool isSame(const BaseReg& other) const noexcept {
return (_signature == other._signature) & (_baseId == other._baseId);
}
//! Tests whether the register is valid (either virtual or physical).
- inline constexpr bool isValid() const noexcept { return (_signature != 0) & (_baseId != kIdBad); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isValid() const noexcept { return bool(unsigned(_signature != 0) & unsigned(_baseId != kIdBad)); }
//! Tests whether this is a physical register.
- inline constexpr bool isPhysReg() const noexcept { return _baseId < kIdBad; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isPhysReg() const noexcept { return _baseId < kIdBad; }
//! Tests whether this is a virtual register.
- inline constexpr bool isVirtReg() const noexcept { return _baseId > kIdBad; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isVirtReg() const noexcept { return _baseId > kIdBad; }
//! Tests whether the register type matches `type` - same as `isReg(type)`, provided for convenience.
- inline constexpr bool isType(RegType type) const noexcept { return _signature.subset(Signature::kRegTypeMask) == Signature::fromRegType(type); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isType(RegType type) const noexcept { return _signature.subset(Signature::kRegTypeMask) == Signature::fromRegType(type); }
//! Tests whether the register group matches `group`.
- inline constexpr bool isGroup(RegGroup group) const noexcept { return _signature.subset(Signature::kRegGroupMask) == Signature::fromRegGroup(group); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isGroup(RegGroup group) const noexcept { return _signature.subset(Signature::kRegGroupMask) == Signature::fromRegGroup(group); }
//! Tests whether the register is a general purpose register (any size).
- inline constexpr bool isGp() const noexcept { return isGroup(RegGroup::kGp); }
- //! Tests whether the register is a vector register.
- inline constexpr bool isVec() const noexcept { return isGroup(RegGroup::kVec); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isGp() const noexcept { return isGroup(RegGroup::kGp); }
+ //! Tests whether the register is a vector register of any size.
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec() const noexcept { return isGroup(RegGroup::kVec); }
+ //! Tests whether the register is a mask register of any size.
+ ASMJIT_INLINE_NODEBUG constexpr bool isMask() const noexcept { return isGroup(RegGroup::kMask); }
using Operand_::isReg;
//! Same as `isType()`, provided for convenience.
- inline constexpr bool isReg(RegType rType) const noexcept { return isType(rType); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isReg(RegType rType) const noexcept { return isType(rType); }
//! Tests whether the register type matches `type` and register id matches `id`.
- inline constexpr bool isReg(RegType rType, uint32_t id) const noexcept { return isType(rType) && this->id() == id; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isReg(RegType rType, uint32_t id) const noexcept { return isType(rType) && this->id() == id; }
//! Returns the register type.
- inline constexpr RegType type() const noexcept { return _signature.regType(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegType type() const noexcept { return _signature.regType(); }
//! Returns the register group.
- inline constexpr RegGroup group() const noexcept { return _signature.regGroup(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegGroup group() const noexcept { return _signature.regGroup(); }
+
+ //! Tests whether the register specifies a size (i.e. the size is not zero).
+ ASMJIT_INLINE_NODEBUG constexpr bool hasSize() const noexcept { return _signature.hasField<Signature::kSizeMask>(); }
+ //! Tests whether the register size matches size `s`.
+ ASMJIT_INLINE_NODEBUG constexpr bool hasSize(uint32_t s) const noexcept { return size() == s; }
+
+ //! Returns the size of the register in bytes. If the register size depends on architecture (like `x86::CReg` and
+ //! `x86::DReg`) the size returned should be the greatest possible (so it should return 64-bit size in such case).
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t size() const noexcept { return _signature.getField<Signature::kSizeMask>(); }
//! Returns operation predicate of the register (ARM/AArch64).
//!
//! The meaning depends on architecture, for example on ARM hardware this describes \ref arm::ShiftOp
//! of the register.
- inline constexpr uint32_t predicate() const noexcept { return _signature.getField<Signature::kPredicateMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t predicate() const noexcept { return _signature.getField<Signature::kPredicateMask>(); }
//! Sets operation predicate of the register to `predicate` (ARM/AArch64).
//!
//! The meaning depends on architecture, for example on ARM hardware this describes \ref arm::ShiftOp
//! of the register.
- inline void setPredicate(uint32_t predicate) noexcept { _signature.setField<Signature::kPredicateMask>(predicate); }
+ ASMJIT_INLINE_NODEBUG void setPredicate(uint32_t predicate) noexcept { _signature.setField<Signature::kPredicateMask>(predicate); }
//! Resets shift operation type of the register to the default value (ARM/AArch64).
- inline void resetPredicate() noexcept { _signature.setField<Signature::kPredicateMask>(0); }
+ ASMJIT_INLINE_NODEBUG void resetPredicate() noexcept { _signature.setField<Signature::kPredicateMask>(0); }
//! Clones the register operand.
- inline constexpr BaseReg clone() const noexcept { return BaseReg(*this); }
+ ASMJIT_INLINE_NODEBUG constexpr BaseReg clone() const noexcept { return BaseReg(*this); }
//! Casts this register to `RegT` by also changing its signature.
//!
//! \note Improper use of `cloneAs()` can lead to hard-to-debug errors.
template<typename RegT>
- inline constexpr RegT cloneAs() const noexcept { return RegT(Signature(RegT::kSignature), id()); }
+ ASMJIT_INLINE_NODEBUG constexpr RegT cloneAs() const noexcept { return RegT(Signature(RegT::kSignature), id()); }
//! Casts this register to `other` by also changing its signature.
//!
//! \note Improper use of `cloneAs()` can lead to hard-to-debug errors.
template<typename RegT>
- inline constexpr RegT cloneAs(const RegT& other) const noexcept { return RegT(other.signature(), id()); }
+ ASMJIT_INLINE_NODEBUG constexpr RegT cloneAs(const RegT& other) const noexcept { return RegT(other.signature(), id()); }
//! Sets the register id to `id`.
- inline void setId(uint32_t id) noexcept { _baseId = id; }
+ ASMJIT_INLINE_NODEBUG void setId(uint32_t id) noexcept { _baseId = id; }
//! Sets a 32-bit operand signature based on traits of `RegT`.
template<typename RegT>
- inline void setSignatureT() noexcept { _signature = RegT::kSignature; }
+ ASMJIT_INLINE_NODEBUG void setSignatureT() noexcept { _signature = RegT::kSignature; }
//! Sets the register `signature` and `id`.
- inline void setSignatureAndId(const OperandSignature& signature, uint32_t id) noexcept {
+ ASMJIT_INLINE_NODEBUG void setSignatureAndId(const OperandSignature& signature, uint32_t id) noexcept {
_signature = signature;
_baseId = id;
}
@@ -982,21 +1068,21 @@ public:
//! \{
//! Tests whether the `op` operand is a general purpose register.
- static inline bool isGp(const Operand_& op) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isGp(const Operand_& op) noexcept {
// Check operand type and register group. Not interested in register type and size.
return op.signature().subset(Signature::kOpTypeMask | Signature::kRegGroupMask) == (Signature::fromOpType(OperandType::kReg) | Signature::fromRegGroup(RegGroup::kGp));
}
//! Tests whether the `op` operand is a vector register.
- static inline bool isVec(const Operand_& op) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isVec(const Operand_& op) noexcept {
// Check operand type and register group. Not interested in register type and size.
return op.signature().subset(Signature::kOpTypeMask | Signature::kRegGroupMask) == (Signature::fromOpType(OperandType::kReg) | Signature::fromRegGroup(RegGroup::kVec));
}
//! Tests whether the `op` is a general purpose register of the given `id`.
- static inline bool isGp(const Operand_& op, uint32_t id) noexcept { return isGp(op) & (op.id() == id); }
+ static ASMJIT_INLINE_NODEBUG bool isGp(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isGp(op)) & unsigned(op.id() == id)); }
//! Tests whether the `op` is a vector register of the given `id`.
- static inline bool isVec(const Operand_& op, uint32_t id) noexcept { return isVec(op) & (op.id() == id); }
+ static ASMJIT_INLINE_NODEBUG bool isVec(const Operand_& op, uint32_t id) noexcept { return bool(unsigned(isVec(op)) & unsigned(op.id() == id)); }
//! \}
};
@@ -1021,16 +1107,16 @@ struct RegOnly {
//! \{
//! Initializes the `RegOnly` instance to hold register `signature` and `id`.
- inline void init(const OperandSignature& signature, uint32_t id) noexcept {
+ ASMJIT_INLINE_NODEBUG void init(const OperandSignature& signature, uint32_t id) noexcept {
_signature = signature;
_id = id;
}
- inline void init(const BaseReg& reg) noexcept { init(reg.signature(), reg.id()); }
- inline void init(const RegOnly& reg) noexcept { init(reg.signature(), reg.id()); }
+ ASMJIT_INLINE_NODEBUG void init(const BaseReg& reg) noexcept { init(reg.signature(), reg.id()); }
+ ASMJIT_INLINE_NODEBUG void init(const RegOnly& reg) noexcept { init(reg.signature(), reg.id()); }
//! Resets the `RegOnly` members to zeros (none).
- inline void reset() noexcept { init(Signature::fromBits(0), 0); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { init(Signature::fromBits(0), 0); }
//! \}
@@ -1038,30 +1124,30 @@ struct RegOnly {
//! \{
//! Tests whether this ExtraReg is none (same as calling `Operand_::isNone()`).
- inline constexpr bool isNone() const noexcept { return _signature == 0; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isNone() const noexcept { return _signature == 0; }
//! Tests whether the register is valid (either virtual or physical).
- inline constexpr bool isReg() const noexcept { return _signature != 0; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isReg() const noexcept { return _signature != 0; }
//! Tests whether this is a physical register.
- inline constexpr bool isPhysReg() const noexcept { return _id < BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isPhysReg() const noexcept { return _id < BaseReg::kIdBad; }
//! Tests whether this is a virtual register (used by `BaseCompiler`).
- inline constexpr bool isVirtReg() const noexcept { return _id > BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isVirtReg() const noexcept { return _id > BaseReg::kIdBad; }
//! Returns the register signature or 0 if no register is assigned.
- inline constexpr OperandSignature signature() const noexcept { return _signature; }
+ ASMJIT_INLINE_NODEBUG constexpr OperandSignature signature() const noexcept { return _signature; }
//! Returns the register id.
//!
//! \note Always check whether the register is assigned before using the returned identifier as
//! non-assigned `RegOnly` instance would return zero id, which is still a valid register id.
- inline constexpr uint32_t id() const noexcept { return _id; }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t id() const noexcept { return _id; }
//! Sets the register id.
- inline void setId(uint32_t id) noexcept { _id = id; }
+ ASMJIT_INLINE_NODEBUG void setId(uint32_t id) noexcept { _id = id; }
//! Returns the register type.
- inline constexpr RegType type() const noexcept { return _signature.regType(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegType type() const noexcept { return _signature.regType(); }
//! Returns the register group.
- inline constexpr RegGroup group() const noexcept { return _signature.regGroup(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegGroup group() const noexcept { return _signature.regGroup(); }
//! \}
@@ -1070,85 +1156,270 @@ struct RegOnly {
//! Converts this ExtraReg to a real `RegT` operand.
template<typename RegT>
- inline constexpr RegT toReg() const noexcept { return RegT(_signature, _id); }
+ ASMJIT_INLINE_NODEBUG constexpr RegT toReg() const noexcept { return RegT(_signature, _id); }
//! \}
};
//! \cond INTERNAL
//! Adds a template specialization for `REG_TYPE` into the local `RegTraits`.
-#define ASMJIT_DEFINE_REG_TRAITS(REG, REG_TYPE, GROUP, SIZE, COUNT, TYPE_ID) \
-template<> \
-struct RegTraits<REG_TYPE> { \
- typedef REG RegT; \
- \
- enum : uint32_t { \
- kValid = uint32_t(true), \
- kCount = uint32_t(COUNT), \
- kType = uint32_t(REG_TYPE), \
- kGroup = uint32_t(GROUP), \
- kSize = uint32_t(SIZE), \
- kTypeId = uint32_t(TYPE_ID), \
- \
- kSignature = (OperandSignature::fromOpType(OperandType::kReg) | \
- OperandSignature::fromRegType(REG_TYPE) | \
- OperandSignature::fromRegGroup(GROUP) | \
- OperandSignature::fromSize(kSize)).bits(), \
- }; \
+#define ASMJIT_DEFINE_REG_TRAITS(REG_TYPE, GROUP, SIZE, TYPE_ID) \
+template<> \
+struct RegTraits<REG_TYPE> { \
+ static constexpr uint32_t kValid = 1; \
+ static constexpr RegType kType = REG_TYPE; \
+ static constexpr RegGroup kGroup = GROUP; \
+ static constexpr uint32_t kSize = SIZE; \
+ static constexpr TypeId kTypeId = TYPE_ID; \
+ \
+ static constexpr uint32_t kSignature = \
+ (OperandSignature::fromOpType(OperandType::kReg) | \
+ OperandSignature::fromRegType(kType) | \
+ OperandSignature::fromRegGroup(kGroup) | \
+ OperandSignature::fromSize(kSize)).bits(); \
+ \
}
//! Adds constructors and member functions to a class that implements abstract register. Abstract register is register
//! that doesn't have type or signature yet, it's a base class like `x86::Reg` or `arm::Reg`.
-#define ASMJIT_DEFINE_ABSTRACT_REG(REG, BASE) \
-public: \
- /*! Default constructor that only setups basics. */ \
- inline constexpr REG() noexcept \
- : BASE(Signature{kSignature}, kIdBad) {} \
- \
- /*! Makes a copy of the `other` register operand. */ \
- inline constexpr REG(const REG& other) noexcept \
- : BASE(other) {} \
- \
- /*! Makes a copy of the `other` register having id set to `id` */ \
- inline constexpr REG(const BaseReg& other, uint32_t id) noexcept \
- : BASE(other, id) {} \
- \
- /*! Creates a register based on `signature` and `id`. */ \
- inline constexpr REG(const OperandSignature& sgn, uint32_t id) noexcept \
- : BASE(sgn, id) {} \
- \
- /*! Creates a completely uninitialized REG register operand (garbage). */ \
- inline explicit REG(Globals::NoInit_) noexcept \
- : BASE(Globals::NoInit) {} \
- \
- /*! Creates a new register from register type and id. */ \
- static inline REG fromTypeAndId(RegType type, uint32_t id) noexcept { \
- return REG(signatureOf(type), id); \
- } \
- \
- /*! Clones the register operand. */ \
- inline constexpr REG clone() const noexcept { return REG(*this); } \
- \
- inline REG& operator=(const REG& other) noexcept = default;
+#define ASMJIT_DEFINE_ABSTRACT_REG(REG, BASE) \
+public: \
+ /*! Default constructor that only setups basics. */ \
+ ASMJIT_INLINE_NODEBUG constexpr REG() noexcept \
+ : BASE(Signature{kSignature}, kIdBad) {} \
+ \
+ /*! Makes a copy of the `other` register operand. */ \
+ ASMJIT_INLINE_NODEBUG constexpr REG(const REG& other) noexcept \
+ : BASE(other) {} \
+ \
+ /*! Makes a copy of the `other` register having id set to `id` */ \
+ ASMJIT_INLINE_NODEBUG constexpr REG(const BaseReg& other, uint32_t id) noexcept \
+ : BASE(other, id) {} \
+ \
+ /*! Creates a register based on `signature` and `id`. */ \
+ ASMJIT_INLINE_NODEBUG constexpr REG(const OperandSignature& sgn, uint32_t id) noexcept \
+ : BASE(sgn, id) {} \
+ \
+ /*! Creates a completely uninitialized REG register operand (garbage). */ \
+ ASMJIT_INLINE_NODEBUG explicit REG(Globals::NoInit_) noexcept \
+ : BASE(Globals::NoInit) {} \
+ \
+ /*! Creates a new register from register type and id. */ \
+ static ASMJIT_INLINE_NODEBUG REG fromTypeAndId(RegType type, uint32_t id) noexcept { \
+ return REG(signatureOf(type), id); \
+ } \
+ \
+ /*! Clones the register operand. */ \
+ ASMJIT_INLINE_NODEBUG constexpr REG clone() const noexcept { return REG(*this); } \
+ \
+ ASMJIT_INLINE_NODEBUG REG& operator=(const REG& other) noexcept = default;
//! Adds constructors and member functions to a class that implements final register. Final registers MUST HAVE a valid
//! signature.
-#define ASMJIT_DEFINE_FINAL_REG(REG, BASE, TRAITS) \
-public: \
- enum : uint32_t { \
- kThisType = TRAITS::kType, \
- kThisGroup = TRAITS::kGroup, \
- kThisSize = TRAITS::kSize, \
- kSignature = TRAITS::kSignature \
- }; \
- \
- ASMJIT_DEFINE_ABSTRACT_REG(REG, BASE) \
- \
- /*! Creates a register operand having its id set to `id`. */ \
- inline constexpr explicit REG(uint32_t id) noexcept \
+#define ASMJIT_DEFINE_FINAL_REG(REG, BASE, TRAITS) \
+public: \
+ static constexpr RegType kThisType = TRAITS::kType; \
+ static constexpr RegGroup kThisGroup = TRAITS::kGroup; \
+ static constexpr uint32_t kThisSize = TRAITS::kSize; \
+ static constexpr uint32_t kSignature = TRAITS::kSignature; \
+ \
+ ASMJIT_DEFINE_ABSTRACT_REG(REG, BASE) \
+ \
+ /*! Creates a register operand having its id set to `id`. */ \
+ ASMJIT_INLINE_NODEBUG constexpr explicit REG(uint32_t id) noexcept \
: BASE(Signature{kSignature}, id) {}
//! \endcond
+//! List of physical registers (base).
+//!
+//! \note List of registers is only used by some ARM instructions at the moment.
+class BaseRegList : public Operand {
+public:
+ //! \name Constants
+ //! \{
+
+ enum : uint32_t {
+ kSignature = Signature::fromOpType(OperandType::kRegList).bits()
+ };
+
+ //! \}
+
+ //! \name Construction & Destruction
+ //! \{
+
+ //! Creates a dummy register operand.
+ ASMJIT_INLINE_NODEBUG constexpr BaseRegList() noexcept
+ : Operand(Globals::Init, Signature::fromOpType(OperandType::kRegList), 0, 0, 0) {}
+
+ //! Creates a new register operand which is the same as `other` .
+ ASMJIT_INLINE_NODEBUG constexpr BaseRegList(const BaseRegList& other) noexcept
+ : Operand(other) {}
+
+ //! Creates a new register operand compatible with `other`, but with a different `id`.
+ ASMJIT_INLINE_NODEBUG constexpr BaseRegList(const BaseRegList& other, RegMask regMask) noexcept
+ : Operand(Globals::Init, other._signature, regMask, 0, 0) {}
+
+ //! Creates a register initialized to the given `signature` and `id`.
+ ASMJIT_INLINE_NODEBUG constexpr BaseRegList(const Signature& signature, RegMask regMask) noexcept
+ : Operand(Globals::Init, signature, regMask, 0, 0) {}
+
+ ASMJIT_INLINE_NODEBUG explicit BaseRegList(Globals::NoInit_) noexcept
+ : Operand(Globals::NoInit) {}
+
+ //! \}
+
+ //! \name Overloaded Operators
+ //! \{
+
+ ASMJIT_INLINE_NODEBUG BaseRegList& operator=(const BaseRegList& other) noexcept = default;
+
+ //! \}
+
+ //! \name Accessors
+ //! \{
+
+ //! Tests whether the register-list is valid, which means it has a type and at least a single register in the list.
+ ASMJIT_INLINE_NODEBUG constexpr bool isValid() const noexcept { return bool(unsigned(_signature != 0u) & unsigned(_baseId != 0u)); }
+
+ //! Tests whether the register type matches `type` - same as `isReg(type)`, provided for convenience.
+ ASMJIT_INLINE_NODEBUG constexpr bool isType(RegType type) const noexcept { return _signature.subset(Signature::kRegTypeMask) == Signature::fromRegType(type); }
+ //! Tests whether the register group matches `group`.
+ ASMJIT_INLINE_NODEBUG constexpr bool isGroup(RegGroup group) const noexcept { return _signature.subset(Signature::kRegGroupMask) == Signature::fromRegGroup(group); }
+
+ //! Tests whether the register is a general purpose register (any size).
+ ASMJIT_INLINE_NODEBUG constexpr bool isGp() const noexcept { return isGroup(RegGroup::kGp); }
+ //! Tests whether the register is a vector register.
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec() const noexcept { return isGroup(RegGroup::kVec); }
+
+ //! Returns the register type.
+ ASMJIT_INLINE_NODEBUG constexpr RegType type() const noexcept { return _signature.regType(); }
+ //! Returns the register group.
+ ASMJIT_INLINE_NODEBUG constexpr RegGroup group() const noexcept { return _signature.regGroup(); }
+ //! Returns the size of a single register in this register-list or 0 if unspecified.
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t size() const noexcept { return _signature.getField<Signature::kSizeMask>(); }
+
+ //! Returns the register list as a mask, where each bit represents one physical register.
+ ASMJIT_INLINE_NODEBUG constexpr RegMask list() const noexcept { return _baseId; }
+ //! Sets the register list to `mask`.
+ ASMJIT_INLINE_NODEBUG void setList(RegMask mask) noexcept { _baseId = mask; }
+ //! Remoes all registers from the register-list by making the underlying register-mask zero.
+ ASMJIT_INLINE_NODEBUG void resetList() noexcept { _baseId = 0; }
+
+ //! Adds registers passed by a register `mask` to the register-list.
+ ASMJIT_INLINE_NODEBUG void addList(RegMask mask) noexcept { _baseId |= mask; }
+ //! Removes registers passed by a register `mask` to the register-list.
+ ASMJIT_INLINE_NODEBUG void clearList(RegMask mask) noexcept { _baseId &= ~mask; }
+ //! Uses AND operator to combine the current register-list with other register `mask`.
+ ASMJIT_INLINE_NODEBUG void andList(RegMask mask) noexcept { _baseId &= mask; }
+ //! Uses XOR operator to combine the current register-list with other register `mask`.
+ ASMJIT_INLINE_NODEBUG void xorList(RegMask mask) noexcept { _baseId ^= mask; }
+
+ //! Checks whether a physical register `physId` is in the register-list.
+ ASMJIT_INLINE_NODEBUG bool hasReg(uint32_t physId) const noexcept { return physId < 32u ? (_baseId & (1u << physId)) != 0 : false; }
+ //! Adds a physical register `physId` to the register-list.
+ ASMJIT_INLINE_NODEBUG void addReg(uint32_t physId) noexcept { addList(1u << physId); }
+ //! Removes a physical register `physId` from the register-list.
+ ASMJIT_INLINE_NODEBUG void clearReg(uint32_t physId) noexcept { clearList(1u << physId); }
+
+ //! Clones the register-list operand.
+ ASMJIT_INLINE_NODEBUG constexpr BaseRegList clone() const noexcept { return BaseRegList(*this); }
+
+ //! Casts this register to `RegT` by also changing its signature.
+ //!
+ //! \note Improper use of `cloneAs()` can lead to hard-to-debug errors.
+ template<typename RegListT>
+ ASMJIT_INLINE_NODEBUG constexpr RegListT cloneAs() const noexcept { return RegListT(Signature(RegListT::kSignature), list()); }
+
+ //! Casts this register to `other` by also changing its signature.
+ //!
+ //! \note Improper use of `cloneAs()` can lead to hard-to-debug errors.
+ template<typename RegListT>
+ ASMJIT_INLINE_NODEBUG constexpr RegListT cloneAs(const RegListT& other) const noexcept { return RegListT(other.signature(), list()); }
+
+ //! \}
+};
+
+template<typename RegT>
+class RegListT : public BaseRegList {
+public:
+ //! \name Construction & Destruction
+ //! \{
+
+ //! Creates a dummy register operand.
+ ASMJIT_INLINE_NODEBUG constexpr RegListT() noexcept
+ : BaseRegList() {}
+
+ //! Creates a new register operand which is the same as `other` .
+ ASMJIT_INLINE_NODEBUG constexpr RegListT(const RegListT& other) noexcept
+ : BaseRegList(other) {}
+
+ //! Creates a new register operand compatible with `other`, but with a different `id`.
+ ASMJIT_INLINE_NODEBUG constexpr RegListT(const RegListT& other, RegMask regMask) noexcept
+ : BaseRegList(other, regMask) {}
+
+ //! Creates a register initialized to the given `signature` and `id`.
+ ASMJIT_INLINE_NODEBUG constexpr RegListT(const Signature& signature, RegMask regMask) noexcept
+ : BaseRegList(signature, regMask) {}
+
+ //! Creates a register initialized to the given `signature` and `regs`.
+ ASMJIT_INLINE_NODEBUG RegListT(const Signature& signature, std::initializer_list<RegT> regs) noexcept
+ : BaseRegList(signature, RegMask(0)) { addRegs(regs); }
+
+ ASMJIT_INLINE_NODEBUG explicit RegListT(Globals::NoInit_) noexcept
+ : BaseRegList(Globals::NoInit) {}
+
+ //! \}
+
+ //! \name Overloaded Operators
+ //! \{
+
+ ASMJIT_INLINE_NODEBUG RegListT& operator=(const RegListT& other) noexcept = default;
+
+ //! \}
+
+ //! \name Accessors
+ //! \{
+
+ using BaseRegList::addList;
+ using BaseRegList::clearList;
+ using BaseRegList::andList;
+ using BaseRegList::xorList;
+
+ //! Adds registers to this register-list as provided by `other` register-list.
+ ASMJIT_INLINE_NODEBUG void addList(const RegListT<RegT>& other) noexcept { addList(other.list()); }
+ //! Removes registers contained in `other` register-list.
+ ASMJIT_INLINE_NODEBUG void clearList(const RegListT<RegT>& other) noexcept { clearList(other.list()); }
+ //! Uses AND operator to combine the current register-list with `other` register-list.
+ ASMJIT_INLINE_NODEBUG void andList(const RegListT<RegT>& other) noexcept { andList(other.list()); }
+ //! Uses XOR operator to combine the current register-list with `other` register-list.
+ ASMJIT_INLINE_NODEBUG void xorList(const RegListT<RegT>& other) noexcept { xorList(other.list()); }
+
+ using BaseRegList::addReg;
+ using BaseRegList::clearReg;
+
+ ASMJIT_INLINE_NODEBUG void addReg(const RegT& reg) noexcept {
+ if (reg.id() < 32u)
+ addReg(reg.id());
+ }
+
+ ASMJIT_INLINE_NODEBUG void addRegs(std::initializer_list<RegT> regs) noexcept {
+ for (const RegT& reg : regs)
+ addReg(reg);
+ }
+
+ ASMJIT_INLINE_NODEBUG void clearReg(const RegT& reg) noexcept {
+ if (reg.id() < 32u)
+ clearReg(reg.id());
+ }
+
+ ASMJIT_INLINE_NODEBUG void clearRegs(std::initializer_list<RegT> regs) noexcept {
+ for (const RegT& reg : regs)
+ clearReg(reg);
+ }
+
+ //! \}
+};
+
//! Base class for all memory operands.
//!
//! The data is split into the following parts:
@@ -1174,18 +1445,18 @@ public:
//! \{
//! Creates a default `BaseMem` operand, that points to [0].
- inline constexpr BaseMem() noexcept
+ ASMJIT_INLINE_NODEBUG constexpr BaseMem() noexcept
: Operand(Globals::Init, Signature::fromOpType(OperandType::kMem), 0, 0, 0) {}
//! Creates a `BaseMem` operand that is a clone of `other`.
- inline constexpr BaseMem(const BaseMem& other) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr BaseMem(const BaseMem& other) noexcept
: Operand(other) {}
//! Creates a `BaseMem` operand from `baseReg` and `offset`.
//!
//! \note This is an architecture independent constructor that can be used to create an architecture
//! independent memory operand to be used in portable code that can handle multiple architectures.
- inline constexpr explicit BaseMem(const BaseReg& baseReg, int32_t offset = 0) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr explicit BaseMem(const BaseReg& baseReg, int32_t offset = 0) noexcept
: Operand(Globals::Init,
Signature::fromOpType(OperandType::kMem) | Signature::fromMemBaseType(baseReg.type()),
baseReg.id(),
@@ -1194,16 +1465,16 @@ public:
//! \cond INTERNAL
//! Creates a `BaseMem` operand from 4 integers as used by `Operand_` struct.
- inline constexpr BaseMem(const OperandSignature& u0, uint32_t baseId, uint32_t indexId, int32_t offset) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr BaseMem(const OperandSignature& u0, uint32_t baseId, uint32_t indexId, int32_t offset) noexcept
: Operand(Globals::Init, u0, baseId, indexId, uint32_t(offset)) {}
//! \endcond
//! Creates a completely uninitialized `BaseMem` operand.
- inline explicit BaseMem(Globals::NoInit_) noexcept
+ ASMJIT_INLINE_NODEBUG explicit BaseMem(Globals::NoInit_) noexcept
: Operand(Globals::NoInit) {}
//! Resets the memory operand - after the reset the memory points to [0].
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_signature = Signature::fromOpType(OperandType::kMem);
_baseId = 0;
_data[0] = 0;
@@ -1215,7 +1486,7 @@ public:
//! \name Overloaded Operators
//! \{
- inline BaseMem& operator=(const BaseMem& other) noexcept { copyFrom(other); return *this; }
+ ASMJIT_INLINE_NODEBUG BaseMem& operator=(const BaseMem& other) noexcept { copyFrom(other); return *this; }
//! \}
@@ -1223,54 +1494,54 @@ public:
//! \{
//! Clones the memory operand.
- inline constexpr BaseMem clone() const noexcept { return BaseMem(*this); }
+ ASMJIT_INLINE_NODEBUG constexpr BaseMem clone() const noexcept { return BaseMem(*this); }
//! Creates a new copy of this memory operand adjusted by `off`.
- inline BaseMem cloneAdjusted(int64_t off) const noexcept {
+ ASMJIT_INLINE_NODEBUG BaseMem cloneAdjusted(int64_t off) const noexcept {
BaseMem result(*this);
result.addOffset(off);
return result;
}
//! Tests whether this memory operand is a register home (only used by \ref asmjit_compiler)
- inline constexpr bool isRegHome() const noexcept { return _signature.hasField<Signature::kMemRegHomeFlag>(); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isRegHome() const noexcept { return _signature.hasField<Signature::kMemRegHomeFlag>(); }
//! Mark this memory operand as register home (only used by \ref asmjit_compiler).
- inline void setRegHome() noexcept { _signature |= Signature::kMemRegHomeFlag; }
+ ASMJIT_INLINE_NODEBUG void setRegHome() noexcept { _signature |= Signature::kMemRegHomeFlag; }
//! Marks this operand to not be a register home (only used by \ref asmjit_compiler).
- inline void clearRegHome() noexcept { _signature &= ~Signature::kMemRegHomeFlag; }
+ ASMJIT_INLINE_NODEBUG void clearRegHome() noexcept { _signature &= ~Signature::kMemRegHomeFlag; }
//! Tests whether the memory operand has a BASE register or label specified.
- inline constexpr bool hasBase() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool hasBase() const noexcept {
return (_signature & Signature::kMemBaseTypeMask) != 0;
}
//! Tests whether the memory operand has an INDEX register specified.
- inline constexpr bool hasIndex() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool hasIndex() const noexcept {
return (_signature & Signature::kMemIndexTypeMask) != 0;
}
//! Tests whether the memory operand has BASE or INDEX register.
- inline constexpr bool hasBaseOrIndex() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool hasBaseOrIndex() const noexcept {
return (_signature & Signature::kMemBaseIndexMask) != 0;
}
//! Tests whether the memory operand has BASE and INDEX register.
- inline constexpr bool hasBaseAndIndex() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool hasBaseAndIndex() const noexcept {
return (_signature & Signature::kMemBaseTypeMask) != 0 && (_signature & Signature::kMemIndexTypeMask) != 0;
}
//! Tests whether the BASE operand is a label.
- inline constexpr bool hasBaseLabel() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool hasBaseLabel() const noexcept {
return _signature.subset(Signature::kMemBaseTypeMask) == Signature::fromMemBaseType(RegType::kLabelTag);
}
//! Tests whether the BASE operand is a register (registers start after `RegType::kLabelTag`).
- inline constexpr bool hasBaseReg() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool hasBaseReg() const noexcept {
return _signature.subset(Signature::kMemBaseTypeMask).bits() > Signature::fromMemBaseType(RegType::kLabelTag).bits();
}
//! Tests whether the INDEX operand is a register (registers start after `RegType::kLabelTag`).
- inline constexpr bool hasIndexReg() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool hasIndexReg() const noexcept {
return _signature.subset(Signature::kMemIndexTypeMask).bits() > Signature::fromMemIndexType(RegType::kLabelTag).bits();
}
@@ -1278,76 +1549,78 @@ public:
//!
//! \note If the returned type is one (a value never associated to a register type) the BASE is not register, but it
//! is a label. One equals to `kLabelTag`. You should always check `hasBaseLabel()` before using `baseId()` result.
- inline constexpr RegType baseType() const noexcept { return _signature.memBaseType(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegType baseType() const noexcept { return _signature.memBaseType(); }
//! Returns the type of an INDEX register (0 if this memory operand doesn't
//! use the INDEX register).
- inline constexpr RegType indexType() const noexcept { return _signature.memIndexType(); }
+ ASMJIT_INLINE_NODEBUG constexpr RegType indexType() const noexcept { return _signature.memIndexType(); }
//! This is used internally for BASE+INDEX validation.
- inline constexpr uint32_t baseAndIndexTypes() const noexcept { return _signature.getField<Signature::kMemBaseIndexMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t baseAndIndexTypes() const noexcept { return _signature.getField<Signature::kMemBaseIndexMask>(); }
//! Returns both BASE (4:0 bits) and INDEX (9:5 bits) types combined into a single value.
//!
//! \remarks Returns id of the BASE register or label (if the BASE was specified as label).
- inline constexpr uint32_t baseId() const noexcept { return _baseId; }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t baseId() const noexcept { return _baseId; }
//! Returns the id of the INDEX register.
- inline constexpr uint32_t indexId() const noexcept { return _data[kDataMemIndexId]; }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t indexId() const noexcept { return _data[kDataMemIndexId]; }
//! Sets the id of the BASE register (without modifying its type).
- inline void setBaseId(uint32_t id) noexcept { _baseId = id; }
+ ASMJIT_INLINE_NODEBUG void setBaseId(uint32_t id) noexcept { _baseId = id; }
+ //! Sets the register type of the BASE register (without modifying its id).
+ ASMJIT_INLINE_NODEBUG void setBaseType(RegType regType) noexcept { _signature.setMemBaseType(regType); }
+
//! Sets the id of the INDEX register (without modifying its type).
- inline void setIndexId(uint32_t id) noexcept { _data[kDataMemIndexId] = id; }
+ ASMJIT_INLINE_NODEBUG void setIndexId(uint32_t id) noexcept { _data[kDataMemIndexId] = id; }
+ //! Sets the register type of the INDEX register (without modifying its id).
+ ASMJIT_INLINE_NODEBUG void setIndexType(RegType regType) noexcept { _signature.setMemIndexType(regType); }
//! Sets the base register to type and id of the given `base` operand.
- inline void setBase(const BaseReg& base) noexcept { return _setBase(base.type(), base.id()); }
+ ASMJIT_INLINE_NODEBUG void setBase(const BaseReg& base) noexcept { return _setBase(base.type(), base.id()); }
//! Sets the index register to type and id of the given `index` operand.
- inline void setIndex(const BaseReg& index) noexcept { return _setIndex(index.type(), index.id()); }
+ ASMJIT_INLINE_NODEBUG void setIndex(const BaseReg& index) noexcept { return _setIndex(index.type(), index.id()); }
//! \cond INTERNAL
- inline void _setBase(RegType type, uint32_t id) noexcept {
+ ASMJIT_INLINE_NODEBUG void _setBase(RegType type, uint32_t id) noexcept {
_signature.setField<Signature::kMemBaseTypeMask>(uint32_t(type));
_baseId = id;
}
- inline void _setIndex(RegType type, uint32_t id) noexcept {
+ ASMJIT_INLINE_NODEBUG void _setIndex(RegType type, uint32_t id) noexcept {
_signature.setField<Signature::kMemIndexTypeMask>(uint32_t(type));
_data[kDataMemIndexId] = id;
}
//! \endcond
//! Resets the memory operand's BASE register or label.
- inline void resetBase() noexcept { _setBase(RegType::kNone, 0); }
+ ASMJIT_INLINE_NODEBUG void resetBase() noexcept { _setBase(RegType::kNone, 0); }
//! Resets the memory operand's INDEX register.
- inline void resetIndex() noexcept { _setIndex(RegType::kNone, 0); }
-
- //! Sets the memory operand size (in bytes).
- inline void setSize(uint32_t size) noexcept { _signature.setField<Signature::kSizeMask>(size); }
+ ASMJIT_INLINE_NODEBUG void resetIndex() noexcept { _setIndex(RegType::kNone, 0); }
//! Tests whether the memory operand has a 64-bit offset or absolute address.
//!
//! If this is true then `hasBase()` must always report false.
- inline constexpr bool isOffset64Bit() const noexcept { return baseType() == RegType::kNone; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isOffset64Bit() const noexcept { return baseType() == RegType::kNone; }
//! Tests whether the memory operand has a non-zero offset or absolute address.
- inline constexpr bool hasOffset() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr bool hasOffset() const noexcept {
return (_data[kDataMemOffsetLo] | uint32_t(_baseId & Support::bitMaskFromBool<uint32_t>(isOffset64Bit()))) != 0;
}
//! Returns either relative offset or absolute address as 64-bit integer.
- inline constexpr int64_t offset() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr int64_t offset() const noexcept {
return isOffset64Bit() ? int64_t(uint64_t(_data[kDataMemOffsetLo]) | (uint64_t(_baseId) << 32))
: int64_t(int32_t(_data[kDataMemOffsetLo])); // Sign extend 32-bit offset.
}
//! Returns a 32-bit low part of a 64-bit offset or absolute address.
- inline constexpr int32_t offsetLo32() const noexcept { return int32_t(_data[kDataMemOffsetLo]); }
+ ASMJIT_INLINE_NODEBUG constexpr int32_t offsetLo32() const noexcept { return int32_t(_data[kDataMemOffsetLo]); }
//! Returns a 32-but high part of a 64-bit offset or absolute address.
//!
//! \note This function is UNSAFE and returns garbage if `isOffset64Bit()`
//! returns false. Never use it blindly without checking it first.
- inline constexpr int32_t offsetHi32() const noexcept { return int32_t(_baseId); }
+ ASMJIT_INLINE_NODEBUG constexpr int32_t offsetHi32() const noexcept { return int32_t(_baseId); }
//! Sets a 64-bit offset or an absolute address to `offset`.
//!
@@ -1383,15 +1656,20 @@ public:
}
//! Adds `offset` to a low 32-bit offset part (don't use without knowing how BaseMem works).
- inline void addOffsetLo32(int32_t offset) noexcept { _data[kDataMemOffsetLo] += uint32_t(offset); }
+ ASMJIT_INLINE_NODEBUG void addOffsetLo32(int32_t offset) noexcept { _data[kDataMemOffsetLo] += uint32_t(offset); }
//! Resets the memory offset to zero.
- inline void resetOffset() noexcept { setOffset(0); }
+ ASMJIT_INLINE_NODEBUG void resetOffset() noexcept { setOffset(0); }
//! Resets the lo part of the memory offset to zero (don't use without knowing how BaseMem works).
- inline void resetOffsetLo32() noexcept { setOffsetLo32(0); }
+ ASMJIT_INLINE_NODEBUG void resetOffsetLo32() noexcept { setOffsetLo32(0); }
//! \}
+
+#if !defined(ASMJIT_NO_DEPRECATED)
+ ASMJIT_DEPRECATED("setSize() is no longer portable - use setX86RmSize() or x86::Mem::setSize() instead, if your target is X86/X86_64")
+ ASMJIT_INLINE_NODEBUG void setSize(uint32_t size) noexcept { _signature.setField<Signature::kSizeMask>(size); }
+#endif
};
//! Type of the an immediate value.
@@ -1423,15 +1701,15 @@ public:
//! \{
//! Creates a new immediate value (initial value is 0).
- inline constexpr Imm() noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Imm() noexcept
: Operand(Globals::Init, Signature::fromOpType(OperandType::kImm), 0, 0, 0) {}
//! Creates a new immediate value from `other`.
- inline constexpr Imm(const Imm& other) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Imm(const Imm& other) noexcept
: Operand(other) {}
//! Creates a new immediate value from ARM/AArch64 specific `shift`.
- inline constexpr Imm(const arm::Shift& shift) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Imm(const arm::Shift& shift) noexcept
: Operand(Globals::Init,
Signature::fromOpType(OperandType::kImm) | Signature::fromPredicate(uint32_t(shift.op())),
0,
@@ -1443,28 +1721,28 @@ public:
//!
//! \note Predicate is currently only used by ARM architectures.
template<typename T, typename = typename std::enable_if<IsConstexprConstructibleAsImmType<typename std::decay<T>::type>::value>::type>
- inline constexpr Imm(const T& val, const uint32_t predicate = 0) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Imm(const T& val, const uint32_t predicate = 0) noexcept
: Operand(Globals::Init,
Signature::fromOpType(OperandType::kImm) | Signature::fromPredicate(predicate),
0,
Support::unpackU32At0(int64_t(val)),
Support::unpackU32At1(int64_t(val))) {}
- inline Imm(const float& val, const uint32_t predicate = 0) noexcept
+ ASMJIT_INLINE_NODEBUG Imm(const float& val, const uint32_t predicate = 0) noexcept
: Operand(Globals::Init,
Signature::fromOpType(OperandType::kImm) | Signature::fromPredicate(predicate),
0,
0,
0) { setValue(val); }
- inline Imm(const double& val, const uint32_t predicate = 0) noexcept
+ ASMJIT_INLINE_NODEBUG Imm(const double& val, const uint32_t predicate = 0) noexcept
: Operand(Globals::Init,
Signature::fromOpType(OperandType::kImm) | Signature::fromPredicate(predicate),
0,
0,
0) { setValue(val); }
- inline explicit Imm(Globals::NoInit_) noexcept
+ ASMJIT_INLINE_NODEBUG explicit Imm(Globals::NoInit_) noexcept
: Operand(Globals::NoInit) {}
//! \}
@@ -1473,7 +1751,7 @@ public:
//! \{
//! Assigns the value of the `other` operand to this immediate.
- inline Imm& operator=(const Imm& other) noexcept { copyFrom(other); return *this; }
+ ASMJIT_INLINE_NODEBUG Imm& operator=(const Imm& other) noexcept { copyFrom(other); return *this; }
//! \}
@@ -1481,73 +1759,73 @@ public:
//! \{
//! Returns immediate type.
- inline constexpr ImmType type() const noexcept { return (ImmType)_signature.getField<Signature::kImmTypeMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr ImmType type() const noexcept { return (ImmType)_signature.getField<Signature::kImmTypeMask>(); }
//! Sets the immediate type to `type`.
- inline void setType(ImmType type) noexcept { _signature.setField<Signature::kImmTypeMask>(uint32_t(type)); }
+ ASMJIT_INLINE_NODEBUG void setType(ImmType type) noexcept { _signature.setField<Signature::kImmTypeMask>(uint32_t(type)); }
//! Resets immediate type to \ref ImmType::kInt.
- inline void resetType() noexcept { setType(ImmType::kInt); }
+ ASMJIT_INLINE_NODEBUG void resetType() noexcept { setType(ImmType::kInt); }
//! Returns operation predicate of the immediate.
//!
//! The meaning depends on architecture, for example on ARM hardware this describes \ref arm::ShiftOp
//! of the immediate.
- inline constexpr uint32_t predicate() const noexcept { return _signature.getField<Signature::kPredicateMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t predicate() const noexcept { return _signature.getField<Signature::kPredicateMask>(); }
//! Sets operation predicate of the immediate to `predicate`.
//!
//! The meaning depends on architecture, for example on ARM hardware this describes \ref arm::ShiftOp
//! of the immediate.
- inline void setPredicate(uint32_t predicate) noexcept { _signature.setField<Signature::kPredicateMask>(predicate); }
+ ASMJIT_INLINE_NODEBUG void setPredicate(uint32_t predicate) noexcept { _signature.setField<Signature::kPredicateMask>(predicate); }
//! Resets the shift operation type of the immediate to the default value (no operation).
- inline void resetPredicate() noexcept { _signature.setField<Signature::kPredicateMask>(0); }
+ ASMJIT_INLINE_NODEBUG void resetPredicate() noexcept { _signature.setField<Signature::kPredicateMask>(0); }
//! Returns the immediate value as `int64_t`, which is the internal format Imm uses.
- inline constexpr int64_t value() const noexcept {
+ ASMJIT_INLINE_NODEBUG constexpr int64_t value() const noexcept {
return int64_t((uint64_t(_data[kDataImmValueHi]) << 32) | _data[kDataImmValueLo]);
}
//! Tests whether this immediate value is integer of any size.
- inline constexpr uint32_t isInt() const noexcept { return type() == ImmType::kInt; }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t isInt() const noexcept { return type() == ImmType::kInt; }
//! Tests whether this immediate value is a double precision floating point value.
- inline constexpr uint32_t isDouble() const noexcept { return type() == ImmType::kDouble; }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t isDouble() const noexcept { return type() == ImmType::kDouble; }
//! Tests whether the immediate can be casted to 8-bit signed integer.
- inline constexpr bool isInt8() const noexcept { return type() == ImmType::kInt && Support::isInt8(value()); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isInt8() const noexcept { return type() == ImmType::kInt && Support::isInt8(value()); }
//! Tests whether the immediate can be casted to 8-bit unsigned integer.
- inline constexpr bool isUInt8() const noexcept { return type() == ImmType::kInt && Support::isUInt8(value()); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isUInt8() const noexcept { return type() == ImmType::kInt && Support::isUInt8(value()); }
//! Tests whether the immediate can be casted to 16-bit signed integer.
- inline constexpr bool isInt16() const noexcept { return type() == ImmType::kInt && Support::isInt16(value()); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isInt16() const noexcept { return type() == ImmType::kInt && Support::isInt16(value()); }
//! Tests whether the immediate can be casted to 16-bit unsigned integer.
- inline constexpr bool isUInt16() const noexcept { return type() == ImmType::kInt && Support::isUInt16(value()); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isUInt16() const noexcept { return type() == ImmType::kInt && Support::isUInt16(value()); }
//! Tests whether the immediate can be casted to 32-bit signed integer.
- inline constexpr bool isInt32() const noexcept { return type() == ImmType::kInt && Support::isInt32(value()); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isInt32() const noexcept { return type() == ImmType::kInt && Support::isInt32(value()); }
//! Tests whether the immediate can be casted to 32-bit unsigned integer.
- inline constexpr bool isUInt32() const noexcept { return type() == ImmType::kInt && _data[kDataImmValueHi] == 0; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isUInt32() const noexcept { return type() == ImmType::kInt && _data[kDataImmValueHi] == 0; }
//! Returns the immediate value casted to `T`.
//!
//! The value is masked before it's casted to `T` so the returned value is simply the representation of `T`
//! considering the original value's lowest bits.
template<typename T>
- inline T valueAs() const noexcept { return Support::immediateToT<T>(value()); }
+ ASMJIT_INLINE_NODEBUG T valueAs() const noexcept { return Support::immediateToT<T>(value()); }
//! Returns low 32-bit signed integer.
- inline constexpr int32_t int32Lo() const noexcept { return int32_t(_data[kDataImmValueLo]); }
+ ASMJIT_INLINE_NODEBUG constexpr int32_t int32Lo() const noexcept { return int32_t(_data[kDataImmValueLo]); }
//! Returns high 32-bit signed integer.
- inline constexpr int32_t int32Hi() const noexcept { return int32_t(_data[kDataImmValueHi]); }
+ ASMJIT_INLINE_NODEBUG constexpr int32_t int32Hi() const noexcept { return int32_t(_data[kDataImmValueHi]); }
//! Returns low 32-bit signed integer.
- inline constexpr uint32_t uint32Lo() const noexcept { return _data[kDataImmValueLo]; }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t uint32Lo() const noexcept { return _data[kDataImmValueLo]; }
//! Returns high 32-bit signed integer.
- inline constexpr uint32_t uint32Hi() const noexcept { return _data[kDataImmValueHi]; }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t uint32Hi() const noexcept { return _data[kDataImmValueHi]; }
//! Sets immediate value to `val`, the value is casted to a signed 64-bit integer.
template<typename T>
- inline void setValue(const T& val) noexcept {
+ ASMJIT_INLINE_NODEBUG void setValue(const T& val) noexcept {
_setValueInternal(Support::immediateFromT(val), std::is_floating_point<T>::value ? ImmType::kDouble : ImmType::kInt);
}
- inline void _setValueInternal(int64_t val, ImmType type) noexcept {
+ ASMJIT_INLINE_NODEBUG void _setValueInternal(int64_t val, ImmType type) noexcept {
setType(type);
_data[kDataImmValueHi] = uint32_t(uint64_t(val) >> 32);
_data[kDataImmValueLo] = uint32_t(uint64_t(val) & 0xFFFFFFFFu);
@@ -1559,22 +1837,22 @@ public:
//! \{
//! Clones the immediate operand.
- inline constexpr Imm clone() const noexcept { return Imm(*this); }
+ ASMJIT_INLINE_NODEBUG constexpr Imm clone() const noexcept { return Imm(*this); }
- inline void signExtend8Bits() noexcept { setValue(int64_t(valueAs<int8_t>())); }
- inline void signExtend16Bits() noexcept { setValue(int64_t(valueAs<int16_t>())); }
- inline void signExtend32Bits() noexcept { setValue(int64_t(valueAs<int32_t>())); }
+ ASMJIT_INLINE_NODEBUG void signExtend8Bits() noexcept { setValue(int64_t(valueAs<int8_t>())); }
+ ASMJIT_INLINE_NODEBUG void signExtend16Bits() noexcept { setValue(int64_t(valueAs<int16_t>())); }
+ ASMJIT_INLINE_NODEBUG void signExtend32Bits() noexcept { setValue(int64_t(valueAs<int32_t>())); }
- inline void zeroExtend8Bits() noexcept { setValue(valueAs<uint8_t>()); }
- inline void zeroExtend16Bits() noexcept { setValue(valueAs<uint16_t>()); }
- inline void zeroExtend32Bits() noexcept { _data[kDataImmValueHi] = 0u; }
+ ASMJIT_INLINE_NODEBUG void zeroExtend8Bits() noexcept { setValue(valueAs<uint8_t>()); }
+ ASMJIT_INLINE_NODEBUG void zeroExtend16Bits() noexcept { setValue(valueAs<uint16_t>()); }
+ ASMJIT_INLINE_NODEBUG void zeroExtend32Bits() noexcept { _data[kDataImmValueHi] = 0u; }
//! \}
};
//! Creates a new immediate operand.
template<typename T>
-static inline constexpr Imm imm(const T& val) noexcept { return Imm(val); }
+static ASMJIT_INLINE_NODEBUG constexpr Imm imm(const T& val) noexcept { return Imm(val); }
//! \}
@@ -1590,12 +1868,12 @@ namespace Support {
template<typename T, bool kIsImm>
struct ForwardOpImpl {
- static inline const T& forward(const T& value) noexcept { return value; }
+ static ASMJIT_INLINE_NODEBUG const T& forward(const T& value) noexcept { return value; }
};
template<typename T>
struct ForwardOpImpl<T, true> {
- static inline Imm forward(const T& value) noexcept { return Imm(value); }
+ static ASMJIT_INLINE_NODEBUG Imm forward(const T& value) noexcept { return Imm(value); }
};
//! Either forwards operand T or returns a new operand that wraps it if T is a type convertible to operand.
diff --git a/3rdparty/asmjit/src/asmjit/core/osutils.cpp b/3rdparty/asmjit/src/asmjit/core/osutils.cpp
index fa900bfbb4c..2d390697f89 100644
--- a/3rdparty/asmjit/src/asmjit/core/osutils.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/osutils.cpp
@@ -4,81 +4,37 @@
// SPDX-License-Identifier: Zlib
#include "../core/api-build_p.h"
-#include "../core/osutils.h"
+#include "../core/osutils_p.h"
#include "../core/support.h"
-#if defined(_WIN32)
- #include <atomic>
-#elif defined(__APPLE__)
- #include <mach/mach_time.h>
-#else
- #include <time.h>
+#if !defined(_WIN32)
+ #include <fcntl.h>
#include <unistd.h>
#endif
ASMJIT_BEGIN_NAMESPACE
-uint32_t OSUtils::getTickCount() noexcept {
-#if defined(_WIN32)
- enum HiResStatus : uint32_t {
- kHiResUnknown = 0,
- kHiResAvailable = 1,
- kHiResNotAvailable = 2
- };
+#if !defined(_WIN32)
+Error OSUtils::readFile(const char* name, String& dst, size_t maxSize) noexcept {
+ char* buffer = dst.prepare(String::ModifyOp::kAssign, maxSize);
+ if (ASMJIT_UNLIKELY(!buffer))
+ return DebugUtils::errored(kErrorOutOfMemory);
- static std::atomic<uint32_t> _hiResStatus(kHiResUnknown);
- static volatile double _hiResFreq(0);
-
- uint32_t status = _hiResStatus.load();
- LARGE_INTEGER now, qpf;
-
- if (status != kHiResNotAvailable && ::QueryPerformanceCounter(&now)) {
- double freq = _hiResFreq;
- if (status == kHiResUnknown) {
- // Detects the availability of high resolution counter.
- if (::QueryPerformanceFrequency(&qpf)) {
- freq = double(qpf.QuadPart) / 1000.0;
- _hiResFreq = freq;
- _hiResStatus.compare_exchange_strong(status, kHiResAvailable);
- status = kHiResAvailable;
- }
- else {
- // High resolution not available.
- _hiResStatus.compare_exchange_strong(status, kHiResNotAvailable);
- }
- }
-
- if (status == kHiResAvailable)
- return uint32_t(uint64_t(int64_t(double(now.QuadPart) / freq)) & 0xFFFFFFFFu);
+ int fd = ASMJIT_FILE64_API(::open)(name, O_RDONLY);
+ if (fd < 0) {
+ dst.clear();
+ return DebugUtils::errored(kErrorFailedToOpenFile);
}
- // Bail to `GetTickCount()` if we cannot use high resolution.
- return ::GetTickCount();
-#elif defined(__APPLE__)
- // See Apple's QA1398.
- static mach_timebase_info_data_t _machTime;
-
- uint32_t denom = _machTime.denom;
- if (ASMJIT_UNLIKELY(!denom)) {
- if (mach_timebase_info(&_machTime) != KERN_SUCCESS || !(denom = _machTime.denom))
- return 0;
+ intptr_t len = ::read(fd, buffer, maxSize);
+ if (len >= 0) {
+ buffer[len] = '\0';
+ dst._setSize(size_t(len));
}
- // `mach_absolute_time()` returns nanoseconds, we want milliseconds.
- uint64_t t = mach_absolute_time() / 1000000u;
- t = (t * _machTime.numer) / _machTime.denom;
- return uint32_t(t & 0xFFFFFFFFu);
-#elif defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
- struct timespec ts;
- if (ASMJIT_UNLIKELY(clock_gettime(CLOCK_MONOTONIC, &ts) != 0))
- return 0;
-
- uint64_t t = (uint64_t(ts.tv_sec ) * 1000u) + (uint64_t(ts.tv_nsec) / 1000000u);
- return uint32_t(t & 0xFFFFFFFFu);
-#else
- #pragma message("asmjit::OSUtils::getTickCount() doesn't have implementation for the target OS.")
- return 0;
-#endif
+ ::close(fd);
+ return kErrorOk;
}
+#endif
ASMJIT_END_NAMESPACE
diff --git a/3rdparty/asmjit/src/asmjit/core/osutils.h b/3rdparty/asmjit/src/asmjit/core/osutils.h
index 3c5c3d94c1e..c6588373425 100644
--- a/3rdparty/asmjit/src/asmjit/core/osutils.h
+++ b/3rdparty/asmjit/src/asmjit/core/osutils.h
@@ -13,13 +13,6 @@ ASMJIT_BEGIN_NAMESPACE
//! \addtogroup asmjit_utilities
//! \{
-//! Operating system utilities.
-namespace OSUtils {
- //! Gets the current CPU tick count, used for benchmarking (1ms resolution).
- ASMJIT_API uint32_t getTickCount() noexcept;
-};
-
-
//! \cond INTERNAL
//! Lock.
//!
@@ -46,11 +39,11 @@ public:
Handle _handle;
#endif
- ASMJIT_FORCE_INLINE Lock() noexcept;
- ASMJIT_FORCE_INLINE ~Lock() noexcept;
+ ASMJIT_INLINE_NODEBUG Lock() noexcept;
+ ASMJIT_INLINE_NODEBUG ~Lock() noexcept;
- ASMJIT_FORCE_INLINE void lock() noexcept;
- ASMJIT_FORCE_INLINE void unlock() noexcept;
+ ASMJIT_INLINE_NODEBUG void lock() noexcept;
+ ASMJIT_INLINE_NODEBUG void unlock() noexcept;
};
//! \endcond
diff --git a/3rdparty/asmjit/src/asmjit/core/osutils_p.h b/3rdparty/asmjit/src/asmjit/core/osutils_p.h
index fd87e731123..0d9d36909e8 100644
--- a/3rdparty/asmjit/src/asmjit/core/osutils_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/osutils_p.h
@@ -7,6 +7,7 @@
#define ASMJIT_CORE_OSUTILS_P_H_INCLUDED
#include "../core/osutils.h"
+#include "../core/string.h"
ASMJIT_BEGIN_NAMESPACE
@@ -20,30 +21,30 @@ ASMJIT_BEGIN_NAMESPACE
static_assert(sizeof(Lock::Handle) == sizeof(CRITICAL_SECTION), "asmjit::Lock::Handle layout must match CRITICAL_SECTION");
static_assert(alignof(Lock::Handle) == alignof(CRITICAL_SECTION), "asmjit::Lock::Handle alignment must match CRITICAL_SECTION");
-ASMJIT_FORCE_INLINE Lock::Lock() noexcept { InitializeCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&_handle)); }
-ASMJIT_FORCE_INLINE Lock::~Lock() noexcept { DeleteCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&_handle)); }
-ASMJIT_FORCE_INLINE void Lock::lock() noexcept { EnterCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&_handle)); }
-ASMJIT_FORCE_INLINE void Lock::unlock() noexcept { LeaveCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&_handle)); }
+ASMJIT_INLINE_NODEBUG Lock::Lock() noexcept { InitializeCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&_handle)); }
+ASMJIT_INLINE_NODEBUG Lock::~Lock() noexcept { DeleteCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&_handle)); }
+ASMJIT_INLINE_NODEBUG void Lock::lock() noexcept { EnterCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&_handle)); }
+ASMJIT_INLINE_NODEBUG void Lock::unlock() noexcept { LeaveCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&_handle)); }
#elif !defined(__EMSCRIPTEN__)
// PThread implementation.
#ifdef PTHREAD_MUTEX_INITIALIZER
-ASMJIT_FORCE_INLINE Lock::Lock() noexcept : _handle(PTHREAD_MUTEX_INITIALIZER) {}
+ASMJIT_INLINE_NODEBUG Lock::Lock() noexcept : _handle(PTHREAD_MUTEX_INITIALIZER) {}
#else
-ASMJIT_FORCE_INLINE Lock::Lock() noexcept { pthread_mutex_init(&_handle, nullptr); }
+ASMJIT_INLINE_NODEBUG Lock::Lock() noexcept { pthread_mutex_init(&_handle, nullptr); }
#endif
-ASMJIT_FORCE_INLINE Lock::~Lock() noexcept { pthread_mutex_destroy(&_handle); }
-ASMJIT_FORCE_INLINE void Lock::lock() noexcept { pthread_mutex_lock(&_handle); }
-ASMJIT_FORCE_INLINE void Lock::unlock() noexcept { pthread_mutex_unlock(&_handle); }
+ASMJIT_INLINE_NODEBUG Lock::~Lock() noexcept { pthread_mutex_destroy(&_handle); }
+ASMJIT_INLINE_NODEBUG void Lock::lock() noexcept { pthread_mutex_lock(&_handle); }
+ASMJIT_INLINE_NODEBUG void Lock::unlock() noexcept { pthread_mutex_unlock(&_handle); }
#else
// Dummy implementation - Emscripten or other unsupported platform.
-ASMJIT_FORCE_INLINE Lock::Lock() noexcept {}
-ASMJIT_FORCE_INLINE Lock::~Lock() noexcept {}
-ASMJIT_FORCE_INLINE void Lock::lock() noexcept {}
-ASMJIT_FORCE_INLINE void Lock::unlock() noexcept {}
+ASMJIT_INLINE_NODEBUG Lock::Lock() noexcept {}
+ASMJIT_INLINE_NODEBUG Lock::~Lock() noexcept {}
+ASMJIT_INLINE_NODEBUG void Lock::lock() noexcept {}
+ASMJIT_INLINE_NODEBUG void Lock::unlock() noexcept {}
#endif
@@ -54,11 +55,20 @@ public:
Lock& _target;
- inline LockGuard(Lock& target) noexcept
+ ASMJIT_INLINE_NODEBUG LockGuard(Lock& target) noexcept
: _target(target) { _target.lock(); }
- inline ~LockGuard() noexcept { _target.unlock(); }
+ ASMJIT_INLINE_NODEBUG ~LockGuard() noexcept { _target.unlock(); }
};
+#if !defined(_WIN32)
+namespace OSUtils {
+
+//! Reads a file, only used on non-Windows platforms to access /sys or other files when necessary.
+Error readFile(const char* name, String& dst, size_t maxSize) noexcept;
+
+} // {OSUtils}
+#endif
+
//! \}
//! \endcond
diff --git a/3rdparty/asmjit/src/asmjit/core/raassignment_p.h b/3rdparty/asmjit/src/asmjit/core/raassignment_p.h
index 54183293111..0865ece7548 100644
--- a/3rdparty/asmjit/src/asmjit/core/raassignment_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/raassignment_p.h
@@ -66,7 +66,7 @@ public:
//! PhysReg to WorkReg mapping.
uint32_t workIds[1 /* ... */];
- static inline size_t sizeOf(size_t count) noexcept {
+ static ASMJIT_INLINE_NODEBUG size_t sizeOf(size_t count) noexcept {
return sizeof(PhysToWorkMap) - sizeof(uint32_t) + count * sizeof(uint32_t);
}
@@ -163,16 +163,16 @@ public:
//! \name Accessors
//! \{
- inline PhysToWorkMap* physToWorkMap() const noexcept { return _physToWorkMap; }
- inline WorkToPhysMap* workToPhysMap() const noexcept { return _workToPhysMap; }
+ ASMJIT_INLINE_NODEBUG PhysToWorkMap* physToWorkMap() const noexcept { return _physToWorkMap; }
+ ASMJIT_INLINE_NODEBUG WorkToPhysMap* workToPhysMap() const noexcept { return _workToPhysMap; }
- inline RARegMask& assigned() noexcept { return _physToWorkMap->assigned; }
- inline const RARegMask& assigned() const noexcept { return _physToWorkMap->assigned; }
- inline uint32_t assigned(RegGroup group) const noexcept { return _physToWorkMap->assigned[group]; }
+ ASMJIT_INLINE_NODEBUG RARegMask& assigned() noexcept { return _physToWorkMap->assigned; }
+ ASMJIT_INLINE_NODEBUG const RARegMask& assigned() const noexcept { return _physToWorkMap->assigned; }
+ ASMJIT_INLINE_NODEBUG uint32_t assigned(RegGroup group) const noexcept { return _physToWorkMap->assigned[group]; }
- inline RARegMask& dirty() noexcept { return _physToWorkMap->dirty; }
- inline const RARegMask& dirty() const noexcept { return _physToWorkMap->dirty; }
- inline RegMask dirty(RegGroup group) const noexcept { return _physToWorkMap->dirty[group]; }
+ ASMJIT_INLINE_NODEBUG RARegMask& dirty() noexcept { return _physToWorkMap->dirty; }
+ ASMJIT_INLINE_NODEBUG const RARegMask& dirty() const noexcept { return _physToWorkMap->dirty; }
+ ASMJIT_INLINE_NODEBUG RegMask dirty(RegGroup group) const noexcept { return _physToWorkMap->dirty[group]; }
inline uint32_t workToPhysId(RegGroup group, uint32_t workId) const noexcept {
DebugUtils::unused(group);
diff --git a/3rdparty/asmjit/src/asmjit/core/rabuilders_p.h b/3rdparty/asmjit/src/asmjit/core/rabuilders_p.h
index 1b763030c45..9d9b4282d2b 100644
--- a/3rdparty/asmjit/src/asmjit/core/rabuilders_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/rabuilders_p.h
@@ -401,7 +401,7 @@ public:
if (node->type() == NodeType::kSentinel) {
if (node == _funcNode->endNode()) {
// Make sure we didn't flow here if this is the end of the function sentinel.
- if (ASMJIT_UNLIKELY(_curBlock))
+ if (ASMJIT_UNLIKELY(_curBlock && _hasCode))
return DebugUtils::errored(kErrorInvalidState);
break;
}
diff --git a/3rdparty/asmjit/src/asmjit/core/radefs_p.h b/3rdparty/asmjit/src/asmjit/core/radefs_p.h
index 15c50ff728c..32503961068 100644
--- a/3rdparty/asmjit/src/asmjit/core/radefs_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/radefs_p.h
@@ -67,7 +67,7 @@ public:
uint32_t registerCount = arch == Arch::kX86 ? 8 : 16;
_availableRegs[RegGroup::kGp] = Support::lsbMask<RegMask>(registerCount) & ~Support::bitMask(4u);
_availableRegs[RegGroup::kVec] = Support::lsbMask<RegMask>(registerCount);
- _availableRegs[RegGroup::kExtraVirt2] = Support::lsbMask<RegMask>(8);
+ _availableRegs[RegGroup::kMask] = Support::lsbMask<RegMask>(8);
_availableRegs[RegGroup::kExtraVirt3] = Support::lsbMask<RegMask>(8);
return kErrorOk;
}
@@ -75,7 +75,7 @@ public:
case Arch::kAArch64: {
_availableRegs[RegGroup::kGp] = 0xFFFFFFFFu & ~Support::bitMask(18, 31u);
_availableRegs[RegGroup::kVec] = 0xFFFFFFFFu;
- _availableRegs[RegGroup::kExtraVirt2] = 0;
+ _availableRegs[RegGroup::kMask] = 0;
_availableRegs[RegGroup::kExtraVirt3] = 0;
return kErrorOk;
}
@@ -115,20 +115,20 @@ struct RAStrategy {
//! \name Accessors
//! \{
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_type = RAStrategyType::kSimple;
_flags = RAStrategyFlags::kNone;
}
- inline RAStrategyType type() const noexcept { return _type; }
- inline void setType(RAStrategyType type) noexcept { _type = type; }
+ ASMJIT_INLINE_NODEBUG RAStrategyType type() const noexcept { return _type; }
+ ASMJIT_INLINE_NODEBUG void setType(RAStrategyType type) noexcept { _type = type; }
- inline bool isSimple() const noexcept { return _type == RAStrategyType::kSimple; }
- inline bool isComplex() const noexcept { return _type >= RAStrategyType::kComplex; }
+ ASMJIT_INLINE_NODEBUG bool isSimple() const noexcept { return _type == RAStrategyType::kSimple; }
+ ASMJIT_INLINE_NODEBUG bool isComplex() const noexcept { return _type >= RAStrategyType::kComplex; }
- inline RAStrategyFlags flags() const noexcept { return _flags; }
- inline bool hasFlag(RAStrategyFlags flag) const noexcept { return Support::test(_flags, flag); }
- inline void addFlags(RAStrategyFlags flags) noexcept { _flags |= flags; }
+ ASMJIT_INLINE_NODEBUG RAStrategyFlags flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(RAStrategyFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG void addFlags(RAStrategyFlags flags) noexcept { _flags |= flags; }
//! \}
};
@@ -153,7 +153,7 @@ struct RARegCount {
//! \{
//! Resets all counters to zero.
- inline void reset() noexcept { _packed = 0; }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _packed = 0; }
//! \}
@@ -170,8 +170,8 @@ struct RARegCount {
return _regs[size_t(group)];
}
- inline bool operator==(const RARegCount& other) const noexcept { return _packed == other._packed; }
- inline bool operator!=(const RARegCount& other) const noexcept { return _packed != other._packed; }
+ ASMJIT_INLINE_NODEBUG bool operator==(const RARegCount& other) const noexcept { return _packed == other._packed; }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const RARegCount& other) const noexcept { return _packed != other._packed; }
//! \}
@@ -233,17 +233,17 @@ struct RARegMask {
//! \name Construction & Destruction
//! \{
- inline void init(const RARegMask& other) noexcept { _masks = other._masks; }
+ ASMJIT_INLINE_NODEBUG void init(const RARegMask& other) noexcept { _masks = other._masks; }
//! Reset all register masks to zero.
- inline void reset() noexcept { _masks.fill(0); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _masks.fill(0); }
//! \}
//! \name Overloaded Operators
//! \{
- inline bool operator==(const RARegMask& other) const noexcept { return _masks == other._masks; }
- inline bool operator!=(const RARegMask& other) const noexcept { return _masks != other._masks; }
+ ASMJIT_INLINE_NODEBUG bool operator==(const RARegMask& other) const noexcept { return _masks == other._masks; }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const RARegMask& other) const noexcept { return _masks != other._masks; }
template<typename Index>
inline uint32_t& operator[](const Index& index) noexcept { return _masks[index]; }
@@ -315,20 +315,20 @@ public:
//! \name Accessors
//! \{
- inline void reset() noexcept { _packed = 0; }
- inline void combineWith(const RARegsStats& other) noexcept { _packed |= other._packed; }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _packed = 0; }
+ ASMJIT_INLINE_NODEBUG void combineWith(const RARegsStats& other) noexcept { _packed |= other._packed; }
- inline bool hasUsed() const noexcept { return (_packed & kMaskUsed) != 0u; }
- inline bool hasUsed(RegGroup group) const noexcept { return (_packed & Support::bitMask(kIndexUsed + uint32_t(group))) != 0u; }
- inline void makeUsed(RegGroup group) noexcept { _packed |= Support::bitMask(kIndexUsed + uint32_t(group)); }
+ ASMJIT_INLINE_NODEBUG bool hasUsed() const noexcept { return (_packed & kMaskUsed) != 0u; }
+ ASMJIT_INLINE_NODEBUG bool hasUsed(RegGroup group) const noexcept { return (_packed & Support::bitMask(kIndexUsed + uint32_t(group))) != 0u; }
+ ASMJIT_INLINE_NODEBUG void makeUsed(RegGroup group) noexcept { _packed |= Support::bitMask(kIndexUsed + uint32_t(group)); }
- inline bool hasFixed() const noexcept { return (_packed & kMaskFixed) != 0u; }
- inline bool hasFixed(RegGroup group) const noexcept { return (_packed & Support::bitMask(kIndexFixed + uint32_t(group))) != 0u; }
- inline void makeFixed(RegGroup group) noexcept { _packed |= Support::bitMask(kIndexFixed + uint32_t(group)); }
+ ASMJIT_INLINE_NODEBUG bool hasFixed() const noexcept { return (_packed & kMaskFixed) != 0u; }
+ ASMJIT_INLINE_NODEBUG bool hasFixed(RegGroup group) const noexcept { return (_packed & Support::bitMask(kIndexFixed + uint32_t(group))) != 0u; }
+ ASMJIT_INLINE_NODEBUG void makeFixed(RegGroup group) noexcept { _packed |= Support::bitMask(kIndexFixed + uint32_t(group)); }
- inline bool hasClobbered() const noexcept { return (_packed & kMaskClobbered) != 0u; }
- inline bool hasClobbered(RegGroup group) const noexcept { return (_packed & Support::bitMask(kIndexClobbered + uint32_t(group))) != 0u; }
- inline void makeClobbered(RegGroup group) noexcept { _packed |= Support::bitMask(kIndexClobbered + uint32_t(group)); }
+ ASMJIT_INLINE_NODEBUG bool hasClobbered() const noexcept { return (_packed & kMaskClobbered) != 0u; }
+ ASMJIT_INLINE_NODEBUG bool hasClobbered(RegGroup group) const noexcept { return (_packed & Support::bitMask(kIndexClobbered + uint32_t(group))) != 0u; }
+ ASMJIT_INLINE_NODEBUG void makeClobbered(RegGroup group) noexcept { _packed |= Support::bitMask(kIndexClobbered + uint32_t(group)); }
//! \}
};
@@ -346,18 +346,18 @@ public:
//! \name Construction & Destruction
//! \{
- inline RALiveCount() noexcept = default;
- inline RALiveCount(const RALiveCount& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG RALiveCount() noexcept = default;
+ ASMJIT_INLINE_NODEBUG RALiveCount(const RALiveCount& other) noexcept = default;
- inline void init(const RALiveCount& other) noexcept { n = other.n; }
- inline void reset() noexcept { n.fill(0); }
+ ASMJIT_INLINE_NODEBUG void init(const RALiveCount& other) noexcept { n = other.n; }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { n.fill(0); }
//! \}
//! \name Overloaded Operators
//! \{
- inline RALiveCount& operator=(const RALiveCount& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG RALiveCount& operator=(const RALiveCount& other) noexcept = default;
inline uint32_t& operator[](RegGroup group) noexcept { return n[group]; }
inline const uint32_t& operator[](RegGroup group) const noexcept { return n[group]; }
@@ -394,31 +394,31 @@ struct RALiveInterval {
//! \name Construction & Destruction
//! \{
- inline RALiveInterval() noexcept : a(0), b(0) {}
- inline RALiveInterval(uint32_t a, uint32_t b) noexcept : a(a), b(b) {}
- inline RALiveInterval(const RALiveInterval& other) noexcept : a(other.a), b(other.b) {}
+ ASMJIT_INLINE_NODEBUG RALiveInterval() noexcept : a(0), b(0) {}
+ ASMJIT_INLINE_NODEBUG RALiveInterval(uint32_t a, uint32_t b) noexcept : a(a), b(b) {}
+ ASMJIT_INLINE_NODEBUG RALiveInterval(const RALiveInterval& other) noexcept : a(other.a), b(other.b) {}
- inline void init(uint32_t aVal, uint32_t bVal) noexcept {
+ ASMJIT_INLINE_NODEBUG void init(uint32_t aVal, uint32_t bVal) noexcept {
a = aVal;
b = bVal;
}
- inline void init(const RALiveInterval& other) noexcept { init(other.a, other.b); }
- inline void reset() noexcept { init(0, 0); }
+ ASMJIT_INLINE_NODEBUG void init(const RALiveInterval& other) noexcept { init(other.a, other.b); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { init(0, 0); }
//! \}
//! \name Overloaded Operators
//! \{
- inline RALiveInterval& operator=(const RALiveInterval& other) = default;
+ ASMJIT_INLINE_NODEBUG RALiveInterval& operator=(const RALiveInterval& other) = default;
//! \}
//! \name Accessors
//! \{
- inline bool isValid() const noexcept { return a < b; }
- inline uint32_t width() const noexcept { return b - a; }
+ ASMJIT_INLINE_NODEBUG bool isValid() const noexcept { return a < b; }
+ ASMJIT_INLINE_NODEBUG uint32_t width() const noexcept { return b - a; }
//! \}
};
@@ -437,23 +437,23 @@ public:
//! \name Construction & Destruction
//! \{
- inline RALiveSpan() noexcept : RALiveInterval(), T() {}
- inline RALiveSpan(const RALiveSpan<T>& other) noexcept : RALiveInterval(other), T() {}
- inline RALiveSpan(const RALiveInterval& interval, const T& data) noexcept : RALiveInterval(interval), T(data) {}
- inline RALiveSpan(uint32_t a, uint32_t b) noexcept : RALiveInterval(a, b), T() {}
- inline RALiveSpan(uint32_t a, uint32_t b, const T& data) noexcept : RALiveInterval(a, b), T(data) {}
+ ASMJIT_INLINE_NODEBUG RALiveSpan() noexcept : RALiveInterval(), T() {}
+ ASMJIT_INLINE_NODEBUG RALiveSpan(const RALiveSpan<T>& other) noexcept : RALiveInterval(other), T() {}
+ ASMJIT_INLINE_NODEBUG RALiveSpan(const RALiveInterval& interval, const T& data) noexcept : RALiveInterval(interval), T(data) {}
+ ASMJIT_INLINE_NODEBUG RALiveSpan(uint32_t a, uint32_t b) noexcept : RALiveInterval(a, b), T() {}
+ ASMJIT_INLINE_NODEBUG RALiveSpan(uint32_t a, uint32_t b, const T& data) noexcept : RALiveInterval(a, b), T(data) {}
- inline void init(const RALiveSpan<T>& other) noexcept {
+ ASMJIT_INLINE_NODEBUG void init(const RALiveSpan<T>& other) noexcept {
RALiveInterval::init(static_cast<const RALiveInterval&>(other));
T::init(static_cast<const T&>(other));
}
- inline void init(const RALiveSpan<T>& span, const T& data) noexcept {
+ ASMJIT_INLINE_NODEBUG void init(const RALiveSpan<T>& span, const T& data) noexcept {
RALiveInterval::init(static_cast<const RALiveInterval&>(span));
T::init(data);
}
- inline void init(const RALiveInterval& interval, const T& data) noexcept {
+ ASMJIT_INLINE_NODEBUG void init(const RALiveInterval& interval, const T& data) noexcept {
RALiveInterval::init(interval);
T::init(data);
}
@@ -463,7 +463,7 @@ public:
//! \name Overloaded Operators
//! \{
- inline RALiveSpan& operator=(const RALiveSpan& other) {
+ ASMJIT_INLINE_NODEBUG RALiveSpan& operator=(const RALiveSpan& other) {
init(other);
return *this;
}
@@ -483,23 +483,23 @@ public:
//! \name Construction & Destruction
//! \{
- inline RALiveSpans() noexcept : _data() {}
+ ASMJIT_INLINE_NODEBUG RALiveSpans() noexcept : _data() {}
- inline void reset() noexcept { _data.reset(); }
- inline void release(ZoneAllocator* allocator) noexcept { _data.release(allocator); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _data.reset(); }
+ ASMJIT_INLINE_NODEBUG void release(ZoneAllocator* allocator) noexcept { _data.release(allocator); }
//! \}
//! \name Accessors
//! \{
- inline bool empty() const noexcept { return _data.empty(); }
- inline uint32_t size() const noexcept { return _data.size(); }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _data.empty(); }
+ ASMJIT_INLINE_NODEBUG uint32_t size() const noexcept { return _data.size(); }
- inline T* data() noexcept { return _data.data(); }
- inline const T* data() const noexcept { return _data.data(); }
+ ASMJIT_INLINE_NODEBUG T* data() noexcept { return _data.data(); }
+ ASMJIT_INLINE_NODEBUG const T* data() const noexcept { return _data.data(); }
- inline bool isOpen() const noexcept {
+ ASMJIT_INLINE_NODEBUG bool isOpen() const noexcept {
uint32_t size = _data.size();
return size > 0 && _data[size - 1].b == RALiveInterval::kInf;
}
@@ -509,7 +509,7 @@ public:
//! \name Utilities
//! \{
- inline void swap(RALiveSpans<T>& other) noexcept { _data.swap(other._data); }
+ ASMJIT_INLINE_NODEBUG void swap(RALiveSpans<T>& other) noexcept { _data.swap(other._data); }
//! Open the current live span.
ASMJIT_FORCE_INLINE Error openAt(ZoneAllocator* allocator, uint32_t start, uint32_t end) noexcept {
@@ -550,16 +550,16 @@ public:
return width;
}
- inline T& operator[](uint32_t index) noexcept { return _data[index]; }
- inline const T& operator[](uint32_t index) const noexcept { return _data[index]; }
+ ASMJIT_INLINE_NODEBUG T& operator[](uint32_t index) noexcept { return _data[index]; }
+ ASMJIT_INLINE_NODEBUG const T& operator[](uint32_t index) const noexcept { return _data[index]; }
- inline bool intersects(const RALiveSpans<T>& other) const noexcept {
+ ASMJIT_INLINE_NODEBUG bool intersects(const RALiveSpans<T>& other) const noexcept {
return intersects(*this, other);
}
ASMJIT_FORCE_INLINE Error nonOverlappingUnionOf(ZoneAllocator* allocator, const RALiveSpans<T>& x, const RALiveSpans<T>& y, const DataType& yData) noexcept {
uint32_t finalSize = x.size() + y.size();
- ASMJIT_PROPAGATE(_data.reserve(allocator, finalSize));
+ ASMJIT_PROPAGATE(_data.growingReserve(allocator, finalSize));
T* dstPtr = _data.data();
const T* xSpan = x.data();
@@ -655,9 +655,9 @@ public:
//! \name Accessors
//! \{
- inline uint32_t width() const noexcept { return _width; }
- inline float freq() const noexcept { return _freq; }
- inline float priority() const noexcept { return _priority; }
+ ASMJIT_INLINE_NODEBUG uint32_t width() const noexcept { return _width; }
+ ASMJIT_INLINE_NODEBUG float freq() const noexcept { return _freq; }
+ ASMJIT_INLINE_NODEBUG float priority() const noexcept { return _priority; }
//! \}
};
@@ -665,13 +665,13 @@ public:
struct LiveRegData {
uint32_t id;
- inline explicit LiveRegData(uint32_t id = BaseReg::kIdBad) noexcept : id(id) {}
- inline LiveRegData(const LiveRegData& other) noexcept : id(other.id) {}
+ ASMJIT_INLINE_NODEBUG explicit LiveRegData(uint32_t id = BaseReg::kIdBad) noexcept : id(id) {}
+ ASMJIT_INLINE_NODEBUG LiveRegData(const LiveRegData& other) noexcept = default;
- inline void init(const LiveRegData& other) noexcept { id = other.id; }
+ ASMJIT_INLINE_NODEBUG void init(const LiveRegData& other) noexcept { id = other.id; }
- inline bool operator==(const LiveRegData& other) const noexcept { return id == other.id; }
- inline bool operator!=(const LiveRegData& other) const noexcept { return id != other.id; }
+ ASMJIT_INLINE_NODEBUG bool operator==(const LiveRegData& other) const noexcept { return id == other.id; }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const LiveRegData& other) const noexcept { return id != other.id; }
};
typedef RALiveSpan<LiveRegData> LiveRegSpan;
@@ -694,7 +694,7 @@ typedef RALiveSpans<LiveRegSpan> LiveRegSpans;
//! - LEA x{ W|Out}, [x{R|Use} + y{R|Out}] -> {x:R|W|Use|Out y:R|Use}
//!
//! It should be obvious from the example above how these flags get created. Each operand contains READ/WRITE
-//! information, which is then merged to RATiedReg's flags. However, we also need to represent the possitility
+//! information, which is then merged to RATiedReg's flags. However, we also need to represent the possibility
//! to view the operation as two independent operations - USE and OUT, because the register allocator first
//! allocates USE registers, and then assigns OUT registers independently of USE registers.
enum class RATiedFlags : uint32_t {
@@ -740,6 +740,11 @@ enum class RATiedFlags : uint32_t {
kLeadConsecutive = 0x00001000u,
kConsecutiveData = 0x00006000u,
+ // Other Constraints
+ // -----------------
+
+ kUnique = 0x00008000u,
+
// Liveness Flags
// --------------
@@ -762,6 +767,12 @@ enum class RATiedFlags : uint32_t {
// Instruction Flags (Never used by RATiedReg)
// -------------------------------------------
+ //! Instruction has been patched to address a memory location instead of a register.
+ //!
+ //! This is currently only possible on X86 or X86_64 targets. It informs rewriter to rewrite the instruction if
+ //! necessary.
+ kInst_RegToMemPatched = 0x40000000u,
+
//! Instruction is transformable to another instruction if necessary.
//!
//! This is flag that is only used by \ref RAInst to inform register allocator that the instruction has some
@@ -853,51 +864,54 @@ struct RATiedReg {
//! \{
//! Returns the associated WorkReg id.
- inline uint32_t workId() const noexcept { return _workId; }
+ ASMJIT_INLINE_NODEBUG uint32_t workId() const noexcept { return _workId; }
- inline bool hasConsecutiveParent() const noexcept { return _consecutiveParent != Globals::kInvalidId; }
- inline uint32_t consecutiveParent() const noexcept { return _consecutiveParent; }
- inline uint32_t consecutiveData() const noexcept { return consecutiveDataFromFlags(_flags); }
+ ASMJIT_INLINE_NODEBUG bool hasConsecutiveParent() const noexcept { return _consecutiveParent != Globals::kInvalidId; }
+ ASMJIT_INLINE_NODEBUG uint32_t consecutiveParent() const noexcept { return _consecutiveParent; }
+ ASMJIT_INLINE_NODEBUG uint32_t consecutiveData() const noexcept { return consecutiveDataFromFlags(_flags); }
//! Returns TiedReg flags.
- inline RATiedFlags flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG RATiedFlags flags() const noexcept { return _flags; }
//! Checks if the given `flag` is set.
- inline bool hasFlag(RATiedFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(RATiedFlags flag) const noexcept { return Support::test(_flags, flag); }
//! Adds tied register flags.
- inline void addFlags(RATiedFlags flags) noexcept { _flags |= flags; }
+ ASMJIT_INLINE_NODEBUG void addFlags(RATiedFlags flags) noexcept { _flags |= flags; }
//! Tests whether the register is read (writes `true` also if it's Read/Write).
- inline bool isRead() const noexcept { return hasFlag(RATiedFlags::kRead); }
+ ASMJIT_INLINE_NODEBUG bool isRead() const noexcept { return hasFlag(RATiedFlags::kRead); }
//! Tests whether the register is written (writes `true` also if it's Read/Write).
- inline bool isWrite() const noexcept { return hasFlag(RATiedFlags::kWrite); }
+ ASMJIT_INLINE_NODEBUG bool isWrite() const noexcept { return hasFlag(RATiedFlags::kWrite); }
//! Tests whether the register is read only.
- inline bool isReadOnly() const noexcept { return (_flags & RATiedFlags::kRW) == RATiedFlags::kRead; }
+ ASMJIT_INLINE_NODEBUG bool isReadOnly() const noexcept { return (_flags & RATiedFlags::kRW) == RATiedFlags::kRead; }
//! Tests whether the register is write only.
- inline bool isWriteOnly() const noexcept { return (_flags & RATiedFlags::kRW) == RATiedFlags::kWrite; }
+ ASMJIT_INLINE_NODEBUG bool isWriteOnly() const noexcept { return (_flags & RATiedFlags::kRW) == RATiedFlags::kWrite; }
//! Tests whether the register is read and written.
- inline bool isReadWrite() const noexcept { return (_flags & RATiedFlags::kRW) == RATiedFlags::kRW; }
+ ASMJIT_INLINE_NODEBUG bool isReadWrite() const noexcept { return (_flags & RATiedFlags::kRW) == RATiedFlags::kRW; }
//! Tests whether the tied register has use operand (Read/ReadWrite).
- inline bool isUse() const noexcept { return hasFlag(RATiedFlags::kUse); }
+ ASMJIT_INLINE_NODEBUG bool isUse() const noexcept { return hasFlag(RATiedFlags::kUse); }
//! Tests whether the tied register has out operand (Write).
- inline bool isOut() const noexcept { return hasFlag(RATiedFlags::kOut); }
+ ASMJIT_INLINE_NODEBUG bool isOut() const noexcept { return hasFlag(RATiedFlags::kOut); }
//! Tests whether the tied register has \ref RATiedFlags::kLeadConsecutive flag set.
- inline bool isLeadConsecutive() const noexcept { return hasFlag(RATiedFlags::kLeadConsecutive); }
+ ASMJIT_INLINE_NODEBUG bool isLeadConsecutive() const noexcept { return hasFlag(RATiedFlags::kLeadConsecutive); }
//! Tests whether the tied register has \ref RATiedFlags::kUseConsecutive flag set.
- inline bool isUseConsecutive() const noexcept { return hasFlag(RATiedFlags::kUseConsecutive); }
+ ASMJIT_INLINE_NODEBUG bool isUseConsecutive() const noexcept { return hasFlag(RATiedFlags::kUseConsecutive); }
//! Tests whether the tied register has \ref RATiedFlags::kOutConsecutive flag set.
- inline bool isOutConsecutive() const noexcept { return hasFlag(RATiedFlags::kOutConsecutive); }
+ ASMJIT_INLINE_NODEBUG bool isOutConsecutive() const noexcept { return hasFlag(RATiedFlags::kOutConsecutive); }
+
+ //! Tests whether the tied register must be unique (cannot be allocated to any other allocated register).
+ ASMJIT_INLINE_NODEBUG bool isUnique() const noexcept { return hasFlag(RATiedFlags::kUnique); }
//! Tests whether the tied register has any consecutive flag.
- inline bool hasAnyConsecutiveFlag() const noexcept { return hasFlag(RATiedFlags::kLeadConsecutive | RATiedFlags::kUseConsecutive | RATiedFlags::kOutConsecutive); }
+ ASMJIT_INLINE_NODEBUG bool hasAnyConsecutiveFlag() const noexcept { return hasFlag(RATiedFlags::kLeadConsecutive | RATiedFlags::kUseConsecutive | RATiedFlags::kOutConsecutive); }
//! Tests whether the USE slot can be patched to memory operand.
- inline bool hasUseRM() const noexcept { return hasFlag(RATiedFlags::kUseRM); }
+ ASMJIT_INLINE_NODEBUG bool hasUseRM() const noexcept { return hasFlag(RATiedFlags::kUseRM); }
//! Tests whether the OUT slot can be patched to memory operand.
- inline bool hasOutRM() const noexcept { return hasFlag(RATiedFlags::kOutRM); }
+ ASMJIT_INLINE_NODEBUG bool hasOutRM() const noexcept { return hasFlag(RATiedFlags::kOutRM); }
- inline uint32_t rmSize() const noexcept { return _rmSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t rmSize() const noexcept { return _rmSize; }
inline void makeReadOnly() noexcept {
_flags = (_flags & ~(RATiedFlags::kOut | RATiedFlags::kWrite)) | RATiedFlags::kUse;
@@ -912,47 +926,47 @@ struct RATiedReg {
}
//! Tests whether the register would duplicate.
- inline bool isDuplicate() const noexcept { return hasFlag(RATiedFlags::kDuplicate); }
+ ASMJIT_INLINE_NODEBUG bool isDuplicate() const noexcept { return hasFlag(RATiedFlags::kDuplicate); }
//! Tests whether the register (and the instruction it's part of) appears last in the basic block.
- inline bool isLast() const noexcept { return hasFlag(RATiedFlags::kLast); }
+ ASMJIT_INLINE_NODEBUG bool isLast() const noexcept { return hasFlag(RATiedFlags::kLast); }
//! Tests whether the register should be killed after USEd and/or OUTed.
- inline bool isKill() const noexcept { return hasFlag(RATiedFlags::kKill); }
+ ASMJIT_INLINE_NODEBUG bool isKill() const noexcept { return hasFlag(RATiedFlags::kKill); }
//! Tests whether the register is OUT or KILL (used internally by local register allocator).
- inline bool isOutOrKill() const noexcept { return hasFlag(RATiedFlags::kOut | RATiedFlags::kKill); }
+ ASMJIT_INLINE_NODEBUG bool isOutOrKill() const noexcept { return hasFlag(RATiedFlags::kOut | RATiedFlags::kKill); }
//! Returns a register mask that describes allocable USE registers (Read/ReadWrite access).
- inline RegMask useRegMask() const noexcept { return _useRegMask; }
+ ASMJIT_INLINE_NODEBUG RegMask useRegMask() const noexcept { return _useRegMask; }
//! Returns a register mask that describes allocable OUT registers (WriteOnly access).
- inline RegMask outRegMask() const noexcept { return _outRegMask; }
+ ASMJIT_INLINE_NODEBUG RegMask outRegMask() const noexcept { return _outRegMask; }
- inline uint32_t refCount() const noexcept { return _refCount; }
- inline void addRefCount(uint32_t n = 1) noexcept { _refCount = uint8_t(_refCount + n); }
+ ASMJIT_INLINE_NODEBUG uint32_t refCount() const noexcept { return _refCount; }
+ ASMJIT_INLINE_NODEBUG void addRefCount(uint32_t n = 1) noexcept { _refCount = uint8_t(_refCount + n); }
//! Tests whether the register must be allocated to a fixed physical register before it's used.
- inline bool hasUseId() const noexcept { return _useId != BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG bool hasUseId() const noexcept { return _useId != BaseReg::kIdBad; }
//! Tests whether the register must be allocated to a fixed physical register before it's written.
- inline bool hasOutId() const noexcept { return _outId != BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG bool hasOutId() const noexcept { return _outId != BaseReg::kIdBad; }
//! Returns a physical register id used for 'use' operation.
- inline uint32_t useId() const noexcept { return _useId; }
+ ASMJIT_INLINE_NODEBUG uint32_t useId() const noexcept { return _useId; }
//! Returns a physical register id used for 'out' operation.
- inline uint32_t outId() const noexcept { return _outId; }
+ ASMJIT_INLINE_NODEBUG uint32_t outId() const noexcept { return _outId; }
- inline uint32_t useRewriteMask() const noexcept { return _useRewriteMask; }
- inline uint32_t outRewriteMask() const noexcept { return _outRewriteMask; }
+ ASMJIT_INLINE_NODEBUG uint32_t useRewriteMask() const noexcept { return _useRewriteMask; }
+ ASMJIT_INLINE_NODEBUG uint32_t outRewriteMask() const noexcept { return _outRewriteMask; }
//! Sets a physical register used for 'use' operation.
- inline void setUseId(uint32_t index) noexcept { _useId = uint8_t(index); }
+ ASMJIT_INLINE_NODEBUG void setUseId(uint32_t index) noexcept { _useId = uint8_t(index); }
//! Sets a physical register used for 'out' operation.
- inline void setOutId(uint32_t index) noexcept { _outId = uint8_t(index); }
+ ASMJIT_INLINE_NODEBUG void setOutId(uint32_t index) noexcept { _outId = uint8_t(index); }
- inline bool isUseDone() const noexcept { return hasFlag(RATiedFlags::kUseDone); }
- inline bool isOutDone() const noexcept { return hasFlag(RATiedFlags::kUseDone); }
+ ASMJIT_INLINE_NODEBUG bool isUseDone() const noexcept { return hasFlag(RATiedFlags::kUseDone); }
+ ASMJIT_INLINE_NODEBUG bool isOutDone() const noexcept { return hasFlag(RATiedFlags::kUseDone); }
- inline void markUseDone() noexcept { addFlags(RATiedFlags::kUseDone); }
- inline void markOutDone() noexcept { addFlags(RATiedFlags::kUseDone); }
+ ASMJIT_INLINE_NODEBUG void markUseDone() noexcept { addFlags(RATiedFlags::kUseDone); }
+ ASMJIT_INLINE_NODEBUG void markOutDone() noexcept { addFlags(RATiedFlags::kUseDone); }
//! \}
};
@@ -1082,7 +1096,7 @@ public:
//! \name Construction & Destruction
//! \{
- inline RAWorkReg(VirtReg* vReg, uint32_t workId) noexcept
+ ASMJIT_INLINE_NODEBUG RAWorkReg(VirtReg* vReg, uint32_t workId) noexcept
: _workId(workId),
_virtId(vReg->id()),
_virtReg(vReg),
@@ -1093,97 +1107,97 @@ public:
//! \name Accessors
//! \{
- inline uint32_t workId() const noexcept { return _workId; }
- inline uint32_t virtId() const noexcept { return _virtId; }
+ ASMJIT_INLINE_NODEBUG uint32_t workId() const noexcept { return _workId; }
+ ASMJIT_INLINE_NODEBUG uint32_t virtId() const noexcept { return _virtId; }
- inline const char* name() const noexcept { return _virtReg->name(); }
- inline uint32_t nameSize() const noexcept { return _virtReg->nameSize(); }
+ ASMJIT_INLINE_NODEBUG const char* name() const noexcept { return _virtReg->name(); }
+ ASMJIT_INLINE_NODEBUG uint32_t nameSize() const noexcept { return _virtReg->nameSize(); }
- inline TypeId typeId() const noexcept { return _virtReg->typeId(); }
+ ASMJIT_INLINE_NODEBUG TypeId typeId() const noexcept { return _virtReg->typeId(); }
- inline RAWorkRegFlags flags() const noexcept { return _flags; }
- inline bool hasFlag(RAWorkRegFlags flag) const noexcept { return Support::test(_flags, flag); }
- inline void addFlags(RAWorkRegFlags flags) noexcept { _flags |= flags; }
+ ASMJIT_INLINE_NODEBUG RAWorkRegFlags flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(RAWorkRegFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG void addFlags(RAWorkRegFlags flags) noexcept { _flags |= flags; }
- inline bool isAllocated() const noexcept { return hasFlag(RAWorkRegFlags::kAllocated); }
- inline void markAllocated() noexcept { addFlags(RAWorkRegFlags::kAllocated); }
+ ASMJIT_INLINE_NODEBUG bool isAllocated() const noexcept { return hasFlag(RAWorkRegFlags::kAllocated); }
+ ASMJIT_INLINE_NODEBUG void markAllocated() noexcept { addFlags(RAWorkRegFlags::kAllocated); }
- inline bool isLeadConsecutive() const noexcept { return hasFlag(RAWorkRegFlags::kLeadConsecutive); }
- inline void markLeadConsecutive() noexcept { addFlags(RAWorkRegFlags::kLeadConsecutive); }
+ ASMJIT_INLINE_NODEBUG bool isLeadConsecutive() const noexcept { return hasFlag(RAWorkRegFlags::kLeadConsecutive); }
+ ASMJIT_INLINE_NODEBUG void markLeadConsecutive() noexcept { addFlags(RAWorkRegFlags::kLeadConsecutive); }
- inline bool isProcessedConsecutive() const noexcept { return hasFlag(RAWorkRegFlags::kProcessedConsecutive); }
- inline void markProcessedConsecutive() noexcept { addFlags(RAWorkRegFlags::kProcessedConsecutive); }
+ ASMJIT_INLINE_NODEBUG bool isProcessedConsecutive() const noexcept { return hasFlag(RAWorkRegFlags::kProcessedConsecutive); }
+ ASMJIT_INLINE_NODEBUG void markProcessedConsecutive() noexcept { addFlags(RAWorkRegFlags::kProcessedConsecutive); }
- inline bool isStackUsed() const noexcept { return hasFlag(RAWorkRegFlags::kStackUsed); }
- inline void markStackUsed() noexcept { addFlags(RAWorkRegFlags::kStackUsed); }
+ ASMJIT_INLINE_NODEBUG bool isStackUsed() const noexcept { return hasFlag(RAWorkRegFlags::kStackUsed); }
+ ASMJIT_INLINE_NODEBUG void markStackUsed() noexcept { addFlags(RAWorkRegFlags::kStackUsed); }
- inline bool isStackPreferred() const noexcept { return hasFlag(RAWorkRegFlags::kStackPreferred); }
- inline void markStackPreferred() noexcept { addFlags(RAWorkRegFlags::kStackPreferred); }
+ ASMJIT_INLINE_NODEBUG bool isStackPreferred() const noexcept { return hasFlag(RAWorkRegFlags::kStackPreferred); }
+ ASMJIT_INLINE_NODEBUG void markStackPreferred() noexcept { addFlags(RAWorkRegFlags::kStackPreferred); }
//! Tests whether this RAWorkReg has been coalesced with another one (cannot be used anymore).
- inline bool isCoalesced() const noexcept { return hasFlag(RAWorkRegFlags::kCoalesced); }
+ ASMJIT_INLINE_NODEBUG bool isCoalesced() const noexcept { return hasFlag(RAWorkRegFlags::kCoalesced); }
- inline OperandSignature signature() const noexcept { return _signature; }
- inline RegType type() const noexcept { return _signature.regType(); }
- inline RegGroup group() const noexcept { return _signature.regGroup(); }
+ ASMJIT_INLINE_NODEBUG OperandSignature signature() const noexcept { return _signature; }
+ ASMJIT_INLINE_NODEBUG RegType type() const noexcept { return _signature.regType(); }
+ ASMJIT_INLINE_NODEBUG RegGroup group() const noexcept { return _signature.regGroup(); }
- inline VirtReg* virtReg() const noexcept { return _virtReg; }
+ ASMJIT_INLINE_NODEBUG VirtReg* virtReg() const noexcept { return _virtReg; }
- inline bool hasTiedReg() const noexcept { return _tiedReg != nullptr; }
- inline RATiedReg* tiedReg() const noexcept { return _tiedReg; }
- inline void setTiedReg(RATiedReg* tiedReg) noexcept { _tiedReg = tiedReg; }
- inline void resetTiedReg() noexcept { _tiedReg = nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasTiedReg() const noexcept { return _tiedReg != nullptr; }
+ ASMJIT_INLINE_NODEBUG RATiedReg* tiedReg() const noexcept { return _tiedReg; }
+ ASMJIT_INLINE_NODEBUG void setTiedReg(RATiedReg* tiedReg) noexcept { _tiedReg = tiedReg; }
+ ASMJIT_INLINE_NODEBUG void resetTiedReg() noexcept { _tiedReg = nullptr; }
- inline bool hasStackSlot() const noexcept { return _stackSlot != nullptr; }
- inline RAStackSlot* stackSlot() const noexcept { return _stackSlot; }
+ ASMJIT_INLINE_NODEBUG bool hasStackSlot() const noexcept { return _stackSlot != nullptr; }
+ ASMJIT_INLINE_NODEBUG RAStackSlot* stackSlot() const noexcept { return _stackSlot; }
- inline LiveRegSpans& liveSpans() noexcept { return _liveSpans; }
- inline const LiveRegSpans& liveSpans() const noexcept { return _liveSpans; }
+ ASMJIT_INLINE_NODEBUG LiveRegSpans& liveSpans() noexcept { return _liveSpans; }
+ ASMJIT_INLINE_NODEBUG const LiveRegSpans& liveSpans() const noexcept { return _liveSpans; }
- inline RALiveStats& liveStats() noexcept { return _liveStats; }
- inline const RALiveStats& liveStats() const noexcept { return _liveStats; }
+ ASMJIT_INLINE_NODEBUG RALiveStats& liveStats() noexcept { return _liveStats; }
+ ASMJIT_INLINE_NODEBUG const RALiveStats& liveStats() const noexcept { return _liveStats; }
- inline bool hasArgIndex() const noexcept { return _argIndex != kNoArgIndex; }
- inline uint32_t argIndex() const noexcept { return _argIndex; }
- inline uint32_t argValueIndex() const noexcept { return _argValueIndex; }
+ ASMJIT_INLINE_NODEBUG bool hasArgIndex() const noexcept { return _argIndex != kNoArgIndex; }
+ ASMJIT_INLINE_NODEBUG uint32_t argIndex() const noexcept { return _argIndex; }
+ ASMJIT_INLINE_NODEBUG uint32_t argValueIndex() const noexcept { return _argValueIndex; }
inline void setArgIndex(uint32_t argIndex, uint32_t valueIndex) noexcept {
_argIndex = uint8_t(argIndex);
_argValueIndex = uint8_t(valueIndex);
}
- inline bool hasHomeRegId() const noexcept { return _homeRegId != BaseReg::kIdBad; }
- inline uint32_t homeRegId() const noexcept { return _homeRegId; }
- inline void setHomeRegId(uint32_t physId) noexcept { _homeRegId = uint8_t(physId); }
+ ASMJIT_INLINE_NODEBUG bool hasHomeRegId() const noexcept { return _homeRegId != BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG uint32_t homeRegId() const noexcept { return _homeRegId; }
+ ASMJIT_INLINE_NODEBUG void setHomeRegId(uint32_t physId) noexcept { _homeRegId = uint8_t(physId); }
- inline bool hasHintRegId() const noexcept { return _hintRegId != BaseReg::kIdBad; }
- inline uint32_t hintRegId() const noexcept { return _hintRegId; }
- inline void setHintRegId(uint32_t physId) noexcept { _hintRegId = uint8_t(physId); }
+ ASMJIT_INLINE_NODEBUG bool hasHintRegId() const noexcept { return _hintRegId != BaseReg::kIdBad; }
+ ASMJIT_INLINE_NODEBUG uint32_t hintRegId() const noexcept { return _hintRegId; }
+ ASMJIT_INLINE_NODEBUG void setHintRegId(uint32_t physId) noexcept { _hintRegId = uint8_t(physId); }
- inline RegMask useIdMask() const noexcept { return _useIdMask; }
- inline bool hasUseIdMask() const noexcept { return _useIdMask != 0u; }
- inline bool hasMultipleUseIds() const noexcept { return _useIdMask != 0u && !Support::isPowerOf2(_useIdMask); }
- inline void addUseIdMask(RegMask mask) noexcept { _useIdMask |= mask; }
+ ASMJIT_INLINE_NODEBUG RegMask useIdMask() const noexcept { return _useIdMask; }
+ ASMJIT_INLINE_NODEBUG bool hasUseIdMask() const noexcept { return _useIdMask != 0u; }
+ ASMJIT_INLINE_NODEBUG bool hasMultipleUseIds() const noexcept { return _useIdMask != 0u && !Support::isPowerOf2(_useIdMask); }
+ ASMJIT_INLINE_NODEBUG void addUseIdMask(RegMask mask) noexcept { _useIdMask |= mask; }
- inline RegMask preferredMask() const noexcept { return _preferredMask; }
- inline bool hasPrereffedMask() const noexcept { return _preferredMask != 0xFFFFFFFFu; }
- inline void restrictPreferredMask(RegMask mask) noexcept { _preferredMask &= mask; }
+ ASMJIT_INLINE_NODEBUG RegMask preferredMask() const noexcept { return _preferredMask; }
+ ASMJIT_INLINE_NODEBUG bool hasPreferredMask() const noexcept { return _preferredMask != 0xFFFFFFFFu; }
+ ASMJIT_INLINE_NODEBUG void restrictPreferredMask(RegMask mask) noexcept { _preferredMask &= mask; }
- inline RegMask consecutiveMask() const noexcept { return _consecutiveMask; }
- inline bool hasConsecutiveMask() const noexcept { return _consecutiveMask != 0xFFFFFFFFu; }
- inline void restrictConsecutiveMask(RegMask mask) noexcept { _consecutiveMask &= mask; }
+ ASMJIT_INLINE_NODEBUG RegMask consecutiveMask() const noexcept { return _consecutiveMask; }
+ ASMJIT_INLINE_NODEBUG bool hasConsecutiveMask() const noexcept { return _consecutiveMask != 0xFFFFFFFFu; }
+ ASMJIT_INLINE_NODEBUG void restrictConsecutiveMask(RegMask mask) noexcept { _consecutiveMask &= mask; }
- inline RegMask clobberSurvivalMask() const noexcept { return _clobberSurvivalMask; }
- inline void addClobberSurvivalMask(RegMask mask) noexcept { _clobberSurvivalMask |= mask; }
+ ASMJIT_INLINE_NODEBUG RegMask clobberSurvivalMask() const noexcept { return _clobberSurvivalMask; }
+ ASMJIT_INLINE_NODEBUG void addClobberSurvivalMask(RegMask mask) noexcept { _clobberSurvivalMask |= mask; }
- inline RegMask allocatedMask() const noexcept { return _allocatedMask; }
- inline void addAllocatedMask(RegMask mask) noexcept { _allocatedMask |= mask; }
+ ASMJIT_INLINE_NODEBUG RegMask allocatedMask() const noexcept { return _allocatedMask; }
+ ASMJIT_INLINE_NODEBUG void addAllocatedMask(RegMask mask) noexcept { _allocatedMask |= mask; }
- inline uint64_t regByteMask() const noexcept { return _regByteMask; }
- inline void setRegByteMask(uint64_t mask) noexcept { _regByteMask = mask; }
+ ASMJIT_INLINE_NODEBUG uint64_t regByteMask() const noexcept { return _regByteMask; }
+ ASMJIT_INLINE_NODEBUG void setRegByteMask(uint64_t mask) noexcept { _regByteMask = mask; }
- inline bool hasImmediateConsecutives() const noexcept { return !_immediateConsecutives.empty(); }
- inline const ZoneBitVector& immediateConsecutives() const noexcept { return _immediateConsecutives; }
+ ASMJIT_INLINE_NODEBUG bool hasImmediateConsecutives() const noexcept { return !_immediateConsecutives.empty(); }
+ ASMJIT_INLINE_NODEBUG const ZoneBitVector& immediateConsecutives() const noexcept { return _immediateConsecutives; }
inline Error addImmediateConsecutive(ZoneAllocator* allocator, uint32_t workId) noexcept {
if (_immediateConsecutives.size() <= workId)
diff --git a/3rdparty/asmjit/src/asmjit/core/ralocal.cpp b/3rdparty/asmjit/src/asmjit/core/ralocal.cpp
index b4d92446b3c..358fbf58f8b 100644
--- a/3rdparty/asmjit/src/asmjit/core/ralocal.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/ralocal.cpp
@@ -21,8 +21,8 @@ static ASMJIT_FORCE_INLINE RATiedReg* RALocal_findTiedRegByWorkId(RATiedReg* tie
return nullptr;
}
-// RALocalAllocator - Init & Reset
-// ===============================
+// RALocalAllocator - Initialization & Reset
+// =========================================
Error RALocalAllocator::init() noexcept {
PhysToWorkMap* physToWorkMap;
@@ -137,9 +137,6 @@ Error RALocalAllocator::switchToAssignment(PhysToWorkMap* dstPhysToWorkMap, cons
dst.initMaps(dstPhysToWorkMap, _tmpWorkToPhysMap);
dst.assignWorkIdsFromPhysIds();
- if (tryMode)
- return kErrorOk;
-
for (RegGroup group : RegGroupVirtValues{}) {
// STEP 1
// ------
@@ -597,10 +594,14 @@ Error RALocalAllocator::allocInst(InstNode* node) noexcept {
if (rmSize <= workReg->virtReg()->virtSize()) {
Operand& op = node->operands()[opIndex];
op = _pass->workRegAsMem(workReg);
- op.as<BaseMem>().setSize(rmSize);
+
+ // NOTE: We cannot use `x86::Mem::setSize()` from here, so let's manipulate the signature directly.
+ op._signature.setSize(rmSize);
+
tiedReg->_useRewriteMask = 0;
tiedReg->markUseDone();
+ raInst->addFlags(RATiedFlags::kInst_RegToMemPatched);
usePending--;
rmAllocated = true;
@@ -687,7 +688,7 @@ Error RALocalAllocator::allocInst(InstNode* node) noexcept {
// ------
//
// ALLOCATE / SHUFFLE all registers that we marked as `willUse` and weren't allocated yet. This is a bit
- // complicated as the allocation is iterative. In some cases we have to wait before allocating a particual
+ // complicated as the allocation is iterative. In some cases we have to wait before allocating a particular
// physical register as it's still occupied by some other one, which we need to move before we can use it.
// In this case we skip it and allocate another some other instead (making it free for another iteration).
//
@@ -836,7 +837,7 @@ Error RALocalAllocator::allocInst(InstNode* node) noexcept {
// STEP 9
// ------
//
- // Vector registers can be cloberred partially by invoke - find if that's the case and clobber when necessary.
+ // Vector registers can be clobbered partially by invoke - find if that's the case and clobber when necessary.
if (node->isInvoke() && group == RegGroup::kVec) {
const InvokeNode* invokeNode = node->as<InvokeNode>();
@@ -927,6 +928,10 @@ Error RALocalAllocator::allocInst(InstNode* node) noexcept {
if (!tiedReg->isOut())
continue;
+ RegMask avoidOut = avoidRegs;
+ if (tiedReg->isUnique())
+ avoidOut |= willUse;
+
uint32_t workId = tiedReg->workId();
uint32_t assignedId = _curAssignment.workToPhysId(group, workId);
@@ -935,7 +940,7 @@ Error RALocalAllocator::allocInst(InstNode* node) noexcept {
uint32_t physId = tiedReg->outId();
if (physId == RAAssignment::kPhysNone) {
- RegMask allocableRegs = tiedReg->outRegMask() & ~(outRegs | avoidRegs);
+ RegMask allocableRegs = tiedReg->outRegMask() & ~(outRegs | avoidOut);
if (!(allocableRegs & ~liveRegs)) {
// There are no more registers, decide which one to spill.
diff --git a/3rdparty/asmjit/src/asmjit/core/ralocal_p.h b/3rdparty/asmjit/src/asmjit/core/ralocal_p.h
index b40e8674274..63fd1b78aba 100644
--- a/3rdparty/asmjit/src/asmjit/core/ralocal_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/ralocal_p.h
@@ -29,52 +29,45 @@ public:
typedef RAAssignment::WorkToPhysMap WorkToPhysMap;
//! Link to `BaseRAPass`.
- BaseRAPass* _pass;
+ BaseRAPass* _pass {};
//! Link to `BaseCompiler`.
- BaseCompiler* _cc;
+ BaseCompiler* _cc {};
//! Architecture traits.
- const ArchTraits* _archTraits;
+ const ArchTraits* _archTraits {};
//! Registers available to the allocator.
- RARegMask _availableRegs;
+ RARegMask _availableRegs {};
//! Registers clobbered by the allocator.
- RARegMask _clobberedRegs;
+ RARegMask _clobberedRegs {};
//! Register assignment (current).
- RAAssignment _curAssignment;
+ RAAssignment _curAssignment {};
//! Register assignment used temporarily during assignment switches.
- RAAssignment _tmpAssignment;
+ RAAssignment _tmpAssignment {};
//! Link to the current `RABlock`.
- RABlock* _block;
+ RABlock* _block {};
//! InstNode.
- InstNode* _node;
+ InstNode* _node {};
//! RA instruction.
- RAInst* _raInst;
+ RAInst* _raInst {};
//! Count of all TiedReg's.
- uint32_t _tiedTotal;
+ uint32_t _tiedTotal {};
//! TiedReg's total counter.
- RARegCount _tiedCount;
+ RARegCount _tiedCount {};
//! Temporary workToPhysMap that can be used freely by the allocator.
- WorkToPhysMap* _tmpWorkToPhysMap;
+ WorkToPhysMap* _tmpWorkToPhysMap {};
//! \name Construction & Destruction
//! \{
- inline RALocalAllocator(BaseRAPass* pass) noexcept
+ inline explicit RALocalAllocator(BaseRAPass* pass) noexcept
: _pass(pass),
_cc(pass->cc()),
_archTraits(pass->_archTraits),
- _availableRegs(pass->_availableRegs),
- _clobberedRegs(),
- _curAssignment(),
- _block(nullptr),
- _node(nullptr),
- _raInst(nullptr),
- _tiedTotal(),
- _tiedCount() {}
+ _availableRegs(pass->_availableRegs) {}
Error init() noexcept;
@@ -83,31 +76,31 @@ public:
//! \name Accessors
//! \{
- inline RAWorkReg* workRegById(uint32_t workId) const noexcept { return _pass->workRegById(workId); }
- inline PhysToWorkMap* physToWorkMap() const noexcept { return _curAssignment.physToWorkMap(); }
- inline WorkToPhysMap* workToPhysMap() const noexcept { return _curAssignment.workToPhysMap(); }
+ ASMJIT_INLINE_NODEBUG RAWorkReg* workRegById(uint32_t workId) const noexcept { return _pass->workRegById(workId); }
+ ASMJIT_INLINE_NODEBUG PhysToWorkMap* physToWorkMap() const noexcept { return _curAssignment.physToWorkMap(); }
+ ASMJIT_INLINE_NODEBUG WorkToPhysMap* workToPhysMap() const noexcept { return _curAssignment.workToPhysMap(); }
//! Returns the currently processed block.
- inline RABlock* block() const noexcept { return _block; }
+ ASMJIT_INLINE_NODEBUG RABlock* block() const noexcept { return _block; }
//! Sets the currently processed block.
- inline void setBlock(RABlock* block) noexcept { _block = block; }
+ ASMJIT_INLINE_NODEBUG void setBlock(RABlock* block) noexcept { _block = block; }
//! Returns the currently processed `InstNode`.
- inline InstNode* node() const noexcept { return _node; }
+ ASMJIT_INLINE_NODEBUG InstNode* node() const noexcept { return _node; }
//! Returns the currently processed `RAInst`.
- inline RAInst* raInst() const noexcept { return _raInst; }
+ ASMJIT_INLINE_NODEBUG RAInst* raInst() const noexcept { return _raInst; }
//! Returns all tied regs as `RATiedReg` array.
- inline RATiedReg* tiedRegs() const noexcept { return _raInst->tiedRegs(); }
+ ASMJIT_INLINE_NODEBUG RATiedReg* tiedRegs() const noexcept { return _raInst->tiedRegs(); }
//! Returns tied registers grouped by the given `group`.
- inline RATiedReg* tiedRegs(RegGroup group) const noexcept { return _raInst->tiedRegs(group); }
+ ASMJIT_INLINE_NODEBUG RATiedReg* tiedRegs(RegGroup group) const noexcept { return _raInst->tiedRegs(group); }
//! Returns count of all TiedRegs used by the instruction.
- inline uint32_t tiedCount() const noexcept { return _tiedTotal; }
+ ASMJIT_INLINE_NODEBUG uint32_t tiedCount() const noexcept { return _tiedTotal; }
//! Returns count of TiedRegs used by the given register `group`.
- inline uint32_t tiedCount(RegGroup group) const noexcept { return _tiedCount.get(group); }
+ ASMJIT_INLINE_NODEBUG uint32_t tiedCount(RegGroup group) const noexcept { return _tiedCount.get(group); }
- inline bool isGroupUsed(RegGroup group) const noexcept { return _tiedCount[group] != 0; }
+ ASMJIT_INLINE_NODEBUG bool isGroupUsed(RegGroup group) const noexcept { return _tiedCount[group] != 0; }
//! \}
@@ -126,7 +119,7 @@ public:
//! a code sequence that is always executed regardless of the flow.
Error switchToAssignment(PhysToWorkMap* dstPhysToWorkMap, const ZoneBitVector& liveIn, bool dstReadOnly, bool tryMode) noexcept;
- inline Error spillRegsBeforeEntry(RABlock* block) noexcept {
+ ASMJIT_INLINE_NODEBUG Error spillRegsBeforeEntry(RABlock* block) noexcept {
return spillScratchGpRegsBeforeEntry(block->entryScratchGpRegs());
}
@@ -153,7 +146,7 @@ public:
kCostOfDirtyFlag = kCostOfFrequency / 4
};
- inline uint32_t costByFrequency(float freq) const noexcept {
+ ASMJIT_INLINE_NODEBUG uint32_t costByFrequency(float freq) const noexcept {
return uint32_t(int32_t(freq * float(kCostOfFrequency)));
}
diff --git a/3rdparty/asmjit/src/asmjit/core/rapass.cpp b/3rdparty/asmjit/src/asmjit/core/rapass.cpp
index 0e87ab6a259..837cbe291cd 100644
--- a/3rdparty/asmjit/src/asmjit/core/rapass.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/rapass.cpp
@@ -114,11 +114,14 @@ Error BaseRAPass::runOnFunction(Zone* zone, Logger* logger, FuncNode* func) {
#ifndef ASMJIT_NO_LOGGING
_logger = logger;
_formatOptions.reset();
- _diagnosticOptions = DiagnosticOptions::kNone;
+ _diagnosticOptions = _cb->diagnosticOptions();
if (logger) {
_formatOptions = logger->options();
- _diagnosticOptions = _cb->diagnosticOptions();
+ }
+ else {
+ _diagnosticOptions &= ~(DiagnosticOptions::kRADebugCFG |
+ DiagnosticOptions::kRADebugUnreachable);
}
#else
DebugUtils::unused(logger);
@@ -193,6 +196,12 @@ Error BaseRAPass::onPerformAllSteps() noexcept {
return kErrorOk;
}
+// BaseRAPass - Events
+// ===================
+
+void BaseRAPass::onInit() noexcept {}
+void BaseRAPass::onDone() noexcept {}
+
// BaseRAPass - CFG - Basic Block Management
// =========================================
@@ -304,6 +313,11 @@ Error BaseRAPass::addBlock(RABlock* block) noexcept {
// BaseRAPass - CFG - Build
// ========================
+// [[pure virtual]]
+Error BaseRAPass::buildCFG() noexcept {
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
Error BaseRAPass::initSharedAssignments(const ZoneVector<uint32_t>& sharedAssignmentsMap) noexcept {
if (sharedAssignmentsMap.empty())
return kErrorOk;
@@ -328,9 +342,14 @@ Error BaseRAPass::initSharedAssignments(const ZoneVector<uint32_t>& sharedAssign
RABlock* firstSuccessor = successors[0];
// NOTE: Shared assignments connect all possible successors so we only need the first to propagate exit scratch
// GP registers.
- ASMJIT_ASSERT(firstSuccessor->hasSharedAssignmentId());
- RASharedAssignment& sa = _sharedAssignments[firstSuccessor->sharedAssignmentId()];
- sa.addEntryScratchGpRegs(block->exitScratchGpRegs());
+ if (firstSuccessor->hasSharedAssignmentId()) {
+ RASharedAssignment& sa = _sharedAssignments[firstSuccessor->sharedAssignmentId()];
+ sa.addEntryScratchGpRegs(block->exitScratchGpRegs());
+ }
+ else {
+ // This is only allowed if there is a single successor - in that case shared assignment is not necessary.
+ ASMJIT_ASSERT(successors.size() == 1u);
+ }
}
}
if (block->hasSharedAssignmentId()) {
@@ -347,21 +366,18 @@ Error BaseRAPass::initSharedAssignments(const ZoneVector<uint32_t>& sharedAssign
class RABlockVisitItem {
public:
+ RABlock* _block {};
+ uint32_t _index {};
+
inline RABlockVisitItem(RABlock* block, uint32_t index) noexcept
: _block(block),
_index(index) {}
- inline RABlockVisitItem(const RABlockVisitItem& other) noexcept
- : _block(other._block),
- _index(other._index) {}
-
+ inline RABlockVisitItem(const RABlockVisitItem& other) noexcept = default;
inline RABlockVisitItem& operator=(const RABlockVisitItem& other) noexcept = default;
inline RABlock* block() const noexcept { return _block; }
inline uint32_t index() const noexcept { return _index; }
-
- RABlock* _block;
- uint32_t _index;
};
Error BaseRAPass::buildCFGViews() noexcept {
@@ -460,12 +476,18 @@ Error BaseRAPass::buildCFGDominators() noexcept {
entryBlock->setIDom(entryBlock);
bool changed = true;
- uint32_t nIters = 0;
+
+#ifndef ASMJIT_NO_LOGGING
+ uint32_t numIters = 0;
+#endif
while (changed) {
- nIters++;
changed = false;
+#ifndef ASMJIT_NO_LOGGING
+ numIters++;
+#endif
+
uint32_t i = _pov.size();
while (i) {
RABlock* block = _pov[--i];
@@ -492,7 +514,7 @@ Error BaseRAPass::buildCFGDominators() noexcept {
}
}
- ASMJIT_RA_LOG_FORMAT(" Done (%u iterations)\n", nIters);
+ ASMJIT_RA_LOG_FORMAT(" Done (%u iterations)\n", numIters);
return kErrorOk;
}
@@ -740,6 +762,13 @@ namespace LiveOps {
static ASMJIT_FORCE_INLINE bool op(BitWord* dst, const BitWord* a, const BitWord* b, const BitWord* c, uint32_t n) noexcept {
BitWord changed = 0;
+#if defined(_MSC_VER) && _MSC_VER <= 1938
+ // MSVC workaround (see #427).
+ //
+ // MSVC incorrectly auto-vectorizes this loop when used with <In> operator. For some reason it trashes a content
+ // of a register, which causes the result to be incorrect. It's a compiler bug we have to prevent unfortunately.
+ #pragma loop(no_vector)
+#endif
for (uint32_t i = 0; i < n; i++) {
BitWord before = dst[i];
BitWord after = Operator::op(before, a[i], b[i], c[i]);
@@ -751,7 +780,7 @@ namespace LiveOps {
return changed != 0;
}
- static ASMJIT_FORCE_INLINE bool recalcInOut(RABlock* block, uint32_t numBitWords, bool initial = false) noexcept {
+ static ASMJIT_NOINLINE bool recalcInOut(RABlock* block, uint32_t numBitWords, bool initial = false) noexcept {
bool changed = initial;
const RABlocks& successors = block->successors();
@@ -782,7 +811,6 @@ ASMJIT_FAVOR_SPEED Error BaseRAPass::buildLiveness() noexcept {
uint32_t numAllBlocks = blockCount();
uint32_t numReachableBlocks = reachableBlockCount();
- uint32_t numVisits = numReachableBlocks;
uint32_t numWorkRegs = workRegCount();
uint32_t numBitWords = ZoneBitVector::_wordsPerBits(numWorkRegs);
@@ -852,7 +880,7 @@ ASMJIT_FAVOR_SPEED Error BaseRAPass::buildLiveness() noexcept {
if (tiedReg->hasConsecutiveParent()) {
RAWorkReg* consecutiveParentReg = workRegById(tiedReg->consecutiveParent());
- consecutiveParentReg->addImmediateConsecutive(allocator(), workId);
+ ASMJIT_PROPAGATE(consecutiveParentReg->addImmediateConsecutive(allocator(), workId));
}
}
@@ -872,6 +900,10 @@ ASMJIT_FAVOR_SPEED Error BaseRAPass::buildLiveness() noexcept {
// Calculate IN/OUT of Each Block
// ------------------------------
+#ifndef ASMJIT_NO_LOGGING
+ uint32_t numVisits = numReachableBlocks;
+#endif
+
{
ZoneStack<RABlock*> workList;
ZoneBitVector workBits;
@@ -902,7 +934,9 @@ ASMJIT_FAVOR_SPEED Error BaseRAPass::buildLiveness() noexcept {
}
}
}
+#ifndef ASMJIT_NO_LOGGING
numVisits++;
+#endif
}
workList.reset();
@@ -1146,7 +1180,7 @@ ASMJIT_FAVOR_SPEED Error BaseRAPass::initGlobalLiveSpans() noexcept {
return DebugUtils::errored(kErrorOutOfMemory);
for (size_t physId = 0; physId < physCount; physId++)
- new(&liveSpans[physId]) LiveRegSpans();
+ new(Support::PlacementNew{&liveSpans[physId]}) LiveRegSpans();
}
_globalLiveSpans[group] = liveSpans;
@@ -1189,6 +1223,7 @@ ASMJIT_FAVOR_SPEED Error BaseRAPass::binPack(RegGroup group) noexcept {
uint32_t numWorkRegs = workRegs.size();
RegMask availableRegs = _availableRegs[group];
+ RegMask preservedRegs = func()->frame().preservedRegs(group);
// First try to pack everything that provides register-id hint as these are most likely function arguments and fixed
// (precolored) virtual registers.
@@ -1320,18 +1355,30 @@ ASMJIT_FAVOR_SPEED Error BaseRAPass::binPack(RegGroup group) noexcept {
if (workReg->isAllocated())
continue;
- RegMask physRegs = availableRegs;
- if (physRegs & workReg->preferredMask())
- physRegs &= workReg->preferredMask();
+ RegMask remainingPhysRegs = availableRegs;
+ if (remainingPhysRegs & workReg->preferredMask())
+ remainingPhysRegs &= workReg->preferredMask();
- while (physRegs) {
- RegMask preferredMask = physRegs;
- uint32_t physId = Support::ctz(preferredMask);
+ RegMask physRegs = remainingPhysRegs & ~preservedRegs;
+ remainingPhysRegs &= preservedRegs;
+
+ for (;;) {
+ if (!physRegs) {
+ if (!remainingPhysRegs)
+ break;
+ physRegs = remainingPhysRegs;
+ remainingPhysRegs = 0;
+ }
+
+ uint32_t physId = Support::ctz(physRegs);
if (workReg->clobberSurvivalMask()) {
- preferredMask &= workReg->clobberSurvivalMask();
- if (preferredMask)
+ RegMask preferredMask = (physRegs | remainingPhysRegs) & workReg->clobberSurvivalMask();
+ if (preferredMask) {
+ if (preferredMask & ~remainingPhysRegs)
+ preferredMask &= ~remainingPhysRegs;
physId = Support::ctz(preferredMask);
+ }
}
LiveRegSpans& live = _globalLiveSpans[group][physId];
@@ -1347,7 +1394,8 @@ ASMJIT_FAVOR_SPEED Error BaseRAPass::binPack(RegGroup group) noexcept {
if (ASMJIT_UNLIKELY(err != 0xFFFFFFFFu))
return err;
- physRegs ^= Support::bitMask(physId);
+ physRegs &= ~Support::bitMask(physId);
+ remainingPhysRegs &= ~Support::bitMask(physId);
}
// Keep it in `workRegs` if it was not allocated.
@@ -1806,6 +1854,50 @@ Error BaseRAPass::rewrite() noexcept {
return _rewrite(_func, _stop);
}
+// [[pure virtual]]
+Error BaseRAPass::_rewrite(BaseNode* first, BaseNode* stop) noexcept {
+ DebugUtils::unused(first, stop);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// BaseRAPass - Emit
+// =================
+
+// [[pure virtual]]
+Error BaseRAPass::emitMove(uint32_t workId, uint32_t dstPhysId, uint32_t srcPhysId) noexcept {
+ DebugUtils::unused(workId, dstPhysId, srcPhysId);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// [[pure virtual]]
+Error BaseRAPass::emitSwap(uint32_t aWorkId, uint32_t aPhysId, uint32_t bWorkId, uint32_t bPhysId) noexcept {
+ DebugUtils::unused(aWorkId, aPhysId, bWorkId, bPhysId);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// [[pure virtual]]
+Error BaseRAPass::emitLoad(uint32_t workId, uint32_t dstPhysId) noexcept {
+ DebugUtils::unused(workId, dstPhysId);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// [[pure virtual]]
+Error BaseRAPass::emitSave(uint32_t workId, uint32_t srcPhysId) noexcept {
+ DebugUtils::unused(workId, srcPhysId);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+// [[pure virtual]]
+Error BaseRAPass::emitJump(const Label& label) noexcept {
+ DebugUtils::unused(label);
+ return DebugUtils::errored(kErrorInvalidState);
+}
+
+Error BaseRAPass::emitPreCall(InvokeNode* invokeNode) noexcept {
+ DebugUtils::unused(invokeNode);
+ return DebugUtils::errored(kErrorOk);
+}
+
// BaseRAPass - Logging
// ====================
diff --git a/3rdparty/asmjit/src/asmjit/core/rapass_p.h b/3rdparty/asmjit/src/asmjit/core/rapass_p.h
index 94738293667..967624045c5 100644
--- a/3rdparty/asmjit/src/asmjit/core/rapass_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/rapass_p.h
@@ -137,7 +137,7 @@ public:
//! \name Construction & Destruction
//! \{
- inline RABlock(BaseRAPass* ra) noexcept
+ ASMJIT_INLINE_NODEBUG RABlock(BaseRAPass* ra) noexcept
: _ra(ra) {}
//! \}
@@ -145,96 +145,96 @@ public:
//! \name Accessors
//! \{
- inline BaseRAPass* pass() const noexcept { return _ra; }
- inline ZoneAllocator* allocator() const noexcept;
+ ASMJIT_INLINE_NODEBUG BaseRAPass* pass() const noexcept { return _ra; }
+ ASMJIT_INLINE_NODEBUG ZoneAllocator* allocator() const noexcept;
- inline uint32_t blockId() const noexcept { return _blockId; }
- inline RABlockFlags flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG uint32_t blockId() const noexcept { return _blockId; }
+ ASMJIT_INLINE_NODEBUG RABlockFlags flags() const noexcept { return _flags; }
- inline bool hasFlag(RABlockFlags flag) const noexcept { return Support::test(_flags, flag); }
- inline void addFlags(RABlockFlags flags) noexcept { _flags |= flags; }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(RABlockFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG void addFlags(RABlockFlags flags) noexcept { _flags |= flags; }
- inline bool isAssigned() const noexcept { return _blockId != kUnassignedId; }
+ ASMJIT_INLINE_NODEBUG bool isAssigned() const noexcept { return _blockId != kUnassignedId; }
- inline bool isConstructed() const noexcept { return hasFlag(RABlockFlags::kIsConstructed); }
- inline bool isReachable() const noexcept { return hasFlag(RABlockFlags::kIsReachable); }
- inline bool isTargetable() const noexcept { return hasFlag(RABlockFlags::kIsTargetable); }
- inline bool isAllocated() const noexcept { return hasFlag(RABlockFlags::kIsAllocated); }
- inline bool isFuncExit() const noexcept { return hasFlag(RABlockFlags::kIsFuncExit); }
- inline bool hasTerminator() const noexcept { return hasFlag(RABlockFlags::kHasTerminator); }
- inline bool hasConsecutive() const noexcept { return hasFlag(RABlockFlags::kHasConsecutive); }
- inline bool hasJumpTable() const noexcept { return hasFlag(RABlockFlags::kHasJumpTable); }
+ ASMJIT_INLINE_NODEBUG bool isConstructed() const noexcept { return hasFlag(RABlockFlags::kIsConstructed); }
+ ASMJIT_INLINE_NODEBUG bool isReachable() const noexcept { return hasFlag(RABlockFlags::kIsReachable); }
+ ASMJIT_INLINE_NODEBUG bool isTargetable() const noexcept { return hasFlag(RABlockFlags::kIsTargetable); }
+ ASMJIT_INLINE_NODEBUG bool isAllocated() const noexcept { return hasFlag(RABlockFlags::kIsAllocated); }
+ ASMJIT_INLINE_NODEBUG bool isFuncExit() const noexcept { return hasFlag(RABlockFlags::kIsFuncExit); }
+ ASMJIT_INLINE_NODEBUG bool hasTerminator() const noexcept { return hasFlag(RABlockFlags::kHasTerminator); }
+ ASMJIT_INLINE_NODEBUG bool hasConsecutive() const noexcept { return hasFlag(RABlockFlags::kHasConsecutive); }
+ ASMJIT_INLINE_NODEBUG bool hasJumpTable() const noexcept { return hasFlag(RABlockFlags::kHasJumpTable); }
- inline void makeConstructed(const RARegsStats& regStats) noexcept {
+ ASMJIT_INLINE_NODEBUG void makeConstructed(const RARegsStats& regStats) noexcept {
_flags |= RABlockFlags::kIsConstructed;
_regsStats.combineWith(regStats);
}
- inline void makeReachable() noexcept { _flags |= RABlockFlags::kIsReachable; }
- inline void makeTargetable() noexcept { _flags |= RABlockFlags::kIsTargetable; }
- inline void makeAllocated() noexcept { _flags |= RABlockFlags::kIsAllocated; }
+ ASMJIT_INLINE_NODEBUG void makeReachable() noexcept { _flags |= RABlockFlags::kIsReachable; }
+ ASMJIT_INLINE_NODEBUG void makeTargetable() noexcept { _flags |= RABlockFlags::kIsTargetable; }
+ ASMJIT_INLINE_NODEBUG void makeAllocated() noexcept { _flags |= RABlockFlags::kIsAllocated; }
- inline const RARegsStats& regsStats() const noexcept { return _regsStats; }
+ ASMJIT_INLINE_NODEBUG const RARegsStats& regsStats() const noexcept { return _regsStats; }
- inline bool hasPredecessors() const noexcept { return !_predecessors.empty(); }
- inline bool hasSuccessors() const noexcept { return !_successors.empty(); }
+ ASMJIT_INLINE_NODEBUG bool hasPredecessors() const noexcept { return !_predecessors.empty(); }
+ ASMJIT_INLINE_NODEBUG bool hasSuccessors() const noexcept { return !_successors.empty(); }
- inline bool hasSuccessor(RABlock* block) noexcept {
+ ASMJIT_INLINE_NODEBUG bool hasSuccessor(RABlock* block) noexcept {
if (block->_predecessors.size() < _successors.size())
return block->_predecessors.contains(this);
else
return _successors.contains(block);
}
- inline const RABlocks& predecessors() const noexcept { return _predecessors; }
- inline const RABlocks& successors() const noexcept { return _successors; }
+ ASMJIT_INLINE_NODEBUG const RABlocks& predecessors() const noexcept { return _predecessors; }
+ ASMJIT_INLINE_NODEBUG const RABlocks& successors() const noexcept { return _successors; }
- inline BaseNode* first() const noexcept { return _first; }
- inline BaseNode* last() const noexcept { return _last; }
+ ASMJIT_INLINE_NODEBUG BaseNode* first() const noexcept { return _first; }
+ ASMJIT_INLINE_NODEBUG BaseNode* last() const noexcept { return _last; }
- inline void setFirst(BaseNode* node) noexcept { _first = node; }
- inline void setLast(BaseNode* node) noexcept { _last = node; }
+ ASMJIT_INLINE_NODEBUG void setFirst(BaseNode* node) noexcept { _first = node; }
+ ASMJIT_INLINE_NODEBUG void setLast(BaseNode* node) noexcept { _last = node; }
- inline uint32_t firstPosition() const noexcept { return _firstPosition; }
- inline void setFirstPosition(uint32_t position) noexcept { _firstPosition = position; }
+ ASMJIT_INLINE_NODEBUG uint32_t firstPosition() const noexcept { return _firstPosition; }
+ ASMJIT_INLINE_NODEBUG void setFirstPosition(uint32_t position) noexcept { _firstPosition = position; }
- inline uint32_t endPosition() const noexcept { return _endPosition; }
- inline void setEndPosition(uint32_t position) noexcept { _endPosition = position; }
+ ASMJIT_INLINE_NODEBUG uint32_t endPosition() const noexcept { return _endPosition; }
+ ASMJIT_INLINE_NODEBUG void setEndPosition(uint32_t position) noexcept { _endPosition = position; }
- inline uint32_t povOrder() const noexcept { return _povOrder; }
+ ASMJIT_INLINE_NODEBUG uint32_t povOrder() const noexcept { return _povOrder; }
- inline RegMask entryScratchGpRegs() const noexcept;
- inline RegMask exitScratchGpRegs() const noexcept { return _exitScratchGpRegs; }
+ ASMJIT_INLINE_NODEBUG RegMask entryScratchGpRegs() const noexcept;
+ ASMJIT_INLINE_NODEBUG RegMask exitScratchGpRegs() const noexcept { return _exitScratchGpRegs; }
- inline void addEntryScratchGpRegs(RegMask regMask) noexcept { _entryScratchGpRegs |= regMask; }
- inline void addExitScratchGpRegs(RegMask regMask) noexcept { _exitScratchGpRegs |= regMask; }
+ ASMJIT_INLINE_NODEBUG void addEntryScratchGpRegs(RegMask regMask) noexcept { _entryScratchGpRegs |= regMask; }
+ ASMJIT_INLINE_NODEBUG void addExitScratchGpRegs(RegMask regMask) noexcept { _exitScratchGpRegs |= regMask; }
- inline bool hasSharedAssignmentId() const noexcept { return _sharedAssignmentId != Globals::kInvalidId; }
- inline uint32_t sharedAssignmentId() const noexcept { return _sharedAssignmentId; }
- inline void setSharedAssignmentId(uint32_t id) noexcept { _sharedAssignmentId = id; }
+ ASMJIT_INLINE_NODEBUG bool hasSharedAssignmentId() const noexcept { return _sharedAssignmentId != Globals::kInvalidId; }
+ ASMJIT_INLINE_NODEBUG uint32_t sharedAssignmentId() const noexcept { return _sharedAssignmentId; }
+ ASMJIT_INLINE_NODEBUG void setSharedAssignmentId(uint32_t id) noexcept { _sharedAssignmentId = id; }
- inline uint64_t timestamp() const noexcept { return _timestamp; }
- inline bool hasTimestamp(uint64_t ts) const noexcept { return _timestamp == ts; }
- inline void setTimestamp(uint64_t ts) const noexcept { _timestamp = ts; }
- inline void resetTimestamp() const noexcept { _timestamp = 0; }
+ ASMJIT_INLINE_NODEBUG uint64_t timestamp() const noexcept { return _timestamp; }
+ ASMJIT_INLINE_NODEBUG bool hasTimestamp(uint64_t ts) const noexcept { return _timestamp == ts; }
+ ASMJIT_INLINE_NODEBUG void setTimestamp(uint64_t ts) const noexcept { _timestamp = ts; }
+ ASMJIT_INLINE_NODEBUG void resetTimestamp() const noexcept { _timestamp = 0; }
- inline RABlock* consecutive() const noexcept { return hasConsecutive() ? _successors[0] : nullptr; }
+ ASMJIT_INLINE_NODEBUG RABlock* consecutive() const noexcept { return hasConsecutive() ? _successors[0] : nullptr; }
- inline RABlock* iDom() noexcept { return _idom; }
- inline const RABlock* iDom() const noexcept { return _idom; }
- inline void setIDom(RABlock* block) noexcept { _idom = block; }
+ ASMJIT_INLINE_NODEBUG RABlock* iDom() noexcept { return _idom; }
+ ASMJIT_INLINE_NODEBUG const RABlock* iDom() const noexcept { return _idom; }
+ ASMJIT_INLINE_NODEBUG void setIDom(RABlock* block) noexcept { _idom = block; }
- inline ZoneBitVector& liveIn() noexcept { return _liveBits[kLiveIn]; }
- inline const ZoneBitVector& liveIn() const noexcept { return _liveBits[kLiveIn]; }
+ ASMJIT_INLINE_NODEBUG ZoneBitVector& liveIn() noexcept { return _liveBits[kLiveIn]; }
+ ASMJIT_INLINE_NODEBUG const ZoneBitVector& liveIn() const noexcept { return _liveBits[kLiveIn]; }
- inline ZoneBitVector& liveOut() noexcept { return _liveBits[kLiveOut]; }
- inline const ZoneBitVector& liveOut() const noexcept { return _liveBits[kLiveOut]; }
+ ASMJIT_INLINE_NODEBUG ZoneBitVector& liveOut() noexcept { return _liveBits[kLiveOut]; }
+ ASMJIT_INLINE_NODEBUG const ZoneBitVector& liveOut() const noexcept { return _liveBits[kLiveOut]; }
- inline ZoneBitVector& gen() noexcept { return _liveBits[kLiveGen]; }
- inline const ZoneBitVector& gen() const noexcept { return _liveBits[kLiveGen]; }
+ ASMJIT_INLINE_NODEBUG ZoneBitVector& gen() noexcept { return _liveBits[kLiveGen]; }
+ ASMJIT_INLINE_NODEBUG const ZoneBitVector& gen() const noexcept { return _liveBits[kLiveGen]; }
- inline ZoneBitVector& kill() noexcept { return _liveBits[kLiveKill]; }
- inline const ZoneBitVector& kill() const noexcept { return _liveBits[kLiveKill]; }
+ ASMJIT_INLINE_NODEBUG ZoneBitVector& kill() noexcept { return _liveBits[kLiveKill]; }
+ ASMJIT_INLINE_NODEBUG const ZoneBitVector& kill() const noexcept { return _liveBits[kLiveKill]; }
inline Error resizeLiveBits(uint32_t size) noexcept {
ASMJIT_PROPAGATE(_liveBits[kLiveIn ].resize(allocator(), size));
@@ -244,9 +244,9 @@ public:
return kErrorOk;
}
- inline bool hasEntryAssignment() const noexcept { return _entryPhysToWorkMap != nullptr; }
- inline PhysToWorkMap* entryPhysToWorkMap() const noexcept { return _entryPhysToWorkMap; }
- inline void setEntryAssignment(PhysToWorkMap* physToWorkMap) noexcept { _entryPhysToWorkMap = physToWorkMap; }
+ ASMJIT_INLINE_NODEBUG bool hasEntryAssignment() const noexcept { return _entryPhysToWorkMap != nullptr; }
+ ASMJIT_INLINE_NODEBUG PhysToWorkMap* entryPhysToWorkMap() const noexcept { return _entryPhysToWorkMap; }
+ ASMJIT_INLINE_NODEBUG void setEntryAssignment(PhysToWorkMap* physToWorkMap) noexcept { _entryPhysToWorkMap = physToWorkMap; }
//! \}
@@ -318,38 +318,40 @@ public:
//! \{
//! Returns instruction RW flags.
- inline InstRWFlags instRWFlags() const noexcept { return _instRWFlags; };
+ ASMJIT_INLINE_NODEBUG InstRWFlags instRWFlags() const noexcept { return _instRWFlags; };
//! Tests whether the given `flag` is present in instruction RW flags.
- inline bool hasInstRWFlag(InstRWFlags flag) const noexcept { return Support::test(_instRWFlags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasInstRWFlag(InstRWFlags flag) const noexcept { return Support::test(_instRWFlags, flag); }
//! Adds `flags` to instruction RW flags.
- inline void addInstRWFlags(InstRWFlags flags) noexcept { _instRWFlags |= flags; }
+ ASMJIT_INLINE_NODEBUG void addInstRWFlags(InstRWFlags flags) noexcept { _instRWFlags |= flags; }
//! Returns the instruction flags.
- inline RATiedFlags flags() const noexcept { return _flags; }
+ ASMJIT_INLINE_NODEBUG RATiedFlags flags() const noexcept { return _flags; }
//! Tests whether the instruction has flag `flag`.
- inline bool hasFlag(RATiedFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(RATiedFlags flag) const noexcept { return Support::test(_flags, flag); }
//! Replaces the existing instruction flags with `flags`.
- inline void setFlags(RATiedFlags flags) noexcept { _flags = flags; }
+ ASMJIT_INLINE_NODEBUG void setFlags(RATiedFlags flags) noexcept { _flags = flags; }
//! Adds instruction `flags` to this RAInst.
- inline void addFlags(RATiedFlags flags) noexcept { _flags |= flags; }
+ ASMJIT_INLINE_NODEBUG void addFlags(RATiedFlags flags) noexcept { _flags |= flags; }
//! Clears instruction `flags` from this RAInst.
- inline void clearFlags(RATiedFlags flags) noexcept { _flags &= ~flags; }
+ ASMJIT_INLINE_NODEBUG void clearFlags(RATiedFlags flags) noexcept { _flags &= ~flags; }
+ //! Tests whether one operand of this instruction has been patched from Reg to Mem.
+ ASMJIT_INLINE_NODEBUG bool isRegToMemPatched() const noexcept { return hasFlag(RATiedFlags::kInst_RegToMemPatched); }
//! Tests whether this instruction can be transformed to another instruction if necessary.
- inline bool isTransformable() const noexcept { return hasFlag(RATiedFlags::kInst_IsTransformable); }
+ ASMJIT_INLINE_NODEBUG bool isTransformable() const noexcept { return hasFlag(RATiedFlags::kInst_IsTransformable); }
//! Returns the associated block with this RAInst.
- inline RABlock* block() const noexcept { return _block; }
+ ASMJIT_INLINE_NODEBUG RABlock* block() const noexcept { return _block; }
//! Returns tied registers (all).
- inline RATiedReg* tiedRegs() const noexcept { return const_cast<RATiedReg*>(_tiedRegs); }
+ ASMJIT_INLINE_NODEBUG RATiedReg* tiedRegs() const noexcept { return const_cast<RATiedReg*>(_tiedRegs); }
//! Returns tied registers for a given `group`.
- inline RATiedReg* tiedRegs(RegGroup group) const noexcept { return const_cast<RATiedReg*>(_tiedRegs) + _tiedIndex.get(group); }
+ ASMJIT_INLINE_NODEBUG RATiedReg* tiedRegs(RegGroup group) const noexcept { return const_cast<RATiedReg*>(_tiedRegs) + _tiedIndex.get(group); }
//! Returns count of all tied registers.
- inline uint32_t tiedCount() const noexcept { return _tiedTotal; }
+ ASMJIT_INLINE_NODEBUG uint32_t tiedCount() const noexcept { return _tiedTotal; }
//! Returns count of tied registers of a given `group`.
- inline uint32_t tiedCount(RegGroup group) const noexcept { return _tiedCount[group]; }
+ ASMJIT_INLINE_NODEBUG uint32_t tiedCount(RegGroup group) const noexcept { return _tiedCount[group]; }
//! Returns `RATiedReg` at the given `index`.
inline RATiedReg* tiedAt(uint32_t index) const noexcept {
@@ -371,7 +373,7 @@ public:
//! \name Static Functions
//! \{
- static inline size_t sizeOf(uint32_t tiedRegCount) noexcept {
+ static ASMJIT_INLINE_NODEBUG size_t sizeOf(uint32_t tiedRegCount) noexcept {
return sizeof(RAInst) - sizeof(RATiedReg) + tiedRegCount * sizeof(RATiedReg);
}
@@ -409,10 +411,10 @@ public:
//! \name Construction & Destruction
//! \{
- inline RAInstBuilder() noexcept { reset(); }
+ ASMJIT_INLINE_NODEBUG RAInstBuilder() noexcept { reset(); }
- inline void init() noexcept { reset(); }
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void init() noexcept { reset(); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_instRWFlags = InstRWFlags::kNone;
_aggregatedFlags = RATiedFlags::kNone;
_forbiddenFlags = RATiedFlags::kNone;
@@ -428,25 +430,25 @@ public:
//! \name Accessors
//! \{
- inline InstRWFlags instRWFlags() const noexcept { return _instRWFlags; }
- inline bool hasInstRWFlag(InstRWFlags flag) const noexcept { return Support::test(_instRWFlags, flag); }
- inline void addInstRWFlags(InstRWFlags flags) noexcept { _instRWFlags |= flags; }
- inline void clearInstRWFlags(InstRWFlags flags) noexcept { _instRWFlags &= ~flags; }
+ ASMJIT_INLINE_NODEBUG InstRWFlags instRWFlags() const noexcept { return _instRWFlags; }
+ ASMJIT_INLINE_NODEBUG bool hasInstRWFlag(InstRWFlags flag) const noexcept { return Support::test(_instRWFlags, flag); }
+ ASMJIT_INLINE_NODEBUG void addInstRWFlags(InstRWFlags flags) noexcept { _instRWFlags |= flags; }
+ ASMJIT_INLINE_NODEBUG void clearInstRWFlags(InstRWFlags flags) noexcept { _instRWFlags &= ~flags; }
- inline RATiedFlags aggregatedFlags() const noexcept { return _aggregatedFlags; }
- inline void addAggregatedFlags(RATiedFlags flags) noexcept { _aggregatedFlags |= flags; }
+ ASMJIT_INLINE_NODEBUG RATiedFlags aggregatedFlags() const noexcept { return _aggregatedFlags; }
+ ASMJIT_INLINE_NODEBUG void addAggregatedFlags(RATiedFlags flags) noexcept { _aggregatedFlags |= flags; }
- inline RATiedFlags forbiddenFlags() const noexcept { return _forbiddenFlags; }
- inline void addForbiddenFlags(RATiedFlags flags) noexcept { _forbiddenFlags |= flags; }
+ ASMJIT_INLINE_NODEBUG RATiedFlags forbiddenFlags() const noexcept { return _forbiddenFlags; }
+ ASMJIT_INLINE_NODEBUG void addForbiddenFlags(RATiedFlags flags) noexcept { _forbiddenFlags |= flags; }
//! Returns the number of tied registers added to the builder.
- inline uint32_t tiedRegCount() const noexcept { return uint32_t((size_t)(_cur - _tiedRegs)); }
+ ASMJIT_INLINE_NODEBUG uint32_t tiedRegCount() const noexcept { return uint32_t((size_t)(_cur - _tiedRegs)); }
- inline RATiedReg* begin() noexcept { return _tiedRegs; }
- inline RATiedReg* end() noexcept { return _cur; }
+ ASMJIT_INLINE_NODEBUG RATiedReg* begin() noexcept { return _tiedRegs; }
+ ASMJIT_INLINE_NODEBUG RATiedReg* end() noexcept { return _cur; }
- inline const RATiedReg* begin() const noexcept { return _tiedRegs; }
- inline const RATiedReg* end() const noexcept { return _cur; }
+ ASMJIT_INLINE_NODEBUG const RATiedReg* begin() const noexcept { return _tiedRegs; }
+ ASMJIT_INLINE_NODEBUG const RATiedReg* end() const noexcept { return _cur; }
//! Returns `RATiedReg` at the given `index`.
inline RATiedReg* operator[](uint32_t index) noexcept {
@@ -634,15 +636,15 @@ public:
//! \name Accessors
//! \{
- inline bool empty() const noexcept { return _physToWorkMap == nullptr; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _physToWorkMap == nullptr; }
- inline RegMask entryScratchGpRegs() const noexcept { return _entryScratchGpRegs; }
- inline void addEntryScratchGpRegs(RegMask mask) noexcept { _entryScratchGpRegs |= mask; }
+ ASMJIT_INLINE_NODEBUG RegMask entryScratchGpRegs() const noexcept { return _entryScratchGpRegs; }
+ ASMJIT_INLINE_NODEBUG void addEntryScratchGpRegs(RegMask mask) noexcept { _entryScratchGpRegs |= mask; }
- inline const ZoneBitVector& liveIn() const noexcept { return _liveIn; }
+ ASMJIT_INLINE_NODEBUG const ZoneBitVector& liveIn() const noexcept { return _liveIn; }
- inline PhysToWorkMap* physToWorkMap() const noexcept { return _physToWorkMap; }
- inline void assignPhysToWorkMap(PhysToWorkMap* physToWorkMap) noexcept { _physToWorkMap = physToWorkMap; }
+ ASMJIT_INLINE_NODEBUG PhysToWorkMap* physToWorkMap() const noexcept { return _physToWorkMap; }
+ ASMJIT_INLINE_NODEBUG void assignPhysToWorkMap(PhysToWorkMap* physToWorkMap) noexcept { _physToWorkMap = physToWorkMap; }
//! \}
};
@@ -754,7 +756,7 @@ public:
//! \{
BaseRAPass() noexcept;
- virtual ~BaseRAPass() noexcept;
+ ~BaseRAPass() noexcept override;
//! \}
@@ -762,38 +764,38 @@ public:
//! \{
//! Returns \ref Logger passed to \ref runOnFunction().
- inline Logger* logger() const noexcept { return _logger; }
+ ASMJIT_INLINE_NODEBUG Logger* logger() const noexcept { return _logger; }
//! Returns either a valid logger if the given `option` is set and logging is enabled, or nullptr.
- inline Logger* getLoggerIf(DiagnosticOptions option) const noexcept { return Support::test(_diagnosticOptions, option) ? _logger : nullptr; }
+ ASMJIT_INLINE_NODEBUG Logger* getLoggerIf(DiagnosticOptions option) const noexcept { return Support::test(_diagnosticOptions, option) ? _logger : nullptr; }
//! Returns whether the diagnostic `option` is enabled.
//!
//! \note Returns false if there is no logger (as diagnostics without logging make no sense).
- inline bool hasDiagnosticOption(DiagnosticOptions option) const noexcept { return Support::test(_diagnosticOptions, option); }
+ ASMJIT_INLINE_NODEBUG bool hasDiagnosticOption(DiagnosticOptions option) const noexcept { return Support::test(_diagnosticOptions, option); }
//! Returns \ref Zone passed to \ref runOnFunction().
- inline Zone* zone() const noexcept { return _allocator.zone(); }
+ ASMJIT_INLINE_NODEBUG Zone* zone() const noexcept { return _allocator.zone(); }
//! Returns \ref ZoneAllocator used by the register allocator.
- inline ZoneAllocator* allocator() const noexcept { return const_cast<ZoneAllocator*>(&_allocator); }
+ ASMJIT_INLINE_NODEBUG ZoneAllocator* allocator() const noexcept { return const_cast<ZoneAllocator*>(&_allocator); }
- inline const ZoneVector<RASharedAssignment>& sharedAssignments() const { return _sharedAssignments; }
- inline uint32_t sharedAssignmentCount() const noexcept { return _sharedAssignments.size(); }
+ ASMJIT_INLINE_NODEBUG const ZoneVector<RASharedAssignment>& sharedAssignments() const { return _sharedAssignments; }
+ ASMJIT_INLINE_NODEBUG uint32_t sharedAssignmentCount() const noexcept { return _sharedAssignments.size(); }
//! Returns the current function node.
- inline FuncNode* func() const noexcept { return _func; }
+ ASMJIT_INLINE_NODEBUG FuncNode* func() const noexcept { return _func; }
//! Returns the stop of the current function.
- inline BaseNode* stop() const noexcept { return _stop; }
+ ASMJIT_INLINE_NODEBUG BaseNode* stop() const noexcept { return _stop; }
//! Returns an extra block used by the current function being processed.
- inline BaseNode* extraBlock() const noexcept { return _extraBlock; }
+ ASMJIT_INLINE_NODEBUG BaseNode* extraBlock() const noexcept { return _extraBlock; }
//! Sets an extra block, see `extraBlock()`.
- inline void setExtraBlock(BaseNode* node) noexcept { _extraBlock = node; }
+ ASMJIT_INLINE_NODEBUG void setExtraBlock(BaseNode* node) noexcept { _extraBlock = node; }
- inline uint32_t endPosition() const noexcept { return _instructionCount * 2; }
+ ASMJIT_INLINE_NODEBUG uint32_t endPosition() const noexcept { return _instructionCount * 2; }
- inline const RARegMask& availableRegs() const noexcept { return _availableRegs; }
- inline const RARegMask& cloberredRegs() const noexcept { return _clobberedRegs; }
+ ASMJIT_INLINE_NODEBUG const RARegMask& availableRegs() const noexcept { return _availableRegs; }
+ ASMJIT_INLINE_NODEBUG const RARegMask& clobberedRegs() const noexcept { return _clobberedRegs; }
//! \}
@@ -818,11 +820,11 @@ public:
//! Called by \ref runOnFunction() before the register allocation to initialize
//! architecture-specific data and constraints.
- virtual void onInit() noexcept = 0;
+ virtual void onInit() noexcept;
//! Called by \ref runOnFunction(` after register allocation to clean everything
//! up. Called even if the register allocation failed.
- virtual void onDone() noexcept = 0;
+ virtual void onDone() noexcept;
//! \}
@@ -842,26 +844,26 @@ public:
}
//! Returns all basic blocks of this function.
- inline RABlocks& blocks() noexcept { return _blocks; }
+ ASMJIT_INLINE_NODEBUG RABlocks& blocks() noexcept { return _blocks; }
//! \overload
- inline const RABlocks& blocks() const noexcept { return _blocks; }
+ ASMJIT_INLINE_NODEBUG const RABlocks& blocks() const noexcept { return _blocks; }
//! Returns the count of basic blocks (returns size of `_blocks` array).
- inline uint32_t blockCount() const noexcept { return _blocks.size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t blockCount() const noexcept { return _blocks.size(); }
//! Returns the count of reachable basic blocks (returns size of `_pov` array).
- inline uint32_t reachableBlockCount() const noexcept { return _pov.size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t reachableBlockCount() const noexcept { return _pov.size(); }
//! Tests whether the CFG has dangling blocks - these were created by `newBlock()`, but not added to CFG through
//! `addBlocks()`. If `true` is returned and the CFG is constructed it means that something is missing and it's
//! incomplete.
//!
//! \note This is only used to check if the number of created blocks matches the number of added blocks.
- inline bool hasDanglingBlocks() const noexcept { return _createdBlockCount != blockCount(); }
+ ASMJIT_INLINE_NODEBUG bool hasDanglingBlocks() const noexcept { return _createdBlockCount != blockCount(); }
//! Gest a next timestamp to be used to mark CFG blocks.
- inline uint64_t nextTimestamp() const noexcept { return ++_lastTimestamp; }
+ ASMJIT_INLINE_NODEBUG uint64_t nextTimestamp() const noexcept { return ++_lastTimestamp; }
- //! Createss a new `RABlock` instance.
+ //! Creates a new `RABlock` instance.
//!
//! \note New blocks don't have ID assigned until they are added to the block array by calling `addBlock()`.
RABlock* newBlock(BaseNode* initialNode = nullptr) noexcept;
@@ -882,7 +884,7 @@ public:
void* p = zone()->alloc(RAInst::sizeOf(tiedRegCount));
if (ASMJIT_UNLIKELY(!p))
return nullptr;
- return new(p) RAInst(block, instRWFlags, flags, tiedRegCount, clobberedRegs);
+ return new(Support::PlacementNew{p}) RAInst(block, instRWFlags, flags, tiedRegCount, clobberedRegs);
}
ASMJIT_FORCE_INLINE Error assignRAInst(BaseNode* node, RABlock* block, RAInstBuilder& ib) noexcept {
@@ -945,7 +947,7 @@ public:
//! analysis and register allocation.
//!
//! Use `RACFGBuilderT` template that provides the necessary boilerplate.
- virtual Error buildCFG() noexcept = 0;
+ virtual Error buildCFG() noexcept;
//! Called after the CFG is built.
Error initSharedAssignments(const ZoneVector<uint32_t>& sharedAssignmentsMap) noexcept;
@@ -974,14 +976,14 @@ public:
const RABlock* _nearestCommonDominator(const RABlock* a, const RABlock* b) const noexcept;
//! Tests whether the basic block `a` dominates `b` - non-strict, returns true when `a == b`.
- inline bool dominates(const RABlock* a, const RABlock* b) const noexcept { return a == b ? true : _strictlyDominates(a, b); }
+ ASMJIT_INLINE_NODEBUG bool dominates(const RABlock* a, const RABlock* b) const noexcept { return a == b ? true : _strictlyDominates(a, b); }
//! Tests whether the basic block `a` dominates `b` - strict dominance check, returns false when `a == b`.
- inline bool strictlyDominates(const RABlock* a, const RABlock* b) const noexcept { return a == b ? false : _strictlyDominates(a, b); }
+ ASMJIT_INLINE_NODEBUG bool strictlyDominates(const RABlock* a, const RABlock* b) const noexcept { return a == b ? false : _strictlyDominates(a, b); }
//! Returns a nearest common dominator of `a` and `b`.
- inline RABlock* nearestCommonDominator(RABlock* a, RABlock* b) const noexcept { return const_cast<RABlock*>(_nearestCommonDominator(a, b)); }
+ ASMJIT_INLINE_NODEBUG RABlock* nearestCommonDominator(RABlock* a, RABlock* b) const noexcept { return const_cast<RABlock*>(_nearestCommonDominator(a, b)); }
//! Returns a nearest common dominator of `a` and `b` (const).
- inline const RABlock* nearestCommonDominator(const RABlock* a, const RABlock* b) const noexcept { return _nearestCommonDominator(a, b); }
+ ASMJIT_INLINE_NODEBUG const RABlock* nearestCommonDominator(const RABlock* a, const RABlock* b) const noexcept { return _nearestCommonDominator(a, b); }
//! \}
@@ -1005,27 +1007,27 @@ public:
//! \{
//! Returns a native size of the general-purpose register of the target architecture.
- inline uint32_t registerSize() const noexcept { return _sp.size(); }
- inline uint32_t availableRegCount(RegGroup group) const noexcept { return _availableRegCount[group]; }
+ ASMJIT_INLINE_NODEBUG uint32_t registerSize() const noexcept { return _sp.size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t availableRegCount(RegGroup group) const noexcept { return _availableRegCount[group]; }
- inline RAWorkReg* workRegById(uint32_t workId) const noexcept { return _workRegs[workId]; }
+ ASMJIT_INLINE_NODEBUG RAWorkReg* workRegById(uint32_t workId) const noexcept { return _workRegs[workId]; }
- inline RAWorkRegs& workRegs() noexcept { return _workRegs; }
- inline RAWorkRegs& workRegs(RegGroup group) noexcept { return _workRegsOfGroup[group]; }
+ ASMJIT_INLINE_NODEBUG RAWorkRegs& workRegs() noexcept { return _workRegs; }
+ ASMJIT_INLINE_NODEBUG RAWorkRegs& workRegs(RegGroup group) noexcept { return _workRegsOfGroup[group]; }
- inline const RAWorkRegs& workRegs() const noexcept { return _workRegs; }
- inline const RAWorkRegs& workRegs(RegGroup group) const noexcept { return _workRegsOfGroup[group]; }
+ ASMJIT_INLINE_NODEBUG const RAWorkRegs& workRegs() const noexcept { return _workRegs; }
+ ASMJIT_INLINE_NODEBUG const RAWorkRegs& workRegs(RegGroup group) const noexcept { return _workRegsOfGroup[group]; }
- inline uint32_t workRegCount() const noexcept { return _workRegs.size(); }
- inline uint32_t workRegCount(RegGroup group) const noexcept { return _workRegsOfGroup[group].size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t workRegCount() const noexcept { return _workRegs.size(); }
+ ASMJIT_INLINE_NODEBUG uint32_t workRegCount(RegGroup group) const noexcept { return _workRegsOfGroup[group].size(); }
inline void _buildPhysIndex() noexcept {
_physRegIndex.buildIndexes(_physRegCount);
_physRegTotal = uint32_t(_physRegIndex[RegGroup::kMaxVirt]) +
uint32_t(_physRegCount[RegGroup::kMaxVirt]) ;
}
- inline uint32_t physRegIndex(RegGroup group) const noexcept { return _physRegIndex[group]; }
- inline uint32_t physRegTotal() const noexcept { return _physRegTotal; }
+ ASMJIT_INLINE_NODEBUG uint32_t physRegIndex(RegGroup group) const noexcept { return _physRegIndex[group]; }
+ ASMJIT_INLINE_NODEBUG uint32_t physRegTotal() const noexcept { return _physRegTotal; }
Error _asWorkReg(VirtReg* vReg, RAWorkReg** out) noexcept;
@@ -1133,7 +1135,7 @@ public:
//! \{
Error rewrite() noexcept;
- virtual Error _rewrite(BaseNode* first, BaseNode* stop) noexcept = 0;
+ virtual Error _rewrite(BaseNode* first, BaseNode* stop) noexcept;
//! \}
@@ -1153,14 +1155,14 @@ public:
//! \name Emit
//! \{
- virtual Error emitMove(uint32_t workId, uint32_t dstPhysId, uint32_t srcPhysId) noexcept = 0;
- virtual Error emitSwap(uint32_t aWorkId, uint32_t aPhysId, uint32_t bWorkId, uint32_t bPhysId) noexcept = 0;
+ virtual Error emitMove(uint32_t workId, uint32_t dstPhysId, uint32_t srcPhysId) noexcept;
+ virtual Error emitSwap(uint32_t aWorkId, uint32_t aPhysId, uint32_t bWorkId, uint32_t bPhysId) noexcept;
- virtual Error emitLoad(uint32_t workId, uint32_t dstPhysId) noexcept = 0;
- virtual Error emitSave(uint32_t workId, uint32_t srcPhysId) noexcept = 0;
+ virtual Error emitLoad(uint32_t workId, uint32_t dstPhysId) noexcept;
+ virtual Error emitSave(uint32_t workId, uint32_t srcPhysId) noexcept;
- virtual Error emitJump(const Label& label) noexcept = 0;
- virtual Error emitPreCall(InvokeNode* invokeNode) noexcept = 0;
+ virtual Error emitJump(const Label& label) noexcept;
+ virtual Error emitPreCall(InvokeNode* invokeNode) noexcept;
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/rastack.cpp b/3rdparty/asmjit/src/asmjit/core/rastack.cpp
index 2b7ed592df5..318fbded4b3 100644
--- a/3rdparty/asmjit/src/asmjit/core/rastack.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/rastack.cpp
@@ -62,7 +62,7 @@ Error RAStackAllocator::calculateStackFrame() noexcept {
// STEP 1:
//
- // Update usage based on the size of the slot. We boost smaller slots in a way that 32-bit register has higher
+ // Update usage based on the size of the slot. We boost smaller slots in a way that 32-bit register has a higher
// priority than a 128-bit register, however, if one 128-bit register is used 4 times more than some other 32-bit
// register it will overweight it.
for (RAStackSlot* slot : _slots) {
diff --git a/3rdparty/asmjit/src/asmjit/core/rastack_p.h b/3rdparty/asmjit/src/asmjit/core/rastack_p.h
index 90640b4dea8..15db8e97948 100644
--- a/3rdparty/asmjit/src/asmjit/core/rastack_p.h
+++ b/3rdparty/asmjit/src/asmjit/core/rastack_p.h
@@ -104,13 +104,13 @@ public:
//! \{
//! Allocator used to allocate internal data.
- ZoneAllocator* _allocator;
+ ZoneAllocator* _allocator {};
//! Count of bytes used by all slots.
- uint32_t _bytesUsed;
+ uint32_t _bytesUsed {};
//! Calculated stack size (can be a bit greater than `_bytesUsed`).
- uint32_t _stackSize;
+ uint32_t _stackSize {};
//! Minimum stack alignment.
- uint32_t _alignment;
+ uint32_t _alignment = 1;
//! Stack slots vector.
RAStackSlots _slots;
@@ -119,14 +119,9 @@ public:
//! \name Construction & Destruction
//! \{
- inline RAStackAllocator() noexcept
- : _allocator(nullptr),
- _bytesUsed(0),
- _stackSize(0),
- _alignment(1),
- _slots() {}
+ ASMJIT_INLINE_NODEBUG RAStackAllocator() noexcept {}
- inline void reset(ZoneAllocator* allocator) noexcept {
+ ASMJIT_INLINE_NODEBUG void reset(ZoneAllocator* allocator) noexcept {
_allocator = allocator;
_bytesUsed = 0;
_stackSize = 0;
@@ -139,15 +134,15 @@ public:
//! \name Accessors
//! \{
- inline ZoneAllocator* allocator() const noexcept { return _allocator; }
+ ASMJIT_INLINE_NODEBUG ZoneAllocator* allocator() const noexcept { return _allocator; }
- inline uint32_t bytesUsed() const noexcept { return _bytesUsed; }
- inline uint32_t stackSize() const noexcept { return _stackSize; }
- inline uint32_t alignment() const noexcept { return _alignment; }
+ ASMJIT_INLINE_NODEBUG uint32_t bytesUsed() const noexcept { return _bytesUsed; }
+ ASMJIT_INLINE_NODEBUG uint32_t stackSize() const noexcept { return _stackSize; }
+ ASMJIT_INLINE_NODEBUG uint32_t alignment() const noexcept { return _alignment; }
- inline RAStackSlots& slots() noexcept { return _slots; }
- inline const RAStackSlots& slots() const noexcept { return _slots; }
- inline uint32_t slotCount() const noexcept { return _slots.size(); }
+ ASMJIT_INLINE_NODEBUG RAStackSlots& slots() noexcept { return _slots; }
+ ASMJIT_INLINE_NODEBUG const RAStackSlots& slots() const noexcept { return _slots; }
+ ASMJIT_INLINE_NODEBUG uint32_t slotCount() const noexcept { return _slots.size(); }
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/core/string.cpp b/3rdparty/asmjit/src/asmjit/core/string.cpp
index 83dc6efdaac..369d060e248 100644
--- a/3rdparty/asmjit/src/asmjit/core/string.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/string.cpp
@@ -14,9 +14,51 @@ ASMJIT_BEGIN_NAMESPACE
static const char String_baseN[] = "0123456789ABCDEF";
-constexpr size_t kMinAllocSize = 64;
+constexpr size_t kMinAllocSize = 128;
constexpr size_t kMaxAllocSize = SIZE_MAX - Globals::kGrowThreshold;
+// Based on ZoneVector_growCapacity().
+//
+// NOTE: The sizes here include null terminators - that way we can have aligned allocations that are power of 2s
+// initially.
+static ASMJIT_FORCE_INLINE size_t String_growCapacity(size_t byteSize, size_t minimumByteSize) noexcept {
+ static constexpr size_t kGrowThreshold = Globals::kGrowThreshold;
+
+ ASMJIT_ASSERT(minimumByteSize < kMaxAllocSize);
+
+ // This is more than exponential growth at the beginning.
+ if (byteSize < kMinAllocSize) {
+ byteSize = kMinAllocSize;
+ }
+ else if (byteSize < 512) {
+ byteSize = 512;
+ }
+
+ if (byteSize < minimumByteSize) {
+ // Exponential growth before we reach `kGrowThreshold`.
+ byteSize = Support::alignUpPowerOf2(minimumByteSize);
+
+ // Bail to `minimumByteSize` in case of overflow - most likely whatever that is happening afterwards would just fail.
+ if (byteSize < minimumByteSize) {
+ return minimumByteSize;
+ }
+
+ // Pretty much chunked growth advancing by `kGrowThreshold` after we exceed it.
+ if (byteSize > kGrowThreshold) {
+ // Align to kGrowThreshold.
+ size_t remainder = minimumByteSize % kGrowThreshold;
+
+ byteSize = minimumByteSize + remainder;
+
+ // Bail to `minimumByteSize` in case of overflow.
+ if (byteSize < minimumByteSize)
+ return minimumByteSize;
+ }
+ }
+
+ return Support::min<size_t>(byteSize, kMaxAllocSize);
+}
+
// String - Clear & Reset
// ======================
@@ -49,13 +91,13 @@ char* String::prepare(ModifyOp op, size_t size) noexcept {
size_t curCapacity;
if (isLargeOrExternal()) {
- curData = this->_large.data;
- curSize = this->_large.size;
- curCapacity = this->_large.capacity;
+ curData = _large.data;
+ curSize = _large.size;
+ curCapacity = _large.capacity;
}
else {
- curData = this->_small.data;
- curSize = this->_small.type;
+ curData = _small.data;
+ curSize = _small.type;
curCapacity = kSSOCapacity;
}
@@ -90,25 +132,20 @@ char* String::prepare(ModifyOp op, size_t size) noexcept {
}
else {
// Prevent arithmetic overflow.
- if (ASMJIT_UNLIKELY(size >= kMaxAllocSize - curSize))
+ if (ASMJIT_UNLIKELY(size >= kMaxAllocSize - curSize - 1))
return nullptr;
size_t newSize = size + curSize;
size_t newSizePlusOne = newSize + 1;
- if (newSizePlusOne > curCapacity) {
- size_t newCapacity = Support::max<size_t>(curCapacity + 1, kMinAllocSize);
-
- if (newCapacity < newSizePlusOne && newCapacity < Globals::kGrowThreshold)
- newCapacity = Support::alignUpPowerOf2(newCapacity);
-
- if (newCapacity < newSizePlusOne)
- newCapacity = Support::alignUp(newSizePlusOne, Globals::kGrowThreshold);
+ if (newSize > curCapacity) {
+ size_t newCapacityPlusOne = String_growCapacity(size + 1u, newSizePlusOne);
+ ASMJIT_ASSERT(newCapacityPlusOne >= newSizePlusOne);
- if (ASMJIT_UNLIKELY(newCapacity < newSizePlusOne))
+ if (ASMJIT_UNLIKELY(newCapacityPlusOne < newSizePlusOne))
return nullptr;
- char* newData = static_cast<char*>(::malloc(newCapacity));
+ char* newData = static_cast<char*>(::malloc(newCapacityPlusOne));
if (ASMJIT_UNLIKELY(!newData))
return nullptr;
@@ -119,7 +156,7 @@ char* String::prepare(ModifyOp op, size_t size) noexcept {
_large.type = kTypeLarge;
_large.size = newSize;
- _large.capacity = newCapacity - 1;
+ _large.capacity = newCapacityPlusOne - 1;
_large.data = newData;
newData[newSize] = '\0';
@@ -463,7 +500,7 @@ Error String::truncate(size_t newSize) noexcept {
return kErrorOk;
}
-bool String::eq(const char* other, size_t size) const noexcept {
+bool String::equals(const char* other, size_t size) const noexcept {
const char* aData = data();
const char* bData = other;
@@ -488,71 +525,92 @@ bool String::eq(const char* other, size_t size) const noexcept {
// ==============
#if defined(ASMJIT_TEST)
+static void test_string_grow() noexcept {
+ String s;
+ size_t c = s.capacity();
+
+ INFO("Testing string grow strategy (SSO capacity: %zu)", c);
+ for (size_t i = 0; i < 1000000; i++) {
+ s.append('x');
+ if (s.capacity() != c) {
+ c = s.capacity();
+ INFO(" String reallocated to new capacity: %zu", c);
+ }
+ }
+
+ // We don't expect a 1 million character string to occupy 4MiB, for example. So verify that!
+ EXPECT_LT(c, size_t(4 * 1024 * 1024));
+}
+
UNIT(core_string) {
String s;
- EXPECT(s.isLargeOrExternal() == false);
- EXPECT(s.isExternal() == false);
-
- EXPECT(s.assign('a') == kErrorOk);
- EXPECT(s.size() == 1);
- EXPECT(s.capacity() == String::kSSOCapacity);
- EXPECT(s.data()[0] == 'a');
- EXPECT(s.data()[1] == '\0');
- EXPECT(s.eq("a") == true);
- EXPECT(s.eq("a", 1) == true);
-
- EXPECT(s.assignChars('b', 4) == kErrorOk);
- EXPECT(s.size() == 4);
- EXPECT(s.capacity() == String::kSSOCapacity);
- EXPECT(s.data()[0] == 'b');
- EXPECT(s.data()[1] == 'b');
- EXPECT(s.data()[2] == 'b');
- EXPECT(s.data()[3] == 'b');
- EXPECT(s.data()[4] == '\0');
- EXPECT(s.eq("bbbb") == true);
- EXPECT(s.eq("bbbb", 4) == true);
-
- EXPECT(s.assign("abc") == kErrorOk);
- EXPECT(s.size() == 3);
- EXPECT(s.capacity() == String::kSSOCapacity);
- EXPECT(s.data()[0] == 'a');
- EXPECT(s.data()[1] == 'b');
- EXPECT(s.data()[2] == 'c');
- EXPECT(s.data()[3] == '\0');
- EXPECT(s.eq("abc") == true);
- EXPECT(s.eq("abc", 3) == true);
+ INFO("Testing string functionality");
+
+ EXPECT_FALSE(s.isLargeOrExternal());
+ EXPECT_FALSE(s.isExternal());
+
+ EXPECT_EQ(s.assign('a'), kErrorOk);
+ EXPECT_EQ(s.size(), 1u);
+ EXPECT_EQ(s.capacity(), String::kSSOCapacity);
+ EXPECT_EQ(s.data()[0], 'a');
+ EXPECT_EQ(s.data()[1], '\0');
+ EXPECT_TRUE(s.equals("a"));
+ EXPECT_TRUE(s.equals("a", 1));
+
+ EXPECT_EQ(s.assignChars('b', 4), kErrorOk);
+ EXPECT_EQ(s.size(), 4u);
+ EXPECT_EQ(s.capacity(), String::kSSOCapacity);
+ EXPECT_EQ(s.data()[0], 'b');
+ EXPECT_EQ(s.data()[1], 'b');
+ EXPECT_EQ(s.data()[2], 'b');
+ EXPECT_EQ(s.data()[3], 'b');
+ EXPECT_EQ(s.data()[4], '\0');
+ EXPECT_TRUE(s.equals("bbbb"));
+ EXPECT_TRUE(s.equals("bbbb", 4));
+
+ EXPECT_EQ(s.assign("abc"), kErrorOk);
+ EXPECT_EQ(s.size(), 3u);
+ EXPECT_EQ(s.capacity(), String::kSSOCapacity);
+ EXPECT_EQ(s.data()[0], 'a');
+ EXPECT_EQ(s.data()[1], 'b');
+ EXPECT_EQ(s.data()[2], 'c');
+ EXPECT_EQ(s.data()[3], '\0');
+ EXPECT_TRUE(s.equals("abc"));
+ EXPECT_TRUE(s.equals("abc", 3));
const char* large = "Large string that will not fit into SSO buffer";
- EXPECT(s.assign(large) == kErrorOk);
- EXPECT(s.isLargeOrExternal() == true);
- EXPECT(s.size() == strlen(large));
- EXPECT(s.capacity() > String::kSSOCapacity);
- EXPECT(s.eq(large) == true);
- EXPECT(s.eq(large, strlen(large)) == true);
+ EXPECT_EQ(s.assign(large), kErrorOk);
+ EXPECT_TRUE(s.isLargeOrExternal());
+ EXPECT_EQ(s.size(), strlen(large));
+ EXPECT_GT(s.capacity(), String::kSSOCapacity);
+ EXPECT_TRUE(s.equals(large));
+ EXPECT_TRUE(s.equals(large, strlen(large)));
const char* additional = " (additional content)";
- EXPECT(s.isLargeOrExternal() == true);
- EXPECT(s.append(additional) == kErrorOk);
- EXPECT(s.size() == strlen(large) + strlen(additional));
+ EXPECT_TRUE(s.isLargeOrExternal());
+ EXPECT_EQ(s.append(additional), kErrorOk);
+ EXPECT_EQ(s.size(), strlen(large) + strlen(additional));
- EXPECT(s.clear() == kErrorOk);
- EXPECT(s.size() == 0);
- EXPECT(s.empty() == true);
- EXPECT(s.data()[0] == '\0');
- EXPECT(s.isLargeOrExternal() == true); // Clear should never release the memory.
+ EXPECT_EQ(s.clear(), kErrorOk);
+ EXPECT_EQ(s.size(), 0u);
+ EXPECT_TRUE(s.empty());
+ EXPECT_EQ(s.data()[0], '\0');
+ EXPECT_TRUE(s.isLargeOrExternal()); // Clear should never release the memory.
- EXPECT(s.appendUInt(1234) == kErrorOk);
- EXPECT(s.eq("1234") == true);
+ EXPECT_EQ(s.appendUInt(1234), kErrorOk);
+ EXPECT_TRUE(s.equals("1234"));
- EXPECT(s.assignUInt(0xFFFF, 16, 0, StringFormatFlags::kAlternate) == kErrorOk);
- EXPECT(s.eq("0xFFFF"));
+ EXPECT_EQ(s.assignUInt(0xFFFF, 16, 0, StringFormatFlags::kAlternate), kErrorOk);
+ EXPECT_TRUE(s.equals("0xFFFF"));
StringTmp<64> sTmp;
- EXPECT(sTmp.isLargeOrExternal());
- EXPECT(sTmp.isExternal());
- EXPECT(sTmp.appendChars(' ', 1000) == kErrorOk);
- EXPECT(!sTmp.isExternal());
+ EXPECT_TRUE(sTmp.isLargeOrExternal());
+ EXPECT_TRUE(sTmp.isExternal());
+ EXPECT_EQ(sTmp.appendChars(' ', 1000), kErrorOk);
+ EXPECT_FALSE(sTmp.isExternal());
+
+ test_string_grow();
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/core/string.h b/3rdparty/asmjit/src/asmjit/core/string.h
index 2562e66194a..c4dee14b00e 100644
--- a/3rdparty/asmjit/src/asmjit/core/string.h
+++ b/3rdparty/asmjit/src/asmjit/core/string.h
@@ -53,9 +53,12 @@ union FixedString {
//! \name Utilities
//! \{
- inline bool eq(const char* other) const noexcept {
- return strcmp(str, other) == 0;
- }
+ inline bool equals(const char* other) const noexcept { return strcmp(str, other) == 0; }
+
+#if !defined(ASMJIT_NO_DEPRECATED)
+ ASMJIT_DEPRECATED("Use FixedString::equals() instead")
+ inline bool eq(const char* other) const noexcept { return equals(other); }
+#endif // !ASMJIT_NO_DEPRECATED
//! \}
};
@@ -131,16 +134,16 @@ public:
//! \{
//! Creates a default-initialized string if zero length.
- inline String() noexcept
+ ASMJIT_INLINE_NODEBUG String() noexcept
: _small {} {}
//! Creates a string that takes ownership of the content of the `other` string.
- inline String(String&& other) noexcept {
+ ASMJIT_INLINE_NODEBUG String(String&& other) noexcept {
_raw = other._raw;
other._resetInternal();
}
- inline ~String() noexcept {
+ ASMJIT_INLINE_NODEBUG ~String() noexcept {
reset();
}
@@ -158,37 +161,37 @@ public:
return *this;
}
- inline bool operator==(const char* other) const noexcept { return eq(other); }
- inline bool operator!=(const char* other) const noexcept { return !eq(other); }
+ ASMJIT_INLINE_NODEBUG bool operator==(const char* other) const noexcept { return equals(other); }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const char* other) const noexcept { return !equals(other); }
- inline bool operator==(const String& other) const noexcept { return eq(other); }
- inline bool operator!=(const String& other) const noexcept { return !eq(other); }
+ ASMJIT_INLINE_NODEBUG bool operator==(const String& other) const noexcept { return equals(other); }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const String& other) const noexcept { return !equals(other); }
//! \}
//! \name Accessors
//! \{
- inline bool isExternal() const noexcept { return _type == kTypeExternal; }
- inline bool isLargeOrExternal() const noexcept { return _type >= kTypeLarge; }
+ ASMJIT_INLINE_NODEBUG bool isExternal() const noexcept { return _type == kTypeExternal; }
+ ASMJIT_INLINE_NODEBUG bool isLargeOrExternal() const noexcept { return _type >= kTypeLarge; }
//! Tests whether the string is empty.
- inline bool empty() const noexcept { return size() == 0; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return size() == 0; }
//! Returns the size of the string.
- inline size_t size() const noexcept { return isLargeOrExternal() ? size_t(_large.size) : size_t(_type); }
+ ASMJIT_INLINE_NODEBUG size_t size() const noexcept { return isLargeOrExternal() ? size_t(_large.size) : size_t(_type); }
//! Returns the capacity of the string.
- inline size_t capacity() const noexcept { return isLargeOrExternal() ? _large.capacity : size_t(kSSOCapacity); }
+ ASMJIT_INLINE_NODEBUG size_t capacity() const noexcept { return isLargeOrExternal() ? _large.capacity : size_t(kSSOCapacity); }
//! Returns the data of the string.
- inline char* data() noexcept { return isLargeOrExternal() ? _large.data : _small.data; }
+ ASMJIT_INLINE_NODEBUG char* data() noexcept { return isLargeOrExternal() ? _large.data : _small.data; }
//! \overload
- inline const char* data() const noexcept { return isLargeOrExternal() ? _large.data : _small.data; }
+ ASMJIT_INLINE_NODEBUG const char* data() const noexcept { return isLargeOrExternal() ? _large.data : _small.data; }
- inline char* start() noexcept { return data(); }
- inline const char* start() const noexcept { return data(); }
+ ASMJIT_INLINE_NODEBUG char* start() noexcept { return data(); }
+ ASMJIT_INLINE_NODEBUG const char* start() const noexcept { return data(); }
- inline char* end() noexcept { return data() + size(); }
- inline const char* end() const noexcept { return data() + size(); }
+ ASMJIT_INLINE_NODEBUG char* end() noexcept { return data() + size(); }
+ ASMJIT_INLINE_NODEBUG const char* end() const noexcept { return data() + size(); }
//! \}
@@ -196,7 +199,7 @@ public:
//! \{
//! Swaps the content of this string with `other`.
- inline void swap(String& other) noexcept {
+ ASMJIT_INLINE_NODEBUG void swap(String& other) noexcept {
std::swap(_raw, other._raw);
}
@@ -219,91 +222,91 @@ public:
ASMJIT_API Error assign(const char* data, size_t size = SIZE_MAX) noexcept;
//! Replaces the current of the string with `other` string.
- inline Error assign(const String& other) noexcept {
+ ASMJIT_INLINE_NODEBUG Error assign(const String& other) noexcept {
return assign(other.data(), other.size());
}
//! Replaces the current of the string by a single `c` character.
- inline Error assign(char c) noexcept {
+ ASMJIT_INLINE_NODEBUG Error assign(char c) noexcept {
return _opChar(ModifyOp::kAssign, c);
}
//! Replaces the current of the string by a `c` character, repeated `n` times.
- inline Error assignChars(char c, size_t n) noexcept {
+ ASMJIT_INLINE_NODEBUG Error assignChars(char c, size_t n) noexcept {
return _opChars(ModifyOp::kAssign, c, n);
}
//! Replaces the current of the string by a formatted integer `i` (signed).
- inline Error assignInt(int64_t i, uint32_t base = 0, size_t width = 0, StringFormatFlags flags = StringFormatFlags::kNone) noexcept {
+ ASMJIT_INLINE_NODEBUG Error assignInt(int64_t i, uint32_t base = 0, size_t width = 0, StringFormatFlags flags = StringFormatFlags::kNone) noexcept {
return _opNumber(ModifyOp::kAssign, uint64_t(i), base, width, flags | StringFormatFlags::kSigned);
}
//! Replaces the current of the string by a formatted integer `i` (unsigned).
- inline Error assignUInt(uint64_t i, uint32_t base = 0, size_t width = 0, StringFormatFlags flags = StringFormatFlags::kNone) noexcept {
+ ASMJIT_INLINE_NODEBUG Error assignUInt(uint64_t i, uint32_t base = 0, size_t width = 0, StringFormatFlags flags = StringFormatFlags::kNone) noexcept {
return _opNumber(ModifyOp::kAssign, i, base, width, flags);
}
//! Replaces the current of the string by the given `data` converted to a HEX string.
- inline Error assignHex(const void* data, size_t size, char separator = '\0') noexcept {
+ ASMJIT_INLINE_NODEBUG Error assignHex(const void* data, size_t size, char separator = '\0') noexcept {
return _opHex(ModifyOp::kAssign, data, size, separator);
}
//! Replaces the current of the string by a formatted string `fmt`.
template<typename... Args>
- inline Error assignFormat(const char* fmt, Args&&... args) noexcept {
+ ASMJIT_INLINE_NODEBUG Error assignFormat(const char* fmt, Args&&... args) noexcept {
return _opFormat(ModifyOp::kAssign, fmt, std::forward<Args>(args)...);
}
//! Replaces the current of the string by a formatted string `fmt` (va_list version).
- inline Error assignVFormat(const char* fmt, va_list ap) noexcept {
+ ASMJIT_INLINE_NODEBUG Error assignVFormat(const char* fmt, va_list ap) noexcept {
return _opVFormat(ModifyOp::kAssign, fmt, ap);
}
//! Appends `str` having the given size `size` to the string.
//!
//! Null terminated strings can set `size` to `SIZE_MAX`.
- inline Error append(const char* str, size_t size = SIZE_MAX) noexcept {
+ ASMJIT_INLINE_NODEBUG Error append(const char* str, size_t size = SIZE_MAX) noexcept {
return _opString(ModifyOp::kAppend, str, size);
}
//! Appends `other` string to this string.
- inline Error append(const String& other) noexcept {
+ ASMJIT_INLINE_NODEBUG Error append(const String& other) noexcept {
return append(other.data(), other.size());
}
//! Appends a single `c` character.
- inline Error append(char c) noexcept {
+ ASMJIT_INLINE_NODEBUG Error append(char c) noexcept {
return _opChar(ModifyOp::kAppend, c);
}
//! Appends `c` character repeated `n` times.
- inline Error appendChars(char c, size_t n) noexcept {
+ ASMJIT_INLINE_NODEBUG Error appendChars(char c, size_t n) noexcept {
return _opChars(ModifyOp::kAppend, c, n);
}
//! Appends a formatted integer `i` (signed).
- inline Error appendInt(int64_t i, uint32_t base = 0, size_t width = 0, StringFormatFlags flags = StringFormatFlags::kNone) noexcept {
+ ASMJIT_INLINE_NODEBUG Error appendInt(int64_t i, uint32_t base = 0, size_t width = 0, StringFormatFlags flags = StringFormatFlags::kNone) noexcept {
return _opNumber(ModifyOp::kAppend, uint64_t(i), base, width, flags | StringFormatFlags::kSigned);
}
//! Appends a formatted integer `i` (unsigned).
- inline Error appendUInt(uint64_t i, uint32_t base = 0, size_t width = 0, StringFormatFlags flags = StringFormatFlags::kNone) noexcept {
+ ASMJIT_INLINE_NODEBUG Error appendUInt(uint64_t i, uint32_t base = 0, size_t width = 0, StringFormatFlags flags = StringFormatFlags::kNone) noexcept {
return _opNumber(ModifyOp::kAppend, i, base, width, flags);
}
//! Appends the given `data` converted to a HEX string.
- inline Error appendHex(const void* data, size_t size, char separator = '\0') noexcept {
+ ASMJIT_INLINE_NODEBUG Error appendHex(const void* data, size_t size, char separator = '\0') noexcept {
return _opHex(ModifyOp::kAppend, data, size, separator);
}
//! Appends a formatted string `fmt` with `args`.
template<typename... Args>
- inline Error appendFormat(const char* fmt, Args&&... args) noexcept {
+ ASMJIT_INLINE_NODEBUG Error appendFormat(const char* fmt, Args&&... args) noexcept {
return _opFormat(ModifyOp::kAppend, fmt, std::forward<Args>(args)...);
}
//! Appends a formatted string `fmt` (va_list version).
- inline Error appendVFormat(const char* fmt, va_list ap) noexcept {
+ ASMJIT_INLINE_NODEBUG Error appendVFormat(const char* fmt, va_list ap) noexcept {
return _opVFormat(ModifyOp::kAppend, fmt, ap);
}
@@ -312,8 +315,16 @@ public:
//! Truncate the string length into `newSize`.
ASMJIT_API Error truncate(size_t newSize) noexcept;
- ASMJIT_API bool eq(const char* other, size_t size = SIZE_MAX) const noexcept;
- inline bool eq(const String& other) const noexcept { return eq(other.data(), other.size()); }
+ ASMJIT_API bool equals(const char* other, size_t size = SIZE_MAX) const noexcept;
+ ASMJIT_INLINE_NODEBUG bool equals(const String& other) const noexcept { return equals(other.data(), other.size()); }
+
+#if !defined(ASMJIT_NO_DEPRECATED)
+ ASMJIT_DEPRECATED("Use String::equals() instead")
+ ASMJIT_INLINE_NODEBUG bool eq(const char* other, size_t size = SIZE_MAX) const noexcept { return equals(other, size); }
+
+ ASMJIT_DEPRECATED("Use String::equals() instead")
+ ASMJIT_INLINE_NODEBUG bool eq(const String& other) const noexcept { return equals(other.data(), other.size()); }
+#endif // !ASMJIT_NO_DEPRECATED
//! \}
@@ -351,7 +362,7 @@ public:
//! \name Construction & Destruction
//! \{
- inline StringTmp() noexcept {
+ ASMJIT_INLINE_NODEBUG StringTmp() noexcept {
_resetToTemporary();
}
diff --git a/3rdparty/asmjit/src/asmjit/core/support.cpp b/3rdparty/asmjit/src/asmjit/core/support.cpp
index 245398fe732..bebabbcc2de 100644
--- a/3rdparty/asmjit/src/asmjit/core/support.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/support.cpp
@@ -15,74 +15,76 @@ ASMJIT_BEGIN_NAMESPACE
template<typename T>
static void testArrays(const T* a, const T* b, size_t size) noexcept {
for (size_t i = 0; i < size; i++)
- EXPECT(a[i] == b[i], "Mismatch at %u", unsigned(i));
+ EXPECT_EQ(a[i], b[i])
+ .message("Mismatch at %u", unsigned(i));
}
static void testAlignment() noexcept {
INFO("Support::isAligned()");
- EXPECT(Support::isAligned<size_t>(0xFFFF, 4) == false);
- EXPECT(Support::isAligned<size_t>(0xFFF4, 4) == true);
- EXPECT(Support::isAligned<size_t>(0xFFF8, 8) == true);
- EXPECT(Support::isAligned<size_t>(0xFFF0, 16) == true);
+ EXPECT_FALSE(Support::isAligned<size_t>(0xFFFF, 4u));
+ EXPECT_TRUE(Support::isAligned<size_t>(0xFFF4, 4u));
+ EXPECT_TRUE(Support::isAligned<size_t>(0xFFF8, 8u));
+ EXPECT_TRUE(Support::isAligned<size_t>(0xFFF0, 16u));
INFO("Support::alignUp()");
- EXPECT(Support::alignUp<size_t>(0xFFFF, 4) == 0x10000);
- EXPECT(Support::alignUp<size_t>(0xFFF4, 4) == 0x0FFF4);
- EXPECT(Support::alignUp<size_t>(0xFFF8, 8) == 0x0FFF8);
- EXPECT(Support::alignUp<size_t>(0xFFF0, 16) == 0x0FFF0);
- EXPECT(Support::alignUp<size_t>(0xFFF0, 32) == 0x10000);
+ EXPECT_EQ(Support::alignUp<size_t>(0xFFFF, 4), 0x10000u);
+ EXPECT_EQ(Support::alignUp<size_t>(0xFFF4, 4), 0x0FFF4u);
+ EXPECT_EQ(Support::alignUp<size_t>(0xFFF8, 8), 0x0FFF8u);
+ EXPECT_EQ(Support::alignUp<size_t>(0xFFF0, 16), 0x0FFF0u);
+ EXPECT_EQ(Support::alignUp<size_t>(0xFFF0, 32), 0x10000u);
INFO("Support::alignUpDiff()");
- EXPECT(Support::alignUpDiff<size_t>(0xFFFF, 4) == 1);
- EXPECT(Support::alignUpDiff<size_t>(0xFFF4, 4) == 0);
- EXPECT(Support::alignUpDiff<size_t>(0xFFF8, 8) == 0);
- EXPECT(Support::alignUpDiff<size_t>(0xFFF0, 16) == 0);
- EXPECT(Support::alignUpDiff<size_t>(0xFFF0, 32) == 16);
+ EXPECT_EQ(Support::alignUpDiff<size_t>(0xFFFF, 4), 1u);
+ EXPECT_EQ(Support::alignUpDiff<size_t>(0xFFF4, 4), 0u);
+ EXPECT_EQ(Support::alignUpDiff<size_t>(0xFFF8, 8), 0u);
+ EXPECT_EQ(Support::alignUpDiff<size_t>(0xFFF0, 16), 0u);
+ EXPECT_EQ(Support::alignUpDiff<size_t>(0xFFF0, 32), 16u);
INFO("Support::alignUpPowerOf2()");
- EXPECT(Support::alignUpPowerOf2<size_t>(0x0000) == 0x00000);
- EXPECT(Support::alignUpPowerOf2<size_t>(0xFFFF) == 0x10000);
- EXPECT(Support::alignUpPowerOf2<size_t>(0xF123) == 0x10000);
- EXPECT(Support::alignUpPowerOf2<size_t>(0x0F00) == 0x01000);
- EXPECT(Support::alignUpPowerOf2<size_t>(0x0100) == 0x00100);
- EXPECT(Support::alignUpPowerOf2<size_t>(0x1001) == 0x02000);
+ EXPECT_EQ(Support::alignUpPowerOf2<size_t>(0x0000), 0x00000u);
+ EXPECT_EQ(Support::alignUpPowerOf2<size_t>(0xFFFF), 0x10000u);
+ EXPECT_EQ(Support::alignUpPowerOf2<size_t>(0xF123), 0x10000u);
+ EXPECT_EQ(Support::alignUpPowerOf2<size_t>(0x0F00), 0x01000u);
+ EXPECT_EQ(Support::alignUpPowerOf2<size_t>(0x0100), 0x00100u);
+ EXPECT_EQ(Support::alignUpPowerOf2<size_t>(0x1001), 0x02000u);
}
static void testBitUtils() noexcept {
uint32_t i;
INFO("Support::shl() / shr()");
- EXPECT(Support::shl(int32_t(0x00001111), 16) == int32_t(0x11110000u));
- EXPECT(Support::shl(uint32_t(0x00001111), 16) == uint32_t(0x11110000u));
- EXPECT(Support::shr(int32_t(0x11110000u), 16) == int32_t(0x00001111u));
- EXPECT(Support::shr(uint32_t(0x11110000u), 16) == uint32_t(0x00001111u));
- EXPECT(Support::sar(int32_t(0xFFFF0000u), 16) == int32_t(0xFFFFFFFFu));
- EXPECT(Support::sar(uint32_t(0xFFFF0000u), 16) == uint32_t(0xFFFFFFFFu));
+ EXPECT_EQ(Support::shl(int32_t(0x00001111), 16), int32_t(0x11110000u));
+ EXPECT_EQ(Support::shl(uint32_t(0x00001111), 16), uint32_t(0x11110000u));
+ EXPECT_EQ(Support::shr(int32_t(0x11110000u), 16), int32_t(0x00001111u));
+ EXPECT_EQ(Support::shr(uint32_t(0x11110000u), 16), uint32_t(0x00001111u));
+ EXPECT_EQ(Support::sar(int32_t(0xFFFF0000u), 16), int32_t(0xFFFFFFFFu));
+ EXPECT_EQ(Support::sar(uint32_t(0xFFFF0000u), 16), uint32_t(0xFFFFFFFFu));
INFO("Support::blsi()");
- for (i = 0; i < 32; i++) EXPECT(Support::blsi(uint32_t(1) << i) == uint32_t(1) << i);
- for (i = 0; i < 31; i++) EXPECT(Support::blsi(uint32_t(3) << i) == uint32_t(1) << i);
- for (i = 0; i < 64; i++) EXPECT(Support::blsi(uint64_t(1) << i) == uint64_t(1) << i);
- for (i = 0; i < 63; i++) EXPECT(Support::blsi(uint64_t(3) << i) == uint64_t(1) << i);
+ for (i = 0; i < 32; i++) EXPECT_EQ(Support::blsi(uint32_t(1) << i), uint32_t(1) << i);
+ for (i = 0; i < 31; i++) EXPECT_EQ(Support::blsi(uint32_t(3) << i), uint32_t(1) << i);
+ for (i = 0; i < 64; i++) EXPECT_EQ(Support::blsi(uint64_t(1) << i), uint64_t(1) << i);
+ for (i = 0; i < 63; i++) EXPECT_EQ(Support::blsi(uint64_t(3) << i), uint64_t(1) << i);
INFO("Support::ctz()");
- for (i = 0; i < 32; i++) EXPECT(Support::Internal::clzFallback(uint32_t(1) << i) == 31 - i);
- for (i = 0; i < 64; i++) EXPECT(Support::Internal::clzFallback(uint64_t(1) << i) == 63 - i);
- for (i = 0; i < 32; i++) EXPECT(Support::Internal::ctzFallback(uint32_t(1) << i) == i);
- for (i = 0; i < 64; i++) EXPECT(Support::Internal::ctzFallback(uint64_t(1) << i) == i);
- for (i = 0; i < 32; i++) EXPECT(Support::clz(uint32_t(1) << i) == 31 - i);
- for (i = 0; i < 64; i++) EXPECT(Support::clz(uint64_t(1) << i) == 63 - i);
- for (i = 0; i < 32; i++) EXPECT(Support::ctz(uint32_t(1) << i) == i);
- for (i = 0; i < 64; i++) EXPECT(Support::ctz(uint64_t(1) << i) == i);
+ for (i = 0; i < 32; i++) EXPECT_EQ(Support::Internal::clzFallback(uint32_t(1) << i), 31 - i);
+ for (i = 0; i < 64; i++) EXPECT_EQ(Support::Internal::clzFallback(uint64_t(1) << i), 63 - i);
+ for (i = 0; i < 32; i++) EXPECT_EQ(Support::Internal::ctzFallback(uint32_t(1) << i), i);
+ for (i = 0; i < 64; i++) EXPECT_EQ(Support::Internal::ctzFallback(uint64_t(1) << i), i);
+ for (i = 0; i < 32; i++) EXPECT_EQ(Support::clz(uint32_t(1) << i), 31 - i);
+ for (i = 0; i < 64; i++) EXPECT_EQ(Support::clz(uint64_t(1) << i), 63 - i);
+ for (i = 0; i < 32; i++) EXPECT_EQ(Support::ctz(uint32_t(1) << i), i);
+ for (i = 0; i < 64; i++) EXPECT_EQ(Support::ctz(uint64_t(1) << i), i);
INFO("Support::bitMask()");
- EXPECT(Support::bitMask(0, 1, 7) == 0x83u);
+ EXPECT_EQ(Support::bitMask(0, 1, 7), 0x83u);
for (i = 0; i < 32; i++)
- EXPECT(Support::bitMask(i) == (1u << i));
+ EXPECT_EQ(Support::bitMask(i), (1u << i));
INFO("Support::bitTest()");
for (i = 0; i < 32; i++) {
- EXPECT(Support::bitTest((1 << i), i) == true, "Support::bitTest(%X, %u) should return true", (1 << i), i);
+ EXPECT_TRUE(Support::bitTest((1 << i), i))
+ .message("Support::bitTest(%X, %u) should return true", (1 << i), i);
}
INFO("Support::lsbMask<uint32_t>()");
@@ -90,7 +92,7 @@ static void testBitUtils() noexcept {
uint32_t expectedBits = 0;
for (uint32_t b = 0; b < i; b++)
expectedBits |= uint32_t(1) << b;
- EXPECT(Support::lsbMask<uint32_t>(i) == expectedBits);
+ EXPECT_EQ(Support::lsbMask<uint32_t>(i), expectedBits);
}
INFO("Support::lsbMask<uint64_t>()");
@@ -98,31 +100,31 @@ static void testBitUtils() noexcept {
uint64_t expectedBits = 0;
for (uint32_t b = 0; b < i; b++)
expectedBits |= uint64_t(1) << b;
- EXPECT(Support::lsbMask<uint64_t>(i) == expectedBits);
+ EXPECT_EQ(Support::lsbMask<uint64_t>(i), expectedBits);
}
INFO("Support::popcnt()");
- for (i = 0; i < 32; i++) EXPECT(Support::popcnt((uint32_t(1) << i)) == 1);
- for (i = 0; i < 64; i++) EXPECT(Support::popcnt((uint64_t(1) << i)) == 1);
- EXPECT(Support::popcnt(0x000000F0) == 4);
- EXPECT(Support::popcnt(0x10101010) == 4);
- EXPECT(Support::popcnt(0xFF000000) == 8);
- EXPECT(Support::popcnt(0xFFFFFFF7) == 31);
- EXPECT(Support::popcnt(0x7FFFFFFF) == 31);
+ for (i = 0; i < 32; i++) EXPECT_EQ(Support::popcnt((uint32_t(1) << i)), 1u);
+ for (i = 0; i < 64; i++) EXPECT_EQ(Support::popcnt((uint64_t(1) << i)), 1u);
+ EXPECT_EQ(Support::popcnt(0x000000F0), 4u);
+ EXPECT_EQ(Support::popcnt(0x10101010), 4u);
+ EXPECT_EQ(Support::popcnt(0xFF000000), 8u);
+ EXPECT_EQ(Support::popcnt(0xFFFFFFF7), 31u);
+ EXPECT_EQ(Support::popcnt(0x7FFFFFFF), 31u);
INFO("Support::isPowerOf2()");
for (i = 0; i < 64; i++) {
- EXPECT(Support::isPowerOf2(uint64_t(1) << i) == true);
- EXPECT(Support::isPowerOf2((uint64_t(1) << i) ^ 0x001101) == false);
+ EXPECT_TRUE(Support::isPowerOf2(uint64_t(1) << i));
+ EXPECT_FALSE(Support::isPowerOf2((uint64_t(1) << i) ^ 0x001101));
}
}
static void testIntUtils() noexcept {
INFO("Support::byteswap()");
- EXPECT(Support::byteswap16(int32_t(0x0102)) == int32_t(0x0201));
- EXPECT(Support::byteswap32(int32_t(0x01020304)) == int32_t(0x04030201));
- EXPECT(Support::byteswap32(uint32_t(0x01020304)) == uint32_t(0x04030201));
- EXPECT(Support::byteswap64(uint64_t(0x0102030405060708)) == uint64_t(0x0807060504030201));
+ EXPECT_EQ(Support::byteswap16(0x0102), 0x0201u);
+ EXPECT_EQ(Support::byteswap32(0x01020304), 0x04030201u);
+ EXPECT_EQ(Support::byteswap32(0x01020304), 0x04030201u);
+ EXPECT_EQ(Support::byteswap64(uint64_t(0x0102030405060708)), uint64_t(0x0807060504030201));
INFO("Support::bytepack()");
union BytePackData {
@@ -131,60 +133,60 @@ static void testIntUtils() noexcept {
} bpdata;
bpdata.u32 = Support::bytepack32_4x8(0x00, 0x11, 0x22, 0x33);
- EXPECT(bpdata.bytes[0] == 0x00);
- EXPECT(bpdata.bytes[1] == 0x11);
- EXPECT(bpdata.bytes[2] == 0x22);
- EXPECT(bpdata.bytes[3] == 0x33);
+ EXPECT_EQ(bpdata.bytes[0], 0x00);
+ EXPECT_EQ(bpdata.bytes[1], 0x11);
+ EXPECT_EQ(bpdata.bytes[2], 0x22);
+ EXPECT_EQ(bpdata.bytes[3], 0x33);
INFO("Support::isBetween()");
- EXPECT(Support::isBetween<int>(10 , 10, 20) == true);
- EXPECT(Support::isBetween<int>(11 , 10, 20) == true);
- EXPECT(Support::isBetween<int>(20 , 10, 20) == true);
- EXPECT(Support::isBetween<int>(9 , 10, 20) == false);
- EXPECT(Support::isBetween<int>(21 , 10, 20) == false);
- EXPECT(Support::isBetween<int>(101, 10, 20) == false);
+ EXPECT_TRUE(Support::isBetween<int>(10 , 10, 20));
+ EXPECT_TRUE(Support::isBetween<int>(11 , 10, 20));
+ EXPECT_TRUE(Support::isBetween<int>(20 , 10, 20));
+ EXPECT_FALSE(Support::isBetween<int>(9 , 10, 20));
+ EXPECT_FALSE(Support::isBetween<int>(21 , 10, 20));
+ EXPECT_FALSE(Support::isBetween<int>(101, 10, 20));
INFO("Support::isInt8()");
- EXPECT(Support::isInt8(-128) == true);
- EXPECT(Support::isInt8( 127) == true);
- EXPECT(Support::isInt8(-129) == false);
- EXPECT(Support::isInt8( 128) == false);
+ EXPECT_TRUE(Support::isInt8(-128));
+ EXPECT_TRUE(Support::isInt8( 127));
+ EXPECT_FALSE(Support::isInt8(-129));
+ EXPECT_FALSE(Support::isInt8( 128));
INFO("Support::isInt16()");
- EXPECT(Support::isInt16(-32768) == true);
- EXPECT(Support::isInt16( 32767) == true);
- EXPECT(Support::isInt16(-32769) == false);
- EXPECT(Support::isInt16( 32768) == false);
+ EXPECT_TRUE(Support::isInt16(-32768));
+ EXPECT_TRUE(Support::isInt16( 32767));
+ EXPECT_FALSE(Support::isInt16(-32769));
+ EXPECT_FALSE(Support::isInt16( 32768));
INFO("Support::isInt32()");
- EXPECT(Support::isInt32( 2147483647 ) == true);
- EXPECT(Support::isInt32(-2147483647 - 1) == true);
- EXPECT(Support::isInt32(uint64_t(2147483648u)) == false);
- EXPECT(Support::isInt32(uint64_t(0xFFFFFFFFu)) == false);
- EXPECT(Support::isInt32(uint64_t(0xFFFFFFFFu) + 1) == false);
+ EXPECT_TRUE(Support::isInt32( 2147483647 ));
+ EXPECT_TRUE(Support::isInt32(-2147483647 - 1));
+ EXPECT_FALSE(Support::isInt32(uint64_t(2147483648u)));
+ EXPECT_FALSE(Support::isInt32(uint64_t(0xFFFFFFFFu)));
+ EXPECT_FALSE(Support::isInt32(uint64_t(0xFFFFFFFFu) + 1));
INFO("Support::isUInt8()");
- EXPECT(Support::isUInt8(0) == true);
- EXPECT(Support::isUInt8(255) == true);
- EXPECT(Support::isUInt8(256) == false);
- EXPECT(Support::isUInt8(-1) == false);
+ EXPECT_TRUE(Support::isUInt8(0) );
+ EXPECT_TRUE(Support::isUInt8(255));
+ EXPECT_FALSE(Support::isUInt8(256));
+ EXPECT_FALSE(Support::isUInt8(-1) );
INFO("Support::isUInt12()");
- EXPECT(Support::isUInt12(0) == true);
- EXPECT(Support::isUInt12(4095) == true);
- EXPECT(Support::isUInt12(4096) == false);
- EXPECT(Support::isUInt12(-1) == false);
+ EXPECT_TRUE(Support::isUInt12(0) );
+ EXPECT_TRUE(Support::isUInt12(4095));
+ EXPECT_FALSE(Support::isUInt12(4096));
+ EXPECT_FALSE(Support::isUInt12(-1) );
INFO("Support::isUInt16()");
- EXPECT(Support::isUInt16(0) == true);
- EXPECT(Support::isUInt16(65535) == true);
- EXPECT(Support::isUInt16(65536) == false);
- EXPECT(Support::isUInt16(-1) == false);
+ EXPECT_TRUE(Support::isUInt16(0) );
+ EXPECT_TRUE(Support::isUInt16(65535));
+ EXPECT_FALSE(Support::isUInt16(65536));
+ EXPECT_FALSE(Support::isUInt16(-1) );
INFO("Support::isUInt32()");
- EXPECT(Support::isUInt32(uint64_t(0xFFFFFFFF)) == true);
- EXPECT(Support::isUInt32(uint64_t(0xFFFFFFFF) + 1) == false);
- EXPECT(Support::isUInt32(-1) == false);
+ EXPECT_TRUE(Support::isUInt32(uint64_t(0xFFFFFFFF)));
+ EXPECT_FALSE(Support::isUInt32(uint64_t(0xFFFFFFFF) + 1));
+ EXPECT_FALSE(Support::isUInt32(-1));
}
static void testReadWrite() noexcept {
@@ -194,17 +196,17 @@ static void testReadWrite() noexcept {
Support::writeU16uBE(arr + 1, 0x0102u);
Support::writeU16uBE(arr + 3, 0x0304u);
- EXPECT(Support::readU32uBE(arr + 1) == 0x01020304u);
- EXPECT(Support::readU32uLE(arr + 1) == 0x04030201u);
- EXPECT(Support::readU32uBE(arr + 2) == 0x02030400u);
- EXPECT(Support::readU32uLE(arr + 2) == 0x00040302u);
+ EXPECT_EQ(Support::readU32uBE(arr + 1), 0x01020304u);
+ EXPECT_EQ(Support::readU32uLE(arr + 1), 0x04030201u);
+ EXPECT_EQ(Support::readU32uBE(arr + 2), 0x02030400u);
+ EXPECT_EQ(Support::readU32uLE(arr + 2), 0x00040302u);
Support::writeU32uLE(arr + 5, 0x05060708u);
- EXPECT(Support::readU64uBE(arr + 1) == 0x0102030408070605u);
- EXPECT(Support::readU64uLE(arr + 1) == 0x0506070804030201u);
+ EXPECT_EQ(Support::readU64uBE(arr + 1), 0x0102030408070605u);
+ EXPECT_EQ(Support::readU64uLE(arr + 1), 0x0506070804030201u);
Support::writeU64uLE(arr + 7, 0x1122334455667788u);
- EXPECT(Support::readU32uBE(arr + 8) == 0x77665544u);
+ EXPECT_EQ(Support::readU32uBE(arr + 8), 0x77665544u);
}
static void testBitVector() noexcept {
@@ -212,132 +214,132 @@ static void testBitVector() noexcept {
{
uint32_t vec[3] = { 0 };
Support::bitVectorFill(vec, 1, 64);
- EXPECT(vec[0] == 0xFFFFFFFEu);
- EXPECT(vec[1] == 0xFFFFFFFFu);
- EXPECT(vec[2] == 0x00000001u);
+ EXPECT_EQ(vec[0], 0xFFFFFFFEu);
+ EXPECT_EQ(vec[1], 0xFFFFFFFFu);
+ EXPECT_EQ(vec[2], 0x00000001u);
Support::bitVectorClear(vec, 1, 1);
- EXPECT(vec[0] == 0xFFFFFFFCu);
- EXPECT(vec[1] == 0xFFFFFFFFu);
- EXPECT(vec[2] == 0x00000001u);
+ EXPECT_EQ(vec[0], 0xFFFFFFFCu);
+ EXPECT_EQ(vec[1], 0xFFFFFFFFu);
+ EXPECT_EQ(vec[2], 0x00000001u);
Support::bitVectorFill(vec, 0, 32);
- EXPECT(vec[0] == 0xFFFFFFFFu);
- EXPECT(vec[1] == 0xFFFFFFFFu);
- EXPECT(vec[2] == 0x00000001u);
+ EXPECT_EQ(vec[0], 0xFFFFFFFFu);
+ EXPECT_EQ(vec[1], 0xFFFFFFFFu);
+ EXPECT_EQ(vec[2], 0x00000001u);
Support::bitVectorClear(vec, 0, 32);
- EXPECT(vec[0] == 0x00000000u);
- EXPECT(vec[1] == 0xFFFFFFFFu);
- EXPECT(vec[2] == 0x00000001u);
+ EXPECT_EQ(vec[0], 0x00000000u);
+ EXPECT_EQ(vec[1], 0xFFFFFFFFu);
+ EXPECT_EQ(vec[2], 0x00000001u);
Support::bitVectorFill(vec, 1, 30);
- EXPECT(vec[0] == 0x7FFFFFFEu);
- EXPECT(vec[1] == 0xFFFFFFFFu);
- EXPECT(vec[2] == 0x00000001u);
+ EXPECT_EQ(vec[0], 0x7FFFFFFEu);
+ EXPECT_EQ(vec[1], 0xFFFFFFFFu);
+ EXPECT_EQ(vec[2], 0x00000001u);
Support::bitVectorClear(vec, 1, 95);
- EXPECT(vec[0] == 0x00000000u);
- EXPECT(vec[1] == 0x00000000u);
- EXPECT(vec[2] == 0x00000000u);
+ EXPECT_EQ(vec[0], 0x00000000u);
+ EXPECT_EQ(vec[1], 0x00000000u);
+ EXPECT_EQ(vec[2], 0x00000000u);
Support::bitVectorFill(vec, 32, 64);
- EXPECT(vec[0] == 0x00000000u);
- EXPECT(vec[1] == 0xFFFFFFFFu);
- EXPECT(vec[2] == 0xFFFFFFFFu);
+ EXPECT_EQ(vec[0], 0x00000000u);
+ EXPECT_EQ(vec[1], 0xFFFFFFFFu);
+ EXPECT_EQ(vec[2], 0xFFFFFFFFu);
Support::bitVectorSetBit(vec, 1, true);
- EXPECT(vec[0] == 0x00000002u);
- EXPECT(vec[1] == 0xFFFFFFFFu);
- EXPECT(vec[2] == 0xFFFFFFFFu);
+ EXPECT_EQ(vec[0], 0x00000002u);
+ EXPECT_EQ(vec[1], 0xFFFFFFFFu);
+ EXPECT_EQ(vec[2], 0xFFFFFFFFu);
Support::bitVectorSetBit(vec, 95, false);
- EXPECT(vec[0] == 0x00000002u);
- EXPECT(vec[1] == 0xFFFFFFFFu);
- EXPECT(vec[2] == 0x7FFFFFFFu);
+ EXPECT_EQ(vec[0], 0x00000002u);
+ EXPECT_EQ(vec[1], 0xFFFFFFFFu);
+ EXPECT_EQ(vec[2], 0x7FFFFFFFu);
Support::bitVectorClear(vec, 33, 32);
- EXPECT(vec[0] == 0x00000002u);
- EXPECT(vec[1] == 0x00000001u);
- EXPECT(vec[2] == 0x7FFFFFFEu);
+ EXPECT_EQ(vec[0], 0x00000002u);
+ EXPECT_EQ(vec[1], 0x00000001u);
+ EXPECT_EQ(vec[2], 0x7FFFFFFEu);
}
INFO("Support::bitVectorIndexOf");
{
uint32_t vec1[1] = { 0x80000000 };
- EXPECT(Support::bitVectorIndexOf(vec1, 0, true) == 31);
- EXPECT(Support::bitVectorIndexOf(vec1, 1, true) == 31);
- EXPECT(Support::bitVectorIndexOf(vec1, 31, true) == 31);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec1, 0, true), 31u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec1, 1, true), 31u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec1, 31, true), 31u);
uint32_t vec2[2] = { 0x00000000, 0x80000000 };
- EXPECT(Support::bitVectorIndexOf(vec2, 0, true) == 63);
- EXPECT(Support::bitVectorIndexOf(vec2, 1, true) == 63);
- EXPECT(Support::bitVectorIndexOf(vec2, 31, true) == 63);
- EXPECT(Support::bitVectorIndexOf(vec2, 32, true) == 63);
- EXPECT(Support::bitVectorIndexOf(vec2, 33, true) == 63);
- EXPECT(Support::bitVectorIndexOf(vec2, 63, true) == 63);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec2, 0, true), 63u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec2, 1, true), 63u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec2, 31, true), 63u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec2, 32, true), 63u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec2, 33, true), 63u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec2, 63, true), 63u);
uint32_t vec3[3] = { 0x00000001, 0x00000000, 0x80000000 };
- EXPECT(Support::bitVectorIndexOf(vec3, 0, true) == 0);
- EXPECT(Support::bitVectorIndexOf(vec3, 1, true) == 95);
- EXPECT(Support::bitVectorIndexOf(vec3, 2, true) == 95);
- EXPECT(Support::bitVectorIndexOf(vec3, 31, true) == 95);
- EXPECT(Support::bitVectorIndexOf(vec3, 32, true) == 95);
- EXPECT(Support::bitVectorIndexOf(vec3, 63, true) == 95);
- EXPECT(Support::bitVectorIndexOf(vec3, 64, true) == 95);
- EXPECT(Support::bitVectorIndexOf(vec3, 95, true) == 95);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec3, 0, true), 0u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec3, 1, true), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec3, 2, true), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec3, 31, true), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec3, 32, true), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec3, 63, true), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec3, 64, true), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec3, 95, true), 95u);
uint32_t vec4[3] = { ~vec3[0], ~vec3[1], ~vec3[2] };
- EXPECT(Support::bitVectorIndexOf(vec4, 0, false) == 0);
- EXPECT(Support::bitVectorIndexOf(vec4, 1, false) == 95);
- EXPECT(Support::bitVectorIndexOf(vec4, 2, false) == 95);
- EXPECT(Support::bitVectorIndexOf(vec4, 31, false) == 95);
- EXPECT(Support::bitVectorIndexOf(vec4, 32, false) == 95);
- EXPECT(Support::bitVectorIndexOf(vec4, 63, false) == 95);
- EXPECT(Support::bitVectorIndexOf(vec4, 64, false) == 95);
- EXPECT(Support::bitVectorIndexOf(vec4, 95, false) == 95);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec4, 0, false), 0u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec4, 1, false), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec4, 2, false), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec4, 31, false), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec4, 32, false), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec4, 63, false), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec4, 64, false), 95u);
+ EXPECT_EQ(Support::bitVectorIndexOf(vec4, 95, false), 95u);
}
INFO("Support::BitWordIterator<uint32_t>");
{
Support::BitWordIterator<uint32_t> it(0x80000F01u);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 0);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 8);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 9);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 10);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 11);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 31);
- EXPECT(!it.hasNext());
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 0u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 8u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 9u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 10u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 11u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 31u);
+ EXPECT_FALSE(it.hasNext());
// No bits set.
it.init(0x00000000u);
- ASMJIT_ASSERT(!it.hasNext());
+ EXPECT_FALSE(it.hasNext());
// Only first bit set.
it.init(0x00000001u);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 0);
- ASMJIT_ASSERT(!it.hasNext());
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 0u);
+ EXPECT_FALSE(it.hasNext());
// Only last bit set (special case).
it.init(0x80000000u);
- ASMJIT_ASSERT(it.hasNext());
- ASMJIT_ASSERT(it.next() == 31);
- ASMJIT_ASSERT(!it.hasNext());
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 31u);
+ EXPECT_FALSE(it.hasNext());
}
INFO("Support::BitWordIterator<uint64_t>");
{
Support::BitWordIterator<uint64_t> it(uint64_t(1) << 63);
- ASMJIT_ASSERT(it.hasNext());
- ASMJIT_ASSERT(it.next() == 63);
- ASMJIT_ASSERT(!it.hasNext());
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 63u);
+ EXPECT_FALSE(it.hasNext());
}
INFO("Support::BitVectorIterator<uint32_t>");
@@ -346,63 +348,63 @@ static void testBitVector() noexcept {
static const uint32_t bitsNone[] = { 0xFFFFFFFFu };
Support::BitVectorIterator<uint32_t> it(bitsNone, 0);
- EXPECT(!it.hasNext());
+ EXPECT_FALSE(it.hasNext());
it.init(bitsNone, 0, 1);
- EXPECT(!it.hasNext());
+ EXPECT_FALSE(it.hasNext());
it.init(bitsNone, 0, 128);
- EXPECT(!it.hasNext());
+ EXPECT_FALSE(it.hasNext());
static const uint32_t bits1[] = { 0x80000008u, 0x80000001u, 0x00000000u, 0x80000000u, 0x00000000u, 0x00000000u, 0x00003000u };
it.init(bits1, ASMJIT_ARRAY_SIZE(bits1));
- EXPECT(it.hasNext());
- EXPECT(it.next() == 3);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 31);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 32);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 63);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 127);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 204);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 205);
- EXPECT(!it.hasNext());
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 3u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 31u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 32u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 63u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 127u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 204u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 205u);
+ EXPECT_FALSE(it.hasNext());
it.init(bits1, ASMJIT_ARRAY_SIZE(bits1), 4);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 31);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 31u);
it.init(bits1, ASMJIT_ARRAY_SIZE(bits1), 64);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 127);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 127u);
it.init(bits1, ASMJIT_ARRAY_SIZE(bits1), 127);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 127);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 127u);
static const uint32_t bits2[] = { 0x80000000u, 0x80000000u, 0x00000000u, 0x80000000u };
it.init(bits2, ASMJIT_ARRAY_SIZE(bits2));
- EXPECT(it.hasNext());
- EXPECT(it.next() == 31);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 63);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 127);
- EXPECT(!it.hasNext());
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 31u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 63u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 127u);
+ EXPECT_FALSE(it.hasNext());
static const uint32_t bits3[] = { 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u };
it.init(bits3, ASMJIT_ARRAY_SIZE(bits3));
- EXPECT(!it.hasNext());
+ EXPECT_FALSE(it.hasNext());
static const uint32_t bits4[] = { 0x00000000u, 0x00000000u, 0x00000000u, 0x80000000u };
it.init(bits4, ASMJIT_ARRAY_SIZE(bits4));
- EXPECT(it.hasNext());
- EXPECT(it.next() == 127);
- EXPECT(!it.hasNext());
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 127u);
+ EXPECT_FALSE(it.hasNext());
}
INFO("Support::BitVectorIterator<uint64_t>");
@@ -410,20 +412,20 @@ static void testBitVector() noexcept {
static const uint64_t bits1[] = { 0x80000000u, 0x80000000u, 0x00000000u, 0x80000000u };
Support::BitVectorIterator<uint64_t> it(bits1, ASMJIT_ARRAY_SIZE(bits1));
- EXPECT(it.hasNext());
- EXPECT(it.next() == 31);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 95);
- EXPECT(it.hasNext());
- EXPECT(it.next() == 223);
- EXPECT(!it.hasNext());
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 31u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 95u);
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 223u);
+ EXPECT_FALSE(it.hasNext());
static const uint64_t bits2[] = { 0x8000000000000000u, 0, 0, 0 };
it.init(bits2, ASMJIT_ARRAY_SIZE(bits2));
- EXPECT(it.hasNext());
- EXPECT(it.next() == 63);
- EXPECT(!it.hasNext());
+ EXPECT_TRUE(it.hasNext());
+ EXPECT_EQ(it.next(), 63u);
+ EXPECT_FALSE(it.hasNext());
}
}
diff --git a/3rdparty/asmjit/src/asmjit/core/support.h b/3rdparty/asmjit/src/asmjit/core/support.h
index e55b8084dbf..b5be91bcd3e 100644
--- a/3rdparty/asmjit/src/asmjit/core/support.h
+++ b/3rdparty/asmjit/src/asmjit/core/support.h
@@ -68,29 +68,29 @@ namespace Internal {
//! \endcond
template<typename T>
-static constexpr bool isUnsigned() noexcept { return std::is_unsigned<T>::value; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isUnsigned() noexcept { return std::is_unsigned<T>::value; }
//! Casts an integer `x` to either `int32_t` or `int64_t` depending on `T`.
template<typename T>
-static constexpr typename Internal::Int32Or64<T, 0>::Type asInt(const T& x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr typename Internal::Int32Or64<T, 0>::Type asInt(const T& x) noexcept {
return (typename Internal::Int32Or64<T, 0>::Type)x;
}
//! Casts an integer `x` to either `uint32_t` or `uint64_t` depending on `T`.
template<typename T>
-static constexpr typename Internal::Int32Or64<T, 1>::Type asUInt(const T& x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr typename Internal::Int32Or64<T, 1>::Type asUInt(const T& x) noexcept {
return (typename Internal::Int32Or64<T, 1>::Type)x;
}
//! Casts an integer `x` to either `int32_t`, uint32_t`, `int64_t`, or `uint64_t` depending on `T`.
template<typename T>
-static constexpr typename Internal::Int32Or64<T>::Type asNormalized(const T& x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr typename Internal::Int32Or64<T>::Type asNormalized(const T& x) noexcept {
return (typename Internal::Int32Or64<T>::Type)x;
}
//! Casts an integer `x` to the same type as defined by `<stdint.h>`.
template<typename T>
-static constexpr typename Internal::StdInt<sizeof(T), isUnsigned<T>()>::Type asStdInt(const T& x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr typename Internal::StdInt<sizeof(T), isUnsigned<T>()>::Type asStdInt(const T& x) noexcept {
return (typename Internal::StdInt<sizeof(T), isUnsigned<T>()>::Type)x;
}
@@ -102,15 +102,15 @@ struct EnumValues {
struct Iterator {
ValueType value;
- inline T operator*() const { return (T)value; }
- inline void operator++() { ++value; }
+ ASMJIT_INLINE_NODEBUG T operator*() const { return (T)value; }
+ ASMJIT_INLINE_NODEBUG void operator++() { ++value; }
- inline bool operator==(const Iterator& other) const noexcept { return value == other.value; }
- inline bool operator!=(const Iterator& other) const noexcept { return value != other.value; }
+ ASMJIT_INLINE_NODEBUG bool operator==(const Iterator& other) const noexcept { return value == other.value; }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const Iterator& other) const noexcept { return value != other.value; }
};
- inline Iterator begin() const noexcept { return Iterator{ValueType(from)}; }
- inline Iterator end() const noexcept { return Iterator{ValueType(to) + 1}; }
+ ASMJIT_INLINE_NODEBUG Iterator begin() const noexcept { return Iterator{ValueType(from)}; }
+ ASMJIT_INLINE_NODEBUG Iterator end() const noexcept { return Iterator{ValueType(to) + 1}; }
};
// Support - BitCast
@@ -120,7 +120,7 @@ struct EnumValues {
namespace Internal {
template<typename DstT, typename SrcT>
union BitCastUnion {
- inline BitCastUnion(SrcT src) noexcept : src(src) {}
+ ASMJIT_INLINE_NODEBUG BitCastUnion(SrcT src) noexcept : src(src) {}
SrcT src;
DstT dst;
};
@@ -131,7 +131,7 @@ namespace Internal {
//!
//! Useful to bit-cast between integers and floating points.
template<typename Dst, typename Src>
-static inline Dst bitCast(const Src& x) noexcept { return Internal::BitCastUnion<Dst, Src>(x).dst; }
+static ASMJIT_INLINE_NODEBUG Dst bitCast(const Src& x) noexcept { return Internal::BitCastUnion<Dst, Src>(x).dst; }
// Support - BitOps
// ================
@@ -140,62 +140,62 @@ static inline Dst bitCast(const Src& x) noexcept { return Internal::BitCastUnion
typedef Internal::StdInt<sizeof(uintptr_t), 1>::Type BitWord;
template<typename T>
-static constexpr uint32_t bitSizeOf() noexcept { return uint32_t(sizeof(T) * 8u); }
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t bitSizeOf() noexcept { return uint32_t(sizeof(T) * 8u); }
//! Number of bits stored in a single `BitWord`.
static constexpr uint32_t kBitWordSizeInBits = bitSizeOf<BitWord>();
//! Returns `0 - x` in a safe way (no undefined behavior), works for unsigned numbers as well.
template<typename T>
-static constexpr T neg(const T& x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr T neg(const T& x) noexcept {
typedef typename std::make_unsigned<T>::type U;
return T(U(0) - U(x));
}
template<typename T>
-static constexpr T allOnes() noexcept { return neg<T>(T(1)); }
+static ASMJIT_INLINE_NODEBUG constexpr T allOnes() noexcept { return neg<T>(T(1)); }
//! Returns `x << y` (shift left logical) by explicitly casting `x` to an unsigned type and back.
template<typename X, typename Y>
-static constexpr X shl(const X& x, const Y& y) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr X shl(const X& x, const Y& y) noexcept {
typedef typename std::make_unsigned<X>::type U;
return X(U(x) << y);
}
//! Returns `x >> y` (shift right logical) by explicitly casting `x` to an unsigned type and back.
template<typename X, typename Y>
-static constexpr X shr(const X& x, const Y& y) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr X shr(const X& x, const Y& y) noexcept {
typedef typename std::make_unsigned<X>::type U;
return X(U(x) >> y);
}
//! Returns `x >> y` (shift right arithmetic) by explicitly casting `x` to a signed type and back.
template<typename X, typename Y>
-static constexpr X sar(const X& x, const Y& y) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr X sar(const X& x, const Y& y) noexcept {
typedef typename std::make_signed<X>::type S;
return X(S(x) >> y);
}
template<typename X, typename Y>
-static constexpr X ror(const X& x, const Y& y) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr X ror(const X& x, const Y& y) noexcept {
typedef typename std::make_unsigned<X>::type U;
- return X((U(x) >> y) | (U(x) << (bitSizeOf<U>() - y)));
+ return X((U(x) >> y) | (U(x) << (bitSizeOf<U>() - U(y))));
}
//! Returns `x | (x >> y)` - helper used by some bit manipulation helpers.
template<typename X, typename Y>
-static constexpr X or_shr(const X& x, const Y& y) noexcept { return X(x | shr(x, y)); }
+static ASMJIT_INLINE_NODEBUG constexpr X or_shr(const X& x, const Y& y) noexcept { return X(x | shr(x, y)); }
//! Returns `x & -x` - extracts lowest set isolated bit (like BLSI instruction).
template<typename T>
-static constexpr T blsi(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr T blsi(T x) noexcept {
typedef typename std::make_unsigned<T>::type U;
return T(U(x) & neg(U(x)));
}
//! Tests whether the given value `x` has `n`th bit set.
template<typename T, typename IndexT>
-static constexpr bool bitTest(T x, IndexT n) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool bitTest(T x, IndexT n) noexcept {
typedef typename std::make_unsigned<T>::type U;
return (U(x) & (U(1) << asStdInt(n))) != 0;
}
@@ -203,7 +203,7 @@ static constexpr bool bitTest(T x, IndexT n) noexcept {
// Tests whether the given `value` is a consecutive mask of bits that starts at
// the least significant bit.
template<typename T>
-static inline constexpr bool isLsbMask(const T& value) {
+static ASMJIT_INLINE_NODEBUG constexpr bool isLsbMask(const T& value) {
typedef typename std::make_unsigned<T>::type U;
return value && ((U(value) + 1u) & U(value)) == 0;
}
@@ -214,14 +214,14 @@ static inline constexpr bool isLsbMask(const T& value) {
// This function is similar to \ref isLsbMask(), but the mask doesn't have to
// start at a least significant bit.
template<typename T>
-static inline constexpr bool isConsecutiveMask(const T& value) {
+static ASMJIT_INLINE_NODEBUG constexpr bool isConsecutiveMask(const T& value) {
typedef typename std::make_unsigned<T>::type U;
return value && isLsbMask((U(value) - 1u) | U(value));
}
//! Generates a trailing bit-mask that has `n` least significant (trailing) bits set.
template<typename T, typename CountT>
-static constexpr T lsbMask(const CountT& n) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr T lsbMask(const CountT& n) noexcept {
typedef typename std::make_unsigned<T>::type U;
return (sizeof(U) < sizeof(uintptr_t))
// Prevent undefined behavior by using a larger type than T.
@@ -230,9 +230,9 @@ static constexpr T lsbMask(const CountT& n) noexcept {
: n ? T(shr(allOnes<T>(), bitSizeOf<T>() - size_t(n))) : T(0);
}
-//! Generats a leading bit-mask that has `n` most significant (leading) bits set.
+//! Generates a leading bit-mask that has `n` most significant (leading) bits set.
template<typename T, typename CountT>
-static constexpr T msbMask(const CountT& n) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr T msbMask(const CountT& n) noexcept {
typedef typename std::make_unsigned<T>::type U;
return (sizeof(U) < sizeof(uintptr_t))
// Prevent undefined behavior by using a larger type than T.
@@ -243,15 +243,15 @@ static constexpr T msbMask(const CountT& n) noexcept {
//! Returns a bit-mask that has `x` bit set.
template<typename Index>
-static constexpr uint32_t bitMask(const Index& x) noexcept { return (1u << asUInt(x)); }
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t bitMask(const Index& x) noexcept { return (1u << asUInt(x)); }
//! Returns a bit-mask that has `x` bit set (multiple arguments).
template<typename Index, typename... Args>
-static constexpr uint32_t bitMask(const Index& x, Args... args) noexcept { return bitMask(x) | bitMask(args...); }
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t bitMask(const Index& x, Args... args) noexcept { return bitMask(x) | bitMask(args...); }
//! Converts a boolean value `b` to zero or full mask (all bits set).
template<typename DstT, typename SrcT>
-static constexpr DstT bitMaskFromBool(SrcT b) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr DstT bitMaskFromBool(SrcT b) noexcept {
typedef typename std::make_unsigned<DstT>::type U;
return DstT(U(0) - U(b));
}
@@ -263,19 +263,19 @@ static inline constexpr bool test(A a, B b) noexcept { return (asUInt(a) & asUIn
//! \cond
namespace Internal {
// Fills all trailing bits right from the first most significant bit set.
- static constexpr uint8_t fillTrailingBitsImpl(uint8_t x) noexcept { return or_shr(or_shr(or_shr(x, 1), 2), 4); }
+ static ASMJIT_INLINE_NODEBUG constexpr uint8_t fillTrailingBitsImpl(uint8_t x) noexcept { return or_shr(or_shr(or_shr(x, 1), 2), 4); }
// Fills all trailing bits right from the first most significant bit set.
- static constexpr uint16_t fillTrailingBitsImpl(uint16_t x) noexcept { return or_shr(or_shr(or_shr(or_shr(x, 1), 2), 4), 8); }
+ static ASMJIT_INLINE_NODEBUG constexpr uint16_t fillTrailingBitsImpl(uint16_t x) noexcept { return or_shr(or_shr(or_shr(or_shr(x, 1), 2), 4), 8); }
// Fills all trailing bits right from the first most significant bit set.
- static constexpr uint32_t fillTrailingBitsImpl(uint32_t x) noexcept { return or_shr(or_shr(or_shr(or_shr(or_shr(x, 1), 2), 4), 8), 16); }
+ static ASMJIT_INLINE_NODEBUG constexpr uint32_t fillTrailingBitsImpl(uint32_t x) noexcept { return or_shr(or_shr(or_shr(or_shr(or_shr(x, 1), 2), 4), 8), 16); }
// Fills all trailing bits right from the first most significant bit set.
- static constexpr uint64_t fillTrailingBitsImpl(uint64_t x) noexcept { return or_shr(or_shr(or_shr(or_shr(or_shr(or_shr(x, 1), 2), 4), 8), 16), 32); }
+ static ASMJIT_INLINE_NODEBUG constexpr uint64_t fillTrailingBitsImpl(uint64_t x) noexcept { return or_shr(or_shr(or_shr(or_shr(or_shr(or_shr(x, 1), 2), 4), 8), 16), 32); }
}
//! \endcond
// Fills all trailing bits right from the first most significant bit set.
template<typename T>
-static constexpr T fillTrailingBits(const T& x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr T fillTrailingBits(const T& x) noexcept {
typedef typename std::make_unsigned<T>::type U;
return T(Internal::fillTrailingBitsImpl(U(x)));
}
@@ -292,59 +292,59 @@ struct BitScanData { T x; uint32_t n; };
template<typename T, uint32_t N>
struct BitScanCalc {
- static constexpr BitScanData<T> advanceLeft(const BitScanData<T>& data, uint32_t n) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr BitScanData<T> advanceLeft(const BitScanData<T>& data, uint32_t n) noexcept {
return BitScanData<T> { data.x << n, data.n + n };
}
- static constexpr BitScanData<T> advanceRight(const BitScanData<T>& data, uint32_t n) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr BitScanData<T> advanceRight(const BitScanData<T>& data, uint32_t n) noexcept {
return BitScanData<T> { data.x >> n, data.n + n };
}
- static constexpr BitScanData<T> clz(const BitScanData<T>& data) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr BitScanData<T> clz(const BitScanData<T>& data) noexcept {
return BitScanCalc<T, N / 2>::clz(advanceLeft(data, data.x & (allOnes<T>() << (bitSizeOf<T>() - N)) ? uint32_t(0) : N));
}
- static constexpr BitScanData<T> ctz(const BitScanData<T>& data) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr BitScanData<T> ctz(const BitScanData<T>& data) noexcept {
return BitScanCalc<T, N / 2>::ctz(advanceRight(data, data.x & (allOnes<T>() >> (bitSizeOf<T>() - N)) ? uint32_t(0) : N));
}
};
template<typename T>
struct BitScanCalc<T, 0> {
- static constexpr BitScanData<T> clz(const BitScanData<T>& ctx) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr BitScanData<T> clz(const BitScanData<T>& ctx) noexcept {
return BitScanData<T> { 0, ctx.n - uint32_t(ctx.x >> (bitSizeOf<T>() - 1)) };
}
- static constexpr BitScanData<T> ctz(const BitScanData<T>& ctx) noexcept {
+ static ASMJIT_INLINE_NODEBUG constexpr BitScanData<T> ctz(const BitScanData<T>& ctx) noexcept {
return BitScanData<T> { 0, ctx.n - uint32_t(ctx.x & 0x1) };
}
};
template<typename T>
-constexpr uint32_t clzFallback(const T& x) noexcept {
+ASMJIT_INLINE_NODEBUG constexpr uint32_t clzFallback(const T& x) noexcept {
return BitScanCalc<T, bitSizeOf<T>() / 2u>::clz(BitScanData<T>{x, 1}).n;
}
template<typename T>
-constexpr uint32_t ctzFallback(const T& x) noexcept {
+ASMJIT_INLINE_NODEBUG constexpr uint32_t ctzFallback(const T& x) noexcept {
return BitScanCalc<T, bitSizeOf<T>() / 2u>::ctz(BitScanData<T>{x, 1}).n;
}
-template<typename T> inline uint32_t clzImpl(const T& x) noexcept { return clzFallback(asUInt(x)); }
-template<typename T> inline uint32_t ctzImpl(const T& x) noexcept { return ctzFallback(asUInt(x)); }
+template<typename T> ASMJIT_INLINE_NODEBUG uint32_t clzImpl(const T& x) noexcept { return clzFallback(asUInt(x)); }
+template<typename T> ASMJIT_INLINE_NODEBUG uint32_t ctzImpl(const T& x) noexcept { return ctzFallback(asUInt(x)); }
#if !defined(ASMJIT_NO_INTRINSICS)
# if defined(__GNUC__)
-template<> inline uint32_t clzImpl(const uint32_t& x) noexcept { return uint32_t(__builtin_clz(x)); }
-template<> inline uint32_t clzImpl(const uint64_t& x) noexcept { return uint32_t(__builtin_clzll(x)); }
-template<> inline uint32_t ctzImpl(const uint32_t& x) noexcept { return uint32_t(__builtin_ctz(x)); }
-template<> inline uint32_t ctzImpl(const uint64_t& x) noexcept { return uint32_t(__builtin_ctzll(x)); }
+template<> ASMJIT_INLINE_NODEBUG uint32_t clzImpl(const uint32_t& x) noexcept { return uint32_t(__builtin_clz(x)); }
+template<> ASMJIT_INLINE_NODEBUG uint32_t clzImpl(const uint64_t& x) noexcept { return uint32_t(__builtin_clzll(x)); }
+template<> ASMJIT_INLINE_NODEBUG uint32_t ctzImpl(const uint32_t& x) noexcept { return uint32_t(__builtin_ctz(x)); }
+template<> ASMJIT_INLINE_NODEBUG uint32_t ctzImpl(const uint64_t& x) noexcept { return uint32_t(__builtin_ctzll(x)); }
# elif defined(_MSC_VER)
-template<> inline uint32_t clzImpl(const uint32_t& x) noexcept { unsigned long i; _BitScanReverse(&i, x); return uint32_t(i ^ 31); }
-template<> inline uint32_t ctzImpl(const uint32_t& x) noexcept { unsigned long i; _BitScanForward(&i, x); return uint32_t(i); }
+template<> ASMJIT_INLINE_NODEBUG uint32_t clzImpl(const uint32_t& x) noexcept { unsigned long i; _BitScanReverse(&i, x); return uint32_t(i ^ 31); }
+template<> ASMJIT_INLINE_NODEBUG uint32_t ctzImpl(const uint32_t& x) noexcept { unsigned long i; _BitScanForward(&i, x); return uint32_t(i); }
# if ASMJIT_ARCH_X86 == 64 || ASMJIT_ARCH_ARM == 64
-template<> inline uint32_t clzImpl(const uint64_t& x) noexcept { unsigned long i; _BitScanReverse64(&i, x); return uint32_t(i ^ 63); }
-template<> inline uint32_t ctzImpl(const uint64_t& x) noexcept { unsigned long i; _BitScanForward64(&i, x); return uint32_t(i); }
+template<> ASMJIT_INLINE_NODEBUG uint32_t clzImpl(const uint64_t& x) noexcept { unsigned long i; _BitScanReverse64(&i, x); return uint32_t(i ^ 63); }
+template<> ASMJIT_INLINE_NODEBUG uint32_t ctzImpl(const uint64_t& x) noexcept { unsigned long i; _BitScanForward64(&i, x); return uint32_t(i); }
# endif
# endif
#endif
@@ -357,13 +357,13 @@ template<> inline uint32_t ctzImpl(const uint64_t& x) noexcept { unsigned long i
//!
//! \note The input MUST NOT be zero, otherwise the result is undefined.
template<typename T>
-static inline uint32_t clz(T x) noexcept { return Internal::clzImpl(asUInt(x)); }
+static ASMJIT_INLINE_NODEBUG uint32_t clz(T x) noexcept { return Internal::clzImpl(asUInt(x)); }
//! Count trailing zeros in `x` (returns a position of a first bit set in `x`).
//!
//! \note The input MUST NOT be zero, otherwise the result is undefined.
template<typename T>
-static inline uint32_t ctz(T x) noexcept { return Internal::ctzImpl(asUInt(x)); }
+static ASMJIT_INLINE_NODEBUG uint32_t ctz(T x) noexcept { return Internal::ctzImpl(asUInt(x)); }
template<uint64_t kInput>
struct ConstCTZ {
@@ -450,49 +450,48 @@ struct ConstCTZ {
//! \cond
namespace Internal {
- static inline uint32_t constPopcntImpl(uint32_t x) noexcept {
+ static ASMJIT_INLINE_NODEBUG uint32_t constPopcntImpl(uint32_t x) noexcept {
x = x - ((x >> 1) & 0x55555555u);
x = (x & 0x33333333u) + ((x >> 2) & 0x33333333u);
return (((x + (x >> 4)) & 0x0F0F0F0Fu) * 0x01010101u) >> 24;
}
- static inline uint32_t constPopcntImpl(uint64_t x) noexcept {
- if (ASMJIT_ARCH_BITS >= 64) {
- x = x - ((x >> 1) & 0x5555555555555555u);
- x = (x & 0x3333333333333333u) + ((x >> 2) & 0x3333333333333333u);
- return uint32_t((((x + (x >> 4)) & 0x0F0F0F0F0F0F0F0Fu) * 0x0101010101010101u) >> 56);
- }
- else {
- return constPopcntImpl(uint32_t(x >> 32)) +
- constPopcntImpl(uint32_t(x & 0xFFFFFFFFu));
- }
+ static ASMJIT_INLINE_NODEBUG uint32_t constPopcntImpl(uint64_t x) noexcept {
+#if ASMJIT_ARCH_BITS >= 64
+ x = x - ((x >> 1) & 0x5555555555555555u);
+ x = (x & 0x3333333333333333u) + ((x >> 2) & 0x3333333333333333u);
+ return uint32_t((((x + (x >> 4)) & 0x0F0F0F0F0F0F0F0Fu) * 0x0101010101010101u) >> 56);
+#else
+ return constPopcntImpl(uint32_t(x >> 32)) +
+ constPopcntImpl(uint32_t(x & 0xFFFFFFFFu));
+#endif
}
- static inline uint32_t popcntImpl(uint32_t x) noexcept {
- #if defined(__GNUC__)
+ static ASMJIT_INLINE_NODEBUG uint32_t popcntImpl(uint32_t x) noexcept {
+#if defined(__GNUC__)
return uint32_t(__builtin_popcount(x));
- #else
+#else
return constPopcntImpl(asUInt(x));
- #endif
+#endif
}
- static inline uint32_t popcntImpl(uint64_t x) noexcept {
- #if defined(__GNUC__)
+ static ASMJIT_INLINE_NODEBUG uint32_t popcntImpl(uint64_t x) noexcept {
+#if defined(__GNUC__)
return uint32_t(__builtin_popcountll(x));
- #else
+#else
return constPopcntImpl(asUInt(x));
- #endif
+#endif
}
}
//! \endcond
//! Calculates count of bits in `x`.
template<typename T>
-static inline uint32_t popcnt(T x) noexcept { return Internal::popcntImpl(asUInt(x)); }
+static ASMJIT_INLINE_NODEBUG uint32_t popcnt(T x) noexcept { return Internal::popcntImpl(asUInt(x)); }
//! Calculates count of bits in `x` (useful in constant expressions).
template<typename T>
-static inline uint32_t constPopcnt(T x) noexcept { return Internal::constPopcntImpl(asUInt(x)); }
+static ASMJIT_INLINE_NODEBUG uint32_t constPopcnt(T x) noexcept { return Internal::constPopcntImpl(asUInt(x)); }
// Support - Min/Max
// =================
@@ -502,16 +501,16 @@ static inline uint32_t constPopcnt(T x) noexcept { return Internal::constPopcntI
// a reference to `a` or `b` but it's a new value instead.
template<typename T>
-static constexpr T min(const T& a, const T& b) noexcept { return b < a ? b : a; }
+static ASMJIT_INLINE_NODEBUG constexpr T min(const T& a, const T& b) noexcept { return b < a ? b : a; }
template<typename T, typename... Args>
-static constexpr T min(const T& a, const T& b, Args&&... args) noexcept { return min(min(a, b), std::forward<Args>(args)...); }
+static ASMJIT_INLINE_NODEBUG constexpr T min(const T& a, const T& b, Args&&... args) noexcept { return min(min(a, b), std::forward<Args>(args)...); }
template<typename T>
-static constexpr T max(const T& a, const T& b) noexcept { return a < b ? b : a; }
+static ASMJIT_INLINE_NODEBUG constexpr T max(const T& a, const T& b) noexcept { return a < b ? b : a; }
template<typename T, typename... Args>
-static constexpr T max(const T& a, const T& b, Args&&... args) noexcept { return max(max(a, b), std::forward<Args>(args)...); }
+static ASMJIT_INLINE_NODEBUG constexpr T max(const T& a, const T& b, Args&&... args) noexcept { return max(max(a, b), std::forward<Args>(args)...); }
// Support - Immediate Helpers
// ===========================
@@ -519,22 +518,22 @@ static constexpr T max(const T& a, const T& b, Args&&... args) noexcept { return
namespace Internal {
template<typename T, bool IsFloat>
struct ImmConv {
- static inline int64_t fromT(const T& x) noexcept { return int64_t(x); }
- static inline T toT(int64_t x) noexcept { return T(uint64_t(x) & Support::allOnes<typename std::make_unsigned<T>::type>()); }
+ static ASMJIT_INLINE_NODEBUG int64_t fromT(const T& x) noexcept { return int64_t(x); }
+ static ASMJIT_INLINE_NODEBUG T toT(int64_t x) noexcept { return T(uint64_t(x) & Support::allOnes<typename std::make_unsigned<T>::type>()); }
};
template<typename T>
struct ImmConv<T, true> {
- static inline int64_t fromT(const T& x) noexcept { return int64_t(bitCast<int64_t>(double(x))); }
- static inline T toT(int64_t x) noexcept { return T(bitCast<double>(x)); }
+ static ASMJIT_INLINE_NODEBUG int64_t fromT(const T& x) noexcept { return int64_t(bitCast<int64_t>(double(x))); }
+ static ASMJIT_INLINE_NODEBUG T toT(int64_t x) noexcept { return T(bitCast<double>(x)); }
};
}
template<typename T>
-static inline int64_t immediateFromT(const T& x) noexcept { return Internal::ImmConv<T, std::is_floating_point<T>::value>::fromT(x); }
+static ASMJIT_INLINE_NODEBUG int64_t immediateFromT(const T& x) noexcept { return Internal::ImmConv<T, std::is_floating_point<T>::value>::fromT(x); }
template<typename T>
-static inline T immediateToT(int64_t x) noexcept { return Internal::ImmConv<T, std::is_floating_point<T>::value>::toT(x); }
+static ASMJIT_INLINE_NODEBUG T immediateToT(int64_t x) noexcept { return Internal::ImmConv<T, std::is_floating_point<T>::value>::toT(x); }
// Support - Overflow Arithmetic
// =============================
@@ -596,9 +595,9 @@ namespace Internal {
template<typename T> inline T subOverflowImpl(const T& x, const T& y, FastUInt8* of) noexcept { return subOverflowFallback(x, y, of); }
template<typename T> inline T mulOverflowImpl(const T& x, const T& y, FastUInt8* of) noexcept { return mulOverflowFallback(x, y, of); }
- #if defined(__GNUC__) && !defined(ASMJIT_NO_INTRINSICS)
- #if defined(__clang__) || __GNUC__ >= 5
- #define ASMJIT_ARITH_OVERFLOW_SPECIALIZE(FUNC, T, RESULT_T, BUILTIN) \
+#if defined(__GNUC__) && !defined(ASMJIT_NO_INTRINSICS)
+#if defined(__clang__) || __GNUC__ >= 5
+#define ASMJIT_ARITH_OVERFLOW_SPECIALIZE(FUNC, T, RESULT_T, BUILTIN) \
template<> \
inline T FUNC(const T& x, const T& y, FastUInt8* of) noexcept { \
RESULT_T result; \
@@ -617,13 +616,13 @@ namespace Internal {
ASMJIT_ARITH_OVERFLOW_SPECIALIZE(mulOverflowImpl, uint32_t, unsigned int , __builtin_umul_overflow )
ASMJIT_ARITH_OVERFLOW_SPECIALIZE(mulOverflowImpl, int64_t , long long , __builtin_smulll_overflow)
ASMJIT_ARITH_OVERFLOW_SPECIALIZE(mulOverflowImpl, uint64_t, unsigned long long, __builtin_umulll_overflow)
- #undef ASMJIT_ARITH_OVERFLOW_SPECIALIZE
- #endif
- #endif
+#undef ASMJIT_ARITH_OVERFLOW_SPECIALIZE
+#endif
+#endif
// There is a bug in MSVC that makes these specializations unusable, maybe in the future...
- #if defined(_MSC_VER) && 0
- #define ASMJIT_ARITH_OVERFLOW_SPECIALIZE(FUNC, T, ALT_T, BUILTIN) \
+#if defined(_MSC_VER) && 0
+#define ASMJIT_ARITH_OVERFLOW_SPECIALIZE(FUNC, T, ALT_T, BUILTIN) \
template<> \
inline T FUNC(T x, T y, FastUInt8* of) noexcept { \
ALT_T result; \
@@ -632,12 +631,12 @@ namespace Internal {
}
ASMJIT_ARITH_OVERFLOW_SPECIALIZE(addOverflowImpl, uint32_t, unsigned int , _addcarry_u32 )
ASMJIT_ARITH_OVERFLOW_SPECIALIZE(subOverflowImpl, uint32_t, unsigned int , _subborrow_u32)
- #if ARCH_BITS >= 64
+#if ARCH_BITS >= 64
ASMJIT_ARITH_OVERFLOW_SPECIALIZE(addOverflowImpl, uint64_t, unsigned __int64 , _addcarry_u64 )
ASMJIT_ARITH_OVERFLOW_SPECIALIZE(subOverflowImpl, uint64_t, unsigned __int64 , _subborrow_u64)
- #endif
- #undef ASMJIT_ARITH_OVERFLOW_SPECIALIZE
- #endif
+#endif
+#undef ASMJIT_ARITH_OVERFLOW_SPECIALIZE
+#endif
} // {Internal}
//! \endcond
@@ -654,26 +653,26 @@ static inline T mulOverflow(const T& x, const T& y, FastUInt8* of) noexcept { re
// ===================
template<typename X, typename Y>
-static constexpr bool isAligned(X base, Y alignment) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isAligned(X base, Y alignment) noexcept {
typedef typename Internal::StdInt<sizeof(X), 1>::Type U;
return ((U)base % (U)alignment) == 0;
}
//! Tests whether the `x` is a power of two (only one bit is set).
template<typename T>
-static constexpr bool isPowerOf2(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isPowerOf2(T x) noexcept {
typedef typename std::make_unsigned<T>::type U;
return x && !(U(x) & (U(x) - U(1)));
}
template<typename X, typename Y>
-static constexpr X alignUp(X x, Y alignment) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr X alignUp(X x, Y alignment) noexcept {
typedef typename Internal::StdInt<sizeof(X), 1>::Type U;
return (X)( ((U)x + ((U)(alignment) - 1u)) & ~((U)(alignment) - 1u) );
}
template<typename T>
-static constexpr T alignUpPowerOf2(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr T alignUpPowerOf2(T x) noexcept {
typedef typename Internal::StdInt<sizeof(T), 1>::Type U;
return (T)(fillTrailingBits(U(x) - 1u) + 1u);
}
@@ -681,13 +680,13 @@ static constexpr T alignUpPowerOf2(T x) noexcept {
//! Returns either zero or a positive difference between `base` and `base` when
//! aligned to `alignment`.
template<typename X, typename Y>
-static constexpr typename Internal::StdInt<sizeof(X), 1>::Type alignUpDiff(X base, Y alignment) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr typename Internal::StdInt<sizeof(X), 1>::Type alignUpDiff(X base, Y alignment) noexcept {
typedef typename Internal::StdInt<sizeof(X), 1>::Type U;
return alignUp(U(base), alignment) - U(base);
}
template<typename X, typename Y>
-static constexpr X alignDown(X x, Y alignment) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr X alignDown(X x, Y alignment) noexcept {
typedef typename Internal::StdInt<sizeof(X), 1>::Type U;
return (X)( (U)x & ~((U)(alignment) - 1u) );
}
@@ -699,7 +698,7 @@ static constexpr X alignDown(X x, Y alignment) noexcept {
//! granularized by `granularity`. This function can be used to calculate
//! the number of BitWords to represent N bits, for example.
template<typename X, typename Y>
-static constexpr X numGranularized(X base, Y granularity) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr X numGranularized(X base, Y granularity) noexcept {
typedef typename Internal::StdInt<sizeof(X), 1>::Type U;
return X((U(base) + U(granularity) - 1) / U(granularity));
}
@@ -709,7 +708,7 @@ static constexpr X numGranularized(X base, Y granularity) noexcept {
//! Checks whether `x` is greater than or equal to `a` and lesser than or equal to `b`.
template<typename T>
-static constexpr bool isBetween(const T& x, const T& a, const T& b) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isBetween(const T& x, const T& a, const T& b) noexcept {
return x >= a && x <= b;
}
@@ -718,7 +717,7 @@ static constexpr bool isBetween(const T& x, const T& a, const T& b) noexcept {
//! Checks whether the given integer `x` can be casted to a 4-bit signed integer.
template<typename T>
-static constexpr bool isInt4(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt4(T x) noexcept {
typedef typename std::make_signed<T>::type S;
typedef typename std::make_unsigned<T>::type U;
@@ -727,7 +726,7 @@ static constexpr bool isInt4(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 7-bit signed integer.
template<typename T>
-static constexpr bool isInt7(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt7(T x) noexcept {
typedef typename std::make_signed<T>::type S;
typedef typename std::make_unsigned<T>::type U;
@@ -736,7 +735,7 @@ static constexpr bool isInt7(T x) noexcept {
//! Checks whether the given integer `x` can be casted to an 8-bit signed integer.
template<typename T>
-static constexpr bool isInt8(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt8(T x) noexcept {
typedef typename std::make_signed<T>::type S;
typedef typename std::make_unsigned<T>::type U;
@@ -745,7 +744,7 @@ static constexpr bool isInt8(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 9-bit signed integer.
template<typename T>
-static constexpr bool isInt9(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt9(T x) noexcept {
typedef typename std::make_signed<T>::type S;
typedef typename std::make_unsigned<T>::type U;
@@ -755,7 +754,7 @@ static constexpr bool isInt9(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 10-bit signed integer.
template<typename T>
-static constexpr bool isInt10(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt10(T x) noexcept {
typedef typename std::make_signed<T>::type S;
typedef typename std::make_unsigned<T>::type U;
@@ -765,7 +764,7 @@ static constexpr bool isInt10(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 16-bit signed integer.
template<typename T>
-static constexpr bool isInt16(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt16(T x) noexcept {
typedef typename std::make_signed<T>::type S;
typedef typename std::make_unsigned<T>::type U;
@@ -775,7 +774,7 @@ static constexpr bool isInt16(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 32-bit signed integer.
template<typename T>
-static constexpr bool isInt32(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt32(T x) noexcept {
typedef typename std::make_signed<T>::type S;
typedef typename std::make_unsigned<T>::type U;
@@ -785,7 +784,7 @@ static constexpr bool isInt32(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 4-bit unsigned integer.
template<typename T>
-static constexpr bool isUInt4(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isUInt4(T x) noexcept {
typedef typename std::make_unsigned<T>::type U;
return std::is_signed<T>::value ? x >= T(0) && x <= T(15)
@@ -794,7 +793,7 @@ static constexpr bool isUInt4(T x) noexcept {
//! Checks whether the given integer `x` can be casted to an 8-bit unsigned integer.
template<typename T>
-static constexpr bool isUInt8(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isUInt8(T x) noexcept {
typedef typename std::make_unsigned<T>::type U;
return std::is_signed<T>::value ? (sizeof(T) <= 1 || T(x) <= T(255)) && x >= T(0)
@@ -803,7 +802,7 @@ static constexpr bool isUInt8(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 12-bit unsigned integer (ARM specific).
template<typename T>
-static constexpr bool isUInt12(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isUInt12(T x) noexcept {
typedef typename std::make_unsigned<T>::type U;
return std::is_signed<T>::value ? (sizeof(T) <= 1 || T(x) <= T(4095)) && x >= T(0)
@@ -812,7 +811,7 @@ static constexpr bool isUInt12(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 16-bit unsigned integer.
template<typename T>
-static constexpr bool isUInt16(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isUInt16(T x) noexcept {
typedef typename std::make_unsigned<T>::type U;
return std::is_signed<T>::value ? (sizeof(T) <= 2 || T(x) <= T(65535)) && x >= T(0)
@@ -821,7 +820,7 @@ static constexpr bool isUInt16(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 32-bit unsigned integer.
template<typename T>
-static constexpr bool isUInt32(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isUInt32(T x) noexcept {
typedef typename std::make_unsigned<T>::type U;
return std::is_signed<T>::value ? (sizeof(T) <= 4 || T(x) <= T(4294967295u)) && x >= T(0)
@@ -830,16 +829,16 @@ static constexpr bool isUInt32(T x) noexcept {
//! Checks whether the given integer `x` can be casted to a 32-bit unsigned integer.
template<typename T>
-static constexpr bool isIntOrUInt32(T x) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isIntOrUInt32(T x) noexcept {
return sizeof(T) <= 4 ? true : (uint32_t(uint64_t(x) >> 32) + 1u) <= 1u;
}
-static bool inline isEncodableOffset32(int32_t offset, uint32_t nBits) noexcept {
+static bool ASMJIT_INLINE_NODEBUG isEncodableOffset32(int32_t offset, uint32_t nBits) noexcept {
uint32_t nRev = 32 - nBits;
return Support::sar(Support::shl(offset, nRev), nRev) == offset;
}
-static bool inline isEncodableOffset64(int64_t offset, uint32_t nBits) noexcept {
+static bool ASMJIT_INLINE_NODEBUG isEncodableOffset64(int64_t offset, uint32_t nBits) noexcept {
uint32_t nRev = 64 - nBits;
return Support::sar(Support::shl(offset, nRev), nRev) == offset;
}
@@ -847,15 +846,15 @@ static bool inline isEncodableOffset64(int64_t offset, uint32_t nBits) noexcept
// Support - ByteSwap
// ==================
-static inline uint16_t byteswap16(uint16_t x) noexcept {
+static ASMJIT_INLINE_NODEBUG uint16_t byteswap16(uint16_t x) noexcept {
return uint16_t(((x >> 8) & 0xFFu) | ((x & 0xFFu) << 8));
}
-static inline uint32_t byteswap32(uint32_t x) noexcept {
+static ASMJIT_INLINE_NODEBUG uint32_t byteswap32(uint32_t x) noexcept {
return (x << 24) | (x >> 24) | ((x << 8) & 0x00FF0000u) | ((x >> 8) & 0x0000FF00);
}
-static inline uint64_t byteswap64(uint64_t x) noexcept {
+static ASMJIT_INLINE_NODEBUG uint64_t byteswap64(uint64_t x) noexcept {
#if (defined(__GNUC__) || defined(__clang__)) && !defined(ASMJIT_NO_INTRINSICS)
return uint64_t(__builtin_bswap64(uint64_t(x)));
#elif defined(_MSC_VER) && !defined(ASMJIT_NO_INTRINSICS)
@@ -870,20 +869,20 @@ static inline uint64_t byteswap64(uint64_t x) noexcept {
// ===========================
//! Pack four 8-bit integer into a 32-bit integer as it is an array of `{b0,b1,b2,b3}`.
-static constexpr uint32_t bytepack32_4x8(uint32_t a, uint32_t b, uint32_t c, uint32_t d) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t bytepack32_4x8(uint32_t a, uint32_t b, uint32_t c, uint32_t d) noexcept {
return ASMJIT_ARCH_LE ? (a | (b << 8) | (c << 16) | (d << 24))
: (d | (c << 8) | (b << 16) | (a << 24));
}
template<typename T>
-static constexpr uint32_t unpackU32At0(T x) noexcept { return ASMJIT_ARCH_LE ? uint32_t(uint64_t(x) & 0xFFFFFFFFu) : uint32_t(uint64_t(x) >> 32); }
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t unpackU32At0(T x) noexcept { return ASMJIT_ARCH_LE ? uint32_t(uint64_t(x) & 0xFFFFFFFFu) : uint32_t(uint64_t(x) >> 32); }
template<typename T>
-static constexpr uint32_t unpackU32At1(T x) noexcept { return ASMJIT_ARCH_BE ? uint32_t(uint64_t(x) & 0xFFFFFFFFu) : uint32_t(uint64_t(x) >> 32); }
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t unpackU32At1(T x) noexcept { return ASMJIT_ARCH_BE ? uint32_t(uint64_t(x) & 0xFFFFFFFFu) : uint32_t(uint64_t(x) >> 32); }
// Support - Position of byte (in bit-shift)
// =========================================
-static inline uint32_t byteShiftOfDWordStruct(uint32_t index) noexcept {
+static ASMJIT_INLINE_NODEBUG uint32_t byteShiftOfDWordStruct(uint32_t index) noexcept {
return ASMJIT_ARCH_LE ? index * 8 : (uint32_t(sizeof(uint32_t)) - 1u - index) * 8;
}
@@ -891,31 +890,31 @@ static inline uint32_t byteShiftOfDWordStruct(uint32_t index) noexcept {
// ==========================
template<typename T>
-static constexpr T asciiToLower(T c) noexcept { return T(c ^ T(T(c >= T('A') && c <= T('Z')) << 5)); }
+static ASMJIT_INLINE_NODEBUG constexpr T asciiToLower(T c) noexcept { return T(c ^ T(T(c >= T('A') && c <= T('Z')) << 5)); }
template<typename T>
-static constexpr T asciiToUpper(T c) noexcept { return T(c ^ T(T(c >= T('a') && c <= T('z')) << 5)); }
+static ASMJIT_INLINE_NODEBUG constexpr T asciiToUpper(T c) noexcept { return T(c ^ T(T(c >= T('a') && c <= T('z')) << 5)); }
-static ASMJIT_FORCE_INLINE size_t strLen(const char* s, size_t maxSize) noexcept {
+static ASMJIT_INLINE_NODEBUG size_t strLen(const char* s, size_t maxSize) noexcept {
size_t i = 0;
while (i < maxSize && s[i] != '\0')
i++;
return i;
}
-static constexpr uint32_t hashRound(uint32_t hash, uint32_t c) noexcept { return hash * 65599 + c; }
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t hashRound(uint32_t hash, uint32_t c) noexcept { return hash * 65599 + c; }
// Gets a hash of the given string `data` of size `size`. Size must be valid
// as this function doesn't check for a null terminator and allows it in the
// middle of the string.
-static inline uint32_t hashString(const char* data, size_t size) noexcept {
+static ASMJIT_INLINE_NODEBUG uint32_t hashString(const char* data, size_t size) noexcept {
uint32_t hashCode = 0;
for (uint32_t i = 0; i < size; i++)
hashCode = hashRound(hashCode, uint8_t(data[i]));
return hashCode;
}
-static ASMJIT_FORCE_INLINE const char* findPackedString(const char* p, uint32_t id) noexcept {
+static ASMJIT_INLINE_NODEBUG const char* findPackedString(const char* p, uint32_t id) noexcept {
uint32_t i = 0;
while (i < id) {
while (p[0])
@@ -926,68 +925,68 @@ static ASMJIT_FORCE_INLINE const char* findPackedString(const char* p, uint32_t
return p;
}
-//! Compares two instruction names.
-//!
-//! `a` is a null terminated instruction name from arch-specific `nameData[]`
-//! table. `b` is a possibly non-null terminated instruction name passed to
-//! `InstAPI::stringToInstId()`.
-static ASMJIT_FORCE_INLINE int cmpInstName(const char* a, const char* b, size_t size) noexcept {
+//! Compares two string views.
+static ASMJIT_FORCE_INLINE int compareStringViews(const char* aData, size_t aSize, const char* bData, size_t bSize) noexcept {
+ size_t size = Support::min(aSize, bSize);
+
for (size_t i = 0; i < size; i++) {
- int c = int(uint8_t(a[i])) - int(uint8_t(b[i]));
- if (c != 0) return c;
+ int c = int(uint8_t(aData[i])) - int(uint8_t(bData[i]));
+ if (c != 0)
+ return c;
}
- return int(uint8_t(a[size]));
+
+ return int(aSize) - int(bSize);
}
// Support - Memory Read Access - 8 Bits
// =====================================
-static inline uint8_t readU8(const void* p) noexcept { return static_cast<const uint8_t*>(p)[0]; }
-static inline int8_t readI8(const void* p) noexcept { return static_cast<const int8_t*>(p)[0]; }
+static ASMJIT_INLINE_NODEBUG uint8_t readU8(const void* p) noexcept { return static_cast<const uint8_t*>(p)[0]; }
+static ASMJIT_INLINE_NODEBUG int8_t readI8(const void* p) noexcept { return static_cast<const int8_t*>(p)[0]; }
// Support - Memory Read Access - 16 Bits
// ======================================
template<ByteOrder BO, size_t Alignment>
-static inline uint16_t readU16x(const void* p) noexcept {
+static ASMJIT_INLINE_NODEBUG uint16_t readU16x(const void* p) noexcept {
typedef typename Internal::AliasedUInt<uint16_t, Alignment>::T U16AlignedToN;
uint16_t x = static_cast<const U16AlignedToN*>(p)[0];
return BO == ByteOrder::kNative ? x : byteswap16(x);
}
template<size_t Alignment = 1>
-static inline uint16_t readU16u(const void* p) noexcept { return readU16x<ByteOrder::kNative, Alignment>(p); }
+static ASMJIT_INLINE_NODEBUG uint16_t readU16u(const void* p) noexcept { return readU16x<ByteOrder::kNative, Alignment>(p); }
template<size_t Alignment = 1>
-static inline uint16_t readU16uLE(const void* p) noexcept { return readU16x<ByteOrder::kLE, Alignment>(p); }
+static ASMJIT_INLINE_NODEBUG uint16_t readU16uLE(const void* p) noexcept { return readU16x<ByteOrder::kLE, Alignment>(p); }
template<size_t Alignment = 1>
-static inline uint16_t readU16uBE(const void* p) noexcept { return readU16x<ByteOrder::kBE, Alignment>(p); }
+static ASMJIT_INLINE_NODEBUG uint16_t readU16uBE(const void* p) noexcept { return readU16x<ByteOrder::kBE, Alignment>(p); }
-static inline uint16_t readU16a(const void* p) noexcept { return readU16x<ByteOrder::kNative, 2>(p); }
-static inline uint16_t readU16aLE(const void* p) noexcept { return readU16x<ByteOrder::kLE, 2>(p); }
-static inline uint16_t readU16aBE(const void* p) noexcept { return readU16x<ByteOrder::kBE, 2>(p); }
+static ASMJIT_INLINE_NODEBUG uint16_t readU16a(const void* p) noexcept { return readU16x<ByteOrder::kNative, 2>(p); }
+static ASMJIT_INLINE_NODEBUG uint16_t readU16aLE(const void* p) noexcept { return readU16x<ByteOrder::kLE, 2>(p); }
+static ASMJIT_INLINE_NODEBUG uint16_t readU16aBE(const void* p) noexcept { return readU16x<ByteOrder::kBE, 2>(p); }
template<ByteOrder BO, size_t Alignment>
-static inline int16_t readI16x(const void* p) noexcept { return int16_t(readU16x<BO, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int16_t readI16x(const void* p) noexcept { return int16_t(readU16x<BO, Alignment>(p)); }
template<size_t Alignment = 1>
-static inline int16_t readI16u(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kNative, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int16_t readI16u(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kNative, Alignment>(p)); }
template<size_t Alignment = 1>
-static inline int16_t readI16uLE(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kLE, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int16_t readI16uLE(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kLE, Alignment>(p)); }
template<size_t Alignment = 1>
-static inline int16_t readI16uBE(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kBE, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int16_t readI16uBE(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kBE, Alignment>(p)); }
-static inline int16_t readI16a(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kNative, 2>(p)); }
-static inline int16_t readI16aLE(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kLE, 2>(p)); }
-static inline int16_t readI16aBE(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kBE, 2>(p)); }
+static ASMJIT_INLINE_NODEBUG int16_t readI16a(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kNative, 2>(p)); }
+static ASMJIT_INLINE_NODEBUG int16_t readI16aLE(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kLE, 2>(p)); }
+static ASMJIT_INLINE_NODEBUG int16_t readI16aBE(const void* p) noexcept { return int16_t(readU16x<ByteOrder::kBE, 2>(p)); }
// Support - Memory Read Access - 24 Bits
// ======================================
template<ByteOrder BO = ByteOrder::kNative>
static inline uint32_t readU24u(const void* p) noexcept {
- uint32_t b0 = readU8(static_cast<const uint8_t*>(p) + (BO == ByteOrder::kLE ? 2 : 0));
- uint32_t b1 = readU8(static_cast<const uint8_t*>(p) + (BO == ByteOrder::kLE ? 1 : 1));
- uint32_t b2 = readU8(static_cast<const uint8_t*>(p) + (BO == ByteOrder::kLE ? 0 : 2));
+ uint32_t b0 = readU8(static_cast<const uint8_t*>(p) + (BO == ByteOrder::kLE ? 2u : 0u));
+ uint32_t b1 = readU8(static_cast<const uint8_t*>(p) + 1u);
+ uint32_t b2 = readU8(static_cast<const uint8_t*>(p) + (BO == ByteOrder::kLE ? 0u : 2u));
return (b0 << 16) | (b1 << 8) | b2;
}
@@ -998,108 +997,108 @@ static inline uint32_t readU24uBE(const void* p) noexcept { return readU24u<Byte
// ======================================
template<ByteOrder BO, size_t Alignment>
-static inline uint32_t readU32x(const void* p) noexcept {
+static ASMJIT_INLINE_NODEBUG uint32_t readU32x(const void* p) noexcept {
typedef typename Internal::AliasedUInt<uint32_t, Alignment>::T U32AlignedToN;
uint32_t x = static_cast<const U32AlignedToN*>(p)[0];
return BO == ByteOrder::kNative ? x : byteswap32(x);
}
template<size_t Alignment = 1>
-static inline uint32_t readU32u(const void* p) noexcept { return readU32x<ByteOrder::kNative, Alignment>(p); }
+static ASMJIT_INLINE_NODEBUG uint32_t readU32u(const void* p) noexcept { return readU32x<ByteOrder::kNative, Alignment>(p); }
template<size_t Alignment = 1>
-static inline uint32_t readU32uLE(const void* p) noexcept { return readU32x<ByteOrder::kLE, Alignment>(p); }
+static ASMJIT_INLINE_NODEBUG uint32_t readU32uLE(const void* p) noexcept { return readU32x<ByteOrder::kLE, Alignment>(p); }
template<size_t Alignment = 1>
-static inline uint32_t readU32uBE(const void* p) noexcept { return readU32x<ByteOrder::kBE, Alignment>(p); }
+static ASMJIT_INLINE_NODEBUG uint32_t readU32uBE(const void* p) noexcept { return readU32x<ByteOrder::kBE, Alignment>(p); }
-static inline uint32_t readU32a(const void* p) noexcept { return readU32x<ByteOrder::kNative, 4>(p); }
-static inline uint32_t readU32aLE(const void* p) noexcept { return readU32x<ByteOrder::kLE, 4>(p); }
-static inline uint32_t readU32aBE(const void* p) noexcept { return readU32x<ByteOrder::kBE, 4>(p); }
+static ASMJIT_INLINE_NODEBUG uint32_t readU32a(const void* p) noexcept { return readU32x<ByteOrder::kNative, 4>(p); }
+static ASMJIT_INLINE_NODEBUG uint32_t readU32aLE(const void* p) noexcept { return readU32x<ByteOrder::kLE, 4>(p); }
+static ASMJIT_INLINE_NODEBUG uint32_t readU32aBE(const void* p) noexcept { return readU32x<ByteOrder::kBE, 4>(p); }
template<ByteOrder BO, size_t Alignment>
-static inline uint32_t readI32x(const void* p) noexcept { return int32_t(readU32x<BO, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG uint32_t readI32x(const void* p) noexcept { return int32_t(readU32x<BO, Alignment>(p)); }
template<size_t Alignment = 1>
-static inline int32_t readI32u(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kNative, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int32_t readI32u(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kNative, Alignment>(p)); }
template<size_t Alignment = 1>
-static inline int32_t readI32uLE(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kLE, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int32_t readI32uLE(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kLE, Alignment>(p)); }
template<size_t Alignment = 1>
-static inline int32_t readI32uBE(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kBE, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int32_t readI32uBE(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kBE, Alignment>(p)); }
-static inline int32_t readI32a(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kNative, 4>(p)); }
-static inline int32_t readI32aLE(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kLE, 4>(p)); }
-static inline int32_t readI32aBE(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kBE, 4>(p)); }
+static ASMJIT_INLINE_NODEBUG int32_t readI32a(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kNative, 4>(p)); }
+static ASMJIT_INLINE_NODEBUG int32_t readI32aLE(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kLE, 4>(p)); }
+static ASMJIT_INLINE_NODEBUG int32_t readI32aBE(const void* p) noexcept { return int32_t(readU32x<ByteOrder::kBE, 4>(p)); }
// Support - Memory Read Access - 64 Bits
// ======================================
template<ByteOrder BO, size_t Alignment>
-static inline uint64_t readU64x(const void* p) noexcept {
+static ASMJIT_INLINE_NODEBUG uint64_t readU64x(const void* p) noexcept {
typedef typename Internal::AliasedUInt<uint64_t, Alignment>::T U64AlignedToN;
uint64_t x = static_cast<const U64AlignedToN*>(p)[0];
return BO == ByteOrder::kNative ? x : byteswap64(x);
}
template<size_t Alignment = 1>
-static inline uint64_t readU64u(const void* p) noexcept { return readU64x<ByteOrder::kNative, Alignment>(p); }
+static ASMJIT_INLINE_NODEBUG uint64_t readU64u(const void* p) noexcept { return readU64x<ByteOrder::kNative, Alignment>(p); }
template<size_t Alignment = 1>
-static inline uint64_t readU64uLE(const void* p) noexcept { return readU64x<ByteOrder::kLE, Alignment>(p); }
+static ASMJIT_INLINE_NODEBUG uint64_t readU64uLE(const void* p) noexcept { return readU64x<ByteOrder::kLE, Alignment>(p); }
template<size_t Alignment = 1>
-static inline uint64_t readU64uBE(const void* p) noexcept { return readU64x<ByteOrder::kBE, Alignment>(p); }
+static ASMJIT_INLINE_NODEBUG uint64_t readU64uBE(const void* p) noexcept { return readU64x<ByteOrder::kBE, Alignment>(p); }
-static inline uint64_t readU64a(const void* p) noexcept { return readU64x<ByteOrder::kNative, 8>(p); }
-static inline uint64_t readU64aLE(const void* p) noexcept { return readU64x<ByteOrder::kLE, 8>(p); }
-static inline uint64_t readU64aBE(const void* p) noexcept { return readU64x<ByteOrder::kBE, 8>(p); }
+static ASMJIT_INLINE_NODEBUG uint64_t readU64a(const void* p) noexcept { return readU64x<ByteOrder::kNative, 8>(p); }
+static ASMJIT_INLINE_NODEBUG uint64_t readU64aLE(const void* p) noexcept { return readU64x<ByteOrder::kLE, 8>(p); }
+static ASMJIT_INLINE_NODEBUG uint64_t readU64aBE(const void* p) noexcept { return readU64x<ByteOrder::kBE, 8>(p); }
template<ByteOrder BO, size_t Alignment>
-static inline int64_t readI64x(const void* p) noexcept { return int64_t(readU64x<BO, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int64_t readI64x(const void* p) noexcept { return int64_t(readU64x<BO, Alignment>(p)); }
template<size_t Alignment = 1>
-static inline int64_t readI64u(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kNative, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int64_t readI64u(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kNative, Alignment>(p)); }
template<size_t Alignment = 1>
-static inline int64_t readI64uLE(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kLE, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int64_t readI64uLE(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kLE, Alignment>(p)); }
template<size_t Alignment = 1>
-static inline int64_t readI64uBE(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kBE, Alignment>(p)); }
+static ASMJIT_INLINE_NODEBUG int64_t readI64uBE(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kBE, Alignment>(p)); }
-static inline int64_t readI64a(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kNative, 8>(p)); }
-static inline int64_t readI64aLE(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kLE, 8>(p)); }
-static inline int64_t readI64aBE(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kBE, 8>(p)); }
+static ASMJIT_INLINE_NODEBUG int64_t readI64a(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kNative, 8>(p)); }
+static ASMJIT_INLINE_NODEBUG int64_t readI64aLE(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kLE, 8>(p)); }
+static ASMJIT_INLINE_NODEBUG int64_t readI64aBE(const void* p) noexcept { return int64_t(readU64x<ByteOrder::kBE, 8>(p)); }
// Support - Memory Write Access - 8 Bits
// ======================================
-static inline void writeU8(void* p, uint8_t x) noexcept { static_cast<uint8_t*>(p)[0] = x; }
-static inline void writeI8(void* p, int8_t x) noexcept { static_cast<int8_t*>(p)[0] = x; }
+static ASMJIT_INLINE_NODEBUG void writeU8(void* p, uint8_t x) noexcept { static_cast<uint8_t*>(p)[0] = x; }
+static ASMJIT_INLINE_NODEBUG void writeI8(void* p, int8_t x) noexcept { static_cast<int8_t*>(p)[0] = x; }
// Support - Memory Write Access - 16 Bits
// =======================================
template<ByteOrder BO = ByteOrder::kNative, size_t Alignment = 1>
-static inline void writeU16x(void* p, uint16_t x) noexcept {
+static ASMJIT_INLINE_NODEBUG void writeU16x(void* p, uint16_t x) noexcept {
typedef typename Internal::AliasedUInt<uint16_t, Alignment>::T U16AlignedToN;
static_cast<U16AlignedToN*>(p)[0] = BO == ByteOrder::kNative ? x : byteswap16(x);
}
template<size_t Alignment = 1>
-static inline void writeU16uLE(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kLE, Alignment>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU16uLE(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kLE, Alignment>(p, x); }
template<size_t Alignment = 1>
-static inline void writeU16uBE(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kBE, Alignment>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU16uBE(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kBE, Alignment>(p, x); }
-static inline void writeU16a(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kNative, 2>(p, x); }
-static inline void writeU16aLE(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kLE, 2>(p, x); }
-static inline void writeU16aBE(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kBE, 2>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU16a(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kNative, 2>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU16aLE(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kLE, 2>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU16aBE(void* p, uint16_t x) noexcept { writeU16x<ByteOrder::kBE, 2>(p, x); }
template<ByteOrder BO = ByteOrder::kNative, size_t Alignment = 1>
-static inline void writeI16x(void* p, int16_t x) noexcept { writeU16x<BO, Alignment>(p, uint16_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI16x(void* p, int16_t x) noexcept { writeU16x<BO, Alignment>(p, uint16_t(x)); }
template<size_t Alignment = 1>
-static inline void writeI16uLE(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kLE, Alignment>(p, uint16_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI16uLE(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kLE, Alignment>(p, uint16_t(x)); }
template<size_t Alignment = 1>
-static inline void writeI16uBE(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kBE, Alignment>(p, uint16_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI16uBE(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kBE, Alignment>(p, uint16_t(x)); }
-static inline void writeI16a(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kNative, 2>(p, uint16_t(x)); }
-static inline void writeI16aLE(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kLE, 2>(p, uint16_t(x)); }
-static inline void writeI16aBE(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kBE, 2>(p, uint16_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI16a(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kNative, 2>(p, uint16_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI16aLE(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kLE, 2>(p, uint16_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI16aBE(void* p, int16_t x) noexcept { writeU16x<ByteOrder::kBE, 2>(p, uint16_t(x)); }
// Support - Memory Write Access - 24 Bits
// =======================================
@@ -1107,7 +1106,7 @@ static inline void writeI16aBE(void* p, int16_t x) noexcept { writeU16x<ByteOrde
template<ByteOrder BO = ByteOrder::kNative>
static inline void writeU24u(void* p, uint32_t v) noexcept {
static_cast<uint8_t*>(p)[0] = uint8_t((v >> (BO == ByteOrder::kLE ? 0 : 16)) & 0xFFu);
- static_cast<uint8_t*>(p)[1] = uint8_t((v >> (BO == ByteOrder::kLE ? 8 : 8)) & 0xFFu);
+ static_cast<uint8_t*>(p)[1] = uint8_t((v >> 8) & 0xFFu);
static_cast<uint8_t*>(p)[2] = uint8_t((v >> (BO == ByteOrder::kLE ? 16 : 0)) & 0xFFu);
}
@@ -1118,85 +1117,85 @@ static inline void writeU24uBE(void* p, uint32_t v) noexcept { writeU24u<ByteOrd
// =======================================
template<ByteOrder BO = ByteOrder::kNative, size_t Alignment = 1>
-static inline void writeU32x(void* p, uint32_t x) noexcept {
+static ASMJIT_INLINE_NODEBUG void writeU32x(void* p, uint32_t x) noexcept {
typedef typename Internal::AliasedUInt<uint32_t, Alignment>::T U32AlignedToN;
static_cast<U32AlignedToN*>(p)[0] = (BO == ByteOrder::kNative) ? x : Support::byteswap32(x);
}
template<size_t Alignment = 1>
-static inline void writeU32u(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kNative, Alignment>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU32u(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kNative, Alignment>(p, x); }
template<size_t Alignment = 1>
-static inline void writeU32uLE(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kLE, Alignment>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU32uLE(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kLE, Alignment>(p, x); }
template<size_t Alignment = 1>
-static inline void writeU32uBE(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kBE, Alignment>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU32uBE(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kBE, Alignment>(p, x); }
-static inline void writeU32a(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kNative, 4>(p, x); }
-static inline void writeU32aLE(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kLE, 4>(p, x); }
-static inline void writeU32aBE(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kBE, 4>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU32a(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kNative, 4>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU32aLE(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kLE, 4>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU32aBE(void* p, uint32_t x) noexcept { writeU32x<ByteOrder::kBE, 4>(p, x); }
template<ByteOrder BO = ByteOrder::kNative, size_t Alignment = 1>
-static inline void writeI32x(void* p, int32_t x) noexcept { writeU32x<BO, Alignment>(p, uint32_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI32x(void* p, int32_t x) noexcept { writeU32x<BO, Alignment>(p, uint32_t(x)); }
template<size_t Alignment = 1>
-static inline void writeI32u(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kNative, Alignment>(p, uint32_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI32u(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kNative, Alignment>(p, uint32_t(x)); }
template<size_t Alignment = 1>
-static inline void writeI32uLE(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kLE, Alignment>(p, uint32_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI32uLE(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kLE, Alignment>(p, uint32_t(x)); }
template<size_t Alignment = 1>
-static inline void writeI32uBE(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kBE, Alignment>(p, uint32_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI32uBE(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kBE, Alignment>(p, uint32_t(x)); }
-static inline void writeI32a(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kNative, 4>(p, uint32_t(x)); }
-static inline void writeI32aLE(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kLE, 4>(p, uint32_t(x)); }
-static inline void writeI32aBE(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kBE, 4>(p, uint32_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI32a(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kNative, 4>(p, uint32_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI32aLE(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kLE, 4>(p, uint32_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI32aBE(void* p, int32_t x) noexcept { writeU32x<ByteOrder::kBE, 4>(p, uint32_t(x)); }
// Support - Memory Write Access - 64 Bits
// =======================================
template<ByteOrder BO = ByteOrder::kNative, size_t Alignment = 1>
-static inline void writeU64x(void* p, uint64_t x) noexcept {
+static ASMJIT_INLINE_NODEBUG void writeU64x(void* p, uint64_t x) noexcept {
typedef typename Internal::AliasedUInt<uint64_t, Alignment>::T U64AlignedToN;
static_cast<U64AlignedToN*>(p)[0] = BO == ByteOrder::kNative ? x : byteswap64(x);
}
template<size_t Alignment = 1>
-static inline void writeU64u(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kNative, Alignment>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU64u(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kNative, Alignment>(p, x); }
template<size_t Alignment = 1>
-static inline void writeU64uLE(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kLE, Alignment>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU64uLE(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kLE, Alignment>(p, x); }
template<size_t Alignment = 1>
-static inline void writeU64uBE(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kBE, Alignment>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU64uBE(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kBE, Alignment>(p, x); }
-static inline void writeU64a(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kNative, 8>(p, x); }
-static inline void writeU64aLE(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kLE, 8>(p, x); }
-static inline void writeU64aBE(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kBE, 8>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU64a(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kNative, 8>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU64aLE(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kLE, 8>(p, x); }
+static ASMJIT_INLINE_NODEBUG void writeU64aBE(void* p, uint64_t x) noexcept { writeU64x<ByteOrder::kBE, 8>(p, x); }
template<ByteOrder BO = ByteOrder::kNative, size_t Alignment = 1>
-static inline void writeI64x(void* p, int64_t x) noexcept { writeU64x<BO, Alignment>(p, uint64_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI64x(void* p, int64_t x) noexcept { writeU64x<BO, Alignment>(p, uint64_t(x)); }
template<size_t Alignment = 1>
-static inline void writeI64u(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kNative, Alignment>(p, uint64_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI64u(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kNative, Alignment>(p, uint64_t(x)); }
template<size_t Alignment = 1>
-static inline void writeI64uLE(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kLE, Alignment>(p, uint64_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI64uLE(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kLE, Alignment>(p, uint64_t(x)); }
template<size_t Alignment = 1>
-static inline void writeI64uBE(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kBE, Alignment>(p, uint64_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI64uBE(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kBE, Alignment>(p, uint64_t(x)); }
-static inline void writeI64a(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kNative, 8>(p, uint64_t(x)); }
-static inline void writeI64aLE(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kLE, 8>(p, uint64_t(x)); }
-static inline void writeI64aBE(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kBE, 8>(p, uint64_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI64a(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kNative, 8>(p, uint64_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI64aLE(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kLE, 8>(p, uint64_t(x)); }
+static ASMJIT_INLINE_NODEBUG void writeI64aBE(void* p, int64_t x) noexcept { writeU64x<ByteOrder::kBE, 8>(p, uint64_t(x)); }
// Support - Operators
// ===================
//! \cond INTERNAL
-struct Set { template<typename T> static inline T op(T x, T y) noexcept { DebugUtils::unused(x); return y; } };
-struct SetNot { template<typename T> static inline T op(T x, T y) noexcept { DebugUtils::unused(x); return ~y; } };
-struct And { template<typename T> static inline T op(T x, T y) noexcept { return x & y; } };
-struct AndNot { template<typename T> static inline T op(T x, T y) noexcept { return x & ~y; } };
-struct NotAnd { template<typename T> static inline T op(T x, T y) noexcept { return ~x & y; } };
-struct Or { template<typename T> static inline T op(T x, T y) noexcept { return x | y; } };
-struct Xor { template<typename T> static inline T op(T x, T y) noexcept { return x ^ y; } };
-struct Add { template<typename T> static inline T op(T x, T y) noexcept { return x + y; } };
-struct Sub { template<typename T> static inline T op(T x, T y) noexcept { return x - y; } };
-struct Min { template<typename T> static inline T op(T x, T y) noexcept { return min<T>(x, y); } };
-struct Max { template<typename T> static inline T op(T x, T y) noexcept { return max<T>(x, y); } };
+struct Set { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { DebugUtils::unused(x); return y; } };
+struct SetNot { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { DebugUtils::unused(x); return ~y; } };
+struct And { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { return x & y; } };
+struct AndNot { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { return x & ~y; } };
+struct NotAnd { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { return ~x & y; } };
+struct Or { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { return x | y; } };
+struct Xor { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { return x ^ y; } };
+struct Add { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { return x + y; } };
+struct Sub { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { return x - y; } };
+struct Min { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { return min<T>(x, y); } };
+struct Max { template<typename T> static ASMJIT_INLINE_NODEBUG T op(T x, T y) noexcept { return max<T>(x, y); } };
//! \endcond
// Support - BitWordIterator
@@ -1218,43 +1217,20 @@ struct Max { template<typename T> static inline T op(T x, T y) noexcept { ret
template<typename T>
class BitWordIterator {
public:
- ASMJIT_FORCE_INLINE explicit BitWordIterator(T bitWord) noexcept
+ ASMJIT_INLINE_NODEBUG explicit BitWordIterator(T bitWord) noexcept
: _bitWord(bitWord) {}
- ASMJIT_FORCE_INLINE void init(T bitWord) noexcept { _bitWord = bitWord; }
- ASMJIT_FORCE_INLINE bool hasNext() const noexcept { return _bitWord != 0; }
+ ASMJIT_INLINE_NODEBUG void init(T bitWord) noexcept { _bitWord = bitWord; }
+ ASMJIT_INLINE_NODEBUG bool hasNext() const noexcept { return _bitWord != 0; }
ASMJIT_FORCE_INLINE uint32_t next() noexcept {
ASMJIT_ASSERT(_bitWord != 0);
uint32_t index = ctz(_bitWord);
- _bitWord ^= T(1u) << index;
- return index;
- }
-
- T _bitWord;
-};
-
-// Support - BitWordFlipIterator
-// =============================
-
-template<typename T>
-class BitWordFlipIterator {
-public:
- ASMJIT_FORCE_INLINE explicit BitWordFlipIterator(T bitWord) noexcept
- : _bitWord(bitWord) {}
-
- ASMJIT_FORCE_INLINE void init(T bitWord) noexcept { _bitWord = bitWord; }
- ASMJIT_FORCE_INLINE bool hasNext() const noexcept { return _bitWord != 0; }
-
- ASMJIT_FORCE_INLINE uint32_t nextAndFlip() noexcept {
- ASMJIT_ASSERT(_bitWord != 0);
- uint32_t index = ctz(_bitWord);
- _bitWord ^= T(1u) << index;
+ _bitWord &= T(_bitWord - 1);
return index;
}
T _bitWord;
- T _xorMask;
};
// Support - BitVectorOps
@@ -1263,7 +1239,7 @@ public:
//! \cond
namespace Internal {
template<typename T, class OperatorT, class FullWordOpT>
- static inline void bitVectorOp(T* buf, size_t index, size_t count) noexcept {
+ static ASMJIT_FORCE_INLINE void bitVectorOp(T* buf, size_t index, size_t count) noexcept {
if (count == 0)
return;
@@ -1297,7 +1273,7 @@ namespace Internal {
//! Sets bit in a bit-vector `buf` at `index`.
template<typename T>
-static inline bool bitVectorGetBit(T* buf, size_t index) noexcept {
+static ASMJIT_INLINE_NODEBUG bool bitVectorGetBit(T* buf, size_t index) noexcept {
const size_t kTSizeInBits = bitSizeOf<T>();
size_t vecIndex = index / kTSizeInBits;
@@ -1308,7 +1284,7 @@ static inline bool bitVectorGetBit(T* buf, size_t index) noexcept {
//! Sets bit in a bit-vector `buf` at `index` to `value`.
template<typename T>
-static inline void bitVectorSetBit(T* buf, size_t index, bool value) noexcept {
+static ASMJIT_INLINE_NODEBUG void bitVectorSetBit(T* buf, size_t index, bool value) noexcept {
const size_t kTSizeInBits = bitSizeOf<T>();
size_t vecIndex = index / kTSizeInBits;
@@ -1323,7 +1299,7 @@ static inline void bitVectorSetBit(T* buf, size_t index, bool value) noexcept {
//! Sets bit in a bit-vector `buf` at `index` to `value`.
template<typename T>
-static inline void bitVectorFlipBit(T* buf, size_t index) noexcept {
+static ASMJIT_INLINE_NODEBUG void bitVectorFlipBit(T* buf, size_t index) noexcept {
const size_t kTSizeInBits = bitSizeOf<T>();
size_t vecIndex = index / kTSizeInBits;
@@ -1335,14 +1311,14 @@ static inline void bitVectorFlipBit(T* buf, size_t index) noexcept {
//! Fills `count` bits in bit-vector `buf` starting at bit-index `index`.
template<typename T>
-static inline void bitVectorFill(T* buf, size_t index, size_t count) noexcept { Internal::bitVectorOp<T, Or, Set>(buf, index, count); }
+static ASMJIT_INLINE_NODEBUG void bitVectorFill(T* buf, size_t index, size_t count) noexcept { Internal::bitVectorOp<T, Or, Set>(buf, index, count); }
//! Clears `count` bits in bit-vector `buf` starting at bit-index `index`.
template<typename T>
-static inline void bitVectorClear(T* buf, size_t index, size_t count) noexcept { Internal::bitVectorOp<T, AndNot, SetNot>(buf, index, count); }
+static ASMJIT_INLINE_NODEBUG void bitVectorClear(T* buf, size_t index, size_t count) noexcept { Internal::bitVectorOp<T, AndNot, SetNot>(buf, index, count); }
template<typename T>
-static inline size_t bitVectorIndexOf(T* buf, size_t start, bool value) noexcept {
+static ASMJIT_FORCE_INLINE size_t bitVectorIndexOf(T* buf, size_t start, bool value) noexcept {
const size_t kTSizeInBits = bitSizeOf<T>();
size_t vecIndex = start / kTSizeInBits; // T[]
size_t bitIndex = start % kTSizeInBits; // T[][]
@@ -1373,9 +1349,9 @@ public:
size_t _end;
T _current;
- ASMJIT_FORCE_INLINE BitVectorIterator(const BitVectorIterator& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG BitVectorIterator(const BitVectorIterator& other) noexcept = default;
- ASMJIT_FORCE_INLINE BitVectorIterator(const T* data, size_t numBitWords, size_t start = 0) noexcept {
+ ASMJIT_INLINE_NODEBUG BitVectorIterator(const T* data, size_t numBitWords, size_t start = 0) noexcept {
init(data, numBitWords, start);
}
@@ -1397,7 +1373,7 @@ public:
_current = bitWord;
}
- ASMJIT_FORCE_INLINE bool hasNext() const noexcept {
+ ASMJIT_INLINE_NODEBUG bool hasNext() const noexcept {
return _current != T(0);
}
@@ -1406,7 +1382,7 @@ public:
ASMJIT_ASSERT(bitWord != T(0));
uint32_t bit = ctz(bitWord);
- bitWord ^= T(1u) << bit;
+ bitWord &= T(bitWord - 1u);
size_t n = _idx + bit;
while (!bitWord && (_idx += bitSizeOf<T>()) < _end)
@@ -1438,7 +1414,7 @@ public:
size_t _end;
T _current;
- ASMJIT_FORCE_INLINE BitVectorOpIterator(const T* aData, const T* bData, size_t numBitWords, size_t start = 0) noexcept {
+ ASMJIT_INLINE_NODEBUG BitVectorOpIterator(const T* aData, const T* bData, size_t numBitWords, size_t start = 0) noexcept {
init(aData, bData, numBitWords, start);
}
@@ -1462,7 +1438,7 @@ public:
_current = bitWord;
}
- ASMJIT_FORCE_INLINE bool hasNext() noexcept {
+ ASMJIT_INLINE_NODEBUG bool hasNext() noexcept {
return _current != T(0);
}
@@ -1471,7 +1447,7 @@ public:
ASMJIT_ASSERT(bitWord != T(0));
uint32_t bit = ctz(bitWord);
- bitWord ^= T(1u) << bit;
+ bitWord &= T(bitWord - 1u);
size_t n = _idx + bit;
while (!bitWord && (_idx += kTSizeInBits) < _end)
@@ -1498,7 +1474,7 @@ enum class SortOrder : uint32_t {
template<SortOrder kOrder = SortOrder::kAscending>
struct Compare {
template<typename A, typename B>
- inline int operator()(const A& a, const B& b) const noexcept {
+ ASMJIT_INLINE_NODEBUG int operator()(const A& a, const B& b) const noexcept {
return kOrder == SortOrder::kAscending ? int(a > b) - int(a < b) : int(a < b) - int(a > b);
}
};
@@ -1587,10 +1563,79 @@ namespace Internal {
//! The main reason to provide a custom qsort implementation is that we needed something that will
//! never throw `bad_alloc` exception. This implementation doesn't use dynamic memory allocation.
template<typename T, class CompareT = Compare<SortOrder::kAscending>>
-static inline void qSort(T* base, size_t size, const CompareT& cmp = CompareT()) noexcept {
+static ASMJIT_INLINE_NODEBUG void qSort(T* base, size_t size, const CompareT& cmp = CompareT()) noexcept {
Internal::QSortImpl<T, CompareT>::sort(base, size, cmp);
}
+// Support - ReverseIterator
+// =========================
+
+//! Reverse iterator to avoid including `<iterator>` header for iteration over arrays, specialized for
+//! AsmJit use (noexcept by design).
+template<typename T>
+class ArrayReverseIterator {
+public:
+ //! \name Members
+ //! \{
+
+ T* _ptr {};
+
+ //! \}
+
+ //! \name Construction & Destruction
+ //! \{
+
+ ASMJIT_INLINE_NODEBUG constexpr ArrayReverseIterator() noexcept = default;
+ ASMJIT_INLINE_NODEBUG constexpr ArrayReverseIterator(const ArrayReverseIterator& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG constexpr ArrayReverseIterator(T* ptr) noexcept : _ptr(ptr) {}
+
+ //! \}
+
+ //! \name Overloaded Operators
+ //! \{
+
+ ASMJIT_INLINE_NODEBUG ArrayReverseIterator& operator=(const ArrayReverseIterator& other) noexcept = default;
+
+ ASMJIT_INLINE_NODEBUG bool operator==(const T* other) const noexcept { return _ptr == other; }
+ ASMJIT_INLINE_NODEBUG bool operator==(const ArrayReverseIterator& other) const noexcept { return _ptr == other._ptr; }
+
+ ASMJIT_INLINE_NODEBUG bool operator!=(const T* other) const noexcept { return _ptr != other; }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const ArrayReverseIterator& other) const noexcept { return _ptr != other._ptr; }
+
+ ASMJIT_INLINE_NODEBUG bool operator<(const T* other) const noexcept { return _ptr < other; }
+ ASMJIT_INLINE_NODEBUG bool operator<(const ArrayReverseIterator& other) const noexcept { return _ptr < other._ptr; }
+
+ ASMJIT_INLINE_NODEBUG bool operator<=(const T* other) const noexcept { return _ptr <= other; }
+ ASMJIT_INLINE_NODEBUG bool operator<=(const ArrayReverseIterator& other) const noexcept { return _ptr <= other._ptr; }
+
+ ASMJIT_INLINE_NODEBUG bool operator>(const T* other) const noexcept { return _ptr > other; }
+ ASMJIT_INLINE_NODEBUG bool operator>(const ArrayReverseIterator& other) const noexcept { return _ptr > other._ptr; }
+
+ ASMJIT_INLINE_NODEBUG bool operator>=(const T* other) const noexcept { return _ptr >= other; }
+ ASMJIT_INLINE_NODEBUG bool operator>=(const ArrayReverseIterator& other) const noexcept { return _ptr >= other._ptr; }
+
+ ASMJIT_INLINE_NODEBUG ArrayReverseIterator& operator++() noexcept { _ptr--; return *this; }
+ ASMJIT_INLINE_NODEBUG ArrayReverseIterator& operator--() noexcept { _ptr++; return *this; }
+
+ ASMJIT_INLINE_NODEBUG ArrayReverseIterator operator++(int) noexcept { ArrayReverseIterator prev(*this); _ptr--; return prev; }
+ ASMJIT_INLINE_NODEBUG ArrayReverseIterator operator--(int) noexcept { ArrayReverseIterator prev(*this); _ptr++; return prev; }
+
+ template<typename Diff> ASMJIT_INLINE_NODEBUG ArrayReverseIterator operator+(const Diff& n) noexcept { return ArrayReverseIterator(_ptr -= n); }
+ template<typename Diff> ASMJIT_INLINE_NODEBUG ArrayReverseIterator operator-(const Diff& n) noexcept { return ArrayReverseIterator(_ptr += n); }
+
+ template<typename Diff> ASMJIT_INLINE_NODEBUG ArrayReverseIterator& operator+=(const Diff& n) noexcept { _ptr -= n; return *this; }
+ template<typename Diff> ASMJIT_INLINE_NODEBUG ArrayReverseIterator& operator-=(const Diff& n) noexcept { _ptr += n; return *this; }
+
+ ASMJIT_INLINE_NODEBUG constexpr T& operator*() const noexcept { return _ptr[-1]; }
+ ASMJIT_INLINE_NODEBUG constexpr T* operator->() const noexcept { return &_ptr[-1]; }
+
+ template<typename Diff> ASMJIT_INLINE_NODEBUG T& operator[](const Diff& n) noexcept { return *(_ptr - n - 1); }
+
+ ASMJIT_INLINE_NODEBUG operator T*() const noexcept { return _ptr; }
+
+ //! \}
+};
+
// Support - Array
// ===============
@@ -1656,26 +1701,26 @@ struct Array {
//! \name Accessors
//! \{
- inline bool empty() const noexcept { return false; }
- inline size_t size() const noexcept { return N; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return false; }
+ ASMJIT_INLINE_NODEBUG size_t size() const noexcept { return N; }
- inline T* data() noexcept { return _data; }
- inline const T* data() const noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG T* data() noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG const T* data() const noexcept { return _data; }
- inline T& front() noexcept { return _data[0]; }
- inline const T& front() const noexcept { return _data[0]; }
+ ASMJIT_INLINE_NODEBUG T& front() noexcept { return _data[0]; }
+ ASMJIT_INLINE_NODEBUG const T& front() const noexcept { return _data[0]; }
- inline T& back() noexcept { return _data[N - 1]; }
- inline const T& back() const noexcept { return _data[N - 1]; }
+ ASMJIT_INLINE_NODEBUG T& back() noexcept { return _data[N - 1]; }
+ ASMJIT_INLINE_NODEBUG const T& back() const noexcept { return _data[N - 1]; }
- inline T* begin() noexcept { return _data; }
- inline T* end() noexcept { return _data + N; }
+ ASMJIT_INLINE_NODEBUG T* begin() noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG T* end() noexcept { return _data + N; }
- inline const T* begin() const noexcept { return _data; }
- inline const T* end() const noexcept { return _data + N; }
+ ASMJIT_INLINE_NODEBUG const T* begin() const noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG const T* end() const noexcept { return _data + N; }
- inline const T* cbegin() const noexcept { return _data; }
- inline const T* cend() const noexcept { return _data + N; }
+ ASMJIT_INLINE_NODEBUG const T* cbegin() const noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG const T* cend() const noexcept { return _data + N; }
//! \}
@@ -1738,8 +1783,8 @@ struct Temporary {
//! \name Construction & Destruction
//! \{
- inline constexpr Temporary(const Temporary& other) noexcept = default;
- inline constexpr Temporary(void* data, size_t size) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Temporary(const Temporary& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG constexpr Temporary(void* data, size_t size) noexcept
: _data(data),
_size(size) {}
@@ -1748,7 +1793,7 @@ struct Temporary {
//! \name Overloaded Operators
//! \{
- inline Temporary& operator=(const Temporary& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG Temporary& operator=(const Temporary& other) noexcept = default;
//! \}
@@ -1757,9 +1802,9 @@ struct Temporary {
//! Returns the data storage.
template<typename T = void>
- inline constexpr T* data() const noexcept { return static_cast<T*>(_data); }
+ ASMJIT_INLINE_NODEBUG constexpr T* data() const noexcept { return static_cast<T*>(_data); }
//! Returns the data storage size in bytes.
- inline constexpr size_t size() const noexcept { return _size; }
+ ASMJIT_INLINE_NODEBUG constexpr size_t size() const noexcept { return _size; }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/support_p.h b/3rdparty/asmjit/src/asmjit/core/support_p.h
new file mode 100644
index 00000000000..1caec9344a4
--- /dev/null
+++ b/3rdparty/asmjit/src/asmjit/core/support_p.h
@@ -0,0 +1,27 @@
+// This file is part of AsmJit project <https://asmjit.com>
+//
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
+
+#ifndef ASMJIT_CORE_SUPPORT_P_H_INCLUDED
+#define ASMJIT_CORE_SUPPORT_P_H_INCLUDED
+
+#include "../core/support.h"
+
+ASMJIT_BEGIN_NAMESPACE
+
+//! \addtogroup asmjit_utilities
+//! \{
+
+namespace Support {
+
+//! \cond INTERNAL
+//! \endcond
+
+} // {Support}
+
+//! \}
+
+ASMJIT_END_NAMESPACE
+
+#endif // ASMJIT_CORE_SUPPORT_P_H_INCLUDED
diff --git a/3rdparty/asmjit/src/asmjit/core/target.cpp b/3rdparty/asmjit/src/asmjit/core/target.cpp
index fef025d709a..cbc6ab51092 100644
--- a/3rdparty/asmjit/src/asmjit/core/target.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/target.cpp
@@ -8,7 +8,9 @@
ASMJIT_BEGIN_NAMESPACE
-Target::Target() noexcept : _environment() {}
+Target::Target() noexcept
+ : _environment{},
+ _cpuFeatures{} {}
Target::~Target() noexcept {}
ASMJIT_END_NAMESPACE
diff --git a/3rdparty/asmjit/src/asmjit/core/target.h b/3rdparty/asmjit/src/asmjit/core/target.h
index 23b0c6294c9..4365be14011 100644
--- a/3rdparty/asmjit/src/asmjit/core/target.h
+++ b/3rdparty/asmjit/src/asmjit/core/target.h
@@ -7,6 +7,7 @@
#define ASMJIT_CORE_TARGET_H_INCLUDED
#include "../core/archtraits.h"
+#include "../core/cpuinfo.h"
#include "../core/func.h"
ASMJIT_BEGIN_NAMESPACE
@@ -22,6 +23,8 @@ public:
//! Target environment information.
Environment _environment;
+ //! Target CPU features.
+ CpuFeatures _cpuFeatures;
//! \name Construction & Destruction
//! \{
@@ -37,11 +40,14 @@ public:
//! \{
//! Returns target's environment.
- inline const Environment& environment() const noexcept { return _environment; }
+ ASMJIT_INLINE_NODEBUG const Environment& environment() const noexcept { return _environment; }
//! Returns the target architecture.
- inline Arch arch() const noexcept { return _environment.arch(); }
+ ASMJIT_INLINE_NODEBUG Arch arch() const noexcept { return _environment.arch(); }
//! Returns the target sub-architecture.
- inline SubArch subArch() const noexcept { return _environment.subArch(); }
+ ASMJIT_INLINE_NODEBUG SubArch subArch() const noexcept { return _environment.subArch(); }
+
+ //! Returns target CPU features.
+ ASMJIT_INLINE_NODEBUG const CpuFeatures& cpuFeatures() const noexcept { return _cpuFeatures; }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/type.h b/3rdparty/asmjit/src/asmjit/core/type.h
index 3754959e4c3..415fe0a421d 100644
--- a/3rdparty/asmjit/src/asmjit/core/type.h
+++ b/3rdparty/asmjit/src/asmjit/core/type.h
@@ -164,74 +164,98 @@ struct TypeData {
ASMJIT_VARAPI const TypeData _typeData;
//! Returns the scalar type of `typeId`.
-static inline TypeId scalarOf(TypeId typeId) noexcept { return _typeData.scalarOf[uint32_t(typeId)]; }
+static ASMJIT_INLINE_NODEBUG TypeId scalarOf(TypeId typeId) noexcept { return _typeData.scalarOf[uint32_t(typeId)]; }
//! Returns the size [in bytes] of `typeId`.
-static inline uint32_t sizeOf(TypeId typeId) noexcept { return _typeData.sizeOf[uint32_t(typeId)]; }
+static ASMJIT_INLINE_NODEBUG uint32_t sizeOf(TypeId typeId) noexcept { return _typeData.sizeOf[uint32_t(typeId)]; }
//! Tests whether a given type `typeId` is between `a` and `b`.
-static inline constexpr bool isBetween(TypeId typeId, TypeId a, TypeId b) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr bool isBetween(TypeId typeId, TypeId a, TypeId b) noexcept {
return Support::isBetween(uint32_t(typeId), uint32_t(a), uint32_t(b));
}
//! Tests whether a given type `typeId` is \ref TypeId::kVoid.
-static inline constexpr bool isVoid(TypeId typeId) noexcept { return typeId == TypeId::kVoid; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isVoid(TypeId typeId) noexcept { return typeId == TypeId::kVoid; }
//! Tests whether a given type `typeId` is a valid non-void type.
-static inline constexpr bool isValid(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kIntStart, TypeId::_kVec512End); }
+static ASMJIT_INLINE_NODEBUG constexpr bool isValid(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kIntStart, TypeId::_kVec512End); }
//! Tests whether a given type `typeId` is scalar (has no vector part).
-static inline constexpr bool isScalar(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kBaseStart, TypeId::_kBaseEnd); }
+static ASMJIT_INLINE_NODEBUG constexpr bool isScalar(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kBaseStart, TypeId::_kBaseEnd); }
//! Tests whether a given type `typeId` is abstract, which means that its size depends on register size.
-static inline constexpr bool isAbstract(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kIntPtr, TypeId::kUIntPtr); }
+static ASMJIT_INLINE_NODEBUG constexpr bool isAbstract(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kIntPtr, TypeId::kUIntPtr); }
//! Tests whether a given type is a scalar integer (signed or unsigned) of any size.
-static inline constexpr bool isInt(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kIntStart, TypeId::_kIntEnd); }
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kIntStart, TypeId::_kIntEnd); }
//! Tests whether a given type is a scalar 8-bit integer (signed).
-static inline constexpr bool isInt8(TypeId typeId) noexcept { return typeId == TypeId::kInt8; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt8(TypeId typeId) noexcept { return typeId == TypeId::kInt8; }
//! Tests whether a given type is a scalar 8-bit integer (unsigned).
-static inline constexpr bool isUInt8(TypeId typeId) noexcept { return typeId == TypeId::kUInt8; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isUInt8(TypeId typeId) noexcept { return typeId == TypeId::kUInt8; }
//! Tests whether a given type is a scalar 16-bit integer (signed).
-static inline constexpr bool isInt16(TypeId typeId) noexcept { return typeId == TypeId::kInt16; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt16(TypeId typeId) noexcept { return typeId == TypeId::kInt16; }
//! Tests whether a given type is a scalar 16-bit integer (unsigned).
-static inline constexpr bool isUInt16(TypeId typeId) noexcept { return typeId == TypeId::kUInt16; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isUInt16(TypeId typeId) noexcept { return typeId == TypeId::kUInt16; }
//! Tests whether a given type is a scalar 32-bit integer (signed).
-static inline constexpr bool isInt32(TypeId typeId) noexcept { return typeId == TypeId::kInt32; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt32(TypeId typeId) noexcept { return typeId == TypeId::kInt32; }
//! Tests whether a given type is a scalar 32-bit integer (unsigned).
-static inline constexpr bool isUInt32(TypeId typeId) noexcept { return typeId == TypeId::kUInt32; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isUInt32(TypeId typeId) noexcept { return typeId == TypeId::kUInt32; }
//! Tests whether a given type is a scalar 64-bit integer (signed).
-static inline constexpr bool isInt64(TypeId typeId) noexcept { return typeId == TypeId::kInt64; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isInt64(TypeId typeId) noexcept { return typeId == TypeId::kInt64; }
//! Tests whether a given type is a scalar 64-bit integer (unsigned).
-static inline constexpr bool isUInt64(TypeId typeId) noexcept { return typeId == TypeId::kUInt64; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isUInt64(TypeId typeId) noexcept { return typeId == TypeId::kUInt64; }
-static inline constexpr bool isGp8(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kInt8, TypeId::kUInt8); }
-static inline constexpr bool isGp16(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kInt16, TypeId::kUInt16); }
-static inline constexpr bool isGp32(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kInt32, TypeId::kUInt32); }
-static inline constexpr bool isGp64(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kInt64, TypeId::kUInt64); }
+//! Tests whether a given type is an 8-bit general purpose register representing either signed or unsigned 8-bit integer.
+static ASMJIT_INLINE_NODEBUG constexpr bool isGp8(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kInt8, TypeId::kUInt8); }
+//! Tests whether a given type is a 16-bit general purpose register representing either signed or unsigned 16-bit integer
+static ASMJIT_INLINE_NODEBUG constexpr bool isGp16(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kInt16, TypeId::kUInt16); }
+//! Tests whether a given type is a 32-bit general purpose register representing either signed or unsigned 32-bit integer
+static ASMJIT_INLINE_NODEBUG constexpr bool isGp32(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kInt32, TypeId::kUInt32); }
+//! Tests whether a given type is a 64-bit general purpose register representing either signed or unsigned 64-bit integer
+static ASMJIT_INLINE_NODEBUG constexpr bool isGp64(TypeId typeId) noexcept { return isBetween(typeId, TypeId::kInt64, TypeId::kUInt64); }
//! Tests whether a given type is a scalar floating point of any size.
-static inline constexpr bool isFloat(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kFloatStart, TypeId::_kFloatEnd); }
+static ASMJIT_INLINE_NODEBUG constexpr bool isFloat(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kFloatStart, TypeId::_kFloatEnd); }
//! Tests whether a given type is a scalar 32-bit float.
-static inline constexpr bool isFloat32(TypeId typeId) noexcept { return typeId == TypeId::kFloat32; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isFloat32(TypeId typeId) noexcept { return typeId == TypeId::kFloat32; }
//! Tests whether a given type is a scalar 64-bit float.
-static inline constexpr bool isFloat64(TypeId typeId) noexcept { return typeId == TypeId::kFloat64; }
+static ASMJIT_INLINE_NODEBUG constexpr bool isFloat64(TypeId typeId) noexcept { return typeId == TypeId::kFloat64; }
//! Tests whether a given type is a scalar 80-bit float.
-static inline constexpr bool isFloat80(TypeId typeId) noexcept { return typeId == TypeId::kFloat80; }
-
-static inline constexpr bool isMask(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kMaskStart, TypeId::_kMaskEnd); }
-static inline constexpr bool isMask8(TypeId typeId) noexcept { return typeId == TypeId::kMask8; }
-static inline constexpr bool isMask16(TypeId typeId) noexcept { return typeId == TypeId::kMask16; }
-static inline constexpr bool isMask32(TypeId typeId) noexcept { return typeId == TypeId::kMask32; }
-static inline constexpr bool isMask64(TypeId typeId) noexcept { return typeId == TypeId::kMask64; }
-
-static inline constexpr bool isMmx(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kMmxStart, TypeId::_kMmxEnd); }
-static inline constexpr bool isMmx32(TypeId typeId) noexcept { return typeId == TypeId::kMmx32; }
-static inline constexpr bool isMmx64(TypeId typeId) noexcept { return typeId == TypeId::kMmx64; }
-
-static inline constexpr bool isVec(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec32Start, TypeId::_kVec512End); }
-static inline constexpr bool isVec32(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec32Start, TypeId::_kVec32End); }
-static inline constexpr bool isVec64(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec64Start, TypeId::_kVec64End); }
-static inline constexpr bool isVec128(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec128Start, TypeId::_kVec128End); }
-static inline constexpr bool isVec256(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec256Start, TypeId::_kVec256End); }
-static inline constexpr bool isVec512(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec512Start, TypeId::_kVec512End); }
+static ASMJIT_INLINE_NODEBUG constexpr bool isFloat80(TypeId typeId) noexcept { return typeId == TypeId::kFloat80; }
+
+//! Tests whether a given type is a mask register of any size.
+static ASMJIT_INLINE_NODEBUG constexpr bool isMask(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kMaskStart, TypeId::_kMaskEnd); }
+//! Tests whether a given type is an 8-bit mask register.
+static ASMJIT_INLINE_NODEBUG constexpr bool isMask8(TypeId typeId) noexcept { return typeId == TypeId::kMask8; }
+//! Tests whether a given type is an 16-bit mask register.
+static ASMJIT_INLINE_NODEBUG constexpr bool isMask16(TypeId typeId) noexcept { return typeId == TypeId::kMask16; }
+//! Tests whether a given type is an 32-bit mask register.
+static ASMJIT_INLINE_NODEBUG constexpr bool isMask32(TypeId typeId) noexcept { return typeId == TypeId::kMask32; }
+//! Tests whether a given type is an 64-bit mask register.
+static ASMJIT_INLINE_NODEBUG constexpr bool isMask64(TypeId typeId) noexcept { return typeId == TypeId::kMask64; }
+
+//! Tests whether a given type is an MMX register.
+//!
+//! \note MMX functionality is in general deprecated on X86 architecture. AsmJit provides it just for completeness.
+static ASMJIT_INLINE_NODEBUG constexpr bool isMmx(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kMmxStart, TypeId::_kMmxEnd); }
+//! Tests whether a given type is an MMX register, which only uses the low 32 bits of data (only specific cases).
+//!
+//! \note MMX functionality is in general deprecated on X86 architecture. AsmJit provides it just for completeness.
+static ASMJIT_INLINE_NODEBUG constexpr bool isMmx32(TypeId typeId) noexcept { return typeId == TypeId::kMmx32; }
+//! Tests whether a given type is an MMX register, which uses 64 bits of data (default).
+//!
+//! \note MMX functionality is in general deprecated on X86 architecture. AsmJit provides it just for completeness.
+static ASMJIT_INLINE_NODEBUG constexpr bool isMmx64(TypeId typeId) noexcept { return typeId == TypeId::kMmx64; }
+
+//! Tests whether a given type is a vector register of any size.
+static ASMJIT_INLINE_NODEBUG constexpr bool isVec(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec32Start, TypeId::_kVec512End); }
+//! Tests whether a given type is a 32-bit or 32-bit view of a vector register.
+static ASMJIT_INLINE_NODEBUG constexpr bool isVec32(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec32Start, TypeId::_kVec32End); }
+//! Tests whether a given type is a 64-bit or 64-bit view of a vector register.
+static ASMJIT_INLINE_NODEBUG constexpr bool isVec64(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec64Start, TypeId::_kVec64End); }
+//! Tests whether a given type is a 128-bit or 128-bit view of a vector register.
+static ASMJIT_INLINE_NODEBUG constexpr bool isVec128(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec128Start, TypeId::_kVec128End); }
+//! Tests whether a given type is a 256-bit or 256-bit view of a vector register.
+static ASMJIT_INLINE_NODEBUG constexpr bool isVec256(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec256Start, TypeId::_kVec256End); }
+//! Tests whether a given type is a 512-bit or 512-bit view of a vector register.
+static ASMJIT_INLINE_NODEBUG constexpr bool isVec512(TypeId typeId) noexcept { return isBetween(typeId, TypeId::_kVec512Start, TypeId::_kVec512End); }
//! \cond
enum TypeCategory : uint32_t {
@@ -317,7 +341,7 @@ struct TypeIdOfT<T&> {
//! Returns a corresponding \ref TypeId of `T` type.
template<typename T>
-static inline constexpr TypeId typeIdOfT() noexcept { return TypeId(TypeIdOfT<T>::kTypeId); }
+static ASMJIT_INLINE_NODEBUG constexpr TypeId typeIdOfT() noexcept { return TypeId(TypeIdOfT<T>::kTypeId); }
//! Returns offset needed to convert a `kIntPtr` and `kUIntPtr` TypeId into a type that matches `registerSize`
//! (general-purpose register size). If you find such TypeId it's then only about adding the offset to it.
@@ -336,18 +360,18 @@ static inline constexpr TypeId typeIdOfT() noexcept { return TypeId(TypeIdOfT<T>
//! // The same, but by using TypeUtils::deabstract() function.
//! typeId = TypeUtils::deabstract(typeId, deabstractDelta);
//! ```
-static inline constexpr uint32_t deabstractDeltaOfSize(uint32_t registerSize) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t deabstractDeltaOfSize(uint32_t registerSize) noexcept {
return registerSize >= 8 ? uint32_t(TypeId::kInt64) - uint32_t(TypeId::kIntPtr)
: uint32_t(TypeId::kInt32) - uint32_t(TypeId::kIntPtr);
}
//! Deabstracts a given `typeId` into a native type by using `deabstractDelta`, which was previously
//! calculated by calling \ref deabstractDeltaOfSize() with a target native register size.
-static inline constexpr TypeId deabstract(TypeId typeId, uint32_t deabstractDelta) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr TypeId deabstract(TypeId typeId, uint32_t deabstractDelta) noexcept {
return isAbstract(typeId) ? TypeId(uint32_t(typeId) + deabstractDelta) : typeId;
}
-static inline constexpr TypeId scalarToVector(TypeId scalarTypeId, TypeId vecStartId) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr TypeId scalarToVector(TypeId scalarTypeId, TypeId vecStartId) noexcept {
return TypeId(uint32_t(vecStartId) + uint32_t(scalarTypeId) - uint32_t(TypeId::kInt8));
}
diff --git a/3rdparty/asmjit/src/asmjit/core/virtmem.cpp b/3rdparty/asmjit/src/asmjit/core/virtmem.cpp
index 43766ef2cd2..743847746af 100644
--- a/3rdparty/asmjit/src/asmjit/core/virtmem.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/virtmem.cpp
@@ -6,7 +6,7 @@
#include "../core/api-build_p.h"
#ifndef ASMJIT_NO_JIT
-#include "../core/osutils.h"
+#include "../core/osutils_p.h"
#include "../core/string.h"
#include "../core/support.h"
#include "../core/virtmem.h"
@@ -19,9 +19,42 @@
#include <sys/types.h>
#include <unistd.h>
+ #if !ASMJIT_ARCH_X86
+ #include <sys/time.h> // required by gettimeofday()
+ #endif
+
// Linux has a `memfd_create` syscall that we would like to use, if available.
#if defined(__linux__)
#include <sys/syscall.h>
+ #include <sys/utsname.h>
+
+ #ifndef MAP_HUGETLB
+ #define MAP_HUGETLB 0x40000
+ #endif // MAP_HUGETLB
+
+ #ifndef MAP_HUGE_SHIFT
+ #define MAP_HUGE_SHIFT 26
+ #endif // MAP_HUGE_SHIFT
+
+ #if !defined(MFD_CLOEXEC)
+ #define MFD_CLOEXEC 0x0001u
+ #endif // MFD_CLOEXEC
+
+ #if !defined(MFD_NOEXEC_SEAL)
+ #define MFD_NOEXEC_SEAL 0x0008u
+ #endif // MFD_NOEXEC_SEAL
+
+ #if !defined(MFD_EXEC)
+ #define MFD_EXEC 0x0010u
+ #endif // MFD_EXEC
+
+ #ifndef MFD_HUGETLB
+ #define MFD_HUGETLB 0x0004
+ #endif // MFD_HUGETLB
+
+ #ifndef MFD_HUGE_SHIFT
+ #define MFD_HUGE_SHIFT 26
+ #endif // MFD_HUGE_SHIFT
#endif
// Apple recently introduced MAP_JIT flag, which we want to use.
@@ -42,25 +75,70 @@
#if !defined(MAP_ANONYMOUS)
#define MAP_ANONYMOUS MAP_ANON
#endif
+
+ // Android NDK doesn't provide `shm_open()` and `shm_unlink()`.
+ #if !defined(__BIONIC__) && !defined(ASMJIT_NO_SHM_OPEN)
+ #define ASMJIT_HAS_SHM_OPEN
+ #endif
+
+ #if defined(__APPLE__) || defined(__BIONIC__) || !defined(ASMJIT_HAS_SHM_OPEN)
+ #define ASMJIT_VM_SHM_DETECT 0
+ #else
+ #define ASMJIT_VM_SHM_DETECT 1
+ #endif
+
+ #if defined(__APPLE__) && TARGET_OS_OSX
+ #if ASMJIT_ARCH_X86 != 0
+ #define ASMJIT_ANONYMOUS_MEMORY_USE_MACH_VM_REMAP
+ #endif
+ #if ASMJIT_ARCH_ARM >= 64
+ #define ASMJIT_HAS_PTHREAD_JIT_WRITE_PROTECT_NP
+ #endif
+ #endif
+
+ #if defined(__APPLE__) && ASMJIT_ARCH_X86 == 0
+ #define ASMJIT_NO_DUAL_MAPPING
+ #endif
+
+ #if defined(__NetBSD__) && defined(MAP_REMAPDUP) && defined(PROT_MPROTECT)
+ #define ASMJIT_ANONYMOUS_MEMORY_USE_REMAPDUP
+ #endif
+
+ #if !defined(ASMJIT_ANONYMOUS_MEMORY_USE_REMAPDUP) && \
+ !defined(ASMJIT_ANONYMOUS_MEMORY_USE_MACH_VM_REMAP) && \
+ !defined(ASMJIT_NO_DUAL_MAPPING)
+ #define ASMJIT_ANONYMOUS_MEMORY_USE_FD
+ #endif
#endif
#include <atomic>
-#if defined(__APPLE__) || defined(__BIONIC__)
- #define ASMJIT_VM_SHM_DETECT 0
-#else
- #define ASMJIT_VM_SHM_DETECT 1
-#endif
+#if defined(ASMJIT_ANONYMOUS_MEMORY_USE_MACH_VM_REMAP)
+#include <mach/mach.h>
+#include <mach/mach_time.h>
+
+extern "C" {
-// Android NDK doesn't provide `shm_open()` and `shm_unlink()`.
-#if defined(__BIONIC__)
- #define ASMJIT_VM_SHM_AVAILABLE 0
+#ifdef mig_external
+mig_external
#else
- #define ASMJIT_VM_SHM_AVAILABLE 1
+extern
#endif
-
-#if defined(__APPLE__) && ASMJIT_ARCH_ARM >= 64
- #define ASMJIT_HAS_PTHREAD_JIT_WRITE_PROTECT_NP
+kern_return_t mach_vm_remap(
+ vm_map_t target_task,
+ mach_vm_address_t *target_address,
+ mach_vm_size_t size,
+ mach_vm_offset_t mask,
+ int flags,
+ vm_map_t src_task,
+ mach_vm_address_t src_address,
+ boolean_t copy,
+ vm_prot_t *cur_protection,
+ vm_prot_t *max_protection,
+ vm_inherit_t inheritance
+);
+
+} // {extern "C"}
#endif
ASMJIT_BEGIN_SUB_NAMESPACE(VirtMem)
@@ -68,7 +146,8 @@ ASMJIT_BEGIN_SUB_NAMESPACE(VirtMem)
// Virtual Memory Utilities
// ========================
-static const MemoryFlags dualMappingFilter[2] = {
+ASMJIT_MAYBE_UNUSED
+static const constexpr MemoryFlags dualMappingFilter[2] = {
MemoryFlags::kAccessWrite | MemoryFlags::kMMapMaxAccessWrite,
MemoryFlags::kAccessExecute | MemoryFlags::kMMapMaxAccessExecute
};
@@ -90,7 +169,7 @@ struct ScopedHandle {
HANDLE value;
};
-static void getVMInfo(Info& vmInfo) noexcept {
+static void detectVMInfo(Info& vmInfo) noexcept {
SYSTEM_INFO systemInfo;
::GetSystemInfo(&systemInfo);
@@ -98,6 +177,15 @@ static void getVMInfo(Info& vmInfo) noexcept {
vmInfo.pageGranularity = systemInfo.dwAllocationGranularity;
}
+static size_t detectLargePageSize() noexcept {
+ return ::GetLargePageMinimum();
+}
+
+static bool hasDualMappingSupport() noexcept {
+ // TODO: This assumption works on X86 platforms, this may not work on AArch64.
+ return true;
+}
+
// Returns windows-specific protectFlags from \ref MemoryFlags.
static DWORD protectFlagsFromMemoryFlags(MemoryFlags memoryFlags) noexcept {
DWORD protectFlags;
@@ -122,7 +210,12 @@ static DWORD desiredAccessFromMemoryFlags(MemoryFlags memoryFlags) noexcept {
}
static HardenedRuntimeFlags getHardenedRuntimeFlags() noexcept {
- return HardenedRuntimeFlags::kNone;
+ HardenedRuntimeFlags flags = HardenedRuntimeFlags::kNone;
+
+ if (hasDualMappingSupport())
+ flags |= HardenedRuntimeFlags::kDualMapping;
+
+ return flags;
}
Error alloc(void** p, size_t size, MemoryFlags memoryFlags) noexcept {
@@ -130,9 +223,23 @@ Error alloc(void** p, size_t size, MemoryFlags memoryFlags) noexcept {
if (size == 0)
return DebugUtils::errored(kErrorInvalidArgument);
+ DWORD allocationType = MEM_COMMIT | MEM_RESERVE;
DWORD protectFlags = protectFlagsFromMemoryFlags(memoryFlags);
- void* result = ::VirtualAlloc(nullptr, size, MEM_COMMIT | MEM_RESERVE, protectFlags);
+ if (Support::test(memoryFlags, MemoryFlags::kMMapLargePages)) {
+ size_t lpSize = largePageSize();
+
+ // Does it make sense to call VirtualAlloc() if we failed to query large page size?
+ if (lpSize == 0)
+ return DebugUtils::errored(kErrorFeatureNotEnabled);
+
+ if (!Support::isAligned(size, lpSize))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ allocationType |= MEM_LARGE_PAGES;
+ }
+
+ void* result = ::VirtualAlloc(nullptr, size, allocationType, protectFlags);
if (!result)
return DebugUtils::errored(kErrorOutOfMemory);
@@ -142,7 +249,9 @@ Error alloc(void** p, size_t size, MemoryFlags memoryFlags) noexcept {
Error release(void* p, size_t size) noexcept {
DebugUtils::unused(size);
- if (ASMJIT_UNLIKELY(!::VirtualFree(p, 0, MEM_RELEASE)))
+ // NOTE: If the `dwFreeType` parameter is MEM_RELEASE, `size` parameter must be zero.
+ constexpr DWORD dwFreeType = MEM_RELEASE;
+ if (ASMJIT_UNLIKELY(!::VirtualFree(p, 0, dwFreeType)))
return DebugUtils::errored(kErrorInvalidArgument);
return kErrorOk;
}
@@ -183,7 +292,7 @@ Error allocDualMapping(DualMapping* dm, size_t size, MemoryFlags memoryFlags) no
ptr[i] = ::MapViewOfFile(handle.value, desiredAccess, 0, 0, size);
if (ptr[i] == nullptr) {
- if (i == 0)
+ if (i == 1u)
::UnmapViewOfFile(ptr[0]);
return DebugUtils::errored(kErrorOutOfMemory);
}
@@ -214,26 +323,52 @@ Error releaseDualMapping(DualMapping* dm, size_t size) noexcept {
#endif
-// Virtual Memory [Posix]
-// ======================
+// Virtual Memory [Unix]
+// =====================
#if !defined(_WIN32)
-static void getVMInfo(Info& vmInfo) noexcept {
- uint32_t pageSize = uint32_t(::getpagesize());
+// Virtual Memory [Unix] - Utilities
+// =================================
- vmInfo.pageSize = pageSize;
- vmInfo.pageGranularity = Support::max<uint32_t>(pageSize, 65536);
-}
+#if defined(__linux__) || (defined(__APPLE__) && TARGET_OS_OSX)
+struct KernelVersion {
+ long ver[2];
-#if !defined(SHM_ANON)
-static const char* getTmpDir() noexcept {
- const char* tmpDir = getenv("TMPDIR");
- return tmpDir ? tmpDir : "/tmp";
+ inline long major() const noexcept { return ver[0]; }
+ inline long minor() const noexcept { return ver[1]; }
+
+ inline bool eq(long major, long minor) const noexcept { return ver[0] == major && ver[1] == minor; }
+ inline bool ge(long major, long minor) const noexcept { return ver[0] > major || (ver[0] == major && ver[1] >= minor); }
+};
+
+ASMJIT_MAYBE_UNUSED
+static KernelVersion getKernelVersion() noexcept {
+ KernelVersion out {};
+ struct utsname buf {};
+
+ uname(&buf);
+
+ size_t i = 0;
+ char* p = buf.release;
+
+ while (*p && i < 2u) {
+ uint8_t c = uint8_t(*p);
+ if (c >= uint8_t('0') && c <= uint8_t('9')) {
+ out.ver[i] = strtol(p, &p, 10);
+ i++;
+ continue;
+ }
+
+ p++;
+ }
+
+ return out;
}
-#endif
+#endif // getKernelVersion
// Translates libc errors specific to VirtualMemory mapping to `asmjit::Error`.
+ASMJIT_MAYBE_UNUSED
static Error asmjitErrorFromErrno(int e) noexcept {
switch (e) {
case EACCES:
@@ -256,16 +391,149 @@ static Error asmjitErrorFromErrno(int e) noexcept {
}
}
+ASMJIT_MAYBE_UNUSED
+static MemoryFlags maxAccessFlagsToRegularAccessFlags(MemoryFlags memoryFlags) noexcept {
+ static constexpr uint32_t kMaxProtShift = Support::ConstCTZ<uint32_t(MemoryFlags::kMMapMaxAccessRead)>::value;
+ return MemoryFlags(uint32_t(memoryFlags & MemoryFlags::kMMapMaxAccessRWX) >> kMaxProtShift);
+}
+
+ASMJIT_MAYBE_UNUSED
+static MemoryFlags regularAccessFlagsToMaxAccessFlags(MemoryFlags memoryFlags) noexcept {
+ static constexpr uint32_t kMaxProtShift = Support::ConstCTZ<uint32_t(MemoryFlags::kMMapMaxAccessRead)>::value;
+ return MemoryFlags(uint32_t(memoryFlags & MemoryFlags::kAccessRWX) << kMaxProtShift);
+}
+
+// Returns `mmap()` protection flags from \ref MemoryFlags.
+ASMJIT_MAYBE_UNUSED
+static int mmProtFromMemoryFlags(MemoryFlags memoryFlags) noexcept {
+ int protection = 0;
+ if (Support::test(memoryFlags, MemoryFlags::kAccessRead)) protection |= PROT_READ;
+ if (Support::test(memoryFlags, MemoryFlags::kAccessWrite)) protection |= PROT_READ | PROT_WRITE;
+ if (Support::test(memoryFlags, MemoryFlags::kAccessExecute)) protection |= PROT_READ | PROT_EXEC;
+ return protection;
+}
+
+// Returns maximum protection flags from `memoryFlags`.
+//
+// Uses:
+// - `PROT_MPROTECT()` on NetBSD.
+// - `PROT_MAX()` when available on other BSDs.
+ASMJIT_MAYBE_UNUSED
+static inline int mmMaxProtFromMemoryFlags(MemoryFlags memoryFlags) noexcept {
+ MemoryFlags acc = maxAccessFlagsToRegularAccessFlags(memoryFlags);
+ if (acc != MemoryFlags::kNone) {
+#if defined(__NetBSD__) && defined(PROT_MPROTECT)
+ return PROT_MPROTECT(mmProtFromMemoryFlags(acc));
+#elif defined(PROT_MAX)
+ return PROT_MAX(mmProtFromMemoryFlags(acc));
+#else
+ return 0;
+#endif
+ }
+
+ return 0;
+}
+
+static void detectVMInfo(Info& vmInfo) noexcept {
+ uint32_t pageSize = uint32_t(::getpagesize());
+
+ vmInfo.pageSize = pageSize;
+ vmInfo.pageGranularity = Support::max<uint32_t>(pageSize, 65536);
+}
+
+static size_t detectLargePageSize() noexcept {
+#if defined(__APPLE__) && defined(VM_FLAGS_SUPERPAGE_SIZE_2MB) && ASMJIT_ARCH_X86
+ return 2u * 1024u * 1024u;
+#elif defined(__FreeBSD__)
+ Support::Array<size_t, 2> pageSize;
+ // TODO: Does it return unsigned?
+ return (getpagesizes(pageSize.data(), 2) < 2) ? 0 : uint32_t(pageSize[1]);
+#elif defined(__linux__)
+ StringTmp<128> storage;
+ if (OSUtils::readFile("/sys/kernel/mm/transparent_hugepage/hpage_pmd_size", storage, 16) != kErrorOk || storage.empty())
+ return 0u;
+
+ // The first value should be the size of the page (hpage_pmd_size).
+ size_t largePageSize = 0;
+
+ const char* buf = storage.data();
+ size_t bufSize = storage.size();
+
+ for (size_t i = 0; i < bufSize; i++) {
+ uint32_t digit = uint32_t(uint8_t(buf[i]) - uint8_t('0'));
+ if (digit >= 10u)
+ break;
+ largePageSize = largePageSize * 10 + digit;
+ }
+
+ if (Support::isPowerOf2(largePageSize))
+ return largePageSize;
+ else
+ return 0u;
+#else
+ return 0u;
+#endif
+}
+
+// Virtual Memory [Posix] - Anonymous Memory
+// =========================================
+
+#if defined(ASMJIT_ANONYMOUS_MEMORY_USE_FD)
+
// Some operating systems don't allow /dev/shm to be executable. On Linux this happens when /dev/shm is mounted with
// 'noexec', which is enforced by systemd. Other operating systems like MacOS also restrict executable permissions
// regarding /dev/shm, so we use a runtime detection before attempting to allocate executable memory. Sometimes we
-// don't need the detection as we know it would always result in `ShmStrategy::kTmpDir`.
-enum class ShmStrategy : uint32_t {
+// don't need the detection as we know it would always result in `AnonymousMemoryStrategy::kTmpDir`.
+enum class AnonymousMemoryStrategy : uint32_t {
kUnknown = 0,
kDevShm = 1,
kTmpDir = 2
};
+#if !defined(SHM_ANON)
+static const char* getTmpDir() noexcept {
+ const char* tmpDir = getenv("TMPDIR");
+ return tmpDir ? tmpDir : "/tmp";
+}
+#endif
+
+#if defined(__linux__) && defined(__NR_memfd_create)
+static uint32_t getMfdExecFlag() noexcept {
+ static std::atomic<uint32_t> cachedMfdExecSupported;
+ uint32_t val = cachedMfdExecSupported.load();
+
+ if (val == 0u) {
+ KernelVersion ver = getKernelVersion();
+ val = uint32_t(ver.ge(6, 3)) + 1u;
+ cachedMfdExecSupported.store(val);
+ }
+
+ return val == 2u ? uint32_t(MFD_EXEC) : uint32_t(0u);
+}
+#endif // __linux__ && __NR_memfd_create
+
+
+// It's not fully random, just to avoid collisions when opening TMP or SHM file.
+ASMJIT_MAYBE_UNUSED
+static uint64_t generateRandomBits(uintptr_t stackPtr, uint32_t attempt) noexcept {
+ static std::atomic<uint32_t> internalCounter;
+
+#if defined(__GNUC__) && ASMJIT_ARCH_X86
+ // Use RDTSC instruction to avoid gettimeofday() as we just need some "random" bits.
+ uint64_t mix = __builtin_ia32_rdtsc();
+#else
+ struct timeval tm {};
+ uint64_t mix = 1; // only used when gettimeofday() fails, which is unlikely.
+ if (gettimeofday(&tm, nullptr) == 0) {
+ mix = uint64_t(tm.tv_usec) ^ uint64_t(tm.tv_sec);
+ }
+#endif
+
+ uint64_t bits = (uint64_t(stackPtr) & 0x1010505000055590u) - mix * 773703683;
+ bits = (bits >> 33) ^ (bits << 7) ^ (attempt * 87178291199);
+ return bits + uint64_t(++internalCounter) * 10619863;
+}
+
class AnonymousMemory {
public:
enum FileType : uint32_t {
@@ -294,13 +562,17 @@ public:
#if defined(__linux__) && defined(__NR_memfd_create)
// Linux specific 'memfd_create' - if the syscall returns `ENOSYS` it means
// it's not available and we will never call it again (would be pointless).
+ //
+ // NOTE: There is also memfd_create() libc function in FreeBSD, but it internally
+ // uses `shm_open(SHM_ANON, ...)` so it's not needed to add support for it (it's
+ // not a syscall as in Linux).
// Zero initialized, if ever changed to '1' that would mean the syscall is not
- // available and we must use `shm_open()` and `shm_unlink()`.
+ // available and we must use `shm_open()` and `shm_unlink()` (or regular `open()`).
static volatile uint32_t memfd_create_not_supported;
if (!memfd_create_not_supported) {
- _fd = (int)syscall(__NR_memfd_create, "vmem", 0);
+ _fd = (int)syscall(__NR_memfd_create, "vmem", MFD_CLOEXEC | getMfdExecFlag());
if (ASMJIT_LIKELY(_fd >= 0))
return kErrorOk;
@@ -310,9 +582,9 @@ public:
else
return DebugUtils::errored(asmjitErrorFromErrno(e));
}
-#endif
+#endif // __linux__ && __NR_memfd_create
-#if defined(SHM_ANON)
+#if defined(ASMJIT_HAS_SHM_OPEN) && defined(SHM_ANON)
// Originally FreeBSD extension, apparently works in other BSDs too.
DebugUtils::unused(preferTmpOverDevShm);
_fd = ::shm_open(SHM_ANON, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
@@ -322,32 +594,26 @@ public:
else
return DebugUtils::errored(asmjitErrorFromErrno(errno));
#else
- // POSIX API. We have to generate somehow a unique name. This is nothing cryptographic, just using a bit from
- // the stack address to always have a different base for different threads (as threads have their own stack)
- // and retries for avoiding collisions. We use `shm_open()` with flags that require creation of the file so we
- // never open an existing shared memory.
- static std::atomic<uint32_t> internalCounter;
- const char* kShmFormat = "/shm-id-%016llX";
-
+ // POSIX API. We have to generate somehow a unique name, so use `generateRandomBits()` helper. To prevent
+ // having file collisions we use `shm_open()` with flags that require creation of the file so we never open
+ // an existing shared memory.
+ static const char kShmFormat[] = "/shm-id-%016llX";
uint32_t kRetryCount = 100;
- uint64_t bits = ((uintptr_t)(void*)this) & 0x55555555u;
for (uint32_t i = 0; i < kRetryCount; i++) {
- bits -= uint64_t(OSUtils::getTickCount()) * 773703683;
- bits = ((bits >> 14) ^ (bits << 6)) + uint64_t(++internalCounter) * 10619863;
-
bool useTmp = !ASMJIT_VM_SHM_DETECT || preferTmpOverDevShm;
+ uint64_t bits = generateRandomBits((uintptr_t)this, i);
if (useTmp) {
_tmpName.assign(getTmpDir());
_tmpName.appendFormat(kShmFormat, (unsigned long long)bits);
- _fd = ::open(_tmpName.data(), O_RDWR | O_CREAT | O_EXCL, 0);
+ _fd = ASMJIT_FILE64_API(::open)(_tmpName.data(), O_RDWR | O_CREAT | O_EXCL, 0);
if (ASMJIT_LIKELY(_fd >= 0)) {
_fileType = kFileTypeTmp;
return kErrorOk;
}
}
-#if ASMJIT_VM_SHM_AVAILABLE
+#if defined(ASMJIT_HAS_SHM_OPEN)
else {
_tmpName.assignFormat(kShmFormat, (unsigned long long)bits);
_fd = ::shm_open(_tmpName.data(), O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
@@ -371,7 +637,7 @@ public:
FileType type = _fileType;
_fileType = kFileTypeNone;
-#if ASMJIT_VM_SHM_AVAILABLE
+#ifdef ASMJIT_HAS_SHM_OPEN
if (type == kFileTypeShm) {
::shm_unlink(_tmpName.data());
return;
@@ -393,31 +659,71 @@ public:
Error allocate(size_t size) noexcept {
// TODO: Improve this by using `posix_fallocate()` when available.
- if (ftruncate(_fd, off_t(size)) != 0)
+ if (ASMJIT_FILE64_API(ftruncate)(_fd, off_t(size)) != 0)
return DebugUtils::errored(asmjitErrorFromErrno(errno));
return kErrorOk;
}
};
-// Returns `mmap()` protection flags from \ref MemoryFlags.
-static int mmProtFromMemoryFlags(MemoryFlags memoryFlags) noexcept {
- int protection = 0;
- if (Support::test(memoryFlags, MemoryFlags::kAccessRead)) protection |= PROT_READ;
- if (Support::test(memoryFlags, MemoryFlags::kAccessWrite)) protection |= PROT_READ | PROT_WRITE;
- if (Support::test(memoryFlags, MemoryFlags::kAccessExecute)) protection |= PROT_READ | PROT_EXEC;
- return protection;
+#if ASMJIT_VM_SHM_DETECT
+static Error detectAnonymousMemoryStrategy(AnonymousMemoryStrategy* strategyOut) noexcept {
+ AnonymousMemory anonMem;
+ Info vmInfo = info();
+
+ ASMJIT_PROPAGATE(anonMem.open(false));
+ ASMJIT_PROPAGATE(anonMem.allocate(vmInfo.pageSize));
+
+ void* ptr = mmap(nullptr, vmInfo.pageSize, PROT_READ | PROT_EXEC, MAP_SHARED, anonMem.fd(), 0);
+ if (ptr == MAP_FAILED) {
+ int e = errno;
+ if (e == EINVAL) {
+ *strategyOut = AnonymousMemoryStrategy::kTmpDir;
+ return kErrorOk;
+ }
+ return DebugUtils::errored(asmjitErrorFromErrno(e));
+ }
+ else {
+ munmap(ptr, vmInfo.pageSize);
+ *strategyOut = AnonymousMemoryStrategy::kDevShm;
+ return kErrorOk;
+ }
}
+#endif
-#if defined(__APPLE__)
-// Detects whether the current process is hardened, which means that pages that have WRITE and EXECUTABLE flags cannot
-// be allocated without MAP_JIT flag.
-static inline bool hasHardenedRuntimeMacOS() noexcept {
-#if TARGET_OS_OSX && ASMJIT_ARCH_ARM >= 64
- // MacOS on AArch64 has always hardened runtime enabled.
+static Error getAnonymousMemoryStrategy(AnonymousMemoryStrategy* strategyOut) noexcept {
+#if ASMJIT_VM_SHM_DETECT
+ // Initially don't assume anything. It has to be tested whether '/dev/shm' was mounted with 'noexec' flag or not.
+ static std::atomic<uint32_t> cachedStrategy;
+
+ AnonymousMemoryStrategy strategy = static_cast<AnonymousMemoryStrategy>(cachedStrategy.load());
+ if (strategy == AnonymousMemoryStrategy::kUnknown) {
+ ASMJIT_PROPAGATE(detectAnonymousMemoryStrategy(&strategy));
+ cachedStrategy.store(static_cast<uint32_t>(strategy));
+ }
+
+ *strategyOut = strategy;
+ return kErrorOk;
+#else
+ *strategyOut = AnonymousMemoryStrategy::kTmpDir;
+ return kErrorOk;
+#endif
+}
+
+#endif // ASMJIT_ANONYMOUS_MEMORY_USE_FD
+
+// Virtual Memory [Posix] - Hardened Runtime & MAP_JIT
+// ===================================================
+
+// Detects whether the current process is hardened, which means that pages that have WRITE and EXECUTABLE flags
+// cannot be normally allocated. On OSX + AArch64 such allocation requires MAP_JIT flag, other platforms don't
+// support this combination.
+static bool hasHardenedRuntime() noexcept {
+#if defined(__APPLE__) && TARGET_OS_OSX && ASMJIT_ARCH_ARM >= 64
+ // OSX on AArch64 has always hardened runtime enabled.
return true;
#else
- static std::atomic<uint32_t> globalHardenedFlag;
+ static std::atomic<uint32_t> cachedHardenedFlag;
enum HardenedFlag : uint32_t {
kHardenedFlagUnknown = 0,
@@ -425,11 +731,11 @@ static inline bool hasHardenedRuntimeMacOS() noexcept {
kHardenedFlagEnabled = 2
};
- uint32_t flag = globalHardenedFlag.load();
+ uint32_t flag = cachedHardenedFlag.load();
if (flag == kHardenedFlagUnknown) {
- size_t pageSize = ::getpagesize();
+ size_t pageSize = size_t(::getpagesize());
+ void* ptr = mmap(nullptr, pageSize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- void* ptr = mmap(nullptr, pageSize, PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (ptr == MAP_FAILED) {
flag = kHardenedFlagEnabled;
}
@@ -437,63 +743,49 @@ static inline bool hasHardenedRuntimeMacOS() noexcept {
flag = kHardenedFlagDisabled;
munmap(ptr, pageSize);
}
- globalHardenedFlag.store(flag);
+
+ cachedHardenedFlag.store(flag);
}
return flag == kHardenedFlagEnabled;
#endif
}
-static inline bool hasMapJitSupportMacOS() noexcept {
-#if TARGET_OS_OSX && ASMJIT_ARCH_ARM >= 64
- // MacOS for 64-bit AArch architecture always uses hardened runtime. Some documentation can be found here:
+// Detects whether MAP_JIT is available.
+static inline bool hasMapJitSupport() noexcept {
+#if defined(__APPLE__) && TARGET_OS_OSX && ASMJIT_ARCH_X86 == 0
+ // Apple platforms always use hardened runtime + MAP_JIT on non-x86 hardware:
// - https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon
return true;
-#elif TARGET_OS_OSX
- // MAP_JIT flag required to run unsigned JIT code is only supported by kernel version 10.14+ (Mojave) and IOS.
- static std::atomic<uint32_t> globalVersion;
-
- int ver = globalVersion.load();
- if (!ver) {
- struct utsname osname {};
- uname(&osname);
- ver = atoi(osname.release);
- globalVersion.store(ver);
+#elif defined(__APPLE__) && TARGET_OS_OSX
+ // MAP_JIT flag required to run unsigned JIT code is only supported by kernel version 10.14+ (Mojave).
+ static std::atomic<uint32_t> cachedMapJitSupport;
+ uint32_t val = cachedMapJitSupport.load();
+
+ if (val == 0u) {
+ KernelVersion ver = getKernelVersion();
+ val = uint32_t(ver.ge(18, 0)) + 1u;
+ cachedMapJitSupport.store(val);
}
- return ver >= 18;
-#else
- // Assume it's available.
- return true;
-#endif
-}
-#endif // __APPLE__
-// Detects whether the current process is hardened, which means that pages that have WRITE and EXECUTABLE flags
-// cannot be normally allocated. On MacOS such allocation requires MAP_JIT flag.
-static inline bool hasHardenedRuntime() noexcept {
-#if defined(__APPLE__)
- return hasHardenedRuntimeMacOS();
+ return val == 2u;
#else
+ // MAP_JIT is not available (it's only available on OSX).
return false;
#endif
}
-// Detects whether MAP_JIT is available.
-static inline bool hasMapJitSupport() noexcept {
-#if defined(__APPLE__)
- return hasMapJitSupportMacOS();
-#else
- return false;
-#endif
-}
-
-// Returns either MAP_JIT or 0 based on `flags` and the host operating system.
+// Returns either MAP_JIT or 0 based on `memoryFlags` and the host operating system.
static inline int mmMapJitFromMemoryFlags(MemoryFlags memoryFlags) noexcept {
#if defined(__APPLE__)
// Always use MAP_JIT flag if user asked for it (could be used for testing on non-hardened processes) and detect
// whether it must be used when the process is actually hardened (in that case it doesn't make sense to rely on
// user `memoryFlags`).
- bool useMapJit = Support::test(memoryFlags, MemoryFlags::kMMapEnableMapJit) || hasHardenedRuntime();
+ //
+ // MAP_JIT is not required when dual-mapping memory and is incompatible with MAP_SHARED, so it will not be
+ // added when the latter is enabled.
+ bool useMapJit = (Support::test(memoryFlags, MemoryFlags::kMMapEnableMapJit) || hasHardenedRuntime())
+ && !Support::test(memoryFlags, MemoryFlags::kMapShared);
if (useMapJit)
return hasMapJitSupport() ? int(MAP_JIT) : 0;
else
@@ -504,121 +796,252 @@ static inline int mmMapJitFromMemoryFlags(MemoryFlags memoryFlags) noexcept {
#endif
}
-// Returns BSD-specific `PROT_MAX()` flags.
-static inline int mmMaxProtFromMemoryFlags(MemoryFlags memoryFlags) noexcept {
-#if defined(PROT_MAX)
- static constexpr uint32_t kMaxProtShift = Support::ConstCTZ<uint32_t(MemoryFlags::kMMapMaxAccessRead)>::value;
-
- if (Support::test(memoryFlags, MemoryFlags::kMMapMaxAccessReadWrite | MemoryFlags::kMMapMaxAccessExecute))
- return PROT_MAX(mmProtFromMemoryFlags((MemoryFlags)(uint32_t(memoryFlags) >> kMaxProtShift)));
- else
- return 0;
-#else
- DebugUtils::unused(memoryFlags);
- return 0;
-#endif
-}
-
-#if ASMJIT_VM_SHM_DETECT
-static Error detectShmStrategy(ShmStrategy* strategyOut) noexcept {
- AnonymousMemory anonMem;
- Info vmInfo = info();
-
- ASMJIT_PROPAGATE(anonMem.open(false));
- ASMJIT_PROPAGATE(anonMem.allocate(vmInfo.pageSize));
-
- void* ptr = mmap(nullptr, vmInfo.pageSize, PROT_READ | PROT_EXEC, MAP_SHARED, anonMem.fd(), 0);
- if (ptr == MAP_FAILED) {
- int e = errno;
- if (e == EINVAL) {
- *strategyOut = ShmStrategy::kTmpDir;
- return kErrorOk;
- }
- return DebugUtils::errored(asmjitErrorFromErrno(e));
- }
- else {
- munmap(ptr, vmInfo.pageSize);
- *strategyOut = ShmStrategy::kDevShm;
- return kErrorOk;
- }
-}
-#endif
-
-static Error getShmStrategy(ShmStrategy* strategyOut) noexcept {
-#if ASMJIT_VM_SHM_DETECT
- // Initially don't assume anything. It has to be tested whether '/dev/shm' was mounted with 'noexec' flag or not.
- static std::atomic<uint32_t> globalShmStrategy;
-
- ShmStrategy strategy = static_cast<ShmStrategy>(globalShmStrategy.load());
- if (strategy == ShmStrategy::kUnknown) {
- ASMJIT_PROPAGATE(detectShmStrategy(&strategy));
- globalShmStrategy.store(static_cast<uint32_t>(strategy));
- }
-
- *strategyOut = strategy;
- return kErrorOk;
+static inline bool hasDualMappingSupport() noexcept {
+#if defined(ASMJIT_NO_DUAL_MAPPING)
+ return false;
#else
- *strategyOut = ShmStrategy::kTmpDir;
- return kErrorOk;
+ return true;
#endif
}
static HardenedRuntimeFlags getHardenedRuntimeFlags() noexcept {
- HardenedRuntimeFlags hrFlags = HardenedRuntimeFlags::kNone;
+ HardenedRuntimeFlags flags = HardenedRuntimeFlags::kNone;
if (hasHardenedRuntime())
- hrFlags |= HardenedRuntimeFlags::kEnabled;
+ flags |= HardenedRuntimeFlags::kEnabled;
if (hasMapJitSupport())
- hrFlags |= HardenedRuntimeFlags::kMapJit;
+ flags |= HardenedRuntimeFlags::kMapJit;
+
+ if (hasDualMappingSupport())
+ flags |= HardenedRuntimeFlags::kDualMapping;
- return hrFlags;
+ return flags;
}
-Error alloc(void** p, size_t size, MemoryFlags memoryFlags) noexcept {
+static Error mapMemory(void** p, size_t size, MemoryFlags memoryFlags, int fd = -1, off_t offset = 0) noexcept {
*p = nullptr;
if (size == 0)
return DebugUtils::errored(kErrorInvalidArgument);
int protection = mmProtFromMemoryFlags(memoryFlags) | mmMaxProtFromMemoryFlags(memoryFlags);
- int mmFlags = MAP_PRIVATE | MAP_ANONYMOUS | mmMapJitFromMemoryFlags(memoryFlags);
+ int mmFlags = mmMapJitFromMemoryFlags(memoryFlags);
+
+ mmFlags |= Support::test(memoryFlags, MemoryFlags::kMapShared) ? MAP_SHARED : MAP_PRIVATE;
+ if (fd == -1)
+ mmFlags |= MAP_ANONYMOUS;
- void* ptr = mmap(nullptr, size, protection, mmFlags, -1, 0);
+ bool useLargePages = Support::test(memoryFlags, VirtMem::MemoryFlags::kMMapLargePages);
+
+ if (useLargePages) {
+#if defined(__linux__)
+ size_t lpSize = largePageSize();
+ if (lpSize == 0)
+ return DebugUtils::errored(kErrorFeatureNotEnabled);
+
+ if (!Support::isAligned(size, lpSize))
+ return DebugUtils::errored(kErrorInvalidArgument);
+
+ unsigned lpSizeLog2 = Support::ctz(lpSize);
+ mmFlags |= int(unsigned(MAP_HUGETLB) | (lpSizeLog2 << MAP_HUGE_SHIFT));
+#else
+ return DebugUtils::errored(kErrorFeatureNotEnabled);
+#endif // __linux__
+ }
+
+ void* ptr = mmap(nullptr, size, protection, mmFlags, fd, offset);
if (ptr == MAP_FAILED)
- return DebugUtils::errored(kErrorOutOfMemory);
+ return DebugUtils::errored(asmjitErrorFromErrno(errno));
+
+#if defined(MADV_HUGEPAGE)
+ if (useLargePages) {
+ madvise(ptr, size, MADV_HUGEPAGE);
+ }
+#endif
*p = ptr;
return kErrorOk;
}
-Error release(void* p, size_t size) noexcept {
+static Error unmapMemory(void* p, size_t size) noexcept {
if (ASMJIT_UNLIKELY(munmap(p, size) != 0))
- return DebugUtils::errored(kErrorInvalidArgument);
+ return DebugUtils::errored(asmjitErrorFromErrno(errno));
return kErrorOk;
}
+Error alloc(void** p, size_t size, MemoryFlags memoryFlags) noexcept {
+ return mapMemory(p, size, memoryFlags);
+}
+
+Error release(void* p, size_t size) noexcept {
+ return unmapMemory(p, size);
+}
Error protect(void* p, size_t size, MemoryFlags memoryFlags) noexcept {
int protection = mmProtFromMemoryFlags(memoryFlags);
if (mprotect(p, size, protection) == 0)
return kErrorOk;
- return DebugUtils::errored(kErrorInvalidArgument);
+ return DebugUtils::errored(asmjitErrorFromErrno(errno));
}
-Error allocDualMapping(DualMapping* dm, size_t size, MemoryFlags memoryFlags) noexcept {
+// Virtual Memory [Posix] - Dual Mapping
+// =====================================
+
+#if !defined(ASMJIT_NO_DUAL_MAPPING)
+static Error unmapDualMapping(DualMapping* dm, size_t size) noexcept {
+ Error err1 = unmapMemory(dm->rx, size);
+ Error err2 = kErrorOk;
+
+ if (dm->rx != dm->rw)
+ err2 = unmapMemory(dm->rw, size);
+
+ // We can report only one error, so report the first...
+ if (err1 || err2)
+ return DebugUtils::errored(err1 ? err1 : err2);
+
dm->rx = nullptr;
dm->rw = nullptr;
+ return kErrorOk;
+}
+#endif // !ASMJIT_NO_DUAL_MAPPING
- if (off_t(size) <= 0)
- return DebugUtils::errored(size == 0 ? kErrorInvalidArgument : kErrorTooLarge);
+#if defined(ASMJIT_ANONYMOUS_MEMORY_USE_REMAPDUP)
+static Error allocDualMappingUsingRemapdup(DualMapping* dmOut, size_t size, MemoryFlags memoryFlags) noexcept {
+ MemoryFlags maxAccessFlags = regularAccessFlagsToMaxAccessFlags(memoryFlags);
+ MemoryFlags finalFlags = memoryFlags | maxAccessFlags | MemoryFlags::kMapShared;
+
+ MemoryFlags rxFlags = finalFlags & ~(MemoryFlags::kAccessWrite | MemoryFlags::kMMapMaxAccessWrite);
+ MemoryFlags rwFlags = finalFlags & ~(MemoryFlags::kAccessExecute);
+
+ // Allocate RW mapping.
+ DualMapping dm {};
+ ASMJIT_PROPAGATE(mapMemory(&dm.rw, size, rwFlags));
+
+ // Allocate RX mapping.
+ dm.rx = mremap(dm.rw, size, nullptr, size, MAP_REMAPDUP);
+ if (dm.rx == MAP_FAILED) {
+ int e = errno;
+ munmap(dm.rw, size);
+ return DebugUtils::errored(asmjitErrorFromErrno(e));
+ }
+
+ if (mprotect(dm.rx, size, mmProtFromMemoryFlags(rxFlags)) != 0) {
+ int e = errno;
+ unmapDualMapping(&dm, size);
+ return DebugUtils::errored(asmjitErrorFromErrno(e));
+ }
+
+ *dmOut = dm;
+ return kErrorOk;
+}
+#endif
+
+#if defined(ASMJIT_ANONYMOUS_MEMORY_USE_MACH_VM_REMAP)
+static Error asmjitErrorFromKernResult(kern_return_t result) noexcept {
+ switch (result) {
+ case KERN_PROTECTION_FAILURE:
+ return DebugUtils::errored(kErrorProtectionFailure);
+ case KERN_NO_SPACE:
+ return DebugUtils::errored(kErrorOutOfMemory);
+ case KERN_INVALID_ARGUMENT:
+ return DebugUtils::errored(kErrorInvalidArgument);
+ default:
+ return DebugUtils::errored(kErrorInvalidState);
+ }
+}
+
+static Error allocDualMappingUsingMachVmRemap(DualMapping* dmOut, size_t size, MemoryFlags memoryFlags) noexcept {
+ DualMapping dm {};
+
+ MemoryFlags mmapFlags = MemoryFlags::kAccessReadWrite | (memoryFlags & MemoryFlags::kMapShared);
+ ASMJIT_PROPAGATE(mapMemory(&dm.rx, size, mmapFlags));
+
+ vm_prot_t curProt;
+ vm_prot_t maxProt;
+
+ int rwProtectFlags = VM_PROT_READ | VM_PROT_WRITE;
+ int rxProtectFlags = VM_PROT_READ;
+
+ if (Support::test(memoryFlags, MemoryFlags::kAccessExecute))
+ rxProtectFlags |= VM_PROT_EXECUTE;
+
+ kern_return_t result {};
+ do {
+ vm_map_t task = mach_task_self();
+ mach_vm_address_t remappedAddr {};
+
+#if defined(VM_FLAGS_RANDOM_ADDR)
+ int remapFlags = VM_FLAGS_ANYWHERE | VM_FLAGS_RANDOM_ADDR;
+#else
+ int remapFlags = VM_FLAGS_ANYWHERE;
+#endif
+
+ // Try to remap the existing memory into a different address.
+ result = mach_vm_remap(
+ task, // target_task
+ &remappedAddr, // target_address
+ size, // size
+ 0, // mask
+ remapFlags, // flags
+ task, // src_task
+ (mach_vm_address_t)dm.rx, // src_address
+ false, // copy
+ &curProt, // cur_protection
+ &maxProt, // max_protection
+ VM_INHERIT_DEFAULT); // inheritance
+
+ if (result != KERN_SUCCESS)
+ break;
+
+ dm.rw = (void*)remappedAddr;
+
+ // Now, try to change permissions of both map regions into RW and RX. The vm_protect()
+ // API is used twice as we also want to set maximum permissions, so nobody would be
+ // allowed to change the RX region back to RW or RWX (if RWX is allowed).
+ uint32_t i;
+ for (i = 0; i < 2; i++) {
+ bool setMaximum = (i == 0);
+
+ result = vm_protect(
+ task, // target_task
+ (vm_address_t)dm.rx, // address
+ size, // size
+ setMaximum, // set_maximum
+ rxProtectFlags); // new_protection
+
+ if (result != KERN_SUCCESS)
+ break;
+
+ result = vm_protect(task, // target_task
+ (vm_address_t)dm.rw, // address
+ size, // size
+ setMaximum, // set_maximum
+ rwProtectFlags); // new_protection
+
+ if (result != KERN_SUCCESS)
+ break;
+ }
+ } while (0);
+
+ if (result != KERN_SUCCESS) {
+ unmapDualMapping(&dm, size);
+ return DebugUtils::errored(asmjitErrorFromKernResult(result));
+ }
+ *dmOut = dm;
+ return kErrorOk;
+}
+#endif // ASMJIT_ANONYMOUS_MEMORY_USE_MACH_VM_REMAP
+
+#if defined(ASMJIT_ANONYMOUS_MEMORY_USE_FD)
+static Error allocDualMappingUsingFile(DualMapping* dm, size_t size, MemoryFlags memoryFlags) noexcept {
bool preferTmpOverDevShm = Support::test(memoryFlags, MemoryFlags::kMappingPreferTmp);
if (!preferTmpOverDevShm) {
- ShmStrategy strategy;
- ASMJIT_PROPAGATE(getShmStrategy(&strategy));
- preferTmpOverDevShm = (strategy == ShmStrategy::kTmpDir);
+ AnonymousMemoryStrategy strategy;
+ ASMJIT_PROPAGATE(getAnonymousMemoryStrategy(&strategy));
+ preferTmpOverDevShm = (strategy == AnonymousMemoryStrategy::kTmpDir);
}
AnonymousMemory anonMem;
@@ -627,16 +1050,12 @@ Error allocDualMapping(DualMapping* dm, size_t size, MemoryFlags memoryFlags) no
void* ptr[2];
for (uint32_t i = 0; i < 2; i++) {
- MemoryFlags accessFlags = memoryFlags & ~dualMappingFilter[i];
- int protection = mmProtFromMemoryFlags(accessFlags) | mmMaxProtFromMemoryFlags(accessFlags);
-
- ptr[i] = mmap(nullptr, size, protection, MAP_SHARED, anonMem.fd(), 0);
- if (ptr[i] == MAP_FAILED) {
- // Get the error now before `munmap()` has a chance to clobber it.
- int e = errno;
+ MemoryFlags restrictedMemoryFlags = memoryFlags & ~dualMappingFilter[i];
+ Error err = mapMemory(&ptr[i], size, restrictedMemoryFlags | MemoryFlags::kMapShared, anonMem.fd(), 0);
+ if (err != kErrorOk) {
if (i == 1)
- munmap(ptr[0], size);
- return DebugUtils::errored(asmjitErrorFromErrno(e));
+ unmapMemory(ptr[0], size);
+ return err;
}
}
@@ -644,18 +1063,38 @@ Error allocDualMapping(DualMapping* dm, size_t size, MemoryFlags memoryFlags) no
dm->rw = ptr[1];
return kErrorOk;
}
+#endif // ASMJIT_ANONYMOUS_MEMORY_USE_FD
-Error releaseDualMapping(DualMapping* dm, size_t size) noexcept {
- Error err = release(dm->rx, size);
- if (dm->rx != dm->rw)
- err |= release(dm->rw, size);
-
- if (err)
- return DebugUtils::errored(kErrorInvalidArgument);
-
+Error allocDualMapping(DualMapping* dm, size_t size, MemoryFlags memoryFlags) noexcept {
dm->rx = nullptr;
dm->rw = nullptr;
- return kErrorOk;
+
+#if defined(ASMJIT_NO_DUAL_MAPPING)
+ DebugUtils::unused(size, memoryFlags);
+ return DebugUtils::errored(kErrorFeatureNotEnabled);
+#else
+ if (off_t(size) <= 0)
+ return DebugUtils::errored(size == 0 ? kErrorInvalidArgument : kErrorTooLarge);
+
+#if defined(ASMJIT_ANONYMOUS_MEMORY_USE_REMAPDUP)
+ return allocDualMappingUsingRemapdup(dm, size, memoryFlags);
+#elif defined(ASMJIT_ANONYMOUS_MEMORY_USE_MACH_VM_REMAP)
+ return allocDualMappingUsingMachVmRemap(dm, size, memoryFlags);
+#elif defined(ASMJIT_ANONYMOUS_MEMORY_USE_FD)
+ return allocDualMappingUsingFile(dm, size, memoryFlags);
+#else
+ #error "[asmjit] VirtMem::allocDualMapping() doesn't have implementation for the target OS or architecture"
+#endif
+#endif // ASMJIT_NO_DUAL_MAPPING
+}
+
+Error releaseDualMapping(DualMapping* dm, size_t size) noexcept {
+#if defined(ASMJIT_NO_DUAL_MAPPING)
+ DebugUtils::unused(dm, size);
+ return DebugUtils::errored(kErrorFeatureNotEnabled);
+#else
+ return unmapDualMapping(dm, size);
+#endif // ASMJIT_NO_DUAL_MAPPING
}
#endif
@@ -663,7 +1102,7 @@ Error releaseDualMapping(DualMapping* dm, size_t size) noexcept {
// ========================================
void flushInstructionCache(void* p, size_t size) noexcept {
-#if ASMJIT_ARCH_X86
+#if ASMJIT_ARCH_X86 || defined(__EMSCRIPTEN__)
// X86/X86_64 architecture doesn't require to do anything to flush instruction cache.
DebugUtils::unused(p, size);
#elif defined(__APPLE__)
@@ -676,7 +1115,7 @@ void flushInstructionCache(void* p, size_t size) noexcept {
char* end = start + size;
__builtin___clear_cache(start, end);
#else
- #pragma message("asmjit::VirtMem::flushInstructionCache() doesn't have implementation for the target OS and compiler")
+ #pragma message("[asmjit] VirtMem::flushInstructionCache() doesn't have implementation for the target OS and compiler")
DebugUtils::unused(p, size);
#endif
}
@@ -690,7 +1129,7 @@ Info info() noexcept {
if (!vmInfoInitialized.load()) {
Info localMemInfo;
- getVMInfo(localMemInfo);
+ detectVMInfo(localMemInfo);
vmInfo = localMemInfo;
vmInfoInitialized.store(1u);
@@ -699,6 +1138,22 @@ Info info() noexcept {
return vmInfo;
}
+size_t largePageSize() noexcept {
+ static std::atomic<size_t> largePageSize;
+ static constexpr size_t kNotAvailable = 1;
+
+ size_t size = largePageSize.load();
+ if (ASMJIT_LIKELY(size > kNotAvailable))
+ return size;
+
+ if (size == kNotAvailable)
+ return 0;
+
+ size = detectLargePageSize();
+ largePageSize.store(size != 0 ? size : kNotAvailable);
+ return size;
+}
+
// Virtual Memory - Hardened Runtime Info
// ======================================
@@ -711,7 +1166,7 @@ HardenedRuntimeInfo hardenedRuntimeInfo() noexcept {
void protectJitMemory(ProtectJitAccess access) noexcept {
#if defined(ASMJIT_HAS_PTHREAD_JIT_WRITE_PROTECT_NP)
- pthread_jit_write_protect_np(static_cast<uint32_t>(access));
+ pthread_jit_write_protect_np(static_cast<int>(access));
#else
DebugUtils::unused(access);
#endif
@@ -719,4 +1174,33 @@ void protectJitMemory(ProtectJitAccess access) noexcept {
ASMJIT_END_SUB_NAMESPACE
-#endif
+// Virtual Memory - Tests
+// ======================
+
+#if defined(ASMJIT_TEST)
+ASMJIT_BEGIN_NAMESPACE
+
+UNIT(virt_mem) {
+ VirtMem::Info vmInfo = VirtMem::info();
+
+ INFO("VirtMem::info():");
+ INFO(" pageSize: %zu", size_t(vmInfo.pageSize));
+ INFO(" pageGranularity: %zu", size_t(vmInfo.pageGranularity));
+
+ INFO("VirtMem::largePageSize():");
+ INFO(" largePageSize: %zu", size_t(VirtMem::largePageSize()));
+
+ VirtMem::HardenedRuntimeInfo hardenedRtInfo = VirtMem::hardenedRuntimeInfo();
+ VirtMem::HardenedRuntimeFlags hardenedFlags = hardenedRtInfo.flags;
+
+ INFO("VirtMem::hardenedRuntimeInfo():");
+ INFO(" flags:");
+ INFO(" kEnabled: %s" , Support::test(hardenedFlags, VirtMem::HardenedRuntimeFlags::kEnabled ) ? "true" : "false");
+ INFO(" kMapJit: %s" , Support::test(hardenedFlags, VirtMem::HardenedRuntimeFlags::kMapJit ) ? "true" : "false");
+ INFO(" kDualMapping: %s", Support::test(hardenedFlags, VirtMem::HardenedRuntimeFlags::kDualMapping) ? "true" : "false");
+}
+
+ASMJIT_END_NAMESPACE
+#endif // ASMJIT_TEST
+
+#endif // !ASMJIT_NO_JIT
diff --git a/3rdparty/asmjit/src/asmjit/core/virtmem.h b/3rdparty/asmjit/src/asmjit/core/virtmem.h
index 50f09457eba..17996dcb07e 100644
--- a/3rdparty/asmjit/src/asmjit/core/virtmem.h
+++ b/3rdparty/asmjit/src/asmjit/core/virtmem.h
@@ -10,6 +10,7 @@
#ifndef ASMJIT_NO_JIT
#include "../core/globals.h"
+#include "../core/support.h"
ASMJIT_BEGIN_NAMESPACE
@@ -19,6 +20,21 @@ ASMJIT_BEGIN_NAMESPACE
//! Virtual memory management.
namespace VirtMem {
+//! Describes whether instruction cache should be flushed after a write operation.
+enum class CachePolicy : uint32_t {
+ //! Default policy.
+ //!
+ //! In some places this would mean `kFlushAfterWrite` and in some places it would mean `kNeverFlush`.
+ //! For example if it's known that an address has never been used before to execute code.
+ kDefault = 0,
+
+ //! Flush instruction cache after a write operation.
+ kFlushAfterWrite = 1,
+
+ //! Avoid flushing instruction cache after a write operation.
+ kNeverFlush = 2
+};
+
//! Flushes instruction cache in the given region.
//!
//! Only useful on non-x86 architectures, however, it's a good practice to call it on any platform to make your
@@ -36,6 +52,15 @@ struct Info {
//! Returns virtual memory information, see `VirtMem::Info` for more details.
ASMJIT_API Info info() noexcept;
+//! Returns the size of the smallest large page supported.
+//!
+//! AsmJit only uses the smallest large page at the moment as these are usually perfectly sized for executable
+//! memory allocation (standard size is 2MB, but different sizes are possible).
+//!
+//! Returns either the detected large page size or 0, if large page support is either not supported by AsmJit
+//! or not accessible to the process.
+ASMJIT_API size_t largePageSize() noexcept;
+
//! Virtual memory access and mmap-specific flags.
enum class MemoryFlags : uint32_t {
//! No flags.
@@ -50,52 +75,80 @@ enum class MemoryFlags : uint32_t {
//! Memory is executable.
kAccessExecute = 0x00000004u,
- //! A combination of \ref MemoryFlags::kAccessRead and \ref MemoryFlags::kAccessWrite.
+ //! A combination of \ref kAccessRead and \ref kAccessWrite.
kAccessReadWrite = kAccessRead | kAccessWrite,
- //! A combination of \ref MemoryFlags::kAccessRead, \ref MemoryFlags::kAccessWrite.
+ //! A combination of \ref kAccessRead, \ref kAccessWrite.
kAccessRW = kAccessRead | kAccessWrite,
- //! A combination of \ref MemoryFlags::kAccessRead and \ref MemoryFlags::kAccessExecute.
+ //! A combination of \ref kAccessRead and \ref kAccessExecute.
kAccessRX = kAccessRead | kAccessExecute,
- //! A combination of \ref MemoryFlags::kAccessRead, \ref MemoryFlags::kAccessWrite, and
- //! \ref MemoryFlags::kAccessExecute.
+ //! A combination of \ref kAccessRead, \ref kAccessWrite, and \ref kAccessExecute.
kAccessRWX = kAccessRead | kAccessWrite | kAccessExecute,
- //! Use a `MAP_JIT` flag available on Apple platforms (introduced by Mojave), which allows JIT code to be executed
- //! in MAC bundles. This flag is not turned on by default, because when a process uses `fork()` the child process
- //! has no access to the pages mapped with `MAP_JIT`, which could break code that doesn't expect this behavior.
+ //! Use a `MAP_JIT` flag available on Apple platforms (introduced by Mojave), which allows JIT code to be
+ //! executed in a MAC bundle.
//!
- //! \note This flag can only be used with \ref VirtMem::alloc().
+ //! This flag may be turned on by the allocator if there is no other way of allocating executable memory.
+ //!
+ //! \note This flag can only be used with \ref VirtMem::alloc(), `MAP_JIT` only works on OSX and not on iOS.
+ //! When a process uses `fork()` the child process has no access to the pages mapped with `MAP_JIT`.
kMMapEnableMapJit = 0x00000010u,
- //! Pass `PROT_MAX(PROT_READ)` to mmap() on platforms that support `PROT_MAX`.
+ //! Pass `PROT_MAX(PROT_READ)` or `PROT_MPROTECT(PROT_READ)` to `mmap()` on platforms that support it.
//!
- //! \note This flag can only be used with \ref VirtMem::alloc().
+ //! This flag allows to set a "maximum access" that the memory page can get during its lifetime. Use
+ //! \ref VirtMem::protect() to change the access flags.
+ //!
+ //! \note This flag can only be used with \ref VirtMem::alloc() and \ref VirtMem::allocDualMapping().
+ //! However \ref VirtMem::allocDualMapping() may automatically use this if \ref kAccessRead is used.
kMMapMaxAccessRead = 0x00000020u,
- //! Pass `PROT_MAX(PROT_WRITE)` to mmap() on platforms that support `PROT_MAX`.
+
+ //! Pass `PROT_MAX(PROT_WRITE)` or `PROT_MPROTECT(PROT_WRITE)` to `mmap()` on platforms that support it.
//!
- //! \note This flag can only be used with \ref VirtMem::alloc().
+ //! This flag allows to set a "maximum access" that the memory page can get during its lifetime. Use
+ //! \ref VirtMem::protect() to change the access flags.
+ //!
+ //! \note This flag can only be used with \ref VirtMem::alloc() and \ref VirtMem::allocDualMapping().
+ //! However \ref VirtMem::allocDualMapping() may automatically use this if \ref kAccessWrite is used.
kMMapMaxAccessWrite = 0x00000040u,
- //! Pass `PROT_MAX(PROT_EXEC)` to mmap() on platforms that support `PROT_MAX`.
+
+ //! Pass `PROT_MAX(PROT_EXEC)` or `PROT_MPROTECT(PROT_EXEC)` to `mmap()` on platforms that support it.
//!
- //! \note This flag can only be used with \ref VirtMem::alloc().
+ //! This flag allows to set a "maximum access" that the memory page can get during its lifetime. Use
+ //! \ref VirtMem::protect() to change the access flags.
+ //!
+ //! \note This flag can only be used with \ref VirtMem::alloc() and \ref VirtMem::allocDualMapping().
+ //! However \ref VirtMem::allocDualMapping() may automatically use this if \ref kAccessExecute is used.
kMMapMaxAccessExecute = 0x00000080u,
- //! A combination of \ref MemoryFlags::kMMapMaxAccessRead and \ref MemoryFlags::kMMapMaxAccessWrite.
+ //! A combination of \ref kMMapMaxAccessRead and \ref kMMapMaxAccessWrite.
kMMapMaxAccessReadWrite = kMMapMaxAccessRead | kMMapMaxAccessWrite,
- //! A combination of \ref MemoryFlags::kMMapMaxAccessRead and \ref MemoryFlags::kMMapMaxAccessWrite.
+ //! A combination of \ref kMMapMaxAccessRead and \ref kMMapMaxAccessWrite.
kMMapMaxAccessRW = kMMapMaxAccessRead | kMMapMaxAccessWrite,
- //! A combination of \ref MemoryFlags::kMMapMaxAccessRead and \ref MemoryFlags::kMMapMaxAccessExecute.
+ //! A combination of \ref kMMapMaxAccessRead and \ref kMMapMaxAccessExecute.
kMMapMaxAccessRX = kMMapMaxAccessRead | kMMapMaxAccessExecute,
- //! A combination of \ref MemoryFlags::kMMapMaxAccessRead, \ref MemoryFlags::kMMapMaxAccessWrite, \ref
- //! MemoryFlags::kMMapMaxAccessExecute.
+ //! A combination of \ref kMMapMaxAccessRead, \ref kMMapMaxAccessWrite, \ref kMMapMaxAccessExecute.
kMMapMaxAccessRWX = kMMapMaxAccessRead | kMMapMaxAccessWrite | kMMapMaxAccessExecute,
+ //! Use `MAP_SHARED` when calling mmap().
+ //!
+ //! \note In some cases `MAP_SHARED` may be set automatically. For example, some dual mapping implementations must
+ //! use `MAP_SHARED` instead of `MAP_PRIVATE` to ensure that the OS would not apply copy on write on RW page, which
+ //! would cause RX page not having the updated content.
+ kMapShared = 0x00000100u,
+
+ //! Request large memory mapped pages.
+ //!
+ //! \remarks If this option is used and large page(s) cannot be mapped, the allocation will fail. Fallback to
+ //! regular pages must be done by the user in this case. Higher level API such as \ref JitAllocator provides an
+ //! additional mechanism to allocate regular page(s) when large page(s) allocation fails.
+ kMMapLargePages = 0x00000200u,
+
//! Not an access flag, only used by `allocDualMapping()` to override the default allocation strategy to always use
//! a 'tmp' directory instead of "/dev/shm" (on POSIX platforms). Please note that this flag will be ignored if the
//! operating system allows to allocate an executable memory by a different API than `open()` or `shm_open()`. For
@@ -157,21 +210,37 @@ enum class HardenedRuntimeFlags : uint32_t {
//! Hardened runtime is enabled - it's not possible to have "Write & Execute" memory protection. The runtime
//! enforces W^X (either write or execute).
//!
- //! \note If the runtime is hardened it means that an operating system specific protection is used. For example on
- //! MacOS platform it's possible to allocate memory with MAP_JIT flag and then use `pthread_jit_write_protect_np()`
+ //! \note If the runtime is hardened it means that an operating system specific protection is used. For example
+ //! on Apple OSX it's possible to allocate memory with MAP_JIT flag and then use `pthread_jit_write_protect_np()`
//! to temporarily swap access permissions for the current thread. Dual mapping is also a possibility on X86/X64
//! architecture.
kEnabled = 0x00000001u,
- //! Read+Write+Execute can only be allocated with MAP_JIT flag (Apple specific).
- kMapJit = 0x00000002u
+ //! Read+Write+Execute can only be allocated with MAP_JIT flag (Apple specific, only available on Apple platforms).
+ kMapJit = 0x00000002u,
+
+ //! Read+Write+Execute can be allocated with dual mapping approach (one region with RW and the other with RX).
+ kDualMapping = 0x00000004u
};
ASMJIT_DEFINE_ENUM_FLAGS(HardenedRuntimeFlags)
//! Hardened runtime information.
struct HardenedRuntimeInfo {
+ //! \name Members
+ //! \{
+
//! Hardened runtime flags.
HardenedRuntimeFlags flags;
+
+ //! \}
+
+ //! \name Accessors
+ //! \{
+
+ //! Tests whether the hardened runtime `flag` is set.
+ ASMJIT_INLINE_NODEBUG bool hasFlag(HardenedRuntimeFlags flag) const noexcept { return Support::test(flags, flag); }
+
+ //! \}
};
//! Returns runtime features provided by the OS.
@@ -187,7 +256,7 @@ enum class ProtectJitAccess : uint32_t {
//! Protects access of memory mapped with MAP_JIT flag for the current thread.
//!
-//! \note This feature is only available on Apple hardware (AArch64) at the moment and and uses a non-portable
+//! \note This feature is only available on Apple hardware (AArch64) at the moment and uses a non-portable
//! `pthread_jit_write_protect_np()` call when available.
//!
//! This function must be called before and after a memory mapped with MAP_JIT flag is modified. Example:
@@ -212,24 +281,40 @@ ASMJIT_API void protectJitMemory(ProtectJitAccess access) noexcept;
//! in destructor. The purpose of this class is to make writing to JIT memory easier.
class ProtectJitReadWriteScope {
public:
+ ASMJIT_NONCOPYABLE(ProtectJitReadWriteScope)
+
+ //! \name Members
+ //! \{
+
void* _rxPtr;
size_t _size;
+ CachePolicy _policy;
+
+ //! \}
+
+ //! \name Construction & Destruction
+ //! \{
//! Makes the given memory block RW protected.
- ASMJIT_FORCE_INLINE ProtectJitReadWriteScope(void* rxPtr, size_t size) noexcept
+ ASMJIT_FORCE_INLINE ProtectJitReadWriteScope(
+ void* rxPtr,
+ size_t size,
+ CachePolicy policy = CachePolicy::kDefault) noexcept
: _rxPtr(rxPtr),
- _size(size) {
+ _size(size),
+ _policy(policy) {
protectJitMemory(ProtectJitAccess::kReadWrite);
}
- // Not copyable.
- ProtectJitReadWriteScope(const ProtectJitReadWriteScope& other) = delete;
-
//! Makes the memory block RX protected again and flushes instruction cache.
ASMJIT_FORCE_INLINE ~ProtectJitReadWriteScope() noexcept {
protectJitMemory(ProtectJitAccess::kReadExecute);
- flushInstructionCache(_rxPtr, _size);
+
+ if (_policy != CachePolicy::kNeverFlush)
+ flushInstructionCache(_rxPtr, _size);
}
+
+ //! \}
};
} // VirtMem
diff --git a/3rdparty/asmjit/src/asmjit/core/zone.cpp b/3rdparty/asmjit/src/asmjit/core/zone.cpp
index d68e110b48c..e1948ebb0c9 100644
--- a/3rdparty/asmjit/src/asmjit/core/zone.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/zone.cpp
@@ -16,8 +16,8 @@ ASMJIT_BEGIN_NAMESPACE
// and should never be modified.
const Zone::Block Zone::_zeroBlock = { nullptr, nullptr, 0 };
-// Zone - Init & Reset
-// ===================
+// Zone - Initialization & Reset
+// =============================
void Zone::_init(size_t blockSize, size_t blockAlignment, const Support::Temporary* temporary) noexcept {
ASMJIT_ASSERT(blockSize >= kMinBlockSize);
@@ -215,8 +215,8 @@ static bool ZoneAllocator_hasDynamicBlock(ZoneAllocator* self, ZoneAllocator::Dy
}
#endif
-// ZoneAllocator - Init & Reset
-// ============================
+// ZoneAllocator - Initialization & Reset
+// ======================================
void ZoneAllocator::reset(Zone* zone) noexcept {
// Free dynamic blocks.
@@ -227,9 +227,9 @@ void ZoneAllocator::reset(Zone* zone) noexcept {
block = next;
}
- // Zero the entire class and initialize to the given `zone`.
- memset(this, 0, sizeof(*this));
_zone = zone;
+ memset(_slots, 0, sizeof(_slots));
+ _dynamicBlocks = nullptr;
}
// asmjit::ZoneAllocator - Alloc & Release
diff --git a/3rdparty/asmjit/src/asmjit/core/zone.h b/3rdparty/asmjit/src/asmjit/core/zone.h
index eaea252903e..b61a3d1292c 100644
--- a/3rdparty/asmjit/src/asmjit/core/zone.h
+++ b/3rdparty/asmjit/src/asmjit/core/zone.h
@@ -85,17 +85,17 @@ public:
//!
//! It's not required, but it's good practice to set `blockSize` to a reasonable value that depends on the usage
//! of `Zone`. Greater block sizes are generally safer and perform better than unreasonably low block sizes.
- inline explicit Zone(size_t blockSize, size_t blockAlignment = 1) noexcept {
+ ASMJIT_INLINE_NODEBUG explicit Zone(size_t blockSize, size_t blockAlignment = 1) noexcept {
_init(blockSize, blockAlignment, nullptr);
}
//! Creates a new Zone with a first block pointing to a `temporary` memory.
- inline Zone(size_t blockSize, size_t blockAlignment, const Support::Temporary& temporary) noexcept {
+ ASMJIT_INLINE_NODEBUG Zone(size_t blockSize, size_t blockAlignment, const Support::Temporary& temporary) noexcept {
_init(blockSize, blockAlignment, &temporary);
}
//! \overload
- inline Zone(size_t blockSize, size_t blockAlignment, const Support::Temporary* temporary) noexcept {
+ ASMJIT_INLINE_NODEBUG Zone(size_t blockSize, size_t blockAlignment, const Support::Temporary* temporary) noexcept {
_init(blockSize, blockAlignment, temporary);
}
@@ -118,7 +118,7 @@ public:
//!
//! This will destroy the `Zone` instance and release all blocks of memory allocated by it. It performs implicit
//! `reset(ResetPolicy::kHard)`.
- inline ~Zone() noexcept { reset(ResetPolicy::kHard); }
+ ASMJIT_INLINE_NODEBUG ~Zone() noexcept { reset(ResetPolicy::kHard); }
ASMJIT_API void _init(size_t blockSize, size_t blockAlignment, const Support::Temporary* temporary) noexcept;
@@ -133,24 +133,24 @@ public:
//! \{
//! Tests whether this `Zone` is actually a `ZoneTmp` that uses temporary memory.
- inline bool isTemporary() const noexcept { return _isTemporary != 0; }
+ ASMJIT_INLINE_NODEBUG bool isTemporary() const noexcept { return _isTemporary != 0; }
//! Returns the default block size.
- inline size_t blockSize() const noexcept { return _blockSize; }
+ ASMJIT_INLINE_NODEBUG size_t blockSize() const noexcept { return _blockSize; }
//! Returns the default block alignment.
- inline size_t blockAlignment() const noexcept { return size_t(1) << _blockAlignmentShift; }
+ ASMJIT_INLINE_NODEBUG size_t blockAlignment() const noexcept { return size_t(1) << _blockAlignmentShift; }
//! Returns remaining size of the current block.
- inline size_t remainingSize() const noexcept { return (size_t)(_end - _ptr); }
+ ASMJIT_INLINE_NODEBUG size_t remainingSize() const noexcept { return (size_t)(_end - _ptr); }
//! Returns the current zone cursor (dangerous).
//!
//! This is a function that can be used to get exclusive access to the current block's memory buffer.
template<typename T = uint8_t>
- inline T* ptr() noexcept { return reinterpret_cast<T*>(_ptr); }
+ ASMJIT_INLINE_NODEBUG T* ptr() noexcept { return reinterpret_cast<T*>(_ptr); }
//! Returns the end of the current zone block, only useful if you use `ptr()`.
template<typename T = uint8_t>
- inline T* end() noexcept { return reinterpret_cast<T*>(_end); }
+ ASMJIT_INLINE_NODEBUG T* end() noexcept { return reinterpret_cast<T*>(_end); }
//! Sets the current zone pointer to `ptr` (must be within the current block).
template<typename T>
@@ -185,7 +185,7 @@ public:
}
//! Aligns the current pointer to `alignment`.
- inline void align(size_t alignment) noexcept {
+ ASMJIT_INLINE_NODEBUG void align(size_t alignment) noexcept {
_ptr = Support::min(Support::alignUp(_ptr, alignment), _end);
}
@@ -193,7 +193,7 @@ public:
//!
//! \note This function doesn't respect any alignment. If you need to ensure there is enough room for an aligned
//! allocation you need to call `align()` before calling `ensure()`.
- inline Error ensure(size_t size) noexcept {
+ ASMJIT_INLINE_NODEBUG Error ensure(size_t size) noexcept {
if (size <= remainingSize())
return kErrorOk;
else
@@ -322,7 +322,7 @@ public:
void* p = alloc(sizeof(T), alignof(T));
if (ASMJIT_UNLIKELY(!p))
return nullptr;
- return new(p) T();
+ return new(Support::PlacementNew{p}) T();
}
//! Like `new(std::nothrow) T(...)`, but allocated by `Zone`.
@@ -331,7 +331,7 @@ public:
void* p = alloc(sizeof(T), alignof(T));
if (ASMJIT_UNLIKELY(!p))
return nullptr;
- return new(p) T(std::forward<Args>(args)...);
+ return new(Support::PlacementNew{p}) T(std::forward<Args>(args)...);
}
//! \cond INTERNAL
@@ -430,11 +430,11 @@ public:
//! \{
//! Zone used to allocate memory that fits into slots.
- Zone* _zone;
+ Zone* _zone {};
//! Indexed slots containing released memory.
- Slot* _slots[kLoCount + kHiCount];
+ Slot* _slots[kLoCount + kHiCount] {};
//! Dynamic blocks for larger allocations (no slots).
- DynamicBlock* _dynamicBlocks;
+ DynamicBlock* _dynamicBlocks {};
//! \}
@@ -444,26 +444,22 @@ public:
//! Creates a new `ZoneAllocator`.
//!
//! \note To use it, you must first `init()` it.
- inline ZoneAllocator() noexcept {
- memset(this, 0, sizeof(*this));
- }
+ ASMJIT_INLINE_NODEBUG ZoneAllocator() noexcept {}
//! Creates a new `ZoneAllocator` initialized to use `zone`.
- inline explicit ZoneAllocator(Zone* zone) noexcept {
- memset(this, 0, sizeof(*this));
- _zone = zone;
- }
+ ASMJIT_INLINE_NODEBUG explicit ZoneAllocator(Zone* zone) noexcept
+ : _zone(zone) {}
//! Destroys the `ZoneAllocator`.
- inline ~ZoneAllocator() noexcept { reset(); }
+ ASMJIT_INLINE_NODEBUG ~ZoneAllocator() noexcept { reset(); }
//! Tests whether the `ZoneAllocator` is initialized (i.e. has `Zone`).
- inline bool isInitialized() const noexcept { return _zone != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool isInitialized() const noexcept { return _zone != nullptr; }
//! Convenience function to initialize the `ZoneAllocator` with `zone`.
//!
//! It's the same as calling `reset(zone)`.
- inline void init(Zone* zone) noexcept { reset(zone); }
+ ASMJIT_INLINE_NODEBUG void init(Zone* zone) noexcept { reset(zone); }
//! Resets this `ZoneAllocator` and also forget about the current `Zone` which is attached (if any). Reset
//! optionally attaches a new `zone` passed, or keeps the `ZoneAllocator` in an uninitialized state, if
@@ -476,7 +472,7 @@ public:
//! \{
//! Returns the assigned `Zone` of this allocator or null if this `ZoneAllocator` is not initialized.
- inline Zone* zone() const noexcept { return _zone; }
+ ASMJIT_INLINE_NODEBUG Zone* zone() const noexcept { return _zone; }
//! \}
@@ -577,7 +573,7 @@ public:
void* p = allocT<T>();
if (ASMJIT_UNLIKELY(!p))
return nullptr;
- return new(p) T();
+ return new(Support::PlacementNew{p}) T();
}
//! Like `new(std::nothrow) T(...)`, but allocated by `Zone`.
template<typename T, typename... Args>
@@ -585,7 +581,7 @@ public:
void* p = allocT<T>();
if (ASMJIT_UNLIKELY(!p))
return nullptr;
- return new(p) T(std::forward<Args>(args)...);
+ return new(Support::PlacementNew{p}) T(std::forward<Args>(args)...);
}
//! Releases the memory previously allocated by `alloc()`. The `size` argument has to be the same as used to call
diff --git a/3rdparty/asmjit/src/asmjit/core/zonehash.cpp b/3rdparty/asmjit/src/asmjit/core/zonehash.cpp
index 3778fbe2260..578b083680e 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonehash.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/zonehash.cpp
@@ -288,8 +288,8 @@ UNIT(zone_hash) {
for (key = 0; key < count; key++) {
node = hashTable.get(MyKeyMatcher(key));
- EXPECT(node != nullptr);
- EXPECT(node->_key == key);
+ EXPECT_NOT_NULL(node);
+ EXPECT_EQ(node->_key, key);
}
{
@@ -298,11 +298,11 @@ UNIT(zone_hash) {
hashTable.remove(&allocator, node);
node = hashTable.get(MyKeyMatcher(count));
- EXPECT(node == nullptr);
+ EXPECT_NULL(node);
}
} while (count);
- EXPECT(hashTable.empty());
+ EXPECT_TRUE(hashTable.empty());
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/core/zonehash.h b/3rdparty/asmjit/src/asmjit/core/zonehash.h
index f332290b54d..d6cd2e31cb9 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonehash.h
+++ b/3rdparty/asmjit/src/asmjit/core/zonehash.h
@@ -59,7 +59,7 @@ public:
//! \name Construction & Destruction
//! \{
- inline ZoneHashBase() noexcept {
+ ASMJIT_INLINE_NODEBUG ZoneHashBase() noexcept {
reset();
}
@@ -99,8 +99,8 @@ public:
//! \name Accessors
//! \{
- inline bool empty() const noexcept { return _size == 0; }
- inline size_t size() const noexcept { return _size; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _size == 0; }
+ ASMJIT_INLINE_NODEBUG size_t size() const noexcept { return _size; }
//! \}
@@ -150,10 +150,10 @@ public:
//! \name Construction & Destruction
//! \{
- inline ZoneHash() noexcept
+ ASMJIT_INLINE_NODEBUG ZoneHash() noexcept
: ZoneHashBase() {}
- inline ZoneHash(ZoneHash&& other) noexcept
+ ASMJIT_INLINE_NODEBUG ZoneHash(ZoneHash&& other) noexcept
: ZoneHash(other) {}
//! \}
@@ -161,7 +161,7 @@ public:
//! \name Utilities
//! \{
- inline void swap(ZoneHash& other) noexcept { ZoneHashBase::_swap(other); }
+ ASMJIT_INLINE_NODEBUG void swap(ZoneHash& other) noexcept { ZoneHashBase::_swap(other); }
template<typename KeyT>
inline NodeT* get(const KeyT& key) const noexcept {
@@ -173,8 +173,8 @@ public:
return node;
}
- inline NodeT* insert(ZoneAllocator* allocator, NodeT* node) noexcept { return static_cast<NodeT*>(_insert(allocator, node)); }
- inline NodeT* remove(ZoneAllocator* allocator, NodeT* node) noexcept { return static_cast<NodeT*>(_remove(allocator, node)); }
+ ASMJIT_INLINE_NODEBUG NodeT* insert(ZoneAllocator* allocator, NodeT* node) noexcept { return static_cast<NodeT*>(_insert(allocator, node)); }
+ ASMJIT_INLINE_NODEBUG NodeT* remove(ZoneAllocator* allocator, NodeT* node) noexcept { return static_cast<NodeT*>(_remove(allocator, node)); }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/core/zonelist.cpp b/3rdparty/asmjit/src/asmjit/core/zonelist.cpp
index d4b311d4307..ff2c2cf1540 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonelist.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/zonelist.cpp
@@ -27,136 +27,136 @@ UNIT(zone_list) {
INFO("Append / Unlink");
// []
- EXPECT(list.empty() == true);
+ EXPECT_TRUE(list.empty());
// [A]
list.append(a);
- EXPECT(list.empty() == false);
- EXPECT(list.first() == a);
- EXPECT(list.last() == a);
- EXPECT(a->prev() == nullptr);
- EXPECT(a->next() == nullptr);
+ EXPECT_FALSE(list.empty());
+ EXPECT_EQ(list.first(), a);
+ EXPECT_EQ(list.last(), a);
+ EXPECT_NULL(a->prev());
+ EXPECT_NULL(a->next());
// [A, B]
list.append(b);
- EXPECT(list.first() == a);
- EXPECT(list.last() == b);
- EXPECT(a->prev() == nullptr);
- EXPECT(a->next() == b);
- EXPECT(b->prev() == a);
- EXPECT(b->next() == nullptr);
+ EXPECT_EQ(list.first(), a);
+ EXPECT_EQ(list.last(), b);
+ EXPECT_NULL(a->prev());
+ EXPECT_EQ(a->next(), b);
+ EXPECT_EQ(b->prev(), a);
+ EXPECT_NULL(b->next());
// [A, B, C]
list.append(c);
- EXPECT(list.first() == a);
- EXPECT(list.last() == c);
- EXPECT(a->prev() == nullptr);
- EXPECT(a->next() == b);
- EXPECT(b->prev() == a);
- EXPECT(b->next() == c);
- EXPECT(c->prev() == b);
- EXPECT(c->next() == nullptr);
+ EXPECT_EQ(list.first(), a);
+ EXPECT_EQ(list.last(), c);
+ EXPECT_NULL(a->prev());
+ EXPECT_EQ(a->next(), b);
+ EXPECT_EQ(b->prev(), a);
+ EXPECT_EQ(b->next(), c);
+ EXPECT_EQ(c->prev(), b);
+ EXPECT_NULL(c->next());
// [B, C]
list.unlink(a);
- EXPECT(list.first() == b);
- EXPECT(list.last() == c);
- EXPECT(a->prev() == nullptr);
- EXPECT(a->next() == nullptr);
- EXPECT(b->prev() == nullptr);
- EXPECT(b->next() == c);
- EXPECT(c->prev() == b);
- EXPECT(c->next() == nullptr);
+ EXPECT_EQ(list.first(), b);
+ EXPECT_EQ(list.last(), c);
+ EXPECT_NULL(a->prev());
+ EXPECT_NULL(a->next());
+ EXPECT_NULL(b->prev());
+ EXPECT_EQ(b->next(), c);
+ EXPECT_EQ(c->prev(), b);
+ EXPECT_NULL(c->next());
// [B]
list.unlink(c);
- EXPECT(list.first() == b);
- EXPECT(list.last() == b);
- EXPECT(b->prev() == nullptr);
- EXPECT(b->next() == nullptr);
- EXPECT(c->prev() == nullptr);
- EXPECT(c->next() == nullptr);
+ EXPECT_EQ(list.first(), b);
+ EXPECT_EQ(list.last(), b);
+ EXPECT_NULL(b->prev());
+ EXPECT_NULL(b->next());
+ EXPECT_NULL(c->prev());
+ EXPECT_NULL(c->next());
// []
list.unlink(b);
- EXPECT(list.empty() == true);
- EXPECT(list.first() == nullptr);
- EXPECT(list.last() == nullptr);
- EXPECT(b->prev() == nullptr);
- EXPECT(b->next() == nullptr);
+ EXPECT_TRUE(list.empty());
+ EXPECT_NULL(list.first());
+ EXPECT_NULL(list.last());
+ EXPECT_NULL(b->prev());
+ EXPECT_NULL(b->next());
INFO("Prepend / Unlink");
// [A]
list.prepend(a);
- EXPECT(list.empty() == false);
- EXPECT(list.first() == a);
- EXPECT(list.last() == a);
- EXPECT(a->prev() == nullptr);
- EXPECT(a->next() == nullptr);
+ EXPECT_FALSE(list.empty());
+ EXPECT_EQ(list.first(), a);
+ EXPECT_EQ(list.last(), a);
+ EXPECT_NULL(a->prev());
+ EXPECT_NULL(a->next());
// [B, A]
list.prepend(b);
- EXPECT(list.first() == b);
- EXPECT(list.last() == a);
- EXPECT(b->prev() == nullptr);
- EXPECT(b->next() == a);
- EXPECT(a->prev() == b);
- EXPECT(a->next() == nullptr);
+ EXPECT_EQ(list.first(), b);
+ EXPECT_EQ(list.last(), a);
+ EXPECT_NULL(b->prev());
+ EXPECT_EQ(b->next(), a);
+ EXPECT_EQ(a->prev(), b);
+ EXPECT_NULL(a->next());
INFO("InsertAfter / InsertBefore");
// [B, A, C]
list.insertAfter(a, c);
- EXPECT(list.first() == b);
- EXPECT(list.last() == c);
- EXPECT(b->prev() == nullptr);
- EXPECT(b->next() == a);
- EXPECT(a->prev() == b);
- EXPECT(a->next() == c);
- EXPECT(c->prev() == a);
- EXPECT(c->next() == nullptr);
+ EXPECT_EQ(list.first(), b);
+ EXPECT_EQ(list.last(), c);
+ EXPECT_NULL(b->prev());
+ EXPECT_EQ(b->next(), a);
+ EXPECT_EQ(a->prev(), b);
+ EXPECT_EQ(a->next(), c);
+ EXPECT_EQ(c->prev(), a);
+ EXPECT_NULL(c->next());
// [B, D, A, C]
list.insertBefore(a, d);
- EXPECT(list.first() == b);
- EXPECT(list.last() == c);
- EXPECT(b->prev() == nullptr);
- EXPECT(b->next() == d);
- EXPECT(d->prev() == b);
- EXPECT(d->next() == a);
- EXPECT(a->prev() == d);
- EXPECT(a->next() == c);
- EXPECT(c->prev() == a);
- EXPECT(c->next() == nullptr);
+ EXPECT_EQ(list.first(), b);
+ EXPECT_EQ(list.last(), c);
+ EXPECT_NULL(b->prev());
+ EXPECT_EQ(b->next(), d);
+ EXPECT_EQ(d->prev(), b);
+ EXPECT_EQ(d->next(), a);
+ EXPECT_EQ(a->prev(), d);
+ EXPECT_EQ(a->next(), c);
+ EXPECT_EQ(c->prev(), a);
+ EXPECT_NULL(c->next());
INFO("PopFirst / Pop");
// [D, A, C]
- EXPECT(list.popFirst() == b);
- EXPECT(b->prev() == nullptr);
- EXPECT(b->next() == nullptr);
-
- EXPECT(list.first() == d);
- EXPECT(list.last() == c);
- EXPECT(d->prev() == nullptr);
- EXPECT(d->next() == a);
- EXPECT(a->prev() == d);
- EXPECT(a->next() == c);
- EXPECT(c->prev() == a);
- EXPECT(c->next() == nullptr);
+ EXPECT_EQ(list.popFirst(), b);
+ EXPECT_NULL(b->prev());
+ EXPECT_NULL(b->next());
+
+ EXPECT_EQ(list.first(), d);
+ EXPECT_EQ(list.last(), c);
+ EXPECT_NULL(d->prev());
+ EXPECT_EQ(d->next(), a);
+ EXPECT_EQ(a->prev(), d);
+ EXPECT_EQ(a->next(), c);
+ EXPECT_EQ(c->prev(), a);
+ EXPECT_NULL(c->next());
// [D, A]
- EXPECT(list.pop() == c);
- EXPECT(c->prev() == nullptr);
- EXPECT(c->next() == nullptr);
-
- EXPECT(list.first() == d);
- EXPECT(list.last() == a);
- EXPECT(d->prev() == nullptr);
- EXPECT(d->next() == a);
- EXPECT(a->prev() == d);
- EXPECT(a->next() == nullptr);
+ EXPECT_EQ(list.pop(), c);
+ EXPECT_NULL(c->prev());
+ EXPECT_NULL(c->next());
+
+ EXPECT_EQ(list.first(), d);
+ EXPECT_EQ(list.last(), a);
+ EXPECT_NULL(d->prev());
+ EXPECT_EQ(d->next(), a);
+ EXPECT_EQ(a->prev(), d);
+ EXPECT_NULL(a->next());
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/core/zonelist.h b/3rdparty/asmjit/src/asmjit/core/zonelist.h
index c5e00136589..8980240ef43 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonelist.h
+++ b/3rdparty/asmjit/src/asmjit/core/zonelist.h
@@ -39,10 +39,10 @@ public:
//! \name Construction & Destruction
//! \{
- inline ZoneListNode() noexcept
+ ASMJIT_INLINE_NODEBUG ZoneListNode() noexcept
: _listNodes { nullptr, nullptr } {}
- inline ZoneListNode(ZoneListNode&& other) noexcept
+ ASMJIT_INLINE_NODEBUG ZoneListNode(ZoneListNode&& other) noexcept
: _listNodes { other._listNodes[0], other._listNodes[1] } {}
//! \}
@@ -50,11 +50,11 @@ public:
//! \name Accessors
//! \{
- inline bool hasPrev() const noexcept { return _listNodes[kNodeIndexPrev] != nullptr; }
- inline bool hasNext() const noexcept { return _listNodes[kNodeIndexNext] != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasPrev() const noexcept { return _listNodes[kNodeIndexPrev] != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool hasNext() const noexcept { return _listNodes[kNodeIndexNext] != nullptr; }
- inline NodeT* prev() const noexcept { return _listNodes[kNodeIndexPrev]; }
- inline NodeT* next() const noexcept { return _listNodes[kNodeIndexNext]; }
+ ASMJIT_INLINE_NODEBUG NodeT* prev() const noexcept { return _listNodes[kNodeIndexPrev]; }
+ ASMJIT_INLINE_NODEBUG NodeT* next() const noexcept { return _listNodes[kNodeIndexNext]; }
//! \}
};
@@ -78,20 +78,19 @@ public:
//! \name Members
//! \{
- NodeT* _nodes[2];
+ NodeT* _nodes[2] {};
//! \}
//! \name Construction & Destruction
//! \{
- inline ZoneList() noexcept
- : _nodes { nullptr, nullptr } {}
+ ASMJIT_INLINE_NODEBUG ZoneList() noexcept {}
- inline ZoneList(ZoneList&& other) noexcept
+ ASMJIT_INLINE_NODEBUG ZoneList(ZoneList&& other) noexcept
: _nodes { other._nodes[0], other._nodes[1] } {}
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_nodes[0] = nullptr;
_nodes[1] = nullptr;
}
@@ -101,16 +100,16 @@ public:
//! \name Accessors
//! \{
- inline bool empty() const noexcept { return _nodes[0] == nullptr; }
- inline NodeT* first() const noexcept { return _nodes[kNodeIndexFirst]; }
- inline NodeT* last() const noexcept { return _nodes[kNodeIndexLast]; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _nodes[0] == nullptr; }
+ ASMJIT_INLINE_NODEBUG NodeT* first() const noexcept { return _nodes[kNodeIndexFirst]; }
+ ASMJIT_INLINE_NODEBUG NodeT* last() const noexcept { return _nodes[kNodeIndexLast]; }
//! \}
//! \name Utilities
//! \{
- inline void swap(ZoneList& other) noexcept {
+ ASMJIT_INLINE_NODEBUG void swap(ZoneList& other) noexcept {
std::swap(_nodes[0], other._nodes[0]);
std::swap(_nodes[1], other._nodes[1]);
}
@@ -144,11 +143,11 @@ public:
node->_listNodes[ dir] = next;
}
- inline void append(NodeT* node) noexcept { _addNode(node, kNodeIndexLast); }
- inline void prepend(NodeT* node) noexcept { _addNode(node, kNodeIndexFirst); }
+ ASMJIT_INLINE_NODEBUG void append(NodeT* node) noexcept { _addNode(node, kNodeIndexLast); }
+ ASMJIT_INLINE_NODEBUG void prepend(NodeT* node) noexcept { _addNode(node, kNodeIndexFirst); }
- inline void insertAfter(NodeT* ref, NodeT* node) noexcept { _insertNode(ref, node, NodeT::kNodeIndexNext); }
- inline void insertBefore(NodeT* ref, NodeT* node) noexcept { _insertNode(ref, node, NodeT::kNodeIndexPrev); }
+ ASMJIT_INLINE_NODEBUG void insertAfter(NodeT* ref, NodeT* node) noexcept { _insertNode(ref, node, NodeT::kNodeIndexNext); }
+ ASMJIT_INLINE_NODEBUG void insertBefore(NodeT* ref, NodeT* node) noexcept { _insertNode(ref, node, NodeT::kNodeIndexPrev); }
inline NodeT* unlink(NodeT* node) noexcept {
NodeT* prev = node->prev();
diff --git a/3rdparty/asmjit/src/asmjit/core/zonestack.cpp b/3rdparty/asmjit/src/asmjit/core/zonestack.cpp
index 77e6f202c7d..7d66670935b 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonestack.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/zonestack.cpp
@@ -9,8 +9,8 @@
ASMJIT_BEGIN_NAMESPACE
-// ZoneStackBase - Init & Reset
-// ============================
+// ZoneStackBase - Initialization & Reset
+// ======================================
Error ZoneStackBase::_init(ZoneAllocator* allocator, size_t middleIndex) noexcept {
ZoneAllocator* oldAllocator = _allocator;
@@ -100,18 +100,24 @@ static void test_zone_stack(ZoneAllocator* allocator, const char* typeName) {
INFO("Testing ZoneStack<%s>", typeName);
INFO(" (%d items per one Block)", ZoneStack<T>::kNumBlockItems);
- EXPECT(stack.init(allocator) == kErrorOk);
- EXPECT(stack.empty(), "Stack must be empty after `init()`");
-
- EXPECT(stack.append(42) == kErrorOk);
- EXPECT(!stack.empty() , "Stack must not be empty after an item has been appended");
- EXPECT(stack.pop() == 42 , "Stack.pop() must return the item that has been appended last");
- EXPECT(stack.empty() , "Stack must be empty after the last item has been removed");
-
- EXPECT(stack.prepend(43) == kErrorOk);
- EXPECT(!stack.empty() , "Stack must not be empty after an item has been prepended");
- EXPECT(stack.popFirst() == 43, "Stack.popFirst() must return the item that has been prepended last");
- EXPECT(stack.empty() , "Stack must be empty after the last item has been removed");
+ EXPECT_EQ(stack.init(allocator), kErrorOk);
+ EXPECT_TRUE(stack.empty());
+
+ EXPECT_EQ(stack.append(42), kErrorOk);
+ EXPECT_FALSE(stack.empty())
+ .message("Stack must not be empty after an item has been appended");
+ EXPECT_EQ(stack.pop(), 42)
+ .message("Stack.pop() must return the item that has been appended last");
+ EXPECT_TRUE(stack.empty())
+ .message("Stack must be empty after the last item has been removed");
+
+ EXPECT_EQ(stack.prepend(43), kErrorOk);
+ EXPECT_FALSE(stack.empty())
+ .message("Stack must not be empty after an item has been prepended");
+ EXPECT_EQ(stack.popFirst(), 43)
+ .message("Stack.popFirst() must return the item that has been prepended last");
+ EXPECT_TRUE(stack.empty())
+ .message("Stack must be empty after the last item has been removed");
int i;
int iMin =-100000;
@@ -121,27 +127,31 @@ static void test_zone_stack(ZoneAllocator* allocator, const char* typeName) {
for (i = iMax; i >= 0; i--) stack.prepend(T(i));
for (i = 0; i <= iMax; i++) {
T item = stack.popFirst();
- EXPECT(i == item, "Item '%d' didn't match the item '%lld' popped", i, (long long)item);
+ EXPECT_EQ(i, item)
+ .message("Item '%d' didn't match the item '%lld' popped", i, (long long)item);
if (!stack.empty()) {
item = stack.popFirst();
- EXPECT(i + 1 == item, "Item '%d' didn't match the item '%lld' popped", i + 1, (long long)item);
+ EXPECT_EQ(i + 1, item)
+ .message("Item '%d' didn't match the item '%lld' popped", i + 1, (long long)item);
stack.prepend(item);
}
}
- EXPECT(stack.empty());
+ EXPECT_TRUE(stack.empty());
INFO("Validating append() & pop()");
for (i = 0; i <= iMax; i++) stack.append(T(i));
for (i = iMax; i >= 0; i--) {
T item = stack.pop();
- EXPECT(i == item, "Item '%d' didn't match the item '%lld' popped", i, (long long)item);
+ EXPECT_EQ(i, item)
+ .message("Item '%d' didn't match the item '%lld' popped", i, (long long)item);
if (!stack.empty()) {
item = stack.pop();
- EXPECT(i - 1 == item, "Item '%d' didn't match the item '%lld' popped", i - 1, (long long)item);
+ EXPECT_EQ(i - 1, item)
+ .message("Item '%d' didn't match the item '%lld' popped", i - 1, (long long)item);
stack.append(item);
}
}
- EXPECT(stack.empty());
+ EXPECT_TRUE(stack.empty());
INFO("Validating append()/prepend() & popFirst()");
for (i = 1; i <= iMax; i++) stack.append(T(i));
@@ -149,9 +159,9 @@ static void test_zone_stack(ZoneAllocator* allocator, const char* typeName) {
for (i = iMin; i <= iMax; i++) {
T item = stack.popFirst();
- EXPECT(i == item, "Item '%d' didn't match the item '%lld' popped", i, (long long)item);
+ EXPECT_EQ(i, item);
}
- EXPECT(stack.empty());
+ EXPECT_TRUE(stack.empty());
INFO("Validating append()/prepend() & pop()");
for (i = 0; i >= iMin; i--) stack.prepend(T(i));
@@ -159,9 +169,9 @@ static void test_zone_stack(ZoneAllocator* allocator, const char* typeName) {
for (i = iMax; i >= iMin; i--) {
T item = stack.pop();
- EXPECT(i == item, "Item '%d' didn't match the item '%lld' popped", i, (long long)item);
+ EXPECT_EQ(i, item);
}
- EXPECT(stack.empty());
+ EXPECT_TRUE(stack.empty());
}
UNIT(zone_stack) {
diff --git a/3rdparty/asmjit/src/asmjit/core/zonestack.h b/3rdparty/asmjit/src/asmjit/core/zonestack.h
index aea7b6868fa..16d5d09dbc1 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonestack.h
+++ b/3rdparty/asmjit/src/asmjit/core/zonestack.h
@@ -44,31 +44,33 @@ public:
//! Pointer to the end of the array.
void* _end;
- inline bool empty() const noexcept { return _start == _end; }
- inline Block* prev() const noexcept { return _link[kBlockIndexPrev]; }
- inline Block* next() const noexcept { return _link[kBlockIndexNext]; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _start == _end; }
+ ASMJIT_INLINE_NODEBUG Block* prev() const noexcept { return _link[kBlockIndexPrev]; }
+ ASMJIT_INLINE_NODEBUG Block* next() const noexcept { return _link[kBlockIndexNext]; }
- inline void setPrev(Block* block) noexcept { _link[kBlockIndexPrev] = block; }
- inline void setNext(Block* block) noexcept { _link[kBlockIndexNext] = block; }
+ ASMJIT_INLINE_NODEBUG void setPrev(Block* block) noexcept { _link[kBlockIndexPrev] = block; }
+ ASMJIT_INLINE_NODEBUG void setNext(Block* block) noexcept { _link[kBlockIndexNext] = block; }
template<typename T>
- inline T* start() const noexcept { return static_cast<T*>(_start); }
+ ASMJIT_INLINE_NODEBUG T* start() const noexcept { return static_cast<T*>(_start); }
template<typename T>
- inline void setStart(T* start) noexcept { _start = static_cast<void*>(start); }
+ ASMJIT_INLINE_NODEBUG void setStart(T* start) noexcept { _start = static_cast<void*>(start); }
template<typename T>
- inline T* end() const noexcept { return (T*)_end; }
+ ASMJIT_INLINE_NODEBUG T* end() const noexcept { return (T*)_end; }
template<typename T>
- inline void setEnd(T* end) noexcept { _end = (void*)end; }
+ ASMJIT_INLINE_NODEBUG void setEnd(T* end) noexcept { _end = (void*)end; }
template<typename T>
- inline T* data() const noexcept { return (T*)((uint8_t*)(this) + sizeof(Block)); }
+ ASMJIT_INLINE_NODEBUG const T* data() const noexcept { return (const T*)((const uint8_t*)(this) + sizeof(Block)); }
+ template<typename T>
+ ASMJIT_INLINE_NODEBUG T* data() noexcept { return (T*)((uint8_t*)(this) + sizeof(Block)); }
template<typename T>
- inline bool canPrepend() const noexcept { return _start > data<void>(); }
+ ASMJIT_INLINE_NODEBUG bool canPrepend() const noexcept { return _start > data<void>(); }
template<typename T>
- inline bool canAppend() const noexcept {
+ ASMJIT_INLINE_NODEBUG bool canAppend() const noexcept {
size_t kNumBlockItems = (kBlockSize - sizeof(Block)) / sizeof(T);
size_t kStartBlockIndex = sizeof(Block);
size_t kEndBlockIndex = kStartBlockIndex + kNumBlockItems * sizeof(T);
@@ -83,25 +85,21 @@ public:
//! \{
//! Allocator used to allocate data.
- ZoneAllocator* _allocator;
+ ZoneAllocator* _allocator {};
//! First and last blocks.
- Block* _block[2];
+ Block* _block[2] {};
//! \}
//! \name Construction & Destruction
//! \{
- inline ZoneStackBase() noexcept {
- _allocator = nullptr;
- _block[0] = nullptr;
- _block[1] = nullptr;
- }
- inline ~ZoneStackBase() noexcept { reset(); }
+ ASMJIT_INLINE_NODEBUG ZoneStackBase() noexcept {}
+ ASMJIT_INLINE_NODEBUG ~ZoneStackBase() noexcept { reset(); }
- inline bool isInitialized() const noexcept { return _allocator != nullptr; }
+ ASMJIT_INLINE_NODEBUG bool isInitialized() const noexcept { return _allocator != nullptr; }
ASMJIT_API Error _init(ZoneAllocator* allocator, size_t middleIndex) noexcept;
- inline Error reset() noexcept { return _init(nullptr, 0); }
+ ASMJIT_INLINE_NODEBUG Error reset() noexcept { return _init(nullptr, 0); }
//! \}
@@ -109,7 +107,7 @@ public:
//! \{
//! Returns `ZoneAllocator` attached to this container.
- inline ZoneAllocator* allocator() const noexcept { return _allocator; }
+ ASMJIT_INLINE_NODEBUG ZoneAllocator* allocator() const noexcept { return _allocator; }
inline bool empty() const noexcept {
ASMJIT_ASSERT(isInitialized());
diff --git a/3rdparty/asmjit/src/asmjit/core/zonestring.h b/3rdparty/asmjit/src/asmjit/core/zonestring.h
index 01f5bd89f6a..e62ac50f287 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonestring.h
+++ b/3rdparty/asmjit/src/asmjit/core/zonestring.h
@@ -27,7 +27,7 @@ struct ZoneStringBase {
};
};
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_dummy = nullptr;
_external = nullptr;
}
@@ -83,8 +83,8 @@ public:
//! \name Construction & Destruction
//! \{
- inline ZoneString() noexcept { reset(); }
- inline void reset() noexcept { _base.reset(); }
+ ASMJIT_INLINE_NODEBUG ZoneString() noexcept { reset(); }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _base.reset(); }
//! \}
@@ -92,21 +92,21 @@ public:
//! \{
//! Tests whether the string is empty.
- inline bool empty() const noexcept { return _base._size == 0; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _base._size == 0; }
//! Returns the string data.
- inline const char* data() const noexcept { return _base._size <= kMaxEmbeddedSize ? _base._embedded : _base._external; }
+ ASMJIT_INLINE_NODEBUG const char* data() const noexcept { return _base._size <= kMaxEmbeddedSize ? _base._embedded : _base._external; }
//! Returns the string size.
- inline uint32_t size() const noexcept { return _base._size; }
+ ASMJIT_INLINE_NODEBUG uint32_t size() const noexcept { return _base._size; }
//! Tests whether the string is embedded (e.g. no dynamically allocated).
- inline bool isEmbedded() const noexcept { return _base._size <= kMaxEmbeddedSize; }
+ ASMJIT_INLINE_NODEBUG bool isEmbedded() const noexcept { return _base._size <= kMaxEmbeddedSize; }
//! Copies a new `data` of the given `size` to the string.
//!
//! If the `size` exceeds the internal buffer the given `zone` will be used to duplicate the data, otherwise
//! the internal buffer will be used as a storage.
- inline Error setData(Zone* zone, const char* data, size_t size) noexcept {
+ ASMJIT_INLINE_NODEBUG Error setData(Zone* zone, const char* data, size_t size) noexcept {
return _base.setData(zone, kMaxEmbeddedSize, data, size);
}
diff --git a/3rdparty/asmjit/src/asmjit/core/zonetree.cpp b/3rdparty/asmjit/src/asmjit/core/zonetree.cpp
index 8c42af8c02f..e8a0e111440 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonetree.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/zonetree.cpp
@@ -19,7 +19,7 @@ struct ZoneRBUnit {
typedef ZoneTree<NodeT> Tree;
static void verifyTree(Tree& tree) noexcept {
- EXPECT(checkHeight(static_cast<NodeT*>(tree._root)) > 0);
+ EXPECT_GT(checkHeight(static_cast<NodeT*>(tree._root)), 0);
}
// Check whether the Red-Black tree is valid.
@@ -30,17 +30,16 @@ struct ZoneRBUnit {
NodeT* rn = node->right();
// Invalid tree.
- EXPECT(ln == nullptr || *ln < *node);
- EXPECT(rn == nullptr || *rn > *node);
+ EXPECT_TRUE(ln == nullptr || *ln < *node);
+ EXPECT_TRUE(rn == nullptr || *rn > *node);
// Red violation.
- EXPECT(!node->isRed() ||
- (!ZoneTreeNode::_isValidRed(ln) && !ZoneTreeNode::_isValidRed(rn)));
+ EXPECT_TRUE(!node->isRed() || (!ZoneTreeNode::_isValidRed(ln) && !ZoneTreeNode::_isValidRed(rn)));
// Black violation.
int lh = checkHeight(ln);
int rh = checkHeight(rn);
- EXPECT(!lh || !rh || lh == rh);
+ EXPECT_TRUE(!lh || !rh || lh == rh);
// Only count black links.
return (lh && rh) ? lh + !node->isRed() : 0;
@@ -83,8 +82,8 @@ UNIT(zone_rbtree) {
for (key = 0; key < count; key++) {
node = rbTree.get(key);
- EXPECT(node != nullptr);
- EXPECT(node->_key == key);
+ EXPECT_NOT_NULL(node);
+ EXPECT_EQ(node->_key, key);
}
node = rbTree.get(--count);
@@ -92,7 +91,7 @@ UNIT(zone_rbtree) {
ZoneRBUnit<MyRBNode>::verifyTree(rbTree);
} while (count);
- EXPECT(rbTree.empty());
+ EXPECT_TRUE(rbTree.empty());
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/core/zonetree.h b/3rdparty/asmjit/src/asmjit/core/zonetree.h
index c5dbc78f496..ffeb674cfe2 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonetree.h
+++ b/3rdparty/asmjit/src/asmjit/core/zonetree.h
@@ -35,33 +35,32 @@ public:
//! \name Members
//! \{
- uintptr_t _rbNodeData[2];
+ uintptr_t _rbNodeData[2] {};
//! \}
//! \name Construction & Destruction
//! \{
- inline ZoneTreeNode() noexcept
- : _rbNodeData { 0, 0 } {}
+ ASMJIT_INLINE_NODEBUG ZoneTreeNode() noexcept {}
//! \}
//! \name Accessors
//! \{
- inline bool isRed() const noexcept { return static_cast<bool>(_rbNodeData[0] & kRedMask); }
+ ASMJIT_INLINE_NODEBUG bool isRed() const noexcept { return static_cast<bool>(_rbNodeData[0] & kRedMask); }
- inline bool hasChild(size_t i) const noexcept { return _rbNodeData[i] > kRedMask; }
- inline bool hasLeft() const noexcept { return _rbNodeData[0] > kRedMask; }
- inline bool hasRight() const noexcept { return _rbNodeData[1] != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasChild(size_t i) const noexcept { return _rbNodeData[i] > kRedMask; }
+ ASMJIT_INLINE_NODEBUG bool hasLeft() const noexcept { return _rbNodeData[0] > kRedMask; }
+ ASMJIT_INLINE_NODEBUG bool hasRight() const noexcept { return _rbNodeData[1] != 0; }
template<typename T = ZoneTreeNode>
- inline T* child(size_t i) const noexcept { return static_cast<T*>(_getChild(i)); }
+ ASMJIT_INLINE_NODEBUG T* child(size_t i) const noexcept { return static_cast<T*>(_getChild(i)); }
template<typename T = ZoneTreeNode>
- inline T* left() const noexcept { return static_cast<T*>(_getLeft()); }
+ ASMJIT_INLINE_NODEBUG T* left() const noexcept { return static_cast<T*>(_getLeft()); }
template<typename T = ZoneTreeNode>
- inline T* right() const noexcept { return static_cast<T*>(_getRight()); }
+ ASMJIT_INLINE_NODEBUG T* right() const noexcept { return static_cast<T*>(_getRight()); }
//! \}
@@ -69,19 +68,19 @@ public:
//! \name Internal
//! \{
- inline ZoneTreeNode* _getChild(size_t i) const noexcept { return (ZoneTreeNode*)(_rbNodeData[i] & kPtrMask); }
- inline ZoneTreeNode* _getLeft() const noexcept { return (ZoneTreeNode*)(_rbNodeData[0] & kPtrMask); }
- inline ZoneTreeNode* _getRight() const noexcept { return (ZoneTreeNode*)(_rbNodeData[1]); }
+ ASMJIT_INLINE_NODEBUG ZoneTreeNode* _getChild(size_t i) const noexcept { return (ZoneTreeNode*)(_rbNodeData[i] & kPtrMask); }
+ ASMJIT_INLINE_NODEBUG ZoneTreeNode* _getLeft() const noexcept { return (ZoneTreeNode*)(_rbNodeData[0] & kPtrMask); }
+ ASMJIT_INLINE_NODEBUG ZoneTreeNode* _getRight() const noexcept { return (ZoneTreeNode*)(_rbNodeData[1]); }
- inline void _setChild(size_t i, ZoneTreeNode* node) noexcept { _rbNodeData[i] = (_rbNodeData[i] & kRedMask) | (uintptr_t)node; }
- inline void _setLeft(ZoneTreeNode* node) noexcept { _rbNodeData[0] = (_rbNodeData[0] & kRedMask) | (uintptr_t)node; }
- inline void _setRight(ZoneTreeNode* node) noexcept { _rbNodeData[1] = (uintptr_t)node; }
+ ASMJIT_INLINE_NODEBUG void _setChild(size_t i, ZoneTreeNode* node) noexcept { _rbNodeData[i] = (_rbNodeData[i] & kRedMask) | (uintptr_t)node; }
+ ASMJIT_INLINE_NODEBUG void _setLeft(ZoneTreeNode* node) noexcept { _rbNodeData[0] = (_rbNodeData[0] & kRedMask) | (uintptr_t)node; }
+ ASMJIT_INLINE_NODEBUG void _setRight(ZoneTreeNode* node) noexcept { _rbNodeData[1] = (uintptr_t)node; }
- inline void _makeRed() noexcept { _rbNodeData[0] |= kRedMask; }
- inline void _makeBlack() noexcept { _rbNodeData[0] &= kPtrMask; }
+ ASMJIT_INLINE_NODEBUG void _makeRed() noexcept { _rbNodeData[0] |= kRedMask; }
+ ASMJIT_INLINE_NODEBUG void _makeBlack() noexcept { _rbNodeData[0] &= kPtrMask; }
//! Tests whether the node is RED (RED node must be non-null and must have RED flag set).
- static inline bool _isValidRed(ZoneTreeNode* node) noexcept { return node && node->isRed(); }
+ static ASMJIT_INLINE_NODEBUG bool _isValidRed(ZoneTreeNode* node) noexcept { return node && node->isRed(); }
//! \}
//! \endcond
@@ -96,7 +95,7 @@ public:
//! \name Construction & Destruction
//! \{
- inline ZoneTreeNodeT() noexcept
+ ASMJIT_INLINE_NODEBUG ZoneTreeNodeT() noexcept
: ZoneTreeNode() {}
//! \}
@@ -104,9 +103,9 @@ public:
//! \name Accessors
//! \{
- inline NodeT* child(size_t i) const noexcept { return static_cast<NodeT*>(_getChild(i)); }
- inline NodeT* left() const noexcept { return static_cast<NodeT*>(_getLeft()); }
- inline NodeT* right() const noexcept { return static_cast<NodeT*>(_getRight()); }
+ ASMJIT_INLINE_NODEBUG NodeT* child(size_t i) const noexcept { return static_cast<NodeT*>(_getChild(i)); }
+ ASMJIT_INLINE_NODEBUG NodeT* left() const noexcept { return static_cast<NodeT*>(_getLeft()); }
+ ASMJIT_INLINE_NODEBUG NodeT* right() const noexcept { return static_cast<NodeT*>(_getRight()); }
//! \}
};
@@ -118,33 +117,30 @@ public:
ASMJIT_NONCOPYABLE(ZoneTree)
typedef NodeT Node;
- NodeT* _root;
+ NodeT* _root {};
//! \name Construction & Destruction
//! \{
- inline ZoneTree() noexcept
- : _root(nullptr) {}
-
- inline ZoneTree(ZoneTree&& other) noexcept
+ ASMJIT_INLINE_NODEBUG ZoneTree() noexcept {}
+ ASMJIT_INLINE_NODEBUG ZoneTree(ZoneTree&& other) noexcept
: _root(other._root) {}
-
- inline void reset() noexcept { _root = nullptr; }
+ ASMJIT_INLINE_NODEBUG void reset() noexcept { _root = nullptr; }
//! \}
//! \name Accessors
//! \{
- inline bool empty() const noexcept { return _root == nullptr; }
- inline NodeT* root() const noexcept { return static_cast<NodeT*>(_root); }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _root == nullptr; }
+ ASMJIT_INLINE_NODEBUG NodeT* root() const noexcept { return static_cast<NodeT*>(_root); }
//! \}
//! \name Utilities
//! \{
- inline void swap(ZoneTree& other) noexcept {
+ ASMJIT_INLINE_NODEBUG void swap(ZoneTree& other) noexcept {
std::swap(_root, other._root);
}
diff --git a/3rdparty/asmjit/src/asmjit/core/zonevector.cpp b/3rdparty/asmjit/src/asmjit/core/zonevector.cpp
index dfec5d5f795..b68e25abf65 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonevector.cpp
+++ b/3rdparty/asmjit/src/asmjit/core/zonevector.cpp
@@ -13,8 +13,63 @@ ASMJIT_BEGIN_NAMESPACE
// ZoneVectorBase - Helpers
// ========================
+// ZoneVector is used as an array to hold short-lived data structures used during code generation. The growing
+// strategy is simple - use small capacity at the beginning (very good for ZoneAllocator) and then grow quicker
+// to prevent successive reallocations.
+static ASMJIT_FORCE_INLINE uint32_t ZoneVector_growCapacity(uint32_t current, uint32_t growMinimum, uint32_t sizeOfT) noexcept {
+ static constexpr size_t kGrowThreshold = Globals::kGrowThreshold;
+
+ size_t byteSize = size_t(current) * sizeOfT;
+ size_t minimumByteSize = size_t(growMinimum) * sizeOfT;
+
+ // This is more than exponential growth at the beginning.
+ if (byteSize < 32) {
+ byteSize = 32;
+ }
+ else if (byteSize < 128) {
+ byteSize = 128;
+ }
+ else if (byteSize < 512) {
+ byteSize = 512;
+ }
+
+ if (byteSize < minimumByteSize) {
+ // Exponential growth before we reach `kGrowThreshold`.
+ byteSize = Support::alignUpPowerOf2(minimumByteSize);
+
+ // Bail to `growMinimum` in case of overflow - most likely whatever that is happening afterwards would just fail.
+ if (byteSize < minimumByteSize) {
+ return growMinimum;
+ }
+
+ // Pretty much chunked growth advancing by `kGrowThreshold` after we exceed it.
+ // This should not be a common case, so we don't really have to optimize for it.
+ if (byteSize > kGrowThreshold) {
+ // Align to kGrowThreshold.
+ size_t remainder = minimumByteSize % kGrowThreshold;
+
+ byteSize = minimumByteSize + remainder;
+
+ // Bail to `growMinimum` in case of overflow - should never happen as it's unlikely we would hit this on a 32-bit
+ // machine (consecutive near 4GiB allocation is impossible, and this should never happen on 64-bit machine as we
+ // use 32-bit size & capacity, so overflow of 64 bit integer is not possible. Added just as an extreme measure.
+ if (byteSize < minimumByteSize)
+ return growMinimum;
+ }
+ }
+
+ size_t n = byteSize / sizeOfT;
+ return uint32_t(Support::min<size_t>(n, 0xFFFFFFFFu));
+}
+
+static ASMJIT_FORCE_INLINE bool ZoneVector_byteSizeIsSafe(size_t nBytes, uint32_t n) noexcept {
+ if (sizeof(uint32_t) < sizeof(size_t))
+ return true; // there is no problem when running on a 64-bit machine.
+ else
+ return nBytes >= size_t(n);
+};
+
Error ZoneVectorBase::_grow(ZoneAllocator* allocator, uint32_t sizeOfT, uint32_t n) noexcept {
- uint32_t threshold = Globals::kGrowThreshold / sizeOfT;
uint32_t capacity = _capacity;
uint32_t after = _size;
@@ -25,37 +80,16 @@ Error ZoneVectorBase::_grow(ZoneAllocator* allocator, uint32_t sizeOfT, uint32_t
if (capacity >= after)
return kErrorOk;
- // ZoneVector is used as an array to hold short-lived data structures used
- // during code generation. The growing strategy is simple - use small capacity
- // at the beginning (very good for ZoneAllocator) and then grow quicker to
- // prevent successive reallocations.
- if (capacity < 4)
- capacity = 4;
- else if (capacity < 8)
- capacity = 8;
- else if (capacity < 16)
- capacity = 16;
- else if (capacity < 64)
- capacity = 64;
- else if (capacity < 256)
- capacity = 256;
-
- while (capacity < after) {
- if (capacity < threshold)
- capacity *= 2;
- else
- capacity += threshold;
- }
-
- return _reserve(allocator, sizeOfT, capacity);
+ return _reserve(allocator, sizeOfT, ZoneVector_growCapacity(capacity, after, sizeOfT));
}
Error ZoneVectorBase::_reserve(ZoneAllocator* allocator, uint32_t sizeOfT, uint32_t n) noexcept {
uint32_t oldCapacity = _capacity;
- if (oldCapacity >= n) return kErrorOk;
+ if (oldCapacity >= n)
+ return kErrorOk;
- uint32_t nBytes = n * sizeOfT;
- if (ASMJIT_UNLIKELY(nBytes < n))
+ size_t nBytes = size_t(n) * sizeOfT;
+ if (ASMJIT_UNLIKELY(!ZoneVector_byteSizeIsSafe(nBytes, n)))
return DebugUtils::errored(kErrorOutOfMemory);
size_t allocatedBytes;
@@ -64,20 +98,28 @@ Error ZoneVectorBase::_reserve(ZoneAllocator* allocator, uint32_t sizeOfT, uint3
if (ASMJIT_UNLIKELY(!newData))
return DebugUtils::errored(kErrorOutOfMemory);
+ uint32_t newCapacity = uint32_t(allocatedBytes / sizeOfT);
+ ASMJIT_ASSERT(newCapacity >= n);
+
void* oldData = _data;
- if (_size)
+ if (oldData && _size) {
memcpy(newData, oldData, size_t(_size) * sizeOfT);
-
- if (oldData)
allocator->release(oldData, size_t(oldCapacity) * sizeOfT);
-
- _capacity = uint32_t(allocatedBytes / sizeOfT);
- ASMJIT_ASSERT(_capacity >= n);
+ }
_data = newData;
+ _capacity = newCapacity;
+
return kErrorOk;
}
+Error ZoneVectorBase::_growingReserve(ZoneAllocator* allocator, uint32_t sizeOfT, uint32_t n) noexcept {
+ uint32_t capacity = _capacity;
+ if (capacity >= n)
+ return kErrorOk;
+ return _reserve(allocator, sizeOfT, ZoneVector_growCapacity(capacity, n, sizeOfT));
+}
+
Error ZoneVectorBase::_resize(ZoneAllocator* allocator, uint32_t sizeOfT, uint32_t n) noexcept {
uint32_t size = _size;
@@ -266,34 +308,59 @@ Error ZoneBitVector::_append(ZoneAllocator* allocator, bool value) noexcept {
#if defined(ASMJIT_TEST)
template<typename T>
static void test_zone_vector(ZoneAllocator* allocator, const char* typeName) {
+ constexpr uint32_t kMiB = 1024 * 1024;
+
int i;
int kMax = 100000;
ZoneVector<T> vec;
INFO("ZoneVector<%s> basic tests", typeName);
- EXPECT(vec.append(allocator, 0) == kErrorOk);
- EXPECT(vec.empty() == false);
- EXPECT(vec.size() == 1);
- EXPECT(vec.capacity() >= 1);
- EXPECT(vec.indexOf(0) == 0);
- EXPECT(vec.indexOf(-11) == Globals::kNotFound);
+ EXPECT_EQ(vec.append(allocator, 0), kErrorOk);
+ EXPECT_FALSE(vec.empty());
+ EXPECT_EQ(vec.size(), 1u);
+ EXPECT_GE(vec.capacity(), 1u);
+ EXPECT_EQ(vec.indexOf(0), 0u);
+ EXPECT_EQ(vec.indexOf(-11), Globals::kNotFound);
vec.clear();
- EXPECT(vec.empty());
- EXPECT(vec.size() == 0);
- EXPECT(vec.indexOf(0) == Globals::kNotFound);
+ EXPECT_TRUE(vec.empty());
+ EXPECT_EQ(vec.size(), 0u);
+ EXPECT_EQ(vec.indexOf(0), Globals::kNotFound);
for (i = 0; i < kMax; i++) {
- EXPECT(vec.append(allocator, T(i)) == kErrorOk);
+ EXPECT_EQ(vec.append(allocator, T(i)), kErrorOk);
}
- EXPECT(vec.empty() == false);
- EXPECT(vec.size() == uint32_t(kMax));
- EXPECT(vec.indexOf(T(kMax - 1)) == uint32_t(kMax - 1));
+ EXPECT_FALSE(vec.empty());
+ EXPECT_EQ(vec.size(), uint32_t(kMax));
+ EXPECT_EQ(vec.indexOf(T(0)), uint32_t(0));
+ EXPECT_EQ(vec.indexOf(T(kMax - 1)), uint32_t(kMax - 1));
+
+ EXPECT_EQ(vec.begin()[0], 0);
+ EXPECT_EQ(vec.end()[-1], kMax - 1);
+
+ EXPECT_EQ(vec.rbegin()[0], kMax - 1);
+ EXPECT_EQ(vec.rend()[-1], 0);
- EXPECT(vec.rbegin()[0] == kMax - 1);
+ int64_t fsum = 0;
+ int64_t rsum = 0;
+
+ for (const T& item : vec) {
+ fsum += item;
+ }
+ for (auto it = vec.rbegin(); it != vec.rend(); ++it) {
+ rsum += *it;
+ }
+
+ EXPECT_EQ(fsum, rsum);
vec.release(allocator);
+
+ INFO("ZoneBitVector::growingReserve()");
+ for (uint32_t j = 0; j < 40 / sizeof(T); j += 8) {
+ EXPECT_EQ(vec.growingReserve(allocator, j * kMiB), kErrorOk);
+ EXPECT_GE(vec.capacity(), j * kMiB);
+ }
}
static void test_zone_bitvector(ZoneAllocator* allocator) {
@@ -303,31 +370,31 @@ static void test_zone_bitvector(ZoneAllocator* allocator) {
uint32_t kMaxCount = 100;
ZoneBitVector vec;
- EXPECT(vec.empty());
- EXPECT(vec.size() == 0);
+ EXPECT_TRUE(vec.empty());
+ EXPECT_EQ(vec.size(), 0u);
INFO("ZoneBitVector::resize()");
for (count = 1; count < kMaxCount; count++) {
vec.clear();
- EXPECT(vec.resize(allocator, count, false) == kErrorOk);
- EXPECT(vec.size() == count);
+ EXPECT_EQ(vec.resize(allocator, count, false), kErrorOk);
+ EXPECT_EQ(vec.size(), count);
for (i = 0; i < count; i++)
- EXPECT(vec.bitAt(i) == false);
+ EXPECT_FALSE(vec.bitAt(i));
vec.clear();
- EXPECT(vec.resize(allocator, count, true) == kErrorOk);
- EXPECT(vec.size() == count);
+ EXPECT_EQ(vec.resize(allocator, count, true), kErrorOk);
+ EXPECT_EQ(vec.size(), count);
for (i = 0; i < count; i++)
- EXPECT(vec.bitAt(i) == true);
+ EXPECT_TRUE(vec.bitAt(i));
}
INFO("ZoneBitVector::fillBits() / clearBits()");
for (count = 1; count < kMaxCount; count += 2) {
vec.clear();
- EXPECT(vec.resize(allocator, count) == kErrorOk);
- EXPECT(vec.size() == count);
+ EXPECT_EQ(vec.resize(allocator, count), kErrorOk);
+ EXPECT_EQ(vec.size(), count);
for (i = 0; i < (count + 1) / 2; i++) {
bool value = bool(i & 1);
@@ -338,7 +405,7 @@ static void test_zone_bitvector(ZoneAllocator* allocator) {
}
for (i = 0; i < count; i++) {
- EXPECT(vec.bitAt(i) == bool(i & 1));
+ EXPECT_EQ(vec.bitAt(i), bool(i & 1));
}
}
}
diff --git a/3rdparty/asmjit/src/asmjit/core/zonevector.h b/3rdparty/asmjit/src/asmjit/core/zonevector.h
index 447c08cb921..f38dca583a0 100644
--- a/3rdparty/asmjit/src/asmjit/core/zonevector.h
+++ b/3rdparty/asmjit/src/asmjit/core/zonevector.h
@@ -58,6 +58,7 @@ protected:
ASMJIT_API Error _grow(ZoneAllocator* allocator, uint32_t sizeOfT, uint32_t n) noexcept;
ASMJIT_API Error _resize(ZoneAllocator* allocator, uint32_t sizeOfT, uint32_t n) noexcept;
ASMJIT_API Error _reserve(ZoneAllocator* allocator, uint32_t sizeOfT, uint32_t n) noexcept;
+ ASMJIT_API Error _growingReserve(ZoneAllocator* allocator, uint32_t sizeOfT, uint32_t n) noexcept;
inline void _swap(ZoneVectorBase& other) noexcept {
std::swap(_data, other._data);
@@ -73,11 +74,11 @@ public:
//! \{
//! Tests whether the vector is empty.
- inline bool empty() const noexcept { return _size == 0; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _size == 0; }
//! Returns the vector size.
- inline size_type size() const noexcept { return _size; }
+ ASMJIT_INLINE_NODEBUG size_type size() const noexcept { return _size; }
//! Returns the vector capacity.
- inline size_type capacity() const noexcept { return _capacity; }
+ ASMJIT_INLINE_NODEBUG size_type capacity() const noexcept { return _capacity; }
//! \}
@@ -85,16 +86,16 @@ public:
//! \{
//! Makes the vector empty (won't change the capacity or data pointer).
- inline void clear() noexcept { _size = 0; }
+ ASMJIT_INLINE_NODEBUG void clear() noexcept { _size = 0; }
//! Resets the vector data and set its `size` to zero.
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_data = nullptr;
_size = 0;
_capacity = 0;
}
//! Truncates the vector to at most `n` items.
- inline void truncate(size_type n) noexcept {
+ ASMJIT_INLINE_NODEBUG void truncate(size_type n) noexcept {
_size = Support::min(_size, n);
}
@@ -128,14 +129,14 @@ public:
typedef T* iterator;
typedef const T* const_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef Support::ArrayReverseIterator<T> reverse_iterator;
+ typedef Support::ArrayReverseIterator<const T> const_reverse_iterator;
//! \name Construction & Destruction
//! \{
- inline ZoneVector() noexcept : ZoneVectorBase() {}
- inline ZoneVector(ZoneVector&& other) noexcept : ZoneVector(other) {}
+ ASMJIT_INLINE_NODEBUG ZoneVector() noexcept : ZoneVectorBase() {}
+ ASMJIT_INLINE_NODEBUG ZoneVector(ZoneVector&& other) noexcept : ZoneVector(other) {}
//! \}
@@ -143,9 +144,9 @@ public:
//! \{
//! Returns vector data.
- inline T* data() noexcept { return static_cast<T*>(_data); }
+ ASMJIT_INLINE_NODEBUG T* data() noexcept { return static_cast<T*>(_data); }
//! Returns vector data (const)
- inline const T* data() const noexcept { return static_cast<const T*>(_data); }
+ ASMJIT_INLINE_NODEBUG const T* data() const noexcept { return static_cast<const T*>(_data); }
//! Returns item at the given index `i` (const).
inline const T& at(size_t i) const noexcept {
@@ -163,23 +164,23 @@ public:
//! \name STL Compatibility (Iterators)
//! \{
- inline iterator begin() noexcept { return iterator(data()); };
- inline const_iterator begin() const noexcept { return const_iterator(data()); };
+ ASMJIT_INLINE_NODEBUG iterator begin() noexcept { return iterator(data()); };
+ ASMJIT_INLINE_NODEBUG const_iterator begin() const noexcept { return const_iterator(data()); };
- inline iterator end() noexcept { return iterator(data() + _size); };
- inline const_iterator end() const noexcept { return const_iterator(data() + _size); };
+ ASMJIT_INLINE_NODEBUG iterator end() noexcept { return iterator(data() + _size); };
+ ASMJIT_INLINE_NODEBUG const_iterator end() const noexcept { return const_iterator(data() + _size); };
- inline reverse_iterator rbegin() noexcept { return reverse_iterator(end()); };
- inline const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); };
+ ASMJIT_INLINE_NODEBUG reverse_iterator rbegin() noexcept { return reverse_iterator(end()); };
+ ASMJIT_INLINE_NODEBUG const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); };
- inline reverse_iterator rend() noexcept { return reverse_iterator(begin()); };
- inline const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); };
+ ASMJIT_INLINE_NODEBUG reverse_iterator rend() noexcept { return reverse_iterator(begin()); };
+ ASMJIT_INLINE_NODEBUG const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); };
- inline const_iterator cbegin() const noexcept { return const_iterator(data()); };
- inline const_iterator cend() const noexcept { return const_iterator(data() + _size); };
+ ASMJIT_INLINE_NODEBUG const_iterator cbegin() const noexcept { return const_iterator(data()); };
+ ASMJIT_INLINE_NODEBUG const_iterator cend() const noexcept { return const_iterator(data() + _size); };
- inline const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(cend()); };
- inline const_reverse_iterator crend() const noexcept { return const_reverse_iterator(cbegin()); };
+ ASMJIT_INLINE_NODEBUG const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(cend()); };
+ ASMJIT_INLINE_NODEBUG const_reverse_iterator crend() const noexcept { return const_reverse_iterator(cbegin()); };
//! \}
@@ -194,8 +195,13 @@ public:
if (ASMJIT_UNLIKELY(_size == _capacity))
ASMJIT_PROPAGATE(grow(allocator, 1));
- ::memmove(static_cast<T*>(_data) + 1, _data, size_t(_size) * sizeof(T));
- memcpy(_data, &item, sizeof(T));
+ memmove(static_cast<void*>(static_cast<T*>(_data) + 1),
+ static_cast<const void*>(_data),
+ size_t(_size) * sizeof(T));
+
+ memcpy(static_cast<void*>(_data),
+ static_cast<const void*>(&item),
+ sizeof(T));
_size++;
return kErrorOk;
@@ -209,10 +215,15 @@ public:
ASMJIT_PROPAGATE(grow(allocator, 1));
T* dst = static_cast<T*>(_data) + index;
- ::memmove(dst + 1, dst, size_t(_size - index) * sizeof(T));
- memcpy(dst, &item, sizeof(T));
- _size++;
+ memmove(static_cast<void*>(dst + 1),
+ static_cast<const void*>(dst),
+ size_t(_size - index) * sizeof(T));
+
+ memcpy(static_cast<void*>(dst),
+ static_cast<const void*>(&item),
+ sizeof(T));
+ _size++;
return kErrorOk;
}
@@ -221,9 +232,11 @@ public:
if (ASMJIT_UNLIKELY(_size == _capacity))
ASMJIT_PROPAGATE(grow(allocator, 1));
- memcpy(static_cast<T*>(_data) + _size, &item, sizeof(T));
- _size++;
+ memcpy(static_cast<void*>(static_cast<T*>(_data) + _size),
+ static_cast<const void*>(&item),
+ sizeof(T));
+ _size++;
return kErrorOk;
}
@@ -234,7 +247,9 @@ public:
ASMJIT_PROPAGATE(grow(allocator, size));
if (size) {
- memcpy(static_cast<T*>(_data) + _size, other._data, size_t(size) * sizeof(T));
+ memcpy(static_cast<void*>(static_cast<T*>(_data) + _size),
+ static_cast<const void*>(other._data),
+ size_t(size) * sizeof(T));
_size += size;
}
@@ -249,10 +264,15 @@ public:
ASMJIT_ASSERT(_size < _capacity);
T* data = static_cast<T*>(_data);
- if (_size)
- ::memmove(data + 1, data, size_t(_size) * sizeof(T));
+ if (_size) {
+ memmove(static_cast<void*>(data + 1),
+ static_cast<const void*>(data),
+ size_t(_size) * sizeof(T));
+ }
- memcpy(data, &item, sizeof(T));
+ memcpy(static_cast<void*>(data),
+ static_cast<const void*>(&item),
+ sizeof(T));
_size++;
}
@@ -263,7 +283,9 @@ public:
ASMJIT_FORCE_INLINE void appendUnsafe(const T& item) noexcept {
ASMJIT_ASSERT(_size < _capacity);
- memcpy(static_cast<T*>(_data) + _size, &item, sizeof(T));
+ memcpy(static_cast<void*>(static_cast<T*>(_data) + _size),
+ static_cast<const void*>(&item),
+ sizeof(T));
_size++;
}
@@ -273,17 +295,26 @@ public:
ASMJIT_ASSERT(index <= _size);
T* dst = static_cast<T*>(_data) + index;
- ::memmove(dst + 1, dst, size_t(_size - index) * sizeof(T));
- memcpy(dst, &item, sizeof(T));
+ memmove(static_cast<void*>(dst + 1),
+ static_cast<const void*>(dst),
+ size_t(_size - index) * sizeof(T));
+
+ memcpy(static_cast<void*>(dst),
+ static_cast<const void*>(&item),
+ sizeof(T));
+
_size++;
}
+
//! Concatenates all items of `other` at the end of the vector.
ASMJIT_FORCE_INLINE void concatUnsafe(const ZoneVector<T>& other) noexcept {
uint32_t size = other._size;
ASMJIT_ASSERT(_capacity - _size >= size);
if (size) {
- memcpy(static_cast<T*>(_data) + _size, other._data, size_t(size) * sizeof(T));
+ memcpy(static_cast<void*>(static_cast<T*>(_data) + _size),
+ static_cast<const void*>(other._data),
+ size_t(size) * sizeof(T));
_size += size;
}
}
@@ -311,8 +342,11 @@ public:
T* data = static_cast<T*>(_data) + i;
size_t size = --_size - i;
- if (size)
- ::memmove(data, data + 1, size_t(size) * sizeof(T));
+ if (size) {
+ memmove(static_cast<void*>(data),
+ static_cast<const void*>(data + 1),
+ size_t(size) * sizeof(T));
+ }
}
//! Pops the last element from the vector and returns it.
@@ -344,9 +378,9 @@ public:
//!
//! \note The vector must have at least one element. Attempting to use `first()` on empty vector will trigger
//! an assertion failure in debug builds.
- inline T& first() noexcept { return operator[](0); }
+ ASMJIT_INLINE_NODEBUG T& first() noexcept { return operator[](0); }
//! \overload
- inline const T& first() const noexcept { return operator[](0); }
+ ASMJIT_INLINE_NODEBUG const T& first() const noexcept { return operator[](0); }
//! Returns a reference to the last element of the vector.
//!
@@ -381,7 +415,21 @@ public:
//! Reallocates the internal array to fit at least `n` items.
inline Error reserve(ZoneAllocator* allocator, uint32_t n) noexcept {
- return n > _capacity ? ZoneVectorBase::_reserve(allocator, sizeof(T), n) : Error(kErrorOk);
+ if (ASMJIT_UNLIKELY(n > _capacity))
+ return ZoneVectorBase::_reserve(allocator, sizeof(T), n);
+ else
+ return Error(kErrorOk);
+ }
+
+ //! Reallocates the internal array to fit at least `n` items with growing semantics.
+ //!
+ //! If the vector is smaller than `n` the same growing calculations will be used as if N items were appended
+ //! to an empty vector, which means reserving additional space for more append operations that could follow.
+ inline Error growingReserve(ZoneAllocator* allocator, uint32_t n) noexcept {
+ if (ASMJIT_UNLIKELY(n > _capacity))
+ return ZoneVectorBase::_growingReserve(allocator, sizeof(T), n);
+ else
+ return Error(kErrorOk);
}
inline Error willGrow(ZoneAllocator* allocator, uint32_t n = 1) noexcept {
@@ -423,21 +471,21 @@ public:
//! \name Internal
//! \{
- static inline uint32_t _wordsPerBits(uint32_t nBits) noexcept {
+ static ASMJIT_INLINE_NODEBUG uint32_t _wordsPerBits(uint32_t nBits) noexcept {
return ((nBits + kBitWordSizeInBits - 1) / kBitWordSizeInBits);
}
- static inline void _zeroBits(BitWord* dst, uint32_t nBitWords) noexcept {
+ static ASMJIT_INLINE_NODEBUG void _zeroBits(BitWord* dst, uint32_t nBitWords) noexcept {
for (uint32_t i = 0; i < nBitWords; i++)
dst[i] = 0;
}
- static inline void _fillBits(BitWord* dst, uint32_t nBitWords) noexcept {
+ static ASMJIT_INLINE_NODEBUG void _fillBits(BitWord* dst, uint32_t nBitWords) noexcept {
for (uint32_t i = 0; i < nBitWords; i++)
dst[i] = ~BitWord(0);
}
- static inline void _copyBits(BitWord* dst, const BitWord* src, uint32_t nBitWords) noexcept {
+ static ASMJIT_INLINE_NODEBUG void _copyBits(BitWord* dst, const BitWord* src, uint32_t nBitWords) noexcept {
for (uint32_t i = 0; i < nBitWords; i++)
dst[i] = src[i];
}
@@ -448,9 +496,9 @@ public:
//! \name Construction & Destruction
//! \{
- inline ZoneBitVector() noexcept {}
+ ASMJIT_INLINE_NODEBUG ZoneBitVector() noexcept {}
- inline ZoneBitVector(ZoneBitVector&& other) noexcept
+ ASMJIT_INLINE_NODEBUG ZoneBitVector(ZoneBitVector&& other) noexcept
: _data(other._data),
_size(other._size),
_capacity(other._capacity) {}
@@ -460,8 +508,8 @@ public:
//! \name Overloaded Operators
//! \{
- inline bool operator==(const ZoneBitVector& other) const noexcept { return eq(other); }
- inline bool operator!=(const ZoneBitVector& other) const noexcept { return !eq(other); }
+ ASMJIT_INLINE_NODEBUG bool operator==(const ZoneBitVector& other) const noexcept { return equals(other); }
+ ASMJIT_INLINE_NODEBUG bool operator!=(const ZoneBitVector& other) const noexcept { return !equals(other); }
//! \}
@@ -469,44 +517,44 @@ public:
//! \{
//! Tests whether the bit-vector is empty (has no bits).
- inline bool empty() const noexcept { return _size == 0; }
+ ASMJIT_INLINE_NODEBUG bool empty() const noexcept { return _size == 0; }
//! Returns the size of this bit-vector (in bits).
- inline uint32_t size() const noexcept { return _size; }
+ ASMJIT_INLINE_NODEBUG uint32_t size() const noexcept { return _size; }
//! Returns the capacity of this bit-vector (in bits).
- inline uint32_t capacity() const noexcept { return _capacity; }
+ ASMJIT_INLINE_NODEBUG uint32_t capacity() const noexcept { return _capacity; }
//! Returns the size of the `BitWord[]` array in `BitWord` units.
- inline uint32_t sizeInBitWords() const noexcept { return _wordsPerBits(_size); }
+ ASMJIT_INLINE_NODEBUG uint32_t sizeInBitWords() const noexcept { return _wordsPerBits(_size); }
//! Returns the capacity of the `BitWord[]` array in `BitWord` units.
- inline uint32_t capacityInBitWords() const noexcept { return _wordsPerBits(_capacity); }
+ ASMJIT_INLINE_NODEBUG uint32_t capacityInBitWords() const noexcept { return _wordsPerBits(_capacity); }
- //! REturns bit-vector data as `BitWord[]`.
- inline BitWord* data() noexcept { return _data; }
+ //! Returns bit-vector data as `BitWord[]`.
+ ASMJIT_INLINE_NODEBUG BitWord* data() noexcept { return _data; }
//! \overload
- inline const BitWord* data() const noexcept { return _data; }
+ ASMJIT_INLINE_NODEBUG const BitWord* data() const noexcept { return _data; }
//! \}
//! \name Utilities
//! \{
- inline void swap(ZoneBitVector& other) noexcept {
+ ASMJIT_INLINE_NODEBUG void swap(ZoneBitVector& other) noexcept {
std::swap(_data, other._data);
std::swap(_size, other._size);
std::swap(_capacity, other._capacity);
}
- inline void clear() noexcept {
+ ASMJIT_INLINE_NODEBUG void clear() noexcept {
_size = 0;
}
- inline void reset() noexcept {
+ ASMJIT_INLINE_NODEBUG void reset() noexcept {
_data = nullptr;
_size = 0;
_capacity = 0;
}
- inline void truncate(uint32_t newSize) noexcept {
+ ASMJIT_INLINE_NODEBUG void truncate(uint32_t newSize) noexcept {
_size = Support::min(_size, newSize);
_clearUnusedBits();
}
@@ -628,7 +676,7 @@ public:
_data[idx] &= (BitWord(1) << bit) - 1u;
}
- ASMJIT_FORCE_INLINE bool eq(const ZoneBitVector& other) const noexcept {
+ ASMJIT_FORCE_INLINE bool equals(const ZoneBitVector& other) const noexcept {
if (_size != other._size)
return false;
@@ -642,18 +690,24 @@ public:
return true;
}
+#if !defined(ASMJIT_NO_DEPRECATED)
+ ASMJIT_DEPRECATED("Use ZoneVector::equals() instead")
+ ASMJIT_FORCE_INLINE bool eq(const ZoneBitVector& other) const noexcept { return equals(other); }
+#endif // !ASMJIT_NO_DEPRECATED
+
//! \}
//! \name Memory Management
//! \{
inline void release(ZoneAllocator* allocator) noexcept {
- if (!_data) return;
+ if (!_data)
+ return;
allocator->release(_data, _capacity / 8);
reset();
}
- inline Error resize(ZoneAllocator* allocator, uint32_t newSize, bool newBitsValue = false) noexcept {
+ ASMJIT_INLINE_NODEBUG Error resize(ZoneAllocator* allocator, uint32_t newSize, bool newBitsValue = false) noexcept {
return _resize(allocator, newSize, newSize, newBitsValue);
}
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86assembler.cpp b/3rdparty/asmjit/src/asmjit/x86/x86assembler.cpp
index f11fea00238..35c5502cc66 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86assembler.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86assembler.cpp
@@ -345,6 +345,10 @@ static ASMJIT_FORCE_INLINE uint32_t x86AltOpcodeOf(const InstDB::InstInfo* info)
return InstDB::_altOpcodeTable[info->_altOpcodeIndex];
}
+static ASMJIT_FORCE_INLINE bool x86IsMmxOrXmm(const Reg& reg) noexcept {
+ return reg.type() == RegType::kX86_Mm || reg.type() == RegType::kX86_Xmm;
+}
+
// x86::Assembler - X86BufferWriter
// ================================
@@ -493,11 +497,11 @@ static ASMJIT_FORCE_INLINE uint32_t x86GetMovAbsInstSize64Bit(uint32_t regSize,
static ASMJIT_FORCE_INLINE bool x86ShouldUseMovabs(Assembler* self, X86BufferWriter& writer, uint32_t regSize, InstOptions options, const Mem& rmRel) noexcept {
if (self->is32Bit()) {
// There is no relative addressing, just decide whether to use MOV encoded with MOD R/M or absolute.
- return !Support::test(options, InstOptions::kX86_ModMR | InstOptions::kX86_ModMR);
+ return !Support::test(options, InstOptions::kX86_ModMR | InstOptions::kX86_ModRM);
}
else {
// If the addressing type is REL or MOD R/M was specified then absolute mov won't be used.
- if (rmRel.addrType() == Mem::AddrType::kRel || Support::test(options, InstOptions::kX86_ModMR))
+ if (rmRel.addrType() == Mem::AddrType::kRel || Support::test(options, InstOptions::kX86_ModMR | InstOptions::kX86_ModRM))
return false;
int64_t addrValue = rmRel.offset();
@@ -529,8 +533,6 @@ static ASMJIT_FORCE_INLINE bool x86ShouldUseMovabs(Assembler* self, X86BufferWri
Assembler::Assembler(CodeHolder* code) noexcept : BaseAssembler() {
_archMask = (uint64_t(1) << uint32_t(Arch::kX86)) |
(uint64_t(1) << uint32_t(Arch::kX64)) ;
- assignEmitterFuncs(this);
-
if (code)
code->attach(this);
}
@@ -560,7 +562,7 @@ ASMJIT_FAVOR_SPEED Error Assembler::_emit(InstId instId, const Operand_& o0, con
const Operand_* rmRel; // Memory operand or operand that holds Label|Imm.
uint32_t rmInfo; // Memory operand's info based on x86MemInfo.
- uint32_t rbReg; // Memory base or modRM register.
+ uint32_t rbReg = 0; // Memory base or modRM register.
uint32_t rxReg; // Memory index register.
uint32_t opReg; // ModR/M opcode or register id.
@@ -610,7 +612,7 @@ ASMJIT_FAVOR_SPEED Error Assembler::_emit(InstId instId, const Operand_& o0, con
Operand_ opArray[Globals::kMaxOpCount];
EmitterUtils::opArrayFromEmitArgs(opArray, o0, o1, o2, opExt);
- err = _funcs.validate(arch(), BaseInst(instId, options, _extraReg), opArray, Globals::kMaxOpCount, ValidationFlags::kNone);
+ err = _funcs.validate(BaseInst(instId, options, _extraReg), opArray, Globals::kMaxOpCount, ValidationFlags::kNone);
if (ASMJIT_UNLIKELY(err))
goto Failed;
}
@@ -653,7 +655,6 @@ ASMJIT_FAVOR_SPEED Error Assembler::_emit(InstId instId, const Operand_& o0, con
// This sequence seems to be the fastest.
opcode = InstDB::_mainOpcodeTable[instInfo->_mainOpcodeIndex];
opReg = opcode.extractModO();
- rbReg = 0;
opcode |= instInfo->_mainOpcodeValue;
// Encoding Scope
@@ -740,11 +741,11 @@ ASMJIT_FAVOR_SPEED Error Assembler::_emit(InstId instId, const Operand_& o0, con
case InstDB::kEncodingX86M_NoMemSize:
if (o0.isReg())
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
goto CaseX86M_NoSize;
case InstDB::kEncodingX86M:
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingX86M_NoSize:
@@ -783,20 +784,20 @@ CaseX86M_GPB_MulDiv:
// [?DX:?AX] <- [?DX:?AX] div|mul r16|r32|r64
if (isign3 == ENC_OPS3(Reg, Reg, Reg)) {
- if (ASMJIT_UNLIKELY(o0.size() != o1.size()))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() != o1.x86RmSize()))
goto InvalidInstruction;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rbReg = o2.id();
goto EmitX86R;
}
// [?DX:?AX] <- [?DX:?AX] div|mul m16|m32|m64
if (isign3 == ENC_OPS3(Reg, Reg, Mem)) {
- if (ASMJIT_UNLIKELY(o0.size() != o1.size()))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() != o1.x86RmSize()))
goto InvalidInstruction;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rmRel = &o2;
goto EmitX86M;
}
@@ -808,10 +809,10 @@ CaseX86M_GPB_MulDiv:
case InstDB::kEncodingX86M_GPB:
if (isign3 == ENC_OPS1(Reg)) {
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rbReg = o0.id();
- if (o0.size() != 1)
+ if (o0.x86RmSize() != 1)
goto EmitX86R;
FIXUP_GPB(o0, rbReg);
@@ -819,10 +820,10 @@ CaseX86M_GPB_MulDiv:
}
if (isign3 == ENC_OPS1(Mem)) {
- if (ASMJIT_UNLIKELY(o0.size() == 0))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() == 0))
goto AmbiguousOperandSize;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rmRel = &o0;
goto EmitX86M;
}
@@ -851,20 +852,20 @@ CaseX86M_GPB_MulDiv:
opReg = 0;
if (isign3 == ENC_OPS1(Reg)) {
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
rbReg = o0.id();
goto EmitX86R;
}
if (isign3 == ENC_OPS1(Mem)) {
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
rmRel = &o0;
goto EmitX86M;
}
// Two operand NOP instruction "0F 1F /r".
opReg = o1.id();
- opcode.addPrefixBySize(o1.size());
+ opcode.addPrefixBySize(o1.x86RmSize());
if (isign3 == ENC_OPS2(Reg, Reg)) {
rbReg = o0.id();
@@ -911,7 +912,7 @@ CaseX86M_GPB_MulDiv:
break;
case InstDB::kEncodingX86Rm:
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingX86Rm_NoSize:
@@ -934,10 +935,10 @@ CaseX86M_GPB_MulDiv:
opReg = o0.id();
rbReg = o1.id();
- if (o0.size() == 2)
+ if (o0.x86RmSize() == 2)
writer.emit8(0x66);
else
- opcode.addWBySize(o0.size());
+ opcode.addWBySize(o0.x86RmSize());
goto EmitX86R;
}
@@ -945,16 +946,16 @@ CaseX86M_GPB_MulDiv:
opReg = o0.id();
rmRel = &o1;
- if (o0.size() == 2)
+ if (o0.x86RmSize() == 2)
writer.emit8(0x66);
else
- opcode.addWBySize(o0.size());
+ opcode.addWBySize(o0.x86RmSize());
goto EmitX86M;
}
break;
case InstDB::kEncodingX86Mr:
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingX86Mr_NoSize:
@@ -973,15 +974,15 @@ CaseX86M_GPB_MulDiv:
case InstDB::kEncodingX86Arith:
if (isign3 == ENC_OPS2(Reg, Reg)) {
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
- if (o0.size() != o1.size())
+ if (o0.x86RmSize() != o1.x86RmSize())
goto OperandSizeMismatch;
rbReg = o0.id();
opReg = o1.id();
- if (o0.size() == 1) {
+ if (o0.x86RmSize() == 1) {
FIXUP_GPB(o0, rbReg);
FIXUP_GPB(o1, opReg);
}
@@ -991,19 +992,19 @@ CaseX86M_GPB_MulDiv:
goto EmitX86R;
// MOD/RM: Alternative encoding selected via instruction options.
- opcode += 2;
+ opcode += 2u;
std::swap(opReg, rbReg);
goto EmitX86R;
}
if (isign3 == ENC_OPS2(Reg, Mem)) {
- opcode += 2;
- opcode.addArithBySize(o0.size());
+ opcode += 2u;
+ opcode.addArithBySize(o0.x86RmSize());
opReg = o0.id();
rmRel = &o1;
- if (o0.size() != 1)
+ if (o0.x86RmSize() != 1)
goto EmitX86M;
FIXUP_GPB(o0, opReg);
@@ -1011,11 +1012,11 @@ CaseX86M_GPB_MulDiv:
}
if (isign3 == ENC_OPS2(Mem, Reg)) {
- opcode.addArithBySize(o1.size());
+ opcode.addArithBySize(o1.x86RmSize());
opReg = o1.id();
rmRel = &o0;
- if (o1.size() != 1)
+ if (o1.x86RmSize() != 1)
goto EmitX86M;
FIXUP_GPB(o1, opReg);
@@ -1026,7 +1027,7 @@ CaseX86M_GPB_MulDiv:
opcode = 0x80;
if (isign3 == ENC_OPS2(Reg, Imm)) {
- uint32_t size = o0.size();
+ uint32_t size = o0.x86RmSize();
rbReg = o0.id();
immValue = o1.as<Imm>().value();
@@ -1075,12 +1076,12 @@ CaseX86M_GPB_MulDiv:
goto EmitX86Op;
}
- opcode += size != 1 ? (immSize != 1 ? 1 : 3) : 0;
+ opcode += size != 1 ? (immSize != 1 ? 1u : 3u) : 0u;
goto EmitX86R;
}
if (isign3 == ENC_OPS2(Mem, Imm)) {
- uint32_t memSize = o0.size();
+ uint32_t memSize = o0.x86RmSize();
if (ASMJIT_UNLIKELY(memSize == 0))
goto AmbiguousOperandSize;
@@ -1095,7 +1096,7 @@ CaseX86M_GPB_MulDiv:
if (Support::isInt8(immValue) && !Support::test(options, InstOptions::kLongForm))
immSize = 1;
- opcode += memSize != 1 ? (immSize != 1 ? 1 : 3) : 0;
+ opcode += memSize != 1 ? (immSize != 1 ? 1u : 3u) : 0u;
opcode.addPrefixBySize(memSize);
rmRel = &o0;
@@ -1105,25 +1106,25 @@ CaseX86M_GPB_MulDiv:
case InstDB::kEncodingX86Bswap:
if (isign3 == ENC_OPS1(Reg)) {
- if (ASMJIT_UNLIKELY(o0.size() == 1))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() == 1))
goto InvalidInstruction;
opReg = o0.id();
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
goto EmitX86OpReg;
}
break;
case InstDB::kEncodingX86Bt:
if (isign3 == ENC_OPS2(Reg, Reg)) {
- opcode.addPrefixBySize(o1.size());
+ opcode.addPrefixBySize(o1.x86RmSize());
opReg = o1.id();
rbReg = o0.id();
goto EmitX86R;
}
if (isign3 == ENC_OPS2(Mem, Reg)) {
- opcode.addPrefixBySize(o1.size());
+ opcode.addPrefixBySize(o1.x86RmSize());
opReg = o1.id();
rmRel = &o0;
goto EmitX86M;
@@ -1134,7 +1135,7 @@ CaseX86M_GPB_MulDiv:
immSize = 1;
opcode = x86AltOpcodeOf(instInfo);
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
opReg = opcode.extractModO();
if (isign3 == ENC_OPS2(Reg, Imm)) {
@@ -1143,7 +1144,7 @@ CaseX86M_GPB_MulDiv:
}
if (isign3 == ENC_OPS2(Mem, Imm)) {
- if (ASMJIT_UNLIKELY(o0.size() == 0))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() == 0))
goto AmbiguousOperandSize;
rmRel = &o0;
@@ -1176,14 +1177,14 @@ CaseX86M_GPB_MulDiv:
}
if (isign3 == ENC_OPS2(Reg, Reg)) {
- if (o0.size() != o1.size())
+ if (o0.x86RmSize() != o1.x86RmSize())
goto OperandSizeMismatch;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rbReg = o0.id();
opReg = o1.id();
- if (o0.size() != 1)
+ if (o0.x86RmSize() != 1)
goto EmitX86R;
FIXUP_GPB(o0, rbReg);
@@ -1192,11 +1193,11 @@ CaseX86M_GPB_MulDiv:
}
if (isign3 == ENC_OPS2(Mem, Reg)) {
- opcode.addArithBySize(o1.size());
+ opcode.addArithBySize(o1.x86RmSize());
opReg = o1.id();
rmRel = &o0;
- if (o1.size() != 1)
+ if (o1.x86RmSize() != 1)
goto EmitX86M;
FIXUP_GPB(o1, opReg);
@@ -1225,18 +1226,18 @@ CaseX86M_GPB_MulDiv:
case InstDB::kEncodingX86Crc:
opReg = o0.id();
- opcode.addWBySize(o0.size());
+ opcode.addWBySize(o0.x86RmSize());
if (isign3 == ENC_OPS2(Reg, Reg)) {
rbReg = o1.id();
- if (o1.size() == 1) {
+ if (o1.x86RmSize() == 1) {
FIXUP_GPB(o1, rbReg);
goto EmitX86R;
}
else {
// This seems to be the only exception of encoding '66F2' prefix.
- if (o1.size() == 2) writer.emit8(0x66);
+ if (o1.x86RmSize() == 2) writer.emit8(0x66);
opcode.add(1);
goto EmitX86R;
@@ -1245,13 +1246,13 @@ CaseX86M_GPB_MulDiv:
if (isign3 == ENC_OPS2(Reg, Mem)) {
rmRel = &o1;
- if (o1.size() == 0)
+ if (o1.x86RmSize() == 0)
goto AmbiguousOperandSize;
// This seems to be the only exception of encoding '66F2' prefix.
- if (o1.size() == 2) writer.emit8(0x66);
+ if (o1.x86RmSize() == 2) writer.emit8(0x66);
- opcode += o1.size() != 1;
+ opcode += uint32_t(o1.x86RmSize() != 1u);
goto EmitX86M;
}
break;
@@ -1271,14 +1272,14 @@ CaseX86M_GPB_MulDiv:
// First process all forms distinct of `kEncodingX86M_OptB_MulDiv`.
if (isign3 == ENC_OPS3(Reg, Reg, Imm)) {
opcode = 0x6B;
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
immValue = o2.as<Imm>().value();
immSize = 1;
if (!Support::isInt8(immValue) || Support::test(options, InstOptions::kLongForm)) {
opcode -= 2;
- immSize = o0.size() == 2 ? 2 : 4;
+ immSize = o0.x86RmSize() == 2 ? 2 : 4;
}
opReg = o0.id();
@@ -1289,18 +1290,18 @@ CaseX86M_GPB_MulDiv:
if (isign3 == ENC_OPS3(Reg, Mem, Imm)) {
opcode = 0x6B;
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
immValue = o2.as<Imm>().value();
immSize = 1;
// Sign extend so isInt8 returns the right result.
- if (o0.size() == 4)
+ if (o0.x86RmSize() == 4)
immValue = x86SignExtendI32<int64_t>(immValue);
if (!Support::isInt8(immValue) || Support::test(options, InstOptions::kLongForm)) {
opcode -= 2;
- immSize = o0.size() == 2 ? 2 : 4;
+ immSize = o0.x86RmSize() == 2 ? 2 : 4;
}
opReg = o0.id();
@@ -1311,48 +1312,48 @@ CaseX86M_GPB_MulDiv:
if (isign3 == ENC_OPS2(Reg, Reg)) {
// Must be explicit 'ax, r8' form.
- if (o1.size() == 1)
+ if (o1.x86RmSize() == 1)
goto CaseX86M_GPB_MulDiv;
- if (o0.size() != o1.size())
+ if (o0.x86RmSize() != o1.x86RmSize())
goto OperandSizeMismatch;
opReg = o0.id();
rbReg = o1.id();
opcode = Opcode::k000F00 | 0xAF;
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
goto EmitX86R;
}
if (isign3 == ENC_OPS2(Reg, Mem)) {
// Must be explicit 'ax, m8' form.
- if (o1.size() == 1)
+ if (o1.x86RmSize() == 1)
goto CaseX86M_GPB_MulDiv;
opReg = o0.id();
rmRel = &o1;
opcode = Opcode::k000F00 | 0xAF;
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
goto EmitX86M;
}
// Shorthand to imul 'reg, reg, imm'.
if (isign3 == ENC_OPS2(Reg, Imm)) {
opcode = 0x6B;
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
immValue = o1.as<Imm>().value();
immSize = 1;
// Sign extend so isInt8 returns the right result.
- if (o0.size() == 4)
+ if (o0.x86RmSize() == 4)
immValue = x86SignExtendI32<int64_t>(immValue);
if (!Support::isInt8(immValue) || Support::test(options, InstOptions::kLongForm)) {
opcode -= 2;
- immSize = o0.size() == 2 ? 2 : 4;
+ immSize = o0.x86RmSize() == 2 ? 2 : 4;
}
opReg = rbReg = o0.id();
@@ -1370,8 +1371,8 @@ CaseX86M_GPB_MulDiv:
immValue = o1.as<Imm>().valueAs<uint8_t>();
immSize = 1;
- opcode = x86AltOpcodeOf(instInfo) + (o0.size() != 1);
- opcode.add66hBySize(o0.size());
+ opcode = x86AltOpcodeOf(instInfo) + (o0.x86RmSize() != 1);
+ opcode.add66hBySize(o0.x86RmSize());
goto EmitX86Op;
}
@@ -1379,8 +1380,8 @@ CaseX86M_GPB_MulDiv:
if (ASMJIT_UNLIKELY(o0.id() != Gp::kIdAx || o1.id() != Gp::kIdDx))
goto InvalidInstruction;
- opcode += o0.size() != 1;
- opcode.add66hBySize(o0.size());
+ opcode += uint32_t(o0.x86RmSize() != 1u);
+ opcode.add66hBySize(o0.x86RmSize());
goto EmitX86Op;
}
break;
@@ -1390,12 +1391,12 @@ CaseX86M_GPB_MulDiv:
if (ASMJIT_UNLIKELY(!x86IsImplicitMem(o0, Gp::kIdDi) || o1.id() != Gp::kIdDx))
goto InvalidInstruction;
- uint32_t size = o0.size();
+ uint32_t size = o0.x86RmSize();
if (ASMJIT_UNLIKELY(size == 0))
goto AmbiguousOperandSize;
rmRel = &o0;
- opcode += (size != 1);
+ opcode += uint32_t(size != 1u);
opcode.add66hBySize(size);
goto EmitX86OpImplicitMem;
@@ -1406,7 +1407,7 @@ CaseX86M_GPB_MulDiv:
if (isign3 == ENC_OPS1(Reg)) {
rbReg = o0.id();
- if (o0.size() == 1) {
+ if (o0.x86RmSize() == 1) {
FIXUP_GPB(o0, rbReg);
goto EmitX86R;
}
@@ -1414,19 +1415,19 @@ CaseX86M_GPB_MulDiv:
if (is32Bit()) {
// INC r16|r32 is only encodable in 32-bit mode (collides with REX).
opcode = x86AltOpcodeOf(instInfo) + (rbReg & 0x07);
- opcode.add66hBySize(o0.size());
+ opcode.add66hBySize(o0.x86RmSize());
goto EmitX86Op;
}
else {
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
goto EmitX86R;
}
}
if (isign3 == ENC_OPS1(Mem)) {
- if (!o0.size())
+ if (!o0.x86RmSize())
goto AmbiguousOperandSize;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rmRel = &o0;
goto EmitX86M;
}
@@ -1457,7 +1458,7 @@ CaseX86M_GPB_MulDiv:
if (ASMJIT_UNLIKELY(!Reg::isGp(o0, Gp::kIdCx)))
goto InvalidInstruction;
- writer.emitAddressOverride((is32Bit() && o0.size() == 2) || (is64Bit() && o0.size() == 4));
+ writer.emitAddressOverride((is32Bit() && o0.x86RmSize() == 2) || (is64Bit() && o0.x86RmSize() == 4));
rmRel = &o1;
}
@@ -1487,7 +1488,7 @@ CaseX86M_GPB_MulDiv:
case InstDB::kEncodingX86LcallLjmp:
if (isign3 == ENC_OPS1(Mem)) {
rmRel = &o0;
- uint32_t mSize = rmRel->size();
+ uint32_t mSize = rmRel->as<Mem>().size();
if (mSize == 0) {
mSize = registerSize();
}
@@ -1519,7 +1520,7 @@ CaseX86M_GPB_MulDiv:
case InstDB::kEncodingX86Lea:
if (isign3 == ENC_OPS2(Reg, Mem)) {
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
opReg = o0.id();
rmRel = &o1;
goto EmitX86M;
@@ -1540,8 +1541,8 @@ CaseX86M_GPB_MulDiv:
// GP <- GP
if (Reg::isGp(o1)) {
- uint32_t opSize = o0.size();
- if (opSize != o1.size())
+ uint32_t opSize = o0.x86RmSize();
+ if (opSize != o1.x86RmSize())
goto InvalidInstruction;
if (opSize == 1) {
@@ -1552,7 +1553,7 @@ CaseX86M_GPB_MulDiv:
if (!Support::test(options, InstOptions::kX86_ModRM))
goto EmitX86R;
- opcode += 2;
+ opcode += 2u;
std::swap(opReg, rbReg);
goto EmitX86R;
}
@@ -1563,7 +1564,7 @@ CaseX86M_GPB_MulDiv:
if (!Support::test(options, InstOptions::kX86_ModRM))
goto EmitX86R;
- opcode += 2;
+ opcode += 2u;
std::swap(opReg, rbReg);
goto EmitX86R;
}
@@ -1572,7 +1573,7 @@ CaseX86M_GPB_MulDiv:
// GP <- SReg
if (Reg::isSReg(o1)) {
opcode = 0x8C;
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
opReg--;
goto EmitX86R;
}
@@ -1606,7 +1607,7 @@ CaseX86M_GPB_MulDiv:
// SReg <- GP
if (Reg::isSReg(o0)) {
opcode = 0x8E;
- opcode.addPrefixBySize(o1.size());
+ opcode.addPrefixBySize(o1.x86RmSize());
opReg--;
goto EmitX86R;
}
@@ -1640,28 +1641,28 @@ CaseX86M_GPB_MulDiv:
// SReg <- Mem
if (Reg::isSReg(o0)) {
opcode = 0x8E;
- opcode.addPrefixBySize(o1.size());
+ opcode.addPrefixBySize(o1.x86RmSize());
opReg--;
goto EmitX86M;
}
// Reg <- Mem
else {
opcode = 0;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
// Handle a special form of `mov al|ax|eax|rax, [ptr64]` that doesn't use MOD.
if (opReg == Gp::kIdAx && !rmRel->as<Mem>().hasBaseOrIndex()) {
- if (x86ShouldUseMovabs(this, writer, o0.size(), options, rmRel->as<Mem>())) {
- opcode += 0xA0;
+ if (x86ShouldUseMovabs(this, writer, o0.x86RmSize(), options, rmRel->as<Mem>())) {
+ opcode += 0xA0u;
immValue = rmRel->as<Mem>().offset();
goto EmitX86OpMovAbs;
}
}
- if (o0.size() == 1)
+ if (o0.x86RmSize() == 1)
FIXUP_GPB(o0, opReg);
- opcode += 0x8A;
+ opcode += 0x8Au;
goto EmitX86M;
}
}
@@ -1673,35 +1674,35 @@ CaseX86M_GPB_MulDiv:
// Mem <- SReg
if (Reg::isSReg(o1)) {
opcode = 0x8C;
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
opReg--;
goto EmitX86M;
}
// Mem <- Reg
else {
opcode = 0;
- opcode.addArithBySize(o1.size());
+ opcode.addArithBySize(o1.x86RmSize());
// Handle a special form of `mov [ptr64], al|ax|eax|rax` that doesn't use MOD.
if (opReg == Gp::kIdAx && !rmRel->as<Mem>().hasBaseOrIndex()) {
- if (x86ShouldUseMovabs(this, writer, o1.size(), options, rmRel->as<Mem>())) {
- opcode += 0xA2;
+ if (x86ShouldUseMovabs(this, writer, o1.x86RmSize(), options, rmRel->as<Mem>())) {
+ opcode += 0xA2u;
immValue = rmRel->as<Mem>().offset();
goto EmitX86OpMovAbs;
}
}
- if (o1.size() == 1)
+ if (o1.x86RmSize() == 1)
FIXUP_GPB(o1, opReg);
- opcode += 0x88;
+ opcode += 0x88u;
goto EmitX86M;
}
}
if (isign3 == ENC_OPS2(Reg, Imm)) {
opReg = o0.id();
- immSize = FastUInt8(o0.size());
+ immSize = FastUInt8(o0.x86RmSize());
if (immSize == 1) {
FIXUP_GPB(o0, opReg);
@@ -1739,7 +1740,7 @@ CaseX86M_GPB_MulDiv:
}
if (isign3 == ENC_OPS2(Mem, Imm)) {
- uint32_t memSize = o0.size();
+ uint32_t memSize = o0.x86RmSize();
if (ASMJIT_UNLIKELY(memSize == 0))
goto AmbiguousOperandSize;
@@ -1761,7 +1762,7 @@ CaseX86M_GPB_MulDiv:
rmRel = &o1;
opcode = 0xA0;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
if (ASMJIT_UNLIKELY(!o0.as<Reg>().isGp()) || opReg != Gp::kIdAx)
goto InvalidInstruction;
@@ -1782,7 +1783,7 @@ CaseX86M_GPB_MulDiv:
rmRel = &o0;
opcode = 0xA2;
- opcode.addArithBySize(o1.size());
+ opcode.addArithBySize(o1.x86RmSize());
if (ASMJIT_UNLIKELY(!o1.as<Reg>().isGp()) || opReg != Gp::kIdAx)
goto InvalidInstruction;
@@ -1811,14 +1812,14 @@ CaseX86M_GPB_MulDiv:
break;
case InstDB::kEncodingX86MovsxMovzx:
- opcode.add(o1.size() != 1);
- opcode.addPrefixBySize(o0.size());
+ opcode.add(o1.x86RmSize() != 1);
+ opcode.addPrefixBySize(o0.x86RmSize());
if (isign3 == ENC_OPS2(Reg, Reg)) {
opReg = o0.id();
rbReg = o1.id();
- if (o1.size() != 1)
+ if (o1.x86RmSize() != 1)
goto EmitX86R;
FIXUP_GPB(o1, rbReg);
@@ -1864,8 +1865,8 @@ CaseX86M_GPB_MulDiv:
if (ASMJIT_UNLIKELY(o1.id() != Gp::kIdAx))
goto InvalidInstruction;
- opcode = x86AltOpcodeOf(instInfo) + (o1.size() != 1);
- opcode.add66hBySize(o1.size());
+ opcode = x86AltOpcodeOf(instInfo) + (o1.x86RmSize() != 1);
+ opcode.add66hBySize(o1.x86RmSize());
immValue = o0.as<Imm>().valueAs<uint8_t>();
immSize = 1;
@@ -1876,8 +1877,8 @@ CaseX86M_GPB_MulDiv:
if (ASMJIT_UNLIKELY(o0.id() != Gp::kIdDx || o1.id() != Gp::kIdAx))
goto InvalidInstruction;
- opcode.add(o1.size() != 1);
- opcode.add66hBySize(o1.size());
+ opcode.add(o1.x86RmSize() != 1);
+ opcode.add66hBySize(o1.x86RmSize());
goto EmitX86Op;
}
break;
@@ -1887,7 +1888,7 @@ CaseX86M_GPB_MulDiv:
if (ASMJIT_UNLIKELY(o0.id() != Gp::kIdDx || !x86IsImplicitMem(o1, Gp::kIdSi)))
goto InvalidInstruction;
- uint32_t size = o1.size();
+ uint32_t size = o1.x86RmSize();
if (ASMJIT_UNLIKELY(size == 0))
goto AmbiguousOperandSize;
@@ -1939,24 +1940,24 @@ CaseX86M_GPB_MulDiv:
CaseX86PushPop_Gp:
// We allow 2 byte, 4 byte, and 8 byte register sizes, although PUSH and POP only allow 2 bytes or
// native size. On 64-bit we simply PUSH/POP 64-bit register even if 32-bit register was given.
- if (ASMJIT_UNLIKELY(o0.size() < 2))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() < 2))
goto InvalidInstruction;
opcode = x86AltOpcodeOf(instInfo);
- opcode.add66hBySize(o0.size());
+ opcode.add66hBySize(o0.x86RmSize());
opReg = o0.id();
goto EmitX86OpReg;
}
}
if (isign3 == ENC_OPS1(Mem)) {
- if (ASMJIT_UNLIKELY(o0.size() == 0))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() == 0))
goto AmbiguousOperandSize;
- if (ASMJIT_UNLIKELY(o0.size() != 2 && o0.size() != registerSize()))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() != 2 && o0.x86RmSize() != registerSize()))
goto InvalidInstruction;
- opcode.add66hBySize(o0.size());
+ opcode.add66hBySize(o0.x86RmSize());
rmRel = &o0;
goto EmitX86M;
}
@@ -1985,17 +1986,17 @@ CaseX86PushPop_Gp:
case InstDB::kEncodingX86Rot:
if (o0.isReg()) {
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rbReg = o0.id();
- if (o0.size() == 1)
+ if (o0.x86RmSize() == 1)
FIXUP_GPB(o0, rbReg);
if (isign3 == ENC_OPS2(Reg, Reg)) {
if (ASMJIT_UNLIKELY(o1.id() != Gp::kIdCx))
goto InvalidInstruction;
- opcode += 2;
+ opcode += 2u;
goto EmitX86R;
}
@@ -2012,15 +2013,15 @@ CaseX86PushPop_Gp:
}
}
else {
- if (ASMJIT_UNLIKELY(o0.size() == 0))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() == 0))
goto AmbiguousOperandSize;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
if (isign3 == ENC_OPS2(Mem, Reg)) {
if (ASMJIT_UNLIKELY(o1.id() != Gp::kIdCx))
goto InvalidInstruction;
- opcode += 2;
+ opcode += 2u;
rmRel = &o0;
goto EmitX86M;
}
@@ -2055,7 +2056,7 @@ CaseX86PushPop_Gp:
case InstDB::kEncodingX86ShldShrd:
if (isign3 == ENC_OPS3(Reg, Reg, Imm)) {
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
opReg = o1.id();
rbReg = o0.id();
@@ -2065,7 +2066,7 @@ CaseX86PushPop_Gp:
}
if (isign3 == ENC_OPS3(Mem, Reg, Imm)) {
- opcode.addPrefixBySize(o1.size());
+ opcode.addPrefixBySize(o1.x86RmSize());
opReg = o1.id();
rmRel = &o0;
@@ -2081,7 +2082,7 @@ CaseX86PushPop_Gp:
if (ASMJIT_UNLIKELY(o2.id() != Gp::kIdCx))
goto InvalidInstruction;
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
opReg = o1.id();
rbReg = o0.id();
goto EmitX86R;
@@ -2091,7 +2092,7 @@ CaseX86PushPop_Gp:
if (ASMJIT_UNLIKELY(o2.id() != Gp::kIdCx))
goto InvalidInstruction;
- opcode.addPrefixBySize(o1.size());
+ opcode.addPrefixBySize(o1.x86RmSize());
opReg = o1.id();
rmRel = &o0;
goto EmitX86M;
@@ -2104,8 +2105,8 @@ CaseX86PushPop_Gp:
if (ASMJIT_UNLIKELY(rmRel->as<Mem>().offsetLo32() || !Reg::isGp(o0.as<Reg>(), Gp::kIdAx)))
goto InvalidInstruction;
- uint32_t size = o0.size();
- if (o1.hasSize() && ASMJIT_UNLIKELY(o1.size() != size))
+ uint32_t size = o0.x86RmSize();
+ if (o1.x86RmSize() != 0u && ASMJIT_UNLIKELY(o1.x86RmSize() != size))
goto OperandSizeMismatch;
opcode.addArithBySize(size);
@@ -2119,8 +2120,8 @@ CaseX86PushPop_Gp:
if (ASMJIT_UNLIKELY(rmRel->as<Mem>().offsetLo32() || !Reg::isGp(o1.as<Reg>(), Gp::kIdAx)))
goto InvalidInstruction;
- uint32_t size = o1.size();
- if (o0.hasSize() && ASMJIT_UNLIKELY(o0.size() != size))
+ uint32_t size = o1.x86RmSize();
+ if (o0.x86RmSize() != 0u && ASMJIT_UNLIKELY(o0.x86RmSize() != size))
goto OperandSizeMismatch;
opcode.addArithBySize(size);
@@ -2138,11 +2139,11 @@ CaseX86PushPop_Gp:
if (ASMJIT_UNLIKELY(o0.as<Mem>().hasOffset()))
goto InvalidInstruction;
- uint32_t size = o1.size();
+ uint32_t size = o1.x86RmSize();
if (ASMJIT_UNLIKELY(size == 0))
goto AmbiguousOperandSize;
- if (ASMJIT_UNLIKELY(o0.size() != size))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() != size))
goto OperandSizeMismatch;
opcode.addArithBySize(size);
@@ -2152,14 +2153,14 @@ CaseX86PushPop_Gp:
case InstDB::kEncodingX86Test:
if (isign3 == ENC_OPS2(Reg, Reg)) {
- if (o0.size() != o1.size())
+ if (o0.x86RmSize() != o1.x86RmSize())
goto OperandSizeMismatch;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rbReg = o0.id();
opReg = o1.id();
- if (o0.size() != 1)
+ if (o0.x86RmSize() != 1)
goto EmitX86R;
FIXUP_GPB(o0, rbReg);
@@ -2168,11 +2169,11 @@ CaseX86PushPop_Gp:
}
if (isign3 == ENC_OPS2(Mem, Reg)) {
- opcode.addArithBySize(o1.size());
+ opcode.addArithBySize(o1.x86RmSize());
opReg = o1.id();
rmRel = &o0;
- if (o1.size() != 1)
+ if (o1.x86RmSize() != 1)
goto EmitX86M;
FIXUP_GPB(o1, opReg);
@@ -2184,23 +2185,23 @@ CaseX86PushPop_Gp:
opReg = opcode.extractModO();
if (isign3 == ENC_OPS2(Reg, Imm)) {
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rbReg = o0.id();
- if (o0.size() == 1) {
+ if (o0.x86RmSize() == 1) {
FIXUP_GPB(o0, rbReg);
immValue = o1.as<Imm>().valueAs<uint8_t>();
immSize = 1;
}
else {
immValue = o1.as<Imm>().value();
- immSize = FastUInt8(Support::min<uint32_t>(o0.size(), 4));
+ immSize = FastUInt8(Support::min<uint32_t>(o0.x86RmSize(), 4));
}
// Short form - AL, AX, EAX, RAX.
if (rbReg == 0 && !Support::test(options, InstOptions::kLongForm)) {
opcode &= Opcode::kPP_66 | Opcode::kW;
- opcode |= 0xA8 + (o0.size() != 1);
+ opcode |= 0xA8 + (o0.x86RmSize() != 1);
goto EmitX86Op;
}
@@ -2208,25 +2209,25 @@ CaseX86PushPop_Gp:
}
if (isign3 == ENC_OPS2(Mem, Imm)) {
- if (ASMJIT_UNLIKELY(o0.size() == 0))
+ if (ASMJIT_UNLIKELY(o0.x86RmSize() == 0))
goto AmbiguousOperandSize;
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
rmRel = &o0;
immValue = o1.as<Imm>().value();
- immSize = FastUInt8(Support::min<uint32_t>(o0.size(), 4));
+ immSize = FastUInt8(Support::min<uint32_t>(o0.x86RmSize(), 4));
goto EmitX86M;
}
break;
case InstDB::kEncodingX86Xchg:
if (isign3 == ENC_OPS2(Reg, Mem)) {
- opcode.addArithBySize(o0.size());
+ opcode.addArithBySize(o0.x86RmSize());
opReg = o0.id();
rmRel = &o1;
- if (o0.size() != 1)
+ if (o0.x86RmSize() != 1)
goto EmitX86M;
FIXUP_GPB(o0, opReg);
@@ -2239,8 +2240,8 @@ CaseX86PushPop_Gp:
rbReg = o0.id();
opReg = o1.id();
- uint32_t opSize = o0.size();
- if (opSize != o1.size())
+ uint32_t opSize = o0.x86RmSize();
+ if (opSize != o1.x86RmSize())
goto OperandSizeMismatch;
if (opSize == 1) {
@@ -2259,7 +2260,7 @@ CaseX86PushPop_Gp:
goto EmitX86OpReg;
}
else {
- // Encode 'xchg eax, eax' by by using a generic path.
+ // Encode 'xchg eax, eax' by using a generic path.
}
}
else if (!Support::test(options, InstOptions::kLongForm)) {
@@ -2278,11 +2279,11 @@ CaseX86PushPop_Gp:
}
if (isign3 == ENC_OPS2(Mem, Reg)) {
- opcode.addArithBySize(o1.size());
+ opcode.addArithBySize(o1.x86RmSize());
opReg = o1.id();
rmRel = &o0;
- if (o1.size() == 1) {
+ if (o1.x86RmSize() == 1) {
FIXUP_GPB(o1, opReg);
}
@@ -2356,7 +2357,7 @@ CaseFpuArith_Reg:
if (isign3 == ENC_OPS1(Mem)) {
CaseFpuArith_Mem:
// 0xD8/0xDC, depends on the size of the memory operand; opReg is valid.
- opcode = (o0.size() == 4) ? 0xD8 : 0xDC;
+ opcode = (o0.x86RmSize() == 4) ? 0xD8 : 0xDC;
// Clear compressed displacement before going to EmitX86M.
opcode &= ~uint32_t(Opcode::kCDSHL_Mask);
@@ -2385,16 +2386,16 @@ CaseFpuArith_Mem:
if (isign3 == ENC_OPS1(Mem)) {
rmRel = &o0;
- if (o0.size() == 4 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM32)) {
+ if (o0.x86RmSize() == 4 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM32)) {
goto EmitX86M;
}
- if (o0.size() == 8 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM64)) {
- opcode += 4;
+ if (o0.x86RmSize() == 8 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM64)) {
+ opcode += 4u;
goto EmitX86M;
}
- if (o0.size() == 10 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM80)) {
+ if (o0.x86RmSize() == 10 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM80)) {
opcode = x86AltOpcodeOf(instInfo);
opReg = opcode.extractModO();
goto EmitX86M;
@@ -2414,16 +2415,16 @@ CaseFpuArith_Mem:
opcode &= ~uint32_t(Opcode::kCDSHL_Mask);
rmRel = &o0;
- if (o0.size() == 2 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM16)) {
- opcode += 4;
+ if (o0.x86RmSize() == 2 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM16)) {
+ opcode += 4u;
goto EmitX86M;
}
- if (o0.size() == 4 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM32)) {
+ if (o0.x86RmSize() == 4 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM32)) {
goto EmitX86M;
}
- if (o0.size() == 8 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM64)) {
+ if (o0.x86RmSize() == 8 && commonInfo->hasFlag(InstDB::InstFlags::kFpuM64)) {
opcode = x86AltOpcodeOf(instInfo) & ~uint32_t(Opcode::kCDSHL_Mask);
opReg = opcode.extractModO();
goto EmitX86M;
@@ -2433,7 +2434,7 @@ CaseFpuArith_Mem:
case InstDB::kEncodingFpuRDef:
if (isign3 == 0) {
- opcode += 1;
+ opcode += 1u;
goto EmitFpuOp;
}
ASMJIT_FALLTHROUGH;
@@ -2550,10 +2551,10 @@ CaseFpuArith_Mem:
case InstDB::kEncodingExtMovbe:
if (isign3 == ENC_OPS2(Reg, Mem)) {
- if (o0.size() == 1)
+ if (o0.x86RmSize() == 1)
goto InvalidInstruction;
- opcode.addPrefixBySize(o0.size());
+ opcode.addPrefixBySize(o0.x86RmSize());
opReg = o0.id();
rmRel = &o1;
goto EmitX86M;
@@ -2563,10 +2564,10 @@ CaseFpuArith_Mem:
opcode = x86AltOpcodeOf(instInfo);
if (isign3 == ENC_OPS2(Mem, Reg)) {
- if (o1.size() == 1)
+ if (o1.x86RmSize() == 1)
goto InvalidInstruction;
- opcode.addPrefixBySize(o1.size());
+ opcode.addPrefixBySize(o1.x86RmSize());
opReg = o1.id();
rmRel = &o0;
goto EmitX86M;
@@ -2575,37 +2576,41 @@ CaseFpuArith_Mem:
case InstDB::kEncodingExtMovd:
CaseExtMovd:
- opReg = o0.id();
- opcode.add66hIf(Reg::isXmm(o0));
+ if (x86IsMmxOrXmm(o0.as<Reg>())) {
+ opReg = o0.id();
+ opcode.add66hIf(Reg::isXmm(o0));
- // MM/XMM <- Gp
- if (isign3 == ENC_OPS2(Reg, Reg) && Reg::isGp(o1)) {
- rbReg = o1.id();
- goto EmitX86R;
- }
+ // MM/XMM <- Gp
+ if (isign3 == ENC_OPS2(Reg, Reg) && Reg::isGp(o1)) {
+ rbReg = o1.id();
+ goto EmitX86R;
+ }
- // MM/XMM <- Mem
- if (isign3 == ENC_OPS2(Reg, Mem)) {
- rmRel = &o1;
- goto EmitX86M;
+ // MM/XMM <- Mem
+ if (isign3 == ENC_OPS2(Reg, Mem)) {
+ rmRel = &o1;
+ goto EmitX86M;
+ }
}
// The following instructions use the secondary opcode.
- opcode &= Opcode::kW;
- opcode |= x86AltOpcodeOf(instInfo);
- opReg = o1.id();
- opcode.add66hIf(Reg::isXmm(o1));
+ if (x86IsMmxOrXmm(o1.as<Reg>())) {
+ opcode &= Opcode::kW;
+ opcode |= x86AltOpcodeOf(instInfo);
+ opReg = o1.id();
+ opcode.add66hIf(Reg::isXmm(o1));
- // GP <- MM/XMM
- if (isign3 == ENC_OPS2(Reg, Reg) && Reg::isGp(o0)) {
- rbReg = o0.id();
- goto EmitX86R;
- }
+ // GP <- MM/XMM
+ if (isign3 == ENC_OPS2(Reg, Reg) && Reg::isGp(o0)) {
+ rbReg = o0.id();
+ goto EmitX86R;
+ }
- // Mem <- MM/XMM
- if (isign3 == ENC_OPS2(Mem, Reg)) {
- rmRel = &o0;
- goto EmitX86M;
+ // Mem <- MM/XMM
+ if (isign3 == ENC_OPS2(Mem, Reg)) {
+ rmRel = &o0;
+ goto EmitX86M;
+ }
}
break;
@@ -2621,7 +2626,7 @@ CaseExtMovd:
if (!Support::test(options, InstOptions::kX86_ModMR))
goto EmitX86R;
- opcode += 0x10;
+ opcode += 0x10u;
std::swap(opReg, rbReg);
goto EmitX86R;
}
@@ -2692,7 +2697,7 @@ CaseExtMovd:
goto CaseExtRm;
case InstDB::kEncodingExtRm_Wx:
- opcode.addWIf(o1.size() == 8);
+ opcode.addWIf(o1.x86RmSize() == 8);
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingExtRm_Wx_GpqOnly:
@@ -2716,7 +2721,7 @@ CaseExtRm:
case InstDB::kEncodingExtRm_P:
if (isign3 == ENC_OPS2(Reg, Reg)) {
- opcode.add66hIf(Reg::isXmm(o0) | Reg::isXmm(o1));
+ opcode.add66hIf(unsigned(Reg::isXmm(o0)) | unsigned(Reg::isXmm(o1)));
opReg = o0.id();
rbReg = o1.id();
@@ -2760,7 +2765,7 @@ CaseExtRm:
case InstDB::kEncodingExtRmRi_P:
if (isign3 == ENC_OPS2(Reg, Reg)) {
- opcode.add66hIf(Reg::isXmm(o0) | Reg::isXmm(o1));
+ opcode.add66hIf(unsigned(Reg::isXmm(o0)) | unsigned(Reg::isXmm(o1)));
opReg = o0.id();
rbReg = o1.id();
@@ -2812,7 +2817,7 @@ CaseExtRm:
immSize = 1;
if (isign3 == ENC_OPS3(Reg, Reg, Imm)) {
- opcode.add66hIf(Reg::isXmm(o0) | Reg::isXmm(o1));
+ opcode.add66hIf(unsigned(Reg::isXmm(o0)) | unsigned(Reg::isXmm(o1)));
opReg = o0.id();
rbReg = o1.id();
@@ -2970,7 +2975,7 @@ CaseExtRm:
break;
case InstDB::kEncodingVexMr_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
if (isign3 == ENC_OPS2(Reg, Reg)) {
opReg = o1.id();
@@ -2987,7 +2992,7 @@ CaseExtRm:
case InstDB::kEncodingVexMr_VM:
if (isign3 == ENC_OPS2(Mem, Reg)) {
- opcode |= Support::max(x86OpcodeLByVMem(o0), x86OpcodeLBySize(o1.size()));
+ opcode |= Support::max(x86OpcodeLByVMem(o0), x86OpcodeLBySize(o1.x86RmSize()));
opReg = o1.id();
rmRel = &o0;
@@ -3010,8 +3015,17 @@ CaseExtRm:
goto CaseVexMri;
+ case InstDB::kEncodingVexMvr_Wx:
+ if (isign3 == ENC_OPS3(Mem, Reg, Reg)) {
+ opcode.addWIf(unsigned(Reg::isGpq(o1)));
+ opReg = x86PackRegAndVvvvv(o1.id(), o2.id());
+ rmRel = &o0;
+ goto EmitVexEvexM;
+ }
+ break;
+
case InstDB::kEncodingVexMri_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexMri:
@@ -3040,19 +3054,19 @@ CaseVexMri:
goto CaseVexRm;
case InstDB::kEncodingVexRm_Wx:
- opcode.addWIf(Reg::isGpq(o0) | Reg::isGpq(o1));
+ opcode.addWIf(unsigned(Reg::isGpq(o0)) | unsigned(Reg::isGpq(o1)));
goto CaseVexRm;
case InstDB::kEncodingVexRm_Lx_Narrow:
- if (o1.size())
- opcode |= x86OpcodeLBySize(o1.size());
- else if (o0.size() == 32)
+ if (o1.x86RmSize())
+ opcode |= x86OpcodeLBySize(o1.x86RmSize());
+ else if (o0.x86RmSize() == 32)
opcode |= Opcode::kLL_2;
goto CaseVexRm;
case InstDB::kEncodingVexRm_Lx_Bcst:
if (isign3 == ENC_OPS2(Reg, Reg) && Reg::isGp(o1.as<Reg>())) {
- opcode = x86AltOpcodeOf(instInfo) | x86OpcodeLBySize(o0.size() | o1.size());
+ opcode = x86AltOpcodeOf(instInfo) | x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
opReg = o0.id();
rbReg = o1.id();
goto EmitVexEvexR;
@@ -3060,7 +3074,7 @@ CaseVexMri:
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRm_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRm:
@@ -3080,7 +3094,7 @@ CaseVexRm:
case InstDB::kEncodingVexRm_VM:
if (isign3 == ENC_OPS2(Reg, Mem)) {
- opcode |= Support::max(x86OpcodeLByVMem(o1), x86OpcodeLBySize(o0.size()));
+ opcode |= Support::max(x86OpcodeLByVMem(o1), x86OpcodeLBySize(o0.x86RmSize()));
opReg = o0.id();
rmRel = &o1;
goto EmitVexEvexM;
@@ -3110,11 +3124,11 @@ CaseVexRm:
}
case InstDB::kEncodingVexRmi_Wx:
- opcode.addWIf(Reg::isGpq(o0) | Reg::isGpq(o1));
+ opcode.addWIf(unsigned(Reg::isGpq(o0)) | unsigned(Reg::isGpq(o1)));
goto CaseVexRmi;
case InstDB::kEncodingVexRmi_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRmi:
@@ -3159,7 +3173,7 @@ CaseVexRvm_R:
}
case InstDB::kEncodingVexRvm_Wx: {
- opcode.addWIf(Reg::isGpq(o0) | (o2.size() == 8));
+ opcode.addWIf(unsigned(Reg::isGpq(o0)) | unsigned((o2.x86RmSize() == 8)));
goto CaseVexRvm;
}
@@ -3169,7 +3183,7 @@ CaseVexRvm_R:
}
case InstDB::kEncodingVexRvm_Lx: {
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
goto CaseVexRvm;
}
@@ -3183,7 +3197,7 @@ CaseVexRvm_R:
const Operand_& o3 = opExt[EmitterUtils::kOp3];
- opcode |= x86OpcodeLBySize(o2.size());
+ opcode |= x86OpcodeLBySize(o2.x86RmSize());
opReg = x86PackRegAndVvvvv(o0.id(), o2.id());
if (o3.isReg()) {
@@ -3200,7 +3214,7 @@ CaseVexRvm_R:
}
case InstDB::kEncodingVexRvmr_Lx: {
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
}
@@ -3234,7 +3248,7 @@ CaseVexRvm_R:
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRvmi_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRvmi:
@@ -3261,7 +3275,7 @@ VexRvmi:
}
case InstDB::kEncodingVexRmv_Wx:
- opcode.addWIf(Reg::isGpq(o0) | Reg::isGpq(o2));
+ opcode.addWIf(unsigned(Reg::isGpq(o0)) | unsigned(Reg::isGpq(o2)));
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRmv:
@@ -3281,7 +3295,7 @@ VexRvmi:
case InstDB::kEncodingVexRmvRm_VM:
if (isign3 == ENC_OPS2(Reg, Mem)) {
opcode = x86AltOpcodeOf(instInfo);
- opcode |= Support::max(x86OpcodeLByVMem(o1), x86OpcodeLBySize(o0.size()));
+ opcode |= Support::max(x86OpcodeLByVMem(o1), x86OpcodeLBySize(o0.x86RmSize()));
opReg = o0.id();
rmRel = &o1;
@@ -3291,7 +3305,7 @@ VexRvmi:
case InstDB::kEncodingVexRmv_VM:
if (isign3 == ENC_OPS3(Reg, Mem, Reg)) {
- opcode |= Support::max(x86OpcodeLByVMem(o1), x86OpcodeLBySize(o0.size() | o2.size()));
+ opcode |= Support::max(x86OpcodeLByVMem(o1), x86OpcodeLBySize(o0.x86RmSize() | o2.x86RmSize()));
opReg = x86PackRegAndVvvvv(o0.id(), o2.id());
rmRel = &o1;
@@ -3325,14 +3339,14 @@ VexRvmi:
if (isign3 == ENC_OPS2(Reg, Reg)) {
if (Reg::isGp(o0)) {
opcode = x86AltOpcodeOf(instInfo);
- opcode.addWBySize(o0.size());
+ opcode.addWBySize(o0.x86RmSize());
opReg = o1.id();
rbReg = o0.id();
goto EmitVexEvexR;
}
if (Reg::isGp(o1)) {
- opcode.addWBySize(o1.size());
+ opcode.addWBySize(o1.x86RmSize());
opReg = o0.id();
rbReg = o1.id();
goto EmitVexEvexR;
@@ -3376,7 +3390,7 @@ VexRvmi:
break;
case InstDB::kEncodingVexRmMr_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRmMr:
@@ -3432,7 +3446,7 @@ VexRvmi:
break;
case InstDB::kEncodingVexRvmRmi_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRvmRmi:
@@ -3544,7 +3558,7 @@ VexRvmi:
break;
case InstDB::kEncodingVexRvmMvr_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRvmMvr:
@@ -3576,7 +3590,7 @@ VexRvmi:
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRvmVmi_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRvmVmi:
@@ -3614,7 +3628,7 @@ VexRvmi:
break;
case InstDB::kEncodingVexVm_Wx:
- opcode.addWIf(Reg::isGpq(o0) | Reg::isGpq(o1));
+ opcode.addWIf(unsigned(Reg::isGpq(o0)) | unsigned(Reg::isGpq(o1)));
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexVm:
@@ -3637,7 +3651,7 @@ VexRvmi:
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexVmi_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexVmi:
@@ -3659,13 +3673,13 @@ CaseVexVmi_AfterImm:
break;
case InstDB::kEncodingVexVmi4_Wx:
- opcode.addWIf(Reg::isGpq(o0) || o1.size() == 8);
+ opcode.addWIf(Reg::isGpq(o0) || o1.x86RmSize() == 8);
immValue = o2.as<Imm>().value();
immSize = 4;
goto CaseVexVmi_AfterImm;
case InstDB::kEncodingVexRvrmRvmr_Lx:
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingVexRvrmRvmr: {
@@ -3710,7 +3724,7 @@ CaseVexVmi_AfterImm:
goto InvalidInstruction;
const uint32_t isign4 = isign3 + (uint32_t(o3.opType()) << 9);
- opcode |= x86OpcodeLBySize(o0.size() | o1.size() | o2.size() | o3.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize() | o2.x86RmSize() | o3.x86RmSize());
immValue = o4.as<Imm>().valueAs<uint8_t>() & 0x0F;
immSize = 1;
@@ -3766,7 +3780,7 @@ CaseVexVmi_AfterImm:
case InstDB::kEncodingFma4_Lx:
// It's fine to just check the first operand, second is just for sanity.
- opcode |= x86OpcodeLBySize(o0.size() | o1.size());
+ opcode |= x86OpcodeLBySize(o0.x86RmSize() | o1.x86RmSize());
ASMJIT_FALLTHROUGH;
case InstDB::kEncodingFma4: {
@@ -4274,7 +4288,7 @@ EmitModSib_LabelRip_X86:
}
else {
// Non-bound label or label bound to a different section.
- relOffset = -4 - immSize;
+ relOffset = -4 - int32_t(immSize);
relSize = 4;
goto EmitRel;
}
@@ -4950,10 +4964,7 @@ EmitDone:
#endif
}
- resetExtraReg();
- resetInstOptions();
- resetInlineComment();
-
+ resetState();
writer.done(this);
return kErrorOk;
@@ -4987,9 +4998,7 @@ Failed:
#ifndef ASMJIT_NO_LOGGING
return EmitterUtils::logInstructionFailed(this, err, instId, options, o0, o1, o2, opExt);
#else
- resetExtraReg();
- resetInstOptions();
- resetInlineComment();
+ resetState();
return reportError(err);
#endif
}
@@ -5085,6 +5094,9 @@ Error Assembler::onAttach(CodeHolder* code) noexcept {
Arch arch = code->arch();
ASMJIT_PROPAGATE(Base::onAttach(code));
+ _instructionAlignment = uint8_t(1);
+ assignEmitterFuncs(this);
+
if (Environment::is32Bit(arch)) {
// 32 bit architecture - X86.
_forcedInstOptions |= InstOptions::kX86_InvalidRex;
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86assembler.h b/3rdparty/asmjit/src/asmjit/x86/x86assembler.h
index dbffae62895..dd980a72692 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86assembler.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86assembler.h
@@ -38,13 +38,14 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! JitRuntime rt; // Create a runtime specialized for JIT.
//! CodeHolder code; // Create a CodeHolder.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
//! x86::Assembler a(&code); // Create and attach x86::Assembler to code.
//!
//! // Decide between 32-bit CDECL, WIN64, and SysV64 calling conventions:
//! // 32-BIT - passed all arguments by stack.
//! // WIN64 - passes first 4 arguments by RCX, RDX, R8, and R9.
-//! // UNIX64 - passes first 6 arguments by RDI, RSI, RCX, RDX, R8, and R9.
+//! // UNIX64 - passes first 6 arguments by RDI, RSI, RDX, RCX, R8, and R9.
//! x86::Gp arr, cnt;
//! x86::Gp sum = x86::eax; // Use EAX as 'sum' as it's a return register.
//!
@@ -100,7 +101,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//!
//! The example should be self-explanatory. It shows how to work with labels, how to use operands, and how to emit
//! instructions that can use different registers based on runtime selection. It implements 32-bit CDECL, WIN64,
-//! and SysV64 caling conventions and will work on most X86/X64 environments.
+//! and SysV64 calling conventions and will work on most X86/X64 environments.
//!
//! Although functions prologs / epilogs can be implemented manually, AsmJit provides utilities that can be used
//! to create function prologs and epilogs automatically, see \ref asmjit_function for more details.
@@ -131,7 +132,8 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! JitRuntime rt; // Create a runtime specialized for JIT.
//! CodeHolder code; // Create a CodeHolder.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
//! x86::Assembler a(&code); // Create and attach x86::Assembler to code.
//!
//! // Enable strict validation.
@@ -149,7 +151,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! printf("Status: %s\n", DebugUtils::errorAsString(err));
//!
//! // Ambiguous operand size - the pointer requires size.
-//! err = a.inc(x86::ptr(x86::rax), 1);
+//! err = a.inc(x86::ptr(x86::rax));
//! printf("Status: %s\n", DebugUtils::errorAsString(err));
//!
//! return 0;
@@ -187,7 +189,8 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! JitRuntime rt; // Create a runtime specialized for JIT.
//! CodeHolder code; // Create a CodeHolder.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
//! x86::Assembler a(&code); // Create and attach x86::Assembler to code.
//!
//! // Let's get these registers from x86::Assembler.
@@ -227,6 +230,9 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! targets easily. If you want to create a register of native size dynamically by specifying its id it's also possible:
//!
//! ```
+//! #include <asmjit/x86.h>
+//! using namespace asmjit;
+//!
//! void example(x86::Assembler& a) {
//! x86::Gp zax = a.gpz(x86::Gp::kIdAx);
//! x86::Gp zbx = a.gpz(x86::Gp::kIdBx);
@@ -281,21 +287,21 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! #include <asmjit/x86.h>
//! using namespace asmjit;
//!
-//! void embedData(x86::Assembler& a, const Label& L_Data) {
+//! void processData(x86::Assembler& a, const Label& L_Data) {
//! x86::Gp addr = a.zax(); // EAX or RAX.
//! x86::Gp val = x86::edi; // Where to store some value...
//!
//! // Approach 1 - Load the address to register through LEA. This approach
//! // is flexible as the address can be then manipulated, for
//! // example if you have a data array, which would need index.
-//! a.lea(addr, L_Data); // Loads the address of the label to EAX or RAX.
-//! a.mov(val, dword_ptr(addr));
+//! a.lea(addr, x86::ptr(L_Data));
+//! a.mov(val, x86::dword_ptr(addr));
//!
//! // Approach 2 - Load the data directly by using L_Data in address. It's
//! // worth noting that this doesn't work with indexes in X64
//! // mode. It will use absolute address in 32-bit mode and
//! // relative address (RIP) in 64-bit mode.
-//! a.mov(val, dword_ptr(L_Data));
+//! a.mov(val, x86::dword_ptr(L_Data));
//! }
//! ```
//!
@@ -346,7 +352,8 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! JitRuntime rt; // Create JIT Runtime.
//! CodeHolder code; // Create a CodeHolder.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
//! x86::Assembler a(&code); // Create and attach x86::Assembler to code.
//!
//! // Decide which registers will be mapped to function arguments. Try changing
@@ -356,18 +363,19 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! x86::Gp src_a = a.zcx();
//! x86::Gp src_b = a.zdx();
//!
-//! X86::Xmm vec0 = x86::xmm0;
-//! X86::Xmm vec1 = x86::xmm1;
+//! x86::Xmm vec0 = x86::xmm0;
+//! x86::Xmm vec1 = x86::xmm1;
//!
//! // Create/initialize FuncDetail and FuncFrame.
//! FuncDetail func;
-//! func.init(FuncSignatureT<void, int*, const int*, const int*>(CallConvId::kHost));
+//! func.init(FuncSignature::build<void, int*, const int*, const int*>(),
+//! rt.environment());
//!
//! FuncFrame frame;
//! frame.init(func);
//!
//! // Make XMM0 and XMM1 dirty - RegGroup::kVec describes XMM|YMM|ZMM registers.
-//! frame.setDirtyRegs(RegGroup::kVec, IntUtils::mask(0, 1));
+//! frame.setDirtyRegs(RegGroup::kVec, Support::bitMask(0, 1));
//!
//! // Alternatively, if you don't want to use register masks you can pass BaseReg
//! // to addDirtyRegs(). The following code would add both xmm0 and xmm1.
@@ -375,7 +383,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//!
//! FuncArgsAssignment args(&func); // Create arguments assignment context.
//! args.assignAll(dst, src_a, src_b);// Assign our registers to arguments.
-//! args.updateFrameInfo(frame); // Reflect our args in FuncFrame.
+//! args.updateFuncFrame(frame); // Reflect our args in FuncFrame.
//! frame.finalize(); // Finalize the FuncFrame (updates it).
//!
//! a.emitProlog(frame); // Emit function prolog.
@@ -453,7 +461,8 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! JitRuntime rt; // Create a runtime specialized for JIT.
//! CodeHolder code; // Create a CodeHolder.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
//! x86::Assembler a(&code); // Create and attach x86::Assembler to code.
//!
//! // Let's get these registers from x86::Assembler.
@@ -532,16 +541,16 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//!
//! void prefixesExample(x86::Assembler& a) {
//! // Lock prefix for implementing atomics:
-//! // lock add dword ptr [dst], 1
-//! a.lock().add(x86::dword_ptr(dst), 1);
+//! // lock add dword ptr [rdi], 1
+//! a.lock().add(x86::dword_ptr(x86::rdi), 1);
//!
//! // Similarly, XAcquire/XRelease prefixes are also available:
-//! // xacquire add dword ptr [dst], 1
-//! a.xacquire().add(x86::dword_ptr(dst), 1);
+//! // xacquire add dword ptr [rdi], 1
+//! a.xacquire().add(x86::dword_ptr(x86::rdi), 1);
//!
//! // Rep prefix (see also repe/repz and repne/repnz):
-//! // rep movs byte ptr [dst], byte ptr [src]
-//! a.rep().movs(x86::byte_ptr(dst), x86::byte_ptr(src));
+//! // rep movs byte ptr [rdi], byte ptr [rsi]
+//! a.rep().movs(x86::byte_ptr(x86::rdi), x86::byte_ptr(x86::rsi));
//!
//! // Forcing REX prefix in 64-bit mode.
//! // rex mov eax, 1
@@ -605,12 +614,12 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! // -----------------
//! //
//! // - Broadcast data is part of memory operand.
-//! // - Use x86::Mem::_1toN(), which returns a new x86::Mem operand.
+//! // - Use x86::Mem::_1to2(), x86::Mem::_1to4(), etc..., which returns a new x86::Mem operand with broadcast.
//!
//! // vaddpd zmm0 {k1} {z}, zmm1, [rcx] {1to8}
-//! a.k(k1).z().vaddpd(zmm0, zmm1, x86::mem(rcx)._1to8());
+//! a.k(k1).z().vaddpd(zmm0, zmm1, x86::ptr(rcx)._1to8());
//!
-//! // Embedded Rounding & Suppress-All-Exceptoins
+//! // Embedded Rounding & Suppress-All-Exceptions
//! // -------------------------------------------
//! //
//! // - Rounding mode and {sae} are part of instruction options.
@@ -637,7 +646,7 @@ public:
//! \{
ASMJIT_API explicit Assembler(CodeHolder* code = nullptr) noexcept;
- ASMJIT_API virtual ~Assembler() noexcept;
+ ASMJIT_API ~Assembler() noexcept override;
//! \}
@@ -648,12 +657,13 @@ public:
// NOTE: x86::Assembler uses _privateData to store 'address-override' bit that is used to decide whether to emit
// address-override (67H) prefix based on the memory BASE+INDEX registers. It's either `kX86MemInfo_67H_X86` or
// `kX86MemInfo_67H_X64`.
- inline uint32_t _addressOverrideMask() const noexcept { return _privateData; }
- inline void _setAddressOverrideMask(uint32_t m) noexcept { _privateData = m; }
+ ASMJIT_INLINE_NODEBUG uint32_t _addressOverrideMask() const noexcept { return _privateData; }
+ ASMJIT_INLINE_NODEBUG void _setAddressOverrideMask(uint32_t m) noexcept { _privateData = m; }
//! \}
//! \endcond
+ //! \cond INTERNAL
//! \name Emit
//! \{
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86builder.cpp b/3rdparty/asmjit/src/asmjit/x86/x86builder.cpp
index a27948b65d4..9f025a15bc0 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86builder.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86builder.cpp
@@ -18,8 +18,6 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
Builder::Builder(CodeHolder* code) noexcept : BaseBuilder() {
_archMask = (uint64_t(1) << uint32_t(Arch::kX86)) |
(uint64_t(1) << uint32_t(Arch::kX64)) ;
- assignEmitterFuncs(this);
-
if (code)
code->attach(this);
}
@@ -29,7 +27,12 @@ Builder::~Builder() noexcept {}
// =====================
Error Builder::onAttach(CodeHolder* code) noexcept {
- return Base::onAttach(code);
+ ASMJIT_PROPAGATE(Base::onAttach(code));
+
+ _instructionAlignment = uint8_t(1);
+ assignEmitterFuncs(this);
+
+ return kErrorOk;
}
Error Builder::onDetach(CodeHolder* code) noexcept {
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86builder.h b/3rdparty/asmjit/src/asmjit/x86/x86builder.h
index f3bb11a0ca2..194c1402f11 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86builder.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86builder.h
@@ -36,7 +36,9 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! // Small helper function to print the current content of `cb`.
//! static void dumpCode(BaseBuilder& builder, const char* phase) {
//! String sb;
-//! builder.dump(sb);
+//! formatOptions formatOptions {};
+//!
+//! Formatter::formatNodeList(sb, formatOptions, &builder);
//! printf("%s:\n%s\n", phase, sb.data());
//! }
//!
@@ -44,7 +46,8 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! JitRuntime rt; // Create JIT Runtime.
//! CodeHolder code; // Create a CodeHolder.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
//! x86::Builder cb(&code); // Create and attach x86::Builder to `code`.
//!
//! // Decide which registers will be mapped to function arguments. Try changing registers
@@ -58,7 +61,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//!
//! // Create and initialize `FuncDetail`.
//! FuncDetail func;
-//! func.init(FuncSignatureT<void, int*, const int*, const int*>(CallConvId::kHost));
+//! func.init(FuncSignature::build<void, int*, const int*, const int*>());
//!
//! // Remember prolog insertion point.
//! BaseNode* prologInsertionPoint = cb.cursor();
@@ -323,7 +326,7 @@ public:
//! \{
ASMJIT_API explicit Builder(CodeHolder* code = nullptr) noexcept;
- ASMJIT_API virtual ~Builder() noexcept;
+ ASMJIT_API ~Builder() noexcept override;
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86compiler.cpp b/3rdparty/asmjit/src/asmjit/x86/x86compiler.cpp
index 04d09807076..830600edabc 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86compiler.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86compiler.cpp
@@ -19,8 +19,6 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
Compiler::Compiler(CodeHolder* code) noexcept : BaseCompiler() {
_archMask = (uint64_t(1) << uint32_t(Arch::kX86)) |
(uint64_t(1) << uint32_t(Arch::kX64)) ;
- assignEmitterFuncs(this);
-
if (code)
code->attach(this);
}
@@ -38,6 +36,9 @@ Error Compiler::onAttach(CodeHolder* code) noexcept {
return err;
}
+ _instructionAlignment = uint8_t(1);
+ assignEmitterFuncs(this);
+
return kErrorOk;
}
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86compiler.h b/3rdparty/asmjit/src/asmjit/x86/x86compiler.h
index d89aea02519..b281e208879 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86compiler.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86compiler.h
@@ -35,31 +35,32 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! typedef int (*Func)(void);
//!
//! int main() {
-//! JitRuntime rt; // Runtime specialized for JIT code execution.
-//! CodeHolder code; // Holds code and relocation information.
+//! JitRuntime rt; // Runtime specialized for JIT code execution.
+//! CodeHolder code; // Holds code and relocation information.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
-//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
+//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
//!
-//! cc.addFunc(FuncSignatureT<int>());// Begin a function of `int fn(void)` signature.
+//! cc.addFunc(FuncSignature::build<int>()); // Begin a function of `int fn(void)` signature.
//!
-//! x86::Gp vReg = cc.newGpd(); // Create a 32-bit general purpose register.
-//! cc.mov(vReg, 1); // Move one to our virtual register `vReg`.
-//! cc.ret(vReg); // Return `vReg` from the function.
+//! x86::Gp vReg = cc.newGpd(); // Create a 32-bit general purpose register.
+//! cc.mov(vReg, 1); // Move one to our virtual register `vReg`.
+//! cc.ret(vReg); // Return `vReg` from the function.
//!
-//! cc.endFunc(); // End of the function body.
-//! cc.finalize(); // Translate and assemble the whole 'cc' content.
+//! cc.endFunc(); // End of the function body.
+//! cc.finalize(); // Translate and assemble the whole 'cc' content.
//! // ----> x86::Compiler is no longer needed from here and can be destroyed <----
//!
//! Func fn;
-//! Error err = rt.add(&fn, &code); // Add the generated code to the runtime.
-//! if (err) return 1; // Handle a possible error returned by AsmJit.
+//! Error err = rt.add(&fn, &code); // Add the generated code to the runtime.
+//! if (err) return 1; // Handle a possible error returned by AsmJit.
//! // ----> CodeHolder is no longer needed from here and can be destroyed <----
//!
-//! int result = fn(); // Execute the generated code.
-//! printf("%d\n", result); // Print the resulting "1".
+//! int result = fn(); // Execute the generated code.
+//! printf("%d\n", result); // Print the resulting "1".
//!
-//! rt.release(fn); // Explicitly remove the function from the runtime.
+//! rt.release(fn); // Explicitly remove the function from the runtime.
//! return 0;
//! }
//! ```
@@ -79,48 +80,49 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! typedef void (*MemCpy32)(uint32_t* dst, const uint32_t* src, size_t count);
//!
//! int main() {
-//! JitRuntime rt; // Runtime specialized for JIT code execution.
-//! CodeHolder code; // Holds code and relocation information.
+//! JitRuntime rt; // Runtime specialized for JIT code execution.
+//! CodeHolder code; // Holds code and relocation information.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
-//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
+//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
//!
-//! FuncNode* funcNode = cc.addFunc( // Begin the function of the following signature:
-//! FuncSignatureT<void, // Return value - void (no return value).
-//! uint32_t*, // 1st argument - uint32_t* (machine reg-size).
-//! const uint32_t*, // 2nd argument - uint32_t* (machine reg-size).
-//! size_t>()); // 3rd argument - size_t (machine reg-size).
+//! FuncNode* funcNode = cc.addFunc ( // Begin the function of the following signature:
+//! FuncSignature::build<void, // Return value - void (no return value).
+//! uint32_t*, // 1st argument - uint32_t* (machine reg-size).
+//! const uint32_t*, // 2nd argument - uint32_t* (machine reg-size).
+//! size_t>()); // 3rd argument - size_t (machine reg-size).
//!
-//! Label L_Loop = cc.newLabel(); // Start of the loop.
-//! Label L_Exit = cc.newLabel(); // Used to exit early.
+//! Label L_Loop = cc.newLabel(); // Start of the loop.
+//! Label L_Exit = cc.newLabel(); // Used to exit early.
//!
-//! x86::Gp dst = cc.newIntPtr("dst");// Create `dst` register (destination pointer).
-//! x86::Gp src = cc.newIntPtr("src");// Create `src` register (source pointer).
-//! x86::Gp i = cc.newUIntPtr("i"); // Create `i` register (loop counter).
+//! x86::Gp dst = cc.newIntPtr("dst"); // Create `dst` register (destination pointer).
+//! x86::Gp src = cc.newIntPtr("src"); // Create `src` register (source pointer).
+//! x86::Gp i = cc.newUIntPtr("i"); // Create `i` register (loop counter).
//!
-//! funcNode->setArg(0, dst); // Assign `dst` argument.
-//! funcNode->setArg(1, src); // Assign `src` argument.
-//! funcNode->setArg(2, i); // Assign `i` argument.
+//! funcNode->setArg(0, dst); // Assign `dst` argument.
+//! funcNode->setArg(1, src); // Assign `src` argument.
+//! funcNode->setArg(2, i); // Assign `i` argument.
//!
-//! cc.test(i, i); // Early exit if length is zero.
+//! cc.test(i, i); // Early exit if length is zero.
//! cc.jz(L_Exit);
//!
-//! cc.bind(L_Loop); // Bind the beginning of the loop here.
+//! cc.bind(L_Loop); // Bind the beginning of the loop here.
//!
-//! x86::Gp tmp = cc.newInt32("tmp"); // Copy a single dword (4 bytes).
-//! cc.mov(tmp, x86::dword_ptr(src)); // Load DWORD from [src] address.
-//! cc.mov(x86::dword_ptr(dst), tmp); // Store DWORD to [dst] address.
+//! x86::Gp tmp = cc.newInt32("tmp"); // Copy a single dword (4 bytes).
+//! cc.mov(tmp, x86::dword_ptr(src)); // Load DWORD from [src] address.
+//! cc.mov(x86::dword_ptr(dst), tmp); // Store DWORD to [dst] address.
//!
-//! cc.add(src, 4); // Increment `src`.
-//! cc.add(dst, 4); // Increment `dst`.
+//! cc.add(src, 4); // Increment `src`.
+//! cc.add(dst, 4); // Increment `dst`.
//!
-//! cc.dec(i); // Loop until `i` is non-zero.
+//! cc.dec(i); // Loop until `i` is non-zero.
//! cc.jnz(L_Loop);
//!
-//! cc.bind(L_Exit); // Label used by early exit.
-//! cc.endFunc(); // End of the function body.
+//! cc.bind(L_Exit); // Label used by early exit.
+//! cc.endFunc(); // End of the function body.
//!
-//! cc.finalize(); // Translate and assemble the whole 'cc' content.
+//! cc.finalize(); // Translate and assemble the whole 'cc' content.
//! // ----> x86::Compiler is no longer needed from here and can be destroyed <----
//!
//! // Add the generated code to the runtime.
@@ -161,13 +163,14 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! typedef void (*Func)(void*);
//!
//! int main() {
-//! JitRuntime rt; // Runtime specialized for JIT code execution.
-//! CodeHolder code; // Holds code and relocation information.
+//! JitRuntime rt; // Runtime specialized for JIT code execution.
+//! CodeHolder code; // Holds code and relocation information.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
-//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
+//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
//!
-//! FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, void*>());
+//! FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, void*>());
//!
//! // Use the following to enable AVX and/or AVX-512.
//! funcNode->frame().setAvxEnabled();
@@ -183,13 +186,13 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! cc.vpaddq(vreg, vreg, vreg);
//! cc.vmovdqu32(x86::ptr(addr), vreg);
//!
-//! cc.endFunc(); // End of the function body.
-//! cc.finalize(); // Translate and assemble the whole 'cc' content.
+//! cc.endFunc(); // End of the function body.
+//! cc.finalize(); // Translate and assemble the whole 'cc' content.
//! // ----> x86::Compiler is no longer needed from here and can be destroyed <----
//!
//! Func fn;
-//! Error err = rt.add(&fn, &code); // Add the generated code to the runtime.
-//! if (err) return 1; // Handle a possible error returned by AsmJit.
+//! Error err = rt.add(&fn, &code); // Add the generated code to the runtime.
+//! if (err) return 1; // Handle a possible error returned by AsmJit.
//! // ----> CodeHolder is no longer needed from here and can be destroyed <----
//!
//! // Execute the generated code and print some output.
@@ -197,7 +200,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! fn(data);
//! printf("%llu\n", (unsigned long long)data[0]);
//!
-//! rt.release(fn); // Explicitly remove the function from the runtime.
+//! rt.release(fn); // Explicitly remove the function from the runtime.
//! return 0;
//! }
//! ```
@@ -219,47 +222,48 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! typedef uint32_t (*Fibonacci)(uint32_t x);
//!
//! int main() {
-//! JitRuntime rt; // Runtime specialized for JIT code execution.
-//! CodeHolder code; // Holds code and relocation information.
+//! JitRuntime rt; // Runtime specialized for JIT code execution.
+//! CodeHolder code; // Holds code and relocation information.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
-//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
+//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
//!
-//! FuncNode* funcNode = cc.addFunc( // Begin of the Fibonacci function, addFunc()
-//! FuncSignatureT<int, int>()); // Returns a pointer to the FuncNode node.
+//! FuncNode* funcNode = cc.addFunc( // Begin of the Fibonacci function, addFunc()
+//! FuncSignature::build<int, int>()); // Returns a pointer to the FuncNode node.
//!
-//! Label L_Exit = cc.newLabel() // Exit label.
-//! x86::Gp x = cc.newUInt32(); // Function x argument.
-//! x86::Gp y = cc.newUInt32(); // Temporary.
+//! Label L_Exit = cc.newLabel(); // Exit label.
+//! x86::Gp x = cc.newUInt32(); // Function x argument.
+//! x86::Gp y = cc.newUInt32(); // Temporary.
//!
//! funcNode->setArg(0, x);
//!
-//! cc.cmp(x, 3); // Return x if less than 3.
+//! cc.cmp(x, 3); // Return x if less than 3.
//! cc.jb(L_Exit);
//!
-//! cc.mov(y, x); // Make copy of the original x.
-//! cc.dec(x); // Decrease x.
+//! cc.mov(y, x); // Make copy of the original x.
+//! cc.dec(x); // Decrease x.
//!
-//! InvokeNode* invokeNode; // Function invocation:
-//! cc.invoke(&invokeNode, // - InvokeNode (output).
-//! funcNode->label(), // - Function address or Label.
-//! FuncSignatureT<int, int>()); // - Function signature.
+//! InvokeNode* invokeNode; // Function invocation:
+//! cc.invoke(&invokeNode, // - InvokeNode (output).
+//! funcNode->label(), // - Function address or Label.
+//! FuncSignature::build<int, int>()); // - Function signature.
//!
-//! invokeNode->setArg(0, x); // Assign x as the first argument.
-//! invokeNode->setRet(0, x); // Assign x as a return value as well.
+//! invokeNode->setArg(0, x); // Assign x as the first argument.
+//! invokeNode->setRet(0, x); // Assign x as a return value as well.
//!
-//! cc.add(x, y); // Combine the return value with y.
+//! cc.add(x, y); // Combine the return value with y.
//!
//! cc.bind(L_Exit);
-//! cc.ret(x); // Return x.
-//! cc.endFunc(); // End of the function body.
+//! cc.ret(x); // Return x.
+//! cc.endFunc(); // End of the function body.
//!
-//! cc.finalize(); // Translate and assemble the whole 'cc' content.
+//! cc.finalize(); // Translate and assemble the whole 'cc' content.
//! // ----> x86::Compiler is no longer needed from here and can be destroyed <----
//!
//! Fibonacci fib;
-//! Error err = rt.add(&fib, &code); // Add the generated code to the runtime.
-//! if (err) return 1; // Handle a possible error returned by AsmJit.
+//! Error err = rt.add(&fib, &code); // Add the generated code to the runtime.
+//! if (err) return 1; // Handle a possible error returned by AsmJit.
//! // ----> CodeHolder is no longer needed from here and can be destroyed <----
//!
//! // Test the generated code.
@@ -287,13 +291,14 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! typedef int (*Func)(void);
//!
//! int main() {
-//! JitRuntime rt; // Runtime specialized for JIT code execution.
-//! CodeHolder code; // Holds code and relocation information.
+//! JitRuntime rt; // Runtime specialized for JIT code execution.
+//! CodeHolder code; // Holds code and relocation information.
//!
-//! code.init(rt.environment()); // Initialize code to match the JIT environment.
-//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
+//! code.init(rt.environment(), // Initialize code to match the JIT environment.
+//! rt.cpuFeatures());
+//! x86::Compiler cc(&code); // Create and attach x86::Compiler to code.
//!
-//! cc.addFunc(FuncSignatureT<int>());// Create a function that returns int.
+//! cc.addFunc(FuncSignature::build<int>()); // Create a function that returns int.
//!
//! x86::Gp p = cc.newIntPtr("p");
//! x86::Gp i = cc.newIntPtr("i");
@@ -301,9 +306,9 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! // Allocate 256 bytes on the stack aligned to 4 bytes.
//! x86::Mem stack = cc.newStack(256, 4);
//!
-//! x86::Mem stackIdx(stack); // Copy of stack with i added.
-//! stackIdx.setIndex(i); // stackIdx <- stack[i].
-//! stackIdx.setSize(1); // stackIdx <- byte ptr stack[i].
+//! x86::Mem stackIdx(stack); // Copy of stack with i added.
+//! stackIdx.setIndex(i); // stackIdx <- stack[i].
+//! stackIdx.setSize(1); // stackIdx <- byte ptr stack[i].
//!
//! // Load a stack address to `p`. This step is purely optional and shows
//! // that `lea` is useful to load a memory operands address (even absolute)
@@ -316,12 +321,12 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! Label L1 = cc.newLabel();
//! Label L2 = cc.newLabel();
//!
-//! cc.bind(L1); // First loop, fill the stack.
-//! cc.mov(stackIdx, i.r8()); // stack[i] = uint8_t(i).
+//! cc.bind(L1); // First loop, fill the stack.
+//! cc.mov(stackIdx, i.r8()); // stack[i] = uint8_t(i).
//!
-//! cc.inc(i); // i++;
-//! cc.cmp(i, 256); // if (i < 256)
-//! cc.jb(L1); // goto L1;
+//! cc.inc(i); // i++;
+//! cc.cmp(i, 256); // if (i < 256)
+//! cc.jb(L1); // goto L1;
//!
//! // Second loop, sum all bytes stored in `stack`.
//! x86::Gp sum = cc.newInt32("sum");
@@ -332,25 +337,25 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//!
//! cc.bind(L2);
//!
-//! cc.movzx(val, stackIdx); // val = uint32_t(stack[i]);
-//! cc.add(sum, val); // sum += val;
+//! cc.movzx(val, stackIdx); // val = uint32_t(stack[i]);
+//! cc.add(sum, val); // sum += val;
//!
-//! cc.inc(i); // i++;
-//! cc.cmp(i, 256); // if (i < 256)
-//! cc.jb(L2); // goto L2;
+//! cc.inc(i); // i++;
+//! cc.cmp(i, 256); // if (i < 256)
+//! cc.jb(L2); // goto L2;
//!
-//! cc.ret(sum); // Return the `sum` of all values.
-//! cc.endFunc(); // End of the function body.
+//! cc.ret(sum); // Return the `sum` of all values.
+//! cc.endFunc(); // End of the function body.
//!
-//! cc.finalize(); // Translate and assemble the whole 'cc' content.
+//! cc.finalize(); // Translate and assemble the whole 'cc' content.
//! // ----> x86::Compiler is no longer needed from here and can be destroyed <----
//!
//! Func func;
-//! Error err = rt.add(&func, &code); // Add the generated code to the runtime.
-//! if (err) return 1; // Handle a possible error returned by AsmJit.
+//! Error err = rt.add(&func, &code); // Add the generated code to the runtime.
+//! if (err) return 1; // Handle a possible error returned by AsmJit.
//! // ----> CodeHolder is no longer needed from here and can be destroyed <----
//!
-//! printf("Func() -> %d\n", func()); // Test the generated code.
+//! printf("Func() -> %d\n", func()); // Test the generated code.
//!
//! rt.release(func);
//! return 0;
@@ -375,7 +380,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! using namespace asmjit;
//!
//! static void exampleUseOfConstPool(x86::Compiler& cc) {
-//! cc.addFunc(FuncSignatureT<int>());
+//! cc.addFunc(FuncSignature::build<int>());
//!
//! x86::Gp v0 = cc.newGpd("v0");
//! x86::Gp v1 = cc.newGpd("v1");
@@ -409,7 +414,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! using namespace asmjit;
//!
//! static void exampleUseOfIndirectJump(x86::Compiler& cc) {
-//! FuncNode* funcNode = cc.addFunc(FuncSignatureT<float, float, float, uint32_t>(CallConvId::kHost));
+//! FuncNode* funcNode = cc.addFunc(FuncSignature::build<float, float, float, uint32_t>());
//!
//! // Function arguments
//! x86::Xmm a = cc.newXmmSs("a");
@@ -489,7 +494,7 @@ public:
//! \{
ASMJIT_API explicit Compiler(CodeHolder* code = nullptr) noexcept;
- ASMJIT_API virtual ~Compiler() noexcept;
+ ASMJIT_API ~Compiler() noexcept override;
//! \}
@@ -497,52 +502,52 @@ public:
//! \{
#ifndef ASMJIT_NO_LOGGING
-# define ASMJIT_NEW_REG_FMT(OUT, PARAM, FORMAT, ARGS) \
+# define ASMJIT_NEW_REG_FMT(OUT, PARAM, FORMAT, ARGS) \
_newRegFmt(&OUT, PARAM, FORMAT, ARGS)
#else
-# define ASMJIT_NEW_REG_FMT(OUT, PARAM, FORMAT, ARGS) \
- DebugUtils::unused(FORMAT); \
- DebugUtils::unused(std::forward<Args>(args)...); \
+# define ASMJIT_NEW_REG_FMT(OUT, PARAM, FORMAT, ARGS) \
+ DebugUtils::unused(FORMAT); \
+ DebugUtils::unused(std::forward<Args>(args)...); \
_newReg(&OUT, PARAM)
#endif
-#define ASMJIT_NEW_REG_CUSTOM(FUNC, REG) \
- inline REG FUNC(TypeId typeId) { \
- REG reg(Globals::NoInit); \
- _newReg(&reg, typeId); \
- return reg; \
- } \
- \
- template<typename... Args> \
- inline REG FUNC(TypeId typeId, const char* fmt, Args&&... args) { \
- REG reg(Globals::NoInit); \
- ASMJIT_NEW_REG_FMT(reg, typeId, fmt, std::forward<Args>(args)...); \
- return reg; \
+#define ASMJIT_NEW_REG_CUSTOM(FUNC, REG) \
+ ASMJIT_INLINE_NODEBUG REG FUNC(TypeId typeId) { \
+ REG reg(Globals::NoInit); \
+ _newReg(&reg, typeId); \
+ return reg; \
+ } \
+ \
+ template<typename... Args> \
+ ASMJIT_INLINE_NODEBUG REG FUNC(TypeId typeId, const char* fmt, Args&&... args) { \
+ REG reg(Globals::NoInit); \
+ ASMJIT_NEW_REG_FMT(reg, typeId, fmt, std::forward<Args>(args)...); \
+ return reg; \
}
-#define ASMJIT_NEW_REG_TYPED(FUNC, REG, TYPE_ID) \
- inline REG FUNC() { \
- REG reg(Globals::NoInit); \
- _newReg(&reg, TYPE_ID); \
- return reg; \
- } \
- \
- template<typename... Args> \
- inline REG FUNC(const char* fmt, Args&&... args) { \
- REG reg(Globals::NoInit); \
- ASMJIT_NEW_REG_FMT(reg, TYPE_ID, fmt, std::forward<Args>(args)...); \
- return reg; \
+#define ASMJIT_NEW_REG_TYPED(FUNC, REG, TYPE_ID) \
+ ASMJIT_INLINE_NODEBUG REG FUNC() { \
+ REG reg(Globals::NoInit); \
+ _newReg(&reg, TYPE_ID); \
+ return reg; \
+ } \
+ \
+ template<typename... Args> \
+ ASMJIT_INLINE_NODEBUG REG FUNC(const char* fmt, Args&&... args) { \
+ REG reg(Globals::NoInit); \
+ ASMJIT_NEW_REG_FMT(reg, TYPE_ID, fmt, std::forward<Args>(args)...); \
+ return reg; \
}
template<typename RegT>
- inline RegT newSimilarReg(const RegT& ref) {
+ ASMJIT_INLINE_NODEBUG RegT newSimilarReg(const RegT& ref) {
RegT reg(Globals::NoInit);
- _newReg(reg, ref);
+ _newReg(&reg, ref);
return reg;
}
template<typename RegT, typename... Args>
- inline RegT newSimilarReg(const RegT& ref, const char* fmt, Args&&... args) {
+ ASMJIT_INLINE_NODEBUG RegT newSimilarReg(const RegT& ref, const char* fmt, Args&&... args) {
RegT reg(Globals::NoInit);
ASMJIT_NEW_REG_FMT(reg, ref, fmt, std::forward<Args>(args)...);
return reg;
@@ -596,7 +601,7 @@ public:
//! \{
//! Creates a new memory chunk allocated on the current function's stack.
- inline Mem newStack(uint32_t size, uint32_t alignment, const char* name = nullptr) {
+ ASMJIT_INLINE_NODEBUG Mem newStack(uint32_t size, uint32_t alignment, const char* name = nullptr) {
Mem m(Globals::NoInit);
_newStack(&m, size, alignment, name);
return m;
@@ -608,38 +613,38 @@ public:
//! \{
//! Put data to a constant-pool and get a memory reference to it.
- inline Mem newConst(ConstPoolScope scope, const void* data, size_t size) {
+ ASMJIT_INLINE_NODEBUG Mem newConst(ConstPoolScope scope, const void* data, size_t size) {
Mem m(Globals::NoInit);
_newConst(&m, scope, data, size);
return m;
}
//! Put a BYTE `val` to a constant-pool.
- inline Mem newByteConst(ConstPoolScope scope, uint8_t val) noexcept { return newConst(scope, &val, 1); }
+ ASMJIT_INLINE_NODEBUG Mem newByteConst(ConstPoolScope scope, uint8_t val) noexcept { return newConst(scope, &val, 1); }
//! Put a WORD `val` to a constant-pool.
- inline Mem newWordConst(ConstPoolScope scope, uint16_t val) noexcept { return newConst(scope, &val, 2); }
+ ASMJIT_INLINE_NODEBUG Mem newWordConst(ConstPoolScope scope, uint16_t val) noexcept { return newConst(scope, &val, 2); }
//! Put a DWORD `val` to a constant-pool.
- inline Mem newDWordConst(ConstPoolScope scope, uint32_t val) noexcept { return newConst(scope, &val, 4); }
+ ASMJIT_INLINE_NODEBUG Mem newDWordConst(ConstPoolScope scope, uint32_t val) noexcept { return newConst(scope, &val, 4); }
//! Put a QWORD `val` to a constant-pool.
- inline Mem newQWordConst(ConstPoolScope scope, uint64_t val) noexcept { return newConst(scope, &val, 8); }
+ ASMJIT_INLINE_NODEBUG Mem newQWordConst(ConstPoolScope scope, uint64_t val) noexcept { return newConst(scope, &val, 8); }
//! Put a WORD `val` to a constant-pool.
- inline Mem newInt16Const(ConstPoolScope scope, int16_t val) noexcept { return newConst(scope, &val, 2); }
+ ASMJIT_INLINE_NODEBUG Mem newInt16Const(ConstPoolScope scope, int16_t val) noexcept { return newConst(scope, &val, 2); }
//! Put a WORD `val` to a constant-pool.
- inline Mem newUInt16Const(ConstPoolScope scope, uint16_t val) noexcept { return newConst(scope, &val, 2); }
+ ASMJIT_INLINE_NODEBUG Mem newUInt16Const(ConstPoolScope scope, uint16_t val) noexcept { return newConst(scope, &val, 2); }
//! Put a DWORD `val` to a constant-pool.
- inline Mem newInt32Const(ConstPoolScope scope, int32_t val) noexcept { return newConst(scope, &val, 4); }
+ ASMJIT_INLINE_NODEBUG Mem newInt32Const(ConstPoolScope scope, int32_t val) noexcept { return newConst(scope, &val, 4); }
//! Put a DWORD `val` to a constant-pool.
- inline Mem newUInt32Const(ConstPoolScope scope, uint32_t val) noexcept { return newConst(scope, &val, 4); }
+ ASMJIT_INLINE_NODEBUG Mem newUInt32Const(ConstPoolScope scope, uint32_t val) noexcept { return newConst(scope, &val, 4); }
//! Put a QWORD `val` to a constant-pool.
- inline Mem newInt64Const(ConstPoolScope scope, int64_t val) noexcept { return newConst(scope, &val, 8); }
+ ASMJIT_INLINE_NODEBUG Mem newInt64Const(ConstPoolScope scope, int64_t val) noexcept { return newConst(scope, &val, 8); }
//! Put a QWORD `val` to a constant-pool.
- inline Mem newUInt64Const(ConstPoolScope scope, uint64_t val) noexcept { return newConst(scope, &val, 8); }
+ ASMJIT_INLINE_NODEBUG Mem newUInt64Const(ConstPoolScope scope, uint64_t val) noexcept { return newConst(scope, &val, 8); }
//! Put a SP-FP `val` to a constant-pool.
- inline Mem newFloatConst(ConstPoolScope scope, float val) noexcept { return newConst(scope, &val, 4); }
+ ASMJIT_INLINE_NODEBUG Mem newFloatConst(ConstPoolScope scope, float val) noexcept { return newConst(scope, &val, 4); }
//! Put a DP-FP `val` to a constant-pool.
- inline Mem newDoubleConst(ConstPoolScope scope, double val) noexcept { return newConst(scope, &val, 8); }
+ ASMJIT_INLINE_NODEBUG Mem newDoubleConst(ConstPoolScope scope, double val) noexcept { return newConst(scope, &val, 8); }
//! \}
@@ -647,9 +652,9 @@ public:
//! \{
//! Force the compiler to not follow the conditional or unconditional jump.
- inline Compiler& unfollow() noexcept { addInstOptions(InstOptions::kUnfollow); return *this; }
+ ASMJIT_INLINE_NODEBUG Compiler& unfollow() noexcept { addInstOptions(InstOptions::kUnfollow); return *this; }
//! Tell the compiler that the destination variable will be overwritten.
- inline Compiler& overwrite() noexcept { addInstOptions(InstOptions::kOverwrite); return *this; }
+ ASMJIT_INLINE_NODEBUG Compiler& overwrite() noexcept { addInstOptions(InstOptions::kOverwrite); return *this; }
//! \}
@@ -657,7 +662,7 @@ public:
//! \{
//! Invoke a function call without `target` type enforcement.
- inline Error invoke_(InvokeNode** out, const Operand_& target, const FuncSignature& signature) {
+ ASMJIT_INLINE_NODEBUG Error invoke_(InvokeNode** out, const Operand_& target, const FuncSignature& signature) {
return addInvokeNode(out, Inst::kIdCall, target, signature);
}
@@ -666,22 +671,22 @@ public:
//! Creates a new \ref InvokeNode, initializes all the necessary members to match the given function `signature`,
//! adds the node to the compiler, and stores its pointer to `out`. The operation is atomic, if anything fails
//! nullptr is stored in `out` and error code is returned.
- inline Error invoke(InvokeNode** out, const Gp& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, const Gp& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
//! \overload
- inline Error invoke(InvokeNode** out, const Mem& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, const Mem& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
//! \overload
- inline Error invoke(InvokeNode** out, const Label& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, const Label& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
//! \overload
- inline Error invoke(InvokeNode** out, const Imm& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, const Imm& target, const FuncSignature& signature) { return invoke_(out, target, signature); }
//! \overload
- inline Error invoke(InvokeNode** out, uint64_t target, const FuncSignature& signature) { return invoke_(out, Imm(int64_t(target)), signature); }
+ ASMJIT_INLINE_NODEBUG Error invoke(InvokeNode** out, uint64_t target, const FuncSignature& signature) { return invoke_(out, Imm(int64_t(target)), signature); }
//! Return from function.
- inline Error ret() { return addRet(Operand(), Operand()); }
+ ASMJIT_INLINE_NODEBUG Error ret() { return addRet(Operand(), Operand()); }
//! \overload
- inline Error ret(const BaseReg& o0) { return addRet(o0, Operand()); }
+ ASMJIT_INLINE_NODEBUG Error ret(const BaseReg& o0) { return addRet(o0, Operand()); }
//! \overload
- inline Error ret(const BaseReg& o0, const BaseReg& o1) { return addRet(o0, o1); }
+ ASMJIT_INLINE_NODEBUG Error ret(const BaseReg& o0, const BaseReg& o1) { return addRet(o0, o1); }
//! \}
@@ -691,9 +696,9 @@ public:
using EmitterExplicitT<Compiler>::jmp;
//! Adds a jump to the given `target` with the provided jump `annotation`.
- inline Error jmp(const BaseReg& target, JumpAnnotation* annotation) { return emitAnnotatedJump(Inst::kIdJmp, target, annotation); }
+ ASMJIT_INLINE_NODEBUG Error jmp(const BaseReg& target, JumpAnnotation* annotation) { return emitAnnotatedJump(Inst::kIdJmp, target, annotation); }
//! \overload
- inline Error jmp(const BaseMem& target, JumpAnnotation* annotation) { return emitAnnotatedJump(Inst::kIdJmp, target, annotation); }
+ ASMJIT_INLINE_NODEBUG Error jmp(const BaseMem& target, JumpAnnotation* annotation) { return emitAnnotatedJump(Inst::kIdJmp, target, annotation); }
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86emithelper.cpp b/3rdparty/asmjit/src/asmjit/x86/x86emithelper.cpp
index b541c048b04..9cd1db68423 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86emithelper.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86emithelper.cpp
@@ -22,6 +22,18 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
// x86::EmitHelper - Utilities
// ===========================
+static constexpr OperandSignature regSizeToGpSignature[8 + 1] = {
+ OperandSignature{0},
+ OperandSignature{RegTraits<RegType::kX86_GpbLo>::kSignature},
+ OperandSignature{RegTraits<RegType::kX86_Gpw>::kSignature},
+ OperandSignature{0},
+ OperandSignature{RegTraits<RegType::kX86_Gpd>::kSignature},
+ OperandSignature{0},
+ OperandSignature{0},
+ OperandSignature{0},
+ OperandSignature{RegTraits<RegType::kX86_Gpq>::kSignature}
+};
+
static inline uint32_t getXmmMovInst(const FuncFrame& frame) {
bool avx = frame.isAvxEnabled();
bool aligned = frame.hasAlignedVecSR();
@@ -70,8 +82,8 @@ ASMJIT_FAVOR_SIZE Error EmitHelper::emitRegMove(
// Detect memory operands and patch them to have the same size as the register. BaseCompiler always sets memory size
// of allocs and spills, so it shouldn't be really necessary, however, after this function was separated from Compiler
// it's better to make sure that the size is always specified, as we can use 'movzx' and 'movsx' that rely on it.
- if (dst.isMem()) { memFlags |= kDstMem; dst.as<Mem>().setSize(src.size()); }
- if (src.isMem()) { memFlags |= kSrcMem; src.as<Mem>().setSize(dst.size()); }
+ if (dst.isMem()) { memFlags |= kDstMem; dst.as<Mem>().setSize(src.as<Mem>().size()); }
+ if (src.isMem()) { memFlags |= kSrcMem; src.as<Mem>().setSize(dst.as<Mem>().size()); }
switch (typeId) {
case TypeId::kInt8:
@@ -182,41 +194,42 @@ ASMJIT_FAVOR_SIZE Error EmitHelper::emitArgMove(
// Not a real loop, just 'break' is nicer than 'goto'.
for (;;) {
if (TypeUtils::isInt(dstTypeId)) {
+ // Sign extend.
if (TypeUtils::isInt(srcTypeId)) {
- instId = Inst::kIdMovsx;
uint32_t castOp = makeCastOp(dstTypeId, srcTypeId);
- // Sign extend by using 'movsx'.
if (castOp == makeCastOp(TypeId::kInt16, TypeId::kInt8 ) ||
castOp == makeCastOp(TypeId::kInt32, TypeId::kInt8 ) ||
- castOp == makeCastOp(TypeId::kInt32, TypeId::kInt16) ||
castOp == makeCastOp(TypeId::kInt64, TypeId::kInt8 ) ||
- castOp == makeCastOp(TypeId::kInt64, TypeId::kInt16))
- break;
-
- // Sign extend by using 'movsxd'.
- instId = Inst::kIdMovsxd;
- if (castOp == makeCastOp(TypeId::kInt64, TypeId::kInt32))
+ castOp == makeCastOp(TypeId::kInt32, TypeId::kInt16) ||
+ castOp == makeCastOp(TypeId::kInt64, TypeId::kInt16) ||
+ castOp == makeCastOp(TypeId::kInt64, TypeId::kInt32)) {
+ // Sign extend by using 'movsx' or 'movsxd'.
+ instId =
+ castOp == makeCastOp(TypeId::kInt64, TypeId::kInt32)
+ ? Inst::kIdMovsxd
+ : Inst::kIdMovsx;
+
+ dst.setSignature(regSizeToGpSignature[dstSize]);
+ if (src.isReg())
+ src.setSignature(regSizeToGpSignature[srcSize]);
break;
+ }
}
+ // Zero extend.
if (TypeUtils::isInt(srcTypeId) || src_.isMem()) {
+ uint32_t movSize = Support::min(srcSize, dstSize);
+ if (movSize <= 4)
+ dstSize = 4;
+
// Zero extend by using 'movzx' or 'mov'.
- if (dstSize <= 4 && srcSize < 4) {
- instId = Inst::kIdMovzx;
- dst.setSignature(Reg::signatureOfT<RegType::kX86_Gpd>());
- }
- else {
- // We should have caught all possibilities where `srcSize` is less than 4, so we don't have to worry
- // about 'movzx' anymore. Minimum size is enough to determine if we want 32-bit or 64-bit move.
- instId = Inst::kIdMov;
- srcSize = Support::min(srcSize, dstSize);
-
- dst.setSignature(srcSize == 4 ? Reg::signatureOfT<RegType::kX86_Gpd>()
- : Reg::signatureOfT<RegType::kX86_Gpq>());
- if (src.isReg())
- src.setSignature(dst.signature());
- }
+ instId = movSize < 4 ? Inst::kIdMovzx : Inst::kIdMov;
+ srcSize = Support::min(srcSize, movSize);
+
+ dst.setSignature(regSizeToGpSignature[dstSize]);
+ if (src.isReg())
+ src.setSignature(regSizeToGpSignature[srcSize]);
break;
}
@@ -394,25 +407,29 @@ Error EmitHelper::emitRegSwap(
// x86::EmitHelper - Emit Prolog & Epilog
// ======================================
-static inline void X86Internal_setupSaveRestoreInfo(RegGroup group, const FuncFrame& frame, Reg& xReg, uint32_t& xInst, uint32_t& xSize) noexcept {
+static inline Error X86Internal_setupSaveRestoreInfo(RegGroup group, const FuncFrame& frame, Reg& xReg, uint32_t& xInst, uint32_t& xSize) noexcept {
switch (group) {
case RegGroup::kVec:
xReg = xmm(0);
xInst = getXmmMovInst(frame);
xSize = xReg.size();
- break;
+ return kErrorOk;
+
case RegGroup::kX86_K:
xReg = k(0);
xInst = Inst::kIdKmovq;
xSize = xReg.size();
- break;
+ return kErrorOk;
+
case RegGroup::kX86_MM:
xReg = mm(0);
xInst = Inst::kIdMovq;
xSize = xReg.size();
- break;
+ return kErrorOk;
+
default:
- break;
+ // This would be a bug in AsmJit if hit.
+ return DebugUtils::errored(kErrorInvalidState);
}
}
@@ -425,6 +442,12 @@ ASMJIT_FAVOR_SIZE Error EmitHelper::emitProlog(const FuncFrame& frame) {
Gp gpReg = zsp; // General purpose register (temporary).
Gp saReg = zsp; // Stack-arguments base pointer.
+ // Emit: 'endbr32' or 'endbr64' (indirect branch protection).
+ if (frame.hasIndirectBranchProtection()) {
+ InstId instId = emitter->is32Bit() ? Inst::kIdEndbr32 : Inst::kIdEndbr64;
+ ASMJIT_PROPAGATE(emitter->emit(instId));
+ }
+
// Emit: 'push zbp'
// 'mov zbp, zsp'.
if (frame.hasPreservedFP()) {
@@ -473,16 +496,15 @@ ASMJIT_FAVOR_SIZE Error EmitHelper::emitProlog(const FuncFrame& frame) {
// Emit 'movxxx [zsp + X], {[x|y|z]mm, k}'.
{
- Reg xReg;
Mem xBase = ptr(zsp, int32_t(frame.extraRegSaveOffset()));
- uint32_t xInst;
- uint32_t xSize;
-
for (RegGroup group : Support::EnumValues<RegGroup, RegGroup(1), RegGroup::kMaxVirt>{}) {
Support::BitWordIterator<RegMask> it(frame.savedRegs(group));
if (it.hasNext()) {
- X86Internal_setupSaveRestoreInfo(group, frame, xReg, xInst, xSize);
+ Reg xReg;
+ uint32_t xInst = 0;
+ uint32_t xSize = 0;
+ ASMJIT_PROPAGATE(X86Internal_setupSaveRestoreInfo(group, frame, xReg, xInst, xSize));
do {
xReg.setId(it.next());
ASMJIT_PROPAGATE(emitter->emit(xInst, xBase, xReg));
@@ -514,16 +536,15 @@ ASMJIT_FAVOR_SIZE Error EmitHelper::emitEpilog(const FuncFrame& frame) {
// Emit 'movxxx {[x|y|z]mm, k}, [zsp + X]'.
{
- Reg xReg;
Mem xBase = ptr(zsp, int32_t(frame.extraRegSaveOffset()));
- uint32_t xInst;
- uint32_t xSize;
-
for (RegGroup group : Support::EnumValues<RegGroup, RegGroup(1), RegGroup::kMaxVirt>{}) {
Support::BitWordIterator<RegMask> it(frame.savedRegs(group));
if (it.hasNext()) {
- X86Internal_setupSaveRestoreInfo(group, frame, xReg, xInst, xSize);
+ Reg xReg;
+ uint32_t xInst;
+ uint32_t xSize;
+ ASMJIT_PROPAGATE(X86Internal_setupSaveRestoreInfo(group, frame, xReg, xInst, xSize));
do {
xReg.setId(it.next());
ASMJIT_PROPAGATE(emitter->emit(xInst, xReg, xBase));
@@ -610,7 +631,7 @@ void assignEmitterFuncs(BaseEmitter* emitter) {
#endif
#ifndef ASMJIT_NO_VALIDATION
- emitter->_funcs.validate = InstInternal::validate;
+ emitter->_funcs.validate = emitter->is32Bit() ? InstInternal::validateX86 : InstInternal::validateX64;
#endif
}
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86emithelper_p.h b/3rdparty/asmjit/src/asmjit/x86/x86emithelper_p.h
index e71d9afe7db..e09d084a097 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86emithelper_p.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86emithelper_p.h
@@ -19,7 +19,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! \addtogroup asmjit_x86
//! \{
-static inline RegType vecTypeIdToRegType(TypeId typeId) noexcept {
+static ASMJIT_INLINE_NODEBUG RegType vecTypeIdToRegType(TypeId typeId) noexcept {
return uint32_t(typeId) <= uint32_t(TypeId::_kVec128End) ? RegType::kX86_Xmm :
uint32_t(typeId) <= uint32_t(TypeId::_kVec256End) ? RegType::kX86_Ymm : RegType::kX86_Zmm;
}
@@ -29,7 +29,7 @@ public:
bool _avxEnabled;
bool _avx512Enabled;
- inline explicit EmitHelper(BaseEmitter* emitter = nullptr, bool avxEnabled = false, bool avx512Enabled = false) noexcept
+ ASMJIT_INLINE_NODEBUG explicit EmitHelper(BaseEmitter* emitter = nullptr, bool avxEnabled = false, bool avx512Enabled = false) noexcept
: BaseEmitHelper(emitter),
_avxEnabled(avxEnabled || avx512Enabled),
_avx512Enabled(avx512Enabled) {}
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86emitter.h b/3rdparty/asmjit/src/asmjit/x86/x86emitter.h
index 1f85dec4fd9..60881d3ff93 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86emitter.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86emitter.h
@@ -139,16 +139,18 @@ struct EmitterExplicitT {
// These two are unfortunately reported by the sanitizer. We know what we do, however, the sanitizer doesn't.
// I have tried to use reinterpret_cast instead, but that would generate bad code when compiled by MSC.
- ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF inline This* _emitter() noexcept { return static_cast<This*>(this); }
- ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF inline const This* _emitter() const noexcept { return static_cast<const This*>(this); }
+ ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF ASMJIT_INLINE_NODEBUG This* _emitter() noexcept { return static_cast<This*>(this); }
+ ASMJIT_ATTRIBUTE_NO_SANITIZE_UNDEF ASMJIT_INLINE_NODEBUG const This* _emitter() const noexcept { return static_cast<const This*>(this); }
//! \endcond
//! \name Native Registers
//! \{
- //! Returns either GPD or GPQ register of the given `id` depending on the emitter's architecture.
+ //! Returns either 32-bit or 64-bit GP register of the given `id` depending on the emitter's architecture.
inline Gp gpz(uint32_t id) const noexcept { return Gp(_emitter()->_gpSignature, id); }
+ //! Clones the given `reg` to either 32-bit or 64-bit GP register depending on the emitter's architecture.
+ inline Gp gpz(const Gp& reg) const noexcept { return Gp(_emitter()->_gpSignature, reg.id()); }
inline Gp zax() const noexcept { return Gp(_emitter()->_gpSignature, Gp::kIdAx); }
inline Gp zcx() const noexcept { return Gp(_emitter()->_gpSignature, Gp::kIdCx); }
@@ -471,7 +473,6 @@ public:
ASMJIT_INST_3x(idiv, Idiv, Gp, Gp, Mem) // ANY [EXPLICIT] xDX[Rem]:xAX[Quot] <- xDX:xAX / m16|m32|m64
ASMJIT_INST_2x(imul, Imul, Gp, Gp) // ANY [EXPLICIT] AX <- AL * r8 | ra <- ra * rb
ASMJIT_INST_2x(imul, Imul, Gp, Mem) // ANY [EXPLICIT] AX <- AL * m8 | ra <- ra * m16|m32|m64
- ASMJIT_INST_2x(imul, Imul, Gp, Imm) // ANY
ASMJIT_INST_3x(imul, Imul, Gp, Gp, Imm) // ANY
ASMJIT_INST_3x(imul, Imul, Gp, Mem, Imm) // ANY
ASMJIT_INST_3x(imul, Imul, Gp, Gp, Gp) // ANY [EXPLICIT] xDX:xAX <- xAX * r16|r32|r64
@@ -633,6 +634,14 @@ public:
//! \}
+ //! \name Core Instructions (Aliases)
+ //! \{
+
+ //! The `imul(Gp, Imm)` instruction is an alias of `imul(Gp, Gp, Imm)` instruction.
+ inline Error imul(const Gp& o0, const Imm& o1) { return _emitter()->_emitI(Inst::kIdImul, o0, o0, o1); }
+
+ //! \}
+
//! \name Deprecated 32-bit Instructions
//! \{
@@ -657,7 +666,6 @@ public:
//! \{
// NOTE: For some reason Doxygen is messed up here and thinks we are in cond.
- //! \endcond
ASMJIT_INST_2x(in, In, Gp_ZAX, Imm) // ANY
ASMJIT_INST_2x(in, In, Gp_ZAX, Gp_DX) // ANY
@@ -679,14 +687,6 @@ public:
//! \}
- //! \name LAHF/SAHF Instructions
- //! \{
-
- ASMJIT_INST_1x(lahf, Lahf, Gp_AH) // LAHFSAHF [EXPLICIT] AH <- EFL
- ASMJIT_INST_1x(sahf, Sahf, Gp_AH) // LAHFSAHF [EXPLICIT] EFL <- AH
-
- //! \}
-
//! \name ADX Instructions
//! \{
@@ -697,13 +697,18 @@ public:
//! \}
- //! \name LZCNT/POPCNT Instructions
+ //! \name CPUID Instruction
//! \{
- ASMJIT_INST_2x(lzcnt, Lzcnt, Gp, Gp) // LZCNT
- ASMJIT_INST_2x(lzcnt, Lzcnt, Gp, Mem) // LZCNT
- ASMJIT_INST_2x(popcnt, Popcnt, Gp, Gp) // POPCNT
- ASMJIT_INST_2x(popcnt, Popcnt, Gp, Mem) // POPCNT
+ ASMJIT_INST_4x(cpuid, Cpuid, Gp_EAX, Gp_EBX, Gp_ECX, Gp_EDX) // I486 [EXPLICIT] EAX:EBX:ECX:EDX <- CPUID[EAX:ECX]
+
+ //! \}
+
+ //! \name LAHF/SAHF Instructions
+ //! \{
+
+ ASMJIT_INST_1x(lahf, Lahf, Gp_AH) // LAHFSAHF [EXPLICIT] AH <- EFL
+ ASMJIT_INST_1x(sahf, Sahf, Gp_AH) // LAHFSAHF [EXPLICIT] EFL <- AH
//! \}
@@ -747,27 +752,36 @@ public:
//! \}
- //! \name TBM Instructions
+ //! \name CMPCCXADD Instructions
//! \{
- ASMJIT_INST_2x(blcfill, Blcfill, Gp, Gp) // TBM
- ASMJIT_INST_2x(blcfill, Blcfill, Gp, Mem) // TBM
- ASMJIT_INST_2x(blci, Blci, Gp, Gp) // TBM
- ASMJIT_INST_2x(blci, Blci, Gp, Mem) // TBM
- ASMJIT_INST_2x(blcic, Blcic, Gp, Gp) // TBM
- ASMJIT_INST_2x(blcic, Blcic, Gp, Mem) // TBM
- ASMJIT_INST_2x(blcmsk, Blcmsk, Gp, Gp) // TBM
- ASMJIT_INST_2x(blcmsk, Blcmsk, Gp, Mem) // TBM
- ASMJIT_INST_2x(blcs, Blcs, Gp, Gp) // TBM
- ASMJIT_INST_2x(blcs, Blcs, Gp, Mem) // TBM
- ASMJIT_INST_2x(blsfill, Blsfill, Gp, Gp) // TBM
- ASMJIT_INST_2x(blsfill, Blsfill, Gp, Mem) // TBM
- ASMJIT_INST_2x(blsic, Blsic, Gp, Gp) // TBM
- ASMJIT_INST_2x(blsic, Blsic, Gp, Mem) // TBM
- ASMJIT_INST_2x(t1mskc, T1mskc, Gp, Gp) // TBM
- ASMJIT_INST_2x(t1mskc, T1mskc, Gp, Mem) // TBM
- ASMJIT_INST_2x(tzmsk, Tzmsk, Gp, Gp) // TBM
- ASMJIT_INST_2x(tzmsk, Tzmsk, Gp, Mem) // TBM
+ ASMJIT_INST_3x(cmpbexadd, Cmpbexadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpbxadd, Cmpbxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmplexadd, Cmplexadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmplxadd, Cmplxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpnbexadd, Cmpnbexadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpnbxadd, Cmpnbxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpnlexadd, Cmpnlexadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpnlxadd, Cmpnlxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpnoxadd, Cmpnoxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpnpxadd, Cmpnpxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpnsxadd, Cmpnsxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpnzxadd, Cmpnzxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpoxadd, Cmpoxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmppxadd, Cmppxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpsxadd, Cmpsxadd, Mem, Gp, Gp)
+ ASMJIT_INST_3x(cmpzxadd, Cmpzxadd, Mem, Gp, Gp)
+
+ //! \}
+
+ //! \name CacheLine Instructions
+ //! \{
+
+ ASMJIT_INST_1x(cldemote, Cldemote, Mem) // CLDEMOTE
+ ASMJIT_INST_1x(clflush, Clflush, Mem) // CLFLUSH
+ ASMJIT_INST_1x(clflushopt, Clflushopt, Mem) // CLFLUSH_OPT
+ ASMJIT_INST_1x(clwb, Clwb, Mem) // CLWB
+ ASMJIT_INST_1x(clzero, Clzero, DS_ZAX) // CLZERO [EXPLICIT]
//! \}
@@ -779,6 +793,23 @@ public:
//! \}
+ //! \name FENCE Instructions (SSE and SSE2)
+ //! \{
+
+ ASMJIT_INST_0x(lfence, Lfence) // SSE2
+ ASMJIT_INST_0x(mfence, Mfence) // SSE2
+ ASMJIT_INST_0x(sfence, Sfence) // SSE
+
+ //! \}
+
+ //! \name LZCNT Instructions
+ //! \{
+
+ ASMJIT_INST_2x(lzcnt, Lzcnt, Gp, Gp) // LZCNT
+ ASMJIT_INST_2x(lzcnt, Lzcnt, Gp, Mem) // LZCNT
+
+ //! \}
+
//! \name MOVBE Instructions
//! \{
@@ -803,12 +834,11 @@ public:
//! \}
- //! \name FENCE Instructions (SSE and SSE2)
+ //! \name POPCNT Instructions
//! \{
- ASMJIT_INST_0x(lfence, Lfence) // SSE2
- ASMJIT_INST_0x(mfence, Mfence) // SSE2
- ASMJIT_INST_0x(sfence, Sfence) // SSE
+ ASMJIT_INST_2x(popcnt, Popcnt, Gp, Gp) // POPCNT
+ ASMJIT_INST_2x(popcnt, Popcnt, Gp, Mem) // POPCNT
//! \}
@@ -825,28 +855,21 @@ public:
//! \}
- //! \name CPUID Instruction
- //! \{
-
- ASMJIT_INST_4x(cpuid, Cpuid, Gp_EAX, Gp_EBX, Gp_ECX, Gp_EDX) // I486 [EXPLICIT] EAX:EBX:ECX:EDX <- CPUID[EAX:ECX]
-
- //! \}
-
- //! \name CacheLine Instructions
+ //! \name PREFETCHI Instructions
//! \{
- ASMJIT_INST_1x(cldemote, Cldemote, Mem) // CLDEMOTE
- ASMJIT_INST_1x(clflush, Clflush, Mem) // CLFLUSH
- ASMJIT_INST_1x(clflushopt, Clflushopt, Mem) // CLFLUSH_OPT
- ASMJIT_INST_1x(clwb, Clwb, Mem) // CLWB
- ASMJIT_INST_1x(clzero, Clzero, DS_ZAX) // CLZERO [EXPLICIT]
+ ASMJIT_INST_1x(prefetchit0, Prefetchit0, Mem)
+ ASMJIT_INST_1x(prefetchit1, Prefetchit1, Mem)
//! \}
- //! \name SERIALIZE Instruction
+ //! \name RAO_INT Instructions
//! \{
- ASMJIT_INST_0x(serialize, Serialize) // SERIALIZE
+ ASMJIT_INST_2x(aadd, Aadd, Mem, Gp)
+ ASMJIT_INST_2x(aand, Aand, Mem, Gp)
+ ASMJIT_INST_2x(aor, Aor, Mem, Gp)
+ ASMJIT_INST_2x(axor, Axor, Mem, Gp)
//! \}
@@ -873,6 +896,37 @@ public:
//! \}
+ //! \name SERIALIZE Instruction
+ //! \{
+
+ ASMJIT_INST_0x(serialize, Serialize) // SERIALIZE
+
+ //! \}
+
+ //! \name TBM Instructions
+ //! \{
+
+ ASMJIT_INST_2x(blcfill, Blcfill, Gp, Gp) // TBM
+ ASMJIT_INST_2x(blcfill, Blcfill, Gp, Mem) // TBM
+ ASMJIT_INST_2x(blci, Blci, Gp, Gp) // TBM
+ ASMJIT_INST_2x(blci, Blci, Gp, Mem) // TBM
+ ASMJIT_INST_2x(blcic, Blcic, Gp, Gp) // TBM
+ ASMJIT_INST_2x(blcic, Blcic, Gp, Mem) // TBM
+ ASMJIT_INST_2x(blcmsk, Blcmsk, Gp, Gp) // TBM
+ ASMJIT_INST_2x(blcmsk, Blcmsk, Gp, Mem) // TBM
+ ASMJIT_INST_2x(blcs, Blcs, Gp, Gp) // TBM
+ ASMJIT_INST_2x(blcs, Blcs, Gp, Mem) // TBM
+ ASMJIT_INST_2x(blsfill, Blsfill, Gp, Gp) // TBM
+ ASMJIT_INST_2x(blsfill, Blsfill, Gp, Mem) // TBM
+ ASMJIT_INST_2x(blsic, Blsic, Gp, Gp) // TBM
+ ASMJIT_INST_2x(blsic, Blsic, Gp, Mem) // TBM
+ ASMJIT_INST_2x(t1mskc, T1mskc, Gp, Gp) // TBM
+ ASMJIT_INST_2x(t1mskc, T1mskc, Gp, Mem) // TBM
+ ASMJIT_INST_2x(tzmsk, Tzmsk, Gp, Gp) // TBM
+ ASMJIT_INST_2x(tzmsk, Tzmsk, Gp, Mem) // TBM
+
+ //! \}
+
//! \name Other User-Mode Instructions
//! \{
@@ -1122,6 +1176,14 @@ public:
//! \}
+ //! \name INVLPGB Instructions
+ //! \{
+
+ ASMJIT_INST_3x(invlpgb, Invlpgb, Gp_EAX, Gp_EDX, Gp_ECX)
+ ASMJIT_INST_0x(tlbsync, Tlbsync)
+
+ //! \}
+
//! \name MONITOR Instructions (Privileged)
//! \{
@@ -1172,6 +1234,7 @@ public:
ASMJIT_INST_0x(vmresume, Vmresume) // VMX
ASMJIT_INST_2x(vmwrite, Vmwrite, Gp, Mem) // VMX
ASMJIT_INST_2x(vmwrite, Vmwrite, Gp, Gp) // VMX
+ ASMJIT_INST_0x(vmxoff, Vmxoff) // VMX
ASMJIT_INST_1x(vmxon, Vmxon, Mem) // VMX
//! \}
@@ -1188,6 +1251,13 @@ public:
//! \}
+ //! \name SEV_ES Instructions
+ //! \{
+
+ ASMJIT_INST_0x(vmgexit, Vmgexit)
+
+ //! \}
+
//! \name FPU Instructions
//! \{
@@ -2092,9 +2162,6 @@ public:
//! \name GFNI Instructions
//! \{
- // NOTE: For some reason Doxygen is messed up here and thinks we are in cond.
- //! \endcond
-
ASMJIT_INST_3x(gf2p8affineinvqb, Gf2p8affineinvqb, Xmm, Xmm, Imm) // GFNI
ASMJIT_INST_3x(gf2p8affineinvqb, Gf2p8affineinvqb, Xmm, Mem, Imm) // GFNI
ASMJIT_INST_3x(gf2p8affineqb, Gf2p8affineqb, Xmm, Xmm, Imm) // GFNI
@@ -2762,7 +2829,7 @@ public:
ASMJIT_INST_3x(vpand, Vpand, Vec, Vec, Mem) // AVX+
ASMJIT_INST_3x(vpandd, Vpandd, Vec, Vec, Vec) // AVX512_F{kz|b32}
ASMJIT_INST_3x(vpandd, Vpandd, Vec, Vec, Mem) // AVX512_F{kz|b32}
- ASMJIT_INST_3x(vpandn, Vpandn, Vec, Vec, Vec) // AV+
+ ASMJIT_INST_3x(vpandn, Vpandn, Vec, Vec, Vec) // AVX+
ASMJIT_INST_3x(vpandn, Vpandn, Vec, Vec, Mem) // AVX+
ASMJIT_INST_3x(vpandnd, Vpandnd, Vec, Vec, Vec) // AVX512_F{kz|b32}
ASMJIT_INST_3x(vpandnd, Vpandnd, Vec, Vec, Mem) // AVX512_F{kz|b32}
@@ -3121,7 +3188,7 @@ public:
ASMJIT_INST_2x(vpopcntq, Vpopcntq, Vec, Mem) // AVX512_VPOPCNTDQ{kz|b64}
ASMJIT_INST_2x(vpopcntw, Vpopcntw, Vec, Vec) // AVX512_BITALG{kz|b32}
ASMJIT_INST_2x(vpopcntw, Vpopcntw, Vec, Mem) // AVX512_BITALG{kz|b32}
- ASMJIT_INST_3x(vpor, Vpor, Vec, Vec, Vec) // AV+
+ ASMJIT_INST_3x(vpor, Vpor, Vec, Vec, Vec) // AVX+
ASMJIT_INST_3x(vpor, Vpor, Vec, Vec, Mem) // AVX+
ASMJIT_INST_3x(vpord, Vpord, Vec, Vec, Vec) // AVX512_F{kz|b32}
ASMJIT_INST_3x(vpord, Vpord, Vec, Vec, Mem) // AVX512_F{kz|b32}
@@ -3659,6 +3726,83 @@ public:
//! \}
+ //! \name AVX_NE_CONVERT Instructions
+ //! \{
+
+ ASMJIT_INST_2x(vbcstnebf162ps, Vbcstnebf162ps, Vec, Mem)
+ ASMJIT_INST_2x(vbcstnesh2ps, Vbcstnesh2ps, Vec, Mem)
+ ASMJIT_INST_2x(vcvtneebf162ps, Vcvtneebf162ps, Vec, Mem)
+ ASMJIT_INST_2x(vcvtneeph2ps, Vcvtneeph2ps, Vec, Mem)
+ ASMJIT_INST_2x(vcvtneobf162ps, Vcvtneobf162ps, Vec, Mem)
+ ASMJIT_INST_2x(vcvtneoph2ps, Vcvtneoph2ps, Vec, Mem)
+
+ //! \}
+
+ //! \name AVX_VNNI_INT8 Instructions
+ //! \{
+
+ ASMJIT_INST_3x(vpdpbssd, Vpdpbssd, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpbssd, Vpdpbssd, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpbssds, Vpdpbssds, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpbssds, Vpdpbssds, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpbsud, Vpdpbsud, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpbsud, Vpdpbsud, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpbsuds, Vpdpbsuds, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpbsuds, Vpdpbsuds, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpbuud, Vpdpbuud, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpbuud, Vpdpbuud, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpbuuds, Vpdpbuuds, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpbuuds, Vpdpbuuds, Vec, Vec, Mem)
+
+ //! \}
+
+ //! \name AVX_VNNI_INT16 Instructions
+ //! \{
+
+ ASMJIT_INST_3x(vpdpwsud, Vpdpwsud, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpwsud, Vpdpwsud, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpwsuds, Vpdpwsuds, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpwsuds, Vpdpwsuds, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpwusd, Vpdpwusd, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpwusd, Vpdpwusd, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpwusds, Vpdpwusds, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpwusds, Vpdpwusds, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpwuud, Vpdpwuud, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpwuud, Vpdpwuud, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vpdpwuuds, Vpdpwuuds, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vpdpwuuds, Vpdpwuuds, Vec, Vec, Mem)
+
+ //! \}
+
+ //! \name AVX+SHA512 Instructions
+ //! \{
+ ASMJIT_INST_2x(vsha512msg1, Vsha512msg1, Vec, Vec)
+ ASMJIT_INST_2x(vsha512msg2, Vsha512msg2, Vec, Vec)
+ ASMJIT_INST_3x(vsha512rnds2, Vsha512rnds2, Vec, Vec, Vec)
+ //! \}
+
+ //! \name AVX+SM3 Instructions
+ //! \{
+
+ ASMJIT_INST_3x(vsm3msg1, Vsm3msg1, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vsm3msg1, Vsm3msg1, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vsm3msg2, Vsm3msg2, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vsm3msg2, Vsm3msg2, Vec, Vec, Mem)
+ ASMJIT_INST_4x(vsm3rnds2, Vsm3rnds2, Vec, Vec, Vec, Imm)
+ ASMJIT_INST_4x(vsm3rnds2, Vsm3rnds2, Vec, Vec, Mem, Imm)
+
+ //! \}
+
+ //! \name AVX+SM4 Instructions
+ //! \{
+
+ ASMJIT_INST_3x(vsm4key4, Vsm4key4, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vsm4key4, Vsm4key4, Vec, Vec, Mem)
+ ASMJIT_INST_3x(vsm4rnds4, Vsm4rnds4, Vec, Vec, Vec)
+ ASMJIT_INST_3x(vsm4rnds4, Vsm4rnds4, Vec, Vec, Mem)
+
+ //! \}
+
//! \name AVX512_FP16 Instructions
//! \{
@@ -3880,22 +4024,48 @@ public:
//! \}
- //! \name AMX Instructions
+ //! \name AMX_TILE Instructions
//! \{
- ASMJIT_INST_1x(ldtilecfg, Ldtilecfg, Mem) // AMX_TILE
- ASMJIT_INST_1x(sttilecfg, Sttilecfg, Mem) // AMX_TILE
- ASMJIT_INST_2x(tileloadd, Tileloadd, Tmm, Mem) // AMX_TILE
- ASMJIT_INST_2x(tileloaddt1, Tileloaddt1, Tmm, Mem) // AMX_TILE
- ASMJIT_INST_0x(tilerelease, Tilerelease) // AMX_TILE
- ASMJIT_INST_2x(tilestored, Tilestored, Mem, Tmm) // AMX_TILE
- ASMJIT_INST_1x(tilezero, Tilezero, Tmm) // AMX_TILE
+ ASMJIT_INST_1x(ldtilecfg, Ldtilecfg, Mem)
+ ASMJIT_INST_1x(sttilecfg, Sttilecfg, Mem)
+ ASMJIT_INST_2x(tileloadd, Tileloadd, Tmm, Mem)
+ ASMJIT_INST_2x(tileloaddt1, Tileloaddt1, Tmm, Mem)
+ ASMJIT_INST_0x(tilerelease, Tilerelease)
+ ASMJIT_INST_2x(tilestored, Tilestored, Mem, Tmm)
+ ASMJIT_INST_1x(tilezero, Tilezero, Tmm)
- ASMJIT_INST_3x(tdpbf16ps, Tdpbf16ps, Tmm, Tmm, Tmm) // AMX_BF16
- ASMJIT_INST_3x(tdpbssd, Tdpbssd, Tmm, Tmm, Tmm) // AMX_INT8
- ASMJIT_INST_3x(tdpbsud, Tdpbsud, Tmm, Tmm, Tmm) // AMX_INT8
- ASMJIT_INST_3x(tdpbusd, Tdpbusd, Tmm, Tmm, Tmm) // AMX_INT8
- ASMJIT_INST_3x(tdpbuud, Tdpbuud, Tmm, Tmm, Tmm) // AMX_INT8
+ //! \}
+
+ //! \name AMX_BF16 Instructions
+ //! \{
+
+ ASMJIT_INST_3x(tdpbf16ps, Tdpbf16ps, Tmm, Tmm, Tmm)
+
+ //! \}
+
+ //! \name AMX_COMPLEX Instructions
+ //! \{
+
+ ASMJIT_INST_3x(tcmmimfp16ps, Tcmmimfp16ps, Tmm, Tmm, Tmm)
+ ASMJIT_INST_3x(tcmmrlfp16ps, Tcmmrlfp16ps, Tmm, Tmm, Tmm)
+
+ //! \}
+
+ //! \name AMX_FP16 Instructions
+ //! \{
+
+ ASMJIT_INST_3x(tdpfp16ps, Tdpfp16ps, Tmm, Tmm, Tmm)
+
+ //! \}
+
+ //! \name AMX_INT8 Instructions
+ //! \{
+
+ ASMJIT_INST_3x(tdpbssd, Tdpbssd, Tmm, Tmm, Tmm)
+ ASMJIT_INST_3x(tdpbsud, Tdpbsud, Tmm, Tmm, Tmm)
+ ASMJIT_INST_3x(tdpbusd, Tdpbusd, Tmm, Tmm, Tmm)
+ ASMJIT_INST_3x(tdpbuud, Tdpbuud, Tmm, Tmm, Tmm)
//! \}
};
@@ -4167,6 +4337,16 @@ struct EmitterImplicitT : public EmitterExplicitT<This> {
//! \}
+ //! \name SEAM Instructions
+ //! \{
+
+ ASMJIT_INST_0x(seamcall, Seamcall)
+ ASMJIT_INST_0x(seamops, Seamops)
+ ASMJIT_INST_0x(seamret, Seamret)
+ ASMJIT_INST_0x(tdcall, Tdcall)
+
+ //! \}
+
//! \name Privileged Instructions
//! \{
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86formatter.cpp b/3rdparty/asmjit/src/asmjit/x86/x86formatter.cpp
index d62dd18b638..67b38dfa779 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86formatter.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86formatter.cpp
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: Zlib
#include "../core/api-build_p.h"
-#ifndef ASMJIT_NO_LOGGING
+#if !defined(ASMJIT_NO_X86) && !defined(ASMJIT_NO_LOGGING)
#include "../core/cpuinfo.h"
#include "../core/misc_p.h"
@@ -95,6 +95,24 @@ struct RegFormatInfo_T {
X == uint32_t(RegType::kX86_Gpd ) ? 8 :
X == uint32_t(RegType::kX86_Gpq ) ? 8 :
X == uint32_t(RegType::kX86_SReg ) ? 7 :
+ X == uint32_t(RegType::kX86_Rip ) ? 1 : 0,
+
+ kRegCount = X == uint32_t(RegType::kX86_GpbLo) ? 32 :
+ X == uint32_t(RegType::kX86_GpbHi) ? 4 :
+ X == uint32_t(RegType::kX86_Gpw ) ? 32 :
+ X == uint32_t(RegType::kX86_Gpd ) ? 32 :
+ X == uint32_t(RegType::kX86_Gpq ) ? 32 :
+ X == uint32_t(RegType::kX86_Xmm ) ? 32 :
+ X == uint32_t(RegType::kX86_Ymm ) ? 32 :
+ X == uint32_t(RegType::kX86_Zmm ) ? 32 :
+ X == uint32_t(RegType::kX86_Mm ) ? 8 :
+ X == uint32_t(RegType::kX86_KReg ) ? 8 :
+ X == uint32_t(RegType::kX86_SReg ) ? 7 :
+ X == uint32_t(RegType::kX86_CReg ) ? 16 :
+ X == uint32_t(RegType::kX86_DReg ) ? 16 :
+ X == uint32_t(RegType::kX86_St ) ? 8 :
+ X == uint32_t(RegType::kX86_Bnd ) ? 4 :
+ X == uint32_t(RegType::kX86_Tmm ) ? 8 :
X == uint32_t(RegType::kX86_Rip ) ? 1 : 0
};
};
@@ -104,7 +122,7 @@ struct RegFormatInfo_T {
}
#define ASMJIT_REG_NAME_ENTRY(TYPE) { \
- RegTraits<RegType(TYPE)>::kCount, \
+ RegFormatInfo_T<TYPE>::kRegCount, \
RegFormatInfo_T<TYPE>::kFormatIndex, \
RegFormatInfo_T<TYPE>::kSpecialIndex, \
RegFormatInfo_T<TYPE>::kSpecialCount \
@@ -198,8 +216,11 @@ Error FormatterInternal::formatFeature(String& sb, uint32_t featureId) noexcept
"AESNI\0"
"ALTMOVCR8\0"
"AMX_BF16\0"
+ "AMX_COMPLEX\0"
+ "AMX_FP16\0"
"AMX_INT8\0"
"AMX_TILE\0"
+ "APX_F\0"
"AVX\0"
"AVX2\0"
"AVX512_4FMAPS\0"
@@ -207,30 +228,36 @@ Error FormatterInternal::formatFeature(String& sb, uint32_t featureId) noexcept
"AVX512_BF16\0"
"AVX512_BITALG\0"
"AVX512_BW\0"
- "AVX512_CDI\0"
+ "AVX512_CD\0"
"AVX512_DQ\0"
- "AVX512_ERI\0"
+ "AVX512_ER\0"
"AVX512_F\0"
"AVX512_FP16\0"
"AVX512_IFMA\0"
- "AVX512_PFI\0"
+ "AVX512_PF\0"
"AVX512_VBMI\0"
"AVX512_VBMI2\0"
"AVX512_VL\0"
"AVX512_VNNI\0"
"AVX512_VP2INTERSECT\0"
"AVX512_VPOPCNTDQ\0"
+ "AVX_IFMA\0"
+ "AVX_NE_CONVERT\0"
"AVX_VNNI\0"
+ "AVX_VNNI_INT16\0"
+ "AVX_VNNI_INT8\0"
"BMI\0"
"BMI2\0"
"CET_IBT\0"
"CET_SS\0"
+ "CET_SSS\0"
"CLDEMOTE\0"
"CLFLUSH\0"
"CLFLUSHOPT\0"
"CLWB\0"
"CLZERO\0"
"CMOV\0"
+ "CMPCCXADD\0"
"CMPXCHG16B\0"
"CMPXCHG8B\0"
"ENCLV\0"
@@ -241,14 +268,20 @@ Error FormatterInternal::formatFeature(String& sb, uint32_t featureId) noexcept
"FMA4\0"
"FPU\0"
"FSGSBASE\0"
+ "FSRM\0"
+ "FSRC\0"
+ "FSRS\0"
"FXSR\0"
"FXSROPT\0"
+ "FZRM\0"
"GEODE\0"
"GFNI\0"
"HLE\0"
"HRESET\0"
"I486\0"
+ "INVLPGB\0"
"LAHFSAHF\0"
+ "LAM\0"
"LWP\0"
"LZCNT\0"
"MCOMMIT\0"
@@ -261,15 +294,19 @@ Error FormatterInternal::formatFeature(String& sb, uint32_t featureId) noexcept
"MOVDIRI\0"
"MPX\0"
"MSR\0"
+ "MSRLIST\0"
"MSSE\0"
"OSXSAVE\0"
"OSPKE\0"
"PCLMULQDQ\0"
"PCONFIG\0"
"POPCNT\0"
+ "PREFETCHI\0"
"PREFETCHW\0"
"PREFETCHWT1\0"
"PTWRITE\0"
+ "RAO_INT\0"
+ "RMPQUERY\0"
"RDPID\0"
"RDPRU\0"
"RDRAND\0"
@@ -277,13 +314,20 @@ Error FormatterInternal::formatFeature(String& sb, uint32_t featureId) noexcept
"RDTSC\0"
"RDTSCP\0"
"RTM\0"
+ "SEAM\0"
"SERIALIZE\0"
+ "SEV\0"
+ "SEV_ES\0"
+ "SEV_SNP\0"
"SHA\0"
+ "SHA512\0"
"SKINIT\0"
+ "SM3\0"
+ "SM4\0"
"SMAP\0"
+ "SME\0"
"SMEP\0"
"SMX\0"
- "SNP\0"
"SSE\0"
"SSE2\0"
"SSE3\0"
@@ -293,6 +337,7 @@ Error FormatterInternal::formatFeature(String& sb, uint32_t featureId) noexcept
"SSSE3\0"
"SVM\0"
"TBM\0"
+ "TSE\0"
"TSX\0"
"TSXLDTRK\0"
"UINTR\0"
@@ -301,6 +346,7 @@ Error FormatterInternal::formatFeature(String& sb, uint32_t featureId) noexcept
"VPCLMULQDQ\0"
"WAITPKG\0"
"WBNOINVD\0"
+ "WRMSRNS\0"
"XOP\0"
"XSAVE\0"
"XSAVEC\0"
@@ -309,14 +355,16 @@ Error FormatterInternal::formatFeature(String& sb, uint32_t featureId) noexcept
"<Unknown>\0";
static const uint16_t sFeatureIndex[] = {
- 0, 5, 8, 11, 17, 24, 28, 34, 44, 53, 62, 71, 75, 80, 94, 108, 120, 134, 144,
- 155, 165, 176, 185, 197, 209, 220, 232, 245, 255, 267, 287, 304, 313, 317,
- 322, 330, 337, 346, 354, 365, 370, 377, 382, 393, 403, 409, 416, 421, 426,
- 430, 435, 439, 448, 453, 461, 467, 472, 476, 483, 488, 497, 501, 507, 515,
- 519, 524, 532, 541, 547, 557, 565, 569, 573, 578, 586, 592, 602, 610, 617,
- 627, 639, 647, 653, 659, 666, 673, 679, 686, 690, 700, 704, 711, 716, 721,
- 725, 729, 733, 738, 743, 750, 757, 763, 769, 773, 777, 781, 790, 796, 801,
- 805, 816, 824, 833, 837, 843, 850, 859, 866
+ 0, 5, 8, 11, 17, 24, 28, 34, 44, 53, 65, 74, 83, 92, 98, 102, 107, 121, 135,
+ 147, 161, 171, 181, 191, 201, 210, 222, 234, 244, 256, 269, 279, 291, 311,
+ 328, 337, 352, 361, 376, 390, 394, 399, 407, 414, 422, 431, 439, 450, 455,
+ 462, 467, 477, 488, 498, 504, 511, 516, 521, 525, 530, 534, 543, 548, 553,
+ 558, 563, 571, 576, 582, 587, 591, 598, 603, 611, 620, 624, 628, 634, 642,
+ 646, 651, 659, 668, 674, 684, 692, 696, 700, 708, 713, 721, 727, 737, 745,
+ 752, 762, 772, 784, 792, 800, 809, 815, 821, 828, 835, 841, 848, 852, 857,
+ 867, 871, 878, 886, 890, 897, 904, 908, 912, 917, 921, 926, 930, 934, 939,
+ 944, 951, 958, 964, 970, 974, 978, 982, 986, 995, 1001, 1006, 1010, 1021,
+ 1029, 1038, 1046, 1050, 1056, 1063, 1072, 1079
};
// @EnumStringEnd@
@@ -344,7 +392,10 @@ ASMJIT_FAVOR_SIZE Error FormatterInternal::formatRegister(String& sb, FormatFlag
else
ASMJIT_PROPAGATE(sb.appendFormat("%%%u", unsigned(Operand::virtIdToIndex(id))));
- if (vReg->type() != type && uint32_t(type) <= uint32_t(RegType::kMaxValue) && Support::test(formatFlags, FormatFlags::kRegCasts)) {
+ bool formatType = (Support::test(formatFlags, FormatFlags::kRegType)) ||
+ (Support::test(formatFlags, FormatFlags::kRegCasts) && vReg->type() != type);
+
+ if (formatType && uint32_t(type) <= uint32_t(RegType::kMaxValue)) {
const RegFormatInfo::TypeEntry& typeEntry = info.typeEntries[size_t(type)];
if (typeEntry.index)
ASMJIT_PROPAGATE(sb.appendFormat("@%s", info.typeStrings + typeEntry.index));
@@ -481,8 +532,8 @@ ASMJIT_FAVOR_SIZE Error FormatterInternal::formatOperand(
// =====================================================
static constexpr char kImmCharStart = '{';
-static constexpr char kImmCharEnd = '}';
-static constexpr char kImmCharOr = '|';
+static constexpr char kImmCharEnd = '}';
+static constexpr char kImmCharOr = '|';
struct ImmBits {
enum Mode : uint32_t {
@@ -496,29 +547,29 @@ struct ImmBits {
char text[48 - 3];
};
-ASMJIT_FAVOR_SIZE static Error FormatterInternal_formatImmShuf(String& sb, uint32_t u8, uint32_t bits, uint32_t count) noexcept {
+ASMJIT_FAVOR_SIZE static Error FormatterInternal_formatImmShuf(String& sb, uint32_t imm8, uint32_t bits, uint32_t count) noexcept {
uint32_t mask = (1 << bits) - 1;
+ uint32_t lastPredicateShift = bits * (count - 1u);
- for (uint32_t i = 0; i < count; i++, u8 >>= bits) {
- uint32_t value = u8 & mask;
+ for (uint32_t i = 0; i < count; i++, imm8 <<= bits) {
+ uint32_t index = (imm8 >> lastPredicateShift) & mask;
ASMJIT_PROPAGATE(sb.append(i == 0 ? kImmCharStart : kImmCharOr));
- ASMJIT_PROPAGATE(sb.appendUInt(value));
+ ASMJIT_PROPAGATE(sb.appendUInt(index));
}
- if (kImmCharEnd)
- ASMJIT_PROPAGATE(sb.append(kImmCharEnd));
+ ASMJIT_PROPAGATE(sb.append(kImmCharEnd));
return kErrorOk;
}
-ASMJIT_FAVOR_SIZE static Error FormatterInternal_formatImmBits(String& sb, uint32_t u8, const ImmBits* bits, uint32_t count) noexcept {
+ASMJIT_FAVOR_SIZE static Error FormatterInternal_formatImmBits(String& sb, uint32_t imm8, const ImmBits* bits, uint32_t count) noexcept {
uint32_t n = 0;
char buf[64];
for (uint32_t i = 0; i < count; i++) {
const ImmBits& spec = bits[i];
- uint32_t value = (u8 & uint32_t(spec.mask)) >> spec.shift;
+ uint32_t value = (imm8 & uint32_t(spec.mask)) >> spec.shift;
const char* str = nullptr;
switch (spec.mode) {
@@ -542,26 +593,23 @@ ASMJIT_FAVOR_SIZE static Error FormatterInternal_formatImmBits(String& sb, uint3
ASMJIT_PROPAGATE(sb.append(str));
}
- if (n && kImmCharEnd)
+ if (n)
ASMJIT_PROPAGATE(sb.append(kImmCharEnd));
return kErrorOk;
}
-ASMJIT_FAVOR_SIZE static Error FormatterInternal_formatImmText(String& sb, uint32_t u8, uint32_t bits, uint32_t advance, const char* text, uint32_t count = 1) noexcept {
+ASMJIT_FAVOR_SIZE static Error FormatterInternal_formatImmText(String& sb, uint32_t imm8, uint32_t bits, uint32_t advance, const char* text, uint32_t count = 1) noexcept {
uint32_t mask = (1u << bits) - 1;
uint32_t pos = 0;
- for (uint32_t i = 0; i < count; i++, u8 >>= bits, pos += advance) {
- uint32_t value = (u8 & mask) + pos;
+ for (uint32_t i = 0; i < count; i++, imm8 >>= bits, pos += advance) {
+ uint32_t value = (imm8 & mask) + pos;
ASMJIT_PROPAGATE(sb.append(i == 0 ? kImmCharStart : kImmCharOr));
ASMJIT_PROPAGATE(sb.append(Support::findPackedString(text, value)));
}
- if (kImmCharEnd)
- ASMJIT_PROPAGATE(sb.append(kImmCharEnd));
-
- return kErrorOk;
+ return sb.append(kImmCharEnd);
}
ASMJIT_FAVOR_SIZE static Error FormatterInternal_explainConst(
@@ -583,8 +631,8 @@ ASMJIT_FAVOR_SIZE static Error FormatterInternal_explainConst(
static const char vpcmpx[] = "EQ\0" "LT\0" "LE\0" "FALSE\0" "NEQ\0" "GE\0" "GT\0" "TRUE\0";
static const char vpcomx[] = "LT\0" "LE\0" "GT\0" "GE\0" "EQ\0" "NEQ\0" "FALSE\0" "TRUE\0";
- static const char vshufpd[] = "A0\0A1\0B0\0B1\0A2\0A3\0B2\0B3\0A4\0A5\0B4\0B5\0A6\0A7\0B6\0B7\0";
- static const char vshufps[] = "A0\0A1\0A2\0A3\0A0\0A1\0A2\0A3\0B0\0B1\0B2\0B3\0B0\0B1\0B2\0B3\0";
+ static const char vshufpd[] = "A0\0" "A1\0" "B0\0" "B1\0" "A2\0" "A3\0" "B2\0" "B3\0" "A4\0" "A5\0" "B4\0" "B5\0" "A6\0" "A7\0" "B6\0" "B7\0";
+ static const char vshufps[] = "A0\0" "A1\0" "A2\0" "A3\0" "A0\0" "A1\0" "A2\0" "A3\0" "B0\0" "B1\0" "B2\0" "B3\0" "B0\0" "B1\0" "B2\0" "B3\0";
static const ImmBits vfpclassxx[] = {
{ 0x07u, 0, ImmBits::kModeLookup, "QNAN\0" "+0\0" "-0\0" "+INF\0" "-INF\0" "DENORMAL\0" "-FINITE\0" "SNAN\0" }
@@ -608,25 +656,25 @@ ASMJIT_FAVOR_SIZE static Error FormatterInternal_explainConst(
};
static const ImmBits vmpsadbw[] = {
- { 0x04u, 2, ImmBits::kModeLookup, "BLK1[0]\0" "BLK1[1]\0" },
- { 0x03u, 0, ImmBits::kModeLookup, "BLK2[0]\0" "BLK2[1]\0" "BLK2[2]\0" "BLK2[3]\0" },
{ 0x40u, 6, ImmBits::kModeLookup, "BLK1[4]\0" "BLK1[5]\0" },
- { 0x30u, 4, ImmBits::kModeLookup, "BLK2[4]\0" "BLK2[5]\0" "BLK2[6]\0" "BLK2[7]\0" }
+ { 0x30u, 4, ImmBits::kModeLookup, "BLK2[4]\0" "BLK2[5]\0" "BLK2[6]\0" "BLK2[7]\0" },
+ { 0x04u, 2, ImmBits::kModeLookup, "BLK1[0]\0" "BLK1[1]\0" },
+ { 0x03u, 0, ImmBits::kModeLookup, "BLK2[0]\0" "BLK2[1]\0" "BLK2[2]\0" "BLK2[3]\0" }
};
static const ImmBits vpclmulqdq[] = {
- { 0x01u, 0, ImmBits::kModeLookup, "LQ\0" "HQ\0" },
- { 0x10u, 4, ImmBits::kModeLookup, "LQ\0" "HQ\0" }
+ { 0x10u, 4, ImmBits::kModeLookup, "LQ\0" "HQ\0" },
+ { 0x01u, 0, ImmBits::kModeLookup, "LQ\0" "HQ\0" }
};
static const ImmBits vperm2x128[] = {
- { 0x0Bu, 0, ImmBits::kModeLookup, "A0\0" "A1\0" "B0\0" "B1\0" "\0" "\0" "\0" "\0" "0\0" "0\0" "0\0" "0\0" },
- { 0xB0u, 4, ImmBits::kModeLookup, "A0\0" "A1\0" "B0\0" "B1\0" "\0" "\0" "\0" "\0" "0\0" "0\0" "0\0" "0\0" }
+ { 0xB0u, 4, ImmBits::kModeLookup, "A0\0" "A1\0" "B0\0" "B1\0" "\0" "\0" "\0" "\0" "0\0" "0\0" "0\0" "0\0" },
+ { 0x0Bu, 0, ImmBits::kModeLookup, "A0\0" "A1\0" "B0\0" "B1\0" "\0" "\0" "\0" "\0" "0\0" "0\0" "0\0" "0\0" }
};
static const ImmBits vrangexx[] = {
- { 0x03u, 0, ImmBits::kModeLookup, "MIN\0" "MAX\0" "MIN_ABS\0" "MAX_ABS\0" },
- { 0x0Cu, 2, ImmBits::kModeLookup, "SIGN_A\0" "SIGN_B\0" "SIGN_0\0" "SIGN_1\0" }
+ { 0x0Cu, 2, ImmBits::kModeLookup, "SIGN_A\0" "SIGN_B\0" "SIGN_0\0" "SIGN_1\0" },
+ { 0x03u, 0, ImmBits::kModeLookup, "MIN\0" "MAX\0" "MIN_ABS\0" "MAX_ABS\0" }
};
static const ImmBits vreducexx_vrndscalexx[] = {
@@ -881,7 +929,7 @@ ASMJIT_FAVOR_SIZE Error FormatterInternal::formatInstruction(
}
}
- ASMJIT_PROPAGATE(InstInternal::instIdToString(arch, instId, sb));
+ ASMJIT_PROPAGATE(InstInternal::instIdToString(instId, sb));
}
else {
ASMJIT_PROPAGATE(sb.appendFormat("[InstId=#%u]", unsigned(instId)));
@@ -898,7 +946,7 @@ ASMJIT_FAVOR_SIZE Error FormatterInternal::formatInstruction(
uint32_t vecSize = 16;
for (uint32_t j = 0; j < opCount; j++)
if (operands[j].isReg())
- vecSize = Support::max<uint32_t>(vecSize, operands[j].size());
+ vecSize = Support::max<uint32_t>(vecSize, operands[j].as<Reg>().size());
ASMJIT_PROPAGATE(FormatterInternal_explainConst(sb, formatFlags, instId, vecSize, op.as<Imm>()));
}
@@ -941,4 +989,4 @@ ASMJIT_FAVOR_SIZE Error FormatterInternal::formatInstruction(
ASMJIT_END_SUB_NAMESPACE
-#endif // !ASMJIT_NO_LOGGING
+#endif // !ASMJIT_NO_X86 && !ASMJIT_NO_LOGGING
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86func.cpp b/3rdparty/asmjit/src/asmjit/x86/x86func.cpp
index bba9eef148c..ac73aff8bdd 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86func.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86func.cpp
@@ -14,7 +14,7 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
namespace FuncInternal {
-static inline bool shouldThreatAsCDeclIn64BitMode(CallConvId ccId) noexcept {
+static inline bool shouldTreatAsCDeclIn64BitMode(CallConvId ccId) noexcept {
return ccId == CallConvId::kCDecl ||
ccId == CallConvId::kStdCall ||
ccId == CallConvId::kThisCall ||
@@ -143,7 +143,7 @@ ASMJIT_FAVOR_SIZE Error initCallConv(CallConv& cc, CallConvId ccId, const Enviro
// Preprocess the calling convention into a common id as many conventions are normally ignored even by C/C++
// compilers and treated as `__cdecl`.
- if (shouldThreatAsCDeclIn64BitMode(ccId))
+ if (shouldTreatAsCDeclIn64BitMode(ccId))
ccId = winABI ? CallConvId::kX64Windows : CallConvId::kX64SystemV;
switch (ccId) {
@@ -327,7 +327,8 @@ ASMJIT_FAVOR_SIZE Error initFuncDetail(FuncDetail& func, const FuncSignature& si
}
switch (cc.strategy()) {
- case CallConvStrategy::kDefault: {
+ case CallConvStrategy::kDefault:
+ default: {
uint32_t gpzPos = 0;
uint32_t vecPos = 0;
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86globals.h b/3rdparty/asmjit/src/asmjit/x86/x86globals.h
index 803c813ac53..21ed41e87d1 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86globals.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86globals.h
@@ -53,20 +53,23 @@ enum class CondCode : uint8_t {
kNLE = 0x0Fu, //!< ZF==0 & SF==OF (signed > )
kZero = kZ, //!< Zero flag.
- kNotZero = kNZ, //!< Non-zero flag.
+ kNotZero = kNZ, //!< Not zero.
+
+ kEqual = kE, //!< `a == b` (equal).
+ kNotEqual = kNE, //!< `a != b` (not equal).
+
+ kCarry = kC, //!< Carry flag.
+ kNotCarry = kNC, //!< Not carry.
kSign = kS, //!< Sign flag.
- kNotSign = kNS, //!< No sign flag.
+ kNotSign = kNS, //!< Not sign.
kNegative = kS, //!< Sign flag.
- kPositive = kNS, //!< No sign flag.
+ kPositive = kNS, //!< Not sign.
kOverflow = kO, //!< Overflow (signed).
kNotOverflow = kNO, //!< Not overflow (signed).
- kEqual = kE, //!< `a == b` (equal).
- kNotEqual = kNE, //!< `a != b` (not equal).
-
kSignedLT = kL, //!< `a < b` (signed).
kSignedLE = kLE, //!< `a <= b` (signed).
kSignedGT = kG, //!< `a > b` (signed).
@@ -77,6 +80,9 @@ enum class CondCode : uint8_t {
kUnsignedGT = kA, //!< `a > b` (unsigned).
kUnsignedGE = kAE, //!< `a >= b` (unsigned).
+ kBTZero = kNC, //!< Tested bit is zero.
+ kBTNotZero = kC, //!< Tested bit is non-zero.
+
kParityEven = kP, //!< Even parity flag.
kParityOdd = kPO, //!< Odd parity flag.
@@ -105,9 +111,9 @@ static constexpr CondCode _reverseCondTable[] = {
//! \endcond
//! Reverses a condition code (reverses the corresponding operands of a comparison).
-static inline constexpr CondCode reverseCond(CondCode cond) noexcept { return _reverseCondTable[uint8_t(cond)]; }
+static ASMJIT_INLINE_NODEBUG constexpr CondCode reverseCond(CondCode cond) noexcept { return _reverseCondTable[uint8_t(cond)]; }
//! Negates a condition code.
-static inline constexpr CondCode negateCond(CondCode cond) noexcept { return CondCode(uint8_t(cond) ^ 1u); }
+static ASMJIT_INLINE_NODEBUG constexpr CondCode negateCond(CondCode cond) noexcept { return CondCode(uint8_t(cond) ^ 1u); }
//! Instruction.
//!
@@ -119,7 +125,9 @@ namespace Inst {
kIdNone = 0, //!< Invalid instruction id.
kIdAaa, //!< Instruction 'aaa' (X86).
kIdAad, //!< Instruction 'aad' (X86).
+ kIdAadd, //!< Instruction 'aadd' {RAO_INT}.
kIdAam, //!< Instruction 'aam' (X86).
+ kIdAand, //!< Instruction 'aand' {RAO_INT}.
kIdAas, //!< Instruction 'aas' (X86).
kIdAdc, //!< Instruction 'adc'.
kIdAdcx, //!< Instruction 'adcx' {ADX}.
@@ -143,7 +151,9 @@ namespace Inst {
kIdAndnps, //!< Instruction 'andnps' {SSE}.
kIdAndpd, //!< Instruction 'andpd' {SSE2}.
kIdAndps, //!< Instruction 'andps' {SSE}.
+ kIdAor, //!< Instruction 'aor' {RAO_INT}.
kIdArpl, //!< Instruction 'arpl' (X86).
+ kIdAxor, //!< Instruction 'axor' {RAO_INT}.
kIdBextr, //!< Instruction 'bextr' {BMI}.
kIdBlcfill, //!< Instruction 'blcfill' {TBM}.
kIdBlci, //!< Instruction 'blci' {TBM}.
@@ -224,14 +234,30 @@ namespace Inst {
kIdCmovs, //!< Instruction 'cmovs' {CMOV}.
kIdCmovz, //!< Instruction 'cmovz' {CMOV}.
kIdCmp, //!< Instruction 'cmp'.
+ kIdCmpbexadd, //!< Instruction 'cmpbexadd' {CMPCCXADD}.
+ kIdCmpbxadd, //!< Instruction 'cmpbxadd' {CMPCCXADD}.
+ kIdCmplexadd, //!< Instruction 'cmplexadd' {CMPCCXADD}.
+ kIdCmplxadd, //!< Instruction 'cmplxadd' {CMPCCXADD}.
+ kIdCmpnbexadd, //!< Instruction 'cmpnbexadd' {CMPCCXADD}.
+ kIdCmpnbxadd, //!< Instruction 'cmpnbxadd' {CMPCCXADD}.
+ kIdCmpnlexadd, //!< Instruction 'cmpnlexadd' {CMPCCXADD}.
+ kIdCmpnlxadd, //!< Instruction 'cmpnlxadd' {CMPCCXADD}.
+ kIdCmpnoxadd, //!< Instruction 'cmpnoxadd' {CMPCCXADD}.
+ kIdCmpnpxadd, //!< Instruction 'cmpnpxadd' {CMPCCXADD}.
+ kIdCmpnsxadd, //!< Instruction 'cmpnsxadd' {CMPCCXADD}.
+ kIdCmpnzxadd, //!< Instruction 'cmpnzxadd' {CMPCCXADD}.
+ kIdCmpoxadd, //!< Instruction 'cmpoxadd' {CMPCCXADD}.
kIdCmppd, //!< Instruction 'cmppd' {SSE2}.
kIdCmpps, //!< Instruction 'cmpps' {SSE}.
+ kIdCmppxadd, //!< Instruction 'cmppxadd' {CMPCCXADD}.
kIdCmps, //!< Instruction 'cmps'.
kIdCmpsd, //!< Instruction 'cmpsd' {SSE2}.
kIdCmpss, //!< Instruction 'cmpss' {SSE}.
+ kIdCmpsxadd, //!< Instruction 'cmpsxadd' {CMPCCXADD}.
kIdCmpxchg, //!< Instruction 'cmpxchg' {I486}.
kIdCmpxchg16b, //!< Instruction 'cmpxchg16b' {CMPXCHG16B} (X64).
kIdCmpxchg8b, //!< Instruction 'cmpxchg8b' {CMPXCHG8B}.
+ kIdCmpzxadd, //!< Instruction 'cmpzxadd' {CMPCCXADD}.
kIdComisd, //!< Instruction 'comisd' {SSE2}.
kIdComiss, //!< Instruction 'comiss' {SSE}.
kIdCpuid, //!< Instruction 'cpuid' {I486}.
@@ -279,104 +305,104 @@ namespace Inst {
kIdEnter, //!< Instruction 'enter'.
kIdExtractps, //!< Instruction 'extractps' {SSE4_1}.
kIdExtrq, //!< Instruction 'extrq' {SSE4A}.
- kIdF2xm1, //!< Instruction 'f2xm1'.
- kIdFabs, //!< Instruction 'fabs'.
- kIdFadd, //!< Instruction 'fadd'.
- kIdFaddp, //!< Instruction 'faddp'.
- kIdFbld, //!< Instruction 'fbld'.
- kIdFbstp, //!< Instruction 'fbstp'.
- kIdFchs, //!< Instruction 'fchs'.
- kIdFclex, //!< Instruction 'fclex'.
- kIdFcmovb, //!< Instruction 'fcmovb' {CMOV}.
- kIdFcmovbe, //!< Instruction 'fcmovbe' {CMOV}.
- kIdFcmove, //!< Instruction 'fcmove' {CMOV}.
- kIdFcmovnb, //!< Instruction 'fcmovnb' {CMOV}.
- kIdFcmovnbe, //!< Instruction 'fcmovnbe' {CMOV}.
- kIdFcmovne, //!< Instruction 'fcmovne' {CMOV}.
- kIdFcmovnu, //!< Instruction 'fcmovnu' {CMOV}.
- kIdFcmovu, //!< Instruction 'fcmovu' {CMOV}.
- kIdFcom, //!< Instruction 'fcom'.
- kIdFcomi, //!< Instruction 'fcomi'.
- kIdFcomip, //!< Instruction 'fcomip'.
- kIdFcomp, //!< Instruction 'fcomp'.
- kIdFcompp, //!< Instruction 'fcompp'.
- kIdFcos, //!< Instruction 'fcos'.
- kIdFdecstp, //!< Instruction 'fdecstp'.
- kIdFdiv, //!< Instruction 'fdiv'.
- kIdFdivp, //!< Instruction 'fdivp'.
- kIdFdivr, //!< Instruction 'fdivr'.
- kIdFdivrp, //!< Instruction 'fdivrp'.
+ kIdF2xm1, //!< Instruction 'f2xm1' {FPU}.
+ kIdFabs, //!< Instruction 'fabs' {FPU}.
+ kIdFadd, //!< Instruction 'fadd' {FPU}.
+ kIdFaddp, //!< Instruction 'faddp' {FPU}.
+ kIdFbld, //!< Instruction 'fbld' {FPU}.
+ kIdFbstp, //!< Instruction 'fbstp' {FPU}.
+ kIdFchs, //!< Instruction 'fchs' {FPU}.
+ kIdFclex, //!< Instruction 'fclex' {FPU}.
+ kIdFcmovb, //!< Instruction 'fcmovb' {CMOV|FPU}.
+ kIdFcmovbe, //!< Instruction 'fcmovbe' {CMOV|FPU}.
+ kIdFcmove, //!< Instruction 'fcmove' {CMOV|FPU}.
+ kIdFcmovnb, //!< Instruction 'fcmovnb' {CMOV|FPU}.
+ kIdFcmovnbe, //!< Instruction 'fcmovnbe' {CMOV|FPU}.
+ kIdFcmovne, //!< Instruction 'fcmovne' {CMOV|FPU}.
+ kIdFcmovnu, //!< Instruction 'fcmovnu' {CMOV|FPU}.
+ kIdFcmovu, //!< Instruction 'fcmovu' {CMOV|FPU}.
+ kIdFcom, //!< Instruction 'fcom' {FPU}.
+ kIdFcomi, //!< Instruction 'fcomi' {FPU}.
+ kIdFcomip, //!< Instruction 'fcomip' {FPU}.
+ kIdFcomp, //!< Instruction 'fcomp' {FPU}.
+ kIdFcompp, //!< Instruction 'fcompp' {FPU}.
+ kIdFcos, //!< Instruction 'fcos' {FPU}.
+ kIdFdecstp, //!< Instruction 'fdecstp' {FPU}.
+ kIdFdiv, //!< Instruction 'fdiv' {FPU}.
+ kIdFdivp, //!< Instruction 'fdivp' {FPU}.
+ kIdFdivr, //!< Instruction 'fdivr' {FPU}.
+ kIdFdivrp, //!< Instruction 'fdivrp' {FPU}.
kIdFemms, //!< Instruction 'femms' {3DNOW}.
- kIdFfree, //!< Instruction 'ffree'.
- kIdFiadd, //!< Instruction 'fiadd'.
- kIdFicom, //!< Instruction 'ficom'.
- kIdFicomp, //!< Instruction 'ficomp'.
- kIdFidiv, //!< Instruction 'fidiv'.
- kIdFidivr, //!< Instruction 'fidivr'.
- kIdFild, //!< Instruction 'fild'.
- kIdFimul, //!< Instruction 'fimul'.
- kIdFincstp, //!< Instruction 'fincstp'.
- kIdFinit, //!< Instruction 'finit'.
- kIdFist, //!< Instruction 'fist'.
- kIdFistp, //!< Instruction 'fistp'.
- kIdFisttp, //!< Instruction 'fisttp' {SSE3}.
- kIdFisub, //!< Instruction 'fisub'.
- kIdFisubr, //!< Instruction 'fisubr'.
- kIdFld, //!< Instruction 'fld'.
- kIdFld1, //!< Instruction 'fld1'.
- kIdFldcw, //!< Instruction 'fldcw'.
- kIdFldenv, //!< Instruction 'fldenv'.
- kIdFldl2e, //!< Instruction 'fldl2e'.
- kIdFldl2t, //!< Instruction 'fldl2t'.
- kIdFldlg2, //!< Instruction 'fldlg2'.
- kIdFldln2, //!< Instruction 'fldln2'.
- kIdFldpi, //!< Instruction 'fldpi'.
- kIdFldz, //!< Instruction 'fldz'.
- kIdFmul, //!< Instruction 'fmul'.
- kIdFmulp, //!< Instruction 'fmulp'.
- kIdFnclex, //!< Instruction 'fnclex'.
- kIdFninit, //!< Instruction 'fninit'.
- kIdFnop, //!< Instruction 'fnop'.
- kIdFnsave, //!< Instruction 'fnsave'.
- kIdFnstcw, //!< Instruction 'fnstcw'.
- kIdFnstenv, //!< Instruction 'fnstenv'.
- kIdFnstsw, //!< Instruction 'fnstsw'.
- kIdFpatan, //!< Instruction 'fpatan'.
- kIdFprem, //!< Instruction 'fprem'.
- kIdFprem1, //!< Instruction 'fprem1'.
- kIdFptan, //!< Instruction 'fptan'.
- kIdFrndint, //!< Instruction 'frndint'.
- kIdFrstor, //!< Instruction 'frstor'.
- kIdFsave, //!< Instruction 'fsave'.
- kIdFscale, //!< Instruction 'fscale'.
- kIdFsin, //!< Instruction 'fsin'.
- kIdFsincos, //!< Instruction 'fsincos'.
- kIdFsqrt, //!< Instruction 'fsqrt'.
- kIdFst, //!< Instruction 'fst'.
- kIdFstcw, //!< Instruction 'fstcw'.
- kIdFstenv, //!< Instruction 'fstenv'.
- kIdFstp, //!< Instruction 'fstp'.
- kIdFstsw, //!< Instruction 'fstsw'.
- kIdFsub, //!< Instruction 'fsub'.
- kIdFsubp, //!< Instruction 'fsubp'.
- kIdFsubr, //!< Instruction 'fsubr'.
- kIdFsubrp, //!< Instruction 'fsubrp'.
- kIdFtst, //!< Instruction 'ftst'.
- kIdFucom, //!< Instruction 'fucom'.
- kIdFucomi, //!< Instruction 'fucomi'.
- kIdFucomip, //!< Instruction 'fucomip'.
- kIdFucomp, //!< Instruction 'fucomp'.
- kIdFucompp, //!< Instruction 'fucompp'.
- kIdFwait, //!< Instruction 'fwait'.
- kIdFxam, //!< Instruction 'fxam'.
- kIdFxch, //!< Instruction 'fxch'.
+ kIdFfree, //!< Instruction 'ffree' {FPU}.
+ kIdFiadd, //!< Instruction 'fiadd' {FPU}.
+ kIdFicom, //!< Instruction 'ficom' {FPU}.
+ kIdFicomp, //!< Instruction 'ficomp' {FPU}.
+ kIdFidiv, //!< Instruction 'fidiv' {FPU}.
+ kIdFidivr, //!< Instruction 'fidivr' {FPU}.
+ kIdFild, //!< Instruction 'fild' {FPU}.
+ kIdFimul, //!< Instruction 'fimul' {FPU}.
+ kIdFincstp, //!< Instruction 'fincstp' {FPU}.
+ kIdFinit, //!< Instruction 'finit' {FPU}.
+ kIdFist, //!< Instruction 'fist' {FPU}.
+ kIdFistp, //!< Instruction 'fistp' {FPU}.
+ kIdFisttp, //!< Instruction 'fisttp' {SSE3|FPU}.
+ kIdFisub, //!< Instruction 'fisub' {FPU}.
+ kIdFisubr, //!< Instruction 'fisubr' {FPU}.
+ kIdFld, //!< Instruction 'fld' {FPU}.
+ kIdFld1, //!< Instruction 'fld1' {FPU}.
+ kIdFldcw, //!< Instruction 'fldcw' {FPU}.
+ kIdFldenv, //!< Instruction 'fldenv' {FPU}.
+ kIdFldl2e, //!< Instruction 'fldl2e' {FPU}.
+ kIdFldl2t, //!< Instruction 'fldl2t' {FPU}.
+ kIdFldlg2, //!< Instruction 'fldlg2' {FPU}.
+ kIdFldln2, //!< Instruction 'fldln2' {FPU}.
+ kIdFldpi, //!< Instruction 'fldpi' {FPU}.
+ kIdFldz, //!< Instruction 'fldz' {FPU}.
+ kIdFmul, //!< Instruction 'fmul' {FPU}.
+ kIdFmulp, //!< Instruction 'fmulp' {FPU}.
+ kIdFnclex, //!< Instruction 'fnclex' {FPU}.
+ kIdFninit, //!< Instruction 'fninit' {FPU}.
+ kIdFnop, //!< Instruction 'fnop' {FPU}.
+ kIdFnsave, //!< Instruction 'fnsave' {FPU}.
+ kIdFnstcw, //!< Instruction 'fnstcw' {FPU}.
+ kIdFnstenv, //!< Instruction 'fnstenv' {FPU}.
+ kIdFnstsw, //!< Instruction 'fnstsw' {FPU}.
+ kIdFpatan, //!< Instruction 'fpatan' {FPU}.
+ kIdFprem, //!< Instruction 'fprem' {FPU}.
+ kIdFprem1, //!< Instruction 'fprem1' {FPU}.
+ kIdFptan, //!< Instruction 'fptan' {FPU}.
+ kIdFrndint, //!< Instruction 'frndint' {FPU}.
+ kIdFrstor, //!< Instruction 'frstor' {FPU}.
+ kIdFsave, //!< Instruction 'fsave' {FPU}.
+ kIdFscale, //!< Instruction 'fscale' {FPU}.
+ kIdFsin, //!< Instruction 'fsin' {FPU}.
+ kIdFsincos, //!< Instruction 'fsincos' {FPU}.
+ kIdFsqrt, //!< Instruction 'fsqrt' {FPU}.
+ kIdFst, //!< Instruction 'fst' {FPU}.
+ kIdFstcw, //!< Instruction 'fstcw' {FPU}.
+ kIdFstenv, //!< Instruction 'fstenv' {FPU}.
+ kIdFstp, //!< Instruction 'fstp' {FPU}.
+ kIdFstsw, //!< Instruction 'fstsw' {FPU}.
+ kIdFsub, //!< Instruction 'fsub' {FPU}.
+ kIdFsubp, //!< Instruction 'fsubp' {FPU}.
+ kIdFsubr, //!< Instruction 'fsubr' {FPU}.
+ kIdFsubrp, //!< Instruction 'fsubrp' {FPU}.
+ kIdFtst, //!< Instruction 'ftst' {FPU}.
+ kIdFucom, //!< Instruction 'fucom' {FPU}.
+ kIdFucomi, //!< Instruction 'fucomi' {FPU}.
+ kIdFucomip, //!< Instruction 'fucomip' {FPU}.
+ kIdFucomp, //!< Instruction 'fucomp' {FPU}.
+ kIdFucompp, //!< Instruction 'fucompp' {FPU}.
+ kIdFwait, //!< Instruction 'fwait' {FPU}.
+ kIdFxam, //!< Instruction 'fxam' {FPU}.
+ kIdFxch, //!< Instruction 'fxch' {FPU}.
kIdFxrstor, //!< Instruction 'fxrstor' {FXSR}.
kIdFxrstor64, //!< Instruction 'fxrstor64' {FXSR} (X64).
kIdFxsave, //!< Instruction 'fxsave' {FXSR}.
kIdFxsave64, //!< Instruction 'fxsave64' {FXSR} (X64).
- kIdFxtract, //!< Instruction 'fxtract'.
- kIdFyl2x, //!< Instruction 'fyl2x'.
- kIdFyl2xp1, //!< Instruction 'fyl2xp1'.
+ kIdFxtract, //!< Instruction 'fxtract' {FPU}.
+ kIdFyl2x, //!< Instruction 'fyl2x' {FPU}.
+ kIdFyl2xp1, //!< Instruction 'fyl2xp1' {FPU}.
kIdGetsec, //!< Instruction 'getsec' {SMX}.
kIdGf2p8affineinvqb, //!< Instruction 'gf2p8affineinvqb' {GFNI}.
kIdGf2p8affineqb, //!< Instruction 'gf2p8affineqb' {GFNI}.
@@ -403,6 +429,7 @@ namespace Inst {
kIdInvept, //!< Instruction 'invept' {VMX}.
kIdInvlpg, //!< Instruction 'invlpg' {I486}.
kIdInvlpga, //!< Instruction 'invlpga' {SVM}.
+ kIdInvlpgb, //!< Instruction 'invlpgb' {INVLPGB}.
kIdInvpcid, //!< Instruction 'invpcid' {I486}.
kIdInvvpid, //!< Instruction 'invvpid' {VMX}.
kIdIret, //!< Instruction 'iret'.
@@ -535,7 +562,7 @@ namespace Inst {
kIdMonitor, //!< Instruction 'monitor' {MONITOR}.
kIdMonitorx, //!< Instruction 'monitorx' {MONITORX}.
kIdMov, //!< Instruction 'mov'.
- kIdMovabs, //!< Instruction 'movabs' (X64).
+ kIdMovabs, //!< Instruction 'movabs'.
kIdMovapd, //!< Instruction 'movapd' {SSE2}.
kIdMovaps, //!< Instruction 'movaps' {SSE}.
kIdMovbe, //!< Instruction 'movbe' {MOVBE}.
@@ -606,7 +633,7 @@ namespace Inst {
kIdPaddusb, //!< Instruction 'paddusb' {MMX|SSE2}.
kIdPaddusw, //!< Instruction 'paddusw' {MMX|SSE2}.
kIdPaddw, //!< Instruction 'paddw' {MMX|SSE2}.
- kIdPalignr, //!< Instruction 'palignr' {SSE3}.
+ kIdPalignr, //!< Instruction 'palignr' {SSSE3}.
kIdPand, //!< Instruction 'pand' {MMX|SSE2}.
kIdPandn, //!< Instruction 'pandn' {MMX|SSE2}.
kIdPause, //!< Instruction 'pause'.
@@ -713,10 +740,12 @@ namespace Inst {
kIdPopfq, //!< Instruction 'popfq' (X64).
kIdPor, //!< Instruction 'por' {MMX|SSE2}.
kIdPrefetch, //!< Instruction 'prefetch' {3DNOW}.
- kIdPrefetchnta, //!< Instruction 'prefetchnta' {MMX2}.
- kIdPrefetcht0, //!< Instruction 'prefetcht0' {MMX2}.
- kIdPrefetcht1, //!< Instruction 'prefetcht1' {MMX2}.
- kIdPrefetcht2, //!< Instruction 'prefetcht2' {MMX2}.
+ kIdPrefetchit0, //!< Instruction 'prefetchit0' {PREFETCHI} (X64).
+ kIdPrefetchit1, //!< Instruction 'prefetchit1' {PREFETCHI} (X64).
+ kIdPrefetchnta, //!< Instruction 'prefetchnta' {SSE}.
+ kIdPrefetcht0, //!< Instruction 'prefetcht0' {SSE}.
+ kIdPrefetcht1, //!< Instruction 'prefetcht1' {SSE}.
+ kIdPrefetcht2, //!< Instruction 'prefetcht2' {SSE}.
kIdPrefetchw, //!< Instruction 'prefetchw' {PREFETCHW}.
kIdPrefetchwt1, //!< Instruction 'prefetchwt1' {PREFETCHWT1}.
kIdPsadbw, //!< Instruction 'psadbw' {MMX2|SSE2}.
@@ -732,7 +761,7 @@ namespace Inst {
kIdPslldq, //!< Instruction 'pslldq' {SSE2}.
kIdPsllq, //!< Instruction 'psllq' {MMX|SSE2}.
kIdPsllw, //!< Instruction 'psllw' {MMX|SSE2}.
- kIdPsmash, //!< Instruction 'psmash' {SNP} (X64).
+ kIdPsmash, //!< Instruction 'psmash' {SEV_SNP} (X64).
kIdPsrad, //!< Instruction 'psrad' {MMX|SSE2}.
kIdPsraw, //!< Instruction 'psraw' {MMX|SSE2}.
kIdPsrld, //!< Instruction 'psrld' {MMX|SSE2}.
@@ -764,7 +793,7 @@ namespace Inst {
kIdPushf, //!< Instruction 'pushf'.
kIdPushfd, //!< Instruction 'pushfd' (X86).
kIdPushfq, //!< Instruction 'pushfq' (X64).
- kIdPvalidate, //!< Instruction 'pvalidate' {SNP}.
+ kIdPvalidate, //!< Instruction 'pvalidate' {SEV_SNP}.
kIdPxor, //!< Instruction 'pxor' {MMX|SSE2}.
kIdRcl, //!< Instruction 'rcl'.
kIdRcpps, //!< Instruction 'rcpps' {SSE}.
@@ -785,8 +814,8 @@ namespace Inst {
kIdRdtscp, //!< Instruction 'rdtscp' {RDTSCP}.
kIdRet, //!< Instruction 'ret'.
kIdRetf, //!< Instruction 'retf'.
- kIdRmpadjust, //!< Instruction 'rmpadjust' {SNP} (X64).
- kIdRmpupdate, //!< Instruction 'rmpupdate' {SNP} (X64).
+ kIdRmpadjust, //!< Instruction 'rmpadjust' {SEV_SNP} (X64).
+ kIdRmpupdate, //!< Instruction 'rmpupdate' {SEV_SNP} (X64).
kIdRol, //!< Instruction 'rol'.
kIdRor, //!< Instruction 'ror'.
kIdRorx, //!< Instruction 'rorx' {BMI2}.
@@ -805,6 +834,9 @@ namespace Inst {
kIdSaveprevssp, //!< Instruction 'saveprevssp' {CET_SS}.
kIdSbb, //!< Instruction 'sbb'.
kIdScas, //!< Instruction 'scas'.
+ kIdSeamcall, //!< Instruction 'seamcall' {SEAM}.
+ kIdSeamops, //!< Instruction 'seamops' {SEAM}.
+ kIdSeamret, //!< Instruction 'seamret' {SEAM}.
kIdSenduipi, //!< Instruction 'senduipi' {UINTR} (X64).
kIdSerialize, //!< Instruction 'serialize' {SERIALIZE}.
kIdSeta, //!< Instruction 'seta'.
@@ -838,7 +870,7 @@ namespace Inst {
kIdSets, //!< Instruction 'sets'.
kIdSetssbsy, //!< Instruction 'setssbsy' {CET_SS}.
kIdSetz, //!< Instruction 'setz'.
- kIdSfence, //!< Instruction 'sfence' {MMX2}.
+ kIdSfence, //!< Instruction 'sfence' {SSE}.
kIdSgdt, //!< Instruction 'sgdt'.
kIdSha1msg1, //!< Instruction 'sha1msg1' {SHA}.
kIdSha1msg2, //!< Instruction 'sha1msg2' {SHA}.
@@ -883,15 +915,19 @@ namespace Inst {
kIdSyscall, //!< Instruction 'syscall' (X64).
kIdSysenter, //!< Instruction 'sysenter'.
kIdSysexit, //!< Instruction 'sysexit'.
- kIdSysexitq, //!< Instruction 'sysexitq'.
+ kIdSysexitq, //!< Instruction 'sysexitq' (X64).
kIdSysret, //!< Instruction 'sysret' (X64).
kIdSysretq, //!< Instruction 'sysretq' (X64).
kIdT1mskc, //!< Instruction 't1mskc' {TBM}.
+ kIdTcmmimfp16ps, //!< Instruction 'tcmmimfp16ps' {AMX_COMPLEX} (X64).
+ kIdTcmmrlfp16ps, //!< Instruction 'tcmmrlfp16ps' {AMX_COMPLEX} (X64).
+ kIdTdcall, //!< Instruction 'tdcall' {SEAM}.
kIdTdpbf16ps, //!< Instruction 'tdpbf16ps' {AMX_BF16} (X64).
kIdTdpbssd, //!< Instruction 'tdpbssd' {AMX_INT8} (X64).
kIdTdpbsud, //!< Instruction 'tdpbsud' {AMX_INT8} (X64).
kIdTdpbusd, //!< Instruction 'tdpbusd' {AMX_INT8} (X64).
kIdTdpbuud, //!< Instruction 'tdpbuud' {AMX_INT8} (X64).
+ kIdTdpfp16ps, //!< Instruction 'tdpfp16ps' {AMX_FP16} (X64).
kIdTest, //!< Instruction 'test'.
kIdTestui, //!< Instruction 'testui' {UINTR} (X64).
kIdTileloadd, //!< Instruction 'tileloadd' {AMX_TILE} (X64).
@@ -899,6 +935,7 @@ namespace Inst {
kIdTilerelease, //!< Instruction 'tilerelease' {AMX_TILE} (X64).
kIdTilestored, //!< Instruction 'tilestored' {AMX_TILE} (X64).
kIdTilezero, //!< Instruction 'tilezero' {AMX_TILE} (X64).
+ kIdTlbsync, //!< Instruction 'tlbsync' {INVLPGB}.
kIdTpause, //!< Instruction 'tpause' {WAITPKG}.
kIdTzcnt, //!< Instruction 'tzcnt' {BMI}.
kIdTzmsk, //!< Instruction 'tzmsk' {TBM}.
@@ -938,6 +975,8 @@ namespace Inst {
kIdVandnps, //!< Instruction 'vandnps' {AVX|AVX512_DQ+VL}.
kIdVandpd, //!< Instruction 'vandpd' {AVX|AVX512_DQ+VL}.
kIdVandps, //!< Instruction 'vandps' {AVX|AVX512_DQ+VL}.
+ kIdVbcstnebf162ps, //!< Instruction 'vbcstnebf162ps' {AVX_NE_CONVERT}.
+ kIdVbcstnesh2ps, //!< Instruction 'vbcstnesh2ps' {AVX_NE_CONVERT}.
kIdVblendmpd, //!< Instruction 'vblendmpd' {AVX512_F+VL}.
kIdVblendmps, //!< Instruction 'vblendmps' {AVX512_F+VL}.
kIdVblendpd, //!< Instruction 'vblendpd' {AVX}.
@@ -973,7 +1012,11 @@ namespace Inst {
kIdVcvtdq2ph, //!< Instruction 'vcvtdq2ph' {AVX512_FP16+VL}.
kIdVcvtdq2ps, //!< Instruction 'vcvtdq2ps' {AVX|AVX512_F+VL}.
kIdVcvtne2ps2bf16, //!< Instruction 'vcvtne2ps2bf16' {AVX512_BF16+VL}.
- kIdVcvtneps2bf16, //!< Instruction 'vcvtneps2bf16' {AVX512_BF16+VL}.
+ kIdVcvtneebf162ps, //!< Instruction 'vcvtneebf162ps' {AVX_NE_CONVERT}.
+ kIdVcvtneeph2ps, //!< Instruction 'vcvtneeph2ps' {AVX_NE_CONVERT}.
+ kIdVcvtneobf162ps, //!< Instruction 'vcvtneobf162ps' {AVX_NE_CONVERT}.
+ kIdVcvtneoph2ps, //!< Instruction 'vcvtneoph2ps' {AVX_NE_CONVERT}.
+ kIdVcvtneps2bf16, //!< Instruction 'vcvtneps2bf16' {AVX_NE_CONVERT|AVX512_BF16+VL}.
kIdVcvtpd2dq, //!< Instruction 'vcvtpd2dq' {AVX|AVX512_F+VL}.
kIdVcvtpd2ph, //!< Instruction 'vcvtpd2ph' {AVX512_FP16+VL}.
kIdVcvtpd2ps, //!< Instruction 'vcvtpd2ps' {AVX|AVX512_F+VL}.
@@ -1057,8 +1100,8 @@ namespace Inst {
kIdVdpps, //!< Instruction 'vdpps' {AVX}.
kIdVerr, //!< Instruction 'verr'.
kIdVerw, //!< Instruction 'verw'.
- kIdVexp2pd, //!< Instruction 'vexp2pd' {AVX512_ERI}.
- kIdVexp2ps, //!< Instruction 'vexp2ps' {AVX512_ERI}.
+ kIdVexp2pd, //!< Instruction 'vexp2pd' {AVX512_ER}.
+ kIdVexp2ps, //!< Instruction 'vexp2ps' {AVX512_ER}.
kIdVexpandpd, //!< Instruction 'vexpandpd' {AVX512_F+VL}.
kIdVexpandps, //!< Instruction 'vexpandps' {AVX512_F+VL}.
kIdVextractf128, //!< Instruction 'vextractf128' {AVX}.
@@ -1073,9 +1116,9 @@ namespace Inst {
kIdVextracti64x4, //!< Instruction 'vextracti64x4' {AVX512_F}.
kIdVextractps, //!< Instruction 'vextractps' {AVX|AVX512_F}.
kIdVfcmaddcph, //!< Instruction 'vfcmaddcph' {AVX512_FP16+VL}.
- kIdVfcmaddcsh, //!< Instruction 'vfcmaddcsh' {AVX512_FP16+VL}.
+ kIdVfcmaddcsh, //!< Instruction 'vfcmaddcsh' {AVX512_FP16}.
kIdVfcmulcph, //!< Instruction 'vfcmulcph' {AVX512_FP16+VL}.
- kIdVfcmulcsh, //!< Instruction 'vfcmulcsh' {AVX512_FP16+VL}.
+ kIdVfcmulcsh, //!< Instruction 'vfcmulcsh' {AVX512_FP16}.
kIdVfixupimmpd, //!< Instruction 'vfixupimmpd' {AVX512_F+VL}.
kIdVfixupimmps, //!< Instruction 'vfixupimmps' {AVX512_F+VL}.
kIdVfixupimmsd, //!< Instruction 'vfixupimmsd' {AVX512_F}.
@@ -1099,7 +1142,7 @@ namespace Inst {
kIdVfmadd231sh, //!< Instruction 'vfmadd231sh' {AVX512_FP16}.
kIdVfmadd231ss, //!< Instruction 'vfmadd231ss' {FMA|AVX512_F}.
kIdVfmaddcph, //!< Instruction 'vfmaddcph' {AVX512_FP16+VL}.
- kIdVfmaddcsh, //!< Instruction 'vfmaddcsh' {AVX512_FP16+VL}.
+ kIdVfmaddcsh, //!< Instruction 'vfmaddcsh' {AVX512_FP16}.
kIdVfmaddpd, //!< Instruction 'vfmaddpd' {FMA4}.
kIdVfmaddps, //!< Instruction 'vfmaddps' {FMA4}.
kIdVfmaddsd, //!< Instruction 'vfmaddsd' {FMA4}.
@@ -1206,14 +1249,14 @@ namespace Inst {
kIdVfrczss, //!< Instruction 'vfrczss' {XOP}.
kIdVgatherdpd, //!< Instruction 'vgatherdpd' {AVX2|AVX512_F+VL}.
kIdVgatherdps, //!< Instruction 'vgatherdps' {AVX2|AVX512_F+VL}.
- kIdVgatherpf0dpd, //!< Instruction 'vgatherpf0dpd' {AVX512_PFI}.
- kIdVgatherpf0dps, //!< Instruction 'vgatherpf0dps' {AVX512_PFI}.
- kIdVgatherpf0qpd, //!< Instruction 'vgatherpf0qpd' {AVX512_PFI}.
- kIdVgatherpf0qps, //!< Instruction 'vgatherpf0qps' {AVX512_PFI}.
- kIdVgatherpf1dpd, //!< Instruction 'vgatherpf1dpd' {AVX512_PFI}.
- kIdVgatherpf1dps, //!< Instruction 'vgatherpf1dps' {AVX512_PFI}.
- kIdVgatherpf1qpd, //!< Instruction 'vgatherpf1qpd' {AVX512_PFI}.
- kIdVgatherpf1qps, //!< Instruction 'vgatherpf1qps' {AVX512_PFI}.
+ kIdVgatherpf0dpd, //!< Instruction 'vgatherpf0dpd' {AVX512_PF}.
+ kIdVgatherpf0dps, //!< Instruction 'vgatherpf0dps' {AVX512_PF}.
+ kIdVgatherpf0qpd, //!< Instruction 'vgatherpf0qpd' {AVX512_PF}.
+ kIdVgatherpf0qps, //!< Instruction 'vgatherpf0qps' {AVX512_PF}.
+ kIdVgatherpf1dpd, //!< Instruction 'vgatherpf1dpd' {AVX512_PF}.
+ kIdVgatherpf1dps, //!< Instruction 'vgatherpf1dps' {AVX512_PF}.
+ kIdVgatherpf1qpd, //!< Instruction 'vgatherpf1qpd' {AVX512_PF}.
+ kIdVgatherpf1qps, //!< Instruction 'vgatherpf1qps' {AVX512_PF}.
kIdVgatherqpd, //!< Instruction 'vgatherqpd' {AVX2|AVX512_F+VL}.
kIdVgatherqps, //!< Instruction 'vgatherqps' {AVX2|AVX512_F+VL}.
kIdVgetexppd, //!< Instruction 'vgetexppd' {AVX512_F+VL}.
@@ -1254,18 +1297,19 @@ namespace Inst {
kIdVmaxpd, //!< Instruction 'vmaxpd' {AVX|AVX512_F+VL}.
kIdVmaxph, //!< Instruction 'vmaxph' {AVX512_FP16+VL}.
kIdVmaxps, //!< Instruction 'vmaxps' {AVX|AVX512_F+VL}.
- kIdVmaxsd, //!< Instruction 'vmaxsd' {AVX|AVX512_F+VL}.
+ kIdVmaxsd, //!< Instruction 'vmaxsd' {AVX|AVX512_F}.
kIdVmaxsh, //!< Instruction 'vmaxsh' {AVX512_FP16}.
- kIdVmaxss, //!< Instruction 'vmaxss' {AVX|AVX512_F+VL}.
+ kIdVmaxss, //!< Instruction 'vmaxss' {AVX|AVX512_F}.
kIdVmcall, //!< Instruction 'vmcall' {VMX}.
kIdVmclear, //!< Instruction 'vmclear' {VMX}.
kIdVmfunc, //!< Instruction 'vmfunc' {VMX}.
+ kIdVmgexit, //!< Instruction 'vmgexit' {SEV_ES}.
kIdVminpd, //!< Instruction 'vminpd' {AVX|AVX512_F+VL}.
kIdVminph, //!< Instruction 'vminph' {AVX512_FP16+VL}.
kIdVminps, //!< Instruction 'vminps' {AVX|AVX512_F+VL}.
- kIdVminsd, //!< Instruction 'vminsd' {AVX|AVX512_F+VL}.
+ kIdVminsd, //!< Instruction 'vminsd' {AVX|AVX512_F}.
kIdVminsh, //!< Instruction 'vminsh' {AVX512_FP16}.
- kIdVminss, //!< Instruction 'vminss' {AVX|AVX512_F+VL}.
+ kIdVminss, //!< Instruction 'vminss' {AVX|AVX512_F}.
kIdVmlaunch, //!< Instruction 'vmlaunch' {VMX}.
kIdVmload, //!< Instruction 'vmload' {SVM}.
kIdVmmcall, //!< Instruction 'vmmcall' {SVM}.
@@ -1316,11 +1360,12 @@ namespace Inst {
kIdVmulsh, //!< Instruction 'vmulsh' {AVX512_FP16}.
kIdVmulss, //!< Instruction 'vmulss' {AVX|AVX512_F}.
kIdVmwrite, //!< Instruction 'vmwrite' {VMX}.
+ kIdVmxoff, //!< Instruction 'vmxoff' {VMX}.
kIdVmxon, //!< Instruction 'vmxon' {VMX}.
kIdVorpd, //!< Instruction 'vorpd' {AVX|AVX512_DQ+VL}.
kIdVorps, //!< Instruction 'vorps' {AVX|AVX512_DQ+VL}.
- kIdVp2intersectd, //!< Instruction 'vp2intersectd' {AVX512_VP2INTERSECT}.
- kIdVp2intersectq, //!< Instruction 'vp2intersectq' {AVX512_VP2INTERSECT}.
+ kIdVp2intersectd, //!< Instruction 'vp2intersectd' {AVX512_VP2INTERSECT+VL}.
+ kIdVp2intersectq, //!< Instruction 'vp2intersectq' {AVX512_VP2INTERSECT+VL}.
kIdVp4dpwssd, //!< Instruction 'vp4dpwssd' {AVX512_4VNNIW}.
kIdVp4dpwssds, //!< Instruction 'vp4dpwssds' {AVX512_4VNNIW}.
kIdVpabsb, //!< Instruction 'vpabsb' {AVX|AVX2|AVX512_BW+VL}.
@@ -1357,8 +1402,8 @@ namespace Inst {
kIdVpblendw, //!< Instruction 'vpblendw' {AVX|AVX2}.
kIdVpbroadcastb, //!< Instruction 'vpbroadcastb' {AVX2|AVX512_BW+VL}.
kIdVpbroadcastd, //!< Instruction 'vpbroadcastd' {AVX2|AVX512_F+VL}.
- kIdVpbroadcastmb2q, //!< Instruction 'vpbroadcastmb2q' {AVX512_CDI+VL}.
- kIdVpbroadcastmw2d, //!< Instruction 'vpbroadcastmw2d' {AVX512_CDI+VL}.
+ kIdVpbroadcastmb2q, //!< Instruction 'vpbroadcastmb2q' {AVX512_CD+VL}.
+ kIdVpbroadcastmw2d, //!< Instruction 'vpbroadcastmw2d' {AVX512_CD+VL}.
kIdVpbroadcastq, //!< Instruction 'vpbroadcastq' {AVX2|AVX512_F+VL}.
kIdVpbroadcastw, //!< Instruction 'vpbroadcastw' {AVX2|AVX512_BW+VL}.
kIdVpclmulqdq, //!< Instruction 'vpclmulqdq' {AVX|AVX512_F+VL & PCLMULQDQ|VPCLMULQDQ}.
@@ -1395,12 +1440,24 @@ namespace Inst {
kIdVpcomuq, //!< Instruction 'vpcomuq' {XOP}.
kIdVpcomuw, //!< Instruction 'vpcomuw' {XOP}.
kIdVpcomw, //!< Instruction 'vpcomw' {XOP}.
- kIdVpconflictd, //!< Instruction 'vpconflictd' {AVX512_CDI+VL}.
- kIdVpconflictq, //!< Instruction 'vpconflictq' {AVX512_CDI+VL}.
+ kIdVpconflictd, //!< Instruction 'vpconflictd' {AVX512_CD+VL}.
+ kIdVpconflictq, //!< Instruction 'vpconflictq' {AVX512_CD+VL}.
+ kIdVpdpbssd, //!< Instruction 'vpdpbssd' {AVX_VNNI_INT8}.
+ kIdVpdpbssds, //!< Instruction 'vpdpbssds' {AVX_VNNI_INT8}.
+ kIdVpdpbsud, //!< Instruction 'vpdpbsud' {AVX_VNNI_INT8}.
+ kIdVpdpbsuds, //!< Instruction 'vpdpbsuds' {AVX_VNNI_INT8}.
kIdVpdpbusd, //!< Instruction 'vpdpbusd' {AVX_VNNI|AVX512_VNNI+VL}.
kIdVpdpbusds, //!< Instruction 'vpdpbusds' {AVX_VNNI|AVX512_VNNI+VL}.
+ kIdVpdpbuud, //!< Instruction 'vpdpbuud' {AVX_VNNI_INT8}.
+ kIdVpdpbuuds, //!< Instruction 'vpdpbuuds' {AVX_VNNI_INT8}.
kIdVpdpwssd, //!< Instruction 'vpdpwssd' {AVX_VNNI|AVX512_VNNI+VL}.
kIdVpdpwssds, //!< Instruction 'vpdpwssds' {AVX_VNNI|AVX512_VNNI+VL}.
+ kIdVpdpwsud, //!< Instruction 'vpdpwsud' {AVX_VNNI_INT16}.
+ kIdVpdpwsuds, //!< Instruction 'vpdpwsuds' {AVX_VNNI_INT16}.
+ kIdVpdpwusd, //!< Instruction 'vpdpwusd' {AVX_VNNI_INT16}.
+ kIdVpdpwusds, //!< Instruction 'vpdpwusds' {AVX_VNNI_INT16}.
+ kIdVpdpwuud, //!< Instruction 'vpdpwuud' {AVX_VNNI_INT16}.
+ kIdVpdpwuuds, //!< Instruction 'vpdpwuuds' {AVX_VNNI_INT16}.
kIdVperm2f128, //!< Instruction 'vperm2f128' {AVX}.
kIdVperm2i128, //!< Instruction 'vperm2i128' {AVX2}.
kIdVpermb, //!< Instruction 'vpermb' {AVX512_VBMI+VL}.
@@ -1463,8 +1520,8 @@ namespace Inst {
kIdVpinsrd, //!< Instruction 'vpinsrd' {AVX|AVX512_DQ}.
kIdVpinsrq, //!< Instruction 'vpinsrq' {AVX|AVX512_DQ} (X64).
kIdVpinsrw, //!< Instruction 'vpinsrw' {AVX|AVX512_BW}.
- kIdVplzcntd, //!< Instruction 'vplzcntd' {AVX512_CDI+VL}.
- kIdVplzcntq, //!< Instruction 'vplzcntq' {AVX512_CDI+VL}.
+ kIdVplzcntd, //!< Instruction 'vplzcntd' {AVX512_CD+VL}.
+ kIdVplzcntq, //!< Instruction 'vplzcntq' {AVX512_CD+VL}.
kIdVpmacsdd, //!< Instruction 'vpmacsdd' {XOP}.
kIdVpmacsdqh, //!< Instruction 'vpmacsdqh' {XOP}.
kIdVpmacsdql, //!< Instruction 'vpmacsdql' {XOP}.
@@ -1477,8 +1534,8 @@ namespace Inst {
kIdVpmacsww, //!< Instruction 'vpmacsww' {XOP}.
kIdVpmadcsswd, //!< Instruction 'vpmadcsswd' {XOP}.
kIdVpmadcswd, //!< Instruction 'vpmadcswd' {XOP}.
- kIdVpmadd52huq, //!< Instruction 'vpmadd52huq' {AVX512_IFMA+VL}.
- kIdVpmadd52luq, //!< Instruction 'vpmadd52luq' {AVX512_IFMA+VL}.
+ kIdVpmadd52huq, //!< Instruction 'vpmadd52huq' {AVX_IFMA|AVX512_IFMA+VL}.
+ kIdVpmadd52luq, //!< Instruction 'vpmadd52luq' {AVX_IFMA|AVX512_IFMA+VL}.
kIdVpmaddubsw, //!< Instruction 'vpmaddubsw' {AVX|AVX2|AVX512_BW+VL}.
kIdVpmaddwd, //!< Instruction 'vpmaddwd' {AVX|AVX2|AVX512_BW+VL}.
kIdVpmaskmovd, //!< Instruction 'vpmaskmovd' {AVX2}.
@@ -1658,10 +1715,10 @@ namespace Inst {
kIdVrcp14ps, //!< Instruction 'vrcp14ps' {AVX512_F+VL}.
kIdVrcp14sd, //!< Instruction 'vrcp14sd' {AVX512_F}.
kIdVrcp14ss, //!< Instruction 'vrcp14ss' {AVX512_F}.
- kIdVrcp28pd, //!< Instruction 'vrcp28pd' {AVX512_ERI}.
- kIdVrcp28ps, //!< Instruction 'vrcp28ps' {AVX512_ERI}.
- kIdVrcp28sd, //!< Instruction 'vrcp28sd' {AVX512_ERI}.
- kIdVrcp28ss, //!< Instruction 'vrcp28ss' {AVX512_ERI}.
+ kIdVrcp28pd, //!< Instruction 'vrcp28pd' {AVX512_ER}.
+ kIdVrcp28ps, //!< Instruction 'vrcp28ps' {AVX512_ER}.
+ kIdVrcp28sd, //!< Instruction 'vrcp28sd' {AVX512_ER}.
+ kIdVrcp28ss, //!< Instruction 'vrcp28ss' {AVX512_ER}.
kIdVrcpph, //!< Instruction 'vrcpph' {AVX512_FP16}.
kIdVrcpps, //!< Instruction 'vrcpps' {AVX}.
kIdVrcpsh, //!< Instruction 'vrcpsh' {AVX512_FP16}.
@@ -1686,10 +1743,10 @@ namespace Inst {
kIdVrsqrt14ps, //!< Instruction 'vrsqrt14ps' {AVX512_F+VL}.
kIdVrsqrt14sd, //!< Instruction 'vrsqrt14sd' {AVX512_F}.
kIdVrsqrt14ss, //!< Instruction 'vrsqrt14ss' {AVX512_F}.
- kIdVrsqrt28pd, //!< Instruction 'vrsqrt28pd' {AVX512_ERI}.
- kIdVrsqrt28ps, //!< Instruction 'vrsqrt28ps' {AVX512_ERI}.
- kIdVrsqrt28sd, //!< Instruction 'vrsqrt28sd' {AVX512_ERI}.
- kIdVrsqrt28ss, //!< Instruction 'vrsqrt28ss' {AVX512_ERI}.
+ kIdVrsqrt28pd, //!< Instruction 'vrsqrt28pd' {AVX512_ER}.
+ kIdVrsqrt28ps, //!< Instruction 'vrsqrt28ps' {AVX512_ER}.
+ kIdVrsqrt28sd, //!< Instruction 'vrsqrt28sd' {AVX512_ER}.
+ kIdVrsqrt28ss, //!< Instruction 'vrsqrt28ss' {AVX512_ER}.
kIdVrsqrtph, //!< Instruction 'vrsqrtph' {AVX512_FP16+VL}.
kIdVrsqrtps, //!< Instruction 'vrsqrtps' {AVX}.
kIdVrsqrtsh, //!< Instruction 'vrsqrtsh' {AVX512_FP16}.
@@ -1702,22 +1759,30 @@ namespace Inst {
kIdVscalefss, //!< Instruction 'vscalefss' {AVX512_F}.
kIdVscatterdpd, //!< Instruction 'vscatterdpd' {AVX512_F+VL}.
kIdVscatterdps, //!< Instruction 'vscatterdps' {AVX512_F+VL}.
- kIdVscatterpf0dpd, //!< Instruction 'vscatterpf0dpd' {AVX512_PFI}.
- kIdVscatterpf0dps, //!< Instruction 'vscatterpf0dps' {AVX512_PFI}.
- kIdVscatterpf0qpd, //!< Instruction 'vscatterpf0qpd' {AVX512_PFI}.
- kIdVscatterpf0qps, //!< Instruction 'vscatterpf0qps' {AVX512_PFI}.
- kIdVscatterpf1dpd, //!< Instruction 'vscatterpf1dpd' {AVX512_PFI}.
- kIdVscatterpf1dps, //!< Instruction 'vscatterpf1dps' {AVX512_PFI}.
- kIdVscatterpf1qpd, //!< Instruction 'vscatterpf1qpd' {AVX512_PFI}.
- kIdVscatterpf1qps, //!< Instruction 'vscatterpf1qps' {AVX512_PFI}.
+ kIdVscatterpf0dpd, //!< Instruction 'vscatterpf0dpd' {AVX512_PF}.
+ kIdVscatterpf0dps, //!< Instruction 'vscatterpf0dps' {AVX512_PF}.
+ kIdVscatterpf0qpd, //!< Instruction 'vscatterpf0qpd' {AVX512_PF}.
+ kIdVscatterpf0qps, //!< Instruction 'vscatterpf0qps' {AVX512_PF}.
+ kIdVscatterpf1dpd, //!< Instruction 'vscatterpf1dpd' {AVX512_PF}.
+ kIdVscatterpf1dps, //!< Instruction 'vscatterpf1dps' {AVX512_PF}.
+ kIdVscatterpf1qpd, //!< Instruction 'vscatterpf1qpd' {AVX512_PF}.
+ kIdVscatterpf1qps, //!< Instruction 'vscatterpf1qps' {AVX512_PF}.
kIdVscatterqpd, //!< Instruction 'vscatterqpd' {AVX512_F+VL}.
kIdVscatterqps, //!< Instruction 'vscatterqps' {AVX512_F+VL}.
+ kIdVsha512msg1, //!< Instruction 'vsha512msg1' {AVX & SHA512}.
+ kIdVsha512msg2, //!< Instruction 'vsha512msg2' {AVX & SHA512}.
+ kIdVsha512rnds2, //!< Instruction 'vsha512rnds2' {AVX & SHA512}.
kIdVshuff32x4, //!< Instruction 'vshuff32x4' {AVX512_F+VL}.
kIdVshuff64x2, //!< Instruction 'vshuff64x2' {AVX512_F+VL}.
kIdVshufi32x4, //!< Instruction 'vshufi32x4' {AVX512_F+VL}.
kIdVshufi64x2, //!< Instruction 'vshufi64x2' {AVX512_F+VL}.
kIdVshufpd, //!< Instruction 'vshufpd' {AVX|AVX512_F+VL}.
kIdVshufps, //!< Instruction 'vshufps' {AVX|AVX512_F+VL}.
+ kIdVsm3msg1, //!< Instruction 'vsm3msg1' {AVX & SM3}.
+ kIdVsm3msg2, //!< Instruction 'vsm3msg2' {AVX & SM3}.
+ kIdVsm3rnds2, //!< Instruction 'vsm3rnds2' {AVX & SM3}.
+ kIdVsm4key4, //!< Instruction 'vsm4key4' {AVX & SM4}.
+ kIdVsm4rnds4, //!< Instruction 'vsm4rnds4' {AVX & SM4}.
kIdVsqrtpd, //!< Instruction 'vsqrtpd' {AVX|AVX512_F+VL}.
kIdVsqrtph, //!< Instruction 'vsqrtph' {AVX512_FP16+VL}.
kIdVsqrtps, //!< Instruction 'vsqrtps' {AVX|AVX512_F+VL}.
@@ -1744,7 +1809,7 @@ namespace Inst {
kIdVxorps, //!< Instruction 'vxorps' {AVX|AVX512_DQ+VL}.
kIdVzeroall, //!< Instruction 'vzeroall' {AVX}.
kIdVzeroupper, //!< Instruction 'vzeroupper' {AVX}.
- kIdWbinvd, //!< Instruction 'wbinvd'.
+ kIdWbinvd, //!< Instruction 'wbinvd' {I486}.
kIdWbnoinvd, //!< Instruction 'wbnoinvd' {WBNOINVD}.
kIdWrfsbase, //!< Instruction 'wrfsbase' {FSGSBASE} (X64).
kIdWrgsbase, //!< Instruction 'wrgsbase' {FSGSBASE} (X64).
@@ -1784,7 +1849,7 @@ namespace Inst {
};
//! Tests whether the `instId` is defined.
- static inline constexpr bool isDefinedId(InstId instId) noexcept { return instId < _kIdCount; }
+ static ASMJIT_INLINE_NODEBUG constexpr bool isDefinedId(InstId instId) noexcept { return instId < _kIdCount; }
//! \cond
#define ASMJIT_INST_FROM_COND(ID) \
@@ -1801,11 +1866,11 @@ namespace Inst {
//! \endcond
//! Translates a condition code `cond` to a `jcc` instruction id.
- static constexpr InstId jccFromCond(CondCode cond) noexcept { return _jccTable[uint8_t(cond)]; }
+ static ASMJIT_INLINE_NODEBUG constexpr InstId jccFromCond(CondCode cond) noexcept { return _jccTable[uint8_t(cond)]; }
//! Translates a condition code `cond` to a `setcc` instruction id.
- static constexpr InstId setccFromCond(CondCode cond) noexcept { return _setccTable[uint8_t(cond)]; }
+ static ASMJIT_INLINE_NODEBUG constexpr InstId setccFromCond(CondCode cond) noexcept { return _setccTable[uint8_t(cond)]; }
//! Translates a condition code `cond` to a `cmovcc` instruction id.
- static constexpr InstId cmovccFromCond(CondCode cond) noexcept { return _cmovccTable[uint8_t(cond)]; }
+ static ASMJIT_INLINE_NODEBUG constexpr InstId cmovccFromCond(CondCode cond) noexcept { return _cmovccTable[uint8_t(cond)]; }
} // {Inst}
//! FPU status word bits.
@@ -1933,7 +1998,7 @@ enum class RoundImm : uint8_t {
kUp = 0x02u, //!< Round to up toward +INF (ceil).
kTrunc = 0x03u, //!< Round toward zero (truncate).
kCurrent = 0x04u, //!< Round to the current rounding mode set (ignores other RC bits).
- kSuppress = 0x08u //!< Supress exceptions (avoids inexact exception, if set).
+ kSuppress = 0x08u //!< Suppress exceptions (avoids inexact exception, if set).
};
ASMJIT_DEFINE_ENUM_FLAGS(RoundImm)
@@ -2085,7 +2150,7 @@ enum class VReduceImm : uint8_t {
ASMJIT_DEFINE_ENUM_FLAGS(VReduceImm)
//! Creates a \ref VReduceImm from a combination of `flags` and `fixedPointLength`.
-static inline constexpr VReduceImm vReduceImm(VReduceImm flags, uint32_t fixedPointLength) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr VReduceImm vReduceImm(VReduceImm flags, uint32_t fixedPointLength) noexcept {
return flags | VReduceImm(fixedPointLength << 4);
}
@@ -2120,7 +2185,7 @@ enum class TLogImm : uint8_t {
ASMJIT_DEFINE_ENUM_FLAGS(TLogImm)
//! Creates an immediate that can be used by VPTERNLOG[D|Q] instructions.
-static inline constexpr TLogImm tLogFromBits(uint8_t b000, uint8_t b001, uint8_t b010, uint8_t b011, uint8_t b100, uint8_t b101, uint8_t b110, uint8_t b111) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr TLogImm tLogFromBits(uint8_t b000, uint8_t b001, uint8_t b010, uint8_t b011, uint8_t b100, uint8_t b101, uint8_t b110, uint8_t b111) noexcept {
return TLogImm(uint8_t(b000 << 0) |
uint8_t(b001 << 1) |
uint8_t(b010 << 2) |
@@ -2132,7 +2197,7 @@ static inline constexpr TLogImm tLogFromBits(uint8_t b000, uint8_t b001, uint8_t
}
//! Creates an if/else logic that can be used by VPTERNLOG[D|Q] instructions.
-static inline constexpr TLogImm fLogIfElse(TLogImm condition, TLogImm a, TLogImm b) noexcept { return (condition & a) | (~condition & b); }
+static ASMJIT_INLINE_NODEBUG constexpr TLogImm fLogIfElse(TLogImm condition, TLogImm a, TLogImm b) noexcept { return (condition & a) | (~condition & b); }
//! Creates a shuffle immediate value that be used with SSE/AVX/AVX-512 instructions to shuffle 2 elements in a vector.
//!
@@ -2141,7 +2206,7 @@ static inline constexpr TLogImm fLogIfElse(TLogImm condition, TLogImm a, TLogImm
//!
//! Shuffle constants can be used to encode an immediate for these instructions:
//! - `shufpd|vshufpd`
-static inline constexpr uint32_t shuffleImm(uint32_t a, uint32_t b) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t shuffleImm(uint32_t a, uint32_t b) noexcept {
return (a << 1) | b;
}
@@ -2158,7 +2223,7 @@ static inline constexpr uint32_t shuffleImm(uint32_t a, uint32_t b) noexcept {
//! - `pshufhw|vpshufhw`
//! - `pshufd|vpshufd`
//! - `shufps|vshufps`
-static inline constexpr uint32_t shuffleImm(uint32_t a, uint32_t b, uint32_t c, uint32_t d) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr uint32_t shuffleImm(uint32_t a, uint32_t b, uint32_t c, uint32_t d) noexcept {
return (a << 6) | (b << 4) | (c << 2) | d;
}
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp b/3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp
index 3857cc12127..fc17b5cdaea 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp
@@ -3,30 +3,12 @@
// See asmjit.h or LICENSE.md for license and copyright information
// SPDX-License-Identifier: Zlib
-// ----------------------------------------------------------------------------
-// IMPORTANT: AsmJit now uses an external instruction database to populate
-// static tables within this file. Perform the following steps to regenerate
-// all tables enclosed by ${...}:
-//
-// 1. Install node.js environment <https://nodejs.org>
-// 2. Go to asmjit/tools directory
-// 3. Get the latest asmdb from <https://github.com/asmjit/asmdb> and
-// copy/link the `asmdb` directory to `asmjit/tools/asmdb`.
-// 4. Execute `node tablegen-x86.js`
-//
-// Instruction encoding and opcodes were added to the `x86inst.cpp` database
-// manually in the past and they are not updated by the script as it became
-// tricky. However, everything else is updated including instruction operands
-// and tables required to validate them, instruction read/write information
-// (including registers and flags), and all indexes to all tables.
-// ----------------------------------------------------------------------------
-
#include "../core/api-build_p.h"
#if !defined(ASMJIT_NO_X86)
#include "../core/cpuinfo.h"
+#include "../core/instdb_p.h"
#include "../core/misc_p.h"
-#include "../core/support.h"
#include "../x86/x86instapi_p.h"
#include "../x86/x86instdb_p.h"
#include "../x86/x86opcode_p.h"
@@ -34,63 +16,21 @@
ASMJIT_BEGIN_SUB_NAMESPACE(x86)
+namespace InstInternal {
+
// x86::InstInternal - Text
// ========================
#ifndef ASMJIT_NO_TEXT
-Error InstInternal::instIdToString(Arch arch, InstId instId, String& output) noexcept {
- DebugUtils::unused(arch);
-
+Error instIdToString(InstId instId, String& output) noexcept {
if (ASMJIT_UNLIKELY(!Inst::isDefinedId(instId)))
return DebugUtils::errored(kErrorInvalidInstruction);
- const InstDB::InstInfo& info = InstDB::infoById(instId);
- return output.append(InstDB::_nameData + info._nameDataIndex);
+ return InstNameUtils::decode(output, InstDB::_instNameIndexTable[instId], InstDB::_instNameStringTable);
}
-InstId InstInternal::stringToInstId(Arch arch, const char* s, size_t len) noexcept {
- DebugUtils::unused(arch);
-
- if (ASMJIT_UNLIKELY(!s))
- return Inst::kIdNone;
-
- if (len == SIZE_MAX)
- len = strlen(s);
-
- if (ASMJIT_UNLIKELY(len == 0 || len > InstDB::kMaxNameSize))
- return Inst::kIdNone;
-
- uint32_t prefix = uint32_t(s[0]) - 'a';
- if (ASMJIT_UNLIKELY(prefix > 'z' - 'a'))
- return Inst::kIdNone;
-
- uint32_t index = InstDB::instNameIndex[prefix].start;
- if (ASMJIT_UNLIKELY(!index))
- return Inst::kIdNone;
-
- const char* nameData = InstDB::_nameData;
- const InstDB::InstInfo* table = InstDB::_instInfoTable;
-
- const InstDB::InstInfo* base = table + index;
- const InstDB::InstInfo* end = table + InstDB::instNameIndex[prefix].end;
-
- for (size_t lim = (size_t)(end - base); lim != 0; lim >>= 1) {
- const InstDB::InstInfo* cur = base + (lim >> 1);
- int result = Support::cmpInstName(nameData + cur[0]._nameDataIndex, s, len);
-
- if (result < 0) {
- base = cur + 1;
- lim--;
- continue;
- }
-
- if (result > 0)
- continue;
-
- return InstId((size_t)(cur - table));
- }
-
- return Inst::kIdNone;
+InstId stringToInstId(const char* s, size_t len) noexcept {
+ return InstNameUtils::find(s, len, InstDB::instNameIndex, InstDB::_instNameIndexTable, InstDB::_instNameStringTable);
}
#endif // !ASMJIT_NO_TEXT
@@ -184,7 +124,7 @@ static const X86ValidationData _x64ValidationData = {
#undef REG_MASK_FROM_REG_TYPE_X86
static ASMJIT_FORCE_INLINE bool x86IsZmmOrM512(const Operand_& op) noexcept {
- return Reg::isZmm(op) || (op.isMem() && op.size() == 64);
+ return Reg::isZmm(op) || (op.isMem() && op.x86RmSize() == 64);
}
static ASMJIT_FORCE_INLINE bool x86CheckOSig(const InstDB::OpSignature& op, const InstDB::OpSignature& ref, bool& immOutOfRange) noexcept {
@@ -216,20 +156,11 @@ static ASMJIT_FORCE_INLINE bool x86CheckOSig(const InstDB::OpSignature& op, cons
return true;
}
-ASMJIT_FAVOR_SIZE Error InstInternal::validate(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept {
- // Only called when `arch` matches X86 family.
- ASMJIT_ASSERT(Environment::isFamilyX86(arch));
-
- const X86ValidationData* vd;
- if (arch == Arch::kX86)
- vd = &_x86ValidationData;
- else
- vd = &_x64ValidationData;
-
+static ASMJIT_FAVOR_SIZE Error validate(InstDB::Mode mode, const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept {
uint32_t i;
- InstDB::Mode mode = InstDB::modeFromArch(arch);
// Get the instruction data.
+ const X86ValidationData* vd = (mode == InstDB::Mode::kX86) ? &_x86ValidationData : &_x64ValidationData;
InstId instId = inst.id();
InstOptions options = inst.options();
@@ -717,6 +648,15 @@ Next:
return kErrorOk;
}
+
+Error validateX86(const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept {
+ return validate(InstDB::Mode::kX86, inst, operands, opCount, validationFlags);
+}
+
+Error validateX64(const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept {
+ return validate(InstDB::Mode::kX64, inst, operands, opCount, validationFlags);
+}
+
#endif // !ASMJIT_NO_VALIDATION
// x86::InstInternal - QueryRWInfo
@@ -785,7 +725,7 @@ static ASMJIT_FORCE_INLINE bool hasSameRegType(const BaseReg* regs, size_t opCou
return true;
}
-Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, InstRWInfo* out) noexcept {
+Error queryRWInfo(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, InstRWInfo* out) noexcept {
// Only called when `arch` matches X86 family.
ASMJIT_ASSERT(Environment::isFamilyX86(arch));
@@ -827,7 +767,7 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
constexpr OpRWFlags RegPhys = OpRWFlags::kRegPhysId;
constexpr OpRWFlags MibRead = OpRWFlags::kMemBaseRead | OpRWFlags::kMemIndexRead;
- if (instRwInfo.category == InstDB::RWInfo::kCategoryGeneric) {
+ if (instRwInfo.category <= uint32_t(InstDB::RWInfo::kCategoryGenericEx)) {
uint32_t i;
uint32_t rmOpsMask = 0;
uint32_t rmMaxSize = 0;
@@ -852,8 +792,8 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
uint64_t rByteMask = rwOpData.rByteMask;
uint64_t wByteMask = rwOpData.wByteMask;
- if (op.isRead() && !rByteMask) rByteMask = Support::lsbMask<uint64_t>(srcOp.size());
- if (op.isWrite() && !wByteMask) wByteMask = Support::lsbMask<uint64_t>(srcOp.size());
+ if (op.isRead() && !rByteMask) rByteMask = Support::lsbMask<uint64_t>(srcOp.x86RmSize());
+ if (op.isWrite() && !wByteMask) wByteMask = Support::lsbMask<uint64_t>(srcOp.x86RmSize());
op._readByteMask = rByteMask;
op._writeByteMask = wByteMask;
@@ -876,7 +816,7 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
}
// Aggregate values required to calculate valid Reg/M info.
- rmMaxSize = Support::max(rmMaxSize, srcOp.size());
+ rmMaxSize = Support::max(rmMaxSize, srcOp.x86RmSize());
rmOpsMask |= Support::bitMask<uint32_t>(i);
}
else {
@@ -919,8 +859,8 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
}
}
- rmOpsMask &= instRmInfo.rmOpsMask;
- if (rmOpsMask) {
+ rmOpsMask &= uint32_t(instRmInfo.rmOpsMask);
+ if (rmOpsMask && !inst.hasOption(InstOptions::kX86_ER)) {
Support::BitWordIterator<uint32_t> it(rmOpsMask);
do {
i = it.next();
@@ -933,7 +873,7 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
op.setRmSize(instRmInfo.fixedSize);
break;
case InstDB::RWInfoRm::kCategoryConsistent:
- op.setRmSize(operands[i].size());
+ op.setRmSize(operands[i].x86RmSize());
break;
case InstDB::RWInfoRm::kCategoryHalf:
op.setRmSize(rmMaxSize / 2u);
@@ -948,6 +888,27 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
} while (it.hasNext());
}
+ // Special cases per instruction.
+ if (instRwInfo.category == InstDB::RWInfo::kCategoryGenericEx) {
+ switch (inst.id()) {
+ case Inst::kIdVpternlogd:
+ case Inst::kIdVpternlogq: {
+ if (opCount == 4 && operands[3].isImm()) {
+ uint32_t predicate = operands[3].as<Imm>().valueAs<uint8_t>();
+
+ if ((predicate >> 4) == (predicate & 0xF)) {
+ out->_operands[0].clearOpFlags(OpRWFlags::kRead);
+ out->_operands[0].setReadByteMask(0);
+ }
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
return rwHandleAVX512(inst, commonInfo, out);
}
@@ -966,8 +927,8 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
const Reg& o1 = operands[1].as<Reg>();
if (o0.isGp() && o1.isGp()) {
- out->_operands[0].reset(W | RegM, operands[0].size());
- out->_operands[1].reset(R | RegM, operands[1].size());
+ out->_operands[0].reset(W | RegM, operands[0].x86RmSize());
+ out->_operands[1].reset(R | RegM, operands[1].x86RmSize());
rwZeroExtendGp(out->_operands[0], operands[0].as<Gp>(), nativeGpSize);
out->_instFlags |= InstRWFlags::kMovOp;
@@ -1114,14 +1075,14 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
if (opCount == 2) {
if (operands[0].isReg() && operands[1].isImm()) {
- out->_operands[0].reset(X, operands[0].size());
+ out->_operands[0].reset(X, operands[0].as<Reg>().size());
out->_operands[1].reset();
rwZeroExtendGp(out->_operands[0], operands[0].as<Gp>(), nativeGpSize);
return kErrorOk;
}
- if (Reg::isGpw(operands[0]) && operands[1].size() == 1) {
+ if (Reg::isGpw(operands[0]) && operands[1].x86RmSize() == 1) {
// imul ax, r8/m8 <- AX = AL * r8/m8
out->_operands[0].reset(X | RegPhys, 2, Gp::kIdAx);
out->_operands[0].setReadByteMask(Support::lsbMask<uint64_t>(1));
@@ -1129,8 +1090,8 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
}
else {
// imul r?, r?/m?
- out->_operands[0].reset(X, operands[0].size());
- out->_operands[1].reset(R | RegM, operands[0].size());
+ out->_operands[0].reset(X, operands[0].as<Gp>().size());
+ out->_operands[1].reset(R | RegM, operands[0].as<Gp>().size());
rwZeroExtendGp(out->_operands[0], operands[0].as<Gp>(), nativeGpSize);
}
@@ -1141,8 +1102,8 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
if (opCount == 3) {
if (operands[2].isImm()) {
- out->_operands[0].reset(W, operands[0].size());
- out->_operands[1].reset(R | RegM, operands[1].size());
+ out->_operands[0].reset(W, operands[0].x86RmSize());
+ out->_operands[1].reset(R | RegM, operands[1].x86RmSize());
out->_operands[2].reset();
rwZeroExtendGp(out->_operands[0], operands[0].as<Gp>(), nativeGpSize);
@@ -1151,9 +1112,9 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
return kErrorOk;
}
else {
- out->_operands[0].reset(W | RegPhys, operands[0].size(), Gp::kIdDx);
- out->_operands[1].reset(X | RegPhys, operands[1].size(), Gp::kIdAx);
- out->_operands[2].reset(R | RegM, operands[2].size());
+ out->_operands[0].reset(W | RegPhys, operands[0].x86RmSize(), Gp::kIdDx);
+ out->_operands[1].reset(X | RegPhys, operands[1].x86RmSize(), Gp::kIdAx);
+ out->_operands[2].reset(R | RegM, operands[2].x86RmSize());
rwZeroExtendGp(out->_operands[0], operands[0].as<Gp>(), nativeGpSize);
rwZeroExtendGp(out->_operands[1], operands[1].as<Gp>(), nativeGpSize);
@@ -1230,18 +1191,18 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
// Special case for 'vmaskmovpd|vmaskmovps|vpmaskmovd|vpmaskmovq' instructions.
if (opCount == 3) {
if (BaseReg::isVec(operands[0]) && BaseReg::isVec(operands[1]) && operands[2].isMem()) {
- out->_operands[0].reset(W, operands[0].size());
- out->_operands[1].reset(R, operands[1].size());
- out->_operands[2].reset(R | MibRead, operands[1].size());
+ out->_operands[0].reset(W, operands[0].x86RmSize());
+ out->_operands[1].reset(R, operands[1].x86RmSize());
+ out->_operands[2].reset(R | MibRead, operands[1].x86RmSize());
rwZeroExtendAvxVec(out->_operands[0], operands[0].as<Vec>());
return kErrorOk;
}
if (operands[0].isMem() && BaseReg::isVec(operands[1]) && BaseReg::isVec(operands[2])) {
- out->_operands[0].reset(X | MibRead, operands[1].size());
- out->_operands[1].reset(R, operands[1].size());
- out->_operands[2].reset(R, operands[2].size());
+ out->_operands[0].reset(X | MibRead, operands[1].x86RmSize());
+ out->_operands[1].reset(R, operands[1].x86RmSize());
+ out->_operands[2].reset(R, operands[2].x86RmSize());
return kErrorOk;
}
}
@@ -1254,7 +1215,7 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
// operand, respectively.
if (opCount == 2) {
if (BaseReg::isVec(operands[0]) && BaseReg::isVec(operands[1])) {
- uint32_t o0Size = operands[0].size();
+ uint32_t o0Size = operands[0].x86RmSize();
uint32_t o1Size = o0Size == 16 ? 8 : o0Size;
out->_operands[0].reset(W, o0Size);
@@ -1266,7 +1227,7 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
}
if (BaseReg::isVec(operands[0]) && operands[1].isMem()) {
- uint32_t o0Size = operands[0].size();
+ uint32_t o0Size = operands[0].x86RmSize();
uint32_t o1Size = o0Size == 16 ? 8 : o0Size;
out->_operands[0].reset(W, o0Size);
@@ -1286,7 +1247,7 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
if (BaseReg::isGp(operands[0]) && BaseReg::isVec(operands[1])) {
out->_operands[0].reset(W, 1);
out->_operands[0].setExtendByteMask(Support::lsbMask<uint32_t>(nativeGpSize - 1) << 1);
- out->_operands[1].reset(R, operands[1].size());
+ out->_operands[1].reset(R, operands[1].x86RmSize());
return kErrorOk;
}
}
@@ -1324,7 +1285,7 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
}
if (operands[0].isReg() && operands[1].isReg()) {
- uint32_t size1 = operands[1].size();
+ uint32_t size1 = operands[1].x86RmSize();
uint32_t size0 = size1 >> shift;
out->_operands[0].reset(W, size0);
@@ -1351,16 +1312,20 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
}
if (operands[0].isReg() && operands[1].isMem()) {
- uint32_t size1 = operands[1].size() ? operands[1].size() : uint32_t(16);
+ uint32_t size1 = operands[1].x86RmSize() ? operands[1].x86RmSize() : uint32_t(16);
uint32_t size0 = size1 >> shift;
out->_operands[0].reset(W, size0);
out->_operands[1].reset(R | MibRead, size1);
+
+ if (BaseReg::isVec(operands[0]))
+ rwZeroExtendAvxVec(out->_operands[0], operands[0].as<Vec>());
+
return kErrorOk;
}
if (operands[0].isMem() && operands[1].isReg()) {
- uint32_t size1 = operands[1].size();
+ uint32_t size1 = operands[1].x86RmSize();
uint32_t size0 = size1 >> shift;
out->_operands[0].reset(W | MibRead, size0);
@@ -1401,12 +1366,15 @@ Error InstInternal::queryRWInfo(Arch arch, const BaseInst& inst, const Operand_*
out->_operands[2].reset();
}
- uint32_t size0 = operands[0].size();
+ uint32_t size0 = operands[0].x86RmSize();
uint32_t size1 = size0 >> shift;
out->_operands[0].reset(W, size0);
out->_operands[1].reset(R, size1);
+ if (BaseReg::isVec(operands[0]))
+ rwZeroExtendAvxVec(out->_operands[0], operands[0].as<Vec>());
+
if (operands[0].isReg() && operands[1].isReg()) {
if (instRmInfo.rmOpsMask & 0x1) {
out->_operands[0].addOpFlags(RegM);
@@ -1481,7 +1449,9 @@ static inline uint32_t InstInternal_usesAvx512(InstOptions instOptions, const Re
return hasEvex | hasKMask | hasKOrZmm;
}
-Error InstInternal::queryFeatures(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, CpuFeatures* out) noexcept {
+Error queryFeatures(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, CpuFeatures* out) noexcept {
+ typedef CpuFeatures::X86 Ext;
+
// Only called when `arch` matches X86 family.
DebugUtils::unused(arch);
ASMJIT_ASSERT(Environment::isFamilyX86(arch));
@@ -1514,19 +1484,19 @@ Error InstInternal::queryFeatures(Arch arch, const BaseInst& inst, const Operand
RegAnalysis regAnalysis = InstInternal_regAnalysis(operands, opCount);
// Handle MMX vs SSE overlap.
- if (out->has(CpuFeatures::X86::kMMX) || out->has(CpuFeatures::X86::kMMX2)) {
+ if (out->has(Ext::kMMX) || out->has(Ext::kMMX2)) {
// Only instructions defined by SSE and SSE2 overlap. Instructions introduced by newer instruction sets like
// SSE3+ don't state MMX as they require SSE3+.
- if (out->has(CpuFeatures::X86::kSSE) || out->has(CpuFeatures::X86::kSSE2)) {
+ if (out->has(Ext::kSSE) || out->has(Ext::kSSE2)) {
if (!regAnalysis.hasRegType(RegType::kX86_Xmm)) {
// The instruction doesn't use XMM register(s), thus it's MMX/MMX2 only.
- out->remove(CpuFeatures::X86::kSSE);
- out->remove(CpuFeatures::X86::kSSE2);
- out->remove(CpuFeatures::X86::kSSE4_1);
+ out->remove(Ext::kSSE);
+ out->remove(Ext::kSSE2);
+ out->remove(Ext::kSSE4_1);
}
else {
- out->remove(CpuFeatures::X86::kMMX);
- out->remove(CpuFeatures::X86::kMMX2);
+ out->remove(Ext::kMMX);
+ out->remove(Ext::kMMX2);
}
// Special case: PEXTRW instruction is MMX/SSE2 instruction. However, MMX/SSE version cannot access memory
@@ -1535,30 +1505,30 @@ Error InstInternal::queryFeatures(Arch arch, const BaseInst& inst, const Operand
// is, of course, not compatible with MMX/SSE2 and would #UD if SSE4.1 is not supported.
if (instId == Inst::kIdPextrw) {
if (opCount >= 1 && operands[0].isMem())
- out->remove(CpuFeatures::X86::kSSE2);
+ out->remove(Ext::kSSE2);
else
- out->remove(CpuFeatures::X86::kSSE4_1);
+ out->remove(Ext::kSSE4_1);
}
}
}
// Handle PCLMULQDQ vs VPCLMULQDQ.
- if (out->has(CpuFeatures::X86::kVPCLMULQDQ)) {
+ if (out->has(Ext::kVPCLMULQDQ)) {
if (regAnalysis.hasRegType(RegType::kX86_Zmm) || Support::test(options, InstOptions::kX86_Evex)) {
// AVX512_F & VPCLMULQDQ.
- out->remove(CpuFeatures::X86::kAVX, CpuFeatures::X86::kPCLMULQDQ);
+ out->remove(Ext::kAVX, Ext::kPCLMULQDQ);
}
else if (regAnalysis.hasRegType(RegType::kX86_Ymm)) {
- out->remove(CpuFeatures::X86::kAVX512_F, CpuFeatures::X86::kAVX512_VL);
+ out->remove(Ext::kAVX512_F, Ext::kAVX512_VL);
}
else {
// AVX & PCLMULQDQ.
- out->remove(CpuFeatures::X86::kAVX512_F, CpuFeatures::X86::kAVX512_VL, CpuFeatures::X86::kVPCLMULQDQ);
+ out->remove(Ext::kAVX512_F, Ext::kAVX512_VL, Ext::kVPCLMULQDQ);
}
}
// Handle AVX vs AVX2 overlap.
- if (out->has(CpuFeatures::X86::kAVX) && out->has(CpuFeatures::X86::kAVX2)) {
+ if (out->has(Ext::kAVX) && out->has(Ext::kAVX2)) {
bool isAVX2 = true;
// Special case: VBROADCASTSS and VBROADCASTSD were introduced in AVX, but only version that uses memory as a
// source operand. AVX2 then added support for register source operand.
@@ -1575,157 +1545,287 @@ Error InstInternal::queryFeatures(Arch arch, const BaseInst& inst, const Operand
}
if (isAVX2)
- out->remove(CpuFeatures::X86::kAVX);
+ out->remove(Ext::kAVX);
else
- out->remove(CpuFeatures::X86::kAVX2);
+ out->remove(Ext::kAVX2);
}
- // Handle AVX|AVX2|FMA|F16C vs AVX512 overlap.
- if (out->has(CpuFeatures::X86::kAVX) || out->has(CpuFeatures::X86::kAVX2) || out->has(CpuFeatures::X86::kFMA) || out->has(CpuFeatures::X86::kF16C)) {
- // Only AVX512-F|BW|DQ allow to encode AVX/AVX2/FMA/F16C instructions
- if (out->has(CpuFeatures::X86::kAVX512_F) || out->has(CpuFeatures::X86::kAVX512_BW) || out->has(CpuFeatures::X86::kAVX512_DQ)) {
- uint32_t usesAvx512 = InstInternal_usesAvx512(options, inst.extraReg(), regAnalysis);
- uint32_t mustUseEvex = 0;
-
- switch (instId) {
- // Special case: VPSLLDQ and VPSRLDQ instructions only allow `reg, reg. imm` combination in AVX|AVX2 mode,
- // then AVX-512 introduced `reg, reg/mem, imm` combination that uses EVEX prefix. This means that if the
- // second operand is memory then this is AVX-512_BW instruction and not AVX/AVX2 instruction.
- case Inst::kIdVpslldq:
- case Inst::kIdVpsrldq:
- mustUseEvex = opCount >= 2 && operands[1].isMem();
- break;
+ // Handle AVX vs AVX512 overlap.
+ //
+ // In general, non-AVX encoding is preferred, however, AVX encoded instructions that were initially provided
+ // as AVX-512 instructions must naturally prefer AVX-512 encoding, as that was the first one provided.
+ if (out->hasAny(Ext::kAVX,
+ Ext::kAVX_IFMA,
+ Ext::kAVX_NE_CONVERT,
+ Ext::kAVX_VNNI,
+ Ext::kAVX2,
+ Ext::kF16C,
+ Ext::kFMA)
+ &&
+ out->hasAny(Ext::kAVX512_BF16,
+ Ext::kAVX512_BW,
+ Ext::kAVX512_DQ,
+ Ext::kAVX512_F,
+ Ext::kAVX512_IFMA,
+ Ext::kAVX512_VNNI)) {
+
+ uint32_t useEvex = InstInternal_usesAvx512(options, inst.extraReg(), regAnalysis) | regAnalysis.highVecUsed;
+ switch (instId) {
+ // Special case: VPBROADCAST[B|D|Q|W] only supports r32/r64 with EVEX prefix.
+ case Inst::kIdVpbroadcastb:
+ case Inst::kIdVpbroadcastd:
+ case Inst::kIdVpbroadcastq:
+ case Inst::kIdVpbroadcastw:
+ useEvex |= uint32_t(opCount >= 2 && x86::Reg::isGp(operands[1]));
+ break;
- // Special case: VPBROADCAST[B|D|Q|W] only supports r32/r64 with EVEX prefix.
- case Inst::kIdVpbroadcastb:
- case Inst::kIdVpbroadcastd:
- case Inst::kIdVpbroadcastq:
- case Inst::kIdVpbroadcastw:
- mustUseEvex = opCount >= 2 && x86::Reg::isGp(operands[1]);
- break;
+ case Inst::kIdVcvtpd2dq:
+ case Inst::kIdVcvtpd2ps:
+ case Inst::kIdVcvttpd2dq:
+ useEvex |= uint32_t(opCount >= 2 && Reg::isYmm(operands[0]));
+ break;
- // Special case: VPERMPD - AVX2 vs AVX512-F case.
- case Inst::kIdVpermpd:
- mustUseEvex = opCount >= 3 && !operands[2].isImm();
- break;
+ case Inst::kIdVgatherdpd:
+ case Inst::kIdVgatherdps:
+ case Inst::kIdVgatherqpd:
+ case Inst::kIdVgatherqps:
+ case Inst::kIdVpgatherdd:
+ case Inst::kIdVpgatherdq:
+ case Inst::kIdVpgatherqd:
+ case Inst::kIdVpgatherqq:
+ useEvex |= uint32_t(opCount == 2);
+ break;
- // Special case: VPERMQ - AVX2 vs AVX512-F case.
- case Inst::kIdVpermq:
- mustUseEvex = opCount >= 3 && (operands[1].isMem() || !operands[2].isImm());
- break;
- }
+ // Special case: These instructions only allow `reg, reg. imm` combination in AVX|AVX2 mode, then
+ // AVX-512 introduced `reg, reg/mem, imm` combination that uses EVEX prefix. This means that if
+ // the second operand is memory then this is AVX-512_BW instruction and not AVX/AVX2 instruction.
+ case Inst::kIdVpslldq:
+ case Inst::kIdVpslld:
+ case Inst::kIdVpsllq:
+ case Inst::kIdVpsllw:
+ case Inst::kIdVpsrad:
+ case Inst::kIdVpsraq:
+ case Inst::kIdVpsraw:
+ case Inst::kIdVpsrld:
+ case Inst::kIdVpsrldq:
+ case Inst::kIdVpsrlq:
+ case Inst::kIdVpsrlw:
+ useEvex |= uint32_t(opCount >= 2 && operands[1].isMem());
+ break;
- if (!(usesAvx512 | mustUseEvex | regAnalysis.highVecUsed))
- out->remove(CpuFeatures::X86::kAVX512_F, CpuFeatures::X86::kAVX512_BW, CpuFeatures::X86::kAVX512_DQ, CpuFeatures::X86::kAVX512_VL);
- else
- out->remove(CpuFeatures::X86::kAVX, CpuFeatures::X86::kAVX2, CpuFeatures::X86::kFMA, CpuFeatures::X86::kF16C);
- }
- }
+ // Special case: VPERMPD - AVX2 vs AVX512-F case.
+ case Inst::kIdVpermpd:
+ useEvex |= uint32_t(opCount >= 3 && !operands[2].isImm());
+ break;
- // Handle AVX_VNNI vs AVX512_VNNI overlap.
- if (out->has(CpuFeatures::X86::kAVX512_VNNI)) {
- // By default the AVX512_VNNI instruction should be used, because it was introduced first. However, VEX|VEX3
- // prefix can be used to force AVX_VNNI instead.
- uint32_t usesAvx512 = InstInternal_usesAvx512(options, inst.extraReg(), regAnalysis);
+ // Special case: VPERMQ - AVX2 vs AVX512-F case.
+ case Inst::kIdVpermq:
+ useEvex |= uint32_t(opCount >= 3 && (operands[1].isMem() || !operands[2].isImm()));
+ break;
+ }
- if (!usesAvx512 && Support::test(options, InstOptions::kX86_Vex | InstOptions::kX86_Vex3))
- out->remove(CpuFeatures::X86::kAVX512_VNNI, CpuFeatures::X86::kAVX512_VL);
- else
- out->remove(CpuFeatures::X86::kAVX_VNNI);
+ if (instInfo.commonInfo().preferEvex() && !Support::test(options, InstOptions::kX86_Vex | InstOptions::kX86_Vex3))
+ useEvex = 1;
+
+ if (useEvex) {
+ out->remove(Ext::kAVX,
+ Ext::kAVX_IFMA,
+ Ext::kAVX_NE_CONVERT,
+ Ext::kAVX_VNNI,
+ Ext::kAVX2,
+ Ext::kF16C,
+ Ext::kFMA);
+ }
+ else {
+ out->remove(Ext::kAVX512_BF16,
+ Ext::kAVX512_BW,
+ Ext::kAVX512_DQ,
+ Ext::kAVX512_F,
+ Ext::kAVX512_IFMA,
+ Ext::kAVX512_VL,
+ Ext::kAVX512_VNNI);
+ }
}
// Clear AVX512_VL if ZMM register is used.
if (regAnalysis.hasRegType(RegType::kX86_Zmm))
- out->remove(CpuFeatures::X86::kAVX512_VL);
+ out->remove(Ext::kAVX512_VL);
}
return kErrorOk;
}
#endif // !ASMJIT_NO_INTROSPECTION
+} // {InstInternal}
+
// x86::InstInternal - Tests
// =========================
#if defined(ASMJIT_TEST)
+#ifndef ASMJIT_NO_TEXT
UNIT(x86_inst_api_text) {
// All known instructions should be matched.
INFO("Matching all X86 instructions");
for (uint32_t a = 1; a < Inst::_kIdCount; a++) {
StringTmp<128> aName;
- EXPECT(InstInternal::instIdToString(Arch::kX86, a, aName) == kErrorOk,
- "Failed to get the name of instruction #%u", a);
+ EXPECT_EQ(InstInternal::instIdToString(a, aName), kErrorOk)
+ .message("Failed to get the name of instruction #%u", a);
- uint32_t b = InstInternal::stringToInstId(Arch::kX86, aName.data(), aName.size());
+ uint32_t b = InstInternal::stringToInstId(aName.data(), aName.size());
StringTmp<128> bName;
- InstInternal::instIdToString(Arch::kX86, b, bName);
+ InstInternal::instIdToString(b, bName);
+ EXPECT_EQ(a, b)
+ .message("Instructions do not match \"%s\" (#%u) != \"%s\" (#%u)", aName.data(), a, bName.data(), b);
+ }
+}
+#endif // !ASMJIT_NO_TEXT
+
+#ifndef ASMJIT_NO_INTROSPECTION
+template<typename... Args>
+static Error queryFeaturesInline(CpuFeatures* out, Arch arch, BaseInst inst, Args&&... args) {
+ Operand_ opArray[] = { std::forward<Args>(args)... };
+ return InstInternal::queryFeatures(arch, inst, opArray, sizeof...(args), out);
+}
+
+UNIT(x86_inst_api_cpu_features) {
+ INFO("Verifying whether SSE2+ features are reported correctly for legacy instructions");
+ {
+ CpuFeatures f;
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdPaddd), xmm1, xmm2);
+ EXPECT_TRUE(f.x86().hasSSE2());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdAddsubpd), xmm1, xmm2);
+ EXPECT_TRUE(f.x86().hasSSE3());
- EXPECT(a == b,
- "Instructions do not match \"%s\" (#%u) != \"%s\" (#%u)", aName.data(), a, bName.data(), b);
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdPshufb), xmm1, xmm2);
+ EXPECT_TRUE(f.x86().hasSSSE3());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdBlendpd), xmm1, xmm2, Imm(1));
+ EXPECT_TRUE(f.x86().hasSSE4_1());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdCrc32), eax, al);
+ EXPECT_TRUE(f.x86().hasSSE4_2());
+ }
+
+ INFO("Verifying whether AVX+ features are reported correctly for AVX instructions");
+ {
+ CpuFeatures f;
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVpaddd), xmm1, xmm2, xmm3);
+ EXPECT_TRUE(f.x86().hasAVX());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVpaddd), ymm1, ymm2, ymm3);
+ EXPECT_TRUE(f.x86().hasAVX2());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVaddsubpd), xmm1, xmm2, xmm3);
+ EXPECT_TRUE(f.x86().hasAVX());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVaddsubpd), ymm1, ymm2, ymm3);
+ EXPECT_TRUE(f.x86().hasAVX());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVpshufb), xmm1, xmm2, xmm3);
+ EXPECT_TRUE(f.x86().hasAVX());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVpshufb), ymm1, ymm2, ymm3);
+ EXPECT_TRUE(f.x86().hasAVX2());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVblendpd), xmm1, xmm2, xmm3, Imm(1));
+ EXPECT_TRUE(f.x86().hasAVX());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVblendpd), ymm1, ymm2, ymm3, Imm(1));
+ EXPECT_TRUE(f.x86().hasAVX());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVpunpcklbw), xmm1, xmm2, xmm3);
+ EXPECT_TRUE(f.x86().hasAVX());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVpunpcklbw), ymm1, ymm2, ymm3);
+ EXPECT_TRUE(f.x86().hasAVX2());
+ }
+
+ INFO("Verifying whether AVX2 / AVX512 features are reported correctly for vpgatherxx instructions");
+ {
+ CpuFeatures f;
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVpgatherdd), xmm1, ptr(rax, xmm2), xmm3);
+ EXPECT_TRUE(f.x86().hasAVX2());
+ EXPECT_FALSE(f.x86().hasAVX512_F());
+
+ // NOTE: This instruction is unencodable, but sometimes this signature is used to check the support (without the {k}).
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVpgatherdd), xmm1, ptr(rax, xmm2));
+ EXPECT_FALSE(f.x86().hasAVX2());
+ EXPECT_TRUE(f.x86().hasAVX512_F());
+
+ queryFeaturesInline(&f, Arch::kX64, BaseInst(Inst::kIdVpgatherdd, InstOptions::kNone, k1), xmm1, ptr(rax, xmm2));
+ EXPECT_FALSE(f.x86().hasAVX2());
+ EXPECT_TRUE(f.x86().hasAVX512_F());
}
}
+#endif // !ASMJIT_NO_INTROSPECTION
+#ifndef ASMJIT_NO_INTROSPECTION
template<typename... Args>
-static Error queryRWInfoSimple(InstRWInfo* out, Arch arch, InstId instId, InstOptions options, Args&&... args) {
- BaseInst inst(instId);
- inst.addOptions(options);
+static Error queryRWInfoInline(InstRWInfo* out, Arch arch, BaseInst inst, Args&&... args) {
Operand_ opArray[] = { std::forward<Args>(args)... };
return InstInternal::queryRWInfo(arch, inst, opArray, sizeof...(args), out);
}
-UNIT(x86_inst_api_rm_feature) {
+UNIT(x86_inst_api_rm_features) {
INFO("Verifying whether RM/feature is reported correctly for PEXTRW instruction");
{
InstRWInfo rwi;
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdPextrw, InstOptions::kNone, eax, mm1, imm(1));
- EXPECT(rwi.rmFeature() == 0);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdPextrw), eax, mm1, imm(1));
+ EXPECT_EQ(rwi.rmFeature(), 0u);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdPextrw, InstOptions::kNone, eax, xmm1, imm(1));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kSSE4_1);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdPextrw), eax, xmm1, imm(1));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kSSE4_1);
}
INFO("Verifying whether RM/feature is reported correctly for AVX512 shift instructions");
{
InstRWInfo rwi;
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpslld, InstOptions::kNone, xmm1, xmm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_F);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpslld), xmm1, xmm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_F);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpsllq, InstOptions::kNone, ymm1, ymm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_F);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpsllq), ymm1, ymm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_F);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpsrad, InstOptions::kNone, xmm1, xmm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_F);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpsrad), xmm1, xmm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_F);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpsrld, InstOptions::kNone, ymm1, ymm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_F);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpsrld), ymm1, ymm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_F);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpsrlq, InstOptions::kNone, xmm1, xmm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_F);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpsrlq), xmm1, xmm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_F);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpslldq, InstOptions::kNone, xmm1, xmm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_BW);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpslldq), xmm1, xmm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_BW);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpsllw, InstOptions::kNone, ymm1, ymm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_BW);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpsllw), ymm1, ymm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_BW);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpsraw, InstOptions::kNone, xmm1, xmm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_BW);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpsraw), xmm1, xmm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_BW);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpsrldq, InstOptions::kNone, ymm1, ymm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_BW);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpsrldq), ymm1, ymm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_BW);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpsrlw, InstOptions::kNone, xmm1, xmm2, imm(8));
- EXPECT(rwi.rmFeature() == CpuFeatures::X86::kAVX512_BW);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpsrlw), xmm1, xmm2, imm(8));
+ EXPECT_EQ(rwi.rmFeature(), CpuFeatures::X86::kAVX512_BW);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpslld, InstOptions::kNone, xmm1, xmm2, xmm3);
- EXPECT(rwi.rmFeature() == 0);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpslld), xmm1, xmm2, xmm3);
+ EXPECT_EQ(rwi.rmFeature(), 0u);
- queryRWInfoSimple(&rwi, Arch::kX64, Inst::kIdVpsllw, InstOptions::kNone, xmm1, xmm2, xmm3);
- EXPECT(rwi.rmFeature() == 0);
+ queryRWInfoInline(&rwi, Arch::kX64, BaseInst(Inst::kIdVpsllw), xmm1, xmm2, xmm3);
+ EXPECT_EQ(rwi.rmFeature(), 0u);
}
}
-#endif
+#endif // !ASMJIT_NO_INTROSPECTION
+
+#endif // ASMJIT_TEST
ASMJIT_END_SUB_NAMESPACE
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86instapi_p.h b/3rdparty/asmjit/src/asmjit/x86/x86instapi_p.h
index 56f7fb928f2..e0866ea702e 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86instapi_p.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86instapi_p.h
@@ -18,12 +18,13 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
namespace InstInternal {
#ifndef ASMJIT_NO_TEXT
-Error ASMJIT_CDECL instIdToString(Arch arch, InstId instId, String& output) noexcept;
-InstId ASMJIT_CDECL stringToInstId(Arch arch, const char* s, size_t len) noexcept;
+Error ASMJIT_CDECL instIdToString(InstId instId, String& output) noexcept;
+InstId ASMJIT_CDECL stringToInstId(const char* s, size_t len) noexcept;
#endif // !ASMJIT_NO_TEXT
#ifndef ASMJIT_NO_VALIDATION
-Error ASMJIT_CDECL validate(Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept;
+Error ASMJIT_CDECL validateX86(const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept;
+Error ASMJIT_CDECL validateX64(const BaseInst& inst, const Operand_* operands, size_t opCount, ValidationFlags validationFlags) noexcept;
#endif // !ASMJIT_NO_VALIDATION
#ifndef ASMJIT_NO_INTROSPECTION
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86instdb.cpp b/3rdparty/asmjit/src/asmjit/x86/x86instdb.cpp
index ee22526c348..c31ce91019a 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86instdb.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86instdb.cpp
@@ -3,24 +3,6 @@
// See asmjit.h or LICENSE.md for license and copyright information
// SPDX-License-Identifier: Zlib
-// ----------------------------------------------------------------------------
-// IMPORTANT: AsmJit now uses an external instruction database to populate
-// static tables within this file. Perform the following steps to regenerate
-// all tables enclosed by ${...}:
-//
-// 1. Install node.js environment <https://nodejs.org>
-// 2. Go to asmjit/tools directory
-// 3. Get the latest asmdb from <https://github.com/asmjit/asmdb> and
-// copy/link the `asmdb` directory to `asmjit/tools/asmdb`.
-// 4. Execute `node tablegen-x86.js`
-//
-// Instruction encoding and opcodes were added to the `x86inst.cpp` database
-// manually in the past and they are not updated by the script as it became
-// tricky. However, everything else is updated including instruction operands
-// and tables required to validate them, instruction read/write information
-// (including registers and flags), and all indexes to all tables.
-// ----------------------------------------------------------------------------
-
#include "../core/api-build_p.h"
#if !defined(ASMJIT_NO_X86)
@@ -47,17 +29,9 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
#define E(PREFIX, OPCODE, ModO, LL, W, EvexW, N, TT) (O_ENCODE(Opcode::k##PREFIX, 0x##OPCODE, Opcode::kModO_##ModO, Opcode::kLL_##LL, Opcode::kW_##W, Opcode::kEvex_W_##EvexW, Opcode::kCDSHL_##N, Opcode::kCDTT_##TT) | Opcode::kMM_ForceEvex)
#define O_FPU(PREFIX, OPCODE, ModO) (Opcode::kFPU_##PREFIX | (0x##OPCODE & 0xFFu) | ((0x##OPCODE >> 8) << Opcode::kFPU_2B_Shift) | Opcode::kModO_##ModO)
-// Don't store `_nameDataIndex` if instruction names are disabled. Since some
-// APIs can use `_nameDataIndex` it's much safer if it's zero if it's not defined.
-#ifndef ASMJIT_NO_TEXT
- #define NAME_DATA_INDEX(Index) Index
-#else
- #define NAME_DATA_INDEX(Index) 0
-#endif
-
// Defines an X86 instruction.
-#define INST(id, encoding, opcode0, opcode1, mainOpcodeIndex, altOpcodeIndex, nameDataIndex, commomInfoIndex, additionalInfoIndex) { \
- uint32_t(NAME_DATA_INDEX(nameDataIndex)), \
+#define INST(id, encoding, opcode0, opcode1, mainOpcodeIndex, altOpcodeIndex, commomInfoIndex, additionalInfoIndex) { \
+ uint32_t(0), \
uint32_t(commomInfoIndex), \
uint32_t(additionalInfoIndex), \
uint8_t(InstDB::kEncoding##encoding), \
@@ -67,1674 +41,1733 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
}
const InstDB::InstInfo InstDB::_instInfoTable[] = {
- /*--------------------+--------------------+------------------+--------+------------------+--------+----+----+------+----+----+
- | Instruction | Instruction | Main Opcode | EVEX |Alternative Opcode| EVEX |Op0X|Op1X|Name-X|IdxA|IdxB|
- | Id & Name | Encoding | (pp+mmm|op/o|L|w|W|N|TT.)|--(pp+mmm|op/o|L|w|W|N|TT.)| (auto-generated) |
- +---------------------+--------------------+---------+----+-+-+-+-+----+---------+----+-+-+-+-+----+----+----+------+----+---*/
+ /*--------------------+--------------------+------------------+--------+------------------+--------+----+----+----+----+
+ | Instruction | Instruction | Main Opcode | EVEX |Alternative Opcode| EVEX |Op0X|Op1X|IdxA|IdxB|
+ | Id & Name | Encoding | (pp+mmm|op/o|L|w|W|N|TT.)|--(pp+mmm|op/o|L|w|W|N|TT.)| (auto-generated) |
+ +---------------------+--------------------+---------+----+-+-+-+-+----+---------+----+-+-+-+-+----+----+----+----+---*/
// ${InstInfo:Begin}
- INST(None , None , 0 , 0 , 0 , 0 , 0 , 0 , 0 ), // #0
- INST(Aaa , X86Op_xAX , O(000000,37,_,_,_,_,_,_ ), 0 , 0 , 0 , 1 , 1 , 1 ), // #1
- INST(Aad , X86I_xAX , O(000000,D5,_,_,_,_,_,_ ), 0 , 0 , 0 , 5 , 2 , 1 ), // #2
- INST(Aam , X86I_xAX , O(000000,D4,_,_,_,_,_,_ ), 0 , 0 , 0 , 9 , 2 , 1 ), // #3
- INST(Aas , X86Op_xAX , O(000000,3F,_,_,_,_,_,_ ), 0 , 0 , 0 , 13 , 1 , 1 ), // #4
- INST(Adc , X86Arith , O(000000,10,2,_,x,_,_,_ ), 0 , 1 , 0 , 17 , 3 , 2 ), // #5
- INST(Adcx , X86Rm , O(660F38,F6,_,_,x,_,_,_ ), 0 , 2 , 0 , 21 , 4 , 3 ), // #6
- INST(Add , X86Arith , O(000000,00,0,_,x,_,_,_ ), 0 , 0 , 0 , 3146 , 3 , 1 ), // #7
- INST(Addpd , ExtRm , O(660F00,58,_,_,_,_,_,_ ), 0 , 3 , 0 , 5788 , 5 , 4 ), // #8
- INST(Addps , ExtRm , O(000F00,58,_,_,_,_,_,_ ), 0 , 4 , 0 , 5800 , 5 , 5 ), // #9
- INST(Addsd , ExtRm , O(F20F00,58,_,_,_,_,_,_ ), 0 , 5 , 0 , 6118 , 6 , 4 ), // #10
- INST(Addss , ExtRm , O(F30F00,58,_,_,_,_,_,_ ), 0 , 6 , 0 , 3283 , 7 , 5 ), // #11
- INST(Addsubpd , ExtRm , O(660F00,D0,_,_,_,_,_,_ ), 0 , 3 , 0 , 5410 , 5 , 6 ), // #12
- INST(Addsubps , ExtRm , O(F20F00,D0,_,_,_,_,_,_ ), 0 , 5 , 0 , 5422 , 5 , 6 ), // #13
- INST(Adox , X86Rm , O(F30F38,F6,_,_,x,_,_,_ ), 0 , 7 , 0 , 26 , 4 , 7 ), // #14
- INST(Aesdec , ExtRm , O(660F38,DE,_,_,_,_,_,_ ), 0 , 2 , 0 , 3352 , 5 , 8 ), // #15
- INST(Aesdeclast , ExtRm , O(660F38,DF,_,_,_,_,_,_ ), 0 , 2 , 0 , 3360 , 5 , 8 ), // #16
- INST(Aesenc , ExtRm , O(660F38,DC,_,_,_,_,_,_ ), 0 , 2 , 0 , 3372 , 5 , 8 ), // #17
- INST(Aesenclast , ExtRm , O(660F38,DD,_,_,_,_,_,_ ), 0 , 2 , 0 , 3380 , 5 , 8 ), // #18
- INST(Aesimc , ExtRm , O(660F38,DB,_,_,_,_,_,_ ), 0 , 2 , 0 , 3392 , 5 , 8 ), // #19
- INST(Aeskeygenassist , ExtRmi , O(660F3A,DF,_,_,_,_,_,_ ), 0 , 8 , 0 , 3400 , 8 , 8 ), // #20
- INST(And , X86Arith , O(000000,20,4,_,x,_,_,_ ), 0 , 9 , 0 , 2525 , 9 , 1 ), // #21
- INST(Andn , VexRvm_Wx , V(000F38,F2,_,0,x,_,_,_ ), 0 , 10 , 0 , 7789 , 10 , 9 ), // #22
- INST(Andnpd , ExtRm , O(660F00,55,_,_,_,_,_,_ ), 0 , 3 , 0 , 3433 , 5 , 4 ), // #23
- INST(Andnps , ExtRm , O(000F00,55,_,_,_,_,_,_ ), 0 , 4 , 0 , 3441 , 5 , 5 ), // #24
- INST(Andpd , ExtRm , O(660F00,54,_,_,_,_,_,_ ), 0 , 3 , 0 , 4745 , 11 , 4 ), // #25
- INST(Andps , ExtRm , O(000F00,54,_,_,_,_,_,_ ), 0 , 4 , 0 , 4755 , 11 , 5 ), // #26
- INST(Arpl , X86Mr_NoSize , O(000000,63,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 12 , 10 ), // #27
- INST(Bextr , VexRmv_Wx , V(000F38,F7,_,0,x,_,_,_ ), 0 , 10 , 0 , 36 , 13 , 9 ), // #28
- INST(Blcfill , VexVm_Wx , V(XOP_M9,01,1,0,x,_,_,_ ), 0 , 11 , 0 , 42 , 14 , 11 ), // #29
- INST(Blci , VexVm_Wx , V(XOP_M9,02,6,0,x,_,_,_ ), 0 , 12 , 0 , 50 , 14 , 11 ), // #30
- INST(Blcic , VexVm_Wx , V(XOP_M9,01,5,0,x,_,_,_ ), 0 , 13 , 0 , 55 , 14 , 11 ), // #31
- INST(Blcmsk , VexVm_Wx , V(XOP_M9,02,1,0,x,_,_,_ ), 0 , 11 , 0 , 61 , 14 , 11 ), // #32
- INST(Blcs , VexVm_Wx , V(XOP_M9,01,3,0,x,_,_,_ ), 0 , 14 , 0 , 68 , 14 , 11 ), // #33
- INST(Blendpd , ExtRmi , O(660F3A,0D,_,_,_,_,_,_ ), 0 , 8 , 0 , 3483 , 8 , 12 ), // #34
- INST(Blendps , ExtRmi , O(660F3A,0C,_,_,_,_,_,_ ), 0 , 8 , 0 , 3492 , 8 , 12 ), // #35
- INST(Blendvpd , ExtRm_XMM0 , O(660F38,15,_,_,_,_,_,_ ), 0 , 2 , 0 , 3501 , 15 , 12 ), // #36
- INST(Blendvps , ExtRm_XMM0 , O(660F38,14,_,_,_,_,_,_ ), 0 , 2 , 0 , 3511 , 15 , 12 ), // #37
- INST(Blsfill , VexVm_Wx , V(XOP_M9,01,2,0,x,_,_,_ ), 0 , 15 , 0 , 73 , 14 , 11 ), // #38
- INST(Blsi , VexVm_Wx , V(000F38,F3,3,0,x,_,_,_ ), 0 , 16 , 0 , 81 , 14 , 9 ), // #39
- INST(Blsic , VexVm_Wx , V(XOP_M9,01,6,0,x,_,_,_ ), 0 , 12 , 0 , 86 , 14 , 11 ), // #40
- INST(Blsmsk , VexVm_Wx , V(000F38,F3,2,0,x,_,_,_ ), 0 , 17 , 0 , 92 , 14 , 9 ), // #41
- INST(Blsr , VexVm_Wx , V(000F38,F3,1,0,x,_,_,_ ), 0 , 18 , 0 , 99 , 14 , 9 ), // #42
- INST(Bndcl , X86Rm , O(F30F00,1A,_,_,_,_,_,_ ), 0 , 6 , 0 , 104 , 16 , 13 ), // #43
- INST(Bndcn , X86Rm , O(F20F00,1B,_,_,_,_,_,_ ), 0 , 5 , 0 , 110 , 16 , 13 ), // #44
- INST(Bndcu , X86Rm , O(F20F00,1A,_,_,_,_,_,_ ), 0 , 5 , 0 , 116 , 16 , 13 ), // #45
- INST(Bndldx , X86Rm , O(000F00,1A,_,_,_,_,_,_ ), 0 , 4 , 0 , 122 , 17 , 13 ), // #46
- INST(Bndmk , X86Rm , O(F30F00,1B,_,_,_,_,_,_ ), 0 , 6 , 0 , 129 , 18 , 13 ), // #47
- INST(Bndmov , X86Bndmov , O(660F00,1A,_,_,_,_,_,_ ), O(660F00,1B,_,_,_,_,_,_ ), 3 , 1 , 135 , 19 , 13 ), // #48
- INST(Bndstx , X86Mr , O(000F00,1B,_,_,_,_,_,_ ), 0 , 4 , 0 , 142 , 20 , 13 ), // #49
- INST(Bound , X86Rm , O(000000,62,_,_,_,_,_,_ ), 0 , 0 , 0 , 149 , 21 , 0 ), // #50
- INST(Bsf , X86Rm , O(000F00,BC,_,_,x,_,_,_ ), 0 , 4 , 0 , 155 , 22 , 1 ), // #51
- INST(Bsr , X86Rm , O(000F00,BD,_,_,x,_,_,_ ), 0 , 4 , 0 , 159 , 22 , 1 ), // #52
- INST(Bswap , X86Bswap , O(000F00,C8,_,_,x,_,_,_ ), 0 , 4 , 0 , 163 , 23 , 0 ), // #53
- INST(Bt , X86Bt , O(000F00,A3,_,_,x,_,_,_ ), O(000F00,BA,4,_,x,_,_,_ ), 4 , 2 , 169 , 24 , 14 ), // #54
- INST(Btc , X86Bt , O(000F00,BB,_,_,x,_,_,_ ), O(000F00,BA,7,_,x,_,_,_ ), 4 , 3 , 172 , 25 , 14 ), // #55
- INST(Btr , X86Bt , O(000F00,B3,_,_,x,_,_,_ ), O(000F00,BA,6,_,x,_,_,_ ), 4 , 4 , 176 , 25 , 14 ), // #56
- INST(Bts , X86Bt , O(000F00,AB,_,_,x,_,_,_ ), O(000F00,BA,5,_,x,_,_,_ ), 4 , 5 , 180 , 25 , 14 ), // #57
- INST(Bzhi , VexRmv_Wx , V(000F38,F5,_,0,x,_,_,_ ), 0 , 10 , 0 , 184 , 13 , 15 ), // #58
- INST(Call , X86Call , O(000000,FF,2,_,_,_,_,_ ), 0 , 1 , 0 , 3038 , 26 , 1 ), // #59
- INST(Cbw , X86Op_xAX , O(660000,98,_,_,_,_,_,_ ), 0 , 19 , 0 , 189 , 27 , 0 ), // #60
- INST(Cdq , X86Op_xDX_xAX , O(000000,99,_,_,_,_,_,_ ), 0 , 0 , 0 , 193 , 28 , 0 ), // #61
- INST(Cdqe , X86Op_xAX , O(000000,98,_,_,1,_,_,_ ), 0 , 20 , 0 , 197 , 29 , 0 ), // #62
- INST(Clac , X86Op , O(000F01,CA,_,_,_,_,_,_ ), 0 , 21 , 0 , 202 , 30 , 16 ), // #63
- INST(Clc , X86Op , O(000000,F8,_,_,_,_,_,_ ), 0 , 0 , 0 , 207 , 30 , 17 ), // #64
- INST(Cld , X86Op , O(000000,FC,_,_,_,_,_,_ ), 0 , 0 , 0 , 211 , 30 , 18 ), // #65
- INST(Cldemote , X86M_Only , O(000F00,1C,0,_,_,_,_,_ ), 0 , 4 , 0 , 215 , 31 , 19 ), // #66
- INST(Clflush , X86M_Only , O(000F00,AE,7,_,_,_,_,_ ), 0 , 22 , 0 , 224 , 31 , 20 ), // #67
- INST(Clflushopt , X86M_Only , O(660F00,AE,7,_,_,_,_,_ ), 0 , 23 , 0 , 232 , 31 , 21 ), // #68
- INST(Clgi , X86Op , O(000F01,DD,_,_,_,_,_,_ ), 0 , 21 , 0 , 243 , 30 , 22 ), // #69
- INST(Cli , X86Op , O(000000,FA,_,_,_,_,_,_ ), 0 , 0 , 0 , 248 , 30 , 23 ), // #70
- INST(Clrssbsy , X86M_Only , O(F30F00,AE,6,_,_,_,_,_ ), 0 , 24 , 0 , 252 , 32 , 24 ), // #71
- INST(Clts , X86Op , O(000F00,06,_,_,_,_,_,_ ), 0 , 4 , 0 , 261 , 30 , 0 ), // #72
- INST(Clui , X86Op , O(F30F01,EE,_,_,_,_,_,_ ), 0 , 25 , 0 , 266 , 33 , 25 ), // #73
- INST(Clwb , X86M_Only , O(660F00,AE,6,_,_,_,_,_ ), 0 , 26 , 0 , 271 , 31 , 26 ), // #74
- INST(Clzero , X86Op_MemZAX , O(000F01,FC,_,_,_,_,_,_ ), 0 , 21 , 0 , 276 , 34 , 27 ), // #75
- INST(Cmc , X86Op , O(000000,F5,_,_,_,_,_,_ ), 0 , 0 , 0 , 283 , 30 , 28 ), // #76
- INST(Cmova , X86Rm , O(000F00,47,_,_,x,_,_,_ ), 0 , 4 , 0 , 287 , 22 , 29 ), // #77
- INST(Cmovae , X86Rm , O(000F00,43,_,_,x,_,_,_ ), 0 , 4 , 0 , 293 , 22 , 30 ), // #78
- INST(Cmovb , X86Rm , O(000F00,42,_,_,x,_,_,_ ), 0 , 4 , 0 , 648 , 22 , 30 ), // #79
- INST(Cmovbe , X86Rm , O(000F00,46,_,_,x,_,_,_ ), 0 , 4 , 0 , 655 , 22 , 29 ), // #80
- INST(Cmovc , X86Rm , O(000F00,42,_,_,x,_,_,_ ), 0 , 4 , 0 , 300 , 22 , 30 ), // #81
- INST(Cmove , X86Rm , O(000F00,44,_,_,x,_,_,_ ), 0 , 4 , 0 , 663 , 22 , 31 ), // #82
- INST(Cmovg , X86Rm , O(000F00,4F,_,_,x,_,_,_ ), 0 , 4 , 0 , 306 , 22 , 32 ), // #83
- INST(Cmovge , X86Rm , O(000F00,4D,_,_,x,_,_,_ ), 0 , 4 , 0 , 312 , 22 , 33 ), // #84
- INST(Cmovl , X86Rm , O(000F00,4C,_,_,x,_,_,_ ), 0 , 4 , 0 , 319 , 22 , 33 ), // #85
- INST(Cmovle , X86Rm , O(000F00,4E,_,_,x,_,_,_ ), 0 , 4 , 0 , 325 , 22 , 32 ), // #86
- INST(Cmovna , X86Rm , O(000F00,46,_,_,x,_,_,_ ), 0 , 4 , 0 , 332 , 22 , 29 ), // #87
- INST(Cmovnae , X86Rm , O(000F00,42,_,_,x,_,_,_ ), 0 , 4 , 0 , 339 , 22 , 30 ), // #88
- INST(Cmovnb , X86Rm , O(000F00,43,_,_,x,_,_,_ ), 0 , 4 , 0 , 670 , 22 , 30 ), // #89
- INST(Cmovnbe , X86Rm , O(000F00,47,_,_,x,_,_,_ ), 0 , 4 , 0 , 678 , 22 , 29 ), // #90
- INST(Cmovnc , X86Rm , O(000F00,43,_,_,x,_,_,_ ), 0 , 4 , 0 , 347 , 22 , 30 ), // #91
- INST(Cmovne , X86Rm , O(000F00,45,_,_,x,_,_,_ ), 0 , 4 , 0 , 687 , 22 , 31 ), // #92
- INST(Cmovng , X86Rm , O(000F00,4E,_,_,x,_,_,_ ), 0 , 4 , 0 , 354 , 22 , 32 ), // #93
- INST(Cmovnge , X86Rm , O(000F00,4C,_,_,x,_,_,_ ), 0 , 4 , 0 , 361 , 22 , 33 ), // #94
- INST(Cmovnl , X86Rm , O(000F00,4D,_,_,x,_,_,_ ), 0 , 4 , 0 , 369 , 22 , 33 ), // #95
- INST(Cmovnle , X86Rm , O(000F00,4F,_,_,x,_,_,_ ), 0 , 4 , 0 , 376 , 22 , 32 ), // #96
- INST(Cmovno , X86Rm , O(000F00,41,_,_,x,_,_,_ ), 0 , 4 , 0 , 384 , 22 , 34 ), // #97
- INST(Cmovnp , X86Rm , O(000F00,4B,_,_,x,_,_,_ ), 0 , 4 , 0 , 391 , 22 , 35 ), // #98
- INST(Cmovns , X86Rm , O(000F00,49,_,_,x,_,_,_ ), 0 , 4 , 0 , 398 , 22 , 36 ), // #99
- INST(Cmovnz , X86Rm , O(000F00,45,_,_,x,_,_,_ ), 0 , 4 , 0 , 405 , 22 , 31 ), // #100
- INST(Cmovo , X86Rm , O(000F00,40,_,_,x,_,_,_ ), 0 , 4 , 0 , 412 , 22 , 34 ), // #101
- INST(Cmovp , X86Rm , O(000F00,4A,_,_,x,_,_,_ ), 0 , 4 , 0 , 418 , 22 , 35 ), // #102
- INST(Cmovpe , X86Rm , O(000F00,4A,_,_,x,_,_,_ ), 0 , 4 , 0 , 424 , 22 , 35 ), // #103
- INST(Cmovpo , X86Rm , O(000F00,4B,_,_,x,_,_,_ ), 0 , 4 , 0 , 431 , 22 , 35 ), // #104
- INST(Cmovs , X86Rm , O(000F00,48,_,_,x,_,_,_ ), 0 , 4 , 0 , 438 , 22 , 36 ), // #105
- INST(Cmovz , X86Rm , O(000F00,44,_,_,x,_,_,_ ), 0 , 4 , 0 , 444 , 22 , 31 ), // #106
- INST(Cmp , X86Arith , O(000000,38,7,_,x,_,_,_ ), 0 , 27 , 0 , 450 , 35 , 1 ), // #107
- INST(Cmppd , ExtRmi , O(660F00,C2,_,_,_,_,_,_ ), 0 , 3 , 0 , 3737 , 8 , 4 ), // #108
- INST(Cmpps , ExtRmi , O(000F00,C2,_,_,_,_,_,_ ), 0 , 4 , 0 , 3751 , 8 , 5 ), // #109
- INST(Cmps , X86StrMm , O(000000,A6,_,_,_,_,_,_ ), 0 , 0 , 0 , 454 , 36 , 37 ), // #110
- INST(Cmpsd , ExtRmi , O(F20F00,C2,_,_,_,_,_,_ ), 0 , 5 , 0 , 3758 , 37 , 4 ), // #111
- INST(Cmpss , ExtRmi , O(F30F00,C2,_,_,_,_,_,_ ), 0 , 6 , 0 , 3772 , 38 , 5 ), // #112
- INST(Cmpxchg , X86Cmpxchg , O(000F00,B0,_,_,x,_,_,_ ), 0 , 4 , 0 , 459 , 39 , 38 ), // #113
- INST(Cmpxchg16b , X86Cmpxchg8b_16b , O(000F00,C7,1,_,1,_,_,_ ), 0 , 28 , 0 , 467 , 40 , 39 ), // #114
- INST(Cmpxchg8b , X86Cmpxchg8b_16b , O(000F00,C7,1,_,_,_,_,_ ), 0 , 29 , 0 , 478 , 41 , 40 ), // #115
- INST(Comisd , ExtRm , O(660F00,2F,_,_,_,_,_,_ ), 0 , 3 , 0 , 11391, 6 , 41 ), // #116
- INST(Comiss , ExtRm , O(000F00,2F,_,_,_,_,_,_ ), 0 , 4 , 0 , 11409, 7 , 42 ), // #117
- INST(Cpuid , X86Op , O(000F00,A2,_,_,_,_,_,_ ), 0 , 4 , 0 , 488 , 42 , 43 ), // #118
- INST(Cqo , X86Op_xDX_xAX , O(000000,99,_,_,1,_,_,_ ), 0 , 20 , 0 , 494 , 43 , 0 ), // #119
- INST(Crc32 , X86Crc , O(F20F38,F0,_,_,x,_,_,_ ), 0 , 30 , 0 , 498 , 44 , 44 ), // #120
- INST(Cvtdq2pd , ExtRm , O(F30F00,E6,_,_,_,_,_,_ ), 0 , 6 , 0 , 3827 , 6 , 4 ), // #121
- INST(Cvtdq2ps , ExtRm , O(000F00,5B,_,_,_,_,_,_ ), 0 , 4 , 0 , 3847 , 5 , 4 ), // #122
- INST(Cvtpd2dq , ExtRm , O(F20F00,E6,_,_,_,_,_,_ ), 0 , 5 , 0 , 3886 , 5 , 4 ), // #123
- INST(Cvtpd2pi , ExtRm , O(660F00,2D,_,_,_,_,_,_ ), 0 , 3 , 0 , 504 , 45 , 4 ), // #124
- INST(Cvtpd2ps , ExtRm , O(660F00,5A,_,_,_,_,_,_ ), 0 , 3 , 0 , 3906 , 5 , 4 ), // #125
- INST(Cvtpi2pd , ExtRm , O(660F00,2A,_,_,_,_,_,_ ), 0 , 3 , 0 , 513 , 46 , 4 ), // #126
- INST(Cvtpi2ps , ExtRm , O(000F00,2A,_,_,_,_,_,_ ), 0 , 4 , 0 , 522 , 46 , 5 ), // #127
- INST(Cvtps2dq , ExtRm , O(660F00,5B,_,_,_,_,_,_ ), 0 , 3 , 0 , 4040 , 5 , 4 ), // #128
- INST(Cvtps2pd , ExtRm , O(000F00,5A,_,_,_,_,_,_ ), 0 , 4 , 0 , 4050 , 6 , 4 ), // #129
- INST(Cvtps2pi , ExtRm , O(000F00,2D,_,_,_,_,_,_ ), 0 , 4 , 0 , 531 , 47 , 5 ), // #130
- INST(Cvtsd2si , ExtRm_Wx_GpqOnly , O(F20F00,2D,_,_,x,_,_,_ ), 0 , 5 , 0 , 4153 , 48 , 4 ), // #131
- INST(Cvtsd2ss , ExtRm , O(F20F00,5A,_,_,_,_,_,_ ), 0 , 5 , 0 , 4163 , 6 , 4 ), // #132
- INST(Cvtsi2sd , ExtRm_Wx , O(F20F00,2A,_,_,x,_,_,_ ), 0 , 5 , 0 , 4225 , 49 , 4 ), // #133
- INST(Cvtsi2ss , ExtRm_Wx , O(F30F00,2A,_,_,x,_,_,_ ), 0 , 6 , 0 , 4245 , 49 , 5 ), // #134
- INST(Cvtss2sd , ExtRm , O(F30F00,5A,_,_,_,_,_,_ ), 0 , 6 , 0 , 4255 , 7 , 4 ), // #135
- INST(Cvtss2si , ExtRm_Wx_GpqOnly , O(F30F00,2D,_,_,x,_,_,_ ), 0 , 6 , 0 , 4275 , 50 , 5 ), // #136
- INST(Cvttpd2dq , ExtRm , O(660F00,E6,_,_,_,_,_,_ ), 0 , 3 , 0 , 4296 , 5 , 4 ), // #137
- INST(Cvttpd2pi , ExtRm , O(660F00,2C,_,_,_,_,_,_ ), 0 , 3 , 0 , 540 , 45 , 4 ), // #138
- INST(Cvttps2dq , ExtRm , O(F30F00,5B,_,_,_,_,_,_ ), 0 , 6 , 0 , 4409 , 5 , 4 ), // #139
- INST(Cvttps2pi , ExtRm , O(000F00,2C,_,_,_,_,_,_ ), 0 , 4 , 0 , 550 , 47 , 5 ), // #140
- INST(Cvttsd2si , ExtRm_Wx_GpqOnly , O(F20F00,2C,_,_,x,_,_,_ ), 0 , 5 , 0 , 4455 , 48 , 4 ), // #141
- INST(Cvttss2si , ExtRm_Wx_GpqOnly , O(F30F00,2C,_,_,x,_,_,_ ), 0 , 6 , 0 , 4501 , 50 , 5 ), // #142
- INST(Cwd , X86Op_xDX_xAX , O(660000,99,_,_,_,_,_,_ ), 0 , 19 , 0 , 560 , 51 , 0 ), // #143
- INST(Cwde , X86Op_xAX , O(000000,98,_,_,_,_,_,_ ), 0 , 0 , 0 , 564 , 52 , 0 ), // #144
- INST(Daa , X86Op , O(000000,27,_,_,_,_,_,_ ), 0 , 0 , 0 , 569 , 1 , 1 ), // #145
- INST(Das , X86Op , O(000000,2F,_,_,_,_,_,_ ), 0 , 0 , 0 , 573 , 1 , 1 ), // #146
- INST(Dec , X86IncDec , O(000000,FE,1,_,x,_,_,_ ), O(000000,48,_,_,x,_,_,_ ), 31 , 6 , 3355 , 53 , 45 ), // #147
- INST(Div , X86M_GPB_MulDiv , O(000000,F6,6,_,x,_,_,_ ), 0 , 32 , 0 , 810 , 54 , 1 ), // #148
- INST(Divpd , ExtRm , O(660F00,5E,_,_,_,_,_,_ ), 0 , 3 , 0 , 4652 , 5 , 4 ), // #149
- INST(Divps , ExtRm , O(000F00,5E,_,_,_,_,_,_ ), 0 , 4 , 0 , 4666 , 5 , 5 ), // #150
- INST(Divsd , ExtRm , O(F20F00,5E,_,_,_,_,_,_ ), 0 , 5 , 0 , 4673 , 6 , 4 ), // #151
- INST(Divss , ExtRm , O(F30F00,5E,_,_,_,_,_,_ ), 0 , 6 , 0 , 4687 , 7 , 5 ), // #152
- INST(Dppd , ExtRmi , O(660F3A,41,_,_,_,_,_,_ ), 0 , 8 , 0 , 4704 , 8 , 12 ), // #153
- INST(Dpps , ExtRmi , O(660F3A,40,_,_,_,_,_,_ ), 0 , 8 , 0 , 4710 , 8 , 12 ), // #154
- INST(Emms , X86Op , O(000F00,77,_,_,_,_,_,_ ), 0 , 4 , 0 , 778 , 55 , 46 ), // #155
- INST(Endbr32 , X86Op_Mod11RM , O(F30F00,1E,7,_,_,_,_,3 ), 0 , 33 , 0 , 577 , 30 , 47 ), // #156
- INST(Endbr64 , X86Op_Mod11RM , O(F30F00,1E,7,_,_,_,_,2 ), 0 , 34 , 0 , 585 , 30 , 47 ), // #157
- INST(Enqcmd , X86EnqcmdMovdir64b , O(F20F38,F8,_,_,_,_,_,_ ), 0 , 30 , 0 , 593 , 56 , 48 ), // #158
- INST(Enqcmds , X86EnqcmdMovdir64b , O(F30F38,F8,_,_,_,_,_,_ ), 0 , 7 , 0 , 600 , 56 , 48 ), // #159
- INST(Enter , X86Enter , O(000000,C8,_,_,_,_,_,_ ), 0 , 0 , 0 , 3046 , 57 , 0 ), // #160
- INST(Extractps , ExtExtract , O(660F3A,17,_,_,_,_,_,_ ), 0 , 8 , 0 , 4900 , 58 , 12 ), // #161
- INST(Extrq , ExtExtrq , O(660F00,79,_,_,_,_,_,_ ), O(660F00,78,0,_,_,_,_,_ ), 3 , 7 , 8625 , 59 , 49 ), // #162
- INST(F2xm1 , FpuOp , O_FPU(00,D9F0,_) , 0 , 35 , 0 , 608 , 30 , 0 ), // #163
- INST(Fabs , FpuOp , O_FPU(00,D9E1,_) , 0 , 35 , 0 , 614 , 30 , 0 ), // #164
- INST(Fadd , FpuArith , O_FPU(00,C0C0,0) , 0 , 36 , 0 , 2121 , 60 , 0 ), // #165
- INST(Faddp , FpuRDef , O_FPU(00,DEC0,_) , 0 , 37 , 0 , 619 , 61 , 0 ), // #166
- INST(Fbld , X86M_Only , O_FPU(00,00DF,4) , 0 , 38 , 0 , 625 , 62 , 0 ), // #167
- INST(Fbstp , X86M_Only , O_FPU(00,00DF,6) , 0 , 39 , 0 , 630 , 62 , 0 ), // #168
- INST(Fchs , FpuOp , O_FPU(00,D9E0,_) , 0 , 35 , 0 , 636 , 30 , 0 ), // #169
- INST(Fclex , FpuOp , O_FPU(9B,DBE2,_) , 0 , 40 , 0 , 641 , 30 , 0 ), // #170
- INST(Fcmovb , FpuR , O_FPU(00,DAC0,_) , 0 , 41 , 0 , 647 , 63 , 30 ), // #171
- INST(Fcmovbe , FpuR , O_FPU(00,DAD0,_) , 0 , 41 , 0 , 654 , 63 , 29 ), // #172
- INST(Fcmove , FpuR , O_FPU(00,DAC8,_) , 0 , 41 , 0 , 662 , 63 , 31 ), // #173
- INST(Fcmovnb , FpuR , O_FPU(00,DBC0,_) , 0 , 42 , 0 , 669 , 63 , 30 ), // #174
- INST(Fcmovnbe , FpuR , O_FPU(00,DBD0,_) , 0 , 42 , 0 , 677 , 63 , 29 ), // #175
- INST(Fcmovne , FpuR , O_FPU(00,DBC8,_) , 0 , 42 , 0 , 686 , 63 , 31 ), // #176
- INST(Fcmovnu , FpuR , O_FPU(00,DBD8,_) , 0 , 42 , 0 , 694 , 63 , 35 ), // #177
- INST(Fcmovu , FpuR , O_FPU(00,DAD8,_) , 0 , 41 , 0 , 702 , 63 , 35 ), // #178
- INST(Fcom , FpuCom , O_FPU(00,D0D0,2) , 0 , 43 , 0 , 709 , 64 , 0 ), // #179
- INST(Fcomi , FpuR , O_FPU(00,DBF0,_) , 0 , 42 , 0 , 714 , 63 , 50 ), // #180
- INST(Fcomip , FpuR , O_FPU(00,DFF0,_) , 0 , 44 , 0 , 720 , 63 , 50 ), // #181
- INST(Fcomp , FpuCom , O_FPU(00,D8D8,3) , 0 , 45 , 0 , 727 , 64 , 0 ), // #182
- INST(Fcompp , FpuOp , O_FPU(00,DED9,_) , 0 , 37 , 0 , 733 , 30 , 0 ), // #183
- INST(Fcos , FpuOp , O_FPU(00,D9FF,_) , 0 , 35 , 0 , 740 , 30 , 0 ), // #184
- INST(Fdecstp , FpuOp , O_FPU(00,D9F6,_) , 0 , 35 , 0 , 745 , 30 , 0 ), // #185
- INST(Fdiv , FpuArith , O_FPU(00,F0F8,6) , 0 , 46 , 0 , 753 , 60 , 0 ), // #186
- INST(Fdivp , FpuRDef , O_FPU(00,DEF8,_) , 0 , 37 , 0 , 758 , 61 , 0 ), // #187
- INST(Fdivr , FpuArith , O_FPU(00,F8F0,7) , 0 , 47 , 0 , 764 , 60 , 0 ), // #188
- INST(Fdivrp , FpuRDef , O_FPU(00,DEF0,_) , 0 , 37 , 0 , 770 , 61 , 0 ), // #189
- INST(Femms , X86Op , O(000F00,0E,_,_,_,_,_,_ ), 0 , 4 , 0 , 777 , 30 , 51 ), // #190
- INST(Ffree , FpuR , O_FPU(00,DDC0,_) , 0 , 48 , 0 , 783 , 63 , 0 ), // #191
- INST(Fiadd , FpuM , O_FPU(00,00DA,0) , 0 , 49 , 0 , 789 , 65 , 0 ), // #192
- INST(Ficom , FpuM , O_FPU(00,00DA,2) , 0 , 50 , 0 , 795 , 65 , 0 ), // #193
- INST(Ficomp , FpuM , O_FPU(00,00DA,3) , 0 , 51 , 0 , 801 , 65 , 0 ), // #194
- INST(Fidiv , FpuM , O_FPU(00,00DA,6) , 0 , 39 , 0 , 808 , 65 , 0 ), // #195
- INST(Fidivr , FpuM , O_FPU(00,00DA,7) , 0 , 52 , 0 , 814 , 65 , 0 ), // #196
- INST(Fild , FpuM , O_FPU(00,00DB,0) , O_FPU(00,00DF,5) , 49 , 8 , 821 , 66 , 0 ), // #197
- INST(Fimul , FpuM , O_FPU(00,00DA,1) , 0 , 53 , 0 , 826 , 65 , 0 ), // #198
- INST(Fincstp , FpuOp , O_FPU(00,D9F7,_) , 0 , 35 , 0 , 832 , 30 , 0 ), // #199
- INST(Finit , FpuOp , O_FPU(9B,DBE3,_) , 0 , 40 , 0 , 840 , 30 , 0 ), // #200
- INST(Fist , FpuM , O_FPU(00,00DB,2) , 0 , 50 , 0 , 846 , 65 , 0 ), // #201
- INST(Fistp , FpuM , O_FPU(00,00DB,3) , O_FPU(00,00DF,7) , 51 , 9 , 851 , 66 , 0 ), // #202
- INST(Fisttp , FpuM , O_FPU(00,00DB,1) , O_FPU(00,00DD,1) , 53 , 10 , 857 , 66 , 6 ), // #203
- INST(Fisub , FpuM , O_FPU(00,00DA,4) , 0 , 38 , 0 , 864 , 65 , 0 ), // #204
- INST(Fisubr , FpuM , O_FPU(00,00DA,5) , 0 , 54 , 0 , 870 , 65 , 0 ), // #205
- INST(Fld , FpuFldFst , O_FPU(00,00D9,0) , O_FPU(00,00DB,5) , 49 , 11 , 877 , 67 , 0 ), // #206
- INST(Fld1 , FpuOp , O_FPU(00,D9E8,_) , 0 , 35 , 0 , 881 , 30 , 0 ), // #207
- INST(Fldcw , X86M_Only , O_FPU(00,00D9,5) , 0 , 54 , 0 , 886 , 68 , 0 ), // #208
- INST(Fldenv , X86M_Only , O_FPU(00,00D9,4) , 0 , 38 , 0 , 892 , 69 , 0 ), // #209
- INST(Fldl2e , FpuOp , O_FPU(00,D9EA,_) , 0 , 35 , 0 , 899 , 30 , 0 ), // #210
- INST(Fldl2t , FpuOp , O_FPU(00,D9E9,_) , 0 , 35 , 0 , 906 , 30 , 0 ), // #211
- INST(Fldlg2 , FpuOp , O_FPU(00,D9EC,_) , 0 , 35 , 0 , 913 , 30 , 0 ), // #212
- INST(Fldln2 , FpuOp , O_FPU(00,D9ED,_) , 0 , 35 , 0 , 920 , 30 , 0 ), // #213
- INST(Fldpi , FpuOp , O_FPU(00,D9EB,_) , 0 , 35 , 0 , 927 , 30 , 0 ), // #214
- INST(Fldz , FpuOp , O_FPU(00,D9EE,_) , 0 , 35 , 0 , 933 , 30 , 0 ), // #215
- INST(Fmul , FpuArith , O_FPU(00,C8C8,1) , 0 , 55 , 0 , 2163 , 60 , 0 ), // #216
- INST(Fmulp , FpuRDef , O_FPU(00,DEC8,_) , 0 , 37 , 0 , 938 , 61 , 0 ), // #217
- INST(Fnclex , FpuOp , O_FPU(00,DBE2,_) , 0 , 42 , 0 , 944 , 30 , 0 ), // #218
- INST(Fninit , FpuOp , O_FPU(00,DBE3,_) , 0 , 42 , 0 , 951 , 30 , 0 ), // #219
- INST(Fnop , FpuOp , O_FPU(00,D9D0,_) , 0 , 35 , 0 , 958 , 30 , 0 ), // #220
- INST(Fnsave , X86M_Only , O_FPU(00,00DD,6) , 0 , 39 , 0 , 963 , 69 , 0 ), // #221
- INST(Fnstcw , X86M_Only , O_FPU(00,00D9,7) , 0 , 52 , 0 , 970 , 68 , 0 ), // #222
- INST(Fnstenv , X86M_Only , O_FPU(00,00D9,6) , 0 , 39 , 0 , 977 , 69 , 0 ), // #223
- INST(Fnstsw , FpuStsw , O_FPU(00,00DD,7) , O_FPU(00,DFE0,_) , 52 , 12 , 985 , 70 , 0 ), // #224
- INST(Fpatan , FpuOp , O_FPU(00,D9F3,_) , 0 , 35 , 0 , 992 , 30 , 0 ), // #225
- INST(Fprem , FpuOp , O_FPU(00,D9F8,_) , 0 , 35 , 0 , 999 , 30 , 0 ), // #226
- INST(Fprem1 , FpuOp , O_FPU(00,D9F5,_) , 0 , 35 , 0 , 1005 , 30 , 0 ), // #227
- INST(Fptan , FpuOp , O_FPU(00,D9F2,_) , 0 , 35 , 0 , 1012 , 30 , 0 ), // #228
- INST(Frndint , FpuOp , O_FPU(00,D9FC,_) , 0 , 35 , 0 , 1018 , 30 , 0 ), // #229
- INST(Frstor , X86M_Only , O_FPU(00,00DD,4) , 0 , 38 , 0 , 1026 , 69 , 0 ), // #230
- INST(Fsave , X86M_Only , O_FPU(9B,00DD,6) , 0 , 56 , 0 , 1033 , 69 , 0 ), // #231
- INST(Fscale , FpuOp , O_FPU(00,D9FD,_) , 0 , 35 , 0 , 1039 , 30 , 0 ), // #232
- INST(Fsin , FpuOp , O_FPU(00,D9FE,_) , 0 , 35 , 0 , 1046 , 30 , 0 ), // #233
- INST(Fsincos , FpuOp , O_FPU(00,D9FB,_) , 0 , 35 , 0 , 1051 , 30 , 0 ), // #234
- INST(Fsqrt , FpuOp , O_FPU(00,D9FA,_) , 0 , 35 , 0 , 1059 , 30 , 0 ), // #235
- INST(Fst , FpuFldFst , O_FPU(00,00D9,2) , 0 , 50 , 0 , 1065 , 71 , 0 ), // #236
- INST(Fstcw , X86M_Only , O_FPU(9B,00D9,7) , 0 , 57 , 0 , 1069 , 68 , 0 ), // #237
- INST(Fstenv , X86M_Only , O_FPU(9B,00D9,6) , 0 , 56 , 0 , 1075 , 69 , 0 ), // #238
- INST(Fstp , FpuFldFst , O_FPU(00,00D9,3) , O(000000,DB,7,_,_,_,_,_ ), 51 , 13 , 1082 , 67 , 0 ), // #239
- INST(Fstsw , FpuStsw , O_FPU(9B,00DD,7) , O_FPU(9B,DFE0,_) , 57 , 14 , 1087 , 70 , 0 ), // #240
- INST(Fsub , FpuArith , O_FPU(00,E0E8,4) , 0 , 58 , 0 , 2241 , 60 , 0 ), // #241
- INST(Fsubp , FpuRDef , O_FPU(00,DEE8,_) , 0 , 37 , 0 , 1093 , 61 , 0 ), // #242
- INST(Fsubr , FpuArith , O_FPU(00,E8E0,5) , 0 , 59 , 0 , 2247 , 60 , 0 ), // #243
- INST(Fsubrp , FpuRDef , O_FPU(00,DEE0,_) , 0 , 37 , 0 , 1099 , 61 , 0 ), // #244
- INST(Ftst , FpuOp , O_FPU(00,D9E4,_) , 0 , 35 , 0 , 1106 , 30 , 0 ), // #245
- INST(Fucom , FpuRDef , O_FPU(00,DDE0,_) , 0 , 48 , 0 , 1111 , 61 , 0 ), // #246
- INST(Fucomi , FpuR , O_FPU(00,DBE8,_) , 0 , 42 , 0 , 1117 , 63 , 50 ), // #247
- INST(Fucomip , FpuR , O_FPU(00,DFE8,_) , 0 , 44 , 0 , 1124 , 63 , 50 ), // #248
- INST(Fucomp , FpuRDef , O_FPU(00,DDE8,_) , 0 , 48 , 0 , 1132 , 61 , 0 ), // #249
- INST(Fucompp , FpuOp , O_FPU(00,DAE9,_) , 0 , 41 , 0 , 1139 , 30 , 0 ), // #250
- INST(Fwait , X86Op , O_FPU(00,009B,_) , 0 , 49 , 0 , 1147 , 30 , 0 ), // #251
- INST(Fxam , FpuOp , O_FPU(00,D9E5,_) , 0 , 35 , 0 , 1153 , 30 , 0 ), // #252
- INST(Fxch , FpuR , O_FPU(00,D9C8,_) , 0 , 35 , 0 , 1158 , 61 , 0 ), // #253
- INST(Fxrstor , X86M_Only , O(000F00,AE,1,_,_,_,_,_ ), 0 , 29 , 0 , 1163 , 69 , 52 ), // #254
- INST(Fxrstor64 , X86M_Only , O(000F00,AE,1,_,1,_,_,_ ), 0 , 28 , 0 , 1171 , 72 , 52 ), // #255
- INST(Fxsave , X86M_Only , O(000F00,AE,0,_,_,_,_,_ ), 0 , 4 , 0 , 1181 , 69 , 52 ), // #256
- INST(Fxsave64 , X86M_Only , O(000F00,AE,0,_,1,_,_,_ ), 0 , 60 , 0 , 1188 , 72 , 52 ), // #257
- INST(Fxtract , FpuOp , O_FPU(00,D9F4,_) , 0 , 35 , 0 , 1197 , 30 , 0 ), // #258
- INST(Fyl2x , FpuOp , O_FPU(00,D9F1,_) , 0 , 35 , 0 , 1205 , 30 , 0 ), // #259
- INST(Fyl2xp1 , FpuOp , O_FPU(00,D9F9,_) , 0 , 35 , 0 , 1211 , 30 , 0 ), // #260
- INST(Getsec , X86Op , O(000F00,37,_,_,_,_,_,_ ), 0 , 4 , 0 , 1219 , 30 , 53 ), // #261
- INST(Gf2p8affineinvqb , ExtRmi , O(660F3A,CF,_,_,_,_,_,_ ), 0 , 8 , 0 , 6789 , 8 , 54 ), // #262
- INST(Gf2p8affineqb , ExtRmi , O(660F3A,CE,_,_,_,_,_,_ ), 0 , 8 , 0 , 6807 , 8 , 54 ), // #263
- INST(Gf2p8mulb , ExtRm , O(660F38,CF,_,_,_,_,_,_ ), 0 , 2 , 0 , 6822 , 5 , 54 ), // #264
- INST(Haddpd , ExtRm , O(660F00,7C,_,_,_,_,_,_ ), 0 , 3 , 0 , 6833 , 5 , 6 ), // #265
- INST(Haddps , ExtRm , O(F20F00,7C,_,_,_,_,_,_ ), 0 , 5 , 0 , 6841 , 5 , 6 ), // #266
- INST(Hlt , X86Op , O(000000,F4,_,_,_,_,_,_ ), 0 , 0 , 0 , 1226 , 30 , 0 ), // #267
- INST(Hreset , X86Op_Mod11RM_I8 , O(F30F3A,F0,0,_,_,_,_,_ ), 0 , 61 , 0 , 1230 , 73 , 55 ), // #268
- INST(Hsubpd , ExtRm , O(660F00,7D,_,_,_,_,_,_ ), 0 , 3 , 0 , 6849 , 5 , 6 ), // #269
- INST(Hsubps , ExtRm , O(F20F00,7D,_,_,_,_,_,_ ), 0 , 5 , 0 , 6857 , 5 , 6 ), // #270
- INST(Idiv , X86M_GPB_MulDiv , O(000000,F6,7,_,x,_,_,_ ), 0 , 27 , 0 , 809 , 54 , 1 ), // #271
- INST(Imul , X86Imul , O(000000,F6,5,_,x,_,_,_ ), 0 , 62 , 0 , 827 , 74 , 1 ), // #272
- INST(In , X86In , O(000000,EC,_,_,_,_,_,_ ), O(000000,E4,_,_,_,_,_,_ ), 0 , 15 , 11572, 75 , 0 ), // #273
- INST(Inc , X86IncDec , O(000000,FE,0,_,x,_,_,_ ), O(000000,40,_,_,x,_,_,_ ), 0 , 16 , 1237 , 53 , 45 ), // #274
- INST(Incsspd , X86M , O(F30F00,AE,5,_,0,_,_,_ ), 0 , 63 , 0 , 1241 , 76 , 56 ), // #275
- INST(Incsspq , X86M , O(F30F00,AE,5,_,1,_,_,_ ), 0 , 64 , 0 , 1249 , 77 , 56 ), // #276
- INST(Ins , X86Ins , O(000000,6C,_,_,_,_,_,_ ), 0 , 0 , 0 , 1916 , 78 , 0 ), // #277
- INST(Insertps , ExtRmi , O(660F3A,21,_,_,_,_,_,_ ), 0 , 8 , 0 , 6993 , 38 , 12 ), // #278
- INST(Insertq , ExtInsertq , O(F20F00,79,_,_,_,_,_,_ ), O(F20F00,78,_,_,_,_,_,_ ), 5 , 17 , 1257 , 79 , 49 ), // #279
- INST(Int , X86Int , O(000000,CD,_,_,_,_,_,_ ), 0 , 0 , 0 , 1022 , 80 , 0 ), // #280
- INST(Int3 , X86Op , O(000000,CC,_,_,_,_,_,_ ), 0 , 0 , 0 , 1265 , 30 , 0 ), // #281
- INST(Into , X86Op , O(000000,CE,_,_,_,_,_,_ ), 0 , 0 , 0 , 1270 , 81 , 57 ), // #282
- INST(Invd , X86Op , O(000F00,08,_,_,_,_,_,_ ), 0 , 4 , 0 , 11501, 30 , 43 ), // #283
- INST(Invept , X86Rm_NoSize , O(660F38,80,_,_,_,_,_,_ ), 0 , 2 , 0 , 1275 , 82 , 58 ), // #284
- INST(Invlpg , X86M_Only , O(000F00,01,7,_,_,_,_,_ ), 0 , 22 , 0 , 1282 , 69 , 43 ), // #285
- INST(Invlpga , X86Op_xAddr , O(000F01,DF,_,_,_,_,_,_ ), 0 , 21 , 0 , 1289 , 83 , 22 ), // #286
- INST(Invpcid , X86Rm_NoSize , O(660F38,82,_,_,_,_,_,_ ), 0 , 2 , 0 , 1297 , 82 , 43 ), // #287
- INST(Invvpid , X86Rm_NoSize , O(660F38,81,_,_,_,_,_,_ ), 0 , 2 , 0 , 1305 , 82 , 58 ), // #288
- INST(Iret , X86Op , O(660000,CF,_,_,_,_,_,_ ), 0 , 19 , 0 , 3226 , 84 , 1 ), // #289
- INST(Iretd , X86Op , O(000000,CF,_,_,_,_,_,_ ), 0 , 0 , 0 , 1313 , 84 , 1 ), // #290
- INST(Iretq , X86Op , O(000000,CF,_,_,1,_,_,_ ), 0 , 20 , 0 , 1319 , 85 , 1 ), // #291
- INST(Ja , X86Jcc , O(000F00,87,_,_,_,_,_,_ ), O(000000,77,_,_,_,_,_,_ ), 4 , 18 , 1325 , 86 , 59 ), // #292
- INST(Jae , X86Jcc , O(000F00,83,_,_,_,_,_,_ ), O(000000,73,_,_,_,_,_,_ ), 4 , 19 , 1328 , 86 , 60 ), // #293
- INST(Jb , X86Jcc , O(000F00,82,_,_,_,_,_,_ ), O(000000,72,_,_,_,_,_,_ ), 4 , 20 , 1332 , 86 , 60 ), // #294
- INST(Jbe , X86Jcc , O(000F00,86,_,_,_,_,_,_ ), O(000000,76,_,_,_,_,_,_ ), 4 , 21 , 1335 , 86 , 59 ), // #295
- INST(Jc , X86Jcc , O(000F00,82,_,_,_,_,_,_ ), O(000000,72,_,_,_,_,_,_ ), 4 , 20 , 1339 , 86 , 60 ), // #296
- INST(Je , X86Jcc , O(000F00,84,_,_,_,_,_,_ ), O(000000,74,_,_,_,_,_,_ ), 4 , 22 , 1342 , 86 , 61 ), // #297
- INST(Jecxz , X86JecxzLoop , 0 , O(000000,E3,_,_,_,_,_,_ ), 0 , 23 , 1345 , 87 , 0 ), // #298
- INST(Jg , X86Jcc , O(000F00,8F,_,_,_,_,_,_ ), O(000000,7F,_,_,_,_,_,_ ), 4 , 24 , 1351 , 86 , 62 ), // #299
- INST(Jge , X86Jcc , O(000F00,8D,_,_,_,_,_,_ ), O(000000,7D,_,_,_,_,_,_ ), 4 , 25 , 1354 , 86 , 63 ), // #300
- INST(Jl , X86Jcc , O(000F00,8C,_,_,_,_,_,_ ), O(000000,7C,_,_,_,_,_,_ ), 4 , 26 , 1358 , 86 , 63 ), // #301
- INST(Jle , X86Jcc , O(000F00,8E,_,_,_,_,_,_ ), O(000000,7E,_,_,_,_,_,_ ), 4 , 27 , 1361 , 86 , 62 ), // #302
- INST(Jmp , X86Jmp , O(000000,FF,4,_,_,_,_,_ ), O(000000,EB,_,_,_,_,_,_ ), 9 , 28 , 1861 , 88 , 0 ), // #303
- INST(Jna , X86Jcc , O(000F00,86,_,_,_,_,_,_ ), O(000000,76,_,_,_,_,_,_ ), 4 , 21 , 1365 , 86 , 59 ), // #304
- INST(Jnae , X86Jcc , O(000F00,82,_,_,_,_,_,_ ), O(000000,72,_,_,_,_,_,_ ), 4 , 20 , 1369 , 86 , 60 ), // #305
- INST(Jnb , X86Jcc , O(000F00,83,_,_,_,_,_,_ ), O(000000,73,_,_,_,_,_,_ ), 4 , 19 , 1374 , 86 , 60 ), // #306
- INST(Jnbe , X86Jcc , O(000F00,87,_,_,_,_,_,_ ), O(000000,77,_,_,_,_,_,_ ), 4 , 18 , 1378 , 86 , 59 ), // #307
- INST(Jnc , X86Jcc , O(000F00,83,_,_,_,_,_,_ ), O(000000,73,_,_,_,_,_,_ ), 4 , 19 , 1383 , 86 , 60 ), // #308
- INST(Jne , X86Jcc , O(000F00,85,_,_,_,_,_,_ ), O(000000,75,_,_,_,_,_,_ ), 4 , 29 , 1387 , 86 , 61 ), // #309
- INST(Jng , X86Jcc , O(000F00,8E,_,_,_,_,_,_ ), O(000000,7E,_,_,_,_,_,_ ), 4 , 27 , 1391 , 86 , 62 ), // #310
- INST(Jnge , X86Jcc , O(000F00,8C,_,_,_,_,_,_ ), O(000000,7C,_,_,_,_,_,_ ), 4 , 26 , 1395 , 86 , 63 ), // #311
- INST(Jnl , X86Jcc , O(000F00,8D,_,_,_,_,_,_ ), O(000000,7D,_,_,_,_,_,_ ), 4 , 25 , 1400 , 86 , 63 ), // #312
- INST(Jnle , X86Jcc , O(000F00,8F,_,_,_,_,_,_ ), O(000000,7F,_,_,_,_,_,_ ), 4 , 24 , 1404 , 86 , 62 ), // #313
- INST(Jno , X86Jcc , O(000F00,81,_,_,_,_,_,_ ), O(000000,71,_,_,_,_,_,_ ), 4 , 30 , 1409 , 86 , 57 ), // #314
- INST(Jnp , X86Jcc , O(000F00,8B,_,_,_,_,_,_ ), O(000000,7B,_,_,_,_,_,_ ), 4 , 31 , 1413 , 86 , 64 ), // #315
- INST(Jns , X86Jcc , O(000F00,89,_,_,_,_,_,_ ), O(000000,79,_,_,_,_,_,_ ), 4 , 32 , 1417 , 86 , 65 ), // #316
- INST(Jnz , X86Jcc , O(000F00,85,_,_,_,_,_,_ ), O(000000,75,_,_,_,_,_,_ ), 4 , 29 , 1421 , 86 , 61 ), // #317
- INST(Jo , X86Jcc , O(000F00,80,_,_,_,_,_,_ ), O(000000,70,_,_,_,_,_,_ ), 4 , 33 , 1425 , 86 , 57 ), // #318
- INST(Jp , X86Jcc , O(000F00,8A,_,_,_,_,_,_ ), O(000000,7A,_,_,_,_,_,_ ), 4 , 34 , 1428 , 86 , 64 ), // #319
- INST(Jpe , X86Jcc , O(000F00,8A,_,_,_,_,_,_ ), O(000000,7A,_,_,_,_,_,_ ), 4 , 34 , 1431 , 86 , 64 ), // #320
- INST(Jpo , X86Jcc , O(000F00,8B,_,_,_,_,_,_ ), O(000000,7B,_,_,_,_,_,_ ), 4 , 31 , 1435 , 86 , 64 ), // #321
- INST(Js , X86Jcc , O(000F00,88,_,_,_,_,_,_ ), O(000000,78,_,_,_,_,_,_ ), 4 , 35 , 1439 , 86 , 65 ), // #322
- INST(Jz , X86Jcc , O(000F00,84,_,_,_,_,_,_ ), O(000000,74,_,_,_,_,_,_ ), 4 , 22 , 1442 , 86 , 61 ), // #323
- INST(Kaddb , VexRvm , V(660F00,4A,_,1,0,_,_,_ ), 0 , 65 , 0 , 1445 , 89 , 66 ), // #324
- INST(Kaddd , VexRvm , V(660F00,4A,_,1,1,_,_,_ ), 0 , 66 , 0 , 1451 , 89 , 67 ), // #325
- INST(Kaddq , VexRvm , V(000F00,4A,_,1,1,_,_,_ ), 0 , 67 , 0 , 1457 , 89 , 67 ), // #326
- INST(Kaddw , VexRvm , V(000F00,4A,_,1,0,_,_,_ ), 0 , 68 , 0 , 1463 , 89 , 66 ), // #327
- INST(Kandb , VexRvm , V(660F00,41,_,1,0,_,_,_ ), 0 , 65 , 0 , 1469 , 89 , 66 ), // #328
- INST(Kandd , VexRvm , V(660F00,41,_,1,1,_,_,_ ), 0 , 66 , 0 , 1475 , 89 , 67 ), // #329
- INST(Kandnb , VexRvm , V(660F00,42,_,1,0,_,_,_ ), 0 , 65 , 0 , 1481 , 89 , 66 ), // #330
- INST(Kandnd , VexRvm , V(660F00,42,_,1,1,_,_,_ ), 0 , 66 , 0 , 1488 , 89 , 67 ), // #331
- INST(Kandnq , VexRvm , V(000F00,42,_,1,1,_,_,_ ), 0 , 67 , 0 , 1495 , 89 , 67 ), // #332
- INST(Kandnw , VexRvm , V(000F00,42,_,1,0,_,_,_ ), 0 , 68 , 0 , 1502 , 89 , 68 ), // #333
- INST(Kandq , VexRvm , V(000F00,41,_,1,1,_,_,_ ), 0 , 67 , 0 , 1509 , 89 , 67 ), // #334
- INST(Kandw , VexRvm , V(000F00,41,_,1,0,_,_,_ ), 0 , 68 , 0 , 1515 , 89 , 68 ), // #335
- INST(Kmovb , VexKmov , V(660F00,90,_,0,0,_,_,_ ), V(660F00,92,_,0,0,_,_,_ ), 69 , 36 , 1521 , 90 , 69 ), // #336
- INST(Kmovd , VexKmov , V(660F00,90,_,0,1,_,_,_ ), V(F20F00,92,_,0,0,_,_,_ ), 70 , 37 , 9105 , 91 , 70 ), // #337
- INST(Kmovq , VexKmov , V(000F00,90,_,0,1,_,_,_ ), V(F20F00,92,_,0,1,_,_,_ ), 71 , 38 , 9116 , 92 , 70 ), // #338
- INST(Kmovw , VexKmov , V(000F00,90,_,0,0,_,_,_ ), V(000F00,92,_,0,0,_,_,_ ), 72 , 39 , 1527 , 93 , 71 ), // #339
- INST(Knotb , VexRm , V(660F00,44,_,0,0,_,_,_ ), 0 , 69 , 0 , 1533 , 94 , 66 ), // #340
- INST(Knotd , VexRm , V(660F00,44,_,0,1,_,_,_ ), 0 , 70 , 0 , 1539 , 94 , 67 ), // #341
- INST(Knotq , VexRm , V(000F00,44,_,0,1,_,_,_ ), 0 , 71 , 0 , 1545 , 94 , 67 ), // #342
- INST(Knotw , VexRm , V(000F00,44,_,0,0,_,_,_ ), 0 , 72 , 0 , 1551 , 94 , 68 ), // #343
- INST(Korb , VexRvm , V(660F00,45,_,1,0,_,_,_ ), 0 , 65 , 0 , 1557 , 89 , 66 ), // #344
- INST(Kord , VexRvm , V(660F00,45,_,1,1,_,_,_ ), 0 , 66 , 0 , 1562 , 89 , 67 ), // #345
- INST(Korq , VexRvm , V(000F00,45,_,1,1,_,_,_ ), 0 , 67 , 0 , 1567 , 89 , 67 ), // #346
- INST(Kortestb , VexRm , V(660F00,98,_,0,0,_,_,_ ), 0 , 69 , 0 , 1572 , 94 , 72 ), // #347
- INST(Kortestd , VexRm , V(660F00,98,_,0,1,_,_,_ ), 0 , 70 , 0 , 1581 , 94 , 73 ), // #348
- INST(Kortestq , VexRm , V(000F00,98,_,0,1,_,_,_ ), 0 , 71 , 0 , 1590 , 94 , 73 ), // #349
- INST(Kortestw , VexRm , V(000F00,98,_,0,0,_,_,_ ), 0 , 72 , 0 , 1599 , 94 , 74 ), // #350
- INST(Korw , VexRvm , V(000F00,45,_,1,0,_,_,_ ), 0 , 68 , 0 , 1608 , 89 , 68 ), // #351
- INST(Kshiftlb , VexRmi , V(660F3A,32,_,0,0,_,_,_ ), 0 , 73 , 0 , 1613 , 95 , 66 ), // #352
- INST(Kshiftld , VexRmi , V(660F3A,33,_,0,0,_,_,_ ), 0 , 73 , 0 , 1622 , 95 , 67 ), // #353
- INST(Kshiftlq , VexRmi , V(660F3A,33,_,0,1,_,_,_ ), 0 , 74 , 0 , 1631 , 95 , 67 ), // #354
- INST(Kshiftlw , VexRmi , V(660F3A,32,_,0,1,_,_,_ ), 0 , 74 , 0 , 1640 , 95 , 68 ), // #355
- INST(Kshiftrb , VexRmi , V(660F3A,30,_,0,0,_,_,_ ), 0 , 73 , 0 , 1649 , 95 , 66 ), // #356
- INST(Kshiftrd , VexRmi , V(660F3A,31,_,0,0,_,_,_ ), 0 , 73 , 0 , 1658 , 95 , 67 ), // #357
- INST(Kshiftrq , VexRmi , V(660F3A,31,_,0,1,_,_,_ ), 0 , 74 , 0 , 1667 , 95 , 67 ), // #358
- INST(Kshiftrw , VexRmi , V(660F3A,30,_,0,1,_,_,_ ), 0 , 74 , 0 , 1676 , 95 , 68 ), // #359
- INST(Ktestb , VexRm , V(660F00,99,_,0,0,_,_,_ ), 0 , 69 , 0 , 1685 , 94 , 72 ), // #360
- INST(Ktestd , VexRm , V(660F00,99,_,0,1,_,_,_ ), 0 , 70 , 0 , 1692 , 94 , 73 ), // #361
- INST(Ktestq , VexRm , V(000F00,99,_,0,1,_,_,_ ), 0 , 71 , 0 , 1699 , 94 , 73 ), // #362
- INST(Ktestw , VexRm , V(000F00,99,_,0,0,_,_,_ ), 0 , 72 , 0 , 1706 , 94 , 72 ), // #363
- INST(Kunpckbw , VexRvm , V(660F00,4B,_,1,0,_,_,_ ), 0 , 65 , 0 , 1713 , 89 , 68 ), // #364
- INST(Kunpckdq , VexRvm , V(000F00,4B,_,1,1,_,_,_ ), 0 , 67 , 0 , 1722 , 89 , 67 ), // #365
- INST(Kunpckwd , VexRvm , V(000F00,4B,_,1,0,_,_,_ ), 0 , 68 , 0 , 1731 , 89 , 67 ), // #366
- INST(Kxnorb , VexRvm , V(660F00,46,_,1,0,_,_,_ ), 0 , 65 , 0 , 1740 , 96 , 66 ), // #367
- INST(Kxnord , VexRvm , V(660F00,46,_,1,1,_,_,_ ), 0 , 66 , 0 , 1747 , 96 , 67 ), // #368
- INST(Kxnorq , VexRvm , V(000F00,46,_,1,1,_,_,_ ), 0 , 67 , 0 , 1754 , 96 , 67 ), // #369
- INST(Kxnorw , VexRvm , V(000F00,46,_,1,0,_,_,_ ), 0 , 68 , 0 , 1761 , 96 , 68 ), // #370
- INST(Kxorb , VexRvm , V(660F00,47,_,1,0,_,_,_ ), 0 , 65 , 0 , 1768 , 96 , 66 ), // #371
- INST(Kxord , VexRvm , V(660F00,47,_,1,1,_,_,_ ), 0 , 66 , 0 , 1774 , 96 , 67 ), // #372
- INST(Kxorq , VexRvm , V(000F00,47,_,1,1,_,_,_ ), 0 , 67 , 0 , 1780 , 96 , 67 ), // #373
- INST(Kxorw , VexRvm , V(000F00,47,_,1,0,_,_,_ ), 0 , 68 , 0 , 1786 , 96 , 68 ), // #374
- INST(Lahf , X86Op , O(000000,9F,_,_,_,_,_,_ ), 0 , 0 , 0 , 1792 , 97 , 75 ), // #375
- INST(Lar , X86Rm , O(000F00,02,_,_,_,_,_,_ ), 0 , 4 , 0 , 1797 , 98 , 10 ), // #376
- INST(Lcall , X86LcallLjmp , O(000000,FF,3,_,_,_,_,_ ), O(000000,9A,_,_,_,_,_,_ ), 75 , 40 , 1801 , 99 , 1 ), // #377
- INST(Lddqu , ExtRm , O(F20F00,F0,_,_,_,_,_,_ ), 0 , 5 , 0 , 7003 , 100, 6 ), // #378
- INST(Ldmxcsr , X86M_Only , O(000F00,AE,2,_,_,_,_,_ ), 0 , 76 , 0 , 7010 , 101, 5 ), // #379
- INST(Lds , X86Rm , O(000000,C5,_,_,_,_,_,_ ), 0 , 0 , 0 , 1807 , 102, 0 ), // #380
- INST(Ldtilecfg , AmxCfg , V(000F38,49,_,0,0,_,_,_ ), 0 , 10 , 0 , 1811 , 103, 76 ), // #381
- INST(Lea , X86Lea , O(000000,8D,_,_,x,_,_,_ ), 0 , 0 , 0 , 1821 , 104, 0 ), // #382
- INST(Leave , X86Op , O(000000,C9,_,_,_,_,_,_ ), 0 , 0 , 0 , 1825 , 30 , 0 ), // #383
- INST(Les , X86Rm , O(000000,C4,_,_,_,_,_,_ ), 0 , 0 , 0 , 1831 , 102, 0 ), // #384
- INST(Lfence , X86Fence , O(000F00,AE,5,_,_,_,_,_ ), 0 , 77 , 0 , 1835 , 30 , 4 ), // #385
- INST(Lfs , X86Rm , O(000F00,B4,_,_,_,_,_,_ ), 0 , 4 , 0 , 1842 , 105, 0 ), // #386
- INST(Lgdt , X86M_Only , O(000F00,01,2,_,_,_,_,_ ), 0 , 76 , 0 , 1846 , 69 , 0 ), // #387
- INST(Lgs , X86Rm , O(000F00,B5,_,_,_,_,_,_ ), 0 , 4 , 0 , 1851 , 105, 0 ), // #388
- INST(Lidt , X86M_Only , O(000F00,01,3,_,_,_,_,_ ), 0 , 78 , 0 , 1855 , 69 , 0 ), // #389
- INST(Ljmp , X86LcallLjmp , O(000000,FF,5,_,_,_,_,_ ), O(000000,EA,_,_,_,_,_,_ ), 62 , 41 , 1860 , 106, 0 ), // #390
- INST(Lldt , X86M_NoSize , O(000F00,00,2,_,_,_,_,_ ), 0 , 76 , 0 , 1865 , 107, 0 ), // #391
- INST(Llwpcb , VexR_Wx , V(XOP_M9,12,0,0,x,_,_,_ ), 0 , 79 , 0 , 1870 , 108, 77 ), // #392
- INST(Lmsw , X86M_NoSize , O(000F00,01,6,_,_,_,_,_ ), 0 , 80 , 0 , 1877 , 107, 0 ), // #393
- INST(Lods , X86StrRm , O(000000,AC,_,_,_,_,_,_ ), 0 , 0 , 0 , 1882 , 109, 78 ), // #394
- INST(Loop , X86JecxzLoop , 0 , O(000000,E2,_,_,_,_,_,_ ), 0 , 42 , 1887 , 110, 0 ), // #395
- INST(Loope , X86JecxzLoop , 0 , O(000000,E1,_,_,_,_,_,_ ), 0 , 43 , 1892 , 110, 61 ), // #396
- INST(Loopne , X86JecxzLoop , 0 , O(000000,E0,_,_,_,_,_,_ ), 0 , 44 , 1898 , 110, 61 ), // #397
- INST(Lsl , X86Rm , O(000F00,03,_,_,_,_,_,_ ), 0 , 4 , 0 , 1905 , 111, 10 ), // #398
- INST(Lss , X86Rm , O(000F00,B2,_,_,_,_,_,_ ), 0 , 4 , 0 , 7556 , 105, 0 ), // #399
- INST(Ltr , X86M_NoSize , O(000F00,00,3,_,_,_,_,_ ), 0 , 78 , 0 , 1909 , 107, 0 ), // #400
- INST(Lwpins , VexVmi4_Wx , V(XOP_MA,12,0,0,x,_,_,_ ), 0 , 81 , 0 , 1913 , 112, 77 ), // #401
- INST(Lwpval , VexVmi4_Wx , V(XOP_MA,12,1,0,x,_,_,_ ), 0 , 82 , 0 , 1920 , 112, 77 ), // #402
- INST(Lzcnt , X86Rm_Raw66H , O(F30F00,BD,_,_,x,_,_,_ ), 0 , 6 , 0 , 1927 , 22 , 79 ), // #403
- INST(Maskmovdqu , ExtRm_ZDI , O(660F00,F7,_,_,_,_,_,_ ), 0 , 3 , 0 , 7019 , 113, 4 ), // #404
- INST(Maskmovq , ExtRm_ZDI , O(000F00,F7,_,_,_,_,_,_ ), 0 , 4 , 0 , 9113 , 114, 80 ), // #405
- INST(Maxpd , ExtRm , O(660F00,5F,_,_,_,_,_,_ ), 0 , 3 , 0 , 7053 , 5 , 4 ), // #406
- INST(Maxps , ExtRm , O(000F00,5F,_,_,_,_,_,_ ), 0 , 4 , 0 , 7067 , 5 , 5 ), // #407
- INST(Maxsd , ExtRm , O(F20F00,5F,_,_,_,_,_,_ ), 0 , 5 , 0 , 9132 , 6 , 4 ), // #408
- INST(Maxss , ExtRm , O(F30F00,5F,_,_,_,_,_,_ ), 0 , 6 , 0 , 7088 , 7 , 5 ), // #409
- INST(Mcommit , X86Op , O(F30F01,FA,_,_,_,_,_,_ ), 0 , 25 , 0 , 1933 , 30 , 81 ), // #410
- INST(Mfence , X86Fence , O(000F00,AE,6,_,_,_,_,_ ), 0 , 80 , 0 , 1941 , 30 , 4 ), // #411
- INST(Minpd , ExtRm , O(660F00,5D,_,_,_,_,_,_ ), 0 , 3 , 0 , 7117 , 5 , 4 ), // #412
- INST(Minps , ExtRm , O(000F00,5D,_,_,_,_,_,_ ), 0 , 4 , 0 , 7131 , 5 , 5 ), // #413
- INST(Minsd , ExtRm , O(F20F00,5D,_,_,_,_,_,_ ), 0 , 5 , 0 , 9196 , 6 , 4 ), // #414
- INST(Minss , ExtRm , O(F30F00,5D,_,_,_,_,_,_ ), 0 , 6 , 0 , 7152 , 7 , 5 ), // #415
- INST(Monitor , X86Op , O(000F01,C8,_,_,_,_,_,_ ), 0 , 21 , 0 , 3232 , 115, 82 ), // #416
- INST(Monitorx , X86Op , O(000F01,FA,_,_,_,_,_,_ ), 0 , 21 , 0 , 1948 , 115, 83 ), // #417
- INST(Mov , X86Mov , 0 , 0 , 0 , 0 , 138 , 116, 84 ), // #418
- INST(Movabs , X86Movabs , 0 , 0 , 0 , 0 , 1957 , 117, 0 ), // #419
- INST(Movapd , ExtMov , O(660F00,28,_,_,_,_,_,_ ), O(660F00,29,_,_,_,_,_,_ ), 3 , 45 , 7183 , 118, 85 ), // #420
- INST(Movaps , ExtMov , O(000F00,28,_,_,_,_,_,_ ), O(000F00,29,_,_,_,_,_,_ ), 4 , 46 , 7191 , 118, 86 ), // #421
- INST(Movbe , ExtMovbe , O(000F38,F0,_,_,x,_,_,_ ), O(000F38,F1,_,_,x,_,_,_ ), 83 , 47 , 656 , 119, 87 ), // #422
- INST(Movd , ExtMovd , O(000F00,6E,_,_,_,_,_,_ ), O(000F00,7E,_,_,_,_,_,_ ), 4 , 48 , 9106 , 120, 88 ), // #423
- INST(Movddup , ExtMov , O(F20F00,12,_,_,_,_,_,_ ), 0 , 5 , 0 , 7205 , 6 , 6 ), // #424
- INST(Movdir64b , X86EnqcmdMovdir64b , O(660F38,F8,_,_,_,_,_,_ ), 0 , 2 , 0 , 1964 , 121, 89 ), // #425
- INST(Movdiri , X86MovntiMovdiri , O(000F38,F9,_,_,_,_,_,_ ), 0 , 83 , 0 , 1974 , 122, 90 ), // #426
- INST(Movdq2q , ExtMov , O(F20F00,D6,_,_,_,_,_,_ ), 0 , 5 , 0 , 1982 , 123, 4 ), // #427
- INST(Movdqa , ExtMov , O(660F00,6F,_,_,_,_,_,_ ), O(660F00,7F,_,_,_,_,_,_ ), 3 , 49 , 7214 , 118, 85 ), // #428
- INST(Movdqu , ExtMov , O(F30F00,6F,_,_,_,_,_,_ ), O(F30F00,7F,_,_,_,_,_,_ ), 6 , 50 , 7023 , 118, 85 ), // #429
- INST(Movhlps , ExtMov , O(000F00,12,_,_,_,_,_,_ ), 0 , 4 , 0 , 7289 , 124, 5 ), // #430
- INST(Movhpd , ExtMov , O(660F00,16,_,_,_,_,_,_ ), O(660F00,17,_,_,_,_,_,_ ), 3 , 51 , 7298 , 125, 4 ), // #431
- INST(Movhps , ExtMov , O(000F00,16,_,_,_,_,_,_ ), O(000F00,17,_,_,_,_,_,_ ), 4 , 52 , 7306 , 125, 5 ), // #432
- INST(Movlhps , ExtMov , O(000F00,16,_,_,_,_,_,_ ), 0 , 4 , 0 , 7314 , 124, 5 ), // #433
- INST(Movlpd , ExtMov , O(660F00,12,_,_,_,_,_,_ ), O(660F00,13,_,_,_,_,_,_ ), 3 , 53 , 7323 , 125, 4 ), // #434
- INST(Movlps , ExtMov , O(000F00,12,_,_,_,_,_,_ ), O(000F00,13,_,_,_,_,_,_ ), 4 , 54 , 7331 , 125, 5 ), // #435
- INST(Movmskpd , ExtMov , O(660F00,50,_,_,_,_,_,_ ), 0 , 3 , 0 , 7339 , 126, 4 ), // #436
- INST(Movmskps , ExtMov , O(000F00,50,_,_,_,_,_,_ ), 0 , 4 , 0 , 7349 , 126, 5 ), // #437
- INST(Movntdq , ExtMov , 0 , O(660F00,E7,_,_,_,_,_,_ ), 0 , 55 , 7359 , 127, 4 ), // #438
- INST(Movntdqa , ExtMov , O(660F38,2A,_,_,_,_,_,_ ), 0 , 2 , 0 , 7368 , 100, 12 ), // #439
- INST(Movnti , X86MovntiMovdiri , O(000F00,C3,_,_,x,_,_,_ ), 0 , 4 , 0 , 1990 , 122, 4 ), // #440
- INST(Movntpd , ExtMov , 0 , O(660F00,2B,_,_,_,_,_,_ ), 0 , 56 , 7378 , 127, 4 ), // #441
- INST(Movntps , ExtMov , 0 , O(000F00,2B,_,_,_,_,_,_ ), 0 , 57 , 7387 , 127, 5 ), // #442
- INST(Movntq , ExtMov , 0 , O(000F00,E7,_,_,_,_,_,_ ), 0 , 58 , 1997 , 128, 80 ), // #443
- INST(Movntsd , ExtMov , 0 , O(F20F00,2B,_,_,_,_,_,_ ), 0 , 59 , 2004 , 129, 49 ), // #444
- INST(Movntss , ExtMov , 0 , O(F30F00,2B,_,_,_,_,_,_ ), 0 , 60 , 2012 , 130, 49 ), // #445
- INST(Movq , ExtMovq , O(000F00,6E,_,_,x,_,_,_ ), O(000F00,7E,_,_,x,_,_,_ ), 4 , 48 , 9117 , 131, 91 ), // #446
- INST(Movq2dq , ExtRm , O(F30F00,D6,_,_,_,_,_,_ ), 0 , 6 , 0 , 2020 , 132, 4 ), // #447
- INST(Movs , X86StrMm , O(000000,A4,_,_,_,_,_,_ ), 0 , 0 , 0 , 439 , 133, 78 ), // #448
- INST(Movsd , ExtMov , O(F20F00,10,_,_,_,_,_,_ ), O(F20F00,11,_,_,_,_,_,_ ), 5 , 61 , 7402 , 134, 85 ), // #449
- INST(Movshdup , ExtRm , O(F30F00,16,_,_,_,_,_,_ ), 0 , 6 , 0 , 7416 , 5 , 6 ), // #450
- INST(Movsldup , ExtRm , O(F30F00,12,_,_,_,_,_,_ ), 0 , 6 , 0 , 7426 , 5 , 6 ), // #451
- INST(Movss , ExtMov , O(F30F00,10,_,_,_,_,_,_ ), O(F30F00,11,_,_,_,_,_,_ ), 6 , 62 , 7436 , 135, 86 ), // #452
- INST(Movsx , X86MovsxMovzx , O(000F00,BE,_,_,x,_,_,_ ), 0 , 4 , 0 , 2028 , 136, 0 ), // #453
- INST(Movsxd , X86Rm , O(000000,63,_,_,x,_,_,_ ), 0 , 0 , 0 , 2034 , 137, 0 ), // #454
- INST(Movupd , ExtMov , O(660F00,10,_,_,_,_,_,_ ), O(660F00,11,_,_,_,_,_,_ ), 3 , 63 , 7443 , 118, 85 ), // #455
- INST(Movups , ExtMov , O(000F00,10,_,_,_,_,_,_ ), O(000F00,11,_,_,_,_,_,_ ), 4 , 64 , 7451 , 118, 86 ), // #456
- INST(Movzx , X86MovsxMovzx , O(000F00,B6,_,_,x,_,_,_ ), 0 , 4 , 0 , 2041 , 136, 0 ), // #457
- INST(Mpsadbw , ExtRmi , O(660F3A,42,_,_,_,_,_,_ ), 0 , 8 , 0 , 7465 , 8 , 12 ), // #458
- INST(Mul , X86M_GPB_MulDiv , O(000000,F6,4,_,x,_,_,_ ), 0 , 9 , 0 , 828 , 54 , 1 ), // #459
- INST(Mulpd , ExtRm , O(660F00,59,_,_,_,_,_,_ ), 0 , 3 , 0 , 7519 , 5 , 4 ), // #460
- INST(Mulps , ExtRm , O(000F00,59,_,_,_,_,_,_ ), 0 , 4 , 0 , 7533 , 5 , 5 ), // #461
- INST(Mulsd , ExtRm , O(F20F00,59,_,_,_,_,_,_ ), 0 , 5 , 0 , 7540 , 6 , 4 ), // #462
- INST(Mulss , ExtRm , O(F30F00,59,_,_,_,_,_,_ ), 0 , 6 , 0 , 7554 , 7 , 5 ), // #463
- INST(Mulx , VexRvm_ZDX_Wx , V(F20F38,F6,_,0,x,_,_,_ ), 0 , 84 , 0 , 2047 , 138, 92 ), // #464
- INST(Mwait , X86Op , O(000F01,C9,_,_,_,_,_,_ ), 0 , 21 , 0 , 3241 , 139, 82 ), // #465
- INST(Mwaitx , X86Op , O(000F01,FB,_,_,_,_,_,_ ), 0 , 21 , 0 , 2052 , 140, 83 ), // #466
- INST(Neg , X86M_GPB , O(000000,F6,3,_,x,_,_,_ ), 0 , 75 , 0 , 2059 , 141, 1 ), // #467
- INST(Nop , X86M_Nop , O(000000,90,_,_,_,_,_,_ ), 0 , 0 , 0 , 959 , 142, 0 ), // #468
- INST(Not , X86M_GPB , O(000000,F6,2,_,x,_,_,_ ), 0 , 1 , 0 , 2063 , 141, 0 ), // #469
- INST(Or , X86Arith , O(000000,08,1,_,x,_,_,_ ), 0 , 31 , 0 , 3237 , 143, 1 ), // #470
- INST(Orpd , ExtRm , O(660F00,56,_,_,_,_,_,_ ), 0 , 3 , 0 , 11458, 11 , 4 ), // #471
- INST(Orps , ExtRm , O(000F00,56,_,_,_,_,_,_ ), 0 , 4 , 0 , 11465, 11 , 5 ), // #472
- INST(Out , X86Out , O(000000,EE,_,_,_,_,_,_ ), O(000000,E6,_,_,_,_,_,_ ), 0 , 65 , 2067 , 144, 0 ), // #473
- INST(Outs , X86Outs , O(000000,6E,_,_,_,_,_,_ ), 0 , 0 , 0 , 2071 , 145, 0 ), // #474
- INST(Pabsb , ExtRm_P , O(000F38,1C,_,_,_,_,_,_ ), 0 , 83 , 0 , 7636 , 146, 93 ), // #475
- INST(Pabsd , ExtRm_P , O(000F38,1E,_,_,_,_,_,_ ), 0 , 83 , 0 , 7643 , 146, 93 ), // #476
- INST(Pabsw , ExtRm_P , O(000F38,1D,_,_,_,_,_,_ ), 0 , 83 , 0 , 7657 , 146, 93 ), // #477
- INST(Packssdw , ExtRm_P , O(000F00,6B,_,_,_,_,_,_ ), 0 , 4 , 0 , 7664 , 146, 88 ), // #478
- INST(Packsswb , ExtRm_P , O(000F00,63,_,_,_,_,_,_ ), 0 , 4 , 0 , 7674 , 146, 88 ), // #479
- INST(Packusdw , ExtRm , O(660F38,2B,_,_,_,_,_,_ ), 0 , 2 , 0 , 7684 , 5 , 12 ), // #480
- INST(Packuswb , ExtRm_P , O(000F00,67,_,_,_,_,_,_ ), 0 , 4 , 0 , 7694 , 146, 88 ), // #481
- INST(Paddb , ExtRm_P , O(000F00,FC,_,_,_,_,_,_ ), 0 , 4 , 0 , 7704 , 146, 88 ), // #482
- INST(Paddd , ExtRm_P , O(000F00,FE,_,_,_,_,_,_ ), 0 , 4 , 0 , 7711 , 146, 88 ), // #483
- INST(Paddq , ExtRm_P , O(000F00,D4,_,_,_,_,_,_ ), 0 , 4 , 0 , 7718 , 146, 4 ), // #484
- INST(Paddsb , ExtRm_P , O(000F00,EC,_,_,_,_,_,_ ), 0 , 4 , 0 , 7725 , 146, 88 ), // #485
- INST(Paddsw , ExtRm_P , O(000F00,ED,_,_,_,_,_,_ ), 0 , 4 , 0 , 7733 , 146, 88 ), // #486
- INST(Paddusb , ExtRm_P , O(000F00,DC,_,_,_,_,_,_ ), 0 , 4 , 0 , 7741 , 146, 88 ), // #487
- INST(Paddusw , ExtRm_P , O(000F00,DD,_,_,_,_,_,_ ), 0 , 4 , 0 , 7750 , 146, 88 ), // #488
- INST(Paddw , ExtRm_P , O(000F00,FD,_,_,_,_,_,_ ), 0 , 4 , 0 , 7759 , 146, 88 ), // #489
- INST(Palignr , ExtRmi_P , O(000F3A,0F,_,_,_,_,_,_ ), 0 , 85 , 0 , 7766 , 147, 6 ), // #490
- INST(Pand , ExtRm_P , O(000F00,DB,_,_,_,_,_,_ ), 0 , 4 , 0 , 7775 , 148, 88 ), // #491
- INST(Pandn , ExtRm_P , O(000F00,DF,_,_,_,_,_,_ ), 0 , 4 , 0 , 7788 , 149, 88 ), // #492
- INST(Pause , X86Op , O(F30000,90,_,_,_,_,_,_ ), 0 , 86 , 0 , 3195 , 30 , 0 ), // #493
- INST(Pavgb , ExtRm_P , O(000F00,E0,_,_,_,_,_,_ ), 0 , 4 , 0 , 7818 , 146, 94 ), // #494
- INST(Pavgusb , Ext3dNow , O(000F0F,BF,_,_,_,_,_,_ ), 0 , 87 , 0 , 2076 , 150, 51 ), // #495
- INST(Pavgw , ExtRm_P , O(000F00,E3,_,_,_,_,_,_ ), 0 , 4 , 0 , 7825 , 146, 94 ), // #496
- INST(Pblendvb , ExtRm_XMM0 , O(660F38,10,_,_,_,_,_,_ ), 0 , 2 , 0 , 7881 , 15 , 12 ), // #497
- INST(Pblendw , ExtRmi , O(660F3A,0E,_,_,_,_,_,_ ), 0 , 8 , 0 , 7891 , 8 , 12 ), // #498
- INST(Pclmulqdq , ExtRmi , O(660F3A,44,_,_,_,_,_,_ ), 0 , 8 , 0 , 7984 , 8 , 95 ), // #499
- INST(Pcmpeqb , ExtRm_P , O(000F00,74,_,_,_,_,_,_ ), 0 , 4 , 0 , 8016 , 149, 88 ), // #500
- INST(Pcmpeqd , ExtRm_P , O(000F00,76,_,_,_,_,_,_ ), 0 , 4 , 0 , 8025 , 149, 88 ), // #501
- INST(Pcmpeqq , ExtRm , O(660F38,29,_,_,_,_,_,_ ), 0 , 2 , 0 , 8034 , 151, 12 ), // #502
- INST(Pcmpeqw , ExtRm_P , O(000F00,75,_,_,_,_,_,_ ), 0 , 4 , 0 , 8043 , 149, 88 ), // #503
- INST(Pcmpestri , ExtRmi , O(660F3A,61,_,_,_,_,_,_ ), 0 , 8 , 0 , 8052 , 152, 96 ), // #504
- INST(Pcmpestrm , ExtRmi , O(660F3A,60,_,_,_,_,_,_ ), 0 , 8 , 0 , 8063 , 153, 96 ), // #505
- INST(Pcmpgtb , ExtRm_P , O(000F00,64,_,_,_,_,_,_ ), 0 , 4 , 0 , 8074 , 149, 88 ), // #506
- INST(Pcmpgtd , ExtRm_P , O(000F00,66,_,_,_,_,_,_ ), 0 , 4 , 0 , 8083 , 149, 88 ), // #507
- INST(Pcmpgtq , ExtRm , O(660F38,37,_,_,_,_,_,_ ), 0 , 2 , 0 , 8092 , 151, 44 ), // #508
- INST(Pcmpgtw , ExtRm_P , O(000F00,65,_,_,_,_,_,_ ), 0 , 4 , 0 , 8101 , 149, 88 ), // #509
- INST(Pcmpistri , ExtRmi , O(660F3A,63,_,_,_,_,_,_ ), 0 , 8 , 0 , 8110 , 154, 96 ), // #510
- INST(Pcmpistrm , ExtRmi , O(660F3A,62,_,_,_,_,_,_ ), 0 , 8 , 0 , 8121 , 155, 96 ), // #511
- INST(Pconfig , X86Op , O(000F01,C5,_,_,_,_,_,_ ), 0 , 21 , 0 , 2084 , 30 , 97 ), // #512
- INST(Pdep , VexRvm_Wx , V(F20F38,F5,_,0,x,_,_,_ ), 0 , 84 , 0 , 2092 , 10 , 92 ), // #513
- INST(Pext , VexRvm_Wx , V(F30F38,F5,_,0,x,_,_,_ ), 0 , 88 , 0 , 2097 , 10 , 92 ), // #514
- INST(Pextrb , ExtExtract , O(000F3A,14,_,_,_,_,_,_ ), 0 , 85 , 0 , 8608 , 156, 12 ), // #515
- INST(Pextrd , ExtExtract , O(000F3A,16,_,_,_,_,_,_ ), 0 , 85 , 0 , 8616 , 58 , 12 ), // #516
- INST(Pextrq , ExtExtract , O(000F3A,16,_,_,1,_,_,_ ), 0 , 89 , 0 , 8624 , 157, 12 ), // #517
- INST(Pextrw , ExtPextrw , O(000F00,C5,_,_,_,_,_,_ ), O(000F3A,15,_,_,_,_,_,_ ), 4 , 66 , 8632 , 158, 98 ), // #518
- INST(Pf2id , Ext3dNow , O(000F0F,1D,_,_,_,_,_,_ ), 0 , 87 , 0 , 2102 , 150, 51 ), // #519
- INST(Pf2iw , Ext3dNow , O(000F0F,1C,_,_,_,_,_,_ ), 0 , 87 , 0 , 2108 , 150, 99 ), // #520
- INST(Pfacc , Ext3dNow , O(000F0F,AE,_,_,_,_,_,_ ), 0 , 87 , 0 , 2114 , 150, 51 ), // #521
- INST(Pfadd , Ext3dNow , O(000F0F,9E,_,_,_,_,_,_ ), 0 , 87 , 0 , 2120 , 150, 51 ), // #522
- INST(Pfcmpeq , Ext3dNow , O(000F0F,B0,_,_,_,_,_,_ ), 0 , 87 , 0 , 2126 , 150, 51 ), // #523
- INST(Pfcmpge , Ext3dNow , O(000F0F,90,_,_,_,_,_,_ ), 0 , 87 , 0 , 2134 , 150, 51 ), // #524
- INST(Pfcmpgt , Ext3dNow , O(000F0F,A0,_,_,_,_,_,_ ), 0 , 87 , 0 , 2142 , 150, 51 ), // #525
- INST(Pfmax , Ext3dNow , O(000F0F,A4,_,_,_,_,_,_ ), 0 , 87 , 0 , 2150 , 150, 51 ), // #526
- INST(Pfmin , Ext3dNow , O(000F0F,94,_,_,_,_,_,_ ), 0 , 87 , 0 , 2156 , 150, 51 ), // #527
- INST(Pfmul , Ext3dNow , O(000F0F,B4,_,_,_,_,_,_ ), 0 , 87 , 0 , 2162 , 150, 51 ), // #528
- INST(Pfnacc , Ext3dNow , O(000F0F,8A,_,_,_,_,_,_ ), 0 , 87 , 0 , 2168 , 150, 99 ), // #529
- INST(Pfpnacc , Ext3dNow , O(000F0F,8E,_,_,_,_,_,_ ), 0 , 87 , 0 , 2175 , 150, 99 ), // #530
- INST(Pfrcp , Ext3dNow , O(000F0F,96,_,_,_,_,_,_ ), 0 , 87 , 0 , 2183 , 150, 51 ), // #531
- INST(Pfrcpit1 , Ext3dNow , O(000F0F,A6,_,_,_,_,_,_ ), 0 , 87 , 0 , 2189 , 150, 51 ), // #532
- INST(Pfrcpit2 , Ext3dNow , O(000F0F,B6,_,_,_,_,_,_ ), 0 , 87 , 0 , 2198 , 150, 51 ), // #533
- INST(Pfrcpv , Ext3dNow , O(000F0F,86,_,_,_,_,_,_ ), 0 , 87 , 0 , 2207 , 150, 100), // #534
- INST(Pfrsqit1 , Ext3dNow , O(000F0F,A7,_,_,_,_,_,_ ), 0 , 87 , 0 , 2214 , 150, 51 ), // #535
- INST(Pfrsqrt , Ext3dNow , O(000F0F,97,_,_,_,_,_,_ ), 0 , 87 , 0 , 2223 , 150, 51 ), // #536
- INST(Pfrsqrtv , Ext3dNow , O(000F0F,87,_,_,_,_,_,_ ), 0 , 87 , 0 , 2231 , 150, 100), // #537
- INST(Pfsub , Ext3dNow , O(000F0F,9A,_,_,_,_,_,_ ), 0 , 87 , 0 , 2240 , 150, 51 ), // #538
- INST(Pfsubr , Ext3dNow , O(000F0F,AA,_,_,_,_,_,_ ), 0 , 87 , 0 , 2246 , 150, 51 ), // #539
- INST(Phaddd , ExtRm_P , O(000F38,02,_,_,_,_,_,_ ), 0 , 83 , 0 , 8711 , 146, 93 ), // #540
- INST(Phaddsw , ExtRm_P , O(000F38,03,_,_,_,_,_,_ ), 0 , 83 , 0 , 8728 , 146, 93 ), // #541
- INST(Phaddw , ExtRm_P , O(000F38,01,_,_,_,_,_,_ ), 0 , 83 , 0 , 8797 , 146, 93 ), // #542
- INST(Phminposuw , ExtRm , O(660F38,41,_,_,_,_,_,_ ), 0 , 2 , 0 , 8823 , 5 , 12 ), // #543
- INST(Phsubd , ExtRm_P , O(000F38,06,_,_,_,_,_,_ ), 0 , 83 , 0 , 8844 , 146, 93 ), // #544
- INST(Phsubsw , ExtRm_P , O(000F38,07,_,_,_,_,_,_ ), 0 , 83 , 0 , 8861 , 146, 93 ), // #545
- INST(Phsubw , ExtRm_P , O(000F38,05,_,_,_,_,_,_ ), 0 , 83 , 0 , 8870 , 146, 93 ), // #546
- INST(Pi2fd , Ext3dNow , O(000F0F,0D,_,_,_,_,_,_ ), 0 , 87 , 0 , 2253 , 150, 51 ), // #547
- INST(Pi2fw , Ext3dNow , O(000F0F,0C,_,_,_,_,_,_ ), 0 , 87 , 0 , 2259 , 150, 99 ), // #548
- INST(Pinsrb , ExtRmi , O(660F3A,20,_,_,_,_,_,_ ), 0 , 8 , 0 , 8887 , 159, 12 ), // #549
- INST(Pinsrd , ExtRmi , O(660F3A,22,_,_,_,_,_,_ ), 0 , 8 , 0 , 8895 , 160, 12 ), // #550
- INST(Pinsrq , ExtRmi , O(660F3A,22,_,_,1,_,_,_ ), 0 , 90 , 0 , 8903 , 161, 12 ), // #551
- INST(Pinsrw , ExtRmi_P , O(000F00,C4,_,_,_,_,_,_ ), 0 , 4 , 0 , 8911 , 162, 94 ), // #552
- INST(Pmaddubsw , ExtRm_P , O(000F38,04,_,_,_,_,_,_ ), 0 , 83 , 0 , 9081 , 146, 93 ), // #553
- INST(Pmaddwd , ExtRm_P , O(000F00,F5,_,_,_,_,_,_ ), 0 , 4 , 0 , 9092 , 146, 88 ), // #554
- INST(Pmaxsb , ExtRm , O(660F38,3C,_,_,_,_,_,_ ), 0 , 2 , 0 , 9123 , 11 , 12 ), // #555
- INST(Pmaxsd , ExtRm , O(660F38,3D,_,_,_,_,_,_ ), 0 , 2 , 0 , 9131 , 11 , 12 ), // #556
- INST(Pmaxsw , ExtRm_P , O(000F00,EE,_,_,_,_,_,_ ), 0 , 4 , 0 , 9147 , 148, 94 ), // #557
- INST(Pmaxub , ExtRm_P , O(000F00,DE,_,_,_,_,_,_ ), 0 , 4 , 0 , 9155 , 148, 94 ), // #558
- INST(Pmaxud , ExtRm , O(660F38,3F,_,_,_,_,_,_ ), 0 , 2 , 0 , 9163 , 11 , 12 ), // #559
- INST(Pmaxuw , ExtRm , O(660F38,3E,_,_,_,_,_,_ ), 0 , 2 , 0 , 9179 , 11 , 12 ), // #560
- INST(Pminsb , ExtRm , O(660F38,38,_,_,_,_,_,_ ), 0 , 2 , 0 , 9187 , 11 , 12 ), // #561
- INST(Pminsd , ExtRm , O(660F38,39,_,_,_,_,_,_ ), 0 , 2 , 0 , 9195 , 11 , 12 ), // #562
- INST(Pminsw , ExtRm_P , O(000F00,EA,_,_,_,_,_,_ ), 0 , 4 , 0 , 9211 , 148, 94 ), // #563
- INST(Pminub , ExtRm_P , O(000F00,DA,_,_,_,_,_,_ ), 0 , 4 , 0 , 9219 , 148, 94 ), // #564
- INST(Pminud , ExtRm , O(660F38,3B,_,_,_,_,_,_ ), 0 , 2 , 0 , 9227 , 11 , 12 ), // #565
- INST(Pminuw , ExtRm , O(660F38,3A,_,_,_,_,_,_ ), 0 , 2 , 0 , 9243 , 11 , 12 ), // #566
- INST(Pmovmskb , ExtRm_P , O(000F00,D7,_,_,_,_,_,_ ), 0 , 4 , 0 , 9321 , 163, 94 ), // #567
- INST(Pmovsxbd , ExtRm , O(660F38,21,_,_,_,_,_,_ ), 0 , 2 , 0 , 9418 , 7 , 12 ), // #568
- INST(Pmovsxbq , ExtRm , O(660F38,22,_,_,_,_,_,_ ), 0 , 2 , 0 , 9428 , 164, 12 ), // #569
- INST(Pmovsxbw , ExtRm , O(660F38,20,_,_,_,_,_,_ ), 0 , 2 , 0 , 9438 , 6 , 12 ), // #570
- INST(Pmovsxdq , ExtRm , O(660F38,25,_,_,_,_,_,_ ), 0 , 2 , 0 , 9448 , 6 , 12 ), // #571
- INST(Pmovsxwd , ExtRm , O(660F38,23,_,_,_,_,_,_ ), 0 , 2 , 0 , 9458 , 6 , 12 ), // #572
- INST(Pmovsxwq , ExtRm , O(660F38,24,_,_,_,_,_,_ ), 0 , 2 , 0 , 9468 , 7 , 12 ), // #573
- INST(Pmovzxbd , ExtRm , O(660F38,31,_,_,_,_,_,_ ), 0 , 2 , 0 , 9555 , 7 , 12 ), // #574
- INST(Pmovzxbq , ExtRm , O(660F38,32,_,_,_,_,_,_ ), 0 , 2 , 0 , 9565 , 164, 12 ), // #575
- INST(Pmovzxbw , ExtRm , O(660F38,30,_,_,_,_,_,_ ), 0 , 2 , 0 , 9575 , 6 , 12 ), // #576
- INST(Pmovzxdq , ExtRm , O(660F38,35,_,_,_,_,_,_ ), 0 , 2 , 0 , 9585 , 6 , 12 ), // #577
- INST(Pmovzxwd , ExtRm , O(660F38,33,_,_,_,_,_,_ ), 0 , 2 , 0 , 9595 , 6 , 12 ), // #578
- INST(Pmovzxwq , ExtRm , O(660F38,34,_,_,_,_,_,_ ), 0 , 2 , 0 , 9605 , 7 , 12 ), // #579
- INST(Pmuldq , ExtRm , O(660F38,28,_,_,_,_,_,_ ), 0 , 2 , 0 , 9615 , 5 , 12 ), // #580
- INST(Pmulhrsw , ExtRm_P , O(000F38,0B,_,_,_,_,_,_ ), 0 , 83 , 0 , 9623 , 146, 93 ), // #581
- INST(Pmulhrw , Ext3dNow , O(000F0F,B7,_,_,_,_,_,_ ), 0 , 87 , 0 , 2265 , 150, 51 ), // #582
- INST(Pmulhuw , ExtRm_P , O(000F00,E4,_,_,_,_,_,_ ), 0 , 4 , 0 , 9633 , 146, 94 ), // #583
- INST(Pmulhw , ExtRm_P , O(000F00,E5,_,_,_,_,_,_ ), 0 , 4 , 0 , 9642 , 146, 88 ), // #584
- INST(Pmulld , ExtRm , O(660F38,40,_,_,_,_,_,_ ), 0 , 2 , 0 , 9650 , 5 , 12 ), // #585
- INST(Pmullw , ExtRm_P , O(000F00,D5,_,_,_,_,_,_ ), 0 , 4 , 0 , 9666 , 146, 88 ), // #586
- INST(Pmuludq , ExtRm_P , O(000F00,F4,_,_,_,_,_,_ ), 0 , 4 , 0 , 9689 , 146, 4 ), // #587
- INST(Pop , X86Pop , O(000000,8F,0,_,_,_,_,_ ), O(000000,58,_,_,_,_,_,_ ), 0 , 67 , 2273 , 165, 0 ), // #588
- INST(Popa , X86Op , O(660000,61,_,_,_,_,_,_ ), 0 , 19 , 0 , 2277 , 81 , 0 ), // #589
- INST(Popad , X86Op , O(000000,61,_,_,_,_,_,_ ), 0 , 0 , 0 , 2282 , 81 , 0 ), // #590
- INST(Popcnt , X86Rm_Raw66H , O(F30F00,B8,_,_,x,_,_,_ ), 0 , 6 , 0 , 2288 , 22 , 101), // #591
- INST(Popf , X86Op , O(660000,9D,_,_,_,_,_,_ ), 0 , 19 , 0 , 2295 , 30 , 102), // #592
- INST(Popfd , X86Op , O(000000,9D,_,_,_,_,_,_ ), 0 , 0 , 0 , 2300 , 81 , 102), // #593
- INST(Popfq , X86Op , O(000000,9D,_,_,_,_,_,_ ), 0 , 0 , 0 , 2306 , 33 , 102), // #594
- INST(Por , ExtRm_P , O(000F00,EB,_,_,_,_,_,_ ), 0 , 4 , 0 , 9734 , 148, 88 ), // #595
- INST(Prefetch , X86M_Only , O(000F00,0D,0,_,_,_,_,_ ), 0 , 4 , 0 , 2312 , 31 , 51 ), // #596
- INST(Prefetchnta , X86M_Only , O(000F00,18,0,_,_,_,_,_ ), 0 , 4 , 0 , 2321 , 31 , 80 ), // #597
- INST(Prefetcht0 , X86M_Only , O(000F00,18,1,_,_,_,_,_ ), 0 , 29 , 0 , 2333 , 31 , 80 ), // #598
- INST(Prefetcht1 , X86M_Only , O(000F00,18,2,_,_,_,_,_ ), 0 , 76 , 0 , 2344 , 31 , 80 ), // #599
- INST(Prefetcht2 , X86M_Only , O(000F00,18,3,_,_,_,_,_ ), 0 , 78 , 0 , 2355 , 31 , 80 ), // #600
- INST(Prefetchw , X86M_Only , O(000F00,0D,1,_,_,_,_,_ ), 0 , 29 , 0 , 2366 , 31 , 103), // #601
- INST(Prefetchwt1 , X86M_Only , O(000F00,0D,2,_,_,_,_,_ ), 0 , 76 , 0 , 2376 , 31 , 104), // #602
- INST(Psadbw , ExtRm_P , O(000F00,F6,_,_,_,_,_,_ ), 0 , 4 , 0 , 4644 , 146, 94 ), // #603
- INST(Pshufb , ExtRm_P , O(000F38,00,_,_,_,_,_,_ ), 0 , 83 , 0 , 10060, 146, 93 ), // #604
- INST(Pshufd , ExtRmi , O(660F00,70,_,_,_,_,_,_ ), 0 , 3 , 0 , 10081, 8 , 4 ), // #605
- INST(Pshufhw , ExtRmi , O(F30F00,70,_,_,_,_,_,_ ), 0 , 6 , 0 , 10089, 8 , 4 ), // #606
- INST(Pshuflw , ExtRmi , O(F20F00,70,_,_,_,_,_,_ ), 0 , 5 , 0 , 10098, 8 , 4 ), // #607
- INST(Pshufw , ExtRmi_P , O(000F00,70,_,_,_,_,_,_ ), 0 , 4 , 0 , 2388 , 166, 80 ), // #608
- INST(Psignb , ExtRm_P , O(000F38,08,_,_,_,_,_,_ ), 0 , 83 , 0 , 10107, 146, 93 ), // #609
- INST(Psignd , ExtRm_P , O(000F38,0A,_,_,_,_,_,_ ), 0 , 83 , 0 , 10115, 146, 93 ), // #610
- INST(Psignw , ExtRm_P , O(000F38,09,_,_,_,_,_,_ ), 0 , 83 , 0 , 10123, 146, 93 ), // #611
- INST(Pslld , ExtRmRi_P , O(000F00,F2,_,_,_,_,_,_ ), O(000F00,72,6,_,_,_,_,_ ), 4 , 68 , 10131, 167, 88 ), // #612
- INST(Pslldq , ExtRmRi , 0 , O(660F00,73,7,_,_,_,_,_ ), 0 , 69 , 10138, 168, 4 ), // #613
- INST(Psllq , ExtRmRi_P , O(000F00,F3,_,_,_,_,_,_ ), O(000F00,73,6,_,_,_,_,_ ), 4 , 70 , 10146, 167, 88 ), // #614
- INST(Psllw , ExtRmRi_P , O(000F00,F1,_,_,_,_,_,_ ), O(000F00,71,6,_,_,_,_,_ ), 4 , 71 , 10177, 167, 88 ), // #615
- INST(Psmash , X86Op , O(F30F01,FF,_,_,_,_,_,_ ), 0 , 25 , 0 , 2395 , 33 , 105), // #616
- INST(Psrad , ExtRmRi_P , O(000F00,E2,_,_,_,_,_,_ ), O(000F00,72,4,_,_,_,_,_ ), 4 , 72 , 10184, 167, 88 ), // #617
- INST(Psraw , ExtRmRi_P , O(000F00,E1,_,_,_,_,_,_ ), O(000F00,71,4,_,_,_,_,_ ), 4 , 73 , 10222, 167, 88 ), // #618
- INST(Psrld , ExtRmRi_P , O(000F00,D2,_,_,_,_,_,_ ), O(000F00,72,2,_,_,_,_,_ ), 4 , 74 , 10229, 167, 88 ), // #619
- INST(Psrldq , ExtRmRi , 0 , O(660F00,73,3,_,_,_,_,_ ), 0 , 75 , 10236, 168, 4 ), // #620
- INST(Psrlq , ExtRmRi_P , O(000F00,D3,_,_,_,_,_,_ ), O(000F00,73,2,_,_,_,_,_ ), 4 , 76 , 10244, 167, 88 ), // #621
- INST(Psrlw , ExtRmRi_P , O(000F00,D1,_,_,_,_,_,_ ), O(000F00,71,2,_,_,_,_,_ ), 4 , 77 , 10275, 167, 88 ), // #622
- INST(Psubb , ExtRm_P , O(000F00,F8,_,_,_,_,_,_ ), 0 , 4 , 0 , 10282, 149, 88 ), // #623
- INST(Psubd , ExtRm_P , O(000F00,FA,_,_,_,_,_,_ ), 0 , 4 , 0 , 10289, 149, 88 ), // #624
- INST(Psubq , ExtRm_P , O(000F00,FB,_,_,_,_,_,_ ), 0 , 4 , 0 , 10296, 149, 4 ), // #625
- INST(Psubsb , ExtRm_P , O(000F00,E8,_,_,_,_,_,_ ), 0 , 4 , 0 , 10303, 149, 88 ), // #626
- INST(Psubsw , ExtRm_P , O(000F00,E9,_,_,_,_,_,_ ), 0 , 4 , 0 , 10311, 149, 88 ), // #627
- INST(Psubusb , ExtRm_P , O(000F00,D8,_,_,_,_,_,_ ), 0 , 4 , 0 , 10319, 149, 88 ), // #628
- INST(Psubusw , ExtRm_P , O(000F00,D9,_,_,_,_,_,_ ), 0 , 4 , 0 , 10328, 149, 88 ), // #629
- INST(Psubw , ExtRm_P , O(000F00,F9,_,_,_,_,_,_ ), 0 , 4 , 0 , 10337, 149, 88 ), // #630
- INST(Pswapd , Ext3dNow , O(000F0F,BB,_,_,_,_,_,_ ), 0 , 87 , 0 , 2402 , 150, 99 ), // #631
- INST(Ptest , ExtRm , O(660F38,17,_,_,_,_,_,_ ), 0 , 2 , 0 , 10366, 5 , 106), // #632
- INST(Ptwrite , X86M , O(F30F00,AE,4,_,_,_,_,_ ), 0 , 91 , 0 , 2409 , 169, 107), // #633
- INST(Punpckhbw , ExtRm_P , O(000F00,68,_,_,_,_,_,_ ), 0 , 4 , 0 , 10449, 146, 88 ), // #634
- INST(Punpckhdq , ExtRm_P , O(000F00,6A,_,_,_,_,_,_ ), 0 , 4 , 0 , 10460, 146, 88 ), // #635
- INST(Punpckhqdq , ExtRm , O(660F00,6D,_,_,_,_,_,_ ), 0 , 3 , 0 , 10471, 5 , 4 ), // #636
- INST(Punpckhwd , ExtRm_P , O(000F00,69,_,_,_,_,_,_ ), 0 , 4 , 0 , 10483, 146, 88 ), // #637
- INST(Punpcklbw , ExtRm_P , O(000F00,60,_,_,_,_,_,_ ), 0 , 4 , 0 , 10494, 170, 88 ), // #638
- INST(Punpckldq , ExtRm_P , O(000F00,62,_,_,_,_,_,_ ), 0 , 4 , 0 , 10505, 170, 88 ), // #639
- INST(Punpcklqdq , ExtRm , O(660F00,6C,_,_,_,_,_,_ ), 0 , 3 , 0 , 10516, 5 , 4 ), // #640
- INST(Punpcklwd , ExtRm_P , O(000F00,61,_,_,_,_,_,_ ), 0 , 4 , 0 , 10528, 170, 88 ), // #641
- INST(Push , X86Push , O(000000,FF,6,_,_,_,_,_ ), O(000000,50,_,_,_,_,_,_ ), 32 , 78 , 2417 , 171, 0 ), // #642
- INST(Pusha , X86Op , O(660000,60,_,_,_,_,_,_ ), 0 , 19 , 0 , 2422 , 81 , 0 ), // #643
- INST(Pushad , X86Op , O(000000,60,_,_,_,_,_,_ ), 0 , 0 , 0 , 2428 , 81 , 0 ), // #644
- INST(Pushf , X86Op , O(660000,9C,_,_,_,_,_,_ ), 0 , 19 , 0 , 2435 , 30 , 108), // #645
- INST(Pushfd , X86Op , O(000000,9C,_,_,_,_,_,_ ), 0 , 0 , 0 , 2441 , 81 , 108), // #646
- INST(Pushfq , X86Op , O(000000,9C,_,_,_,_,_,_ ), 0 , 0 , 0 , 2448 , 33 , 108), // #647
- INST(Pvalidate , X86Op , O(F20F01,FF,_,_,_,_,_,_ ), 0 , 92 , 0 , 2455 , 30 , 109), // #648
- INST(Pxor , ExtRm_P , O(000F00,EF,_,_,_,_,_,_ ), 0 , 4 , 0 , 10539, 149, 88 ), // #649
- INST(Rcl , X86Rot , O(000000,D0,2,_,x,_,_,_ ), 0 , 1 , 0 , 2465 , 172, 110), // #650
- INST(Rcpps , ExtRm , O(000F00,53,_,_,_,_,_,_ ), 0 , 4 , 0 , 10674, 5 , 5 ), // #651
- INST(Rcpss , ExtRm , O(F30F00,53,_,_,_,_,_,_ ), 0 , 6 , 0 , 10688, 7 , 5 ), // #652
- INST(Rcr , X86Rot , O(000000,D0,3,_,x,_,_,_ ), 0 , 75 , 0 , 2469 , 172, 110), // #653
- INST(Rdfsbase , X86M , O(F30F00,AE,0,_,x,_,_,_ ), 0 , 6 , 0 , 2473 , 173, 111), // #654
- INST(Rdgsbase , X86M , O(F30F00,AE,1,_,x,_,_,_ ), 0 , 93 , 0 , 2482 , 173, 111), // #655
- INST(Rdmsr , X86Op , O(000F00,32,_,_,_,_,_,_ ), 0 , 4 , 0 , 2491 , 174, 112), // #656
- INST(Rdpid , X86R_Native , O(F30F00,C7,7,_,_,_,_,_ ), 0 , 94 , 0 , 2497 , 175, 113), // #657
- INST(Rdpkru , X86Op , O(000F01,EE,_,_,_,_,_,_ ), 0 , 21 , 0 , 2503 , 174, 114), // #658
- INST(Rdpmc , X86Op , O(000F00,33,_,_,_,_,_,_ ), 0 , 4 , 0 , 2510 , 174, 0 ), // #659
- INST(Rdpru , X86Op , O(000F01,FD,_,_,_,_,_,_ ), 0 , 21 , 0 , 2516 , 174, 115), // #660
- INST(Rdrand , X86M , O(000F00,C7,6,_,x,_,_,_ ), 0 , 80 , 0 , 2522 , 23 , 116), // #661
- INST(Rdseed , X86M , O(000F00,C7,7,_,x,_,_,_ ), 0 , 22 , 0 , 2529 , 23 , 117), // #662
- INST(Rdsspd , X86M , O(F30F00,1E,1,_,_,_,_,_ ), 0 , 93 , 0 , 2536 , 76 , 56 ), // #663
- INST(Rdsspq , X86M , O(F30F00,1E,1,_,_,_,_,_ ), 0 , 93 , 0 , 2543 , 77 , 56 ), // #664
- INST(Rdtsc , X86Op , O(000F00,31,_,_,_,_,_,_ ), 0 , 4 , 0 , 2550 , 28 , 118), // #665
- INST(Rdtscp , X86Op , O(000F01,F9,_,_,_,_,_,_ ), 0 , 21 , 0 , 2556 , 174, 119), // #666
- INST(Ret , X86Ret , O(000000,C2,_,_,_,_,_,_ ), 0 , 0 , 0 , 3072 , 176, 0 ), // #667
- INST(Retf , X86Ret , O(000000,CA,_,_,x,_,_,_ ), 0 , 0 , 0 , 2563 , 177, 0 ), // #668
- INST(Rmpadjust , X86Op , O(F30F01,FE,_,_,_,_,_,_ ), 0 , 25 , 0 , 2568 , 33 , 105), // #669
- INST(Rmpupdate , X86Op , O(F20F01,FE,_,_,_,_,_,_ ), 0 , 92 , 0 , 2578 , 33 , 105), // #670
- INST(Rol , X86Rot , O(000000,D0,0,_,x,_,_,_ ), 0 , 0 , 0 , 2588 , 172, 120), // #671
- INST(Ror , X86Rot , O(000000,D0,1,_,x,_,_,_ ), 0 , 31 , 0 , 2592 , 172, 120), // #672
- INST(Rorx , VexRmi_Wx , V(F20F3A,F0,_,0,x,_,_,_ ), 0 , 95 , 0 , 2596 , 178, 92 ), // #673
- INST(Roundpd , ExtRmi , O(660F3A,09,_,_,_,_,_,_ ), 0 , 8 , 0 , 10827, 8 , 12 ), // #674
- INST(Roundps , ExtRmi , O(660F3A,08,_,_,_,_,_,_ ), 0 , 8 , 0 , 10836, 8 , 12 ), // #675
- INST(Roundsd , ExtRmi , O(660F3A,0B,_,_,_,_,_,_ ), 0 , 8 , 0 , 10845, 37 , 12 ), // #676
- INST(Roundss , ExtRmi , O(660F3A,0A,_,_,_,_,_,_ ), 0 , 8 , 0 , 10854, 38 , 12 ), // #677
- INST(Rsm , X86Op , O(000F00,AA,_,_,_,_,_,_ ), 0 , 4 , 0 , 2601 , 81 , 1 ), // #678
- INST(Rsqrtps , ExtRm , O(000F00,52,_,_,_,_,_,_ ), 0 , 4 , 0 , 10960, 5 , 5 ), // #679
- INST(Rsqrtss , ExtRm , O(F30F00,52,_,_,_,_,_,_ ), 0 , 6 , 0 , 10978, 7 , 5 ), // #680
- INST(Rstorssp , X86M_Only , O(F30F00,01,5,_,_,_,_,_ ), 0 , 63 , 0 , 2605 , 32 , 24 ), // #681
- INST(Sahf , X86Op , O(000000,9E,_,_,_,_,_,_ ), 0 , 0 , 0 , 2614 , 97 , 121), // #682
- INST(Sal , X86Rot , O(000000,D0,4,_,x,_,_,_ ), 0 , 9 , 0 , 2619 , 172, 1 ), // #683
- INST(Sar , X86Rot , O(000000,D0,7,_,x,_,_,_ ), 0 , 27 , 0 , 2623 , 172, 1 ), // #684
- INST(Sarx , VexRmv_Wx , V(F30F38,F7,_,0,x,_,_,_ ), 0 , 88 , 0 , 2627 , 13 , 92 ), // #685
- INST(Saveprevssp , X86Op , O(F30F01,EA,_,_,_,_,_,_ ), 0 , 25 , 0 , 2632 , 30 , 24 ), // #686
- INST(Sbb , X86Arith , O(000000,18,3,_,x,_,_,_ ), 0 , 75 , 0 , 2644 , 179, 2 ), // #687
- INST(Scas , X86StrRm , O(000000,AE,_,_,_,_,_,_ ), 0 , 0 , 0 , 2648 , 180, 37 ), // #688
- INST(Senduipi , X86M_NoSize , O(F30F00,C7,6,_,_,_,_,_ ), 0 , 24 , 0 , 2653 , 77 , 25 ), // #689
- INST(Serialize , X86Op , O(000F01,E8,_,_,_,_,_,_ ), 0 , 21 , 0 , 2662 , 30 , 122), // #690
- INST(Seta , X86Set , O(000F00,97,_,_,_,_,_,_ ), 0 , 4 , 0 , 2672 , 181, 59 ), // #691
- INST(Setae , X86Set , O(000F00,93,_,_,_,_,_,_ ), 0 , 4 , 0 , 2677 , 181, 60 ), // #692
- INST(Setb , X86Set , O(000F00,92,_,_,_,_,_,_ ), 0 , 4 , 0 , 2683 , 181, 60 ), // #693
- INST(Setbe , X86Set , O(000F00,96,_,_,_,_,_,_ ), 0 , 4 , 0 , 2688 , 181, 59 ), // #694
- INST(Setc , X86Set , O(000F00,92,_,_,_,_,_,_ ), 0 , 4 , 0 , 2694 , 181, 60 ), // #695
- INST(Sete , X86Set , O(000F00,94,_,_,_,_,_,_ ), 0 , 4 , 0 , 2699 , 181, 61 ), // #696
- INST(Setg , X86Set , O(000F00,9F,_,_,_,_,_,_ ), 0 , 4 , 0 , 2704 , 181, 62 ), // #697
- INST(Setge , X86Set , O(000F00,9D,_,_,_,_,_,_ ), 0 , 4 , 0 , 2709 , 181, 63 ), // #698
- INST(Setl , X86Set , O(000F00,9C,_,_,_,_,_,_ ), 0 , 4 , 0 , 2715 , 181, 63 ), // #699
- INST(Setle , X86Set , O(000F00,9E,_,_,_,_,_,_ ), 0 , 4 , 0 , 2720 , 181, 62 ), // #700
- INST(Setna , X86Set , O(000F00,96,_,_,_,_,_,_ ), 0 , 4 , 0 , 2726 , 181, 59 ), // #701
- INST(Setnae , X86Set , O(000F00,92,_,_,_,_,_,_ ), 0 , 4 , 0 , 2732 , 181, 60 ), // #702
- INST(Setnb , X86Set , O(000F00,93,_,_,_,_,_,_ ), 0 , 4 , 0 , 2739 , 181, 60 ), // #703
- INST(Setnbe , X86Set , O(000F00,97,_,_,_,_,_,_ ), 0 , 4 , 0 , 2745 , 181, 59 ), // #704
- INST(Setnc , X86Set , O(000F00,93,_,_,_,_,_,_ ), 0 , 4 , 0 , 2752 , 181, 60 ), // #705
- INST(Setne , X86Set , O(000F00,95,_,_,_,_,_,_ ), 0 , 4 , 0 , 2758 , 181, 61 ), // #706
- INST(Setng , X86Set , O(000F00,9E,_,_,_,_,_,_ ), 0 , 4 , 0 , 2764 , 181, 62 ), // #707
- INST(Setnge , X86Set , O(000F00,9C,_,_,_,_,_,_ ), 0 , 4 , 0 , 2770 , 181, 63 ), // #708
- INST(Setnl , X86Set , O(000F00,9D,_,_,_,_,_,_ ), 0 , 4 , 0 , 2777 , 181, 63 ), // #709
- INST(Setnle , X86Set , O(000F00,9F,_,_,_,_,_,_ ), 0 , 4 , 0 , 2783 , 181, 62 ), // #710
- INST(Setno , X86Set , O(000F00,91,_,_,_,_,_,_ ), 0 , 4 , 0 , 2790 , 181, 57 ), // #711
- INST(Setnp , X86Set , O(000F00,9B,_,_,_,_,_,_ ), 0 , 4 , 0 , 2796 , 181, 64 ), // #712
- INST(Setns , X86Set , O(000F00,99,_,_,_,_,_,_ ), 0 , 4 , 0 , 2802 , 181, 65 ), // #713
- INST(Setnz , X86Set , O(000F00,95,_,_,_,_,_,_ ), 0 , 4 , 0 , 2808 , 181, 61 ), // #714
- INST(Seto , X86Set , O(000F00,90,_,_,_,_,_,_ ), 0 , 4 , 0 , 2814 , 181, 57 ), // #715
- INST(Setp , X86Set , O(000F00,9A,_,_,_,_,_,_ ), 0 , 4 , 0 , 2819 , 181, 64 ), // #716
- INST(Setpe , X86Set , O(000F00,9A,_,_,_,_,_,_ ), 0 , 4 , 0 , 2824 , 181, 64 ), // #717
- INST(Setpo , X86Set , O(000F00,9B,_,_,_,_,_,_ ), 0 , 4 , 0 , 2830 , 181, 64 ), // #718
- INST(Sets , X86Set , O(000F00,98,_,_,_,_,_,_ ), 0 , 4 , 0 , 2836 , 181, 65 ), // #719
- INST(Setssbsy , X86Op , O(F30F01,E8,_,_,_,_,_,_ ), 0 , 25 , 0 , 2841 , 30 , 56 ), // #720
- INST(Setz , X86Set , O(000F00,94,_,_,_,_,_,_ ), 0 , 4 , 0 , 2850 , 181, 61 ), // #721
- INST(Sfence , X86Fence , O(000F00,AE,7,_,_,_,_,_ ), 0 , 22 , 0 , 2855 , 30 , 80 ), // #722
- INST(Sgdt , X86M_Only , O(000F00,01,0,_,_,_,_,_ ), 0 , 4 , 0 , 2862 , 69 , 0 ), // #723
- INST(Sha1msg1 , ExtRm , O(000F38,C9,_,_,_,_,_,_ ), 0 , 83 , 0 , 2867 , 5 , 123), // #724
- INST(Sha1msg2 , ExtRm , O(000F38,CA,_,_,_,_,_,_ ), 0 , 83 , 0 , 2876 , 5 , 123), // #725
- INST(Sha1nexte , ExtRm , O(000F38,C8,_,_,_,_,_,_ ), 0 , 83 , 0 , 2885 , 5 , 123), // #726
- INST(Sha1rnds4 , ExtRmi , O(000F3A,CC,_,_,_,_,_,_ ), 0 , 85 , 0 , 2895 , 8 , 123), // #727
- INST(Sha256msg1 , ExtRm , O(000F38,CC,_,_,_,_,_,_ ), 0 , 83 , 0 , 2905 , 5 , 123), // #728
- INST(Sha256msg2 , ExtRm , O(000F38,CD,_,_,_,_,_,_ ), 0 , 83 , 0 , 2916 , 5 , 123), // #729
- INST(Sha256rnds2 , ExtRm_XMM0 , O(000F38,CB,_,_,_,_,_,_ ), 0 , 83 , 0 , 2927 , 15 , 123), // #730
- INST(Shl , X86Rot , O(000000,D0,4,_,x,_,_,_ ), 0 , 9 , 0 , 2939 , 172, 1 ), // #731
- INST(Shld , X86ShldShrd , O(000F00,A4,_,_,x,_,_,_ ), 0 , 4 , 0 , 9938 , 182, 1 ), // #732
- INST(Shlx , VexRmv_Wx , V(660F38,F7,_,0,x,_,_,_ ), 0 , 96 , 0 , 2943 , 13 , 92 ), // #733
- INST(Shr , X86Rot , O(000000,D0,5,_,x,_,_,_ ), 0 , 62 , 0 , 2948 , 172, 1 ), // #734
- INST(Shrd , X86ShldShrd , O(000F00,AC,_,_,x,_,_,_ ), 0 , 4 , 0 , 2952 , 182, 1 ), // #735
- INST(Shrx , VexRmv_Wx , V(F20F38,F7,_,0,x,_,_,_ ), 0 , 84 , 0 , 2957 , 13 , 92 ), // #736
- INST(Shufpd , ExtRmi , O(660F00,C6,_,_,_,_,_,_ ), 0 , 3 , 0 , 11259, 8 , 4 ), // #737
- INST(Shufps , ExtRmi , O(000F00,C6,_,_,_,_,_,_ ), 0 , 4 , 0 , 11267, 8 , 5 ), // #738
- INST(Sidt , X86M_Only , O(000F00,01,1,_,_,_,_,_ ), 0 , 29 , 0 , 2962 , 69 , 0 ), // #739
- INST(Skinit , X86Op_xAX , O(000F01,DE,_,_,_,_,_,_ ), 0 , 21 , 0 , 2967 , 52 , 124), // #740
- INST(Sldt , X86M_NoMemSize , O(000F00,00,0,_,_,_,_,_ ), 0 , 4 , 0 , 2974 , 183, 0 ), // #741
- INST(Slwpcb , VexR_Wx , V(XOP_M9,12,1,0,x,_,_,_ ), 0 , 11 , 0 , 2979 , 108, 77 ), // #742
- INST(Smsw , X86M_NoMemSize , O(000F00,01,4,_,_,_,_,_ ), 0 , 97 , 0 , 2986 , 183, 0 ), // #743
- INST(Sqrtpd , ExtRm , O(660F00,51,_,_,_,_,_,_ ), 0 , 3 , 0 , 11275, 5 , 4 ), // #744
- INST(Sqrtps , ExtRm , O(000F00,51,_,_,_,_,_,_ ), 0 , 4 , 0 , 10961, 5 , 5 ), // #745
- INST(Sqrtsd , ExtRm , O(F20F00,51,_,_,_,_,_,_ ), 0 , 5 , 0 , 11299, 6 , 4 ), // #746
- INST(Sqrtss , ExtRm , O(F30F00,51,_,_,_,_,_,_ ), 0 , 6 , 0 , 10979, 7 , 5 ), // #747
- INST(Stac , X86Op , O(000F01,CB,_,_,_,_,_,_ ), 0 , 21 , 0 , 2991 , 30 , 16 ), // #748
- INST(Stc , X86Op , O(000000,F9,_,_,_,_,_,_ ), 0 , 0 , 0 , 2996 , 30 , 17 ), // #749
- INST(Std , X86Op , O(000000,FD,_,_,_,_,_,_ ), 0 , 0 , 0 , 7921 , 30 , 18 ), // #750
- INST(Stgi , X86Op , O(000F01,DC,_,_,_,_,_,_ ), 0 , 21 , 0 , 3000 , 30 , 124), // #751
- INST(Sti , X86Op , O(000000,FB,_,_,_,_,_,_ ), 0 , 0 , 0 , 3005 , 30 , 23 ), // #752
- INST(Stmxcsr , X86M_Only , O(000F00,AE,3,_,_,_,_,_ ), 0 , 78 , 0 , 11323, 101, 5 ), // #753
- INST(Stos , X86StrMr , O(000000,AA,_,_,_,_,_,_ ), 0 , 0 , 0 , 3009 , 184, 78 ), // #754
- INST(Str , X86M_NoMemSize , O(000F00,00,1,_,_,_,_,_ ), 0 , 29 , 0 , 3014 , 183, 0 ), // #755
- INST(Sttilecfg , AmxCfg , V(660F38,49,_,0,0,_,_,_ ), 0 , 96 , 0 , 3018 , 103, 76 ), // #756
- INST(Stui , X86Op , O(F30F01,EF,_,_,_,_,_,_ ), 0 , 25 , 0 , 3135 , 33 , 25 ), // #757
- INST(Sub , X86Arith , O(000000,28,5,_,x,_,_,_ ), 0 , 62 , 0 , 866 , 179, 1 ), // #758
- INST(Subpd , ExtRm , O(660F00,5C,_,_,_,_,_,_ ), 0 , 3 , 0 , 5413 , 5 , 4 ), // #759
- INST(Subps , ExtRm , O(000F00,5C,_,_,_,_,_,_ ), 0 , 4 , 0 , 5425 , 5 , 5 ), // #760
- INST(Subsd , ExtRm , O(F20F00,5C,_,_,_,_,_,_ ), 0 , 5 , 0 , 6392 , 6 , 4 ), // #761
- INST(Subss , ExtRm , O(F30F00,5C,_,_,_,_,_,_ ), 0 , 6 , 0 , 6402 , 7 , 5 ), // #762
- INST(Swapgs , X86Op , O(000F01,F8,_,_,_,_,_,_ ), 0 , 21 , 0 , 3028 , 33 , 0 ), // #763
- INST(Syscall , X86Op , O(000F00,05,_,_,_,_,_,_ ), 0 , 4 , 0 , 3035 , 33 , 0 ), // #764
- INST(Sysenter , X86Op , O(000F00,34,_,_,_,_,_,_ ), 0 , 4 , 0 , 3043 , 30 , 0 ), // #765
- INST(Sysexit , X86Op , O(000F00,35,_,_,_,_,_,_ ), 0 , 4 , 0 , 3052 , 30 , 0 ), // #766
- INST(Sysexitq , X86Op , O(000F00,35,_,_,1,_,_,_ ), 0 , 60 , 0 , 3060 , 30 , 0 ), // #767
- INST(Sysret , X86Op , O(000F00,07,_,_,_,_,_,_ ), 0 , 4 , 0 , 3069 , 33 , 0 ), // #768
- INST(Sysretq , X86Op , O(000F00,07,_,_,1,_,_,_ ), 0 , 60 , 0 , 3076 , 33 , 0 ), // #769
- INST(T1mskc , VexVm_Wx , V(XOP_M9,01,7,0,x,_,_,_ ), 0 , 98 , 0 , 3084 , 14 , 11 ), // #770
- INST(Tdpbf16ps , AmxRmv , V(F30F38,5C,_,0,0,_,_,_ ), 0 , 88 , 0 , 3091 , 185, 125), // #771
- INST(Tdpbssd , AmxRmv , V(F20F38,5E,_,0,0,_,_,_ ), 0 , 84 , 0 , 3101 , 185, 126), // #772
- INST(Tdpbsud , AmxRmv , V(F30F38,5E,_,0,0,_,_,_ ), 0 , 88 , 0 , 3109 , 185, 126), // #773
- INST(Tdpbusd , AmxRmv , V(660F38,5E,_,0,0,_,_,_ ), 0 , 96 , 0 , 3117 , 185, 126), // #774
- INST(Tdpbuud , AmxRmv , V(000F38,5E,_,0,0,_,_,_ ), 0 , 10 , 0 , 3125 , 185, 126), // #775
- INST(Test , X86Test , O(000000,84,_,_,x,_,_,_ ), O(000000,F6,_,_,x,_,_,_ ), 0 , 79 , 10367, 186, 1 ), // #776
- INST(Testui , X86Op , O(F30F01,ED,_,_,_,_,_,_ ), 0 , 25 , 0 , 3133 , 33 , 127), // #777
- INST(Tileloadd , AmxRm , V(F20F38,4B,_,0,0,_,_,_ ), 0 , 84 , 0 , 3140 , 187, 76 ), // #778
- INST(Tileloaddt1 , AmxRm , V(660F38,4B,_,0,0,_,_,_ ), 0 , 96 , 0 , 3150 , 187, 76 ), // #779
- INST(Tilerelease , VexOpMod , V(000F38,49,0,0,0,_,_,_ ), 0 , 10 , 0 , 3162 , 188, 76 ), // #780
- INST(Tilestored , AmxMr , V(F30F38,4B,_,0,0,_,_,_ ), 0 , 88 , 0 , 3174 , 189, 76 ), // #781
- INST(Tilezero , AmxR , V(F20F38,49,_,0,0,_,_,_ ), 0 , 84 , 0 , 3185 , 190, 76 ), // #782
- INST(Tpause , X86R32_EDX_EAX , O(660F00,AE,6,_,_,_,_,_ ), 0 , 26 , 0 , 3194 , 191, 128), // #783
- INST(Tzcnt , X86Rm_Raw66H , O(F30F00,BC,_,_,x,_,_,_ ), 0 , 6 , 0 , 3201 , 22 , 9 ), // #784
- INST(Tzmsk , VexVm_Wx , V(XOP_M9,01,4,0,x,_,_,_ ), 0 , 99 , 0 , 3207 , 14 , 11 ), // #785
- INST(Ucomisd , ExtRm , O(660F00,2E,_,_,_,_,_,_ ), 0 , 3 , 0 , 11390, 6 , 41 ), // #786
- INST(Ucomiss , ExtRm , O(000F00,2E,_,_,_,_,_,_ ), 0 , 4 , 0 , 11408, 7 , 42 ), // #787
- INST(Ud0 , X86Rm , O(000F00,FF,_,_,_,_,_,_ ), 0 , 4 , 0 , 3213 , 192, 0 ), // #788
- INST(Ud1 , X86Rm , O(000F00,B9,_,_,_,_,_,_ ), 0 , 4 , 0 , 3217 , 192, 0 ), // #789
- INST(Ud2 , X86Op , O(000F00,0B,_,_,_,_,_,_ ), 0 , 4 , 0 , 3221 , 30 , 0 ), // #790
- INST(Uiret , X86Op , O(F30F01,EC,_,_,_,_,_,_ ), 0 , 25 , 0 , 3225 , 33 , 25 ), // #791
- INST(Umonitor , X86R_FromM , O(F30F00,AE,6,_,_,_,_,_ ), 0 , 24 , 0 , 3231 , 193, 129), // #792
- INST(Umwait , X86R32_EDX_EAX , O(F20F00,AE,6,_,_,_,_,_ ), 0 , 100, 0 , 3240 , 191, 128), // #793
- INST(Unpckhpd , ExtRm , O(660F00,15,_,_,_,_,_,_ ), 0 , 3 , 0 , 11417, 5 , 4 ), // #794
- INST(Unpckhps , ExtRm , O(000F00,15,_,_,_,_,_,_ ), 0 , 4 , 0 , 11427, 5 , 5 ), // #795
- INST(Unpcklpd , ExtRm , O(660F00,14,_,_,_,_,_,_ ), 0 , 3 , 0 , 11437, 5 , 4 ), // #796
- INST(Unpcklps , ExtRm , O(000F00,14,_,_,_,_,_,_ ), 0 , 4 , 0 , 11447, 5 , 5 ), // #797
- INST(V4fmaddps , VexRm_T1_4X , E(F20F38,9A,_,2,_,0,4,T4X), 0 , 101, 0 , 3247 , 194, 130), // #798
- INST(V4fmaddss , VexRm_T1_4X , E(F20F38,9B,_,0,_,0,4,T4X), 0 , 102, 0 , 3257 , 195, 130), // #799
- INST(V4fnmaddps , VexRm_T1_4X , E(F20F38,AA,_,2,_,0,4,T4X), 0 , 101, 0 , 3267 , 194, 130), // #800
- INST(V4fnmaddss , VexRm_T1_4X , E(F20F38,AB,_,0,_,0,4,T4X), 0 , 102, 0 , 3278 , 195, 130), // #801
- INST(Vaddpd , VexRvm_Lx , V(660F00,58,_,x,I,1,4,FV ), 0 , 103, 0 , 3289 , 196, 131), // #802
- INST(Vaddph , VexRvm_Lx , E(00MAP5,58,_,_,_,0,4,FV ), 0 , 104, 0 , 3296 , 197, 132), // #803
- INST(Vaddps , VexRvm_Lx , V(000F00,58,_,x,I,0,4,FV ), 0 , 105, 0 , 3303 , 198, 131), // #804
- INST(Vaddsd , VexRvm , V(F20F00,58,_,I,I,1,3,T1S), 0 , 106, 0 , 3310 , 199, 133), // #805
- INST(Vaddsh , VexRvm , E(F3MAP5,58,_,_,_,0,1,T1S), 0 , 107, 0 , 3317 , 200, 134), // #806
- INST(Vaddss , VexRvm , V(F30F00,58,_,I,I,0,2,T1S), 0 , 108, 0 , 3324 , 201, 133), // #807
- INST(Vaddsubpd , VexRvm_Lx , V(660F00,D0,_,x,I,_,_,_ ), 0 , 69 , 0 , 3331 , 202, 135), // #808
- INST(Vaddsubps , VexRvm_Lx , V(F20F00,D0,_,x,I,_,_,_ ), 0 , 109, 0 , 3341 , 202, 135), // #809
- INST(Vaesdec , VexRvm_Lx , V(660F38,DE,_,x,I,_,4,FVM), 0 , 110, 0 , 3351 , 203, 136), // #810
- INST(Vaesdeclast , VexRvm_Lx , V(660F38,DF,_,x,I,_,4,FVM), 0 , 110, 0 , 3359 , 203, 136), // #811
- INST(Vaesenc , VexRvm_Lx , V(660F38,DC,_,x,I,_,4,FVM), 0 , 110, 0 , 3371 , 203, 136), // #812
- INST(Vaesenclast , VexRvm_Lx , V(660F38,DD,_,x,I,_,4,FVM), 0 , 110, 0 , 3379 , 203, 136), // #813
- INST(Vaesimc , VexRm , V(660F38,DB,_,0,I,_,_,_ ), 0 , 96 , 0 , 3391 , 204, 137), // #814
- INST(Vaeskeygenassist , VexRmi , V(660F3A,DF,_,0,I,_,_,_ ), 0 , 73 , 0 , 3399 , 205, 137), // #815
- INST(Valignd , VexRvmi_Lx , E(660F3A,03,_,x,_,0,4,FV ), 0 , 111, 0 , 3416 , 206, 138), // #816
- INST(Valignq , VexRvmi_Lx , E(660F3A,03,_,x,_,1,4,FV ), 0 , 112, 0 , 3424 , 207, 138), // #817
- INST(Vandnpd , VexRvm_Lx , V(660F00,55,_,x,I,1,4,FV ), 0 , 103, 0 , 3432 , 208, 139), // #818
- INST(Vandnps , VexRvm_Lx , V(000F00,55,_,x,I,0,4,FV ), 0 , 105, 0 , 3440 , 209, 139), // #819
- INST(Vandpd , VexRvm_Lx , V(660F00,54,_,x,I,1,4,FV ), 0 , 103, 0 , 3448 , 210, 139), // #820
- INST(Vandps , VexRvm_Lx , V(000F00,54,_,x,I,0,4,FV ), 0 , 105, 0 , 3455 , 211, 139), // #821
- INST(Vblendmpd , VexRvm_Lx , E(660F38,65,_,x,_,1,4,FV ), 0 , 113, 0 , 3462 , 212, 138), // #822
- INST(Vblendmps , VexRvm_Lx , E(660F38,65,_,x,_,0,4,FV ), 0 , 114, 0 , 3472 , 213, 138), // #823
- INST(Vblendpd , VexRvmi_Lx , V(660F3A,0D,_,x,I,_,_,_ ), 0 , 73 , 0 , 3482 , 214, 135), // #824
- INST(Vblendps , VexRvmi_Lx , V(660F3A,0C,_,x,I,_,_,_ ), 0 , 73 , 0 , 3491 , 214, 135), // #825
- INST(Vblendvpd , VexRvmr_Lx , V(660F3A,4B,_,x,0,_,_,_ ), 0 , 73 , 0 , 3500 , 215, 135), // #826
- INST(Vblendvps , VexRvmr_Lx , V(660F3A,4A,_,x,0,_,_,_ ), 0 , 73 , 0 , 3510 , 215, 135), // #827
- INST(Vbroadcastf128 , VexRm , V(660F38,1A,_,1,0,_,_,_ ), 0 , 115, 0 , 3520 , 216, 135), // #828
- INST(Vbroadcastf32x2 , VexRm_Lx , E(660F38,19,_,x,_,0,3,T2 ), 0 , 116, 0 , 3535 , 217, 140), // #829
- INST(Vbroadcastf32x4 , VexRm_Lx , E(660F38,1A,_,x,_,0,4,T4 ), 0 , 117, 0 , 3551 , 218, 68 ), // #830
- INST(Vbroadcastf32x8 , VexRm , E(660F38,1B,_,2,_,0,5,T8 ), 0 , 118, 0 , 3567 , 219, 66 ), // #831
- INST(Vbroadcastf64x2 , VexRm_Lx , E(660F38,1A,_,x,_,1,4,T2 ), 0 , 119, 0 , 3583 , 218, 140), // #832
- INST(Vbroadcastf64x4 , VexRm , E(660F38,1B,_,2,_,1,5,T4 ), 0 , 120, 0 , 3599 , 219, 68 ), // #833
- INST(Vbroadcasti128 , VexRm , V(660F38,5A,_,1,0,_,_,_ ), 0 , 115, 0 , 3615 , 216, 141), // #834
- INST(Vbroadcasti32x2 , VexRm_Lx , E(660F38,59,_,x,_,0,3,T2 ), 0 , 116, 0 , 3630 , 220, 140), // #835
- INST(Vbroadcasti32x4 , VexRm_Lx , E(660F38,5A,_,x,_,0,4,T4 ), 0 , 117, 0 , 3646 , 218, 138), // #836
- INST(Vbroadcasti32x8 , VexRm , E(660F38,5B,_,2,_,0,5,T8 ), 0 , 118, 0 , 3662 , 219, 66 ), // #837
- INST(Vbroadcasti64x2 , VexRm_Lx , E(660F38,5A,_,x,_,1,4,T2 ), 0 , 119, 0 , 3678 , 218, 140), // #838
- INST(Vbroadcasti64x4 , VexRm , E(660F38,5B,_,2,_,1,5,T4 ), 0 , 120, 0 , 3694 , 219, 68 ), // #839
- INST(Vbroadcastsd , VexRm_Lx , V(660F38,19,_,x,0,1,3,T1S), 0 , 121, 0 , 3710 , 221, 142), // #840
- INST(Vbroadcastss , VexRm_Lx , V(660F38,18,_,x,0,0,2,T1S), 0 , 122, 0 , 3723 , 222, 142), // #841
- INST(Vcmppd , VexRvmi_Lx_KEvex , V(660F00,C2,_,x,I,1,4,FV ), 0 , 103, 0 , 3736 , 223, 131), // #842
- INST(Vcmpph , VexRvmi_Lx_KEvex , E(000F3A,C2,_,_,_,0,4,FV ), 0 , 123, 0 , 3743 , 224, 132), // #843
- INST(Vcmpps , VexRvmi_Lx_KEvex , V(000F00,C2,_,x,I,0,4,FV ), 0 , 105, 0 , 3750 , 225, 131), // #844
- INST(Vcmpsd , VexRvmi_KEvex , V(F20F00,C2,_,I,I,1,3,T1S), 0 , 106, 0 , 3757 , 226, 133), // #845
- INST(Vcmpsh , VexRvmi_KEvex , E(F30F3A,C2,_,_,_,0,1,T1S), 0 , 124, 0 , 3764 , 227, 134), // #846
- INST(Vcmpss , VexRvmi_KEvex , V(F30F00,C2,_,I,I,0,2,T1S), 0 , 108, 0 , 3771 , 228, 133), // #847
- INST(Vcomisd , VexRm , V(660F00,2F,_,I,I,1,3,T1S), 0 , 125, 0 , 3778 , 229, 143), // #848
- INST(Vcomish , VexRm , E(00MAP5,2F,_,_,_,0,1,T1S), 0 , 126, 0 , 3786 , 230, 134), // #849
- INST(Vcomiss , VexRm , V(000F00,2F,_,I,I,0,2,T1S), 0 , 127, 0 , 3794 , 231, 143), // #850
- INST(Vcompresspd , VexMr_Lx , E(660F38,8A,_,x,_,1,3,T1S), 0 , 128, 0 , 3802 , 232, 138), // #851
- INST(Vcompressps , VexMr_Lx , E(660F38,8A,_,x,_,0,2,T1S), 0 , 129, 0 , 3814 , 232, 138), // #852
- INST(Vcvtdq2pd , VexRm_Lx , V(F30F00,E6,_,x,I,0,3,HV ), 0 , 130, 0 , 3826 , 233, 131), // #853
- INST(Vcvtdq2ph , VexRm_Lx , E(00MAP5,5B,_,_,_,0,4,FV ), 0 , 104, 0 , 3836 , 234, 132), // #854
- INST(Vcvtdq2ps , VexRm_Lx , V(000F00,5B,_,x,I,0,4,FV ), 0 , 105, 0 , 3846 , 235, 131), // #855
- INST(Vcvtne2ps2bf16 , VexRvm_Lx , E(F20F38,72,_,_,_,0,4,FV ), 0 , 131, 0 , 3856 , 213, 144), // #856
- INST(Vcvtneps2bf16 , VexRm_Lx_Narrow , E(F30F38,72,_,_,_,0,4,FV ), 0 , 132, 0 , 3871 , 236, 144), // #857
- INST(Vcvtpd2dq , VexRm_Lx_Narrow , V(F20F00,E6,_,x,I,1,4,FV ), 0 , 133, 0 , 3885 , 237, 131), // #858
- INST(Vcvtpd2ph , VexRm_Lx , E(66MAP5,5A,_,_,_,1,4,FV ), 0 , 134, 0 , 3895 , 238, 132), // #859
- INST(Vcvtpd2ps , VexRm_Lx_Narrow , V(660F00,5A,_,x,I,1,4,FV ), 0 , 103, 0 , 3905 , 237, 131), // #860
- INST(Vcvtpd2qq , VexRm_Lx , E(660F00,7B,_,x,_,1,4,FV ), 0 , 135, 0 , 3915 , 239, 140), // #861
- INST(Vcvtpd2udq , VexRm_Lx_Narrow , E(000F00,79,_,x,_,1,4,FV ), 0 , 136, 0 , 3925 , 240, 138), // #862
- INST(Vcvtpd2uqq , VexRm_Lx , E(660F00,79,_,x,_,1,4,FV ), 0 , 135, 0 , 3936 , 239, 140), // #863
- INST(Vcvtph2dq , VexRm_Lx , E(66MAP5,5B,_,_,_,0,3,HV ), 0 , 137, 0 , 3947 , 241, 132), // #864
- INST(Vcvtph2pd , VexRm_Lx , E(00MAP5,5A,_,_,_,0,2,QV ), 0 , 138, 0 , 3957 , 242, 132), // #865
- INST(Vcvtph2ps , VexRm_Lx , V(660F38,13,_,x,0,0,3,HVM), 0 , 139, 0 , 3967 , 243, 145), // #866
- INST(Vcvtph2psx , VexRm_Lx , E(66MAP6,13,_,_,_,0,3,HV ), 0 , 140, 0 , 3977 , 244, 132), // #867
- INST(Vcvtph2qq , VexRm_Lx , E(66MAP5,7B,_,_,_,0,2,QV ), 0 , 141, 0 , 3988 , 245, 132), // #868
- INST(Vcvtph2udq , VexRm_Lx , E(00MAP5,79,_,_,_,0,3,HV ), 0 , 142, 0 , 3998 , 241, 132), // #869
- INST(Vcvtph2uqq , VexRm_Lx , E(66MAP5,79,_,_,_,0,2,QV ), 0 , 141, 0 , 4009 , 245, 132), // #870
- INST(Vcvtph2uw , VexRm_Lx , E(00MAP5,7D,_,_,_,0,4,FV ), 0 , 104, 0 , 4020 , 246, 132), // #871
- INST(Vcvtph2w , VexRm_Lx , E(66MAP5,7D,_,_,_,0,4,FV ), 0 , 143, 0 , 4030 , 246, 132), // #872
- INST(Vcvtps2dq , VexRm_Lx , V(660F00,5B,_,x,I,0,4,FV ), 0 , 144, 0 , 4039 , 235, 131), // #873
- INST(Vcvtps2pd , VexRm_Lx , V(000F00,5A,_,x,I,0,3,HV ), 0 , 145, 0 , 4049 , 247, 131), // #874
- INST(Vcvtps2ph , VexMri_Lx , V(660F3A,1D,_,x,0,0,3,HVM), 0 , 146, 0 , 4059 , 248, 145), // #875
- INST(Vcvtps2phx , VexRm_Lx , E(66MAP5,1D,_,_,_,0,4,FV ), 0 , 143, 0 , 4069 , 234, 132), // #876
- INST(Vcvtps2qq , VexRm_Lx , E(660F00,7B,_,x,_,0,3,HV ), 0 , 147, 0 , 4080 , 249, 140), // #877
- INST(Vcvtps2udq , VexRm_Lx , E(000F00,79,_,x,_,0,4,FV ), 0 , 148, 0 , 4090 , 250, 138), // #878
- INST(Vcvtps2uqq , VexRm_Lx , E(660F00,79,_,x,_,0,3,HV ), 0 , 147, 0 , 4101 , 249, 140), // #879
- INST(Vcvtqq2pd , VexRm_Lx , E(F30F00,E6,_,x,_,1,4,FV ), 0 , 149, 0 , 4112 , 239, 140), // #880
- INST(Vcvtqq2ph , VexRm_Lx , E(00MAP5,5B,_,_,_,1,4,FV ), 0 , 150, 0 , 4122 , 238, 132), // #881
- INST(Vcvtqq2ps , VexRm_Lx_Narrow , E(000F00,5B,_,x,_,1,4,FV ), 0 , 136, 0 , 4132 , 240, 140), // #882
- INST(Vcvtsd2sh , VexRvm , E(F2MAP5,5A,_,_,_,1,3,T1S), 0 , 151, 0 , 4142 , 251, 134), // #883
- INST(Vcvtsd2si , VexRm_Wx , V(F20F00,2D,_,I,x,x,3,T1F), 0 , 152, 0 , 4152 , 252, 133), // #884
- INST(Vcvtsd2ss , VexRvm , V(F20F00,5A,_,I,I,1,3,T1S), 0 , 106, 0 , 4162 , 199, 133), // #885
- INST(Vcvtsd2usi , VexRm_Wx , E(F20F00,79,_,I,_,x,3,T1F), 0 , 153, 0 , 4172 , 253, 68 ), // #886
- INST(Vcvtsh2sd , VexRvm , E(F3MAP5,5A,_,_,_,0,1,T1S), 0 , 107, 0 , 4183 , 254, 134), // #887
- INST(Vcvtsh2si , VexRm_Wx , E(F3MAP5,2D,_,_,_,x,1,T1S), 0 , 107, 0 , 4193 , 255, 134), // #888
- INST(Vcvtsh2ss , VexRvm , E(00MAP6,13,_,_,_,0,1,T1S), 0 , 154, 0 , 4203 , 254, 134), // #889
- INST(Vcvtsh2usi , VexRm_Wx , E(F3MAP5,79,_,_,_,x,1,T1S), 0 , 107, 0 , 4213 , 255, 134), // #890
- INST(Vcvtsi2sd , VexRvm_Wx , V(F20F00,2A,_,I,x,x,2,T1W), 0 , 155, 0 , 4224 , 256, 133), // #891
- INST(Vcvtsi2sh , VexRvm_Wx , E(F3MAP5,2A,_,_,_,x,2,T1W), 0 , 156, 0 , 4234 , 257, 134), // #892
- INST(Vcvtsi2ss , VexRvm_Wx , V(F30F00,2A,_,I,x,x,2,T1W), 0 , 157, 0 , 4244 , 256, 133), // #893
- INST(Vcvtss2sd , VexRvm , V(F30F00,5A,_,I,I,0,2,T1S), 0 , 108, 0 , 4254 , 258, 133), // #894
- INST(Vcvtss2sh , VexRvm , E(00MAP5,1D,_,_,_,0,2,T1S), 0 , 158, 0 , 4264 , 259, 134), // #895
- INST(Vcvtss2si , VexRm_Wx , V(F30F00,2D,_,I,x,x,2,T1F), 0 , 108, 0 , 4274 , 260, 133), // #896
- INST(Vcvtss2usi , VexRm_Wx , E(F30F00,79,_,I,_,x,2,T1F), 0 , 159, 0 , 4284 , 261, 68 ), // #897
- INST(Vcvttpd2dq , VexRm_Lx_Narrow , V(660F00,E6,_,x,I,1,4,FV ), 0 , 103, 0 , 4295 , 262, 131), // #898
- INST(Vcvttpd2qq , VexRm_Lx , E(660F00,7A,_,x,_,1,4,FV ), 0 , 135, 0 , 4306 , 263, 138), // #899
- INST(Vcvttpd2udq , VexRm_Lx_Narrow , E(000F00,78,_,x,_,1,4,FV ), 0 , 136, 0 , 4317 , 264, 138), // #900
- INST(Vcvttpd2uqq , VexRm_Lx , E(660F00,78,_,x,_,1,4,FV ), 0 , 135, 0 , 4329 , 263, 140), // #901
- INST(Vcvttph2dq , VexRm_Lx , E(F3MAP5,5B,_,_,_,0,3,HV ), 0 , 160, 0 , 4341 , 244, 132), // #902
- INST(Vcvttph2qq , VexRm_Lx , E(66MAP5,7A,_,_,_,0,2,QV ), 0 , 141, 0 , 4352 , 242, 132), // #903
- INST(Vcvttph2udq , VexRm_Lx , E(00MAP5,78,_,_,_,0,3,HV ), 0 , 142, 0 , 4363 , 244, 132), // #904
- INST(Vcvttph2uqq , VexRm_Lx , E(66MAP5,78,_,_,_,0,2,QV ), 0 , 141, 0 , 4375 , 242, 132), // #905
- INST(Vcvttph2uw , VexRm_Lx , E(00MAP5,7C,_,_,_,0,4,FV ), 0 , 104, 0 , 4387 , 265, 132), // #906
- INST(Vcvttph2w , VexRm_Lx , E(66MAP5,7C,_,_,_,0,4,FV ), 0 , 143, 0 , 4398 , 265, 132), // #907
- INST(Vcvttps2dq , VexRm_Lx , V(F30F00,5B,_,x,I,0,4,FV ), 0 , 161, 0 , 4408 , 266, 131), // #908
- INST(Vcvttps2qq , VexRm_Lx , E(660F00,7A,_,x,_,0,3,HV ), 0 , 147, 0 , 4419 , 267, 140), // #909
- INST(Vcvttps2udq , VexRm_Lx , E(000F00,78,_,x,_,0,4,FV ), 0 , 148, 0 , 4430 , 268, 138), // #910
- INST(Vcvttps2uqq , VexRm_Lx , E(660F00,78,_,x,_,0,3,HV ), 0 , 147, 0 , 4442 , 267, 140), // #911
- INST(Vcvttsd2si , VexRm_Wx , V(F20F00,2C,_,I,x,x,3,T1F), 0 , 152, 0 , 4454 , 269, 133), // #912
- INST(Vcvttsd2usi , VexRm_Wx , E(F20F00,78,_,I,_,x,3,T1F), 0 , 153, 0 , 4465 , 270, 68 ), // #913
- INST(Vcvttsh2si , VexRm_Wx , E(F3MAP5,2C,_,_,_,x,1,T1S), 0 , 107, 0 , 4477 , 271, 134), // #914
- INST(Vcvttsh2usi , VexRm_Wx , E(F3MAP5,78,_,_,_,x,1,T1S), 0 , 107, 0 , 4488 , 271, 134), // #915
- INST(Vcvttss2si , VexRm_Wx , V(F30F00,2C,_,I,x,x,2,T1F), 0 , 108, 0 , 4500 , 272, 133), // #916
- INST(Vcvttss2usi , VexRm_Wx , E(F30F00,78,_,I,_,x,2,T1F), 0 , 159, 0 , 4511 , 273, 68 ), // #917
- INST(Vcvtudq2pd , VexRm_Lx , E(F30F00,7A,_,x,_,0,3,HV ), 0 , 162, 0 , 4523 , 274, 138), // #918
- INST(Vcvtudq2ph , VexRm_Lx , E(F2MAP5,7A,_,_,_,0,4,FV ), 0 , 163, 0 , 4534 , 234, 132), // #919
- INST(Vcvtudq2ps , VexRm_Lx , E(F20F00,7A,_,x,_,0,4,FV ), 0 , 164, 0 , 4545 , 250, 138), // #920
- INST(Vcvtuqq2pd , VexRm_Lx , E(F30F00,7A,_,x,_,1,4,FV ), 0 , 149, 0 , 4556 , 239, 140), // #921
- INST(Vcvtuqq2ph , VexRm_Lx , E(F2MAP5,7A,_,_,_,1,4,FV ), 0 , 165, 0 , 4567 , 238, 132), // #922
- INST(Vcvtuqq2ps , VexRm_Lx_Narrow , E(F20F00,7A,_,x,_,1,4,FV ), 0 , 166, 0 , 4578 , 240, 140), // #923
- INST(Vcvtusi2sd , VexRvm_Wx , E(F20F00,7B,_,I,_,x,2,T1W), 0 , 167, 0 , 4589 , 257, 68 ), // #924
- INST(Vcvtusi2sh , VexRvm_Wx , E(F3MAP5,7B,_,_,_,x,2,T1W), 0 , 156, 0 , 4600 , 257, 134), // #925
- INST(Vcvtusi2ss , VexRvm_Wx , E(F30F00,7B,_,I,_,x,2,T1W), 0 , 168, 0 , 4611 , 257, 68 ), // #926
- INST(Vcvtuw2ph , VexRm_Lx , E(F2MAP5,7D,_,_,_,0,4,FV ), 0 , 163, 0 , 4622 , 246, 132), // #927
- INST(Vcvtw2ph , VexRm_Lx , E(F3MAP5,7D,_,_,_,0,4,FV ), 0 , 169, 0 , 4632 , 246, 132), // #928
- INST(Vdbpsadbw , VexRvmi_Lx , E(660F3A,42,_,x,_,0,4,FVM), 0 , 111, 0 , 4641 , 275, 146), // #929
- INST(Vdivpd , VexRvm_Lx , V(660F00,5E,_,x,I,1,4,FV ), 0 , 103, 0 , 4651 , 196, 131), // #930
- INST(Vdivph , VexRvm_Lx , E(00MAP5,5E,_,_,_,0,4,FV ), 0 , 104, 0 , 4658 , 197, 132), // #931
- INST(Vdivps , VexRvm_Lx , V(000F00,5E,_,x,I,0,4,FV ), 0 , 105, 0 , 4665 , 198, 131), // #932
- INST(Vdivsd , VexRvm , V(F20F00,5E,_,I,I,1,3,T1S), 0 , 106, 0 , 4672 , 199, 133), // #933
- INST(Vdivsh , VexRvm , E(F3MAP5,5E,_,_,_,0,1,T1S), 0 , 107, 0 , 4679 , 200, 134), // #934
- INST(Vdivss , VexRvm , V(F30F00,5E,_,I,I,0,2,T1S), 0 , 108, 0 , 4686 , 201, 133), // #935
- INST(Vdpbf16ps , VexRvm_Lx , E(F30F38,52,_,_,_,0,4,FV ), 0 , 132, 0 , 4693 , 213, 144), // #936
- INST(Vdppd , VexRvmi_Lx , V(660F3A,41,_,x,I,_,_,_ ), 0 , 73 , 0 , 4703 , 276, 135), // #937
- INST(Vdpps , VexRvmi_Lx , V(660F3A,40,_,x,I,_,_,_ ), 0 , 73 , 0 , 4709 , 214, 135), // #938
- INST(Verr , X86M_NoSize , O(000F00,00,4,_,_,_,_,_ ), 0 , 97 , 0 , 4715 , 107, 10 ), // #939
- INST(Verw , X86M_NoSize , O(000F00,00,5,_,_,_,_,_ ), 0 , 77 , 0 , 4720 , 107, 10 ), // #940
- INST(Vexp2pd , VexRm , E(660F38,C8,_,2,_,1,4,FV ), 0 , 170, 0 , 4725 , 277, 147), // #941
- INST(Vexp2ps , VexRm , E(660F38,C8,_,2,_,0,4,FV ), 0 , 171, 0 , 4733 , 278, 147), // #942
- INST(Vexpandpd , VexRm_Lx , E(660F38,88,_,x,_,1,3,T1S), 0 , 128, 0 , 4741 , 279, 138), // #943
- INST(Vexpandps , VexRm_Lx , E(660F38,88,_,x,_,0,2,T1S), 0 , 129, 0 , 4751 , 279, 138), // #944
- INST(Vextractf128 , VexMri , V(660F3A,19,_,1,0,_,_,_ ), 0 , 172, 0 , 4761 , 280, 135), // #945
- INST(Vextractf32x4 , VexMri_Lx , E(660F3A,19,_,x,_,0,4,T4 ), 0 , 173, 0 , 4774 , 281, 138), // #946
- INST(Vextractf32x8 , VexMri , E(660F3A,1B,_,2,_,0,5,T8 ), 0 , 174, 0 , 4788 , 282, 66 ), // #947
- INST(Vextractf64x2 , VexMri_Lx , E(660F3A,19,_,x,_,1,4,T2 ), 0 , 175, 0 , 4802 , 281, 140), // #948
- INST(Vextractf64x4 , VexMri , E(660F3A,1B,_,2,_,1,5,T4 ), 0 , 176, 0 , 4816 , 282, 68 ), // #949
- INST(Vextracti128 , VexMri , V(660F3A,39,_,1,0,_,_,_ ), 0 , 172, 0 , 4830 , 280, 141), // #950
- INST(Vextracti32x4 , VexMri_Lx , E(660F3A,39,_,x,_,0,4,T4 ), 0 , 173, 0 , 4843 , 281, 138), // #951
- INST(Vextracti32x8 , VexMri , E(660F3A,3B,_,2,_,0,5,T8 ), 0 , 174, 0 , 4857 , 282, 66 ), // #952
- INST(Vextracti64x2 , VexMri_Lx , E(660F3A,39,_,x,_,1,4,T2 ), 0 , 175, 0 , 4871 , 281, 140), // #953
- INST(Vextracti64x4 , VexMri , E(660F3A,3B,_,2,_,1,5,T4 ), 0 , 176, 0 , 4885 , 282, 68 ), // #954
- INST(Vextractps , VexMri , V(660F3A,17,_,0,I,I,2,T1S), 0 , 177, 0 , 4899 , 283, 133), // #955
- INST(Vfcmaddcph , VexRvm_Lx , E(F2MAP6,56,_,_,_,0,4,FV ), 0 , 178, 0 , 4910 , 284, 132), // #956
- INST(Vfcmaddcsh , VexRvm , E(F2MAP6,57,_,_,_,0,2,T1S), 0 , 179, 0 , 4921 , 259, 132), // #957
- INST(Vfcmulcph , VexRvm_Lx , E(F2MAP6,D6,_,_,_,0,4,FV ), 0 , 178, 0 , 4932 , 284, 132), // #958
- INST(Vfcmulcsh , VexRvm , E(F2MAP6,D7,_,_,_,0,2,T1S), 0 , 179, 0 , 4942 , 259, 132), // #959
- INST(Vfixupimmpd , VexRvmi_Lx , E(660F3A,54,_,x,_,1,4,FV ), 0 , 112, 0 , 4952 , 285, 138), // #960
- INST(Vfixupimmps , VexRvmi_Lx , E(660F3A,54,_,x,_,0,4,FV ), 0 , 111, 0 , 4964 , 286, 138), // #961
- INST(Vfixupimmsd , VexRvmi , E(660F3A,55,_,I,_,1,3,T1S), 0 , 180, 0 , 4976 , 287, 68 ), // #962
- INST(Vfixupimmss , VexRvmi , E(660F3A,55,_,I,_,0,2,T1S), 0 , 181, 0 , 4988 , 288, 68 ), // #963
- INST(Vfmadd132pd , VexRvm_Lx , V(660F38,98,_,x,1,1,4,FV ), 0 , 182, 0 , 5000 , 196, 148), // #964
- INST(Vfmadd132ph , VexRvm_Lx , E(66MAP6,98,_,_,_,0,4,FV ), 0 , 183, 0 , 5012 , 197, 132), // #965
- INST(Vfmadd132ps , VexRvm_Lx , V(660F38,98,_,x,0,0,4,FV ), 0 , 110, 0 , 5024 , 198, 148), // #966
- INST(Vfmadd132sd , VexRvm , V(660F38,99,_,I,1,1,3,T1S), 0 , 184, 0 , 5036 , 199, 149), // #967
- INST(Vfmadd132sh , VexRvm , E(66MAP6,99,_,_,_,0,1,T1S), 0 , 185, 0 , 5048 , 200, 134), // #968
- INST(Vfmadd132ss , VexRvm , V(660F38,99,_,I,0,0,2,T1S), 0 , 122, 0 , 5060 , 201, 149), // #969
- INST(Vfmadd213pd , VexRvm_Lx , V(660F38,A8,_,x,1,1,4,FV ), 0 , 182, 0 , 5072 , 196, 148), // #970
- INST(Vfmadd213ph , VexRvm_Lx , E(66MAP6,A8,_,_,_,0,4,FV ), 0 , 183, 0 , 5084 , 197, 132), // #971
- INST(Vfmadd213ps , VexRvm_Lx , V(660F38,A8,_,x,0,0,4,FV ), 0 , 110, 0 , 5096 , 198, 148), // #972
- INST(Vfmadd213sd , VexRvm , V(660F38,A9,_,I,1,1,3,T1S), 0 , 184, 0 , 5108 , 199, 149), // #973
- INST(Vfmadd213sh , VexRvm , E(66MAP6,A9,_,_,_,0,1,T1S), 0 , 185, 0 , 5120 , 200, 134), // #974
- INST(Vfmadd213ss , VexRvm , V(660F38,A9,_,I,0,0,2,T1S), 0 , 122, 0 , 5132 , 201, 149), // #975
- INST(Vfmadd231pd , VexRvm_Lx , V(660F38,B8,_,x,1,1,4,FV ), 0 , 182, 0 , 5144 , 196, 148), // #976
- INST(Vfmadd231ph , VexRvm_Lx , E(66MAP6,B8,_,_,_,0,4,FV ), 0 , 183, 0 , 5156 , 197, 132), // #977
- INST(Vfmadd231ps , VexRvm_Lx , V(660F38,B8,_,x,0,0,4,FV ), 0 , 110, 0 , 5168 , 198, 148), // #978
- INST(Vfmadd231sd , VexRvm , V(660F38,B9,_,I,1,1,3,T1S), 0 , 184, 0 , 5180 , 199, 149), // #979
- INST(Vfmadd231sh , VexRvm , E(66MAP6,B9,_,_,_,0,1,T1S), 0 , 185, 0 , 5192 , 200, 134), // #980
- INST(Vfmadd231ss , VexRvm , V(660F38,B9,_,I,0,0,2,T1S), 0 , 122, 0 , 5204 , 201, 149), // #981
- INST(Vfmaddcph , VexRvm_Lx , E(F3MAP6,56,_,_,_,0,4,FV ), 0 , 186, 0 , 5216 , 284, 132), // #982
- INST(Vfmaddcsh , VexRvm , E(F3MAP6,57,_,_,_,0,2,T1S), 0 , 187, 0 , 5226 , 259, 132), // #983
- INST(Vfmaddpd , Fma4_Lx , V(660F3A,69,_,x,x,_,_,_ ), 0 , 73 , 0 , 5236 , 289, 150), // #984
- INST(Vfmaddps , Fma4_Lx , V(660F3A,68,_,x,x,_,_,_ ), 0 , 73 , 0 , 5245 , 289, 150), // #985
- INST(Vfmaddsd , Fma4 , V(660F3A,6B,_,0,x,_,_,_ ), 0 , 73 , 0 , 5254 , 290, 150), // #986
- INST(Vfmaddss , Fma4 , V(660F3A,6A,_,0,x,_,_,_ ), 0 , 73 , 0 , 5263 , 291, 150), // #987
- INST(Vfmaddsub132pd , VexRvm_Lx , V(660F38,96,_,x,1,1,4,FV ), 0 , 182, 0 , 5272 , 196, 148), // #988
- INST(Vfmaddsub132ph , VexRvm_Lx , E(66MAP6,96,_,_,_,0,4,FV ), 0 , 183, 0 , 5287 , 197, 132), // #989
- INST(Vfmaddsub132ps , VexRvm_Lx , V(660F38,96,_,x,0,0,4,FV ), 0 , 110, 0 , 5302 , 198, 148), // #990
- INST(Vfmaddsub213pd , VexRvm_Lx , V(660F38,A6,_,x,1,1,4,FV ), 0 , 182, 0 , 5317 , 196, 148), // #991
- INST(Vfmaddsub213ph , VexRvm_Lx , E(66MAP6,A6,_,_,_,0,4,FV ), 0 , 183, 0 , 5332 , 197, 132), // #992
- INST(Vfmaddsub213ps , VexRvm_Lx , V(660F38,A6,_,x,0,0,4,FV ), 0 , 110, 0 , 5347 , 198, 148), // #993
- INST(Vfmaddsub231pd , VexRvm_Lx , V(660F38,B6,_,x,1,1,4,FV ), 0 , 182, 0 , 5362 , 196, 148), // #994
- INST(Vfmaddsub231ph , VexRvm_Lx , E(66MAP6,B6,_,_,_,0,4,FV ), 0 , 183, 0 , 5377 , 197, 132), // #995
- INST(Vfmaddsub231ps , VexRvm_Lx , V(660F38,B6,_,x,0,0,4,FV ), 0 , 110, 0 , 5392 , 198, 148), // #996
- INST(Vfmaddsubpd , Fma4_Lx , V(660F3A,5D,_,x,x,_,_,_ ), 0 , 73 , 0 , 5407 , 289, 150), // #997
- INST(Vfmaddsubps , Fma4_Lx , V(660F3A,5C,_,x,x,_,_,_ ), 0 , 73 , 0 , 5419 , 289, 150), // #998
- INST(Vfmsub132pd , VexRvm_Lx , V(660F38,9A,_,x,1,1,4,FV ), 0 , 182, 0 , 5431 , 196, 148), // #999
- INST(Vfmsub132ph , VexRvm_Lx , E(66MAP6,9A,_,_,_,0,4,FV ), 0 , 183, 0 , 5443 , 197, 132), // #1000
- INST(Vfmsub132ps , VexRvm_Lx , V(660F38,9A,_,x,0,0,4,FV ), 0 , 110, 0 , 5455 , 198, 148), // #1001
- INST(Vfmsub132sd , VexRvm , V(660F38,9B,_,I,1,1,3,T1S), 0 , 184, 0 , 5467 , 199, 149), // #1002
- INST(Vfmsub132sh , VexRvm , E(66MAP6,9B,_,_,_,0,1,T1S), 0 , 185, 0 , 5479 , 200, 134), // #1003
- INST(Vfmsub132ss , VexRvm , V(660F38,9B,_,I,0,0,2,T1S), 0 , 122, 0 , 5491 , 201, 149), // #1004
- INST(Vfmsub213pd , VexRvm_Lx , V(660F38,AA,_,x,1,1,4,FV ), 0 , 182, 0 , 5503 , 196, 148), // #1005
- INST(Vfmsub213ph , VexRvm_Lx , E(66MAP6,AA,_,_,_,0,4,FV ), 0 , 183, 0 , 5515 , 197, 132), // #1006
- INST(Vfmsub213ps , VexRvm_Lx , V(660F38,AA,_,x,0,0,4,FV ), 0 , 110, 0 , 5527 , 198, 148), // #1007
- INST(Vfmsub213sd , VexRvm , V(660F38,AB,_,I,1,1,3,T1S), 0 , 184, 0 , 5539 , 199, 149), // #1008
- INST(Vfmsub213sh , VexRvm , E(66MAP6,AB,_,_,_,0,1,T1S), 0 , 185, 0 , 5551 , 200, 134), // #1009
- INST(Vfmsub213ss , VexRvm , V(660F38,AB,_,I,0,0,2,T1S), 0 , 122, 0 , 5563 , 201, 149), // #1010
- INST(Vfmsub231pd , VexRvm_Lx , V(660F38,BA,_,x,1,1,4,FV ), 0 , 182, 0 , 5575 , 196, 148), // #1011
- INST(Vfmsub231ph , VexRvm_Lx , E(66MAP6,BA,_,_,_,0,4,FV ), 0 , 183, 0 , 5587 , 197, 132), // #1012
- INST(Vfmsub231ps , VexRvm_Lx , V(660F38,BA,_,x,0,0,4,FV ), 0 , 110, 0 , 5599 , 198, 148), // #1013
- INST(Vfmsub231sd , VexRvm , V(660F38,BB,_,I,1,1,3,T1S), 0 , 184, 0 , 5611 , 199, 149), // #1014
- INST(Vfmsub231sh , VexRvm , E(66MAP6,BB,_,_,_,0,1,T1S), 0 , 185, 0 , 5623 , 200, 134), // #1015
- INST(Vfmsub231ss , VexRvm , V(660F38,BB,_,I,0,0,2,T1S), 0 , 122, 0 , 5635 , 201, 149), // #1016
- INST(Vfmsubadd132pd , VexRvm_Lx , V(660F38,97,_,x,1,1,4,FV ), 0 , 182, 0 , 5647 , 196, 148), // #1017
- INST(Vfmsubadd132ph , VexRvm_Lx , E(66MAP6,97,_,_,_,0,4,FV ), 0 , 183, 0 , 5662 , 197, 132), // #1018
- INST(Vfmsubadd132ps , VexRvm_Lx , V(660F38,97,_,x,0,0,4,FV ), 0 , 110, 0 , 5677 , 198, 148), // #1019
- INST(Vfmsubadd213pd , VexRvm_Lx , V(660F38,A7,_,x,1,1,4,FV ), 0 , 182, 0 , 5692 , 196, 148), // #1020
- INST(Vfmsubadd213ph , VexRvm_Lx , E(66MAP6,A7,_,_,_,0,4,FV ), 0 , 183, 0 , 5707 , 197, 132), // #1021
- INST(Vfmsubadd213ps , VexRvm_Lx , V(660F38,A7,_,x,0,0,4,FV ), 0 , 110, 0 , 5722 , 198, 148), // #1022
- INST(Vfmsubadd231pd , VexRvm_Lx , V(660F38,B7,_,x,1,1,4,FV ), 0 , 182, 0 , 5737 , 196, 148), // #1023
- INST(Vfmsubadd231ph , VexRvm_Lx , E(66MAP6,B7,_,_,_,0,4,FV ), 0 , 183, 0 , 5752 , 197, 132), // #1024
- INST(Vfmsubadd231ps , VexRvm_Lx , V(660F38,B7,_,x,0,0,4,FV ), 0 , 110, 0 , 5767 , 198, 148), // #1025
- INST(Vfmsubaddpd , Fma4_Lx , V(660F3A,5F,_,x,x,_,_,_ ), 0 , 73 , 0 , 5782 , 289, 150), // #1026
- INST(Vfmsubaddps , Fma4_Lx , V(660F3A,5E,_,x,x,_,_,_ ), 0 , 73 , 0 , 5794 , 289, 150), // #1027
- INST(Vfmsubpd , Fma4_Lx , V(660F3A,6D,_,x,x,_,_,_ ), 0 , 73 , 0 , 5806 , 289, 150), // #1028
- INST(Vfmsubps , Fma4_Lx , V(660F3A,6C,_,x,x,_,_,_ ), 0 , 73 , 0 , 5815 , 289, 150), // #1029
- INST(Vfmsubsd , Fma4 , V(660F3A,6F,_,0,x,_,_,_ ), 0 , 73 , 0 , 5824 , 290, 150), // #1030
- INST(Vfmsubss , Fma4 , V(660F3A,6E,_,0,x,_,_,_ ), 0 , 73 , 0 , 5833 , 291, 150), // #1031
- INST(Vfmulcph , VexRvm_Lx , E(F3MAP6,D6,_,_,_,0,4,FV ), 0 , 186, 0 , 5842 , 284, 132), // #1032
- INST(Vfmulcsh , VexRvm , E(F3MAP6,D7,_,_,_,0,2,T1S), 0 , 187, 0 , 5851 , 259, 132), // #1033
- INST(Vfnmadd132pd , VexRvm_Lx , V(660F38,9C,_,x,1,1,4,FV ), 0 , 182, 0 , 5860 , 196, 148), // #1034
- INST(Vfnmadd132ph , VexRvm_Lx , E(66MAP6,9C,_,_,_,0,4,FV ), 0 , 183, 0 , 5873 , 197, 132), // #1035
- INST(Vfnmadd132ps , VexRvm_Lx , V(660F38,9C,_,x,0,0,4,FV ), 0 , 110, 0 , 5886 , 198, 148), // #1036
- INST(Vfnmadd132sd , VexRvm , V(660F38,9D,_,I,1,1,3,T1S), 0 , 184, 0 , 5899 , 199, 149), // #1037
- INST(Vfnmadd132sh , VexRvm , E(66MAP6,9D,_,_,_,0,1,T1S), 0 , 185, 0 , 5912 , 200, 134), // #1038
- INST(Vfnmadd132ss , VexRvm , V(660F38,9D,_,I,0,0,2,T1S), 0 , 122, 0 , 5925 , 201, 149), // #1039
- INST(Vfnmadd213pd , VexRvm_Lx , V(660F38,AC,_,x,1,1,4,FV ), 0 , 182, 0 , 5938 , 196, 148), // #1040
- INST(Vfnmadd213ph , VexRvm_Lx , E(66MAP6,AC,_,_,_,0,4,FV ), 0 , 183, 0 , 5951 , 197, 132), // #1041
- INST(Vfnmadd213ps , VexRvm_Lx , V(660F38,AC,_,x,0,0,4,FV ), 0 , 110, 0 , 5964 , 198, 148), // #1042
- INST(Vfnmadd213sd , VexRvm , V(660F38,AD,_,I,1,1,3,T1S), 0 , 184, 0 , 5977 , 199, 149), // #1043
- INST(Vfnmadd213sh , VexRvm , E(66MAP6,AD,_,_,_,0,1,T1S), 0 , 185, 0 , 5990 , 200, 134), // #1044
- INST(Vfnmadd213ss , VexRvm , V(660F38,AD,_,I,0,0,2,T1S), 0 , 122, 0 , 6003 , 201, 149), // #1045
- INST(Vfnmadd231pd , VexRvm_Lx , V(660F38,BC,_,x,1,1,4,FV ), 0 , 182, 0 , 6016 , 196, 148), // #1046
- INST(Vfnmadd231ph , VexRvm_Lx , E(66MAP6,BC,_,_,_,0,4,FV ), 0 , 183, 0 , 6029 , 197, 132), // #1047
- INST(Vfnmadd231ps , VexRvm_Lx , V(660F38,BC,_,x,0,0,4,FV ), 0 , 110, 0 , 6042 , 198, 148), // #1048
- INST(Vfnmadd231sd , VexRvm , V(660F38,BD,_,I,1,1,3,T1S), 0 , 184, 0 , 6055 , 199, 149), // #1049
- INST(Vfnmadd231sh , VexRvm , E(66MAP6,BD,_,_,_,0,1,T1S), 0 , 185, 0 , 6068 , 200, 134), // #1050
- INST(Vfnmadd231ss , VexRvm , V(660F38,BD,_,I,0,0,2,T1S), 0 , 122, 0 , 6081 , 201, 149), // #1051
- INST(Vfnmaddpd , Fma4_Lx , V(660F3A,79,_,x,x,_,_,_ ), 0 , 73 , 0 , 6094 , 289, 150), // #1052
- INST(Vfnmaddps , Fma4_Lx , V(660F3A,78,_,x,x,_,_,_ ), 0 , 73 , 0 , 6104 , 289, 150), // #1053
- INST(Vfnmaddsd , Fma4 , V(660F3A,7B,_,0,x,_,_,_ ), 0 , 73 , 0 , 6114 , 290, 150), // #1054
- INST(Vfnmaddss , Fma4 , V(660F3A,7A,_,0,x,_,_,_ ), 0 , 73 , 0 , 6124 , 291, 150), // #1055
- INST(Vfnmsub132pd , VexRvm_Lx , V(660F38,9E,_,x,1,1,4,FV ), 0 , 182, 0 , 6134 , 196, 148), // #1056
- INST(Vfnmsub132ph , VexRvm_Lx , E(66MAP6,9E,_,_,_,0,4,FV ), 0 , 183, 0 , 6147 , 197, 132), // #1057
- INST(Vfnmsub132ps , VexRvm_Lx , V(660F38,9E,_,x,0,0,4,FV ), 0 , 110, 0 , 6160 , 198, 148), // #1058
- INST(Vfnmsub132sd , VexRvm , V(660F38,9F,_,I,1,1,3,T1S), 0 , 184, 0 , 6173 , 199, 149), // #1059
- INST(Vfnmsub132sh , VexRvm , E(66MAP6,9F,_,_,_,0,1,T1S), 0 , 185, 0 , 6186 , 200, 134), // #1060
- INST(Vfnmsub132ss , VexRvm , V(660F38,9F,_,I,0,0,2,T1S), 0 , 122, 0 , 6199 , 201, 149), // #1061
- INST(Vfnmsub213pd , VexRvm_Lx , V(660F38,AE,_,x,1,1,4,FV ), 0 , 182, 0 , 6212 , 196, 148), // #1062
- INST(Vfnmsub213ph , VexRvm_Lx , E(66MAP6,AE,_,_,_,0,4,FV ), 0 , 183, 0 , 6225 , 197, 132), // #1063
- INST(Vfnmsub213ps , VexRvm_Lx , V(660F38,AE,_,x,0,0,4,FV ), 0 , 110, 0 , 6238 , 198, 148), // #1064
- INST(Vfnmsub213sd , VexRvm , V(660F38,AF,_,I,1,1,3,T1S), 0 , 184, 0 , 6251 , 199, 149), // #1065
- INST(Vfnmsub213sh , VexRvm , E(66MAP6,AF,_,_,_,0,1,T1S), 0 , 185, 0 , 6264 , 200, 134), // #1066
- INST(Vfnmsub213ss , VexRvm , V(660F38,AF,_,I,0,0,2,T1S), 0 , 122, 0 , 6277 , 201, 149), // #1067
- INST(Vfnmsub231pd , VexRvm_Lx , V(660F38,BE,_,x,1,1,4,FV ), 0 , 182, 0 , 6290 , 196, 148), // #1068
- INST(Vfnmsub231ph , VexRvm_Lx , E(66MAP6,BE,_,_,_,0,4,FV ), 0 , 183, 0 , 6303 , 197, 132), // #1069
- INST(Vfnmsub231ps , VexRvm_Lx , V(660F38,BE,_,x,0,0,4,FV ), 0 , 110, 0 , 6316 , 198, 148), // #1070
- INST(Vfnmsub231sd , VexRvm , V(660F38,BF,_,I,1,1,3,T1S), 0 , 184, 0 , 6329 , 199, 149), // #1071
- INST(Vfnmsub231sh , VexRvm , E(66MAP6,BF,_,_,_,0,1,T1S), 0 , 185, 0 , 6342 , 200, 134), // #1072
- INST(Vfnmsub231ss , VexRvm , V(660F38,BF,_,I,0,0,2,T1S), 0 , 122, 0 , 6355 , 201, 149), // #1073
- INST(Vfnmsubpd , Fma4_Lx , V(660F3A,7D,_,x,x,_,_,_ ), 0 , 73 , 0 , 6368 , 289, 150), // #1074
- INST(Vfnmsubps , Fma4_Lx , V(660F3A,7C,_,x,x,_,_,_ ), 0 , 73 , 0 , 6378 , 289, 150), // #1075
- INST(Vfnmsubsd , Fma4 , V(660F3A,7F,_,0,x,_,_,_ ), 0 , 73 , 0 , 6388 , 290, 150), // #1076
- INST(Vfnmsubss , Fma4 , V(660F3A,7E,_,0,x,_,_,_ ), 0 , 73 , 0 , 6398 , 291, 150), // #1077
- INST(Vfpclasspd , VexRmi_Lx , E(660F3A,66,_,x,_,1,4,FV ), 0 , 112, 0 , 6408 , 292, 140), // #1078
- INST(Vfpclassph , VexRmi_Lx , E(000F3A,66,_,_,_,0,4,FV ), 0 , 123, 0 , 6419 , 293, 132), // #1079
- INST(Vfpclassps , VexRmi_Lx , E(660F3A,66,_,x,_,0,4,FV ), 0 , 111, 0 , 6430 , 294, 140), // #1080
- INST(Vfpclasssd , VexRmi , E(660F3A,67,_,I,_,1,3,T1S), 0 , 180, 0 , 6441 , 295, 66 ), // #1081
- INST(Vfpclasssh , VexRmi , E(000F3A,67,_,_,_,0,1,T1S), 0 , 188, 0 , 6452 , 296, 134), // #1082
- INST(Vfpclassss , VexRmi , E(660F3A,67,_,I,_,0,2,T1S), 0 , 181, 0 , 6463 , 297, 66 ), // #1083
- INST(Vfrczpd , VexRm_Lx , V(XOP_M9,81,_,x,0,_,_,_ ), 0 , 79 , 0 , 6474 , 298, 151), // #1084
- INST(Vfrczps , VexRm_Lx , V(XOP_M9,80,_,x,0,_,_,_ ), 0 , 79 , 0 , 6482 , 298, 151), // #1085
- INST(Vfrczsd , VexRm , V(XOP_M9,83,_,0,0,_,_,_ ), 0 , 79 , 0 , 6490 , 299, 151), // #1086
- INST(Vfrczss , VexRm , V(XOP_M9,82,_,0,0,_,_,_ ), 0 , 79 , 0 , 6498 , 300, 151), // #1087
- INST(Vgatherdpd , VexRmvRm_VM , V(660F38,92,_,x,1,_,_,_ ), E(660F38,92,_,x,_,1,3,T1S), 189, 80 , 6506 , 301, 152), // #1088
- INST(Vgatherdps , VexRmvRm_VM , V(660F38,92,_,x,0,_,_,_ ), E(660F38,92,_,x,_,0,2,T1S), 96 , 81 , 6517 , 302, 152), // #1089
- INST(Vgatherpf0dpd , VexM_VM , E(660F38,C6,1,2,_,1,3,T1S), 0 , 190, 0 , 6528 , 303, 153), // #1090
- INST(Vgatherpf0dps , VexM_VM , E(660F38,C6,1,2,_,0,2,T1S), 0 , 191, 0 , 6542 , 304, 153), // #1091
- INST(Vgatherpf0qpd , VexM_VM , E(660F38,C7,1,2,_,1,3,T1S), 0 , 190, 0 , 6556 , 305, 153), // #1092
- INST(Vgatherpf0qps , VexM_VM , E(660F38,C7,1,2,_,0,2,T1S), 0 , 191, 0 , 6570 , 305, 153), // #1093
- INST(Vgatherpf1dpd , VexM_VM , E(660F38,C6,2,2,_,1,3,T1S), 0 , 192, 0 , 6584 , 303, 153), // #1094
- INST(Vgatherpf1dps , VexM_VM , E(660F38,C6,2,2,_,0,2,T1S), 0 , 193, 0 , 6598 , 304, 153), // #1095
- INST(Vgatherpf1qpd , VexM_VM , E(660F38,C7,2,2,_,1,3,T1S), 0 , 192, 0 , 6612 , 305, 153), // #1096
- INST(Vgatherpf1qps , VexM_VM , E(660F38,C7,2,2,_,0,2,T1S), 0 , 193, 0 , 6626 , 305, 153), // #1097
- INST(Vgatherqpd , VexRmvRm_VM , V(660F38,93,_,x,1,_,_,_ ), E(660F38,93,_,x,_,1,3,T1S), 189, 82 , 6640 , 306, 152), // #1098
- INST(Vgatherqps , VexRmvRm_VM , V(660F38,93,_,x,0,_,_,_ ), E(660F38,93,_,x,_,0,2,T1S), 96 , 83 , 6651 , 307, 152), // #1099
- INST(Vgetexppd , VexRm_Lx , E(660F38,42,_,x,_,1,4,FV ), 0 , 113, 0 , 6662 , 263, 138), // #1100
- INST(Vgetexpph , VexRm_Lx , E(66MAP6,42,_,_,_,0,4,FV ), 0 , 183, 0 , 6672 , 265, 132), // #1101
- INST(Vgetexpps , VexRm_Lx , E(660F38,42,_,x,_,0,4,FV ), 0 , 114, 0 , 6682 , 268, 138), // #1102
- INST(Vgetexpsd , VexRvm , E(660F38,43,_,I,_,1,3,T1S), 0 , 128, 0 , 6692 , 308, 68 ), // #1103
- INST(Vgetexpsh , VexRvm , E(66MAP6,43,_,_,_,0,1,T1S), 0 , 185, 0 , 6702 , 254, 134), // #1104
- INST(Vgetexpss , VexRvm , E(660F38,43,_,I,_,0,2,T1S), 0 , 129, 0 , 6712 , 309, 68 ), // #1105
- INST(Vgetmantpd , VexRmi_Lx , E(660F3A,26,_,x,_,1,4,FV ), 0 , 112, 0 , 6722 , 310, 138), // #1106
- INST(Vgetmantph , VexRmi_Lx , E(000F3A,26,_,_,_,0,4,FV ), 0 , 123, 0 , 6733 , 311, 132), // #1107
- INST(Vgetmantps , VexRmi_Lx , E(660F3A,26,_,x,_,0,4,FV ), 0 , 111, 0 , 6744 , 312, 138), // #1108
- INST(Vgetmantsd , VexRvmi , E(660F3A,27,_,I,_,1,3,T1S), 0 , 180, 0 , 6755 , 287, 68 ), // #1109
- INST(Vgetmantsh , VexRvmi , E(000F3A,27,_,_,_,0,1,T1S), 0 , 188, 0 , 6766 , 313, 134), // #1110
- INST(Vgetmantss , VexRvmi , E(660F3A,27,_,I,_,0,2,T1S), 0 , 181, 0 , 6777 , 288, 68 ), // #1111
- INST(Vgf2p8affineinvqb, VexRvmi_Lx , V(660F3A,CF,_,x,1,1,4,FV ), 0 , 194, 0 , 6788 , 314, 154), // #1112
- INST(Vgf2p8affineqb , VexRvmi_Lx , V(660F3A,CE,_,x,1,1,4,FV ), 0 , 194, 0 , 6806 , 314, 154), // #1113
- INST(Vgf2p8mulb , VexRvm_Lx , V(660F38,CF,_,x,0,0,4,FV ), 0 , 110, 0 , 6821 , 315, 154), // #1114
- INST(Vhaddpd , VexRvm_Lx , V(660F00,7C,_,x,I,_,_,_ ), 0 , 69 , 0 , 6832 , 202, 135), // #1115
- INST(Vhaddps , VexRvm_Lx , V(F20F00,7C,_,x,I,_,_,_ ), 0 , 109, 0 , 6840 , 202, 135), // #1116
- INST(Vhsubpd , VexRvm_Lx , V(660F00,7D,_,x,I,_,_,_ ), 0 , 69 , 0 , 6848 , 202, 135), // #1117
- INST(Vhsubps , VexRvm_Lx , V(F20F00,7D,_,x,I,_,_,_ ), 0 , 109, 0 , 6856 , 202, 135), // #1118
- INST(Vinsertf128 , VexRvmi , V(660F3A,18,_,1,0,_,_,_ ), 0 , 172, 0 , 6864 , 316, 135), // #1119
- INST(Vinsertf32x4 , VexRvmi_Lx , E(660F3A,18,_,x,_,0,4,T4 ), 0 , 173, 0 , 6876 , 317, 138), // #1120
- INST(Vinsertf32x8 , VexRvmi , E(660F3A,1A,_,2,_,0,5,T8 ), 0 , 174, 0 , 6889 , 318, 66 ), // #1121
- INST(Vinsertf64x2 , VexRvmi_Lx , E(660F3A,18,_,x,_,1,4,T2 ), 0 , 175, 0 , 6902 , 317, 140), // #1122
- INST(Vinsertf64x4 , VexRvmi , E(660F3A,1A,_,2,_,1,5,T4 ), 0 , 176, 0 , 6915 , 318, 68 ), // #1123
- INST(Vinserti128 , VexRvmi , V(660F3A,38,_,1,0,_,_,_ ), 0 , 172, 0 , 6928 , 316, 141), // #1124
- INST(Vinserti32x4 , VexRvmi_Lx , E(660F3A,38,_,x,_,0,4,T4 ), 0 , 173, 0 , 6940 , 317, 138), // #1125
- INST(Vinserti32x8 , VexRvmi , E(660F3A,3A,_,2,_,0,5,T8 ), 0 , 174, 0 , 6953 , 318, 66 ), // #1126
- INST(Vinserti64x2 , VexRvmi_Lx , E(660F3A,38,_,x,_,1,4,T2 ), 0 , 175, 0 , 6966 , 317, 140), // #1127
- INST(Vinserti64x4 , VexRvmi , E(660F3A,3A,_,2,_,1,5,T4 ), 0 , 176, 0 , 6979 , 318, 68 ), // #1128
- INST(Vinsertps , VexRvmi , V(660F3A,21,_,0,I,0,2,T1S), 0 , 177, 0 , 6992 , 319, 133), // #1129
- INST(Vlddqu , VexRm_Lx , V(F20F00,F0,_,x,I,_,_,_ ), 0 , 109, 0 , 7002 , 320, 135), // #1130
- INST(Vldmxcsr , VexM , V(000F00,AE,2,0,I,_,_,_ ), 0 , 195, 0 , 7009 , 321, 135), // #1131
- INST(Vmaskmovdqu , VexRm_ZDI , V(660F00,F7,_,0,I,_,_,_ ), 0 , 69 , 0 , 7018 , 322, 135), // #1132
- INST(Vmaskmovpd , VexRvmMvr_Lx , V(660F38,2D,_,x,0,_,_,_ ), V(660F38,2F,_,x,0,_,_,_ ), 96 , 84 , 7030 , 323, 135), // #1133
- INST(Vmaskmovps , VexRvmMvr_Lx , V(660F38,2C,_,x,0,_,_,_ ), V(660F38,2E,_,x,0,_,_,_ ), 96 , 85 , 7041 , 323, 135), // #1134
- INST(Vmaxpd , VexRvm_Lx , V(660F00,5F,_,x,I,1,4,FV ), 0 , 103, 0 , 7052 , 324, 131), // #1135
- INST(Vmaxph , VexRvm_Lx , E(00MAP5,5F,_,_,_,0,4,FV ), 0 , 104, 0 , 7059 , 325, 132), // #1136
- INST(Vmaxps , VexRvm_Lx , V(000F00,5F,_,x,I,0,4,FV ), 0 , 105, 0 , 7066 , 326, 131), // #1137
- INST(Vmaxsd , VexRvm , V(F20F00,5F,_,I,I,1,3,T1S), 0 , 106, 0 , 7073 , 327, 131), // #1138
- INST(Vmaxsh , VexRvm , E(F3MAP5,5F,_,_,_,0,1,T1S), 0 , 107, 0 , 7080 , 254, 134), // #1139
- INST(Vmaxss , VexRvm , V(F30F00,5F,_,I,I,0,2,T1S), 0 , 108, 0 , 7087 , 258, 131), // #1140
- INST(Vmcall , X86Op , O(000F01,C1,_,_,_,_,_,_ ), 0 , 21 , 0 , 7094 , 30 , 58 ), // #1141
- INST(Vmclear , X86M_Only , O(660F00,C7,6,_,_,_,_,_ ), 0 , 26 , 0 , 7101 , 32 , 58 ), // #1142
- INST(Vmfunc , X86Op , O(000F01,D4,_,_,_,_,_,_ ), 0 , 21 , 0 , 7109 , 30 , 58 ), // #1143
- INST(Vminpd , VexRvm_Lx , V(660F00,5D,_,x,I,1,4,FV ), 0 , 103, 0 , 7116 , 324, 131), // #1144
- INST(Vminph , VexRvm_Lx , E(00MAP5,5D,_,_,_,0,4,FV ), 0 , 104, 0 , 7123 , 325, 132), // #1145
- INST(Vminps , VexRvm_Lx , V(000F00,5D,_,x,I,0,4,FV ), 0 , 105, 0 , 7130 , 326, 131), // #1146
- INST(Vminsd , VexRvm , V(F20F00,5D,_,I,I,1,3,T1S), 0 , 106, 0 , 7137 , 327, 131), // #1147
- INST(Vminsh , VexRvm , E(F3MAP5,5D,_,_,_,0,1,T1S), 0 , 107, 0 , 7144 , 254, 134), // #1148
- INST(Vminss , VexRvm , V(F30F00,5D,_,I,I,0,2,T1S), 0 , 108, 0 , 7151 , 258, 131), // #1149
- INST(Vmlaunch , X86Op , O(000F01,C2,_,_,_,_,_,_ ), 0 , 21 , 0 , 7158 , 30 , 58 ), // #1150
- INST(Vmload , X86Op_xAX , O(000F01,DA,_,_,_,_,_,_ ), 0 , 21 , 0 , 7167 , 328, 22 ), // #1151
- INST(Vmmcall , X86Op , O(000F01,D9,_,_,_,_,_,_ ), 0 , 21 , 0 , 7174 , 30 , 22 ), // #1152
- INST(Vmovapd , VexRmMr_Lx , V(660F00,28,_,x,I,1,4,FVM), V(660F00,29,_,x,I,1,4,FVM), 103, 86 , 7182 , 329, 155), // #1153
- INST(Vmovaps , VexRmMr_Lx , V(000F00,28,_,x,I,0,4,FVM), V(000F00,29,_,x,I,0,4,FVM), 105, 87 , 7190 , 329, 155), // #1154
- INST(Vmovd , VexMovdMovq , V(660F00,6E,_,0,0,0,2,T1S), V(660F00,7E,_,0,0,0,2,T1S), 196, 88 , 7198 , 330, 133), // #1155
- INST(Vmovddup , VexRm_Lx , V(F20F00,12,_,x,I,1,3,DUP), 0 , 197, 0 , 7204 , 331, 131), // #1156
- INST(Vmovdqa , VexRmMr_Lx , V(660F00,6F,_,x,I,_,_,_ ), V(660F00,7F,_,x,I,_,_,_ ), 69 , 89 , 7213 , 332, 156), // #1157
- INST(Vmovdqa32 , VexRmMr_Lx , E(660F00,6F,_,x,_,0,4,FVM), E(660F00,7F,_,x,_,0,4,FVM), 198, 90 , 7221 , 333, 157), // #1158
- INST(Vmovdqa64 , VexRmMr_Lx , E(660F00,6F,_,x,_,1,4,FVM), E(660F00,7F,_,x,_,1,4,FVM), 135, 91 , 7231 , 333, 157), // #1159
- INST(Vmovdqu , VexRmMr_Lx , V(F30F00,6F,_,x,I,_,_,_ ), V(F30F00,7F,_,x,I,_,_,_ ), 199, 92 , 7241 , 332, 156), // #1160
- INST(Vmovdqu16 , VexRmMr_Lx , E(F20F00,6F,_,x,_,1,4,FVM), E(F20F00,7F,_,x,_,1,4,FVM), 166, 93 , 7249 , 333, 158), // #1161
- INST(Vmovdqu32 , VexRmMr_Lx , E(F30F00,6F,_,x,_,0,4,FVM), E(F30F00,7F,_,x,_,0,4,FVM), 200, 94 , 7259 , 333, 157), // #1162
- INST(Vmovdqu64 , VexRmMr_Lx , E(F30F00,6F,_,x,_,1,4,FVM), E(F30F00,7F,_,x,_,1,4,FVM), 149, 95 , 7269 , 333, 157), // #1163
- INST(Vmovdqu8 , VexRmMr_Lx , E(F20F00,6F,_,x,_,0,4,FVM), E(F20F00,7F,_,x,_,0,4,FVM), 164, 96 , 7279 , 333, 158), // #1164
- INST(Vmovhlps , VexRvm , V(000F00,12,_,0,I,0,_,_ ), 0 , 72 , 0 , 7288 , 334, 133), // #1165
- INST(Vmovhpd , VexRvmMr , V(660F00,16,_,0,I,1,3,T1S), V(660F00,17,_,0,I,1,3,T1S), 125, 97 , 7297 , 335, 133), // #1166
- INST(Vmovhps , VexRvmMr , V(000F00,16,_,0,I,0,3,T2 ), V(000F00,17,_,0,I,0,3,T2 ), 201, 98 , 7305 , 335, 133), // #1167
- INST(Vmovlhps , VexRvm , V(000F00,16,_,0,I,0,_,_ ), 0 , 72 , 0 , 7313 , 334, 133), // #1168
- INST(Vmovlpd , VexRvmMr , V(660F00,12,_,0,I,1,3,T1S), V(660F00,13,_,0,I,1,3,T1S), 125, 99 , 7322 , 335, 133), // #1169
- INST(Vmovlps , VexRvmMr , V(000F00,12,_,0,I,0,3,T2 ), V(000F00,13,_,0,I,0,3,T2 ), 201, 100, 7330 , 335, 133), // #1170
- INST(Vmovmskpd , VexRm_Lx , V(660F00,50,_,x,I,_,_,_ ), 0 , 69 , 0 , 7338 , 336, 135), // #1171
- INST(Vmovmskps , VexRm_Lx , V(000F00,50,_,x,I,_,_,_ ), 0 , 72 , 0 , 7348 , 336, 135), // #1172
- INST(Vmovntdq , VexMr_Lx , V(660F00,E7,_,x,I,0,4,FVM), 0 , 144, 0 , 7358 , 337, 131), // #1173
- INST(Vmovntdqa , VexRm_Lx , V(660F38,2A,_,x,I,0,4,FVM), 0 , 110, 0 , 7367 , 338, 142), // #1174
- INST(Vmovntpd , VexMr_Lx , V(660F00,2B,_,x,I,1,4,FVM), 0 , 103, 0 , 7377 , 337, 131), // #1175
- INST(Vmovntps , VexMr_Lx , V(000F00,2B,_,x,I,0,4,FVM), 0 , 105, 0 , 7386 , 337, 131), // #1176
- INST(Vmovq , VexMovdMovq , V(660F00,6E,_,0,I,1,3,T1S), V(660F00,7E,_,0,I,1,3,T1S), 125, 101, 7395 , 339, 159), // #1177
- INST(Vmovsd , VexMovssMovsd , V(F20F00,10,_,I,I,1,3,T1S), V(F20F00,11,_,I,I,1,3,T1S), 106, 102, 7401 , 340, 159), // #1178
- INST(Vmovsh , VexMovssMovsd , E(F3MAP5,10,_,I,_,0,1,T1S), E(F3MAP5,11,_,I,_,0,1,T1S), 107, 103, 7408 , 341, 134), // #1179
- INST(Vmovshdup , VexRm_Lx , V(F30F00,16,_,x,I,0,4,FVM), 0 , 161, 0 , 7415 , 342, 131), // #1180
- INST(Vmovsldup , VexRm_Lx , V(F30F00,12,_,x,I,0,4,FVM), 0 , 161, 0 , 7425 , 342, 131), // #1181
- INST(Vmovss , VexMovssMovsd , V(F30F00,10,_,I,I,0,2,T1S), V(F30F00,11,_,I,I,0,2,T1S), 108, 104, 7435 , 343, 159), // #1182
- INST(Vmovupd , VexRmMr_Lx , V(660F00,10,_,x,I,1,4,FVM), V(660F00,11,_,x,I,1,4,FVM), 103, 105, 7442 , 329, 155), // #1183
- INST(Vmovups , VexRmMr_Lx , V(000F00,10,_,x,I,0,4,FVM), V(000F00,11,_,x,I,0,4,FVM), 105, 106, 7450 , 329, 155), // #1184
- INST(Vmovw , VexMovdMovq , E(66MAP5,6E,_,0,_,I,1,T1S), E(66MAP5,7E,_,0,_,I,1,T1S), 202, 107, 7458 , 344, 134), // #1185
- INST(Vmpsadbw , VexRvmi_Lx , V(660F3A,42,_,x,I,_,_,_ ), 0 , 73 , 0 , 7464 , 214, 160), // #1186
- INST(Vmptrld , X86M_Only , O(000F00,C7,6,_,_,_,_,_ ), 0 , 80 , 0 , 7473 , 32 , 58 ), // #1187
- INST(Vmptrst , X86M_Only , O(000F00,C7,7,_,_,_,_,_ ), 0 , 22 , 0 , 7481 , 32 , 58 ), // #1188
- INST(Vmread , X86Mr_NoSize , O(000F00,78,_,_,_,_,_,_ ), 0 , 4 , 0 , 7489 , 345, 58 ), // #1189
- INST(Vmresume , X86Op , O(000F01,C3,_,_,_,_,_,_ ), 0 , 21 , 0 , 7496 , 30 , 58 ), // #1190
- INST(Vmrun , X86Op_xAX , O(000F01,D8,_,_,_,_,_,_ ), 0 , 21 , 0 , 7505 , 328, 22 ), // #1191
- INST(Vmsave , X86Op_xAX , O(000F01,DB,_,_,_,_,_,_ ), 0 , 21 , 0 , 7511 , 328, 22 ), // #1192
- INST(Vmulpd , VexRvm_Lx , V(660F00,59,_,x,I,1,4,FV ), 0 , 103, 0 , 7518 , 196, 131), // #1193
- INST(Vmulph , VexRvm_Lx , E(00MAP5,59,_,_,_,0,4,FV ), 0 , 104, 0 , 7525 , 197, 132), // #1194
- INST(Vmulps , VexRvm_Lx , V(000F00,59,_,x,I,0,4,FV ), 0 , 105, 0 , 7532 , 198, 131), // #1195
- INST(Vmulsd , VexRvm , V(F20F00,59,_,I,I,1,3,T1S), 0 , 106, 0 , 7539 , 199, 133), // #1196
- INST(Vmulsh , VexRvm , E(F3MAP5,59,_,_,_,0,1,T1S), 0 , 107, 0 , 7546 , 200, 134), // #1197
- INST(Vmulss , VexRvm , V(F30F00,59,_,I,I,0,2,T1S), 0 , 108, 0 , 7553 , 201, 133), // #1198
- INST(Vmwrite , X86Rm_NoSize , O(000F00,79,_,_,_,_,_,_ ), 0 , 4 , 0 , 7560 , 346, 58 ), // #1199
- INST(Vmxon , X86M_Only , O(F30F00,C7,6,_,_,_,_,_ ), 0 , 24 , 0 , 7568 , 32 , 58 ), // #1200
- INST(Vorpd , VexRvm_Lx , V(660F00,56,_,x,I,1,4,FV ), 0 , 103, 0 , 7574 , 210, 139), // #1201
- INST(Vorps , VexRvm_Lx , V(000F00,56,_,x,I,0,4,FV ), 0 , 105, 0 , 7580 , 211, 139), // #1202
- INST(Vp2intersectd , VexRvm_Lx_2xK , E(F20F38,68,_,_,_,0,4,FV ), 0 , 131, 0 , 7586 , 347, 161), // #1203
- INST(Vp2intersectq , VexRvm_Lx_2xK , E(F20F38,68,_,_,_,1,4,FV ), 0 , 203, 0 , 7600 , 348, 161), // #1204
- INST(Vp4dpwssd , VexRm_T1_4X , E(F20F38,52,_,2,_,0,4,T4X), 0 , 101, 0 , 7614 , 194, 162), // #1205
- INST(Vp4dpwssds , VexRm_T1_4X , E(F20F38,53,_,2,_,0,4,T4X), 0 , 101, 0 , 7624 , 194, 162), // #1206
- INST(Vpabsb , VexRm_Lx , V(660F38,1C,_,x,I,_,4,FVM), 0 , 110, 0 , 7635 , 342, 163), // #1207
- INST(Vpabsd , VexRm_Lx , V(660F38,1E,_,x,I,0,4,FV ), 0 , 110, 0 , 7642 , 349, 142), // #1208
- INST(Vpabsq , VexRm_Lx , E(660F38,1F,_,x,_,1,4,FV ), 0 , 113, 0 , 7649 , 350, 138), // #1209
- INST(Vpabsw , VexRm_Lx , V(660F38,1D,_,x,I,_,4,FVM), 0 , 110, 0 , 7656 , 342, 163), // #1210
- INST(Vpackssdw , VexRvm_Lx , V(660F00,6B,_,x,I,0,4,FV ), 0 , 144, 0 , 7663 , 209, 163), // #1211
- INST(Vpacksswb , VexRvm_Lx , V(660F00,63,_,x,I,I,4,FVM), 0 , 144, 0 , 7673 , 315, 163), // #1212
- INST(Vpackusdw , VexRvm_Lx , V(660F38,2B,_,x,I,0,4,FV ), 0 , 110, 0 , 7683 , 209, 163), // #1213
- INST(Vpackuswb , VexRvm_Lx , V(660F00,67,_,x,I,I,4,FVM), 0 , 144, 0 , 7693 , 315, 163), // #1214
- INST(Vpaddb , VexRvm_Lx , V(660F00,FC,_,x,I,I,4,FVM), 0 , 144, 0 , 7703 , 315, 163), // #1215
- INST(Vpaddd , VexRvm_Lx , V(660F00,FE,_,x,I,0,4,FV ), 0 , 144, 0 , 7710 , 209, 142), // #1216
- INST(Vpaddq , VexRvm_Lx , V(660F00,D4,_,x,I,1,4,FV ), 0 , 103, 0 , 7717 , 208, 142), // #1217
- INST(Vpaddsb , VexRvm_Lx , V(660F00,EC,_,x,I,I,4,FVM), 0 , 144, 0 , 7724 , 315, 163), // #1218
- INST(Vpaddsw , VexRvm_Lx , V(660F00,ED,_,x,I,I,4,FVM), 0 , 144, 0 , 7732 , 315, 163), // #1219
- INST(Vpaddusb , VexRvm_Lx , V(660F00,DC,_,x,I,I,4,FVM), 0 , 144, 0 , 7740 , 315, 163), // #1220
- INST(Vpaddusw , VexRvm_Lx , V(660F00,DD,_,x,I,I,4,FVM), 0 , 144, 0 , 7749 , 315, 163), // #1221
- INST(Vpaddw , VexRvm_Lx , V(660F00,FD,_,x,I,I,4,FVM), 0 , 144, 0 , 7758 , 315, 163), // #1222
- INST(Vpalignr , VexRvmi_Lx , V(660F3A,0F,_,x,I,I,4,FVM), 0 , 204, 0 , 7765 , 314, 163), // #1223
- INST(Vpand , VexRvm_Lx , V(660F00,DB,_,x,I,_,_,_ ), 0 , 69 , 0 , 7774 , 351, 160), // #1224
- INST(Vpandd , VexRvm_Lx , E(660F00,DB,_,x,_,0,4,FV ), 0 , 198, 0 , 7780 , 352, 138), // #1225
- INST(Vpandn , VexRvm_Lx , V(660F00,DF,_,x,I,_,_,_ ), 0 , 69 , 0 , 7787 , 353, 160), // #1226
- INST(Vpandnd , VexRvm_Lx , E(660F00,DF,_,x,_,0,4,FV ), 0 , 198, 0 , 7794 , 354, 138), // #1227
- INST(Vpandnq , VexRvm_Lx , E(660F00,DF,_,x,_,1,4,FV ), 0 , 135, 0 , 7802 , 355, 138), // #1228
- INST(Vpandq , VexRvm_Lx , E(660F00,DB,_,x,_,1,4,FV ), 0 , 135, 0 , 7810 , 356, 138), // #1229
- INST(Vpavgb , VexRvm_Lx , V(660F00,E0,_,x,I,I,4,FVM), 0 , 144, 0 , 7817 , 315, 163), // #1230
- INST(Vpavgw , VexRvm_Lx , V(660F00,E3,_,x,I,I,4,FVM), 0 , 144, 0 , 7824 , 315, 163), // #1231
- INST(Vpblendd , VexRvmi_Lx , V(660F3A,02,_,x,0,_,_,_ ), 0 , 73 , 0 , 7831 , 214, 141), // #1232
- INST(Vpblendmb , VexRvm_Lx , E(660F38,66,_,x,_,0,4,FVM), 0 , 114, 0 , 7840 , 357, 146), // #1233
- INST(Vpblendmd , VexRvm_Lx , E(660F38,64,_,x,_,0,4,FV ), 0 , 114, 0 , 7850 , 213, 138), // #1234
- INST(Vpblendmq , VexRvm_Lx , E(660F38,64,_,x,_,1,4,FV ), 0 , 113, 0 , 7860 , 212, 138), // #1235
- INST(Vpblendmw , VexRvm_Lx , E(660F38,66,_,x,_,1,4,FVM), 0 , 113, 0 , 7870 , 357, 146), // #1236
- INST(Vpblendvb , VexRvmr_Lx , V(660F3A,4C,_,x,0,_,_,_ ), 0 , 73 , 0 , 7880 , 215, 160), // #1237
- INST(Vpblendw , VexRvmi_Lx , V(660F3A,0E,_,x,I,_,_,_ ), 0 , 73 , 0 , 7890 , 214, 160), // #1238
- INST(Vpbroadcastb , VexRm_Lx_Bcst , V(660F38,78,_,x,0,0,0,T1S), E(660F38,7A,_,x,0,0,0,T1S), 96 , 108, 7899 , 358, 164), // #1239
- INST(Vpbroadcastd , VexRm_Lx_Bcst , V(660F38,58,_,x,0,0,2,T1S), E(660F38,7C,_,x,0,0,0,T1S), 122, 109, 7912 , 359, 152), // #1240
- INST(Vpbroadcastmb2q , VexRm_Lx , E(F30F38,2A,_,x,_,1,_,_ ), 0 , 205, 0 , 7925 , 360, 165), // #1241
- INST(Vpbroadcastmw2d , VexRm_Lx , E(F30F38,3A,_,x,_,0,_,_ ), 0 , 206, 0 , 7941 , 360, 165), // #1242
- INST(Vpbroadcastq , VexRm_Lx_Bcst , V(660F38,59,_,x,0,1,3,T1S), E(660F38,7C,_,x,0,1,0,T1S), 121, 110, 7957 , 361, 152), // #1243
- INST(Vpbroadcastw , VexRm_Lx_Bcst , V(660F38,79,_,x,0,0,1,T1S), E(660F38,7B,_,x,0,0,0,T1S), 207, 111, 7970 , 362, 164), // #1244
- INST(Vpclmulqdq , VexRvmi_Lx , V(660F3A,44,_,x,I,_,4,FVM), 0 , 204, 0 , 7983 , 363, 166), // #1245
- INST(Vpcmov , VexRvrmRvmr_Lx , V(XOP_M8,A2,_,x,x,_,_,_ ), 0 , 208, 0 , 7994 , 289, 151), // #1246
- INST(Vpcmpb , VexRvmi_Lx , E(660F3A,3F,_,x,_,0,4,FVM), 0 , 111, 0 , 8001 , 364, 146), // #1247
- INST(Vpcmpd , VexRvmi_Lx , E(660F3A,1F,_,x,_,0,4,FV ), 0 , 111, 0 , 8008 , 365, 138), // #1248
- INST(Vpcmpeqb , VexRvm_Lx_KEvex , V(660F00,74,_,x,I,I,4,FV ), 0 , 144, 0 , 8015 , 366, 163), // #1249
- INST(Vpcmpeqd , VexRvm_Lx_KEvex , V(660F00,76,_,x,I,0,4,FVM), 0 , 144, 0 , 8024 , 367, 142), // #1250
- INST(Vpcmpeqq , VexRvm_Lx_KEvex , V(660F38,29,_,x,I,1,4,FVM), 0 , 209, 0 , 8033 , 368, 142), // #1251
- INST(Vpcmpeqw , VexRvm_Lx_KEvex , V(660F00,75,_,x,I,I,4,FV ), 0 , 144, 0 , 8042 , 366, 163), // #1252
- INST(Vpcmpestri , VexRmi , V(660F3A,61,_,0,I,_,_,_ ), 0 , 73 , 0 , 8051 , 369, 167), // #1253
- INST(Vpcmpestrm , VexRmi , V(660F3A,60,_,0,I,_,_,_ ), 0 , 73 , 0 , 8062 , 370, 167), // #1254
- INST(Vpcmpgtb , VexRvm_Lx_KEvex , V(660F00,64,_,x,I,I,4,FV ), 0 , 144, 0 , 8073 , 366, 163), // #1255
- INST(Vpcmpgtd , VexRvm_Lx_KEvex , V(660F00,66,_,x,I,0,4,FVM), 0 , 144, 0 , 8082 , 367, 142), // #1256
- INST(Vpcmpgtq , VexRvm_Lx_KEvex , V(660F38,37,_,x,I,1,4,FVM), 0 , 209, 0 , 8091 , 368, 142), // #1257
- INST(Vpcmpgtw , VexRvm_Lx_KEvex , V(660F00,65,_,x,I,I,4,FV ), 0 , 144, 0 , 8100 , 366, 163), // #1258
- INST(Vpcmpistri , VexRmi , V(660F3A,63,_,0,I,_,_,_ ), 0 , 73 , 0 , 8109 , 371, 167), // #1259
- INST(Vpcmpistrm , VexRmi , V(660F3A,62,_,0,I,_,_,_ ), 0 , 73 , 0 , 8120 , 372, 167), // #1260
- INST(Vpcmpq , VexRvmi_Lx , E(660F3A,1F,_,x,_,1,4,FV ), 0 , 112, 0 , 8131 , 373, 138), // #1261
- INST(Vpcmpub , VexRvmi_Lx , E(660F3A,3E,_,x,_,0,4,FVM), 0 , 111, 0 , 8138 , 364, 146), // #1262
- INST(Vpcmpud , VexRvmi_Lx , E(660F3A,1E,_,x,_,0,4,FV ), 0 , 111, 0 , 8146 , 365, 138), // #1263
- INST(Vpcmpuq , VexRvmi_Lx , E(660F3A,1E,_,x,_,1,4,FV ), 0 , 112, 0 , 8154 , 373, 138), // #1264
- INST(Vpcmpuw , VexRvmi_Lx , E(660F3A,3E,_,x,_,1,4,FVM), 0 , 112, 0 , 8162 , 373, 146), // #1265
- INST(Vpcmpw , VexRvmi_Lx , E(660F3A,3F,_,x,_,1,4,FVM), 0 , 112, 0 , 8170 , 373, 146), // #1266
- INST(Vpcomb , VexRvmi , V(XOP_M8,CC,_,0,0,_,_,_ ), 0 , 208, 0 , 8177 , 276, 151), // #1267
- INST(Vpcomd , VexRvmi , V(XOP_M8,CE,_,0,0,_,_,_ ), 0 , 208, 0 , 8184 , 276, 151), // #1268
- INST(Vpcompressb , VexMr_Lx , E(660F38,63,_,x,_,0,0,T1S), 0 , 210, 0 , 8191 , 232, 168), // #1269
- INST(Vpcompressd , VexMr_Lx , E(660F38,8B,_,x,_,0,2,T1S), 0 , 129, 0 , 8203 , 232, 138), // #1270
- INST(Vpcompressq , VexMr_Lx , E(660F38,8B,_,x,_,1,3,T1S), 0 , 128, 0 , 8215 , 232, 138), // #1271
- INST(Vpcompressw , VexMr_Lx , E(660F38,63,_,x,_,1,1,T1S), 0 , 211, 0 , 8227 , 232, 168), // #1272
- INST(Vpcomq , VexRvmi , V(XOP_M8,CF,_,0,0,_,_,_ ), 0 , 208, 0 , 8239 , 276, 151), // #1273
- INST(Vpcomub , VexRvmi , V(XOP_M8,EC,_,0,0,_,_,_ ), 0 , 208, 0 , 8246 , 276, 151), // #1274
- INST(Vpcomud , VexRvmi , V(XOP_M8,EE,_,0,0,_,_,_ ), 0 , 208, 0 , 8254 , 276, 151), // #1275
- INST(Vpcomuq , VexRvmi , V(XOP_M8,EF,_,0,0,_,_,_ ), 0 , 208, 0 , 8262 , 276, 151), // #1276
- INST(Vpcomuw , VexRvmi , V(XOP_M8,ED,_,0,0,_,_,_ ), 0 , 208, 0 , 8270 , 276, 151), // #1277
- INST(Vpcomw , VexRvmi , V(XOP_M8,CD,_,0,0,_,_,_ ), 0 , 208, 0 , 8278 , 276, 151), // #1278
- INST(Vpconflictd , VexRm_Lx , E(660F38,C4,_,x,_,0,4,FV ), 0 , 114, 0 , 8285 , 374, 165), // #1279
- INST(Vpconflictq , VexRm_Lx , E(660F38,C4,_,x,_,1,4,FV ), 0 , 113, 0 , 8297 , 374, 165), // #1280
- INST(Vpdpbusd , VexRvm_Lx , V(660F38,50,_,x,_,0,4,FV ), 0 , 110, 0 , 8309 , 375, 169), // #1281
- INST(Vpdpbusds , VexRvm_Lx , V(660F38,51,_,x,_,0,4,FV ), 0 , 110, 0 , 8318 , 375, 169), // #1282
- INST(Vpdpwssd , VexRvm_Lx , V(660F38,52,_,x,_,0,4,FV ), 0 , 110, 0 , 8328 , 375, 169), // #1283
- INST(Vpdpwssds , VexRvm_Lx , V(660F38,53,_,x,_,0,4,FV ), 0 , 110, 0 , 8337 , 375, 169), // #1284
- INST(Vperm2f128 , VexRvmi , V(660F3A,06,_,1,0,_,_,_ ), 0 , 172, 0 , 8347 , 376, 135), // #1285
- INST(Vperm2i128 , VexRvmi , V(660F3A,46,_,1,0,_,_,_ ), 0 , 172, 0 , 8358 , 376, 141), // #1286
- INST(Vpermb , VexRvm_Lx , E(660F38,8D,_,x,_,0,4,FVM), 0 , 114, 0 , 8369 , 357, 170), // #1287
- INST(Vpermd , VexRvm_Lx , V(660F38,36,_,x,0,0,4,FV ), 0 , 110, 0 , 8376 , 377, 152), // #1288
- INST(Vpermi2b , VexRvm_Lx , E(660F38,75,_,x,_,0,4,FVM), 0 , 114, 0 , 8383 , 357, 170), // #1289
- INST(Vpermi2d , VexRvm_Lx , E(660F38,76,_,x,_,0,4,FV ), 0 , 114, 0 , 8392 , 213, 138), // #1290
- INST(Vpermi2pd , VexRvm_Lx , E(660F38,77,_,x,_,1,4,FV ), 0 , 113, 0 , 8401 , 212, 138), // #1291
- INST(Vpermi2ps , VexRvm_Lx , E(660F38,77,_,x,_,0,4,FV ), 0 , 114, 0 , 8411 , 213, 138), // #1292
- INST(Vpermi2q , VexRvm_Lx , E(660F38,76,_,x,_,1,4,FV ), 0 , 113, 0 , 8421 , 212, 138), // #1293
- INST(Vpermi2w , VexRvm_Lx , E(660F38,75,_,x,_,1,4,FVM), 0 , 113, 0 , 8430 , 357, 146), // #1294
- INST(Vpermil2pd , VexRvrmiRvmri_Lx , V(660F3A,49,_,x,x,_,_,_ ), 0 , 73 , 0 , 8439 , 378, 151), // #1295
- INST(Vpermil2ps , VexRvrmiRvmri_Lx , V(660F3A,48,_,x,x,_,_,_ ), 0 , 73 , 0 , 8450 , 378, 151), // #1296
- INST(Vpermilpd , VexRvmRmi_Lx , V(660F38,0D,_,x,0,1,4,FV ), V(660F3A,05,_,x,0,1,4,FV ), 209, 112, 8461 , 379, 131), // #1297
- INST(Vpermilps , VexRvmRmi_Lx , V(660F38,0C,_,x,0,0,4,FV ), V(660F3A,04,_,x,0,0,4,FV ), 110, 113, 8471 , 380, 131), // #1298
- INST(Vpermpd , VexRvmRmi_Lx , E(660F38,16,_,x,1,1,4,FV ), V(660F3A,01,_,x,1,1,4,FV ), 212, 114, 8481 , 381, 152), // #1299
- INST(Vpermps , VexRvm_Lx , V(660F38,16,_,x,0,0,4,FV ), 0 , 110, 0 , 8489 , 377, 152), // #1300
- INST(Vpermq , VexRvmRmi_Lx , E(660F38,36,_,x,_,1,4,FV ), V(660F3A,00,_,x,1,1,4,FV ), 113, 115, 8497 , 381, 152), // #1301
- INST(Vpermt2b , VexRvm_Lx , E(660F38,7D,_,x,_,0,4,FVM), 0 , 114, 0 , 8504 , 357, 170), // #1302
- INST(Vpermt2d , VexRvm_Lx , E(660F38,7E,_,x,_,0,4,FV ), 0 , 114, 0 , 8513 , 213, 138), // #1303
- INST(Vpermt2pd , VexRvm_Lx , E(660F38,7F,_,x,_,1,4,FV ), 0 , 113, 0 , 8522 , 212, 138), // #1304
- INST(Vpermt2ps , VexRvm_Lx , E(660F38,7F,_,x,_,0,4,FV ), 0 , 114, 0 , 8532 , 213, 138), // #1305
- INST(Vpermt2q , VexRvm_Lx , E(660F38,7E,_,x,_,1,4,FV ), 0 , 113, 0 , 8542 , 212, 138), // #1306
- INST(Vpermt2w , VexRvm_Lx , E(660F38,7D,_,x,_,1,4,FVM), 0 , 113, 0 , 8551 , 357, 146), // #1307
- INST(Vpermw , VexRvm_Lx , E(660F38,8D,_,x,_,1,4,FVM), 0 , 113, 0 , 8560 , 357, 146), // #1308
- INST(Vpexpandb , VexRm_Lx , E(660F38,62,_,x,_,0,0,T1S), 0 , 210, 0 , 8567 , 279, 168), // #1309
- INST(Vpexpandd , VexRm_Lx , E(660F38,89,_,x,_,0,2,T1S), 0 , 129, 0 , 8577 , 279, 138), // #1310
- INST(Vpexpandq , VexRm_Lx , E(660F38,89,_,x,_,1,3,T1S), 0 , 128, 0 , 8587 , 279, 138), // #1311
- INST(Vpexpandw , VexRm_Lx , E(660F38,62,_,x,_,1,1,T1S), 0 , 211, 0 , 8597 , 279, 168), // #1312
- INST(Vpextrb , VexMri , V(660F3A,14,_,0,0,I,0,T1S), 0 , 73 , 0 , 8607 , 382, 171), // #1313
- INST(Vpextrd , VexMri , V(660F3A,16,_,0,0,0,2,T1S), 0 , 177, 0 , 8615 , 283, 172), // #1314
- INST(Vpextrq , VexMri , V(660F3A,16,_,0,1,1,3,T1S), 0 , 213, 0 , 8623 , 383, 172), // #1315
- INST(Vpextrw , VexMri_Vpextrw , V(660F3A,15,_,0,0,I,1,T1S), 0 , 214, 0 , 8631 , 384, 171), // #1316
- INST(Vpgatherdd , VexRmvRm_VM , V(660F38,90,_,x,0,_,_,_ ), E(660F38,90,_,x,_,0,2,T1S), 96 , 116, 8639 , 302, 152), // #1317
- INST(Vpgatherdq , VexRmvRm_VM , V(660F38,90,_,x,1,_,_,_ ), E(660F38,90,_,x,_,1,3,T1S), 189, 117, 8650 , 301, 152), // #1318
- INST(Vpgatherqd , VexRmvRm_VM , V(660F38,91,_,x,0,_,_,_ ), E(660F38,91,_,x,_,0,2,T1S), 96 , 118, 8661 , 307, 152), // #1319
- INST(Vpgatherqq , VexRmvRm_VM , V(660F38,91,_,x,1,_,_,_ ), E(660F38,91,_,x,_,1,3,T1S), 189, 119, 8672 , 306, 152), // #1320
- INST(Vphaddbd , VexRm , V(XOP_M9,C2,_,0,0,_,_,_ ), 0 , 79 , 0 , 8683 , 204, 151), // #1321
- INST(Vphaddbq , VexRm , V(XOP_M9,C3,_,0,0,_,_,_ ), 0 , 79 , 0 , 8692 , 204, 151), // #1322
- INST(Vphaddbw , VexRm , V(XOP_M9,C1,_,0,0,_,_,_ ), 0 , 79 , 0 , 8701 , 204, 151), // #1323
- INST(Vphaddd , VexRvm_Lx , V(660F38,02,_,x,I,_,_,_ ), 0 , 96 , 0 , 8710 , 202, 160), // #1324
- INST(Vphadddq , VexRm , V(XOP_M9,CB,_,0,0,_,_,_ ), 0 , 79 , 0 , 8718 , 204, 151), // #1325
- INST(Vphaddsw , VexRvm_Lx , V(660F38,03,_,x,I,_,_,_ ), 0 , 96 , 0 , 8727 , 202, 160), // #1326
- INST(Vphaddubd , VexRm , V(XOP_M9,D2,_,0,0,_,_,_ ), 0 , 79 , 0 , 8736 , 204, 151), // #1327
- INST(Vphaddubq , VexRm , V(XOP_M9,D3,_,0,0,_,_,_ ), 0 , 79 , 0 , 8746 , 204, 151), // #1328
- INST(Vphaddubw , VexRm , V(XOP_M9,D1,_,0,0,_,_,_ ), 0 , 79 , 0 , 8756 , 204, 151), // #1329
- INST(Vphaddudq , VexRm , V(XOP_M9,DB,_,0,0,_,_,_ ), 0 , 79 , 0 , 8766 , 204, 151), // #1330
- INST(Vphadduwd , VexRm , V(XOP_M9,D6,_,0,0,_,_,_ ), 0 , 79 , 0 , 8776 , 204, 151), // #1331
- INST(Vphadduwq , VexRm , V(XOP_M9,D7,_,0,0,_,_,_ ), 0 , 79 , 0 , 8786 , 204, 151), // #1332
- INST(Vphaddw , VexRvm_Lx , V(660F38,01,_,x,I,_,_,_ ), 0 , 96 , 0 , 8796 , 202, 160), // #1333
- INST(Vphaddwd , VexRm , V(XOP_M9,C6,_,0,0,_,_,_ ), 0 , 79 , 0 , 8804 , 204, 151), // #1334
- INST(Vphaddwq , VexRm , V(XOP_M9,C7,_,0,0,_,_,_ ), 0 , 79 , 0 , 8813 , 204, 151), // #1335
- INST(Vphminposuw , VexRm , V(660F38,41,_,0,I,_,_,_ ), 0 , 96 , 0 , 8822 , 204, 135), // #1336
- INST(Vphsubbw , VexRm , V(XOP_M9,E1,_,0,0,_,_,_ ), 0 , 79 , 0 , 8834 , 204, 151), // #1337
- INST(Vphsubd , VexRvm_Lx , V(660F38,06,_,x,I,_,_,_ ), 0 , 96 , 0 , 8843 , 202, 160), // #1338
- INST(Vphsubdq , VexRm , V(XOP_M9,E3,_,0,0,_,_,_ ), 0 , 79 , 0 , 8851 , 204, 151), // #1339
- INST(Vphsubsw , VexRvm_Lx , V(660F38,07,_,x,I,_,_,_ ), 0 , 96 , 0 , 8860 , 202, 160), // #1340
- INST(Vphsubw , VexRvm_Lx , V(660F38,05,_,x,I,_,_,_ ), 0 , 96 , 0 , 8869 , 202, 160), // #1341
- INST(Vphsubwd , VexRm , V(XOP_M9,E2,_,0,0,_,_,_ ), 0 , 79 , 0 , 8877 , 204, 151), // #1342
- INST(Vpinsrb , VexRvmi , V(660F3A,20,_,0,0,I,0,T1S), 0 , 73 , 0 , 8886 , 385, 171), // #1343
- INST(Vpinsrd , VexRvmi , V(660F3A,22,_,0,0,0,2,T1S), 0 , 177, 0 , 8894 , 386, 172), // #1344
- INST(Vpinsrq , VexRvmi , V(660F3A,22,_,0,1,1,3,T1S), 0 , 213, 0 , 8902 , 387, 172), // #1345
- INST(Vpinsrw , VexRvmi , V(660F00,C4,_,0,0,I,1,T1S), 0 , 215, 0 , 8910 , 388, 171), // #1346
- INST(Vplzcntd , VexRm_Lx , E(660F38,44,_,x,_,0,4,FV ), 0 , 114, 0 , 8918 , 374, 165), // #1347
- INST(Vplzcntq , VexRm_Lx , E(660F38,44,_,x,_,1,4,FV ), 0 , 113, 0 , 8927 , 350, 165), // #1348
- INST(Vpmacsdd , VexRvmr , V(XOP_M8,9E,_,0,0,_,_,_ ), 0 , 208, 0 , 8936 , 389, 151), // #1349
- INST(Vpmacsdqh , VexRvmr , V(XOP_M8,9F,_,0,0,_,_,_ ), 0 , 208, 0 , 8945 , 389, 151), // #1350
- INST(Vpmacsdql , VexRvmr , V(XOP_M8,97,_,0,0,_,_,_ ), 0 , 208, 0 , 8955 , 389, 151), // #1351
- INST(Vpmacssdd , VexRvmr , V(XOP_M8,8E,_,0,0,_,_,_ ), 0 , 208, 0 , 8965 , 389, 151), // #1352
- INST(Vpmacssdqh , VexRvmr , V(XOP_M8,8F,_,0,0,_,_,_ ), 0 , 208, 0 , 8975 , 389, 151), // #1353
- INST(Vpmacssdql , VexRvmr , V(XOP_M8,87,_,0,0,_,_,_ ), 0 , 208, 0 , 8986 , 389, 151), // #1354
- INST(Vpmacsswd , VexRvmr , V(XOP_M8,86,_,0,0,_,_,_ ), 0 , 208, 0 , 8997 , 389, 151), // #1355
- INST(Vpmacssww , VexRvmr , V(XOP_M8,85,_,0,0,_,_,_ ), 0 , 208, 0 , 9007 , 389, 151), // #1356
- INST(Vpmacswd , VexRvmr , V(XOP_M8,96,_,0,0,_,_,_ ), 0 , 208, 0 , 9017 , 389, 151), // #1357
- INST(Vpmacsww , VexRvmr , V(XOP_M8,95,_,0,0,_,_,_ ), 0 , 208, 0 , 9026 , 389, 151), // #1358
- INST(Vpmadcsswd , VexRvmr , V(XOP_M8,A6,_,0,0,_,_,_ ), 0 , 208, 0 , 9035 , 389, 151), // #1359
- INST(Vpmadcswd , VexRvmr , V(XOP_M8,B6,_,0,0,_,_,_ ), 0 , 208, 0 , 9046 , 389, 151), // #1360
- INST(Vpmadd52huq , VexRvm_Lx , E(660F38,B5,_,x,_,1,4,FV ), 0 , 113, 0 , 9056 , 212, 173), // #1361
- INST(Vpmadd52luq , VexRvm_Lx , E(660F38,B4,_,x,_,1,4,FV ), 0 , 113, 0 , 9068 , 212, 173), // #1362
- INST(Vpmaddubsw , VexRvm_Lx , V(660F38,04,_,x,I,I,4,FVM), 0 , 110, 0 , 9080 , 315, 163), // #1363
- INST(Vpmaddwd , VexRvm_Lx , V(660F00,F5,_,x,I,I,4,FVM), 0 , 144, 0 , 9091 , 315, 163), // #1364
- INST(Vpmaskmovd , VexRvmMvr_Lx , V(660F38,8C,_,x,0,_,_,_ ), V(660F38,8E,_,x,0,_,_,_ ), 96 , 120, 9100 , 323, 141), // #1365
- INST(Vpmaskmovq , VexRvmMvr_Lx , V(660F38,8C,_,x,1,_,_,_ ), V(660F38,8E,_,x,1,_,_,_ ), 189, 121, 9111 , 323, 141), // #1366
- INST(Vpmaxsb , VexRvm_Lx , V(660F38,3C,_,x,I,I,4,FVM), 0 , 110, 0 , 9122 , 390, 163), // #1367
- INST(Vpmaxsd , VexRvm_Lx , V(660F38,3D,_,x,I,0,4,FV ), 0 , 110, 0 , 9130 , 211, 142), // #1368
- INST(Vpmaxsq , VexRvm_Lx , E(660F38,3D,_,x,_,1,4,FV ), 0 , 113, 0 , 9138 , 212, 138), // #1369
- INST(Vpmaxsw , VexRvm_Lx , V(660F00,EE,_,x,I,I,4,FVM), 0 , 144, 0 , 9146 , 390, 163), // #1370
- INST(Vpmaxub , VexRvm_Lx , V(660F00,DE,_,x,I,I,4,FVM), 0 , 144, 0 , 9154 , 390, 163), // #1371
- INST(Vpmaxud , VexRvm_Lx , V(660F38,3F,_,x,I,0,4,FV ), 0 , 110, 0 , 9162 , 211, 142), // #1372
- INST(Vpmaxuq , VexRvm_Lx , E(660F38,3F,_,x,_,1,4,FV ), 0 , 113, 0 , 9170 , 212, 138), // #1373
- INST(Vpmaxuw , VexRvm_Lx , V(660F38,3E,_,x,I,I,4,FVM), 0 , 110, 0 , 9178 , 390, 163), // #1374
- INST(Vpminsb , VexRvm_Lx , V(660F38,38,_,x,I,I,4,FVM), 0 , 110, 0 , 9186 , 390, 163), // #1375
- INST(Vpminsd , VexRvm_Lx , V(660F38,39,_,x,I,0,4,FV ), 0 , 110, 0 , 9194 , 211, 142), // #1376
- INST(Vpminsq , VexRvm_Lx , E(660F38,39,_,x,_,1,4,FV ), 0 , 113, 0 , 9202 , 212, 138), // #1377
- INST(Vpminsw , VexRvm_Lx , V(660F00,EA,_,x,I,I,4,FVM), 0 , 144, 0 , 9210 , 390, 163), // #1378
- INST(Vpminub , VexRvm_Lx , V(660F00,DA,_,x,I,_,4,FVM), 0 , 144, 0 , 9218 , 390, 163), // #1379
- INST(Vpminud , VexRvm_Lx , V(660F38,3B,_,x,I,0,4,FV ), 0 , 110, 0 , 9226 , 211, 142), // #1380
- INST(Vpminuq , VexRvm_Lx , E(660F38,3B,_,x,_,1,4,FV ), 0 , 113, 0 , 9234 , 212, 138), // #1381
- INST(Vpminuw , VexRvm_Lx , V(660F38,3A,_,x,I,_,4,FVM), 0 , 110, 0 , 9242 , 390, 163), // #1382
- INST(Vpmovb2m , VexRm_Lx , E(F30F38,29,_,x,_,0,_,_ ), 0 , 206, 0 , 9250 , 391, 146), // #1383
- INST(Vpmovd2m , VexRm_Lx , E(F30F38,39,_,x,_,0,_,_ ), 0 , 206, 0 , 9259 , 391, 140), // #1384
- INST(Vpmovdb , VexMr_Lx , E(F30F38,31,_,x,_,0,2,QVM), 0 , 216, 0 , 9268 , 392, 138), // #1385
- INST(Vpmovdw , VexMr_Lx , E(F30F38,33,_,x,_,0,3,HVM), 0 , 217, 0 , 9276 , 393, 138), // #1386
- INST(Vpmovm2b , VexRm_Lx , E(F30F38,28,_,x,_,0,_,_ ), 0 , 206, 0 , 9284 , 360, 146), // #1387
- INST(Vpmovm2d , VexRm_Lx , E(F30F38,38,_,x,_,0,_,_ ), 0 , 206, 0 , 9293 , 360, 140), // #1388
- INST(Vpmovm2q , VexRm_Lx , E(F30F38,38,_,x,_,1,_,_ ), 0 , 205, 0 , 9302 , 360, 140), // #1389
- INST(Vpmovm2w , VexRm_Lx , E(F30F38,28,_,x,_,1,_,_ ), 0 , 205, 0 , 9311 , 360, 146), // #1390
- INST(Vpmovmskb , VexRm_Lx , V(660F00,D7,_,x,I,_,_,_ ), 0 , 69 , 0 , 9320 , 336, 160), // #1391
- INST(Vpmovq2m , VexRm_Lx , E(F30F38,39,_,x,_,1,_,_ ), 0 , 205, 0 , 9330 , 391, 140), // #1392
- INST(Vpmovqb , VexMr_Lx , E(F30F38,32,_,x,_,0,1,OVM), 0 , 218, 0 , 9339 , 394, 138), // #1393
- INST(Vpmovqd , VexMr_Lx , E(F30F38,35,_,x,_,0,3,HVM), 0 , 217, 0 , 9347 , 393, 138), // #1394
- INST(Vpmovqw , VexMr_Lx , E(F30F38,34,_,x,_,0,2,QVM), 0 , 216, 0 , 9355 , 392, 138), // #1395
- INST(Vpmovsdb , VexMr_Lx , E(F30F38,21,_,x,_,0,2,QVM), 0 , 216, 0 , 9363 , 392, 138), // #1396
- INST(Vpmovsdw , VexMr_Lx , E(F30F38,23,_,x,_,0,3,HVM), 0 , 217, 0 , 9372 , 393, 138), // #1397
- INST(Vpmovsqb , VexMr_Lx , E(F30F38,22,_,x,_,0,1,OVM), 0 , 218, 0 , 9381 , 394, 138), // #1398
- INST(Vpmovsqd , VexMr_Lx , E(F30F38,25,_,x,_,0,3,HVM), 0 , 217, 0 , 9390 , 393, 138), // #1399
- INST(Vpmovsqw , VexMr_Lx , E(F30F38,24,_,x,_,0,2,QVM), 0 , 216, 0 , 9399 , 392, 138), // #1400
- INST(Vpmovswb , VexMr_Lx , E(F30F38,20,_,x,_,0,3,HVM), 0 , 217, 0 , 9408 , 393, 146), // #1401
- INST(Vpmovsxbd , VexRm_Lx , V(660F38,21,_,x,I,I,2,QVM), 0 , 219, 0 , 9417 , 395, 142), // #1402
- INST(Vpmovsxbq , VexRm_Lx , V(660F38,22,_,x,I,I,1,OVM), 0 , 220, 0 , 9427 , 396, 142), // #1403
- INST(Vpmovsxbw , VexRm_Lx , V(660F38,20,_,x,I,I,3,HVM), 0 , 139, 0 , 9437 , 397, 163), // #1404
- INST(Vpmovsxdq , VexRm_Lx , V(660F38,25,_,x,I,0,3,HVM), 0 , 139, 0 , 9447 , 397, 142), // #1405
- INST(Vpmovsxwd , VexRm_Lx , V(660F38,23,_,x,I,I,3,HVM), 0 , 139, 0 , 9457 , 397, 142), // #1406
- INST(Vpmovsxwq , VexRm_Lx , V(660F38,24,_,x,I,I,2,QVM), 0 , 219, 0 , 9467 , 395, 142), // #1407
- INST(Vpmovusdb , VexMr_Lx , E(F30F38,11,_,x,_,0,2,QVM), 0 , 216, 0 , 9477 , 392, 138), // #1408
- INST(Vpmovusdw , VexMr_Lx , E(F30F38,13,_,x,_,0,3,HVM), 0 , 217, 0 , 9487 , 393, 138), // #1409
- INST(Vpmovusqb , VexMr_Lx , E(F30F38,12,_,x,_,0,1,OVM), 0 , 218, 0 , 9497 , 394, 138), // #1410
- INST(Vpmovusqd , VexMr_Lx , E(F30F38,15,_,x,_,0,3,HVM), 0 , 217, 0 , 9507 , 393, 138), // #1411
- INST(Vpmovusqw , VexMr_Lx , E(F30F38,14,_,x,_,0,2,QVM), 0 , 216, 0 , 9517 , 392, 138), // #1412
- INST(Vpmovuswb , VexMr_Lx , E(F30F38,10,_,x,_,0,3,HVM), 0 , 217, 0 , 9527 , 393, 146), // #1413
- INST(Vpmovw2m , VexRm_Lx , E(F30F38,29,_,x,_,1,_,_ ), 0 , 205, 0 , 9537 , 391, 146), // #1414
- INST(Vpmovwb , VexMr_Lx , E(F30F38,30,_,x,_,0,3,HVM), 0 , 217, 0 , 9546 , 393, 146), // #1415
- INST(Vpmovzxbd , VexRm_Lx , V(660F38,31,_,x,I,I,2,QVM), 0 , 219, 0 , 9554 , 395, 142), // #1416
- INST(Vpmovzxbq , VexRm_Lx , V(660F38,32,_,x,I,I,1,OVM), 0 , 220, 0 , 9564 , 396, 142), // #1417
- INST(Vpmovzxbw , VexRm_Lx , V(660F38,30,_,x,I,I,3,HVM), 0 , 139, 0 , 9574 , 397, 163), // #1418
- INST(Vpmovzxdq , VexRm_Lx , V(660F38,35,_,x,I,0,3,HVM), 0 , 139, 0 , 9584 , 397, 142), // #1419
- INST(Vpmovzxwd , VexRm_Lx , V(660F38,33,_,x,I,I,3,HVM), 0 , 139, 0 , 9594 , 397, 142), // #1420
- INST(Vpmovzxwq , VexRm_Lx , V(660F38,34,_,x,I,I,2,QVM), 0 , 219, 0 , 9604 , 395, 142), // #1421
- INST(Vpmuldq , VexRvm_Lx , V(660F38,28,_,x,I,1,4,FV ), 0 , 209, 0 , 9614 , 208, 142), // #1422
- INST(Vpmulhrsw , VexRvm_Lx , V(660F38,0B,_,x,I,I,4,FVM), 0 , 110, 0 , 9622 , 315, 163), // #1423
- INST(Vpmulhuw , VexRvm_Lx , V(660F00,E4,_,x,I,I,4,FVM), 0 , 144, 0 , 9632 , 315, 163), // #1424
- INST(Vpmulhw , VexRvm_Lx , V(660F00,E5,_,x,I,I,4,FVM), 0 , 144, 0 , 9641 , 315, 163), // #1425
- INST(Vpmulld , VexRvm_Lx , V(660F38,40,_,x,I,0,4,FV ), 0 , 110, 0 , 9649 , 209, 142), // #1426
- INST(Vpmullq , VexRvm_Lx , E(660F38,40,_,x,_,1,4,FV ), 0 , 113, 0 , 9657 , 212, 140), // #1427
- INST(Vpmullw , VexRvm_Lx , V(660F00,D5,_,x,I,I,4,FVM), 0 , 144, 0 , 9665 , 315, 163), // #1428
- INST(Vpmultishiftqb , VexRvm_Lx , E(660F38,83,_,x,_,1,4,FV ), 0 , 113, 0 , 9673 , 212, 170), // #1429
- INST(Vpmuludq , VexRvm_Lx , V(660F00,F4,_,x,I,1,4,FV ), 0 , 103, 0 , 9688 , 208, 142), // #1430
- INST(Vpopcntb , VexRm_Lx , E(660F38,54,_,x,_,0,4,FV ), 0 , 114, 0 , 9697 , 279, 174), // #1431
- INST(Vpopcntd , VexRm_Lx , E(660F38,55,_,x,_,0,4,FVM), 0 , 114, 0 , 9706 , 374, 175), // #1432
- INST(Vpopcntq , VexRm_Lx , E(660F38,55,_,x,_,1,4,FVM), 0 , 113, 0 , 9715 , 350, 175), // #1433
- INST(Vpopcntw , VexRm_Lx , E(660F38,54,_,x,_,1,4,FV ), 0 , 113, 0 , 9724 , 279, 174), // #1434
- INST(Vpor , VexRvm_Lx , V(660F00,EB,_,x,I,_,_,_ ), 0 , 69 , 0 , 9733 , 351, 160), // #1435
- INST(Vpord , VexRvm_Lx , E(660F00,EB,_,x,_,0,4,FV ), 0 , 198, 0 , 9738 , 352, 138), // #1436
- INST(Vporq , VexRvm_Lx , E(660F00,EB,_,x,_,1,4,FV ), 0 , 135, 0 , 9744 , 356, 138), // #1437
- INST(Vpperm , VexRvrmRvmr , V(XOP_M8,A3,_,0,x,_,_,_ ), 0 , 208, 0 , 9750 , 398, 151), // #1438
- INST(Vprold , VexVmi_Lx , E(660F00,72,1,x,_,0,4,FV ), 0 , 221, 0 , 9757 , 399, 138), // #1439
- INST(Vprolq , VexVmi_Lx , E(660F00,72,1,x,_,1,4,FV ), 0 , 222, 0 , 9764 , 400, 138), // #1440
- INST(Vprolvd , VexRvm_Lx , E(660F38,15,_,x,_,0,4,FV ), 0 , 114, 0 , 9771 , 213, 138), // #1441
- INST(Vprolvq , VexRvm_Lx , E(660F38,15,_,x,_,1,4,FV ), 0 , 113, 0 , 9779 , 212, 138), // #1442
- INST(Vprord , VexVmi_Lx , E(660F00,72,0,x,_,0,4,FV ), 0 , 198, 0 , 9787 , 399, 138), // #1443
- INST(Vprorq , VexVmi_Lx , E(660F00,72,0,x,_,1,4,FV ), 0 , 135, 0 , 9794 , 400, 138), // #1444
- INST(Vprorvd , VexRvm_Lx , E(660F38,14,_,x,_,0,4,FV ), 0 , 114, 0 , 9801 , 213, 138), // #1445
- INST(Vprorvq , VexRvm_Lx , E(660F38,14,_,x,_,1,4,FV ), 0 , 113, 0 , 9809 , 212, 138), // #1446
- INST(Vprotb , VexRvmRmvRmi , V(XOP_M9,90,_,0,x,_,_,_ ), V(XOP_M8,C0,_,0,x,_,_,_ ), 79 , 122, 9817 , 401, 151), // #1447
- INST(Vprotd , VexRvmRmvRmi , V(XOP_M9,92,_,0,x,_,_,_ ), V(XOP_M8,C2,_,0,x,_,_,_ ), 79 , 123, 9824 , 401, 151), // #1448
- INST(Vprotq , VexRvmRmvRmi , V(XOP_M9,93,_,0,x,_,_,_ ), V(XOP_M8,C3,_,0,x,_,_,_ ), 79 , 124, 9831 , 401, 151), // #1449
- INST(Vprotw , VexRvmRmvRmi , V(XOP_M9,91,_,0,x,_,_,_ ), V(XOP_M8,C1,_,0,x,_,_,_ ), 79 , 125, 9838 , 401, 151), // #1450
- INST(Vpsadbw , VexRvm_Lx , V(660F00,F6,_,x,I,I,4,FVM), 0 , 144, 0 , 9845 , 203, 163), // #1451
- INST(Vpscatterdd , VexMr_VM , E(660F38,A0,_,x,_,0,2,T1S), 0 , 129, 0 , 9853 , 402, 138), // #1452
- INST(Vpscatterdq , VexMr_VM , E(660F38,A0,_,x,_,1,3,T1S), 0 , 128, 0 , 9865 , 403, 138), // #1453
- INST(Vpscatterqd , VexMr_VM , E(660F38,A1,_,x,_,0,2,T1S), 0 , 129, 0 , 9877 , 404, 138), // #1454
- INST(Vpscatterqq , VexMr_VM , E(660F38,A1,_,x,_,1,3,T1S), 0 , 128, 0 , 9889 , 405, 138), // #1455
- INST(Vpshab , VexRvmRmv , V(XOP_M9,98,_,0,x,_,_,_ ), 0 , 79 , 0 , 9901 , 406, 151), // #1456
- INST(Vpshad , VexRvmRmv , V(XOP_M9,9A,_,0,x,_,_,_ ), 0 , 79 , 0 , 9908 , 406, 151), // #1457
- INST(Vpshaq , VexRvmRmv , V(XOP_M9,9B,_,0,x,_,_,_ ), 0 , 79 , 0 , 9915 , 406, 151), // #1458
- INST(Vpshaw , VexRvmRmv , V(XOP_M9,99,_,0,x,_,_,_ ), 0 , 79 , 0 , 9922 , 406, 151), // #1459
- INST(Vpshlb , VexRvmRmv , V(XOP_M9,94,_,0,x,_,_,_ ), 0 , 79 , 0 , 9929 , 406, 151), // #1460
- INST(Vpshld , VexRvmRmv , V(XOP_M9,96,_,0,x,_,_,_ ), 0 , 79 , 0 , 9936 , 406, 151), // #1461
- INST(Vpshldd , VexRvmi_Lx , E(660F3A,71,_,x,_,0,4,FV ), 0 , 111, 0 , 9943 , 206, 168), // #1462
- INST(Vpshldq , VexRvmi_Lx , E(660F3A,71,_,x,_,1,4,FV ), 0 , 112, 0 , 9951 , 207, 168), // #1463
- INST(Vpshldvd , VexRvm_Lx , E(660F38,71,_,x,_,0,4,FV ), 0 , 114, 0 , 9959 , 213, 168), // #1464
- INST(Vpshldvq , VexRvm_Lx , E(660F38,71,_,x,_,1,4,FV ), 0 , 113, 0 , 9968 , 212, 168), // #1465
- INST(Vpshldvw , VexRvm_Lx , E(660F38,70,_,x,_,1,4,FVM), 0 , 113, 0 , 9977 , 357, 168), // #1466
- INST(Vpshldw , VexRvmi_Lx , E(660F3A,70,_,x,_,1,4,FVM), 0 , 112, 0 , 9986 , 275, 168), // #1467
- INST(Vpshlq , VexRvmRmv , V(XOP_M9,97,_,0,x,_,_,_ ), 0 , 79 , 0 , 9994 , 406, 151), // #1468
- INST(Vpshlw , VexRvmRmv , V(XOP_M9,95,_,0,x,_,_,_ ), 0 , 79 , 0 , 10001, 406, 151), // #1469
- INST(Vpshrdd , VexRvmi_Lx , E(660F3A,73,_,x,_,0,4,FV ), 0 , 111, 0 , 10008, 206, 168), // #1470
- INST(Vpshrdq , VexRvmi_Lx , E(660F3A,73,_,x,_,1,4,FV ), 0 , 112, 0 , 10016, 207, 168), // #1471
- INST(Vpshrdvd , VexRvm_Lx , E(660F38,73,_,x,_,0,4,FV ), 0 , 114, 0 , 10024, 213, 168), // #1472
- INST(Vpshrdvq , VexRvm_Lx , E(660F38,73,_,x,_,1,4,FV ), 0 , 113, 0 , 10033, 212, 168), // #1473
- INST(Vpshrdvw , VexRvm_Lx , E(660F38,72,_,x,_,1,4,FVM), 0 , 113, 0 , 10042, 357, 168), // #1474
- INST(Vpshrdw , VexRvmi_Lx , E(660F3A,72,_,x,_,1,4,FVM), 0 , 112, 0 , 10051, 275, 168), // #1475
- INST(Vpshufb , VexRvm_Lx , V(660F38,00,_,x,I,I,4,FVM), 0 , 110, 0 , 10059, 315, 163), // #1476
- INST(Vpshufbitqmb , VexRvm_Lx , E(660F38,8F,_,x,0,0,4,FVM), 0 , 114, 0 , 10067, 407, 174), // #1477
- INST(Vpshufd , VexRmi_Lx , V(660F00,70,_,x,I,0,4,FV ), 0 , 144, 0 , 10080, 408, 142), // #1478
- INST(Vpshufhw , VexRmi_Lx , V(F30F00,70,_,x,I,I,4,FVM), 0 , 161, 0 , 10088, 409, 163), // #1479
- INST(Vpshuflw , VexRmi_Lx , V(F20F00,70,_,x,I,I,4,FVM), 0 , 223, 0 , 10097, 409, 163), // #1480
- INST(Vpsignb , VexRvm_Lx , V(660F38,08,_,x,I,_,_,_ ), 0 , 96 , 0 , 10106, 202, 160), // #1481
- INST(Vpsignd , VexRvm_Lx , V(660F38,0A,_,x,I,_,_,_ ), 0 , 96 , 0 , 10114, 202, 160), // #1482
- INST(Vpsignw , VexRvm_Lx , V(660F38,09,_,x,I,_,_,_ ), 0 , 96 , 0 , 10122, 202, 160), // #1483
- INST(Vpslld , VexRvmVmi_Lx_MEvex , V(660F00,F2,_,x,I,0,4,128), V(660F00,72,6,x,I,0,4,FV ), 224, 126, 10130, 410, 142), // #1484
- INST(Vpslldq , VexVmi_Lx_MEvex , V(660F00,73,7,x,I,I,4,FVM), 0 , 225, 0 , 10137, 411, 163), // #1485
- INST(Vpsllq , VexRvmVmi_Lx_MEvex , V(660F00,F3,_,x,I,1,4,128), V(660F00,73,6,x,I,1,4,FV ), 226, 127, 10145, 412, 142), // #1486
- INST(Vpsllvd , VexRvm_Lx , V(660F38,47,_,x,0,0,4,FV ), 0 , 110, 0 , 10152, 209, 152), // #1487
- INST(Vpsllvq , VexRvm_Lx , V(660F38,47,_,x,1,1,4,FV ), 0 , 182, 0 , 10160, 208, 152), // #1488
- INST(Vpsllvw , VexRvm_Lx , E(660F38,12,_,x,_,1,4,FVM), 0 , 113, 0 , 10168, 357, 146), // #1489
- INST(Vpsllw , VexRvmVmi_Lx_MEvex , V(660F00,F1,_,x,I,I,4,128), V(660F00,71,6,x,I,I,4,FVM), 224, 128, 10176, 413, 163), // #1490
- INST(Vpsrad , VexRvmVmi_Lx_MEvex , V(660F00,E2,_,x,I,0,4,128), V(660F00,72,4,x,I,0,4,FV ), 224, 129, 10183, 410, 142), // #1491
- INST(Vpsraq , VexRvmVmi_Lx_MEvex , E(660F00,E2,_,x,_,1,4,128), E(660F00,72,4,x,_,1,4,FV ), 227, 130, 10190, 414, 138), // #1492
- INST(Vpsravd , VexRvm_Lx , V(660F38,46,_,x,0,0,4,FV ), 0 , 110, 0 , 10197, 209, 152), // #1493
- INST(Vpsravq , VexRvm_Lx , E(660F38,46,_,x,_,1,4,FV ), 0 , 113, 0 , 10205, 212, 138), // #1494
- INST(Vpsravw , VexRvm_Lx , E(660F38,11,_,x,_,1,4,FVM), 0 , 113, 0 , 10213, 357, 146), // #1495
- INST(Vpsraw , VexRvmVmi_Lx_MEvex , V(660F00,E1,_,x,I,I,4,128), V(660F00,71,4,x,I,I,4,FVM), 224, 131, 10221, 413, 163), // #1496
- INST(Vpsrld , VexRvmVmi_Lx_MEvex , V(660F00,D2,_,x,I,0,4,128), V(660F00,72,2,x,I,0,4,FV ), 224, 132, 10228, 410, 142), // #1497
- INST(Vpsrldq , VexVmi_Lx_MEvex , V(660F00,73,3,x,I,I,4,FVM), 0 , 228, 0 , 10235, 411, 163), // #1498
- INST(Vpsrlq , VexRvmVmi_Lx_MEvex , V(660F00,D3,_,x,I,1,4,128), V(660F00,73,2,x,I,1,4,FV ), 226, 133, 10243, 412, 142), // #1499
- INST(Vpsrlvd , VexRvm_Lx , V(660F38,45,_,x,0,0,4,FV ), 0 , 110, 0 , 10250, 209, 152), // #1500
- INST(Vpsrlvq , VexRvm_Lx , V(660F38,45,_,x,1,1,4,FV ), 0 , 182, 0 , 10258, 208, 152), // #1501
- INST(Vpsrlvw , VexRvm_Lx , E(660F38,10,_,x,_,1,4,FVM), 0 , 113, 0 , 10266, 357, 146), // #1502
- INST(Vpsrlw , VexRvmVmi_Lx_MEvex , V(660F00,D1,_,x,I,I,4,128), V(660F00,71,2,x,I,I,4,FVM), 224, 134, 10274, 413, 163), // #1503
- INST(Vpsubb , VexRvm_Lx , V(660F00,F8,_,x,I,I,4,FVM), 0 , 144, 0 , 10281, 415, 163), // #1504
- INST(Vpsubd , VexRvm_Lx , V(660F00,FA,_,x,I,0,4,FV ), 0 , 144, 0 , 10288, 416, 142), // #1505
- INST(Vpsubq , VexRvm_Lx , V(660F00,FB,_,x,I,1,4,FV ), 0 , 103, 0 , 10295, 417, 142), // #1506
- INST(Vpsubsb , VexRvm_Lx , V(660F00,E8,_,x,I,I,4,FVM), 0 , 144, 0 , 10302, 415, 163), // #1507
- INST(Vpsubsw , VexRvm_Lx , V(660F00,E9,_,x,I,I,4,FVM), 0 , 144, 0 , 10310, 415, 163), // #1508
- INST(Vpsubusb , VexRvm_Lx , V(660F00,D8,_,x,I,I,4,FVM), 0 , 144, 0 , 10318, 415, 163), // #1509
- INST(Vpsubusw , VexRvm_Lx , V(660F00,D9,_,x,I,I,4,FVM), 0 , 144, 0 , 10327, 415, 163), // #1510
- INST(Vpsubw , VexRvm_Lx , V(660F00,F9,_,x,I,I,4,FVM), 0 , 144, 0 , 10336, 415, 163), // #1511
- INST(Vpternlogd , VexRvmi_Lx , E(660F3A,25,_,x,_,0,4,FV ), 0 , 111, 0 , 10343, 206, 138), // #1512
- INST(Vpternlogq , VexRvmi_Lx , E(660F3A,25,_,x,_,1,4,FV ), 0 , 112, 0 , 10354, 207, 138), // #1513
- INST(Vptest , VexRm_Lx , V(660F38,17,_,x,I,_,_,_ ), 0 , 96 , 0 , 10365, 298, 167), // #1514
- INST(Vptestmb , VexRvm_Lx , E(660F38,26,_,x,_,0,4,FVM), 0 , 114, 0 , 10372, 407, 146), // #1515
- INST(Vptestmd , VexRvm_Lx , E(660F38,27,_,x,_,0,4,FV ), 0 , 114, 0 , 10381, 418, 138), // #1516
- INST(Vptestmq , VexRvm_Lx , E(660F38,27,_,x,_,1,4,FV ), 0 , 113, 0 , 10390, 419, 138), // #1517
- INST(Vptestmw , VexRvm_Lx , E(660F38,26,_,x,_,1,4,FVM), 0 , 113, 0 , 10399, 407, 146), // #1518
- INST(Vptestnmb , VexRvm_Lx , E(F30F38,26,_,x,_,0,4,FVM), 0 , 132, 0 , 10408, 407, 146), // #1519
- INST(Vptestnmd , VexRvm_Lx , E(F30F38,27,_,x,_,0,4,FV ), 0 , 132, 0 , 10418, 418, 138), // #1520
- INST(Vptestnmq , VexRvm_Lx , E(F30F38,27,_,x,_,1,4,FV ), 0 , 229, 0 , 10428, 419, 138), // #1521
- INST(Vptestnmw , VexRvm_Lx , E(F30F38,26,_,x,_,1,4,FVM), 0 , 229, 0 , 10438, 407, 146), // #1522
- INST(Vpunpckhbw , VexRvm_Lx , V(660F00,68,_,x,I,I,4,FVM), 0 , 144, 0 , 10448, 315, 163), // #1523
- INST(Vpunpckhdq , VexRvm_Lx , V(660F00,6A,_,x,I,0,4,FV ), 0 , 144, 0 , 10459, 209, 142), // #1524
- INST(Vpunpckhqdq , VexRvm_Lx , V(660F00,6D,_,x,I,1,4,FV ), 0 , 103, 0 , 10470, 208, 142), // #1525
- INST(Vpunpckhwd , VexRvm_Lx , V(660F00,69,_,x,I,I,4,FVM), 0 , 144, 0 , 10482, 315, 163), // #1526
- INST(Vpunpcklbw , VexRvm_Lx , V(660F00,60,_,x,I,I,4,FVM), 0 , 144, 0 , 10493, 315, 163), // #1527
- INST(Vpunpckldq , VexRvm_Lx , V(660F00,62,_,x,I,0,4,FV ), 0 , 144, 0 , 10504, 209, 142), // #1528
- INST(Vpunpcklqdq , VexRvm_Lx , V(660F00,6C,_,x,I,1,4,FV ), 0 , 103, 0 , 10515, 208, 142), // #1529
- INST(Vpunpcklwd , VexRvm_Lx , V(660F00,61,_,x,I,I,4,FVM), 0 , 144, 0 , 10527, 315, 163), // #1530
- INST(Vpxor , VexRvm_Lx , V(660F00,EF,_,x,I,_,_,_ ), 0 , 69 , 0 , 10538, 353, 160), // #1531
- INST(Vpxord , VexRvm_Lx , E(660F00,EF,_,x,_,0,4,FV ), 0 , 198, 0 , 10544, 354, 138), // #1532
- INST(Vpxorq , VexRvm_Lx , E(660F00,EF,_,x,_,1,4,FV ), 0 , 135, 0 , 10551, 355, 138), // #1533
- INST(Vrangepd , VexRvmi_Lx , E(660F3A,50,_,x,_,1,4,FV ), 0 , 112, 0 , 10558, 285, 140), // #1534
- INST(Vrangeps , VexRvmi_Lx , E(660F3A,50,_,x,_,0,4,FV ), 0 , 111, 0 , 10567, 286, 140), // #1535
- INST(Vrangesd , VexRvmi , E(660F3A,51,_,I,_,1,3,T1S), 0 , 180, 0 , 10576, 287, 66 ), // #1536
- INST(Vrangess , VexRvmi , E(660F3A,51,_,I,_,0,2,T1S), 0 , 181, 0 , 10585, 288, 66 ), // #1537
- INST(Vrcp14pd , VexRm_Lx , E(660F38,4C,_,x,_,1,4,FV ), 0 , 113, 0 , 10594, 350, 138), // #1538
- INST(Vrcp14ps , VexRm_Lx , E(660F38,4C,_,x,_,0,4,FV ), 0 , 114, 0 , 10603, 374, 138), // #1539
- INST(Vrcp14sd , VexRvm , E(660F38,4D,_,I,_,1,3,T1S), 0 , 128, 0 , 10612, 420, 68 ), // #1540
- INST(Vrcp14ss , VexRvm , E(660F38,4D,_,I,_,0,2,T1S), 0 , 129, 0 , 10621, 421, 68 ), // #1541
- INST(Vrcp28pd , VexRm , E(660F38,CA,_,2,_,1,4,FV ), 0 , 170, 0 , 10630, 277, 147), // #1542
- INST(Vrcp28ps , VexRm , E(660F38,CA,_,2,_,0,4,FV ), 0 , 171, 0 , 10639, 278, 147), // #1543
- INST(Vrcp28sd , VexRvm , E(660F38,CB,_,I,_,1,3,T1S), 0 , 128, 0 , 10648, 308, 147), // #1544
- INST(Vrcp28ss , VexRvm , E(660F38,CB,_,I,_,0,2,T1S), 0 , 129, 0 , 10657, 309, 147), // #1545
- INST(Vrcpph , VexRm_Lx , E(66MAP6,4C,_,_,_,0,4,FV ), 0 , 183, 0 , 10666, 422, 134), // #1546
- INST(Vrcpps , VexRm_Lx , V(000F00,53,_,x,I,_,_,_ ), 0 , 72 , 0 , 10673, 298, 135), // #1547
- INST(Vrcpsh , VexRvm , E(66MAP6,4D,_,_,_,0,1,T1S), 0 , 185, 0 , 10680, 423, 134), // #1548
- INST(Vrcpss , VexRvm , V(F30F00,53,_,I,I,_,_,_ ), 0 , 199, 0 , 10687, 424, 135), // #1549
- INST(Vreducepd , VexRmi_Lx , E(660F3A,56,_,x,_,1,4,FV ), 0 , 112, 0 , 10694, 400, 140), // #1550
- INST(Vreduceph , VexRmi_Lx , E(000F3A,56,_,_,_,0,4,FV ), 0 , 123, 0 , 10704, 311, 132), // #1551
- INST(Vreduceps , VexRmi_Lx , E(660F3A,56,_,x,_,0,4,FV ), 0 , 111, 0 , 10714, 399, 140), // #1552
- INST(Vreducesd , VexRvmi , E(660F3A,57,_,I,_,1,3,T1S), 0 , 180, 0 , 10724, 425, 66 ), // #1553
- INST(Vreducesh , VexRvmi , E(000F3A,57,_,_,_,0,1,T1S), 0 , 188, 0 , 10734, 313, 134), // #1554
- INST(Vreducess , VexRvmi , E(660F3A,57,_,I,_,0,2,T1S), 0 , 181, 0 , 10744, 426, 66 ), // #1555
- INST(Vrndscalepd , VexRmi_Lx , E(660F3A,09,_,x,_,1,4,FV ), 0 , 112, 0 , 10754, 310, 138), // #1556
- INST(Vrndscaleph , VexRmi_Lx , E(000F3A,08,_,_,_,0,4,FV ), 0 , 123, 0 , 10766, 311, 132), // #1557
- INST(Vrndscaleps , VexRmi_Lx , E(660F3A,08,_,x,_,0,4,FV ), 0 , 111, 0 , 10778, 312, 138), // #1558
- INST(Vrndscalesd , VexRvmi , E(660F3A,0B,_,I,_,1,3,T1S), 0 , 180, 0 , 10790, 287, 68 ), // #1559
- INST(Vrndscalesh , VexRvmi , E(000F3A,0A,_,_,_,0,1,T1S), 0 , 188, 0 , 10802, 313, 134), // #1560
- INST(Vrndscaless , VexRvmi , E(660F3A,0A,_,I,_,0,2,T1S), 0 , 181, 0 , 10814, 288, 68 ), // #1561
- INST(Vroundpd , VexRmi_Lx , V(660F3A,09,_,x,I,_,_,_ ), 0 , 73 , 0 , 10826, 427, 135), // #1562
- INST(Vroundps , VexRmi_Lx , V(660F3A,08,_,x,I,_,_,_ ), 0 , 73 , 0 , 10835, 427, 135), // #1563
- INST(Vroundsd , VexRvmi , V(660F3A,0B,_,I,I,_,_,_ ), 0 , 73 , 0 , 10844, 428, 135), // #1564
- INST(Vroundss , VexRvmi , V(660F3A,0A,_,I,I,_,_,_ ), 0 , 73 , 0 , 10853, 429, 135), // #1565
- INST(Vrsqrt14pd , VexRm_Lx , E(660F38,4E,_,x,_,1,4,FV ), 0 , 113, 0 , 10862, 350, 138), // #1566
- INST(Vrsqrt14ps , VexRm_Lx , E(660F38,4E,_,x,_,0,4,FV ), 0 , 114, 0 , 10873, 374, 138), // #1567
- INST(Vrsqrt14sd , VexRvm , E(660F38,4F,_,I,_,1,3,T1S), 0 , 128, 0 , 10884, 420, 68 ), // #1568
- INST(Vrsqrt14ss , VexRvm , E(660F38,4F,_,I,_,0,2,T1S), 0 , 129, 0 , 10895, 421, 68 ), // #1569
- INST(Vrsqrt28pd , VexRm , E(660F38,CC,_,2,_,1,4,FV ), 0 , 170, 0 , 10906, 277, 147), // #1570
- INST(Vrsqrt28ps , VexRm , E(660F38,CC,_,2,_,0,4,FV ), 0 , 171, 0 , 10917, 278, 147), // #1571
- INST(Vrsqrt28sd , VexRvm , E(660F38,CD,_,I,_,1,3,T1S), 0 , 128, 0 , 10928, 308, 147), // #1572
- INST(Vrsqrt28ss , VexRvm , E(660F38,CD,_,I,_,0,2,T1S), 0 , 129, 0 , 10939, 309, 147), // #1573
- INST(Vrsqrtph , VexRm_Lx , E(66MAP6,4E,_,_,_,0,4,FV ), 0 , 183, 0 , 10950, 422, 132), // #1574
- INST(Vrsqrtps , VexRm_Lx , V(000F00,52,_,x,I,_,_,_ ), 0 , 72 , 0 , 10959, 298, 135), // #1575
- INST(Vrsqrtsh , VexRvm , E(66MAP6,4F,_,_,_,0,1,T1S), 0 , 185, 0 , 10968, 423, 134), // #1576
- INST(Vrsqrtss , VexRvm , V(F30F00,52,_,I,I,_,_,_ ), 0 , 199, 0 , 10977, 424, 135), // #1577
- INST(Vscalefpd , VexRvm_Lx , E(660F38,2C,_,x,_,1,4,FV ), 0 , 113, 0 , 10986, 430, 138), // #1578
- INST(Vscalefph , VexRvm_Lx , E(66MAP6,2C,_,_,_,0,4,FV ), 0 , 183, 0 , 10996, 197, 132), // #1579
- INST(Vscalefps , VexRvm_Lx , E(660F38,2C,_,x,_,0,4,FV ), 0 , 114, 0 , 11006, 284, 138), // #1580
- INST(Vscalefsd , VexRvm , E(660F38,2D,_,I,_,1,3,T1S), 0 , 128, 0 , 11016, 251, 68 ), // #1581
- INST(Vscalefsh , VexRvm , E(66MAP6,2D,_,_,_,0,1,T1S), 0 , 185, 0 , 11026, 200, 134), // #1582
- INST(Vscalefss , VexRvm , E(660F38,2D,_,I,_,0,2,T1S), 0 , 129, 0 , 11036, 259, 68 ), // #1583
- INST(Vscatterdpd , VexMr_VM , E(660F38,A2,_,x,_,1,3,T1S), 0 , 128, 0 , 11046, 403, 138), // #1584
- INST(Vscatterdps , VexMr_VM , E(660F38,A2,_,x,_,0,2,T1S), 0 , 129, 0 , 11058, 402, 138), // #1585
- INST(Vscatterpf0dpd , VexM_VM , E(660F38,C6,5,2,_,1,3,T1S), 0 , 230, 0 , 11070, 303, 153), // #1586
- INST(Vscatterpf0dps , VexM_VM , E(660F38,C6,5,2,_,0,2,T1S), 0 , 231, 0 , 11085, 304, 153), // #1587
- INST(Vscatterpf0qpd , VexM_VM , E(660F38,C7,5,2,_,1,3,T1S), 0 , 230, 0 , 11100, 305, 153), // #1588
- INST(Vscatterpf0qps , VexM_VM , E(660F38,C7,5,2,_,0,2,T1S), 0 , 231, 0 , 11115, 305, 153), // #1589
- INST(Vscatterpf1dpd , VexM_VM , E(660F38,C6,6,2,_,1,3,T1S), 0 , 232, 0 , 11130, 303, 153), // #1590
- INST(Vscatterpf1dps , VexM_VM , E(660F38,C6,6,2,_,0,2,T1S), 0 , 233, 0 , 11145, 304, 153), // #1591
- INST(Vscatterpf1qpd , VexM_VM , E(660F38,C7,6,2,_,1,3,T1S), 0 , 232, 0 , 11160, 305, 153), // #1592
- INST(Vscatterpf1qps , VexM_VM , E(660F38,C7,6,2,_,0,2,T1S), 0 , 233, 0 , 11175, 305, 153), // #1593
- INST(Vscatterqpd , VexMr_VM , E(660F38,A3,_,x,_,1,3,T1S), 0 , 128, 0 , 11190, 405, 138), // #1594
- INST(Vscatterqps , VexMr_VM , E(660F38,A3,_,x,_,0,2,T1S), 0 , 129, 0 , 11202, 404, 138), // #1595
- INST(Vshuff32x4 , VexRvmi_Lx , E(660F3A,23,_,x,_,0,4,FV ), 0 , 111, 0 , 11214, 431, 138), // #1596
- INST(Vshuff64x2 , VexRvmi_Lx , E(660F3A,23,_,x,_,1,4,FV ), 0 , 112, 0 , 11225, 432, 138), // #1597
- INST(Vshufi32x4 , VexRvmi_Lx , E(660F3A,43,_,x,_,0,4,FV ), 0 , 111, 0 , 11236, 431, 138), // #1598
- INST(Vshufi64x2 , VexRvmi_Lx , E(660F3A,43,_,x,_,1,4,FV ), 0 , 112, 0 , 11247, 432, 138), // #1599
- INST(Vshufpd , VexRvmi_Lx , V(660F00,C6,_,x,I,1,4,FV ), 0 , 103, 0 , 11258, 433, 131), // #1600
- INST(Vshufps , VexRvmi_Lx , V(000F00,C6,_,x,I,0,4,FV ), 0 , 105, 0 , 11266, 434, 131), // #1601
- INST(Vsqrtpd , VexRm_Lx , V(660F00,51,_,x,I,1,4,FV ), 0 , 103, 0 , 11274, 435, 131), // #1602
- INST(Vsqrtph , VexRm_Lx , E(00MAP5,51,_,_,_,0,4,FV ), 0 , 104, 0 , 11282, 246, 132), // #1603
- INST(Vsqrtps , VexRm_Lx , V(000F00,51,_,x,I,0,4,FV ), 0 , 105, 0 , 11290, 235, 131), // #1604
- INST(Vsqrtsd , VexRvm , V(F20F00,51,_,I,I,1,3,T1S), 0 , 106, 0 , 11298, 199, 133), // #1605
- INST(Vsqrtsh , VexRvm , E(F3MAP5,51,_,_,_,0,1,T1S), 0 , 107, 0 , 11306, 200, 134), // #1606
- INST(Vsqrtss , VexRvm , V(F30F00,51,_,I,I,0,2,T1S), 0 , 108, 0 , 11314, 201, 133), // #1607
- INST(Vstmxcsr , VexM , V(000F00,AE,3,0,I,_,_,_ ), 0 , 234, 0 , 11322, 321, 135), // #1608
- INST(Vsubpd , VexRvm_Lx , V(660F00,5C,_,x,I,1,4,FV ), 0 , 103, 0 , 11331, 196, 131), // #1609
- INST(Vsubph , VexRvm_Lx , E(00MAP5,5C,_,_,_,0,4,FV ), 0 , 104, 0 , 11338, 197, 132), // #1610
- INST(Vsubps , VexRvm_Lx , V(000F00,5C,_,x,I,0,4,FV ), 0 , 105, 0 , 11345, 198, 131), // #1611
- INST(Vsubsd , VexRvm , V(F20F00,5C,_,I,I,1,3,T1S), 0 , 106, 0 , 11352, 199, 133), // #1612
- INST(Vsubsh , VexRvm , E(F3MAP5,5C,_,_,_,0,1,T1S), 0 , 107, 0 , 11359, 200, 134), // #1613
- INST(Vsubss , VexRvm , V(F30F00,5C,_,I,I,0,2,T1S), 0 , 108, 0 , 11366, 201, 133), // #1614
- INST(Vtestpd , VexRm_Lx , V(660F38,0F,_,x,0,_,_,_ ), 0 , 96 , 0 , 11373, 298, 167), // #1615
- INST(Vtestps , VexRm_Lx , V(660F38,0E,_,x,0,_,_,_ ), 0 , 96 , 0 , 11381, 298, 167), // #1616
- INST(Vucomisd , VexRm , V(660F00,2E,_,I,I,1,3,T1S), 0 , 125, 0 , 11389, 229, 143), // #1617
- INST(Vucomish , VexRm , E(00MAP5,2E,_,_,_,0,1,T1S), 0 , 126, 0 , 11398, 230, 134), // #1618
- INST(Vucomiss , VexRm , V(000F00,2E,_,I,I,0,2,T1S), 0 , 127, 0 , 11407, 231, 143), // #1619
- INST(Vunpckhpd , VexRvm_Lx , V(660F00,15,_,x,I,1,4,FV ), 0 , 103, 0 , 11416, 208, 131), // #1620
- INST(Vunpckhps , VexRvm_Lx , V(000F00,15,_,x,I,0,4,FV ), 0 , 105, 0 , 11426, 209, 131), // #1621
- INST(Vunpcklpd , VexRvm_Lx , V(660F00,14,_,x,I,1,4,FV ), 0 , 103, 0 , 11436, 208, 131), // #1622
- INST(Vunpcklps , VexRvm_Lx , V(000F00,14,_,x,I,0,4,FV ), 0 , 105, 0 , 11446, 209, 131), // #1623
- INST(Vxorpd , VexRvm_Lx , V(660F00,57,_,x,I,1,4,FV ), 0 , 103, 0 , 11456, 417, 139), // #1624
- INST(Vxorps , VexRvm_Lx , V(000F00,57,_,x,I,0,4,FV ), 0 , 105, 0 , 11463, 416, 139), // #1625
- INST(Vzeroall , VexOp , V(000F00,77,_,1,I,_,_,_ ), 0 , 68 , 0 , 11470, 436, 135), // #1626
- INST(Vzeroupper , VexOp , V(000F00,77,_,0,I,_,_,_ ), 0 , 72 , 0 , 11479, 436, 135), // #1627
- INST(Wbinvd , X86Op , O(000F00,09,_,_,_,_,_,_ ), 0 , 4 , 0 , 11490, 30 , 0 ), // #1628
- INST(Wbnoinvd , X86Op , O(F30F00,09,_,_,_,_,_,_ ), 0 , 6 , 0 , 11497, 30 , 176), // #1629
- INST(Wrfsbase , X86M , O(F30F00,AE,2,_,x,_,_,_ ), 0 , 235, 0 , 11506, 173, 111), // #1630
- INST(Wrgsbase , X86M , O(F30F00,AE,3,_,x,_,_,_ ), 0 , 236, 0 , 11515, 173, 111), // #1631
- INST(Wrmsr , X86Op , O(000F00,30,_,_,_,_,_,_ ), 0 , 4 , 0 , 11524, 174, 112), // #1632
- INST(Wrssd , X86Mr , O(000F38,F6,_,_,_,_,_,_ ), 0 , 83 , 0 , 11530, 437, 56 ), // #1633
- INST(Wrssq , X86Mr , O(000F38,F6,_,_,1,_,_,_ ), 0 , 237, 0 , 11536, 438, 56 ), // #1634
- INST(Wrussd , X86Mr , O(660F38,F5,_,_,_,_,_,_ ), 0 , 2 , 0 , 11542, 437, 56 ), // #1635
- INST(Wrussq , X86Mr , O(660F38,F5,_,_,1,_,_,_ ), 0 , 238, 0 , 11549, 438, 56 ), // #1636
- INST(Xabort , X86Op_Mod11RM_I8 , O(000000,C6,7,_,_,_,_,_ ), 0 , 27 , 0 , 11556, 80 , 177), // #1637
- INST(Xadd , X86Xadd , O(000F00,C0,_,_,x,_,_,_ ), 0 , 4 , 0 , 11563, 439, 38 ), // #1638
- INST(Xbegin , X86JmpRel , O(000000,C7,7,_,_,_,_,_ ), 0 , 27 , 0 , 11568, 440, 177), // #1639
- INST(Xchg , X86Xchg , O(000000,86,_,_,x,_,_,_ ), 0 , 0 , 0 , 462 , 441, 0 ), // #1640
- INST(Xend , X86Op , O(000F01,D5,_,_,_,_,_,_ ), 0 , 21 , 0 , 11575, 30 , 177), // #1641
- INST(Xgetbv , X86Op , O(000F01,D0,_,_,_,_,_,_ ), 0 , 21 , 0 , 11580, 174, 178), // #1642
- INST(Xlatb , X86Op , O(000000,D7,_,_,_,_,_,_ ), 0 , 0 , 0 , 11587, 30 , 0 ), // #1643
- INST(Xor , X86Arith , O(000000,30,6,_,x,_,_,_ ), 0 , 32 , 0 , 10540, 179, 1 ), // #1644
- INST(Xorpd , ExtRm , O(660F00,57,_,_,_,_,_,_ ), 0 , 3 , 0 , 11457, 151, 4 ), // #1645
- INST(Xorps , ExtRm , O(000F00,57,_,_,_,_,_,_ ), 0 , 4 , 0 , 11464, 151, 5 ), // #1646
- INST(Xresldtrk , X86Op , O(F20F01,E9,_,_,_,_,_,_ ), 0 , 92 , 0 , 11593, 30 , 179), // #1647
- INST(Xrstor , X86M_Only_EDX_EAX , O(000F00,AE,5,_,_,_,_,_ ), 0 , 77 , 0 , 1164 , 442, 178), // #1648
- INST(Xrstor64 , X86M_Only_EDX_EAX , O(000F00,AE,5,_,1,_,_,_ ), 0 , 239, 0 , 1172 , 443, 178), // #1649
- INST(Xrstors , X86M_Only_EDX_EAX , O(000F00,C7,3,_,_,_,_,_ ), 0 , 78 , 0 , 11603, 442, 180), // #1650
- INST(Xrstors64 , X86M_Only_EDX_EAX , O(000F00,C7,3,_,1,_,_,_ ), 0 , 240, 0 , 11611, 443, 180), // #1651
- INST(Xsave , X86M_Only_EDX_EAX , O(000F00,AE,4,_,_,_,_,_ ), 0 , 97 , 0 , 1182 , 442, 178), // #1652
- INST(Xsave64 , X86M_Only_EDX_EAX , O(000F00,AE,4,_,1,_,_,_ ), 0 , 241, 0 , 1189 , 443, 178), // #1653
- INST(Xsavec , X86M_Only_EDX_EAX , O(000F00,C7,4,_,_,_,_,_ ), 0 , 97 , 0 , 11621, 442, 181), // #1654
- INST(Xsavec64 , X86M_Only_EDX_EAX , O(000F00,C7,4,_,1,_,_,_ ), 0 , 241, 0 , 11628, 443, 181), // #1655
- INST(Xsaveopt , X86M_Only_EDX_EAX , O(000F00,AE,6,_,_,_,_,_ ), 0 , 80 , 0 , 11637, 442, 182), // #1656
- INST(Xsaveopt64 , X86M_Only_EDX_EAX , O(000F00,AE,6,_,1,_,_,_ ), 0 , 242, 0 , 11646, 443, 182), // #1657
- INST(Xsaves , X86M_Only_EDX_EAX , O(000F00,C7,5,_,_,_,_,_ ), 0 , 77 , 0 , 11657, 442, 180), // #1658
- INST(Xsaves64 , X86M_Only_EDX_EAX , O(000F00,C7,5,_,1,_,_,_ ), 0 , 239, 0 , 11664, 443, 180), // #1659
- INST(Xsetbv , X86Op , O(000F01,D1,_,_,_,_,_,_ ), 0 , 21 , 0 , 11673, 174, 178), // #1660
- INST(Xsusldtrk , X86Op , O(F20F01,E8,_,_,_,_,_,_ ), 0 , 92 , 0 , 11680, 30 , 179), // #1661
- INST(Xtest , X86Op , O(000F01,D6,_,_,_,_,_,_ ), 0 , 21 , 0 , 11690, 30 , 183) // #1662
+ INST(None , None , 0 , 0 , 0 , 0 , 0 , 0 ), // #0
+ INST(Aaa , X86Op_xAX , O(000000,37,_,_,_,_,_,_ ), 0 , 0 , 0 , 1 , 1 ), // #1
+ INST(Aad , X86I_xAX , O(000000,D5,_,_,_,_,_,_ ), 0 , 0 , 0 , 2 , 1 ), // #2
+ INST(Aadd , X86Mr , O(000F38,FC,_,_,_,_,_,_ ), 0 , 1 , 0 , 3 , 2 ), // #3
+ INST(Aam , X86I_xAX , O(000000,D4,_,_,_,_,_,_ ), 0 , 0 , 0 , 2 , 1 ), // #4
+ INST(Aand , X86Mr , O(660F38,FC,_,_,_,_,_,_ ), 0 , 2 , 0 , 3 , 2 ), // #5
+ INST(Aas , X86Op_xAX , O(000000,3F,_,_,_,_,_,_ ), 0 , 0 , 0 , 1 , 1 ), // #6
+ INST(Adc , X86Arith , O(000000,10,2,_,x,_,_,_ ), 0 , 3 , 0 , 4 , 3 ), // #7
+ INST(Adcx , X86Rm , O(660F38,F6,_,_,x,_,_,_ ), 0 , 2 , 0 , 5 , 4 ), // #8
+ INST(Add , X86Arith , O(000000,00,0,_,x,_,_,_ ), 0 , 0 , 0 , 4 , 1 ), // #9
+ INST(Addpd , ExtRm , O(660F00,58,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #10
+ INST(Addps , ExtRm , O(000F00,58,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #11
+ INST(Addsd , ExtRm , O(F20F00,58,_,_,_,_,_,_ ), 0 , 6 , 0 , 7 , 5 ), // #12
+ INST(Addss , ExtRm , O(F30F00,58,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 6 ), // #13
+ INST(Addsubpd , ExtRm , O(660F00,D0,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 7 ), // #14
+ INST(Addsubps , ExtRm , O(F20F00,D0,_,_,_,_,_,_ ), 0 , 6 , 0 , 6 , 7 ), // #15
+ INST(Adox , X86Rm , O(F30F38,F6,_,_,x,_,_,_ ), 0 , 8 , 0 , 5 , 8 ), // #16
+ INST(Aesdec , ExtRm , O(660F38,DE,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 9 ), // #17
+ INST(Aesdeclast , ExtRm , O(660F38,DF,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 9 ), // #18
+ INST(Aesenc , ExtRm , O(660F38,DC,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 9 ), // #19
+ INST(Aesenclast , ExtRm , O(660F38,DD,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 9 ), // #20
+ INST(Aesimc , ExtRm , O(660F38,DB,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 9 ), // #21
+ INST(Aeskeygenassist , ExtRmi , O(660F3A,DF,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 9 ), // #22
+ INST(And , X86Arith , O(000000,20,4,_,x,_,_,_ ), 0 , 10 , 0 , 10 , 1 ), // #23
+ INST(Andn , VexRvm_Wx , V(000F38,F2,_,0,x,_,_,_ ), 0 , 11 , 0 , 11 , 10 ), // #24
+ INST(Andnpd , ExtRm , O(660F00,55,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #25
+ INST(Andnps , ExtRm , O(000F00,55,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #26
+ INST(Andpd , ExtRm , O(660F00,54,_,_,_,_,_,_ ), 0 , 4 , 0 , 12 , 5 ), // #27
+ INST(Andps , ExtRm , O(000F00,54,_,_,_,_,_,_ ), 0 , 5 , 0 , 12 , 6 ), // #28
+ INST(Aor , X86Mr , O(F20F38,FC,_,_,_,_,_,_ ), 0 , 12 , 0 , 3 , 2 ), // #29
+ INST(Arpl , X86Mr_NoSize , O(000000,63,_,_,_,_,_,_ ), 0 , 0 , 0 , 13 , 11 ), // #30
+ INST(Axor , X86Mr , O(F30F38,FC,_,_,_,_,_,_ ), 0 , 8 , 0 , 3 , 2 ), // #31
+ INST(Bextr , VexRmv_Wx , V(000F38,F7,_,0,x,_,_,_ ), 0 , 11 , 0 , 14 , 10 ), // #32
+ INST(Blcfill , VexVm_Wx , V(XOP_M9,01,1,0,x,_,_,_ ), 0 , 13 , 0 , 15 , 12 ), // #33
+ INST(Blci , VexVm_Wx , V(XOP_M9,02,6,0,x,_,_,_ ), 0 , 14 , 0 , 15 , 12 ), // #34
+ INST(Blcic , VexVm_Wx , V(XOP_M9,01,5,0,x,_,_,_ ), 0 , 15 , 0 , 15 , 12 ), // #35
+ INST(Blcmsk , VexVm_Wx , V(XOP_M9,02,1,0,x,_,_,_ ), 0 , 13 , 0 , 15 , 12 ), // #36
+ INST(Blcs , VexVm_Wx , V(XOP_M9,01,3,0,x,_,_,_ ), 0 , 16 , 0 , 15 , 12 ), // #37
+ INST(Blendpd , ExtRmi , O(660F3A,0D,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 13 ), // #38
+ INST(Blendps , ExtRmi , O(660F3A,0C,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 13 ), // #39
+ INST(Blendvpd , ExtRm_XMM0 , O(660F38,15,_,_,_,_,_,_ ), 0 , 2 , 0 , 16 , 13 ), // #40
+ INST(Blendvps , ExtRm_XMM0 , O(660F38,14,_,_,_,_,_,_ ), 0 , 2 , 0 , 16 , 13 ), // #41
+ INST(Blsfill , VexVm_Wx , V(XOP_M9,01,2,0,x,_,_,_ ), 0 , 17 , 0 , 15 , 12 ), // #42
+ INST(Blsi , VexVm_Wx , V(000F38,F3,3,0,x,_,_,_ ), 0 , 18 , 0 , 15 , 10 ), // #43
+ INST(Blsic , VexVm_Wx , V(XOP_M9,01,6,0,x,_,_,_ ), 0 , 14 , 0 , 15 , 12 ), // #44
+ INST(Blsmsk , VexVm_Wx , V(000F38,F3,2,0,x,_,_,_ ), 0 , 19 , 0 , 15 , 10 ), // #45
+ INST(Blsr , VexVm_Wx , V(000F38,F3,1,0,x,_,_,_ ), 0 , 20 , 0 , 15 , 10 ), // #46
+ INST(Bndcl , X86Rm , O(F30F00,1A,_,_,_,_,_,_ ), 0 , 7 , 0 , 17 , 14 ), // #47
+ INST(Bndcn , X86Rm , O(F20F00,1B,_,_,_,_,_,_ ), 0 , 6 , 0 , 17 , 14 ), // #48
+ INST(Bndcu , X86Rm , O(F20F00,1A,_,_,_,_,_,_ ), 0 , 6 , 0 , 17 , 14 ), // #49
+ INST(Bndldx , X86Rm , O(000F00,1A,_,_,_,_,_,_ ), 0 , 5 , 0 , 18 , 14 ), // #50
+ INST(Bndmk , X86Rm , O(F30F00,1B,_,_,_,_,_,_ ), 0 , 7 , 0 , 19 , 14 ), // #51
+ INST(Bndmov , X86Bndmov , O(660F00,1A,_,_,_,_,_,_ ), O(660F00,1B,_,_,_,_,_,_ ), 4 , 1 , 20 , 14 ), // #52
+ INST(Bndstx , X86Mr , O(000F00,1B,_,_,_,_,_,_ ), 0 , 5 , 0 , 21 , 14 ), // #53
+ INST(Bound , X86Rm , O(000000,62,_,_,_,_,_,_ ), 0 , 0 , 0 , 22 , 0 ), // #54
+ INST(Bsf , X86Rm , O(000F00,BC,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 1 ), // #55
+ INST(Bsr , X86Rm , O(000F00,BD,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 1 ), // #56
+ INST(Bswap , X86Bswap , O(000F00,C8,_,_,x,_,_,_ ), 0 , 5 , 0 , 24 , 0 ), // #57
+ INST(Bt , X86Bt , O(000F00,A3,_,_,x,_,_,_ ), O(000F00,BA,4,_,x,_,_,_ ), 5 , 2 , 25 , 15 ), // #58
+ INST(Btc , X86Bt , O(000F00,BB,_,_,x,_,_,_ ), O(000F00,BA,7,_,x,_,_,_ ), 5 , 3 , 26 , 15 ), // #59
+ INST(Btr , X86Bt , O(000F00,B3,_,_,x,_,_,_ ), O(000F00,BA,6,_,x,_,_,_ ), 5 , 4 , 26 , 15 ), // #60
+ INST(Bts , X86Bt , O(000F00,AB,_,_,x,_,_,_ ), O(000F00,BA,5,_,x,_,_,_ ), 5 , 5 , 26 , 15 ), // #61
+ INST(Bzhi , VexRmv_Wx , V(000F38,F5,_,0,x,_,_,_ ), 0 , 11 , 0 , 14 , 16 ), // #62
+ INST(Call , X86Call , O(000000,FF,2,_,_,_,_,_ ), 0 , 3 , 0 , 27 , 1 ), // #63
+ INST(Cbw , X86Op_xAX , O(660000,98,_,_,_,_,_,_ ), 0 , 21 , 0 , 28 , 0 ), // #64
+ INST(Cdq , X86Op_xDX_xAX , O(000000,99,_,_,_,_,_,_ ), 0 , 0 , 0 , 29 , 0 ), // #65
+ INST(Cdqe , X86Op_xAX , O(000000,98,_,_,1,_,_,_ ), 0 , 22 , 0 , 30 , 0 ), // #66
+ INST(Clac , X86Op , O(000F01,CA,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 17 ), // #67
+ INST(Clc , X86Op , O(000000,F8,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 18 ), // #68
+ INST(Cld , X86Op , O(000000,FC,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 19 ), // #69
+ INST(Cldemote , X86M_Only , O(000F00,1C,0,_,_,_,_,_ ), 0 , 5 , 0 , 32 , 20 ), // #70
+ INST(Clflush , X86M_Only , O(000F00,AE,7,_,_,_,_,_ ), 0 , 24 , 0 , 32 , 21 ), // #71
+ INST(Clflushopt , X86M_Only , O(660F00,AE,7,_,_,_,_,_ ), 0 , 25 , 0 , 32 , 22 ), // #72
+ INST(Clgi , X86Op , O(000F01,DD,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 23 ), // #73
+ INST(Cli , X86Op , O(000000,FA,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 24 ), // #74
+ INST(Clrssbsy , X86M_Only , O(F30F00,AE,6,_,_,_,_,_ ), 0 , 26 , 0 , 33 , 25 ), // #75
+ INST(Clts , X86Op , O(000F00,06,_,_,_,_,_,_ ), 0 , 5 , 0 , 31 , 0 ), // #76
+ INST(Clui , X86Op , O(F30F01,EE,_,_,_,_,_,_ ), 0 , 27 , 0 , 34 , 26 ), // #77
+ INST(Clwb , X86M_Only , O(660F00,AE,6,_,_,_,_,_ ), 0 , 28 , 0 , 32 , 27 ), // #78
+ INST(Clzero , X86Op_MemZAX , O(000F01,FC,_,_,_,_,_,_ ), 0 , 23 , 0 , 35 , 28 ), // #79
+ INST(Cmc , X86Op , O(000000,F5,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 29 ), // #80
+ INST(Cmova , X86Rm , O(000F00,47,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 30 ), // #81
+ INST(Cmovae , X86Rm , O(000F00,43,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 31 ), // #82
+ INST(Cmovb , X86Rm , O(000F00,42,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 31 ), // #83
+ INST(Cmovbe , X86Rm , O(000F00,46,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 30 ), // #84
+ INST(Cmovc , X86Rm , O(000F00,42,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 31 ), // #85
+ INST(Cmove , X86Rm , O(000F00,44,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 32 ), // #86
+ INST(Cmovg , X86Rm , O(000F00,4F,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 33 ), // #87
+ INST(Cmovge , X86Rm , O(000F00,4D,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 34 ), // #88
+ INST(Cmovl , X86Rm , O(000F00,4C,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 34 ), // #89
+ INST(Cmovle , X86Rm , O(000F00,4E,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 33 ), // #90
+ INST(Cmovna , X86Rm , O(000F00,46,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 30 ), // #91
+ INST(Cmovnae , X86Rm , O(000F00,42,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 31 ), // #92
+ INST(Cmovnb , X86Rm , O(000F00,43,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 31 ), // #93
+ INST(Cmovnbe , X86Rm , O(000F00,47,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 30 ), // #94
+ INST(Cmovnc , X86Rm , O(000F00,43,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 31 ), // #95
+ INST(Cmovne , X86Rm , O(000F00,45,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 32 ), // #96
+ INST(Cmovng , X86Rm , O(000F00,4E,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 33 ), // #97
+ INST(Cmovnge , X86Rm , O(000F00,4C,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 34 ), // #98
+ INST(Cmovnl , X86Rm , O(000F00,4D,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 34 ), // #99
+ INST(Cmovnle , X86Rm , O(000F00,4F,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 33 ), // #100
+ INST(Cmovno , X86Rm , O(000F00,41,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 35 ), // #101
+ INST(Cmovnp , X86Rm , O(000F00,4B,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 36 ), // #102
+ INST(Cmovns , X86Rm , O(000F00,49,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 37 ), // #103
+ INST(Cmovnz , X86Rm , O(000F00,45,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 32 ), // #104
+ INST(Cmovo , X86Rm , O(000F00,40,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 35 ), // #105
+ INST(Cmovp , X86Rm , O(000F00,4A,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 36 ), // #106
+ INST(Cmovpe , X86Rm , O(000F00,4A,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 36 ), // #107
+ INST(Cmovpo , X86Rm , O(000F00,4B,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 36 ), // #108
+ INST(Cmovs , X86Rm , O(000F00,48,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 37 ), // #109
+ INST(Cmovz , X86Rm , O(000F00,44,_,_,x,_,_,_ ), 0 , 5 , 0 , 23 , 32 ), // #110
+ INST(Cmp , X86Arith , O(000000,38,7,_,x,_,_,_ ), 0 , 29 , 0 , 36 , 1 ), // #111
+ INST(Cmpbexadd , VexMvr_Wx , V(660F38,E6,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #112
+ INST(Cmpbxadd , VexMvr_Wx , V(660F38,E2,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #113
+ INST(Cmplexadd , VexMvr_Wx , V(660F38,EE,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #114
+ INST(Cmplxadd , VexMvr_Wx , V(660F38,EC,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #115
+ INST(Cmpnbexadd , VexMvr_Wx , V(660F38,E7,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #116
+ INST(Cmpnbxadd , VexMvr_Wx , V(660F38,E3,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #117
+ INST(Cmpnlexadd , VexMvr_Wx , V(660F38,EF,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #118
+ INST(Cmpnlxadd , VexMvr_Wx , V(660F38,ED,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #119
+ INST(Cmpnoxadd , VexMvr_Wx , V(660F38,E1,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #120
+ INST(Cmpnpxadd , VexMvr_Wx , V(660F38,EB,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #121
+ INST(Cmpnsxadd , VexMvr_Wx , V(660F38,E9,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #122
+ INST(Cmpnzxadd , VexMvr_Wx , V(660F38,E5,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #123
+ INST(Cmpoxadd , VexMvr_Wx , V(660F38,E0,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #124
+ INST(Cmppd , ExtRmi , O(660F00,C2,_,_,_,_,_,_ ), 0 , 4 , 0 , 9 , 5 ), // #125
+ INST(Cmpps , ExtRmi , O(000F00,C2,_,_,_,_,_,_ ), 0 , 5 , 0 , 9 , 6 ), // #126
+ INST(Cmppxadd , VexMvr_Wx , V(660F38,EA,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #127
+ INST(Cmps , X86StrMm , O(000000,A6,_,_,_,_,_,_ ), 0 , 0 , 0 , 38 , 39 ), // #128
+ INST(Cmpsd , ExtRmi , O(F20F00,C2,_,_,_,_,_,_ ), 0 , 6 , 0 , 39 , 5 ), // #129
+ INST(Cmpss , ExtRmi , O(F30F00,C2,_,_,_,_,_,_ ), 0 , 7 , 0 , 40 , 6 ), // #130
+ INST(Cmpsxadd , VexMvr_Wx , V(660F38,E8,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #131
+ INST(Cmpxchg , X86Cmpxchg , O(000F00,B0,_,_,x,_,_,_ ), 0 , 5 , 0 , 41 , 40 ), // #132
+ INST(Cmpxchg16b , X86Cmpxchg8b_16b , O(000F00,C7,1,_,1,_,_,_ ), 0 , 31 , 0 , 42 , 41 ), // #133
+ INST(Cmpxchg8b , X86Cmpxchg8b_16b , O(000F00,C7,1,_,_,_,_,_ ), 0 , 32 , 0 , 43 , 42 ), // #134
+ INST(Cmpzxadd , VexMvr_Wx , V(660F38,E4,_,0,x,_,_,_ ), 0 , 30 , 0 , 37 , 38 ), // #135
+ INST(Comisd , ExtRm , O(660F00,2F,_,_,_,_,_,_ ), 0 , 4 , 0 , 7 , 43 ), // #136
+ INST(Comiss , ExtRm , O(000F00,2F,_,_,_,_,_,_ ), 0 , 5 , 0 , 8 , 44 ), // #137
+ INST(Cpuid , X86Op , O(000F00,A2,_,_,_,_,_,_ ), 0 , 5 , 0 , 44 , 45 ), // #138
+ INST(Cqo , X86Op_xDX_xAX , O(000000,99,_,_,1,_,_,_ ), 0 , 22 , 0 , 45 , 0 ), // #139
+ INST(Crc32 , X86Crc , O(F20F38,F0,_,_,x,_,_,_ ), 0 , 12 , 0 , 46 , 46 ), // #140
+ INST(Cvtdq2pd , ExtRm , O(F30F00,E6,_,_,_,_,_,_ ), 0 , 7 , 0 , 7 , 5 ), // #141
+ INST(Cvtdq2ps , ExtRm , O(000F00,5B,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 5 ), // #142
+ INST(Cvtpd2dq , ExtRm , O(F20F00,E6,_,_,_,_,_,_ ), 0 , 6 , 0 , 6 , 5 ), // #143
+ INST(Cvtpd2pi , ExtRm , O(660F00,2D,_,_,_,_,_,_ ), 0 , 4 , 0 , 47 , 5 ), // #144
+ INST(Cvtpd2ps , ExtRm , O(660F00,5A,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #145
+ INST(Cvtpi2pd , ExtRm , O(660F00,2A,_,_,_,_,_,_ ), 0 , 4 , 0 , 48 , 5 ), // #146
+ INST(Cvtpi2ps , ExtRm , O(000F00,2A,_,_,_,_,_,_ ), 0 , 5 , 0 , 48 , 6 ), // #147
+ INST(Cvtps2dq , ExtRm , O(660F00,5B,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #148
+ INST(Cvtps2pd , ExtRm , O(000F00,5A,_,_,_,_,_,_ ), 0 , 5 , 0 , 7 , 5 ), // #149
+ INST(Cvtps2pi , ExtRm , O(000F00,2D,_,_,_,_,_,_ ), 0 , 5 , 0 , 49 , 6 ), // #150
+ INST(Cvtsd2si , ExtRm_Wx_GpqOnly , O(F20F00,2D,_,_,x,_,_,_ ), 0 , 6 , 0 , 50 , 5 ), // #151
+ INST(Cvtsd2ss , ExtRm , O(F20F00,5A,_,_,_,_,_,_ ), 0 , 6 , 0 , 7 , 5 ), // #152
+ INST(Cvtsi2sd , ExtRm_Wx , O(F20F00,2A,_,_,x,_,_,_ ), 0 , 6 , 0 , 51 , 5 ), // #153
+ INST(Cvtsi2ss , ExtRm_Wx , O(F30F00,2A,_,_,x,_,_,_ ), 0 , 7 , 0 , 52 , 6 ), // #154
+ INST(Cvtss2sd , ExtRm , O(F30F00,5A,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 5 ), // #155
+ INST(Cvtss2si , ExtRm_Wx_GpqOnly , O(F30F00,2D,_,_,x,_,_,_ ), 0 , 7 , 0 , 53 , 6 ), // #156
+ INST(Cvttpd2dq , ExtRm , O(660F00,E6,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #157
+ INST(Cvttpd2pi , ExtRm , O(660F00,2C,_,_,_,_,_,_ ), 0 , 4 , 0 , 47 , 5 ), // #158
+ INST(Cvttps2dq , ExtRm , O(F30F00,5B,_,_,_,_,_,_ ), 0 , 7 , 0 , 6 , 5 ), // #159
+ INST(Cvttps2pi , ExtRm , O(000F00,2C,_,_,_,_,_,_ ), 0 , 5 , 0 , 49 , 6 ), // #160
+ INST(Cvttsd2si , ExtRm_Wx_GpqOnly , O(F20F00,2C,_,_,x,_,_,_ ), 0 , 6 , 0 , 50 , 5 ), // #161
+ INST(Cvttss2si , ExtRm_Wx_GpqOnly , O(F30F00,2C,_,_,x,_,_,_ ), 0 , 7 , 0 , 54 , 6 ), // #162
+ INST(Cwd , X86Op_xDX_xAX , O(660000,99,_,_,_,_,_,_ ), 0 , 21 , 0 , 55 , 0 ), // #163
+ INST(Cwde , X86Op_xAX , O(000000,98,_,_,_,_,_,_ ), 0 , 0 , 0 , 56 , 0 ), // #164
+ INST(Daa , X86Op , O(000000,27,_,_,_,_,_,_ ), 0 , 0 , 0 , 1 , 1 ), // #165
+ INST(Das , X86Op , O(000000,2F,_,_,_,_,_,_ ), 0 , 0 , 0 , 1 , 1 ), // #166
+ INST(Dec , X86IncDec , O(000000,FE,1,_,x,_,_,_ ), O(000000,48,_,_,x,_,_,_ ), 33 , 6 , 57 , 47 ), // #167
+ INST(Div , X86M_GPB_MulDiv , O(000000,F6,6,_,x,_,_,_ ), 0 , 34 , 0 , 58 , 1 ), // #168
+ INST(Divpd , ExtRm , O(660F00,5E,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #169
+ INST(Divps , ExtRm , O(000F00,5E,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #170
+ INST(Divsd , ExtRm , O(F20F00,5E,_,_,_,_,_,_ ), 0 , 6 , 0 , 7 , 5 ), // #171
+ INST(Divss , ExtRm , O(F30F00,5E,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 6 ), // #172
+ INST(Dppd , ExtRmi , O(660F3A,41,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 13 ), // #173
+ INST(Dpps , ExtRmi , O(660F3A,40,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 13 ), // #174
+ INST(Emms , X86Op , O(000F00,77,_,_,_,_,_,_ ), 0 , 5 , 0 , 59 , 48 ), // #175
+ INST(Endbr32 , X86Op_Mod11RM , O(F30F00,1E,7,_,_,_,_,3 ), 0 , 35 , 0 , 31 , 49 ), // #176
+ INST(Endbr64 , X86Op_Mod11RM , O(F30F00,1E,7,_,_,_,_,2 ), 0 , 36 , 0 , 31 , 49 ), // #177
+ INST(Enqcmd , X86EnqcmdMovdir64b , O(F20F38,F8,_,_,_,_,_,_ ), 0 , 12 , 0 , 60 , 50 ), // #178
+ INST(Enqcmds , X86EnqcmdMovdir64b , O(F30F38,F8,_,_,_,_,_,_ ), 0 , 8 , 0 , 60 , 50 ), // #179
+ INST(Enter , X86Enter , O(000000,C8,_,_,_,_,_,_ ), 0 , 0 , 0 , 61 , 0 ), // #180
+ INST(Extractps , ExtExtract , O(660F3A,17,_,_,_,_,_,_ ), 0 , 9 , 0 , 62 , 13 ), // #181
+ INST(Extrq , ExtExtrq , O(660F00,79,_,_,_,_,_,_ ), O(660F00,78,0,_,_,_,_,_ ), 4 , 7 , 63 , 51 ), // #182
+ INST(F2xm1 , FpuOp , O_FPU(00,D9F0,_) , 0 , 37 , 0 , 31 , 52 ), // #183
+ INST(Fabs , FpuOp , O_FPU(00,D9E1,_) , 0 , 37 , 0 , 31 , 52 ), // #184
+ INST(Fadd , FpuArith , O_FPU(00,C0C0,0) , 0 , 38 , 0 , 64 , 52 ), // #185
+ INST(Faddp , FpuRDef , O_FPU(00,DEC0,_) , 0 , 39 , 0 , 65 , 52 ), // #186
+ INST(Fbld , X86M_Only , O_FPU(00,00DF,4) , 0 , 40 , 0 , 66 , 52 ), // #187
+ INST(Fbstp , X86M_Only , O_FPU(00,00DF,6) , 0 , 41 , 0 , 66 , 52 ), // #188
+ INST(Fchs , FpuOp , O_FPU(00,D9E0,_) , 0 , 37 , 0 , 31 , 52 ), // #189
+ INST(Fclex , FpuOp , O_FPU(9B,DBE2,_) , 0 , 42 , 0 , 31 , 52 ), // #190
+ INST(Fcmovb , FpuR , O_FPU(00,DAC0,_) , 0 , 43 , 0 , 67 , 53 ), // #191
+ INST(Fcmovbe , FpuR , O_FPU(00,DAD0,_) , 0 , 43 , 0 , 67 , 54 ), // #192
+ INST(Fcmove , FpuR , O_FPU(00,DAC8,_) , 0 , 43 , 0 , 67 , 55 ), // #193
+ INST(Fcmovnb , FpuR , O_FPU(00,DBC0,_) , 0 , 44 , 0 , 67 , 53 ), // #194
+ INST(Fcmovnbe , FpuR , O_FPU(00,DBD0,_) , 0 , 44 , 0 , 67 , 54 ), // #195
+ INST(Fcmovne , FpuR , O_FPU(00,DBC8,_) , 0 , 44 , 0 , 67 , 55 ), // #196
+ INST(Fcmovnu , FpuR , O_FPU(00,DBD8,_) , 0 , 44 , 0 , 67 , 56 ), // #197
+ INST(Fcmovu , FpuR , O_FPU(00,DAD8,_) , 0 , 43 , 0 , 67 , 56 ), // #198
+ INST(Fcom , FpuCom , O_FPU(00,D0D0,2) , 0 , 45 , 0 , 68 , 52 ), // #199
+ INST(Fcomi , FpuR , O_FPU(00,DBF0,_) , 0 , 44 , 0 , 67 , 57 ), // #200
+ INST(Fcomip , FpuR , O_FPU(00,DFF0,_) , 0 , 46 , 0 , 67 , 57 ), // #201
+ INST(Fcomp , FpuCom , O_FPU(00,D8D8,3) , 0 , 47 , 0 , 68 , 52 ), // #202
+ INST(Fcompp , FpuOp , O_FPU(00,DED9,_) , 0 , 39 , 0 , 31 , 52 ), // #203
+ INST(Fcos , FpuOp , O_FPU(00,D9FF,_) , 0 , 37 , 0 , 31 , 52 ), // #204
+ INST(Fdecstp , FpuOp , O_FPU(00,D9F6,_) , 0 , 37 , 0 , 31 , 52 ), // #205
+ INST(Fdiv , FpuArith , O_FPU(00,F0F8,6) , 0 , 48 , 0 , 64 , 52 ), // #206
+ INST(Fdivp , FpuRDef , O_FPU(00,DEF8,_) , 0 , 39 , 0 , 65 , 52 ), // #207
+ INST(Fdivr , FpuArith , O_FPU(00,F8F0,7) , 0 , 49 , 0 , 64 , 52 ), // #208
+ INST(Fdivrp , FpuRDef , O_FPU(00,DEF0,_) , 0 , 39 , 0 , 65 , 52 ), // #209
+ INST(Femms , X86Op , O(000F00,0E,_,_,_,_,_,_ ), 0 , 5 , 0 , 31 , 58 ), // #210
+ INST(Ffree , FpuR , O_FPU(00,DDC0,_) , 0 , 50 , 0 , 67 , 52 ), // #211
+ INST(Fiadd , FpuM , O_FPU(00,00DA,0) , 0 , 51 , 0 , 69 , 52 ), // #212
+ INST(Ficom , FpuM , O_FPU(00,00DA,2) , 0 , 52 , 0 , 69 , 52 ), // #213
+ INST(Ficomp , FpuM , O_FPU(00,00DA,3) , 0 , 53 , 0 , 69 , 52 ), // #214
+ INST(Fidiv , FpuM , O_FPU(00,00DA,6) , 0 , 41 , 0 , 69 , 52 ), // #215
+ INST(Fidivr , FpuM , O_FPU(00,00DA,7) , 0 , 54 , 0 , 69 , 52 ), // #216
+ INST(Fild , FpuM , O_FPU(00,00DB,0) , O_FPU(00,00DF,5) , 51 , 8 , 70 , 52 ), // #217
+ INST(Fimul , FpuM , O_FPU(00,00DA,1) , 0 , 55 , 0 , 69 , 52 ), // #218
+ INST(Fincstp , FpuOp , O_FPU(00,D9F7,_) , 0 , 37 , 0 , 31 , 52 ), // #219
+ INST(Finit , FpuOp , O_FPU(9B,DBE3,_) , 0 , 42 , 0 , 31 , 52 ), // #220
+ INST(Fist , FpuM , O_FPU(00,00DB,2) , 0 , 52 , 0 , 69 , 52 ), // #221
+ INST(Fistp , FpuM , O_FPU(00,00DB,3) , O_FPU(00,00DF,7) , 53 , 9 , 70 , 52 ), // #222
+ INST(Fisttp , FpuM , O_FPU(00,00DB,1) , O_FPU(00,00DD,1) , 55 , 10 , 70 , 59 ), // #223
+ INST(Fisub , FpuM , O_FPU(00,00DA,4) , 0 , 40 , 0 , 69 , 52 ), // #224
+ INST(Fisubr , FpuM , O_FPU(00,00DA,5) , 0 , 56 , 0 , 69 , 52 ), // #225
+ INST(Fld , FpuFldFst , O_FPU(00,00D9,0) , O_FPU(00,00DB,5) , 51 , 11 , 71 , 52 ), // #226
+ INST(Fld1 , FpuOp , O_FPU(00,D9E8,_) , 0 , 37 , 0 , 31 , 52 ), // #227
+ INST(Fldcw , X86M_Only , O_FPU(00,00D9,5) , 0 , 56 , 0 , 72 , 52 ), // #228
+ INST(Fldenv , X86M_Only , O_FPU(00,00D9,4) , 0 , 40 , 0 , 32 , 52 ), // #229
+ INST(Fldl2e , FpuOp , O_FPU(00,D9EA,_) , 0 , 37 , 0 , 31 , 52 ), // #230
+ INST(Fldl2t , FpuOp , O_FPU(00,D9E9,_) , 0 , 37 , 0 , 31 , 52 ), // #231
+ INST(Fldlg2 , FpuOp , O_FPU(00,D9EC,_) , 0 , 37 , 0 , 31 , 52 ), // #232
+ INST(Fldln2 , FpuOp , O_FPU(00,D9ED,_) , 0 , 37 , 0 , 31 , 52 ), // #233
+ INST(Fldpi , FpuOp , O_FPU(00,D9EB,_) , 0 , 37 , 0 , 31 , 52 ), // #234
+ INST(Fldz , FpuOp , O_FPU(00,D9EE,_) , 0 , 37 , 0 , 31 , 52 ), // #235
+ INST(Fmul , FpuArith , O_FPU(00,C8C8,1) , 0 , 57 , 0 , 64 , 52 ), // #236
+ INST(Fmulp , FpuRDef , O_FPU(00,DEC8,_) , 0 , 39 , 0 , 65 , 52 ), // #237
+ INST(Fnclex , FpuOp , O_FPU(00,DBE2,_) , 0 , 44 , 0 , 31 , 52 ), // #238
+ INST(Fninit , FpuOp , O_FPU(00,DBE3,_) , 0 , 44 , 0 , 31 , 52 ), // #239
+ INST(Fnop , FpuOp , O_FPU(00,D9D0,_) , 0 , 37 , 0 , 31 , 52 ), // #240
+ INST(Fnsave , X86M_Only , O_FPU(00,00DD,6) , 0 , 41 , 0 , 32 , 52 ), // #241
+ INST(Fnstcw , X86M_Only , O_FPU(00,00D9,7) , 0 , 54 , 0 , 72 , 52 ), // #242
+ INST(Fnstenv , X86M_Only , O_FPU(00,00D9,6) , 0 , 41 , 0 , 32 , 52 ), // #243
+ INST(Fnstsw , FpuStsw , O_FPU(00,00DD,7) , O_FPU(00,DFE0,_) , 54 , 12 , 73 , 52 ), // #244
+ INST(Fpatan , FpuOp , O_FPU(00,D9F3,_) , 0 , 37 , 0 , 31 , 52 ), // #245
+ INST(Fprem , FpuOp , O_FPU(00,D9F8,_) , 0 , 37 , 0 , 31 , 52 ), // #246
+ INST(Fprem1 , FpuOp , O_FPU(00,D9F5,_) , 0 , 37 , 0 , 31 , 52 ), // #247
+ INST(Fptan , FpuOp , O_FPU(00,D9F2,_) , 0 , 37 , 0 , 31 , 52 ), // #248
+ INST(Frndint , FpuOp , O_FPU(00,D9FC,_) , 0 , 37 , 0 , 31 , 52 ), // #249
+ INST(Frstor , X86M_Only , O_FPU(00,00DD,4) , 0 , 40 , 0 , 32 , 52 ), // #250
+ INST(Fsave , X86M_Only , O_FPU(9B,00DD,6) , 0 , 58 , 0 , 32 , 52 ), // #251
+ INST(Fscale , FpuOp , O_FPU(00,D9FD,_) , 0 , 37 , 0 , 31 , 52 ), // #252
+ INST(Fsin , FpuOp , O_FPU(00,D9FE,_) , 0 , 37 , 0 , 31 , 52 ), // #253
+ INST(Fsincos , FpuOp , O_FPU(00,D9FB,_) , 0 , 37 , 0 , 31 , 52 ), // #254
+ INST(Fsqrt , FpuOp , O_FPU(00,D9FA,_) , 0 , 37 , 0 , 31 , 52 ), // #255
+ INST(Fst , FpuFldFst , O_FPU(00,00D9,2) , 0 , 52 , 0 , 74 , 52 ), // #256
+ INST(Fstcw , X86M_Only , O_FPU(9B,00D9,7) , 0 , 59 , 0 , 72 , 52 ), // #257
+ INST(Fstenv , X86M_Only , O_FPU(9B,00D9,6) , 0 , 58 , 0 , 32 , 52 ), // #258
+ INST(Fstp , FpuFldFst , O_FPU(00,00D9,3) , O(000000,DB,7,_,_,_,_,_ ), 53 , 13 , 71 , 52 ), // #259
+ INST(Fstsw , FpuStsw , O_FPU(9B,00DD,7) , O_FPU(9B,DFE0,_) , 59 , 14 , 73 , 52 ), // #260
+ INST(Fsub , FpuArith , O_FPU(00,E0E8,4) , 0 , 60 , 0 , 64 , 52 ), // #261
+ INST(Fsubp , FpuRDef , O_FPU(00,DEE8,_) , 0 , 39 , 0 , 65 , 52 ), // #262
+ INST(Fsubr , FpuArith , O_FPU(00,E8E0,5) , 0 , 61 , 0 , 64 , 52 ), // #263
+ INST(Fsubrp , FpuRDef , O_FPU(00,DEE0,_) , 0 , 39 , 0 , 65 , 52 ), // #264
+ INST(Ftst , FpuOp , O_FPU(00,D9E4,_) , 0 , 37 , 0 , 31 , 52 ), // #265
+ INST(Fucom , FpuRDef , O_FPU(00,DDE0,_) , 0 , 50 , 0 , 65 , 52 ), // #266
+ INST(Fucomi , FpuR , O_FPU(00,DBE8,_) , 0 , 44 , 0 , 67 , 57 ), // #267
+ INST(Fucomip , FpuR , O_FPU(00,DFE8,_) , 0 , 46 , 0 , 67 , 57 ), // #268
+ INST(Fucomp , FpuRDef , O_FPU(00,DDE8,_) , 0 , 50 , 0 , 65 , 52 ), // #269
+ INST(Fucompp , FpuOp , O_FPU(00,DAE9,_) , 0 , 43 , 0 , 31 , 52 ), // #270
+ INST(Fwait , X86Op , O_FPU(00,009B,_) , 0 , 51 , 0 , 31 , 52 ), // #271
+ INST(Fxam , FpuOp , O_FPU(00,D9E5,_) , 0 , 37 , 0 , 31 , 52 ), // #272
+ INST(Fxch , FpuR , O_FPU(00,D9C8,_) , 0 , 37 , 0 , 65 , 52 ), // #273
+ INST(Fxrstor , X86M_Only , O(000F00,AE,1,_,_,_,_,_ ), 0 , 32 , 0 , 32 , 60 ), // #274
+ INST(Fxrstor64 , X86M_Only , O(000F00,AE,1,_,1,_,_,_ ), 0 , 31 , 0 , 75 , 60 ), // #275
+ INST(Fxsave , X86M_Only , O(000F00,AE,0,_,_,_,_,_ ), 0 , 5 , 0 , 32 , 61 ), // #276
+ INST(Fxsave64 , X86M_Only , O(000F00,AE,0,_,1,_,_,_ ), 0 , 62 , 0 , 75 , 61 ), // #277
+ INST(Fxtract , FpuOp , O_FPU(00,D9F4,_) , 0 , 37 , 0 , 31 , 52 ), // #278
+ INST(Fyl2x , FpuOp , O_FPU(00,D9F1,_) , 0 , 37 , 0 , 31 , 52 ), // #279
+ INST(Fyl2xp1 , FpuOp , O_FPU(00,D9F9,_) , 0 , 37 , 0 , 31 , 52 ), // #280
+ INST(Getsec , X86Op , O(000F00,37,_,_,_,_,_,_ ), 0 , 5 , 0 , 56 , 62 ), // #281
+ INST(Gf2p8affineinvqb , ExtRmi , O(660F3A,CF,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 63 ), // #282
+ INST(Gf2p8affineqb , ExtRmi , O(660F3A,CE,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 63 ), // #283
+ INST(Gf2p8mulb , ExtRm , O(660F38,CF,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 63 ), // #284
+ INST(Haddpd , ExtRm , O(660F00,7C,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 7 ), // #285
+ INST(Haddps , ExtRm , O(F20F00,7C,_,_,_,_,_,_ ), 0 , 6 , 0 , 6 , 7 ), // #286
+ INST(Hlt , X86Op , O(000000,F4,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 0 ), // #287
+ INST(Hreset , X86Op_Mod11RM_I8 , O(F30F3A,F0,0,_,_,_,_,_ ), 0 , 63 , 0 , 76 , 64 ), // #288
+ INST(Hsubpd , ExtRm , O(660F00,7D,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 7 ), // #289
+ INST(Hsubps , ExtRm , O(F20F00,7D,_,_,_,_,_,_ ), 0 , 6 , 0 , 6 , 7 ), // #290
+ INST(Idiv , X86M_GPB_MulDiv , O(000000,F6,7,_,x,_,_,_ ), 0 , 29 , 0 , 58 , 1 ), // #291
+ INST(Imul , X86Imul , O(000000,F6,5,_,x,_,_,_ ), 0 , 64 , 0 , 77 , 1 ), // #292
+ INST(In , X86In , O(000000,EC,_,_,_,_,_,_ ), O(000000,E4,_,_,_,_,_,_ ), 0 , 15 , 78 , 0 ), // #293
+ INST(Inc , X86IncDec , O(000000,FE,0,_,x,_,_,_ ), O(000000,40,_,_,x,_,_,_ ), 0 , 16 , 79 , 47 ), // #294
+ INST(Incsspd , X86M , O(F30F00,AE,5,_,0,_,_,_ ), 0 , 65 , 0 , 80 , 65 ), // #295
+ INST(Incsspq , X86M , O(F30F00,AE,5,_,1,_,_,_ ), 0 , 66 , 0 , 81 , 65 ), // #296
+ INST(Ins , X86Ins , O(000000,6C,_,_,_,_,_,_ ), 0 , 0 , 0 , 82 , 0 ), // #297
+ INST(Insertps , ExtRmi , O(660F3A,21,_,_,_,_,_,_ ), 0 , 9 , 0 , 40 , 13 ), // #298
+ INST(Insertq , ExtInsertq , O(F20F00,79,_,_,_,_,_,_ ), O(F20F00,78,_,_,_,_,_,_ ), 6 , 17 , 83 , 51 ), // #299
+ INST(Int , X86Int , O(000000,CD,_,_,_,_,_,_ ), 0 , 0 , 0 , 84 , 0 ), // #300
+ INST(Int3 , X86Op , O(000000,CC,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 0 ), // #301
+ INST(Into , X86Op , O(000000,CE,_,_,_,_,_,_ ), 0 , 0 , 0 , 85 , 66 ), // #302
+ INST(Invd , X86Op , O(000F00,08,_,_,_,_,_,_ ), 0 , 5 , 0 , 31 , 45 ), // #303
+ INST(Invept , X86Rm_NoSize , O(660F38,80,_,_,_,_,_,_ ), 0 , 2 , 0 , 86 , 67 ), // #304
+ INST(Invlpg , X86M_Only , O(000F00,01,7,_,_,_,_,_ ), 0 , 24 , 0 , 32 , 45 ), // #305
+ INST(Invlpga , X86Op_xAddr , O(000F01,DF,_,_,_,_,_,_ ), 0 , 23 , 0 , 87 , 23 ), // #306
+ INST(Invlpgb , X86Op , O(000F01,FE,_,_,_,_,_,_ ), 0 , 23 , 0 , 88 , 68 ), // #307
+ INST(Invpcid , X86Rm_NoSize , O(660F38,82,_,_,_,_,_,_ ), 0 , 2 , 0 , 86 , 45 ), // #308
+ INST(Invvpid , X86Rm_NoSize , O(660F38,81,_,_,_,_,_,_ ), 0 , 2 , 0 , 86 , 67 ), // #309
+ INST(Iret , X86Op , O(660000,CF,_,_,_,_,_,_ ), 0 , 21 , 0 , 89 , 1 ), // #310
+ INST(Iretd , X86Op , O(000000,CF,_,_,_,_,_,_ ), 0 , 0 , 0 , 89 , 1 ), // #311
+ INST(Iretq , X86Op , O(000000,CF,_,_,1,_,_,_ ), 0 , 22 , 0 , 90 , 1 ), // #312
+ INST(Ja , X86Jcc , O(000F00,87,_,_,_,_,_,_ ), O(000000,77,_,_,_,_,_,_ ), 5 , 18 , 91 , 69 ), // #313
+ INST(Jae , X86Jcc , O(000F00,83,_,_,_,_,_,_ ), O(000000,73,_,_,_,_,_,_ ), 5 , 19 , 91 , 70 ), // #314
+ INST(Jb , X86Jcc , O(000F00,82,_,_,_,_,_,_ ), O(000000,72,_,_,_,_,_,_ ), 5 , 20 , 91 , 70 ), // #315
+ INST(Jbe , X86Jcc , O(000F00,86,_,_,_,_,_,_ ), O(000000,76,_,_,_,_,_,_ ), 5 , 21 , 91 , 69 ), // #316
+ INST(Jc , X86Jcc , O(000F00,82,_,_,_,_,_,_ ), O(000000,72,_,_,_,_,_,_ ), 5 , 20 , 91 , 70 ), // #317
+ INST(Je , X86Jcc , O(000F00,84,_,_,_,_,_,_ ), O(000000,74,_,_,_,_,_,_ ), 5 , 22 , 91 , 71 ), // #318
+ INST(Jecxz , X86JecxzLoop , 0 , O(000000,E3,_,_,_,_,_,_ ), 0 , 23 , 92 , 0 ), // #319
+ INST(Jg , X86Jcc , O(000F00,8F,_,_,_,_,_,_ ), O(000000,7F,_,_,_,_,_,_ ), 5 , 24 , 91 , 72 ), // #320
+ INST(Jge , X86Jcc , O(000F00,8D,_,_,_,_,_,_ ), O(000000,7D,_,_,_,_,_,_ ), 5 , 25 , 91 , 73 ), // #321
+ INST(Jl , X86Jcc , O(000F00,8C,_,_,_,_,_,_ ), O(000000,7C,_,_,_,_,_,_ ), 5 , 26 , 91 , 73 ), // #322
+ INST(Jle , X86Jcc , O(000F00,8E,_,_,_,_,_,_ ), O(000000,7E,_,_,_,_,_,_ ), 5 , 27 , 91 , 72 ), // #323
+ INST(Jmp , X86Jmp , O(000000,FF,4,_,_,_,_,_ ), O(000000,EB,_,_,_,_,_,_ ), 10 , 28 , 93 , 0 ), // #324
+ INST(Jna , X86Jcc , O(000F00,86,_,_,_,_,_,_ ), O(000000,76,_,_,_,_,_,_ ), 5 , 21 , 91 , 69 ), // #325
+ INST(Jnae , X86Jcc , O(000F00,82,_,_,_,_,_,_ ), O(000000,72,_,_,_,_,_,_ ), 5 , 20 , 91 , 70 ), // #326
+ INST(Jnb , X86Jcc , O(000F00,83,_,_,_,_,_,_ ), O(000000,73,_,_,_,_,_,_ ), 5 , 19 , 91 , 70 ), // #327
+ INST(Jnbe , X86Jcc , O(000F00,87,_,_,_,_,_,_ ), O(000000,77,_,_,_,_,_,_ ), 5 , 18 , 91 , 69 ), // #328
+ INST(Jnc , X86Jcc , O(000F00,83,_,_,_,_,_,_ ), O(000000,73,_,_,_,_,_,_ ), 5 , 19 , 91 , 70 ), // #329
+ INST(Jne , X86Jcc , O(000F00,85,_,_,_,_,_,_ ), O(000000,75,_,_,_,_,_,_ ), 5 , 29 , 91 , 71 ), // #330
+ INST(Jng , X86Jcc , O(000F00,8E,_,_,_,_,_,_ ), O(000000,7E,_,_,_,_,_,_ ), 5 , 27 , 91 , 72 ), // #331
+ INST(Jnge , X86Jcc , O(000F00,8C,_,_,_,_,_,_ ), O(000000,7C,_,_,_,_,_,_ ), 5 , 26 , 91 , 73 ), // #332
+ INST(Jnl , X86Jcc , O(000F00,8D,_,_,_,_,_,_ ), O(000000,7D,_,_,_,_,_,_ ), 5 , 25 , 91 , 73 ), // #333
+ INST(Jnle , X86Jcc , O(000F00,8F,_,_,_,_,_,_ ), O(000000,7F,_,_,_,_,_,_ ), 5 , 24 , 91 , 72 ), // #334
+ INST(Jno , X86Jcc , O(000F00,81,_,_,_,_,_,_ ), O(000000,71,_,_,_,_,_,_ ), 5 , 30 , 91 , 66 ), // #335
+ INST(Jnp , X86Jcc , O(000F00,8B,_,_,_,_,_,_ ), O(000000,7B,_,_,_,_,_,_ ), 5 , 31 , 91 , 74 ), // #336
+ INST(Jns , X86Jcc , O(000F00,89,_,_,_,_,_,_ ), O(000000,79,_,_,_,_,_,_ ), 5 , 32 , 91 , 75 ), // #337
+ INST(Jnz , X86Jcc , O(000F00,85,_,_,_,_,_,_ ), O(000000,75,_,_,_,_,_,_ ), 5 , 29 , 91 , 71 ), // #338
+ INST(Jo , X86Jcc , O(000F00,80,_,_,_,_,_,_ ), O(000000,70,_,_,_,_,_,_ ), 5 , 33 , 91 , 66 ), // #339
+ INST(Jp , X86Jcc , O(000F00,8A,_,_,_,_,_,_ ), O(000000,7A,_,_,_,_,_,_ ), 5 , 34 , 91 , 74 ), // #340
+ INST(Jpe , X86Jcc , O(000F00,8A,_,_,_,_,_,_ ), O(000000,7A,_,_,_,_,_,_ ), 5 , 34 , 91 , 74 ), // #341
+ INST(Jpo , X86Jcc , O(000F00,8B,_,_,_,_,_,_ ), O(000000,7B,_,_,_,_,_,_ ), 5 , 31 , 91 , 74 ), // #342
+ INST(Js , X86Jcc , O(000F00,88,_,_,_,_,_,_ ), O(000000,78,_,_,_,_,_,_ ), 5 , 35 , 91 , 75 ), // #343
+ INST(Jz , X86Jcc , O(000F00,84,_,_,_,_,_,_ ), O(000000,74,_,_,_,_,_,_ ), 5 , 22 , 91 , 71 ), // #344
+ INST(Kaddb , VexRvm , V(660F00,4A,_,1,0,_,_,_ ), 0 , 67 , 0 , 94 , 76 ), // #345
+ INST(Kaddd , VexRvm , V(660F00,4A,_,1,1,_,_,_ ), 0 , 68 , 0 , 94 , 77 ), // #346
+ INST(Kaddq , VexRvm , V(000F00,4A,_,1,1,_,_,_ ), 0 , 69 , 0 , 94 , 77 ), // #347
+ INST(Kaddw , VexRvm , V(000F00,4A,_,1,0,_,_,_ ), 0 , 70 , 0 , 94 , 76 ), // #348
+ INST(Kandb , VexRvm , V(660F00,41,_,1,0,_,_,_ ), 0 , 67 , 0 , 94 , 76 ), // #349
+ INST(Kandd , VexRvm , V(660F00,41,_,1,1,_,_,_ ), 0 , 68 , 0 , 94 , 77 ), // #350
+ INST(Kandnb , VexRvm , V(660F00,42,_,1,0,_,_,_ ), 0 , 67 , 0 , 94 , 76 ), // #351
+ INST(Kandnd , VexRvm , V(660F00,42,_,1,1,_,_,_ ), 0 , 68 , 0 , 94 , 77 ), // #352
+ INST(Kandnq , VexRvm , V(000F00,42,_,1,1,_,_,_ ), 0 , 69 , 0 , 94 , 77 ), // #353
+ INST(Kandnw , VexRvm , V(000F00,42,_,1,0,_,_,_ ), 0 , 70 , 0 , 94 , 78 ), // #354
+ INST(Kandq , VexRvm , V(000F00,41,_,1,1,_,_,_ ), 0 , 69 , 0 , 94 , 77 ), // #355
+ INST(Kandw , VexRvm , V(000F00,41,_,1,0,_,_,_ ), 0 , 70 , 0 , 94 , 78 ), // #356
+ INST(Kmovb , VexKmov , V(660F00,90,_,0,0,_,_,_ ), V(660F00,92,_,0,0,_,_,_ ), 71 , 36 , 95 , 79 ), // #357
+ INST(Kmovd , VexKmov , V(660F00,90,_,0,1,_,_,_ ), V(F20F00,92,_,0,0,_,_,_ ), 72 , 37 , 96 , 80 ), // #358
+ INST(Kmovq , VexKmov , V(000F00,90,_,0,1,_,_,_ ), V(F20F00,92,_,0,1,_,_,_ ), 73 , 38 , 97 , 80 ), // #359
+ INST(Kmovw , VexKmov , V(000F00,90,_,0,0,_,_,_ ), V(000F00,92,_,0,0,_,_,_ ), 74 , 39 , 98 , 81 ), // #360
+ INST(Knotb , VexRm , V(660F00,44,_,0,0,_,_,_ ), 0 , 71 , 0 , 99 , 76 ), // #361
+ INST(Knotd , VexRm , V(660F00,44,_,0,1,_,_,_ ), 0 , 72 , 0 , 99 , 77 ), // #362
+ INST(Knotq , VexRm , V(000F00,44,_,0,1,_,_,_ ), 0 , 73 , 0 , 99 , 77 ), // #363
+ INST(Knotw , VexRm , V(000F00,44,_,0,0,_,_,_ ), 0 , 74 , 0 , 99 , 78 ), // #364
+ INST(Korb , VexRvm , V(660F00,45,_,1,0,_,_,_ ), 0 , 67 , 0 , 94 , 76 ), // #365
+ INST(Kord , VexRvm , V(660F00,45,_,1,1,_,_,_ ), 0 , 68 , 0 , 94 , 77 ), // #366
+ INST(Korq , VexRvm , V(000F00,45,_,1,1,_,_,_ ), 0 , 69 , 0 , 94 , 77 ), // #367
+ INST(Kortestb , VexRm , V(660F00,98,_,0,0,_,_,_ ), 0 , 71 , 0 , 99 , 82 ), // #368
+ INST(Kortestd , VexRm , V(660F00,98,_,0,1,_,_,_ ), 0 , 72 , 0 , 99 , 83 ), // #369
+ INST(Kortestq , VexRm , V(000F00,98,_,0,1,_,_,_ ), 0 , 73 , 0 , 99 , 83 ), // #370
+ INST(Kortestw , VexRm , V(000F00,98,_,0,0,_,_,_ ), 0 , 74 , 0 , 99 , 84 ), // #371
+ INST(Korw , VexRvm , V(000F00,45,_,1,0,_,_,_ ), 0 , 70 , 0 , 94 , 78 ), // #372
+ INST(Kshiftlb , VexRmi , V(660F3A,32,_,0,0,_,_,_ ), 0 , 75 , 0 , 100, 76 ), // #373
+ INST(Kshiftld , VexRmi , V(660F3A,33,_,0,0,_,_,_ ), 0 , 75 , 0 , 100, 77 ), // #374
+ INST(Kshiftlq , VexRmi , V(660F3A,33,_,0,1,_,_,_ ), 0 , 76 , 0 , 100, 77 ), // #375
+ INST(Kshiftlw , VexRmi , V(660F3A,32,_,0,1,_,_,_ ), 0 , 76 , 0 , 100, 78 ), // #376
+ INST(Kshiftrb , VexRmi , V(660F3A,30,_,0,0,_,_,_ ), 0 , 75 , 0 , 100, 76 ), // #377
+ INST(Kshiftrd , VexRmi , V(660F3A,31,_,0,0,_,_,_ ), 0 , 75 , 0 , 100, 77 ), // #378
+ INST(Kshiftrq , VexRmi , V(660F3A,31,_,0,1,_,_,_ ), 0 , 76 , 0 , 100, 77 ), // #379
+ INST(Kshiftrw , VexRmi , V(660F3A,30,_,0,1,_,_,_ ), 0 , 76 , 0 , 100, 78 ), // #380
+ INST(Ktestb , VexRm , V(660F00,99,_,0,0,_,_,_ ), 0 , 71 , 0 , 99 , 82 ), // #381
+ INST(Ktestd , VexRm , V(660F00,99,_,0,1,_,_,_ ), 0 , 72 , 0 , 99 , 83 ), // #382
+ INST(Ktestq , VexRm , V(000F00,99,_,0,1,_,_,_ ), 0 , 73 , 0 , 99 , 83 ), // #383
+ INST(Ktestw , VexRm , V(000F00,99,_,0,0,_,_,_ ), 0 , 74 , 0 , 99 , 82 ), // #384
+ INST(Kunpckbw , VexRvm , V(660F00,4B,_,1,0,_,_,_ ), 0 , 67 , 0 , 94 , 78 ), // #385
+ INST(Kunpckdq , VexRvm , V(000F00,4B,_,1,1,_,_,_ ), 0 , 69 , 0 , 94 , 77 ), // #386
+ INST(Kunpckwd , VexRvm , V(000F00,4B,_,1,0,_,_,_ ), 0 , 70 , 0 , 94 , 77 ), // #387
+ INST(Kxnorb , VexRvm , V(660F00,46,_,1,0,_,_,_ ), 0 , 67 , 0 , 101, 76 ), // #388
+ INST(Kxnord , VexRvm , V(660F00,46,_,1,1,_,_,_ ), 0 , 68 , 0 , 101, 77 ), // #389
+ INST(Kxnorq , VexRvm , V(000F00,46,_,1,1,_,_,_ ), 0 , 69 , 0 , 101, 77 ), // #390
+ INST(Kxnorw , VexRvm , V(000F00,46,_,1,0,_,_,_ ), 0 , 70 , 0 , 101, 78 ), // #391
+ INST(Kxorb , VexRvm , V(660F00,47,_,1,0,_,_,_ ), 0 , 67 , 0 , 101, 76 ), // #392
+ INST(Kxord , VexRvm , V(660F00,47,_,1,1,_,_,_ ), 0 , 68 , 0 , 101, 77 ), // #393
+ INST(Kxorq , VexRvm , V(000F00,47,_,1,1,_,_,_ ), 0 , 69 , 0 , 101, 77 ), // #394
+ INST(Kxorw , VexRvm , V(000F00,47,_,1,0,_,_,_ ), 0 , 70 , 0 , 101, 78 ), // #395
+ INST(Lahf , X86Op , O(000000,9F,_,_,_,_,_,_ ), 0 , 0 , 0 , 102, 85 ), // #396
+ INST(Lar , X86Rm , O(000F00,02,_,_,_,_,_,_ ), 0 , 5 , 0 , 103, 11 ), // #397
+ INST(Lcall , X86LcallLjmp , O(000000,FF,3,_,_,_,_,_ ), O(000000,9A,_,_,_,_,_,_ ), 77 , 40 , 104, 1 ), // #398
+ INST(Lddqu , ExtRm , O(F20F00,F0,_,_,_,_,_,_ ), 0 , 6 , 0 , 105, 7 ), // #399
+ INST(Ldmxcsr , X86M_Only , O(000F00,AE,2,_,_,_,_,_ ), 0 , 78 , 0 , 106, 6 ), // #400
+ INST(Lds , X86Rm , O(000000,C5,_,_,_,_,_,_ ), 0 , 0 , 0 , 107, 0 ), // #401
+ INST(Ldtilecfg , AmxCfg , V(000F38,49,_,0,0,_,_,_ ), 0 , 11 , 0 , 108, 86 ), // #402
+ INST(Lea , X86Lea , O(000000,8D,_,_,x,_,_,_ ), 0 , 0 , 0 , 109, 0 ), // #403
+ INST(Leave , X86Op , O(000000,C9,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 0 ), // #404
+ INST(Les , X86Rm , O(000000,C4,_,_,_,_,_,_ ), 0 , 0 , 0 , 107, 0 ), // #405
+ INST(Lfence , X86Fence , O(000F00,AE,5,_,_,_,_,_ ), 0 , 79 , 0 , 31 , 5 ), // #406
+ INST(Lfs , X86Rm , O(000F00,B4,_,_,_,_,_,_ ), 0 , 5 , 0 , 110, 0 ), // #407
+ INST(Lgdt , X86M_Only , O(000F00,01,2,_,_,_,_,_ ), 0 , 78 , 0 , 32 , 0 ), // #408
+ INST(Lgs , X86Rm , O(000F00,B5,_,_,_,_,_,_ ), 0 , 5 , 0 , 110, 0 ), // #409
+ INST(Lidt , X86M_Only , O(000F00,01,3,_,_,_,_,_ ), 0 , 80 , 0 , 32 , 0 ), // #410
+ INST(Ljmp , X86LcallLjmp , O(000000,FF,5,_,_,_,_,_ ), O(000000,EA,_,_,_,_,_,_ ), 64 , 41 , 111, 0 ), // #411
+ INST(Lldt , X86M_NoSize , O(000F00,00,2,_,_,_,_,_ ), 0 , 78 , 0 , 112, 0 ), // #412
+ INST(Llwpcb , VexR_Wx , V(XOP_M9,12,0,0,x,_,_,_ ), 0 , 81 , 0 , 113, 87 ), // #413
+ INST(Lmsw , X86M_NoSize , O(000F00,01,6,_,_,_,_,_ ), 0 , 82 , 0 , 112, 0 ), // #414
+ INST(Lods , X86StrRm , O(000000,AC,_,_,_,_,_,_ ), 0 , 0 , 0 , 114, 88 ), // #415
+ INST(Loop , X86JecxzLoop , 0 , O(000000,E2,_,_,_,_,_,_ ), 0 , 42 , 115, 0 ), // #416
+ INST(Loope , X86JecxzLoop , 0 , O(000000,E1,_,_,_,_,_,_ ), 0 , 43 , 115, 71 ), // #417
+ INST(Loopne , X86JecxzLoop , 0 , O(000000,E0,_,_,_,_,_,_ ), 0 , 44 , 115, 71 ), // #418
+ INST(Lsl , X86Rm , O(000F00,03,_,_,_,_,_,_ ), 0 , 5 , 0 , 116, 11 ), // #419
+ INST(Lss , X86Rm , O(000F00,B2,_,_,_,_,_,_ ), 0 , 5 , 0 , 110, 0 ), // #420
+ INST(Ltr , X86M_NoSize , O(000F00,00,3,_,_,_,_,_ ), 0 , 80 , 0 , 112, 0 ), // #421
+ INST(Lwpins , VexVmi4_Wx , V(XOP_MA,12,0,0,x,_,_,_ ), 0 , 83 , 0 , 117, 87 ), // #422
+ INST(Lwpval , VexVmi4_Wx , V(XOP_MA,12,1,0,x,_,_,_ ), 0 , 84 , 0 , 117, 87 ), // #423
+ INST(Lzcnt , X86Rm_Raw66H , O(F30F00,BD,_,_,x,_,_,_ ), 0 , 7 , 0 , 23 , 89 ), // #424
+ INST(Maskmovdqu , ExtRm_ZDI , O(660F00,F7,_,_,_,_,_,_ ), 0 , 4 , 0 , 118, 5 ), // #425
+ INST(Maskmovq , ExtRm_ZDI , O(000F00,F7,_,_,_,_,_,_ ), 0 , 5 , 0 , 119, 90 ), // #426
+ INST(Maxpd , ExtRm , O(660F00,5F,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #427
+ INST(Maxps , ExtRm , O(000F00,5F,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #428
+ INST(Maxsd , ExtRm , O(F20F00,5F,_,_,_,_,_,_ ), 0 , 6 , 0 , 7 , 5 ), // #429
+ INST(Maxss , ExtRm , O(F30F00,5F,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 6 ), // #430
+ INST(Mcommit , X86Op , O(F30F01,FA,_,_,_,_,_,_ ), 0 , 27 , 0 , 31 , 91 ), // #431
+ INST(Mfence , X86Fence , O(000F00,AE,6,_,_,_,_,_ ), 0 , 82 , 0 , 31 , 5 ), // #432
+ INST(Minpd , ExtRm , O(660F00,5D,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #433
+ INST(Minps , ExtRm , O(000F00,5D,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #434
+ INST(Minsd , ExtRm , O(F20F00,5D,_,_,_,_,_,_ ), 0 , 6 , 0 , 7 , 5 ), // #435
+ INST(Minss , ExtRm , O(F30F00,5D,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 6 ), // #436
+ INST(Monitor , X86Op , O(000F01,C8,_,_,_,_,_,_ ), 0 , 23 , 0 , 120, 92 ), // #437
+ INST(Monitorx , X86Op , O(000F01,FA,_,_,_,_,_,_ ), 0 , 23 , 0 , 120, 93 ), // #438
+ INST(Mov , X86Mov , 0 , 0 , 0 , 0 , 121, 94 ), // #439
+ INST(Movabs , X86Movabs , 0 , 0 , 0 , 0 , 122, 0 ), // #440
+ INST(Movapd , ExtMov , O(660F00,28,_,_,_,_,_,_ ), O(660F00,29,_,_,_,_,_,_ ), 4 , 45 , 123, 95 ), // #441
+ INST(Movaps , ExtMov , O(000F00,28,_,_,_,_,_,_ ), O(000F00,29,_,_,_,_,_,_ ), 5 , 46 , 123, 96 ), // #442
+ INST(Movbe , ExtMovbe , O(000F38,F0,_,_,x,_,_,_ ), O(000F38,F1,_,_,x,_,_,_ ), 1 , 47 , 124, 97 ), // #443
+ INST(Movd , ExtMovd , O(000F00,6E,_,_,_,_,_,_ ), O(000F00,7E,_,_,_,_,_,_ ), 5 , 48 , 125, 98 ), // #444
+ INST(Movddup , ExtMov , O(F20F00,12,_,_,_,_,_,_ ), 0 , 6 , 0 , 7 , 7 ), // #445
+ INST(Movdir64b , X86EnqcmdMovdir64b , O(660F38,F8,_,_,_,_,_,_ ), 0 , 2 , 0 , 126, 99 ), // #446
+ INST(Movdiri , X86MovntiMovdiri , O(000F38,F9,_,_,_,_,_,_ ), 0 , 1 , 0 , 3 , 100), // #447
+ INST(Movdq2q , ExtMov , O(F20F00,D6,_,_,_,_,_,_ ), 0 , 6 , 0 , 127, 5 ), // #448
+ INST(Movdqa , ExtMov , O(660F00,6F,_,_,_,_,_,_ ), O(660F00,7F,_,_,_,_,_,_ ), 4 , 49 , 123, 95 ), // #449
+ INST(Movdqu , ExtMov , O(F30F00,6F,_,_,_,_,_,_ ), O(F30F00,7F,_,_,_,_,_,_ ), 7 , 50 , 123, 95 ), // #450
+ INST(Movhlps , ExtMov , O(000F00,12,_,_,_,_,_,_ ), 0 , 5 , 0 , 128, 6 ), // #451
+ INST(Movhpd , ExtMov , O(660F00,16,_,_,_,_,_,_ ), O(660F00,17,_,_,_,_,_,_ ), 4 , 51 , 129, 5 ), // #452
+ INST(Movhps , ExtMov , O(000F00,16,_,_,_,_,_,_ ), O(000F00,17,_,_,_,_,_,_ ), 5 , 52 , 129, 6 ), // #453
+ INST(Movlhps , ExtMov , O(000F00,16,_,_,_,_,_,_ ), 0 , 5 , 0 , 128, 6 ), // #454
+ INST(Movlpd , ExtMov , O(660F00,12,_,_,_,_,_,_ ), O(660F00,13,_,_,_,_,_,_ ), 4 , 53 , 129, 5 ), // #455
+ INST(Movlps , ExtMov , O(000F00,12,_,_,_,_,_,_ ), O(000F00,13,_,_,_,_,_,_ ), 5 , 54 , 129, 6 ), // #456
+ INST(Movmskpd , ExtMov , O(660F00,50,_,_,_,_,_,_ ), 0 , 4 , 0 , 130, 5 ), // #457
+ INST(Movmskps , ExtMov , O(000F00,50,_,_,_,_,_,_ ), 0 , 5 , 0 , 130, 6 ), // #458
+ INST(Movntdq , ExtMov , 0 , O(660F00,E7,_,_,_,_,_,_ ), 0 , 55 , 131, 5 ), // #459
+ INST(Movntdqa , ExtMov , O(660F38,2A,_,_,_,_,_,_ ), 0 , 2 , 0 , 105, 13 ), // #460
+ INST(Movnti , X86MovntiMovdiri , O(000F00,C3,_,_,x,_,_,_ ), 0 , 5 , 0 , 3 , 5 ), // #461
+ INST(Movntpd , ExtMov , 0 , O(660F00,2B,_,_,_,_,_,_ ), 0 , 56 , 131, 5 ), // #462
+ INST(Movntps , ExtMov , 0 , O(000F00,2B,_,_,_,_,_,_ ), 0 , 57 , 131, 6 ), // #463
+ INST(Movntq , ExtMov , 0 , O(000F00,E7,_,_,_,_,_,_ ), 0 , 58 , 132, 90 ), // #464
+ INST(Movntsd , ExtMov , 0 , O(F20F00,2B,_,_,_,_,_,_ ), 0 , 59 , 133, 51 ), // #465
+ INST(Movntss , ExtMov , 0 , O(F30F00,2B,_,_,_,_,_,_ ), 0 , 60 , 134, 51 ), // #466
+ INST(Movq , ExtMovq , O(000F00,6E,_,_,x,_,_,_ ), O(000F00,7E,_,_,x,_,_,_ ), 5 , 48 , 135, 101), // #467
+ INST(Movq2dq , ExtRm , O(F30F00,D6,_,_,_,_,_,_ ), 0 , 7 , 0 , 136, 5 ), // #468
+ INST(Movs , X86StrMm , O(000000,A4,_,_,_,_,_,_ ), 0 , 0 , 0 , 137, 88 ), // #469
+ INST(Movsd , ExtMov , O(F20F00,10,_,_,_,_,_,_ ), O(F20F00,11,_,_,_,_,_,_ ), 6 , 61 , 138, 95 ), // #470
+ INST(Movshdup , ExtRm , O(F30F00,16,_,_,_,_,_,_ ), 0 , 7 , 0 , 6 , 7 ), // #471
+ INST(Movsldup , ExtRm , O(F30F00,12,_,_,_,_,_,_ ), 0 , 7 , 0 , 6 , 7 ), // #472
+ INST(Movss , ExtMov , O(F30F00,10,_,_,_,_,_,_ ), O(F30F00,11,_,_,_,_,_,_ ), 7 , 62 , 139, 96 ), // #473
+ INST(Movsx , X86MovsxMovzx , O(000F00,BE,_,_,x,_,_,_ ), 0 , 5 , 0 , 140, 0 ), // #474
+ INST(Movsxd , X86Rm , O(000000,63,_,_,x,_,_,_ ), 0 , 0 , 0 , 141, 0 ), // #475
+ INST(Movupd , ExtMov , O(660F00,10,_,_,_,_,_,_ ), O(660F00,11,_,_,_,_,_,_ ), 4 , 63 , 123, 95 ), // #476
+ INST(Movups , ExtMov , O(000F00,10,_,_,_,_,_,_ ), O(000F00,11,_,_,_,_,_,_ ), 5 , 64 , 123, 96 ), // #477
+ INST(Movzx , X86MovsxMovzx , O(000F00,B6,_,_,x,_,_,_ ), 0 , 5 , 0 , 140, 0 ), // #478
+ INST(Mpsadbw , ExtRmi , O(660F3A,42,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 13 ), // #479
+ INST(Mul , X86M_GPB_MulDiv , O(000000,F6,4,_,x,_,_,_ ), 0 , 10 , 0 , 58 , 1 ), // #480
+ INST(Mulpd , ExtRm , O(660F00,59,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #481
+ INST(Mulps , ExtRm , O(000F00,59,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #482
+ INST(Mulsd , ExtRm , O(F20F00,59,_,_,_,_,_,_ ), 0 , 6 , 0 , 7 , 5 ), // #483
+ INST(Mulss , ExtRm , O(F30F00,59,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 6 ), // #484
+ INST(Mulx , VexRvm_ZDX_Wx , V(F20F38,F6,_,0,x,_,_,_ ), 0 , 85 , 0 , 142, 102), // #485
+ INST(Mwait , X86Op , O(000F01,C9,_,_,_,_,_,_ ), 0 , 23 , 0 , 143, 92 ), // #486
+ INST(Mwaitx , X86Op , O(000F01,FB,_,_,_,_,_,_ ), 0 , 23 , 0 , 144, 93 ), // #487
+ INST(Neg , X86M_GPB , O(000000,F6,3,_,x,_,_,_ ), 0 , 77 , 0 , 145, 1 ), // #488
+ INST(Nop , X86M_Nop , O(000000,90,_,_,_,_,_,_ ), 0 , 0 , 0 , 146, 0 ), // #489
+ INST(Not , X86M_GPB , O(000000,F6,2,_,x,_,_,_ ), 0 , 3 , 0 , 145, 0 ), // #490
+ INST(Or , X86Arith , O(000000,08,1,_,x,_,_,_ ), 0 , 33 , 0 , 147, 1 ), // #491
+ INST(Orpd , ExtRm , O(660F00,56,_,_,_,_,_,_ ), 0 , 4 , 0 , 12 , 5 ), // #492
+ INST(Orps , ExtRm , O(000F00,56,_,_,_,_,_,_ ), 0 , 5 , 0 , 12 , 6 ), // #493
+ INST(Out , X86Out , O(000000,EE,_,_,_,_,_,_ ), O(000000,E6,_,_,_,_,_,_ ), 0 , 65 , 148, 0 ), // #494
+ INST(Outs , X86Outs , O(000000,6E,_,_,_,_,_,_ ), 0 , 0 , 0 , 149, 0 ), // #495
+ INST(Pabsb , ExtRm_P , O(000F38,1C,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #496
+ INST(Pabsd , ExtRm_P , O(000F38,1E,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #497
+ INST(Pabsw , ExtRm_P , O(000F38,1D,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #498
+ INST(Packssdw , ExtRm_P , O(000F00,6B,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #499
+ INST(Packsswb , ExtRm_P , O(000F00,63,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #500
+ INST(Packusdw , ExtRm , O(660F38,2B,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 13 ), // #501
+ INST(Packuswb , ExtRm_P , O(000F00,67,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #502
+ INST(Paddb , ExtRm_P , O(000F00,FC,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #503
+ INST(Paddd , ExtRm_P , O(000F00,FE,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #504
+ INST(Paddq , ExtRm_P , O(000F00,D4,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 5 ), // #505
+ INST(Paddsb , ExtRm_P , O(000F00,EC,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #506
+ INST(Paddsw , ExtRm_P , O(000F00,ED,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #507
+ INST(Paddusb , ExtRm_P , O(000F00,DC,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #508
+ INST(Paddusw , ExtRm_P , O(000F00,DD,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #509
+ INST(Paddw , ExtRm_P , O(000F00,FD,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #510
+ INST(Palignr , ExtRmi_P , O(000F3A,0F,_,_,_,_,_,_ ), 0 , 86 , 0 , 151, 103), // #511
+ INST(Pand , ExtRm_P , O(000F00,DB,_,_,_,_,_,_ ), 0 , 5 , 0 , 152, 98 ), // #512
+ INST(Pandn , ExtRm_P , O(000F00,DF,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #513
+ INST(Pause , X86Op , O(F30000,90,_,_,_,_,_,_ ), 0 , 87 , 0 , 31 , 0 ), // #514
+ INST(Pavgb , ExtRm_P , O(000F00,E0,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 104), // #515
+ INST(Pavgusb , Ext3dNow , O(000F0F,BF,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #516
+ INST(Pavgw , ExtRm_P , O(000F00,E3,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 104), // #517
+ INST(Pblendvb , ExtRm_XMM0 , O(660F38,10,_,_,_,_,_,_ ), 0 , 2 , 0 , 16 , 13 ), // #518
+ INST(Pblendw , ExtRmi , O(660F3A,0E,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 13 ), // #519
+ INST(Pclmulqdq , ExtRmi , O(660F3A,44,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 105), // #520
+ INST(Pcmpeqb , ExtRm_P , O(000F00,74,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #521
+ INST(Pcmpeqd , ExtRm_P , O(000F00,76,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #522
+ INST(Pcmpeqq , ExtRm , O(660F38,29,_,_,_,_,_,_ ), 0 , 2 , 0 , 155, 13 ), // #523
+ INST(Pcmpeqw , ExtRm_P , O(000F00,75,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #524
+ INST(Pcmpestri , ExtRmi , O(660F3A,61,_,_,_,_,_,_ ), 0 , 9 , 0 , 156, 106), // #525
+ INST(Pcmpestrm , ExtRmi , O(660F3A,60,_,_,_,_,_,_ ), 0 , 9 , 0 , 157, 106), // #526
+ INST(Pcmpgtb , ExtRm_P , O(000F00,64,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #527
+ INST(Pcmpgtd , ExtRm_P , O(000F00,66,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #528
+ INST(Pcmpgtq , ExtRm , O(660F38,37,_,_,_,_,_,_ ), 0 , 2 , 0 , 155, 46 ), // #529
+ INST(Pcmpgtw , ExtRm_P , O(000F00,65,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #530
+ INST(Pcmpistri , ExtRmi , O(660F3A,63,_,_,_,_,_,_ ), 0 , 9 , 0 , 158, 106), // #531
+ INST(Pcmpistrm , ExtRmi , O(660F3A,62,_,_,_,_,_,_ ), 0 , 9 , 0 , 159, 106), // #532
+ INST(Pconfig , X86Op , O(000F01,C5,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 107), // #533
+ INST(Pdep , VexRvm_Wx , V(F20F38,F5,_,0,x,_,_,_ ), 0 , 85 , 0 , 11 , 102), // #534
+ INST(Pext , VexRvm_Wx , V(F30F38,F5,_,0,x,_,_,_ ), 0 , 89 , 0 , 11 , 102), // #535
+ INST(Pextrb , ExtExtract , O(000F3A,14,_,_,_,_,_,_ ), 0 , 86 , 0 , 160, 13 ), // #536
+ INST(Pextrd , ExtExtract , O(000F3A,16,_,_,_,_,_,_ ), 0 , 86 , 0 , 62 , 13 ), // #537
+ INST(Pextrq , ExtExtract , O(000F3A,16,_,_,1,_,_,_ ), 0 , 90 , 0 , 161, 13 ), // #538
+ INST(Pextrw , ExtPextrw , O(000F00,C5,_,_,_,_,_,_ ), O(000F3A,15,_,_,_,_,_,_ ), 5 , 66 , 162, 108), // #539
+ INST(Pf2id , Ext3dNow , O(000F0F,1D,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #540
+ INST(Pf2iw , Ext3dNow , O(000F0F,1C,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 109), // #541
+ INST(Pfacc , Ext3dNow , O(000F0F,AE,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #542
+ INST(Pfadd , Ext3dNow , O(000F0F,9E,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #543
+ INST(Pfcmpeq , Ext3dNow , O(000F0F,B0,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #544
+ INST(Pfcmpge , Ext3dNow , O(000F0F,90,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #545
+ INST(Pfcmpgt , Ext3dNow , O(000F0F,A0,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #546
+ INST(Pfmax , Ext3dNow , O(000F0F,A4,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #547
+ INST(Pfmin , Ext3dNow , O(000F0F,94,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #548
+ INST(Pfmul , Ext3dNow , O(000F0F,B4,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #549
+ INST(Pfnacc , Ext3dNow , O(000F0F,8A,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 109), // #550
+ INST(Pfpnacc , Ext3dNow , O(000F0F,8E,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 109), // #551
+ INST(Pfrcp , Ext3dNow , O(000F0F,96,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #552
+ INST(Pfrcpit1 , Ext3dNow , O(000F0F,A6,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #553
+ INST(Pfrcpit2 , Ext3dNow , O(000F0F,B6,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #554
+ INST(Pfrcpv , Ext3dNow , O(000F0F,86,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 110), // #555
+ INST(Pfrsqit1 , Ext3dNow , O(000F0F,A7,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #556
+ INST(Pfrsqrt , Ext3dNow , O(000F0F,97,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #557
+ INST(Pfrsqrtv , Ext3dNow , O(000F0F,87,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 110), // #558
+ INST(Pfsub , Ext3dNow , O(000F0F,9A,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #559
+ INST(Pfsubr , Ext3dNow , O(000F0F,AA,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #560
+ INST(Phaddd , ExtRm_P , O(000F38,02,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #561
+ INST(Phaddsw , ExtRm_P , O(000F38,03,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #562
+ INST(Phaddw , ExtRm_P , O(000F38,01,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #563
+ INST(Phminposuw , ExtRm , O(660F38,41,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 13 ), // #564
+ INST(Phsubd , ExtRm_P , O(000F38,06,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #565
+ INST(Phsubsw , ExtRm_P , O(000F38,07,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #566
+ INST(Phsubw , ExtRm_P , O(000F38,05,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #567
+ INST(Pi2fd , Ext3dNow , O(000F0F,0D,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #568
+ INST(Pi2fw , Ext3dNow , O(000F0F,0C,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 109), // #569
+ INST(Pinsrb , ExtRmi , O(660F3A,20,_,_,_,_,_,_ ), 0 , 9 , 0 , 163, 13 ), // #570
+ INST(Pinsrd , ExtRmi , O(660F3A,22,_,_,_,_,_,_ ), 0 , 9 , 0 , 164, 13 ), // #571
+ INST(Pinsrq , ExtRmi , O(660F3A,22,_,_,1,_,_,_ ), 0 , 91 , 0 , 165, 13 ), // #572
+ INST(Pinsrw , ExtRmi_P , O(000F00,C4,_,_,_,_,_,_ ), 0 , 5 , 0 , 166, 104), // #573
+ INST(Pmaddubsw , ExtRm_P , O(000F38,04,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #574
+ INST(Pmaddwd , ExtRm_P , O(000F00,F5,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #575
+ INST(Pmaxsb , ExtRm , O(660F38,3C,_,_,_,_,_,_ ), 0 , 2 , 0 , 12 , 13 ), // #576
+ INST(Pmaxsd , ExtRm , O(660F38,3D,_,_,_,_,_,_ ), 0 , 2 , 0 , 12 , 13 ), // #577
+ INST(Pmaxsw , ExtRm_P , O(000F00,EE,_,_,_,_,_,_ ), 0 , 5 , 0 , 152, 104), // #578
+ INST(Pmaxub , ExtRm_P , O(000F00,DE,_,_,_,_,_,_ ), 0 , 5 , 0 , 152, 104), // #579
+ INST(Pmaxud , ExtRm , O(660F38,3F,_,_,_,_,_,_ ), 0 , 2 , 0 , 12 , 13 ), // #580
+ INST(Pmaxuw , ExtRm , O(660F38,3E,_,_,_,_,_,_ ), 0 , 2 , 0 , 12 , 13 ), // #581
+ INST(Pminsb , ExtRm , O(660F38,38,_,_,_,_,_,_ ), 0 , 2 , 0 , 12 , 13 ), // #582
+ INST(Pminsd , ExtRm , O(660F38,39,_,_,_,_,_,_ ), 0 , 2 , 0 , 12 , 13 ), // #583
+ INST(Pminsw , ExtRm_P , O(000F00,EA,_,_,_,_,_,_ ), 0 , 5 , 0 , 152, 104), // #584
+ INST(Pminub , ExtRm_P , O(000F00,DA,_,_,_,_,_,_ ), 0 , 5 , 0 , 152, 104), // #585
+ INST(Pminud , ExtRm , O(660F38,3B,_,_,_,_,_,_ ), 0 , 2 , 0 , 12 , 13 ), // #586
+ INST(Pminuw , ExtRm , O(660F38,3A,_,_,_,_,_,_ ), 0 , 2 , 0 , 12 , 13 ), // #587
+ INST(Pmovmskb , ExtRm_P , O(000F00,D7,_,_,_,_,_,_ ), 0 , 5 , 0 , 167, 104), // #588
+ INST(Pmovsxbd , ExtRm , O(660F38,21,_,_,_,_,_,_ ), 0 , 2 , 0 , 8 , 13 ), // #589
+ INST(Pmovsxbq , ExtRm , O(660F38,22,_,_,_,_,_,_ ), 0 , 2 , 0 , 168, 13 ), // #590
+ INST(Pmovsxbw , ExtRm , O(660F38,20,_,_,_,_,_,_ ), 0 , 2 , 0 , 7 , 13 ), // #591
+ INST(Pmovsxdq , ExtRm , O(660F38,25,_,_,_,_,_,_ ), 0 , 2 , 0 , 7 , 13 ), // #592
+ INST(Pmovsxwd , ExtRm , O(660F38,23,_,_,_,_,_,_ ), 0 , 2 , 0 , 7 , 13 ), // #593
+ INST(Pmovsxwq , ExtRm , O(660F38,24,_,_,_,_,_,_ ), 0 , 2 , 0 , 8 , 13 ), // #594
+ INST(Pmovzxbd , ExtRm , O(660F38,31,_,_,_,_,_,_ ), 0 , 2 , 0 , 8 , 13 ), // #595
+ INST(Pmovzxbq , ExtRm , O(660F38,32,_,_,_,_,_,_ ), 0 , 2 , 0 , 168, 13 ), // #596
+ INST(Pmovzxbw , ExtRm , O(660F38,30,_,_,_,_,_,_ ), 0 , 2 , 0 , 7 , 13 ), // #597
+ INST(Pmovzxdq , ExtRm , O(660F38,35,_,_,_,_,_,_ ), 0 , 2 , 0 , 7 , 13 ), // #598
+ INST(Pmovzxwd , ExtRm , O(660F38,33,_,_,_,_,_,_ ), 0 , 2 , 0 , 7 , 13 ), // #599
+ INST(Pmovzxwq , ExtRm , O(660F38,34,_,_,_,_,_,_ ), 0 , 2 , 0 , 8 , 13 ), // #600
+ INST(Pmuldq , ExtRm , O(660F38,28,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 13 ), // #601
+ INST(Pmulhrsw , ExtRm_P , O(000F38,0B,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #602
+ INST(Pmulhrw , Ext3dNow , O(000F0F,B7,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 58 ), // #603
+ INST(Pmulhuw , ExtRm_P , O(000F00,E4,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 104), // #604
+ INST(Pmulhw , ExtRm_P , O(000F00,E5,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #605
+ INST(Pmulld , ExtRm , O(660F38,40,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 13 ), // #606
+ INST(Pmullw , ExtRm_P , O(000F00,D5,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #607
+ INST(Pmuludq , ExtRm_P , O(000F00,F4,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 5 ), // #608
+ INST(Pop , X86Pop , O(000000,8F,0,_,_,_,_,_ ), O(000000,58,_,_,_,_,_,_ ), 0 , 67 , 169, 0 ), // #609
+ INST(Popa , X86Op , O(660000,61,_,_,_,_,_,_ ), 0 , 21 , 0 , 85 , 0 ), // #610
+ INST(Popad , X86Op , O(000000,61,_,_,_,_,_,_ ), 0 , 0 , 0 , 85 , 0 ), // #611
+ INST(Popcnt , X86Rm_Raw66H , O(F30F00,B8,_,_,x,_,_,_ ), 0 , 7 , 0 , 23 , 111), // #612
+ INST(Popf , X86Op , O(660000,9D,_,_,_,_,_,_ ), 0 , 21 , 0 , 31 , 112), // #613
+ INST(Popfd , X86Op , O(000000,9D,_,_,_,_,_,_ ), 0 , 0 , 0 , 85 , 112), // #614
+ INST(Popfq , X86Op , O(000000,9D,_,_,_,_,_,_ ), 0 , 0 , 0 , 34 , 112), // #615
+ INST(Por , ExtRm_P , O(000F00,EB,_,_,_,_,_,_ ), 0 , 5 , 0 , 152, 98 ), // #616
+ INST(Prefetch , X86M_Only , O(000F00,0D,0,_,_,_,_,_ ), 0 , 5 , 0 , 32 , 58 ), // #617
+ INST(Prefetchit0 , X86M_Only , O(000F00,18,7,_,_,_,_,_ ), 0 , 24 , 0 , 75 , 113), // #618
+ INST(Prefetchit1 , X86M_Only , O(000F00,18,6,_,_,_,_,_ ), 0 , 82 , 0 , 75 , 113), // #619
+ INST(Prefetchnta , X86M_Only , O(000F00,18,0,_,_,_,_,_ ), 0 , 5 , 0 , 32 , 6 ), // #620
+ INST(Prefetcht0 , X86M_Only , O(000F00,18,1,_,_,_,_,_ ), 0 , 32 , 0 , 32 , 6 ), // #621
+ INST(Prefetcht1 , X86M_Only , O(000F00,18,2,_,_,_,_,_ ), 0 , 78 , 0 , 32 , 6 ), // #622
+ INST(Prefetcht2 , X86M_Only , O(000F00,18,3,_,_,_,_,_ ), 0 , 80 , 0 , 32 , 6 ), // #623
+ INST(Prefetchw , X86M_Only , O(000F00,0D,1,_,_,_,_,_ ), 0 , 32 , 0 , 32 , 114), // #624
+ INST(Prefetchwt1 , X86M_Only , O(000F00,0D,2,_,_,_,_,_ ), 0 , 78 , 0 , 32 , 115), // #625
+ INST(Psadbw , ExtRm_P , O(000F00,F6,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 104), // #626
+ INST(Pshufb , ExtRm_P , O(000F38,00,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #627
+ INST(Pshufd , ExtRmi , O(660F00,70,_,_,_,_,_,_ ), 0 , 4 , 0 , 9 , 5 ), // #628
+ INST(Pshufhw , ExtRmi , O(F30F00,70,_,_,_,_,_,_ ), 0 , 7 , 0 , 9 , 5 ), // #629
+ INST(Pshuflw , ExtRmi , O(F20F00,70,_,_,_,_,_,_ ), 0 , 6 , 0 , 9 , 5 ), // #630
+ INST(Pshufw , ExtRmi_P , O(000F00,70,_,_,_,_,_,_ ), 0 , 5 , 0 , 170, 90 ), // #631
+ INST(Psignb , ExtRm_P , O(000F38,08,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #632
+ INST(Psignd , ExtRm_P , O(000F38,0A,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #633
+ INST(Psignw , ExtRm_P , O(000F38,09,_,_,_,_,_,_ ), 0 , 1 , 0 , 150, 103), // #634
+ INST(Pslld , ExtRmRi_P , O(000F00,F2,_,_,_,_,_,_ ), O(000F00,72,6,_,_,_,_,_ ), 5 , 68 , 171, 98 ), // #635
+ INST(Pslldq , ExtRmRi , 0 , O(660F00,73,7,_,_,_,_,_ ), 0 , 69 , 172, 5 ), // #636
+ INST(Psllq , ExtRmRi_P , O(000F00,F3,_,_,_,_,_,_ ), O(000F00,73,6,_,_,_,_,_ ), 5 , 70 , 171, 98 ), // #637
+ INST(Psllw , ExtRmRi_P , O(000F00,F1,_,_,_,_,_,_ ), O(000F00,71,6,_,_,_,_,_ ), 5 , 71 , 171, 98 ), // #638
+ INST(Psmash , X86Op , O(F30F01,FF,_,_,_,_,_,_ ), 0 , 27 , 0 , 34 , 116), // #639
+ INST(Psrad , ExtRmRi_P , O(000F00,E2,_,_,_,_,_,_ ), O(000F00,72,4,_,_,_,_,_ ), 5 , 72 , 171, 98 ), // #640
+ INST(Psraw , ExtRmRi_P , O(000F00,E1,_,_,_,_,_,_ ), O(000F00,71,4,_,_,_,_,_ ), 5 , 73 , 171, 98 ), // #641
+ INST(Psrld , ExtRmRi_P , O(000F00,D2,_,_,_,_,_,_ ), O(000F00,72,2,_,_,_,_,_ ), 5 , 74 , 171, 98 ), // #642
+ INST(Psrldq , ExtRmRi , 0 , O(660F00,73,3,_,_,_,_,_ ), 0 , 75 , 172, 5 ), // #643
+ INST(Psrlq , ExtRmRi_P , O(000F00,D3,_,_,_,_,_,_ ), O(000F00,73,2,_,_,_,_,_ ), 5 , 76 , 171, 98 ), // #644
+ INST(Psrlw , ExtRmRi_P , O(000F00,D1,_,_,_,_,_,_ ), O(000F00,71,2,_,_,_,_,_ ), 5 , 77 , 171, 98 ), // #645
+ INST(Psubb , ExtRm_P , O(000F00,F8,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #646
+ INST(Psubd , ExtRm_P , O(000F00,FA,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #647
+ INST(Psubq , ExtRm_P , O(000F00,FB,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 5 ), // #648
+ INST(Psubsb , ExtRm_P , O(000F00,E8,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #649
+ INST(Psubsw , ExtRm_P , O(000F00,E9,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #650
+ INST(Psubusb , ExtRm_P , O(000F00,D8,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #651
+ INST(Psubusw , ExtRm_P , O(000F00,D9,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #652
+ INST(Psubw , ExtRm_P , O(000F00,F9,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #653
+ INST(Pswapd , Ext3dNow , O(000F0F,BB,_,_,_,_,_,_ ), 0 , 88 , 0 , 154, 109), // #654
+ INST(Ptest , ExtRm , O(660F38,17,_,_,_,_,_,_ ), 0 , 2 , 0 , 6 , 117), // #655
+ INST(Ptwrite , X86M , O(F30F00,AE,4,_,_,_,_,_ ), 0 , 92 , 0 , 173, 118), // #656
+ INST(Punpckhbw , ExtRm_P , O(000F00,68,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #657
+ INST(Punpckhdq , ExtRm_P , O(000F00,6A,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #658
+ INST(Punpckhqdq , ExtRm , O(660F00,6D,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #659
+ INST(Punpckhwd , ExtRm_P , O(000F00,69,_,_,_,_,_,_ ), 0 , 5 , 0 , 150, 98 ), // #660
+ INST(Punpcklbw , ExtRm_P , O(000F00,60,_,_,_,_,_,_ ), 0 , 5 , 0 , 174, 98 ), // #661
+ INST(Punpckldq , ExtRm_P , O(000F00,62,_,_,_,_,_,_ ), 0 , 5 , 0 , 174, 98 ), // #662
+ INST(Punpcklqdq , ExtRm , O(660F00,6C,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #663
+ INST(Punpcklwd , ExtRm_P , O(000F00,61,_,_,_,_,_,_ ), 0 , 5 , 0 , 174, 98 ), // #664
+ INST(Push , X86Push , O(000000,FF,6,_,_,_,_,_ ), O(000000,50,_,_,_,_,_,_ ), 34 , 78 , 175, 0 ), // #665
+ INST(Pusha , X86Op , O(660000,60,_,_,_,_,_,_ ), 0 , 21 , 0 , 85 , 0 ), // #666
+ INST(Pushad , X86Op , O(000000,60,_,_,_,_,_,_ ), 0 , 0 , 0 , 85 , 0 ), // #667
+ INST(Pushf , X86Op , O(660000,9C,_,_,_,_,_,_ ), 0 , 21 , 0 , 31 , 119), // #668
+ INST(Pushfd , X86Op , O(000000,9C,_,_,_,_,_,_ ), 0 , 0 , 0 , 85 , 119), // #669
+ INST(Pushfq , X86Op , O(000000,9C,_,_,_,_,_,_ ), 0 , 0 , 0 , 34 , 119), // #670
+ INST(Pvalidate , X86Op , O(F20F01,FF,_,_,_,_,_,_ ), 0 , 93 , 0 , 31 , 120), // #671
+ INST(Pxor , ExtRm_P , O(000F00,EF,_,_,_,_,_,_ ), 0 , 5 , 0 , 153, 98 ), // #672
+ INST(Rcl , X86Rot , O(000000,D0,2,_,x,_,_,_ ), 0 , 3 , 0 , 176, 121), // #673
+ INST(Rcpps , ExtRm , O(000F00,53,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #674
+ INST(Rcpss , ExtRm , O(F30F00,53,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 6 ), // #675
+ INST(Rcr , X86Rot , O(000000,D0,3,_,x,_,_,_ ), 0 , 77 , 0 , 176, 121), // #676
+ INST(Rdfsbase , X86M , O(F30F00,AE,0,_,x,_,_,_ ), 0 , 7 , 0 , 177, 122), // #677
+ INST(Rdgsbase , X86M , O(F30F00,AE,1,_,x,_,_,_ ), 0 , 94 , 0 , 177, 122), // #678
+ INST(Rdmsr , X86Op , O(000F00,32,_,_,_,_,_,_ ), 0 , 5 , 0 , 178, 123), // #679
+ INST(Rdpid , X86R_Native , O(F30F00,C7,7,_,_,_,_,_ ), 0 , 95 , 0 , 179, 124), // #680
+ INST(Rdpkru , X86Op , O(000F01,EE,_,_,_,_,_,_ ), 0 , 23 , 0 , 178, 125), // #681
+ INST(Rdpmc , X86Op , O(000F00,33,_,_,_,_,_,_ ), 0 , 5 , 0 , 178, 0 ), // #682
+ INST(Rdpru , X86Op , O(000F01,FD,_,_,_,_,_,_ ), 0 , 23 , 0 , 178, 126), // #683
+ INST(Rdrand , X86M , O(000F00,C7,6,_,x,_,_,_ ), 0 , 82 , 0 , 24 , 127), // #684
+ INST(Rdseed , X86M , O(000F00,C7,7,_,x,_,_,_ ), 0 , 24 , 0 , 24 , 128), // #685
+ INST(Rdsspd , X86M , O(F30F00,1E,1,_,_,_,_,_ ), 0 , 94 , 0 , 80 , 65 ), // #686
+ INST(Rdsspq , X86M , O(F30F00,1E,1,_,_,_,_,_ ), 0 , 94 , 0 , 81 , 65 ), // #687
+ INST(Rdtsc , X86Op , O(000F00,31,_,_,_,_,_,_ ), 0 , 5 , 0 , 29 , 129), // #688
+ INST(Rdtscp , X86Op , O(000F01,F9,_,_,_,_,_,_ ), 0 , 23 , 0 , 178, 130), // #689
+ INST(Ret , X86Ret , O(000000,C2,_,_,_,_,_,_ ), 0 , 0 , 0 , 180, 0 ), // #690
+ INST(Retf , X86Ret , O(000000,CA,_,_,x,_,_,_ ), 0 , 0 , 0 , 181, 0 ), // #691
+ INST(Rmpadjust , X86Op , O(F30F01,FE,_,_,_,_,_,_ ), 0 , 27 , 0 , 34 , 116), // #692
+ INST(Rmpupdate , X86Op , O(F20F01,FE,_,_,_,_,_,_ ), 0 , 93 , 0 , 34 , 116), // #693
+ INST(Rol , X86Rot , O(000000,D0,0,_,x,_,_,_ ), 0 , 0 , 0 , 176, 131), // #694
+ INST(Ror , X86Rot , O(000000,D0,1,_,x,_,_,_ ), 0 , 33 , 0 , 176, 131), // #695
+ INST(Rorx , VexRmi_Wx , V(F20F3A,F0,_,0,x,_,_,_ ), 0 , 96 , 0 , 182, 102), // #696
+ INST(Roundpd , ExtRmi , O(660F3A,09,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 13 ), // #697
+ INST(Roundps , ExtRmi , O(660F3A,08,_,_,_,_,_,_ ), 0 , 9 , 0 , 9 , 13 ), // #698
+ INST(Roundsd , ExtRmi , O(660F3A,0B,_,_,_,_,_,_ ), 0 , 9 , 0 , 39 , 13 ), // #699
+ INST(Roundss , ExtRmi , O(660F3A,0A,_,_,_,_,_,_ ), 0 , 9 , 0 , 40 , 13 ), // #700
+ INST(Rsm , X86Op , O(000F00,AA,_,_,_,_,_,_ ), 0 , 5 , 0 , 85 , 1 ), // #701
+ INST(Rsqrtps , ExtRm , O(000F00,52,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #702
+ INST(Rsqrtss , ExtRm , O(F30F00,52,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 6 ), // #703
+ INST(Rstorssp , X86M_Only , O(F30F00,01,5,_,_,_,_,_ ), 0 , 65 , 0 , 33 , 25 ), // #704
+ INST(Sahf , X86Op , O(000000,9E,_,_,_,_,_,_ ), 0 , 0 , 0 , 102, 132), // #705
+ INST(Sal , X86Rot , O(000000,D0,4,_,x,_,_,_ ), 0 , 10 , 0 , 176, 1 ), // #706
+ INST(Sar , X86Rot , O(000000,D0,7,_,x,_,_,_ ), 0 , 29 , 0 , 176, 1 ), // #707
+ INST(Sarx , VexRmv_Wx , V(F30F38,F7,_,0,x,_,_,_ ), 0 , 89 , 0 , 14 , 102), // #708
+ INST(Saveprevssp , X86Op , O(F30F01,EA,_,_,_,_,_,_ ), 0 , 27 , 0 , 31 , 25 ), // #709
+ INST(Sbb , X86Arith , O(000000,18,3,_,x,_,_,_ ), 0 , 77 , 0 , 183, 3 ), // #710
+ INST(Scas , X86StrRm , O(000000,AE,_,_,_,_,_,_ ), 0 , 0 , 0 , 184, 39 ), // #711
+ INST(Seamcall , X86Op , O(660F01,CF,_,_,_,_,_,_ ), 0 , 97 , 0 , 31 , 133), // #712
+ INST(Seamops , X86Op , O(660F01,CE,_,_,_,_,_,_ ), 0 , 97 , 0 , 31 , 133), // #713
+ INST(Seamret , X86Op , O(660F01,CD,_,_,_,_,_,_ ), 0 , 97 , 0 , 31 , 133), // #714
+ INST(Senduipi , X86M_NoSize , O(F30F00,C7,6,_,_,_,_,_ ), 0 , 26 , 0 , 81 , 26 ), // #715
+ INST(Serialize , X86Op , O(000F01,E8,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 134), // #716
+ INST(Seta , X86Set , O(000F00,97,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 69 ), // #717
+ INST(Setae , X86Set , O(000F00,93,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 70 ), // #718
+ INST(Setb , X86Set , O(000F00,92,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 70 ), // #719
+ INST(Setbe , X86Set , O(000F00,96,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 69 ), // #720
+ INST(Setc , X86Set , O(000F00,92,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 70 ), // #721
+ INST(Sete , X86Set , O(000F00,94,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 71 ), // #722
+ INST(Setg , X86Set , O(000F00,9F,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 72 ), // #723
+ INST(Setge , X86Set , O(000F00,9D,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 73 ), // #724
+ INST(Setl , X86Set , O(000F00,9C,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 73 ), // #725
+ INST(Setle , X86Set , O(000F00,9E,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 72 ), // #726
+ INST(Setna , X86Set , O(000F00,96,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 69 ), // #727
+ INST(Setnae , X86Set , O(000F00,92,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 70 ), // #728
+ INST(Setnb , X86Set , O(000F00,93,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 70 ), // #729
+ INST(Setnbe , X86Set , O(000F00,97,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 69 ), // #730
+ INST(Setnc , X86Set , O(000F00,93,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 70 ), // #731
+ INST(Setne , X86Set , O(000F00,95,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 71 ), // #732
+ INST(Setng , X86Set , O(000F00,9E,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 72 ), // #733
+ INST(Setnge , X86Set , O(000F00,9C,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 73 ), // #734
+ INST(Setnl , X86Set , O(000F00,9D,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 73 ), // #735
+ INST(Setnle , X86Set , O(000F00,9F,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 72 ), // #736
+ INST(Setno , X86Set , O(000F00,91,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 66 ), // #737
+ INST(Setnp , X86Set , O(000F00,9B,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 74 ), // #738
+ INST(Setns , X86Set , O(000F00,99,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 75 ), // #739
+ INST(Setnz , X86Set , O(000F00,95,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 71 ), // #740
+ INST(Seto , X86Set , O(000F00,90,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 66 ), // #741
+ INST(Setp , X86Set , O(000F00,9A,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 74 ), // #742
+ INST(Setpe , X86Set , O(000F00,9A,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 74 ), // #743
+ INST(Setpo , X86Set , O(000F00,9B,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 74 ), // #744
+ INST(Sets , X86Set , O(000F00,98,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 75 ), // #745
+ INST(Setssbsy , X86Op , O(F30F01,E8,_,_,_,_,_,_ ), 0 , 27 , 0 , 31 , 65 ), // #746
+ INST(Setz , X86Set , O(000F00,94,_,_,_,_,_,_ ), 0 , 5 , 0 , 185, 71 ), // #747
+ INST(Sfence , X86Fence , O(000F00,AE,7,_,_,_,_,_ ), 0 , 24 , 0 , 31 , 6 ), // #748
+ INST(Sgdt , X86M_Only , O(000F00,01,0,_,_,_,_,_ ), 0 , 5 , 0 , 32 , 0 ), // #749
+ INST(Sha1msg1 , ExtRm , O(000F38,C9,_,_,_,_,_,_ ), 0 , 1 , 0 , 6 , 135), // #750
+ INST(Sha1msg2 , ExtRm , O(000F38,CA,_,_,_,_,_,_ ), 0 , 1 , 0 , 6 , 135), // #751
+ INST(Sha1nexte , ExtRm , O(000F38,C8,_,_,_,_,_,_ ), 0 , 1 , 0 , 6 , 135), // #752
+ INST(Sha1rnds4 , ExtRmi , O(000F3A,CC,_,_,_,_,_,_ ), 0 , 86 , 0 , 9 , 135), // #753
+ INST(Sha256msg1 , ExtRm , O(000F38,CC,_,_,_,_,_,_ ), 0 , 1 , 0 , 6 , 135), // #754
+ INST(Sha256msg2 , ExtRm , O(000F38,CD,_,_,_,_,_,_ ), 0 , 1 , 0 , 6 , 135), // #755
+ INST(Sha256rnds2 , ExtRm_XMM0 , O(000F38,CB,_,_,_,_,_,_ ), 0 , 1 , 0 , 16 , 135), // #756
+ INST(Shl , X86Rot , O(000000,D0,4,_,x,_,_,_ ), 0 , 10 , 0 , 176, 1 ), // #757
+ INST(Shld , X86ShldShrd , O(000F00,A4,_,_,x,_,_,_ ), 0 , 5 , 0 , 186, 1 ), // #758
+ INST(Shlx , VexRmv_Wx , V(660F38,F7,_,0,x,_,_,_ ), 0 , 30 , 0 , 14 , 102), // #759
+ INST(Shr , X86Rot , O(000000,D0,5,_,x,_,_,_ ), 0 , 64 , 0 , 176, 1 ), // #760
+ INST(Shrd , X86ShldShrd , O(000F00,AC,_,_,x,_,_,_ ), 0 , 5 , 0 , 186, 1 ), // #761
+ INST(Shrx , VexRmv_Wx , V(F20F38,F7,_,0,x,_,_,_ ), 0 , 85 , 0 , 14 , 102), // #762
+ INST(Shufpd , ExtRmi , O(660F00,C6,_,_,_,_,_,_ ), 0 , 4 , 0 , 9 , 5 ), // #763
+ INST(Shufps , ExtRmi , O(000F00,C6,_,_,_,_,_,_ ), 0 , 5 , 0 , 9 , 6 ), // #764
+ INST(Sidt , X86M_Only , O(000F00,01,1,_,_,_,_,_ ), 0 , 32 , 0 , 32 , 0 ), // #765
+ INST(Skinit , X86Op_xAX , O(000F01,DE,_,_,_,_,_,_ ), 0 , 23 , 0 , 56 , 136), // #766
+ INST(Sldt , X86M_NoMemSize , O(000F00,00,0,_,_,_,_,_ ), 0 , 5 , 0 , 187, 0 ), // #767
+ INST(Slwpcb , VexR_Wx , V(XOP_M9,12,1,0,x,_,_,_ ), 0 , 13 , 0 , 113, 87 ), // #768
+ INST(Smsw , X86M_NoMemSize , O(000F00,01,4,_,_,_,_,_ ), 0 , 98 , 0 , 187, 0 ), // #769
+ INST(Sqrtpd , ExtRm , O(660F00,51,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #770
+ INST(Sqrtps , ExtRm , O(000F00,51,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #771
+ INST(Sqrtsd , ExtRm , O(F20F00,51,_,_,_,_,_,_ ), 0 , 6 , 0 , 7 , 5 ), // #772
+ INST(Sqrtss , ExtRm , O(F30F00,51,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 6 ), // #773
+ INST(Stac , X86Op , O(000F01,CB,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 17 ), // #774
+ INST(Stc , X86Op , O(000000,F9,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 18 ), // #775
+ INST(Std , X86Op , O(000000,FD,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 19 ), // #776
+ INST(Stgi , X86Op , O(000F01,DC,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 136), // #777
+ INST(Sti , X86Op , O(000000,FB,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 24 ), // #778
+ INST(Stmxcsr , X86M_Only , O(000F00,AE,3,_,_,_,_,_ ), 0 , 80 , 0 , 106, 6 ), // #779
+ INST(Stos , X86StrMr , O(000000,AA,_,_,_,_,_,_ ), 0 , 0 , 0 , 188, 88 ), // #780
+ INST(Str , X86M_NoMemSize , O(000F00,00,1,_,_,_,_,_ ), 0 , 32 , 0 , 187, 0 ), // #781
+ INST(Sttilecfg , AmxCfg , V(660F38,49,_,0,0,_,_,_ ), 0 , 30 , 0 , 108, 86 ), // #782
+ INST(Stui , X86Op , O(F30F01,EF,_,_,_,_,_,_ ), 0 , 27 , 0 , 34 , 26 ), // #783
+ INST(Sub , X86Arith , O(000000,28,5,_,x,_,_,_ ), 0 , 64 , 0 , 183, 1 ), // #784
+ INST(Subpd , ExtRm , O(660F00,5C,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #785
+ INST(Subps , ExtRm , O(000F00,5C,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #786
+ INST(Subsd , ExtRm , O(F20F00,5C,_,_,_,_,_,_ ), 0 , 6 , 0 , 7 , 5 ), // #787
+ INST(Subss , ExtRm , O(F30F00,5C,_,_,_,_,_,_ ), 0 , 7 , 0 , 8 , 6 ), // #788
+ INST(Swapgs , X86Op , O(000F01,F8,_,_,_,_,_,_ ), 0 , 23 , 0 , 34 , 0 ), // #789
+ INST(Syscall , X86Op , O(000F00,05,_,_,_,_,_,_ ), 0 , 5 , 0 , 34 , 0 ), // #790
+ INST(Sysenter , X86Op , O(000F00,34,_,_,_,_,_,_ ), 0 , 5 , 0 , 31 , 0 ), // #791
+ INST(Sysexit , X86Op , O(000F00,35,_,_,_,_,_,_ ), 0 , 5 , 0 , 31 , 0 ), // #792
+ INST(Sysexitq , X86Op , O(000F00,35,_,_,1,_,_,_ ), 0 , 62 , 0 , 34 , 0 ), // #793
+ INST(Sysret , X86Op , O(000F00,07,_,_,_,_,_,_ ), 0 , 5 , 0 , 34 , 0 ), // #794
+ INST(Sysretq , X86Op , O(000F00,07,_,_,1,_,_,_ ), 0 , 62 , 0 , 34 , 0 ), // #795
+ INST(T1mskc , VexVm_Wx , V(XOP_M9,01,7,0,x,_,_,_ ), 0 , 99 , 0 , 15 , 12 ), // #796
+ INST(Tcmmimfp16ps , AmxRmv , V(660F38,6C,_,0,0,_,_,_ ), 0 , 30 , 0 , 189, 137), // #797
+ INST(Tcmmrlfp16ps , AmxRmv , V(000F38,6C,_,0,0,_,_,_ ), 0 , 11 , 0 , 189, 137), // #798
+ INST(Tdcall , X86Op , O(660F01,CC,_,_,_,_,_,_ ), 0 , 97 , 0 , 31 , 133), // #799
+ INST(Tdpbf16ps , AmxRmv , V(F30F38,5C,_,0,0,_,_,_ ), 0 , 89 , 0 , 189, 138), // #800
+ INST(Tdpbssd , AmxRmv , V(F20F38,5E,_,0,0,_,_,_ ), 0 , 85 , 0 , 189, 139), // #801
+ INST(Tdpbsud , AmxRmv , V(F30F38,5E,_,0,0,_,_,_ ), 0 , 89 , 0 , 189, 139), // #802
+ INST(Tdpbusd , AmxRmv , V(660F38,5E,_,0,0,_,_,_ ), 0 , 30 , 0 , 189, 139), // #803
+ INST(Tdpbuud , AmxRmv , V(000F38,5E,_,0,0,_,_,_ ), 0 , 11 , 0 , 189, 139), // #804
+ INST(Tdpfp16ps , AmxRmv , V(F20F38,5C,_,0,0,_,_,_ ), 0 , 85 , 0 , 189, 140), // #805
+ INST(Test , X86Test , O(000000,84,_,_,x,_,_,_ ), O(000000,F6,_,_,x,_,_,_ ), 0 , 79 , 190, 1 ), // #806
+ INST(Testui , X86Op , O(F30F01,ED,_,_,_,_,_,_ ), 0 , 27 , 0 , 34 , 141), // #807
+ INST(Tileloadd , AmxRm , V(F20F38,4B,_,0,0,_,_,_ ), 0 , 85 , 0 , 191, 86 ), // #808
+ INST(Tileloaddt1 , AmxRm , V(660F38,4B,_,0,0,_,_,_ ), 0 , 30 , 0 , 191, 86 ), // #809
+ INST(Tilerelease , VexOpMod , V(000F38,49,0,0,0,_,_,_ ), 0 , 11 , 0 , 192, 86 ), // #810
+ INST(Tilestored , AmxMr , V(F30F38,4B,_,0,0,_,_,_ ), 0 , 89 , 0 , 193, 86 ), // #811
+ INST(Tilezero , AmxR , V(F20F38,49,_,0,0,_,_,_ ), 0 , 85 , 0 , 194, 86 ), // #812
+ INST(Tlbsync , X86Op , O(000F01,FF,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 68 ), // #813
+ INST(Tpause , X86R32_EDX_EAX , O(660F00,AE,6,_,_,_,_,_ ), 0 , 28 , 0 , 195, 142), // #814
+ INST(Tzcnt , X86Rm_Raw66H , O(F30F00,BC,_,_,x,_,_,_ ), 0 , 7 , 0 , 23 , 10 ), // #815
+ INST(Tzmsk , VexVm_Wx , V(XOP_M9,01,4,0,x,_,_,_ ), 0 , 100, 0 , 15 , 12 ), // #816
+ INST(Ucomisd , ExtRm , O(660F00,2E,_,_,_,_,_,_ ), 0 , 4 , 0 , 7 , 43 ), // #817
+ INST(Ucomiss , ExtRm , O(000F00,2E,_,_,_,_,_,_ ), 0 , 5 , 0 , 8 , 44 ), // #818
+ INST(Ud0 , X86Rm , O(000F00,FF,_,_,_,_,_,_ ), 0 , 5 , 0 , 196, 0 ), // #819
+ INST(Ud1 , X86Rm , O(000F00,B9,_,_,_,_,_,_ ), 0 , 5 , 0 , 196, 0 ), // #820
+ INST(Ud2 , X86Op , O(000F00,0B,_,_,_,_,_,_ ), 0 , 5 , 0 , 31 , 0 ), // #821
+ INST(Uiret , X86Op , O(F30F01,EC,_,_,_,_,_,_ ), 0 , 27 , 0 , 34 , 26 ), // #822
+ INST(Umonitor , X86R_FromM , O(F30F00,AE,6,_,_,_,_,_ ), 0 , 26 , 0 , 197, 143), // #823
+ INST(Umwait , X86R32_EDX_EAX , O(F20F00,AE,6,_,_,_,_,_ ), 0 , 101, 0 , 195, 142), // #824
+ INST(Unpckhpd , ExtRm , O(660F00,15,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #825
+ INST(Unpckhps , ExtRm , O(000F00,15,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #826
+ INST(Unpcklpd , ExtRm , O(660F00,14,_,_,_,_,_,_ ), 0 , 4 , 0 , 6 , 5 ), // #827
+ INST(Unpcklps , ExtRm , O(000F00,14,_,_,_,_,_,_ ), 0 , 5 , 0 , 6 , 6 ), // #828
+ INST(V4fmaddps , VexRm_T1_4X , E(F20F38,9A,_,2,_,0,4,T4X), 0 , 102, 0 , 198, 144), // #829
+ INST(V4fmaddss , VexRm_T1_4X , E(F20F38,9B,_,0,_,0,4,T4X), 0 , 103, 0 , 199, 144), // #830
+ INST(V4fnmaddps , VexRm_T1_4X , E(F20F38,AA,_,2,_,0,4,T4X), 0 , 102, 0 , 198, 144), // #831
+ INST(V4fnmaddss , VexRm_T1_4X , E(F20F38,AB,_,0,_,0,4,T4X), 0 , 103, 0 , 199, 144), // #832
+ INST(Vaddpd , VexRvm_Lx , V(660F00,58,_,x,I,1,4,FV ), 0 , 104, 0 , 200, 145), // #833
+ INST(Vaddph , VexRvm_Lx , E(00MAP5,58,_,_,_,0,4,FV ), 0 , 105, 0 , 201, 146), // #834
+ INST(Vaddps , VexRvm_Lx , V(000F00,58,_,x,I,0,4,FV ), 0 , 106, 0 , 202, 145), // #835
+ INST(Vaddsd , VexRvm , V(F20F00,58,_,I,I,1,3,T1S), 0 , 107, 0 , 203, 147), // #836
+ INST(Vaddsh , VexRvm , E(F3MAP5,58,_,_,_,0,1,T1S), 0 , 108, 0 , 204, 148), // #837
+ INST(Vaddss , VexRvm , V(F30F00,58,_,I,I,0,2,T1S), 0 , 109, 0 , 205, 147), // #838
+ INST(Vaddsubpd , VexRvm_Lx , V(660F00,D0,_,x,I,_,_,_ ), 0 , 71 , 0 , 206, 149), // #839
+ INST(Vaddsubps , VexRvm_Lx , V(F20F00,D0,_,x,I,_,_,_ ), 0 , 110, 0 , 206, 149), // #840
+ INST(Vaesdec , VexRvm_Lx , V(660F38,DE,_,x,I,_,4,FVM), 0 , 111, 0 , 207, 150), // #841
+ INST(Vaesdeclast , VexRvm_Lx , V(660F38,DF,_,x,I,_,4,FVM), 0 , 111, 0 , 207, 150), // #842
+ INST(Vaesenc , VexRvm_Lx , V(660F38,DC,_,x,I,_,4,FVM), 0 , 111, 0 , 207, 150), // #843
+ INST(Vaesenclast , VexRvm_Lx , V(660F38,DD,_,x,I,_,4,FVM), 0 , 111, 0 , 207, 150), // #844
+ INST(Vaesimc , VexRm , V(660F38,DB,_,0,I,_,_,_ ), 0 , 30 , 0 , 208, 151), // #845
+ INST(Vaeskeygenassist , VexRmi , V(660F3A,DF,_,0,I,_,_,_ ), 0 , 75 , 0 , 209, 151), // #846
+ INST(Valignd , VexRvmi_Lx , E(660F3A,03,_,x,_,0,4,FV ), 0 , 112, 0 , 210, 152), // #847
+ INST(Valignq , VexRvmi_Lx , E(660F3A,03,_,x,_,1,4,FV ), 0 , 113, 0 , 211, 152), // #848
+ INST(Vandnpd , VexRvm_Lx , V(660F00,55,_,x,I,1,4,FV ), 0 , 104, 0 , 212, 153), // #849
+ INST(Vandnps , VexRvm_Lx , V(000F00,55,_,x,I,0,4,FV ), 0 , 106, 0 , 213, 153), // #850
+ INST(Vandpd , VexRvm_Lx , V(660F00,54,_,x,I,1,4,FV ), 0 , 104, 0 , 214, 153), // #851
+ INST(Vandps , VexRvm_Lx , V(000F00,54,_,x,I,0,4,FV ), 0 , 106, 0 , 215, 153), // #852
+ INST(Vbcstnebf162ps , VexRm_Lx , V(F30F38,B1,_,x,0,_,_,_ ), 0 , 89 , 0 , 216, 154), // #853
+ INST(Vbcstnesh2ps , VexRm_Lx , V(660F38,B1,_,x,0,_,_,_ ), 0 , 30 , 0 , 216, 154), // #854
+ INST(Vblendmpd , VexRvm_Lx , E(660F38,65,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #855
+ INST(Vblendmps , VexRvm_Lx , E(660F38,65,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 152), // #856
+ INST(Vblendpd , VexRvmi_Lx , V(660F3A,0D,_,x,I,_,_,_ ), 0 , 75 , 0 , 219, 149), // #857
+ INST(Vblendps , VexRvmi_Lx , V(660F3A,0C,_,x,I,_,_,_ ), 0 , 75 , 0 , 219, 149), // #858
+ INST(Vblendvpd , VexRvmr_Lx , V(660F3A,4B,_,x,0,_,_,_ ), 0 , 75 , 0 , 220, 149), // #859
+ INST(Vblendvps , VexRvmr_Lx , V(660F3A,4A,_,x,0,_,_,_ ), 0 , 75 , 0 , 220, 149), // #860
+ INST(Vbroadcastf128 , VexRm , V(660F38,1A,_,1,0,_,_,_ ), 0 , 116, 0 , 221, 149), // #861
+ INST(Vbroadcastf32x2 , VexRm_Lx , E(660F38,19,_,x,_,0,3,T2 ), 0 , 117, 0 , 222, 155), // #862
+ INST(Vbroadcastf32x4 , VexRm_Lx , E(660F38,1A,_,x,_,0,4,T4 ), 0 , 118, 0 , 223, 78 ), // #863
+ INST(Vbroadcastf32x8 , VexRm , E(660F38,1B,_,2,_,0,5,T8 ), 0 , 119, 0 , 224, 76 ), // #864
+ INST(Vbroadcastf64x2 , VexRm_Lx , E(660F38,1A,_,x,_,1,4,T2 ), 0 , 120, 0 , 223, 155), // #865
+ INST(Vbroadcastf64x4 , VexRm , E(660F38,1B,_,2,_,1,5,T4 ), 0 , 121, 0 , 224, 78 ), // #866
+ INST(Vbroadcasti128 , VexRm , V(660F38,5A,_,1,0,_,_,_ ), 0 , 116, 0 , 221, 156), // #867
+ INST(Vbroadcasti32x2 , VexRm_Lx , E(660F38,59,_,x,_,0,3,T2 ), 0 , 117, 0 , 225, 155), // #868
+ INST(Vbroadcasti32x4 , VexRm_Lx , E(660F38,5A,_,x,_,0,4,T4 ), 0 , 118, 0 , 223, 152), // #869
+ INST(Vbroadcasti32x8 , VexRm , E(660F38,5B,_,2,_,0,5,T8 ), 0 , 119, 0 , 224, 76 ), // #870
+ INST(Vbroadcasti64x2 , VexRm_Lx , E(660F38,5A,_,x,_,1,4,T2 ), 0 , 120, 0 , 223, 155), // #871
+ INST(Vbroadcasti64x4 , VexRm , E(660F38,5B,_,2,_,1,5,T4 ), 0 , 121, 0 , 224, 78 ), // #872
+ INST(Vbroadcastsd , VexRm_Lx , V(660F38,19,_,x,0,1,3,T1S), 0 , 122, 0 , 226, 157), // #873
+ INST(Vbroadcastss , VexRm_Lx , V(660F38,18,_,x,0,0,2,T1S), 0 , 123, 0 , 227, 157), // #874
+ INST(Vcmppd , VexRvmi_Lx_KEvex , V(660F00,C2,_,x,I,1,4,FV ), 0 , 104, 0 , 228, 145), // #875
+ INST(Vcmpph , VexRvmi_Lx_KEvex , E(000F3A,C2,_,_,_,0,4,FV ), 0 , 124, 0 , 229, 146), // #876
+ INST(Vcmpps , VexRvmi_Lx_KEvex , V(000F00,C2,_,x,I,0,4,FV ), 0 , 106, 0 , 230, 145), // #877
+ INST(Vcmpsd , VexRvmi_KEvex , V(F20F00,C2,_,I,I,1,3,T1S), 0 , 107, 0 , 231, 147), // #878
+ INST(Vcmpsh , VexRvmi_KEvex , E(F30F3A,C2,_,_,_,0,1,T1S), 0 , 125, 0 , 232, 148), // #879
+ INST(Vcmpss , VexRvmi_KEvex , V(F30F00,C2,_,I,I,0,2,T1S), 0 , 109, 0 , 233, 147), // #880
+ INST(Vcomisd , VexRm , V(660F00,2F,_,I,I,1,3,T1S), 0 , 126, 0 , 234, 158), // #881
+ INST(Vcomish , VexRm , E(00MAP5,2F,_,_,_,0,1,T1S), 0 , 127, 0 , 235, 159), // #882
+ INST(Vcomiss , VexRm , V(000F00,2F,_,I,I,0,2,T1S), 0 , 128, 0 , 236, 158), // #883
+ INST(Vcompresspd , VexMr_Lx , E(660F38,8A,_,x,_,1,3,T1S), 0 , 129, 0 , 237, 152), // #884
+ INST(Vcompressps , VexMr_Lx , E(660F38,8A,_,x,_,0,2,T1S), 0 , 130, 0 , 237, 152), // #885
+ INST(Vcvtdq2pd , VexRm_Lx , V(F30F00,E6,_,x,I,0,3,HV ), 0 , 131, 0 , 238, 145), // #886
+ INST(Vcvtdq2ph , VexRm_Lx_Narrow , E(00MAP5,5B,_,x,0,0,4,FV ), 0 , 105, 0 , 239, 146), // #887
+ INST(Vcvtdq2ps , VexRm_Lx , V(000F00,5B,_,x,I,0,4,FV ), 0 , 106, 0 , 240, 145), // #888
+ INST(Vcvtne2ps2bf16 , VexRvm_Lx , E(F20F38,72,_,_,_,0,4,FV ), 0 , 132, 0 , 218, 160), // #889
+ INST(Vcvtneebf162ps , VexRm_Lx , V(F30F38,B0,_,x,0,_,_,_ ), 0 , 89 , 0 , 241, 154), // #890
+ INST(Vcvtneeph2ps , VexRm_Lx , V(660F38,B0,_,x,0,_,_,_ ), 0 , 30 , 0 , 241, 154), // #891
+ INST(Vcvtneobf162ps , VexRm_Lx , V(F20F38,B0,_,x,0,_,_,_ ), 0 , 85 , 0 , 241, 154), // #892
+ INST(Vcvtneoph2ps , VexRm_Lx , V(000F38,B0,_,x,0,_,_,_ ), 0 , 11 , 0 , 241, 154), // #893
+ INST(Vcvtneps2bf16 , VexRm_Lx_Narrow , V(F30F38,72,_,_,_,0,4,FV ), 0 , 133, 0 , 242, 161), // #894
+ INST(Vcvtpd2dq , VexRm_Lx_Narrow , V(F20F00,E6,_,x,I,1,4,FV ), 0 , 134, 0 , 243, 145), // #895
+ INST(Vcvtpd2ph , VexRm_Lx , E(66MAP5,5A,_,_,_,1,4,FV ), 0 , 135, 0 , 244, 146), // #896
+ INST(Vcvtpd2ps , VexRm_Lx_Narrow , V(660F00,5A,_,x,I,1,4,FV ), 0 , 104, 0 , 243, 145), // #897
+ INST(Vcvtpd2qq , VexRm_Lx , E(660F00,7B,_,x,_,1,4,FV ), 0 , 136, 0 , 245, 155), // #898
+ INST(Vcvtpd2udq , VexRm_Lx_Narrow , E(000F00,79,_,x,_,1,4,FV ), 0 , 137, 0 , 246, 152), // #899
+ INST(Vcvtpd2uqq , VexRm_Lx , E(660F00,79,_,x,_,1,4,FV ), 0 , 136, 0 , 245, 155), // #900
+ INST(Vcvtph2dq , VexRm_Lx , E(66MAP5,5B,_,_,_,0,3,HV ), 0 , 138, 0 , 247, 146), // #901
+ INST(Vcvtph2pd , VexRm_Lx , E(00MAP5,5A,_,_,_,0,2,QV ), 0 , 139, 0 , 248, 146), // #902
+ INST(Vcvtph2ps , VexRm_Lx , V(660F38,13,_,x,0,0,3,HVM), 0 , 140, 0 , 249, 162), // #903
+ INST(Vcvtph2psx , VexRm_Lx , E(66MAP6,13,_,_,_,0,3,HV ), 0 , 141, 0 , 250, 146), // #904
+ INST(Vcvtph2qq , VexRm_Lx , E(66MAP5,7B,_,_,_,0,2,QV ), 0 , 142, 0 , 251, 146), // #905
+ INST(Vcvtph2udq , VexRm_Lx , E(00MAP5,79,_,_,_,0,3,HV ), 0 , 143, 0 , 247, 146), // #906
+ INST(Vcvtph2uqq , VexRm_Lx , E(66MAP5,79,_,_,_,0,2,QV ), 0 , 142, 0 , 251, 146), // #907
+ INST(Vcvtph2uw , VexRm_Lx , E(00MAP5,7D,_,_,_,0,4,FV ), 0 , 105, 0 , 252, 146), // #908
+ INST(Vcvtph2w , VexRm_Lx , E(66MAP5,7D,_,_,_,0,4,FV ), 0 , 144, 0 , 252, 146), // #909
+ INST(Vcvtps2dq , VexRm_Lx , V(660F00,5B,_,x,I,0,4,FV ), 0 , 145, 0 , 240, 145), // #910
+ INST(Vcvtps2pd , VexRm_Lx , V(000F00,5A,_,x,I,0,3,HV ), 0 , 146, 0 , 253, 145), // #911
+ INST(Vcvtps2ph , VexMri_Lx , V(660F3A,1D,_,x,0,0,3,HVM), 0 , 147, 0 , 254, 162), // #912
+ INST(Vcvtps2phx , VexRm_Lx_Narrow , E(66MAP5,1D,_,_,_,0,4,FV ), 0 , 144, 0 , 239, 146), // #913
+ INST(Vcvtps2qq , VexRm_Lx , E(660F00,7B,_,x,_,0,3,HV ), 0 , 148, 0 , 255, 155), // #914
+ INST(Vcvtps2udq , VexRm_Lx , E(000F00,79,_,x,_,0,4,FV ), 0 , 149, 0 , 256, 152), // #915
+ INST(Vcvtps2uqq , VexRm_Lx , E(660F00,79,_,x,_,0,3,HV ), 0 , 148, 0 , 255, 155), // #916
+ INST(Vcvtqq2pd , VexRm_Lx , E(F30F00,E6,_,x,_,1,4,FV ), 0 , 150, 0 , 245, 155), // #917
+ INST(Vcvtqq2ph , VexRm_Lx , E(00MAP5,5B,_,_,_,1,4,FV ), 0 , 151, 0 , 244, 146), // #918
+ INST(Vcvtqq2ps , VexRm_Lx_Narrow , E(000F00,5B,_,x,_,1,4,FV ), 0 , 137, 0 , 246, 155), // #919
+ INST(Vcvtsd2sh , VexRvm , E(F2MAP5,5A,_,_,_,1,3,T1S), 0 , 152, 0 , 257, 148), // #920
+ INST(Vcvtsd2si , VexRm_Wx , V(F20F00,2D,_,I,x,x,3,T1F), 0 , 153, 0 , 258, 147), // #921
+ INST(Vcvtsd2ss , VexRvm , V(F20F00,5A,_,I,I,1,3,T1S), 0 , 107, 0 , 203, 147), // #922
+ INST(Vcvtsd2usi , VexRm_Wx , E(F20F00,79,_,I,_,x,3,T1F), 0 , 154, 0 , 259, 78 ), // #923
+ INST(Vcvtsh2sd , VexRvm , E(F3MAP5,5A,_,_,_,0,1,T1S), 0 , 108, 0 , 260, 148), // #924
+ INST(Vcvtsh2si , VexRm_Wx , E(F3MAP5,2D,_,_,_,x,1,T1S), 0 , 108, 0 , 261, 148), // #925
+ INST(Vcvtsh2ss , VexRvm , E(00MAP6,13,_,_,_,0,1,T1S), 0 , 155, 0 , 260, 148), // #926
+ INST(Vcvtsh2usi , VexRm_Wx , E(F3MAP5,79,_,_,_,x,1,T1S), 0 , 108, 0 , 261, 148), // #927
+ INST(Vcvtsi2sd , VexRvm_Wx , V(F20F00,2A,_,I,x,x,2,T1W), 0 , 156, 0 , 262, 147), // #928
+ INST(Vcvtsi2sh , VexRvm_Wx , E(F3MAP5,2A,_,_,_,x,2,T1W), 0 , 157, 0 , 263, 148), // #929
+ INST(Vcvtsi2ss , VexRvm_Wx , V(F30F00,2A,_,I,x,x,2,T1W), 0 , 158, 0 , 262, 147), // #930
+ INST(Vcvtss2sd , VexRvm , V(F30F00,5A,_,I,I,0,2,T1S), 0 , 109, 0 , 264, 147), // #931
+ INST(Vcvtss2sh , VexRvm , E(00MAP5,1D,_,_,_,0,2,T1S), 0 , 159, 0 , 265, 148), // #932
+ INST(Vcvtss2si , VexRm_Wx , V(F30F00,2D,_,I,x,x,2,T1F), 0 , 109, 0 , 266, 147), // #933
+ INST(Vcvtss2usi , VexRm_Wx , E(F30F00,79,_,I,_,x,2,T1F), 0 , 160, 0 , 267, 78 ), // #934
+ INST(Vcvttpd2dq , VexRm_Lx_Narrow , V(660F00,E6,_,x,I,1,4,FV ), 0 , 104, 0 , 268, 145), // #935
+ INST(Vcvttpd2qq , VexRm_Lx , E(660F00,7A,_,x,_,1,4,FV ), 0 , 136, 0 , 269, 152), // #936
+ INST(Vcvttpd2udq , VexRm_Lx_Narrow , E(000F00,78,_,x,_,1,4,FV ), 0 , 137, 0 , 270, 152), // #937
+ INST(Vcvttpd2uqq , VexRm_Lx , E(660F00,78,_,x,_,1,4,FV ), 0 , 136, 0 , 269, 155), // #938
+ INST(Vcvttph2dq , VexRm_Lx , E(F3MAP5,5B,_,_,_,0,3,HV ), 0 , 161, 0 , 250, 146), // #939
+ INST(Vcvttph2qq , VexRm_Lx , E(66MAP5,7A,_,_,_,0,2,QV ), 0 , 142, 0 , 248, 146), // #940
+ INST(Vcvttph2udq , VexRm_Lx , E(00MAP5,78,_,_,_,0,3,HV ), 0 , 143, 0 , 250, 146), // #941
+ INST(Vcvttph2uqq , VexRm_Lx , E(66MAP5,78,_,_,_,0,2,QV ), 0 , 142, 0 , 248, 146), // #942
+ INST(Vcvttph2uw , VexRm_Lx , E(00MAP5,7C,_,_,_,0,4,FV ), 0 , 105, 0 , 271, 146), // #943
+ INST(Vcvttph2w , VexRm_Lx , E(66MAP5,7C,_,_,_,0,4,FV ), 0 , 144, 0 , 271, 146), // #944
+ INST(Vcvttps2dq , VexRm_Lx , V(F30F00,5B,_,x,I,0,4,FV ), 0 , 162, 0 , 272, 145), // #945
+ INST(Vcvttps2qq , VexRm_Lx , E(660F00,7A,_,x,_,0,3,HV ), 0 , 148, 0 , 273, 155), // #946
+ INST(Vcvttps2udq , VexRm_Lx , E(000F00,78,_,x,_,0,4,FV ), 0 , 149, 0 , 274, 152), // #947
+ INST(Vcvttps2uqq , VexRm_Lx , E(660F00,78,_,x,_,0,3,HV ), 0 , 148, 0 , 273, 155), // #948
+ INST(Vcvttsd2si , VexRm_Wx , V(F20F00,2C,_,I,x,x,3,T1F), 0 , 153, 0 , 275, 147), // #949
+ INST(Vcvttsd2usi , VexRm_Wx , E(F20F00,78,_,I,_,x,3,T1F), 0 , 154, 0 , 276, 78 ), // #950
+ INST(Vcvttsh2si , VexRm_Wx , E(F3MAP5,2C,_,_,_,x,1,T1S), 0 , 108, 0 , 277, 148), // #951
+ INST(Vcvttsh2usi , VexRm_Wx , E(F3MAP5,78,_,_,_,x,1,T1S), 0 , 108, 0 , 277, 148), // #952
+ INST(Vcvttss2si , VexRm_Wx , V(F30F00,2C,_,I,x,x,2,T1F), 0 , 109, 0 , 278, 147), // #953
+ INST(Vcvttss2usi , VexRm_Wx , E(F30F00,78,_,I,_,x,2,T1F), 0 , 160, 0 , 279, 78 ), // #954
+ INST(Vcvtudq2pd , VexRm_Lx , E(F30F00,7A,_,x,_,0,3,HV ), 0 , 163, 0 , 280, 152), // #955
+ INST(Vcvtudq2ph , VexRm_Lx_Narrow , E(F2MAP5,7A,_,_,_,0,4,FV ), 0 , 164, 0 , 239, 146), // #956
+ INST(Vcvtudq2ps , VexRm_Lx , E(F20F00,7A,_,x,_,0,4,FV ), 0 , 165, 0 , 256, 152), // #957
+ INST(Vcvtuqq2pd , VexRm_Lx , E(F30F00,7A,_,x,_,1,4,FV ), 0 , 150, 0 , 245, 155), // #958
+ INST(Vcvtuqq2ph , VexRm_Lx , E(F2MAP5,7A,_,_,_,1,4,FV ), 0 , 166, 0 , 244, 146), // #959
+ INST(Vcvtuqq2ps , VexRm_Lx_Narrow , E(F20F00,7A,_,x,_,1,4,FV ), 0 , 167, 0 , 246, 155), // #960
+ INST(Vcvtusi2sd , VexRvm_Wx , E(F20F00,7B,_,I,_,x,2,T1W), 0 , 168, 0 , 281, 78 ), // #961
+ INST(Vcvtusi2sh , VexRvm_Wx , E(F3MAP5,7B,_,_,_,x,2,T1W), 0 , 157, 0 , 263, 148), // #962
+ INST(Vcvtusi2ss , VexRvm_Wx , E(F30F00,7B,_,I,_,x,2,T1W), 0 , 169, 0 , 281, 78 ), // #963
+ INST(Vcvtuw2ph , VexRm_Lx , E(F2MAP5,7D,_,_,_,0,4,FV ), 0 , 164, 0 , 252, 146), // #964
+ INST(Vcvtw2ph , VexRm_Lx , E(F3MAP5,7D,_,_,_,0,4,FV ), 0 , 170, 0 , 252, 146), // #965
+ INST(Vdbpsadbw , VexRvmi_Lx , E(660F3A,42,_,x,_,0,4,FVM), 0 , 112, 0 , 282, 163), // #966
+ INST(Vdivpd , VexRvm_Lx , V(660F00,5E,_,x,I,1,4,FV ), 0 , 104, 0 , 200, 145), // #967
+ INST(Vdivph , VexRvm_Lx , E(00MAP5,5E,_,_,_,0,4,FV ), 0 , 105, 0 , 201, 146), // #968
+ INST(Vdivps , VexRvm_Lx , V(000F00,5E,_,x,I,0,4,FV ), 0 , 106, 0 , 202, 145), // #969
+ INST(Vdivsd , VexRvm , V(F20F00,5E,_,I,I,1,3,T1S), 0 , 107, 0 , 203, 147), // #970
+ INST(Vdivsh , VexRvm , E(F3MAP5,5E,_,_,_,0,1,T1S), 0 , 108, 0 , 204, 148), // #971
+ INST(Vdivss , VexRvm , V(F30F00,5E,_,I,I,0,2,T1S), 0 , 109, 0 , 205, 147), // #972
+ INST(Vdpbf16ps , VexRvm_Lx , E(F30F38,52,_,_,_,0,4,FV ), 0 , 171, 0 , 218, 160), // #973
+ INST(Vdppd , VexRvmi_Lx , V(660F3A,41,_,x,I,_,_,_ ), 0 , 75 , 0 , 283, 149), // #974
+ INST(Vdpps , VexRvmi_Lx , V(660F3A,40,_,x,I,_,_,_ ), 0 , 75 , 0 , 219, 149), // #975
+ INST(Verr , X86M_NoSize , O(000F00,00,4,_,_,_,_,_ ), 0 , 98 , 0 , 112, 11 ), // #976
+ INST(Verw , X86M_NoSize , O(000F00,00,5,_,_,_,_,_ ), 0 , 79 , 0 , 112, 11 ), // #977
+ INST(Vexp2pd , VexRm , E(660F38,C8,_,2,_,1,4,FV ), 0 , 172, 0 , 284, 164), // #978
+ INST(Vexp2ps , VexRm , E(660F38,C8,_,2,_,0,4,FV ), 0 , 173, 0 , 285, 164), // #979
+ INST(Vexpandpd , VexRm_Lx , E(660F38,88,_,x,_,1,3,T1S), 0 , 129, 0 , 286, 152), // #980
+ INST(Vexpandps , VexRm_Lx , E(660F38,88,_,x,_,0,2,T1S), 0 , 130, 0 , 286, 152), // #981
+ INST(Vextractf128 , VexMri , V(660F3A,19,_,1,0,_,_,_ ), 0 , 174, 0 , 287, 149), // #982
+ INST(Vextractf32x4 , VexMri_Lx , E(660F3A,19,_,x,_,0,4,T4 ), 0 , 175, 0 , 288, 152), // #983
+ INST(Vextractf32x8 , VexMri , E(660F3A,1B,_,2,_,0,5,T8 ), 0 , 176, 0 , 289, 76 ), // #984
+ INST(Vextractf64x2 , VexMri_Lx , E(660F3A,19,_,x,_,1,4,T2 ), 0 , 177, 0 , 288, 155), // #985
+ INST(Vextractf64x4 , VexMri , E(660F3A,1B,_,2,_,1,5,T4 ), 0 , 178, 0 , 289, 78 ), // #986
+ INST(Vextracti128 , VexMri , V(660F3A,39,_,1,0,_,_,_ ), 0 , 174, 0 , 287, 156), // #987
+ INST(Vextracti32x4 , VexMri_Lx , E(660F3A,39,_,x,_,0,4,T4 ), 0 , 175, 0 , 288, 152), // #988
+ INST(Vextracti32x8 , VexMri , E(660F3A,3B,_,2,_,0,5,T8 ), 0 , 176, 0 , 289, 76 ), // #989
+ INST(Vextracti64x2 , VexMri_Lx , E(660F3A,39,_,x,_,1,4,T2 ), 0 , 177, 0 , 288, 155), // #990
+ INST(Vextracti64x4 , VexMri , E(660F3A,3B,_,2,_,1,5,T4 ), 0 , 178, 0 , 289, 78 ), // #991
+ INST(Vextractps , VexMri , V(660F3A,17,_,0,I,I,2,T1S), 0 , 179, 0 , 290, 147), // #992
+ INST(Vfcmaddcph , VexRvm_Lx , E(F2MAP6,56,_,_,_,0,4,FV ), 0 , 180, 0 , 291, 146), // #993
+ INST(Vfcmaddcsh , VexRvm , E(F2MAP6,57,_,_,_,0,2,T1S), 0 , 181, 0 , 265, 148), // #994
+ INST(Vfcmulcph , VexRvm_Lx , E(F2MAP6,D6,_,_,_,0,4,FV ), 0 , 180, 0 , 291, 146), // #995
+ INST(Vfcmulcsh , VexRvm , E(F2MAP6,D7,_,_,_,0,2,T1S), 0 , 181, 0 , 265, 148), // #996
+ INST(Vfixupimmpd , VexRvmi_Lx , E(660F3A,54,_,x,_,1,4,FV ), 0 , 113, 0 , 292, 152), // #997
+ INST(Vfixupimmps , VexRvmi_Lx , E(660F3A,54,_,x,_,0,4,FV ), 0 , 112, 0 , 293, 152), // #998
+ INST(Vfixupimmsd , VexRvmi , E(660F3A,55,_,I,_,1,3,T1S), 0 , 182, 0 , 294, 78 ), // #999
+ INST(Vfixupimmss , VexRvmi , E(660F3A,55,_,I,_,0,2,T1S), 0 , 183, 0 , 295, 78 ), // #1000
+ INST(Vfmadd132pd , VexRvm_Lx , V(660F38,98,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1001
+ INST(Vfmadd132ph , VexRvm_Lx , E(66MAP6,98,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1002
+ INST(Vfmadd132ps , VexRvm_Lx , V(660F38,98,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1003
+ INST(Vfmadd132sd , VexRvm , V(660F38,99,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1004
+ INST(Vfmadd132sh , VexRvm , E(66MAP6,99,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1005
+ INST(Vfmadd132ss , VexRvm , V(660F38,99,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1006
+ INST(Vfmadd213pd , VexRvm_Lx , V(660F38,A8,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1007
+ INST(Vfmadd213ph , VexRvm_Lx , E(66MAP6,A8,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1008
+ INST(Vfmadd213ps , VexRvm_Lx , V(660F38,A8,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1009
+ INST(Vfmadd213sd , VexRvm , V(660F38,A9,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1010
+ INST(Vfmadd213sh , VexRvm , E(66MAP6,A9,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1011
+ INST(Vfmadd213ss , VexRvm , V(660F38,A9,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1012
+ INST(Vfmadd231pd , VexRvm_Lx , V(660F38,B8,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1013
+ INST(Vfmadd231ph , VexRvm_Lx , E(66MAP6,B8,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1014
+ INST(Vfmadd231ps , VexRvm_Lx , V(660F38,B8,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1015
+ INST(Vfmadd231sd , VexRvm , V(660F38,B9,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1016
+ INST(Vfmadd231sh , VexRvm , E(66MAP6,B9,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1017
+ INST(Vfmadd231ss , VexRvm , V(660F38,B9,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1018
+ INST(Vfmaddcph , VexRvm_Lx , E(F3MAP6,56,_,_,_,0,4,FV ), 0 , 188, 0 , 291, 146), // #1019
+ INST(Vfmaddcsh , VexRvm , E(F3MAP6,57,_,_,_,0,2,T1S), 0 , 189, 0 , 265, 148), // #1020
+ INST(Vfmaddpd , Fma4_Lx , V(660F3A,69,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1021
+ INST(Vfmaddps , Fma4_Lx , V(660F3A,68,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1022
+ INST(Vfmaddsd , Fma4 , V(660F3A,6B,_,0,x,_,_,_ ), 0 , 75 , 0 , 297, 167), // #1023
+ INST(Vfmaddss , Fma4 , V(660F3A,6A,_,0,x,_,_,_ ), 0 , 75 , 0 , 298, 167), // #1024
+ INST(Vfmaddsub132pd , VexRvm_Lx , V(660F38,96,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1025
+ INST(Vfmaddsub132ph , VexRvm_Lx , E(66MAP6,96,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1026
+ INST(Vfmaddsub132ps , VexRvm_Lx , V(660F38,96,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1027
+ INST(Vfmaddsub213pd , VexRvm_Lx , V(660F38,A6,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1028
+ INST(Vfmaddsub213ph , VexRvm_Lx , E(66MAP6,A6,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1029
+ INST(Vfmaddsub213ps , VexRvm_Lx , V(660F38,A6,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1030
+ INST(Vfmaddsub231pd , VexRvm_Lx , V(660F38,B6,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1031
+ INST(Vfmaddsub231ph , VexRvm_Lx , E(66MAP6,B6,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1032
+ INST(Vfmaddsub231ps , VexRvm_Lx , V(660F38,B6,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1033
+ INST(Vfmaddsubpd , Fma4_Lx , V(660F3A,5D,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1034
+ INST(Vfmaddsubps , Fma4_Lx , V(660F3A,5C,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1035
+ INST(Vfmsub132pd , VexRvm_Lx , V(660F38,9A,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1036
+ INST(Vfmsub132ph , VexRvm_Lx , E(66MAP6,9A,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1037
+ INST(Vfmsub132ps , VexRvm_Lx , V(660F38,9A,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1038
+ INST(Vfmsub132sd , VexRvm , V(660F38,9B,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1039
+ INST(Vfmsub132sh , VexRvm , E(66MAP6,9B,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1040
+ INST(Vfmsub132ss , VexRvm , V(660F38,9B,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1041
+ INST(Vfmsub213pd , VexRvm_Lx , V(660F38,AA,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1042
+ INST(Vfmsub213ph , VexRvm_Lx , E(66MAP6,AA,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1043
+ INST(Vfmsub213ps , VexRvm_Lx , V(660F38,AA,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1044
+ INST(Vfmsub213sd , VexRvm , V(660F38,AB,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1045
+ INST(Vfmsub213sh , VexRvm , E(66MAP6,AB,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1046
+ INST(Vfmsub213ss , VexRvm , V(660F38,AB,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1047
+ INST(Vfmsub231pd , VexRvm_Lx , V(660F38,BA,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1048
+ INST(Vfmsub231ph , VexRvm_Lx , E(66MAP6,BA,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1049
+ INST(Vfmsub231ps , VexRvm_Lx , V(660F38,BA,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1050
+ INST(Vfmsub231sd , VexRvm , V(660F38,BB,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1051
+ INST(Vfmsub231sh , VexRvm , E(66MAP6,BB,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1052
+ INST(Vfmsub231ss , VexRvm , V(660F38,BB,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1053
+ INST(Vfmsubadd132pd , VexRvm_Lx , V(660F38,97,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1054
+ INST(Vfmsubadd132ph , VexRvm_Lx , E(66MAP6,97,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1055
+ INST(Vfmsubadd132ps , VexRvm_Lx , V(660F38,97,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1056
+ INST(Vfmsubadd213pd , VexRvm_Lx , V(660F38,A7,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1057
+ INST(Vfmsubadd213ph , VexRvm_Lx , E(66MAP6,A7,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1058
+ INST(Vfmsubadd213ps , VexRvm_Lx , V(660F38,A7,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1059
+ INST(Vfmsubadd231pd , VexRvm_Lx , V(660F38,B7,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1060
+ INST(Vfmsubadd231ph , VexRvm_Lx , E(66MAP6,B7,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1061
+ INST(Vfmsubadd231ps , VexRvm_Lx , V(660F38,B7,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1062
+ INST(Vfmsubaddpd , Fma4_Lx , V(660F3A,5F,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1063
+ INST(Vfmsubaddps , Fma4_Lx , V(660F3A,5E,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1064
+ INST(Vfmsubpd , Fma4_Lx , V(660F3A,6D,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1065
+ INST(Vfmsubps , Fma4_Lx , V(660F3A,6C,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1066
+ INST(Vfmsubsd , Fma4 , V(660F3A,6F,_,0,x,_,_,_ ), 0 , 75 , 0 , 297, 167), // #1067
+ INST(Vfmsubss , Fma4 , V(660F3A,6E,_,0,x,_,_,_ ), 0 , 75 , 0 , 298, 167), // #1068
+ INST(Vfmulcph , VexRvm_Lx , E(F3MAP6,D6,_,_,_,0,4,FV ), 0 , 188, 0 , 291, 146), // #1069
+ INST(Vfmulcsh , VexRvm , E(F3MAP6,D7,_,_,_,0,2,T1S), 0 , 189, 0 , 265, 146), // #1070
+ INST(Vfnmadd132pd , VexRvm_Lx , V(660F38,9C,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1071
+ INST(Vfnmadd132ph , VexRvm_Lx , E(66MAP6,9C,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1072
+ INST(Vfnmadd132ps , VexRvm_Lx , V(660F38,9C,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1073
+ INST(Vfnmadd132sd , VexRvm , V(660F38,9D,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1074
+ INST(Vfnmadd132sh , VexRvm , E(66MAP6,9D,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1075
+ INST(Vfnmadd132ss , VexRvm , V(660F38,9D,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1076
+ INST(Vfnmadd213pd , VexRvm_Lx , V(660F38,AC,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1077
+ INST(Vfnmadd213ph , VexRvm_Lx , E(66MAP6,AC,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1078
+ INST(Vfnmadd213ps , VexRvm_Lx , V(660F38,AC,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1079
+ INST(Vfnmadd213sd , VexRvm , V(660F38,AD,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1080
+ INST(Vfnmadd213sh , VexRvm , E(66MAP6,AD,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1081
+ INST(Vfnmadd213ss , VexRvm , V(660F38,AD,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1082
+ INST(Vfnmadd231pd , VexRvm_Lx , V(660F38,BC,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1083
+ INST(Vfnmadd231ph , VexRvm_Lx , E(66MAP6,BC,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1084
+ INST(Vfnmadd231ps , VexRvm_Lx , V(660F38,BC,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1085
+ INST(Vfnmadd231sd , VexRvm , V(660F38,BD,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1086
+ INST(Vfnmadd231sh , VexRvm , E(66MAP6,BD,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1087
+ INST(Vfnmadd231ss , VexRvm , V(660F38,BD,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1088
+ INST(Vfnmaddpd , Fma4_Lx , V(660F3A,79,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1089
+ INST(Vfnmaddps , Fma4_Lx , V(660F3A,78,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1090
+ INST(Vfnmaddsd , Fma4 , V(660F3A,7B,_,0,x,_,_,_ ), 0 , 75 , 0 , 297, 167), // #1091
+ INST(Vfnmaddss , Fma4 , V(660F3A,7A,_,0,x,_,_,_ ), 0 , 75 , 0 , 298, 167), // #1092
+ INST(Vfnmsub132pd , VexRvm_Lx , V(660F38,9E,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1093
+ INST(Vfnmsub132ph , VexRvm_Lx , E(66MAP6,9E,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1094
+ INST(Vfnmsub132ps , VexRvm_Lx , V(660F38,9E,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1095
+ INST(Vfnmsub132sd , VexRvm , V(660F38,9F,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1096
+ INST(Vfnmsub132sh , VexRvm , E(66MAP6,9F,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1097
+ INST(Vfnmsub132ss , VexRvm , V(660F38,9F,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1098
+ INST(Vfnmsub213pd , VexRvm_Lx , V(660F38,AE,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1099
+ INST(Vfnmsub213ph , VexRvm_Lx , E(66MAP6,AE,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1100
+ INST(Vfnmsub213ps , VexRvm_Lx , V(660F38,AE,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1101
+ INST(Vfnmsub213sd , VexRvm , V(660F38,AF,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1102
+ INST(Vfnmsub213sh , VexRvm , E(66MAP6,AF,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1103
+ INST(Vfnmsub213ss , VexRvm , V(660F38,AF,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1104
+ INST(Vfnmsub231pd , VexRvm_Lx , V(660F38,BE,_,x,1,1,4,FV ), 0 , 184, 0 , 200, 165), // #1105
+ INST(Vfnmsub231ph , VexRvm_Lx , E(66MAP6,BE,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1106
+ INST(Vfnmsub231ps , VexRvm_Lx , V(660F38,BE,_,x,0,0,4,FV ), 0 , 111, 0 , 202, 165), // #1107
+ INST(Vfnmsub231sd , VexRvm , V(660F38,BF,_,I,1,1,3,T1S), 0 , 186, 0 , 203, 166), // #1108
+ INST(Vfnmsub231sh , VexRvm , E(66MAP6,BF,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1109
+ INST(Vfnmsub231ss , VexRvm , V(660F38,BF,_,I,0,0,2,T1S), 0 , 123, 0 , 205, 166), // #1110
+ INST(Vfnmsubpd , Fma4_Lx , V(660F3A,7D,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1111
+ INST(Vfnmsubps , Fma4_Lx , V(660F3A,7C,_,x,x,_,_,_ ), 0 , 75 , 0 , 296, 167), // #1112
+ INST(Vfnmsubsd , Fma4 , V(660F3A,7F,_,0,x,_,_,_ ), 0 , 75 , 0 , 297, 167), // #1113
+ INST(Vfnmsubss , Fma4 , V(660F3A,7E,_,0,x,_,_,_ ), 0 , 75 , 0 , 298, 167), // #1114
+ INST(Vfpclasspd , VexRmi_Lx , E(660F3A,66,_,x,_,1,4,FV ), 0 , 113, 0 , 299, 155), // #1115
+ INST(Vfpclassph , VexRmi_Lx , E(000F3A,66,_,_,_,0,4,FV ), 0 , 124, 0 , 300, 146), // #1116
+ INST(Vfpclassps , VexRmi_Lx , E(660F3A,66,_,x,_,0,4,FV ), 0 , 112, 0 , 301, 155), // #1117
+ INST(Vfpclasssd , VexRmi , E(660F3A,67,_,I,_,1,3,T1S), 0 , 182, 0 , 302, 76 ), // #1118
+ INST(Vfpclasssh , VexRmi , E(000F3A,67,_,_,_,0,1,T1S), 0 , 190, 0 , 303, 148), // #1119
+ INST(Vfpclassss , VexRmi , E(660F3A,67,_,I,_,0,2,T1S), 0 , 183, 0 , 304, 76 ), // #1120
+ INST(Vfrczpd , VexRm_Lx , V(XOP_M9,81,_,x,0,_,_,_ ), 0 , 81 , 0 , 305, 168), // #1121
+ INST(Vfrczps , VexRm_Lx , V(XOP_M9,80,_,x,0,_,_,_ ), 0 , 81 , 0 , 305, 168), // #1122
+ INST(Vfrczsd , VexRm , V(XOP_M9,83,_,0,0,_,_,_ ), 0 , 81 , 0 , 306, 168), // #1123
+ INST(Vfrczss , VexRm , V(XOP_M9,82,_,0,0,_,_,_ ), 0 , 81 , 0 , 307, 168), // #1124
+ INST(Vgatherdpd , VexRmvRm_VM , V(660F38,92,_,x,1,_,_,_ ), E(660F38,92,_,x,_,1,3,T1S), 191, 80 , 308, 169), // #1125
+ INST(Vgatherdps , VexRmvRm_VM , V(660F38,92,_,x,0,_,_,_ ), E(660F38,92,_,x,_,0,2,T1S), 30 , 81 , 309, 169), // #1126
+ INST(Vgatherpf0dpd , VexM_VM , E(660F38,C6,1,2,_,1,3,T1S), 0 , 192, 0 , 310, 170), // #1127
+ INST(Vgatherpf0dps , VexM_VM , E(660F38,C6,1,2,_,0,2,T1S), 0 , 193, 0 , 311, 170), // #1128
+ INST(Vgatherpf0qpd , VexM_VM , E(660F38,C7,1,2,_,1,3,T1S), 0 , 192, 0 , 312, 170), // #1129
+ INST(Vgatherpf0qps , VexM_VM , E(660F38,C7,1,2,_,0,2,T1S), 0 , 193, 0 , 312, 170), // #1130
+ INST(Vgatherpf1dpd , VexM_VM , E(660F38,C6,2,2,_,1,3,T1S), 0 , 194, 0 , 310, 170), // #1131
+ INST(Vgatherpf1dps , VexM_VM , E(660F38,C6,2,2,_,0,2,T1S), 0 , 195, 0 , 311, 170), // #1132
+ INST(Vgatherpf1qpd , VexM_VM , E(660F38,C7,2,2,_,1,3,T1S), 0 , 194, 0 , 312, 170), // #1133
+ INST(Vgatherpf1qps , VexM_VM , E(660F38,C7,2,2,_,0,2,T1S), 0 , 195, 0 , 312, 170), // #1134
+ INST(Vgatherqpd , VexRmvRm_VM , V(660F38,93,_,x,1,_,_,_ ), E(660F38,93,_,x,_,1,3,T1S), 191, 82 , 313, 169), // #1135
+ INST(Vgatherqps , VexRmvRm_VM , V(660F38,93,_,x,0,_,_,_ ), E(660F38,93,_,x,_,0,2,T1S), 30 , 83 , 314, 169), // #1136
+ INST(Vgetexppd , VexRm_Lx , E(660F38,42,_,x,_,1,4,FV ), 0 , 114, 0 , 269, 152), // #1137
+ INST(Vgetexpph , VexRm_Lx , E(66MAP6,42,_,_,_,0,4,FV ), 0 , 185, 0 , 271, 146), // #1138
+ INST(Vgetexpps , VexRm_Lx , E(660F38,42,_,x,_,0,4,FV ), 0 , 115, 0 , 274, 152), // #1139
+ INST(Vgetexpsd , VexRvm , E(660F38,43,_,I,_,1,3,T1S), 0 , 129, 0 , 315, 78 ), // #1140
+ INST(Vgetexpsh , VexRvm , E(66MAP6,43,_,_,_,0,1,T1S), 0 , 187, 0 , 260, 148), // #1141
+ INST(Vgetexpss , VexRvm , E(660F38,43,_,I,_,0,2,T1S), 0 , 130, 0 , 316, 78 ), // #1142
+ INST(Vgetmantpd , VexRmi_Lx , E(660F3A,26,_,x,_,1,4,FV ), 0 , 113, 0 , 317, 152), // #1143
+ INST(Vgetmantph , VexRmi_Lx , E(000F3A,26,_,_,_,0,4,FV ), 0 , 124, 0 , 318, 146), // #1144
+ INST(Vgetmantps , VexRmi_Lx , E(660F3A,26,_,x,_,0,4,FV ), 0 , 112, 0 , 319, 152), // #1145
+ INST(Vgetmantsd , VexRvmi , E(660F3A,27,_,I,_,1,3,T1S), 0 , 182, 0 , 294, 78 ), // #1146
+ INST(Vgetmantsh , VexRvmi , E(000F3A,27,_,_,_,0,1,T1S), 0 , 190, 0 , 320, 148), // #1147
+ INST(Vgetmantss , VexRvmi , E(660F3A,27,_,I,_,0,2,T1S), 0 , 183, 0 , 295, 78 ), // #1148
+ INST(Vgf2p8affineinvqb, VexRvmi_Lx , V(660F3A,CF,_,x,1,1,4,FV ), 0 , 196, 0 , 321, 171), // #1149
+ INST(Vgf2p8affineqb , VexRvmi_Lx , V(660F3A,CE,_,x,1,1,4,FV ), 0 , 196, 0 , 321, 171), // #1150
+ INST(Vgf2p8mulb , VexRvm_Lx , V(660F38,CF,_,x,0,0,4,FV ), 0 , 111, 0 , 322, 171), // #1151
+ INST(Vhaddpd , VexRvm_Lx , V(660F00,7C,_,x,I,_,_,_ ), 0 , 71 , 0 , 206, 149), // #1152
+ INST(Vhaddps , VexRvm_Lx , V(F20F00,7C,_,x,I,_,_,_ ), 0 , 110, 0 , 206, 149), // #1153
+ INST(Vhsubpd , VexRvm_Lx , V(660F00,7D,_,x,I,_,_,_ ), 0 , 71 , 0 , 206, 149), // #1154
+ INST(Vhsubps , VexRvm_Lx , V(F20F00,7D,_,x,I,_,_,_ ), 0 , 110, 0 , 206, 149), // #1155
+ INST(Vinsertf128 , VexRvmi , V(660F3A,18,_,1,0,_,_,_ ), 0 , 174, 0 , 323, 149), // #1156
+ INST(Vinsertf32x4 , VexRvmi_Lx , E(660F3A,18,_,x,_,0,4,T4 ), 0 , 175, 0 , 324, 152), // #1157
+ INST(Vinsertf32x8 , VexRvmi , E(660F3A,1A,_,2,_,0,5,T8 ), 0 , 176, 0 , 325, 76 ), // #1158
+ INST(Vinsertf64x2 , VexRvmi_Lx , E(660F3A,18,_,x,_,1,4,T2 ), 0 , 177, 0 , 324, 155), // #1159
+ INST(Vinsertf64x4 , VexRvmi , E(660F3A,1A,_,2,_,1,5,T4 ), 0 , 178, 0 , 325, 78 ), // #1160
+ INST(Vinserti128 , VexRvmi , V(660F3A,38,_,1,0,_,_,_ ), 0 , 174, 0 , 323, 156), // #1161
+ INST(Vinserti32x4 , VexRvmi_Lx , E(660F3A,38,_,x,_,0,4,T4 ), 0 , 175, 0 , 324, 152), // #1162
+ INST(Vinserti32x8 , VexRvmi , E(660F3A,3A,_,2,_,0,5,T8 ), 0 , 176, 0 , 325, 76 ), // #1163
+ INST(Vinserti64x2 , VexRvmi_Lx , E(660F3A,38,_,x,_,1,4,T2 ), 0 , 177, 0 , 324, 155), // #1164
+ INST(Vinserti64x4 , VexRvmi , E(660F3A,3A,_,2,_,1,5,T4 ), 0 , 178, 0 , 325, 78 ), // #1165
+ INST(Vinsertps , VexRvmi , V(660F3A,21,_,0,I,0,2,T1S), 0 , 179, 0 , 326, 147), // #1166
+ INST(Vlddqu , VexRm_Lx , V(F20F00,F0,_,x,I,_,_,_ ), 0 , 110, 0 , 241, 149), // #1167
+ INST(Vldmxcsr , VexM , V(000F00,AE,2,0,I,_,_,_ ), 0 , 197, 0 , 327, 149), // #1168
+ INST(Vmaskmovdqu , VexRm_ZDI , V(660F00,F7,_,0,I,_,_,_ ), 0 , 71 , 0 , 328, 149), // #1169
+ INST(Vmaskmovpd , VexRvmMvr_Lx , V(660F38,2D,_,x,0,_,_,_ ), V(660F38,2F,_,x,0,_,_,_ ), 30 , 84 , 329, 149), // #1170
+ INST(Vmaskmovps , VexRvmMvr_Lx , V(660F38,2C,_,x,0,_,_,_ ), V(660F38,2E,_,x,0,_,_,_ ), 30 , 85 , 329, 149), // #1171
+ INST(Vmaxpd , VexRvm_Lx , V(660F00,5F,_,x,I,1,4,FV ), 0 , 104, 0 , 330, 145), // #1172
+ INST(Vmaxph , VexRvm_Lx , E(00MAP5,5F,_,_,_,0,4,FV ), 0 , 105, 0 , 331, 146), // #1173
+ INST(Vmaxps , VexRvm_Lx , V(000F00,5F,_,x,I,0,4,FV ), 0 , 106, 0 , 332, 145), // #1174
+ INST(Vmaxsd , VexRvm , V(F20F00,5F,_,I,I,1,3,T1S), 0 , 107, 0 , 333, 147), // #1175
+ INST(Vmaxsh , VexRvm , E(F3MAP5,5F,_,_,_,0,1,T1S), 0 , 108, 0 , 260, 148), // #1176
+ INST(Vmaxss , VexRvm , V(F30F00,5F,_,I,I,0,2,T1S), 0 , 109, 0 , 264, 147), // #1177
+ INST(Vmcall , X86Op , O(000F01,C1,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 67 ), // #1178
+ INST(Vmclear , X86M_Only , O(660F00,C7,6,_,_,_,_,_ ), 0 , 28 , 0 , 33 , 67 ), // #1179
+ INST(Vmfunc , X86Op , O(000F01,D4,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 67 ), // #1180
+ INST(Vmgexit , X86Op , O(F20F01,D9,_,_,_,_,_,_ ), 0 , 93 , 0 , 31 , 172), // #1181
+ INST(Vminpd , VexRvm_Lx , V(660F00,5D,_,x,I,1,4,FV ), 0 , 104, 0 , 330, 145), // #1182
+ INST(Vminph , VexRvm_Lx , E(00MAP5,5D,_,_,_,0,4,FV ), 0 , 105, 0 , 331, 146), // #1183
+ INST(Vminps , VexRvm_Lx , V(000F00,5D,_,x,I,0,4,FV ), 0 , 106, 0 , 332, 145), // #1184
+ INST(Vminsd , VexRvm , V(F20F00,5D,_,I,I,1,3,T1S), 0 , 107, 0 , 333, 147), // #1185
+ INST(Vminsh , VexRvm , E(F3MAP5,5D,_,_,_,0,1,T1S), 0 , 108, 0 , 260, 148), // #1186
+ INST(Vminss , VexRvm , V(F30F00,5D,_,I,I,0,2,T1S), 0 , 109, 0 , 264, 147), // #1187
+ INST(Vmlaunch , X86Op , O(000F01,C2,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 67 ), // #1188
+ INST(Vmload , X86Op_xAX , O(000F01,DA,_,_,_,_,_,_ ), 0 , 23 , 0 , 334, 23 ), // #1189
+ INST(Vmmcall , X86Op , O(000F01,D9,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 23 ), // #1190
+ INST(Vmovapd , VexRmMr_Lx , V(660F00,28,_,x,I,1,4,FVM), V(660F00,29,_,x,I,1,4,FVM), 104, 86 , 335, 173), // #1191
+ INST(Vmovaps , VexRmMr_Lx , V(000F00,28,_,x,I,0,4,FVM), V(000F00,29,_,x,I,0,4,FVM), 106, 87 , 335, 173), // #1192
+ INST(Vmovd , VexMovdMovq , V(660F00,6E,_,0,0,0,2,T1S), V(660F00,7E,_,0,0,0,2,T1S), 198, 88 , 336, 147), // #1193
+ INST(Vmovddup , VexRm_Lx , V(F20F00,12,_,x,I,1,3,DUP), 0 , 199, 0 , 337, 145), // #1194
+ INST(Vmovdqa , VexRmMr_Lx , V(660F00,6F,_,x,I,_,_,_ ), V(660F00,7F,_,x,I,_,_,_ ), 71 , 89 , 338, 174), // #1195
+ INST(Vmovdqa32 , VexRmMr_Lx , E(660F00,6F,_,x,_,0,4,FVM), E(660F00,7F,_,x,_,0,4,FVM), 200, 90 , 339, 175), // #1196
+ INST(Vmovdqa64 , VexRmMr_Lx , E(660F00,6F,_,x,_,1,4,FVM), E(660F00,7F,_,x,_,1,4,FVM), 136, 91 , 339, 175), // #1197
+ INST(Vmovdqu , VexRmMr_Lx , V(F30F00,6F,_,x,I,_,_,_ ), V(F30F00,7F,_,x,I,_,_,_ ), 201, 92 , 338, 174), // #1198
+ INST(Vmovdqu16 , VexRmMr_Lx , E(F20F00,6F,_,x,_,1,4,FVM), E(F20F00,7F,_,x,_,1,4,FVM), 167, 93 , 339, 176), // #1199
+ INST(Vmovdqu32 , VexRmMr_Lx , E(F30F00,6F,_,x,_,0,4,FVM), E(F30F00,7F,_,x,_,0,4,FVM), 202, 94 , 339, 175), // #1200
+ INST(Vmovdqu64 , VexRmMr_Lx , E(F30F00,6F,_,x,_,1,4,FVM), E(F30F00,7F,_,x,_,1,4,FVM), 150, 95 , 339, 175), // #1201
+ INST(Vmovdqu8 , VexRmMr_Lx , E(F20F00,6F,_,x,_,0,4,FVM), E(F20F00,7F,_,x,_,0,4,FVM), 165, 96 , 339, 176), // #1202
+ INST(Vmovhlps , VexRvm , V(000F00,12,_,0,I,0,_,_ ), 0 , 74 , 0 , 340, 147), // #1203
+ INST(Vmovhpd , VexRvmMr , V(660F00,16,_,0,I,1,3,T1S), V(660F00,17,_,0,I,1,3,T1S), 126, 97 , 341, 147), // #1204
+ INST(Vmovhps , VexRvmMr , V(000F00,16,_,0,I,0,3,T2 ), V(000F00,17,_,0,I,0,3,T2 ), 203, 98 , 341, 147), // #1205
+ INST(Vmovlhps , VexRvm , V(000F00,16,_,0,I,0,_,_ ), 0 , 74 , 0 , 340, 147), // #1206
+ INST(Vmovlpd , VexRvmMr , V(660F00,12,_,0,I,1,3,T1S), V(660F00,13,_,0,I,1,3,T1S), 126, 99 , 341, 147), // #1207
+ INST(Vmovlps , VexRvmMr , V(000F00,12,_,0,I,0,3,T2 ), V(000F00,13,_,0,I,0,3,T2 ), 203, 100, 341, 147), // #1208
+ INST(Vmovmskpd , VexRm_Lx , V(660F00,50,_,x,I,_,_,_ ), 0 , 71 , 0 , 342, 149), // #1209
+ INST(Vmovmskps , VexRm_Lx , V(000F00,50,_,x,I,_,_,_ ), 0 , 74 , 0 , 342, 149), // #1210
+ INST(Vmovntdq , VexMr_Lx , V(660F00,E7,_,x,I,0,4,FVM), 0 , 145, 0 , 343, 145), // #1211
+ INST(Vmovntdqa , VexRm_Lx , V(660F38,2A,_,x,I,0,4,FVM), 0 , 111, 0 , 344, 157), // #1212
+ INST(Vmovntpd , VexMr_Lx , V(660F00,2B,_,x,I,1,4,FVM), 0 , 104, 0 , 343, 145), // #1213
+ INST(Vmovntps , VexMr_Lx , V(000F00,2B,_,x,I,0,4,FVM), 0 , 106, 0 , 343, 145), // #1214
+ INST(Vmovq , VexMovdMovq , V(660F00,6E,_,0,I,1,3,T1S), V(660F00,7E,_,0,I,1,3,T1S), 126, 101, 345, 177), // #1215
+ INST(Vmovsd , VexMovssMovsd , V(F20F00,10,_,I,I,1,3,T1S), V(F20F00,11,_,I,I,1,3,T1S), 107, 102, 346, 177), // #1216
+ INST(Vmovsh , VexMovssMovsd , E(F3MAP5,10,_,I,_,0,1,T1S), E(F3MAP5,11,_,I,_,0,1,T1S), 108, 103, 347, 148), // #1217
+ INST(Vmovshdup , VexRm_Lx , V(F30F00,16,_,x,I,0,4,FVM), 0 , 162, 0 , 348, 145), // #1218
+ INST(Vmovsldup , VexRm_Lx , V(F30F00,12,_,x,I,0,4,FVM), 0 , 162, 0 , 348, 145), // #1219
+ INST(Vmovss , VexMovssMovsd , V(F30F00,10,_,I,I,0,2,T1S), V(F30F00,11,_,I,I,0,2,T1S), 109, 104, 349, 177), // #1220
+ INST(Vmovupd , VexRmMr_Lx , V(660F00,10,_,x,I,1,4,FVM), V(660F00,11,_,x,I,1,4,FVM), 104, 105, 335, 173), // #1221
+ INST(Vmovups , VexRmMr_Lx , V(000F00,10,_,x,I,0,4,FVM), V(000F00,11,_,x,I,0,4,FVM), 106, 106, 335, 173), // #1222
+ INST(Vmovw , VexMovdMovq , E(66MAP5,6E,_,0,_,I,1,T1S), E(66MAP5,7E,_,0,_,I,1,T1S), 204, 107, 350, 148), // #1223
+ INST(Vmpsadbw , VexRvmi_Lx , V(660F3A,42,_,x,I,_,_,_ ), 0 , 75 , 0 , 219, 178), // #1224
+ INST(Vmptrld , X86M_Only , O(000F00,C7,6,_,_,_,_,_ ), 0 , 82 , 0 , 33 , 67 ), // #1225
+ INST(Vmptrst , X86M_Only , O(000F00,C7,7,_,_,_,_,_ ), 0 , 24 , 0 , 33 , 67 ), // #1226
+ INST(Vmread , X86Mr_NoSize , O(000F00,78,_,_,_,_,_,_ ), 0 , 5 , 0 , 351, 67 ), // #1227
+ INST(Vmresume , X86Op , O(000F01,C3,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 67 ), // #1228
+ INST(Vmrun , X86Op_xAX , O(000F01,D8,_,_,_,_,_,_ ), 0 , 23 , 0 , 334, 23 ), // #1229
+ INST(Vmsave , X86Op_xAX , O(000F01,DB,_,_,_,_,_,_ ), 0 , 23 , 0 , 334, 23 ), // #1230
+ INST(Vmulpd , VexRvm_Lx , V(660F00,59,_,x,I,1,4,FV ), 0 , 104, 0 , 200, 145), // #1231
+ INST(Vmulph , VexRvm_Lx , E(00MAP5,59,_,_,_,0,4,FV ), 0 , 105, 0 , 201, 146), // #1232
+ INST(Vmulps , VexRvm_Lx , V(000F00,59,_,x,I,0,4,FV ), 0 , 106, 0 , 202, 145), // #1233
+ INST(Vmulsd , VexRvm , V(F20F00,59,_,I,I,1,3,T1S), 0 , 107, 0 , 203, 147), // #1234
+ INST(Vmulsh , VexRvm , E(F3MAP5,59,_,_,_,0,1,T1S), 0 , 108, 0 , 204, 148), // #1235
+ INST(Vmulss , VexRvm , V(F30F00,59,_,I,I,0,2,T1S), 0 , 109, 0 , 205, 147), // #1236
+ INST(Vmwrite , X86Rm_NoSize , O(000F00,79,_,_,_,_,_,_ ), 0 , 5 , 0 , 352, 67 ), // #1237
+ INST(Vmxoff , X86Op , O(000F01,C4,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 67 ), // #1238
+ INST(Vmxon , X86M_Only , O(F30F00,C7,6,_,_,_,_,_ ), 0 , 26 , 0 , 33 , 67 ), // #1239
+ INST(Vorpd , VexRvm_Lx , V(660F00,56,_,x,I,1,4,FV ), 0 , 104, 0 , 214, 153), // #1240
+ INST(Vorps , VexRvm_Lx , V(000F00,56,_,x,I,0,4,FV ), 0 , 106, 0 , 215, 153), // #1241
+ INST(Vp2intersectd , VexRvm_Lx_2xK , E(F20F38,68,_,_,_,0,4,FV ), 0 , 132, 0 , 353, 179), // #1242
+ INST(Vp2intersectq , VexRvm_Lx_2xK , E(F20F38,68,_,_,_,1,4,FV ), 0 , 205, 0 , 354, 179), // #1243
+ INST(Vp4dpwssd , VexRm_T1_4X , E(F20F38,52,_,2,_,0,4,T4X), 0 , 102, 0 , 198, 180), // #1244
+ INST(Vp4dpwssds , VexRm_T1_4X , E(F20F38,53,_,2,_,0,4,T4X), 0 , 102, 0 , 198, 180), // #1245
+ INST(Vpabsb , VexRm_Lx , V(660F38,1C,_,x,I,_,4,FVM), 0 , 111, 0 , 348, 181), // #1246
+ INST(Vpabsd , VexRm_Lx , V(660F38,1E,_,x,I,0,4,FV ), 0 , 111, 0 , 355, 157), // #1247
+ INST(Vpabsq , VexRm_Lx , E(660F38,1F,_,x,_,1,4,FV ), 0 , 114, 0 , 356, 152), // #1248
+ INST(Vpabsw , VexRm_Lx , V(660F38,1D,_,x,I,_,4,FVM), 0 , 111, 0 , 348, 181), // #1249
+ INST(Vpackssdw , VexRvm_Lx , V(660F00,6B,_,x,I,0,4,FV ), 0 , 145, 0 , 213, 181), // #1250
+ INST(Vpacksswb , VexRvm_Lx , V(660F00,63,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1251
+ INST(Vpackusdw , VexRvm_Lx , V(660F38,2B,_,x,I,0,4,FV ), 0 , 111, 0 , 213, 181), // #1252
+ INST(Vpackuswb , VexRvm_Lx , V(660F00,67,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1253
+ INST(Vpaddb , VexRvm_Lx , V(660F00,FC,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1254
+ INST(Vpaddd , VexRvm_Lx , V(660F00,FE,_,x,I,0,4,FV ), 0 , 145, 0 , 213, 157), // #1255
+ INST(Vpaddq , VexRvm_Lx , V(660F00,D4,_,x,I,1,4,FV ), 0 , 104, 0 , 212, 157), // #1256
+ INST(Vpaddsb , VexRvm_Lx , V(660F00,EC,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1257
+ INST(Vpaddsw , VexRvm_Lx , V(660F00,ED,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1258
+ INST(Vpaddusb , VexRvm_Lx , V(660F00,DC,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1259
+ INST(Vpaddusw , VexRvm_Lx , V(660F00,DD,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1260
+ INST(Vpaddw , VexRvm_Lx , V(660F00,FD,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1261
+ INST(Vpalignr , VexRvmi_Lx , V(660F3A,0F,_,x,I,I,4,FVM), 0 , 206, 0 , 321, 181), // #1262
+ INST(Vpand , VexRvm_Lx , V(660F00,DB,_,x,I,_,_,_ ), 0 , 71 , 0 , 357, 178), // #1263
+ INST(Vpandd , VexRvm_Lx , E(660F00,DB,_,x,_,0,4,FV ), 0 , 200, 0 , 358, 152), // #1264
+ INST(Vpandn , VexRvm_Lx , V(660F00,DF,_,x,I,_,_,_ ), 0 , 71 , 0 , 359, 178), // #1265
+ INST(Vpandnd , VexRvm_Lx , E(660F00,DF,_,x,_,0,4,FV ), 0 , 200, 0 , 360, 152), // #1266
+ INST(Vpandnq , VexRvm_Lx , E(660F00,DF,_,x,_,1,4,FV ), 0 , 136, 0 , 361, 152), // #1267
+ INST(Vpandq , VexRvm_Lx , E(660F00,DB,_,x,_,1,4,FV ), 0 , 136, 0 , 362, 152), // #1268
+ INST(Vpavgb , VexRvm_Lx , V(660F00,E0,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1269
+ INST(Vpavgw , VexRvm_Lx , V(660F00,E3,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1270
+ INST(Vpblendd , VexRvmi_Lx , V(660F3A,02,_,x,0,_,_,_ ), 0 , 75 , 0 , 219, 156), // #1271
+ INST(Vpblendmb , VexRvm_Lx , E(660F38,66,_,x,_,0,4,FVM), 0 , 115, 0 , 363, 163), // #1272
+ INST(Vpblendmd , VexRvm_Lx , E(660F38,64,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 152), // #1273
+ INST(Vpblendmq , VexRvm_Lx , E(660F38,64,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1274
+ INST(Vpblendmw , VexRvm_Lx , E(660F38,66,_,x,_,1,4,FVM), 0 , 114, 0 , 363, 163), // #1275
+ INST(Vpblendvb , VexRvmr_Lx , V(660F3A,4C,_,x,0,_,_,_ ), 0 , 75 , 0 , 220, 178), // #1276
+ INST(Vpblendw , VexRvmi_Lx , V(660F3A,0E,_,x,I,_,_,_ ), 0 , 75 , 0 , 219, 178), // #1277
+ INST(Vpbroadcastb , VexRm_Lx_Bcst , V(660F38,78,_,x,0,0,0,T1S), E(660F38,7A,_,x,0,0,0,T1S), 30 , 108, 364, 182), // #1278
+ INST(Vpbroadcastd , VexRm_Lx_Bcst , V(660F38,58,_,x,0,0,2,T1S), E(660F38,7C,_,x,0,0,0,T1S), 123, 109, 365, 169), // #1279
+ INST(Vpbroadcastmb2q , VexRm_Lx , E(F30F38,2A,_,x,_,1,_,_ ), 0 , 207, 0 , 366, 183), // #1280
+ INST(Vpbroadcastmw2d , VexRm_Lx , E(F30F38,3A,_,x,_,0,_,_ ), 0 , 208, 0 , 366, 183), // #1281
+ INST(Vpbroadcastq , VexRm_Lx_Bcst , V(660F38,59,_,x,0,1,3,T1S), E(660F38,7C,_,x,0,1,0,T1S), 122, 110, 367, 169), // #1282
+ INST(Vpbroadcastw , VexRm_Lx_Bcst , V(660F38,79,_,x,0,0,1,T1S), E(660F38,7B,_,x,0,0,0,T1S), 209, 111, 368, 182), // #1283
+ INST(Vpclmulqdq , VexRvmi_Lx , V(660F3A,44,_,x,I,_,4,FVM), 0 , 206, 0 , 369, 184), // #1284
+ INST(Vpcmov , VexRvrmRvmr_Lx , V(XOP_M8,A2,_,x,x,_,_,_ ), 0 , 210, 0 , 296, 168), // #1285
+ INST(Vpcmpb , VexRvmi_Lx , E(660F3A,3F,_,x,_,0,4,FVM), 0 , 112, 0 , 370, 163), // #1286
+ INST(Vpcmpd , VexRvmi_Lx , E(660F3A,1F,_,x,_,0,4,FV ), 0 , 112, 0 , 371, 152), // #1287
+ INST(Vpcmpeqb , VexRvm_Lx_KEvex , V(660F00,74,_,x,I,I,4,FV ), 0 , 145, 0 , 372, 181), // #1288
+ INST(Vpcmpeqd , VexRvm_Lx_KEvex , V(660F00,76,_,x,I,0,4,FVM), 0 , 145, 0 , 373, 157), // #1289
+ INST(Vpcmpeqq , VexRvm_Lx_KEvex , V(660F38,29,_,x,I,1,4,FVM), 0 , 211, 0 , 374, 157), // #1290
+ INST(Vpcmpeqw , VexRvm_Lx_KEvex , V(660F00,75,_,x,I,I,4,FV ), 0 , 145, 0 , 372, 181), // #1291
+ INST(Vpcmpestri , VexRmi , V(660F3A,61,_,0,I,_,_,_ ), 0 , 75 , 0 , 375, 185), // #1292
+ INST(Vpcmpestrm , VexRmi , V(660F3A,60,_,0,I,_,_,_ ), 0 , 75 , 0 , 376, 185), // #1293
+ INST(Vpcmpgtb , VexRvm_Lx_KEvex , V(660F00,64,_,x,I,I,4,FV ), 0 , 145, 0 , 372, 181), // #1294
+ INST(Vpcmpgtd , VexRvm_Lx_KEvex , V(660F00,66,_,x,I,0,4,FVM), 0 , 145, 0 , 373, 157), // #1295
+ INST(Vpcmpgtq , VexRvm_Lx_KEvex , V(660F38,37,_,x,I,1,4,FVM), 0 , 211, 0 , 374, 157), // #1296
+ INST(Vpcmpgtw , VexRvm_Lx_KEvex , V(660F00,65,_,x,I,I,4,FV ), 0 , 145, 0 , 372, 181), // #1297
+ INST(Vpcmpistri , VexRmi , V(660F3A,63,_,0,I,_,_,_ ), 0 , 75 , 0 , 377, 185), // #1298
+ INST(Vpcmpistrm , VexRmi , V(660F3A,62,_,0,I,_,_,_ ), 0 , 75 , 0 , 378, 185), // #1299
+ INST(Vpcmpq , VexRvmi_Lx , E(660F3A,1F,_,x,_,1,4,FV ), 0 , 113, 0 , 379, 152), // #1300
+ INST(Vpcmpub , VexRvmi_Lx , E(660F3A,3E,_,x,_,0,4,FVM), 0 , 112, 0 , 370, 163), // #1301
+ INST(Vpcmpud , VexRvmi_Lx , E(660F3A,1E,_,x,_,0,4,FV ), 0 , 112, 0 , 371, 152), // #1302
+ INST(Vpcmpuq , VexRvmi_Lx , E(660F3A,1E,_,x,_,1,4,FV ), 0 , 113, 0 , 379, 152), // #1303
+ INST(Vpcmpuw , VexRvmi_Lx , E(660F3A,3E,_,x,_,1,4,FVM), 0 , 113, 0 , 379, 163), // #1304
+ INST(Vpcmpw , VexRvmi_Lx , E(660F3A,3F,_,x,_,1,4,FVM), 0 , 113, 0 , 379, 163), // #1305
+ INST(Vpcomb , VexRvmi , V(XOP_M8,CC,_,0,0,_,_,_ ), 0 , 210, 0 , 283, 168), // #1306
+ INST(Vpcomd , VexRvmi , V(XOP_M8,CE,_,0,0,_,_,_ ), 0 , 210, 0 , 283, 168), // #1307
+ INST(Vpcompressb , VexMr_Lx , E(660F38,63,_,x,_,0,0,T1S), 0 , 212, 0 , 237, 186), // #1308
+ INST(Vpcompressd , VexMr_Lx , E(660F38,8B,_,x,_,0,2,T1S), 0 , 130, 0 , 237, 152), // #1309
+ INST(Vpcompressq , VexMr_Lx , E(660F38,8B,_,x,_,1,3,T1S), 0 , 129, 0 , 237, 152), // #1310
+ INST(Vpcompressw , VexMr_Lx , E(660F38,63,_,x,_,1,1,T1S), 0 , 213, 0 , 237, 186), // #1311
+ INST(Vpcomq , VexRvmi , V(XOP_M8,CF,_,0,0,_,_,_ ), 0 , 210, 0 , 283, 168), // #1312
+ INST(Vpcomub , VexRvmi , V(XOP_M8,EC,_,0,0,_,_,_ ), 0 , 210, 0 , 283, 168), // #1313
+ INST(Vpcomud , VexRvmi , V(XOP_M8,EE,_,0,0,_,_,_ ), 0 , 210, 0 , 283, 168), // #1314
+ INST(Vpcomuq , VexRvmi , V(XOP_M8,EF,_,0,0,_,_,_ ), 0 , 210, 0 , 283, 168), // #1315
+ INST(Vpcomuw , VexRvmi , V(XOP_M8,ED,_,0,0,_,_,_ ), 0 , 210, 0 , 283, 168), // #1316
+ INST(Vpcomw , VexRvmi , V(XOP_M8,CD,_,0,0,_,_,_ ), 0 , 210, 0 , 283, 168), // #1317
+ INST(Vpconflictd , VexRm_Lx , E(660F38,C4,_,x,_,0,4,FV ), 0 , 115, 0 , 380, 183), // #1318
+ INST(Vpconflictq , VexRm_Lx , E(660F38,C4,_,x,_,1,4,FV ), 0 , 114, 0 , 380, 183), // #1319
+ INST(Vpdpbssd , VexRvm_Lx , V(F20F38,50,_,x,0,_,_,_ ), 0 , 85 , 0 , 206, 187), // #1320
+ INST(Vpdpbssds , VexRvm_Lx , V(F20F38,51,_,x,0,_,_,_ ), 0 , 85 , 0 , 206, 187), // #1321
+ INST(Vpdpbsud , VexRvm_Lx , V(F30F38,50,_,x,0,_,_,_ ), 0 , 89 , 0 , 206, 187), // #1322
+ INST(Vpdpbsuds , VexRvm_Lx , V(F30F38,51,_,x,0,_,_,_ ), 0 , 89 , 0 , 206, 187), // #1323
+ INST(Vpdpbusd , VexRvm_Lx , V(660F38,50,_,x,_,0,4,FV ), 0 , 111, 0 , 381, 188), // #1324
+ INST(Vpdpbusds , VexRvm_Lx , V(660F38,51,_,x,_,0,4,FV ), 0 , 111, 0 , 381, 188), // #1325
+ INST(Vpdpbuud , VexRvm_Lx , V(000F38,50,_,x,0,_,_,_ ), 0 , 11 , 0 , 206, 187), // #1326
+ INST(Vpdpbuuds , VexRvm_Lx , V(000F38,51,_,x,0,_,_,_ ), 0 , 11 , 0 , 206, 187), // #1327
+ INST(Vpdpwssd , VexRvm_Lx , V(660F38,52,_,x,_,0,4,FV ), 0 , 111, 0 , 381, 188), // #1328
+ INST(Vpdpwssds , VexRvm_Lx , V(660F38,53,_,x,_,0,4,FV ), 0 , 111, 0 , 381, 188), // #1329
+ INST(Vpdpwsud , VexRvm_Lx , V(F30F38,D2,_,x,0,_,_,_ ), 0 , 89 , 0 , 206, 189), // #1330
+ INST(Vpdpwsuds , VexRvm_Lx , V(F30F38,D3,_,x,0,_,_,_ ), 0 , 89 , 0 , 206, 189), // #1331
+ INST(Vpdpwusd , VexRvm_Lx , V(660F38,D2,_,x,0,_,_,_ ), 0 , 30 , 0 , 206, 189), // #1332
+ INST(Vpdpwusds , VexRvm_Lx , V(660F38,D3,_,x,0,_,_,_ ), 0 , 30 , 0 , 206, 189), // #1333
+ INST(Vpdpwuud , VexRvm_Lx , V(000F38,D2,_,x,0,_,_,_ ), 0 , 11 , 0 , 206, 189), // #1334
+ INST(Vpdpwuuds , VexRvm_Lx , V(000F38,D3,_,x,0,_,_,_ ), 0 , 11 , 0 , 206, 189), // #1335
+ INST(Vperm2f128 , VexRvmi , V(660F3A,06,_,1,0,_,_,_ ), 0 , 174, 0 , 382, 149), // #1336
+ INST(Vperm2i128 , VexRvmi , V(660F3A,46,_,1,0,_,_,_ ), 0 , 174, 0 , 382, 156), // #1337
+ INST(Vpermb , VexRvm_Lx , E(660F38,8D,_,x,_,0,4,FVM), 0 , 115, 0 , 363, 190), // #1338
+ INST(Vpermd , VexRvm_Lx , V(660F38,36,_,x,0,0,4,FV ), 0 , 111, 0 , 383, 169), // #1339
+ INST(Vpermi2b , VexRvm_Lx , E(660F38,75,_,x,_,0,4,FVM), 0 , 115, 0 , 363, 190), // #1340
+ INST(Vpermi2d , VexRvm_Lx , E(660F38,76,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 152), // #1341
+ INST(Vpermi2pd , VexRvm_Lx , E(660F38,77,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1342
+ INST(Vpermi2ps , VexRvm_Lx , E(660F38,77,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 152), // #1343
+ INST(Vpermi2q , VexRvm_Lx , E(660F38,76,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1344
+ INST(Vpermi2w , VexRvm_Lx , E(660F38,75,_,x,_,1,4,FVM), 0 , 114, 0 , 363, 163), // #1345
+ INST(Vpermil2pd , VexRvrmiRvmri_Lx , V(660F3A,49,_,x,x,_,_,_ ), 0 , 75 , 0 , 384, 168), // #1346
+ INST(Vpermil2ps , VexRvrmiRvmri_Lx , V(660F3A,48,_,x,x,_,_,_ ), 0 , 75 , 0 , 384, 168), // #1347
+ INST(Vpermilpd , VexRvmRmi_Lx , V(660F38,0D,_,x,0,1,4,FV ), V(660F3A,05,_,x,0,1,4,FV ), 211, 112, 385, 145), // #1348
+ INST(Vpermilps , VexRvmRmi_Lx , V(660F38,0C,_,x,0,0,4,FV ), V(660F3A,04,_,x,0,0,4,FV ), 111, 113, 386, 145), // #1349
+ INST(Vpermpd , VexRvmRmi_Lx , E(660F38,16,_,x,1,1,4,FV ), V(660F3A,01,_,x,1,1,4,FV ), 214, 114, 387, 169), // #1350
+ INST(Vpermps , VexRvm_Lx , V(660F38,16,_,x,0,0,4,FV ), 0 , 111, 0 , 383, 169), // #1351
+ INST(Vpermq , VexRvmRmi_Lx , E(660F38,36,_,x,_,1,4,FV ), V(660F3A,00,_,x,1,1,4,FV ), 114, 115, 387, 169), // #1352
+ INST(Vpermt2b , VexRvm_Lx , E(660F38,7D,_,x,_,0,4,FVM), 0 , 115, 0 , 363, 190), // #1353
+ INST(Vpermt2d , VexRvm_Lx , E(660F38,7E,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 152), // #1354
+ INST(Vpermt2pd , VexRvm_Lx , E(660F38,7F,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1355
+ INST(Vpermt2ps , VexRvm_Lx , E(660F38,7F,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 152), // #1356
+ INST(Vpermt2q , VexRvm_Lx , E(660F38,7E,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1357
+ INST(Vpermt2w , VexRvm_Lx , E(660F38,7D,_,x,_,1,4,FVM), 0 , 114, 0 , 363, 163), // #1358
+ INST(Vpermw , VexRvm_Lx , E(660F38,8D,_,x,_,1,4,FVM), 0 , 114, 0 , 363, 163), // #1359
+ INST(Vpexpandb , VexRm_Lx , E(660F38,62,_,x,_,0,0,T1S), 0 , 212, 0 , 286, 186), // #1360
+ INST(Vpexpandd , VexRm_Lx , E(660F38,89,_,x,_,0,2,T1S), 0 , 130, 0 , 286, 152), // #1361
+ INST(Vpexpandq , VexRm_Lx , E(660F38,89,_,x,_,1,3,T1S), 0 , 129, 0 , 286, 152), // #1362
+ INST(Vpexpandw , VexRm_Lx , E(660F38,62,_,x,_,1,1,T1S), 0 , 213, 0 , 286, 186), // #1363
+ INST(Vpextrb , VexMri , V(660F3A,14,_,0,0,I,0,T1S), 0 , 75 , 0 , 388, 191), // #1364
+ INST(Vpextrd , VexMri , V(660F3A,16,_,0,0,0,2,T1S), 0 , 179, 0 , 290, 192), // #1365
+ INST(Vpextrq , VexMri , V(660F3A,16,_,0,1,1,3,T1S), 0 , 215, 0 , 389, 192), // #1366
+ INST(Vpextrw , VexMri_Vpextrw , V(660F3A,15,_,0,0,I,1,T1S), 0 , 216, 0 , 390, 191), // #1367
+ INST(Vpgatherdd , VexRmvRm_VM , V(660F38,90,_,x,0,_,_,_ ), E(660F38,90,_,x,_,0,2,T1S), 30 , 116, 309, 169), // #1368
+ INST(Vpgatherdq , VexRmvRm_VM , V(660F38,90,_,x,1,_,_,_ ), E(660F38,90,_,x,_,1,3,T1S), 191, 117, 308, 169), // #1369
+ INST(Vpgatherqd , VexRmvRm_VM , V(660F38,91,_,x,0,_,_,_ ), E(660F38,91,_,x,_,0,2,T1S), 30 , 118, 314, 169), // #1370
+ INST(Vpgatherqq , VexRmvRm_VM , V(660F38,91,_,x,1,_,_,_ ), E(660F38,91,_,x,_,1,3,T1S), 191, 119, 313, 169), // #1371
+ INST(Vphaddbd , VexRm , V(XOP_M9,C2,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1372
+ INST(Vphaddbq , VexRm , V(XOP_M9,C3,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1373
+ INST(Vphaddbw , VexRm , V(XOP_M9,C1,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1374
+ INST(Vphaddd , VexRvm_Lx , V(660F38,02,_,x,I,_,_,_ ), 0 , 30 , 0 , 206, 178), // #1375
+ INST(Vphadddq , VexRm , V(XOP_M9,CB,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1376
+ INST(Vphaddsw , VexRvm_Lx , V(660F38,03,_,x,I,_,_,_ ), 0 , 30 , 0 , 206, 178), // #1377
+ INST(Vphaddubd , VexRm , V(XOP_M9,D2,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1378
+ INST(Vphaddubq , VexRm , V(XOP_M9,D3,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1379
+ INST(Vphaddubw , VexRm , V(XOP_M9,D1,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1380
+ INST(Vphaddudq , VexRm , V(XOP_M9,DB,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1381
+ INST(Vphadduwd , VexRm , V(XOP_M9,D6,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1382
+ INST(Vphadduwq , VexRm , V(XOP_M9,D7,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1383
+ INST(Vphaddw , VexRvm_Lx , V(660F38,01,_,x,I,_,_,_ ), 0 , 30 , 0 , 206, 178), // #1384
+ INST(Vphaddwd , VexRm , V(XOP_M9,C6,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1385
+ INST(Vphaddwq , VexRm , V(XOP_M9,C7,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1386
+ INST(Vphminposuw , VexRm , V(660F38,41,_,0,I,_,_,_ ), 0 , 30 , 0 , 208, 149), // #1387
+ INST(Vphsubbw , VexRm , V(XOP_M9,E1,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1388
+ INST(Vphsubd , VexRvm_Lx , V(660F38,06,_,x,I,_,_,_ ), 0 , 30 , 0 , 206, 178), // #1389
+ INST(Vphsubdq , VexRm , V(XOP_M9,E3,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1390
+ INST(Vphsubsw , VexRvm_Lx , V(660F38,07,_,x,I,_,_,_ ), 0 , 30 , 0 , 206, 178), // #1391
+ INST(Vphsubw , VexRvm_Lx , V(660F38,05,_,x,I,_,_,_ ), 0 , 30 , 0 , 206, 178), // #1392
+ INST(Vphsubwd , VexRm , V(XOP_M9,E2,_,0,0,_,_,_ ), 0 , 81 , 0 , 208, 168), // #1393
+ INST(Vpinsrb , VexRvmi , V(660F3A,20,_,0,0,I,0,T1S), 0 , 75 , 0 , 391, 191), // #1394
+ INST(Vpinsrd , VexRvmi , V(660F3A,22,_,0,0,0,2,T1S), 0 , 179, 0 , 392, 192), // #1395
+ INST(Vpinsrq , VexRvmi , V(660F3A,22,_,0,1,1,3,T1S), 0 , 215, 0 , 393, 192), // #1396
+ INST(Vpinsrw , VexRvmi , V(660F00,C4,_,0,0,I,1,T1S), 0 , 217, 0 , 394, 191), // #1397
+ INST(Vplzcntd , VexRm_Lx , E(660F38,44,_,x,_,0,4,FV ), 0 , 115, 0 , 380, 183), // #1398
+ INST(Vplzcntq , VexRm_Lx , E(660F38,44,_,x,_,1,4,FV ), 0 , 114, 0 , 356, 183), // #1399
+ INST(Vpmacsdd , VexRvmr , V(XOP_M8,9E,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1400
+ INST(Vpmacsdqh , VexRvmr , V(XOP_M8,9F,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1401
+ INST(Vpmacsdql , VexRvmr , V(XOP_M8,97,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1402
+ INST(Vpmacssdd , VexRvmr , V(XOP_M8,8E,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1403
+ INST(Vpmacssdqh , VexRvmr , V(XOP_M8,8F,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1404
+ INST(Vpmacssdql , VexRvmr , V(XOP_M8,87,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1405
+ INST(Vpmacsswd , VexRvmr , V(XOP_M8,86,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1406
+ INST(Vpmacssww , VexRvmr , V(XOP_M8,85,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1407
+ INST(Vpmacswd , VexRvmr , V(XOP_M8,96,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1408
+ INST(Vpmacsww , VexRvmr , V(XOP_M8,95,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1409
+ INST(Vpmadcsswd , VexRvmr , V(XOP_M8,A6,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1410
+ INST(Vpmadcswd , VexRvmr , V(XOP_M8,B6,_,0,0,_,_,_ ), 0 , 210, 0 , 395, 168), // #1411
+ INST(Vpmadd52huq , VexRvm_Lx , V(660F38,B5,_,x,1,1,4,FV ), 0 , 184, 0 , 396, 193), // #1412
+ INST(Vpmadd52luq , VexRvm_Lx , V(660F38,B4,_,x,1,1,4,FV ), 0 , 184, 0 , 396, 193), // #1413
+ INST(Vpmaddubsw , VexRvm_Lx , V(660F38,04,_,x,I,I,4,FVM), 0 , 111, 0 , 322, 181), // #1414
+ INST(Vpmaddwd , VexRvm_Lx , V(660F00,F5,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1415
+ INST(Vpmaskmovd , VexRvmMvr_Lx , V(660F38,8C,_,x,0,_,_,_ ), V(660F38,8E,_,x,0,_,_,_ ), 30 , 120, 329, 156), // #1416
+ INST(Vpmaskmovq , VexRvmMvr_Lx , V(660F38,8C,_,x,1,_,_,_ ), V(660F38,8E,_,x,1,_,_,_ ), 191, 121, 329, 156), // #1417
+ INST(Vpmaxsb , VexRvm_Lx , V(660F38,3C,_,x,I,I,4,FVM), 0 , 111, 0 , 397, 181), // #1418
+ INST(Vpmaxsd , VexRvm_Lx , V(660F38,3D,_,x,I,0,4,FV ), 0 , 111, 0 , 215, 157), // #1419
+ INST(Vpmaxsq , VexRvm_Lx , E(660F38,3D,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1420
+ INST(Vpmaxsw , VexRvm_Lx , V(660F00,EE,_,x,I,I,4,FVM), 0 , 145, 0 , 397, 181), // #1421
+ INST(Vpmaxub , VexRvm_Lx , V(660F00,DE,_,x,I,I,4,FVM), 0 , 145, 0 , 397, 181), // #1422
+ INST(Vpmaxud , VexRvm_Lx , V(660F38,3F,_,x,I,0,4,FV ), 0 , 111, 0 , 215, 157), // #1423
+ INST(Vpmaxuq , VexRvm_Lx , E(660F38,3F,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1424
+ INST(Vpmaxuw , VexRvm_Lx , V(660F38,3E,_,x,I,I,4,FVM), 0 , 111, 0 , 397, 181), // #1425
+ INST(Vpminsb , VexRvm_Lx , V(660F38,38,_,x,I,I,4,FVM), 0 , 111, 0 , 397, 181), // #1426
+ INST(Vpminsd , VexRvm_Lx , V(660F38,39,_,x,I,0,4,FV ), 0 , 111, 0 , 215, 157), // #1427
+ INST(Vpminsq , VexRvm_Lx , E(660F38,39,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1428
+ INST(Vpminsw , VexRvm_Lx , V(660F00,EA,_,x,I,I,4,FVM), 0 , 145, 0 , 397, 181), // #1429
+ INST(Vpminub , VexRvm_Lx , V(660F00,DA,_,x,I,_,4,FVM), 0 , 145, 0 , 397, 181), // #1430
+ INST(Vpminud , VexRvm_Lx , V(660F38,3B,_,x,I,0,4,FV ), 0 , 111, 0 , 215, 157), // #1431
+ INST(Vpminuq , VexRvm_Lx , E(660F38,3B,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1432
+ INST(Vpminuw , VexRvm_Lx , V(660F38,3A,_,x,I,_,4,FVM), 0 , 111, 0 , 397, 181), // #1433
+ INST(Vpmovb2m , VexRm_Lx , E(F30F38,29,_,x,_,0,_,_ ), 0 , 208, 0 , 398, 163), // #1434
+ INST(Vpmovd2m , VexRm_Lx , E(F30F38,39,_,x,_,0,_,_ ), 0 , 208, 0 , 398, 155), // #1435
+ INST(Vpmovdb , VexMr_Lx , E(F30F38,31,_,x,_,0,2,QVM), 0 , 218, 0 , 399, 152), // #1436
+ INST(Vpmovdw , VexMr_Lx , E(F30F38,33,_,x,_,0,3,HVM), 0 , 219, 0 , 400, 152), // #1437
+ INST(Vpmovm2b , VexRm_Lx , E(F30F38,28,_,x,_,0,_,_ ), 0 , 208, 0 , 366, 163), // #1438
+ INST(Vpmovm2d , VexRm_Lx , E(F30F38,38,_,x,_,0,_,_ ), 0 , 208, 0 , 366, 155), // #1439
+ INST(Vpmovm2q , VexRm_Lx , E(F30F38,38,_,x,_,1,_,_ ), 0 , 207, 0 , 366, 155), // #1440
+ INST(Vpmovm2w , VexRm_Lx , E(F30F38,28,_,x,_,1,_,_ ), 0 , 207, 0 , 366, 163), // #1441
+ INST(Vpmovmskb , VexRm_Lx , V(660F00,D7,_,x,I,_,_,_ ), 0 , 71 , 0 , 342, 178), // #1442
+ INST(Vpmovq2m , VexRm_Lx , E(F30F38,39,_,x,_,1,_,_ ), 0 , 207, 0 , 398, 155), // #1443
+ INST(Vpmovqb , VexMr_Lx , E(F30F38,32,_,x,_,0,1,OVM), 0 , 220, 0 , 401, 152), // #1444
+ INST(Vpmovqd , VexMr_Lx , E(F30F38,35,_,x,_,0,3,HVM), 0 , 219, 0 , 400, 152), // #1445
+ INST(Vpmovqw , VexMr_Lx , E(F30F38,34,_,x,_,0,2,QVM), 0 , 218, 0 , 399, 152), // #1446
+ INST(Vpmovsdb , VexMr_Lx , E(F30F38,21,_,x,_,0,2,QVM), 0 , 218, 0 , 399, 152), // #1447
+ INST(Vpmovsdw , VexMr_Lx , E(F30F38,23,_,x,_,0,3,HVM), 0 , 219, 0 , 400, 152), // #1448
+ INST(Vpmovsqb , VexMr_Lx , E(F30F38,22,_,x,_,0,1,OVM), 0 , 220, 0 , 401, 152), // #1449
+ INST(Vpmovsqd , VexMr_Lx , E(F30F38,25,_,x,_,0,3,HVM), 0 , 219, 0 , 400, 152), // #1450
+ INST(Vpmovsqw , VexMr_Lx , E(F30F38,24,_,x,_,0,2,QVM), 0 , 218, 0 , 399, 152), // #1451
+ INST(Vpmovswb , VexMr_Lx , E(F30F38,20,_,x,_,0,3,HVM), 0 , 219, 0 , 400, 163), // #1452
+ INST(Vpmovsxbd , VexRm_Lx , V(660F38,21,_,x,I,I,2,QVM), 0 , 221, 0 , 402, 157), // #1453
+ INST(Vpmovsxbq , VexRm_Lx , V(660F38,22,_,x,I,I,1,OVM), 0 , 222, 0 , 403, 157), // #1454
+ INST(Vpmovsxbw , VexRm_Lx , V(660F38,20,_,x,I,I,3,HVM), 0 , 140, 0 , 404, 181), // #1455
+ INST(Vpmovsxdq , VexRm_Lx , V(660F38,25,_,x,I,0,3,HVM), 0 , 140, 0 , 404, 157), // #1456
+ INST(Vpmovsxwd , VexRm_Lx , V(660F38,23,_,x,I,I,3,HVM), 0 , 140, 0 , 404, 157), // #1457
+ INST(Vpmovsxwq , VexRm_Lx , V(660F38,24,_,x,I,I,2,QVM), 0 , 221, 0 , 402, 157), // #1458
+ INST(Vpmovusdb , VexMr_Lx , E(F30F38,11,_,x,_,0,2,QVM), 0 , 218, 0 , 399, 152), // #1459
+ INST(Vpmovusdw , VexMr_Lx , E(F30F38,13,_,x,_,0,3,HVM), 0 , 219, 0 , 400, 152), // #1460
+ INST(Vpmovusqb , VexMr_Lx , E(F30F38,12,_,x,_,0,1,OVM), 0 , 220, 0 , 401, 152), // #1461
+ INST(Vpmovusqd , VexMr_Lx , E(F30F38,15,_,x,_,0,3,HVM), 0 , 219, 0 , 400, 152), // #1462
+ INST(Vpmovusqw , VexMr_Lx , E(F30F38,14,_,x,_,0,2,QVM), 0 , 218, 0 , 399, 152), // #1463
+ INST(Vpmovuswb , VexMr_Lx , E(F30F38,10,_,x,_,0,3,HVM), 0 , 219, 0 , 400, 163), // #1464
+ INST(Vpmovw2m , VexRm_Lx , E(F30F38,29,_,x,_,1,_,_ ), 0 , 207, 0 , 398, 163), // #1465
+ INST(Vpmovwb , VexMr_Lx , E(F30F38,30,_,x,_,0,3,HVM), 0 , 219, 0 , 400, 163), // #1466
+ INST(Vpmovzxbd , VexRm_Lx , V(660F38,31,_,x,I,I,2,QVM), 0 , 221, 0 , 402, 157), // #1467
+ INST(Vpmovzxbq , VexRm_Lx , V(660F38,32,_,x,I,I,1,OVM), 0 , 222, 0 , 403, 157), // #1468
+ INST(Vpmovzxbw , VexRm_Lx , V(660F38,30,_,x,I,I,3,HVM), 0 , 140, 0 , 404, 181), // #1469
+ INST(Vpmovzxdq , VexRm_Lx , V(660F38,35,_,x,I,0,3,HVM), 0 , 140, 0 , 404, 157), // #1470
+ INST(Vpmovzxwd , VexRm_Lx , V(660F38,33,_,x,I,I,3,HVM), 0 , 140, 0 , 404, 157), // #1471
+ INST(Vpmovzxwq , VexRm_Lx , V(660F38,34,_,x,I,I,2,QVM), 0 , 221, 0 , 402, 157), // #1472
+ INST(Vpmuldq , VexRvm_Lx , V(660F38,28,_,x,I,1,4,FV ), 0 , 211, 0 , 212, 157), // #1473
+ INST(Vpmulhrsw , VexRvm_Lx , V(660F38,0B,_,x,I,I,4,FVM), 0 , 111, 0 , 322, 181), // #1474
+ INST(Vpmulhuw , VexRvm_Lx , V(660F00,E4,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1475
+ INST(Vpmulhw , VexRvm_Lx , V(660F00,E5,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1476
+ INST(Vpmulld , VexRvm_Lx , V(660F38,40,_,x,I,0,4,FV ), 0 , 111, 0 , 213, 157), // #1477
+ INST(Vpmullq , VexRvm_Lx , E(660F38,40,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 155), // #1478
+ INST(Vpmullw , VexRvm_Lx , V(660F00,D5,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1479
+ INST(Vpmultishiftqb , VexRvm_Lx , E(660F38,83,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 190), // #1480
+ INST(Vpmuludq , VexRvm_Lx , V(660F00,F4,_,x,I,1,4,FV ), 0 , 104, 0 , 212, 157), // #1481
+ INST(Vpopcntb , VexRm_Lx , E(660F38,54,_,x,_,0,4,FV ), 0 , 115, 0 , 286, 194), // #1482
+ INST(Vpopcntd , VexRm_Lx , E(660F38,55,_,x,_,0,4,FVM), 0 , 115, 0 , 380, 195), // #1483
+ INST(Vpopcntq , VexRm_Lx , E(660F38,55,_,x,_,1,4,FVM), 0 , 114, 0 , 356, 195), // #1484
+ INST(Vpopcntw , VexRm_Lx , E(660F38,54,_,x,_,1,4,FV ), 0 , 114, 0 , 286, 194), // #1485
+ INST(Vpor , VexRvm_Lx , V(660F00,EB,_,x,I,_,_,_ ), 0 , 71 , 0 , 357, 178), // #1486
+ INST(Vpord , VexRvm_Lx , E(660F00,EB,_,x,_,0,4,FV ), 0 , 200, 0 , 358, 152), // #1487
+ INST(Vporq , VexRvm_Lx , E(660F00,EB,_,x,_,1,4,FV ), 0 , 136, 0 , 362, 152), // #1488
+ INST(Vpperm , VexRvrmRvmr , V(XOP_M8,A3,_,0,x,_,_,_ ), 0 , 210, 0 , 405, 168), // #1489
+ INST(Vprold , VexVmi_Lx , E(660F00,72,1,x,_,0,4,FV ), 0 , 223, 0 , 406, 152), // #1490
+ INST(Vprolq , VexVmi_Lx , E(660F00,72,1,x,_,1,4,FV ), 0 , 224, 0 , 407, 152), // #1491
+ INST(Vprolvd , VexRvm_Lx , E(660F38,15,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 152), // #1492
+ INST(Vprolvq , VexRvm_Lx , E(660F38,15,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1493
+ INST(Vprord , VexVmi_Lx , E(660F00,72,0,x,_,0,4,FV ), 0 , 200, 0 , 406, 152), // #1494
+ INST(Vprorq , VexVmi_Lx , E(660F00,72,0,x,_,1,4,FV ), 0 , 136, 0 , 407, 152), // #1495
+ INST(Vprorvd , VexRvm_Lx , E(660F38,14,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 152), // #1496
+ INST(Vprorvq , VexRvm_Lx , E(660F38,14,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1497
+ INST(Vprotb , VexRvmRmvRmi , V(XOP_M9,90,_,0,x,_,_,_ ), V(XOP_M8,C0,_,0,x,_,_,_ ), 81 , 122, 408, 168), // #1498
+ INST(Vprotd , VexRvmRmvRmi , V(XOP_M9,92,_,0,x,_,_,_ ), V(XOP_M8,C2,_,0,x,_,_,_ ), 81 , 123, 408, 168), // #1499
+ INST(Vprotq , VexRvmRmvRmi , V(XOP_M9,93,_,0,x,_,_,_ ), V(XOP_M8,C3,_,0,x,_,_,_ ), 81 , 124, 408, 168), // #1500
+ INST(Vprotw , VexRvmRmvRmi , V(XOP_M9,91,_,0,x,_,_,_ ), V(XOP_M8,C1,_,0,x,_,_,_ ), 81 , 125, 408, 168), // #1501
+ INST(Vpsadbw , VexRvm_Lx , V(660F00,F6,_,x,I,I,4,FVM), 0 , 145, 0 , 207, 181), // #1502
+ INST(Vpscatterdd , VexMr_VM , E(660F38,A0,_,x,_,0,2,T1S), 0 , 130, 0 , 409, 152), // #1503
+ INST(Vpscatterdq , VexMr_VM , E(660F38,A0,_,x,_,1,3,T1S), 0 , 129, 0 , 410, 152), // #1504
+ INST(Vpscatterqd , VexMr_VM , E(660F38,A1,_,x,_,0,2,T1S), 0 , 130, 0 , 411, 152), // #1505
+ INST(Vpscatterqq , VexMr_VM , E(660F38,A1,_,x,_,1,3,T1S), 0 , 129, 0 , 412, 152), // #1506
+ INST(Vpshab , VexRvmRmv , V(XOP_M9,98,_,0,x,_,_,_ ), 0 , 81 , 0 , 413, 168), // #1507
+ INST(Vpshad , VexRvmRmv , V(XOP_M9,9A,_,0,x,_,_,_ ), 0 , 81 , 0 , 413, 168), // #1508
+ INST(Vpshaq , VexRvmRmv , V(XOP_M9,9B,_,0,x,_,_,_ ), 0 , 81 , 0 , 413, 168), // #1509
+ INST(Vpshaw , VexRvmRmv , V(XOP_M9,99,_,0,x,_,_,_ ), 0 , 81 , 0 , 413, 168), // #1510
+ INST(Vpshlb , VexRvmRmv , V(XOP_M9,94,_,0,x,_,_,_ ), 0 , 81 , 0 , 413, 168), // #1511
+ INST(Vpshld , VexRvmRmv , V(XOP_M9,96,_,0,x,_,_,_ ), 0 , 81 , 0 , 413, 168), // #1512
+ INST(Vpshldd , VexRvmi_Lx , E(660F3A,71,_,x,_,0,4,FV ), 0 , 112, 0 , 210, 186), // #1513
+ INST(Vpshldq , VexRvmi_Lx , E(660F3A,71,_,x,_,1,4,FV ), 0 , 113, 0 , 211, 186), // #1514
+ INST(Vpshldvd , VexRvm_Lx , E(660F38,71,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 186), // #1515
+ INST(Vpshldvq , VexRvm_Lx , E(660F38,71,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 186), // #1516
+ INST(Vpshldvw , VexRvm_Lx , E(660F38,70,_,x,_,1,4,FVM), 0 , 114, 0 , 363, 186), // #1517
+ INST(Vpshldw , VexRvmi_Lx , E(660F3A,70,_,x,_,1,4,FVM), 0 , 113, 0 , 282, 186), // #1518
+ INST(Vpshlq , VexRvmRmv , V(XOP_M9,97,_,0,x,_,_,_ ), 0 , 81 , 0 , 413, 168), // #1519
+ INST(Vpshlw , VexRvmRmv , V(XOP_M9,95,_,0,x,_,_,_ ), 0 , 81 , 0 , 413, 168), // #1520
+ INST(Vpshrdd , VexRvmi_Lx , E(660F3A,73,_,x,_,0,4,FV ), 0 , 112, 0 , 210, 186), // #1521
+ INST(Vpshrdq , VexRvmi_Lx , E(660F3A,73,_,x,_,1,4,FV ), 0 , 113, 0 , 211, 186), // #1522
+ INST(Vpshrdvd , VexRvm_Lx , E(660F38,73,_,x,_,0,4,FV ), 0 , 115, 0 , 218, 186), // #1523
+ INST(Vpshrdvq , VexRvm_Lx , E(660F38,73,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 186), // #1524
+ INST(Vpshrdvw , VexRvm_Lx , E(660F38,72,_,x,_,1,4,FVM), 0 , 114, 0 , 363, 186), // #1525
+ INST(Vpshrdw , VexRvmi_Lx , E(660F3A,72,_,x,_,1,4,FVM), 0 , 113, 0 , 282, 186), // #1526
+ INST(Vpshufb , VexRvm_Lx , V(660F38,00,_,x,I,I,4,FVM), 0 , 111, 0 , 322, 181), // #1527
+ INST(Vpshufbitqmb , VexRvm_Lx , E(660F38,8F,_,x,0,0,4,FVM), 0 , 115, 0 , 414, 194), // #1528
+ INST(Vpshufd , VexRmi_Lx , V(660F00,70,_,x,I,0,4,FV ), 0 , 145, 0 , 415, 157), // #1529
+ INST(Vpshufhw , VexRmi_Lx , V(F30F00,70,_,x,I,I,4,FVM), 0 , 162, 0 , 416, 181), // #1530
+ INST(Vpshuflw , VexRmi_Lx , V(F20F00,70,_,x,I,I,4,FVM), 0 , 225, 0 , 416, 181), // #1531
+ INST(Vpsignb , VexRvm_Lx , V(660F38,08,_,x,I,_,_,_ ), 0 , 30 , 0 , 206, 178), // #1532
+ INST(Vpsignd , VexRvm_Lx , V(660F38,0A,_,x,I,_,_,_ ), 0 , 30 , 0 , 206, 178), // #1533
+ INST(Vpsignw , VexRvm_Lx , V(660F38,09,_,x,I,_,_,_ ), 0 , 30 , 0 , 206, 178), // #1534
+ INST(Vpslld , VexRvmVmi_Lx_MEvex , V(660F00,F2,_,x,I,0,4,128), V(660F00,72,6,x,I,0,4,FV ), 226, 126, 417, 157), // #1535
+ INST(Vpslldq , VexVmi_Lx_MEvex , V(660F00,73,7,x,I,I,4,FVM), 0 , 227, 0 , 418, 181), // #1536
+ INST(Vpsllq , VexRvmVmi_Lx_MEvex , V(660F00,F3,_,x,I,1,4,128), V(660F00,73,6,x,I,1,4,FV ), 228, 127, 419, 157), // #1537
+ INST(Vpsllvd , VexRvm_Lx , V(660F38,47,_,x,0,0,4,FV ), 0 , 111, 0 , 213, 169), // #1538
+ INST(Vpsllvq , VexRvm_Lx , V(660F38,47,_,x,1,1,4,FV ), 0 , 184, 0 , 212, 169), // #1539
+ INST(Vpsllvw , VexRvm_Lx , E(660F38,12,_,x,_,1,4,FVM), 0 , 114, 0 , 363, 163), // #1540
+ INST(Vpsllw , VexRvmVmi_Lx_MEvex , V(660F00,F1,_,x,I,I,4,128), V(660F00,71,6,x,I,I,4,FVM), 226, 128, 420, 181), // #1541
+ INST(Vpsrad , VexRvmVmi_Lx_MEvex , V(660F00,E2,_,x,I,0,4,128), V(660F00,72,4,x,I,0,4,FV ), 226, 129, 417, 157), // #1542
+ INST(Vpsraq , VexRvmVmi_Lx_MEvex , E(660F00,E2,_,x,_,1,4,128), E(660F00,72,4,x,_,1,4,FV ), 229, 130, 421, 152), // #1543
+ INST(Vpsravd , VexRvm_Lx , V(660F38,46,_,x,0,0,4,FV ), 0 , 111, 0 , 213, 169), // #1544
+ INST(Vpsravq , VexRvm_Lx , E(660F38,46,_,x,_,1,4,FV ), 0 , 114, 0 , 217, 152), // #1545
+ INST(Vpsravw , VexRvm_Lx , E(660F38,11,_,x,_,1,4,FVM), 0 , 114, 0 , 363, 163), // #1546
+ INST(Vpsraw , VexRvmVmi_Lx_MEvex , V(660F00,E1,_,x,I,I,4,128), V(660F00,71,4,x,I,I,4,FVM), 226, 131, 420, 181), // #1547
+ INST(Vpsrld , VexRvmVmi_Lx_MEvex , V(660F00,D2,_,x,I,0,4,128), V(660F00,72,2,x,I,0,4,FV ), 226, 132, 417, 157), // #1548
+ INST(Vpsrldq , VexVmi_Lx_MEvex , V(660F00,73,3,x,I,I,4,FVM), 0 , 230, 0 , 418, 181), // #1549
+ INST(Vpsrlq , VexRvmVmi_Lx_MEvex , V(660F00,D3,_,x,I,1,4,128), V(660F00,73,2,x,I,1,4,FV ), 228, 133, 419, 157), // #1550
+ INST(Vpsrlvd , VexRvm_Lx , V(660F38,45,_,x,0,0,4,FV ), 0 , 111, 0 , 213, 169), // #1551
+ INST(Vpsrlvq , VexRvm_Lx , V(660F38,45,_,x,1,1,4,FV ), 0 , 184, 0 , 212, 169), // #1552
+ INST(Vpsrlvw , VexRvm_Lx , E(660F38,10,_,x,_,1,4,FVM), 0 , 114, 0 , 363, 163), // #1553
+ INST(Vpsrlw , VexRvmVmi_Lx_MEvex , V(660F00,D1,_,x,I,I,4,128), V(660F00,71,2,x,I,I,4,FVM), 226, 134, 420, 181), // #1554
+ INST(Vpsubb , VexRvm_Lx , V(660F00,F8,_,x,I,I,4,FVM), 0 , 145, 0 , 422, 181), // #1555
+ INST(Vpsubd , VexRvm_Lx , V(660F00,FA,_,x,I,0,4,FV ), 0 , 145, 0 , 423, 157), // #1556
+ INST(Vpsubq , VexRvm_Lx , V(660F00,FB,_,x,I,1,4,FV ), 0 , 104, 0 , 424, 157), // #1557
+ INST(Vpsubsb , VexRvm_Lx , V(660F00,E8,_,x,I,I,4,FVM), 0 , 145, 0 , 422, 181), // #1558
+ INST(Vpsubsw , VexRvm_Lx , V(660F00,E9,_,x,I,I,4,FVM), 0 , 145, 0 , 422, 181), // #1559
+ INST(Vpsubusb , VexRvm_Lx , V(660F00,D8,_,x,I,I,4,FVM), 0 , 145, 0 , 422, 181), // #1560
+ INST(Vpsubusw , VexRvm_Lx , V(660F00,D9,_,x,I,I,4,FVM), 0 , 145, 0 , 422, 181), // #1561
+ INST(Vpsubw , VexRvm_Lx , V(660F00,F9,_,x,I,I,4,FVM), 0 , 145, 0 , 422, 181), // #1562
+ INST(Vpternlogd , VexRvmi_Lx , E(660F3A,25,_,x,_,0,4,FV ), 0 , 112, 0 , 210, 152), // #1563
+ INST(Vpternlogq , VexRvmi_Lx , E(660F3A,25,_,x,_,1,4,FV ), 0 , 113, 0 , 211, 152), // #1564
+ INST(Vptest , VexRm_Lx , V(660F38,17,_,x,I,_,_,_ ), 0 , 30 , 0 , 305, 185), // #1565
+ INST(Vptestmb , VexRvm_Lx , E(660F38,26,_,x,_,0,4,FVM), 0 , 115, 0 , 414, 163), // #1566
+ INST(Vptestmd , VexRvm_Lx , E(660F38,27,_,x,_,0,4,FV ), 0 , 115, 0 , 425, 152), // #1567
+ INST(Vptestmq , VexRvm_Lx , E(660F38,27,_,x,_,1,4,FV ), 0 , 114, 0 , 426, 152), // #1568
+ INST(Vptestmw , VexRvm_Lx , E(660F38,26,_,x,_,1,4,FVM), 0 , 114, 0 , 414, 163), // #1569
+ INST(Vptestnmb , VexRvm_Lx , E(F30F38,26,_,x,_,0,4,FVM), 0 , 171, 0 , 414, 163), // #1570
+ INST(Vptestnmd , VexRvm_Lx , E(F30F38,27,_,x,_,0,4,FV ), 0 , 171, 0 , 425, 152), // #1571
+ INST(Vptestnmq , VexRvm_Lx , E(F30F38,27,_,x,_,1,4,FV ), 0 , 231, 0 , 426, 152), // #1572
+ INST(Vptestnmw , VexRvm_Lx , E(F30F38,26,_,x,_,1,4,FVM), 0 , 231, 0 , 414, 163), // #1573
+ INST(Vpunpckhbw , VexRvm_Lx , V(660F00,68,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1574
+ INST(Vpunpckhdq , VexRvm_Lx , V(660F00,6A,_,x,I,0,4,FV ), 0 , 145, 0 , 213, 157), // #1575
+ INST(Vpunpckhqdq , VexRvm_Lx , V(660F00,6D,_,x,I,1,4,FV ), 0 , 104, 0 , 212, 157), // #1576
+ INST(Vpunpckhwd , VexRvm_Lx , V(660F00,69,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1577
+ INST(Vpunpcklbw , VexRvm_Lx , V(660F00,60,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1578
+ INST(Vpunpckldq , VexRvm_Lx , V(660F00,62,_,x,I,0,4,FV ), 0 , 145, 0 , 213, 157), // #1579
+ INST(Vpunpcklqdq , VexRvm_Lx , V(660F00,6C,_,x,I,1,4,FV ), 0 , 104, 0 , 212, 157), // #1580
+ INST(Vpunpcklwd , VexRvm_Lx , V(660F00,61,_,x,I,I,4,FVM), 0 , 145, 0 , 322, 181), // #1581
+ INST(Vpxor , VexRvm_Lx , V(660F00,EF,_,x,I,_,_,_ ), 0 , 71 , 0 , 359, 178), // #1582
+ INST(Vpxord , VexRvm_Lx , E(660F00,EF,_,x,_,0,4,FV ), 0 , 200, 0 , 360, 152), // #1583
+ INST(Vpxorq , VexRvm_Lx , E(660F00,EF,_,x,_,1,4,FV ), 0 , 136, 0 , 361, 152), // #1584
+ INST(Vrangepd , VexRvmi_Lx , E(660F3A,50,_,x,_,1,4,FV ), 0 , 113, 0 , 292, 155), // #1585
+ INST(Vrangeps , VexRvmi_Lx , E(660F3A,50,_,x,_,0,4,FV ), 0 , 112, 0 , 293, 155), // #1586
+ INST(Vrangesd , VexRvmi , E(660F3A,51,_,I,_,1,3,T1S), 0 , 182, 0 , 294, 76 ), // #1587
+ INST(Vrangess , VexRvmi , E(660F3A,51,_,I,_,0,2,T1S), 0 , 183, 0 , 295, 76 ), // #1588
+ INST(Vrcp14pd , VexRm_Lx , E(660F38,4C,_,x,_,1,4,FV ), 0 , 114, 0 , 356, 152), // #1589
+ INST(Vrcp14ps , VexRm_Lx , E(660F38,4C,_,x,_,0,4,FV ), 0 , 115, 0 , 380, 152), // #1590
+ INST(Vrcp14sd , VexRvm , E(660F38,4D,_,I,_,1,3,T1S), 0 , 129, 0 , 427, 78 ), // #1591
+ INST(Vrcp14ss , VexRvm , E(660F38,4D,_,I,_,0,2,T1S), 0 , 130, 0 , 428, 78 ), // #1592
+ INST(Vrcp28pd , VexRm , E(660F38,CA,_,2,_,1,4,FV ), 0 , 172, 0 , 284, 164), // #1593
+ INST(Vrcp28ps , VexRm , E(660F38,CA,_,2,_,0,4,FV ), 0 , 173, 0 , 285, 164), // #1594
+ INST(Vrcp28sd , VexRvm , E(660F38,CB,_,I,_,1,3,T1S), 0 , 129, 0 , 315, 164), // #1595
+ INST(Vrcp28ss , VexRvm , E(660F38,CB,_,I,_,0,2,T1S), 0 , 130, 0 , 316, 164), // #1596
+ INST(Vrcpph , VexRm_Lx , E(66MAP6,4C,_,_,_,0,4,FV ), 0 , 185, 0 , 429, 148), // #1597
+ INST(Vrcpps , VexRm_Lx , V(000F00,53,_,x,I,_,_,_ ), 0 , 74 , 0 , 305, 149), // #1598
+ INST(Vrcpsh , VexRvm , E(66MAP6,4D,_,_,_,0,1,T1S), 0 , 187, 0 , 430, 148), // #1599
+ INST(Vrcpss , VexRvm , V(F30F00,53,_,I,I,_,_,_ ), 0 , 201, 0 , 431, 149), // #1600
+ INST(Vreducepd , VexRmi_Lx , E(660F3A,56,_,x,_,1,4,FV ), 0 , 113, 0 , 407, 155), // #1601
+ INST(Vreduceph , VexRmi_Lx , E(000F3A,56,_,_,_,0,4,FV ), 0 , 124, 0 , 318, 146), // #1602
+ INST(Vreduceps , VexRmi_Lx , E(660F3A,56,_,x,_,0,4,FV ), 0 , 112, 0 , 406, 155), // #1603
+ INST(Vreducesd , VexRvmi , E(660F3A,57,_,I,_,1,3,T1S), 0 , 182, 0 , 432, 76 ), // #1604
+ INST(Vreducesh , VexRvmi , E(000F3A,57,_,_,_,0,1,T1S), 0 , 190, 0 , 320, 148), // #1605
+ INST(Vreducess , VexRvmi , E(660F3A,57,_,I,_,0,2,T1S), 0 , 183, 0 , 433, 76 ), // #1606
+ INST(Vrndscalepd , VexRmi_Lx , E(660F3A,09,_,x,_,1,4,FV ), 0 , 113, 0 , 317, 152), // #1607
+ INST(Vrndscaleph , VexRmi_Lx , E(000F3A,08,_,_,_,0,4,FV ), 0 , 124, 0 , 318, 146), // #1608
+ INST(Vrndscaleps , VexRmi_Lx , E(660F3A,08,_,x,_,0,4,FV ), 0 , 112, 0 , 319, 152), // #1609
+ INST(Vrndscalesd , VexRvmi , E(660F3A,0B,_,I,_,1,3,T1S), 0 , 182, 0 , 294, 78 ), // #1610
+ INST(Vrndscalesh , VexRvmi , E(000F3A,0A,_,_,_,0,1,T1S), 0 , 190, 0 , 320, 148), // #1611
+ INST(Vrndscaless , VexRvmi , E(660F3A,0A,_,I,_,0,2,T1S), 0 , 183, 0 , 295, 78 ), // #1612
+ INST(Vroundpd , VexRmi_Lx , V(660F3A,09,_,x,I,_,_,_ ), 0 , 75 , 0 , 434, 149), // #1613
+ INST(Vroundps , VexRmi_Lx , V(660F3A,08,_,x,I,_,_,_ ), 0 , 75 , 0 , 434, 149), // #1614
+ INST(Vroundsd , VexRvmi , V(660F3A,0B,_,I,I,_,_,_ ), 0 , 75 , 0 , 435, 149), // #1615
+ INST(Vroundss , VexRvmi , V(660F3A,0A,_,I,I,_,_,_ ), 0 , 75 , 0 , 436, 149), // #1616
+ INST(Vrsqrt14pd , VexRm_Lx , E(660F38,4E,_,x,_,1,4,FV ), 0 , 114, 0 , 356, 152), // #1617
+ INST(Vrsqrt14ps , VexRm_Lx , E(660F38,4E,_,x,_,0,4,FV ), 0 , 115, 0 , 380, 152), // #1618
+ INST(Vrsqrt14sd , VexRvm , E(660F38,4F,_,I,_,1,3,T1S), 0 , 129, 0 , 427, 78 ), // #1619
+ INST(Vrsqrt14ss , VexRvm , E(660F38,4F,_,I,_,0,2,T1S), 0 , 130, 0 , 428, 78 ), // #1620
+ INST(Vrsqrt28pd , VexRm , E(660F38,CC,_,2,_,1,4,FV ), 0 , 172, 0 , 284, 164), // #1621
+ INST(Vrsqrt28ps , VexRm , E(660F38,CC,_,2,_,0,4,FV ), 0 , 173, 0 , 285, 164), // #1622
+ INST(Vrsqrt28sd , VexRvm , E(660F38,CD,_,I,_,1,3,T1S), 0 , 129, 0 , 315, 164), // #1623
+ INST(Vrsqrt28ss , VexRvm , E(660F38,CD,_,I,_,0,2,T1S), 0 , 130, 0 , 316, 164), // #1624
+ INST(Vrsqrtph , VexRm_Lx , E(66MAP6,4E,_,_,_,0,4,FV ), 0 , 185, 0 , 429, 146), // #1625
+ INST(Vrsqrtps , VexRm_Lx , V(000F00,52,_,x,I,_,_,_ ), 0 , 74 , 0 , 305, 149), // #1626
+ INST(Vrsqrtsh , VexRvm , E(66MAP6,4F,_,_,_,0,1,T1S), 0 , 187, 0 , 430, 148), // #1627
+ INST(Vrsqrtss , VexRvm , V(F30F00,52,_,I,I,_,_,_ ), 0 , 201, 0 , 431, 149), // #1628
+ INST(Vscalefpd , VexRvm_Lx , E(660F38,2C,_,x,_,1,4,FV ), 0 , 114, 0 , 437, 152), // #1629
+ INST(Vscalefph , VexRvm_Lx , E(66MAP6,2C,_,_,_,0,4,FV ), 0 , 185, 0 , 201, 146), // #1630
+ INST(Vscalefps , VexRvm_Lx , E(660F38,2C,_,x,_,0,4,FV ), 0 , 115, 0 , 291, 152), // #1631
+ INST(Vscalefsd , VexRvm , E(660F38,2D,_,I,_,1,3,T1S), 0 , 129, 0 , 257, 78 ), // #1632
+ INST(Vscalefsh , VexRvm , E(66MAP6,2D,_,_,_,0,1,T1S), 0 , 187, 0 , 204, 148), // #1633
+ INST(Vscalefss , VexRvm , E(660F38,2D,_,I,_,0,2,T1S), 0 , 130, 0 , 265, 78 ), // #1634
+ INST(Vscatterdpd , VexMr_VM , E(660F38,A2,_,x,_,1,3,T1S), 0 , 129, 0 , 410, 152), // #1635
+ INST(Vscatterdps , VexMr_VM , E(660F38,A2,_,x,_,0,2,T1S), 0 , 130, 0 , 409, 152), // #1636
+ INST(Vscatterpf0dpd , VexM_VM , E(660F38,C6,5,2,_,1,3,T1S), 0 , 232, 0 , 310, 170), // #1637
+ INST(Vscatterpf0dps , VexM_VM , E(660F38,C6,5,2,_,0,2,T1S), 0 , 233, 0 , 311, 170), // #1638
+ INST(Vscatterpf0qpd , VexM_VM , E(660F38,C7,5,2,_,1,3,T1S), 0 , 232, 0 , 312, 170), // #1639
+ INST(Vscatterpf0qps , VexM_VM , E(660F38,C7,5,2,_,0,2,T1S), 0 , 233, 0 , 312, 170), // #1640
+ INST(Vscatterpf1dpd , VexM_VM , E(660F38,C6,6,2,_,1,3,T1S), 0 , 234, 0 , 310, 170), // #1641
+ INST(Vscatterpf1dps , VexM_VM , E(660F38,C6,6,2,_,0,2,T1S), 0 , 235, 0 , 311, 170), // #1642
+ INST(Vscatterpf1qpd , VexM_VM , E(660F38,C7,6,2,_,1,3,T1S), 0 , 234, 0 , 312, 170), // #1643
+ INST(Vscatterpf1qps , VexM_VM , E(660F38,C7,6,2,_,0,2,T1S), 0 , 235, 0 , 312, 170), // #1644
+ INST(Vscatterqpd , VexMr_VM , E(660F38,A3,_,x,_,1,3,T1S), 0 , 129, 0 , 412, 152), // #1645
+ INST(Vscatterqps , VexMr_VM , E(660F38,A3,_,x,_,0,2,T1S), 0 , 130, 0 , 411, 152), // #1646
+ INST(Vsha512msg1 , VexRm , V(F20F38,CC,_,1,0,_,_,_ ), 0 , 236, 0 , 438, 196), // #1647
+ INST(Vsha512msg2 , VexRm , V(F20F38,CD,_,1,0,_,_,_ ), 0 , 236, 0 , 439, 196), // #1648
+ INST(Vsha512rnds2 , VexRvm , V(F20F38,CB,_,1,0,_,_,_ ), 0 , 236, 0 , 440, 196), // #1649
+ INST(Vshuff32x4 , VexRvmi_Lx , E(660F3A,23,_,x,_,0,4,FV ), 0 , 112, 0 , 441, 152), // #1650
+ INST(Vshuff64x2 , VexRvmi_Lx , E(660F3A,23,_,x,_,1,4,FV ), 0 , 113, 0 , 442, 152), // #1651
+ INST(Vshufi32x4 , VexRvmi_Lx , E(660F3A,43,_,x,_,0,4,FV ), 0 , 112, 0 , 441, 152), // #1652
+ INST(Vshufi64x2 , VexRvmi_Lx , E(660F3A,43,_,x,_,1,4,FV ), 0 , 113, 0 , 442, 152), // #1653
+ INST(Vshufpd , VexRvmi_Lx , V(660F00,C6,_,x,I,1,4,FV ), 0 , 104, 0 , 443, 145), // #1654
+ INST(Vshufps , VexRvmi_Lx , V(000F00,C6,_,x,I,0,4,FV ), 0 , 106, 0 , 444, 145), // #1655
+ INST(Vsm3msg1 , VexRvm , V(000F38,DA,_,0,0,_,_,_ ), 0 , 11 , 0 , 445, 197), // #1656
+ INST(Vsm3msg2 , VexRvm , V(660F38,DA,_,0,0,_,_,_ ), 0 , 30 , 0 , 445, 197), // #1657
+ INST(Vsm3rnds2 , VexRvmi , V(660F3A,DE,_,0,0,_,_,_ ), 0 , 75 , 0 , 283, 197), // #1658
+ INST(Vsm4key4 , VexRvm_Lx , V(F30F38,DA,_,x,0,_,_,_ ), 0 , 89 , 0 , 206, 198), // #1659
+ INST(Vsm4rnds4 , VexRvm_Lx , V(F20F38,DA,_,x,0,_,_,_ ), 0 , 85 , 0 , 206, 198), // #1660
+ INST(Vsqrtpd , VexRm_Lx , V(660F00,51,_,x,I,1,4,FV ), 0 , 104, 0 , 446, 145), // #1661
+ INST(Vsqrtph , VexRm_Lx , E(00MAP5,51,_,_,_,0,4,FV ), 0 , 105, 0 , 252, 146), // #1662
+ INST(Vsqrtps , VexRm_Lx , V(000F00,51,_,x,I,0,4,FV ), 0 , 106, 0 , 240, 145), // #1663
+ INST(Vsqrtsd , VexRvm , V(F20F00,51,_,I,I,1,3,T1S), 0 , 107, 0 , 203, 147), // #1664
+ INST(Vsqrtsh , VexRvm , E(F3MAP5,51,_,_,_,0,1,T1S), 0 , 108, 0 , 204, 148), // #1665
+ INST(Vsqrtss , VexRvm , V(F30F00,51,_,I,I,0,2,T1S), 0 , 109, 0 , 205, 147), // #1666
+ INST(Vstmxcsr , VexM , V(000F00,AE,3,0,I,_,_,_ ), 0 , 237, 0 , 327, 149), // #1667
+ INST(Vsubpd , VexRvm_Lx , V(660F00,5C,_,x,I,1,4,FV ), 0 , 104, 0 , 200, 145), // #1668
+ INST(Vsubph , VexRvm_Lx , E(00MAP5,5C,_,_,_,0,4,FV ), 0 , 105, 0 , 201, 146), // #1669
+ INST(Vsubps , VexRvm_Lx , V(000F00,5C,_,x,I,0,4,FV ), 0 , 106, 0 , 202, 145), // #1670
+ INST(Vsubsd , VexRvm , V(F20F00,5C,_,I,I,1,3,T1S), 0 , 107, 0 , 203, 147), // #1671
+ INST(Vsubsh , VexRvm , E(F3MAP5,5C,_,_,_,0,1,T1S), 0 , 108, 0 , 204, 148), // #1672
+ INST(Vsubss , VexRvm , V(F30F00,5C,_,I,I,0,2,T1S), 0 , 109, 0 , 205, 147), // #1673
+ INST(Vtestpd , VexRm_Lx , V(660F38,0F,_,x,0,_,_,_ ), 0 , 30 , 0 , 305, 185), // #1674
+ INST(Vtestps , VexRm_Lx , V(660F38,0E,_,x,0,_,_,_ ), 0 , 30 , 0 , 305, 185), // #1675
+ INST(Vucomisd , VexRm , V(660F00,2E,_,I,I,1,3,T1S), 0 , 126, 0 , 234, 158), // #1676
+ INST(Vucomish , VexRm , E(00MAP5,2E,_,_,_,0,1,T1S), 0 , 127, 0 , 235, 159), // #1677
+ INST(Vucomiss , VexRm , V(000F00,2E,_,I,I,0,2,T1S), 0 , 128, 0 , 236, 158), // #1678
+ INST(Vunpckhpd , VexRvm_Lx , V(660F00,15,_,x,I,1,4,FV ), 0 , 104, 0 , 212, 145), // #1679
+ INST(Vunpckhps , VexRvm_Lx , V(000F00,15,_,x,I,0,4,FV ), 0 , 106, 0 , 213, 145), // #1680
+ INST(Vunpcklpd , VexRvm_Lx , V(660F00,14,_,x,I,1,4,FV ), 0 , 104, 0 , 212, 145), // #1681
+ INST(Vunpcklps , VexRvm_Lx , V(000F00,14,_,x,I,0,4,FV ), 0 , 106, 0 , 213, 145), // #1682
+ INST(Vxorpd , VexRvm_Lx , V(660F00,57,_,x,I,1,4,FV ), 0 , 104, 0 , 424, 153), // #1683
+ INST(Vxorps , VexRvm_Lx , V(000F00,57,_,x,I,0,4,FV ), 0 , 106, 0 , 423, 153), // #1684
+ INST(Vzeroall , VexOp , V(000F00,77,_,1,I,_,_,_ ), 0 , 70 , 0 , 447, 149), // #1685
+ INST(Vzeroupper , VexOp , V(000F00,77,_,0,I,_,_,_ ), 0 , 74 , 0 , 447, 149), // #1686
+ INST(Wbinvd , X86Op , O(000F00,09,_,_,_,_,_,_ ), 0 , 5 , 0 , 31 , 45 ), // #1687
+ INST(Wbnoinvd , X86Op , O(F30F00,09,_,_,_,_,_,_ ), 0 , 7 , 0 , 31 , 199), // #1688
+ INST(Wrfsbase , X86M , O(F30F00,AE,2,_,x,_,_,_ ), 0 , 238, 0 , 177, 122), // #1689
+ INST(Wrgsbase , X86M , O(F30F00,AE,3,_,x,_,_,_ ), 0 , 239, 0 , 177, 122), // #1690
+ INST(Wrmsr , X86Op , O(000F00,30,_,_,_,_,_,_ ), 0 , 5 , 0 , 178, 123), // #1691
+ INST(Wrssd , X86Mr , O(000F38,F6,_,_,_,_,_,_ ), 0 , 1 , 0 , 448, 65 ), // #1692
+ INST(Wrssq , X86Mr , O(000F38,F6,_,_,1,_,_,_ ), 0 , 240, 0 , 449, 65 ), // #1693
+ INST(Wrussd , X86Mr , O(660F38,F5,_,_,_,_,_,_ ), 0 , 2 , 0 , 448, 65 ), // #1694
+ INST(Wrussq , X86Mr , O(660F38,F5,_,_,1,_,_,_ ), 0 , 241, 0 , 449, 65 ), // #1695
+ INST(Xabort , X86Op_Mod11RM_I8 , O(000000,C6,7,_,_,_,_,_ ), 0 , 29 , 0 , 84 , 200), // #1696
+ INST(Xadd , X86Xadd , O(000F00,C0,_,_,x,_,_,_ ), 0 , 5 , 0 , 450, 40 ), // #1697
+ INST(Xbegin , X86JmpRel , O(000000,C7,7,_,_,_,_,_ ), 0 , 29 , 0 , 451, 200), // #1698
+ INST(Xchg , X86Xchg , O(000000,86,_,_,x,_,_,_ ), 0 , 0 , 0 , 452, 0 ), // #1699
+ INST(Xend , X86Op , O(000F01,D5,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 200), // #1700
+ INST(Xgetbv , X86Op , O(000F01,D0,_,_,_,_,_,_ ), 0 , 23 , 0 , 178, 201), // #1701
+ INST(Xlatb , X86Op , O(000000,D7,_,_,_,_,_,_ ), 0 , 0 , 0 , 31 , 0 ), // #1702
+ INST(Xor , X86Arith , O(000000,30,6,_,x,_,_,_ ), 0 , 34 , 0 , 183, 1 ), // #1703
+ INST(Xorpd , ExtRm , O(660F00,57,_,_,_,_,_,_ ), 0 , 4 , 0 , 155, 5 ), // #1704
+ INST(Xorps , ExtRm , O(000F00,57,_,_,_,_,_,_ ), 0 , 5 , 0 , 155, 6 ), // #1705
+ INST(Xresldtrk , X86Op , O(F20F01,E9,_,_,_,_,_,_ ), 0 , 93 , 0 , 31 , 202), // #1706
+ INST(Xrstor , X86M_Only_EDX_EAX , O(000F00,AE,5,_,_,_,_,_ ), 0 , 79 , 0 , 453, 201), // #1707
+ INST(Xrstor64 , X86M_Only_EDX_EAX , O(000F00,AE,5,_,1,_,_,_ ), 0 , 242, 0 , 454, 201), // #1708
+ INST(Xrstors , X86M_Only_EDX_EAX , O(000F00,C7,3,_,_,_,_,_ ), 0 , 80 , 0 , 453, 203), // #1709
+ INST(Xrstors64 , X86M_Only_EDX_EAX , O(000F00,C7,3,_,1,_,_,_ ), 0 , 243, 0 , 454, 203), // #1710
+ INST(Xsave , X86M_Only_EDX_EAX , O(000F00,AE,4,_,_,_,_,_ ), 0 , 98 , 0 , 453, 201), // #1711
+ INST(Xsave64 , X86M_Only_EDX_EAX , O(000F00,AE,4,_,1,_,_,_ ), 0 , 244, 0 , 454, 201), // #1712
+ INST(Xsavec , X86M_Only_EDX_EAX , O(000F00,C7,4,_,_,_,_,_ ), 0 , 98 , 0 , 453, 204), // #1713
+ INST(Xsavec64 , X86M_Only_EDX_EAX , O(000F00,C7,4,_,1,_,_,_ ), 0 , 244, 0 , 454, 204), // #1714
+ INST(Xsaveopt , X86M_Only_EDX_EAX , O(000F00,AE,6,_,_,_,_,_ ), 0 , 82 , 0 , 453, 205), // #1715
+ INST(Xsaveopt64 , X86M_Only_EDX_EAX , O(000F00,AE,6,_,1,_,_,_ ), 0 , 245, 0 , 454, 205), // #1716
+ INST(Xsaves , X86M_Only_EDX_EAX , O(000F00,C7,5,_,_,_,_,_ ), 0 , 79 , 0 , 453, 203), // #1717
+ INST(Xsaves64 , X86M_Only_EDX_EAX , O(000F00,C7,5,_,1,_,_,_ ), 0 , 242, 0 , 454, 203), // #1718
+ INST(Xsetbv , X86Op , O(000F01,D1,_,_,_,_,_,_ ), 0 , 23 , 0 , 178, 201), // #1719
+ INST(Xsusldtrk , X86Op , O(F20F01,E8,_,_,_,_,_,_ ), 0 , 93 , 0 , 31 , 202), // #1720
+ INST(Xtest , X86Op , O(000F01,D6,_,_,_,_,_,_ ), 0 , 23 , 0 , 31 , 206) // #1721
// ${InstInfo:End}
};
#undef NAME_DATA_INDEX
@@ -1747,248 +1780,251 @@ const InstDB::InstInfo InstDB::_instInfoTable[] = {
// ------------------- Automatically generated, do not edit -------------------
const uint32_t InstDB::_mainOpcodeTable[] = {
O(000000,00,0,0,0,0,0,0 ), // #0 [ref=56x]
- O(000000,00,2,0,0,0,0,0 ), // #1 [ref=4x]
- O(660F38,00,0,0,0,0,0,0 ), // #2 [ref=43x]
- O(660F00,00,0,0,0,0,0,0 ), // #3 [ref=38x]
- O(000F00,00,0,0,0,0,0,0 ), // #4 [ref=231x]
- O(F20F00,00,0,0,0,0,0,0 ), // #5 [ref=24x]
- O(F30F00,00,0,0,0,0,0,0 ), // #6 [ref=29x]
- O(F30F38,00,0,0,0,0,0,0 ), // #7 [ref=2x]
- O(660F3A,00,0,0,0,0,0,0 ), // #8 [ref=22x]
- O(000000,00,4,0,0,0,0,0 ), // #9 [ref=5x]
- V(000F38,00,0,0,0,0,0,None), // #10 [ref=6x]
- V(XOP_M9,00,1,0,0,0,0,None), // #11 [ref=3x]
- V(XOP_M9,00,6,0,0,0,0,None), // #12 [ref=2x]
- V(XOP_M9,00,5,0,0,0,0,None), // #13 [ref=1x]
- V(XOP_M9,00,3,0,0,0,0,None), // #14 [ref=1x]
- V(XOP_M9,00,2,0,0,0,0,None), // #15 [ref=1x]
- V(000F38,00,3,0,0,0,0,None), // #16 [ref=1x]
- V(000F38,00,2,0,0,0,0,None), // #17 [ref=1x]
- V(000F38,00,1,0,0,0,0,None), // #18 [ref=1x]
- O(660000,00,0,0,0,0,0,0 ), // #19 [ref=7x]
- O(000000,00,0,0,1,0,0,0 ), // #20 [ref=3x]
- O(000F01,00,0,0,0,0,0,0 ), // #21 [ref=29x]
- O(000F00,00,7,0,0,0,0,0 ), // #22 [ref=5x]
- O(660F00,00,7,0,0,0,0,0 ), // #23 [ref=1x]
- O(F30F00,00,6,0,0,0,0,0 ), // #24 [ref=4x]
- O(F30F01,00,0,0,0,0,0,0 ), // #25 [ref=9x]
- O(660F00,00,6,0,0,0,0,0 ), // #26 [ref=3x]
- O(000000,00,7,0,0,0,0,0 ), // #27 [ref=5x]
- O(000F00,00,1,0,1,0,0,0 ), // #28 [ref=2x]
- O(000F00,00,1,0,0,0,0,0 ), // #29 [ref=6x]
- O(F20F38,00,0,0,0,0,0,0 ), // #30 [ref=2x]
- O(000000,00,1,0,0,0,0,0 ), // #31 [ref=3x]
- O(000000,00,6,0,0,0,0,0 ), // #32 [ref=3x]
- O(F30F00,00,7,0,0,0,0,3 ), // #33 [ref=1x]
- O(F30F00,00,7,0,0,0,0,2 ), // #34 [ref=1x]
- O_FPU(00,D900,0) , // #35 [ref=29x]
- O_FPU(00,C000,0) , // #36 [ref=1x]
- O_FPU(00,DE00,0) , // #37 [ref=7x]
- O_FPU(00,0000,4) , // #38 [ref=4x]
- O_FPU(00,0000,6) , // #39 [ref=4x]
- O_FPU(9B,DB00,0) , // #40 [ref=2x]
- O_FPU(00,DA00,0) , // #41 [ref=5x]
- O_FPU(00,DB00,0) , // #42 [ref=8x]
- O_FPU(00,D000,2) , // #43 [ref=1x]
- O_FPU(00,DF00,0) , // #44 [ref=2x]
- O_FPU(00,D800,3) , // #45 [ref=1x]
- O_FPU(00,F000,6) , // #46 [ref=1x]
- O_FPU(00,F800,7) , // #47 [ref=1x]
- O_FPU(00,DD00,0) , // #48 [ref=3x]
- O_FPU(00,0000,0) , // #49 [ref=4x]
- O_FPU(00,0000,2) , // #50 [ref=3x]
- O_FPU(00,0000,3) , // #51 [ref=3x]
- O_FPU(00,0000,7) , // #52 [ref=3x]
- O_FPU(00,0000,1) , // #53 [ref=2x]
- O_FPU(00,0000,5) , // #54 [ref=2x]
- O_FPU(00,C800,1) , // #55 [ref=1x]
- O_FPU(9B,0000,6) , // #56 [ref=2x]
- O_FPU(9B,0000,7) , // #57 [ref=2x]
- O_FPU(00,E000,4) , // #58 [ref=1x]
- O_FPU(00,E800,5) , // #59 [ref=1x]
- O(000F00,00,0,0,1,0,0,0 ), // #60 [ref=3x]
- O(F30F3A,00,0,0,0,0,0,0 ), // #61 [ref=1x]
- O(000000,00,5,0,0,0,0,0 ), // #62 [ref=4x]
- O(F30F00,00,5,0,0,0,0,0 ), // #63 [ref=2x]
- O(F30F00,00,5,0,1,0,0,0 ), // #64 [ref=1x]
- V(660F00,00,0,1,0,0,0,None), // #65 [ref=7x]
- V(660F00,00,0,1,1,0,0,None), // #66 [ref=6x]
- V(000F00,00,0,1,1,0,0,None), // #67 [ref=7x]
- V(000F00,00,0,1,0,0,0,None), // #68 [ref=8x]
- V(660F00,00,0,0,0,0,0,None), // #69 [ref=15x]
- V(660F00,00,0,0,1,0,0,None), // #70 [ref=4x]
- V(000F00,00,0,0,1,0,0,None), // #71 [ref=4x]
- V(000F00,00,0,0,0,0,0,None), // #72 [ref=10x]
- V(660F3A,00,0,0,0,0,0,None), // #73 [ref=47x]
- V(660F3A,00,0,0,1,0,0,None), // #74 [ref=4x]
- O(000000,00,3,0,0,0,0,0 ), // #75 [ref=4x]
- O(000F00,00,2,0,0,0,0,0 ), // #76 [ref=5x]
- O(000F00,00,5,0,0,0,0,0 ), // #77 [ref=4x]
- O(000F00,00,3,0,0,0,0,0 ), // #78 [ref=5x]
- V(XOP_M9,00,0,0,0,0,0,None), // #79 [ref=32x]
- O(000F00,00,6,0,0,0,0,0 ), // #80 [ref=5x]
- V(XOP_MA,00,0,0,0,0,0,None), // #81 [ref=1x]
- V(XOP_MA,00,1,0,0,0,0,None), // #82 [ref=1x]
- O(000F38,00,0,0,0,0,0,0 ), // #83 [ref=24x]
- V(F20F38,00,0,0,0,0,0,None), // #84 [ref=6x]
- O(000F3A,00,0,0,0,0,0,0 ), // #85 [ref=4x]
- O(F30000,00,0,0,0,0,0,0 ), // #86 [ref=1x]
- O(000F0F,00,0,0,0,0,0,0 ), // #87 [ref=26x]
- V(F30F38,00,0,0,0,0,0,None), // #88 [ref=5x]
- O(000F3A,00,0,0,1,0,0,0 ), // #89 [ref=1x]
- O(660F3A,00,0,0,1,0,0,0 ), // #90 [ref=1x]
- O(F30F00,00,4,0,0,0,0,0 ), // #91 [ref=1x]
- O(F20F01,00,0,0,0,0,0,0 ), // #92 [ref=4x]
- O(F30F00,00,1,0,0,0,0,0 ), // #93 [ref=3x]
- O(F30F00,00,7,0,0,0,0,0 ), // #94 [ref=1x]
- V(F20F3A,00,0,0,0,0,0,None), // #95 [ref=1x]
- V(660F38,00,0,0,0,0,0,None), // #96 [ref=26x]
- O(000F00,00,4,0,0,0,0,0 ), // #97 [ref=4x]
- V(XOP_M9,00,7,0,0,0,0,None), // #98 [ref=1x]
- V(XOP_M9,00,4,0,0,0,0,None), // #99 [ref=1x]
- O(F20F00,00,6,0,0,0,0,0 ), // #100 [ref=1x]
- E(F20F38,00,0,2,0,0,4,None), // #101 [ref=4x]
- E(F20F38,00,0,0,0,0,4,None), // #102 [ref=2x]
- V(660F00,00,0,0,0,1,4,ByLL), // #103 [ref=25x]
- E(00MAP5,00,0,0,0,0,4,ByLL), // #104 [ref=10x]
- V(000F00,00,0,0,0,0,4,ByLL), // #105 [ref=19x]
- V(F20F00,00,0,0,0,1,3,None), // #106 [ref=10x]
- E(F3MAP5,00,0,0,0,0,1,None), // #107 [ref=13x]
- V(F30F00,00,0,0,0,0,2,None), // #108 [ref=12x]
- V(F20F00,00,0,0,0,0,0,None), // #109 [ref=4x]
- V(660F38,00,0,0,0,0,4,ByLL), // #110 [ref=50x]
- E(660F3A,00,0,0,0,0,4,ByLL), // #111 [ref=17x]
- E(660F3A,00,0,0,0,1,4,ByLL), // #112 [ref=18x]
- E(660F38,00,0,0,0,1,4,ByLL), // #113 [ref=40x]
- E(660F38,00,0,0,0,0,4,ByLL), // #114 [ref=25x]
- V(660F38,00,0,1,0,0,0,None), // #115 [ref=2x]
- E(660F38,00,0,0,0,0,3,None), // #116 [ref=2x]
- E(660F38,00,0,0,0,0,4,None), // #117 [ref=2x]
- E(660F38,00,0,2,0,0,5,None), // #118 [ref=2x]
- E(660F38,00,0,0,0,1,4,None), // #119 [ref=2x]
- E(660F38,00,0,2,0,1,5,None), // #120 [ref=2x]
- V(660F38,00,0,0,0,1,3,None), // #121 [ref=2x]
- V(660F38,00,0,0,0,0,2,None), // #122 [ref=14x]
- E(000F3A,00,0,0,0,0,4,ByLL), // #123 [ref=5x]
- E(F30F3A,00,0,0,0,0,1,None), // #124 [ref=1x]
- V(660F00,00,0,0,0,1,3,None), // #125 [ref=5x]
- E(00MAP5,00,0,0,0,0,1,None), // #126 [ref=2x]
- V(000F00,00,0,0,0,0,2,None), // #127 [ref=2x]
- E(660F38,00,0,0,0,1,3,None), // #128 [ref=14x]
- E(660F38,00,0,0,0,0,2,None), // #129 [ref=14x]
- V(F30F00,00,0,0,0,0,3,ByLL), // #130 [ref=1x]
- E(F20F38,00,0,0,0,0,4,ByLL), // #131 [ref=2x]
- E(F30F38,00,0,0,0,0,4,ByLL), // #132 [ref=4x]
- V(F20F00,00,0,0,0,1,4,ByLL), // #133 [ref=1x]
- E(66MAP5,00,0,0,0,1,4,ByLL), // #134 [ref=1x]
- E(660F00,00,0,0,0,1,4,ByLL), // #135 [ref=10x]
- E(000F00,00,0,0,0,1,4,ByLL), // #136 [ref=3x]
- E(66MAP5,00,0,0,0,0,3,ByLL), // #137 [ref=1x]
- E(00MAP5,00,0,0,0,0,2,ByLL), // #138 [ref=1x]
- V(660F38,00,0,0,0,0,3,ByLL), // #139 [ref=7x]
- E(66MAP6,00,0,0,0,0,3,ByLL), // #140 [ref=1x]
- E(66MAP5,00,0,0,0,0,2,ByLL), // #141 [ref=4x]
- E(00MAP5,00,0,0,0,0,3,ByLL), // #142 [ref=2x]
- E(66MAP5,00,0,0,0,0,4,ByLL), // #143 [ref=3x]
- V(660F00,00,0,0,0,0,4,ByLL), // #144 [ref=43x]
- V(000F00,00,0,0,0,0,3,ByLL), // #145 [ref=1x]
- V(660F3A,00,0,0,0,0,3,ByLL), // #146 [ref=1x]
- E(660F00,00,0,0,0,0,3,ByLL), // #147 [ref=4x]
- E(000F00,00,0,0,0,0,4,ByLL), // #148 [ref=2x]
- E(F30F00,00,0,0,0,1,4,ByLL), // #149 [ref=3x]
- E(00MAP5,00,0,0,0,1,4,ByLL), // #150 [ref=1x]
- E(F2MAP5,00,0,0,0,1,3,None), // #151 [ref=1x]
- V(F20F00,00,0,0,0,0,3,None), // #152 [ref=2x]
- E(F20F00,00,0,0,0,0,3,None), // #153 [ref=2x]
- E(00MAP6,00,0,0,0,0,1,None), // #154 [ref=1x]
- V(F20F00,00,0,0,0,0,2,T1W ), // #155 [ref=1x]
- E(F3MAP5,00,0,0,0,0,2,T1W ), // #156 [ref=2x]
- V(F30F00,00,0,0,0,0,2,T1W ), // #157 [ref=1x]
- E(00MAP5,00,0,0,0,0,2,None), // #158 [ref=1x]
- E(F30F00,00,0,0,0,0,2,None), // #159 [ref=2x]
- E(F3MAP5,00,0,0,0,0,3,ByLL), // #160 [ref=1x]
- V(F30F00,00,0,0,0,0,4,ByLL), // #161 [ref=4x]
- E(F30F00,00,0,0,0,0,3,ByLL), // #162 [ref=1x]
- E(F2MAP5,00,0,0,0,0,4,ByLL), // #163 [ref=2x]
- E(F20F00,00,0,0,0,0,4,ByLL), // #164 [ref=2x]
- E(F2MAP5,00,0,0,0,1,4,ByLL), // #165 [ref=1x]
- E(F20F00,00,0,0,0,1,4,ByLL), // #166 [ref=2x]
- E(F20F00,00,0,0,0,0,2,T1W ), // #167 [ref=1x]
- E(F30F00,00,0,0,0,0,2,T1W ), // #168 [ref=1x]
- E(F3MAP5,00,0,0,0,0,4,ByLL), // #169 [ref=1x]
- E(660F38,00,0,2,0,1,4,ByLL), // #170 [ref=3x]
- E(660F38,00,0,2,0,0,4,ByLL), // #171 [ref=3x]
- V(660F3A,00,0,1,0,0,0,None), // #172 [ref=6x]
- E(660F3A,00,0,0,0,0,4,None), // #173 [ref=4x]
- E(660F3A,00,0,2,0,0,5,None), // #174 [ref=4x]
- E(660F3A,00,0,0,0,1,4,None), // #175 [ref=4x]
- E(660F3A,00,0,2,0,1,5,None), // #176 [ref=4x]
- V(660F3A,00,0,0,0,0,2,None), // #177 [ref=4x]
- E(F2MAP6,00,0,0,0,0,4,ByLL), // #178 [ref=2x]
- E(F2MAP6,00,0,0,0,0,2,None), // #179 [ref=2x]
- E(660F3A,00,0,0,0,1,3,None), // #180 [ref=6x]
- E(660F3A,00,0,0,0,0,2,None), // #181 [ref=6x]
- V(660F38,00,0,0,1,1,4,ByLL), // #182 [ref=20x]
- E(66MAP6,00,0,0,0,0,4,ByLL), // #183 [ref=22x]
- V(660F38,00,0,0,1,1,3,None), // #184 [ref=12x]
- E(66MAP6,00,0,0,0,0,1,None), // #185 [ref=16x]
- E(F3MAP6,00,0,0,0,0,4,ByLL), // #186 [ref=2x]
- E(F3MAP6,00,0,0,0,0,2,None), // #187 [ref=2x]
- E(000F3A,00,0,0,0,0,1,None), // #188 [ref=4x]
- V(660F38,00,0,0,1,0,0,None), // #189 [ref=5x]
- E(660F38,00,1,2,0,1,3,None), // #190 [ref=2x]
- E(660F38,00,1,2,0,0,2,None), // #191 [ref=2x]
- E(660F38,00,2,2,0,1,3,None), // #192 [ref=2x]
- E(660F38,00,2,2,0,0,2,None), // #193 [ref=2x]
- V(660F3A,00,0,0,1,1,4,ByLL), // #194 [ref=2x]
- V(000F00,00,2,0,0,0,0,None), // #195 [ref=1x]
- V(660F00,00,0,0,0,0,2,None), // #196 [ref=1x]
- V(F20F00,00,0,0,0,1,3,DUP ), // #197 [ref=1x]
- E(660F00,00,0,0,0,0,4,ByLL), // #198 [ref=6x]
- V(F30F00,00,0,0,0,0,0,None), // #199 [ref=3x]
- E(F30F00,00,0,0,0,0,4,ByLL), // #200 [ref=1x]
- V(000F00,00,0,0,0,0,3,None), // #201 [ref=2x]
- E(66MAP5,00,0,0,0,0,1,None), // #202 [ref=1x]
- E(F20F38,00,0,0,0,1,4,ByLL), // #203 [ref=1x]
- V(660F3A,00,0,0,0,0,4,ByLL), // #204 [ref=2x]
- E(F30F38,00,0,0,0,1,0,None), // #205 [ref=5x]
- E(F30F38,00,0,0,0,0,0,None), // #206 [ref=5x]
- V(660F38,00,0,0,0,0,1,None), // #207 [ref=1x]
- V(XOP_M8,00,0,0,0,0,0,None), // #208 [ref=22x]
- V(660F38,00,0,0,0,1,4,ByLL), // #209 [ref=4x]
- E(660F38,00,0,0,0,0,0,None), // #210 [ref=2x]
- E(660F38,00,0,0,0,1,1,None), // #211 [ref=2x]
- E(660F38,00,0,0,1,1,4,ByLL), // #212 [ref=1x]
- V(660F3A,00,0,0,1,1,3,None), // #213 [ref=2x]
- V(660F3A,00,0,0,0,0,1,None), // #214 [ref=1x]
- V(660F00,00,0,0,0,0,1,None), // #215 [ref=1x]
- E(F30F38,00,0,0,0,0,2,ByLL), // #216 [ref=6x]
- E(F30F38,00,0,0,0,0,3,ByLL), // #217 [ref=9x]
- E(F30F38,00,0,0,0,0,1,ByLL), // #218 [ref=3x]
- V(660F38,00,0,0,0,0,2,ByLL), // #219 [ref=4x]
- V(660F38,00,0,0,0,0,1,ByLL), // #220 [ref=2x]
- E(660F00,00,1,0,0,0,4,ByLL), // #221 [ref=1x]
- E(660F00,00,1,0,0,1,4,ByLL), // #222 [ref=1x]
- V(F20F00,00,0,0,0,0,4,ByLL), // #223 [ref=1x]
- V(660F00,00,0,0,0,0,4,None), // #224 [ref=6x]
- V(660F00,00,7,0,0,0,4,ByLL), // #225 [ref=1x]
- V(660F00,00,0,0,0,1,4,None), // #226 [ref=2x]
- E(660F00,00,0,0,0,1,4,None), // #227 [ref=1x]
- V(660F00,00,3,0,0,0,4,ByLL), // #228 [ref=1x]
- E(F30F38,00,0,0,0,1,4,ByLL), // #229 [ref=2x]
- E(660F38,00,5,2,0,1,3,None), // #230 [ref=2x]
- E(660F38,00,5,2,0,0,2,None), // #231 [ref=2x]
- E(660F38,00,6,2,0,1,3,None), // #232 [ref=2x]
- E(660F38,00,6,2,0,0,2,None), // #233 [ref=2x]
- V(000F00,00,3,0,0,0,0,None), // #234 [ref=1x]
- O(F30F00,00,2,0,0,0,0,0 ), // #235 [ref=1x]
- O(F30F00,00,3,0,0,0,0,0 ), // #236 [ref=1x]
- O(000F38,00,0,0,1,0,0,0 ), // #237 [ref=1x]
- O(660F38,00,0,0,1,0,0,0 ), // #238 [ref=1x]
- O(000F00,00,5,0,1,0,0,0 ), // #239 [ref=2x]
- O(000F00,00,3,0,1,0,0,0 ), // #240 [ref=1x]
- O(000F00,00,4,0,1,0,0,0 ), // #241 [ref=2x]
- O(000F00,00,6,0,1,0,0,0 ) // #242 [ref=1x]
+ O(000F38,00,0,0,0,0,0,0 ), // #1 [ref=25x]
+ O(660F38,00,0,0,0,0,0,0 ), // #2 [ref=44x]
+ O(000000,00,2,0,0,0,0,0 ), // #3 [ref=4x]
+ O(660F00,00,0,0,0,0,0,0 ), // #4 [ref=38x]
+ O(000F00,00,0,0,0,0,0,0 ), // #5 [ref=231x]
+ O(F20F00,00,0,0,0,0,0,0 ), // #6 [ref=24x]
+ O(F30F00,00,0,0,0,0,0,0 ), // #7 [ref=29x]
+ O(F30F38,00,0,0,0,0,0,0 ), // #8 [ref=3x]
+ O(660F3A,00,0,0,0,0,0,0 ), // #9 [ref=22x]
+ O(000000,00,4,0,0,0,0,0 ), // #10 [ref=5x]
+ V(000F38,00,0,0,0,0,0,None), // #11 [ref=13x]
+ O(F20F38,00,0,0,0,0,0,0 ), // #12 [ref=3x]
+ V(XOP_M9,00,1,0,0,0,0,None), // #13 [ref=3x]
+ V(XOP_M9,00,6,0,0,0,0,None), // #14 [ref=2x]
+ V(XOP_M9,00,5,0,0,0,0,None), // #15 [ref=1x]
+ V(XOP_M9,00,3,0,0,0,0,None), // #16 [ref=1x]
+ V(XOP_M9,00,2,0,0,0,0,None), // #17 [ref=1x]
+ V(000F38,00,3,0,0,0,0,None), // #18 [ref=1x]
+ V(000F38,00,2,0,0,0,0,None), // #19 [ref=1x]
+ V(000F38,00,1,0,0,0,0,None), // #20 [ref=1x]
+ O(660000,00,0,0,0,0,0,0 ), // #21 [ref=7x]
+ O(000000,00,0,0,1,0,0,0 ), // #22 [ref=3x]
+ O(000F01,00,0,0,0,0,0,0 ), // #23 [ref=32x]
+ O(000F00,00,7,0,0,0,0,0 ), // #24 [ref=6x]
+ O(660F00,00,7,0,0,0,0,0 ), // #25 [ref=1x]
+ O(F30F00,00,6,0,0,0,0,0 ), // #26 [ref=4x]
+ O(F30F01,00,0,0,0,0,0,0 ), // #27 [ref=9x]
+ O(660F00,00,6,0,0,0,0,0 ), // #28 [ref=3x]
+ O(000000,00,7,0,0,0,0,0 ), // #29 [ref=5x]
+ V(660F38,00,0,0,0,0,0,None), // #30 [ref=48x]
+ O(000F00,00,1,0,1,0,0,0 ), // #31 [ref=2x]
+ O(000F00,00,1,0,0,0,0,0 ), // #32 [ref=6x]
+ O(000000,00,1,0,0,0,0,0 ), // #33 [ref=3x]
+ O(000000,00,6,0,0,0,0,0 ), // #34 [ref=3x]
+ O(F30F00,00,7,0,0,0,0,3 ), // #35 [ref=1x]
+ O(F30F00,00,7,0,0,0,0,2 ), // #36 [ref=1x]
+ O_FPU(00,D900,0) , // #37 [ref=29x]
+ O_FPU(00,C000,0) , // #38 [ref=1x]
+ O_FPU(00,DE00,0) , // #39 [ref=7x]
+ O_FPU(00,0000,4) , // #40 [ref=4x]
+ O_FPU(00,0000,6) , // #41 [ref=4x]
+ O_FPU(9B,DB00,0) , // #42 [ref=2x]
+ O_FPU(00,DA00,0) , // #43 [ref=5x]
+ O_FPU(00,DB00,0) , // #44 [ref=8x]
+ O_FPU(00,D000,2) , // #45 [ref=1x]
+ O_FPU(00,DF00,0) , // #46 [ref=2x]
+ O_FPU(00,D800,3) , // #47 [ref=1x]
+ O_FPU(00,F000,6) , // #48 [ref=1x]
+ O_FPU(00,F800,7) , // #49 [ref=1x]
+ O_FPU(00,DD00,0) , // #50 [ref=3x]
+ O_FPU(00,0000,0) , // #51 [ref=4x]
+ O_FPU(00,0000,2) , // #52 [ref=3x]
+ O_FPU(00,0000,3) , // #53 [ref=3x]
+ O_FPU(00,0000,7) , // #54 [ref=3x]
+ O_FPU(00,0000,1) , // #55 [ref=2x]
+ O_FPU(00,0000,5) , // #56 [ref=2x]
+ O_FPU(00,C800,1) , // #57 [ref=1x]
+ O_FPU(9B,0000,6) , // #58 [ref=2x]
+ O_FPU(9B,0000,7) , // #59 [ref=2x]
+ O_FPU(00,E000,4) , // #60 [ref=1x]
+ O_FPU(00,E800,5) , // #61 [ref=1x]
+ O(000F00,00,0,0,1,0,0,0 ), // #62 [ref=3x]
+ O(F30F3A,00,0,0,0,0,0,0 ), // #63 [ref=1x]
+ O(000000,00,5,0,0,0,0,0 ), // #64 [ref=4x]
+ O(F30F00,00,5,0,0,0,0,0 ), // #65 [ref=2x]
+ O(F30F00,00,5,0,1,0,0,0 ), // #66 [ref=1x]
+ V(660F00,00,0,1,0,0,0,None), // #67 [ref=7x]
+ V(660F00,00,0,1,1,0,0,None), // #68 [ref=6x]
+ V(000F00,00,0,1,1,0,0,None), // #69 [ref=7x]
+ V(000F00,00,0,1,0,0,0,None), // #70 [ref=8x]
+ V(660F00,00,0,0,0,0,0,None), // #71 [ref=15x]
+ V(660F00,00,0,0,1,0,0,None), // #72 [ref=4x]
+ V(000F00,00,0,0,1,0,0,None), // #73 [ref=4x]
+ V(000F00,00,0,0,0,0,0,None), // #74 [ref=10x]
+ V(660F3A,00,0,0,0,0,0,None), // #75 [ref=48x]
+ V(660F3A,00,0,0,1,0,0,None), // #76 [ref=4x]
+ O(000000,00,3,0,0,0,0,0 ), // #77 [ref=4x]
+ O(000F00,00,2,0,0,0,0,0 ), // #78 [ref=5x]
+ O(000F00,00,5,0,0,0,0,0 ), // #79 [ref=4x]
+ O(000F00,00,3,0,0,0,0,0 ), // #80 [ref=5x]
+ V(XOP_M9,00,0,0,0,0,0,None), // #81 [ref=32x]
+ O(000F00,00,6,0,0,0,0,0 ), // #82 [ref=6x]
+ V(XOP_MA,00,0,0,0,0,0,None), // #83 [ref=1x]
+ V(XOP_MA,00,1,0,0,0,0,None), // #84 [ref=1x]
+ V(F20F38,00,0,0,0,0,0,None), // #85 [ref=11x]
+ O(000F3A,00,0,0,0,0,0,0 ), // #86 [ref=4x]
+ O(F30000,00,0,0,0,0,0,0 ), // #87 [ref=1x]
+ O(000F0F,00,0,0,0,0,0,0 ), // #88 [ref=26x]
+ V(F30F38,00,0,0,0,0,0,None), // #89 [ref=12x]
+ O(000F3A,00,0,0,1,0,0,0 ), // #90 [ref=1x]
+ O(660F3A,00,0,0,1,0,0,0 ), // #91 [ref=1x]
+ O(F30F00,00,4,0,0,0,0,0 ), // #92 [ref=1x]
+ O(F20F01,00,0,0,0,0,0,0 ), // #93 [ref=5x]
+ O(F30F00,00,1,0,0,0,0,0 ), // #94 [ref=3x]
+ O(F30F00,00,7,0,0,0,0,0 ), // #95 [ref=1x]
+ V(F20F3A,00,0,0,0,0,0,None), // #96 [ref=1x]
+ O(660F01,00,0,0,0,0,0,0 ), // #97 [ref=4x]
+ O(000F00,00,4,0,0,0,0,0 ), // #98 [ref=4x]
+ V(XOP_M9,00,7,0,0,0,0,None), // #99 [ref=1x]
+ V(XOP_M9,00,4,0,0,0,0,None), // #100 [ref=1x]
+ O(F20F00,00,6,0,0,0,0,0 ), // #101 [ref=1x]
+ E(F20F38,00,0,2,0,0,4,None), // #102 [ref=4x]
+ E(F20F38,00,0,0,0,0,4,None), // #103 [ref=2x]
+ V(660F00,00,0,0,0,1,4,ByLL), // #104 [ref=25x]
+ E(00MAP5,00,0,0,0,0,4,ByLL), // #105 [ref=10x]
+ V(000F00,00,0,0,0,0,4,ByLL), // #106 [ref=19x]
+ V(F20F00,00,0,0,0,1,3,None), // #107 [ref=10x]
+ E(F3MAP5,00,0,0,0,0,1,None), // #108 [ref=13x]
+ V(F30F00,00,0,0,0,0,2,None), // #109 [ref=12x]
+ V(F20F00,00,0,0,0,0,0,None), // #110 [ref=4x]
+ V(660F38,00,0,0,0,0,4,ByLL), // #111 [ref=50x]
+ E(660F3A,00,0,0,0,0,4,ByLL), // #112 [ref=17x]
+ E(660F3A,00,0,0,0,1,4,ByLL), // #113 [ref=18x]
+ E(660F38,00,0,0,0,1,4,ByLL), // #114 [ref=38x]
+ E(660F38,00,0,0,0,0,4,ByLL), // #115 [ref=25x]
+ V(660F38,00,0,1,0,0,0,None), // #116 [ref=2x]
+ E(660F38,00,0,0,0,0,3,None), // #117 [ref=2x]
+ E(660F38,00,0,0,0,0,4,None), // #118 [ref=2x]
+ E(660F38,00,0,2,0,0,5,None), // #119 [ref=2x]
+ E(660F38,00,0,0,0,1,4,None), // #120 [ref=2x]
+ E(660F38,00,0,2,0,1,5,None), // #121 [ref=2x]
+ V(660F38,00,0,0,0,1,3,None), // #122 [ref=2x]
+ V(660F38,00,0,0,0,0,2,None), // #123 [ref=14x]
+ E(000F3A,00,0,0,0,0,4,ByLL), // #124 [ref=5x]
+ E(F30F3A,00,0,0,0,0,1,None), // #125 [ref=1x]
+ V(660F00,00,0,0,0,1,3,None), // #126 [ref=5x]
+ E(00MAP5,00,0,0,0,0,1,None), // #127 [ref=2x]
+ V(000F00,00,0,0,0,0,2,None), // #128 [ref=2x]
+ E(660F38,00,0,0,0,1,3,None), // #129 [ref=14x]
+ E(660F38,00,0,0,0,0,2,None), // #130 [ref=14x]
+ V(F30F00,00,0,0,0,0,3,ByLL), // #131 [ref=1x]
+ E(F20F38,00,0,0,0,0,4,ByLL), // #132 [ref=2x]
+ V(F30F38,00,0,0,0,0,4,ByLL), // #133 [ref=1x]
+ V(F20F00,00,0,0,0,1,4,ByLL), // #134 [ref=1x]
+ E(66MAP5,00,0,0,0,1,4,ByLL), // #135 [ref=1x]
+ E(660F00,00,0,0,0,1,4,ByLL), // #136 [ref=10x]
+ E(000F00,00,0,0,0,1,4,ByLL), // #137 [ref=3x]
+ E(66MAP5,00,0,0,0,0,3,ByLL), // #138 [ref=1x]
+ E(00MAP5,00,0,0,0,0,2,ByLL), // #139 [ref=1x]
+ V(660F38,00,0,0,0,0,3,ByLL), // #140 [ref=7x]
+ E(66MAP6,00,0,0,0,0,3,ByLL), // #141 [ref=1x]
+ E(66MAP5,00,0,0,0,0,2,ByLL), // #142 [ref=4x]
+ E(00MAP5,00,0,0,0,0,3,ByLL), // #143 [ref=2x]
+ E(66MAP5,00,0,0,0,0,4,ByLL), // #144 [ref=3x]
+ V(660F00,00,0,0,0,0,4,ByLL), // #145 [ref=43x]
+ V(000F00,00,0,0,0,0,3,ByLL), // #146 [ref=1x]
+ V(660F3A,00,0,0,0,0,3,ByLL), // #147 [ref=1x]
+ E(660F00,00,0,0,0,0,3,ByLL), // #148 [ref=4x]
+ E(000F00,00,0,0,0,0,4,ByLL), // #149 [ref=2x]
+ E(F30F00,00,0,0,0,1,4,ByLL), // #150 [ref=3x]
+ E(00MAP5,00,0,0,0,1,4,ByLL), // #151 [ref=1x]
+ E(F2MAP5,00,0,0,0,1,3,None), // #152 [ref=1x]
+ V(F20F00,00,0,0,0,0,3,None), // #153 [ref=2x]
+ E(F20F00,00,0,0,0,0,3,None), // #154 [ref=2x]
+ E(00MAP6,00,0,0,0,0,1,None), // #155 [ref=1x]
+ V(F20F00,00,0,0,0,0,2,T1W ), // #156 [ref=1x]
+ E(F3MAP5,00,0,0,0,0,2,T1W ), // #157 [ref=2x]
+ V(F30F00,00,0,0,0,0,2,T1W ), // #158 [ref=1x]
+ E(00MAP5,00,0,0,0,0,2,None), // #159 [ref=1x]
+ E(F30F00,00,0,0,0,0,2,None), // #160 [ref=2x]
+ E(F3MAP5,00,0,0,0,0,3,ByLL), // #161 [ref=1x]
+ V(F30F00,00,0,0,0,0,4,ByLL), // #162 [ref=4x]
+ E(F30F00,00,0,0,0,0,3,ByLL), // #163 [ref=1x]
+ E(F2MAP5,00,0,0,0,0,4,ByLL), // #164 [ref=2x]
+ E(F20F00,00,0,0,0,0,4,ByLL), // #165 [ref=2x]
+ E(F2MAP5,00,0,0,0,1,4,ByLL), // #166 [ref=1x]
+ E(F20F00,00,0,0,0,1,4,ByLL), // #167 [ref=2x]
+ E(F20F00,00,0,0,0,0,2,T1W ), // #168 [ref=1x]
+ E(F30F00,00,0,0,0,0,2,T1W ), // #169 [ref=1x]
+ E(F3MAP5,00,0,0,0,0,4,ByLL), // #170 [ref=1x]
+ E(F30F38,00,0,0,0,0,4,ByLL), // #171 [ref=3x]
+ E(660F38,00,0,2,0,1,4,ByLL), // #172 [ref=3x]
+ E(660F38,00,0,2,0,0,4,ByLL), // #173 [ref=3x]
+ V(660F3A,00,0,1,0,0,0,None), // #174 [ref=6x]
+ E(660F3A,00,0,0,0,0,4,None), // #175 [ref=4x]
+ E(660F3A,00,0,2,0,0,5,None), // #176 [ref=4x]
+ E(660F3A,00,0,0,0,1,4,None), // #177 [ref=4x]
+ E(660F3A,00,0,2,0,1,5,None), // #178 [ref=4x]
+ V(660F3A,00,0,0,0,0,2,None), // #179 [ref=4x]
+ E(F2MAP6,00,0,0,0,0,4,ByLL), // #180 [ref=2x]
+ E(F2MAP6,00,0,0,0,0,2,None), // #181 [ref=2x]
+ E(660F3A,00,0,0,0,1,3,None), // #182 [ref=6x]
+ E(660F3A,00,0,0,0,0,2,None), // #183 [ref=6x]
+ V(660F38,00,0,0,1,1,4,ByLL), // #184 [ref=22x]
+ E(66MAP6,00,0,0,0,0,4,ByLL), // #185 [ref=22x]
+ V(660F38,00,0,0,1,1,3,None), // #186 [ref=12x]
+ E(66MAP6,00,0,0,0,0,1,None), // #187 [ref=16x]
+ E(F3MAP6,00,0,0,0,0,4,ByLL), // #188 [ref=2x]
+ E(F3MAP6,00,0,0,0,0,2,None), // #189 [ref=2x]
+ E(000F3A,00,0,0,0,0,1,None), // #190 [ref=4x]
+ V(660F38,00,0,0,1,0,0,None), // #191 [ref=5x]
+ E(660F38,00,1,2,0,1,3,None), // #192 [ref=2x]
+ E(660F38,00,1,2,0,0,2,None), // #193 [ref=2x]
+ E(660F38,00,2,2,0,1,3,None), // #194 [ref=2x]
+ E(660F38,00,2,2,0,0,2,None), // #195 [ref=2x]
+ V(660F3A,00,0,0,1,1,4,ByLL), // #196 [ref=2x]
+ V(000F00,00,2,0,0,0,0,None), // #197 [ref=1x]
+ V(660F00,00,0,0,0,0,2,None), // #198 [ref=1x]
+ V(F20F00,00,0,0,0,1,3,DUP ), // #199 [ref=1x]
+ E(660F00,00,0,0,0,0,4,ByLL), // #200 [ref=6x]
+ V(F30F00,00,0,0,0,0,0,None), // #201 [ref=3x]
+ E(F30F00,00,0,0,0,0,4,ByLL), // #202 [ref=1x]
+ V(000F00,00,0,0,0,0,3,None), // #203 [ref=2x]
+ E(66MAP5,00,0,0,0,0,1,None), // #204 [ref=1x]
+ E(F20F38,00,0,0,0,1,4,ByLL), // #205 [ref=1x]
+ V(660F3A,00,0,0,0,0,4,ByLL), // #206 [ref=2x]
+ E(F30F38,00,0,0,0,1,0,None), // #207 [ref=5x]
+ E(F30F38,00,0,0,0,0,0,None), // #208 [ref=5x]
+ V(660F38,00,0,0,0,0,1,None), // #209 [ref=1x]
+ V(XOP_M8,00,0,0,0,0,0,None), // #210 [ref=22x]
+ V(660F38,00,0,0,0,1,4,ByLL), // #211 [ref=4x]
+ E(660F38,00,0,0,0,0,0,None), // #212 [ref=2x]
+ E(660F38,00,0,0,0,1,1,None), // #213 [ref=2x]
+ E(660F38,00,0,0,1,1,4,ByLL), // #214 [ref=1x]
+ V(660F3A,00,0,0,1,1,3,None), // #215 [ref=2x]
+ V(660F3A,00,0,0,0,0,1,None), // #216 [ref=1x]
+ V(660F00,00,0,0,0,0,1,None), // #217 [ref=1x]
+ E(F30F38,00,0,0,0,0,2,ByLL), // #218 [ref=6x]
+ E(F30F38,00,0,0,0,0,3,ByLL), // #219 [ref=9x]
+ E(F30F38,00,0,0,0,0,1,ByLL), // #220 [ref=3x]
+ V(660F38,00,0,0,0,0,2,ByLL), // #221 [ref=4x]
+ V(660F38,00,0,0,0,0,1,ByLL), // #222 [ref=2x]
+ E(660F00,00,1,0,0,0,4,ByLL), // #223 [ref=1x]
+ E(660F00,00,1,0,0,1,4,ByLL), // #224 [ref=1x]
+ V(F20F00,00,0,0,0,0,4,ByLL), // #225 [ref=1x]
+ V(660F00,00,0,0,0,0,4,None), // #226 [ref=6x]
+ V(660F00,00,7,0,0,0,4,ByLL), // #227 [ref=1x]
+ V(660F00,00,0,0,0,1,4,None), // #228 [ref=2x]
+ E(660F00,00,0,0,0,1,4,None), // #229 [ref=1x]
+ V(660F00,00,3,0,0,0,4,ByLL), // #230 [ref=1x]
+ E(F30F38,00,0,0,0,1,4,ByLL), // #231 [ref=2x]
+ E(660F38,00,5,2,0,1,3,None), // #232 [ref=2x]
+ E(660F38,00,5,2,0,0,2,None), // #233 [ref=2x]
+ E(660F38,00,6,2,0,1,3,None), // #234 [ref=2x]
+ E(660F38,00,6,2,0,0,2,None), // #235 [ref=2x]
+ V(F20F38,00,0,1,0,0,0,None), // #236 [ref=3x]
+ V(000F00,00,3,0,0,0,0,None), // #237 [ref=1x]
+ O(F30F00,00,2,0,0,0,0,0 ), // #238 [ref=1x]
+ O(F30F00,00,3,0,0,0,0,0 ), // #239 [ref=1x]
+ O(000F38,00,0,0,1,0,0,0 ), // #240 [ref=1x]
+ O(660F38,00,0,0,1,0,0,0 ), // #241 [ref=1x]
+ O(000F00,00,5,0,1,0,0,0 ), // #242 [ref=2x]
+ O(000F00,00,3,0,1,0,0,0 ), // #243 [ref=1x]
+ O(000F00,00,4,0,1,0,0,0 ), // #244 [ref=2x]
+ O(000F00,00,6,0,1,0,0,0 ) // #245 [ref=1x]
};
// ----------------------------------------------------------------------------
// ${MainOpcodeTable:End}
@@ -1996,7 +2032,7 @@ const uint32_t InstDB::_mainOpcodeTable[] = {
// ${AltOpcodeTable:Begin}
// ------------------- Automatically generated, do not edit -------------------
const uint32_t InstDB::_altOpcodeTable[] = {
- O(000000,00,0,0,0,0,0,0 ), // #0 [ref=1514x]
+ O(000000,00,0,0,0,0,0,0 ), // #0 [ref=1573x]
O(660F00,1B,0,0,0,0,0,0 ), // #1 [ref=1x]
O(000F00,BA,4,0,0,0,0,0 ), // #2 [ref=1x]
O(000F00,BA,7,0,0,0,0,0 ), // #3 [ref=1x]
@@ -2151,449 +2187,460 @@ const uint32_t InstDB::_altOpcodeTable[] = {
#define SAME_REG_HINT(VAL) uint8_t(InstSameRegHint::k##VAL)
const InstDB::CommonInfo InstDB::_commonInfoTable[] = {
{ 0 , 0 , 0 , 0 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #0 [ref=1x]
- { 0 , 0 , 383, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #1 [ref=4x]
- { 0 , 0 , 384, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #2 [ref=2x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 16 , 12, CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #3 [ref=2x]
- { 0 , 0 , 180, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #4 [ref=2x]
- { F(Vec) , 0 , 79 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #5 [ref=54x]
- { F(Vec) , 0 , 106, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #6 [ref=19x]
- { F(Vec) , 0 , 212, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #7 [ref=16x]
- { F(Vec) , 0 , 221, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #8 [ref=20x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 28 , 11, CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #9 [ref=1x]
- { F(Vex) , 0 , 275, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #10 [ref=3x]
- { F(Vec) , 0 , 79 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #11 [ref=12x]
- { 0 , 0 , 385, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #12 [ref=1x]
- { F(Vex) , 0 , 277, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #13 [ref=5x]
- { F(Vex) , 0 , 180, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #14 [ref=12x]
- { F(Vec) , 0 , 386, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #15 [ref=4x]
- { 0 , 0 , 279, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #16 [ref=3x]
- { F(Mib) , 0 , 387, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #17 [ref=1x]
- { 0 , 0 , 388, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #18 [ref=1x]
- { 0 , 0 , 281, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #19 [ref=1x]
- { F(Mib) , 0 , 389, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #20 [ref=1x]
- { 0 , 0 , 283, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #21 [ref=1x]
- { 0 , 0 , 179, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #22 [ref=35x]
- { 0 , 0 , 390, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #23 [ref=3x]
- { 0 , 0 , 123, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #24 [ref=1x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 123, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #25 [ref=3x]
- { F(Rep)|F(RepIgnored) , 0 , 285, 2 , CONTROL_FLOW(Call), SAME_REG_HINT(None)}, // #26 [ref=1x]
- { 0 , 0 , 391, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #27 [ref=1x]
- { 0 , 0 , 392, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #28 [ref=2x]
- { 0 , 0 , 364, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #29 [ref=1x]
- { 0 , 0 , 108, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #30 [ref=83x]
- { 0 , 0 , 393, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #31 [ref=11x]
- { 0 , 0 , 394, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #32 [ref=6x]
- { 0 , 0 , 395, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #33 [ref=13x]
- { 0 , 0 , 396, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #34 [ref=1x]
- { 0 , 0 , 16 , 12, CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #35 [ref=1x]
- { F(Rep) , 0 , 127, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #36 [ref=1x]
- { F(Vec) , 0 , 397, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #37 [ref=2x]
- { F(Vec) , 0 , 398, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #38 [ref=3x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 131, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #39 [ref=1x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 399, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #40 [ref=1x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 400, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #41 [ref=1x]
- { 0 , 0 , 401, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #42 [ref=1x]
- { 0 , 0 , 402, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #43 [ref=1x]
- { 0 , 0 , 287, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #44 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 403, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #45 [ref=2x]
- { F(Mmx)|F(Vec) , 0 , 404, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #46 [ref=2x]
- { F(Mmx)|F(Vec) , 0 , 405, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #47 [ref=2x]
- { F(Vec) , 0 , 406, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #48 [ref=2x]
- { F(Vec) , 0 , 407, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #49 [ref=2x]
- { F(Vec) , 0 , 408, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #50 [ref=2x]
- { 0 , 0 , 409, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #51 [ref=1x]
- { 0 , 0 , 410, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #52 [ref=2x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 289, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #53 [ref=2x]
- { 0 , 0 , 39 , 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #54 [ref=3x]
- { F(Mmx) , 0 , 108, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #55 [ref=1x]
- { 0 , 0 , 291, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #56 [ref=2x]
- { 0 , 0 , 411, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #57 [ref=1x]
- { F(Vec) , 0 , 412, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #58 [ref=2x]
- { F(Vec) , 0 , 293, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #59 [ref=1x]
- { F(FpuM32)|F(FpuM64) , 0 , 182, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #60 [ref=6x]
- { 0 , 0 , 295, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #61 [ref=9x]
- { F(FpuM80) , 0 , 413, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #62 [ref=2x]
- { 0 , 0 , 296, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #63 [ref=13x]
- { F(FpuM32)|F(FpuM64) , 0 , 297, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #64 [ref=2x]
- { F(FpuM16)|F(FpuM32) , 0 , 414, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #65 [ref=9x]
- { F(FpuM16)|F(FpuM32)|F(FpuM64) , 0 , 415, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #66 [ref=3x]
- { F(FpuM32)|F(FpuM64)|F(FpuM80) , 0 , 416, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #67 [ref=2x]
- { F(FpuM16) , 0 , 417, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #68 [ref=3x]
- { 0 , 0 , 418, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #69 [ref=13x]
- { F(FpuM16) , 0 , 419, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #70 [ref=2x]
- { F(FpuM32)|F(FpuM64) , 0 , 298, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #71 [ref=1x]
- { 0 , 0 , 420, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #72 [ref=2x]
- { 0 , 0 , 421, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #73 [ref=1x]
- { 0 , 0 , 39 , 10, CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #74 [ref=1x]
- { 0 , 0 , 422, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #75 [ref=1x]
- { 0 , 0 , 423, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #76 [ref=2x]
- { 0 , 0 , 348, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #77 [ref=3x]
- { F(Rep) , 0 , 424, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #78 [ref=1x]
- { F(Vec) , 0 , 299, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #79 [ref=1x]
- { 0 , 0 , 425, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #80 [ref=2x]
- { 0 , 0 , 426, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #81 [ref=8x]
- { 0 , 0 , 301, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #82 [ref=3x]
- { 0 , 0 , 303, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #83 [ref=1x]
- { 0 , 0 , 108, 1 , CONTROL_FLOW(Return), SAME_REG_HINT(None)}, // #84 [ref=2x]
- { 0 , 0 , 395, 1 , CONTROL_FLOW(Return), SAME_REG_HINT(None)}, // #85 [ref=1x]
- { F(Rep)|F(RepIgnored) , 0 , 305, 2 , CONTROL_FLOW(Branch), SAME_REG_HINT(None)}, // #86 [ref=30x]
- { F(Rep)|F(RepIgnored) , 0 , 307, 2 , CONTROL_FLOW(Branch), SAME_REG_HINT(None)}, // #87 [ref=1x]
- { F(Rep)|F(RepIgnored) , 0 , 309, 2 , CONTROL_FLOW(Jump), SAME_REG_HINT(None)}, // #88 [ref=1x]
- { F(Vex) , 0 , 427, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #89 [ref=19x]
- { F(Vex) , 0 , 311, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #90 [ref=1x]
- { F(Vex) , 0 , 313, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #91 [ref=1x]
- { F(Vex) , 0 , 315, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #92 [ref=1x]
- { F(Vex) , 0 , 317, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #93 [ref=1x]
- { F(Vex) , 0 , 428, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #94 [ref=12x]
- { F(Vex) , 0 , 429, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #95 [ref=8x]
- { F(Vex) , 0 , 427, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #96 [ref=8x]
- { 0 , 0 , 430, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #97 [ref=2x]
- { 0 , 0 , 319, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #98 [ref=1x]
- { 0 , 0 , 321, 2 , CONTROL_FLOW(Call), SAME_REG_HINT(None)}, // #99 [ref=1x]
- { F(Vec) , 0 , 230, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #100 [ref=2x]
- { 0 , 0 , 431, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #101 [ref=2x]
- { 0 , 0 , 323, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #102 [ref=2x]
- { F(Vex) , 0 , 432, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #103 [ref=2x]
- { 0 , 0 , 433, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #104 [ref=1x]
- { 0 , 0 , 185, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #105 [ref=3x]
- { 0 , 0 , 321, 2 , CONTROL_FLOW(Jump), SAME_REG_HINT(None)}, // #106 [ref=1x]
- { 0 , 0 , 434, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #107 [ref=5x]
- { F(Vex) , 0 , 435, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #108 [ref=2x]
- { F(Rep) , 0 , 135, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #109 [ref=1x]
- { 0 , 0 , 307, 2 , CONTROL_FLOW(Branch), SAME_REG_HINT(None)}, // #110 [ref=3x]
- { 0 , 0 , 325, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #111 [ref=1x]
- { F(Vex) , 0 , 436, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #112 [ref=2x]
- { F(Vec) , 0 , 437, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #113 [ref=1x]
- { F(Mmx) , 0 , 438, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #114 [ref=1x]
- { 0 , 0 , 439, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #115 [ref=2x]
- { F(XRelease) , 0 , 0 , 16, CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #116 [ref=1x]
- { 0 , 0 , 49 , 9 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #117 [ref=1x]
- { F(Vec) , 0 , 79 , 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #118 [ref=6x]
- { 0 , 0 , 73 , 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #119 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 327, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #120 [ref=1x]
- { 0 , 0 , 440, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #121 [ref=1x]
- { 0 , 0 , 77 , 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #122 [ref=2x]
- { F(Mmx)|F(Vec) , 0 , 441, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #123 [ref=1x]
- { F(Vec) , 0 , 294, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #124 [ref=2x]
- { F(Vec) , 0 , 236, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #125 [ref=4x]
- { F(Vec) , 0 , 442, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #126 [ref=2x]
- { F(Vec) , 0 , 80 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #127 [ref=3x]
- { F(Mmx) , 0 , 443, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #128 [ref=1x]
- { F(Vec) , 0 , 107, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #129 [ref=1x]
- { F(Vec) , 0 , 242, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #130 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 103, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #131 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 444, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #132 [ref=1x]
- { F(Rep) , 0 , 139, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #133 [ref=1x]
- { F(Vec) , 0 , 106, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #134 [ref=1x]
- { F(Vec) , 0 , 329, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #135 [ref=1x]
- { 0 , 0 , 331, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #136 [ref=2x]
- { 0 , 0 , 333, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #137 [ref=1x]
- { F(Vex) , 0 , 335, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #138 [ref=1x]
- { 0 , 0 , 445, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #139 [ref=1x]
- { 0 , 0 , 446, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #140 [ref=1x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 290, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #141 [ref=2x]
- { 0 , 0 , 108, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #142 [ref=1x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 16 , 12, CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #143 [ref=1x]
- { 0 , 0 , 447, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #144 [ref=1x]
- { F(Rep) , 0 , 448, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #145 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 337, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #146 [ref=37x]
- { F(Mmx)|F(Vec) , 0 , 339, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #147 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 337, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #148 [ref=6x]
- { F(Mmx)|F(Vec) , 0 , 337, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #149 [ref=16x]
- { F(Mmx) , 0 , 337, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #150 [ref=26x]
- { F(Vec) , 0 , 79 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #151 [ref=4x]
- { F(Vec) , 0 , 449, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #152 [ref=1x]
- { F(Vec) , 0 , 450, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #153 [ref=1x]
- { F(Vec) , 0 , 451, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #154 [ref=1x]
- { F(Vec) , 0 , 452, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #155 [ref=1x]
- { F(Vec) , 0 , 453, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #156 [ref=1x]
- { F(Vec) , 0 , 454, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #157 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 341, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #158 [ref=1x]
- { F(Vec) , 0 , 455, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #159 [ref=1x]
- { F(Vec) , 0 , 456, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #160 [ref=1x]
- { F(Vec) , 0 , 457, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #161 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 458, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #162 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 459, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #163 [ref=1x]
- { F(Vec) , 0 , 263, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #164 [ref=2x]
- { 0 , 0 , 143, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #165 [ref=1x]
- { F(Mmx) , 0 , 339, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #166 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 343, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #167 [ref=8x]
- { F(Vec) , 0 , 460, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #168 [ref=2x]
- { 0 , 0 , 461, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #169 [ref=1x]
- { F(Mmx)|F(Vec) , 0 , 345, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #170 [ref=3x]
- { 0 , 0 , 147, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #171 [ref=1x]
- { 0 , 0 , 462, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #172 [ref=8x]
- { 0 , 0 , 463, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #173 [ref=4x]
- { 0 , 0 , 464, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #174 [ref=8x]
- { 0 , 0 , 347, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #175 [ref=1x]
- { F(Rep)|F(RepIgnored) , 0 , 349, 2 , CONTROL_FLOW(Return), SAME_REG_HINT(None)}, // #176 [ref=1x]
- { 0 , 0 , 349, 2 , CONTROL_FLOW(Return), SAME_REG_HINT(None)}, // #177 [ref=1x]
- { F(Vex) , 0 , 351, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #178 [ref=1x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 16 , 12, CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #179 [ref=3x]
- { F(Rep) , 0 , 151, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #180 [ref=1x]
- { 0 , 0 , 465, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #181 [ref=30x]
- { 0 , 0 , 188, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #182 [ref=2x]
- { 0 , 0 , 466, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #183 [ref=3x]
- { F(Rep) , 0 , 155, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #184 [ref=1x]
- { F(Vex) , 0 , 467, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #185 [ref=5x]
- { 0 , 0 , 66 , 7 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #186 [ref=1x]
- { F(Tsib)|F(Vex) , 0 , 468, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #187 [ref=2x]
- { F(Vex) , 0 , 395, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #188 [ref=1x]
- { F(Tsib)|F(Vex) , 0 , 469, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #189 [ref=1x]
- { F(Vex) , 0 , 470, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #190 [ref=1x]
- { 0 , 0 , 471, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #191 [ref=2x]
- { 0 , 0 , 180, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #192 [ref=2x]
- { 0 , 0 , 472, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #193 [ref=1x]
- { F(Evex)|F(Vec) , X(K)|X(T4X)|X(Z) , 473, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #194 [ref=4x]
- { F(Evex)|F(Vec) , X(K)|X(T4X)|X(Z) , 474, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #195 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #196 [ref=22x]
- { F(Evex)|F(Vec) , X(B16)|X(ER)|X(K)|X(SAE)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #197 [ref=23x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #198 [ref=22x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(K)|X(SAE)|X(Z) , 475, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #199 [ref=18x]
- { F(Evex)|F(Vec) , X(ER)|X(K)|X(SAE)|X(Z) , 476, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #200 [ref=18x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(K)|X(SAE)|X(Z) , 477, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #201 [ref=17x]
- { F(Vec)|F(Vex) , 0 , 191, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #202 [ref=15x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #203 [ref=5x]
- { F(Vec)|F(Vex) , 0 , 79 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #204 [ref=17x]
- { F(Vec)|F(Vex) , 0 , 221, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #205 [ref=1x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 194, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #206 [ref=4x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 194, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #207 [ref=4x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #208 [ref=10x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #209 [ref=12x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #210 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #211 [ref=6x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #212 [ref=19x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #213 [ref=12x]
- { F(Vec)|F(Vex) , 0 , 194, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #214 [ref=6x]
- { F(Vec)|F(Vex) , 0 , 353, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #215 [ref=3x]
- { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 478, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #216 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 479, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #217 [ref=1x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 480, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #218 [ref=4x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 481, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #219 [ref=4x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 482, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #220 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 479, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #221 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 483, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #222 [ref=1x]
- { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(B64)|X(K)|X(SAE)|X(Z) , 197, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #223 [ref=1x]
- { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE) , 200, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #224 [ref=1x]
- { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(B32)|X(K)|X(SAE)|X(Z) , 197, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #225 [ref=1x]
- { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 484, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #226 [ref=1x]
- { F(Evex)|F(Vec) , X(K)|X(SAE) , 485, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #227 [ref=1x]
- { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 486, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #228 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(SAE) , 106, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #229 [ref=2x]
- { F(Evex)|F(Vec) , X(SAE) , 263, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #230 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(SAE) , 212, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #231 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 203, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #232 [ref=6x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 206, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #233 [ref=1x]
- { F(Evex)|F(Vec) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 355, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #234 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #235 [ref=3x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 355, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #236 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 355, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #237 [ref=2x]
- { F(Evex)|F(Vec) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 487, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #238 [ref=3x]
- { F(Evex)|F(Vec) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #239 [ref=4x]
- { F(Evex)|F(Vec) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 355, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #240 [ref=3x]
- { F(Evex)|F(Vec) , X(B16)|X(ER)|X(K)|X(SAE)|X(Z) , 206, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #241 [ref=2x]
- { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 212, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #242 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 206, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #243 [ref=1x]
- { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 206, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #244 [ref=3x]
- { F(Evex)|F(Vec) , X(B16)|X(ER)|X(K)|X(SAE)|X(Z) , 212, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #245 [ref=2x]
- { F(Evex)|F(Vec) , X(B16)|X(ER)|X(K)|X(SAE)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #246 [ref=5x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 206, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #247 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 215, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #248 [ref=1x]
- { F(Evex)|F(Vec) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 206, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #249 [ref=2x]
- { F(Evex)|F(Vec) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #250 [ref=2x]
- { F(Evex)|F(Vec) , X(ER)|X(K)|X(SAE)|X(Z) , 475, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #251 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(SAE) , 406, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #252 [ref=1x]
- { F(Evex)|F(Vec) , X(ER)|X(SAE) , 406, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #253 [ref=1x]
- { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 476, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #254 [ref=5x]
- { F(Evex)|F(Vec) , X(ER)|X(SAE) , 488, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #255 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(SAE) , 489, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #256 [ref=2x]
- { F(Evex)|F(Vec) , X(ER)|X(SAE) , 489, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #257 [ref=4x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 477, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #258 [ref=3x]
- { F(Evex)|F(Vec) , X(ER)|X(K)|X(SAE)|X(Z) , 477, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #259 [ref=6x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(SAE) , 408, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #260 [ref=1x]
- { F(Evex)|F(Vec) , X(ER)|X(SAE) , 408, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #261 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(SAE)|X(Z) , 355, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #262 [ref=1x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #263 [ref=3x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 355, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #264 [ref=1x]
- { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #265 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(SAE)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #266 [ref=1x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 206, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #267 [ref=2x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #268 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(SAE) , 406, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #269 [ref=1x]
- { F(Evex)|F(Vec) , X(SAE) , 406, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #270 [ref=1x]
- { F(Evex)|F(Vec) , X(SAE) , 488, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #271 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(SAE) , 408, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #272 [ref=1x]
- { F(Evex)|F(Vec) , X(SAE) , 408, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #273 [ref=1x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 206, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #274 [ref=1x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 194, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #275 [ref=3x]
- { F(Vec)|F(Vex) , 0 , 194, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #276 [ref=9x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 83 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #277 [ref=3x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 83 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #278 [ref=3x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #279 [ref=8x]
- { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 216, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #280 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 490, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #281 [ref=4x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 217, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #282 [ref=4x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 412, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #283 [ref=2x]
- { F(Evex)|F(Vec) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #284 [ref=5x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 194, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #285 [ref=2x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 194, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #286 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 491, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #287 [ref=4x]
- { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 492, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #288 [ref=4x]
- { F(Vec)|F(Vex) , 0 , 159, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #289 [ref=13x]
- { F(Vec)|F(Vex) , 0 , 357, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #290 [ref=4x]
- { F(Vec)|F(Vex) , 0 , 359, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #291 [ref=4x]
- { F(Evex)|F(Vec) , X(B64)|X(K) , 493, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #292 [ref=1x]
- { F(Evex)|F(Vec) , X(B16)|X(K) , 493, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #293 [ref=1x]
- { F(Evex)|F(Vec) , X(B32)|X(K) , 493, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #294 [ref=1x]
- { F(Evex)|F(Vec) , X(K) , 494, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #295 [ref=1x]
- { F(Evex)|F(Vec) , X(K) , 495, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #296 [ref=1x]
- { F(Evex)|F(Vec) , X(K) , 496, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #297 [ref=1x]
- { F(Vec)|F(Vex) , 0 , 209, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #298 [ref=7x]
- { F(Vec)|F(Vex) , 0 , 106, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #299 [ref=1x]
- { F(Vec)|F(Vex) , 0 , 212, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #300 [ref=1x]
- { F(Evex)|F(EvexTwoOp)|F(Vec)|F(Vex)|F(Vsib) , X(K) , 163, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #301 [ref=2x]
- { F(Evex)|F(EvexTwoOp)|F(Vec)|F(Vex)|F(Vsib) , X(K) , 113, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #302 [ref=2x]
- { F(Evex)|F(Vsib) , X(K) , 497, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #303 [ref=4x]
- { F(Evex)|F(Vsib) , X(K) , 498, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #304 [ref=4x]
- { F(Evex)|F(Vsib) , X(K) , 499, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #305 [ref=8x]
- { F(Evex)|F(EvexTwoOp)|F(Vec)|F(Vex)|F(Vsib) , X(K) , 118, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #306 [ref=2x]
- { F(Evex)|F(EvexTwoOp)|F(Vec)|F(Vex)|F(Vsib) , X(K) , 218, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #307 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 475, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #308 [ref=3x]
- { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 477, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #309 [ref=3x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 221, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #310 [ref=2x]
- { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 221, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #311 [ref=3x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 221, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #312 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 500, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #313 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 194, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #314 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #315 [ref=22x]
- { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 361, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #316 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 361, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #317 [ref=4x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 501, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #318 [ref=4x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 492, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #319 [ref=1x]
- { F(Vec)|F(Vex) , 0 , 230, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #320 [ref=1x]
- { F(Vex) , 0 , 431, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #321 [ref=2x]
- { F(Vec)|F(Vex) , 0 , 437, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #322 [ref=1x]
- { F(Vec)|F(Vex) , 0 , 167, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #323 [ref=4x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(SAE)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #324 [ref=2x]
- { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #325 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(SAE)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #326 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 475, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #327 [ref=2x]
- { 0 , 0 , 363, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #328 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 79 , 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #329 [ref=4x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 365, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #330 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 224, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #331 [ref=1x]
- { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 79 , 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #332 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 79 , 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #333 [ref=6x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 238, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #334 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 367, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #335 [ref=4x]
- { F(Vec)|F(Vex) , 0 , 502, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #336 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 227, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #337 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 230, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #338 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 233, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #339 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 236, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #340 [ref=1x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 239, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #341 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #342 [ref=4x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 242, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #343 [ref=1x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 369, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #344 [ref=1x]
- { 0 , 0 , 371, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #345 [ref=1x]
- { 0 , 0 , 373, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #346 [ref=1x]
- { F(Evex)|F(Vec) , X(B32) , 245, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #347 [ref=1x]
- { F(Evex)|F(Vec) , X(B64) , 245, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #348 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #349 [ref=1x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #350 [ref=5x]
- { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 191, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #351 [ref=2x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #352 [ref=2x]
- { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 191, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #353 [ref=2x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #354 [ref=2x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #355 [ref=2x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #356 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #357 [ref=13x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 503, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #358 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 504, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #359 [ref=1x]
- { F(Evex)|F(Vec) , 0 , 505, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #360 [ref=6x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 248, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #361 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 506, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #362 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 194, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #363 [ref=1x]
- { F(Evex)|F(Vec) , X(K) , 200, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #364 [ref=2x]
- { F(Evex)|F(Vec) , X(B32)|X(K) , 200, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #365 [ref=2x]
- { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(K) , 251, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #366 [ref=4x]
- { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(B32)|X(K) , 251, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #367 [ref=2x]
- { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(B64)|X(K) , 251, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #368 [ref=2x]
- { F(Vec)|F(Vex) , 0 , 449, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #369 [ref=1x]
- { F(Vec)|F(Vex) , 0 , 450, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #370 [ref=1x]
- { F(Vec)|F(Vex) , 0 , 451, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #371 [ref=1x]
- { F(Vec)|F(Vex) , 0 , 452, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #372 [ref=1x]
- { F(Evex)|F(Vec) , X(B64)|X(K) , 200, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #373 [ref=4x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #374 [ref=6x]
- { F(Evex)|F(EvexCompat)|F(PreferEvex)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #375 [ref=4x]
- { F(Vec)|F(Vex) , 0 , 195, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #376 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 192, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #377 [ref=2x]
- { F(Vec)|F(Vex) , 0 , 171, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #378 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 85 , 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #379 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 85 , 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #380 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 175, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #381 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 453, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #382 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 454, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #383 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 507, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #384 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 508, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #385 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 509, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #386 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 510, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #387 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 511, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #388 [ref=1x]
- { F(Vec)|F(Vex) , 0 , 353, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #389 [ref=12x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #390 [ref=8x]
- { F(Evex)|F(Vec) , 0 , 512, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #391 [ref=4x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 254, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #392 [ref=6x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 257, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #393 [ref=9x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 260, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #394 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 212, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #395 [ref=4x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 263, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #396 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 206, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #397 [ref=6x]
- { F(Vec)|F(Vex) , 0 , 159, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #398 [ref=1x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 221, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #399 [ref=3x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 221, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #400 [ref=3x]
- { F(Vec)|F(Vex) , 0 , 375, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #401 [ref=4x]
- { F(Evex)|F(Vec)|F(Vsib) , X(K) , 266, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #402 [ref=2x]
- { F(Evex)|F(Vec)|F(Vsib) , X(K) , 377, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #403 [ref=2x]
- { F(Evex)|F(Vec)|F(Vsib) , X(K) , 379, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #404 [ref=2x]
- { F(Evex)|F(Vec)|F(Vsib) , X(K) , 269, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #405 [ref=2x]
- { F(Vec)|F(Vex) , 0 , 381, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #406 [ref=8x]
- { F(Evex)|F(Vec) , X(K) , 272, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #407 [ref=5x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 221, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #408 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 221, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #409 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 91 , 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #410 [ref=3x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 221, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #411 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 91 , 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #412 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 91 , 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #413 [ref=3x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 97 , 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #414 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #415 [ref=6x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #416 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #417 [ref=2x]
- { F(Evex)|F(Vec) , X(B32)|X(K) , 272, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #418 [ref=2x]
- { F(Evex)|F(Vec) , X(B64)|X(K) , 272, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #419 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 475, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #420 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 477, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #421 [ref=2x]
- { F(Evex)|F(Vec) , X(B16)|X(K)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #422 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 476, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #423 [ref=2x]
- { F(Vec)|F(Vex) , 0 , 477, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #424 [ref=2x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 491, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #425 [ref=1x]
- { F(Evex)|F(Vec) , X(K)|X(Z) , 492, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #426 [ref=1x]
- { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 221, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #427 [ref=2x]
- { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 491, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #428 [ref=1x]
- { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 492, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #429 [ref=1x]
- { F(Evex)|F(Vec) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 191, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #430 [ref=1x]
- { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 195, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #431 [ref=2x]
- { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 195, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #432 [ref=2x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 194, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #433 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 194, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #434 [ref=1x]
- { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 209, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #435 [ref=1x]
- { F(Vec)|F(Vex) , 0 , 108, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #436 [ref=2x]
- { 0 , 0 , 23 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #437 [ref=2x]
- { 0 , 0 , 61 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #438 [ref=2x]
- { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 58 , 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #439 [ref=1x]
- { 0 , 0 , 513, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #440 [ref=1x]
- { F(Lock)|F(XAcquire) , 0 , 58 , 8 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #441 [ref=1x]
- { 0 , 0 , 514, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #442 [ref=6x]
- { 0 , 0 , 515, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)} // #443 [ref=6x]
+ { 0 , 0 , 455, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #1 [ref=4x]
+ { 0 , 0 , 456, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #2 [ref=2x]
+ { 0 , 0 , 108, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #3 [ref=6x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 20 , 13, CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #4 [ref=2x]
+ { 0 , 0 , 50 , 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #5 [ref=2x]
+ { F(Vec) , 0 , 72 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #6 [ref=54x]
+ { F(Vec) , 0 , 143, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #7 [ref=19x]
+ { F(Vec) , 0 , 283, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #8 [ref=16x]
+ { F(Vec) , 0 , 292, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #9 [ref=20x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 33 , 12, CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #10 [ref=1x]
+ { F(Vex) , 0 , 325, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #11 [ref=3x]
+ { F(Vec) , 0 , 72 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #12 [ref=12x]
+ { 0 , 0 , 457, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #13 [ref=1x]
+ { F(Vex) , 0 , 327, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #14 [ref=5x]
+ { F(Vex) , 0 , 50 , 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #15 [ref=12x]
+ { F(Vec) , 0 , 458, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #16 [ref=4x]
+ { 0 , 0 , 329, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #17 [ref=3x]
+ { F(Mib) , 0 , 459, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #18 [ref=1x]
+ { 0 , 0 , 460, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #19 [ref=1x]
+ { 0 , 0 , 331, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #20 [ref=1x]
+ { F(Mib) , 0 , 461, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #21 [ref=1x]
+ { 0 , 0 , 333, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #22 [ref=1x]
+ { 0 , 0 , 49 , 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #23 [ref=35x]
+ { 0 , 0 , 335, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #24 [ref=3x]
+ { 0 , 0 , 134, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #25 [ref=1x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 134, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #26 [ref=3x]
+ { F(Rep)|F(RepIgnored) , 0 , 235, 3 , CONTROL_FLOW(Call), SAME_REG_HINT(None)}, // #27 [ref=1x]
+ { 0 , 0 , 462, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #28 [ref=1x]
+ { 0 , 0 , 463, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #29 [ref=2x]
+ { 0 , 0 , 436, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #30 [ref=1x]
+ { 0 , 0 , 110, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #31 [ref=88x]
+ { 0 , 0 , 464, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #32 [ref=24x]
+ { 0 , 0 , 465, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #33 [ref=6x]
+ { 0 , 0 , 466, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #34 [ref=14x]
+ { 0 , 0 , 467, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #35 [ref=1x]
+ { 0 , 0 , 20 , 13, CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #36 [ref=1x]
+ { F(Vex) , 0 , 337, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #37 [ref=16x]
+ { F(Rep) , 0 , 179, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #38 [ref=1x]
+ { F(Vec) , 0 , 468, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #39 [ref=2x]
+ { F(Vec) , 0 , 469, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #40 [ref=3x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 183, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #41 [ref=1x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 470, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #42 [ref=1x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 471, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #43 [ref=1x]
+ { 0 , 0 , 472, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #44 [ref=1x]
+ { 0 , 0 , 473, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #45 [ref=1x]
+ { 0 , 0 , 339, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #46 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 474, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #47 [ref=2x]
+ { F(Mmx)|F(Vec) , 0 , 475, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #48 [ref=2x]
+ { F(Mmx)|F(Vec) , 0 , 476, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #49 [ref=2x]
+ { F(Vec) , 0 , 341, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #50 [ref=2x]
+ { F(Vec) , 0 , 343, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #51 [ref=1x]
+ { F(Vec) , 0 , 345, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #52 [ref=1x]
+ { F(Vec) , 0 , 347, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #53 [ref=1x]
+ { F(Vec) , 0 , 349, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #54 [ref=1x]
+ { 0 , 0 , 477, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #55 [ref=1x]
+ { 0 , 0 , 478, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #56 [ref=3x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 238, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #57 [ref=1x]
+ { 0 , 0 , 45 , 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #58 [ref=3x]
+ { F(Mmx) , 0 , 110, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #59 [ref=1x]
+ { 0 , 0 , 351, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #60 [ref=2x]
+ { 0 , 0 , 479, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #61 [ref=1x]
+ { F(Vec) , 0 , 480, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #62 [ref=2x]
+ { F(Vec) , 0 , 353, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #63 [ref=1x]
+ { F(FpuM32)|F(FpuM64) , 0 , 241, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #64 [ref=6x]
+ { 0 , 0 , 355, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #65 [ref=9x]
+ { F(FpuM80) , 0 , 481, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #66 [ref=2x]
+ { 0 , 0 , 356, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #67 [ref=13x]
+ { F(FpuM32)|F(FpuM64) , 0 , 357, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #68 [ref=2x]
+ { F(FpuM16)|F(FpuM32) , 0 , 482, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #69 [ref=9x]
+ { F(FpuM16)|F(FpuM32)|F(FpuM64) , 0 , 483, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #70 [ref=3x]
+ { F(FpuM32)|F(FpuM64)|F(FpuM80) , 0 , 484, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #71 [ref=2x]
+ { F(FpuM16) , 0 , 485, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #72 [ref=3x]
+ { F(FpuM16) , 0 , 486, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #73 [ref=2x]
+ { F(FpuM32)|F(FpuM64) , 0 , 358, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #74 [ref=1x]
+ { 0 , 0 , 487, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #75 [ref=4x]
+ { 0 , 0 , 488, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #76 [ref=1x]
+ { 0 , 0 , 45 , 10, CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #77 [ref=1x]
+ { 0 , 0 , 489, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #78 [ref=1x]
+ { F(Lock) , 0 , 238, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #79 [ref=1x]
+ { 0 , 0 , 379, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #80 [ref=2x]
+ { 0 , 0 , 336, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #81 [ref=3x]
+ { F(Rep) , 0 , 490, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #82 [ref=1x]
+ { F(Vec) , 0 , 359, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #83 [ref=1x]
+ { 0 , 0 , 491, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #84 [ref=2x]
+ { 0 , 0 , 492, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #85 [ref=8x]
+ { 0 , 0 , 361, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #86 [ref=3x]
+ { 0 , 0 , 363, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #87 [ref=1x]
+ { 0 , 0 , 365, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #88 [ref=1x]
+ { 0 , 0 , 110, 1 , CONTROL_FLOW(Return), SAME_REG_HINT(None)}, // #89 [ref=2x]
+ { 0 , 0 , 466, 1 , CONTROL_FLOW(Return), SAME_REG_HINT(None)}, // #90 [ref=1x]
+ { F(Rep) , 0 , 244, 1 , CONTROL_FLOW(Branch), SAME_REG_HINT(None)}, // #91 [ref=30x]
+ { F(Rep) , 0 , 367, 2 , CONTROL_FLOW(Branch), SAME_REG_HINT(None)}, // #92 [ref=1x]
+ { F(Rep) , 0 , 244, 3 , CONTROL_FLOW(Jump), SAME_REG_HINT(None)}, // #93 [ref=1x]
+ { F(Vex) , 0 , 493, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #94 [ref=19x]
+ { F(Vex) , 0 , 369, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #95 [ref=1x]
+ { F(Vex) , 0 , 371, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #96 [ref=1x]
+ { F(Vex) , 0 , 187, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #97 [ref=1x]
+ { F(Vex) , 0 , 373, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #98 [ref=1x]
+ { F(Vex) , 0 , 494, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #99 [ref=12x]
+ { F(Vex) , 0 , 495, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #100 [ref=8x]
+ { F(Vex) , 0 , 493, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #101 [ref=8x]
+ { 0 , 0 , 496, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #102 [ref=2x]
+ { 0 , 0 , 253, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #103 [ref=1x]
+ { 0 , 0 , 247, 3 , CONTROL_FLOW(Call), SAME_REG_HINT(None)}, // #104 [ref=1x]
+ { F(Vec) , 0 , 169, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #105 [ref=2x]
+ { 0 , 0 , 497, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #106 [ref=2x]
+ { 0 , 0 , 375, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #107 [ref=2x]
+ { F(Vex) , 0 , 498, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #108 [ref=2x]
+ { 0 , 0 , 377, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #109 [ref=1x]
+ { 0 , 0 , 250, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #110 [ref=3x]
+ { 0 , 0 , 247, 3 , CONTROL_FLOW(Jump), SAME_REG_HINT(None)}, // #111 [ref=1x]
+ { 0 , 0 , 499, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #112 [ref=5x]
+ { F(Vex) , 0 , 379, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #113 [ref=2x]
+ { F(Rep) , 0 , 191, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #114 [ref=1x]
+ { 0 , 0 , 367, 2 , CONTROL_FLOW(Branch), SAME_REG_HINT(None)}, // #115 [ref=3x]
+ { 0 , 0 , 253, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #116 [ref=1x]
+ { F(Vex) , 0 , 381, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #117 [ref=2x]
+ { F(Vec) , 0 , 500, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #118 [ref=1x]
+ { F(Mmx) , 0 , 501, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #119 [ref=1x]
+ { 0 , 0 , 502, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #120 [ref=2x]
+ { F(XRelease) , 0 , 0 , 20, CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #121 [ref=1x]
+ { 0 , 0 , 55 , 9 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #122 [ref=1x]
+ { F(Vec) , 0 , 72 , 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #123 [ref=6x]
+ { 0 , 0 , 104, 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #124 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 383, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #125 [ref=1x]
+ { 0 , 0 , 385, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #126 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 503, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #127 [ref=1x]
+ { F(Vec) , 0 , 354, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #128 [ref=2x]
+ { F(Vec) , 0 , 80 , 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #129 [ref=4x]
+ { F(Vec) , 0 , 504, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #130 [ref=2x]
+ { F(Vec) , 0 , 73 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #131 [ref=3x]
+ { F(Mmx) , 0 , 505, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #132 [ref=1x]
+ { F(Vec) , 0 , 80 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #133 [ref=1x]
+ { F(Vec) , 0 , 88 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #134 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 139, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #135 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 506, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #136 [ref=1x]
+ { F(Rep) , 0 , 195, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #137 [ref=1x]
+ { F(Vec) , 0 , 387, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #138 [ref=1x]
+ { F(Vec) , 0 , 389, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #139 [ref=1x]
+ { 0 , 0 , 256, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #140 [ref=2x]
+ { 0 , 0 , 391, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #141 [ref=1x]
+ { F(Vex) , 0 , 393, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #142 [ref=1x]
+ { 0 , 0 , 507, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #143 [ref=1x]
+ { 0 , 0 , 508, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #144 [ref=1x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 239, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #145 [ref=2x]
+ { 0 , 0 , 110, 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #146 [ref=1x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 20 , 13, CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #147 [ref=1x]
+ { 0 , 0 , 509, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #148 [ref=1x]
+ { F(Rep) , 0 , 510, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #149 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 395, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #150 [ref=37x]
+ { F(Mmx)|F(Vec) , 0 , 397, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #151 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 395, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #152 [ref=6x]
+ { F(Mmx)|F(Vec) , 0 , 395, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #153 [ref=16x]
+ { F(Mmx) , 0 , 139, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #154 [ref=26x]
+ { F(Vec) , 0 , 72 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #155 [ref=4x]
+ { F(Vec) , 0 , 511, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #156 [ref=1x]
+ { F(Vec) , 0 , 512, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #157 [ref=1x]
+ { F(Vec) , 0 , 513, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #158 [ref=1x]
+ { F(Vec) , 0 , 514, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #159 [ref=1x]
+ { F(Vec) , 0 , 515, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #160 [ref=1x]
+ { F(Vec) , 0 , 516, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #161 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 399, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #162 [ref=1x]
+ { F(Vec) , 0 , 517, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #163 [ref=1x]
+ { F(Vec) , 0 , 518, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #164 [ref=1x]
+ { F(Vec) , 0 , 519, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #165 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 520, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #166 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 521, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #167 [ref=1x]
+ { F(Vec) , 0 , 313, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #168 [ref=2x]
+ { 0 , 0 , 144, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #169 [ref=1x]
+ { F(Mmx) , 0 , 397, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #170 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 401, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #171 [ref=8x]
+ { F(Vec) , 0 , 522, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #172 [ref=2x]
+ { 0 , 0 , 403, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #173 [ref=1x]
+ { F(Mmx)|F(Vec) , 0 , 405, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #174 [ref=3x]
+ { 0 , 0 , 149, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #175 [ref=1x]
+ { 0 , 0 , 407, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #176 [ref=8x]
+ { 0 , 0 , 523, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #177 [ref=4x]
+ { 0 , 0 , 524, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #178 [ref=8x]
+ { 0 , 0 , 409, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #179 [ref=1x]
+ { F(Rep)|F(RepIgnored) , 0 , 411, 2 , CONTROL_FLOW(Return), SAME_REG_HINT(None)}, // #180 [ref=1x]
+ { 0 , 0 , 411, 2 , CONTROL_FLOW(Return), SAME_REG_HINT(None)}, // #181 [ref=1x]
+ { F(Vex) , 0 , 413, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #182 [ref=1x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 20 , 13, CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #183 [ref=3x]
+ { F(Rep) , 0 , 199, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #184 [ref=1x]
+ { 0 , 0 , 525, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #185 [ref=30x]
+ { 0 , 0 , 259, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #186 [ref=2x]
+ { 0 , 0 , 415, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #187 [ref=3x]
+ { F(Rep) , 0 , 203, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #188 [ref=1x]
+ { F(Vex) , 0 , 526, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #189 [ref=8x]
+ { 0 , 0 , 64 , 8 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #190 [ref=1x]
+ { F(Tsib)|F(Vex) , 0 , 527, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #191 [ref=2x]
+ { F(Vex) , 0 , 466, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #192 [ref=1x]
+ { F(Tsib)|F(Vex) , 0 , 528, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #193 [ref=1x]
+ { F(Vex) , 0 , 529, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #194 [ref=1x]
+ { 0 , 0 , 530, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #195 [ref=2x]
+ { 0 , 0 , 50 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #196 [ref=2x]
+ { 0 , 0 , 417, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #197 [ref=1x]
+ { F(Evex)|F(Vec) , X(K)|X(T4X)|X(Z) , 531, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #198 [ref=4x]
+ { F(Evex)|F(Vec) , X(K)|X(T4X)|X(Z) , 532, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #199 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #200 [ref=22x]
+ { F(Evex)|F(Vec) , X(B16)|X(ER)|X(K)|X(SAE)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #201 [ref=23x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #202 [ref=22x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(K)|X(SAE)|X(Z) , 533, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #203 [ref=18x]
+ { F(Evex)|F(Vec) , X(ER)|X(K)|X(SAE)|X(Z) , 534, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #204 [ref=18x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(K)|X(SAE)|X(Z) , 535, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #205 [ref=17x]
+ { F(Vec)|F(Vex) , 0 , 262, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #206 [ref=29x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #207 [ref=5x]
+ { F(Vec)|F(Vex) , 0 , 72 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #208 [ref=17x]
+ { F(Vec)|F(Vex) , 0 , 292, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #209 [ref=1x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 265, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #210 [ref=4x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 265, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #211 [ref=4x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #212 [ref=10x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #213 [ref=12x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #214 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #215 [ref=6x]
+ { F(Vec)|F(Vex) , 0 , 536, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #216 [ref=2x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #217 [ref=17x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #218 [ref=12x]
+ { F(Vec)|F(Vex) , 0 , 265, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #219 [ref=6x]
+ { F(Vec)|F(Vex) , 0 , 419, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #220 [ref=3x]
+ { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 537, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #221 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 538, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #222 [ref=1x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 539, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #223 [ref=4x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 540, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #224 [ref=4x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 445, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #225 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 538, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #226 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 541, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #227 [ref=1x]
+ { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(B64)|X(ImplicitZ)|X(K)|X(SAE), 268, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #228 [ref=1x]
+ { F(Evex)|F(Vec) , X(B16)|X(ImplicitZ)|X(K)|X(SAE), 271, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #229 [ref=1x]
+ { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(B32)|X(ImplicitZ)|X(K)|X(SAE), 268, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #230 [ref=1x]
+ { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(ImplicitZ)|X(K)|X(SAE) , 542, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #231 [ref=1x]
+ { F(Evex)|F(Vec) , X(ImplicitZ)|X(K)|X(SAE) , 543, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #232 [ref=1x]
+ { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(ImplicitZ)|X(K)|X(SAE) , 544, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #233 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(SAE) , 143, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #234 [ref=2x]
+ { F(Evex)|F(Vec) , X(SAE) , 313, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #235 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(SAE) , 283, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #236 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 274, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #237 [ref=6x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 277, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #238 [ref=1x]
+ { F(Evex)|F(Vec) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 421, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #239 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #240 [ref=3x]
+ { F(Vec)|F(Vex) , 0 , 169, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #241 [ref=5x]
+ { F(Evex)|F(EvexCompat)|F(PreferEvex)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 421, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #242 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 421, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #243 [ref=2x]
+ { F(Evex)|F(Vec) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 545, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #244 [ref=3x]
+ { F(Evex)|F(Vec) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #245 [ref=4x]
+ { F(Evex)|F(Vec) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 421, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #246 [ref=3x]
+ { F(Evex)|F(Vec) , X(B16)|X(ER)|X(K)|X(SAE)|X(Z) , 277, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #247 [ref=2x]
+ { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 283, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #248 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 277, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #249 [ref=1x]
+ { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 277, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #250 [ref=3x]
+ { F(Evex)|F(Vec) , X(B16)|X(ER)|X(K)|X(SAE)|X(Z) , 283, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #251 [ref=2x]
+ { F(Evex)|F(Vec) , X(B16)|X(ER)|X(K)|X(SAE)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #252 [ref=5x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 277, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #253 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 286, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #254 [ref=1x]
+ { F(Evex)|F(Vec) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 277, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #255 [ref=2x]
+ { F(Evex)|F(Vec) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #256 [ref=2x]
+ { F(Evex)|F(Vec) , X(ER)|X(K)|X(SAE)|X(Z) , 533, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #257 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(SAE) , 341, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #258 [ref=1x]
+ { F(Evex)|F(Vec) , X(ER)|X(SAE) , 341, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #259 [ref=1x]
+ { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 534, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #260 [ref=5x]
+ { F(Evex)|F(Vec) , X(ER)|X(SAE) , 423, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #261 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(SAE) , 425, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #262 [ref=2x]
+ { F(Evex)|F(Vec) , X(ER)|X(SAE) , 427, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #263 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 535, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #264 [ref=3x]
+ { F(Evex)|F(Vec) , X(ER)|X(K)|X(SAE)|X(Z) , 535, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #265 [ref=6x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(ER)|X(SAE) , 347, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #266 [ref=1x]
+ { F(Evex)|F(Vec) , X(ER)|X(SAE) , 347, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #267 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(SAE)|X(Z) , 421, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #268 [ref=1x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #269 [ref=3x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 421, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #270 [ref=1x]
+ { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #271 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(SAE)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #272 [ref=1x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 277, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #273 [ref=2x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #274 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(SAE) , 341, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #275 [ref=1x]
+ { F(Evex)|F(Vec) , X(SAE) , 341, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #276 [ref=1x]
+ { F(Evex)|F(Vec) , X(SAE) , 423, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #277 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(SAE) , 347, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #278 [ref=1x]
+ { F(Evex)|F(Vec) , X(SAE) , 347, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #279 [ref=1x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 277, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #280 [ref=1x]
+ { F(Evex)|F(Vec) , X(ER)|X(SAE) , 425, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #281 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 265, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #282 [ref=3x]
+ { F(Vec)|F(Vex) , 0 , 265, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #283 [ref=10x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 78 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #284 [ref=3x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 78 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #285 [ref=3x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #286 [ref=8x]
+ { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 287, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #287 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 546, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #288 [ref=4x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 288, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #289 [ref=4x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 480, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #290 [ref=2x]
+ { F(Evex)|F(Vec) , X(B32)|X(ER)|X(K)|X(SAE)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #291 [ref=5x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 265, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #292 [ref=2x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 265, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #293 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 547, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #294 [ref=4x]
+ { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 548, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #295 [ref=4x]
+ { F(Vec)|F(Vex) , 0 , 207, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #296 [ref=13x]
+ { F(Vec)|F(Vex) , 0 , 429, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #297 [ref=4x]
+ { F(Vec)|F(Vex) , 0 , 431, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #298 [ref=4x]
+ { F(Evex)|F(Vec) , X(B64)|X(ImplicitZ)|X(K) , 549, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #299 [ref=1x]
+ { F(Evex)|F(Vec) , X(B16)|X(K) , 549, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #300 [ref=1x]
+ { F(Evex)|F(Vec) , X(B32)|X(ImplicitZ)|X(K) , 549, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #301 [ref=1x]
+ { F(Evex)|F(Vec) , X(ImplicitZ)|X(K) , 550, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #302 [ref=1x]
+ { F(Evex)|F(Vec) , X(K) , 551, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #303 [ref=1x]
+ { F(Evex)|F(Vec) , X(ImplicitZ)|X(K) , 552, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #304 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 280, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #305 [ref=7x]
+ { F(Vec)|F(Vex) , 0 , 143, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #306 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 283, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #307 [ref=1x]
+ { F(Evex)|F(EvexTwoOp)|F(Vec)|F(Vex)|F(Vsib) , X(K) , 211, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #308 [ref=2x]
+ { F(Evex)|F(EvexTwoOp)|F(Vec)|F(Vex)|F(Vsib) , X(K) , 154, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #309 [ref=2x]
+ { F(Evex)|F(Vsib) , X(K) , 553, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #310 [ref=4x]
+ { F(Evex)|F(Vsib) , X(K) , 554, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #311 [ref=4x]
+ { F(Evex)|F(Vsib) , X(K) , 555, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #312 [ref=8x]
+ { F(Evex)|F(EvexTwoOp)|F(Vec)|F(Vex)|F(Vsib) , X(K) , 159, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #313 [ref=2x]
+ { F(Evex)|F(EvexTwoOp)|F(Vec)|F(Vex)|F(Vsib) , X(K) , 289, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #314 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 533, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #315 [ref=3x]
+ { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 535, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #316 [ref=3x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(SAE)|X(Z) , 292, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #317 [ref=2x]
+ { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 292, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #318 [ref=3x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(SAE)|X(Z) , 292, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #319 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(SAE)|X(Z) , 556, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #320 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 265, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #321 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #322 [ref=22x]
+ { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 433, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #323 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 433, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #324 [ref=4x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 557, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #325 [ref=4x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 548, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #326 [ref=1x]
+ { F(Vex) , 0 , 497, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #327 [ref=2x]
+ { F(Vec)|F(Vex) , 0 , 500, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #328 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 215, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #329 [ref=4x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(SAE)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #330 [ref=2x]
+ { F(Evex)|F(Vec) , X(B16)|X(K)|X(SAE)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #331 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(SAE)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #332 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(SAE)|X(Z) , 533, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #333 [ref=2x]
+ { 0 , 0 , 435, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #334 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 72 , 8 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #335 [ref=4x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 437, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #336 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 295, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #337 [ref=1x]
+ { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 72 , 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #338 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 116, 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #339 [ref=6x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 82 , 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #340 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 219, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #341 [ref=4x]
+ { F(Vec)|F(Vex) , 0 , 558, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #342 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 164, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #343 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 169, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #344 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 174, 5 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #345 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 80 , 8 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #346 [ref=1x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 223, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #347 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #348 [ref=4x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 88 , 8 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #349 [ref=1x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 439, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #350 [ref=1x]
+ { 0 , 0 , 441, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #351 [ref=1x]
+ { 0 , 0 , 443, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #352 [ref=1x]
+ { F(Evex)|F(Vec) , X(B32) , 298, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #353 [ref=1x]
+ { F(Evex)|F(Vec) , X(B64) , 298, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #354 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #355 [ref=1x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #356 [ref=5x]
+ { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 262, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #357 [ref=2x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #358 [ref=2x]
+ { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 262, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #359 [ref=2x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #360 [ref=2x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #361 [ref=2x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #362 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #363 [ref=13x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 559, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #364 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 560, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #365 [ref=1x]
+ { F(Evex)|F(Vec) , 0 , 561, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #366 [ref=6x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 445, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #367 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 562, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #368 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 265, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #369 [ref=1x]
+ { F(Evex)|F(Vec) , X(ImplicitZ)|X(K) , 271, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #370 [ref=2x]
+ { F(Evex)|F(Vec) , X(B32)|X(ImplicitZ)|X(K) , 271, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #371 [ref=2x]
+ { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(ImplicitZ)|X(K) , 301, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #372 [ref=4x]
+ { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(B32)|X(ImplicitZ)|X(K) , 301, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #373 [ref=2x]
+ { F(Evex)|F(EvexKReg)|F(Vec)|F(Vex) , X(B64)|X(ImplicitZ)|X(K) , 301, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #374 [ref=2x]
+ { F(Vec)|F(Vex) , 0 , 511, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #375 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 512, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #376 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 513, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #377 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 514, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #378 [ref=1x]
+ { F(Evex)|F(Vec) , X(B64)|X(ImplicitZ)|X(K) , 271, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #379 [ref=4x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #380 [ref=6x]
+ { F(Evex)|F(EvexCompat)|F(PreferEvex)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #381 [ref=4x]
+ { F(Vec)|F(Vex) , 0 , 266, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #382 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 263, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #383 [ref=2x]
+ { F(Vec)|F(Vex) , 0 , 227, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #384 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 96 , 8 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #385 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 96 , 8 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #386 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 231, 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #387 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 515, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #388 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 516, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #389 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 563, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #390 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 564, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #391 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 565, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #392 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 566, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #393 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 567, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #394 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 419, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #395 [ref=12x]
+ { F(Evex)|F(EvexCompat)|F(PreferEvex)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #396 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #397 [ref=8x]
+ { F(Evex)|F(Vec) , 0 , 568, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #398 [ref=4x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 304, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #399 [ref=6x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 307, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #400 [ref=9x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 310, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #401 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 283, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #402 [ref=4x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 313, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #403 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 277, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #404 [ref=6x]
+ { F(Vec)|F(Vex) , 0 , 207, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #405 [ref=1x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 292, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #406 [ref=3x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 292, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #407 [ref=3x]
+ { F(Vec)|F(Vex) , 0 , 447, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #408 [ref=4x]
+ { F(Evex)|F(Vec)|F(Vsib) , X(K) , 316, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #409 [ref=2x]
+ { F(Evex)|F(Vec)|F(Vsib) , X(K) , 449, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #410 [ref=2x]
+ { F(Evex)|F(Vec)|F(Vsib) , X(K) , 451, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #411 [ref=2x]
+ { F(Evex)|F(Vec)|F(Vsib) , X(K) , 319, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #412 [ref=2x]
+ { F(Vec)|F(Vex) , 0 , 453, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #413 [ref=8x]
+ { F(Evex)|F(Vec) , X(ImplicitZ)|X(K) , 322, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #414 [ref=5x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 292, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #415 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 292, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #416 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 122, 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #417 [ref=3x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , 0 , 292, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #418 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 122, 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #419 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 122, 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #420 [ref=3x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 128, 6 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #421 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #422 [ref=6x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #423 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(WO)}, // #424 [ref=2x]
+ { F(Evex)|F(Vec) , X(B32)|X(ImplicitZ)|X(K) , 322, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #425 [ref=2x]
+ { F(Evex)|F(Vec) , X(B64)|X(ImplicitZ)|X(K) , 322, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #426 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 533, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #427 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 535, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #428 [ref=2x]
+ { F(Evex)|F(Vec) , X(B16)|X(K)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #429 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 534, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #430 [ref=2x]
+ { F(Vec)|F(Vex) , 0 , 535, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #431 [ref=2x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 547, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #432 [ref=1x]
+ { F(Evex)|F(Vec) , X(K)|X(Z) , 548, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #433 [ref=1x]
+ { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 292, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #434 [ref=2x]
+ { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 547, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #435 [ref=1x]
+ { F(EvexTransformable)|F(Vec)|F(Vex) , 0 , 548, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #436 [ref=1x]
+ { F(Evex)|F(Vec) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 262, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #437 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 569, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #438 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 570, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #439 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 571, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #440 [ref=1x]
+ { F(Evex)|F(Vec) , X(B32)|X(K)|X(Z) , 266, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #441 [ref=2x]
+ { F(Evex)|F(Vec) , X(B64)|X(K)|X(Z) , 266, 2 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #442 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(K)|X(Z) , 265, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #443 [ref=1x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B32)|X(K)|X(Z) , 265, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #444 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 262, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #445 [ref=2x]
+ { F(Evex)|F(EvexCompat)|F(Vec)|F(Vex) , X(B64)|X(ER)|X(K)|X(SAE)|X(Z) , 280, 3 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #446 [ref=1x]
+ { F(Vec)|F(Vex) , 0 , 110, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #447 [ref=2x]
+ { 0 , 0 , 27 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #448 [ref=2x]
+ { 0 , 0 , 28 , 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #449 [ref=2x]
+ { F(Lock)|F(XAcquire)|F(XRelease) , 0 , 25 , 4 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #450 [ref=1x]
+ { 0 , 0 , 236, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #451 [ref=1x]
+ { F(XAcquire) , 0 , 25 , 8 , CONTROL_FLOW(Regular), SAME_REG_HINT(RO)}, // #452 [ref=1x]
+ { 0 , 0 , 572, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)}, // #453 [ref=6x]
+ { 0 , 0 , 573, 1 , CONTROL_FLOW(Regular), SAME_REG_HINT(None)} // #454 [ref=6x]
};
#undef SAME_REG_HINT
#undef CONTROL_FLOW
@@ -2609,197 +2656,220 @@ const InstDB::CommonInfo InstDB::_commonInfoTable[] = {
// ------------------- Automatically generated, do not edit -------------------
#define EXT(VAL) uint32_t(CpuFeatures::X86::k##VAL)
const InstDB::AdditionalInfo InstDB::_additionalInfoTable[] = {
- { 0, 0, { 0 } }, // #0 [ref=148x]
+ { 0, 0, { 0 } }, // #0 [ref=67x]
{ 0, 1, { 0 } }, // #1 [ref=32x]
- { 0, 2, { 0 } }, // #2 [ref=2x]
- { 0, 3, { EXT(ADX) } }, // #3 [ref=1x]
- { 0, 0, { EXT(SSE2) } }, // #4 [ref=60x]
- { 0, 0, { EXT(SSE) } }, // #5 [ref=41x]
- { 0, 0, { EXT(SSE3) } }, // #6 [ref=12x]
- { 0, 4, { EXT(ADX) } }, // #7 [ref=1x]
- { 0, 0, { EXT(AESNI) } }, // #8 [ref=6x]
- { 0, 1, { EXT(BMI) } }, // #9 [ref=6x]
- { 0, 5, { 0 } }, // #10 [ref=5x]
- { 0, 0, { EXT(TBM) } }, // #11 [ref=9x]
- { 0, 0, { EXT(SSE4_1) } }, // #12 [ref=47x]
- { 0, 0, { EXT(MPX) } }, // #13 [ref=7x]
- { 0, 6, { 0 } }, // #14 [ref=4x]
- { 0, 1, { EXT(BMI2) } }, // #15 [ref=1x]
- { 0, 7, { EXT(SMAP) } }, // #16 [ref=2x]
- { 0, 8, { 0 } }, // #17 [ref=2x]
- { 0, 9, { 0 } }, // #18 [ref=2x]
- { 0, 0, { EXT(CLDEMOTE) } }, // #19 [ref=1x]
- { 0, 0, { EXT(CLFLUSH) } }, // #20 [ref=1x]
- { 0, 0, { EXT(CLFLUSHOPT) } }, // #21 [ref=1x]
- { 0, 0, { EXT(SVM) } }, // #22 [ref=6x]
- { 0, 10, { 0 } }, // #23 [ref=2x]
- { 0, 1, { EXT(CET_SS) } }, // #24 [ref=3x]
- { 0, 0, { EXT(UINTR) } }, // #25 [ref=4x]
- { 0, 0, { EXT(CLWB) } }, // #26 [ref=1x]
- { 0, 0, { EXT(CLZERO) } }, // #27 [ref=1x]
- { 0, 3, { 0 } }, // #28 [ref=1x]
- { 0, 11, { EXT(CMOV) } }, // #29 [ref=6x]
- { 0, 12, { EXT(CMOV) } }, // #30 [ref=8x]
- { 0, 13, { EXT(CMOV) } }, // #31 [ref=6x]
- { 0, 14, { EXT(CMOV) } }, // #32 [ref=4x]
- { 0, 15, { EXT(CMOV) } }, // #33 [ref=4x]
- { 0, 16, { EXT(CMOV) } }, // #34 [ref=2x]
- { 0, 17, { EXT(CMOV) } }, // #35 [ref=6x]
- { 0, 18, { EXT(CMOV) } }, // #36 [ref=2x]
- { 0, 19, { 0 } }, // #37 [ref=2x]
- { 0, 1, { EXT(I486) } }, // #38 [ref=2x]
- { 0, 5, { EXT(CMPXCHG16B) } }, // #39 [ref=1x]
- { 0, 5, { EXT(CMPXCHG8B) } }, // #40 [ref=1x]
- { 0, 1, { EXT(SSE2) } }, // #41 [ref=2x]
- { 0, 1, { EXT(SSE) } }, // #42 [ref=2x]
- { 0, 0, { EXT(I486) } }, // #43 [ref=4x]
- { 0, 0, { EXT(SSE4_2) } }, // #44 [ref=2x]
- { 0, 20, { 0 } }, // #45 [ref=2x]
- { 0, 0, { EXT(MMX) } }, // #46 [ref=1x]
- { 0, 0, { EXT(CET_IBT) } }, // #47 [ref=2x]
- { 0, 0, { EXT(ENQCMD) } }, // #48 [ref=2x]
- { 0, 0, { EXT(SSE4A) } }, // #49 [ref=4x]
- { 0, 21, { 0 } }, // #50 [ref=4x]
- { 0, 0, { EXT(3DNOW) } }, // #51 [ref=21x]
- { 0, 0, { EXT(FXSR) } }, // #52 [ref=4x]
- { 0, 0, { EXT(SMX) } }, // #53 [ref=1x]
- { 0, 0, { EXT(GFNI) } }, // #54 [ref=3x]
- { 0, 0, { EXT(HRESET) } }, // #55 [ref=1x]
- { 0, 0, { EXT(CET_SS) } }, // #56 [ref=9x]
- { 0, 16, { 0 } }, // #57 [ref=5x]
- { 0, 0, { EXT(VMX) } }, // #58 [ref=12x]
- { 0, 11, { 0 } }, // #59 [ref=8x]
- { 0, 12, { 0 } }, // #60 [ref=12x]
- { 0, 13, { 0 } }, // #61 [ref=10x]
- { 0, 14, { 0 } }, // #62 [ref=8x]
- { 0, 15, { 0 } }, // #63 [ref=8x]
- { 0, 17, { 0 } }, // #64 [ref=8x]
- { 0, 18, { 0 } }, // #65 [ref=4x]
- { 0, 0, { EXT(AVX512_DQ) } }, // #66 [ref=22x]
- { 0, 0, { EXT(AVX512_BW) } }, // #67 [ref=20x]
- { 0, 0, { EXT(AVX512_F) } }, // #68 [ref=36x]
- { 1, 0, { EXT(AVX512_DQ) } }, // #69 [ref=1x]
- { 1, 0, { EXT(AVX512_BW) } }, // #70 [ref=2x]
- { 1, 0, { EXT(AVX512_F) } }, // #71 [ref=1x]
- { 0, 1, { EXT(AVX512_DQ) } }, // #72 [ref=3x]
- { 0, 1, { EXT(AVX512_BW) } }, // #73 [ref=4x]
- { 0, 1, { EXT(AVX512_F) } }, // #74 [ref=1x]
- { 0, 22, { EXT(LAHFSAHF) } }, // #75 [ref=1x]
- { 0, 0, { EXT(AMX_TILE) } }, // #76 [ref=7x]
- { 0, 0, { EXT(LWP) } }, // #77 [ref=4x]
- { 0, 23, { 0 } }, // #78 [ref=3x]
- { 0, 1, { EXT(LZCNT) } }, // #79 [ref=1x]
- { 0, 0, { EXT(MMX2) } }, // #80 [ref=8x]
- { 0, 1, { EXT(MCOMMIT) } }, // #81 [ref=1x]
- { 0, 0, { EXT(MONITOR) } }, // #82 [ref=2x]
- { 0, 0, { EXT(MONITORX) } }, // #83 [ref=2x]
- { 1, 0, { 0 } }, // #84 [ref=1x]
- { 1, 0, { EXT(SSE2) } }, // #85 [ref=5x]
- { 1, 0, { EXT(SSE) } }, // #86 [ref=3x]
- { 0, 0, { EXT(MOVBE) } }, // #87 [ref=1x]
- { 0, 0, { EXT(MMX), EXT(SSE2) } }, // #88 [ref=45x]
- { 0, 0, { EXT(MOVDIR64B) } }, // #89 [ref=1x]
- { 0, 0, { EXT(MOVDIRI) } }, // #90 [ref=1x]
- { 1, 0, { EXT(MMX), EXT(SSE2) } }, // #91 [ref=1x]
- { 0, 0, { EXT(BMI2) } }, // #92 [ref=7x]
- { 0, 0, { EXT(SSSE3) } }, // #93 [ref=15x]
- { 0, 0, { EXT(MMX2), EXT(SSE2) } }, // #94 [ref=10x]
- { 0, 0, { EXT(PCLMULQDQ) } }, // #95 [ref=1x]
- { 0, 1, { EXT(SSE4_2) } }, // #96 [ref=4x]
- { 0, 0, { EXT(PCONFIG) } }, // #97 [ref=1x]
- { 0, 0, { EXT(MMX2), EXT(SSE2), EXT(SSE4_1) } }, // #98 [ref=1x]
- { 0, 0, { EXT(3DNOW2) } }, // #99 [ref=5x]
- { 0, 0, { EXT(GEODE) } }, // #100 [ref=2x]
- { 0, 1, { EXT(POPCNT) } }, // #101 [ref=1x]
- { 0, 24, { 0 } }, // #102 [ref=3x]
- { 0, 1, { EXT(PREFETCHW) } }, // #103 [ref=1x]
- { 0, 1, { EXT(PREFETCHWT1) } }, // #104 [ref=1x]
- { 0, 20, { EXT(SNP) } }, // #105 [ref=3x]
- { 0, 1, { EXT(SSE4_1) } }, // #106 [ref=1x]
- { 0, 0, { EXT(PTWRITE) } }, // #107 [ref=1x]
- { 0, 25, { 0 } }, // #108 [ref=3x]
- { 0, 1, { EXT(SNP) } }, // #109 [ref=1x]
- { 0, 26, { 0 } }, // #110 [ref=2x]
- { 0, 0, { EXT(FSGSBASE) } }, // #111 [ref=4x]
- { 0, 0, { EXT(MSR) } }, // #112 [ref=2x]
- { 0, 0, { EXT(RDPID) } }, // #113 [ref=1x]
- { 0, 0, { EXT(OSPKE) } }, // #114 [ref=1x]
- { 0, 0, { EXT(RDPRU) } }, // #115 [ref=1x]
- { 0, 1, { EXT(RDRAND) } }, // #116 [ref=1x]
- { 0, 1, { EXT(RDSEED) } }, // #117 [ref=1x]
- { 0, 0, { EXT(RDTSC) } }, // #118 [ref=1x]
- { 0, 0, { EXT(RDTSCP) } }, // #119 [ref=1x]
- { 0, 27, { 0 } }, // #120 [ref=2x]
- { 0, 28, { EXT(LAHFSAHF) } }, // #121 [ref=1x]
- { 0, 0, { EXT(SERIALIZE) } }, // #122 [ref=1x]
- { 0, 0, { EXT(SHA) } }, // #123 [ref=7x]
- { 0, 0, { EXT(SKINIT) } }, // #124 [ref=2x]
- { 0, 0, { EXT(AMX_BF16) } }, // #125 [ref=1x]
- { 0, 0, { EXT(AMX_INT8) } }, // #126 [ref=4x]
- { 0, 1, { EXT(UINTR) } }, // #127 [ref=1x]
- { 0, 1, { EXT(WAITPKG) } }, // #128 [ref=2x]
- { 0, 0, { EXT(WAITPKG) } }, // #129 [ref=1x]
- { 0, 0, { EXT(AVX512_4FMAPS) } }, // #130 [ref=4x]
- { 0, 0, { EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL) } }, // #131 [ref=42x]
- { 0, 0, { EXT(AVX512_FP16), EXT(AVX512_VL) } }, // #132 [ref=63x]
- { 0, 0, { EXT(AVX), EXT(AVX512_F) } }, // #133 [ref=29x]
- { 0, 0, { EXT(AVX512_FP16) } }, // #134 [ref=43x]
- { 0, 0, { EXT(AVX) } }, // #135 [ref=35x]
- { 0, 0, { EXT(AESNI), EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL), EXT(VAES) } }, // #136 [ref=4x]
- { 0, 0, { EXT(AESNI), EXT(AVX) } }, // #137 [ref=2x]
- { 0, 0, { EXT(AVX512_F), EXT(AVX512_VL) } }, // #138 [ref=108x]
- { 0, 0, { EXT(AVX), EXT(AVX512_DQ), EXT(AVX512_VL) } }, // #139 [ref=8x]
- { 0, 0, { EXT(AVX512_DQ), EXT(AVX512_VL) } }, // #140 [ref=30x]
- { 0, 0, { EXT(AVX2) } }, // #141 [ref=7x]
- { 0, 0, { EXT(AVX), EXT(AVX2), EXT(AVX512_F), EXT(AVX512_VL) } }, // #142 [ref=39x]
- { 0, 1, { EXT(AVX), EXT(AVX512_F) } }, // #143 [ref=4x]
- { 0, 0, { EXT(AVX512_BF16), EXT(AVX512_VL) } }, // #144 [ref=3x]
- { 0, 0, { EXT(AVX512_F), EXT(AVX512_VL), EXT(F16C) } }, // #145 [ref=2x]
- { 0, 0, { EXT(AVX512_BW), EXT(AVX512_VL) } }, // #146 [ref=24x]
- { 0, 0, { EXT(AVX512_ERI) } }, // #147 [ref=10x]
- { 0, 0, { EXT(AVX512_F), EXT(AVX512_VL), EXT(FMA) } }, // #148 [ref=36x]
- { 0, 0, { EXT(AVX512_F), EXT(FMA) } }, // #149 [ref=24x]
- { 0, 0, { EXT(FMA4) } }, // #150 [ref=20x]
- { 0, 0, { EXT(XOP) } }, // #151 [ref=55x]
- { 0, 0, { EXT(AVX2), EXT(AVX512_F), EXT(AVX512_VL) } }, // #152 [ref=19x]
- { 0, 0, { EXT(AVX512_PFI) } }, // #153 [ref=16x]
- { 0, 0, { EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL), EXT(GFNI) } }, // #154 [ref=3x]
- { 1, 0, { EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL) } }, // #155 [ref=4x]
- { 1, 0, { EXT(AVX) } }, // #156 [ref=2x]
- { 1, 0, { EXT(AVX512_F), EXT(AVX512_VL) } }, // #157 [ref=4x]
- { 1, 0, { EXT(AVX512_BW), EXT(AVX512_VL) } }, // #158 [ref=2x]
- { 1, 0, { EXT(AVX), EXT(AVX512_F) } }, // #159 [ref=3x]
- { 0, 0, { EXT(AVX), EXT(AVX2) } }, // #160 [ref=17x]
- { 0, 0, { EXT(AVX512_VP2INTERSECT) } }, // #161 [ref=2x]
- { 0, 0, { EXT(AVX512_4VNNIW) } }, // #162 [ref=2x]
- { 0, 0, { EXT(AVX), EXT(AVX2), EXT(AVX512_BW), EXT(AVX512_VL) } }, // #163 [ref=54x]
- { 0, 0, { EXT(AVX2), EXT(AVX512_BW), EXT(AVX512_VL) } }, // #164 [ref=2x]
- { 0, 0, { EXT(AVX512_CDI), EXT(AVX512_VL) } }, // #165 [ref=6x]
- { 0, 0, { EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL), EXT(PCLMULQDQ), EXT(VPCLMULQDQ) } }, // #166 [ref=1x]
- { 0, 1, { EXT(AVX) } }, // #167 [ref=7x]
- { 0, 0, { EXT(AVX512_VBMI2), EXT(AVX512_VL) } }, // #168 [ref=16x]
- { 0, 0, { EXT(AVX512_VL), EXT(AVX512_VNNI), EXT(AVX_VNNI) } }, // #169 [ref=4x]
- { 0, 0, { EXT(AVX512_VBMI), EXT(AVX512_VL) } }, // #170 [ref=4x]
- { 0, 0, { EXT(AVX), EXT(AVX512_BW) } }, // #171 [ref=4x]
- { 0, 0, { EXT(AVX), EXT(AVX512_DQ) } }, // #172 [ref=4x]
- { 0, 0, { EXT(AVX512_IFMA), EXT(AVX512_VL) } }, // #173 [ref=2x]
- { 0, 0, { EXT(AVX512_BITALG), EXT(AVX512_VL) } }, // #174 [ref=3x]
- { 0, 0, { EXT(AVX512_VL), EXT(AVX512_VPOPCNTDQ) } }, // #175 [ref=2x]
- { 0, 0, { EXT(WBNOINVD) } }, // #176 [ref=1x]
- { 0, 0, { EXT(RTM) } }, // #177 [ref=3x]
- { 0, 0, { EXT(XSAVE) } }, // #178 [ref=6x]
- { 0, 0, { EXT(TSXLDTRK) } }, // #179 [ref=2x]
- { 0, 0, { EXT(XSAVES) } }, // #180 [ref=4x]
- { 0, 0, { EXT(XSAVEC) } }, // #181 [ref=2x]
- { 0, 0, { EXT(XSAVEOPT) } }, // #182 [ref=2x]
- { 0, 1, { EXT(TSX) } } // #183 [ref=1x]
+ { 0, 0, { EXT(RAO_INT) } }, // #2 [ref=4x]
+ { 0, 2, { 0 } }, // #3 [ref=2x]
+ { 0, 3, { EXT(ADX) } }, // #4 [ref=1x]
+ { 0, 0, { EXT(SSE2) } }, // #5 [ref=60x]
+ { 0, 0, { EXT(SSE) } }, // #6 [ref=46x]
+ { 0, 0, { EXT(SSE3) } }, // #7 [ref=10x]
+ { 0, 4, { EXT(ADX) } }, // #8 [ref=1x]
+ { 0, 0, { EXT(AESNI) } }, // #9 [ref=6x]
+ { 0, 1, { EXT(BMI) } }, // #10 [ref=6x]
+ { 0, 5, { 0 } }, // #11 [ref=5x]
+ { 0, 0, { EXT(TBM) } }, // #12 [ref=9x]
+ { 0, 0, { EXT(SSE4_1) } }, // #13 [ref=47x]
+ { 0, 0, { EXT(MPX) } }, // #14 [ref=7x]
+ { 0, 6, { 0 } }, // #15 [ref=4x]
+ { 0, 1, { EXT(BMI2) } }, // #16 [ref=1x]
+ { 0, 7, { EXT(SMAP) } }, // #17 [ref=2x]
+ { 0, 8, { 0 } }, // #18 [ref=2x]
+ { 0, 9, { 0 } }, // #19 [ref=2x]
+ { 0, 0, { EXT(CLDEMOTE) } }, // #20 [ref=1x]
+ { 0, 0, { EXT(CLFLUSH) } }, // #21 [ref=1x]
+ { 0, 0, { EXT(CLFLUSHOPT) } }, // #22 [ref=1x]
+ { 0, 0, { EXT(SVM) } }, // #23 [ref=6x]
+ { 0, 10, { 0 } }, // #24 [ref=2x]
+ { 0, 1, { EXT(CET_SS) } }, // #25 [ref=3x]
+ { 0, 0, { EXT(UINTR) } }, // #26 [ref=4x]
+ { 0, 0, { EXT(CLWB) } }, // #27 [ref=1x]
+ { 0, 0, { EXT(CLZERO) } }, // #28 [ref=1x]
+ { 0, 3, { 0 } }, // #29 [ref=1x]
+ { 0, 11, { EXT(CMOV) } }, // #30 [ref=4x]
+ { 0, 12, { EXT(CMOV) } }, // #31 [ref=6x]
+ { 0, 13, { EXT(CMOV) } }, // #32 [ref=4x]
+ { 0, 14, { EXT(CMOV) } }, // #33 [ref=4x]
+ { 0, 15, { EXT(CMOV) } }, // #34 [ref=4x]
+ { 0, 16, { EXT(CMOV) } }, // #35 [ref=2x]
+ { 0, 17, { EXT(CMOV) } }, // #36 [ref=4x]
+ { 0, 18, { EXT(CMOV) } }, // #37 [ref=2x]
+ { 0, 1, { EXT(CMPCCXADD) } }, // #38 [ref=16x]
+ { 0, 19, { 0 } }, // #39 [ref=2x]
+ { 0, 1, { EXT(I486) } }, // #40 [ref=2x]
+ { 0, 5, { EXT(CMPXCHG16B) } }, // #41 [ref=1x]
+ { 0, 5, { EXT(CMPXCHG8B) } }, // #42 [ref=1x]
+ { 0, 1, { EXT(SSE2) } }, // #43 [ref=2x]
+ { 0, 1, { EXT(SSE) } }, // #44 [ref=2x]
+ { 0, 0, { EXT(I486) } }, // #45 [ref=5x]
+ { 0, 0, { EXT(SSE4_2) } }, // #46 [ref=2x]
+ { 0, 20, { 0 } }, // #47 [ref=2x]
+ { 0, 0, { EXT(MMX) } }, // #48 [ref=1x]
+ { 0, 0, { EXT(CET_IBT) } }, // #49 [ref=2x]
+ { 0, 1, { EXT(ENQCMD) } }, // #50 [ref=2x]
+ { 0, 0, { EXT(SSE4A) } }, // #51 [ref=4x]
+ { 0, 21, { EXT(FPU) } }, // #52 [ref=80x]
+ { 0, 22, { EXT(CMOV), EXT(FPU) } }, // #53 [ref=2x]
+ { 0, 23, { EXT(CMOV), EXT(FPU) } }, // #54 [ref=2x]
+ { 0, 24, { EXT(CMOV), EXT(FPU) } }, // #55 [ref=2x]
+ { 0, 25, { EXT(CMOV), EXT(FPU) } }, // #56 [ref=2x]
+ { 0, 26, { EXT(FPU) } }, // #57 [ref=4x]
+ { 0, 0, { EXT(3DNOW) } }, // #58 [ref=21x]
+ { 0, 21, { EXT(SSE3), EXT(FPU) } }, // #59 [ref=1x]
+ { 0, 21, { EXT(FXSR) } }, // #60 [ref=2x]
+ { 0, 27, { EXT(FXSR) } }, // #61 [ref=2x]
+ { 0, 0, { EXT(SMX) } }, // #62 [ref=1x]
+ { 0, 0, { EXT(GFNI) } }, // #63 [ref=3x]
+ { 0, 0, { EXT(HRESET) } }, // #64 [ref=1x]
+ { 0, 0, { EXT(CET_SS) } }, // #65 [ref=9x]
+ { 0, 16, { 0 } }, // #66 [ref=5x]
+ { 0, 0, { EXT(VMX) } }, // #67 [ref=13x]
+ { 0, 0, { EXT(INVLPGB) } }, // #68 [ref=2x]
+ { 0, 11, { 0 } }, // #69 [ref=8x]
+ { 0, 12, { 0 } }, // #70 [ref=12x]
+ { 0, 13, { 0 } }, // #71 [ref=10x]
+ { 0, 14, { 0 } }, // #72 [ref=8x]
+ { 0, 15, { 0 } }, // #73 [ref=8x]
+ { 0, 17, { 0 } }, // #74 [ref=8x]
+ { 0, 18, { 0 } }, // #75 [ref=4x]
+ { 0, 0, { EXT(AVX512_DQ) } }, // #76 [ref=22x]
+ { 0, 0, { EXT(AVX512_BW) } }, // #77 [ref=20x]
+ { 0, 0, { EXT(AVX512_F) } }, // #78 [ref=36x]
+ { 1, 0, { EXT(AVX512_DQ) } }, // #79 [ref=1x]
+ { 1, 0, { EXT(AVX512_BW) } }, // #80 [ref=2x]
+ { 1, 0, { EXT(AVX512_F) } }, // #81 [ref=1x]
+ { 0, 1, { EXT(AVX512_DQ) } }, // #82 [ref=3x]
+ { 0, 1, { EXT(AVX512_BW) } }, // #83 [ref=4x]
+ { 0, 1, { EXT(AVX512_F) } }, // #84 [ref=1x]
+ { 0, 28, { EXT(LAHFSAHF) } }, // #85 [ref=1x]
+ { 0, 0, { EXT(AMX_TILE) } }, // #86 [ref=7x]
+ { 0, 0, { EXT(LWP) } }, // #87 [ref=4x]
+ { 0, 29, { 0 } }, // #88 [ref=3x]
+ { 0, 1, { EXT(LZCNT) } }, // #89 [ref=1x]
+ { 0, 0, { EXT(MMX2) } }, // #90 [ref=3x]
+ { 0, 1, { EXT(MCOMMIT) } }, // #91 [ref=1x]
+ { 0, 0, { EXT(MONITOR) } }, // #92 [ref=2x]
+ { 0, 0, { EXT(MONITORX) } }, // #93 [ref=2x]
+ { 1, 0, { 0 } }, // #94 [ref=1x]
+ { 1, 0, { EXT(SSE2) } }, // #95 [ref=5x]
+ { 1, 0, { EXT(SSE) } }, // #96 [ref=3x]
+ { 0, 0, { EXT(MOVBE) } }, // #97 [ref=1x]
+ { 0, 0, { EXT(MMX), EXT(SSE2) } }, // #98 [ref=45x]
+ { 0, 0, { EXT(MOVDIR64B) } }, // #99 [ref=1x]
+ { 0, 0, { EXT(MOVDIRI) } }, // #100 [ref=1x]
+ { 1, 0, { EXT(MMX), EXT(SSE2) } }, // #101 [ref=1x]
+ { 0, 0, { EXT(BMI2) } }, // #102 [ref=7x]
+ { 0, 0, { EXT(SSSE3) } }, // #103 [ref=16x]
+ { 0, 0, { EXT(MMX2), EXT(SSE2) } }, // #104 [ref=10x]
+ { 0, 0, { EXT(PCLMULQDQ) } }, // #105 [ref=1x]
+ { 0, 1, { EXT(SSE4_2) } }, // #106 [ref=4x]
+ { 0, 0, { EXT(PCONFIG) } }, // #107 [ref=1x]
+ { 0, 0, { EXT(MMX2), EXT(SSE2), EXT(SSE4_1) } }, // #108 [ref=1x]
+ { 0, 0, { EXT(3DNOW2) } }, // #109 [ref=5x]
+ { 0, 0, { EXT(GEODE) } }, // #110 [ref=2x]
+ { 0, 1, { EXT(POPCNT) } }, // #111 [ref=1x]
+ { 0, 30, { 0 } }, // #112 [ref=3x]
+ { 0, 0, { EXT(PREFETCHI) } }, // #113 [ref=2x]
+ { 0, 1, { EXT(PREFETCHW) } }, // #114 [ref=1x]
+ { 0, 1, { EXT(PREFETCHWT1) } }, // #115 [ref=1x]
+ { 0, 20, { EXT(SEV_SNP) } }, // #116 [ref=3x]
+ { 0, 1, { EXT(SSE4_1) } }, // #117 [ref=1x]
+ { 0, 0, { EXT(PTWRITE) } }, // #118 [ref=1x]
+ { 0, 31, { 0 } }, // #119 [ref=3x]
+ { 0, 1, { EXT(SEV_SNP) } }, // #120 [ref=1x]
+ { 0, 32, { 0 } }, // #121 [ref=2x]
+ { 0, 0, { EXT(FSGSBASE) } }, // #122 [ref=4x]
+ { 0, 0, { EXT(MSR) } }, // #123 [ref=2x]
+ { 0, 0, { EXT(RDPID) } }, // #124 [ref=1x]
+ { 0, 0, { EXT(OSPKE) } }, // #125 [ref=1x]
+ { 0, 0, { EXT(RDPRU) } }, // #126 [ref=1x]
+ { 0, 1, { EXT(RDRAND) } }, // #127 [ref=1x]
+ { 0, 1, { EXT(RDSEED) } }, // #128 [ref=1x]
+ { 0, 0, { EXT(RDTSC) } }, // #129 [ref=1x]
+ { 0, 0, { EXT(RDTSCP) } }, // #130 [ref=1x]
+ { 0, 33, { 0 } }, // #131 [ref=2x]
+ { 0, 34, { EXT(LAHFSAHF) } }, // #132 [ref=1x]
+ { 0, 0, { EXT(SEAM) } }, // #133 [ref=4x]
+ { 0, 0, { EXT(SERIALIZE) } }, // #134 [ref=1x]
+ { 0, 0, { EXT(SHA) } }, // #135 [ref=7x]
+ { 0, 0, { EXT(SKINIT) } }, // #136 [ref=2x]
+ { 0, 0, { EXT(AMX_COMPLEX) } }, // #137 [ref=2x]
+ { 0, 0, { EXT(AMX_BF16) } }, // #138 [ref=1x]
+ { 0, 0, { EXT(AMX_INT8) } }, // #139 [ref=4x]
+ { 0, 0, { EXT(AMX_FP16) } }, // #140 [ref=1x]
+ { 0, 1, { EXT(UINTR) } }, // #141 [ref=1x]
+ { 0, 1, { EXT(WAITPKG) } }, // #142 [ref=2x]
+ { 0, 0, { EXT(WAITPKG) } }, // #143 [ref=1x]
+ { 0, 0, { EXT(AVX512_4FMAPS) } }, // #144 [ref=4x]
+ { 0, 0, { EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL) } }, // #145 [ref=38x]
+ { 0, 0, { EXT(AVX512_FP16), EXT(AVX512_VL) } }, // #146 [ref=60x]
+ { 0, 0, { EXT(AVX), EXT(AVX512_F) } }, // #147 [ref=33x]
+ { 0, 0, { EXT(AVX512_FP16) } }, // #148 [ref=44x]
+ { 0, 0, { EXT(AVX) } }, // #149 [ref=35x]
+ { 0, 0, { EXT(AESNI), EXT(VAES), EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL) } }, // #150 [ref=4x]
+ { 0, 0, { EXT(AESNI), EXT(AVX) } }, // #151 [ref=2x]
+ { 0, 0, { EXT(AVX512_F), EXT(AVX512_VL) } }, // #152 [ref=108x]
+ { 0, 0, { EXT(AVX), EXT(AVX512_DQ), EXT(AVX512_VL) } }, // #153 [ref=8x]
+ { 0, 0, { EXT(AVX_NE_CONVERT) } }, // #154 [ref=6x]
+ { 0, 0, { EXT(AVX512_DQ), EXT(AVX512_VL) } }, // #155 [ref=30x]
+ { 0, 0, { EXT(AVX2) } }, // #156 [ref=7x]
+ { 0, 0, { EXT(AVX), EXT(AVX2), EXT(AVX512_F), EXT(AVX512_VL) } }, // #157 [ref=39x]
+ { 0, 1, { EXT(AVX), EXT(AVX512_F) } }, // #158 [ref=4x]
+ { 0, 1, { EXT(AVX512_FP16) } }, // #159 [ref=2x]
+ { 0, 0, { EXT(AVX512_BF16), EXT(AVX512_VL) } }, // #160 [ref=2x]
+ { 0, 0, { EXT(AVX_NE_CONVERT), EXT(AVX512_BF16), EXT(AVX512_VL) } }, // #161 [ref=1x]
+ { 0, 0, { EXT(F16C), EXT(AVX512_F), EXT(AVX512_VL) } }, // #162 [ref=2x]
+ { 0, 0, { EXT(AVX512_BW), EXT(AVX512_VL) } }, // #163 [ref=24x]
+ { 0, 0, { EXT(AVX512_ER) } }, // #164 [ref=10x]
+ { 0, 0, { EXT(FMA), EXT(AVX512_F), EXT(AVX512_VL) } }, // #165 [ref=36x]
+ { 0, 0, { EXT(FMA), EXT(AVX512_F) } }, // #166 [ref=24x]
+ { 0, 0, { EXT(FMA4) } }, // #167 [ref=20x]
+ { 0, 0, { EXT(XOP) } }, // #168 [ref=55x]
+ { 0, 0, { EXT(AVX2), EXT(AVX512_F), EXT(AVX512_VL) } }, // #169 [ref=19x]
+ { 0, 0, { EXT(AVX512_PF) } }, // #170 [ref=16x]
+ { 0, 0, { EXT(GFNI), EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL) } }, // #171 [ref=3x]
+ { 0, 0, { EXT(SEV_ES) } }, // #172 [ref=1x]
+ { 1, 0, { EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL) } }, // #173 [ref=4x]
+ { 1, 0, { EXT(AVX) } }, // #174 [ref=2x]
+ { 1, 0, { EXT(AVX512_F), EXT(AVX512_VL) } }, // #175 [ref=4x]
+ { 1, 0, { EXT(AVX512_BW), EXT(AVX512_VL) } }, // #176 [ref=2x]
+ { 1, 0, { EXT(AVX), EXT(AVX512_F) } }, // #177 [ref=3x]
+ { 0, 0, { EXT(AVX), EXT(AVX2) } }, // #178 [ref=17x]
+ { 0, 0, { EXT(AVX512_VL), EXT(AVX512_VP2INTERSECT) } }, // #179 [ref=2x]
+ { 0, 0, { EXT(AVX512_4VNNIW) } }, // #180 [ref=2x]
+ { 0, 0, { EXT(AVX), EXT(AVX2), EXT(AVX512_BW), EXT(AVX512_VL) } }, // #181 [ref=54x]
+ { 0, 0, { EXT(AVX2), EXT(AVX512_BW), EXT(AVX512_VL) } }, // #182 [ref=2x]
+ { 0, 0, { EXT(AVX512_CD), EXT(AVX512_VL) } }, // #183 [ref=6x]
+ { 0, 0, { EXT(PCLMULQDQ), EXT(VPCLMULQDQ), EXT(AVX), EXT(AVX512_F), EXT(AVX512_VL) } }, // #184 [ref=1x]
+ { 0, 1, { EXT(AVX) } }, // #185 [ref=7x]
+ { 0, 0, { EXT(AVX512_VBMI2), EXT(AVX512_VL) } }, // #186 [ref=16x]
+ { 0, 0, { EXT(AVX_VNNI_INT8) } }, // #187 [ref=6x]
+ { 0, 0, { EXT(AVX_VNNI), EXT(AVX512_VL), EXT(AVX512_VNNI) } }, // #188 [ref=4x]
+ { 0, 0, { EXT(AVX_VNNI_INT16) } }, // #189 [ref=6x]
+ { 0, 0, { EXT(AVX512_VBMI), EXT(AVX512_VL) } }, // #190 [ref=4x]
+ { 0, 0, { EXT(AVX), EXT(AVX512_BW) } }, // #191 [ref=4x]
+ { 0, 0, { EXT(AVX), EXT(AVX512_DQ) } }, // #192 [ref=4x]
+ { 0, 0, { EXT(AVX_IFMA), EXT(AVX512_IFMA), EXT(AVX512_VL) } }, // #193 [ref=2x]
+ { 0, 0, { EXT(AVX512_BITALG), EXT(AVX512_VL) } }, // #194 [ref=3x]
+ { 0, 0, { EXT(AVX512_VL), EXT(AVX512_VPOPCNTDQ) } }, // #195 [ref=2x]
+ { 0, 0, { EXT(SHA512), EXT(AVX) } }, // #196 [ref=3x]
+ { 0, 0, { EXT(SM3), EXT(AVX) } }, // #197 [ref=3x]
+ { 0, 0, { EXT(SM4), EXT(AVX) } }, // #198 [ref=2x]
+ { 0, 0, { EXT(WBNOINVD) } }, // #199 [ref=1x]
+ { 0, 0, { EXT(RTM) } }, // #200 [ref=3x]
+ { 0, 0, { EXT(XSAVE) } }, // #201 [ref=6x]
+ { 0, 0, { EXT(TSXLDTRK) } }, // #202 [ref=2x]
+ { 0, 0, { EXT(XSAVES) } }, // #203 [ref=4x]
+ { 0, 0, { EXT(XSAVEC) } }, // #204 [ref=2x]
+ { 0, 0, { EXT(XSAVEOPT) } }, // #205 [ref=2x]
+ { 0, 1, { EXT(TSX) } } // #206 [ref=1x]
};
#undef EXT
#define FLAG(VAL) uint32_t(CpuRWFlags::kX86_##VAL)
const InstDB::RWFlagsInfoTable InstDB::_rwFlagsInfoTable[] = {
- { 0, 0 }, // #0 [ref=1429x]
- { 0, FLAG(AF) | FLAG(CF) | FLAG(OF) | FLAG(PF) | FLAG(SF) | FLAG(ZF) }, // #1 [ref=84x]
+ { 0, 0 }, // #0 [ref=1383x]
+ { 0, FLAG(AF) | FLAG(CF) | FLAG(OF) | FLAG(PF) | FLAG(SF) | FLAG(ZF) }, // #1 [ref=104x]
{ FLAG(CF), FLAG(AF) | FLAG(CF) | FLAG(OF) | FLAG(PF) | FLAG(SF) | FLAG(ZF) }, // #2 [ref=2x]
{ FLAG(CF), FLAG(CF) }, // #3 [ref=2x]
{ FLAG(OF), FLAG(OF) }, // #4 [ref=1x]
@@ -2809,30 +2879,36 @@ const InstDB::RWFlagsInfoTable InstDB::_rwFlagsInfoTable[] = {
{ 0, FLAG(CF) }, // #8 [ref=2x]
{ 0, FLAG(DF) }, // #9 [ref=2x]
{ 0, FLAG(IF) }, // #10 [ref=2x]
- { FLAG(CF) | FLAG(ZF), 0 }, // #11 [ref=14x]
- { FLAG(CF), 0 }, // #12 [ref=20x]
- { FLAG(ZF), 0 }, // #13 [ref=16x]
+ { FLAG(CF) | FLAG(ZF), 0 }, // #11 [ref=12x]
+ { FLAG(CF), 0 }, // #12 [ref=18x]
+ { FLAG(ZF), 0 }, // #13 [ref=14x]
{ FLAG(OF) | FLAG(SF) | FLAG(ZF), 0 }, // #14 [ref=12x]
{ FLAG(OF) | FLAG(SF), 0 }, // #15 [ref=12x]
{ FLAG(OF), 0 }, // #16 [ref=7x]
- { FLAG(PF), 0 }, // #17 [ref=14x]
+ { FLAG(PF), 0 }, // #17 [ref=12x]
{ FLAG(SF), 0 }, // #18 [ref=6x]
{ FLAG(DF), FLAG(AF) | FLAG(CF) | FLAG(OF) | FLAG(PF) | FLAG(SF) | FLAG(ZF) }, // #19 [ref=2x]
{ 0, FLAG(AF) | FLAG(OF) | FLAG(PF) | FLAG(SF) | FLAG(ZF) }, // #20 [ref=5x]
- { 0, FLAG(CF) | FLAG(PF) | FLAG(ZF) }, // #21 [ref=4x]
- { FLAG(AF) | FLAG(CF) | FLAG(PF) | FLAG(SF) | FLAG(ZF), 0 }, // #22 [ref=1x]
- { FLAG(DF), 0 }, // #23 [ref=3x]
- { 0, FLAG(AF) | FLAG(CF) | FLAG(DF) | FLAG(IF) | FLAG(OF) | FLAG(PF) | FLAG(SF) | FLAG(ZF) }, // #24 [ref=3x]
- { FLAG(AF) | FLAG(CF) | FLAG(DF) | FLAG(IF) | FLAG(OF) | FLAG(PF) | FLAG(SF) | FLAG(ZF), 0 }, // #25 [ref=3x]
- { FLAG(CF) | FLAG(OF), FLAG(CF) | FLAG(OF) }, // #26 [ref=2x]
- { 0, FLAG(CF) | FLAG(OF) }, // #27 [ref=2x]
- { 0, FLAG(AF) | FLAG(CF) | FLAG(PF) | FLAG(SF) | FLAG(ZF) } // #28 [ref=1x]
+ { 0, FLAG(C0) | FLAG(C1) | FLAG(C2) | FLAG(C3) }, // #21 [ref=83x]
+ { FLAG(CF), FLAG(C0) | FLAG(C1) | FLAG(C2) | FLAG(C3) }, // #22 [ref=2x]
+ { FLAG(CF) | FLAG(ZF), FLAG(C0) | FLAG(C1) | FLAG(C2) | FLAG(C3) }, // #23 [ref=2x]
+ { FLAG(ZF), FLAG(C0) | FLAG(C1) | FLAG(C2) | FLAG(C3) }, // #24 [ref=2x]
+ { FLAG(PF), FLAG(C0) | FLAG(C1) | FLAG(C2) | FLAG(C3) }, // #25 [ref=2x]
+ { 0, FLAG(C1) | FLAG(CF) | FLAG(PF) | FLAG(ZF) }, // #26 [ref=4x]
+ { FLAG(C0) | FLAG(C1) | FLAG(C2) | FLAG(C3), 0 }, // #27 [ref=2x]
+ { FLAG(AF) | FLAG(CF) | FLAG(PF) | FLAG(SF) | FLAG(ZF), 0 }, // #28 [ref=1x]
+ { FLAG(DF), 0 }, // #29 [ref=3x]
+ { 0, FLAG(AF) | FLAG(CF) | FLAG(DF) | FLAG(IF) | FLAG(OF) | FLAG(PF) | FLAG(SF) | FLAG(ZF) }, // #30 [ref=3x]
+ { FLAG(AF) | FLAG(CF) | FLAG(DF) | FLAG(IF) | FLAG(OF) | FLAG(PF) | FLAG(SF) | FLAG(ZF), 0 }, // #31 [ref=3x]
+ { FLAG(CF) | FLAG(OF), FLAG(CF) | FLAG(OF) }, // #32 [ref=2x]
+ { 0, FLAG(CF) | FLAG(OF) }, // #33 [ref=2x]
+ { 0, FLAG(AF) | FLAG(CF) | FLAG(PF) | FLAG(SF) | FLAG(ZF) } // #34 [ref=1x]
};
#undef FLAG
#define FLAG(VAL) uint32_t(InstRWFlags::k##VAL)
const InstRWFlags InstDB::_instFlagsTable[] = {
- InstRWFlags(FLAG(None)), // #0 [ref=1634x]
+ InstRWFlags(FLAG(None)), // #0 [ref=1693x]
InstRWFlags(FLAG(MovOp)) // #1 [ref=29x]
};
#undef FLAG
@@ -2845,164 +2921,8 @@ const InstRWFlags InstDB::_instFlagsTable[] = {
#ifndef ASMJIT_NO_TEXT
// ${NameData:Begin}
// ------------------- Automatically generated, do not edit -------------------
-const char InstDB::_nameData[] =
- "\0" "aaa\0" "aad\0" "aam\0" "aas\0" "adc\0" "adcx\0" "adox\0" "arpl\0" "bextr\0" "blcfill\0" "blci\0" "blcic\0"
- "blcmsk\0" "blcs\0" "blsfill\0" "blsi\0" "blsic\0" "blsmsk\0" "blsr\0" "bndcl\0" "bndcn\0" "bndcu\0" "bndldx\0"
- "bndmk\0" "bndmov\0" "bndstx\0" "bound\0" "bsf\0" "bsr\0" "bswap\0" "bt\0" "btc\0" "btr\0" "bts\0" "bzhi\0" "cbw\0"
- "cdq\0" "cdqe\0" "clac\0" "clc\0" "cld\0" "cldemote\0" "clflush\0" "clflushopt\0" "clgi\0" "cli\0" "clrssbsy\0"
- "clts\0" "clui\0" "clwb\0" "clzero\0" "cmc\0" "cmova\0" "cmovae\0" "cmovc\0" "cmovg\0" "cmovge\0" "cmovl\0"
- "cmovle\0" "cmovna\0" "cmovnae\0" "cmovnc\0" "cmovng\0" "cmovnge\0" "cmovnl\0" "cmovnle\0" "cmovno\0" "cmovnp\0"
- "cmovns\0" "cmovnz\0" "cmovo\0" "cmovp\0" "cmovpe\0" "cmovpo\0" "cmovs\0" "cmovz\0" "cmp\0" "cmps\0" "cmpxchg\0"
- "cmpxchg16b\0" "cmpxchg8b\0" "cpuid\0" "cqo\0" "crc32\0" "cvtpd2pi\0" "cvtpi2pd\0" "cvtpi2ps\0" "cvtps2pi\0"
- "cvttpd2pi\0" "cvttps2pi\0" "cwd\0" "cwde\0" "daa\0" "das\0" "endbr32\0" "endbr64\0" "enqcmd\0" "enqcmds\0" "f2xm1\0"
- "fabs\0" "faddp\0" "fbld\0" "fbstp\0" "fchs\0" "fclex\0" "fcmovb\0" "fcmovbe\0" "fcmove\0" "fcmovnb\0" "fcmovnbe\0"
- "fcmovne\0" "fcmovnu\0" "fcmovu\0" "fcom\0" "fcomi\0" "fcomip\0" "fcomp\0" "fcompp\0" "fcos\0" "fdecstp\0" "fdiv\0"
- "fdivp\0" "fdivr\0" "fdivrp\0" "femms\0" "ffree\0" "fiadd\0" "ficom\0" "ficomp\0" "fidiv\0" "fidivr\0" "fild\0"
- "fimul\0" "fincstp\0" "finit\0" "fist\0" "fistp\0" "fisttp\0" "fisub\0" "fisubr\0" "fld\0" "fld1\0" "fldcw\0"
- "fldenv\0" "fldl2e\0" "fldl2t\0" "fldlg2\0" "fldln2\0" "fldpi\0" "fldz\0" "fmulp\0" "fnclex\0" "fninit\0" "fnop\0"
- "fnsave\0" "fnstcw\0" "fnstenv\0" "fnstsw\0" "fpatan\0" "fprem\0" "fprem1\0" "fptan\0" "frndint\0" "frstor\0"
- "fsave\0" "fscale\0" "fsin\0" "fsincos\0" "fsqrt\0" "fst\0" "fstcw\0" "fstenv\0" "fstp\0" "fstsw\0" "fsubp\0"
- "fsubrp\0" "ftst\0" "fucom\0" "fucomi\0" "fucomip\0" "fucomp\0" "fucompp\0" "fwait\0" "fxam\0" "fxch\0" "fxrstor\0"
- "fxrstor64\0" "fxsave\0" "fxsave64\0" "fxtract\0" "fyl2x\0" "fyl2xp1\0" "getsec\0" "hlt\0" "hreset\0" "inc\0"
- "incsspd\0" "incsspq\0" "insertq\0" "int3\0" "into\0" "invept\0" "invlpg\0" "invlpga\0" "invpcid\0" "invvpid\0"
- "iretd\0" "iretq\0" "ja\0" "jae\0" "jb\0" "jbe\0" "jc\0" "je\0" "jecxz\0" "jg\0" "jge\0" "jl\0" "jle\0" "jna\0"
- "jnae\0" "jnb\0" "jnbe\0" "jnc\0" "jne\0" "jng\0" "jnge\0" "jnl\0" "jnle\0" "jno\0" "jnp\0" "jns\0" "jnz\0" "jo\0"
- "jp\0" "jpe\0" "jpo\0" "js\0" "jz\0" "kaddb\0" "kaddd\0" "kaddq\0" "kaddw\0" "kandb\0" "kandd\0" "kandnb\0"
- "kandnd\0" "kandnq\0" "kandnw\0" "kandq\0" "kandw\0" "kmovb\0" "kmovw\0" "knotb\0" "knotd\0" "knotq\0" "knotw\0"
- "korb\0" "kord\0" "korq\0" "kortestb\0" "kortestd\0" "kortestq\0" "kortestw\0" "korw\0" "kshiftlb\0" "kshiftld\0"
- "kshiftlq\0" "kshiftlw\0" "kshiftrb\0" "kshiftrd\0" "kshiftrq\0" "kshiftrw\0" "ktestb\0" "ktestd\0" "ktestq\0"
- "ktestw\0" "kunpckbw\0" "kunpckdq\0" "kunpckwd\0" "kxnorb\0" "kxnord\0" "kxnorq\0" "kxnorw\0" "kxorb\0" "kxord\0"
- "kxorq\0" "kxorw\0" "lahf\0" "lar\0" "lcall\0" "lds\0" "ldtilecfg\0" "lea\0" "leave\0" "les\0" "lfence\0" "lfs\0"
- "lgdt\0" "lgs\0" "lidt\0" "ljmp\0" "lldt\0" "llwpcb\0" "lmsw\0" "lods\0" "loop\0" "loope\0" "loopne\0" "lsl\0"
- "ltr\0" "lwpins\0" "lwpval\0" "lzcnt\0" "mcommit\0" "mfence\0" "monitorx\0" "movabs\0" "movdir64b\0" "movdiri\0"
- "movdq2q\0" "movnti\0" "movntq\0" "movntsd\0" "movntss\0" "movq2dq\0" "movsx\0" "movsxd\0" "movzx\0" "mulx\0"
- "mwaitx\0" "neg\0" "not\0" "out\0" "outs\0" "pavgusb\0" "pconfig\0" "pdep\0" "pext\0" "pf2id\0" "pf2iw\0" "pfacc\0"
- "pfadd\0" "pfcmpeq\0" "pfcmpge\0" "pfcmpgt\0" "pfmax\0" "pfmin\0" "pfmul\0" "pfnacc\0" "pfpnacc\0" "pfrcp\0"
- "pfrcpit1\0" "pfrcpit2\0" "pfrcpv\0" "pfrsqit1\0" "pfrsqrt\0" "pfrsqrtv\0" "pfsub\0" "pfsubr\0" "pi2fd\0" "pi2fw\0"
- "pmulhrw\0" "pop\0" "popa\0" "popad\0" "popcnt\0" "popf\0" "popfd\0" "popfq\0" "prefetch\0" "prefetchnta\0"
- "prefetcht0\0" "prefetcht1\0" "prefetcht2\0" "prefetchw\0" "prefetchwt1\0" "pshufw\0" "psmash\0" "pswapd\0"
- "ptwrite\0" "push\0" "pusha\0" "pushad\0" "pushf\0" "pushfd\0" "pushfq\0" "pvalidate\0" "rcl\0" "rcr\0" "rdfsbase\0"
- "rdgsbase\0" "rdmsr\0" "rdpid\0" "rdpkru\0" "rdpmc\0" "rdpru\0" "rdrand\0" "rdseed\0" "rdsspd\0" "rdsspq\0" "rdtsc\0"
- "rdtscp\0" "retf\0" "rmpadjust\0" "rmpupdate\0" "rol\0" "ror\0" "rorx\0" "rsm\0" "rstorssp\0" "sahf\0" "sal\0"
- "sar\0" "sarx\0" "saveprevssp\0" "sbb\0" "scas\0" "senduipi\0" "serialize\0" "seta\0" "setae\0" "setb\0" "setbe\0"
- "setc\0" "sete\0" "setg\0" "setge\0" "setl\0" "setle\0" "setna\0" "setnae\0" "setnb\0" "setnbe\0" "setnc\0" "setne\0"
- "setng\0" "setnge\0" "setnl\0" "setnle\0" "setno\0" "setnp\0" "setns\0" "setnz\0" "seto\0" "setp\0" "setpe\0"
- "setpo\0" "sets\0" "setssbsy\0" "setz\0" "sfence\0" "sgdt\0" "sha1msg1\0" "sha1msg2\0" "sha1nexte\0" "sha1rnds4\0"
- "sha256msg1\0" "sha256msg2\0" "sha256rnds2\0" "shl\0" "shlx\0" "shr\0" "shrd\0" "shrx\0" "sidt\0" "skinit\0" "sldt\0"
- "slwpcb\0" "smsw\0" "stac\0" "stc\0" "stgi\0" "sti\0" "stos\0" "str\0" "sttilecfg\0" "swapgs\0" "syscall\0"
- "sysenter\0" "sysexit\0" "sysexitq\0" "sysret\0" "sysretq\0" "t1mskc\0" "tdpbf16ps\0" "tdpbssd\0" "tdpbsud\0"
- "tdpbusd\0" "tdpbuud\0" "testui\0" "tileloadd\0" "tileloaddt1\0" "tilerelease\0" "tilestored\0" "tilezero\0"
- "tpause\0" "tzcnt\0" "tzmsk\0" "ud0\0" "ud1\0" "ud2\0" "uiret\0" "umonitor\0" "umwait\0" "v4fmaddps\0" "v4fmaddss\0"
- "v4fnmaddps\0" "v4fnmaddss\0" "vaddpd\0" "vaddph\0" "vaddps\0" "vaddsd\0" "vaddsh\0" "vaddss\0" "vaddsubpd\0"
- "vaddsubps\0" "vaesdec\0" "vaesdeclast\0" "vaesenc\0" "vaesenclast\0" "vaesimc\0" "vaeskeygenassist\0" "valignd\0"
- "valignq\0" "vandnpd\0" "vandnps\0" "vandpd\0" "vandps\0" "vblendmpd\0" "vblendmps\0" "vblendpd\0" "vblendps\0"
- "vblendvpd\0" "vblendvps\0" "vbroadcastf128\0" "vbroadcastf32x2\0" "vbroadcastf32x4\0" "vbroadcastf32x8\0"
- "vbroadcastf64x2\0" "vbroadcastf64x4\0" "vbroadcasti128\0" "vbroadcasti32x2\0" "vbroadcasti32x4\0"
- "vbroadcasti32x8\0" "vbroadcasti64x2\0" "vbroadcasti64x4\0" "vbroadcastsd\0" "vbroadcastss\0" "vcmppd\0" "vcmpph\0"
- "vcmpps\0" "vcmpsd\0" "vcmpsh\0" "vcmpss\0" "vcomisd\0" "vcomish\0" "vcomiss\0" "vcompresspd\0" "vcompressps\0"
- "vcvtdq2pd\0" "vcvtdq2ph\0" "vcvtdq2ps\0" "vcvtne2ps2bf16\0" "vcvtneps2bf16\0" "vcvtpd2dq\0" "vcvtpd2ph\0"
- "vcvtpd2ps\0" "vcvtpd2qq\0" "vcvtpd2udq\0" "vcvtpd2uqq\0" "vcvtph2dq\0" "vcvtph2pd\0" "vcvtph2ps\0" "vcvtph2psx\0"
- "vcvtph2qq\0" "vcvtph2udq\0" "vcvtph2uqq\0" "vcvtph2uw\0" "vcvtph2w\0" "vcvtps2dq\0" "vcvtps2pd\0" "vcvtps2ph\0"
- "vcvtps2phx\0" "vcvtps2qq\0" "vcvtps2udq\0" "vcvtps2uqq\0" "vcvtqq2pd\0" "vcvtqq2ph\0" "vcvtqq2ps\0" "vcvtsd2sh\0"
- "vcvtsd2si\0" "vcvtsd2ss\0" "vcvtsd2usi\0" "vcvtsh2sd\0" "vcvtsh2si\0" "vcvtsh2ss\0" "vcvtsh2usi\0" "vcvtsi2sd\0"
- "vcvtsi2sh\0" "vcvtsi2ss\0" "vcvtss2sd\0" "vcvtss2sh\0" "vcvtss2si\0" "vcvtss2usi\0" "vcvttpd2dq\0" "vcvttpd2qq\0"
- "vcvttpd2udq\0" "vcvttpd2uqq\0" "vcvttph2dq\0" "vcvttph2qq\0" "vcvttph2udq\0" "vcvttph2uqq\0" "vcvttph2uw\0"
- "vcvttph2w\0" "vcvttps2dq\0" "vcvttps2qq\0" "vcvttps2udq\0" "vcvttps2uqq\0" "vcvttsd2si\0" "vcvttsd2usi\0"
- "vcvttsh2si\0" "vcvttsh2usi\0" "vcvttss2si\0" "vcvttss2usi\0" "vcvtudq2pd\0" "vcvtudq2ph\0" "vcvtudq2ps\0"
- "vcvtuqq2pd\0" "vcvtuqq2ph\0" "vcvtuqq2ps\0" "vcvtusi2sd\0" "vcvtusi2sh\0" "vcvtusi2ss\0" "vcvtuw2ph\0" "vcvtw2ph\0"
- "vdbpsadbw\0" "vdivpd\0" "vdivph\0" "vdivps\0" "vdivsd\0" "vdivsh\0" "vdivss\0" "vdpbf16ps\0" "vdppd\0" "vdpps\0"
- "verr\0" "verw\0" "vexp2pd\0" "vexp2ps\0" "vexpandpd\0" "vexpandps\0" "vextractf128\0" "vextractf32x4\0"
- "vextractf32x8\0" "vextractf64x2\0" "vextractf64x4\0" "vextracti128\0" "vextracti32x4\0" "vextracti32x8\0"
- "vextracti64x2\0" "vextracti64x4\0" "vextractps\0" "vfcmaddcph\0" "vfcmaddcsh\0" "vfcmulcph\0" "vfcmulcsh\0"
- "vfixupimmpd\0" "vfixupimmps\0" "vfixupimmsd\0" "vfixupimmss\0" "vfmadd132pd\0" "vfmadd132ph\0" "vfmadd132ps\0"
- "vfmadd132sd\0" "vfmadd132sh\0" "vfmadd132ss\0" "vfmadd213pd\0" "vfmadd213ph\0" "vfmadd213ps\0" "vfmadd213sd\0"
- "vfmadd213sh\0" "vfmadd213ss\0" "vfmadd231pd\0" "vfmadd231ph\0" "vfmadd231ps\0" "vfmadd231sd\0" "vfmadd231sh\0"
- "vfmadd231ss\0" "vfmaddcph\0" "vfmaddcsh\0" "vfmaddpd\0" "vfmaddps\0" "vfmaddsd\0" "vfmaddss\0" "vfmaddsub132pd\0"
- "vfmaddsub132ph\0" "vfmaddsub132ps\0" "vfmaddsub213pd\0" "vfmaddsub213ph\0" "vfmaddsub213ps\0" "vfmaddsub231pd\0"
- "vfmaddsub231ph\0" "vfmaddsub231ps\0" "vfmaddsubpd\0" "vfmaddsubps\0" "vfmsub132pd\0" "vfmsub132ph\0" "vfmsub132ps\0"
- "vfmsub132sd\0" "vfmsub132sh\0" "vfmsub132ss\0" "vfmsub213pd\0" "vfmsub213ph\0" "vfmsub213ps\0" "vfmsub213sd\0"
- "vfmsub213sh\0" "vfmsub213ss\0" "vfmsub231pd\0" "vfmsub231ph\0" "vfmsub231ps\0" "vfmsub231sd\0" "vfmsub231sh\0"
- "vfmsub231ss\0" "vfmsubadd132pd\0" "vfmsubadd132ph\0" "vfmsubadd132ps\0" "vfmsubadd213pd\0" "vfmsubadd213ph\0"
- "vfmsubadd213ps\0" "vfmsubadd231pd\0" "vfmsubadd231ph\0" "vfmsubadd231ps\0" "vfmsubaddpd\0" "vfmsubaddps\0"
- "vfmsubpd\0" "vfmsubps\0" "vfmsubsd\0" "vfmsubss\0" "vfmulcph\0" "vfmulcsh\0" "vfnmadd132pd\0" "vfnmadd132ph\0"
- "vfnmadd132ps\0" "vfnmadd132sd\0" "vfnmadd132sh\0" "vfnmadd132ss\0" "vfnmadd213pd\0" "vfnmadd213ph\0"
- "vfnmadd213ps\0" "vfnmadd213sd\0" "vfnmadd213sh\0" "vfnmadd213ss\0" "vfnmadd231pd\0" "vfnmadd231ph\0"
- "vfnmadd231ps\0" "vfnmadd231sd\0" "vfnmadd231sh\0" "vfnmadd231ss\0" "vfnmaddpd\0" "vfnmaddps\0" "vfnmaddsd\0"
- "vfnmaddss\0" "vfnmsub132pd\0" "vfnmsub132ph\0" "vfnmsub132ps\0" "vfnmsub132sd\0" "vfnmsub132sh\0" "vfnmsub132ss\0"
- "vfnmsub213pd\0" "vfnmsub213ph\0" "vfnmsub213ps\0" "vfnmsub213sd\0" "vfnmsub213sh\0" "vfnmsub213ss\0"
- "vfnmsub231pd\0" "vfnmsub231ph\0" "vfnmsub231ps\0" "vfnmsub231sd\0" "vfnmsub231sh\0" "vfnmsub231ss\0" "vfnmsubpd\0"
- "vfnmsubps\0" "vfnmsubsd\0" "vfnmsubss\0" "vfpclasspd\0" "vfpclassph\0" "vfpclassps\0" "vfpclasssd\0" "vfpclasssh\0"
- "vfpclassss\0" "vfrczpd\0" "vfrczps\0" "vfrczsd\0" "vfrczss\0" "vgatherdpd\0" "vgatherdps\0" "vgatherpf0dpd\0"
- "vgatherpf0dps\0" "vgatherpf0qpd\0" "vgatherpf0qps\0" "vgatherpf1dpd\0" "vgatherpf1dps\0" "vgatherpf1qpd\0"
- "vgatherpf1qps\0" "vgatherqpd\0" "vgatherqps\0" "vgetexppd\0" "vgetexpph\0" "vgetexpps\0" "vgetexpsd\0" "vgetexpsh\0"
- "vgetexpss\0" "vgetmantpd\0" "vgetmantph\0" "vgetmantps\0" "vgetmantsd\0" "vgetmantsh\0" "vgetmantss\0"
- "vgf2p8affineinvqb\0" "vgf2p8affineqb\0" "vgf2p8mulb\0" "vhaddpd\0" "vhaddps\0" "vhsubpd\0" "vhsubps\0"
- "vinsertf128\0" "vinsertf32x4\0" "vinsertf32x8\0" "vinsertf64x2\0" "vinsertf64x4\0" "vinserti128\0" "vinserti32x4\0"
- "vinserti32x8\0" "vinserti64x2\0" "vinserti64x4\0" "vinsertps\0" "vlddqu\0" "vldmxcsr\0" "vmaskmovdqu\0"
- "vmaskmovpd\0" "vmaskmovps\0" "vmaxpd\0" "vmaxph\0" "vmaxps\0" "vmaxsd\0" "vmaxsh\0" "vmaxss\0" "vmcall\0"
- "vmclear\0" "vmfunc\0" "vminpd\0" "vminph\0" "vminps\0" "vminsd\0" "vminsh\0" "vminss\0" "vmlaunch\0" "vmload\0"
- "vmmcall\0" "vmovapd\0" "vmovaps\0" "vmovd\0" "vmovddup\0" "vmovdqa\0" "vmovdqa32\0" "vmovdqa64\0" "vmovdqu\0"
- "vmovdqu16\0" "vmovdqu32\0" "vmovdqu64\0" "vmovdqu8\0" "vmovhlps\0" "vmovhpd\0" "vmovhps\0" "vmovlhps\0" "vmovlpd\0"
- "vmovlps\0" "vmovmskpd\0" "vmovmskps\0" "vmovntdq\0" "vmovntdqa\0" "vmovntpd\0" "vmovntps\0" "vmovq\0" "vmovsd\0"
- "vmovsh\0" "vmovshdup\0" "vmovsldup\0" "vmovss\0" "vmovupd\0" "vmovups\0" "vmovw\0" "vmpsadbw\0" "vmptrld\0"
- "vmptrst\0" "vmread\0" "vmresume\0" "vmrun\0" "vmsave\0" "vmulpd\0" "vmulph\0" "vmulps\0" "vmulsd\0" "vmulsh\0"
- "vmulss\0" "vmwrite\0" "vmxon\0" "vorpd\0" "vorps\0" "vp2intersectd\0" "vp2intersectq\0" "vp4dpwssd\0" "vp4dpwssds\0"
- "vpabsb\0" "vpabsd\0" "vpabsq\0" "vpabsw\0" "vpackssdw\0" "vpacksswb\0" "vpackusdw\0" "vpackuswb\0" "vpaddb\0"
- "vpaddd\0" "vpaddq\0" "vpaddsb\0" "vpaddsw\0" "vpaddusb\0" "vpaddusw\0" "vpaddw\0" "vpalignr\0" "vpand\0" "vpandd\0"
- "vpandn\0" "vpandnd\0" "vpandnq\0" "vpandq\0" "vpavgb\0" "vpavgw\0" "vpblendd\0" "vpblendmb\0" "vpblendmd\0"
- "vpblendmq\0" "vpblendmw\0" "vpblendvb\0" "vpblendw\0" "vpbroadcastb\0" "vpbroadcastd\0" "vpbroadcastmb2q\0"
- "vpbroadcastmw2d\0" "vpbroadcastq\0" "vpbroadcastw\0" "vpclmulqdq\0" "vpcmov\0" "vpcmpb\0" "vpcmpd\0" "vpcmpeqb\0"
- "vpcmpeqd\0" "vpcmpeqq\0" "vpcmpeqw\0" "vpcmpestri\0" "vpcmpestrm\0" "vpcmpgtb\0" "vpcmpgtd\0" "vpcmpgtq\0"
- "vpcmpgtw\0" "vpcmpistri\0" "vpcmpistrm\0" "vpcmpq\0" "vpcmpub\0" "vpcmpud\0" "vpcmpuq\0" "vpcmpuw\0" "vpcmpw\0"
- "vpcomb\0" "vpcomd\0" "vpcompressb\0" "vpcompressd\0" "vpcompressq\0" "vpcompressw\0" "vpcomq\0" "vpcomub\0"
- "vpcomud\0" "vpcomuq\0" "vpcomuw\0" "vpcomw\0" "vpconflictd\0" "vpconflictq\0" "vpdpbusd\0" "vpdpbusds\0"
- "vpdpwssd\0" "vpdpwssds\0" "vperm2f128\0" "vperm2i128\0" "vpermb\0" "vpermd\0" "vpermi2b\0" "vpermi2d\0"
- "vpermi2pd\0" "vpermi2ps\0" "vpermi2q\0" "vpermi2w\0" "vpermil2pd\0" "vpermil2ps\0" "vpermilpd\0" "vpermilps\0"
- "vpermpd\0" "vpermps\0" "vpermq\0" "vpermt2b\0" "vpermt2d\0" "vpermt2pd\0" "vpermt2ps\0" "vpermt2q\0" "vpermt2w\0"
- "vpermw\0" "vpexpandb\0" "vpexpandd\0" "vpexpandq\0" "vpexpandw\0" "vpextrb\0" "vpextrd\0" "vpextrq\0" "vpextrw\0"
- "vpgatherdd\0" "vpgatherdq\0" "vpgatherqd\0" "vpgatherqq\0" "vphaddbd\0" "vphaddbq\0" "vphaddbw\0" "vphaddd\0"
- "vphadddq\0" "vphaddsw\0" "vphaddubd\0" "vphaddubq\0" "vphaddubw\0" "vphaddudq\0" "vphadduwd\0" "vphadduwq\0"
- "vphaddw\0" "vphaddwd\0" "vphaddwq\0" "vphminposuw\0" "vphsubbw\0" "vphsubd\0" "vphsubdq\0" "vphsubsw\0" "vphsubw\0"
- "vphsubwd\0" "vpinsrb\0" "vpinsrd\0" "vpinsrq\0" "vpinsrw\0" "vplzcntd\0" "vplzcntq\0" "vpmacsdd\0" "vpmacsdqh\0"
- "vpmacsdql\0" "vpmacssdd\0" "vpmacssdqh\0" "vpmacssdql\0" "vpmacsswd\0" "vpmacssww\0" "vpmacswd\0" "vpmacsww\0"
- "vpmadcsswd\0" "vpmadcswd\0" "vpmadd52huq\0" "vpmadd52luq\0" "vpmaddubsw\0" "vpmaddwd\0" "vpmaskmovd\0"
- "vpmaskmovq\0" "vpmaxsb\0" "vpmaxsd\0" "vpmaxsq\0" "vpmaxsw\0" "vpmaxub\0" "vpmaxud\0" "vpmaxuq\0" "vpmaxuw\0"
- "vpminsb\0" "vpminsd\0" "vpminsq\0" "vpminsw\0" "vpminub\0" "vpminud\0" "vpminuq\0" "vpminuw\0" "vpmovb2m\0"
- "vpmovd2m\0" "vpmovdb\0" "vpmovdw\0" "vpmovm2b\0" "vpmovm2d\0" "vpmovm2q\0" "vpmovm2w\0" "vpmovmskb\0" "vpmovq2m\0"
- "vpmovqb\0" "vpmovqd\0" "vpmovqw\0" "vpmovsdb\0" "vpmovsdw\0" "vpmovsqb\0" "vpmovsqd\0" "vpmovsqw\0" "vpmovswb\0"
- "vpmovsxbd\0" "vpmovsxbq\0" "vpmovsxbw\0" "vpmovsxdq\0" "vpmovsxwd\0" "vpmovsxwq\0" "vpmovusdb\0" "vpmovusdw\0"
- "vpmovusqb\0" "vpmovusqd\0" "vpmovusqw\0" "vpmovuswb\0" "vpmovw2m\0" "vpmovwb\0" "vpmovzxbd\0" "vpmovzxbq\0"
- "vpmovzxbw\0" "vpmovzxdq\0" "vpmovzxwd\0" "vpmovzxwq\0" "vpmuldq\0" "vpmulhrsw\0" "vpmulhuw\0" "vpmulhw\0"
- "vpmulld\0" "vpmullq\0" "vpmullw\0" "vpmultishiftqb\0" "vpmuludq\0" "vpopcntb\0" "vpopcntd\0" "vpopcntq\0"
- "vpopcntw\0" "vpor\0" "vpord\0" "vporq\0" "vpperm\0" "vprold\0" "vprolq\0" "vprolvd\0" "vprolvq\0" "vprord\0"
- "vprorq\0" "vprorvd\0" "vprorvq\0" "vprotb\0" "vprotd\0" "vprotq\0" "vprotw\0" "vpsadbw\0" "vpscatterdd\0"
- "vpscatterdq\0" "vpscatterqd\0" "vpscatterqq\0" "vpshab\0" "vpshad\0" "vpshaq\0" "vpshaw\0" "vpshlb\0" "vpshld\0"
- "vpshldd\0" "vpshldq\0" "vpshldvd\0" "vpshldvq\0" "vpshldvw\0" "vpshldw\0" "vpshlq\0" "vpshlw\0" "vpshrdd\0"
- "vpshrdq\0" "vpshrdvd\0" "vpshrdvq\0" "vpshrdvw\0" "vpshrdw\0" "vpshufb\0" "vpshufbitqmb\0" "vpshufd\0" "vpshufhw\0"
- "vpshuflw\0" "vpsignb\0" "vpsignd\0" "vpsignw\0" "vpslld\0" "vpslldq\0" "vpsllq\0" "vpsllvd\0" "vpsllvq\0"
- "vpsllvw\0" "vpsllw\0" "vpsrad\0" "vpsraq\0" "vpsravd\0" "vpsravq\0" "vpsravw\0" "vpsraw\0" "vpsrld\0" "vpsrldq\0"
- "vpsrlq\0" "vpsrlvd\0" "vpsrlvq\0" "vpsrlvw\0" "vpsrlw\0" "vpsubb\0" "vpsubd\0" "vpsubq\0" "vpsubsb\0" "vpsubsw\0"
- "vpsubusb\0" "vpsubusw\0" "vpsubw\0" "vpternlogd\0" "vpternlogq\0" "vptest\0" "vptestmb\0" "vptestmd\0" "vptestmq\0"
- "vptestmw\0" "vptestnmb\0" "vptestnmd\0" "vptestnmq\0" "vptestnmw\0" "vpunpckhbw\0" "vpunpckhdq\0" "vpunpckhqdq\0"
- "vpunpckhwd\0" "vpunpcklbw\0" "vpunpckldq\0" "vpunpcklqdq\0" "vpunpcklwd\0" "vpxor\0" "vpxord\0" "vpxorq\0"
- "vrangepd\0" "vrangeps\0" "vrangesd\0" "vrangess\0" "vrcp14pd\0" "vrcp14ps\0" "vrcp14sd\0" "vrcp14ss\0" "vrcp28pd\0"
- "vrcp28ps\0" "vrcp28sd\0" "vrcp28ss\0" "vrcpph\0" "vrcpps\0" "vrcpsh\0" "vrcpss\0" "vreducepd\0" "vreduceph\0"
- "vreduceps\0" "vreducesd\0" "vreducesh\0" "vreducess\0" "vrndscalepd\0" "vrndscaleph\0" "vrndscaleps\0"
- "vrndscalesd\0" "vrndscalesh\0" "vrndscaless\0" "vroundpd\0" "vroundps\0" "vroundsd\0" "vroundss\0" "vrsqrt14pd\0"
- "vrsqrt14ps\0" "vrsqrt14sd\0" "vrsqrt14ss\0" "vrsqrt28pd\0" "vrsqrt28ps\0" "vrsqrt28sd\0" "vrsqrt28ss\0" "vrsqrtph\0"
- "vrsqrtps\0" "vrsqrtsh\0" "vrsqrtss\0" "vscalefpd\0" "vscalefph\0" "vscalefps\0" "vscalefsd\0" "vscalefsh\0"
- "vscalefss\0" "vscatterdpd\0" "vscatterdps\0" "vscatterpf0dpd\0" "vscatterpf0dps\0" "vscatterpf0qpd\0"
- "vscatterpf0qps\0" "vscatterpf1dpd\0" "vscatterpf1dps\0" "vscatterpf1qpd\0" "vscatterpf1qps\0" "vscatterqpd\0"
- "vscatterqps\0" "vshuff32x4\0" "vshuff64x2\0" "vshufi32x4\0" "vshufi64x2\0" "vshufpd\0" "vshufps\0" "vsqrtpd\0"
- "vsqrtph\0" "vsqrtps\0" "vsqrtsd\0" "vsqrtsh\0" "vsqrtss\0" "vstmxcsr\0" "vsubpd\0" "vsubph\0" "vsubps\0" "vsubsd\0"
- "vsubsh\0" "vsubss\0" "vtestpd\0" "vtestps\0" "vucomisd\0" "vucomish\0" "vucomiss\0" "vunpckhpd\0" "vunpckhps\0"
- "vunpcklpd\0" "vunpcklps\0" "vxorpd\0" "vxorps\0" "vzeroall\0" "vzeroupper\0" "wbinvd\0" "wbnoinvd\0" "wrfsbase\0"
- "wrgsbase\0" "wrmsr\0" "wrssd\0" "wrssq\0" "wrussd\0" "wrussq\0" "xabort\0" "xadd\0" "xbegin\0" "xend\0" "xgetbv\0"
- "xlatb\0" "xresldtrk\0" "xrstors\0" "xrstors64\0" "xsavec\0" "xsavec64\0" "xsaveopt\0" "xsaveopt64\0" "xsaves\0"
- "xsaves64\0" "xsetbv\0" "xsusldtrk\0" "xtest";
-
-const InstDB::InstNameIndex InstDB::instNameIndex[26] = {
- { Inst::kIdAaa , Inst::kIdArpl + 1 },
+const InstNameIndex InstDB::instNameIndex = {{
+ { Inst::kIdAaa , Inst::kIdAxor + 1 },
{ Inst::kIdBextr , Inst::kIdBzhi + 1 },
{ Inst::kIdCall , Inst::kIdCwde + 1 },
{ Inst::kIdDaa , Inst::kIdDpps + 1 },
@@ -3028,6 +2948,1761 @@ const InstDB::InstNameIndex InstDB::instNameIndex[26] = {
{ Inst::kIdXabort , Inst::kIdXtest + 1 },
{ Inst::kIdNone , Inst::kIdNone + 1 },
{ Inst::kIdNone , Inst::kIdNone + 1 }
+}, uint16_t(17)};
+
+const char InstDB::_instNameStringTable[] =
+ "vgf2p8affineinvqbvaeskeygenassistvbroadcastf32x464x264x4i32x2i32x4i32x8i64x2i64x"
+ "4vpbroadcastmb2w2dvbcstnebf162p128i128vcvtne2ps2vcvtneebf16vcvtneobf16vfmaddsub1"
+ "32ph213pd213ph213ps231pd231ph231psvfmsubadd132vpmultishiftvscatterpf0dqpdqps1dpd"
+ "1dps1qpd1qpsvcvtneps2vextracvextractfvgatherpf0vp2intersecttcmmimfp16tcmmrlfp16s"
+ "h2pssdph2psvfnmadd132213sd213sh213ss231sd231sh231ssvfnmsub132vinservinsertfvpshu"
+ "fbitqvsha512rndprefetchitntawt1saveprevsssha256rndtileloaddtilereleavaesdeclvaes"
+ "enclvcompressvcvttpd2uqqvcvttph2uvcvttps2uvcvttsd2uvcvttsh2uvcvttss2uvfixupimmvf"
+ "madd132vfmsub132vmaskmovdqvpcompressvpconflictvphminposuvpmadd52hluqvpscatterqdv"
+ "punpckhqlqdqvrndscalemsg1msg2clflushopcmpnbexcmpnlexcmpxchg16t0t2tilestorev4fnma"
+ "ddssvcvtpd2uvcvtph2psudqvcvtps2phvcvtsd2uvcvtsh2uvcvtss2uvcvtudq2vcvtuqq2vcvtusi"
+ "2vfcmaddcvfpclassvgetmanmulbvp4dpwssvpclmuvpcmpestrvpcmpistrvperm2fvpermil2vpgat"
+ "hervpmacssdqvpmadcsswubswvpmaskmovpternlogbwwdlbwldqlwdvrsqrt1428pd28ps28sd28ssv"
+ "shufvshuffvzeroupxsaveoptcmpbexcmplexcmpnbxcmpnlxcmpnoxcmpnpxcmpnsxcmpnzx8bfxrst"
+ "orldtilecfmovdir64pvalidarmpadjurmpupdaserialisha1nexsha1rndssttilecftdpbf16tdpf"
+ "p16v4fmadvaddsubvblendmvpdvcvtdq2uwvcvtqq2vcvtsi2vcvtuwvdbpsadvdpbf16vexpanvfcmu"
+ "lccphcshvgetexpvmovdqau16u32u64vmovmskvmovntvmovshdvmovsldvpackssdwbvpackuswbvpb"
+ "lendmdvpdpbssudsvpdpbusvpdpwssvpdpwus2pdvpermtvpexpanvphaddubwqdqhvpmovmskvpmovs"
+ "xbvpmovusqwvpmovzxbvpmulhrvptestnmqvreducevscalefvsm3rndvsm4rndsvunpckhlpdlpsxre"
+ "sldtrs64xsusldtrcldemoclrssbscmpbxcmplxcmpoxcmppxcmpsxcmpzxcvtpifcmovfxsavekorte"
+ "stkshiftrbkunpckmonitorpfrcpipfrsqirtvrdfsbrdgsbsspseamcalsenduisetssbssysesysex"
+ "vcvtwvfmulvldmxcsvmlaundupu8vmovhvmovlhvmpsadvmresumvpadduvpaligngtbgtdgtqgtw2b2"
+ "qbdbqvphsubvplzcnb2md2mq2mw2mvpopcnvpshldvqvpshrdvwhwvpsubuvrangevrcp14vroundsdv"
+ "sm4keyvstmxcsvucomiallwbnoinwrfsbwrgsbc64blcfiblsficmovnendbrenqcmnufdecsfincsfn"
+ "stefrndfsincfucomfyl2xincsspqinvlinvlpinvpcinvvpmcommmovq2pavgupfcmpepfpnaptwris"
+ "eamoseamrsyscsysretdpbutlbsyvaesivaligvandnvcomivfrczvhadvhsubvmclevmgexvmmcvmov"
+ "avmovuvmptvmwrivpandvpextrwvpinsvpmaxvpminvprolvprorvpsadvpsigvpslvpsllvpsravpsr"
+ "lvsqrvtes";
+
+
+const uint32_t InstDB::_instNameIndexTable[] = {
+ 0x80000000, // Small ''.
+ 0x80000421, // Small 'aaa'.
+ 0x80001021, // Small 'aad'.
+ 0x80021021, // Small 'aadd'.
+ 0x80003421, // Small 'aam'.
+ 0x80023821, // Small 'aand'.
+ 0x80004C21, // Small 'aas'.
+ 0x80000C81, // Small 'adc'.
+ 0x800C0C81, // Small 'adcx'.
+ 0x80001081, // Small 'add'.
+ 0x80481081, // Small 'addpd'.
+ 0x81381081, // Small 'addps'.
+ 0x80499081, // Small 'addsd'.
+ 0x81399081, // Small 'addss'.
+ 0x20A76099, // Large 'addsub|pd'.
+ 0x207D6099, // Large 'addsub|ps'.
+ 0x800C3C81, // Small 'adox'.
+ 0x86524CA1, // Small 'aesdec'.
+ 0x302871D5, // Large 'aesdecl|ast'.
+ 0x86E2CCA1, // Small 'aesenc'.
+ 0x302871DD, // Large 'aesencl|ast'.
+ 0x86D4CCA1, // Small 'aesimc'.
+ 0x0000F012, // Large 'aeskeygenassist'.
+ 0x800011C1, // Small 'and'.
+ 0x800711C1, // Small 'andn'.
+ 0x890711C1, // Small 'andnpd'.
+ 0xA70711C1, // Small 'andnps'.
+ 0x804811C1, // Small 'andpd'.
+ 0x813811C1, // Small 'andps'.
+ 0x800049E1, // Small 'aor'.
+ 0x80064241, // Small 'arpl'.
+ 0x80093F01, // Small 'axor'.
+ 0x812A60A2, // Small 'bextr'.
+ 0x26F45709, // Large 'blcfi|ll'.
+ 0x80048D82, // Small 'blci'.
+ 0x80348D82, // Small 'blcic'.
+ 0x97368D82, // Small 'blcmsk'.
+ 0x80098D82, // Small 'blcs'.
+ 0x20A75471, // Large 'blend|pd'.
+ 0x207D5471, // Large 'blend|ps'.
+ 0x34775471, // Large 'blend|vpd'.
+ 0x318B5471, // Large 'blend|vps'.
+ 0x26F4570E, // Large 'blsfi|ll'.
+ 0x8004CD82, // Small 'blsi'.
+ 0x8034CD82, // Small 'blsic'.
+ 0x9736CD82, // Small 'blsmsk'.
+ 0x80094D82, // Small 'blsr'.
+ 0x80C191C2, // Small 'bndcl'.
+ 0x80E191C2, // Small 'bndcn'.
+ 0x815191C2, // Small 'bndcu'.
+ 0xB04611C2, // Small 'bndldx'.
+ 0x80B691C2, // Small 'bndmk'.
+ 0xACF691C2, // Small 'bndmov'.
+ 0xB14991C2, // Small 'bndstx'.
+ 0x804755E2, // Small 'bound'.
+ 0x80001A62, // Small 'bsf'.
+ 0x80004A62, // Small 'bsr'.
+ 0x8100DE62, // Small 'bswap'.
+ 0x80000282, // Small 'bt'.
+ 0x80000E82, // Small 'btc'.
+ 0x80004A82, // Small 'btr'.
+ 0x80004E82, // Small 'bts'.
+ 0x8004A342, // Small 'bzhi'.
+ 0x80063023, // Small 'call'.
+ 0x80005C43, // Small 'cbw'.
+ 0x80004483, // Small 'cdq'.
+ 0x8002C483, // Small 'cdqe'.
+ 0x80018583, // Small 'clac'.
+ 0x80000D83, // Small 'clc'.
+ 0x80001183, // Small 'cld'.
+ 0x20DF65B0, // Large 'cldemo|te'.
+ 0x0000729D, // Large 'clflush'.
+ 0x1020929D, // Large 'clflushop|t'.
+ 0x80049D83, // Small 'clgi'.
+ 0x80002583, // Small 'cli'.
+ 0x101775B6, // Large 'clrssbs|y'.
+ 0x8009D183, // Small 'clts'.
+ 0x8004D583, // Small 'clui'.
+ 0x80015D83, // Small 'clwb'.
+ 0x9F22E983, // Small 'clzero'.
+ 0x80000DA3, // Small 'cmc'.
+ 0x801B3DA3, // Small 'cmova'.
+ 0x8A1B3DA3, // Small 'cmovae'.
+ 0x802B3DA3, // Small 'cmovb'.
+ 0x8A2B3DA3, // Small 'cmovbe'.
+ 0x803B3DA3, // Small 'cmovc'.
+ 0x805B3DA3, // Small 'cmove'.
+ 0x807B3DA3, // Small 'cmovg'.
+ 0x8A7B3DA3, // Small 'cmovge'.
+ 0x80CB3DA3, // Small 'cmovl'.
+ 0x8ACB3DA3, // Small 'cmovle'.
+ 0x82EB3DA3, // Small 'cmovna'.
+ 0x20125713, // Large 'cmovn|ae'.
+ 0x84EB3DA3, // Small 'cmovnb'.
+ 0x22AA5713, // Large 'cmovn|be'.
+ 0x86EB3DA3, // Small 'cmovnc'.
+ 0x8AEB3DA3, // Small 'cmovne'.
+ 0x8EEB3DA3, // Small 'cmovng'.
+ 0x20185713, // Large 'cmovn|ge'.
+ 0x98EB3DA3, // Small 'cmovnl'.
+ 0x21C45713, // Large 'cmovn|le'.
+ 0x9EEB3DA3, // Small 'cmovno'.
+ 0xA0EB3DA3, // Small 'cmovnp'.
+ 0xA6EB3DA3, // Small 'cmovns'.
+ 0xB4EB3DA3, // Small 'cmovnz'.
+ 0x80FB3DA3, // Small 'cmovo'.
+ 0x810B3DA3, // Small 'cmovp'.
+ 0x8B0B3DA3, // Small 'cmovpe'.
+ 0x9F0B3DA3, // Small 'cmovpo'.
+ 0x813B3DA3, // Small 'cmovs'.
+ 0x81AB3DA3, // Small 'cmovz'.
+ 0x800041A3, // Small 'cmp'.
+ 0x309963D9, // Large 'cmpbex|add'.
+ 0x309955BD, // Large 'cmpbx|add'.
+ 0x309963DF, // Large 'cmplex|add'.
+ 0x309955C2, // Large 'cmplx|add'.
+ 0x309972A6, // Large 'cmpnbex|add'.
+ 0x309963E5, // Large 'cmpnbx|add'.
+ 0x309972AD, // Large 'cmpnlex|add'.
+ 0x309963EB, // Large 'cmpnlx|add'.
+ 0x309963F1, // Large 'cmpnox|add'.
+ 0x309963F7, // Large 'cmpnpx|add'.
+ 0x309963FD, // Large 'cmpnsx|add'.
+ 0x30996403, // Large 'cmpnzx|add'.
+ 0x309955C7, // Large 'cmpox|add'.
+ 0x804841A3, // Small 'cmppd'.
+ 0x813841A3, // Small 'cmpps'.
+ 0x309955CC, // Large 'cmppx|add'.
+ 0x8009C1A3, // Small 'cmps'.
+ 0x8049C1A3, // Small 'cmpsd'.
+ 0x8139C1A3, // Small 'cmpss'.
+ 0x309955D1, // Large 'cmpsx|add'.
+ 0x000072B4, // Large 'cmpxchg'.
+ 0x101092B4, // Large 'cmpxchg16|b'.
+ 0x240972B4, // Large 'cmpxchg|8b'.
+ 0x309955D6, // Large 'cmpzx|add'.
+ 0x8934B5E3, // Small 'comisd'.
+ 0xA734B5E3, // Small 'comiss'.
+ 0x8044D603, // Small 'cpuid'.
+ 0x80003E23, // Small 'cqo'.
+ 0x81DF0E43, // Small 'crc32'.
+ 0x20A7647B, // Large 'cvtdq2|pd'.
+ 0x207D647B, // Large 'cvtdq2|ps'.
+ 0x20E562D5, // Large 'cvtpd2|dq'.
+ 0x222A62D5, // Large 'cvtpd2|pi'.
+ 0x207D62D5, // Large 'cvtpd2|ps'.
+ 0x352555DB, // Large 'cvtpi|2pd'.
+ 0x307C55DB, // Large 'cvtpi|2ps'.
+ 0x20E562E9, // Large 'cvtps2|dq'.
+ 0x102672E9, // Large 'cvtps2p|d'.
+ 0x100972E9, // Large 'cvtps2p|i'.
+ 0x201D62F2, // Large 'cvtsd2|si'.
+ 0x201C62F2, // Large 'cvtsd2|ss'.
+ 0x2144648B, // Large 'cvtsi2|sd'.
+ 0x201C648B, // Large 'cvtsi2|ss'.
+ 0x21446302, // Large 'cvtss2|sd'.
+ 0x201D6302, // Large 'cvtss2|si'.
+ 0x20E571EE, // Large 'cvttpd2|dq'.
+ 0x222A71EE, // Large 'cvttpd2|pi'.
+ 0x20E57202, // Large 'cvttps2|dq'.
+ 0x222A7202, // Large 'cvttps2|pi'.
+ 0x201D720B, // Large 'cvttsd2|si'.
+ 0x201D721D, // Large 'cvttss2|si'.
+ 0x800012E3, // Small 'cwd'.
+ 0x800292E3, // Small 'cwde'.
+ 0x80000424, // Small 'daa'.
+ 0x80004C24, // Small 'das'.
+ 0x80000CA4, // Small 'dec'.
+ 0x80005924, // Small 'div'.
+ 0x80485924, // Small 'divpd'.
+ 0x81385924, // Small 'divps'.
+ 0x8049D924, // Small 'divsd'.
+ 0x8139D924, // Small 'divss'.
+ 0x80024204, // Small 'dppd'.
+ 0x8009C204, // Small 'dpps'.
+ 0x8009B5A5, // Small 'emms'.
+ 0x202C5718, // Large 'endbr|32'.
+ 0x20305718, // Large 'endbr|64'.
+ 0x88D1C5C5, // Small 'enqcmd'.
+ 0x209B571D, // Large 'enqcm|ds'.
+ 0x8122D1C5, // Small 'enter'.
+ 0x207D710D, // Large 'extract|ps'.
+ 0x81195305, // Small 'extrq'.
+ 0x81C6E3A6, // Small 'f2xm1'.
+ 0x80098826, // Small 'fabs'.
+ 0x80021026, // Small 'fadd'.
+ 0x81021026, // Small 'faddp'.
+ 0x80023046, // Small 'fbld'.
+ 0x810A4C46, // Small 'fbstp'.
+ 0x8009A066, // Small 'fchs'.
+ 0x8182B066, // Small 'fclex'.
+ 0x8567B466, // Small 'fcmovb'.
+ 0x22AA55E0, // Large 'fcmov|be'.
+ 0x8B67B466, // Small 'fcmove'.
+ 0x22A955E0, // Large 'fcmov|nb'.
+ 0x32A955E0, // Large 'fcmov|nbe'.
+ 0x200A55E0, // Large 'fcmov|ne'.
+ 0x272255E0, // Large 'fcmov|nu'.
+ 0xAB67B466, // Small 'fcmovu'.
+ 0x8006BC66, // Small 'fcom'.
+ 0x8096BC66, // Small 'fcomi'.
+ 0xA096BC66, // Small 'fcomip'.
+ 0x8106BC66, // Small 'fcomp'.
+ 0xA106BC66, // Small 'fcompp'.
+ 0x8009BC66, // Small 'fcos'.
+ 0x21F15724, // Large 'fdecs|tp'.
+ 0x800B2486, // Small 'fdiv'.
+ 0x810B2486, // Small 'fdivp'.
+ 0x812B2486, // Small 'fdivr'.
+ 0xA12B2486, // Small 'fdivrp'.
+ 0x8136B4A6, // Small 'femms'.
+ 0x8052C8C6, // Small 'ffree'.
+ 0x80420526, // Small 'fiadd'.
+ 0x80D78D26, // Small 'ficom'.
+ 0xA0D78D26, // Small 'ficomp'.
+ 0x81649126, // Small 'fidiv'.
+ 0xA5649126, // Small 'fidivr'.
+ 0x80023126, // Small 'fild'.
+ 0x80CAB526, // Small 'fimul'.
+ 0x21F15729, // Large 'fincs|tp'.
+ 0x8144B926, // Small 'finit'.
+ 0x800A4D26, // Small 'fist'.
+ 0x810A4D26, // Small 'fistp'.
+ 0xA14A4D26, // Small 'fisttp'.
+ 0x802ACD26, // Small 'fisub'.
+ 0xA42ACD26, // Small 'fisubr'.
+ 0x80001186, // Small 'fld'.
+ 0x800E1186, // Small 'fld1'.
+ 0x81719186, // Small 'fldcw'.
+ 0xACE29186, // Small 'fldenv'.
+ 0x8BD61186, // Small 'fldl2e'.
+ 0xA9D61186, // Small 'fldl2t'.
+ 0xBA761186, // Small 'fldlg2'.
+ 0xBAE61186, // Small 'fldln2'.
+ 0x80981186, // Small 'fldpi'.
+ 0x800D1186, // Small 'fldz'.
+ 0x800655A6, // Small 'fmul'.
+ 0x810655A6, // Small 'fmulp'.
+ 0xB0560DC6, // Small 'fnclex'.
+ 0xA89725C6, // Small 'fninit'.
+ 0x80083DC6, // Small 'fnop'.
+ 0x8B60CDC6, // Small 'fnsave'.
+ 0xAE3A4DC6, // Small 'fnstcw'.
+ 0x200D572E, // Large 'fnste|nv'.
+ 0xAF3A4DC6, // Small 'fnstsw'.
+ 0x9C1A0606, // Small 'fpatan'.
+ 0x80D2CA06, // Small 'fprem'.
+ 0xB8D2CA06, // Small 'fprem1'.
+ 0x80E0D206, // Small 'fptan'.
+ 0x31224733, // Large 'frnd|int'.
+ 0xA4FA4E46, // Small 'frstor'.
+ 0x805B0666, // Small 'fsave'.
+ 0x8AC08E66, // Small 'fscale'.
+ 0x80072666, // Small 'fsin'.
+ 0x22655737, // Large 'fsinc|os'.
+ 0x81494666, // Small 'fsqrt'.
+ 0x80005266, // Small 'fst'.
+ 0x8171D266, // Small 'fstcw'.
+ 0xACE2D266, // Small 'fstenv'.
+ 0x80085266, // Small 'fstp'.
+ 0x8179D266, // Small 'fstsw'.
+ 0x80015666, // Small 'fsub'.
+ 0x81015666, // Small 'fsubp'.
+ 0x81215666, // Small 'fsubr'.
+ 0xA1215666, // Small 'fsubrp'.
+ 0x800A4E86, // Small 'ftst'.
+ 0x80D78EA6, // Small 'fucom'.
+ 0x92D78EA6, // Small 'fucomi'.
+ 0x260C573C, // Large 'fucom|ip'.
+ 0xA0D78EA6, // Small 'fucomp'.
+ 0x25CE573C, // Large 'fucom|pp'.
+ 0x814486E6, // Small 'fwait'.
+ 0x80068706, // Small 'fxam'.
+ 0x80040F06, // Small 'fxch'.
+ 0x0000740B, // Large 'fxrstor'.
+ 0x2030740B, // Large 'fxrstor|64'.
+ 0x8B60CF06, // Small 'fxsave'.
+ 0x203065E5, // Large 'fxsave|64'.
+ 0x510F240B, // Large 'fx|tract'.
+ 0x818EB326, // Small 'fyl2x'.
+ 0x206E5741, // Large 'fyl2x|p1'.
+ 0x8659D0A7, // Small 'getsec'.
+ 0x1010F001, // Large 'gf2p8affineinvq|b'.
+ 0x200FB001, // Large 'gf2p8affine|qb'.
+ 0x43385001, // Large 'gf2p8|mulb'.
+ 0x89021028, // Small 'haddpd'.
+ 0xA7021028, // Small 'haddps'.
+ 0x80005188, // Small 'hlt'.
+ 0xA8599648, // Small 'hreset'.
+ 0x89015668, // Small 'hsubpd'.
+ 0xA7015668, // Small 'hsubps'.
+ 0x800B2489, // Small 'idiv'.
+ 0x800655A9, // Small 'imul'.
+ 0x800001C9, // Small 'in'.
+ 0x80000DC9, // Small 'inc'.
+ 0x20A75746, // Large 'incss|pd'.
+ 0x274B5746, // Large 'incss|pq'.
+ 0x80004DC9, // Small 'ins'.
+ 0x207D6184, // Large 'insert|ps'.
+ 0x100F6184, // Large 'insert|q'.
+ 0x800051C9, // Small 'int'.
+ 0x800F51C9, // Small 'int3'.
+ 0x8007D1C9, // Small 'into'.
+ 0x800259C9, // Small 'invd'.
+ 0xA902D9C9, // Small 'invept'.
+ 0x8F0659C9, // Small 'invlpg'.
+ 0x336C474D, // Large 'invl|pga'.
+ 0x23995751, // Large 'invlp|gb'.
+ 0x24265756, // Large 'invpc|id'.
+ 0x2426575B, // Large 'invvp|id'.
+ 0x800A1649, // Small 'iret'.
+ 0x804A1649, // Small 'iretd'.
+ 0x811A1649, // Small 'iretq'.
+ 0x8000002A, // Small 'ja'.
+ 0x8000142A, // Small 'jae'.
+ 0x8000004A, // Small 'jb'.
+ 0x8000144A, // Small 'jbe'.
+ 0x8000006A, // Small 'jc'.
+ 0x800000AA, // Small 'je'.
+ 0x81AC0CAA, // Small 'jecxz'.
+ 0x800000EA, // Small 'jg'.
+ 0x800014EA, // Small 'jge'.
+ 0x8000018A, // Small 'jl'.
+ 0x8000158A, // Small 'jle'.
+ 0x800041AA, // Small 'jmp'.
+ 0x800005CA, // Small 'jna'.
+ 0x800285CA, // Small 'jnae'.
+ 0x800009CA, // Small 'jnb'.
+ 0x800289CA, // Small 'jnbe'.
+ 0x80000DCA, // Small 'jnc'.
+ 0x800015CA, // Small 'jne'.
+ 0x80001DCA, // Small 'jng'.
+ 0x80029DCA, // Small 'jnge'.
+ 0x800031CA, // Small 'jnl'.
+ 0x8002B1CA, // Small 'jnle'.
+ 0x80003DCA, // Small 'jno'.
+ 0x800041CA, // Small 'jnp'.
+ 0x80004DCA, // Small 'jns'.
+ 0x800069CA, // Small 'jnz'.
+ 0x800001EA, // Small 'jo'.
+ 0x8000020A, // Small 'jp'.
+ 0x8000160A, // Small 'jpe'.
+ 0x80003E0A, // Small 'jpo'.
+ 0x8000026A, // Small 'js'.
+ 0x8000034A, // Small 'jz'.
+ 0x8022102B, // Small 'kaddb'.
+ 0x8042102B, // Small 'kaddd'.
+ 0x8112102B, // Small 'kaddq'.
+ 0x8172102B, // Small 'kaddw'.
+ 0x8022382B, // Small 'kandb'.
+ 0x8042382B, // Small 'kandd'.
+ 0x84E2382B, // Small 'kandnb'.
+ 0x88E2382B, // Small 'kandnd'.
+ 0xA2E2382B, // Small 'kandnq'.
+ 0xAEE2382B, // Small 'kandnw'.
+ 0x8112382B, // Small 'kandq'.
+ 0x8172382B, // Small 'kandw'.
+ 0x802B3DAB, // Small 'kmovb'.
+ 0x804B3DAB, // Small 'kmovd'.
+ 0x811B3DAB, // Small 'kmovq'.
+ 0x817B3DAB, // Small 'kmovw'.
+ 0x802A3DCB, // Small 'knotb'.
+ 0x804A3DCB, // Small 'knotd'.
+ 0x811A3DCB, // Small 'knotq'.
+ 0x817A3DCB, // Small 'knotw'.
+ 0x800149EB, // Small 'korb'.
+ 0x800249EB, // Small 'kord'.
+ 0x8008C9EB, // Small 'korq'.
+ 0x101075EB, // Large 'kortest|b'.
+ 0x102675EB, // Large 'kortest|d'.
+ 0x100F75EB, // Large 'kortest|q'.
+ 0x105F75EB, // Large 'kortest|w'.
+ 0x800BC9EB, // Small 'korw'.
+ 0x233A65F2, // Large 'kshift|lb'.
+ 0x23A165F2, // Large 'kshift|ld'.
+ 0x228865F2, // Large 'kshift|lq'.
+ 0x23A465F2, // Large 'kshift|lw'.
+ 0x25F865F2, // Large 'kshift|rb'.
+ 0x102675F2, // Large 'kshiftr|d'.
+ 0x100F75F2, // Large 'kshiftr|q'.
+ 0x105F75F2, // Large 'kshiftr|w'.
+ 0x8549968B, // Small 'ktestb'.
+ 0x8949968B, // Small 'ktestd'.
+ 0xA349968B, // Small 'ktestq'.
+ 0xAF49968B, // Small 'ktestw'.
+ 0x239A65FA, // Large 'kunpck|bw'.
+ 0x20E565FA, // Large 'kunpck|dq'.
+ 0x239C65FA, // Large 'kunpck|wd'.
+ 0x8527BB0B, // Small 'kxnorb'.
+ 0x8927BB0B, // Small 'kxnord'.
+ 0xA327BB0B, // Small 'kxnorq'.
+ 0xAF27BB0B, // Small 'kxnorw'.
+ 0x80293F0B, // Small 'kxorb'.
+ 0x80493F0B, // Small 'kxord'.
+ 0x81193F0B, // Small 'kxorq'.
+ 0x81793F0B, // Small 'kxorw'.
+ 0x8003202C, // Small 'lahf'.
+ 0x8000482C, // Small 'lar'.
+ 0x80C6046C, // Small 'lcall'.
+ 0x8158908C, // Small 'lddqu'.
+ 0x1023664B, // Large 'ldmxcs|r'.
+ 0x80004C8C, // Small 'lds'.
+ 0x10018412, // Large 'ldtilecf|g'.
+ 0x800004AC, // Small 'lea'.
+ 0x805B04AC, // Small 'leave'.
+ 0x80004CAC, // Small 'les'.
+ 0x8A3714CC, // Small 'lfence'.
+ 0x80004CCC, // Small 'lfs'.
+ 0x800A10EC, // Small 'lgdt'.
+ 0x80004CEC, // Small 'lgs'.
+ 0x800A112C, // Small 'lidt'.
+ 0x8008354C, // Small 'ljmp'.
+ 0x800A118C, // Small 'lldt'.
+ 0x84385D8C, // Small 'llwpcb'.
+ 0x800BCDAC, // Small 'lmsw'.
+ 0x800991EC, // Small 'lods'.
+ 0x80083DEC, // Small 'loop'.
+ 0x80583DEC, // Small 'loope'.
+ 0x8AE83DEC, // Small 'loopne'.
+ 0x8000326C, // Small 'lsl'.
+ 0x80004E6C, // Small 'lss'.
+ 0x80004A8C, // Small 'ltr'.
+ 0xA6E4C2EC, // Small 'lwpins'.
+ 0x981B42EC, // Small 'lwpval'.
+ 0x81470F4C, // Small 'lzcnt'.
+ 0x109D9241, // Large 'maskmovdq|u'.
+ 0x100F7241, // Large 'maskmov|q'.
+ 0x8048602D, // Small 'maxpd'.
+ 0x8138602D, // Small 'maxps'.
+ 0x8049E02D, // Small 'maxsd'.
+ 0x8139E02D, // Small 'maxss'.
+ 0x21925760, // Large 'mcomm|it'.
+ 0x8A3714CD, // Small 'mfence'.
+ 0x8048392D, // Small 'minpd'.
+ 0x8138392D, // Small 'minps'.
+ 0x8049B92D, // Small 'minsd'.
+ 0x8139B92D, // Small 'minss'.
+ 0x00007600, // Large 'monitor'.
+ 0x102E7600, // Large 'monitor|x'.
+ 0x800059ED, // Small 'mov'.
+ 0xA620D9ED, // Small 'movabs'.
+ 0x8900D9ED, // Small 'movapd'.
+ 0xA700D9ED, // Small 'movaps'.
+ 0x805159ED, // Small 'movbe'.
+ 0x800259ED, // Small 'movd'.
+ 0x36574245, // Large 'movd|dup'.
+ 0x1010841A, // Large 'movdir64|b'.
+ 0x1009641A, // Large 'movdir|i'.
+ 0x268F5245, // Large 'movdq|2q'.
+ 0x831259ED, // Small 'movdqa'.
+ 0xAB1259ED, // Small 'movdqu'.
+ 0x359A465D, // Large 'movh|lps'.
+ 0x890459ED, // Small 'movhpd'.
+ 0xA70459ED, // Small 'movhps'.
+ 0x207D5662, // Large 'movlh|ps'.
+ 0x890659ED, // Small 'movlpd'.
+ 0xA70659ED, // Small 'movlps'.
+ 0x20A764D0, // Large 'movmsk|pd'.
+ 0x207D64D0, // Large 'movmsk|ps'.
+ 0x20E554D7, // Large 'movnt|dq'.
+ 0x34C354D7, // Large 'movnt|dqa'.
+ 0x934759ED, // Small 'movnti'.
+ 0x20A754D7, // Large 'movnt|pd'.
+ 0x207D54D7, // Large 'movnt|ps'.
+ 0xA34759ED, // Small 'movntq'.
+ 0x214454D7, // Large 'movnt|sd'.
+ 0x201C54D7, // Large 'movnt|ss'.
+ 0x8008D9ED, // Small 'movq'.
+ 0x20E55765, // Large 'movq2|dq'.
+ 0x8009D9ED, // Small 'movs'.
+ 0x8049D9ED, // Small 'movsd'.
+ 0x222964DD, // Large 'movshd|up'.
+ 0x222964E4, // Large 'movsld|up'.
+ 0x8139D9ED, // Small 'movss'.
+ 0x8189D9ED, // Small 'movsx'.
+ 0x8989D9ED, // Small 'movsxd'.
+ 0x890AD9ED, // Small 'movupd'.
+ 0xA70AD9ED, // Small 'movups'.
+ 0x818D59ED, // Small 'movzx'.
+ 0x239A5668, // Large 'mpsad|bw'.
+ 0x800032AD, // Small 'mul'.
+ 0x804832AD, // Small 'mulpd'.
+ 0x813832AD, // Small 'mulps'.
+ 0x8049B2AD, // Small 'mulsd'.
+ 0x8139B2AD, // Small 'mulss'.
+ 0x800C32AD, // Small 'mulx'.
+ 0x814486ED, // Small 'mwait'.
+ 0xB14486ED, // Small 'mwaitx'.
+ 0x80001CAE, // Small 'neg'.
+ 0x800041EE, // Small 'nop'.
+ 0x800051EE, // Small 'not'.
+ 0x8000024F, // Small 'or'.
+ 0x8002424F, // Small 'orpd'.
+ 0x8009C24F, // Small 'orps'.
+ 0x800052AF, // Small 'out'.
+ 0x8009D2AF, // Small 'outs'.
+ 0x80298830, // Small 'pabsb'.
+ 0x80498830, // Small 'pabsd'.
+ 0x81798830, // Small 'pabsw'.
+ 0x000084EB, // Large 'packssdw'.
+ 0x24F264EB, // Large 'packss|wb'.
+ 0x24F164F5, // Large 'packus|dw'.
+ 0x000084F5, // Large 'packuswb'.
+ 0x80221030, // Small 'paddb'.
+ 0x80421030, // Small 'paddd'.
+ 0x81121030, // Small 'paddq'.
+ 0x85321030, // Small 'paddsb'.
+ 0xAF321030, // Small 'paddsw'.
+ 0x25BA5675, // Large 'paddu|sb'.
+ 0x23835675, // Large 'paddu|sw'.
+ 0x81721030, // Small 'paddw'.
+ 0x1023667B, // Large 'palign|r'.
+ 0x80023830, // Small 'pand'.
+ 0x80E23830, // Small 'pandn'.
+ 0x8059D430, // Small 'pause'.
+ 0x8023D830, // Small 'pavgb'.
+ 0x25BA576A, // Large 'pavgu|sb'.
+ 0x8173D830, // Small 'pavgw'.
+ 0x202164FE, // Large 'pblend|vb'.
+ 0x105F64FE, // Large 'pblend|w'.
+ 0x42885345, // Large 'pclmu|lqdq'.
+ 0x200F534B, // Large 'pcmpe|qb'.
+ 0x227D534B, // Large 'pcmpe|qd'.
+ 0x21F6534B, // Large 'pcmpe|qq'.
+ 0x2559534B, // Large 'pcmpe|qw'.
+ 0x1009834B, // Large 'pcmpestr|i'.
+ 0x105C834B, // Large 'pcmpestr|m'.
+ 0x368142A5, // Large 'pcmp|gtb'.
+ 0x368442A5, // Large 'pcmp|gtd'.
+ 0x368742A5, // Large 'pcmp|gtq'.
+ 0x368A42A5, // Large 'pcmp|gtw'.
+ 0x10098354, // Large 'pcmpistr|i'.
+ 0x105C8354, // Large 'pcmpistr|m'.
+ 0x267E5255, // Large 'pconf|ig'.
+ 0x80081490, // Small 'pdep'.
+ 0x800A60B0, // Small 'pext'.
+ 0x852A60B0, // Small 'pextrb'.
+ 0x892A60B0, // Small 'pextrd'.
+ 0xA32A60B0, // Small 'pextrq'.
+ 0xAF2A60B0, // Small 'pextrw'.
+ 0x8044F4D0, // Small 'pf2id'.
+ 0x8174F4D0, // Small 'pf2iw'.
+ 0x803184D0, // Small 'pfacc'.
+ 0x804204D0, // Small 'pfadd'.
+ 0x100F676F, // Large 'pfcmpe|q'.
+ 0x2018576F, // Large 'pfcmp|ge'.
+ 0x2681576F, // Large 'pfcmp|gt'.
+ 0x8180B4D0, // Small 'pfmax'.
+ 0x80E4B4D0, // Small 'pfmin'.
+ 0x80CAB4D0, // Small 'pfmul'.
+ 0x8630B8D0, // Small 'pfnacc'.
+ 0x24B15775, // Large 'pfpna|cc'.
+ 0x8101C8D0, // Small 'pfrcp'.
+ 0x21AD6607, // Large 'pfrcpi|t1'.
+ 0x22BF6607, // Large 'pfrcpi|t2'.
+ 0xAD01C8D0, // Small 'pfrcpv'.
+ 0x21AD660D, // Large 'pfrsqi|t1'.
+ 0x2188560D, // Large 'pfrsq|rt'.
+ 0x3613560D, // Large 'pfrsq|rtv'.
+ 0x802ACCD0, // Small 'pfsub'.
+ 0xA42ACCD0, // Small 'pfsubr'.
+ 0x88420510, // Small 'phaddd'.
+ 0x23835536, // Large 'phadd|sw'.
+ 0xAE420510, // Small 'phaddw'.
+ 0x105F925F, // Large 'phminposu|w'.
+ 0x882ACD10, // Small 'phsubd'.
+ 0x23835696, // Large 'phsub|sw'.
+ 0xAE2ACD10, // Small 'phsubw'.
+ 0x80437530, // Small 'pi2fd'.
+ 0x81737530, // Small 'pi2fw'.
+ 0x8529B930, // Small 'pinsrb'.
+ 0x8929B930, // Small 'pinsrd'.
+ 0xA329B930, // Small 'pinsrq'.
+ 0xAF29B930, // Small 'pinsrw'.
+ 0x43855269, // Large 'pmadd|ubsw'.
+ 0x239C5269, // Large 'pmadd|wd'.
+ 0x853C05B0, // Small 'pmaxsb'.
+ 0x893C05B0, // Small 'pmaxsd'.
+ 0xAF3C05B0, // Small 'pmaxsw'.
+ 0x855C05B0, // Small 'pmaxub'.
+ 0x895C05B0, // Small 'pmaxud'.
+ 0xAF5C05B0, // Small 'pmaxuw'.
+ 0x853725B0, // Small 'pminsb'.
+ 0x893725B0, // Small 'pminsd'.
+ 0xAF3725B0, // Small 'pminsw'.
+ 0x855725B0, // Small 'pminub'.
+ 0x895725B0, // Small 'pminud'.
+ 0xAF5725B0, // Small 'pminuw'.
+ 0x10107543, // Large 'pmovmsk|b'.
+ 0x1026754B, // Large 'pmovsxb|d'.
+ 0x100F754B, // Large 'pmovsxb|q'.
+ 0x105F754B, // Large 'pmovsxb|w'.
+ 0x20E5654B, // Large 'pmovsx|dq'.
+ 0x239C654B, // Large 'pmovsx|wd'.
+ 0x253D654B, // Large 'pmovsx|wq'.
+ 0x1026755C, // Large 'pmovzxb|d'.
+ 0x100F755C, // Large 'pmovzxb|q'.
+ 0x105F755C, // Large 'pmovzxb|w'.
+ 0x20E5655C, // Large 'pmovzx|dq'.
+ 0x239C655C, // Large 'pmovzx|wd'.
+ 0x253D655C, // Large 'pmovzx|wq'.
+ 0xA24655B0, // Small 'pmuldq'.
+ 0x23836564, // Large 'pmulhr|sw'.
+ 0x105F6564, // Large 'pmulhr|w'.
+ 0x24815564, // Large 'pmulh|uw'.
+ 0xAE8655B0, // Small 'pmulhw'.
+ 0x88C655B0, // Small 'pmulld'.
+ 0xAEC655B0, // Small 'pmullw'.
+ 0x32E540CF, // Large 'pmul|udq'.
+ 0x800041F0, // Small 'pop'.
+ 0x8000C1F0, // Small 'popa'.
+ 0x8040C1F0, // Small 'popad'.
+ 0xA8E1C1F0, // Small 'popcnt'.
+ 0x800341F0, // Small 'popf'.
+ 0x804341F0, // Small 'popfd'.
+ 0x811341F0, // Small 'popfq'.
+ 0x800049F0, // Small 'por'.
+ 0x0000819F, // Large 'prefetch'.
+ 0x10E4A19F, // Large 'prefetchit|0'.
+ 0x106BA19F, // Large 'prefetchit|1'.
+ 0x31A9819F, // Large 'prefetch|nta'.
+ 0x22BD819F, // Large 'prefetch|t0'.
+ 0x21AD819F, // Large 'prefetch|t1'.
+ 0x22BF819F, // Large 'prefetch|t2'.
+ 0x105F819F, // Large 'prefetch|w'.
+ 0x31AC819F, // Large 'prefetch|wt1'.
+ 0xAE220670, // Small 'psadbw'.
+ 0x846AA270, // Small 'pshufb'.
+ 0x886AA270, // Small 'pshufd'.
+ 0x26C3518C, // Large 'pshuf|hw'.
+ 0x23A4518C, // Large 'pshuf|lw'.
+ 0xAE6AA270, // Small 'pshufw'.
+ 0x84E3A670, // Small 'psignb'.
+ 0x88E3A670, // Small 'psignd'.
+ 0xAEE3A670, // Small 'psignw'.
+ 0x80463270, // Small 'pslld'.
+ 0xA2463270, // Small 'pslldq'.
+ 0x81163270, // Small 'psllq'.
+ 0x81763270, // Small 'psllw'.
+ 0x9130B670, // Small 'psmash'.
+ 0x8040CA70, // Small 'psrad'.
+ 0x8170CA70, // Small 'psraw'.
+ 0x80464A70, // Small 'psrld'.
+ 0xA2464A70, // Small 'psrldq'.
+ 0x81164A70, // Small 'psrlq'.
+ 0x81764A70, // Small 'psrlw'.
+ 0x80215670, // Small 'psubb'.
+ 0x80415670, // Small 'psubd'.
+ 0x81115670, // Small 'psubq'.
+ 0x85315670, // Small 'psubsb'.
+ 0xAF315670, // Small 'psubsw'.
+ 0x25BA56C6, // Large 'psubu|sb'.
+ 0x238356C6, // Large 'psubu|sw'.
+ 0x81715670, // Small 'psubw'.
+ 0x8900DE70, // Small 'pswapd'.
+ 0x81499690, // Small 'ptest'.
+ 0x20DF577A, // Large 'ptwri|te'.
+ 0x239A7280, // Large 'punpckh|bw'.
+ 0x20E57280, // Large 'punpckh|dq'.
+ 0x20E58280, // Large 'punpckhq|dq'.
+ 0x239C7280, // Large 'punpckh|wd'.
+ 0x339E6280, // Large 'punpck|lbw'.
+ 0x33A16280, // Large 'punpck|ldq'.
+ 0x42886280, // Large 'punpck|lqdq'.
+ 0x33A46280, // Large 'punpck|lwd'.
+ 0x80044EB0, // Small 'push'.
+ 0x80144EB0, // Small 'pusha'.
+ 0x88144EB0, // Small 'pushad'.
+ 0x80644EB0, // Small 'pushf'.
+ 0x88644EB0, // Small 'pushfd'.
+ 0xA2644EB0, // Small 'pushfq'.
+ 0x20DF7422, // Large 'pvalida|te'.
+ 0x80093F10, // Small 'pxor'.
+ 0x80003072, // Small 'rcl'.
+ 0x81384072, // Small 'rcpps'.
+ 0x8139C072, // Small 'rcpss'.
+ 0x80004872, // Small 'rcr'.
+ 0x34365616, // Large 'rdfsb|ase'.
+ 0x3436561B, // Large 'rdgsb|ase'.
+ 0x8129B492, // Small 'rdmsr'.
+ 0x8044C092, // Small 'rdpid'.
+ 0xAB25C092, // Small 'rdpkru'.
+ 0x8036C092, // Small 'rdpmc'.
+ 0x81594092, // Small 'rdpru'.
+ 0x88E0C892, // Small 'rdrand'.
+ 0x8852CC92, // Small 'rdseed'.
+ 0x8909CC92, // Small 'rdsspd'.
+ 0xA309CC92, // Small 'rdsspq'.
+ 0x8039D092, // Small 'rdtsc'.
+ 0xA039D092, // Small 'rdtscp'.
+ 0x800050B2, // Small 'ret'.
+ 0x800350B2, // Small 'retf'.
+ 0x201F7429, // Large 'rmpadju|st'.
+ 0x20DF7430, // Large 'rmpupda|te'.
+ 0x800031F2, // Small 'rol'.
+ 0x800049F2, // Small 'ror'.
+ 0x800C49F2, // Small 'rorx'.
+ 0x20A756D8, // Large 'round|pd'.
+ 0x207D56D8, // Large 'round|ps'.
+ 0x000076D8, // Large 'roundsd'.
+ 0x101466D8, // Large 'rounds|s'.
+ 0x80003672, // Small 'rsm'.
+ 0x207D53A8, // Large 'rsqrt|ps'.
+ 0x201C53A8, // Large 'rsqrt|ss'.
+ 0x3620540D, // Large 'rstor|ssp'.
+ 0x80032033, // Small 'sahf'.
+ 0x80003033, // Small 'sal'.
+ 0x80004833, // Small 'sar'.
+ 0x800C4833, // Small 'sarx'.
+ 0x1004A1AF, // Large 'saveprevss|p'.
+ 0x80000853, // Small 'sbb'.
+ 0x80098473, // Small 'scas'.
+ 0x10D27623, // Large 'seamcal|l'.
+ 0x207D577F, // Large 'seamo|ps'.
+ 0x21A35784, // Large 'seamr|et'.
+ 0x222A662A, // Large 'sendui|pi'.
+ 0x23CB7437, // Large 'seriali|ze'.
+ 0x8000D0B3, // Small 'seta'.
+ 0x8050D0B3, // Small 'setae'.
+ 0x800150B3, // Small 'setb'.
+ 0x805150B3, // Small 'setbe'.
+ 0x8001D0B3, // Small 'setc'.
+ 0x8002D0B3, // Small 'sete'.
+ 0x8003D0B3, // Small 'setg'.
+ 0x8053D0B3, // Small 'setge'.
+ 0x800650B3, // Small 'setl'.
+ 0x805650B3, // Small 'setle'.
+ 0x801750B3, // Small 'setna'.
+ 0x8A1750B3, // Small 'setnae'.
+ 0x802750B3, // Small 'setnb'.
+ 0x8A2750B3, // Small 'setnbe'.
+ 0x803750B3, // Small 'setnc'.
+ 0x805750B3, // Small 'setne'.
+ 0x807750B3, // Small 'setng'.
+ 0x8A7750B3, // Small 'setnge'.
+ 0x80C750B3, // Small 'setnl'.
+ 0x8AC750B3, // Small 'setnle'.
+ 0x80F750B3, // Small 'setno'.
+ 0x810750B3, // Small 'setnp'.
+ 0x813750B3, // Small 'setns'.
+ 0x81A750B3, // Small 'setnz'.
+ 0x8007D0B3, // Small 'seto'.
+ 0x800850B3, // Small 'setp'.
+ 0x805850B3, // Small 'setpe'.
+ 0x80F850B3, // Small 'setpo'.
+ 0x8009D0B3, // Small 'sets'.
+ 0x10177630, // Large 'setssbs|y'.
+ 0x800D50B3, // Small 'setz'.
+ 0x8A3714D3, // Small 'sfence'.
+ 0x800A10F3, // Small 'sgdt'.
+ 0x4295443E, // Large 'sha1|msg1'.
+ 0x4299443E, // Large 'sha1|msg2'.
+ 0x20DF743E, // Large 'sha1nex|te'.
+ 0x102F8445, // Large 'sha1rnds|4'.
+ 0x429561B9, // Large 'sha256|msg1'.
+ 0x429961B9, // Large 'sha256|msg2'.
+ 0x207E91B9, // Large 'sha256rnd|s2'.
+ 0x80003113, // Small 'shl'.
+ 0x80023113, // Small 'shld'.
+ 0x800C3113, // Small 'shlx'.
+ 0x80004913, // Small 'shr'.
+ 0x80024913, // Small 'shrd'.
+ 0x800C4913, // Small 'shrx'.
+ 0x89035513, // Small 'shufpd'.
+ 0xA7035513, // Small 'shufps'.
+ 0x800A1133, // Small 'sidt'.
+ 0xA8972573, // Small 'skinit'.
+ 0x800A1193, // Small 'sldt'.
+ 0x84385D93, // Small 'slwpcb'.
+ 0x800BCDB3, // Small 'smsw'.
+ 0x890A4A33, // Small 'sqrtpd'.
+ 0xA70A4A33, // Small 'sqrtps'.
+ 0x893A4A33, // Small 'sqrtsd'.
+ 0xA73A4A33, // Small 'sqrtss'.
+ 0x80018693, // Small 'stac'.
+ 0x80000E93, // Small 'stc'.
+ 0x80001293, // Small 'std'.
+ 0x80049E93, // Small 'stgi'.
+ 0x80002693, // Small 'sti'.
+ 0x102366E7, // Large 'stmxcs|r'.
+ 0x8009BE93, // Small 'stos'.
+ 0x80004A93, // Small 'str'.
+ 0x1001844D, // Large 'sttilecf|g'.
+ 0x8004D693, // Small 'stui'.
+ 0x80000AB3, // Small 'sub'.
+ 0x80480AB3, // Small 'subpd'.
+ 0x81380AB3, // Small 'subps'.
+ 0x80498AB3, // Small 'subsd'.
+ 0x81398AB3, // Small 'subss'.
+ 0xA67806F3, // Small 'swapgs'.
+ 0x36F34789, // Large 'sysc|all'.
+ 0x41234637, // Large 'syse|nter'.
+ 0x2192563B, // Large 'sysex|it'.
+ 0x3192563B, // Large 'sysex|itq'.
+ 0xA8594F33, // Small 'sysret'.
+ 0x2193578D, // Large 'sysre|tq'.
+ 0x86B9B794, // Small 't1mskc'.
+ 0x207DA12B, // Large 'tcmmimfp16|ps'.
+ 0x207DA135, // Large 'tcmmrlfp16|ps'.
+ 0x98C08C94, // Small 'tdcall'.
+ 0x207D7455, // Large 'tdpbf16|ps'.
+ 0x31434455, // Large 'tdpb|ssd'.
+ 0x32E44455, // Large 'tdpb|sud'.
+ 0x21445792, // Large 'tdpbu|sd'.
+ 0x22E55792, // Large 'tdpbu|ud'.
+ 0x207D745C, // Large 'tdpfp16|ps'.
+ 0x800A4CB4, // Small 'test'.
+ 0x935A4CB4, // Small 'testui'.
+ 0x000091C2, // Large 'tileloadd'.
+ 0x21AD91C2, // Large 'tileloadd|t1'.
+ 0x212791CB, // Large 'tilerelea|se'.
+ 0x102692C1, // Large 'tilestore|d'.
+ 0x43CB41C2, // Large 'tile|zero'.
+ 0x21E15797, // Large 'tlbsy|nc'.
+ 0x8B3A8614, // Small 'tpause'.
+ 0x81470F54, // Small 'tzcnt'.
+ 0x80B9B754, // Small 'tzmsk'.
+ 0x214456EE, // Large 'ucomi|sd'.
+ 0x201C56EE, // Large 'ucomi|ss'.
+ 0x80006C95, // Small 'ud0'.
+ 0x80007095, // Small 'ud1'.
+ 0x80007495, // Small 'ud2'.
+ 0x8142C935, // Small 'uiret'.
+ 0x7600109D, // Large 'u|monitor'.
+ 0xA890DDB5, // Small 'umwait'.
+ 0x20A76281, // Large 'unpckh|pd'.
+ 0x207D6281, // Large 'unpckh|ps'.
+ 0x35975281, // Large 'unpck|lpd'.
+ 0x359A5281, // Large 'unpck|lps'.
+ 0x30F16463, // Large 'v4fmad|dps'.
+ 0x32D16463, // Large 'v4fmad|dss'.
+ 0x30F172CA, // Large 'v4fnmad|dps'.
+ 0x32D172CA, // Large 'v4fnmad|dss'.
+ 0x89021036, // Small 'vaddpd'.
+ 0x91021036, // Small 'vaddph'.
+ 0xA7021036, // Small 'vaddps'.
+ 0x89321036, // Small 'vaddsd'.
+ 0x91321036, // Small 'vaddsh'.
+ 0xA7321036, // Small 'vaddss'.
+ 0x20A77469, // Large 'vaddsub|pd'.
+ 0x207D7469, // Large 'vaddsub|ps'.
+ 0x000071D4, // Large 'vaesdec'.
+ 0x302881D4, // Large 'vaesdecl|ast'.
+ 0x000071DC, // Large 'vaesenc'.
+ 0x302881DC, // Large 'vaesencl|ast'.
+ 0x2626579C, // Large 'vaesi|mc'.
+ 0x1020F011, // Large 'vaeskeygenassis|t'.
+ 0x219D57A1, // Large 'valig|nd'.
+ 0x271E57A1, // Large 'valig|nq'.
+ 0x20A757A6, // Large 'vandn|pd'.
+ 0x207D57A6, // Large 'vandn|ps'.
+ 0x89023836, // Small 'vandpd'.
+ 0xA7023836, // Small 'vandps'.
+ 0x1014D062, // Large 'vbcstnebf162p|s'.
+ 0x513F7062, // Large 'vbcstne|sh2ps'.
+ 0x20A77470, // Large 'vblendm|pd'.
+ 0x207D7470, // Large 'vblendm|ps'.
+ 0x20A76470, // Large 'vblend|pd'.
+ 0x207D6470, // Large 'vblend|ps'.
+ 0x34776470, // Large 'vblend|vpd'.
+ 0x318B6470, // Large 'vblend|vps'.
+ 0x306FB021, // Large 'vbroadcastf|128'.
+ 0x1003E021, // Large 'vbroadcastf32x|2'.
+ 0x102FE021, // Large 'vbroadcastf32x|4'.
+ 0x1005E021, // Large 'vbroadcastf32x|8'.
+ 0x4030B021, // Large 'vbroadcastf|64x2'.
+ 0x4034B021, // Large 'vbroadcastf|64x4'.
+ 0x4072A021, // Large 'vbroadcast|i128'.
+ 0x5038A021, // Large 'vbroadcast|i32x2'.
+ 0x503DA021, // Large 'vbroadcast|i32x4'.
+ 0x5042A021, // Large 'vbroadcast|i32x8'.
+ 0x5047A021, // Large 'vbroadcast|i64x2'.
+ 0x504CA021, // Large 'vbroadcast|i64x4'.
+ 0x2144A021, // Large 'vbroadcast|sd'.
+ 0x201CA021, // Large 'vbroadcast|ss'.
+ 0x89083476, // Small 'vcmppd'.
+ 0x91083476, // Small 'vcmpph'.
+ 0xA7083476, // Small 'vcmpps'.
+ 0x89383476, // Small 'vcmpsd'.
+ 0x91383476, // Small 'vcmpsh'.
+ 0xA7383476, // Small 'vcmpss'.
+ 0x214457AB, // Large 'vcomi|sd'.
+ 0x20D557AB, // Large 'vcomi|sh'.
+ 0x201C57AB, // Large 'vcomi|ss'.
+ 0x20A791E4, // Large 'vcompress|pd'.
+ 0x207D91E4, // Large 'vcompress|ps'.
+ 0x20A7747A, // Large 'vcvtdq2|pd'.
+ 0x20A2747A, // Large 'vcvtdq2|ph'.
+ 0x207D747A, // Large 'vcvtdq2|ps'.
+ 0x4069A076, // Large 'vcvtne2ps2|bf16'.
+ 0x307CB080, // Large 'vcvtneebf16|2ps'.
+ 0x51467080, // Large 'vcvtnee|ph2ps'.
+ 0x307CB08B, // Large 'vcvtneobf16|2ps'.
+ 0x5146708B, // Large 'vcvtneo|ph2ps'.
+ 0x406990FC, // Large 'vcvtneps2|bf16'.
+ 0x20E572D4, // Large 'vcvtpd2|dq'.
+ 0x20A272D4, // Large 'vcvtpd2|ph'.
+ 0x207D72D4, // Large 'vcvtpd2|ps'.
+ 0x21F672D4, // Large 'vcvtpd2|qq'.
+ 0x20E582D4, // Large 'vcvtpd2u|dq'.
+ 0x21F682D4, // Large 'vcvtpd2u|qq'.
+ 0x20E572DC, // Large 'vcvtph2|dq'.
+ 0x102682DC, // Large 'vcvtph2p|d'.
+ 0x000092DC, // Large 'vcvtph2ps'.
+ 0x102E92DC, // Large 'vcvtph2ps|x'.
+ 0x21F672DC, // Large 'vcvtph2|qq'.
+ 0x32E572DC, // Large 'vcvtph2|udq'.
+ 0x31F572DC, // Large 'vcvtph2|uqq'.
+ 0x248172DC, // Large 'vcvtph2|uw'.
+ 0x105F72DC, // Large 'vcvtph2|w'.
+ 0x20E572E8, // Large 'vcvtps2|dq'.
+ 0x102682E8, // Large 'vcvtps2p|d'.
+ 0x000092E8, // Large 'vcvtps2ph'.
+ 0x102E92E8, // Large 'vcvtps2ph|x'.
+ 0x21F672E8, // Large 'vcvtps2|qq'.
+ 0x32E572E8, // Large 'vcvtps2|udq'.
+ 0x31F572E8, // Large 'vcvtps2|uqq'.
+ 0x20A77483, // Large 'vcvtqq2|pd'.
+ 0x20A27483, // Large 'vcvtqq2|ph'.
+ 0x207D7483, // Large 'vcvtqq2|ps'.
+ 0x20D572F1, // Large 'vcvtsd2|sh'.
+ 0x201D72F1, // Large 'vcvtsd2|si'.
+ 0x201C72F1, // Large 'vcvtsd2|ss'.
+ 0x201D82F1, // Large 'vcvtsd2u|si'.
+ 0x214472F9, // Large 'vcvtsh2|sd'.
+ 0x201D72F9, // Large 'vcvtsh2|si'.
+ 0x201C72F9, // Large 'vcvtsh2|ss'.
+ 0x201D82F9, // Large 'vcvtsh2u|si'.
+ 0x2144748A, // Large 'vcvtsi2|sd'.
+ 0x20D5748A, // Large 'vcvtsi2|sh'.
+ 0x201C748A, // Large 'vcvtsi2|ss'.
+ 0x21447301, // Large 'vcvtss2|sd'.
+ 0x20D57301, // Large 'vcvtss2|sh'.
+ 0x201D7301, // Large 'vcvtss2|si'.
+ 0x201D8301, // Large 'vcvtss2u|si'.
+ 0x20E581ED, // Large 'vcvttpd2|dq'.
+ 0x21F681ED, // Large 'vcvttpd2|qq'.
+ 0x20E591ED, // Large 'vcvttpd2u|dq'.
+ 0x21F691ED, // Large 'vcvttpd2u|qq'.
+ 0x20E581F8, // Large 'vcvttph2|dq'.
+ 0x21F681F8, // Large 'vcvttph2|qq'.
+ 0x20E591F8, // Large 'vcvttph2u|dq'.
+ 0x21F691F8, // Large 'vcvttph2u|qq'.
+ 0x105F91F8, // Large 'vcvttph2u|w'.
+ 0x105F81F8, // Large 'vcvttph2|w'.
+ 0x20E58201, // Large 'vcvttps2|dq'.
+ 0x21F68201, // Large 'vcvttps2|qq'.
+ 0x20E59201, // Large 'vcvttps2u|dq'.
+ 0x21F69201, // Large 'vcvttps2u|qq'.
+ 0x201D820A, // Large 'vcvttsd2|si'.
+ 0x201D920A, // Large 'vcvttsd2u|si'.
+ 0x201D8213, // Large 'vcvttsh2|si'.
+ 0x201D9213, // Large 'vcvttsh2u|si'.
+ 0x201D821C, // Large 'vcvttss2|si'.
+ 0x201D921C, // Large 'vcvttss2u|si'.
+ 0x20A78309, // Large 'vcvtudq2|pd'.
+ 0x20A28309, // Large 'vcvtudq2|ph'.
+ 0x207D8309, // Large 'vcvtudq2|ps'.
+ 0x20A78311, // Large 'vcvtuqq2|pd'.
+ 0x20A28311, // Large 'vcvtuqq2|ph'.
+ 0x207D8311, // Large 'vcvtuqq2|ps'.
+ 0x21448319, // Large 'vcvtusi2|sd'.
+ 0x20D58319, // Large 'vcvtusi2|sh'.
+ 0x201C8319, // Large 'vcvtusi2|ss'.
+ 0x30A16491, // Large 'vcvtuw|2ph'.
+ 0x30A15640, // Large 'vcvtw|2ph'.
+ 0x239A7497, // Large 'vdbpsad|bw'.
+ 0x890B2496, // Small 'vdivpd'.
+ 0x910B2496, // Small 'vdivph'.
+ 0xA70B2496, // Small 'vdivps'.
+ 0x893B2496, // Small 'vdivsd'.
+ 0x913B2496, // Small 'vdivsh'.
+ 0xA73B2496, // Small 'vdivss'.
+ 0x207D749E, // Large 'vdpbf16|ps'.
+ 0x80484096, // Small 'vdppd'.
+ 0x81384096, // Small 'vdpps'.
+ 0x800948B6, // Small 'verr'.
+ 0x800BC8B6, // Small 'verw'.
+ 0x352544A5, // Large 'vexp|2pd'.
+ 0x307C44A5, // Large 'vexp|2ps'.
+ 0x30ED64A5, // Large 'vexpan|dpd'.
+ 0x30F164A5, // Large 'vexpan|dps'.
+ 0x306F910C, // Large 'vextractf|128'.
+ 0x602A7105, // Large 'vextrac|tf32x4'.
+ 0x4043910C, // Large 'vextractf|32x8'.
+ 0x4030910C, // Large 'vextractf|64x2'.
+ 0x4034910C, // Large 'vextractf|64x4'.
+ 0x4072810C, // Large 'vextract|i128'.
+ 0x503D810C, // Large 'vextract|i32x4'.
+ 0x5042810C, // Large 'vextract|i32x8'.
+ 0x5047810C, // Large 'vextract|i64x2'.
+ 0x504C810C, // Large 'vextract|i64x4'.
+ 0x207D810C, // Large 'vextract|ps'.
+ 0x20A28321, // Large 'vfcmaddc|ph'.
+ 0x20D58321, // Large 'vfcmaddc|sh'.
+ 0x20A274AB, // Large 'vfcmulc|ph'.
+ 0x20D574AB, // Large 'vfcmulc|sh'.
+ 0x20A79225, // Large 'vfixupimm|pd'.
+ 0x207D9225, // Large 'vfixupimm|ps'.
+ 0x21449225, // Large 'vfixupimm|sd'.
+ 0x201C9225, // Large 'vfixupimm|ss'.
+ 0x20A7922E, // Large 'vfmadd132|pd'.
+ 0x20A2922E, // Large 'vfmadd132|ph'.
+ 0x207D922E, // Large 'vfmadd132|ps'.
+ 0x2144922E, // Large 'vfmadd132|sd'.
+ 0x20D5922E, // Large 'vfmadd132|sh'.
+ 0x201C922E, // Large 'vfmadd132|ss'.
+ 0x50A46096, // Large 'vfmadd|213pd'.
+ 0x50A96096, // Large 'vfmadd|213ph'.
+ 0x50AE6096, // Large 'vfmadd|213ps'.
+ 0x51556096, // Large 'vfmadd|213sd'.
+ 0x515A6096, // Large 'vfmadd|213sh'.
+ 0x515F6096, // Large 'vfmadd|213ss'.
+ 0x50B36096, // Large 'vfmadd|231pd'.
+ 0x50B86096, // Large 'vfmadd|231ph'.
+ 0x50BD6096, // Large 'vfmadd|231ps'.
+ 0x51646096, // Large 'vfmadd|231sd'.
+ 0x51696096, // Large 'vfmadd|231sh'.
+ 0x516E6096, // Large 'vfmadd|231ss'.
+ 0x34B26096, // Large 'vfmadd|cph'.
+ 0x34B56096, // Large 'vfmadd|csh'.
+ 0x20A76096, // Large 'vfmadd|pd'.
+ 0x207D6096, // Large 'vfmadd|ps'.
+ 0x10267096, // Large 'vfmadds|d'.
+ 0x10147096, // Large 'vfmadds|s'.
+ 0x1026D096, // Large 'vfmaddsub132p|d'.
+ 0x10A3D096, // Large 'vfmaddsub132p|h'.
+ 0x1014D096, // Large 'vfmaddsub132p|s'.
+ 0x50A49096, // Large 'vfmaddsub|213pd'.
+ 0x50A99096, // Large 'vfmaddsub|213ph'.
+ 0x50AE9096, // Large 'vfmaddsub|213ps'.
+ 0x50B39096, // Large 'vfmaddsub|231pd'.
+ 0x50B89096, // Large 'vfmaddsub|231ph'.
+ 0x50BD9096, // Large 'vfmaddsub|231ps'.
+ 0x20A79096, // Large 'vfmaddsub|pd'.
+ 0x207D9096, // Large 'vfmaddsub|ps'.
+ 0x20A79237, // Large 'vfmsub132|pd'.
+ 0x20A29237, // Large 'vfmsub132|ph'.
+ 0x207D9237, // Large 'vfmsub132|ps'.
+ 0x21449237, // Large 'vfmsub132|sd'.
+ 0x20D59237, // Large 'vfmsub132|sh'.
+ 0x201C9237, // Large 'vfmsub132|ss'.
+ 0x50A460C2, // Large 'vfmsub|213pd'.
+ 0x50A960C2, // Large 'vfmsub|213ph'.
+ 0x50AE60C2, // Large 'vfmsub|213ps'.
+ 0x515560C2, // Large 'vfmsub|213sd'.
+ 0x515A60C2, // Large 'vfmsub|213sh'.
+ 0x515F60C2, // Large 'vfmsub|213ss'.
+ 0x50B360C2, // Large 'vfmsub|231pd'.
+ 0x50B860C2, // Large 'vfmsub|231ph'.
+ 0x50BD60C2, // Large 'vfmsub|231ps'.
+ 0x516460C2, // Large 'vfmsub|231sd'.
+ 0x516960C2, // Large 'vfmsub|231sh'.
+ 0x516E60C2, // Large 'vfmsub|231ss'.
+ 0x20A7C0C2, // Large 'vfmsubadd132|pd'.
+ 0x20A2C0C2, // Large 'vfmsubadd132|ph'.
+ 0x207DC0C2, // Large 'vfmsubadd132|ps'.
+ 0x50A490C2, // Large 'vfmsubadd|213pd'.
+ 0x50A990C2, // Large 'vfmsubadd|213ph'.
+ 0x50AE90C2, // Large 'vfmsubadd|213ps'.
+ 0x50B390C2, // Large 'vfmsubadd|231pd'.
+ 0x50B890C2, // Large 'vfmsubadd|231ph'.
+ 0x50BD90C2, // Large 'vfmsubadd|231ps'.
+ 0x20A790C2, // Large 'vfmsubadd|pd'.
+ 0x207D90C2, // Large 'vfmsubadd|ps'.
+ 0x20A760C2, // Large 'vfmsub|pd'.
+ 0x207D60C2, // Large 'vfmsub|ps'.
+ 0x214460C2, // Large 'vfmsub|sd'.
+ 0x201C60C2, // Large 'vfmsub|ss'.
+ 0x34B25645, // Large 'vfmul|cph'.
+ 0x34B55645, // Large 'vfmul|csh'.
+ 0x20A7A14B, // Large 'vfnmadd132|pd'.
+ 0x20A2A14B, // Large 'vfnmadd132|ph'.
+ 0x207DA14B, // Large 'vfnmadd132|ps'.
+ 0x2144A14B, // Large 'vfnmadd132|sd'.
+ 0x20D5A14B, // Large 'vfnmadd132|sh'.
+ 0x201CA14B, // Large 'vfnmadd132|ss'.
+ 0x50A4714B, // Large 'vfnmadd|213pd'.
+ 0x50A9714B, // Large 'vfnmadd|213ph'.
+ 0x50AE714B, // Large 'vfnmadd|213ps'.
+ 0x5155714B, // Large 'vfnmadd|213sd'.
+ 0x515A714B, // Large 'vfnmadd|213sh'.
+ 0x515F714B, // Large 'vfnmadd|213ss'.
+ 0x50B3714B, // Large 'vfnmadd|231pd'.
+ 0x50B8714B, // Large 'vfnmadd|231ph'.
+ 0x50BD714B, // Large 'vfnmadd|231ps'.
+ 0x5164714B, // Large 'vfnmadd|231sd'.
+ 0x5169714B, // Large 'vfnmadd|231sh'.
+ 0x516E714B, // Large 'vfnmadd|231ss'.
+ 0x20A7714B, // Large 'vfnmadd|pd'.
+ 0x207D714B, // Large 'vfnmadd|ps'.
+ 0x2144714B, // Large 'vfnmadd|sd'.
+ 0x201C714B, // Large 'vfnmadd|ss'.
+ 0x20A7A173, // Large 'vfnmsub132|pd'.
+ 0x20A2A173, // Large 'vfnmsub132|ph'.
+ 0x207DA173, // Large 'vfnmsub132|ps'.
+ 0x2144A173, // Large 'vfnmsub132|sd'.
+ 0x20D5A173, // Large 'vfnmsub132|sh'.
+ 0x201CA173, // Large 'vfnmsub132|ss'.
+ 0x50A47173, // Large 'vfnmsub|213pd'.
+ 0x50A97173, // Large 'vfnmsub|213ph'.
+ 0x50AE7173, // Large 'vfnmsub|213ps'.
+ 0x51557173, // Large 'vfnmsub|213sd'.
+ 0x515A7173, // Large 'vfnmsub|213sh'.
+ 0x515F7173, // Large 'vfnmsub|213ss'.
+ 0x50B37173, // Large 'vfnmsub|231pd'.
+ 0x50B87173, // Large 'vfnmsub|231ph'.
+ 0x50BD7173, // Large 'vfnmsub|231ps'.
+ 0x51647173, // Large 'vfnmsub|231sd'.
+ 0x51697173, // Large 'vfnmsub|231sh'.
+ 0x516E7173, // Large 'vfnmsub|231ss'.
+ 0x20A77173, // Large 'vfnmsub|pd'.
+ 0x207D7173, // Large 'vfnmsub|ps'.
+ 0x21447173, // Large 'vfnmsub|sd'.
+ 0x201C7173, // Large 'vfnmsub|ss'.
+ 0x20A78329, // Large 'vfpclass|pd'.
+ 0x20A28329, // Large 'vfpclass|ph'.
+ 0x207D8329, // Large 'vfpclass|ps'.
+ 0x21448329, // Large 'vfpclass|sd'.
+ 0x20D58329, // Large 'vfpclass|sh'.
+ 0x201C8329, // Large 'vfpclass|ss'.
+ 0x20A757B0, // Large 'vfrcz|pd'.
+ 0x207D57B0, // Large 'vfrcz|ps'.
+ 0x214457B0, // Large 'vfrcz|sd'.
+ 0x201C57B0, // Large 'vfrcz|ss'.
+ 0x30ED7115, // Large 'vgather|dpd'.
+ 0x30F17115, // Large 'vgather|dps'.
+ 0x30EDA115, // Large 'vgatherpf0|dpd'.
+ 0x30F1A115, // Large 'vgatherpf0|dps'.
+ 0x30E6A115, // Large 'vgatherpf0|qpd'.
+ 0x30E9A115, // Large 'vgatherpf0|qps'.
+ 0x40EC9115, // Large 'vgatherpf|1dpd'.
+ 0x40F09115, // Large 'vgatherpf|1dps'.
+ 0x40F49115, // Large 'vgatherpf|1qpd'.
+ 0x40F89115, // Large 'vgatherpf|1qps'.
+ 0x30E67115, // Large 'vgather|qpd'.
+ 0x30E97115, // Large 'vgather|qps'.
+ 0x20A774B8, // Large 'vgetexp|pd'.
+ 0x20A274B8, // Large 'vgetexp|ph'.
+ 0x207D74B8, // Large 'vgetexp|ps'.
+ 0x214474B8, // Large 'vgetexp|sd'.
+ 0x20D574B8, // Large 'vgetexp|sh'.
+ 0x201C74B8, // Large 'vgetexp|ss'.
+ 0x31F17331, // Large 'vgetman|tpd'.
+ 0x31FC7331, // Large 'vgetman|tph'.
+ 0x32057331, // Large 'vgetman|tps'.
+ 0x320E7331, // Large 'vgetman|tsd'.
+ 0x32177331, // Large 'vgetman|tsh'.
+ 0x32207331, // Large 'vgetman|tss'.
+ 0x200FF000, // Large 'vgf2p8affineinv|qb'.
+ 0x200FC000, // Large 'vgf2p8affine|qb'.
+ 0x43386000, // Large 'vgf2p8|mulb'.
+ 0x30ED47B5, // Large 'vhad|dpd'.
+ 0x30F147B5, // Large 'vhad|dps'.
+ 0x20A757B9, // Large 'vhsub|pd'.
+ 0x207D57B9, // Large 'vhsub|ps'.
+ 0x306F8183, // Large 'vinsertf|128'.
+ 0x602A617D, // Large 'vinser|tf32x4'.
+ 0x40438183, // Large 'vinsertf|32x8'.
+ 0x40308183, // Large 'vinsertf|64x2'.
+ 0x40348183, // Large 'vinsertf|64x4'.
+ 0x40727183, // Large 'vinsert|i128'.
+ 0x503D7183, // Large 'vinsert|i32x4'.
+ 0x50427183, // Large 'vinsert|i32x8'.
+ 0x50477183, // Large 'vinsert|i64x2'.
+ 0x504C7183, // Large 'vinsert|i64x4'.
+ 0x207D7183, // Large 'vinsert|ps'.
+ 0xAB121196, // Small 'vlddqu'.
+ 0x1023764A, // Large 'vldmxcs|r'.
+ 0x109DA240, // Large 'vmaskmovdq|u'.
+ 0x20A78240, // Large 'vmaskmov|pd'.
+ 0x207D8240, // Large 'vmaskmov|ps'.
+ 0x890C05B6, // Small 'vmaxpd'.
+ 0x910C05B6, // Small 'vmaxph'.
+ 0xA70C05B6, // Small 'vmaxps'.
+ 0x893C05B6, // Small 'vmaxsd'.
+ 0x913C05B6, // Small 'vmaxsh'.
+ 0xA73C05B6, // Small 'vmaxss'.
+ 0x98C08DB6, // Small 'vmcall'.
+ 0x242857BE, // Large 'vmcle|ar'.
+ 0x86EA99B6, // Small 'vmfunc'.
+ 0x219257C3, // Large 'vmgex|it'.
+ 0x890725B6, // Small 'vminpd'.
+ 0x910725B6, // Small 'vminph'.
+ 0xA70725B6, // Small 'vminps'.
+ 0x893725B6, // Small 'vminsd'.
+ 0x913725B6, // Small 'vminsh'.
+ 0xA73725B6, // Small 'vminss'.
+ 0x21A56651, // Large 'vmlaun|ch'.
+ 0x8817B1B6, // Small 'vmload'.
+ 0x36F347C8, // Large 'vmmc|all'.
+ 0x20A757CC, // Large 'vmova|pd'.
+ 0x207D57CC, // Large 'vmova|ps'.
+ 0x804B3DB6, // Small 'vmovd'.
+ 0x365754BF, // Large 'vmovd|dup'.
+ 0x000074BF, // Large 'vmovdqa'.
+ 0x202C74BF, // Large 'vmovdqa|32'.
+ 0x203074BF, // Large 'vmovdqa|64'.
+ 0x109D64BF, // Large 'vmovdq|u'.
+ 0x34C664BF, // Large 'vmovdq|u16'.
+ 0x34C964BF, // Large 'vmovdq|u32'.
+ 0x34CC64BF, // Large 'vmovdq|u64'.
+ 0x265A64BF, // Large 'vmovdq|u8'.
+ 0x359A565C, // Large 'vmovh|lps'.
+ 0x20A7565C, // Large 'vmovh|pd'.
+ 0x207D565C, // Large 'vmovh|ps'.
+ 0x207D6661, // Large 'vmovlh|ps'.
+ 0x20A75661, // Large 'vmovl|pd'.
+ 0x207D5661, // Large 'vmovl|ps'.
+ 0x20A774CF, // Large 'vmovmsk|pd'.
+ 0x207D74CF, // Large 'vmovmsk|ps'.
+ 0x20E564D6, // Large 'vmovnt|dq'.
+ 0x34C364D6, // Large 'vmovnt|dqa'.
+ 0x20A764D6, // Large 'vmovnt|pd'.
+ 0x207D64D6, // Large 'vmovnt|ps'.
+ 0x811B3DB6, // Small 'vmovq'.
+ 0x893B3DB6, // Small 'vmovsd'.
+ 0x913B3DB6, // Small 'vmovsh'.
+ 0x222974DC, // Large 'vmovshd|up'.
+ 0x222974E3, // Large 'vmovsld|up'.
+ 0xA73B3DB6, // Small 'vmovss'.
+ 0x343344BF, // Large 'vmov|upd'.
+ 0x207D57D1, // Large 'vmovu|ps'.
+ 0x817B3DB6, // Small 'vmovw'.
+ 0x239A6667, // Large 'vmpsad|bw'.
+ 0x341147D6, // Large 'vmpt|rld'.
+ 0x340D47D6, // Large 'vmpt|rst'.
+ 0x8812C9B6, // Small 'vmread'.
+ 0x100B766D, // Large 'vmresum|e'.
+ 0x80EAC9B6, // Small 'vmrun'.
+ 0x8B60CDB6, // Small 'vmsave'.
+ 0x890655B6, // Small 'vmulpd'.
+ 0x910655B6, // Small 'vmulph'.
+ 0xA70655B6, // Small 'vmulps'.
+ 0x893655B6, // Small 'vmulsd'.
+ 0x913655B6, // Small 'vmulsh'.
+ 0xA73655B6, // Small 'vmulss'.
+ 0x20DF57DA, // Large 'vmwri|te'.
+ 0x8C67E1B6, // Small 'vmxoff'.
+ 0x80E7E1B6, // Small 'vmxon'.
+ 0x804849F6, // Small 'vorpd'.
+ 0x813849F6, // Small 'vorps'.
+ 0x1026C11F, // Large 'vp2intersect|d'.
+ 0x100FC11F, // Large 'vp2intersect|q'.
+ 0x1026833C, // Large 'vp4dpwss|d'.
+ 0x209B833C, // Large 'vp4dpwss|ds'.
+ 0x85310616, // Small 'vpabsb'.
+ 0x89310616, // Small 'vpabsd'.
+ 0xA3310616, // Small 'vpabsq'.
+ 0xAF310616, // Small 'vpabsw'.
+ 0x105F84EA, // Large 'vpackssd|w'.
+ 0x24F274EA, // Large 'vpackss|wb'.
+ 0x34F064F4, // Large 'vpacku|sdw'.
+ 0x34FA64F4, // Large 'vpacku|swb'.
+ 0x84420616, // Small 'vpaddb'.
+ 0x88420616, // Small 'vpaddd'.
+ 0xA2420616, // Small 'vpaddq'.
+ 0x25BA5674, // Large 'vpadd|sb'.
+ 0x23835674, // Large 'vpadd|sw'.
+ 0x25BA6674, // Large 'vpaddu|sb'.
+ 0x23836674, // Large 'vpaddu|sw'.
+ 0xAE420616, // Small 'vpaddw'.
+ 0x1023767A, // Large 'vpalign|r'.
+ 0x80470616, // Small 'vpand'.
+ 0x88470616, // Small 'vpandd'.
+ 0x9C470616, // Small 'vpandn'.
+ 0x219D57DF, // Large 'vpand|nd'.
+ 0x271E57DF, // Large 'vpand|nq'.
+ 0xA2470616, // Small 'vpandq'.
+ 0x847B0616, // Small 'vpavgb'.
+ 0xAE7B0616, // Small 'vpavgw'.
+ 0x102674FD, // Large 'vpblend|d'.
+ 0x205C74FD, // Large 'vpblend|mb'.
+ 0x250474FD, // Large 'vpblend|md'.
+ 0x100F84FD, // Large 'vpblendm|q'.
+ 0x105F84FD, // Large 'vpblendm|w'.
+ 0x202174FD, // Large 'vpblend|vb'.
+ 0x105F74FD, // Large 'vpblend|w'.
+ 0x1010B051, // Large 'vpbroadcast|b'.
+ 0x1026B051, // Large 'vpbroadcast|d'.
+ 0x100FE051, // Large 'vpbroadcastmb2|q'.
+ 0x305FC051, // Large 'vpbroadcastm|w2d'.
+ 0x100FB051, // Large 'vpbroadcast|q'.
+ 0x105FB051, // Large 'vpbroadcast|w'.
+ 0x42886344, // Large 'vpclmu|lqdq'.
+ 0xACF68E16, // Small 'vpcmov'.
+ 0x85068E16, // Small 'vpcmpb'.
+ 0x89068E16, // Small 'vpcmpd'.
+ 0x200F634A, // Large 'vpcmpe|qb'.
+ 0x227D634A, // Large 'vpcmpe|qd'.
+ 0x21F6634A, // Large 'vpcmpe|qq'.
+ 0x2559634A, // Large 'vpcmpe|qw'.
+ 0x1009934A, // Large 'vpcmpestr|i'.
+ 0x105C934A, // Large 'vpcmpestr|m'.
+ 0x3681534A, // Large 'vpcmp|gtb'.
+ 0x3684534A, // Large 'vpcmp|gtd'.
+ 0x3687534A, // Large 'vpcmp|gtq'.
+ 0x368A534A, // Large 'vpcmp|gtw'.
+ 0x10099353, // Large 'vpcmpistr|i'.
+ 0x105C9353, // Large 'vpcmpistr|m'.
+ 0xA3068E16, // Small 'vpcmpq'.
+ 0x209D534A, // Large 'vpcmp|ub'.
+ 0x22E5534A, // Large 'vpcmp|ud'.
+ 0x21F5534A, // Large 'vpcmp|uq'.
+ 0x2481534A, // Large 'vpcmp|uw'.
+ 0xAF068E16, // Small 'vpcmpw'.
+ 0x84D78E16, // Small 'vpcomb'.
+ 0x88D78E16, // Small 'vpcomd'.
+ 0x1010A24A, // Large 'vpcompress|b'.
+ 0x1026A24A, // Large 'vpcompress|d'.
+ 0x100FA24A, // Large 'vpcompress|q'.
+ 0x105FA24A, // Large 'vpcompress|w'.
+ 0xA2D78E16, // Small 'vpcomq'.
+ 0x209D524A, // Large 'vpcom|ub'.
+ 0x22E5524A, // Large 'vpcom|ud'.
+ 0x21F5524A, // Large 'vpcom|uq'.
+ 0x2481524A, // Large 'vpcom|uw'.
+ 0xAED78E16, // Small 'vpcomw'.
+ 0x1026A254, // Large 'vpconflict|d'.
+ 0x100FA254, // Large 'vpconflict|q'.
+ 0x10267506, // Large 'vpdpbss|d'.
+ 0x209B7506, // Large 'vpdpbss|ds'.
+ 0x22E56506, // Large 'vpdpbs|ud'.
+ 0x350D6506, // Large 'vpdpbs|uds'.
+ 0x10267510, // Large 'vpdpbus|d'.
+ 0x209B7510, // Large 'vpdpbus|ds'.
+ 0x22E56510, // Large 'vpdpbu|ud'.
+ 0x350D6510, // Large 'vpdpbu|uds'.
+ 0x10267517, // Large 'vpdpwss|d'.
+ 0x209B7517, // Large 'vpdpwss|ds'.
+ 0x22E56517, // Large 'vpdpws|ud'.
+ 0x350D6517, // Large 'vpdpws|uds'.
+ 0x1026751E, // Large 'vpdpwus|d'.
+ 0x209B751E, // Large 'vpdpwus|ds'.
+ 0x22E5651E, // Large 'vpdpwu|ud'.
+ 0x350D651E, // Large 'vpdpwu|uds'.
+ 0x306F735C, // Large 'vperm2f|128'.
+ 0x4072635C, // Large 'vperm2|i128'.
+ 0x84D91616, // Small 'vpermb'.
+ 0x88D91616, // Small 'vpermd'.
+ 0x268D6363, // Large 'vpermi|2b'.
+ 0x20606363, // Large 'vpermi|2d'.
+ 0x35256363, // Large 'vpermi|2pd'.
+ 0x307C6363, // Large 'vpermi|2ps'.
+ 0x268F6363, // Large 'vpermi|2q'.
+ 0x205E6363, // Large 'vpermi|2w'.
+ 0x20A78363, // Large 'vpermil2|pd'.
+ 0x207D8363, // Large 'vpermil2|ps'.
+ 0x20A77363, // Large 'vpermil|pd'.
+ 0x207D7363, // Large 'vpermil|ps'.
+ 0x20A7535C, // Large 'vperm|pd'.
+ 0x207D535C, // Large 'vperm|ps'.
+ 0xA2D91616, // Small 'vpermq'.
+ 0x268D6528, // Large 'vpermt|2b'.
+ 0x20606528, // Large 'vpermt|2d'.
+ 0x35256528, // Large 'vpermt|2pd'.
+ 0x307C6528, // Large 'vpermt|2ps'.
+ 0x268F6528, // Large 'vpermt|2q'.
+ 0x205E6528, // Large 'vpermt|2w'.
+ 0xAED91616, // Small 'vpermw'.
+ 0x2498752E, // Large 'vpexpan|db'.
+ 0x209A752E, // Large 'vpexpan|dd'.
+ 0x20E5752E, // Large 'vpexpan|dq'.
+ 0x24F1752E, // Large 'vpexpan|dw'.
+ 0x35F7452E, // Large 'vpex|trb'.
+ 0x261657E4, // Large 'vpext|rd'.
+ 0x227C57E4, // Large 'vpext|rq'.
+ 0x27E957E4, // Large 'vpext|rw'.
+ 0x209A836B, // Large 'vpgather|dd'.
+ 0x20E5836B, // Large 'vpgather|dq'.
+ 0x227D836B, // Large 'vpgather|qd'.
+ 0x21F6836B, // Large 'vpgather|qq'.
+ 0x26916535, // Large 'vphadd|bd'.
+ 0x26936535, // Large 'vphadd|bq'.
+ 0x239A6535, // Large 'vphadd|bw'.
+ 0x10266535, // Large 'vphadd|d'.
+ 0x20E56535, // Large 'vphadd|dq'.
+ 0x23836535, // Large 'vphadd|sw'.
+ 0x10268535, // Large 'vphaddub|d'.
+ 0x100F8535, // Large 'vphaddub|q'.
+ 0x105F8535, // Large 'vphaddub|w'.
+ 0x20E57535, // Large 'vphaddu|dq'.
+ 0x239C7535, // Large 'vphaddu|wd'.
+ 0x253D7535, // Large 'vphaddu|wq'.
+ 0x105F6535, // Large 'vphadd|w'.
+ 0x239C6535, // Large 'vphadd|wd'.
+ 0x253D6535, // Large 'vphadd|wq'.
+ 0x105FA25E, // Large 'vphminposu|w'.
+ 0x239A6695, // Large 'vphsub|bw'.
+ 0x10266695, // Large 'vphsub|d'.
+ 0x20E56695, // Large 'vphsub|dq'.
+ 0x23836695, // Large 'vphsub|sw'.
+ 0x105F6695, // Large 'vphsub|w'.
+ 0x239C6695, // Large 'vphsub|wd'.
+ 0x25F857EB, // Large 'vpins|rb'.
+ 0x261657EB, // Large 'vpins|rd'.
+ 0x227C57EB, // Large 'vpins|rq'.
+ 0x27E957EB, // Large 'vpins|rw'.
+ 0x2455669B, // Large 'vplzcn|td'.
+ 0x2193669B, // Large 'vplzcn|tq'.
+ 0x209A6373, // Large 'vpmacs|dd'.
+ 0x353F6373, // Large 'vpmacs|dqh'.
+ 0x33A26373, // Large 'vpmacs|dql'.
+ 0x10268373, // Large 'vpmacssd|d'.
+ 0x10A39373, // Large 'vpmacssdq|h'.
+ 0x10D29373, // Large 'vpmacssdq|l'.
+ 0x239C7373, // Large 'vpmacss|wd'.
+ 0x239B7373, // Large 'vpmacss|ww'.
+ 0x239C6373, // Large 'vpmacs|wd'.
+ 0x239B6373, // Large 'vpmacs|ww'.
+ 0x1026937C, // Large 'vpmadcssw|d'.
+ 0x239C737C, // Large 'vpmadcs|wd'.
+ 0x21F59268, // Large 'vpmadd52h|uq'.
+ 0x32718268, // Large 'vpmadd52|luq'.
+ 0x43856268, // Large 'vpmadd|ubsw'.
+ 0x239C6268, // Large 'vpmadd|wd'.
+ 0x62434268, // Large 'vpma|skmovd'.
+ 0x200E8389, // Large 'vpmaskmo|vq'.
+ 0x25BA57F0, // Large 'vpmax|sb'.
+ 0x214457F0, // Large 'vpmax|sd'.
+ 0x23A957F0, // Large 'vpmax|sq'.
+ 0x238357F0, // Large 'vpmax|sw'.
+ 0x209D57F0, // Large 'vpmax|ub'.
+ 0x22E557F0, // Large 'vpmax|ud'.
+ 0x21F557F0, // Large 'vpmax|uq'.
+ 0x248157F0, // Large 'vpmax|uw'.
+ 0x25BA57F5, // Large 'vpmin|sb'.
+ 0x214457F5, // Large 'vpmin|sd'.
+ 0x23A957F5, // Large 'vpmin|sq'.
+ 0x238357F5, // Large 'vpmin|sw'.
+ 0x209D57F5, // Large 'vpmin|ub'.
+ 0x22E557F5, // Large 'vpmin|ud'.
+ 0x21F557F5, // Large 'vpmin|uq'.
+ 0x248157F5, // Large 'vpmin|uw'.
+ 0x36A15542, // Large 'vpmov|b2m'.
+ 0x36A45542, // Large 'vpmov|d2m'.
+ 0x24985542, // Large 'vpmov|db'.
+ 0x24F15542, // Large 'vpmov|dw'.
+ 0x268D6542, // Large 'vpmovm|2b'.
+ 0x20606542, // Large 'vpmovm|2d'.
+ 0x268F6542, // Large 'vpmovm|2q'.
+ 0x205E6542, // Large 'vpmovm|2w'.
+ 0x10108542, // Large 'vpmovmsk|b'.
+ 0x36A75542, // Large 'vpmov|q2m'.
+ 0x200F5542, // Large 'vpmov|qb'.
+ 0x227D5542, // Large 'vpmov|qd'.
+ 0x25595542, // Large 'vpmov|qw'.
+ 0x2498654A, // Large 'vpmovs|db'.
+ 0x24F1654A, // Large 'vpmovs|dw'.
+ 0x200F654A, // Large 'vpmovs|qb'.
+ 0x227D654A, // Large 'vpmovs|qd'.
+ 0x2559654A, // Large 'vpmovs|qw'.
+ 0x24F2654A, // Large 'vpmovs|wb'.
+ 0x1026854A, // Large 'vpmovsxb|d'.
+ 0x100F854A, // Large 'vpmovsxb|q'.
+ 0x105F854A, // Large 'vpmovsxb|w'.
+ 0x20E5754A, // Large 'vpmovsx|dq'.
+ 0x239C754A, // Large 'vpmovsx|wd'.
+ 0x253D754A, // Large 'vpmovsx|wq'.
+ 0x24987552, // Large 'vpmovus|db'.
+ 0x24F17552, // Large 'vpmovus|dw'.
+ 0x200F7552, // Large 'vpmovus|qb'.
+ 0x227D7552, // Large 'vpmovus|qd'.
+ 0x25597552, // Large 'vpmovus|qw'.
+ 0x24F27552, // Large 'vpmovus|wb'.
+ 0x36AA5542, // Large 'vpmov|w2m'.
+ 0x24F25542, // Large 'vpmov|wb'.
+ 0x1026855B, // Large 'vpmovzxb|d'.
+ 0x100F855B, // Large 'vpmovzxb|q'.
+ 0x105F855B, // Large 'vpmovzxb|w'.
+ 0x20E5755B, // Large 'vpmovzx|dq'.
+ 0x239C755B, // Large 'vpmovzx|wd'.
+ 0x253D755B, // Large 'vpmovzx|wq'.
+ 0x20E550CE, // Large 'vpmul|dq'.
+ 0x23837563, // Large 'vpmulhr|sw'.
+ 0x24816563, // Large 'vpmulh|uw'.
+ 0x105F6563, // Large 'vpmulh|w'.
+ 0x23A150CE, // Large 'vpmul|ld'.
+ 0x228850CE, // Large 'vpmul|lq'.
+ 0x23A450CE, // Large 'vpmul|lw'.
+ 0x200FC0CE, // Large 'vpmultishift|qb'.
+ 0x32E550CE, // Large 'vpmul|udq'.
+ 0x268266AD, // Large 'vpopcn|tb'.
+ 0x245566AD, // Large 'vpopcn|td'.
+ 0x219366AD, // Large 'vpopcn|tq'.
+ 0x264366AD, // Large 'vpopcn|tw'.
+ 0x80093E16, // Small 'vpor'.
+ 0x80493E16, // Small 'vpord'.
+ 0x81193E16, // Small 'vporq'.
+ 0x9B22C216, // Small 'vpperm'.
+ 0x88C7CA16, // Small 'vprold'.
+ 0xA2C7CA16, // Small 'vprolq'.
+ 0x224757FA, // Large 'vprol|vd'.
+ 0x200E57FA, // Large 'vprol|vq'.
+ 0x8927CA16, // Small 'vprord'.
+ 0xA327CA16, // Small 'vprorq'.
+ 0x224757FF, // Large 'vpror|vd'.
+ 0x200E57FF, // Large 'vpror|vq'.
+ 0x8547CA16, // Small 'vprotb'.
+ 0x8947CA16, // Small 'vprotd'.
+ 0xA347CA16, // Small 'vprotq'.
+ 0xAF47CA16, // Small 'vprotw'.
+ 0x239A5804, // Large 'vpsad|bw'.
+ 0x209A9274, // Large 'vpscatter|dd'.
+ 0x20E59274, // Large 'vpscatter|dq'.
+ 0x227D9274, // Large 'vpscatter|qd'.
+ 0x100FA274, // Large 'vpscatterq|q'.
+ 0x84144E16, // Small 'vpshab'.
+ 0x88144E16, // Small 'vpshad'.
+ 0xA2144E16, // Small 'vpshaq'.
+ 0xAE144E16, // Small 'vpshaw'.
+ 0x84C44E16, // Small 'vpshlb'.
+ 0x88C44E16, // Small 'vpshld'.
+ 0x102666B3, // Large 'vpshld|d'.
+ 0x100F66B3, // Large 'vpshld|q'.
+ 0x349D56B3, // Large 'vpshl|dvd'.
+ 0x36B856B3, // Large 'vpshl|dvq'.
+ 0x105F76B3, // Large 'vpshldv|w'.
+ 0x105F66B3, // Large 'vpshld|w'.
+ 0xA2C44E16, // Small 'vpshlq'.
+ 0xAEC44E16, // Small 'vpshlw'.
+ 0x102666BB, // Large 'vpshrd|d'.
+ 0x100F66BB, // Large 'vpshrd|q'.
+ 0x349D56BB, // Large 'vpshr|dvd'.
+ 0x36B856BB, // Large 'vpshr|dvq'.
+ 0x36C056BB, // Large 'vpshr|dvw'.
+ 0x105F66BB, // Large 'vpshrd|w'.
+ 0x0000718B, // Large 'vpshufb'.
+ 0x205CA18B, // Large 'vpshufbitq|mb'.
+ 0x1026618B, // Large 'vpshuf|d'.
+ 0x26C3618B, // Large 'vpshuf|hw'.
+ 0x23A4618B, // Large 'vpshuf|lw'.
+ 0x22A95809, // Large 'vpsig|nb'.
+ 0x219D5809, // Large 'vpsig|nd'.
+ 0x26FB5809, // Large 'vpsig|nw'.
+ 0x88C64E16, // Small 'vpslld'.
+ 0x33A1480E, // Large 'vpsl|ldq'.
+ 0xA2C64E16, // Small 'vpsllq'.
+ 0x22475812, // Large 'vpsll|vd'.
+ 0x200E5812, // Large 'vpsll|vq'.
+ 0x26C15812, // Large 'vpsll|vw'.
+ 0xAEC64E16, // Small 'vpsllw'.
+ 0x88194E16, // Small 'vpsrad'.
+ 0xA2194E16, // Small 'vpsraq'.
+ 0x22475817, // Large 'vpsra|vd'.
+ 0x200E5817, // Large 'vpsra|vq'.
+ 0x26C15817, // Large 'vpsra|vw'.
+ 0xAE194E16, // Small 'vpsraw'.
+ 0x88C94E16, // Small 'vpsrld'.
+ 0x33A14817, // Large 'vpsr|ldq'.
+ 0xA2C94E16, // Small 'vpsrlq'.
+ 0x2247581C, // Large 'vpsrl|vd'.
+ 0x200E581C, // Large 'vpsrl|vq'.
+ 0x26C1581C, // Large 'vpsrl|vw'.
+ 0xAEC94E16, // Small 'vpsrlw'.
+ 0x842ACE16, // Small 'vpsubb'.
+ 0x882ACE16, // Small 'vpsubd'.
+ 0xA22ACE16, // Small 'vpsubq'.
+ 0x25BA56C5, // Large 'vpsub|sb'.
+ 0x238356C5, // Large 'vpsub|sw'.
+ 0x25BA66C5, // Large 'vpsubu|sb'.
+ 0x238366C5, // Large 'vpsubu|sw'.
+ 0xAE2ACE16, // Small 'vpsubw'.
+ 0x10269391, // Large 'vpternlog|d'.
+ 0x100F9391, // Large 'vpternlog|q'.
+ 0xA932D216, // Small 'vptest'.
+ 0x205C656A, // Large 'vptest|mb'.
+ 0x2504656A, // Large 'vptest|md'.
+ 0x2571656A, // Large 'vptest|mq'.
+ 0x26A9656A, // Large 'vptest|mw'.
+ 0x205C756A, // Large 'vptestn|mb'.
+ 0x2504756A, // Large 'vptestn|md'.
+ 0x2571756A, // Large 'vptestn|mq'.
+ 0x105F856A, // Large 'vptestnm|w'.
+ 0x239A827F, // Large 'vpunpckh|bw'.
+ 0x20E5827F, // Large 'vpunpckh|dq'.
+ 0x20E5927F, // Large 'vpunpckhq|dq'.
+ 0x239C827F, // Large 'vpunpckh|wd'.
+ 0x339E727F, // Large 'vpunpck|lbw'.
+ 0x33A1727F, // Large 'vpunpck|ldq'.
+ 0x4288727F, // Large 'vpunpck|lqdq'.
+ 0x33A4727F, // Large 'vpunpck|lwd'.
+ 0x8127E216, // Small 'vpxor'.
+ 0x8927E216, // Small 'vpxord'.
+ 0xA327E216, // Small 'vpxorq'.
+ 0x20A766CB, // Large 'vrange|pd'.
+ 0x207D66CB, // Large 'vrange|ps'.
+ 0x214466CB, // Large 'vrange|sd'.
+ 0x201C66CB, // Large 'vrange|ss'.
+ 0x20A766D1, // Large 'vrcp14|pd'.
+ 0x207D66D1, // Large 'vrcp14|ps'.
+ 0x214466D1, // Large 'vrcp14|sd'.
+ 0x201C66D1, // Large 'vrcp14|ss'.
+ 0x43AF46D1, // Large 'vrcp|28pd'.
+ 0x43B346D1, // Large 'vrcp|28ps'.
+ 0x43B746D1, // Large 'vrcp|28sd'.
+ 0x43BB46D1, // Large 'vrcp|28ss'.
+ 0x91080E56, // Small 'vrcpph'.
+ 0xA7080E56, // Small 'vrcpps'.
+ 0x91380E56, // Small 'vrcpsh'.
+ 0xA7380E56, // Small 'vrcpss'.
+ 0x20A77573, // Large 'vreduce|pd'.
+ 0x20A27573, // Large 'vreduce|ph'.
+ 0x207D7573, // Large 'vreduce|ps'.
+ 0x21447573, // Large 'vreduce|sd'.
+ 0x20D57573, // Large 'vreduce|sh'.
+ 0x201C7573, // Large 'vreduce|ss'.
+ 0x20A7928C, // Large 'vrndscale|pd'.
+ 0x20A2928C, // Large 'vrndscale|ph'.
+ 0x207D928C, // Large 'vrndscale|ps'.
+ 0x2144928C, // Large 'vrndscale|sd'.
+ 0x20D5928C, // Large 'vrndscale|sh'.
+ 0x201C928C, // Large 'vrndscale|ss'.
+ 0x30ED56D7, // Large 'vroun|dpd'.
+ 0x30F156D7, // Large 'vroun|dps'.
+ 0x36DC56D7, // Large 'vroun|dsd'.
+ 0x101476D7, // Large 'vrounds|s'.
+ 0x20A783A7, // Large 'vrsqrt14|pd'.
+ 0x207D83A7, // Large 'vrsqrt14|ps'.
+ 0x214483A7, // Large 'vrsqrt14|sd'.
+ 0x201C83A7, // Large 'vrsqrt14|ss'.
+ 0x43AF63A7, // Large 'vrsqrt|28pd'.
+ 0x43B363A7, // Large 'vrsqrt|28ps'.
+ 0x43B763A7, // Large 'vrsqrt|28sd'.
+ 0x43BB63A7, // Large 'vrsqrt|28ss'.
+ 0x20A263A7, // Large 'vrsqrt|ph'.
+ 0x207D63A7, // Large 'vrsqrt|ps'.
+ 0x20D563A7, // Large 'vrsqrt|sh'.
+ 0x201C63A7, // Large 'vrsqrt|ss'.
+ 0x20A7757A, // Large 'vscalef|pd'.
+ 0x20A2757A, // Large 'vscalef|ph'.
+ 0x207D757A, // Large 'vscalef|ps'.
+ 0x2144757A, // Large 'vscalef|sd'.
+ 0x20D5757A, // Large 'vscalef|sh'.
+ 0x201C757A, // Large 'vscalef|ss'.
+ 0x30ED80DA, // Large 'vscatter|dpd'.
+ 0x30F180DA, // Large 'vscatter|dps'.
+ 0x20A7C0DA, // Large 'vscatterpf0d|pd'.
+ 0x207DC0DA, // Large 'vscatterpf0d|ps'.
+ 0x30E6B0DA, // Large 'vscatterpf0|qpd'.
+ 0x30E9B0DA, // Large 'vscatterpf0|qps'.
+ 0x40ECA0DA, // Large 'vscatterpf|1dpd'.
+ 0x40F0A0DA, // Large 'vscatterpf|1dps'.
+ 0x40F4A0DA, // Large 'vscatterpf|1qpd'.
+ 0x40F8A0DA, // Large 'vscatterpf|1qps'.
+ 0x30E680DA, // Large 'vscatter|qpd'.
+ 0x30E980DA, // Large 'vscatter|qps'.
+ 0x42957195, // Large 'vsha512|msg1'.
+ 0x42997195, // Large 'vsha512|msg2'.
+ 0x207EA195, // Large 'vsha512rnd|s2'.
+ 0x502B53BF, // Large 'vshuf|f32x4'.
+ 0x403063C4, // Large 'vshuff|64x2'.
+ 0x503D53BF, // Large 'vshuf|i32x4'.
+ 0x504753BF, // Large 'vshuf|i64x2'.
+ 0x20A753BF, // Large 'vshuf|pd'.
+ 0x207D53BF, // Large 'vshuf|ps'.
+ 0x42954581, // Large 'vsm3|msg1'.
+ 0x42994581, // Large 'vsm3|msg2'.
+ 0x207E7581, // Large 'vsm3rnd|s2'.
+ 0x102F76DF, // Large 'vsm4key|4'.
+ 0x102F8588, // Large 'vsm4rnds|4'.
+ 0x31F14821, // Large 'vsqr|tpd'.
+ 0x31FC4821, // Large 'vsqr|tph'.
+ 0x32054821, // Large 'vsqr|tps'.
+ 0x320E4821, // Large 'vsqr|tsd'.
+ 0x32174821, // Large 'vsqr|tsh'.
+ 0x32204821, // Large 'vsqr|tss'.
+ 0x102376E6, // Large 'vstmxcs|r'.
+ 0x89015676, // Small 'vsubpd'.
+ 0x91015676, // Small 'vsubph'.
+ 0xA7015676, // Small 'vsubps'.
+ 0x89315676, // Small 'vsubsd'.
+ 0x91315676, // Small 'vsubsh'.
+ 0xA7315676, // Small 'vsubss'.
+ 0x31F14825, // Large 'vtes|tpd'.
+ 0x32054825, // Large 'vtes|tps'.
+ 0x214466ED, // Large 'vucomi|sd'.
+ 0x20D566ED, // Large 'vucomi|sh'.
+ 0x201C66ED, // Large 'vucomi|ss'.
+ 0x20A77590, // Large 'vunpckh|pd'.
+ 0x207D7590, // Large 'vunpckh|ps'.
+ 0x35976590, // Large 'vunpck|lpd'.
+ 0x359A6590, // Large 'vunpck|lps'.
+ 0x89093F16, // Small 'vxorpd'.
+ 0xA7093F16, // Small 'vxorps'.
+ 0x36F353CA, // Large 'vzero|all'.
+ 0x335D73CA, // Large 'vzeroup|per'.
+ 0x89672457, // Small 'wbinvd'.
+ 0x224766F6, // Large 'wbnoin|vd'.
+ 0x343656FC, // Large 'wrfsb|ase'.
+ 0x34365701, // Large 'wrgsb|ase'.
+ 0x8129B657, // Small 'wrmsr'.
+ 0x8049CE57, // Small 'wrssd'.
+ 0x8119CE57, // Small 'wrssq'.
+ 0x8939D657, // Small 'wrussd'.
+ 0xA339D657, // Small 'wrussq'.
+ 0xA9278838, // Small 'xabort'.
+ 0x80021038, // Small 'xadd'.
+ 0x9C939458, // Small 'xbegin'.
+ 0x8003A078, // Small 'xchg'.
+ 0x800238B8, // Small 'xend'.
+ 0xAC2A14F8, // Small 'xgetbv'.
+ 0x802A0598, // Small 'xlatb'.
+ 0x800049F8, // Small 'xor'.
+ 0x804849F8, // Small 'xorpd'.
+ 0x813849F8, // Small 'xorps'.
+ 0x1015859D, // Large 'xresldtr|k'.
+ 0xA4FA4E58, // Small 'xrstor'.
+ 0x2030640C, // Large 'xrstor|64'.
+ 0x1014640C, // Large 'xrstor|s'.
+ 0x35A5640C, // Large 'xrstor|s64'.
+ 0x805B0678, // Small 'xsave'.
+ 0x203053D1, // Large 'xsave|64'.
+ 0x865B0678, // Small 'xsavec'.
+ 0x370653D1, // Large 'xsave|c64'.
+ 0x000083D1, // Large 'xsaveopt'.
+ 0x203083D1, // Large 'xsaveopt|64'.
+ 0xA65B0678, // Small 'xsaves'.
+ 0x35A553D1, // Large 'xsave|s64'.
+ 0xAC2A1678, // Small 'xsetbv'.
+ 0x101585A8, // Large 'xsusldtr|k'.
+ 0x81499698 // Small 'xtest'.
};
// ----------------------------------------------------------------------------
// ${NameData:End}
@@ -3054,515 +4729,573 @@ const InstDB::InstSignature InstDB::_instSignatureTable[] = {
ROW(2, 1, 1, 0, 9 , 10 , 0 , 0 , 0 , 0 ), // {r8lo|r8hi|m8, i8|u8}
ROW(2, 1, 1, 0, 11 , 12 , 0 , 0 , 0 , 0 ), // {r16|m16, i16|u16}
ROW(2, 1, 1, 0, 13 , 14 , 0 , 0 , 0 , 0 ), // {r32|m32, i32|u32}
- ROW(2, 0, 1, 0, 15 , 16 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, i32}
+ ROW(2, 0, 1, 0, 15 , 16 , 0 , 0 , 0 , 0 ), // {r64|m64, i32}
ROW(2, 0, 1, 0, 8 , 17 , 0 , 0 , 0 , 0 ), // {r64, i64|u64|m64|mem|sreg|creg|dreg}
ROW(2, 1, 1, 0, 2 , 18 , 0 , 0 , 0 , 0 ), // {r8lo|r8hi, m8|mem}
ROW(2, 1, 1, 0, 4 , 19 , 0 , 0 , 0 , 0 ), // {r16, m16|mem|sreg}
ROW(2, 1, 1, 0, 6 , 20 , 0 , 0 , 0 , 0 ), // {r32, m32|mem|sreg}
ROW(2, 1, 1, 0, 21 , 22 , 0 , 0 , 0 , 0 ), // {m16|mem, sreg}
+ ROW(2, 1, 1, 0, 21 , 22 , 0 , 0 , 0 , 0 ), // {m16|mem, sreg}
+ ROW(2, 0, 1, 0, 21 , 22 , 0 , 0 , 0 , 0 ), // {m16|mem, sreg}
ROW(2, 1, 1, 0, 22 , 21 , 0 , 0 , 0 , 0 ), // {sreg, m16|mem}
+ ROW(2, 1, 1, 0, 22 , 21 , 0 , 0 , 0 , 0 ), // {sreg, m16|mem}
+ ROW(2, 0, 1, 0, 22 , 21 , 0 , 0 , 0 , 0 ), // {sreg, m16|mem}
ROW(2, 1, 0, 0, 6 , 23 , 0 , 0 , 0 , 0 ), // {r32, creg|dreg}
ROW(2, 1, 0, 0, 23 , 6 , 0 , 0 , 0 , 0 ), // {creg|dreg, r32}
- ROW(2, 1, 1, 0, 9 , 10 , 0 , 0 , 0 , 0 ), // #16 {r8lo|r8hi|m8, i8|u8}
+ ROW(2, 1, 1, 0, 9 , 10 , 0 , 0 , 0 , 0 ), // #20 {r8lo|r8hi|m8, i8|u8}
ROW(2, 1, 1, 0, 11 , 12 , 0 , 0 , 0 , 0 ), // {r16|m16, i16|u16}
ROW(2, 1, 1, 0, 13 , 14 , 0 , 0 , 0 , 0 ), // {r32|m32, i32|u32}
- ROW(2, 0, 1, 0, 15 , 24 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, i32|r64}
- ROW(2, 1, 1, 0, 25 , 26 , 0 , 0 , 0 , 0 ), // {r16|m16|r32|m32|r64|m64|mem, i8}
- ROW(2, 1, 1, 0, 1 , 2 , 0 , 0 , 0 , 0 ), // {r8lo|r8hi|m8|mem, r8lo|r8hi}
+ ROW(2, 0, 1, 0, 15 , 24 , 0 , 0 , 0 , 0 ), // {r64|m64, i32|i8}
+ ROW(2, 1, 1, 0, 25 , 26 , 0 , 0 , 0 , 0 ), // {r16|m16|r32|m32, i8}
+ ROW(2, 1, 1, 0, 1 , 2 , 0 , 0 , 0 , 0 ), // #25 {r8lo|r8hi|m8|mem, r8lo|r8hi}
ROW(2, 1, 1, 0, 27 , 4 , 0 , 0 , 0 , 0 ), // {r16|m16|mem, r16}
- ROW(2, 1, 1, 0, 28 , 6 , 0 , 0 , 0 , 0 ), // #23 {r32|m32|mem, r32}
+ ROW(2, 1, 1, 0, 28 , 6 , 0 , 0 , 0 , 0 ), // #27 {r32|m32|mem, r32}
+ ROW(2, 0, 1, 0, 29 , 8 , 0 , 0 , 0 , 0 ), // #28 {r64|m64|mem, r64}
ROW(2, 1, 1, 0, 2 , 18 , 0 , 0 , 0 , 0 ), // {r8lo|r8hi, m8|mem}
ROW(2, 1, 1, 0, 4 , 21 , 0 , 0 , 0 , 0 ), // {r16, m16|mem}
- ROW(2, 1, 1, 0, 6 , 29 , 0 , 0 , 0 , 0 ), // {r32, m32|mem}
- ROW(2, 0, 1, 0, 8 , 30 , 0 , 0 , 0 , 0 ), // {r64, m64|mem}
- ROW(2, 1, 1, 0, 31 , 10 , 0 , 0 , 0 , 0 ), // #28 {r8lo|r8hi|m8|r16|m16|r32|m32|r64|m64|mem, i8|u8}
+ ROW(2, 1, 1, 0, 6 , 30 , 0 , 0 , 0 , 0 ), // {r32, m32|mem}
+ ROW(2, 0, 1, 0, 8 , 31 , 0 , 0 , 0 , 0 ), // {r64, m64|mem}
+ ROW(2, 1, 1, 0, 32 , 10 , 0 , 0 , 0 , 0 ), // #33 {r8lo|r8hi|m8|r16|m16|r32|m32, i8|u8}
ROW(2, 1, 1, 0, 11 , 12 , 0 , 0 , 0 , 0 ), // {r16|m16, i16|u16}
ROW(2, 1, 1, 0, 13 , 14 , 0 , 0 , 0 , 0 ), // {r32|m32, i32|u32}
- ROW(2, 0, 1, 0, 8 , 32 , 0 , 0 , 0 , 0 ), // {r64, u32|i32|r64|m64|mem}
- ROW(2, 0, 1, 0, 30 , 24 , 0 , 0 , 0 , 0 ), // {m64|mem, i32|r64}
+ ROW(2, 0, 1, 0, 8 , 33 , 0 , 0 , 0 , 0 ), // {r64, u32|i32|i8|u8|r64|m64|mem}
+ ROW(2, 0, 1, 0, 34 , 35 , 0 , 0 , 0 , 0 ), // {m64, i32|i8|u8}
ROW(2, 1, 1, 0, 1 , 2 , 0 , 0 , 0 , 0 ), // {r8lo|r8hi|m8|mem, r8lo|r8hi}
ROW(2, 1, 1, 0, 27 , 4 , 0 , 0 , 0 , 0 ), // {r16|m16|mem, r16}
ROW(2, 1, 1, 0, 28 , 6 , 0 , 0 , 0 , 0 ), // {r32|m32|mem, r32}
+ ROW(2, 0, 1, 0, 31 , 8 , 0 , 0 , 0 , 0 ), // {m64|mem, r64}
ROW(2, 1, 1, 0, 2 , 18 , 0 , 0 , 0 , 0 ), // {r8lo|r8hi, m8|mem}
ROW(2, 1, 1, 0, 4 , 21 , 0 , 0 , 0 , 0 ), // {r16, m16|mem}
- ROW(2, 1, 1, 0, 6 , 29 , 0 , 0 , 0 , 0 ), // {r32, m32|mem}
- ROW(2, 1, 1, 1, 33 , 1 , 0 , 0 , 0 , 0 ), // #39 {<ax>, r8lo|r8hi|m8|mem}
- ROW(3, 1, 1, 2, 34 , 33 , 27 , 0 , 0 , 0 ), // {<dx>, <ax>, r16|m16|mem}
- ROW(3, 1, 1, 2, 35 , 36 , 28 , 0 , 0 , 0 ), // {<edx>, <eax>, r32|m32|mem}
- ROW(3, 0, 1, 2, 37 , 38 , 15 , 0 , 0 , 0 ), // {<rdx>, <rax>, r64|m64|mem}
- ROW(2, 1, 1, 0, 4 , 39 , 0 , 0 , 0 , 0 ), // {r16, r16|m16|mem|i8|i16}
- ROW(2, 1, 1, 0, 6 , 40 , 0 , 0 , 0 , 0 ), // {r32, r32|m32|mem|i8|i32}
- ROW(2, 0, 1, 0, 8 , 41 , 0 , 0 , 0 , 0 ), // {r64, r64|m64|mem|i8|i32}
+ ROW(2, 1, 1, 0, 6 , 30 , 0 , 0 , 0 , 0 ), // {r32, m32|mem}
+ ROW(2, 1, 1, 1, 36 , 1 , 0 , 0 , 0 , 0 ), // #45 {<ax>, r8lo|r8hi|m8|mem}
+ ROW(3, 1, 1, 2, 37 , 36 , 27 , 0 , 0 , 0 ), // {<dx>, <ax>, r16|m16|mem}
+ ROW(3, 1, 1, 2, 38 , 39 , 28 , 0 , 0 , 0 ), // {<edx>, <eax>, r32|m32|mem}
+ ROW(3, 0, 1, 2, 40 , 41 , 29 , 0 , 0 , 0 ), // {<rdx>, <rax>, r64|m64|mem}
+ ROW(2, 1, 1, 0, 4 , 27 , 0 , 0 , 0 , 0 ), // #49 {r16, r16|m16|mem}
+ ROW(2, 1, 1, 0, 6 , 28 , 0 , 0 , 0 , 0 ), // #50 {r32, r32|m32|mem}
+ ROW(2, 0, 1, 0, 8 , 29 , 0 , 0 , 0 , 0 ), // {r64, r64|m64|mem}
ROW(3, 1, 1, 0, 4 , 27 , 42 , 0 , 0 , 0 ), // {r16, r16|m16|mem, i8|i16|u16}
ROW(3, 1, 1, 0, 6 , 28 , 43 , 0 , 0 , 0 ), // {r32, r32|m32|mem, i8|i32|u32}
- ROW(3, 0, 1, 0, 8 , 15 , 44 , 0 , 0 , 0 ), // {r64, r64|m64|mem, i8|i32}
- ROW(2, 0, 1, 0, 8 , 45 , 0 , 0 , 0 , 0 ), // #49 {r64, i64|u64}
- ROW(2, 0, 1, 0, 46 , 18 , 0 , 0 , 0 , 0 ), // {al, m8|mem}
- ROW(2, 0, 1, 0, 47 , 21 , 0 , 0 , 0 , 0 ), // {ax, m16|mem}
- ROW(2, 0, 1, 0, 48 , 29 , 0 , 0 , 0 , 0 ), // {eax, m32|mem}
- ROW(2, 0, 1, 0, 49 , 30 , 0 , 0 , 0 , 0 ), // {rax, m64|mem}
- ROW(2, 0, 1, 0, 18 , 46 , 0 , 0 , 0 , 0 ), // {m8|mem, al}
- ROW(2, 0, 1, 0, 21 , 47 , 0 , 0 , 0 , 0 ), // {m16|mem, ax}
- ROW(2, 0, 1, 0, 29 , 48 , 0 , 0 , 0 , 0 ), // {m32|mem, eax}
- ROW(2, 0, 1, 0, 30 , 49 , 0 , 0 , 0 , 0 ), // {m64|mem, rax}
- ROW(2, 1, 1, 0, 1 , 2 , 0 , 0 , 0 , 0 ), // #58 {r8lo|r8hi|m8|mem, r8lo|r8hi}
- ROW(2, 1, 1, 0, 27 , 4 , 0 , 0 , 0 , 0 ), // {r16|m16|mem, r16}
- ROW(2, 1, 1, 0, 28 , 6 , 0 , 0 , 0 , 0 ), // {r32|m32|mem, r32}
- ROW(2, 0, 1, 0, 15 , 8 , 0 , 0 , 0 , 0 ), // #61 {r64|m64|mem, r64}
- ROW(2, 1, 1, 0, 2 , 18 , 0 , 0 , 0 , 0 ), // {r8lo|r8hi, m8|mem}
- ROW(2, 1, 1, 0, 4 , 21 , 0 , 0 , 0 , 0 ), // {r16, m16|mem}
- ROW(2, 1, 1, 0, 6 , 29 , 0 , 0 , 0 , 0 ), // {r32, m32|mem}
- ROW(2, 0, 1, 0, 8 , 30 , 0 , 0 , 0 , 0 ), // {r64, m64|mem}
- ROW(2, 1, 1, 0, 9 , 10 , 0 , 0 , 0 , 0 ), // #66 {r8lo|r8hi|m8, i8|u8}
+ ROW(3, 0, 1, 0, 8 , 29 , 24 , 0 , 0 , 0 ), // {r64, r64|m64|mem, i8|i32}
+ ROW(2, 0, 1, 0, 8 , 44 , 0 , 0 , 0 , 0 ), // #55 {r64, i64|u64}
+ ROW(2, 1, 1, 0, 45 , 18 , 0 , 0 , 0 , 0 ), // {al, m8|mem}
+ ROW(2, 1, 1, 0, 46 , 21 , 0 , 0 , 0 , 0 ), // {ax, m16|mem}
+ ROW(2, 1, 1, 0, 47 , 30 , 0 , 0 , 0 , 0 ), // {eax, m32|mem}
+ ROW(2, 0, 1, 0, 48 , 31 , 0 , 0 , 0 , 0 ), // {rax, m64|mem}
+ ROW(2, 1, 1, 0, 18 , 45 , 0 , 0 , 0 , 0 ), // {m8|mem, al}
+ ROW(2, 1, 1, 0, 21 , 46 , 0 , 0 , 0 , 0 ), // {m16|mem, ax}
+ ROW(2, 1, 1, 0, 30 , 47 , 0 , 0 , 0 , 0 ), // {m32|mem, eax}
+ ROW(2, 0, 1, 0, 31 , 48 , 0 , 0 , 0 , 0 ), // {m64|mem, rax}
+ ROW(2, 1, 1, 0, 9 , 10 , 0 , 0 , 0 , 0 ), // #64 {r8lo|r8hi|m8, i8|u8}
ROW(2, 1, 1, 0, 11 , 12 , 0 , 0 , 0 , 0 ), // {r16|m16, i16|u16}
ROW(2, 1, 1, 0, 13 , 14 , 0 , 0 , 0 , 0 ), // {r32|m32, i32|u32}
- ROW(2, 0, 1, 0, 15 , 24 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, i32|r64}
+ ROW(2, 0, 1, 0, 15 , 16 , 0 , 0 , 0 , 0 ), // {r64|m64, i32}
ROW(2, 1, 1, 0, 1 , 2 , 0 , 0 , 0 , 0 ), // {r8lo|r8hi|m8|mem, r8lo|r8hi}
ROW(2, 1, 1, 0, 27 , 4 , 0 , 0 , 0 , 0 ), // {r16|m16|mem, r16}
ROW(2, 1, 1, 0, 28 , 6 , 0 , 0 , 0 , 0 ), // {r32|m32|mem, r32}
- ROW(2, 1, 1, 0, 4 , 21 , 0 , 0 , 0 , 0 ), // #73 {r16, m16|mem}
- ROW(2, 1, 1, 0, 6 , 29 , 0 , 0 , 0 , 0 ), // {r32, m32|mem}
- ROW(2, 0, 1, 0, 8 , 30 , 0 , 0 , 0 , 0 ), // {r64, m64|mem}
+ ROW(2, 0, 1, 0, 29 , 8 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, r64}
+ ROW(2, 1, 1, 0, 49 , 50 , 0 , 0 , 0 , 0 ), // #72 {xmm, xmm|m128|mem}
+ ROW(2, 1, 1, 0, 51 , 49 , 0 , 0 , 0 , 0 ), // #73 {m128|mem, xmm}
+ ROW(2, 1, 1, 0, 52 , 53 , 0 , 0 , 0 , 0 ), // {ymm, ymm|m256|mem}
+ ROW(2, 1, 1, 0, 54 , 52 , 0 , 0 , 0 , 0 ), // {m256|mem, ymm}
+ ROW(2, 1, 1, 0, 51 , 49 , 0 , 0 , 0 , 0 ), // {m128|mem, xmm}
+ ROW(2, 1, 1, 0, 54 , 52 , 0 , 0 , 0 , 0 ), // {m256|mem, ymm}
+ ROW(2, 1, 1, 0, 55 , 56 , 0 , 0 , 0 , 0 ), // #78 {zmm, zmm|m512|mem}
+ ROW(2, 1, 1, 0, 57 , 55 , 0 , 0 , 0 , 0 ), // {m512|mem, zmm}
+ ROW(2, 1, 1, 0, 31 , 49 , 0 , 0 , 0 , 0 ), // #80 {m64|mem, xmm}
+ ROW(2, 1, 1, 0, 49 , 31 , 0 , 0 , 0 , 0 ), // {xmm, m64|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // #82 {xmm, xmm, xmm}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
+ ROW(2, 1, 1, 0, 31 , 49 , 0 , 0 , 0 , 0 ), // {m64|mem, xmm}
+ ROW(2, 1, 1, 0, 49 , 31 , 0 , 0 , 0 , 0 ), // {xmm, m64|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
+ ROW(2, 1, 1, 0, 30 , 49 , 0 , 0 , 0 , 0 ), // #88 {m32|mem, xmm}
+ ROW(2, 1, 1, 0, 49 , 30 , 0 , 0 , 0 , 0 ), // {xmm, m32|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
+ ROW(2, 1, 1, 0, 30 , 49 , 0 , 0 , 0 , 0 ), // {m32|mem, xmm}
+ ROW(2, 1, 1, 0, 49 , 30 , 0 , 0 , 0 , 0 ), // {xmm, m32|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
+ ROW(3, 1, 1, 0, 49 , 49 , 58 , 0 , 0 , 0 ), // #96 {xmm, xmm, xmm|m128|mem|i8|u8}
+ ROW(3, 1, 1, 0, 49 , 51 , 10 , 0 , 0 , 0 ), // {xmm, m128|mem, i8|u8}
+ ROW(3, 1, 1, 0, 52 , 52 , 59 , 0 , 0 , 0 ), // {ymm, ymm, ymm|m256|mem|i8|u8}
+ ROW(3, 1, 1, 0, 52 , 54 , 10 , 0 , 0 , 0 ), // {ymm, m256|mem, i8|u8}
+ ROW(3, 1, 1, 0, 55 , 55 , 60 , 0 , 0 , 0 ), // {zmm, zmm, zmm|m512|mem|i8|u8}
+ ROW(3, 1, 1, 0, 49 , 51 , 10 , 0 , 0 , 0 ), // {xmm, m128|mem, i8|u8}
+ ROW(3, 1, 1, 0, 52 , 54 , 10 , 0 , 0 , 0 ), // {ymm, m256|mem, i8|u8}
+ ROW(3, 1, 1, 0, 55 , 57 , 10 , 0 , 0 , 0 ), // {zmm, m512|mem, i8|u8}
+ ROW(2, 1, 1, 0, 4 , 21 , 0 , 0 , 0 , 0 ), // #104 {r16, m16|mem}
+ ROW(2, 1, 1, 0, 6 , 30 , 0 , 0 , 0 , 0 ), // {r32, m32|mem}
+ ROW(2, 0, 1, 0, 8 , 31 , 0 , 0 , 0 , 0 ), // {r64, m64|mem}
ROW(2, 1, 1, 0, 21 , 4 , 0 , 0 , 0 , 0 ), // {m16|mem, r16}
- ROW(2, 1, 1, 0, 29 , 6 , 0 , 0 , 0 , 0 ), // #77 {m32|mem, r32}
- ROW(2, 0, 1, 0, 30 , 8 , 0 , 0 , 0 , 0 ), // {m64|mem, r64}
- ROW(2, 1, 1, 0, 50 , 51 , 0 , 0 , 0 , 0 ), // #79 {xmm, xmm|m128|mem}
- ROW(2, 1, 1, 0, 52 , 50 , 0 , 0 , 0 , 0 ), // #80 {m128|mem, xmm}
- ROW(2, 1, 1, 0, 53 , 54 , 0 , 0 , 0 , 0 ), // {ymm, ymm|m256|mem}
- ROW(2, 1, 1, 0, 55 , 53 , 0 , 0 , 0 , 0 ), // {m256|mem, ymm}
- ROW(2, 1, 1, 0, 56 , 57 , 0 , 0 , 0 , 0 ), // #83 {zmm, zmm|m512|mem}
- ROW(2, 1, 1, 0, 58 , 56 , 0 , 0 , 0 , 0 ), // {m512|mem, zmm}
- ROW(3, 1, 1, 0, 50 , 50 , 59 , 0 , 0 , 0 ), // #85 {xmm, xmm, xmm|m128|mem|i8|u8}
- ROW(3, 1, 1, 0, 50 , 52 , 10 , 0 , 0 , 0 ), // {xmm, m128|mem, i8|u8}
- ROW(3, 1, 1, 0, 53 , 53 , 60 , 0 , 0 , 0 ), // {ymm, ymm, ymm|m256|mem|i8|u8}
- ROW(3, 1, 1, 0, 53 , 55 , 10 , 0 , 0 , 0 ), // {ymm, m256|mem, i8|u8}
- ROW(3, 1, 1, 0, 56 , 56 , 61 , 0 , 0 , 0 ), // {zmm, zmm, zmm|m512|mem|i8|u8}
- ROW(3, 1, 1, 0, 56 , 58 , 10 , 0 , 0 , 0 ), // {zmm, m512|mem, i8|u8}
- ROW(3, 1, 1, 0, 50 , 50 , 59 , 0 , 0 , 0 ), // #91 {xmm, xmm, i8|u8|xmm|m128|mem}
- ROW(3, 1, 1, 0, 53 , 53 , 59 , 0 , 0 , 0 ), // {ymm, ymm, i8|u8|xmm|m128|mem}
- ROW(3, 1, 1, 0, 50 , 52 , 10 , 0 , 0 , 0 ), // {xmm, m128|mem, i8|u8}
- ROW(3, 1, 1, 0, 53 , 55 , 10 , 0 , 0 , 0 ), // {ymm, m256|mem, i8|u8}
- ROW(3, 1, 1, 0, 56 , 56 , 59 , 0 , 0 , 0 ), // {zmm, zmm, xmm|m128|mem|i8|u8}
- ROW(3, 1, 1, 0, 56 , 58 , 10 , 0 , 0 , 0 ), // {zmm, m512|mem, i8|u8}
- ROW(3, 1, 1, 0, 50 , 50 , 59 , 0 , 0 , 0 ), // #97 {xmm, xmm, xmm|m128|mem|i8|u8}
- ROW(3, 1, 1, 0, 50 , 52 , 10 , 0 , 0 , 0 ), // {xmm, m128|mem, i8|u8}
- ROW(3, 1, 1, 0, 53 , 53 , 59 , 0 , 0 , 0 ), // {ymm, ymm, xmm|m128|mem|i8|u8}
- ROW(3, 1, 1, 0, 53 , 55 , 10 , 0 , 0 , 0 ), // {ymm, m256|mem, i8|u8}
- ROW(3, 1, 1, 0, 56 , 56 , 59 , 0 , 0 , 0 ), // {zmm, zmm, xmm|m128|mem|i8|u8}
- ROW(3, 1, 1, 0, 56 , 58 , 10 , 0 , 0 , 0 ), // {zmm, m512|mem, i8|u8}
- ROW(2, 1, 1, 0, 62 , 63 , 0 , 0 , 0 , 0 ), // #103 {mm, mm|m64|mem|r64}
- ROW(2, 1, 1, 0, 15 , 64 , 0 , 0 , 0 , 0 ), // {m64|mem|r64, mm|xmm}
- ROW(2, 0, 1, 0, 50 , 15 , 0 , 0 , 0 , 0 ), // {xmm, r64|m64|mem}
- ROW(2, 1, 1, 0, 50 , 65 , 0 , 0 , 0 , 0 ), // #106 {xmm, xmm|m64|mem}
- ROW(2, 1, 1, 0, 30 , 50 , 0 , 0 , 0 , 0 ), // #107 {m64|mem, xmm}
- ROW(0, 1, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #108 {}
- ROW(1, 1, 1, 0, 66 , 0 , 0 , 0 , 0 , 0 ), // {r16|m16|r32|m32|r64|m64}
+ ROW(2, 1, 1, 0, 30 , 6 , 0 , 0 , 0 , 0 ), // #108 {m32|mem, r32}
+ ROW(2, 0, 1, 0, 31 , 8 , 0 , 0 , 0 , 0 ), // {m64|mem, r64}
+ ROW(0, 1, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #110 {}
+ ROW(1, 1, 1, 0, 25 , 0 , 0 , 0 , 0 , 0 ), // {r16|m16|r32|m32}
+ ROW(1, 0, 1, 0, 15 , 0 , 0 , 0 , 0 , 0 ), // {r64|m64}
ROW(2, 1, 1, 0, 27 , 4 , 0 , 0 , 0 , 0 ), // {r16|m16|mem, r16}
ROW(2, 1, 1, 0, 28 , 6 , 0 , 0 , 0 , 0 ), // {r32|m32|mem, r32}
- ROW(2, 1, 1, 0, 15 , 8 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, r64}
- ROW(3, 1, 1, 0, 50 , 67 , 50 , 0 , 0 , 0 ), // #113 {xmm, vm32x, xmm}
- ROW(3, 1, 1, 0, 53 , 68 , 53 , 0 , 0 , 0 ), // {ymm, vm32y, ymm}
- ROW(2, 1, 1, 0, 50 , 67 , 0 , 0 , 0 , 0 ), // {xmm, vm32x}
- ROW(2, 1, 1, 0, 53 , 68 , 0 , 0 , 0 , 0 ), // {ymm, vm32y}
- ROW(2, 1, 1, 0, 56 , 69 , 0 , 0 , 0 , 0 ), // {zmm, vm32z}
- ROW(3, 1, 1, 0, 50 , 70 , 50 , 0 , 0 , 0 ), // #118 {xmm, vm64x, xmm}
- ROW(3, 1, 1, 0, 53 , 71 , 53 , 0 , 0 , 0 ), // {ymm, vm64y, ymm}
- ROW(2, 1, 1, 0, 50 , 70 , 0 , 0 , 0 , 0 ), // {xmm, vm64x}
- ROW(2, 1, 1, 0, 53 , 71 , 0 , 0 , 0 , 0 ), // {ymm, vm64y}
- ROW(2, 1, 1, 0, 56 , 72 , 0 , 0 , 0 , 0 ), // {zmm, vm64z}
- ROW(2, 1, 1, 0, 25 , 10 , 0 , 0 , 0 , 0 ), // #123 {r16|m16|r32|m32|r64|m64|mem, i8|u8}
+ ROW(2, 0, 1, 0, 29 , 8 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, r64}
+ ROW(2, 1, 1, 0, 49 , 50 , 0 , 0 , 0 , 0 ), // #116 {xmm, xmm|m128|mem}
+ ROW(2, 1, 1, 0, 51 , 49 , 0 , 0 , 0 , 0 ), // {m128|mem, xmm}
+ ROW(2, 1, 1, 0, 52 , 53 , 0 , 0 , 0 , 0 ), // {ymm, ymm|m256|mem}
+ ROW(2, 1, 1, 0, 54 , 52 , 0 , 0 , 0 , 0 ), // {m256|mem, ymm}
+ ROW(2, 1, 1, 0, 55 , 56 , 0 , 0 , 0 , 0 ), // {zmm, zmm|m512|mem}
+ ROW(2, 1, 1, 0, 57 , 55 , 0 , 0 , 0 , 0 ), // {m512|mem, zmm}
+ ROW(3, 1, 1, 0, 49 , 49 , 58 , 0 , 0 , 0 ), // #122 {xmm, xmm, i8|u8|xmm|m128|mem}
+ ROW(3, 1, 1, 0, 52 , 52 , 58 , 0 , 0 , 0 ), // {ymm, ymm, i8|u8|xmm|m128|mem}
+ ROW(3, 1, 1, 0, 49 , 51 , 10 , 0 , 0 , 0 ), // {xmm, m128|mem, i8|u8}
+ ROW(3, 1, 1, 0, 52 , 54 , 10 , 0 , 0 , 0 ), // {ymm, m256|mem, i8|u8}
+ ROW(3, 1, 1, 0, 55 , 55 , 58 , 0 , 0 , 0 ), // {zmm, zmm, xmm|m128|mem|i8|u8}
+ ROW(3, 1, 1, 0, 55 , 57 , 10 , 0 , 0 , 0 ), // {zmm, m512|mem, i8|u8}
+ ROW(3, 1, 1, 0, 49 , 49 , 58 , 0 , 0 , 0 ), // #128 {xmm, xmm, xmm|m128|mem|i8|u8}
+ ROW(3, 1, 1, 0, 49 , 51 , 10 , 0 , 0 , 0 ), // {xmm, m128|mem, i8|u8}
+ ROW(3, 1, 1, 0, 52 , 52 , 58 , 0 , 0 , 0 ), // {ymm, ymm, xmm|m128|mem|i8|u8}
+ ROW(3, 1, 1, 0, 52 , 54 , 10 , 0 , 0 , 0 ), // {ymm, m256|mem, i8|u8}
+ ROW(3, 1, 1, 0, 55 , 55 , 58 , 0 , 0 , 0 ), // {zmm, zmm, xmm|m128|mem|i8|u8}
+ ROW(3, 1, 1, 0, 55 , 57 , 10 , 0 , 0 , 0 ), // {zmm, m512|mem, i8|u8}
+ ROW(2, 1, 1, 0, 25 , 10 , 0 , 0 , 0 , 0 ), // #134 {r16|m16|r32|m32, i8|u8}
+ ROW(2, 0, 1, 0, 15 , 10 , 0 , 0 , 0 , 0 ), // {r64|m64, i8|u8}
ROW(2, 1, 1, 0, 27 , 4 , 0 , 0 , 0 , 0 ), // {r16|m16|mem, r16}
ROW(2, 1, 1, 0, 28 , 6 , 0 , 0 , 0 , 0 ), // {r32|m32|mem, r32}
- ROW(2, 0, 1, 0, 15 , 8 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, r64}
- ROW(2, 1, 1, 2, 73 , 74 , 0 , 0 , 0 , 0 ), // #127 {<ds:[m8|memBase|zsi]>, <es:[m8|memBase|zdi]>}
- ROW(2, 1, 1, 2, 75 , 76 , 0 , 0 , 0 , 0 ), // {<ds:[m16|memBase|zsi]>, <es:[m16|memBase|zdi]>}
- ROW(2, 1, 1, 2, 77 , 78 , 0 , 0 , 0 , 0 ), // {<ds:[m32|memBase|zsi]>, <es:[m32|memBase|zdi]>}
- ROW(2, 0, 1, 2, 79 , 80 , 0 , 0 , 0 , 0 ), // {<ds:[m64|memBase|zsi]>, <es:[m64|memBase|zdi]>}
- ROW(3, 1, 1, 1, 1 , 2 , 81 , 0 , 0 , 0 ), // #131 {r8lo|r8hi|m8|mem, r8lo|r8hi, <al>}
- ROW(3, 1, 1, 1, 27 , 4 , 33 , 0 , 0 , 0 ), // {r16|m16|mem, r16, <ax>}
- ROW(3, 1, 1, 1, 28 , 6 , 36 , 0 , 0 , 0 ), // {r32|m32|mem, r32, <eax>}
- ROW(3, 0, 1, 1, 15 , 8 , 38 , 0 , 0 , 0 ), // {r64|m64|mem, r64, <rax>}
- ROW(2, 1, 1, 2, 81 , 82 , 0 , 0 , 0 , 0 ), // #135 {<al>, <ds:[m8|memBase|zsi|mem]>}
- ROW(2, 1, 1, 2, 33 , 83 , 0 , 0 , 0 , 0 ), // {<ax>, <ds:[m16|memBase|zsi|mem]>}
- ROW(2, 1, 1, 2, 36 , 84 , 0 , 0 , 0 , 0 ), // {<eax>, <ds:[m32|memBase|zsi|mem]>}
- ROW(2, 0, 1, 2, 38 , 85 , 0 , 0 , 0 , 0 ), // {<rax>, <ds:[m64|memBase|zsi|mem]>}
- ROW(2, 1, 1, 2, 74 , 73 , 0 , 0 , 0 , 0 ), // #139 {<es:[m8|memBase|zdi]>, <ds:[m8|memBase|zsi]>}
- ROW(2, 1, 1, 2, 76 , 75 , 0 , 0 , 0 , 0 ), // {<es:[m16|memBase|zdi]>, <ds:[m16|memBase|zsi]>}
- ROW(2, 1, 1, 2, 78 , 77 , 0 , 0 , 0 , 0 ), // {<es:[m32|memBase|zdi]>, <ds:[m32|memBase|zsi]>}
- ROW(2, 0, 1, 2, 80 , 79 , 0 , 0 , 0 , 0 ), // {<es:[m64|memBase|zdi]>, <ds:[m64|memBase|zsi]>}
- ROW(1, 1, 1, 0, 86 , 0 , 0 , 0 , 0 , 0 ), // #143 {r16|m16|r64|m64}
+ ROW(2, 0, 1, 0, 29 , 8 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, r64}
+ ROW(2, 1, 1, 0, 61 , 62 , 0 , 0 , 0 , 0 ), // #139 {mm, mm|m64|mem}
+ ROW(2, 0, 1, 0, 63 , 29 , 0 , 0 , 0 , 0 ), // {mm|xmm, r64|m64|mem}
+ ROW(2, 1, 1, 0, 31 , 63 , 0 , 0 , 0 , 0 ), // {m64|mem, mm|xmm}
+ ROW(2, 0, 1, 0, 29 , 63 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, mm|xmm}
+ ROW(2, 1, 1, 0, 49 , 64 , 0 , 0 , 0 , 0 ), // #143 {xmm, xmm|m64|mem}
+ ROW(1, 1, 1, 0, 11 , 0 , 0 , 0 , 0 , 0 ), // #144 {r16|m16}
ROW(1, 1, 0, 0, 13 , 0 , 0 , 0 , 0 , 0 ), // {r32|m32}
- ROW(1, 1, 0, 0, 87 , 0 , 0 , 0 , 0 , 0 ), // {ds|es|ss}
- ROW(1, 1, 1, 0, 88 , 0 , 0 , 0 , 0 , 0 ), // {fs|gs}
- ROW(1, 1, 1, 0, 89 , 0 , 0 , 0 , 0 , 0 ), // #147 {r16|m16|r64|m64|i8|i16|i32}
- ROW(1, 1, 0, 0, 90 , 0 , 0 , 0 , 0 , 0 ), // {r32|m32|i32|u32}
- ROW(1, 1, 0, 0, 91 , 0 , 0 , 0 , 0 , 0 ), // {cs|ss|ds|es}
- ROW(1, 1, 1, 0, 88 , 0 , 0 , 0 , 0 , 0 ), // {fs|gs}
- ROW(2, 1, 1, 2, 81 , 92 , 0 , 0 , 0 , 0 ), // #151 {<al>, <es:[m8|memBase|zdi|mem]>}
- ROW(2, 1, 1, 2, 33 , 93 , 0 , 0 , 0 , 0 ), // {<ax>, <es:[m16|memBase|zdi|mem]>}
- ROW(2, 1, 1, 2, 36 , 94 , 0 , 0 , 0 , 0 ), // {<eax>, <es:[m32|memBase|zdi|mem]>}
- ROW(2, 0, 1, 2, 38 , 95 , 0 , 0 , 0 , 0 ), // {<rax>, <es:[m64|memBase|zdi|mem]>}
- ROW(2, 1, 1, 2, 92 , 81 , 0 , 0 , 0 , 0 ), // #155 {<es:[m8|memBase|zdi|mem]>, <al>}
- ROW(2, 1, 1, 2, 93 , 33 , 0 , 0 , 0 , 0 ), // {<es:[m16|memBase|zdi|mem]>, <ax>}
- ROW(2, 1, 1, 2, 94 , 36 , 0 , 0 , 0 , 0 ), // {<es:[m32|memBase|zdi|mem]>, <eax>}
- ROW(2, 0, 1, 2, 95 , 38 , 0 , 0 , 0 , 0 ), // {<es:[m64|memBase|zdi|mem]>, <rax>}
- ROW(4, 1, 1, 0, 50 , 50 , 50 , 51 , 0 , 0 ), // #159 {xmm, xmm, xmm, xmm|m128|mem}
- ROW(4, 1, 1, 0, 50 , 50 , 52 , 50 , 0 , 0 ), // {xmm, xmm, m128|mem, xmm}
- ROW(4, 1, 1, 0, 53 , 53 , 53 , 54 , 0 , 0 ), // {ymm, ymm, ymm, ymm|m256|mem}
- ROW(4, 1, 1, 0, 53 , 53 , 55 , 53 , 0 , 0 ), // {ymm, ymm, m256|mem, ymm}
- ROW(3, 1, 1, 0, 50 , 67 , 50 , 0 , 0 , 0 ), // #163 {xmm, vm32x, xmm}
- ROW(3, 1, 1, 0, 53 , 67 , 53 , 0 , 0 , 0 ), // {ymm, vm32x, ymm}
- ROW(2, 1, 1, 0, 96 , 67 , 0 , 0 , 0 , 0 ), // {xmm|ymm, vm32x}
- ROW(2, 1, 1, 0, 56 , 68 , 0 , 0 , 0 , 0 ), // {zmm, vm32y}
- ROW(3, 1, 1, 0, 52 , 50 , 50 , 0 , 0 , 0 ), // #167 {m128|mem, xmm, xmm}
- ROW(3, 1, 1, 0, 55 , 53 , 53 , 0 , 0 , 0 ), // {m256|mem, ymm, ymm}
- ROW(3, 1, 1, 0, 50 , 50 , 52 , 0 , 0 , 0 ), // {xmm, xmm, m128|mem}
- ROW(3, 1, 1, 0, 53 , 53 , 55 , 0 , 0 , 0 ), // {ymm, ymm, m256|mem}
- ROW(5, 1, 1, 0, 50 , 50 , 51 , 50 , 97 , 0 ), // #171 {xmm, xmm, xmm|m128|mem, xmm, i4|u4}
- ROW(5, 1, 1, 0, 50 , 50 , 50 , 52 , 97 , 0 ), // {xmm, xmm, xmm, m128|mem, i4|u4}
- ROW(5, 1, 1, 0, 53 , 53 , 54 , 53 , 97 , 0 ), // {ymm, ymm, ymm|m256|mem, ymm, i4|u4}
- ROW(5, 1, 1, 0, 53 , 53 , 53 , 55 , 97 , 0 ), // {ymm, ymm, ymm, m256|mem, i4|u4}
- ROW(3, 1, 1, 0, 53 , 54 , 10 , 0 , 0 , 0 ), // #175 {ymm, ymm|m256|mem, i8|u8}
- ROW(3, 1, 1, 0, 53 , 53 , 54 , 0 , 0 , 0 ), // {ymm, ymm, ymm|m256|mem}
- ROW(3, 1, 1, 0, 56 , 56 , 61 , 0 , 0 , 0 ), // {zmm, zmm, zmm|m512|mem|i8|u8}
- ROW(3, 1, 1, 0, 56 , 58 , 10 , 0 , 0 , 0 ), // {zmm, m512|mem, i8|u8}
- ROW(2, 1, 1, 0, 4 , 27 , 0 , 0 , 0 , 0 ), // #179 {r16, r16|m16|mem}
- ROW(2, 1, 1, 0, 6 , 28 , 0 , 0 , 0 , 0 ), // #180 {r32, r32|m32|mem}
- ROW(2, 0, 1, 0, 8 , 15 , 0 , 0 , 0 , 0 ), // {r64, r64|m64|mem}
- ROW(1, 1, 1, 0, 98 , 0 , 0 , 0 , 0 , 0 ), // #182 {m32|m64}
- ROW(2, 1, 1, 0, 99 , 100, 0 , 0 , 0 , 0 ), // {st0, st}
- ROW(2, 1, 1, 0, 100, 99 , 0 , 0 , 0 , 0 ), // {st, st0}
- ROW(2, 1, 1, 0, 4 , 29 , 0 , 0 , 0 , 0 ), // #185 {r16, m32|mem}
- ROW(2, 1, 1, 0, 6 , 101, 0 , 0 , 0 , 0 ), // {r32, m48|mem}
- ROW(2, 0, 1, 0, 8 , 102, 0 , 0 , 0 , 0 ), // {r64, m80|mem}
- ROW(3, 1, 1, 0, 27 , 4 , 103, 0 , 0 , 0 ), // #188 {r16|m16|mem, r16, cl|i8|u8}
- ROW(3, 1, 1, 0, 28 , 6 , 103, 0 , 0 , 0 ), // {r32|m32|mem, r32, cl|i8|u8}
- ROW(3, 0, 1, 0, 15 , 8 , 103, 0 , 0 , 0 ), // {r64|m64|mem, r64, cl|i8|u8}
- ROW(3, 1, 1, 0, 50 , 50 , 51 , 0 , 0 , 0 ), // #191 {xmm, xmm, xmm|m128|mem}
- ROW(3, 1, 1, 0, 53 , 53 , 54 , 0 , 0 , 0 ), // #192 {ymm, ymm, ymm|m256|mem}
- ROW(3, 1, 1, 0, 56 , 56 , 57 , 0 , 0 , 0 ), // {zmm, zmm, zmm|m512|mem}
- ROW(4, 1, 1, 0, 50 , 50 , 51 , 10 , 0 , 0 ), // #194 {xmm, xmm, xmm|m128|mem, i8|u8}
- ROW(4, 1, 1, 0, 53 , 53 , 54 , 10 , 0 , 0 ), // #195 {ymm, ymm, ymm|m256|mem, i8|u8}
- ROW(4, 1, 1, 0, 56 , 56 , 57 , 10 , 0 , 0 ), // {zmm, zmm, zmm|m512|mem, i8|u8}
- ROW(4, 1, 1, 0, 104, 50 , 51 , 10 , 0 , 0 ), // #197 {xmm|k, xmm, xmm|m128|mem, i8|u8}
- ROW(4, 1, 1, 0, 105, 53 , 54 , 10 , 0 , 0 ), // {ymm|k, ymm, ymm|m256|mem, i8|u8}
- ROW(4, 1, 1, 0, 106, 56 , 57 , 10 , 0 , 0 ), // {k, zmm, zmm|m512|mem, i8|u8}
- ROW(4, 1, 1, 0, 106, 50 , 51 , 10 , 0 , 0 ), // #200 {k, xmm, xmm|m128|mem, i8|u8}
- ROW(4, 1, 1, 0, 106, 53 , 54 , 10 , 0 , 0 ), // {k, ymm, ymm|m256|mem, i8|u8}
- ROW(4, 1, 1, 0, 106, 56 , 57 , 10 , 0 , 0 ), // {k, zmm, zmm|m512|mem, i8|u8}
- ROW(2, 1, 1, 0, 51 , 50 , 0 , 0 , 0 , 0 ), // #203 {xmm|m128|mem, xmm}
- ROW(2, 1, 1, 0, 54 , 53 , 0 , 0 , 0 , 0 ), // {ymm|m256|mem, ymm}
- ROW(2, 1, 1, 0, 57 , 56 , 0 , 0 , 0 , 0 ), // {zmm|m512|mem, zmm}
- ROW(2, 1, 1, 0, 50 , 65 , 0 , 0 , 0 , 0 ), // #206 {xmm, xmm|m64|mem}
- ROW(2, 1, 1, 0, 53 , 51 , 0 , 0 , 0 , 0 ), // {ymm, xmm|m128|mem}
- ROW(2, 1, 1, 0, 56 , 54 , 0 , 0 , 0 , 0 ), // {zmm, ymm|m256|mem}
- ROW(2, 1, 1, 0, 50 , 51 , 0 , 0 , 0 , 0 ), // #209 {xmm, xmm|m128|mem}
- ROW(2, 1, 1, 0, 53 , 54 , 0 , 0 , 0 , 0 ), // {ymm, ymm|m256|mem}
- ROW(2, 1, 1, 0, 56 , 57 , 0 , 0 , 0 , 0 ), // {zmm, zmm|m512|mem}
- ROW(2, 1, 1, 0, 50 , 107, 0 , 0 , 0 , 0 ), // #212 {xmm, xmm|m32|mem}
- ROW(2, 1, 1, 0, 53 , 65 , 0 , 0 , 0 , 0 ), // {ymm, xmm|m64|mem}
- ROW(2, 1, 1, 0, 56 , 51 , 0 , 0 , 0 , 0 ), // {zmm, xmm|m128|mem}
- ROW(3, 1, 1, 0, 65 , 50 , 10 , 0 , 0 , 0 ), // #215 {xmm|m64|mem, xmm, i8|u8}
- ROW(3, 1, 1, 0, 51 , 53 , 10 , 0 , 0 , 0 ), // #216 {xmm|m128|mem, ymm, i8|u8}
- ROW(3, 1, 1, 0, 54 , 56 , 10 , 0 , 0 , 0 ), // #217 {ymm|m256|mem, zmm, i8|u8}
- ROW(3, 1, 1, 0, 50 , 108, 50 , 0 , 0 , 0 ), // #218 {xmm, vm64x|vm64y, xmm}
- ROW(2, 1, 1, 0, 50 , 108, 0 , 0 , 0 , 0 ), // {xmm, vm64x|vm64y}
- ROW(2, 1, 1, 0, 53 , 72 , 0 , 0 , 0 , 0 ), // {ymm, vm64z}
- ROW(3, 1, 1, 0, 50 , 51 , 10 , 0 , 0 , 0 ), // #221 {xmm, xmm|m128|mem, i8|u8}
- ROW(3, 1, 1, 0, 53 , 54 , 10 , 0 , 0 , 0 ), // {ymm, ymm|m256|mem, i8|u8}
- ROW(3, 1, 1, 0, 56 , 57 , 10 , 0 , 0 , 0 ), // {zmm, zmm|m512|mem, i8|u8}
- ROW(2, 1, 1, 0, 50 , 65 , 0 , 0 , 0 , 0 ), // #224 {xmm, xmm|m64|mem}
- ROW(2, 1, 1, 0, 53 , 54 , 0 , 0 , 0 , 0 ), // {ymm, ymm|m256|mem}
- ROW(2, 1, 1, 0, 56 , 57 , 0 , 0 , 0 , 0 ), // {zmm, zmm|m512|mem}
- ROW(2, 1, 1, 0, 52 , 50 , 0 , 0 , 0 , 0 ), // #227 {m128|mem, xmm}
- ROW(2, 1, 1, 0, 55 , 53 , 0 , 0 , 0 , 0 ), // {m256|mem, ymm}
- ROW(2, 1, 1, 0, 58 , 56 , 0 , 0 , 0 , 0 ), // {m512|mem, zmm}
- ROW(2, 1, 1, 0, 50 , 52 , 0 , 0 , 0 , 0 ), // #230 {xmm, m128|mem}
- ROW(2, 1, 1, 0, 53 , 55 , 0 , 0 , 0 , 0 ), // {ymm, m256|mem}
- ROW(2, 1, 1, 0, 56 , 58 , 0 , 0 , 0 , 0 ), // {zmm, m512|mem}
- ROW(2, 0, 1, 0, 15 , 50 , 0 , 0 , 0 , 0 ), // #233 {r64|m64|mem, xmm}
- ROW(2, 1, 1, 0, 50 , 109, 0 , 0 , 0 , 0 ), // {xmm, xmm|m64|mem|r64}
- ROW(2, 1, 1, 0, 30 , 50 , 0 , 0 , 0 , 0 ), // {m64|mem, xmm}
- ROW(2, 1, 1, 0, 30 , 50 , 0 , 0 , 0 , 0 ), // #236 {m64|mem, xmm}
- ROW(2, 1, 1, 0, 50 , 30 , 0 , 0 , 0 , 0 ), // {xmm, m64|mem}
- ROW(3, 1, 1, 0, 50 , 50 , 50 , 0 , 0 , 0 ), // #238 {xmm, xmm, xmm}
- ROW(2, 1, 1, 0, 21 , 50 , 0 , 0 , 0 , 0 ), // #239 {m16|mem, xmm}
- ROW(2, 1, 1, 0, 50 , 21 , 0 , 0 , 0 , 0 ), // {xmm, m16|mem}
- ROW(3, 1, 1, 0, 50 , 50 , 50 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
- ROW(2, 1, 1, 0, 29 , 50 , 0 , 0 , 0 , 0 ), // #242 {m32|mem, xmm}
- ROW(2, 1, 1, 0, 50 , 29 , 0 , 0 , 0 , 0 ), // {xmm, m32|mem}
- ROW(3, 1, 1, 0, 50 , 50 , 50 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
- ROW(4, 1, 1, 0, 106, 106, 50 , 51 , 0 , 0 ), // #245 {k, k, xmm, xmm|m128|mem}
- ROW(4, 1, 1, 0, 106, 106, 53 , 54 , 0 , 0 ), // {k, k, ymm, ymm|m256|mem}
- ROW(4, 1, 1, 0, 106, 106, 56 , 57 , 0 , 0 ), // {k, k, zmm, zmm|m512|mem}
- ROW(2, 1, 1, 0, 96 , 109, 0 , 0 , 0 , 0 ), // #248 {xmm|ymm, xmm|m64|mem|r64}
- ROW(2, 0, 1, 0, 56 , 8 , 0 , 0 , 0 , 0 ), // {zmm, r64}
- ROW(2, 1, 1, 0, 56 , 65 , 0 , 0 , 0 , 0 ), // {zmm, xmm|m64|mem}
- ROW(3, 1, 1, 0, 104, 50 , 51 , 0 , 0 , 0 ), // #251 {xmm|k, xmm, xmm|m128|mem}
- ROW(3, 1, 1, 0, 105, 53 , 54 , 0 , 0 , 0 ), // {ymm|k, ymm, ymm|m256|mem}
- ROW(3, 1, 1, 0, 106, 56 , 57 , 0 , 0 , 0 ), // {k, zmm, zmm|m512|mem}
- ROW(2, 1, 1, 0, 107, 50 , 0 , 0 , 0 , 0 ), // #254 {xmm|m32|mem, xmm}
- ROW(2, 1, 1, 0, 65 , 53 , 0 , 0 , 0 , 0 ), // {xmm|m64|mem, ymm}
- ROW(2, 1, 1, 0, 51 , 56 , 0 , 0 , 0 , 0 ), // {xmm|m128|mem, zmm}
- ROW(2, 1, 1, 0, 65 , 50 , 0 , 0 , 0 , 0 ), // #257 {xmm|m64|mem, xmm}
- ROW(2, 1, 1, 0, 51 , 53 , 0 , 0 , 0 , 0 ), // {xmm|m128|mem, ymm}
- ROW(2, 1, 1, 0, 54 , 56 , 0 , 0 , 0 , 0 ), // {ymm|m256|mem, zmm}
- ROW(2, 1, 1, 0, 110, 50 , 0 , 0 , 0 , 0 ), // #260 {xmm|m16|mem, xmm}
- ROW(2, 1, 1, 0, 107, 53 , 0 , 0 , 0 , 0 ), // {xmm|m32|mem, ymm}
- ROW(2, 1, 1, 0, 65 , 56 , 0 , 0 , 0 , 0 ), // {xmm|m64|mem, zmm}
- ROW(2, 1, 1, 0, 50 , 110, 0 , 0 , 0 , 0 ), // #263 {xmm, xmm|m16|mem}
- ROW(2, 1, 1, 0, 53 , 107, 0 , 0 , 0 , 0 ), // {ymm, xmm|m32|mem}
- ROW(2, 1, 1, 0, 56 , 65 , 0 , 0 , 0 , 0 ), // {zmm, xmm|m64|mem}
- ROW(2, 1, 1, 0, 67 , 50 , 0 , 0 , 0 , 0 ), // #266 {vm32x, xmm}
- ROW(2, 1, 1, 0, 68 , 53 , 0 , 0 , 0 , 0 ), // {vm32y, ymm}
- ROW(2, 1, 1, 0, 69 , 56 , 0 , 0 , 0 , 0 ), // {vm32z, zmm}
- ROW(2, 1, 1, 0, 70 , 50 , 0 , 0 , 0 , 0 ), // #269 {vm64x, xmm}
- ROW(2, 1, 1, 0, 71 , 53 , 0 , 0 , 0 , 0 ), // {vm64y, ymm}
- ROW(2, 1, 1, 0, 72 , 56 , 0 , 0 , 0 , 0 ), // {vm64z, zmm}
- ROW(3, 1, 1, 0, 106, 50 , 51 , 0 , 0 , 0 ), // #272 {k, xmm, xmm|m128|mem}
- ROW(3, 1, 1, 0, 106, 53 , 54 , 0 , 0 , 0 ), // {k, ymm, ymm|m256|mem}
- ROW(3, 1, 1, 0, 106, 56 , 57 , 0 , 0 , 0 ), // {k, zmm, zmm|m512|mem}
- ROW(3, 1, 1, 0, 6 , 6 , 28 , 0 , 0 , 0 ), // #275 {r32, r32, r32|m32|mem}
- ROW(3, 0, 1, 0, 8 , 8 , 15 , 0 , 0 , 0 ), // {r64, r64, r64|m64|mem}
- ROW(3, 1, 1, 0, 6 , 28 , 6 , 0 , 0 , 0 ), // #277 {r32, r32|m32|mem, r32}
- ROW(3, 0, 1, 0, 8 , 15 , 8 , 0 , 0 , 0 ), // {r64, r64|m64|mem, r64}
- ROW(2, 1, 0, 0, 111, 28 , 0 , 0 , 0 , 0 ), // #279 {bnd, r32|m32|mem}
- ROW(2, 0, 1, 0, 111, 15 , 0 , 0 , 0 , 0 ), // {bnd, r64|m64|mem}
- ROW(2, 1, 1, 0, 111, 112, 0 , 0 , 0 , 0 ), // #281 {bnd, bnd|mem}
- ROW(2, 1, 1, 0, 113, 111, 0 , 0 , 0 , 0 ), // {mem, bnd}
- ROW(2, 1, 0, 0, 4 , 29 , 0 , 0 , 0 , 0 ), // #283 {r16, m32|mem}
- ROW(2, 1, 0, 0, 6 , 30 , 0 , 0 , 0 , 0 ), // {r32, m64|mem}
- ROW(1, 1, 0, 0, 114, 0 , 0 , 0 , 0 , 0 ), // #285 {rel16|r16|m16|r32|m32}
- ROW(1, 1, 1, 0, 115, 0 , 0 , 0 , 0 , 0 ), // {rel32|r64|m64|mem}
- ROW(2, 1, 1, 0, 6 , 116, 0 , 0 , 0 , 0 ), // #287 {r32, r8lo|r8hi|m8|r16|m16|r32|m32}
- ROW(2, 0, 1, 0, 8 , 117, 0 , 0 , 0 , 0 ), // {r64, r8lo|r8hi|m8|r64|m64}
- ROW(1, 1, 0, 0, 118, 0 , 0 , 0 , 0 , 0 ), // #289 {r16|r32}
- ROW(1, 1, 1, 0, 31 , 0 , 0 , 0 , 0 , 0 ), // #290 {r8lo|r8hi|m8|r16|m16|r32|m32|r64|m64|mem}
- ROW(2, 1, 0, 0, 119, 58 , 0 , 0 , 0 , 0 ), // #291 {es:[mem|m512|memBase], m512|mem}
- ROW(2, 0, 1, 0, 119, 58 , 0 , 0 , 0 , 0 ), // {es:[mem|m512|memBase], m512|mem}
- ROW(3, 1, 1, 0, 50 , 10 , 10 , 0 , 0 , 0 ), // #293 {xmm, i8|u8, i8|u8}
- ROW(2, 1, 1, 0, 50 , 50 , 0 , 0 , 0 , 0 ), // #294 {xmm, xmm}
- ROW(0, 1, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #295 {}
- ROW(1, 1, 1, 0, 100, 0 , 0 , 0 , 0 , 0 ), // #296 {st}
- ROW(0, 1, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #297 {}
- ROW(1, 1, 1, 0, 120, 0 , 0 , 0 , 0 , 0 ), // #298 {m32|m64|st}
- ROW(2, 1, 1, 0, 50 , 50 , 0 , 0 , 0 , 0 ), // #299 {xmm, xmm}
- ROW(4, 1, 1, 0, 50 , 50 , 10 , 10 , 0 , 0 ), // {xmm, xmm, i8|u8, i8|u8}
- ROW(2, 1, 0, 0, 6 , 52 , 0 , 0 , 0 , 0 ), // #301 {r32, m128|mem}
- ROW(2, 0, 1, 0, 8 , 52 , 0 , 0 , 0 , 0 ), // {r64, m128|mem}
- ROW(2, 1, 0, 2, 36 , 121, 0 , 0 , 0 , 0 ), // #303 {<eax>, <ecx>}
- ROW(2, 0, 1, 2, 122, 121, 0 , 0 , 0 , 0 ), // {<eax|rax>, <ecx>}
- ROW(1, 1, 1, 0, 123, 0 , 0 , 0 , 0 , 0 ), // #305 {rel8|rel32}
- ROW(1, 1, 0, 0, 124, 0 , 0 , 0 , 0 , 0 ), // {rel16}
- ROW(2, 1, 0, 1, 125, 126, 0 , 0 , 0 , 0 ), // #307 {<cx|ecx>, rel8}
- ROW(2, 0, 1, 1, 127, 126, 0 , 0 , 0 , 0 ), // {<ecx|rcx>, rel8}
- ROW(1, 1, 1, 0, 128, 0 , 0 , 0 , 0 , 0 ), // #309 {rel8|rel32|r64|m64|mem}
- ROW(1, 1, 0, 0, 129, 0 , 0 , 0 , 0 , 0 ), // {rel16|r32|m32|mem}
- ROW(2, 1, 1, 0, 106, 130, 0 , 0 , 0 , 0 ), // #311 {k, k|m8|mem|r32}
- ROW(2, 1, 1, 0, 131, 106, 0 , 0 , 0 , 0 ), // {m8|mem|r32, k}
- ROW(2, 1, 1, 0, 106, 132, 0 , 0 , 0 , 0 ), // #313 {k, k|m32|mem|r32}
- ROW(2, 1, 1, 0, 28 , 106, 0 , 0 , 0 , 0 ), // {m32|mem|r32, k}
- ROW(2, 1, 1, 0, 106, 133, 0 , 0 , 0 , 0 ), // #315 {k, k|m64|mem|r64}
- ROW(2, 1, 1, 0, 15 , 106, 0 , 0 , 0 , 0 ), // {m64|mem|r64, k}
- ROW(2, 1, 1, 0, 106, 134, 0 , 0 , 0 , 0 ), // #317 {k, k|m16|mem|r32}
- ROW(2, 1, 1, 0, 135, 106, 0 , 0 , 0 , 0 ), // {m16|mem|r32, k}
- ROW(2, 1, 1, 0, 4 , 27 , 0 , 0 , 0 , 0 ), // #319 {r16, r16|m16|mem}
- ROW(2, 1, 1, 0, 6 , 135, 0 , 0 , 0 , 0 ), // {r32, r32|m16|mem}
- ROW(2, 1, 0, 0, 136, 137, 0 , 0 , 0 , 0 ), // #321 {i16, i16|i32}
- ROW(1, 1, 1, 0, 138, 0 , 0 , 0 , 0 , 0 ), // {m32|m48|m80|mem}
- ROW(2, 1, 0, 0, 4 , 29 , 0 , 0 , 0 , 0 ), // #323 {r16, m32|mem}
- ROW(2, 1, 0, 0, 6 , 101, 0 , 0 , 0 , 0 ), // {r32, m48|mem}
- ROW(2, 1, 1, 0, 4 , 27 , 0 , 0 , 0 , 0 ), // #325 {r16, r16|m16|mem}
- ROW(2, 1, 1, 0, 139, 135, 0 , 0 , 0 , 0 ), // {r32|r64, r32|m16|mem}
- ROW(2, 1, 1, 0, 64 , 28 , 0 , 0 , 0 , 0 ), // #327 {mm|xmm, r32|m32|mem}
- ROW(2, 1, 1, 0, 28 , 64 , 0 , 0 , 0 , 0 ), // {r32|m32|mem, mm|xmm}
- ROW(2, 1, 1, 0, 50 , 107, 0 , 0 , 0 , 0 ), // #329 {xmm, xmm|m32|mem}
- ROW(2, 1, 1, 0, 29 , 50 , 0 , 0 , 0 , 0 ), // {m32|mem, xmm}
- ROW(2, 1, 1, 0, 4 , 9 , 0 , 0 , 0 , 0 ), // #331 {r16, r8lo|r8hi|m8}
- ROW(2, 1, 1, 0, 139, 140, 0 , 0 , 0 , 0 ), // {r32|r64, r8lo|r8hi|m8|r16|m16}
- ROW(2, 0, 1, 0, 4 , 27 , 0 , 0 , 0 , 0 ), // #333 {r16, r16|m16|mem}
- ROW(2, 0, 1, 0, 139, 28 , 0 , 0 , 0 , 0 ), // {r32|r64, r32|m32|mem}
- ROW(4, 1, 1, 1, 6 , 6 , 28 , 35 , 0 , 0 ), // #335 {r32, r32, r32|m32|mem, <edx>}
- ROW(4, 0, 1, 1, 8 , 8 , 15 , 37 , 0 , 0 ), // {r64, r64, r64|m64|mem, <rdx>}
- ROW(2, 1, 1, 0, 62 , 141, 0 , 0 , 0 , 0 ), // #337 {mm, mm|m64|mem}
- ROW(2, 1, 1, 0, 50 , 51 , 0 , 0 , 0 , 0 ), // {xmm, xmm|m128|mem}
- ROW(3, 1, 1, 0, 62 , 141, 10 , 0 , 0 , 0 ), // #339 {mm, mm|m64|mem, i8|u8}
- ROW(3, 1, 1, 0, 50 , 51 , 10 , 0 , 0 , 0 ), // {xmm, xmm|m128|mem, i8|u8}
- ROW(3, 1, 1, 0, 6 , 64 , 10 , 0 , 0 , 0 ), // #341 {r32, mm|xmm, i8|u8}
- ROW(3, 1, 1, 0, 21 , 50 , 10 , 0 , 0 , 0 ), // {m16|mem, xmm, i8|u8}
- ROW(2, 1, 1, 0, 62 , 142, 0 , 0 , 0 , 0 ), // #343 {mm, i8|u8|mm|m64|mem}
- ROW(2, 1, 1, 0, 50 , 59 , 0 , 0 , 0 , 0 ), // {xmm, i8|u8|xmm|m128|mem}
- ROW(2, 1, 1, 0, 62 , 143, 0 , 0 , 0 , 0 ), // #345 {mm, mm|m32|mem}
- ROW(2, 1, 1, 0, 50 , 51 , 0 , 0 , 0 , 0 ), // {xmm, xmm|m128|mem}
- ROW(1, 1, 0, 0, 6 , 0 , 0 , 0 , 0 , 0 ), // #347 {r32}
- ROW(1, 0, 1, 0, 8 , 0 , 0 , 0 , 0 , 0 ), // #348 {r64}
- ROW(0, 1, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #349 {}
- ROW(1, 1, 1, 0, 144, 0 , 0 , 0 , 0 , 0 ), // {u16}
- ROW(3, 1, 1, 0, 6 , 28 , 10 , 0 , 0 , 0 ), // #351 {r32, r32|m32|mem, i8|u8}
- ROW(3, 0, 1, 0, 8 , 15 , 10 , 0 , 0 , 0 ), // {r64, r64|m64|mem, i8|u8}
- ROW(4, 1, 1, 0, 50 , 50 , 51 , 50 , 0 , 0 ), // #353 {xmm, xmm, xmm|m128|mem, xmm}
- ROW(4, 1, 1, 0, 53 , 53 , 54 , 53 , 0 , 0 ), // {ymm, ymm, ymm|m256|mem, ymm}
- ROW(2, 1, 1, 0, 50 , 145, 0 , 0 , 0 , 0 ), // #355 {xmm, xmm|m128|ymm|m256}
- ROW(2, 1, 1, 0, 53 , 57 , 0 , 0 , 0 , 0 ), // {ymm, zmm|m512|mem}
- ROW(4, 1, 1, 0, 50 , 50 , 50 , 65 , 0 , 0 ), // #357 {xmm, xmm, xmm, xmm|m64|mem}
- ROW(4, 1, 1, 0, 50 , 50 , 30 , 50 , 0 , 0 ), // {xmm, xmm, m64|mem, xmm}
- ROW(4, 1, 1, 0, 50 , 50 , 50 , 107, 0 , 0 ), // #359 {xmm, xmm, xmm, xmm|m32|mem}
- ROW(4, 1, 1, 0, 50 , 50 , 29 , 50 , 0 , 0 ), // {xmm, xmm, m32|mem, xmm}
- ROW(4, 1, 1, 0, 53 , 53 , 51 , 10 , 0 , 0 ), // #361 {ymm, ymm, xmm|m128|mem, i8|u8}
- ROW(4, 1, 1, 0, 56 , 56 , 51 , 10 , 0 , 0 ), // {zmm, zmm, xmm|m128|mem, i8|u8}
- ROW(1, 1, 0, 1, 36 , 0 , 0 , 0 , 0 , 0 ), // #363 {<eax>}
- ROW(1, 0, 1, 1, 38 , 0 , 0 , 0 , 0 , 0 ), // #364 {<rax>}
- ROW(2, 1, 1, 0, 28 , 50 , 0 , 0 , 0 , 0 ), // #365 {r32|m32|mem, xmm}
- ROW(2, 1, 1, 0, 50 , 28 , 0 , 0 , 0 , 0 ), // {xmm, r32|m32|mem}
- ROW(2, 1, 1, 0, 30 , 50 , 0 , 0 , 0 , 0 ), // #367 {m64|mem, xmm}
- ROW(3, 1, 1, 0, 50 , 50 , 30 , 0 , 0 , 0 ), // {xmm, xmm, m64|mem}
- ROW(2, 1, 1, 0, 135, 50 , 0 , 0 , 0 , 0 ), // #369 {r32|m16|mem, xmm}
- ROW(2, 1, 1, 0, 50 , 135, 0 , 0 , 0 , 0 ), // {xmm, r32|m16|mem}
- ROW(2, 1, 0, 0, 28 , 6 , 0 , 0 , 0 , 0 ), // #371 {r32|m32|mem, r32}
- ROW(2, 0, 1, 0, 15 , 8 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, r64}
- ROW(2, 1, 0, 0, 6 , 28 , 0 , 0 , 0 , 0 ), // #373 {r32, r32|m32|mem}
- ROW(2, 0, 1, 0, 8 , 15 , 0 , 0 , 0 , 0 ), // {r64, r64|m64|mem}
- ROW(3, 1, 1, 0, 50 , 50 , 59 , 0 , 0 , 0 ), // #375 {xmm, xmm, xmm|m128|mem|i8|u8}
- ROW(3, 1, 1, 0, 50 , 52 , 146, 0 , 0 , 0 ), // {xmm, m128|mem, i8|u8|xmm}
- ROW(2, 1, 1, 0, 67 , 96 , 0 , 0 , 0 , 0 ), // #377 {vm32x, xmm|ymm}
- ROW(2, 1, 1, 0, 68 , 56 , 0 , 0 , 0 , 0 ), // {vm32y, zmm}
- ROW(2, 1, 1, 0, 108, 50 , 0 , 0 , 0 , 0 ), // #379 {vm64x|vm64y, xmm}
- ROW(2, 1, 1, 0, 72 , 53 , 0 , 0 , 0 , 0 ), // {vm64z, ymm}
- ROW(3, 1, 1, 0, 50 , 50 , 51 , 0 , 0 , 0 ), // #381 {xmm, xmm, xmm|m128|mem}
- ROW(3, 1, 1, 0, 50 , 52 , 50 , 0 , 0 , 0 ), // {xmm, m128|mem, xmm}
- ROW(1, 1, 0, 1, 33 , 0 , 0 , 0 , 0 , 0 ), // #383 {<ax>}
- ROW(2, 1, 0, 1, 33 , 10 , 0 , 0 , 0 , 0 ), // #384 {<ax>, i8|u8}
- ROW(2, 1, 0, 0, 27 , 4 , 0 , 0 , 0 , 0 ), // #385 {r16|m16|mem, r16}
- ROW(3, 1, 1, 1, 50 , 51 , 147, 0 , 0 , 0 ), // #386 {xmm, xmm|m128|mem, <xmm0>}
- ROW(2, 1, 1, 0, 111, 148, 0 , 0 , 0 , 0 ), // #387 {bnd, mib}
- ROW(2, 1, 1, 0, 111, 113, 0 , 0 , 0 , 0 ), // #388 {bnd, mem}
- ROW(2, 1, 1, 0, 148, 111, 0 , 0 , 0 , 0 ), // #389 {mib, bnd}
- ROW(1, 1, 1, 0, 149, 0 , 0 , 0 , 0 , 0 ), // #390 {r16|r32|r64}
- ROW(1, 1, 1, 1, 33 , 0 , 0 , 0 , 0 , 0 ), // #391 {<ax>}
- ROW(2, 1, 1, 2, 35 , 36 , 0 , 0 , 0 , 0 ), // #392 {<edx>, <eax>}
- ROW(1, 1, 1, 0, 150, 0 , 0 , 0 , 0 , 0 ), // #393 {mem|m8|m16|m32|m48|m64|m80|m128|m256|m512|m1024}
- ROW(1, 1, 1, 0, 30 , 0 , 0 , 0 , 0 , 0 ), // #394 {m64|mem}
- ROW(0, 0, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #395 {}
- ROW(1, 1, 1, 1, 151, 0 , 0 , 0 , 0 , 0 ), // #396 {<ds:[mem|m512|memBase|zax]>}
- ROW(3, 1, 1, 0, 50 , 65 , 10 , 0 , 0 , 0 ), // #397 {xmm, xmm|m64|mem, i8|u8}
- ROW(3, 1, 1, 0, 50 , 107, 10 , 0 , 0 , 0 ), // #398 {xmm, xmm|m32|mem, i8|u8}
- ROW(5, 0, 1, 4, 52 , 37 , 38 , 152, 153, 0 ), // #399 {m128|mem, <rdx>, <rax>, <rcx>, <rbx>}
- ROW(5, 1, 1, 4, 30 , 35 , 36 , 121, 154, 0 ), // #400 {m64|mem, <edx>, <eax>, <ecx>, <ebx>}
- ROW(4, 1, 1, 4, 36 , 154, 121, 35 , 0 , 0 ), // #401 {<eax>, <ebx>, <ecx>, <edx>}
- ROW(2, 0, 1, 2, 37 , 38 , 0 , 0 , 0 , 0 ), // #402 {<rdx>, <rax>}
- ROW(2, 1, 1, 0, 62 , 51 , 0 , 0 , 0 , 0 ), // #403 {mm, xmm|m128|mem}
- ROW(2, 1, 1, 0, 50 , 141, 0 , 0 , 0 , 0 ), // #404 {xmm, mm|m64|mem}
- ROW(2, 1, 1, 0, 62 , 65 , 0 , 0 , 0 , 0 ), // #405 {mm, xmm|m64|mem}
- ROW(2, 1, 1, 0, 139, 65 , 0 , 0 , 0 , 0 ), // #406 {r32|r64, xmm|m64|mem}
- ROW(2, 1, 1, 0, 50 , 155, 0 , 0 , 0 , 0 ), // #407 {xmm, r32|m32|mem|r64|m64}
- ROW(2, 1, 1, 0, 139, 107, 0 , 0 , 0 , 0 ), // #408 {r32|r64, xmm|m32|mem}
- ROW(2, 1, 1, 2, 34 , 33 , 0 , 0 , 0 , 0 ), // #409 {<dx>, <ax>}
- ROW(1, 1, 1, 1, 36 , 0 , 0 , 0 , 0 , 0 ), // #410 {<eax>}
- ROW(2, 1, 1, 0, 12 , 10 , 0 , 0 , 0 , 0 ), // #411 {i16|u16, i8|u8}
- ROW(3, 1, 1, 0, 28 , 50 , 10 , 0 , 0 , 0 ), // #412 {r32|m32|mem, xmm, i8|u8}
- ROW(1, 1, 1, 0, 102, 0 , 0 , 0 , 0 , 0 ), // #413 {m80|mem}
- ROW(1, 1, 1, 0, 156, 0 , 0 , 0 , 0 , 0 ), // #414 {m16|m32}
- ROW(1, 1, 1, 0, 157, 0 , 0 , 0 , 0 , 0 ), // #415 {m16|m32|m64}
- ROW(1, 1, 1, 0, 158, 0 , 0 , 0 , 0 , 0 ), // #416 {m32|m64|m80|st}
- ROW(1, 1, 1, 0, 21 , 0 , 0 , 0 , 0 , 0 ), // #417 {m16|mem}
- ROW(1, 1, 1, 0, 113, 0 , 0 , 0 , 0 , 0 ), // #418 {mem}
- ROW(1, 1, 1, 0, 159, 0 , 0 , 0 , 0 , 0 ), // #419 {ax|m16|mem}
- ROW(1, 0, 1, 0, 113, 0 , 0 , 0 , 0 , 0 ), // #420 {mem}
- ROW(2, 1, 1, 1, 10 , 36 , 0 , 0 , 0 , 0 ), // #421 {i8|u8, <eax>}
- ROW(2, 1, 1, 0, 160, 161, 0 , 0 , 0 , 0 ), // #422 {al|ax|eax, i8|u8|dx}
- ROW(1, 1, 1, 0, 6 , 0 , 0 , 0 , 0 , 0 ), // #423 {r32}
- ROW(2, 1, 1, 0, 162, 163, 0 , 0 , 0 , 0 ), // #424 {es:[m8|memBase|zdi|m16|m32], dx}
- ROW(1, 1, 1, 0, 10 , 0 , 0 , 0 , 0 , 0 ), // #425 {i8|u8}
- ROW(0, 1, 0, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #426 {}
- ROW(3, 1, 1, 0, 106, 106, 106, 0 , 0 , 0 ), // #427 {k, k, k}
- ROW(2, 1, 1, 0, 106, 106, 0 , 0 , 0 , 0 ), // #428 {k, k}
- ROW(3, 1, 1, 0, 106, 106, 10 , 0 , 0 , 0 ), // #429 {k, k, i8|u8}
- ROW(1, 1, 1, 1, 164, 0 , 0 , 0 , 0 , 0 ), // #430 {<ah>}
- ROW(1, 1, 1, 0, 29 , 0 , 0 , 0 , 0 , 0 ), // #431 {m32|mem}
- ROW(1, 0, 1, 0, 58 , 0 , 0 , 0 , 0 , 0 ), // #432 {m512|mem}
- ROW(2, 1, 1, 0, 149, 150, 0 , 0 , 0 , 0 ), // #433 {r16|r32|r64, mem|m8|m16|m32|m48|m64|m80|m128|m256|m512|m1024}
- ROW(1, 1, 1, 0, 27 , 0 , 0 , 0 , 0 , 0 ), // #434 {r16|m16|mem}
- ROW(1, 1, 1, 0, 139, 0 , 0 , 0 , 0 , 0 ), // #435 {r32|r64}
- ROW(3, 1, 1, 0, 139, 28 , 14 , 0 , 0 , 0 ), // #436 {r32|r64, r32|m32|mem, i32|u32}
- ROW(3, 1, 1, 1, 50 , 50 , 165, 0 , 0 , 0 ), // #437 {xmm, xmm, <ds:[mem|m128|memBase|zdi]>}
- ROW(3, 1, 1, 1, 62 , 62 , 166, 0 , 0 , 0 ), // #438 {mm, mm, <ds:[mem|m64|memBase|zdi]>}
- ROW(3, 1, 1, 3, 167, 121, 35 , 0 , 0 , 0 ), // #439 {<ds:[mem|memBase|zax]>, <ecx>, <edx>}
- ROW(2, 1, 1, 0, 119, 58 , 0 , 0 , 0 , 0 ), // #440 {es:[mem|m512|memBase], m512|mem}
- ROW(2, 1, 1, 0, 62 , 50 , 0 , 0 , 0 , 0 ), // #441 {mm, xmm}
- ROW(2, 1, 1, 0, 6 , 50 , 0 , 0 , 0 , 0 ), // #442 {r32, xmm}
- ROW(2, 1, 1, 0, 30 , 62 , 0 , 0 , 0 , 0 ), // #443 {m64|mem, mm}
- ROW(2, 1, 1, 0, 50 , 62 , 0 , 0 , 0 , 0 ), // #444 {xmm, mm}
- ROW(2, 1, 1, 2, 36 , 121, 0 , 0 , 0 , 0 ), // #445 {<eax>, <ecx>}
- ROW(3, 1, 1, 3, 36 , 121, 154, 0 , 0 , 0 ), // #446 {<eax>, <ecx>, <ebx>}
- ROW(2, 1, 1, 0, 168, 160, 0 , 0 , 0 , 0 ), // #447 {u8|dx, al|ax|eax}
- ROW(2, 1, 1, 0, 163, 169, 0 , 0 , 0 , 0 ), // #448 {dx, ds:[m8|memBase|zsi|m16|m32]}
- ROW(6, 1, 1, 3, 50 , 51 , 10 , 121, 36 , 35 ), // #449 {xmm, xmm|m128|mem, i8|u8, <ecx>, <eax>, <edx>}
- ROW(6, 1, 1, 3, 50 , 51 , 10 , 147, 36 , 35 ), // #450 {xmm, xmm|m128|mem, i8|u8, <xmm0>, <eax>, <edx>}
- ROW(4, 1, 1, 1, 50 , 51 , 10 , 121, 0 , 0 ), // #451 {xmm, xmm|m128|mem, i8|u8, <ecx>}
- ROW(4, 1, 1, 1, 50 , 51 , 10 , 147, 0 , 0 ), // #452 {xmm, xmm|m128|mem, i8|u8, <xmm0>}
- ROW(3, 1, 1, 0, 131, 50 , 10 , 0 , 0 , 0 ), // #453 {r32|m8|mem, xmm, i8|u8}
- ROW(3, 0, 1, 0, 15 , 50 , 10 , 0 , 0 , 0 ), // #454 {r64|m64|mem, xmm, i8|u8}
- ROW(3, 1, 1, 0, 50 , 131, 10 , 0 , 0 , 0 ), // #455 {xmm, r32|m8|mem, i8|u8}
- ROW(3, 1, 1, 0, 50 , 28 , 10 , 0 , 0 , 0 ), // #456 {xmm, r32|m32|mem, i8|u8}
- ROW(3, 0, 1, 0, 50 , 15 , 10 , 0 , 0 , 0 ), // #457 {xmm, r64|m64|mem, i8|u8}
- ROW(3, 1, 1, 0, 64 , 135, 10 , 0 , 0 , 0 ), // #458 {mm|xmm, r32|m16|mem, i8|u8}
- ROW(2, 1, 1, 0, 6 , 64 , 0 , 0 , 0 , 0 ), // #459 {r32, mm|xmm}
- ROW(2, 1, 1, 0, 50 , 10 , 0 , 0 , 0 , 0 ), // #460 {xmm, i8|u8}
- ROW(1, 1, 1, 0, 155, 0 , 0 , 0 , 0 , 0 ), // #461 {r32|m32|mem|r64|m64}
- ROW(2, 1, 1, 0, 31 , 103, 0 , 0 , 0 , 0 ), // #462 {r8lo|r8hi|m8|r16|m16|r32|m32|r64|m64|mem, cl|i8|u8}
- ROW(1, 0, 1, 0, 139, 0 , 0 , 0 , 0 , 0 ), // #463 {r32|r64}
- ROW(3, 1, 1, 3, 35 , 36 , 121, 0 , 0 , 0 ), // #464 {<edx>, <eax>, <ecx>}
- ROW(1, 1, 1, 0, 1 , 0 , 0 , 0 , 0 , 0 ), // #465 {r8lo|r8hi|m8|mem}
- ROW(1, 1, 1, 0, 170, 0 , 0 , 0 , 0 , 0 ), // #466 {r16|m16|mem|r32|r64}
- ROW(3, 0, 1, 0, 171, 171, 171, 0 , 0 , 0 ), // #467 {tmm, tmm, tmm}
- ROW(2, 0, 1, 0, 171, 172, 0 , 0 , 0 , 0 ), // #468 {tmm, tmem}
- ROW(2, 0, 1, 0, 172, 171, 0 , 0 , 0 , 0 ), // #469 {tmem, tmm}
- ROW(1, 0, 1, 0, 171, 0 , 0 , 0 , 0 , 0 ), // #470 {tmm}
- ROW(3, 1, 1, 2, 6 , 35 , 36 , 0 , 0 , 0 ), // #471 {r32, <edx>, <eax>}
- ROW(1, 1, 1, 0, 173, 0 , 0 , 0 , 0 , 0 ), // #472 {ds:[mem|memBase]}
- ROW(6, 1, 1, 0, 56 , 56 , 56 , 56 , 56 , 52 ), // #473 {zmm, zmm, zmm, zmm, zmm, m128|mem}
- ROW(6, 1, 1, 0, 50 , 50 , 50 , 50 , 50 , 52 ), // #474 {xmm, xmm, xmm, xmm, xmm, m128|mem}
- ROW(3, 1, 1, 0, 50 , 50 , 65 , 0 , 0 , 0 ), // #475 {xmm, xmm, xmm|m64|mem}
- ROW(3, 1, 1, 0, 50 , 50 , 110, 0 , 0 , 0 ), // #476 {xmm, xmm, xmm|m16|mem}
- ROW(3, 1, 1, 0, 50 , 50 , 107, 0 , 0 , 0 ), // #477 {xmm, xmm, xmm|m32|mem}
- ROW(2, 1, 1, 0, 53 , 52 , 0 , 0 , 0 , 0 ), // #478 {ymm, m128|mem}
- ROW(2, 1, 1, 0, 174, 65 , 0 , 0 , 0 , 0 ), // #479 {ymm|zmm, xmm|m64|mem}
- ROW(2, 1, 1, 0, 174, 52 , 0 , 0 , 0 , 0 ), // #480 {ymm|zmm, m128|mem}
- ROW(2, 1, 1, 0, 56 , 55 , 0 , 0 , 0 , 0 ), // #481 {zmm, m256|mem}
- ROW(2, 1, 1, 0, 175, 65 , 0 , 0 , 0 , 0 ), // #482 {xmm|ymm|zmm, xmm|m64|mem}
- ROW(2, 1, 1, 0, 175, 107, 0 , 0 , 0 , 0 ), // #483 {xmm|ymm|zmm, m32|mem|xmm}
- ROW(4, 1, 1, 0, 104, 50 , 65 , 10 , 0 , 0 ), // #484 {xmm|k, xmm, xmm|m64|mem, i8|u8}
- ROW(4, 1, 1, 0, 106, 50 , 110, 10 , 0 , 0 ), // #485 {k, xmm, xmm|m16|mem, i8|u8}
- ROW(4, 1, 1, 0, 104, 50 , 107, 10 , 0 , 0 ), // #486 {xmm|k, xmm, xmm|m32|mem, i8|u8}
- ROW(2, 1, 1, 0, 50 , 176, 0 , 0 , 0 , 0 ), // #487 {xmm, xmm|m128|ymm|m256|zmm|m512}
- ROW(2, 1, 1, 0, 139, 110, 0 , 0 , 0 , 0 ), // #488 {r32|r64, xmm|m16|mem}
- ROW(3, 1, 1, 0, 50 , 50 , 155, 0 , 0 , 0 ), // #489 {xmm, xmm, r32|m32|mem|r64|m64}
- ROW(3, 1, 1, 0, 51 , 174, 10 , 0 , 0 , 0 ), // #490 {xmm|m128|mem, ymm|zmm, i8|u8}
- ROW(4, 1, 1, 0, 50 , 50 , 65 , 10 , 0 , 0 ), // #491 {xmm, xmm, xmm|m64|mem, i8|u8}
- ROW(4, 1, 1, 0, 50 , 50 , 107, 10 , 0 , 0 ), // #492 {xmm, xmm, xmm|m32|mem, i8|u8}
- ROW(3, 1, 1, 0, 106, 176, 10 , 0 , 0 , 0 ), // #493 {k, xmm|m128|ymm|m256|zmm|m512, i8|u8}
- ROW(3, 1, 1, 0, 106, 65 , 10 , 0 , 0 , 0 ), // #494 {k, xmm|m64|mem, i8|u8}
- ROW(3, 1, 1, 0, 106, 110, 10 , 0 , 0 , 0 ), // #495 {k, xmm|m16|mem, i8|u8}
- ROW(3, 1, 1, 0, 106, 107, 10 , 0 , 0 , 0 ), // #496 {k, xmm|m32|mem, i8|u8}
- ROW(1, 1, 1, 0, 68 , 0 , 0 , 0 , 0 , 0 ), // #497 {vm32y}
- ROW(1, 1, 1, 0, 69 , 0 , 0 , 0 , 0 , 0 ), // #498 {vm32z}
- ROW(1, 1, 1, 0, 72 , 0 , 0 , 0 , 0 , 0 ), // #499 {vm64z}
- ROW(4, 1, 1, 0, 50 , 50 , 110, 10 , 0 , 0 ), // #500 {xmm, xmm, xmm|m16|mem, i8|u8}
- ROW(4, 1, 1, 0, 56 , 56 , 54 , 10 , 0 , 0 ), // #501 {zmm, zmm, ymm|m256|mem, i8|u8}
- ROW(2, 1, 1, 0, 6 , 96 , 0 , 0 , 0 , 0 ), // #502 {r32, xmm|ymm}
- ROW(2, 1, 1, 0, 175, 177, 0 , 0 , 0 , 0 ), // #503 {xmm|ymm|zmm, xmm|m8|mem|r32}
- ROW(2, 1, 1, 0, 175, 178, 0 , 0 , 0 , 0 ), // #504 {xmm|ymm|zmm, xmm|m32|mem|r32}
- ROW(2, 1, 1, 0, 175, 106, 0 , 0 , 0 , 0 ), // #505 {xmm|ymm|zmm, k}
- ROW(2, 1, 1, 0, 175, 179, 0 , 0 , 0 , 0 ), // #506 {xmm|ymm|zmm, xmm|m16|mem|r32}
- ROW(3, 1, 1, 0, 135, 50 , 10 , 0 , 0 , 0 ), // #507 {r32|m16|mem, xmm, i8|u8}
- ROW(4, 1, 1, 0, 50 , 50 , 131, 10 , 0 , 0 ), // #508 {xmm, xmm, r32|m8|mem, i8|u8}
- ROW(4, 1, 1, 0, 50 , 50 , 28 , 10 , 0 , 0 ), // #509 {xmm, xmm, r32|m32|mem, i8|u8}
- ROW(4, 0, 1, 0, 50 , 50 , 15 , 10 , 0 , 0 ), // #510 {xmm, xmm, r64|m64|mem, i8|u8}
- ROW(4, 1, 1, 0, 50 , 50 , 135, 10 , 0 , 0 ), // #511 {xmm, xmm, r32|m16|mem, i8|u8}
- ROW(2, 1, 1, 0, 106, 175, 0 , 0 , 0 , 0 ), // #512 {k, xmm|ymm|zmm}
- ROW(1, 1, 1, 0, 124, 0 , 0 , 0 , 0 , 0 ), // #513 {rel16|rel32}
- ROW(3, 1, 1, 2, 113, 35 , 36 , 0 , 0 , 0 ), // #514 {mem, <edx>, <eax>}
- ROW(3, 0, 1, 2, 113, 35 , 36 , 0 , 0 , 0 ) // #515 {mem, <edx>, <eax>}
+ ROW(1, 0, 1, 0, 15 , 0 , 0 , 0 , 0 , 0 ), // {r64|m64}
+ ROW(1, 1, 0, 0, 65 , 0 , 0 , 0 , 0 , 0 ), // {ds|es|ss}
+ ROW(1, 1, 1, 0, 66 , 0 , 0 , 0 , 0 , 0 ), // {fs|gs}
+ ROW(1, 1, 1, 0, 67 , 0 , 0 , 0 , 0 , 0 ), // #149 {r16|m16|i8|i16}
+ ROW(1, 1, 0, 0, 68 , 0 , 0 , 0 , 0 , 0 ), // {r32|m32|i32|u32}
+ ROW(1, 0, 1, 0, 69 , 0 , 0 , 0 , 0 , 0 ), // {r64|m64|i32}
+ ROW(1, 1, 0, 0, 70 , 0 , 0 , 0 , 0 , 0 ), // {cs|ss|ds|es}
+ ROW(1, 1, 1, 0, 66 , 0 , 0 , 0 , 0 , 0 ), // {fs|gs}
+ ROW(3, 1, 1, 0, 49 , 71 , 49 , 0 , 0 , 0 ), // #154 {xmm, vm32x, xmm}
+ ROW(3, 1, 1, 0, 52 , 72 , 52 , 0 , 0 , 0 ), // {ymm, vm32y, ymm}
+ ROW(2, 1, 1, 0, 49 , 71 , 0 , 0 , 0 , 0 ), // {xmm, vm32x}
+ ROW(2, 1, 1, 0, 52 , 72 , 0 , 0 , 0 , 0 ), // {ymm, vm32y}
+ ROW(2, 1, 1, 0, 55 , 73 , 0 , 0 , 0 , 0 ), // {zmm, vm32z}
+ ROW(3, 1, 1, 0, 49 , 74 , 49 , 0 , 0 , 0 ), // #159 {xmm, vm64x, xmm}
+ ROW(3, 1, 1, 0, 52 , 75 , 52 , 0 , 0 , 0 ), // {ymm, vm64y, ymm}
+ ROW(2, 1, 1, 0, 49 , 74 , 0 , 0 , 0 , 0 ), // {xmm, vm64x}
+ ROW(2, 1, 1, 0, 52 , 75 , 0 , 0 , 0 , 0 ), // {ymm, vm64y}
+ ROW(2, 1, 1, 0, 55 , 76 , 0 , 0 , 0 , 0 ), // {zmm, vm64z}
+ ROW(2, 1, 1, 0, 51 , 49 , 0 , 0 , 0 , 0 ), // #164 {m128|mem, xmm}
+ ROW(2, 1, 1, 0, 54 , 52 , 0 , 0 , 0 , 0 ), // {m256|mem, ymm}
+ ROW(2, 1, 1, 0, 51 , 49 , 0 , 0 , 0 , 0 ), // {m128|mem, xmm}
+ ROW(2, 1, 1, 0, 54 , 52 , 0 , 0 , 0 , 0 ), // {m256|mem, ymm}
+ ROW(2, 1, 1, 0, 57 , 55 , 0 , 0 , 0 , 0 ), // {m512|mem, zmm}
+ ROW(2, 1, 1, 0, 49 , 51 , 0 , 0 , 0 , 0 ), // #169 {xmm, m128|mem}
+ ROW(2, 1, 1, 0, 52 , 54 , 0 , 0 , 0 , 0 ), // {ymm, m256|mem}
+ ROW(2, 1, 1, 0, 49 , 51 , 0 , 0 , 0 , 0 ), // {xmm, m128|mem}
+ ROW(2, 1, 1, 0, 52 , 54 , 0 , 0 , 0 , 0 ), // {ymm, m256|mem}
+ ROW(2, 1, 1, 0, 55 , 57 , 0 , 0 , 0 , 0 ), // {zmm, m512|mem}
+ ROW(2, 0, 1, 0, 29 , 49 , 0 , 0 , 0 , 0 ), // #174 {r64|m64|mem, xmm}
+ ROW(2, 1, 1, 0, 49 , 64 , 0 , 0 , 0 , 0 ), // {xmm, xmm|m64|mem}
+ ROW(2, 0, 1, 0, 49 , 29 , 0 , 0 , 0 , 0 ), // {xmm, r64|m64|mem}
+ ROW(2, 1, 1, 0, 31 , 49 , 0 , 0 , 0 , 0 ), // {m64|mem, xmm}
+ ROW(2, 1, 1, 0, 31 , 49 , 0 , 0 , 0 , 0 ), // {m64|mem, xmm}
+ ROW(2, 1, 1, 0, 77 , 78 , 0 , 0 , 0 , 0 ), // #179 {ds:[memBase|zsi|m8], es:[memBase|zdi|m8]}
+ ROW(2, 1, 1, 0, 79 , 80 , 0 , 0 , 0 , 0 ), // {ds:[memBase|zsi|m16], es:[memBase|zdi|m16]}
+ ROW(2, 1, 1, 0, 81 , 82 , 0 , 0 , 0 , 0 ), // {ds:[memBase|zsi|m32], es:[memBase|zdi|m32]}
+ ROW(2, 0, 1, 0, 83 , 84 , 0 , 0 , 0 , 0 ), // {ds:[memBase|zsi|m64], es:[memBase|zdi|m64]}
+ ROW(3, 1, 1, 1, 1 , 2 , 85 , 0 , 0 , 0 ), // #183 {r8lo|r8hi|m8|mem, r8lo|r8hi, <al>}
+ ROW(3, 1, 1, 1, 27 , 4 , 36 , 0 , 0 , 0 ), // {r16|m16|mem, r16, <ax>}
+ ROW(3, 1, 1, 1, 28 , 6 , 39 , 0 , 0 , 0 ), // {r32|m32|mem, r32, <eax>}
+ ROW(3, 0, 1, 1, 29 , 8 , 41 , 0 , 0 , 0 ), // {r64|m64|mem, r64, <rax>}
+ ROW(2, 1, 1, 0, 86 , 87 , 0 , 0 , 0 , 0 ), // #187 {k, k|m64|mem}
+ ROW(2, 0, 1, 0, 86 , 8 , 0 , 0 , 0 , 0 ), // {k, r64}
+ ROW(2, 1, 1, 0, 31 , 86 , 0 , 0 , 0 , 0 ), // {m64|mem, k}
+ ROW(2, 0, 1, 0, 8 , 86 , 0 , 0 , 0 , 0 ), // {r64, k}
+ ROW(2, 1, 1, 0, 45 , 88 , 0 , 0 , 0 , 0 ), // #191 {al, ds:[memBase|zsi|m8|mem]}
+ ROW(2, 1, 1, 0, 46 , 89 , 0 , 0 , 0 , 0 ), // {ax, ds:[memBase|zsi|m16|mem]}
+ ROW(2, 1, 1, 0, 47 , 90 , 0 , 0 , 0 , 0 ), // {eax, ds:[memBase|zsi|m32|mem]}
+ ROW(2, 0, 1, 0, 48 , 91 , 0 , 0 , 0 , 0 ), // {rax, ds:[memBase|zsi|m64|mem]}
+ ROW(2, 1, 1, 0, 78 , 77 , 0 , 0 , 0 , 0 ), // #195 {es:[memBase|zdi|m8], ds:[memBase|zsi|m8]}
+ ROW(2, 1, 1, 0, 80 , 79 , 0 , 0 , 0 , 0 ), // {es:[memBase|zdi|m16], ds:[memBase|zsi|m16]}
+ ROW(2, 1, 1, 0, 82 , 81 , 0 , 0 , 0 , 0 ), // {es:[memBase|zdi|m32], ds:[memBase|zsi|m32]}
+ ROW(2, 0, 1, 0, 84 , 83 , 0 , 0 , 0 , 0 ), // {es:[memBase|zdi|m64], ds:[memBase|zsi|m64]}
+ ROW(2, 1, 1, 0, 45 , 92 , 0 , 0 , 0 , 0 ), // #199 {al, es:[memBase|zdi|m8|mem]}
+ ROW(2, 1, 1, 0, 46 , 93 , 0 , 0 , 0 , 0 ), // {ax, es:[memBase|zdi|m16|mem]}
+ ROW(2, 1, 1, 0, 47 , 94 , 0 , 0 , 0 , 0 ), // {eax, es:[memBase|zdi|m32|mem]}
+ ROW(2, 0, 1, 0, 48 , 95 , 0 , 0 , 0 , 0 ), // {rax, es:[memBase|zdi|m64|mem]}
+ ROW(2, 1, 1, 0, 92 , 45 , 0 , 0 , 0 , 0 ), // #203 {es:[memBase|zdi|m8|mem], al}
+ ROW(2, 1, 1, 0, 93 , 46 , 0 , 0 , 0 , 0 ), // {es:[memBase|zdi|m16|mem], ax}
+ ROW(2, 1, 1, 0, 94 , 47 , 0 , 0 , 0 , 0 ), // {es:[memBase|zdi|m32|mem], eax}
+ ROW(2, 0, 1, 0, 95 , 48 , 0 , 0 , 0 , 0 ), // {es:[memBase|zdi|m64|mem], rax}
+ ROW(4, 1, 1, 0, 49 , 49 , 49 , 50 , 0 , 0 ), // #207 {xmm, xmm, xmm, xmm|m128|mem}
+ ROW(4, 1, 1, 0, 49 , 49 , 51 , 49 , 0 , 0 ), // {xmm, xmm, m128|mem, xmm}
+ ROW(4, 1, 1, 0, 52 , 52 , 52 , 53 , 0 , 0 ), // {ymm, ymm, ymm, ymm|m256|mem}
+ ROW(4, 1, 1, 0, 52 , 52 , 54 , 52 , 0 , 0 ), // {ymm, ymm, m256|mem, ymm}
+ ROW(3, 1, 1, 0, 49 , 71 , 49 , 0 , 0 , 0 ), // #211 {xmm, vm32x, xmm}
+ ROW(3, 1, 1, 0, 52 , 71 , 52 , 0 , 0 , 0 ), // {ymm, vm32x, ymm}
+ ROW(2, 1, 1, 0, 96 , 71 , 0 , 0 , 0 , 0 ), // {xmm|ymm, vm32x}
+ ROW(2, 1, 1, 0, 55 , 72 , 0 , 0 , 0 , 0 ), // {zmm, vm32y}
+ ROW(3, 1, 1, 0, 51 , 49 , 49 , 0 , 0 , 0 ), // #215 {m128|mem, xmm, xmm}
+ ROW(3, 1, 1, 0, 54 , 52 , 52 , 0 , 0 , 0 ), // {m256|mem, ymm, ymm}
+ ROW(3, 1, 1, 0, 49 , 49 , 51 , 0 , 0 , 0 ), // {xmm, xmm, m128|mem}
+ ROW(3, 1, 1, 0, 52 , 52 , 54 , 0 , 0 , 0 ), // {ymm, ymm, m256|mem}
+ ROW(2, 1, 1, 0, 31 , 49 , 0 , 0 , 0 , 0 ), // #219 {m64|mem, xmm}
+ ROW(3, 1, 1, 0, 49 , 49 , 31 , 0 , 0 , 0 ), // {xmm, xmm, m64|mem}
+ ROW(2, 1, 1, 0, 31 , 49 , 0 , 0 , 0 , 0 ), // {m64|mem, xmm}
+ ROW(3, 1, 1, 0, 49 , 49 , 31 , 0 , 0 , 0 ), // {xmm, xmm, m64|mem}
+ ROW(2, 1, 1, 0, 21 , 49 , 0 , 0 , 0 , 0 ), // #223 {m16|mem, xmm}
+ ROW(2, 1, 1, 0, 49 , 21 , 0 , 0 , 0 , 0 ), // {xmm, m16|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
+ ROW(3, 1, 1, 0, 49 , 49 , 49 , 0 , 0 , 0 ), // {xmm, xmm, xmm}
+ ROW(5, 1, 1, 0, 49 , 49 , 50 , 49 , 97 , 0 ), // #227 {xmm, xmm, xmm|m128|mem, xmm, i4|u4}
+ ROW(5, 1, 1, 0, 49 , 49 , 49 , 51 , 97 , 0 ), // {xmm, xmm, xmm, m128|mem, i4|u4}
+ ROW(5, 1, 1, 0, 52 , 52 , 53 , 52 , 97 , 0 ), // {ymm, ymm, ymm|m256|mem, ymm, i4|u4}
+ ROW(5, 1, 1, 0, 52 , 52 , 52 , 54 , 97 , 0 ), // {ymm, ymm, ymm, m256|mem, i4|u4}
+ ROW(3, 1, 1, 0, 52 , 53 , 10 , 0 , 0 , 0 ), // #231 {ymm, ymm|m256|mem, i8|u8}
+ ROW(3, 1, 1, 0, 52 , 52 , 53 , 0 , 0 , 0 ), // {ymm, ymm, ymm|m256|mem}
+ ROW(3, 1, 1, 0, 55 , 55 , 60 , 0 , 0 , 0 ), // {zmm, zmm, zmm|m512|mem|i8|u8}
+ ROW(3, 1, 1, 0, 55 , 57 , 10 , 0 , 0 , 0 ), // {zmm, m512|mem, i8|u8}
+ ROW(1, 1, 0, 0, 98 , 0 , 0 , 0 , 0 , 0 ), // #235 {rel16|r16|m16|mem|r32|m32}
+ ROW(1, 1, 1, 0, 99 , 0 , 0 , 0 , 0 , 0 ), // #236 {rel32}
+ ROW(1, 0, 1, 0, 29 , 0 , 0 , 0 , 0 , 0 ), // {r64|m64|mem}
+ ROW(1, 1, 0, 0, 100, 0 , 0 , 0 , 0 , 0 ), // #238 {r16|r32}
+ ROW(1, 1, 1, 0, 32 , 0 , 0 , 0 , 0 , 0 ), // #239 {r8lo|r8hi|m8|r16|m16|r32|m32}
+ ROW(1, 0, 1, 0, 15 , 0 , 0 , 0 , 0 , 0 ), // {r64|m64}
+ ROW(1, 1, 1, 0, 101, 0 , 0 , 0 , 0 , 0 ), // #241 {m32|m64}
+ ROW(2, 1, 1, 0, 102, 103, 0 , 0 , 0 , 0 ), // {st0, st}
+ ROW(2, 1, 1, 0, 103, 102, 0 , 0 , 0 , 0 ), // {st, st0}
+ ROW(1, 1, 1, 0, 104, 0 , 0 , 0 , 0 , 0 ), // #244 {rel8|rel32}
+ ROW(1, 1, 0, 0, 105, 0 , 0 , 0 , 0 , 0 ), // {rel16|r32|m32}
+ ROW(1, 0, 1, 0, 15 , 0 , 0 , 0 , 0 , 0 ), // {r64|m64}
+ ROW(2, 1, 0, 0, 106, 107, 0 , 0 , 0 , 0 ), // #247 {i16, i16|i32}
+ ROW(1, 1, 1, 0, 108, 0 , 0 , 0 , 0 , 0 ), // {m32|mem|m48}
+ ROW(1, 0, 1, 0, 109, 0 , 0 , 0 , 0 , 0 ), // {m80|mem}
+ ROW(2, 1, 1, 0, 4 , 30 , 0 , 0 , 0 , 0 ), // #250 {r16, m32|mem}
+ ROW(2, 1, 1, 0, 6 , 110, 0 , 0 , 0 , 0 ), // {r32, m48|mem}
+ ROW(2, 0, 1, 0, 8 , 109, 0 , 0 , 0 , 0 ), // {r64, m80|mem}
+ ROW(2, 1, 1, 0, 4 , 27 , 0 , 0 , 0 , 0 ), // #253 {r16, r16|m16|mem}
+ ROW(2, 1, 1, 0, 6 , 111, 0 , 0 , 0 , 0 ), // {r32, r32|m16|mem}
+ ROW(2, 0, 1, 0, 8 , 111, 0 , 0 , 0 , 0 ), // {r64, r32|m16|mem}
+ ROW(2, 1, 1, 0, 4 , 9 , 0 , 0 , 0 , 0 ), // #256 {r16, r8lo|r8hi|m8}
+ ROW(2, 1, 1, 0, 6 , 112, 0 , 0 , 0 , 0 ), // {r32, r8lo|r8hi|m8|r16|m16}
+ ROW(2, 0, 1, 0, 8 , 113, 0 , 0 , 0 , 0 ), // {r64, r8lo|m8|r16|m16}
+ ROW(3, 1, 1, 0, 27 , 4 , 114, 0 , 0 , 0 ), // #259 {r16|m16|mem, r16, cl|i8|u8}
+ ROW(3, 1, 1, 0, 28 , 6 , 114, 0 , 0 , 0 ), // {r32|m32|mem, r32, cl|i8|u8}
+ ROW(3, 0, 1, 0, 29 , 8 , 114, 0 , 0 , 0 ), // {r64|m64|mem, r64, cl|i8|u8}
+ ROW(3, 1, 1, 0, 49 , 49 , 50 , 0 , 0 , 0 ), // #262 {xmm, xmm, xmm|m128|mem}
+ ROW(3, 1, 1, 0, 52 , 52 , 53 , 0 , 0 , 0 ), // #263 {ymm, ymm, ymm|m256|mem}
+ ROW(3, 1, 1, 0, 55 , 55 , 56 , 0 , 0 , 0 ), // {zmm, zmm, zmm|m512|mem}
+ ROW(4, 1, 1, 0, 49 , 49 , 50 , 10 , 0 , 0 ), // #265 {xmm, xmm, xmm|m128|mem, i8|u8}
+ ROW(4, 1, 1, 0, 52 , 52 , 53 , 10 , 0 , 0 ), // #266 {ymm, ymm, ymm|m256|mem, i8|u8}
+ ROW(4, 1, 1, 0, 55 , 55 , 56 , 10 , 0 , 0 ), // {zmm, zmm, zmm|m512|mem, i8|u8}
+ ROW(4, 1, 1, 0, 115, 49 , 50 , 10 , 0 , 0 ), // #268 {xmm|k, xmm, xmm|m128|mem, i8|u8}
+ ROW(4, 1, 1, 0, 116, 52 , 53 , 10 , 0 , 0 ), // {ymm|k, ymm, ymm|m256|mem, i8|u8}
+ ROW(4, 1, 1, 0, 86 , 55 , 56 , 10 , 0 , 0 ), // {k, zmm, zmm|m512|mem, i8|u8}
+ ROW(4, 1, 1, 0, 86 , 49 , 50 , 10 , 0 , 0 ), // #271 {k, xmm, xmm|m128|mem, i8|u8}
+ ROW(4, 1, 1, 0, 86 , 52 , 53 , 10 , 0 , 0 ), // {k, ymm, ymm|m256|mem, i8|u8}
+ ROW(4, 1, 1, 0, 86 , 55 , 56 , 10 , 0 , 0 ), // {k, zmm, zmm|m512|mem, i8|u8}
+ ROW(2, 1, 1, 0, 50 , 49 , 0 , 0 , 0 , 0 ), // #274 {xmm|m128|mem, xmm}
+ ROW(2, 1, 1, 0, 53 , 52 , 0 , 0 , 0 , 0 ), // {ymm|m256|mem, ymm}
+ ROW(2, 1, 1, 0, 56 , 55 , 0 , 0 , 0 , 0 ), // {zmm|m512|mem, zmm}
+ ROW(2, 1, 1, 0, 49 , 64 , 0 , 0 , 0 , 0 ), // #277 {xmm, xmm|m64|mem}
+ ROW(2, 1, 1, 0, 52 , 50 , 0 , 0 , 0 , 0 ), // {ymm, xmm|m128|mem}
+ ROW(2, 1, 1, 0, 55 , 53 , 0 , 0 , 0 , 0 ), // {zmm, ymm|m256|mem}
+ ROW(2, 1, 1, 0, 49 , 50 , 0 , 0 , 0 , 0 ), // #280 {xmm, xmm|m128|mem}
+ ROW(2, 1, 1, 0, 52 , 53 , 0 , 0 , 0 , 0 ), // {ymm, ymm|m256|mem}
+ ROW(2, 1, 1, 0, 55 , 56 , 0 , 0 , 0 , 0 ), // {zmm, zmm|m512|mem}
+ ROW(2, 1, 1, 0, 49 , 117, 0 , 0 , 0 , 0 ), // #283 {xmm, xmm|m32|mem}
+ ROW(2, 1, 1, 0, 52 , 64 , 0 , 0 , 0 , 0 ), // {ymm, xmm|m64|mem}
+ ROW(2, 1, 1, 0, 55 , 50 , 0 , 0 , 0 , 0 ), // {zmm, xmm|m128|mem}
+ ROW(3, 1, 1, 0, 64 , 49 , 10 , 0 , 0 , 0 ), // #286 {xmm|m64|mem, xmm, i8|u8}
+ ROW(3, 1, 1, 0, 50 , 52 , 10 , 0 , 0 , 0 ), // #287 {xmm|m128|mem, ymm, i8|u8}
+ ROW(3, 1, 1, 0, 53 , 55 , 10 , 0 , 0 , 0 ), // #288 {ymm|m256|mem, zmm, i8|u8}
+ ROW(3, 1, 1, 0, 49 , 118, 49 , 0 , 0 , 0 ), // #289 {xmm, vm64x|vm64y, xmm}
+ ROW(2, 1, 1, 0, 49 , 118, 0 , 0 , 0 , 0 ), // {xmm, vm64x|vm64y}
+ ROW(2, 1, 1, 0, 52 , 76 , 0 , 0 , 0 , 0 ), // {ymm, vm64z}
+ ROW(3, 1, 1, 0, 49 , 50 , 10 , 0 , 0 , 0 ), // #292 {xmm, xmm|m128|mem, i8|u8}
+ ROW(3, 1, 1, 0, 52 , 53 , 10 , 0 , 0 , 0 ), // {ymm, ymm|m256|mem, i8|u8}
+ ROW(3, 1, 1, 0, 55 , 56 , 10 , 0 , 0 , 0 ), // {zmm, zmm|m512|mem, i8|u8}
+ ROW(2, 1, 1, 0, 49 , 64 , 0 , 0 , 0 , 0 ), // #295 {xmm, xmm|m64|mem}
+ ROW(2, 1, 1, 0, 52 , 53 , 0 , 0 , 0 , 0 ), // {ymm, ymm|m256|mem}
+ ROW(2, 1, 1, 0, 55 , 56 , 0 , 0 , 0 , 0 ), // {zmm, zmm|m512|mem}
+ ROW(4, 1, 1, 0, 86 , 86 , 49 , 50 , 0 , 0 ), // #298 {k, k, xmm, xmm|m128|mem}
+ ROW(4, 1, 1, 0, 86 , 86 , 52 , 53 , 0 , 0 ), // {k, k, ymm, ymm|m256|mem}
+ ROW(4, 1, 1, 0, 86 , 86 , 55 , 56 , 0 , 0 ), // {k, k, zmm, zmm|m512|mem}
+ ROW(3, 1, 1, 0, 115, 49 , 50 , 0 , 0 , 0 ), // #301 {xmm|k, xmm, xmm|m128|mem}
+ ROW(3, 1, 1, 0, 116, 52 , 53 , 0 , 0 , 0 ), // {ymm|k, ymm, ymm|m256|mem}
+ ROW(3, 1, 1, 0, 86 , 55 , 56 , 0 , 0 , 0 ), // {k, zmm, zmm|m512|mem}
+ ROW(2, 1, 1, 0, 117, 49 , 0 , 0 , 0 , 0 ), // #304 {xmm|m32|mem, xmm}
+ ROW(2, 1, 1, 0, 64 , 52 , 0 , 0 , 0 , 0 ), // {xmm|m64|mem, ymm}
+ ROW(2, 1, 1, 0, 50 , 55 , 0 , 0 , 0 , 0 ), // {xmm|m128|mem, zmm}
+ ROW(2, 1, 1, 0, 64 , 49 , 0 , 0 , 0 , 0 ), // #307 {xmm|m64|mem, xmm}
+ ROW(2, 1, 1, 0, 50 , 52 , 0 , 0 , 0 , 0 ), // {xmm|m128|mem, ymm}
+ ROW(2, 1, 1, 0, 53 , 55 , 0 , 0 , 0 , 0 ), // {ymm|m256|mem, zmm}
+ ROW(2, 1, 1, 0, 119, 49 , 0 , 0 , 0 , 0 ), // #310 {xmm|m16|mem, xmm}
+ ROW(2, 1, 1, 0, 117, 52 , 0 , 0 , 0 , 0 ), // {xmm|m32|mem, ymm}
+ ROW(2, 1, 1, 0, 64 , 55 , 0 , 0 , 0 , 0 ), // {xmm|m64|mem, zmm}
+ ROW(2, 1, 1, 0, 49 , 119, 0 , 0 , 0 , 0 ), // #313 {xmm, xmm|m16|mem}
+ ROW(2, 1, 1, 0, 52 , 117, 0 , 0 , 0 , 0 ), // {ymm, xmm|m32|mem}
+ ROW(2, 1, 1, 0, 55 , 64 , 0 , 0 , 0 , 0 ), // {zmm, xmm|m64|mem}
+ ROW(2, 1, 1, 0, 71 , 49 , 0 , 0 , 0 , 0 ), // #316 {vm32x, xmm}
+ ROW(2, 1, 1, 0, 72 , 52 , 0 , 0 , 0 , 0 ), // {vm32y, ymm}
+ ROW(2, 1, 1, 0, 73 , 55 , 0 , 0 , 0 , 0 ), // {vm32z, zmm}
+ ROW(2, 1, 1, 0, 74 , 49 , 0 , 0 , 0 , 0 ), // #319 {vm64x, xmm}
+ ROW(2, 1, 1, 0, 75 , 52 , 0 , 0 , 0 , 0 ), // {vm64y, ymm}
+ ROW(2, 1, 1, 0, 76 , 55 , 0 , 0 , 0 , 0 ), // {vm64z, zmm}
+ ROW(3, 1, 1, 0, 86 , 49 , 50 , 0 , 0 , 0 ), // #322 {k, xmm, xmm|m128|mem}
+ ROW(3, 1, 1, 0, 86 , 52 , 53 , 0 , 0 , 0 ), // {k, ymm, ymm|m256|mem}
+ ROW(3, 1, 1, 0, 86 , 55 , 56 , 0 , 0 , 0 ), // {k, zmm, zmm|m512|mem}
+ ROW(3, 1, 1, 0, 6 , 6 , 28 , 0 , 0 , 0 ), // #325 {r32, r32, r32|m32|mem}
+ ROW(3, 0, 1, 0, 8 , 8 , 29 , 0 , 0 , 0 ), // {r64, r64, r64|m64|mem}
+ ROW(3, 1, 1, 0, 6 , 28 , 6 , 0 , 0 , 0 ), // #327 {r32, r32|m32|mem, r32}
+ ROW(3, 0, 1, 0, 8 , 29 , 8 , 0 , 0 , 0 ), // {r64, r64|m64|mem, r64}
+ ROW(2, 1, 0, 0, 120, 28 , 0 , 0 , 0 , 0 ), // #329 {bnd, r32|m32|mem}
+ ROW(2, 0, 1, 0, 120, 29 , 0 , 0 , 0 , 0 ), // {bnd, r64|m64|mem}
+ ROW(2, 1, 1, 0, 120, 121, 0 , 0 , 0 , 0 ), // #331 {bnd, bnd|mem}
+ ROW(2, 1, 1, 0, 122, 120, 0 , 0 , 0 , 0 ), // {mem, bnd}
+ ROW(2, 1, 0, 0, 4 , 30 , 0 , 0 , 0 , 0 ), // #333 {r16, m32|mem}
+ ROW(2, 1, 0, 0, 6 , 31 , 0 , 0 , 0 , 0 ), // {r32, m64|mem}
+ ROW(1, 1, 1, 0, 100, 0 , 0 , 0 , 0 , 0 ), // #335 {r16|r32}
+ ROW(1, 0, 1, 0, 8 , 0 , 0 , 0 , 0 , 0 ), // #336 {r64}
+ ROW(3, 1, 1, 0, 30 , 6 , 6 , 0 , 0 , 0 ), // #337 {m32|mem, r32, r32}
+ ROW(3, 0, 1, 0, 31 , 8 , 8 , 0 , 0 , 0 ), // {m64|mem, r64, r64}
+ ROW(2, 1, 1, 0, 6 , 32 , 0 , 0 , 0 , 0 ), // #339 {r32, r8lo|r8hi|m8|r16|m16|r32|m32}
+ ROW(2, 0, 1, 0, 8 , 123, 0 , 0 , 0 , 0 ), // {r64, r8lo|m8|r64|m64}
+ ROW(2, 1, 1, 0, 6 , 64 , 0 , 0 , 0 , 0 ), // #341 {r32, xmm|m64|mem}
+ ROW(2, 0, 1, 0, 8 , 64 , 0 , 0 , 0 , 0 ), // {r64, xmm|m64|mem}
+ ROW(2, 1, 1, 0, 49 , 28 , 0 , 0 , 0 , 0 ), // #343 {xmm, r32|m32|mem}
+ ROW(2, 0, 1, 0, 49 , 29 , 0 , 0 , 0 , 0 ), // {xmm, r64|m64|mem}
+ ROW(2, 0, 1, 0, 49 , 29 , 0 , 0 , 0 , 0 ), // #345 {xmm, r64|m64|mem}
+ ROW(2, 1, 1, 0, 49 , 28 , 0 , 0 , 0 , 0 ), // {xmm, r32|m32|mem}
+ ROW(2, 1, 1, 0, 6 , 117, 0 , 0 , 0 , 0 ), // #347 {r32, xmm|m32|mem}
+ ROW(2, 0, 1, 0, 8 , 117, 0 , 0 , 0 , 0 ), // {r64, xmm|m32|mem}
+ ROW(2, 0, 1, 0, 8 , 117, 0 , 0 , 0 , 0 ), // #349 {r64, xmm|m32|mem}
+ ROW(2, 1, 1, 0, 6 , 117, 0 , 0 , 0 , 0 ), // {r32, xmm|m32|mem}
+ ROW(2, 1, 0, 0, 124, 57 , 0 , 0 , 0 , 0 ), // #351 {es:[mem|m512|memBase], m512|mem}
+ ROW(2, 0, 1, 0, 124, 57 , 0 , 0 , 0 , 0 ), // {es:[mem|m512|memBase], m512|mem}
+ ROW(3, 1, 1, 0, 49 , 10 , 10 , 0 , 0 , 0 ), // #353 {xmm, i8|u8, i8|u8}
+ ROW(2, 1, 1, 0, 49 , 49 , 0 , 0 , 0 , 0 ), // #354 {xmm, xmm}
+ ROW(0, 1, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #355 {}
+ ROW(1, 1, 1, 0, 103, 0 , 0 , 0 , 0 , 0 ), // #356 {st}
+ ROW(0, 1, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #357 {}
+ ROW(1, 1, 1, 0, 125, 0 , 0 , 0 , 0 , 0 ), // #358 {m32|m64|st}
+ ROW(2, 1, 1, 0, 49 , 49 , 0 , 0 , 0 , 0 ), // #359 {xmm, xmm}
+ ROW(4, 1, 1, 0, 49 , 49 , 10 , 10 , 0 , 0 ), // {xmm, xmm, i8|u8, i8|u8}
+ ROW(2, 1, 0, 0, 6 , 51 , 0 , 0 , 0 , 0 ), // #361 {r32, m128|mem}
+ ROW(2, 0, 1, 0, 8 , 51 , 0 , 0 , 0 , 0 ), // {r64, m128|mem}
+ ROW(2, 1, 0, 2, 39 , 126, 0 , 0 , 0 , 0 ), // #363 {<eax>, <ecx>}
+ ROW(2, 0, 1, 2, 127, 126, 0 , 0 , 0 , 0 ), // {<eax|rax>, <ecx>}
+ ROW(3, 1, 0, 3, 39 , 38 , 126, 0 , 0 , 0 ), // #365 {<eax>, <edx>, <ecx>}
+ ROW(3, 0, 1, 3, 127, 38 , 126, 0 , 0 , 0 ), // {<eax|rax>, <edx>, <ecx>}
+ ROW(2, 1, 0, 1, 128, 129, 0 , 0 , 0 , 0 ), // #367 {<cx|ecx>, rel8}
+ ROW(2, 0, 1, 1, 130, 129, 0 , 0 , 0 , 0 ), // {<ecx|rcx>, rel8}
+ ROW(2, 1, 1, 0, 86 , 131, 0 , 0 , 0 , 0 ), // #369 {k, k|m8|mem|r32}
+ ROW(2, 1, 1, 0, 132, 86 , 0 , 0 , 0 , 0 ), // {m8|mem|r32, k}
+ ROW(2, 1, 1, 0, 86 , 133, 0 , 0 , 0 , 0 ), // #371 {k, k|m32|mem|r32}
+ ROW(2, 1, 1, 0, 28 , 86 , 0 , 0 , 0 , 0 ), // {m32|mem|r32, k}
+ ROW(2, 1, 1, 0, 86 , 134, 0 , 0 , 0 , 0 ), // #373 {k, k|m16|mem|r32}
+ ROW(2, 1, 1, 0, 111, 86 , 0 , 0 , 0 , 0 ), // {m16|mem|r32, k}
+ ROW(2, 1, 0, 0, 4 , 30 , 0 , 0 , 0 , 0 ), // #375 {r16, m32|mem}
+ ROW(2, 1, 0, 0, 6 , 110, 0 , 0 , 0 , 0 ), // {r32, m48|mem}
+ ROW(2, 1, 1, 0, 100, 135, 0 , 0 , 0 , 0 ), // #377 {r16|r32, mem|m8|m16|m32|m48|m64|m80|m128|m256|m512|m1024}
+ ROW(2, 0, 1, 0, 8 , 135, 0 , 0 , 0 , 0 ), // {r64, mem|m8|m16|m32|m48|m64|m80|m128|m256|m512|m1024}
+ ROW(1, 1, 1, 0, 6 , 0 , 0 , 0 , 0 , 0 ), // #379 {r32}
+ ROW(1, 0, 1, 0, 8 , 0 , 0 , 0 , 0 , 0 ), // {r64}
+ ROW(3, 1, 1, 0, 6 , 28 , 14 , 0 , 0 , 0 ), // #381 {r32, r32|m32|mem, i32|u32}
+ ROW(3, 0, 1, 0, 8 , 28 , 14 , 0 , 0 , 0 ), // {r64, r32|m32|mem, i32|u32}
+ ROW(2, 1, 1, 0, 63 , 28 , 0 , 0 , 0 , 0 ), // #383 {mm|xmm, r32|m32|mem}
+ ROW(2, 1, 1, 0, 28 , 63 , 0 , 0 , 0 , 0 ), // {r32|m32|mem, mm|xmm}
+ ROW(2, 1, 1, 0, 124, 57 , 0 , 0 , 0 , 0 ), // #385 {es:[mem|m512|memBase], m512|mem}
+ ROW(2, 1, 1, 0, 124, 57 , 0 , 0 , 0 , 0 ), // {es:[mem|m512|memBase], m512|mem}
+ ROW(2, 1, 1, 0, 49 , 64 , 0 , 0 , 0 , 0 ), // #387 {xmm, xmm|m64|mem}
+ ROW(2, 1, 1, 0, 31 , 49 , 0 , 0 , 0 , 0 ), // {m64|mem, xmm}
+ ROW(2, 1, 1, 0, 49 , 117, 0 , 0 , 0 , 0 ), // #389 {xmm, xmm|m32|mem}
+ ROW(2, 1, 1, 0, 30 , 49 , 0 , 0 , 0 , 0 ), // {m32|mem, xmm}
+ ROW(2, 0, 1, 0, 4 , 27 , 0 , 0 , 0 , 0 ), // #391 {r16, r16|m16|mem}
+ ROW(2, 0, 1, 0, 136, 28 , 0 , 0 , 0 , 0 ), // {r32|r64, r32|m32|mem}
+ ROW(4, 1, 1, 1, 6 , 6 , 28 , 38 , 0 , 0 ), // #393 {r32, r32, r32|m32|mem, <edx>}
+ ROW(4, 0, 1, 1, 8 , 8 , 29 , 40 , 0 , 0 ), // {r64, r64, r64|m64|mem, <rdx>}
+ ROW(2, 1, 1, 0, 61 , 62 , 0 , 0 , 0 , 0 ), // #395 {mm, mm|m64|mem}
+ ROW(2, 1, 1, 0, 49 , 50 , 0 , 0 , 0 , 0 ), // {xmm, xmm|m128|mem}
+ ROW(3, 1, 1, 0, 61 , 62 , 10 , 0 , 0 , 0 ), // #397 {mm, mm|m64|mem, i8|u8}
+ ROW(3, 1, 1, 0, 49 , 50 , 10 , 0 , 0 , 0 ), // {xmm, xmm|m128|mem, i8|u8}
+ ROW(3, 1, 1, 0, 6 , 63 , 10 , 0 , 0 , 0 ), // #399 {r32, mm|xmm, i8|u8}
+ ROW(3, 1, 1, 0, 21 , 49 , 10 , 0 , 0 , 0 ), // {m16|mem, xmm, i8|u8}
+ ROW(2, 1, 1, 0, 61 , 137, 0 , 0 , 0 , 0 ), // #401 {mm, i8|u8|mm|m64|mem}
+ ROW(2, 1, 1, 0, 49 , 58 , 0 , 0 , 0 , 0 ), // {xmm, i8|u8|xmm|m128|mem}
+ ROW(1, 1, 1, 0, 28 , 0 , 0 , 0 , 0 , 0 ), // #403 {r32|m32|mem}
+ ROW(1, 0, 1, 0, 29 , 0 , 0 , 0 , 0 , 0 ), // {r64|m64|mem}
+ ROW(2, 1, 1, 0, 61 , 138, 0 , 0 , 0 , 0 ), // #405 {mm, mm|m32|mem}
+ ROW(2, 1, 1, 0, 49 , 50 , 0 , 0 , 0 , 0 ), // {xmm, xmm|m128|mem}
+ ROW(2, 1, 1, 0, 32 , 114, 0 , 0 , 0 , 0 ), // #407 {r8lo|r8hi|m8|r16|m16|r32|m32, cl|i8|u8}
+ ROW(2, 0, 1, 0, 15 , 114, 0 , 0 , 0 , 0 ), // {r64|m64, cl|i8|u8}
+ ROW(1, 1, 0, 0, 6 , 0 , 0 , 0 , 0 , 0 ), // #409 {r32}
+ ROW(1, 0, 1, 0, 8 , 0 , 0 , 0 , 0 , 0 ), // {r64}
+ ROW(0, 1, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #411 {}
+ ROW(1, 1, 1, 0, 139, 0 , 0 , 0 , 0 , 0 ), // {u16}
+ ROW(3, 1, 1, 0, 6 , 28 , 10 , 0 , 0 , 0 ), // #413 {r32, r32|m32|mem, i8|u8}
+ ROW(3, 0, 1, 0, 8 , 29 , 10 , 0 , 0 , 0 ), // {r64, r64|m64|mem, i8|u8}
+ ROW(1, 1, 1, 0, 140, 0 , 0 , 0 , 0 , 0 ), // #415 {r16|m16|mem|r32}
+ ROW(1, 0, 1, 0, 141, 0 , 0 , 0 , 0 , 0 ), // {r64|m16|mem}
+ ROW(1, 1, 0, 0, 142, 0 , 0 , 0 , 0 , 0 ), // #417 {ds:[mem|memBase]}
+ ROW(1, 0, 1, 0, 142, 0 , 0 , 0 , 0 , 0 ), // {ds:[mem|memBase]}
+ ROW(4, 1, 1, 0, 49 , 49 , 50 , 49 , 0 , 0 ), // #419 {xmm, xmm, xmm|m128|mem, xmm}
+ ROW(4, 1, 1, 0, 52 , 52 , 53 , 52 , 0 , 0 ), // {ymm, ymm, ymm|m256|mem, ymm}
+ ROW(2, 1, 1, 0, 49 , 143, 0 , 0 , 0 , 0 ), // #421 {xmm, xmm|m128|ymm|m256}
+ ROW(2, 1, 1, 0, 52 , 56 , 0 , 0 , 0 , 0 ), // {ymm, zmm|m512|mem}
+ ROW(2, 1, 1, 0, 6 , 119, 0 , 0 , 0 , 0 ), // #423 {r32, xmm|m16|mem}
+ ROW(2, 0, 1, 0, 8 , 119, 0 , 0 , 0 , 0 ), // {r64, xmm|m16|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 28 , 0 , 0 , 0 ), // #425 {xmm, xmm, r32|m32|mem}
+ ROW(3, 0, 1, 0, 49 , 49 , 29 , 0 , 0 , 0 ), // {xmm, xmm, r64|m64|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 13 , 0 , 0 , 0 ), // #427 {xmm, xmm, r32|m32}
+ ROW(3, 0, 1, 0, 49 , 49 , 15 , 0 , 0 , 0 ), // {xmm, xmm, r64|m64}
+ ROW(4, 1, 1, 0, 49 , 49 , 49 , 64 , 0 , 0 ), // #429 {xmm, xmm, xmm, xmm|m64|mem}
+ ROW(4, 1, 1, 0, 49 , 49 , 31 , 49 , 0 , 0 ), // {xmm, xmm, m64|mem, xmm}
+ ROW(4, 1, 1, 0, 49 , 49 , 49 , 117, 0 , 0 ), // #431 {xmm, xmm, xmm, xmm|m32|mem}
+ ROW(4, 1, 1, 0, 49 , 49 , 30 , 49 , 0 , 0 ), // {xmm, xmm, m32|mem, xmm}
+ ROW(4, 1, 1, 0, 52 , 52 , 50 , 10 , 0 , 0 ), // #433 {ymm, ymm, xmm|m128|mem, i8|u8}
+ ROW(4, 1, 1, 0, 55 , 55 , 50 , 10 , 0 , 0 ), // {zmm, zmm, xmm|m128|mem, i8|u8}
+ ROW(1, 1, 0, 1, 39 , 0 , 0 , 0 , 0 , 0 ), // #435 {<eax>}
+ ROW(1, 0, 1, 1, 41 , 0 , 0 , 0 , 0 , 0 ), // #436 {<rax>}
+ ROW(2, 1, 1, 0, 28 , 49 , 0 , 0 , 0 , 0 ), // #437 {r32|m32|mem, xmm}
+ ROW(2, 1, 1, 0, 49 , 28 , 0 , 0 , 0 , 0 ), // {xmm, r32|m32|mem}
+ ROW(2, 1, 1, 0, 111, 49 , 0 , 0 , 0 , 0 ), // #439 {r32|m16|mem, xmm}
+ ROW(2, 1, 1, 0, 49 , 111, 0 , 0 , 0 , 0 ), // {xmm, r32|m16|mem}
+ ROW(2, 1, 0, 0, 28 , 6 , 0 , 0 , 0 , 0 ), // #441 {r32|m32|mem, r32}
+ ROW(2, 0, 1, 0, 29 , 8 , 0 , 0 , 0 , 0 ), // {r64|m64|mem, r64}
+ ROW(2, 1, 0, 0, 6 , 28 , 0 , 0 , 0 , 0 ), // #443 {r32, r32|m32|mem}
+ ROW(2, 0, 1, 0, 8 , 29 , 0 , 0 , 0 , 0 ), // {r64, r64|m64|mem}
+ ROW(2, 1, 1, 0, 144, 64 , 0 , 0 , 0 , 0 ), // #445 {xmm|ymm|zmm, xmm|m64|mem}
+ ROW(2, 0, 1, 0, 144, 8 , 0 , 0 , 0 , 0 ), // {xmm|ymm|zmm, r64}
+ ROW(3, 1, 1, 0, 49 , 49 , 58 , 0 , 0 , 0 ), // #447 {xmm, xmm, xmm|m128|mem|i8|u8}
+ ROW(3, 1, 1, 0, 49 , 51 , 145, 0 , 0 , 0 ), // {xmm, m128|mem, i8|u8|xmm}
+ ROW(2, 1, 1, 0, 71 , 96 , 0 , 0 , 0 , 0 ), // #449 {vm32x, xmm|ymm}
+ ROW(2, 1, 1, 0, 72 , 55 , 0 , 0 , 0 , 0 ), // {vm32y, zmm}
+ ROW(2, 1, 1, 0, 118, 49 , 0 , 0 , 0 , 0 ), // #451 {vm64x|vm64y, xmm}
+ ROW(2, 1, 1, 0, 76 , 52 , 0 , 0 , 0 , 0 ), // {vm64z, ymm}
+ ROW(3, 1, 1, 0, 49 , 49 , 50 , 0 , 0 , 0 ), // #453 {xmm, xmm, xmm|m128|mem}
+ ROW(3, 1, 1, 0, 49 , 51 , 49 , 0 , 0 , 0 ), // {xmm, m128|mem, xmm}
+ ROW(1, 1, 0, 1, 36 , 0 , 0 , 0 , 0 , 0 ), // #455 {<ax>}
+ ROW(2, 1, 0, 1, 36 , 10 , 0 , 0 , 0 , 0 ), // #456 {<ax>, i8|u8}
+ ROW(2, 1, 0, 0, 27 , 4 , 0 , 0 , 0 , 0 ), // #457 {r16|m16|mem, r16}
+ ROW(3, 1, 1, 1, 49 , 50 , 146, 0 , 0 , 0 ), // #458 {xmm, xmm|m128|mem, <xmm0>}
+ ROW(2, 1, 1, 0, 120, 147, 0 , 0 , 0 , 0 ), // #459 {bnd, mib}
+ ROW(2, 1, 1, 0, 120, 122, 0 , 0 , 0 , 0 ), // #460 {bnd, mem}
+ ROW(2, 1, 1, 0, 147, 120, 0 , 0 , 0 , 0 ), // #461 {mib, bnd}
+ ROW(1, 1, 1, 1, 36 , 0 , 0 , 0 , 0 , 0 ), // #462 {<ax>}
+ ROW(2, 1, 1, 2, 38 , 39 , 0 , 0 , 0 , 0 ), // #463 {<edx>, <eax>}
+ ROW(1, 1, 1, 0, 122, 0 , 0 , 0 , 0 , 0 ), // #464 {mem}
+ ROW(1, 1, 1, 0, 31 , 0 , 0 , 0 , 0 , 0 ), // #465 {m64|mem}
+ ROW(0, 0, 1, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #466 {}
+ ROW(1, 1, 1, 1, 148, 0 , 0 , 0 , 0 , 0 ), // #467 {<ds:[mem|m512|memBase|zax]>}
+ ROW(3, 1, 1, 0, 49 , 64 , 10 , 0 , 0 , 0 ), // #468 {xmm, xmm|m64|mem, i8|u8}
+ ROW(3, 1, 1, 0, 49 , 117, 10 , 0 , 0 , 0 ), // #469 {xmm, xmm|m32|mem, i8|u8}
+ ROW(5, 0, 1, 4, 51 , 40 , 41 , 149, 150, 0 ), // #470 {m128|mem, <rdx>, <rax>, <rcx>, <rbx>}
+ ROW(5, 1, 1, 4, 31 , 38 , 39 , 126, 151, 0 ), // #471 {m64|mem, <edx>, <eax>, <ecx>, <ebx>}
+ ROW(4, 1, 1, 4, 39 , 151, 126, 38 , 0 , 0 ), // #472 {<eax>, <ebx>, <ecx>, <edx>}
+ ROW(2, 0, 1, 2, 40 , 41 , 0 , 0 , 0 , 0 ), // #473 {<rdx>, <rax>}
+ ROW(2, 1, 1, 0, 61 , 50 , 0 , 0 , 0 , 0 ), // #474 {mm, xmm|m128|mem}
+ ROW(2, 1, 1, 0, 49 , 62 , 0 , 0 , 0 , 0 ), // #475 {xmm, mm|m64|mem}
+ ROW(2, 1, 1, 0, 61 , 64 , 0 , 0 , 0 , 0 ), // #476 {mm, xmm|m64|mem}
+ ROW(2, 1, 1, 2, 37 , 36 , 0 , 0 , 0 , 0 ), // #477 {<dx>, <ax>}
+ ROW(1, 1, 1, 1, 39 , 0 , 0 , 0 , 0 , 0 ), // #478 {<eax>}
+ ROW(2, 1, 1, 0, 12 , 10 , 0 , 0 , 0 , 0 ), // #479 {i16|u16, i8|u8}
+ ROW(3, 1, 1, 0, 28 , 49 , 10 , 0 , 0 , 0 ), // #480 {r32|m32|mem, xmm, i8|u8}
+ ROW(1, 1, 1, 0, 109, 0 , 0 , 0 , 0 , 0 ), // #481 {m80|mem}
+ ROW(1, 1, 1, 0, 152, 0 , 0 , 0 , 0 , 0 ), // #482 {m16|m32}
+ ROW(1, 1, 1, 0, 153, 0 , 0 , 0 , 0 , 0 ), // #483 {m16|m32|m64}
+ ROW(1, 1, 1, 0, 154, 0 , 0 , 0 , 0 , 0 ), // #484 {m32|m64|m80|st}
+ ROW(1, 1, 1, 0, 21 , 0 , 0 , 0 , 0 , 0 ), // #485 {m16|mem}
+ ROW(1, 1, 1, 0, 155, 0 , 0 , 0 , 0 , 0 ), // #486 {ax|m16|mem}
+ ROW(1, 0, 1, 0, 122, 0 , 0 , 0 , 0 , 0 ), // #487 {mem}
+ ROW(2, 1, 1, 1, 10 , 39 , 0 , 0 , 0 , 0 ), // #488 {i8|u8, <eax>}
+ ROW(2, 1, 1, 0, 156, 157, 0 , 0 , 0 , 0 ), // #489 {al|ax|eax, i8|u8|dx}
+ ROW(2, 1, 1, 0, 158, 159, 0 , 0 , 0 , 0 ), // #490 {es:[memBase|zdi|m8|m16|m32], dx}
+ ROW(1, 1, 1, 0, 10 , 0 , 0 , 0 , 0 , 0 ), // #491 {i8|u8}
+ ROW(0, 1, 0, 0, 0 , 0 , 0 , 0 , 0 , 0 ), // #492 {}
+ ROW(3, 1, 1, 0, 86 , 86 , 86 , 0 , 0 , 0 ), // #493 {k, k, k}
+ ROW(2, 1, 1, 0, 86 , 86 , 0 , 0 , 0 , 0 ), // #494 {k, k}
+ ROW(3, 1, 1, 0, 86 , 86 , 10 , 0 , 0 , 0 ), // #495 {k, k, i8|u8}
+ ROW(1, 1, 1, 1, 160, 0 , 0 , 0 , 0 , 0 ), // #496 {<ah>}
+ ROW(1, 1, 1, 0, 30 , 0 , 0 , 0 , 0 , 0 ), // #497 {m32|mem}
+ ROW(1, 0, 1, 0, 57 , 0 , 0 , 0 , 0 , 0 ), // #498 {m512|mem}
+ ROW(1, 1, 1, 0, 27 , 0 , 0 , 0 , 0 , 0 ), // #499 {r16|m16|mem}
+ ROW(3, 1, 1, 1, 49 , 49 , 161, 0 , 0 , 0 ), // #500 {xmm, xmm, <ds:[mem|m128|memBase|zdi]>}
+ ROW(3, 1, 1, 1, 61 , 61 , 162, 0 , 0 , 0 ), // #501 {mm, mm, <ds:[mem|m64|memBase|zdi]>}
+ ROW(3, 1, 1, 3, 163, 126, 38 , 0 , 0 , 0 ), // #502 {<ds:[mem|memBase|zax]>, <ecx>, <edx>}
+ ROW(2, 1, 1, 0, 61 , 49 , 0 , 0 , 0 , 0 ), // #503 {mm, xmm}
+ ROW(2, 1, 1, 0, 6 , 49 , 0 , 0 , 0 , 0 ), // #504 {r32, xmm}
+ ROW(2, 1, 1, 0, 31 , 61 , 0 , 0 , 0 , 0 ), // #505 {m64|mem, mm}
+ ROW(2, 1, 1, 0, 49 , 61 , 0 , 0 , 0 , 0 ), // #506 {xmm, mm}
+ ROW(2, 1, 1, 2, 39 , 126, 0 , 0 , 0 , 0 ), // #507 {<eax>, <ecx>}
+ ROW(3, 1, 1, 3, 39 , 126, 151, 0 , 0 , 0 ), // #508 {<eax>, <ecx>, <ebx>}
+ ROW(2, 1, 1, 0, 164, 156, 0 , 0 , 0 , 0 ), // #509 {u8|dx, al|ax|eax}
+ ROW(2, 1, 1, 0, 159, 165, 0 , 0 , 0 , 0 ), // #510 {dx, ds:[memBase|zsi|m8|m16|m32]}
+ ROW(6, 1, 1, 3, 49 , 50 , 10 , 126, 39 , 38 ), // #511 {xmm, xmm|m128|mem, i8|u8, <ecx>, <eax>, <edx>}
+ ROW(6, 1, 1, 3, 49 , 50 , 10 , 146, 39 , 38 ), // #512 {xmm, xmm|m128|mem, i8|u8, <xmm0>, <eax>, <edx>}
+ ROW(4, 1, 1, 1, 49 , 50 , 10 , 126, 0 , 0 ), // #513 {xmm, xmm|m128|mem, i8|u8, <ecx>}
+ ROW(4, 1, 1, 1, 49 , 50 , 10 , 146, 0 , 0 ), // #514 {xmm, xmm|m128|mem, i8|u8, <xmm0>}
+ ROW(3, 1, 1, 0, 132, 49 , 10 , 0 , 0 , 0 ), // #515 {r32|m8|mem, xmm, i8|u8}
+ ROW(3, 0, 1, 0, 29 , 49 , 10 , 0 , 0 , 0 ), // #516 {r64|m64|mem, xmm, i8|u8}
+ ROW(3, 1, 1, 0, 49 , 132, 10 , 0 , 0 , 0 ), // #517 {xmm, r32|m8|mem, i8|u8}
+ ROW(3, 1, 1, 0, 49 , 28 , 10 , 0 , 0 , 0 ), // #518 {xmm, r32|m32|mem, i8|u8}
+ ROW(3, 0, 1, 0, 49 , 29 , 10 , 0 , 0 , 0 ), // #519 {xmm, r64|m64|mem, i8|u8}
+ ROW(3, 1, 1, 0, 63 , 111, 10 , 0 , 0 , 0 ), // #520 {mm|xmm, r32|m16|mem, i8|u8}
+ ROW(2, 1, 1, 0, 6 , 63 , 0 , 0 , 0 , 0 ), // #521 {r32, mm|xmm}
+ ROW(2, 1, 1, 0, 49 , 10 , 0 , 0 , 0 , 0 ), // #522 {xmm, i8|u8}
+ ROW(1, 0, 1, 0, 136, 0 , 0 , 0 , 0 , 0 ), // #523 {r32|r64}
+ ROW(3, 1, 1, 3, 38 , 39 , 126, 0 , 0 , 0 ), // #524 {<edx>, <eax>, <ecx>}
+ ROW(1, 1, 1, 0, 1 , 0 , 0 , 0 , 0 , 0 ), // #525 {r8lo|r8hi|m8|mem}
+ ROW(3, 0, 1, 0, 166, 166, 166, 0 , 0 , 0 ), // #526 {tmm, tmm, tmm}
+ ROW(2, 0, 1, 0, 166, 167, 0 , 0 , 0 , 0 ), // #527 {tmm, tmem}
+ ROW(2, 0, 1, 0, 167, 166, 0 , 0 , 0 , 0 ), // #528 {tmem, tmm}
+ ROW(1, 0, 1, 0, 166, 0 , 0 , 0 , 0 , 0 ), // #529 {tmm}
+ ROW(3, 1, 1, 2, 6 , 38 , 39 , 0 , 0 , 0 ), // #530 {r32, <edx>, <eax>}
+ ROW(6, 1, 1, 0, 55 , 55 , 55 , 55 , 55 , 51 ), // #531 {zmm, zmm, zmm, zmm, zmm, m128|mem}
+ ROW(6, 1, 1, 0, 49 , 49 , 49 , 49 , 49 , 51 ), // #532 {xmm, xmm, xmm, xmm, xmm, m128|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 64 , 0 , 0 , 0 ), // #533 {xmm, xmm, xmm|m64|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 119, 0 , 0 , 0 ), // #534 {xmm, xmm, xmm|m16|mem}
+ ROW(3, 1, 1, 0, 49 , 49 , 117, 0 , 0 , 0 ), // #535 {xmm, xmm, xmm|m32|mem}
+ ROW(2, 1, 1, 0, 96 , 21 , 0 , 0 , 0 , 0 ), // #536 {xmm|ymm, m16|mem}
+ ROW(2, 1, 1, 0, 52 , 51 , 0 , 0 , 0 , 0 ), // #537 {ymm, m128|mem}
+ ROW(2, 1, 1, 0, 168, 64 , 0 , 0 , 0 , 0 ), // #538 {ymm|zmm, xmm|m64|mem}
+ ROW(2, 1, 1, 0, 168, 51 , 0 , 0 , 0 , 0 ), // #539 {ymm|zmm, m128|mem}
+ ROW(2, 1, 1, 0, 55 , 54 , 0 , 0 , 0 , 0 ), // #540 {zmm, m256|mem}
+ ROW(2, 1, 1, 0, 144, 117, 0 , 0 , 0 , 0 ), // #541 {xmm|ymm|zmm, m32|mem|xmm}
+ ROW(4, 1, 1, 0, 115, 49 , 64 , 10 , 0 , 0 ), // #542 {xmm|k, xmm, xmm|m64|mem, i8|u8}
+ ROW(4, 1, 1, 0, 86 , 49 , 119, 10 , 0 , 0 ), // #543 {k, xmm, xmm|m16|mem, i8|u8}
+ ROW(4, 1, 1, 0, 115, 49 , 117, 10 , 0 , 0 ), // #544 {xmm|k, xmm, xmm|m32|mem, i8|u8}
+ ROW(2, 1, 1, 0, 49 , 169, 0 , 0 , 0 , 0 ), // #545 {xmm, xmm|m128|ymm|m256|zmm|m512}
+ ROW(3, 1, 1, 0, 50 , 168, 10 , 0 , 0 , 0 ), // #546 {xmm|m128|mem, ymm|zmm, i8|u8}
+ ROW(4, 1, 1, 0, 49 , 49 , 64 , 10 , 0 , 0 ), // #547 {xmm, xmm, xmm|m64|mem, i8|u8}
+ ROW(4, 1, 1, 0, 49 , 49 , 117, 10 , 0 , 0 ), // #548 {xmm, xmm, xmm|m32|mem, i8|u8}
+ ROW(3, 1, 1, 0, 86 , 169, 10 , 0 , 0 , 0 ), // #549 {k, xmm|m128|ymm|m256|zmm|m512, i8|u8}
+ ROW(3, 1, 1, 0, 86 , 64 , 10 , 0 , 0 , 0 ), // #550 {k, xmm|m64|mem, i8|u8}
+ ROW(3, 1, 1, 0, 86 , 119, 10 , 0 , 0 , 0 ), // #551 {k, xmm|m16|mem, i8|u8}
+ ROW(3, 1, 1, 0, 86 , 117, 10 , 0 , 0 , 0 ), // #552 {k, xmm|m32|mem, i8|u8}
+ ROW(1, 1, 1, 0, 72 , 0 , 0 , 0 , 0 , 0 ), // #553 {vm32y}
+ ROW(1, 1, 1, 0, 73 , 0 , 0 , 0 , 0 , 0 ), // #554 {vm32z}
+ ROW(1, 1, 1, 0, 76 , 0 , 0 , 0 , 0 , 0 ), // #555 {vm64z}
+ ROW(4, 1, 1, 0, 49 , 49 , 119, 10 , 0 , 0 ), // #556 {xmm, xmm, xmm|m16|mem, i8|u8}
+ ROW(4, 1, 1, 0, 55 , 55 , 53 , 10 , 0 , 0 ), // #557 {zmm, zmm, ymm|m256|mem, i8|u8}
+ ROW(2, 1, 1, 0, 6 , 96 , 0 , 0 , 0 , 0 ), // #558 {r32, xmm|ymm}
+ ROW(2, 1, 1, 0, 144, 170, 0 , 0 , 0 , 0 ), // #559 {xmm|ymm|zmm, xmm|m8|mem|r32}
+ ROW(2, 1, 1, 0, 144, 171, 0 , 0 , 0 , 0 ), // #560 {xmm|ymm|zmm, xmm|m32|mem|r32}
+ ROW(2, 1, 1, 0, 144, 86 , 0 , 0 , 0 , 0 ), // #561 {xmm|ymm|zmm, k}
+ ROW(2, 1, 1, 0, 144, 172, 0 , 0 , 0 , 0 ), // #562 {xmm|ymm|zmm, xmm|m16|mem|r32}
+ ROW(3, 1, 1, 0, 111, 49 , 10 , 0 , 0 , 0 ), // #563 {r32|m16|mem, xmm, i8|u8}
+ ROW(4, 1, 1, 0, 49 , 49 , 132, 10 , 0 , 0 ), // #564 {xmm, xmm, r32|m8|mem, i8|u8}
+ ROW(4, 1, 1, 0, 49 , 49 , 28 , 10 , 0 , 0 ), // #565 {xmm, xmm, r32|m32|mem, i8|u8}
+ ROW(4, 0, 1, 0, 49 , 49 , 29 , 10 , 0 , 0 ), // #566 {xmm, xmm, r64|m64|mem, i8|u8}
+ ROW(4, 1, 1, 0, 49 , 49 , 111, 10 , 0 , 0 ), // #567 {xmm, xmm, r32|m16|mem, i8|u8}
+ ROW(2, 1, 1, 0, 86 , 144, 0 , 0 , 0 , 0 ), // #568 {k, xmm|ymm|zmm}
+ ROW(2, 1, 1, 0, 52 , 49 , 0 , 0 , 0 , 0 ), // #569 {ymm, xmm}
+ ROW(2, 1, 1, 0, 52 , 52 , 0 , 0 , 0 , 0 ), // #570 {ymm, ymm}
+ ROW(3, 1, 1, 0, 52 , 52 , 49 , 0 , 0 , 0 ), // #571 {ymm, ymm, xmm}
+ ROW(3, 1, 1, 2, 122, 38 , 39 , 0 , 0 , 0 ), // #572 {mem, <edx>, <eax>}
+ ROW(3, 0, 1, 2, 122, 38 , 39 , 0 , 0 , 0 ) // #573 {mem, <edx>, <eax>}
};
#undef ROW
@@ -3584,7 +5317,7 @@ const InstDB::OpSignature InstDB::_opSignatureTable[] = {
ROW(F(ImmI16) | F(ImmU16), 0x00),
ROW(F(RegGpd) | F(Mem32), 0x00),
ROW(F(ImmI32) | F(ImmU32), 0x00),
- ROW(F(RegGpq) | F(MemUnspecified) | F(Mem64), 0x00),
+ ROW(F(RegGpq) | F(Mem64), 0x00),
ROW(F(ImmI32), 0x00),
ROW(F(RegSReg) | F(RegCReg) | F(RegDReg) | F(MemUnspecified) | F(Mem64) | F(ImmI64) | F(ImmU64), 0x00),
ROW(F(MemUnspecified) | F(Mem8), 0x00),
@@ -3593,27 +5326,26 @@ const InstDB::OpSignature InstDB::_opSignatureTable[] = {
ROW(F(MemUnspecified) | F(Mem16), 0x00),
ROW(F(RegSReg), 0x00),
ROW(F(RegCReg) | F(RegDReg), 0x00),
- ROW(F(RegGpq) | F(ImmI32), 0x00),
- ROW(F(RegGpw) | F(RegGpd) | F(RegGpq) | F(MemUnspecified) | F(Mem16) | F(Mem32) | F(Mem64), 0x00),
+ ROW(F(ImmI8) | F(ImmI32), 0x00),
+ ROW(F(RegGpw) | F(RegGpd) | F(Mem16) | F(Mem32), 0x00),
ROW(F(ImmI8), 0x00),
ROW(F(RegGpw) | F(MemUnspecified) | F(Mem16), 0x00),
ROW(F(RegGpd) | F(MemUnspecified) | F(Mem32), 0x00),
+ ROW(F(RegGpq) | F(MemUnspecified) | F(Mem64), 0x00),
ROW(F(MemUnspecified) | F(Mem32), 0x00),
ROW(F(MemUnspecified) | F(Mem64), 0x00),
- ROW(F(RegGpbLo) | F(RegGpbHi) | F(RegGpw) | F(RegGpd) | F(RegGpq) | F(MemUnspecified) | F(Mem8) | F(Mem16) | F(Mem32) | F(Mem64), 0x00),
- ROW(F(RegGpq) | F(MemUnspecified) | F(Mem64) | F(ImmI32) | F(ImmU32), 0x00),
+ ROW(F(RegGpbLo) | F(RegGpbHi) | F(RegGpw) | F(RegGpd) | F(Mem8) | F(Mem16) | F(Mem32), 0x00),
+ ROW(F(RegGpq) | F(MemUnspecified) | F(Mem64) | F(ImmI8) | F(ImmU8) | F(ImmI32) | F(ImmU32), 0x00),
+ ROW(F(Mem64), 0x00),
+ ROW(F(ImmI8) | F(ImmU8) | F(ImmI32), 0x00),
ROW(F(RegGpw) | F(FlagImplicit), 0x01),
ROW(F(RegGpw) | F(FlagImplicit), 0x04),
ROW(F(RegGpd) | F(FlagImplicit), 0x04),
ROW(F(RegGpd) | F(FlagImplicit), 0x01),
ROW(F(RegGpq) | F(FlagImplicit), 0x04),
ROW(F(RegGpq) | F(FlagImplicit), 0x01),
- ROW(F(RegGpw) | F(MemUnspecified) | F(Mem16) | F(ImmI8) | F(ImmI16), 0x00),
- ROW(F(RegGpd) | F(MemUnspecified) | F(Mem32) | F(ImmI8) | F(ImmI32), 0x00),
- ROW(F(RegGpq) | F(MemUnspecified) | F(Mem64) | F(ImmI8) | F(ImmI32), 0x00),
ROW(F(ImmI8) | F(ImmI16) | F(ImmU16), 0x00),
ROW(F(ImmI8) | F(ImmI32) | F(ImmU32), 0x00),
- ROW(F(ImmI8) | F(ImmI32), 0x00),
ROW(F(ImmI64) | F(ImmU64), 0x00),
ROW(F(RegGpbLo), 0x01),
ROW(F(RegGpw), 0x01),
@@ -3632,99 +5364,96 @@ const InstDB::OpSignature InstDB::_opSignatureTable[] = {
ROW(F(RegYmm) | F(MemUnspecified) | F(Mem256) | F(ImmI8) | F(ImmU8), 0x00),
ROW(F(RegZmm) | F(MemUnspecified) | F(Mem512) | F(ImmI8) | F(ImmU8), 0x00),
ROW(F(RegMm), 0x00),
- ROW(F(RegGpq) | F(RegMm) | F(MemUnspecified) | F(Mem64), 0x00),
+ ROW(F(RegMm) | F(MemUnspecified) | F(Mem64), 0x00),
ROW(F(RegXmm) | F(RegMm), 0x00),
ROW(F(RegXmm) | F(MemUnspecified) | F(Mem64), 0x00),
- ROW(F(RegGpw) | F(RegGpd) | F(RegGpq) | F(Mem16) | F(Mem32) | F(Mem64), 0x00),
+ ROW(F(RegSReg), 0x1A),
+ ROW(F(RegSReg), 0x60),
+ ROW(F(RegGpw) | F(Mem16) | F(ImmI8) | F(ImmI16), 0x00),
+ ROW(F(RegGpd) | F(Mem32) | F(ImmI32) | F(ImmU32), 0x00),
+ ROW(F(RegGpq) | F(Mem64) | F(ImmI32), 0x00),
+ ROW(F(RegSReg), 0x1E),
ROW(F(Vm32x), 0x00),
ROW(F(Vm32y), 0x00),
ROW(F(Vm32z), 0x00),
ROW(F(Vm64x), 0x00),
ROW(F(Vm64y), 0x00),
ROW(F(Vm64z), 0x00),
- ROW(F(Mem8) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x40),
- ROW(F(Mem8) | F(FlagMemBase) | F(FlagMemEs) | F(FlagImplicit), 0x80),
- ROW(F(Mem16) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x40),
- ROW(F(Mem16) | F(FlagMemBase) | F(FlagMemEs) | F(FlagImplicit), 0x80),
- ROW(F(Mem32) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x40),
- ROW(F(Mem32) | F(FlagMemBase) | F(FlagMemEs) | F(FlagImplicit), 0x80),
- ROW(F(Mem64) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x40),
- ROW(F(Mem64) | F(FlagMemBase) | F(FlagMemEs) | F(FlagImplicit), 0x80),
+ ROW(F(Mem8) | F(FlagMemBase) | F(FlagMemDs), 0x40),
+ ROW(F(Mem8) | F(FlagMemBase) | F(FlagMemEs), 0x80),
+ ROW(F(Mem16) | F(FlagMemBase) | F(FlagMemDs), 0x40),
+ ROW(F(Mem16) | F(FlagMemBase) | F(FlagMemEs), 0x80),
+ ROW(F(Mem32) | F(FlagMemBase) | F(FlagMemDs), 0x40),
+ ROW(F(Mem32) | F(FlagMemBase) | F(FlagMemEs), 0x80),
+ ROW(F(Mem64) | F(FlagMemBase) | F(FlagMemDs), 0x40),
+ ROW(F(Mem64) | F(FlagMemBase) | F(FlagMemEs), 0x80),
ROW(F(RegGpbLo) | F(FlagImplicit), 0x01),
- ROW(F(MemUnspecified) | F(Mem8) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x40),
- ROW(F(MemUnspecified) | F(Mem16) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x40),
- ROW(F(MemUnspecified) | F(Mem32) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x40),
- ROW(F(MemUnspecified) | F(Mem64) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x40),
- ROW(F(RegGpw) | F(RegGpq) | F(Mem16) | F(Mem64), 0x00),
- ROW(F(RegSReg), 0x1A),
- ROW(F(RegSReg), 0x60),
- ROW(F(RegGpw) | F(RegGpq) | F(Mem16) | F(Mem64) | F(ImmI8) | F(ImmI16) | F(ImmI32), 0x00),
- ROW(F(RegGpd) | F(Mem32) | F(ImmI32) | F(ImmU32), 0x00),
- ROW(F(RegSReg), 0x1E),
- ROW(F(MemUnspecified) | F(Mem8) | F(FlagMemBase) | F(FlagMemEs) | F(FlagImplicit), 0x80),
- ROW(F(MemUnspecified) | F(Mem16) | F(FlagMemBase) | F(FlagMemEs) | F(FlagImplicit), 0x80),
- ROW(F(MemUnspecified) | F(Mem32) | F(FlagMemBase) | F(FlagMemEs) | F(FlagImplicit), 0x80),
- ROW(F(MemUnspecified) | F(Mem64) | F(FlagMemBase) | F(FlagMemEs) | F(FlagImplicit), 0x80),
+ ROW(F(RegKReg), 0x00),
+ ROW(F(RegKReg) | F(MemUnspecified) | F(Mem64), 0x00),
+ ROW(F(MemUnspecified) | F(Mem8) | F(FlagMemBase) | F(FlagMemDs), 0x40),
+ ROW(F(MemUnspecified) | F(Mem16) | F(FlagMemBase) | F(FlagMemDs), 0x40),
+ ROW(F(MemUnspecified) | F(Mem32) | F(FlagMemBase) | F(FlagMemDs), 0x40),
+ ROW(F(MemUnspecified) | F(Mem64) | F(FlagMemBase) | F(FlagMemDs), 0x40),
+ ROW(F(MemUnspecified) | F(Mem8) | F(FlagMemBase) | F(FlagMemEs), 0x80),
+ ROW(F(MemUnspecified) | F(Mem16) | F(FlagMemBase) | F(FlagMemEs), 0x80),
+ ROW(F(MemUnspecified) | F(Mem32) | F(FlagMemBase) | F(FlagMemEs), 0x80),
+ ROW(F(MemUnspecified) | F(Mem64) | F(FlagMemBase) | F(FlagMemEs), 0x80),
ROW(F(RegXmm) | F(RegYmm), 0x00),
ROW(F(ImmI4) | F(ImmU4), 0x00),
+ ROW(F(RegGpw) | F(RegGpd) | F(MemUnspecified) | F(Mem16) | F(Mem32) | F(ImmI32) | F(ImmI64) | F(Rel32), 0x00),
+ ROW(F(ImmI32) | F(ImmI64) | F(Rel32), 0x00),
+ ROW(F(RegGpw) | F(RegGpd), 0x00),
ROW(F(Mem32) | F(Mem64), 0x00),
ROW(F(RegSt), 0x01),
ROW(F(RegSt), 0x00),
- ROW(F(MemUnspecified) | F(Mem48), 0x00),
+ ROW(F(ImmI32) | F(ImmI64) | F(Rel8) | F(Rel32), 0x00),
+ ROW(F(RegGpd) | F(Mem32) | F(ImmI32) | F(ImmI64) | F(Rel32), 0x00),
+ ROW(F(ImmI16), 0x00),
+ ROW(F(ImmI16) | F(ImmI32), 0x00),
+ ROW(F(MemUnspecified) | F(Mem32) | F(Mem48), 0x00),
ROW(F(MemUnspecified) | F(Mem80), 0x00),
+ ROW(F(MemUnspecified) | F(Mem48), 0x00),
+ ROW(F(RegGpd) | F(MemUnspecified) | F(Mem16), 0x00),
+ ROW(F(RegGpbLo) | F(RegGpbHi) | F(RegGpw) | F(Mem8) | F(Mem16), 0x00),
+ ROW(F(RegGpbLo) | F(RegGpw) | F(Mem8) | F(Mem16), 0x00),
ROW(F(RegGpbLo) | F(ImmI8) | F(ImmU8), 0x02),
ROW(F(RegXmm) | F(RegKReg), 0x00),
ROW(F(RegYmm) | F(RegKReg), 0x00),
- ROW(F(RegKReg), 0x00),
ROW(F(RegXmm) | F(MemUnspecified) | F(Mem32), 0x00),
ROW(F(Vm64x) | F(Vm64y), 0x00),
- ROW(F(RegGpq) | F(RegXmm) | F(MemUnspecified) | F(Mem64), 0x00),
ROW(F(RegXmm) | F(MemUnspecified) | F(Mem16), 0x00),
ROW(F(RegBnd), 0x00),
ROW(F(RegBnd) | F(MemUnspecified), 0x00),
ROW(F(MemUnspecified), 0x00),
- ROW(F(RegGpw) | F(RegGpd) | F(Mem16) | F(Mem32) | F(ImmI32) | F(ImmI64) | F(Rel32), 0x00),
- ROW(F(RegGpq) | F(MemUnspecified) | F(Mem64) | F(ImmI32) | F(ImmI64) | F(Rel32), 0x00),
- ROW(F(RegGpbLo) | F(RegGpbHi) | F(RegGpw) | F(RegGpd) | F(Mem8) | F(Mem16) | F(Mem32), 0x00),
- ROW(F(RegGpbLo) | F(RegGpbHi) | F(RegGpq) | F(Mem8) | F(Mem64), 0x00),
- ROW(F(RegGpw) | F(RegGpd), 0x00),
+ ROW(F(RegGpbLo) | F(RegGpq) | F(Mem8) | F(Mem64), 0x00),
ROW(F(MemUnspecified) | F(Mem512) | F(FlagMemBase) | F(FlagMemEs), 0x00),
ROW(F(RegSt) | F(Mem32) | F(Mem64), 0x00),
ROW(F(RegGpd) | F(FlagImplicit), 0x02),
ROW(F(RegGpd) | F(RegGpq) | F(FlagImplicit), 0x01),
- ROW(F(ImmI32) | F(ImmI64) | F(Rel8) | F(Rel32), 0x00),
- ROW(F(ImmI32) | F(ImmI64) | F(Rel32), 0x00),
ROW(F(RegGpw) | F(RegGpd) | F(FlagImplicit), 0x02),
ROW(F(ImmI32) | F(ImmI64) | F(Rel8), 0x00),
ROW(F(RegGpd) | F(RegGpq) | F(FlagImplicit), 0x02),
- ROW(F(RegGpq) | F(MemUnspecified) | F(Mem64) | F(ImmI32) | F(ImmI64) | F(Rel8) | F(Rel32), 0x00),
- ROW(F(RegGpd) | F(MemUnspecified) | F(Mem32) | F(ImmI32) | F(ImmI64) | F(Rel32), 0x00),
ROW(F(RegGpd) | F(RegKReg) | F(MemUnspecified) | F(Mem8), 0x00),
ROW(F(RegGpd) | F(MemUnspecified) | F(Mem8), 0x00),
ROW(F(RegGpd) | F(RegKReg) | F(MemUnspecified) | F(Mem32), 0x00),
- ROW(F(RegGpq) | F(RegKReg) | F(MemUnspecified) | F(Mem64), 0x00),
ROW(F(RegGpd) | F(RegKReg) | F(MemUnspecified) | F(Mem16), 0x00),
- ROW(F(RegGpd) | F(MemUnspecified) | F(Mem16), 0x00),
- ROW(F(ImmI16), 0x00),
- ROW(F(ImmI16) | F(ImmI32), 0x00),
- ROW(F(MemUnspecified) | F(Mem32) | F(Mem48) | F(Mem80), 0x00),
+ ROW(F(MemUnspecified) | F(Mem8) | F(Mem16) | F(Mem32) | F(Mem48) | F(Mem64) | F(Mem80) | F(Mem128) | F(Mem256) | F(Mem512) | F(Mem1024), 0x00),
ROW(F(RegGpd) | F(RegGpq), 0x00),
- ROW(F(RegGpbLo) | F(RegGpbHi) | F(RegGpw) | F(Mem8) | F(Mem16), 0x00),
- ROW(F(RegMm) | F(MemUnspecified) | F(Mem64), 0x00),
ROW(F(RegMm) | F(MemUnspecified) | F(Mem64) | F(ImmI8) | F(ImmU8), 0x00),
ROW(F(RegMm) | F(MemUnspecified) | F(Mem32), 0x00),
ROW(F(ImmU16), 0x00),
+ ROW(F(RegGpw) | F(RegGpd) | F(MemUnspecified) | F(Mem16), 0x00),
+ ROW(F(RegGpq) | F(MemUnspecified) | F(Mem16), 0x00),
+ ROW(F(MemUnspecified) | F(FlagMemBase) | F(FlagMemDs), 0x00),
ROW(F(RegXmm) | F(RegYmm) | F(Mem128) | F(Mem256), 0x00),
+ ROW(F(RegXmm) | F(RegYmm) | F(RegZmm), 0x00),
ROW(F(RegXmm) | F(ImmI8) | F(ImmU8), 0x00),
ROW(F(RegXmm) | F(FlagImplicit), 0x01),
ROW(F(MemUnspecified) | F(FlagMib), 0x00),
- ROW(F(RegGpw) | F(RegGpd) | F(RegGpq), 0x00),
- ROW(F(MemUnspecified) | F(Mem8) | F(Mem16) | F(Mem32) | F(Mem48) | F(Mem64) | F(Mem80) | F(Mem128) | F(Mem256) | F(Mem512) | F(Mem1024), 0x00),
ROW(F(MemUnspecified) | F(Mem512) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x01),
ROW(F(RegGpq) | F(FlagImplicit), 0x02),
ROW(F(RegGpq) | F(FlagImplicit), 0x08),
ROW(F(RegGpd) | F(FlagImplicit), 0x08),
- ROW(F(RegGpd) | F(RegGpq) | F(MemUnspecified) | F(Mem32) | F(Mem64), 0x00),
ROW(F(Mem16) | F(Mem32), 0x00),
ROW(F(Mem16) | F(Mem32) | F(Mem64), 0x00),
ROW(F(RegSt) | F(Mem32) | F(Mem64) | F(Mem80), 0x00),
@@ -3739,12 +5468,9 @@ const InstDB::OpSignature InstDB::_opSignatureTable[] = {
ROW(F(MemUnspecified) | F(FlagMemBase) | F(FlagMemDs) | F(FlagImplicit), 0x01),
ROW(F(RegGpw) | F(ImmU8), 0x04),
ROW(F(Mem8) | F(Mem16) | F(Mem32) | F(FlagMemBase) | F(FlagMemDs), 0x40),
- ROW(F(RegGpw) | F(RegGpd) | F(RegGpq) | F(MemUnspecified) | F(Mem16), 0x00),
ROW(F(RegTmm), 0x00),
ROW(F(MemUnspecified) | F(FlagTMem), 0x00),
- ROW(F(MemUnspecified) | F(FlagMemBase) | F(FlagMemDs), 0x00),
ROW(F(RegYmm) | F(RegZmm), 0x00),
- ROW(F(RegXmm) | F(RegYmm) | F(RegZmm), 0x00),
ROW(F(RegXmm) | F(RegYmm) | F(RegZmm) | F(Mem128) | F(Mem256) | F(Mem512), 0x00),
ROW(F(RegGpd) | F(RegXmm) | F(MemUnspecified) | F(Mem8), 0x00),
ROW(F(RegGpd) | F(RegXmm) | F(MemUnspecified) | F(Mem32), 0x00),
@@ -3762,302 +5488,311 @@ const InstDB::OpSignature InstDB::_opSignatureTable[] = {
// ${InstRWInfoTable:Begin}
// ------------------- Automatically generated, do not edit -------------------
const uint8_t InstDB::rwInfoIndexA[Inst::_kIdCount] = {
- 0, 0, 1, 1, 0, 2, 3, 2, 4, 4, 5, 6, 4, 4, 3, 4, 4, 4, 4, 7, 0, 2, 0, 4, 4, 4,
- 4, 8, 0, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 10, 10, 10, 11, 11, 12, 13,
- 14, 9, 9, 0, 15, 16, 16, 16, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 18, 0, 0, 19, 0, 0, 0, 0, 0, 20, 21, 0, 22, 23, 24, 7, 25,
- 25, 25, 24, 26, 7, 24, 27, 28, 29, 30, 31, 32, 33, 25, 25, 7, 27, 28, 33, 34,
- 0, 0, 0, 0, 35, 4, 4, 5, 6, 0, 0, 0, 0, 0, 36, 36, 0, 0, 37, 0, 0, 38, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 38, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 38,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 39, 4,
- 4, 35, 40, 41, 0, 0, 0, 42, 0, 37, 0, 0, 0, 0, 43, 0, 44, 43, 43, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 47, 48, 49, 50, 51,
- 52, 53, 0, 0, 0, 54, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 55, 56, 57, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 59, 0, 60, 0, 61, 0, 60, 0, 60, 0, 60,
- 0, 0, 0, 0, 0, 62, 63, 63, 63, 58, 60, 0, 0, 0, 9, 0, 0, 4, 4, 5, 6, 0, 0, 4,
- 4, 5, 6, 0, 0, 64, 65, 66, 66, 67, 47, 24, 36, 67, 52, 66, 66, 68, 69, 69, 70,
- 71, 71, 72, 72, 59, 59, 67, 59, 59, 71, 71, 73, 48, 52, 74, 75, 7, 7, 76, 77,
- 9, 66, 66, 77, 0, 35, 4, 4, 5, 6, 0, 78, 0, 0, 79, 0, 2, 4, 4, 80, 81, 9, 9,
- 9, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 0, 3, 82, 3, 0, 0, 0, 3, 3,
- 4, 3, 0, 0, 3, 3, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 83, 27, 27, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 27, 82, 82, 82, 27, 27, 82, 82, 82, 3, 3, 3, 84, 3, 3, 3,
- 27, 27, 0, 0, 0, 0, 3, 3, 4, 4, 3, 3, 4, 4, 4, 4, 3, 3, 4, 4, 85, 86, 87, 24,
- 24, 24, 86, 86, 87, 24, 24, 24, 86, 4, 3, 82, 3, 3, 4, 3, 3, 0, 0, 0, 9, 0,
- 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 3, 3, 3, 3, 88, 3, 3, 0, 3, 3,
- 3, 88, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 27, 89, 0, 3, 3, 4, 3, 90, 90, 4, 90, 0,
- 0, 0, 0, 0, 0, 0, 3, 91, 7, 92, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 0, 0,
- 0, 0, 0, 91, 91, 0, 0, 0, 0, 0, 0, 7, 92, 0, 0, 91, 91, 0, 0, 2, 94, 0, 0, 0,
+ 0, 0, 1, 2, 1, 2, 0, 3, 4, 3, 5, 5, 6, 7, 5, 5, 4, 5, 5, 5, 5, 8, 0, 3, 0, 5,
+ 5, 5, 5, 2, 9, 2, 0, 10, 10, 10, 10, 10, 0, 0, 0, 0, 10, 10, 10, 10, 10, 11, 11,
+ 11, 12, 12, 13, 14, 15, 10, 10, 0, 16, 17, 17, 17, 0, 0, 0, 18, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 21, 22, 0, 23, 24, 25, 8, 26, 26,
+ 26, 25, 27, 8, 25, 28, 29, 30, 31, 32, 33, 34, 26, 26, 8, 28, 29, 34, 35, 0,
+ 0, 0, 0, 36, 5, 5, 6, 7, 0, 0, 0, 0, 0, 37, 37, 0, 0, 38, 0, 0, 39, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 39, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 39, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 0, 40, 5, 5, 36,
+ 41, 42, 0, 0, 0, 43, 0, 38, 0, 0, 0, 0, 44, 0, 45, 0, 44, 44, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 48, 49, 50, 51, 52, 53,
+ 54, 0, 0, 0, 55, 56, 57, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 56, 57, 58, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 60, 0, 2, 0, 61, 0, 2, 0, 2, 0, 2, 0, 0,
+ 0, 0, 0, 62, 63, 63, 63, 59, 2, 0, 0, 0, 10, 0, 0, 5, 5, 6, 7, 0, 0, 5, 5, 6,
+ 7, 0, 0, 64, 65, 66, 66, 67, 48, 25, 37, 67, 53, 66, 66, 68, 69, 69, 70, 71,
+ 71, 72, 72, 60, 60, 67, 60, 60, 71, 71, 73, 49, 53, 74, 75, 8, 8, 76, 77, 10,
+ 66, 66, 77, 0, 36, 5, 5, 6, 7, 0, 78, 0, 0, 79, 0, 3, 5, 5, 80, 81, 10, 10, 10,
+ 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 0, 4, 82, 4, 0, 0, 0, 4, 4, 5,
+ 4, 0, 0, 4, 4, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 83, 28, 28, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 28, 82, 82, 82, 28, 28, 82, 82, 82, 4, 4, 4, 84, 4, 4, 4, 28,
+ 28, 0, 0, 0, 0, 4, 4, 5, 5, 4, 4, 5, 5, 5, 5, 4, 4, 5, 5, 85, 86, 87, 25, 25,
+ 25, 86, 86, 87, 25, 25, 25, 86, 5, 4, 82, 4, 4, 5, 4, 4, 0, 0, 0, 10, 0, 0,
+ 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 4, 4, 4, 4, 88, 4, 4, 0, 4,
+ 4, 4, 88, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 28, 89, 0, 4, 4, 5, 4, 90, 90, 5, 90,
+ 0, 0, 0, 0, 0, 0, 0, 4, 91, 8, 92, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93,
+ 0, 0, 0, 0, 0, 91, 91, 0, 0, 0, 0, 0, 0, 8, 92, 0, 0, 91, 91, 0, 0, 3, 94, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 4, 4, 0, 91, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7, 7, 26, 92, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 2, 4, 4, 5, 6, 0, 0, 0, 0, 0,
- 0, 0, 9, 0, 0, 0, 0, 0, 15, 0, 96, 96, 0, 97, 0, 0, 9, 9, 20, 21, 98, 98, 0,
- 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 28, 100, 101, 100, 101, 99, 28, 100, 101,
- 100, 101, 102, 103, 0, 0, 0, 0, 0, 0, 20, 104, 21, 105, 105, 106, 77, 9, 0, 77,
- 107, 108, 107, 9, 107, 9, 109, 110, 106, 109, 110, 109, 110, 9, 9, 9, 106,
- 0, 77, 106, 9, 106, 9, 108, 107, 0, 28, 0, 28, 0, 111, 0, 111, 0, 0, 0, 0, 0,
- 33, 33, 107, 9, 107, 9, 109, 110, 109, 110, 9, 9, 9, 106, 9, 106, 28, 28, 111,
- 111, 33, 33, 106, 77, 9, 9, 108, 107, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 112, 112, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 0, 5, 5, 0, 91, 0, 0, 91, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 8, 8, 27, 92, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 3, 5, 5, 6, 7, 0,
+ 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 96, 96, 0, 97, 0, 0,
+ 0, 10, 10, 21, 22, 98, 98, 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 99, 99, 0, 0, 0, 0, 0, 0, 100, 29,
+ 101, 102, 101, 102, 100, 29, 101, 102, 101, 102, 103, 104, 0, 0, 0, 0, 0, 0,
+ 21, 105, 22, 106, 106, 107, 77, 10, 0, 67, 67, 67, 67, 77, 108, 109, 108, 10,
+ 108, 10, 110, 111, 107, 110, 111, 110, 111, 10, 10, 10, 107, 0, 77, 107, 10,
+ 107, 10, 109, 108, 0, 29, 0, 29, 0, 112, 0, 112, 0, 0, 0, 0, 0, 34, 34, 108,
+ 10, 108, 10, 110, 111, 110, 111, 10, 10, 10, 107, 10, 107, 29, 29, 112, 112, 34,
+ 34, 107, 77, 10, 10, 109, 108, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 113, 113, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 27, 113, 60, 60,
- 0, 0, 0, 0, 0, 0, 0, 0, 60, 114, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 28, 114, 2, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 2, 115, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 115, 47, 116, 115, 115, 115, 115, 115,
- 115, 115, 115, 0, 117, 117, 0, 71, 71, 118, 119, 67, 67, 67, 67, 120, 71, 121,
- 9, 9, 73, 115, 115, 49, 0, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 0, 0,
- 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 33, 124, 124, 28, 125, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 105, 105, 105, 0,
- 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 60, 60, 114, 60, 7, 7, 7,
- 0, 7, 0, 7, 7, 7, 7, 7, 7, 0, 7, 7, 84, 7, 0, 7, 0, 0, 7, 0, 0, 0, 0, 9, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 116, 48, 117, 116, 116, 116, 116,
+ 116, 116, 116, 116, 0, 118, 118, 0, 71, 71, 119, 120, 67, 67, 67, 67, 121, 71,
+ 122, 10, 10, 73, 116, 116, 50, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123,
+ 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 34, 125, 125, 29, 126, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 106,
+ 106, 106, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 126, 126, 127, 128, 124, 124, 124, 124, 85, 126, 129, 128,
- 127, 127, 128, 129, 128, 127, 128, 130, 131, 106, 106, 106, 130, 127, 128,
- 129, 128, 127, 128, 126, 128, 130, 131, 106, 106, 106, 130, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 67,
- 132, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 10, 10, 10, 10, 0, 0, 0, 0, 2, 2, 115, 2, 8, 8, 8, 0, 8, 0, 8, 8, 8, 8, 8, 8,
+ 0, 8, 8, 84, 8, 0, 8, 0, 0, 8, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127,
+ 127, 128, 129, 125, 125, 125, 125, 85, 127, 130, 129, 128, 128, 129, 130,
+ 129, 128, 129, 131, 132, 107, 107, 107, 131, 128, 129, 130, 129, 128, 129, 127,
+ 129, 131, 132, 107, 107, 107, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 67, 133, 67, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 112, 112, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 112, 112, 0, 0, 9, 9, 0, 0, 0,
- 0, 0, 0, 0, 0, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 67, 132, 0, 0, 0, 0, 0, 0, 9,
- 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 122, 20, 104, 21, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 133, 134, 133, 134, 0, 135, 0, 136, 0, 0, 0, 2, 4, 4, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 10, 10, 0, 0, 113, 113, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 113, 113, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0,
+ 0, 67, 67, 0, 0, 0, 0, 0, 0, 0, 0, 67, 133, 134, 135, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 123, 21, 105, 22,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 137, 136, 137, 0, 138, 0, 139, 0,
+ 0, 0, 3, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
const uint8_t InstDB::rwInfoIndexB[Inst::_kIdCount] = {
- 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 0,
- 0, 0, 4, 0, 0, 0, 0, 0, 5, 5, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7, 0, 0, 0, 0, 4, 8, 1, 0, 9, 0, 0, 0, 10, 10, 10, 0, 0, 11, 0, 0, 10, 12,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5, 5, 0, 13, 14, 15, 16, 17, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 1, 1, 20, 21, 0, 0,
- 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 22, 23, 0, 0, 24, 25, 26, 27, 0, 0, 25, 25, 25,
- 25, 25, 25, 25, 25, 28, 29, 29, 28, 0, 0, 0, 24, 25, 24, 25, 0, 25, 24, 24, 24,
- 24, 24, 24, 24, 0, 0, 30, 30, 30, 24, 24, 28, 0, 31, 10, 0, 0, 0, 0, 0, 0, 24,
- 25, 0, 0, 0, 32, 33, 32, 34, 0, 0, 0, 0, 0, 10, 32, 0, 0, 0, 0, 35, 33, 32,
- 35, 34, 24, 25, 24, 25, 0, 29, 29, 29, 29, 0, 0, 0, 25, 10, 10, 32, 32, 0, 0,
- 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 21, 36, 0, 20, 37, 38, 0, 39, 40, 0, 0, 0, 0,
- 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, 44, 41, 42, 41, 42, 43,
- 44, 43, 44, 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, 0, 0, 0, 0, 44, 45, 46, 47,
- 48, 45, 46, 47, 48, 0, 0, 0, 0, 49, 50, 51, 41, 42, 43, 44, 41, 42, 43, 44, 52,
- 0, 24, 0, 53, 0, 54, 0, 0, 0, 0, 0, 10, 0, 10, 24, 55, 56, 55, 0, 0, 0, 0,
- 0, 0, 55, 57, 57, 0, 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 60, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 5, 5, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 4, 8, 1, 0, 9, 0, 0, 0, 10, 10, 10, 0, 0, 11, 0,
+ 0, 10, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 5, 5, 13, 0, 14, 15, 13, 16, 17, 18, 13, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 1, 1, 21, 22, 0, 0, 0,
+ 0, 5, 5, 0, 0, 0, 0, 0, 0, 23, 24, 0, 0, 25, 26, 27, 28, 0, 0, 26, 26, 26, 26,
+ 26, 26, 26, 26, 29, 30, 30, 29, 0, 0, 0, 25, 26, 25, 26, 0, 26, 25, 25, 25,
+ 25, 25, 25, 25, 0, 0, 31, 31, 31, 25, 25, 29, 0, 32, 10, 0, 0, 0, 0, 0, 0, 25,
+ 26, 0, 0, 0, 33, 34, 33, 35, 0, 0, 0, 0, 0, 10, 33, 0, 0, 0, 0, 36, 34, 33, 36,
+ 35, 25, 26, 25, 26, 0, 30, 30, 30, 30, 0, 0, 0, 26, 10, 10, 33, 33, 0, 0, 0,
+ 20, 5, 5, 0, 0, 0, 0, 0, 0, 0, 22, 37, 0, 21, 38, 39, 0, 40, 41, 0, 0, 0, 0,
+ 0, 10, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 46, 43, 44, 43, 44,
+ 45, 46, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 0, 0, 46, 47, 48,
+ 49, 50, 47, 48, 49, 50, 0, 0, 0, 0, 51, 52, 53, 43, 44, 45, 46, 43, 44, 45, 46,
+ 54, 0, 25, 0, 55, 0, 56, 0, 0, 0, 0, 0, 10, 0, 10, 25, 57, 58, 57, 0, 0, 0,
+ 0, 0, 0, 57, 59, 59, 0, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 62, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 61, 0, 0, 61, 0, 0, 0, 0, 0, 5, 62, 0, 0, 0, 0, 63, 0, 64, 20, 65, 20, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0,
- 6, 5, 5, 0, 0, 0, 0, 67, 68, 0, 0, 0, 0, 69, 70, 0, 3, 3, 71, 22, 72, 73, 0,
+ 0, 0, 63, 0, 0, 63, 0, 0, 0, 0, 0, 5, 64, 0, 0, 0, 0, 65, 0, 66, 21, 67, 21,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0,
+ 0, 6, 5, 5, 0, 0, 0, 0, 69, 70, 0, 0, 0, 0, 71, 72, 0, 3, 3, 73, 23, 74, 75,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 74, 39, 75, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 10,
- 10, 10, 10, 10, 10, 10, 0, 0, 2, 2, 2, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 81, 80, 81, 81, 81, 80, 80, 82, 83, 0, 84,
- 0, 0, 0, 0, 0, 0, 85, 2, 2, 86, 87, 0, 0, 0, 11, 88, 0, 0, 4, 0, 0, 0, 89, 0,
- 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
- 90, 90, 90, 90, 90, 90, 90, 90, 90, 0, 90, 0, 32, 0, 0, 0, 5, 0, 0, 6, 0, 91,
- 4, 0, 91, 4, 5, 5, 32, 19, 92, 80, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 0, 92,
- 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95, 95, 95, 95, 95, 0, 0, 0, 0,
- 0, 0, 96, 97, 0, 0, 0, 0, 0, 0, 0, 0, 56, 97, 0, 0, 0, 0, 98, 99, 98, 99, 3,
- 3, 3, 100, 101, 102, 3, 3, 3, 3, 3, 3, 0, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 103,
- 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 104, 3, 105, 106, 107, 0,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 108, 0, 0, 0, 0, 0, 0, 0, 109, 0, 110, 0, 111, 0, 111, 0, 112, 113, 114, 115,
- 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 112, 113, 114, 0, 0, 3, 3, 3, 3, 100, 111, 102, 3, 117, 3, 55, 55,
- 0, 0, 0, 0, 118, 119, 120, 119, 120, 118, 119, 120, 119, 120, 22, 121, 122, 121,
- 122, 121, 121, 123, 124, 121, 121, 121, 125, 126, 127, 121, 121, 121, 125,
- 126, 127, 121, 121, 121, 125, 126, 127, 121, 122, 128, 128, 129, 130, 121, 121,
- 121, 121, 121, 121, 121, 121, 121, 128, 128, 121, 121, 121, 125, 131, 127, 121,
- 121, 121, 125, 131, 127, 121, 121, 121, 125, 131, 127, 121, 121, 121, 121,
- 121, 121, 121, 121, 121, 128, 128, 128, 128, 129, 130, 121, 122, 121, 121, 121,
- 125, 126, 127, 121, 121, 121, 125, 126, 127, 121, 121, 121, 125, 126, 127,
- 128, 128, 129, 130, 121, 121, 121, 125, 131, 127, 121, 121, 121, 125, 131, 127,
- 121, 121, 121, 132, 131, 133, 128, 128, 129, 130, 134, 134, 134, 78, 135, 136,
- 0, 0, 0, 0, 137, 138, 10, 10, 10, 10, 10, 10, 10, 10, 138, 139, 0, 0, 0, 140,
- 141, 142, 85, 85, 85, 140, 141, 142, 3, 3, 3, 3, 3, 3, 3, 143, 144, 145, 144,
- 145, 143, 144, 145, 144, 145, 102, 0, 53, 58, 146, 146, 3, 3, 3, 100, 101,
- 102, 0, 147, 0, 3, 3, 3, 100, 101, 102, 0, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 149, 150, 150, 151, 152, 152, 0, 0, 0, 0, 0, 0, 0, 153, 154, 0, 0, 155,
- 0, 0, 0, 3, 11, 147, 0, 0, 156, 148, 3, 3, 3, 100, 101, 102, 0, 11, 3, 3, 157,
- 157, 158, 158, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 103, 3, 0, 0, 0, 0, 0, 0, 3, 128, 104, 104, 3,
- 3, 3, 3, 67, 68, 3, 3, 3, 3, 69, 70, 104, 104, 104, 104, 104, 104, 117, 117, 0,
- 0, 0, 0, 117, 117, 117, 117, 117, 117, 0, 0, 121, 121, 121, 121, 159, 159, 3,
- 3, 3, 121, 3, 3, 121, 121, 128, 128, 160, 160, 160, 3, 160, 3, 121, 121, 121,
- 121, 121, 3, 0, 0, 0, 0, 71, 22, 72, 161, 138, 137, 139, 138, 0, 0, 0, 3, 0,
- 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 3, 3, 0, 162, 102, 100, 101, 0, 0,
- 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 121, 121, 3, 3, 146,
- 146, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 3, 3, 3, 164, 85, 85,
- 3, 3, 85, 85, 3, 3, 165, 165, 165, 165, 3, 0, 0, 0, 0, 165, 165, 165, 165, 165,
- 165, 3, 3, 121, 121, 121, 3, 165, 165, 3, 3, 121, 121, 121, 3, 3, 104, 85, 85,
- 85, 3, 3, 3, 166, 167, 166, 3, 3, 3, 168, 166, 169, 3, 3, 3, 168, 166, 167,
- 166, 3, 3, 3, 168, 3, 3, 3, 3, 3, 3, 3, 3, 121, 121, 0, 104, 104, 104, 104, 104,
- 104, 104, 104, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 140, 142, 0, 0, 140,
- 142, 0, 0, 140, 142, 0, 0, 141, 142, 85, 85, 85, 140, 141, 142, 85, 85, 85, 140,
- 141, 142, 85, 85, 140, 142, 0, 0, 140, 142, 0, 0, 140, 142, 0, 0, 141, 142,
- 3, 3, 3, 100, 101, 102, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 3, 3, 3,
- 3, 3, 3, 0, 0, 0, 140, 141, 142, 93, 3, 3, 3, 100, 101, 102, 0, 0, 0, 0, 0, 3,
- 3, 3, 3, 3, 3, 0, 0, 0, 0, 56, 56, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0,
- 0, 0, 0, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, 172, 172, 170, 0,
- 0
+ 0, 0, 0, 0, 76, 40, 77, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 2, 2, 2, 80, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0,
+ 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 81, 82, 81, 82, 82, 82, 81, 81, 83,
+ 84, 0, 85, 0, 0, 0, 0, 0, 0, 86, 2, 2, 87, 88, 0, 0, 0, 11, 89, 0, 0, 4, 0, 0,
+ 0, 0, 0, 0, 90, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
+ 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 91, 0, 33, 0, 0,
+ 0, 5, 0, 0, 6, 0, 92, 4, 0, 92, 4, 5, 5, 33, 20, 93, 81, 93, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 94, 0, 93, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 96, 0,
+ 96, 96, 96, 96, 96, 96, 0, 0, 0, 0, 0, 0, 97, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 10,
+ 98, 0, 0, 0, 0, 99, 100, 99, 100, 3, 3, 3, 101, 102, 103, 3, 3, 3, 3, 3, 3,
+ 0, 2, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 104, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 105, 3, 106, 107, 108, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 0, 0, 0, 0, 0,
+ 0, 0, 110, 0, 111, 0, 112, 0, 112, 0, 113, 114, 115, 116, 117, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 114,
+ 115, 0, 0, 3, 3, 3, 3, 101, 112, 103, 3, 118, 3, 57, 57, 0, 0, 0, 0, 119, 120,
+ 121, 120, 121, 119, 120, 121, 120, 121, 23, 122, 123, 122, 123, 124, 124, 125,
+ 126, 124, 124, 124, 127, 128, 129, 124, 124, 124, 127, 128, 129, 124, 124,
+ 124, 127, 128, 129, 122, 123, 130, 130, 131, 132, 124, 124, 124, 124, 124, 124,
+ 124, 124, 124, 130, 130, 124, 124, 124, 127, 133, 129, 124, 124, 124, 127, 133,
+ 129, 124, 124, 124, 127, 133, 129, 124, 124, 124, 124, 124, 124, 124, 124,
+ 124, 130, 130, 130, 130, 131, 132, 122, 123, 124, 124, 124, 127, 128, 129, 124,
+ 124, 124, 127, 128, 129, 124, 124, 124, 127, 128, 129, 130, 130, 131, 132,
+ 124, 124, 124, 127, 133, 129, 124, 124, 124, 127, 133, 129, 124, 124, 124, 134,
+ 133, 135, 130, 130, 131, 132, 136, 136, 136, 80, 137, 138, 0, 0, 0, 0, 139,
+ 140, 10, 10, 10, 10, 10, 10, 10, 10, 140, 141, 0, 0, 0, 142, 143, 144, 86, 86,
+ 86, 142, 143, 144, 3, 3, 3, 3, 3, 3, 3, 145, 146, 147, 146, 147, 145, 146, 147,
+ 146, 147, 103, 0, 55, 60, 148, 148, 3, 3, 3, 101, 102, 103, 0, 149, 0, 0, 3,
+ 3, 3, 101, 102, 103, 0, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 151, 152,
+ 152, 153, 154, 154, 0, 0, 0, 0, 0, 0, 0, 155, 156, 0, 0, 157, 0, 0, 0, 3, 11,
+ 149, 0, 0, 158, 150, 3, 3, 3, 101, 102, 103, 0, 0, 11, 3, 3, 159, 159, 160,
+ 160, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 104, 3, 0, 0, 0, 0, 0, 0, 3, 130, 105, 105, 3, 3, 3, 3, 69, 70,
+ 3, 3, 3, 3, 71, 72, 105, 105, 105, 105, 105, 105, 118, 118, 0, 0, 0, 0, 118,
+ 118, 118, 118, 118, 118, 0, 0, 124, 124, 124, 124, 124, 124, 124, 124, 124,
+ 124, 124, 124, 124, 124, 124, 124, 161, 161, 3, 3, 124, 124, 3, 3, 124, 124, 130,
+ 130, 162, 162, 162, 3, 162, 124, 124, 124, 124, 124, 124, 3, 0, 0, 0, 0, 73,
+ 23, 74, 163, 140, 139, 141, 140, 0, 0, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 3, 0, 3, 3, 0, 164, 103, 101, 102, 0, 0, 165, 165, 165, 165, 165, 165,
+ 165, 165, 165, 165, 165, 165, 124, 124, 3, 3, 148, 148, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 0, 0, 0, 0, 3, 3, 3, 166, 86, 86, 3, 3, 86, 86, 3, 3, 167, 167,
+ 167, 167, 3, 0, 0, 0, 0, 167, 167, 167, 167, 167, 167, 3, 3, 124, 124, 124,
+ 3, 167, 167, 3, 3, 124, 124, 124, 3, 3, 105, 86, 86, 86, 3, 3, 3, 168, 169, 168,
+ 3, 3, 3, 170, 168, 171, 3, 3, 3, 170, 168, 169, 168, 3, 3, 3, 170, 3, 3, 3,
+ 3, 3, 3, 3, 3, 172, 172, 0, 105, 105, 105, 105, 105, 105, 105, 105, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 142, 144, 0, 0, 142, 144, 0, 0, 142, 144, 0, 0,
+ 143, 144, 86, 86, 86, 142, 143, 144, 86, 86, 86, 142, 143, 144, 86, 86, 142, 144,
+ 0, 0, 142, 144, 0, 0, 142, 144, 0, 0, 143, 144, 3, 3, 3, 101, 102, 103, 0,
+ 0, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 173, 3, 3, 3, 3, 3, 3, 174, 174,
+ 174, 3, 3, 0, 0, 0, 142, 143, 144, 94, 3, 3, 3, 101, 102, 103, 0, 0, 0, 0,
+ 0, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 58, 58, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 0,
+ 0, 0, 0, 0, 176, 176, 176, 176, 177, 177, 177, 177, 177, 177, 177, 177, 175,
+ 0, 0
};
const InstDB::RWInfo InstDB::rwInfoA[] = {
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #0 [ref=1007x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #0 [ref=1054x]
{ InstDB::RWInfo::kCategoryGeneric , 0 , { 1 , 0 , 0 , 0 , 0 , 0 } }, // #1 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 1 , { 2 , 3 , 0 , 0 , 0 , 0 } }, // #2 [ref=7x]
- { InstDB::RWInfo::kCategoryGeneric , 2 , { 2 , 3 , 0 , 0 , 0 , 0 } }, // #3 [ref=96x]
- { InstDB::RWInfo::kCategoryGeneric , 3 , { 4 , 5 , 0 , 0 , 0 , 0 } }, // #4 [ref=55x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 6 , 7 , 0 , 0 , 0 , 0 } }, // #5 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 8 , 9 , 0 , 0 , 0 , 0 } }, // #6 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 3 , { 10, 5 , 0 , 0 , 0 , 0 } }, // #7 [ref=26x]
- { InstDB::RWInfo::kCategoryGeneric , 7 , { 12, 13, 0 , 0 , 0 , 0 } }, // #8 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 2 , { 11, 3 , 0 , 0 , 0 , 0 } }, // #9 [ref=75x]
- { InstDB::RWInfo::kCategoryGeneric , 2 , { 5 , 3 , 0 , 0 , 0 , 0 } }, // #10 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 8 , { 10, 3 , 0 , 0 , 0 , 0 } }, // #11 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 9 , { 10, 5 , 0 , 0 , 0 , 0 } }, // #12 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 8 , { 15, 5 , 0 , 0 , 0 , 0 } }, // #13 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 3 , 3 , 0 , 0 , 0 , 0 } }, // #14 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 10, { 3 , 3 , 0 , 0 , 0 , 0 } }, // #15 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 10, { 2 , 3 , 0 , 0 , 0 , 0 } }, // #16 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 16, 17, 0 , 0 , 0 , 0 } }, // #17 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 1 , { 3 , 3 , 0 , 0 , 0 , 0 } }, // #18 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 20, 21, 0 , 0 , 0 , 0 } }, // #19 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 7 , 7 , 0 , 0 , 0 , 0 } }, // #20 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 9 , 9 , 0 , 0 , 0 , 0 } }, // #21 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 33, 34, 0 , 0 , 0 , 0 } }, // #22 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 14, { 2 , 3 , 0 , 0 , 0 , 0 } }, // #23 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 10, 7 , 0 , 0 , 0 , 0 } }, // #24 [ref=10x]
- { InstDB::RWInfo::kCategoryGeneric , 3 , { 35, 5 , 0 , 0 , 0 , 0 } }, // #25 [ref=5x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 36, 7 , 0 , 0 , 0 , 0 } }, // #26 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 35, 7 , 0 , 0 , 0 , 0 } }, // #27 [ref=11x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 11, 7 , 0 , 0 , 0 , 0 } }, // #28 [ref=9x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 37, 7 , 0 , 0 , 0 , 0 } }, // #29 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 14, { 36, 3 , 0 , 0 , 0 , 0 } }, // #30 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 14, { 37, 3 , 0 , 0 , 0 , 0 } }, // #31 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 36, 9 , 0 , 0 , 0 , 0 } }, // #32 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 11, 9 , 0 , 0 , 0 , 0 } }, // #33 [ref=7x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 38, 39, 0 , 0 , 0 , 0 } }, // #34 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 15, { 1 , 40, 0 , 0 , 0 , 0 } }, // #35 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 16, { 11, 43, 0 , 0 , 0 , 0 } }, // #36 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 4 , 5 , 0 , 0 , 0 , 0 } }, // #37 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 45, 46, 0 , 0 , 0 , 0 } }, // #38 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 0 , 50, 0 , 0 , 0 , 0 } }, // #39 [ref=1x]
- { InstDB::RWInfo::kCategoryImul , 2 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #40 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 51, 52, 0 , 0 , 0 , 0 } }, // #41 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 54, 52, 0 , 0 , 0 , 0 } }, // #42 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 13, { 3 , 5 , 0 , 0 , 0 , 0 } }, // #43 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 22, 29, 0 , 0 , 0 , 0 } }, // #44 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 55, 0 , 0 , 0 , 0 , 0 } }, // #45 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 23, { 56, 40, 0 , 0 , 0 , 0 } }, // #46 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 24, { 44, 9 , 0 , 0 , 0 , 0 } }, // #47 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 25, { 35, 7 , 0 , 0 , 0 , 0 } }, // #48 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 26, { 48, 13, 0 , 0 , 0 , 0 } }, // #49 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 56, 40, 0 , 0 , 0 , 0 } }, // #50 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 44, 9 , 0 , 0 , 0 , 0 } }, // #51 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 7 , 0 , 0 , 0 , 0 } }, // #52 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 48, 13, 0 , 0 , 0 , 0 } }, // #53 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 40, 40, 0 , 0 , 0 , 0 } }, // #54 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 9 , 9 , 0 , 0 , 0 , 0 } }, // #55 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 7 , 7 , 0 , 0 , 0 , 0 } }, // #56 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 13, 13, 0 , 0 , 0 , 0 } }, // #57 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 27, { 11, 3 , 0 , 0 , 0 , 0 } }, // #58 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 13, { 10, 5 , 0 , 0 , 0 , 0 } }, // #59 [ref=5x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 2 , 3 , 0 , 0 , 0 , 0 } }, // #60 [ref=11x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 2 , 3 , 0 , 0 , 0 , 0 } }, // #2 [ref=15x]
+ { InstDB::RWInfo::kCategoryGeneric , 1 , { 2 , 3 , 0 , 0 , 0 , 0 } }, // #3 [ref=7x]
+ { InstDB::RWInfo::kCategoryGeneric , 2 , { 2 , 3 , 0 , 0 , 0 , 0 } }, // #4 [ref=96x]
+ { InstDB::RWInfo::kCategoryGeneric , 3 , { 4 , 5 , 0 , 0 , 0 , 0 } }, // #5 [ref=55x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 6 , 7 , 0 , 0 , 0 , 0 } }, // #6 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 8 , 9 , 0 , 0 , 0 , 0 } }, // #7 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 3 , { 10, 5 , 0 , 0 , 0 , 0 } }, // #8 [ref=26x]
+ { InstDB::RWInfo::kCategoryGeneric , 7 , { 12, 13, 0 , 0 , 0 , 0 } }, // #9 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 2 , { 11, 3 , 0 , 0 , 0 , 0 } }, // #10 [ref=75x]
+ { InstDB::RWInfo::kCategoryGeneric , 2 , { 5 , 3 , 0 , 0 , 0 , 0 } }, // #11 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 10, 3 , 0 , 0 , 0 , 0 } }, // #12 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 9 , { 10, 5 , 0 , 0 , 0 , 0 } }, // #13 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 15, 5 , 0 , 0 , 0 , 0 } }, // #14 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 3 , 3 , 0 , 0 , 0 , 0 } }, // #15 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 10, { 3 , 3 , 0 , 0 , 0 , 0 } }, // #16 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 10, { 2 , 3 , 0 , 0 , 0 , 0 } }, // #17 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 16, 17, 0 , 0 , 0 , 0 } }, // #18 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 1 , { 3 , 3 , 0 , 0 , 0 , 0 } }, // #19 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 14, { 20, 21, 0 , 0 , 0 , 0 } }, // #20 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 7 , 7 , 0 , 0 , 0 , 0 } }, // #21 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 9 , 9 , 0 , 0 , 0 , 0 } }, // #22 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 33, 34, 0 , 0 , 0 , 0 } }, // #23 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 16, { 2 , 3 , 0 , 0 , 0 , 0 } }, // #24 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 10, 7 , 0 , 0 , 0 , 0 } }, // #25 [ref=10x]
+ { InstDB::RWInfo::kCategoryGeneric , 3 , { 35, 5 , 0 , 0 , 0 , 0 } }, // #26 [ref=5x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 36, 7 , 0 , 0 , 0 , 0 } }, // #27 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 35, 7 , 0 , 0 , 0 , 0 } }, // #28 [ref=11x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 11, 7 , 0 , 0 , 0 , 0 } }, // #29 [ref=9x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 37, 7 , 0 , 0 , 0 , 0 } }, // #30 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 16, { 36, 3 , 0 , 0 , 0 , 0 } }, // #31 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 16, { 37, 3 , 0 , 0 , 0 , 0 } }, // #32 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 36, 9 , 0 , 0 , 0 , 0 } }, // #33 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 11, 9 , 0 , 0 , 0 , 0 } }, // #34 [ref=7x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 38, 39, 0 , 0 , 0 , 0 } }, // #35 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 17, { 1 , 40, 0 , 0 , 0 , 0 } }, // #36 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 13, { 43, 44, 0 , 0 , 0 , 0 } }, // #37 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 4 , 5 , 0 , 0 , 0 , 0 } }, // #38 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 46, 47, 0 , 0 , 0 , 0 } }, // #39 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 0 , 51, 0 , 0 , 0 , 0 } }, // #40 [ref=1x]
+ { InstDB::RWInfo::kCategoryImul , 2 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #41 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 52, 53, 0 , 0 , 0 , 0 } }, // #42 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 14, { 55, 53, 0 , 0 , 0 , 0 } }, // #43 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 15, { 3 , 5 , 0 , 0 , 0 , 0 } }, // #44 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 22, 29, 0 , 0 , 0 , 0 } }, // #45 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 57, 0 , 0 , 0 , 0 , 0 } }, // #46 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 23, { 58, 40, 0 , 0 , 0 , 0 } }, // #47 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 24, { 45, 9 , 0 , 0 , 0 , 0 } }, // #48 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 25, { 35, 7 , 0 , 0 , 0 , 0 } }, // #49 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 26, { 49, 13, 0 , 0 , 0 , 0 } }, // #50 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 58, 40, 0 , 0 , 0 , 0 } }, // #51 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 45, 9 , 0 , 0 , 0 , 0 } }, // #52 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 7 , 0 , 0 , 0 , 0 } }, // #53 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 49, 13, 0 , 0 , 0 , 0 } }, // #54 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 40, 40, 0 , 0 , 0 , 0 } }, // #55 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 9 , 9 , 0 , 0 , 0 , 0 } }, // #56 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 7 , 7 , 0 , 0 , 0 , 0 } }, // #57 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 13, 13, 0 , 0 , 0 , 0 } }, // #58 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 27, { 11, 3 , 0 , 0 , 0 , 0 } }, // #59 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 15, { 10, 5 , 0 , 0 , 0 , 0 } }, // #60 [ref=5x]
{ InstDB::RWInfo::kCategoryGeneric , 8 , { 11, 3 , 0 , 0 , 0 , 0 } }, // #61 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 51, 20, 0 , 0 , 0 , 0 } }, // #62 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 58, 0 , 0 , 0 , 0 , 0 } }, // #63 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 52, 20, 0 , 0 , 0 , 0 } }, // #62 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 60, 0 , 0 , 0 , 0 , 0 } }, // #63 [ref=3x]
{ InstDB::RWInfo::kCategoryMov , 29, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #64 [ref=1x]
{ InstDB::RWInfo::kCategoryMovabs , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #65 [ref=1x]
{ InstDB::RWInfo::kCategoryGeneric , 30, { 10, 5 , 0 , 0 , 0 , 0 } }, // #66 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 11, 3 , 0 , 0 , 0 , 0 } }, // #67 [ref=14x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 36, 61, 0 , 0 , 0 , 0 } }, // #68 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 11, 3 , 0 , 0 , 0 , 0 } }, // #67 [ref=18x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 36, 64, 0 , 0 , 0 , 0 } }, // #68 [ref=1x]
{ InstDB::RWInfo::kCategoryMovh64 , 12, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #69 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 62, 7 , 0 , 0 , 0 , 0 } }, // #70 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 65, 7 , 0 , 0 , 0 , 0 } }, // #70 [ref=1x]
{ InstDB::RWInfo::kCategoryGeneric , 12, { 35, 7 , 0 , 0 , 0 , 0 } }, // #71 [ref=7x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 56, 5 , 0 , 0 , 0 , 0 } }, // #72 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 28, { 44, 9 , 0 , 0 , 0 , 0 } }, // #73 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 63, 20, 0 , 0 , 0 , 0 } }, // #74 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 58, 5 , 0 , 0 , 0 , 0 } }, // #72 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 28, { 45, 9 , 0 , 0 , 0 , 0 } }, // #73 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 14, { 66, 20, 0 , 0 , 0 , 0 } }, // #74 [ref=1x]
{ InstDB::RWInfo::kCategoryGeneric , 31, { 35, 7 , 0 , 0 , 0 , 0 } }, // #75 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 33, { 44, 9 , 0 , 0 , 0 , 0 } }, // #76 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 14, { 11, 3 , 0 , 0 , 0 , 0 } }, // #77 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 33, { 45, 9 , 0 , 0 , 0 , 0 } }, // #76 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 16, { 11, 3 , 0 , 0 , 0 , 0 } }, // #77 [ref=6x]
{ InstDB::RWInfo::kCategoryGeneric , 0 , { 17, 29, 0 , 0 , 0 , 0 } }, // #78 [ref=1x]
{ InstDB::RWInfo::kCategoryGeneric , 11, { 3 , 3 , 0 , 0 , 0 , 0 } }, // #79 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 52, 22, 0 , 0 , 0 , 0 } }, // #80 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 52, 66, 0 , 0 , 0 , 0 } }, // #81 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 53, 22, 0 , 0 , 0 , 0 } }, // #80 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 14, { 53, 69, 0 , 0 , 0 , 0 } }, // #81 [ref=1x]
{ InstDB::RWInfo::kCategoryGeneric , 4 , { 26, 7 , 0 , 0 , 0 , 0 } }, // #82 [ref=18x]
{ InstDB::RWInfo::kCategoryGeneric , 36, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #83 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 3 , { 69, 5 , 0 , 0 , 0 , 0 } }, // #84 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 3 , { 72, 5 , 0 , 0 , 0 , 0 } }, // #84 [ref=2x]
{ InstDB::RWInfo::kCategoryVmov1_8 , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #85 [ref=2x]
{ InstDB::RWInfo::kCategoryGeneric , 5 , { 10, 9 , 0 , 0 , 0 , 0 } }, // #86 [ref=4x]
{ InstDB::RWInfo::kCategoryGeneric , 27, { 10, 13, 0 , 0 , 0 , 0 } }, // #87 [ref=2x]
{ InstDB::RWInfo::kCategoryGeneric , 0 , { 4 , 0 , 0 , 0 , 0 , 0 } }, // #88 [ref=2x]
{ InstDB::RWInfo::kCategoryGeneric , 3 , { 5 , 5 , 0 , 0 , 0 , 0 } }, // #89 [ref=1x]
{ InstDB::RWInfo::kCategoryPunpcklxx , 38, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #90 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 10, { 2 , 71, 0 , 0 , 0 , 0 } }, // #91 [ref=8x]
+ { InstDB::RWInfo::kCategoryGeneric , 10, { 2 , 73, 0 , 0 , 0 , 0 } }, // #91 [ref=8x]
{ InstDB::RWInfo::kCategoryGeneric , 5 , { 37, 9 , 0 , 0 , 0 , 0 } }, // #92 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 16, 50, 0 , 0 , 0 , 0 } }, // #93 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 16, 51, 0 , 0 , 0 , 0 } }, // #93 [ref=1x]
{ InstDB::RWInfo::kCategoryGeneric , 0 , { 22, 21, 0 , 0 , 0 , 0 } }, // #94 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 63, 22, 0 , 0 , 0 , 0 } }, // #95 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 8 , { 74, 3 , 0 , 0 , 0 , 0 } }, // #96 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 8 , { 11, 43, 0 , 0 , 0 , 0 } }, // #97 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 53, 9 , 0 , 0 , 0 , 0 } }, // #98 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 13, { 80, 5 , 0 , 0 , 0 , 0 } }, // #99 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 13, { 11, 5 , 0 , 0 , 0 , 0 } }, // #100 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 43, { 74, 81, 0 , 0 , 0 , 0 } }, // #101 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 44, { 11, 7 , 0 , 0 , 0 , 0 } }, // #102 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 45, { 11, 9 , 0 , 0 , 0 , 0 } }, // #103 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 27, { 13, 13, 0 , 0 , 0 , 0 } }, // #104 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 11, { 11, 3 , 0 , 0 , 0 , 0 } }, // #105 [ref=7x]
- { InstDB::RWInfo::kCategoryVmov2_1 , 46, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #106 [ref=14x]
- { InstDB::RWInfo::kCategoryVmov1_2 , 14, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #107 [ref=7x]
- { InstDB::RWInfo::kCategoryGeneric , 14, { 10, 3 , 0 , 0 , 0 , 0 } }, // #108 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 46, { 11, 3 , 0 , 0 , 0 , 0 } }, // #109 [ref=5x]
- { InstDB::RWInfo::kCategoryGeneric , 47, { 11, 5 , 0 , 0 , 0 , 0 } }, // #110 [ref=5x]
- { InstDB::RWInfo::kCategoryGeneric , 27, { 11, 5 , 0 , 0 , 0 , 0 } }, // #111 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 51, { 74, 43, 0 , 0 , 0 , 0 } }, // #112 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 44, 9 , 0 , 0 , 0 , 0 } }, // #113 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 18, { 2 , 3 , 0 , 0 , 0 , 0 } }, // #114 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 58, { 11, 3 , 0 , 0 , 0 , 0 } }, // #115 [ref=12x]
- { InstDB::RWInfo::kCategoryVmovddup , 38, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #116 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 12, { 35, 61, 0 , 0 , 0 , 0 } }, // #117 [ref=2x]
- { InstDB::RWInfo::kCategoryVmovmskpd , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #118 [ref=1x]
- { InstDB::RWInfo::kCategoryVmovmskps , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #119 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 59, { 35, 7 , 0 , 0 , 0 , 0 } }, // #120 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 21, { 48, 13, 0 , 0 , 0 , 0 } }, // #121 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 2 , { 3 , 3 , 0 , 0 , 0 , 0 } }, // #122 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 15, { 11, 40, 0 , 0 , 0 , 0 } }, // #123 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 11, 7 , 0 , 0 , 0 , 0 } }, // #124 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 27, { 11, 13, 0 , 0 , 0 , 0 } }, // #125 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 3 , 0 , 0 , 0 , 0 } }, // #126 [ref=4x]
- { InstDB::RWInfo::kCategoryVmov1_4 , 62, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #127 [ref=6x]
- { InstDB::RWInfo::kCategoryVmov1_2 , 48, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #128 [ref=9x]
- { InstDB::RWInfo::kCategoryVmov1_8 , 63, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #129 [ref=3x]
- { InstDB::RWInfo::kCategoryVmov4_1 , 47, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #130 [ref=4x]
- { InstDB::RWInfo::kCategoryVmov8_1 , 64, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #131 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 18, { 11, 3 , 0 , 0 , 0 , 0 } }, // #132 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 17, { 44, 9 , 0 , 0 , 0 , 0 } }, // #133 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 35, { 35, 7 , 0 , 0 , 0 , 0 } }, // #134 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 11, { 2 , 2 , 0 , 0 , 0 , 0 } }, // #135 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 58, { 2 , 2 , 0 , 0 , 0 , 0 } } // #136 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 66, 22, 0 , 0 , 0 , 0 } }, // #95 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 43, 3 , 0 , 0 , 0 , 0 } }, // #96 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 11, 44, 0 , 0 , 0 , 0 } }, // #97 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 54, 9 , 0 , 0 , 0 , 0 } }, // #98 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 21, { 11, 13, 0 , 0 , 0 , 0 } }, // #99 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 15, { 81, 5 , 0 , 0 , 0 , 0 } }, // #100 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 15, { 11, 5 , 0 , 0 , 0 , 0 } }, // #101 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 43, { 43, 82, 0 , 0 , 0 , 0 } }, // #102 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 44, { 11, 7 , 0 , 0 , 0 , 0 } }, // #103 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 45, { 11, 9 , 0 , 0 , 0 , 0 } }, // #104 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 27, { 13, 13, 0 , 0 , 0 , 0 } }, // #105 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 11, { 11, 3 , 0 , 0 , 0 , 0 } }, // #106 [ref=7x]
+ { InstDB::RWInfo::kCategoryVmov2_1 , 46, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #107 [ref=14x]
+ { InstDB::RWInfo::kCategoryVmov1_2 , 16, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #108 [ref=7x]
+ { InstDB::RWInfo::kCategoryGeneric , 16, { 10, 3 , 0 , 0 , 0 , 0 } }, // #109 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 46, { 11, 3 , 0 , 0 , 0 , 0 } }, // #110 [ref=5x]
+ { InstDB::RWInfo::kCategoryGeneric , 47, { 11, 5 , 0 , 0 , 0 , 0 } }, // #111 [ref=5x]
+ { InstDB::RWInfo::kCategoryGeneric , 27, { 11, 5 , 0 , 0 , 0 , 0 } }, // #112 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 51, { 43, 44, 0 , 0 , 0 , 0 } }, // #113 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 45, 9 , 0 , 0 , 0 , 0 } }, // #114 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 14, { 2 , 3 , 0 , 0 , 0 , 0 } }, // #115 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 58, { 11, 3 , 0 , 0 , 0 , 0 } }, // #116 [ref=12x]
+ { InstDB::RWInfo::kCategoryVmovddup , 38, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #117 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 12, { 35, 64, 0 , 0 , 0 , 0 } }, // #118 [ref=2x]
+ { InstDB::RWInfo::kCategoryVmovmskpd , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #119 [ref=1x]
+ { InstDB::RWInfo::kCategoryVmovmskps , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #120 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 59, { 35, 7 , 0 , 0 , 0 , 0 } }, // #121 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 21, { 49, 13, 0 , 0 , 0 , 0 } }, // #122 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 2 , { 3 , 3 , 0 , 0 , 0 , 0 } }, // #123 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 17, { 11, 40, 0 , 0 , 0 , 0 } }, // #124 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 11, 7 , 0 , 0 , 0 , 0 } }, // #125 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 27, { 11, 13, 0 , 0 , 0 , 0 } }, // #126 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 3 , 0 , 0 , 0 , 0 } }, // #127 [ref=4x]
+ { InstDB::RWInfo::kCategoryVmov1_4 , 62, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #128 [ref=6x]
+ { InstDB::RWInfo::kCategoryVmov1_2 , 48, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #129 [ref=9x]
+ { InstDB::RWInfo::kCategoryVmov1_8 , 63, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #130 [ref=3x]
+ { InstDB::RWInfo::kCategoryVmov4_1 , 47, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #131 [ref=4x]
+ { InstDB::RWInfo::kCategoryVmov8_1 , 64, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #132 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 14, { 11, 3 , 0 , 0 , 0 , 0 } }, // #133 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 90, 5 , 0 , 0 , 0 , 0 } }, // #134 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 90, 82, 0 , 0 , 0 , 0 } }, // #135 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 18, { 45, 9 , 0 , 0 , 0 , 0 } }, // #136 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 35, { 35, 7 , 0 , 0 , 0 , 0 } }, // #137 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 11, { 2 , 2 , 0 , 0 , 0 , 0 } }, // #138 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 58, { 2 , 2 , 0 , 0 , 0 , 0 } } // #139 [ref=1x]
};
const InstDB::RWInfo InstDB::rwInfoB[] = {
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #0 [ref=773x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #0 [ref=791x]
{ InstDB::RWInfo::kCategoryGeneric , 0 , { 1 , 0 , 0 , 0 , 0 , 0 } }, // #1 [ref=5x]
{ InstDB::RWInfo::kCategoryGeneric , 3 , { 10, 5 , 0 , 0 , 0 , 0 } }, // #2 [ref=7x]
{ InstDB::RWInfo::kCategoryGeneric , 6 , { 11, 3 , 3 , 0 , 0 , 0 } }, // #3 [ref=193x]
@@ -4067,201 +5802,206 @@ const InstDB::RWInfo InstDB::rwInfoB[] = {
{ InstDB::RWInfo::kCategoryGeneric , 0 , { 2 , 0 , 0 , 0 , 0 , 0 } }, // #7 [ref=1x]
{ InstDB::RWInfo::kCategoryGeneric , 11, { 3 , 0 , 0 , 0 , 0 , 0 } }, // #8 [ref=2x]
{ InstDB::RWInfo::kCategoryGeneric , 0 , { 18, 0 , 0 , 0 , 0 , 0 } }, // #9 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 8 , { 3 , 0 , 0 , 0 , 0 , 0 } }, // #10 [ref=34x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 3 , 0 , 0 , 0 , 0 , 0 } }, // #10 [ref=37x]
{ InstDB::RWInfo::kCategoryGeneric , 12, { 7 , 0 , 0 , 0 , 0 , 0 } }, // #11 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 19, 0 , 0 , 0 , 0 , 0 } }, // #12 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 6 , 7 , 0 , 0 , 0 , 0 } }, // #13 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 8 , 9 , 0 , 0 , 0 , 0 } }, // #14 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 11, { 2 , 3 , 22, 0 , 0 , 0 } }, // #15 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 13, { 4 , 23, 18, 24, 25, 0 } }, // #16 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 12, { 26, 27, 28, 29, 30, 0 } }, // #17 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 28, 31, 32, 16, 0 , 0 } }, // #18 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 28, 0 , 0 , 0 , 0 , 0 } }, // #19 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 10, { 2 , 0 , 0 , 0 , 0 , 0 } }, // #20 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 6 , { 41, 42, 3 , 0 , 0 , 0 } }, // #21 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 17, { 44, 5 , 0 , 0 , 0 , 0 } }, // #22 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 4 , 0 , 0 , 0 , 0 , 0 } }, // #23 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 18, { 3 , 0 , 0 , 0 , 0 , 0 } }, // #24 [ref=17x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 45, 0 , 0 , 0 , 0 , 0 } }, // #25 [ref=16x]
- { InstDB::RWInfo::kCategoryGeneric , 19, { 46, 0 , 0 , 0 , 0 , 0 } }, // #26 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 13, { 19, 0 , 0 , 0 , 0 , 0 } }, // #12 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 2 , 2 , 3 , 0 , 0 , 0 } }, // #13 [ref=16x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 6 , 7 , 0 , 0 , 0 , 0 } }, // #14 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 8 , 9 , 0 , 0 , 0 , 0 } }, // #15 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 11, { 2 , 3 , 22, 0 , 0 , 0 } }, // #16 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 15, { 4 , 23, 18, 24, 25, 0 } }, // #17 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 12, { 26, 27, 28, 29, 30, 0 } }, // #18 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 28, 31, 32, 16, 0 , 0 } }, // #19 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 28, 0 , 0 , 0 , 0 , 0 } }, // #20 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 10, { 2 , 0 , 0 , 0 , 0 , 0 } }, // #21 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 6 , { 41, 42, 3 , 0 , 0 , 0 } }, // #22 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 18, { 45, 5 , 0 , 0 , 0 , 0 } }, // #23 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 4 , 0 , 0 , 0 , 0 , 0 } }, // #24 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 14, { 3 , 0 , 0 , 0 , 0 , 0 } }, // #25 [ref=17x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 46, 0 , 0 , 0 , 0 , 0 } }, // #26 [ref=16x]
{ InstDB::RWInfo::kCategoryGeneric , 19, { 47, 0 , 0 , 0 , 0 , 0 } }, // #27 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 20, { 3 , 0 , 0 , 0 , 0 , 0 } }, // #28 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 46, 0 , 0 , 0 , 0 , 0 } }, // #29 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 18, { 11, 0 , 0 , 0 , 0 , 0 } }, // #30 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 21, { 13, 0 , 0 , 0 , 0 , 0 } }, // #31 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 8 , { 11, 0 , 0 , 0 , 0 , 0 } }, // #32 [ref=8x]
- { InstDB::RWInfo::kCategoryGeneric , 21, { 48, 0 , 0 , 0 , 0 , 0 } }, // #33 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 7 , { 49, 0 , 0 , 0 , 0 , 0 } }, // #34 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 20, { 11, 0 , 0 , 0 , 0 , 0 } }, // #35 [ref=2x]
- { InstDB::RWInfo::kCategoryImul , 22, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #36 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 53, 0 , 0 , 0 , 0 , 0 } }, // #37 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 26, 0 , 0 , 0 , 0 , 0 } }, // #38 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 4 , 9 , 0 , 0 , 0 , 0 } }, // #39 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 4 , 5 , 0 , 0 , 0 , 0 } }, // #40 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 56, 40, 40, 0 , 0 , 0 } }, // #41 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 44, 9 , 9 , 0 , 0 , 0 } }, // #42 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 7 , 7 , 0 , 0 , 0 } }, // #43 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 48, 13, 13, 0 , 0 , 0 } }, // #44 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 56, 40, 0 , 0 , 0 , 0 } }, // #45 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 44, 9 , 0 , 0 , 0 , 0 } }, // #46 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 7 , 0 , 0 , 0 , 0 } }, // #47 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 48, 13, 0 , 0 , 0 , 0 } }, // #48 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 48, 40, 40, 0 , 0 , 0 } }, // #49 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 9 , 9 , 0 , 0 , 0 } }, // #50 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 44, 13, 13, 0 , 0 , 0 } }, // #51 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 57, 0 , 0 , 0 , 0 , 0 } }, // #52 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 28, { 9 , 0 , 0 , 0 , 0 , 0 } }, // #53 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 16, { 43, 0 , 0 , 0 , 0 , 0 } }, // #54 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 7 , { 13, 0 , 0 , 0 , 0 , 0 } }, // #55 [ref=5x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 3 , 0 , 0 , 0 , 0 , 0 } }, // #56 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 3 , 9 , 0 , 0 , 0 , 0 } }, // #57 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 5 , 5 , 59, 0 , 0 , 0 } }, // #58 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 7 , 7 , 59, 0 , 0 , 0 } }, // #59 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 19, 29, 60, 0 , 0 , 0 } }, // #60 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 32, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #61 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 6 , { 64, 42, 3 , 0 , 0 , 0 } }, // #62 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 6 , { 11, 11, 3 , 65, 0 , 0 } }, // #63 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 17, 29, 30, 0 , 0 , 0 } }, // #64 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 10, { 3 , 0 , 0 , 0 , 0 , 0 } }, // #65 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 2 , { 2 , 3 , 0 , 0 , 0 , 0 } }, // #66 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 3 , { 5 , 5 , 0 , 67, 17, 60 } }, // #67 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 3 , { 5 , 5 , 0 , 68, 17, 60 } }, // #68 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 3 , { 5 , 5 , 0 , 67, 0 , 0 } }, // #69 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 3 , { 5 , 5 , 0 , 68, 0 , 0 } }, // #70 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 34, { 56, 5 , 0 , 0 , 0 , 0 } }, // #71 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 35, { 35, 5 , 0 , 0 , 0 , 0 } }, // #72 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 37, { 48, 3 , 0 , 0 , 0 , 0 } }, // #73 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 15, { 4 , 40, 0 , 0 , 0 , 0 } }, // #74 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 4 , 7 , 0 , 0 , 0 , 0 } }, // #75 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 27, { 2 , 13, 0 , 0 , 0 , 0 } }, // #76 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 10, { 70, 0 , 0 , 0 , 0 , 0 } }, // #77 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 35, 7 , 0 , 0 , 0 , 0 } }, // #78 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 10, { 65, 0 , 0 , 0 , 0 , 0 } }, // #79 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 11, 0 , 0 , 0 , 0 , 0 } }, // #80 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 16, 50, 29, 0 , 0 , 0 } }, // #81 [ref=5x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 44, 0 , 0 , 0 , 0 , 0 } }, // #82 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 0 , 0 , 0 , 0 , 0 } }, // #83 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 16, 50, 67, 0 , 0 , 0 } }, // #84 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 2 , { 11, 3 , 0 , 0 , 0 , 0 } }, // #85 [ref=19x]
- { InstDB::RWInfo::kCategoryGeneric , 4 , { 36, 7 , 0 , 0 , 0 , 0 } }, // #86 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 37, 9 , 0 , 0 , 0 , 0 } }, // #87 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 72, 0 , 0 , 0 , 0 , 0 } }, // #88 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 7 , 0 , 0 , 0 , 0 , 0 } }, // #89 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 34, { 73, 0 , 0 , 0 , 0 , 0 } }, // #90 [ref=30x]
- { InstDB::RWInfo::kCategoryGeneric , 11, { 2 , 3 , 71, 0 , 0 , 0 } }, // #91 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 39, { 11, 0 , 0 , 0 , 0 , 0 } }, // #92 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 28, { 44, 0 , 0 , 0 , 0 , 0 } }, // #93 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 16, { 74, 0 , 0 , 0 , 0 , 0 } }, // #94 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 75, 43, 43, 0 , 0 , 0 } }, // #95 [ref=5x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 74, 0 , 0 , 0 , 0 , 0 } }, // #96 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 9 , 60, 17, 0 , 0 , 0 } }, // #97 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 13, { 75, 76, 77, 77, 77, 5 } }, // #98 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 13, { 4 , 78, 79, 79, 79, 5 } }, // #99 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 40, { 10, 5 , 7 , 0 , 0 , 0 } }, // #100 [ref=8x]
- { InstDB::RWInfo::kCategoryGeneric , 41, { 10, 5 , 13, 0 , 0 , 0 } }, // #101 [ref=7x]
- { InstDB::RWInfo::kCategoryGeneric , 42, { 10, 5 , 9 , 0 , 0 , 0 } }, // #102 [ref=9x]
- { InstDB::RWInfo::kCategoryGeneric , 6 , { 11, 3 , 3 , 3 , 0 , 0 } }, // #103 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 6 , { 35, 3 , 3 , 0 , 0 , 0 } }, // #104 [ref=18x]
- { InstDB::RWInfo::kCategoryGeneric , 40, { 11, 5 , 7 , 0 , 0 , 0 } }, // #105 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 41, { 35, 13, 13, 0 , 0 , 0 } }, // #106 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 42, { 11, 5 , 9 , 0 , 0 , 0 } }, // #107 [ref=1x]
- { InstDB::RWInfo::kCategoryVmov1_2 , 48, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #108 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 40, { 10, 5 , 5 , 0 , 0 , 0 } }, // #109 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 40, { 10, 82, 7 , 0 , 0 , 0 } }, // #110 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 41, { 10, 5 , 5 , 0 , 0 , 0 } }, // #111 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 49, { 10, 61, 3 , 0 , 0 , 0 } }, // #112 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 49, { 10, 3 , 3 , 0 , 0 , 0 } }, // #113 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 49, { 10, 82, 3 , 0 , 0 , 0 } }, // #114 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 42, { 10, 61, 9 , 0 , 0 , 0 } }, // #115 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 42, { 10, 5 , 5 , 0 , 0 , 0 } }, // #116 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 50, { 10, 5 , 5 , 0 , 0 , 0 } }, // #117 [ref=9x]
- { InstDB::RWInfo::kCategoryGeneric , 52, { 10, 81, 0 , 0 , 0 , 0 } }, // #118 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 52, { 10, 3 , 0 , 0 , 0 , 0 } }, // #119 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 53, { 80, 43, 0 , 0 , 0 , 0 } }, // #120 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 6 , { 2 , 3 , 3 , 0 , 0 , 0 } }, // #121 [ref=82x]
- { InstDB::RWInfo::kCategoryGeneric , 42, { 4 , 5 , 5 , 0 , 0 , 0 } }, // #122 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 40, { 4 , 61, 7 , 0 , 0 , 0 } }, // #123 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 42, { 4 , 82, 9 , 0 , 0 , 0 } }, // #124 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 40, { 6 , 7 , 7 , 0 , 0 , 0 } }, // #125 [ref=11x]
- { InstDB::RWInfo::kCategoryGeneric , 41, { 4 , 5 , 5 , 0 , 0 , 0 } }, // #126 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 42, { 8 , 9 , 9 , 0 , 0 , 0 } }, // #127 [ref=11x]
- { InstDB::RWInfo::kCategoryGeneric , 54, { 11, 3 , 3 , 3 , 0 , 0 } }, // #128 [ref=15x]
- { InstDB::RWInfo::kCategoryGeneric , 55, { 35, 7 , 7 , 7 , 0 , 0 } }, // #129 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 56, { 44, 9 , 9 , 9 , 0 , 0 } }, // #130 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 41, { 4 , 5 , 13, 0 , 0 , 0 } }, // #131 [ref=6x]
- { InstDB::RWInfo::kCategoryGeneric , 40, { 26, 7 , 7 , 0 , 0 , 0 } }, // #132 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 42, { 53, 9 , 9 , 0 , 0 , 0 } }, // #133 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 14, { 35, 3 , 0 , 0 , 0 , 0 } }, // #134 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 27, { 35, 13, 0 , 0 , 0 , 0 } }, // #135 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 5 , { 35, 9 , 0 , 0 , 0 , 0 } }, // #136 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 8 , { 2 , 3 , 2 , 0 , 0 , 0 } }, // #137 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 2 , 3 , 2 , 0 , 0 , 0 } }, // #138 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 18, { 4 , 3 , 4 , 0 , 0 , 0 } }, // #139 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 40, { 10, 61, 7 , 0 , 0 , 0 } }, // #140 [ref=11x]
- { InstDB::RWInfo::kCategoryGeneric , 41, { 10, 83, 13, 0 , 0 , 0 } }, // #141 [ref=7x]
- { InstDB::RWInfo::kCategoryGeneric , 42, { 10, 82, 9 , 0 , 0 , 0 } }, // #142 [ref=13x]
- { InstDB::RWInfo::kCategoryGeneric , 50, { 80, 81, 5 , 0 , 0 , 0 } }, // #143 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 50, { 11, 3 , 5 , 0 , 0 , 0 } }, // #144 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 57, { 74, 43, 81, 0 , 0 , 0 } }, // #145 [ref=4x]
- { InstDB::RWInfo::kCategoryVmaskmov , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #146 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 12, { 35, 0 , 0 , 0 , 0 , 0 } }, // #147 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 22, 0 , 0 , 0 , 0 , 0 } }, // #148 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 61, 61, 0 , 0 , 0 } }, // #149 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 12, { 10, 7 , 7 , 0 , 0 , 0 } }, // #150 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 7 , 7 , 0 , 0 , 0 } }, // #151 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 12, { 10, 61, 7 , 0 , 0 , 0 } }, // #152 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 61, 7 , 0 , 0 , 0 } }, // #153 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 83, 13, 0 , 0 , 0 } }, // #154 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 82, 9 , 0 , 0 , 0 } }, // #155 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 84, 0 , 0 , 0 , 0 , 0 } }, // #156 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 60, { 85, 86, 3 , 3 , 0 , 0 } }, // #157 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 13, { 74, 76, 77, 77, 77, 5 } }, // #158 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 57, { 80, 81, 81, 0 , 0 , 0 } }, // #159 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 22, { 11, 3 , 3 , 0 , 0 , 0 } }, // #160 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 7 , { 48, 5 , 0 , 0 , 0 , 0 } }, // #161 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 61, { 10, 5 , 40, 0 , 0 , 0 } }, // #162 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 50, { 10, 5 , 5 , 5 , 0 , 0 } }, // #163 [ref=12x]
- { InstDB::RWInfo::kCategoryGeneric , 65, { 10, 5 , 5 , 5 , 0 , 0 } }, // #164 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 66, { 10, 5 , 5 , 0 , 0 , 0 } }, // #165 [ref=12x]
- { InstDB::RWInfo::kCategoryGeneric , 67, { 11, 3 , 5 , 0 , 0 , 0 } }, // #166 [ref=5x]
- { InstDB::RWInfo::kCategoryGeneric , 68, { 11, 3 , 0 , 0 , 0 , 0 } }, // #167 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 69, { 11, 3 , 5 , 0 , 0 , 0 } }, // #168 [ref=3x]
- { InstDB::RWInfo::kCategoryGeneric , 22, { 11, 3 , 5 , 0 , 0 , 0 } }, // #169 [ref=1x]
- { InstDB::RWInfo::kCategoryGeneric , 0 , { 60, 17, 29, 0 , 0 , 0 } }, // #170 [ref=2x]
- { InstDB::RWInfo::kCategoryGeneric , 8 , { 3 , 60, 17, 0 , 0 , 0 } }, // #171 [ref=4x]
- { InstDB::RWInfo::kCategoryGeneric , 8 , { 11, 60, 17, 0 , 0 , 0 } } // #172 [ref=8x]
+ { InstDB::RWInfo::kCategoryGeneric , 19, { 48, 0 , 0 , 0 , 0 , 0 } }, // #28 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 20, { 3 , 0 , 0 , 0 , 0 , 0 } }, // #29 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 47, 0 , 0 , 0 , 0 , 0 } }, // #30 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 14, { 11, 0 , 0 , 0 , 0 , 0 } }, // #31 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 21, { 13, 0 , 0 , 0 , 0 , 0 } }, // #32 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 11, 0 , 0 , 0 , 0 , 0 } }, // #33 [ref=8x]
+ { InstDB::RWInfo::kCategoryGeneric , 21, { 49, 0 , 0 , 0 , 0 , 0 } }, // #34 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 7 , { 50, 0 , 0 , 0 , 0 , 0 } }, // #35 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 20, { 11, 0 , 0 , 0 , 0 , 0 } }, // #36 [ref=2x]
+ { InstDB::RWInfo::kCategoryImul , 22, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #37 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 54, 0 , 0 , 0 , 0 , 0 } }, // #38 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 26, 0 , 0 , 0 , 0 , 0 } }, // #39 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 4 , 9 , 0 , 0 , 0 , 0 } }, // #40 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 4 , 5 , 0 , 0 , 0 , 0 } }, // #41 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 22, 56, 57, 0 , 0 , 0 } }, // #42 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 58, 40, 40, 0 , 0 , 0 } }, // #43 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 45, 9 , 9 , 0 , 0 , 0 } }, // #44 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 7 , 7 , 0 , 0 , 0 } }, // #45 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 49, 13, 13, 0 , 0 , 0 } }, // #46 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 58, 40, 0 , 0 , 0 , 0 } }, // #47 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 45, 9 , 0 , 0 , 0 , 0 } }, // #48 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 7 , 0 , 0 , 0 , 0 } }, // #49 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 49, 13, 0 , 0 , 0 , 0 } }, // #50 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 49, 40, 40, 0 , 0 , 0 } }, // #51 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 9 , 9 , 0 , 0 , 0 } }, // #52 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 45, 13, 13, 0 , 0 , 0 } }, // #53 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 59, 0 , 0 , 0 , 0 , 0 } }, // #54 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 28, { 9 , 0 , 0 , 0 , 0 , 0 } }, // #55 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 13, { 44, 0 , 0 , 0 , 0 , 0 } }, // #56 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 7 , { 13, 0 , 0 , 0 , 0 , 0 } }, // #57 [ref=5x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 3 , 0 , 0 , 0 , 0 , 0 } }, // #58 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 3 , 9 , 0 , 0 , 0 , 0 } }, // #59 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 15, { 5 , 5 , 61, 0 , 0 , 0 } }, // #60 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 12, { 7 , 7 , 62, 0 , 0 , 0 } }, // #61 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 63, 29, 56, 0 , 0 , 0 } }, // #62 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 32, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #63 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 6 , { 67, 42, 3 , 0 , 0 , 0 } }, // #64 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 6 , { 11, 11, 3 , 68, 0 , 0 } }, // #65 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 17, 29, 30, 0 , 0 , 0 } }, // #66 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 10, { 3 , 0 , 0 , 0 , 0 , 0 } }, // #67 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 2 , { 2 , 3 , 0 , 0 , 0 , 0 } }, // #68 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 3 , { 5 , 5 , 0 , 70, 17, 56 } }, // #69 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 3 , { 5 , 5 , 0 , 71, 17, 56 } }, // #70 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 3 , { 5 , 5 , 0 , 70, 0 , 0 } }, // #71 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 3 , { 5 , 5 , 0 , 71, 0 , 0 } }, // #72 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 34, { 58, 5 , 0 , 0 , 0 , 0 } }, // #73 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 35, { 35, 5 , 0 , 0 , 0 , 0 } }, // #74 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 37, { 49, 3 , 0 , 0 , 0 , 0 } }, // #75 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 17, { 4 , 40, 0 , 0 , 0 , 0 } }, // #76 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 4 , 7 , 0 , 0 , 0 , 0 } }, // #77 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 27, { 2 , 13, 0 , 0 , 0 , 0 } }, // #78 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 10, { 11, 0 , 0 , 0 , 0 , 0 } }, // #79 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 35, 7 , 0 , 0 , 0 , 0 } }, // #80 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 11, 0 , 0 , 0 , 0 , 0 } }, // #81 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 16, 51, 29, 0 , 0 , 0 } }, // #82 [ref=5x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 45, 0 , 0 , 0 , 0 , 0 } }, // #83 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 35, 0 , 0 , 0 , 0 , 0 } }, // #84 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 16, 51, 70, 0 , 0 , 0 } }, // #85 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 2 , { 11, 3 , 0 , 0 , 0 , 0 } }, // #86 [ref=19x]
+ { InstDB::RWInfo::kCategoryGeneric , 4 , { 36, 7 , 0 , 0 , 0 , 0 } }, // #87 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 37, 9 , 0 , 0 , 0 , 0 } }, // #88 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 74, 0 , 0 , 0 , 0 , 0 } }, // #89 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 7 , 0 , 0 , 0 , 0 , 0 } }, // #90 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 34, { 75, 0 , 0 , 0 , 0 , 0 } }, // #91 [ref=30x]
+ { InstDB::RWInfo::kCategoryGeneric , 11, { 2 , 3 , 73, 0 , 0 , 0 } }, // #92 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 39, { 11, 0 , 0 , 0 , 0 , 0 } }, // #93 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 28, { 45, 0 , 0 , 0 , 0 , 0 } }, // #94 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 13, { 43, 0 , 0 , 0 , 0 , 0 } }, // #95 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 76, 44, 44, 0 , 0 , 0 } }, // #96 [ref=8x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 43, 0 , 0 , 0 , 0 , 0 } }, // #97 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 9 , 56, 17, 0 , 0 , 0 } }, // #98 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 15, { 76, 77, 78, 78, 78, 5 } }, // #99 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 15, { 4 , 79, 80, 80, 80, 5 } }, // #100 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 40, { 10, 5 , 7 , 0 , 0 , 0 } }, // #101 [ref=8x]
+ { InstDB::RWInfo::kCategoryGeneric , 41, { 10, 5 , 13, 0 , 0 , 0 } }, // #102 [ref=7x]
+ { InstDB::RWInfo::kCategoryGeneric , 42, { 10, 5 , 9 , 0 , 0 , 0 } }, // #103 [ref=9x]
+ { InstDB::RWInfo::kCategoryGeneric , 6 , { 11, 3 , 3 , 3 , 0 , 0 } }, // #104 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 6 , { 35, 3 , 3 , 0 , 0 , 0 } }, // #105 [ref=18x]
+ { InstDB::RWInfo::kCategoryGeneric , 40, { 11, 5 , 7 , 0 , 0 , 0 } }, // #106 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 41, { 35, 13, 13, 0 , 0 , 0 } }, // #107 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 42, { 11, 5 , 9 , 0 , 0 , 0 } }, // #108 [ref=1x]
+ { InstDB::RWInfo::kCategoryVmov1_2 , 48, { 0 , 0 , 0 , 0 , 0 , 0 } }, // #109 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 40, { 10, 5 , 5 , 0 , 0 , 0 } }, // #110 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 40, { 10, 83, 7 , 0 , 0 , 0 } }, // #111 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 41, { 10, 5 , 5 , 0 , 0 , 0 } }, // #112 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 49, { 10, 64, 3 , 0 , 0 , 0 } }, // #113 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 49, { 10, 3 , 3 , 0 , 0 , 0 } }, // #114 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 49, { 10, 83, 3 , 0 , 0 , 0 } }, // #115 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 42, { 10, 64, 9 , 0 , 0 , 0 } }, // #116 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 42, { 10, 5 , 5 , 0 , 0 , 0 } }, // #117 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 50, { 10, 5 , 5 , 0 , 0 , 0 } }, // #118 [ref=9x]
+ { InstDB::RWInfo::kCategoryGeneric , 52, { 10, 82, 0 , 0 , 0 , 0 } }, // #119 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 52, { 10, 3 , 0 , 0 , 0 , 0 } }, // #120 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 53, { 81, 44, 0 , 0 , 0 , 0 } }, // #121 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 6 , { 84, 3 , 3 , 0 , 0 , 0 } }, // #122 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 42, { 85, 5 , 5 , 0 , 0 , 0 } }, // #123 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 6 , { 2 , 3 , 3 , 0 , 0 , 0 } }, // #124 [ref=90x]
+ { InstDB::RWInfo::kCategoryGeneric , 40, { 4 , 64, 7 , 0 , 0 , 0 } }, // #125 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 42, { 4 , 83, 9 , 0 , 0 , 0 } }, // #126 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 40, { 6 , 7 , 7 , 0 , 0 , 0 } }, // #127 [ref=11x]
+ { InstDB::RWInfo::kCategoryGeneric , 41, { 4 , 5 , 5 , 0 , 0 , 0 } }, // #128 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 42, { 8 , 9 , 9 , 0 , 0 , 0 } }, // #129 [ref=11x]
+ { InstDB::RWInfo::kCategoryGeneric , 54, { 11, 3 , 3 , 3 , 0 , 0 } }, // #130 [ref=15x]
+ { InstDB::RWInfo::kCategoryGeneric , 55, { 35, 7 , 7 , 7 , 0 , 0 } }, // #131 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 56, { 45, 9 , 9 , 9 , 0 , 0 } }, // #132 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 41, { 4 , 5 , 13, 0 , 0 , 0 } }, // #133 [ref=6x]
+ { InstDB::RWInfo::kCategoryGeneric , 40, { 26, 7 , 7 , 0 , 0 , 0 } }, // #134 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 42, { 54, 9 , 9 , 0 , 0 , 0 } }, // #135 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 16, { 35, 3 , 0 , 0 , 0 , 0 } }, // #136 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 27, { 35, 13, 0 , 0 , 0 , 0 } }, // #137 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 5 , { 35, 9 , 0 , 0 , 0 , 0 } }, // #138 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 2 , 3 , 2 , 0 , 0 , 0 } }, // #139 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 2 , 3 , 2 , 0 , 0 , 0 } }, // #140 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 14, { 4 , 3 , 4 , 0 , 0 , 0 } }, // #141 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 40, { 10, 64, 7 , 0 , 0 , 0 } }, // #142 [ref=11x]
+ { InstDB::RWInfo::kCategoryGeneric , 41, { 10, 86, 13, 0 , 0 , 0 } }, // #143 [ref=7x]
+ { InstDB::RWInfo::kCategoryGeneric , 42, { 10, 83, 9 , 0 , 0 , 0 } }, // #144 [ref=13x]
+ { InstDB::RWInfo::kCategoryGeneric , 50, { 81, 82, 5 , 0 , 0 , 0 } }, // #145 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 50, { 11, 3 , 5 , 0 , 0 , 0 } }, // #146 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 57, { 43, 44, 82, 0 , 0 , 0 } }, // #147 [ref=4x]
+ { InstDB::RWInfo::kCategoryVmaskmov , 0 , { 0 , 0 , 0 , 0 , 0 , 0 } }, // #148 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 12, { 35, 0 , 0 , 0 , 0 , 0 } }, // #149 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 22, 0 , 0 , 0 , 0 , 0 } }, // #150 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 64, 64, 0 , 0 , 0 } }, // #151 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 12, { 10, 7 , 7 , 0 , 0 , 0 } }, // #152 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 7 , 7 , 0 , 0 , 0 } }, // #153 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 12, { 10, 64, 7 , 0 , 0 , 0 } }, // #154 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 64, 7 , 0 , 0 , 0 } }, // #155 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 86, 13, 0 , 0 , 0 } }, // #156 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 10, 83, 9 , 0 , 0 , 0 } }, // #157 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 87, 0 , 0 , 0 , 0 , 0 } }, // #158 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 60, { 88, 89, 3 , 3 , 0 , 0 } }, // #159 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 15, { 43, 77, 78, 78, 78, 5 } }, // #160 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 57, { 81, 82, 82, 0 , 0 , 0 } }, // #161 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 22, { 11, 3 , 3 , 0 , 0 , 0 } }, // #162 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 7 , { 49, 5 , 0 , 0 , 0 , 0 } }, // #163 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 61, { 10, 5 , 40, 0 , 0 , 0 } }, // #164 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 50, { 10, 5 , 5 , 5 , 0 , 0 } }, // #165 [ref=12x]
+ { InstDB::RWInfo::kCategoryGeneric , 65, { 10, 5 , 5 , 5 , 0 , 0 } }, // #166 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 66, { 10, 5 , 5 , 0 , 0 , 0 } }, // #167 [ref=12x]
+ { InstDB::RWInfo::kCategoryGeneric , 67, { 11, 3 , 5 , 0 , 0 , 0 } }, // #168 [ref=5x]
+ { InstDB::RWInfo::kCategoryGeneric , 68, { 11, 3 , 0 , 0 , 0 , 0 } }, // #169 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 69, { 11, 3 , 5 , 0 , 0 , 0 } }, // #170 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 22, { 11, 3 , 5 , 0 , 0 , 0 } }, // #171 [ref=1x]
+ { InstDB::RWInfo::kCategoryGenericEx , 6 , { 2 , 3 , 3 , 0 , 0 , 0 } }, // #172 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 90, 82, 5 , 0 , 0 , 0 } }, // #173 [ref=1x]
+ { InstDB::RWInfo::kCategoryGeneric , 50, { 4 , 5 , 5 , 0 , 0 , 0 } }, // #174 [ref=3x]
+ { InstDB::RWInfo::kCategoryGeneric , 0 , { 56, 17, 29, 0 , 0 , 0 } }, // #175 [ref=2x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 3 , 56, 17, 0 , 0 , 0 } }, // #176 [ref=4x]
+ { InstDB::RWInfo::kCategoryGeneric , 8 , { 11, 56, 17, 0 , 0 , 0 } } // #177 [ref=8x]
};
const InstDB::RWInfoOp InstDB::rwInfoOp[] = {
- { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kNone }, // #0 [ref=16519x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kNone }, // #0 [ref=17086x]
{ 0x0000000000000003u, 0x0000000000000003u, 0x00, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kRegPhysId }, // #1 [ref=10x]
- { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #2 [ref=236x]
- { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #3 [ref=1077x]
- { 0x000000000000FFFFu, 0x000000000000FFFFu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #4 [ref=108x]
- { 0x000000000000FFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #5 [ref=348x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #2 [ref=282x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #3 [ref=1132x]
+ { 0x000000000000FFFFu, 0x000000000000FFFFu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #4 [ref=107x]
+ { 0x000000000000FFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #5 [ref=356x]
{ 0x00000000000000FFu, 0x00000000000000FFu, 0xFF, 0, { 0 }, OpRWFlags::kRW }, // #6 [ref=18x]
{ 0x00000000000000FFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #7 [ref=186x]
{ 0x000000000000000Fu, 0x000000000000000Fu, 0xFF, 0, { 0 }, OpRWFlags::kRW }, // #8 [ref=18x]
{ 0x000000000000000Fu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #9 [ref=135x]
{ 0x0000000000000000u, 0x000000000000FFFFu, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #10 [ref=184x]
- { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #11 [ref=455x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #11 [ref=459x]
{ 0x0000000000000003u, 0x0000000000000003u, 0xFF, 0, { 0 }, OpRWFlags::kRW }, // #12 [ref=1x]
- { 0x0000000000000003u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #13 [ref=63x]
+ { 0x0000000000000003u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #13 [ref=65x]
{ 0x000000000000FFFFu, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #14 [ref=4x]
{ 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kMemBaseWrite | OpRWFlags::kMemIndexWrite }, // #15 [ref=1x]
{ 0x0000000000000000u, 0x000000000000000Fu, 0x02, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #16 [ref=9x]
{ 0x000000000000000Fu, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #17 [ref=23x]
{ 0x00000000000000FFu, 0x00000000000000FFu, 0x00, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #18 [ref=2x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kMemPhysId }, // #19 [ref=3x]
+ { 0xFFFFFFFFFFFFFFFFu, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kMemPhysId }, // #19 [ref=1x]
{ 0x0000000000000000u, 0x0000000000000000u, 0x06, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kMemBaseRW | OpRWFlags::kMemBasePostModify | OpRWFlags::kMemPhysId }, // #20 [ref=3x]
{ 0x0000000000000000u, 0x0000000000000000u, 0x07, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kMemBaseRW | OpRWFlags::kMemBasePostModify | OpRWFlags::kMemPhysId }, // #21 [ref=2x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #22 [ref=7x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #22 [ref=8x]
{ 0x00000000000000FFu, 0x00000000000000FFu, 0x02, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #23 [ref=1x]
{ 0x00000000000000FFu, 0x0000000000000000u, 0x01, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #24 [ref=1x]
{ 0x00000000000000FFu, 0x0000000000000000u, 0x03, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #25 [ref=1x]
{ 0x00000000000000FFu, 0x00000000000000FFu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #26 [ref=21x]
{ 0x000000000000000Fu, 0x000000000000000Fu, 0x02, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #27 [ref=1x]
- { 0x000000000000000Fu, 0x000000000000000Fu, 0x00, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #28 [ref=4x]
+ { 0x000000000000000Fu, 0x000000000000000Fu, 0x00, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #28 [ref=5x]
{ 0x000000000000000Fu, 0x0000000000000000u, 0x01, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #29 [ref=13x]
{ 0x000000000000000Fu, 0x0000000000000000u, 0x03, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #30 [ref=2x]
{ 0x0000000000000000u, 0x000000000000000Fu, 0x03, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #31 [ref=1x]
@@ -4276,75 +6016,79 @@ const InstDB::RWInfoOp InstDB::rwInfoOp[] = {
{ 0x0000000000000001u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #40 [ref=28x]
{ 0x0000000000000000u, 0x0000000000000000u, 0x02, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #41 [ref=2x]
{ 0x0000000000000000u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #42 [ref=3x]
- { 0xFFFFFFFFFFFFFFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #43 [ref=29x]
- { 0x0000000000000000u, 0x000000000000000Fu, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #44 [ref=30x]
- { 0x00000000000003FFu, 0x00000000000003FFu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #45 [ref=22x]
- { 0x00000000000003FFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #46 [ref=13x]
- { 0x0000000000000000u, 0x00000000000003FFu, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #47 [ref=1x]
- { 0x0000000000000000u, 0x0000000000000003u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #48 [ref=17x]
- { 0x0000000000000000u, 0x0000000000000003u, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #49 [ref=2x]
- { 0x0000000000000000u, 0x000000000000000Fu, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #50 [ref=8x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #51 [ref=2x]
- { 0x0000000000000003u, 0x0000000000000000u, 0x02, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #52 [ref=4x]
- { 0x000000000000000Fu, 0x000000000000000Fu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #53 [ref=4x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x07, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kMemPhysId }, // #54 [ref=1x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x01, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #55 [ref=1x]
- { 0x0000000000000000u, 0x0000000000000001u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #56 [ref=14x]
- { 0x0000000000000000u, 0x0000000000000001u, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kRegPhysId }, // #57 [ref=1x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x01, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #58 [ref=3x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x07, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kMemPhysId }, // #59 [ref=3x]
- { 0x000000000000000Fu, 0x0000000000000000u, 0x02, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #60 [ref=22x]
- { 0x000000000000FF00u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #61 [ref=23x]
- { 0x0000000000000000u, 0x000000000000FF00u, 0xFF, 0, { 0 }, OpRWFlags::kWrite }, // #62 [ref=1x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x07, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kMemBaseRW | OpRWFlags::kMemBasePostModify | OpRWFlags::kMemPhysId }, // #63 [ref=2x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x02, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #64 [ref=1x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x02, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #65 [ref=2x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x06, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kMemPhysId }, // #66 [ref=1x]
- { 0x0000000000000000u, 0x000000000000000Fu, 0x01, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #67 [ref=5x]
- { 0x0000000000000000u, 0x000000000000FFFFu, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #68 [ref=4x]
- { 0x0000000000000000u, 0x0000000000000007u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #69 [ref=2x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x04, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #70 [ref=1x]
- { 0x0000000000000001u, 0x0000000000000000u, 0x01, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #71 [ref=10x]
- { 0x0000000000000001u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #72 [ref=1x]
- { 0x0000000000000000u, 0x0000000000000001u, 0xFF, 0, { 0 }, OpRWFlags::kWrite }, // #73 [ref=30x]
- { 0x0000000000000000u, 0xFFFFFFFFFFFFFFFFu, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #74 [ref=20x]
- { 0xFFFFFFFFFFFFFFFFu, 0xFFFFFFFFFFFFFFFFu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #75 [ref=7x]
- { 0xFFFFFFFFFFFFFFFFu, 0x0000000000000000u, 0xFF, 4, { 0 }, OpRWFlags::kRead }, // #76 [ref=4x]
- { 0xFFFFFFFFFFFFFFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kConsecutive }, // #77 [ref=12x]
- { 0x000000000000FFFFu, 0x0000000000000000u, 0xFF, 4, { 0 }, OpRWFlags::kRead }, // #78 [ref=2x]
- { 0x000000000000FFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kConsecutive }, // #79 [ref=6x]
- { 0x0000000000000000u, 0x00000000FFFFFFFFu, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #80 [ref=10x]
- { 0x00000000FFFFFFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #81 [ref=16x]
- { 0x000000000000FFF0u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #82 [ref=18x]
- { 0x000000000000FFFCu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #83 [ref=8x]
- { 0x0000000000000000u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #84 [ref=1x]
- { 0x0000000000000000u, 0x00000000000000FFu, 0xFF, 2, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #85 [ref=2x]
- { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kConsecutive } // #86 [ref=2x]
+ { 0x0000000000000000u, 0xFFFFFFFFFFFFFFFFu, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #43 [ref=23x]
+ { 0xFFFFFFFFFFFFFFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #44 [ref=35x]
+ { 0x0000000000000000u, 0x000000000000000Fu, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #45 [ref=30x]
+ { 0x00000000000003FFu, 0x00000000000003FFu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #46 [ref=22x]
+ { 0x00000000000003FFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #47 [ref=13x]
+ { 0x0000000000000000u, 0x00000000000003FFu, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #48 [ref=1x]
+ { 0x0000000000000000u, 0x0000000000000003u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #49 [ref=17x]
+ { 0x0000000000000000u, 0x0000000000000003u, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #50 [ref=2x]
+ { 0x0000000000000000u, 0x000000000000000Fu, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #51 [ref=8x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #52 [ref=2x]
+ { 0x0000000000000003u, 0x0000000000000000u, 0x02, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #53 [ref=4x]
+ { 0x000000000000000Fu, 0x000000000000000Fu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #54 [ref=4x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x07, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kMemPhysId }, // #55 [ref=1x]
+ { 0x000000000000000Fu, 0x0000000000000000u, 0x02, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #56 [ref=23x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x01, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #57 [ref=2x]
+ { 0x0000000000000000u, 0x0000000000000001u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #58 [ref=14x]
+ { 0x0000000000000000u, 0x0000000000000001u, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kRegPhysId }, // #59 [ref=1x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x01, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #60 [ref=3x]
+ { 0x000000000000FFFFu, 0x000000000000FFFFu, 0x07, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kMemPhysId }, // #61 [ref=2x]
+ { 0x00000000000000FFu, 0x00000000000000FFu, 0x07, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kMemPhysId }, // #62 [ref=1x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kMemPhysId }, // #63 [ref=2x]
+ { 0x000000000000FF00u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #64 [ref=23x]
+ { 0x0000000000000000u, 0x000000000000FF00u, 0xFF, 0, { 0 }, OpRWFlags::kWrite }, // #65 [ref=1x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x07, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kMemBaseRW | OpRWFlags::kMemBasePostModify | OpRWFlags::kMemPhysId }, // #66 [ref=2x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x02, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kRegPhysId | OpRWFlags::kZExt }, // #67 [ref=1x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x02, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #68 [ref=1x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x06, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kMemPhysId }, // #69 [ref=1x]
+ { 0x0000000000000000u, 0x000000000000000Fu, 0x01, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #70 [ref=5x]
+ { 0x0000000000000000u, 0x000000000000FFFFu, 0x00, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #71 [ref=4x]
+ { 0x0000000000000000u, 0x0000000000000007u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #72 [ref=2x]
+ { 0x0000000000000001u, 0x0000000000000000u, 0x01, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #73 [ref=10x]
+ { 0x0000000000000001u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kRegPhysId }, // #74 [ref=1x]
+ { 0x0000000000000000u, 0x0000000000000001u, 0xFF, 0, { 0 }, OpRWFlags::kWrite }, // #75 [ref=30x]
+ { 0xFFFFFFFFFFFFFFFFu, 0xFFFFFFFFFFFFFFFFu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt }, // #76 [ref=10x]
+ { 0xFFFFFFFFFFFFFFFFu, 0x0000000000000000u, 0xFF, 4, { 0 }, OpRWFlags::kRead }, // #77 [ref=4x]
+ { 0xFFFFFFFFFFFFFFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kConsecutive }, // #78 [ref=12x]
+ { 0x000000000000FFFFu, 0x0000000000000000u, 0xFF, 4, { 0 }, OpRWFlags::kRead }, // #79 [ref=2x]
+ { 0x000000000000FFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead | OpRWFlags::kConsecutive }, // #80 [ref=6x]
+ { 0x0000000000000000u, 0x00000000FFFFFFFFu, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #81 [ref=10x]
+ { 0x00000000FFFFFFFFu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #82 [ref=18x]
+ { 0x000000000000FFF0u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #83 [ref=18x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kUnique | OpRWFlags::kZExt }, // #84 [ref=4x]
+ { 0x000000000000FFFFu, 0x000000000000FFFFu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kUnique | OpRWFlags::kZExt }, // #85 [ref=4x]
+ { 0x000000000000FFFCu, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kRead }, // #86 [ref=8x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0x00, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt | OpRWFlags::kRegPhysId }, // #87 [ref=1x]
+ { 0x0000000000000000u, 0x00000000000000FFu, 0xFF, 2, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt }, // #88 [ref=2x]
+ { 0x0000000000000000u, 0x0000000000000000u, 0xFF, 0, { 0 }, OpRWFlags::kWrite | OpRWFlags::kZExt | OpRWFlags::kConsecutive }, // #89 [ref=2x]
+ { 0x00000000FFFFFFFFu, 0x00000000FFFFFFFFu, 0xFF, 0, { 0 }, OpRWFlags::kRW | OpRWFlags::kZExt } // #90 [ref=3x]
};
const InstDB::RWInfoRm InstDB::rwInfoRm[] = {
- { InstDB::RWInfoRm::kCategoryNone , 0x00, 0 , 0, 0 }, // #0 [ref=1997x]
+ { InstDB::RWInfoRm::kCategoryNone , 0x00, 0 , 0, 0 }, // #0 [ref=2083x]
{ InstDB::RWInfoRm::kCategoryConsistent, 0x03, 0 , InstDB::RWInfoRm::kFlagAmbiguous, 0 }, // #1 [ref=8x]
{ InstDB::RWInfoRm::kCategoryConsistent, 0x02, 0 , 0, 0 }, // #2 [ref=204x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x02, 16, 0, 0 }, // #3 [ref=122x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x02, 8 , 0, 0 }, // #4 [ref=66x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x02, 4 , 0, 0 }, // #5 [ref=35x]
- { InstDB::RWInfoRm::kCategoryConsistent, 0x04, 0 , 0, 0 }, // #6 [ref=300x]
+ { InstDB::RWInfoRm::kCategoryConsistent, 0x04, 0 , 0, 0 }, // #6 [ref=314x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x01, 2 , 0, 0 }, // #7 [ref=9x]
- { InstDB::RWInfoRm::kCategoryFixed , 0x00, 0 , 0, 0 }, // #8 [ref=63x]
+ { InstDB::RWInfoRm::kCategoryFixed , 0x00, 0 , 0, 0 }, // #8 [ref=68x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x03, 0 , 0, 0 }, // #9 [ref=1x]
{ InstDB::RWInfoRm::kCategoryConsistent, 0x01, 0 , InstDB::RWInfoRm::kFlagAmbiguous, 0 }, // #10 [ref=21x]
{ InstDB::RWInfoRm::kCategoryConsistent, 0x01, 0 , 0, 0 }, // #11 [ref=14x]
- { InstDB::RWInfoRm::kCategoryFixed , 0x00, 8 , 0, 0 }, // #12 [ref=22x]
- { InstDB::RWInfoRm::kCategoryFixed , 0x00, 16, 0, 0 }, // #13 [ref=21x]
- { InstDB::RWInfoRm::kCategoryConsistent, 0x02, 0 , InstDB::RWInfoRm::kFlagAmbiguous, 0 }, // #14 [ref=22x]
- { InstDB::RWInfoRm::kCategoryFixed , 0x02, 1 , 0, 0 }, // #15 [ref=5x]
- { InstDB::RWInfoRm::kCategoryFixed , 0x00, 64, 0, 0 }, // #16 [ref=5x]
- { InstDB::RWInfoRm::kCategoryFixed , 0x01, 4 , 0, 0 }, // #17 [ref=6x]
- { InstDB::RWInfoRm::kCategoryNone , 0x00, 0 , InstDB::RWInfoRm::kFlagAmbiguous, 0 }, // #18 [ref=26x]
+ { InstDB::RWInfoRm::kCategoryFixed , 0x00, 8 , 0, 0 }, // #12 [ref=23x]
+ { InstDB::RWInfoRm::kCategoryFixed , 0x00, 64, 0, 0 }, // #13 [ref=6x]
+ { InstDB::RWInfoRm::kCategoryNone , 0x00, 0 , InstDB::RWInfoRm::kFlagAmbiguous, 0 }, // #14 [ref=30x]
+ { InstDB::RWInfoRm::kCategoryFixed , 0x00, 16, 0, 0 }, // #15 [ref=23x]
+ { InstDB::RWInfoRm::kCategoryConsistent, 0x02, 0 , InstDB::RWInfoRm::kFlagAmbiguous, 0 }, // #16 [ref=22x]
+ { InstDB::RWInfoRm::kCategoryFixed , 0x02, 1 , 0, 0 }, // #17 [ref=5x]
+ { InstDB::RWInfoRm::kCategoryFixed , 0x01, 4 , 0, 0 }, // #18 [ref=6x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x00, 10, 0, 0 }, // #19 [ref=2x]
{ InstDB::RWInfoRm::kCategoryNone , 0x01, 0 , InstDB::RWInfoRm::kFlagAmbiguous, 0 }, // #20 [ref=5x]
- { InstDB::RWInfoRm::kCategoryFixed , 0x00, 2 , 0, 0 }, // #21 [ref=4x]
+ { InstDB::RWInfoRm::kCategoryFixed , 0x00, 2 , 0, 0 }, // #21 [ref=6x]
{ InstDB::RWInfoRm::kCategoryConsistent, 0x06, 0 , 0, 0 }, // #22 [ref=6x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x03, 1 , 0, 0 }, // #23 [ref=1x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x03, 4 , 0, 0 }, // #24 [ref=3x]
@@ -4373,7 +6117,7 @@ const InstDB::RWInfoRm InstDB::rwInfoRm[] = {
{ InstDB::RWInfoRm::kCategoryQuarter , 0x02, 0 , 0, 0 }, // #47 [ref=9x]
{ InstDB::RWInfoRm::kCategoryHalf , 0x01, 0 , 0, 0 }, // #48 [ref=10x]
{ InstDB::RWInfoRm::kCategoryConsistent, 0x04, 0 , InstDB::RWInfoRm::kFlagAmbiguous, 0 }, // #49 [ref=6x]
- { InstDB::RWInfoRm::kCategoryFixed , 0x04, 16, 0, 0 }, // #50 [ref=27x]
+ { InstDB::RWInfoRm::kCategoryFixed , 0x04, 16, 0, 0 }, // #50 [ref=30x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x02, 64, 0, 0 }, // #51 [ref=6x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x01, 16, 0, 0 }, // #52 [ref=6x]
{ InstDB::RWInfoRm::kCategoryFixed , 0x01, 32, 0, 0 }, // #53 [ref=4x]
@@ -4405,20 +6149,33 @@ UNIT(x86_inst_db) {
INFO("Checking validity of Inst enums");
// Cross-validate prefixes.
- EXPECT(uint32_t(InstOptions::kX86_Rex ) == 0x40000000u, "REX prefix must be at 0x40000000");
- EXPECT(uint32_t(InstOptions::kX86_Evex) == 0x00001000u, "EVEX prefix must be at 0x00001000");
+ EXPECT_EQ(uint32_t(InstOptions::kX86_Rex ), 0x40000000u)
+ .message("REX prefix must be at 0x40000000");
+
+ EXPECT_EQ(uint32_t(InstOptions::kX86_Evex), 0x00001000u)
+ .message("EVEX prefix must be at 0x00001000");
// These could be combined together to form a valid REX prefix, they must match.
- EXPECT(uint32_t(InstOptions::kX86_OpCodeB) == uint32_t(Opcode::kB), "Opcode::kB must match InstOptions::kX86_OpCodeB");
- EXPECT(uint32_t(InstOptions::kX86_OpCodeX) == uint32_t(Opcode::kX), "Opcode::kX must match InstOptions::kX86_OpCodeX");
- EXPECT(uint32_t(InstOptions::kX86_OpCodeR) == uint32_t(Opcode::kR), "Opcode::kR must match InstOptions::kX86_OpCodeR");
- EXPECT(uint32_t(InstOptions::kX86_OpCodeW) == uint32_t(Opcode::kW), "Opcode::kW must match InstOptions::kX86_OpCodeW");
+ EXPECT_EQ(uint32_t(InstOptions::kX86_OpCodeB), uint32_t(Opcode::kB))
+ .message("Opcode::kB must match InstOptions::kX86_OpCodeB");
+
+ EXPECT_EQ(uint32_t(InstOptions::kX86_OpCodeX), uint32_t(Opcode::kX))
+ .message("Opcode::kX must match InstOptions::kX86_OpCodeX");
+
+ EXPECT_EQ(uint32_t(InstOptions::kX86_OpCodeR), uint32_t(Opcode::kR))
+ .message("Opcode::kR must match InstOptions::kX86_OpCodeR");
+
+ EXPECT_EQ(uint32_t(InstOptions::kX86_OpCodeW), uint32_t(Opcode::kW))
+ .message("Opcode::kW must match InstOptions::kX86_OpCodeW");
uint32_t rex_rb = (Opcode::kR >> Opcode::kREX_Shift) | (Opcode::kB >> Opcode::kREX_Shift) | 0x40;
uint32_t rex_rw = (Opcode::kR >> Opcode::kREX_Shift) | (Opcode::kW >> Opcode::kREX_Shift) | 0x40;
- EXPECT(rex_rb == 0x45, "Opcode::kR|B must form a valid REX prefix (0x45) if combined with 0x40");
- EXPECT(rex_rw == 0x4C, "Opcode::kR|W must form a valid REX prefix (0x4C) if combined with 0x40");
+ EXPECT_EQ(rex_rb, 0x45u)
+ .message("Opcode::kR|B must form a valid REX prefix (0x45) if combined with 0x40");
+
+ EXPECT_EQ(rex_rw, 0x4Cu)
+ .message("Opcode::kR|W must form a valid REX prefix (0x4C) if combined with 0x40");
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86instdb.h b/3rdparty/asmjit/src/asmjit/x86/x86instdb.h
index 87a286c2829..2bf7d148957 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86instdb.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86instdb.h
@@ -30,7 +30,7 @@ enum class Mode : uint8_t {
ASMJIT_DEFINE_ENUM_FLAGS(Mode)
//! Converts architecture to operation mode, see \ref Mode.
-static constexpr Mode modeFromArch(Arch arch) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mode modeFromArch(Arch arch) noexcept {
return arch == Arch::kX86 ? Mode::kX86 :
arch == Arch::kX64 ? Mode::kX64 : Mode::kNone;
}
@@ -348,92 +348,92 @@ struct CommonInfo {
//! \{
//! Returns instruction flags.
- inline InstFlags flags() const noexcept { return (InstFlags)_flags; }
+ ASMJIT_INLINE_NODEBUG InstFlags flags() const noexcept { return (InstFlags)_flags; }
//! Tests whether the instruction has a `flag`.
- inline bool hasFlag(InstFlags flag) const noexcept { return Support::test(_flags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasFlag(InstFlags flag) const noexcept { return Support::test(_flags, flag); }
//! Returns instruction AVX-512 flags.
- inline Avx512Flags avx512Flags() const noexcept { return (Avx512Flags)_avx512Flags; }
+ ASMJIT_INLINE_NODEBUG Avx512Flags avx512Flags() const noexcept { return (Avx512Flags)_avx512Flags; }
//! Tests whether the instruction has an AVX-512 `flag`.
- inline bool hasAvx512Flag(Avx512Flags flag) const noexcept { return Support::test(_avx512Flags, flag); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512Flag(Avx512Flags flag) const noexcept { return Support::test(_avx512Flags, flag); }
//! Tests whether the instruction is FPU instruction.
- inline bool isFpu() const noexcept { return hasFlag(InstFlags::kFpu); }
+ ASMJIT_INLINE_NODEBUG bool isFpu() const noexcept { return hasFlag(InstFlags::kFpu); }
//! Tests whether the instruction is MMX/3DNOW instruction that accesses MMX registers (includes EMMS and FEMMS).
- inline bool isMmx() const noexcept { return hasFlag(InstFlags::kMmx); }
+ ASMJIT_INLINE_NODEBUG bool isMmx() const noexcept { return hasFlag(InstFlags::kMmx); }
//! Tests whether the instruction is SSE|AVX|AVX512 instruction that accesses XMM|YMM|ZMM registers.
- inline bool isVec() const noexcept { return hasFlag(InstFlags::kVec); }
+ ASMJIT_INLINE_NODEBUG bool isVec() const noexcept { return hasFlag(InstFlags::kVec); }
//! Tests whether the instruction is SSE+ (SSE4.2, AES, SHA included) instruction that accesses XMM registers.
- inline bool isSse() const noexcept { return (flags() & (InstFlags::kVec | InstFlags::kVex | InstFlags::kEvex)) == InstFlags::kVec; }
+ ASMJIT_INLINE_NODEBUG bool isSse() const noexcept { return (flags() & (InstFlags::kVec | InstFlags::kVex | InstFlags::kEvex)) == InstFlags::kVec; }
//! Tests whether the instruction is AVX+ (FMA included) instruction that accesses XMM|YMM|ZMM registers.
- inline bool isAvx() const noexcept { return isVec() && isVexOrEvex(); }
+ ASMJIT_INLINE_NODEBUG bool isAvx() const noexcept { return isVec() && isVexOrEvex(); }
//! Tests whether the instruction can be prefixed with LOCK prefix.
- inline bool hasLockPrefix() const noexcept { return hasFlag(InstFlags::kLock); }
+ ASMJIT_INLINE_NODEBUG bool hasLockPrefix() const noexcept { return hasFlag(InstFlags::kLock); }
//! Tests whether the instruction can be prefixed with REP (REPE|REPZ) prefix.
- inline bool hasRepPrefix() const noexcept { return hasFlag(InstFlags::kRep); }
+ ASMJIT_INLINE_NODEBUG bool hasRepPrefix() const noexcept { return hasFlag(InstFlags::kRep); }
//! Tests whether the instruction can be prefixed with XACQUIRE prefix.
- inline bool hasXAcquirePrefix() const noexcept { return hasFlag(InstFlags::kXAcquire); }
+ ASMJIT_INLINE_NODEBUG bool hasXAcquirePrefix() const noexcept { return hasFlag(InstFlags::kXAcquire); }
//! Tests whether the instruction can be prefixed with XRELEASE prefix.
- inline bool hasXReleasePrefix() const noexcept { return hasFlag(InstFlags::kXRelease); }
+ ASMJIT_INLINE_NODEBUG bool hasXReleasePrefix() const noexcept { return hasFlag(InstFlags::kXRelease); }
//! Tests whether the rep prefix is supported by the instruction, but ignored (has no effect).
- inline bool isRepIgnored() const noexcept { return hasFlag(InstFlags::kRepIgnored); }
+ ASMJIT_INLINE_NODEBUG bool isRepIgnored() const noexcept { return hasFlag(InstFlags::kRepIgnored); }
//! Tests whether the instruction uses MIB.
- inline bool isMibOp() const noexcept { return hasFlag(InstFlags::kMib); }
+ ASMJIT_INLINE_NODEBUG bool isMibOp() const noexcept { return hasFlag(InstFlags::kMib); }
//! Tests whether the instruction uses VSIB.
- inline bool isVsibOp() const noexcept { return hasFlag(InstFlags::kVsib); }
+ ASMJIT_INLINE_NODEBUG bool isVsibOp() const noexcept { return hasFlag(InstFlags::kVsib); }
//! Tests whether the instruction uses TSIB (AMX, instruction requires MOD+SIB).
- inline bool isTsibOp() const noexcept { return hasFlag(InstFlags::kTsib); }
+ ASMJIT_INLINE_NODEBUG bool isTsibOp() const noexcept { return hasFlag(InstFlags::kTsib); }
//! Tests whether the instruction uses VEX (can be set together with EVEX if both are encodable).
- inline bool isVex() const noexcept { return hasFlag(InstFlags::kVex); }
+ ASMJIT_INLINE_NODEBUG bool isVex() const noexcept { return hasFlag(InstFlags::kVex); }
//! Tests whether the instruction uses EVEX (can be set together with VEX if both are encodable).
- inline bool isEvex() const noexcept { return hasFlag(InstFlags::kEvex); }
+ ASMJIT_INLINE_NODEBUG bool isEvex() const noexcept { return hasFlag(InstFlags::kEvex); }
//! Tests whether the instruction uses EVEX (can be set together with VEX if both are encodable).
- inline bool isVexOrEvex() const noexcept { return hasFlag(InstFlags::kVex | InstFlags::kEvex); }
+ ASMJIT_INLINE_NODEBUG bool isVexOrEvex() const noexcept { return hasFlag(InstFlags::kVex | InstFlags::kEvex); }
//! Tests whether the instruction should prefer EVEX prefix instead of VEX prefix.
- inline bool preferEvex() const noexcept { return hasFlag(InstFlags::kPreferEvex); }
+ ASMJIT_INLINE_NODEBUG bool preferEvex() const noexcept { return hasFlag(InstFlags::kPreferEvex); }
- inline bool isEvexCompatible() const noexcept { return hasFlag(InstFlags::kEvexCompat); }
- inline bool isEvexKRegOnly() const noexcept { return hasFlag(InstFlags::kEvexKReg); }
- inline bool isEvexTwoOpOnly() const noexcept { return hasFlag(InstFlags::kEvexTwoOp); }
- inline bool isEvexTransformable() const noexcept { return hasFlag(InstFlags::kEvexTransformable); }
+ ASMJIT_INLINE_NODEBUG bool isEvexCompatible() const noexcept { return hasFlag(InstFlags::kEvexCompat); }
+ ASMJIT_INLINE_NODEBUG bool isEvexKRegOnly() const noexcept { return hasFlag(InstFlags::kEvexKReg); }
+ ASMJIT_INLINE_NODEBUG bool isEvexTwoOpOnly() const noexcept { return hasFlag(InstFlags::kEvexTwoOp); }
+ ASMJIT_INLINE_NODEBUG bool isEvexTransformable() const noexcept { return hasFlag(InstFlags::kEvexTransformable); }
//! Tests whether the instruction supports AVX512 masking {k}.
- inline bool hasAvx512K() const noexcept { return hasAvx512Flag(Avx512Flags::kK); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512K() const noexcept { return hasAvx512Flag(Avx512Flags::kK); }
//! Tests whether the instruction supports AVX512 zeroing {k}{z}.
- inline bool hasAvx512Z() const noexcept { return hasAvx512Flag(Avx512Flags::kZ); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512Z() const noexcept { return hasAvx512Flag(Avx512Flags::kZ); }
//! Tests whether the instruction supports AVX512 embedded-rounding {er}.
- inline bool hasAvx512ER() const noexcept { return hasAvx512Flag(Avx512Flags::kER); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512ER() const noexcept { return hasAvx512Flag(Avx512Flags::kER); }
//! Tests whether the instruction supports AVX512 suppress-all-exceptions {sae}.
- inline bool hasAvx512SAE() const noexcept { return hasAvx512Flag(Avx512Flags::kSAE); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512SAE() const noexcept { return hasAvx512Flag(Avx512Flags::kSAE); }
//! Tests whether the instruction supports AVX512 broadcast (either 32-bit or 64-bit).
- inline bool hasAvx512B() const noexcept { return hasAvx512Flag(Avx512Flags::kB16 | Avx512Flags::kB32 | Avx512Flags::kB64); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512B() const noexcept { return hasAvx512Flag(Avx512Flags::kB16 | Avx512Flags::kB32 | Avx512Flags::kB64); }
//! Tests whether the instruction supports AVX512 broadcast (16-bit).
- inline bool hasAvx512B16() const noexcept { return hasAvx512Flag(Avx512Flags::kB16); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512B16() const noexcept { return hasAvx512Flag(Avx512Flags::kB16); }
//! Tests whether the instruction supports AVX512 broadcast (32-bit).
- inline bool hasAvx512B32() const noexcept { return hasAvx512Flag(Avx512Flags::kB32); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512B32() const noexcept { return hasAvx512Flag(Avx512Flags::kB32); }
//! Tests whether the instruction supports AVX512 broadcast (64-bit).
- inline bool hasAvx512B64() const noexcept { return hasAvx512Flag(Avx512Flags::kB64); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512B64() const noexcept { return hasAvx512Flag(Avx512Flags::kB64); }
// Returns the size of the broadcast - either 2, 4, or 8, or 0 if broadcast is not supported.
- inline uint32_t broadcastSize() const noexcept {
+ ASMJIT_INLINE_NODEBUG uint32_t broadcastSize() const noexcept {
constexpr uint32_t kShift = Support::ConstCTZ<uint32_t(Avx512Flags::kB16)>::value;
return (uint32_t(_avx512Flags) & uint32_t(Avx512Flags::kB16 | Avx512Flags::kB32 | Avx512Flags::kB64)) >> (kShift - 1);
}
- inline uint32_t signatureIndex() const noexcept { return _iSignatureIndex; }
- inline uint32_t signatureCount() const noexcept { return _iSignatureCount; }
+ ASMJIT_INLINE_NODEBUG uint32_t signatureIndex() const noexcept { return _iSignatureIndex; }
+ ASMJIT_INLINE_NODEBUG uint32_t signatureCount() const noexcept { return _iSignatureCount; }
- inline const InstSignature* signatureData() const noexcept { return _instSignatureTable + _iSignatureIndex; }
- inline const InstSignature* signatureEnd() const noexcept { return _instSignatureTable + _iSignatureIndex + _iSignatureCount; }
+ ASMJIT_INLINE_NODEBUG const InstSignature* signatureData() const noexcept { return _instSignatureTable + _iSignatureIndex; }
+ ASMJIT_INLINE_NODEBUG const InstSignature* signatureEnd() const noexcept { return _instSignatureTable + _iSignatureIndex + _iSignatureCount; }
//! Returns a control flow category of the instruction.
- inline InstControlFlow controlFlow() const noexcept { return (InstControlFlow)_controlFlow; }
+ ASMJIT_INLINE_NODEBUG InstControlFlow controlFlow() const noexcept { return (InstControlFlow)_controlFlow; }
//! Returns a hint that can be used when both inputs are the same register.
- inline InstSameRegHint sameRegHint() const noexcept { return (InstSameRegHint)_sameRegHint; }
+ ASMJIT_INLINE_NODEBUG InstSameRegHint sameRegHint() const noexcept { return (InstSameRegHint)_sameRegHint; }
//! \}
};
@@ -442,8 +442,8 @@ ASMJIT_VARAPI const CommonInfo _commonInfoTable[];
//! Instruction information.
struct InstInfo {
- //! Index to \ref _nameData.
- uint32_t _nameDataIndex : 14;
+ //! Reserved for future use.
+ uint32_t _reserved : 14;
//! Index to \ref _commonInfoTable.
uint32_t _commonInfoIndex : 10;
//! Index to \ref _additionalInfoTable.
@@ -462,83 +462,83 @@ struct InstInfo {
//! \{
//! Returns common information, see \ref CommonInfo.
- inline const CommonInfo& commonInfo() const noexcept { return _commonInfoTable[_commonInfoIndex]; }
+ ASMJIT_INLINE_NODEBUG const CommonInfo& commonInfo() const noexcept { return _commonInfoTable[_commonInfoIndex]; }
- //! Returns instruction flags, see \ref Flags.
- inline InstFlags flags() const noexcept { return commonInfo().flags(); }
- //! Tests whether the instruction has flag `flag`, see \ref Flags.
- inline bool hasFlag(InstFlags flag) const noexcept { return commonInfo().hasFlag(flag); }
+ //! Returns instruction flags, see \ref InstFlags.
+ ASMJIT_INLINE_NODEBUG InstFlags flags() const noexcept { return commonInfo().flags(); }
+ //! Tests whether the instruction has flag `flag`, see \ref InstFlags.
+ ASMJIT_INLINE_NODEBUG bool hasFlag(InstFlags flag) const noexcept { return commonInfo().hasFlag(flag); }
//! Returns instruction AVX-512 flags, see \ref Avx512Flags.
- inline Avx512Flags avx512Flags() const noexcept { return commonInfo().avx512Flags(); }
+ ASMJIT_INLINE_NODEBUG Avx512Flags avx512Flags() const noexcept { return commonInfo().avx512Flags(); }
//! Tests whether the instruction has an AVX-512 `flag`, see \ref Avx512Flags.
- inline bool hasAvx512Flag(Avx512Flags flag) const noexcept { return commonInfo().hasAvx512Flag(flag); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512Flag(Avx512Flags flag) const noexcept { return commonInfo().hasAvx512Flag(flag); }
//! Tests whether the instruction is FPU instruction.
- inline bool isFpu() const noexcept { return commonInfo().isFpu(); }
+ ASMJIT_INLINE_NODEBUG bool isFpu() const noexcept { return commonInfo().isFpu(); }
//! Tests whether the instruction is MMX/3DNOW instruction that accesses MMX registers (includes EMMS and FEMMS).
- inline bool isMmx() const noexcept { return commonInfo().isMmx(); }
+ ASMJIT_INLINE_NODEBUG bool isMmx() const noexcept { return commonInfo().isMmx(); }
//! Tests whether the instruction is SSE|AVX|AVX512 instruction that accesses XMM|YMM|ZMM registers.
- inline bool isVec() const noexcept { return commonInfo().isVec(); }
+ ASMJIT_INLINE_NODEBUG bool isVec() const noexcept { return commonInfo().isVec(); }
//! Tests whether the instruction is SSE+ (SSE4.2, AES, SHA included) instruction that accesses XMM registers.
- inline bool isSse() const noexcept { return commonInfo().isSse(); }
+ ASMJIT_INLINE_NODEBUG bool isSse() const noexcept { return commonInfo().isSse(); }
//! Tests whether the instruction is AVX+ (FMA included) instruction that accesses XMM|YMM|ZMM registers.
- inline bool isAvx() const noexcept { return commonInfo().isAvx(); }
+ ASMJIT_INLINE_NODEBUG bool isAvx() const noexcept { return commonInfo().isAvx(); }
//! Tests whether the instruction can be prefixed with LOCK prefix.
- inline bool hasLockPrefix() const noexcept { return commonInfo().hasLockPrefix(); }
+ ASMJIT_INLINE_NODEBUG bool hasLockPrefix() const noexcept { return commonInfo().hasLockPrefix(); }
//! Tests whether the instruction can be prefixed with REP (REPE|REPZ) prefix.
- inline bool hasRepPrefix() const noexcept { return commonInfo().hasRepPrefix(); }
+ ASMJIT_INLINE_NODEBUG bool hasRepPrefix() const noexcept { return commonInfo().hasRepPrefix(); }
//! Tests whether the instruction can be prefixed with XACQUIRE prefix.
- inline bool hasXAcquirePrefix() const noexcept { return commonInfo().hasXAcquirePrefix(); }
+ ASMJIT_INLINE_NODEBUG bool hasXAcquirePrefix() const noexcept { return commonInfo().hasXAcquirePrefix(); }
//! Tests whether the instruction can be prefixed with XRELEASE prefix.
- inline bool hasXReleasePrefix() const noexcept { return commonInfo().hasXReleasePrefix(); }
+ ASMJIT_INLINE_NODEBUG bool hasXReleasePrefix() const noexcept { return commonInfo().hasXReleasePrefix(); }
//! Tests whether the rep prefix is supported by the instruction, but ignored (has no effect).
- inline bool isRepIgnored() const noexcept { return commonInfo().isRepIgnored(); }
+ ASMJIT_INLINE_NODEBUG bool isRepIgnored() const noexcept { return commonInfo().isRepIgnored(); }
//! Tests whether the instruction uses MIB.
- inline bool isMibOp() const noexcept { return hasFlag(InstFlags::kMib); }
+ ASMJIT_INLINE_NODEBUG bool isMibOp() const noexcept { return hasFlag(InstFlags::kMib); }
//! Tests whether the instruction uses VSIB.
- inline bool isVsibOp() const noexcept { return hasFlag(InstFlags::kVsib); }
+ ASMJIT_INLINE_NODEBUG bool isVsibOp() const noexcept { return hasFlag(InstFlags::kVsib); }
//! Tests whether the instruction uses VEX (can be set together with EVEX if both are encodable).
- inline bool isVex() const noexcept { return hasFlag(InstFlags::kVex); }
+ ASMJIT_INLINE_NODEBUG bool isVex() const noexcept { return hasFlag(InstFlags::kVex); }
//! Tests whether the instruction uses EVEX (can be set together with VEX if both are encodable).
- inline bool isEvex() const noexcept { return hasFlag(InstFlags::kEvex); }
+ ASMJIT_INLINE_NODEBUG bool isEvex() const noexcept { return hasFlag(InstFlags::kEvex); }
//! Tests whether the instruction uses EVEX (can be set together with VEX if both are encodable).
- inline bool isVexOrEvex() const noexcept { return hasFlag(InstFlags::kVex | InstFlags::kEvex); }
+ ASMJIT_INLINE_NODEBUG bool isVexOrEvex() const noexcept { return hasFlag(InstFlags::kVex | InstFlags::kEvex); }
- inline bool isEvexCompatible() const noexcept { return hasFlag(InstFlags::kEvexCompat); }
- inline bool isEvexKRegOnly() const noexcept { return hasFlag(InstFlags::kEvexKReg); }
- inline bool isEvexTwoOpOnly() const noexcept { return hasFlag(InstFlags::kEvexTwoOp); }
- inline bool isEvexTransformable() const noexcept { return hasFlag(InstFlags::kEvexTransformable); }
+ ASMJIT_INLINE_NODEBUG bool isEvexCompatible() const noexcept { return hasFlag(InstFlags::kEvexCompat); }
+ ASMJIT_INLINE_NODEBUG bool isEvexKRegOnly() const noexcept { return hasFlag(InstFlags::kEvexKReg); }
+ ASMJIT_INLINE_NODEBUG bool isEvexTwoOpOnly() const noexcept { return hasFlag(InstFlags::kEvexTwoOp); }
+ ASMJIT_INLINE_NODEBUG bool isEvexTransformable() const noexcept { return hasFlag(InstFlags::kEvexTransformable); }
//! Tests whether the instruction supports AVX512 masking {k}.
- inline bool hasAvx512K() const noexcept { return hasAvx512Flag(Avx512Flags::kK); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512K() const noexcept { return hasAvx512Flag(Avx512Flags::kK); }
//! Tests whether the instruction supports AVX512 zeroing {k}{z}.
- inline bool hasAvx512Z() const noexcept { return hasAvx512Flag(Avx512Flags::kZ); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512Z() const noexcept { return hasAvx512Flag(Avx512Flags::kZ); }
//! Tests whether the instruction supports AVX512 embedded-rounding {er}.
- inline bool hasAvx512ER() const noexcept { return hasAvx512Flag(Avx512Flags::kER); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512ER() const noexcept { return hasAvx512Flag(Avx512Flags::kER); }
//! Tests whether the instruction supports AVX512 suppress-all-exceptions {sae}.
- inline bool hasAvx512SAE() const noexcept { return hasAvx512Flag(Avx512Flags::kSAE); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512SAE() const noexcept { return hasAvx512Flag(Avx512Flags::kSAE); }
//! Tests whether the instruction supports AVX512 broadcast (either 32-bit or 64-bit).
- inline bool hasAvx512B() const noexcept { return hasAvx512Flag(Avx512Flags::kB16 | Avx512Flags::kB32 | Avx512Flags::kB64); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512B() const noexcept { return hasAvx512Flag(Avx512Flags::kB16 | Avx512Flags::kB32 | Avx512Flags::kB64); }
//! Tests whether the instruction supports AVX512 broadcast (16-bit).
- inline bool hasAvx512B16() const noexcept { return hasAvx512Flag(Avx512Flags::kB16); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512B16() const noexcept { return hasAvx512Flag(Avx512Flags::kB16); }
//! Tests whether the instruction supports AVX512 broadcast (32-bit).
- inline bool hasAvx512B32() const noexcept { return hasAvx512Flag(Avx512Flags::kB32); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512B32() const noexcept { return hasAvx512Flag(Avx512Flags::kB32); }
//! Tests whether the instruction supports AVX512 broadcast (64-bit).
- inline bool hasAvx512B64() const noexcept { return hasAvx512Flag(Avx512Flags::kB64); }
+ ASMJIT_INLINE_NODEBUG bool hasAvx512B64() const noexcept { return hasAvx512Flag(Avx512Flags::kB64); }
//! Returns a control flow category of the instruction.
- inline InstControlFlow controlFlow() const noexcept { return commonInfo().controlFlow(); }
+ ASMJIT_INLINE_NODEBUG InstControlFlow controlFlow() const noexcept { return commonInfo().controlFlow(); }
//! Returns a hint that can be used when both inputs are the same register.
- inline InstSameRegHint sameRegHint() const noexcept { return commonInfo().sameRegHint(); }
+ ASMJIT_INLINE_NODEBUG InstSameRegHint sameRegHint() const noexcept { return commonInfo().sameRegHint(); }
- inline uint32_t signatureIndex() const noexcept { return commonInfo().signatureIndex(); }
- inline uint32_t signatureCount() const noexcept { return commonInfo().signatureCount(); }
+ ASMJIT_INLINE_NODEBUG uint32_t signatureIndex() const noexcept { return commonInfo().signatureIndex(); }
+ ASMJIT_INLINE_NODEBUG uint32_t signatureCount() const noexcept { return commonInfo().signatureCount(); }
- inline const InstSignature* signatureData() const noexcept { return commonInfo().signatureData(); }
- inline const InstSignature* signatureEnd() const noexcept { return commonInfo().signatureEnd(); }
+ ASMJIT_INLINE_NODEBUG const InstSignature* signatureData() const noexcept { return commonInfo().signatureData(); }
+ ASMJIT_INLINE_NODEBUG const InstSignature* signatureEnd() const noexcept { return commonInfo().signatureEnd(); }
//! \}
};
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86instdb_p.h b/3rdparty/asmjit/src/asmjit/x86/x86instdb_p.h
index b8e12e16b45..cb006060832 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86instdb_p.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86instdb_p.h
@@ -6,6 +6,7 @@
#ifndef ASMJIT_X86_X86INSTDB_P_H_INCLUDED
#define ASMJIT_X86_X86INSTDB_P_H_INCLUDED
+#include "../core/instdb_p.h"
#include "../x86/x86instdb.h"
ASMJIT_BEGIN_SUB_NAMESPACE(x86)
@@ -38,11 +39,11 @@ enum EncodingId : uint32_t {
kEncodingX86M_GPB, //!< X86 [M] (handles single-byte size).
kEncodingX86M_GPB_MulDiv, //!< X86 [M] (like GPB, handles implicit|explicit MUL|DIV|IDIV).
kEncodingX86M_Only, //!< X86 [M] (restricted to memory operand of any size).
- kEncodingX86M_Only_EDX_EAX, //!< X86 [M] (memory operand only, followed by implicit <edx> and <eax>).
+ kEncodingX86M_Only_EDX_EAX, //!< X86 [M] (memory operand only, followed by implicit `EDX` and `EAX`).
kEncodingX86M_Nop, //!< X86 [M] (special case of NOP instruction).
kEncodingX86R_Native, //!< X86 [R] (register must be either 32-bit or 64-bit depending on arch).
kEncodingX86R_FromM, //!< X86 [R] - which specifies memory address.
- kEncodingX86R32_EDX_EAX, //!< X86 [R32] followed by implicit EDX and EAX.
+ kEncodingX86R32_EDX_EAX, //!< X86 [R32] followed by implicit `EDX` and `EAX`.
kEncodingX86Rm, //!< X86 [RM] (doesn't handle single-byte size).
kEncodingX86Rm_Raw66H, //!< X86 [RM] (used by LZCNT, POPCNT, and TZCNT).
kEncodingX86Rm_NoSize, //!< X86 [RM] (doesn't add REX.W prefix if 64-bit reg is used).
@@ -126,6 +127,7 @@ enum EncodingId : uint32_t {
kEncodingVexMri, //!< VEX|EVEX [MRI].
kEncodingVexMri_Lx, //!< VEX|EVEX [MRI] (propagates VEX|EVEX.L if YMM used).
kEncodingVexMri_Vpextrw, //!< VEX|EVEX [MRI] (special case required by VPEXTRW instruction).
+ kEncodingVexMvr_Wx, //!< VEX|EVEX [MVR] (propagates VEX|EVEX.W if GPQ used).
kEncodingVexRm, //!< VEX|EVEX [RM].
kEncodingVexRm_ZDI, //!< VEX|EVEX [RM<ZDI>].
kEncodingVexRm_Wx, //!< VEX|EVEX [RM] (propagates VEX|EVEX.W if GPQ used).
@@ -200,20 +202,10 @@ struct AdditionalInfo {
inline const uint8_t* featuresEnd() const noexcept { return _features + ASMJIT_ARRAY_SIZE(_features); }
};
-// ${NameLimits:Begin}
-// ------------------- Automatically generated, do not edit -------------------
-enum : uint32_t { kMaxNameSize = 17 };
-// ----------------------------------------------------------------------------
-// ${NameLimits:End}
-
-struct InstNameIndex {
- uint16_t start;
- uint16_t end;
-};
-
struct RWInfo {
enum Category : uint8_t {
- kCategoryGeneric,
+ kCategoryGeneric = 0,
+ kCategoryGenericEx,
kCategoryMov,
kCategoryMovabs,
kCategoryImul,
@@ -295,8 +287,9 @@ extern const uint32_t _mainOpcodeTable[];
extern const uint32_t _altOpcodeTable[];
#ifndef ASMJIT_NO_TEXT
-extern const char _nameData[];
-extern const InstNameIndex instNameIndex[26];
+extern const InstNameIndex instNameIndex;
+extern const char _instNameStringTable[];
+extern const uint32_t _instNameIndexTable[];
#endif // !ASMJIT_NO_TEXT
extern const AdditionalInfo _additionalInfoTable[];
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86opcode_p.h b/3rdparty/asmjit/src/asmjit/x86/x86opcode_p.h
index 94a76f04818..ab0b13e1a50 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86opcode_p.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86opcode_p.h
@@ -45,7 +45,7 @@ struct Opcode {
//! `pp` in instruction manuals.
//!
//! - `LL` field is used exclusively by AVX+ and AVX512+ instruction sets. It describes vector size, which is `L.128`
- //! for XMM register, `L.256` for for YMM register, and `L.512` for ZMM register. The `LL` field is omitted in case
+ //! for XMM register, `L.256` for YMM register, and `L.512` for ZMM register. The `LL` field is omitted in case
//! that instruction supports multiple vector lengths, however, if the instruction requires specific `L` value it
//! must be specified as a part of the opcode.
//!
@@ -244,7 +244,7 @@ struct Opcode {
// REX|VEX|EVEX B|X|R|W Bits
// -------------------------
//
- // NOTE: REX.[B|X|R] are never stored within the opcode itself, they are reserved by AsmJit are are added
+ // NOTE: REX.[B|X|R] are never stored within the opcode itself, they are reserved by AsmJit and are added
// dynamically to the opcode to represent [REX|VEX|EVEX].[B|X|R] bits. REX.W can be stored in DB as it's sometimes
// part of the opcode itself.
@@ -280,7 +280,7 @@ struct Opcode {
// `L` or `LL` field in AVX/XOP/AVX-512
// ------------------------------------
//
- // VEX/XOP prefix can only use the first bit `L.128` or `L.256`. EVEX prefix prefix makes it possible to use also
+ // VEX/XOP prefix can only use the first bit `L.128` or `L.256`. EVEX prefix makes it possible to use also
// `L.512`. If the instruction set manual describes an instruction by `LIG` it means that the `L` field is ignored
// and AsmJit defaults to `0` in such case.
kLL_Shift = 29,
@@ -336,27 +336,27 @@ struct Opcode {
// Opcode Builder
// --------------
- inline uint32_t get() const noexcept { return v; }
+ ASMJIT_INLINE_NODEBUG uint32_t get() const noexcept { return v; }
- inline bool hasW() const noexcept { return (v & kW) != 0; }
- inline bool has66h() const noexcept { return (v & kPP_66) != 0; }
+ ASMJIT_INLINE_NODEBUG bool hasW() const noexcept { return (v & kW) != 0; }
+ ASMJIT_INLINE_NODEBUG bool has66h() const noexcept { return (v & kPP_66) != 0; }
- inline Opcode& add(uint32_t x) noexcept { return operator+=(x); }
+ ASMJIT_INLINE_NODEBUG Opcode& add(uint32_t x) noexcept { return operator+=(x); }
- inline Opcode& add66h() noexcept { return operator|=(kPP_66); }
+ ASMJIT_INLINE_NODEBUG Opcode& add66h() noexcept { return operator|=(kPP_66); }
template<typename T>
- inline Opcode& add66hIf(T exp) noexcept { return operator|=(uint32_t(exp) << kPP_Shift); }
+ ASMJIT_INLINE_NODEBUG Opcode& add66hIf(T exp) noexcept { return operator|=(uint32_t(exp) << kPP_Shift); }
template<typename T>
- inline Opcode& add66hBySize(T size) noexcept { return add66hIf(size == 2); }
+ ASMJIT_INLINE_NODEBUG Opcode& add66hBySize(T size) noexcept { return add66hIf(size == 2); }
- inline Opcode& addW() noexcept { return operator|=(kW); }
+ ASMJIT_INLINE_NODEBUG Opcode& addW() noexcept { return operator|=(kW); }
template<typename T>
- inline Opcode& addWIf(T exp) noexcept { return operator|=(uint32_t(exp) << kW_Shift); }
+ ASMJIT_INLINE_NODEBUG Opcode& addWIf(T exp) noexcept { return operator|=(uint32_t(exp) << kW_Shift); }
template<typename T>
- inline Opcode& addWBySize(T size) noexcept { return addWIf(size == 8); }
+ ASMJIT_INLINE_NODEBUG Opcode& addWBySize(T size) noexcept { return addWIf(size == 8); }
template<typename T>
- inline Opcode& addPrefixBySize(T size) noexcept {
+ ASMJIT_INLINE_NODEBUG Opcode& addPrefixBySize(T size) noexcept {
static const uint32_t mask[16] = {
0, // #0
0, // #1 -> nothing (already handled or not possible)
@@ -372,7 +372,7 @@ struct Opcode {
}
template<typename T>
- inline Opcode& addArithBySize(T size) noexcept {
+ ASMJIT_INLINE_NODEBUG Opcode& addArithBySize(T size) noexcept {
static const uint32_t mask[16] = {
0, // #0
0, // #1 -> nothing
@@ -387,45 +387,45 @@ struct Opcode {
return operator|=(mask[size & 0xF]);
}
- inline Opcode& forceEvex() noexcept { return operator|=(kMM_ForceEvex); }
+ ASMJIT_INLINE_NODEBUG Opcode& forceEvex() noexcept { return operator|=(kMM_ForceEvex); }
template<typename T>
- inline Opcode& forceEvexIf(T exp) noexcept { return operator|=(uint32_t(exp) << Support::ConstCTZ<uint32_t(kMM_ForceEvex)>::value); }
+ ASMJIT_INLINE_NODEBUG Opcode& forceEvexIf(T exp) noexcept { return operator|=(uint32_t(exp) << Support::ConstCTZ<uint32_t(kMM_ForceEvex)>::value); }
//! Extract `O` field (R) from the opcode (specified as /0..7 in instruction manuals).
- inline uint32_t extractModO() const noexcept {
+ ASMJIT_INLINE_NODEBUG uint32_t extractModO() const noexcept {
return (v >> kModO_Shift) & 0x07;
}
//! Extract `RM` field (RM) from the opcode (usually specified as another opcode value).
- inline uint32_t extractModRM() const noexcept {
+ ASMJIT_INLINE_NODEBUG uint32_t extractModRM() const noexcept {
return (v >> kModRM_Shift) & 0x07;
}
//! Extract `REX` prefix from opcode combined with `options`.
- inline uint32_t extractRex(InstOptions options) const noexcept {
+ ASMJIT_INLINE_NODEBUG uint32_t extractRex(InstOptions options) const noexcept {
// kREX was designed in a way that when shifted there will be no bytes set except REX.[B|X|R|W].
// The returned value forms a real REX prefix byte. This case should be unit-tested as well.
return (v | uint32_t(options)) >> kREX_Shift;
}
- inline uint32_t extractLLMMMMM(InstOptions options) const noexcept {
+ ASMJIT_INLINE_NODEBUG uint32_t extractLLMMMMM(InstOptions options) const noexcept {
uint32_t llMmmmm = uint32_t(v & (kLL_Mask | kMM_Mask));
uint32_t vexEvex = uint32_t(options & InstOptions::kX86_Evex);
return (llMmmmm | vexEvex) >> kMM_Shift;
}
- inline Opcode& operator=(uint32_t x) noexcept { v = x; return *this; }
- inline Opcode& operator+=(uint32_t x) noexcept { v += x; return *this; }
- inline Opcode& operator-=(uint32_t x) noexcept { v -= x; return *this; }
- inline Opcode& operator&=(uint32_t x) noexcept { v &= x; return *this; }
- inline Opcode& operator|=(uint32_t x) noexcept { v |= x; return *this; }
- inline Opcode& operator^=(uint32_t x) noexcept { v ^= x; return *this; }
-
- inline uint32_t operator&(uint32_t x) const noexcept { return v & x; }
- inline uint32_t operator|(uint32_t x) const noexcept { return v | x; }
- inline uint32_t operator^(uint32_t x) const noexcept { return v ^ x; }
- inline uint32_t operator<<(uint32_t x) const noexcept { return v << x; }
- inline uint32_t operator>>(uint32_t x) const noexcept { return v >> x; }
+ ASMJIT_INLINE_NODEBUG Opcode& operator=(uint32_t x) noexcept { v = x; return *this; }
+ ASMJIT_INLINE_NODEBUG Opcode& operator+=(uint32_t x) noexcept { v += x; return *this; }
+ ASMJIT_INLINE_NODEBUG Opcode& operator-=(uint32_t x) noexcept { v -= x; return *this; }
+ ASMJIT_INLINE_NODEBUG Opcode& operator&=(uint32_t x) noexcept { v &= x; return *this; }
+ ASMJIT_INLINE_NODEBUG Opcode& operator|=(uint32_t x) noexcept { v |= x; return *this; }
+ ASMJIT_INLINE_NODEBUG Opcode& operator^=(uint32_t x) noexcept { v ^= x; return *this; }
+
+ ASMJIT_INLINE_NODEBUG uint32_t operator&(uint32_t x) const noexcept { return v & x; }
+ ASMJIT_INLINE_NODEBUG uint32_t operator|(uint32_t x) const noexcept { return v | x; }
+ ASMJIT_INLINE_NODEBUG uint32_t operator^(uint32_t x) const noexcept { return v ^ x; }
+ ASMJIT_INLINE_NODEBUG uint32_t operator<<(uint32_t x) const noexcept { return v << x; }
+ ASMJIT_INLINE_NODEBUG uint32_t operator>>(uint32_t x) const noexcept { return v >> x; }
};
//! \}
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86operand.cpp b/3rdparty/asmjit/src/asmjit/x86/x86operand.cpp
index a47fec2b5b2..5ab50de570e 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86operand.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86operand.cpp
@@ -19,210 +19,210 @@ UNIT(x86_operand) {
Label L(1000); // Label with some ID.
INFO("Checking basic properties of built-in X86 registers");
- EXPECT(gpb(Gp::kIdAx) == al);
- EXPECT(gpb(Gp::kIdBx) == bl);
- EXPECT(gpb(Gp::kIdCx) == cl);
- EXPECT(gpb(Gp::kIdDx) == dl);
-
- EXPECT(gpb_lo(Gp::kIdAx) == al);
- EXPECT(gpb_lo(Gp::kIdBx) == bl);
- EXPECT(gpb_lo(Gp::kIdCx) == cl);
- EXPECT(gpb_lo(Gp::kIdDx) == dl);
-
- EXPECT(gpb_hi(Gp::kIdAx) == ah);
- EXPECT(gpb_hi(Gp::kIdBx) == bh);
- EXPECT(gpb_hi(Gp::kIdCx) == ch);
- EXPECT(gpb_hi(Gp::kIdDx) == dh);
-
- EXPECT(gpw(Gp::kIdAx) == ax);
- EXPECT(gpw(Gp::kIdBx) == bx);
- EXPECT(gpw(Gp::kIdCx) == cx);
- EXPECT(gpw(Gp::kIdDx) == dx);
-
- EXPECT(gpd(Gp::kIdAx) == eax);
- EXPECT(gpd(Gp::kIdBx) == ebx);
- EXPECT(gpd(Gp::kIdCx) == ecx);
- EXPECT(gpd(Gp::kIdDx) == edx);
-
- EXPECT(gpq(Gp::kIdAx) == rax);
- EXPECT(gpq(Gp::kIdBx) == rbx);
- EXPECT(gpq(Gp::kIdCx) == rcx);
- EXPECT(gpq(Gp::kIdDx) == rdx);
-
- EXPECT(gpb(Gp::kIdAx) != dl);
- EXPECT(gpw(Gp::kIdBx) != cx);
- EXPECT(gpd(Gp::kIdCx) != ebx);
- EXPECT(gpq(Gp::kIdDx) != rax);
+ EXPECT_EQ(gpb(Gp::kIdAx), al);
+ EXPECT_EQ(gpb(Gp::kIdBx), bl);
+ EXPECT_EQ(gpb(Gp::kIdCx), cl);
+ EXPECT_EQ(gpb(Gp::kIdDx), dl);
+
+ EXPECT_EQ(gpb_lo(Gp::kIdAx), al);
+ EXPECT_EQ(gpb_lo(Gp::kIdBx), bl);
+ EXPECT_EQ(gpb_lo(Gp::kIdCx), cl);
+ EXPECT_EQ(gpb_lo(Gp::kIdDx), dl);
+
+ EXPECT_EQ(gpb_hi(Gp::kIdAx), ah);
+ EXPECT_EQ(gpb_hi(Gp::kIdBx), bh);
+ EXPECT_EQ(gpb_hi(Gp::kIdCx), ch);
+ EXPECT_EQ(gpb_hi(Gp::kIdDx), dh);
+
+ EXPECT_EQ(gpw(Gp::kIdAx), ax);
+ EXPECT_EQ(gpw(Gp::kIdBx), bx);
+ EXPECT_EQ(gpw(Gp::kIdCx), cx);
+ EXPECT_EQ(gpw(Gp::kIdDx), dx);
+
+ EXPECT_EQ(gpd(Gp::kIdAx), eax);
+ EXPECT_EQ(gpd(Gp::kIdBx), ebx);
+ EXPECT_EQ(gpd(Gp::kIdCx), ecx);
+ EXPECT_EQ(gpd(Gp::kIdDx), edx);
+
+ EXPECT_EQ(gpq(Gp::kIdAx), rax);
+ EXPECT_EQ(gpq(Gp::kIdBx), rbx);
+ EXPECT_EQ(gpq(Gp::kIdCx), rcx);
+ EXPECT_EQ(gpq(Gp::kIdDx), rdx);
+
+ EXPECT_NE(gpb(Gp::kIdAx), dl);
+ EXPECT_NE(gpw(Gp::kIdBx), cx);
+ EXPECT_NE(gpd(Gp::kIdCx), ebx);
+ EXPECT_NE(gpq(Gp::kIdDx), rax);
INFO("Checking if x86::reg(...) matches built-in IDs");
- EXPECT(gpb(5) == bpl);
- EXPECT(gpw(5) == bp);
- EXPECT(gpd(5) == ebp);
- EXPECT(gpq(5) == rbp);
- EXPECT(st(5) == st5);
- EXPECT(mm(5) == mm5);
- EXPECT(k(5) == k5);
- EXPECT(cr(5) == cr5);
- EXPECT(dr(5) == dr5);
- EXPECT(xmm(5) == xmm5);
- EXPECT(ymm(5) == ymm5);
- EXPECT(zmm(5) == zmm5);
+ EXPECT_EQ(gpb(5), bpl);
+ EXPECT_EQ(gpw(5), bp);
+ EXPECT_EQ(gpd(5), ebp);
+ EXPECT_EQ(gpq(5), rbp);
+ EXPECT_EQ(st(5) , st5);
+ EXPECT_EQ(mm(5) , mm5);
+ EXPECT_EQ(k(5) , k5);
+ EXPECT_EQ(cr(5) , cr5);
+ EXPECT_EQ(dr(5) , dr5);
+ EXPECT_EQ(xmm(5), xmm5);
+ EXPECT_EQ(ymm(5), ymm5);
+ EXPECT_EQ(zmm(5), zmm5);
INFO("Checking x86::Gp register properties");
- EXPECT(Gp().isReg() == true);
- EXPECT(eax.isReg() == true);
- EXPECT(eax.id() == 0);
- EXPECT(eax.size() == 4);
- EXPECT(eax.type() == RegType::kX86_Gpd);
- EXPECT(eax.group() == RegGroup::kGp);
+ EXPECT_TRUE(Gp().isReg());
+ EXPECT_TRUE(eax.isReg());
+ EXPECT_EQ(eax.id(), 0u);
+ EXPECT_EQ(eax.size(), 4u);
+ EXPECT_EQ(eax.type(), RegType::kX86_Gpd);
+ EXPECT_EQ(eax.group(), RegGroup::kGp);
INFO("Checking x86::Xmm register properties");
- EXPECT(Xmm().isReg() == true);
- EXPECT(xmm4.isReg() == true);
- EXPECT(xmm4.id() == 4);
- EXPECT(xmm4.size() == 16);
- EXPECT(xmm4.type() == RegType::kX86_Xmm);
- EXPECT(xmm4.group() == RegGroup::kVec);
- EXPECT(xmm4.isVec());
+ EXPECT_TRUE(Xmm().isReg());
+ EXPECT_TRUE(xmm4.isReg());
+ EXPECT_EQ(xmm4.id(), 4u);
+ EXPECT_EQ(xmm4.size(), 16u);
+ EXPECT_EQ(xmm4.type(), RegType::kX86_Xmm);
+ EXPECT_EQ(xmm4.group(), RegGroup::kVec);
+ EXPECT_TRUE(xmm4.isVec());
INFO("Checking x86::Ymm register properties");
- EXPECT(Ymm().isReg() == true);
- EXPECT(ymm5.isReg() == true);
- EXPECT(ymm5.id() == 5);
- EXPECT(ymm5.size() == 32);
- EXPECT(ymm5.type() == RegType::kX86_Ymm);
- EXPECT(ymm5.group() == RegGroup::kVec);
- EXPECT(ymm5.isVec());
+ EXPECT_TRUE(Ymm().isReg());
+ EXPECT_TRUE(ymm5.isReg());
+ EXPECT_EQ(ymm5.id(), 5u);
+ EXPECT_EQ(ymm5.size(), 32u);
+ EXPECT_EQ(ymm5.type(), RegType::kX86_Ymm);
+ EXPECT_EQ(ymm5.group(), RegGroup::kVec);
+ EXPECT_TRUE(ymm5.isVec());
INFO("Checking x86::Zmm register properties");
- EXPECT(Zmm().isReg() == true);
- EXPECT(zmm6.isReg() == true);
- EXPECT(zmm6.id() == 6);
- EXPECT(zmm6.size() == 64);
- EXPECT(zmm6.type() == RegType::kX86_Zmm);
- EXPECT(zmm6.group() == RegGroup::kVec);
- EXPECT(zmm6.isVec());
+ EXPECT_TRUE(Zmm().isReg());
+ EXPECT_TRUE(zmm6.isReg());
+ EXPECT_EQ(zmm6.id(), 6u);
+ EXPECT_EQ(zmm6.size(), 64u);
+ EXPECT_EQ(zmm6.type(), RegType::kX86_Zmm);
+ EXPECT_EQ(zmm6.group(), RegGroup::kVec);
+ EXPECT_TRUE(zmm6.isVec());
INFO("Checking x86::Vec register properties");
- EXPECT(Vec().isReg() == true);
+ EXPECT_TRUE(Vec().isReg());
// Converts a VEC register to a type of the passed register, but keeps the ID.
- EXPECT(xmm4.cloneAs(ymm10) == ymm4);
- EXPECT(xmm4.cloneAs(zmm11) == zmm4);
- EXPECT(ymm5.cloneAs(xmm12) == xmm5);
- EXPECT(ymm5.cloneAs(zmm13) == zmm5);
- EXPECT(zmm6.cloneAs(xmm14) == xmm6);
- EXPECT(zmm6.cloneAs(ymm15) == ymm6);
+ EXPECT_EQ(xmm4.cloneAs(ymm10), ymm4);
+ EXPECT_EQ(xmm4.cloneAs(zmm11), zmm4);
+ EXPECT_EQ(ymm5.cloneAs(xmm12), xmm5);
+ EXPECT_EQ(ymm5.cloneAs(zmm13), zmm5);
+ EXPECT_EQ(zmm6.cloneAs(xmm14), xmm6);
+ EXPECT_EQ(zmm6.cloneAs(ymm15), ymm6);
- EXPECT(xmm7.xmm() == xmm7);
- EXPECT(xmm7.ymm() == ymm7);
- EXPECT(xmm7.zmm() == zmm7);
+ EXPECT_EQ(xmm7.xmm(), xmm7);
+ EXPECT_EQ(xmm7.ymm(), ymm7);
+ EXPECT_EQ(xmm7.zmm(), zmm7);
- EXPECT(ymm7.xmm() == xmm7);
- EXPECT(ymm7.ymm() == ymm7);
- EXPECT(ymm7.zmm() == zmm7);
+ EXPECT_EQ(ymm7.xmm(), xmm7);
+ EXPECT_EQ(ymm7.ymm(), ymm7);
+ EXPECT_EQ(ymm7.zmm(), zmm7);
- EXPECT(zmm7.xmm() == xmm7);
- EXPECT(zmm7.ymm() == ymm7);
- EXPECT(zmm7.zmm() == zmm7);
+ EXPECT_EQ(zmm7.xmm(), xmm7);
+ EXPECT_EQ(zmm7.ymm(), ymm7);
+ EXPECT_EQ(zmm7.zmm(), zmm7);
INFO("Checking x86::Mm register properties");
- EXPECT(Mm().isReg() == true);
- EXPECT(mm2.isReg() == true);
- EXPECT(mm2.id() == 2);
- EXPECT(mm2.size() == 8);
- EXPECT(mm2.type() == RegType::kX86_Mm);
- EXPECT(mm2.group() == RegGroup::kX86_MM);
+ EXPECT_TRUE(Mm().isReg());
+ EXPECT_TRUE(mm2.isReg());
+ EXPECT_EQ(mm2.id(), 2u);
+ EXPECT_EQ(mm2.size(), 8u);
+ EXPECT_EQ(mm2.type(), RegType::kX86_Mm);
+ EXPECT_EQ(mm2.group(), RegGroup::kX86_MM);
INFO("Checking x86::KReg register properties");
- EXPECT(KReg().isReg() == true);
- EXPECT(k3.isReg() == true);
- EXPECT(k3.id() == 3);
- EXPECT(k3.size() == 0);
- EXPECT(k3.type() == RegType::kX86_KReg);
- EXPECT(k3.group() == RegGroup::kX86_K);
+ EXPECT_TRUE(KReg().isReg());
+ EXPECT_TRUE(k3.isReg());
+ EXPECT_EQ(k3.id(), 3u);
+ EXPECT_EQ(k3.size(), 0u);
+ EXPECT_EQ(k3.type(), RegType::kX86_KReg);
+ EXPECT_EQ(k3.group(), RegGroup::kX86_K);
INFO("Checking x86::St register properties");
- EXPECT(St().isReg() == true);
- EXPECT(st1.isReg() == true);
- EXPECT(st1.id() == 1);
- EXPECT(st1.size() == 10);
- EXPECT(st1.type() == RegType::kX86_St);
- EXPECT(st1.group() == RegGroup::kX86_St);
+ EXPECT_TRUE(St().isReg());
+ EXPECT_TRUE(st1.isReg());
+ EXPECT_EQ(st1.id(), 1u);
+ EXPECT_EQ(st1.size(), 10u);
+ EXPECT_EQ(st1.type(), RegType::kX86_St);
+ EXPECT_EQ(st1.group(), RegGroup::kX86_St);
INFO("Checking if default constructed regs behave as expected");
- EXPECT(Reg().isValid() == false);
- EXPECT(Gp().isValid() == false);
- EXPECT(Xmm().isValid() == false);
- EXPECT(Ymm().isValid() == false);
- EXPECT(Zmm().isValid() == false);
- EXPECT(Mm().isValid() == false);
- EXPECT(KReg().isValid() == false);
- EXPECT(SReg().isValid() == false);
- EXPECT(CReg().isValid() == false);
- EXPECT(DReg().isValid() == false);
- EXPECT(St().isValid() == false);
- EXPECT(Bnd().isValid() == false);
+ EXPECT_FALSE(Reg().isValid());
+ EXPECT_FALSE(Gp().isValid());
+ EXPECT_FALSE(Xmm().isValid());
+ EXPECT_FALSE(Ymm().isValid());
+ EXPECT_FALSE(Zmm().isValid());
+ EXPECT_FALSE(Mm().isValid());
+ EXPECT_FALSE(KReg().isValid());
+ EXPECT_FALSE(SReg().isValid());
+ EXPECT_FALSE(CReg().isValid());
+ EXPECT_FALSE(DReg().isValid());
+ EXPECT_FALSE(St().isValid());
+ EXPECT_FALSE(Bnd().isValid());
INFO("Checking x86::Mem operand");
Mem m;
- EXPECT(m == Mem(), "Two default constructed x86::Mem operands must be equal");
+ EXPECT_EQ(m, Mem());
m = ptr(L);
- EXPECT(m.hasBase() == true);
- EXPECT(m.hasBaseReg() == false);
- EXPECT(m.hasBaseLabel() == true);
- EXPECT(m.hasOffset() == false);
- EXPECT(m.isOffset64Bit() == false);
- EXPECT(m.offset() == 0);
- EXPECT(m.offsetLo32() == 0);
+ EXPECT_TRUE(m.hasBase());
+ EXPECT_FALSE(m.hasBaseReg());
+ EXPECT_TRUE(m.hasBaseLabel());
+ EXPECT_FALSE(m.hasOffset());
+ EXPECT_FALSE(m.isOffset64Bit());
+ EXPECT_EQ(m.offset(), 0);
+ EXPECT_EQ(m.offsetLo32(), 0);
m = ptr(0x0123456789ABCDEFu);
- EXPECT(m.hasBase() == false);
- EXPECT(m.hasBaseReg() == false);
- EXPECT(m.hasIndex() == false);
- EXPECT(m.hasIndexReg() == false);
- EXPECT(m.hasOffset() == true);
- EXPECT(m.isOffset64Bit() == true);
- EXPECT(m.offset() == int64_t(0x0123456789ABCDEFu));
- EXPECT(m.offsetLo32() == int32_t(0x89ABCDEFu));
+ EXPECT_FALSE(m.hasBase());
+ EXPECT_FALSE(m.hasBaseReg());
+ EXPECT_FALSE(m.hasIndex());
+ EXPECT_FALSE(m.hasIndexReg());
+ EXPECT_TRUE(m.hasOffset());
+ EXPECT_TRUE(m.isOffset64Bit());
+ EXPECT_EQ(m.offset(), int64_t(0x0123456789ABCDEFu));
+ EXPECT_EQ(m.offsetLo32(), int32_t(0x89ABCDEFu));
m.addOffset(1);
- EXPECT(m.offset() == int64_t(0x0123456789ABCDF0u));
+ EXPECT_EQ(m.offset(), int64_t(0x0123456789ABCDF0u));
m = ptr(0x0123456789ABCDEFu, rdi, 3);
- EXPECT(m.hasSegment() == false);
- EXPECT(m.hasBase() == false);
- EXPECT(m.hasBaseReg() == false);
- EXPECT(m.hasIndex() == true);
- EXPECT(m.hasIndexReg() == true);
- EXPECT(m.indexType() == rdi.type());
- EXPECT(m.indexId() == rdi.id());
- EXPECT(m.shift() == 3);
- EXPECT(m.hasOffset() == true);
- EXPECT(m.isOffset64Bit() == true);
- EXPECT(m.offset() == int64_t(0x0123456789ABCDEFu));
- EXPECT(m.offsetLo32() == int32_t(0x89ABCDEFu));
+ EXPECT_FALSE(m.hasSegment());
+ EXPECT_FALSE(m.hasBase());
+ EXPECT_FALSE(m.hasBaseReg());
+ EXPECT_TRUE(m.hasIndex());
+ EXPECT_TRUE(m.hasIndexReg());
+ EXPECT_EQ(m.indexType(), rdi.type());
+ EXPECT_EQ(m.indexId(), rdi.id());
+ EXPECT_EQ(m.shift(), 3u);
+ EXPECT_TRUE(m.hasOffset());
+ EXPECT_TRUE(m.isOffset64Bit());
+ EXPECT_EQ(m.offset(), int64_t(0x0123456789ABCDEFu));
+ EXPECT_EQ(m.offsetLo32(), int32_t(0x89ABCDEFu));
m.resetIndex();
- EXPECT(m.hasIndex() == false);
- EXPECT(m.hasIndexReg() == false);
+ EXPECT_FALSE(m.hasIndex());
+ EXPECT_FALSE(m.hasIndexReg());
m = ptr(rax);
- EXPECT(m.hasBase() == true);
- EXPECT(m.hasBaseReg() == true);
- EXPECT(m.baseType() == rax.type());
- EXPECT(m.baseId() == rax.id());
- EXPECT(m.hasIndex() == false);
- EXPECT(m.hasIndexReg() == false);
- EXPECT(m.indexType() == RegType::kNone);
- EXPECT(m.indexId() == 0);
- EXPECT(m.hasOffset() == false);
- EXPECT(m.isOffset64Bit() == false);
- EXPECT(m.offset() == 0);
- EXPECT(m.offsetLo32() == 0);
+ EXPECT_TRUE(m.hasBase());
+ EXPECT_TRUE(m.hasBaseReg());
+ EXPECT_EQ(m.baseType(), rax.type());
+ EXPECT_EQ(m.baseId(), rax.id());
+ EXPECT_FALSE(m.hasIndex());
+ EXPECT_FALSE(m.hasIndexReg());
+ EXPECT_EQ(m.indexType(), RegType::kNone);
+ EXPECT_EQ(m.indexId(), 0u);
+ EXPECT_FALSE(m.hasOffset());
+ EXPECT_FALSE(m.isOffset64Bit());
+ EXPECT_EQ(m.offset(), 0);
+ EXPECT_EQ(m.offsetLo32(), 0);
m.setIndex(rsi);
- EXPECT(m.hasIndex() == true);
- EXPECT(m.hasIndexReg() == true);
- EXPECT(m.indexType() == rsi.type());
- EXPECT(m.indexId() == rsi.id());
+ EXPECT_TRUE(m.hasIndex());
+ EXPECT_TRUE(m.hasIndexReg());
+ EXPECT_EQ(m.indexType(), rsi.type());
+ EXPECT_EQ(m.indexId(), rsi.id());
}
#endif
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86operand.h b/3rdparty/asmjit/src/asmjit/x86/x86operand.h
index 037d4af4ddf..8510a9310b5 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86operand.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86operand.h
@@ -49,26 +49,26 @@ template<RegType kRegType>
struct RegTraits : public BaseRegTraits {};
//! \cond
-// <--------------------+-----+-------------------------+------------------------+---+---+------------------+
-// | Reg | Reg-Type | Reg-Group |Sz |Cnt| TypeId |
-// <--------------------+-----+-------------------------+------------------------+---+---+------------------+
-ASMJIT_DEFINE_REG_TRAITS(Rip , RegType::kX86_Rip , RegGroup::kX86_Rip , 0 , 1 , TypeId::kVoid );
-ASMJIT_DEFINE_REG_TRAITS(GpbLo, RegType::kX86_GpbLo , RegGroup::kGp , 1 , 16, TypeId::kInt8 );
-ASMJIT_DEFINE_REG_TRAITS(GpbHi, RegType::kX86_GpbHi , RegGroup::kGp , 1 , 4 , TypeId::kInt8 );
-ASMJIT_DEFINE_REG_TRAITS(Gpw , RegType::kX86_Gpw , RegGroup::kGp , 2 , 16, TypeId::kInt16 );
-ASMJIT_DEFINE_REG_TRAITS(Gpd , RegType::kX86_Gpd , RegGroup::kGp , 4 , 16, TypeId::kInt32 );
-ASMJIT_DEFINE_REG_TRAITS(Gpq , RegType::kX86_Gpq , RegGroup::kGp , 8 , 16, TypeId::kInt64 );
-ASMJIT_DEFINE_REG_TRAITS(Xmm , RegType::kX86_Xmm , RegGroup::kVec , 16, 32, TypeId::kInt32x4 );
-ASMJIT_DEFINE_REG_TRAITS(Ymm , RegType::kX86_Ymm , RegGroup::kVec , 32, 32, TypeId::kInt32x8 );
-ASMJIT_DEFINE_REG_TRAITS(Zmm , RegType::kX86_Zmm , RegGroup::kVec , 64, 32, TypeId::kInt32x16);
-ASMJIT_DEFINE_REG_TRAITS(KReg , RegType::kX86_KReg , RegGroup::kX86_K , 0 , 8 , TypeId::kVoid );
-ASMJIT_DEFINE_REG_TRAITS(Mm , RegType::kX86_Mm , RegGroup::kX86_MM , 8 , 8 , TypeId::kMmx64 );
-ASMJIT_DEFINE_REG_TRAITS(SReg , RegType::kX86_SReg , RegGroup::kX86_SReg , 2 , 7 , TypeId::kVoid );
-ASMJIT_DEFINE_REG_TRAITS(CReg , RegType::kX86_CReg , RegGroup::kX86_CReg , 0 , 16, TypeId::kVoid );
-ASMJIT_DEFINE_REG_TRAITS(DReg , RegType::kX86_DReg , RegGroup::kX86_DReg , 0 , 16, TypeId::kVoid );
-ASMJIT_DEFINE_REG_TRAITS(St , RegType::kX86_St , RegGroup::kX86_St , 10, 8 , TypeId::kFloat80 );
-ASMJIT_DEFINE_REG_TRAITS(Bnd , RegType::kX86_Bnd , RegGroup::kX86_Bnd , 16, 4 , TypeId::kVoid );
-ASMJIT_DEFINE_REG_TRAITS(Tmm , RegType::kX86_Tmm , RegGroup::kX86_Tmm , 0 , 8 , TypeId::kVoid );
+// <--------------------+------------------------+------------------------+---+------------------+
+// | Reg-Type | Reg-Group |Sz | TypeId |
+// <--------------------+------------------------+------------------------+---+------------------+
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Rip , RegGroup::kX86_Rip , 0 , TypeId::kVoid );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_GpbLo , RegGroup::kGp , 1 , TypeId::kInt8 );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_GpbHi , RegGroup::kGp , 1 , TypeId::kInt8 );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Gpw , RegGroup::kGp , 2 , TypeId::kInt16 );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Gpd , RegGroup::kGp , 4 , TypeId::kInt32 );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Gpq , RegGroup::kGp , 8 , TypeId::kInt64 );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Xmm , RegGroup::kVec , 16, TypeId::kInt32x4 );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Ymm , RegGroup::kVec , 32, TypeId::kInt32x8 );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Zmm , RegGroup::kVec , 64, TypeId::kInt32x16);
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_KReg , RegGroup::kX86_K , 0 , TypeId::kVoid );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Mm , RegGroup::kX86_MM , 8 , TypeId::kMmx64 );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_SReg , RegGroup::kX86_SReg , 2 , TypeId::kVoid );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_CReg , RegGroup::kX86_CReg , 0 , TypeId::kVoid );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_DReg , RegGroup::kX86_DReg , 0 , TypeId::kVoid );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_St , RegGroup::kX86_St , 10, TypeId::kFloat80 );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Bnd , RegGroup::kX86_Bnd , 16, TypeId::kVoid );
+ASMJIT_DEFINE_REG_TRAITS(RegType::kX86_Tmm , RegGroup::kX86_Tmm , 0 , TypeId::kVoid );
//! \endcond
//! Register (X86).
@@ -77,121 +77,135 @@ public:
ASMJIT_DEFINE_ABSTRACT_REG(Reg, BaseReg)
//! Tests whether the register is a GPB register (8-bit).
- inline constexpr bool isGpb() const noexcept { return size() == 1; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isGpb() const noexcept { return size() == 1; }
//! Tests whether the register is a low GPB register (8-bit).
- inline constexpr bool isGpbLo() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_GpbLo>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isGpbLo() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_GpbLo>::kSignature); }
//! Tests whether the register is a high GPB register (8-bit).
- inline constexpr bool isGpbHi() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_GpbHi>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isGpbHi() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_GpbHi>::kSignature); }
//! Tests whether the register is a GPW register (16-bit).
- inline constexpr bool isGpw() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Gpw>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isGpw() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Gpw>::kSignature); }
//! Tests whether the register is a GPD register (32-bit).
- inline constexpr bool isGpd() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Gpd>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isGpd() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Gpd>::kSignature); }
//! Tests whether the register is a GPQ register (64-bit).
- inline constexpr bool isGpq() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Gpq>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isGpq() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Gpq>::kSignature); }
+
+ //! Tests whether the register is a 32-bit general purpose register, alias of \ref isGpd().
+ ASMJIT_INLINE_NODEBUG constexpr bool isGp32() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Gpd>::kSignature); }
+ //! Tests whether the register is a 64-bit general purpose register, alias of \ref isGpq()
+ ASMJIT_INLINE_NODEBUG constexpr bool isGp64() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Gpq>::kSignature); }
+
//! Tests whether the register is an XMM register (128-bit).
- inline constexpr bool isXmm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Xmm>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isXmm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Xmm>::kSignature); }
//! Tests whether the register is a YMM register (256-bit).
- inline constexpr bool isYmm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Ymm>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isYmm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Ymm>::kSignature); }
//! Tests whether the register is a ZMM register (512-bit).
- inline constexpr bool isZmm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Zmm>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isZmm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Zmm>::kSignature); }
+
+ //! Tests whether the register is a 128-bit vector register, alias of \ref isXmm().
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec128() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Xmm>::kSignature); }
+ //! Tests whether the register is a 256-bit vector register, alias of \ref isYmm().
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec256() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Ymm>::kSignature); }
+ //! Tests whether the register is a 512-bit vector register, alias of \ref isZmm().
+ ASMJIT_INLINE_NODEBUG constexpr bool isVec512() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Zmm>::kSignature); }
+
//! Tests whether the register is an MMX register (64-bit).
- inline constexpr bool isMm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Mm>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isMm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Mm>::kSignature); }
//! Tests whether the register is a K register (64-bit).
- inline constexpr bool isKReg() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_KReg>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isKReg() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_KReg>::kSignature); }
//! Tests whether the register is a segment register.
- inline constexpr bool isSReg() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_SReg>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isSReg() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_SReg>::kSignature); }
//! Tests whether the register is a control register.
- inline constexpr bool isCReg() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_CReg>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isCReg() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_CReg>::kSignature); }
//! Tests whether the register is a debug register.
- inline constexpr bool isDReg() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_DReg>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isDReg() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_DReg>::kSignature); }
//! Tests whether the register is an FPU register (80-bit).
- inline constexpr bool isSt() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_St>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isSt() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_St>::kSignature); }
//! Tests whether the register is a bound register.
- inline constexpr bool isBnd() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Bnd>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isBnd() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Bnd>::kSignature); }
//! Tests whether the register is a TMM register.
- inline constexpr bool isTmm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Tmm>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isTmm() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Tmm>::kSignature); }
//! Tests whether the register is RIP.
- inline constexpr bool isRip() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Rip>::kSignature); }
+ ASMJIT_INLINE_NODEBUG constexpr bool isRip() const noexcept { return hasBaseSignature(RegTraits<RegType::kX86_Rip>::kSignature); }
template<RegType REG_TYPE>
- inline void setRegT(uint32_t rId) noexcept {
+ ASMJIT_INLINE_NODEBUG void setRegT(uint32_t rId) noexcept {
setSignature(OperandSignature{RegTraits<REG_TYPE>::kSignature});
setId(rId);
}
- inline void setTypeAndId(RegType type, uint32_t id) noexcept {
+ ASMJIT_INLINE_NODEBUG void setTypeAndId(RegType type, uint32_t id) noexcept {
setSignature(signatureOf(type));
setId(id);
}
- static inline RegGroup groupOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kX86).regTypeToGroup(type); }
- static inline TypeId typeIdOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kX86).regTypeToTypeId(type); }
- static inline OperandSignature signatureOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kX86).regTypeToSignature(type); }
+ static ASMJIT_INLINE_NODEBUG RegGroup groupOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kX86).regTypeToGroup(type); }
+ static ASMJIT_INLINE_NODEBUG TypeId typeIdOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kX86).regTypeToTypeId(type); }
+ static ASMJIT_INLINE_NODEBUG OperandSignature signatureOf(RegType type) noexcept { return ArchTraits::byArch(Arch::kX86).regTypeToSignature(type); }
template<RegType REG_TYPE>
- static inline RegGroup groupOfT() noexcept { return RegGroup(RegTraits<REG_TYPE>::kGroup); }
+ static ASMJIT_INLINE_NODEBUG RegGroup groupOfT() noexcept { return RegGroup(RegTraits<REG_TYPE>::kGroup); }
template<RegType REG_TYPE>
- static inline TypeId typeIdOfT() noexcept { return TypeId(RegTraits<REG_TYPE>::kTypeId); }
+ static ASMJIT_INLINE_NODEBUG TypeId typeIdOfT() noexcept { return TypeId(RegTraits<REG_TYPE>::kTypeId); }
template<RegType REG_TYPE>
- static inline OperandSignature signatureOfT() noexcept { return OperandSignature{RegTraits<REG_TYPE>::kSignature}; }
+ static ASMJIT_INLINE_NODEBUG OperandSignature signatureOfT() noexcept { return OperandSignature{RegTraits<REG_TYPE>::kSignature}; }
- static inline OperandSignature signatureOfVecByType(TypeId typeId) noexcept {
+ static ASMJIT_INLINE_NODEBUG OperandSignature signatureOfVecByType(TypeId typeId) noexcept {
return OperandSignature{typeId <= TypeId::_kVec128End ? uint32_t(RegTraits<RegType::kX86_Xmm>::kSignature) :
typeId <= TypeId::_kVec256End ? uint32_t(RegTraits<RegType::kX86_Ymm>::kSignature) :
uint32_t(RegTraits<RegType::kX86_Zmm>::kSignature)};
}
- static inline OperandSignature signatureOfVecBySize(uint32_t size) noexcept {
+ static ASMJIT_INLINE_NODEBUG OperandSignature signatureOfVecBySize(uint32_t size) noexcept {
return OperandSignature{size <= 16 ? uint32_t(RegTraits<RegType::kX86_Xmm>::kSignature) :
size <= 32 ? uint32_t(RegTraits<RegType::kX86_Ymm>::kSignature) :
uint32_t(RegTraits<RegType::kX86_Zmm>::kSignature)};
}
//! Tests whether the `op` operand is either a low or high 8-bit GPB register.
- static inline bool isGpb(const Operand_& op) noexcept {
+ static ASMJIT_INLINE_NODEBUG bool isGpb(const Operand_& op) noexcept {
// Check operand type, register group, and size. Not interested in register type.
return op.signature().subset(Signature::kOpTypeMask | Signature::kRegGroupMask | Signature::kSizeMask) ==
(Signature::fromOpType(OperandType::kReg) | Signature::fromRegGroup(RegGroup::kGp) | Signature::fromSize(1));
}
- static inline bool isGpbLo(const Operand_& op) noexcept { return op.as<Reg>().isGpbLo(); }
- static inline bool isGpbHi(const Operand_& op) noexcept { return op.as<Reg>().isGpbHi(); }
- static inline bool isGpw(const Operand_& op) noexcept { return op.as<Reg>().isGpw(); }
- static inline bool isGpd(const Operand_& op) noexcept { return op.as<Reg>().isGpd(); }
- static inline bool isGpq(const Operand_& op) noexcept { return op.as<Reg>().isGpq(); }
- static inline bool isXmm(const Operand_& op) noexcept { return op.as<Reg>().isXmm(); }
- static inline bool isYmm(const Operand_& op) noexcept { return op.as<Reg>().isYmm(); }
- static inline bool isZmm(const Operand_& op) noexcept { return op.as<Reg>().isZmm(); }
- static inline bool isMm(const Operand_& op) noexcept { return op.as<Reg>().isMm(); }
- static inline bool isKReg(const Operand_& op) noexcept { return op.as<Reg>().isKReg(); }
- static inline bool isSReg(const Operand_& op) noexcept { return op.as<Reg>().isSReg(); }
- static inline bool isCReg(const Operand_& op) noexcept { return op.as<Reg>().isCReg(); }
- static inline bool isDReg(const Operand_& op) noexcept { return op.as<Reg>().isDReg(); }
- static inline bool isSt(const Operand_& op) noexcept { return op.as<Reg>().isSt(); }
- static inline bool isBnd(const Operand_& op) noexcept { return op.as<Reg>().isBnd(); }
- static inline bool isTmm(const Operand_& op) noexcept { return op.as<Reg>().isTmm(); }
- static inline bool isRip(const Operand_& op) noexcept { return op.as<Reg>().isRip(); }
-
- static inline bool isGpb(const Operand_& op, uint32_t rId) noexcept { return isGpb(op) & (op.id() == rId); }
- static inline bool isGpbLo(const Operand_& op, uint32_t rId) noexcept { return isGpbLo(op) & (op.id() == rId); }
- static inline bool isGpbHi(const Operand_& op, uint32_t rId) noexcept { return isGpbHi(op) & (op.id() == rId); }
- static inline bool isGpw(const Operand_& op, uint32_t rId) noexcept { return isGpw(op) & (op.id() == rId); }
- static inline bool isGpd(const Operand_& op, uint32_t rId) noexcept { return isGpd(op) & (op.id() == rId); }
- static inline bool isGpq(const Operand_& op, uint32_t rId) noexcept { return isGpq(op) & (op.id() == rId); }
- static inline bool isXmm(const Operand_& op, uint32_t rId) noexcept { return isXmm(op) & (op.id() == rId); }
- static inline bool isYmm(const Operand_& op, uint32_t rId) noexcept { return isYmm(op) & (op.id() == rId); }
- static inline bool isZmm(const Operand_& op, uint32_t rId) noexcept { return isZmm(op) & (op.id() == rId); }
- static inline bool isMm(const Operand_& op, uint32_t rId) noexcept { return isMm(op) & (op.id() == rId); }
- static inline bool isKReg(const Operand_& op, uint32_t rId) noexcept { return isKReg(op) & (op.id() == rId); }
- static inline bool isSReg(const Operand_& op, uint32_t rId) noexcept { return isSReg(op) & (op.id() == rId); }
- static inline bool isCReg(const Operand_& op, uint32_t rId) noexcept { return isCReg(op) & (op.id() == rId); }
- static inline bool isDReg(const Operand_& op, uint32_t rId) noexcept { return isDReg(op) & (op.id() == rId); }
- static inline bool isSt(const Operand_& op, uint32_t rId) noexcept { return isSt(op) & (op.id() == rId); }
- static inline bool isBnd(const Operand_& op, uint32_t rId) noexcept { return isBnd(op) & (op.id() == rId); }
- static inline bool isTmm(const Operand_& op, uint32_t rId) noexcept { return isTmm(op) & (op.id() == rId); }
- static inline bool isRip(const Operand_& op, uint32_t rId) noexcept { return isRip(op) & (op.id() == rId); }
+ static ASMJIT_INLINE_NODEBUG bool isGpbLo(const Operand_& op) noexcept { return op.as<Reg>().isGpbLo(); }
+ static ASMJIT_INLINE_NODEBUG bool isGpbHi(const Operand_& op) noexcept { return op.as<Reg>().isGpbHi(); }
+ static ASMJIT_INLINE_NODEBUG bool isGpw(const Operand_& op) noexcept { return op.as<Reg>().isGpw(); }
+ static ASMJIT_INLINE_NODEBUG bool isGpd(const Operand_& op) noexcept { return op.as<Reg>().isGpd(); }
+ static ASMJIT_INLINE_NODEBUG bool isGpq(const Operand_& op) noexcept { return op.as<Reg>().isGpq(); }
+ static ASMJIT_INLINE_NODEBUG bool isXmm(const Operand_& op) noexcept { return op.as<Reg>().isXmm(); }
+ static ASMJIT_INLINE_NODEBUG bool isYmm(const Operand_& op) noexcept { return op.as<Reg>().isYmm(); }
+ static ASMJIT_INLINE_NODEBUG bool isZmm(const Operand_& op) noexcept { return op.as<Reg>().isZmm(); }
+ static ASMJIT_INLINE_NODEBUG bool isMm(const Operand_& op) noexcept { return op.as<Reg>().isMm(); }
+ static ASMJIT_INLINE_NODEBUG bool isKReg(const Operand_& op) noexcept { return op.as<Reg>().isKReg(); }
+ static ASMJIT_INLINE_NODEBUG bool isSReg(const Operand_& op) noexcept { return op.as<Reg>().isSReg(); }
+ static ASMJIT_INLINE_NODEBUG bool isCReg(const Operand_& op) noexcept { return op.as<Reg>().isCReg(); }
+ static ASMJIT_INLINE_NODEBUG bool isDReg(const Operand_& op) noexcept { return op.as<Reg>().isDReg(); }
+ static ASMJIT_INLINE_NODEBUG bool isSt(const Operand_& op) noexcept { return op.as<Reg>().isSt(); }
+ static ASMJIT_INLINE_NODEBUG bool isBnd(const Operand_& op) noexcept { return op.as<Reg>().isBnd(); }
+ static ASMJIT_INLINE_NODEBUG bool isTmm(const Operand_& op) noexcept { return op.as<Reg>().isTmm(); }
+ static ASMJIT_INLINE_NODEBUG bool isRip(const Operand_& op) noexcept { return op.as<Reg>().isRip(); }
+
+ static ASMJIT_INLINE_NODEBUG bool isGpb(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isGpb(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isGpbLo(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isGpbLo(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isGpbHi(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isGpbHi(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isGpw(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isGpw(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isGpd(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isGpd(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isGpq(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isGpq(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isXmm(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isXmm(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isYmm(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isYmm(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isZmm(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isZmm(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isMm(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isMm(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isKReg(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isKReg(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isSReg(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isSReg(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isCReg(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isCReg(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isDReg(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isDReg(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isSt(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isSt(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isBnd(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isBnd(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isTmm(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isTmm(op)) & unsigned(op.id() == rId)); }
+ static ASMJIT_INLINE_NODEBUG bool isRip(const Operand_& op, uint32_t rId) noexcept { return bool(unsigned(isRip(op)) & unsigned(op.id() == rId)); }
};
//! General purpose register (X86).
@@ -223,17 +237,17 @@ public:
};
//! Casts this register to 8-bit (LO) part.
- inline GpbLo r8() const noexcept;
+ ASMJIT_INLINE_NODEBUG GpbLo r8() const noexcept;
//! Casts this register to 8-bit (LO) part.
- inline GpbLo r8Lo() const noexcept;
+ ASMJIT_INLINE_NODEBUG GpbLo r8Lo() const noexcept;
//! Casts this register to 8-bit (HI) part.
- inline GpbHi r8Hi() const noexcept;
+ ASMJIT_INLINE_NODEBUG GpbHi r8Hi() const noexcept;
//! Casts this register to 16-bit.
- inline Gpw r16() const noexcept;
+ ASMJIT_INLINE_NODEBUG Gpw r16() const noexcept;
//! Casts this register to 32-bit.
- inline Gpd r32() const noexcept;
+ ASMJIT_INLINE_NODEBUG Gpd r32() const noexcept;
//! Casts this register to 64-bit.
- inline Gpq r64() const noexcept;
+ ASMJIT_INLINE_NODEBUG Gpq r64() const noexcept;
};
//! Vector register (XMM|YMM|ZMM) (X86).
@@ -241,14 +255,21 @@ class Vec : public Reg {
ASMJIT_DEFINE_ABSTRACT_REG(Vec, Reg)
//! Casts this register to XMM (clone).
- inline Xmm xmm() const noexcept;
- //! Casts this register to YMM.
- inline Ymm ymm() const noexcept;
- //! Casts this register to ZMM.
- inline Zmm zmm() const noexcept;
+ ASMJIT_INLINE_NODEBUG Xmm xmm() const noexcept;
+ //! Casts this register to YMM (clone).
+ ASMJIT_INLINE_NODEBUG Ymm ymm() const noexcept;
+ //! Casts this register to ZMM (clone).
+ ASMJIT_INLINE_NODEBUG Zmm zmm() const noexcept;
+
+ //! Casts this register to XMM (clone).
+ ASMJIT_INLINE_NODEBUG Vec v128() const noexcept;
+ //! Casts this register to YMM (clone).
+ ASMJIT_INLINE_NODEBUG Vec v256() const noexcept;
+ //! Casts this register to ZMM (clone).
+ ASMJIT_INLINE_NODEBUG Vec v512() const noexcept;
//! Casts this register to a register that has half the size (or XMM if it's already XMM).
- inline Vec half() const noexcept {
+ ASMJIT_INLINE_NODEBUG Vec half() const noexcept {
return Vec(type() == RegType::kX86_Zmm ? signatureOfT<RegType::kX86_Ymm>() : signatureOfT<RegType::kX86_Xmm>(), id());
}
};
@@ -300,21 +321,21 @@ class Gpq : public Gp { ASMJIT_DEFINE_FINAL_REG(Gpq, Gp, RegTraits<RegType::kX86
class Xmm : public Vec {
ASMJIT_DEFINE_FINAL_REG(Xmm, Vec, RegTraits<RegType::kX86_Xmm>)
//! Casts this register to a register that has half the size (XMM).
- inline Xmm half() const noexcept { return Xmm(id()); }
+ ASMJIT_INLINE_NODEBUG Xmm half() const noexcept { return Xmm(id()); }
};
//! 256-bit YMM register (AVX+).
class Ymm : public Vec {
ASMJIT_DEFINE_FINAL_REG(Ymm, Vec, RegTraits<RegType::kX86_Ymm>)
//! Casts this register to a register that has half the size (XMM).
- inline Xmm half() const noexcept { return Xmm(id()); }
+ ASMJIT_INLINE_NODEBUG Xmm half() const noexcept { return Xmm(id()); }
};
//! 512-bit ZMM register (AVX512+).
class Zmm : public Vec {
ASMJIT_DEFINE_FINAL_REG(Zmm, Vec, RegTraits<RegType::kX86_Zmm>)
//! Casts this register to a register that has half the size (YMM).
- inline Ymm half() const noexcept { return Ymm(id()); }
+ ASMJIT_INLINE_NODEBUG Ymm half() const noexcept { return Ymm(id()); }
};
//! 64-bit MMX register (MMX+).
@@ -335,60 +356,61 @@ class Tmm : public Reg { ASMJIT_DEFINE_FINAL_REG(Tmm, Reg, RegTraits<RegType::kX
class Rip : public Reg { ASMJIT_DEFINE_FINAL_REG(Rip, Reg, RegTraits<RegType::kX86_Rip>) };
//! \cond
-inline GpbLo Gp::r8() const noexcept { return GpbLo(id()); }
-inline GpbLo Gp::r8Lo() const noexcept { return GpbLo(id()); }
-inline GpbHi Gp::r8Hi() const noexcept { return GpbHi(id()); }
-inline Gpw Gp::r16() const noexcept { return Gpw(id()); }
-inline Gpd Gp::r32() const noexcept { return Gpd(id()); }
-inline Gpq Gp::r64() const noexcept { return Gpq(id()); }
-inline Xmm Vec::xmm() const noexcept { return Xmm(id()); }
-inline Ymm Vec::ymm() const noexcept { return Ymm(id()); }
-inline Zmm Vec::zmm() const noexcept { return Zmm(id()); }
+ASMJIT_INLINE_NODEBUG GpbLo Gp::r8() const noexcept { return GpbLo(id()); }
+ASMJIT_INLINE_NODEBUG GpbLo Gp::r8Lo() const noexcept { return GpbLo(id()); }
+ASMJIT_INLINE_NODEBUG GpbHi Gp::r8Hi() const noexcept { return GpbHi(id()); }
+ASMJIT_INLINE_NODEBUG Gpw Gp::r16() const noexcept { return Gpw(id()); }
+ASMJIT_INLINE_NODEBUG Gpd Gp::r32() const noexcept { return Gpd(id()); }
+ASMJIT_INLINE_NODEBUG Gpq Gp::r64() const noexcept { return Gpq(id()); }
+ASMJIT_INLINE_NODEBUG Xmm Vec::xmm() const noexcept { return Xmm(id()); }
+ASMJIT_INLINE_NODEBUG Ymm Vec::ymm() const noexcept { return Ymm(id()); }
+ASMJIT_INLINE_NODEBUG Zmm Vec::zmm() const noexcept { return Zmm(id()); }
+ASMJIT_INLINE_NODEBUG Vec Vec::v128() const noexcept { return Xmm(id()); }
+ASMJIT_INLINE_NODEBUG Vec Vec::v256() const noexcept { return Ymm(id()); }
+ASMJIT_INLINE_NODEBUG Vec Vec::v512() const noexcept { return Zmm(id()); }
//! \endcond
//! \namespace asmjit::x86::regs
//!
-//! Registers provided by X86 and X64 ISAs are in both `asmjit::x86` and
-//! `asmjit::x86::regs` namespaces so they can be included with using directive.
-//! For example `using namespace asmjit::x86::regs` would include all registers,
-//! but not other X86-specific API, whereas `using namespace asmjit::x86` would
-//! include everything X86-specific.
+//! Registers provided by X86 and X64 ISAs are in both `asmjit::x86` and `asmjit::x86::regs` namespaces so they can
+//! be included with using directive. For example `using namespace asmjit::x86::regs` would include all registers,
+//! but not other X86-specific API, whereas `using namespace asmjit::x86` would include everything X86-specific.
#ifndef _DOXYGEN
namespace regs {
#endif
//! Creates an 8-bit low GPB register operand.
-static constexpr GpbLo gpb(uint32_t rId) noexcept { return GpbLo(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr GpbLo gpb(uint32_t rId) noexcept { return GpbLo(rId); }
//! Creates an 8-bit low GPB register operand.
-static constexpr GpbLo gpb_lo(uint32_t rId) noexcept { return GpbLo(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr GpbLo gpb_lo(uint32_t rId) noexcept { return GpbLo(rId); }
//! Creates an 8-bit high GPB register operand.
-static constexpr GpbHi gpb_hi(uint32_t rId) noexcept { return GpbHi(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr GpbHi gpb_hi(uint32_t rId) noexcept { return GpbHi(rId); }
//! Creates a 16-bit GPW register operand.
-static constexpr Gpw gpw(uint32_t rId) noexcept { return Gpw(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr Gpw gpw(uint32_t rId) noexcept { return Gpw(rId); }
//! Creates a 32-bit GPD register operand.
-static constexpr Gpd gpd(uint32_t rId) noexcept { return Gpd(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr Gpd gpd(uint32_t rId) noexcept { return Gpd(rId); }
//! Creates a 64-bit GPQ register operand (64-bit).
-static constexpr Gpq gpq(uint32_t rId) noexcept { return Gpq(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr Gpq gpq(uint32_t rId) noexcept { return Gpq(rId); }
//! Creates a 128-bit XMM register operand.
-static constexpr Xmm xmm(uint32_t rId) noexcept { return Xmm(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr Xmm xmm(uint32_t rId) noexcept { return Xmm(rId); }
//! Creates a 256-bit YMM register operand.
-static constexpr Ymm ymm(uint32_t rId) noexcept { return Ymm(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr Ymm ymm(uint32_t rId) noexcept { return Ymm(rId); }
//! Creates a 512-bit ZMM register operand.
-static constexpr Zmm zmm(uint32_t rId) noexcept { return Zmm(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr Zmm zmm(uint32_t rId) noexcept { return Zmm(rId); }
//! Creates a 64-bit Mm register operand.
-static constexpr Mm mm(uint32_t rId) noexcept { return Mm(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr Mm mm(uint32_t rId) noexcept { return Mm(rId); }
//! Creates a 64-bit K register operand.
-static constexpr KReg k(uint32_t rId) noexcept { return KReg(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr KReg k(uint32_t rId) noexcept { return KReg(rId); }
//! Creates a 32-bit or 64-bit control register operand.
-static constexpr CReg cr(uint32_t rId) noexcept { return CReg(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr CReg cr(uint32_t rId) noexcept { return CReg(rId); }
//! Creates a 32-bit or 64-bit debug register operand.
-static constexpr DReg dr(uint32_t rId) noexcept { return DReg(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr DReg dr(uint32_t rId) noexcept { return DReg(rId); }
//! Creates an 80-bit st register operand.
-static constexpr St st(uint32_t rId) noexcept { return St(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr St st(uint32_t rId) noexcept { return St(rId); }
//! Creates a 128-bit bound register operand.
-static constexpr Bnd bnd(uint32_t rId) noexcept { return Bnd(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr Bnd bnd(uint32_t rId) noexcept { return Bnd(rId); }
//! Creates a TMM register operand.
-static constexpr Tmm tmm(uint32_t rId) noexcept { return Tmm(rId); }
+static ASMJIT_INLINE_NODEBUG constexpr Tmm tmm(uint32_t rId) noexcept { return Tmm(rId); }
static constexpr GpbLo al = GpbLo(Gp::kIdAx);
static constexpr GpbLo bl = GpbLo(Gp::kIdBx);
@@ -723,25 +745,25 @@ public:
//! \{
//! Creates a default `Mem` operand that points to [0].
- inline constexpr Mem() noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem() noexcept
: BaseMem() {}
- inline constexpr Mem(const Mem& other) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const Mem& other) noexcept
: BaseMem(other) {}
- inline explicit Mem(Globals::NoInit_) noexcept
+ ASMJIT_INLINE_NODEBUG explicit Mem(Globals::NoInit_) noexcept
: BaseMem(Globals::NoInit) {}
- inline constexpr Mem(const Signature& signature, uint32_t baseId, uint32_t indexId, int32_t offset) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const Signature& signature, uint32_t baseId, uint32_t indexId, int32_t offset) noexcept
: BaseMem(signature, baseId, indexId, offset) {}
- inline constexpr Mem(const Label& base, int32_t off, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const Label& base, int32_t off, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromMemBaseType(RegType::kLabelTag) |
Signature::fromSize(size) |
signature, base.id(), 0, off) {}
- inline constexpr Mem(const Label& base, const BaseReg& index, uint32_t shift, int32_t off, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const Label& base, const BaseReg& index, uint32_t shift, int32_t off, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromMemBaseType(RegType::kLabelTag) |
Signature::fromMemIndexType(index.type()) |
@@ -749,13 +771,13 @@ public:
Signature::fromSize(size) |
signature, base.id(), index.id(), off) {}
- inline constexpr Mem(const BaseReg& base, int32_t off, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const BaseReg& base, int32_t off, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromMemBaseType(base.type()) |
Signature::fromSize(size) |
signature, base.id(), 0, off) {}
- inline constexpr Mem(const BaseReg& base, const BaseReg& index, uint32_t shift, int32_t off, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(const BaseReg& base, const BaseReg& index, uint32_t shift, int32_t off, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromMemBaseType(base.type()) |
Signature::fromMemIndexType(index.type()) |
@@ -763,12 +785,12 @@ public:
Signature::fromSize(size) |
signature, base.id(), index.id(), off) {}
- inline constexpr explicit Mem(uint64_t base, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr explicit Mem(uint64_t base, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromSize(size) |
signature, uint32_t(base >> 32), 0, int32_t(uint32_t(base & 0xFFFFFFFFu))) {}
- inline constexpr Mem(uint64_t base, const BaseReg& index, uint32_t shift = 0, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
+ ASMJIT_INLINE_NODEBUG constexpr Mem(uint64_t base, const BaseReg& index, uint32_t shift = 0, uint32_t size = 0, Signature signature = OperandSignature{0}) noexcept
: BaseMem(Signature::fromOpType(OperandType::kMem) |
Signature::fromMemIndexType(index.type()) |
Signature::fromValue<kSignatureMemShiftValueMask>(shift) |
@@ -780,7 +802,7 @@ public:
//! \name Overloaded Operators
//! \{
- inline Mem& operator=(const Mem& other) noexcept = default;
+ ASMJIT_INLINE_NODEBUG Mem& operator=(const Mem& other) noexcept = default;
//! \}
@@ -788,17 +810,25 @@ public:
//! \{
//! Clones the memory operand.
- inline constexpr Mem clone() const noexcept { return Mem(*this); }
+ ASMJIT_INLINE_NODEBUG constexpr Mem clone() const noexcept { return Mem(*this); }
- //! Creates a new copy of this memory operand adjusted by `off`.
+ //! Creates a copy of this memory operand adjusted by `off`.
inline Mem cloneAdjusted(int64_t off) const noexcept {
Mem result(*this);
result.addOffset(off);
return result;
}
- inline constexpr Mem cloneBroadcasted(Broadcast b) const noexcept {
- return Mem((_signature & ~Signature{kSignatureMemBroadcastMask}) | Signature::fromValue<kSignatureMemBroadcastMask>(b), _baseId, _data[0], int32_t(_data[1]));
+ //! Creates a copy of this memory operand resized to `size`.
+ inline Mem cloneResized(uint32_t size) const noexcept {
+ Mem result(*this);
+ result.setSize(size);
+ return result;
+ }
+
+ //! Creates a copy of this memory operand with a broadcast `bcst`.
+ ASMJIT_INLINE_NODEBUG constexpr Mem cloneBroadcasted(Broadcast bcst) const noexcept {
+ return Mem((_signature & ~Signature{kSignatureMemBroadcastMask}) | Signature::fromValue<kSignatureMemBroadcastMask>(bcst), _baseId, _data[0], int32_t(_data[1]));
}
//! \}
@@ -809,43 +839,64 @@ public:
//! Converts memory `baseType` and `baseId` to `x86::Reg` instance.
//!
//! The memory must have a valid base register otherwise the result will be wrong.
- inline Reg baseReg() const noexcept { return Reg::fromTypeAndId(baseType(), baseId()); }
+ ASMJIT_INLINE_NODEBUG Reg baseReg() const noexcept { return Reg::fromTypeAndId(baseType(), baseId()); }
//! Converts memory `indexType` and `indexId` to `x86::Reg` instance.
//!
//! The memory must have a valid index register otherwise the result will be wrong.
- inline Reg indexReg() const noexcept { return Reg::fromTypeAndId(indexType(), indexId()); }
+ ASMJIT_INLINE_NODEBUG Reg indexReg() const noexcept { return Reg::fromTypeAndId(indexType(), indexId()); }
using BaseMem::setIndex;
- inline void setIndex(const BaseReg& index, uint32_t shift) noexcept {
+ ASMJIT_INLINE_NODEBUG void setIndex(const BaseReg& index, uint32_t shift) noexcept {
setIndex(index);
setShift(shift);
}
//! \}
+ //! \name Memory Size
+ //! \{
+
+ //! Tests whether the memory operand specifies a size (i.e. the size is not zero).
+ ASMJIT_INLINE_NODEBUG constexpr bool hasSize() const noexcept { return _signature.hasField<Signature::kSizeMask>(); }
+ //! Tests whether the memory operand size matches size `s`.
+ ASMJIT_INLINE_NODEBUG constexpr bool hasSize(uint32_t s) const noexcept { return size() == s; }
+
+ //! Returns the size of the memory operand in bytes.
+ //!
+ //! \note Most instructions would deduce the size of the memory operand, so in most cases it's expected that the
+ //! returned value would be zero. However, some instruction require the size to select between multiple variations,
+ //! so in some cases size is required would be non-zero (for example `inc [mem], immediate` requires size to
+ //! distinguish between 8-bit, 16-bit, 32-bit, and 64-bit increments.
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t size() const noexcept { return _signature.getField<Signature::kSizeMask>(); }
+
+ //! Sets the memory operand size (in bytes).
+ ASMJIT_INLINE_NODEBUG void setSize(uint32_t size) noexcept { _signature.setField<Signature::kSizeMask>(size); }
+
+ //! \}
+
//! \name Address Type
//! \{
//! Returns the address type of the memory operand.
//!
//! By default, address type of newly created memory operands is always \ref AddrType::kDefault.
- inline constexpr AddrType addrType() const noexcept { return (AddrType)_signature.getField<kSignatureMemAddrTypeMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr AddrType addrType() const noexcept { return (AddrType)_signature.getField<kSignatureMemAddrTypeMask>(); }
//! Sets the address type to `addrType`.
- inline void setAddrType(AddrType addrType) noexcept { _signature.setField<kSignatureMemAddrTypeMask>(uint32_t(addrType)); }
+ ASMJIT_INLINE_NODEBUG void setAddrType(AddrType addrType) noexcept { _signature.setField<kSignatureMemAddrTypeMask>(uint32_t(addrType)); }
//! Resets the address type to \ref AddrType::kDefault.
- inline void resetAddrType() noexcept { _signature.setField<kSignatureMemAddrTypeMask>(uint32_t(AddrType::kDefault)); }
+ ASMJIT_INLINE_NODEBUG void resetAddrType() noexcept { _signature.setField<kSignatureMemAddrTypeMask>(uint32_t(AddrType::kDefault)); }
//! Tests whether the address type is \ref AddrType::kAbs.
- inline constexpr bool isAbs() const noexcept { return addrType() == AddrType::kAbs; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isAbs() const noexcept { return addrType() == AddrType::kAbs; }
//! Sets the address type to \ref AddrType::kAbs.
- inline void setAbs() noexcept { setAddrType(AddrType::kAbs); }
+ ASMJIT_INLINE_NODEBUG void setAbs() noexcept { setAddrType(AddrType::kAbs); }
//! Tests whether the address type is \ref AddrType::kRel.
- inline constexpr bool isRel() const noexcept { return addrType() == AddrType::kRel; }
+ ASMJIT_INLINE_NODEBUG constexpr bool isRel() const noexcept { return addrType() == AddrType::kRel; }
//! Sets the address type to \ref AddrType::kRel.
- inline void setRel() noexcept { setAddrType(AddrType::kRel); }
+ ASMJIT_INLINE_NODEBUG void setRel() noexcept { setAddrType(AddrType::kRel); }
//! \}
@@ -853,18 +904,18 @@ public:
//! \{
//! Tests whether the memory operand has a segment override.
- inline constexpr bool hasSegment() const noexcept { return _signature.hasField<kSignatureMemSegmentMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr bool hasSegment() const noexcept { return _signature.hasField<kSignatureMemSegmentMask>(); }
//! Returns the associated segment override as `SReg` operand.
- inline constexpr SReg segment() const noexcept { return SReg(segmentId()); }
+ ASMJIT_INLINE_NODEBUG constexpr SReg segment() const noexcept { return SReg(segmentId()); }
//! Returns segment override register id, see `SReg::Id`.
- inline constexpr uint32_t segmentId() const noexcept { return _signature.getField<kSignatureMemSegmentMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t segmentId() const noexcept { return _signature.getField<kSignatureMemSegmentMask>(); }
//! Sets the segment override to `seg`.
- inline void setSegment(const SReg& seg) noexcept { setSegment(seg.id()); }
+ ASMJIT_INLINE_NODEBUG void setSegment(const SReg& seg) noexcept { setSegment(seg.id()); }
//! Sets the segment override to `id`.
- inline void setSegment(uint32_t rId) noexcept { _signature.setField<kSignatureMemSegmentMask>(rId); }
+ ASMJIT_INLINE_NODEBUG void setSegment(uint32_t rId) noexcept { _signature.setField<kSignatureMemSegmentMask>(rId); }
//! Resets the segment override.
- inline void resetSegment() noexcept { _signature.setField<kSignatureMemSegmentMask>(0); }
+ ASMJIT_INLINE_NODEBUG void resetSegment() noexcept { _signature.setField<kSignatureMemSegmentMask>(0); }
//! \}
@@ -872,13 +923,13 @@ public:
//! \{
//! Tests whether the memory operand has shift (aka scale) value.
- inline constexpr bool hasShift() const noexcept { return _signature.hasField<kSignatureMemShiftValueMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr bool hasShift() const noexcept { return _signature.hasField<kSignatureMemShiftValueMask>(); }
//! Returns the memory operand's shift (aka scale) value.
- inline constexpr uint32_t shift() const noexcept { return _signature.getField<kSignatureMemShiftValueMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr uint32_t shift() const noexcept { return _signature.getField<kSignatureMemShiftValueMask>(); }
//! Sets the memory operand's shift (aka scale) value.
- inline void setShift(uint32_t shift) noexcept { _signature.setField<kSignatureMemShiftValueMask>(shift); }
+ ASMJIT_INLINE_NODEBUG void setShift(uint32_t shift) noexcept { _signature.setField<kSignatureMemShiftValueMask>(shift); }
//! Resets the memory operand's shift (aka scale) value to zero.
- inline void resetShift() noexcept { _signature.setField<kSignatureMemShiftValueMask>(0); }
+ ASMJIT_INLINE_NODEBUG void resetShift() noexcept { _signature.setField<kSignatureMemShiftValueMask>(0); }
//! \}
@@ -886,156 +937,168 @@ public:
//! \{
//! Tests whether the memory operand has broadcast {1tox}.
- inline constexpr bool hasBroadcast() const noexcept { return _signature.hasField<kSignatureMemBroadcastMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr bool hasBroadcast() const noexcept { return _signature.hasField<kSignatureMemBroadcastMask>(); }
//! Returns the memory operand's broadcast.
- inline constexpr Broadcast getBroadcast() const noexcept { return (Broadcast)_signature.getField<kSignatureMemBroadcastMask>(); }
+ ASMJIT_INLINE_NODEBUG constexpr Broadcast getBroadcast() const noexcept { return (Broadcast)_signature.getField<kSignatureMemBroadcastMask>(); }
//! Sets the memory operand's broadcast.
- inline void setBroadcast(Broadcast b) noexcept { _signature.setField<kSignatureMemBroadcastMask>(uint32_t(b)); }
+ ASMJIT_INLINE_NODEBUG void setBroadcast(Broadcast b) noexcept { _signature.setField<kSignatureMemBroadcastMask>(uint32_t(b)); }
//! Resets the memory operand's broadcast to none.
- inline void resetBroadcast() noexcept { _signature.setField<kSignatureMemBroadcastMask>(0); }
+ ASMJIT_INLINE_NODEBUG void resetBroadcast() noexcept { _signature.setField<kSignatureMemBroadcastMask>(0); }
//! Returns a new `Mem` without a broadcast (the possible broadcast is cleared).
- inline constexpr Mem _1to1() const noexcept { return cloneBroadcasted(Broadcast::kNone); }
+ ASMJIT_INLINE_NODEBUG constexpr Mem _1to1() const noexcept { return cloneBroadcasted(Broadcast::kNone); }
//! Returns a new `Mem` with {1to2} broadcast (AVX-512).
- inline constexpr Mem _1to2() const noexcept { return cloneBroadcasted(Broadcast::k1To2); }
+ ASMJIT_INLINE_NODEBUG constexpr Mem _1to2() const noexcept { return cloneBroadcasted(Broadcast::k1To2); }
//! Returns a new `Mem` with {1to4} broadcast (AVX-512).
- inline constexpr Mem _1to4() const noexcept { return cloneBroadcasted(Broadcast::k1To4); }
+ ASMJIT_INLINE_NODEBUG constexpr Mem _1to4() const noexcept { return cloneBroadcasted(Broadcast::k1To4); }
//! Returns a new `Mem` with {1to8} broadcast (AVX-512).
- inline constexpr Mem _1to8() const noexcept { return cloneBroadcasted(Broadcast::k1To8); }
+ ASMJIT_INLINE_NODEBUG constexpr Mem _1to8() const noexcept { return cloneBroadcasted(Broadcast::k1To8); }
//! Returns a new `Mem` with {1to16} broadcast (AVX-512).
- inline constexpr Mem _1to16() const noexcept { return cloneBroadcasted(Broadcast::k1To16); }
+ ASMJIT_INLINE_NODEBUG constexpr Mem _1to16() const noexcept { return cloneBroadcasted(Broadcast::k1To16); }
//! Returns a new `Mem` with {1to32} broadcast (AVX-512).
- inline constexpr Mem _1to32() const noexcept { return cloneBroadcasted(Broadcast::k1To32); }
+ ASMJIT_INLINE_NODEBUG constexpr Mem _1to32() const noexcept { return cloneBroadcasted(Broadcast::k1To32); }
//! Returns a new `Mem` with {1to64} broadcast (AVX-512).
- inline constexpr Mem _1to64() const noexcept { return cloneBroadcasted(Broadcast::k1To64); }
+ ASMJIT_INLINE_NODEBUG constexpr Mem _1to64() const noexcept { return cloneBroadcasted(Broadcast::k1To64); }
//! \}
};
//! Creates `[base.reg + offset]` memory operand.
-static inline constexpr Mem ptr(const Gp& base, int32_t offset = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Gp& base, int32_t offset = 0, uint32_t size = 0) noexcept {
return Mem(base, offset, size);
}
//! Creates `[base.reg + (index << shift) + offset]` memory operand (scalar index).
-static inline constexpr Mem ptr(const Gp& base, const Gp& index, uint32_t shift = 0, int32_t offset = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Gp& base, const Gp& index, uint32_t shift = 0, int32_t offset = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, offset, size);
}
//! Creates `[base.reg + (index << shift) + offset]` memory operand (vector index).
-static inline constexpr Mem ptr(const Gp& base, const Vec& index, uint32_t shift = 0, int32_t offset = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Gp& base, const Vec& index, uint32_t shift = 0, int32_t offset = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, offset, size);
}
//! Creates `[base + offset]` memory operand.
-static inline constexpr Mem ptr(const Label& base, int32_t offset = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Label& base, int32_t offset = 0, uint32_t size = 0) noexcept {
return Mem(base, offset, size);
}
//! Creates `[base + (index << shift) + offset]` memory operand.
-static inline constexpr Mem ptr(const Label& base, const Gp& index, uint32_t shift = 0, int32_t offset = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Label& base, const Gp& index, uint32_t shift = 0, int32_t offset = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, offset, size);
}
//! Creates `[base + (index << shift) + offset]` memory operand.
-static inline constexpr Mem ptr(const Label& base, const Vec& index, uint32_t shift = 0, int32_t offset = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Label& base, const Vec& index, uint32_t shift = 0, int32_t offset = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, offset, size);
}
//! Creates `[rip + offset]` memory operand.
-static inline constexpr Mem ptr(const Rip& rip_, int32_t offset = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(const Rip& rip_, int32_t offset = 0, uint32_t size = 0) noexcept {
return Mem(rip_, offset, size);
}
//! Creates `[base]` absolute memory operand.
-static inline constexpr Mem ptr(uint64_t base, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(uint64_t base, uint32_t size = 0) noexcept {
return Mem(base, size);
}
//! Creates `[base + (index.reg << shift)]` absolute memory operand.
-static inline constexpr Mem ptr(uint64_t base, const Reg& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(uint64_t base, const Reg& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, size);
}
//! Creates `[base + (index.reg << shift)]` absolute memory operand.
-static inline constexpr Mem ptr(uint64_t base, const Vec& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr(uint64_t base, const Vec& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, size);
}
//! Creates `[base]` absolute memory operand (absolute).
-static inline constexpr Mem ptr_abs(uint64_t base, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_abs(uint64_t base, uint32_t size = 0) noexcept {
return Mem(base, size, OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kAbs));
}
//! Creates `[base + (index.reg << shift)]` absolute memory operand (absolute).
-static inline constexpr Mem ptr_abs(uint64_t base, const Reg& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_abs(uint64_t base, const Reg& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, size, OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kAbs));
}
//! Creates `[base + (index.reg << shift)]` absolute memory operand (absolute).
-static inline constexpr Mem ptr_abs(uint64_t base, const Vec& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_abs(uint64_t base, const Vec& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, size, OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kAbs));
}
//! Creates `[base]` relative memory operand (relative).
-static inline constexpr Mem ptr_rel(uint64_t base, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_rel(uint64_t base, uint32_t size = 0) noexcept {
return Mem(base, size, OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kRel));
}
//! Creates `[base + (index.reg << shift)]` relative memory operand (relative).
-static inline constexpr Mem ptr_rel(uint64_t base, const Reg& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_rel(uint64_t base, const Reg& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, size, OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kRel));
}
//! Creates `[base + (index.reg << shift)]` relative memory operand (relative).
-static inline constexpr Mem ptr_rel(uint64_t base, const Vec& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
+static ASMJIT_INLINE_NODEBUG constexpr Mem ptr_rel(uint64_t base, const Vec& index, uint32_t shift = 0, uint32_t size = 0) noexcept {
return Mem(base, index, shift, size, OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kRel));
}
-#define ASMJIT_MEM_PTR(FUNC, SIZE) \
- static constexpr Mem FUNC(const Gp& base, int32_t offset = 0) noexcept { \
- return Mem(base, offset, SIZE); \
- } \
- static constexpr Mem FUNC(const Gp& base, const Gp& index, uint32_t shift = 0, int32_t offset = 0) noexcept { \
- return Mem(base, index, shift, offset, SIZE); \
- } \
- static constexpr Mem FUNC(const Gp& base, const Vec& index, uint32_t shift = 0, int32_t offset = 0) noexcept { \
- return Mem(base, index, shift, offset, SIZE); \
- } \
- static constexpr Mem FUNC(const Label& base, int32_t offset = 0) noexcept { \
- return Mem(base, offset, SIZE); \
- } \
- static constexpr Mem FUNC(const Label& base, const Gp& index, uint32_t shift = 0, int32_t offset = 0) noexcept { \
- return Mem(base, index, shift, offset, SIZE); \
- } \
- static constexpr Mem FUNC(const Rip& rip_, int32_t offset = 0) noexcept { \
- return Mem(rip_, offset, SIZE); \
- } \
- static constexpr Mem FUNC(uint64_t base) noexcept { \
- return Mem(base, SIZE); \
- } \
- static constexpr Mem FUNC(uint64_t base, const Gp& index, uint32_t shift = 0) noexcept { \
- return Mem(base, index, shift, SIZE); \
- } \
- static constexpr Mem FUNC(uint64_t base, const Vec& index, uint32_t shift = 0) noexcept { \
- return Mem(base, index, shift, SIZE); \
- } \
- \
- static constexpr Mem FUNC##_abs(uint64_t base) noexcept { \
- return Mem(base, SIZE, \
- OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kAbs)); \
- } \
- static constexpr Mem FUNC##_abs(uint64_t base, const Gp& index, uint32_t shift = 0) noexcept { \
- return Mem(base, index, shift, SIZE, \
- OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kAbs)); \
- } \
- static constexpr Mem FUNC##_abs(uint64_t base, const Vec& index, uint32_t shift = 0) noexcept { \
- return Mem(base, index, shift, SIZE, \
- OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kAbs)); \
- } \
- \
- static constexpr Mem FUNC##_rel(uint64_t base) noexcept { \
- return Mem(base, SIZE, \
- OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kRel)); \
- } \
- static constexpr Mem FUNC##_rel(uint64_t base, const Gp& index, uint32_t shift = 0) noexcept { \
- return Mem(base, index, shift, SIZE, \
- OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kRel)); \
- } \
- static constexpr Mem FUNC##_rel(uint64_t base, const Vec& index, uint32_t shift = 0) noexcept { \
- return Mem(base, index, shift, SIZE, \
- OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kRel)); \
- }
+#define ASMJIT_MEM_PTR(FUNC, SIZE) \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC( \
+ const Gp& base, int32_t offset = 0) noexcept \
+ { return Mem(base, offset, SIZE); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC( \
+ const Gp& base, const Gp& index, uint32_t shift = 0, int32_t offset = 0) noexcept \
+ { return Mem(base, index, shift, offset, SIZE); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC( \
+ const Gp& base, const Vec& index, uint32_t shift = 0, int32_t offset = 0) noexcept \
+ { return Mem(base, index, shift, offset, SIZE); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC( \
+ const Label& base, int32_t offset = 0) noexcept \
+ { return Mem(base, offset, SIZE); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC( \
+ const Label& base, const Gp& index, uint32_t shift = 0, int32_t offset = 0) noexcept \
+ { return Mem(base, index, shift, offset, SIZE); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC( \
+ const Rip& rip_, int32_t offset = 0) noexcept \
+ { return Mem(rip_, offset, SIZE); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC( \
+ uint64_t base) noexcept \
+ { return Mem(base, SIZE); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC( \
+ uint64_t base, const Gp& index, uint32_t shift = 0) noexcept \
+ { return Mem(base, index, shift, SIZE); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC( \
+ uint64_t base, const Vec& index, uint32_t shift = 0) noexcept \
+ { return Mem(base, index, shift, SIZE); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC##_abs( \
+ uint64_t base) noexcept \
+ { return Mem(base, SIZE, \
+ OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kAbs)); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC##_abs( \
+ uint64_t base, const Gp& index, uint32_t shift = 0) noexcept \
+ { return Mem(base, index, shift, SIZE, \
+ OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kAbs)); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC##_abs( \
+ uint64_t base, const Vec& index, uint32_t shift = 0) noexcept \
+ { return Mem(base, index, shift, SIZE, \
+ OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kAbs)); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC##_rel( \
+ uint64_t base) noexcept \
+ { return Mem(base, SIZE, \
+ OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kRel)); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC##_rel( \
+ uint64_t base, const Gp& index, uint32_t shift = 0) noexcept \
+ { return Mem(base, index, shift, SIZE, \
+ OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kRel)); } \
+ \
+ static ASMJIT_INLINE_NODEBUG constexpr Mem FUNC##_rel( \
+ uint64_t base, const Vec& index, uint32_t shift = 0) noexcept \
+ { return Mem(base, index, shift, SIZE, \
+ OperandSignature::fromValue<Mem::kSignatureMemAddrTypeMask>(Mem::AddrType::kRel)); }
// Definition of memory operand constructors that use platform independent naming.
ASMJIT_MEM_PTR(ptr_8, 1)
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86rapass.cpp b/3rdparty/asmjit/src/asmjit/x86/x86rapass.cpp
index 02870d95ffe..c106c6c7e1d 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86rapass.cpp
+++ b/3rdparty/asmjit/src/asmjit/x86/x86rapass.cpp
@@ -183,6 +183,9 @@ Error RACFGBuilder::onInst(InstNode* inst, InstControlFlow& cf, RAInstBuilder& i
RATiedFlags flags = raRegRwFlags(opRwInfo.opFlags());
RegMask allowedRegs = instructionAllowedRegs;
+ if (opRwInfo.isUnique())
+ flags |= RATiedFlags::kUnique;
+
// X86-specific constraints related to LO|HI general purpose registers. This is only required when the
// register is part of the encoding. If the register is fixed we won't restrict anything as it doesn't
// restrict encoding of other registers.
@@ -220,9 +223,11 @@ Error RACFGBuilder::onInst(InstNode* inst, InstControlFlow& cf, RAInstBuilder& i
}
}
- // Do not use RegMem flag if changing Reg to Mem requires additional CPU feature that may not be enabled.
+ // Do not use RegMem flag if changing Reg to Mem requires a CPU feature that is not available.
if (rwInfo.rmFeature() && Support::test(flags, RATiedFlags::kUseRM | RATiedFlags::kOutRM)) {
- flags &= ~(RATiedFlags::kUseRM | RATiedFlags::kOutRM);
+ if (!cc()->code()->cpuFeatures().has(rwInfo.rmFeature())) {
+ flags &= ~(RATiedFlags::kUseRM | RATiedFlags::kOutRM);
+ }
}
RegGroup group = workReg->group();
@@ -472,6 +477,20 @@ Error RACFGBuilder::onInst(InstNode* inst, InstControlFlow& cf, RAInstBuilder& i
}
}
}
+ else if (opCount == 4 && inst->op(3).isImm()) {
+ const Imm& imm = inst->op(3).as<Imm>();
+
+ switch (inst->id()) {
+ case Inst::kIdVpternlogd:
+ case Inst::kIdVpternlogq: {
+ uint32_t predicate = uint32_t(imm.value() & 0xFFu);
+ if (predicate == 0x00u || predicate == 0xFFu) {
+ ib[0]->makeWriteOnly();
+ }
+ break;
+ }
+ }
+ }
switch (sameRegHint) {
case InstSameRegHint::kNone:
@@ -818,7 +837,7 @@ Error RACFGBuilder::moveImmToStackArg(InvokeNode* invokeNode, const FuncValue& a
stackPtr.setSize(4);
imm[0] = imm_;
- uint32_t nMovs = 0;
+ uint32_t movCount = 0;
// One stack entry has the same size as the native register size. That means that if we want to move a 32-bit
// integer on the stack in 64-bit mode, we need to extend it to a 64-bit integer first. In 32-bit mode, pushing
@@ -834,7 +853,7 @@ Error RACFGBuilder::moveImmToStackArg(InvokeNode* invokeNode, const FuncValue& a
case TypeId::kFloat32:
MovU32:
imm[0].zeroExtend32Bits();
- nMovs = 1;
+ movCount = 1;
break;
case TypeId::kInt64:
@@ -844,20 +863,20 @@ MovU32:
case TypeId::kMmx64:
if (_is64Bit && imm[0].isInt32()) {
stackPtr.setSize(8);
- nMovs = 1;
+ movCount = 1;
break;
}
imm[1].setValue(imm[0].uint32Hi());
imm[0].zeroExtend32Bits();
- nMovs = 2;
+ movCount = 2;
break;
default:
return DebugUtils::errored(kErrorInvalidAssignment);
}
- for (uint32_t i = 0; i < nMovs; i++) {
+ for (uint32_t i = 0; i < movCount; i++) {
ASMJIT_PROPAGATE(cc()->mov(stackPtr, imm[i]));
stackPtr.addOffsetLo32(int32_t(stackPtr.size()));
}
@@ -1304,6 +1323,54 @@ ASMJIT_FAVOR_SPEED Error X86RAPass::_rewrite(BaseNode* first, BaseNode* stop) no
}
}
+ // If one operand was rewritten from Reg to Mem, we have to ensure that we are using the correct instruction.
+ if (raInst->isRegToMemPatched()) {
+ switch (inst->id()) {
+ case Inst::kIdKmovb: {
+ if (operands[0].isGp() && operands[1].isMem()) {
+ // Transform from [V]MOVD to MOV.
+ operands[1].as<Mem>().setSize(1);
+ inst->setId(Inst::kIdMovzx);
+ }
+ break;
+ }
+
+ case Inst::kIdVmovw: {
+ if (operands[0].isGp() && operands[1].isMem()) {
+ // Transform from [V]MOVD to MOV.
+ operands[1].as<Mem>().setSize(2);
+ inst->setId(Inst::kIdMovzx);
+ }
+ break;
+ }
+
+ case Inst::kIdMovd:
+ case Inst::kIdVmovd:
+ case Inst::kIdKmovd: {
+ if (operands[0].isGp() && operands[1].isMem()) {
+ // Transform from [V]MOVD to MOV.
+ operands[1].as<Mem>().setSize(4);
+ inst->setId(Inst::kIdMov);
+ }
+ break;
+ }
+
+ case Inst::kIdMovq:
+ case Inst::kIdVmovq:
+ case Inst::kIdKmovq: {
+ if (operands[0].isGp() && operands[1].isMem()) {
+ // Transform from [V]MOVQ to MOV.
+ operands[1].as<Mem>().setSize(8);
+ inst->setId(Inst::kIdMov);
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
// Transform VEX instruction to EVEX when necessary.
if (raInst->isTransformable()) {
if (maxRegId > 15) {
diff --git a/3rdparty/asmjit/src/asmjit/x86/x86rapass_p.h b/3rdparty/asmjit/src/asmjit/x86/x86rapass_p.h
index b9603c21afc..67227a1a619 100644
--- a/3rdparty/asmjit/src/asmjit/x86/x86rapass_p.h
+++ b/3rdparty/asmjit/src/asmjit/x86/x86rapass_p.h
@@ -36,7 +36,7 @@ public:
//! \{
X86RAPass() noexcept;
- virtual ~X86RAPass() noexcept;
+ ~X86RAPass() noexcept override;
//! \}
@@ -44,20 +44,20 @@ public:
//! \{
//! Returns the compiler casted to `x86::Compiler`.
- inline Compiler* cc() const noexcept { return static_cast<Compiler*>(_cb); }
+ ASMJIT_INLINE_NODEBUG Compiler* cc() const noexcept { return static_cast<Compiler*>(_cb); }
//! Returns emit helper.
- inline EmitHelper* emitHelper() noexcept { return &_emitHelper; }
+ ASMJIT_INLINE_NODEBUG EmitHelper* emitHelper() noexcept { return &_emitHelper; }
- inline bool avxEnabled() const noexcept { return _emitHelper._avxEnabled; }
- inline bool avx512Enabled() const noexcept { return _emitHelper._avx512Enabled; }
+ ASMJIT_INLINE_NODEBUG bool avxEnabled() const noexcept { return _emitHelper._avxEnabled; }
+ ASMJIT_INLINE_NODEBUG bool avx512Enabled() const noexcept { return _emitHelper._avx512Enabled; }
//! \}
//! \name Utilities
//! \{
- inline uint32_t choose(uint32_t sseInstId, uint32_t avxInstId) noexcept {
+ ASMJIT_INLINE_NODEBUG InstId choose(InstId sseInstId, InstId avxInstId) noexcept {
return avxEnabled() ? avxInstId : sseInstId;
}
diff --git a/3rdparty/asmjit/test/asmjit_test_assembler.cpp b/3rdparty/asmjit/test/asmjit_test_assembler.cpp
index 4b40a751fe4..6a56b67a80c 100644
--- a/3rdparty/asmjit/test/asmjit_test_assembler.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_assembler.cpp
@@ -26,7 +26,7 @@ int main(int argc, char* argv[]) {
CmdLine cmdLine(argc, argv);
TestSettings settings {};
- settings.quiet = cmdLine.hasArg("--quiet");
+ settings.verbose = cmdLine.hasArg("--verbose");
settings.validate = cmdLine.hasArg("--validate");
printf("AsmJit Assembler Test-Suite v%u.%u.%u:\n\n",
@@ -35,12 +35,21 @@ int main(int argc, char* argv[]) {
unsigned((ASMJIT_LIBRARY_VERSION ) & 0xFF));
printf("Usage:\n");
- printf(" --help Show usage only\n");
- printf(" --arch=<ARCH> Select architecture to run ('all' by default)\n");
- printf(" --quiet Show only assembling errors [%s]\n", settings.quiet ? "x" : " ");
- printf(" --validate Use instruction validation [%s]\n", settings.validate ? "x" : " ");
+ printf(" --help Show usage only\n");
+ printf(" --verbose Show only assembling errors [%s]\n", settings.verbose ? "x" : " ");
+ printf(" --validate Use instruction validation [%s]\n", settings.validate ? "x" : " ");
+ printf(" --arch=<ARCH> Select architecture to run ('all' by default)\n");
printf("\n");
+ printf("Architectures:\n");
+#if !defined(ASMJIT_NO_X86)
+ printf(" --arch=x86 32-bit X86 architecture (X86)\n");
+ printf(" --arch=x64 64-bit X86 architecture (X86_64)\n");
+#endif
+#if !defined(ASMJIT_NO_AARCH64)
+ printf(" --arch=aarch64 64-bit ARM architecture (AArch64)\n");
+#endif
+ printf("\n");
if (cmdLine.hasArg("--help"))
return 0;
diff --git a/3rdparty/asmjit/test/asmjit_test_assembler.h b/3rdparty/asmjit/test/asmjit_test_assembler.h
index 61d774bbb1d..26f2c97ed98 100644
--- a/3rdparty/asmjit/test/asmjit_test_assembler.h
+++ b/3rdparty/asmjit/test/asmjit_test_assembler.h
@@ -10,7 +10,7 @@
#include <stdio.h>
struct TestSettings {
- bool quiet;
+ bool verbose;
bool validate;
};
@@ -52,7 +52,7 @@ public:
assembler.addDiagnosticOptions(asmjit::DiagnosticOptions::kValidateAssembler);
}
- ASMJIT_NOINLINE bool testInstruction(const char* expectedOpcode, const char* s, uint32_t err) noexcept {
+ ASMJIT_NOINLINE bool testValidInstruction(const char* s, const char* expectedOpcode, asmjit::Error err = asmjit::kErrorOk) noexcept {
count++;
if (err) {
@@ -73,13 +73,36 @@ public:
return false;
}
- if (!settings.quiet)
+ if (settings.verbose)
printf(" OK [%s] <- %s\n", encodedOpcode.data(), s);
passed++;
prepare();
return true;
}
+
+ ASMJIT_NOINLINE bool testInvalidInstruction(const char* s, asmjit::Error expectedError, asmjit::Error err) noexcept {
+ count++;
+
+ if (err == asmjit::kErrorOk) {
+ printf(" !! %s passed, but should have failed with <%s> error\n", s, asmjit::DebugUtils::errorAsString(expectedError));
+ prepare();
+ return false;
+ }
+
+ if (err != asmjit::kErrorOk) {
+ printf(" !! %s failed with <%s>, but should have failed with <%s>\n", s, asmjit::DebugUtils::errorAsString(err), asmjit::DebugUtils::errorAsString(expectedError));
+ prepare();
+ return false;
+ }
+
+ if (settings.verbose)
+ printf(" OK [%s] <- %s\n", asmjit::DebugUtils::errorAsString(err), s);
+
+ passed++;
+ prepare();
+ return true;
+ }
};
#endif // ASMJIT_TEST_ASSEMBLER_H_INCLUDED
diff --git a/3rdparty/asmjit/test/asmjit_test_assembler_a64.cpp b/3rdparty/asmjit/test/asmjit_test_assembler_a64.cpp
index a1d1178532f..4bb471040a3 100644
--- a/3rdparty/asmjit/test/asmjit_test_assembler_a64.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_assembler_a64.cpp
@@ -17,7 +17,7 @@
using namespace asmjit;
#define TEST_INSTRUCTION(OPCODE, ...) \
- tester.testInstruction(OPCODE, #__VA_ARGS__, tester.assembler.__VA_ARGS__)
+ tester.testValidInstruction(#__VA_ARGS__, OPCODE, tester.assembler.__VA_ARGS__)
static void ASMJIT_NOINLINE testA64AssemblerBase(AssemblerTester<a64::Assembler>& tester) noexcept {
using namespace a64;
@@ -42,6 +42,7 @@ static void ASMJIT_NOINLINE testA64AssemblerBase(AssemblerTester<a64::Assembler>
TEST_INSTRUCTION("E103038B", add(x1, xzr, x3));
TEST_INSTRUCTION("5F00030B", add(wzr, w2, w3));
TEST_INSTRUCTION("5F00038B", add(xzr, x2, x3));
+ TEST_INSTRUCTION("4140238B", add(x1, x2, w3, uxtw(0)));
TEST_INSTRUCTION("83004011", add(w3, w4, 0, lsl(12)));
TEST_INSTRUCTION("83004091", add(x3, x4, 0, lsl(12)));
TEST_INSTRUCTION("83005011", add(w3, w4, 1024, lsl(12)));
@@ -210,7 +211,8 @@ static void ASMJIT_NOINLINE testA64AssemblerBase(AssemblerTester<a64::Assembler>
TEST_INSTRUCTION("3F00022B", cmn(w1, w2));
TEST_INSTRUCTION("3F0002AB", cmn(x1, x2));
TEST_INSTRUCTION("3F08222B", cmn(w1, w2, uxtb(2)));
- TEST_INSTRUCTION("3F0822AB", cmn(x1, x2, uxtb(2)));
+ TEST_INSTRUCTION("3F0822AB", cmn(x1, w2, uxtb(2)));
+ TEST_INSTRUCTION("5F4023AB", cmn(x2, w3, uxtw(0)));
TEST_INSTRUCTION("FF43212B", cmn(wsp, w1));
TEST_INSTRUCTION("FF07212B", cmn(wsp, w1, uxtb(1)));
TEST_INSTRUCTION("FF6321AB", cmn(sp, x1));
@@ -224,7 +226,8 @@ static void ASMJIT_NOINLINE testA64AssemblerBase(AssemblerTester<a64::Assembler>
TEST_INSTRUCTION("3F00026B", cmp(w1, w2));
TEST_INSTRUCTION("3F0002EB", cmp(x1, x2));
TEST_INSTRUCTION("3F08226B", cmp(w1, w2, uxtb(2)));
- TEST_INSTRUCTION("3F0822EB", cmp(x1, x2, uxtb(2)));
+ TEST_INSTRUCTION("3F0822EB", cmp(x1, w2, uxtb(2)));
+ TEST_INSTRUCTION("5F4023EB", cmp(x2, w3, uxtw(0)));
TEST_INSTRUCTION("FF43216B", cmp(wsp, w1));
TEST_INSTRUCTION("FF07216B", cmp(wsp, w1, uxtb(1)));
TEST_INSTRUCTION("FF6321EB", cmp(sp, x1));
@@ -485,16 +488,24 @@ static void ASMJIT_NOINLINE testA64AssemblerBase(AssemblerTester<a64::Assembler>
TEST_INSTRUCTION("41104078", ldrh(w1, ptr(x2, 1))); // LDURH
TEST_INSTRUCTION("41D05F78", ldrh(w1, ptr(x2, -3))); // LDURH
TEST_INSTRUCTION("41705F78", ldrh(w1, ptr(x2, -9))); // LDURH
+ TEST_INSTRUCTION("4168E338", ldrsb(w1, ptr(x2, x3)));
TEST_INSTRUCTION("4104C039", ldrsb(w1, ptr(x2, 1)));
+ TEST_INSTRUCTION("4120C039", ldrsb(w1, ptr(x2, 8)));
TEST_INSTRUCTION("41D0DF38", ldrsb(w1, ptr(x2, -3))); // LDURSB
TEST_INSTRUCTION("4170DF38", ldrsb(w1, ptr(x2, -9))); // LDURSB
+ TEST_INSTRUCTION("4168A338", ldrsb(x1, ptr(x2, x3)));
TEST_INSTRUCTION("41048039", ldrsb(x1, ptr(x2, 1)));
+ TEST_INSTRUCTION("41208039", ldrsb(x1, ptr(x2, 8)));
TEST_INSTRUCTION("41D09F38", ldrsb(x1, ptr(x2, -3))); // LDURSB
TEST_INSTRUCTION("41709F38", ldrsb(x1, ptr(x2, -9))); // LDURSB
+ TEST_INSTRUCTION("4168E378", ldrsh(w1, ptr(x2, x3)));
TEST_INSTRUCTION("4110C078", ldrsh(w1, ptr(x2, 1))); // LDURSH
+ TEST_INSTRUCTION("4110C079", ldrsh(w1, ptr(x2, 8)));
TEST_INSTRUCTION("41D0DF78", ldrsh(w1, ptr(x2, -3))); // LDURSH
TEST_INSTRUCTION("4170DF78", ldrsh(w1, ptr(x2, -9))); // LDURSH
+ TEST_INSTRUCTION("4168A378", ldrsh(x1, ptr(x2, x3)));
TEST_INSTRUCTION("41108078", ldrsh(x1, ptr(x2, 1))); // LDURSH
+ TEST_INSTRUCTION("41108079", ldrsh(x1, ptr(x2, 8)));
TEST_INSTRUCTION("41D09F78", ldrsh(x1, ptr(x2, -3))); // LDURSH
TEST_INSTRUCTION("41709F78", ldrsh(x1, ptr(x2, -9))); // LDURSH
TEST_INSTRUCTION("410080B9", ldrsw(x1, ptr(x2)));
@@ -738,6 +749,10 @@ static void ASMJIT_NOINLINE testA64AssemblerBase(AssemblerTester<a64::Assembler>
TEST_INSTRUCTION("411088B8", ldursw(x1, ptr(x2, 129)));
TEST_INSTRUCTION("E10380B8", ldursw(x1, ptr(sp)));
TEST_INSTRUCTION("E11388B8", ldursw(x1, ptr(sp, 129)));
+ TEST_INSTRUCTION("420080B8", ldursw(x2, ptr(x2)));
+ TEST_INSTRUCTION("421088B8", ldursw(x2, ptr(x2, 129)));
+ TEST_INSTRUCTION("E20380B8", ldursw(x2, ptr(sp)));
+ TEST_INSTRUCTION("E21388B8", ldursw(x2, ptr(sp, 129)));
TEST_INSTRUCTION("61087F88", ldxp(w1, w2, ptr(x3)));
TEST_INSTRUCTION("E10B7F88", ldxp(w1, w2, ptr(sp)));
TEST_INSTRUCTION("61087FC8", ldxp(x1, x2, ptr(x3)));
@@ -850,6 +865,13 @@ static void ASMJIT_NOINLINE testA64AssemblerBase(AssemblerTester<a64::Assembler>
TEST_INSTRUCTION("F42FC1DA", pacdzb(x20));
TEST_INSTRUCTION("4130C39A", pacga(x1, x2, x3));
TEST_INSTRUCTION("4130DF9A", pacga(x1, x2, sp));
+ TEST_INSTRUCTION("204080F9", prfm(Predicate::PRFOp::kPLDL1KEEP, ptr(x1, 128)));
+ TEST_INSTRUCTION("401098F8", prfm(Predicate::PRFOp::kPLDL1KEEP, ptr(x2, -127)));
+ TEST_INSTRUCTION("601088F8", prfm(Predicate::PRFOp::kPLDL1KEEP, ptr(x3, 129)));
+ TEST_INSTRUCTION("6068A4F8", prfm(Predicate::PRFOp::kPLDL1KEEP, ptr(x3, x4)));
+ TEST_INSTRUCTION("6078A4F8", prfm(Predicate::PRFOp::kPLDL1KEEP, ptr(x3, x4, lsl(3))));
+ TEST_INSTRUCTION("60C8A4F8", prfm(Predicate::PRFOp::kPLDL1KEEP, ptr(x3, x4, sxtw(0))));
+ TEST_INSTRUCTION("73D8A4F8", prfm(Predicate::PRFOp::kPSTL2STRM, ptr(x3, x4, sxtw(3))));
TEST_INSTRUCTION("9F3403D5", pssbb());
TEST_INSTRUCTION("4100C05A", rbit(w1, w2));
TEST_INSTRUCTION("4100C0DA", rbit(x1, x2));
diff --git a/3rdparty/asmjit/test/asmjit_test_assembler_x64.cpp b/3rdparty/asmjit/test/asmjit_test_assembler_x64.cpp
index bedf7964541..556c0eb9f5c 100644
--- a/3rdparty/asmjit/test/asmjit_test_assembler_x64.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_assembler_x64.cpp
@@ -17,7 +17,7 @@
using namespace asmjit;
#define TEST_INSTRUCTION(OPCODE, ...) \
- tester.testInstruction(OPCODE, #__VA_ARGS__, tester.assembler.__VA_ARGS__)
+ tester.testValidInstruction(#__VA_ARGS__, OPCODE, tester.assembler.__VA_ARGS__)
static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>& tester) noexcept {
using namespace x86;
@@ -58,12 +58,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("138C1A80000000" , adc(ecx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("48138C1A80000000" , adc(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("48138C1A80000000" , adc(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("660F38F6CA" , adcx(ecx, edx));
- TEST_INSTRUCTION("660F38F68C1A80000000" , adcx(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("660F38F68C1A80000000" , adcx(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("66480F38F6CA" , adcx(rcx, rdx));
- TEST_INSTRUCTION("66480F38F68C1A80000000" , adcx(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("66480F38F68C1A80000000" , adcx(rcx, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("80C101" , add(cl, 1));
TEST_INSTRUCTION("80C501" , add(ch, 1));
TEST_INSTRUCTION("8084118000000001" , add(byte_ptr(rcx, rdx, 0, 128), 1));
@@ -100,12 +94,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("038C1A80000000" , add(ecx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("48038C1A80000000" , add(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("48038C1A80000000" , add(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30F38F6CA" , adox(ecx, edx));
- TEST_INSTRUCTION("F30F38F68C1A80000000" , adox(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30F38F68C1A80000000" , adox(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F3480F38F6CA" , adox(rcx, rdx));
- TEST_INSTRUCTION("F3480F38F68C1A80000000" , adox(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F3480F38F68C1A80000000" , adox(rcx, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("80E101" , and_(cl, 1));
TEST_INSTRUCTION("80E501" , and_(ch, 1));
TEST_INSTRUCTION("6683E101" , and_(cx, 1));
@@ -142,93 +130,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66238C1A80000000" , and_(cx, word_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("238C1A80000000" , and_(ecx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("238C1A80000000" , and_(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E268F2CB" , andn(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E268F28C2B80000000" , andn(ecx, edx, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E268F28C2B80000000" , andn(ecx, edx, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E8F2CB" , andn(rcx, rdx, rbx));
- TEST_INSTRUCTION("C4E2E8F28C2B80000000" , andn(rcx, rdx, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E8F28C2B80000000" , andn(rcx, rdx, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E260F7CA" , bextr(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E258F78C1A80000000" , bextr(ecx, ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E258F78C1A80000000" , bextr(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E2E0F7CA" , bextr(rcx, rdx, rbx));
- TEST_INSTRUCTION("C4E2D8F78C1A80000000" , bextr(rcx, ptr(rdx, rbx, 0, 128), rsp));
- TEST_INSTRUCTION("C4E2D8F78C1A80000000" , bextr(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
- TEST_INSTRUCTION("8FE97001CA" , blcfill(ecx, edx));
- TEST_INSTRUCTION("8FE970018C1A80000000" , blcfill(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE970018C1A80000000" , blcfill(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001CA" , blcfill(rcx, rdx));
- TEST_INSTRUCTION("8FE9F0018C1A80000000" , blcfill(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F0018C1A80000000" , blcfill(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97002F2" , blci(ecx, edx));
- TEST_INSTRUCTION("8FE97002B41A80000000" , blci(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97002B41A80000000" , blci(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F002F2" , blci(rcx, rdx));
- TEST_INSTRUCTION("8FE9F002B41A80000000" , blci(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F002B41A80000000" , blci(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001EA" , blcic(ecx, edx));
- TEST_INSTRUCTION("8FE97001AC1A80000000" , blcic(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001AC1A80000000" , blcic(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001EA" , blcic(rcx, rdx));
- TEST_INSTRUCTION("8FE9F001AC1A80000000" , blcic(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001AC1A80000000" , blcic(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97002CA" , blcmsk(ecx, edx));
- TEST_INSTRUCTION("8FE970028C1A80000000" , blcmsk(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE970028C1A80000000" , blcmsk(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F002CA" , blcmsk(rcx, rdx));
- TEST_INSTRUCTION("8FE9F0028C1A80000000" , blcmsk(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F0028C1A80000000" , blcmsk(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001DA" , blcs(ecx, edx));
- TEST_INSTRUCTION("8FE970019C1A80000000" , blcs(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE970019C1A80000000" , blcs(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001DA" , blcs(rcx, rdx));
- TEST_INSTRUCTION("8FE9F0019C1A80000000" , blcs(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F0019C1A80000000" , blcs(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001D2" , blsfill(ecx, edx));
- TEST_INSTRUCTION("8FE97001941A80000000" , blsfill(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001941A80000000" , blsfill(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001D2" , blsfill(rcx, rdx));
- TEST_INSTRUCTION("8FE9F001941A80000000" , blsfill(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001941A80000000" , blsfill(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E270F3DA" , blsi(ecx, edx));
- TEST_INSTRUCTION("C4E270F39C1A80000000" , blsi(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E270F39C1A80000000" , blsi(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2F0F3DA" , blsi(rcx, rdx));
- TEST_INSTRUCTION("C4E2F0F39C1A80000000" , blsi(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2F0F39C1A80000000" , blsi(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001F2" , blsic(ecx, edx));
- TEST_INSTRUCTION("8FE97001B41A80000000" , blsic(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001B41A80000000" , blsic(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001F2" , blsic(rcx, rdx));
- TEST_INSTRUCTION("8FE9F001B41A80000000" , blsic(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001B41A80000000" , blsic(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E270F3D2" , blsmsk(ecx, edx));
- TEST_INSTRUCTION("C4E270F3941A80000000" , blsmsk(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E270F3941A80000000" , blsmsk(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2F0F3D2" , blsmsk(rcx, rdx));
- TEST_INSTRUCTION("C4E2F0F3941A80000000" , blsmsk(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2F0F3941A80000000" , blsmsk(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E270F3CA" , blsr(ecx, edx));
- TEST_INSTRUCTION("C4E270F38C1A80000000" , blsr(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E270F38C1A80000000" , blsr(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2F0F3CA" , blsr(rcx, rdx));
- TEST_INSTRUCTION("C4E2F0F38C1A80000000" , blsr(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2F0F38C1A80000000" , blsr(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30F1ACA" , bndcl(bnd1, rdx));
- TEST_INSTRUCTION("F30F1A8C1A80000000" , bndcl(bnd1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30F1A8C1A80000000" , bndcl(bnd1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F20F1BCA" , bndcn(bnd1, rdx));
- TEST_INSTRUCTION("F20F1B8C1A80000000" , bndcn(bnd1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F20F1B8C1A80000000" , bndcn(bnd1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F20F1ACA" , bndcu(bnd1, rdx));
- TEST_INSTRUCTION("F20F1A8C1A80000000" , bndcu(bnd1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F20F1A8C1A80000000" , bndcu(bnd1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("0F1A8C1A80000000" , bndldx(bnd1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30F1B8C1A80000000" , bndmk(bnd1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("660F1ACA" , bndmov(bnd1, bnd2));
- TEST_INSTRUCTION("660F1A8C1A80000000" , bndmov(bnd1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("660F1B9C1180000000" , bndmov(ptr(rcx, rdx, 0, 128), bnd3));
- TEST_INSTRUCTION("0F1B9C1180000000" , bndstx(ptr(rcx, rdx, 0, 128), bnd3));
TEST_INSTRUCTION("660FBCCA" , bsf(cx, dx));
TEST_INSTRUCTION("660FBC8C1A80000000" , bsf(cx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("660FBC8C1A80000000" , bsf(cx, word_ptr(rdx, rbx, 0, 128)));
@@ -310,30 +211,12 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("480FABD1" , bts(rcx, rdx));
TEST_INSTRUCTION("480FAB9C1180000000" , bts(ptr(rcx, rdx, 0, 128), rbx));
TEST_INSTRUCTION("480FAB9C1180000000" , bts(qword_ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("C4E260F5CA" , bzhi(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E258F58C1A80000000" , bzhi(ecx, ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E258F58C1A80000000" , bzhi(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E2E0F5CA" , bzhi(rcx, rdx, rbx));
- TEST_INSTRUCTION("C4E2D8F58C1A80000000" , bzhi(rcx, ptr(rdx, rbx, 0, 128), rsp));
- TEST_INSTRUCTION("C4E2D8F58C1A80000000" , bzhi(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
TEST_INSTRUCTION("6698" , cbw(ax));
TEST_INSTRUCTION("99" , cdq(edx, eax));
TEST_INSTRUCTION("4898" , cdqe(rax));
- TEST_INSTRUCTION("0F01CA" , clac());
TEST_INSTRUCTION("F8" , clc());
TEST_INSTRUCTION("FC" , cld());
- TEST_INSTRUCTION("0F1C841180000000" , cldemote(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0FAEBC1180000000" , clflush(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("660FAEBC1180000000" , clflushopt(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F01DD" , clgi());
TEST_INSTRUCTION("FA" , cli());
- TEST_INSTRUCTION("F30FAEB41180000000" , clrssbsy(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("F30FAEB41180000000" , clrssbsy(qword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F06" , clts());
- TEST_INSTRUCTION("F30F01EE" , clui());
- TEST_INSTRUCTION("660FAEB41180000000" , clwb(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F01FC" , clzero(ptr(rax)));
- TEST_INSTRUCTION("0F01FC" , clzero(zmmword_ptr(rax)));
TEST_INSTRUCTION("F5" , cmc());
TEST_INSTRUCTION("660F47CA" , cmova(cx, dx));
TEST_INSTRUCTION("660F478C1A80000000" , cmova(cx, ptr(rdx, rbx, 0, 128)));
@@ -668,17 +551,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0FC78C1180000000" , cmpxchg8b(qword_ptr(rcx, rdx, 0, 128), edx, eax, ecx, ebx));
TEST_INSTRUCTION("0FA2" , cpuid(eax, ebx, ecx, edx));
TEST_INSTRUCTION("4899" , cqo(rdx, rax));
- TEST_INSTRUCTION("F20F38F0CA" , crc32(ecx, dl));
- TEST_INSTRUCTION("F20F38F0CE" , crc32(ecx, dh));
- TEST_INSTRUCTION("66F20F38F1CA" , crc32(ecx, dx));
- TEST_INSTRUCTION("F20F38F1CA" , crc32(ecx, edx));
- TEST_INSTRUCTION("F20F38F08C1A80000000" , crc32(ecx, byte_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("66F20F38F18C1A80000000" , crc32(ecx, word_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F20F38F18C1A80000000" , crc32(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F2480F38F0CA" , crc32(rcx, dl));
- TEST_INSTRUCTION("F2480F38F1CA" , crc32(rcx, rdx));
- TEST_INSTRUCTION("F2480F38F08C1A80000000" , crc32(rcx, byte_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F2480F38F18C1A80000000" , crc32(rcx, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("6699" , cwd(dx, ax));
TEST_INSTRUCTION("98" , cwde(eax));
TEST_INSTRUCTION("FEC9" , dec(cl));
@@ -703,19 +575,8 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("48F7F1" , div(rdx, rax, rcx));
TEST_INSTRUCTION("48F7B41180000000" , div(rdx, rax, ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("48F7B41180000000" , div(rdx, rax, qword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("F30F1EFB" , endbr32());
- TEST_INSTRUCTION("F30F1EFA" , endbr64());
- TEST_INSTRUCTION("F20F38F88C1A80000000" , enqcmd(zmmword_ptr(rcx), zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30F38F88C1A80000000" , enqcmds(zmmword_ptr(rcx), zmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("C8010002" , enter(1, 2));
- TEST_INSTRUCTION("0FAE8C1180000000" , fxrstor(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("480FAE8C1180000000" , fxrstor64(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0FAE841180000000" , fxsave(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("480FAE841180000000" , fxsave64(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("D9F4" , fxtract());
- TEST_INSTRUCTION("0F37" , getsec());
TEST_INSTRUCTION("F4" , hlt());
- TEST_INSTRUCTION("F30F3AF0C001" , hreset(1, eax));
TEST_INSTRUCTION("F6F9" , idiv(ax, cl));
TEST_INSTRUCTION("F6FD" , idiv(ax, ch));
TEST_INSTRUCTION("F6BC1180000000" , idiv(ax, ptr(rcx, rdx, 0, 128)));
@@ -754,12 +615,15 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("486BC901" , imul(rcx, 1));
TEST_INSTRUCTION("480FAF8C1A80000000" , imul(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("480FAF8C1A80000000" , imul(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("666BC901" , imul(cx, cx, 1));
TEST_INSTRUCTION("666BCA01" , imul(cx, dx, 1));
TEST_INSTRUCTION("666B8C1A8000000001" , imul(cx, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("666B8C1A8000000001" , imul(cx, word_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("6BC901" , imul(ecx, ecx, 1));
TEST_INSTRUCTION("6BCA01" , imul(ecx, edx, 1));
TEST_INSTRUCTION("6B8C1A8000000001" , imul(ecx, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("6B8C1A8000000001" , imul(ecx, dword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("486BC901" , imul(rcx, rcx, 1));
TEST_INSTRUCTION("486BCA01" , imul(rcx, rdx, 1));
TEST_INSTRUCTION("486B8C1A8000000001" , imul(rcx, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("486B8C1A8000000001" , imul(rcx, qword_ptr(rdx, rbx, 0, 128), 1));
@@ -778,101 +642,18 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66FF841180000000" , inc(word_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("FF841180000000" , inc(dword_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("48FF841180000000" , inc(qword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("F30FAEE9" , incsspd(ecx));
- TEST_INSTRUCTION("F3480FAEE9" , incsspq(rcx));
TEST_INSTRUCTION("6C" , ins(byte_ptr(rdi), dx));
TEST_INSTRUCTION("666D" , ins(word_ptr(rdi), dx));
TEST_INSTRUCTION("6D" , ins(dword_ptr(rdi), dx));
TEST_INSTRUCTION("CD01" , int_(1));
TEST_INSTRUCTION("CC" , int3());
TEST_INSTRUCTION("0F08" , invd());
- TEST_INSTRUCTION("660F38808C1A80000000" , invept(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("660F38808C1A80000000" , invept(rcx, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("0F01BC1180000000" , invlpg(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("670F01DF" , invlpga(eax, ecx));
- TEST_INSTRUCTION("0F01DF" , invlpga(rax, ecx));
TEST_INSTRUCTION("660F38828C1A80000000" , invpcid(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("660F38828C1A80000000" , invpcid(rcx, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("660F38818C1A80000000" , invvpid(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("660F38818C1A80000000" , invvpid(rcx, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("66CF" , iret());
TEST_INSTRUCTION("CF" , iretd());
TEST_INSTRUCTION("48CF" , iretq());
- TEST_INSTRUCTION("C5ED4ACB" , kaddb(k1, k2, k3));
- TEST_INSTRUCTION("C4E1ED4ACB" , kaddd(k1, k2, k3));
- TEST_INSTRUCTION("C4E1EC4ACB" , kaddq(k1, k2, k3));
- TEST_INSTRUCTION("C5EC4ACB" , kaddw(k1, k2, k3));
- TEST_INSTRUCTION("C5ED41CB" , kandb(k1, k2, k3));
- TEST_INSTRUCTION("C4E1ED41CB" , kandd(k1, k2, k3));
- TEST_INSTRUCTION("C5ED42CB" , kandnb(k1, k2, k3));
- TEST_INSTRUCTION("C4E1ED42CB" , kandnd(k1, k2, k3));
- TEST_INSTRUCTION("C4E1EC42CB" , kandnq(k1, k2, k3));
- TEST_INSTRUCTION("C5EC42CB" , kandnw(k1, k2, k3));
- TEST_INSTRUCTION("C4E1EC41CB" , kandq(k1, k2, k3));
- TEST_INSTRUCTION("C5EC41CB" , kandw(k1, k2, k3));
- TEST_INSTRUCTION("C5F992CA" , kmovb(k1, edx));
- TEST_INSTRUCTION("C5F990CA" , kmovb(k1, k2));
- TEST_INSTRUCTION("C5F9908C1A80000000" , kmovb(k1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F9908C1A80000000" , kmovb(k1, byte_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F993CA" , kmovb(ecx, k2));
- TEST_INSTRUCTION("C5F9919C1180000000" , kmovb(ptr(rcx, rdx, 0, 128), k3));
- TEST_INSTRUCTION("C5F9919C1180000000" , kmovb(byte_ptr(rcx, rdx, 0, 128), k3));
- TEST_INSTRUCTION("C5FB92CA" , kmovd(k1, edx));
- TEST_INSTRUCTION("C4E1F990CA" , kmovd(k1, k2));
- TEST_INSTRUCTION("C4E1F9908C1A80000000" , kmovd(k1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1F9908C1A80000000" , kmovd(k1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FB93CA" , kmovd(ecx, k2));
- TEST_INSTRUCTION("C4E1F9919C1180000000" , kmovd(ptr(rcx, rdx, 0, 128), k3));
- TEST_INSTRUCTION("C4E1F9919C1180000000" , kmovd(dword_ptr(rcx, rdx, 0, 128), k3));
- TEST_INSTRUCTION("C4E1FB92CA" , kmovq(k1, rdx));
- TEST_INSTRUCTION("C4E1F890CA" , kmovq(k1, k2));
- TEST_INSTRUCTION("C4E1F8908C1A80000000" , kmovq(k1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1F8908C1A80000000" , kmovq(k1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1FB93CA" , kmovq(rcx, k2));
- TEST_INSTRUCTION("C4E1F8919C1180000000" , kmovq(ptr(rcx, rdx, 0, 128), k3));
- TEST_INSTRUCTION("C4E1F8919C1180000000" , kmovq(qword_ptr(rcx, rdx, 0, 128), k3));
- TEST_INSTRUCTION("C5F892CA" , kmovw(k1, edx));
- TEST_INSTRUCTION("C5F890CA" , kmovw(k1, k2));
- TEST_INSTRUCTION("C5F8908C1A80000000" , kmovw(k1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F8908C1A80000000" , kmovw(k1, word_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F893CA" , kmovw(ecx, k2));
- TEST_INSTRUCTION("C5F8919C1180000000" , kmovw(ptr(rcx, rdx, 0, 128), k3));
- TEST_INSTRUCTION("C5F8919C1180000000" , kmovw(word_ptr(rcx, rdx, 0, 128), k3));
- TEST_INSTRUCTION("C5F944CA" , knotb(k1, k2));
- TEST_INSTRUCTION("C4E1F944CA" , knotd(k1, k2));
- TEST_INSTRUCTION("C4E1F844CA" , knotq(k1, k2));
- TEST_INSTRUCTION("C5F844CA" , knotw(k1, k2));
- TEST_INSTRUCTION("C5ED45CB" , korb(k1, k2, k3));
- TEST_INSTRUCTION("C4E1ED45CB" , kord(k1, k2, k3));
- TEST_INSTRUCTION("C4E1EC45CB" , korq(k1, k2, k3));
- TEST_INSTRUCTION("C5F998CA" , kortestb(k1, k2));
- TEST_INSTRUCTION("C4E1F998CA" , kortestd(k1, k2));
- TEST_INSTRUCTION("C4E1F898CA" , kortestq(k1, k2));
- TEST_INSTRUCTION("C5F898CA" , kortestw(k1, k2));
- TEST_INSTRUCTION("C5EC45CB" , korw(k1, k2, k3));
- TEST_INSTRUCTION("C4E37932CA01" , kshiftlb(k1, k2, 1));
- TEST_INSTRUCTION("C4E37933CA01" , kshiftld(k1, k2, 1));
- TEST_INSTRUCTION("C4E3F933CA01" , kshiftlq(k1, k2, 1));
- TEST_INSTRUCTION("C4E3F932CA01" , kshiftlw(k1, k2, 1));
- TEST_INSTRUCTION("C4E37930CA01" , kshiftrb(k1, k2, 1));
- TEST_INSTRUCTION("C4E37931CA01" , kshiftrd(k1, k2, 1));
- TEST_INSTRUCTION("C4E3F931CA01" , kshiftrq(k1, k2, 1));
- TEST_INSTRUCTION("C4E3F930CA01" , kshiftrw(k1, k2, 1));
- TEST_INSTRUCTION("C5F999CA" , ktestb(k1, k2));
- TEST_INSTRUCTION("C4E1F999CA" , ktestd(k1, k2));
- TEST_INSTRUCTION("C4E1F899CA" , ktestq(k1, k2));
- TEST_INSTRUCTION("C5F899CA" , ktestw(k1, k2));
- TEST_INSTRUCTION("C5ED4BCB" , kunpckbw(k1, k2, k3));
- TEST_INSTRUCTION("C4E1EC4BCB" , kunpckdq(k1, k2, k3));
- TEST_INSTRUCTION("C5EC4BCB" , kunpckwd(k1, k2, k3));
- TEST_INSTRUCTION("C5ED46CB" , kxnorb(k1, k2, k3));
- TEST_INSTRUCTION("C4E1ED46CB" , kxnord(k1, k2, k3));
- TEST_INSTRUCTION("C4E1EC46CB" , kxnorq(k1, k2, k3));
- TEST_INSTRUCTION("C5EC46CB" , kxnorw(k1, k2, k3));
- TEST_INSTRUCTION("C5ED47CB" , kxorb(k1, k2, k3));
- TEST_INSTRUCTION("C4E1ED47CB" , kxord(k1, k2, k3));
- TEST_INSTRUCTION("C4E1EC47CB" , kxorq(k1, k2, k3));
- TEST_INSTRUCTION("C5EC47CB" , kxorw(k1, k2, k3));
TEST_INSTRUCTION("9F" , lahf(ah));
TEST_INSTRUCTION("660F02CA" , lar(cx, dx));
TEST_INSTRUCTION("660F028C1A80000000" , lar(cx, ptr(rdx, rbx, 0, 128)));
@@ -884,13 +665,10 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66FF9C1180000000" , lcall(dword_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("FF9C1180000000" , lcall(fword_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("48FF9C1180000000" , lcall(tbyte_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0FAE941180000000" , ldmxcsr(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0FAE941180000000" , ldmxcsr(dword_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("668D8C1A80000000" , lea(cx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("8D8C1A80000000" , lea(ecx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("488D8C1A80000000" , lea(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("C9" , leave());
- TEST_INSTRUCTION("0FAEE8" , lfence());
TEST_INSTRUCTION("660FB48C1A80000000" , lfs(cx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("660FB48C1A80000000" , lfs(cx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("0FB48C1A80000000" , lfs(ecx, ptr(rdx, rbx, 0, 128)));
@@ -912,8 +690,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0F00D1" , lldt(cx));
TEST_INSTRUCTION("0F00941180000000" , lldt(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F00941180000000" , lldt(word_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("8FE97812C1" , llwpcb(ecx));
- TEST_INSTRUCTION("8FE9F812C1" , llwpcb(rcx));
TEST_INSTRUCTION("0F01F1" , lmsw(cx));
TEST_INSTRUCTION("0F01B41180000000" , lmsw(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F01B41180000000" , lmsw(word_ptr(rcx, rdx, 0, 128)));
@@ -943,31 +719,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0F00D9" , ltr(cx));
TEST_INSTRUCTION("0F009C1180000000" , ltr(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F009C1180000000" , ltr(word_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("8FEA7012C201000000" , lwpins(ecx, edx, 1));
- TEST_INSTRUCTION("8FEA7012841A8000000001000000" , lwpins(ecx, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FEA7012841A8000000001000000" , lwpins(ecx, dword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FEAF012C201000000" , lwpins(rcx, edx, 1));
- TEST_INSTRUCTION("8FEAF012841A8000000001000000" , lwpins(rcx, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FEAF012841A8000000001000000" , lwpins(rcx, dword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FEA7012CA01000000" , lwpval(ecx, edx, 1));
- TEST_INSTRUCTION("8FEA70128C1A8000000001000000" , lwpval(ecx, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FEA70128C1A8000000001000000" , lwpval(ecx, dword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FEAF012CA01000000" , lwpval(rcx, edx, 1));
- TEST_INSTRUCTION("8FEAF0128C1A8000000001000000" , lwpval(rcx, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FEAF0128C1A8000000001000000" , lwpval(rcx, dword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("66F30FBDCA" , lzcnt(cx, dx));
- TEST_INSTRUCTION("66F30FBD8C1A80000000" , lzcnt(cx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("66F30FBD8C1A80000000" , lzcnt(cx, word_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30FBDCA" , lzcnt(ecx, edx));
- TEST_INSTRUCTION("F30FBD8C1A80000000" , lzcnt(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30FBD8C1A80000000" , lzcnt(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F3480FBDCA" , lzcnt(rcx, rdx));
- TEST_INSTRUCTION("F3480FBD8C1A80000000" , lzcnt(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F3480FBD8C1A80000000" , lzcnt(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30F01FA" , mcommit());
- TEST_INSTRUCTION("0FAEF0" , mfence());
- TEST_INSTRUCTION("0F01C8" , monitor(ptr(rax), ecx, edx));
- TEST_INSTRUCTION("0F01FA" , monitorx(ptr(rax), ecx, edx));
TEST_INSTRUCTION("88D1" , mov(cl, dl));
TEST_INSTRUCTION("88F1" , mov(cl, dh));
TEST_INSTRUCTION("88D5" , mov(ch, dl));
@@ -1019,27 +770,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("8EA41A80000000" , mov(fs, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("668EA41A80000000" , mov(fs, word_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("48B90100000000000000" , movabs(rcx, 1));
- TEST_INSTRUCTION("660F38F08C1A80000000" , movbe(cx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("660F38F08C1A80000000" , movbe(cx, word_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("0F38F08C1A80000000" , movbe(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("0F38F08C1A80000000" , movbe(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("480F38F08C1A80000000" , movbe(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("480F38F08C1A80000000" , movbe(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("660F38F19C1180000000" , movbe(ptr(rcx, rdx, 0, 128), bx));
- TEST_INSTRUCTION("660F38F19C1180000000" , movbe(word_ptr(rcx, rdx, 0, 128), bx));
- TEST_INSTRUCTION("0F38F19C1180000000" , movbe(ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("0F38F19C1180000000" , movbe(dword_ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("480F38F19C1180000000" , movbe(ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("480F38F19C1180000000" , movbe(qword_ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("660F38F88C1A80000000" , movdir64b(zmmword_ptr(rcx), zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("0F38F99C1180000000" , movdiri(ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("0F38F99C1180000000" , movdiri(dword_ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("480F38F99C1180000000" , movdiri(ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("480F38F99C1180000000" , movdiri(qword_ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("0FC39C1180000000" , movnti(ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("0FC39C1180000000" , movnti(dword_ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("480FC39C1180000000" , movnti(ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("480FC39C1180000000" , movnti(qword_ptr(rcx, rdx, 0, 128), rbx));
TEST_INSTRUCTION("A4" , movs(byte_ptr(rdi), byte_ptr(rsi)));
TEST_INSTRUCTION("66A5" , movs(word_ptr(rdi), word_ptr(rsi)));
TEST_INSTRUCTION("A5" , movs(dword_ptr(rdi), dword_ptr(rsi)));
@@ -1090,14 +820,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("48F7E1" , mul(rdx, rax, rcx));
TEST_INSTRUCTION("48F7A41180000000" , mul(rdx, rax, ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("48F7A41180000000" , mul(rdx, rax, qword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("C4E26BF6CB" , mulx(ecx, edx, ebx, edx));
- TEST_INSTRUCTION("C4E26BF68C2B80000000" , mulx(ecx, edx, ptr(rbx, rbp, 0, 128), edx));
- TEST_INSTRUCTION("C4E26BF68C2B80000000" , mulx(ecx, edx, dword_ptr(rbx, rbp, 0, 128), edx));
- TEST_INSTRUCTION("C4E2EBF6CB" , mulx(rcx, rdx, rbx, rdx));
- TEST_INSTRUCTION("C4E2EBF68C2B80000000" , mulx(rcx, rdx, ptr(rbx, rbp, 0, 128), rdx));
- TEST_INSTRUCTION("C4E2EBF68C2B80000000" , mulx(rcx, rdx, qword_ptr(rbx, rbp, 0, 128), rdx));
- TEST_INSTRUCTION("0F01C9" , mwait(eax, ecx));
- TEST_INSTRUCTION("0F01FB" , mwaitx(eax, ecx, ebx));
TEST_INSTRUCTION("F6D9" , neg(cl));
TEST_INSTRUCTION("F6DD" , neg(ch));
TEST_INSTRUCTION("66F7D9" , neg(cx));
@@ -1178,48 +900,13 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("666F" , outs(dx, word_ptr(rsi)));
TEST_INSTRUCTION("6F" , outs(dx, dword_ptr(rsi)));
TEST_INSTRUCTION("F390" , pause());
- TEST_INSTRUCTION("0F01C5" , pconfig());
- TEST_INSTRUCTION("C4E26BF5CB" , pdep(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E26BF58C2B80000000" , pdep(ecx, edx, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26BF58C2B80000000" , pdep(ecx, edx, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EBF5CB" , pdep(rcx, rdx, rbx));
- TEST_INSTRUCTION("C4E2EBF58C2B80000000" , pdep(rcx, rdx, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EBF58C2B80000000" , pdep(rcx, rdx, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26AF5CB" , pext(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E26AF58C2B80000000" , pext(ecx, edx, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26AF58C2B80000000" , pext(ecx, edx, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EAF5CB" , pext(rcx, rdx, rbx));
- TEST_INSTRUCTION("C4E2EAF58C2B80000000" , pext(rcx, rdx, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EAF58C2B80000000" , pext(rcx, rdx, qword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("6659" , pop(cx));
TEST_INSTRUCTION("59" , pop(rcx));
TEST_INSTRUCTION("668F841180000000" , pop(word_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("8F841180000000" , pop(qword_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0FA1" , pop(fs));
- TEST_INSTRUCTION("66F30FB8CA" , popcnt(cx, dx));
- TEST_INSTRUCTION("66F30FB88C1A80000000" , popcnt(cx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("66F30FB88C1A80000000" , popcnt(cx, word_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30FB8CA" , popcnt(ecx, edx));
- TEST_INSTRUCTION("F30FB88C1A80000000" , popcnt(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30FB88C1A80000000" , popcnt(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F3480FB8CA" , popcnt(rcx, rdx));
- TEST_INSTRUCTION("F3480FB88C1A80000000" , popcnt(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F3480FB88C1A80000000" , popcnt(rcx, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("669D" , popf());
TEST_INSTRUCTION("9D" , popfq());
- TEST_INSTRUCTION("0F0D841180000000" , prefetch(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F18841180000000" , prefetchnta(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F188C1180000000" , prefetcht0(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F18941180000000" , prefetcht1(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F189C1180000000" , prefetcht2(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F0D8C1180000000" , prefetchw(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F0D941180000000" , prefetchwt1(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("F30F01FF" , psmash());
- TEST_INSTRUCTION("F30FAEE1" , ptwrite(ecx));
- TEST_INSTRUCTION("F3480FAEE1" , ptwrite(rcx));
- TEST_INSTRUCTION("F30FAEA41180000000" , ptwrite(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("F30FAEA41180000000" , ptwrite(dword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("F3480FAEA41180000000" , ptwrite(qword_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("6651" , push(cx));
TEST_INSTRUCTION("51" , push(rcx));
TEST_INSTRUCTION("6A01" , push(1));
@@ -1228,7 +915,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0FA0" , push(fs));
TEST_INSTRUCTION("669C" , pushf());
TEST_INSTRUCTION("9C" , pushfq());
- TEST_INSTRUCTION("F20F01FF" , pvalidate());
TEST_INSTRUCTION("D2D1" , rcl(cl, cl));
TEST_INSTRUCTION("D0D1" , rcl(cl, 1));
TEST_INSTRUCTION("D2D5" , rcl(ch, cl));
@@ -1265,31 +951,11 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("D19C1180000000" , rcr(dword_ptr(rcx, rdx, 0, 128), 1));
TEST_INSTRUCTION("48D39C1180000000" , rcr(qword_ptr(rcx, rdx, 0, 128), cl));
TEST_INSTRUCTION("48D19C1180000000" , rcr(qword_ptr(rcx, rdx, 0, 128), 1));
- TEST_INSTRUCTION("F30FAEC1" , rdfsbase(ecx));
- TEST_INSTRUCTION("F3480FAEC1" , rdfsbase(rcx));
- TEST_INSTRUCTION("F30FAEC9" , rdgsbase(ecx));
- TEST_INSTRUCTION("F3480FAEC9" , rdgsbase(rcx));
TEST_INSTRUCTION("0F32" , rdmsr(edx, eax, ecx));
- TEST_INSTRUCTION("F30FC7F9" , rdpid(rcx));
- TEST_INSTRUCTION("0F01EE" , rdpkru(edx, eax, ecx));
- TEST_INSTRUCTION("0F33" , rdpmc(edx, eax, ecx));
- TEST_INSTRUCTION("0F01FD" , rdpru(edx, eax, ecx));
- TEST_INSTRUCTION("660FC7F1" , rdrand(cx));
- TEST_INSTRUCTION("0FC7F1" , rdrand(ecx));
- TEST_INSTRUCTION("480FC7F1" , rdrand(rcx));
- TEST_INSTRUCTION("660FC7F9" , rdseed(cx));
- TEST_INSTRUCTION("0FC7F9" , rdseed(ecx));
- TEST_INSTRUCTION("480FC7F9" , rdseed(rcx));
- TEST_INSTRUCTION("F30F1EC9" , rdsspd(ecx));
- TEST_INSTRUCTION("F3480F1EC9" , rdsspq(rcx));
- TEST_INSTRUCTION("0F31" , rdtsc(edx, eax));
- TEST_INSTRUCTION("0F01F9" , rdtscp(edx, eax, ecx));
TEST_INSTRUCTION("C3" , ret());
TEST_INSTRUCTION("C20100" , ret(1));
TEST_INSTRUCTION("CB" , retf());
TEST_INSTRUCTION("CA0100" , retf(1));
- TEST_INSTRUCTION("F30F01FE" , rmpadjust());
- TEST_INSTRUCTION("F20F01FE" , rmpupdate());
TEST_INSTRUCTION("D2C1" , rol(cl, cl));
TEST_INSTRUCTION("D0C1" , rol(cl, 1));
TEST_INSTRUCTION("D2C5" , rol(ch, cl));
@@ -1326,12 +992,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("D18C1180000000" , ror(dword_ptr(rcx, rdx, 0, 128), 1));
TEST_INSTRUCTION("48D38C1180000000" , ror(qword_ptr(rcx, rdx, 0, 128), cl));
TEST_INSTRUCTION("48D18C1180000000" , ror(qword_ptr(rcx, rdx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37BF0CA01" , rorx(ecx, edx, 1));
- TEST_INSTRUCTION("C4E37BF08C1A8000000001" , rorx(ecx, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37BF08C1A8000000001" , rorx(ecx, dword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3FBF0CA01" , rorx(rcx, rdx, 1));
- TEST_INSTRUCTION("C4E3FBF08C1A8000000001" , rorx(rcx, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3FBF08C1A8000000001" , rorx(rcx, qword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("9E" , sahf(ah));
TEST_INSTRUCTION("D2E1" , sal(cl, cl));
TEST_INSTRUCTION("D0E1" , sal(cl, 1));
@@ -1369,13 +1029,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("D1BC1180000000" , sar(dword_ptr(rcx, rdx, 0, 128), 1));
TEST_INSTRUCTION("48D3BC1180000000" , sar(qword_ptr(rcx, rdx, 0, 128), cl));
TEST_INSTRUCTION("48D1BC1180000000" , sar(qword_ptr(rcx, rdx, 0, 128), 1));
- TEST_INSTRUCTION("C4E262F7CA" , sarx(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E25AF78C1A80000000" , sarx(ecx, ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E25AF78C1A80000000" , sarx(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E2E2F7CA" , sarx(rcx, rdx, rbx));
- TEST_INSTRUCTION("C4E2DAF78C1A80000000" , sarx(rcx, ptr(rdx, rbx, 0, 128), rsp));
- TEST_INSTRUCTION("C4E2DAF78C1A80000000" , sarx(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
- TEST_INSTRUCTION("F30F01EA" , saveprevssp());
TEST_INSTRUCTION("80D901" , sbb(cl, 1));
TEST_INSTRUCTION("80DD01" , sbb(ch, 1));
TEST_INSTRUCTION("809C118000000001" , sbb(byte_ptr(rcx, rdx, 0, 128), 1));
@@ -1420,8 +1073,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("AF" , scas(eax, dword_ptr(rdi)));
TEST_INSTRUCTION("48AF" , scas(rax, ptr(rdi)));
TEST_INSTRUCTION("48AF" , scas(rax, qword_ptr(rdi)));
- TEST_INSTRUCTION("F30FC7F1" , senduipi(rcx));
- TEST_INSTRUCTION("0F01E8" , serialize());
TEST_INSTRUCTION("0F97C1" , seta(cl));
TEST_INSTRUCTION("0F97C5" , seta(ch));
TEST_INSTRUCTION("0F97841180000000" , seta(ptr(rcx, rdx, 0, 128)));
@@ -1538,12 +1189,10 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0F98C5" , sets(ch));
TEST_INSTRUCTION("0F98841180000000" , sets(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F98841180000000" , sets(byte_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("F30F01E8" , setssbsy());
TEST_INSTRUCTION("0F94C1" , setz(cl));
TEST_INSTRUCTION("0F94C5" , setz(ch));
TEST_INSTRUCTION("0F94841180000000" , setz(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F94841180000000" , setz(byte_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0FAEF8" , sfence());
TEST_INSTRUCTION("0F01841180000000" , sgdt(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("D2E1" , shl(cl, cl));
TEST_INSTRUCTION("D0E1" , shl(cl, 1));
@@ -1581,12 +1230,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("480FA49C118000000001" , shld(ptr(rcx, rdx, 0, 128), rbx, 1));
TEST_INSTRUCTION("480FA59C1180000000" , shld(qword_ptr(rcx, rdx, 0, 128), rbx, cl));
TEST_INSTRUCTION("480FA49C118000000001" , shld(qword_ptr(rcx, rdx, 0, 128), rbx, 1));
- TEST_INSTRUCTION("C4E261F7CA" , shlx(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E259F78C1A80000000" , shlx(ecx, ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E259F78C1A80000000" , shlx(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E2E1F7CA" , shlx(rcx, rdx, rbx));
- TEST_INSTRUCTION("C4E2D9F78C1A80000000" , shlx(rcx, ptr(rdx, rbx, 0, 128), rsp));
- TEST_INSTRUCTION("C4E2D9F78C1A80000000" , shlx(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
TEST_INSTRUCTION("D2E9" , shr(cl, cl));
TEST_INSTRUCTION("D0E9" , shr(cl, 1));
TEST_INSTRUCTION("D2ED" , shr(ch, cl));
@@ -1623,33 +1266,20 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("480FAC9C118000000001" , shrd(ptr(rcx, rdx, 0, 128), rbx, 1));
TEST_INSTRUCTION("480FAD9C1180000000" , shrd(qword_ptr(rcx, rdx, 0, 128), rbx, cl));
TEST_INSTRUCTION("480FAC9C118000000001" , shrd(qword_ptr(rcx, rdx, 0, 128), rbx, 1));
- TEST_INSTRUCTION("C4E263F7CA" , shrx(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E25BF78C1A80000000" , shrx(ecx, ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E25BF78C1A80000000" , shrx(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
- TEST_INSTRUCTION("C4E2E3F7CA" , shrx(rcx, rdx, rbx));
- TEST_INSTRUCTION("C4E2DBF78C1A80000000" , shrx(rcx, ptr(rdx, rbx, 0, 128), rsp));
- TEST_INSTRUCTION("C4E2DBF78C1A80000000" , shrx(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
TEST_INSTRUCTION("0F018C1180000000" , sidt(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F01DE" , skinit(eax));
TEST_INSTRUCTION("660F00C1" , sldt(cx));
TEST_INSTRUCTION("0F00C1" , sldt(ecx));
TEST_INSTRUCTION("480F00C1" , sldt(rcx));
TEST_INSTRUCTION("0F00841180000000" , sldt(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F00841180000000" , sldt(word_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("8FE97812C9" , slwpcb(ecx));
- TEST_INSTRUCTION("8FE9F812C9" , slwpcb(rcx));
TEST_INSTRUCTION("660F01E1" , smsw(cx));
TEST_INSTRUCTION("0F01E1" , smsw(ecx));
TEST_INSTRUCTION("480F01E1" , smsw(rcx));
TEST_INSTRUCTION("0F01A41180000000" , smsw(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F01A41180000000" , smsw(word_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F01CB" , stac());
TEST_INSTRUCTION("F9" , stc());
TEST_INSTRUCTION("FD" , std());
- TEST_INSTRUCTION("0F01DC" , stgi());
TEST_INSTRUCTION("FB" , sti());
- TEST_INSTRUCTION("0FAE9C1180000000" , stmxcsr(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0FAE9C1180000000" , stmxcsr(dword_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("AA" , stos(ptr(rdi), al));
TEST_INSTRUCTION("AA" , stos(byte_ptr(rdi), al));
TEST_INSTRUCTION("66AB" , stos(ptr(rdi), ax));
@@ -1663,7 +1293,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("480F00C9" , str(rcx));
TEST_INSTRUCTION("0F008C1180000000" , str(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F008C1180000000" , str(word_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("F30F01EF" , stui());
TEST_INSTRUCTION("80E901" , sub(cl, 1));
TEST_INSTRUCTION("80ED01" , sub(ch, 1));
TEST_INSTRUCTION("80AC118000000001" , sub(byte_ptr(rcx, rdx, 0, 128), 1));
@@ -1700,19 +1329,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("2B8C1A80000000" , sub(ecx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("482B8C1A80000000" , sub(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("482B8C1A80000000" , sub(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("0F01F8" , swapgs());
- TEST_INSTRUCTION("0F05" , syscall());
- TEST_INSTRUCTION("0F34" , sysenter());
- TEST_INSTRUCTION("0F35" , sysexit());
- TEST_INSTRUCTION("480F35" , sysexitq());
- TEST_INSTRUCTION("0F07" , sysret());
- TEST_INSTRUCTION("480F07" , sysretq());
- TEST_INSTRUCTION("8FE97001FA" , t1mskc(ecx, edx));
- TEST_INSTRUCTION("8FE97001BC1A80000000" , t1mskc(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001BC1A80000000" , t1mskc(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001FA" , t1mskc(rcx, rdx));
- TEST_INSTRUCTION("8FE9F001BC1A80000000" , t1mskc(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001BC1A80000000" , t1mskc(rcx, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("F6C101" , test(cl, 1));
TEST_INSTRUCTION("F6C501" , test(ch, 1));
TEST_INSTRUCTION("F684118000000001" , test(byte_ptr(rcx, rdx, 0, 128), 1));
@@ -1739,23 +1355,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("85D1" , test(ecx, edx));
TEST_INSTRUCTION("859C1180000000" , test(ptr(rcx, rdx, 0, 128), ebx));
TEST_INSTRUCTION("859C1180000000" , test(dword_ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("F30F01ED" , testui());
- TEST_INSTRUCTION("660FAEF1" , tpause(ecx, edx, eax));
- TEST_INSTRUCTION("66F30FBCCA" , tzcnt(cx, dx));
- TEST_INSTRUCTION("66F30FBC8C1A80000000" , tzcnt(cx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("66F30FBC8C1A80000000" , tzcnt(cx, word_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30FBCCA" , tzcnt(ecx, edx));
- TEST_INSTRUCTION("F30FBC8C1A80000000" , tzcnt(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30FBC8C1A80000000" , tzcnt(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F3480FBCCA" , tzcnt(rcx, rdx));
- TEST_INSTRUCTION("F3480FBC8C1A80000000" , tzcnt(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F3480FBC8C1A80000000" , tzcnt(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001E2" , tzmsk(ecx, edx));
- TEST_INSTRUCTION("8FE97001A41A80000000" , tzmsk(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97001A41A80000000" , tzmsk(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001E2" , tzmsk(rcx, rdx));
- TEST_INSTRUCTION("8FE9F001A41A80000000" , tzmsk(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE9F001A41A80000000" , tzmsk(rcx, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("0FFFCA" , ud0(ecx, edx));
TEST_INSTRUCTION("0FFF8C1A80000000" , ud0(ecx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("0FFF8C1A80000000" , ud0(ecx, dword_ptr(rdx, rbx, 0, 128)));
@@ -1764,55 +1363,14 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0FB98C1A80000000" , ud1(ecx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("0F0B" , ud2());
TEST_INSTRUCTION("F30F01EC" , uiret());
- TEST_INSTRUCTION("F30FAEF1" , umonitor(ptr(rcx)));
- TEST_INSTRUCTION("F20FAEF1" , umwait(ecx, edx, eax));
TEST_INSTRUCTION("0F00E1" , verr(cx));
TEST_INSTRUCTION("0F00A41180000000" , verr(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F00A41180000000" , verr(word_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F00E9" , verw(cx));
TEST_INSTRUCTION("0F00AC1180000000" , verw(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F00AC1180000000" , verw(word_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F01C1" , vmcall());
- TEST_INSTRUCTION("660FC7B41180000000" , vmclear(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("660FC7B41180000000" , vmclear(qword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F01D4" , vmfunc());
- TEST_INSTRUCTION("0F01C2" , vmlaunch());
- TEST_INSTRUCTION("0F01DA" , vmload(rax));
- TEST_INSTRUCTION("0F01D9" , vmmcall());
- TEST_INSTRUCTION("0FC7B41180000000" , vmptrld(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0FC7B41180000000" , vmptrld(qword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0FC7BC1180000000" , vmptrst(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0FC7BC1180000000" , vmptrst(qword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("0F78D1" , vmread(rcx, rdx));
- TEST_INSTRUCTION("0F789C1180000000" , vmread(ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("0F789C1180000000" , vmread(qword_ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("0F01C3" , vmresume());
- TEST_INSTRUCTION("0F01D8" , vmrun(rax));
- TEST_INSTRUCTION("0F01DB" , vmsave(rax));
- TEST_INSTRUCTION("0F79CA" , vmwrite(rcx, rdx));
- TEST_INSTRUCTION("0F798C1A80000000" , vmwrite(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("0F798C1A80000000" , vmwrite(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("F30FC7B41180000000" , vmxon(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("F30FC7B41180000000" , vmxon(qword_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("0F09" , wbinvd());
- TEST_INSTRUCTION("F30F09" , wbnoinvd());
- TEST_INSTRUCTION("F30FAED1" , wrfsbase(ecx));
- TEST_INSTRUCTION("F3480FAED1" , wrfsbase(rcx));
- TEST_INSTRUCTION("F30FAED9" , wrgsbase(ecx));
- TEST_INSTRUCTION("F3480FAED9" , wrgsbase(rcx));
TEST_INSTRUCTION("0F30" , wrmsr(edx, eax, ecx));
- TEST_INSTRUCTION("0F38F6D1" , wrssd(ecx, edx));
- TEST_INSTRUCTION("0F38F69C1180000000" , wrssd(ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("0F38F69C1180000000" , wrssd(dword_ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("480F38F6D1" , wrssq(rcx, rdx));
- TEST_INSTRUCTION("480F38F69C1180000000" , wrssq(ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("480F38F69C1180000000" , wrssq(qword_ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("660F38F5D1" , wrussd(ecx, edx));
- TEST_INSTRUCTION("660F38F59C1180000000" , wrussd(ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("660F38F59C1180000000" , wrussd(dword_ptr(rcx, rdx, 0, 128), ebx));
- TEST_INSTRUCTION("66480F38F5D1" , wrussq(rcx, rdx));
- TEST_INSTRUCTION("66480F38F59C1180000000" , wrussq(ptr(rcx, rdx, 0, 128), rbx));
- TEST_INSTRUCTION("66480F38F59C1180000000" , wrussq(qword_ptr(rcx, rdx, 0, 128), rbx));
TEST_INSTRUCTION("C6F801" , xabort(1));
TEST_INSTRUCTION("0FC0D1" , xadd(cl, dl));
TEST_INSTRUCTION("0FC0F1" , xadd(cl, dh));
@@ -1858,8 +1416,6 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("878C1A80000000" , xchg(ecx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("48878C1A80000000" , xchg(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("48878C1A80000000" , xchg(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("0F01D5" , xend());
- TEST_INSTRUCTION("0F01D0" , xgetbv(edx, eax, ecx));
TEST_INSTRUCTION("D7" , xlatb());
TEST_INSTRUCTION("80F101" , xor_(cl, 1));
TEST_INSTRUCTION("80F501" , xor_(ch, 1));
@@ -1897,6 +1453,461 @@ static void ASMJIT_NOINLINE testX64AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("338C1A80000000" , xor_(ecx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("48338C1A80000000" , xor_(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("48338C1A80000000" , xor_(rcx, qword_ptr(rdx, rbx, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerBaseExt(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("0F38FC9C1180000000" , aadd(ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F38FC9C1180000000" , aadd(dword_ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("480F38FC9C1180000000" , aadd(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("480F38FC9C1180000000" , aadd(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("660F38FC9C1180000000" , aand(ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("660F38FC9C1180000000" , aand(dword_ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("66480F38FC9C1180000000" , aand(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("66480F38FC9C1180000000" , aand(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("660F38F6CA" , adcx(ecx, edx));
+ TEST_INSTRUCTION("660F38F68C1A80000000" , adcx(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("660F38F68C1A80000000" , adcx(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("66480F38F6CA" , adcx(rcx, rdx));
+ TEST_INSTRUCTION("66480F38F68C1A80000000" , adcx(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("66480F38F68C1A80000000" , adcx(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30F38F6CA" , adox(ecx, edx));
+ TEST_INSTRUCTION("F30F38F68C1A80000000" , adox(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30F38F68C1A80000000" , adox(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F3480F38F6CA" , adox(rcx, rdx));
+ TEST_INSTRUCTION("F3480F38F68C1A80000000" , adox(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F3480F38F68C1A80000000" , adox(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E268F2CB" , andn(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E268F28C2B80000000" , andn(ecx, edx, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E268F28C2B80000000" , andn(ecx, edx, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E8F2CB" , andn(rcx, rdx, rbx));
+ TEST_INSTRUCTION("C4E2E8F28C2B80000000" , andn(rcx, rdx, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E8F28C2B80000000" , andn(rcx, rdx, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("F20F38FC9C1180000000" , aor(ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("F20F38FC9C1180000000" , aor(dword_ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("F2480F38FC9C1180000000" , aor(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("F2480F38FC9C1180000000" , aor(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("F30F38FC9C1180000000" , axor(ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("F30F38FC9C1180000000" , axor(dword_ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("F3480F38FC9C1180000000" , axor(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("F3480F38FC9C1180000000" , axor(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("C4E260F7CA" , bextr(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E258F78C1A80000000" , bextr(ecx, ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E258F78C1A80000000" , bextr(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E2E0F7CA" , bextr(rcx, rdx, rbx));
+ TEST_INSTRUCTION("C4E2D8F78C1A80000000" , bextr(rcx, ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("C4E2D8F78C1A80000000" , bextr(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("8FE97001CA" , blcfill(ecx, edx));
+ TEST_INSTRUCTION("8FE970018C1A80000000" , blcfill(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE970018C1A80000000" , blcfill(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001CA" , blcfill(rcx, rdx));
+ TEST_INSTRUCTION("8FE9F0018C1A80000000" , blcfill(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F0018C1A80000000" , blcfill(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97002F2" , blci(ecx, edx));
+ TEST_INSTRUCTION("8FE97002B41A80000000" , blci(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97002B41A80000000" , blci(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F002F2" , blci(rcx, rdx));
+ TEST_INSTRUCTION("8FE9F002B41A80000000" , blci(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F002B41A80000000" , blci(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001EA" , blcic(ecx, edx));
+ TEST_INSTRUCTION("8FE97001AC1A80000000" , blcic(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001AC1A80000000" , blcic(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001EA" , blcic(rcx, rdx));
+ TEST_INSTRUCTION("8FE9F001AC1A80000000" , blcic(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001AC1A80000000" , blcic(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97002CA" , blcmsk(ecx, edx));
+ TEST_INSTRUCTION("8FE970028C1A80000000" , blcmsk(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE970028C1A80000000" , blcmsk(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F002CA" , blcmsk(rcx, rdx));
+ TEST_INSTRUCTION("8FE9F0028C1A80000000" , blcmsk(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F0028C1A80000000" , blcmsk(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001DA" , blcs(ecx, edx));
+ TEST_INSTRUCTION("8FE970019C1A80000000" , blcs(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE970019C1A80000000" , blcs(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001DA" , blcs(rcx, rdx));
+ TEST_INSTRUCTION("8FE9F0019C1A80000000" , blcs(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F0019C1A80000000" , blcs(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001D2" , blsfill(ecx, edx));
+ TEST_INSTRUCTION("8FE97001941A80000000" , blsfill(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001941A80000000" , blsfill(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001D2" , blsfill(rcx, rdx));
+ TEST_INSTRUCTION("8FE9F001941A80000000" , blsfill(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001941A80000000" , blsfill(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F3DA" , blsi(ecx, edx));
+ TEST_INSTRUCTION("C4E270F39C1A80000000" , blsi(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F39C1A80000000" , blsi(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2F0F3DA" , blsi(rcx, rdx));
+ TEST_INSTRUCTION("C4E2F0F39C1A80000000" , blsi(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2F0F39C1A80000000" , blsi(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001F2" , blsic(ecx, edx));
+ TEST_INSTRUCTION("8FE97001B41A80000000" , blsic(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001B41A80000000" , blsic(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001F2" , blsic(rcx, rdx));
+ TEST_INSTRUCTION("8FE9F001B41A80000000" , blsic(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001B41A80000000" , blsic(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F3D2" , blsmsk(ecx, edx));
+ TEST_INSTRUCTION("C4E270F3941A80000000" , blsmsk(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F3941A80000000" , blsmsk(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2F0F3D2" , blsmsk(rcx, rdx));
+ TEST_INSTRUCTION("C4E2F0F3941A80000000" , blsmsk(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2F0F3941A80000000" , blsmsk(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F3CA" , blsr(ecx, edx));
+ TEST_INSTRUCTION("C4E270F38C1A80000000" , blsr(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F38C1A80000000" , blsr(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2F0F3CA" , blsr(rcx, rdx));
+ TEST_INSTRUCTION("C4E2F0F38C1A80000000" , blsr(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2F0F38C1A80000000" , blsr(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30F1ACA" , bndcl(bnd1, rdx));
+ TEST_INSTRUCTION("F30F1A8C1A80000000" , bndcl(bnd1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30F1A8C1A80000000" , bndcl(bnd1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F20F1BCA" , bndcn(bnd1, rdx));
+ TEST_INSTRUCTION("F20F1B8C1A80000000" , bndcn(bnd1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F20F1B8C1A80000000" , bndcn(bnd1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F20F1ACA" , bndcu(bnd1, rdx));
+ TEST_INSTRUCTION("F20F1A8C1A80000000" , bndcu(bnd1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F20F1A8C1A80000000" , bndcu(bnd1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("0F1A8C1A80000000" , bndldx(bnd1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30F1B8C1A80000000" , bndmk(bnd1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("660F1ACA" , bndmov(bnd1, bnd2));
+ TEST_INSTRUCTION("660F1A8C1A80000000" , bndmov(bnd1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("660F1B9C1180000000" , bndmov(ptr(rcx, rdx, 0, 128), bnd3));
+ TEST_INSTRUCTION("0F1B9C1180000000" , bndstx(ptr(rcx, rdx, 0, 128), bnd3));
+ TEST_INSTRUCTION("C4E260F5CA" , bzhi(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E258F58C1A80000000" , bzhi(ecx, ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E258F58C1A80000000" , bzhi(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E2E0F5CA" , bzhi(rcx, rdx, rbx));
+ TEST_INSTRUCTION("C4E2D8F58C1A80000000" , bzhi(rcx, ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("C4E2D8F58C1A80000000" , bzhi(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("0F01CA" , clac());
+ TEST_INSTRUCTION("0F1C841180000000" , cldemote(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0FAEBC1180000000" , clflush(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("660FAEBC1180000000" , clflushopt(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F01DD" , clgi());
+ TEST_INSTRUCTION("F30FAEB41180000000" , clrssbsy(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("F30FAEB41180000000" , clrssbsy(qword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F06" , clts());
+ TEST_INSTRUCTION("F30F01EE" , clui());
+ TEST_INSTRUCTION("660FAEB41180000000" , clwb(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F01FC" , clzero(ptr(rax)));
+ TEST_INSTRUCTION("0F01FC" , clzero(zmmword_ptr(rax)));
+ TEST_INSTRUCTION("C4E259E69C1180000000" , cmpbexadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E69C1180000000" , cmpbexadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9E69C1180000000" , cmpbexadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9E69C1180000000" , cmpbexadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259E29C1180000000" , cmpbxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E29C1180000000" , cmpbxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9E29C1180000000" , cmpbxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9E29C1180000000" , cmpbxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259EE9C1180000000" , cmplexadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EE9C1180000000" , cmplexadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9EE9C1180000000" , cmplexadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9EE9C1180000000" , cmplexadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259EC9C1180000000" , cmplxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EC9C1180000000" , cmplxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9EC9C1180000000" , cmplxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9EC9C1180000000" , cmplxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259E79C1180000000" , cmpnbexadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E79C1180000000" , cmpnbexadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9E79C1180000000" , cmpnbexadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9E79C1180000000" , cmpnbexadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259E39C1180000000" , cmpnbxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E39C1180000000" , cmpnbxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9E39C1180000000" , cmpnbxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9E39C1180000000" , cmpnbxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259EF9C1180000000" , cmpnlexadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EF9C1180000000" , cmpnlexadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9EF9C1180000000" , cmpnlexadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9EF9C1180000000" , cmpnlexadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259ED9C1180000000" , cmpnlxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259ED9C1180000000" , cmpnlxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9ED9C1180000000" , cmpnlxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9ED9C1180000000" , cmpnlxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259E19C1180000000" , cmpnoxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E19C1180000000" , cmpnoxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9E19C1180000000" , cmpnoxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9E19C1180000000" , cmpnoxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259EB9C1180000000" , cmpnpxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EB9C1180000000" , cmpnpxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9EB9C1180000000" , cmpnpxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9EB9C1180000000" , cmpnpxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259E99C1180000000" , cmpnsxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E99C1180000000" , cmpnsxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9E99C1180000000" , cmpnsxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9E99C1180000000" , cmpnsxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259E59C1180000000" , cmpnzxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E59C1180000000" , cmpnzxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9E59C1180000000" , cmpnzxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9E59C1180000000" , cmpnzxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259E09C1180000000" , cmpoxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E09C1180000000" , cmpoxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9E09C1180000000" , cmpoxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9E09C1180000000" , cmpoxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259EA9C1180000000" , cmppxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EA9C1180000000" , cmppxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9EA9C1180000000" , cmppxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9EA9C1180000000" , cmppxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E259E89C1180000000" , cmpsxadd(ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E89C1180000000" , cmpsxadd(dword_ptr(rcx, rdx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E2D9E89C1180000000" , cmpsxadd(ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("C4E2D9E89C1180000000" , cmpsxadd(qword_ptr(rcx, rdx, 0, 128), rbx, rsp));
+ TEST_INSTRUCTION("F20F38F0CA" , crc32(ecx, dl));
+ TEST_INSTRUCTION("F20F38F0CE" , crc32(ecx, dh));
+ TEST_INSTRUCTION("66F20F38F1CA" , crc32(ecx, dx));
+ TEST_INSTRUCTION("F20F38F1CA" , crc32(ecx, edx));
+ TEST_INSTRUCTION("F20F38F08C1A80000000" , crc32(ecx, byte_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("66F20F38F18C1A80000000" , crc32(ecx, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F20F38F18C1A80000000" , crc32(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F2480F38F0CA" , crc32(rcx, dl));
+ TEST_INSTRUCTION("F2480F38F1CA" , crc32(rcx, rdx));
+ TEST_INSTRUCTION("F2480F38F08C1A80000000" , crc32(rcx, byte_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F2480F38F18C1A80000000" , crc32(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30F1EFB" , endbr32());
+ TEST_INSTRUCTION("F30F1EFA" , endbr64());
+ TEST_INSTRUCTION("F20F38F88C1A80000000" , enqcmd(zmmword_ptr(rcx), zmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30F38F88C1A80000000" , enqcmds(zmmword_ptr(rcx), zmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("0FAE8C1180000000" , fxrstor(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("480FAE8C1180000000" , fxrstor64(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0FAE841180000000" , fxsave(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("480FAE841180000000" , fxsave64(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("D9F4" , fxtract());
+ TEST_INSTRUCTION("0F37" , getsec());
+ TEST_INSTRUCTION("F30F3AF0C001" , hreset(1, eax));
+ TEST_INSTRUCTION("F30FAEE9" , incsspd(ecx));
+ TEST_INSTRUCTION("F3480FAEE9" , incsspq(rcx));
+ TEST_INSTRUCTION("660F38808C1A80000000" , invept(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("660F38808C1A80000000" , invept(rcx, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("670F01DF" , invlpga(eax, ecx));
+ TEST_INSTRUCTION("0F01DF" , invlpga(rax, ecx));
+ TEST_INSTRUCTION("660F38818C1A80000000" , invvpid(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("660F38818C1A80000000" , invvpid(rcx, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("0FAE941180000000" , ldmxcsr(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0FAE941180000000" , ldmxcsr(dword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0FAEE8" , lfence());
+ TEST_INSTRUCTION("8FE97812C1" , llwpcb(ecx));
+ TEST_INSTRUCTION("8FE9F812C1" , llwpcb(rcx));
+ TEST_INSTRUCTION("8FEA7012C201000000" , lwpins(ecx, edx, 1));
+ TEST_INSTRUCTION("8FEA7012841A8000000001000000" , lwpins(ecx, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEA7012841A8000000001000000" , lwpins(ecx, dword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEAF012C201000000" , lwpins(rcx, edx, 1));
+ TEST_INSTRUCTION("8FEAF012841A8000000001000000" , lwpins(rcx, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEAF012841A8000000001000000" , lwpins(rcx, dword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEA7012CA01000000" , lwpval(ecx, edx, 1));
+ TEST_INSTRUCTION("8FEA70128C1A8000000001000000" , lwpval(ecx, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEA70128C1A8000000001000000" , lwpval(ecx, dword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEAF012CA01000000" , lwpval(rcx, edx, 1));
+ TEST_INSTRUCTION("8FEAF0128C1A8000000001000000" , lwpval(rcx, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEAF0128C1A8000000001000000" , lwpval(rcx, dword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("66F30FBDCA" , lzcnt(cx, dx));
+ TEST_INSTRUCTION("66F30FBD8C1A80000000" , lzcnt(cx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("66F30FBD8C1A80000000" , lzcnt(cx, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30FBDCA" , lzcnt(ecx, edx));
+ TEST_INSTRUCTION("F30FBD8C1A80000000" , lzcnt(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30FBD8C1A80000000" , lzcnt(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F3480FBDCA" , lzcnt(rcx, rdx));
+ TEST_INSTRUCTION("F3480FBD8C1A80000000" , lzcnt(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F3480FBD8C1A80000000" , lzcnt(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30F01FA" , mcommit());
+ TEST_INSTRUCTION("0FAEF0" , mfence());
+ TEST_INSTRUCTION("0F01C8" , monitor(ptr(rax), ecx, edx));
+ TEST_INSTRUCTION("0F01FA" , monitorx(ptr(rax), ecx, edx));
+ TEST_INSTRUCTION("660F38F08C1A80000000" , movbe(cx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("660F38F08C1A80000000" , movbe(cx, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("0F38F08C1A80000000" , movbe(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("0F38F08C1A80000000" , movbe(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("480F38F08C1A80000000" , movbe(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("480F38F08C1A80000000" , movbe(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("660F38F19C1180000000" , movbe(ptr(rcx, rdx, 0, 128), bx));
+ TEST_INSTRUCTION("660F38F19C1180000000" , movbe(word_ptr(rcx, rdx, 0, 128), bx));
+ TEST_INSTRUCTION("0F38F19C1180000000" , movbe(ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F38F19C1180000000" , movbe(dword_ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("480F38F19C1180000000" , movbe(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("480F38F19C1180000000" , movbe(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("660F38F88C1A80000000" , movdir64b(zmmword_ptr(rcx), zmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("0F38F99C1180000000" , movdiri(ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F38F99C1180000000" , movdiri(dword_ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("480F38F99C1180000000" , movdiri(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("480F38F99C1180000000" , movdiri(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("0FC39C1180000000" , movnti(ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("0FC39C1180000000" , movnti(dword_ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("480FC39C1180000000" , movnti(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("480FC39C1180000000" , movnti(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("C4E26BF6CB" , mulx(ecx, edx, ebx, edx));
+ TEST_INSTRUCTION("C4E26BF68C2B80000000" , mulx(ecx, edx, ptr(rbx, rbp, 0, 128), edx));
+ TEST_INSTRUCTION("C4E26BF68C2B80000000" , mulx(ecx, edx, dword_ptr(rbx, rbp, 0, 128), edx));
+ TEST_INSTRUCTION("C4E2EBF6CB" , mulx(rcx, rdx, rbx, rdx));
+ TEST_INSTRUCTION("C4E2EBF68C2B80000000" , mulx(rcx, rdx, ptr(rbx, rbp, 0, 128), rdx));
+ TEST_INSTRUCTION("C4E2EBF68C2B80000000" , mulx(rcx, rdx, qword_ptr(rbx, rbp, 0, 128), rdx));
+ TEST_INSTRUCTION("0F01C9" , mwait(eax, ecx));
+ TEST_INSTRUCTION("0F01FB" , mwaitx(eax, ecx, ebx));
+ TEST_INSTRUCTION("0F01C5" , pconfig());
+ TEST_INSTRUCTION("C4E26BF5CB" , pdep(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E26BF58C2B80000000" , pdep(ecx, edx, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26BF58C2B80000000" , pdep(ecx, edx, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EBF5CB" , pdep(rcx, rdx, rbx));
+ TEST_INSTRUCTION("C4E2EBF58C2B80000000" , pdep(rcx, rdx, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EBF58C2B80000000" , pdep(rcx, rdx, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AF5CB" , pext(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E26AF58C2B80000000" , pext(ecx, edx, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AF58C2B80000000" , pext(ecx, edx, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EAF5CB" , pext(rcx, rdx, rbx));
+ TEST_INSTRUCTION("C4E2EAF58C2B80000000" , pext(rcx, rdx, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EAF58C2B80000000" , pext(rcx, rdx, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("66F30FB8CA" , popcnt(cx, dx));
+ TEST_INSTRUCTION("66F30FB88C1A80000000" , popcnt(cx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("66F30FB88C1A80000000" , popcnt(cx, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30FB8CA" , popcnt(ecx, edx));
+ TEST_INSTRUCTION("F30FB88C1A80000000" , popcnt(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30FB88C1A80000000" , popcnt(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F3480FB8CA" , popcnt(rcx, rdx));
+ TEST_INSTRUCTION("F3480FB88C1A80000000" , popcnt(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F3480FB88C1A80000000" , popcnt(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("0F0D841180000000" , prefetch(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F18BC1180000000" , prefetchit0(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F18B41180000000" , prefetchit1(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F18841180000000" , prefetchnta(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F188C1180000000" , prefetcht0(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F18941180000000" , prefetcht1(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F189C1180000000" , prefetcht2(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F0D8C1180000000" , prefetchw(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F0D941180000000" , prefetchwt1(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("F30F01FF" , psmash());
+ TEST_INSTRUCTION("F30FAEE1" , ptwrite(ecx));
+ TEST_INSTRUCTION("F3480FAEE1" , ptwrite(rcx));
+ TEST_INSTRUCTION("F30FAEA41180000000" , ptwrite(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("F30FAEA41180000000" , ptwrite(dword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("F3480FAEA41180000000" , ptwrite(qword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("F20F01FF" , pvalidate());
+ TEST_INSTRUCTION("F30FAEC1" , rdfsbase(ecx));
+ TEST_INSTRUCTION("F3480FAEC1" , rdfsbase(rcx));
+ TEST_INSTRUCTION("F30FAEC9" , rdgsbase(ecx));
+ TEST_INSTRUCTION("F3480FAEC9" , rdgsbase(rcx));
+ TEST_INSTRUCTION("F30FC7F9" , rdpid(rcx));
+ TEST_INSTRUCTION("0F01EE" , rdpkru(edx, eax, ecx));
+ TEST_INSTRUCTION("0F33" , rdpmc(edx, eax, ecx));
+ TEST_INSTRUCTION("0F01FD" , rdpru(edx, eax, ecx));
+ TEST_INSTRUCTION("660FC7F1" , rdrand(cx));
+ TEST_INSTRUCTION("0FC7F1" , rdrand(ecx));
+ TEST_INSTRUCTION("480FC7F1" , rdrand(rcx));
+ TEST_INSTRUCTION("660FC7F9" , rdseed(cx));
+ TEST_INSTRUCTION("0FC7F9" , rdseed(ecx));
+ TEST_INSTRUCTION("480FC7F9" , rdseed(rcx));
+ TEST_INSTRUCTION("F30F1EC9" , rdsspd(ecx));
+ TEST_INSTRUCTION("F3480F1EC9" , rdsspq(rcx));
+ TEST_INSTRUCTION("0F31" , rdtsc(edx, eax));
+ TEST_INSTRUCTION("0F01F9" , rdtscp(edx, eax, ecx));
+ TEST_INSTRUCTION("F30F01FE" , rmpadjust());
+ TEST_INSTRUCTION("F20F01FE" , rmpupdate());
+ TEST_INSTRUCTION("C4E37BF0CA01" , rorx(ecx, edx, 1));
+ TEST_INSTRUCTION("C4E37BF08C1A8000000001" , rorx(ecx, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37BF08C1A8000000001" , rorx(ecx, dword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3FBF0CA01" , rorx(rcx, rdx, 1));
+ TEST_INSTRUCTION("C4E3FBF08C1A8000000001" , rorx(rcx, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3FBF08C1A8000000001" , rorx(rcx, qword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E262F7CA" , sarx(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E25AF78C1A80000000" , sarx(ecx, ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E25AF78C1A80000000" , sarx(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E2E2F7CA" , sarx(rcx, rdx, rbx));
+ TEST_INSTRUCTION("C4E2DAF78C1A80000000" , sarx(rcx, ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("C4E2DAF78C1A80000000" , sarx(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("F30F01EA" , saveprevssp());
+ TEST_INSTRUCTION("F30FC7F1" , senduipi(rcx));
+ TEST_INSTRUCTION("0F01E8" , serialize());
+ TEST_INSTRUCTION("F30F01E8" , setssbsy());
+ TEST_INSTRUCTION("0FAEF8" , sfence());
+ TEST_INSTRUCTION("C4E261F7CA" , shlx(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E259F78C1A80000000" , shlx(ecx, ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E259F78C1A80000000" , shlx(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E2E1F7CA" , shlx(rcx, rdx, rbx));
+ TEST_INSTRUCTION("C4E2D9F78C1A80000000" , shlx(rcx, ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("C4E2D9F78C1A80000000" , shlx(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("C4E263F7CA" , shrx(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E25BF78C1A80000000" , shrx(ecx, ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E25BF78C1A80000000" , shrx(ecx, dword_ptr(rdx, rbx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E2E3F7CA" , shrx(rcx, rdx, rbx));
+ TEST_INSTRUCTION("C4E2DBF78C1A80000000" , shrx(rcx, ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("C4E2DBF78C1A80000000" , shrx(rcx, qword_ptr(rdx, rbx, 0, 128), rsp));
+ TEST_INSTRUCTION("0F01DE" , skinit(eax));
+ TEST_INSTRUCTION("8FE97812C9" , slwpcb(ecx));
+ TEST_INSTRUCTION("8FE9F812C9" , slwpcb(rcx));
+ TEST_INSTRUCTION("0F01CB" , stac());
+ TEST_INSTRUCTION("0F01DC" , stgi());
+ TEST_INSTRUCTION("0FAE9C1180000000" , stmxcsr(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0FAE9C1180000000" , stmxcsr(dword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("F30F01EF" , stui());
+ TEST_INSTRUCTION("0F01F8" , swapgs());
+ TEST_INSTRUCTION("0F05" , syscall());
+ TEST_INSTRUCTION("0F34" , sysenter());
+ TEST_INSTRUCTION("0F35" , sysexit());
+ TEST_INSTRUCTION("480F35" , sysexitq());
+ TEST_INSTRUCTION("0F07" , sysret());
+ TEST_INSTRUCTION("480F07" , sysretq());
+ TEST_INSTRUCTION("8FE97001FA" , t1mskc(ecx, edx));
+ TEST_INSTRUCTION("8FE97001BC1A80000000" , t1mskc(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001BC1A80000000" , t1mskc(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001FA" , t1mskc(rcx, rdx));
+ TEST_INSTRUCTION("8FE9F001BC1A80000000" , t1mskc(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001BC1A80000000" , t1mskc(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30F01ED" , testui());
+ TEST_INSTRUCTION("660FAEF1" , tpause(ecx, edx, eax));
+ TEST_INSTRUCTION("66F30FBCCA" , tzcnt(cx, dx));
+ TEST_INSTRUCTION("66F30FBC8C1A80000000" , tzcnt(cx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("66F30FBC8C1A80000000" , tzcnt(cx, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30FBCCA" , tzcnt(ecx, edx));
+ TEST_INSTRUCTION("F30FBC8C1A80000000" , tzcnt(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30FBC8C1A80000000" , tzcnt(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F3480FBCCA" , tzcnt(rcx, rdx));
+ TEST_INSTRUCTION("F3480FBC8C1A80000000" , tzcnt(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F3480FBC8C1A80000000" , tzcnt(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001E2" , tzmsk(ecx, edx));
+ TEST_INSTRUCTION("8FE97001A41A80000000" , tzmsk(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001A41A80000000" , tzmsk(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001E2" , tzmsk(rcx, rdx));
+ TEST_INSTRUCTION("8FE9F001A41A80000000" , tzmsk(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE9F001A41A80000000" , tzmsk(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30FAEF1" , umonitor(ptr(rcx)));
+ TEST_INSTRUCTION("F20FAEF1" , umwait(ecx, edx, eax));
+ TEST_INSTRUCTION("0F01C1" , vmcall());
+ TEST_INSTRUCTION("660FC7B41180000000" , vmclear(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("660FC7B41180000000" , vmclear(qword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F01D4" , vmfunc());
+ TEST_INSTRUCTION("0F01C2" , vmlaunch());
+ TEST_INSTRUCTION("0F01DA" , vmload(rax));
+ TEST_INSTRUCTION("0F01D9" , vmmcall());
+ TEST_INSTRUCTION("0FC7B41180000000" , vmptrld(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0FC7B41180000000" , vmptrld(qword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0FC7BC1180000000" , vmptrst(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0FC7BC1180000000" , vmptrst(qword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("0F78D1" , vmread(rcx, rdx));
+ TEST_INSTRUCTION("0F789C1180000000" , vmread(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("0F789C1180000000" , vmread(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("0F01C3" , vmresume());
+ TEST_INSTRUCTION("0F01D8" , vmrun(rax));
+ TEST_INSTRUCTION("0F01DB" , vmsave(rax));
+ TEST_INSTRUCTION("0F79CA" , vmwrite(rcx, rdx));
+ TEST_INSTRUCTION("0F798C1A80000000" , vmwrite(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("0F798C1A80000000" , vmwrite(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("F30FC7B41180000000" , vmxon(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("F30FC7B41180000000" , vmxon(qword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("F30F09" , wbnoinvd());
+ TEST_INSTRUCTION("F30FAED1" , wrfsbase(ecx));
+ TEST_INSTRUCTION("F3480FAED1" , wrfsbase(rcx));
+ TEST_INSTRUCTION("F30FAED9" , wrgsbase(ecx));
+ TEST_INSTRUCTION("F3480FAED9" , wrgsbase(rcx));
+ TEST_INSTRUCTION("0F38F6D1" , wrssd(ecx, edx));
+ TEST_INSTRUCTION("0F38F69C1180000000" , wrssd(ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F38F69C1180000000" , wrssd(dword_ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("480F38F6D1" , wrssq(rcx, rdx));
+ TEST_INSTRUCTION("480F38F69C1180000000" , wrssq(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("480F38F69C1180000000" , wrssq(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("660F38F5D1" , wrussd(ecx, edx));
+ TEST_INSTRUCTION("660F38F59C1180000000" , wrussd(ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("660F38F59C1180000000" , wrussd(dword_ptr(rcx, rdx, 0, 128), ebx));
+ TEST_INSTRUCTION("66480F38F5D1" , wrussq(rcx, rdx));
+ TEST_INSTRUCTION("66480F38F59C1180000000" , wrussq(ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("66480F38F59C1180000000" , wrussq(qword_ptr(rcx, rdx, 0, 128), rbx));
+ TEST_INSTRUCTION("0F01D5" , xend());
+ TEST_INSTRUCTION("0F01D0" , xgetbv(edx, eax, ecx));
TEST_INSTRUCTION("F20F01E9" , xresldtrk());
TEST_INSTRUCTION("0FAEAC1180000000" , xrstor(ptr(rcx, rdx, 0, 128), edx, eax));
TEST_INSTRUCTION("480FAEAC1180000000" , xrstor64(ptr(rcx, rdx, 0, 128), edx, eax));
@@ -3068,32 +3079,18 @@ static void ASMJIT_NOINLINE testX64AssemblerMMX_SSE(AssemblerTester<x86::Assembl
static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>& tester) noexcept {
using namespace x86;
- TEST_INSTRUCTION("62F25F489A4C1A08" , v4fmaddps(zmm1, zmm4, zmm5, zmm6, zmm7, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("62F25F489A4C1A08" , v4fmaddps(zmm1, zmm4, zmm5, zmm6, zmm7, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("62F25F089B4C1A08" , v4fmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("62F25F089B4C1A08" , v4fmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("62F25F48AA4C1A08" , v4fnmaddps(zmm1, zmm4, zmm5, zmm6, zmm7, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("62F25F48AA4C1A08" , v4fnmaddps(zmm1, zmm4, zmm5, zmm6, zmm7, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("62F25F08AB4C1A08" , v4fnmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("62F25F08AB4C1A08" , v4fnmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("C5E958CB" , vaddpd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C5E9588C2B80000000" , vaddpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E9588C2B80000000" , vaddpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5ED58CB" , vaddpd(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C5ED588C2B80000000" , vaddpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5ED588C2B80000000" , vaddpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F1ED4858CB" , vaddpd(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F1ED48584C2B02" , vaddpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F1ED48584C2B02" , vaddpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E858CB" , vaddps(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C5E8588C2B80000000" , vaddps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E8588C2B80000000" , vaddps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5EC58CB" , vaddps(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C5EC588C2B80000000" , vaddps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5EC588C2B80000000" , vaddps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F16C4858CB" , vaddps(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F16C48584C2B02" , vaddps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F16C48584C2B02" , vaddps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5EB58CB" , vaddsd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C5EB588C2B80000000" , vaddsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5EB588C2B80000000" , vaddsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
@@ -3118,114 +3115,54 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("C4E26DDECB" , vaesdec(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C4E26DDE8C2B80000000" , vaesdec(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E26DDE8C2B80000000" , vaesdec(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D48DECB" , vaesdec(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F26D48DE4C2B02" , vaesdec(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D48DE4C2B02" , vaesdec(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E269DFCB" , vaesdeclast(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C4E269DF8C2B80000000" , vaesdeclast(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E269DF8C2B80000000" , vaesdeclast(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E26DDFCB" , vaesdeclast(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C4E26DDF8C2B80000000" , vaesdeclast(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E26DDF8C2B80000000" , vaesdeclast(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D48DFCB" , vaesdeclast(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F26D48DF4C2B02" , vaesdeclast(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D48DF4C2B02" , vaesdeclast(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E269DCCB" , vaesenc(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C4E269DC8C2B80000000" , vaesenc(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E269DC8C2B80000000" , vaesenc(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E26DDCCB" , vaesenc(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C4E26DDC8C2B80000000" , vaesenc(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E26DDC8C2B80000000" , vaesenc(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D48DCCB" , vaesenc(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F26D48DC4C2B02" , vaesenc(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D48DC4C2B02" , vaesenc(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E269DDCB" , vaesenclast(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C4E269DD8C2B80000000" , vaesenclast(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E269DD8C2B80000000" , vaesenclast(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E26DDDCB" , vaesenclast(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C4E26DDD8C2B80000000" , vaesenclast(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E26DDD8C2B80000000" , vaesenclast(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D48DDCB" , vaesenclast(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F26D48DD4C2B02" , vaesenclast(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D48DD4C2B02" , vaesenclast(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E279DBCA" , vaesimc(xmm1, xmm2));
TEST_INSTRUCTION("C4E279DB8C1A80000000" , vaesimc(xmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("C4E279DB8C1A80000000" , vaesimc(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("C4E379DFCA01" , vaeskeygenassist(xmm1, xmm2, 1));
TEST_INSTRUCTION("C4E379DF8C1A8000000001" , vaeskeygenassist(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("C4E379DF8C1A8000000001" , vaeskeygenassist(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("62F36D0803CB01" , valignd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("62F36D08034C2B0801" , valignd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F36D08034C2B0801" , valignd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F36D2803CB01" , valignd(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("62F36D28034C2B0401" , valignd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F36D28034C2B0401" , valignd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F36D4803CB01" , valignd(zmm1, zmm2, zmm3, 1));
- TEST_INSTRUCTION("62F36D48034C2B0201" , valignd(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F36D48034C2B0201" , valignd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F3ED0803CB01" , valignq(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("62F3ED08034C2B0801" , valignq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F3ED08034C2B0801" , valignq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F3ED2803CB01" , valignq(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("62F3ED28034C2B0401" , valignq(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F3ED28034C2B0401" , valignq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F3ED4803CB01" , valignq(zmm1, zmm2, zmm3, 1));
- TEST_INSTRUCTION("62F3ED48034C2B0201" , valignq(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("62F3ED48034C2B0201" , valignq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("C5E955CB" , vandnpd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C5E9558C2B80000000" , vandnpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E9558C2B80000000" , vandnpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5ED55CB" , vandnpd(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C5ED558C2B80000000" , vandnpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5ED558C2B80000000" , vandnpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F1ED4855CB" , vandnpd(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F1ED48554C2B02" , vandnpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F1ED48554C2B02" , vandnpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E855CB" , vandnps(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C5E8558C2B80000000" , vandnps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E8558C2B80000000" , vandnps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5EC55CB" , vandnps(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C5EC558C2B80000000" , vandnps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5EC558C2B80000000" , vandnps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F16C4855CB" , vandnps(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F16C48554C2B02" , vandnps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F16C48554C2B02" , vandnps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E954CB" , vandpd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C5E9548C2B80000000" , vandpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E9548C2B80000000" , vandpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5ED54CB" , vandpd(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C5ED548C2B80000000" , vandpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5ED548C2B80000000" , vandpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F1ED4854CB" , vandpd(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F1ED48544C2B02" , vandpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F1ED48544C2B02" , vandpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E854CB" , vandps(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("C5E8548C2B80000000" , vandps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5E8548C2B80000000" , vandps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5EC54CB" , vandps(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("C5EC548C2B80000000" , vandps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C5EC548C2B80000000" , vandps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F16C4854CB" , vandps(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F16C48544C2B02" , vandps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F16C48544C2B02" , vandps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F2ED0865CB" , vblendmpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("62F2ED08654C2B08" , vblendmpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F2ED08654C2B08" , vblendmpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F2ED2865CB" , vblendmpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("62F2ED28654C2B04" , vblendmpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F2ED28654C2B04" , vblendmpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F2ED4865CB" , vblendmpd(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F2ED48654C2B02" , vblendmpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F2ED48654C2B02" , vblendmpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D0865CB" , vblendmps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("62F26D08654C2B08" , vblendmps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D08654C2B08" , vblendmps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D2865CB" , vblendmps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("62F26D28654C2B04" , vblendmps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D28654C2B04" , vblendmps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D4865CB" , vblendmps(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F26D48654C2B02" , vblendmps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F26D48654C2B02" , vblendmps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("C4E3690DCB01" , vblendpd(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("C4E3690D8C2B8000000001" , vblendpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("C4E3690D8C2B8000000001" , vblendpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
@@ -3252,6 +3189,2434 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("C4E36D4A8C2B8000000060" , vblendvps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
TEST_INSTRUCTION("C4E27D1A8C1A80000000" , vbroadcastf128(ymm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("C4E27D1A8C1A80000000" , vbroadcastf128(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D5A8C1A80000000" , vbroadcasti128(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D5A8C1A80000000" , vbroadcasti128(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D19CA" , vbroadcastsd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D198C1A80000000" , vbroadcastsd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D198C1A80000000" , vbroadcastsd(ymm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27918CA" , vbroadcastss(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279188C1A80000000" , vbroadcastss(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279188C1A80000000" , vbroadcastss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D18CA" , vbroadcastss(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D188C1A80000000" , vbroadcastss(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D188C1A80000000" , vbroadcastss(ymm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5E9C2CB01" , vcmppd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5E9C28C2B8000000001" , vcmppd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9C28C2B8000000001" , vcmppd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EDC2CB01" , vcmppd(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C5EDC28C2B8000000001" , vcmppd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EDC28C2B8000000001" , vcmppd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E8C2CB01" , vcmpps(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5E8C28C2B8000000001" , vcmpps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E8C28C2B8000000001" , vcmpps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5ECC2CB01" , vcmpps(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C5ECC28C2B8000000001" , vcmpps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5ECC28C2B8000000001" , vcmpps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EBC2CB01" , vcmpsd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5EBC28C2B8000000001" , vcmpsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EBC28C2B8000000001" , vcmpsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EAC2CB01" , vcmpss(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5EAC28C2B8000000001" , vcmpss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EAC28C2B8000000001" , vcmpss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5F92FCA" , vcomisd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F92F8C1A80000000" , vcomisd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F92F8C1A80000000" , vcomisd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F82FCA" , vcomiss(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F82F8C1A80000000" , vcomiss(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F82F8C1A80000000" , vcomiss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FAE6CA" , vcvtdq2pd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FAE68C1A80000000" , vcvtdq2pd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FAE68C1A80000000" , vcvtdq2pd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FEE6CA" , vcvtdq2pd(ymm1, xmm2));
+ TEST_INSTRUCTION("C5FEE68C1A80000000" , vcvtdq2pd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FEE68C1A80000000" , vcvtdq2pd(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F85BCA" , vcvtdq2ps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F85B8C1A80000000" , vcvtdq2ps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F85B8C1A80000000" , vcvtdq2ps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC5BCA" , vcvtdq2ps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC5B8C1A80000000" , vcvtdq2ps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC5B8C1A80000000" , vcvtdq2ps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FBE6CA" , vcvtpd2dq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FFE6CA" , vcvtpd2dq(xmm1, ymm2));
+ TEST_INSTRUCTION("C5FBE68C1A80000000" , vcvtpd2dq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FFE68C1A80000000" , vcvtpd2dq(xmm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F95ACA" , vcvtpd2ps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FD5ACA" , vcvtpd2ps(xmm1, ymm2));
+ TEST_INSTRUCTION("C5F95A8C1A80000000" , vcvtpd2ps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD5A8C1A80000000" , vcvtpd2ps(xmm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27913CA" , vcvtph2ps(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279138C1A80000000" , vcvtph2ps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279138C1A80000000" , vcvtph2ps(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D13CA" , vcvtph2ps(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D138C1A80000000" , vcvtph2ps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D138C1A80000000" , vcvtph2ps(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F95BCA" , vcvtps2dq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F95B8C1A80000000" , vcvtps2dq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F95B8C1A80000000" , vcvtps2dq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD5BCA" , vcvtps2dq(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD5B8C1A80000000" , vcvtps2dq(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD5B8C1A80000000" , vcvtps2dq(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F85ACA" , vcvtps2pd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F85A8C1A80000000" , vcvtps2pd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F85A8C1A80000000" , vcvtps2pd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC5ACA" , vcvtps2pd(ymm1, xmm2));
+ TEST_INSTRUCTION("C5FC5A8C1A80000000" , vcvtps2pd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC5A8C1A80000000" , vcvtps2pd(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E3791DD101" , vcvtps2ph(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E3791D9C118000000001" , vcvtps2ph(ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E3791D9C118000000001" , vcvtps2ph(qword_ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E37D1DD101" , vcvtps2ph(xmm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D1D9C118000000001" , vcvtps2ph(ptr(rcx, rdx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37D1D9C118000000001" , vcvtps2ph(xmmword_ptr(rcx, rdx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C5FB2DCA" , vcvtsd2si(ecx, xmm2));
+ TEST_INSTRUCTION("C5FB2D8C1A80000000" , vcvtsd2si(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FB2D8C1A80000000" , vcvtsd2si(ecx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1FB2DCA" , vcvtsd2si(rcx, xmm2));
+ TEST_INSTRUCTION("C4E1FB2D8C1A80000000" , vcvtsd2si(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1FB2D8C1A80000000" , vcvtsd2si(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5EB5ACB" , vcvtsd2ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5A8C2B80000000" , vcvtsd2ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5A8C2B80000000" , vcvtsd2ss(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB2ACB" , vcvtsi2sd(xmm1, xmm2, ebx));
+ TEST_INSTRUCTION("C4E1EB2ACB" , vcvtsi2sd(xmm1, xmm2, rbx));
+ TEST_INSTRUCTION("C5EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E1EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA2ACB" , vcvtsi2ss(xmm1, xmm2, ebx));
+ TEST_INSTRUCTION("C4E1EA2ACB" , vcvtsi2ss(xmm1, xmm2, rbx));
+ TEST_INSTRUCTION("C5EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E1EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5ACB" , vcvtss2sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5A8C2B80000000" , vcvtss2sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5A8C2B80000000" , vcvtss2sd(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5FA2DCA" , vcvtss2si(ecx, xmm2));
+ TEST_INSTRUCTION("C5FA2D8C1A80000000" , vcvtss2si(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA2D8C1A80000000" , vcvtss2si(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1FA2DCA" , vcvtss2si(rcx, xmm2));
+ TEST_INSTRUCTION("C4E1FA2D8C1A80000000" , vcvtss2si(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1FA2D8C1A80000000" , vcvtss2si(rcx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F9E6CA" , vcvttpd2dq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FDE6CA" , vcvttpd2dq(xmm1, ymm2));
+ TEST_INSTRUCTION("C5F9E68C1A80000000" , vcvttpd2dq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FDE68C1A80000000" , vcvttpd2dq(xmm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA5BCA" , vcvttps2dq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA5B8C1A80000000" , vcvttps2dq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA5B8C1A80000000" , vcvttps2dq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FE5BCA" , vcvttps2dq(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FE5B8C1A80000000" , vcvttps2dq(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FE5B8C1A80000000" , vcvttps2dq(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FB2CCA" , vcvttsd2si(ecx, xmm2));
+ TEST_INSTRUCTION("C5FB2C8C1A80000000" , vcvttsd2si(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FB2C8C1A80000000" , vcvttsd2si(ecx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1FB2CCA" , vcvttsd2si(rcx, xmm2));
+ TEST_INSTRUCTION("C4E1FB2C8C1A80000000" , vcvttsd2si(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1FB2C8C1A80000000" , vcvttsd2si(rcx, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA2CCA" , vcvttss2si(ecx, xmm2));
+ TEST_INSTRUCTION("C5FA2C8C1A80000000" , vcvttss2si(ecx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA2C8C1A80000000" , vcvttss2si(ecx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1FA2CCA" , vcvttss2si(rcx, xmm2));
+ TEST_INSTRUCTION("C4E1FA2C8C1A80000000" , vcvttss2si(rcx, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1FA2C8C1A80000000" , vcvttss2si(rcx, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5E95ECB" , vdivpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E95E8C2B80000000" , vdivpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E95E8C2B80000000" , vdivpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5ECB" , vdivpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED5E8C2B80000000" , vdivpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5E8C2B80000000" , vdivpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E85ECB" , vdivps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E85E8C2B80000000" , vdivps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E85E8C2B80000000" , vdivps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5ECB" , vdivps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC5E8C2B80000000" , vdivps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5E8C2B80000000" , vdivps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5ECB" , vdivsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5E8C2B80000000" , vdivsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5E8C2B80000000" , vdivsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5ECB" , vdivss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5E8C2B80000000" , vdivss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5E8C2B80000000" , vdivss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E36941CB01" , vdppd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369418C2B8000000001" , vdppd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369418C2B8000000001" , vdppd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36940CB01" , vdpps(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369408C2B8000000001" , vdpps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369408C2B8000000001" , vdpps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D40CB01" , vdpps(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D408C2B8000000001" , vdpps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D408C2B8000000001" , vdpps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D19D101" , vextractf128(xmm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D199C118000000001" , vextractf128(ptr(rcx, rdx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37D199C118000000001" , vextractf128(xmmword_ptr(rcx, rdx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37D39D101" , vextracti128(xmm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D399C118000000001" , vextracti128(ptr(rcx, rdx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37D399C118000000001" , vextracti128(xmmword_ptr(rcx, rdx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37917D101" , vextractps(ecx, xmm2, 1));
+ TEST_INSTRUCTION("C4E379179C118000000001" , vextractps(ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E379179C118000000001" , vextractps(dword_ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E2D9928C1A80000000" , vgatherdpd(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2DD928C1A80000000" , vgatherdpd(ymm1, ptr(rdx, xmm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E259928C1A80000000" , vgatherdps(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E25D928C1A80000000" , vgatherdps(ymm1, ptr(rdx, ymm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E2D9938C1A80000000" , vgatherqpd(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2DD938C1A80000000" , vgatherqpd(ymm1, ptr(rdx, ymm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E259938C1A80000000" , vgatherqps(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E25D938C1A80000000" , vgatherqps(xmm1, ptr(rdx, ymm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E3E9CFCB01" , vgf2p8affineinvqb(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3E9CF8C2B8000000001" , vgf2p8affineinvqb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9CF8C2B8000000001" , vgf2p8affineinvqb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3EDCFCB01" , vgf2p8affineinvqb(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E3EDCF8C2B8000000001" , vgf2p8affineinvqb(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3EDCF8C2B8000000001" , vgf2p8affineinvqb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9CECB01" , vgf2p8affineqb(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3E9CE8C2B8000000001" , vgf2p8affineqb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9CE8C2B8000000001" , vgf2p8affineqb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3EDCECB01" , vgf2p8affineqb(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E3EDCE8C2B8000000001" , vgf2p8affineqb(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3EDCE8C2B8000000001" , vgf2p8affineqb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E269CFCB" , vgf2p8mulb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269CF8C2B80000000" , vgf2p8mulb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269CF8C2B80000000" , vgf2p8mulb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DCFCB" , vgf2p8mulb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DCF8C2B80000000" , vgf2p8mulb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DCF8C2B80000000" , vgf2p8mulb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E97CCB" , vhaddpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E97C8C2B80000000" , vhaddpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E97C8C2B80000000" , vhaddpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED7CCB" , vhaddpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED7C8C2B80000000" , vhaddpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED7C8C2B80000000" , vhaddpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB7CCB" , vhaddps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB7C8C2B80000000" , vhaddps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB7C8C2B80000000" , vhaddps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EF7CCB" , vhaddps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EF7C8C2B80000000" , vhaddps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EF7C8C2B80000000" , vhaddps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E97DCB" , vhsubpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E97D8C2B80000000" , vhsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E97D8C2B80000000" , vhsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED7DCB" , vhsubpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED7D8C2B80000000" , vhsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED7D8C2B80000000" , vhsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB7DCB" , vhsubps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB7D8C2B80000000" , vhsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB7D8C2B80000000" , vhsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EF7DCB" , vhsubps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EF7D8C2B80000000" , vhsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EF7D8C2B80000000" , vhsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E36D18CB01" , vinsertf128(ymm1, ymm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E36D188C2B8000000001" , vinsertf128(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D188C2B8000000001" , vinsertf128(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D38CB01" , vinserti128(ymm1, ymm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E36D388C2B8000000001" , vinserti128(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D388C2B8000000001" , vinserti128(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36921CB01" , vinsertps(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369218C2B8000000001" , vinsertps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369218C2B8000000001" , vinsertps(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5FBF08C1A80000000" , vlddqu(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FBF08C1A80000000" , vlddqu(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FFF08C1A80000000" , vlddqu(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FFF08C1A80000000" , vlddqu(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F8AE941180000000" , vldmxcsr(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("C5F8AE941180000000" , vldmxcsr(dword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("C5F9F7CA" , vmaskmovdqu(xmm1, xmm2, ptr(rdi)));
+ TEST_INSTRUCTION("C5F9F7CA" , vmaskmovdqu(xmm1, xmm2, xmmword_ptr(rdi)));
+ TEST_INSTRUCTION("C4E2612FA41180000000" , vmaskmovpd(ptr(rcx, rdx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2612FA41180000000" , vmaskmovpd(xmmword_ptr(rcx, rdx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2652FA41180000000" , vmaskmovpd(ptr(rcx, rdx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2652FA41180000000" , vmaskmovpd(ymmword_ptr(rcx, rdx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2692D8C2B80000000" , vmaskmovpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2692D8C2B80000000" , vmaskmovpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2D8C2B80000000" , vmaskmovpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2D8C2B80000000" , vmaskmovpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2612EA41180000000" , vmaskmovps(ptr(rcx, rdx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2612EA41180000000" , vmaskmovps(xmmword_ptr(rcx, rdx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2652EA41180000000" , vmaskmovps(ptr(rcx, rdx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2652EA41180000000" , vmaskmovps(ymmword_ptr(rcx, rdx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2692C8C2B80000000" , vmaskmovps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2692C8C2B80000000" , vmaskmovps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2C8C2B80000000" , vmaskmovps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2C8C2B80000000" , vmaskmovps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E95FCB" , vmaxpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E95F8C2B80000000" , vmaxpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E95F8C2B80000000" , vmaxpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5FCB" , vmaxpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED5F8C2B80000000" , vmaxpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5F8C2B80000000" , vmaxpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E85FCB" , vmaxps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E85F8C2B80000000" , vmaxps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E85F8C2B80000000" , vmaxps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5FCB" , vmaxps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC5F8C2B80000000" , vmaxps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5F8C2B80000000" , vmaxps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5FCB" , vmaxsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5F8C2B80000000" , vmaxsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5F8C2B80000000" , vmaxsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5FCB" , vmaxss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5F8C2B80000000" , vmaxss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5F8C2B80000000" , vmaxss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E95DCB" , vminpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E95D8C2B80000000" , vminpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E95D8C2B80000000" , vminpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5DCB" , vminpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED5D8C2B80000000" , vminpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5D8C2B80000000" , vminpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E85DCB" , vminps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E85D8C2B80000000" , vminps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E85D8C2B80000000" , vminps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5DCB" , vminps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC5D8C2B80000000" , vminps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5D8C2B80000000" , vminps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5DCB" , vminsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5D8C2B80000000" , vminsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5D8C2B80000000" , vminsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5DCB" , vminss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5D8C2B80000000" , vminss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5D8C2B80000000" , vminss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F928CA" , vmovapd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F9288C1A80000000" , vmovapd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F9288C1A80000000" , vmovapd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F9299C1180000000" , vmovapd(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9299C1180000000" , vmovapd(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FD28CA" , vmovapd(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD288C1A80000000" , vmovapd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD288C1A80000000" , vmovapd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD299C1180000000" , vmovapd(ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FD299C1180000000" , vmovapd(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5F828CA" , vmovaps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8288C1A80000000" , vmovaps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F8288C1A80000000" , vmovaps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F8299C1180000000" , vmovaps(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F8299C1180000000" , vmovaps(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FC28CA" , vmovaps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC288C1A80000000" , vmovaps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC288C1A80000000" , vmovaps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC299C1180000000" , vmovaps(ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FC299C1180000000" , vmovaps(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5F97ED1" , vmovd(ecx, xmm2));
+ TEST_INSTRUCTION("C5F97E9C1180000000" , vmovd(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F97E9C1180000000" , vmovd(dword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F96ECA" , vmovd(xmm1, edx));
+ TEST_INSTRUCTION("C5F96E8C1A80000000" , vmovd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F96E8C1A80000000" , vmovd(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FB12CA" , vmovddup(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FB128C1A80000000" , vmovddup(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FB128C1A80000000" , vmovddup(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FF12CA" , vmovddup(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FF128C1A80000000" , vmovddup(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FF128C1A80000000" , vmovddup(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F96FCA" , vmovdqa(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F96F8C1A80000000" , vmovdqa(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F96F8C1A80000000" , vmovdqa(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F97F9C1180000000" , vmovdqa(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F97F9C1180000000" , vmovdqa(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FD6FCA" , vmovdqa(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD6F8C1A80000000" , vmovdqa(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD6F8C1A80000000" , vmovdqa(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD7F9C1180000000" , vmovdqa(ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FD7F9C1180000000" , vmovdqa(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FA6FCA" , vmovdqu(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA6F8C1A80000000" , vmovdqu(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA6F8C1A80000000" , vmovdqu(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA7F9C1180000000" , vmovdqu(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FA7F9C1180000000" , vmovdqu(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FE6FCA" , vmovdqu(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FE6F8C1A80000000" , vmovdqu(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FE6F8C1A80000000" , vmovdqu(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FE7F9C1180000000" , vmovdqu(ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FE7F9C1180000000" , vmovdqu(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5E812CB" , vmovhlps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F9179C1180000000" , vmovhpd(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9179C1180000000" , vmovhpd(qword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5E9168C2B80000000" , vmovhpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9168C2B80000000" , vmovhpd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F8179C1180000000" , vmovhps(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F8179C1180000000" , vmovhps(qword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5E8168C2B80000000" , vmovhps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E8168C2B80000000" , vmovhps(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E816CB" , vmovlhps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F9139C1180000000" , vmovlpd(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9139C1180000000" , vmovlpd(qword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5E9128C2B80000000" , vmovlpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9128C2B80000000" , vmovlpd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F8139C1180000000" , vmovlps(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F8139C1180000000" , vmovlps(qword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5E8128C2B80000000" , vmovlps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E8128C2B80000000" , vmovlps(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F950CA" , vmovmskpd(ecx, xmm2));
+ TEST_INSTRUCTION("C5FD50CA" , vmovmskpd(ecx, ymm2));
+ TEST_INSTRUCTION("C5F850CA" , vmovmskps(ecx, xmm2));
+ TEST_INSTRUCTION("C5FC50CA" , vmovmskps(ecx, ymm2));
+ TEST_INSTRUCTION("C5F9E79C1180000000" , vmovntdq(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9E79C1180000000" , vmovntdq(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FDE79C1180000000" , vmovntdq(ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FDE79C1180000000" , vmovntdq(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C4E2792A8C1A80000000" , vmovntdqa(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2792A8C1A80000000" , vmovntdqa(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D2A8C1A80000000" , vmovntdqa(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D2A8C1A80000000" , vmovntdqa(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F92B9C1180000000" , vmovntpd(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F92B9C1180000000" , vmovntpd(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FD2B9C1180000000" , vmovntpd(ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FD2B9C1180000000" , vmovntpd(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C4E1F97ED1" , vmovq(rcx, xmm2));
+ TEST_INSTRUCTION("C5F9D69C1180000000" , vmovq(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9D69C1180000000" , vmovq(qword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C4E1F96ECA" , vmovq(xmm1, rdx));
+ TEST_INSTRUCTION("C5FA7ECA" , vmovq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA7E8C1A80000000" , vmovq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA7E8C1A80000000" , vmovq(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FB119C1180000000" , vmovsd(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FB119C1180000000" , vmovsd(qword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FB108C1A80000000" , vmovsd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FB108C1A80000000" , vmovsd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5EB10CB" , vmovsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5FA16CA" , vmovshdup(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA168C1A80000000" , vmovshdup(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA168C1A80000000" , vmovshdup(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FE16CA" , vmovshdup(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FE168C1A80000000" , vmovshdup(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FE168C1A80000000" , vmovshdup(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA12CA" , vmovsldup(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA128C1A80000000" , vmovsldup(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA128C1A80000000" , vmovsldup(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FE12CA" , vmovsldup(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FE128C1A80000000" , vmovsldup(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FE128C1A80000000" , vmovsldup(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA119C1180000000" , vmovss(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FA119C1180000000" , vmovss(dword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FA108C1A80000000" , vmovss(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FA108C1A80000000" , vmovss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5EA10CB" , vmovss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F910CA" , vmovupd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F9108C1A80000000" , vmovupd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F9108C1A80000000" , vmovupd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F9119C1180000000" , vmovupd(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9119C1180000000" , vmovupd(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FD10CA" , vmovupd(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD108C1A80000000" , vmovupd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD108C1A80000000" , vmovupd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD119C1180000000" , vmovupd(ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FD119C1180000000" , vmovupd(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5F810CA" , vmovups(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8108C1A80000000" , vmovups(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F8108C1A80000000" , vmovups(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F8119C1180000000" , vmovups(ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F8119C1180000000" , vmovups(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FC10CA" , vmovups(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC108C1A80000000" , vmovups(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC108C1A80000000" , vmovups(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC119C1180000000" , vmovups(ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FC119C1180000000" , vmovups(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C4E36942CB01" , vmpsadbw(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369428C2B8000000001" , vmpsadbw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369428C2B8000000001" , vmpsadbw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D42CB01" , vmpsadbw(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D428C2B8000000001" , vmpsadbw(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D428C2B8000000001" , vmpsadbw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E959CB" , vmulpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9598C2B80000000" , vmulpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9598C2B80000000" , vmulpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED59CB" , vmulpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED598C2B80000000" , vmulpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED598C2B80000000" , vmulpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E859CB" , vmulps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8598C2B80000000" , vmulps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E8598C2B80000000" , vmulps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC59CB" , vmulps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC598C2B80000000" , vmulps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC598C2B80000000" , vmulps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB59CB" , vmulsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB598C2B80000000" , vmulsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB598C2B80000000" , vmulsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA59CB" , vmulss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA598C2B80000000" , vmulss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA598C2B80000000" , vmulss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E956CB" , vorpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9568C2B80000000" , vorpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9568C2B80000000" , vorpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED56CB" , vorpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED568C2B80000000" , vorpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED568C2B80000000" , vorpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E856CB" , vorps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8568C2B80000000" , vorps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E8568C2B80000000" , vorps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC56CB" , vorps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC568C2B80000000" , vorps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC568C2B80000000" , vorps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2791CCA" , vpabsb(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2791C8C1A80000000" , vpabsb(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791C8C1A80000000" , vpabsb(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1CCA" , vpabsb(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D1C8C1A80000000" , vpabsb(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1C8C1A80000000" , vpabsb(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791ECA" , vpabsd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2791E8C1A80000000" , vpabsd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791E8C1A80000000" , vpabsd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1ECA" , vpabsd(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D1E8C1A80000000" , vpabsd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1E8C1A80000000" , vpabsd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791DCA" , vpabsw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2791D8C1A80000000" , vpabsw(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791D8C1A80000000" , vpabsw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1DCA" , vpabsw(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D1D8C1A80000000" , vpabsw(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1D8C1A80000000" , vpabsw(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5E96BCB" , vpackssdw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E96B8C2B80000000" , vpackssdw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E96B8C2B80000000" , vpackssdw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6BCB" , vpackssdw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED6B8C2B80000000" , vpackssdw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6B8C2B80000000" , vpackssdw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E963CB" , vpacksswb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9638C2B80000000" , vpacksswb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9638C2B80000000" , vpacksswb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED63CB" , vpacksswb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED638C2B80000000" , vpacksswb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED638C2B80000000" , vpacksswb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2692BCB" , vpackusdw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2692B8C2B80000000" , vpackusdw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2692B8C2B80000000" , vpackusdw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2BCB" , vpackusdw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D2B8C2B80000000" , vpackusdw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2B8C2B80000000" , vpackusdw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E967CB" , vpackuswb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9678C2B80000000" , vpackuswb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9678C2B80000000" , vpackuswb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED67CB" , vpackuswb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED678C2B80000000" , vpackuswb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED678C2B80000000" , vpackuswb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FCCB" , vpaddb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FC8C2B80000000" , vpaddb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FC8C2B80000000" , vpaddb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFCCB" , vpaddb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFC8C2B80000000" , vpaddb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFC8C2B80000000" , vpaddb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FECB" , vpaddd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FE8C2B80000000" , vpaddd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FE8C2B80000000" , vpaddd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFECB" , vpaddd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFE8C2B80000000" , vpaddd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFE8C2B80000000" , vpaddd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D4CB" , vpaddq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9D48C2B80000000" , vpaddq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D48C2B80000000" , vpaddq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD4CB" , vpaddq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDD48C2B80000000" , vpaddq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD48C2B80000000" , vpaddq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9ECCB" , vpaddsb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EC8C2B80000000" , vpaddsb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EC8C2B80000000" , vpaddsb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDECCB" , vpaddsb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEC8C2B80000000" , vpaddsb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEC8C2B80000000" , vpaddsb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EDCB" , vpaddsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9ED8C2B80000000" , vpaddsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9ED8C2B80000000" , vpaddsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEDCB" , vpaddsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDED8C2B80000000" , vpaddsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDED8C2B80000000" , vpaddsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DCCB" , vpaddusb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DC8C2B80000000" , vpaddusb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DC8C2B80000000" , vpaddusb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDCCB" , vpaddusb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDC8C2B80000000" , vpaddusb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDC8C2B80000000" , vpaddusb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DDCB" , vpaddusw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DD8C2B80000000" , vpaddusw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DD8C2B80000000" , vpaddusw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDDCB" , vpaddusw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDD8C2B80000000" , vpaddusw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDD8C2B80000000" , vpaddusw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FDCB" , vpaddw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FD8C2B80000000" , vpaddw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FD8C2B80000000" , vpaddw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFDCB" , vpaddw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFD8C2B80000000" , vpaddw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFD8C2B80000000" , vpaddw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E3690FCB01" , vpalignr(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690F8C2B8000000001" , vpalignr(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690F8C2B8000000001" , vpalignr(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0FCB01" , vpalignr(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D0F8C2B8000000001" , vpalignr(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0F8C2B8000000001" , vpalignr(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9DBCB" , vpand(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DB8C2B80000000" , vpand(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DB8C2B80000000" , vpand(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDBCB" , vpand(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDB8C2B80000000" , vpand(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDB8C2B80000000" , vpand(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DFCB" , vpandn(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DF8C2B80000000" , vpandn(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DF8C2B80000000" , vpandn(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDFCB" , vpandn(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDF8C2B80000000" , vpandn(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDF8C2B80000000" , vpandn(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E0CB" , vpavgb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E08C2B80000000" , vpavgb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E08C2B80000000" , vpavgb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE0CB" , vpavgb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE08C2B80000000" , vpavgb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE08C2B80000000" , vpavgb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E3CB" , vpavgw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E38C2B80000000" , vpavgw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E38C2B80000000" , vpavgw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE3CB" , vpavgw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE38C2B80000000" , vpavgw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE38C2B80000000" , vpavgw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E36902CB01" , vpblendd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369028C2B8000000001" , vpblendd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369028C2B8000000001" , vpblendd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D02CB01" , vpblendd(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D028C2B8000000001" , vpblendd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D028C2B8000000001" , vpblendd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3694CCB40" , vpblendvb(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3694C8C2B8000000060" , vpblendvb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3694C8C2B8000000060" , vpblendvb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E36D4CCB40" , vpblendvb(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E36D4C8C2B8000000060" , vpblendvb(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D4C8C2B8000000060" , vpblendvb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3690ECB01" , vpblendw(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690E8C2B8000000001" , vpblendw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690E8C2B8000000001" , vpblendw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0ECB01" , vpblendw(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D0E8C2B8000000001" , vpblendw(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0E8C2B8000000001" , vpblendw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E27978CA" , vpbroadcastb(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279788C1A80000000" , vpbroadcastb(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279788C1A80000000" , vpbroadcastb(xmm1, byte_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D78CA" , vpbroadcastb(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D788C1A80000000" , vpbroadcastb(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D788C1A80000000" , vpbroadcastb(ymm1, byte_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27958CA" , vpbroadcastd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279588C1A80000000" , vpbroadcastd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279588C1A80000000" , vpbroadcastd(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D58CA" , vpbroadcastd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D588C1A80000000" , vpbroadcastd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D588C1A80000000" , vpbroadcastd(ymm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27959CA" , vpbroadcastq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279598C1A80000000" , vpbroadcastq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279598C1A80000000" , vpbroadcastq(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D59CA" , vpbroadcastq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D598C1A80000000" , vpbroadcastq(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D598C1A80000000" , vpbroadcastq(ymm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27979CA" , vpbroadcastw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279798C1A80000000" , vpbroadcastw(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279798C1A80000000" , vpbroadcastw(xmm1, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D79CA" , vpbroadcastw(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D798C1A80000000" , vpbroadcastw(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D798C1A80000000" , vpbroadcastw(ymm1, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E36944CB01" , vpclmulqdq(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369448C2B8000000001" , vpclmulqdq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369448C2B8000000001" , vpclmulqdq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D44CB01" , vpclmulqdq(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D448C2B8000000001" , vpclmulqdq(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D448C2B8000000001" , vpclmulqdq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E974CB" , vpcmpeqb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9748C2B80000000" , vpcmpeqb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9748C2B80000000" , vpcmpeqb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED74CB" , vpcmpeqb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED748C2B80000000" , vpcmpeqb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED748C2B80000000" , vpcmpeqb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E976CB" , vpcmpeqd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9768C2B80000000" , vpcmpeqd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9768C2B80000000" , vpcmpeqd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED76CB" , vpcmpeqd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED768C2B80000000" , vpcmpeqd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED768C2B80000000" , vpcmpeqd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26929CB" , vpcmpeqq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269298C2B80000000" , vpcmpeqq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269298C2B80000000" , vpcmpeqq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D29CB" , vpcmpeqq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D298C2B80000000" , vpcmpeqq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D298C2B80000000" , vpcmpeqq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E975CB" , vpcmpeqw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9758C2B80000000" , vpcmpeqw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9758C2B80000000" , vpcmpeqw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED75CB" , vpcmpeqw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED758C2B80000000" , vpcmpeqw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED758C2B80000000" , vpcmpeqw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E37961CA01" , vpcmpestri(xmm1, xmm2, 1, ecx, eax, edx));
+ TEST_INSTRUCTION("C4E379618C1A8000000001" , vpcmpestri(xmm1, ptr(rdx, rbx, 0, 128), 1, ecx, eax, edx));
+ TEST_INSTRUCTION("C4E379618C1A8000000001" , vpcmpestri(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1, ecx, eax, edx));
+ TEST_INSTRUCTION("C4E37960CA01" , vpcmpestrm(xmm1, xmm2, 1, xmm0, eax, edx));
+ TEST_INSTRUCTION("C4E379608C1A8000000001" , vpcmpestrm(xmm1, ptr(rdx, rbx, 0, 128), 1, xmm0, eax, edx));
+ TEST_INSTRUCTION("C4E379608C1A8000000001" , vpcmpestrm(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1, xmm0, eax, edx));
+ TEST_INSTRUCTION("C5E964CB" , vpcmpgtb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9648C2B80000000" , vpcmpgtb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9648C2B80000000" , vpcmpgtb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED64CB" , vpcmpgtb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED648C2B80000000" , vpcmpgtb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED648C2B80000000" , vpcmpgtb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E966CB" , vpcmpgtd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9668C2B80000000" , vpcmpgtd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9668C2B80000000" , vpcmpgtd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED66CB" , vpcmpgtd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED668C2B80000000" , vpcmpgtd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED668C2B80000000" , vpcmpgtd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26937CB" , vpcmpgtq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269378C2B80000000" , vpcmpgtq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269378C2B80000000" , vpcmpgtq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D37CB" , vpcmpgtq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D378C2B80000000" , vpcmpgtq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D378C2B80000000" , vpcmpgtq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E965CB" , vpcmpgtw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9658C2B80000000" , vpcmpgtw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9658C2B80000000" , vpcmpgtw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED65CB" , vpcmpgtw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED658C2B80000000" , vpcmpgtw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED658C2B80000000" , vpcmpgtw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E37963CA01" , vpcmpistri(xmm1, xmm2, 1, ecx));
+ TEST_INSTRUCTION("C4E379638C1A8000000001" , vpcmpistri(xmm1, ptr(rdx, rbx, 0, 128), 1, ecx));
+ TEST_INSTRUCTION("C4E379638C1A8000000001" , vpcmpistri(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1, ecx));
+ TEST_INSTRUCTION("C4E37962CA01" , vpcmpistrm(xmm1, xmm2, 1, xmm0));
+ TEST_INSTRUCTION("C4E379628C1A8000000001" , vpcmpistrm(xmm1, ptr(rdx, rbx, 0, 128), 1, xmm0));
+ TEST_INSTRUCTION("C4E379628C1A8000000001" , vpcmpistrm(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1, xmm0));
+ TEST_INSTRUCTION("C4E36D06CB01" , vperm2f128(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D068C2B8000000001" , vperm2f128(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D068C2B8000000001" , vperm2f128(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D46CB01" , vperm2i128(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D468C2B8000000001" , vperm2i128(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D468C2B8000000001" , vperm2i128(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26D36CB" , vpermd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D368C2B80000000" , vpermd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D368C2B80000000" , vpermd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E36949CB41" , vpermil2pd(xmm1, xmm2, xmm3, xmm4, 1));
+ TEST_INSTRUCTION("C4E369498C2B8000000061" , vpermil2pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6, 1));
+ TEST_INSTRUCTION("C4E369498C2B8000000061" , vpermil2pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6, 1));
+ TEST_INSTRUCTION("C4E3E9498C358000000031" , vpermil2pd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9498C358000000031" , vpermil2pd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D49CB41" , vpermil2pd(ymm1, ymm2, ymm3, ymm4, 1));
+ TEST_INSTRUCTION("C4E36D498C2B8000000061" , vpermil2pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6, 1));
+ TEST_INSTRUCTION("C4E36D498C2B8000000061" , vpermil2pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6, 1));
+ TEST_INSTRUCTION("C4E3ED498C358000000031" , vpermil2pd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3ED498C358000000031" , vpermil2pd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36948CB41" , vpermil2ps(xmm1, xmm2, xmm3, xmm4, 1));
+ TEST_INSTRUCTION("C4E369488C2B8000000061" , vpermil2ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6, 1));
+ TEST_INSTRUCTION("C4E369488C2B8000000061" , vpermil2ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6, 1));
+ TEST_INSTRUCTION("C4E3E9488C358000000031" , vpermil2ps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9488C358000000031" , vpermil2ps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D48CB41" , vpermil2ps(ymm1, ymm2, ymm3, ymm4, 1));
+ TEST_INSTRUCTION("C4E36D488C2B8000000061" , vpermil2ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6, 1));
+ TEST_INSTRUCTION("C4E36D488C2B8000000061" , vpermil2ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6, 1));
+ TEST_INSTRUCTION("C4E3ED488C358000000031" , vpermil2ps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3ED488C358000000031" , vpermil2ps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E2690DCB" , vpermilpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E37905CA01" , vpermilpd(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E2690D8C2B80000000" , vpermilpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690D8C2B80000000" , vpermilpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E379058C1A8000000001" , vpermilpd(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E379058C1A8000000001" , vpermilpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26D0DCB" , vpermilpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E37D05CA01" , vpermilpd(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E26D0D8C2B80000000" , vpermilpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0D8C2B80000000" , vpermilpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E37D058C1A8000000001" , vpermilpd(ymm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D058C1A8000000001" , vpermilpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E2690CCB" , vpermilps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E37904CA01" , vpermilps(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E2690C8C2B80000000" , vpermilps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690C8C2B80000000" , vpermilps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E379048C1A8000000001" , vpermilps(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E379048C1A8000000001" , vpermilps(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26D0CCB" , vpermilps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E37D04CA01" , vpermilps(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E26D0C8C2B80000000" , vpermilps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0C8C2B80000000" , vpermilps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E37D048C1A8000000001" , vpermilps(ymm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D048C1A8000000001" , vpermilps(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3FD01CA01" , vpermpd(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E3FD018C1A8000000001" , vpermpd(ymm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3FD018C1A8000000001" , vpermpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26D16CB" , vpermps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D168C2B80000000" , vpermps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D168C2B80000000" , vpermps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E3FD00CA01" , vpermq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E3FD008C1A8000000001" , vpermq(ymm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3FD008C1A8000000001" , vpermq(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37914D101" , vpextrb(ecx, xmm2, 1));
+ TEST_INSTRUCTION("C4E379149C118000000001" , vpextrb(ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E379149C118000000001" , vpextrb(byte_ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E37916D101" , vpextrd(ecx, xmm2, 1));
+ TEST_INSTRUCTION("C4E379169C118000000001" , vpextrd(ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E379169C118000000001" , vpextrd(dword_ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E3F916D101" , vpextrq(rcx, xmm2, 1));
+ TEST_INSTRUCTION("C4E3F9169C118000000001" , vpextrq(ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E3F9169C118000000001" , vpextrq(qword_ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C5F9C5CA01" , vpextrw(ecx, xmm2, 1));
+ TEST_INSTRUCTION("C4E379159C118000000001" , vpextrw(ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E379159C118000000001" , vpextrw(word_ptr(rcx, rdx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E259908C1A80000000" , vpgatherdd(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E25D908C1A80000000" , vpgatherdd(ymm1, ptr(rdx, ymm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E2D9908C1A80000000" , vpgatherdq(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2DD908C1A80000000" , vpgatherdq(ymm1, ptr(rdx, xmm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E259918C1A80000000" , vpgatherqd(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E25D918C1A80000000" , vpgatherqd(xmm1, ptr(rdx, ymm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2D9918C1A80000000" , vpgatherqq(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2DD918C1A80000000" , vpgatherqq(ymm1, ptr(rdx, ymm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E26902CB" , vphaddd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269028C2B80000000" , vphaddd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269028C2B80000000" , vphaddd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D02CB" , vphaddd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D028C2B80000000" , vphaddd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D028C2B80000000" , vphaddd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26903CB" , vphaddsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269038C2B80000000" , vphaddsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269038C2B80000000" , vphaddsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D03CB" , vphaddsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D038C2B80000000" , vphaddsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D038C2B80000000" , vphaddsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26901CB" , vphaddw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269018C2B80000000" , vphaddw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269018C2B80000000" , vphaddw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D01CB" , vphaddw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D018C2B80000000" , vphaddw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D018C2B80000000" , vphaddw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E27941CA" , vphminposuw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279418C1A80000000" , vphminposuw(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279418C1A80000000" , vphminposuw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E26906CB" , vphsubd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269068C2B80000000" , vphsubd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269068C2B80000000" , vphsubd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D06CB" , vphsubd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D068C2B80000000" , vphsubd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D068C2B80000000" , vphsubd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26907CB" , vphsubsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269078C2B80000000" , vphsubsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269078C2B80000000" , vphsubsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D07CB" , vphsubsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D078C2B80000000" , vphsubsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D078C2B80000000" , vphsubsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26905CB" , vphsubw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269058C2B80000000" , vphsubw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269058C2B80000000" , vphsubw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D05CB" , vphsubw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D058C2B80000000" , vphsubw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D058C2B80000000" , vphsubw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E36920CB01" , vpinsrb(xmm1, xmm2, ebx, 1));
+ TEST_INSTRUCTION("C4E369208C2B8000000001" , vpinsrb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369208C2B8000000001" , vpinsrb(xmm1, xmm2, byte_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36922CB01" , vpinsrd(xmm1, xmm2, ebx, 1));
+ TEST_INSTRUCTION("C4E369228C2B8000000001" , vpinsrd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369228C2B8000000001" , vpinsrd(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E922CB01" , vpinsrq(xmm1, xmm2, rbx, 1));
+ TEST_INSTRUCTION("C4E3E9228C2B8000000001" , vpinsrq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9228C2B8000000001" , vpinsrq(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9C4CB01" , vpinsrw(xmm1, xmm2, ebx, 1));
+ TEST_INSTRUCTION("C5E9C48C2B8000000001" , vpinsrw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9C48C2B8000000001" , vpinsrw(xmm1, xmm2, word_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26904CB" , vpmaddubsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269048C2B80000000" , vpmaddubsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269048C2B80000000" , vpmaddubsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D04CB" , vpmaddubsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D048C2B80000000" , vpmaddubsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D048C2B80000000" , vpmaddubsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F5CB" , vpmaddwd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F58C2B80000000" , vpmaddwd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F58C2B80000000" , vpmaddwd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF5CB" , vpmaddwd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF58C2B80000000" , vpmaddwd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF58C2B80000000" , vpmaddwd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2618EA41180000000" , vpmaskmovd(ptr(rcx, rdx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2618EA41180000000" , vpmaskmovd(xmmword_ptr(rcx, rdx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2658EA41180000000" , vpmaskmovd(ptr(rcx, rdx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2658EA41180000000" , vpmaskmovd(ymmword_ptr(rcx, rdx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2698C8C2B80000000" , vpmaskmovd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2698C8C2B80000000" , vpmaskmovd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D8C8C2B80000000" , vpmaskmovd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D8C8C2B80000000" , vpmaskmovd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E18EA41180000000" , vpmaskmovq(ptr(rcx, rdx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2E18EA41180000000" , vpmaskmovq(xmmword_ptr(rcx, rdx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2E58EA41180000000" , vpmaskmovq(ptr(rcx, rdx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2E58EA41180000000" , vpmaskmovq(ymmword_ptr(rcx, rdx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2E98C8C2B80000000" , vpmaskmovq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E98C8C2B80000000" , vpmaskmovq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED8C8C2B80000000" , vpmaskmovq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED8C8C2B80000000" , vpmaskmovq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693CCB" , vpmaxsb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693C8C2B80000000" , vpmaxsb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693C8C2B80000000" , vpmaxsb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3CCB" , vpmaxsb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3C8C2B80000000" , vpmaxsb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3C8C2B80000000" , vpmaxsb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693DCB" , vpmaxsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693D8C2B80000000" , vpmaxsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693D8C2B80000000" , vpmaxsd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3DCB" , vpmaxsd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3D8C2B80000000" , vpmaxsd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3D8C2B80000000" , vpmaxsd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EECB" , vpmaxsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EE8C2B80000000" , vpmaxsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EE8C2B80000000" , vpmaxsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEECB" , vpmaxsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEE8C2B80000000" , vpmaxsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEE8C2B80000000" , vpmaxsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DECB" , vpmaxub(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DE8C2B80000000" , vpmaxub(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DE8C2B80000000" , vpmaxub(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDECB" , vpmaxub(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDE8C2B80000000" , vpmaxub(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDE8C2B80000000" , vpmaxub(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693FCB" , vpmaxud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693F8C2B80000000" , vpmaxud(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693F8C2B80000000" , vpmaxud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3FCB" , vpmaxud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3F8C2B80000000" , vpmaxud(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3F8C2B80000000" , vpmaxud(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693ECB" , vpmaxuw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693E8C2B80000000" , vpmaxuw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693E8C2B80000000" , vpmaxuw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3ECB" , vpmaxuw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3E8C2B80000000" , vpmaxuw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3E8C2B80000000" , vpmaxuw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26938CB" , vpminsb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269388C2B80000000" , vpminsb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269388C2B80000000" , vpminsb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D38CB" , vpminsb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D388C2B80000000" , vpminsb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D388C2B80000000" , vpminsb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26939CB" , vpminsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269398C2B80000000" , vpminsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269398C2B80000000" , vpminsd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D39CB" , vpminsd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D398C2B80000000" , vpminsd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D398C2B80000000" , vpminsd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EACB" , vpminsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EA8C2B80000000" , vpminsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EA8C2B80000000" , vpminsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEACB" , vpminsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEA8C2B80000000" , vpminsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEA8C2B80000000" , vpminsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DACB" , vpminub(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DA8C2B80000000" , vpminub(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DA8C2B80000000" , vpminub(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDACB" , vpminub(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDA8C2B80000000" , vpminub(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDA8C2B80000000" , vpminub(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693BCB" , vpminud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693B8C2B80000000" , vpminud(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693B8C2B80000000" , vpminud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3BCB" , vpminud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3B8C2B80000000" , vpminud(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3B8C2B80000000" , vpminud(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693ACB" , vpminuw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693A8C2B80000000" , vpminuw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693A8C2B80000000" , vpminuw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3ACB" , vpminuw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3A8C2B80000000" , vpminuw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3A8C2B80000000" , vpminuw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F9D7CA" , vpmovmskb(ecx, xmm2));
+ TEST_INSTRUCTION("C5FDD7CA" , vpmovmskb(ecx, ymm2));
+ TEST_INSTRUCTION("C4E27921CA" , vpmovsxbd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279218C1A80000000" , vpmovsxbd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279218C1A80000000" , vpmovsxbd(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D21CA" , vpmovsxbd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D218C1A80000000" , vpmovsxbd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D218C1A80000000" , vpmovsxbd(ymm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27922CA" , vpmovsxbq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279228C1A80000000" , vpmovsxbq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279228C1A80000000" , vpmovsxbq(xmm1, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D22CA" , vpmovsxbq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D228C1A80000000" , vpmovsxbq(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D228C1A80000000" , vpmovsxbq(ymm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27920CA" , vpmovsxbw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279208C1A80000000" , vpmovsxbw(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279208C1A80000000" , vpmovsxbw(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D20CA" , vpmovsxbw(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D208C1A80000000" , vpmovsxbw(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D208C1A80000000" , vpmovsxbw(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27925CA" , vpmovsxdq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279258C1A80000000" , vpmovsxdq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279258C1A80000000" , vpmovsxdq(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D25CA" , vpmovsxdq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D258C1A80000000" , vpmovsxdq(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D258C1A80000000" , vpmovsxdq(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27923CA" , vpmovsxwd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279238C1A80000000" , vpmovsxwd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279238C1A80000000" , vpmovsxwd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D23CA" , vpmovsxwd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D238C1A80000000" , vpmovsxwd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D238C1A80000000" , vpmovsxwd(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27924CA" , vpmovsxwq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279248C1A80000000" , vpmovsxwq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279248C1A80000000" , vpmovsxwq(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D24CA" , vpmovsxwq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D248C1A80000000" , vpmovsxwq(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D248C1A80000000" , vpmovsxwq(ymm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27931CA" , vpmovzxbd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279318C1A80000000" , vpmovzxbd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279318C1A80000000" , vpmovzxbd(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D31CA" , vpmovzxbd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D318C1A80000000" , vpmovzxbd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D318C1A80000000" , vpmovzxbd(ymm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27932CA" , vpmovzxbq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279328C1A80000000" , vpmovzxbq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279328C1A80000000" , vpmovzxbq(xmm1, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D32CA" , vpmovzxbq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D328C1A80000000" , vpmovzxbq(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D328C1A80000000" , vpmovzxbq(ymm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27930CA" , vpmovzxbw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279308C1A80000000" , vpmovzxbw(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279308C1A80000000" , vpmovzxbw(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D30CA" , vpmovzxbw(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D308C1A80000000" , vpmovzxbw(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D308C1A80000000" , vpmovzxbw(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27935CA" , vpmovzxdq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279358C1A80000000" , vpmovzxdq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279358C1A80000000" , vpmovzxdq(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D35CA" , vpmovzxdq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D358C1A80000000" , vpmovzxdq(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D358C1A80000000" , vpmovzxdq(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27933CA" , vpmovzxwd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279338C1A80000000" , vpmovzxwd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279338C1A80000000" , vpmovzxwd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D33CA" , vpmovzxwd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D338C1A80000000" , vpmovzxwd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D338C1A80000000" , vpmovzxwd(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27934CA" , vpmovzxwq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279348C1A80000000" , vpmovzxwq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279348C1A80000000" , vpmovzxwq(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D34CA" , vpmovzxwq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D348C1A80000000" , vpmovzxwq(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D348C1A80000000" , vpmovzxwq(ymm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E26928CB" , vpmuldq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269288C2B80000000" , vpmuldq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269288C2B80000000" , vpmuldq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D28CB" , vpmuldq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D288C2B80000000" , vpmuldq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D288C2B80000000" , vpmuldq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690BCB" , vpmulhrsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2690B8C2B80000000" , vpmulhrsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690B8C2B80000000" , vpmulhrsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0BCB" , vpmulhrsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D0B8C2B80000000" , vpmulhrsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0B8C2B80000000" , vpmulhrsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E4CB" , vpmulhuw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E48C2B80000000" , vpmulhuw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E48C2B80000000" , vpmulhuw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE4CB" , vpmulhuw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE48C2B80000000" , vpmulhuw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE48C2B80000000" , vpmulhuw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E5CB" , vpmulhw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E58C2B80000000" , vpmulhw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E58C2B80000000" , vpmulhw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE5CB" , vpmulhw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE58C2B80000000" , vpmulhw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE58C2B80000000" , vpmulhw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26940CB" , vpmulld(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269408C2B80000000" , vpmulld(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269408C2B80000000" , vpmulld(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D40CB" , vpmulld(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D408C2B80000000" , vpmulld(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D408C2B80000000" , vpmulld(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D5CB" , vpmullw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9D58C2B80000000" , vpmullw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D58C2B80000000" , vpmullw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD5CB" , vpmullw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDD58C2B80000000" , vpmullw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD58C2B80000000" , vpmullw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F4CB" , vpmuludq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F48C2B80000000" , vpmuludq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F48C2B80000000" , vpmuludq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF4CB" , vpmuludq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF48C2B80000000" , vpmuludq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF48C2B80000000" , vpmuludq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EBCB" , vpor(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EB8C2B80000000" , vpor(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EB8C2B80000000" , vpor(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEBCB" , vpor(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEB8C2B80000000" , vpor(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEB8C2B80000000" , vpor(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F6CB" , vpsadbw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F68C2B80000000" , vpsadbw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F68C2B80000000" , vpsadbw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF6CB" , vpsadbw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF68C2B80000000" , vpsadbw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF68C2B80000000" , vpsadbw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26900CB" , vpshufb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269008C2B80000000" , vpshufb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269008C2B80000000" , vpshufb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D00CB" , vpshufb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D008C2B80000000" , vpshufb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D008C2B80000000" , vpshufb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F970CA01" , vpshufd(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5F9708C1A8000000001" , vpshufd(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5F9708C1A8000000001" , vpshufd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FD70CA01" , vpshufd(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5FD708C1A8000000001" , vpshufd(ymm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FD708C1A8000000001" , vpshufd(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FA70CA01" , vpshufhw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5FA708C1A8000000001" , vpshufhw(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FA708C1A8000000001" , vpshufhw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FE70CA01" , vpshufhw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5FE708C1A8000000001" , vpshufhw(ymm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FE708C1A8000000001" , vpshufhw(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FB70CA01" , vpshuflw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5FB708C1A8000000001" , vpshuflw(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FB708C1A8000000001" , vpshuflw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FF70CA01" , vpshuflw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5FF708C1A8000000001" , vpshuflw(ymm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FF708C1A8000000001" , vpshuflw(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26908CB" , vpsignb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269088C2B80000000" , vpsignb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269088C2B80000000" , vpsignb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D08CB" , vpsignb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D088C2B80000000" , vpsignb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D088C2B80000000" , vpsignb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690ACB" , vpsignd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2690A8C2B80000000" , vpsignd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690A8C2B80000000" , vpsignd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0ACB" , vpsignd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D0A8C2B80000000" , vpsignd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0A8C2B80000000" , vpsignd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26909CB" , vpsignw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269098C2B80000000" , vpsignw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269098C2B80000000" , vpsignw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D09CB" , vpsignw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D098C2B80000000" , vpsignw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D098C2B80000000" , vpsignw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F2CB" , vpslld(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F172F201" , vpslld(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9F28C2B80000000" , vpslld(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F28C2B80000000" , vpslld(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF2CB" , vpslld(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F572F201" , vpslld(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDF28C2B80000000" , vpslld(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF28C2B80000000" , vpslld(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F173FA01" , vpslldq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5F573FA01" , vpslldq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5E9F3CB" , vpsllq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F173F201" , vpsllq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9F38C2B80000000" , vpsllq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F38C2B80000000" , vpsllq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF3CB" , vpsllq(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F573F201" , vpsllq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDF38C2B80000000" , vpsllq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF38C2B80000000" , vpsllq(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26947CB" , vpsllvd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269478C2B80000000" , vpsllvd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269478C2B80000000" , vpsllvd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D47CB" , vpsllvd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D478C2B80000000" , vpsllvd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D478C2B80000000" , vpsllvd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E947CB" , vpsllvq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9478C2B80000000" , vpsllvq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9478C2B80000000" , vpsllvq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED47CB" , vpsllvq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED478C2B80000000" , vpsllvq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED478C2B80000000" , vpsllvq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F1CB" , vpsllw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F171F201" , vpsllw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9F18C2B80000000" , vpsllw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F18C2B80000000" , vpsllw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF1CB" , vpsllw(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F571F201" , vpsllw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDF18C2B80000000" , vpsllw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF18C2B80000000" , vpsllw(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E2CB" , vpsrad(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F172E201" , vpsrad(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9E28C2B80000000" , vpsrad(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E28C2B80000000" , vpsrad(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE2CB" , vpsrad(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F572E201" , vpsrad(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDE28C2B80000000" , vpsrad(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE28C2B80000000" , vpsrad(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26946CB" , vpsravd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269468C2B80000000" , vpsravd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269468C2B80000000" , vpsravd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D46CB" , vpsravd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D468C2B80000000" , vpsravd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D468C2B80000000" , vpsravd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E1CB" , vpsraw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F171E201" , vpsraw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9E18C2B80000000" , vpsraw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E18C2B80000000" , vpsraw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE1CB" , vpsraw(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F571E201" , vpsraw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDE18C2B80000000" , vpsraw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE18C2B80000000" , vpsraw(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D2CB" , vpsrld(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F172D201" , vpsrld(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9D28C2B80000000" , vpsrld(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D28C2B80000000" , vpsrld(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD2CB" , vpsrld(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F572D201" , vpsrld(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDD28C2B80000000" , vpsrld(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD28C2B80000000" , vpsrld(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F173DA01" , vpsrldq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5F573DA01" , vpsrldq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5E9D3CB" , vpsrlq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F173D201" , vpsrlq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9D38C2B80000000" , vpsrlq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D38C2B80000000" , vpsrlq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD3CB" , vpsrlq(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F573D201" , vpsrlq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDD38C2B80000000" , vpsrlq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD38C2B80000000" , vpsrlq(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26945CB" , vpsrlvd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269458C2B80000000" , vpsrlvd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269458C2B80000000" , vpsrlvd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D45CB" , vpsrlvd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D458C2B80000000" , vpsrlvd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D458C2B80000000" , vpsrlvd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E945CB" , vpsrlvq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9458C2B80000000" , vpsrlvq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9458C2B80000000" , vpsrlvq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED45CB" , vpsrlvq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED458C2B80000000" , vpsrlvq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED458C2B80000000" , vpsrlvq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D1CB" , vpsrlw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F171D201" , vpsrlw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9D18C2B80000000" , vpsrlw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D18C2B80000000" , vpsrlw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD1CB" , vpsrlw(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F571D201" , vpsrlw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDD18C2B80000000" , vpsrlw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD18C2B80000000" , vpsrlw(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F8CB" , vpsubb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F88C2B80000000" , vpsubb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F88C2B80000000" , vpsubb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF8CB" , vpsubb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF88C2B80000000" , vpsubb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF88C2B80000000" , vpsubb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FACB" , vpsubd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FA8C2B80000000" , vpsubd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FA8C2B80000000" , vpsubd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFACB" , vpsubd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFA8C2B80000000" , vpsubd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFA8C2B80000000" , vpsubd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FBCB" , vpsubq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FB8C2B80000000" , vpsubq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FB8C2B80000000" , vpsubq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFBCB" , vpsubq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFB8C2B80000000" , vpsubq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFB8C2B80000000" , vpsubq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E8CB" , vpsubsb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E88C2B80000000" , vpsubsb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E88C2B80000000" , vpsubsb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE8CB" , vpsubsb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE88C2B80000000" , vpsubsb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE88C2B80000000" , vpsubsb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E9CB" , vpsubsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E98C2B80000000" , vpsubsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E98C2B80000000" , vpsubsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE9CB" , vpsubsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE98C2B80000000" , vpsubsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE98C2B80000000" , vpsubsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D8CB" , vpsubusb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9D88C2B80000000" , vpsubusb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D88C2B80000000" , vpsubusb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD8CB" , vpsubusb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDD88C2B80000000" , vpsubusb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD88C2B80000000" , vpsubusb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D9CB" , vpsubusw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9D98C2B80000000" , vpsubusw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D98C2B80000000" , vpsubusw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD9CB" , vpsubusw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDD98C2B80000000" , vpsubusw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD98C2B80000000" , vpsubusw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F9CB" , vpsubw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F98C2B80000000" , vpsubw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F98C2B80000000" , vpsubw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF9CB" , vpsubw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF98C2B80000000" , vpsubw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF98C2B80000000" , vpsubw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E27917CA" , vptest(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279178C1A80000000" , vptest(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279178C1A80000000" , vptest(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D17CA" , vptest(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D178C1A80000000" , vptest(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D178C1A80000000" , vptest(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5E968CB" , vpunpckhbw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9688C2B80000000" , vpunpckhbw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9688C2B80000000" , vpunpckhbw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED68CB" , vpunpckhbw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED688C2B80000000" , vpunpckhbw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED688C2B80000000" , vpunpckhbw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E96ACB" , vpunpckhdq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E96A8C2B80000000" , vpunpckhdq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E96A8C2B80000000" , vpunpckhdq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6ACB" , vpunpckhdq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED6A8C2B80000000" , vpunpckhdq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6A8C2B80000000" , vpunpckhdq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E96DCB" , vpunpckhqdq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E96D8C2B80000000" , vpunpckhqdq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E96D8C2B80000000" , vpunpckhqdq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6DCB" , vpunpckhqdq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED6D8C2B80000000" , vpunpckhqdq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6D8C2B80000000" , vpunpckhqdq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E969CB" , vpunpckhwd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9698C2B80000000" , vpunpckhwd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9698C2B80000000" , vpunpckhwd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED69CB" , vpunpckhwd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED698C2B80000000" , vpunpckhwd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED698C2B80000000" , vpunpckhwd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E960CB" , vpunpcklbw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9608C2B80000000" , vpunpcklbw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9608C2B80000000" , vpunpcklbw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED60CB" , vpunpcklbw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED608C2B80000000" , vpunpcklbw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED608C2B80000000" , vpunpcklbw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E962CB" , vpunpckldq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9628C2B80000000" , vpunpckldq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9628C2B80000000" , vpunpckldq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED62CB" , vpunpckldq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED628C2B80000000" , vpunpckldq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED628C2B80000000" , vpunpckldq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E96CCB" , vpunpcklqdq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E96C8C2B80000000" , vpunpcklqdq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E96C8C2B80000000" , vpunpcklqdq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6CCB" , vpunpcklqdq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED6C8C2B80000000" , vpunpcklqdq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6C8C2B80000000" , vpunpcklqdq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E961CB" , vpunpcklwd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9618C2B80000000" , vpunpcklwd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9618C2B80000000" , vpunpcklwd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED61CB" , vpunpcklwd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED618C2B80000000" , vpunpcklwd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED618C2B80000000" , vpunpcklwd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EFCB" , vpxor(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EF8C2B80000000" , vpxor(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EF8C2B80000000" , vpxor(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEFCB" , vpxor(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEF8C2B80000000" , vpxor(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEF8C2B80000000" , vpxor(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F853CA" , vrcpps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8538C1A80000000" , vrcpps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F8538C1A80000000" , vrcpps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC53CA" , vrcpps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC538C1A80000000" , vrcpps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC538C1A80000000" , vrcpps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5EA53CB" , vrcpss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA538C2B80000000" , vrcpss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA538C2B80000000" , vrcpss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E37909CA01" , vroundpd(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E379098C1A8000000001" , vroundpd(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E379098C1A8000000001" , vroundpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D09CA01" , vroundpd(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D098C1A8000000001" , vroundpd(ymm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D098C1A8000000001" , vroundpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37908CA01" , vroundps(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E379088C1A8000000001" , vroundps(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E379088C1A8000000001" , vroundps(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D08CA01" , vroundps(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D088C1A8000000001" , vroundps(ymm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D088C1A8000000001" , vroundps(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690BCB01" , vroundsd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690B8C2B8000000001" , vroundsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690B8C2B8000000001" , vroundsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690ACB01" , vroundss(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690A8C2B8000000001" , vroundss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690A8C2B8000000001" , vroundss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5F852CA" , vrsqrtps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8528C1A80000000" , vrsqrtps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F8528C1A80000000" , vrsqrtps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC52CA" , vrsqrtps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC528C1A80000000" , vrsqrtps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC528C1A80000000" , vrsqrtps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5EA52CB" , vrsqrtss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA528C2B80000000" , vrsqrtss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA528C2B80000000" , vrsqrtss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9C6CB01" , vshufpd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5E9C68C2B8000000001" , vshufpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9C68C2B8000000001" , vshufpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EDC6CB01" , vshufpd(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C5EDC68C2B8000000001" , vshufpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EDC68C2B8000000001" , vshufpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E8C6CB01" , vshufps(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5E8C68C2B8000000001" , vshufps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E8C68C2B8000000001" , vshufps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5ECC6CB01" , vshufps(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C5ECC68C2B8000000001" , vshufps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5ECC68C2B8000000001" , vshufps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C5F951CA" , vsqrtpd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F9518C1A80000000" , vsqrtpd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F9518C1A80000000" , vsqrtpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD51CA" , vsqrtpd(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD518C1A80000000" , vsqrtpd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FD518C1A80000000" , vsqrtpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F851CA" , vsqrtps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8518C1A80000000" , vsqrtps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F8518C1A80000000" , vsqrtps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC51CA" , vsqrtps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC518C1A80000000" , vsqrtps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FC518C1A80000000" , vsqrtps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5EB51CB" , vsqrtsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB518C2B80000000" , vsqrtsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB518C2B80000000" , vsqrtsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA51CB" , vsqrtss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA518C2B80000000" , vsqrtss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA518C2B80000000" , vsqrtss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5F8AE9C1180000000" , vstmxcsr(ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("C5F8AE9C1180000000" , vstmxcsr(dword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("C5E95CCB" , vsubpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E95C8C2B80000000" , vsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E95C8C2B80000000" , vsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5CCB" , vsubpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED5C8C2B80000000" , vsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5C8C2B80000000" , vsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E85CCB" , vsubps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E85C8C2B80000000" , vsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E85C8C2B80000000" , vsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5CCB" , vsubps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC5C8C2B80000000" , vsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5C8C2B80000000" , vsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5CCB" , vsubsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5C8C2B80000000" , vsubsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5C8C2B80000000" , vsubsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5CCB" , vsubss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5C8C2B80000000" , vsubss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5C8C2B80000000" , vsubss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2790FCA" , vtestpd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2790F8C1A80000000" , vtestpd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2790F8C1A80000000" , vtestpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D0FCA" , vtestpd(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D0F8C1A80000000" , vtestpd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D0F8C1A80000000" , vtestpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2790ECA" , vtestps(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2790E8C1A80000000" , vtestps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E2790E8C1A80000000" , vtestps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D0ECA" , vtestps(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D0E8C1A80000000" , vtestps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D0E8C1A80000000" , vtestps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F92ECA" , vucomisd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F92E8C1A80000000" , vucomisd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F92E8C1A80000000" , vucomisd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F82ECA" , vucomiss(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F82E8C1A80000000" , vucomiss(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F82E8C1A80000000" , vucomiss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5E915CB" , vunpckhpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9158C2B80000000" , vunpckhpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9158C2B80000000" , vunpckhpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED15CB" , vunpckhpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED158C2B80000000" , vunpckhpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED158C2B80000000" , vunpckhpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E815CB" , vunpckhps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8158C2B80000000" , vunpckhps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E8158C2B80000000" , vunpckhps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC15CB" , vunpckhps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC158C2B80000000" , vunpckhps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC158C2B80000000" , vunpckhps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E914CB" , vunpcklpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9148C2B80000000" , vunpcklpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9148C2B80000000" , vunpcklpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED14CB" , vunpcklpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED148C2B80000000" , vunpcklpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED148C2B80000000" , vunpcklpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E814CB" , vunpcklps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8148C2B80000000" , vunpcklps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E8148C2B80000000" , vunpcklps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC14CB" , vunpcklps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC148C2B80000000" , vunpcklps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC148C2B80000000" , vunpcklps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E957CB" , vxorpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9578C2B80000000" , vxorpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E9578C2B80000000" , vxorpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED57CB" , vxorpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED578C2B80000000" , vxorpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5ED578C2B80000000" , vxorpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E857CB" , vxorps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8578C2B80000000" , vxorps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5E8578C2B80000000" , vxorps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC57CB" , vxorps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC578C2B80000000" , vxorps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5EC578C2B80000000" , vxorps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C5FC77" , vzeroall());
+ TEST_INSTRUCTION("C5F877" , vzeroupper());
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX_NE_CONVERT(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E27AB18C1A80000000" , vbcstnebf162ps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27AB18C1A80000000" , vbcstnebf162ps(xmm1, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27EB18C1A80000000" , vbcstnebf162ps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27EB18C1A80000000" , vbcstnebf162ps(ymm1, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279B18C1A80000000" , vbcstnesh2ps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279B18C1A80000000" , vbcstnesh2ps(xmm1, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27DB18C1A80000000" , vbcstnesh2ps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27DB18C1A80000000" , vbcstnesh2ps(ymm1, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27AB08C1A80000000" , vcvtneebf162ps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27AB08C1A80000000" , vcvtneebf162ps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27EB08C1A80000000" , vcvtneebf162ps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27EB08C1A80000000" , vcvtneebf162ps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279B08C1A80000000" , vcvtneeph2ps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E279B08C1A80000000" , vcvtneeph2ps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27DB08C1A80000000" , vcvtneeph2ps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27DB08C1A80000000" , vcvtneeph2ps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27BB08C1A80000000" , vcvtneobf162ps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27BB08C1A80000000" , vcvtneobf162ps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27FB08C1A80000000" , vcvtneobf162ps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27FB08C1A80000000" , vcvtneobf162ps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E278B08C1A80000000" , vcvtneoph2ps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E278B08C1A80000000" , vcvtneoph2ps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27CB08C1A80000000" , vcvtneoph2ps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27CB08C1A80000000" , vcvtneoph2ps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27A72CA" , vex().vcvtneps2bf16(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E27E72CA" , vex().vcvtneps2bf16(xmm1, ymm2));
+ TEST_INSTRUCTION("C4E27A728C1A80000000" , vex().vcvtneps2bf16(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E27E728C1A80000000" , vex().vcvtneps2bf16(xmm1, ymmword_ptr(rdx, rbx, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX_VNNI(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E25150F4" , vex().vpdpbusd(xmm6, xmm5, xmm4));
+ TEST_INSTRUCTION("C4E25550F4" , vex().vpdpbusd(ymm6, ymm5, ymm4));
+ TEST_INSTRUCTION("C4E25151F4" , vex().vpdpbusds(xmm6, xmm5, xmm4));
+ TEST_INSTRUCTION("C4E25551F4" , vex().vpdpbusds(ymm6, ymm5, ymm4));
+ TEST_INSTRUCTION("C4E25152F4" , vex().vpdpwssd(xmm6, xmm5, xmm4));
+ TEST_INSTRUCTION("C4E25552F4" , vex().vpdpwssd(ymm6, ymm5, ymm4));
+ TEST_INSTRUCTION("C4E25153F4" , vex().vpdpwssds(xmm6, xmm5, xmm4));
+ TEST_INSTRUCTION("C4E25553F4" , vex().vpdpwssds(ymm6, ymm5, ymm4));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX_VNNI_INT8(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E26B50CB" , vpdpbssd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26B508C2B80000000" , vpdpbssd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26B508C2B80000000" , vpdpbssd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26F50CB" , vpdpbssd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26F508C2B80000000" , vpdpbssd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26F508C2B80000000" , vpdpbssd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26B51CB" , vpdpbssds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26B518C2B80000000" , vpdpbssds(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26B518C2B80000000" , vpdpbssds(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26F51CB" , vpdpbssds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26F518C2B80000000" , vpdpbssds(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26F518C2B80000000" , vpdpbssds(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26A50CB" , vpdpbsud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26A508C2B80000000" , vpdpbsud(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26A508C2B80000000" , vpdpbsud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26E50CB" , vpdpbsud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26E508C2B80000000" , vpdpbsud(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26E508C2B80000000" , vpdpbsud(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26A51CB" , vpdpbsuds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26A518C2B80000000" , vpdpbsuds(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26A518C2B80000000" , vpdpbsuds(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26E51CB" , vpdpbsuds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26E518C2B80000000" , vpdpbsuds(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26E518C2B80000000" , vpdpbsuds(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26850CB" , vpdpbuud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268508C2B80000000" , vpdpbuud(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E268508C2B80000000" , vpdpbuud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26C50CB" , vpdpbuud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26C508C2B80000000" , vpdpbuud(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26C508C2B80000000" , vpdpbuud(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26851CB" , vpdpbuuds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268518C2B80000000" , vpdpbuuds(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E268518C2B80000000" , vpdpbuuds(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26C51CB" , vpdpbuuds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26C518C2B80000000" , vpdpbuuds(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26C518C2B80000000" , vpdpbuuds(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX_VNNI_INT16(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E26AD2CB" , vpdpwsud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26AD28C2B80000000" , vpdpwsud(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AD28C2B80000000" , vpdpwsud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ED2CB" , vpdpwsud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26ED28C2B80000000" , vpdpwsud(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ED28C2B80000000" , vpdpwsud(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AD3CB" , vpdpwsuds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26AD38C2B80000000" , vpdpwsuds(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AD38C2B80000000" , vpdpwsuds(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ED3CB" , vpdpwsuds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26ED38C2B80000000" , vpdpwsuds(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ED38C2B80000000" , vpdpwsuds(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269D2CB" , vpdpwusd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269D28C2B80000000" , vpdpwusd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269D28C2B80000000" , vpdpwusd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DD2CB" , vpdpwusd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DD28C2B80000000" , vpdpwusd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DD28C2B80000000" , vpdpwusd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269D3CB" , vpdpwusds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269D38C2B80000000" , vpdpwusds(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269D38C2B80000000" , vpdpwusds(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DD3CB" , vpdpwusds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DD38C2B80000000" , vpdpwusds(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DD38C2B80000000" , vpdpwusds(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E268D2CB" , vpdpwuud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268D28C2B80000000" , vpdpwuud(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E268D28C2B80000000" , vpdpwuud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26CD2CB" , vpdpwuud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26CD28C2B80000000" , vpdpwuud(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26CD28C2B80000000" , vpdpwuud(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E268D3CB" , vpdpwuuds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268D38C2B80000000" , vpdpwuuds(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E268D38C2B80000000" , vpdpwuuds(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26CD3CB" , vpdpwuuds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26CD38C2B80000000" , vpdpwuuds(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26CD38C2B80000000" , vpdpwuuds(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX_SHA512(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E27FCCCA" , vsha512msg1(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27FCDCA" , vsha512msg2(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E26FCBCB" , vsha512rnds2(ymm1, ymm2, xmm3));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX_SM3(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E268DACB" , vsm3msg1(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268DA8C2B80000000" , vsm3msg1(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E268DA8C2B80000000" , vsm3msg1(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DACB" , vsm3msg2(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269DA8C2B80000000" , vsm3msg2(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DA8C2B80000000" , vsm3msg2(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E369DECB01" , vsm3rnds2(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369DE8C2B8000000001" , vsm3rnds2(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369DE8C2B8000000001" , vsm3rnds2(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX_SM4(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E26ADACB" , vsm4key4(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26ADA8C2B80000000" , vsm4key4(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ADA8C2B80000000" , vsm4key4(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26EDACB" , vsm4key4(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26EDA8C2B80000000" , vsm4key4(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26EDA8C2B80000000" , vsm4key4(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26BDACB" , vsm4rnds4(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26BDA8C2B80000000" , vsm4rnds4(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26BDA8C2B80000000" , vsm4rnds4(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26FDACB" , vsm4rnds4(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26FDA8C2B80000000" , vsm4rnds4(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26FDA8C2B80000000" , vsm4rnds4(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerFMA(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E2E998CB" , vfmadd132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9988C2B80000000" , vfmadd132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9988C2B80000000" , vfmadd132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED98CB" , vfmadd132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED988C2B80000000" , vfmadd132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED988C2B80000000" , vfmadd132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26998CB" , vfmadd132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269988C2B80000000" , vfmadd132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269988C2B80000000" , vfmadd132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D98CB" , vfmadd132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D988C2B80000000" , vfmadd132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D988C2B80000000" , vfmadd132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E999CB" , vfmadd132sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9998C2B80000000" , vfmadd132sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9998C2B80000000" , vfmadd132sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26999CB" , vfmadd132ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269998C2B80000000" , vfmadd132ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269998C2B80000000" , vfmadd132ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A8CB" , vfmadd213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9A88C2B80000000" , vfmadd213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A88C2B80000000" , vfmadd213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA8CB" , vfmadd213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDA88C2B80000000" , vfmadd213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA88C2B80000000" , vfmadd213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A8CB" , vfmadd213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269A88C2B80000000" , vfmadd213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A88C2B80000000" , vfmadd213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA8CB" , vfmadd213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DA88C2B80000000" , vfmadd213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA88C2B80000000" , vfmadd213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A9CB" , vfmadd213sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9A98C2B80000000" , vfmadd213sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A98C2B80000000" , vfmadd213sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A9CB" , vfmadd213ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269A98C2B80000000" , vfmadd213ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A98C2B80000000" , vfmadd213ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B8CB" , vfmadd231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9B88C2B80000000" , vfmadd231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B88C2B80000000" , vfmadd231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB8CB" , vfmadd231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDB88C2B80000000" , vfmadd231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB88C2B80000000" , vfmadd231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B8CB" , vfmadd231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269B88C2B80000000" , vfmadd231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B88C2B80000000" , vfmadd231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB8CB" , vfmadd231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DB88C2B80000000" , vfmadd231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB88C2B80000000" , vfmadd231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B9CB" , vfmadd231sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9B98C2B80000000" , vfmadd231sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B98C2B80000000" , vfmadd231sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B9CB" , vfmadd231ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269B98C2B80000000" , vfmadd231ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B98C2B80000000" , vfmadd231ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E996CB" , vfmaddsub132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9968C2B80000000" , vfmaddsub132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9968C2B80000000" , vfmaddsub132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED96CB" , vfmaddsub132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED968C2B80000000" , vfmaddsub132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED968C2B80000000" , vfmaddsub132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26996CB" , vfmaddsub132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269968C2B80000000" , vfmaddsub132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269968C2B80000000" , vfmaddsub132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D96CB" , vfmaddsub132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D968C2B80000000" , vfmaddsub132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D968C2B80000000" , vfmaddsub132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A6CB" , vfmaddsub213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9A68C2B80000000" , vfmaddsub213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A68C2B80000000" , vfmaddsub213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA6CB" , vfmaddsub213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDA68C2B80000000" , vfmaddsub213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA68C2B80000000" , vfmaddsub213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A6CB" , vfmaddsub213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269A68C2B80000000" , vfmaddsub213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A68C2B80000000" , vfmaddsub213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA6CB" , vfmaddsub213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DA68C2B80000000" , vfmaddsub213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA68C2B80000000" , vfmaddsub213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B6CB" , vfmaddsub231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9B68C2B80000000" , vfmaddsub231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B68C2B80000000" , vfmaddsub231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB6CB" , vfmaddsub231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDB68C2B80000000" , vfmaddsub231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB68C2B80000000" , vfmaddsub231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B6CB" , vfmaddsub231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269B68C2B80000000" , vfmaddsub231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B68C2B80000000" , vfmaddsub231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB6CB" , vfmaddsub231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DB68C2B80000000" , vfmaddsub231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB68C2B80000000" , vfmaddsub231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99ACB" , vfmsub132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99A8C2B80000000" , vfmsub132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99A8C2B80000000" , vfmsub132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9ACB" , vfmsub132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED9A8C2B80000000" , vfmsub132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9A8C2B80000000" , vfmsub132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699ACB" , vfmsub132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699A8C2B80000000" , vfmsub132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699A8C2B80000000" , vfmsub132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9ACB" , vfmsub132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D9A8C2B80000000" , vfmsub132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9A8C2B80000000" , vfmsub132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99BCB" , vfmsub132sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99B8C2B80000000" , vfmsub132sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99B8C2B80000000" , vfmsub132sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699BCB" , vfmsub132ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699B8C2B80000000" , vfmsub132ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699B8C2B80000000" , vfmsub132ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AACB" , vfmsub213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AA8C2B80000000" , vfmsub213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AA8C2B80000000" , vfmsub213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAACB" , vfmsub213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDAA8C2B80000000" , vfmsub213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAA8C2B80000000" , vfmsub213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AACB" , vfmsub213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AA8C2B80000000" , vfmsub213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AA8C2B80000000" , vfmsub213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAACB" , vfmsub213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DAA8C2B80000000" , vfmsub213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAA8C2B80000000" , vfmsub213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9ABCB" , vfmsub213sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AB8C2B80000000" , vfmsub213sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AB8C2B80000000" , vfmsub213sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269ABCB" , vfmsub213ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AB8C2B80000000" , vfmsub213ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AB8C2B80000000" , vfmsub213ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BACB" , vfmsub231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BA8C2B80000000" , vfmsub231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BA8C2B80000000" , vfmsub231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBACB" , vfmsub231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDBA8C2B80000000" , vfmsub231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBA8C2B80000000" , vfmsub231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BACB" , vfmsub231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BA8C2B80000000" , vfmsub231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BA8C2B80000000" , vfmsub231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBACB" , vfmsub231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DBA8C2B80000000" , vfmsub231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBA8C2B80000000" , vfmsub231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BBCB" , vfmsub231sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BB8C2B80000000" , vfmsub231sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BB8C2B80000000" , vfmsub231sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BBCB" , vfmsub231ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BB8C2B80000000" , vfmsub231ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BB8C2B80000000" , vfmsub231ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E997CB" , vfmsubadd132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9978C2B80000000" , vfmsubadd132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9978C2B80000000" , vfmsubadd132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED97CB" , vfmsubadd132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED978C2B80000000" , vfmsubadd132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED978C2B80000000" , vfmsubadd132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26997CB" , vfmsubadd132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269978C2B80000000" , vfmsubadd132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269978C2B80000000" , vfmsubadd132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D97CB" , vfmsubadd132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D978C2B80000000" , vfmsubadd132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D978C2B80000000" , vfmsubadd132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A7CB" , vfmsubadd213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9A78C2B80000000" , vfmsubadd213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A78C2B80000000" , vfmsubadd213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA7CB" , vfmsubadd213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDA78C2B80000000" , vfmsubadd213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA78C2B80000000" , vfmsubadd213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A7CB" , vfmsubadd213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269A78C2B80000000" , vfmsubadd213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A78C2B80000000" , vfmsubadd213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA7CB" , vfmsubadd213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DA78C2B80000000" , vfmsubadd213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA78C2B80000000" , vfmsubadd213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B7CB" , vfmsubadd231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9B78C2B80000000" , vfmsubadd231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B78C2B80000000" , vfmsubadd231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB7CB" , vfmsubadd231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDB78C2B80000000" , vfmsubadd231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB78C2B80000000" , vfmsubadd231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B7CB" , vfmsubadd231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269B78C2B80000000" , vfmsubadd231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B78C2B80000000" , vfmsubadd231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB7CB" , vfmsubadd231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DB78C2B80000000" , vfmsubadd231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB78C2B80000000" , vfmsubadd231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99CCB" , vfnmadd132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99C8C2B80000000" , vfnmadd132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99C8C2B80000000" , vfnmadd132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9CCB" , vfnmadd132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED9C8C2B80000000" , vfnmadd132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9C8C2B80000000" , vfnmadd132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699CCB" , vfnmadd132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699C8C2B80000000" , vfnmadd132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699C8C2B80000000" , vfnmadd132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9CCB" , vfnmadd132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D9C8C2B80000000" , vfnmadd132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9C8C2B80000000" , vfnmadd132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99DCB" , vfnmadd132sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99D8C2B80000000" , vfnmadd132sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99D8C2B80000000" , vfnmadd132sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699DCB" , vfnmadd132ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699D8C2B80000000" , vfnmadd132ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699D8C2B80000000" , vfnmadd132ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9ACCB" , vfnmadd213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AC8C2B80000000" , vfnmadd213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AC8C2B80000000" , vfnmadd213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDACCB" , vfnmadd213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDAC8C2B80000000" , vfnmadd213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAC8C2B80000000" , vfnmadd213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269ACCB" , vfnmadd213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AC8C2B80000000" , vfnmadd213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AC8C2B80000000" , vfnmadd213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DACCB" , vfnmadd213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DAC8C2B80000000" , vfnmadd213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAC8C2B80000000" , vfnmadd213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9ADCB" , vfnmadd213sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AD8C2B80000000" , vfnmadd213sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AD8C2B80000000" , vfnmadd213sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269ADCB" , vfnmadd213ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AD8C2B80000000" , vfnmadd213ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AD8C2B80000000" , vfnmadd213ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BCCB" , vfnmadd231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BC8C2B80000000" , vfnmadd231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BC8C2B80000000" , vfnmadd231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBCCB" , vfnmadd231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDBC8C2B80000000" , vfnmadd231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBC8C2B80000000" , vfnmadd231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BCCB" , vfnmadd231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BC8C2B80000000" , vfnmadd231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BC8C2B80000000" , vfnmadd231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBCCB" , vfnmadd231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DBC8C2B80000000" , vfnmadd231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBC8C2B80000000" , vfnmadd231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BDCB" , vfnmadd231sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BD8C2B80000000" , vfnmadd231sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BD8C2B80000000" , vfnmadd231sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BDCB" , vfnmadd231ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BD8C2B80000000" , vfnmadd231ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BD8C2B80000000" , vfnmadd231ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99ECB" , vfnmsub132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99E8C2B80000000" , vfnmsub132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99E8C2B80000000" , vfnmsub132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9ECB" , vfnmsub132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED9E8C2B80000000" , vfnmsub132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9E8C2B80000000" , vfnmsub132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699ECB" , vfnmsub132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699E8C2B80000000" , vfnmsub132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699E8C2B80000000" , vfnmsub132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9ECB" , vfnmsub132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D9E8C2B80000000" , vfnmsub132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9E8C2B80000000" , vfnmsub132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99FCB" , vfnmsub132sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99F8C2B80000000" , vfnmsub132sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99F8C2B80000000" , vfnmsub132sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699FCB" , vfnmsub132ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699F8C2B80000000" , vfnmsub132ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699F8C2B80000000" , vfnmsub132ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AECB" , vfnmsub213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AE8C2B80000000" , vfnmsub213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AE8C2B80000000" , vfnmsub213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAECB" , vfnmsub213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDAE8C2B80000000" , vfnmsub213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAE8C2B80000000" , vfnmsub213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AECB" , vfnmsub213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AE8C2B80000000" , vfnmsub213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AE8C2B80000000" , vfnmsub213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAECB" , vfnmsub213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DAE8C2B80000000" , vfnmsub213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAE8C2B80000000" , vfnmsub213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AFCB" , vfnmsub213sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AF8C2B80000000" , vfnmsub213sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AF8C2B80000000" , vfnmsub213sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AFCB" , vfnmsub213ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AF8C2B80000000" , vfnmsub213ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AF8C2B80000000" , vfnmsub213ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BECB" , vfnmsub231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BE8C2B80000000" , vfnmsub231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BE8C2B80000000" , vfnmsub231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBECB" , vfnmsub231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDBE8C2B80000000" , vfnmsub231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBE8C2B80000000" , vfnmsub231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BECB" , vfnmsub231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BE8C2B80000000" , vfnmsub231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BE8C2B80000000" , vfnmsub231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBECB" , vfnmsub231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DBE8C2B80000000" , vfnmsub231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBE8C2B80000000" , vfnmsub231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BFCB" , vfnmsub231sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BF8C2B80000000" , vfnmsub231sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BF8C2B80000000" , vfnmsub231sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BFCB" , vfnmsub231ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BF8C2B80000000" , vfnmsub231ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BF8C2B80000000" , vfnmsub231ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerFMA4(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E3E969CC30" , vfmaddpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E9698C358000000030" , vfmaddpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E9698C358000000030" , vfmaddpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E369698C2B8000000060" , vfmaddpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E369698C2B8000000060" , vfmaddpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED69CC30" , vfmaddpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED698C358000000030" , vfmaddpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED698C358000000030" , vfmaddpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D698C2B8000000060" , vfmaddpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D698C2B8000000060" , vfmaddpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E968CC30" , vfmaddps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E9688C358000000030" , vfmaddps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E9688C358000000030" , vfmaddps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E369688C2B8000000060" , vfmaddps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E369688C2B8000000060" , vfmaddps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED68CC30" , vfmaddps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED688C358000000030" , vfmaddps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED688C358000000030" , vfmaddps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D688C2B8000000060" , vfmaddps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D688C2B8000000060" , vfmaddps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E96BCC30" , vfmaddsd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96B8C358000000030" , vfmaddsd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96B8C358000000030" , vfmaddsd(xmm1, xmm2, xmm3, qword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696B8C2B8000000060" , vfmaddsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696B8C2B8000000060" , vfmaddsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E96ACC30" , vfmaddss(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96A8C358000000030" , vfmaddss(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96A8C358000000030" , vfmaddss(xmm1, xmm2, xmm3, dword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696A8C2B8000000060" , vfmaddss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696A8C2B8000000060" , vfmaddss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E95DCC30" , vfmaddsubpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E95D8C358000000030" , vfmaddsubpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E95D8C358000000030" , vfmaddsubpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3695D8C2B8000000060" , vfmaddsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3695D8C2B8000000060" , vfmaddsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED5DCC30" , vfmaddsubpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED5D8C358000000030" , vfmaddsubpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED5D8C358000000030" , vfmaddsubpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D5D8C2B8000000060" , vfmaddsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D5D8C2B8000000060" , vfmaddsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E95CCC30" , vfmaddsubps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E95C8C358000000030" , vfmaddsubps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E95C8C358000000030" , vfmaddsubps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3695C8C2B8000000060" , vfmaddsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3695C8C2B8000000060" , vfmaddsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED5CCC30" , vfmaddsubps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED5C8C358000000030" , vfmaddsubps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED5C8C358000000030" , vfmaddsubps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D5C8C2B8000000060" , vfmaddsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D5C8C2B8000000060" , vfmaddsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E95FCC30" , vfmsubaddpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E95F8C358000000030" , vfmsubaddpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E95F8C358000000030" , vfmsubaddpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3695F8C2B8000000060" , vfmsubaddpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3695F8C2B8000000060" , vfmsubaddpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED5FCC30" , vfmsubaddpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED5F8C358000000030" , vfmsubaddpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED5F8C358000000030" , vfmsubaddpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D5F8C2B8000000060" , vfmsubaddpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D5F8C2B8000000060" , vfmsubaddpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E95ECC30" , vfmsubaddps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E95E8C358000000030" , vfmsubaddps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E95E8C358000000030" , vfmsubaddps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3695E8C2B8000000060" , vfmsubaddps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3695E8C2B8000000060" , vfmsubaddps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED5ECC30" , vfmsubaddps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED5E8C358000000030" , vfmsubaddps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED5E8C358000000030" , vfmsubaddps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D5E8C2B8000000060" , vfmsubaddps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D5E8C2B8000000060" , vfmsubaddps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E96DCC30" , vfmsubpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96D8C358000000030" , vfmsubpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96D8C358000000030" , vfmsubpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696D8C2B8000000060" , vfmsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696D8C2B8000000060" , vfmsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED6DCC30" , vfmsubpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED6D8C358000000030" , vfmsubpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED6D8C358000000030" , vfmsubpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D6D8C2B8000000060" , vfmsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D6D8C2B8000000060" , vfmsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E96CCC30" , vfmsubps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96C8C358000000030" , vfmsubps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96C8C358000000030" , vfmsubps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696C8C2B8000000060" , vfmsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696C8C2B8000000060" , vfmsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED6CCC30" , vfmsubps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED6C8C358000000030" , vfmsubps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED6C8C358000000030" , vfmsubps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D6C8C2B8000000060" , vfmsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D6C8C2B8000000060" , vfmsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E96FCC30" , vfmsubsd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96F8C358000000030" , vfmsubsd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96F8C358000000030" , vfmsubsd(xmm1, xmm2, xmm3, qword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696F8C2B8000000060" , vfmsubsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696F8C2B8000000060" , vfmsubsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E96ECC30" , vfmsubss(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96E8C358000000030" , vfmsubss(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96E8C358000000030" , vfmsubss(xmm1, xmm2, xmm3, dword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696E8C2B8000000060" , vfmsubss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696E8C2B8000000060" , vfmsubss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E979CC30" , vfnmaddpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E9798C358000000030" , vfnmaddpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E9798C358000000030" , vfnmaddpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E369798C2B8000000060" , vfnmaddpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E369798C2B8000000060" , vfnmaddpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED79CC30" , vfnmaddpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED798C358000000030" , vfnmaddpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED798C358000000030" , vfnmaddpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D798C2B8000000060" , vfnmaddpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D798C2B8000000060" , vfnmaddpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E978CC30" , vfnmaddps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E9788C358000000030" , vfnmaddps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E9788C358000000030" , vfnmaddps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E369788C2B8000000060" , vfnmaddps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E369788C2B8000000060" , vfnmaddps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED78CC30" , vfnmaddps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED788C358000000030" , vfnmaddps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED788C358000000030" , vfnmaddps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D788C2B8000000060" , vfnmaddps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D788C2B8000000060" , vfnmaddps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E97BCC30" , vfnmaddsd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97B8C358000000030" , vfnmaddsd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97B8C358000000030" , vfnmaddsd(xmm1, xmm2, xmm3, qword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697B8C2B8000000060" , vfnmaddsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697B8C2B8000000060" , vfnmaddsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E97ACC30" , vfnmaddss(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97A8C358000000030" , vfnmaddss(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97A8C358000000030" , vfnmaddss(xmm1, xmm2, xmm3, dword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697A8C2B8000000060" , vfnmaddss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697A8C2B8000000060" , vfnmaddss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E97DCC30" , vfnmsubpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97D8C358000000030" , vfnmsubpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97D8C358000000030" , vfnmsubpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697D8C2B8000000060" , vfnmsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697D8C2B8000000060" , vfnmsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED7DCC30" , vfnmsubpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED7D8C358000000030" , vfnmsubpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED7D8C358000000030" , vfnmsubpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D7D8C2B8000000060" , vfnmsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D7D8C2B8000000060" , vfnmsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E97CCC30" , vfnmsubps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97C8C358000000030" , vfnmsubps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97C8C358000000030" , vfnmsubps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697C8C2B8000000060" , vfnmsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697C8C2B8000000060" , vfnmsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED7CCC30" , vfnmsubps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED7C8C358000000030" , vfnmsubps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED7C8C358000000030" , vfnmsubps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D7C8C2B8000000060" , vfnmsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D7C8C2B8000000060" , vfnmsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E97FCC30" , vfnmsubsd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97F8C358000000030" , vfnmsubsd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97F8C358000000030" , vfnmsubsd(xmm1, xmm2, xmm3, qword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697F8C2B8000000060" , vfnmsubsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697F8C2B8000000060" , vfnmsubsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E97ECC30" , vfnmsubss(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97E8C358000000030" , vfnmsubss(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97E8C358000000030" , vfnmsubss(xmm1, xmm2, xmm3, dword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697E8C2B8000000060" , vfnmsubss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697E8C2B8000000060" , vfnmsubss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), xmm6));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerXOP(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("8FE97881CA" , vfrczpd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978818C1A80000000" , vfrczpd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978818C1A80000000" , vfrczpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97C81CA" , vfrczpd(ymm1, ymm2));
+ TEST_INSTRUCTION("8FE97C818C1A80000000" , vfrczpd(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97C818C1A80000000" , vfrczpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97880CA" , vfrczps(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978808C1A80000000" , vfrczps(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978808C1A80000000" , vfrczps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97C80CA" , vfrczps(ymm1, ymm2));
+ TEST_INSTRUCTION("8FE97C808C1A80000000" , vfrczps(ymm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97C808C1A80000000" , vfrczps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97883CA" , vfrczsd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978838C1A80000000" , vfrczsd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978838C1A80000000" , vfrczsd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE97882CA" , vfrczss(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978828C1A80000000" , vfrczss(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978828C1A80000000" , vfrczss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE868A2CB40" , vpcmov(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8E8A28C358000000030" , vpcmov(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("8FE8E8A28C358000000030" , vpcmov(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("8FE868A28C2B8000000060" , vpcmov(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A28C2B8000000060" , vpcmov(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86CA2CB40" , vpcmov(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("8FE8ECA28C358000000030" , vpcmov(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("8FE8ECA28C358000000030" , vpcmov(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("8FE86CA28C2B8000000060" , vpcmov(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("8FE86CA28C2B8000000060" , vpcmov(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
+ TEST_INSTRUCTION("8FE868CCCB01" , vpcomb(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868CC8C2B8000000001" , vpcomb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CC8C2B8000000001" , vpcomb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CECB01" , vpcomd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868CE8C2B8000000001" , vpcomd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CE8C2B8000000001" , vpcomd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CFCB01" , vpcomq(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868CF8C2B8000000001" , vpcomq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CF8C2B8000000001" , vpcomq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868ECCB01" , vpcomub(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868EC8C2B8000000001" , vpcomub(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EC8C2B8000000001" , vpcomub(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EECB01" , vpcomud(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868EE8C2B8000000001" , vpcomud(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EE8C2B8000000001" , vpcomud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EFCB01" , vpcomuq(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868EF8C2B8000000001" , vpcomuq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EF8C2B8000000001" , vpcomuq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EDCB01" , vpcomuw(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868ED8C2B8000000001" , vpcomuw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868ED8C2B8000000001" , vpcomuw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CDCB01" , vpcomw(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868CD8C2B8000000001" , vpcomw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CD8C2B8000000001" , vpcomw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE978C2CA" , vphaddbd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C28C1A80000000" , vphaddbd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C28C1A80000000" , vphaddbd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C3CA" , vphaddbq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C38C1A80000000" , vphaddbq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C38C1A80000000" , vphaddbq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C1CA" , vphaddbw(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C18C1A80000000" , vphaddbw(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C18C1A80000000" , vphaddbw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978CBCA" , vphadddq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978CB8C1A80000000" , vphadddq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978CB8C1A80000000" , vphadddq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D2CA" , vphaddubd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D28C1A80000000" , vphaddubd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D28C1A80000000" , vphaddubd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D3CA" , vphaddubq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D38C1A80000000" , vphaddubq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D38C1A80000000" , vphaddubq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D1CA" , vphaddubw(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D18C1A80000000" , vphaddubw(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D18C1A80000000" , vphaddubw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978DBCA" , vphaddudq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978DB8C1A80000000" , vphaddudq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978DB8C1A80000000" , vphaddudq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D6CA" , vphadduwd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D68C1A80000000" , vphadduwd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D68C1A80000000" , vphadduwd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D7CA" , vphadduwq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D78C1A80000000" , vphadduwq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D78C1A80000000" , vphadduwq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C6CA" , vphaddwd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C68C1A80000000" , vphaddwd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C68C1A80000000" , vphaddwd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C7CA" , vphaddwq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C78C1A80000000" , vphaddwq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C78C1A80000000" , vphaddwq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E1CA" , vphsubbw(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978E18C1A80000000" , vphsubbw(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E18C1A80000000" , vphsubbw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E3CA" , vphsubdq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978E38C1A80000000" , vphsubdq(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E38C1A80000000" , vphsubdq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E2CA" , vphsubwd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978E28C1A80000000" , vphsubwd(xmm1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E28C1A80000000" , vphsubwd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("8FE8689ECB40" , vpmacsdd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8689E8C2B8000000060" , vpmacsdd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8689E8C2B8000000060" , vpmacsdd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8689FCB40" , vpmacsdqh(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8689F8C2B8000000060" , vpmacsdqh(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8689F8C2B8000000060" , vpmacsdqh(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86897CB40" , vpmacsdql(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868978C2B8000000060" , vpmacsdql(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868978C2B8000000060" , vpmacsdql(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8688ECB40" , vpmacssdd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8688E8C2B8000000060" , vpmacssdd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8688E8C2B8000000060" , vpmacssdd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8688FCB40" , vpmacssdqh(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8688F8C2B8000000060" , vpmacssdqh(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8688F8C2B8000000060" , vpmacssdqh(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86887CB40" , vpmacssdql(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868878C2B8000000060" , vpmacssdql(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868878C2B8000000060" , vpmacssdql(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86886CB40" , vpmacsswd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868868C2B8000000060" , vpmacsswd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868868C2B8000000060" , vpmacsswd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86885CB40" , vpmacssww(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868858C2B8000000060" , vpmacssww(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868858C2B8000000060" , vpmacssww(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86896CB40" , vpmacswd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868968C2B8000000060" , vpmacswd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868968C2B8000000060" , vpmacswd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86895CB40" , vpmacsww(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868958C2B8000000060" , vpmacsww(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868958C2B8000000060" , vpmacsww(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A6CB40" , vpmadcsswd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868A68C2B8000000060" , vpmadcsswd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A68C2B8000000060" , vpmadcsswd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868B6CB40" , vpmadcswd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868B68C2B8000000060" , vpmadcswd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868B68C2B8000000060" , vpmadcswd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A3CB40" , vpperm(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8E8A38C358000000030" , vpperm(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("8FE8E8A38C358000000030" , vpperm(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
+ TEST_INSTRUCTION("8FE868A38C2B8000000060" , vpperm(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A38C2B8000000060" , vpperm(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE96090CA" , vprotb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE878C0CA01" , vprotb(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("8FE9E8908C2B80000000" , vprotb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8908C2B80000000" , vprotb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958908C1A80000000" , vprotb(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C08C1A8000000001" , vprotb(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE958908C1A80000000" , vprotb(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C08C1A8000000001" , vprotb(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE96092CA" , vprotd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE878C2CA01" , vprotd(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("8FE9E8928C2B80000000" , vprotd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8928C2B80000000" , vprotd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958928C1A80000000" , vprotd(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C28C1A8000000001" , vprotd(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE958928C1A80000000" , vprotd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C28C1A8000000001" , vprotd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE96093CA" , vprotq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE878C3CA01" , vprotq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("8FE9E8938C2B80000000" , vprotq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8938C2B80000000" , vprotq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958938C1A80000000" , vprotq(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C38C1A8000000001" , vprotq(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE958938C1A80000000" , vprotq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C38C1A8000000001" , vprotq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE96091CA" , vprotw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE878C1CA01" , vprotw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("8FE9E8918C2B80000000" , vprotw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8918C2B80000000" , vprotw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958918C1A80000000" , vprotw(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C18C1A8000000001" , vprotw(xmm1, ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE958918C1A80000000" , vprotw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C18C1A8000000001" , vprotw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE96098CA" , vpshab(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8988C2B80000000" , vpshab(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8988C2B80000000" , vpshab(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958988C1A80000000" , vpshab(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958988C1A80000000" , vpshab(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE9609ACA" , vpshad(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E89A8C2B80000000" , vpshad(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E89A8C2B80000000" , vpshad(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9589A8C1A80000000" , vpshad(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE9589A8C1A80000000" , vpshad(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE9609BCA" , vpshaq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E89B8C2B80000000" , vpshaq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E89B8C2B80000000" , vpshaq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9589B8C1A80000000" , vpshaq(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE9589B8C1A80000000" , vpshaq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96099CA" , vpshaw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8998C2B80000000" , vpshaw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8998C2B80000000" , vpshaw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958998C1A80000000" , vpshaw(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958998C1A80000000" , vpshaw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96094CA" , vpshlb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8948C2B80000000" , vpshlb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8948C2B80000000" , vpshlb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958948C1A80000000" , vpshlb(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958948C1A80000000" , vpshlb(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96096CA" , vpshld(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8968C2B80000000" , vpshld(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8968C2B80000000" , vpshld(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958968C1A80000000" , vpshld(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958968C1A80000000" , vpshld(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96097CA" , vpshlq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8978C2B80000000" , vpshlq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8978C2B80000000" , vpshlq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958978C1A80000000" , vpshlq(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958978C1A80000000" , vpshlq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96095CA" , vpshlw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8958C2B80000000" , vpshlw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8958C2B80000000" , vpshlw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("8FE958958C1A80000000" , vpshlw(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958958C1A80000000" , vpshlw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX512(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C5ED4ACB" , kaddb(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1ED4ACB" , kaddd(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1EC4ACB" , kaddq(k1, k2, k3));
+ TEST_INSTRUCTION("C5EC4ACB" , kaddw(k1, k2, k3));
+ TEST_INSTRUCTION("C5ED41CB" , kandb(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1ED41CB" , kandd(k1, k2, k3));
+ TEST_INSTRUCTION("C5ED42CB" , kandnb(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1ED42CB" , kandnd(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1EC42CB" , kandnq(k1, k2, k3));
+ TEST_INSTRUCTION("C5EC42CB" , kandnw(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1EC41CB" , kandq(k1, k2, k3));
+ TEST_INSTRUCTION("C5EC41CB" , kandw(k1, k2, k3));
+ TEST_INSTRUCTION("C5F992CA" , kmovb(k1, edx));
+ TEST_INSTRUCTION("C5F990CA" , kmovb(k1, k2));
+ TEST_INSTRUCTION("C5F9908C1A80000000" , kmovb(k1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F9908C1A80000000" , kmovb(k1, byte_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F993CA" , kmovb(ecx, k2));
+ TEST_INSTRUCTION("C5F9919C1180000000" , kmovb(ptr(rcx, rdx, 0, 128), k3));
+ TEST_INSTRUCTION("C5F9919C1180000000" , kmovb(byte_ptr(rcx, rdx, 0, 128), k3));
+ TEST_INSTRUCTION("C5FB92CA" , kmovd(k1, edx));
+ TEST_INSTRUCTION("C4E1F990CA" , kmovd(k1, k2));
+ TEST_INSTRUCTION("C4E1F9908C1A80000000" , kmovd(k1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1F9908C1A80000000" , kmovd(k1, dword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5FB93CA" , kmovd(ecx, k2));
+ TEST_INSTRUCTION("C4E1F9919C1180000000" , kmovd(ptr(rcx, rdx, 0, 128), k3));
+ TEST_INSTRUCTION("C4E1F9919C1180000000" , kmovd(dword_ptr(rcx, rdx, 0, 128), k3));
+ TEST_INSTRUCTION("C4E1FB92CA" , kmovq(k1, rdx));
+ TEST_INSTRUCTION("C4E1F890CA" , kmovq(k1, k2));
+ TEST_INSTRUCTION("C4E1F8908C1A80000000" , kmovq(k1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1F8908C1A80000000" , kmovq(k1, qword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C4E1FB93CA" , kmovq(rcx, k2));
+ TEST_INSTRUCTION("C4E1F8919C1180000000" , kmovq(ptr(rcx, rdx, 0, 128), k3));
+ TEST_INSTRUCTION("C4E1F8919C1180000000" , kmovq(qword_ptr(rcx, rdx, 0, 128), k3));
+ TEST_INSTRUCTION("C5F892CA" , kmovw(k1, edx));
+ TEST_INSTRUCTION("C5F890CA" , kmovw(k1, k2));
+ TEST_INSTRUCTION("C5F8908C1A80000000" , kmovw(k1, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F8908C1A80000000" , kmovw(k1, word_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("C5F893CA" , kmovw(ecx, k2));
+ TEST_INSTRUCTION("C5F8919C1180000000" , kmovw(ptr(rcx, rdx, 0, 128), k3));
+ TEST_INSTRUCTION("C5F8919C1180000000" , kmovw(word_ptr(rcx, rdx, 0, 128), k3));
+ TEST_INSTRUCTION("C5F944CA" , knotb(k1, k2));
+ TEST_INSTRUCTION("C4E1F944CA" , knotd(k1, k2));
+ TEST_INSTRUCTION("C4E1F844CA" , knotq(k1, k2));
+ TEST_INSTRUCTION("C5F844CA" , knotw(k1, k2));
+ TEST_INSTRUCTION("C5ED45CB" , korb(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1ED45CB" , kord(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1EC45CB" , korq(k1, k2, k3));
+ TEST_INSTRUCTION("C5F998CA" , kortestb(k1, k2));
+ TEST_INSTRUCTION("C4E1F998CA" , kortestd(k1, k2));
+ TEST_INSTRUCTION("C4E1F898CA" , kortestq(k1, k2));
+ TEST_INSTRUCTION("C5F898CA" , kortestw(k1, k2));
+ TEST_INSTRUCTION("C5EC45CB" , korw(k1, k2, k3));
+ TEST_INSTRUCTION("C4E37932CA01" , kshiftlb(k1, k2, 1));
+ TEST_INSTRUCTION("C4E37933CA01" , kshiftld(k1, k2, 1));
+ TEST_INSTRUCTION("C4E3F933CA01" , kshiftlq(k1, k2, 1));
+ TEST_INSTRUCTION("C4E3F932CA01" , kshiftlw(k1, k2, 1));
+ TEST_INSTRUCTION("C4E37930CA01" , kshiftrb(k1, k2, 1));
+ TEST_INSTRUCTION("C4E37931CA01" , kshiftrd(k1, k2, 1));
+ TEST_INSTRUCTION("C4E3F931CA01" , kshiftrq(k1, k2, 1));
+ TEST_INSTRUCTION("C4E3F930CA01" , kshiftrw(k1, k2, 1));
+ TEST_INSTRUCTION("C5F999CA" , ktestb(k1, k2));
+ TEST_INSTRUCTION("C4E1F999CA" , ktestd(k1, k2));
+ TEST_INSTRUCTION("C4E1F899CA" , ktestq(k1, k2));
+ TEST_INSTRUCTION("C5F899CA" , ktestw(k1, k2));
+ TEST_INSTRUCTION("C5ED4BCB" , kunpckbw(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1EC4BCB" , kunpckdq(k1, k2, k3));
+ TEST_INSTRUCTION("C5EC4BCB" , kunpckwd(k1, k2, k3));
+ TEST_INSTRUCTION("C5ED46CB" , kxnorb(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1ED46CB" , kxnord(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1EC46CB" , kxnorq(k1, k2, k3));
+ TEST_INSTRUCTION("C5EC46CB" , kxnorw(k1, k2, k3));
+ TEST_INSTRUCTION("C5ED47CB" , kxorb(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1ED47CB" , kxord(k1, k2, k3));
+ TEST_INSTRUCTION("C4E1EC47CB" , kxorq(k1, k2, k3));
+ TEST_INSTRUCTION("C5EC47CB" , kxorw(k1, k2, k3));
+ TEST_INSTRUCTION("62F25F489A4C1A08" , v4fmaddps(zmm1, zmm4, zmm5, zmm6, zmm7, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("62F25F489A4C1A08" , v4fmaddps(zmm1, zmm4, zmm5, zmm6, zmm7, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("62F25F089B4C1A08" , v4fmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("62F25F089B4C1A08" , v4fmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("62F25F48AA4C1A08" , v4fnmaddps(zmm1, zmm4, zmm5, zmm6, zmm7, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("62F25F48AA4C1A08" , v4fnmaddps(zmm1, zmm4, zmm5, zmm6, zmm7, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("62F25F08AB4C1A08" , v4fnmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("62F25F08AB4C1A08" , v4fnmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, xmmword_ptr(rdx, rbx, 0, 128)));
+ TEST_INSTRUCTION("62F1ED4858CB" , vaddpd(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F1ED48584C2B02" , vaddpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F1ED48584C2B02" , vaddpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F16C4858CB" , vaddps(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F16C48584C2B02" , vaddps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F16C48584C2B02" , vaddps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D48DECB" , vaesdec(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F26D48DE4C2B02" , vaesdec(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D48DE4C2B02" , vaesdec(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D48DFCB" , vaesdeclast(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F26D48DF4C2B02" , vaesdeclast(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D48DF4C2B02" , vaesdeclast(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D48DCCB" , vaesenc(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F26D48DC4C2B02" , vaesenc(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D48DC4C2B02" , vaesenc(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D48DDCB" , vaesenclast(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F26D48DD4C2B02" , vaesenclast(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D48DD4C2B02" , vaesenclast(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F36D0803CB01" , valignd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("62F36D08034C2B0801" , valignd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F36D08034C2B0801" , valignd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F36D2803CB01" , valignd(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("62F36D28034C2B0401" , valignd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F36D28034C2B0401" , valignd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F36D4803CB01" , valignd(zmm1, zmm2, zmm3, 1));
+ TEST_INSTRUCTION("62F36D48034C2B0201" , valignd(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F36D48034C2B0201" , valignd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F3ED0803CB01" , valignq(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("62F3ED08034C2B0801" , valignq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F3ED08034C2B0801" , valignq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F3ED2803CB01" , valignq(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("62F3ED28034C2B0401" , valignq(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F3ED28034C2B0401" , valignq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F3ED4803CB01" , valignq(zmm1, zmm2, zmm3, 1));
+ TEST_INSTRUCTION("62F3ED48034C2B0201" , valignq(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F3ED48034C2B0201" , valignq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F1ED4855CB" , vandnpd(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F1ED48554C2B02" , vandnpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F1ED48554C2B02" , vandnpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F16C4855CB" , vandnps(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F16C48554C2B02" , vandnps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F16C48554C2B02" , vandnps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F1ED4854CB" , vandpd(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F1ED48544C2B02" , vandpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F1ED48544C2B02" , vandpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F16C4854CB" , vandps(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F16C48544C2B02" , vandps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F16C48544C2B02" , vandps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F2ED0865CB" , vblendmpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("62F2ED08654C2B08" , vblendmpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F2ED08654C2B08" , vblendmpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F2ED2865CB" , vblendmpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("62F2ED28654C2B04" , vblendmpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F2ED28654C2B04" , vblendmpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F2ED4865CB" , vblendmpd(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F2ED48654C2B02" , vblendmpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F2ED48654C2B02" , vblendmpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D0865CB" , vblendmps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("62F26D08654C2B08" , vblendmps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D08654C2B08" , vblendmps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D2865CB" , vblendmps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("62F26D28654C2B04" , vblendmps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D28654C2B04" , vblendmps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D4865CB" , vblendmps(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F26D48654C2B02" , vblendmps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F26D48654C2B02" , vblendmps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F27D2819CA" , vbroadcastf32x2(ymm1, xmm2));
TEST_INSTRUCTION("62F27D28194C1A10" , vbroadcastf32x2(ymm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D28194C1A10" , vbroadcastf32x2(ymm1, qword_ptr(rdx, rbx, 0, 128)));
@@ -3270,8 +5635,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD481A4C1A08" , vbroadcastf64x2(zmm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD481B4C1A04" , vbroadcastf64x4(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD481B4C1A04" , vbroadcastf64x4(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D5A8C1A80000000" , vbroadcasti128(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D5A8C1A80000000" , vbroadcasti128(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D0859CA" , vbroadcasti32x2(xmm1, xmm2));
TEST_INSTRUCTION("62F27D08594C1A10" , vbroadcasti32x2(xmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D08594C1A10" , vbroadcasti32x2(xmm1, qword_ptr(rdx, rbx, 0, 128)));
@@ -3293,69 +5656,36 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD485A4C1A08" , vbroadcasti64x2(zmm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD485B4C1A04" , vbroadcasti64x4(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD485B4C1A04" , vbroadcasti64x4(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D19CA" , vbroadcastsd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D198C1A80000000" , vbroadcastsd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D198C1A80000000" , vbroadcastsd(ymm1, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD4819CA" , vbroadcastsd(zmm1, xmm2));
TEST_INSTRUCTION("62F2FD48194C1A10" , vbroadcastsd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD48194C1A10" , vbroadcastsd(zmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27918CA" , vbroadcastss(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279188C1A80000000" , vbroadcastss(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279188C1A80000000" , vbroadcastss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D18CA" , vbroadcastss(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D188C1A80000000" , vbroadcastss(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D188C1A80000000" , vbroadcastss(ymm1, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4818CA" , vbroadcastss(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48184C1A20" , vbroadcastss(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48184C1A20" , vbroadcastss(zmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5E9C2CB01" , vcmppd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5E9C28C2B8000000001" , vcmppd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C28C2B8000000001" , vcmppd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED08C2CB01" , vcmppd(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F1ED08C24C2B0801" , vcmppd(k1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED08C24C2B0801" , vcmppd(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5EDC2CB01" , vcmppd(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C5EDC28C2B8000000001" , vcmppd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5EDC28C2B8000000001" , vcmppd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED28C2CB01" , vcmppd(k1, ymm2, ymm3, 1));
TEST_INSTRUCTION("62F1ED28C24C2B0401" , vcmppd(k1, ymm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED28C24C2B0401" , vcmppd(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED48C2CB01" , vcmppd(k1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F1ED48C24C2B0201" , vcmppd(k1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED48C24C2B0201" , vcmppd(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E8C2CB01" , vcmpps(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5E8C28C2B8000000001" , vcmpps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E8C28C2B8000000001" , vcmpps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16C08C2CB01" , vcmpps(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F16C08C24C2B0801" , vcmpps(k1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16C08C24C2B0801" , vcmpps(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5ECC2CB01" , vcmpps(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C5ECC28C2B8000000001" , vcmpps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5ECC28C2B8000000001" , vcmpps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16C28C2CB01" , vcmpps(k1, ymm2, ymm3, 1));
TEST_INSTRUCTION("62F16C28C24C2B0401" , vcmpps(k1, ymm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16C28C24C2B0401" , vcmpps(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16C48C2CB01" , vcmpps(k1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F16C48C24C2B0201" , vcmpps(k1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16C48C24C2B0201" , vcmpps(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5EBC2CB01" , vcmpsd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5EBC28C2B8000000001" , vcmpsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5EBC28C2B8000000001" , vcmpsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1EF08C2CB01" , vcmpsd(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F1EF08C24C2B1001" , vcmpsd(k1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1EF08C24C2B1001" , vcmpsd(k1, xmm2, qword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5EAC2CB01" , vcmpss(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5EAC28C2B8000000001" , vcmpss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5EAC28C2B8000000001" , vcmpss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16E08C2CB01" , vcmpss(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F16E08C24C2B2001" , vcmpss(k1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16E08C24C2B2001" , vcmpss(k1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5F92FCA" , vcomisd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F92F8C1A80000000" , vcomisd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F92F8C1A80000000" , vcomisd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F82FCA" , vcomiss(xmm1, xmm2));
- TEST_INSTRUCTION("C5F82F8C1A80000000" , vcomiss(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F82F8C1A80000000" , vcomiss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD088AD1" , vcompresspd(xmm1, xmm2));
TEST_INSTRUCTION("62F2FD088A5C1110" , vcompresspd(ptr(rcx, rdx, 0, 128), xmm3));
TEST_INSTRUCTION("62F2FD088A5C1110" , vcompresspd(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
@@ -3374,21 +5704,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27D488AD1" , vcompressps(zmm1, zmm2));
TEST_INSTRUCTION("62F27D488A5C1120" , vcompressps(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F27D488A5C1120" , vcompressps(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5FAE6CA" , vcvtdq2pd(xmm1, xmm2));
- TEST_INSTRUCTION("C5FAE68C1A80000000" , vcvtdq2pd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FAE68C1A80000000" , vcvtdq2pd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FEE6CA" , vcvtdq2pd(ymm1, xmm2));
- TEST_INSTRUCTION("C5FEE68C1A80000000" , vcvtdq2pd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FEE68C1A80000000" , vcvtdq2pd(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E48E6CA" , vcvtdq2pd(zmm1, ymm2));
TEST_INSTRUCTION("62F17E48E64C1A04" , vcvtdq2pd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E48E64C1A04" , vcvtdq2pd(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F85BCA" , vcvtdq2ps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F85B8C1A80000000" , vcvtdq2ps(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F85B8C1A80000000" , vcvtdq2ps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC5BCA" , vcvtdq2ps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC5B8C1A80000000" , vcvtdq2ps(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC5B8C1A80000000" , vcvtdq2ps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C485BCA" , vcvtdq2ps(zmm1, zmm2));
TEST_INSTRUCTION("62F17C485B4C1A02" , vcvtdq2ps(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C485B4C1A02" , vcvtdq2ps(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
@@ -3408,17 +5726,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27E4872CA" , vcvtneps2bf16(ymm1, zmm2));
TEST_INSTRUCTION("62F27E48724C1A02" , vcvtneps2bf16(ymm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27E48724C1A02" , vcvtneps2bf16(ymm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FBE6CA" , vcvtpd2dq(xmm1, xmm2));
- TEST_INSTRUCTION("C5FFE6CA" , vcvtpd2dq(xmm1, ymm2));
- TEST_INSTRUCTION("C5FBE68C1A80000000" , vcvtpd2dq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FFE68C1A80000000" , vcvtpd2dq(xmm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FF48E6CA" , vcvtpd2dq(ymm1, zmm2));
TEST_INSTRUCTION("62F1FF48E64C1A02" , vcvtpd2dq(ymm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FF48E64C1A02" , vcvtpd2dq(ymm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F95ACA" , vcvtpd2ps(xmm1, xmm2));
- TEST_INSTRUCTION("C5FD5ACA" , vcvtpd2ps(xmm1, ymm2));
- TEST_INSTRUCTION("C5F95A8C1A80000000" , vcvtpd2ps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD5A8C1A80000000" , vcvtpd2ps(xmm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD485ACA" , vcvtpd2ps(ymm1, zmm2));
TEST_INSTRUCTION("62F1FD485A4C1A02" , vcvtpd2ps(ymm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD485A4C1A02" , vcvtpd2ps(ymm1, zmmword_ptr(rdx, rbx, 0, 128)));
@@ -3447,39 +5757,15 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1FD4879CA" , vcvtpd2uqq(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48794C1A02" , vcvtpd2uqq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD48794C1A02" , vcvtpd2uqq(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27913CA" , vcvtph2ps(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279138C1A80000000" , vcvtph2ps(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279138C1A80000000" , vcvtph2ps(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D13CA" , vcvtph2ps(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D138C1A80000000" , vcvtph2ps(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D138C1A80000000" , vcvtph2ps(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4813CA" , vcvtph2ps(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48134C1A04" , vcvtph2ps(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48134C1A04" , vcvtph2ps(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F95BCA" , vcvtps2dq(xmm1, xmm2));
- TEST_INSTRUCTION("C5F95B8C1A80000000" , vcvtps2dq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F95B8C1A80000000" , vcvtps2dq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD5BCA" , vcvtps2dq(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD5B8C1A80000000" , vcvtps2dq(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD5B8C1A80000000" , vcvtps2dq(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17D485BCA" , vcvtps2dq(zmm1, zmm2));
TEST_INSTRUCTION("62F17D485B4C1A02" , vcvtps2dq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17D485B4C1A02" , vcvtps2dq(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F85ACA" , vcvtps2pd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F85A8C1A80000000" , vcvtps2pd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F85A8C1A80000000" , vcvtps2pd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC5ACA" , vcvtps2pd(ymm1, xmm2));
- TEST_INSTRUCTION("C5FC5A8C1A80000000" , vcvtps2pd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC5A8C1A80000000" , vcvtps2pd(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C485ACA" , vcvtps2pd(zmm1, ymm2));
TEST_INSTRUCTION("62F17C485A4C1A04" , vcvtps2pd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C485A4C1A04" , vcvtps2pd(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E3791DD101" , vcvtps2ph(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E3791D9C118000000001" , vcvtps2ph(ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E3791D9C118000000001" , vcvtps2ph(qword_ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E37D1DD101" , vcvtps2ph(xmm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D1D9C118000000001" , vcvtps2ph(ptr(rcx, rdx, 0, 128), ymm3, 1));
- TEST_INSTRUCTION("C4E37D1D9C118000000001" , vcvtps2ph(xmmword_ptr(rcx, rdx, 0, 128), ymm3, 1));
TEST_INSTRUCTION("62F37D481DD101" , vcvtps2ph(ymm1, zmm2, 1));
TEST_INSTRUCTION("62F37D481D5C110401" , vcvtps2ph(ptr(rcx, rdx, 0, 128), zmm3, 1));
TEST_INSTRUCTION("62F37D481D5C110401" , vcvtps2ph(ymmword_ptr(rcx, rdx, 0, 128), zmm3, 1));
@@ -3526,50 +5812,18 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1FC485BCA" , vcvtqq2ps(ymm1, zmm2));
TEST_INSTRUCTION("62F1FC485B4C1A02" , vcvtqq2ps(ymm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FC485B4C1A02" , vcvtqq2ps(ymm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FB2DCA" , vcvtsd2si(ecx, xmm2));
- TEST_INSTRUCTION("C5FB2D8C1A80000000" , vcvtsd2si(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FB2D8C1A80000000" , vcvtsd2si(ecx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1FB2DCA" , vcvtsd2si(rcx, xmm2));
- TEST_INSTRUCTION("C4E1FB2D8C1A80000000" , vcvtsd2si(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1FB2D8C1A80000000" , vcvtsd2si(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5EB5ACB" , vcvtsd2ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5A8C2B80000000" , vcvtsd2ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB5A8C2B80000000" , vcvtsd2ss(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F17F0879CA" , vcvtsd2usi(ecx, xmm2));
TEST_INSTRUCTION("62F17F08794C1A10" , vcvtsd2usi(ecx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17F08794C1A10" , vcvtsd2usi(ecx, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FF0879CA" , vcvtsd2usi(rcx, xmm2));
TEST_INSTRUCTION("62F1FF08794C1A10" , vcvtsd2usi(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FF08794C1A10" , vcvtsd2usi(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5EB2ACB" , vcvtsi2sd(xmm1, xmm2, ebx));
- TEST_INSTRUCTION("C4E1EB2ACB" , vcvtsi2sd(xmm1, xmm2, rbx));
- TEST_INSTRUCTION("C5EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E1EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA2ACB" , vcvtsi2ss(xmm1, xmm2, ebx));
- TEST_INSTRUCTION("C4E1EA2ACB" , vcvtsi2ss(xmm1, xmm2, rbx));
- TEST_INSTRUCTION("C5EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E1EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5ACB" , vcvtss2sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5A8C2B80000000" , vcvtss2sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5A8C2B80000000" , vcvtss2sd(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5FA2DCA" , vcvtss2si(ecx, xmm2));
- TEST_INSTRUCTION("C5FA2D8C1A80000000" , vcvtss2si(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA2D8C1A80000000" , vcvtss2si(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1FA2DCA" , vcvtss2si(rcx, xmm2));
- TEST_INSTRUCTION("C4E1FA2D8C1A80000000" , vcvtss2si(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1FA2D8C1A80000000" , vcvtss2si(rcx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E0879CA" , vcvtss2usi(ecx, xmm2));
TEST_INSTRUCTION("62F17E08794C1A20" , vcvtss2usi(ecx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E08794C1A20" , vcvtss2usi(ecx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FE0879CA" , vcvtss2usi(rcx, xmm2));
TEST_INSTRUCTION("62F1FE08794C1A20" , vcvtss2usi(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FE08794C1A20" , vcvtss2usi(rcx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F9E6CA" , vcvttpd2dq(xmm1, xmm2));
- TEST_INSTRUCTION("C5FDE6CA" , vcvttpd2dq(xmm1, ymm2));
- TEST_INSTRUCTION("C5F9E68C1A80000000" , vcvttpd2dq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FDE68C1A80000000" , vcvttpd2dq(xmm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD48E6CA" , vcvttpd2dq(ymm1, zmm2));
TEST_INSTRUCTION("62F1FD48E64C1A02" , vcvttpd2dq(ymm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD48E64C1A02" , vcvttpd2dq(ymm1, zmmword_ptr(rdx, rbx, 0, 128)));
@@ -3598,12 +5852,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1FD4878CA" , vcvttpd2uqq(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48784C1A02" , vcvttpd2uqq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD48784C1A02" , vcvttpd2uqq(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA5BCA" , vcvttps2dq(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA5B8C1A80000000" , vcvttps2dq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA5B8C1A80000000" , vcvttps2dq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FE5BCA" , vcvttps2dq(ymm1, ymm2));
- TEST_INSTRUCTION("C5FE5B8C1A80000000" , vcvttps2dq(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FE5B8C1A80000000" , vcvttps2dq(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E485BCA" , vcvttps2dq(zmm1, zmm2));
TEST_INSTRUCTION("62F17E485B4C1A02" , vcvttps2dq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E485B4C1A02" , vcvttps2dq(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
@@ -3634,24 +5882,12 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F17D4878CA" , vcvttps2uqq(zmm1, ymm2));
TEST_INSTRUCTION("62F17D48784C1A04" , vcvttps2uqq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17D48784C1A04" , vcvttps2uqq(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FB2CCA" , vcvttsd2si(ecx, xmm2));
- TEST_INSTRUCTION("C5FB2C8C1A80000000" , vcvttsd2si(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FB2C8C1A80000000" , vcvttsd2si(ecx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1FB2CCA" , vcvttsd2si(rcx, xmm2));
- TEST_INSTRUCTION("C4E1FB2C8C1A80000000" , vcvttsd2si(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1FB2C8C1A80000000" , vcvttsd2si(rcx, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17F0878CA" , vcvttsd2usi(ecx, xmm2));
TEST_INSTRUCTION("62F17F08784C1A10" , vcvttsd2usi(ecx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17F08784C1A10" , vcvttsd2usi(ecx, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FF0878CA" , vcvttsd2usi(rcx, xmm2));
TEST_INSTRUCTION("62F1FF08784C1A10" , vcvttsd2usi(rcx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FF08784C1A10" , vcvttsd2usi(rcx, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA2CCA" , vcvttss2si(ecx, xmm2));
- TEST_INSTRUCTION("C5FA2C8C1A80000000" , vcvttss2si(ecx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA2C8C1A80000000" , vcvttss2si(ecx, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1FA2CCA" , vcvttss2si(rcx, xmm2));
- TEST_INSTRUCTION("C4E1FA2C8C1A80000000" , vcvttss2si(rcx, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E1FA2C8C1A80000000" , vcvttss2si(rcx, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E0878CA" , vcvttss2usi(ecx, xmm2));
TEST_INSTRUCTION("62F17E08784C1A20" , vcvttss2usi(ecx, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E08784C1A20" , vcvttss2usi(ecx, dword_ptr(rdx, rbx, 0, 128)));
@@ -3711,30 +5947,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D4842CB01" , vdbpsadbw(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F36D48424C2B0201" , vdbpsadbw(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D48424C2B0201" , vdbpsadbw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E95ECB" , vdivpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E95E8C2B80000000" , vdivpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E95E8C2B80000000" , vdivpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED5ECB" , vdivpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED5E8C2B80000000" , vdivpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED5E8C2B80000000" , vdivpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F1ED485ECB" , vdivpd(zmm1, zmm2, zmm3));
- TEST_INSTRUCTION("62F1ED485E4C2B02" , vdivpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("62F1ED485E4C2B02" , vdivpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E85ECB" , vdivps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E85E8C2B80000000" , vdivps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E85E8C2B80000000" , vdivps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC5ECB" , vdivps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC5E8C2B80000000" , vdivps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC5E8C2B80000000" , vdivps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C485ECB" , vdivps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C485E4C2B02" , vdivps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C485E4C2B02" , vdivps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB5ECB" , vdivsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5E8C2B80000000" , vdivsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB5E8C2B80000000" , vdivsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5ECB" , vdivss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5E8C2B80000000" , vdivss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5E8C2B80000000" , vdivss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26E0852CB" , vdpbf16ps(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26E08524C2B08" , vdpbf16ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26E08524C2B08" , vdpbf16ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -3744,15 +5959,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26E4852CB" , vdpbf16ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26E48524C2B02" , vdpbf16ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26E48524C2B02" , vdpbf16ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E36941CB01" , vdppd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369418C2B8000000001" , vdppd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369418C2B8000000001" , vdppd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36940CB01" , vdpps(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369408C2B8000000001" , vdpps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369408C2B8000000001" , vdpps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D40CB01" , vdpps(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D408C2B8000000001" , vdpps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D408C2B8000000001" , vdpps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
+ TEST_INSTRUCTION("62F1ED485ECB" , vdivpd(zmm1, zmm2, zmm3));
+ TEST_INSTRUCTION("62F1ED485E4C2B02" , vdivpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
+ TEST_INSTRUCTION("62F1ED485E4C2B02" , vdivpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2FD48C8CA" , vexp2pd(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48C84C1A02" , vexp2pd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD48C84C1A02" , vexp2pd(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
@@ -3777,9 +5986,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27D4888CA" , vexpandps(zmm1, zmm2));
TEST_INSTRUCTION("62F27D48884C1A20" , vexpandps(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48884C1A20" , vexpandps(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E37D19D101" , vextractf128(xmm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D199C118000000001" , vextractf128(ptr(rcx, rdx, 0, 128), ymm3, 1));
- TEST_INSTRUCTION("C4E37D199C118000000001" , vextractf128(xmmword_ptr(rcx, rdx, 0, 128), ymm3, 1));
TEST_INSTRUCTION("62F37D2819D101" , vextractf32x4(xmm1, ymm2, 1));
TEST_INSTRUCTION("62F37D4819D101" , vextractf32x4(xmm1, zmm2, 1));
TEST_INSTRUCTION("62F37D28195C110801" , vextractf32x4(ptr(rcx, rdx, 0, 128), ymm3, 1));
@@ -3798,9 +6004,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3FD481BD101" , vextractf64x4(ymm1, zmm2, 1));
TEST_INSTRUCTION("62F3FD481B5C110401" , vextractf64x4(ptr(rcx, rdx, 0, 128), zmm3, 1));
TEST_INSTRUCTION("62F3FD481B5C110401" , vextractf64x4(ymmword_ptr(rcx, rdx, 0, 128), zmm3, 1));
- TEST_INSTRUCTION("C4E37D39D101" , vextracti128(xmm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D399C118000000001" , vextracti128(ptr(rcx, rdx, 0, 128), ymm3, 1));
- TEST_INSTRUCTION("C4E37D399C118000000001" , vextracti128(xmmword_ptr(rcx, rdx, 0, 128), ymm3, 1));
TEST_INSTRUCTION("62F37D2839D101" , vextracti32x4(xmm1, ymm2, 1));
TEST_INSTRUCTION("62F37D4839D101" , vextracti32x4(xmm1, zmm2, 1));
TEST_INSTRUCTION("62F37D28395C110801" , vextracti32x4(ptr(rcx, rdx, 0, 128), ymm3, 1));
@@ -3819,9 +6022,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3FD483BD101" , vextracti64x4(ymm1, zmm2, 1));
TEST_INSTRUCTION("62F3FD483B5C110401" , vextracti64x4(ptr(rcx, rdx, 0, 128), zmm3, 1));
TEST_INSTRUCTION("62F3FD483B5C110401" , vextracti64x4(ymmword_ptr(rcx, rdx, 0, 128), zmm3, 1));
- TEST_INSTRUCTION("C4E37917D101" , vextractps(ecx, xmm2, 1));
- TEST_INSTRUCTION("C4E379179C118000000001" , vextractps(ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E379179C118000000001" , vextractps(dword_ptr(rcx, rdx, 0, 128), xmm3, 1));
TEST_INSTRUCTION("62F3ED0854CB01" , vfixupimmpd(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F3ED08544C2B0801" , vfixupimmpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED08544C2B0801" , vfixupimmpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
@@ -3846,562 +6046,114 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D0855CB01" , vfixupimmss(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08554C2B2001" , vfixupimmss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08554C2B2001" , vfixupimmss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E2E998CB" , vfmadd132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9988C2B80000000" , vfmadd132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9988C2B80000000" , vfmadd132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED98CB" , vfmadd132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED988C2B80000000" , vfmadd132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED988C2B80000000" , vfmadd132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED4898CB" , vfmadd132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48984C2B02" , vfmadd132pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48984C2B02" , vfmadd132pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26998CB" , vfmadd132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269988C2B80000000" , vfmadd132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269988C2B80000000" , vfmadd132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D98CB" , vfmadd132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D988C2B80000000" , vfmadd132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D988C2B80000000" , vfmadd132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4898CB" , vfmadd132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48984C2B02" , vfmadd132ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48984C2B02" , vfmadd132ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E999CB" , vfmadd132sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9998C2B80000000" , vfmadd132sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9998C2B80000000" , vfmadd132sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26999CB" , vfmadd132ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269998C2B80000000" , vfmadd132ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269998C2B80000000" , vfmadd132ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A8CB" , vfmadd213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9A88C2B80000000" , vfmadd213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A88C2B80000000" , vfmadd213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA8CB" , vfmadd213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDA88C2B80000000" , vfmadd213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA88C2B80000000" , vfmadd213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A8CB" , vfmadd213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48A84C2B02" , vfmadd213pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A84C2B02" , vfmadd213pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269A8CB" , vfmadd213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269A88C2B80000000" , vfmadd213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269A88C2B80000000" , vfmadd213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA8CB" , vfmadd213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DA88C2B80000000" , vfmadd213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA88C2B80000000" , vfmadd213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48A8CB" , vfmadd213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48A84C2B02" , vfmadd213ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48A84C2B02" , vfmadd213ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A9CB" , vfmadd213sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9A98C2B80000000" , vfmadd213sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A98C2B80000000" , vfmadd213sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269A9CB" , vfmadd213ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269A98C2B80000000" , vfmadd213ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269A98C2B80000000" , vfmadd213ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B8CB" , vfmadd231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9B88C2B80000000" , vfmadd231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B88C2B80000000" , vfmadd231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB8CB" , vfmadd231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDB88C2B80000000" , vfmadd231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB88C2B80000000" , vfmadd231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B8CB" , vfmadd231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48B84C2B02" , vfmadd231pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B84C2B02" , vfmadd231pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269B8CB" , vfmadd231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269B88C2B80000000" , vfmadd231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269B88C2B80000000" , vfmadd231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB8CB" , vfmadd231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DB88C2B80000000" , vfmadd231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB88C2B80000000" , vfmadd231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48B8CB" , vfmadd231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48B84C2B02" , vfmadd231ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48B84C2B02" , vfmadd231ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B9CB" , vfmadd231sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9B98C2B80000000" , vfmadd231sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B98C2B80000000" , vfmadd231sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269B9CB" , vfmadd231ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269B98C2B80000000" , vfmadd231ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269B98C2B80000000" , vfmadd231ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E3E969CC30" , vfmaddpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E9698C358000000030" , vfmaddpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E9698C358000000030" , vfmaddpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E369698C2B8000000060" , vfmaddpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E369698C2B8000000060" , vfmaddpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED69CC30" , vfmaddpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED698C358000000030" , vfmaddpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED698C358000000030" , vfmaddpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D698C2B8000000060" , vfmaddpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D698C2B8000000060" , vfmaddpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E968CC30" , vfmaddps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E9688C358000000030" , vfmaddps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E9688C358000000030" , vfmaddps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E369688C2B8000000060" , vfmaddps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E369688C2B8000000060" , vfmaddps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED68CC30" , vfmaddps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED688C358000000030" , vfmaddps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED688C358000000030" , vfmaddps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D688C2B8000000060" , vfmaddps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D688C2B8000000060" , vfmaddps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E96BCC30" , vfmaddsd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96B8C358000000030" , vfmaddsd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96B8C358000000030" , vfmaddsd(xmm1, xmm2, xmm3, qword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3696B8C2B8000000060" , vfmaddsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696B8C2B8000000060" , vfmaddsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3E96ACC30" , vfmaddss(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96A8C358000000030" , vfmaddss(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96A8C358000000030" , vfmaddss(xmm1, xmm2, xmm3, dword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3696A8C2B8000000060" , vfmaddss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696A8C2B8000000060" , vfmaddss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E2E996CB" , vfmaddsub132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9968C2B80000000" , vfmaddsub132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9968C2B80000000" , vfmaddsub132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED96CB" , vfmaddsub132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED968C2B80000000" , vfmaddsub132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED968C2B80000000" , vfmaddsub132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED4896CB" , vfmaddsub132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48964C2B02" , vfmaddsub132pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48964C2B02" , vfmaddsub132pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26996CB" , vfmaddsub132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269968C2B80000000" , vfmaddsub132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269968C2B80000000" , vfmaddsub132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D96CB" , vfmaddsub132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D968C2B80000000" , vfmaddsub132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D968C2B80000000" , vfmaddsub132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4896CB" , vfmaddsub132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48964C2B02" , vfmaddsub132ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48964C2B02" , vfmaddsub132ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A6CB" , vfmaddsub213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9A68C2B80000000" , vfmaddsub213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A68C2B80000000" , vfmaddsub213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA6CB" , vfmaddsub213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDA68C2B80000000" , vfmaddsub213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA68C2B80000000" , vfmaddsub213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A6CB" , vfmaddsub213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48A64C2B02" , vfmaddsub213pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A64C2B02" , vfmaddsub213pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269A6CB" , vfmaddsub213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269A68C2B80000000" , vfmaddsub213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269A68C2B80000000" , vfmaddsub213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA6CB" , vfmaddsub213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DA68C2B80000000" , vfmaddsub213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA68C2B80000000" , vfmaddsub213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48A6CB" , vfmaddsub213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48A64C2B02" , vfmaddsub213ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48A64C2B02" , vfmaddsub213ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B6CB" , vfmaddsub231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9B68C2B80000000" , vfmaddsub231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B68C2B80000000" , vfmaddsub231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB6CB" , vfmaddsub231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDB68C2B80000000" , vfmaddsub231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB68C2B80000000" , vfmaddsub231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B6CB" , vfmaddsub231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48B64C2B02" , vfmaddsub231pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B64C2B02" , vfmaddsub231pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269B6CB" , vfmaddsub231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269B68C2B80000000" , vfmaddsub231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269B68C2B80000000" , vfmaddsub231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB6CB" , vfmaddsub231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DB68C2B80000000" , vfmaddsub231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB68C2B80000000" , vfmaddsub231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48B6CB" , vfmaddsub231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48B64C2B02" , vfmaddsub231ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48B64C2B02" , vfmaddsub231ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E3E95DCC30" , vfmaddsubpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E95D8C358000000030" , vfmaddsubpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E95D8C358000000030" , vfmaddsubpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3695D8C2B8000000060" , vfmaddsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3695D8C2B8000000060" , vfmaddsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED5DCC30" , vfmaddsubpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED5D8C358000000030" , vfmaddsubpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED5D8C358000000030" , vfmaddsubpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D5D8C2B8000000060" , vfmaddsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D5D8C2B8000000060" , vfmaddsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E95CCC30" , vfmaddsubps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E95C8C358000000030" , vfmaddsubps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E95C8C358000000030" , vfmaddsubps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3695C8C2B8000000060" , vfmaddsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3695C8C2B8000000060" , vfmaddsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED5CCC30" , vfmaddsubps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED5C8C358000000030" , vfmaddsubps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED5C8C358000000030" , vfmaddsubps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D5C8C2B8000000060" , vfmaddsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D5C8C2B8000000060" , vfmaddsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E2E99ACB" , vfmsub132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99A8C2B80000000" , vfmsub132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99A8C2B80000000" , vfmsub132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9ACB" , vfmsub132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED9A8C2B80000000" , vfmsub132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9A8C2B80000000" , vfmsub132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED489ACB" , vfmsub132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED489A4C2B02" , vfmsub132pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED489A4C2B02" , vfmsub132pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699ACB" , vfmsub132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699A8C2B80000000" , vfmsub132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699A8C2B80000000" , vfmsub132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9ACB" , vfmsub132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D9A8C2B80000000" , vfmsub132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9A8C2B80000000" , vfmsub132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D489ACB" , vfmsub132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D489A4C2B02" , vfmsub132ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D489A4C2B02" , vfmsub132ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99BCB" , vfmsub132sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99B8C2B80000000" , vfmsub132sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99B8C2B80000000" , vfmsub132sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699BCB" , vfmsub132ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699B8C2B80000000" , vfmsub132ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699B8C2B80000000" , vfmsub132ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AACB" , vfmsub213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AA8C2B80000000" , vfmsub213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AA8C2B80000000" , vfmsub213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAACB" , vfmsub213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDAA8C2B80000000" , vfmsub213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAA8C2B80000000" , vfmsub213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AACB" , vfmsub213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48AA4C2B02" , vfmsub213pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AA4C2B02" , vfmsub213pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269AACB" , vfmsub213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AA8C2B80000000" , vfmsub213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269AA8C2B80000000" , vfmsub213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAACB" , vfmsub213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DAA8C2B80000000" , vfmsub213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAA8C2B80000000" , vfmsub213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48AACB" , vfmsub213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48AA4C2B02" , vfmsub213ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48AA4C2B02" , vfmsub213ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9ABCB" , vfmsub213sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AB8C2B80000000" , vfmsub213sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AB8C2B80000000" , vfmsub213sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269ABCB" , vfmsub213ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AB8C2B80000000" , vfmsub213ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269AB8C2B80000000" , vfmsub213ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BACB" , vfmsub231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BA8C2B80000000" , vfmsub231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BA8C2B80000000" , vfmsub231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBACB" , vfmsub231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDBA8C2B80000000" , vfmsub231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBA8C2B80000000" , vfmsub231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BACB" , vfmsub231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48BA4C2B02" , vfmsub231pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BA4C2B02" , vfmsub231pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BACB" , vfmsub231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BA8C2B80000000" , vfmsub231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BA8C2B80000000" , vfmsub231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBACB" , vfmsub231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DBA8C2B80000000" , vfmsub231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBA8C2B80000000" , vfmsub231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48BACB" , vfmsub231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48BA4C2B02" , vfmsub231ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48BA4C2B02" , vfmsub231ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BBCB" , vfmsub231sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BB8C2B80000000" , vfmsub231sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BB8C2B80000000" , vfmsub231sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BBCB" , vfmsub231ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BB8C2B80000000" , vfmsub231ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BB8C2B80000000" , vfmsub231ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E997CB" , vfmsubadd132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9978C2B80000000" , vfmsubadd132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9978C2B80000000" , vfmsubadd132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED97CB" , vfmsubadd132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED978C2B80000000" , vfmsubadd132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED978C2B80000000" , vfmsubadd132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED4897CB" , vfmsubadd132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48974C2B02" , vfmsubadd132pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48974C2B02" , vfmsubadd132pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26997CB" , vfmsubadd132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269978C2B80000000" , vfmsubadd132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269978C2B80000000" , vfmsubadd132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D97CB" , vfmsubadd132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D978C2B80000000" , vfmsubadd132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D978C2B80000000" , vfmsubadd132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4897CB" , vfmsubadd132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48974C2B02" , vfmsubadd132ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48974C2B02" , vfmsubadd132ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A7CB" , vfmsubadd213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9A78C2B80000000" , vfmsubadd213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A78C2B80000000" , vfmsubadd213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA7CB" , vfmsubadd213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDA78C2B80000000" , vfmsubadd213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA78C2B80000000" , vfmsubadd213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A7CB" , vfmsubadd213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48A74C2B02" , vfmsubadd213pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A74C2B02" , vfmsubadd213pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269A7CB" , vfmsubadd213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269A78C2B80000000" , vfmsubadd213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269A78C2B80000000" , vfmsubadd213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA7CB" , vfmsubadd213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DA78C2B80000000" , vfmsubadd213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA78C2B80000000" , vfmsubadd213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48A7CB" , vfmsubadd213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48A74C2B02" , vfmsubadd213ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48A74C2B02" , vfmsubadd213ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B7CB" , vfmsubadd231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9B78C2B80000000" , vfmsubadd231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B78C2B80000000" , vfmsubadd231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB7CB" , vfmsubadd231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDB78C2B80000000" , vfmsubadd231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB78C2B80000000" , vfmsubadd231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B7CB" , vfmsubadd231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48B74C2B02" , vfmsubadd231pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B74C2B02" , vfmsubadd231pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269B7CB" , vfmsubadd231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269B78C2B80000000" , vfmsubadd231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269B78C2B80000000" , vfmsubadd231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB7CB" , vfmsubadd231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DB78C2B80000000" , vfmsubadd231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB78C2B80000000" , vfmsubadd231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48B7CB" , vfmsubadd231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48B74C2B02" , vfmsubadd231ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48B74C2B02" , vfmsubadd231ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E3E95FCC30" , vfmsubaddpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E95F8C358000000030" , vfmsubaddpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E95F8C358000000030" , vfmsubaddpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3695F8C2B8000000060" , vfmsubaddpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3695F8C2B8000000060" , vfmsubaddpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED5FCC30" , vfmsubaddpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED5F8C358000000030" , vfmsubaddpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED5F8C358000000030" , vfmsubaddpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D5F8C2B8000000060" , vfmsubaddpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D5F8C2B8000000060" , vfmsubaddpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E95ECC30" , vfmsubaddps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E95E8C358000000030" , vfmsubaddps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E95E8C358000000030" , vfmsubaddps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3695E8C2B8000000060" , vfmsubaddps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3695E8C2B8000000060" , vfmsubaddps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED5ECC30" , vfmsubaddps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED5E8C358000000030" , vfmsubaddps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED5E8C358000000030" , vfmsubaddps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D5E8C2B8000000060" , vfmsubaddps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D5E8C2B8000000060" , vfmsubaddps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E96DCC30" , vfmsubpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96D8C358000000030" , vfmsubpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96D8C358000000030" , vfmsubpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3696D8C2B8000000060" , vfmsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696D8C2B8000000060" , vfmsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED6DCC30" , vfmsubpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED6D8C358000000030" , vfmsubpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED6D8C358000000030" , vfmsubpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D6D8C2B8000000060" , vfmsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D6D8C2B8000000060" , vfmsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E96CCC30" , vfmsubps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96C8C358000000030" , vfmsubps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96C8C358000000030" , vfmsubps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3696C8C2B8000000060" , vfmsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696C8C2B8000000060" , vfmsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED6CCC30" , vfmsubps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED6C8C358000000030" , vfmsubps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED6C8C358000000030" , vfmsubps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D6C8C2B8000000060" , vfmsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D6C8C2B8000000060" , vfmsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E96FCC30" , vfmsubsd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96F8C358000000030" , vfmsubsd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96F8C358000000030" , vfmsubsd(xmm1, xmm2, xmm3, qword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3696F8C2B8000000060" , vfmsubsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696F8C2B8000000060" , vfmsubsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3E96ECC30" , vfmsubss(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96E8C358000000030" , vfmsubss(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96E8C358000000030" , vfmsubss(xmm1, xmm2, xmm3, dword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3696E8C2B8000000060" , vfmsubss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696E8C2B8000000060" , vfmsubss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E2E99CCB" , vfnmadd132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99C8C2B80000000" , vfnmadd132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99C8C2B80000000" , vfnmadd132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9CCB" , vfnmadd132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED9C8C2B80000000" , vfnmadd132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9C8C2B80000000" , vfnmadd132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED489CCB" , vfnmadd132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED489C4C2B02" , vfnmadd132pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED489C4C2B02" , vfnmadd132pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699CCB" , vfnmadd132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699C8C2B80000000" , vfnmadd132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699C8C2B80000000" , vfnmadd132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9CCB" , vfnmadd132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D9C8C2B80000000" , vfnmadd132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9C8C2B80000000" , vfnmadd132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D489CCB" , vfnmadd132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D489C4C2B02" , vfnmadd132ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D489C4C2B02" , vfnmadd132ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99DCB" , vfnmadd132sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99D8C2B80000000" , vfnmadd132sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99D8C2B80000000" , vfnmadd132sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699DCB" , vfnmadd132ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699D8C2B80000000" , vfnmadd132ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699D8C2B80000000" , vfnmadd132ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9ACCB" , vfnmadd213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AC8C2B80000000" , vfnmadd213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AC8C2B80000000" , vfnmadd213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDACCB" , vfnmadd213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDAC8C2B80000000" , vfnmadd213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAC8C2B80000000" , vfnmadd213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48ACCB" , vfnmadd213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48AC4C2B02" , vfnmadd213pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AC4C2B02" , vfnmadd213pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269ACCB" , vfnmadd213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AC8C2B80000000" , vfnmadd213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269AC8C2B80000000" , vfnmadd213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DACCB" , vfnmadd213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DAC8C2B80000000" , vfnmadd213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAC8C2B80000000" , vfnmadd213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48ACCB" , vfnmadd213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48AC4C2B02" , vfnmadd213ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48AC4C2B02" , vfnmadd213ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9ADCB" , vfnmadd213sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AD8C2B80000000" , vfnmadd213sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AD8C2B80000000" , vfnmadd213sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269ADCB" , vfnmadd213ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AD8C2B80000000" , vfnmadd213ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269AD8C2B80000000" , vfnmadd213ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BCCB" , vfnmadd231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BC8C2B80000000" , vfnmadd231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BC8C2B80000000" , vfnmadd231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBCCB" , vfnmadd231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDBC8C2B80000000" , vfnmadd231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBC8C2B80000000" , vfnmadd231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BCCB" , vfnmadd231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48BC4C2B02" , vfnmadd231pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BC4C2B02" , vfnmadd231pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BCCB" , vfnmadd231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BC8C2B80000000" , vfnmadd231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BC8C2B80000000" , vfnmadd231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBCCB" , vfnmadd231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DBC8C2B80000000" , vfnmadd231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBC8C2B80000000" , vfnmadd231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48BCCB" , vfnmadd231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48BC4C2B02" , vfnmadd231ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48BC4C2B02" , vfnmadd231ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BDCB" , vfnmadd231sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BD8C2B80000000" , vfnmadd231sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BD8C2B80000000" , vfnmadd231sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BDCB" , vfnmadd231ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BD8C2B80000000" , vfnmadd231ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BD8C2B80000000" , vfnmadd231ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E3E979CC30" , vfnmaddpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E9798C358000000030" , vfnmaddpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E9798C358000000030" , vfnmaddpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E369798C2B8000000060" , vfnmaddpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E369798C2B8000000060" , vfnmaddpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED79CC30" , vfnmaddpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED798C358000000030" , vfnmaddpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED798C358000000030" , vfnmaddpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D798C2B8000000060" , vfnmaddpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D798C2B8000000060" , vfnmaddpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E978CC30" , vfnmaddps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E9788C358000000030" , vfnmaddps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E9788C358000000030" , vfnmaddps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E369788C2B8000000060" , vfnmaddps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E369788C2B8000000060" , vfnmaddps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED78CC30" , vfnmaddps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED788C358000000030" , vfnmaddps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED788C358000000030" , vfnmaddps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D788C2B8000000060" , vfnmaddps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D788C2B8000000060" , vfnmaddps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E97BCC30" , vfnmaddsd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97B8C358000000030" , vfnmaddsd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97B8C358000000030" , vfnmaddsd(xmm1, xmm2, xmm3, qword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3697B8C2B8000000060" , vfnmaddsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697B8C2B8000000060" , vfnmaddsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3E97ACC30" , vfnmaddss(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97A8C358000000030" , vfnmaddss(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97A8C358000000030" , vfnmaddss(xmm1, xmm2, xmm3, dword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3697A8C2B8000000060" , vfnmaddss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697A8C2B8000000060" , vfnmaddss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E2E99ECB" , vfnmsub132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99E8C2B80000000" , vfnmsub132pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99E8C2B80000000" , vfnmsub132pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9ECB" , vfnmsub132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED9E8C2B80000000" , vfnmsub132pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9E8C2B80000000" , vfnmsub132pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED489ECB" , vfnmsub132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED489E4C2B02" , vfnmsub132pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED489E4C2B02" , vfnmsub132pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699ECB" , vfnmsub132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699E8C2B80000000" , vfnmsub132ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699E8C2B80000000" , vfnmsub132ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9ECB" , vfnmsub132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D9E8C2B80000000" , vfnmsub132ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9E8C2B80000000" , vfnmsub132ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D489ECB" , vfnmsub132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D489E4C2B02" , vfnmsub132ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D489E4C2B02" , vfnmsub132ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99FCB" , vfnmsub132sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99F8C2B80000000" , vfnmsub132sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99F8C2B80000000" , vfnmsub132sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699FCB" , vfnmsub132ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699F8C2B80000000" , vfnmsub132ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2699F8C2B80000000" , vfnmsub132ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AECB" , vfnmsub213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AE8C2B80000000" , vfnmsub213pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AE8C2B80000000" , vfnmsub213pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAECB" , vfnmsub213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDAE8C2B80000000" , vfnmsub213pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAE8C2B80000000" , vfnmsub213pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AECB" , vfnmsub213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48AE4C2B02" , vfnmsub213pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AE4C2B02" , vfnmsub213pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269AECB" , vfnmsub213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AE8C2B80000000" , vfnmsub213ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269AE8C2B80000000" , vfnmsub213ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAECB" , vfnmsub213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DAE8C2B80000000" , vfnmsub213ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAE8C2B80000000" , vfnmsub213ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48AECB" , vfnmsub213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48AE4C2B02" , vfnmsub213ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48AE4C2B02" , vfnmsub213ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AFCB" , vfnmsub213sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AF8C2B80000000" , vfnmsub213sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AF8C2B80000000" , vfnmsub213sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269AFCB" , vfnmsub213ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AF8C2B80000000" , vfnmsub213ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269AF8C2B80000000" , vfnmsub213ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BECB" , vfnmsub231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BE8C2B80000000" , vfnmsub231pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BE8C2B80000000" , vfnmsub231pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBECB" , vfnmsub231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDBE8C2B80000000" , vfnmsub231pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBE8C2B80000000" , vfnmsub231pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BECB" , vfnmsub231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48BE4C2B02" , vfnmsub231pd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BE4C2B02" , vfnmsub231pd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BECB" , vfnmsub231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BE8C2B80000000" , vfnmsub231ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BE8C2B80000000" , vfnmsub231ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBECB" , vfnmsub231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DBE8C2B80000000" , vfnmsub231ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBE8C2B80000000" , vfnmsub231ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48BECB" , vfnmsub231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48BE4C2B02" , vfnmsub231ps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48BE4C2B02" , vfnmsub231ps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BFCB" , vfnmsub231sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BF8C2B80000000" , vfnmsub231sd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BF8C2B80000000" , vfnmsub231sd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BFCB" , vfnmsub231ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BF8C2B80000000" , vfnmsub231ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269BF8C2B80000000" , vfnmsub231ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E3E97DCC30" , vfnmsubpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97D8C358000000030" , vfnmsubpd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97D8C358000000030" , vfnmsubpd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3697D8C2B8000000060" , vfnmsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697D8C2B8000000060" , vfnmsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED7DCC30" , vfnmsubpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED7D8C358000000030" , vfnmsubpd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED7D8C358000000030" , vfnmsubpd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D7D8C2B8000000060" , vfnmsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D7D8C2B8000000060" , vfnmsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E97CCC30" , vfnmsubps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97C8C358000000030" , vfnmsubps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97C8C358000000030" , vfnmsubps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3697C8C2B8000000060" , vfnmsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697C8C2B8000000060" , vfnmsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED7CCC30" , vfnmsubps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED7C8C358000000030" , vfnmsubps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED7C8C358000000030" , vfnmsubps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E36D7C8C2B8000000060" , vfnmsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D7C8C2B8000000060" , vfnmsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E97FCC30" , vfnmsubsd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97F8C358000000030" , vfnmsubsd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97F8C358000000030" , vfnmsubsd(xmm1, xmm2, xmm3, qword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3697F8C2B8000000060" , vfnmsubsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697F8C2B8000000060" , vfnmsubsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3E97ECC30" , vfnmsubss(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97E8C358000000030" , vfnmsubss(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97E8C358000000030" , vfnmsubss(xmm1, xmm2, xmm3, dword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("C4E3697E8C2B8000000060" , vfnmsubss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697E8C2B8000000060" , vfnmsubss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), xmm6));
TEST_INSTRUCTION("62F3FD0866CA01" , vfpclasspd(k1, xmm2, 1));
TEST_INSTRUCTION("62F3FD2866CA01" , vfpclasspd(k1, ymm2, 1));
TEST_INSTRUCTION("62F3FD4866CA01" , vfpclasspd(k1, zmm2, 1));
@@ -4420,31 +6172,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F37D0867CA01" , vfpclassss(k1, xmm2, 1));
TEST_INSTRUCTION("62F37D08674C1A2001" , vfpclassss(k1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F37D08674C1A2001" , vfpclassss(k1, dword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FE97881CA" , vfrczpd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978818C1A80000000" , vfrczpd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978818C1A80000000" , vfrczpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97C81CA" , vfrczpd(ymm1, ymm2));
- TEST_INSTRUCTION("8FE97C818C1A80000000" , vfrczpd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97C818C1A80000000" , vfrczpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97880CA" , vfrczps(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978808C1A80000000" , vfrczps(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978808C1A80000000" , vfrczps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97C80CA" , vfrczps(ymm1, ymm2));
- TEST_INSTRUCTION("8FE97C808C1A80000000" , vfrczps(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97C808C1A80000000" , vfrczps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97883CA" , vfrczsd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978838C1A80000000" , vfrczsd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978838C1A80000000" , vfrczsd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE97882CA" , vfrczss(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978828C1A80000000" , vfrczss(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978828C1A80000000" , vfrczss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2D9928C1A80000000" , vgatherdpd(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E2DD928C1A80000000" , vgatherdpd(ymm1, ptr(rdx, xmm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F2FD09924C1A10" , k(k1).vgatherdpd(xmm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD29924C1A10" , k(k1).vgatherdpd(ymm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD49924C1A10" , k(k1).vgatherdpd(zmm1, ptr(rdx, ymm3, 0, 128)));
- TEST_INSTRUCTION("C4E259928C1A80000000" , vgatherdps(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E25D928C1A80000000" , vgatherdps(ymm1, ptr(rdx, ymm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F27D09924C1A20" , k(k1).vgatherdps(xmm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F27D29924C1A20" , k(k1).vgatherdps(ymm1, ptr(rdx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F27D49924C1A20" , k(k1).vgatherdps(zmm1, ptr(rdx, zmm3, 0, 128)));
@@ -4456,13 +6186,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27D49C6541120" , k(k1).vgatherpf1dps(ptr(rcx, zmm2, 0, 128)));
TEST_INSTRUCTION("62F2FD49C7541110" , k(k1).vgatherpf1qpd(ptr(rcx, zmm2, 0, 128)));
TEST_INSTRUCTION("62F27D49C7541120" , k(k1).vgatherpf1qps(ptr(rcx, zmm2, 0, 128)));
- TEST_INSTRUCTION("C4E2D9938C1A80000000" , vgatherqpd(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E2DD938C1A80000000" , vgatherqpd(ymm1, ptr(rdx, ymm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F2FD09934C1A10" , k(k1).vgatherqpd(xmm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD29934C1A10" , k(k1).vgatherqpd(ymm1, ptr(rdx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F2FD49934C1A10" , k(k1).vgatherqpd(zmm1, ptr(rdx, zmm3, 0, 128)));
- TEST_INSTRUCTION("C4E259938C1A80000000" , vgatherqps(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E25D938C1A80000000" , vgatherqps(xmm1, ptr(rdx, ymm3, 0, 128), xmm4));
TEST_INSTRUCTION("62F27D09934C1A20" , k(k1).vgatherqps(xmm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F27D29934C1A20" , k(k1).vgatherqps(xmm1, ptr(rdx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F27D49934C1A20" , k(k1).vgatherqps(ymm1, ptr(rdx, zmm3, 0, 128)));
@@ -4514,60 +6240,15 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D0827CB01" , vgetmantss(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08274C2B2001" , vgetmantss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08274C2B2001" , vgetmantss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9CFCB01" , vgf2p8affineinvqb(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3E9CF8C2B8000000001" , vgf2p8affineinvqb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9CF8C2B8000000001" , vgf2p8affineinvqb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3EDCFCB01" , vgf2p8affineinvqb(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E3EDCF8C2B8000000001" , vgf2p8affineinvqb(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3EDCF8C2B8000000001" , vgf2p8affineinvqb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48CFCB01" , vgf2p8affineinvqb(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48CF4C2B0201" , vgf2p8affineinvqb(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48CF4C2B0201" , vgf2p8affineinvqb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9CECB01" , vgf2p8affineqb(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3E9CE8C2B8000000001" , vgf2p8affineqb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9CE8C2B8000000001" , vgf2p8affineqb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3EDCECB01" , vgf2p8affineqb(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E3EDCE8C2B8000000001" , vgf2p8affineqb(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3EDCE8C2B8000000001" , vgf2p8affineqb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48CECB01" , vgf2p8affineqb(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48CE4C2B0201" , vgf2p8affineqb(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48CE4C2B0201" , vgf2p8affineqb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E269CFCB" , vgf2p8mulb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269CF8C2B80000000" , vgf2p8mulb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269CF8C2B80000000" , vgf2p8mulb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DCFCB" , vgf2p8mulb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DCF8C2B80000000" , vgf2p8mulb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26DCF8C2B80000000" , vgf2p8mulb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48CFCB" , vgf2p8mulb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48CF4C2B02" , vgf2p8mulb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48CF4C2B02" , vgf2p8mulb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E97CCB" , vhaddpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E97C8C2B80000000" , vhaddpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E97C8C2B80000000" , vhaddpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED7CCB" , vhaddpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED7C8C2B80000000" , vhaddpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED7C8C2B80000000" , vhaddpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB7CCB" , vhaddps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB7C8C2B80000000" , vhaddps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB7C8C2B80000000" , vhaddps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EF7CCB" , vhaddps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EF7C8C2B80000000" , vhaddps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EF7C8C2B80000000" , vhaddps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E97DCB" , vhsubpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E97D8C2B80000000" , vhsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E97D8C2B80000000" , vhsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED7DCB" , vhsubpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED7D8C2B80000000" , vhsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED7D8C2B80000000" , vhsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB7DCB" , vhsubps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB7D8C2B80000000" , vhsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB7D8C2B80000000" , vhsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EF7DCB" , vhsubps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EF7D8C2B80000000" , vhsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EF7D8C2B80000000" , vhsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E36D18CB01" , vinsertf128(ymm1, ymm2, xmm3, 1));
- TEST_INSTRUCTION("C4E36D188C2B8000000001" , vinsertf128(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D188C2B8000000001" , vinsertf128(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D2818CB01" , vinsertf32x4(ymm1, ymm2, xmm3, 1));
TEST_INSTRUCTION("62F36D28184C2B0801" , vinsertf32x4(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D28184C2B0801" , vinsertf32x4(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
@@ -4586,9 +6267,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED481ACB01" , vinsertf64x4(zmm1, zmm2, ymm3, 1));
TEST_INSTRUCTION("62F3ED481A4C2B0401" , vinsertf64x4(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED481A4C2B0401" , vinsertf64x4(zmm1, zmm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D38CB01" , vinserti128(ymm1, ymm2, xmm3, 1));
- TEST_INSTRUCTION("C4E36D388C2B8000000001" , vinserti128(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D388C2B8000000001" , vinserti128(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D2838CB01" , vinserti32x4(ymm1, ymm2, xmm3, 1));
TEST_INSTRUCTION("62F36D28384C2B0801" , vinserti32x4(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D28384C2B0801" , vinserti32x4(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
@@ -4607,136 +6285,31 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED483ACB01" , vinserti64x4(zmm1, zmm2, ymm3, 1));
TEST_INSTRUCTION("62F3ED483A4C2B0401" , vinserti64x4(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED483A4C2B0401" , vinserti64x4(zmm1, zmm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36921CB01" , vinsertps(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369218C2B8000000001" , vinsertps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369218C2B8000000001" , vinsertps(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5FBF08C1A80000000" , vlddqu(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FBF08C1A80000000" , vlddqu(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FFF08C1A80000000" , vlddqu(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FFF08C1A80000000" , vlddqu(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F8AE941180000000" , vldmxcsr(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("C5F8AE941180000000" , vldmxcsr(dword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("C5F9F7CA" , vmaskmovdqu(xmm1, xmm2, ptr(rdi)));
- TEST_INSTRUCTION("C5F9F7CA" , vmaskmovdqu(xmm1, xmm2, xmmword_ptr(rdi)));
- TEST_INSTRUCTION("C4E2612FA41180000000" , vmaskmovpd(ptr(rcx, rdx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2612FA41180000000" , vmaskmovpd(xmmword_ptr(rcx, rdx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2652FA41180000000" , vmaskmovpd(ptr(rcx, rdx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2652FA41180000000" , vmaskmovpd(ymmword_ptr(rcx, rdx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2692D8C2B80000000" , vmaskmovpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2692D8C2B80000000" , vmaskmovpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2D8C2B80000000" , vmaskmovpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2D8C2B80000000" , vmaskmovpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2612EA41180000000" , vmaskmovps(ptr(rcx, rdx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2612EA41180000000" , vmaskmovps(xmmword_ptr(rcx, rdx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2652EA41180000000" , vmaskmovps(ptr(rcx, rdx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2652EA41180000000" , vmaskmovps(ymmword_ptr(rcx, rdx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2692C8C2B80000000" , vmaskmovps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2692C8C2B80000000" , vmaskmovps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2C8C2B80000000" , vmaskmovps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2C8C2B80000000" , vmaskmovps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E95FCB" , vmaxpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E95F8C2B80000000" , vmaxpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E95F8C2B80000000" , vmaxpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED5FCB" , vmaxpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED5F8C2B80000000" , vmaxpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED5F8C2B80000000" , vmaxpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED485FCB" , vmaxpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED485F4C2B02" , vmaxpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED485F4C2B02" , vmaxpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E85FCB" , vmaxps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E85F8C2B80000000" , vmaxps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E85F8C2B80000000" , vmaxps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC5FCB" , vmaxps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC5F8C2B80000000" , vmaxps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC5F8C2B80000000" , vmaxps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C485FCB" , vmaxps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C485F4C2B02" , vmaxps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C485F4C2B02" , vmaxps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB5FCB" , vmaxsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5F8C2B80000000" , vmaxsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB5F8C2B80000000" , vmaxsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5FCB" , vmaxss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5F8C2B80000000" , vmaxss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5F8C2B80000000" , vmaxss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E95DCB" , vminpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E95D8C2B80000000" , vminpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E95D8C2B80000000" , vminpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED5DCB" , vminpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED5D8C2B80000000" , vminpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED5D8C2B80000000" , vminpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED485DCB" , vminpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED485D4C2B02" , vminpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED485D4C2B02" , vminpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E85DCB" , vminps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E85D8C2B80000000" , vminps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E85D8C2B80000000" , vminps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC5DCB" , vminps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC5D8C2B80000000" , vminps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC5D8C2B80000000" , vminps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C485DCB" , vminps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C485D4C2B02" , vminps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C485D4C2B02" , vminps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB5DCB" , vminsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5D8C2B80000000" , vminsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB5D8C2B80000000" , vminsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5DCB" , vminss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5D8C2B80000000" , vminss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5D8C2B80000000" , vminss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5F928CA" , vmovapd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F9288C1A80000000" , vmovapd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F9288C1A80000000" , vmovapd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F9299C1180000000" , vmovapd(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9299C1180000000" , vmovapd(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FD28CA" , vmovapd(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD288C1A80000000" , vmovapd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD288C1A80000000" , vmovapd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD299C1180000000" , vmovapd(ptr(rcx, rdx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FD299C1180000000" , vmovapd(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
TEST_INSTRUCTION("62F1FD4828CA" , vmovapd(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48284C1A02" , vmovapd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD48284C1A02" , vmovapd(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD48295C1102" , vmovapd(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F1FD48295C1102" , vmovapd(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5F828CA" , vmovaps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8288C1A80000000" , vmovaps(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F8288C1A80000000" , vmovaps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F8299C1180000000" , vmovaps(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F8299C1180000000" , vmovaps(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FC28CA" , vmovaps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC288C1A80000000" , vmovaps(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC288C1A80000000" , vmovaps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC299C1180000000" , vmovaps(ptr(rcx, rdx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FC299C1180000000" , vmovaps(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
TEST_INSTRUCTION("62F17C4828CA" , vmovaps(zmm1, zmm2));
TEST_INSTRUCTION("62F17C48284C1A02" , vmovaps(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C48284C1A02" , vmovaps(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C48295C1102" , vmovaps(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F17C48295C1102" , vmovaps(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5F97ED1" , vmovd(ecx, xmm2));
- TEST_INSTRUCTION("C5F97E9C1180000000" , vmovd(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F97E9C1180000000" , vmovd(dword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F96ECA" , vmovd(xmm1, edx));
- TEST_INSTRUCTION("C5F96E8C1A80000000" , vmovd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F96E8C1A80000000" , vmovd(xmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FB12CA" , vmovddup(xmm1, xmm2));
- TEST_INSTRUCTION("C5FB128C1A80000000" , vmovddup(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FB128C1A80000000" , vmovddup(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FF12CA" , vmovddup(ymm1, ymm2));
- TEST_INSTRUCTION("C5FF128C1A80000000" , vmovddup(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FF128C1A80000000" , vmovddup(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FF4812CA" , vmovddup(zmm1, zmm2));
TEST_INSTRUCTION("62F1FF48124C1A02" , vmovddup(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FF48124C1A02" , vmovddup(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F96FCA" , vmovdqa(xmm1, xmm2));
- TEST_INSTRUCTION("C5F96F8C1A80000000" , vmovdqa(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F96F8C1A80000000" , vmovdqa(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F97F9C1180000000" , vmovdqa(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F97F9C1180000000" , vmovdqa(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FD6FCA" , vmovdqa(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD6F8C1A80000000" , vmovdqa(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD6F8C1A80000000" , vmovdqa(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD7F9C1180000000" , vmovdqa(ptr(rcx, rdx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FD7F9C1180000000" , vmovdqa(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
TEST_INSTRUCTION("62F17D086FCA" , vmovdqa32(xmm1, xmm2));
TEST_INSTRUCTION("62F17D086F4C1A08" , vmovdqa32(xmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17D086F4C1A08" , vmovdqa32(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
@@ -4767,16 +6340,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1FD486F4C1A02" , vmovdqa64(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD487F5C1102" , vmovdqa64(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F1FD487F5C1102" , vmovdqa64(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5FA6FCA" , vmovdqu(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA6F8C1A80000000" , vmovdqu(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA6F8C1A80000000" , vmovdqu(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA7F9C1180000000" , vmovdqu(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FA7F9C1180000000" , vmovdqu(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FE6FCA" , vmovdqu(ymm1, ymm2));
- TEST_INSTRUCTION("C5FE6F8C1A80000000" , vmovdqu(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FE6F8C1A80000000" , vmovdqu(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FE7F9C1180000000" , vmovdqu(ptr(rcx, rdx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FE7F9C1180000000" , vmovdqu(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
TEST_INSTRUCTION("62F1FF086FCA" , vmovdqu16(xmm1, xmm2));
TEST_INSTRUCTION("62F1FF086F4C1A08" , vmovdqu16(xmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FF086F4C1A08" , vmovdqu16(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
@@ -4837,162 +6400,43 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F17F486F4C1A02" , vmovdqu8(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17F487F5C1102" , vmovdqu8(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F17F487F5C1102" , vmovdqu8(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5E812CB" , vmovhlps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F9179C1180000000" , vmovhpd(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9179C1180000000" , vmovhpd(qword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5E9168C2B80000000" , vmovhpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9168C2B80000000" , vmovhpd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5F8179C1180000000" , vmovhps(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F8179C1180000000" , vmovhps(qword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5E8168C2B80000000" , vmovhps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E8168C2B80000000" , vmovhps(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E816CB" , vmovlhps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F9139C1180000000" , vmovlpd(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9139C1180000000" , vmovlpd(qword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5E9128C2B80000000" , vmovlpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9128C2B80000000" , vmovlpd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5F8139C1180000000" , vmovlps(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F8139C1180000000" , vmovlps(qword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5E8128C2B80000000" , vmovlps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E8128C2B80000000" , vmovlps(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5F950CA" , vmovmskpd(ecx, xmm2));
- TEST_INSTRUCTION("C5FD50CA" , vmovmskpd(ecx, ymm2));
- TEST_INSTRUCTION("C5F850CA" , vmovmskps(ecx, xmm2));
- TEST_INSTRUCTION("C5FC50CA" , vmovmskps(ecx, ymm2));
- TEST_INSTRUCTION("C5F9E79C1180000000" , vmovntdq(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9E79C1180000000" , vmovntdq(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FDE79C1180000000" , vmovntdq(ptr(rcx, rdx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FDE79C1180000000" , vmovntdq(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
TEST_INSTRUCTION("62F17D48E75C1102" , vmovntdq(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F17D48E75C1102" , vmovntdq(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C4E2792A8C1A80000000" , vmovntdqa(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2792A8C1A80000000" , vmovntdqa(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D2A8C1A80000000" , vmovntdqa(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D2A8C1A80000000" , vmovntdqa(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D482A4C1A02" , vmovntdqa(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D482A4C1A02" , vmovntdqa(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F92B9C1180000000" , vmovntpd(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F92B9C1180000000" , vmovntpd(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FD2B9C1180000000" , vmovntpd(ptr(rcx, rdx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FD2B9C1180000000" , vmovntpd(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
TEST_INSTRUCTION("62F1FD482B5C1102" , vmovntpd(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F1FD482B5C1102" , vmovntpd(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
+ TEST_INSTRUCTION("62F17C482B5C1102" , vmovntps(ptr(rcx, rdx, 0, 128), zmm3));
+ TEST_INSTRUCTION("62F17C482B5C1102" , vmovntps(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("C5F82B9C1180000000" , vmovntps(ptr(rcx, rdx, 0, 128), xmm3));
TEST_INSTRUCTION("C5F82B9C1180000000" , vmovntps(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
TEST_INSTRUCTION("C5FC2B9C1180000000" , vmovntps(ptr(rcx, rdx, 0, 128), ymm3));
TEST_INSTRUCTION("C5FC2B9C1180000000" , vmovntps(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
- TEST_INSTRUCTION("62F17C482B5C1102" , vmovntps(ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("62F17C482B5C1102" , vmovntps(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C4E1F97ED1" , vmovq(rcx, xmm2));
- TEST_INSTRUCTION("C5F9D69C1180000000" , vmovq(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9D69C1180000000" , vmovq(qword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C4E1F96ECA" , vmovq(xmm1, rdx));
- TEST_INSTRUCTION("C5FA7ECA" , vmovq(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA7E8C1A80000000" , vmovq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA7E8C1A80000000" , vmovq(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FB119C1180000000" , vmovsd(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FB119C1180000000" , vmovsd(qword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FB108C1A80000000" , vmovsd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FB108C1A80000000" , vmovsd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5EB10CB" , vmovsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5FA16CA" , vmovshdup(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA168C1A80000000" , vmovshdup(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA168C1A80000000" , vmovshdup(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FE16CA" , vmovshdup(ymm1, ymm2));
- TEST_INSTRUCTION("C5FE168C1A80000000" , vmovshdup(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FE168C1A80000000" , vmovshdup(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E4816CA" , vmovshdup(zmm1, zmm2));
TEST_INSTRUCTION("62F17E48164C1A02" , vmovshdup(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E48164C1A02" , vmovshdup(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA12CA" , vmovsldup(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA128C1A80000000" , vmovsldup(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA128C1A80000000" , vmovsldup(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FE12CA" , vmovsldup(ymm1, ymm2));
- TEST_INSTRUCTION("C5FE128C1A80000000" , vmovsldup(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FE128C1A80000000" , vmovsldup(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E4812CA" , vmovsldup(zmm1, zmm2));
TEST_INSTRUCTION("62F17E48124C1A02" , vmovsldup(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17E48124C1A02" , vmovsldup(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA119C1180000000" , vmovss(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FA119C1180000000" , vmovss(dword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FA108C1A80000000" , vmovss(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FA108C1A80000000" , vmovss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5EA10CB" , vmovss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F910CA" , vmovupd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F9108C1A80000000" , vmovupd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F9108C1A80000000" , vmovupd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F9119C1180000000" , vmovupd(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9119C1180000000" , vmovupd(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FD10CA" , vmovupd(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD108C1A80000000" , vmovupd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD108C1A80000000" , vmovupd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD119C1180000000" , vmovupd(ptr(rcx, rdx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FD119C1180000000" , vmovupd(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
TEST_INSTRUCTION("62F1FD4810CA" , vmovupd(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48104C1A02" , vmovupd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD48104C1A02" , vmovupd(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD48115C1102" , vmovupd(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F1FD48115C1102" , vmovupd(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5F810CA" , vmovups(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8108C1A80000000" , vmovups(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F8108C1A80000000" , vmovups(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F8119C1180000000" , vmovups(ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F8119C1180000000" , vmovups(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FC10CA" , vmovups(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC108C1A80000000" , vmovups(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC108C1A80000000" , vmovups(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC119C1180000000" , vmovups(ptr(rcx, rdx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FC119C1180000000" , vmovups(ymmword_ptr(rcx, rdx, 0, 128), ymm3));
TEST_INSTRUCTION("62F17C4810CA" , vmovups(zmm1, zmm2));
TEST_INSTRUCTION("62F17C48104C1A02" , vmovups(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C48104C1A02" , vmovups(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C48115C1102" , vmovups(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F17C48115C1102" , vmovups(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C4E36942CB01" , vmpsadbw(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369428C2B8000000001" , vmpsadbw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369428C2B8000000001" , vmpsadbw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D42CB01" , vmpsadbw(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D428C2B8000000001" , vmpsadbw(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D428C2B8000000001" , vmpsadbw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E959CB" , vmulpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9598C2B80000000" , vmulpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9598C2B80000000" , vmulpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED59CB" , vmulpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED598C2B80000000" , vmulpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED598C2B80000000" , vmulpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED4859CB" , vmulpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48594C2B02" , vmulpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48594C2B02" , vmulpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E859CB" , vmulps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8598C2B80000000" , vmulps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E8598C2B80000000" , vmulps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC59CB" , vmulps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC598C2B80000000" , vmulps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC598C2B80000000" , vmulps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C4859CB" , vmulps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48594C2B02" , vmulps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C48594C2B02" , vmulps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB59CB" , vmulsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB598C2B80000000" , vmulsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB598C2B80000000" , vmulsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA59CB" , vmulss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA598C2B80000000" , vmulss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA598C2B80000000" , vmulss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E956CB" , vorpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9568C2B80000000" , vorpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9568C2B80000000" , vorpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED56CB" , vorpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED568C2B80000000" , vorpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED568C2B80000000" , vorpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED4856CB" , vorpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48564C2B02" , vorpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48564C2B02" , vorpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E856CB" , vorps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8568C2B80000000" , vorps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E8568C2B80000000" , vorps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC56CB" , vorps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC568C2B80000000" , vorps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC568C2B80000000" , vorps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C4856CB" , vorps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48564C2B02" , vorps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C48564C2B02" , vorps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -5018,21 +6462,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F25F48524C1A08" , vp4dpwssd(zmm1, zmm4, zmm5, zmm6, zmm7, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F25F48534C1A08" , vp4dpwssds(zmm1, zmm4, zmm5, zmm6, zmm7, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F25F48534C1A08" , vp4dpwssds(zmm1, zmm4, zmm5, zmm6, zmm7, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2791CCA" , vpabsb(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2791C8C1A80000000" , vpabsb(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2791C8C1A80000000" , vpabsb(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1CCA" , vpabsb(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D1C8C1A80000000" , vpabsb(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1C8C1A80000000" , vpabsb(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D481CCA" , vpabsb(zmm1, zmm2));
TEST_INSTRUCTION("62F27D481C4C1A02" , vpabsb(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D481C4C1A02" , vpabsb(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2791ECA" , vpabsd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2791E8C1A80000000" , vpabsd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2791E8C1A80000000" , vpabsd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1ECA" , vpabsd(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D1E8C1A80000000" , vpabsd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1E8C1A80000000" , vpabsd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D481ECA" , vpabsd(zmm1, zmm2));
TEST_INSTRUCTION("62F27D481E4C1A02" , vpabsd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D481E4C1A02" , vpabsd(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
@@ -5045,138 +6477,48 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD481FCA" , vpabsq(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD481F4C1A02" , vpabsq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD481F4C1A02" , vpabsq(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2791DCA" , vpabsw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2791D8C1A80000000" , vpabsw(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2791D8C1A80000000" , vpabsw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1DCA" , vpabsw(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D1D8C1A80000000" , vpabsw(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1D8C1A80000000" , vpabsw(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D481DCA" , vpabsw(zmm1, zmm2));
TEST_INSTRUCTION("62F27D481D4C1A02" , vpabsw(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D481D4C1A02" , vpabsw(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5E96BCB" , vpackssdw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E96B8C2B80000000" , vpackssdw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E96B8C2B80000000" , vpackssdw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED6BCB" , vpackssdw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED6B8C2B80000000" , vpackssdw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED6B8C2B80000000" , vpackssdw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D486BCB" , vpackssdw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D486B4C2B02" , vpackssdw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D486B4C2B02" , vpackssdw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E963CB" , vpacksswb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9638C2B80000000" , vpacksswb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9638C2B80000000" , vpacksswb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED63CB" , vpacksswb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED638C2B80000000" , vpacksswb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED638C2B80000000" , vpacksswb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4863CB" , vpacksswb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48634C2B02" , vpacksswb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48634C2B02" , vpacksswb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2692BCB" , vpackusdw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2692B8C2B80000000" , vpackusdw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2692B8C2B80000000" , vpackusdw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2BCB" , vpackusdw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D2B8C2B80000000" , vpackusdw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2B8C2B80000000" , vpackusdw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D482BCB" , vpackusdw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D482B4C2B02" , vpackusdw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D482B4C2B02" , vpackusdw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E967CB" , vpackuswb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9678C2B80000000" , vpackuswb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9678C2B80000000" , vpackuswb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED67CB" , vpackuswb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED678C2B80000000" , vpackuswb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED678C2B80000000" , vpackuswb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4867CB" , vpackuswb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48674C2B02" , vpackuswb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48674C2B02" , vpackuswb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FCCB" , vpaddb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FC8C2B80000000" , vpaddb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FC8C2B80000000" , vpaddb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFCCB" , vpaddb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFC8C2B80000000" , vpaddb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFC8C2B80000000" , vpaddb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48FCCB" , vpaddb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48FC4C2B02" , vpaddb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48FC4C2B02" , vpaddb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FECB" , vpaddd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FE8C2B80000000" , vpaddd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FE8C2B80000000" , vpaddd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFECB" , vpaddd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFE8C2B80000000" , vpaddd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFE8C2B80000000" , vpaddd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48FECB" , vpaddd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48FE4C2B02" , vpaddd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48FE4C2B02" , vpaddd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D4CB" , vpaddq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9D48C2B80000000" , vpaddq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D48C2B80000000" , vpaddq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD4CB" , vpaddq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDD48C2B80000000" , vpaddq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD48C2B80000000" , vpaddq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48D4CB" , vpaddq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48D44C2B02" , vpaddq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48D44C2B02" , vpaddq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9ECCB" , vpaddsb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EC8C2B80000000" , vpaddsb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9EC8C2B80000000" , vpaddsb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDECCB" , vpaddsb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEC8C2B80000000" , vpaddsb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEC8C2B80000000" , vpaddsb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48ECCB" , vpaddsb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48EC4C2B02" , vpaddsb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48EC4C2B02" , vpaddsb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9EDCB" , vpaddsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9ED8C2B80000000" , vpaddsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9ED8C2B80000000" , vpaddsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEDCB" , vpaddsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDED8C2B80000000" , vpaddsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDED8C2B80000000" , vpaddsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48EDCB" , vpaddsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48ED4C2B02" , vpaddsw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48ED4C2B02" , vpaddsw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DCCB" , vpaddusb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DC8C2B80000000" , vpaddusb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DC8C2B80000000" , vpaddusb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDCCB" , vpaddusb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDC8C2B80000000" , vpaddusb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDC8C2B80000000" , vpaddusb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48DCCB" , vpaddusb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DC4C2B02" , vpaddusb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48DC4C2B02" , vpaddusb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DDCB" , vpaddusw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DD8C2B80000000" , vpaddusw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DD8C2B80000000" , vpaddusw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDDCB" , vpaddusw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDD8C2B80000000" , vpaddusw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDD8C2B80000000" , vpaddusw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48DDCB" , vpaddusw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DD4C2B02" , vpaddusw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48DD4C2B02" , vpaddusw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FDCB" , vpaddw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FD8C2B80000000" , vpaddw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FD8C2B80000000" , vpaddw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFDCB" , vpaddw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFD8C2B80000000" , vpaddw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFD8C2B80000000" , vpaddw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48FDCB" , vpaddw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48FD4C2B02" , vpaddw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48FD4C2B02" , vpaddw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E3690FCB01" , vpalignr(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690F8C2B8000000001" , vpalignr(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690F8C2B8000000001" , vpalignr(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0FCB01" , vpalignr(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D0F8C2B8000000001" , vpalignr(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0F8C2B8000000001" , vpalignr(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D480FCB01" , vpalignr(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F36D480F4C2B0201" , vpalignr(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D480F4C2B0201" , vpalignr(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9DBCB" , vpand(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DB8C2B80000000" , vpand(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DB8C2B80000000" , vpand(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDBCB" , vpand(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDB8C2B80000000" , vpand(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDB8C2B80000000" , vpand(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08DBCB" , vpandd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08DB4C2B08" , vpandd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08DB4C2B08" , vpandd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -5186,12 +6528,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48DBCB" , vpandd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DB4C2B02" , vpandd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48DB4C2B02" , vpandd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DFCB" , vpandn(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DF8C2B80000000" , vpandn(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DF8C2B80000000" , vpandn(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDFCB" , vpandn(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDF8C2B80000000" , vpandn(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDF8C2B80000000" , vpandn(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08DFCB" , vpandnd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08DF4C2B08" , vpandnd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08DF4C2B08" , vpandnd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -5219,30 +6555,12 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48DBCB" , vpandq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48DB4C2B02" , vpandq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48DB4C2B02" , vpandq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E0CB" , vpavgb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E08C2B80000000" , vpavgb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E08C2B80000000" , vpavgb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE0CB" , vpavgb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE08C2B80000000" , vpavgb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE08C2B80000000" , vpavgb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E0CB" , vpavgb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E04C2B02" , vpavgb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E04C2B02" , vpavgb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E3CB" , vpavgw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E38C2B80000000" , vpavgw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E38C2B80000000" , vpavgw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE3CB" , vpavgw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE38C2B80000000" , vpavgw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE38C2B80000000" , vpavgw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E3CB" , vpavgw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E34C2B02" , vpavgw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E34C2B02" , vpavgw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E36902CB01" , vpblendd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369028C2B8000000001" , vpblendd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369028C2B8000000001" , vpblendd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D02CB01" , vpblendd(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D028C2B8000000001" , vpblendd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D028C2B8000000001" , vpblendd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F26D0866CB" , vpblendmb(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D08664C2B08" , vpblendmb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D08664C2B08" , vpblendmb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -5279,38 +6597,14 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4866CB" , vpblendmw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48664C2B02" , vpblendmw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48664C2B02" , vpblendmw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E3694CCB40" , vpblendvb(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3694C8C2B8000000060" , vpblendvb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3694C8C2B8000000060" , vpblendvb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E36D4CCB40" , vpblendvb(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E36D4C8C2B8000000060" , vpblendvb(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D4C8C2B8000000060" , vpblendvb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3690ECB01" , vpblendw(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690E8C2B8000000001" , vpblendw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690E8C2B8000000001" , vpblendw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0ECB01" , vpblendw(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D0E8C2B8000000001" , vpblendw(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0E8C2B8000000001" , vpblendw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F27D087ACA" , vpbroadcastb(xmm1, edx));
- TEST_INSTRUCTION("C4E27978CA" , vpbroadcastb(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279788C1A80000000" , vpbroadcastb(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279788C1A80000000" , vpbroadcastb(xmm1, byte_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D287ACA" , vpbroadcastb(ymm1, edx));
- TEST_INSTRUCTION("C4E27D78CA" , vpbroadcastb(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D788C1A80000000" , vpbroadcastb(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D788C1A80000000" , vpbroadcastb(ymm1, byte_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D487ACA" , vpbroadcastb(zmm1, edx));
TEST_INSTRUCTION("62F27D4878CA" , vpbroadcastb(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48788C1A80000000" , vpbroadcastb(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48788C1A80000000" , vpbroadcastb(zmm1, byte_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D087CCA" , vpbroadcastd(xmm1, edx));
- TEST_INSTRUCTION("C4E27958CA" , vpbroadcastd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279588C1A80000000" , vpbroadcastd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279588C1A80000000" , vpbroadcastd(xmm1, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D287CCA" , vpbroadcastd(ymm1, edx));
- TEST_INSTRUCTION("C4E27D58CA" , vpbroadcastd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D588C1A80000000" , vpbroadcastd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D588C1A80000000" , vpbroadcastd(ymm1, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D487CCA" , vpbroadcastd(zmm1, edx));
TEST_INSTRUCTION("62F27D4858CA" , vpbroadcastd(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48584C1A20" , vpbroadcastd(zmm1, ptr(rdx, rbx, 0, 128)));
@@ -5322,48 +6616,20 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27E283ACA" , vpbroadcastmw2d(ymm1, k2));
TEST_INSTRUCTION("62F27E483ACA" , vpbroadcastmw2d(zmm1, k2));
TEST_INSTRUCTION("62F2FD087CCA" , vpbroadcastq(xmm1, rdx));
- TEST_INSTRUCTION("C4E27959CA" , vpbroadcastq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279598C1A80000000" , vpbroadcastq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279598C1A80000000" , vpbroadcastq(xmm1, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD287CCA" , vpbroadcastq(ymm1, rdx));
- TEST_INSTRUCTION("C4E27D59CA" , vpbroadcastq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D598C1A80000000" , vpbroadcastq(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D598C1A80000000" , vpbroadcastq(ymm1, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD487CCA" , vpbroadcastq(zmm1, rdx));
TEST_INSTRUCTION("62F2FD4859CA" , vpbroadcastq(zmm1, xmm2));
TEST_INSTRUCTION("62F2FD48594C1A10" , vpbroadcastq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD48594C1A10" , vpbroadcastq(zmm1, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D087BCA" , vpbroadcastw(xmm1, edx));
- TEST_INSTRUCTION("C4E27979CA" , vpbroadcastw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279798C1A80000000" , vpbroadcastw(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279798C1A80000000" , vpbroadcastw(xmm1, word_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D287BCA" , vpbroadcastw(ymm1, edx));
- TEST_INSTRUCTION("C4E27D79CA" , vpbroadcastw(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D798C1A80000000" , vpbroadcastw(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D798C1A80000000" , vpbroadcastw(ymm1, word_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D487BCA" , vpbroadcastw(zmm1, edx));
TEST_INSTRUCTION("62F27D4879CA" , vpbroadcastw(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48794C1A40" , vpbroadcastw(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48794C1A40" , vpbroadcastw(zmm1, word_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E36944CB01" , vpclmulqdq(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369448C2B8000000001" , vpclmulqdq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369448C2B8000000001" , vpclmulqdq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D44CB01" , vpclmulqdq(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D448C2B8000000001" , vpclmulqdq(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D448C2B8000000001" , vpclmulqdq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D4844CB01" , vpclmulqdq(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F36D48444C2B0201" , vpclmulqdq(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D48444C2B0201" , vpclmulqdq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868A2CB40" , vpcmov(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8E8A28C358000000030" , vpcmov(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("8FE8E8A28C358000000030" , vpcmov(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("8FE868A28C2B8000000060" , vpcmov(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868A28C2B8000000060" , vpcmov(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86CA2CB40" , vpcmov(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("8FE8ECA28C358000000030" , vpcmov(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("8FE8ECA28C358000000030" , vpcmov(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("8FE86CA28C2B8000000060" , vpcmov(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6));
- TEST_INSTRUCTION("8FE86CA28C2B8000000060" , vpcmov(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6));
TEST_INSTRUCTION("62F36D083FCB01" , vpcmpb(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D083F4C2B0801" , vpcmpb(k1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D083F4C2B0801" , vpcmpb(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
@@ -5382,138 +6648,78 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D481FCB01" , vpcmpd(k1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F36D481F4C2B0201" , vpcmpd(k1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D481F4C2B0201" , vpcmpd(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E974CB" , vpcmpeqb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9748C2B80000000" , vpcmpeqb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9748C2B80000000" , vpcmpeqb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D0874CB" , vpcmpeqb(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08744C2B08" , vpcmpeqb(k1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08744C2B08" , vpcmpeqb(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED74CB" , vpcmpeqb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED748C2B80000000" , vpcmpeqb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED748C2B80000000" , vpcmpeqb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D2874CB" , vpcmpeqb(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28744C2B04" , vpcmpeqb(k1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D28744C2B04" , vpcmpeqb(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4874CB" , vpcmpeqb(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48744C2B02" , vpcmpeqb(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48744C2B02" , vpcmpeqb(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E976CB" , vpcmpeqd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9768C2B80000000" , vpcmpeqd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9768C2B80000000" , vpcmpeqd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D0876CB" , vpcmpeqd(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08764C2B08" , vpcmpeqd(k1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08764C2B08" , vpcmpeqd(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED76CB" , vpcmpeqd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED768C2B80000000" , vpcmpeqd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED768C2B80000000" , vpcmpeqd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D2876CB" , vpcmpeqd(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28764C2B04" , vpcmpeqd(k1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D28764C2B04" , vpcmpeqd(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4876CB" , vpcmpeqd(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48764C2B02" , vpcmpeqd(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48764C2B02" , vpcmpeqd(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26929CB" , vpcmpeqq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269298C2B80000000" , vpcmpeqq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269298C2B80000000" , vpcmpeqq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED0829CB" , vpcmpeqq(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F2ED08294C2B08" , vpcmpeqq(k1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED08294C2B08" , vpcmpeqq(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D29CB" , vpcmpeqq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D298C2B80000000" , vpcmpeqq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D298C2B80000000" , vpcmpeqq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED2829CB" , vpcmpeqq(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F2ED28294C2B04" , vpcmpeqq(k1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED28294C2B04" , vpcmpeqq(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED4829CB" , vpcmpeqq(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48294C2B02" , vpcmpeqq(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48294C2B02" , vpcmpeqq(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E975CB" , vpcmpeqw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9758C2B80000000" , vpcmpeqw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9758C2B80000000" , vpcmpeqw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D0875CB" , vpcmpeqw(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08754C2B08" , vpcmpeqw(k1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08754C2B08" , vpcmpeqw(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED75CB" , vpcmpeqw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED758C2B80000000" , vpcmpeqw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED758C2B80000000" , vpcmpeqw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D2875CB" , vpcmpeqw(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28754C2B04" , vpcmpeqw(k1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D28754C2B04" , vpcmpeqw(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4875CB" , vpcmpeqw(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48754C2B02" , vpcmpeqw(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48754C2B02" , vpcmpeqw(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E37961CA01" , vpcmpestri(xmm1, xmm2, 1, ecx, eax, edx));
- TEST_INSTRUCTION("C4E379618C1A8000000001" , vpcmpestri(xmm1, ptr(rdx, rbx, 0, 128), 1, ecx, eax, edx));
- TEST_INSTRUCTION("C4E379618C1A8000000001" , vpcmpestri(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1, ecx, eax, edx));
- TEST_INSTRUCTION("C4E37960CA01" , vpcmpestrm(xmm1, xmm2, 1, xmm0, eax, edx));
- TEST_INSTRUCTION("C4E379608C1A8000000001" , vpcmpestrm(xmm1, ptr(rdx, rbx, 0, 128), 1, xmm0, eax, edx));
- TEST_INSTRUCTION("C4E379608C1A8000000001" , vpcmpestrm(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1, xmm0, eax, edx));
- TEST_INSTRUCTION("C5E964CB" , vpcmpgtb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9648C2B80000000" , vpcmpgtb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9648C2B80000000" , vpcmpgtb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D0864CB" , vpcmpgtb(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08644C2B08" , vpcmpgtb(k1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08644C2B08" , vpcmpgtb(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED64CB" , vpcmpgtb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED648C2B80000000" , vpcmpgtb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED648C2B80000000" , vpcmpgtb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D2864CB" , vpcmpgtb(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28644C2B04" , vpcmpgtb(k1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D28644C2B04" , vpcmpgtb(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4864CB" , vpcmpgtb(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48644C2B02" , vpcmpgtb(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48644C2B02" , vpcmpgtb(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E966CB" , vpcmpgtd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9668C2B80000000" , vpcmpgtd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9668C2B80000000" , vpcmpgtd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D0866CB" , vpcmpgtd(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08664C2B08" , vpcmpgtd(k1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08664C2B08" , vpcmpgtd(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED66CB" , vpcmpgtd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED668C2B80000000" , vpcmpgtd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED668C2B80000000" , vpcmpgtd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D2866CB" , vpcmpgtd(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28664C2B04" , vpcmpgtd(k1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D28664C2B04" , vpcmpgtd(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4866CB" , vpcmpgtd(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48664C2B02" , vpcmpgtd(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48664C2B02" , vpcmpgtd(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26937CB" , vpcmpgtq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269378C2B80000000" , vpcmpgtq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269378C2B80000000" , vpcmpgtq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED0837CB" , vpcmpgtq(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F2ED08374C2B08" , vpcmpgtq(k1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED08374C2B08" , vpcmpgtq(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D37CB" , vpcmpgtq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D378C2B80000000" , vpcmpgtq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D378C2B80000000" , vpcmpgtq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED2837CB" , vpcmpgtq(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F2ED28374C2B04" , vpcmpgtq(k1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED28374C2B04" , vpcmpgtq(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED4837CB" , vpcmpgtq(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48374C2B02" , vpcmpgtq(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48374C2B02" , vpcmpgtq(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E965CB" , vpcmpgtw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9658C2B80000000" , vpcmpgtw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9658C2B80000000" , vpcmpgtw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D0865CB" , vpcmpgtw(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08654C2B08" , vpcmpgtw(k1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08654C2B08" , vpcmpgtw(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED65CB" , vpcmpgtw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED658C2B80000000" , vpcmpgtw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED658C2B80000000" , vpcmpgtw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D2865CB" , vpcmpgtw(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28654C2B04" , vpcmpgtw(k1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D28654C2B04" , vpcmpgtw(k1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4865CB" , vpcmpgtw(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48654C2B02" , vpcmpgtw(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48654C2B02" , vpcmpgtw(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E37963CA01" , vpcmpistri(xmm1, xmm2, 1, ecx));
- TEST_INSTRUCTION("C4E379638C1A8000000001" , vpcmpistri(xmm1, ptr(rdx, rbx, 0, 128), 1, ecx));
- TEST_INSTRUCTION("C4E379638C1A8000000001" , vpcmpistri(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1, ecx));
- TEST_INSTRUCTION("C4E37962CA01" , vpcmpistrm(xmm1, xmm2, 1, xmm0));
- TEST_INSTRUCTION("C4E379628C1A8000000001" , vpcmpistrm(xmm1, ptr(rdx, rbx, 0, 128), 1, xmm0));
- TEST_INSTRUCTION("C4E379628C1A8000000001" , vpcmpistrm(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1, xmm0));
TEST_INSTRUCTION("62F3ED081FCB01" , vpcmpq(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F3ED081F4C2B0801" , vpcmpq(k1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED081F4C2B0801" , vpcmpq(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
@@ -5568,12 +6774,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED483FCB01" , vpcmpw(k1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED483F4C2B0201" , vpcmpw(k1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED483F4C2B0201" , vpcmpw(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CCCB01" , vpcomb(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868CC8C2B8000000001" , vpcomb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CC8C2B8000000001" , vpcomb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CECB01" , vpcomd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868CE8C2B8000000001" , vpcomd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CE8C2B8000000001" , vpcomd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F27D0863D1" , vpcompressb(xmm1, xmm2));
TEST_INSTRUCTION("62F27D08639C1180000000" , vpcompressb(ptr(rcx, rdx, 0, 128), xmm3));
TEST_INSTRUCTION("62F27D08639C1180000000" , vpcompressb(xmmword_ptr(rcx, rdx, 0, 128), xmm3));
@@ -5610,24 +6810,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD4863D1" , vpcompressw(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48635C1140" , vpcompressw(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F2FD48635C1140" , vpcompressw(zmmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("8FE868CFCB01" , vpcomq(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868CF8C2B8000000001" , vpcomq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CF8C2B8000000001" , vpcomq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868ECCB01" , vpcomub(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868EC8C2B8000000001" , vpcomub(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EC8C2B8000000001" , vpcomub(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EECB01" , vpcomud(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868EE8C2B8000000001" , vpcomud(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EE8C2B8000000001" , vpcomud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EFCB01" , vpcomuq(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868EF8C2B8000000001" , vpcomuq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EF8C2B8000000001" , vpcomuq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EDCB01" , vpcomuw(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868ED8C2B8000000001" , vpcomuw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868ED8C2B8000000001" , vpcomuw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CDCB01" , vpcomw(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868CD8C2B8000000001" , vpcomw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CD8C2B8000000001" , vpcomw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F27D08C4CA" , vpconflictd(xmm1, xmm2));
TEST_INSTRUCTION("62F27D08C44C1A08" , vpconflictd(xmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D08C44C1A08" , vpconflictd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
@@ -5682,12 +6864,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D4853CB" , vpdpwssds(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48534C2B02" , vpdpwssds(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48534C2B02" , vpdpwssds(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E36D06CB01" , vperm2f128(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D068C2B8000000001" , vperm2f128(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D068C2B8000000001" , vperm2f128(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D46CB01" , vperm2i128(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D468C2B8000000001" , vperm2i128(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D468C2B8000000001" , vperm2i128(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F26D088DCB" , vpermb(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D088D4C2B08" , vpermb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D088D4C2B08" , vpermb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -5697,9 +6873,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D488DCB" , vpermb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D488D4C2B02" , vpermb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D488D4C2B02" , vpermb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D36CB" , vpermd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D368C2B80000000" , vpermd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D368C2B80000000" , vpermd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4836CB" , vpermd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48364C2B02" , vpermd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48364C2B02" , vpermd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -5757,65 +6930,18 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4875CB" , vpermi2w(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48754C2B02" , vpermi2w(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48754C2B02" , vpermi2w(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E36949CB41" , vpermil2pd(xmm1, xmm2, xmm3, xmm4, 1));
- TEST_INSTRUCTION("C4E369498C2B8000000061" , vpermil2pd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6, 1));
- TEST_INSTRUCTION("C4E369498C2B8000000061" , vpermil2pd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6, 1));
- TEST_INSTRUCTION("C4E3E9498C358000000031" , vpermil2pd(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9498C358000000031" , vpermil2pd(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D49CB41" , vpermil2pd(ymm1, ymm2, ymm3, ymm4, 1));
- TEST_INSTRUCTION("C4E36D498C2B8000000061" , vpermil2pd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6, 1));
- TEST_INSTRUCTION("C4E36D498C2B8000000061" , vpermil2pd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6, 1));
- TEST_INSTRUCTION("C4E3ED498C358000000031" , vpermil2pd(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128), 1));
- TEST_INSTRUCTION("C4E3ED498C358000000031" , vpermil2pd(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128), 1));
- TEST_INSTRUCTION("C4E36948CB41" , vpermil2ps(xmm1, xmm2, xmm3, xmm4, 1));
- TEST_INSTRUCTION("C4E369488C2B8000000061" , vpermil2ps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6, 1));
- TEST_INSTRUCTION("C4E369488C2B8000000061" , vpermil2ps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6, 1));
- TEST_INSTRUCTION("C4E3E9488C358000000031" , vpermil2ps(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9488C358000000031" , vpermil2ps(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D48CB41" , vpermil2ps(ymm1, ymm2, ymm3, ymm4, 1));
- TEST_INSTRUCTION("C4E36D488C2B8000000061" , vpermil2ps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), ymm6, 1));
- TEST_INSTRUCTION("C4E36D488C2B8000000061" , vpermil2ps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), ymm6, 1));
- TEST_INSTRUCTION("C4E3ED488C358000000031" , vpermil2ps(ymm1, ymm2, ymm3, ptr(rbp, rsi, 0, 128), 1));
- TEST_INSTRUCTION("C4E3ED488C358000000031" , vpermil2ps(ymm1, ymm2, ymm3, ymmword_ptr(rbp, rsi, 0, 128), 1));
- TEST_INSTRUCTION("C4E2690DCB" , vpermilpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E37905CA01" , vpermilpd(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E2690D8C2B80000000" , vpermilpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2690D8C2B80000000" , vpermilpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E379058C1A8000000001" , vpermilpd(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E379058C1A8000000001" , vpermilpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26D0DCB" , vpermilpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E37D05CA01" , vpermilpd(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E26D0D8C2B80000000" , vpermilpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0D8C2B80000000" , vpermilpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E37D058C1A8000000001" , vpermilpd(ymm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D058C1A8000000001" , vpermilpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F2ED480DCB" , vpermilpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F3FD4805CA01" , vpermilpd(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F2ED480D4C2B02" , vpermilpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED480D4C2B02" , vpermilpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F3FD48054C1A0201" , vpermilpd(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F3FD48054C1A0201" , vpermilpd(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E2690CCB" , vpermilps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E37904CA01" , vpermilps(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E2690C8C2B80000000" , vpermilps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2690C8C2B80000000" , vpermilps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E379048C1A8000000001" , vpermilps(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E379048C1A8000000001" , vpermilps(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26D0CCB" , vpermilps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E37D04CA01" , vpermilps(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E26D0C8C2B80000000" , vpermilps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0C8C2B80000000" , vpermilps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E37D048C1A8000000001" , vpermilps(ymm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D048C1A8000000001" , vpermilps(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F26D480CCB" , vpermilps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F37D4804CA01" , vpermilps(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F26D480C4C2B02" , vpermilps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D480C4C2B02" , vpermilps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F37D48044C1A0201" , vpermilps(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F37D48044C1A0201" , vpermilps(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3FD01CA01" , vpermpd(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E3FD018C1A8000000001" , vpermpd(ymm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3FD018C1A8000000001" , vpermpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F2ED2816CB" , vpermpd(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("62F2ED28164C2B04" , vpermpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED28164C2B04" , vpermpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
@@ -5825,15 +6951,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED48164C2B02" , vpermpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F3FD48014C1A0201" , vpermpd(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F3FD48014C1A0201" , vpermpd(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26D16CB" , vpermps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D168C2B80000000" , vpermps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D168C2B80000000" , vpermps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4816CB" , vpermps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48164C2B02" , vpermps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48164C2B02" , vpermps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E3FD00CA01" , vpermq(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E3FD008C1A8000000001" , vpermq(ymm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3FD008C1A8000000001" , vpermq(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F2ED2836CB" , vpermq(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("62F2ED28364C2B04" , vpermq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED28364C2B04" , vpermq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
@@ -5942,134 +7062,18 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD4862CA" , vpexpandw(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48624C1A40" , vpexpandw(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD48624C1A40" , vpexpandw(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E37914D101" , vpextrb(ecx, xmm2, 1));
- TEST_INSTRUCTION("C4E379149C118000000001" , vpextrb(ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E379149C118000000001" , vpextrb(byte_ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E37916D101" , vpextrd(ecx, xmm2, 1));
- TEST_INSTRUCTION("C4E379169C118000000001" , vpextrd(ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E379169C118000000001" , vpextrd(dword_ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E3F916D101" , vpextrq(rcx, xmm2, 1));
- TEST_INSTRUCTION("C4E3F9169C118000000001" , vpextrq(ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E3F9169C118000000001" , vpextrq(qword_ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C5F9C5CA01" , vpextrw(ecx, xmm2, 1));
- TEST_INSTRUCTION("C4E379159C118000000001" , vpextrw(ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E379159C118000000001" , vpextrw(word_ptr(rcx, rdx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E259908C1A80000000" , vpgatherdd(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E25D908C1A80000000" , vpgatherdd(ymm1, ptr(rdx, ymm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F27D09904C1A20" , k(k1).vpgatherdd(xmm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F27D29904C1A20" , k(k1).vpgatherdd(ymm1, ptr(rdx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F27D49904C1A20" , k(k1).vpgatherdd(zmm1, ptr(rdx, zmm3, 0, 128)));
- TEST_INSTRUCTION("C4E2D9908C1A80000000" , vpgatherdq(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E2DD908C1A80000000" , vpgatherdq(ymm1, ptr(rdx, xmm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F2FD09904C1A10" , k(k1).vpgatherdq(xmm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD29904C1A10" , k(k1).vpgatherdq(ymm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD49904C1A10" , k(k1).vpgatherdq(zmm1, ptr(rdx, ymm3, 0, 128)));
- TEST_INSTRUCTION("C4E259918C1A80000000" , vpgatherqd(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E25D918C1A80000000" , vpgatherqd(xmm1, ptr(rdx, ymm3, 0, 128), xmm4));
TEST_INSTRUCTION("62F27D09914C1A20" , k(k1).vpgatherqd(xmm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F27D29914C1A20" , k(k1).vpgatherqd(xmm1, ptr(rdx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F27D49914C1A20" , k(k1).vpgatherqd(ymm1, ptr(rdx, zmm3, 0, 128)));
- TEST_INSTRUCTION("C4E2D9918C1A80000000" , vpgatherqq(xmm1, ptr(rdx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E2DD918C1A80000000" , vpgatherqq(ymm1, ptr(rdx, ymm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F2FD09914C1A10" , k(k1).vpgatherqq(xmm1, ptr(rdx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD29914C1A10" , k(k1).vpgatherqq(ymm1, ptr(rdx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F2FD49914C1A10" , k(k1).vpgatherqq(zmm1, ptr(rdx, zmm3, 0, 128)));
- TEST_INSTRUCTION("8FE978C2CA" , vphaddbd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C28C1A80000000" , vphaddbd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978C28C1A80000000" , vphaddbd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978C3CA" , vphaddbq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C38C1A80000000" , vphaddbq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978C38C1A80000000" , vphaddbq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978C1CA" , vphaddbw(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C18C1A80000000" , vphaddbw(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978C18C1A80000000" , vphaddbw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E26902CB" , vphaddd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269028C2B80000000" , vphaddd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269028C2B80000000" , vphaddd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D02CB" , vphaddd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D028C2B80000000" , vphaddd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D028C2B80000000" , vphaddd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE978CBCA" , vphadddq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978CB8C1A80000000" , vphadddq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978CB8C1A80000000" , vphadddq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E26903CB" , vphaddsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269038C2B80000000" , vphaddsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269038C2B80000000" , vphaddsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D03CB" , vphaddsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D038C2B80000000" , vphaddsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D038C2B80000000" , vphaddsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE978D2CA" , vphaddubd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D28C1A80000000" , vphaddubd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978D28C1A80000000" , vphaddubd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978D3CA" , vphaddubq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D38C1A80000000" , vphaddubq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978D38C1A80000000" , vphaddubq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978D1CA" , vphaddubw(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D18C1A80000000" , vphaddubw(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978D18C1A80000000" , vphaddubw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978DBCA" , vphaddudq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978DB8C1A80000000" , vphaddudq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978DB8C1A80000000" , vphaddudq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978D6CA" , vphadduwd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D68C1A80000000" , vphadduwd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978D68C1A80000000" , vphadduwd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978D7CA" , vphadduwq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D78C1A80000000" , vphadduwq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978D78C1A80000000" , vphadduwq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E26901CB" , vphaddw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269018C2B80000000" , vphaddw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269018C2B80000000" , vphaddw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D01CB" , vphaddw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D018C2B80000000" , vphaddw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D018C2B80000000" , vphaddw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE978C6CA" , vphaddwd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C68C1A80000000" , vphaddwd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978C68C1A80000000" , vphaddwd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978C7CA" , vphaddwq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C78C1A80000000" , vphaddwq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978C78C1A80000000" , vphaddwq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27941CA" , vphminposuw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279418C1A80000000" , vphminposuw(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279418C1A80000000" , vphminposuw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978E1CA" , vphsubbw(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978E18C1A80000000" , vphsubbw(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978E18C1A80000000" , vphsubbw(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E26906CB" , vphsubd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269068C2B80000000" , vphsubd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269068C2B80000000" , vphsubd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D06CB" , vphsubd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D068C2B80000000" , vphsubd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D068C2B80000000" , vphsubd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE978E3CA" , vphsubdq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978E38C1A80000000" , vphsubdq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978E38C1A80000000" , vphsubdq(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E26907CB" , vphsubsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269078C2B80000000" , vphsubsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269078C2B80000000" , vphsubsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D07CB" , vphsubsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D078C2B80000000" , vphsubsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D078C2B80000000" , vphsubsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26905CB" , vphsubw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269058C2B80000000" , vphsubw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269058C2B80000000" , vphsubw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D05CB" , vphsubw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D058C2B80000000" , vphsubw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D058C2B80000000" , vphsubw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE978E2CA" , vphsubwd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978E28C1A80000000" , vphsubwd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE978E28C1A80000000" , vphsubwd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E36920CB01" , vpinsrb(xmm1, xmm2, ebx, 1));
- TEST_INSTRUCTION("C4E369208C2B8000000001" , vpinsrb(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369208C2B8000000001" , vpinsrb(xmm1, xmm2, byte_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36922CB01" , vpinsrd(xmm1, xmm2, ebx, 1));
- TEST_INSTRUCTION("C4E369228C2B8000000001" , vpinsrd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369228C2B8000000001" , vpinsrd(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E922CB01" , vpinsrq(xmm1, xmm2, rbx, 1));
- TEST_INSTRUCTION("C4E3E9228C2B8000000001" , vpinsrq(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9228C2B8000000001" , vpinsrq(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C4CB01" , vpinsrw(xmm1, xmm2, ebx, 1));
- TEST_INSTRUCTION("C5E9C48C2B8000000001" , vpinsrw(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C48C2B8000000001" , vpinsrw(xmm1, xmm2, word_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F27D0844CA" , vplzcntd(xmm1, xmm2));
TEST_INSTRUCTION("62F27D08444C1A08" , vplzcntd(xmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D08444C1A08" , vplzcntd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
@@ -6088,42 +7092,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD4844CA" , vplzcntq(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48444C1A02" , vplzcntq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD48444C1A02" , vplzcntq(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("8FE8689ECB40" , vpmacsdd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8689E8C2B8000000060" , vpmacsdd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8689E8C2B8000000060" , vpmacsdd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8689FCB40" , vpmacsdqh(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8689F8C2B8000000060" , vpmacsdqh(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8689F8C2B8000000060" , vpmacsdqh(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86897CB40" , vpmacsdql(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868978C2B8000000060" , vpmacsdql(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868978C2B8000000060" , vpmacsdql(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8688ECB40" , vpmacssdd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8688E8C2B8000000060" , vpmacssdd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8688E8C2B8000000060" , vpmacssdd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8688FCB40" , vpmacssdqh(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8688F8C2B8000000060" , vpmacssdqh(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8688F8C2B8000000060" , vpmacssdqh(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86887CB40" , vpmacssdql(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868878C2B8000000060" , vpmacssdql(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868878C2B8000000060" , vpmacssdql(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86886CB40" , vpmacsswd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868868C2B8000000060" , vpmacsswd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868868C2B8000000060" , vpmacsswd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86885CB40" , vpmacssww(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868858C2B8000000060" , vpmacssww(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868858C2B8000000060" , vpmacssww(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86896CB40" , vpmacswd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868968C2B8000000060" , vpmacswd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868968C2B8000000060" , vpmacswd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86895CB40" , vpmacsww(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868958C2B8000000060" , vpmacsww(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868958C2B8000000060" , vpmacsww(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868A6CB40" , vpmadcsswd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868A68C2B8000000060" , vpmadcsswd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868A68C2B8000000060" , vpmadcsswd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868B6CB40" , vpmadcswd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868B68C2B8000000060" , vpmadcswd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868B68C2B8000000060" , vpmadcswd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
TEST_INSTRUCTION("62F2ED08B5CB" , vpmadd52huq(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F2ED08B54C2B08" , vpmadd52huq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED08B54C2B08" , vpmadd52huq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -6142,55 +7110,15 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED48B4CB" , vpmadd52luq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48B44C2B02" , vpmadd52luq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B44C2B02" , vpmadd52luq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26904CB" , vpmaddubsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269048C2B80000000" , vpmaddubsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269048C2B80000000" , vpmaddubsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D04CB" , vpmaddubsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D048C2B80000000" , vpmaddubsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D048C2B80000000" , vpmaddubsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4804CB" , vpmaddubsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48044C2B02" , vpmaddubsw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48044C2B02" , vpmaddubsw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F5CB" , vpmaddwd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F58C2B80000000" , vpmaddwd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F58C2B80000000" , vpmaddwd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF5CB" , vpmaddwd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF58C2B80000000" , vpmaddwd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF58C2B80000000" , vpmaddwd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48F5CB" , vpmaddwd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48F54C2B02" , vpmaddwd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48F54C2B02" , vpmaddwd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2618EA41180000000" , vpmaskmovd(ptr(rcx, rdx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2618EA41180000000" , vpmaskmovd(xmmword_ptr(rcx, rdx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2658EA41180000000" , vpmaskmovd(ptr(rcx, rdx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2658EA41180000000" , vpmaskmovd(ymmword_ptr(rcx, rdx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2698C8C2B80000000" , vpmaskmovd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2698C8C2B80000000" , vpmaskmovd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D8C8C2B80000000" , vpmaskmovd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D8C8C2B80000000" , vpmaskmovd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E18EA41180000000" , vpmaskmovq(ptr(rcx, rdx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2E18EA41180000000" , vpmaskmovq(xmmword_ptr(rcx, rdx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2E58EA41180000000" , vpmaskmovq(ptr(rcx, rdx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2E58EA41180000000" , vpmaskmovq(ymmword_ptr(rcx, rdx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2E98C8C2B80000000" , vpmaskmovq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E98C8C2B80000000" , vpmaskmovq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED8C8C2B80000000" , vpmaskmovq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED8C8C2B80000000" , vpmaskmovq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693CCB" , vpmaxsb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693C8C2B80000000" , vpmaxsb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693C8C2B80000000" , vpmaxsb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3CCB" , vpmaxsb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3C8C2B80000000" , vpmaxsb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3C8C2B80000000" , vpmaxsb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483CCB" , vpmaxsb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483C4C2B02" , vpmaxsb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483C4C2B02" , vpmaxsb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693DCB" , vpmaxsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693D8C2B80000000" , vpmaxsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693D8C2B80000000" , vpmaxsd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3DCB" , vpmaxsd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3D8C2B80000000" , vpmaxsd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3D8C2B80000000" , vpmaxsd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483DCB" , vpmaxsd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483D4C2B02" , vpmaxsd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483D4C2B02" , vpmaxsd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -6203,30 +7131,12 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED483DCB" , vpmaxsq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED483D4C2B02" , vpmaxsq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED483D4C2B02" , vpmaxsq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9EECB" , vpmaxsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EE8C2B80000000" , vpmaxsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9EE8C2B80000000" , vpmaxsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEECB" , vpmaxsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEE8C2B80000000" , vpmaxsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEE8C2B80000000" , vpmaxsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48EECB" , vpmaxsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48EE4C2B02" , vpmaxsw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48EE4C2B02" , vpmaxsw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DECB" , vpmaxub(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DE8C2B80000000" , vpmaxub(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DE8C2B80000000" , vpmaxub(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDECB" , vpmaxub(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDE8C2B80000000" , vpmaxub(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDE8C2B80000000" , vpmaxub(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48DECB" , vpmaxub(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DE4C2B02" , vpmaxub(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48DE4C2B02" , vpmaxub(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693FCB" , vpmaxud(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693F8C2B80000000" , vpmaxud(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693F8C2B80000000" , vpmaxud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3FCB" , vpmaxud(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3F8C2B80000000" , vpmaxud(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3F8C2B80000000" , vpmaxud(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483FCB" , vpmaxud(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483F4C2B02" , vpmaxud(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483F4C2B02" , vpmaxud(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -6239,30 +7149,12 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED483FCB" , vpmaxuq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED483F4C2B02" , vpmaxuq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED483F4C2B02" , vpmaxuq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693ECB" , vpmaxuw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693E8C2B80000000" , vpmaxuw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693E8C2B80000000" , vpmaxuw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3ECB" , vpmaxuw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3E8C2B80000000" , vpmaxuw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3E8C2B80000000" , vpmaxuw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483ECB" , vpmaxuw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483E4C2B02" , vpmaxuw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483E4C2B02" , vpmaxuw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26938CB" , vpminsb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269388C2B80000000" , vpminsb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269388C2B80000000" , vpminsb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D38CB" , vpminsb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D388C2B80000000" , vpminsb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D388C2B80000000" , vpminsb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4838CB" , vpminsb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48384C2B02" , vpminsb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48384C2B02" , vpminsb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26939CB" , vpminsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269398C2B80000000" , vpminsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269398C2B80000000" , vpminsd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D39CB" , vpminsd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D398C2B80000000" , vpminsd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D398C2B80000000" , vpminsd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4839CB" , vpminsd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48394C2B02" , vpminsd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48394C2B02" , vpminsd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -6275,30 +7167,12 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4839CB" , vpminsq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48394C2B02" , vpminsq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48394C2B02" , vpminsq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9EACB" , vpminsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EA8C2B80000000" , vpminsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9EA8C2B80000000" , vpminsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEACB" , vpminsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEA8C2B80000000" , vpminsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEA8C2B80000000" , vpminsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48EACB" , vpminsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48EA4C2B02" , vpminsw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48EA4C2B02" , vpminsw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DACB" , vpminub(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DA8C2B80000000" , vpminub(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9DA8C2B80000000" , vpminub(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDACB" , vpminub(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDA8C2B80000000" , vpminub(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDDA8C2B80000000" , vpminub(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48DACB" , vpminub(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DA4C2B02" , vpminub(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48DA4C2B02" , vpminub(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693BCB" , vpminud(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693B8C2B80000000" , vpminud(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693B8C2B80000000" , vpminud(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3BCB" , vpminud(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3B8C2B80000000" , vpminud(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3B8C2B80000000" , vpminud(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483BCB" , vpminud(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483B4C2B02" , vpminud(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483B4C2B02" , vpminud(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -6311,12 +7185,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED483BCB" , vpminuq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED483B4C2B02" , vpminuq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED483B4C2B02" , vpminuq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693ACB" , vpminuw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693A8C2B80000000" , vpminuw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2693A8C2B80000000" , vpminuw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3ACB" , vpminuw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3A8C2B80000000" , vpminuw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3A8C2B80000000" , vpminuw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483ACB" , vpminuw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483A4C2B02" , vpminuw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D483A4C2B02" , vpminuw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -6356,8 +7224,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FE0828CA" , vpmovm2w(xmm1, k2));
TEST_INSTRUCTION("62F2FE2828CA" , vpmovm2w(ymm1, k2));
TEST_INSTRUCTION("62F2FE4828CA" , vpmovm2w(zmm1, k2));
- TEST_INSTRUCTION("C5F9D7CA" , vpmovmskb(ecx, xmm2));
- TEST_INSTRUCTION("C5FDD7CA" , vpmovmskb(ecx, ymm2));
TEST_INSTRUCTION("62F2FE0839CA" , vpmovq2m(k1, xmm2));
TEST_INSTRUCTION("62F2FE2839CA" , vpmovq2m(k1, ymm2));
TEST_INSTRUCTION("62F2FE4839CA" , vpmovq2m(k1, zmm2));
@@ -6442,57 +7308,21 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27E4820D1" , vpmovswb(ymm1, zmm2));
TEST_INSTRUCTION("62F27E48205C1104" , vpmovswb(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F27E48205C1104" , vpmovswb(ymmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C4E27921CA" , vpmovsxbd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279218C1A80000000" , vpmovsxbd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279218C1A80000000" , vpmovsxbd(xmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D21CA" , vpmovsxbd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D218C1A80000000" , vpmovsxbd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D218C1A80000000" , vpmovsxbd(ymm1, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4821CA" , vpmovsxbd(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48214C1A08" , vpmovsxbd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48214C1A08" , vpmovsxbd(zmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27922CA" , vpmovsxbq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279228C1A80000000" , vpmovsxbq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279228C1A80000000" , vpmovsxbq(xmm1, word_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D22CA" , vpmovsxbq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D228C1A80000000" , vpmovsxbq(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D228C1A80000000" , vpmovsxbq(ymm1, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4822CA" , vpmovsxbq(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48224C1A10" , vpmovsxbq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48224C1A10" , vpmovsxbq(zmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27920CA" , vpmovsxbw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279208C1A80000000" , vpmovsxbw(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279208C1A80000000" , vpmovsxbw(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D20CA" , vpmovsxbw(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D208C1A80000000" , vpmovsxbw(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D208C1A80000000" , vpmovsxbw(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4820CA" , vpmovsxbw(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48204C1A04" , vpmovsxbw(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48204C1A04" , vpmovsxbw(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27925CA" , vpmovsxdq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279258C1A80000000" , vpmovsxdq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279258C1A80000000" , vpmovsxdq(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D25CA" , vpmovsxdq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D258C1A80000000" , vpmovsxdq(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D258C1A80000000" , vpmovsxdq(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4825CA" , vpmovsxdq(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48254C1A04" , vpmovsxdq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48254C1A04" , vpmovsxdq(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27923CA" , vpmovsxwd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279238C1A80000000" , vpmovsxwd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279238C1A80000000" , vpmovsxwd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D23CA" , vpmovsxwd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D238C1A80000000" , vpmovsxwd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D238C1A80000000" , vpmovsxwd(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4823CA" , vpmovsxwd(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48234C1A04" , vpmovsxwd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48234C1A04" , vpmovsxwd(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27924CA" , vpmovsxwq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279248C1A80000000" , vpmovsxwq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279248C1A80000000" , vpmovsxwq(xmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D24CA" , vpmovsxwq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D248C1A80000000" , vpmovsxwq(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D248C1A80000000" , vpmovsxwq(ymm1, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4824CA" , vpmovsxwq(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48244C1A08" , vpmovsxwq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48244C1A08" , vpmovsxwq(zmm1, xmmword_ptr(rdx, rbx, 0, 128)));
@@ -6562,102 +7392,36 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27E4830D1" , vpmovwb(ymm1, zmm2));
TEST_INSTRUCTION("62F27E48305C1104" , vpmovwb(ptr(rcx, rdx, 0, 128), zmm3));
TEST_INSTRUCTION("62F27E48305C1104" , vpmovwb(ymmword_ptr(rcx, rdx, 0, 128), zmm3));
- TEST_INSTRUCTION("C4E27931CA" , vpmovzxbd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279318C1A80000000" , vpmovzxbd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279318C1A80000000" , vpmovzxbd(xmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D31CA" , vpmovzxbd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D318C1A80000000" , vpmovzxbd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D318C1A80000000" , vpmovzxbd(ymm1, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4831CA" , vpmovzxbd(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48314C1A08" , vpmovzxbd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48314C1A08" , vpmovzxbd(zmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27932CA" , vpmovzxbq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279328C1A80000000" , vpmovzxbq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279328C1A80000000" , vpmovzxbq(xmm1, word_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D32CA" , vpmovzxbq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D328C1A80000000" , vpmovzxbq(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D328C1A80000000" , vpmovzxbq(ymm1, dword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4832CA" , vpmovzxbq(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48324C1A10" , vpmovzxbq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48324C1A10" , vpmovzxbq(zmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27930CA" , vpmovzxbw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279308C1A80000000" , vpmovzxbw(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279308C1A80000000" , vpmovzxbw(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D30CA" , vpmovzxbw(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D308C1A80000000" , vpmovzxbw(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D308C1A80000000" , vpmovzxbw(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4830CA" , vpmovzxbw(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48304C1A04" , vpmovzxbw(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48304C1A04" , vpmovzxbw(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27935CA" , vpmovzxdq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279358C1A80000000" , vpmovzxdq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279358C1A80000000" , vpmovzxdq(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D35CA" , vpmovzxdq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D358C1A80000000" , vpmovzxdq(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D358C1A80000000" , vpmovzxdq(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4835CA" , vpmovzxdq(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48354C1A04" , vpmovzxdq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48354C1A04" , vpmovzxdq(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27933CA" , vpmovzxwd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279338C1A80000000" , vpmovzxwd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279338C1A80000000" , vpmovzxwd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D33CA" , vpmovzxwd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D338C1A80000000" , vpmovzxwd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D338C1A80000000" , vpmovzxwd(ymm1, xmmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4833CA" , vpmovzxwd(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48334C1A04" , vpmovzxwd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48334C1A04" , vpmovzxwd(zmm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27934CA" , vpmovzxwq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279348C1A80000000" , vpmovzxwq(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279348C1A80000000" , vpmovzxwq(xmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D34CA" , vpmovzxwq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D348C1A80000000" , vpmovzxwq(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D348C1A80000000" , vpmovzxwq(ymm1, qword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D4834CA" , vpmovzxwq(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48344C1A08" , vpmovzxwq(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F27D48344C1A08" , vpmovzxwq(zmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E26928CB" , vpmuldq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269288C2B80000000" , vpmuldq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269288C2B80000000" , vpmuldq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D28CB" , vpmuldq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D288C2B80000000" , vpmuldq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D288C2B80000000" , vpmuldq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED4828CB" , vpmuldq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48284C2B02" , vpmuldq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48284C2B02" , vpmuldq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2690BCB" , vpmulhrsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2690B8C2B80000000" , vpmulhrsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2690B8C2B80000000" , vpmulhrsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0BCB" , vpmulhrsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D0B8C2B80000000" , vpmulhrsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0B8C2B80000000" , vpmulhrsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D480BCB" , vpmulhrsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D480B4C2B02" , vpmulhrsw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D480B4C2B02" , vpmulhrsw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E4CB" , vpmulhuw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E48C2B80000000" , vpmulhuw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E48C2B80000000" , vpmulhuw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE4CB" , vpmulhuw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE48C2B80000000" , vpmulhuw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE48C2B80000000" , vpmulhuw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E4CB" , vpmulhuw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E44C2B02" , vpmulhuw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E44C2B02" , vpmulhuw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E5CB" , vpmulhw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E58C2B80000000" , vpmulhw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E58C2B80000000" , vpmulhw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE5CB" , vpmulhw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE58C2B80000000" , vpmulhw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE58C2B80000000" , vpmulhw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E5CB" , vpmulhw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E54C2B02" , vpmulhw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E54C2B02" , vpmulhw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26940CB" , vpmulld(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269408C2B80000000" , vpmulld(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269408C2B80000000" , vpmulld(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D40CB" , vpmulld(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D408C2B80000000" , vpmulld(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D408C2B80000000" , vpmulld(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4840CB" , vpmulld(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48404C2B02" , vpmulld(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48404C2B02" , vpmulld(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -6670,12 +7434,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4840CB" , vpmullq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48404C2B02" , vpmullq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48404C2B02" , vpmullq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D5CB" , vpmullw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9D58C2B80000000" , vpmullw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D58C2B80000000" , vpmullw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD5CB" , vpmullw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDD58C2B80000000" , vpmullw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD58C2B80000000" , vpmullw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48D5CB" , vpmullw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48D54C2B02" , vpmullw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48D54C2B02" , vpmullw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -6688,12 +7446,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4883CB" , vpmultishiftqb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48834C2B02" , vpmultishiftqb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48834C2B02" , vpmultishiftqb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F4CB" , vpmuludq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F48C2B80000000" , vpmuludq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F48C2B80000000" , vpmuludq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF4CB" , vpmuludq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF48C2B80000000" , vpmuludq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF48C2B80000000" , vpmuludq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48F4CB" , vpmuludq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48F44C2B02" , vpmuludq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48F44C2B02" , vpmuludq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -6733,12 +7485,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD4854CA" , vpopcntw(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48544C1A02" , vpopcntw(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD48544C1A02" , vpopcntw(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5E9EBCB" , vpor(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EB8C2B80000000" , vpor(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9EB8C2B80000000" , vpor(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEBCB" , vpor(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEB8C2B80000000" , vpor(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEB8C2B80000000" , vpor(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08EBCB" , vpord(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08EB4C2B08" , vpord(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08EB4C2B08" , vpord(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -6757,11 +7503,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48EBCB" , vporq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48EB4C2B02" , vporq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48EB4C2B02" , vporq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE868A3CB40" , vpperm(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8E8A38C358000000030" , vpperm(xmm1, xmm2, xmm3, ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("8FE8E8A38C358000000030" , vpperm(xmm1, xmm2, xmm3, xmmword_ptr(rbp, rsi, 0, 128)));
- TEST_INSTRUCTION("8FE868A38C2B8000000060" , vpperm(xmm1, xmm2, ptr(rbx, rbp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868A38C2B8000000060" , vpperm(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), xmm6));
TEST_INSTRUCTION("62F1750872CA01" , vprold(xmm1, xmm2, 1));
TEST_INSTRUCTION("62F17508724C1A0801" , vprold(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17508724C1A0801" , vprold(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
@@ -6834,44 +7575,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4814CB" , vprorvq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48144C2B02" , vprorvq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48144C2B02" , vprorvq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE96090CA" , vprotb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE878C0CA01" , vprotb(xmm1, xmm2, 1));
- TEST_INSTRUCTION("8FE9E8908C2B80000000" , vprotb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8908C2B80000000" , vprotb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958908C1A80000000" , vprotb(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C08C1A8000000001" , vprotb(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FE958908C1A80000000" , vprotb(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C08C1A8000000001" , vprotb(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FE96092CA" , vprotd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE878C2CA01" , vprotd(xmm1, xmm2, 1));
- TEST_INSTRUCTION("8FE9E8928C2B80000000" , vprotd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8928C2B80000000" , vprotd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958928C1A80000000" , vprotd(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C28C1A8000000001" , vprotd(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FE958928C1A80000000" , vprotd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C28C1A8000000001" , vprotd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FE96093CA" , vprotq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE878C3CA01" , vprotq(xmm1, xmm2, 1));
- TEST_INSTRUCTION("8FE9E8938C2B80000000" , vprotq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8938C2B80000000" , vprotq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958938C1A80000000" , vprotq(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C38C1A8000000001" , vprotq(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FE958938C1A80000000" , vprotq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C38C1A8000000001" , vprotq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FE96091CA" , vprotw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE878C1CA01" , vprotw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("8FE9E8918C2B80000000" , vprotw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8918C2B80000000" , vprotw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958918C1A80000000" , vprotw(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C18C1A8000000001" , vprotw(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("8FE958918C1A80000000" , vprotw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C18C1A8000000001" , vprotw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9F6CB" , vpsadbw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F68C2B80000000" , vpsadbw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F68C2B80000000" , vpsadbw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF6CB" , vpsadbw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF68C2B80000000" , vpsadbw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF68C2B80000000" , vpsadbw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48F6CB" , vpsadbw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48F64C2B02" , vpsadbw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48F64C2B02" , vpsadbw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -6887,36 +7590,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD09A15C1110" , k(k1).vpscatterqq(ptr(rcx, xmm2, 0, 128), xmm3));
TEST_INSTRUCTION("62F2FD29A15C1110" , k(k1).vpscatterqq(ptr(rcx, ymm2, 0, 128), ymm3));
TEST_INSTRUCTION("62F2FD49A15C1110" , k(k1).vpscatterqq(ptr(rcx, zmm2, 0, 128), zmm3));
- TEST_INSTRUCTION("8FE96098CA" , vpshab(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8988C2B80000000" , vpshab(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8988C2B80000000" , vpshab(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958988C1A80000000" , vpshab(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958988C1A80000000" , vpshab(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE9609ACA" , vpshad(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E89A8C2B80000000" , vpshad(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E89A8C2B80000000" , vpshad(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9589A8C1A80000000" , vpshad(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE9589A8C1A80000000" , vpshad(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE9609BCA" , vpshaq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E89B8C2B80000000" , vpshaq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E89B8C2B80000000" , vpshaq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9589B8C1A80000000" , vpshaq(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE9589B8C1A80000000" , vpshaq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE96099CA" , vpshaw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8998C2B80000000" , vpshaw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8998C2B80000000" , vpshaw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958998C1A80000000" , vpshaw(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958998C1A80000000" , vpshaw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE96094CA" , vpshlb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8948C2B80000000" , vpshlb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8948C2B80000000" , vpshlb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958948C1A80000000" , vpshlb(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958948C1A80000000" , vpshlb(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE96096CA" , vpshld(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8968C2B80000000" , vpshld(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8968C2B80000000" , vpshld(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958968C1A80000000" , vpshld(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958968C1A80000000" , vpshld(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
TEST_INSTRUCTION("62F36D0871CB01" , vpshldd(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08714C2B0801" , vpshldd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08714C2B0801" , vpshldd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
@@ -6971,16 +7644,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED4870CB01" , vpshldw(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48704C2B0201" , vpshldw(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48704C2B0201" , vpshldw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("8FE96097CA" , vpshlq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8978C2B80000000" , vpshlq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8978C2B80000000" , vpshlq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958978C1A80000000" , vpshlq(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958978C1A80000000" , vpshlq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE96095CA" , vpshlw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8958C2B80000000" , vpshlw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8958C2B80000000" , vpshlw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("8FE958958C1A80000000" , vpshlw(xmm1, ptr(rdx, rbx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958958C1A80000000" , vpshlw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), xmm4));
TEST_INSTRUCTION("62F36D0873CB01" , vpshrdd(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08734C2B0801" , vpshrdd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08734C2B0801" , vpshrdd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
@@ -7035,12 +7698,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED4872CB01" , vpshrdw(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48724C2B0201" , vpshrdw(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48724C2B0201" , vpshrdw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E26900CB" , vpshufb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269008C2B80000000" , vpshufb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269008C2B80000000" , vpshufb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D00CB" , vpshufb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D008C2B80000000" , vpshufb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D008C2B80000000" , vpshufb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4800CB" , vpshufb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48004C2B02" , vpshufb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48004C2B02" , vpshufb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -7053,59 +7710,15 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D488FCB" , vpshufbitqmb(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D488F4C2B02" , vpshufbitqmb(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D488F4C2B02" , vpshufbitqmb(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5F970CA01" , vpshufd(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5F9708C1A8000000001" , vpshufd(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5F9708C1A8000000001" , vpshufd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FD70CA01" , vpshufd(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5FD708C1A8000000001" , vpshufd(ymm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FD708C1A8000000001" , vpshufd(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17D4870CA01" , vpshufd(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17D48704C1A0201" , vpshufd(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17D48704C1A0201" , vpshufd(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FA70CA01" , vpshufhw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5FA708C1A8000000001" , vpshufhw(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FA708C1A8000000001" , vpshufhw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FE70CA01" , vpshufhw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5FE708C1A8000000001" , vpshufhw(ymm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FE708C1A8000000001" , vpshufhw(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17E4870CA01" , vpshufhw(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17E48704C1A0201" , vpshufhw(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17E48704C1A0201" , vpshufhw(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FB70CA01" , vpshuflw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5FB708C1A8000000001" , vpshuflw(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FB708C1A8000000001" , vpshuflw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FF70CA01" , vpshuflw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5FF708C1A8000000001" , vpshuflw(ymm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5FF708C1A8000000001" , vpshuflw(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17F4870CA01" , vpshuflw(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17F48704C1A0201" , vpshuflw(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17F48704C1A0201" , vpshuflw(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26908CB" , vpsignb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269088C2B80000000" , vpsignb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269088C2B80000000" , vpsignb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D08CB" , vpsignb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D088C2B80000000" , vpsignb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D088C2B80000000" , vpsignb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2690ACB" , vpsignd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2690A8C2B80000000" , vpsignd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2690A8C2B80000000" , vpsignd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0ACB" , vpsignd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D0A8C2B80000000" , vpsignd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0A8C2B80000000" , vpsignd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26909CB" , vpsignw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269098C2B80000000" , vpsignw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269098C2B80000000" , vpsignw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D09CB" , vpsignw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D098C2B80000000" , vpsignw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D098C2B80000000" , vpsignw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F2CB" , vpslld(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F172F201" , vpslld(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9F28C2B80000000" , vpslld(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F28C2B80000000" , vpslld(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF2CB" , vpslld(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F572F201" , vpslld(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDF28C2B80000000" , vpslld(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF28C2B80000000" , vpslld(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1750872741A0801" , vpslld(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1750872741A0801" , vpslld(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1752872741A0401" , vpslld(ymm1, ptr(rdx, rbx, 0, 128), 1));
@@ -7116,23 +7729,13 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48F24C2B08" , vpslld(zmm1, zmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1754872741A0201" , vpslld(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1754872741A0201" , vpslld(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5F173FA01" , vpslldq(xmm1, xmm2, 1));
TEST_INSTRUCTION("62F17508737C1A0801" , vpslldq(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17508737C1A0801" , vpslldq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5F573FA01" , vpslldq(ymm1, ymm2, 1));
TEST_INSTRUCTION("62F17528737C1A0401" , vpslldq(ymm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17528737C1A0401" , vpslldq(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1754873FA01" , vpslldq(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17548737C1A0201" , vpslldq(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17548737C1A0201" , vpslldq(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9F3CB" , vpsllq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F173F201" , vpsllq(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9F38C2B80000000" , vpsllq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F38C2B80000000" , vpsllq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF3CB" , vpsllq(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F573F201" , vpsllq(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDF38C2B80000000" , vpsllq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF38C2B80000000" , vpsllq(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1F50873741A0801" , vpsllq(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1F50873741A0801" , vpsllq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1F52873741A0401" , vpsllq(ymm1, ptr(rdx, rbx, 0, 128), 1));
@@ -7143,21 +7746,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48F34C2B08" , vpsllq(zmm1, zmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1F54873741A0201" , vpsllq(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1F54873741A0201" , vpsllq(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26947CB" , vpsllvd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269478C2B80000000" , vpsllvd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269478C2B80000000" , vpsllvd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D47CB" , vpsllvd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D478C2B80000000" , vpsllvd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D478C2B80000000" , vpsllvd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4847CB" , vpsllvd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48474C2B02" , vpsllvd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48474C2B02" , vpsllvd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E947CB" , vpsllvq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9478C2B80000000" , vpsllvq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9478C2B80000000" , vpsllvq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED47CB" , vpsllvq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED478C2B80000000" , vpsllvq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED478C2B80000000" , vpsllvq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED4847CB" , vpsllvq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48474C2B02" , vpsllvq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48474C2B02" , vpsllvq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -7170,14 +7761,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4812CB" , vpsllvw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48124C2B02" , vpsllvw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48124C2B02" , vpsllvw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F1CB" , vpsllw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F171F201" , vpsllw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9F18C2B80000000" , vpsllw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F18C2B80000000" , vpsllw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF1CB" , vpsllw(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F571F201" , vpsllw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDF18C2B80000000" , vpsllw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF18C2B80000000" , vpsllw(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1750871741A0801" , vpsllw(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1750871741A0801" , vpsllw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1752871741A0401" , vpsllw(ymm1, ptr(rdx, rbx, 0, 128), 1));
@@ -7188,14 +7771,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48F14C2B08" , vpsllw(zmm1, zmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1754871741A0201" , vpsllw(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1754871741A0201" , vpsllw(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9E2CB" , vpsrad(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F172E201" , vpsrad(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9E28C2B80000000" , vpsrad(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E28C2B80000000" , vpsrad(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE2CB" , vpsrad(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F572E201" , vpsrad(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDE28C2B80000000" , vpsrad(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE28C2B80000000" , vpsrad(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1750872641A0801" , vpsrad(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1750872641A0801" , vpsrad(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1752872641A0401" , vpsrad(ymm1, ptr(rdx, rbx, 0, 128), 1));
@@ -7224,12 +7799,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48E24C2B08" , vpsraq(zmm1, zmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1F54872641A0201" , vpsraq(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1F54872641A0201" , vpsraq(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26946CB" , vpsravd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269468C2B80000000" , vpsravd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269468C2B80000000" , vpsravd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D46CB" , vpsravd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D468C2B80000000" , vpsravd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D468C2B80000000" , vpsravd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4846CB" , vpsravd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48464C2B02" , vpsravd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48464C2B02" , vpsravd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -7251,14 +7820,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4811CB" , vpsravw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48114C2B02" , vpsravw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48114C2B02" , vpsravw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E1CB" , vpsraw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F171E201" , vpsraw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9E18C2B80000000" , vpsraw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E18C2B80000000" , vpsraw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE1CB" , vpsraw(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F571E201" , vpsraw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDE18C2B80000000" , vpsraw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE18C2B80000000" , vpsraw(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1750871641A0801" , vpsraw(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1750871641A0801" , vpsraw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1752871641A0401" , vpsraw(ymm1, ptr(rdx, rbx, 0, 128), 1));
@@ -7269,14 +7830,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48E14C2B08" , vpsraw(zmm1, zmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1754871641A0201" , vpsraw(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1754871641A0201" , vpsraw(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9D2CB" , vpsrld(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F172D201" , vpsrld(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9D28C2B80000000" , vpsrld(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D28C2B80000000" , vpsrld(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD2CB" , vpsrld(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F572D201" , vpsrld(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDD28C2B80000000" , vpsrld(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD28C2B80000000" , vpsrld(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1750872541A0801" , vpsrld(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1750872541A0801" , vpsrld(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1752872541A0401" , vpsrld(ymm1, ptr(rdx, rbx, 0, 128), 1));
@@ -7287,23 +7840,13 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48D24C2B08" , vpsrld(zmm1, zmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1754872541A0201" , vpsrld(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1754872541A0201" , vpsrld(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5F173DA01" , vpsrldq(xmm1, xmm2, 1));
TEST_INSTRUCTION("62F17508735C1A0801" , vpsrldq(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17508735C1A0801" , vpsrldq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5F573DA01" , vpsrldq(ymm1, ymm2, 1));
TEST_INSTRUCTION("62F17528735C1A0401" , vpsrldq(ymm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17528735C1A0401" , vpsrldq(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1754873DA01" , vpsrldq(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17548735C1A0201" , vpsrldq(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F17548735C1A0201" , vpsrldq(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9D3CB" , vpsrlq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F173D201" , vpsrlq(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9D38C2B80000000" , vpsrlq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D38C2B80000000" , vpsrlq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD3CB" , vpsrlq(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F573D201" , vpsrlq(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDD38C2B80000000" , vpsrlq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD38C2B80000000" , vpsrlq(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1F50873541A0801" , vpsrlq(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1F50873541A0801" , vpsrlq(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1F52873541A0401" , vpsrlq(ymm1, ptr(rdx, rbx, 0, 128), 1));
@@ -7314,21 +7857,9 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48D34C2B08" , vpsrlq(zmm1, zmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1F54873541A0201" , vpsrlq(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1F54873541A0201" , vpsrlq(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26945CB" , vpsrlvd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269458C2B80000000" , vpsrlvd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E269458C2B80000000" , vpsrlvd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D45CB" , vpsrlvd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D458C2B80000000" , vpsrlvd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E26D458C2B80000000" , vpsrlvd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D4845CB" , vpsrlvd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48454C2B02" , vpsrlvd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D48454C2B02" , vpsrlvd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E945CB" , vpsrlvq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9458C2B80000000" , vpsrlvq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9458C2B80000000" , vpsrlvq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED45CB" , vpsrlvq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED458C2B80000000" , vpsrlvq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED458C2B80000000" , vpsrlvq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED4845CB" , vpsrlvq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48454C2B02" , vpsrlvq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48454C2B02" , vpsrlvq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -7341,14 +7872,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4810CB" , vpsrlvw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48104C2B02" , vpsrlvw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED48104C2B02" , vpsrlvw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D1CB" , vpsrlw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F171D201" , vpsrlw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9D18C2B80000000" , vpsrlw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D18C2B80000000" , vpsrlw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD1CB" , vpsrlw(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F571D201" , vpsrlw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDD18C2B80000000" , vpsrlw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD18C2B80000000" , vpsrlw(ymm1, ymm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1750871541A0801" , vpsrlw(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1750871541A0801" , vpsrlw(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1752871541A0401" , vpsrlw(ymm1, ptr(rdx, rbx, 0, 128), 1));
@@ -7359,75 +7882,27 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48D14C2B08" , vpsrlw(zmm1, zmm2, xmmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1754871541A0201" , vpsrlw(zmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F1754871541A0201" , vpsrlw(zmm1, zmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9F8CB" , vpsubb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F88C2B80000000" , vpsubb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F88C2B80000000" , vpsubb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF8CB" , vpsubb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF88C2B80000000" , vpsubb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF88C2B80000000" , vpsubb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48F8CB" , vpsubb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48F84C2B02" , vpsubb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48F84C2B02" , vpsubb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FACB" , vpsubd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FA8C2B80000000" , vpsubd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FA8C2B80000000" , vpsubd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFACB" , vpsubd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFA8C2B80000000" , vpsubd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFA8C2B80000000" , vpsubd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48FACB" , vpsubd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48FA4C2B02" , vpsubd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48FA4C2B02" , vpsubd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FBCB" , vpsubq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FB8C2B80000000" , vpsubq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9FB8C2B80000000" , vpsubq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFBCB" , vpsubq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFB8C2B80000000" , vpsubq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDFB8C2B80000000" , vpsubq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48FBCB" , vpsubq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48FB4C2B02" , vpsubq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48FB4C2B02" , vpsubq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E8CB" , vpsubsb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E88C2B80000000" , vpsubsb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E88C2B80000000" , vpsubsb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE8CB" , vpsubsb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE88C2B80000000" , vpsubsb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE88C2B80000000" , vpsubsb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E8CB" , vpsubsb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E84C2B02" , vpsubsb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E84C2B02" , vpsubsb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E9CB" , vpsubsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E98C2B80000000" , vpsubsw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9E98C2B80000000" , vpsubsw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE9CB" , vpsubsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE98C2B80000000" , vpsubsw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDE98C2B80000000" , vpsubsw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E9CB" , vpsubsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E94C2B02" , vpsubsw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48E94C2B02" , vpsubsw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D8CB" , vpsubusb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9D88C2B80000000" , vpsubusb(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D88C2B80000000" , vpsubusb(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD8CB" , vpsubusb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDD88C2B80000000" , vpsubusb(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD88C2B80000000" , vpsubusb(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48D8CB" , vpsubusb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48D84C2B02" , vpsubusb(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48D84C2B02" , vpsubusb(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D9CB" , vpsubusw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9D98C2B80000000" , vpsubusw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9D98C2B80000000" , vpsubusw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD9CB" , vpsubusw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDD98C2B80000000" , vpsubusw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDD98C2B80000000" , vpsubusw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48D9CB" , vpsubusw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48D94C2B02" , vpsubusw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48D94C2B02" , vpsubusw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F9CB" , vpsubw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F98C2B80000000" , vpsubw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9F98C2B80000000" , vpsubw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF9CB" , vpsubw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF98C2B80000000" , vpsubw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDF98C2B80000000" , vpsubw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48F9CB" , vpsubw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48F94C2B02" , vpsubw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48F94C2B02" , vpsubw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
@@ -7449,12 +7924,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED4825CB01" , vpternlogq(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48254C2B0201" , vpternlogq(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48254C2B0201" , vpternlogq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E27917CA" , vptest(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279178C1A80000000" , vptest(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E279178C1A80000000" , vptest(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D17CA" , vptest(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D178C1A80000000" , vptest(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D178C1A80000000" , vptest(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F26D0826CB" , vptestmb(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D08264C2B08" , vptestmb(k1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D08264C2B08" , vptestmb(k1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -7527,84 +7996,30 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2EE4826CB" , vptestnmw(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F2EE48264C2B02" , vptestnmw(k1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2EE48264C2B02" , vptestnmw(k1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E968CB" , vpunpckhbw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9688C2B80000000" , vpunpckhbw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9688C2B80000000" , vpunpckhbw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED68CB" , vpunpckhbw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED688C2B80000000" , vpunpckhbw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED688C2B80000000" , vpunpckhbw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4868CB" , vpunpckhbw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48684C2B02" , vpunpckhbw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48684C2B02" , vpunpckhbw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E96ACB" , vpunpckhdq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E96A8C2B80000000" , vpunpckhdq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E96A8C2B80000000" , vpunpckhdq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED6ACB" , vpunpckhdq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED6A8C2B80000000" , vpunpckhdq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED6A8C2B80000000" , vpunpckhdq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D486ACB" , vpunpckhdq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D486A4C2B02" , vpunpckhdq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D486A4C2B02" , vpunpckhdq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E96DCB" , vpunpckhqdq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E96D8C2B80000000" , vpunpckhqdq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E96D8C2B80000000" , vpunpckhqdq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED6DCB" , vpunpckhqdq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED6D8C2B80000000" , vpunpckhqdq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED6D8C2B80000000" , vpunpckhqdq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED486DCB" , vpunpckhqdq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED486D4C2B02" , vpunpckhqdq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED486D4C2B02" , vpunpckhqdq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E969CB" , vpunpckhwd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9698C2B80000000" , vpunpckhwd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9698C2B80000000" , vpunpckhwd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED69CB" , vpunpckhwd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED698C2B80000000" , vpunpckhwd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED698C2B80000000" , vpunpckhwd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4869CB" , vpunpckhwd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48694C2B02" , vpunpckhwd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48694C2B02" , vpunpckhwd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E960CB" , vpunpcklbw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9608C2B80000000" , vpunpcklbw(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9608C2B80000000" , vpunpcklbw(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED60CB" , vpunpcklbw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED608C2B80000000" , vpunpcklbw(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED608C2B80000000" , vpunpcklbw(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4860CB" , vpunpcklbw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48604C2B02" , vpunpcklbw(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48604C2B02" , vpunpcklbw(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E962CB" , vpunpckldq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9628C2B80000000" , vpunpckldq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9628C2B80000000" , vpunpckldq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED62CB" , vpunpckldq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED628C2B80000000" , vpunpckldq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED628C2B80000000" , vpunpckldq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4862CB" , vpunpckldq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48624C2B02" , vpunpckldq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48624C2B02" , vpunpckldq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E96CCB" , vpunpcklqdq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E96C8C2B80000000" , vpunpcklqdq(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E96C8C2B80000000" , vpunpcklqdq(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED6CCB" , vpunpcklqdq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED6C8C2B80000000" , vpunpcklqdq(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED6C8C2B80000000" , vpunpcklqdq(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED486CCB" , vpunpcklqdq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED486C4C2B02" , vpunpcklqdq(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED486C4C2B02" , vpunpcklqdq(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E961CB" , vpunpcklwd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9618C2B80000000" , vpunpcklwd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9618C2B80000000" , vpunpcklwd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED61CB" , vpunpcklwd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED618C2B80000000" , vpunpcklwd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED618C2B80000000" , vpunpcklwd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D4861CB" , vpunpcklwd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48614C2B02" , vpunpcklwd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D48614C2B02" , vpunpcklwd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9EFCB" , vpxor(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EF8C2B80000000" , vpxor(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9EF8C2B80000000" , vpxor(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEFCB" , vpxor(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEF8C2B80000000" , vpxor(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EDEF8C2B80000000" , vpxor(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08EFCB" , vpxord(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08EF4C2B08" , vpxord(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16D08EF4C2B08" , vpxord(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -7683,15 +8098,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D08CBCB" , vrcp28ss(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D08CB4C2B20" , vrcp28ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D08CB4C2B20" , vrcp28ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5F853CA" , vrcpps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8538C1A80000000" , vrcpps(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F8538C1A80000000" , vrcpps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC53CA" , vrcpps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC538C1A80000000" , vrcpps(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC538C1A80000000" , vrcpps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5EA53CB" , vrcpss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA538C2B80000000" , vrcpss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA538C2B80000000" , vrcpss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F3FD0856CA01" , vreducepd(xmm1, xmm2, 1));
TEST_INSTRUCTION("62F3FD08564C1A0801" , vreducepd(xmm1, ptr(rdx, rbx, 0, 128), 1));
TEST_INSTRUCTION("62F3FD08564C1A0801" , vreducepd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
@@ -7740,24 +8146,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D080ACB01" , vrndscaless(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D080A4C2B2001" , vrndscaless(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F36D080A4C2B2001" , vrndscaless(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E37909CA01" , vroundpd(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E379098C1A8000000001" , vroundpd(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E379098C1A8000000001" , vroundpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D09CA01" , vroundpd(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D098C1A8000000001" , vroundpd(ymm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D098C1A8000000001" , vroundpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37908CA01" , vroundps(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E379088C1A8000000001" , vroundps(xmm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E379088C1A8000000001" , vroundps(xmm1, xmmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D08CA01" , vroundps(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D088C1A8000000001" , vroundps(ymm1, ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D088C1A8000000001" , vroundps(ymm1, ymmword_ptr(rdx, rbx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690BCB01" , vroundsd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690B8C2B8000000001" , vroundsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690B8C2B8000000001" , vroundsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690ACB01" , vroundss(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690A8C2B8000000001" , vroundss(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690A8C2B8000000001" , vroundss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F2FD084ECA" , vrsqrt14pd(xmm1, xmm2));
TEST_INSTRUCTION("62F2FD084E4C1A08" , vrsqrt14pd(xmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F2FD084E4C1A08" , vrsqrt14pd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
@@ -7794,15 +8182,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D08CDCB" , vrsqrt28ss(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D08CD4C2B20" , vrsqrt28ss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F26D08CD4C2B20" , vrsqrt28ss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5F852CA" , vrsqrtps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8528C1A80000000" , vrsqrtps(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F8528C1A80000000" , vrsqrtps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC52CA" , vrsqrtps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC528C1A80000000" , vrsqrtps(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC528C1A80000000" , vrsqrtps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5EA52CB" , vrsqrtss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA528C2B80000000" , vrsqrtss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA528C2B80000000" , vrsqrtss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED082CCB" , vscalefpd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F2ED082C4C2B08" , vscalefpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F2ED082C4C2B08" , vscalefpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
@@ -7871,148 +8250,42 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED4843CB01" , vshufi64x2(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48434C2B0201" , vshufi64x2(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48434C2B0201" , vshufi64x2(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C6CB01" , vshufpd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5E9C68C2B8000000001" , vshufpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C68C2B8000000001" , vshufpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5EDC6CB01" , vshufpd(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C5EDC68C2B8000000001" , vshufpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5EDC68C2B8000000001" , vshufpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED48C6CB01" , vshufpd(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F1ED48C64C2B0201" , vshufpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED48C64C2B0201" , vshufpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E8C6CB01" , vshufps(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5E8C68C2B8000000001" , vshufps(xmm1, xmm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5E8C68C2B8000000001" , vshufps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5ECC6CB01" , vshufps(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C5ECC68C2B8000000001" , vshufps(ymm1, ymm2, ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5ECC68C2B8000000001" , vshufps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16C48C6CB01" , vshufps(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F16C48C64C2B0201" , vshufps(zmm1, zmm2, ptr(rbx, rbp, 0, 128), 1));
TEST_INSTRUCTION("62F16C48C64C2B0201" , vshufps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128), 1));
- TEST_INSTRUCTION("C5F951CA" , vsqrtpd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F9518C1A80000000" , vsqrtpd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F9518C1A80000000" , vsqrtpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD51CA" , vsqrtpd(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD518C1A80000000" , vsqrtpd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FD518C1A80000000" , vsqrtpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD4851CA" , vsqrtpd(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48514C1A02" , vsqrtpd(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F1FD48514C1A02" , vsqrtpd(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F851CA" , vsqrtps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8518C1A80000000" , vsqrtps(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F8518C1A80000000" , vsqrtps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC51CA" , vsqrtps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC518C1A80000000" , vsqrtps(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5FC518C1A80000000" , vsqrtps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C4851CA" , vsqrtps(zmm1, zmm2));
TEST_INSTRUCTION("62F17C48514C1A02" , vsqrtps(zmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("62F17C48514C1A02" , vsqrtps(zmm1, zmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5EB51CB" , vsqrtsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB518C2B80000000" , vsqrtsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB518C2B80000000" , vsqrtsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA51CB" , vsqrtss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA518C2B80000000" , vsqrtss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA518C2B80000000" , vsqrtss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5F8AE9C1180000000" , vstmxcsr(ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("C5F8AE9C1180000000" , vstmxcsr(dword_ptr(rcx, rdx, 0, 128)));
- TEST_INSTRUCTION("C5E95CCB" , vsubpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E95C8C2B80000000" , vsubpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E95C8C2B80000000" , vsubpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED5CCB" , vsubpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED5C8C2B80000000" , vsubpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED5C8C2B80000000" , vsubpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED485CCB" , vsubpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED485C4C2B02" , vsubpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED485C4C2B02" , vsubpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E85CCB" , vsubps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E85C8C2B80000000" , vsubps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E85C8C2B80000000" , vsubps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC5CCB" , vsubps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC5C8C2B80000000" , vsubps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC5C8C2B80000000" , vsubps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C485CCB" , vsubps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C485C4C2B02" , vsubps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C485C4C2B02" , vsubps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB5CCB" , vsubsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5C8C2B80000000" , vsubsd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EB5C8C2B80000000" , vsubsd(xmm1, xmm2, qword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5CCB" , vsubss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5C8C2B80000000" , vsubss(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EA5C8C2B80000000" , vsubss(xmm1, xmm2, dword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C4E2790FCA" , vtestpd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2790F8C1A80000000" , vtestpd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2790F8C1A80000000" , vtestpd(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D0FCA" , vtestpd(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D0F8C1A80000000" , vtestpd(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D0F8C1A80000000" , vtestpd(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2790ECA" , vtestps(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2790E8C1A80000000" , vtestps(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E2790E8C1A80000000" , vtestps(xmm1, xmmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D0ECA" , vtestps(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D0E8C1A80000000" , vtestps(ymm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C4E27D0E8C1A80000000" , vtestps(ymm1, ymmword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F92ECA" , vucomisd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F92E8C1A80000000" , vucomisd(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F92E8C1A80000000" , vucomisd(xmm1, qword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F82ECA" , vucomiss(xmm1, xmm2));
- TEST_INSTRUCTION("C5F82E8C1A80000000" , vucomiss(xmm1, ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5F82E8C1A80000000" , vucomiss(xmm1, dword_ptr(rdx, rbx, 0, 128)));
- TEST_INSTRUCTION("C5E915CB" , vunpckhpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9158C2B80000000" , vunpckhpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9158C2B80000000" , vunpckhpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED15CB" , vunpckhpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED158C2B80000000" , vunpckhpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED158C2B80000000" , vunpckhpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED4815CB" , vunpckhpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48154C2B02" , vunpckhpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48154C2B02" , vunpckhpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E815CB" , vunpckhps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8158C2B80000000" , vunpckhps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E8158C2B80000000" , vunpckhps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC15CB" , vunpckhps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC158C2B80000000" , vunpckhps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC158C2B80000000" , vunpckhps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C4815CB" , vunpckhps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48154C2B02" , vunpckhps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C48154C2B02" , vunpckhps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E914CB" , vunpcklpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9148C2B80000000" , vunpcklpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9148C2B80000000" , vunpcklpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED14CB" , vunpcklpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED148C2B80000000" , vunpcklpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED148C2B80000000" , vunpcklpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED4814CB" , vunpcklpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48144C2B02" , vunpcklpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48144C2B02" , vunpcklpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E814CB" , vunpcklps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8148C2B80000000" , vunpcklps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E8148C2B80000000" , vunpcklps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC14CB" , vunpcklps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC148C2B80000000" , vunpcklps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC148C2B80000000" , vunpcklps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C4814CB" , vunpcklps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48144C2B02" , vunpcklps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C48144C2B02" , vunpcklps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E957CB" , vxorpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9578C2B80000000" , vxorpd(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E9578C2B80000000" , vxorpd(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED57CB" , vxorpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED578C2B80000000" , vxorpd(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5ED578C2B80000000" , vxorpd(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED4857CB" , vxorpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48574C2B02" , vxorpd(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F1ED48574C2B02" , vxorpd(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E857CB" , vxorps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8578C2B80000000" , vxorps(xmm1, xmm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5E8578C2B80000000" , vxorps(xmm1, xmm2, xmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC57CB" , vxorps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC578C2B80000000" , vxorps(ymm1, ymm2, ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5EC578C2B80000000" , vxorps(ymm1, ymm2, ymmword_ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C4857CB" , vxorps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48574C2B02" , vxorps(zmm1, zmm2, ptr(rbx, rbp, 0, 128)));
TEST_INSTRUCTION("62F16C48574C2B02" , vxorps(zmm1, zmm2, zmmword_ptr(rbx, rbp, 0, 128)));
- TEST_INSTRUCTION("C5FC77" , vzeroall());
- TEST_INSTRUCTION("C5F877" , vzeroupper());
}
static void ASMJIT_NOINLINE testX64AssemblerAVX512_FP16(AssemblerTester<x86::Assembler>& tester) noexcept {
@@ -8040,8 +8313,10 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX512_FP16(AssemblerTester<x86::Ass
TEST_INSTRUCTION("62F57D087E7280" , vmovw(word_ptr(rdx, -256), xmm6));
}
-// Tests generated from 'llvm/test/MC/X86/intel-syntax-avx512.s' file.
-static void ASMJIT_NOINLINE testX64AssemblerAVX512_LLVM(AssemblerTester<x86::Assembler>& tester) noexcept {
+// Tests generated from 'llvm/test/MC/X86/intel-syntax-avx512.s' file to ensure compatibility with LLVM assembler.
+//
+// NOTE: Split to 4 functions as compilers can be really slow when compiling it for some reason.
+static void ASMJIT_NOINLINE testX64AssemblerAVX512_LLVM_1(AssemblerTester<x86::Assembler>& tester) noexcept {
using namespace x86;
TEST_INSTRUCTION("62F174485808" , vaddps(zmm1, zmm1, zmmword_ptr(rax)));
@@ -9801,6 +10076,11 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX512_LLVM(AssemblerTester<x86::Ass
TEST_INSTRUCTION("62621508BF9200020000" , vfnmsub231ss(xmm26, xmm13, dword_ptr(rdx, 512)));
TEST_INSTRUCTION("62621508BF5280" , vfnmsub231ss(xmm26, xmm13, dword_ptr(rdx, -512)));
TEST_INSTRUCTION("62621508BF92FCFDFFFF" , vfnmsub231ss(xmm26, xmm13, dword_ptr(rdx, -516)));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX512_LLVM_2(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
TEST_INSTRUCTION("6212FD4842F1" , vgetexppd(zmm14, zmm25));
TEST_INSTRUCTION("6212FD4D42F1" , k(k5).vgetexppd(zmm14, zmm25));
TEST_INSTRUCTION("6212FDCD42F1" , k(k5).z().vgetexppd(zmm14, zmm25));
@@ -12841,6 +13121,11 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX512_LLVM(AssemblerTester<x86::Ass
TEST_INSTRUCTION("62E2D55877A200040000" , vpermi2pd(zmm20, zmm5, qword_ptr(rdx, 1024)._1to8()));
TEST_INSTRUCTION("62E2D558776280" , vpermi2pd(zmm20, zmm5, qword_ptr(rdx, -1024)._1to8()));
TEST_INSTRUCTION("62E2D55877A2F8FBFFFF" , vpermi2pd(zmm20, zmm5, qword_ptr(rdx, -1032)._1to8()));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX512_LLVM_3(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
TEST_INSTRUCTION("62E1A54858CA" , vaddpd(zmm17, zmm11, zmm2));
TEST_INSTRUCTION("62E1A54958CA" , k(k1).vaddpd(zmm17, zmm11, zmm2));
TEST_INSTRUCTION("62E1A5C958CA" , k(k1).z().vaddpd(zmm17, zmm11, zmm2));
@@ -15133,6 +15418,11 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX512_LLVM(AssemblerTester<x86::Ass
TEST_INSTRUCTION("62619D58DB9A00040000" , vpandq(zmm27, zmm12, qword_ptr(rdx, 1024)._1to8()));
TEST_INSTRUCTION("62619D58DB5A80" , vpandq(zmm27, zmm12, qword_ptr(rdx, -1024)._1to8()));
TEST_INSTRUCTION("62619D58DB9AF8FBFFFF" , vpandq(zmm27, zmm12, qword_ptr(rdx, -1032)._1to8()));
+}
+
+static void ASMJIT_NOINLINE testX64AssemblerAVX512_LLVM_4(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
TEST_INSTRUCTION("62C23D4064FC" , vpblendmd(zmm23, zmm24, zmm12));
TEST_INSTRUCTION("62C23D4164FC" , k(k1).vpblendmd(zmm23, zmm24, zmm12));
TEST_INSTRUCTION("62C23DC164FC" , k(k1).z().vpblendmd(zmm23, zmm24, zmm12));
@@ -17631,7 +17921,6 @@ static void ASMJIT_NOINLINE testX64AssemblerAVX512_LLVM(AssemblerTester<x86::Ass
TEST_INSTRUCTION("6292FD49A194C685FFFFFF" , k(k1).vpscatterqq(zmmword_ptr(r14, zmm8, 3, -123), zmm2));
TEST_INSTRUCTION("6292FD49A1540120" , k(k1).vpscatterqq(zmmword_ptr(r9, zmm8, 0, 256), zmm2));
TEST_INSTRUCTION("62B2FD49A1948100040000" , k(k1).vpscatterqq(zmmword_ptr(rcx, zmm8, 2, 1024), zmm2));
-
}
static void ASMJIT_NOINLINE testX64AssemblerAMX(AssemblerTester<x86::Assembler>& tester) noexcept {
@@ -17641,11 +17930,14 @@ static void ASMJIT_NOINLINE testX64AssemblerAMX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("C4E27849841180000000" , ldtilecfg(zmmword_ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("C4E27949841180000000" , sttilecfg(ptr(rcx, rdx, 0, 128)));
TEST_INSTRUCTION("C4E27949841180000000" , sttilecfg(zmmword_ptr(rcx, rdx, 0, 128)));
+ TEST_INSTRUCTION("C4E2616CCA" , tcmmimfp16ps(tmm1, tmm2, tmm3));
+ TEST_INSTRUCTION("C4E2606CCA" , tcmmrlfp16ps(tmm1, tmm2, tmm3));
TEST_INSTRUCTION("C4E2625CCA" , tdpbf16ps(tmm1, tmm2, tmm3));
TEST_INSTRUCTION("C4E2635ECA" , tdpbssd(tmm1, tmm2, tmm3));
TEST_INSTRUCTION("C4E2625ECA" , tdpbsud(tmm1, tmm2, tmm3));
TEST_INSTRUCTION("C4E2615ECA" , tdpbusd(tmm1, tmm2, tmm3));
TEST_INSTRUCTION("C4E2605ECA" , tdpbuud(tmm1, tmm2, tmm3));
+ TEST_INSTRUCTION("C4E2635CCA" , tdpfp16ps(tmm1, tmm2, tmm3));
TEST_INSTRUCTION("C4E27B4B8C1A80000000" , tileloadd(tmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("C4E2794B8C1A80000000" , tileloaddt1(tmm1, ptr(rdx, rbx, 0, 128)));
TEST_INSTRUCTION("C4E27849C0" , tilerelease());
@@ -17799,10 +18091,6 @@ static void ASMJIT_NOINLINE testX64AssemblerExtras(AssemblerTester<x86::Assemble
TEST_INSTRUCTION("62F2472068742DE0" , vp2intersectd(k6, k7, ymm23, ymmword_ptr(rbp, rbp, 0, -1024)));
TEST_INSTRUCTION("62F2472068717F" , vp2intersectd(k6, k7, ymm23, ymmword_ptr(rcx, 4064)));
- // AVX_VNNI & AVX512_VNNI.
- TEST_INSTRUCTION("C4E25550F4" , vex().vpdpbusd(ymm6, ymm5, ymm4));
- TEST_INSTRUCTION("62F2552850F4" , vpdpbusd(ymm6, ymm5, ymm4));
-
// SVM.
TEST_INSTRUCTION("670F01DF" , invlpga(eax, ecx));
TEST_INSTRUCTION("0F01DF" , invlpga(rax, ecx));
@@ -17814,13 +18102,26 @@ bool testX64Assembler(const TestSettings& settings) noexcept {
AssemblerTester<Assembler> tester(Arch::kX64, settings);
tester.printHeader("X64");
- TEST_INSTRUCTION("62919D18C2D2AB" , sae().vcmppd(k2, zmm12, zmm26, 171));
-
testX64AssemblerBase(tester);
+ testX64AssemblerBaseExt(tester);
testX64AssemblerMMX_SSE(tester);
testX64AssemblerAVX(tester);
+ testX64AssemblerAVX_NE_CONVERT(tester);
+ testX64AssemblerAVX_VNNI(tester);
+ testX64AssemblerAVX_VNNI_INT8(tester);
+ testX64AssemblerAVX_VNNI_INT16(tester);
+ testX64AssemblerAVX_SHA512(tester);
+ testX64AssemblerAVX_SM3(tester);
+ testX64AssemblerAVX_SM4(tester);
+ testX64AssemblerFMA(tester);
+ testX64AssemblerFMA4(tester);
+ testX64AssemblerXOP(tester);
+ testX64AssemblerAVX512(tester);
testX64AssemblerAVX512_FP16(tester);
- testX64AssemblerAVX512_LLVM(tester);
+ testX64AssemblerAVX512_LLVM_1(tester);
+ testX64AssemblerAVX512_LLVM_2(tester);
+ testX64AssemblerAVX512_LLVM_3(tester);
+ testX64AssemblerAVX512_LLVM_4(tester);
testX64AssemblerAMX(tester);
testX64AssemblerExtras(tester);
diff --git a/3rdparty/asmjit/test/asmjit_test_assembler_x86.cpp b/3rdparty/asmjit/test/asmjit_test_assembler_x86.cpp
index a5ea03ae525..6143d8cef91 100644
--- a/3rdparty/asmjit/test/asmjit_test_assembler_x86.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_assembler_x86.cpp
@@ -17,7 +17,10 @@
using namespace asmjit;
#define TEST_INSTRUCTION(OPCODE, ...) \
- tester.testInstruction(OPCODE, #__VA_ARGS__, tester.assembler.__VA_ARGS__)
+ tester.testValidInstruction(#__VA_ARGS__, OPCODE, tester.assembler.__VA_ARGS__)
+
+#define FAIL_INSTRUCTION(ExpectedError, ...) \
+ tester.testInvalidInstruction(#__VA_ARGS__, ExpectedError, tester.assembler.__VA_ARGS__)
static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>& tester) noexcept {
using namespace x86;
@@ -55,9 +58,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66138C1A80000000" , adc(cx, word_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("138C1A80000000" , adc(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("138C1A80000000" , adc(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("660F38F6CA" , adcx(ecx, edx));
- TEST_INSTRUCTION("660F38F68C1A80000000" , adcx(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("660F38F68C1A80000000" , adcx(ecx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("80C101" , add(cl, 1));
TEST_INSTRUCTION("80C501" , add(ch, 1));
TEST_INSTRUCTION("8084118000000001" , add(byte_ptr(ecx, edx, 0, 128), 1));
@@ -116,60 +116,9 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66238C1A80000000" , and_(cx, word_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("238C1A80000000" , and_(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("238C1A80000000" , and_(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E268F2CB" , andn(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E268F28C2B80000000" , andn(ecx, edx, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E268F28C2B80000000" , andn(ecx, edx, dword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("63D1" , arpl(cx, dx));
TEST_INSTRUCTION("639C1180000000" , arpl(ptr(ecx, edx, 0, 128), bx));
TEST_INSTRUCTION("639C1180000000" , arpl(word_ptr(ecx, edx, 0, 128), bx));
- TEST_INSTRUCTION("C4E260F7CA" , bextr(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E258F78C1A80000000" , bextr(ecx, ptr(edx, ebx, 0, 128), esp));
- TEST_INSTRUCTION("C4E258F78C1A80000000" , bextr(ecx, dword_ptr(edx, ebx, 0, 128), esp));
- TEST_INSTRUCTION("8FE97001CA" , blcfill(ecx, edx));
- TEST_INSTRUCTION("8FE970018C1A80000000" , blcfill(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE970018C1A80000000" , blcfill(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97002F2" , blci(ecx, edx));
- TEST_INSTRUCTION("8FE97002B41A80000000" , blci(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97002B41A80000000" , blci(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001EA" , blcic(ecx, edx));
- TEST_INSTRUCTION("8FE97001AC1A80000000" , blcic(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001AC1A80000000" , blcic(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97002CA" , blcmsk(ecx, edx));
- TEST_INSTRUCTION("8FE970028C1A80000000" , blcmsk(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE970028C1A80000000" , blcmsk(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001DA" , blcs(ecx, edx));
- TEST_INSTRUCTION("8FE970019C1A80000000" , blcs(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE970019C1A80000000" , blcs(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001D2" , blsfill(ecx, edx));
- TEST_INSTRUCTION("8FE97001941A80000000" , blsfill(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001941A80000000" , blsfill(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E270F3DA" , blsi(ecx, edx));
- TEST_INSTRUCTION("C4E270F39C1A80000000" , blsi(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E270F39C1A80000000" , blsi(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001F2" , blsic(ecx, edx));
- TEST_INSTRUCTION("8FE97001B41A80000000" , blsic(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001B41A80000000" , blsic(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E270F3D2" , blsmsk(ecx, edx));
- TEST_INSTRUCTION("C4E270F3941A80000000" , blsmsk(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E270F3941A80000000" , blsmsk(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E270F3CA" , blsr(ecx, edx));
- TEST_INSTRUCTION("C4E270F38C1A80000000" , blsr(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E270F38C1A80000000" , blsr(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30F1ACA" , bndcl(bnd1, edx));
- TEST_INSTRUCTION("F30F1A8C1A80000000" , bndcl(bnd1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30F1A8C1A80000000" , bndcl(bnd1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F20F1BCA" , bndcn(bnd1, edx));
- TEST_INSTRUCTION("F20F1B8C1A80000000" , bndcn(bnd1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F20F1B8C1A80000000" , bndcn(bnd1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F20F1ACA" , bndcu(bnd1, edx));
- TEST_INSTRUCTION("F20F1A8C1A80000000" , bndcu(bnd1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F20F1A8C1A80000000" , bndcu(bnd1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("0F1A8C1A80000000" , bndldx(bnd1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30F1B8C1A80000000" , bndmk(bnd1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("660F1ACA" , bndmov(bnd1, bnd2));
- TEST_INSTRUCTION("660F1A8C1A80000000" , bndmov(bnd1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("660F1B9C1180000000" , bndmov(ptr(ecx, edx, 0, 128), bnd3));
- TEST_INSTRUCTION("0F1B9C1180000000" , bndstx(ptr(ecx, edx, 0, 128), bnd3));
TEST_INSTRUCTION("66628C1A80000000" , bound(cx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("66628C1A80000000" , bound(cx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("628C1A80000000" , bound(ecx, ptr(edx, ebx, 0, 128)));
@@ -228,25 +177,11 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0FABD1" , bts(ecx, edx));
TEST_INSTRUCTION("0FAB9C1180000000" , bts(ptr(ecx, edx, 0, 128), ebx));
TEST_INSTRUCTION("0FAB9C1180000000" , bts(dword_ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("C4E260F5CA" , bzhi(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E258F58C1A80000000" , bzhi(ecx, ptr(edx, ebx, 0, 128), esp));
- TEST_INSTRUCTION("C4E258F58C1A80000000" , bzhi(ecx, dword_ptr(edx, ebx, 0, 128), esp));
TEST_INSTRUCTION("6698" , cbw(ax));
TEST_INSTRUCTION("99" , cdq(edx, eax));
- TEST_INSTRUCTION("0F01CA" , clac());
TEST_INSTRUCTION("F8" , clc());
TEST_INSTRUCTION("FC" , cld());
- TEST_INSTRUCTION("0F1C841180000000" , cldemote(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0FAEBC1180000000" , clflush(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("660FAEBC1180000000" , clflushopt(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F01DD" , clgi());
TEST_INSTRUCTION("FA" , cli());
- TEST_INSTRUCTION("F30FAEB41180000000" , clrssbsy(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("F30FAEB41180000000" , clrssbsy(qword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F06" , clts());
- TEST_INSTRUCTION("660FAEB41180000000" , clwb(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F01FC" , clzero(ptr(eax)));
- TEST_INSTRUCTION("0F01FC" , clzero(zmmword_ptr(eax)));
TEST_INSTRUCTION("F5" , cmc());
TEST_INSTRUCTION("660F47CA" , cmova(cx, dx));
TEST_INSTRUCTION("660F478C1A80000000" , cmova(cx, ptr(edx, ebx, 0, 128)));
@@ -477,13 +412,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0FC78C1180000000" , cmpxchg8b(ptr(ecx, edx, 0, 128), edx, eax, ecx, ebx));
TEST_INSTRUCTION("0FC78C1180000000" , cmpxchg8b(qword_ptr(ecx, edx, 0, 128), edx, eax, ecx, ebx));
TEST_INSTRUCTION("0FA2" , cpuid(eax, ebx, ecx, edx));
- TEST_INSTRUCTION("F20F38F0CA" , crc32(ecx, dl));
- TEST_INSTRUCTION("F20F38F0CE" , crc32(ecx, dh));
- TEST_INSTRUCTION("66F20F38F1CA" , crc32(ecx, dx));
- TEST_INSTRUCTION("F20F38F1CA" , crc32(ecx, edx));
- TEST_INSTRUCTION("F20F38F08C1A80000000" , crc32(ecx, byte_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("66F20F38F18C1A80000000" , crc32(ecx, word_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F20F38F18C1A80000000" , crc32(ecx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("6699" , cwd(dx, ax));
TEST_INSTRUCTION("98" , cwde(eax));
TEST_INSTRUCTION("27" , daa(ax));
@@ -505,18 +433,8 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("F7F1" , div(edx, eax, ecx));
TEST_INSTRUCTION("F7B41180000000" , div(edx, eax, ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("F7B41180000000" , div(edx, eax, dword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F77" , emms());
- TEST_INSTRUCTION("F30F1EFB" , endbr32());
- TEST_INSTRUCTION("F30F1EFA" , endbr64());
- TEST_INSTRUCTION("F20F38F88C1A80000000" , enqcmd(zmmword_ptr(ecx), zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30F38F88C1A80000000" , enqcmds(zmmword_ptr(ecx), zmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("C8010002" , enter(1, 2));
- TEST_INSTRUCTION("0FAE8C1180000000" , fxrstor(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0FAE841180000000" , fxsave(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("D9F4" , fxtract());
- TEST_INSTRUCTION("0F37" , getsec());
TEST_INSTRUCTION("F4" , hlt());
- TEST_INSTRUCTION("F30F3AF0C001" , hreset(1, eax));
TEST_INSTRUCTION("F6F9" , idiv(ax, cl));
TEST_INSTRUCTION("F6FD" , idiv(ax, ch));
TEST_INSTRUCTION("F6BC1180000000" , idiv(ax, ptr(ecx, edx, 0, 128)));
@@ -545,9 +463,11 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("6BC901" , imul(ecx, 1));
TEST_INSTRUCTION("0FAF8C1A80000000" , imul(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("0FAF8C1A80000000" , imul(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("666BC901" , imul(cx, cx, 1));
TEST_INSTRUCTION("666BCA01" , imul(cx, dx, 1));
TEST_INSTRUCTION("666B8C1A8000000001" , imul(cx, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("666B8C1A8000000001" , imul(cx, word_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("6BC901" , imul(ecx, ecx, 1));
TEST_INSTRUCTION("6BCA01" , imul(ecx, edx, 1));
TEST_INSTRUCTION("6B8C1A8000000001" , imul(ecx, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("6B8C1A8000000001" , imul(ecx, dword_ptr(edx, ebx, 0, 128), 1));
@@ -564,7 +484,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("FE841180000000" , inc(byte_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("66FF841180000000" , inc(word_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("FF841180000000" , inc(dword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("F30FAEE9" , incsspd(ecx));
TEST_INSTRUCTION("6C" , ins(byte_ptr(edi), dx));
TEST_INSTRUCTION("666D" , ins(word_ptr(edi), dx));
TEST_INSTRUCTION("6D" , ins(dword_ptr(edi), dx));
@@ -572,14 +491,9 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("CC" , int3());
TEST_INSTRUCTION("CE" , into());
TEST_INSTRUCTION("0F08" , invd());
- TEST_INSTRUCTION("660F38808C1A80000000" , invept(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("660F38808C1A80000000" , invept(ecx, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("0F01BC1180000000" , invlpg(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F01DF" , invlpga(eax, ecx));
TEST_INSTRUCTION("660F38828C1A80000000" , invpcid(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("660F38828C1A80000000" , invpcid(ecx, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("660F38818C1A80000000" , invvpid(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("660F38818C1A80000000" , invvpid(ecx, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("66CF" , iret());
TEST_INSTRUCTION("CF" , iretd());
TEST_INSTRUCTION("9F" , lahf(ah));
@@ -593,8 +507,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("FF9C1180000000" , lcall(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("66FF9C1180000000" , lcall(dword_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("FF9C1180000000" , lcall(fword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0FAE941180000000" , ldmxcsr(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0FAE941180000000" , ldmxcsr(dword_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("66C58C1A80000000" , lds(cx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("66C58C1A80000000" , lds(cx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("C58C1A80000000" , lds(ecx, ptr(edx, ebx, 0, 128)));
@@ -606,7 +518,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66C48C1A80000000" , les(cx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("C48C1A80000000" , les(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("C48C1A80000000" , les(ecx, fword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("0FAEE8" , lfence());
TEST_INSTRUCTION("660FB48C1A80000000" , lfs(cx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("660FB48C1A80000000" , lfs(cx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("0FB48C1A80000000" , lfs(ecx, ptr(edx, ebx, 0, 128)));
@@ -624,7 +535,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0F00D1" , lldt(cx));
TEST_INSTRUCTION("0F00941180000000" , lldt(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F00941180000000" , lldt(word_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("8FE97812C1" , llwpcb(ecx));
TEST_INSTRUCTION("0F01F1" , lmsw(cx));
TEST_INSTRUCTION("0F01B41180000000" , lmsw(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F01B41180000000" , lmsw(word_ptr(ecx, edx, 0, 128)));
@@ -647,22 +557,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0F00D9" , ltr(cx));
TEST_INSTRUCTION("0F009C1180000000" , ltr(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F009C1180000000" , ltr(word_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("8FEA7012C201000000" , lwpins(ecx, edx, 1));
- TEST_INSTRUCTION("8FEA7012841A8000000001000000" , lwpins(ecx, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FEA7012841A8000000001000000" , lwpins(ecx, dword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FEA7012CA01000000" , lwpval(ecx, edx, 1));
- TEST_INSTRUCTION("8FEA70128C1A8000000001000000" , lwpval(ecx, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FEA70128C1A8000000001000000" , lwpval(ecx, dword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("66F30FBDCA" , lzcnt(cx, dx));
- TEST_INSTRUCTION("66F30FBD8C1A80000000" , lzcnt(cx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("66F30FBD8C1A80000000" , lzcnt(cx, word_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30FBDCA" , lzcnt(ecx, edx));
- TEST_INSTRUCTION("F30FBD8C1A80000000" , lzcnt(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30FBD8C1A80000000" , lzcnt(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30F01FA" , mcommit());
- TEST_INSTRUCTION("0FAEF0" , mfence());
- TEST_INSTRUCTION("0F01C8" , monitor(ptr(eax), ecx, edx));
- TEST_INSTRUCTION("0F01FA" , monitorx(ptr(eax), ecx, edx));
TEST_INSTRUCTION("88D1" , mov(cl, dl));
TEST_INSTRUCTION("88F1" , mov(cl, dh));
TEST_INSTRUCTION("88D5" , mov(ch, dl));
@@ -704,19 +598,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0F21D1" , mov(ecx, dr2));
TEST_INSTRUCTION("0F22CA" , mov(cr1, edx));
TEST_INSTRUCTION("0F23CA" , mov(dr1, edx));
- TEST_INSTRUCTION("660F38F08C1A80000000" , movbe(cx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("660F38F08C1A80000000" , movbe(cx, word_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("0F38F08C1A80000000" , movbe(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("0F38F08C1A80000000" , movbe(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("660F38F19C1180000000" , movbe(ptr(ecx, edx, 0, 128), bx));
- TEST_INSTRUCTION("660F38F19C1180000000" , movbe(word_ptr(ecx, edx, 0, 128), bx));
- TEST_INSTRUCTION("0F38F19C1180000000" , movbe(ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("0F38F19C1180000000" , movbe(dword_ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("660F38F88C1A80000000" , movdir64b(zmmword_ptr(ecx), zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("0F38F99C1180000000" , movdiri(ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("0F38F99C1180000000" , movdiri(dword_ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("0FC39C1180000000" , movnti(ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("0FC39C1180000000" , movnti(dword_ptr(ecx, edx, 0, 128), ebx));
TEST_INSTRUCTION("A4" , movs(byte_ptr(edi), byte_ptr(esi)));
TEST_INSTRUCTION("66A5" , movs(word_ptr(edi), word_ptr(esi)));
TEST_INSTRUCTION("A5" , movs(dword_ptr(edi), dword_ptr(esi)));
@@ -746,11 +627,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("F7E1" , mul(edx, eax, ecx));
TEST_INSTRUCTION("F7A41180000000" , mul(edx, eax, ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("F7A41180000000" , mul(edx, eax, dword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("C4E26BF6CB" , mulx(ecx, edx, ebx, edx));
- TEST_INSTRUCTION("C4E26BF68C2B80000000" , mulx(ecx, edx, ptr(ebx, ebp, 0, 128), edx));
- TEST_INSTRUCTION("C4E26BF68C2B80000000" , mulx(ecx, edx, dword_ptr(ebx, ebp, 0, 128), edx));
- TEST_INSTRUCTION("0F01C9" , mwait(eax, ecx));
- TEST_INSTRUCTION("0F01FB" , mwaitx(eax, ecx, ebx));
TEST_INSTRUCTION("F6D9" , neg(cl));
TEST_INSTRUCTION("F6DD" , neg(ch));
TEST_INSTRUCTION("66F7D9" , neg(cx));
@@ -815,13 +691,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("666F" , outs(dx, word_ptr(esi)));
TEST_INSTRUCTION("6F" , outs(dx, dword_ptr(esi)));
TEST_INSTRUCTION("F390" , pause());
- TEST_INSTRUCTION("0F01C5" , pconfig());
- TEST_INSTRUCTION("C4E26BF5CB" , pdep(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E26BF58C2B80000000" , pdep(ecx, edx, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26BF58C2B80000000" , pdep(ecx, edx, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26AF5CB" , pext(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E26AF58C2B80000000" , pext(ecx, edx, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26AF58C2B80000000" , pext(ecx, edx, dword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("6659" , pop(cx));
TEST_INSTRUCTION("668F841180000000" , pop(word_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("59" , pop(ecx));
@@ -829,24 +698,8 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0FA1" , pop(fs));
TEST_INSTRUCTION("6661" , popa());
TEST_INSTRUCTION("61" , popad());
- TEST_INSTRUCTION("66F30FB8CA" , popcnt(cx, dx));
- TEST_INSTRUCTION("66F30FB88C1A80000000" , popcnt(cx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("66F30FB88C1A80000000" , popcnt(cx, word_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30FB8CA" , popcnt(ecx, edx));
- TEST_INSTRUCTION("F30FB88C1A80000000" , popcnt(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30FB88C1A80000000" , popcnt(ecx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("669D" , popf());
TEST_INSTRUCTION("9D" , popfd());
- TEST_INSTRUCTION("0F0D841180000000" , prefetch(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F18841180000000" , prefetchnta(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F188C1180000000" , prefetcht0(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F18941180000000" , prefetcht1(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F189C1180000000" , prefetcht2(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F0D8C1180000000" , prefetchw(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F0D941180000000" , prefetchwt1(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("F30FAEE1" , ptwrite(ecx));
- TEST_INSTRUCTION("F30FAEA41180000000" , ptwrite(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("F30FAEA41180000000" , ptwrite(dword_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("6651" , push(cx));
TEST_INSTRUCTION("6A01" , push(1));
TEST_INSTRUCTION("66FFB41180000000" , push(word_ptr(ecx, edx, 0, 128)));
@@ -857,7 +710,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("60" , pushad());
TEST_INSTRUCTION("669C" , pushf());
TEST_INSTRUCTION("9C" , pushfd());
- TEST_INSTRUCTION("F20F01FF" , pvalidate());
TEST_INSTRUCTION("D2D1" , rcl(cl, cl));
TEST_INSTRUCTION("D0D1" , rcl(cl, 1));
TEST_INSTRUCTION("D2D5" , rcl(ch, cl));
@@ -887,17 +739,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("D39C1180000000" , rcr(dword_ptr(ecx, edx, 0, 128), cl));
TEST_INSTRUCTION("D19C1180000000" , rcr(dword_ptr(ecx, edx, 0, 128), 1));
TEST_INSTRUCTION("0F32" , rdmsr(edx, eax, ecx));
- TEST_INSTRUCTION("F30FC7F9" , rdpid(ecx));
- TEST_INSTRUCTION("0F01EE" , rdpkru(edx, eax, ecx));
- TEST_INSTRUCTION("0F33" , rdpmc(edx, eax, ecx));
- TEST_INSTRUCTION("0F01FD" , rdpru(edx, eax, ecx));
- TEST_INSTRUCTION("660FC7F1" , rdrand(cx));
- TEST_INSTRUCTION("0FC7F1" , rdrand(ecx));
- TEST_INSTRUCTION("660FC7F9" , rdseed(cx));
- TEST_INSTRUCTION("0FC7F9" , rdseed(ecx));
- TEST_INSTRUCTION("F30F1EC9" , rdsspd(ecx));
- TEST_INSTRUCTION("0F31" , rdtsc(edx, eax));
- TEST_INSTRUCTION("0F01F9" , rdtscp(edx, eax, ecx));
TEST_INSTRUCTION("C3" , ret());
TEST_INSTRUCTION("C20100" , ret(1));
TEST_INSTRUCTION("CB" , retf());
@@ -930,12 +771,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66D18C1180000000" , ror(word_ptr(ecx, edx, 0, 128), 1));
TEST_INSTRUCTION("D38C1180000000" , ror(dword_ptr(ecx, edx, 0, 128), cl));
TEST_INSTRUCTION("D18C1180000000" , ror(dword_ptr(ecx, edx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37BF0CA01" , rorx(ecx, edx, 1));
- TEST_INSTRUCTION("C4E37BF08C1A8000000001" , rorx(ecx, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37BF08C1A8000000001" , rorx(ecx, dword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("0FAA" , rsm());
- TEST_INSTRUCTION("F30F01AC1180000000" , rstorssp(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("F30F01AC1180000000" , rstorssp(qword_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("9E" , sahf(ah));
TEST_INSTRUCTION("D2E1" , sal(cl, cl));
TEST_INSTRUCTION("D0E1" , sal(cl, 1));
@@ -965,10 +800,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66D1BC1180000000" , sar(word_ptr(ecx, edx, 0, 128), 1));
TEST_INSTRUCTION("D3BC1180000000" , sar(dword_ptr(ecx, edx, 0, 128), cl));
TEST_INSTRUCTION("D1BC1180000000" , sar(dword_ptr(ecx, edx, 0, 128), 1));
- TEST_INSTRUCTION("C4E262F7CA" , sarx(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E25AF78C1A80000000" , sarx(ecx, ptr(edx, ebx, 0, 128), esp));
- TEST_INSTRUCTION("C4E25AF78C1A80000000" , sarx(ecx, dword_ptr(edx, ebx, 0, 128), esp));
- TEST_INSTRUCTION("F30F01EA" , saveprevssp());
TEST_INSTRUCTION("80D901" , sbb(cl, 1));
TEST_INSTRUCTION("80DD01" , sbb(ch, 1));
TEST_INSTRUCTION("809C118000000001" , sbb(byte_ptr(ecx, edx, 0, 128), 1));
@@ -1004,7 +835,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66AF" , scas(ax, word_ptr(edi)));
TEST_INSTRUCTION("AF" , scas(eax, ptr(edi)));
TEST_INSTRUCTION("AF" , scas(eax, dword_ptr(edi)));
- TEST_INSTRUCTION("0F01E8" , serialize());
TEST_INSTRUCTION("0F97C1" , seta(cl));
TEST_INSTRUCTION("0F97C5" , seta(ch));
TEST_INSTRUCTION("0F97841180000000" , seta(ptr(ecx, edx, 0, 128)));
@@ -1121,12 +951,10 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0F98C5" , sets(ch));
TEST_INSTRUCTION("0F98841180000000" , sets(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F98841180000000" , sets(byte_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("F30F01E8" , setssbsy());
TEST_INSTRUCTION("0F94C1" , setz(cl));
TEST_INSTRUCTION("0F94C5" , setz(ch));
TEST_INSTRUCTION("0F94841180000000" , setz(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F94841180000000" , setz(byte_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0FAEF8" , sfence());
TEST_INSTRUCTION("0F01841180000000" , sgdt(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("D2E1" , shl(cl, cl));
TEST_INSTRUCTION("D0E1" , shl(cl, 1));
@@ -1154,9 +982,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0FA49C118000000001" , shld(ptr(ecx, edx, 0, 128), ebx, 1));
TEST_INSTRUCTION("0FA59C1180000000" , shld(dword_ptr(ecx, edx, 0, 128), ebx, cl));
TEST_INSTRUCTION("0FA49C118000000001" , shld(dword_ptr(ecx, edx, 0, 128), ebx, 1));
- TEST_INSTRUCTION("C4E261F7CA" , shlx(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E259F78C1A80000000" , shlx(ecx, ptr(edx, ebx, 0, 128), esp));
- TEST_INSTRUCTION("C4E259F78C1A80000000" , shlx(ecx, dword_ptr(edx, ebx, 0, 128), esp));
TEST_INSTRUCTION("D2E9" , shr(cl, cl));
TEST_INSTRUCTION("D0E9" , shr(cl, 1));
TEST_INSTRUCTION("D2ED" , shr(ch, cl));
@@ -1183,27 +1008,18 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0FAC9C118000000001" , shrd(ptr(ecx, edx, 0, 128), ebx, 1));
TEST_INSTRUCTION("0FAD9C1180000000" , shrd(dword_ptr(ecx, edx, 0, 128), ebx, cl));
TEST_INSTRUCTION("0FAC9C118000000001" , shrd(dword_ptr(ecx, edx, 0, 128), ebx, 1));
- TEST_INSTRUCTION("C4E263F7CA" , shrx(ecx, edx, ebx));
- TEST_INSTRUCTION("C4E25BF78C1A80000000" , shrx(ecx, ptr(edx, ebx, 0, 128), esp));
- TEST_INSTRUCTION("C4E25BF78C1A80000000" , shrx(ecx, dword_ptr(edx, ebx, 0, 128), esp));
TEST_INSTRUCTION("0F018C1180000000" , sidt(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F01DE" , skinit(eax));
TEST_INSTRUCTION("660F00C1" , sldt(cx));
TEST_INSTRUCTION("0F00C1" , sldt(ecx));
TEST_INSTRUCTION("0F00841180000000" , sldt(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F00841180000000" , sldt(word_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("8FE97812C9" , slwpcb(ecx));
TEST_INSTRUCTION("660F01E1" , smsw(cx));
TEST_INSTRUCTION("0F01E1" , smsw(ecx));
TEST_INSTRUCTION("0F01A41180000000" , smsw(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F01A41180000000" , smsw(word_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F01CB" , stac());
TEST_INSTRUCTION("F9" , stc());
TEST_INSTRUCTION("FD" , std());
- TEST_INSTRUCTION("0F01DC" , stgi());
TEST_INSTRUCTION("FB" , sti());
- TEST_INSTRUCTION("0FAE9C1180000000" , stmxcsr(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0FAE9C1180000000" , stmxcsr(dword_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("AA" , stos(ptr(edi), al));
TEST_INSTRUCTION("AA" , stos(byte_ptr(edi), al));
TEST_INSTRUCTION("66AB" , stos(ptr(edi), ax));
@@ -1243,11 +1059,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("662B8C1A80000000" , sub(cx, word_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("2B8C1A80000000" , sub(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("2B8C1A80000000" , sub(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("0F34" , sysenter());
- TEST_INSTRUCTION("0F35" , sysexit());
- TEST_INSTRUCTION("8FE97001FA" , t1mskc(ecx, edx));
- TEST_INSTRUCTION("8FE97001BC1A80000000" , t1mskc(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001BC1A80000000" , t1mskc(ecx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("F6C101" , test(cl, 1));
TEST_INSTRUCTION("F6C501" , test(ch, 1));
TEST_INSTRUCTION("F684118000000001" , test(byte_ptr(ecx, edx, 0, 128), 1));
@@ -1269,16 +1080,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("85D1" , test(ecx, edx));
TEST_INSTRUCTION("859C1180000000" , test(ptr(ecx, edx, 0, 128), ebx));
TEST_INSTRUCTION("859C1180000000" , test(dword_ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("660FAEF1" , tpause(ecx, edx, eax));
- TEST_INSTRUCTION("66F30FBCCA" , tzcnt(cx, dx));
- TEST_INSTRUCTION("66F30FBC8C1A80000000" , tzcnt(cx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("66F30FBC8C1A80000000" , tzcnt(cx, word_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30FBCCA" , tzcnt(ecx, edx));
- TEST_INSTRUCTION("F30FBC8C1A80000000" , tzcnt(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30FBC8C1A80000000" , tzcnt(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001E2" , tzmsk(ecx, edx));
- TEST_INSTRUCTION("8FE97001A41A80000000" , tzmsk(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97001A41A80000000" , tzmsk(ecx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("0FFFCA" , ud0(ecx, edx));
TEST_INSTRUCTION("0FFF8C1A80000000" , ud0(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("0FFF8C1A80000000" , ud0(ecx, dword_ptr(edx, ebx, 0, 128)));
@@ -1286,45 +1087,14 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("0FB98C1A80000000" , ud1(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("0FB98C1A80000000" , ud1(ecx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("0F0B" , ud2());
- TEST_INSTRUCTION("F30FAEF1" , umonitor(ptr(ecx)));
- TEST_INSTRUCTION("F20FAEF1" , umwait(ecx, edx, eax));
TEST_INSTRUCTION("0F00E1" , verr(cx));
TEST_INSTRUCTION("0F00A41180000000" , verr(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F00A41180000000" , verr(word_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F00E9" , verw(cx));
TEST_INSTRUCTION("0F00AC1180000000" , verw(ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F00AC1180000000" , verw(word_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F01C1" , vmcall());
- TEST_INSTRUCTION("660FC7B41180000000" , vmclear(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("660FC7B41180000000" , vmclear(qword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F01D4" , vmfunc());
- TEST_INSTRUCTION("0F01C2" , vmlaunch());
- TEST_INSTRUCTION("0F01DA" , vmload(eax));
- TEST_INSTRUCTION("0F01D9" , vmmcall());
- TEST_INSTRUCTION("0FC7B41180000000" , vmptrld(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0FC7B41180000000" , vmptrld(qword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0FC7BC1180000000" , vmptrst(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0FC7BC1180000000" , vmptrst(qword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("0F78D1" , vmread(ecx, edx));
- TEST_INSTRUCTION("0F789C1180000000" , vmread(ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("0F789C1180000000" , vmread(dword_ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("0F01C3" , vmresume());
- TEST_INSTRUCTION("0F01D8" , vmrun(eax));
- TEST_INSTRUCTION("0F01DB" , vmsave(eax));
- TEST_INSTRUCTION("0F79CA" , vmwrite(ecx, edx));
- TEST_INSTRUCTION("0F798C1A80000000" , vmwrite(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("0F798C1A80000000" , vmwrite(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("F30FC7B41180000000" , vmxon(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("F30FC7B41180000000" , vmxon(qword_ptr(ecx, edx, 0, 128)));
TEST_INSTRUCTION("0F09" , wbinvd());
- TEST_INSTRUCTION("F30F09" , wbnoinvd());
TEST_INSTRUCTION("0F30" , wrmsr(edx, eax, ecx));
- TEST_INSTRUCTION("0F38F6D1" , wrssd(ecx, edx));
- TEST_INSTRUCTION("0F38F69C1180000000" , wrssd(ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("0F38F69C1180000000" , wrssd(dword_ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("660F38F5D1" , wrussd(ecx, edx));
- TEST_INSTRUCTION("660F38F59C1180000000" , wrussd(ptr(ecx, edx, 0, 128), ebx));
- TEST_INSTRUCTION("660F38F59C1180000000" , wrussd(dword_ptr(ecx, edx, 0, 128), ebx));
TEST_INSTRUCTION("C6F801" , xabort(1));
TEST_INSTRUCTION("0FC0D1" , xadd(cl, dl));
TEST_INSTRUCTION("0FC0F1" , xadd(cl, dh));
@@ -1362,8 +1132,6 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66878C1A80000000" , xchg(cx, word_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("878C1A80000000" , xchg(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("878C1A80000000" , xchg(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("0F01D5" , xend());
- TEST_INSTRUCTION("0F01D0" , xgetbv(edx, eax, ecx));
TEST_INSTRUCTION("D7" , xlatb());
TEST_INSTRUCTION("80F101" , xor_(cl, 1));
TEST_INSTRUCTION("80F501" , xor_(ch, 1));
@@ -1394,6 +1162,286 @@ static void ASMJIT_NOINLINE testX86AssemblerBase(AssemblerTester<x86::Assembler>
TEST_INSTRUCTION("66338C1A80000000" , xor_(cx, word_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("338C1A80000000" , xor_(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("338C1A80000000" , xor_(ecx, dword_ptr(edx, ebx, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerBaseExt(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("0F38FC9C1180000000" , aadd(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F38FC9C1180000000" , aadd(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("660F38FC9C1180000000" , aand(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("660F38FC9C1180000000" , aand(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("660F38F6CA" , adcx(ecx, edx));
+ TEST_INSTRUCTION("660F38F68C1A80000000" , adcx(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("660F38F68C1A80000000" , adcx(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E268F2CB" , andn(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E268F28C2B80000000" , andn(ecx, edx, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E268F28C2B80000000" , andn(ecx, edx, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("F20F38FC9C1180000000" , aor(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("F20F38FC9C1180000000" , aor(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("F30F38FC9C1180000000" , axor(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("F30F38FC9C1180000000" , axor(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("C4E260F7CA" , bextr(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E258F78C1A80000000" , bextr(ecx, ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E258F78C1A80000000" , bextr(ecx, dword_ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("8FE97001CA" , blcfill(ecx, edx));
+ TEST_INSTRUCTION("8FE970018C1A80000000" , blcfill(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE970018C1A80000000" , blcfill(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97002F2" , blci(ecx, edx));
+ TEST_INSTRUCTION("8FE97002B41A80000000" , blci(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97002B41A80000000" , blci(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001EA" , blcic(ecx, edx));
+ TEST_INSTRUCTION("8FE97001AC1A80000000" , blcic(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001AC1A80000000" , blcic(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97002CA" , blcmsk(ecx, edx));
+ TEST_INSTRUCTION("8FE970028C1A80000000" , blcmsk(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE970028C1A80000000" , blcmsk(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001DA" , blcs(ecx, edx));
+ TEST_INSTRUCTION("8FE970019C1A80000000" , blcs(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE970019C1A80000000" , blcs(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001D2" , blsfill(ecx, edx));
+ TEST_INSTRUCTION("8FE97001941A80000000" , blsfill(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001941A80000000" , blsfill(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F3DA" , blsi(ecx, edx));
+ TEST_INSTRUCTION("C4E270F39C1A80000000" , blsi(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F39C1A80000000" , blsi(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001F2" , blsic(ecx, edx));
+ TEST_INSTRUCTION("8FE97001B41A80000000" , blsic(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001B41A80000000" , blsic(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F3D2" , blsmsk(ecx, edx));
+ TEST_INSTRUCTION("C4E270F3941A80000000" , blsmsk(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F3941A80000000" , blsmsk(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F3CA" , blsr(ecx, edx));
+ TEST_INSTRUCTION("C4E270F38C1A80000000" , blsr(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E270F38C1A80000000" , blsr(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30F1ACA" , bndcl(bnd1, edx));
+ TEST_INSTRUCTION("F30F1A8C1A80000000" , bndcl(bnd1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30F1A8C1A80000000" , bndcl(bnd1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F20F1BCA" , bndcn(bnd1, edx));
+ TEST_INSTRUCTION("F20F1B8C1A80000000" , bndcn(bnd1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F20F1B8C1A80000000" , bndcn(bnd1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F20F1ACA" , bndcu(bnd1, edx));
+ TEST_INSTRUCTION("F20F1A8C1A80000000" , bndcu(bnd1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F20F1A8C1A80000000" , bndcu(bnd1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0F1A8C1A80000000" , bndldx(bnd1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30F1B8C1A80000000" , bndmk(bnd1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("660F1ACA" , bndmov(bnd1, bnd2));
+ TEST_INSTRUCTION("660F1A8C1A80000000" , bndmov(bnd1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("660F1B9C1180000000" , bndmov(ptr(ecx, edx, 0, 128), bnd3));
+ TEST_INSTRUCTION("0F1B9C1180000000" , bndstx(ptr(ecx, edx, 0, 128), bnd3));
+ TEST_INSTRUCTION("C4E260F5CA" , bzhi(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E258F58C1A80000000" , bzhi(ecx, ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E258F58C1A80000000" , bzhi(ecx, dword_ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("0F01CA" , clac());
+ TEST_INSTRUCTION("0F1C841180000000" , cldemote(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0FAEBC1180000000" , clflush(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("660FAEBC1180000000" , clflushopt(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F01DD" , clgi());
+ TEST_INSTRUCTION("F30FAEB41180000000" , clrssbsy(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("F30FAEB41180000000" , clrssbsy(qword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F06" , clts());
+ TEST_INSTRUCTION("660FAEB41180000000" , clwb(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F01FC" , clzero(ptr(eax)));
+ TEST_INSTRUCTION("0F01FC" , clzero(zmmword_ptr(eax)));
+ TEST_INSTRUCTION("C4E259E69C1180000000" , cmpbexadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E69C1180000000" , cmpbexadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E29C1180000000" , cmpbxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E29C1180000000" , cmpbxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EE9C1180000000" , cmplexadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EE9C1180000000" , cmplexadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EC9C1180000000" , cmplxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EC9C1180000000" , cmplxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E79C1180000000" , cmpnbexadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E79C1180000000" , cmpnbexadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E39C1180000000" , cmpnbxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E39C1180000000" , cmpnbxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EF9C1180000000" , cmpnlexadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EF9C1180000000" , cmpnlexadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259ED9C1180000000" , cmpnlxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259ED9C1180000000" , cmpnlxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E19C1180000000" , cmpnoxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E19C1180000000" , cmpnoxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EB9C1180000000" , cmpnpxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EB9C1180000000" , cmpnpxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E99C1180000000" , cmpnsxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E99C1180000000" , cmpnsxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E59C1180000000" , cmpnzxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E59C1180000000" , cmpnzxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E09C1180000000" , cmpoxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E09C1180000000" , cmpoxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EA9C1180000000" , cmppxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259EA9C1180000000" , cmppxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E89C1180000000" , cmpsxadd(ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("C4E259E89C1180000000" , cmpsxadd(dword_ptr(ecx, edx, 0, 128), ebx, esp));
+ TEST_INSTRUCTION("F20F38F0CA" , crc32(ecx, dl));
+ TEST_INSTRUCTION("F20F38F0CE" , crc32(ecx, dh));
+ TEST_INSTRUCTION("66F20F38F1CA" , crc32(ecx, dx));
+ TEST_INSTRUCTION("F20F38F1CA" , crc32(ecx, edx));
+ TEST_INSTRUCTION("F20F38F08C1A80000000" , crc32(ecx, byte_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("66F20F38F18C1A80000000" , crc32(ecx, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F20F38F18C1A80000000" , crc32(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0F77" , emms());
+ TEST_INSTRUCTION("F30F1EFB" , endbr32());
+ TEST_INSTRUCTION("F30F1EFA" , endbr64());
+ TEST_INSTRUCTION("F20F38F88C1A80000000" , enqcmd(zmmword_ptr(ecx), zmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30F38F88C1A80000000" , enqcmds(zmmword_ptr(ecx), zmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0FAE8C1180000000" , fxrstor(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0FAE841180000000" , fxsave(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("D9F4" , fxtract());
+ TEST_INSTRUCTION("0F37" , getsec());
+ TEST_INSTRUCTION("F30F3AF0C001" , hreset(1, eax));
+ TEST_INSTRUCTION("0FAE941180000000" , ldmxcsr(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0FAE941180000000" , ldmxcsr(dword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("F30FAEE9" , incsspd(ecx));
+ TEST_INSTRUCTION("660F38808C1A80000000" , invept(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("660F38808C1A80000000" , invept(ecx, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0F01DF" , invlpga(eax, ecx));
+ TEST_INSTRUCTION("660F38818C1A80000000" , invvpid(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("660F38818C1A80000000" , invvpid(ecx, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0FAEE8" , lfence());
+ TEST_INSTRUCTION("8FE97812C1" , llwpcb(ecx));
+ TEST_INSTRUCTION("8FEA7012C201000000" , lwpins(ecx, edx, 1));
+ TEST_INSTRUCTION("8FEA7012841A8000000001000000" , lwpins(ecx, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEA7012841A8000000001000000" , lwpins(ecx, dword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEA7012CA01000000" , lwpval(ecx, edx, 1));
+ TEST_INSTRUCTION("8FEA70128C1A8000000001000000" , lwpval(ecx, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FEA70128C1A8000000001000000" , lwpval(ecx, dword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("66F30FBDCA" , lzcnt(cx, dx));
+ TEST_INSTRUCTION("66F30FBD8C1A80000000" , lzcnt(cx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("66F30FBD8C1A80000000" , lzcnt(cx, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30FBDCA" , lzcnt(ecx, edx));
+ TEST_INSTRUCTION("F30FBD8C1A80000000" , lzcnt(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30FBD8C1A80000000" , lzcnt(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30F01FA" , mcommit());
+ TEST_INSTRUCTION("0FAEF0" , mfence());
+ TEST_INSTRUCTION("0F01C8" , monitor(ptr(eax), ecx, edx));
+ TEST_INSTRUCTION("0F01FA" , monitorx(ptr(eax), ecx, edx));
+ TEST_INSTRUCTION("660F38F08C1A80000000" , movbe(cx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("660F38F08C1A80000000" , movbe(cx, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0F38F08C1A80000000" , movbe(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0F38F08C1A80000000" , movbe(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("660F38F19C1180000000" , movbe(ptr(ecx, edx, 0, 128), bx));
+ TEST_INSTRUCTION("660F38F19C1180000000" , movbe(word_ptr(ecx, edx, 0, 128), bx));
+ TEST_INSTRUCTION("0F38F19C1180000000" , movbe(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F38F19C1180000000" , movbe(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("660F38F88C1A80000000" , movdir64b(zmmword_ptr(ecx), zmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0F38F99C1180000000" , movdiri(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F38F99C1180000000" , movdiri(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("0FC39C1180000000" , movnti(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("0FC39C1180000000" , movnti(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("C4E26BF6CB" , mulx(ecx, edx, ebx, edx));
+ TEST_INSTRUCTION("C4E26BF68C2B80000000" , mulx(ecx, edx, ptr(ebx, ebp, 0, 128), edx));
+ TEST_INSTRUCTION("C4E26BF68C2B80000000" , mulx(ecx, edx, dword_ptr(ebx, ebp, 0, 128), edx));
+ TEST_INSTRUCTION("0F01C9" , mwait(eax, ecx));
+ TEST_INSTRUCTION("0F01FB" , mwaitx(eax, ecx, ebx));
+ TEST_INSTRUCTION("0F01C5" , pconfig());
+ TEST_INSTRUCTION("C4E26BF5CB" , pdep(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E26BF58C2B80000000" , pdep(ecx, edx, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26BF58C2B80000000" , pdep(ecx, edx, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AF5CB" , pext(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E26AF58C2B80000000" , pext(ecx, edx, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AF58C2B80000000" , pext(ecx, edx, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("66F30FB8CA" , popcnt(cx, dx));
+ TEST_INSTRUCTION("66F30FB88C1A80000000" , popcnt(cx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("66F30FB88C1A80000000" , popcnt(cx, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30FB8CA" , popcnt(ecx, edx));
+ TEST_INSTRUCTION("F30FB88C1A80000000" , popcnt(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30FB88C1A80000000" , popcnt(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0F0D841180000000" , prefetch(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F18841180000000" , prefetchnta(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F188C1180000000" , prefetcht0(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F18941180000000" , prefetcht1(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F189C1180000000" , prefetcht2(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F0D8C1180000000" , prefetchw(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F0D941180000000" , prefetchwt1(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("F30FAEE1" , ptwrite(ecx));
+ TEST_INSTRUCTION("F30FAEA41180000000" , ptwrite(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("F30FAEA41180000000" , ptwrite(dword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("F20F01FF" , pvalidate());
+ TEST_INSTRUCTION("F30FC7F9" , rdpid(ecx));
+ TEST_INSTRUCTION("0F01EE" , rdpkru(edx, eax, ecx));
+ TEST_INSTRUCTION("0F33" , rdpmc(edx, eax, ecx));
+ TEST_INSTRUCTION("0F01FD" , rdpru(edx, eax, ecx));
+ TEST_INSTRUCTION("660FC7F1" , rdrand(cx));
+ TEST_INSTRUCTION("0FC7F1" , rdrand(ecx));
+ TEST_INSTRUCTION("660FC7F9" , rdseed(cx));
+ TEST_INSTRUCTION("0FC7F9" , rdseed(ecx));
+ TEST_INSTRUCTION("F30F1EC9" , rdsspd(ecx));
+ TEST_INSTRUCTION("0F31" , rdtsc(edx, eax));
+ TEST_INSTRUCTION("0F01F9" , rdtscp(edx, eax, ecx));
+ TEST_INSTRUCTION("C4E37BF0CA01" , rorx(ecx, edx, 1));
+ TEST_INSTRUCTION("C4E37BF08C1A8000000001" , rorx(ecx, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37BF08C1A8000000001" , rorx(ecx, dword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("0FAA" , rsm());
+ TEST_INSTRUCTION("F30F01AC1180000000" , rstorssp(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("F30F01AC1180000000" , rstorssp(qword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("C4E262F7CA" , sarx(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E25AF78C1A80000000" , sarx(ecx, ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E25AF78C1A80000000" , sarx(ecx, dword_ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("F30F01EA" , saveprevssp());
+ TEST_INSTRUCTION("0F01E8" , serialize());
+ TEST_INSTRUCTION("F30F01E8" , setssbsy());
+ TEST_INSTRUCTION("0FAEF8" , sfence());
+ TEST_INSTRUCTION("C4E261F7CA" , shlx(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E259F78C1A80000000" , shlx(ecx, ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E259F78C1A80000000" , shlx(ecx, dword_ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E263F7CA" , shrx(ecx, edx, ebx));
+ TEST_INSTRUCTION("C4E25BF78C1A80000000" , shrx(ecx, ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("C4E25BF78C1A80000000" , shrx(ecx, dword_ptr(edx, ebx, 0, 128), esp));
+ TEST_INSTRUCTION("8FE97812C9" , slwpcb(ecx));
+ TEST_INSTRUCTION("0F01DE" , skinit(eax));
+ TEST_INSTRUCTION("0F01CB" , stac());
+ TEST_INSTRUCTION("0F01DC" , stgi());
+ TEST_INSTRUCTION("0FAE9C1180000000" , stmxcsr(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0FAE9C1180000000" , stmxcsr(dword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F34" , sysenter());
+ TEST_INSTRUCTION("0F35" , sysexit());
+ TEST_INSTRUCTION("8FE97001FA" , t1mskc(ecx, edx));
+ TEST_INSTRUCTION("8FE97001BC1A80000000" , t1mskc(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001BC1A80000000" , t1mskc(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("660FAEF1" , tpause(ecx, edx, eax));
+ TEST_INSTRUCTION("66F30FBCCA" , tzcnt(cx, dx));
+ TEST_INSTRUCTION("66F30FBC8C1A80000000" , tzcnt(cx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("66F30FBC8C1A80000000" , tzcnt(cx, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30FBCCA" , tzcnt(ecx, edx));
+ TEST_INSTRUCTION("F30FBC8C1A80000000" , tzcnt(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30FBC8C1A80000000" , tzcnt(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001E2" , tzmsk(ecx, edx));
+ TEST_INSTRUCTION("8FE97001A41A80000000" , tzmsk(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97001A41A80000000" , tzmsk(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30FAEF1" , umonitor(ptr(ecx)));
+ TEST_INSTRUCTION("F20FAEF1" , umwait(ecx, edx, eax));
+ TEST_INSTRUCTION("0F01C1" , vmcall());
+ TEST_INSTRUCTION("660FC7B41180000000" , vmclear(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("660FC7B41180000000" , vmclear(qword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F01D4" , vmfunc());
+ TEST_INSTRUCTION("0F01C2" , vmlaunch());
+ TEST_INSTRUCTION("0F01DA" , vmload(eax));
+ TEST_INSTRUCTION("0F01D9" , vmmcall());
+ TEST_INSTRUCTION("0FC7B41180000000" , vmptrld(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0FC7B41180000000" , vmptrld(qword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0FC7BC1180000000" , vmptrst(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0FC7BC1180000000" , vmptrst(qword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("0F78D1" , vmread(ecx, edx));
+ TEST_INSTRUCTION("0F789C1180000000" , vmread(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F789C1180000000" , vmread(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F01C3" , vmresume());
+ TEST_INSTRUCTION("0F01D8" , vmrun(eax));
+ TEST_INSTRUCTION("0F01DB" , vmsave(eax));
+ TEST_INSTRUCTION("0F79CA" , vmwrite(ecx, edx));
+ TEST_INSTRUCTION("0F798C1A80000000" , vmwrite(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("0F798C1A80000000" , vmwrite(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("F30FC7B41180000000" , vmxon(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("F30FC7B41180000000" , vmxon(qword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("F30F09" , wbnoinvd());
+ TEST_INSTRUCTION("0F38F6D1" , wrssd(ecx, edx));
+ TEST_INSTRUCTION("0F38F69C1180000000" , wrssd(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F38F69C1180000000" , wrssd(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("660F38F5D1" , wrussd(ecx, edx));
+ TEST_INSTRUCTION("660F38F59C1180000000" , wrussd(ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("660F38F59C1180000000" , wrussd(dword_ptr(ecx, edx, 0, 128), ebx));
+ TEST_INSTRUCTION("0F01D5" , xend());
+ TEST_INSTRUCTION("0F01D0" , xgetbv(edx, eax, ecx));
TEST_INSTRUCTION("F20F01E9" , xresldtrk());
TEST_INSTRUCTION("0FAEAC1180000000" , xrstor(ptr(ecx, edx, 0, 128), edx, eax));
TEST_INSTRUCTION("0FC79C1180000000" , xrstors(ptr(ecx, edx, 0, 128), edx, eax));
@@ -2533,6 +2581,2375 @@ static void ASMJIT_NOINLINE testX86AssemblerMMX_SSE(AssemblerTester<x86::Assembl
static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>& tester) noexcept {
using namespace x86;
+ TEST_INSTRUCTION("C5E958CB" , vaddpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9588C2B80000000" , vaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9588C2B80000000" , vaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED58CB" , vaddpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED588C2B80000000" , vaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED588C2B80000000" , vaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E858CB" , vaddps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8588C2B80000000" , vaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8588C2B80000000" , vaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC58CB" , vaddps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC588C2B80000000" , vaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC588C2B80000000" , vaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB58CB" , vaddsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB588C2B80000000" , vaddsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB588C2B80000000" , vaddsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA58CB" , vaddss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA588C2B80000000" , vaddss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA588C2B80000000" , vaddss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D0CB" , vaddsubpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9D08C2B80000000" , vaddsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D08C2B80000000" , vaddsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD0CB" , vaddsubpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDD08C2B80000000" , vaddsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD08C2B80000000" , vaddsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EBD0CB" , vaddsubps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EBD08C2B80000000" , vaddsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EBD08C2B80000000" , vaddsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EFD0CB" , vaddsubps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EFD08C2B80000000" , vaddsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EFD08C2B80000000" , vaddsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DECB" , vaesdec(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269DE8C2B80000000" , vaesdec(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DE8C2B80000000" , vaesdec(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DDECB" , vaesdec(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DDE8C2B80000000" , vaesdec(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DDE8C2B80000000" , vaesdec(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DFCB" , vaesdeclast(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269DF8C2B80000000" , vaesdeclast(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DF8C2B80000000" , vaesdeclast(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DDFCB" , vaesdeclast(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DDF8C2B80000000" , vaesdeclast(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DDF8C2B80000000" , vaesdeclast(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DCCB" , vaesenc(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269DC8C2B80000000" , vaesenc(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DC8C2B80000000" , vaesenc(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DDCCB" , vaesenc(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DDC8C2B80000000" , vaesenc(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DDC8C2B80000000" , vaesenc(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DDCB" , vaesenclast(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269DD8C2B80000000" , vaesenclast(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DD8C2B80000000" , vaesenclast(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DDDCB" , vaesenclast(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DDD8C2B80000000" , vaesenclast(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DDD8C2B80000000" , vaesenclast(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E279DBCA" , vaesimc(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279DB8C1A80000000" , vaesimc(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279DB8C1A80000000" , vaesimc(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E379DFCA01" , vaeskeygenassist(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E379DF8C1A8000000001" , vaeskeygenassist(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E379DF8C1A8000000001" , vaeskeygenassist(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5E955CB" , vandnpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9558C2B80000000" , vandnpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9558C2B80000000" , vandnpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED55CB" , vandnpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED558C2B80000000" , vandnpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED558C2B80000000" , vandnpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E855CB" , vandnps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8558C2B80000000" , vandnps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8558C2B80000000" , vandnps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC55CB" , vandnps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC558C2B80000000" , vandnps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC558C2B80000000" , vandnps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E954CB" , vandpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9548C2B80000000" , vandpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9548C2B80000000" , vandpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED54CB" , vandpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED548C2B80000000" , vandpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED548C2B80000000" , vandpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E854CB" , vandps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8548C2B80000000" , vandps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8548C2B80000000" , vandps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC54CB" , vandps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC548C2B80000000" , vandps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC548C2B80000000" , vandps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E3690DCB01" , vblendpd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690D8C2B8000000001" , vblendpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690D8C2B8000000001" , vblendpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0DCB01" , vblendpd(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D0D8C2B8000000001" , vblendpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0D8C2B8000000001" , vblendpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690CCB01" , vblendps(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690C8C2B8000000001" , vblendps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690C8C2B8000000001" , vblendps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0CCB01" , vblendps(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D0C8C2B8000000001" , vblendps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0C8C2B8000000001" , vblendps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3694BCB40" , vblendvpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3694B8C2B8000000060" , vblendvpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3694B8C2B8000000060" , vblendvpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E36D4BCB40" , vblendvpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E36D4B8C2B8000000060" , vblendvpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D4B8C2B8000000060" , vblendvpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3694ACB40" , vblendvps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3694A8C2B8000000060" , vblendvps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3694A8C2B8000000060" , vblendvps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E36D4ACB40" , vblendvps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E36D4A8C2B8000000060" , vblendvps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D4A8C2B8000000060" , vblendvps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E27D1A8C1A80000000" , vbroadcastf128(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1A8C1A80000000" , vbroadcastf128(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D5A8C1A80000000" , vbroadcasti128(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D5A8C1A80000000" , vbroadcasti128(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D19CA" , vbroadcastsd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D198C1A80000000" , vbroadcastsd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D198C1A80000000" , vbroadcastsd(ymm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27918CA" , vbroadcastss(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279188C1A80000000" , vbroadcastss(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279188C1A80000000" , vbroadcastss(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D18CA" , vbroadcastss(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D188C1A80000000" , vbroadcastss(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D188C1A80000000" , vbroadcastss(ymm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5E9C2CB01" , vcmppd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5E9C28C2B8000000001" , vcmppd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9C28C2B8000000001" , vcmppd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EDC2CB01" , vcmppd(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C5EDC28C2B8000000001" , vcmppd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EDC28C2B8000000001" , vcmppd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E8C2CB01" , vcmpps(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5E8C28C2B8000000001" , vcmpps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E8C28C2B8000000001" , vcmpps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5ECC2CB01" , vcmpps(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C5ECC28C2B8000000001" , vcmpps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5ECC28C2B8000000001" , vcmpps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EBC2CB01" , vcmpsd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5EBC28C2B8000000001" , vcmpsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EBC28C2B8000000001" , vcmpsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EAC2CB01" , vcmpss(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5EAC28C2B8000000001" , vcmpss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EAC28C2B8000000001" , vcmpss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5F92FCA" , vcomisd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F92F8C1A80000000" , vcomisd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F92F8C1A80000000" , vcomisd(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F82FCA" , vcomiss(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F82F8C1A80000000" , vcomiss(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F82F8C1A80000000" , vcomiss(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FAE6CA" , vcvtdq2pd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FAE68C1A80000000" , vcvtdq2pd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FAE68C1A80000000" , vcvtdq2pd(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FEE6CA" , vcvtdq2pd(ymm1, xmm2));
+ TEST_INSTRUCTION("C5FEE68C1A80000000" , vcvtdq2pd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FEE68C1A80000000" , vcvtdq2pd(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F85BCA" , vcvtdq2ps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F85B8C1A80000000" , vcvtdq2ps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F85B8C1A80000000" , vcvtdq2ps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC5BCA" , vcvtdq2ps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC5B8C1A80000000" , vcvtdq2ps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC5B8C1A80000000" , vcvtdq2ps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FBE6CA" , vcvtpd2dq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FFE6CA" , vcvtpd2dq(xmm1, ymm2));
+ TEST_INSTRUCTION("C5FBE68C1A80000000" , vcvtpd2dq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FFE68C1A80000000" , vcvtpd2dq(xmm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F95ACA" , vcvtpd2ps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FD5ACA" , vcvtpd2ps(xmm1, ymm2));
+ TEST_INSTRUCTION("C5F95A8C1A80000000" , vcvtpd2ps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD5A8C1A80000000" , vcvtpd2ps(xmm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27913CA" , vcvtph2ps(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279138C1A80000000" , vcvtph2ps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279138C1A80000000" , vcvtph2ps(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D13CA" , vcvtph2ps(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D138C1A80000000" , vcvtph2ps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D138C1A80000000" , vcvtph2ps(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F95BCA" , vcvtps2dq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F95B8C1A80000000" , vcvtps2dq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F95B8C1A80000000" , vcvtps2dq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD5BCA" , vcvtps2dq(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD5B8C1A80000000" , vcvtps2dq(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD5B8C1A80000000" , vcvtps2dq(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F85ACA" , vcvtps2pd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F85A8C1A80000000" , vcvtps2pd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F85A8C1A80000000" , vcvtps2pd(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC5ACA" , vcvtps2pd(ymm1, xmm2));
+ TEST_INSTRUCTION("C5FC5A8C1A80000000" , vcvtps2pd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC5A8C1A80000000" , vcvtps2pd(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E3791DD101" , vcvtps2ph(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E3791D9C118000000001" , vcvtps2ph(ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E3791D9C118000000001" , vcvtps2ph(qword_ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E37D1DD101" , vcvtps2ph(xmm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D1D9C118000000001" , vcvtps2ph(ptr(ecx, edx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37D1D9C118000000001" , vcvtps2ph(xmmword_ptr(ecx, edx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C5FB2DCA" , vcvtsd2si(ecx, xmm2));
+ TEST_INSTRUCTION("C5FB2D8C1A80000000" , vcvtsd2si(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FB2D8C1A80000000" , vcvtsd2si(ecx, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5EB5ACB" , vcvtsd2ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5A8C2B80000000" , vcvtsd2ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5A8C2B80000000" , vcvtsd2ss(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB2ACB" , vcvtsi2sd(xmm1, xmm2, ebx));
+ TEST_INSTRUCTION("C5EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA2ACB" , vcvtsi2ss(xmm1, xmm2, ebx));
+ TEST_INSTRUCTION("C5EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5ACB" , vcvtss2sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5A8C2B80000000" , vcvtss2sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5A8C2B80000000" , vcvtss2sd(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5FA2DCA" , vcvtss2si(ecx, xmm2));
+ TEST_INSTRUCTION("C5FA2D8C1A80000000" , vcvtss2si(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA2D8C1A80000000" , vcvtss2si(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F9E6CA" , vcvttpd2dq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FDE6CA" , vcvttpd2dq(xmm1, ymm2));
+ TEST_INSTRUCTION("C5F9E68C1A80000000" , vcvttpd2dq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FDE68C1A80000000" , vcvttpd2dq(xmm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA5BCA" , vcvttps2dq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA5B8C1A80000000" , vcvttps2dq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA5B8C1A80000000" , vcvttps2dq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FE5BCA" , vcvttps2dq(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FE5B8C1A80000000" , vcvttps2dq(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FE5B8C1A80000000" , vcvttps2dq(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FB2CCA" , vcvttsd2si(ecx, xmm2));
+ TEST_INSTRUCTION("C5FB2C8C1A80000000" , vcvttsd2si(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FB2C8C1A80000000" , vcvttsd2si(ecx, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA2CCA" , vcvttss2si(ecx, xmm2));
+ TEST_INSTRUCTION("C5FA2C8C1A80000000" , vcvttss2si(ecx, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA2C8C1A80000000" , vcvttss2si(ecx, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5E95ECB" , vdivpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E95E8C2B80000000" , vdivpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E95E8C2B80000000" , vdivpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5ECB" , vdivpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED5E8C2B80000000" , vdivpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5E8C2B80000000" , vdivpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E85ECB" , vdivps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E85E8C2B80000000" , vdivps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E85E8C2B80000000" , vdivps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5ECB" , vdivps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC5E8C2B80000000" , vdivps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5E8C2B80000000" , vdivps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5ECB" , vdivsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5E8C2B80000000" , vdivsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5E8C2B80000000" , vdivsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5ECB" , vdivss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5E8C2B80000000" , vdivss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5E8C2B80000000" , vdivss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E36941CB01" , vdppd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369418C2B8000000001" , vdppd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369418C2B8000000001" , vdppd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36940CB01" , vdpps(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369408C2B8000000001" , vdpps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369408C2B8000000001" , vdpps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D40CB01" , vdpps(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D408C2B8000000001" , vdpps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D408C2B8000000001" , vdpps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D19D101" , vextractf128(xmm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D199C118000000001" , vextractf128(ptr(ecx, edx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37D199C118000000001" , vextractf128(xmmword_ptr(ecx, edx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37D39D101" , vextracti128(xmm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D399C118000000001" , vextracti128(ptr(ecx, edx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37D399C118000000001" , vextracti128(xmmword_ptr(ecx, edx, 0, 128), ymm3, 1));
+ TEST_INSTRUCTION("C4E37917D101" , vextractps(ecx, xmm2, 1));
+ TEST_INSTRUCTION("C4E379179C118000000001" , vextractps(ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E379179C118000000001" , vextractps(dword_ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E2D9928C1A80000000" , vgatherdpd(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2DD928C1A80000000" , vgatherdpd(ymm1, ptr(edx, xmm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E259928C1A80000000" , vgatherdps(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E25D928C1A80000000" , vgatherdps(ymm1, ptr(edx, ymm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E2D9938C1A80000000" , vgatherqpd(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2DD938C1A80000000" , vgatherqpd(ymm1, ptr(edx, ymm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E259938C1A80000000" , vgatherqps(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E25D938C1A80000000" , vgatherqps(xmm1, ptr(edx, ymm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E3E9CFCB01" , vgf2p8affineinvqb(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3E9CF8C2B8000000001" , vgf2p8affineinvqb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9CF8C2B8000000001" , vgf2p8affineinvqb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3EDCFCB01" , vgf2p8affineinvqb(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E3EDCF8C2B8000000001" , vgf2p8affineinvqb(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3EDCF8C2B8000000001" , vgf2p8affineinvqb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9CECB01" , vgf2p8affineqb(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3E9CE8C2B8000000001" , vgf2p8affineqb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9CE8C2B8000000001" , vgf2p8affineqb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3EDCECB01" , vgf2p8affineqb(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E3EDCE8C2B8000000001" , vgf2p8affineqb(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3EDCE8C2B8000000001" , vgf2p8affineqb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E269CFCB" , vgf2p8mulb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269CF8C2B80000000" , vgf2p8mulb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269CF8C2B80000000" , vgf2p8mulb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DCFCB" , vgf2p8mulb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DCF8C2B80000000" , vgf2p8mulb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DCF8C2B80000000" , vgf2p8mulb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E97CCB" , vhaddpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E97C8C2B80000000" , vhaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E97C8C2B80000000" , vhaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED7CCB" , vhaddpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED7C8C2B80000000" , vhaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED7C8C2B80000000" , vhaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB7CCB" , vhaddps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB7C8C2B80000000" , vhaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB7C8C2B80000000" , vhaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EF7CCB" , vhaddps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EF7C8C2B80000000" , vhaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EF7C8C2B80000000" , vhaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E97DCB" , vhsubpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E97D8C2B80000000" , vhsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E97D8C2B80000000" , vhsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED7DCB" , vhsubpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED7D8C2B80000000" , vhsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED7D8C2B80000000" , vhsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB7DCB" , vhsubps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB7D8C2B80000000" , vhsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB7D8C2B80000000" , vhsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EF7DCB" , vhsubps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EF7D8C2B80000000" , vhsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EF7D8C2B80000000" , vhsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E36D18CB01" , vinsertf128(ymm1, ymm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E36D188C2B8000000001" , vinsertf128(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D188C2B8000000001" , vinsertf128(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D38CB01" , vinserti128(ymm1, ymm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E36D388C2B8000000001" , vinserti128(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D388C2B8000000001" , vinserti128(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36921CB01" , vinsertps(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369218C2B8000000001" , vinsertps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369218C2B8000000001" , vinsertps(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5FBF08C1A80000000" , vlddqu(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FBF08C1A80000000" , vlddqu(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FFF08C1A80000000" , vlddqu(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FFF08C1A80000000" , vlddqu(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F8AE941180000000" , vldmxcsr(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("C5F8AE941180000000" , vldmxcsr(dword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("C5F9F7CA" , vmaskmovdqu(xmm1, xmm2, ptr(edi)));
+ TEST_INSTRUCTION("C5F9F7CA" , vmaskmovdqu(xmm1, xmm2, xmmword_ptr(edi)));
+ TEST_INSTRUCTION("C4E2612FA41180000000" , vmaskmovpd(ptr(ecx, edx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2612FA41180000000" , vmaskmovpd(xmmword_ptr(ecx, edx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2652FA41180000000" , vmaskmovpd(ptr(ecx, edx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2652FA41180000000" , vmaskmovpd(ymmword_ptr(ecx, edx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2692D8C2B80000000" , vmaskmovpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2692D8C2B80000000" , vmaskmovpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2D8C2B80000000" , vmaskmovpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2D8C2B80000000" , vmaskmovpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2612EA41180000000" , vmaskmovps(ptr(ecx, edx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2612EA41180000000" , vmaskmovps(xmmword_ptr(ecx, edx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2652EA41180000000" , vmaskmovps(ptr(ecx, edx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2652EA41180000000" , vmaskmovps(ymmword_ptr(ecx, edx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2692C8C2B80000000" , vmaskmovps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2692C8C2B80000000" , vmaskmovps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2C8C2B80000000" , vmaskmovps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2C8C2B80000000" , vmaskmovps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E95FCB" , vmaxpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E95F8C2B80000000" , vmaxpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E95F8C2B80000000" , vmaxpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5FCB" , vmaxpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED5F8C2B80000000" , vmaxpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5F8C2B80000000" , vmaxpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E85FCB" , vmaxps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E85F8C2B80000000" , vmaxps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E85F8C2B80000000" , vmaxps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5FCB" , vmaxps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC5F8C2B80000000" , vmaxps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5F8C2B80000000" , vmaxps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5FCB" , vmaxsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5F8C2B80000000" , vmaxsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5F8C2B80000000" , vmaxsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5FCB" , vmaxss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5F8C2B80000000" , vmaxss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5F8C2B80000000" , vmaxss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E95DCB" , vminpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E95D8C2B80000000" , vminpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E95D8C2B80000000" , vminpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5DCB" , vminpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED5D8C2B80000000" , vminpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5D8C2B80000000" , vminpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E85DCB" , vminps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E85D8C2B80000000" , vminps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E85D8C2B80000000" , vminps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5DCB" , vminps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC5D8C2B80000000" , vminps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5D8C2B80000000" , vminps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5DCB" , vminsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5D8C2B80000000" , vminsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5D8C2B80000000" , vminsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5DCB" , vminss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5D8C2B80000000" , vminss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5D8C2B80000000" , vminss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F928CA" , vmovapd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F9288C1A80000000" , vmovapd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F9288C1A80000000" , vmovapd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F9299C1180000000" , vmovapd(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9299C1180000000" , vmovapd(xmmword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FD28CA" , vmovapd(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD288C1A80000000" , vmovapd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD288C1A80000000" , vmovapd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD299C1180000000" , vmovapd(ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FD299C1180000000" , vmovapd(ymmword_ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5F828CA" , vmovaps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8288C1A80000000" , vmovaps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F8288C1A80000000" , vmovaps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F8299C1180000000" , vmovaps(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F8299C1180000000" , vmovaps(xmmword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FC28CA" , vmovaps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC288C1A80000000" , vmovaps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC288C1A80000000" , vmovaps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC299C1180000000" , vmovaps(ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FC299C1180000000" , vmovaps(ymmword_ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5F97ED1" , vmovd(ecx, xmm2));
+ TEST_INSTRUCTION("C5F97E9C1180000000" , vmovd(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F97E9C1180000000" , vmovd(dword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F96ECA" , vmovd(xmm1, edx));
+ TEST_INSTRUCTION("C5F96E8C1A80000000" , vmovd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F96E8C1A80000000" , vmovd(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FB12CA" , vmovddup(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FB128C1A80000000" , vmovddup(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FB128C1A80000000" , vmovddup(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FF12CA" , vmovddup(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FF128C1A80000000" , vmovddup(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FF128C1A80000000" , vmovddup(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F96FCA" , vmovdqa(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F96F8C1A80000000" , vmovdqa(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F96F8C1A80000000" , vmovdqa(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F97F9C1180000000" , vmovdqa(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F97F9C1180000000" , vmovdqa(xmmword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FD6FCA" , vmovdqa(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD6F8C1A80000000" , vmovdqa(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD6F8C1A80000000" , vmovdqa(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD7F9C1180000000" , vmovdqa(ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FD7F9C1180000000" , vmovdqa(ymmword_ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FA6FCA" , vmovdqu(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA6F8C1A80000000" , vmovdqu(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA6F8C1A80000000" , vmovdqu(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA7F9C1180000000" , vmovdqu(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FA7F9C1180000000" , vmovdqu(xmmword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FE6FCA" , vmovdqu(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FE6F8C1A80000000" , vmovdqu(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FE6F8C1A80000000" , vmovdqu(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FE7F9C1180000000" , vmovdqu(ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FE7F9C1180000000" , vmovdqu(ymmword_ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5E812CB" , vmovhlps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F9179C1180000000" , vmovhpd(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9179C1180000000" , vmovhpd(qword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5E9168C2B80000000" , vmovhpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9168C2B80000000" , vmovhpd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F8179C1180000000" , vmovhps(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F8179C1180000000" , vmovhps(qword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5E8168C2B80000000" , vmovhps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8168C2B80000000" , vmovhps(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E816CB" , vmovlhps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F9139C1180000000" , vmovlpd(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9139C1180000000" , vmovlpd(qword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5E9128C2B80000000" , vmovlpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9128C2B80000000" , vmovlpd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F8139C1180000000" , vmovlps(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F8139C1180000000" , vmovlps(qword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5E8128C2B80000000" , vmovlps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8128C2B80000000" , vmovlps(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F950CA" , vmovmskpd(ecx, xmm2));
+ TEST_INSTRUCTION("C5FD50CA" , vmovmskpd(ecx, ymm2));
+ TEST_INSTRUCTION("C5F850CA" , vmovmskps(ecx, xmm2));
+ TEST_INSTRUCTION("C5FC50CA" , vmovmskps(ecx, ymm2));
+ TEST_INSTRUCTION("C5F9E79C1180000000" , vmovntdq(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9E79C1180000000" , vmovntdq(xmmword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FDE79C1180000000" , vmovntdq(ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FDE79C1180000000" , vmovntdq(ymmword_ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C4E2792A8C1A80000000" , vmovntdqa(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E2792A8C1A80000000" , vmovntdqa(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D2A8C1A80000000" , vmovntdqa(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D2A8C1A80000000" , vmovntdqa(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F92B9C1180000000" , vmovntpd(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F92B9C1180000000" , vmovntpd(xmmword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FD2B9C1180000000" , vmovntpd(ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FD2B9C1180000000" , vmovntpd(ymmword_ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5F82B9C1180000000" , vmovntps(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F82B9C1180000000" , vmovntps(xmmword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FC2B9C1180000000" , vmovntps(ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FC2B9C1180000000" , vmovntps(ymmword_ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FA7ECA" , vmovq(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA7E8C1A80000000" , vmovq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA7E8C1A80000000" , vmovq(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F9D69C1180000000" , vmovq(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9D69C1180000000" , vmovq(qword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FB119C1180000000" , vmovsd(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FB119C1180000000" , vmovsd(qword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FB108C1A80000000" , vmovsd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FB108C1A80000000" , vmovsd(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5EB10CB" , vmovsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5FA16CA" , vmovshdup(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA168C1A80000000" , vmovshdup(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA168C1A80000000" , vmovshdup(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FE16CA" , vmovshdup(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FE168C1A80000000" , vmovshdup(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FE168C1A80000000" , vmovshdup(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA12CA" , vmovsldup(xmm1, xmm2));
+ TEST_INSTRUCTION("C5FA128C1A80000000" , vmovsldup(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA128C1A80000000" , vmovsldup(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FE12CA" , vmovsldup(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FE128C1A80000000" , vmovsldup(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FE128C1A80000000" , vmovsldup(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA119C1180000000" , vmovss(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FA119C1180000000" , vmovss(dword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FA108C1A80000000" , vmovss(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FA108C1A80000000" , vmovss(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5EA10CB" , vmovss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F910CA" , vmovupd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F9108C1A80000000" , vmovupd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F9108C1A80000000" , vmovupd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F9119C1180000000" , vmovupd(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F9119C1180000000" , vmovupd(xmmword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FD10CA" , vmovupd(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD108C1A80000000" , vmovupd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD108C1A80000000" , vmovupd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD119C1180000000" , vmovupd(ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FD119C1180000000" , vmovupd(ymmword_ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5F810CA" , vmovups(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8108C1A80000000" , vmovups(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F8108C1A80000000" , vmovups(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F8119C1180000000" , vmovups(ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5F8119C1180000000" , vmovups(xmmword_ptr(ecx, edx, 0, 128), xmm3));
+ TEST_INSTRUCTION("C5FC10CA" , vmovups(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC108C1A80000000" , vmovups(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC108C1A80000000" , vmovups(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC119C1180000000" , vmovups(ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C5FC119C1180000000" , vmovups(ymmword_ptr(ecx, edx, 0, 128), ymm3));
+ TEST_INSTRUCTION("C4E36942CB01" , vmpsadbw(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369428C2B8000000001" , vmpsadbw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369428C2B8000000001" , vmpsadbw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D42CB01" , vmpsadbw(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D428C2B8000000001" , vmpsadbw(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D428C2B8000000001" , vmpsadbw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E959CB" , vmulpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9598C2B80000000" , vmulpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9598C2B80000000" , vmulpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED59CB" , vmulpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED598C2B80000000" , vmulpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED598C2B80000000" , vmulpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E859CB" , vmulps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8598C2B80000000" , vmulps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8598C2B80000000" , vmulps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC59CB" , vmulps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC598C2B80000000" , vmulps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC598C2B80000000" , vmulps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB59CB" , vmulsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB598C2B80000000" , vmulsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB598C2B80000000" , vmulsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA59CB" , vmulss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA598C2B80000000" , vmulss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA598C2B80000000" , vmulss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E956CB" , vorpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9568C2B80000000" , vorpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9568C2B80000000" , vorpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED56CB" , vorpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED568C2B80000000" , vorpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED568C2B80000000" , vorpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E856CB" , vorps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8568C2B80000000" , vorps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8568C2B80000000" , vorps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC56CB" , vorps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC568C2B80000000" , vorps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC568C2B80000000" , vorps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2791CCA" , vpabsb(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2791C8C1A80000000" , vpabsb(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791C8C1A80000000" , vpabsb(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1CCA" , vpabsb(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D1C8C1A80000000" , vpabsb(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1C8C1A80000000" , vpabsb(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791ECA" , vpabsd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2791E8C1A80000000" , vpabsd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791E8C1A80000000" , vpabsd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1ECA" , vpabsd(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D1E8C1A80000000" , vpabsd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1E8C1A80000000" , vpabsd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791DCA" , vpabsw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2791D8C1A80000000" , vpabsw(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E2791D8C1A80000000" , vpabsw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1DCA" , vpabsw(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D1D8C1A80000000" , vpabsw(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D1D8C1A80000000" , vpabsw(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5E96BCB" , vpackssdw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E96B8C2B80000000" , vpackssdw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E96B8C2B80000000" , vpackssdw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6BCB" , vpackssdw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED6B8C2B80000000" , vpackssdw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6B8C2B80000000" , vpackssdw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E963CB" , vpacksswb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9638C2B80000000" , vpacksswb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9638C2B80000000" , vpacksswb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED63CB" , vpacksswb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED638C2B80000000" , vpacksswb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED638C2B80000000" , vpacksswb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2692BCB" , vpackusdw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2692B8C2B80000000" , vpackusdw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2692B8C2B80000000" , vpackusdw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2BCB" , vpackusdw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D2B8C2B80000000" , vpackusdw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D2B8C2B80000000" , vpackusdw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E967CB" , vpackuswb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9678C2B80000000" , vpackuswb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9678C2B80000000" , vpackuswb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED67CB" , vpackuswb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED678C2B80000000" , vpackuswb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED678C2B80000000" , vpackuswb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FCCB" , vpaddb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FC8C2B80000000" , vpaddb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FC8C2B80000000" , vpaddb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFCCB" , vpaddb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFC8C2B80000000" , vpaddb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFC8C2B80000000" , vpaddb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FECB" , vpaddd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FE8C2B80000000" , vpaddd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FE8C2B80000000" , vpaddd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFECB" , vpaddd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFE8C2B80000000" , vpaddd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFE8C2B80000000" , vpaddd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D4CB" , vpaddq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9D48C2B80000000" , vpaddq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D48C2B80000000" , vpaddq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD4CB" , vpaddq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDD48C2B80000000" , vpaddq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD48C2B80000000" , vpaddq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9ECCB" , vpaddsb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EC8C2B80000000" , vpaddsb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EC8C2B80000000" , vpaddsb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDECCB" , vpaddsb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEC8C2B80000000" , vpaddsb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEC8C2B80000000" , vpaddsb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EDCB" , vpaddsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9ED8C2B80000000" , vpaddsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9ED8C2B80000000" , vpaddsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEDCB" , vpaddsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDED8C2B80000000" , vpaddsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDED8C2B80000000" , vpaddsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DCCB" , vpaddusb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DC8C2B80000000" , vpaddusb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DC8C2B80000000" , vpaddusb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDCCB" , vpaddusb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDC8C2B80000000" , vpaddusb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDC8C2B80000000" , vpaddusb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DDCB" , vpaddusw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DD8C2B80000000" , vpaddusw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DD8C2B80000000" , vpaddusw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDDCB" , vpaddusw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDD8C2B80000000" , vpaddusw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDD8C2B80000000" , vpaddusw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FDCB" , vpaddw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FD8C2B80000000" , vpaddw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FD8C2B80000000" , vpaddw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFDCB" , vpaddw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFD8C2B80000000" , vpaddw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFD8C2B80000000" , vpaddw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E3690FCB01" , vpalignr(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690F8C2B8000000001" , vpalignr(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690F8C2B8000000001" , vpalignr(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0FCB01" , vpalignr(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D0F8C2B8000000001" , vpalignr(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0F8C2B8000000001" , vpalignr(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9DBCB" , vpand(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DB8C2B80000000" , vpand(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DB8C2B80000000" , vpand(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDBCB" , vpand(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDB8C2B80000000" , vpand(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDB8C2B80000000" , vpand(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DFCB" , vpandn(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DF8C2B80000000" , vpandn(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DF8C2B80000000" , vpandn(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDFCB" , vpandn(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDF8C2B80000000" , vpandn(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDF8C2B80000000" , vpandn(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E0CB" , vpavgb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E08C2B80000000" , vpavgb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E08C2B80000000" , vpavgb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE0CB" , vpavgb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE08C2B80000000" , vpavgb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE08C2B80000000" , vpavgb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E3CB" , vpavgw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E38C2B80000000" , vpavgw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E38C2B80000000" , vpavgw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE3CB" , vpavgw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE38C2B80000000" , vpavgw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE38C2B80000000" , vpavgw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E36902CB01" , vpblendd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369028C2B8000000001" , vpblendd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369028C2B8000000001" , vpblendd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D02CB01" , vpblendd(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D028C2B8000000001" , vpblendd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D028C2B8000000001" , vpblendd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3694CCB40" , vpblendvb(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3694C8C2B8000000060" , vpblendvb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3694C8C2B8000000060" , vpblendvb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E36D4CCB40" , vpblendvb(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E36D4C8C2B8000000060" , vpblendvb(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D4C8C2B8000000060" , vpblendvb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3690ECB01" , vpblendw(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690E8C2B8000000001" , vpblendw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690E8C2B8000000001" , vpblendw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0ECB01" , vpblendw(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D0E8C2B8000000001" , vpblendw(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D0E8C2B8000000001" , vpblendw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E27978CA" , vpbroadcastb(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279788C1A80000000" , vpbroadcastb(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279788C1A80000000" , vpbroadcastb(xmm1, byte_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D78CA" , vpbroadcastb(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D788C1A80000000" , vpbroadcastb(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D788C1A80000000" , vpbroadcastb(ymm1, byte_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27958CA" , vpbroadcastd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279588C1A80000000" , vpbroadcastd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279588C1A80000000" , vpbroadcastd(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D58CA" , vpbroadcastd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D588C1A80000000" , vpbroadcastd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D588C1A80000000" , vpbroadcastd(ymm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27959CA" , vpbroadcastq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279598C1A80000000" , vpbroadcastq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279598C1A80000000" , vpbroadcastq(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D59CA" , vpbroadcastq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D598C1A80000000" , vpbroadcastq(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D598C1A80000000" , vpbroadcastq(ymm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27979CA" , vpbroadcastw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279798C1A80000000" , vpbroadcastw(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279798C1A80000000" , vpbroadcastw(xmm1, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D79CA" , vpbroadcastw(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D798C1A80000000" , vpbroadcastw(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D798C1A80000000" , vpbroadcastw(ymm1, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E36944CB01" , vpclmulqdq(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369448C2B8000000001" , vpclmulqdq(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369448C2B8000000001" , vpclmulqdq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D44CB01" , vpclmulqdq(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D448C2B8000000001" , vpclmulqdq(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D448C2B8000000001" , vpclmulqdq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E974CB" , vpcmpeqb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9748C2B80000000" , vpcmpeqb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9748C2B80000000" , vpcmpeqb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED74CB" , vpcmpeqb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED748C2B80000000" , vpcmpeqb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED748C2B80000000" , vpcmpeqb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E976CB" , vpcmpeqd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9768C2B80000000" , vpcmpeqd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9768C2B80000000" , vpcmpeqd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED76CB" , vpcmpeqd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED768C2B80000000" , vpcmpeqd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED768C2B80000000" , vpcmpeqd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26929CB" , vpcmpeqq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269298C2B80000000" , vpcmpeqq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269298C2B80000000" , vpcmpeqq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D29CB" , vpcmpeqq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D298C2B80000000" , vpcmpeqq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D298C2B80000000" , vpcmpeqq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E975CB" , vpcmpeqw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9758C2B80000000" , vpcmpeqw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9758C2B80000000" , vpcmpeqw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED75CB" , vpcmpeqw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED758C2B80000000" , vpcmpeqw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED758C2B80000000" , vpcmpeqw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E37961CA01" , vpcmpestri(xmm1, xmm2, 1, ecx, eax, edx));
+ TEST_INSTRUCTION("C4E379618C1A8000000001" , vpcmpestri(xmm1, ptr(edx, ebx, 0, 128), 1, ecx, eax, edx));
+ TEST_INSTRUCTION("C4E379618C1A8000000001" , vpcmpestri(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1, ecx, eax, edx));
+ TEST_INSTRUCTION("C4E37960CA01" , vpcmpestrm(xmm1, xmm2, 1, xmm0, eax, edx));
+ TEST_INSTRUCTION("C4E379608C1A8000000001" , vpcmpestrm(xmm1, ptr(edx, ebx, 0, 128), 1, xmm0, eax, edx));
+ TEST_INSTRUCTION("C4E379608C1A8000000001" , vpcmpestrm(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1, xmm0, eax, edx));
+ TEST_INSTRUCTION("C5E964CB" , vpcmpgtb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9648C2B80000000" , vpcmpgtb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9648C2B80000000" , vpcmpgtb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED64CB" , vpcmpgtb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED648C2B80000000" , vpcmpgtb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED648C2B80000000" , vpcmpgtb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E966CB" , vpcmpgtd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9668C2B80000000" , vpcmpgtd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9668C2B80000000" , vpcmpgtd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED66CB" , vpcmpgtd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED668C2B80000000" , vpcmpgtd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED668C2B80000000" , vpcmpgtd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26937CB" , vpcmpgtq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269378C2B80000000" , vpcmpgtq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269378C2B80000000" , vpcmpgtq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D37CB" , vpcmpgtq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D378C2B80000000" , vpcmpgtq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D378C2B80000000" , vpcmpgtq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E965CB" , vpcmpgtw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9658C2B80000000" , vpcmpgtw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9658C2B80000000" , vpcmpgtw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED65CB" , vpcmpgtw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED658C2B80000000" , vpcmpgtw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED658C2B80000000" , vpcmpgtw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E37963CA01" , vpcmpistri(xmm1, xmm2, 1, ecx));
+ TEST_INSTRUCTION("C4E379638C1A8000000001" , vpcmpistri(xmm1, ptr(edx, ebx, 0, 128), 1, ecx));
+ TEST_INSTRUCTION("C4E379638C1A8000000001" , vpcmpistri(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1, ecx));
+ TEST_INSTRUCTION("C4E37962CA01" , vpcmpistrm(xmm1, xmm2, 1, xmm0));
+ TEST_INSTRUCTION("C4E379628C1A8000000001" , vpcmpistrm(xmm1, ptr(edx, ebx, 0, 128), 1, xmm0));
+ TEST_INSTRUCTION("C4E379628C1A8000000001" , vpcmpistrm(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1, xmm0));
+ TEST_INSTRUCTION("C4E36D06CB01" , vperm2f128(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D068C2B8000000001" , vperm2f128(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D068C2B8000000001" , vperm2f128(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D46CB01" , vperm2i128(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C4E36D468C2B8000000001" , vperm2i128(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D468C2B8000000001" , vperm2i128(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26D36CB" , vpermd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D368C2B80000000" , vpermd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D368C2B80000000" , vpermd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E36949CB41" , vpermil2pd(xmm1, xmm2, xmm3, xmm4, 1));
+ TEST_INSTRUCTION("C4E369498C2B8000000061" , vpermil2pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6, 1));
+ TEST_INSTRUCTION("C4E369498C2B8000000061" , vpermil2pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6, 1));
+ TEST_INSTRUCTION("C4E3E9498C358000000031" , vpermil2pd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9498C358000000031" , vpermil2pd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D49CB41" , vpermil2pd(ymm1, ymm2, ymm3, ymm4, 1));
+ TEST_INSTRUCTION("C4E36D498C2B8000000061" , vpermil2pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6, 1));
+ TEST_INSTRUCTION("C4E36D498C2B8000000061" , vpermil2pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6, 1));
+ TEST_INSTRUCTION("C4E3ED498C358000000031" , vpermil2pd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3ED498C358000000031" , vpermil2pd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36948CB41" , vpermil2ps(xmm1, xmm2, xmm3, xmm4, 1));
+ TEST_INSTRUCTION("C4E369488C2B8000000061" , vpermil2ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6, 1));
+ TEST_INSTRUCTION("C4E369488C2B8000000061" , vpermil2ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6, 1));
+ TEST_INSTRUCTION("C4E3E9488C358000000031" , vpermil2ps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3E9488C358000000031" , vpermil2ps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36D48CB41" , vpermil2ps(ymm1, ymm2, ymm3, ymm4, 1));
+ TEST_INSTRUCTION("C4E36D488C2B8000000061" , vpermil2ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6, 1));
+ TEST_INSTRUCTION("C4E36D488C2B8000000061" , vpermil2ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6, 1));
+ TEST_INSTRUCTION("C4E3ED488C358000000031" , vpermil2ps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3ED488C358000000031" , vpermil2ps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128), 1));
+ TEST_INSTRUCTION("C4E2690DCB" , vpermilpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E37905CA01" , vpermilpd(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E2690D8C2B80000000" , vpermilpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690D8C2B80000000" , vpermilpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E379058C1A8000000001" , vpermilpd(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E379058C1A8000000001" , vpermilpd(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26D0DCB" , vpermilpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E37D05CA01" , vpermilpd(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E26D0D8C2B80000000" , vpermilpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0D8C2B80000000" , vpermilpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E37D058C1A8000000001" , vpermilpd(ymm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D058C1A8000000001" , vpermilpd(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E2690CCB" , vpermilps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E37904CA01" , vpermilps(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E2690C8C2B80000000" , vpermilps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690C8C2B80000000" , vpermilps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E379048C1A8000000001" , vpermilps(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E379048C1A8000000001" , vpermilps(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26D0CCB" , vpermilps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E37D04CA01" , vpermilps(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E26D0C8C2B80000000" , vpermilps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0C8C2B80000000" , vpermilps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E37D048C1A8000000001" , vpermilps(ymm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D048C1A8000000001" , vpermilps(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3FD01CA01" , vpermpd(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E3FD018C1A8000000001" , vpermpd(ymm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3FD018C1A8000000001" , vpermpd(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26D16CB" , vpermps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D168C2B80000000" , vpermps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D168C2B80000000" , vpermps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E3FD00CA01" , vpermq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E3FD008C1A8000000001" , vpermq(ymm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3FD008C1A8000000001" , vpermq(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37914D101" , vpextrb(ecx, xmm2, 1));
+ TEST_INSTRUCTION("C4E379149C118000000001" , vpextrb(ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E379149C118000000001" , vpextrb(byte_ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E37916D101" , vpextrd(ecx, xmm2, 1));
+ TEST_INSTRUCTION("C4E379169C118000000001" , vpextrd(ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E379169C118000000001" , vpextrd(dword_ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C5F9C5CA01" , vpextrw(ecx, xmm2, 1));
+ TEST_INSTRUCTION("C4E379159C118000000001" , vpextrw(ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E379159C118000000001" , vpextrw(word_ptr(ecx, edx, 0, 128), xmm3, 1));
+ TEST_INSTRUCTION("C4E259908C1A80000000" , vpgatherdd(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E25D908C1A80000000" , vpgatherdd(ymm1, ptr(edx, ymm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E2D9908C1A80000000" , vpgatherdq(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2DD908C1A80000000" , vpgatherdq(ymm1, ptr(edx, xmm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E259918C1A80000000" , vpgatherqd(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E25D918C1A80000000" , vpgatherqd(xmm1, ptr(edx, ymm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2D9918C1A80000000" , vpgatherqq(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
+ TEST_INSTRUCTION("C4E2DD918C1A80000000" , vpgatherqq(ymm1, ptr(edx, ymm3, 0, 128), ymm4));
+ TEST_INSTRUCTION("C4E26902CB" , vphaddd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269028C2B80000000" , vphaddd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269028C2B80000000" , vphaddd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D02CB" , vphaddd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D028C2B80000000" , vphaddd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D028C2B80000000" , vphaddd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26903CB" , vphaddsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269038C2B80000000" , vphaddsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269038C2B80000000" , vphaddsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D03CB" , vphaddsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D038C2B80000000" , vphaddsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D038C2B80000000" , vphaddsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26901CB" , vphaddw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269018C2B80000000" , vphaddw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269018C2B80000000" , vphaddw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D01CB" , vphaddw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D018C2B80000000" , vphaddw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D018C2B80000000" , vphaddw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E27941CA" , vphminposuw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279418C1A80000000" , vphminposuw(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279418C1A80000000" , vphminposuw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E26906CB" , vphsubd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269068C2B80000000" , vphsubd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269068C2B80000000" , vphsubd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D06CB" , vphsubd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D068C2B80000000" , vphsubd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D068C2B80000000" , vphsubd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26907CB" , vphsubsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269078C2B80000000" , vphsubsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269078C2B80000000" , vphsubsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D07CB" , vphsubsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D078C2B80000000" , vphsubsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D078C2B80000000" , vphsubsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26905CB" , vphsubw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269058C2B80000000" , vphsubw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269058C2B80000000" , vphsubw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D05CB" , vphsubw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D058C2B80000000" , vphsubw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D058C2B80000000" , vphsubw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E36920CB01" , vpinsrb(xmm1, xmm2, ebx, 1));
+ TEST_INSTRUCTION("C4E369208C2B8000000001" , vpinsrb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369208C2B8000000001" , vpinsrb(xmm1, xmm2, byte_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E36922CB01" , vpinsrd(xmm1, xmm2, ebx, 1));
+ TEST_INSTRUCTION("C4E369228C2B8000000001" , vpinsrd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369228C2B8000000001" , vpinsrd(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9C4CB01" , vpinsrw(xmm1, xmm2, ebx, 1));
+ TEST_INSTRUCTION("C5E9C48C2B8000000001" , vpinsrw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9C48C2B8000000001" , vpinsrw(xmm1, xmm2, word_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26904CB" , vpmaddubsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269048C2B80000000" , vpmaddubsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269048C2B80000000" , vpmaddubsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D04CB" , vpmaddubsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D048C2B80000000" , vpmaddubsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D048C2B80000000" , vpmaddubsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F5CB" , vpmaddwd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F58C2B80000000" , vpmaddwd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F58C2B80000000" , vpmaddwd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF5CB" , vpmaddwd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF58C2B80000000" , vpmaddwd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF58C2B80000000" , vpmaddwd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2618EA41180000000" , vpmaskmovd(ptr(ecx, edx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2618EA41180000000" , vpmaskmovd(xmmword_ptr(ecx, edx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2658EA41180000000" , vpmaskmovd(ptr(ecx, edx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2658EA41180000000" , vpmaskmovd(ymmword_ptr(ecx, edx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2698C8C2B80000000" , vpmaskmovd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2698C8C2B80000000" , vpmaskmovd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D8C8C2B80000000" , vpmaskmovd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D8C8C2B80000000" , vpmaskmovd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E18EA41180000000" , vpmaskmovq(ptr(ecx, edx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2E18EA41180000000" , vpmaskmovq(xmmword_ptr(ecx, edx, 0, 128), xmm3, xmm4));
+ TEST_INSTRUCTION("C4E2E58EA41180000000" , vpmaskmovq(ptr(ecx, edx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2E58EA41180000000" , vpmaskmovq(ymmword_ptr(ecx, edx, 0, 128), ymm3, ymm4));
+ TEST_INSTRUCTION("C4E2E98C8C2B80000000" , vpmaskmovq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E98C8C2B80000000" , vpmaskmovq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED8C8C2B80000000" , vpmaskmovq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED8C8C2B80000000" , vpmaskmovq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693CCB" , vpmaxsb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693C8C2B80000000" , vpmaxsb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693C8C2B80000000" , vpmaxsb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3CCB" , vpmaxsb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3C8C2B80000000" , vpmaxsb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3C8C2B80000000" , vpmaxsb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693DCB" , vpmaxsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693D8C2B80000000" , vpmaxsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693D8C2B80000000" , vpmaxsd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3DCB" , vpmaxsd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3D8C2B80000000" , vpmaxsd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3D8C2B80000000" , vpmaxsd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EECB" , vpmaxsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EE8C2B80000000" , vpmaxsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EE8C2B80000000" , vpmaxsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEECB" , vpmaxsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEE8C2B80000000" , vpmaxsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEE8C2B80000000" , vpmaxsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DECB" , vpmaxub(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DE8C2B80000000" , vpmaxub(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DE8C2B80000000" , vpmaxub(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDECB" , vpmaxub(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDE8C2B80000000" , vpmaxub(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDE8C2B80000000" , vpmaxub(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693FCB" , vpmaxud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693F8C2B80000000" , vpmaxud(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693F8C2B80000000" , vpmaxud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3FCB" , vpmaxud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3F8C2B80000000" , vpmaxud(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3F8C2B80000000" , vpmaxud(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693ECB" , vpmaxuw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693E8C2B80000000" , vpmaxuw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693E8C2B80000000" , vpmaxuw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3ECB" , vpmaxuw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3E8C2B80000000" , vpmaxuw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3E8C2B80000000" , vpmaxuw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26938CB" , vpminsb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269388C2B80000000" , vpminsb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269388C2B80000000" , vpminsb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D38CB" , vpminsb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D388C2B80000000" , vpminsb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D388C2B80000000" , vpminsb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26939CB" , vpminsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269398C2B80000000" , vpminsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269398C2B80000000" , vpminsd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D39CB" , vpminsd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D398C2B80000000" , vpminsd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D398C2B80000000" , vpminsd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EACB" , vpminsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EA8C2B80000000" , vpminsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EA8C2B80000000" , vpminsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEACB" , vpminsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEA8C2B80000000" , vpminsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEA8C2B80000000" , vpminsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DACB" , vpminub(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9DA8C2B80000000" , vpminub(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9DA8C2B80000000" , vpminub(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDACB" , vpminub(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDDA8C2B80000000" , vpminub(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDDA8C2B80000000" , vpminub(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693BCB" , vpminud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693B8C2B80000000" , vpminud(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693B8C2B80000000" , vpminud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3BCB" , vpminud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3B8C2B80000000" , vpminud(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3B8C2B80000000" , vpminud(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693ACB" , vpminuw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2693A8C2B80000000" , vpminuw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2693A8C2B80000000" , vpminuw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3ACB" , vpminuw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D3A8C2B80000000" , vpminuw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D3A8C2B80000000" , vpminuw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F9D7CA" , vpmovmskb(ecx, xmm2));
+ TEST_INSTRUCTION("C5FDD7CA" , vpmovmskb(ecx, ymm2));
+ TEST_INSTRUCTION("C4E27921CA" , vpmovsxbd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279218C1A80000000" , vpmovsxbd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279218C1A80000000" , vpmovsxbd(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D21CA" , vpmovsxbd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D218C1A80000000" , vpmovsxbd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D218C1A80000000" , vpmovsxbd(ymm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27922CA" , vpmovsxbq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279228C1A80000000" , vpmovsxbq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279228C1A80000000" , vpmovsxbq(xmm1, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D22CA" , vpmovsxbq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D228C1A80000000" , vpmovsxbq(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D228C1A80000000" , vpmovsxbq(ymm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27920CA" , vpmovsxbw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279208C1A80000000" , vpmovsxbw(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279208C1A80000000" , vpmovsxbw(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D20CA" , vpmovsxbw(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D208C1A80000000" , vpmovsxbw(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D208C1A80000000" , vpmovsxbw(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27925CA" , vpmovsxdq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279258C1A80000000" , vpmovsxdq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279258C1A80000000" , vpmovsxdq(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D25CA" , vpmovsxdq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D258C1A80000000" , vpmovsxdq(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D258C1A80000000" , vpmovsxdq(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27923CA" , vpmovsxwd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279238C1A80000000" , vpmovsxwd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279238C1A80000000" , vpmovsxwd(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D23CA" , vpmovsxwd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D238C1A80000000" , vpmovsxwd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D238C1A80000000" , vpmovsxwd(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27924CA" , vpmovsxwq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279248C1A80000000" , vpmovsxwq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279248C1A80000000" , vpmovsxwq(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D24CA" , vpmovsxwq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D248C1A80000000" , vpmovsxwq(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D248C1A80000000" , vpmovsxwq(ymm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27931CA" , vpmovzxbd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279318C1A80000000" , vpmovzxbd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279318C1A80000000" , vpmovzxbd(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D31CA" , vpmovzxbd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D318C1A80000000" , vpmovzxbd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D318C1A80000000" , vpmovzxbd(ymm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27932CA" , vpmovzxbq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279328C1A80000000" , vpmovzxbq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279328C1A80000000" , vpmovzxbq(xmm1, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D32CA" , vpmovzxbq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D328C1A80000000" , vpmovzxbq(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D328C1A80000000" , vpmovzxbq(ymm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27930CA" , vpmovzxbw(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279308C1A80000000" , vpmovzxbw(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279308C1A80000000" , vpmovzxbw(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D30CA" , vpmovzxbw(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D308C1A80000000" , vpmovzxbw(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D308C1A80000000" , vpmovzxbw(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27935CA" , vpmovzxdq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279358C1A80000000" , vpmovzxdq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279358C1A80000000" , vpmovzxdq(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D35CA" , vpmovzxdq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D358C1A80000000" , vpmovzxdq(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D358C1A80000000" , vpmovzxdq(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27933CA" , vpmovzxwd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279338C1A80000000" , vpmovzxwd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279338C1A80000000" , vpmovzxwd(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D33CA" , vpmovzxwd(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D338C1A80000000" , vpmovzxwd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D338C1A80000000" , vpmovzxwd(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27934CA" , vpmovzxwq(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279348C1A80000000" , vpmovzxwq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279348C1A80000000" , vpmovzxwq(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D34CA" , vpmovzxwq(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27D348C1A80000000" , vpmovzxwq(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D348C1A80000000" , vpmovzxwq(ymm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E26928CB" , vpmuldq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269288C2B80000000" , vpmuldq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269288C2B80000000" , vpmuldq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D28CB" , vpmuldq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D288C2B80000000" , vpmuldq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D288C2B80000000" , vpmuldq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690BCB" , vpmulhrsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2690B8C2B80000000" , vpmulhrsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690B8C2B80000000" , vpmulhrsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0BCB" , vpmulhrsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D0B8C2B80000000" , vpmulhrsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0B8C2B80000000" , vpmulhrsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E4CB" , vpmulhuw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E48C2B80000000" , vpmulhuw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E48C2B80000000" , vpmulhuw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE4CB" , vpmulhuw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE48C2B80000000" , vpmulhuw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE48C2B80000000" , vpmulhuw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E5CB" , vpmulhw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E58C2B80000000" , vpmulhw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E58C2B80000000" , vpmulhw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE5CB" , vpmulhw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE58C2B80000000" , vpmulhw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE58C2B80000000" , vpmulhw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26940CB" , vpmulld(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269408C2B80000000" , vpmulld(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269408C2B80000000" , vpmulld(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D40CB" , vpmulld(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D408C2B80000000" , vpmulld(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D408C2B80000000" , vpmulld(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D5CB" , vpmullw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9D58C2B80000000" , vpmullw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D58C2B80000000" , vpmullw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD5CB" , vpmullw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDD58C2B80000000" , vpmullw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD58C2B80000000" , vpmullw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F4CB" , vpmuludq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F48C2B80000000" , vpmuludq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F48C2B80000000" , vpmuludq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF4CB" , vpmuludq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF48C2B80000000" , vpmuludq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF48C2B80000000" , vpmuludq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EBCB" , vpor(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EB8C2B80000000" , vpor(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EB8C2B80000000" , vpor(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEBCB" , vpor(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEB8C2B80000000" , vpor(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEB8C2B80000000" , vpor(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F6CB" , vpsadbw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F68C2B80000000" , vpsadbw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F68C2B80000000" , vpsadbw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF6CB" , vpsadbw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF68C2B80000000" , vpsadbw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF68C2B80000000" , vpsadbw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26900CB" , vpshufb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269008C2B80000000" , vpshufb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269008C2B80000000" , vpshufb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D00CB" , vpshufb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D008C2B80000000" , vpshufb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D008C2B80000000" , vpshufb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F970CA01" , vpshufd(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5F9708C1A8000000001" , vpshufd(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5F9708C1A8000000001" , vpshufd(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FD70CA01" , vpshufd(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5FD708C1A8000000001" , vpshufd(ymm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FD708C1A8000000001" , vpshufd(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FA70CA01" , vpshufhw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5FA708C1A8000000001" , vpshufhw(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FA708C1A8000000001" , vpshufhw(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FE70CA01" , vpshufhw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5FE708C1A8000000001" , vpshufhw(ymm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FE708C1A8000000001" , vpshufhw(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FB70CA01" , vpshuflw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5FB708C1A8000000001" , vpshuflw(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FB708C1A8000000001" , vpshuflw(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FF70CA01" , vpshuflw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5FF708C1A8000000001" , vpshuflw(ymm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C5FF708C1A8000000001" , vpshuflw(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E26908CB" , vpsignb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269088C2B80000000" , vpsignb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269088C2B80000000" , vpsignb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D08CB" , vpsignb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D088C2B80000000" , vpsignb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D088C2B80000000" , vpsignb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690ACB" , vpsignd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2690A8C2B80000000" , vpsignd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2690A8C2B80000000" , vpsignd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0ACB" , vpsignd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D0A8C2B80000000" , vpsignd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D0A8C2B80000000" , vpsignd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26909CB" , vpsignw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269098C2B80000000" , vpsignw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269098C2B80000000" , vpsignw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D09CB" , vpsignw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D098C2B80000000" , vpsignw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D098C2B80000000" , vpsignw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F2CB" , vpslld(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F172F201" , vpslld(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9F28C2B80000000" , vpslld(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F28C2B80000000" , vpslld(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF2CB" , vpslld(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F572F201" , vpslld(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDF28C2B80000000" , vpslld(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF28C2B80000000" , vpslld(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F173FA01" , vpslldq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5F573FA01" , vpslldq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5E9F3CB" , vpsllq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F173F201" , vpsllq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9F38C2B80000000" , vpsllq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F38C2B80000000" , vpsllq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF3CB" , vpsllq(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F573F201" , vpsllq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDF38C2B80000000" , vpsllq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF38C2B80000000" , vpsllq(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26947CB" , vpsllvd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269478C2B80000000" , vpsllvd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269478C2B80000000" , vpsllvd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D47CB" , vpsllvd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D478C2B80000000" , vpsllvd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D478C2B80000000" , vpsllvd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E947CB" , vpsllvq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9478C2B80000000" , vpsllvq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9478C2B80000000" , vpsllvq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED47CB" , vpsllvq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED478C2B80000000" , vpsllvq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED478C2B80000000" , vpsllvq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F1CB" , vpsllw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F171F201" , vpsllw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9F18C2B80000000" , vpsllw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F18C2B80000000" , vpsllw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF1CB" , vpsllw(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F571F201" , vpsllw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDF18C2B80000000" , vpsllw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF18C2B80000000" , vpsllw(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E2CB" , vpsrad(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F172E201" , vpsrad(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9E28C2B80000000" , vpsrad(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E28C2B80000000" , vpsrad(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE2CB" , vpsrad(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F572E201" , vpsrad(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDE28C2B80000000" , vpsrad(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE28C2B80000000" , vpsrad(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26946CB" , vpsravd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269468C2B80000000" , vpsravd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269468C2B80000000" , vpsravd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D46CB" , vpsravd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D468C2B80000000" , vpsravd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D468C2B80000000" , vpsravd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E1CB" , vpsraw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F171E201" , vpsraw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9E18C2B80000000" , vpsraw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E18C2B80000000" , vpsraw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE1CB" , vpsraw(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F571E201" , vpsraw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDE18C2B80000000" , vpsraw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE18C2B80000000" , vpsraw(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D2CB" , vpsrld(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F172D201" , vpsrld(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9D28C2B80000000" , vpsrld(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D28C2B80000000" , vpsrld(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD2CB" , vpsrld(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F572D201" , vpsrld(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDD28C2B80000000" , vpsrld(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD28C2B80000000" , vpsrld(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F173DA01" , vpsrldq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5F573DA01" , vpsrldq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5E9D3CB" , vpsrlq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F173D201" , vpsrlq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9D38C2B80000000" , vpsrlq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D38C2B80000000" , vpsrlq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD3CB" , vpsrlq(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F573D201" , vpsrlq(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDD38C2B80000000" , vpsrlq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD38C2B80000000" , vpsrlq(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26945CB" , vpsrlvd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269458C2B80000000" , vpsrlvd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269458C2B80000000" , vpsrlvd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D45CB" , vpsrlvd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D458C2B80000000" , vpsrlvd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D458C2B80000000" , vpsrlvd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E945CB" , vpsrlvq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9458C2B80000000" , vpsrlvq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9458C2B80000000" , vpsrlvq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED45CB" , vpsrlvq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED458C2B80000000" , vpsrlvq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED458C2B80000000" , vpsrlvq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D1CB" , vpsrlw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5F171D201" , vpsrlw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C5E9D18C2B80000000" , vpsrlw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D18C2B80000000" , vpsrlw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD1CB" , vpsrlw(ymm1, ymm2, xmm3));
+ TEST_INSTRUCTION("C5F571D201" , vpsrlw(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C5EDD18C2B80000000" , vpsrlw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD18C2B80000000" , vpsrlw(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F8CB" , vpsubb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F88C2B80000000" , vpsubb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F88C2B80000000" , vpsubb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF8CB" , vpsubb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF88C2B80000000" , vpsubb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF88C2B80000000" , vpsubb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FACB" , vpsubd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FA8C2B80000000" , vpsubd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FA8C2B80000000" , vpsubd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFACB" , vpsubd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFA8C2B80000000" , vpsubd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFA8C2B80000000" , vpsubd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FBCB" , vpsubq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9FB8C2B80000000" , vpsubq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9FB8C2B80000000" , vpsubq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFBCB" , vpsubq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDFB8C2B80000000" , vpsubq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDFB8C2B80000000" , vpsubq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E8CB" , vpsubsb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E88C2B80000000" , vpsubsb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E88C2B80000000" , vpsubsb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE8CB" , vpsubsb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE88C2B80000000" , vpsubsb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE88C2B80000000" , vpsubsb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E9CB" , vpsubsw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9E98C2B80000000" , vpsubsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9E98C2B80000000" , vpsubsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE9CB" , vpsubsw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDE98C2B80000000" , vpsubsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDE98C2B80000000" , vpsubsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D8CB" , vpsubusb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9D88C2B80000000" , vpsubusb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D88C2B80000000" , vpsubusb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD8CB" , vpsubusb(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDD88C2B80000000" , vpsubusb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD88C2B80000000" , vpsubusb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D9CB" , vpsubusw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9D98C2B80000000" , vpsubusw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9D98C2B80000000" , vpsubusw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD9CB" , vpsubusw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDD98C2B80000000" , vpsubusw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDD98C2B80000000" , vpsubusw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F9CB" , vpsubw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9F98C2B80000000" , vpsubw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9F98C2B80000000" , vpsubw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF9CB" , vpsubw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDF98C2B80000000" , vpsubw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDF98C2B80000000" , vpsubw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E27917CA" , vptest(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E279178C1A80000000" , vptest(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279178C1A80000000" , vptest(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D17CA" , vptest(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D178C1A80000000" , vptest(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D178C1A80000000" , vptest(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5E968CB" , vpunpckhbw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9688C2B80000000" , vpunpckhbw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9688C2B80000000" , vpunpckhbw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED68CB" , vpunpckhbw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED688C2B80000000" , vpunpckhbw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED688C2B80000000" , vpunpckhbw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E96ACB" , vpunpckhdq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E96A8C2B80000000" , vpunpckhdq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E96A8C2B80000000" , vpunpckhdq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6ACB" , vpunpckhdq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED6A8C2B80000000" , vpunpckhdq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6A8C2B80000000" , vpunpckhdq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E96DCB" , vpunpckhqdq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E96D8C2B80000000" , vpunpckhqdq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E96D8C2B80000000" , vpunpckhqdq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6DCB" , vpunpckhqdq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED6D8C2B80000000" , vpunpckhqdq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6D8C2B80000000" , vpunpckhqdq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E969CB" , vpunpckhwd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9698C2B80000000" , vpunpckhwd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9698C2B80000000" , vpunpckhwd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED69CB" , vpunpckhwd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED698C2B80000000" , vpunpckhwd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED698C2B80000000" , vpunpckhwd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E960CB" , vpunpcklbw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9608C2B80000000" , vpunpcklbw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9608C2B80000000" , vpunpcklbw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED60CB" , vpunpcklbw(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED608C2B80000000" , vpunpcklbw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED608C2B80000000" , vpunpcklbw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E962CB" , vpunpckldq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9628C2B80000000" , vpunpckldq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9628C2B80000000" , vpunpckldq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED62CB" , vpunpckldq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED628C2B80000000" , vpunpckldq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED628C2B80000000" , vpunpckldq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E96CCB" , vpunpcklqdq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E96C8C2B80000000" , vpunpcklqdq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E96C8C2B80000000" , vpunpcklqdq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6CCB" , vpunpcklqdq(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED6C8C2B80000000" , vpunpcklqdq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED6C8C2B80000000" , vpunpcklqdq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E961CB" , vpunpcklwd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9618C2B80000000" , vpunpcklwd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9618C2B80000000" , vpunpcklwd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED61CB" , vpunpcklwd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED618C2B80000000" , vpunpcklwd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED618C2B80000000" , vpunpcklwd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EFCB" , vpxor(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9EF8C2B80000000" , vpxor(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9EF8C2B80000000" , vpxor(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEFCB" , vpxor(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EDEF8C2B80000000" , vpxor(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EDEF8C2B80000000" , vpxor(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F853CA" , vrcpps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8538C1A80000000" , vrcpps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F8538C1A80000000" , vrcpps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC53CA" , vrcpps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC538C1A80000000" , vrcpps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC538C1A80000000" , vrcpps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5EA53CB" , vrcpss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA538C2B80000000" , vrcpss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA538C2B80000000" , vrcpss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E37909CA01" , vroundpd(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E379098C1A8000000001" , vroundpd(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E379098C1A8000000001" , vroundpd(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D09CA01" , vroundpd(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D098C1A8000000001" , vroundpd(ymm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D098C1A8000000001" , vroundpd(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37908CA01" , vroundps(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("C4E379088C1A8000000001" , vroundps(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E379088C1A8000000001" , vroundps(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D08CA01" , vroundps(ymm1, ymm2, 1));
+ TEST_INSTRUCTION("C4E37D088C1A8000000001" , vroundps(ymm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E37D088C1A8000000001" , vroundps(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690BCB01" , vroundsd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690B8C2B8000000001" , vroundsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690B8C2B8000000001" , vroundsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690ACB01" , vroundss(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E3690A8C2B8000000001" , vroundss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E3690A8C2B8000000001" , vroundss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5F852CA" , vrsqrtps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8528C1A80000000" , vrsqrtps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F8528C1A80000000" , vrsqrtps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC52CA" , vrsqrtps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC528C1A80000000" , vrsqrtps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC528C1A80000000" , vrsqrtps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5EA52CB" , vrsqrtss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA528C2B80000000" , vrsqrtss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA528C2B80000000" , vrsqrtss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9C6CB01" , vshufpd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5E9C68C2B8000000001" , vshufpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E9C68C2B8000000001" , vshufpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EDC6CB01" , vshufpd(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C5EDC68C2B8000000001" , vshufpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5EDC68C2B8000000001" , vshufpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E8C6CB01" , vshufps(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C5E8C68C2B8000000001" , vshufps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5E8C68C2B8000000001" , vshufps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5ECC6CB01" , vshufps(ymm1, ymm2, ymm3, 1));
+ TEST_INSTRUCTION("C5ECC68C2B8000000001" , vshufps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5ECC68C2B8000000001" , vshufps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C5F951CA" , vsqrtpd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F9518C1A80000000" , vsqrtpd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F9518C1A80000000" , vsqrtpd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD51CA" , vsqrtpd(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FD518C1A80000000" , vsqrtpd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FD518C1A80000000" , vsqrtpd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F851CA" , vsqrtps(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F8518C1A80000000" , vsqrtps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F8518C1A80000000" , vsqrtps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC51CA" , vsqrtps(ymm1, ymm2));
+ TEST_INSTRUCTION("C5FC518C1A80000000" , vsqrtps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5FC518C1A80000000" , vsqrtps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5EB51CB" , vsqrtsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB518C2B80000000" , vsqrtsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB518C2B80000000" , vsqrtsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA51CB" , vsqrtss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA518C2B80000000" , vsqrtss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA518C2B80000000" , vsqrtss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5F8AE9C1180000000" , vstmxcsr(ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("C5F8AE9C1180000000" , vstmxcsr(dword_ptr(ecx, edx, 0, 128)));
+ TEST_INSTRUCTION("C5E95CCB" , vsubpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E95C8C2B80000000" , vsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E95C8C2B80000000" , vsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5CCB" , vsubpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED5C8C2B80000000" , vsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED5C8C2B80000000" , vsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E85CCB" , vsubps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E85C8C2B80000000" , vsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E85C8C2B80000000" , vsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5CCB" , vsubps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC5C8C2B80000000" , vsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC5C8C2B80000000" , vsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5CCB" , vsubsd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EB5C8C2B80000000" , vsubsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EB5C8C2B80000000" , vsubsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5CCB" , vsubss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5EA5C8C2B80000000" , vsubss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EA5C8C2B80000000" , vsubss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2790FCA" , vtestpd(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2790F8C1A80000000" , vtestpd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E2790F8C1A80000000" , vtestpd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D0FCA" , vtestpd(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D0F8C1A80000000" , vtestpd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D0F8C1A80000000" , vtestpd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E2790ECA" , vtestps(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E2790E8C1A80000000" , vtestps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E2790E8C1A80000000" , vtestps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D0ECA" , vtestps(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E27D0E8C1A80000000" , vtestps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27D0E8C1A80000000" , vtestps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F92ECA" , vucomisd(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F92E8C1A80000000" , vucomisd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F92E8C1A80000000" , vucomisd(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F82ECA" , vucomiss(xmm1, xmm2));
+ TEST_INSTRUCTION("C5F82E8C1A80000000" , vucomiss(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5F82E8C1A80000000" , vucomiss(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C5E915CB" , vunpckhpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9158C2B80000000" , vunpckhpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9158C2B80000000" , vunpckhpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED15CB" , vunpckhpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED158C2B80000000" , vunpckhpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED158C2B80000000" , vunpckhpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E815CB" , vunpckhps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8158C2B80000000" , vunpckhps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8158C2B80000000" , vunpckhps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC15CB" , vunpckhps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC158C2B80000000" , vunpckhps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC158C2B80000000" , vunpckhps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E914CB" , vunpcklpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9148C2B80000000" , vunpcklpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9148C2B80000000" , vunpcklpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED14CB" , vunpcklpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED148C2B80000000" , vunpcklpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED148C2B80000000" , vunpcklpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E814CB" , vunpcklps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8148C2B80000000" , vunpcklps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8148C2B80000000" , vunpcklps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC14CB" , vunpcklps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC148C2B80000000" , vunpcklps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC148C2B80000000" , vunpcklps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E957CB" , vxorpd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E9578C2B80000000" , vxorpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E9578C2B80000000" , vxorpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED57CB" , vxorpd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5ED578C2B80000000" , vxorpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5ED578C2B80000000" , vxorpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E857CB" , vxorps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C5E8578C2B80000000" , vxorps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5E8578C2B80000000" , vxorps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC57CB" , vxorps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C5EC578C2B80000000" , vxorps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5EC578C2B80000000" , vxorps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C5FC77" , vzeroall());
+ TEST_INSTRUCTION("C5F877" , vzeroupper());
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerAVX_NE_CONVERT(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E27AB18C1A80000000" , vbcstnebf162ps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27AB18C1A80000000" , vbcstnebf162ps(xmm1, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27EB18C1A80000000" , vbcstnebf162ps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27EB18C1A80000000" , vbcstnebf162ps(ymm1, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279B18C1A80000000" , vbcstnesh2ps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279B18C1A80000000" , vbcstnesh2ps(xmm1, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27DB18C1A80000000" , vbcstnesh2ps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27DB18C1A80000000" , vbcstnesh2ps(ymm1, word_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27AB08C1A80000000" , vcvtneebf162ps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27AB08C1A80000000" , vcvtneebf162ps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27EB08C1A80000000" , vcvtneebf162ps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27EB08C1A80000000" , vcvtneebf162ps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279B08C1A80000000" , vcvtneeph2ps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E279B08C1A80000000" , vcvtneeph2ps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27DB08C1A80000000" , vcvtneeph2ps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27DB08C1A80000000" , vcvtneeph2ps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27BB08C1A80000000" , vcvtneobf162ps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27BB08C1A80000000" , vcvtneobf162ps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27FB08C1A80000000" , vcvtneobf162ps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27FB08C1A80000000" , vcvtneobf162ps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E278B08C1A80000000" , vcvtneoph2ps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E278B08C1A80000000" , vcvtneoph2ps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27CB08C1A80000000" , vcvtneoph2ps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27CB08C1A80000000" , vcvtneoph2ps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27A72CA" , vex().vcvtneps2bf16(xmm1, xmm2));
+ TEST_INSTRUCTION("C4E27E72CA" , vex().vcvtneps2bf16(xmm1, ymm2));
+ TEST_INSTRUCTION("C4E27A728C1A80000000" , vex().vcvtneps2bf16(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("C4E27E728C1A80000000" , vex().vcvtneps2bf16(xmm1, ymmword_ptr(edx, ebx, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerAVX_VNNI(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E25150F4" , vex().vpdpbusd(xmm6, xmm5, xmm4));
+ TEST_INSTRUCTION("C4E25550F4" , vex().vpdpbusd(ymm6, ymm5, ymm4));
+ TEST_INSTRUCTION("C4E25151F4" , vex().vpdpbusds(xmm6, xmm5, xmm4));
+ TEST_INSTRUCTION("C4E25551F4" , vex().vpdpbusds(ymm6, ymm5, ymm4));
+ TEST_INSTRUCTION("C4E25152F4" , vex().vpdpwssd(xmm6, xmm5, xmm4));
+ TEST_INSTRUCTION("C4E25552F4" , vex().vpdpwssd(ymm6, ymm5, ymm4));
+ TEST_INSTRUCTION("C4E25153F4" , vex().vpdpwssds(xmm6, xmm5, xmm4));
+ TEST_INSTRUCTION("C4E25553F4" , vex().vpdpwssds(ymm6, ymm5, ymm4));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerAVX_VNNI_INT8(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E26B50CB" , vpdpbssd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26B508C2B80000000" , vpdpbssd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26B508C2B80000000" , vpdpbssd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26F50CB" , vpdpbssd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26F508C2B80000000" , vpdpbssd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26F508C2B80000000" , vpdpbssd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26B51CB" , vpdpbssds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26B518C2B80000000" , vpdpbssds(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26B518C2B80000000" , vpdpbssds(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26F51CB" , vpdpbssds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26F518C2B80000000" , vpdpbssds(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26F518C2B80000000" , vpdpbssds(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26A50CB" , vpdpbsud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26A508C2B80000000" , vpdpbsud(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26A508C2B80000000" , vpdpbsud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26E50CB" , vpdpbsud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26E508C2B80000000" , vpdpbsud(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26E508C2B80000000" , vpdpbsud(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26A51CB" , vpdpbsuds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26A518C2B80000000" , vpdpbsuds(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26A518C2B80000000" , vpdpbsuds(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26E51CB" , vpdpbsuds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26E518C2B80000000" , vpdpbsuds(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26E518C2B80000000" , vpdpbsuds(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26850CB" , vpdpbuud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268508C2B80000000" , vpdpbuud(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E268508C2B80000000" , vpdpbuud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26C50CB" , vpdpbuud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26C508C2B80000000" , vpdpbuud(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26C508C2B80000000" , vpdpbuud(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26851CB" , vpdpbuuds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268518C2B80000000" , vpdpbuuds(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E268518C2B80000000" , vpdpbuuds(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26C51CB" , vpdpbuuds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26C518C2B80000000" , vpdpbuuds(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26C518C2B80000000" , vpdpbuuds(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerAVX_VNNI_INT16(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E26AD2CB" , vpdpwsud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26AD28C2B80000000" , vpdpwsud(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AD28C2B80000000" , vpdpwsud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ED2CB" , vpdpwsud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26ED28C2B80000000" , vpdpwsud(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ED28C2B80000000" , vpdpwsud(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AD3CB" , vpdpwsuds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26AD38C2B80000000" , vpdpwsuds(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26AD38C2B80000000" , vpdpwsuds(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ED3CB" , vpdpwsuds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26ED38C2B80000000" , vpdpwsuds(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ED38C2B80000000" , vpdpwsuds(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269D2CB" , vpdpwusd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269D28C2B80000000" , vpdpwusd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269D28C2B80000000" , vpdpwusd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DD2CB" , vpdpwusd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DD28C2B80000000" , vpdpwusd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DD28C2B80000000" , vpdpwusd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269D3CB" , vpdpwusds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269D38C2B80000000" , vpdpwusds(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269D38C2B80000000" , vpdpwusds(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DD3CB" , vpdpwusds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DD38C2B80000000" , vpdpwusds(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DD38C2B80000000" , vpdpwusds(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E268D2CB" , vpdpwuud(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268D28C2B80000000" , vpdpwuud(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E268D28C2B80000000" , vpdpwuud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26CD2CB" , vpdpwuud(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26CD28C2B80000000" , vpdpwuud(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26CD28C2B80000000" , vpdpwuud(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E268D3CB" , vpdpwuuds(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268D38C2B80000000" , vpdpwuuds(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E268D38C2B80000000" , vpdpwuuds(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26CD3CB" , vpdpwuuds(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26CD38C2B80000000" , vpdpwuuds(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26CD38C2B80000000" , vpdpwuuds(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerAVX_SHA512(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E27FCCCA" , vsha512msg1(ymm1, xmm2));
+ TEST_INSTRUCTION("C4E27FCDCA" , vsha512msg2(ymm1, ymm2));
+ TEST_INSTRUCTION("C4E26FCBCB" , vsha512rnds2(ymm1, ymm2, xmm3));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerAVX_SM3(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E268DACB" , vsm3msg1(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E268DA8C2B80000000" , vsm3msg1(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E268DA8C2B80000000" , vsm3msg1(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DACB" , vsm3msg2(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269DA8C2B80000000" , vsm3msg2(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269DA8C2B80000000" , vsm3msg2(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E369DECB01" , vsm3rnds2(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("C4E369DE8C2B8000000001" , vsm3rnds2(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("C4E369DE8C2B8000000001" , vsm3rnds2(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerAVX_SM4(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E26ADACB" , vsm4key4(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26ADA8C2B80000000" , vsm4key4(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26ADA8C2B80000000" , vsm4key4(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26EDACB" , vsm4key4(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26EDA8C2B80000000" , vsm4key4(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26EDA8C2B80000000" , vsm4key4(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26BDACB" , vsm4rnds4(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E26BDA8C2B80000000" , vsm4rnds4(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26BDA8C2B80000000" , vsm4rnds4(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26FDACB" , vsm4rnds4(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26FDA8C2B80000000" , vsm4rnds4(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26FDA8C2B80000000" , vsm4rnds4(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerFMA(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E2E998CB" , vfmadd132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9988C2B80000000" , vfmadd132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9988C2B80000000" , vfmadd132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED98CB" , vfmadd132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED988C2B80000000" , vfmadd132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED988C2B80000000" , vfmadd132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26998CB" , vfmadd132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269988C2B80000000" , vfmadd132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269988C2B80000000" , vfmadd132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D98CB" , vfmadd132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D988C2B80000000" , vfmadd132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D988C2B80000000" , vfmadd132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E999CB" , vfmadd132sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9998C2B80000000" , vfmadd132sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9998C2B80000000" , vfmadd132sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26999CB" , vfmadd132ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269998C2B80000000" , vfmadd132ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269998C2B80000000" , vfmadd132ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A8CB" , vfmadd213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9A88C2B80000000" , vfmadd213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A88C2B80000000" , vfmadd213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA8CB" , vfmadd213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDA88C2B80000000" , vfmadd213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA88C2B80000000" , vfmadd213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A8CB" , vfmadd213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269A88C2B80000000" , vfmadd213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A88C2B80000000" , vfmadd213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA8CB" , vfmadd213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DA88C2B80000000" , vfmadd213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA88C2B80000000" , vfmadd213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A9CB" , vfmadd213sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9A98C2B80000000" , vfmadd213sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A98C2B80000000" , vfmadd213sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A9CB" , vfmadd213ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269A98C2B80000000" , vfmadd213ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A98C2B80000000" , vfmadd213ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B8CB" , vfmadd231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9B88C2B80000000" , vfmadd231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B88C2B80000000" , vfmadd231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB8CB" , vfmadd231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDB88C2B80000000" , vfmadd231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB88C2B80000000" , vfmadd231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B8CB" , vfmadd231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269B88C2B80000000" , vfmadd231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B88C2B80000000" , vfmadd231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB8CB" , vfmadd231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DB88C2B80000000" , vfmadd231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB88C2B80000000" , vfmadd231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B9CB" , vfmadd231sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9B98C2B80000000" , vfmadd231sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B98C2B80000000" , vfmadd231sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B9CB" , vfmadd231ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269B98C2B80000000" , vfmadd231ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B98C2B80000000" , vfmadd231ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E996CB" , vfmaddsub132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9968C2B80000000" , vfmaddsub132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9968C2B80000000" , vfmaddsub132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED96CB" , vfmaddsub132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED968C2B80000000" , vfmaddsub132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED968C2B80000000" , vfmaddsub132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26996CB" , vfmaddsub132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269968C2B80000000" , vfmaddsub132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269968C2B80000000" , vfmaddsub132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D96CB" , vfmaddsub132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D968C2B80000000" , vfmaddsub132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D968C2B80000000" , vfmaddsub132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A6CB" , vfmaddsub213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9A68C2B80000000" , vfmaddsub213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A68C2B80000000" , vfmaddsub213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA6CB" , vfmaddsub213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDA68C2B80000000" , vfmaddsub213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA68C2B80000000" , vfmaddsub213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A6CB" , vfmaddsub213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269A68C2B80000000" , vfmaddsub213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A68C2B80000000" , vfmaddsub213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA6CB" , vfmaddsub213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DA68C2B80000000" , vfmaddsub213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA68C2B80000000" , vfmaddsub213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B6CB" , vfmaddsub231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9B68C2B80000000" , vfmaddsub231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B68C2B80000000" , vfmaddsub231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB6CB" , vfmaddsub231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDB68C2B80000000" , vfmaddsub231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB68C2B80000000" , vfmaddsub231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B6CB" , vfmaddsub231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269B68C2B80000000" , vfmaddsub231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B68C2B80000000" , vfmaddsub231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB6CB" , vfmaddsub231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DB68C2B80000000" , vfmaddsub231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB68C2B80000000" , vfmaddsub231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99ACB" , vfmsub132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99A8C2B80000000" , vfmsub132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99A8C2B80000000" , vfmsub132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9ACB" , vfmsub132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED9A8C2B80000000" , vfmsub132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9A8C2B80000000" , vfmsub132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699ACB" , vfmsub132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699A8C2B80000000" , vfmsub132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699A8C2B80000000" , vfmsub132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9ACB" , vfmsub132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D9A8C2B80000000" , vfmsub132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9A8C2B80000000" , vfmsub132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99BCB" , vfmsub132sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99B8C2B80000000" , vfmsub132sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99B8C2B80000000" , vfmsub132sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699BCB" , vfmsub132ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699B8C2B80000000" , vfmsub132ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699B8C2B80000000" , vfmsub132ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AACB" , vfmsub213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AA8C2B80000000" , vfmsub213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AA8C2B80000000" , vfmsub213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAACB" , vfmsub213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDAA8C2B80000000" , vfmsub213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAA8C2B80000000" , vfmsub213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AACB" , vfmsub213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AA8C2B80000000" , vfmsub213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AA8C2B80000000" , vfmsub213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAACB" , vfmsub213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DAA8C2B80000000" , vfmsub213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAA8C2B80000000" , vfmsub213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9ABCB" , vfmsub213sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AB8C2B80000000" , vfmsub213sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AB8C2B80000000" , vfmsub213sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269ABCB" , vfmsub213ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AB8C2B80000000" , vfmsub213ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AB8C2B80000000" , vfmsub213ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BACB" , vfmsub231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BA8C2B80000000" , vfmsub231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BA8C2B80000000" , vfmsub231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBACB" , vfmsub231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDBA8C2B80000000" , vfmsub231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBA8C2B80000000" , vfmsub231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BACB" , vfmsub231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BA8C2B80000000" , vfmsub231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BA8C2B80000000" , vfmsub231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBACB" , vfmsub231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DBA8C2B80000000" , vfmsub231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBA8C2B80000000" , vfmsub231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BBCB" , vfmsub231sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BB8C2B80000000" , vfmsub231sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BB8C2B80000000" , vfmsub231sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BBCB" , vfmsub231ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BB8C2B80000000" , vfmsub231ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BB8C2B80000000" , vfmsub231ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E997CB" , vfmsubadd132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9978C2B80000000" , vfmsubadd132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9978C2B80000000" , vfmsubadd132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED97CB" , vfmsubadd132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED978C2B80000000" , vfmsubadd132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED978C2B80000000" , vfmsubadd132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26997CB" , vfmsubadd132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269978C2B80000000" , vfmsubadd132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269978C2B80000000" , vfmsubadd132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D97CB" , vfmsubadd132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D978C2B80000000" , vfmsubadd132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D978C2B80000000" , vfmsubadd132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A7CB" , vfmsubadd213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9A78C2B80000000" , vfmsubadd213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9A78C2B80000000" , vfmsubadd213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA7CB" , vfmsubadd213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDA78C2B80000000" , vfmsubadd213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDA78C2B80000000" , vfmsubadd213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A7CB" , vfmsubadd213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269A78C2B80000000" , vfmsubadd213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269A78C2B80000000" , vfmsubadd213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA7CB" , vfmsubadd213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DA78C2B80000000" , vfmsubadd213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DA78C2B80000000" , vfmsubadd213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B7CB" , vfmsubadd231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9B78C2B80000000" , vfmsubadd231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9B78C2B80000000" , vfmsubadd231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB7CB" , vfmsubadd231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDB78C2B80000000" , vfmsubadd231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDB78C2B80000000" , vfmsubadd231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B7CB" , vfmsubadd231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269B78C2B80000000" , vfmsubadd231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269B78C2B80000000" , vfmsubadd231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB7CB" , vfmsubadd231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DB78C2B80000000" , vfmsubadd231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DB78C2B80000000" , vfmsubadd231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99CCB" , vfnmadd132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99C8C2B80000000" , vfnmadd132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99C8C2B80000000" , vfnmadd132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9CCB" , vfnmadd132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED9C8C2B80000000" , vfnmadd132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9C8C2B80000000" , vfnmadd132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699CCB" , vfnmadd132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699C8C2B80000000" , vfnmadd132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699C8C2B80000000" , vfnmadd132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9CCB" , vfnmadd132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D9C8C2B80000000" , vfnmadd132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9C8C2B80000000" , vfnmadd132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99DCB" , vfnmadd132sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99D8C2B80000000" , vfnmadd132sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99D8C2B80000000" , vfnmadd132sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699DCB" , vfnmadd132ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699D8C2B80000000" , vfnmadd132ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699D8C2B80000000" , vfnmadd132ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9ACCB" , vfnmadd213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AC8C2B80000000" , vfnmadd213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AC8C2B80000000" , vfnmadd213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDACCB" , vfnmadd213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDAC8C2B80000000" , vfnmadd213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAC8C2B80000000" , vfnmadd213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269ACCB" , vfnmadd213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AC8C2B80000000" , vfnmadd213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AC8C2B80000000" , vfnmadd213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DACCB" , vfnmadd213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DAC8C2B80000000" , vfnmadd213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAC8C2B80000000" , vfnmadd213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9ADCB" , vfnmadd213sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AD8C2B80000000" , vfnmadd213sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AD8C2B80000000" , vfnmadd213sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269ADCB" , vfnmadd213ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AD8C2B80000000" , vfnmadd213ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AD8C2B80000000" , vfnmadd213ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BCCB" , vfnmadd231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BC8C2B80000000" , vfnmadd231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BC8C2B80000000" , vfnmadd231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBCCB" , vfnmadd231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDBC8C2B80000000" , vfnmadd231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBC8C2B80000000" , vfnmadd231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BCCB" , vfnmadd231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BC8C2B80000000" , vfnmadd231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BC8C2B80000000" , vfnmadd231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBCCB" , vfnmadd231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DBC8C2B80000000" , vfnmadd231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBC8C2B80000000" , vfnmadd231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BDCB" , vfnmadd231sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BD8C2B80000000" , vfnmadd231sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BD8C2B80000000" , vfnmadd231sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BDCB" , vfnmadd231ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BD8C2B80000000" , vfnmadd231ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BD8C2B80000000" , vfnmadd231ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99ECB" , vfnmsub132pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99E8C2B80000000" , vfnmsub132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99E8C2B80000000" , vfnmsub132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9ECB" , vfnmsub132pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2ED9E8C2B80000000" , vfnmsub132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2ED9E8C2B80000000" , vfnmsub132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699ECB" , vfnmsub132ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699E8C2B80000000" , vfnmsub132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699E8C2B80000000" , vfnmsub132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9ECB" , vfnmsub132ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26D9E8C2B80000000" , vfnmsub132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26D9E8C2B80000000" , vfnmsub132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99FCB" , vfnmsub132sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E99F8C2B80000000" , vfnmsub132sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E99F8C2B80000000" , vfnmsub132sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699FCB" , vfnmsub132ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2699F8C2B80000000" , vfnmsub132ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2699F8C2B80000000" , vfnmsub132ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AECB" , vfnmsub213pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AE8C2B80000000" , vfnmsub213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AE8C2B80000000" , vfnmsub213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAECB" , vfnmsub213pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDAE8C2B80000000" , vfnmsub213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDAE8C2B80000000" , vfnmsub213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AECB" , vfnmsub213ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AE8C2B80000000" , vfnmsub213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AE8C2B80000000" , vfnmsub213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAECB" , vfnmsub213ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DAE8C2B80000000" , vfnmsub213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DAE8C2B80000000" , vfnmsub213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AFCB" , vfnmsub213sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9AF8C2B80000000" , vfnmsub213sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9AF8C2B80000000" , vfnmsub213sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AFCB" , vfnmsub213ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269AF8C2B80000000" , vfnmsub213ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269AF8C2B80000000" , vfnmsub213ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BECB" , vfnmsub231pd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BE8C2B80000000" , vfnmsub231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BE8C2B80000000" , vfnmsub231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBECB" , vfnmsub231pd(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E2EDBE8C2B80000000" , vfnmsub231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2EDBE8C2B80000000" , vfnmsub231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BECB" , vfnmsub231ps(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BE8C2B80000000" , vfnmsub231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BE8C2B80000000" , vfnmsub231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBECB" , vfnmsub231ps(ymm1, ymm2, ymm3));
+ TEST_INSTRUCTION("C4E26DBE8C2B80000000" , vfnmsub231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E26DBE8C2B80000000" , vfnmsub231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BFCB" , vfnmsub231sd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E2E9BF8C2B80000000" , vfnmsub231sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E2E9BF8C2B80000000" , vfnmsub231sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BFCB" , vfnmsub231ss(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("C4E269BF8C2B80000000" , vfnmsub231ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("C4E269BF8C2B80000000" , vfnmsub231ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerFMA4(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("C4E3E969CC30" , vfmaddpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E9698C358000000030" , vfmaddpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E9698C358000000030" , vfmaddpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E369698C2B8000000060" , vfmaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E369698C2B8000000060" , vfmaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED69CC30" , vfmaddpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED698C358000000030" , vfmaddpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED698C358000000030" , vfmaddpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D698C2B8000000060" , vfmaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D698C2B8000000060" , vfmaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E968CC30" , vfmaddps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E9688C358000000030" , vfmaddps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E9688C358000000030" , vfmaddps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E369688C2B8000000060" , vfmaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E369688C2B8000000060" , vfmaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED68CC30" , vfmaddps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED688C358000000030" , vfmaddps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED688C358000000030" , vfmaddps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D688C2B8000000060" , vfmaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D688C2B8000000060" , vfmaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E96BCC30" , vfmaddsd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96B8C358000000030" , vfmaddsd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96B8C358000000030" , vfmaddsd(xmm1, xmm2, xmm3, qword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696B8C2B8000000060" , vfmaddsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696B8C2B8000000060" , vfmaddsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E96ACC30" , vfmaddss(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96A8C358000000030" , vfmaddss(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96A8C358000000030" , vfmaddss(xmm1, xmm2, xmm3, dword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696A8C2B8000000060" , vfmaddss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696A8C2B8000000060" , vfmaddss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E95DCC30" , vfmaddsubpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E95D8C358000000030" , vfmaddsubpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E95D8C358000000030" , vfmaddsubpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3695D8C2B8000000060" , vfmaddsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3695D8C2B8000000060" , vfmaddsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED5DCC30" , vfmaddsubpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED5D8C358000000030" , vfmaddsubpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED5D8C358000000030" , vfmaddsubpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D5D8C2B8000000060" , vfmaddsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D5D8C2B8000000060" , vfmaddsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E95CCC30" , vfmaddsubps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E95C8C358000000030" , vfmaddsubps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E95C8C358000000030" , vfmaddsubps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3695C8C2B8000000060" , vfmaddsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3695C8C2B8000000060" , vfmaddsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED5CCC30" , vfmaddsubps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED5C8C358000000030" , vfmaddsubps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED5C8C358000000030" , vfmaddsubps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D5C8C2B8000000060" , vfmaddsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D5C8C2B8000000060" , vfmaddsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E95FCC30" , vfmsubaddpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E95F8C358000000030" , vfmsubaddpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E95F8C358000000030" , vfmsubaddpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3695F8C2B8000000060" , vfmsubaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3695F8C2B8000000060" , vfmsubaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED5FCC30" , vfmsubaddpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED5F8C358000000030" , vfmsubaddpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED5F8C358000000030" , vfmsubaddpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D5F8C2B8000000060" , vfmsubaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D5F8C2B8000000060" , vfmsubaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E95ECC30" , vfmsubaddps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E95E8C358000000030" , vfmsubaddps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E95E8C358000000030" , vfmsubaddps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3695E8C2B8000000060" , vfmsubaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3695E8C2B8000000060" , vfmsubaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED5ECC30" , vfmsubaddps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED5E8C358000000030" , vfmsubaddps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED5E8C358000000030" , vfmsubaddps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D5E8C2B8000000060" , vfmsubaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D5E8C2B8000000060" , vfmsubaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E96DCC30" , vfmsubpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96D8C358000000030" , vfmsubpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96D8C358000000030" , vfmsubpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696D8C2B8000000060" , vfmsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696D8C2B8000000060" , vfmsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED6DCC30" , vfmsubpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED6D8C358000000030" , vfmsubpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED6D8C358000000030" , vfmsubpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D6D8C2B8000000060" , vfmsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D6D8C2B8000000060" , vfmsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E96CCC30" , vfmsubps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96C8C358000000030" , vfmsubps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96C8C358000000030" , vfmsubps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696C8C2B8000000060" , vfmsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696C8C2B8000000060" , vfmsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED6CCC30" , vfmsubps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED6C8C358000000030" , vfmsubps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED6C8C358000000030" , vfmsubps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D6C8C2B8000000060" , vfmsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D6C8C2B8000000060" , vfmsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E96FCC30" , vfmsubsd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96F8C358000000030" , vfmsubsd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96F8C358000000030" , vfmsubsd(xmm1, xmm2, xmm3, qword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696F8C2B8000000060" , vfmsubsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696F8C2B8000000060" , vfmsubsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E96ECC30" , vfmsubss(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E96E8C358000000030" , vfmsubss(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E96E8C358000000030" , vfmsubss(xmm1, xmm2, xmm3, dword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3696E8C2B8000000060" , vfmsubss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3696E8C2B8000000060" , vfmsubss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E979CC30" , vfnmaddpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E9798C358000000030" , vfnmaddpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E9798C358000000030" , vfnmaddpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E369798C2B8000000060" , vfnmaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E369798C2B8000000060" , vfnmaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED79CC30" , vfnmaddpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED798C358000000030" , vfnmaddpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED798C358000000030" , vfnmaddpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D798C2B8000000060" , vfnmaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D798C2B8000000060" , vfnmaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E978CC30" , vfnmaddps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E9788C358000000030" , vfnmaddps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E9788C358000000030" , vfnmaddps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E369788C2B8000000060" , vfnmaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E369788C2B8000000060" , vfnmaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED78CC30" , vfnmaddps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED788C358000000030" , vfnmaddps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED788C358000000030" , vfnmaddps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D788C2B8000000060" , vfnmaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D788C2B8000000060" , vfnmaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E97BCC30" , vfnmaddsd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97B8C358000000030" , vfnmaddsd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97B8C358000000030" , vfnmaddsd(xmm1, xmm2, xmm3, qword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697B8C2B8000000060" , vfnmaddsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697B8C2B8000000060" , vfnmaddsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E97ACC30" , vfnmaddss(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97A8C358000000030" , vfnmaddss(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97A8C358000000030" , vfnmaddss(xmm1, xmm2, xmm3, dword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697A8C2B8000000060" , vfnmaddss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697A8C2B8000000060" , vfnmaddss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E97DCC30" , vfnmsubpd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97D8C358000000030" , vfnmsubpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97D8C358000000030" , vfnmsubpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697D8C2B8000000060" , vfnmsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697D8C2B8000000060" , vfnmsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED7DCC30" , vfnmsubpd(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED7D8C358000000030" , vfnmsubpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED7D8C358000000030" , vfnmsubpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D7D8C2B8000000060" , vfnmsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D7D8C2B8000000060" , vfnmsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E97CCC30" , vfnmsubps(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97C8C358000000030" , vfnmsubps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97C8C358000000030" , vfnmsubps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697C8C2B8000000060" , vfnmsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697C8C2B8000000060" , vfnmsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3ED7CCC30" , vfnmsubps(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("C4E3ED7C8C358000000030" , vfnmsubps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3ED7C8C358000000030" , vfnmsubps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E36D7C8C2B8000000060" , vfnmsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E36D7C8C2B8000000060" , vfnmsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("C4E3E97FCC30" , vfnmsubsd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97F8C358000000030" , vfnmsubsd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97F8C358000000030" , vfnmsubsd(xmm1, xmm2, xmm3, qword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697F8C2B8000000060" , vfnmsubsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697F8C2B8000000060" , vfnmsubsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3E97ECC30" , vfnmsubss(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("C4E3E97E8C358000000030" , vfnmsubss(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3E97E8C358000000030" , vfnmsubss(xmm1, xmm2, xmm3, dword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("C4E3697E8C2B8000000060" , vfnmsubss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("C4E3697E8C2B8000000060" , vfnmsubss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), xmm6));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerXOP(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ TEST_INSTRUCTION("8FE97881CA" , vfrczpd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978818C1A80000000" , vfrczpd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978818C1A80000000" , vfrczpd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97C81CA" , vfrczpd(ymm1, ymm2));
+ TEST_INSTRUCTION("8FE97C818C1A80000000" , vfrczpd(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97C818C1A80000000" , vfrczpd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97880CA" , vfrczps(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978808C1A80000000" , vfrczps(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978808C1A80000000" , vfrczps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97C80CA" , vfrczps(ymm1, ymm2));
+ TEST_INSTRUCTION("8FE97C808C1A80000000" , vfrczps(ymm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97C808C1A80000000" , vfrczps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97883CA" , vfrczsd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978838C1A80000000" , vfrczsd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978838C1A80000000" , vfrczsd(xmm1, qword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE97882CA" , vfrczss(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978828C1A80000000" , vfrczss(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978828C1A80000000" , vfrczss(xmm1, dword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE868A2CB40" , vpcmov(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8E8A28C358000000030" , vpcmov(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("8FE8E8A28C358000000030" , vpcmov(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("8FE868A28C2B8000000060" , vpcmov(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A28C2B8000000060" , vpcmov(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86CA2CB40" , vpcmov(ymm1, ymm2, ymm3, ymm4));
+ TEST_INSTRUCTION("8FE8ECA28C358000000030" , vpcmov(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("8FE8ECA28C358000000030" , vpcmov(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("8FE86CA28C2B8000000060" , vpcmov(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("8FE86CA28C2B8000000060" , vpcmov(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
+ TEST_INSTRUCTION("8FE868CCCB01" , vpcomb(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868CC8C2B8000000001" , vpcomb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CC8C2B8000000001" , vpcomb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CECB01" , vpcomd(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868CE8C2B8000000001" , vpcomd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CE8C2B8000000001" , vpcomd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CFCB01" , vpcomq(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868CF8C2B8000000001" , vpcomq(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CF8C2B8000000001" , vpcomq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868ECCB01" , vpcomub(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868EC8C2B8000000001" , vpcomub(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EC8C2B8000000001" , vpcomub(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EECB01" , vpcomud(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868EE8C2B8000000001" , vpcomud(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EE8C2B8000000001" , vpcomud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EFCB01" , vpcomuq(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868EF8C2B8000000001" , vpcomuq(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EF8C2B8000000001" , vpcomuq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868EDCB01" , vpcomuw(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868ED8C2B8000000001" , vpcomuw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868ED8C2B8000000001" , vpcomuw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CDCB01" , vpcomw(xmm1, xmm2, xmm3, 1));
+ TEST_INSTRUCTION("8FE868CD8C2B8000000001" , vpcomw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE868CD8C2B8000000001" , vpcomw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
+ TEST_INSTRUCTION("8FE978C2CA" , vphaddbd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C28C1A80000000" , vphaddbd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C28C1A80000000" , vphaddbd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C3CA" , vphaddbq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C38C1A80000000" , vphaddbq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C38C1A80000000" , vphaddbq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C1CA" , vphaddbw(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C18C1A80000000" , vphaddbw(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C18C1A80000000" , vphaddbw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978CBCA" , vphadddq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978CB8C1A80000000" , vphadddq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978CB8C1A80000000" , vphadddq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D2CA" , vphaddubd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D28C1A80000000" , vphaddubd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D28C1A80000000" , vphaddubd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D3CA" , vphaddubq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D38C1A80000000" , vphaddubq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D38C1A80000000" , vphaddubq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D1CA" , vphaddubw(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D18C1A80000000" , vphaddubw(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D18C1A80000000" , vphaddubw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978DBCA" , vphaddudq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978DB8C1A80000000" , vphaddudq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978DB8C1A80000000" , vphaddudq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D6CA" , vphadduwd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D68C1A80000000" , vphadduwd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D68C1A80000000" , vphadduwd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D7CA" , vphadduwq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978D78C1A80000000" , vphadduwq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978D78C1A80000000" , vphadduwq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C6CA" , vphaddwd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C68C1A80000000" , vphaddwd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C68C1A80000000" , vphaddwd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C7CA" , vphaddwq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978C78C1A80000000" , vphaddwq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978C78C1A80000000" , vphaddwq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E1CA" , vphsubbw(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978E18C1A80000000" , vphsubbw(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E18C1A80000000" , vphsubbw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E3CA" , vphsubdq(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978E38C1A80000000" , vphsubdq(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E38C1A80000000" , vphsubdq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E2CA" , vphsubwd(xmm1, xmm2));
+ TEST_INSTRUCTION("8FE978E28C1A80000000" , vphsubwd(xmm1, ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE978E28C1A80000000" , vphsubwd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
+ TEST_INSTRUCTION("8FE8689ECB40" , vpmacsdd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8689E8C2B8000000060" , vpmacsdd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8689E8C2B8000000060" , vpmacsdd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8689FCB40" , vpmacsdqh(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8689F8C2B8000000060" , vpmacsdqh(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8689F8C2B8000000060" , vpmacsdqh(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86897CB40" , vpmacsdql(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868978C2B8000000060" , vpmacsdql(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868978C2B8000000060" , vpmacsdql(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8688ECB40" , vpmacssdd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8688E8C2B8000000060" , vpmacssdd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8688E8C2B8000000060" , vpmacssdd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8688FCB40" , vpmacssdqh(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8688F8C2B8000000060" , vpmacssdqh(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE8688F8C2B8000000060" , vpmacssdqh(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86887CB40" , vpmacssdql(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868878C2B8000000060" , vpmacssdql(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868878C2B8000000060" , vpmacssdql(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86886CB40" , vpmacsswd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868868C2B8000000060" , vpmacsswd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868868C2B8000000060" , vpmacsswd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86885CB40" , vpmacssww(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868858C2B8000000060" , vpmacssww(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868858C2B8000000060" , vpmacssww(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86896CB40" , vpmacswd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868968C2B8000000060" , vpmacswd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868968C2B8000000060" , vpmacswd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE86895CB40" , vpmacsww(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868958C2B8000000060" , vpmacsww(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868958C2B8000000060" , vpmacsww(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A6CB40" , vpmadcsswd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868A68C2B8000000060" , vpmadcsswd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A68C2B8000000060" , vpmadcsswd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868B6CB40" , vpmadcswd(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE868B68C2B8000000060" , vpmadcswd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868B68C2B8000000060" , vpmadcswd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A3CB40" , vpperm(xmm1, xmm2, xmm3, xmm4));
+ TEST_INSTRUCTION("8FE8E8A38C358000000030" , vpperm(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("8FE8E8A38C358000000030" , vpperm(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
+ TEST_INSTRUCTION("8FE868A38C2B8000000060" , vpperm(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE868A38C2B8000000060" , vpperm(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
+ TEST_INSTRUCTION("8FE96090CA" , vprotb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE878C0CA01" , vprotb(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("8FE9E8908C2B80000000" , vprotb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8908C2B80000000" , vprotb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958908C1A80000000" , vprotb(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C08C1A8000000001" , vprotb(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE958908C1A80000000" , vprotb(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C08C1A8000000001" , vprotb(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE96092CA" , vprotd(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE878C2CA01" , vprotd(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("8FE9E8928C2B80000000" , vprotd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8928C2B80000000" , vprotd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958928C1A80000000" , vprotd(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C28C1A8000000001" , vprotd(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE958928C1A80000000" , vprotd(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C28C1A8000000001" , vprotd(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE96093CA" , vprotq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE878C3CA01" , vprotq(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("8FE9E8938C2B80000000" , vprotq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8938C2B80000000" , vprotq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958938C1A80000000" , vprotq(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C38C1A8000000001" , vprotq(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE958938C1A80000000" , vprotq(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C38C1A8000000001" , vprotq(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE96091CA" , vprotw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE878C1CA01" , vprotw(xmm1, xmm2, 1));
+ TEST_INSTRUCTION("8FE9E8918C2B80000000" , vprotw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8918C2B80000000" , vprotw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958918C1A80000000" , vprotw(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C18C1A8000000001" , vprotw(xmm1, ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE958918C1A80000000" , vprotw(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE878C18C1A8000000001" , vprotw(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
+ TEST_INSTRUCTION("8FE96098CA" , vpshab(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8988C2B80000000" , vpshab(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8988C2B80000000" , vpshab(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958988C1A80000000" , vpshab(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958988C1A80000000" , vpshab(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE9609ACA" , vpshad(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E89A8C2B80000000" , vpshad(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E89A8C2B80000000" , vpshad(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9589A8C1A80000000" , vpshad(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE9589A8C1A80000000" , vpshad(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE9609BCA" , vpshaq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E89B8C2B80000000" , vpshaq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E89B8C2B80000000" , vpshaq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9589B8C1A80000000" , vpshaq(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE9589B8C1A80000000" , vpshaq(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96099CA" , vpshaw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8998C2B80000000" , vpshaw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8998C2B80000000" , vpshaw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958998C1A80000000" , vpshaw(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958998C1A80000000" , vpshaw(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96094CA" , vpshlb(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8948C2B80000000" , vpshlb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8948C2B80000000" , vpshlb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958948C1A80000000" , vpshlb(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958948C1A80000000" , vpshlb(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96096CA" , vpshld(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8968C2B80000000" , vpshld(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8968C2B80000000" , vpshld(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958968C1A80000000" , vpshld(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958968C1A80000000" , vpshld(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96097CA" , vpshlq(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8978C2B80000000" , vpshlq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8978C2B80000000" , vpshlq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958978C1A80000000" , vpshlq(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958978C1A80000000" , vpshlq(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE96095CA" , vpshlw(xmm1, xmm2, xmm3));
+ TEST_INSTRUCTION("8FE9E8958C2B80000000" , vpshlw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE9E8958C2B80000000" , vpshlw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
+ TEST_INSTRUCTION("8FE958958C1A80000000" , vpshlw(xmm1, ptr(edx, ebx, 0, 128), xmm4));
+ TEST_INSTRUCTION("8FE958958C1A80000000" , vpshlw(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
+}
+
+static void ASMJIT_NOINLINE testX86AssemblerAVX512(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
TEST_INSTRUCTION("C5ED4ACB" , kaddb(k1, k2, k3));
TEST_INSTRUCTION("C4E1ED4ACB" , kaddd(k1, k2, k3));
TEST_INSTRUCTION("C4E1EC4ACB" , kaddq(k1, k2, k3));
@@ -2614,84 +5031,24 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F25F48AA4C1A08" , v4fnmaddps(zmm1, zmm4, zmm5, zmm6, zmm7, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F25F08AB4C1A08" , v4fnmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F25F08AB4C1A08" , v4fnmaddss(xmm1, xmm4, xmm5, xmm6, xmm7, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5E958CB" , vaddpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9588C2B80000000" , vaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9588C2B80000000" , vaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED58CB" , vaddpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED588C2B80000000" , vaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED588C2B80000000" , vaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED4858CB" , vaddpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48584C2B02" , vaddpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48584C2B02" , vaddpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E858CB" , vaddps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8588C2B80000000" , vaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8588C2B80000000" , vaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC58CB" , vaddps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC588C2B80000000" , vaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC588C2B80000000" , vaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C4858CB" , vaddps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48584C2B02" , vaddps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C48584C2B02" , vaddps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB58CB" , vaddsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB588C2B80000000" , vaddsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB588C2B80000000" , vaddsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA58CB" , vaddss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA588C2B80000000" , vaddss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA588C2B80000000" , vaddss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D0CB" , vaddsubpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9D08C2B80000000" , vaddsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D08C2B80000000" , vaddsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD0CB" , vaddsubpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDD08C2B80000000" , vaddsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD08C2B80000000" , vaddsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EBD0CB" , vaddsubps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EBD08C2B80000000" , vaddsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EBD08C2B80000000" , vaddsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EFD0CB" , vaddsubps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EFD08C2B80000000" , vaddsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EFD08C2B80000000" , vaddsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269DECB" , vaesdec(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269DE8C2B80000000" , vaesdec(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269DE8C2B80000000" , vaesdec(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DDECB" , vaesdec(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DDE8C2B80000000" , vaesdec(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DDE8C2B80000000" , vaesdec(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48DECB" , vaesdec(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48DE4C2B02" , vaesdec(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48DE4C2B02" , vaesdec(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269DFCB" , vaesdeclast(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269DF8C2B80000000" , vaesdeclast(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269DF8C2B80000000" , vaesdeclast(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DDFCB" , vaesdeclast(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DDF8C2B80000000" , vaesdeclast(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DDF8C2B80000000" , vaesdeclast(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48DFCB" , vaesdeclast(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48DF4C2B02" , vaesdeclast(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48DF4C2B02" , vaesdeclast(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269DCCB" , vaesenc(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269DC8C2B80000000" , vaesenc(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269DC8C2B80000000" , vaesenc(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DDCCB" , vaesenc(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DDC8C2B80000000" , vaesenc(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DDC8C2B80000000" , vaesenc(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48DCCB" , vaesenc(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48DC4C2B02" , vaesenc(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48DC4C2B02" , vaesenc(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269DDCB" , vaesenclast(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269DD8C2B80000000" , vaesenclast(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269DD8C2B80000000" , vaesenclast(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DDDCB" , vaesenclast(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DDD8C2B80000000" , vaesenclast(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DDD8C2B80000000" , vaesenclast(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48DDCB" , vaesenclast(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48DD4C2B02" , vaesenclast(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48DD4C2B02" , vaesenclast(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E279DBCA" , vaesimc(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279DB8C1A80000000" , vaesimc(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279DB8C1A80000000" , vaesimc(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E379DFCA01" , vaeskeygenassist(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E379DF8C1A8000000001" , vaeskeygenassist(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E379DF8C1A8000000001" , vaeskeygenassist(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F36D0803CB01" , valignd(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08034C2B0801" , valignd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08034C2B0801" , valignd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
@@ -2710,39 +5067,15 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED4803CB01" , valignq(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48034C2B0201" , valignq(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48034C2B0201" , valignq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E955CB" , vandnpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9558C2B80000000" , vandnpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9558C2B80000000" , vandnpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED55CB" , vandnpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED558C2B80000000" , vandnpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED558C2B80000000" , vandnpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED4855CB" , vandnpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48554C2B02" , vandnpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48554C2B02" , vandnpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E855CB" , vandnps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8558C2B80000000" , vandnps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8558C2B80000000" , vandnps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC55CB" , vandnps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC558C2B80000000" , vandnps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC558C2B80000000" , vandnps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C4855CB" , vandnps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48554C2B02" , vandnps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C48554C2B02" , vandnps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E954CB" , vandpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9548C2B80000000" , vandpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9548C2B80000000" , vandpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED54CB" , vandpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED548C2B80000000" , vandpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED548C2B80000000" , vandpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED4854CB" , vandpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48544C2B02" , vandpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48544C2B02" , vandpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E854CB" , vandps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8548C2B80000000" , vandps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8548C2B80000000" , vandps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC54CB" , vandps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC548C2B80000000" , vandps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC548C2B80000000" , vandps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C4854CB" , vandps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48544C2B02" , vandps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C48544C2B02" , vandps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -2764,32 +5097,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D4865CB" , vblendmps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48654C2B02" , vblendmps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48654C2B02" , vblendmps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E3690DCB01" , vblendpd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690D8C2B8000000001" , vblendpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690D8C2B8000000001" , vblendpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0DCB01" , vblendpd(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D0D8C2B8000000001" , vblendpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0D8C2B8000000001" , vblendpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690CCB01" , vblendps(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690C8C2B8000000001" , vblendps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690C8C2B8000000001" , vblendps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0CCB01" , vblendps(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D0C8C2B8000000001" , vblendps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0C8C2B8000000001" , vblendps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3694BCB40" , vblendvpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3694B8C2B8000000060" , vblendvpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3694B8C2B8000000060" , vblendvpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E36D4BCB40" , vblendvpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E36D4B8C2B8000000060" , vblendvpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D4B8C2B8000000060" , vblendvpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3694ACB40" , vblendvps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3694A8C2B8000000060" , vblendvps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3694A8C2B8000000060" , vblendvps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E36D4ACB40" , vblendvps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E36D4A8C2B8000000060" , vblendvps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D4A8C2B8000000060" , vblendvps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E27D1A8C1A80000000" , vbroadcastf128(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1A8C1A80000000" , vbroadcastf128(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D2819CA" , vbroadcastf32x2(ymm1, xmm2));
TEST_INSTRUCTION("62F27D28194C1A10" , vbroadcastf32x2(ymm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D28194C1A10" , vbroadcastf32x2(ymm1, qword_ptr(edx, ebx, 0, 128)));
@@ -2808,8 +5115,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD481A4C1A08" , vbroadcastf64x2(zmm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD481B4C1A04" , vbroadcastf64x4(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD481B4C1A04" , vbroadcastf64x4(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D5A8C1A80000000" , vbroadcasti128(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D5A8C1A80000000" , vbroadcasti128(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D0859CA" , vbroadcasti32x2(xmm1, xmm2));
TEST_INSTRUCTION("62F27D08594C1A10" , vbroadcasti32x2(xmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D08594C1A10" , vbroadcasti32x2(xmm1, qword_ptr(edx, ebx, 0, 128)));
@@ -2831,69 +5136,36 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD485A4C1A08" , vbroadcasti64x2(zmm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD485B4C1A04" , vbroadcasti64x4(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD485B4C1A04" , vbroadcasti64x4(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D19CA" , vbroadcastsd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D198C1A80000000" , vbroadcastsd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D198C1A80000000" , vbroadcastsd(ymm1, qword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD4819CA" , vbroadcastsd(zmm1, xmm2));
TEST_INSTRUCTION("62F2FD48194C1A10" , vbroadcastsd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD48194C1A10" , vbroadcastsd(zmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27918CA" , vbroadcastss(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279188C1A80000000" , vbroadcastss(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279188C1A80000000" , vbroadcastss(xmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D18CA" , vbroadcastss(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D188C1A80000000" , vbroadcastss(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D188C1A80000000" , vbroadcastss(ymm1, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4818CA" , vbroadcastss(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48184C1A20" , vbroadcastss(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48184C1A20" , vbroadcastss(zmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5E9C2CB01" , vcmppd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5E9C28C2B8000000001" , vcmppd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C28C2B8000000001" , vcmppd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED08C2CB01" , vcmppd(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F1ED08C24C2B0801" , vcmppd(k1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED08C24C2B0801" , vcmppd(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5EDC2CB01" , vcmppd(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C5EDC28C2B8000000001" , vcmppd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5EDC28C2B8000000001" , vcmppd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED28C2CB01" , vcmppd(k1, ymm2, ymm3, 1));
TEST_INSTRUCTION("62F1ED28C24C2B0401" , vcmppd(k1, ymm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED28C24C2B0401" , vcmppd(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED48C2CB01" , vcmppd(k1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F1ED48C24C2B0201" , vcmppd(k1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F1ED48C24C2B0201" , vcmppd(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E8C2CB01" , vcmpps(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5E8C28C2B8000000001" , vcmpps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E8C28C2B8000000001" , vcmpps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F16C08C2CB01" , vcmpps(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F16C08C24C2B0801" , vcmpps(k1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F16C08C24C2B0801" , vcmpps(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5ECC2CB01" , vcmpps(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C5ECC28C2B8000000001" , vcmpps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5ECC28C2B8000000001" , vcmpps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F16C28C2CB01" , vcmpps(k1, ymm2, ymm3, 1));
TEST_INSTRUCTION("62F16C28C24C2B0401" , vcmpps(k1, ymm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F16C28C24C2B0401" , vcmpps(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F16C48C2CB01" , vcmpps(k1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F16C48C24C2B0201" , vcmpps(k1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F16C48C24C2B0201" , vcmpps(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5EBC2CB01" , vcmpsd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5EBC28C2B8000000001" , vcmpsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5EBC28C2B8000000001" , vcmpsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F1EF08C2CB01" , vcmpsd(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F1EF08C24C2B1001" , vcmpsd(k1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F1EF08C24C2B1001" , vcmpsd(k1, xmm2, qword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5EAC2CB01" , vcmpss(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5EAC28C2B8000000001" , vcmpss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5EAC28C2B8000000001" , vcmpss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F16E08C2CB01" , vcmpss(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F16E08C24C2B2001" , vcmpss(k1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F16E08C24C2B2001" , vcmpss(k1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5F92FCA" , vcomisd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F92F8C1A80000000" , vcomisd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F92F8C1A80000000" , vcomisd(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F82FCA" , vcomiss(xmm1, xmm2));
- TEST_INSTRUCTION("C5F82F8C1A80000000" , vcomiss(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F82F8C1A80000000" , vcomiss(xmm1, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD088AD1" , vcompresspd(xmm1, xmm2));
TEST_INSTRUCTION("62F2FD088A5C1110" , vcompresspd(ptr(ecx, edx, 0, 128), xmm3));
TEST_INSTRUCTION("62F2FD088A5C1110" , vcompresspd(xmmword_ptr(ecx, edx, 0, 128), xmm3));
@@ -2912,21 +5184,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27D488AD1" , vcompressps(zmm1, zmm2));
TEST_INSTRUCTION("62F27D488A5C1120" , vcompressps(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F27D488A5C1120" , vcompressps(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5FAE6CA" , vcvtdq2pd(xmm1, xmm2));
- TEST_INSTRUCTION("C5FAE68C1A80000000" , vcvtdq2pd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FAE68C1A80000000" , vcvtdq2pd(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FEE6CA" , vcvtdq2pd(ymm1, xmm2));
- TEST_INSTRUCTION("C5FEE68C1A80000000" , vcvtdq2pd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FEE68C1A80000000" , vcvtdq2pd(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E48E6CA" , vcvtdq2pd(zmm1, ymm2));
TEST_INSTRUCTION("62F17E48E64C1A04" , vcvtdq2pd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E48E64C1A04" , vcvtdq2pd(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F85BCA" , vcvtdq2ps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F85B8C1A80000000" , vcvtdq2ps(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F85B8C1A80000000" , vcvtdq2ps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC5BCA" , vcvtdq2ps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC5B8C1A80000000" , vcvtdq2ps(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC5B8C1A80000000" , vcvtdq2ps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C485BCA" , vcvtdq2ps(zmm1, zmm2));
TEST_INSTRUCTION("62F17C485B4C1A02" , vcvtdq2ps(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C485B4C1A02" , vcvtdq2ps(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
@@ -2946,17 +5206,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27E4872CA" , vcvtneps2bf16(ymm1, zmm2));
TEST_INSTRUCTION("62F27E48724C1A02" , vcvtneps2bf16(ymm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27E48724C1A02" , vcvtneps2bf16(ymm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FBE6CA" , vcvtpd2dq(xmm1, xmm2));
- TEST_INSTRUCTION("C5FFE6CA" , vcvtpd2dq(xmm1, ymm2));
- TEST_INSTRUCTION("C5FBE68C1A80000000" , vcvtpd2dq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FFE68C1A80000000" , vcvtpd2dq(xmm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FF48E6CA" , vcvtpd2dq(ymm1, zmm2));
TEST_INSTRUCTION("62F1FF48E64C1A02" , vcvtpd2dq(ymm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FF48E64C1A02" , vcvtpd2dq(ymm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F95ACA" , vcvtpd2ps(xmm1, xmm2));
- TEST_INSTRUCTION("C5FD5ACA" , vcvtpd2ps(xmm1, ymm2));
- TEST_INSTRUCTION("C5F95A8C1A80000000" , vcvtpd2ps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD5A8C1A80000000" , vcvtpd2ps(xmm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD485ACA" , vcvtpd2ps(ymm1, zmm2));
TEST_INSTRUCTION("62F1FD485A4C1A02" , vcvtpd2ps(ymm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD485A4C1A02" , vcvtpd2ps(ymm1, zmmword_ptr(edx, ebx, 0, 128)));
@@ -2985,39 +5237,15 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1FD4879CA" , vcvtpd2uqq(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48794C1A02" , vcvtpd2uqq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD48794C1A02" , vcvtpd2uqq(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27913CA" , vcvtph2ps(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279138C1A80000000" , vcvtph2ps(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279138C1A80000000" , vcvtph2ps(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D13CA" , vcvtph2ps(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D138C1A80000000" , vcvtph2ps(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D138C1A80000000" , vcvtph2ps(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4813CA" , vcvtph2ps(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48134C1A04" , vcvtph2ps(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48134C1A04" , vcvtph2ps(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F95BCA" , vcvtps2dq(xmm1, xmm2));
- TEST_INSTRUCTION("C5F95B8C1A80000000" , vcvtps2dq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F95B8C1A80000000" , vcvtps2dq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD5BCA" , vcvtps2dq(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD5B8C1A80000000" , vcvtps2dq(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD5B8C1A80000000" , vcvtps2dq(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17D485BCA" , vcvtps2dq(zmm1, zmm2));
TEST_INSTRUCTION("62F17D485B4C1A02" , vcvtps2dq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17D485B4C1A02" , vcvtps2dq(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F85ACA" , vcvtps2pd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F85A8C1A80000000" , vcvtps2pd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F85A8C1A80000000" , vcvtps2pd(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC5ACA" , vcvtps2pd(ymm1, xmm2));
- TEST_INSTRUCTION("C5FC5A8C1A80000000" , vcvtps2pd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC5A8C1A80000000" , vcvtps2pd(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C485ACA" , vcvtps2pd(zmm1, ymm2));
TEST_INSTRUCTION("62F17C485A4C1A04" , vcvtps2pd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C485A4C1A04" , vcvtps2pd(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E3791DD101" , vcvtps2ph(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E3791D9C118000000001" , vcvtps2ph(ptr(ecx, edx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E3791D9C118000000001" , vcvtps2ph(qword_ptr(ecx, edx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E37D1DD101" , vcvtps2ph(xmm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D1D9C118000000001" , vcvtps2ph(ptr(ecx, edx, 0, 128), ymm3, 1));
- TEST_INSTRUCTION("C4E37D1D9C118000000001" , vcvtps2ph(xmmword_ptr(ecx, edx, 0, 128), ymm3, 1));
TEST_INSTRUCTION("62F37D481DD101" , vcvtps2ph(ymm1, zmm2, 1));
TEST_INSTRUCTION("62F37D481D5C110401" , vcvtps2ph(ptr(ecx, edx, 0, 128), zmm3, 1));
TEST_INSTRUCTION("62F37D481D5C110401" , vcvtps2ph(ymmword_ptr(ecx, edx, 0, 128), zmm3, 1));
@@ -3064,36 +5292,12 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1FC485BCA" , vcvtqq2ps(ymm1, zmm2));
TEST_INSTRUCTION("62F1FC485B4C1A02" , vcvtqq2ps(ymm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FC485B4C1A02" , vcvtqq2ps(ymm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FB2DCA" , vcvtsd2si(ecx, xmm2));
- TEST_INSTRUCTION("C5FB2D8C1A80000000" , vcvtsd2si(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FB2D8C1A80000000" , vcvtsd2si(ecx, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5EB5ACB" , vcvtsd2ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5A8C2B80000000" , vcvtsd2ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB5A8C2B80000000" , vcvtsd2ss(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F17F0879CA" , vcvtsd2usi(ecx, xmm2));
TEST_INSTRUCTION("62F17F08794C1A10" , vcvtsd2usi(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17F08794C1A10" , vcvtsd2usi(ecx, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5EB2ACB" , vcvtsi2sd(xmm1, xmm2, ebx));
- TEST_INSTRUCTION("C5EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E1EB2A8C2B80000000" , vcvtsi2sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA2ACB" , vcvtsi2ss(xmm1, xmm2, ebx));
- TEST_INSTRUCTION("C5EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E1EA2A8C2B80000000" , vcvtsi2ss(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5ACB" , vcvtss2sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5A8C2B80000000" , vcvtss2sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5A8C2B80000000" , vcvtss2sd(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5FA2DCA" , vcvtss2si(ecx, xmm2));
- TEST_INSTRUCTION("C5FA2D8C1A80000000" , vcvtss2si(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA2D8C1A80000000" , vcvtss2si(ecx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E0879CA" , vcvtss2usi(ecx, xmm2));
TEST_INSTRUCTION("62F17E08794C1A20" , vcvtss2usi(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E08794C1A20" , vcvtss2usi(ecx, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F9E6CA" , vcvttpd2dq(xmm1, xmm2));
- TEST_INSTRUCTION("C5FDE6CA" , vcvttpd2dq(xmm1, ymm2));
- TEST_INSTRUCTION("C5F9E68C1A80000000" , vcvttpd2dq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FDE68C1A80000000" , vcvttpd2dq(xmm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD48E6CA" , vcvttpd2dq(ymm1, zmm2));
TEST_INSTRUCTION("62F1FD48E64C1A02" , vcvttpd2dq(ymm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD48E64C1A02" , vcvttpd2dq(ymm1, zmmword_ptr(edx, ebx, 0, 128)));
@@ -3122,12 +5326,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1FD4878CA" , vcvttpd2uqq(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48784C1A02" , vcvttpd2uqq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD48784C1A02" , vcvttpd2uqq(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA5BCA" , vcvttps2dq(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA5B8C1A80000000" , vcvttps2dq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA5B8C1A80000000" , vcvttps2dq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FE5BCA" , vcvttps2dq(ymm1, ymm2));
- TEST_INSTRUCTION("C5FE5B8C1A80000000" , vcvttps2dq(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FE5B8C1A80000000" , vcvttps2dq(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E485BCA" , vcvttps2dq(zmm1, zmm2));
TEST_INSTRUCTION("62F17E485B4C1A02" , vcvttps2dq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E485B4C1A02" , vcvttps2dq(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
@@ -3158,15 +5356,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F17D4878CA" , vcvttps2uqq(zmm1, ymm2));
TEST_INSTRUCTION("62F17D48784C1A04" , vcvttps2uqq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17D48784C1A04" , vcvttps2uqq(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FB2CCA" , vcvttsd2si(ecx, xmm2));
- TEST_INSTRUCTION("C5FB2C8C1A80000000" , vcvttsd2si(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FB2C8C1A80000000" , vcvttsd2si(ecx, qword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17F0878CA" , vcvttsd2usi(ecx, xmm2));
TEST_INSTRUCTION("62F17F08784C1A10" , vcvttsd2usi(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17F08784C1A10" , vcvttsd2usi(ecx, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA2CCA" , vcvttss2si(ecx, xmm2));
- TEST_INSTRUCTION("C5FA2C8C1A80000000" , vcvttss2si(ecx, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA2C8C1A80000000" , vcvttss2si(ecx, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E0878CA" , vcvttss2usi(ecx, xmm2));
TEST_INSTRUCTION("62F17E08784C1A20" , vcvttss2usi(ecx, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E08784C1A20" , vcvttss2usi(ecx, dword_ptr(edx, ebx, 0, 128)));
@@ -3207,11 +5399,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16F087BCB" , vcvtusi2sd(xmm1, xmm2, ebx));
TEST_INSTRUCTION("62F16F087B4C2B20" , vcvtusi2sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16F087B4C2B20" , vcvtusi2sd(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("62F1EF087B4C2B10" , vcvtusi2sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16E087BCB" , vcvtusi2ss(xmm1, xmm2, ebx));
TEST_INSTRUCTION("62F16E087B4C2B20" , vcvtusi2ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16E087B4C2B20" , vcvtusi2ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("62F1EE087B4C2B10" , vcvtusi2ss(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F36D0842CB01" , vdbpsadbw(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08424C2B0801" , vdbpsadbw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08424C2B0801" , vdbpsadbw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
@@ -3221,30 +5411,12 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D4842CB01" , vdbpsadbw(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F36D48424C2B0201" , vdbpsadbw(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D48424C2B0201" , vdbpsadbw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E95ECB" , vdivpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E95E8C2B80000000" , vdivpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E95E8C2B80000000" , vdivpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED5ECB" , vdivpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED5E8C2B80000000" , vdivpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED5E8C2B80000000" , vdivpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED485ECB" , vdivpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED485E4C2B02" , vdivpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED485E4C2B02" , vdivpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E85ECB" , vdivps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E85E8C2B80000000" , vdivps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E85E8C2B80000000" , vdivps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC5ECB" , vdivps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC5E8C2B80000000" , vdivps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC5E8C2B80000000" , vdivps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C485ECB" , vdivps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C485E4C2B02" , vdivps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C485E4C2B02" , vdivps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB5ECB" , vdivsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5E8C2B80000000" , vdivsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB5E8C2B80000000" , vdivsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5ECB" , vdivss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5E8C2B80000000" , vdivss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5E8C2B80000000" , vdivss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26E0852CB" , vdpbf16ps(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26E08524C2B08" , vdpbf16ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26E08524C2B08" , vdpbf16ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -3254,15 +5426,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26E4852CB" , vdpbf16ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26E48524C2B02" , vdpbf16ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26E48524C2B02" , vdpbf16ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E36941CB01" , vdppd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369418C2B8000000001" , vdppd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369418C2B8000000001" , vdppd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36940CB01" , vdpps(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369408C2B8000000001" , vdpps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369408C2B8000000001" , vdpps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D40CB01" , vdpps(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D408C2B8000000001" , vdpps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D408C2B8000000001" , vdpps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F2FD48C8CA" , vexp2pd(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48C84C1A02" , vexp2pd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD48C84C1A02" , vexp2pd(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
@@ -3287,9 +5450,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27D4888CA" , vexpandps(zmm1, zmm2));
TEST_INSTRUCTION("62F27D48884C1A20" , vexpandps(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48884C1A20" , vexpandps(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E37D19D101" , vextractf128(xmm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D199C118000000001" , vextractf128(ptr(ecx, edx, 0, 128), ymm3, 1));
- TEST_INSTRUCTION("C4E37D199C118000000001" , vextractf128(xmmword_ptr(ecx, edx, 0, 128), ymm3, 1));
TEST_INSTRUCTION("62F37D2819D101" , vextractf32x4(xmm1, ymm2, 1));
TEST_INSTRUCTION("62F37D4819D101" , vextractf32x4(xmm1, zmm2, 1));
TEST_INSTRUCTION("62F37D28195C110801" , vextractf32x4(ptr(ecx, edx, 0, 128), ymm3, 1));
@@ -3308,9 +5468,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3FD481BD101" , vextractf64x4(ymm1, zmm2, 1));
TEST_INSTRUCTION("62F3FD481B5C110401" , vextractf64x4(ptr(ecx, edx, 0, 128), zmm3, 1));
TEST_INSTRUCTION("62F3FD481B5C110401" , vextractf64x4(ymmword_ptr(ecx, edx, 0, 128), zmm3, 1));
- TEST_INSTRUCTION("C4E37D39D101" , vextracti128(xmm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D399C118000000001" , vextracti128(ptr(ecx, edx, 0, 128), ymm3, 1));
- TEST_INSTRUCTION("C4E37D399C118000000001" , vextracti128(xmmword_ptr(ecx, edx, 0, 128), ymm3, 1));
TEST_INSTRUCTION("62F37D2839D101" , vextracti32x4(xmm1, ymm2, 1));
TEST_INSTRUCTION("62F37D4839D101" , vextracti32x4(xmm1, zmm2, 1));
TEST_INSTRUCTION("62F37D28395C110801" , vextracti32x4(ptr(ecx, edx, 0, 128), ymm3, 1));
@@ -3329,9 +5486,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3FD483BD101" , vextracti64x4(ymm1, zmm2, 1));
TEST_INSTRUCTION("62F3FD483B5C110401" , vextracti64x4(ptr(ecx, edx, 0, 128), zmm3, 1));
TEST_INSTRUCTION("62F3FD483B5C110401" , vextracti64x4(ymmword_ptr(ecx, edx, 0, 128), zmm3, 1));
- TEST_INSTRUCTION("C4E37917D101" , vextractps(ecx, xmm2, 1));
- TEST_INSTRUCTION("C4E379179C118000000001" , vextractps(ptr(ecx, edx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E379179C118000000001" , vextractps(dword_ptr(ecx, edx, 0, 128), xmm3, 1));
TEST_INSTRUCTION("62F3ED0854CB01" , vfixupimmpd(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F3ED08544C2B0801" , vfixupimmpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED08544C2B0801" , vfixupimmpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
@@ -3356,562 +5510,114 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D0855CB01" , vfixupimmss(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08554C2B2001" , vfixupimmss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08554C2B2001" , vfixupimmss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E2E998CB" , vfmadd132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9988C2B80000000" , vfmadd132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9988C2B80000000" , vfmadd132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED98CB" , vfmadd132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED988C2B80000000" , vfmadd132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED988C2B80000000" , vfmadd132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED4898CB" , vfmadd132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48984C2B02" , vfmadd132pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48984C2B02" , vfmadd132pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26998CB" , vfmadd132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269988C2B80000000" , vfmadd132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269988C2B80000000" , vfmadd132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D98CB" , vfmadd132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D988C2B80000000" , vfmadd132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D988C2B80000000" , vfmadd132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4898CB" , vfmadd132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48984C2B02" , vfmadd132ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48984C2B02" , vfmadd132ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E999CB" , vfmadd132sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9998C2B80000000" , vfmadd132sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9998C2B80000000" , vfmadd132sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26999CB" , vfmadd132ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269998C2B80000000" , vfmadd132ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269998C2B80000000" , vfmadd132ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A8CB" , vfmadd213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9A88C2B80000000" , vfmadd213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A88C2B80000000" , vfmadd213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA8CB" , vfmadd213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDA88C2B80000000" , vfmadd213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA88C2B80000000" , vfmadd213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A8CB" , vfmadd213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48A84C2B02" , vfmadd213pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A84C2B02" , vfmadd213pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269A8CB" , vfmadd213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269A88C2B80000000" , vfmadd213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269A88C2B80000000" , vfmadd213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA8CB" , vfmadd213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DA88C2B80000000" , vfmadd213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA88C2B80000000" , vfmadd213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48A8CB" , vfmadd213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48A84C2B02" , vfmadd213ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48A84C2B02" , vfmadd213ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A9CB" , vfmadd213sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9A98C2B80000000" , vfmadd213sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A98C2B80000000" , vfmadd213sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269A9CB" , vfmadd213ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269A98C2B80000000" , vfmadd213ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269A98C2B80000000" , vfmadd213ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B8CB" , vfmadd231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9B88C2B80000000" , vfmadd231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B88C2B80000000" , vfmadd231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB8CB" , vfmadd231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDB88C2B80000000" , vfmadd231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB88C2B80000000" , vfmadd231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B8CB" , vfmadd231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48B84C2B02" , vfmadd231pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B84C2B02" , vfmadd231pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269B8CB" , vfmadd231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269B88C2B80000000" , vfmadd231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269B88C2B80000000" , vfmadd231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB8CB" , vfmadd231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DB88C2B80000000" , vfmadd231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB88C2B80000000" , vfmadd231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48B8CB" , vfmadd231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48B84C2B02" , vfmadd231ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48B84C2B02" , vfmadd231ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B9CB" , vfmadd231sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9B98C2B80000000" , vfmadd231sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B98C2B80000000" , vfmadd231sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269B9CB" , vfmadd231ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269B98C2B80000000" , vfmadd231ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269B98C2B80000000" , vfmadd231ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E3E969CC30" , vfmaddpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E9698C358000000030" , vfmaddpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E9698C358000000030" , vfmaddpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E369698C2B8000000060" , vfmaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E369698C2B8000000060" , vfmaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED69CC30" , vfmaddpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED698C358000000030" , vfmaddpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED698C358000000030" , vfmaddpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D698C2B8000000060" , vfmaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D698C2B8000000060" , vfmaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E968CC30" , vfmaddps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E9688C358000000030" , vfmaddps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E9688C358000000030" , vfmaddps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E369688C2B8000000060" , vfmaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E369688C2B8000000060" , vfmaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED68CC30" , vfmaddps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED688C358000000030" , vfmaddps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED688C358000000030" , vfmaddps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D688C2B8000000060" , vfmaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D688C2B8000000060" , vfmaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E96BCC30" , vfmaddsd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96B8C358000000030" , vfmaddsd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96B8C358000000030" , vfmaddsd(xmm1, xmm2, xmm3, qword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3696B8C2B8000000060" , vfmaddsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696B8C2B8000000060" , vfmaddsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3E96ACC30" , vfmaddss(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96A8C358000000030" , vfmaddss(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96A8C358000000030" , vfmaddss(xmm1, xmm2, xmm3, dword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3696A8C2B8000000060" , vfmaddss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696A8C2B8000000060" , vfmaddss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E2E996CB" , vfmaddsub132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9968C2B80000000" , vfmaddsub132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9968C2B80000000" , vfmaddsub132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED96CB" , vfmaddsub132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED968C2B80000000" , vfmaddsub132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED968C2B80000000" , vfmaddsub132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED4896CB" , vfmaddsub132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48964C2B02" , vfmaddsub132pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48964C2B02" , vfmaddsub132pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26996CB" , vfmaddsub132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269968C2B80000000" , vfmaddsub132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269968C2B80000000" , vfmaddsub132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D96CB" , vfmaddsub132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D968C2B80000000" , vfmaddsub132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D968C2B80000000" , vfmaddsub132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4896CB" , vfmaddsub132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48964C2B02" , vfmaddsub132ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48964C2B02" , vfmaddsub132ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A6CB" , vfmaddsub213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9A68C2B80000000" , vfmaddsub213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A68C2B80000000" , vfmaddsub213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA6CB" , vfmaddsub213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDA68C2B80000000" , vfmaddsub213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA68C2B80000000" , vfmaddsub213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A6CB" , vfmaddsub213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48A64C2B02" , vfmaddsub213pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A64C2B02" , vfmaddsub213pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269A6CB" , vfmaddsub213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269A68C2B80000000" , vfmaddsub213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269A68C2B80000000" , vfmaddsub213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA6CB" , vfmaddsub213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DA68C2B80000000" , vfmaddsub213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA68C2B80000000" , vfmaddsub213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48A6CB" , vfmaddsub213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48A64C2B02" , vfmaddsub213ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48A64C2B02" , vfmaddsub213ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B6CB" , vfmaddsub231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9B68C2B80000000" , vfmaddsub231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B68C2B80000000" , vfmaddsub231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB6CB" , vfmaddsub231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDB68C2B80000000" , vfmaddsub231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB68C2B80000000" , vfmaddsub231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B6CB" , vfmaddsub231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48B64C2B02" , vfmaddsub231pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B64C2B02" , vfmaddsub231pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269B6CB" , vfmaddsub231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269B68C2B80000000" , vfmaddsub231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269B68C2B80000000" , vfmaddsub231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB6CB" , vfmaddsub231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DB68C2B80000000" , vfmaddsub231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB68C2B80000000" , vfmaddsub231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48B6CB" , vfmaddsub231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48B64C2B02" , vfmaddsub231ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48B64C2B02" , vfmaddsub231ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E3E95DCC30" , vfmaddsubpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E95D8C358000000030" , vfmaddsubpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E95D8C358000000030" , vfmaddsubpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3695D8C2B8000000060" , vfmaddsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3695D8C2B8000000060" , vfmaddsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED5DCC30" , vfmaddsubpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED5D8C358000000030" , vfmaddsubpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED5D8C358000000030" , vfmaddsubpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D5D8C2B8000000060" , vfmaddsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D5D8C2B8000000060" , vfmaddsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E95CCC30" , vfmaddsubps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E95C8C358000000030" , vfmaddsubps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E95C8C358000000030" , vfmaddsubps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3695C8C2B8000000060" , vfmaddsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3695C8C2B8000000060" , vfmaddsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED5CCC30" , vfmaddsubps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED5C8C358000000030" , vfmaddsubps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED5C8C358000000030" , vfmaddsubps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D5C8C2B8000000060" , vfmaddsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D5C8C2B8000000060" , vfmaddsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E2E99ACB" , vfmsub132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99A8C2B80000000" , vfmsub132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99A8C2B80000000" , vfmsub132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9ACB" , vfmsub132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED9A8C2B80000000" , vfmsub132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9A8C2B80000000" , vfmsub132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED489ACB" , vfmsub132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED489A4C2B02" , vfmsub132pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED489A4C2B02" , vfmsub132pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699ACB" , vfmsub132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699A8C2B80000000" , vfmsub132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699A8C2B80000000" , vfmsub132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9ACB" , vfmsub132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D9A8C2B80000000" , vfmsub132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9A8C2B80000000" , vfmsub132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D489ACB" , vfmsub132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D489A4C2B02" , vfmsub132ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D489A4C2B02" , vfmsub132ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99BCB" , vfmsub132sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99B8C2B80000000" , vfmsub132sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99B8C2B80000000" , vfmsub132sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699BCB" , vfmsub132ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699B8C2B80000000" , vfmsub132ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699B8C2B80000000" , vfmsub132ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AACB" , vfmsub213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AA8C2B80000000" , vfmsub213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AA8C2B80000000" , vfmsub213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAACB" , vfmsub213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDAA8C2B80000000" , vfmsub213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAA8C2B80000000" , vfmsub213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AACB" , vfmsub213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48AA4C2B02" , vfmsub213pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AA4C2B02" , vfmsub213pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269AACB" , vfmsub213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AA8C2B80000000" , vfmsub213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269AA8C2B80000000" , vfmsub213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAACB" , vfmsub213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DAA8C2B80000000" , vfmsub213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAA8C2B80000000" , vfmsub213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48AACB" , vfmsub213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48AA4C2B02" , vfmsub213ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48AA4C2B02" , vfmsub213ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9ABCB" , vfmsub213sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AB8C2B80000000" , vfmsub213sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AB8C2B80000000" , vfmsub213sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269ABCB" , vfmsub213ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AB8C2B80000000" , vfmsub213ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269AB8C2B80000000" , vfmsub213ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BACB" , vfmsub231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BA8C2B80000000" , vfmsub231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BA8C2B80000000" , vfmsub231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBACB" , vfmsub231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDBA8C2B80000000" , vfmsub231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBA8C2B80000000" , vfmsub231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BACB" , vfmsub231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48BA4C2B02" , vfmsub231pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BA4C2B02" , vfmsub231pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BACB" , vfmsub231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BA8C2B80000000" , vfmsub231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BA8C2B80000000" , vfmsub231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBACB" , vfmsub231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DBA8C2B80000000" , vfmsub231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBA8C2B80000000" , vfmsub231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48BACB" , vfmsub231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48BA4C2B02" , vfmsub231ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48BA4C2B02" , vfmsub231ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BBCB" , vfmsub231sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BB8C2B80000000" , vfmsub231sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BB8C2B80000000" , vfmsub231sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BBCB" , vfmsub231ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BB8C2B80000000" , vfmsub231ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BB8C2B80000000" , vfmsub231ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E997CB" , vfmsubadd132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9978C2B80000000" , vfmsubadd132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9978C2B80000000" , vfmsubadd132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED97CB" , vfmsubadd132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED978C2B80000000" , vfmsubadd132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED978C2B80000000" , vfmsubadd132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED4897CB" , vfmsubadd132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48974C2B02" , vfmsubadd132pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48974C2B02" , vfmsubadd132pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26997CB" , vfmsubadd132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269978C2B80000000" , vfmsubadd132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269978C2B80000000" , vfmsubadd132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D97CB" , vfmsubadd132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D978C2B80000000" , vfmsubadd132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D978C2B80000000" , vfmsubadd132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4897CB" , vfmsubadd132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48974C2B02" , vfmsubadd132ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48974C2B02" , vfmsubadd132ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A7CB" , vfmsubadd213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9A78C2B80000000" , vfmsubadd213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9A78C2B80000000" , vfmsubadd213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA7CB" , vfmsubadd213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDA78C2B80000000" , vfmsubadd213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDA78C2B80000000" , vfmsubadd213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A7CB" , vfmsubadd213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48A74C2B02" , vfmsubadd213pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48A74C2B02" , vfmsubadd213pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269A7CB" , vfmsubadd213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269A78C2B80000000" , vfmsubadd213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269A78C2B80000000" , vfmsubadd213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA7CB" , vfmsubadd213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DA78C2B80000000" , vfmsubadd213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DA78C2B80000000" , vfmsubadd213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48A7CB" , vfmsubadd213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48A74C2B02" , vfmsubadd213ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48A74C2B02" , vfmsubadd213ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B7CB" , vfmsubadd231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9B78C2B80000000" , vfmsubadd231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9B78C2B80000000" , vfmsubadd231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB7CB" , vfmsubadd231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDB78C2B80000000" , vfmsubadd231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDB78C2B80000000" , vfmsubadd231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B7CB" , vfmsubadd231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48B74C2B02" , vfmsubadd231pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B74C2B02" , vfmsubadd231pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269B7CB" , vfmsubadd231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269B78C2B80000000" , vfmsubadd231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269B78C2B80000000" , vfmsubadd231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB7CB" , vfmsubadd231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DB78C2B80000000" , vfmsubadd231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DB78C2B80000000" , vfmsubadd231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48B7CB" , vfmsubadd231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48B74C2B02" , vfmsubadd231ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48B74C2B02" , vfmsubadd231ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E3E95FCC30" , vfmsubaddpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E95F8C358000000030" , vfmsubaddpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E95F8C358000000030" , vfmsubaddpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3695F8C2B8000000060" , vfmsubaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3695F8C2B8000000060" , vfmsubaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED5FCC30" , vfmsubaddpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED5F8C358000000030" , vfmsubaddpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED5F8C358000000030" , vfmsubaddpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D5F8C2B8000000060" , vfmsubaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D5F8C2B8000000060" , vfmsubaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E95ECC30" , vfmsubaddps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E95E8C358000000030" , vfmsubaddps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E95E8C358000000030" , vfmsubaddps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3695E8C2B8000000060" , vfmsubaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3695E8C2B8000000060" , vfmsubaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED5ECC30" , vfmsubaddps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED5E8C358000000030" , vfmsubaddps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED5E8C358000000030" , vfmsubaddps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D5E8C2B8000000060" , vfmsubaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D5E8C2B8000000060" , vfmsubaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E96DCC30" , vfmsubpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96D8C358000000030" , vfmsubpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96D8C358000000030" , vfmsubpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3696D8C2B8000000060" , vfmsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696D8C2B8000000060" , vfmsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED6DCC30" , vfmsubpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED6D8C358000000030" , vfmsubpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED6D8C358000000030" , vfmsubpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D6D8C2B8000000060" , vfmsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D6D8C2B8000000060" , vfmsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E96CCC30" , vfmsubps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96C8C358000000030" , vfmsubps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96C8C358000000030" , vfmsubps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3696C8C2B8000000060" , vfmsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696C8C2B8000000060" , vfmsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED6CCC30" , vfmsubps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED6C8C358000000030" , vfmsubps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED6C8C358000000030" , vfmsubps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D6C8C2B8000000060" , vfmsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D6C8C2B8000000060" , vfmsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E96FCC30" , vfmsubsd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96F8C358000000030" , vfmsubsd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96F8C358000000030" , vfmsubsd(xmm1, xmm2, xmm3, qword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3696F8C2B8000000060" , vfmsubsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696F8C2B8000000060" , vfmsubsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3E96ECC30" , vfmsubss(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E96E8C358000000030" , vfmsubss(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E96E8C358000000030" , vfmsubss(xmm1, xmm2, xmm3, dword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3696E8C2B8000000060" , vfmsubss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3696E8C2B8000000060" , vfmsubss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E2E99CCB" , vfnmadd132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99C8C2B80000000" , vfnmadd132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99C8C2B80000000" , vfnmadd132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9CCB" , vfnmadd132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED9C8C2B80000000" , vfnmadd132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9C8C2B80000000" , vfnmadd132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED489CCB" , vfnmadd132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED489C4C2B02" , vfnmadd132pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED489C4C2B02" , vfnmadd132pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699CCB" , vfnmadd132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699C8C2B80000000" , vfnmadd132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699C8C2B80000000" , vfnmadd132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9CCB" , vfnmadd132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D9C8C2B80000000" , vfnmadd132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9C8C2B80000000" , vfnmadd132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D489CCB" , vfnmadd132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D489C4C2B02" , vfnmadd132ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D489C4C2B02" , vfnmadd132ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99DCB" , vfnmadd132sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99D8C2B80000000" , vfnmadd132sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99D8C2B80000000" , vfnmadd132sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699DCB" , vfnmadd132ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699D8C2B80000000" , vfnmadd132ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699D8C2B80000000" , vfnmadd132ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9ACCB" , vfnmadd213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AC8C2B80000000" , vfnmadd213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AC8C2B80000000" , vfnmadd213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDACCB" , vfnmadd213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDAC8C2B80000000" , vfnmadd213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAC8C2B80000000" , vfnmadd213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48ACCB" , vfnmadd213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48AC4C2B02" , vfnmadd213pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AC4C2B02" , vfnmadd213pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269ACCB" , vfnmadd213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AC8C2B80000000" , vfnmadd213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269AC8C2B80000000" , vfnmadd213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DACCB" , vfnmadd213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DAC8C2B80000000" , vfnmadd213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAC8C2B80000000" , vfnmadd213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48ACCB" , vfnmadd213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48AC4C2B02" , vfnmadd213ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48AC4C2B02" , vfnmadd213ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9ADCB" , vfnmadd213sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AD8C2B80000000" , vfnmadd213sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AD8C2B80000000" , vfnmadd213sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269ADCB" , vfnmadd213ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AD8C2B80000000" , vfnmadd213ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269AD8C2B80000000" , vfnmadd213ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BCCB" , vfnmadd231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BC8C2B80000000" , vfnmadd231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BC8C2B80000000" , vfnmadd231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBCCB" , vfnmadd231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDBC8C2B80000000" , vfnmadd231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBC8C2B80000000" , vfnmadd231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BCCB" , vfnmadd231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48BC4C2B02" , vfnmadd231pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BC4C2B02" , vfnmadd231pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BCCB" , vfnmadd231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BC8C2B80000000" , vfnmadd231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BC8C2B80000000" , vfnmadd231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBCCB" , vfnmadd231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DBC8C2B80000000" , vfnmadd231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBC8C2B80000000" , vfnmadd231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48BCCB" , vfnmadd231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48BC4C2B02" , vfnmadd231ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48BC4C2B02" , vfnmadd231ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BDCB" , vfnmadd231sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BD8C2B80000000" , vfnmadd231sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BD8C2B80000000" , vfnmadd231sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BDCB" , vfnmadd231ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BD8C2B80000000" , vfnmadd231ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BD8C2B80000000" , vfnmadd231ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E3E979CC30" , vfnmaddpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E9798C358000000030" , vfnmaddpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E9798C358000000030" , vfnmaddpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E369798C2B8000000060" , vfnmaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E369798C2B8000000060" , vfnmaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED79CC30" , vfnmaddpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED798C358000000030" , vfnmaddpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED798C358000000030" , vfnmaddpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D798C2B8000000060" , vfnmaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D798C2B8000000060" , vfnmaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E978CC30" , vfnmaddps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E9788C358000000030" , vfnmaddps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E9788C358000000030" , vfnmaddps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E369788C2B8000000060" , vfnmaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E369788C2B8000000060" , vfnmaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED78CC30" , vfnmaddps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED788C358000000030" , vfnmaddps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED788C358000000030" , vfnmaddps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D788C2B8000000060" , vfnmaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D788C2B8000000060" , vfnmaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E97BCC30" , vfnmaddsd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97B8C358000000030" , vfnmaddsd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97B8C358000000030" , vfnmaddsd(xmm1, xmm2, xmm3, qword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3697B8C2B8000000060" , vfnmaddsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697B8C2B8000000060" , vfnmaddsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3E97ACC30" , vfnmaddss(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97A8C358000000030" , vfnmaddss(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97A8C358000000030" , vfnmaddss(xmm1, xmm2, xmm3, dword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3697A8C2B8000000060" , vfnmaddss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697A8C2B8000000060" , vfnmaddss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E2E99ECB" , vfnmsub132pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99E8C2B80000000" , vfnmsub132pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99E8C2B80000000" , vfnmsub132pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9ECB" , vfnmsub132pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED9E8C2B80000000" , vfnmsub132pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED9E8C2B80000000" , vfnmsub132pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED489ECB" , vfnmsub132pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED489E4C2B02" , vfnmsub132pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED489E4C2B02" , vfnmsub132pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699ECB" , vfnmsub132ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699E8C2B80000000" , vfnmsub132ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699E8C2B80000000" , vfnmsub132ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9ECB" , vfnmsub132ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D9E8C2B80000000" , vfnmsub132ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D9E8C2B80000000" , vfnmsub132ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D489ECB" , vfnmsub132ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D489E4C2B02" , vfnmsub132ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D489E4C2B02" , vfnmsub132ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99FCB" , vfnmsub132sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E99F8C2B80000000" , vfnmsub132sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E99F8C2B80000000" , vfnmsub132sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699FCB" , vfnmsub132ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2699F8C2B80000000" , vfnmsub132ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2699F8C2B80000000" , vfnmsub132ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AECB" , vfnmsub213pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AE8C2B80000000" , vfnmsub213pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AE8C2B80000000" , vfnmsub213pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAECB" , vfnmsub213pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDAE8C2B80000000" , vfnmsub213pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDAE8C2B80000000" , vfnmsub213pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AECB" , vfnmsub213pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48AE4C2B02" , vfnmsub213pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48AE4C2B02" , vfnmsub213pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269AECB" , vfnmsub213ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AE8C2B80000000" , vfnmsub213ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269AE8C2B80000000" , vfnmsub213ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAECB" , vfnmsub213ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DAE8C2B80000000" , vfnmsub213ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DAE8C2B80000000" , vfnmsub213ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48AECB" , vfnmsub213ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48AE4C2B02" , vfnmsub213ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48AE4C2B02" , vfnmsub213ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AFCB" , vfnmsub213sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9AF8C2B80000000" , vfnmsub213sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9AF8C2B80000000" , vfnmsub213sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269AFCB" , vfnmsub213ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269AF8C2B80000000" , vfnmsub213ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269AF8C2B80000000" , vfnmsub213ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BECB" , vfnmsub231pd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BE8C2B80000000" , vfnmsub231pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BE8C2B80000000" , vfnmsub231pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBECB" , vfnmsub231pd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2EDBE8C2B80000000" , vfnmsub231pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2EDBE8C2B80000000" , vfnmsub231pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BECB" , vfnmsub231pd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48BE4C2B02" , vfnmsub231pd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48BE4C2B02" , vfnmsub231pd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BECB" , vfnmsub231ps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BE8C2B80000000" , vfnmsub231ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BE8C2B80000000" , vfnmsub231ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBECB" , vfnmsub231ps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DBE8C2B80000000" , vfnmsub231ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DBE8C2B80000000" , vfnmsub231ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48BECB" , vfnmsub231ps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48BE4C2B02" , vfnmsub231ps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48BE4C2B02" , vfnmsub231ps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BFCB" , vfnmsub231sd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9BF8C2B80000000" , vfnmsub231sd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9BF8C2B80000000" , vfnmsub231sd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BFCB" , vfnmsub231ss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269BF8C2B80000000" , vfnmsub231ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269BF8C2B80000000" , vfnmsub231ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E3E97DCC30" , vfnmsubpd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97D8C358000000030" , vfnmsubpd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97D8C358000000030" , vfnmsubpd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3697D8C2B8000000060" , vfnmsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697D8C2B8000000060" , vfnmsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED7DCC30" , vfnmsubpd(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED7D8C358000000030" , vfnmsubpd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED7D8C358000000030" , vfnmsubpd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D7D8C2B8000000060" , vfnmsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D7D8C2B8000000060" , vfnmsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E97CCC30" , vfnmsubps(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97C8C358000000030" , vfnmsubps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97C8C358000000030" , vfnmsubps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3697C8C2B8000000060" , vfnmsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697C8C2B8000000060" , vfnmsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3ED7CCC30" , vfnmsubps(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E3ED7C8C358000000030" , vfnmsubps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3ED7C8C358000000030" , vfnmsubps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E36D7C8C2B8000000060" , vfnmsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D7C8C2B8000000060" , vfnmsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3E97FCC30" , vfnmsubsd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97F8C358000000030" , vfnmsubsd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97F8C358000000030" , vfnmsubsd(xmm1, xmm2, xmm3, qword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3697F8C2B8000000060" , vfnmsubsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697F8C2B8000000060" , vfnmsubsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3E97ECC30" , vfnmsubss(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3E97E8C358000000030" , vfnmsubss(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3E97E8C358000000030" , vfnmsubss(xmm1, xmm2, xmm3, dword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("C4E3697E8C2B8000000060" , vfnmsubss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3697E8C2B8000000060" , vfnmsubss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), xmm6));
TEST_INSTRUCTION("62F3FD0866CA01" , vfpclasspd(k1, xmm2, 1));
TEST_INSTRUCTION("62F3FD2866CA01" , vfpclasspd(k1, ymm2, 1));
TEST_INSTRUCTION("62F3FD4866CA01" , vfpclasspd(k1, zmm2, 1));
@@ -3930,31 +5636,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F37D0867CA01" , vfpclassss(k1, xmm2, 1));
TEST_INSTRUCTION("62F37D08674C1A2001" , vfpclassss(k1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F37D08674C1A2001" , vfpclassss(k1, dword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FE97881CA" , vfrczpd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978818C1A80000000" , vfrczpd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978818C1A80000000" , vfrczpd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97C81CA" , vfrczpd(ymm1, ymm2));
- TEST_INSTRUCTION("8FE97C818C1A80000000" , vfrczpd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97C818C1A80000000" , vfrczpd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97880CA" , vfrczps(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978808C1A80000000" , vfrczps(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978808C1A80000000" , vfrczps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97C80CA" , vfrczps(ymm1, ymm2));
- TEST_INSTRUCTION("8FE97C808C1A80000000" , vfrczps(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97C808C1A80000000" , vfrczps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97883CA" , vfrczsd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978838C1A80000000" , vfrczsd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978838C1A80000000" , vfrczsd(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE97882CA" , vfrczss(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978828C1A80000000" , vfrczss(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978828C1A80000000" , vfrczss(xmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2D9928C1A80000000" , vgatherdpd(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E2DD928C1A80000000" , vgatherdpd(ymm1, ptr(edx, xmm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F2FD09924C1A10" , k(k1).vgatherdpd(xmm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD29924C1A10" , k(k1).vgatherdpd(ymm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD49924C1A10" , k(k1).vgatherdpd(zmm1, ptr(edx, ymm3, 0, 128)));
- TEST_INSTRUCTION("C4E259928C1A80000000" , vgatherdps(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E25D928C1A80000000" , vgatherdps(ymm1, ptr(edx, ymm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F27D09924C1A20" , k(k1).vgatherdps(xmm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F27D29924C1A20" , k(k1).vgatherdps(ymm1, ptr(edx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F27D49924C1A20" , k(k1).vgatherdps(zmm1, ptr(edx, zmm3, 0, 128)));
@@ -3966,13 +5650,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27D49C6541120" , k(k1).vgatherpf1dps(ptr(ecx, zmm2, 0, 128)));
TEST_INSTRUCTION("62F2FD49C7541110" , k(k1).vgatherpf1qpd(ptr(ecx, zmm2, 0, 128)));
TEST_INSTRUCTION("62F27D49C7541120" , k(k1).vgatherpf1qps(ptr(ecx, zmm2, 0, 128)));
- TEST_INSTRUCTION("C4E2D9938C1A80000000" , vgatherqpd(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E2DD938C1A80000000" , vgatherqpd(ymm1, ptr(edx, ymm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F2FD09934C1A10" , k(k1).vgatherqpd(xmm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD29934C1A10" , k(k1).vgatherqpd(ymm1, ptr(edx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F2FD49934C1A10" , k(k1).vgatherqpd(zmm1, ptr(edx, zmm3, 0, 128)));
- TEST_INSTRUCTION("C4E259938C1A80000000" , vgatherqps(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E25D938C1A80000000" , vgatherqps(xmm1, ptr(edx, ymm3, 0, 128), xmm4));
TEST_INSTRUCTION("62F27D09934C1A20" , k(k1).vgatherqps(xmm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F27D29934C1A20" , k(k1).vgatherqps(xmm1, ptr(edx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F27D49934C1A20" , k(k1).vgatherqps(ymm1, ptr(edx, zmm3, 0, 128)));
@@ -4024,60 +5704,15 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D0827CB01" , vgetmantss(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08274C2B2001" , vgetmantss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08274C2B2001" , vgetmantss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9CFCB01" , vgf2p8affineinvqb(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3E9CF8C2B8000000001" , vgf2p8affineinvqb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9CF8C2B8000000001" , vgf2p8affineinvqb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3EDCFCB01" , vgf2p8affineinvqb(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E3EDCF8C2B8000000001" , vgf2p8affineinvqb(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3EDCF8C2B8000000001" , vgf2p8affineinvqb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48CFCB01" , vgf2p8affineinvqb(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48CF4C2B0201" , vgf2p8affineinvqb(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48CF4C2B0201" , vgf2p8affineinvqb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9CECB01" , vgf2p8affineqb(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3E9CE8C2B8000000001" , vgf2p8affineqb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9CE8C2B8000000001" , vgf2p8affineqb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3EDCECB01" , vgf2p8affineqb(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E3EDCE8C2B8000000001" , vgf2p8affineqb(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3EDCE8C2B8000000001" , vgf2p8affineqb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48CECB01" , vgf2p8affineqb(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48CE4C2B0201" , vgf2p8affineqb(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48CE4C2B0201" , vgf2p8affineqb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E269CFCB" , vgf2p8mulb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269CF8C2B80000000" , vgf2p8mulb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269CF8C2B80000000" , vgf2p8mulb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DCFCB" , vgf2p8mulb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26DCF8C2B80000000" , vgf2p8mulb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26DCF8C2B80000000" , vgf2p8mulb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48CFCB" , vgf2p8mulb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48CF4C2B02" , vgf2p8mulb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48CF4C2B02" , vgf2p8mulb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E97CCB" , vhaddpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E97C8C2B80000000" , vhaddpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E97C8C2B80000000" , vhaddpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED7CCB" , vhaddpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED7C8C2B80000000" , vhaddpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED7C8C2B80000000" , vhaddpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB7CCB" , vhaddps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB7C8C2B80000000" , vhaddps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB7C8C2B80000000" , vhaddps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EF7CCB" , vhaddps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EF7C8C2B80000000" , vhaddps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EF7C8C2B80000000" , vhaddps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E97DCB" , vhsubpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E97D8C2B80000000" , vhsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E97D8C2B80000000" , vhsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED7DCB" , vhsubpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED7D8C2B80000000" , vhsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED7D8C2B80000000" , vhsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB7DCB" , vhsubps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB7D8C2B80000000" , vhsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB7D8C2B80000000" , vhsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EF7DCB" , vhsubps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EF7D8C2B80000000" , vhsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EF7D8C2B80000000" , vhsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E36D18CB01" , vinsertf128(ymm1, ymm2, xmm3, 1));
- TEST_INSTRUCTION("C4E36D188C2B8000000001" , vinsertf128(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D188C2B8000000001" , vinsertf128(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D2818CB01" , vinsertf32x4(ymm1, ymm2, xmm3, 1));
TEST_INSTRUCTION("62F36D28184C2B0801" , vinsertf32x4(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D28184C2B0801" , vinsertf32x4(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
@@ -4096,9 +5731,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED481ACB01" , vinsertf64x4(zmm1, zmm2, ymm3, 1));
TEST_INSTRUCTION("62F3ED481A4C2B0401" , vinsertf64x4(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED481A4C2B0401" , vinsertf64x4(zmm1, zmm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D38CB01" , vinserti128(ymm1, ymm2, xmm3, 1));
- TEST_INSTRUCTION("C4E36D388C2B8000000001" , vinserti128(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D388C2B8000000001" , vinserti128(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D2838CB01" , vinserti32x4(ymm1, ymm2, xmm3, 1));
TEST_INSTRUCTION("62F36D28384C2B0801" , vinserti32x4(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D28384C2B0801" , vinserti32x4(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
@@ -4117,136 +5749,31 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED483ACB01" , vinserti64x4(zmm1, zmm2, ymm3, 1));
TEST_INSTRUCTION("62F3ED483A4C2B0401" , vinserti64x4(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED483A4C2B0401" , vinserti64x4(zmm1, zmm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36921CB01" , vinsertps(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369218C2B8000000001" , vinsertps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369218C2B8000000001" , vinsertps(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5FBF08C1A80000000" , vlddqu(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FBF08C1A80000000" , vlddqu(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FFF08C1A80000000" , vlddqu(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FFF08C1A80000000" , vlddqu(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F8AE941180000000" , vldmxcsr(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("C5F8AE941180000000" , vldmxcsr(dword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("C5F9F7CA" , vmaskmovdqu(xmm1, xmm2, ptr(edi)));
- TEST_INSTRUCTION("C5F9F7CA" , vmaskmovdqu(xmm1, xmm2, xmmword_ptr(edi)));
- TEST_INSTRUCTION("C4E2612FA41180000000" , vmaskmovpd(ptr(ecx, edx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2612FA41180000000" , vmaskmovpd(xmmword_ptr(ecx, edx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2652FA41180000000" , vmaskmovpd(ptr(ecx, edx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2652FA41180000000" , vmaskmovpd(ymmword_ptr(ecx, edx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2692D8C2B80000000" , vmaskmovpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2692D8C2B80000000" , vmaskmovpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2D8C2B80000000" , vmaskmovpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2D8C2B80000000" , vmaskmovpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2612EA41180000000" , vmaskmovps(ptr(ecx, edx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2612EA41180000000" , vmaskmovps(xmmword_ptr(ecx, edx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2652EA41180000000" , vmaskmovps(ptr(ecx, edx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2652EA41180000000" , vmaskmovps(ymmword_ptr(ecx, edx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2692C8C2B80000000" , vmaskmovps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2692C8C2B80000000" , vmaskmovps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2C8C2B80000000" , vmaskmovps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2C8C2B80000000" , vmaskmovps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E95FCB" , vmaxpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E95F8C2B80000000" , vmaxpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E95F8C2B80000000" , vmaxpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED5FCB" , vmaxpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED5F8C2B80000000" , vmaxpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED5F8C2B80000000" , vmaxpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED485FCB" , vmaxpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED485F4C2B02" , vmaxpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED485F4C2B02" , vmaxpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E85FCB" , vmaxps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E85F8C2B80000000" , vmaxps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E85F8C2B80000000" , vmaxps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC5FCB" , vmaxps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC5F8C2B80000000" , vmaxps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC5F8C2B80000000" , vmaxps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C485FCB" , vmaxps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C485F4C2B02" , vmaxps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C485F4C2B02" , vmaxps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB5FCB" , vmaxsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5F8C2B80000000" , vmaxsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB5F8C2B80000000" , vmaxsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5FCB" , vmaxss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5F8C2B80000000" , vmaxss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5F8C2B80000000" , vmaxss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E95DCB" , vminpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E95D8C2B80000000" , vminpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E95D8C2B80000000" , vminpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED5DCB" , vminpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED5D8C2B80000000" , vminpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED5D8C2B80000000" , vminpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED485DCB" , vminpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED485D4C2B02" , vminpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED485D4C2B02" , vminpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E85DCB" , vminps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E85D8C2B80000000" , vminps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E85D8C2B80000000" , vminps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC5DCB" , vminps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC5D8C2B80000000" , vminps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC5D8C2B80000000" , vminps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C485DCB" , vminps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C485D4C2B02" , vminps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C485D4C2B02" , vminps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB5DCB" , vminsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5D8C2B80000000" , vminsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB5D8C2B80000000" , vminsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5DCB" , vminss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5D8C2B80000000" , vminss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5D8C2B80000000" , vminss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5F928CA" , vmovapd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F9288C1A80000000" , vmovapd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F9288C1A80000000" , vmovapd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F9299C1180000000" , vmovapd(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9299C1180000000" , vmovapd(xmmword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FD28CA" , vmovapd(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD288C1A80000000" , vmovapd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD288C1A80000000" , vmovapd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD299C1180000000" , vmovapd(ptr(ecx, edx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FD299C1180000000" , vmovapd(ymmword_ptr(ecx, edx, 0, 128), ymm3));
TEST_INSTRUCTION("62F1FD4828CA" , vmovapd(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48284C1A02" , vmovapd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD48284C1A02" , vmovapd(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD48295C1102" , vmovapd(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F1FD48295C1102" , vmovapd(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5F828CA" , vmovaps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8288C1A80000000" , vmovaps(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F8288C1A80000000" , vmovaps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F8299C1180000000" , vmovaps(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F8299C1180000000" , vmovaps(xmmword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FC28CA" , vmovaps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC288C1A80000000" , vmovaps(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC288C1A80000000" , vmovaps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC299C1180000000" , vmovaps(ptr(ecx, edx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FC299C1180000000" , vmovaps(ymmword_ptr(ecx, edx, 0, 128), ymm3));
TEST_INSTRUCTION("62F17C4828CA" , vmovaps(zmm1, zmm2));
TEST_INSTRUCTION("62F17C48284C1A02" , vmovaps(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C48284C1A02" , vmovaps(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C48295C1102" , vmovaps(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F17C48295C1102" , vmovaps(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5F97ED1" , vmovd(ecx, xmm2));
- TEST_INSTRUCTION("C5F97E9C1180000000" , vmovd(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F97E9C1180000000" , vmovd(dword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F96ECA" , vmovd(xmm1, edx));
- TEST_INSTRUCTION("C5F96E8C1A80000000" , vmovd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F96E8C1A80000000" , vmovd(xmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FB12CA" , vmovddup(xmm1, xmm2));
- TEST_INSTRUCTION("C5FB128C1A80000000" , vmovddup(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FB128C1A80000000" , vmovddup(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FF12CA" , vmovddup(ymm1, ymm2));
- TEST_INSTRUCTION("C5FF128C1A80000000" , vmovddup(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FF128C1A80000000" , vmovddup(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FF4812CA" , vmovddup(zmm1, zmm2));
TEST_INSTRUCTION("62F1FF48124C1A02" , vmovddup(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FF48124C1A02" , vmovddup(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F96FCA" , vmovdqa(xmm1, xmm2));
- TEST_INSTRUCTION("C5F96F8C1A80000000" , vmovdqa(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F96F8C1A80000000" , vmovdqa(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F97F9C1180000000" , vmovdqa(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F97F9C1180000000" , vmovdqa(xmmword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FD6FCA" , vmovdqa(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD6F8C1A80000000" , vmovdqa(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD6F8C1A80000000" , vmovdqa(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD7F9C1180000000" , vmovdqa(ptr(ecx, edx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FD7F9C1180000000" , vmovdqa(ymmword_ptr(ecx, edx, 0, 128), ymm3));
TEST_INSTRUCTION("62F17D086FCA" , vmovdqa32(xmm1, xmm2));
TEST_INSTRUCTION("62F17D086F4C1A08" , vmovdqa32(xmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17D086F4C1A08" , vmovdqa32(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
@@ -4277,16 +5804,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1FD486F4C1A02" , vmovdqa64(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD487F5C1102" , vmovdqa64(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F1FD487F5C1102" , vmovdqa64(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5FA6FCA" , vmovdqu(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA6F8C1A80000000" , vmovdqu(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA6F8C1A80000000" , vmovdqu(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA7F9C1180000000" , vmovdqu(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FA7F9C1180000000" , vmovdqu(xmmword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FE6FCA" , vmovdqu(ymm1, ymm2));
- TEST_INSTRUCTION("C5FE6F8C1A80000000" , vmovdqu(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FE6F8C1A80000000" , vmovdqu(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FE7F9C1180000000" , vmovdqu(ptr(ecx, edx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FE7F9C1180000000" , vmovdqu(ymmword_ptr(ecx, edx, 0, 128), ymm3));
TEST_INSTRUCTION("62F1FF086FCA" , vmovdqu16(xmm1, xmm2));
TEST_INSTRUCTION("62F1FF086F4C1A08" , vmovdqu16(xmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FF086F4C1A08" , vmovdqu16(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
@@ -4347,160 +5864,39 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F17F486F4C1A02" , vmovdqu8(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17F487F5C1102" , vmovdqu8(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F17F487F5C1102" , vmovdqu8(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5E812CB" , vmovhlps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F9179C1180000000" , vmovhpd(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9179C1180000000" , vmovhpd(qword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5E9168C2B80000000" , vmovhpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9168C2B80000000" , vmovhpd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5F8179C1180000000" , vmovhps(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F8179C1180000000" , vmovhps(qword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5E8168C2B80000000" , vmovhps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8168C2B80000000" , vmovhps(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E816CB" , vmovlhps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F9139C1180000000" , vmovlpd(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9139C1180000000" , vmovlpd(qword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5E9128C2B80000000" , vmovlpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9128C2B80000000" , vmovlpd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5F8139C1180000000" , vmovlps(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F8139C1180000000" , vmovlps(qword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5E8128C2B80000000" , vmovlps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8128C2B80000000" , vmovlps(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5F950CA" , vmovmskpd(ecx, xmm2));
- TEST_INSTRUCTION("C5FD50CA" , vmovmskpd(ecx, ymm2));
- TEST_INSTRUCTION("C5F850CA" , vmovmskps(ecx, xmm2));
- TEST_INSTRUCTION("C5FC50CA" , vmovmskps(ecx, ymm2));
- TEST_INSTRUCTION("C5F9E79C1180000000" , vmovntdq(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9E79C1180000000" , vmovntdq(xmmword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FDE79C1180000000" , vmovntdq(ptr(ecx, edx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FDE79C1180000000" , vmovntdq(ymmword_ptr(ecx, edx, 0, 128), ymm3));
TEST_INSTRUCTION("62F17D48E75C1102" , vmovntdq(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F17D48E75C1102" , vmovntdq(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C4E2792A8C1A80000000" , vmovntdqa(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2792A8C1A80000000" , vmovntdqa(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D2A8C1A80000000" , vmovntdqa(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D2A8C1A80000000" , vmovntdqa(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D482A4C1A02" , vmovntdqa(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D482A4C1A02" , vmovntdqa(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F92B9C1180000000" , vmovntpd(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F92B9C1180000000" , vmovntpd(xmmword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FD2B9C1180000000" , vmovntpd(ptr(ecx, edx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FD2B9C1180000000" , vmovntpd(ymmword_ptr(ecx, edx, 0, 128), ymm3));
TEST_INSTRUCTION("62F1FD482B5C1102" , vmovntpd(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F1FD482B5C1102" , vmovntpd(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5F82B9C1180000000" , vmovntps(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F82B9C1180000000" , vmovntps(xmmword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FC2B9C1180000000" , vmovntps(ptr(ecx, edx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FC2B9C1180000000" , vmovntps(ymmword_ptr(ecx, edx, 0, 128), ymm3));
TEST_INSTRUCTION("62F17C482B5C1102" , vmovntps(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F17C482B5C1102" , vmovntps(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5FA7ECA" , vmovq(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA7E8C1A80000000" , vmovq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA7E8C1A80000000" , vmovq(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F9D69C1180000000" , vmovq(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9D69C1180000000" , vmovq(qword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FB119C1180000000" , vmovsd(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FB119C1180000000" , vmovsd(qword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FB108C1A80000000" , vmovsd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FB108C1A80000000" , vmovsd(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5EB10CB" , vmovsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5FA16CA" , vmovshdup(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA168C1A80000000" , vmovshdup(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA168C1A80000000" , vmovshdup(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FE16CA" , vmovshdup(ymm1, ymm2));
- TEST_INSTRUCTION("C5FE168C1A80000000" , vmovshdup(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FE168C1A80000000" , vmovshdup(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E4816CA" , vmovshdup(zmm1, zmm2));
TEST_INSTRUCTION("62F17E48164C1A02" , vmovshdup(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E48164C1A02" , vmovshdup(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA12CA" , vmovsldup(xmm1, xmm2));
- TEST_INSTRUCTION("C5FA128C1A80000000" , vmovsldup(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA128C1A80000000" , vmovsldup(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FE12CA" , vmovsldup(ymm1, ymm2));
- TEST_INSTRUCTION("C5FE128C1A80000000" , vmovsldup(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FE128C1A80000000" , vmovsldup(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E4812CA" , vmovsldup(zmm1, zmm2));
TEST_INSTRUCTION("62F17E48124C1A02" , vmovsldup(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17E48124C1A02" , vmovsldup(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA119C1180000000" , vmovss(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FA119C1180000000" , vmovss(dword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FA108C1A80000000" , vmovss(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FA108C1A80000000" , vmovss(xmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5EA10CB" , vmovss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F910CA" , vmovupd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F9108C1A80000000" , vmovupd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F9108C1A80000000" , vmovupd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F9119C1180000000" , vmovupd(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F9119C1180000000" , vmovupd(xmmword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FD10CA" , vmovupd(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD108C1A80000000" , vmovupd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD108C1A80000000" , vmovupd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD119C1180000000" , vmovupd(ptr(ecx, edx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FD119C1180000000" , vmovupd(ymmword_ptr(ecx, edx, 0, 128), ymm3));
TEST_INSTRUCTION("62F1FD4810CA" , vmovupd(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48104C1A02" , vmovupd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD48104C1A02" , vmovupd(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD48115C1102" , vmovupd(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F1FD48115C1102" , vmovupd(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C5F810CA" , vmovups(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8108C1A80000000" , vmovups(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F8108C1A80000000" , vmovups(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F8119C1180000000" , vmovups(ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5F8119C1180000000" , vmovups(xmmword_ptr(ecx, edx, 0, 128), xmm3));
- TEST_INSTRUCTION("C5FC10CA" , vmovups(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC108C1A80000000" , vmovups(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC108C1A80000000" , vmovups(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC119C1180000000" , vmovups(ptr(ecx, edx, 0, 128), ymm3));
- TEST_INSTRUCTION("C5FC119C1180000000" , vmovups(ymmword_ptr(ecx, edx, 0, 128), ymm3));
TEST_INSTRUCTION("62F17C4810CA" , vmovups(zmm1, zmm2));
TEST_INSTRUCTION("62F17C48104C1A02" , vmovups(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C48104C1A02" , vmovups(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C48115C1102" , vmovups(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F17C48115C1102" , vmovups(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C4E36942CB01" , vmpsadbw(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369428C2B8000000001" , vmpsadbw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369428C2B8000000001" , vmpsadbw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D42CB01" , vmpsadbw(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D428C2B8000000001" , vmpsadbw(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D428C2B8000000001" , vmpsadbw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E959CB" , vmulpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9598C2B80000000" , vmulpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9598C2B80000000" , vmulpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED59CB" , vmulpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED598C2B80000000" , vmulpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED598C2B80000000" , vmulpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED4859CB" , vmulpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48594C2B02" , vmulpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48594C2B02" , vmulpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E859CB" , vmulps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8598C2B80000000" , vmulps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8598C2B80000000" , vmulps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC59CB" , vmulps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC598C2B80000000" , vmulps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC598C2B80000000" , vmulps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C4859CB" , vmulps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48594C2B02" , vmulps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C48594C2B02" , vmulps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB59CB" , vmulsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB598C2B80000000" , vmulsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB598C2B80000000" , vmulsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA59CB" , vmulss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA598C2B80000000" , vmulss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA598C2B80000000" , vmulss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E956CB" , vorpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9568C2B80000000" , vorpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9568C2B80000000" , vorpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED56CB" , vorpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED568C2B80000000" , vorpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED568C2B80000000" , vorpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED4856CB" , vorpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48564C2B02" , vorpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48564C2B02" , vorpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E856CB" , vorps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8568C2B80000000" , vorps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8568C2B80000000" , vorps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC56CB" , vorps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC568C2B80000000" , vorps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC568C2B80000000" , vorps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C4856CB" , vorps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48564C2B02" , vorps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C48564C2B02" , vorps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -4526,21 +5922,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F25F48524C1A08" , vp4dpwssd(zmm1, zmm4, zmm5, zmm6, zmm7, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F25F48534C1A08" , vp4dpwssds(zmm1, zmm4, zmm5, zmm6, zmm7, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F25F48534C1A08" , vp4dpwssds(zmm1, zmm4, zmm5, zmm6, zmm7, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2791CCA" , vpabsb(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2791C8C1A80000000" , vpabsb(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2791C8C1A80000000" , vpabsb(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1CCA" , vpabsb(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D1C8C1A80000000" , vpabsb(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1C8C1A80000000" , vpabsb(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D481CCA" , vpabsb(zmm1, zmm2));
TEST_INSTRUCTION("62F27D481C4C1A02" , vpabsb(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D481C4C1A02" , vpabsb(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2791ECA" , vpabsd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2791E8C1A80000000" , vpabsd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2791E8C1A80000000" , vpabsd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1ECA" , vpabsd(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D1E8C1A80000000" , vpabsd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1E8C1A80000000" , vpabsd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D481ECA" , vpabsd(zmm1, zmm2));
TEST_INSTRUCTION("62F27D481E4C1A02" , vpabsd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D481E4C1A02" , vpabsd(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
@@ -4553,138 +5937,48 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD481FCA" , vpabsq(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD481F4C1A02" , vpabsq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD481F4C1A02" , vpabsq(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2791DCA" , vpabsw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2791D8C1A80000000" , vpabsw(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2791D8C1A80000000" , vpabsw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1DCA" , vpabsw(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D1D8C1A80000000" , vpabsw(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D1D8C1A80000000" , vpabsw(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D481DCA" , vpabsw(zmm1, zmm2));
TEST_INSTRUCTION("62F27D481D4C1A02" , vpabsw(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D481D4C1A02" , vpabsw(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5E96BCB" , vpackssdw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E96B8C2B80000000" , vpackssdw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E96B8C2B80000000" , vpackssdw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED6BCB" , vpackssdw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED6B8C2B80000000" , vpackssdw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED6B8C2B80000000" , vpackssdw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D486BCB" , vpackssdw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D486B4C2B02" , vpackssdw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D486B4C2B02" , vpackssdw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E963CB" , vpacksswb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9638C2B80000000" , vpacksswb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9638C2B80000000" , vpacksswb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED63CB" , vpacksswb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED638C2B80000000" , vpacksswb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED638C2B80000000" , vpacksswb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4863CB" , vpacksswb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48634C2B02" , vpacksswb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48634C2B02" , vpacksswb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2692BCB" , vpackusdw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2692B8C2B80000000" , vpackusdw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2692B8C2B80000000" , vpackusdw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2BCB" , vpackusdw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D2B8C2B80000000" , vpackusdw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D2B8C2B80000000" , vpackusdw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D482BCB" , vpackusdw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D482B4C2B02" , vpackusdw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D482B4C2B02" , vpackusdw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E967CB" , vpackuswb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9678C2B80000000" , vpackuswb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9678C2B80000000" , vpackuswb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED67CB" , vpackuswb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED678C2B80000000" , vpackuswb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED678C2B80000000" , vpackuswb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4867CB" , vpackuswb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48674C2B02" , vpackuswb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48674C2B02" , vpackuswb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FCCB" , vpaddb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FC8C2B80000000" , vpaddb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FC8C2B80000000" , vpaddb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFCCB" , vpaddb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFC8C2B80000000" , vpaddb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFC8C2B80000000" , vpaddb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48FCCB" , vpaddb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48FC4C2B02" , vpaddb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48FC4C2B02" , vpaddb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FECB" , vpaddd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FE8C2B80000000" , vpaddd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FE8C2B80000000" , vpaddd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFECB" , vpaddd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFE8C2B80000000" , vpaddd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFE8C2B80000000" , vpaddd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48FECB" , vpaddd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48FE4C2B02" , vpaddd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48FE4C2B02" , vpaddd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D4CB" , vpaddq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9D48C2B80000000" , vpaddq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D48C2B80000000" , vpaddq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD4CB" , vpaddq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDD48C2B80000000" , vpaddq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD48C2B80000000" , vpaddq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48D4CB" , vpaddq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48D44C2B02" , vpaddq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48D44C2B02" , vpaddq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9ECCB" , vpaddsb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EC8C2B80000000" , vpaddsb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9EC8C2B80000000" , vpaddsb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDECCB" , vpaddsb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEC8C2B80000000" , vpaddsb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEC8C2B80000000" , vpaddsb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48ECCB" , vpaddsb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48EC4C2B02" , vpaddsb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48EC4C2B02" , vpaddsb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9EDCB" , vpaddsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9ED8C2B80000000" , vpaddsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9ED8C2B80000000" , vpaddsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEDCB" , vpaddsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDED8C2B80000000" , vpaddsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDED8C2B80000000" , vpaddsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48EDCB" , vpaddsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48ED4C2B02" , vpaddsw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48ED4C2B02" , vpaddsw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DCCB" , vpaddusb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DC8C2B80000000" , vpaddusb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DC8C2B80000000" , vpaddusb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDCCB" , vpaddusb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDC8C2B80000000" , vpaddusb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDC8C2B80000000" , vpaddusb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48DCCB" , vpaddusb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DC4C2B02" , vpaddusb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48DC4C2B02" , vpaddusb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DDCB" , vpaddusw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DD8C2B80000000" , vpaddusw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DD8C2B80000000" , vpaddusw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDDCB" , vpaddusw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDD8C2B80000000" , vpaddusw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDD8C2B80000000" , vpaddusw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48DDCB" , vpaddusw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DD4C2B02" , vpaddusw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48DD4C2B02" , vpaddusw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FDCB" , vpaddw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FD8C2B80000000" , vpaddw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FD8C2B80000000" , vpaddw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFDCB" , vpaddw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFD8C2B80000000" , vpaddw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFD8C2B80000000" , vpaddw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48FDCB" , vpaddw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48FD4C2B02" , vpaddw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48FD4C2B02" , vpaddw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E3690FCB01" , vpalignr(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690F8C2B8000000001" , vpalignr(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690F8C2B8000000001" , vpalignr(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0FCB01" , vpalignr(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D0F8C2B8000000001" , vpalignr(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0F8C2B8000000001" , vpalignr(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D480FCB01" , vpalignr(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F36D480F4C2B0201" , vpalignr(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D480F4C2B0201" , vpalignr(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9DBCB" , vpand(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DB8C2B80000000" , vpand(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DB8C2B80000000" , vpand(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDBCB" , vpand(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDB8C2B80000000" , vpand(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDB8C2B80000000" , vpand(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08DBCB" , vpandd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08DB4C2B08" , vpandd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08DB4C2B08" , vpandd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -4694,12 +5988,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48DBCB" , vpandd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DB4C2B02" , vpandd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48DB4C2B02" , vpandd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DFCB" , vpandn(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DF8C2B80000000" , vpandn(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DF8C2B80000000" , vpandn(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDFCB" , vpandn(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDF8C2B80000000" , vpandn(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDF8C2B80000000" , vpandn(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08DFCB" , vpandnd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08DF4C2B08" , vpandnd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08DF4C2B08" , vpandnd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -4727,30 +6015,12 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48DBCB" , vpandq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48DB4C2B02" , vpandq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48DB4C2B02" , vpandq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E0CB" , vpavgb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E08C2B80000000" , vpavgb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E08C2B80000000" , vpavgb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE0CB" , vpavgb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE08C2B80000000" , vpavgb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE08C2B80000000" , vpavgb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E0CB" , vpavgb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E04C2B02" , vpavgb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E04C2B02" , vpavgb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E3CB" , vpavgw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E38C2B80000000" , vpavgw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E38C2B80000000" , vpavgw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE3CB" , vpavgw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE38C2B80000000" , vpavgw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE38C2B80000000" , vpavgw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E3CB" , vpavgw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E34C2B02" , vpavgw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E34C2B02" , vpavgw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E36902CB01" , vpblendd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369028C2B8000000001" , vpblendd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369028C2B8000000001" , vpblendd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D02CB01" , vpblendd(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D028C2B8000000001" , vpblendd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D028C2B8000000001" , vpblendd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F26D0866CB" , vpblendmb(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D08664C2B08" , vpblendmb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D08664C2B08" , vpblendmb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -4787,38 +6057,14 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4866CB" , vpblendmw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48664C2B02" , vpblendmw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48664C2B02" , vpblendmw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E3694CCB40" , vpblendvb(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("C4E3694C8C2B8000000060" , vpblendvb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E3694C8C2B8000000060" , vpblendvb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("C4E36D4CCB40" , vpblendvb(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("C4E36D4C8C2B8000000060" , vpblendvb(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E36D4C8C2B8000000060" , vpblendvb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("C4E3690ECB01" , vpblendw(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690E8C2B8000000001" , vpblendw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690E8C2B8000000001" , vpblendw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0ECB01" , vpblendw(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D0E8C2B8000000001" , vpblendw(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D0E8C2B8000000001" , vpblendw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F27D087ACA" , vpbroadcastb(xmm1, edx));
- TEST_INSTRUCTION("C4E27978CA" , vpbroadcastb(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279788C1A80000000" , vpbroadcastb(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279788C1A80000000" , vpbroadcastb(xmm1, byte_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D287ACA" , vpbroadcastb(ymm1, edx));
- TEST_INSTRUCTION("C4E27D78CA" , vpbroadcastb(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D788C1A80000000" , vpbroadcastb(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D788C1A80000000" , vpbroadcastb(ymm1, byte_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D487ACA" , vpbroadcastb(zmm1, edx));
TEST_INSTRUCTION("62F27D4878CA" , vpbroadcastb(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48788C1A80000000" , vpbroadcastb(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48788C1A80000000" , vpbroadcastb(zmm1, byte_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D087CCA" , vpbroadcastd(xmm1, edx));
- TEST_INSTRUCTION("C4E27958CA" , vpbroadcastd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279588C1A80000000" , vpbroadcastd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279588C1A80000000" , vpbroadcastd(xmm1, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D287CCA" , vpbroadcastd(ymm1, edx));
- TEST_INSTRUCTION("C4E27D58CA" , vpbroadcastd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D588C1A80000000" , vpbroadcastd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D588C1A80000000" , vpbroadcastd(ymm1, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D487CCA" , vpbroadcastd(zmm1, edx));
TEST_INSTRUCTION("62F27D4858CA" , vpbroadcastd(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48584C1A20" , vpbroadcastd(zmm1, ptr(edx, ebx, 0, 128)));
@@ -4829,46 +6075,18 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27E083ACA" , vpbroadcastmw2d(xmm1, k2));
TEST_INSTRUCTION("62F27E283ACA" , vpbroadcastmw2d(ymm1, k2));
TEST_INSTRUCTION("62F27E483ACA" , vpbroadcastmw2d(zmm1, k2));
- TEST_INSTRUCTION("C4E27959CA" , vpbroadcastq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279598C1A80000000" , vpbroadcastq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279598C1A80000000" , vpbroadcastq(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D59CA" , vpbroadcastq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D598C1A80000000" , vpbroadcastq(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D598C1A80000000" , vpbroadcastq(ymm1, qword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD4859CA" , vpbroadcastq(zmm1, xmm2));
TEST_INSTRUCTION("62F2FD48594C1A10" , vpbroadcastq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD48594C1A10" , vpbroadcastq(zmm1, qword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D087BCA" , vpbroadcastw(xmm1, edx));
- TEST_INSTRUCTION("C4E27979CA" , vpbroadcastw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279798C1A80000000" , vpbroadcastw(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279798C1A80000000" , vpbroadcastw(xmm1, word_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D287BCA" , vpbroadcastw(ymm1, edx));
- TEST_INSTRUCTION("C4E27D79CA" , vpbroadcastw(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D798C1A80000000" , vpbroadcastw(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D798C1A80000000" , vpbroadcastw(ymm1, word_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D487BCA" , vpbroadcastw(zmm1, edx));
TEST_INSTRUCTION("62F27D4879CA" , vpbroadcastw(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48794C1A40" , vpbroadcastw(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48794C1A40" , vpbroadcastw(zmm1, word_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E36944CB01" , vpclmulqdq(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E369448C2B8000000001" , vpclmulqdq(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369448C2B8000000001" , vpclmulqdq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D44CB01" , vpclmulqdq(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D448C2B8000000001" , vpclmulqdq(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D448C2B8000000001" , vpclmulqdq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D4844CB01" , vpclmulqdq(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F36D48444C2B0201" , vpclmulqdq(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D48444C2B0201" , vpclmulqdq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868A2CB40" , vpcmov(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8E8A28C358000000030" , vpcmov(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("8FE8E8A28C358000000030" , vpcmov(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("8FE868A28C2B8000000060" , vpcmov(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868A28C2B8000000060" , vpcmov(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86CA2CB40" , vpcmov(ymm1, ymm2, ymm3, ymm4));
- TEST_INSTRUCTION("8FE8ECA28C358000000030" , vpcmov(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("8FE8ECA28C358000000030" , vpcmov(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("8FE86CA28C2B8000000060" , vpcmov(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6));
- TEST_INSTRUCTION("8FE86CA28C2B8000000060" , vpcmov(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6));
TEST_INSTRUCTION("62F36D083FCB01" , vpcmpb(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D083F4C2B0801" , vpcmpb(k1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D083F4C2B0801" , vpcmpb(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
@@ -4887,138 +6105,78 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D481FCB01" , vpcmpd(k1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F36D481F4C2B0201" , vpcmpd(k1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D481F4C2B0201" , vpcmpd(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E974CB" , vpcmpeqb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9748C2B80000000" , vpcmpeqb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9748C2B80000000" , vpcmpeqb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D0874CB" , vpcmpeqb(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08744C2B08" , vpcmpeqb(k1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08744C2B08" , vpcmpeqb(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED74CB" , vpcmpeqb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED748C2B80000000" , vpcmpeqb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED748C2B80000000" , vpcmpeqb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D2874CB" , vpcmpeqb(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28744C2B04" , vpcmpeqb(k1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D28744C2B04" , vpcmpeqb(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4874CB" , vpcmpeqb(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48744C2B02" , vpcmpeqb(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48744C2B02" , vpcmpeqb(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E976CB" , vpcmpeqd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9768C2B80000000" , vpcmpeqd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9768C2B80000000" , vpcmpeqd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D0876CB" , vpcmpeqd(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08764C2B08" , vpcmpeqd(k1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08764C2B08" , vpcmpeqd(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED76CB" , vpcmpeqd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED768C2B80000000" , vpcmpeqd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED768C2B80000000" , vpcmpeqd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D2876CB" , vpcmpeqd(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28764C2B04" , vpcmpeqd(k1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D28764C2B04" , vpcmpeqd(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4876CB" , vpcmpeqd(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48764C2B02" , vpcmpeqd(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48764C2B02" , vpcmpeqd(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26929CB" , vpcmpeqq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269298C2B80000000" , vpcmpeqq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269298C2B80000000" , vpcmpeqq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED0829CB" , vpcmpeqq(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F2ED08294C2B08" , vpcmpeqq(k1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED08294C2B08" , vpcmpeqq(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D29CB" , vpcmpeqq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D298C2B80000000" , vpcmpeqq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D298C2B80000000" , vpcmpeqq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED2829CB" , vpcmpeqq(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F2ED28294C2B04" , vpcmpeqq(k1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED28294C2B04" , vpcmpeqq(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED4829CB" , vpcmpeqq(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48294C2B02" , vpcmpeqq(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48294C2B02" , vpcmpeqq(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E975CB" , vpcmpeqw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9758C2B80000000" , vpcmpeqw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9758C2B80000000" , vpcmpeqw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D0875CB" , vpcmpeqw(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08754C2B08" , vpcmpeqw(k1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08754C2B08" , vpcmpeqw(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED75CB" , vpcmpeqw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED758C2B80000000" , vpcmpeqw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED758C2B80000000" , vpcmpeqw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D2875CB" , vpcmpeqw(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28754C2B04" , vpcmpeqw(k1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D28754C2B04" , vpcmpeqw(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4875CB" , vpcmpeqw(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48754C2B02" , vpcmpeqw(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48754C2B02" , vpcmpeqw(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E37961CA01" , vpcmpestri(xmm1, xmm2, 1, ecx, eax, edx));
- TEST_INSTRUCTION("C4E379618C1A8000000001" , vpcmpestri(xmm1, ptr(edx, ebx, 0, 128), 1, ecx, eax, edx));
- TEST_INSTRUCTION("C4E379618C1A8000000001" , vpcmpestri(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1, ecx, eax, edx));
- TEST_INSTRUCTION("C4E37960CA01" , vpcmpestrm(xmm1, xmm2, 1, xmm0, eax, edx));
- TEST_INSTRUCTION("C4E379608C1A8000000001" , vpcmpestrm(xmm1, ptr(edx, ebx, 0, 128), 1, xmm0, eax, edx));
- TEST_INSTRUCTION("C4E379608C1A8000000001" , vpcmpestrm(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1, xmm0, eax, edx));
- TEST_INSTRUCTION("C5E964CB" , vpcmpgtb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9648C2B80000000" , vpcmpgtb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9648C2B80000000" , vpcmpgtb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D0864CB" , vpcmpgtb(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08644C2B08" , vpcmpgtb(k1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08644C2B08" , vpcmpgtb(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED64CB" , vpcmpgtb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED648C2B80000000" , vpcmpgtb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED648C2B80000000" , vpcmpgtb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D2864CB" , vpcmpgtb(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28644C2B04" , vpcmpgtb(k1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D28644C2B04" , vpcmpgtb(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4864CB" , vpcmpgtb(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48644C2B02" , vpcmpgtb(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48644C2B02" , vpcmpgtb(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E966CB" , vpcmpgtd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9668C2B80000000" , vpcmpgtd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9668C2B80000000" , vpcmpgtd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D0866CB" , vpcmpgtd(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08664C2B08" , vpcmpgtd(k1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08664C2B08" , vpcmpgtd(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED66CB" , vpcmpgtd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED668C2B80000000" , vpcmpgtd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED668C2B80000000" , vpcmpgtd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D2866CB" , vpcmpgtd(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28664C2B04" , vpcmpgtd(k1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D28664C2B04" , vpcmpgtd(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4866CB" , vpcmpgtd(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48664C2B02" , vpcmpgtd(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48664C2B02" , vpcmpgtd(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26937CB" , vpcmpgtq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269378C2B80000000" , vpcmpgtq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269378C2B80000000" , vpcmpgtq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED0837CB" , vpcmpgtq(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F2ED08374C2B08" , vpcmpgtq(k1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED08374C2B08" , vpcmpgtq(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D37CB" , vpcmpgtq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D378C2B80000000" , vpcmpgtq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D378C2B80000000" , vpcmpgtq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED2837CB" , vpcmpgtq(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F2ED28374C2B04" , vpcmpgtq(k1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED28374C2B04" , vpcmpgtq(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED4837CB" , vpcmpgtq(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48374C2B02" , vpcmpgtq(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48374C2B02" , vpcmpgtq(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E965CB" , vpcmpgtw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9658C2B80000000" , vpcmpgtw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9658C2B80000000" , vpcmpgtw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D0865CB" , vpcmpgtw(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08654C2B08" , vpcmpgtw(k1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08654C2B08" , vpcmpgtw(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED65CB" , vpcmpgtw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED658C2B80000000" , vpcmpgtw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED658C2B80000000" , vpcmpgtw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D2865CB" , vpcmpgtw(k1, ymm2, ymm3));
TEST_INSTRUCTION("62F16D28654C2B04" , vpcmpgtw(k1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D28654C2B04" , vpcmpgtw(k1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4865CB" , vpcmpgtw(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48654C2B02" , vpcmpgtw(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48654C2B02" , vpcmpgtw(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E37963CA01" , vpcmpistri(xmm1, xmm2, 1, ecx));
- TEST_INSTRUCTION("C4E379638C1A8000000001" , vpcmpistri(xmm1, ptr(edx, ebx, 0, 128), 1, ecx));
- TEST_INSTRUCTION("C4E379638C1A8000000001" , vpcmpistri(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1, ecx));
- TEST_INSTRUCTION("C4E37962CA01" , vpcmpistrm(xmm1, xmm2, 1, xmm0));
- TEST_INSTRUCTION("C4E379628C1A8000000001" , vpcmpistrm(xmm1, ptr(edx, ebx, 0, 128), 1, xmm0));
- TEST_INSTRUCTION("C4E379628C1A8000000001" , vpcmpistrm(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1, xmm0));
TEST_INSTRUCTION("62F3ED081FCB01" , vpcmpq(k1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F3ED081F4C2B0801" , vpcmpq(k1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED081F4C2B0801" , vpcmpq(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
@@ -5073,12 +6231,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED483FCB01" , vpcmpw(k1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED483F4C2B0201" , vpcmpw(k1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED483F4C2B0201" , vpcmpw(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CCCB01" , vpcomb(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868CC8C2B8000000001" , vpcomb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CC8C2B8000000001" , vpcomb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CECB01" , vpcomd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868CE8C2B8000000001" , vpcomd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CE8C2B8000000001" , vpcomd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F27D0863D1" , vpcompressb(xmm1, xmm2));
TEST_INSTRUCTION("62F27D08639C1180000000" , vpcompressb(ptr(ecx, edx, 0, 128), xmm3));
TEST_INSTRUCTION("62F27D08639C1180000000" , vpcompressb(xmmword_ptr(ecx, edx, 0, 128), xmm3));
@@ -5115,24 +6267,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD4863D1" , vpcompressw(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48635C1140" , vpcompressw(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F2FD48635C1140" , vpcompressw(zmmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("8FE868CFCB01" , vpcomq(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868CF8C2B8000000001" , vpcomq(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CF8C2B8000000001" , vpcomq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868ECCB01" , vpcomub(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868EC8C2B8000000001" , vpcomub(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EC8C2B8000000001" , vpcomub(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EECB01" , vpcomud(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868EE8C2B8000000001" , vpcomud(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EE8C2B8000000001" , vpcomud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EFCB01" , vpcomuq(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868EF8C2B8000000001" , vpcomuq(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EF8C2B8000000001" , vpcomuq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868EDCB01" , vpcomuw(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868ED8C2B8000000001" , vpcomuw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868ED8C2B8000000001" , vpcomuw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CDCB01" , vpcomw(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("8FE868CD8C2B8000000001" , vpcomw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE868CD8C2B8000000001" , vpcomw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F27D08C4CA" , vpconflictd(xmm1, xmm2));
TEST_INSTRUCTION("62F27D08C44C1A08" , vpconflictd(xmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D08C44C1A08" , vpconflictd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
@@ -5187,12 +6321,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D4853CB" , vpdpwssds(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48534C2B02" , vpdpwssds(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48534C2B02" , vpdpwssds(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E36D06CB01" , vperm2f128(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D068C2B8000000001" , vperm2f128(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D068C2B8000000001" , vperm2f128(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D46CB01" , vperm2i128(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C4E36D468C2B8000000001" , vperm2i128(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D468C2B8000000001" , vperm2i128(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F26D088DCB" , vpermb(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D088D4C2B08" , vpermb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D088D4C2B08" , vpermb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -5202,9 +6330,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D488DCB" , vpermb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D488D4C2B02" , vpermb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D488D4C2B02" , vpermb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D36CB" , vpermd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D368C2B80000000" , vpermd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D368C2B80000000" , vpermd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4836CB" , vpermd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48364C2B02" , vpermd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48364C2B02" , vpermd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -5262,65 +6387,18 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4875CB" , vpermi2w(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48754C2B02" , vpermi2w(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48754C2B02" , vpermi2w(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E36949CB41" , vpermil2pd(xmm1, xmm2, xmm3, xmm4, 1));
- TEST_INSTRUCTION("C4E369498C2B8000000061" , vpermil2pd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6, 1));
- TEST_INSTRUCTION("C4E369498C2B8000000061" , vpermil2pd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6, 1));
- TEST_INSTRUCTION("C4E3E9498C358000000031" , vpermil2pd(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9498C358000000031" , vpermil2pd(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D49CB41" , vpermil2pd(ymm1, ymm2, ymm3, ymm4, 1));
- TEST_INSTRUCTION("C4E36D498C2B8000000061" , vpermil2pd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6, 1));
- TEST_INSTRUCTION("C4E36D498C2B8000000061" , vpermil2pd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6, 1));
- TEST_INSTRUCTION("C4E3ED498C358000000031" , vpermil2pd(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128), 1));
- TEST_INSTRUCTION("C4E3ED498C358000000031" , vpermil2pd(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128), 1));
- TEST_INSTRUCTION("C4E36948CB41" , vpermil2ps(xmm1, xmm2, xmm3, xmm4, 1));
- TEST_INSTRUCTION("C4E369488C2B8000000061" , vpermil2ps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6, 1));
- TEST_INSTRUCTION("C4E369488C2B8000000061" , vpermil2ps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6, 1));
- TEST_INSTRUCTION("C4E3E9488C358000000031" , vpermil2ps(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128), 1));
- TEST_INSTRUCTION("C4E3E9488C358000000031" , vpermil2ps(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128), 1));
- TEST_INSTRUCTION("C4E36D48CB41" , vpermil2ps(ymm1, ymm2, ymm3, ymm4, 1));
- TEST_INSTRUCTION("C4E36D488C2B8000000061" , vpermil2ps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), ymm6, 1));
- TEST_INSTRUCTION("C4E36D488C2B8000000061" , vpermil2ps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), ymm6, 1));
- TEST_INSTRUCTION("C4E3ED488C358000000031" , vpermil2ps(ymm1, ymm2, ymm3, ptr(ebp, esi, 0, 128), 1));
- TEST_INSTRUCTION("C4E3ED488C358000000031" , vpermil2ps(ymm1, ymm2, ymm3, ymmword_ptr(ebp, esi, 0, 128), 1));
- TEST_INSTRUCTION("C4E2690DCB" , vpermilpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E37905CA01" , vpermilpd(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E2690D8C2B80000000" , vpermilpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2690D8C2B80000000" , vpermilpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E379058C1A8000000001" , vpermilpd(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E379058C1A8000000001" , vpermilpd(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26D0DCB" , vpermilpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E37D05CA01" , vpermilpd(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E26D0D8C2B80000000" , vpermilpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0D8C2B80000000" , vpermilpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E37D058C1A8000000001" , vpermilpd(ymm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D058C1A8000000001" , vpermilpd(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F2ED480DCB" , vpermilpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F3FD4805CA01" , vpermilpd(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F2ED480D4C2B02" , vpermilpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED480D4C2B02" , vpermilpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F3FD48054C1A0201" , vpermilpd(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F3FD48054C1A0201" , vpermilpd(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E2690CCB" , vpermilps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E37904CA01" , vpermilps(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E2690C8C2B80000000" , vpermilps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2690C8C2B80000000" , vpermilps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E379048C1A8000000001" , vpermilps(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E379048C1A8000000001" , vpermilps(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26D0CCB" , vpermilps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E37D04CA01" , vpermilps(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E26D0C8C2B80000000" , vpermilps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0C8C2B80000000" , vpermilps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E37D048C1A8000000001" , vpermilps(ymm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D048C1A8000000001" , vpermilps(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F26D480CCB" , vpermilps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F37D4804CA01" , vpermilps(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F26D480C4C2B02" , vpermilps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D480C4C2B02" , vpermilps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F37D48044C1A0201" , vpermilps(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F37D48044C1A0201" , vpermilps(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3FD01CA01" , vpermpd(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E3FD018C1A8000000001" , vpermpd(ymm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3FD018C1A8000000001" , vpermpd(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F2ED2816CB" , vpermpd(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("62F2ED28164C2B04" , vpermpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED28164C2B04" , vpermpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
@@ -5330,15 +6408,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED48164C2B02" , vpermpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F3FD48014C1A0201" , vpermpd(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F3FD48014C1A0201" , vpermpd(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26D16CB" , vpermps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D168C2B80000000" , vpermps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D168C2B80000000" , vpermps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4816CB" , vpermps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48164C2B02" , vpermps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48164C2B02" , vpermps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E3FD00CA01" , vpermq(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E3FD008C1A8000000001" , vpermq(ymm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3FD008C1A8000000001" , vpermq(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F2ED2836CB" , vpermq(ymm1, ymm2, ymm3));
TEST_INSTRUCTION("62F2ED28364C2B04" , vpermq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED28364C2B04" , vpermq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
@@ -5447,128 +6519,18 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD4862CA" , vpexpandw(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48624C1A40" , vpexpandw(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD48624C1A40" , vpexpandw(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E37914D101" , vpextrb(ecx, xmm2, 1));
- TEST_INSTRUCTION("C4E379149C118000000001" , vpextrb(ptr(ecx, edx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E379149C118000000001" , vpextrb(byte_ptr(ecx, edx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E37916D101" , vpextrd(ecx, xmm2, 1));
- TEST_INSTRUCTION("C4E379169C118000000001" , vpextrd(ptr(ecx, edx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E379169C118000000001" , vpextrd(dword_ptr(ecx, edx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C5F9C5CA01" , vpextrw(ecx, xmm2, 1));
- TEST_INSTRUCTION("C4E379159C118000000001" , vpextrw(ptr(ecx, edx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E379159C118000000001" , vpextrw(word_ptr(ecx, edx, 0, 128), xmm3, 1));
- TEST_INSTRUCTION("C4E259908C1A80000000" , vpgatherdd(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E25D908C1A80000000" , vpgatherdd(ymm1, ptr(edx, ymm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F27D09904C1A20" , k(k1).vpgatherdd(xmm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F27D29904C1A20" , k(k1).vpgatherdd(ymm1, ptr(edx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F27D49904C1A20" , k(k1).vpgatherdd(zmm1, ptr(edx, zmm3, 0, 128)));
- TEST_INSTRUCTION("C4E2D9908C1A80000000" , vpgatherdq(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E2DD908C1A80000000" , vpgatherdq(ymm1, ptr(edx, xmm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F2FD09904C1A10" , k(k1).vpgatherdq(xmm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD29904C1A10" , k(k1).vpgatherdq(ymm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD49904C1A10" , k(k1).vpgatherdq(zmm1, ptr(edx, ymm3, 0, 128)));
- TEST_INSTRUCTION("C4E259918C1A80000000" , vpgatherqd(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E25D918C1A80000000" , vpgatherqd(xmm1, ptr(edx, ymm3, 0, 128), xmm4));
TEST_INSTRUCTION("62F27D09914C1A20" , k(k1).vpgatherqd(xmm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F27D29914C1A20" , k(k1).vpgatherqd(xmm1, ptr(edx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F27D49914C1A20" , k(k1).vpgatherqd(ymm1, ptr(edx, zmm3, 0, 128)));
- TEST_INSTRUCTION("C4E2D9918C1A80000000" , vpgatherqq(xmm1, ptr(edx, xmm3, 0, 128), xmm4));
- TEST_INSTRUCTION("C4E2DD918C1A80000000" , vpgatherqq(ymm1, ptr(edx, ymm3, 0, 128), ymm4));
TEST_INSTRUCTION("62F2FD09914C1A10" , k(k1).vpgatherqq(xmm1, ptr(edx, xmm3, 0, 128)));
TEST_INSTRUCTION("62F2FD29914C1A10" , k(k1).vpgatherqq(ymm1, ptr(edx, ymm3, 0, 128)));
TEST_INSTRUCTION("62F2FD49914C1A10" , k(k1).vpgatherqq(zmm1, ptr(edx, zmm3, 0, 128)));
- TEST_INSTRUCTION("8FE978C2CA" , vphaddbd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C28C1A80000000" , vphaddbd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978C28C1A80000000" , vphaddbd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978C3CA" , vphaddbq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C38C1A80000000" , vphaddbq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978C38C1A80000000" , vphaddbq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978C1CA" , vphaddbw(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C18C1A80000000" , vphaddbw(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978C18C1A80000000" , vphaddbw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E26902CB" , vphaddd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269028C2B80000000" , vphaddd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269028C2B80000000" , vphaddd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D02CB" , vphaddd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D028C2B80000000" , vphaddd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D028C2B80000000" , vphaddd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE978CBCA" , vphadddq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978CB8C1A80000000" , vphadddq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978CB8C1A80000000" , vphadddq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E26903CB" , vphaddsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269038C2B80000000" , vphaddsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269038C2B80000000" , vphaddsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D03CB" , vphaddsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D038C2B80000000" , vphaddsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D038C2B80000000" , vphaddsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE978D2CA" , vphaddubd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D28C1A80000000" , vphaddubd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978D28C1A80000000" , vphaddubd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978D3CA" , vphaddubq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D38C1A80000000" , vphaddubq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978D38C1A80000000" , vphaddubq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978D1CA" , vphaddubw(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D18C1A80000000" , vphaddubw(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978D18C1A80000000" , vphaddubw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978DBCA" , vphaddudq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978DB8C1A80000000" , vphaddudq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978DB8C1A80000000" , vphaddudq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978D6CA" , vphadduwd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D68C1A80000000" , vphadduwd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978D68C1A80000000" , vphadduwd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978D7CA" , vphadduwq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978D78C1A80000000" , vphadduwq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978D78C1A80000000" , vphadduwq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E26901CB" , vphaddw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269018C2B80000000" , vphaddw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269018C2B80000000" , vphaddw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D01CB" , vphaddw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D018C2B80000000" , vphaddw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D018C2B80000000" , vphaddw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE978C6CA" , vphaddwd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C68C1A80000000" , vphaddwd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978C68C1A80000000" , vphaddwd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978C7CA" , vphaddwq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978C78C1A80000000" , vphaddwq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978C78C1A80000000" , vphaddwq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27941CA" , vphminposuw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279418C1A80000000" , vphminposuw(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279418C1A80000000" , vphminposuw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978E1CA" , vphsubbw(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978E18C1A80000000" , vphsubbw(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978E18C1A80000000" , vphsubbw(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E26906CB" , vphsubd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269068C2B80000000" , vphsubd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269068C2B80000000" , vphsubd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D06CB" , vphsubd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D068C2B80000000" , vphsubd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D068C2B80000000" , vphsubd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE978E3CA" , vphsubdq(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978E38C1A80000000" , vphsubdq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978E38C1A80000000" , vphsubdq(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E26907CB" , vphsubsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269078C2B80000000" , vphsubsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269078C2B80000000" , vphsubsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D07CB" , vphsubsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D078C2B80000000" , vphsubsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D078C2B80000000" , vphsubsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26905CB" , vphsubw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269058C2B80000000" , vphsubw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269058C2B80000000" , vphsubw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D05CB" , vphsubw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D058C2B80000000" , vphsubw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D058C2B80000000" , vphsubw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE978E2CA" , vphsubwd(xmm1, xmm2));
- TEST_INSTRUCTION("8FE978E28C1A80000000" , vphsubwd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE978E28C1A80000000" , vphsubwd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E36920CB01" , vpinsrb(xmm1, xmm2, ebx, 1));
- TEST_INSTRUCTION("C4E369208C2B8000000001" , vpinsrb(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369208C2B8000000001" , vpinsrb(xmm1, xmm2, byte_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E36922CB01" , vpinsrd(xmm1, xmm2, ebx, 1));
- TEST_INSTRUCTION("C4E369228C2B8000000001" , vpinsrd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E369228C2B8000000001" , vpinsrd(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C4CB01" , vpinsrw(xmm1, xmm2, ebx, 1));
- TEST_INSTRUCTION("C5E9C48C2B8000000001" , vpinsrw(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C48C2B8000000001" , vpinsrw(xmm1, xmm2, word_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F27D0844CA" , vplzcntd(xmm1, xmm2));
TEST_INSTRUCTION("62F27D08444C1A08" , vplzcntd(xmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D08444C1A08" , vplzcntd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
@@ -5587,42 +6549,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD4844CA" , vplzcntq(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48444C1A02" , vplzcntq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD48444C1A02" , vplzcntq(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("8FE8689ECB40" , vpmacsdd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8689E8C2B8000000060" , vpmacsdd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8689E8C2B8000000060" , vpmacsdd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8689FCB40" , vpmacsdqh(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8689F8C2B8000000060" , vpmacsdqh(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8689F8C2B8000000060" , vpmacsdqh(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86897CB40" , vpmacsdql(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868978C2B8000000060" , vpmacsdql(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868978C2B8000000060" , vpmacsdql(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8688ECB40" , vpmacssdd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8688E8C2B8000000060" , vpmacssdd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8688E8C2B8000000060" , vpmacssdd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8688FCB40" , vpmacssdqh(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8688F8C2B8000000060" , vpmacssdqh(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE8688F8C2B8000000060" , vpmacssdqh(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86887CB40" , vpmacssdql(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868878C2B8000000060" , vpmacssdql(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868878C2B8000000060" , vpmacssdql(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86886CB40" , vpmacsswd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868868C2B8000000060" , vpmacsswd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868868C2B8000000060" , vpmacsswd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86885CB40" , vpmacssww(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868858C2B8000000060" , vpmacssww(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868858C2B8000000060" , vpmacssww(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86896CB40" , vpmacswd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868968C2B8000000060" , vpmacswd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868968C2B8000000060" , vpmacswd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE86895CB40" , vpmacsww(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868958C2B8000000060" , vpmacsww(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868958C2B8000000060" , vpmacsww(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868A6CB40" , vpmadcsswd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868A68C2B8000000060" , vpmadcsswd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868A68C2B8000000060" , vpmadcsswd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868B6CB40" , vpmadcswd(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE868B68C2B8000000060" , vpmadcswd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868B68C2B8000000060" , vpmadcswd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
TEST_INSTRUCTION("62F2ED08B5CB" , vpmadd52huq(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F2ED08B54C2B08" , vpmadd52huq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED08B54C2B08" , vpmadd52huq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -5641,55 +6567,15 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED48B4CB" , vpmadd52luq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48B44C2B02" , vpmadd52luq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48B44C2B02" , vpmadd52luq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26904CB" , vpmaddubsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269048C2B80000000" , vpmaddubsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269048C2B80000000" , vpmaddubsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D04CB" , vpmaddubsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D048C2B80000000" , vpmaddubsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D048C2B80000000" , vpmaddubsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4804CB" , vpmaddubsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48044C2B02" , vpmaddubsw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48044C2B02" , vpmaddubsw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F5CB" , vpmaddwd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F58C2B80000000" , vpmaddwd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F58C2B80000000" , vpmaddwd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF5CB" , vpmaddwd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF58C2B80000000" , vpmaddwd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF58C2B80000000" , vpmaddwd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48F5CB" , vpmaddwd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48F54C2B02" , vpmaddwd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48F54C2B02" , vpmaddwd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2618EA41180000000" , vpmaskmovd(ptr(ecx, edx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2618EA41180000000" , vpmaskmovd(xmmword_ptr(ecx, edx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2658EA41180000000" , vpmaskmovd(ptr(ecx, edx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2658EA41180000000" , vpmaskmovd(ymmword_ptr(ecx, edx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2698C8C2B80000000" , vpmaskmovd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2698C8C2B80000000" , vpmaskmovd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D8C8C2B80000000" , vpmaskmovd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D8C8C2B80000000" , vpmaskmovd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E18EA41180000000" , vpmaskmovq(ptr(ecx, edx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2E18EA41180000000" , vpmaskmovq(xmmword_ptr(ecx, edx, 0, 128), xmm3, xmm4));
- TEST_INSTRUCTION("C4E2E58EA41180000000" , vpmaskmovq(ptr(ecx, edx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2E58EA41180000000" , vpmaskmovq(ymmword_ptr(ecx, edx, 0, 128), ymm3, ymm4));
- TEST_INSTRUCTION("C4E2E98C8C2B80000000" , vpmaskmovq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E98C8C2B80000000" , vpmaskmovq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED8C8C2B80000000" , vpmaskmovq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED8C8C2B80000000" , vpmaskmovq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693CCB" , vpmaxsb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693C8C2B80000000" , vpmaxsb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693C8C2B80000000" , vpmaxsb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3CCB" , vpmaxsb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3C8C2B80000000" , vpmaxsb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3C8C2B80000000" , vpmaxsb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483CCB" , vpmaxsb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483C4C2B02" , vpmaxsb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483C4C2B02" , vpmaxsb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693DCB" , vpmaxsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693D8C2B80000000" , vpmaxsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693D8C2B80000000" , vpmaxsd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3DCB" , vpmaxsd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3D8C2B80000000" , vpmaxsd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3D8C2B80000000" , vpmaxsd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483DCB" , vpmaxsd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483D4C2B02" , vpmaxsd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483D4C2B02" , vpmaxsd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -5702,30 +6588,12 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED483DCB" , vpmaxsq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED483D4C2B02" , vpmaxsq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED483D4C2B02" , vpmaxsq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9EECB" , vpmaxsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EE8C2B80000000" , vpmaxsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9EE8C2B80000000" , vpmaxsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEECB" , vpmaxsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEE8C2B80000000" , vpmaxsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEE8C2B80000000" , vpmaxsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48EECB" , vpmaxsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48EE4C2B02" , vpmaxsw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48EE4C2B02" , vpmaxsw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DECB" , vpmaxub(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DE8C2B80000000" , vpmaxub(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DE8C2B80000000" , vpmaxub(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDECB" , vpmaxub(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDE8C2B80000000" , vpmaxub(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDE8C2B80000000" , vpmaxub(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48DECB" , vpmaxub(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DE4C2B02" , vpmaxub(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48DE4C2B02" , vpmaxub(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693FCB" , vpmaxud(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693F8C2B80000000" , vpmaxud(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693F8C2B80000000" , vpmaxud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3FCB" , vpmaxud(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3F8C2B80000000" , vpmaxud(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3F8C2B80000000" , vpmaxud(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483FCB" , vpmaxud(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483F4C2B02" , vpmaxud(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483F4C2B02" , vpmaxud(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -5738,30 +6606,12 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED483FCB" , vpmaxuq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED483F4C2B02" , vpmaxuq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED483F4C2B02" , vpmaxuq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693ECB" , vpmaxuw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693E8C2B80000000" , vpmaxuw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693E8C2B80000000" , vpmaxuw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3ECB" , vpmaxuw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3E8C2B80000000" , vpmaxuw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3E8C2B80000000" , vpmaxuw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483ECB" , vpmaxuw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483E4C2B02" , vpmaxuw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483E4C2B02" , vpmaxuw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26938CB" , vpminsb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269388C2B80000000" , vpminsb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269388C2B80000000" , vpminsb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D38CB" , vpminsb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D388C2B80000000" , vpminsb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D388C2B80000000" , vpminsb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4838CB" , vpminsb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48384C2B02" , vpminsb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48384C2B02" , vpminsb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26939CB" , vpminsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269398C2B80000000" , vpminsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269398C2B80000000" , vpminsd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D39CB" , vpminsd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D398C2B80000000" , vpminsd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D398C2B80000000" , vpminsd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4839CB" , vpminsd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48394C2B02" , vpminsd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48394C2B02" , vpminsd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -5774,30 +6624,12 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4839CB" , vpminsq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48394C2B02" , vpminsq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48394C2B02" , vpminsq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9EACB" , vpminsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EA8C2B80000000" , vpminsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9EA8C2B80000000" , vpminsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEACB" , vpminsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEA8C2B80000000" , vpminsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEA8C2B80000000" , vpminsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48EACB" , vpminsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48EA4C2B02" , vpminsw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48EA4C2B02" , vpminsw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DACB" , vpminub(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9DA8C2B80000000" , vpminub(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9DA8C2B80000000" , vpminub(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDACB" , vpminub(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDDA8C2B80000000" , vpminub(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDDA8C2B80000000" , vpminub(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48DACB" , vpminub(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48DA4C2B02" , vpminub(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48DA4C2B02" , vpminub(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693BCB" , vpminud(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693B8C2B80000000" , vpminud(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693B8C2B80000000" , vpminud(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3BCB" , vpminud(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3B8C2B80000000" , vpminud(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3B8C2B80000000" , vpminud(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483BCB" , vpminud(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483B4C2B02" , vpminud(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483B4C2B02" , vpminud(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -5810,12 +6642,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED483BCB" , vpminuq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED483B4C2B02" , vpminuq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED483B4C2B02" , vpminuq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693ACB" , vpminuw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2693A8C2B80000000" , vpminuw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2693A8C2B80000000" , vpminuw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3ACB" , vpminuw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D3A8C2B80000000" , vpminuw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D3A8C2B80000000" , vpminuw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483ACB" , vpminuw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D483A4C2B02" , vpminuw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D483A4C2B02" , vpminuw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -5855,8 +6681,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FE0828CA" , vpmovm2w(xmm1, k2));
TEST_INSTRUCTION("62F2FE2828CA" , vpmovm2w(ymm1, k2));
TEST_INSTRUCTION("62F2FE4828CA" , vpmovm2w(zmm1, k2));
- TEST_INSTRUCTION("C5F9D7CA" , vpmovmskb(ecx, xmm2));
- TEST_INSTRUCTION("C5FDD7CA" , vpmovmskb(ecx, ymm2));
TEST_INSTRUCTION("62F2FE0839CA" , vpmovq2m(k1, xmm2));
TEST_INSTRUCTION("62F2FE2839CA" , vpmovq2m(k1, ymm2));
TEST_INSTRUCTION("62F2FE4839CA" , vpmovq2m(k1, zmm2));
@@ -5941,57 +6765,21 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27E4820D1" , vpmovswb(ymm1, zmm2));
TEST_INSTRUCTION("62F27E48205C1104" , vpmovswb(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F27E48205C1104" , vpmovswb(ymmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C4E27921CA" , vpmovsxbd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279218C1A80000000" , vpmovsxbd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279218C1A80000000" , vpmovsxbd(xmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D21CA" , vpmovsxbd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D218C1A80000000" , vpmovsxbd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D218C1A80000000" , vpmovsxbd(ymm1, qword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4821CA" , vpmovsxbd(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48214C1A08" , vpmovsxbd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48214C1A08" , vpmovsxbd(zmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27922CA" , vpmovsxbq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279228C1A80000000" , vpmovsxbq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279228C1A80000000" , vpmovsxbq(xmm1, word_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D22CA" , vpmovsxbq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D228C1A80000000" , vpmovsxbq(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D228C1A80000000" , vpmovsxbq(ymm1, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4822CA" , vpmovsxbq(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48224C1A10" , vpmovsxbq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48224C1A10" , vpmovsxbq(zmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27920CA" , vpmovsxbw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279208C1A80000000" , vpmovsxbw(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279208C1A80000000" , vpmovsxbw(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D20CA" , vpmovsxbw(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D208C1A80000000" , vpmovsxbw(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D208C1A80000000" , vpmovsxbw(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4820CA" , vpmovsxbw(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48204C1A04" , vpmovsxbw(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48204C1A04" , vpmovsxbw(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27925CA" , vpmovsxdq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279258C1A80000000" , vpmovsxdq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279258C1A80000000" , vpmovsxdq(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D25CA" , vpmovsxdq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D258C1A80000000" , vpmovsxdq(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D258C1A80000000" , vpmovsxdq(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4825CA" , vpmovsxdq(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48254C1A04" , vpmovsxdq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48254C1A04" , vpmovsxdq(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27923CA" , vpmovsxwd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279238C1A80000000" , vpmovsxwd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279238C1A80000000" , vpmovsxwd(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D23CA" , vpmovsxwd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D238C1A80000000" , vpmovsxwd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D238C1A80000000" , vpmovsxwd(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4823CA" , vpmovsxwd(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48234C1A04" , vpmovsxwd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48234C1A04" , vpmovsxwd(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27924CA" , vpmovsxwq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279248C1A80000000" , vpmovsxwq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279248C1A80000000" , vpmovsxwq(xmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D24CA" , vpmovsxwq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D248C1A80000000" , vpmovsxwq(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D248C1A80000000" , vpmovsxwq(ymm1, qword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4824CA" , vpmovsxwq(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48244C1A08" , vpmovsxwq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48244C1A08" , vpmovsxwq(zmm1, xmmword_ptr(edx, ebx, 0, 128)));
@@ -6061,102 +6849,36 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F27E4830D1" , vpmovwb(ymm1, zmm2));
TEST_INSTRUCTION("62F27E48305C1104" , vpmovwb(ptr(ecx, edx, 0, 128), zmm3));
TEST_INSTRUCTION("62F27E48305C1104" , vpmovwb(ymmword_ptr(ecx, edx, 0, 128), zmm3));
- TEST_INSTRUCTION("C4E27931CA" , vpmovzxbd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279318C1A80000000" , vpmovzxbd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279318C1A80000000" , vpmovzxbd(xmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D31CA" , vpmovzxbd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D318C1A80000000" , vpmovzxbd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D318C1A80000000" , vpmovzxbd(ymm1, qword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4831CA" , vpmovzxbd(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48314C1A08" , vpmovzxbd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48314C1A08" , vpmovzxbd(zmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27932CA" , vpmovzxbq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279328C1A80000000" , vpmovzxbq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279328C1A80000000" , vpmovzxbq(xmm1, word_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D32CA" , vpmovzxbq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D328C1A80000000" , vpmovzxbq(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D328C1A80000000" , vpmovzxbq(ymm1, dword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4832CA" , vpmovzxbq(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48324C1A10" , vpmovzxbq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48324C1A10" , vpmovzxbq(zmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27930CA" , vpmovzxbw(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279308C1A80000000" , vpmovzxbw(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279308C1A80000000" , vpmovzxbw(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D30CA" , vpmovzxbw(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D308C1A80000000" , vpmovzxbw(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D308C1A80000000" , vpmovzxbw(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4830CA" , vpmovzxbw(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48304C1A04" , vpmovzxbw(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48304C1A04" , vpmovzxbw(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27935CA" , vpmovzxdq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279358C1A80000000" , vpmovzxdq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279358C1A80000000" , vpmovzxdq(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D35CA" , vpmovzxdq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D358C1A80000000" , vpmovzxdq(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D358C1A80000000" , vpmovzxdq(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4835CA" , vpmovzxdq(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48354C1A04" , vpmovzxdq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48354C1A04" , vpmovzxdq(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27933CA" , vpmovzxwd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279338C1A80000000" , vpmovzxwd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279338C1A80000000" , vpmovzxwd(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D33CA" , vpmovzxwd(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D338C1A80000000" , vpmovzxwd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D338C1A80000000" , vpmovzxwd(ymm1, xmmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4833CA" , vpmovzxwd(zmm1, ymm2));
TEST_INSTRUCTION("62F27D48334C1A04" , vpmovzxwd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48334C1A04" , vpmovzxwd(zmm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27934CA" , vpmovzxwq(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279348C1A80000000" , vpmovzxwq(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279348C1A80000000" , vpmovzxwq(xmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D34CA" , vpmovzxwq(ymm1, xmm2));
- TEST_INSTRUCTION("C4E27D348C1A80000000" , vpmovzxwq(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D348C1A80000000" , vpmovzxwq(ymm1, qword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D4834CA" , vpmovzxwq(zmm1, xmm2));
TEST_INSTRUCTION("62F27D48344C1A08" , vpmovzxwq(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F27D48344C1A08" , vpmovzxwq(zmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E26928CB" , vpmuldq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269288C2B80000000" , vpmuldq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269288C2B80000000" , vpmuldq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D28CB" , vpmuldq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D288C2B80000000" , vpmuldq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D288C2B80000000" , vpmuldq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED4828CB" , vpmuldq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48284C2B02" , vpmuldq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48284C2B02" , vpmuldq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2690BCB" , vpmulhrsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2690B8C2B80000000" , vpmulhrsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2690B8C2B80000000" , vpmulhrsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0BCB" , vpmulhrsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D0B8C2B80000000" , vpmulhrsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0B8C2B80000000" , vpmulhrsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D480BCB" , vpmulhrsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D480B4C2B02" , vpmulhrsw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D480B4C2B02" , vpmulhrsw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E4CB" , vpmulhuw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E48C2B80000000" , vpmulhuw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E48C2B80000000" , vpmulhuw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE4CB" , vpmulhuw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE48C2B80000000" , vpmulhuw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE48C2B80000000" , vpmulhuw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E4CB" , vpmulhuw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E44C2B02" , vpmulhuw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E44C2B02" , vpmulhuw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E5CB" , vpmulhw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E58C2B80000000" , vpmulhw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E58C2B80000000" , vpmulhw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE5CB" , vpmulhw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE58C2B80000000" , vpmulhw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE58C2B80000000" , vpmulhw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E5CB" , vpmulhw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E54C2B02" , vpmulhw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E54C2B02" , vpmulhw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26940CB" , vpmulld(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269408C2B80000000" , vpmulld(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269408C2B80000000" , vpmulld(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D40CB" , vpmulld(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D408C2B80000000" , vpmulld(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D408C2B80000000" , vpmulld(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4840CB" , vpmulld(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48404C2B02" , vpmulld(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48404C2B02" , vpmulld(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -6169,12 +6891,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4840CB" , vpmullq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48404C2B02" , vpmullq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48404C2B02" , vpmullq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D5CB" , vpmullw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9D58C2B80000000" , vpmullw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D58C2B80000000" , vpmullw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD5CB" , vpmullw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDD58C2B80000000" , vpmullw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD58C2B80000000" , vpmullw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48D5CB" , vpmullw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48D54C2B02" , vpmullw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48D54C2B02" , vpmullw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -6187,12 +6903,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4883CB" , vpmultishiftqb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48834C2B02" , vpmultishiftqb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48834C2B02" , vpmultishiftqb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F4CB" , vpmuludq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F48C2B80000000" , vpmuludq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F48C2B80000000" , vpmuludq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF4CB" , vpmuludq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF48C2B80000000" , vpmuludq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF48C2B80000000" , vpmuludq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48F4CB" , vpmuludq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48F44C2B02" , vpmuludq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48F44C2B02" , vpmuludq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -6232,12 +6942,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD4854CA" , vpopcntw(zmm1, zmm2));
TEST_INSTRUCTION("62F2FD48544C1A02" , vpopcntw(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD48544C1A02" , vpopcntw(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5E9EBCB" , vpor(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EB8C2B80000000" , vpor(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9EB8C2B80000000" , vpor(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEBCB" , vpor(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEB8C2B80000000" , vpor(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEB8C2B80000000" , vpor(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08EBCB" , vpord(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08EB4C2B08" , vpord(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08EB4C2B08" , vpord(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -6256,11 +6960,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48EBCB" , vporq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48EB4C2B02" , vporq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48EB4C2B02" , vporq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE868A3CB40" , vpperm(xmm1, xmm2, xmm3, xmm4));
- TEST_INSTRUCTION("8FE8E8A38C358000000030" , vpperm(xmm1, xmm2, xmm3, ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("8FE8E8A38C358000000030" , vpperm(xmm1, xmm2, xmm3, xmmword_ptr(ebp, esi, 0, 128)));
- TEST_INSTRUCTION("8FE868A38C2B8000000060" , vpperm(xmm1, xmm2, ptr(ebx, ebp, 0, 128), xmm6));
- TEST_INSTRUCTION("8FE868A38C2B8000000060" , vpperm(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), xmm6));
TEST_INSTRUCTION("62F1750872CA01" , vprold(xmm1, xmm2, 1));
TEST_INSTRUCTION("62F17508724C1A0801" , vprold(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17508724C1A0801" , vprold(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
@@ -6333,44 +7032,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4814CB" , vprorvq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48144C2B02" , vprorvq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48144C2B02" , vprorvq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE96090CA" , vprotb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE878C0CA01" , vprotb(xmm1, xmm2, 1));
- TEST_INSTRUCTION("8FE9E8908C2B80000000" , vprotb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8908C2B80000000" , vprotb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958908C1A80000000" , vprotb(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C08C1A8000000001" , vprotb(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FE958908C1A80000000" , vprotb(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C08C1A8000000001" , vprotb(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FE96092CA" , vprotd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE878C2CA01" , vprotd(xmm1, xmm2, 1));
- TEST_INSTRUCTION("8FE9E8928C2B80000000" , vprotd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8928C2B80000000" , vprotd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958928C1A80000000" , vprotd(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C28C1A8000000001" , vprotd(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FE958928C1A80000000" , vprotd(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C28C1A8000000001" , vprotd(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FE96093CA" , vprotq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE878C3CA01" , vprotq(xmm1, xmm2, 1));
- TEST_INSTRUCTION("8FE9E8938C2B80000000" , vprotq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8938C2B80000000" , vprotq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958938C1A80000000" , vprotq(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C38C1A8000000001" , vprotq(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FE958938C1A80000000" , vprotq(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C38C1A8000000001" , vprotq(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FE96091CA" , vprotw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE878C1CA01" , vprotw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("8FE9E8918C2B80000000" , vprotw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8918C2B80000000" , vprotw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958918C1A80000000" , vprotw(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C18C1A8000000001" , vprotw(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("8FE958918C1A80000000" , vprotw(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE878C18C1A8000000001" , vprotw(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9F6CB" , vpsadbw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F68C2B80000000" , vpsadbw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F68C2B80000000" , vpsadbw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF6CB" , vpsadbw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF68C2B80000000" , vpsadbw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF68C2B80000000" , vpsadbw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48F6CB" , vpsadbw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48F64C2B02" , vpsadbw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48F64C2B02" , vpsadbw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -6386,36 +7047,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2FD09A15C1110" , k(k1).vpscatterqq(ptr(ecx, xmm2, 0, 128), xmm3));
TEST_INSTRUCTION("62F2FD29A15C1110" , k(k1).vpscatterqq(ptr(ecx, ymm2, 0, 128), ymm3));
TEST_INSTRUCTION("62F2FD49A15C1110" , k(k1).vpscatterqq(ptr(ecx, zmm2, 0, 128), zmm3));
- TEST_INSTRUCTION("8FE96098CA" , vpshab(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8988C2B80000000" , vpshab(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8988C2B80000000" , vpshab(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958988C1A80000000" , vpshab(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958988C1A80000000" , vpshab(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE9609ACA" , vpshad(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E89A8C2B80000000" , vpshad(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E89A8C2B80000000" , vpshad(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9589A8C1A80000000" , vpshad(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE9589A8C1A80000000" , vpshad(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE9609BCA" , vpshaq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E89B8C2B80000000" , vpshaq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E89B8C2B80000000" , vpshaq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9589B8C1A80000000" , vpshaq(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE9589B8C1A80000000" , vpshaq(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE96099CA" , vpshaw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8998C2B80000000" , vpshaw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8998C2B80000000" , vpshaw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958998C1A80000000" , vpshaw(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958998C1A80000000" , vpshaw(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE96094CA" , vpshlb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8948C2B80000000" , vpshlb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8948C2B80000000" , vpshlb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958948C1A80000000" , vpshlb(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958948C1A80000000" , vpshlb(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE96096CA" , vpshld(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8968C2B80000000" , vpshld(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8968C2B80000000" , vpshld(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958968C1A80000000" , vpshld(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958968C1A80000000" , vpshld(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
TEST_INSTRUCTION("62F36D0871CB01" , vpshldd(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08714C2B0801" , vpshldd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08714C2B0801" , vpshldd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
@@ -6470,16 +7101,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED4870CB01" , vpshldw(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48704C2B0201" , vpshldw(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48704C2B0201" , vpshldw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("8FE96097CA" , vpshlq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8978C2B80000000" , vpshlq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8978C2B80000000" , vpshlq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958978C1A80000000" , vpshlq(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958978C1A80000000" , vpshlq(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE96095CA" , vpshlw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("8FE9E8958C2B80000000" , vpshlw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE9E8958C2B80000000" , vpshlw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("8FE958958C1A80000000" , vpshlw(xmm1, ptr(edx, ebx, 0, 128), xmm4));
- TEST_INSTRUCTION("8FE958958C1A80000000" , vpshlw(xmm1, xmmword_ptr(edx, ebx, 0, 128), xmm4));
TEST_INSTRUCTION("62F36D0873CB01" , vpshrdd(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D08734C2B0801" , vpshrdd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D08734C2B0801" , vpshrdd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
@@ -6534,12 +7155,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED4872CB01" , vpshrdw(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48724C2B0201" , vpshrdw(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48724C2B0201" , vpshrdw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E26900CB" , vpshufb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269008C2B80000000" , vpshufb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269008C2B80000000" , vpshufb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D00CB" , vpshufb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D008C2B80000000" , vpshufb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D008C2B80000000" , vpshufb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4800CB" , vpshufb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48004C2B02" , vpshufb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48004C2B02" , vpshufb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -6552,59 +7167,15 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D488FCB" , vpshufbitqmb(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D488F4C2B02" , vpshufbitqmb(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D488F4C2B02" , vpshufbitqmb(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5F970CA01" , vpshufd(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5F9708C1A8000000001" , vpshufd(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5F9708C1A8000000001" , vpshufd(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FD70CA01" , vpshufd(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5FD708C1A8000000001" , vpshufd(ymm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FD708C1A8000000001" , vpshufd(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17D4870CA01" , vpshufd(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17D48704C1A0201" , vpshufd(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17D48704C1A0201" , vpshufd(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FA70CA01" , vpshufhw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5FA708C1A8000000001" , vpshufhw(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FA708C1A8000000001" , vpshufhw(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FE70CA01" , vpshufhw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5FE708C1A8000000001" , vpshufhw(ymm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FE708C1A8000000001" , vpshufhw(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17E4870CA01" , vpshufhw(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17E48704C1A0201" , vpshufhw(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17E48704C1A0201" , vpshufhw(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FB70CA01" , vpshuflw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5FB708C1A8000000001" , vpshuflw(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FB708C1A8000000001" , vpshuflw(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FF70CA01" , vpshuflw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5FF708C1A8000000001" , vpshuflw(ymm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5FF708C1A8000000001" , vpshuflw(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17F4870CA01" , vpshuflw(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17F48704C1A0201" , vpshuflw(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17F48704C1A0201" , vpshuflw(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26908CB" , vpsignb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269088C2B80000000" , vpsignb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269088C2B80000000" , vpsignb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D08CB" , vpsignb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D088C2B80000000" , vpsignb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D088C2B80000000" , vpsignb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2690ACB" , vpsignd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2690A8C2B80000000" , vpsignd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2690A8C2B80000000" , vpsignd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0ACB" , vpsignd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D0A8C2B80000000" , vpsignd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D0A8C2B80000000" , vpsignd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26909CB" , vpsignw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269098C2B80000000" , vpsignw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269098C2B80000000" , vpsignw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D09CB" , vpsignw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D098C2B80000000" , vpsignw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D098C2B80000000" , vpsignw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F2CB" , vpslld(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F172F201" , vpslld(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9F28C2B80000000" , vpslld(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F28C2B80000000" , vpslld(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF2CB" , vpslld(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F572F201" , vpslld(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDF28C2B80000000" , vpslld(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF28C2B80000000" , vpslld(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1750872741A0801" , vpslld(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1750872741A0801" , vpslld(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1752872741A0401" , vpslld(ymm1, ptr(edx, ebx, 0, 128), 1));
@@ -6615,23 +7186,13 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48F24C2B08" , vpslld(zmm1, zmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1754872741A0201" , vpslld(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1754872741A0201" , vpslld(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5F173FA01" , vpslldq(xmm1, xmm2, 1));
TEST_INSTRUCTION("62F17508737C1A0801" , vpslldq(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17508737C1A0801" , vpslldq(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5F573FA01" , vpslldq(ymm1, ymm2, 1));
TEST_INSTRUCTION("62F17528737C1A0401" , vpslldq(ymm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17528737C1A0401" , vpslldq(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1754873FA01" , vpslldq(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17548737C1A0201" , vpslldq(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17548737C1A0201" , vpslldq(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9F3CB" , vpsllq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F173F201" , vpsllq(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9F38C2B80000000" , vpsllq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F38C2B80000000" , vpsllq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF3CB" , vpsllq(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F573F201" , vpsllq(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDF38C2B80000000" , vpsllq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF38C2B80000000" , vpsllq(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1F50873741A0801" , vpsllq(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1F50873741A0801" , vpsllq(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1F52873741A0401" , vpsllq(ymm1, ptr(edx, ebx, 0, 128), 1));
@@ -6642,21 +7203,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48F34C2B08" , vpsllq(zmm1, zmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1F54873741A0201" , vpsllq(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1F54873741A0201" , vpsllq(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26947CB" , vpsllvd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269478C2B80000000" , vpsllvd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269478C2B80000000" , vpsllvd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D47CB" , vpsllvd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D478C2B80000000" , vpsllvd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D478C2B80000000" , vpsllvd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4847CB" , vpsllvd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48474C2B02" , vpsllvd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48474C2B02" , vpsllvd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E947CB" , vpsllvq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9478C2B80000000" , vpsllvq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9478C2B80000000" , vpsllvq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED47CB" , vpsllvq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED478C2B80000000" , vpsllvq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED478C2B80000000" , vpsllvq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED4847CB" , vpsllvq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48474C2B02" , vpsllvq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48474C2B02" , vpsllvq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -6669,14 +7218,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4812CB" , vpsllvw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48124C2B02" , vpsllvw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48124C2B02" , vpsllvw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F1CB" , vpsllw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F171F201" , vpsllw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9F18C2B80000000" , vpsllw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F18C2B80000000" , vpsllw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF1CB" , vpsllw(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F571F201" , vpsllw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDF18C2B80000000" , vpsllw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF18C2B80000000" , vpsllw(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1750871741A0801" , vpsllw(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1750871741A0801" , vpsllw(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1752871741A0401" , vpsllw(ymm1, ptr(edx, ebx, 0, 128), 1));
@@ -6687,14 +7228,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48F14C2B08" , vpsllw(zmm1, zmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1754871741A0201" , vpsllw(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1754871741A0201" , vpsllw(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9E2CB" , vpsrad(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F172E201" , vpsrad(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9E28C2B80000000" , vpsrad(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E28C2B80000000" , vpsrad(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE2CB" , vpsrad(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F572E201" , vpsrad(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDE28C2B80000000" , vpsrad(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE28C2B80000000" , vpsrad(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1750872641A0801" , vpsrad(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1750872641A0801" , vpsrad(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1752872641A0401" , vpsrad(ymm1, ptr(edx, ebx, 0, 128), 1));
@@ -6723,12 +7256,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48E24C2B08" , vpsraq(zmm1, zmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1F54872641A0201" , vpsraq(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1F54872641A0201" , vpsraq(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26946CB" , vpsravd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269468C2B80000000" , vpsravd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269468C2B80000000" , vpsravd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D46CB" , vpsravd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D468C2B80000000" , vpsravd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D468C2B80000000" , vpsravd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4846CB" , vpsravd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48464C2B02" , vpsravd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48464C2B02" , vpsravd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -6750,14 +7277,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4811CB" , vpsravw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48114C2B02" , vpsravw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48114C2B02" , vpsravw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E1CB" , vpsraw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F171E201" , vpsraw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9E18C2B80000000" , vpsraw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E18C2B80000000" , vpsraw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE1CB" , vpsraw(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F571E201" , vpsraw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDE18C2B80000000" , vpsraw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE18C2B80000000" , vpsraw(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1750871641A0801" , vpsraw(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1750871641A0801" , vpsraw(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1752871641A0401" , vpsraw(ymm1, ptr(edx, ebx, 0, 128), 1));
@@ -6768,14 +7287,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48E14C2B08" , vpsraw(zmm1, zmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1754871641A0201" , vpsraw(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1754871641A0201" , vpsraw(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9D2CB" , vpsrld(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F172D201" , vpsrld(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9D28C2B80000000" , vpsrld(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D28C2B80000000" , vpsrld(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD2CB" , vpsrld(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F572D201" , vpsrld(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDD28C2B80000000" , vpsrld(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD28C2B80000000" , vpsrld(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1750872541A0801" , vpsrld(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1750872541A0801" , vpsrld(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1752872541A0401" , vpsrld(ymm1, ptr(edx, ebx, 0, 128), 1));
@@ -6786,23 +7297,13 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48D24C2B08" , vpsrld(zmm1, zmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1754872541A0201" , vpsrld(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1754872541A0201" , vpsrld(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5F173DA01" , vpsrldq(xmm1, xmm2, 1));
TEST_INSTRUCTION("62F17508735C1A0801" , vpsrldq(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17508735C1A0801" , vpsrldq(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5F573DA01" , vpsrldq(ymm1, ymm2, 1));
TEST_INSTRUCTION("62F17528735C1A0401" , vpsrldq(ymm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17528735C1A0401" , vpsrldq(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1754873DA01" , vpsrldq(zmm1, zmm2, 1));
TEST_INSTRUCTION("62F17548735C1A0201" , vpsrldq(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F17548735C1A0201" , vpsrldq(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9D3CB" , vpsrlq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F173D201" , vpsrlq(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9D38C2B80000000" , vpsrlq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D38C2B80000000" , vpsrlq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD3CB" , vpsrlq(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F573D201" , vpsrlq(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDD38C2B80000000" , vpsrlq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD38C2B80000000" , vpsrlq(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1F50873541A0801" , vpsrlq(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1F50873541A0801" , vpsrlq(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1F52873541A0401" , vpsrlq(ymm1, ptr(edx, ebx, 0, 128), 1));
@@ -6813,21 +7314,9 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F1ED48D34C2B08" , vpsrlq(zmm1, zmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1F54873541A0201" , vpsrlq(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1F54873541A0201" , vpsrlq(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E26945CB" , vpsrlvd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E269458C2B80000000" , vpsrlvd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E269458C2B80000000" , vpsrlvd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D45CB" , vpsrlvd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E26D458C2B80000000" , vpsrlvd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E26D458C2B80000000" , vpsrlvd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D4845CB" , vpsrlvd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F26D48454C2B02" , vpsrlvd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D48454C2B02" , vpsrlvd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E945CB" , vpsrlvq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C4E2E9458C2B80000000" , vpsrlvq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2E9458C2B80000000" , vpsrlvq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED45CB" , vpsrlvq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C4E2ED458C2B80000000" , vpsrlvq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2ED458C2B80000000" , vpsrlvq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED4845CB" , vpsrlvq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48454C2B02" , vpsrlvq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48454C2B02" , vpsrlvq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -6840,14 +7329,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2ED4810CB" , vpsrlvw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F2ED48104C2B02" , vpsrlvw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED48104C2B02" , vpsrlvw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D1CB" , vpsrlw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5F171D201" , vpsrlw(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C5E9D18C2B80000000" , vpsrlw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D18C2B80000000" , vpsrlw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD1CB" , vpsrlw(ymm1, ymm2, xmm3));
- TEST_INSTRUCTION("C5F571D201" , vpsrlw(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C5EDD18C2B80000000" , vpsrlw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD18C2B80000000" , vpsrlw(ymm1, ymm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1750871541A0801" , vpsrlw(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1750871541A0801" , vpsrlw(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1752871541A0401" , vpsrlw(ymm1, ptr(edx, ebx, 0, 128), 1));
@@ -6858,75 +7339,27 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F16D48D14C2B08" , vpsrlw(zmm1, zmm2, xmmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1754871541A0201" , vpsrlw(zmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F1754871541A0201" , vpsrlw(zmm1, zmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C5E9F8CB" , vpsubb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F88C2B80000000" , vpsubb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F88C2B80000000" , vpsubb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF8CB" , vpsubb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF88C2B80000000" , vpsubb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF88C2B80000000" , vpsubb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48F8CB" , vpsubb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48F84C2B02" , vpsubb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48F84C2B02" , vpsubb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FACB" , vpsubd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FA8C2B80000000" , vpsubd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FA8C2B80000000" , vpsubd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFACB" , vpsubd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFA8C2B80000000" , vpsubd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFA8C2B80000000" , vpsubd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48FACB" , vpsubd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48FA4C2B02" , vpsubd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48FA4C2B02" , vpsubd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FBCB" , vpsubq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9FB8C2B80000000" , vpsubq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9FB8C2B80000000" , vpsubq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFBCB" , vpsubq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDFB8C2B80000000" , vpsubq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDFB8C2B80000000" , vpsubq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48FBCB" , vpsubq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48FB4C2B02" , vpsubq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48FB4C2B02" , vpsubq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E8CB" , vpsubsb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E88C2B80000000" , vpsubsb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E88C2B80000000" , vpsubsb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE8CB" , vpsubsb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE88C2B80000000" , vpsubsb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE88C2B80000000" , vpsubsb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E8CB" , vpsubsb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E84C2B02" , vpsubsb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E84C2B02" , vpsubsb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E9CB" , vpsubsw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9E98C2B80000000" , vpsubsw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9E98C2B80000000" , vpsubsw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE9CB" , vpsubsw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDE98C2B80000000" , vpsubsw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDE98C2B80000000" , vpsubsw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E9CB" , vpsubsw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48E94C2B02" , vpsubsw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48E94C2B02" , vpsubsw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D8CB" , vpsubusb(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9D88C2B80000000" , vpsubusb(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D88C2B80000000" , vpsubusb(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD8CB" , vpsubusb(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDD88C2B80000000" , vpsubusb(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD88C2B80000000" , vpsubusb(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48D8CB" , vpsubusb(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48D84C2B02" , vpsubusb(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48D84C2B02" , vpsubusb(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D9CB" , vpsubusw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9D98C2B80000000" , vpsubusw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9D98C2B80000000" , vpsubusw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD9CB" , vpsubusw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDD98C2B80000000" , vpsubusw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDD98C2B80000000" , vpsubusw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48D9CB" , vpsubusw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48D94C2B02" , vpsubusw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48D94C2B02" , vpsubusw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F9CB" , vpsubw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9F98C2B80000000" , vpsubw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9F98C2B80000000" , vpsubw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF9CB" , vpsubw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDF98C2B80000000" , vpsubw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDF98C2B80000000" , vpsubw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48F9CB" , vpsubw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48F94C2B02" , vpsubw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48F94C2B02" , vpsubw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
@@ -6948,12 +7381,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED4825CB01" , vpternlogq(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48254C2B0201" , vpternlogq(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48254C2B0201" , vpternlogq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E27917CA" , vptest(xmm1, xmm2));
- TEST_INSTRUCTION("C4E279178C1A80000000" , vptest(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E279178C1A80000000" , vptest(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D17CA" , vptest(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D178C1A80000000" , vptest(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D178C1A80000000" , vptest(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F26D0826CB" , vptestmb(k1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D08264C2B08" , vptestmb(k1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D08264C2B08" , vptestmb(k1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -7026,84 +7453,30 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F2EE4826CB" , vptestnmw(k1, zmm2, zmm3));
TEST_INSTRUCTION("62F2EE48264C2B02" , vptestnmw(k1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2EE48264C2B02" , vptestnmw(k1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E968CB" , vpunpckhbw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9688C2B80000000" , vpunpckhbw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9688C2B80000000" , vpunpckhbw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED68CB" , vpunpckhbw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED688C2B80000000" , vpunpckhbw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED688C2B80000000" , vpunpckhbw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4868CB" , vpunpckhbw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48684C2B02" , vpunpckhbw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48684C2B02" , vpunpckhbw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E96ACB" , vpunpckhdq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E96A8C2B80000000" , vpunpckhdq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E96A8C2B80000000" , vpunpckhdq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED6ACB" , vpunpckhdq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED6A8C2B80000000" , vpunpckhdq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED6A8C2B80000000" , vpunpckhdq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D486ACB" , vpunpckhdq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D486A4C2B02" , vpunpckhdq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D486A4C2B02" , vpunpckhdq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E96DCB" , vpunpckhqdq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E96D8C2B80000000" , vpunpckhqdq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E96D8C2B80000000" , vpunpckhqdq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED6DCB" , vpunpckhqdq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED6D8C2B80000000" , vpunpckhqdq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED6D8C2B80000000" , vpunpckhqdq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED486DCB" , vpunpckhqdq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED486D4C2B02" , vpunpckhqdq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED486D4C2B02" , vpunpckhqdq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E969CB" , vpunpckhwd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9698C2B80000000" , vpunpckhwd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9698C2B80000000" , vpunpckhwd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED69CB" , vpunpckhwd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED698C2B80000000" , vpunpckhwd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED698C2B80000000" , vpunpckhwd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4869CB" , vpunpckhwd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48694C2B02" , vpunpckhwd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48694C2B02" , vpunpckhwd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E960CB" , vpunpcklbw(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9608C2B80000000" , vpunpcklbw(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9608C2B80000000" , vpunpcklbw(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED60CB" , vpunpcklbw(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED608C2B80000000" , vpunpcklbw(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED608C2B80000000" , vpunpcklbw(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4860CB" , vpunpcklbw(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48604C2B02" , vpunpcklbw(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48604C2B02" , vpunpcklbw(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E962CB" , vpunpckldq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9628C2B80000000" , vpunpckldq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9628C2B80000000" , vpunpckldq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED62CB" , vpunpckldq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED628C2B80000000" , vpunpckldq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED628C2B80000000" , vpunpckldq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4862CB" , vpunpckldq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48624C2B02" , vpunpckldq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48624C2B02" , vpunpckldq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E96CCB" , vpunpcklqdq(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E96C8C2B80000000" , vpunpcklqdq(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E96C8C2B80000000" , vpunpcklqdq(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED6CCB" , vpunpcklqdq(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED6C8C2B80000000" , vpunpcklqdq(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED6C8C2B80000000" , vpunpcklqdq(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED486CCB" , vpunpcklqdq(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED486C4C2B02" , vpunpcklqdq(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED486C4C2B02" , vpunpcklqdq(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E961CB" , vpunpcklwd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9618C2B80000000" , vpunpcklwd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9618C2B80000000" , vpunpcklwd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED61CB" , vpunpcklwd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED618C2B80000000" , vpunpcklwd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED618C2B80000000" , vpunpcklwd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D4861CB" , vpunpcklwd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16D48614C2B02" , vpunpcklwd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D48614C2B02" , vpunpcklwd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9EFCB" , vpxor(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9EF8C2B80000000" , vpxor(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9EF8C2B80000000" , vpxor(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEFCB" , vpxor(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EDEF8C2B80000000" , vpxor(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EDEF8C2B80000000" , vpxor(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08EFCB" , vpxord(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F16D08EF4C2B08" , vpxord(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16D08EF4C2B08" , vpxord(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -7182,15 +7555,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D08CBCB" , vrcp28ss(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D08CB4C2B20" , vrcp28ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D08CB4C2B20" , vrcp28ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5F853CA" , vrcpps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8538C1A80000000" , vrcpps(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F8538C1A80000000" , vrcpps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC53CA" , vrcpps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC538C1A80000000" , vrcpps(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC538C1A80000000" , vrcpps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5EA53CB" , vrcpss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA538C2B80000000" , vrcpss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA538C2B80000000" , vrcpss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F3FD0856CA01" , vreducepd(xmm1, xmm2, 1));
TEST_INSTRUCTION("62F3FD08564C1A0801" , vreducepd(xmm1, ptr(edx, ebx, 0, 128), 1));
TEST_INSTRUCTION("62F3FD08564C1A0801" , vreducepd(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
@@ -7239,24 +7603,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F36D080ACB01" , vrndscaless(xmm1, xmm2, xmm3, 1));
TEST_INSTRUCTION("62F36D080A4C2B2001" , vrndscaless(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F36D080A4C2B2001" , vrndscaless(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E37909CA01" , vroundpd(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E379098C1A8000000001" , vroundpd(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E379098C1A8000000001" , vroundpd(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D09CA01" , vroundpd(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D098C1A8000000001" , vroundpd(ymm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D098C1A8000000001" , vroundpd(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37908CA01" , vroundps(xmm1, xmm2, 1));
- TEST_INSTRUCTION("C4E379088C1A8000000001" , vroundps(xmm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E379088C1A8000000001" , vroundps(xmm1, xmmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D08CA01" , vroundps(ymm1, ymm2, 1));
- TEST_INSTRUCTION("C4E37D088C1A8000000001" , vroundps(ymm1, ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E37D088C1A8000000001" , vroundps(ymm1, ymmword_ptr(edx, ebx, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690BCB01" , vroundsd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690B8C2B8000000001" , vroundsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690B8C2B8000000001" , vroundsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690ACB01" , vroundss(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C4E3690A8C2B8000000001" , vroundss(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C4E3690A8C2B8000000001" , vroundss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F2FD084ECA" , vrsqrt14pd(xmm1, xmm2));
TEST_INSTRUCTION("62F2FD084E4C1A08" , vrsqrt14pd(xmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F2FD084E4C1A08" , vrsqrt14pd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
@@ -7293,15 +7639,6 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F26D08CDCB" , vrsqrt28ss(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F26D08CD4C2B20" , vrsqrt28ss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F26D08CD4C2B20" , vrsqrt28ss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5F852CA" , vrsqrtps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8528C1A80000000" , vrsqrtps(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F8528C1A80000000" , vrsqrtps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC52CA" , vrsqrtps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC528C1A80000000" , vrsqrtps(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC528C1A80000000" , vrsqrtps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5EA52CB" , vrsqrtss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA528C2B80000000" , vrsqrtss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA528C2B80000000" , vrsqrtss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED082CCB" , vscalefpd(xmm1, xmm2, xmm3));
TEST_INSTRUCTION("62F2ED082C4C2B08" , vscalefpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F2ED082C4C2B08" , vscalefpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
@@ -7370,148 +7707,36 @@ static void ASMJIT_NOINLINE testX86AssemblerAVX(AssemblerTester<x86::Assembler>&
TEST_INSTRUCTION("62F3ED4843CB01" , vshufi64x2(zmm1, zmm2, zmm3, 1));
TEST_INSTRUCTION("62F3ED48434C2B0201" , vshufi64x2(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
TEST_INSTRUCTION("62F3ED48434C2B0201" , vshufi64x2(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C6CB01" , vshufpd(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5E9C68C2B8000000001" , vshufpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E9C68C2B8000000001" , vshufpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5EDC6CB01" , vshufpd(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C5EDC68C2B8000000001" , vshufpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5EDC68C2B8000000001" , vshufpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("62F1ED48C6CB01" , vshufpd(zmm1, zmm2, zmm3, 1));
- TEST_INSTRUCTION("62F1ED48C64C2B0201" , vshufpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("62F1ED48C64C2B0201" , vshufpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E8C6CB01" , vshufps(xmm1, xmm2, xmm3, 1));
- TEST_INSTRUCTION("C5E8C68C2B8000000001" , vshufps(xmm1, xmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5E8C68C2B8000000001" , vshufps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5ECC6CB01" , vshufps(ymm1, ymm2, ymm3, 1));
- TEST_INSTRUCTION("C5ECC68C2B8000000001" , vshufps(ymm1, ymm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5ECC68C2B8000000001" , vshufps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("62F16C48C6CB01" , vshufps(zmm1, zmm2, zmm3, 1));
- TEST_INSTRUCTION("62F16C48C64C2B0201" , vshufps(zmm1, zmm2, ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("62F16C48C64C2B0201" , vshufps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128), 1));
- TEST_INSTRUCTION("C5F951CA" , vsqrtpd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F9518C1A80000000" , vsqrtpd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F9518C1A80000000" , vsqrtpd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD51CA" , vsqrtpd(ymm1, ymm2));
- TEST_INSTRUCTION("C5FD518C1A80000000" , vsqrtpd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FD518C1A80000000" , vsqrtpd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD4851CA" , vsqrtpd(zmm1, zmm2));
TEST_INSTRUCTION("62F1FD48514C1A02" , vsqrtpd(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F1FD48514C1A02" , vsqrtpd(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F851CA" , vsqrtps(xmm1, xmm2));
- TEST_INSTRUCTION("C5F8518C1A80000000" , vsqrtps(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F8518C1A80000000" , vsqrtps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC51CA" , vsqrtps(ymm1, ymm2));
- TEST_INSTRUCTION("C5FC518C1A80000000" , vsqrtps(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5FC518C1A80000000" , vsqrtps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C4851CA" , vsqrtps(zmm1, zmm2));
TEST_INSTRUCTION("62F17C48514C1A02" , vsqrtps(zmm1, ptr(edx, ebx, 0, 128)));
TEST_INSTRUCTION("62F17C48514C1A02" , vsqrtps(zmm1, zmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5EB51CB" , vsqrtsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB518C2B80000000" , vsqrtsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB518C2B80000000" , vsqrtsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA51CB" , vsqrtss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA518C2B80000000" , vsqrtss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA518C2B80000000" , vsqrtss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5F8AE9C1180000000" , vstmxcsr(ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("C5F8AE9C1180000000" , vstmxcsr(dword_ptr(ecx, edx, 0, 128)));
- TEST_INSTRUCTION("C5E95CCB" , vsubpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E95C8C2B80000000" , vsubpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E95C8C2B80000000" , vsubpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED5CCB" , vsubpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED5C8C2B80000000" , vsubpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED5C8C2B80000000" , vsubpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED485CCB" , vsubpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED485C4C2B02" , vsubpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED485C4C2B02" , vsubpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E85CCB" , vsubps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E85C8C2B80000000" , vsubps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E85C8C2B80000000" , vsubps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC5CCB" , vsubps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC5C8C2B80000000" , vsubps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC5C8C2B80000000" , vsubps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C485CCB" , vsubps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C485C4C2B02" , vsubps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C485C4C2B02" , vsubps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB5CCB" , vsubsd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EB5C8C2B80000000" , vsubsd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EB5C8C2B80000000" , vsubsd(xmm1, xmm2, qword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5CCB" , vsubss(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5EA5C8C2B80000000" , vsubss(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EA5C8C2B80000000" , vsubss(xmm1, xmm2, dword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C4E2790FCA" , vtestpd(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2790F8C1A80000000" , vtestpd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2790F8C1A80000000" , vtestpd(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D0FCA" , vtestpd(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D0F8C1A80000000" , vtestpd(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D0F8C1A80000000" , vtestpd(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2790ECA" , vtestps(xmm1, xmm2));
- TEST_INSTRUCTION("C4E2790E8C1A80000000" , vtestps(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E2790E8C1A80000000" , vtestps(xmm1, xmmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D0ECA" , vtestps(ymm1, ymm2));
- TEST_INSTRUCTION("C4E27D0E8C1A80000000" , vtestps(ymm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C4E27D0E8C1A80000000" , vtestps(ymm1, ymmword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F92ECA" , vucomisd(xmm1, xmm2));
- TEST_INSTRUCTION("C5F92E8C1A80000000" , vucomisd(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F92E8C1A80000000" , vucomisd(xmm1, qword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F82ECA" , vucomiss(xmm1, xmm2));
- TEST_INSTRUCTION("C5F82E8C1A80000000" , vucomiss(xmm1, ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5F82E8C1A80000000" , vucomiss(xmm1, dword_ptr(edx, ebx, 0, 128)));
- TEST_INSTRUCTION("C5E915CB" , vunpckhpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9158C2B80000000" , vunpckhpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9158C2B80000000" , vunpckhpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED15CB" , vunpckhpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED158C2B80000000" , vunpckhpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED158C2B80000000" , vunpckhpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED4815CB" , vunpckhpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48154C2B02" , vunpckhpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48154C2B02" , vunpckhpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E815CB" , vunpckhps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8158C2B80000000" , vunpckhps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8158C2B80000000" , vunpckhps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC15CB" , vunpckhps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC158C2B80000000" , vunpckhps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC158C2B80000000" , vunpckhps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C4815CB" , vunpckhps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48154C2B02" , vunpckhps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C48154C2B02" , vunpckhps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E914CB" , vunpcklpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9148C2B80000000" , vunpcklpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9148C2B80000000" , vunpcklpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED14CB" , vunpcklpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED148C2B80000000" , vunpcklpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED148C2B80000000" , vunpcklpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED4814CB" , vunpcklpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48144C2B02" , vunpcklpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48144C2B02" , vunpcklpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E814CB" , vunpcklps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8148C2B80000000" , vunpcklps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8148C2B80000000" , vunpcklps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC14CB" , vunpcklps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC148C2B80000000" , vunpcklps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC148C2B80000000" , vunpcklps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C4814CB" , vunpcklps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48144C2B02" , vunpcklps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C48144C2B02" , vunpcklps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E957CB" , vxorpd(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E9578C2B80000000" , vxorpd(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E9578C2B80000000" , vxorpd(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED57CB" , vxorpd(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5ED578C2B80000000" , vxorpd(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5ED578C2B80000000" , vxorpd(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED4857CB" , vxorpd(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F1ED48574C2B02" , vxorpd(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F1ED48574C2B02" , vxorpd(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E857CB" , vxorps(xmm1, xmm2, xmm3));
- TEST_INSTRUCTION("C5E8578C2B80000000" , vxorps(xmm1, xmm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5E8578C2B80000000" , vxorps(xmm1, xmm2, xmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC57CB" , vxorps(ymm1, ymm2, ymm3));
- TEST_INSTRUCTION("C5EC578C2B80000000" , vxorps(ymm1, ymm2, ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5EC578C2B80000000" , vxorps(ymm1, ymm2, ymmword_ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C4857CB" , vxorps(zmm1, zmm2, zmm3));
TEST_INSTRUCTION("62F16C48574C2B02" , vxorps(zmm1, zmm2, ptr(ebx, ebp, 0, 128)));
TEST_INSTRUCTION("62F16C48574C2B02" , vxorps(zmm1, zmm2, zmmword_ptr(ebx, ebp, 0, 128)));
- TEST_INSTRUCTION("C5FC77" , vzeroall());
- TEST_INSTRUCTION("C5F877" , vzeroupper());
}
static void ASMJIT_NOINLINE testX86AssemblerAVX512_FP16(AssemblerTester<x86::Assembler>& tester) noexcept {
@@ -8279,6 +8504,17 @@ static void ASMJIT_NOINLINE testX86AssemblerExtras(AssemblerTester<x86::Assemble
TEST_INSTRUCTION("62F2552850F4" , vpdpbusd(ymm6, ymm5, ymm4));
}
+/*
+// TODO: Failures can be enabled once the assembler always validates.
+static void ASMJIT_NOINLINE testX86AssemblerFailures(AssemblerTester<x86::Assembler>& tester) noexcept {
+ using namespace x86;
+
+ FAIL_INSTRUCTION(kErrorInvalidInstruction , movs(byte_ptr(eax), byte_ptr(esi)));
+ FAIL_INSTRUCTION(kErrorInvalidInstruction , movs(word_ptr(eax), word_ptr(esi)));
+ FAIL_INSTRUCTION(kErrorInvalidInstruction , movs(dword_ptr(eax), dword_ptr(esi)));
+}
+*/
+
bool testX86Assembler(const TestSettings& settings) noexcept {
using namespace x86;
@@ -8286,15 +8522,30 @@ bool testX86Assembler(const TestSettings& settings) noexcept {
tester.printHeader("X86");
testX86AssemblerBase(tester);
+ testX86AssemblerBaseExt(tester);
testX86AssemblerMMX_SSE(tester);
testX86AssemblerAVX(tester);
+ testX86AssemblerAVX_NE_CONVERT(tester);
+ testX86AssemblerAVX_VNNI(tester);
+ testX86AssemblerAVX_VNNI_INT8(tester);
+ testX86AssemblerAVX_VNNI_INT16(tester);
+ testX86AssemblerAVX_SHA512(tester);
+ testX86AssemblerAVX_SM3(tester);
+ testX86AssemblerAVX_SM4(tester);
+ testX86AssemblerFMA(tester);
+ testX86AssemblerFMA4(tester);
+ testX86AssemblerXOP(tester);
+ testX86AssemblerAVX512(tester);
testX86AssemblerAVX512_FP16(tester);
testX86AssemblerExtras(tester);
+ // testX86AssemblerFailures(tester);
+
tester.printSummary();
return tester.didPass();
}
+#undef FAIL_INSTRUCTION
#undef TEST_INSTRUCTION
#endif // !ASMJIT_NO_X86
diff --git a/3rdparty/asmjit/test/asmjit_test_compiler.cpp b/3rdparty/asmjit/test/asmjit_test_compiler.cpp
index f2bc306c6df..cfbb7ede6d9 100644
--- a/3rdparty/asmjit/test/asmjit_test_compiler.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_compiler.cpp
@@ -13,37 +13,37 @@
#include <vector>
#include <chrono>
+#if !defined(ASMJIT_NO_COMPILER)
+
#include "cmdline.h"
#include "asmjitutils.h"
#include "performancetimer.h"
-
#include "asmjit_test_compiler.h"
-#if !defined(ASMJIT_NO_X86) && ASMJIT_ARCH_X86
-#include <asmjit/x86.h>
-void compiler_add_x86_tests(TestApp& app);
-#endif
-
-#if !defined(ASMJIT_NO_AARCH64) && ASMJIT_ARCH_ARM == 64
-#include <asmjit/a64.h>
-void compiler_add_a64_tests(TestApp& app);
-#endif
+#if !defined(ASMJIT_NO_X86)
+ #include <asmjit/x86.h>
+ void compiler_add_x86_tests(TestApp& app);
+#endif // !ASMJIT_NO_X86
-#if !defined(ASMJIT_NO_X86) && ASMJIT_ARCH_X86
- #define ASMJIT_HAVE_WORKING_JIT
-#endif
-
-#if !defined(ASMJIT_NO_AARCH64) && ASMJIT_ARCH_ARM == 64
- #define ASMJIT_HAVE_WORKING_JIT
-#endif
+#if !defined(ASMJIT_NO_AARCH64)
+ #include <asmjit/a64.h>
+ void compiler_add_a64_tests(TestApp& app);
+#endif // !ASMJIT_NO_AARCH64
using namespace asmjit;
int TestApp::handleArgs(int argc, const char* const* argv) {
CmdLine cmd(argc, argv);
+ _arch = cmd.valueOf("--arch", "all");
+ _filter = cmd.valueOf("--filter", nullptr);
+ if (cmd.hasArg("--help")) _helpOnly = true;
if (cmd.hasArg("--verbose")) _verbose = true;
+
+#ifndef ASMJIT_NO_LOGGING
if (cmd.hasArg("--dump-asm")) _dumpAsm = true;
+#endif // !ASMJIT_NO_LOGGING
+
if (cmd.hasArg("--dump-hex")) _dumpHex = true;
return 0;
@@ -55,31 +55,73 @@ void TestApp::showInfo() {
unsigned((ASMJIT_LIBRARY_VERSION >> 8) & 0xFF),
unsigned((ASMJIT_LIBRARY_VERSION ) & 0xFF),
asmjitArchAsString(Arch::kHost));
- printf(" [%s] Verbose (use --verbose to turn verbose output ON)\n", _verbose ? "x" : " ");
- printf(" [%s] DumpAsm (use --dump-asm to turn assembler dumps ON)\n", _dumpAsm ? "x" : " ");
- printf(" [%s] DumpHex (use --dump-hex to dump binary in hexadecimal)\n", _dumpHex ? "x" : " ");
+
+ printf("Usage:\n");
+ printf(" --help Show usage only\n");
+ printf(" --arch=<NAME> Select architecture to run ('all' by default)\n");
+ printf(" --filter=<NAME> Use a filter to restrict which test is called\n");
+ printf(" --verbose Verbose output\n");
+ printf(" --dump-asm Assembler output\n");
+ printf(" --dump-hex Hexadecimal output (relocated, only for host arch)\n");
printf("\n");
}
+#ifndef ASMJIT_NO_LOGGING
+class IndentedStdoutLogger : public Logger {
+public:
+ ASMJIT_NONCOPYABLE(IndentedStdoutLogger)
+
+ size_t _indentation = 0;
+
+ explicit IndentedStdoutLogger(size_t indentation) noexcept
+ : _indentation(indentation) {}
+
+ Error _log(const char* data, size_t size = SIZE_MAX) noexcept override {
+ asmjit::DebugUtils::unused(size);
+ printIndented(data, _indentation);
+ return kErrorOk;
+ }
+};
+#endif // !ASMJIT_NO_LOGGING
+
+bool TestApp::shouldRun(const TestCase* tc) {
+ if (!_filter)
+ return true;
+
+ return strstr(tc->name(), _filter) != nullptr;
+}
+
int TestApp::run() {
-#ifndef ASMJIT_HAVE_WORKING_JIT
- return 0;
-#else
#ifndef ASMJIT_NO_LOGGING
FormatOptions formatOptions;
formatOptions.addFlags(
FormatFlags::kMachineCode |
FormatFlags::kExplainImms |
FormatFlags::kRegCasts );
+ formatOptions.setIndentation(FormatIndentationGroup::kCode, 2);
- FileLogger fileLogger(stdout);
- fileLogger.setOptions(formatOptions);
+ IndentedStdoutLogger printLogger(4);
+ printLogger.setOptions(formatOptions);
StringLogger stringLogger;
stringLogger.setOptions(formatOptions);
-#endif
+ auto printStringLoggerContent = [&]() {
+ if (!_verbose) {
+ printf("%s", stringLogger.data());
+ fflush(stdout);
+ }
+ };
+#else
+ auto printStringLoggerContent = [&]() {};
+#endif // !ASMJIT_NO_LOGGING
+
+ // maybe unused...
+ DebugUtils::unused(printStringLoggerContent);
+
+#ifndef ASMJIT_NO_JIT
JitRuntime runtime;
+#endif // !ASMJIT_NO_JIT
PerformanceTimer compileTimer;
PerformanceTimer finalizeTimer;
@@ -87,62 +129,149 @@ int TestApp::run() {
double finalizeTime = 0;
for (std::unique_ptr<TestCase>& test : _tests) {
+ if (!shouldRun(test.get()))
+ continue;
+
+ _numTests++;
+
for (uint32_t pass = 0; pass < 2; pass++) {
+ bool runnable = false;
CodeHolder code;
SimpleErrorHandler errorHandler;
- code.init(runtime.environment());
+ const char* statusSeparator = " ";
+
+ // Filter architecture to run.
+ if (strcmp(_arch, "all") != 0) {
+ switch (test->arch()) {
+ case Arch::kX86:
+ if (strcmp(_arch, "x86") == 0)
+ break;
+ continue;
+ case Arch::kX64:
+ if (strcmp(_arch, "x64") == 0)
+ break;
+ continue;
+ case Arch::kAArch64:
+ if (strcmp(_arch, "aarch64") == 0)
+ break;
+ continue;
+ default:
+ continue;
+ }
+ }
+
+ // Use platform environment and CPU features when the test can run on the arch.
+#ifndef ASMJIT_NO_JIT
+ if (runtime.arch() == test->arch()) {
+ code.init(runtime.environment(), runtime.cpuFeatures());
+ runnable = true;
+ }
+#endif // !ASMJIT_NO_JIT
+
+ if (!code.isInitialized()) {
+ Environment customEnv;
+ CpuFeatures features;
+
+ switch (test->arch()) {
+ case Arch::kX86:
+ case Arch::kX64:
+ features.add(CpuFeatures::X86::kADX,
+ CpuFeatures::X86::kAVX,
+ CpuFeatures::X86::kAVX2,
+ CpuFeatures::X86::kBMI,
+ CpuFeatures::X86::kBMI2,
+ CpuFeatures::X86::kCMOV,
+ CpuFeatures::X86::kF16C,
+ CpuFeatures::X86::kFMA,
+ CpuFeatures::X86::kFPU,
+ CpuFeatures::X86::kI486,
+ CpuFeatures::X86::kLZCNT,
+ CpuFeatures::X86::kMMX,
+ CpuFeatures::X86::kMMX2,
+ CpuFeatures::X86::kPOPCNT,
+ CpuFeatures::X86::kSSE,
+ CpuFeatures::X86::kSSE2,
+ CpuFeatures::X86::kSSE3,
+ CpuFeatures::X86::kSSSE3,
+ CpuFeatures::X86::kSSE4_1,
+ CpuFeatures::X86::kSSE4_2);
+ break;
+
+ case Arch::kAArch64:
+ features.add(CpuFeatures::ARM::kAES,
+ CpuFeatures::ARM::kASIMD,
+ CpuFeatures::ARM::kIDIVA,
+ CpuFeatures::ARM::kIDIVT,
+ CpuFeatures::ARM::kPMULL);
+ break;
+
+ default:
+ break;
+ }
+
+ customEnv.init(test->arch());
+ code.init(customEnv, features);
+ }
+
code.setErrorHandler(&errorHandler);
if (pass != 0) {
+ printf("[Test:%s] %s", asmjitArchAsString(test->arch()), test->name());
+ fflush(stdout);
+
#ifndef ASMJIT_NO_LOGGING
+ if (_verbose || _dumpAsm || _dumpHex) {
+ printf("\n");
+ statusSeparator = " ";
+ }
+
if (_verbose) {
- code.setLogger(&fileLogger);
+ printf(" [Log]\n");
+ code.setLogger(&printLogger);
}
else {
stringLogger.clear();
code.setLogger(&stringLogger);
}
-#endif
-
- printf("[Test] %s", test->name());
-
-#ifndef ASMJIT_NO_LOGGING
- if (_verbose)
- printf("\n");
-#endif
+#endif // !ASMJIT_NO_LOGGING
}
+ std::unique_ptr<BaseCompiler> cc;
+
+#ifndef ASMJIT_NO_X86
+ if (code.arch() == Arch::kX86 || code.arch() == Arch::kX64)
+ cc = std::unique_ptr<x86::Compiler>(new x86::Compiler(&code));
+#endif // !ASMJIT_NO_X86
-#if !defined(ASMJIT_NO_X86) && ASMJIT_ARCH_X86
- x86::Compiler cc(&code);
-#endif
+#ifndef ASMJIT_NO_AARCH64
+ if (code.arch() == Arch::kAArch64)
+ cc = std::unique_ptr<a64::Compiler>(new a64::Compiler(&code));
+#endif // !ASMJIT_NO_AARCH64
-#if !defined(ASMJIT_NO_AARCH64) && ASMJIT_ARCH_ARM == 64
- a64::Compiler cc(&code);
-#endif
+ if (!cc)
+ continue;
#ifndef ASMJIT_NO_LOGGING
- cc.addDiagnosticOptions(DiagnosticOptions::kRAAnnotate | DiagnosticOptions::kRADebugAll);
-#endif
+ cc->addDiagnosticOptions(DiagnosticOptions::kRAAnnotate | DiagnosticOptions::kRADebugAll);
+#endif // !ASMJIT_NO_LOGGING
compileTimer.start();
- test->compile(cc);
+ test->compile(*cc);
compileTimer.stop();
- void* func = nullptr;
Error err = errorHandler._err;
-
- if (!err) {
+ if (err == kErrorOk) {
finalizeTimer.start();
- err = cc.finalize();
+ err = cc->finalize();
finalizeTimer.stop();
}
- // The first pass is only for timing serialization and compilation, because otherwise it would be biased by
- // logging, which takes much more time than finalize() does. We want to benchmark Compiler the way it would
- // be used in production.
+ // The first pass is only used for timing of serialization and compilation, because otherwise it would be
+ // biased by logging, which takes much more time than finalize() does. We want to benchmark Compiler the
+ // way it would be used in the production.
if (pass == 0) {
+ _outputSize += code.codeSize();
compileTime += compileTimer.duration();
finalizeTime += finalizeTimer.duration();
continue;
@@ -150,72 +279,83 @@ int TestApp::run() {
#ifndef ASMJIT_NO_LOGGING
if (_dumpAsm) {
- if (!_verbose)
- printf("\n");
-
String sb;
- Formatter::formatNodeList(sb, formatOptions, &cc);
- printf("%s", sb.data());
+ Formatter::formatNodeList(sb, formatOptions, cc.get());
+ printf(" [Assembly]\n");
+ printIndented(sb.data(), 4);
}
-#endif
-
- if (err == kErrorOk)
- err = runtime.add(&func, &code);
-
- if (err == kErrorOk && _dumpHex) {
- String sb;
- sb.appendHex((void*)func, code.codeSize());
- printf("\n (HEX: %s)\n", sb.data());
- }
-
- if (_verbose)
- fflush(stdout);
-
- if (err == kErrorOk) {
- _outputSize += code.codeSize();
-
- StringTmp<128> result;
- StringTmp<128> expect;
+#endif // !ASMJIT_NO_LOGGING
+
+#ifndef ASMJIT_NO_JIT
+ if (runnable) {
+ void* func = nullptr;
+ if (err == kErrorOk)
+ err = runtime.add(&func, &code);
+
+ if (err == kErrorOk && _dumpHex) {
+ String sb;
+ sb.appendHex((void*)func, code.codeSize());
+ printf(" [Hex Dump]:\n");
+ for (size_t i = 0; i < sb.size(); i += 76) {
+ printf(" %.60s\n", sb.data() + i);
+ }
+ }
- if (test->run(func, result, expect)) {
- if (!_verbose)
- printf(" [OK]\n");
+ if (_verbose)
+ fflush(stdout);
+
+ if (err == kErrorOk) {
+ StringTmp<128> result;
+ StringTmp<128> expect;
+
+ if (test->run(func, result, expect)) {
+ if (!_verbose)
+ printf("%s[RUN OK]\n", statusSeparator);
+ }
+ else {
+ if (!_verbose)
+ printf("%s[RUN FAILED]\n", statusSeparator);
+
+ printStringLoggerContent();
+ printf(" [Output]\n");
+ printf(" Returned: %s\n", result.data());
+ printf(" Expected: %s\n", expect.data());
+ _numFailed++;
+ }
+
+ if (_dumpAsm)
+ printf("\n");
+
+ runtime.release(func);
}
else {
if (!_verbose)
- printf(" [FAILED]\n");
+ printf("%s[COMPILE FAILED]\n", statusSeparator);
-#ifndef ASMJIT_NO_LOGGING
- if (!_verbose)
- printf("%s", stringLogger.data());
-#endif
-
- printf("[Status]\n");
- printf(" Returned: %s\n", result.data());
- printf(" Expected: %s\n", expect.data());
-
- _nFailed++;
+ printStringLoggerContent();
+ printf(" [Status]\n");
+ printf(" ERROR 0x%08X: %s\n", unsigned(err), errorHandler._message.data());
+ _numFailed++;
}
+ }
+#endif // !ASMJIT_NO_JIT
- if (_dumpAsm)
- printf("\n");
-
- runtime.release(func);
+ if (!runnable) {
+ if (err) {
+ printf(" [Status]\n");
+ printf(" ERROR 0x%08X: %s\n", unsigned(err), errorHandler._message.data());
+ _numFailed++;
+ }
+ else {
+ printf("%s[COMPILE OK]\n", statusSeparator);
+ }
}
- else {
- if (!_verbose)
- printf(" [FAILED]\n");
#ifndef ASMJIT_NO_LOGGING
- if (!_verbose)
- printf("%s", stringLogger.data());
-#endif
-
- printf("[Status]\n");
- printf(" ERROR 0x%08X: %s\n", unsigned(err), errorHandler._message.data());
-
- _nFailed++;
+ if (_verbose || _dumpAsm || _dumpHex) {
+ printf("\n");
}
+#endif // !ASMJIT_NO_LOGGING
}
}
@@ -226,13 +366,12 @@ int TestApp::run() {
printf(" FinalizeTime: %.2f ms\n", finalizeTime);
printf("\n");
- if (_nFailed == 0)
- printf("** SUCCESS: All %u tests passed **\n", unsigned(_tests.size()));
+ if (_numFailed == 0)
+ printf("** SUCCESS: All %u tests passed **\n", _numTests);
else
- printf("** FAILURE: %u of %u tests failed **\n", _nFailed, unsigned(_tests.size()));
+ printf("** FAILURE: %u of %u tests failed **\n", _numFailed, _numTests);
- return _nFailed == 0 ? 0 : 1;
-#endif
+ return _numFailed == 0 ? 0 : 1;
}
int main(int argc, char* argv[]) {
@@ -241,13 +380,24 @@ int main(int argc, char* argv[]) {
app.handleArgs(argc, argv);
app.showInfo();
-#if !defined(ASMJIT_NO_X86) && ASMJIT_ARCH_X86
+#if !defined(ASMJIT_NO_X86)
compiler_add_x86_tests(app);
-#endif
+#endif // !ASMJIT_NO_X86
-#if !defined(ASMJIT_NO_AARCH64) && ASMJIT_ARCH_ARM == 64
+#if !defined(ASMJIT_NO_AARCH64)
compiler_add_a64_tests(app);
-#endif
+#endif // !ASMJIT_NO_AARCH64
return app.run();
}
+
+#else
+
+int main(int argc, char* argv[]) {
+ DebugUtils::unused(argc, argv);
+
+ printf("AsmJit Compiler Test suite is disabled when compiling with ASMJIT_NO_COMPILER\n\n");
+ return 0;
+}
+
+#endif // !ASMJIT_NO_COMPILER
diff --git a/3rdparty/asmjit/test/asmjit_test_compiler.h b/3rdparty/asmjit/test/asmjit_test_compiler.h
index e694b379e11..433d47953dd 100644
--- a/3rdparty/asmjit/test/asmjit_test_compiler.h
+++ b/3rdparty/asmjit/test/asmjit_test_compiler.h
@@ -29,33 +29,41 @@ public:
//! A test case interface for testing AsmJit's Compiler.
class TestCase {
public:
- TestCase(const char* name = nullptr) {
+ TestCase(const char* name, asmjit::Arch arch) {
if (name)
_name.assign(name);
+ _arch = arch;
}
virtual ~TestCase() {}
inline const char* name() const { return _name.data(); }
+ inline asmjit::Arch arch() const { return _arch; }
virtual void compile(asmjit::BaseCompiler& cc) = 0;
virtual bool run(void* func, asmjit::String& result, asmjit::String& expect) = 0;
asmjit::String _name;
+ asmjit::Arch _arch;
};
class TestApp {
public:
std::vector<std::unique_ptr<TestCase>> _tests;
- unsigned _nFailed = 0;
- size_t _outputSize = 0;
-
+ const char* _arch = nullptr;
+ const char* _filter = nullptr;
+ bool _helpOnly = false;
bool _verbose = false;
bool _dumpAsm = false;
bool _dumpHex = false;
- TestApp() noexcept {}
+ unsigned _numTests = 0;
+ unsigned _numFailed = 0;
+ size_t _outputSize = 0;
+
+ TestApp() noexcept
+ : _arch("all") {}
~TestApp() noexcept {}
void add(TestCase* test) noexcept {
@@ -67,6 +75,8 @@ public:
int handleArgs(int argc, const char* const* argv);
void showInfo();
+
+ bool shouldRun(const TestCase* tc);
int run();
};
diff --git a/3rdparty/asmjit/test/asmjit_test_compiler_a64.cpp b/3rdparty/asmjit/test/asmjit_test_compiler_a64.cpp
index 4fc362e7230..4d8cd5e8b2d 100644
--- a/3rdparty/asmjit/test/asmjit_test_compiler_a64.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_compiler_a64.cpp
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: Zlib
#include <asmjit/core.h>
-#if !defined(ASMJIT_NO_AARCH64) && ASMJIT_ARCH_ARM == 64
+#if !defined(ASMJIT_NO_COMPILER) && !defined(ASMJIT_NO_AARCH64)
#include <asmjit/a64.h>
#include <stdio.h>
@@ -21,7 +21,7 @@ using namespace asmjit;
class A64TestCase : public TestCase {
public:
A64TestCase(const char* name = nullptr)
- : TestCase(name) {}
+ : TestCase(name, Arch::kAArch64) {}
virtual void compile(BaseCompiler& cc) override {
compile(static_cast<a64::Compiler&>(cc));
@@ -55,7 +55,7 @@ public:
uint32_t i;
uint32_t argCount = _argCount;
- FuncSignatureBuilder signature;
+ FuncSignature signature;
signature.setRetT<int>();
for (i = 0; i < argCount; i++)
signature.addArgT<int>();
@@ -64,11 +64,11 @@ public:
if (_preserveFP)
funcNode->frame().setPreservedFP();
- arm::Gp sum;
+ a64::Gp sum;
if (argCount) {
for (i = 0; i < argCount; i++) {
- arm::Gp iReg = cc.newInt32("i%u", i);
+ a64::Gp iReg = cc.newInt32("i%u", i);
funcNode->setArg(i, iReg);
if (i == 0)
@@ -184,7 +184,7 @@ public:
result.assignFormat("ret={%u, %u}", resultRet >> 28, resultRet & 0x0FFFFFFFu);
expect.assignFormat("ret={%u, %u}", expectRet >> 28, expectRet & 0x0FFFFFFFu);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -201,24 +201,24 @@ public:
}
virtual void compile(a64::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, void*, const void*, const void*>());
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, void*, const void*, const void*>());
- arm::Gp dst = cc.newUIntPtr("dst");
- arm::Gp src1 = cc.newUIntPtr("src1");
- arm::Gp src2 = cc.newUIntPtr("src2");
+ a64::Gp dst = cc.newUIntPtr("dst");
+ a64::Gp src1 = cc.newUIntPtr("src1");
+ a64::Gp src2 = cc.newUIntPtr("src2");
funcNode->setArg(0, dst);
funcNode->setArg(1, src1);
funcNode->setArg(2, src2);
- arm::Vec v1 = cc.newVecQ("vec1");
- arm::Vec v2 = cc.newVecQ("vec2");
- arm::Vec v3 = cc.newVecQ("vec3");
+ a64::Vec v1 = cc.newVecQ("vec1");
+ a64::Vec v2 = cc.newVecQ("vec2");
+ a64::Vec v3 = cc.newVecQ("vec3");
- cc.ldr(v2, arm::ptr(src1));
- cc.ldr(v3, arm::ptr(src2));
+ cc.ldr(v2, a64::ptr(src1));
+ cc.ldr(v3, a64::ptr(src2));
cc.add(v1.b16(), v2.b16(), v3.b16());
- cc.str(v1, arm::ptr(dst));
+ cc.str(v1, a64::ptr(dst));
cc.endFunc();
}
@@ -235,13 +235,10 @@ public:
ptr_as_func<Func>(_func)(dst, aSrc, bSrc);
- unsigned int resultRet = 0;
- unsigned int expectRet = 0;
-
result.assignFormat("ret={%u, %u, %u, %u}", dst[0], dst[1], dst[2], dst[3]);
expect.assignFormat("ret={%u, %u, %u, %u}", ref[0], ref[1], ref[2], ref[3]);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -264,16 +261,16 @@ public:
}
virtual void compile(a64::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>());
+ cc.addFunc(FuncSignature::build<int>());
- arm::Gp* regs = static_cast<arm::Gp*>(malloc(_regCount * sizeof(arm::Gp)));
+ a64::Gp* regs = static_cast<a64::Gp*>(malloc(_regCount * sizeof(a64::Gp)));
for (uint32_t i = 0; i < _regCount; i++) {
regs[i] = cc.newUInt32("reg%u", i);
cc.mov(regs[i], i + 1);
}
- arm::Gp sum = cc.newUInt32("sum");
+ a64::Gp sum = cc.newUInt32("sum");
cc.mov(sum, 0);
for (uint32_t i = 0; i < _regCount; i++) {
@@ -314,15 +311,15 @@ public:
}
virtual void compile(a64::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>());
+ cc.addFunc(FuncSignature::build<int>());
- arm::Gp addr = cc.newIntPtr("addr");
- arm::Gp val = cc.newIntPtr("val");
+ a64::Gp addr = cc.newIntPtr("addr");
+ a64::Gp val = cc.newIntPtr("val");
Label L_Table = cc.newLabel();
cc.adr(addr, L_Table);
- cc.ldrsw(val, arm::ptr(addr, 8));
+ cc.ldrsw(val, a64::ptr(addr, 8));
cc.ret(val);
cc.endFunc();
@@ -358,11 +355,11 @@ public:
}
virtual void compile(a64::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, void*, size_t>());
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, void*, size_t>());
- arm::Gp p = cc.newIntPtr("p");
- arm::Gp count = cc.newIntPtr("count");
- arm::Gp i = cc.newIntPtr("i");
+ a64::Gp p = cc.newIntPtr("p");
+ a64::Gp count = cc.newIntPtr("count");
+ a64::Gp i = cc.newIntPtr("i");
Label L = cc.newLabel();
funcNode->setArg(0, p);
@@ -413,12 +410,12 @@ public:
}
virtual void compile(a64::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<uint32_t, uint32_t, uint32_t>());
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<uint32_t, uint32_t, uint32_t>());
- arm::Gp x = cc.newUInt32("x");
- arm::Gp y = cc.newUInt32("y");
- arm::Gp r = cc.newUInt32("r");
- arm::Gp fn = cc.newUIntPtr("fn");
+ a64::Gp x = cc.newUInt32("x");
+ a64::Gp y = cc.newUInt32("y");
+ a64::Gp r = cc.newUInt32("r");
+ a64::Gp fn = cc.newUIntPtr("fn");
funcNode->setArg(0, x);
funcNode->setArg(1, y);
@@ -426,7 +423,7 @@ public:
cc.mov(fn, (uint64_t)calledFunc);
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, fn, FuncSignatureT<uint32_t, uint32_t, uint32_t>(CallConvId::kHost));
+ cc.invoke(&invokeNode, fn, FuncSignature::build<uint32_t, uint32_t, uint32_t>());
invokeNode->setArg(0, x);
invokeNode->setArg(1, y);
invokeNode->setRet(0, r);
@@ -466,19 +463,19 @@ public:
}
virtual void compile(a64::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<double, double, double>());
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<double, double, double>());
- arm::Vec x = cc.newVecD("x");
- arm::Vec y = cc.newVecD("y");
- arm::Vec r = cc.newVecD("r");
- arm::Gp fn = cc.newUIntPtr("fn");
+ a64::Vec x = cc.newVecD("x");
+ a64::Vec y = cc.newVecD("y");
+ a64::Vec r = cc.newVecD("r");
+ a64::Gp fn = cc.newUIntPtr("fn");
funcNode->setArg(0, x);
funcNode->setArg(1, y);
cc.mov(fn, (uint64_t)calledFunc);
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, fn, FuncSignatureT<double, double, double>(CallConvId::kHost));
+ cc.invoke(&invokeNode, fn, FuncSignature::build<double, double, double>());
invokeNode->setArg(0, x);
invokeNode->setArg(1, y);
invokeNode->setRet(0, r);
@@ -518,19 +515,19 @@ public:
}
virtual void compile(a64::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<double, double, double>());
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<double, double, double>());
- arm::Vec x = cc.newVecD("x");
- arm::Vec y = cc.newVecD("y");
- arm::Vec r = cc.newVecD("r");
- arm::Gp fn = cc.newUIntPtr("fn");
+ a64::Vec x = cc.newVecD("x");
+ a64::Vec y = cc.newVecD("y");
+ a64::Vec r = cc.newVecD("r");
+ a64::Gp fn = cc.newUIntPtr("fn");
funcNode->setArg(0, x);
funcNode->setArg(1, y);
cc.mov(fn, (uint64_t)calledFunc);
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, fn, FuncSignatureT<double, double, double>(CallConvId::kHost));
+ cc.invoke(&invokeNode, fn, FuncSignature::build<double, double, double>());
invokeNode->setArg(0, y);
invokeNode->setArg(1, x);
invokeNode->setRet(0, r);
@@ -583,14 +580,14 @@ public:
}
virtual void compile(a64::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<float, float, float, uint32_t>());
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<float, float, float, uint32_t>());
- arm::Vec a = cc.newVecS("a");
- arm::Vec b = cc.newVecS("b");
- arm::Gp op = cc.newUInt32("op");
+ a64::Vec a = cc.newVecS("a");
+ a64::Vec b = cc.newVecS("b");
+ a64::Gp op = cc.newUInt32("op");
- arm::Gp target = cc.newIntPtr("target");
- arm::Gp offset = cc.newIntPtr("offset");
+ a64::Gp target = cc.newIntPtr("target");
+ a64::Gp offset = cc.newIntPtr("offset");
Label L_End = cc.newLabel();
@@ -605,7 +602,7 @@ public:
funcNode->setArg(2, op);
cc.adr(target, L_Table);
- cc.ldrsw(offset, arm::ptr(target, op, arm::sxtw(2)));
+ cc.ldrsw(offset, a64::ptr(target, op, a64::sxtw(2)));
cc.add(target, target, offset);
// JumpAnnotation allows to annotate all possible jump targets of
@@ -687,4 +684,4 @@ void compiler_add_a64_tests(TestApp& app) {
app.addT<A64Test_JumpTable>();
}
-#endif // !ASMJIT_NO_AARCH64 && ASMJIT_ARCH_ARM == 64
+#endif // !ASMJIT_NO_COMPILER && !ASMJIT_NO_AARCH64
diff --git a/3rdparty/asmjit/test/asmjit_test_compiler_x86.cpp b/3rdparty/asmjit/test/asmjit_test_compiler_x86.cpp
index a3a067d2ea8..9ff6d893855 100644
--- a/3rdparty/asmjit/test/asmjit_test_compiler_x86.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_compiler_x86.cpp
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: Zlib
#include <asmjit/core.h>
-#if !defined(ASMJIT_NO_X86) && ASMJIT_ARCH_X86
+#if !defined(ASMJIT_NO_X86) && !defined(ASMJIT_NO_COMPILER)
#include <asmjit/x86.h>
#include <setjmp.h>
@@ -12,8 +12,10 @@
#include <stdlib.h>
#include <string.h>
-// Required for function tests that pass / return XMM registers.
-#include <emmintrin.h>
+#if ASMJIT_ARCH_X86
+ // Required for function tests that pass / return XMM registers.
+ #include <emmintrin.h>
+#endif
#include "asmjit_test_misc.h"
#include "asmjit_test_compiler.h"
@@ -31,7 +33,7 @@ using namespace asmjit;
class X86TestCase : public TestCase {
public:
X86TestCase(const char* name = nullptr)
- : TestCase(name) {}
+ : TestCase(name, Arch::kHost == Arch::kX86 ? Arch::kX86 : Arch::kX64) {}
virtual void compile(BaseCompiler& cc) override {
compile(static_cast<x86::Compiler&>(cc));
@@ -65,7 +67,7 @@ public:
uint32_t i;
uint32_t argCount = _argCount;
- FuncSignatureBuilder signature(CallConvId::kHost);
+ FuncSignature signature(CallConvId::kCDecl);
signature.setRetT<int>();
for (i = 0; i < argCount; i++)
signature.addArgT<int>();
@@ -201,7 +203,7 @@ public:
result.assignFormat("ret={%u, %u}", resultRet >> 28, resultRet & 0x0FFFFFFFu);
expect.assignFormat("ret={%u, %u}", expectRet >> 28, expectRet & 0x0FFFFFFFu);
- return resultRet == expectRet;
+ return result == expect;
}
uint32_t _argCount;
@@ -221,7 +223,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
cc.endFunc();
}
@@ -236,8 +238,8 @@ public:
}
};
-// x86::Compiler - X86Test_AlignNone
-// =================================
+// x86::Compiler - X86Test_NoAlign
+// ===============================
class X86Test_NoAlign : public X86TestCase {
public:
@@ -248,7 +250,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
cc.align(AlignMode::kCode, 0);
cc.align(AlignMode::kCode, 1);
cc.endFunc();
@@ -265,6 +267,35 @@ public:
}
};
+// x86::Compiler - X86Test_IndirectBranchProtection
+// ================================================
+
+class X86Test_IndirectBranchProtection : public X86TestCase {
+public:
+ X86Test_IndirectBranchProtection() : X86TestCase("IndirectBranchProtection") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_IndirectBranchProtection());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ FuncNode* func = cc.addFunc(FuncSignature::build<void>());
+ func->addAttributes(FuncAttributes::kIndirectBranchProtection);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ DebugUtils::unused(result, expect);
+
+ typedef void (*Func)(void);
+ Func func = ptr_as_func<Func>(_func);
+
+ func();
+ return true;
+ }
+};
+
+
// x86::Compiler - X86Test_JumpMerge
// =================================
@@ -277,7 +308,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- Label L0 = cc.newLabel();
+ Label L0 = cc.newLabel();
Label L1 = cc.newLabel();
Label L2 = cc.newLabel();
Label LEnd = cc.newLabel();
@@ -285,7 +316,7 @@ public:
x86::Gp dst = cc.newIntPtr("dst");
x86::Gp val = cc.newInt32("val");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, int*, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, int*, int>());
funcNode->setArg(0, dst);
funcNode->setArg(1, val);
@@ -341,7 +372,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
Label L1 = cc.newLabel();
Label L2 = cc.newLabel();
@@ -382,7 +413,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
for (uint32_t i = 0; i < 1000; i++) {
Label L = cc.newLabel();
cc.jmp(L);
@@ -406,7 +437,7 @@ public:
result.assignFormat("ret={%d}", resultRet);
expect.assignFormat("ret={%d}", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -422,7 +453,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
Label L_1 = cc.newLabel();
Label L_2 = cc.newLabel();
@@ -484,7 +515,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
Label L_1 = cc.newLabel();
Label L_2 = cc.newLabel();
@@ -557,7 +588,7 @@ public:
Label L_Div = cc.newLabel();
Label L_End = cc.newLabel();
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<float, float, float, uint32_t>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<float, float, float, uint32_t>());
funcNode->setArg(0, a);
funcNode->setArg(1, b);
funcNode->setArg(2, op);
@@ -658,7 +689,7 @@ public:
Label L_Case1 = cc.newLabel();
Label L_End = cc.newLabel();
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int>());
funcNode->setArg(0, value);
cc.bind(L_Begin);
@@ -715,6 +746,126 @@ public:
}
};
+// x86::Compiler - X86Test_JumpTable3
+// ==================================
+
+class X86Test_JumpTable3 : public X86TestCase {
+public:
+ X86Test_JumpTable3()
+ : X86TestCase("JumpTable {Jumping to a single label}") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_JumpTable3());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ cc.addFunc(FuncSignature::build<int>());
+
+ Label L_Target = cc.newLabel();
+ x86::Gp target = cc.newUIntPtr("target");
+ x86::Gp result = cc.newUInt32("result");
+
+ JumpAnnotation* annotation = cc.newJumpAnnotation();
+ annotation->addLabel(L_Target);
+
+ cc.lea(target, x86::ptr(L_Target));
+ cc.jmp(target, annotation);
+
+ cc.bind(L_Target);
+ cc.mov(result, 1234);
+ cc.ret(result);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef int (*Func)(void);
+ Func func = ptr_as_func<Func>(_func);
+
+ int out = func();
+ int expected = 1234;
+
+ result.assignFormat("ret=%d", out);
+ expect.assignFormat("ret=%d", expected);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_JumpTable4
+// ==================================
+
+class X86Test_JumpTable4 : public X86TestCase {
+public:
+ X86Test_JumpTable4()
+ : X86TestCase("JumpTable {Jumping to a single label and multiple labels}") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_JumpTable4());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ x86::Gp result = cc.newUInt32("result");
+ x86::Gp condition = cc.newUInt32("condition");
+
+ FuncNode* func = cc.addFunc(FuncSignature::build<int, int>());
+ func->setArg(0, condition);
+
+ Label L_NonZero = cc.newLabel();
+ cc.test(condition, condition);
+ cc.jnz(L_NonZero);
+
+ {
+ JumpAnnotation* annotation = cc.newJumpAnnotation();
+ Label L_Target = cc.newLabel();
+ annotation->addLabel(L_Target);
+
+ x86::Gp target = cc.newUIntPtr("target");
+ cc.lea(target, x86::ptr(L_Target));
+ cc.jmp(target, annotation);
+ cc.bind(L_Target);
+ cc.mov(result, 1234);
+ cc.ret(result);
+ }
+
+ {
+ JumpAnnotation* annotation = cc.newJumpAnnotation();
+ Label L_Target1 = cc.newLabel();
+ Label L_Target2 = cc.newLabel();
+ annotation->addLabel(L_Target1);
+ annotation->addLabel(L_Target2);
+
+ cc.bind(L_NonZero);
+ x86::Gp target = cc.newUIntPtr("target");
+ cc.lea(target, x86::ptr(L_Target1));
+ cc.jmp(target, annotation);
+
+ cc.bind(L_Target1);
+ cc.mov(result, 4321);
+ cc.ret(result);
+
+ // Never executed.
+ cc.bind(L_Target2);
+ cc.mov(result, 0);
+ cc.ret(result);
+ }
+
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef int (*Func)(int);
+ Func func = ptr_as_func<Func>(_func);
+
+ int results[2] = { func(0), func(1) };
+ int expected[2] = { 1234, 4321 };
+
+ result.assignFormat("ret={%d, %d}", results[0], results[1]);
+ expect.assignFormat("ret={%d, %d}", expected[0], expected[1]);
+
+ return result == expect;
+ }
+};
+
// x86::Compiler - X86Test_AllocBase
// =================================
@@ -727,7 +878,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
x86::Gp v0 = cc.newInt32("v0");
x86::Gp v1 = cc.newInt32("v1");
@@ -761,7 +912,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -782,7 +933,7 @@ public:
x86::Gp a0 = cc.newIntPtr("a0");
x86::Gp a1 = cc.newIntPtr("a1");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, int*, int*>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, int*, int*>());
funcNode->setArg(0, a0);
funcNode->setArg(1, a1);
@@ -820,8 +971,8 @@ public:
typedef void (*Func)(int*, int*);
Func func = ptr_as_func<Func>(_func);
- int resultX;
- int resultY;
+ int resultX = 0;
+ int resultY = 0;
int expectX = 36;
int expectY = -36;
@@ -850,7 +1001,7 @@ public:
x86::Gp a = cc.newIntPtr("a");
x86::Gp v[32];
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, uint32_t*>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, uint32_t*>());
funcNode->setArg(0, a);
for (uint32_t i = 0; i < ASMJIT_ARRAY_SIZE(v); i++) v[i] = cc.newInt32("v%d", i);
@@ -875,8 +1026,8 @@ public:
Func func = ptr_as_func<Func>(_func);
uint32_t i;
- uint32_t resultBuf[32];
- uint32_t expectBuf[32];
+ uint32_t resultBuf[32] {};
+ uint32_t expectBuf[32] {};
for (i = 0; i < ASMJIT_ARRAY_SIZE(resultBuf); i++)
expectBuf[i] = i * 32;
@@ -896,15 +1047,516 @@ public:
}
};
-// x86::Compiler - X86Test_AllocImul1
+// x86::Compiler - X86Test_AllocInt8
+// =================================
+
+class X86Test_AllocInt8 : public X86TestCase {
+public:
+ X86Test_AllocInt8() : X86TestCase("AllocInt8") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_AllocInt8());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ x86::Gp x = cc.newInt8("x");
+ x86::Gp y = cc.newInt32("y");
+
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int8_t>());
+ funcNode->setArg(0, x);
+
+ cc.movsx(y, x);
+
+ cc.ret(y);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef int (*Func)(int8_t);
+ Func func = ptr_as_func<Func>(_func);
+
+ int resultRet = func(int8_t(-13));
+ int expectRet = -13;
+
+ result.assignFormat("ret=%d", resultRet);
+ expect.assignFormat("ret=%d", expectRet);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AllocUnhandledArg
+// =========================================
+
+class X86Test_AllocUnhandledArg : public X86TestCase {
+public:
+ X86Test_AllocUnhandledArg() : X86TestCase("AllocUnhandledArg") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_AllocUnhandledArg());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ x86::Gp x = cc.newInt32("x");
+
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int, int>());
+ funcNode->setArg(2, x);
+
+ cc.ret(x);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef int (*Func)(int, int, int);
+ Func func = ptr_as_func<Func>(_func);
+
+ int resultRet = func(42, 155, 199);
+ int expectRet = 199;
+
+ result.assignFormat("ret={%d}", resultRet);
+ expect.assignFormat("ret={%d}", expectRet);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AllocArgsIntPtr
+// =======================================
+
+class X86Test_AllocArgsIntPtr : public X86TestCase {
+public:
+ X86Test_AllocArgsIntPtr() : X86TestCase("AllocArgsIntPtr") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_AllocArgsIntPtr());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, void*, void*, void*, void*, void*, void*, void*, void*>());
+ x86::Gp var[8];
+
+ for (uint32_t i = 0; i < 8; i++) {
+ var[i] = cc.newIntPtr("var%u", i);
+ funcNode->setArg(i, var[i]);
+ }
+
+ for (uint32_t i = 0; i < 8; i++) {
+ cc.add(var[i], int(i + 1));
+ }
+
+ // Move some data into buffer provided by arguments so we can verify if it
+ // really works without looking into assembler output.
+ for (uint32_t i = 0; i < 8; i++) {
+ cc.add(x86::byte_ptr(var[i]), int(i + 1));
+ }
+
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef void (*Func)(void*, void*, void*, void*, void*, void*, void*, void*);
+ Func func = ptr_as_func<Func>(_func);
+
+ uint8_t resultBuf[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ uint8_t expectBuf[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
+
+ func(resultBuf, resultBuf, resultBuf, resultBuf,
+ resultBuf, resultBuf, resultBuf, resultBuf);
+
+ result.assignFormat("buf={%d, %d, %d, %d, %d, %d, %d, %d, %d}",
+ resultBuf[0], resultBuf[1], resultBuf[2], resultBuf[3],
+ resultBuf[4], resultBuf[5], resultBuf[6], resultBuf[7],
+ resultBuf[8]);
+ expect.assignFormat("buf={%d, %d, %d, %d, %d, %d, %d, %d, %d}",
+ expectBuf[0], expectBuf[1], expectBuf[2], expectBuf[3],
+ expectBuf[4], expectBuf[5], expectBuf[6], expectBuf[7],
+ expectBuf[8]);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AllocArgsFloat
+// ======================================
+
+class X86Test_AllocArgsFloat : public X86TestCase {
+public:
+ X86Test_AllocArgsFloat() : X86TestCase("AllocArgsFloat") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_AllocArgsFloat());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, float, float, float, float, float, float, float, void*>());
+
+ x86::Gp p = cc.newIntPtr("p");
+ x86::Xmm xv[7];
+
+ for (uint32_t i = 0; i < 7; i++) {
+ xv[i] = cc.newXmmSs("xv%u", i);
+ funcNode->setArg(i, xv[i]);
+ }
+
+ funcNode->setArg(7, p);
+
+ cc.addss(xv[0], xv[1]);
+ cc.addss(xv[0], xv[2]);
+ cc.addss(xv[0], xv[3]);
+ cc.addss(xv[0], xv[4]);
+ cc.addss(xv[0], xv[5]);
+ cc.addss(xv[0], xv[6]);
+
+ cc.movss(x86::ptr(p), xv[0]);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef void (*Func)(float, float, float, float, float, float, float, float*);
+ Func func = ptr_as_func<Func>(_func);
+
+ float resultRet = 0;
+ float expectRet = 1.0f + 2.0f + 3.0f + 4.0f + 5.0f + 6.0f + 7.0f;
+
+ func(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, &resultRet);
+
+ result.assignFormat("ret={%g}", resultRet);
+ expect.assignFormat("ret={%g}", expectRet);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AllocArgsDouble
+// =======================================
+
+class X86Test_AllocArgsDouble : public X86TestCase {
+public:
+ X86Test_AllocArgsDouble() : X86TestCase("AllocArgsDouble") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_AllocArgsDouble());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, double, double, double, double, double, double, double, void*>());
+
+ x86::Gp p = cc.newIntPtr("p");
+ x86::Xmm xv[7];
+
+ for (uint32_t i = 0; i < 7; i++) {
+ xv[i] = cc.newXmmSd("xv%u", i);
+ funcNode->setArg(i, xv[i]);
+ }
+
+ funcNode->setArg(7, p);
+
+ cc.addsd(xv[0], xv[1]);
+ cc.addsd(xv[0], xv[2]);
+ cc.addsd(xv[0], xv[3]);
+ cc.addsd(xv[0], xv[4]);
+ cc.addsd(xv[0], xv[5]);
+ cc.addsd(xv[0], xv[6]);
+
+ cc.movsd(x86::ptr(p), xv[0]);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef void (*Func)(double, double, double, double, double, double, double, double*);
+ Func func = ptr_as_func<Func>(_func);
+
+ double resultRet = 0;
+ double expectRet = 1.0 + 2.0 + 3.0 + 4.0 + 5.0 + 6.0 + 7.0;
+
+ func(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, &resultRet);
+
+ result.assignFormat("ret={%g}", resultRet);
+ expect.assignFormat("ret={%g}", expectRet);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AllocArgsVec
+// ====================================
+
+#if ASMJIT_ARCH_X86
+class X86Test_AllocArgsVec : public X86TestCase {
+public:
+ X86Test_AllocArgsVec() : X86TestCase("AllocArgsVec") {}
+
+ static void add(TestApp& app) {
+ // Not supported on Windows.
+#ifndef _WIN32
+ app.add(new X86Test_AllocArgsVec());
+#else
+ DebugUtils::unused(app);
+#endif
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ x86::Xmm a = cc.newXmm("aXmm");
+ x86::Xmm b = cc.newXmm("bXmm");
+
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<x86::Xmm, x86::Xmm, x86::Xmm>());
+ funcNode->setArg(0, a);
+ funcNode->setArg(1, b);
+
+ cc.paddb(a, b);
+ cc.ret(a);
+
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef __m128i (*Func)(__m128i, __m128i);
+ Func func = ptr_as_func<Func>(_func);
+
+ uint8_t aData[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+ uint8_t bData[16] = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+
+ uint8_t rData[16] {};
+ uint8_t eData[16] = { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 };
+
+ __m128i aVec = _mm_loadu_si128(reinterpret_cast<const __m128i*>(aData));
+ __m128i bVec = _mm_loadu_si128(reinterpret_cast<const __m128i*>(bData));
+
+ __m128i rVec = func(aVec, bVec);
+ _mm_storeu_si128(reinterpret_cast<__m128i*>(rData), rVec);
+
+ result.appendHex(rData, 16);
+ expect.appendHex(eData, 16);
+
+ return result == expect;
+ }
+};
+#endif // ASMJIT_ARCH_X86
+
+// x86::Compiler - X86Test_AllocRetFloat1
+// ======================================
+
+class X86Test_AllocRetFloat1 : public X86TestCase {
+public:
+ X86Test_AllocRetFloat1() : X86TestCase("AllocRetFloat1") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_AllocRetFloat1());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ x86::Xmm x = cc.newXmmSs("x");
+
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<float, float>());
+ funcNode->setArg(0, x);
+
+ cc.ret(x);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef float (*Func)(float);
+ Func func = ptr_as_func<Func>(_func);
+
+ float resultRet = func(42.0f);
+ float expectRet = 42.0f;
+
+ result.assignFormat("ret={%g}", resultRet);
+ expect.assignFormat("ret={%g}", expectRet);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AllocRetFloat2
+// ======================================
+
+class X86Test_AllocRetFloat2 : public X86TestCase {
+public:
+ X86Test_AllocRetFloat2() : X86TestCase("AllocRetFloat2") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_AllocRetFloat2());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ x86::Xmm x = cc.newXmmSs("x");
+ x86::Xmm y = cc.newXmmSs("y");
+
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<float, float, float>());
+ funcNode->setArg(0, x);
+ funcNode->setArg(1, y);
+
+ cc.addss(x, y);
+ cc.ret(x);
+
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef float (*Func)(float, float);
+ Func func = ptr_as_func<Func>(_func);
+
+ float resultRet = func(1.0f, 2.0f);
+ float expectRet = 1.0f + 2.0f;
+
+ result.assignFormat("ret={%g}", resultRet);
+ expect.assignFormat("ret={%g}", expectRet);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AllocRetDouble1
+// =======================================
+
+class X86Test_AllocRetDouble1 : public X86TestCase {
+public:
+ X86Test_AllocRetDouble1() : X86TestCase("AllocRetDouble1") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_AllocRetDouble1());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ x86::Xmm x = cc.newXmmSd("x");
+
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<double, double>());
+ funcNode->setArg(0, x);
+
+ cc.ret(x);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef double (*Func)(double);
+ Func func = ptr_as_func<Func>(_func);
+
+ double resultRet = func(42.0);
+ double expectRet = 42.0;
+
+ result.assignFormat("ret={%g}", resultRet);
+ expect.assignFormat("ret={%g}", expectRet);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AllocRetDouble2
+// =======================================
+
+class X86Test_AllocRetDouble2 : public X86TestCase {
+public:
+ X86Test_AllocRetDouble2() : X86TestCase("AllocRetDouble2") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_AllocRetDouble2());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ x86::Xmm x = cc.newXmmSd("x");
+ x86::Xmm y = cc.newXmmSd("y");
+
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<double, double, double>());
+ funcNode->setArg(0, x);
+ funcNode->setArg(1, y);
+
+ cc.addsd(x, y);
+ cc.ret(x);
+
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef double (*Func)(double, double);
+ Func func = ptr_as_func<Func>(_func);
+
+ double resultRet = func(1.0, 2.0);
+ double expectRet = 1.0 + 2.0;
+
+ result.assignFormat("ret={%g}", resultRet);
+ expect.assignFormat("ret={%g}", expectRet);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AllocStack
// ==================================
-class X86Test_AllocImul1 : public X86TestCase {
+class X86Test_AllocStack : public X86TestCase {
public:
- X86Test_AllocImul1() : X86TestCase("AllocImul1") {}
+ X86Test_AllocStack() : X86TestCase("AllocStack") {}
+
+ enum { kSize = 256 };
static void add(TestApp& app) {
- app.add(new X86Test_AllocImul1());
+ app.add(new X86Test_AllocStack());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ cc.addFunc(FuncSignature::build<int>());
+
+ x86::Mem stack = cc.newStack(kSize, 1);
+ stack.setSize(1);
+
+ x86::Gp i = cc.newIntPtr("i");
+ x86::Gp a = cc.newInt32("a");
+ x86::Gp b = cc.newInt32("b");
+
+ Label L_1 = cc.newLabel();
+ Label L_2 = cc.newLabel();
+
+ // Fill stack by sequence [0, 1, 2, 3 ... 255].
+ cc.xor_(i, i);
+
+ x86::Mem stackWithIndex = stack.clone();
+ stackWithIndex.setIndex(i, 0);
+
+ cc.bind(L_1);
+ cc.mov(stackWithIndex, i.r8());
+ cc.inc(i);
+ cc.cmp(i, 255);
+ cc.jle(L_1);
+
+ // Sum sequence in stack.
+ cc.xor_(i, i);
+ cc.xor_(a, a);
+
+ cc.bind(L_2);
+ cc.movzx(b, stackWithIndex);
+ cc.add(a, b);
+ cc.inc(i);
+ cc.cmp(i, 255);
+ cc.jle(L_2);
+
+ cc.ret(a);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef int (*Func)(void);
+ Func func = ptr_as_func<Func>(_func);
+
+ int resultRet = func();
+ int expectRet = 32640;
+
+ result.assignInt(resultRet);
+ expect.assignInt(expectRet);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_Imul1
+// =============================
+
+class X86Test_Imul1 : public X86TestCase {
+public:
+ X86Test_Imul1() : X86TestCase("Imul1") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_Imul1());
}
virtual void compile(x86::Compiler& cc) {
@@ -915,7 +1567,7 @@ public:
x86::Gp vLo = cc.newInt32("vLo");
x86::Gp src = cc.newInt32("src");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, int*, int*, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, int*, int*, int, int>());
funcNode->setArg(0, dstHi);
funcNode->setArg(1, dstLo);
funcNode->setArg(2, vLo);
@@ -934,8 +1586,8 @@ public:
int v0 = 4;
int v1 = 4;
- int resultHi;
- int resultLo;
+ int resultHi = 0;
+ int resultLo = 0;
int expectHi = 0;
int expectLo = v0 * v1;
@@ -949,22 +1601,22 @@ public:
}
};
-// x86::Compiler - X86Test_AllocImul2
-// ==================================
+// x86::Compiler - X86Test_Imul2
+// =============================
-class X86Test_AllocImul2 : public X86TestCase {
+class X86Test_Imul2 : public X86TestCase {
public:
- X86Test_AllocImul2() : X86TestCase("AllocImul2") {}
+ X86Test_Imul2() : X86TestCase("Imul2") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocImul2());
+ app.add(new X86Test_Imul2());
}
virtual void compile(x86::Compiler& cc) {
x86::Gp dst = cc.newIntPtr("dst");
x86::Gp src = cc.newIntPtr("src");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, int*, const int*>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, int*, const int*>());
funcNode->setArg(0, dst);
funcNode->setArg(1, src);
@@ -1001,15 +1653,15 @@ public:
}
};
-// x86::Compiler - X86Test_AllocIdiv1
-// ==================================
+// x86::Compiler - X86Test_Idiv1
+// =============================
-class X86Test_AllocIdiv1 : public X86TestCase {
+class X86Test_Idiv1 : public X86TestCase {
public:
- X86Test_AllocIdiv1() : X86TestCase("AllocIdiv1") {}
+ X86Test_Idiv1() : X86TestCase("Idiv1") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocIdiv1());
+ app.add(new X86Test_Idiv1());
}
virtual void compile(x86::Compiler& cc) {
@@ -1017,7 +1669,7 @@ public:
x86::Gp b = cc.newInt32("b");
x86::Gp dummy = cc.newInt32("dummy");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int>());
funcNode->setArg(0, a);
funcNode->setArg(1, b);
@@ -1041,19 +1693,19 @@ public:
result.assignFormat("result=%d", resultRet);
expect.assignFormat("result=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
-// x86::Compiler - X86Test_AllocSetz
-// =================================
+// x86::Compiler - X86Test_Setz
+// ============================
-class X86Test_AllocSetz : public X86TestCase {
+class X86Test_Setz : public X86TestCase {
public:
- X86Test_AllocSetz() : X86TestCase("AllocSetz") {}
+ X86Test_Setz() : X86TestCase("Setz") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocSetz());
+ app.add(new X86Test_Setz());
}
virtual void compile(x86::Compiler& cc) {
@@ -1061,7 +1713,7 @@ public:
x86::Gp src1 = cc.newInt32("src1");
x86::Gp dst0 = cc.newIntPtr("dst0");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, int, int, char*>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, int, int, char*>());
funcNode->setArg(0, src0);
funcNode->setArg(1, src1);
funcNode->setArg(2, dst0);
@@ -1076,7 +1728,7 @@ public:
typedef void (*Func)(int, int, char*);
Func func = ptr_as_func<Func>(_func);
- char resultBuf[4];
+ char resultBuf[4] {};
char expectBuf[4] = { 1, 0, 0, 1 };
func(0, 0, &resultBuf[0]); // We are expecting 1 (0 == 0).
@@ -1094,15 +1746,15 @@ public:
}
};
-// x86::Compiler - X86Test_AllocShlRor
-// ===================================
+// x86::Compiler - X86Test_ShlRor
+// ==============================
-class X86Test_AllocShlRor : public X86TestCase {
+class X86Test_ShlRor : public X86TestCase {
public:
- X86Test_AllocShlRor() : X86TestCase("AllocShlRor") {}
+ X86Test_ShlRor() : X86TestCase("ShlRor") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocShlRor());
+ app.add(new X86Test_ShlRor());
}
virtual void compile(x86::Compiler& cc) {
@@ -1111,7 +1763,7 @@ public:
x86::Gp vShlParam = cc.newInt32("vShlParam");
x86::Gp vRorParam = cc.newInt32("vRorParam");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, int*, int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, int*, int, int, int>());
funcNode->setArg(0, dst);
funcNode->setArg(1, var);
funcNode->setArg(2, vShlParam);
@@ -1129,7 +1781,7 @@ public:
int v0 = 0x000000FF;
- int resultRet;
+ int resultRet = 0;
int expectRet = 0x0000FF00;
func(&resultRet, v0, 16, 8);
@@ -1137,21 +1789,21 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
-// x86::Compiler - X86Test_AllocGpbLo
-// ==================================
+// x86::Compiler - X86Test_GpbLo
+// =============================
-class X86Test_AllocGpbLo1 : public X86TestCase {
+class X86Test_GpbLo1 : public X86TestCase {
public:
- X86Test_AllocGpbLo1() : X86TestCase("AllocGpbLo1") {}
+ X86Test_GpbLo1() : X86TestCase("GpbLo1") {}
enum : uint32_t { kCount = 32 };
static void add(TestApp& app) {
- app.add(new X86Test_AllocGpbLo1());
+ app.add(new X86Test_GpbLo1());
}
virtual void compile(x86::Compiler& cc) {
@@ -1159,7 +1811,7 @@ public:
x86::Gp rSum = cc.newUInt32("rSum");
x86::Gp x[kCount];
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<uint32_t, uint32_t*>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<uint32_t, uint32_t*>());
funcNode->setArg(0, rPtr);
for (uint32_t i = 0; i < kCount; i++) {
@@ -1196,10 +1848,9 @@ public:
uint32_t i;
uint32_t buf[kCount];
- uint32_t resultRet;
- uint32_t expectRet;
+ uint32_t resultRet = 0;
+ uint32_t expectRet = 0;
- expectRet = 0;
for (i = 0; i < kCount; i++) {
buf[i] = 1;
}
@@ -1223,25 +1874,25 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
-// x86::Compiler - X86Test_AllocGpbLo2
-// ===================================
+// x86::Compiler - X86Test_GpbLo2
+// ==============================
-class X86Test_AllocGpbLo2 : public X86TestCase {
+class X86Test_GpbLo2 : public X86TestCase {
public:
- X86Test_AllocGpbLo2() : X86TestCase("AllocGpbLo2") {}
+ X86Test_GpbLo2() : X86TestCase("GpbLo2") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocGpbLo2());
+ app.add(new X86Test_GpbLo2());
}
virtual void compile(x86::Compiler& cc) {
x86::Gp v = cc.newUInt32("v");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<uint32_t, uint32_t>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<uint32_t, uint32_t>());
funcNode->setArg(0, v);
cc.mov(v.r8(), 0xFF);
@@ -1259,19 +1910,19 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
-// x86::Compiler - X86Test_AllocRepMovsb
-// =====================================
+// x86::Compiler - X86Test_RepMovsb
+// ================================
-class X86Test_AllocRepMovsb : public X86TestCase {
+class X86Test_RepMovsb : public X86TestCase {
public:
- X86Test_AllocRepMovsb() : X86TestCase("AllocRepMovsb") {}
+ X86Test_RepMovsb() : X86TestCase("RepMovsb") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocRepMovsb());
+ app.add(new X86Test_RepMovsb());
}
virtual void compile(x86::Compiler& cc) {
@@ -1279,7 +1930,7 @@ public:
x86::Gp src = cc.newIntPtr("src");
x86::Gp cnt = cc.newIntPtr("cnt");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, void*, void*, size_t>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, void*, void*, size_t>());
funcNode->setArg(0, dst);
funcNode->setArg(1, src);
funcNode->setArg(2, cnt);
@@ -1303,15 +1954,15 @@ public:
}
};
-// x86::Compiler - X86Test_AllocIfElse1
-// ====================================
+// x86::Compiler - X86Test_IfElse1
+// ===============================
-class X86Test_AllocIfElse1 : public X86TestCase {
+class X86Test_IfElse1 : public X86TestCase {
public:
- X86Test_AllocIfElse1() : X86TestCase("AllocIfElse1") {}
+ X86Test_IfElse1() : X86TestCase("IfElse1") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocIfElse1());
+ app.add(new X86Test_IfElse1());
}
virtual void compile(x86::Compiler& cc) {
@@ -1321,7 +1972,7 @@ public:
Label L_1 = cc.newLabel();
Label L_2 = cc.newLabel();
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int>());
funcNode->setArg(0, v1);
funcNode->setArg(1, v2);
@@ -1353,15 +2004,15 @@ public:
}
};
-// x86::Compiler - X86Test_AllocIfElse2
-// ====================================
+// x86::Compiler - X86Test_IfElse2
+// ===============================
-class X86Test_AllocIfElse2 : public X86TestCase {
+class X86Test_IfElse2 : public X86TestCase {
public:
- X86Test_AllocIfElse2() : X86TestCase("AllocIfElse2") {}
+ X86Test_IfElse2() : X86TestCase("IfElse2") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocIfElse2());
+ app.add(new X86Test_IfElse2());
}
virtual void compile(x86::Compiler& cc) {
@@ -1373,7 +2024,7 @@ public:
Label L_3 = cc.newLabel();
Label L_4 = cc.newLabel();
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int>());
funcNode->setArg(0, v1);
funcNode->setArg(1, v2);
@@ -1412,15 +2063,15 @@ public:
}
};
-// x86::Compiler - X86Test_AllocIfElse3
-// ====================================
+// x86::Compiler - X86Test_IfElse3
+// ===============================
-class X86Test_AllocIfElse3 : public X86TestCase {
+class X86Test_IfElse3 : public X86TestCase {
public:
- X86Test_AllocIfElse3() : X86TestCase("AllocIfElse3") {}
+ X86Test_IfElse3() : X86TestCase("IfElse3") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocIfElse3());
+ app.add(new X86Test_IfElse3());
}
virtual void compile(x86::Compiler& cc) {
@@ -1432,7 +2083,7 @@ public:
Label L_Loop = cc.newLabel();
Label L_Exit = cc.newLabel();
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int>());
funcNode->setArg(0, v1);
funcNode->setArg(1, v2);
@@ -1471,15 +2122,15 @@ public:
}
};
-// x86::Compiler - X86Test_AllocIfElse4
-// ====================================
+// x86::Compiler - X86Test_IfElse4
+// ===============================
-class X86Test_AllocIfElse4 : public X86TestCase {
+class X86Test_IfElse4 : public X86TestCase {
public:
- X86Test_AllocIfElse4() : X86TestCase("AllocIfElse4") {}
+ X86Test_IfElse4() : X86TestCase("IfElse4") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocIfElse4());
+ app.add(new X86Test_IfElse4());
}
virtual void compile(x86::Compiler& cc) {
@@ -1492,7 +2143,7 @@ public:
Label L_Loop2 = cc.newLabel();
Label L_Exit = cc.newLabel();
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int>());
funcNode->setArg(0, v1);
funcNode->setArg(1, v2);
@@ -1534,516 +2185,17 @@ public:
}
};
-// x86::Compiler - X86Test_AllocInt8
-// =================================
-
-class X86Test_AllocInt8 : public X86TestCase {
-public:
- X86Test_AllocInt8() : X86TestCase("AllocInt8") {}
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocInt8());
- }
-
- virtual void compile(x86::Compiler& cc) {
- x86::Gp x = cc.newInt8("x");
- x86::Gp y = cc.newInt32("y");
-
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, char>(CallConvId::kHost));
- funcNode->setArg(0, x);
-
- cc.movsx(y, x);
-
- cc.ret(y);
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef int (*Func)(char);
- Func func = ptr_as_func<Func>(_func);
-
- int resultRet = func(-13);
- int expectRet = -13;
-
- result.assignFormat("ret=%d", resultRet);
- expect.assignFormat("ret=%d", expectRet);
-
- return result == expect;
- }
-};
-
-// x86::Compiler - X86Test_AllocUnhandledArg
-// =========================================
-
-class X86Test_AllocUnhandledArg : public X86TestCase {
-public:
- X86Test_AllocUnhandledArg() : X86TestCase("AllocUnhandledArg") {}
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocUnhandledArg());
- }
-
- virtual void compile(x86::Compiler& cc) {
- x86::Gp x = cc.newInt32("x");
-
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int, int>(CallConvId::kHost));
- funcNode->setArg(2, x);
-
- cc.ret(x);
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef int (*Func)(int, int, int);
- Func func = ptr_as_func<Func>(_func);
-
- int resultRet = func(42, 155, 199);
- int expectRet = 199;
-
- result.assignFormat("ret={%d}", resultRet);
- expect.assignFormat("ret={%d}", expectRet);
-
- return result == expect;
- }
-};
-
-// x86::Compiler - X86Test_AllocArgsIntPtr
-// =======================================
-
-class X86Test_AllocArgsIntPtr : public X86TestCase {
-public:
- X86Test_AllocArgsIntPtr() : X86TestCase("AllocArgsIntPtr") {}
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocArgsIntPtr());
- }
-
- virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, void*, void*, void*, void*, void*, void*, void*, void*>(CallConvId::kHost));
- x86::Gp var[8];
-
- for (uint32_t i = 0; i < 8; i++) {
- var[i] = cc.newIntPtr("var%u", i);
- funcNode->setArg(i, var[i]);
- }
-
- for (uint32_t i = 0; i < 8; i++) {
- cc.add(var[i], int(i + 1));
- }
-
- // Move some data into buffer provided by arguments so we can verify if it
- // really works without looking into assembler output.
- for (uint32_t i = 0; i < 8; i++) {
- cc.add(x86::byte_ptr(var[i]), int(i + 1));
- }
-
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef void (*Func)(void*, void*, void*, void*, void*, void*, void*, void*);
- Func func = ptr_as_func<Func>(_func);
-
- uint8_t resultBuf[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- uint8_t expectBuf[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
-
- func(resultBuf, resultBuf, resultBuf, resultBuf,
- resultBuf, resultBuf, resultBuf, resultBuf);
-
- result.assignFormat("buf={%d, %d, %d, %d, %d, %d, %d, %d, %d}",
- resultBuf[0], resultBuf[1], resultBuf[2], resultBuf[3],
- resultBuf[4], resultBuf[5], resultBuf[6], resultBuf[7],
- resultBuf[8]);
- expect.assignFormat("buf={%d, %d, %d, %d, %d, %d, %d, %d, %d}",
- expectBuf[0], expectBuf[1], expectBuf[2], expectBuf[3],
- expectBuf[4], expectBuf[5], expectBuf[6], expectBuf[7],
- expectBuf[8]);
-
- return result == expect;
- }
-};
-
-// x86::Compiler - X86Test_AllocArgsFloat
-// ======================================
-
-class X86Test_AllocArgsFloat : public X86TestCase {
-public:
- X86Test_AllocArgsFloat() : X86TestCase("AllocArgsFloat") {}
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocArgsFloat());
- }
-
- virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, float, float, float, float, float, float, float, void*>(CallConvId::kHost));
-
- x86::Gp p = cc.newIntPtr("p");
- x86::Xmm xv[7];
-
- for (uint32_t i = 0; i < 7; i++) {
- xv[i] = cc.newXmmSs("xv%u", i);
- funcNode->setArg(i, xv[i]);
- }
-
- funcNode->setArg(7, p);
-
- cc.addss(xv[0], xv[1]);
- cc.addss(xv[0], xv[2]);
- cc.addss(xv[0], xv[3]);
- cc.addss(xv[0], xv[4]);
- cc.addss(xv[0], xv[5]);
- cc.addss(xv[0], xv[6]);
-
- cc.movss(x86::ptr(p), xv[0]);
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef void (*Func)(float, float, float, float, float, float, float, float*);
- Func func = ptr_as_func<Func>(_func);
-
- float resultRet;
- float expectRet = 1.0f + 2.0f + 3.0f + 4.0f + 5.0f + 6.0f + 7.0f;
-
- func(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, &resultRet);
-
- result.assignFormat("ret={%g}", resultRet);
- expect.assignFormat("ret={%g}", expectRet);
-
- return resultRet == expectRet;
- }
-};
-
-// x86::Compiler - X86Test_AllocArgsDouble
-// =======================================
-
-class X86Test_AllocArgsDouble : public X86TestCase {
-public:
- X86Test_AllocArgsDouble() : X86TestCase("AllocArgsDouble") {}
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocArgsDouble());
- }
-
- virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, double, double, double, double, double, double, double, void*>(CallConvId::kHost));
-
- x86::Gp p = cc.newIntPtr("p");
- x86::Xmm xv[7];
-
- for (uint32_t i = 0; i < 7; i++) {
- xv[i] = cc.newXmmSd("xv%u", i);
- funcNode->setArg(i, xv[i]);
- }
-
- funcNode->setArg(7, p);
-
- cc.addsd(xv[0], xv[1]);
- cc.addsd(xv[0], xv[2]);
- cc.addsd(xv[0], xv[3]);
- cc.addsd(xv[0], xv[4]);
- cc.addsd(xv[0], xv[5]);
- cc.addsd(xv[0], xv[6]);
-
- cc.movsd(x86::ptr(p), xv[0]);
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef void (*Func)(double, double, double, double, double, double, double, double*);
- Func func = ptr_as_func<Func>(_func);
-
- double resultRet;
- double expectRet = 1.0 + 2.0 + 3.0 + 4.0 + 5.0 + 6.0 + 7.0;
-
- func(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, &resultRet);
-
- result.assignFormat("ret={%g}", resultRet);
- expect.assignFormat("ret={%g}", expectRet);
-
- return resultRet == expectRet;
- }
-};
-
-// x86::Compiler - X86Test_AllocArgsVec
-// ====================================
-
-class X86Test_AllocArgsVec : public X86TestCase {
-public:
- X86Test_AllocArgsVec() : X86TestCase("AllocArgsVec") {}
-
- static void add(TestApp& app) {
- // Not supported on Windows.
-#ifndef _WIN32
- app.add(new X86Test_AllocArgsVec());
-#else
- DebugUtils::unused(app);
-#endif
- }
-
- virtual void compile(x86::Compiler& cc) {
- x86::Xmm a = cc.newXmm("aXmm");
- x86::Xmm b = cc.newXmm("bXmm");
-
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<x86::Xmm, x86::Xmm, x86::Xmm>(CallConvId::kHost));
- funcNode->setArg(0, a);
- funcNode->setArg(1, b);
-
- cc.paddb(a, b);
- cc.ret(a);
-
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef __m128i (*Func)(__m128i, __m128i);
- Func func = ptr_as_func<Func>(_func);
-
- uint8_t aData[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
- uint8_t bData[16] = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
-
- uint8_t rData[16];
- uint8_t eData[16] = { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 };
-
- __m128i aVec = _mm_loadu_si128(reinterpret_cast<const __m128i*>(aData));
- __m128i bVec = _mm_loadu_si128(reinterpret_cast<const __m128i*>(bData));
-
- __m128i rVec = func(aVec, bVec);
- _mm_storeu_si128(reinterpret_cast<__m128i*>(rData), rVec);
-
- result.appendHex(rData, 16);
- expect.appendHex(eData, 16);
-
- return result == expect;
- }
-};
-
-// x86::Compiler - X86Test_AllocRetFloat1
-// ======================================
-
-class X86Test_AllocRetFloat1 : public X86TestCase {
-public:
- X86Test_AllocRetFloat1() : X86TestCase("AllocRetFloat1") {}
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocRetFloat1());
- }
-
- virtual void compile(x86::Compiler& cc) {
- x86::Xmm x = cc.newXmmSs("x");
-
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<float, float>(CallConvId::kHost));
- funcNode->setArg(0, x);
-
- cc.ret(x);
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef float (*Func)(float);
- Func func = ptr_as_func<Func>(_func);
-
- float resultRet = func(42.0f);
- float expectRet = 42.0f;
-
- result.assignFormat("ret={%g}", resultRet);
- expect.assignFormat("ret={%g}", expectRet);
-
- return resultRet == expectRet;
- }
-};
-
-// x86::Compiler - X86Test_AllocRetFloat2
-// ======================================
-
-class X86Test_AllocRetFloat2 : public X86TestCase {
-public:
- X86Test_AllocRetFloat2() : X86TestCase("AllocRetFloat2") {}
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocRetFloat2());
- }
-
- virtual void compile(x86::Compiler& cc) {
- x86::Xmm x = cc.newXmmSs("x");
- x86::Xmm y = cc.newXmmSs("y");
-
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<float, float, float>(CallConvId::kHost));
- funcNode->setArg(0, x);
- funcNode->setArg(1, y);
-
- cc.addss(x, y);
- cc.ret(x);
-
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef float (*Func)(float, float);
- Func func = ptr_as_func<Func>(_func);
-
- float resultRet = func(1.0f, 2.0f);
- float expectRet = 1.0f + 2.0f;
-
- result.assignFormat("ret={%g}", resultRet);
- expect.assignFormat("ret={%g}", expectRet);
-
- return resultRet == expectRet;
- }
-};
-
-// x86::Compiler - X86Test_AllocRetDouble1
-// =======================================
-
-class X86Test_AllocRetDouble1 : public X86TestCase {
-public:
- X86Test_AllocRetDouble1() : X86TestCase("AllocRetDouble1") {}
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocRetDouble1());
- }
-
- virtual void compile(x86::Compiler& cc) {
- x86::Xmm x = cc.newXmmSd("x");
-
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<double, double>(CallConvId::kHost));
- funcNode->setArg(0, x);
-
- cc.ret(x);
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef double (*Func)(double);
- Func func = ptr_as_func<Func>(_func);
-
- double resultRet = func(42.0);
- double expectRet = 42.0;
-
- result.assignFormat("ret={%g}", resultRet);
- expect.assignFormat("ret={%g}", expectRet);
-
- return resultRet == expectRet;
- }
-};
-
-// x86::Compiler - X86Test_AllocRetDouble2
-// =======================================
-
-class X86Test_AllocRetDouble2 : public X86TestCase {
-public:
- X86Test_AllocRetDouble2() : X86TestCase("AllocRetDouble2") {}
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocRetDouble2());
- }
-
- virtual void compile(x86::Compiler& cc) {
- x86::Xmm x = cc.newXmmSd("x");
- x86::Xmm y = cc.newXmmSd("y");
-
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<double, double, double>(CallConvId::kHost));
- funcNode->setArg(0, x);
- funcNode->setArg(1, y);
-
- cc.addsd(x, y);
- cc.ret(x);
-
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef double (*Func)(double, double);
- Func func = ptr_as_func<Func>(_func);
-
- double resultRet = func(1.0, 2.0);
- double expectRet = 1.0 + 2.0;
-
- result.assignFormat("ret={%g}", resultRet);
- expect.assignFormat("ret={%g}", expectRet);
-
- return resultRet == expectRet;
- }
-};
-
-// x86::Compiler - X86Test_AllocStack
-// ==================================
-
-class X86Test_AllocStack : public X86TestCase {
-public:
- X86Test_AllocStack() : X86TestCase("AllocStack") {}
-
- enum { kSize = 256 };
-
- static void add(TestApp& app) {
- app.add(new X86Test_AllocStack());
- }
-
- virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
-
- x86::Mem stack = cc.newStack(kSize, 1);
- stack.setSize(1);
-
- x86::Gp i = cc.newIntPtr("i");
- x86::Gp a = cc.newInt32("a");
- x86::Gp b = cc.newInt32("b");
-
- Label L_1 = cc.newLabel();
- Label L_2 = cc.newLabel();
-
- // Fill stack by sequence [0, 1, 2, 3 ... 255].
- cc.xor_(i, i);
-
- x86::Mem stackWithIndex = stack.clone();
- stackWithIndex.setIndex(i, 0);
-
- cc.bind(L_1);
- cc.mov(stackWithIndex, i.r8());
- cc.inc(i);
- cc.cmp(i, 255);
- cc.jle(L_1);
-
- // Sum sequence in stack.
- cc.xor_(i, i);
- cc.xor_(a, a);
-
- cc.bind(L_2);
- cc.movzx(b, stackWithIndex);
- cc.add(a, b);
- cc.inc(i);
- cc.cmp(i, 255);
- cc.jle(L_2);
-
- cc.ret(a);
- cc.endFunc();
- }
-
- virtual bool run(void* _func, String& result, String& expect) {
- typedef int (*Func)(void);
- Func func = ptr_as_func<Func>(_func);
-
- int resultRet = func();
- int expectRet = 32640;
-
- result.assignInt(resultRet);
- expect.assignInt(expectRet);
-
- return resultRet == expectRet;
- }
-};
-
-// x86::Compiler - X86Test_AllocMemcpy
-// ===================================
+// x86::Compiler - X86Test_Memcpy
+// ==============================
-class X86Test_AllocMemcpy : public X86TestCase {
+class X86Test_Memcpy : public X86TestCase {
public:
- X86Test_AllocMemcpy() : X86TestCase("AllocMemcpy") {}
+ X86Test_Memcpy() : X86TestCase("Memcpy") {}
enum { kCount = 32 };
static void add(TestApp& app) {
- app.add(new X86Test_AllocMemcpy());
+ app.add(new X86Test_Memcpy());
}
virtual void compile(x86::Compiler& cc) {
@@ -2054,7 +2206,7 @@ public:
Label L_Loop = cc.newLabel(); // Create base labels we use
Label L_Exit = cc.newLabel(); // in our function.
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, uint32_t*, const uint32_t*, size_t>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, uint32_t*, const uint32_t*, size_t>());
funcNode->setArg(0, dst);
funcNode->setArg(1, src);
funcNode->setArg(2, cnt);
@@ -2114,15 +2266,15 @@ public:
}
};
-// x86::Compiler - X86Test_AllocExtraBlock
-// =======================================
+// x86::Compiler - X86Test_ExtraBlock
+// ==================================
-class X86Test_AllocExtraBlock : public X86TestCase {
+class X86Test_ExtraBlock : public X86TestCase {
public:
- X86Test_AllocExtraBlock() : X86TestCase("AllocExtraBlock") {}
+ X86Test_ExtraBlock() : X86TestCase("ExtraBlock") {}
static void add(TestApp& app) {
- app.add(new X86Test_AllocExtraBlock());
+ app.add(new X86Test_ExtraBlock());
}
virtual void compile(x86::Compiler& cc) {
@@ -2131,7 +2283,7 @@ public:
x86::Gp a = cc.newInt32("a");
x86::Gp b = cc.newInt32("b");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int, int>());
funcNode->setArg(0, cond);
funcNode->setArg(1, a);
funcNode->setArg(2, b);
@@ -2176,17 +2328,17 @@ public:
}
};
-// x86::Compiler - X86Test_AllocAlphaBlend
-// =======================================
+// x86::Compiler - X86Test_AlphaBlend
+// ==================================
-class X86Test_AllocAlphaBlend : public X86TestCase {
+class X86Test_AlphaBlend : public X86TestCase {
public:
- X86Test_AllocAlphaBlend() : X86TestCase("AllocAlphaBlend") {}
+ X86Test_AlphaBlend() : X86TestCase("AlphaBlend") {}
enum { kCount = 17 };
static void add(TestApp& app) {
- app.add(new X86Test_AllocAlphaBlend());
+ app.add(new X86Test_AlphaBlend());
}
static uint32_t blendSrcOver(uint32_t d, uint32_t s) {
@@ -2254,6 +2406,158 @@ public:
}
};
+// x86::Compiler - X86Test_AVX512_KK
+// =================================
+
+class X86Test_AVX512_KK : public X86TestCase {
+public:
+ X86Test_AVX512_KK() : X86TestCase("AVX512_KK") {}
+
+ static void add(TestApp& app) {
+ const CpuInfo& cpuInfo = CpuInfo::host();
+
+ if (cpuInfo.features().x86().hasAVX512_F()) {
+ app.add(new X86Test_AVX512_KK());
+ }
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<uint32_t, const void*, const void*, uint32_t>());
+
+ x86::Gp a = cc.newIntPtr("a");
+ x86::Gp b = cc.newIntPtr("b");
+ x86::Gp pred = cc.newInt32("pred");
+ x86::Gp result = cc.newInt32("result");
+
+ x86::Vec va = cc.newZmm("va");
+ x86::Vec vb = cc.newZmm("vb");
+ x86::KReg kIn = cc.newKd("k_in");
+ x86::KReg kOut = cc.newKd("k_out");
+
+ funcNode->setArg(0, a);
+ funcNode->setArg(1, b);
+ funcNode->setArg(2, pred);
+
+ cc.vmovdqu32(va, x86::ptr(a));
+ cc.vmovdqu32(vb, x86::ptr(b));
+ cc.kmovd(kIn, pred);
+ cc.k(kIn).vpcmpeqd(kOut, va, vb);
+ cc.kmovd(result, kOut);
+ cc.ret(result);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef uint32_t (*Func)(const void*, const void*, uint32_t prevK);
+ Func func = ptr_as_func<Func>(_func);
+
+ static const uint32_t srcA[16] = { 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 };
+ static const uint32_t srcB[16] = { 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1 };
+
+ uint32_t ret = func(srcA, srcB, 0xF0F0);
+
+ result.assignFormat("0x%08X", ret);
+ expect.assignFormat("0x%08X", 0xA040u);
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_AVX512_TernLog
+// ======================================
+
+class X86Test_AVX512_TernLog : public X86TestCase {
+public:
+ X86Test_AVX512_TernLog() : X86TestCase("AVX512_TernLog") {}
+
+ static void add(TestApp& app) {
+ const CpuInfo& cpuInfo = CpuInfo::host();
+
+ if (cpuInfo.features().x86().hasAVX512_F()) {
+ app.add(new X86Test_AVX512_TernLog());
+ }
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, void*>());
+
+ x86::Gp out = cc.newIntPtr("outPtr");
+ x86::Vec vec = cc.newZmm("vec");
+
+ funcNode->setArg(0, out);
+
+ cc.vpternlogd(vec, vec, vec, 0xFFu);
+ cc.vmovdqu8(x86::ptr(out), vec);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef void (*Func)(void*);
+ Func func = ptr_as_func<Func>(_func);
+
+ uint32_t out[16];
+ func(out);
+
+ result.assign("{");
+ expect.assign("{");
+
+ for (uint32_t i = 0; i < 16; i++) {
+ if (i) {
+ result.append(", ");
+ expect.append(", ");
+ }
+ result.appendFormat("0x%08X", out[i]);
+ expect.appendFormat("0x%08X", 0xFFFFFFFFu);
+ }
+
+ result.append("}");
+ expect.append("}");
+
+ return result == expect;
+ }
+};
+
+// x86::Compiler - X86Test_FuncArgInt8
+// ===================================
+
+class X86Test_FuncArgInt8 : public X86TestCase {
+public:
+ X86Test_FuncArgInt8() : X86TestCase("FuncArgInt8") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_FuncArgInt8());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ x86::Gp v0 = cc.newUInt32("v0");
+ x86::Gp v1 = cc.newUInt32("v1");
+
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<unsigned, uint8_t, uint8_t, uint32_t>());
+ funcNode->setArg(0, v0);
+ funcNode->setArg(1, v1);
+
+ cc.add(v0, v1);
+
+ cc.ret(v0);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef uint32_t (*Func)(uint8_t, uint8_t, uint32_t);
+ Func func = ptr_as_func<Func>(_func);
+
+ uint32_t arg = uint32_t(uintptr_t(_func) & 0xFFFFFFFF);
+
+ unsigned resultRet = func(uint8_t(arg & 0xFF), uint8_t(arg & 0xFF), arg);
+ unsigned expectRet = (arg & 0xFF) * 2;
+
+ result.assignFormat("ret=%u", resultRet);
+ expect.assignFormat("ret=%u", expectRet);
+
+ return result == expect;
+ }
+};
+
// x86::Compiler - X86Test_FuncCallBase1
// =====================================
@@ -2270,7 +2574,7 @@ public:
x86::Gp v1 = cc.newInt32("v1");
x86::Gp v2 = cc.newInt32("v2");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int, int>());
funcNode->setArg(0, v0);
funcNode->setArg(1, v1);
funcNode->setArg(2, v2);
@@ -2282,7 +2586,7 @@ public:
// Call a function.
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignatureT<int, int, int, int>(CallConvId::kHost));
+ cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignature::build<int, int, int, int>());
invokeNode->setArg(0, v2);
invokeNode->setArg(1, v1);
invokeNode->setArg(2, v0);
@@ -2302,7 +2606,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static int calledFunc(int a, int b, int c) { return (a + b) * c; }
@@ -2322,7 +2626,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
const int kTokenSize = 32;
@@ -2342,19 +2646,19 @@ public:
cc.lea(p2, s2);
// Try to corrupt the stack if wrongly allocated.
- cc.invoke(&invokeNode, imm((void*)memcpy), FuncSignatureT<void*, void*, void*, size_t>(CallConvId::kCDecl));
+ cc.invoke(&invokeNode, imm((void*)memcpy), FuncSignature::build<void*, void*, void*, size_t>());
invokeNode->setArg(0, p1);
invokeNode->setArg(1, imm(token));
invokeNode->setArg(2, imm(kTokenSize));
invokeNode->setRet(0, p1);
- cc.invoke(&invokeNode, imm((void*)memcpy), FuncSignatureT<void*, void*, void*, size_t>(CallConvId::kCDecl));
+ cc.invoke(&invokeNode, imm((void*)memcpy), FuncSignature::build<void*, void*, void*, size_t>());
invokeNode->setArg(0, p2);
invokeNode->setArg(1, imm(token));
invokeNode->setArg(2, imm(kTokenSize));
invokeNode->setRet(0, p2);
- cc.invoke(&invokeNode, imm((void*)memcmp), FuncSignatureT<int, void*, void*, size_t>(CallConvId::kCDecl));
+ cc.invoke(&invokeNode, imm((void*)memcmp), FuncSignature::build<int, void*, void*, size_t>());
invokeNode->setArg(0, p1);
invokeNode->setArg(1, p2);
invokeNode->setArg(2, imm(kTokenSize));
@@ -2385,7 +2689,7 @@ public:
result.assignInt(resultRet);
expect.assignInt(expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -2405,7 +2709,7 @@ public:
x86::Gp y = cc.newInt32("y");
x86::Gp z = cc.newInt32("z");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int, int>());
funcNode->setArg(0, x);
funcNode->setArg(1, y);
funcNode->setArg(2, z);
@@ -2413,7 +2717,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)calledFunc),
- FuncSignatureT<int, int, int, int>(CallConvId::kStdCall));
+ FuncSignature::build<int, int, int, int>(CallConvId::kStdCall));
invokeNode->setArg(0, x);
invokeNode->setArg(1, y);
invokeNode->setArg(2, z);
@@ -2433,7 +2737,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
// STDCALL function that is called inside the generated one.
@@ -2456,16 +2760,16 @@ public:
virtual void compile(x86::Compiler& cc) {
x86::Gp var = cc.newInt32("var");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int>());
funcNode->setArg(0, var);
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignatureT<int, int>(CallConvId::kFastCall));
+ cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignature::build<int, int>(CallConvId::kFastCall));
invokeNode->setArg(0, var);
invokeNode->setRet(0, var);
- cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignatureT<int, int>(CallConvId::kFastCall));
+ cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignature::build<int, int>(CallConvId::kFastCall));
invokeNode->setArg(0, var);
invokeNode->setRet(0, var);
@@ -2483,7 +2787,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
// FASTCALL function that is called inside the generated one.
@@ -2495,6 +2799,7 @@ public:
// x86::Compiler - X86Test_FuncCallSIMD
// ====================================
+#if ASMJIT_ARCH_X86
class X86Test_FuncCallSIMD : public X86TestCase {
public:
bool _useVectorCall;
@@ -2513,7 +2818,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, void*, const void*, const void*>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, void*, const void*, const void*>());
x86::Gp resultPtr = cc.newIntPtr("resultPtr");
x86::Gp aPtr = cc.newIntPtr("aPtr");
@@ -2542,7 +2847,7 @@ public:
cc.movdqu(bXmm, x86::ptr(bPtr));
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, pFn, FuncSignatureT<x86::Xmm, x86::Xmm, x86::Xmm>(ccId));
+ cc.invoke(&invokeNode, pFn, FuncSignature::build<x86::Xmm, x86::Xmm, x86::Xmm>(ccId));
invokeNode->setArg(0, aXmm);
invokeNode->setArg(1, bXmm);
@@ -2560,7 +2865,7 @@ public:
uint8_t aData[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
uint8_t bData[16] = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
- uint8_t rData[16];
+ uint8_t rData[16] {};
uint8_t eData[16] = { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 };
func(rData, aData, bData);
@@ -2581,6 +2886,7 @@ public:
}
#endif
};
+#endif // ASMJIT_ARCH_X86
// x86::Compiler - X86Test_FuncCallLight
// =====================================
@@ -2594,8 +2900,8 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncSignatureT<void, const void*, const void*, const void*, const void*, void*> f1Sig(CallConvId::kCDecl);
- FuncSignatureT<x86::Xmm, x86::Xmm, x86::Xmm> f2Sig(CallConvId::kLightCall2);
+ FuncSignature f1Sig = FuncSignature::build<void, const void*, const void*, const void*, const void*, void*>();
+ FuncSignature f2Sig = FuncSignature::build<x86::Xmm, x86::Xmm, x86::Xmm>(CallConvId::kLightCall2);
FuncNode* f1Node = cc.newFunc(f1Sig);
FuncNode* f2Node = cc.newFunc(f2Sig);
@@ -2668,7 +2974,7 @@ public:
int16_t c[8] = { 1, 3, 9, 7, 5, 4, 2, 1 };
int16_t d[8] = { 2, 0,-6,-4,-2,-1, 1, 2 };
- int16_t o[8];
+ int16_t o[8] {};
int oExp = 7 * 3;
func(a, b, c, d, o);
@@ -2696,7 +3002,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
// Prepare.
x86::Gp va = cc.newInt32("va");
@@ -2725,7 +3031,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)calledFunc),
- FuncSignatureT<int, int, int, int, int, int, int, int, int, int, int>(CallConvId::kHost));
+ FuncSignature::build<int, int, int, int, int, int, int, int, int, int, int>());
invokeNode->setArg(0, va);
invokeNode->setArg(1, vb);
invokeNode->setArg(2, vc);
@@ -2752,7 +3058,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -2772,7 +3078,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
// Prepare.
x86::Gp a = cc.newInt32("a");
@@ -2782,7 +3088,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)calledFunc),
- FuncSignatureT<int, int, int, int, int, int, int, int, int, int, int>(CallConvId::kHost));
+ FuncSignature::build<int, int, int, int, int, int, int, int, int, int, int>());
invokeNode->setArg(0, a);
invokeNode->setArg(1, a);
invokeNode->setArg(2, a);
@@ -2809,7 +3115,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -2825,7 +3131,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
// Prepare.
x86::Gp rv = cc.newInt32("rv");
@@ -2834,7 +3140,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)X86Test_FuncCallManyArgs::calledFunc),
- FuncSignatureT<int, int, int, int, int, int, int, int, int, int, int>(CallConvId::kHost));
+ FuncSignature::build<int, int, int, int, int, int, int, int, int, int, int>());
invokeNode->setArg(0, imm(0x03));
invokeNode->setArg(1, imm(0x12));
@@ -2862,7 +3168,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -2891,7 +3197,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
// Prepare.
x86::Gp rv = cc.newInt32("rv");
@@ -2900,7 +3206,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)calledFunc),
- FuncSignatureT<int, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*>(CallConvId::kHost));
+ FuncSignature::build<int, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*>());
invokeNode->setArg(0, imm(0x01));
invokeNode->setArg(1, imm(0x02));
@@ -2928,7 +3234,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -2952,7 +3258,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int&, int&, int&, int&>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int&, int&, int&, int&>());
// Prepare.
x86::Gp arg1 = cc.newInt32();
@@ -2970,7 +3276,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)calledFunc),
- FuncSignatureT<int, int&, int&, int&, int&>(CallConvId::kHost));
+ FuncSignature::build<int, int&, int&, int&, int&>());
invokeNode->setArg(0, arg1);
invokeNode->setArg(1, arg2);
@@ -2994,7 +3300,7 @@ public:
result.assignFormat("ret={%08X %08X %08X %08X %08X}", resultRet, inputs[0], inputs[1], inputs[2], inputs[3]);
expect.assignFormat("ret={%08X %08X %08X %08X %08X}", expectRet, outputs[0], outputs[1], outputs[2], outputs[3]);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -3014,7 +3320,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<float, float, float>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<float, float, float>());
x86::Xmm a = cc.newXmmSs("a");
x86::Xmm b = cc.newXmmSs("b");
@@ -3025,7 +3331,7 @@ public:
// Call function.
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignatureT<float, float, float>(CallConvId::kHost));
+ cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignature::build<float, float, float>());
invokeNode->setArg(0, a);
invokeNode->setArg(1, b);
invokeNode->setRet(0, ret);
@@ -3044,7 +3350,7 @@ public:
result.assignFormat("ret=%g", resultRet);
expect.assignFormat("ret=%g", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -3064,7 +3370,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<double, double, double>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<double, double, double>());
x86::Xmm a = cc.newXmmSd("a");
x86::Xmm b = cc.newXmmSd("b");
@@ -3074,7 +3380,7 @@ public:
funcNode->setArg(1, b);
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignatureT<double, double, double>(CallConvId::kHost));
+ cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignature::build<double, double, double>());
invokeNode->setArg(0, a);
invokeNode->setArg(1, b);
invokeNode->setRet(0, ret);
@@ -3093,7 +3399,7 @@ public:
result.assignFormat("ret=%g", resultRet);
expect.assignFormat("ret=%g", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -3116,7 +3422,7 @@ public:
InvokeNode* invokeNode;
x86::Gp result;
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int, int>());
funcNode->setArg(0, x);
funcNode->setArg(1, y);
funcNode->setArg(2, op);
@@ -3136,7 +3442,7 @@ public:
cc.bind(opAdd);
result = cc.newInt32("result_1");
- cc.invoke(&invokeNode, (uint64_t)calledFuncAdd, FuncSignatureT<int, int, int>(CallConvId::kHost));
+ cc.invoke(&invokeNode, (uint64_t)calledFuncAdd, FuncSignature::build<int, int, int>());
invokeNode->setArg(0, x);
invokeNode->setArg(1, y);
invokeNode->setRet(0, result);
@@ -3145,7 +3451,7 @@ public:
cc.bind(opMul);
result = cc.newInt32("result_2");
- cc.invoke(&invokeNode, (uint64_t)calledFuncMul, FuncSignatureT<int, int, int>(CallConvId::kHost));
+ cc.invoke(&invokeNode, (uint64_t)calledFuncMul, FuncSignature::build<int, int, int>());
invokeNode->setArg(0, x);
invokeNode->setArg(1, y);
invokeNode->setRet(0, result);
@@ -3199,7 +3505,7 @@ public:
x86::Gp acc0 = cc.newInt32("acc0");
x86::Gp acc1 = cc.newInt32("acc1");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int*>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int*>());
funcNode->setArg(0, buf);
cc.mov(acc0, 0);
@@ -3214,7 +3520,7 @@ public:
cc.mov(ptr, buf);
cc.mov(idx, int(i));
- cc.invoke(&invokeNode, (uint64_t)calledFunc, FuncSignatureT<int, int*, int>(CallConvId::kFastCall));
+ cc.invoke(&invokeNode, (uint64_t)calledFunc, FuncSignature::build<int, int*, int>(CallConvId::kFastCall));
invokeNode->setArg(0, ptr);
invokeNode->setArg(1, idx);
invokeNode->setRet(0, ret);
@@ -3224,7 +3530,7 @@ public:
cc.mov(ptr, buf);
cc.mov(idx, int(i));
- cc.invoke(&invokeNode, (uint64_t)calledFunc, FuncSignatureT<int, int*, int>(CallConvId::kFastCall));
+ cc.invoke(&invokeNode, (uint64_t)calledFunc, FuncSignature::build<int, int*, int>(CallConvId::kFastCall));
invokeNode->setArg(0, ptr);
invokeNode->setArg(1, idx);
invokeNode->setRet(0, ret);
@@ -3249,7 +3555,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -3268,7 +3574,7 @@ public:
x86::Gp val = cc.newInt32("val");
Label skip = cc.newLabel();
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int>());
funcNode->setArg(0, val);
cc.cmp(val, 1);
@@ -3280,7 +3586,7 @@ public:
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, funcNode->label(), FuncSignatureT<int, int>(CallConvId::kHost));
+ cc.invoke(&invokeNode, funcNode->label(), FuncSignature::build<int, int>());
invokeNode->setArg(0, tmp);
invokeNode->setRet(0, tmp);
cc.mul(cc.newInt32(), val, tmp);
@@ -3300,7 +3606,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -3316,7 +3622,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int, int, int>());
x86::Gp a0 = cc.newInt32("a0");
x86::Gp a1 = cc.newInt32("a1");
@@ -3334,7 +3640,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)calledFunc),
- FuncSignatureT<int, size_t, int, int, int, int>(CallConvId::kHost, 1));
+ FuncSignature::build<int, size_t, int, int, int, int>(CallConvId::kCDecl, 1));
invokeNode->setArg(0, imm(4));
invokeNode->setArg(1, a0);
invokeNode->setArg(2, a1);
@@ -3356,7 +3662,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static int calledFunc(size_t n, ...) {
@@ -3384,7 +3690,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<double, double, double, double, double>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<double, double, double, double, double>());
x86::Xmm a0 = cc.newXmmSd("a0");
x86::Xmm a1 = cc.newXmmSd("a1");
@@ -3402,7 +3708,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)calledFunc),
- FuncSignatureT<double, size_t, double, double, double, double>(CallConvId::kHost, 1));
+ FuncSignature::build<double, size_t, double, double, double, double>(CallConvId::kCDecl, 1));
invokeNode->setArg(0, imm(4));
invokeNode->setArg(1, a0);
invokeNode->setArg(2, a1);
@@ -3424,7 +3730,7 @@ public:
result.assignFormat("ret=%f", resultRet);
expect.assignFormat("ret=%f", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static double calledFunc(size_t n, ...) {
@@ -3452,7 +3758,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<uint64_t, uint64_t>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<uint64_t, uint64_t>());
if (cc.is64Bit()) {
x86::Gp reg = cc.newUInt64();
@@ -3485,7 +3791,7 @@ public:
result.assignFormat("ret=%llu", (unsigned long long)resultRet);
expect.assignFormat("ret=%llu", (unsigned long long)expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static double calledFunc(size_t n, ...) {
@@ -3515,7 +3821,7 @@ public:
static void dummy(int, int) {}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int>());
x86::Gp a = cc.newInt32("a");
x86::Gp b = cc.newInt32("b");
@@ -3527,7 +3833,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)dummy),
- FuncSignatureT<void, int, int>(CallConvId::kHost));
+ FuncSignature::build<void, int, int>());
invokeNode->setArg(0, a);
invokeNode->setArg(1, b);
@@ -3547,7 +3853,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -3563,7 +3869,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<double, const double*>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<double, const double*>());
x86::Gp p = cc.newIntPtr("p");
x86::Xmm arg = cc.newXmmSd("arg");
@@ -3575,7 +3881,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)op),
- FuncSignatureT<double, double>(CallConvId::kHost));
+ FuncSignature::build<double, double>());
invokeNode->setArg(0, arg);
invokeNode->setRet(0, ret);
@@ -3595,7 +3901,7 @@ public:
result.assignFormat("ret=%g", resultRet);
expect.assignFormat("ret=%g", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static double op(double a) { return a * a; }
@@ -3613,7 +3919,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<double, const double*>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<double, const double*>());
x86::Gp p = cc.newIntPtr("p");
x86::Xmm arg = cc.newXmmSd("arg");
@@ -3625,7 +3931,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
imm((void*)op),
- FuncSignatureT<double, double>(CallConvId::kHost));
+ FuncSignature::build<double, double>());
invokeNode->setArg(0, arg);
invokeNode->setRet(0, ret);
@@ -3648,7 +3954,7 @@ public:
result.assignFormat("ret=%g", resultRet);
expect.assignFormat("ret=%g", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static double op(double a) { return a * a; }
@@ -3668,13 +3974,13 @@ public:
virtual void compile(x86::Compiler& cc) {
InvokeNode* invokeNode;
- FuncSignatureBuilder funcSignature;
- funcSignature.setCallConvId(CallConvId::kHost);
+ FuncSignature funcSignature;
+ funcSignature.setCallConvId(CallConvId::kCDecl);
funcSignature.setRet(TypeId::kFloat64);
cc.addFunc(funcSignature);
- FuncSignatureBuilder invokeSignature;
- invokeSignature.setCallConvId(CallConvId::kHost);
+ FuncSignature invokeSignature;
+ invokeSignature.setCallConvId(CallConvId::kCDecl);
invokeSignature.setRet(TypeId::kFloat64);
cc.invoke(&invokeNode, imm((void*)calledFunc), invokeSignature);
@@ -3695,7 +4001,7 @@ public:
result.assignFormat("ret=%g", resultRet);
expect.assignFormat("ret=%g", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static double calledFunc() { return 3.14; }
@@ -3714,7 +4020,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
x86::Gp pFn = cc.newIntPtr("pFn");
x86::Gp vars[16];
@@ -3733,7 +4039,7 @@ public:
}
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, pFn, FuncSignatureT<void>(CallConvId::kHost));
+ cc.invoke(&invokeNode, pFn, FuncSignature::build<void>());
for (i = 1; i < regCount; i++)
if (vars[i].isValid())
@@ -3753,7 +4059,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static void calledFunc() {}
@@ -3771,7 +4077,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<uint32_t, uint32_t>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<uint32_t, uint32_t>());
constexpr uint32_t kCount = 16;
@@ -3787,7 +4093,7 @@ public:
v[i] = cc.newUInt32("v%u", i);
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignatureT<uint32_t, uint32_t>(CallConvId::kHost));
+ cc.invoke(&invokeNode, imm((void*)calledFunc), FuncSignature::build<uint32_t, uint32_t>());
invokeNode->setArg(0, argVal);
invokeNode->setRet(0, retVal);
@@ -3813,7 +4119,7 @@ public:
result.assignFormat("ret=%u", resultRet);
expect.assignFormat("ret=%u", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static uint32_t calledFunc(uint32_t x) { return x + 1; }
@@ -3829,17 +4135,18 @@ public:
static void add(TestApp& app) {
const CpuInfo& cpuInfo = CpuInfo::host();
- if (cpuInfo.features().x86().hasAVX2() && sizeof(void*) == 8)
+ if (cpuInfo.features().x86().hasAVX2() && sizeof(void*) == 8) {
app.add(new X86Test_FuncCallAVXClobber());
+ }
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* mainFunc = cc.addFunc(FuncSignatureT<void, void*, const void*, const void*>(CallConvId::kHost));
+ FuncNode* mainFunc = cc.addFunc(FuncSignature::build<void, void*, const void*, const void*>());
mainFunc->frame().setAvxEnabled();
mainFunc->frame().setAvxCleanup();
// We need a Windows calling convention to test this properly also on a non-Windows machine.
- FuncNode* helperFunc = cc.newFunc(FuncSignatureT<void, void*, const void*>(CallConvId::kX64Windows));
+ FuncNode* helperFunc = cc.newFunc(FuncSignature::build<void, void*, const void*>(CallConvId::kX64Windows));
helperFunc->frame().setAvxEnabled();
helperFunc->frame().setAvxCleanup();
@@ -3866,7 +4173,7 @@ public:
InvokeNode* invokeNode;
cc.invoke(&invokeNode,
helperFunc->label(),
- FuncSignatureT<void, void*, const void*>(CallConvId::kX64Windows));
+ FuncSignature::build<void, void*, const void*>(CallConvId::kX64Windows));
invokeNode->setArg(0, tPtr);
invokeNode->setArg(1, bPtr);
@@ -3911,8 +4218,8 @@ public:
static const uint32_t aData[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
static const uint32_t bData[8] = { 6, 3, 5, 9, 1, 8, 7, 2 };
- uint32_t resultData[8];
- uint32_t expectData[8];
+ uint32_t resultData[8] {};
+ uint32_t expectData[8] {};
for (i = 0; i < 8; i++)
expectData[i] = aData[i] * 8 + bData[i] + 1;
@@ -3937,6 +4244,60 @@ public:
}
};
+// x86::Compiler - X86Test_VecToScalar
+// ===================================
+
+class X86Test_VecToScalar : public X86TestCase {
+public:
+ static constexpr uint32_t kVecCount = 64;
+
+ X86Test_VecToScalar() : X86TestCase("VecToScalar") {}
+
+ static void add(TestApp& app) {
+ app.add(new X86Test_VecToScalar());
+ }
+
+ virtual void compile(x86::Compiler& cc) {
+ FuncNode* func = cc.addFunc(FuncSignature::build<uint32_t, uint32_t>());
+
+ x86::Gp x = cc.newInt32("x");
+ x86::Gp t = cc.newInt32("t");
+ x86::Xmm v[kVecCount];
+
+ func->setArg(0, x);
+
+ for (size_t i = 0; i < kVecCount; i++) {
+ v[i] = cc.newXmm("v%d", i);
+ if (i != 0)
+ cc.add(x, 1);
+ cc.movd(v[i], x);
+ }
+
+ cc.xor_(x, x);
+
+ for (size_t i = 0; i < kVecCount; i++) {
+ cc.movd(t, v[i]);
+ cc.add(x, t);
+ }
+
+ cc.ret(x);
+ cc.endFunc();
+ }
+
+ virtual bool run(void* _func, String& result, String& expect) {
+ typedef uint32_t (*Func)(uint32_t);
+ Func func = ptr_as_func<Func>(_func);
+
+ uint32_t resultRet = func(1);
+ uint32_t expectRet = 2080; // 1 + 2 + 3 + ... + 64
+
+ result.assignFormat("ret=%d", resultRet);
+ expect.assignFormat("ret=%d", expectRet);
+
+ return result == expect;
+ }
+};
+
// x86::Compiler - X86Test_MiscLocalConstPool
// ==========================================
@@ -3949,7 +4310,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
x86::Gp v0 = cc.newInt32("v0");
x86::Gp v1 = cc.newInt32("v1");
@@ -3975,7 +4336,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -3991,7 +4352,7 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- cc.addFunc(FuncSignatureT<int>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<int>());
x86::Gp v0 = cc.newInt32("v0");
x86::Gp v1 = cc.newInt32("v1");
@@ -4017,7 +4378,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
};
@@ -4032,7 +4393,7 @@ struct X86Test_MiscMultiRet : public X86TestCase {
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, int, int>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, int, int>());
x86::Gp op = cc.newInt32("op");
x86::Gp a = cc.newInt32("a");
@@ -4108,7 +4469,7 @@ struct X86Test_MiscMultiRet : public X86TestCase {
result.assignFormat("ret={%d %d %d %d}", r0, r1, r2, r3);
expect.assignFormat("ret={%d %d %d %d}", e0, e1, e2, e3);
- return result.eq(expect);
+ return result == expect;
}
};
@@ -4124,8 +4485,8 @@ public:
}
virtual void compile(x86::Compiler& cc) {
- FuncNode* f1Node = cc.newFunc(FuncSignatureT<int, int, int>(CallConvId::kHost));
- FuncNode* f2Node = cc.newFunc(FuncSignatureT<int, int, int>(CallConvId::kHost));
+ FuncNode* f1Node = cc.newFunc(FuncSignature::build<int, int, int>());
+ FuncNode* f2Node = cc.newFunc(FuncSignature::build<int, int, int>());
{
x86::Gp a = cc.newInt32("a");
@@ -4136,7 +4497,7 @@ public:
f1Node->setArg(1, b);
InvokeNode* invokeNode;
- cc.invoke(&invokeNode, f2Node->label(), FuncSignatureT<int, int, int>(CallConvId::kHost));
+ cc.invoke(&invokeNode, f2Node->label(), FuncSignature::build<int, int, int>());
invokeNode->setArg(0, a);
invokeNode->setArg(1, b);
invokeNode->setRet(0, a);
@@ -4170,7 +4531,7 @@ public:
result.assignFormat("ret=%d", resultRet);
expect.assignFormat("ret=%d", expectRet);
- return result.eq(expect);
+ return result == expect;
}
};
@@ -4195,7 +4556,7 @@ public:
x86::Gp b = cc.newIntPtr("b");
Label tramp = cc.newLabel();
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<int, int, void*>(CallConvId::kFastCall));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<int, int, void*>(CallConvId::kFastCall));
funcNode->setArg(0, a);
funcNode->setArg(1, b);
@@ -4223,7 +4584,7 @@ public:
result.assignFormat("ret={%d}", resultRet);
expect.assignFormat("ret={%d}", expectRet);
- return resultRet == expectRet;
+ return result == expect;
}
static void ASMJIT_FASTCALL handler() { longjmp(globalJmpBuf, 1); }
@@ -4236,6 +4597,7 @@ void compiler_add_x86_tests(TestApp& app) {
// Base tests.
app.addT<X86Test_NoCode>();
app.addT<X86Test_NoAlign>();
+ app.addT<X86Test_IndirectBranchProtection>();
app.addT<X86Test_AlignBase>();
// Jump tests.
@@ -4246,44 +4608,55 @@ void compiler_add_x86_tests(TestApp& app) {
app.addT<X86Test_JumpUnreachable2>();
app.addT<X86Test_JumpTable1>();
app.addT<X86Test_JumpTable2>();
+ app.addT<X86Test_JumpTable3>();
+ app.addT<X86Test_JumpTable4>();
- // Alloc tests.
+ // Alloc and instruction tests.
app.addT<X86Test_AllocBase>();
app.addT<X86Test_AllocMany1>();
app.addT<X86Test_AllocMany2>();
- app.addT<X86Test_AllocImul1>();
- app.addT<X86Test_AllocImul2>();
- app.addT<X86Test_AllocIdiv1>();
- app.addT<X86Test_AllocSetz>();
- app.addT<X86Test_AllocShlRor>();
- app.addT<X86Test_AllocGpbLo1>();
- app.addT<X86Test_AllocGpbLo2>();
- app.addT<X86Test_AllocRepMovsb>();
- app.addT<X86Test_AllocIfElse1>();
- app.addT<X86Test_AllocIfElse2>();
- app.addT<X86Test_AllocIfElse3>();
- app.addT<X86Test_AllocIfElse4>();
app.addT<X86Test_AllocInt8>();
app.addT<X86Test_AllocUnhandledArg>();
app.addT<X86Test_AllocArgsIntPtr>();
app.addT<X86Test_AllocArgsFloat>();
app.addT<X86Test_AllocArgsDouble>();
+#if ASMJIT_ARCH_X86
app.addT<X86Test_AllocArgsVec>();
+#endif
app.addT<X86Test_AllocRetFloat1>();
app.addT<X86Test_AllocRetFloat2>();
app.addT<X86Test_AllocRetDouble1>();
app.addT<X86Test_AllocRetDouble2>();
app.addT<X86Test_AllocStack>();
- app.addT<X86Test_AllocMemcpy>();
- app.addT<X86Test_AllocExtraBlock>();
- app.addT<X86Test_AllocAlphaBlend>();
+ app.addT<X86Test_Imul1>();
+ app.addT<X86Test_Imul2>();
+ app.addT<X86Test_Idiv1>();
+ app.addT<X86Test_Setz>();
+ app.addT<X86Test_ShlRor>();
+ app.addT<X86Test_GpbLo1>();
+ app.addT<X86Test_GpbLo2>();
+ app.addT<X86Test_RepMovsb>();
+ app.addT<X86Test_IfElse1>();
+ app.addT<X86Test_IfElse2>();
+ app.addT<X86Test_IfElse3>();
+ app.addT<X86Test_IfElse4>();
+ app.addT<X86Test_Memcpy>();
+ app.addT<X86Test_ExtraBlock>();
+ app.addT<X86Test_AlphaBlend>();
+ app.addT<X86Test_AVX512_KK>();
+ app.addT<X86Test_AVX512_TernLog>();
+
+ // Function arguments handling tests.
+ app.addT<X86Test_FuncArgInt8>();
// Function call tests.
app.addT<X86Test_FuncCallBase1>();
app.addT<X86Test_FuncCallBase2>();
app.addT<X86Test_FuncCallStd>();
app.addT<X86Test_FuncCallFast>();
+#if ASMJIT_ARCH_X86
app.addT<X86Test_FuncCallSIMD>();
+#endif
app.addT<X86Test_FuncCallLight>();
app.addT<X86Test_FuncCallManyArgs>();
app.addT<X86Test_FuncCallDuplicateArgs>();
@@ -4307,6 +4680,7 @@ void compiler_add_x86_tests(TestApp& app) {
app.addT<X86Test_FuncCallAVXClobber>();
// Miscellaneous tests.
+ app.addT<X86Test_VecToScalar>();
app.addT<X86Test_MiscLocalConstPool>();
app.addT<X86Test_MiscGlobalConstPool>();
app.addT<X86Test_MiscMultiRet>();
@@ -4314,4 +4688,4 @@ void compiler_add_x86_tests(TestApp& app) {
app.addT<X86Test_MiscUnfollow>();
}
-#endif // !ASMJIT_NO_X86 && ASMJIT_ARCH_X86
+#endif // !ASMJIT_NO_X86 && !ASMJIT_NO_COMPILER
diff --git a/3rdparty/asmjit/test/asmjit_test_emitters.cpp b/3rdparty/asmjit/test/asmjit_test_emitters.cpp
index 63c14a6c2e2..47fcaff39d5 100644
--- a/3rdparty/asmjit/test/asmjit_test_emitters.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_emitters.cpp
@@ -5,8 +5,24 @@
#include <asmjit/core.h>
-#if !defined(ASMJIT_NO_X86) && ASMJIT_ARCH_X86
+static void printInfo() noexcept {
+ printf("AsmJit Emitters Test-Suite v%u.%u.%u\n",
+ unsigned((ASMJIT_LIBRARY_VERSION >> 16) ),
+ unsigned((ASMJIT_LIBRARY_VERSION >> 8) & 0xFF),
+ unsigned((ASMJIT_LIBRARY_VERSION ) & 0xFF));
+}
+
+#if !defined(ASMJIT_NO_JIT) && ( \
+ (ASMJIT_ARCH_X86 != 0 && !defined(ASMJIT_NO_X86 )) || \
+ (ASMJIT_ARCH_ARM == 64 && !defined(ASMJIT_NO_AARCH64)) )
+
+#if ASMJIT_ARCH_X86 != 0
#include <asmjit/x86.h>
+#endif
+
+#if ASMJIT_ARCH_ARM == 64
+#include <asmjit/a64.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -17,9 +33,13 @@ using namespace asmjit;
// Signature of the generated function.
typedef void (*SumIntsFunc)(int* dst, const int* a, const int* b);
+// X86 Backend
+// -----------
+
+#if ASMJIT_ARCH_X86 != 0
// This function works with both x86::Assembler and x86::Builder. It shows how
// `x86::Emitter` can be used to make your code more generic.
-static void makeRawFunc(x86::Emitter* emitter) noexcept {
+static void generateFuncWithEmitter(x86::Emitter* emitter) noexcept {
// Decide which registers will be mapped to function arguments. Try changing
// registers of `dst`, `src_a`, and `src_b` and see what happens in function's
// prolog and epilog.
@@ -34,13 +54,13 @@ static void makeRawFunc(x86::Emitter* emitter) noexcept {
// Create and initialize `FuncDetail` and `FuncFrame`.
FuncDetail func;
- func.init(FuncSignatureT<void, int*, const int*, const int*>(CallConvId::kHost), emitter->environment());
+ func.init(FuncSignature::build<void, int*, const int*, const int*>(), emitter->environment());
FuncFrame frame;
frame.init(func);
- // Make XMM0 and XMM1 dirty. VEC group includes XMM|YMM|ZMM registers.
- frame.addDirtyRegs(x86::xmm0, x86::xmm1);
+ // Make or registers dirty.
+ frame.addDirtyRegs(vec0, vec1);
FuncArgsAssignment args(&func); // Create arguments assignment context.
args.assignAll(dst, src_a, src_b); // Assign our registers to arguments.
@@ -63,14 +83,14 @@ static void makeRawFunc(x86::Emitter* emitter) noexcept {
#ifndef ASMJIT_NO_COMPILER
// This function works with x86::Compiler, provided for comparison.
-static void makeCompiledFunc(x86::Compiler* cc) noexcept {
+static void generateFuncWithCompiler(x86::Compiler* cc) noexcept {
x86::Gp dst = cc->newIntPtr("dst");
x86::Gp src_a = cc->newIntPtr("src_a");
x86::Gp src_b = cc->newIntPtr("src_b");
x86::Xmm vec0 = cc->newXmm("vec0");
x86::Xmm vec1 = cc->newXmm("vec1");
- FuncNode* funcNode = cc->addFunc(FuncSignatureT<void, int*, const int*, const int*>(CallConvId::kHost));
+ FuncNode* funcNode = cc->addFunc(FuncSignature::build<void, int*, const int*, const int*>());
funcNode->setArg(0, dst);
funcNode->setArg(1, src_a);
funcNode->setArg(2, src_b);
@@ -83,44 +103,22 @@ static void makeCompiledFunc(x86::Compiler* cc) noexcept {
}
#endif
-static uint32_t testFunc(JitRuntime& rt, EmitterType emitterType) noexcept {
-#ifndef ASMJIT_NO_LOGGING
- FileLogger logger(stdout);
- logger.setIndentation(FormatIndentationGroup::kCode, 2);
-#endif
-
- CodeHolder code;
- code.init(rt.environment());
-
-#ifndef ASMJIT_NO_LOGGING
- code.setLogger(&logger);
-#endif
-
- Error err = kErrorOk;
+static Error generateFunc(CodeHolder& code, EmitterType emitterType) noexcept {
switch (emitterType) {
- case EmitterType::kNone: {
- break;
- }
-
case EmitterType::kAssembler: {
printf("Using x86::Assembler:\n");
x86::Assembler a(&code);
- makeRawFunc(a.as<x86::Emitter>());
- break;
+ generateFuncWithEmitter(a.as<x86::Emitter>());
+ return kErrorOk;
}
#ifndef ASMJIT_NO_BUILDER
case EmitterType::kBuilder: {
printf("Using x86::Builder:\n");
x86::Builder cb(&code);
- makeRawFunc(cb.as<x86::Emitter>());
-
- err = cb.finalize();
- if (err) {
- printf("** FAILURE: x86::Builder::finalize() failed (%s) **\n", DebugUtils::errorAsString(err));
- return 1;
- }
- break;
+ generateFuncWithEmitter(cb.as<x86::Emitter>());
+
+ return cb.finalize();
}
#endif
@@ -128,16 +126,148 @@ static uint32_t testFunc(JitRuntime& rt, EmitterType emitterType) noexcept {
case EmitterType::kCompiler: {
printf("Using x86::Compiler:\n");
x86::Compiler cc(&code);
- makeCompiledFunc(&cc);
-
- err = cc.finalize();
- if (err) {
- printf("** FAILURE: x86::Compiler::finalize() failed (%s) **\n", DebugUtils::errorAsString(err));
- return 1;
- }
- break;
+ generateFuncWithCompiler(&cc);
+
+ return cc.finalize();
}
#endif
+
+ default: {
+ printf("** FAILURE: No emitter to use **\n");
+ exit(1);
+ }
+ }
+}
+#endif
+
+// AArch64 Backend
+// ---------------
+
+#if ASMJIT_ARCH_ARM == 64
+// This function works with both a64::Assembler and a64::Builder. It shows how
+// `a64::Emitter` can be used to make your code more generic.
+static void generateFuncWithEmitter(a64::Emitter* emitter) noexcept {
+ // Decide which registers will be mapped to function arguments. Try changing
+ // registers of `dst`, `src_a`, and `src_b` and see what happens in function's
+ // prolog and epilog.
+ a64::Gp dst = a64::x0;
+ a64::Gp src_a = a64::x1;
+ a64::Gp src_b = a64::x2;
+
+ // Decide which vector registers to use. We use these to keep the code generic,
+ // you can switch to any other registers when needed.
+ a64::Vec vec0 = a64::v0;
+ a64::Vec vec1 = a64::v1;
+ a64::Vec vec2 = a64::v2;
+
+ // Create and initialize `FuncDetail` and `FuncFrame`.
+ FuncDetail func;
+ func.init(FuncSignature::build<void, int*, const int*, const int*>(), emitter->environment());
+
+ FuncFrame frame;
+ frame.init(func);
+
+ // Make XMM0 and XMM1 dirty. VEC group includes XMM|YMM|ZMM registers.
+ frame.addDirtyRegs(vec0, vec1, vec2);
+
+ FuncArgsAssignment args(&func); // Create arguments assignment context.
+ args.assignAll(dst, src_a, src_b); // Assign our registers to arguments.
+ args.updateFuncFrame(frame); // Reflect our args in FuncFrame.
+ frame.finalize();
+
+ // Emit prolog and allocate arguments to registers.
+ emitter->emitProlog(frame);
+ emitter->emitArgsAssignment(frame, args);
+
+ emitter->ld1(vec0.b16(), a64::ptr(src_a)); // Load 4 ints from [src_a] to vec0.
+ emitter->ld1(vec1.b16(), a64::ptr(src_b)); // Load 4 ints from [src_b] to vec1.
+ emitter->add(vec2.s4(), vec0.s4(), vec1.s4()); // Add 4 ints of vec0 and vec1 and store to vec2.
+ emitter->st1(vec2.b16(), a64::ptr(dst)); // Store the result (vec2) to [dst].
+
+ // Emit epilog and return.
+ emitter->emitEpilog(frame);
+}
+
+#ifndef ASMJIT_NO_COMPILER
+// This function works with x86::Compiler, provided for comparison.
+static void generateFuncWithCompiler(a64::Compiler* cc) noexcept {
+ a64::Gp dst = cc->newIntPtr("dst");
+ a64::Gp src_a = cc->newIntPtr("src_a");
+ a64::Gp src_b = cc->newIntPtr("src_b");
+ a64::Vec vec0 = cc->newVecQ("vec0");
+ a64::Vec vec1 = cc->newVecQ("vec1");
+ a64::Vec vec2 = cc->newVecQ("vec2");
+
+ FuncNode* funcNode = cc->addFunc(FuncSignature::build<void, int*, const int*, const int*>());
+ funcNode->setArg(0, dst);
+ funcNode->setArg(1, src_a);
+ funcNode->setArg(2, src_b);
+
+ cc->ld1(vec0.b16(), a64::ptr(src_a)); // Load 4 ints from [src_a] to vec0.
+ cc->ld1(vec1.b16(), a64::ptr(src_b)); // Load 4 ints from [src_b] to vec1.
+ cc->add(vec2.s4(), vec0.s4(), vec1.s4()); // Add 4 ints of vec0 and vec1 and store to vec2.
+ cc->st1(vec2.b16(), a64::ptr(dst)); // Store the result (vec2) to [dst].
+ cc->endFunc();
+}
+#endif
+
+static Error generateFunc(CodeHolder& code, EmitterType emitterType) noexcept {
+ switch (emitterType) {
+ case EmitterType::kAssembler: {
+ printf("Using a64::Assembler:\n");
+ a64::Assembler a(&code);
+ generateFuncWithEmitter(a.as<a64::Emitter>());
+ return kErrorOk;
+ }
+
+#ifndef ASMJIT_NO_BUILDER
+ case EmitterType::kBuilder: {
+ printf("Using a64::Builder:\n");
+ a64::Builder cb(&code);
+ generateFuncWithEmitter(cb.as<a64::Emitter>());
+
+ return cb.finalize();
+ }
+#endif
+
+#ifndef ASMJIT_NO_COMPILER
+ case EmitterType::kCompiler: {
+ printf("Using a64::Compiler:\n");
+ a64::Compiler cc(&code);
+ generateFuncWithCompiler(&cc);
+
+ return cc.finalize();
+ }
+#endif
+
+ default: {
+ printf("** FAILURE: No emitter to use **\n");
+ exit(1);
+ }
+ }
+}
+#endif
+
+// Testing
+// -------
+
+static uint32_t testFunc(JitRuntime& rt, EmitterType emitterType) noexcept {
+#ifndef ASMJIT_NO_LOGGING
+ FileLogger logger(stdout);
+ logger.setIndentation(FormatIndentationGroup::kCode, 2);
+#endif
+
+ CodeHolder code;
+ code.init(rt.environment(), rt.cpuFeatures());
+
+#ifndef ASMJIT_NO_LOGGING
+ code.setLogger(&logger);
+#endif
+
+ Error err = generateFunc(code, emitterType);
+ if (err) {
+ printf("** FAILURE: Failed to generate a function: %s **\n", DebugUtils::errorAsString(err));
+ return 1;
}
// Add the code generated to the runtime.
@@ -145,41 +275,38 @@ static uint32_t testFunc(JitRuntime& rt, EmitterType emitterType) noexcept {
err = rt.add(&fn, &code);
if (err) {
- printf("** FAILURE: JitRuntime::add() failed (%s) **\n", DebugUtils::errorAsString(err));
+ printf("** FAILURE: JitRuntime::add() failed: %s **\n", DebugUtils::errorAsString(err));
return 1;
}
// Execute the generated function.
- int inA[4] = { 4, 3, 2, 1 };
- int inB[4] = { 1, 5, 2, 8 };
- int out[4];
+ static const int inA[4] = { 4, 3, 2, 1 };
+ static const int inB[4] = { 1, 5, 2, 8 };
+ int out[4] {};
fn(out, inA, inB);
// Should print {5 8 4 9}.
printf("Result = { %d %d %d %d }\n\n", out[0], out[1], out[2], out[3]);
rt.release(fn);
- return !(out[0] == 5 && out[1] == 8 && out[2] == 4 && out[3] == 9);
+ return out[0] == 5 && out[1] == 8 && out[2] == 4 && out[3] == 9;
}
int main() {
- printf("AsmJit Emitters Test-Suite v%u.%u.%u\n",
- unsigned((ASMJIT_LIBRARY_VERSION >> 16) ),
- unsigned((ASMJIT_LIBRARY_VERSION >> 8) & 0xFF),
- unsigned((ASMJIT_LIBRARY_VERSION ) & 0xFF));
+ printInfo();
printf("\n");
JitRuntime rt;
unsigned nFailed = 0;
- nFailed += testFunc(rt, EmitterType::kAssembler);
+ nFailed += !testFunc(rt, EmitterType::kAssembler);
#ifndef ASMJIT_NO_BUILDER
- nFailed += testFunc(rt, EmitterType::kBuilder);
+ nFailed += !testFunc(rt, EmitterType::kBuilder);
#endif
#ifndef ASMJIT_NO_COMPILER
- nFailed += testFunc(rt, EmitterType::kCompiler);
+ nFailed += !testFunc(rt, EmitterType::kCompiler);
#endif
if (!nFailed)
@@ -191,7 +318,8 @@ int main() {
}
#else
int main() {
- printf("AsmJit X86 Emitter Test is disabled on non-x86 host\n\n");
+ printInfo();
+ printf("\nThis test is currently disabled - no JIT or no support for the target architecture\n");
return 0;
}
-#endif // !ASMJIT_NO_X86 && ASMJIT_ARCH_X86
+#endif // ASMJIT_ARCH_X86 && !ASMJIT_NO_X86 && !ASMJIT_NO_JIT
diff --git a/3rdparty/asmjit/test/asmjit_test_execute.cpp b/3rdparty/asmjit/test/asmjit_test_execute.cpp
new file mode 100644
index 00000000000..ce002dc5a6b
--- /dev/null
+++ b/3rdparty/asmjit/test/asmjit_test_execute.cpp
@@ -0,0 +1,103 @@
+// This file is part of AsmJit project <https://asmjit.com>
+//
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
+
+#include <asmjit/core.h>
+
+static void printInfo() noexcept {
+ printf("AsmJit Execute Test-Suite v%u.%u.%u\n",
+ unsigned((ASMJIT_LIBRARY_VERSION >> 16) ),
+ unsigned((ASMJIT_LIBRARY_VERSION >> 8) & 0xFF),
+ unsigned((ASMJIT_LIBRARY_VERSION ) & 0xFF));
+}
+
+#if !defined(ASMJIT_NO_JIT) && ( \
+ (ASMJIT_ARCH_X86 != 0 && !defined(ASMJIT_NO_X86 )) || \
+ (ASMJIT_ARCH_ARM == 64 && !defined(ASMJIT_NO_AARCH64)) )
+
+#if ASMJIT_ARCH_X86 != 0
+#include <asmjit/x86.h>
+#endif
+
+#if ASMJIT_ARCH_ARM == 64
+#include <asmjit/a64.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+using namespace asmjit;
+
+// Signature of the generated function.
+typedef void (*EmptyFunc)(void);
+
+// Generate Empty Function
+// -----------------------
+
+#if ASMJIT_ARCH_X86 != 0
+static void generateEmptyFunc(CodeHolder& code) noexcept {
+ x86::Assembler a(&code);
+ a.ret();
+}
+#endif
+
+#if ASMJIT_ARCH_ARM == 64
+static void generateEmptyFunc(CodeHolder& code) noexcept {
+ a64::Assembler a(&code);
+ a.ret(a64::x30);
+}
+#endif
+
+// Testing
+// -------
+
+static void executeEmptyFunc(JitRuntime& rt) noexcept {
+ CodeHolder code;
+ code.init(rt.environment(), rt.cpuFeatures());
+
+ EmptyFunc fn;
+
+ generateEmptyFunc(code);
+ Error err = rt.add(&fn, &code);
+
+ if (err) {
+ printf("** FAILURE: JitRuntime::add() failed: %s **\n", DebugUtils::errorAsString(err));
+ exit(1);
+ }
+
+ fn();
+
+ rt.release(&fn);
+}
+
+int main() {
+ printInfo();
+ printf("\n");
+
+ {
+ printf("Trying to execute empty function with JitRuntime (default settings)\n");
+ JitRuntime rt;
+ executeEmptyFunc(rt);
+ }
+
+ if (VirtMem::hardenedRuntimeInfo().hasFlag(VirtMem::HardenedRuntimeFlags::kDualMapping)) {
+ printf("Trying to execute empty function with JitRuntime (dual-mapped)\n");
+ JitAllocator::CreateParams params {};
+ params.options |= JitAllocatorOptions::kUseDualMapping;
+ JitRuntime rt;
+ executeEmptyFunc(rt);
+ }
+
+ // If we are here we were successful, otherwise the process would crash.
+ printf("** SUCCESS **\n");
+ return 0;
+}
+#else
+int main() {
+ printInfo();
+ printf("\nThis test is currently disabled - no JIT or no support for the target architecture\n");
+ return 0;
+}
+#endif // ASMJIT_ARCH_X86 && !ASMJIT_NO_X86 && !ASMJIT_NO_JIT
diff --git a/3rdparty/asmjit/test/asmjit_test_instinfo.cpp b/3rdparty/asmjit/test/asmjit_test_instinfo.cpp
index 3d51edcab14..c8cf058513c 100644
--- a/3rdparty/asmjit/test/asmjit_test_instinfo.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_instinfo.cpp
@@ -13,6 +13,9 @@
using namespace asmjit;
+namespace {
+
+#if !defined(ASMJIT_NO_X86)
static char accessLetter(bool r, bool w) noexcept {
return r && w ? 'X' : r ? 'R' : w ? 'W' : '_';
}
@@ -140,6 +143,7 @@ static void printInfoExtra(Arch arch, InstId instId, InstOptions options, const
Operand_ opArray[] = { std::forward<Args>(args)... };
printInfo(arch, inst, opArray, sizeof...(args));
}
+#endif // !ASMJIT_NO_X86
static void testX86Arch() {
#if !defined(ASMJIT_NO_X86)
@@ -147,6 +151,7 @@ static void testX86Arch() {
Arch arch = Arch::kX64;
printInfoSimple(arch, Inst::kIdAdd, InstOptions::kNone, eax, ebx);
+ printInfoSimple(arch, Inst::kIdXor, InstOptions::kNone, eax, eax);
printInfoSimple(arch, Inst::kIdLods, InstOptions::kNone, eax, dword_ptr(rsi));
printInfoSimple(arch, Inst::kIdPshufd, InstOptions::kNone, xmm0, xmm1, imm(0));
@@ -163,11 +168,16 @@ static void testX86Arch() {
printInfoSimple(arch, Inst::kIdVaddpd, InstOptions::kNone, ymm0, ymm30, ymm31);
printInfoSimple(arch, Inst::kIdVaddpd, InstOptions::kNone, zmm0, zmm1, zmm2);
+ printInfoSimple(arch, Inst::kIdVpternlogd, InstOptions::kNone, zmm0, zmm0, zmm0, imm(0xFF));
+ printInfoSimple(arch, Inst::kIdVpternlogq, InstOptions::kNone, zmm0, zmm1, zmm2, imm(0x33));
+
printInfoExtra(arch, Inst::kIdVaddpd, InstOptions::kNone, k1, zmm0, zmm1, zmm2);
printInfoExtra(arch, Inst::kIdVaddpd, InstOptions::kX86_ZMask, k1, zmm0, zmm1, zmm2);
-#endif
+#endif // !ASMJIT_NO_X86
}
+} // {anonymous}
+
int main() {
printf("AsmJit Instruction Info Test-Suite v%u.%u.%u\n",
unsigned((ASMJIT_LIBRARY_VERSION >> 16) ),
diff --git a/3rdparty/asmjit/test/asmjit_test_misc.h b/3rdparty/asmjit/test/asmjit_test_misc.h
index 0839d30ac00..6231971f01f 100644
--- a/3rdparty/asmjit/test/asmjit_test_misc.h
+++ b/3rdparty/asmjit/test/asmjit_test_misc.h
@@ -170,7 +170,7 @@ static void generateSseAlphaBlend(asmjit::BaseEmitter& emitter, bool emitPrologE
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -202,7 +202,7 @@ static void generateSseAlphaBlend(asmjit::BaseEmitter& emitter, bool emitPrologE
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -242,7 +242,7 @@ static void generateSseAlphaBlend(asmjit::BaseEmitter& emitter, bool emitPrologE
Xmm v6 = cc.newXmm("v6");
Xmm v7 = cc.newXmm("v7");
- FuncNode* funcNode = cc.addFunc(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost));
+ FuncNode* funcNode = cc.addFunc(FuncSignature::build<void, void*, const void*, size_t>());
funcNode->setArg(0, dst);
funcNode->setArg(1, src);
funcNode->setArg(2, i);
diff --git a/3rdparty/asmjit/test/asmjit_test_perf.cpp b/3rdparty/asmjit/test/asmjit_test_perf.cpp
index ab965948f40..98353fd147d 100644
--- a/3rdparty/asmjit/test/asmjit_test_perf.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_perf.cpp
@@ -30,9 +30,19 @@ int main(int argc, char* argv[]) {
unsigned((ASMJIT_LIBRARY_VERSION ) & 0xFF));
printf("Usage:\n");
- printf(" --help Show usage only\n");
- printf(" --quick Decrease the number of iterations to make tests quicker\n");
- printf(" --arch=<ARCH> Select architecture to run ('all' by default)\n");
+ printf(" --help Show usage only\n");
+ printf(" --quick Decrease the number of iterations to make tests quicker\n");
+ printf(" --arch=<ARCH> Select architecture(s) to run ('all' by default)\n");
+ printf("\n");
+
+ printf("Architectures:\n");
+#if !defined(ASMJIT_NO_X86)
+ printf(" --arch=x86 32-bit X86 architecture (X86)\n");
+ printf(" --arch=x64 64-bit X86 architecture (X86_64)\n");
+#endif
+#if !defined(ASMJIT_NO_AARCH64)
+ printf(" --arch=aarch64 64-bit ARM architecture (AArch64)\n");
+#endif
printf("\n");
if (cmdLine.hasArg("--help"))
diff --git a/3rdparty/asmjit/test/asmjit_test_perf.h b/3rdparty/asmjit/test/asmjit_test_perf.h
index 2ab0038ed31..f637013985b 100644
--- a/3rdparty/asmjit/test/asmjit_test_perf.h
+++ b/3rdparty/asmjit/test/asmjit_test_perf.h
@@ -10,7 +10,9 @@
#include "asmjitutils.h"
#include "performancetimer.h"
-class MyErrorHandler : public asmjit::ErrorHandler {
+namespace asmjit_perf_utils {
+
+class TestErrorHandler : public asmjit::ErrorHandler {
void handleError(asmjit::Error err, const char* message, asmjit::BaseEmitter* origin) {
(void)err;
(void)origin;
@@ -19,10 +21,50 @@ class MyErrorHandler : public asmjit::ErrorHandler {
}
};
+#ifndef ASMJIT_NO_BUILDER
+template<typename BuilderT, typename FuncT>
+static uint32_t calculateInstructionCount(asmjit::CodeHolder& code, asmjit::Arch arch, const FuncT& func) noexcept {
+ BuilderT builder;
+ TestErrorHandler eh;
+
+ asmjit::Environment env(arch);
+ code.init(env);
+ code.setErrorHandler(&eh);
+ code.attach(&builder);
+ func(builder);
+
+ uint32_t count = 0;
+ asmjit::BaseNode* node = builder.firstNode();
+
+ while (node) {
+ count += uint32_t(node->isInst());
+ node = node->next();
+ }
+
+ code.reset();
+ return count;
+}
+#endif
+
+static inline double calculateMBPS(double duration, uint64_t outputSize) noexcept {
+ if (duration == 0)
+ return 0.0;
+
+ double bytesTotal = double(outputSize);
+ return (bytesTotal * 1000) / (duration * 1024 * 1024);
+}
+
+static inline double calculateMIPS(double duration, uint64_t instCount) noexcept {
+ if (duration == 0)
+ return 0.0;
+
+ return double(instCount) * 1000.0 / (duration * 1e6);
+}
+
template<typename EmitterT, typename FuncT>
-static void bench(asmjit::CodeHolder& code, asmjit::Arch arch, uint32_t numIterations, const char* testName, const FuncT& func) noexcept {
+static void bench(asmjit::CodeHolder& code, asmjit::Arch arch, uint32_t numIterations, const char* testName, uint32_t instCount, const FuncT& func) noexcept {
EmitterT emitter;
- MyErrorHandler eh;
+ TestErrorHandler eh;
const char* archName = asmjitArchAsString(arch);
const char* emitterName =
@@ -53,9 +95,20 @@ static void bench(asmjit::CodeHolder& code, asmjit::Arch arch, uint32_t numItera
}
printf(" [%s] %-9s %-16s | CodeSize:%5llu [B] | Time:%8.4f [ms]", archName, emitterName, testName, (unsigned long long)codeSize, duration);
- if (codeSize)
- printf(" | Speed:%8.3f [MB/s]", mbps(duration, codeSize));
+ if (codeSize) {
+ printf(" | Speed:%7.1f [MiB/s]", calculateMBPS(duration, codeSize));
+ }
+ else {
+ printf(" | Speed: N/A ");
+ }
+
+ if (instCount) {
+ printf(", %8.1f [MInst/s]", calculateMIPS(duration, instCount));
+ }
+
printf("\n");
}
+} // {asmjit_perf_utils}
+
#endif // ASMJIT_TEST_PERF_H_INCLUDED
diff --git a/3rdparty/asmjit/test/asmjit_test_perf_a64.cpp b/3rdparty/asmjit/test/asmjit_test_perf_a64.cpp
index 4f4aebb6e72..938aa9b2c50 100644
--- a/3rdparty/asmjit/test/asmjit_test_perf_a64.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_perf_a64.cpp
@@ -177,13 +177,13 @@ static void generateGpSequenceInternal(
cc.cmn(wA, wB);
cc.cmn(xA, xB);
cc.cmn(wA, wB, uxtb(2));
- cc.cmn(xA, xB, uxtb(2));
+ cc.cmn(xA, wB, uxtb(2));
cc.cmp(wA, 33);
cc.cmp(xA, 33);
cc.cmp(wA, wB);
cc.cmp(xA, xB);
cc.cmp(wA, wB, uxtb(2));
- cc.cmp(xA, xB, uxtb(2));
+ cc.cmp(xA, wB, uxtb(2));
cc.crc32b(wA, wB, wC);
cc.crc32b(wzr, wB, wC);
cc.crc32b(wA, wzr, wC);
@@ -582,7 +582,7 @@ static void generateGpSequence(BaseEmitter& emitter, bool emitPrologEpilog) {
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -608,7 +608,7 @@ static void generateGpSequence(BaseEmitter& emitter, bool emitPrologEpilog) {
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -633,7 +633,7 @@ static void generateGpSequence(BaseEmitter& emitter, bool emitPrologEpilog) {
a64::Gp c = cc.newIntPtr("c");
a64::Gp d = cc.newIntPtr("d");
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
generateGpSequenceInternal(cc, a, b, c, d);
cc.endFunc();
}
@@ -645,42 +645,50 @@ static void benchmarkA64Function(Arch arch, uint32_t numIterations, const char*
CodeHolder code;
printf("%s:\n", description);
- bench<a64::Assembler>(code, arch, numIterations, "[raw]", [&](a64::Assembler& cc) {
+ uint32_t instCount = 0;
+
+#ifndef ASMJIT_NO_BUILDER
+ instCount = asmjit_perf_utils::calculateInstructionCount<a64::Builder>(code, arch, [&](a64::Builder& cc) {
+ emitterFn(cc, false);
+ });
+#endif
+
+ asmjit_perf_utils::bench<a64::Assembler>(code, arch, numIterations, "[raw]", instCount, [&](a64::Assembler& cc) {
emitterFn(cc, false);
});
- bench<a64::Assembler>(code, arch, numIterations, "[validated]", [&](a64::Assembler& cc) {
+ asmjit_perf_utils::bench<a64::Assembler>(code, arch, numIterations, "[validated]", instCount, [&](a64::Assembler& cc) {
cc.addDiagnosticOptions(DiagnosticOptions::kValidateAssembler);
emitterFn(cc, false);
});
- bench<a64::Assembler>(code, arch, numIterations, "[prolog/epilog]", [&](a64::Assembler& cc) {
+ asmjit_perf_utils::bench<a64::Assembler>(code, arch, numIterations, "[prolog/epilog]", instCount, [&](a64::Assembler& cc) {
cc.addDiagnosticOptions(DiagnosticOptions::kValidateAssembler);
emitterFn(cc, true);
});
#ifndef ASMJIT_NO_BUILDER
- bench<a64::Builder>(code, arch, numIterations, "[no-asm]", [&](a64::Builder& cc) {
+ asmjit_perf_utils::bench<a64::Builder>(code, arch, numIterations, "[no-asm]", instCount, [&](a64::Builder& cc) {
emitterFn(cc, false);
});
- bench<a64::Builder>(code, arch, numIterations, "[finalized]", [&](a64::Builder& cc) {
+ asmjit_perf_utils::bench<a64::Builder>(code, arch, numIterations, "[finalized]", instCount, [&](a64::Builder& cc) {
emitterFn(cc, false);
cc.finalize();
});
- bench<a64::Builder>(code, arch, numIterations, "[prolog/epilog]", [&](a64::Builder& cc) {
+ asmjit_perf_utils::bench<a64::Builder>(code, arch, numIterations, "[prolog/epilog]", instCount, [&](a64::Builder& cc) {
emitterFn(cc, true);
cc.finalize();
});
#endif
#ifndef ASMJIT_NO_COMPILER
- bench<a64::Compiler>(code, arch, numIterations, "[no-asm]", [&](a64::Compiler& cc) {
+ asmjit_perf_utils::bench<a64::Compiler>(code, arch, numIterations, "[no-asm]", instCount, [&](a64::Compiler& cc) {
emitterFn(cc, true);
});
- bench<a64::Compiler>(code, arch, numIterations, "[finalized]", [&](a64::Compiler& cc) {
+ asmjit_perf_utils::bench<a64::Compiler>(code, arch, numIterations, "[finalized]", instCount, [&](a64::Compiler& cc) {
emitterFn(cc, true);
cc.finalize();
});
diff --git a/3rdparty/asmjit/test/asmjit_test_perf_x86.cpp b/3rdparty/asmjit/test/asmjit_test_perf_x86.cpp
index e2720b7c50a..4ff74818939 100644
--- a/3rdparty/asmjit/test/asmjit_test_perf_x86.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_perf_x86.cpp
@@ -335,7 +335,7 @@ static void generateGpSequence(BaseEmitter& emitter, InstForm form, bool emitPro
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -361,7 +361,7 @@ static void generateGpSequence(BaseEmitter& emitter, InstForm form, bool emitPro
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -386,7 +386,7 @@ static void generateGpSequence(BaseEmitter& emitter, InstForm form, bool emitPro
Gp c = cc.newIntPtr("c");
Gp d = cc.newIntPtr("d");
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
generateGpSequenceInternal(cc, form, a, b, c, d);
cc.endFunc();
}
@@ -670,9 +670,9 @@ static void generateSseSequenceInternal(
cc.cvtpi2ps(xmmA, m);
cc.cvtsi2ss(xmmA, m);
cc.cvtss2si(gpd, m);
- if (cc.is64Bit()) cc.cvtss2si(gpq, m);
+ cc.cvtss2si(gpz, m);
cc.cvttss2si(gpd, m);
- if (cc.is64Bit()) cc.cvttss2si(gpq, m);
+ cc.cvttss2si(gpz, m);
cc.divps(xmmA, m);
cc.divss(xmmA, m);
cc.maxps(xmmA, m);
@@ -729,16 +729,16 @@ static void generateSseSequenceInternal(
cc.cvtps2dq(xmmA, m);
cc.cvtps2pd(xmmA, m);
cc.cvtsd2si(gpd, m);
- if (cc.is64Bit()) cc.cvtsd2si(gpq, m);
+ cc.cvtsd2si(gpz, m);
cc.cvtsd2ss(xmmA, m);
cc.cvtsi2sd(xmmA, m);
cc.cvtss2sd(xmmA, m);
cc.cvtss2si(gpd, m);
- if (cc.is64Bit()) cc.cvtss2si(gpq, m);
+ cc.cvtss2si(gpz, m);
cc.cvttpd2dq(xmmA, m);
cc.cvttps2dq(xmmA, m);
cc.cvttsd2si(gpd, m);
- if (cc.is64Bit()) cc.cvttsd2si(gpq, m);
+ cc.cvttsd2si(gpz, m);
cc.divpd(xmmA, m);
cc.divsd(xmmA, m);
cc.maxpd(xmmA, m);
@@ -927,7 +927,7 @@ static void generateSseSequence(BaseEmitter& emitter, InstForm form, bool emitPr
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -948,7 +948,7 @@ static void generateSseSequence(BaseEmitter& emitter, InstForm form, bool emitPr
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -974,7 +974,7 @@ static void generateSseSequence(BaseEmitter& emitter, InstForm form, bool emitPr
Xmm c = cc.newXmm("c");
Xmm d = cc.newXmm("d");
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
generateSseSequenceInternal(cc, form, gp, a, b, c, d);
cc.endFunc();
}
@@ -983,9 +983,602 @@ static void generateSseSequence(BaseEmitter& emitter, InstForm form, bool emitPr
// Generates a long sequence of AVX instructions.
template<typename Emitter>
-static void generateAvxSequenceInternal(
+static void generateAvxSequenceInternalRegOnly(
+ Emitter& cc,
+ const x86::Gp& gp,
+ const x86::Vec& vecA, const x86::Vec& vecB, const x86::Vec& vecC, const x86::Vec& vecD) {
+
+ x86::Gp gpd = gp.r32();
+ x86::Gp gpq = gp.r64();
+ x86::Gp gpz = cc.is32Bit() ? gpd : gpq;
+
+ x86::Xmm xmmA = vecA.xmm();
+ x86::Xmm xmmB = vecB.xmm();
+ x86::Xmm xmmC = vecC.xmm();
+ x86::Xmm xmmD = vecD.xmm();
+
+ x86::Ymm ymmA = vecA.ymm();
+ x86::Ymm ymmB = vecB.ymm();
+ x86::Ymm ymmC = vecC.ymm();
+
+ cc.xor_(gpd, gpd);
+ cc.vxorps(xmmA, xmmA, xmmA);
+ cc.vxorps(xmmB, xmmB, xmmB);
+ cc.vxorps(xmmC, xmmC, xmmC);
+ cc.vxorps(xmmD, xmmD, xmmD);
+
+ cc.vaddpd(xmmA, xmmB, xmmC);
+ cc.vaddpd(ymmA, ymmB, ymmC);
+ cc.vaddps(xmmA, xmmB, xmmC);
+ cc.vaddps(ymmA, ymmB, ymmC);
+ cc.vaddsd(xmmA, xmmB, xmmC);
+ cc.vaddss(xmmA, xmmB, xmmC);
+ cc.vaddsubpd(xmmA, xmmB, xmmC);
+ cc.vaddsubpd(ymmA, ymmB, ymmC);
+ cc.vaddsubps(xmmA, xmmB, xmmC);
+ cc.vaddsubps(ymmA, ymmB, ymmC);
+ cc.vandpd(xmmA, xmmB, xmmC);
+ cc.vandpd(ymmA, ymmB, ymmC);
+ cc.vandps(xmmA, xmmB, xmmC);
+ cc.vandps(ymmA, ymmB, ymmC);
+ cc.vandnpd(xmmA, xmmB, xmmC);
+ cc.vandnpd(ymmA, ymmB, ymmC);
+ cc.vandnps(xmmA, xmmB, xmmC);
+ cc.vandnps(ymmA, ymmB, ymmC);
+ cc.vblendpd(xmmA, xmmB, xmmC, 0);
+ cc.vblendpd(ymmA, ymmB, ymmC, 0);
+ cc.vblendps(xmmA, xmmB, xmmC, 0);
+ cc.vblendps(ymmA, ymmB, ymmC, 0);
+ cc.vblendvpd(xmmA, xmmB, xmmC, xmmA);
+ cc.vblendvpd(ymmA, ymmB, ymmC, ymmA);
+ cc.vcmppd(xmmA, xmmB, xmmC, 0);
+ cc.vcmppd(ymmA, ymmB, ymmC, 0);
+ cc.vcmpps(xmmA, xmmB, xmmC, 0);
+ cc.vcmpps(ymmA, ymmB, ymmC, 0);
+ cc.vcmpsd(xmmA, xmmB, xmmC, 0);
+ cc.vcmpss(xmmA, xmmB, xmmC, 0);
+ cc.vcomisd(xmmA, xmmB);
+ cc.vcomiss(xmmA, xmmB);
+ cc.vcvtdq2pd(xmmA, xmmB);
+ cc.vcvtdq2pd(ymmA, xmmB);
+ cc.vcvtdq2ps(xmmA, xmmB);
+ cc.vcvtdq2ps(ymmA, ymmB);
+ cc.vcvtpd2dq(xmmA, xmmB);
+ cc.vcvtpd2dq(xmmA, ymmB);
+ cc.vcvtpd2ps(xmmA, xmmB);
+ cc.vcvtpd2ps(xmmA, ymmB);
+ cc.vcvtps2dq(xmmA, xmmB);
+ cc.vcvtps2dq(ymmA, ymmB);
+ cc.vcvtps2pd(xmmA, xmmB);
+ cc.vcvtps2pd(ymmA, xmmB);
+ cc.vcvtsd2si(gpd, xmmB);
+ cc.vcvtsd2si(gpz, xmmB);
+ cc.vcvtsd2ss(xmmA, xmmB, xmmC);
+ cc.vcvtsi2sd(xmmA, xmmB, gpd);
+ cc.vcvtsi2sd(xmmA, xmmB, gpz);
+ cc.vcvtsi2ss(xmmA, xmmB, gpd);
+ cc.vcvtsi2ss(xmmA, xmmB, gpz);
+ cc.vcvtss2sd(xmmA, xmmB, xmmC);
+ cc.vcvtss2si(gpd, xmmB);
+ cc.vcvttpd2dq(xmmA, xmmB);
+ cc.vcvttpd2dq(xmmA, ymmB);
+ cc.vcvttps2dq(xmmA, xmmB);
+ cc.vcvttps2dq(ymmA, ymmB);
+ cc.vcvttsd2si(gpd, xmmB);
+ cc.vcvttss2si(gpz, xmmB);
+ cc.vdivpd(xmmA, xmmB, xmmC);
+ cc.vdivpd(ymmA, ymmB, ymmC);
+ cc.vdivps(xmmA, xmmB, xmmC);
+ cc.vdivps(ymmA, ymmB, ymmC);
+ cc.vdivsd(xmmA, xmmB, xmmC);
+ cc.vdivss(xmmA, xmmB, xmmC);
+ cc.vdppd(xmmA, xmmB, xmmC, 0);
+ cc.vdpps(xmmA, xmmB, xmmC, 0);
+ cc.vdpps(ymmA, ymmB, ymmC, 0);
+ cc.vextractf128(xmmA, ymmB, 0);
+ cc.vextractps(gpd, xmmB, 0);
+ cc.vhaddpd(xmmA, xmmB, xmmC);
+ cc.vhaddpd(ymmA, ymmB, ymmC);
+ cc.vhaddps(xmmA, xmmB, xmmC);
+ cc.vhaddps(ymmA, ymmB, ymmC);
+ cc.vhsubpd(xmmA, xmmB, xmmC);
+ cc.vhsubpd(ymmA, ymmB, ymmC);
+ cc.vhsubps(xmmA, xmmB, xmmC);
+ cc.vhsubps(ymmA, ymmB, ymmC);
+ cc.vinsertf128(ymmA, ymmB, xmmC, 0);
+ cc.vinsertps(xmmA, xmmB, xmmC, 0);
+ cc.vmaxpd(xmmA, xmmB, xmmC);
+ cc.vmaxpd(ymmA, ymmB, ymmC);
+ cc.vmaxps(xmmA, xmmB, xmmC);
+ cc.vmaxps(ymmA, ymmB, ymmC);
+ cc.vmaxsd(xmmA, xmmB, xmmC);
+ cc.vmaxss(xmmA, xmmB, xmmC);
+ cc.vminpd(xmmA, xmmB, xmmC);
+ cc.vminpd(ymmA, ymmB, ymmC);
+ cc.vminps(xmmA, xmmB, xmmC);
+ cc.vminps(ymmA, ymmB, ymmC);
+ cc.vminsd(xmmA, xmmB, xmmC);
+ cc.vminss(xmmA, xmmB, xmmC);
+ cc.vmovapd(xmmA, xmmB);
+ cc.vmovapd(ymmA, ymmB);
+ cc.vmovaps(xmmA, xmmB);
+ cc.vmovaps(ymmA, ymmB);
+ cc.vmovd(xmmA, gpd);
+ cc.vmovd(gpd, xmmB);
+ cc.vmovddup(xmmA, xmmB);
+ cc.vmovddup(ymmA, ymmB);
+ cc.vmovdqa(xmmA, xmmB);
+ cc.vmovdqa(ymmA, ymmB);
+ cc.vmovdqu(xmmA, xmmB);
+ cc.vmovdqu(ymmA, ymmB);
+ cc.vmovhlps(xmmA, xmmB, xmmC);
+ cc.vmovlhps(xmmA, xmmB, xmmC);
+ cc.vmovmskpd(gpd, xmmB);
+ cc.vmovmskpd(gpd, ymmB);
+ cc.vmovmskps(gpd, xmmB);
+ cc.vmovmskps(gpd, ymmB);
+ cc.vmovsd(xmmA, xmmB, xmmC);
+ cc.vmovshdup(xmmA, xmmB);
+ cc.vmovshdup(ymmA, ymmB);
+ cc.vmovsldup(xmmA, xmmB);
+ cc.vmovsldup(ymmA, ymmB);
+ cc.vmovss(xmmA, xmmB, xmmC);
+ cc.vmovupd(xmmA, xmmB);
+ cc.vmovupd(ymmA, ymmB);
+ cc.vmovups(xmmA, xmmB);
+ cc.vmovups(ymmA, ymmB);
+ cc.vmpsadbw(xmmA, xmmB, xmmC, 0);
+ cc.vmulpd(xmmA, xmmB, xmmC);
+ cc.vmulpd(ymmA, ymmB, ymmC);
+ cc.vmulps(xmmA, xmmB, xmmC);
+ cc.vmulps(ymmA, ymmB, ymmC);
+ cc.vmulsd(xmmA, xmmB, xmmC);
+ cc.vmulss(xmmA, xmmB, xmmC);
+ cc.vorpd(xmmA, xmmB, xmmC);
+ cc.vorpd(ymmA, ymmB, ymmC);
+ cc.vorps(xmmA, xmmB, xmmC);
+ cc.vorps(ymmA, ymmB, ymmC);
+ cc.vpabsb(xmmA, xmmB);
+ cc.vpabsd(xmmA, xmmB);
+ cc.vpabsw(xmmA, xmmB);
+ cc.vpackssdw(xmmA, xmmB, xmmC);
+ cc.vpacksswb(xmmA, xmmB, xmmC);
+ cc.vpackusdw(xmmA, xmmB, xmmC);
+ cc.vpackuswb(xmmA, xmmB, xmmC);
+ cc.vpaddb(xmmA, xmmB, xmmC);
+ cc.vpaddd(xmmA, xmmB, xmmC);
+ cc.vpaddq(xmmA, xmmB, xmmC);
+ cc.vpaddw(xmmA, xmmB, xmmC);
+ cc.vpaddsb(xmmA, xmmB, xmmC);
+ cc.vpaddsw(xmmA, xmmB, xmmC);
+ cc.vpaddusb(xmmA, xmmB, xmmC);
+ cc.vpaddusw(xmmA, xmmB, xmmC);
+ cc.vpalignr(xmmA, xmmB, xmmC, 0);
+ cc.vpand(xmmA, xmmB, xmmC);
+ cc.vpandn(xmmA, xmmB, xmmC);
+ cc.vpavgb(xmmA, xmmB, xmmC);
+ cc.vpavgw(xmmA, xmmB, xmmC);
+ cc.vpblendvb(xmmA, xmmB, xmmC, xmmA);
+ cc.vpblendw(xmmA, xmmB, xmmC, 0);
+ cc.vpcmpeqb(xmmA, xmmB, xmmC);
+ cc.vpcmpeqd(xmmA, xmmB, xmmC);
+ cc.vpcmpeqq(xmmA, xmmB, xmmC);
+ cc.vpcmpeqw(xmmA, xmmB, xmmC);
+ cc.vpcmpgtb(xmmA, xmmB, xmmC);
+ cc.vpcmpgtd(xmmA, xmmB, xmmC);
+ cc.vpcmpgtq(xmmA, xmmB, xmmC);
+ cc.vpcmpgtw(xmmA, xmmB, xmmC);
+ cc.vpermilpd(xmmA, xmmB, xmmC);
+ cc.vpermilpd(ymmA, ymmB, ymmC);
+ cc.vpermilpd(xmmA, xmmB, 0);
+ cc.vpermilpd(ymmA, ymmB, 0);
+ cc.vpermilps(xmmA, xmmB, xmmC);
+ cc.vpermilps(ymmA, ymmB, ymmC);
+ cc.vpermilps(xmmA, xmmB, 0);
+ cc.vpermilps(ymmA, ymmB, 0);
+ cc.vperm2f128(ymmA, ymmB, ymmC, 0);
+ cc.vpextrb(gpd, xmmB, 0);
+ cc.vpextrd(gpd, xmmB, 0);
+ if (cc.is64Bit()) cc.vpextrq(gpq, xmmB, 0);
+ cc.vpextrw(gpd, xmmB, 0);
+ cc.vphaddd(xmmA, xmmB, xmmC);
+ cc.vphaddsw(xmmA, xmmB, xmmC);
+ cc.vphaddw(xmmA, xmmB, xmmC);
+ cc.vphminposuw(xmmA, xmmB);
+ cc.vphsubd(xmmA, xmmB, xmmC);
+ cc.vphsubsw(xmmA, xmmB, xmmC);
+ cc.vphsubw(xmmA, xmmB, xmmC);
+ cc.vpinsrb(xmmA, xmmB, gpd, 0);
+ cc.vpinsrd(xmmA, xmmB, gpd, 0);
+ cc.vpinsrw(xmmA, xmmB, gpd, 0);
+ cc.vpmaddubsw(xmmA, xmmB, xmmC);
+ cc.vpmaddwd(xmmA, xmmB, xmmC);
+ cc.vpmaxsb(xmmA, xmmB, xmmC);
+ cc.vpmaxsd(xmmA, xmmB, xmmC);
+ cc.vpmaxsw(xmmA, xmmB, xmmC);
+ cc.vpmaxub(xmmA, xmmB, xmmC);
+ cc.vpmaxud(xmmA, xmmB, xmmC);
+ cc.vpmaxuw(xmmA, xmmB, xmmC);
+ cc.vpminsb(xmmA, xmmB, xmmC);
+ cc.vpminsd(xmmA, xmmB, xmmC);
+ cc.vpminsw(xmmA, xmmB, xmmC);
+ cc.vpminub(xmmA, xmmB, xmmC);
+ cc.vpminud(xmmA, xmmB, xmmC);
+ cc.vpminuw(xmmA, xmmB, xmmC);
+ cc.vpmovmskb(gpd, xmmB);
+ cc.vpmovsxbd(xmmA, xmmB);
+ cc.vpmovsxbq(xmmA, xmmB);
+ cc.vpmovsxbw(xmmA, xmmB);
+ cc.vpmovsxdq(xmmA, xmmB);
+ cc.vpmovsxwd(xmmA, xmmB);
+ cc.vpmovsxwq(xmmA, xmmB);
+ cc.vpmovzxbd(xmmA, xmmB);
+ cc.vpmovzxbq(xmmA, xmmB);
+ cc.vpmovzxbw(xmmA, xmmB);
+ cc.vpmovzxdq(xmmA, xmmB);
+ cc.vpmovzxwd(xmmA, xmmB);
+ cc.vpmovzxwq(xmmA, xmmB);
+ cc.vpmuldq(xmmA, xmmB, xmmC);
+ cc.vpmulhrsw(xmmA, xmmB, xmmC);
+ cc.vpmulhuw(xmmA, xmmB, xmmC);
+ cc.vpmulhw(xmmA, xmmB, xmmC);
+ cc.vpmulld(xmmA, xmmB, xmmC);
+ cc.vpmullw(xmmA, xmmB, xmmC);
+ cc.vpmuludq(xmmA, xmmB, xmmC);
+ cc.vpor(xmmA, xmmB, xmmC);
+ cc.vpsadbw(xmmA, xmmB, xmmC);
+ cc.vpshufb(xmmA, xmmB, xmmC);
+ cc.vpshufd(xmmA, xmmB, 0);
+ cc.vpshufhw(xmmA, xmmB, 0);
+ cc.vpshuflw(xmmA, xmmB, 0);
+ cc.vpsignb(xmmA, xmmB, xmmC);
+ cc.vpsignd(xmmA, xmmB, xmmC);
+ cc.vpsignw(xmmA, xmmB, xmmC);
+ cc.vpslld(xmmA, xmmB, xmmC);
+ cc.vpslld(xmmA, xmmB, 0);
+ cc.vpslldq(xmmA, xmmB, 0);
+ cc.vpsllq(xmmA, xmmB, xmmC);
+ cc.vpsllq(xmmA, xmmB, 0);
+ cc.vpsllw(xmmA, xmmB, xmmC);
+ cc.vpsllw(xmmA, xmmB, 0);
+ cc.vpsrad(xmmA, xmmB, xmmC);
+ cc.vpsrad(xmmA, xmmB, 0);
+ cc.vpsraw(xmmA, xmmB, xmmC);
+ cc.vpsraw(xmmA, xmmB, 0);
+ cc.vpsrld(xmmA, xmmB, xmmC);
+ cc.vpsrld(xmmA, xmmB, 0);
+ cc.vpsrldq(xmmA, xmmB, 0);
+ cc.vpsrlq(xmmA, xmmB, xmmC);
+ cc.vpsrlq(xmmA, xmmB, 0);
+ cc.vpsrlw(xmmA, xmmB, xmmC);
+ cc.vpsrlw(xmmA, xmmB, 0);
+ cc.vpsubb(xmmA, xmmB, xmmC);
+ cc.vpsubd(xmmA, xmmB, xmmC);
+ cc.vpsubq(xmmA, xmmB, xmmC);
+ cc.vpsubw(xmmA, xmmB, xmmC);
+ cc.vpsubsb(xmmA, xmmB, xmmC);
+ cc.vpsubsw(xmmA, xmmB, xmmC);
+ cc.vpsubusb(xmmA, xmmB, xmmC);
+ cc.vpsubusw(xmmA, xmmB, xmmC);
+ cc.vptest(xmmA, xmmB);
+ cc.vptest(ymmA, ymmB);
+ cc.vpunpckhbw(xmmA, xmmB, xmmC);
+ cc.vpunpckhdq(xmmA, xmmB, xmmC);
+ cc.vpunpckhqdq(xmmA, xmmB, xmmC);
+ cc.vpunpckhwd(xmmA, xmmB, xmmC);
+ cc.vpunpcklbw(xmmA, xmmB, xmmC);
+ cc.vpunpckldq(xmmA, xmmB, xmmC);
+ cc.vpunpcklqdq(xmmA, xmmB, xmmC);
+ cc.vpunpcklwd(xmmA, xmmB, xmmC);
+ cc.vpxor(xmmA, xmmB, xmmC);
+ cc.vrcpps(xmmA, xmmB);
+ cc.vrcpps(ymmA, ymmB);
+ cc.vrcpss(xmmA, xmmB, xmmC);
+ cc.vrsqrtps(xmmA, xmmB);
+ cc.vrsqrtps(ymmA, ymmB);
+ cc.vrsqrtss(xmmA, xmmB, xmmC);
+ cc.vroundpd(xmmA, xmmB, 0);
+ cc.vroundpd(ymmA, ymmB, 0);
+ cc.vroundps(xmmA, xmmB, 0);
+ cc.vroundps(ymmA, ymmB, 0);
+ cc.vroundsd(xmmA, xmmB, xmmC, 0);
+ cc.vroundss(xmmA, xmmB, xmmC, 0);
+ cc.vshufpd(xmmA, xmmB, xmmC, 0);
+ cc.vshufpd(ymmA, ymmB, ymmC, 0);
+ cc.vshufps(xmmA, xmmB, xmmC, 0);
+ cc.vshufps(ymmA, ymmB, ymmC, 0);
+ cc.vsqrtpd(xmmA, xmmB);
+ cc.vsqrtpd(ymmA, ymmB);
+ cc.vsqrtps(xmmA, xmmB);
+ cc.vsqrtps(ymmA, ymmB);
+ cc.vsqrtsd(xmmA, xmmB, xmmC);
+ cc.vsqrtss(xmmA, xmmB, xmmC);
+ cc.vsubpd(xmmA, xmmB, xmmC);
+ cc.vsubpd(ymmA, ymmB, ymmC);
+ cc.vsubps(xmmA, xmmB, xmmC);
+ cc.vsubps(ymmA, ymmB, ymmC);
+ cc.vsubsd(xmmA, xmmB, xmmC);
+ cc.vsubss(xmmA, xmmB, xmmC);
+ cc.vtestps(xmmA, xmmB);
+ cc.vtestps(ymmA, ymmB);
+ cc.vtestpd(xmmA, xmmB);
+ cc.vtestpd(ymmA, ymmB);
+ cc.vucomisd(xmmA, xmmB);
+ cc.vucomiss(xmmA, xmmB);
+ cc.vunpckhpd(xmmA, xmmB, xmmC);
+ cc.vunpckhpd(ymmA, ymmB, ymmC);
+ cc.vunpckhps(xmmA, xmmB, xmmC);
+ cc.vunpckhps(ymmA, ymmB, ymmC);
+ cc.vunpcklpd(xmmA, xmmB, xmmC);
+ cc.vunpcklpd(ymmA, ymmB, ymmC);
+ cc.vunpcklps(xmmA, xmmB, xmmC);
+ cc.vunpcklps(ymmA, ymmB, ymmC);
+ cc.vxorpd(xmmA, xmmB, xmmC);
+ cc.vxorpd(ymmA, ymmB, ymmC);
+ cc.vxorps(xmmA, xmmB, xmmC);
+ cc.vxorps(ymmA, ymmB, ymmC);
+
+ // AVX+AESNI.
+ cc.vaesdec(xmmA, xmmB, xmmC);
+ cc.vaesdeclast(xmmA, xmmB, xmmC);
+ cc.vaesenc(xmmA, xmmB, xmmC);
+ cc.vaesenclast(xmmA, xmmB, xmmC);
+ cc.vaesimc(xmmA, xmmB);
+ cc.vaeskeygenassist(xmmA, xmmB, 0);
+
+ // AVX+PCLMULQDQ.
+ cc.vpclmulqdq(xmmA, xmmB, xmmC, 0);
+
+ // AVX2.
+ cc.vbroadcastsd(ymmA, xmmB);
+ cc.vbroadcastss(xmmA, xmmB);
+ cc.vbroadcastss(ymmA, xmmB);
+ cc.vextracti128(xmmA, ymmB, 0);
+ cc.vinserti128(ymmA, ymmB, xmmC, 0);
+ cc.vmpsadbw(ymmA, ymmB, ymmC, 0);
+ cc.vpabsb(ymmA, ymmB);
+ cc.vpabsd(ymmA, ymmB);
+ cc.vpabsw(ymmA, ymmB);
+ cc.vpackssdw(ymmA, ymmB, ymmC);
+ cc.vpacksswb(ymmA, ymmB, ymmC);
+ cc.vpackusdw(ymmA, ymmB, ymmC);
+ cc.vpackuswb(ymmA, ymmB, ymmC);
+ cc.vpaddb(ymmA, ymmB, ymmC);
+ cc.vpaddd(ymmA, ymmB, ymmC);
+ cc.vpaddq(ymmA, ymmB, ymmC);
+ cc.vpaddw(ymmA, ymmB, ymmC);
+ cc.vpaddsb(ymmA, ymmB, ymmC);
+ cc.vpaddsw(ymmA, ymmB, ymmC);
+ cc.vpaddusb(ymmA, ymmB, ymmC);
+ cc.vpaddusw(ymmA, ymmB, ymmC);
+ cc.vpalignr(ymmA, ymmB, ymmC, 0);
+ cc.vpand(ymmA, ymmB, ymmC);
+ cc.vpandn(ymmA, ymmB, ymmC);
+ cc.vpavgb(ymmA, ymmB, ymmC);
+ cc.vpavgw(ymmA, ymmB, ymmC);
+ cc.vpblendd(xmmA, xmmB, xmmC, 0);
+ cc.vpblendd(ymmA, ymmB, ymmC, 0);
+ cc.vpblendvb(ymmA, ymmB, ymmC, ymmA);
+ cc.vpblendw(ymmA, ymmB, ymmC, 0);
+ cc.vpbroadcastb(xmmA, xmmB);
+ cc.vpbroadcastb(ymmA, xmmB);
+ cc.vpbroadcastd(xmmA, xmmB);
+ cc.vpbroadcastd(ymmA, xmmB);
+ cc.vpbroadcastq(xmmA, xmmB);
+ cc.vpbroadcastq(ymmA, xmmB);
+ cc.vpbroadcastw(xmmA, xmmB);
+ cc.vpbroadcastw(ymmA, xmmB);
+ cc.vpcmpeqb(ymmA, ymmB, ymmC);
+ cc.vpcmpeqd(ymmA, ymmB, ymmC);
+ cc.vpcmpeqq(ymmA, ymmB, ymmC);
+ cc.vpcmpeqw(ymmA, ymmB, ymmC);
+ cc.vpcmpgtb(ymmA, ymmB, ymmC);
+ cc.vpcmpgtd(ymmA, ymmB, ymmC);
+ cc.vpcmpgtq(ymmA, ymmB, ymmC);
+ cc.vpcmpgtw(ymmA, ymmB, ymmC);
+ cc.vperm2i128(ymmA, ymmB, ymmC, 0);
+ cc.vpermd(ymmA, ymmB, ymmC);
+ cc.vpermps(ymmA, ymmB, ymmC);
+ cc.vpermpd(ymmA, ymmB, 0);
+ cc.vpermq(ymmA, ymmB, 0);
+ cc.vpmovmskb(gpd, ymmB);
+ cc.vpmovsxbd(ymmA, xmmB);
+ cc.vpmovsxbq(ymmA, xmmB);
+ cc.vpmovsxbw(ymmA, xmmB);
+ cc.vpmovsxdq(ymmA, xmmB);
+ cc.vpmovsxwd(ymmA, xmmB);
+ cc.vpmovsxwq(ymmA, xmmB);
+ cc.vpmovzxbd(ymmA, xmmB);
+ cc.vpmovzxbq(ymmA, xmmB);
+ cc.vpmovzxbw(ymmA, xmmB);
+ cc.vpmovzxdq(ymmA, xmmB);
+ cc.vpmovzxwd(ymmA, xmmB);
+ cc.vpmovzxwq(ymmA, xmmB);
+ cc.vpshufd(ymmA, ymmB, 0);
+ cc.vpshufhw(ymmA, ymmB, 0);
+ cc.vpshuflw(ymmA, ymmB, 0);
+ cc.vpslld(ymmA, ymmB, 0);
+ cc.vpslldq(ymmA, ymmB, 0);
+ cc.vpsllq(ymmA, ymmB, 0);
+ cc.vpsllw(ymmA, ymmB, 0);
+ cc.vpsrad(ymmA, ymmB, 0);
+ cc.vpsraw(ymmA, ymmB, 0);
+ cc.vpsrld(ymmA, ymmB, 0);
+ cc.vpsrldq(ymmA, ymmB, 0);
+ cc.vpsrlq(ymmA, ymmB, 0);
+ cc.vpsrlw(ymmA, ymmB, 0);
+ cc.vphaddd(ymmA, ymmB, ymmC);
+ cc.vphaddsw(ymmA, ymmB, ymmC);
+ cc.vphaddw(ymmA, ymmB, ymmC);
+ cc.vphsubd(ymmA, ymmB, ymmC);
+ cc.vphsubsw(ymmA, ymmB, ymmC);
+ cc.vphsubw(ymmA, ymmB, ymmC);
+ cc.vpmaddubsw(ymmA, ymmB, ymmC);
+ cc.vpmaddwd(ymmA, ymmB, ymmC);
+ cc.vpmaxsb(ymmA, ymmB, ymmC);
+ cc.vpmaxsd(ymmA, ymmB, ymmC);
+ cc.vpmaxsw(ymmA, ymmB, ymmC);
+ cc.vpmaxub(ymmA, ymmB, ymmC);
+ cc.vpmaxud(ymmA, ymmB, ymmC);
+ cc.vpmaxuw(ymmA, ymmB, ymmC);
+ cc.vpminsb(ymmA, ymmB, ymmC);
+ cc.vpminsd(ymmA, ymmB, ymmC);
+ cc.vpminsw(ymmA, ymmB, ymmC);
+ cc.vpminub(ymmA, ymmB, ymmC);
+ cc.vpminud(ymmA, ymmB, ymmC);
+ cc.vpminuw(ymmA, ymmB, ymmC);
+ cc.vpmuldq(ymmA, ymmB, ymmC);
+ cc.vpmulhrsw(ymmA, ymmB, ymmC);
+ cc.vpmulhuw(ymmA, ymmB, ymmC);
+ cc.vpmulhw(ymmA, ymmB, ymmC);
+ cc.vpmulld(ymmA, ymmB, ymmC);
+ cc.vpmullw(ymmA, ymmB, ymmC);
+ cc.vpmuludq(ymmA, ymmB, ymmC);
+ cc.vpor(ymmA, ymmB, ymmC);
+ cc.vpsadbw(ymmA, ymmB, ymmC);
+ cc.vpshufb(ymmA, ymmB, ymmC);
+ cc.vpsignb(ymmA, ymmB, ymmC);
+ cc.vpsignd(ymmA, ymmB, ymmC);
+ cc.vpsignw(ymmA, ymmB, ymmC);
+ cc.vpslld(ymmA, ymmB, xmmC);
+ cc.vpsllq(ymmA, ymmB, xmmC);
+ cc.vpsllvd(xmmA, xmmB, xmmC);
+ cc.vpsllvd(ymmA, ymmB, ymmC);
+ cc.vpsllvq(xmmA, xmmB, xmmC);
+ cc.vpsllvq(ymmA, ymmB, ymmC);
+ cc.vpsllw(ymmA, ymmB, xmmC);
+ cc.vpsrad(ymmA, ymmB, xmmC);
+ cc.vpsravd(xmmA, xmmB, xmmC);
+ cc.vpsravd(ymmA, ymmB, ymmC);
+ cc.vpsraw(ymmA, ymmB, xmmC);
+ cc.vpsrld(ymmA, ymmB, xmmC);
+ cc.vpsrlq(ymmA, ymmB, xmmC);
+ cc.vpsrlvd(xmmA, xmmB, xmmC);
+ cc.vpsrlvd(ymmA, ymmB, ymmC);
+ cc.vpsrlvq(xmmA, xmmB, xmmC);
+ cc.vpsrlvq(ymmA, ymmB, ymmC);
+ cc.vpsrlw(ymmA, ymmB, xmmC);
+ cc.vpsubb(ymmA, ymmB, ymmC);
+ cc.vpsubd(ymmA, ymmB, ymmC);
+ cc.vpsubq(ymmA, ymmB, ymmC);
+ cc.vpsubsb(ymmA, ymmB, ymmC);
+ cc.vpsubsw(ymmA, ymmB, ymmC);
+ cc.vpsubusb(ymmA, ymmB, ymmC);
+ cc.vpsubusw(ymmA, ymmB, ymmC);
+ cc.vpsubw(ymmA, ymmB, ymmC);
+ cc.vpunpckhbw(ymmA, ymmB, ymmC);
+ cc.vpunpckhdq(ymmA, ymmB, ymmC);
+ cc.vpunpckhqdq(ymmA, ymmB, ymmC);
+ cc.vpunpckhwd(ymmA, ymmB, ymmC);
+ cc.vpunpcklbw(ymmA, ymmB, ymmC);
+ cc.vpunpckldq(ymmA, ymmB, ymmC);
+ cc.vpunpcklqdq(ymmA, ymmB, ymmC);
+ cc.vpunpcklwd(ymmA, ymmB, ymmC);
+ cc.vpxor(ymmA, ymmB, ymmC);
+
+ // FMA.
+ cc.vfmadd132pd(xmmA, xmmB, xmmC);
+ cc.vfmadd132pd(ymmA, ymmB, ymmC);
+ cc.vfmadd132ps(xmmA, xmmB, xmmC);
+ cc.vfmadd132ps(ymmA, ymmB, ymmC);
+ cc.vfmadd132sd(xmmA, xmmB, xmmC);
+ cc.vfmadd132ss(xmmA, xmmB, xmmC);
+ cc.vfmadd213pd(xmmA, xmmB, xmmC);
+ cc.vfmadd213pd(ymmA, ymmB, ymmC);
+ cc.vfmadd213ps(xmmA, xmmB, xmmC);
+ cc.vfmadd213ps(ymmA, ymmB, ymmC);
+ cc.vfmadd213sd(xmmA, xmmB, xmmC);
+ cc.vfmadd213ss(xmmA, xmmB, xmmC);
+ cc.vfmadd231pd(xmmA, xmmB, xmmC);
+ cc.vfmadd231pd(ymmA, ymmB, ymmC);
+ cc.vfmadd231ps(xmmA, xmmB, xmmC);
+ cc.vfmadd231ps(ymmA, ymmB, ymmC);
+ cc.vfmadd231sd(xmmA, xmmB, xmmC);
+ cc.vfmadd231ss(xmmA, xmmB, xmmC);
+ cc.vfmaddsub132pd(xmmA, xmmB, xmmC);
+ cc.vfmaddsub132pd(ymmA, ymmB, ymmC);
+ cc.vfmaddsub132ps(xmmA, xmmB, xmmC);
+ cc.vfmaddsub132ps(ymmA, ymmB, ymmC);
+ cc.vfmaddsub213pd(xmmA, xmmB, xmmC);
+ cc.vfmaddsub213pd(ymmA, ymmB, ymmC);
+ cc.vfmaddsub213ps(xmmA, xmmB, xmmC);
+ cc.vfmaddsub213ps(ymmA, ymmB, ymmC);
+ cc.vfmaddsub231pd(xmmA, xmmB, xmmC);
+ cc.vfmaddsub231pd(ymmA, ymmB, ymmC);
+ cc.vfmaddsub231ps(xmmA, xmmB, xmmC);
+ cc.vfmaddsub231ps(ymmA, ymmB, ymmC);
+ cc.vfmsub132pd(xmmA, xmmB, xmmC);
+ cc.vfmsub132pd(ymmA, ymmB, ymmC);
+ cc.vfmsub132ps(xmmA, xmmB, xmmC);
+ cc.vfmsub132ps(ymmA, ymmB, ymmC);
+ cc.vfmsub132sd(xmmA, xmmB, xmmC);
+ cc.vfmsub132ss(xmmA, xmmB, xmmC);
+ cc.vfmsub213pd(xmmA, xmmB, xmmC);
+ cc.vfmsub213pd(ymmA, ymmB, ymmC);
+ cc.vfmsub213ps(xmmA, xmmB, xmmC);
+ cc.vfmsub213ps(ymmA, ymmB, ymmC);
+ cc.vfmsub213sd(xmmA, xmmB, xmmC);
+ cc.vfmsub213ss(xmmA, xmmB, xmmC);
+ cc.vfmsub231pd(xmmA, xmmB, xmmC);
+ cc.vfmsub231pd(ymmA, ymmB, ymmC);
+ cc.vfmsub231ps(xmmA, xmmB, xmmC);
+ cc.vfmsub231ps(ymmA, ymmB, ymmC);
+ cc.vfmsub231sd(xmmA, xmmB, xmmC);
+ cc.vfmsub231ss(xmmA, xmmB, xmmC);
+ cc.vfmsubadd132pd(xmmA, xmmB, xmmC);
+ cc.vfmsubadd132pd(ymmA, ymmB, ymmC);
+ cc.vfmsubadd132ps(xmmA, xmmB, xmmC);
+ cc.vfmsubadd132ps(ymmA, ymmB, ymmC);
+ cc.vfmsubadd213pd(xmmA, xmmB, xmmC);
+ cc.vfmsubadd213pd(ymmA, ymmB, ymmC);
+ cc.vfmsubadd213ps(xmmA, xmmB, xmmC);
+ cc.vfmsubadd213ps(ymmA, ymmB, ymmC);
+ cc.vfmsubadd231pd(xmmA, xmmB, xmmC);
+ cc.vfmsubadd231pd(ymmA, ymmB, ymmC);
+ cc.vfmsubadd231ps(xmmA, xmmB, xmmC);
+ cc.vfmsubadd231ps(ymmA, ymmB, ymmC);
+ cc.vfnmadd132pd(xmmA, xmmB, xmmC);
+ cc.vfnmadd132pd(ymmA, ymmB, ymmC);
+ cc.vfnmadd132ps(xmmA, xmmB, xmmC);
+ cc.vfnmadd132ps(ymmA, ymmB, ymmC);
+ cc.vfnmadd132sd(xmmA, xmmB, xmmC);
+ cc.vfnmadd132ss(xmmA, xmmB, xmmC);
+ cc.vfnmadd213pd(xmmA, xmmB, xmmC);
+ cc.vfnmadd213pd(ymmA, ymmB, ymmC);
+ cc.vfnmadd213ps(xmmA, xmmB, xmmC);
+ cc.vfnmadd213ps(ymmA, ymmB, ymmC);
+ cc.vfnmadd213sd(xmmA, xmmB, xmmC);
+ cc.vfnmadd213ss(xmmA, xmmB, xmmC);
+ cc.vfnmadd231pd(xmmA, xmmB, xmmC);
+ cc.vfnmadd231pd(ymmA, ymmB, ymmC);
+ cc.vfnmadd231ps(xmmA, xmmB, xmmC);
+ cc.vfnmadd231ps(ymmA, ymmB, ymmC);
+ cc.vfnmadd231sd(xmmA, xmmB, xmmC);
+ cc.vfnmadd231ss(xmmA, xmmB, xmmC);
+ cc.vfnmsub132pd(xmmA, xmmB, xmmC);
+ cc.vfnmsub132pd(ymmA, ymmB, ymmC);
+ cc.vfnmsub132ps(xmmA, xmmB, xmmC);
+ cc.vfnmsub132ps(ymmA, ymmB, ymmC);
+ cc.vfnmsub132sd(xmmA, xmmB, xmmC);
+ cc.vfnmsub132ss(xmmA, xmmB, xmmC);
+ cc.vfnmsub213pd(xmmA, xmmB, xmmC);
+ cc.vfnmsub213pd(ymmA, ymmB, ymmC);
+ cc.vfnmsub213ps(xmmA, xmmB, xmmC);
+ cc.vfnmsub213ps(ymmA, ymmB, ymmC);
+ cc.vfnmsub213sd(xmmA, xmmB, xmmC);
+ cc.vfnmsub213ss(xmmA, xmmB, xmmC);
+ cc.vfnmsub231pd(xmmA, xmmB, xmmC);
+ cc.vfnmsub231pd(ymmA, ymmB, ymmC);
+ cc.vfnmsub231ps(xmmA, xmmB, xmmC);
+ cc.vfnmsub231ps(ymmA, ymmB, ymmC);
+ cc.vfnmsub231sd(xmmA, xmmB, xmmC);
+ cc.vfnmsub231ss(xmmA, xmmB, xmmC);
+}
+
+// Generates a long sequence of AVX instructions.
+template<typename Emitter>
+static void generateAvxSequenceInternalRegMem(
Emitter& cc,
- InstForm form,
const x86::Gp& gp,
const x86::Vec& vecA, const x86::Vec& vecB, const x86::Vec& vecC, const x86::Vec& vecD) {
@@ -1003,1090 +1596,534 @@ static void generateAvxSequenceInternal(
x86::Ymm ymmC = vecC.ymm();
x86::Ymm ymmD = vecD.ymm();
+ x86::Mem m = x86::ptr(gpz);
+ x86::Mem m128 = x86::xmmword_ptr(gpz);
+ x86::Mem m256 = x86::xmmword_ptr(gpz);
+ x86::Mem vx_ptr = x86::ptr(gpz, xmmD);
+ x86::Mem vy_ptr = x86::ptr(gpz, ymmD);
+
cc.xor_(gpd, gpd);
cc.vxorps(xmmA, xmmA, xmmA);
cc.vxorps(xmmB, xmmB, xmmB);
cc.vxorps(xmmC, xmmC, xmmC);
cc.vxorps(xmmD, xmmD, xmmD);
- if (form == InstForm::kReg) {
- cc.vaddpd(xmmA, xmmB, xmmC);
- cc.vaddpd(ymmA, ymmB, ymmC);
- cc.vaddps(xmmA, xmmB, xmmC);
- cc.vaddps(ymmA, ymmB, ymmC);
- cc.vaddsd(xmmA, xmmB, xmmC);
- cc.vaddss(xmmA, xmmB, xmmC);
- cc.vaddsubpd(xmmA, xmmB, xmmC);
- cc.vaddsubpd(ymmA, ymmB, ymmC);
- cc.vaddsubps(xmmA, xmmB, xmmC);
- cc.vaddsubps(ymmA, ymmB, ymmC);
- cc.vandpd(xmmA, xmmB, xmmC);
- cc.vandpd(ymmA, ymmB, ymmC);
- cc.vandps(xmmA, xmmB, xmmC);
- cc.vandps(ymmA, ymmB, ymmC);
- cc.vandnpd(xmmA, xmmB, xmmC);
- cc.vandnpd(ymmA, ymmB, ymmC);
- cc.vandnps(xmmA, xmmB, xmmC);
- cc.vandnps(ymmA, ymmB, ymmC);
- cc.vblendpd(xmmA, xmmB, xmmC, 0);
- cc.vblendpd(ymmA, ymmB, ymmC, 0);
- cc.vblendps(xmmA, xmmB, xmmC, 0);
- cc.vblendps(ymmA, ymmB, ymmC, 0);
- cc.vblendvpd(xmmA, xmmB, xmmC, xmmA);
- cc.vblendvpd(ymmA, ymmB, ymmC, ymmA);
- cc.vcmppd(xmmA, xmmB, xmmC, 0);
- cc.vcmppd(ymmA, ymmB, ymmC, 0);
- cc.vcmpps(xmmA, xmmB, xmmC, 0);
- cc.vcmpps(ymmA, ymmB, ymmC, 0);
- cc.vcmpsd(xmmA, xmmB, xmmC, 0);
- cc.vcmpss(xmmA, xmmB, xmmC, 0);
- cc.vcomisd(xmmA, xmmB);
- cc.vcomiss(xmmA, xmmB);
- cc.vcvtdq2pd(xmmA, xmmB);
- cc.vcvtdq2pd(ymmA, xmmB);
- cc.vcvtdq2ps(xmmA, xmmB);
- cc.vcvtdq2ps(ymmA, ymmB);
- cc.vcvtpd2dq(xmmA, xmmB);
- cc.vcvtpd2dq(xmmA, ymmB);
- cc.vcvtpd2ps(xmmA, xmmB);
- cc.vcvtpd2ps(xmmA, ymmB);
- cc.vcvtps2dq(xmmA, xmmB);
- cc.vcvtps2dq(ymmA, ymmB);
- cc.vcvtps2pd(xmmA, xmmB);
- cc.vcvtps2pd(ymmA, xmmB);
- cc.vcvtsd2si(gpd, xmmB);
- cc.vcvtsd2si(gpz, xmmB);
- cc.vcvtsd2ss(xmmA, xmmB, xmmC);
- cc.vcvtsi2sd(xmmA, xmmB, gpd);
- cc.vcvtsi2sd(xmmA, xmmB, gpz);
- cc.vcvtsi2ss(xmmA, xmmB, gpd);
- cc.vcvtsi2ss(xmmA, xmmB, gpz);
- cc.vcvtss2sd(xmmA, xmmB, xmmC);
- cc.vcvtss2si(gpd, xmmB);
- cc.vcvttpd2dq(xmmA, xmmB);
- cc.vcvttpd2dq(xmmA, ymmB);
- cc.vcvttps2dq(xmmA, xmmB);
- cc.vcvttps2dq(ymmA, ymmB);
- cc.vcvttsd2si(gpd, xmmB);
- cc.vcvttss2si(gpz, xmmB);
- cc.vdivpd(xmmA, xmmB, xmmC);
- cc.vdivpd(ymmA, ymmB, ymmC);
- cc.vdivps(xmmA, xmmB, xmmC);
- cc.vdivps(ymmA, ymmB, ymmC);
- cc.vdivsd(xmmA, xmmB, xmmC);
- cc.vdivss(xmmA, xmmB, xmmC);
- cc.vdppd(xmmA, xmmB, xmmC, 0);
- cc.vdpps(xmmA, xmmB, xmmC, 0);
- cc.vdpps(ymmA, ymmB, ymmC, 0);
- cc.vextractf128(xmmA, ymmB, 0);
- cc.vextractps(gpd, xmmB, 0);
- cc.vhaddpd(xmmA, xmmB, xmmC);
- cc.vhaddpd(ymmA, ymmB, ymmC);
- cc.vhaddps(xmmA, xmmB, xmmC);
- cc.vhaddps(ymmA, ymmB, ymmC);
- cc.vhsubpd(xmmA, xmmB, xmmC);
- cc.vhsubpd(ymmA, ymmB, ymmC);
- cc.vhsubps(xmmA, xmmB, xmmC);
- cc.vhsubps(ymmA, ymmB, ymmC);
- cc.vinsertf128(ymmA, ymmB, xmmC, 0);
- cc.vinsertps(xmmA, xmmB, xmmC, 0);
- cc.vmaxpd(xmmA, xmmB, xmmC);
- cc.vmaxpd(ymmA, ymmB, ymmC);
- cc.vmaxps(xmmA, xmmB, xmmC);
- cc.vmaxps(ymmA, ymmB, ymmC);
- cc.vmaxsd(xmmA, xmmB, xmmC);
- cc.vmaxss(xmmA, xmmB, xmmC);
- cc.vminpd(xmmA, xmmB, xmmC);
- cc.vminpd(ymmA, ymmB, ymmC);
- cc.vminps(xmmA, xmmB, xmmC);
- cc.vminps(ymmA, ymmB, ymmC);
- cc.vminsd(xmmA, xmmB, xmmC);
- cc.vminss(xmmA, xmmB, xmmC);
- cc.vmovapd(xmmA, xmmB);
- cc.vmovapd(ymmA, ymmB);
- cc.vmovaps(xmmA, xmmB);
- cc.vmovaps(ymmA, ymmB);
- cc.vmovd(xmmA, gpd);
- cc.vmovd(gpd, xmmB);
- cc.vmovddup(xmmA, xmmB);
- cc.vmovddup(ymmA, ymmB);
- cc.vmovdqa(xmmA, xmmB);
- cc.vmovdqa(ymmA, ymmB);
- cc.vmovdqu(xmmA, xmmB);
- cc.vmovdqu(ymmA, ymmB);
- cc.vmovhlps(xmmA, xmmB, xmmC);
- cc.vmovlhps(xmmA, xmmB, xmmC);
- cc.vmovmskpd(gpd, xmmB);
- cc.vmovmskpd(gpd, ymmB);
- cc.vmovmskps(gpd, xmmB);
- cc.vmovmskps(gpd, ymmB);
- cc.vmovsd(xmmA, xmmB, xmmC);
- cc.vmovshdup(xmmA, xmmB);
- cc.vmovshdup(ymmA, ymmB);
- cc.vmovsldup(xmmA, xmmB);
- cc.vmovsldup(ymmA, ymmB);
- cc.vmovss(xmmA, xmmB, xmmC);
- cc.vmovupd(xmmA, xmmB);
- cc.vmovupd(ymmA, ymmB);
- cc.vmovups(xmmA, xmmB);
- cc.vmovups(ymmA, ymmB);
- cc.vmpsadbw(xmmA, xmmB, xmmC, 0);
- cc.vmulpd(xmmA, xmmB, xmmC);
- cc.vmulpd(ymmA, ymmB, ymmC);
- cc.vmulps(xmmA, xmmB, xmmC);
- cc.vmulps(ymmA, ymmB, ymmC);
- cc.vmulsd(xmmA, xmmB, xmmC);
- cc.vmulss(xmmA, xmmB, xmmC);
- cc.vorpd(xmmA, xmmB, xmmC);
- cc.vorpd(ymmA, ymmB, ymmC);
- cc.vorps(xmmA, xmmB, xmmC);
- cc.vorps(ymmA, ymmB, ymmC);
- cc.vpabsb(xmmA, xmmB);
- cc.vpabsd(xmmA, xmmB);
- cc.vpabsw(xmmA, xmmB);
- cc.vpackssdw(xmmA, xmmB, xmmC);
- cc.vpacksswb(xmmA, xmmB, xmmC);
- cc.vpackusdw(xmmA, xmmB, xmmC);
- cc.vpackuswb(xmmA, xmmB, xmmC);
- cc.vpaddb(xmmA, xmmB, xmmC);
- cc.vpaddd(xmmA, xmmB, xmmC);
- cc.vpaddq(xmmA, xmmB, xmmC);
- cc.vpaddw(xmmA, xmmB, xmmC);
- cc.vpaddsb(xmmA, xmmB, xmmC);
- cc.vpaddsw(xmmA, xmmB, xmmC);
- cc.vpaddusb(xmmA, xmmB, xmmC);
- cc.vpaddusw(xmmA, xmmB, xmmC);
- cc.vpalignr(xmmA, xmmB, xmmC, 0);
- cc.vpand(xmmA, xmmB, xmmC);
- cc.vpandn(xmmA, xmmB, xmmC);
- cc.vpavgb(xmmA, xmmB, xmmC);
- cc.vpavgw(xmmA, xmmB, xmmC);
- cc.vpblendvb(xmmA, xmmB, xmmC, xmmA);
- cc.vpblendw(xmmA, xmmB, xmmC, 0);
- cc.vpcmpeqb(xmmA, xmmB, xmmC);
- cc.vpcmpeqd(xmmA, xmmB, xmmC);
- cc.vpcmpeqq(xmmA, xmmB, xmmC);
- cc.vpcmpeqw(xmmA, xmmB, xmmC);
- cc.vpcmpgtb(xmmA, xmmB, xmmC);
- cc.vpcmpgtd(xmmA, xmmB, xmmC);
- cc.vpcmpgtq(xmmA, xmmB, xmmC);
- cc.vpcmpgtw(xmmA, xmmB, xmmC);
- cc.vpermilpd(xmmA, xmmB, xmmC);
- cc.vpermilpd(ymmA, ymmB, ymmC);
- cc.vpermilpd(xmmA, xmmB, 0);
- cc.vpermilpd(ymmA, ymmB, 0);
- cc.vpermilps(xmmA, xmmB, xmmC);
- cc.vpermilps(ymmA, ymmB, ymmC);
- cc.vpermilps(xmmA, xmmB, 0);
- cc.vpermilps(ymmA, ymmB, 0);
- cc.vperm2f128(ymmA, ymmB, ymmC, 0);
- cc.vpextrb(gpd, xmmB, 0);
- cc.vpextrd(gpd, xmmB, 0);
- if (cc.is64Bit()) cc.vpextrq(gpq, xmmB, 0);
- cc.vpextrw(gpd, xmmB, 0);
- cc.vphaddd(xmmA, xmmB, xmmC);
- cc.vphaddsw(xmmA, xmmB, xmmC);
- cc.vphaddw(xmmA, xmmB, xmmC);
- cc.vphminposuw(xmmA, xmmB);
- cc.vphsubd(xmmA, xmmB, xmmC);
- cc.vphsubsw(xmmA, xmmB, xmmC);
- cc.vphsubw(xmmA, xmmB, xmmC);
- cc.vpinsrb(xmmA, xmmB, gpd, 0);
- cc.vpinsrd(xmmA, xmmB, gpd, 0);
- cc.vpinsrw(xmmA, xmmB, gpd, 0);
- cc.vpmaddubsw(xmmA, xmmB, xmmC);
- cc.vpmaddwd(xmmA, xmmB, xmmC);
- cc.vpmaxsb(xmmA, xmmB, xmmC);
- cc.vpmaxsd(xmmA, xmmB, xmmC);
- cc.vpmaxsw(xmmA, xmmB, xmmC);
- cc.vpmaxub(xmmA, xmmB, xmmC);
- cc.vpmaxud(xmmA, xmmB, xmmC);
- cc.vpmaxuw(xmmA, xmmB, xmmC);
- cc.vpminsb(xmmA, xmmB, xmmC);
- cc.vpminsd(xmmA, xmmB, xmmC);
- cc.vpminsw(xmmA, xmmB, xmmC);
- cc.vpminub(xmmA, xmmB, xmmC);
- cc.vpminud(xmmA, xmmB, xmmC);
- cc.vpminuw(xmmA, xmmB, xmmC);
- cc.vpmovmskb(gpd, xmmB);
- cc.vpmovsxbd(xmmA, xmmB);
- cc.vpmovsxbq(xmmA, xmmB);
- cc.vpmovsxbw(xmmA, xmmB);
- cc.vpmovsxdq(xmmA, xmmB);
- cc.vpmovsxwd(xmmA, xmmB);
- cc.vpmovsxwq(xmmA, xmmB);
- cc.vpmovzxbd(xmmA, xmmB);
- cc.vpmovzxbq(xmmA, xmmB);
- cc.vpmovzxbw(xmmA, xmmB);
- cc.vpmovzxdq(xmmA, xmmB);
- cc.vpmovzxwd(xmmA, xmmB);
- cc.vpmovzxwq(xmmA, xmmB);
- cc.vpmuldq(xmmA, xmmB, xmmC);
- cc.vpmulhrsw(xmmA, xmmB, xmmC);
- cc.vpmulhuw(xmmA, xmmB, xmmC);
- cc.vpmulhw(xmmA, xmmB, xmmC);
- cc.vpmulld(xmmA, xmmB, xmmC);
- cc.vpmullw(xmmA, xmmB, xmmC);
- cc.vpmuludq(xmmA, xmmB, xmmC);
- cc.vpor(xmmA, xmmB, xmmC);
- cc.vpsadbw(xmmA, xmmB, xmmC);
- cc.vpshufb(xmmA, xmmB, xmmC);
- cc.vpshufd(xmmA, xmmB, 0);
- cc.vpshufhw(xmmA, xmmB, 0);
- cc.vpshuflw(xmmA, xmmB, 0);
- cc.vpsignb(xmmA, xmmB, xmmC);
- cc.vpsignd(xmmA, xmmB, xmmC);
- cc.vpsignw(xmmA, xmmB, xmmC);
- cc.vpslld(xmmA, xmmB, xmmC);
- cc.vpslld(xmmA, xmmB, 0);
- cc.vpslldq(xmmA, xmmB, 0);
- cc.vpsllq(xmmA, xmmB, xmmC);
- cc.vpsllq(xmmA, xmmB, 0);
- cc.vpsllw(xmmA, xmmB, xmmC);
- cc.vpsllw(xmmA, xmmB, 0);
- cc.vpsrad(xmmA, xmmB, xmmC);
- cc.vpsrad(xmmA, xmmB, 0);
- cc.vpsraw(xmmA, xmmB, xmmC);
- cc.vpsraw(xmmA, xmmB, 0);
- cc.vpsrld(xmmA, xmmB, xmmC);
- cc.vpsrld(xmmA, xmmB, 0);
- cc.vpsrldq(xmmA, xmmB, 0);
- cc.vpsrlq(xmmA, xmmB, xmmC);
- cc.vpsrlq(xmmA, xmmB, 0);
- cc.vpsrlw(xmmA, xmmB, xmmC);
- cc.vpsrlw(xmmA, xmmB, 0);
- cc.vpsubb(xmmA, xmmB, xmmC);
- cc.vpsubd(xmmA, xmmB, xmmC);
- cc.vpsubq(xmmA, xmmB, xmmC);
- cc.vpsubw(xmmA, xmmB, xmmC);
- cc.vpsubsb(xmmA, xmmB, xmmC);
- cc.vpsubsw(xmmA, xmmB, xmmC);
- cc.vpsubusb(xmmA, xmmB, xmmC);
- cc.vpsubusw(xmmA, xmmB, xmmC);
- cc.vptest(xmmA, xmmB);
- cc.vptest(ymmA, ymmB);
- cc.vpunpckhbw(xmmA, xmmB, xmmC);
- cc.vpunpckhdq(xmmA, xmmB, xmmC);
- cc.vpunpckhqdq(xmmA, xmmB, xmmC);
- cc.vpunpckhwd(xmmA, xmmB, xmmC);
- cc.vpunpcklbw(xmmA, xmmB, xmmC);
- cc.vpunpckldq(xmmA, xmmB, xmmC);
- cc.vpunpcklqdq(xmmA, xmmB, xmmC);
- cc.vpunpcklwd(xmmA, xmmB, xmmC);
- cc.vpxor(xmmA, xmmB, xmmC);
- cc.vrcpps(xmmA, xmmB);
- cc.vrcpps(ymmA, ymmB);
- cc.vrcpss(xmmA, xmmB, xmmC);
- cc.vrsqrtps(xmmA, xmmB);
- cc.vrsqrtps(ymmA, ymmB);
- cc.vrsqrtss(xmmA, xmmB, xmmC);
- cc.vroundpd(xmmA, xmmB, 0);
- cc.vroundpd(ymmA, ymmB, 0);
- cc.vroundps(xmmA, xmmB, 0);
- cc.vroundps(ymmA, ymmB, 0);
- cc.vroundsd(xmmA, xmmB, xmmC, 0);
- cc.vroundss(xmmA, xmmB, xmmC, 0);
- cc.vshufpd(xmmA, xmmB, xmmC, 0);
- cc.vshufpd(ymmA, ymmB, ymmC, 0);
- cc.vshufps(xmmA, xmmB, xmmC, 0);
- cc.vshufps(ymmA, ymmB, ymmC, 0);
- cc.vsqrtpd(xmmA, xmmB);
- cc.vsqrtpd(ymmA, ymmB);
- cc.vsqrtps(xmmA, xmmB);
- cc.vsqrtps(ymmA, ymmB);
- cc.vsqrtsd(xmmA, xmmB, xmmC);
- cc.vsqrtss(xmmA, xmmB, xmmC);
- cc.vsubpd(xmmA, xmmB, xmmC);
- cc.vsubpd(ymmA, ymmB, ymmC);
- cc.vsubps(xmmA, xmmB, xmmC);
- cc.vsubps(ymmA, ymmB, ymmC);
- cc.vsubsd(xmmA, xmmB, xmmC);
- cc.vsubss(xmmA, xmmB, xmmC);
- cc.vtestps(xmmA, xmmB);
- cc.vtestps(ymmA, ymmB);
- cc.vtestpd(xmmA, xmmB);
- cc.vtestpd(ymmA, ymmB);
- cc.vucomisd(xmmA, xmmB);
- cc.vucomiss(xmmA, xmmB);
- cc.vunpckhpd(xmmA, xmmB, xmmC);
- cc.vunpckhpd(ymmA, ymmB, ymmC);
- cc.vunpckhps(xmmA, xmmB, xmmC);
- cc.vunpckhps(ymmA, ymmB, ymmC);
- cc.vunpcklpd(xmmA, xmmB, xmmC);
- cc.vunpcklpd(ymmA, ymmB, ymmC);
- cc.vunpcklps(xmmA, xmmB, xmmC);
- cc.vunpcklps(ymmA, ymmB, ymmC);
- cc.vxorpd(xmmA, xmmB, xmmC);
- cc.vxorpd(ymmA, ymmB, ymmC);
- cc.vxorps(xmmA, xmmB, xmmC);
- cc.vxorps(ymmA, ymmB, ymmC);
-
- // AVX+AESNI.
- cc.vaesdec(xmmA, xmmB, xmmC);
- cc.vaesdeclast(xmmA, xmmB, xmmC);
- cc.vaesenc(xmmA, xmmB, xmmC);
- cc.vaesenclast(xmmA, xmmB, xmmC);
- cc.vaesimc(xmmA, xmmB);
- cc.vaeskeygenassist(xmmA, xmmB, 0);
-
- // AVX+PCLMULQDQ.
- cc.vpclmulqdq(xmmA, xmmB, xmmC, 0);
-
- // AVX2.
- cc.vbroadcastsd(ymmA, xmmB);
- cc.vbroadcastss(xmmA, xmmB);
- cc.vbroadcastss(ymmA, xmmB);
- cc.vextracti128(xmmA, ymmB, 0);
- cc.vinserti128(ymmA, ymmB, xmmC, 0);
- cc.vmpsadbw(ymmA, ymmB, ymmC, 0);
- cc.vpabsb(ymmA, ymmB);
- cc.vpabsd(ymmA, ymmB);
- cc.vpabsw(ymmA, ymmB);
- cc.vpackssdw(ymmA, ymmB, ymmC);
- cc.vpacksswb(ymmA, ymmB, ymmC);
- cc.vpackusdw(ymmA, ymmB, ymmC);
- cc.vpackuswb(ymmA, ymmB, ymmC);
- cc.vpaddb(ymmA, ymmB, ymmC);
- cc.vpaddd(ymmA, ymmB, ymmC);
- cc.vpaddq(ymmA, ymmB, ymmC);
- cc.vpaddw(ymmA, ymmB, ymmC);
- cc.vpaddsb(ymmA, ymmB, ymmC);
- cc.vpaddsw(ymmA, ymmB, ymmC);
- cc.vpaddusb(ymmA, ymmB, ymmC);
- cc.vpaddusw(ymmA, ymmB, ymmC);
- cc.vpalignr(ymmA, ymmB, ymmC, 0);
- cc.vpand(ymmA, ymmB, ymmC);
- cc.vpandn(ymmA, ymmB, ymmC);
- cc.vpavgb(ymmA, ymmB, ymmC);
- cc.vpavgw(ymmA, ymmB, ymmC);
- cc.vpblendd(xmmA, xmmB, xmmC, 0);
- cc.vpblendd(ymmA, ymmB, ymmC, 0);
- cc.vpblendvb(ymmA, ymmB, ymmC, ymmA);
- cc.vpblendw(ymmA, ymmB, ymmC, 0);
- cc.vpbroadcastb(xmmA, xmmB);
- cc.vpbroadcastb(ymmA, xmmB);
- cc.vpbroadcastd(xmmA, xmmB);
- cc.vpbroadcastd(ymmA, xmmB);
- cc.vpbroadcastq(xmmA, xmmB);
- cc.vpbroadcastq(ymmA, xmmB);
- cc.vpbroadcastw(xmmA, xmmB);
- cc.vpbroadcastw(ymmA, xmmB);
- cc.vpcmpeqb(ymmA, ymmB, ymmC);
- cc.vpcmpeqd(ymmA, ymmB, ymmC);
- cc.vpcmpeqq(ymmA, ymmB, ymmC);
- cc.vpcmpeqw(ymmA, ymmB, ymmC);
- cc.vpcmpgtb(ymmA, ymmB, ymmC);
- cc.vpcmpgtd(ymmA, ymmB, ymmC);
- cc.vpcmpgtq(ymmA, ymmB, ymmC);
- cc.vpcmpgtw(ymmA, ymmB, ymmC);
- cc.vperm2i128(ymmA, ymmB, ymmC, 0);
- cc.vpermd(ymmA, ymmB, ymmC);
- cc.vpermps(ymmA, ymmB, ymmC);
- cc.vpermpd(ymmA, ymmB, 0);
- cc.vpermq(ymmA, ymmB, 0);
- cc.vpmovmskb(gpd, ymmB);
- cc.vpmovsxbd(ymmA, xmmB);
- cc.vpmovsxbq(ymmA, xmmB);
- cc.vpmovsxbw(ymmA, xmmB);
- cc.vpmovsxdq(ymmA, xmmB);
- cc.vpmovsxwd(ymmA, xmmB);
- cc.vpmovsxwq(ymmA, xmmB);
- cc.vpmovzxbd(ymmA, xmmB);
- cc.vpmovzxbq(ymmA, xmmB);
- cc.vpmovzxbw(ymmA, xmmB);
- cc.vpmovzxdq(ymmA, xmmB);
- cc.vpmovzxwd(ymmA, xmmB);
- cc.vpmovzxwq(ymmA, xmmB);
- cc.vpshufd(ymmA, ymmB, 0);
- cc.vpshufhw(ymmA, ymmB, 0);
- cc.vpshuflw(ymmA, ymmB, 0);
- cc.vpslld(ymmA, ymmB, 0);
- cc.vpslldq(ymmA, ymmB, 0);
- cc.vpsllq(ymmA, ymmB, 0);
- cc.vpsllw(ymmA, ymmB, 0);
- cc.vpsrad(ymmA, ymmB, 0);
- cc.vpsraw(ymmA, ymmB, 0);
- cc.vpsrld(ymmA, ymmB, 0);
- cc.vpsrldq(ymmA, ymmB, 0);
- cc.vpsrlq(ymmA, ymmB, 0);
- cc.vpsrlw(ymmA, ymmB, 0);
- cc.vphaddd(ymmA, ymmB, ymmC);
- cc.vphaddsw(ymmA, ymmB, ymmC);
- cc.vphaddw(ymmA, ymmB, ymmC);
- cc.vphsubd(ymmA, ymmB, ymmC);
- cc.vphsubsw(ymmA, ymmB, ymmC);
- cc.vphsubw(ymmA, ymmB, ymmC);
- cc.vpmaddubsw(ymmA, ymmB, ymmC);
- cc.vpmaddwd(ymmA, ymmB, ymmC);
- cc.vpmaxsb(ymmA, ymmB, ymmC);
- cc.vpmaxsd(ymmA, ymmB, ymmC);
- cc.vpmaxsw(ymmA, ymmB, ymmC);
- cc.vpmaxub(ymmA, ymmB, ymmC);
- cc.vpmaxud(ymmA, ymmB, ymmC);
- cc.vpmaxuw(ymmA, ymmB, ymmC);
- cc.vpminsb(ymmA, ymmB, ymmC);
- cc.vpminsd(ymmA, ymmB, ymmC);
- cc.vpminsw(ymmA, ymmB, ymmC);
- cc.vpminub(ymmA, ymmB, ymmC);
- cc.vpminud(ymmA, ymmB, ymmC);
- cc.vpminuw(ymmA, ymmB, ymmC);
- cc.vpmuldq(ymmA, ymmB, ymmC);
- cc.vpmulhrsw(ymmA, ymmB, ymmC);
- cc.vpmulhuw(ymmA, ymmB, ymmC);
- cc.vpmulhw(ymmA, ymmB, ymmC);
- cc.vpmulld(ymmA, ymmB, ymmC);
- cc.vpmullw(ymmA, ymmB, ymmC);
- cc.vpmuludq(ymmA, ymmB, ymmC);
- cc.vpor(ymmA, ymmB, ymmC);
- cc.vpsadbw(ymmA, ymmB, ymmC);
- cc.vpshufb(ymmA, ymmB, ymmC);
- cc.vpsignb(ymmA, ymmB, ymmC);
- cc.vpsignd(ymmA, ymmB, ymmC);
- cc.vpsignw(ymmA, ymmB, ymmC);
- cc.vpslld(ymmA, ymmB, xmmC);
- cc.vpsllq(ymmA, ymmB, xmmC);
- cc.vpsllvd(xmmA, xmmB, xmmC);
- cc.vpsllvd(ymmA, ymmB, ymmC);
- cc.vpsllvq(xmmA, xmmB, xmmC);
- cc.vpsllvq(ymmA, ymmB, ymmC);
- cc.vpsllw(ymmA, ymmB, xmmC);
- cc.vpsrad(ymmA, ymmB, xmmC);
- cc.vpsravd(xmmA, xmmB, xmmC);
- cc.vpsravd(ymmA, ymmB, ymmC);
- cc.vpsraw(ymmA, ymmB, xmmC);
- cc.vpsrld(ymmA, ymmB, xmmC);
- cc.vpsrlq(ymmA, ymmB, xmmC);
- cc.vpsrlvd(xmmA, xmmB, xmmC);
- cc.vpsrlvd(ymmA, ymmB, ymmC);
- cc.vpsrlvq(xmmA, xmmB, xmmC);
- cc.vpsrlvq(ymmA, ymmB, ymmC);
- cc.vpsrlw(ymmA, ymmB, xmmC);
- cc.vpsubb(ymmA, ymmB, ymmC);
- cc.vpsubd(ymmA, ymmB, ymmC);
- cc.vpsubq(ymmA, ymmB, ymmC);
- cc.vpsubsb(ymmA, ymmB, ymmC);
- cc.vpsubsw(ymmA, ymmB, ymmC);
- cc.vpsubusb(ymmA, ymmB, ymmC);
- cc.vpsubusw(ymmA, ymmB, ymmC);
- cc.vpsubw(ymmA, ymmB, ymmC);
- cc.vpunpckhbw(ymmA, ymmB, ymmC);
- cc.vpunpckhdq(ymmA, ymmB, ymmC);
- cc.vpunpckhqdq(ymmA, ymmB, ymmC);
- cc.vpunpckhwd(ymmA, ymmB, ymmC);
- cc.vpunpcklbw(ymmA, ymmB, ymmC);
- cc.vpunpckldq(ymmA, ymmB, ymmC);
- cc.vpunpcklqdq(ymmA, ymmB, ymmC);
- cc.vpunpcklwd(ymmA, ymmB, ymmC);
- cc.vpxor(ymmA, ymmB, ymmC);
-
- // FMA.
- cc.vfmadd132pd(xmmA, xmmB, xmmC);
- cc.vfmadd132pd(ymmA, ymmB, ymmC);
- cc.vfmadd132ps(xmmA, xmmB, xmmC);
- cc.vfmadd132ps(ymmA, ymmB, ymmC);
- cc.vfmadd132sd(xmmA, xmmB, xmmC);
- cc.vfmadd132ss(xmmA, xmmB, xmmC);
- cc.vfmadd213pd(xmmA, xmmB, xmmC);
- cc.vfmadd213pd(ymmA, ymmB, ymmC);
- cc.vfmadd213ps(xmmA, xmmB, xmmC);
- cc.vfmadd213ps(ymmA, ymmB, ymmC);
- cc.vfmadd213sd(xmmA, xmmB, xmmC);
- cc.vfmadd213ss(xmmA, xmmB, xmmC);
- cc.vfmadd231pd(xmmA, xmmB, xmmC);
- cc.vfmadd231pd(ymmA, ymmB, ymmC);
- cc.vfmadd231ps(xmmA, xmmB, xmmC);
- cc.vfmadd231ps(ymmA, ymmB, ymmC);
- cc.vfmadd231sd(xmmA, xmmB, xmmC);
- cc.vfmadd231ss(xmmA, xmmB, xmmC);
- cc.vfmaddsub132pd(xmmA, xmmB, xmmC);
- cc.vfmaddsub132pd(ymmA, ymmB, ymmC);
- cc.vfmaddsub132ps(xmmA, xmmB, xmmC);
- cc.vfmaddsub132ps(ymmA, ymmB, ymmC);
- cc.vfmaddsub213pd(xmmA, xmmB, xmmC);
- cc.vfmaddsub213pd(ymmA, ymmB, ymmC);
- cc.vfmaddsub213ps(xmmA, xmmB, xmmC);
- cc.vfmaddsub213ps(ymmA, ymmB, ymmC);
- cc.vfmaddsub231pd(xmmA, xmmB, xmmC);
- cc.vfmaddsub231pd(ymmA, ymmB, ymmC);
- cc.vfmaddsub231ps(xmmA, xmmB, xmmC);
- cc.vfmaddsub231ps(ymmA, ymmB, ymmC);
- cc.vfmsub132pd(xmmA, xmmB, xmmC);
- cc.vfmsub132pd(ymmA, ymmB, ymmC);
- cc.vfmsub132ps(xmmA, xmmB, xmmC);
- cc.vfmsub132ps(ymmA, ymmB, ymmC);
- cc.vfmsub132sd(xmmA, xmmB, xmmC);
- cc.vfmsub132ss(xmmA, xmmB, xmmC);
- cc.vfmsub213pd(xmmA, xmmB, xmmC);
- cc.vfmsub213pd(ymmA, ymmB, ymmC);
- cc.vfmsub213ps(xmmA, xmmB, xmmC);
- cc.vfmsub213ps(ymmA, ymmB, ymmC);
- cc.vfmsub213sd(xmmA, xmmB, xmmC);
- cc.vfmsub213ss(xmmA, xmmB, xmmC);
- cc.vfmsub231pd(xmmA, xmmB, xmmC);
- cc.vfmsub231pd(ymmA, ymmB, ymmC);
- cc.vfmsub231ps(xmmA, xmmB, xmmC);
- cc.vfmsub231ps(ymmA, ymmB, ymmC);
- cc.vfmsub231sd(xmmA, xmmB, xmmC);
- cc.vfmsub231ss(xmmA, xmmB, xmmC);
- cc.vfmsubadd132pd(xmmA, xmmB, xmmC);
- cc.vfmsubadd132pd(ymmA, ymmB, ymmC);
- cc.vfmsubadd132ps(xmmA, xmmB, xmmC);
- cc.vfmsubadd132ps(ymmA, ymmB, ymmC);
- cc.vfmsubadd213pd(xmmA, xmmB, xmmC);
- cc.vfmsubadd213pd(ymmA, ymmB, ymmC);
- cc.vfmsubadd213ps(xmmA, xmmB, xmmC);
- cc.vfmsubadd213ps(ymmA, ymmB, ymmC);
- cc.vfmsubadd231pd(xmmA, xmmB, xmmC);
- cc.vfmsubadd231pd(ymmA, ymmB, ymmC);
- cc.vfmsubadd231ps(xmmA, xmmB, xmmC);
- cc.vfmsubadd231ps(ymmA, ymmB, ymmC);
- cc.vfnmadd132pd(xmmA, xmmB, xmmC);
- cc.vfnmadd132pd(ymmA, ymmB, ymmC);
- cc.vfnmadd132ps(xmmA, xmmB, xmmC);
- cc.vfnmadd132ps(ymmA, ymmB, ymmC);
- cc.vfnmadd132sd(xmmA, xmmB, xmmC);
- cc.vfnmadd132ss(xmmA, xmmB, xmmC);
- cc.vfnmadd213pd(xmmA, xmmB, xmmC);
- cc.vfnmadd213pd(ymmA, ymmB, ymmC);
- cc.vfnmadd213ps(xmmA, xmmB, xmmC);
- cc.vfnmadd213ps(ymmA, ymmB, ymmC);
- cc.vfnmadd213sd(xmmA, xmmB, xmmC);
- cc.vfnmadd213ss(xmmA, xmmB, xmmC);
- cc.vfnmadd231pd(xmmA, xmmB, xmmC);
- cc.vfnmadd231pd(ymmA, ymmB, ymmC);
- cc.vfnmadd231ps(xmmA, xmmB, xmmC);
- cc.vfnmadd231ps(ymmA, ymmB, ymmC);
- cc.vfnmadd231sd(xmmA, xmmB, xmmC);
- cc.vfnmadd231ss(xmmA, xmmB, xmmC);
- cc.vfnmsub132pd(xmmA, xmmB, xmmC);
- cc.vfnmsub132pd(ymmA, ymmB, ymmC);
- cc.vfnmsub132ps(xmmA, xmmB, xmmC);
- cc.vfnmsub132ps(ymmA, ymmB, ymmC);
- cc.vfnmsub132sd(xmmA, xmmB, xmmC);
- cc.vfnmsub132ss(xmmA, xmmB, xmmC);
- cc.vfnmsub213pd(xmmA, xmmB, xmmC);
- cc.vfnmsub213pd(ymmA, ymmB, ymmC);
- cc.vfnmsub213ps(xmmA, xmmB, xmmC);
- cc.vfnmsub213ps(ymmA, ymmB, ymmC);
- cc.vfnmsub213sd(xmmA, xmmB, xmmC);
- cc.vfnmsub213ss(xmmA, xmmB, xmmC);
- cc.vfnmsub231pd(xmmA, xmmB, xmmC);
- cc.vfnmsub231pd(ymmA, ymmB, ymmC);
- cc.vfnmsub231ps(xmmA, xmmB, xmmC);
- cc.vfnmsub231ps(ymmA, ymmB, ymmC);
- cc.vfnmsub231sd(xmmA, xmmB, xmmC);
- cc.vfnmsub231ss(xmmA, xmmB, xmmC);
- }
- else {
- x86::Mem m = x86::ptr(gpz);
- x86::Mem m128 = x86::xmmword_ptr(gpz);
- x86::Mem m256 = x86::xmmword_ptr(gpz);
- x86::Mem vx_ptr = x86::ptr(gpz, xmmD);
- x86::Mem vy_ptr = x86::ptr(gpz, ymmD);
-
- cc.vaddpd(xmmA, xmmB, m);
- cc.vaddpd(ymmA, ymmB, m);
- cc.vaddps(xmmA, xmmB, m);
- cc.vaddps(ymmA, ymmB, m);
- cc.vaddsd(xmmA, xmmB, m);
- cc.vaddss(xmmA, xmmB, m);
- cc.vaddsubpd(xmmA, xmmB, m);
- cc.vaddsubpd(ymmA, ymmB, m);
- cc.vaddsubps(xmmA, xmmB, m);
- cc.vaddsubps(ymmA, ymmB, m);
- cc.vandpd(xmmA, xmmB, m);
- cc.vandpd(ymmA, ymmB, m);
- cc.vandps(xmmA, xmmB, m);
- cc.vandps(ymmA, ymmB, m);
- cc.vandnpd(xmmA, xmmB, m);
- cc.vandnpd(ymmA, ymmB, m);
- cc.vandnps(xmmA, xmmB, m);
- cc.vandnps(ymmA, ymmB, m);
- cc.vblendpd(xmmA, xmmB, m, 0);
- cc.vblendpd(ymmA, ymmB, m, 0);
- cc.vblendps(xmmA, xmmB, m, 0);
- cc.vblendps(ymmA, ymmB, m, 0);
- cc.vblendvpd(xmmA, xmmB, m, xmmA);
- cc.vblendvpd(ymmA, ymmB, m, ymmA);
- cc.vbroadcastf128(ymmA, m);
- cc.vbroadcastsd(ymmA, m);
- cc.vbroadcastss(xmmA, m);
- cc.vbroadcastss(ymmA, m);
- cc.vcmppd(xmmA, xmmB, m, 0);
- cc.vcmppd(ymmA, ymmB, m, 0);
- cc.vcmpps(xmmA, xmmB, m, 0);
- cc.vcmpps(ymmA, ymmB, m, 0);
- cc.vcmpsd(xmmA, xmmB, m, 0);
- cc.vcmpss(xmmA, xmmB, m, 0);
- cc.vcomisd(xmmA, m);
- cc.vcomiss(xmmA, m);
- cc.vcvtdq2pd(xmmA, m);
- cc.vcvtdq2pd(ymmA, m);
- cc.vcvtdq2ps(xmmA, m);
- cc.vcvtdq2ps(ymmA, m);
- cc.vcvtpd2dq(xmmA, m128);
- cc.vcvtpd2dq(xmmA, m256);
- cc.vcvtpd2ps(xmmA, m128);
- cc.vcvtpd2ps(xmmA, m256);
- cc.vcvtps2dq(xmmA, m);
- cc.vcvtps2dq(ymmA, m);
- cc.vcvtps2pd(xmmA, m);
- cc.vcvtps2pd(ymmA, m);
- cc.vcvtsd2si(gpd, m);
- cc.vcvtsd2ss(xmmA, xmmB, m);
- cc.vcvtsi2sd(xmmA, xmmB, m);
- cc.vcvtsi2ss(xmmA, xmmB, m);
- cc.vcvtss2sd(xmmA, xmmB, m);
- cc.vcvtss2si(gpd, m);
- cc.vcvttpd2dq(xmmA, m128);
- cc.vcvttpd2dq(xmmA, m256);
- cc.vcvttps2dq(xmmA, m);
- cc.vcvttps2dq(ymmA, m);
- cc.vcvttsd2si(gpd, m);
- cc.vcvttss2si(gpd, m);
- cc.vdivpd(xmmA, xmmB, m);
- cc.vdivpd(ymmA, ymmB, m);
- cc.vdivps(xmmA, xmmB, m);
- cc.vdivps(ymmA, ymmB, m);
- cc.vdivsd(xmmA, xmmB, m);
- cc.vdivss(xmmA, xmmB, m);
- cc.vdppd(xmmA, xmmB, m, 0);
- cc.vdpps(xmmA, xmmB, m, 0);
- cc.vdpps(ymmA, ymmB, m, 0);
- cc.vextractf128(m, ymmB, 0);
- cc.vextractps(m, xmmB, 0);
- cc.vhaddpd(xmmA, xmmB, m);
- cc.vhaddpd(ymmA, ymmB, m);
- cc.vhaddps(xmmA, xmmB, m);
- cc.vhaddps(ymmA, ymmB, m);
- cc.vhsubpd(xmmA, xmmB, m);
- cc.vhsubpd(ymmA, ymmB, m);
- cc.vhsubps(xmmA, xmmB, m);
- cc.vhsubps(ymmA, ymmB, m);
- cc.vinsertf128(ymmA, ymmB, m, 0);
- cc.vinsertps(xmmA, xmmB, m, 0);
- cc.vlddqu(xmmA, m);
- cc.vlddqu(ymmA, m);
- cc.vmaskmovps(xmmA, xmmB, m);
- cc.vmaskmovps(ymmA, ymmB, m);
- cc.vmaskmovps(m, xmmB, xmmC);
- cc.vmaskmovps(m, ymmB, ymmC);
- cc.vmaskmovpd(xmmA, xmmB, m);
- cc.vmaskmovpd(ymmA, ymmB, m);
- cc.vmaskmovpd(m, xmmB, xmmC);
- cc.vmaskmovpd(m, ymmB, ymmC);
- cc.vmaxpd(xmmA, xmmB, m);
- cc.vmaxpd(ymmA, ymmB, m);
- cc.vmaxps(xmmA, xmmB, m);
- cc.vmaxps(ymmA, ymmB, m);
- cc.vmaxsd(xmmA, xmmB, m);
- cc.vmaxss(xmmA, xmmB, m);
- cc.vminpd(xmmA, xmmB, m);
- cc.vminpd(ymmA, ymmB, m);
- cc.vminps(xmmA, xmmB, m);
- cc.vminps(ymmA, ymmB, m);
- cc.vminsd(xmmA, xmmB, m);
- cc.vminss(xmmA, xmmB, m);
- cc.vmovapd(xmmA, m);
- cc.vmovapd(m, xmmB);
- cc.vmovapd(ymmA, m);
- cc.vmovapd(m, ymmB);
- cc.vmovaps(xmmA, m);
- cc.vmovaps(m, xmmB);
- cc.vmovaps(ymmA, m);
- cc.vmovaps(m, ymmB);
- cc.vmovd(xmmA, m);
- cc.vmovd(m, xmmB);
- cc.vmovddup(xmmA, m);
- cc.vmovddup(ymmA, m);
- cc.vmovdqa(xmmA, m);
- cc.vmovdqa(m, xmmB);
- cc.vmovdqa(ymmA, m);
- cc.vmovdqa(m, ymmB);
- cc.vmovdqu(xmmA, m);
- cc.vmovdqu(m, xmmB);
- cc.vmovdqu(ymmA, m);
- cc.vmovdqu(m, ymmB);
- cc.vmovhpd(xmmA, xmmB, m);
- cc.vmovhps(xmmA, xmmB, m);
- cc.vmovhps(m, xmmB);
- cc.vmovlpd(xmmA, xmmB, m);
- cc.vmovlpd(m, xmmB);
- cc.vmovlps(xmmA, xmmB, m);
- cc.vmovlps(m, xmmB);
- cc.vmovntdq(m, xmmB);
- cc.vmovntdq(m, ymmB);
- cc.vmovntdqa(xmmA, m);
- cc.vmovntpd(m, xmmB);
- cc.vmovntpd(m, ymmB);
- cc.vmovntps(m, xmmB);
- cc.vmovntps(m, ymmB);
- cc.vmovsd(xmmA, m);
- cc.vmovsd(m, xmmB);
- cc.vmovshdup(xmmA, m);
- cc.vmovshdup(ymmA, m);
- cc.vmovsldup(xmmA, m);
- cc.vmovsldup(ymmA, m);
- cc.vmovss(xmmA, m);
- cc.vmovss(m, xmmB);
- cc.vmovupd(xmmA, m);
- cc.vmovupd(m, xmmB);
- cc.vmovupd(ymmA, m);
- cc.vmovupd(m, ymmB);
- cc.vmovups(xmmA, m);
- cc.vmovups(m, xmmB);
- cc.vmovups(ymmA, m);
- cc.vmovups(m, ymmB);
- cc.vmpsadbw(xmmA, xmmB, m, 0);
- cc.vmulpd(xmmA, xmmB, m);
- cc.vmulpd(ymmA, ymmB, m);
- cc.vmulps(xmmA, xmmB, m);
- cc.vmulps(ymmA, ymmB, m);
- cc.vmulsd(xmmA, xmmB, m);
- cc.vmulss(xmmA, xmmB, m);
- cc.vorpd(xmmA, xmmB, m);
- cc.vorpd(ymmA, ymmB, m);
- cc.vorps(xmmA, xmmB, m);
- cc.vorps(ymmA, ymmB, m);
- cc.vpabsb(xmmA, m);
- cc.vpabsd(xmmA, m);
- cc.vpabsw(xmmA, m);
- cc.vpackssdw(xmmA, xmmB, m);
- cc.vpacksswb(xmmA, xmmB, m);
- cc.vpackusdw(xmmA, xmmB, m);
- cc.vpackuswb(xmmA, xmmB, m);
- cc.vpaddb(xmmA, xmmB, m);
- cc.vpaddd(xmmA, xmmB, m);
- cc.vpaddq(xmmA, xmmB, m);
- cc.vpaddw(xmmA, xmmB, m);
- cc.vpaddsb(xmmA, xmmB, m);
- cc.vpaddsw(xmmA, xmmB, m);
- cc.vpaddusb(xmmA, xmmB, m);
- cc.vpaddusw(xmmA, xmmB, m);
- cc.vpalignr(xmmA, xmmB, m, 0);
- cc.vpand(xmmA, xmmB, m);
- cc.vpandn(xmmA, xmmB, m);
- cc.vpavgb(xmmA, xmmB, m);
- cc.vpavgw(xmmA, xmmB, m);
- cc.vpblendvb(xmmA, xmmB, m, xmmA);
- cc.vpblendw(xmmA, xmmB, m, 0);
- cc.vpcmpeqb(xmmA, xmmB, m);
- cc.vpcmpeqd(xmmA, xmmB, m);
- cc.vpcmpeqq(xmmA, xmmB, m);
- cc.vpcmpeqw(xmmA, xmmB, m);
- cc.vpcmpgtb(xmmA, xmmB, m);
- cc.vpcmpgtd(xmmA, xmmB, m);
- cc.vpcmpgtq(xmmA, xmmB, m);
- cc.vpcmpgtw(xmmA, xmmB, m);
- cc.vpermilpd(xmmA, xmmB, m);
- cc.vpermilpd(ymmA, ymmB, m);
- cc.vpermilpd(xmmA, m, 0);
- cc.vpermilpd(ymmA, m, 0);
- cc.vpermilps(xmmA, xmmB, m);
- cc.vpermilps(ymmA, ymmB, m);
- cc.vpermilps(xmmA, m, 0);
- cc.vpermilps(ymmA, m, 0);
- cc.vperm2f128(ymmA, ymmB, m, 0);
- cc.vpextrb(m, xmmB, 0);
- cc.vpextrd(m, xmmB, 0);
- if (cc.is64Bit()) cc.vpextrq(m, xmmB, 0);
- cc.vpextrw(m, xmmB, 0);
- cc.vphaddd(xmmA, xmmB, m);
- cc.vphaddsw(xmmA, xmmB, m);
- cc.vphaddw(xmmA, xmmB, m);
- cc.vphminposuw(xmmA, m);
- cc.vphsubd(xmmA, xmmB, m);
- cc.vphsubsw(xmmA, xmmB, m);
- cc.vphsubw(xmmA, xmmB, m);
- cc.vpinsrb(xmmA, xmmB, m, 0);
- cc.vpinsrd(xmmA, xmmB, m, 0);
- cc.vpinsrw(xmmA, xmmB, m, 0);
- cc.vpmaddubsw(xmmA, xmmB, m);
- cc.vpmaddwd(xmmA, xmmB, m);
- cc.vpmaxsb(xmmA, xmmB, m);
- cc.vpmaxsd(xmmA, xmmB, m);
- cc.vpmaxsw(xmmA, xmmB, m);
- cc.vpmaxub(xmmA, xmmB, m);
- cc.vpmaxud(xmmA, xmmB, m);
- cc.vpmaxuw(xmmA, xmmB, m);
- cc.vpminsb(xmmA, xmmB, m);
- cc.vpminsd(xmmA, xmmB, m);
- cc.vpminsw(xmmA, xmmB, m);
- cc.vpminub(xmmA, xmmB, m);
- cc.vpminud(xmmA, xmmB, m);
- cc.vpminuw(xmmA, xmmB, m);
- cc.vpmovsxbd(xmmA, m);
- cc.vpmovsxbq(xmmA, m);
- cc.vpmovsxbw(xmmA, m);
- cc.vpmovsxdq(xmmA, m);
- cc.vpmovsxwd(xmmA, m);
- cc.vpmovsxwq(xmmA, m);
- cc.vpmovzxbd(xmmA, m);
- cc.vpmovzxbq(xmmA, m);
- cc.vpmovzxbw(xmmA, m);
- cc.vpmovzxdq(xmmA, m);
- cc.vpmovzxwd(xmmA, m);
- cc.vpmovzxwq(xmmA, m);
- cc.vpmuldq(xmmA, xmmB, m);
- cc.vpmulhrsw(xmmA, xmmB, m);
- cc.vpmulhuw(xmmA, xmmB, m);
- cc.vpmulhw(xmmA, xmmB, m);
- cc.vpmulld(xmmA, xmmB, m);
- cc.vpmullw(xmmA, xmmB, m);
- cc.vpmuludq(xmmA, xmmB, m);
- cc.vpor(xmmA, xmmB, m);
- cc.vpsadbw(xmmA, xmmB, m);
- cc.vpshufb(xmmA, xmmB, m);
- cc.vpshufd(xmmA, m, 0);
- cc.vpshufhw(xmmA, m, 0);
- cc.vpshuflw(xmmA, m, 0);
- cc.vpsignb(xmmA, xmmB, m);
- cc.vpsignd(xmmA, xmmB, m);
- cc.vpsignw(xmmA, xmmB, m);
- cc.vpslld(xmmA, xmmB, m);
- cc.vpsllq(xmmA, xmmB, m);
- cc.vpsllw(xmmA, xmmB, m);
- cc.vpsrad(xmmA, xmmB, m);
- cc.vpsraw(xmmA, xmmB, m);
- cc.vpsrld(xmmA, xmmB, m);
- cc.vpsrlq(xmmA, xmmB, m);
- cc.vpsrlw(xmmA, xmmB, m);
- cc.vpsubb(xmmA, xmmB, m);
- cc.vpsubd(xmmA, xmmB, m);
- cc.vpsubq(xmmA, xmmB, m);
- cc.vpsubw(xmmA, xmmB, m);
- cc.vpsubsb(xmmA, xmmB, m);
- cc.vpsubsw(xmmA, xmmB, m);
- cc.vpsubusb(xmmA, xmmB, m);
- cc.vpsubusw(xmmA, xmmB, m);
- cc.vptest(xmmA, m);
- cc.vptest(ymmA, m);
- cc.vpunpckhbw(xmmA, xmmB, m);
- cc.vpunpckhdq(xmmA, xmmB, m);
- cc.vpunpckhqdq(xmmA, xmmB, m);
- cc.vpunpckhwd(xmmA, xmmB, m);
- cc.vpunpcklbw(xmmA, xmmB, m);
- cc.vpunpckldq(xmmA, xmmB, m);
- cc.vpunpcklqdq(xmmA, xmmB, m);
- cc.vpunpcklwd(xmmA, xmmB, m);
- cc.vpxor(xmmA, xmmB, m);
- cc.vrcpps(xmmA, m);
- cc.vrcpps(ymmA, m);
- cc.vrcpss(xmmA, xmmB, m);
- cc.vrsqrtps(xmmA, m);
- cc.vrsqrtps(ymmA, m);
- cc.vrsqrtss(xmmA, xmmB, m);
- cc.vroundpd(xmmA, m, 0);
- cc.vroundpd(ymmA, m, 0);
- cc.vroundps(xmmA, m, 0);
- cc.vroundps(ymmA, m, 0);
- cc.vroundsd(xmmA, xmmB, m, 0);
- cc.vroundss(xmmA, xmmB, m, 0);
- cc.vshufpd(xmmA, xmmB, m, 0);
- cc.vshufpd(ymmA, ymmB, m, 0);
- cc.vshufps(xmmA, xmmB, m, 0);
- cc.vshufps(ymmA, ymmB, m, 0);
- cc.vsqrtpd(xmmA, m);
- cc.vsqrtpd(ymmA, m);
- cc.vsqrtps(xmmA, m);
- cc.vsqrtps(ymmA, m);
- cc.vsqrtsd(xmmA, xmmB, m);
- cc.vsqrtss(xmmA, xmmB, m);
- cc.vsubpd(xmmA, xmmB, m);
- cc.vsubpd(ymmA, ymmB, m);
- cc.vsubps(xmmA, xmmB, m);
- cc.vsubps(ymmA, ymmB, m);
- cc.vsubsd(xmmA, xmmB, m);
- cc.vsubss(xmmA, xmmB, m);
- cc.vtestps(xmmA, m);
- cc.vtestps(ymmA, m);
- cc.vtestpd(xmmA, m);
- cc.vtestpd(ymmA, m);
- cc.vucomisd(xmmA, m);
- cc.vucomiss(xmmA, m);
- cc.vunpckhpd(xmmA, xmmB, m);
- cc.vunpckhpd(ymmA, ymmB, m);
- cc.vunpckhps(xmmA, xmmB, m);
- cc.vunpckhps(ymmA, ymmB, m);
- cc.vunpcklpd(xmmA, xmmB, m);
- cc.vunpcklpd(ymmA, ymmB, m);
- cc.vunpcklps(xmmA, xmmB, m);
- cc.vunpcklps(ymmA, ymmB, m);
- cc.vxorpd(xmmA, xmmB, m);
- cc.vxorpd(ymmA, ymmB, m);
- cc.vxorps(xmmA, xmmB, m);
- cc.vxorps(ymmA, ymmB, m);
-
- // AVX+AESNI.
- cc.vaesdec(xmmA, xmmB, m);
- cc.vaesdeclast(xmmA, xmmB, m);
- cc.vaesenc(xmmA, xmmB, m);
- cc.vaesenclast(xmmA, xmmB, m);
- cc.vaesimc(xmmA, m);
- cc.vaeskeygenassist(xmmA, m, 0);
-
- // AVX+PCLMULQDQ.
- cc.vpclmulqdq(xmmA, xmmB, m, 0);
-
- // AVX2.
- cc.vbroadcasti128(ymmA, m);
- cc.vextracti128(m, ymmB, 0);
- cc.vgatherdpd(xmmA, vx_ptr, xmmC);
- cc.vgatherdpd(ymmA, vx_ptr, ymmC);
- cc.vgatherdps(xmmA, vx_ptr, xmmC);
- cc.vgatherdps(ymmA, vy_ptr, ymmC);
- cc.vgatherqpd(xmmA, vx_ptr, xmmC);
- cc.vgatherqpd(ymmA, vy_ptr, ymmC);
- cc.vgatherqps(xmmA, vx_ptr, xmmC);
- cc.vgatherqps(xmmA, vy_ptr, xmmC);
- cc.vinserti128(ymmA, ymmB, m, 0);
- cc.vmovntdqa(ymmA, m);
- cc.vmpsadbw(ymmA, ymmB, m, 0);
- cc.vpabsb(ymmA, m);
- cc.vpabsd(ymmA, m);
- cc.vpabsw(ymmA, m);
- cc.vpackssdw(ymmA, ymmB, m);
- cc.vpacksswb(ymmA, ymmB, m);
- cc.vpackusdw(ymmA, ymmB, m);
- cc.vpackuswb(ymmA, ymmB, m);
- cc.vpaddb(ymmA, ymmB, m);
- cc.vpaddd(ymmA, ymmB, m);
- cc.vpaddq(ymmA, ymmB, m);
- cc.vpaddw(ymmA, ymmB, m);
- cc.vpaddsb(ymmA, ymmB, m);
- cc.vpaddsw(ymmA, ymmB, m);
- cc.vpaddusb(ymmA, ymmB, m);
- cc.vpaddusw(ymmA, ymmB, m);
- cc.vpalignr(ymmA, ymmB, m, 0);
- cc.vpand(ymmA, ymmB, m);
- cc.vpandn(ymmA, ymmB, m);
- cc.vpavgb(ymmA, ymmB, m);
- cc.vpavgw(ymmA, ymmB, m);
- cc.vpblendd(xmmA, xmmB, m, 0);
- cc.vpblendd(ymmA, ymmB, m, 0);
- cc.vpblendvb(ymmA, ymmB, m, ymmA);
- cc.vpblendw(ymmA, ymmB, m, 0);
- cc.vpbroadcastb(xmmA, m);
- cc.vpbroadcastb(ymmA, m);
- cc.vpbroadcastd(xmmA, m);
- cc.vpbroadcastd(ymmA, m);
- cc.vpbroadcastq(xmmA, m);
- cc.vpbroadcastq(ymmA, m);
- cc.vpbroadcastw(xmmA, m);
- cc.vpbroadcastw(ymmA, m);
- cc.vpcmpeqb(ymmA, ymmB, m);
- cc.vpcmpeqd(ymmA, ymmB, m);
- cc.vpcmpeqq(ymmA, ymmB, m);
- cc.vpcmpeqw(ymmA, ymmB, m);
- cc.vpcmpgtb(ymmA, ymmB, m);
- cc.vpcmpgtd(ymmA, ymmB, m);
- cc.vpcmpgtq(ymmA, ymmB, m);
- cc.vpcmpgtw(ymmA, ymmB, m);
- cc.vperm2i128(ymmA, ymmB, m, 0);
- cc.vpermd(ymmA, ymmB, m);
- cc.vpermps(ymmA, ymmB, m);
- cc.vpermpd(ymmA, m, 0);
- cc.vpermq(ymmA, m, 0);
- cc.vpgatherdd(xmmA, vx_ptr, xmmC);
- cc.vpgatherdd(ymmA, vy_ptr, ymmC);
- cc.vpgatherdq(xmmA, vx_ptr, xmmC);
- cc.vpgatherdq(ymmA, vx_ptr, ymmC);
- cc.vpgatherqd(xmmA, vx_ptr, xmmC);
- cc.vpgatherqd(xmmA, vy_ptr, xmmC);
- cc.vpgatherqq(xmmA, vx_ptr, xmmC);
- cc.vpgatherqq(ymmA, vy_ptr, ymmC);
- cc.vpmovsxbd(ymmA, m);
- cc.vpmovsxbq(ymmA, m);
- cc.vpmovsxbw(ymmA, m);
- cc.vpmovsxdq(ymmA, m);
- cc.vpmovsxwd(ymmA, m);
- cc.vpmovsxwq(ymmA, m);
- cc.vpmovzxbd(ymmA, m);
- cc.vpmovzxbq(ymmA, m);
- cc.vpmovzxbw(ymmA, m);
- cc.vpmovzxdq(ymmA, m);
- cc.vpmovzxwd(ymmA, m);
- cc.vpmovzxwq(ymmA, m);
- cc.vpshufd(ymmA, m, 0);
- cc.vpshufhw(ymmA, m, 0);
- cc.vpshuflw(ymmA, m, 0);
- cc.vphaddd(ymmA, ymmB, m);
- cc.vphaddsw(ymmA, ymmB, m);
- cc.vphaddw(ymmA, ymmB, m);
- cc.vphsubd(ymmA, ymmB, m);
- cc.vphsubsw(ymmA, ymmB, m);
- cc.vphsubw(ymmA, ymmB, m);
- cc.vpmaddubsw(ymmA, ymmB, m);
- cc.vpmaddwd(ymmA, ymmB, m);
- cc.vpmaskmovd(m, xmmB, xmmC);
- cc.vpmaskmovd(m, ymmB, ymmC);
- cc.vpmaskmovd(xmmA, xmmB, m);
- cc.vpmaskmovd(ymmA, ymmB, m);
- cc.vpmaskmovq(m, xmmB, xmmC);
- cc.vpmaskmovq(m, ymmB, ymmC);
- cc.vpmaskmovq(xmmA, xmmB, m);
- cc.vpmaskmovq(ymmA, ymmB, m);
- cc.vpmaxsb(ymmA, ymmB, m);
- cc.vpmaxsd(ymmA, ymmB, m);
- cc.vpmaxsw(ymmA, ymmB, m);
- cc.vpmaxub(ymmA, ymmB, m);
- cc.vpmaxud(ymmA, ymmB, m);
- cc.vpmaxuw(ymmA, ymmB, m);
- cc.vpminsb(ymmA, ymmB, m);
- cc.vpminsd(ymmA, ymmB, m);
- cc.vpminsw(ymmA, ymmB, m);
- cc.vpminub(ymmA, ymmB, m);
- cc.vpminud(ymmA, ymmB, m);
- cc.vpminuw(ymmA, ymmB, m);
- cc.vpmuldq(ymmA, ymmB, m);
- cc.vpmulhrsw(ymmA, ymmB, m);
- cc.vpmulhuw(ymmA, ymmB, m);
- cc.vpmulhw(ymmA, ymmB, m);
- cc.vpmulld(ymmA, ymmB, m);
- cc.vpmullw(ymmA, ymmB, m);
- cc.vpmuludq(ymmA, ymmB, m);
- cc.vpor(ymmA, ymmB, m);
- cc.vpsadbw(ymmA, ymmB, m);
- cc.vpshufb(ymmA, ymmB, m);
- cc.vpsignb(ymmA, ymmB, m);
- cc.vpsignd(ymmA, ymmB, m);
- cc.vpsignw(ymmA, ymmB, m);
- cc.vpslld(ymmA, ymmB, m);
- cc.vpsllq(ymmA, ymmB, m);
- cc.vpsllvd(xmmA, xmmB, m);
- cc.vpsllvd(ymmA, ymmB, m);
- cc.vpsllvq(xmmA, xmmB, m);
- cc.vpsllvq(ymmA, ymmB, m);
- cc.vpsllw(ymmA, ymmB, m);
- cc.vpsrad(ymmA, ymmB, m);
- cc.vpsravd(xmmA, xmmB, m);
- cc.vpsravd(ymmA, ymmB, m);
- cc.vpsraw(ymmA, ymmB, m);
- cc.vpsrld(ymmA, ymmB, m);
- cc.vpsrlq(ymmA, ymmB, m);
- cc.vpsrlvd(xmmA, xmmB, m);
- cc.vpsrlvd(ymmA, ymmB, m);
- cc.vpsrlvq(xmmA, xmmB, m);
- cc.vpsrlvq(ymmA, ymmB, m);
- cc.vpsrlw(ymmA, ymmB, m);
- cc.vpsubb(ymmA, ymmB, m);
- cc.vpsubd(ymmA, ymmB, m);
- cc.vpsubq(ymmA, ymmB, m);
- cc.vpsubsb(ymmA, ymmB, m);
- cc.vpsubsw(ymmA, ymmB, m);
- cc.vpsubusb(ymmA, ymmB, m);
- cc.vpsubusw(ymmA, ymmB, m);
- cc.vpsubw(ymmA, ymmB, m);
- cc.vpunpckhbw(ymmA, ymmB, m);
- cc.vpunpckhdq(ymmA, ymmB, m);
- cc.vpunpckhqdq(ymmA, ymmB, m);
- cc.vpunpckhwd(ymmA, ymmB, m);
- cc.vpunpcklbw(ymmA, ymmB, m);
- cc.vpunpckldq(ymmA, ymmB, m);
- cc.vpunpcklqdq(ymmA, ymmB, m);
- cc.vpunpcklwd(ymmA, ymmB, m);
- cc.vpxor(ymmA, ymmB, m);
- }
+ cc.vaddpd(xmmA, xmmB, m);
+ cc.vaddpd(ymmA, ymmB, m);
+ cc.vaddps(xmmA, xmmB, m);
+ cc.vaddps(ymmA, ymmB, m);
+ cc.vaddsd(xmmA, xmmB, m);
+ cc.vaddss(xmmA, xmmB, m);
+ cc.vaddsubpd(xmmA, xmmB, m);
+ cc.vaddsubpd(ymmA, ymmB, m);
+ cc.vaddsubps(xmmA, xmmB, m);
+ cc.vaddsubps(ymmA, ymmB, m);
+ cc.vandpd(xmmA, xmmB, m);
+ cc.vandpd(ymmA, ymmB, m);
+ cc.vandps(xmmA, xmmB, m);
+ cc.vandps(ymmA, ymmB, m);
+ cc.vandnpd(xmmA, xmmB, m);
+ cc.vandnpd(ymmA, ymmB, m);
+ cc.vandnps(xmmA, xmmB, m);
+ cc.vandnps(ymmA, ymmB, m);
+ cc.vblendpd(xmmA, xmmB, m, 0);
+ cc.vblendpd(ymmA, ymmB, m, 0);
+ cc.vblendps(xmmA, xmmB, m, 0);
+ cc.vblendps(ymmA, ymmB, m, 0);
+ cc.vblendvpd(xmmA, xmmB, m, xmmA);
+ cc.vblendvpd(ymmA, ymmB, m, ymmA);
+ cc.vbroadcastf128(ymmA, m);
+ cc.vbroadcastsd(ymmA, m);
+ cc.vbroadcastss(xmmA, m);
+ cc.vbroadcastss(ymmA, m);
+ cc.vcmppd(xmmA, xmmB, m, 0);
+ cc.vcmppd(ymmA, ymmB, m, 0);
+ cc.vcmpps(xmmA, xmmB, m, 0);
+ cc.vcmpps(ymmA, ymmB, m, 0);
+ cc.vcmpsd(xmmA, xmmB, m, 0);
+ cc.vcmpss(xmmA, xmmB, m, 0);
+ cc.vcomisd(xmmA, m);
+ cc.vcomiss(xmmA, m);
+ cc.vcvtdq2pd(xmmA, m);
+ cc.vcvtdq2pd(ymmA, m);
+ cc.vcvtdq2ps(xmmA, m);
+ cc.vcvtdq2ps(ymmA, m);
+ cc.vcvtpd2dq(xmmA, m128);
+ cc.vcvtpd2dq(xmmA, m256);
+ cc.vcvtpd2ps(xmmA, m128);
+ cc.vcvtpd2ps(xmmA, m256);
+ cc.vcvtps2dq(xmmA, m);
+ cc.vcvtps2dq(ymmA, m);
+ cc.vcvtps2pd(xmmA, m);
+ cc.vcvtps2pd(ymmA, m);
+ cc.vcvtsd2si(gpd, m);
+ cc.vcvtsd2ss(xmmA, xmmB, m);
+ cc.vcvtsi2sd(xmmA, xmmB, m);
+ cc.vcvtsi2ss(xmmA, xmmB, m);
+ cc.vcvtss2sd(xmmA, xmmB, m);
+ cc.vcvtss2si(gpd, m);
+ cc.vcvttpd2dq(xmmA, m128);
+ cc.vcvttpd2dq(xmmA, m256);
+ cc.vcvttps2dq(xmmA, m);
+ cc.vcvttps2dq(ymmA, m);
+ cc.vcvttsd2si(gpd, m);
+ cc.vcvttss2si(gpd, m);
+ cc.vdivpd(xmmA, xmmB, m);
+ cc.vdivpd(ymmA, ymmB, m);
+ cc.vdivps(xmmA, xmmB, m);
+ cc.vdivps(ymmA, ymmB, m);
+ cc.vdivsd(xmmA, xmmB, m);
+ cc.vdivss(xmmA, xmmB, m);
+ cc.vdppd(xmmA, xmmB, m, 0);
+ cc.vdpps(xmmA, xmmB, m, 0);
+ cc.vdpps(ymmA, ymmB, m, 0);
+ cc.vextractf128(m, ymmB, 0);
+ cc.vextractps(m, xmmB, 0);
+ cc.vhaddpd(xmmA, xmmB, m);
+ cc.vhaddpd(ymmA, ymmB, m);
+ cc.vhaddps(xmmA, xmmB, m);
+ cc.vhaddps(ymmA, ymmB, m);
+ cc.vhsubpd(xmmA, xmmB, m);
+ cc.vhsubpd(ymmA, ymmB, m);
+ cc.vhsubps(xmmA, xmmB, m);
+ cc.vhsubps(ymmA, ymmB, m);
+ cc.vinsertf128(ymmA, ymmB, m, 0);
+ cc.vinsertps(xmmA, xmmB, m, 0);
+ cc.vlddqu(xmmA, m);
+ cc.vlddqu(ymmA, m);
+ cc.vmaskmovps(xmmA, xmmB, m);
+ cc.vmaskmovps(ymmA, ymmB, m);
+ cc.vmaskmovps(m, xmmB, xmmC);
+ cc.vmaskmovps(m, ymmB, ymmC);
+ cc.vmaskmovpd(xmmA, xmmB, m);
+ cc.vmaskmovpd(ymmA, ymmB, m);
+ cc.vmaskmovpd(m, xmmB, xmmC);
+ cc.vmaskmovpd(m, ymmB, ymmC);
+ cc.vmaxpd(xmmA, xmmB, m);
+ cc.vmaxpd(ymmA, ymmB, m);
+ cc.vmaxps(xmmA, xmmB, m);
+ cc.vmaxps(ymmA, ymmB, m);
+ cc.vmaxsd(xmmA, xmmB, m);
+ cc.vmaxss(xmmA, xmmB, m);
+ cc.vminpd(xmmA, xmmB, m);
+ cc.vminpd(ymmA, ymmB, m);
+ cc.vminps(xmmA, xmmB, m);
+ cc.vminps(ymmA, ymmB, m);
+ cc.vminsd(xmmA, xmmB, m);
+ cc.vminss(xmmA, xmmB, m);
+ cc.vmovapd(xmmA, m);
+ cc.vmovapd(m, xmmB);
+ cc.vmovapd(ymmA, m);
+ cc.vmovapd(m, ymmB);
+ cc.vmovaps(xmmA, m);
+ cc.vmovaps(m, xmmB);
+ cc.vmovaps(ymmA, m);
+ cc.vmovaps(m, ymmB);
+ cc.vmovd(xmmA, m);
+ cc.vmovd(m, xmmB);
+ cc.vmovddup(xmmA, m);
+ cc.vmovddup(ymmA, m);
+ cc.vmovdqa(xmmA, m);
+ cc.vmovdqa(m, xmmB);
+ cc.vmovdqa(ymmA, m);
+ cc.vmovdqa(m, ymmB);
+ cc.vmovdqu(xmmA, m);
+ cc.vmovdqu(m, xmmB);
+ cc.vmovdqu(ymmA, m);
+ cc.vmovdqu(m, ymmB);
+ cc.vmovhpd(xmmA, xmmB, m);
+ cc.vmovhps(xmmA, xmmB, m);
+ cc.vmovhps(m, xmmB);
+ cc.vmovlpd(xmmA, xmmB, m);
+ cc.vmovlpd(m, xmmB);
+ cc.vmovlps(xmmA, xmmB, m);
+ cc.vmovlps(m, xmmB);
+ cc.vmovntdq(m, xmmB);
+ cc.vmovntdq(m, ymmB);
+ cc.vmovntdqa(xmmA, m);
+ cc.vmovntpd(m, xmmB);
+ cc.vmovntpd(m, ymmB);
+ cc.vmovntps(m, xmmB);
+ cc.vmovntps(m, ymmB);
+ cc.vmovsd(xmmA, m);
+ cc.vmovsd(m, xmmB);
+ cc.vmovshdup(xmmA, m);
+ cc.vmovshdup(ymmA, m);
+ cc.vmovsldup(xmmA, m);
+ cc.vmovsldup(ymmA, m);
+ cc.vmovss(xmmA, m);
+ cc.vmovss(m, xmmB);
+ cc.vmovupd(xmmA, m);
+ cc.vmovupd(m, xmmB);
+ cc.vmovupd(ymmA, m);
+ cc.vmovupd(m, ymmB);
+ cc.vmovups(xmmA, m);
+ cc.vmovups(m, xmmB);
+ cc.vmovups(ymmA, m);
+ cc.vmovups(m, ymmB);
+ cc.vmpsadbw(xmmA, xmmB, m, 0);
+ cc.vmulpd(xmmA, xmmB, m);
+ cc.vmulpd(ymmA, ymmB, m);
+ cc.vmulps(xmmA, xmmB, m);
+ cc.vmulps(ymmA, ymmB, m);
+ cc.vmulsd(xmmA, xmmB, m);
+ cc.vmulss(xmmA, xmmB, m);
+ cc.vorpd(xmmA, xmmB, m);
+ cc.vorpd(ymmA, ymmB, m);
+ cc.vorps(xmmA, xmmB, m);
+ cc.vorps(ymmA, ymmB, m);
+ cc.vpabsb(xmmA, m);
+ cc.vpabsd(xmmA, m);
+ cc.vpabsw(xmmA, m);
+ cc.vpackssdw(xmmA, xmmB, m);
+ cc.vpacksswb(xmmA, xmmB, m);
+ cc.vpackusdw(xmmA, xmmB, m);
+ cc.vpackuswb(xmmA, xmmB, m);
+ cc.vpaddb(xmmA, xmmB, m);
+ cc.vpaddd(xmmA, xmmB, m);
+ cc.vpaddq(xmmA, xmmB, m);
+ cc.vpaddw(xmmA, xmmB, m);
+ cc.vpaddsb(xmmA, xmmB, m);
+ cc.vpaddsw(xmmA, xmmB, m);
+ cc.vpaddusb(xmmA, xmmB, m);
+ cc.vpaddusw(xmmA, xmmB, m);
+ cc.vpalignr(xmmA, xmmB, m, 0);
+ cc.vpand(xmmA, xmmB, m);
+ cc.vpandn(xmmA, xmmB, m);
+ cc.vpavgb(xmmA, xmmB, m);
+ cc.vpavgw(xmmA, xmmB, m);
+ cc.vpblendvb(xmmA, xmmB, m, xmmA);
+ cc.vpblendw(xmmA, xmmB, m, 0);
+ cc.vpcmpeqb(xmmA, xmmB, m);
+ cc.vpcmpeqd(xmmA, xmmB, m);
+ cc.vpcmpeqq(xmmA, xmmB, m);
+ cc.vpcmpeqw(xmmA, xmmB, m);
+ cc.vpcmpgtb(xmmA, xmmB, m);
+ cc.vpcmpgtd(xmmA, xmmB, m);
+ cc.vpcmpgtq(xmmA, xmmB, m);
+ cc.vpcmpgtw(xmmA, xmmB, m);
+ cc.vpermilpd(xmmA, xmmB, m);
+ cc.vpermilpd(ymmA, ymmB, m);
+ cc.vpermilpd(xmmA, m, 0);
+ cc.vpermilpd(ymmA, m, 0);
+ cc.vpermilps(xmmA, xmmB, m);
+ cc.vpermilps(ymmA, ymmB, m);
+ cc.vpermilps(xmmA, m, 0);
+ cc.vpermilps(ymmA, m, 0);
+ cc.vperm2f128(ymmA, ymmB, m, 0);
+ cc.vpextrb(m, xmmB, 0);
+ cc.vpextrd(m, xmmB, 0);
+ if (cc.is64Bit()) cc.vpextrq(m, xmmB, 0);
+ cc.vpextrw(m, xmmB, 0);
+ cc.vphaddd(xmmA, xmmB, m);
+ cc.vphaddsw(xmmA, xmmB, m);
+ cc.vphaddw(xmmA, xmmB, m);
+ cc.vphminposuw(xmmA, m);
+ cc.vphsubd(xmmA, xmmB, m);
+ cc.vphsubsw(xmmA, xmmB, m);
+ cc.vphsubw(xmmA, xmmB, m);
+ cc.vpinsrb(xmmA, xmmB, m, 0);
+ cc.vpinsrd(xmmA, xmmB, m, 0);
+ cc.vpinsrw(xmmA, xmmB, m, 0);
+ cc.vpmaddubsw(xmmA, xmmB, m);
+ cc.vpmaddwd(xmmA, xmmB, m);
+ cc.vpmaxsb(xmmA, xmmB, m);
+ cc.vpmaxsd(xmmA, xmmB, m);
+ cc.vpmaxsw(xmmA, xmmB, m);
+ cc.vpmaxub(xmmA, xmmB, m);
+ cc.vpmaxud(xmmA, xmmB, m);
+ cc.vpmaxuw(xmmA, xmmB, m);
+ cc.vpminsb(xmmA, xmmB, m);
+ cc.vpminsd(xmmA, xmmB, m);
+ cc.vpminsw(xmmA, xmmB, m);
+ cc.vpminub(xmmA, xmmB, m);
+ cc.vpminud(xmmA, xmmB, m);
+ cc.vpminuw(xmmA, xmmB, m);
+ cc.vpmovsxbd(xmmA, m);
+ cc.vpmovsxbq(xmmA, m);
+ cc.vpmovsxbw(xmmA, m);
+ cc.vpmovsxdq(xmmA, m);
+ cc.vpmovsxwd(xmmA, m);
+ cc.vpmovsxwq(xmmA, m);
+ cc.vpmovzxbd(xmmA, m);
+ cc.vpmovzxbq(xmmA, m);
+ cc.vpmovzxbw(xmmA, m);
+ cc.vpmovzxdq(xmmA, m);
+ cc.vpmovzxwd(xmmA, m);
+ cc.vpmovzxwq(xmmA, m);
+ cc.vpmuldq(xmmA, xmmB, m);
+ cc.vpmulhrsw(xmmA, xmmB, m);
+ cc.vpmulhuw(xmmA, xmmB, m);
+ cc.vpmulhw(xmmA, xmmB, m);
+ cc.vpmulld(xmmA, xmmB, m);
+ cc.vpmullw(xmmA, xmmB, m);
+ cc.vpmuludq(xmmA, xmmB, m);
+ cc.vpor(xmmA, xmmB, m);
+ cc.vpsadbw(xmmA, xmmB, m);
+ cc.vpshufb(xmmA, xmmB, m);
+ cc.vpshufd(xmmA, m, 0);
+ cc.vpshufhw(xmmA, m, 0);
+ cc.vpshuflw(xmmA, m, 0);
+ cc.vpsignb(xmmA, xmmB, m);
+ cc.vpsignd(xmmA, xmmB, m);
+ cc.vpsignw(xmmA, xmmB, m);
+ cc.vpslld(xmmA, xmmB, m);
+ cc.vpsllq(xmmA, xmmB, m);
+ cc.vpsllw(xmmA, xmmB, m);
+ cc.vpsrad(xmmA, xmmB, m);
+ cc.vpsraw(xmmA, xmmB, m);
+ cc.vpsrld(xmmA, xmmB, m);
+ cc.vpsrlq(xmmA, xmmB, m);
+ cc.vpsrlw(xmmA, xmmB, m);
+ cc.vpsubb(xmmA, xmmB, m);
+ cc.vpsubd(xmmA, xmmB, m);
+ cc.vpsubq(xmmA, xmmB, m);
+ cc.vpsubw(xmmA, xmmB, m);
+ cc.vpsubsb(xmmA, xmmB, m);
+ cc.vpsubsw(xmmA, xmmB, m);
+ cc.vpsubusb(xmmA, xmmB, m);
+ cc.vpsubusw(xmmA, xmmB, m);
+ cc.vptest(xmmA, m);
+ cc.vptest(ymmA, m);
+ cc.vpunpckhbw(xmmA, xmmB, m);
+ cc.vpunpckhdq(xmmA, xmmB, m);
+ cc.vpunpckhqdq(xmmA, xmmB, m);
+ cc.vpunpckhwd(xmmA, xmmB, m);
+ cc.vpunpcklbw(xmmA, xmmB, m);
+ cc.vpunpckldq(xmmA, xmmB, m);
+ cc.vpunpcklqdq(xmmA, xmmB, m);
+ cc.vpunpcklwd(xmmA, xmmB, m);
+ cc.vpxor(xmmA, xmmB, m);
+ cc.vrcpps(xmmA, m);
+ cc.vrcpps(ymmA, m);
+ cc.vrcpss(xmmA, xmmB, m);
+ cc.vrsqrtps(xmmA, m);
+ cc.vrsqrtps(ymmA, m);
+ cc.vrsqrtss(xmmA, xmmB, m);
+ cc.vroundpd(xmmA, m, 0);
+ cc.vroundpd(ymmA, m, 0);
+ cc.vroundps(xmmA, m, 0);
+ cc.vroundps(ymmA, m, 0);
+ cc.vroundsd(xmmA, xmmB, m, 0);
+ cc.vroundss(xmmA, xmmB, m, 0);
+ cc.vshufpd(xmmA, xmmB, m, 0);
+ cc.vshufpd(ymmA, ymmB, m, 0);
+ cc.vshufps(xmmA, xmmB, m, 0);
+ cc.vshufps(ymmA, ymmB, m, 0);
+ cc.vsqrtpd(xmmA, m);
+ cc.vsqrtpd(ymmA, m);
+ cc.vsqrtps(xmmA, m);
+ cc.vsqrtps(ymmA, m);
+ cc.vsqrtsd(xmmA, xmmB, m);
+ cc.vsqrtss(xmmA, xmmB, m);
+ cc.vsubpd(xmmA, xmmB, m);
+ cc.vsubpd(ymmA, ymmB, m);
+ cc.vsubps(xmmA, xmmB, m);
+ cc.vsubps(ymmA, ymmB, m);
+ cc.vsubsd(xmmA, xmmB, m);
+ cc.vsubss(xmmA, xmmB, m);
+ cc.vtestps(xmmA, m);
+ cc.vtestps(ymmA, m);
+ cc.vtestpd(xmmA, m);
+ cc.vtestpd(ymmA, m);
+ cc.vucomisd(xmmA, m);
+ cc.vucomiss(xmmA, m);
+ cc.vunpckhpd(xmmA, xmmB, m);
+ cc.vunpckhpd(ymmA, ymmB, m);
+ cc.vunpckhps(xmmA, xmmB, m);
+ cc.vunpckhps(ymmA, ymmB, m);
+ cc.vunpcklpd(xmmA, xmmB, m);
+ cc.vunpcklpd(ymmA, ymmB, m);
+ cc.vunpcklps(xmmA, xmmB, m);
+ cc.vunpcklps(ymmA, ymmB, m);
+ cc.vxorpd(xmmA, xmmB, m);
+ cc.vxorpd(ymmA, ymmB, m);
+ cc.vxorps(xmmA, xmmB, m);
+ cc.vxorps(ymmA, ymmB, m);
+
+ // AVX+AESNI.
+ cc.vaesdec(xmmA, xmmB, m);
+ cc.vaesdeclast(xmmA, xmmB, m);
+ cc.vaesenc(xmmA, xmmB, m);
+ cc.vaesenclast(xmmA, xmmB, m);
+ cc.vaesimc(xmmA, m);
+ cc.vaeskeygenassist(xmmA, m, 0);
+
+ // AVX+PCLMULQDQ.
+ cc.vpclmulqdq(xmmA, xmmB, m, 0);
+
+ // AVX2.
+ cc.vbroadcasti128(ymmA, m);
+ cc.vextracti128(m, ymmB, 0);
+ cc.vgatherdpd(xmmA, vx_ptr, xmmC);
+ cc.vgatherdpd(ymmA, vx_ptr, ymmC);
+ cc.vgatherdps(xmmA, vx_ptr, xmmC);
+ cc.vgatherdps(ymmA, vy_ptr, ymmC);
+ cc.vgatherqpd(xmmA, vx_ptr, xmmC);
+ cc.vgatherqpd(ymmA, vy_ptr, ymmC);
+ cc.vgatherqps(xmmA, vx_ptr, xmmC);
+ cc.vgatherqps(xmmA, vy_ptr, xmmC);
+ cc.vinserti128(ymmA, ymmB, m, 0);
+ cc.vmovntdqa(ymmA, m);
+ cc.vmpsadbw(ymmA, ymmB, m, 0);
+ cc.vpabsb(ymmA, m);
+ cc.vpabsd(ymmA, m);
+ cc.vpabsw(ymmA, m);
+ cc.vpackssdw(ymmA, ymmB, m);
+ cc.vpacksswb(ymmA, ymmB, m);
+ cc.vpackusdw(ymmA, ymmB, m);
+ cc.vpackuswb(ymmA, ymmB, m);
+ cc.vpaddb(ymmA, ymmB, m);
+ cc.vpaddd(ymmA, ymmB, m);
+ cc.vpaddq(ymmA, ymmB, m);
+ cc.vpaddw(ymmA, ymmB, m);
+ cc.vpaddsb(ymmA, ymmB, m);
+ cc.vpaddsw(ymmA, ymmB, m);
+ cc.vpaddusb(ymmA, ymmB, m);
+ cc.vpaddusw(ymmA, ymmB, m);
+ cc.vpalignr(ymmA, ymmB, m, 0);
+ cc.vpand(ymmA, ymmB, m);
+ cc.vpandn(ymmA, ymmB, m);
+ cc.vpavgb(ymmA, ymmB, m);
+ cc.vpavgw(ymmA, ymmB, m);
+ cc.vpblendd(xmmA, xmmB, m, 0);
+ cc.vpblendd(ymmA, ymmB, m, 0);
+ cc.vpblendvb(ymmA, ymmB, m, ymmA);
+ cc.vpblendw(ymmA, ymmB, m, 0);
+ cc.vpbroadcastb(xmmA, m);
+ cc.vpbroadcastb(ymmA, m);
+ cc.vpbroadcastd(xmmA, m);
+ cc.vpbroadcastd(ymmA, m);
+ cc.vpbroadcastq(xmmA, m);
+ cc.vpbroadcastq(ymmA, m);
+ cc.vpbroadcastw(xmmA, m);
+ cc.vpbroadcastw(ymmA, m);
+ cc.vpcmpeqb(ymmA, ymmB, m);
+ cc.vpcmpeqd(ymmA, ymmB, m);
+ cc.vpcmpeqq(ymmA, ymmB, m);
+ cc.vpcmpeqw(ymmA, ymmB, m);
+ cc.vpcmpgtb(ymmA, ymmB, m);
+ cc.vpcmpgtd(ymmA, ymmB, m);
+ cc.vpcmpgtq(ymmA, ymmB, m);
+ cc.vpcmpgtw(ymmA, ymmB, m);
+ cc.vperm2i128(ymmA, ymmB, m, 0);
+ cc.vpermd(ymmA, ymmB, m);
+ cc.vpermps(ymmA, ymmB, m);
+ cc.vpermpd(ymmA, m, 0);
+ cc.vpermq(ymmA, m, 0);
+ cc.vpgatherdd(xmmA, vx_ptr, xmmC);
+ cc.vpgatherdd(ymmA, vy_ptr, ymmC);
+ cc.vpgatherdq(xmmA, vx_ptr, xmmC);
+ cc.vpgatherdq(ymmA, vx_ptr, ymmC);
+ cc.vpgatherqd(xmmA, vx_ptr, xmmC);
+ cc.vpgatherqd(xmmA, vy_ptr, xmmC);
+ cc.vpgatherqq(xmmA, vx_ptr, xmmC);
+ cc.vpgatherqq(ymmA, vy_ptr, ymmC);
+ cc.vpmovsxbd(ymmA, m);
+ cc.vpmovsxbq(ymmA, m);
+ cc.vpmovsxbw(ymmA, m);
+ cc.vpmovsxdq(ymmA, m);
+ cc.vpmovsxwd(ymmA, m);
+ cc.vpmovsxwq(ymmA, m);
+ cc.vpmovzxbd(ymmA, m);
+ cc.vpmovzxbq(ymmA, m);
+ cc.vpmovzxbw(ymmA, m);
+ cc.vpmovzxdq(ymmA, m);
+ cc.vpmovzxwd(ymmA, m);
+ cc.vpmovzxwq(ymmA, m);
+ cc.vpshufd(ymmA, m, 0);
+ cc.vpshufhw(ymmA, m, 0);
+ cc.vpshuflw(ymmA, m, 0);
+ cc.vphaddd(ymmA, ymmB, m);
+ cc.vphaddsw(ymmA, ymmB, m);
+ cc.vphaddw(ymmA, ymmB, m);
+ cc.vphsubd(ymmA, ymmB, m);
+ cc.vphsubsw(ymmA, ymmB, m);
+ cc.vphsubw(ymmA, ymmB, m);
+ cc.vpmaddubsw(ymmA, ymmB, m);
+ cc.vpmaddwd(ymmA, ymmB, m);
+ cc.vpmaskmovd(m, xmmB, xmmC);
+ cc.vpmaskmovd(m, ymmB, ymmC);
+ cc.vpmaskmovd(xmmA, xmmB, m);
+ cc.vpmaskmovd(ymmA, ymmB, m);
+ cc.vpmaskmovq(m, xmmB, xmmC);
+ cc.vpmaskmovq(m, ymmB, ymmC);
+ cc.vpmaskmovq(xmmA, xmmB, m);
+ cc.vpmaskmovq(ymmA, ymmB, m);
+ cc.vpmaxsb(ymmA, ymmB, m);
+ cc.vpmaxsd(ymmA, ymmB, m);
+ cc.vpmaxsw(ymmA, ymmB, m);
+ cc.vpmaxub(ymmA, ymmB, m);
+ cc.vpmaxud(ymmA, ymmB, m);
+ cc.vpmaxuw(ymmA, ymmB, m);
+ cc.vpminsb(ymmA, ymmB, m);
+ cc.vpminsd(ymmA, ymmB, m);
+ cc.vpminsw(ymmA, ymmB, m);
+ cc.vpminub(ymmA, ymmB, m);
+ cc.vpminud(ymmA, ymmB, m);
+ cc.vpminuw(ymmA, ymmB, m);
+ cc.vpmuldq(ymmA, ymmB, m);
+ cc.vpmulhrsw(ymmA, ymmB, m);
+ cc.vpmulhuw(ymmA, ymmB, m);
+ cc.vpmulhw(ymmA, ymmB, m);
+ cc.vpmulld(ymmA, ymmB, m);
+ cc.vpmullw(ymmA, ymmB, m);
+ cc.vpmuludq(ymmA, ymmB, m);
+ cc.vpor(ymmA, ymmB, m);
+ cc.vpsadbw(ymmA, ymmB, m);
+ cc.vpshufb(ymmA, ymmB, m);
+ cc.vpsignb(ymmA, ymmB, m);
+ cc.vpsignd(ymmA, ymmB, m);
+ cc.vpsignw(ymmA, ymmB, m);
+ cc.vpslld(ymmA, ymmB, m);
+ cc.vpsllq(ymmA, ymmB, m);
+ cc.vpsllvd(xmmA, xmmB, m);
+ cc.vpsllvd(ymmA, ymmB, m);
+ cc.vpsllvq(xmmA, xmmB, m);
+ cc.vpsllvq(ymmA, ymmB, m);
+ cc.vpsllw(ymmA, ymmB, m);
+ cc.vpsrad(ymmA, ymmB, m);
+ cc.vpsravd(xmmA, xmmB, m);
+ cc.vpsravd(ymmA, ymmB, m);
+ cc.vpsraw(ymmA, ymmB, m);
+ cc.vpsrld(ymmA, ymmB, m);
+ cc.vpsrlq(ymmA, ymmB, m);
+ cc.vpsrlvd(xmmA, xmmB, m);
+ cc.vpsrlvd(ymmA, ymmB, m);
+ cc.vpsrlvq(xmmA, xmmB, m);
+ cc.vpsrlvq(ymmA, ymmB, m);
+ cc.vpsrlw(ymmA, ymmB, m);
+ cc.vpsubb(ymmA, ymmB, m);
+ cc.vpsubd(ymmA, ymmB, m);
+ cc.vpsubq(ymmA, ymmB, m);
+ cc.vpsubsb(ymmA, ymmB, m);
+ cc.vpsubsw(ymmA, ymmB, m);
+ cc.vpsubusb(ymmA, ymmB, m);
+ cc.vpsubusw(ymmA, ymmB, m);
+ cc.vpsubw(ymmA, ymmB, m);
+ cc.vpunpckhbw(ymmA, ymmB, m);
+ cc.vpunpckhdq(ymmA, ymmB, m);
+ cc.vpunpckhqdq(ymmA, ymmB, m);
+ cc.vpunpckhwd(ymmA, ymmB, m);
+ cc.vpunpcklbw(ymmA, ymmB, m);
+ cc.vpunpckldq(ymmA, ymmB, m);
+ cc.vpunpcklqdq(ymmA, ymmB, m);
+ cc.vpunpcklwd(ymmA, ymmB, m);
+ cc.vpxor(ymmA, ymmB, m);
+}
+
+// Generates a long sequence of AVX instructions.
+template<typename Emitter>
+static void generateAvxSequenceInternal(
+ Emitter& cc,
+ InstForm form,
+ const x86::Gp& gp,
+ const x86::Vec& vecA, const x86::Vec& vecB, const x86::Vec& vecC, const x86::Vec& vecD) {
+
+ if (form == InstForm::kReg)
+ generateAvxSequenceInternalRegOnly(cc, gp, vecA, vecB, vecC, vecD);
+ else
+ generateAvxSequenceInternalRegMem(cc, gp, vecA, vecB, vecC, vecD);
}
static void generateAvxSequence(BaseEmitter& emitter, InstForm form, bool emitPrologEpilog) {
@@ -2097,7 +2134,7 @@ static void generateAvxSequence(BaseEmitter& emitter, InstForm form, bool emitPr
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -2118,7 +2155,7 @@ static void generateAvxSequence(BaseEmitter& emitter, InstForm form, bool emitPr
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -2144,7 +2181,7 @@ static void generateAvxSequence(BaseEmitter& emitter, InstForm form, bool emitPr
Ymm c = cc.newYmm("c");
Ymm d = cc.newYmm("d");
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
generateAvxSequenceInternal(cc, form, gp, a, b, c, d);
cc.endFunc();
}
@@ -2153,9 +2190,8 @@ static void generateAvxSequence(BaseEmitter& emitter, InstForm form, bool emitPr
// Generates a long sequence of AVX512 instructions.
template<typename Emitter>
-static void generateAvx512SequenceInternal(
+static void generateAvx512SequenceInternalRegOnly(
Emitter& cc,
- InstForm form,
const x86::Gp& gp,
const x86::KReg& kA, const x86::KReg& kB, const x86::KReg& kC,
const x86::Vec& vecA, const x86::Vec& vecB, const x86::Vec& vecC, const x86::Vec& vecD) {
@@ -2172,2673 +2208,2716 @@ static void generateAvx512SequenceInternal(
x86::Ymm ymmA = vecA.ymm();
x86::Ymm ymmB = vecB.ymm();
x86::Ymm ymmC = vecC.ymm();
- x86::Ymm ymmD = vecD.ymm();
x86::Zmm zmmA = vecA.zmm();
x86::Zmm zmmB = vecB.zmm();
x86::Zmm zmmC = vecC.zmm();
+
+ cc.xor_(gpd, gpd);
+ cc.vxorps(xmmA, xmmA, xmmA);
+ cc.vxorps(xmmB, xmmB, xmmB);
+ cc.vxorps(xmmC, xmmC, xmmC);
+ cc.vxorps(xmmD, xmmD, xmmD);
+
+ cc.kaddb(kA, kB, kC);
+ cc.kaddd(kA, kB, kC);
+ cc.kaddq(kA, kB, kC);
+ cc.kaddw(kA, kB, kC);
+ cc.kandb(kA, kB, kC);
+ cc.kandd(kA, kB, kC);
+ cc.kandnb(kA, kB, kC);
+ cc.kandnd(kA, kB, kC);
+ cc.kandnq(kA, kB, kC);
+ cc.kandnw(kA, kB, kC);
+ cc.kandq(kA, kB, kC);
+ cc.kandw(kA, kB, kC);
+ cc.kmovb(kA, kB);
+ cc.kmovb(kA, gpd);
+ cc.kmovb(gpd, kB);
+ cc.kmovd(kA, kB);
+ cc.kmovd(kA, gpd);
+ cc.kmovd(gpd, kB);
+ cc.kmovq(kA, kB);
+ if (cc.is64Bit()) cc.kmovq(kA, gpq);
+ if (cc.is64Bit()) cc.kmovq(gpq, kB);
+ cc.kmovw(kA, kB);
+ cc.kmovw(kA, gpd);
+ cc.kmovw(gpd, kB);
+ cc.knotb(kA, kB);
+ cc.knotd(kA, kB);
+ cc.knotq(kA, kB);
+ cc.knotw(kA, kB);
+ cc.korb(kA, kB, kC);
+ cc.kord(kA, kB, kC);
+ cc.korq(kA, kB, kC);
+ cc.kortestb(kA, kB);
+ cc.kortestd(kA, kB);
+ cc.kortestq(kA, kB);
+ cc.kortestw(kA, kB);
+ cc.korw(kA, kB, kC);
+ cc.kshiftlb(kA, kB, 0);
+ cc.kshiftld(kA, kB, 0);
+ cc.kshiftlq(kA, kB, 0);
+ cc.kshiftlw(kA, kB, 0);
+ cc.kshiftrb(kA, kB, 0);
+ cc.kshiftrd(kA, kB, 0);
+ cc.kshiftrq(kA, kB, 0);
+ cc.kshiftrw(kA, kB, 0);
+ cc.ktestb(kA, kB);
+ cc.ktestd(kA, kB);
+ cc.ktestq(kA, kB);
+ cc.ktestw(kA, kB);
+ cc.kunpckbw(kA, kB, kC);
+ cc.kunpckdq(kA, kB, kC);
+ cc.kunpckwd(kA, kB, kC);
+ cc.kxnorb(kA, kB, kC);
+ cc.kxnord(kA, kB, kC);
+ cc.kxnorq(kA, kB, kC);
+ cc.kxnorw(kA, kB, kC);
+ cc.kxorb(kA, kB, kC);
+ cc.kxord(kA, kB, kC);
+ cc.kxorq(kA, kB, kC);
+ cc.kxorw(kA, kB, kC);
+ cc.nop();
+
+ cc.evex().vaddpd(xmmA, xmmB, xmmC);
+ cc.evex().vaddpd(ymmA, ymmB, ymmC);
+ cc.evex().vaddpd(zmmA, zmmB, zmmC);
+ cc.evex().vaddps(xmmA, xmmB, xmmC);
+ cc.evex().vaddps(ymmA, ymmB, ymmC);
+ cc.evex().vaddps(zmmA, zmmB, zmmC);
+ cc.evex().vaddsd(xmmA, xmmB, xmmC);
+ cc.evex().vaddss(xmmA, xmmB, xmmC);
+ cc.evex().valignd(xmmA, xmmB, xmmC, 0);
+ cc.evex().valignd(ymmA, ymmB, ymmC, 0);
+ cc.evex().valignd(zmmA, zmmB, zmmC, 0);
+ cc.evex().valignq(xmmA, xmmB, xmmC, 0);
+ cc.evex().valignq(ymmA, ymmB, ymmC, 0);
+ cc.evex().valignq(zmmA, zmmB, zmmC, 0);
+ cc.evex().vandnpd(xmmA, xmmB, xmmC);
+ cc.evex().vandnpd(ymmA, ymmB, ymmC);
+ cc.evex().vandnpd(zmmA, zmmB, zmmC);
+ cc.evex().vandnps(xmmA, xmmB, xmmC);
+ cc.evex().vandnps(ymmA, ymmB, ymmC);
+ cc.evex().vandnps(zmmA, zmmB, zmmC);
+ cc.evex().vandpd(xmmA, xmmB, xmmC);
+ cc.evex().vandpd(ymmA, ymmB, ymmC);
+ cc.evex().vandpd(zmmA, zmmB, zmmC);
+ cc.evex().vandps(xmmA, xmmB, xmmC);
+ cc.evex().vandps(ymmA, ymmB, ymmC);
+ cc.evex().vandps(zmmA, zmmB, zmmC);
+ cc.evex().vblendmpd(xmmA, xmmB, xmmC);
+ cc.evex().vblendmpd(ymmA, ymmB, ymmC);
+ cc.evex().vblendmpd(zmmA, zmmB, zmmC);
+ cc.evex().vblendmps(xmmA, xmmB, xmmC);
+ cc.evex().vblendmps(ymmA, ymmB, ymmC);
+ cc.evex().vblendmps(zmmA, zmmB, zmmC);
+ cc.evex().vbroadcastf32x2(ymmA, xmmB);
+ cc.evex().vbroadcastf32x2(zmmA, xmmB);
+ cc.evex().vbroadcasti32x2(xmmA, xmmB);
+ cc.evex().vbroadcasti32x2(ymmA, xmmB);
+ cc.evex().vbroadcasti32x2(zmmA, xmmB);
+ cc.evex().vbroadcastsd(ymmA, xmmB);
+ cc.evex().vbroadcastsd(zmmA, xmmB);
+ cc.evex().vbroadcastss(xmmA, xmmB);
+ cc.evex().vbroadcastss(ymmA, xmmB);
+ cc.evex().vbroadcastss(zmmA, xmmB);
+ cc.evex().vcmppd(kA, xmmB, xmmC, 0);
+ cc.evex().vcmppd(kA, ymmB, ymmC, 0);
+ cc.evex().vcmppd(kA, zmmB, zmmC, 0);
+ cc.evex().vcmpps(kA, xmmB, xmmC, 0);
+ cc.evex().vcmpps(kA, ymmB, ymmC, 0);
+ cc.evex().vcmpps(kA, zmmB, zmmC, 0);
+ cc.evex().vcmpsd(kA, xmmB, xmmC, 0);
+ cc.evex().vcmpss(kA, xmmB, xmmC, 0);
+ cc.evex().vcomisd(xmmA, xmmB);
+ cc.evex().vcomiss(xmmA, xmmB);
+ cc.evex().vcompresspd(xmmA, xmmB);
+ cc.evex().vcompresspd(ymmA, ymmB);
+ cc.evex().vcompresspd(zmmA, zmmB);
+ cc.evex().vcompressps(xmmA, xmmB);
+ cc.evex().vcompressps(ymmA, ymmB);
+ cc.evex().vcompressps(zmmA, zmmB);
+ cc.evex().vcvtdq2pd(xmmA, xmmB);
+ cc.evex().vcvtdq2pd(ymmA, xmmB);
+ cc.evex().vcvtdq2pd(zmmA, ymmB);
+ cc.evex().vcvtdq2ps(xmmA, xmmB);
+ cc.evex().vcvtdq2ps(ymmA, ymmB);
+ cc.evex().vcvtdq2ps(zmmA, zmmB);
+ cc.evex().vcvtpd2dq(xmmA, xmmB);
+ cc.evex().vcvtpd2dq(xmmA, ymmB);
+ cc.evex().vcvtpd2dq(ymmA, zmmB);
+ cc.evex().vcvtpd2qq(xmmA, xmmB);
+ cc.evex().vcvtpd2qq(ymmA, ymmB);
+ cc.evex().vcvtpd2qq(zmmA, zmmB);
+ cc.evex().vcvtpd2udq(xmmA, xmmB);
+ cc.evex().vcvtpd2udq(xmmA, ymmB);
+ cc.evex().vcvtpd2udq(ymmA, zmmB);
+ cc.evex().vcvtpd2uqq(xmmA, xmmB);
+ cc.evex().vcvtpd2uqq(ymmA, ymmB);
+ cc.evex().vcvtpd2uqq(zmmA, zmmB);
+ cc.evex().vcvtph2ps(xmmA, xmmB);
+ cc.evex().vcvtph2ps(ymmA, xmmB);
+ cc.evex().vcvtph2ps(zmmA, ymmB);
+ cc.evex().vcvtps2dq(xmmA, xmmB);
+ cc.evex().vcvtps2dq(ymmA, ymmB);
+ cc.evex().vcvtps2dq(zmmA, zmmB);
+ cc.evex().vcvtps2pd(xmmA, xmmB);
+ cc.evex().vcvtps2pd(ymmA, xmmB);
+ cc.evex().vcvtps2pd(zmmA, ymmB);
+ cc.evex().vcvtps2ph(xmmA, xmmB, 0);
+ cc.evex().vcvtps2ph(xmmA, ymmB, 0);
+ cc.evex().vcvtps2ph(ymmA, zmmB, 0);
+ cc.evex().vcvtps2qq(xmmA, xmmB);
+ cc.evex().vcvtps2qq(ymmA, xmmB);
+ cc.evex().vcvtps2qq(zmmA, ymmB);
+ cc.evex().vcvtps2udq(xmmA, xmmB);
+ cc.evex().vcvtps2udq(ymmA, ymmB);
+ cc.evex().vcvtps2udq(zmmA, zmmB);
+ cc.evex().vcvtps2uqq(xmmA, xmmB);
+ cc.evex().vcvtps2uqq(ymmA, xmmB);
+ cc.evex().vcvtps2uqq(zmmA, ymmB);
+ cc.evex().vcvtqq2pd(xmmA, xmmB);
+ cc.evex().vcvtqq2pd(ymmA, ymmB);
+ cc.evex().vcvtqq2pd(zmmA, zmmB);
+ cc.evex().vcvtqq2ps(xmmA, xmmB);
+ cc.evex().vcvtqq2ps(xmmA, ymmB);
+ cc.evex().vcvtqq2ps(ymmA, zmmB);
+ cc.evex().vcvtsd2si(gpd, xmmB);
+ cc.evex().vcvtsd2si(gpz, xmmB);
+ cc.evex().vcvtsd2ss(xmmA, xmmB, xmmC);
+ cc.evex().vcvtsd2usi(gpd, xmmB);
+ cc.evex().vcvtsd2usi(gpz, xmmB);
+ cc.evex().vcvtsi2sd(xmmA, xmmB, gpd);
+ cc.evex().vcvtsi2sd(xmmA, xmmB, gpz);
+ cc.evex().vcvtsi2ss(xmmA, xmmB, gpd);
+ cc.evex().vcvtsi2ss(xmmA, xmmB, gpz);
+ cc.evex().vcvtss2sd(xmmA, xmmB, xmmC);
+ cc.evex().vcvtss2si(gpd, xmmB);
+ cc.evex().vcvtss2si(gpz, xmmB);
+ cc.evex().vcvtss2usi(gpd, xmmB);
+ cc.evex().vcvtss2usi(gpz, xmmB);
+ cc.evex().vcvttpd2dq(xmmA, xmmB);
+ cc.evex().vcvttpd2dq(xmmA, ymmB);
+ cc.evex().vcvttpd2dq(ymmA, zmmB);
+ cc.evex().vcvttpd2qq(xmmA, xmmB);
+ cc.evex().vcvttpd2qq(ymmA, ymmB);
+ cc.evex().vcvttpd2qq(zmmA, zmmB);
+ cc.evex().vcvttpd2udq(xmmA, xmmB);
+ cc.evex().vcvttpd2udq(xmmA, ymmB);
+ cc.evex().vcvttpd2udq(ymmA, zmmB);
+ cc.evex().vcvttpd2uqq(xmmA, xmmB);
+ cc.evex().vcvttpd2uqq(ymmA, ymmB);
+ cc.evex().vcvttpd2uqq(zmmA, zmmB);
+ cc.evex().vcvttps2dq(xmmA, xmmB);
+ cc.evex().vcvttps2dq(ymmA, ymmB);
+ cc.evex().vcvttps2dq(zmmA, zmmB);
+ cc.evex().vcvttps2qq(xmmA, xmmB);
+ cc.evex().vcvttps2qq(ymmA, xmmB);
+ cc.evex().vcvttps2qq(zmmA, ymmB);
+ cc.evex().vcvttps2udq(xmmA, xmmB);
+ cc.evex().vcvttps2udq(ymmA, ymmB);
+ cc.evex().vcvttps2udq(zmmA, zmmB);
+ cc.evex().vcvttps2uqq(xmmA, xmmB);
+ cc.evex().vcvttps2uqq(ymmA, xmmB);
+ cc.evex().vcvttps2uqq(zmmA, ymmB);
+ cc.evex().vcvttsd2si(gpd, xmmB);
+ cc.evex().vcvttsd2si(gpz, xmmB);
+ cc.evex().vcvttsd2usi(gpd, xmmB);
+ cc.evex().vcvttsd2usi(gpz, xmmB);
+ cc.evex().vcvttss2si(gpd, xmmB);
+ cc.evex().vcvttss2si(gpz, xmmB);
+ cc.evex().vcvttss2usi(gpd, xmmB);
+ cc.evex().vcvttss2usi(gpz, xmmB);
+ cc.evex().vcvtudq2pd(xmmA, xmmB);
+ cc.evex().vcvtudq2pd(ymmA, xmmB);
+ cc.evex().vcvtudq2pd(zmmA, ymmB);
+ cc.evex().vcvtudq2ps(xmmA, xmmB);
+ cc.evex().vcvtudq2ps(ymmA, ymmB);
+ cc.evex().vcvtudq2ps(zmmA, zmmB);
+ cc.evex().vcvtuqq2pd(xmmA, xmmB);
+ cc.evex().vcvtuqq2pd(ymmA, ymmB);
+ cc.evex().vcvtuqq2pd(zmmA, zmmB);
+ cc.evex().vcvtuqq2ps(xmmA, xmmB);
+ cc.evex().vcvtuqq2ps(xmmA, ymmB);
+ cc.evex().vcvtuqq2ps(ymmA, zmmB);
+ cc.evex().vcvtusi2sd(xmmA, xmmB, gpd);
+ cc.evex().vcvtusi2sd(xmmA, xmmB, gpz);
+ cc.evex().vcvtusi2ss(xmmA, xmmB, gpd);
+ cc.evex().vcvtusi2ss(xmmA, xmmB, gpz);
+ cc.evex().vdbpsadbw(xmmA, xmmB, xmmC, 0);
+ cc.evex().vdbpsadbw(ymmA, ymmB, ymmC, 0);
+ cc.evex().vdbpsadbw(zmmA, zmmB, zmmC, 0);
+ cc.evex().vdivpd(xmmA, xmmB, xmmC);
+ cc.evex().vdivpd(ymmA, ymmB, ymmC);
+ cc.evex().vdivpd(zmmA, zmmB, zmmC);
+ cc.evex().vdivps(xmmA, xmmB, xmmC);
+ cc.evex().vdivps(ymmA, ymmB, ymmC);
+ cc.evex().vdivps(zmmA, zmmB, zmmC);
+ cc.evex().vdivsd(xmmA, xmmB, xmmC);
+ cc.evex().vdivss(xmmA, xmmB, xmmC);
+ cc.evex().vexp2pd(zmmA, zmmB);
+ cc.evex().vexp2ps(zmmA, zmmB);
+ cc.evex().vexpandpd(xmmA, xmmB);
+ cc.evex().vexpandpd(ymmA, ymmB);
+ cc.evex().vexpandpd(zmmA, zmmB);
+ cc.evex().vexpandps(xmmA, xmmB);
+ cc.evex().vexpandps(ymmA, ymmB);
+ cc.evex().vexpandps(zmmA, zmmB);
+ cc.evex().vextractf32x4(xmmA, ymmB, 0);
+ cc.evex().vextractf32x4(xmmA, zmmB, 0);
+ cc.evex().vextractf32x8(ymmA, zmmB, 0);
+ cc.evex().vextractf64x2(xmmA, ymmB, 0);
+ cc.evex().vextractf64x2(xmmA, zmmB, 0);
+ cc.evex().vextractf64x4(ymmA, zmmB, 0);
+ cc.evex().vextracti32x4(xmmA, ymmB, 0);
+ cc.evex().vextracti32x4(xmmA, zmmB, 0);
+ cc.evex().vextracti32x8(ymmA, zmmB, 0);
+ cc.evex().vextracti64x2(xmmA, ymmB, 0);
+ cc.evex().vextracti64x2(xmmA, zmmB, 0);
+ cc.evex().vextracti64x4(ymmA, zmmB, 0);
+ cc.evex().vextractps(gpd, xmmB, 0);
+ cc.evex().vfixupimmpd(xmmA, xmmB, xmmC, 0);
+ cc.evex().vfixupimmpd(ymmA, ymmB, ymmC, 0);
+ cc.evex().vfixupimmpd(zmmA, zmmB, zmmC, 0);
+ cc.evex().vfixupimmps(xmmA, xmmB, xmmC, 0);
+ cc.evex().vfixupimmps(ymmA, ymmB, ymmC, 0);
+ cc.evex().vfixupimmps(zmmA, zmmB, zmmC, 0);
+ cc.evex().vfixupimmsd(xmmA, xmmB, xmmC, 0);
+ cc.evex().vfixupimmss(xmmA, xmmB, xmmC, 0);
+ cc.evex().vfmadd132pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd132pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmadd132pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmadd132ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd132ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmadd132ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmadd132sd(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd132ss(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd213pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd213pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmadd213pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmadd213ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd213ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmadd213ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmadd213sd(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd213ss(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd231pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd231pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmadd231pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmadd231ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd231ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmadd231ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmadd231sd(xmmA, xmmB, xmmC);
+ cc.evex().vfmadd231ss(xmmA, xmmB, xmmC);
+ cc.evex().vfmaddsub132pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmaddsub132pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmaddsub132pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmaddsub132ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmaddsub132ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmaddsub132ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmaddsub213pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmaddsub213pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmaddsub213pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmaddsub213ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmaddsub213ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmaddsub213ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmaddsub231pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmaddsub231pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmaddsub231pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmaddsub231ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmaddsub231ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmaddsub231ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmsub132pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub132pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmsub132pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmsub132ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub132ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmsub132ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmsub132sd(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub132ss(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub213pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub213pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmsub213pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmsub213ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub213ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmsub213ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmsub213sd(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub213ss(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub231pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub231pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmsub231pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmsub231ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub231ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmsub231ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmsub231sd(xmmA, xmmB, xmmC);
+ cc.evex().vfmsub231ss(xmmA, xmmB, xmmC);
+ cc.evex().vfmsubadd132pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmsubadd132pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmsubadd132pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmsubadd132ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmsubadd132ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmsubadd132ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmsubadd213pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmsubadd213pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmsubadd213pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmsubadd213ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmsubadd213ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmsubadd213ps(zmmA, zmmB, zmmC);
+ cc.evex().vfmsubadd231pd(xmmA, xmmB, xmmC);
+ cc.evex().vfmsubadd231pd(ymmA, ymmB, ymmC);
+ cc.evex().vfmsubadd231pd(zmmA, zmmB, zmmC);
+ cc.evex().vfmsubadd231ps(xmmA, xmmB, xmmC);
+ cc.evex().vfmsubadd231ps(ymmA, ymmB, ymmC);
+ cc.evex().vfmsubadd231ps(zmmA, zmmB, zmmC);
+ cc.evex().vfnmadd132pd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd132pd(ymmA, ymmB, ymmC);
+ cc.evex().vfnmadd132pd(zmmA, zmmB, zmmC);
+ cc.evex().vfnmadd132ps(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd132ps(ymmA, ymmB, ymmC);
+ cc.evex().vfnmadd132ps(zmmA, zmmB, zmmC);
+ cc.evex().vfnmadd132sd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd132ss(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd213pd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd213pd(ymmA, ymmB, ymmC);
+ cc.evex().vfnmadd213pd(zmmA, zmmB, zmmC);
+ cc.evex().vfnmadd213ps(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd213ps(ymmA, ymmB, ymmC);
+ cc.evex().vfnmadd213ps(zmmA, zmmB, zmmC);
+ cc.evex().vfnmadd213sd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd213ss(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd231pd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd231pd(ymmA, ymmB, ymmC);
+ cc.evex().vfnmadd231pd(zmmA, zmmB, zmmC);
+ cc.evex().vfnmadd231ps(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd231ps(ymmA, ymmB, ymmC);
+ cc.evex().vfnmadd231ps(zmmA, zmmB, zmmC);
+ cc.evex().vfnmadd231sd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmadd231ss(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub132pd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub132pd(ymmA, ymmB, ymmC);
+ cc.evex().vfnmsub132pd(zmmA, zmmB, zmmC);
+ cc.evex().vfnmsub132ps(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub132ps(ymmA, ymmB, ymmC);
+ cc.evex().vfnmsub132ps(zmmA, zmmB, zmmC);
+ cc.evex().vfnmsub132sd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub132ss(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub213pd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub213pd(ymmA, ymmB, ymmC);
+ cc.evex().vfnmsub213pd(zmmA, zmmB, zmmC);
+ cc.evex().vfnmsub213ps(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub213ps(ymmA, ymmB, ymmC);
+ cc.evex().vfnmsub213ps(zmmA, zmmB, zmmC);
+ cc.evex().vfnmsub213sd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub213ss(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub231pd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub231pd(ymmA, ymmB, ymmC);
+ cc.evex().vfnmsub231pd(zmmA, zmmB, zmmC);
+ cc.evex().vfnmsub231ps(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub231ps(ymmA, ymmB, ymmC);
+ cc.evex().vfnmsub231ps(zmmA, zmmB, zmmC);
+ cc.evex().vfnmsub231sd(xmmA, xmmB, xmmC);
+ cc.evex().vfnmsub231ss(xmmA, xmmB, xmmC);
+ cc.evex().vfpclasspd(kA, xmmB, 0);
+ cc.evex().vfpclasspd(kA, ymmB, 0);
+ cc.evex().vfpclasspd(kA, zmmB, 0);
+ cc.evex().vfpclassps(kA, xmmB, 0);
+ cc.evex().vfpclassps(kA, ymmB, 0);
+ cc.evex().vfpclassps(kA, zmmB, 0);
+ cc.evex().vfpclasssd(kA, xmmB, 0);
+ cc.evex().vfpclassss(kA, xmmB, 0);
+ cc.evex().vgetexppd(xmmA, xmmB);
+ cc.evex().vgetexppd(ymmA, ymmB);
+ cc.evex().vgetexppd(zmmA, zmmB);
+ cc.evex().vgetexpps(xmmA, xmmB);
+ cc.evex().vgetexpps(ymmA, ymmB);
+ cc.evex().vgetexpps(zmmA, zmmB);
+ cc.evex().vgetexpsd(xmmA, xmmB, xmmC);
+ cc.evex().vgetexpss(xmmA, xmmB, xmmC);
+ cc.evex().vgetmantpd(xmmA, xmmB, 0);
+ cc.evex().vgetmantpd(ymmA, ymmB, 0);
+ cc.evex().vgetmantpd(zmmA, zmmB, 0);
+ cc.evex().vgetmantps(xmmA, xmmB, 0);
+ cc.evex().vgetmantps(ymmA, ymmB, 0);
+ cc.evex().vgetmantps(zmmA, zmmB, 0);
+ cc.evex().vgetmantsd(xmmA, xmmB, xmmC, 0);
+ cc.evex().vgetmantss(xmmA, xmmB, xmmC, 0);
+ cc.evex().vinsertf32x4(ymmA, ymmB, xmmC, 0);
+ cc.evex().vinsertf32x4(zmmA, zmmB, xmmC, 0);
+ cc.evex().vinsertf32x8(zmmA, zmmB, ymmC, 0);
+ cc.evex().vinsertf64x2(ymmA, ymmB, xmmC, 0);
+ cc.evex().vinsertf64x2(zmmA, zmmB, xmmC, 0);
+ cc.evex().vinsertf64x4(zmmA, zmmB, ymmC, 0);
+ cc.evex().vinserti32x4(ymmA, ymmB, xmmC, 0);
+ cc.evex().vinserti32x4(zmmA, zmmB, xmmC, 0);
+ cc.evex().vinserti32x8(zmmA, zmmB, ymmC, 0);
+ cc.evex().vinserti64x2(ymmA, ymmB, xmmC, 0);
+ cc.evex().vinserti64x2(zmmA, zmmB, xmmC, 0);
+ cc.evex().vinserti64x4(zmmA, zmmB, ymmC, 0);
+ cc.evex().vinsertps(xmmA, xmmB, xmmC, 0);
+ cc.evex().vmaxpd(xmmA, xmmB, xmmC);
+ cc.evex().vmaxpd(ymmA, ymmB, ymmC);
+ cc.evex().vmaxpd(zmmA, zmmB, zmmC);
+ cc.evex().vmaxps(xmmA, xmmB, xmmC);
+ cc.evex().vmaxps(ymmA, ymmB, ymmC);
+ cc.evex().vmaxps(zmmA, zmmB, zmmC);
+ cc.evex().vmaxsd(xmmA, xmmB, xmmC);
+ cc.evex().vmaxss(xmmA, xmmB, xmmC);
+ cc.evex().vminpd(xmmA, xmmB, xmmC);
+ cc.evex().vminpd(ymmA, ymmB, ymmC);
+ cc.evex().vminpd(zmmA, zmmB, zmmC);
+ cc.evex().vminps(xmmA, xmmB, xmmC);
+ cc.evex().vminps(ymmA, ymmB, ymmC);
+ cc.evex().vminps(zmmA, zmmB, zmmC);
+ cc.evex().vminsd(xmmA, xmmB, xmmC);
+ cc.evex().vminss(xmmA, xmmB, xmmC);
+ cc.evex().vmovapd(xmmA, xmmB);
+ cc.evex().vmovapd(xmmA, xmmB);
+ cc.evex().vmovapd(ymmA, ymmB);
+ cc.evex().vmovapd(ymmA, ymmB);
+ cc.evex().vmovapd(zmmA, zmmB);
+ cc.evex().vmovapd(zmmA, zmmB);
+ cc.evex().vmovaps(xmmA, xmmB);
+ cc.evex().vmovaps(xmmA, xmmB);
+ cc.evex().vmovaps(ymmA, ymmB);
+ cc.evex().vmovaps(ymmA, ymmB);
+ cc.evex().vmovaps(zmmA, zmmB);
+ cc.evex().vmovaps(zmmA, zmmB);
+ cc.evex().vmovd(gpd, xmmB);
+ cc.evex().vmovd(xmmA, gpd);
+ cc.evex().vmovddup(xmmA, xmmB);
+ cc.evex().vmovddup(ymmA, ymmB);
+ cc.evex().vmovddup(zmmA, zmmB);
+ cc.evex().vmovdqa32(xmmA, xmmB);
+ cc.evex().vmovdqa32(xmmA, xmmB);
+ cc.evex().vmovdqa32(ymmA, ymmB);
+ cc.evex().vmovdqa32(ymmA, ymmB);
+ cc.evex().vmovdqa32(zmmA, zmmB);
+ cc.evex().vmovdqa32(zmmA, zmmB);
+ cc.evex().vmovdqa64(xmmA, xmmB);
+ cc.evex().vmovdqa64(xmmA, xmmB);
+ cc.evex().vmovdqa64(ymmA, ymmB);
+ cc.evex().vmovdqa64(ymmA, ymmB);
+ cc.evex().vmovdqa64(zmmA, zmmB);
+ cc.evex().vmovdqa64(zmmA, zmmB);
+ cc.evex().vmovdqu16(xmmA, xmmB);
+ cc.evex().vmovdqu16(xmmA, xmmB);
+ cc.evex().vmovdqu16(ymmA, ymmB);
+ cc.evex().vmovdqu16(ymmA, ymmB);
+ cc.evex().vmovdqu16(zmmA, zmmB);
+ cc.evex().vmovdqu16(zmmA, zmmB);
+ cc.evex().vmovdqu32(xmmA, xmmB);
+ cc.evex().vmovdqu32(xmmA, xmmB);
+ cc.evex().vmovdqu32(ymmA, ymmB);
+ cc.evex().vmovdqu32(ymmA, ymmB);
+ cc.evex().vmovdqu32(zmmA, zmmB);
+ cc.evex().vmovdqu32(zmmA, zmmB);
+ cc.evex().vmovdqu64(xmmA, xmmB);
+ cc.evex().vmovdqu64(xmmA, xmmB);
+ cc.evex().vmovdqu64(ymmA, ymmB);
+ cc.evex().vmovdqu64(ymmA, ymmB);
+ cc.evex().vmovdqu64(zmmA, zmmB);
+ cc.evex().vmovdqu64(zmmA, zmmB);
+ cc.evex().vmovdqu8(xmmA, xmmB);
+ cc.evex().vmovdqu8(xmmA, xmmB);
+ cc.evex().vmovdqu8(ymmA, ymmB);
+ cc.evex().vmovdqu8(ymmA, ymmB);
+ cc.evex().vmovdqu8(zmmA, zmmB);
+ cc.evex().vmovdqu8(zmmA, zmmB);
+ cc.evex().vmovhlps(xmmA, xmmB, xmmC);
+ if (cc.is64Bit()) cc.evex().vmovq(gpq, xmmB);
+ if (cc.is64Bit()) cc.evex().vmovq(xmmA, gpq);
+ cc.evex().vmovq(xmmA, xmmB);
+ cc.evex().vmovsd(xmmA, xmmB, xmmC);
+ cc.evex().vmovshdup(xmmA, xmmB);
+ cc.evex().vmovshdup(ymmA, ymmB);
+ cc.evex().vmovshdup(zmmA, zmmB);
+ cc.evex().vmovsldup(xmmA, xmmB);
+ cc.evex().vmovsldup(ymmA, ymmB);
+ cc.evex().vmovsldup(zmmA, zmmB);
+ cc.evex().vmovss(xmmA, xmmB, xmmC);
+ cc.evex().vmovupd(xmmA, xmmB);
+ cc.evex().vmovupd(xmmA, xmmB);
+ cc.evex().vmovupd(ymmA, ymmB);
+ cc.evex().vmovupd(ymmA, ymmB);
+ cc.evex().vmovupd(zmmA, zmmB);
+ cc.evex().vmovupd(zmmA, zmmB);
+ cc.evex().vmovups(xmmA, xmmB);
+ cc.evex().vmovups(xmmA, xmmB);
+ cc.evex().vmovups(ymmA, ymmB);
+ cc.evex().vmovups(ymmA, ymmB);
+ cc.evex().vmovups(zmmA, zmmB);
+ cc.evex().vmovups(zmmA, zmmB);
+ cc.evex().vmulpd(xmmA, xmmB, xmmC);
+ cc.evex().vmulpd(ymmA, ymmB, ymmC);
+ cc.evex().vmulpd(zmmA, zmmB, zmmC);
+ cc.evex().vmulps(xmmA, xmmB, xmmC);
+ cc.evex().vmulps(ymmA, ymmB, ymmC);
+ cc.evex().vmulps(zmmA, zmmB, zmmC);
+ cc.evex().vmulsd(xmmA, xmmB, xmmC);
+ cc.evex().vmulss(xmmA, xmmB, xmmC);
+ cc.evex().vorpd(xmmA, xmmB, xmmC);
+ cc.evex().vorpd(ymmA, ymmB, ymmC);
+ cc.evex().vorpd(zmmA, zmmB, zmmC);
+ cc.evex().vorps(xmmA, xmmB, xmmC);
+ cc.evex().vorps(ymmA, ymmB, ymmC);
+ cc.evex().vorps(zmmA, zmmB, zmmC);
+ cc.evex().vpabsb(xmmA, xmmB);
+ cc.evex().vpabsb(ymmA, ymmB);
+ cc.evex().vpabsb(zmmA, zmmB);
+ cc.evex().vpabsd(xmmA, xmmB);
+ cc.evex().vpabsd(ymmA, ymmB);
+ cc.evex().vpabsd(zmmA, zmmB);
+ cc.evex().vpabsq(xmmA, xmmB);
+ cc.evex().vpabsq(ymmA, ymmB);
+ cc.evex().vpabsq(zmmA, zmmB);
+ cc.evex().vpabsw(xmmA, xmmB);
+ cc.evex().vpabsw(ymmA, ymmB);
+ cc.evex().vpabsw(zmmA, zmmB);
+ cc.evex().vpackssdw(xmmA, xmmB, xmmC);
+ cc.evex().vpackssdw(ymmA, ymmB, ymmC);
+ cc.evex().vpackssdw(zmmA, zmmB, zmmC);
+ cc.evex().vpacksswb(xmmA, xmmB, xmmC);
+ cc.evex().vpacksswb(ymmA, ymmB, ymmC);
+ cc.evex().vpacksswb(zmmA, zmmB, zmmC);
+ cc.evex().vpackusdw(xmmA, xmmB, xmmC);
+ cc.evex().vpackusdw(ymmA, ymmB, ymmC);
+ cc.evex().vpackusdw(zmmA, zmmB, zmmC);
+ cc.evex().vpackuswb(xmmA, xmmB, xmmC);
+ cc.evex().vpackuswb(ymmA, ymmB, ymmC);
+ cc.evex().vpackuswb(zmmA, zmmB, zmmC);
+ cc.evex().vpaddb(xmmA, xmmB, xmmC);
+ cc.evex().vpaddb(ymmA, ymmB, ymmC);
+ cc.evex().vpaddb(zmmA, zmmB, zmmC);
+ cc.evex().vpaddd(xmmA, xmmB, xmmC);
+ cc.evex().vpaddd(ymmA, ymmB, ymmC);
+ cc.evex().vpaddd(zmmA, zmmB, zmmC);
+ cc.evex().vpaddq(xmmA, xmmB, xmmC);
+ cc.evex().vpaddq(ymmA, ymmB, ymmC);
+ cc.evex().vpaddq(zmmA, zmmB, zmmC);
+ cc.evex().vpaddsb(xmmA, xmmB, xmmC);
+ cc.evex().vpaddsb(ymmA, ymmB, ymmC);
+ cc.evex().vpaddsb(zmmA, zmmB, zmmC);
+ cc.evex().vpaddsw(xmmA, xmmB, xmmC);
+ cc.evex().vpaddsw(ymmA, ymmB, ymmC);
+ cc.evex().vpaddsw(zmmA, zmmB, zmmC);
+ cc.evex().vpaddusb(xmmA, xmmB, xmmC);
+ cc.evex().vpaddusb(ymmA, ymmB, ymmC);
+ cc.evex().vpaddusb(zmmA, zmmB, zmmC);
+ cc.evex().vpaddusw(xmmA, xmmB, xmmC);
+ cc.evex().vpaddusw(ymmA, ymmB, ymmC);
+ cc.evex().vpaddusw(zmmA, zmmB, zmmC);
+ cc.evex().vpaddw(xmmA, xmmB, xmmC);
+ cc.evex().vpaddw(ymmA, ymmB, ymmC);
+ cc.evex().vpaddw(zmmA, zmmB, zmmC);
+ cc.evex().vpalignr(xmmA, xmmB, xmmC, 0);
+ cc.evex().vpalignr(ymmA, ymmB, ymmC, 0);
+ cc.evex().vpalignr(zmmA, zmmB, zmmC, 0);
+ cc.evex().vpandd(xmmA, xmmB, xmmC);
+ cc.evex().vpandd(ymmA, ymmB, ymmC);
+ cc.evex().vpandd(zmmA, zmmB, zmmC);
+ cc.evex().vpandnd(xmmA, xmmB, xmmC);
+ cc.evex().vpandnd(ymmA, ymmB, ymmC);
+ cc.evex().vpandnd(zmmA, zmmB, zmmC);
+ cc.evex().vpandnq(xmmA, xmmB, xmmC);
+ cc.evex().vpandnq(ymmA, ymmB, ymmC);
+ cc.evex().vpandnq(zmmA, zmmB, zmmC);
+ cc.evex().vpandq(xmmA, xmmB, xmmC);
+ cc.evex().vpandq(ymmA, ymmB, ymmC);
+ cc.evex().vpandq(zmmA, zmmB, zmmC);
+ cc.evex().vpavgb(xmmA, xmmB, xmmC);
+ cc.evex().vpavgb(ymmA, ymmB, ymmC);
+ cc.evex().vpavgb(zmmA, zmmB, zmmC);
+ cc.evex().vpavgw(xmmA, xmmB, xmmC);
+ cc.evex().vpavgw(ymmA, ymmB, ymmC);
+ cc.evex().vpavgw(zmmA, zmmB, zmmC);
+ cc.evex().vpblendmb(xmmA, xmmB, xmmC);
+ cc.evex().vpblendmb(ymmA, ymmB, ymmC);
+ cc.evex().vpblendmb(zmmA, zmmB, zmmC);
+ cc.evex().vpblendmd(xmmA, xmmB, xmmC);
+ cc.evex().vpblendmd(ymmA, ymmB, ymmC);
+ cc.evex().vpblendmd(zmmA, zmmB, zmmC);
+ cc.evex().vpblendmq(xmmA, xmmB, xmmC);
+ cc.evex().vpblendmq(ymmA, ymmB, ymmC);
+ cc.evex().vpblendmq(zmmA, zmmB, zmmC);
+ cc.evex().vpblendmw(xmmA, xmmB, xmmC);
+ cc.evex().vpblendmw(ymmA, ymmB, ymmC);
+ cc.evex().vpblendmw(zmmA, zmmB, zmmC);
+ cc.evex().vpbroadcastb(xmmA, gpd);
+ cc.evex().vpbroadcastb(xmmA, xmmB);
+ cc.evex().vpbroadcastb(ymmA, gpd);
+ cc.evex().vpbroadcastb(ymmA, xmmB);
+ cc.evex().vpbroadcastb(zmmA, gpd);
+ cc.evex().vpbroadcastb(zmmA, xmmB);
+ cc.evex().vpbroadcastd(xmmA, gpd);
+ cc.evex().vpbroadcastd(xmmA, xmmB);
+ cc.evex().vpbroadcastd(ymmA, gpd);
+ cc.evex().vpbroadcastd(ymmA, xmmB);
+ cc.evex().vpbroadcastd(zmmA, gpd);
+ cc.evex().vpbroadcastd(zmmA, xmmB);
+ cc.evex().vpbroadcastmb2q(xmmA, kB);
+ cc.evex().vpbroadcastmb2q(ymmA, kB);
+ cc.evex().vpbroadcastmb2q(zmmA, kB);
+ cc.evex().vpbroadcastmw2d(xmmA, kB);
+ cc.evex().vpbroadcastmw2d(ymmA, kB);
+ cc.evex().vpbroadcastmw2d(zmmA, kB);
+ if (cc.is64Bit()) cc.evex().vpbroadcastq(xmmA, gpq);
+ cc.evex().vpbroadcastq(xmmA, xmmB);
+ if (cc.is64Bit()) cc.evex().vpbroadcastq(ymmA, gpq);
+ cc.evex().vpbroadcastq(ymmA, xmmB);
+ if (cc.is64Bit()) cc.evex().vpbroadcastq(zmmA, gpq);
+ cc.evex().vpbroadcastq(zmmA, xmmB);
+ cc.evex().vpbroadcastw(xmmA, gpd);
+ cc.evex().vpbroadcastw(xmmA, xmmB);
+ cc.evex().vpbroadcastw(ymmA, gpd);
+ cc.evex().vpbroadcastw(ymmA, xmmB);
+ cc.evex().vpbroadcastw(zmmA, gpd);
+ cc.evex().vpbroadcastw(zmmA, xmmB);
+ cc.evex().vpcmpb(kA, xmmB, xmmC, 0);
+ cc.evex().vpcmpb(kA, ymmB, ymmC, 0);
+ cc.evex().vpcmpb(kA, zmmB, zmmC, 0);
+ cc.evex().vpcmpd(kA, xmmB, xmmC, 0);
+ cc.evex().vpcmpd(kA, ymmB, ymmC, 0);
+ cc.evex().vpcmpd(kA, zmmB, zmmC, 0);
+ cc.evex().vpcmpeqb(kA, xmmB, xmmC);
+ cc.evex().vpcmpeqb(kA, ymmB, ymmC);
+ cc.evex().vpcmpeqb(kA, zmmB, zmmC);
+ cc.evex().vpcmpeqd(kA, xmmB, xmmC);
+ cc.evex().vpcmpeqd(kA, ymmB, ymmC);
+ cc.evex().vpcmpeqd(kA, zmmB, zmmC);
+ cc.evex().vpcmpeqq(kA, xmmB, xmmC);
+ cc.evex().vpcmpeqq(kA, ymmB, ymmC);
+ cc.evex().vpcmpeqq(kA, zmmB, zmmC);
+ cc.evex().vpcmpeqw(kA, xmmB, xmmC);
+ cc.evex().vpcmpeqw(kA, ymmB, ymmC);
+ cc.evex().vpcmpeqw(kA, zmmB, zmmC);
+ cc.evex().vpcmpgtb(kA, xmmB, xmmC);
+ cc.evex().vpcmpgtb(kA, ymmB, ymmC);
+ cc.evex().vpcmpgtb(kA, zmmB, zmmC);
+ cc.evex().vpcmpgtd(kA, xmmB, xmmC);
+ cc.evex().vpcmpgtd(kA, ymmB, ymmC);
+ cc.evex().vpcmpgtd(kA, zmmB, zmmC);
+ cc.evex().vpcmpgtq(kA, xmmB, xmmC);
+ cc.evex().vpcmpgtq(kA, ymmB, ymmC);
+ cc.evex().vpcmpgtq(kA, zmmB, zmmC);
+ cc.evex().vpcmpgtw(kA, xmmB, xmmC);
+ cc.evex().vpcmpgtw(kA, ymmB, ymmC);
+ cc.evex().vpcmpgtw(kA, zmmB, zmmC);
+ cc.evex().vpcmpq(kA, xmmB, xmmC, 0);
+ cc.evex().vpcmpq(kA, ymmB, ymmC, 0);
+ cc.evex().vpcmpq(kA, zmmB, zmmC, 0);
+ cc.evex().vpcmpub(kA, xmmB, xmmC, 0);
+ cc.evex().vpcmpub(kA, ymmB, ymmC, 0);
+ cc.evex().vpcmpub(kA, zmmB, zmmC, 0);
+ cc.evex().vpcmpud(kA, xmmB, xmmC, 0);
+ cc.evex().vpcmpud(kA, ymmB, ymmC, 0);
+ cc.evex().vpcmpud(kA, zmmB, zmmC, 0);
+ cc.evex().vpcmpuq(kA, xmmB, xmmC, 0);
+ cc.evex().vpcmpuq(kA, ymmB, ymmC, 0);
+ cc.evex().vpcmpuq(kA, zmmB, zmmC, 0);
+ cc.evex().vpcmpuw(kA, xmmB, xmmC, 0);
+ cc.evex().vpcmpuw(kA, ymmB, ymmC, 0);
+ cc.evex().vpcmpuw(kA, zmmB, zmmC, 0);
+ cc.evex().vpcmpw(kA, xmmB, xmmC, 0);
+ cc.evex().vpcmpw(kA, ymmB, ymmC, 0);
+ cc.evex().vpcmpw(kA, zmmB, zmmC, 0);
+ cc.evex().vpcompressd(xmmA, xmmB);
+ cc.evex().vpcompressd(ymmA, ymmB);
+ cc.evex().vpcompressd(zmmA, zmmB);
+ cc.evex().vpcompressq(xmmA, xmmB);
+ cc.evex().vpcompressq(ymmA, ymmB);
+ cc.evex().vpcompressq(zmmA, zmmB);
+ cc.evex().vpconflictd(xmmA, xmmB);
+ cc.evex().vpconflictd(ymmA, ymmB);
+ cc.evex().vpconflictd(zmmA, zmmB);
+ cc.evex().vpconflictq(xmmA, xmmB);
+ cc.evex().vpconflictq(ymmA, ymmB);
+ cc.evex().vpconflictq(zmmA, zmmB);
+ cc.evex().vpermb(xmmA, xmmB, xmmC);
+ cc.evex().vpermb(ymmA, ymmB, ymmC);
+ cc.evex().vpermb(zmmA, zmmB, zmmC);
+ cc.evex().vpermd(ymmA, ymmB, ymmC);
+ cc.evex().vpermd(zmmA, zmmB, zmmC);
+ cc.evex().vpermi2b(xmmA, xmmB, xmmC);
+ cc.evex().vpermi2b(ymmA, ymmB, ymmC);
+ cc.evex().vpermi2b(zmmA, zmmB, zmmC);
+ cc.evex().vpermi2d(xmmA, xmmB, xmmC);
+ cc.evex().vpermi2d(ymmA, ymmB, ymmC);
+ cc.evex().vpermi2d(zmmA, zmmB, zmmC);
+ cc.evex().vpermi2pd(xmmA, xmmB, xmmC);
+ cc.evex().vpermi2pd(ymmA, ymmB, ymmC);
+ cc.evex().vpermi2pd(zmmA, zmmB, zmmC);
+ cc.evex().vpermi2ps(xmmA, xmmB, xmmC);
+ cc.evex().vpermi2ps(ymmA, ymmB, ymmC);
+ cc.evex().vpermi2ps(zmmA, zmmB, zmmC);
+ cc.evex().vpermi2q(xmmA, xmmB, xmmC);
+ cc.evex().vpermi2q(ymmA, ymmB, ymmC);
+ cc.evex().vpermi2q(zmmA, zmmB, zmmC);
+ cc.evex().vpermi2w(xmmA, xmmB, xmmC);
+ cc.evex().vpermi2w(ymmA, ymmB, ymmC);
+ cc.evex().vpermi2w(zmmA, zmmB, zmmC);
+ cc.evex().vpermilpd(xmmA, xmmB, xmmC);
+ cc.evex().vpermilpd(ymmA, ymmB, ymmC);
+ cc.evex().vpermilpd(zmmA, zmmB, zmmC);
+ cc.evex().vpermilpd(xmmA, xmmB, 0);
+ cc.evex().vpermilpd(ymmA, ymmB, 0);
+ cc.evex().vpermilpd(zmmA, zmmB, 0);
+ cc.evex().vpermilps(xmmA, xmmB, xmmC);
+ cc.evex().vpermilps(ymmA, ymmB, ymmC);
+ cc.evex().vpermilps(zmmA, zmmB, zmmC);
+ cc.evex().vpermilps(xmmA, xmmB, 0);
+ cc.evex().vpermilps(ymmA, ymmB, 0);
+ cc.evex().vpermilps(zmmA, zmmB, 0);
+ cc.evex().vpermq(ymmA, ymmB, ymmC);
+ cc.evex().vpermq(zmmA, zmmB, zmmC);
+ cc.evex().vpermq(ymmA, ymmB, 0);
+ cc.evex().vpermq(zmmA, zmmB, 0);
+ cc.evex().vpermt2b(xmmA, xmmB, xmmC);
+ cc.evex().vpermt2b(ymmA, ymmB, ymmC);
+ cc.evex().vpermt2b(zmmA, zmmB, zmmC);
+ cc.evex().vpermt2d(xmmA, xmmB, xmmC);
+ cc.evex().vpermt2d(ymmA, ymmB, ymmC);
+ cc.evex().vpermt2d(zmmA, zmmB, zmmC);
+ cc.evex().vpermt2pd(xmmA, xmmB, xmmC);
+ cc.evex().vpermt2pd(ymmA, ymmB, ymmC);
+ cc.evex().vpermt2pd(zmmA, zmmB, zmmC);
+ cc.evex().vpermt2ps(xmmA, xmmB, xmmC);
+ cc.evex().vpermt2ps(ymmA, ymmB, ymmC);
+ cc.evex().vpermt2ps(zmmA, zmmB, zmmC);
+ cc.evex().vpermt2q(xmmA, xmmB, xmmC);
+ cc.evex().vpermt2q(ymmA, ymmB, ymmC);
+ cc.evex().vpermt2q(zmmA, zmmB, zmmC);
+ cc.evex().vpermt2w(xmmA, xmmB, xmmC);
+ cc.evex().vpermt2w(ymmA, ymmB, ymmC);
+ cc.evex().vpermt2w(zmmA, zmmB, zmmC);
+ cc.evex().vpermw(xmmA, xmmB, xmmC);
+ cc.evex().vpermw(ymmA, ymmB, ymmC);
+ cc.evex().vpermw(zmmA, zmmB, zmmC);
+ cc.evex().vpexpandd(xmmA, xmmB);
+ cc.evex().vpexpandd(ymmA, ymmB);
+ cc.evex().vpexpandd(zmmA, zmmB);
+ cc.evex().vpexpandq(xmmA, xmmB);
+ cc.evex().vpexpandq(ymmA, ymmB);
+ cc.evex().vpexpandq(zmmA, zmmB);
+ cc.evex().vpextrb(gpd, xmmB, 0);
+ cc.evex().vpextrd(gpd, xmmB, 0);
+ if (cc.is64Bit()) cc.evex().vpextrq(gpq, xmmB, 0);
+ cc.evex().vpextrw(gpd, xmmB, 0);
+ cc.evex().vpinsrb(xmmA, xmmB, gpd, 0);
+ cc.evex().vpinsrd(xmmA, xmmB, gpd, 0);
+ if (cc.is64Bit()) cc.evex().vpinsrq(xmmA, xmmB, gpq, 0);
+ cc.evex().vpinsrw(xmmA, xmmB, gpd, 0);
+ cc.evex().vplzcntd(xmmA, xmmB);
+ cc.evex().vplzcntd(ymmA, ymmB);
+ cc.evex().vplzcntd(zmmA, zmmB);
+ cc.evex().vplzcntq(xmmA, xmmB);
+ cc.evex().vplzcntq(ymmA, ymmB);
+ cc.evex().vplzcntq(zmmA, zmmB);
+ cc.evex().vpmadd52huq(xmmA, xmmB, xmmC);
+ cc.evex().vpmadd52huq(ymmA, ymmB, ymmC);
+ cc.evex().vpmadd52huq(zmmA, zmmB, zmmC);
+ cc.evex().vpmadd52luq(xmmA, xmmB, xmmC);
+ cc.evex().vpmadd52luq(ymmA, ymmB, ymmC);
+ cc.evex().vpmadd52luq(zmmA, zmmB, zmmC);
+ cc.evex().vpmaddubsw(xmmA, xmmB, xmmC);
+ cc.evex().vpmaddubsw(ymmA, ymmB, ymmC);
+ cc.evex().vpmaddubsw(zmmA, zmmB, zmmC);
+ cc.evex().vpmaddwd(xmmA, xmmB, xmmC);
+ cc.evex().vpmaddwd(ymmA, ymmB, ymmC);
+ cc.evex().vpmaddwd(zmmA, zmmB, zmmC);
+ cc.evex().vpmaxsb(xmmA, xmmB, xmmC);
+ cc.evex().vpmaxsb(ymmA, ymmB, ymmC);
+ cc.evex().vpmaxsb(zmmA, zmmB, zmmC);
+ cc.evex().vpmaxsd(xmmA, xmmB, xmmC);
+ cc.evex().vpmaxsd(ymmA, ymmB, ymmC);
+ cc.evex().vpmaxsd(zmmA, zmmB, zmmC);
+ cc.evex().vpmaxsq(xmmA, xmmB, xmmC);
+ cc.evex().vpmaxsq(ymmA, ymmB, ymmC);
+ cc.evex().vpmaxsq(zmmA, zmmB, zmmC);
+ cc.evex().vpmaxsw(xmmA, xmmB, xmmC);
+ cc.evex().vpmaxsw(ymmA, ymmB, ymmC);
+ cc.evex().vpmaxsw(zmmA, zmmB, zmmC);
+ cc.evex().vpmaxub(xmmA, xmmB, xmmC);
+ cc.evex().vpmaxub(ymmA, ymmB, ymmC);
+ cc.evex().vpmaxub(zmmA, zmmB, zmmC);
+ cc.evex().vpmaxud(xmmA, xmmB, xmmC);
+ cc.evex().vpmaxud(ymmA, ymmB, ymmC);
+ cc.evex().vpmaxud(zmmA, zmmB, zmmC);
+ cc.evex().vpmaxuq(xmmA, xmmB, xmmC);
+ cc.evex().vpmaxuq(ymmA, ymmB, ymmC);
+ cc.evex().vpmaxuq(zmmA, zmmB, zmmC);
+ cc.evex().vpmaxuw(xmmA, xmmB, xmmC);
+ cc.evex().vpmaxuw(ymmA, ymmB, ymmC);
+ cc.evex().vpmaxuw(zmmA, zmmB, zmmC);
+ cc.evex().vpminsb(xmmA, xmmB, xmmC);
+ cc.evex().vpminsb(ymmA, ymmB, ymmC);
+ cc.evex().vpminsb(zmmA, zmmB, zmmC);
+ cc.evex().vpminsd(xmmA, xmmB, xmmC);
+ cc.evex().vpminsd(ymmA, ymmB, ymmC);
+ cc.evex().vpminsd(zmmA, zmmB, zmmC);
+ cc.evex().vpminsq(xmmA, xmmB, xmmC);
+ cc.evex().vpminsq(ymmA, ymmB, ymmC);
+ cc.evex().vpminsq(zmmA, zmmB, zmmC);
+ cc.evex().vpminsw(xmmA, xmmB, xmmC);
+ cc.evex().vpminsw(ymmA, ymmB, ymmC);
+ cc.evex().vpminsw(zmmA, zmmB, zmmC);
+ cc.evex().vpminub(xmmA, xmmB, xmmC);
+ cc.evex().vpminub(ymmA, ymmB, ymmC);
+ cc.evex().vpminub(zmmA, zmmB, zmmC);
+ cc.evex().vpminud(xmmA, xmmB, xmmC);
+ cc.evex().vpminud(ymmA, ymmB, ymmC);
+ cc.evex().vpminud(zmmA, zmmB, zmmC);
+ cc.evex().vpminuq(xmmA, xmmB, xmmC);
+ cc.evex().vpminuq(ymmA, ymmB, ymmC);
+ cc.evex().vpminuq(zmmA, zmmB, zmmC);
+ cc.evex().vpminuw(xmmA, xmmB, xmmC);
+ cc.evex().vpminuw(ymmA, ymmB, ymmC);
+ cc.evex().vpminuw(zmmA, zmmB, zmmC);
+ cc.evex().vpmovb2m(kA, xmmB);
+ cc.evex().vpmovb2m(kA, ymmB);
+ cc.evex().vpmovb2m(kA, zmmB);
+ cc.evex().vpmovd2m(kA, xmmB);
+ cc.evex().vpmovd2m(kA, ymmB);
+ cc.evex().vpmovd2m(kA, zmmB);
+ cc.evex().vpmovdb(xmmA, xmmB);
+ cc.evex().vpmovdb(xmmA, ymmB);
+ cc.evex().vpmovdb(xmmA, zmmB);
+ cc.evex().vpmovdw(xmmA, xmmB);
+ cc.evex().vpmovdw(xmmA, ymmB);
+ cc.evex().vpmovdw(ymmA, zmmB);
+ cc.evex().vpmovm2b(xmmA, kB);
+ cc.evex().vpmovm2b(ymmA, kB);
+ cc.evex().vpmovm2b(zmmA, kB);
+ cc.evex().vpmovm2d(xmmA, kB);
+ cc.evex().vpmovm2d(ymmA, kB);
+ cc.evex().vpmovm2d(zmmA, kB);
+ cc.evex().vpmovm2q(xmmA, kB);
+ cc.evex().vpmovm2q(ymmA, kB);
+ cc.evex().vpmovm2q(zmmA, kB);
+ cc.evex().vpmovm2w(xmmA, kB);
+ cc.evex().vpmovm2w(ymmA, kB);
+ cc.evex().vpmovm2w(zmmA, kB);
+ cc.evex().vpmovq2m(kA, xmmB);
+ cc.evex().vpmovq2m(kA, ymmB);
+ cc.evex().vpmovq2m(kA, zmmB);
+ cc.evex().vpmovqb(xmmA, xmmB);
+ cc.evex().vpmovqb(xmmA, ymmB);
+ cc.evex().vpmovqb(xmmA, zmmB);
+ cc.evex().vpmovqd(xmmA, xmmB);
+ cc.evex().vpmovqd(xmmA, ymmB);
+ cc.evex().vpmovqd(ymmA, zmmB);
+ cc.evex().vpmovqw(xmmA, xmmB);
+ cc.evex().vpmovqw(xmmA, ymmB);
+ cc.evex().vpmovqw(xmmA, zmmB);
+ cc.evex().vpmovsdb(xmmA, xmmB);
+ cc.evex().vpmovsdb(xmmA, ymmB);
+ cc.evex().vpmovsdb(xmmA, zmmB);
+ cc.evex().vpmovsdw(xmmA, xmmB);
+ cc.evex().vpmovsdw(xmmA, ymmB);
+ cc.evex().vpmovsdw(ymmA, zmmB);
+ cc.evex().vpmovsqb(xmmA, xmmB);
+ cc.evex().vpmovsqb(xmmA, ymmB);
+ cc.evex().vpmovsqb(xmmA, zmmB);
+ cc.evex().vpmovsqd(xmmA, xmmB);
+ cc.evex().vpmovsqd(xmmA, ymmB);
+ cc.evex().vpmovsqd(ymmA, zmmB);
+ cc.evex().vpmovsqw(xmmA, xmmB);
+ cc.evex().vpmovsqw(xmmA, ymmB);
+ cc.evex().vpmovsqw(xmmA, zmmB);
+ cc.evex().vpmovswb(xmmA, xmmB);
+ cc.evex().vpmovswb(xmmA, ymmB);
+ cc.evex().vpmovswb(ymmA, zmmB);
+ cc.evex().vpmovsxbd(xmmA, xmmB);
+ cc.evex().vpmovsxbd(ymmA, xmmB);
+ cc.evex().vpmovsxbd(zmmA, xmmB);
+ cc.evex().vpmovsxbq(xmmA, xmmB);
+ cc.evex().vpmovsxbq(ymmA, xmmB);
+ cc.evex().vpmovsxbq(zmmA, xmmB);
+ cc.evex().vpmovsxbw(xmmA, xmmB);
+ cc.evex().vpmovsxbw(ymmA, xmmB);
+ cc.evex().vpmovsxbw(zmmA, ymmB);
+ cc.evex().vpmovsxdq(xmmA, xmmB);
+ cc.evex().vpmovsxdq(ymmA, xmmB);
+ cc.evex().vpmovsxdq(zmmA, ymmB);
+ cc.evex().vpmovsxwd(xmmA, xmmB);
+ cc.evex().vpmovsxwd(ymmA, xmmB);
+ cc.evex().vpmovsxwd(zmmA, ymmB);
+ cc.evex().vpmovsxwq(xmmA, xmmB);
+ cc.evex().vpmovsxwq(ymmA, xmmB);
+ cc.evex().vpmovsxwq(zmmA, xmmB);
+ cc.evex().vpmovusdb(xmmA, xmmB);
+ cc.evex().vpmovusdb(xmmA, ymmB);
+ cc.evex().vpmovusdb(xmmA, zmmB);
+ cc.evex().vpmovusdw(xmmA, xmmB);
+ cc.evex().vpmovusdw(xmmA, ymmB);
+ cc.evex().vpmovusdw(ymmA, zmmB);
+ cc.evex().vpmovusqb(xmmA, xmmB);
+ cc.evex().vpmovusqb(xmmA, ymmB);
+ cc.evex().vpmovusqb(xmmA, zmmB);
+ cc.evex().vpmovusqd(xmmA, xmmB);
+ cc.evex().vpmovusqd(xmmA, ymmB);
+ cc.evex().vpmovusqd(ymmA, zmmB);
+ cc.evex().vpmovusqw(xmmA, xmmB);
+ cc.evex().vpmovusqw(xmmA, ymmB);
+ cc.evex().vpmovusqw(xmmA, zmmB);
+ cc.evex().vpmovuswb(xmmA, xmmB);
+ cc.evex().vpmovuswb(xmmA, ymmB);
+ cc.evex().vpmovuswb(ymmA, zmmB);
+ cc.evex().vpmovw2m(kA, xmmB);
+ cc.evex().vpmovw2m(kA, ymmB);
+ cc.evex().vpmovw2m(kA, zmmB);
+ cc.evex().vpmovwb(xmmA, xmmB);
+ cc.evex().vpmovwb(xmmA, ymmB);
+ cc.evex().vpmovwb(ymmA, zmmB);
+ cc.evex().vpmovzxbd(xmmA, xmmB);
+ cc.evex().vpmovzxbd(ymmA, xmmB);
+ cc.evex().vpmovzxbd(zmmA, xmmB);
+ cc.evex().vpmovzxbq(xmmA, xmmB);
+ cc.evex().vpmovzxbq(ymmA, xmmB);
+ cc.evex().vpmovzxbq(zmmA, xmmB);
+ cc.evex().vpmovzxbw(xmmA, xmmB);
+ cc.evex().vpmovzxbw(ymmA, xmmB);
+ cc.evex().vpmovzxbw(zmmA, ymmB);
+ cc.evex().vpmovzxdq(xmmA, xmmB);
+ cc.evex().vpmovzxdq(ymmA, xmmB);
+ cc.evex().vpmovzxdq(zmmA, ymmB);
+ cc.evex().vpmovzxwd(xmmA, xmmB);
+ cc.evex().vpmovzxwd(ymmA, xmmB);
+ cc.evex().vpmovzxwd(zmmA, ymmB);
+ cc.evex().vpmovzxwq(xmmA, xmmB);
+ cc.evex().vpmovzxwq(ymmA, xmmB);
+ cc.evex().vpmovzxwq(zmmA, xmmB);
+ cc.evex().vpmuldq(xmmA, xmmB, xmmC);
+ cc.evex().vpmuldq(ymmA, ymmB, ymmC);
+ cc.evex().vpmuldq(zmmA, zmmB, zmmC);
+ cc.evex().vpmulhrsw(xmmA, xmmB, xmmC);
+ cc.evex().vpmulhrsw(ymmA, ymmB, ymmC);
+ cc.evex().vpmulhrsw(zmmA, zmmB, zmmC);
+ cc.evex().vpmulhuw(xmmA, xmmB, xmmC);
+ cc.evex().vpmulhuw(ymmA, ymmB, ymmC);
+ cc.evex().vpmulhuw(zmmA, zmmB, zmmC);
+ cc.evex().vpmulhw(xmmA, xmmB, xmmC);
+ cc.evex().vpmulhw(ymmA, ymmB, ymmC);
+ cc.evex().vpmulhw(zmmA, zmmB, zmmC);
+ cc.evex().vpmulld(xmmA, xmmB, xmmC);
+ cc.evex().vpmulld(ymmA, ymmB, ymmC);
+ cc.evex().vpmulld(zmmA, zmmB, zmmC);
+ cc.evex().vpmullq(xmmA, xmmB, xmmC);
+ cc.evex().vpmullq(ymmA, ymmB, ymmC);
+ cc.evex().vpmullq(zmmA, zmmB, zmmC);
+ cc.evex().vpmullw(xmmA, xmmB, xmmC);
+ cc.evex().vpmullw(ymmA, ymmB, ymmC);
+ cc.evex().vpmullw(zmmA, zmmB, zmmC);
+ cc.evex().vpmultishiftqb(xmmA, xmmB, xmmC);
+ cc.evex().vpmultishiftqb(ymmA, ymmB, ymmC);
+ cc.evex().vpmultishiftqb(zmmA, zmmB, zmmC);
+ cc.evex().vpmuludq(xmmA, xmmB, xmmC);
+ cc.evex().vpmuludq(ymmA, ymmB, ymmC);
+ cc.evex().vpmuludq(zmmA, zmmB, zmmC);
+ cc.evex().vpopcntd(zmmA, zmmB);
+ cc.evex().vpopcntq(zmmA, zmmB);
+ cc.evex().vpord(xmmA, xmmB, xmmC);
+ cc.evex().vpord(ymmA, ymmB, ymmC);
+ cc.evex().vpord(zmmA, zmmB, zmmC);
+ cc.evex().vporq(xmmA, xmmB, xmmC);
+ cc.evex().vporq(ymmA, ymmB, ymmC);
+ cc.evex().vporq(zmmA, zmmB, zmmC);
+ cc.evex().vprold(xmmA, xmmB, 0);
+ cc.evex().vprold(ymmA, ymmB, 0);
+ cc.evex().vprold(zmmA, zmmB, 0);
+ cc.evex().vprolq(xmmA, xmmB, 0);
+ cc.evex().vprolq(ymmA, ymmB, 0);
+ cc.evex().vprolq(zmmA, zmmB, 0);
+ cc.evex().vprolvd(xmmA, xmmB, xmmC);
+ cc.evex().vprolvd(ymmA, ymmB, ymmC);
+ cc.evex().vprolvd(zmmA, zmmB, zmmC);
+ cc.evex().vprolvq(xmmA, xmmB, xmmC);
+ cc.evex().vprolvq(ymmA, ymmB, ymmC);
+ cc.evex().vprolvq(zmmA, zmmB, zmmC);
+ cc.evex().vprord(xmmA, xmmB, 0);
+ cc.evex().vprord(ymmA, ymmB, 0);
+ cc.evex().vprord(zmmA, zmmB, 0);
+ cc.evex().vprorq(xmmA, xmmB, 0);
+ cc.evex().vprorq(ymmA, ymmB, 0);
+ cc.evex().vprorq(zmmA, zmmB, 0);
+ cc.evex().vprorvd(xmmA, xmmB, xmmC);
+ cc.evex().vprorvd(ymmA, ymmB, ymmC);
+ cc.evex().vprorvd(zmmA, zmmB, zmmC);
+ cc.evex().vprorvq(xmmA, xmmB, xmmC);
+ cc.evex().vprorvq(ymmA, ymmB, ymmC);
+ cc.evex().vprorvq(zmmA, zmmB, zmmC);
+ cc.evex().vpsadbw(xmmA, xmmB, xmmC);
+ cc.evex().vpsadbw(ymmA, ymmB, ymmC);
+ cc.evex().vpsadbw(zmmA, zmmB, zmmC);
+ cc.evex().vpshufb(xmmA, xmmB, xmmC);
+ cc.evex().vpshufb(ymmA, ymmB, ymmC);
+ cc.evex().vpshufb(zmmA, zmmB, zmmC);
+ cc.evex().vpshufd(xmmA, xmmB, 0);
+ cc.evex().vpshufd(ymmA, ymmB, 0);
+ cc.evex().vpshufd(zmmA, zmmB, 0);
+ cc.evex().vpshufhw(xmmA, xmmB, 0);
+ cc.evex().vpshufhw(ymmA, ymmB, 0);
+ cc.evex().vpshufhw(zmmA, zmmB, 0);
+ cc.evex().vpshuflw(xmmA, xmmB, 0);
+ cc.evex().vpshuflw(ymmA, ymmB, 0);
+ cc.evex().vpshuflw(zmmA, zmmB, 0);
+ cc.evex().vpslld(xmmA, xmmB, xmmC);
+ cc.evex().vpslld(xmmA, xmmB, 0);
+ cc.evex().vpslld(ymmA, ymmB, xmmC);
+ cc.evex().vpslld(ymmA, ymmB, 0);
+ cc.evex().vpslld(zmmA, zmmB, xmmC);
+ cc.evex().vpslld(zmmA, zmmB, 0);
+ cc.evex().vpslldq(xmmA, xmmB, 0);
+ cc.evex().vpslldq(ymmA, ymmB, 0);
+ cc.evex().vpslldq(zmmA, zmmB, 0);
+ cc.evex().vpsllq(xmmA, xmmB, xmmC);
+ cc.evex().vpsllq(xmmA, xmmB, 0);
+ cc.evex().vpsllq(ymmA, ymmB, xmmC);
+ cc.evex().vpsllq(ymmA, ymmB, 0);
+ cc.evex().vpsllq(zmmA, zmmB, xmmC);
+ cc.evex().vpsllq(zmmA, zmmB, 0);
+ cc.evex().vpsllvd(xmmA, xmmB, xmmC);
+ cc.evex().vpsllvd(ymmA, ymmB, ymmC);
+ cc.evex().vpsllvd(zmmA, zmmB, zmmC);
+ cc.evex().vpsllvq(xmmA, xmmB, xmmC);
+ cc.evex().vpsllvq(ymmA, ymmB, ymmC);
+ cc.evex().vpsllvq(zmmA, zmmB, zmmC);
+ cc.evex().vpsllvw(xmmA, xmmB, xmmC);
+ cc.evex().vpsllvw(ymmA, ymmB, ymmC);
+ cc.evex().vpsllvw(zmmA, zmmB, zmmC);
+ cc.evex().vpsllw(xmmA, xmmB, xmmC);
+ cc.evex().vpsllw(xmmA, xmmB, 0);
+ cc.evex().vpsllw(ymmA, ymmB, xmmC);
+ cc.evex().vpsllw(ymmA, ymmB, 0);
+ cc.evex().vpsllw(zmmA, zmmB, xmmC);
+ cc.evex().vpsllw(zmmA, zmmB, 0);
+ cc.evex().vpsrad(xmmA, xmmB, xmmC);
+ cc.evex().vpsrad(xmmA, xmmB, 0);
+ cc.evex().vpsrad(ymmA, ymmB, xmmC);
+ cc.evex().vpsrad(ymmA, ymmB, 0);
+ cc.evex().vpsrad(zmmA, zmmB, xmmC);
+ cc.evex().vpsrad(zmmA, zmmB, 0);
+ cc.evex().vpsraq(xmmA, xmmB, xmmC);
+ cc.evex().vpsraq(xmmA, xmmB, 0);
+ cc.evex().vpsraq(ymmA, ymmB, xmmC);
+ cc.evex().vpsraq(ymmA, ymmB, 0);
+ cc.evex().vpsraq(zmmA, zmmB, xmmC);
+ cc.evex().vpsraq(zmmA, zmmB, 0);
+ cc.evex().vpsravd(xmmA, xmmB, xmmC);
+ cc.evex().vpsravd(ymmA, ymmB, ymmC);
+ cc.evex().vpsravd(zmmA, zmmB, zmmC);
+ cc.evex().vpsravq(xmmA, xmmB, xmmC);
+ cc.evex().vpsravq(ymmA, ymmB, ymmC);
+ cc.evex().vpsravq(zmmA, zmmB, zmmC);
+ cc.evex().vpsravw(xmmA, xmmB, xmmC);
+ cc.evex().vpsravw(ymmA, ymmB, ymmC);
+ cc.evex().vpsravw(zmmA, zmmB, zmmC);
+ cc.evex().vpsraw(xmmA, xmmB, xmmC);
+ cc.evex().vpsraw(xmmA, xmmB, 0);
+ cc.evex().vpsraw(ymmA, ymmB, xmmC);
+ cc.evex().vpsraw(ymmA, ymmB, 0);
+ cc.evex().vpsraw(zmmA, zmmB, xmmC);
+ cc.evex().vpsraw(zmmA, zmmB, 0);
+ cc.evex().vpsrld(xmmA, xmmB, xmmC);
+ cc.evex().vpsrld(xmmA, xmmB, 0);
+ cc.evex().vpsrld(ymmA, ymmB, xmmC);
+ cc.evex().vpsrld(ymmA, ymmB, 0);
+ cc.evex().vpsrld(zmmA, zmmB, xmmC);
+ cc.evex().vpsrld(zmmA, zmmB, 0);
+ cc.evex().vpsrldq(xmmA, xmmB, 0);
+ cc.evex().vpsrldq(ymmA, ymmB, 0);
+ cc.evex().vpsrldq(zmmA, zmmB, 0);
+ cc.evex().vpsrlq(xmmA, xmmB, xmmC);
+ cc.evex().vpsrlq(xmmA, xmmB, 0);
+ cc.evex().vpsrlq(ymmA, ymmB, xmmC);
+ cc.evex().vpsrlq(ymmA, ymmB, 0);
+ cc.evex().vpsrlq(zmmA, zmmB, xmmC);
+ cc.evex().vpsrlq(zmmA, zmmB, 0);
+ cc.evex().vpsrlvd(xmmA, xmmB, xmmC);
+ cc.evex().vpsrlvd(ymmA, ymmB, ymmC);
+ cc.evex().vpsrlvd(zmmA, zmmB, zmmC);
+ cc.evex().vpsrlvq(xmmA, xmmB, xmmC);
+ cc.evex().vpsrlvq(ymmA, ymmB, ymmC);
+ cc.evex().vpsrlvq(zmmA, zmmB, zmmC);
+ cc.evex().vpsrlvw(xmmA, xmmB, xmmC);
+ cc.evex().vpsrlvw(ymmA, ymmB, ymmC);
+ cc.evex().vpsrlvw(zmmA, zmmB, zmmC);
+ cc.evex().vpsrlw(xmmA, xmmB, xmmC);
+ cc.evex().vpsrlw(xmmA, xmmB, 0);
+ cc.evex().vpsrlw(ymmA, ymmB, xmmC);
+ cc.evex().vpsrlw(ymmA, ymmB, 0);
+ cc.evex().vpsrlw(zmmA, zmmB, xmmC);
+ cc.evex().vpsrlw(zmmA, zmmB, 0);
+ cc.evex().vpsubb(xmmA, xmmB, xmmC);
+ cc.evex().vpsubb(ymmA, ymmB, ymmC);
+ cc.evex().vpsubb(zmmA, zmmB, zmmC);
+ cc.evex().vpsubd(xmmA, xmmB, xmmC);
+ cc.evex().vpsubd(ymmA, ymmB, ymmC);
+ cc.evex().vpsubd(zmmA, zmmB, zmmC);
+ cc.evex().vpsubq(xmmA, xmmB, xmmC);
+ cc.evex().vpsubq(ymmA, ymmB, ymmC);
+ cc.evex().vpsubq(zmmA, zmmB, zmmC);
+ cc.evex().vpsubsb(xmmA, xmmB, xmmC);
+ cc.evex().vpsubsb(ymmA, ymmB, ymmC);
+ cc.evex().vpsubsb(zmmA, zmmB, zmmC);
+ cc.evex().vpsubsw(xmmA, xmmB, xmmC);
+ cc.evex().vpsubsw(ymmA, ymmB, ymmC);
+ cc.evex().vpsubsw(zmmA, zmmB, zmmC);
+ cc.evex().vpsubusb(xmmA, xmmB, xmmC);
+ cc.evex().vpsubusb(ymmA, ymmB, ymmC);
+ cc.evex().vpsubusb(zmmA, zmmB, zmmC);
+ cc.evex().vpsubusw(xmmA, xmmB, xmmC);
+ cc.evex().vpsubusw(ymmA, ymmB, ymmC);
+ cc.evex().vpsubusw(zmmA, zmmB, zmmC);
+ cc.evex().vpsubw(xmmA, xmmB, xmmC);
+ cc.evex().vpsubw(ymmA, ymmB, ymmC);
+ cc.evex().vpsubw(zmmA, zmmB, zmmC);
+ cc.evex().vpternlogd(xmmA, xmmB, xmmC, 0);
+ cc.evex().vpternlogd(ymmA, ymmB, ymmC, 0);
+ cc.evex().vpternlogd(zmmA, zmmB, zmmC, 0);
+ cc.evex().vpternlogq(xmmA, xmmB, xmmC, 0);
+ cc.evex().vpternlogq(ymmA, ymmB, ymmC, 0);
+ cc.evex().vpternlogq(zmmA, zmmB, zmmC, 0);
+ cc.evex().vptestmb(kA, xmmB, xmmC);
+ cc.evex().vptestmb(kA, ymmB, ymmC);
+ cc.evex().vptestmb(kA, zmmB, zmmC);
+ cc.evex().vptestmd(kA, xmmB, xmmC);
+ cc.evex().vptestmd(kA, ymmB, ymmC);
+ cc.evex().vptestmd(kA, zmmB, zmmC);
+ cc.evex().vptestmq(kA, xmmB, xmmC);
+ cc.evex().vptestmq(kA, ymmB, ymmC);
+ cc.evex().vptestmq(kA, zmmB, zmmC);
+ cc.evex().vptestmw(kA, xmmB, xmmC);
+ cc.evex().vptestmw(kA, ymmB, ymmC);
+ cc.evex().vptestmw(kA, zmmB, zmmC);
+ cc.evex().vptestnmb(kA, xmmB, xmmC);
+ cc.evex().vptestnmb(kA, ymmB, ymmC);
+ cc.evex().vptestnmb(kA, zmmB, zmmC);
+ cc.evex().vptestnmd(kA, xmmB, xmmC);
+ cc.evex().vptestnmd(kA, ymmB, ymmC);
+ cc.evex().vptestnmd(kA, zmmB, zmmC);
+ cc.evex().vptestnmq(kA, xmmB, xmmC);
+ cc.evex().vptestnmq(kA, ymmB, ymmC);
+ cc.evex().vptestnmq(kA, zmmB, zmmC);
+ cc.evex().vptestnmw(kA, xmmB, xmmC);
+ cc.evex().vptestnmw(kA, ymmB, ymmC);
+ cc.evex().vptestnmw(kA, zmmB, zmmC);
+ cc.evex().vpunpckhbw(xmmA, xmmB, xmmC);
+ cc.evex().vpunpckhbw(ymmA, ymmB, ymmC);
+ cc.evex().vpunpckhbw(zmmA, zmmB, zmmC);
+ cc.evex().vpunpckhdq(xmmA, xmmB, xmmC);
+ cc.evex().vpunpckhdq(ymmA, ymmB, ymmC);
+ cc.evex().vpunpckhdq(zmmA, zmmB, zmmC);
+ cc.evex().vpunpckhqdq(xmmA, xmmB, xmmC);
+ cc.evex().vpunpckhqdq(ymmA, ymmB, ymmC);
+ cc.evex().vpunpckhqdq(zmmA, zmmB, zmmC);
+ cc.evex().vpunpckhwd(xmmA, xmmB, xmmC);
+ cc.evex().vpunpckhwd(ymmA, ymmB, ymmC);
+ cc.evex().vpunpckhwd(zmmA, zmmB, zmmC);
+ cc.evex().vpunpcklbw(xmmA, xmmB, xmmC);
+ cc.evex().vpunpcklbw(ymmA, ymmB, ymmC);
+ cc.evex().vpunpcklbw(zmmA, zmmB, zmmC);
+ cc.evex().vpunpckldq(xmmA, xmmB, xmmC);
+ cc.evex().vpunpckldq(ymmA, ymmB, ymmC);
+ cc.evex().vpunpckldq(zmmA, zmmB, zmmC);
+ cc.evex().vpunpcklqdq(xmmA, xmmB, xmmC);
+ cc.evex().vpunpcklqdq(ymmA, ymmB, ymmC);
+ cc.evex().vpunpcklqdq(zmmA, zmmB, zmmC);
+ cc.evex().vpunpcklwd(xmmA, xmmB, xmmC);
+ cc.evex().vpunpcklwd(ymmA, ymmB, ymmC);
+ cc.evex().vpunpcklwd(zmmA, zmmB, zmmC);
+ cc.evex().vpxord(xmmA, xmmB, xmmC);
+ cc.evex().vpxord(ymmA, ymmB, ymmC);
+ cc.evex().vpxord(zmmA, zmmB, zmmC);
+ cc.evex().vpxorq(xmmA, xmmB, xmmC);
+ cc.evex().vpxorq(ymmA, ymmB, ymmC);
+ cc.evex().vpxorq(zmmA, zmmB, zmmC);
+ cc.evex().vrangepd(xmmA, xmmB, xmmC, 0);
+ cc.evex().vrangepd(ymmA, ymmB, ymmC, 0);
+ cc.evex().vrangepd(zmmA, zmmB, zmmC, 0);
+ cc.evex().vrangeps(xmmA, xmmB, xmmC, 0);
+ cc.evex().vrangeps(ymmA, ymmB, ymmC, 0);
+ cc.evex().vrangeps(zmmA, zmmB, zmmC, 0);
+ cc.evex().vrangesd(xmmA, xmmB, xmmC, 0);
+ cc.evex().vrangess(xmmA, xmmB, xmmC, 0);
+ cc.evex().vrcp14pd(xmmA, xmmB);
+ cc.evex().vrcp14pd(ymmA, ymmB);
+ cc.evex().vrcp14pd(zmmA, zmmB);
+ cc.evex().vrcp14ps(xmmA, xmmB);
+ cc.evex().vrcp14ps(ymmA, ymmB);
+ cc.evex().vrcp14ps(zmmA, zmmB);
+ cc.evex().vrcp14sd(xmmA, xmmB, xmmC);
+ cc.evex().vrcp14ss(xmmA, xmmB, xmmC);
+ cc.evex().vrcp28pd(zmmA, zmmB);
+ cc.evex().vrcp28ps(zmmA, zmmB);
+ cc.evex().vrcp28sd(xmmA, xmmB, xmmC);
+ cc.evex().vrcp28ss(xmmA, xmmB, xmmC);
+ cc.evex().vreducepd(xmmA, xmmB, 0);
+ cc.evex().vreducepd(ymmA, ymmB, 0);
+ cc.evex().vreducepd(zmmA, zmmB, 0);
+ cc.evex().vreduceps(xmmA, xmmB, 0);
+ cc.evex().vreduceps(ymmA, ymmB, 0);
+ cc.evex().vreduceps(zmmA, zmmB, 0);
+ cc.evex().vreducesd(xmmA, xmmB, xmmC, 0);
+ cc.evex().vreducess(xmmA, xmmB, xmmC, 0);
+ cc.evex().vrndscalepd(xmmA, xmmB, 0);
+ cc.evex().vrndscalepd(ymmA, ymmB, 0);
+ cc.evex().vrndscalepd(zmmA, zmmB, 0);
+ cc.evex().vrndscaleps(xmmA, xmmB, 0);
+ cc.evex().vrndscaleps(ymmA, ymmB, 0);
+ cc.evex().vrndscaleps(zmmA, zmmB, 0);
+ cc.evex().vrndscalesd(xmmA, xmmB, xmmC, 0);
+ cc.evex().vrndscaless(xmmA, xmmB, xmmC, 0);
+ cc.evex().vrsqrt14pd(xmmA, xmmB);
+ cc.evex().vrsqrt14pd(ymmA, ymmB);
+ cc.evex().vrsqrt14pd(zmmA, zmmB);
+ cc.evex().vrsqrt14ps(xmmA, xmmB);
+ cc.evex().vrsqrt14ps(ymmA, ymmB);
+ cc.evex().vrsqrt14ps(zmmA, zmmB);
+ cc.evex().vrsqrt14sd(xmmA, xmmB, xmmC);
+ cc.evex().vrsqrt14ss(xmmA, xmmB, xmmC);
+ cc.evex().vrsqrt28pd(zmmA, zmmB);
+ cc.evex().vrsqrt28ps(zmmA, zmmB);
+ cc.evex().vrsqrt28sd(xmmA, xmmB, xmmC);
+ cc.evex().vrsqrt28ss(xmmA, xmmB, xmmC);
+ cc.evex().vscalefpd(xmmA, xmmB, xmmC);
+ cc.evex().vscalefpd(ymmA, ymmB, ymmC);
+ cc.evex().vscalefpd(zmmA, zmmB, zmmC);
+ cc.evex().vscalefps(xmmA, xmmB, xmmC);
+ cc.evex().vscalefps(ymmA, ymmB, ymmC);
+ cc.evex().vscalefps(zmmA, zmmB, zmmC);
+ cc.evex().vscalefsd(xmmA, xmmB, xmmC);
+ cc.evex().vscalefss(xmmA, xmmB, xmmC);
+ cc.evex().vshuff32x4(ymmA, ymmB, ymmC, 0);
+ cc.evex().vshuff32x4(zmmA, zmmB, zmmC, 0);
+ cc.evex().vshuff64x2(ymmA, ymmB, ymmC, 0);
+ cc.evex().vshuff64x2(zmmA, zmmB, zmmC, 0);
+ cc.evex().vshufi32x4(ymmA, ymmB, ymmC, 0);
+ cc.evex().vshufi32x4(zmmA, zmmB, zmmC, 0);
+ cc.evex().vshufi64x2(ymmA, ymmB, ymmC, 0);
+ cc.evex().vshufi64x2(zmmA, zmmB, zmmC, 0);
+ cc.evex().vshufpd(xmmA, xmmB, xmmC, 0);
+ cc.evex().vshufpd(ymmA, ymmB, ymmC, 0);
+ cc.evex().vshufpd(zmmA, zmmB, zmmC, 0);
+ cc.evex().vshufps(xmmA, xmmB, xmmC, 0);
+ cc.evex().vshufps(ymmA, ymmB, ymmC, 0);
+ cc.evex().vshufps(zmmA, zmmB, zmmC, 0);
+ cc.evex().vsqrtpd(xmmA, xmmB);
+ cc.evex().vsqrtpd(ymmA, ymmB);
+ cc.evex().vsqrtpd(zmmA, zmmB);
+ cc.evex().vsqrtps(xmmA, xmmB);
+ cc.evex().vsqrtps(ymmA, ymmB);
+ cc.evex().vsqrtps(zmmA, zmmB);
+ cc.evex().vsqrtsd(xmmA, xmmB, xmmC);
+ cc.evex().vsqrtss(xmmA, xmmB, xmmC);
+ cc.evex().vsubpd(xmmA, xmmB, xmmC);
+ cc.evex().vsubpd(ymmA, ymmB, ymmC);
+ cc.evex().vsubpd(zmmA, zmmB, zmmC);
+ cc.evex().vsubps(xmmA, xmmB, xmmC);
+ cc.evex().vsubps(ymmA, ymmB, ymmC);
+ cc.evex().vsubps(zmmA, zmmB, zmmC);
+ cc.evex().vsubsd(xmmA, xmmB, xmmC);
+ cc.evex().vsubss(xmmA, xmmB, xmmC);
+ cc.evex().vucomisd(xmmA, xmmB);
+ cc.evex().vucomiss(xmmA, xmmB);
+ cc.evex().vunpckhpd(xmmA, xmmB, xmmC);
+ cc.evex().vunpckhpd(ymmA, ymmB, ymmC);
+ cc.evex().vunpckhpd(zmmA, zmmB, zmmC);
+ cc.evex().vunpckhps(xmmA, xmmB, xmmC);
+ cc.evex().vunpckhps(ymmA, ymmB, ymmC);
+ cc.evex().vunpckhps(zmmA, zmmB, zmmC);
+ cc.evex().vunpcklpd(xmmA, xmmB, xmmC);
+ cc.evex().vunpcklpd(ymmA, ymmB, ymmC);
+ cc.evex().vunpcklpd(zmmA, zmmB, zmmC);
+ cc.evex().vunpcklps(xmmA, xmmB, xmmC);
+ cc.evex().vunpcklps(ymmA, ymmB, ymmC);
+ cc.evex().vunpcklps(zmmA, zmmB, zmmC);
+ cc.evex().vxorpd(xmmA, xmmB, xmmC);
+ cc.evex().vxorpd(ymmA, ymmB, ymmC);
+ cc.evex().vxorpd(zmmA, zmmB, zmmC);
+ cc.evex().vxorps(xmmA, xmmB, xmmC);
+ cc.evex().vxorps(ymmA, ymmB, ymmC);
+ cc.evex().vxorps(zmmA, zmmB, zmmC);
+}
+
+template<typename Emitter>
+static void generateAvx512SequenceInternalRegMem(
+ Emitter& cc,
+ const x86::Gp& gp,
+ const x86::KReg& kA, const x86::KReg& kB, const x86::KReg& kC,
+ const x86::Vec& vecA, const x86::Vec& vecB, const x86::Vec& vecC, const x86::Vec& vecD) {
+
+ DebugUtils::unused(kC);
+
+ x86::Gp gpd = gp.r32();
+ x86::Gp gpq = gp.r64();
+ x86::Gp gpz = cc.is32Bit() ? gpd : gpq;
+
+ x86::Xmm xmmA = vecA.xmm();
+ x86::Xmm xmmB = vecB.xmm();
+ x86::Xmm xmmC = vecC.xmm();
+ x86::Xmm xmmD = vecD.xmm();
+
+ x86::Ymm ymmA = vecA.ymm();
+ x86::Ymm ymmB = vecB.ymm();
+ x86::Ymm ymmD = vecD.ymm();
+
+ x86::Zmm zmmA = vecA.zmm();
+ x86::Zmm zmmB = vecB.zmm();
x86::Zmm zmmD = vecD.zmm();
+ x86::Mem m = x86::ptr(gpz);
+ x86::Mem m32 = x86::dword_ptr(gpz);
+ x86::Mem m64 = x86::qword_ptr(gpz);
+ x86::Mem m128 = x86::xmmword_ptr(gpz);
+ x86::Mem m256 = x86::ymmword_ptr(gpz);
+ x86::Mem m512 = x86::zmmword_ptr(gpz);
+ x86::Mem vx_ptr = x86::ptr(gpz, xmmD);
+ x86::Mem vy_ptr = x86::ptr(gpz, ymmD);
+ x86::Mem vz_ptr = x86::ptr(gpz, zmmD);
+
cc.xor_(gpd, gpd);
cc.vxorps(xmmA, xmmA, xmmA);
cc.vxorps(xmmB, xmmB, xmmB);
cc.vxorps(xmmC, xmmC, xmmC);
cc.vxorps(xmmD, xmmD, xmmD);
- if (form == InstForm::kReg) {
- cc.kaddb(kA, kB, kC);
- cc.kaddd(kA, kB, kC);
- cc.kaddq(kA, kB, kC);
- cc.kaddw(kA, kB, kC);
- cc.kandb(kA, kB, kC);
- cc.kandd(kA, kB, kC);
- cc.kandnb(kA, kB, kC);
- cc.kandnd(kA, kB, kC);
- cc.kandnq(kA, kB, kC);
- cc.kandnw(kA, kB, kC);
- cc.kandq(kA, kB, kC);
- cc.kandw(kA, kB, kC);
- cc.kmovb(kA, kB);
- cc.kmovb(kA, gpd);
- cc.kmovb(gpd, kB);
- cc.kmovd(kA, kB);
- cc.kmovd(kA, gpd);
- cc.kmovd(gpd, kB);
- cc.kmovq(kA, kB);
- if (cc.is64Bit()) cc.kmovq(kA, gpq);
- if (cc.is64Bit()) cc.kmovq(gpq, kB);
- cc.kmovw(kA, kB);
- cc.kmovw(kA, gpd);
- cc.kmovw(gpd, kB);
- cc.knotb(kA, kB);
- cc.knotd(kA, kB);
- cc.knotq(kA, kB);
- cc.knotw(kA, kB);
- cc.korb(kA, kB, kC);
- cc.kord(kA, kB, kC);
- cc.korq(kA, kB, kC);
- cc.kortestb(kA, kB);
- cc.kortestd(kA, kB);
- cc.kortestq(kA, kB);
- cc.kortestw(kA, kB);
- cc.korw(kA, kB, kC);
- cc.kshiftlb(kA, kB, 0);
- cc.kshiftld(kA, kB, 0);
- cc.kshiftlq(kA, kB, 0);
- cc.kshiftlw(kA, kB, 0);
- cc.kshiftrb(kA, kB, 0);
- cc.kshiftrd(kA, kB, 0);
- cc.kshiftrq(kA, kB, 0);
- cc.kshiftrw(kA, kB, 0);
- cc.ktestb(kA, kB);
- cc.ktestd(kA, kB);
- cc.ktestq(kA, kB);
- cc.ktestw(kA, kB);
- cc.kunpckbw(kA, kB, kC);
- cc.kunpckdq(kA, kB, kC);
- cc.kunpckwd(kA, kB, kC);
- cc.kxnorb(kA, kB, kC);
- cc.kxnord(kA, kB, kC);
- cc.kxnorq(kA, kB, kC);
- cc.kxnorw(kA, kB, kC);
- cc.kxorb(kA, kB, kC);
- cc.kxord(kA, kB, kC);
- cc.kxorq(kA, kB, kC);
- cc.kxorw(kA, kB, kC);
- cc.nop();
-
- cc.evex().vaddpd(xmmA, xmmB, xmmC);
- cc.evex().vaddpd(ymmA, ymmB, ymmC);
- cc.evex().vaddpd(zmmA, zmmB, zmmC);
- cc.evex().vaddps(xmmA, xmmB, xmmC);
- cc.evex().vaddps(ymmA, ymmB, ymmC);
- cc.evex().vaddps(zmmA, zmmB, zmmC);
- cc.evex().vaddsd(xmmA, xmmB, xmmC);
- cc.evex().vaddss(xmmA, xmmB, xmmC);
- cc.evex().valignd(xmmA, xmmB, xmmC, 0);
- cc.evex().valignd(ymmA, ymmB, ymmC, 0);
- cc.evex().valignd(zmmA, zmmB, zmmC, 0);
- cc.evex().valignq(xmmA, xmmB, xmmC, 0);
- cc.evex().valignq(ymmA, ymmB, ymmC, 0);
- cc.evex().valignq(zmmA, zmmB, zmmC, 0);
- cc.evex().vandnpd(xmmA, xmmB, xmmC);
- cc.evex().vandnpd(ymmA, ymmB, ymmC);
- cc.evex().vandnpd(zmmA, zmmB, zmmC);
- cc.evex().vandnps(xmmA, xmmB, xmmC);
- cc.evex().vandnps(ymmA, ymmB, ymmC);
- cc.evex().vandnps(zmmA, zmmB, zmmC);
- cc.evex().vandpd(xmmA, xmmB, xmmC);
- cc.evex().vandpd(ymmA, ymmB, ymmC);
- cc.evex().vandpd(zmmA, zmmB, zmmC);
- cc.evex().vandps(xmmA, xmmB, xmmC);
- cc.evex().vandps(ymmA, ymmB, ymmC);
- cc.evex().vandps(zmmA, zmmB, zmmC);
- cc.evex().vblendmpd(xmmA, xmmB, xmmC);
- cc.evex().vblendmpd(ymmA, ymmB, ymmC);
- cc.evex().vblendmpd(zmmA, zmmB, zmmC);
- cc.evex().vblendmps(xmmA, xmmB, xmmC);
- cc.evex().vblendmps(ymmA, ymmB, ymmC);
- cc.evex().vblendmps(zmmA, zmmB, zmmC);
- cc.evex().vbroadcastf32x2(ymmA, xmmB);
- cc.evex().vbroadcastf32x2(zmmA, xmmB);
- cc.evex().vbroadcasti32x2(xmmA, xmmB);
- cc.evex().vbroadcasti32x2(ymmA, xmmB);
- cc.evex().vbroadcasti32x2(zmmA, xmmB);
- cc.evex().vbroadcastsd(ymmA, xmmB);
- cc.evex().vbroadcastsd(zmmA, xmmB);
- cc.evex().vbroadcastss(xmmA, xmmB);
- cc.evex().vbroadcastss(ymmA, xmmB);
- cc.evex().vbroadcastss(zmmA, xmmB);
- cc.evex().vcmppd(kA, xmmB, xmmC, 0);
- cc.evex().vcmppd(kA, ymmB, ymmC, 0);
- cc.evex().vcmppd(kA, zmmB, zmmC, 0);
- cc.evex().vcmpps(kA, xmmB, xmmC, 0);
- cc.evex().vcmpps(kA, ymmB, ymmC, 0);
- cc.evex().vcmpps(kA, zmmB, zmmC, 0);
- cc.evex().vcmpsd(kA, xmmB, xmmC, 0);
- cc.evex().vcmpss(kA, xmmB, xmmC, 0);
- cc.evex().vcomisd(xmmA, xmmB);
- cc.evex().vcomiss(xmmA, xmmB);
- cc.evex().vcompresspd(xmmA, xmmB);
- cc.evex().vcompresspd(ymmA, ymmB);
- cc.evex().vcompresspd(zmmA, zmmB);
- cc.evex().vcompressps(xmmA, xmmB);
- cc.evex().vcompressps(ymmA, ymmB);
- cc.evex().vcompressps(zmmA, zmmB);
- cc.evex().vcvtdq2pd(xmmA, xmmB);
- cc.evex().vcvtdq2pd(ymmA, xmmB);
- cc.evex().vcvtdq2pd(zmmA, ymmB);
- cc.evex().vcvtdq2ps(xmmA, xmmB);
- cc.evex().vcvtdq2ps(ymmA, ymmB);
- cc.evex().vcvtdq2ps(zmmA, zmmB);
- cc.evex().vcvtpd2dq(xmmA, xmmB);
- cc.evex().vcvtpd2dq(xmmA, ymmB);
- cc.evex().vcvtpd2dq(ymmA, zmmB);
- cc.evex().vcvtpd2qq(xmmA, xmmB);
- cc.evex().vcvtpd2qq(ymmA, ymmB);
- cc.evex().vcvtpd2qq(zmmA, zmmB);
- cc.evex().vcvtpd2udq(xmmA, xmmB);
- cc.evex().vcvtpd2udq(xmmA, ymmB);
- cc.evex().vcvtpd2udq(ymmA, zmmB);
- cc.evex().vcvtpd2uqq(xmmA, xmmB);
- cc.evex().vcvtpd2uqq(ymmA, ymmB);
- cc.evex().vcvtpd2uqq(zmmA, zmmB);
- cc.evex().vcvtph2ps(xmmA, xmmB);
- cc.evex().vcvtph2ps(ymmA, xmmB);
- cc.evex().vcvtph2ps(zmmA, ymmB);
- cc.evex().vcvtps2dq(xmmA, xmmB);
- cc.evex().vcvtps2dq(ymmA, ymmB);
- cc.evex().vcvtps2dq(zmmA, zmmB);
- cc.evex().vcvtps2pd(xmmA, xmmB);
- cc.evex().vcvtps2pd(ymmA, xmmB);
- cc.evex().vcvtps2pd(zmmA, ymmB);
- cc.evex().vcvtps2ph(xmmA, xmmB, 0);
- cc.evex().vcvtps2ph(xmmA, ymmB, 0);
- cc.evex().vcvtps2ph(ymmA, zmmB, 0);
- cc.evex().vcvtps2qq(xmmA, xmmB);
- cc.evex().vcvtps2qq(ymmA, xmmB);
- cc.evex().vcvtps2qq(zmmA, ymmB);
- cc.evex().vcvtps2udq(xmmA, xmmB);
- cc.evex().vcvtps2udq(ymmA, ymmB);
- cc.evex().vcvtps2udq(zmmA, zmmB);
- cc.evex().vcvtps2uqq(xmmA, xmmB);
- cc.evex().vcvtps2uqq(ymmA, xmmB);
- cc.evex().vcvtps2uqq(zmmA, ymmB);
- cc.evex().vcvtqq2pd(xmmA, xmmB);
- cc.evex().vcvtqq2pd(ymmA, ymmB);
- cc.evex().vcvtqq2pd(zmmA, zmmB);
- cc.evex().vcvtqq2ps(xmmA, xmmB);
- cc.evex().vcvtqq2ps(xmmA, ymmB);
- cc.evex().vcvtqq2ps(ymmA, zmmB);
- cc.evex().vcvtsd2si(gpd, xmmB);
- if (cc.is64Bit()) cc.evex().vcvtsd2si(gpq, xmmB);
- cc.evex().vcvtsd2ss(xmmA, xmmB, xmmC);
- cc.evex().vcvtsd2usi(gpd, xmmB);
- if (cc.is64Bit()) cc.evex().vcvtsd2usi(gpq, xmmB);
- cc.evex().vcvtsi2sd(xmmA, xmmB, gpd);
- if (cc.is64Bit()) cc.evex().vcvtsi2sd(xmmA, xmmB, gpq);
- cc.evex().vcvtsi2ss(xmmA, xmmB, gpd);
- if (cc.is64Bit()) cc.evex().vcvtsi2ss(xmmA, xmmB, gpq);
- cc.evex().vcvtss2sd(xmmA, xmmB, xmmC);
- cc.evex().vcvtss2si(gpd, xmmB);
- if (cc.is64Bit()) cc.evex().vcvtss2si(gpq, xmmB);
- cc.evex().vcvtss2usi(gpd, xmmB);
- if (cc.is64Bit()) cc.evex().vcvtss2usi(gpq, xmmB);
- cc.evex().vcvttpd2dq(xmmA, xmmB);
- cc.evex().vcvttpd2dq(xmmA, ymmB);
- cc.evex().vcvttpd2dq(ymmA, zmmB);
- cc.evex().vcvttpd2qq(xmmA, xmmB);
- cc.evex().vcvttpd2qq(ymmA, ymmB);
- cc.evex().vcvttpd2qq(zmmA, zmmB);
- cc.evex().vcvttpd2udq(xmmA, xmmB);
- cc.evex().vcvttpd2udq(xmmA, ymmB);
- cc.evex().vcvttpd2udq(ymmA, zmmB);
- cc.evex().vcvttpd2uqq(xmmA, xmmB);
- cc.evex().vcvttpd2uqq(ymmA, ymmB);
- cc.evex().vcvttpd2uqq(zmmA, zmmB);
- cc.evex().vcvttps2dq(xmmA, xmmB);
- cc.evex().vcvttps2dq(ymmA, ymmB);
- cc.evex().vcvttps2dq(zmmA, zmmB);
- cc.evex().vcvttps2qq(xmmA, xmmB);
- cc.evex().vcvttps2qq(ymmA, xmmB);
- cc.evex().vcvttps2qq(zmmA, ymmB);
- cc.evex().vcvttps2udq(xmmA, xmmB);
- cc.evex().vcvttps2udq(ymmA, ymmB);
- cc.evex().vcvttps2udq(zmmA, zmmB);
- cc.evex().vcvttps2uqq(xmmA, xmmB);
- cc.evex().vcvttps2uqq(ymmA, xmmB);
- cc.evex().vcvttps2uqq(zmmA, ymmB);
- cc.evex().vcvttsd2si(gpd, xmmB);
- if (cc.is64Bit()) cc.evex().vcvttsd2si(gpq, xmmB);
- cc.evex().vcvttsd2usi(gpd, xmmB);
- if (cc.is64Bit()) cc.evex().vcvttsd2usi(gpq, xmmB);
- cc.evex().vcvttss2si(gpd, xmmB);
- if (cc.is64Bit()) cc.evex().vcvttss2si(gpq, xmmB);
- cc.evex().vcvttss2usi(gpd, xmmB);
- if (cc.is64Bit()) cc.evex().vcvttss2usi(gpq, xmmB);
- cc.evex().vcvtudq2pd(xmmA, xmmB);
- cc.evex().vcvtudq2pd(ymmA, xmmB);
- cc.evex().vcvtudq2pd(zmmA, ymmB);
- cc.evex().vcvtudq2ps(xmmA, xmmB);
- cc.evex().vcvtudq2ps(ymmA, ymmB);
- cc.evex().vcvtudq2ps(zmmA, zmmB);
- cc.evex().vcvtuqq2pd(xmmA, xmmB);
- cc.evex().vcvtuqq2pd(ymmA, ymmB);
- cc.evex().vcvtuqq2pd(zmmA, zmmB);
- cc.evex().vcvtuqq2ps(xmmA, xmmB);
- cc.evex().vcvtuqq2ps(xmmA, ymmB);
- cc.evex().vcvtuqq2ps(ymmA, zmmB);
- cc.evex().vcvtusi2sd(xmmA, xmmB, gpd);
- if (cc.is64Bit()) cc.evex().vcvtusi2sd(xmmA, xmmB, gpq);
- cc.evex().vcvtusi2ss(xmmA, xmmB, gpd);
- if (cc.is64Bit()) cc.evex().vcvtusi2ss(xmmA, xmmB, gpq);
- cc.evex().vdbpsadbw(xmmA, xmmB, xmmC, 0);
- cc.evex().vdbpsadbw(ymmA, ymmB, ymmC, 0);
- cc.evex().vdbpsadbw(zmmA, zmmB, zmmC, 0);
- cc.evex().vdivpd(xmmA, xmmB, xmmC);
- cc.evex().vdivpd(ymmA, ymmB, ymmC);
- cc.evex().vdivpd(zmmA, zmmB, zmmC);
- cc.evex().vdivps(xmmA, xmmB, xmmC);
- cc.evex().vdivps(ymmA, ymmB, ymmC);
- cc.evex().vdivps(zmmA, zmmB, zmmC);
- cc.evex().vdivsd(xmmA, xmmB, xmmC);
- cc.evex().vdivss(xmmA, xmmB, xmmC);
- cc.evex().vexp2pd(zmmA, zmmB);
- cc.evex().vexp2ps(zmmA, zmmB);
- cc.evex().vexpandpd(xmmA, xmmB);
- cc.evex().vexpandpd(ymmA, ymmB);
- cc.evex().vexpandpd(zmmA, zmmB);
- cc.evex().vexpandps(xmmA, xmmB);
- cc.evex().vexpandps(ymmA, ymmB);
- cc.evex().vexpandps(zmmA, zmmB);
- cc.evex().vextractf32x4(xmmA, ymmB, 0);
- cc.evex().vextractf32x4(xmmA, zmmB, 0);
- cc.evex().vextractf32x8(ymmA, zmmB, 0);
- cc.evex().vextractf64x2(xmmA, ymmB, 0);
- cc.evex().vextractf64x2(xmmA, zmmB, 0);
- cc.evex().vextractf64x4(ymmA, zmmB, 0);
- cc.evex().vextracti32x4(xmmA, ymmB, 0);
- cc.evex().vextracti32x4(xmmA, zmmB, 0);
- cc.evex().vextracti32x8(ymmA, zmmB, 0);
- cc.evex().vextracti64x2(xmmA, ymmB, 0);
- cc.evex().vextracti64x2(xmmA, zmmB, 0);
- cc.evex().vextracti64x4(ymmA, zmmB, 0);
- cc.evex().vextractps(gpd, xmmB, 0);
- cc.evex().vfixupimmpd(xmmA, xmmB, xmmC, 0);
- cc.evex().vfixupimmpd(ymmA, ymmB, ymmC, 0);
- cc.evex().vfixupimmpd(zmmA, zmmB, zmmC, 0);
- cc.evex().vfixupimmps(xmmA, xmmB, xmmC, 0);
- cc.evex().vfixupimmps(ymmA, ymmB, ymmC, 0);
- cc.evex().vfixupimmps(zmmA, zmmB, zmmC, 0);
- cc.evex().vfixupimmsd(xmmA, xmmB, xmmC, 0);
- cc.evex().vfixupimmss(xmmA, xmmB, xmmC, 0);
- cc.evex().vfmadd132pd(xmmA, xmmB, xmmC);
- cc.evex().vfmadd132pd(ymmA, ymmB, ymmC);
- cc.evex().vfmadd132pd(zmmA, zmmB, zmmC);
- cc.evex().vfmadd132ps(xmmA, xmmB, xmmC);
- cc.evex().vfmadd132ps(ymmA, ymmB, ymmC);
- cc.evex().vfmadd132ps(zmmA, zmmB, zmmC);
- cc.evex().vfmadd132sd(xmmA, xmmB, xmmC);
- cc.evex().vfmadd132ss(xmmA, xmmB, xmmC);
- cc.evex().vfmadd213pd(xmmA, xmmB, xmmC);
- cc.evex().vfmadd213pd(ymmA, ymmB, ymmC);
- cc.evex().vfmadd213pd(zmmA, zmmB, zmmC);
- cc.evex().vfmadd213ps(xmmA, xmmB, xmmC);
- cc.evex().vfmadd213ps(ymmA, ymmB, ymmC);
- cc.evex().vfmadd213ps(zmmA, zmmB, zmmC);
- cc.evex().vfmadd213sd(xmmA, xmmB, xmmC);
- cc.evex().vfmadd213ss(xmmA, xmmB, xmmC);
- cc.evex().vfmadd231pd(xmmA, xmmB, xmmC);
- cc.evex().vfmadd231pd(ymmA, ymmB, ymmC);
- cc.evex().vfmadd231pd(zmmA, zmmB, zmmC);
- cc.evex().vfmadd231ps(xmmA, xmmB, xmmC);
- cc.evex().vfmadd231ps(ymmA, ymmB, ymmC);
- cc.evex().vfmadd231ps(zmmA, zmmB, zmmC);
- cc.evex().vfmadd231sd(xmmA, xmmB, xmmC);
- cc.evex().vfmadd231ss(xmmA, xmmB, xmmC);
- cc.evex().vfmaddsub132pd(xmmA, xmmB, xmmC);
- cc.evex().vfmaddsub132pd(ymmA, ymmB, ymmC);
- cc.evex().vfmaddsub132pd(zmmA, zmmB, zmmC);
- cc.evex().vfmaddsub132ps(xmmA, xmmB, xmmC);
- cc.evex().vfmaddsub132ps(ymmA, ymmB, ymmC);
- cc.evex().vfmaddsub132ps(zmmA, zmmB, zmmC);
- cc.evex().vfmaddsub213pd(xmmA, xmmB, xmmC);
- cc.evex().vfmaddsub213pd(ymmA, ymmB, ymmC);
- cc.evex().vfmaddsub213pd(zmmA, zmmB, zmmC);
- cc.evex().vfmaddsub213ps(xmmA, xmmB, xmmC);
- cc.evex().vfmaddsub213ps(ymmA, ymmB, ymmC);
- cc.evex().vfmaddsub213ps(zmmA, zmmB, zmmC);
- cc.evex().vfmaddsub231pd(xmmA, xmmB, xmmC);
- cc.evex().vfmaddsub231pd(ymmA, ymmB, ymmC);
- cc.evex().vfmaddsub231pd(zmmA, zmmB, zmmC);
- cc.evex().vfmaddsub231ps(xmmA, xmmB, xmmC);
- cc.evex().vfmaddsub231ps(ymmA, ymmB, ymmC);
- cc.evex().vfmaddsub231ps(zmmA, zmmB, zmmC);
- cc.evex().vfmsub132pd(xmmA, xmmB, xmmC);
- cc.evex().vfmsub132pd(ymmA, ymmB, ymmC);
- cc.evex().vfmsub132pd(zmmA, zmmB, zmmC);
- cc.evex().vfmsub132ps(xmmA, xmmB, xmmC);
- cc.evex().vfmsub132ps(ymmA, ymmB, ymmC);
- cc.evex().vfmsub132ps(zmmA, zmmB, zmmC);
- cc.evex().vfmsub132sd(xmmA, xmmB, xmmC);
- cc.evex().vfmsub132ss(xmmA, xmmB, xmmC);
- cc.evex().vfmsub213pd(xmmA, xmmB, xmmC);
- cc.evex().vfmsub213pd(ymmA, ymmB, ymmC);
- cc.evex().vfmsub213pd(zmmA, zmmB, zmmC);
- cc.evex().vfmsub213ps(xmmA, xmmB, xmmC);
- cc.evex().vfmsub213ps(ymmA, ymmB, ymmC);
- cc.evex().vfmsub213ps(zmmA, zmmB, zmmC);
- cc.evex().vfmsub213sd(xmmA, xmmB, xmmC);
- cc.evex().vfmsub213ss(xmmA, xmmB, xmmC);
- cc.evex().vfmsub231pd(xmmA, xmmB, xmmC);
- cc.evex().vfmsub231pd(ymmA, ymmB, ymmC);
- cc.evex().vfmsub231pd(zmmA, zmmB, zmmC);
- cc.evex().vfmsub231ps(xmmA, xmmB, xmmC);
- cc.evex().vfmsub231ps(ymmA, ymmB, ymmC);
- cc.evex().vfmsub231ps(zmmA, zmmB, zmmC);
- cc.evex().vfmsub231sd(xmmA, xmmB, xmmC);
- cc.evex().vfmsub231ss(xmmA, xmmB, xmmC);
- cc.evex().vfmsubadd132pd(xmmA, xmmB, xmmC);
- cc.evex().vfmsubadd132pd(ymmA, ymmB, ymmC);
- cc.evex().vfmsubadd132pd(zmmA, zmmB, zmmC);
- cc.evex().vfmsubadd132ps(xmmA, xmmB, xmmC);
- cc.evex().vfmsubadd132ps(ymmA, ymmB, ymmC);
- cc.evex().vfmsubadd132ps(zmmA, zmmB, zmmC);
- cc.evex().vfmsubadd213pd(xmmA, xmmB, xmmC);
- cc.evex().vfmsubadd213pd(ymmA, ymmB, ymmC);
- cc.evex().vfmsubadd213pd(zmmA, zmmB, zmmC);
- cc.evex().vfmsubadd213ps(xmmA, xmmB, xmmC);
- cc.evex().vfmsubadd213ps(ymmA, ymmB, ymmC);
- cc.evex().vfmsubadd213ps(zmmA, zmmB, zmmC);
- cc.evex().vfmsubadd231pd(xmmA, xmmB, xmmC);
- cc.evex().vfmsubadd231pd(ymmA, ymmB, ymmC);
- cc.evex().vfmsubadd231pd(zmmA, zmmB, zmmC);
- cc.evex().vfmsubadd231ps(xmmA, xmmB, xmmC);
- cc.evex().vfmsubadd231ps(ymmA, ymmB, ymmC);
- cc.evex().vfmsubadd231ps(zmmA, zmmB, zmmC);
- cc.evex().vfnmadd132pd(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd132pd(ymmA, ymmB, ymmC);
- cc.evex().vfnmadd132pd(zmmA, zmmB, zmmC);
- cc.evex().vfnmadd132ps(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd132ps(ymmA, ymmB, ymmC);
- cc.evex().vfnmadd132ps(zmmA, zmmB, zmmC);
- cc.evex().vfnmadd132sd(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd132ss(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd213pd(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd213pd(ymmA, ymmB, ymmC);
- cc.evex().vfnmadd213pd(zmmA, zmmB, zmmC);
- cc.evex().vfnmadd213ps(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd213ps(ymmA, ymmB, ymmC);
- cc.evex().vfnmadd213ps(zmmA, zmmB, zmmC);
- cc.evex().vfnmadd213sd(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd213ss(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd231pd(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd231pd(ymmA, ymmB, ymmC);
- cc.evex().vfnmadd231pd(zmmA, zmmB, zmmC);
- cc.evex().vfnmadd231ps(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd231ps(ymmA, ymmB, ymmC);
- cc.evex().vfnmadd231ps(zmmA, zmmB, zmmC);
- cc.evex().vfnmadd231sd(xmmA, xmmB, xmmC);
- cc.evex().vfnmadd231ss(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub132pd(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub132pd(ymmA, ymmB, ymmC);
- cc.evex().vfnmsub132pd(zmmA, zmmB, zmmC);
- cc.evex().vfnmsub132ps(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub132ps(ymmA, ymmB, ymmC);
- cc.evex().vfnmsub132ps(zmmA, zmmB, zmmC);
- cc.evex().vfnmsub132sd(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub132ss(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub213pd(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub213pd(ymmA, ymmB, ymmC);
- cc.evex().vfnmsub213pd(zmmA, zmmB, zmmC);
- cc.evex().vfnmsub213ps(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub213ps(ymmA, ymmB, ymmC);
- cc.evex().vfnmsub213ps(zmmA, zmmB, zmmC);
- cc.evex().vfnmsub213sd(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub213ss(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub231pd(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub231pd(ymmA, ymmB, ymmC);
- cc.evex().vfnmsub231pd(zmmA, zmmB, zmmC);
- cc.evex().vfnmsub231ps(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub231ps(ymmA, ymmB, ymmC);
- cc.evex().vfnmsub231ps(zmmA, zmmB, zmmC);
- cc.evex().vfnmsub231sd(xmmA, xmmB, xmmC);
- cc.evex().vfnmsub231ss(xmmA, xmmB, xmmC);
- cc.evex().vfpclasspd(kA, xmmB, 0);
- cc.evex().vfpclasspd(kA, ymmB, 0);
- cc.evex().vfpclasspd(kA, zmmB, 0);
- cc.evex().vfpclassps(kA, xmmB, 0);
- cc.evex().vfpclassps(kA, ymmB, 0);
- cc.evex().vfpclassps(kA, zmmB, 0);
- cc.evex().vfpclasssd(kA, xmmB, 0);
- cc.evex().vfpclassss(kA, xmmB, 0);
- cc.evex().vgetexppd(xmmA, xmmB);
- cc.evex().vgetexppd(ymmA, ymmB);
- cc.evex().vgetexppd(zmmA, zmmB);
- cc.evex().vgetexpps(xmmA, xmmB);
- cc.evex().vgetexpps(ymmA, ymmB);
- cc.evex().vgetexpps(zmmA, zmmB);
- cc.evex().vgetexpsd(xmmA, xmmB, xmmC);
- cc.evex().vgetexpss(xmmA, xmmB, xmmC);
- cc.evex().vgetmantpd(xmmA, xmmB, 0);
- cc.evex().vgetmantpd(ymmA, ymmB, 0);
- cc.evex().vgetmantpd(zmmA, zmmB, 0);
- cc.evex().vgetmantps(xmmA, xmmB, 0);
- cc.evex().vgetmantps(ymmA, ymmB, 0);
- cc.evex().vgetmantps(zmmA, zmmB, 0);
- cc.evex().vgetmantsd(xmmA, xmmB, xmmC, 0);
- cc.evex().vgetmantss(xmmA, xmmB, xmmC, 0);
- cc.evex().vinsertf32x4(ymmA, ymmB, xmmC, 0);
- cc.evex().vinsertf32x4(zmmA, zmmB, xmmC, 0);
- cc.evex().vinsertf32x8(zmmA, zmmB, ymmC, 0);
- cc.evex().vinsertf64x2(ymmA, ymmB, xmmC, 0);
- cc.evex().vinsertf64x2(zmmA, zmmB, xmmC, 0);
- cc.evex().vinsertf64x4(zmmA, zmmB, ymmC, 0);
- cc.evex().vinserti32x4(ymmA, ymmB, xmmC, 0);
- cc.evex().vinserti32x4(zmmA, zmmB, xmmC, 0);
- cc.evex().vinserti32x8(zmmA, zmmB, ymmC, 0);
- cc.evex().vinserti64x2(ymmA, ymmB, xmmC, 0);
- cc.evex().vinserti64x2(zmmA, zmmB, xmmC, 0);
- cc.evex().vinserti64x4(zmmA, zmmB, ymmC, 0);
- cc.evex().vinsertps(xmmA, xmmB, xmmC, 0);
- cc.evex().vmaxpd(xmmA, xmmB, xmmC);
- cc.evex().vmaxpd(ymmA, ymmB, ymmC);
- cc.evex().vmaxpd(zmmA, zmmB, zmmC);
- cc.evex().vmaxps(xmmA, xmmB, xmmC);
- cc.evex().vmaxps(ymmA, ymmB, ymmC);
- cc.evex().vmaxps(zmmA, zmmB, zmmC);
- cc.evex().vmaxsd(xmmA, xmmB, xmmC);
- cc.evex().vmaxss(xmmA, xmmB, xmmC);
- cc.evex().vminpd(xmmA, xmmB, xmmC);
- cc.evex().vminpd(ymmA, ymmB, ymmC);
- cc.evex().vminpd(zmmA, zmmB, zmmC);
- cc.evex().vminps(xmmA, xmmB, xmmC);
- cc.evex().vminps(ymmA, ymmB, ymmC);
- cc.evex().vminps(zmmA, zmmB, zmmC);
- cc.evex().vminsd(xmmA, xmmB, xmmC);
- cc.evex().vminss(xmmA, xmmB, xmmC);
- cc.evex().vmovapd(xmmA, xmmB);
- cc.evex().vmovapd(xmmA, xmmB);
- cc.evex().vmovapd(ymmA, ymmB);
- cc.evex().vmovapd(ymmA, ymmB);
- cc.evex().vmovapd(zmmA, zmmB);
- cc.evex().vmovapd(zmmA, zmmB);
- cc.evex().vmovaps(xmmA, xmmB);
- cc.evex().vmovaps(xmmA, xmmB);
- cc.evex().vmovaps(ymmA, ymmB);
- cc.evex().vmovaps(ymmA, ymmB);
- cc.evex().vmovaps(zmmA, zmmB);
- cc.evex().vmovaps(zmmA, zmmB);
- cc.evex().vmovd(gpd, xmmB);
- cc.evex().vmovd(xmmA, gpd);
- cc.evex().vmovddup(xmmA, xmmB);
- cc.evex().vmovddup(ymmA, ymmB);
- cc.evex().vmovddup(zmmA, zmmB);
- cc.evex().vmovdqa32(xmmA, xmmB);
- cc.evex().vmovdqa32(xmmA, xmmB);
- cc.evex().vmovdqa32(ymmA, ymmB);
- cc.evex().vmovdqa32(ymmA, ymmB);
- cc.evex().vmovdqa32(zmmA, zmmB);
- cc.evex().vmovdqa32(zmmA, zmmB);
- cc.evex().vmovdqa64(xmmA, xmmB);
- cc.evex().vmovdqa64(xmmA, xmmB);
- cc.evex().vmovdqa64(ymmA, ymmB);
- cc.evex().vmovdqa64(ymmA, ymmB);
- cc.evex().vmovdqa64(zmmA, zmmB);
- cc.evex().vmovdqa64(zmmA, zmmB);
- cc.evex().vmovdqu16(xmmA, xmmB);
- cc.evex().vmovdqu16(xmmA, xmmB);
- cc.evex().vmovdqu16(ymmA, ymmB);
- cc.evex().vmovdqu16(ymmA, ymmB);
- cc.evex().vmovdqu16(zmmA, zmmB);
- cc.evex().vmovdqu16(zmmA, zmmB);
- cc.evex().vmovdqu32(xmmA, xmmB);
- cc.evex().vmovdqu32(xmmA, xmmB);
- cc.evex().vmovdqu32(ymmA, ymmB);
- cc.evex().vmovdqu32(ymmA, ymmB);
- cc.evex().vmovdqu32(zmmA, zmmB);
- cc.evex().vmovdqu32(zmmA, zmmB);
- cc.evex().vmovdqu64(xmmA, xmmB);
- cc.evex().vmovdqu64(xmmA, xmmB);
- cc.evex().vmovdqu64(ymmA, ymmB);
- cc.evex().vmovdqu64(ymmA, ymmB);
- cc.evex().vmovdqu64(zmmA, zmmB);
- cc.evex().vmovdqu64(zmmA, zmmB);
- cc.evex().vmovdqu8(xmmA, xmmB);
- cc.evex().vmovdqu8(xmmA, xmmB);
- cc.evex().vmovdqu8(ymmA, ymmB);
- cc.evex().vmovdqu8(ymmA, ymmB);
- cc.evex().vmovdqu8(zmmA, zmmB);
- cc.evex().vmovdqu8(zmmA, zmmB);
- cc.evex().vmovhlps(xmmA, xmmB, xmmC);
- if (cc.is64Bit()) cc.evex().vmovq(gpq, xmmB);
- if (cc.is64Bit()) cc.evex().vmovq(xmmA, gpq);
- cc.evex().vmovq(xmmA, xmmB);
- cc.evex().vmovsd(xmmA, xmmB, xmmC);
- cc.evex().vmovshdup(xmmA, xmmB);
- cc.evex().vmovshdup(ymmA, ymmB);
- cc.evex().vmovshdup(zmmA, zmmB);
- cc.evex().vmovsldup(xmmA, xmmB);
- cc.evex().vmovsldup(ymmA, ymmB);
- cc.evex().vmovsldup(zmmA, zmmB);
- cc.evex().vmovss(xmmA, xmmB, xmmC);
- cc.evex().vmovupd(xmmA, xmmB);
- cc.evex().vmovupd(xmmA, xmmB);
- cc.evex().vmovupd(ymmA, ymmB);
- cc.evex().vmovupd(ymmA, ymmB);
- cc.evex().vmovupd(zmmA, zmmB);
- cc.evex().vmovupd(zmmA, zmmB);
- cc.evex().vmovups(xmmA, xmmB);
- cc.evex().vmovups(xmmA, xmmB);
- cc.evex().vmovups(ymmA, ymmB);
- cc.evex().vmovups(ymmA, ymmB);
- cc.evex().vmovups(zmmA, zmmB);
- cc.evex().vmovups(zmmA, zmmB);
- cc.evex().vmulpd(xmmA, xmmB, xmmC);
- cc.evex().vmulpd(ymmA, ymmB, ymmC);
- cc.evex().vmulpd(zmmA, zmmB, zmmC);
- cc.evex().vmulps(xmmA, xmmB, xmmC);
- cc.evex().vmulps(ymmA, ymmB, ymmC);
- cc.evex().vmulps(zmmA, zmmB, zmmC);
- cc.evex().vmulsd(xmmA, xmmB, xmmC);
- cc.evex().vmulss(xmmA, xmmB, xmmC);
- cc.evex().vorpd(xmmA, xmmB, xmmC);
- cc.evex().vorpd(ymmA, ymmB, ymmC);
- cc.evex().vorpd(zmmA, zmmB, zmmC);
- cc.evex().vorps(xmmA, xmmB, xmmC);
- cc.evex().vorps(ymmA, ymmB, ymmC);
- cc.evex().vorps(zmmA, zmmB, zmmC);
- cc.evex().vpabsb(xmmA, xmmB);
- cc.evex().vpabsb(ymmA, ymmB);
- cc.evex().vpabsb(zmmA, zmmB);
- cc.evex().vpabsd(xmmA, xmmB);
- cc.evex().vpabsd(ymmA, ymmB);
- cc.evex().vpabsd(zmmA, zmmB);
- cc.evex().vpabsq(xmmA, xmmB);
- cc.evex().vpabsq(ymmA, ymmB);
- cc.evex().vpabsq(zmmA, zmmB);
- cc.evex().vpabsw(xmmA, xmmB);
- cc.evex().vpabsw(ymmA, ymmB);
- cc.evex().vpabsw(zmmA, zmmB);
- cc.evex().vpackssdw(xmmA, xmmB, xmmC);
- cc.evex().vpackssdw(ymmA, ymmB, ymmC);
- cc.evex().vpackssdw(zmmA, zmmB, zmmC);
- cc.evex().vpacksswb(xmmA, xmmB, xmmC);
- cc.evex().vpacksswb(ymmA, ymmB, ymmC);
- cc.evex().vpacksswb(zmmA, zmmB, zmmC);
- cc.evex().vpackusdw(xmmA, xmmB, xmmC);
- cc.evex().vpackusdw(ymmA, ymmB, ymmC);
- cc.evex().vpackusdw(zmmA, zmmB, zmmC);
- cc.evex().vpackuswb(xmmA, xmmB, xmmC);
- cc.evex().vpackuswb(ymmA, ymmB, ymmC);
- cc.evex().vpackuswb(zmmA, zmmB, zmmC);
- cc.evex().vpaddb(xmmA, xmmB, xmmC);
- cc.evex().vpaddb(ymmA, ymmB, ymmC);
- cc.evex().vpaddb(zmmA, zmmB, zmmC);
- cc.evex().vpaddd(xmmA, xmmB, xmmC);
- cc.evex().vpaddd(ymmA, ymmB, ymmC);
- cc.evex().vpaddd(zmmA, zmmB, zmmC);
- cc.evex().vpaddq(xmmA, xmmB, xmmC);
- cc.evex().vpaddq(ymmA, ymmB, ymmC);
- cc.evex().vpaddq(zmmA, zmmB, zmmC);
- cc.evex().vpaddsb(xmmA, xmmB, xmmC);
- cc.evex().vpaddsb(ymmA, ymmB, ymmC);
- cc.evex().vpaddsb(zmmA, zmmB, zmmC);
- cc.evex().vpaddsw(xmmA, xmmB, xmmC);
- cc.evex().vpaddsw(ymmA, ymmB, ymmC);
- cc.evex().vpaddsw(zmmA, zmmB, zmmC);
- cc.evex().vpaddusb(xmmA, xmmB, xmmC);
- cc.evex().vpaddusb(ymmA, ymmB, ymmC);
- cc.evex().vpaddusb(zmmA, zmmB, zmmC);
- cc.evex().vpaddusw(xmmA, xmmB, xmmC);
- cc.evex().vpaddusw(ymmA, ymmB, ymmC);
- cc.evex().vpaddusw(zmmA, zmmB, zmmC);
- cc.evex().vpaddw(xmmA, xmmB, xmmC);
- cc.evex().vpaddw(ymmA, ymmB, ymmC);
- cc.evex().vpaddw(zmmA, zmmB, zmmC);
- cc.evex().vpalignr(xmmA, xmmB, xmmC, 0);
- cc.evex().vpalignr(ymmA, ymmB, ymmC, 0);
- cc.evex().vpalignr(zmmA, zmmB, zmmC, 0);
- cc.evex().vpandd(xmmA, xmmB, xmmC);
- cc.evex().vpandd(ymmA, ymmB, ymmC);
- cc.evex().vpandd(zmmA, zmmB, zmmC);
- cc.evex().vpandnd(xmmA, xmmB, xmmC);
- cc.evex().vpandnd(ymmA, ymmB, ymmC);
- cc.evex().vpandnd(zmmA, zmmB, zmmC);
- cc.evex().vpandnq(xmmA, xmmB, xmmC);
- cc.evex().vpandnq(ymmA, ymmB, ymmC);
- cc.evex().vpandnq(zmmA, zmmB, zmmC);
- cc.evex().vpandq(xmmA, xmmB, xmmC);
- cc.evex().vpandq(ymmA, ymmB, ymmC);
- cc.evex().vpandq(zmmA, zmmB, zmmC);
- cc.evex().vpavgb(xmmA, xmmB, xmmC);
- cc.evex().vpavgb(ymmA, ymmB, ymmC);
- cc.evex().vpavgb(zmmA, zmmB, zmmC);
- cc.evex().vpavgw(xmmA, xmmB, xmmC);
- cc.evex().vpavgw(ymmA, ymmB, ymmC);
- cc.evex().vpavgw(zmmA, zmmB, zmmC);
- cc.evex().vpblendmb(xmmA, xmmB, xmmC);
- cc.evex().vpblendmb(ymmA, ymmB, ymmC);
- cc.evex().vpblendmb(zmmA, zmmB, zmmC);
- cc.evex().vpblendmd(xmmA, xmmB, xmmC);
- cc.evex().vpblendmd(ymmA, ymmB, ymmC);
- cc.evex().vpblendmd(zmmA, zmmB, zmmC);
- cc.evex().vpblendmq(xmmA, xmmB, xmmC);
- cc.evex().vpblendmq(ymmA, ymmB, ymmC);
- cc.evex().vpblendmq(zmmA, zmmB, zmmC);
- cc.evex().vpblendmw(xmmA, xmmB, xmmC);
- cc.evex().vpblendmw(ymmA, ymmB, ymmC);
- cc.evex().vpblendmw(zmmA, zmmB, zmmC);
- cc.evex().vpbroadcastb(xmmA, gpd);
- cc.evex().vpbroadcastb(xmmA, xmmB);
- cc.evex().vpbroadcastb(ymmA, gpd);
- cc.evex().vpbroadcastb(ymmA, xmmB);
- cc.evex().vpbroadcastb(zmmA, gpd);
- cc.evex().vpbroadcastb(zmmA, xmmB);
- cc.evex().vpbroadcastd(xmmA, gpd);
- cc.evex().vpbroadcastd(xmmA, xmmB);
- cc.evex().vpbroadcastd(ymmA, gpd);
- cc.evex().vpbroadcastd(ymmA, xmmB);
- cc.evex().vpbroadcastd(zmmA, gpd);
- cc.evex().vpbroadcastd(zmmA, xmmB);
- cc.evex().vpbroadcastmb2q(xmmA, kB);
- cc.evex().vpbroadcastmb2q(ymmA, kB);
- cc.evex().vpbroadcastmb2q(zmmA, kB);
- cc.evex().vpbroadcastmw2d(xmmA, kB);
- cc.evex().vpbroadcastmw2d(ymmA, kB);
- cc.evex().vpbroadcastmw2d(zmmA, kB);
- if (cc.is64Bit()) cc.evex().vpbroadcastq(xmmA, gpq);
- cc.evex().vpbroadcastq(xmmA, xmmB);
- if (cc.is64Bit()) cc.evex().vpbroadcastq(ymmA, gpq);
- cc.evex().vpbroadcastq(ymmA, xmmB);
- if (cc.is64Bit()) cc.evex().vpbroadcastq(zmmA, gpq);
- cc.evex().vpbroadcastq(zmmA, xmmB);
- cc.evex().vpbroadcastw(xmmA, gpd);
- cc.evex().vpbroadcastw(xmmA, xmmB);
- cc.evex().vpbroadcastw(ymmA, gpd);
- cc.evex().vpbroadcastw(ymmA, xmmB);
- cc.evex().vpbroadcastw(zmmA, gpd);
- cc.evex().vpbroadcastw(zmmA, xmmB);
- cc.evex().vpcmpb(kA, xmmB, xmmC, 0);
- cc.evex().vpcmpb(kA, ymmB, ymmC, 0);
- cc.evex().vpcmpb(kA, zmmB, zmmC, 0);
- cc.evex().vpcmpd(kA, xmmB, xmmC, 0);
- cc.evex().vpcmpd(kA, ymmB, ymmC, 0);
- cc.evex().vpcmpd(kA, zmmB, zmmC, 0);
- cc.evex().vpcmpeqb(kA, xmmB, xmmC);
- cc.evex().vpcmpeqb(kA, ymmB, ymmC);
- cc.evex().vpcmpeqb(kA, zmmB, zmmC);
- cc.evex().vpcmpeqd(kA, xmmB, xmmC);
- cc.evex().vpcmpeqd(kA, ymmB, ymmC);
- cc.evex().vpcmpeqd(kA, zmmB, zmmC);
- cc.evex().vpcmpeqq(kA, xmmB, xmmC);
- cc.evex().vpcmpeqq(kA, ymmB, ymmC);
- cc.evex().vpcmpeqq(kA, zmmB, zmmC);
- cc.evex().vpcmpeqw(kA, xmmB, xmmC);
- cc.evex().vpcmpeqw(kA, ymmB, ymmC);
- cc.evex().vpcmpeqw(kA, zmmB, zmmC);
- cc.evex().vpcmpgtb(kA, xmmB, xmmC);
- cc.evex().vpcmpgtb(kA, ymmB, ymmC);
- cc.evex().vpcmpgtb(kA, zmmB, zmmC);
- cc.evex().vpcmpgtd(kA, xmmB, xmmC);
- cc.evex().vpcmpgtd(kA, ymmB, ymmC);
- cc.evex().vpcmpgtd(kA, zmmB, zmmC);
- cc.evex().vpcmpgtq(kA, xmmB, xmmC);
- cc.evex().vpcmpgtq(kA, ymmB, ymmC);
- cc.evex().vpcmpgtq(kA, zmmB, zmmC);
- cc.evex().vpcmpgtw(kA, xmmB, xmmC);
- cc.evex().vpcmpgtw(kA, ymmB, ymmC);
- cc.evex().vpcmpgtw(kA, zmmB, zmmC);
- cc.evex().vpcmpq(kA, xmmB, xmmC, 0);
- cc.evex().vpcmpq(kA, ymmB, ymmC, 0);
- cc.evex().vpcmpq(kA, zmmB, zmmC, 0);
- cc.evex().vpcmpub(kA, xmmB, xmmC, 0);
- cc.evex().vpcmpub(kA, ymmB, ymmC, 0);
- cc.evex().vpcmpub(kA, zmmB, zmmC, 0);
- cc.evex().vpcmpud(kA, xmmB, xmmC, 0);
- cc.evex().vpcmpud(kA, ymmB, ymmC, 0);
- cc.evex().vpcmpud(kA, zmmB, zmmC, 0);
- cc.evex().vpcmpuq(kA, xmmB, xmmC, 0);
- cc.evex().vpcmpuq(kA, ymmB, ymmC, 0);
- cc.evex().vpcmpuq(kA, zmmB, zmmC, 0);
- cc.evex().vpcmpuw(kA, xmmB, xmmC, 0);
- cc.evex().vpcmpuw(kA, ymmB, ymmC, 0);
- cc.evex().vpcmpuw(kA, zmmB, zmmC, 0);
- cc.evex().vpcmpw(kA, xmmB, xmmC, 0);
- cc.evex().vpcmpw(kA, ymmB, ymmC, 0);
- cc.evex().vpcmpw(kA, zmmB, zmmC, 0);
- cc.evex().vpcompressd(xmmA, xmmB);
- cc.evex().vpcompressd(ymmA, ymmB);
- cc.evex().vpcompressd(zmmA, zmmB);
- cc.evex().vpcompressq(xmmA, xmmB);
- cc.evex().vpcompressq(ymmA, ymmB);
- cc.evex().vpcompressq(zmmA, zmmB);
- cc.evex().vpconflictd(xmmA, xmmB);
- cc.evex().vpconflictd(ymmA, ymmB);
- cc.evex().vpconflictd(zmmA, zmmB);
- cc.evex().vpconflictq(xmmA, xmmB);
- cc.evex().vpconflictq(ymmA, ymmB);
- cc.evex().vpconflictq(zmmA, zmmB);
- cc.evex().vpermb(xmmA, xmmB, xmmC);
- cc.evex().vpermb(ymmA, ymmB, ymmC);
- cc.evex().vpermb(zmmA, zmmB, zmmC);
- cc.evex().vpermd(ymmA, ymmB, ymmC);
- cc.evex().vpermd(zmmA, zmmB, zmmC);
- cc.evex().vpermi2b(xmmA, xmmB, xmmC);
- cc.evex().vpermi2b(ymmA, ymmB, ymmC);
- cc.evex().vpermi2b(zmmA, zmmB, zmmC);
- cc.evex().vpermi2d(xmmA, xmmB, xmmC);
- cc.evex().vpermi2d(ymmA, ymmB, ymmC);
- cc.evex().vpermi2d(zmmA, zmmB, zmmC);
- cc.evex().vpermi2pd(xmmA, xmmB, xmmC);
- cc.evex().vpermi2pd(ymmA, ymmB, ymmC);
- cc.evex().vpermi2pd(zmmA, zmmB, zmmC);
- cc.evex().vpermi2ps(xmmA, xmmB, xmmC);
- cc.evex().vpermi2ps(ymmA, ymmB, ymmC);
- cc.evex().vpermi2ps(zmmA, zmmB, zmmC);
- cc.evex().vpermi2q(xmmA, xmmB, xmmC);
- cc.evex().vpermi2q(ymmA, ymmB, ymmC);
- cc.evex().vpermi2q(zmmA, zmmB, zmmC);
- cc.evex().vpermi2w(xmmA, xmmB, xmmC);
- cc.evex().vpermi2w(ymmA, ymmB, ymmC);
- cc.evex().vpermi2w(zmmA, zmmB, zmmC);
- cc.evex().vpermilpd(xmmA, xmmB, xmmC);
- cc.evex().vpermilpd(ymmA, ymmB, ymmC);
- cc.evex().vpermilpd(zmmA, zmmB, zmmC);
- cc.evex().vpermilpd(xmmA, xmmB, 0);
- cc.evex().vpermilpd(ymmA, ymmB, 0);
- cc.evex().vpermilpd(zmmA, zmmB, 0);
- cc.evex().vpermilps(xmmA, xmmB, xmmC);
- cc.evex().vpermilps(ymmA, ymmB, ymmC);
- cc.evex().vpermilps(zmmA, zmmB, zmmC);
- cc.evex().vpermilps(xmmA, xmmB, 0);
- cc.evex().vpermilps(ymmA, ymmB, 0);
- cc.evex().vpermilps(zmmA, zmmB, 0);
- cc.evex().vpermq(ymmA, ymmB, ymmC);
- cc.evex().vpermq(zmmA, zmmB, zmmC);
- cc.evex().vpermq(ymmA, ymmB, 0);
- cc.evex().vpermq(zmmA, zmmB, 0);
- cc.evex().vpermt2b(xmmA, xmmB, xmmC);
- cc.evex().vpermt2b(ymmA, ymmB, ymmC);
- cc.evex().vpermt2b(zmmA, zmmB, zmmC);
- cc.evex().vpermt2d(xmmA, xmmB, xmmC);
- cc.evex().vpermt2d(ymmA, ymmB, ymmC);
- cc.evex().vpermt2d(zmmA, zmmB, zmmC);
- cc.evex().vpermt2pd(xmmA, xmmB, xmmC);
- cc.evex().vpermt2pd(ymmA, ymmB, ymmC);
- cc.evex().vpermt2pd(zmmA, zmmB, zmmC);
- cc.evex().vpermt2ps(xmmA, xmmB, xmmC);
- cc.evex().vpermt2ps(ymmA, ymmB, ymmC);
- cc.evex().vpermt2ps(zmmA, zmmB, zmmC);
- cc.evex().vpermt2q(xmmA, xmmB, xmmC);
- cc.evex().vpermt2q(ymmA, ymmB, ymmC);
- cc.evex().vpermt2q(zmmA, zmmB, zmmC);
- cc.evex().vpermt2w(xmmA, xmmB, xmmC);
- cc.evex().vpermt2w(ymmA, ymmB, ymmC);
- cc.evex().vpermt2w(zmmA, zmmB, zmmC);
- cc.evex().vpermw(xmmA, xmmB, xmmC);
- cc.evex().vpermw(ymmA, ymmB, ymmC);
- cc.evex().vpermw(zmmA, zmmB, zmmC);
- cc.evex().vpexpandd(xmmA, xmmB);
- cc.evex().vpexpandd(ymmA, ymmB);
- cc.evex().vpexpandd(zmmA, zmmB);
- cc.evex().vpexpandq(xmmA, xmmB);
- cc.evex().vpexpandq(ymmA, ymmB);
- cc.evex().vpexpandq(zmmA, zmmB);
- cc.evex().vpextrb(gpd, xmmB, 0);
- cc.evex().vpextrd(gpd, xmmB, 0);
- if (cc.is64Bit()) cc.evex().vpextrq(gpq, xmmB, 0);
- cc.evex().vpextrw(gpd, xmmB, 0);
- cc.evex().vpinsrb(xmmA, xmmB, gpd, 0);
- cc.evex().vpinsrd(xmmA, xmmB, gpd, 0);
- if (cc.is64Bit()) cc.evex().vpinsrq(xmmA, xmmB, gpq, 0);
- cc.evex().vpinsrw(xmmA, xmmB, gpd, 0);
- cc.evex().vplzcntd(xmmA, xmmB);
- cc.evex().vplzcntd(ymmA, ymmB);
- cc.evex().vplzcntd(zmmA, zmmB);
- cc.evex().vplzcntq(xmmA, xmmB);
- cc.evex().vplzcntq(ymmA, ymmB);
- cc.evex().vplzcntq(zmmA, zmmB);
- cc.evex().vpmadd52huq(xmmA, xmmB, xmmC);
- cc.evex().vpmadd52huq(ymmA, ymmB, ymmC);
- cc.evex().vpmadd52huq(zmmA, zmmB, zmmC);
- cc.evex().vpmadd52luq(xmmA, xmmB, xmmC);
- cc.evex().vpmadd52luq(ymmA, ymmB, ymmC);
- cc.evex().vpmadd52luq(zmmA, zmmB, zmmC);
- cc.evex().vpmaddubsw(xmmA, xmmB, xmmC);
- cc.evex().vpmaddubsw(ymmA, ymmB, ymmC);
- cc.evex().vpmaddubsw(zmmA, zmmB, zmmC);
- cc.evex().vpmaddwd(xmmA, xmmB, xmmC);
- cc.evex().vpmaddwd(ymmA, ymmB, ymmC);
- cc.evex().vpmaddwd(zmmA, zmmB, zmmC);
- cc.evex().vpmaxsb(xmmA, xmmB, xmmC);
- cc.evex().vpmaxsb(ymmA, ymmB, ymmC);
- cc.evex().vpmaxsb(zmmA, zmmB, zmmC);
- cc.evex().vpmaxsd(xmmA, xmmB, xmmC);
- cc.evex().vpmaxsd(ymmA, ymmB, ymmC);
- cc.evex().vpmaxsd(zmmA, zmmB, zmmC);
- cc.evex().vpmaxsq(xmmA, xmmB, xmmC);
- cc.evex().vpmaxsq(ymmA, ymmB, ymmC);
- cc.evex().vpmaxsq(zmmA, zmmB, zmmC);
- cc.evex().vpmaxsw(xmmA, xmmB, xmmC);
- cc.evex().vpmaxsw(ymmA, ymmB, ymmC);
- cc.evex().vpmaxsw(zmmA, zmmB, zmmC);
- cc.evex().vpmaxub(xmmA, xmmB, xmmC);
- cc.evex().vpmaxub(ymmA, ymmB, ymmC);
- cc.evex().vpmaxub(zmmA, zmmB, zmmC);
- cc.evex().vpmaxud(xmmA, xmmB, xmmC);
- cc.evex().vpmaxud(ymmA, ymmB, ymmC);
- cc.evex().vpmaxud(zmmA, zmmB, zmmC);
- cc.evex().vpmaxuq(xmmA, xmmB, xmmC);
- cc.evex().vpmaxuq(ymmA, ymmB, ymmC);
- cc.evex().vpmaxuq(zmmA, zmmB, zmmC);
- cc.evex().vpmaxuw(xmmA, xmmB, xmmC);
- cc.evex().vpmaxuw(ymmA, ymmB, ymmC);
- cc.evex().vpmaxuw(zmmA, zmmB, zmmC);
- cc.evex().vpminsb(xmmA, xmmB, xmmC);
- cc.evex().vpminsb(ymmA, ymmB, ymmC);
- cc.evex().vpminsb(zmmA, zmmB, zmmC);
- cc.evex().vpminsd(xmmA, xmmB, xmmC);
- cc.evex().vpminsd(ymmA, ymmB, ymmC);
- cc.evex().vpminsd(zmmA, zmmB, zmmC);
- cc.evex().vpminsq(xmmA, xmmB, xmmC);
- cc.evex().vpminsq(ymmA, ymmB, ymmC);
- cc.evex().vpminsq(zmmA, zmmB, zmmC);
- cc.evex().vpminsw(xmmA, xmmB, xmmC);
- cc.evex().vpminsw(ymmA, ymmB, ymmC);
- cc.evex().vpminsw(zmmA, zmmB, zmmC);
- cc.evex().vpminub(xmmA, xmmB, xmmC);
- cc.evex().vpminub(ymmA, ymmB, ymmC);
- cc.evex().vpminub(zmmA, zmmB, zmmC);
- cc.evex().vpminud(xmmA, xmmB, xmmC);
- cc.evex().vpminud(ymmA, ymmB, ymmC);
- cc.evex().vpminud(zmmA, zmmB, zmmC);
- cc.evex().vpminuq(xmmA, xmmB, xmmC);
- cc.evex().vpminuq(ymmA, ymmB, ymmC);
- cc.evex().vpminuq(zmmA, zmmB, zmmC);
- cc.evex().vpminuw(xmmA, xmmB, xmmC);
- cc.evex().vpminuw(ymmA, ymmB, ymmC);
- cc.evex().vpminuw(zmmA, zmmB, zmmC);
- cc.evex().vpmovb2m(kA, xmmB);
- cc.evex().vpmovb2m(kA, ymmB);
- cc.evex().vpmovb2m(kA, zmmB);
- cc.evex().vpmovd2m(kA, xmmB);
- cc.evex().vpmovd2m(kA, ymmB);
- cc.evex().vpmovd2m(kA, zmmB);
- cc.evex().vpmovdb(xmmA, xmmB);
- cc.evex().vpmovdb(xmmA, ymmB);
- cc.evex().vpmovdb(xmmA, zmmB);
- cc.evex().vpmovdw(xmmA, xmmB);
- cc.evex().vpmovdw(xmmA, ymmB);
- cc.evex().vpmovdw(ymmA, zmmB);
- cc.evex().vpmovm2b(xmmA, kB);
- cc.evex().vpmovm2b(ymmA, kB);
- cc.evex().vpmovm2b(zmmA, kB);
- cc.evex().vpmovm2d(xmmA, kB);
- cc.evex().vpmovm2d(ymmA, kB);
- cc.evex().vpmovm2d(zmmA, kB);
- cc.evex().vpmovm2q(xmmA, kB);
- cc.evex().vpmovm2q(ymmA, kB);
- cc.evex().vpmovm2q(zmmA, kB);
- cc.evex().vpmovm2w(xmmA, kB);
- cc.evex().vpmovm2w(ymmA, kB);
- cc.evex().vpmovm2w(zmmA, kB);
- cc.evex().vpmovq2m(kA, xmmB);
- cc.evex().vpmovq2m(kA, ymmB);
- cc.evex().vpmovq2m(kA, zmmB);
- cc.evex().vpmovqb(xmmA, xmmB);
- cc.evex().vpmovqb(xmmA, ymmB);
- cc.evex().vpmovqb(xmmA, zmmB);
- cc.evex().vpmovqd(xmmA, xmmB);
- cc.evex().vpmovqd(xmmA, ymmB);
- cc.evex().vpmovqd(ymmA, zmmB);
- cc.evex().vpmovqw(xmmA, xmmB);
- cc.evex().vpmovqw(xmmA, ymmB);
- cc.evex().vpmovqw(xmmA, zmmB);
- cc.evex().vpmovsdb(xmmA, xmmB);
- cc.evex().vpmovsdb(xmmA, ymmB);
- cc.evex().vpmovsdb(xmmA, zmmB);
- cc.evex().vpmovsdw(xmmA, xmmB);
- cc.evex().vpmovsdw(xmmA, ymmB);
- cc.evex().vpmovsdw(ymmA, zmmB);
- cc.evex().vpmovsqb(xmmA, xmmB);
- cc.evex().vpmovsqb(xmmA, ymmB);
- cc.evex().vpmovsqb(xmmA, zmmB);
- cc.evex().vpmovsqd(xmmA, xmmB);
- cc.evex().vpmovsqd(xmmA, ymmB);
- cc.evex().vpmovsqd(ymmA, zmmB);
- cc.evex().vpmovsqw(xmmA, xmmB);
- cc.evex().vpmovsqw(xmmA, ymmB);
- cc.evex().vpmovsqw(xmmA, zmmB);
- cc.evex().vpmovswb(xmmA, xmmB);
- cc.evex().vpmovswb(xmmA, ymmB);
- cc.evex().vpmovswb(ymmA, zmmB);
- cc.evex().vpmovsxbd(xmmA, xmmB);
- cc.evex().vpmovsxbd(ymmA, xmmB);
- cc.evex().vpmovsxbd(zmmA, xmmB);
- cc.evex().vpmovsxbq(xmmA, xmmB);
- cc.evex().vpmovsxbq(ymmA, xmmB);
- cc.evex().vpmovsxbq(zmmA, xmmB);
- cc.evex().vpmovsxbw(xmmA, xmmB);
- cc.evex().vpmovsxbw(ymmA, xmmB);
- cc.evex().vpmovsxbw(zmmA, ymmB);
- cc.evex().vpmovsxdq(xmmA, xmmB);
- cc.evex().vpmovsxdq(ymmA, xmmB);
- cc.evex().vpmovsxdq(zmmA, ymmB);
- cc.evex().vpmovsxwd(xmmA, xmmB);
- cc.evex().vpmovsxwd(ymmA, xmmB);
- cc.evex().vpmovsxwd(zmmA, ymmB);
- cc.evex().vpmovsxwq(xmmA, xmmB);
- cc.evex().vpmovsxwq(ymmA, xmmB);
- cc.evex().vpmovsxwq(zmmA, xmmB);
- cc.evex().vpmovusdb(xmmA, xmmB);
- cc.evex().vpmovusdb(xmmA, ymmB);
- cc.evex().vpmovusdb(xmmA, zmmB);
- cc.evex().vpmovusdw(xmmA, xmmB);
- cc.evex().vpmovusdw(xmmA, ymmB);
- cc.evex().vpmovusdw(ymmA, zmmB);
- cc.evex().vpmovusqb(xmmA, xmmB);
- cc.evex().vpmovusqb(xmmA, ymmB);
- cc.evex().vpmovusqb(xmmA, zmmB);
- cc.evex().vpmovusqd(xmmA, xmmB);
- cc.evex().vpmovusqd(xmmA, ymmB);
- cc.evex().vpmovusqd(ymmA, zmmB);
- cc.evex().vpmovusqw(xmmA, xmmB);
- cc.evex().vpmovusqw(xmmA, ymmB);
- cc.evex().vpmovusqw(xmmA, zmmB);
- cc.evex().vpmovuswb(xmmA, xmmB);
- cc.evex().vpmovuswb(xmmA, ymmB);
- cc.evex().vpmovuswb(ymmA, zmmB);
- cc.evex().vpmovw2m(kA, xmmB);
- cc.evex().vpmovw2m(kA, ymmB);
- cc.evex().vpmovw2m(kA, zmmB);
- cc.evex().vpmovwb(xmmA, xmmB);
- cc.evex().vpmovwb(xmmA, ymmB);
- cc.evex().vpmovwb(ymmA, zmmB);
- cc.evex().vpmovzxbd(xmmA, xmmB);
- cc.evex().vpmovzxbd(ymmA, xmmB);
- cc.evex().vpmovzxbd(zmmA, xmmB);
- cc.evex().vpmovzxbq(xmmA, xmmB);
- cc.evex().vpmovzxbq(ymmA, xmmB);
- cc.evex().vpmovzxbq(zmmA, xmmB);
- cc.evex().vpmovzxbw(xmmA, xmmB);
- cc.evex().vpmovzxbw(ymmA, xmmB);
- cc.evex().vpmovzxbw(zmmA, ymmB);
- cc.evex().vpmovzxdq(xmmA, xmmB);
- cc.evex().vpmovzxdq(ymmA, xmmB);
- cc.evex().vpmovzxdq(zmmA, ymmB);
- cc.evex().vpmovzxwd(xmmA, xmmB);
- cc.evex().vpmovzxwd(ymmA, xmmB);
- cc.evex().vpmovzxwd(zmmA, ymmB);
- cc.evex().vpmovzxwq(xmmA, xmmB);
- cc.evex().vpmovzxwq(ymmA, xmmB);
- cc.evex().vpmovzxwq(zmmA, xmmB);
- cc.evex().vpmuldq(xmmA, xmmB, xmmC);
- cc.evex().vpmuldq(ymmA, ymmB, ymmC);
- cc.evex().vpmuldq(zmmA, zmmB, zmmC);
- cc.evex().vpmulhrsw(xmmA, xmmB, xmmC);
- cc.evex().vpmulhrsw(ymmA, ymmB, ymmC);
- cc.evex().vpmulhrsw(zmmA, zmmB, zmmC);
- cc.evex().vpmulhuw(xmmA, xmmB, xmmC);
- cc.evex().vpmulhuw(ymmA, ymmB, ymmC);
- cc.evex().vpmulhuw(zmmA, zmmB, zmmC);
- cc.evex().vpmulhw(xmmA, xmmB, xmmC);
- cc.evex().vpmulhw(ymmA, ymmB, ymmC);
- cc.evex().vpmulhw(zmmA, zmmB, zmmC);
- cc.evex().vpmulld(xmmA, xmmB, xmmC);
- cc.evex().vpmulld(ymmA, ymmB, ymmC);
- cc.evex().vpmulld(zmmA, zmmB, zmmC);
- cc.evex().vpmullq(xmmA, xmmB, xmmC);
- cc.evex().vpmullq(ymmA, ymmB, ymmC);
- cc.evex().vpmullq(zmmA, zmmB, zmmC);
- cc.evex().vpmullw(xmmA, xmmB, xmmC);
- cc.evex().vpmullw(ymmA, ymmB, ymmC);
- cc.evex().vpmullw(zmmA, zmmB, zmmC);
- cc.evex().vpmultishiftqb(xmmA, xmmB, xmmC);
- cc.evex().vpmultishiftqb(ymmA, ymmB, ymmC);
- cc.evex().vpmultishiftqb(zmmA, zmmB, zmmC);
- cc.evex().vpmuludq(xmmA, xmmB, xmmC);
- cc.evex().vpmuludq(ymmA, ymmB, ymmC);
- cc.evex().vpmuludq(zmmA, zmmB, zmmC);
- cc.evex().vpopcntd(zmmA, zmmB);
- cc.evex().vpopcntq(zmmA, zmmB);
- cc.evex().vpord(xmmA, xmmB, xmmC);
- cc.evex().vpord(ymmA, ymmB, ymmC);
- cc.evex().vpord(zmmA, zmmB, zmmC);
- cc.evex().vporq(xmmA, xmmB, xmmC);
- cc.evex().vporq(ymmA, ymmB, ymmC);
- cc.evex().vporq(zmmA, zmmB, zmmC);
- cc.evex().vprold(xmmA, xmmB, 0);
- cc.evex().vprold(ymmA, ymmB, 0);
- cc.evex().vprold(zmmA, zmmB, 0);
- cc.evex().vprolq(xmmA, xmmB, 0);
- cc.evex().vprolq(ymmA, ymmB, 0);
- cc.evex().vprolq(zmmA, zmmB, 0);
- cc.evex().vprolvd(xmmA, xmmB, xmmC);
- cc.evex().vprolvd(ymmA, ymmB, ymmC);
- cc.evex().vprolvd(zmmA, zmmB, zmmC);
- cc.evex().vprolvq(xmmA, xmmB, xmmC);
- cc.evex().vprolvq(ymmA, ymmB, ymmC);
- cc.evex().vprolvq(zmmA, zmmB, zmmC);
- cc.evex().vprord(xmmA, xmmB, 0);
- cc.evex().vprord(ymmA, ymmB, 0);
- cc.evex().vprord(zmmA, zmmB, 0);
- cc.evex().vprorq(xmmA, xmmB, 0);
- cc.evex().vprorq(ymmA, ymmB, 0);
- cc.evex().vprorq(zmmA, zmmB, 0);
- cc.evex().vprorvd(xmmA, xmmB, xmmC);
- cc.evex().vprorvd(ymmA, ymmB, ymmC);
- cc.evex().vprorvd(zmmA, zmmB, zmmC);
- cc.evex().vprorvq(xmmA, xmmB, xmmC);
- cc.evex().vprorvq(ymmA, ymmB, ymmC);
- cc.evex().vprorvq(zmmA, zmmB, zmmC);
- cc.evex().vpsadbw(xmmA, xmmB, xmmC);
- cc.evex().vpsadbw(ymmA, ymmB, ymmC);
- cc.evex().vpsadbw(zmmA, zmmB, zmmC);
- cc.evex().vpshufb(xmmA, xmmB, xmmC);
- cc.evex().vpshufb(ymmA, ymmB, ymmC);
- cc.evex().vpshufb(zmmA, zmmB, zmmC);
- cc.evex().vpshufd(xmmA, xmmB, 0);
- cc.evex().vpshufd(ymmA, ymmB, 0);
- cc.evex().vpshufd(zmmA, zmmB, 0);
- cc.evex().vpshufhw(xmmA, xmmB, 0);
- cc.evex().vpshufhw(ymmA, ymmB, 0);
- cc.evex().vpshufhw(zmmA, zmmB, 0);
- cc.evex().vpshuflw(xmmA, xmmB, 0);
- cc.evex().vpshuflw(ymmA, ymmB, 0);
- cc.evex().vpshuflw(zmmA, zmmB, 0);
- cc.evex().vpslld(xmmA, xmmB, xmmC);
- cc.evex().vpslld(xmmA, xmmB, 0);
- cc.evex().vpslld(ymmA, ymmB, xmmC);
- cc.evex().vpslld(ymmA, ymmB, 0);
- cc.evex().vpslld(zmmA, zmmB, xmmC);
- cc.evex().vpslld(zmmA, zmmB, 0);
- cc.evex().vpslldq(xmmA, xmmB, 0);
- cc.evex().vpslldq(ymmA, ymmB, 0);
- cc.evex().vpslldq(zmmA, zmmB, 0);
- cc.evex().vpsllq(xmmA, xmmB, xmmC);
- cc.evex().vpsllq(xmmA, xmmB, 0);
- cc.evex().vpsllq(ymmA, ymmB, xmmC);
- cc.evex().vpsllq(ymmA, ymmB, 0);
- cc.evex().vpsllq(zmmA, zmmB, xmmC);
- cc.evex().vpsllq(zmmA, zmmB, 0);
- cc.evex().vpsllvd(xmmA, xmmB, xmmC);
- cc.evex().vpsllvd(ymmA, ymmB, ymmC);
- cc.evex().vpsllvd(zmmA, zmmB, zmmC);
- cc.evex().vpsllvq(xmmA, xmmB, xmmC);
- cc.evex().vpsllvq(ymmA, ymmB, ymmC);
- cc.evex().vpsllvq(zmmA, zmmB, zmmC);
- cc.evex().vpsllvw(xmmA, xmmB, xmmC);
- cc.evex().vpsllvw(ymmA, ymmB, ymmC);
- cc.evex().vpsllvw(zmmA, zmmB, zmmC);
- cc.evex().vpsllw(xmmA, xmmB, xmmC);
- cc.evex().vpsllw(xmmA, xmmB, 0);
- cc.evex().vpsllw(ymmA, ymmB, xmmC);
- cc.evex().vpsllw(ymmA, ymmB, 0);
- cc.evex().vpsllw(zmmA, zmmB, xmmC);
- cc.evex().vpsllw(zmmA, zmmB, 0);
- cc.evex().vpsrad(xmmA, xmmB, xmmC);
- cc.evex().vpsrad(xmmA, xmmB, 0);
- cc.evex().vpsrad(ymmA, ymmB, xmmC);
- cc.evex().vpsrad(ymmA, ymmB, 0);
- cc.evex().vpsrad(zmmA, zmmB, xmmC);
- cc.evex().vpsrad(zmmA, zmmB, 0);
- cc.evex().vpsraq(xmmA, xmmB, xmmC);
- cc.evex().vpsraq(xmmA, xmmB, 0);
- cc.evex().vpsraq(ymmA, ymmB, xmmC);
- cc.evex().vpsraq(ymmA, ymmB, 0);
- cc.evex().vpsraq(zmmA, zmmB, xmmC);
- cc.evex().vpsraq(zmmA, zmmB, 0);
- cc.evex().vpsravd(xmmA, xmmB, xmmC);
- cc.evex().vpsravd(ymmA, ymmB, ymmC);
- cc.evex().vpsravd(zmmA, zmmB, zmmC);
- cc.evex().vpsravq(xmmA, xmmB, xmmC);
- cc.evex().vpsravq(ymmA, ymmB, ymmC);
- cc.evex().vpsravq(zmmA, zmmB, zmmC);
- cc.evex().vpsravw(xmmA, xmmB, xmmC);
- cc.evex().vpsravw(ymmA, ymmB, ymmC);
- cc.evex().vpsravw(zmmA, zmmB, zmmC);
- cc.evex().vpsraw(xmmA, xmmB, xmmC);
- cc.evex().vpsraw(xmmA, xmmB, 0);
- cc.evex().vpsraw(ymmA, ymmB, xmmC);
- cc.evex().vpsraw(ymmA, ymmB, 0);
- cc.evex().vpsraw(zmmA, zmmB, xmmC);
- cc.evex().vpsraw(zmmA, zmmB, 0);
- cc.evex().vpsrld(xmmA, xmmB, xmmC);
- cc.evex().vpsrld(xmmA, xmmB, 0);
- cc.evex().vpsrld(ymmA, ymmB, xmmC);
- cc.evex().vpsrld(ymmA, ymmB, 0);
- cc.evex().vpsrld(zmmA, zmmB, xmmC);
- cc.evex().vpsrld(zmmA, zmmB, 0);
- cc.evex().vpsrldq(xmmA, xmmB, 0);
- cc.evex().vpsrldq(ymmA, ymmB, 0);
- cc.evex().vpsrldq(zmmA, zmmB, 0);
- cc.evex().vpsrlq(xmmA, xmmB, xmmC);
- cc.evex().vpsrlq(xmmA, xmmB, 0);
- cc.evex().vpsrlq(ymmA, ymmB, xmmC);
- cc.evex().vpsrlq(ymmA, ymmB, 0);
- cc.evex().vpsrlq(zmmA, zmmB, xmmC);
- cc.evex().vpsrlq(zmmA, zmmB, 0);
- cc.evex().vpsrlvd(xmmA, xmmB, xmmC);
- cc.evex().vpsrlvd(ymmA, ymmB, ymmC);
- cc.evex().vpsrlvd(zmmA, zmmB, zmmC);
- cc.evex().vpsrlvq(xmmA, xmmB, xmmC);
- cc.evex().vpsrlvq(ymmA, ymmB, ymmC);
- cc.evex().vpsrlvq(zmmA, zmmB, zmmC);
- cc.evex().vpsrlvw(xmmA, xmmB, xmmC);
- cc.evex().vpsrlvw(ymmA, ymmB, ymmC);
- cc.evex().vpsrlvw(zmmA, zmmB, zmmC);
- cc.evex().vpsrlw(xmmA, xmmB, xmmC);
- cc.evex().vpsrlw(xmmA, xmmB, 0);
- cc.evex().vpsrlw(ymmA, ymmB, xmmC);
- cc.evex().vpsrlw(ymmA, ymmB, 0);
- cc.evex().vpsrlw(zmmA, zmmB, xmmC);
- cc.evex().vpsrlw(zmmA, zmmB, 0);
- cc.evex().vpsubb(xmmA, xmmB, xmmC);
- cc.evex().vpsubb(ymmA, ymmB, ymmC);
- cc.evex().vpsubb(zmmA, zmmB, zmmC);
- cc.evex().vpsubd(xmmA, xmmB, xmmC);
- cc.evex().vpsubd(ymmA, ymmB, ymmC);
- cc.evex().vpsubd(zmmA, zmmB, zmmC);
- cc.evex().vpsubq(xmmA, xmmB, xmmC);
- cc.evex().vpsubq(ymmA, ymmB, ymmC);
- cc.evex().vpsubq(zmmA, zmmB, zmmC);
- cc.evex().vpsubsb(xmmA, xmmB, xmmC);
- cc.evex().vpsubsb(ymmA, ymmB, ymmC);
- cc.evex().vpsubsb(zmmA, zmmB, zmmC);
- cc.evex().vpsubsw(xmmA, xmmB, xmmC);
- cc.evex().vpsubsw(ymmA, ymmB, ymmC);
- cc.evex().vpsubsw(zmmA, zmmB, zmmC);
- cc.evex().vpsubusb(xmmA, xmmB, xmmC);
- cc.evex().vpsubusb(ymmA, ymmB, ymmC);
- cc.evex().vpsubusb(zmmA, zmmB, zmmC);
- cc.evex().vpsubusw(xmmA, xmmB, xmmC);
- cc.evex().vpsubusw(ymmA, ymmB, ymmC);
- cc.evex().vpsubusw(zmmA, zmmB, zmmC);
- cc.evex().vpsubw(xmmA, xmmB, xmmC);
- cc.evex().vpsubw(ymmA, ymmB, ymmC);
- cc.evex().vpsubw(zmmA, zmmB, zmmC);
- cc.evex().vpternlogd(xmmA, xmmB, xmmC, 0);
- cc.evex().vpternlogd(ymmA, ymmB, ymmC, 0);
- cc.evex().vpternlogd(zmmA, zmmB, zmmC, 0);
- cc.evex().vpternlogq(xmmA, xmmB, xmmC, 0);
- cc.evex().vpternlogq(ymmA, ymmB, ymmC, 0);
- cc.evex().vpternlogq(zmmA, zmmB, zmmC, 0);
- cc.evex().vptestmb(kA, xmmB, xmmC);
- cc.evex().vptestmb(kA, ymmB, ymmC);
- cc.evex().vptestmb(kA, zmmB, zmmC);
- cc.evex().vptestmd(kA, xmmB, xmmC);
- cc.evex().vptestmd(kA, ymmB, ymmC);
- cc.evex().vptestmd(kA, zmmB, zmmC);
- cc.evex().vptestmq(kA, xmmB, xmmC);
- cc.evex().vptestmq(kA, ymmB, ymmC);
- cc.evex().vptestmq(kA, zmmB, zmmC);
- cc.evex().vptestmw(kA, xmmB, xmmC);
- cc.evex().vptestmw(kA, ymmB, ymmC);
- cc.evex().vptestmw(kA, zmmB, zmmC);
- cc.evex().vptestnmb(kA, xmmB, xmmC);
- cc.evex().vptestnmb(kA, ymmB, ymmC);
- cc.evex().vptestnmb(kA, zmmB, zmmC);
- cc.evex().vptestnmd(kA, xmmB, xmmC);
- cc.evex().vptestnmd(kA, ymmB, ymmC);
- cc.evex().vptestnmd(kA, zmmB, zmmC);
- cc.evex().vptestnmq(kA, xmmB, xmmC);
- cc.evex().vptestnmq(kA, ymmB, ymmC);
- cc.evex().vptestnmq(kA, zmmB, zmmC);
- cc.evex().vptestnmw(kA, xmmB, xmmC);
- cc.evex().vptestnmw(kA, ymmB, ymmC);
- cc.evex().vptestnmw(kA, zmmB, zmmC);
- cc.evex().vpunpckhbw(xmmA, xmmB, xmmC);
- cc.evex().vpunpckhbw(ymmA, ymmB, ymmC);
- cc.evex().vpunpckhbw(zmmA, zmmB, zmmC);
- cc.evex().vpunpckhdq(xmmA, xmmB, xmmC);
- cc.evex().vpunpckhdq(ymmA, ymmB, ymmC);
- cc.evex().vpunpckhdq(zmmA, zmmB, zmmC);
- cc.evex().vpunpckhqdq(xmmA, xmmB, xmmC);
- cc.evex().vpunpckhqdq(ymmA, ymmB, ymmC);
- cc.evex().vpunpckhqdq(zmmA, zmmB, zmmC);
- cc.evex().vpunpckhwd(xmmA, xmmB, xmmC);
- cc.evex().vpunpckhwd(ymmA, ymmB, ymmC);
- cc.evex().vpunpckhwd(zmmA, zmmB, zmmC);
- cc.evex().vpunpcklbw(xmmA, xmmB, xmmC);
- cc.evex().vpunpcklbw(ymmA, ymmB, ymmC);
- cc.evex().vpunpcklbw(zmmA, zmmB, zmmC);
- cc.evex().vpunpckldq(xmmA, xmmB, xmmC);
- cc.evex().vpunpckldq(ymmA, ymmB, ymmC);
- cc.evex().vpunpckldq(zmmA, zmmB, zmmC);
- cc.evex().vpunpcklqdq(xmmA, xmmB, xmmC);
- cc.evex().vpunpcklqdq(ymmA, ymmB, ymmC);
- cc.evex().vpunpcklqdq(zmmA, zmmB, zmmC);
- cc.evex().vpunpcklwd(xmmA, xmmB, xmmC);
- cc.evex().vpunpcklwd(ymmA, ymmB, ymmC);
- cc.evex().vpunpcklwd(zmmA, zmmB, zmmC);
- cc.evex().vpxord(xmmA, xmmB, xmmC);
- cc.evex().vpxord(ymmA, ymmB, ymmC);
- cc.evex().vpxord(zmmA, zmmB, zmmC);
- cc.evex().vpxorq(xmmA, xmmB, xmmC);
- cc.evex().vpxorq(ymmA, ymmB, ymmC);
- cc.evex().vpxorq(zmmA, zmmB, zmmC);
- cc.evex().vrangepd(xmmA, xmmB, xmmC, 0);
- cc.evex().vrangepd(ymmA, ymmB, ymmC, 0);
- cc.evex().vrangepd(zmmA, zmmB, zmmC, 0);
- cc.evex().vrangeps(xmmA, xmmB, xmmC, 0);
- cc.evex().vrangeps(ymmA, ymmB, ymmC, 0);
- cc.evex().vrangeps(zmmA, zmmB, zmmC, 0);
- cc.evex().vrangesd(xmmA, xmmB, xmmC, 0);
- cc.evex().vrangess(xmmA, xmmB, xmmC, 0);
- cc.evex().vrcp14pd(xmmA, xmmB);
- cc.evex().vrcp14pd(ymmA, ymmB);
- cc.evex().vrcp14pd(zmmA, zmmB);
- cc.evex().vrcp14ps(xmmA, xmmB);
- cc.evex().vrcp14ps(ymmA, ymmB);
- cc.evex().vrcp14ps(zmmA, zmmB);
- cc.evex().vrcp14sd(xmmA, xmmB, xmmC);
- cc.evex().vrcp14ss(xmmA, xmmB, xmmC);
- cc.evex().vrcp28pd(zmmA, zmmB);
- cc.evex().vrcp28ps(zmmA, zmmB);
- cc.evex().vrcp28sd(xmmA, xmmB, xmmC);
- cc.evex().vrcp28ss(xmmA, xmmB, xmmC);
- cc.evex().vreducepd(xmmA, xmmB, 0);
- cc.evex().vreducepd(ymmA, ymmB, 0);
- cc.evex().vreducepd(zmmA, zmmB, 0);
- cc.evex().vreduceps(xmmA, xmmB, 0);
- cc.evex().vreduceps(ymmA, ymmB, 0);
- cc.evex().vreduceps(zmmA, zmmB, 0);
- cc.evex().vreducesd(xmmA, xmmB, xmmC, 0);
- cc.evex().vreducess(xmmA, xmmB, xmmC, 0);
- cc.evex().vrndscalepd(xmmA, xmmB, 0);
- cc.evex().vrndscalepd(ymmA, ymmB, 0);
- cc.evex().vrndscalepd(zmmA, zmmB, 0);
- cc.evex().vrndscaleps(xmmA, xmmB, 0);
- cc.evex().vrndscaleps(ymmA, ymmB, 0);
- cc.evex().vrndscaleps(zmmA, zmmB, 0);
- cc.evex().vrndscalesd(xmmA, xmmB, xmmC, 0);
- cc.evex().vrndscaless(xmmA, xmmB, xmmC, 0);
- cc.evex().vrsqrt14pd(xmmA, xmmB);
- cc.evex().vrsqrt14pd(ymmA, ymmB);
- cc.evex().vrsqrt14pd(zmmA, zmmB);
- cc.evex().vrsqrt14ps(xmmA, xmmB);
- cc.evex().vrsqrt14ps(ymmA, ymmB);
- cc.evex().vrsqrt14ps(zmmA, zmmB);
- cc.evex().vrsqrt14sd(xmmA, xmmB, xmmC);
- cc.evex().vrsqrt14ss(xmmA, xmmB, xmmC);
- cc.evex().vrsqrt28pd(zmmA, zmmB);
- cc.evex().vrsqrt28ps(zmmA, zmmB);
- cc.evex().vrsqrt28sd(xmmA, xmmB, xmmC);
- cc.evex().vrsqrt28ss(xmmA, xmmB, xmmC);
- cc.evex().vscalefpd(xmmA, xmmB, xmmC);
- cc.evex().vscalefpd(ymmA, ymmB, ymmC);
- cc.evex().vscalefpd(zmmA, zmmB, zmmC);
- cc.evex().vscalefps(xmmA, xmmB, xmmC);
- cc.evex().vscalefps(ymmA, ymmB, ymmC);
- cc.evex().vscalefps(zmmA, zmmB, zmmC);
- cc.evex().vscalefsd(xmmA, xmmB, xmmC);
- cc.evex().vscalefss(xmmA, xmmB, xmmC);
- cc.evex().vshuff32x4(ymmA, ymmB, ymmC, 0);
- cc.evex().vshuff32x4(zmmA, zmmB, zmmC, 0);
- cc.evex().vshuff64x2(ymmA, ymmB, ymmC, 0);
- cc.evex().vshuff64x2(zmmA, zmmB, zmmC, 0);
- cc.evex().vshufi32x4(ymmA, ymmB, ymmC, 0);
- cc.evex().vshufi32x4(zmmA, zmmB, zmmC, 0);
- cc.evex().vshufi64x2(ymmA, ymmB, ymmC, 0);
- cc.evex().vshufi64x2(zmmA, zmmB, zmmC, 0);
- cc.evex().vshufpd(xmmA, xmmB, xmmC, 0);
- cc.evex().vshufpd(ymmA, ymmB, ymmC, 0);
- cc.evex().vshufpd(zmmA, zmmB, zmmC, 0);
- cc.evex().vshufps(xmmA, xmmB, xmmC, 0);
- cc.evex().vshufps(ymmA, ymmB, ymmC, 0);
- cc.evex().vshufps(zmmA, zmmB, zmmC, 0);
- cc.evex().vsqrtpd(xmmA, xmmB);
- cc.evex().vsqrtpd(ymmA, ymmB);
- cc.evex().vsqrtpd(zmmA, zmmB);
- cc.evex().vsqrtps(xmmA, xmmB);
- cc.evex().vsqrtps(ymmA, ymmB);
- cc.evex().vsqrtps(zmmA, zmmB);
- cc.evex().vsqrtsd(xmmA, xmmB, xmmC);
- cc.evex().vsqrtss(xmmA, xmmB, xmmC);
- cc.evex().vsubpd(xmmA, xmmB, xmmC);
- cc.evex().vsubpd(ymmA, ymmB, ymmC);
- cc.evex().vsubpd(zmmA, zmmB, zmmC);
- cc.evex().vsubps(xmmA, xmmB, xmmC);
- cc.evex().vsubps(ymmA, ymmB, ymmC);
- cc.evex().vsubps(zmmA, zmmB, zmmC);
- cc.evex().vsubsd(xmmA, xmmB, xmmC);
- cc.evex().vsubss(xmmA, xmmB, xmmC);
- cc.evex().vucomisd(xmmA, xmmB);
- cc.evex().vucomiss(xmmA, xmmB);
- cc.evex().vunpckhpd(xmmA, xmmB, xmmC);
- cc.evex().vunpckhpd(ymmA, ymmB, ymmC);
- cc.evex().vunpckhpd(zmmA, zmmB, zmmC);
- cc.evex().vunpckhps(xmmA, xmmB, xmmC);
- cc.evex().vunpckhps(ymmA, ymmB, ymmC);
- cc.evex().vunpckhps(zmmA, zmmB, zmmC);
- cc.evex().vunpcklpd(xmmA, xmmB, xmmC);
- cc.evex().vunpcklpd(ymmA, ymmB, ymmC);
- cc.evex().vunpcklpd(zmmA, zmmB, zmmC);
- cc.evex().vunpcklps(xmmA, xmmB, xmmC);
- cc.evex().vunpcklps(ymmA, ymmB, ymmC);
- cc.evex().vunpcklps(zmmA, zmmB, zmmC);
- cc.evex().vxorpd(xmmA, xmmB, xmmC);
- cc.evex().vxorpd(ymmA, ymmB, ymmC);
- cc.evex().vxorpd(zmmA, zmmB, zmmC);
- cc.evex().vxorps(xmmA, xmmB, xmmC);
- cc.evex().vxorps(ymmA, ymmB, ymmC);
- cc.evex().vxorps(zmmA, zmmB, zmmC);
- }
- else {
- x86::Mem m = x86::ptr(gpz);
- x86::Mem m32 = x86::dword_ptr(gpz);
- x86::Mem m64 = x86::qword_ptr(gpz);
- x86::Mem m128 = x86::xmmword_ptr(gpz);
- x86::Mem m256 = x86::ymmword_ptr(gpz);
- x86::Mem m512 = x86::zmmword_ptr(gpz);
- x86::Mem vx_ptr = x86::ptr(gpz, xmmD);
- x86::Mem vy_ptr = x86::ptr(gpz, ymmD);
- x86::Mem vz_ptr = x86::ptr(gpz, zmmD);
-
- cc.kmovb(kA, m);
- cc.kmovb(m, kB);
- cc.kmovd(kA, m);
- cc.kmovd(m, kB);
- cc.kmovq(kA, m);
- cc.kmovq(m, kB);
- cc.kmovw(kA, m);
- cc.kmovw(m, kB);
-
- cc.evex().vaddpd(xmmA, xmmB, m);
- cc.evex().vaddpd(ymmA, ymmB, m);
- cc.evex().vaddpd(zmmA, zmmB, m);
- cc.evex().vaddps(xmmA, xmmB, m);
- cc.evex().vaddps(ymmA, ymmB, m);
- cc.evex().vaddps(zmmA, zmmB, m);
- cc.evex().vaddsd(xmmA, xmmB, m);
- cc.evex().vaddss(xmmA, xmmB, m);
- cc.evex().valignd(xmmA, xmmB, m, 0);
- cc.evex().valignd(ymmA, ymmB, m, 0);
- cc.evex().valignd(zmmA, zmmB, m, 0);
- cc.evex().valignq(xmmA, xmmB, m, 0);
- cc.evex().valignq(ymmA, ymmB, m, 0);
- cc.evex().valignq(zmmA, zmmB, m, 0);
- cc.evex().vandnpd(xmmA, xmmB, m);
- cc.evex().vandnpd(ymmA, ymmB, m);
- cc.evex().vandnpd(zmmA, zmmB, m);
- cc.evex().vandnps(xmmA, xmmB, m);
- cc.evex().vandnps(ymmA, ymmB, m);
- cc.evex().vandnps(zmmA, zmmB, m);
- cc.evex().vandpd(xmmA, xmmB, m);
- cc.evex().vandpd(ymmA, ymmB, m);
- cc.evex().vandpd(zmmA, zmmB, m);
- cc.evex().vandps(xmmA, xmmB, m);
- cc.evex().vandps(ymmA, ymmB, m);
- cc.evex().vandps(zmmA, zmmB, m);
- cc.evex().vblendmpd(xmmA, xmmB, m);
- cc.evex().vblendmpd(ymmA, ymmB, m);
- cc.evex().vblendmpd(zmmA, zmmB, m);
- cc.evex().vblendmps(xmmA, xmmB, m);
- cc.evex().vblendmps(ymmA, ymmB, m);
- cc.evex().vblendmps(zmmA, zmmB, m);
- cc.evex().vbroadcastf32x2(ymmA, m);
- cc.evex().vbroadcastf32x2(zmmA, m);
- cc.evex().vbroadcastf32x4(ymmA, m);
- cc.evex().vbroadcastf32x4(zmmA, m);
- cc.evex().vbroadcastf32x8(zmmA, m);
- cc.evex().vbroadcastf64x2(ymmA, m);
- cc.evex().vbroadcastf64x2(zmmA, m);
- cc.evex().vbroadcastf64x4(zmmA, m);
- cc.evex().vbroadcasti32x2(xmmA, m);
- cc.evex().vbroadcasti32x2(ymmA, m);
- cc.evex().vbroadcasti32x2(zmmA, m);
- cc.evex().vbroadcasti32x4(ymmA, m);
- cc.evex().vbroadcasti32x4(zmmA, m);
- cc.evex().vbroadcasti32x8(zmmA, m);
- cc.evex().vbroadcasti64x2(ymmA, m);
- cc.evex().vbroadcasti64x2(zmmA, m);
- cc.evex().vbroadcasti64x4(zmmA, m);
- cc.evex().vbroadcastsd(ymmA, m);
- cc.evex().vbroadcastsd(zmmA, m);
- cc.evex().vbroadcastss(xmmA, m);
- cc.evex().vbroadcastss(ymmA, m);
- cc.evex().vbroadcastss(zmmA, m);
- cc.evex().vcmppd(kA, xmmB, m, 0);
- cc.evex().vcmppd(kA, ymmB, m, 0);
- cc.evex().vcmppd(kA, zmmB, m, 0);
- cc.evex().vcmpps(kA, xmmB, m, 0);
- cc.evex().vcmpps(kA, ymmB, m, 0);
- cc.evex().vcmpps(kA, zmmB, m, 0);
- cc.evex().vcmpsd(kA, xmmB, m, 0);
- cc.evex().vcmpss(kA, xmmB, m, 0);
- cc.evex().vcomisd(xmmA, m);
- cc.evex().vcomiss(xmmA, m);
- cc.evex().vcompresspd(m, xmmB);
- cc.evex().vcompresspd(m, ymmB);
- cc.evex().vcompresspd(m, zmmB);
- cc.evex().vcompressps(m, xmmB);
- cc.evex().vcompressps(m, ymmB);
- cc.evex().vcompressps(m, zmmB);
- cc.evex().vcvtdq2pd(xmmA, m);
- cc.evex().vcvtdq2pd(ymmA, m);
- cc.evex().vcvtdq2pd(zmmA, m);
- cc.evex().vcvtdq2ps(xmmA, m);
- cc.evex().vcvtdq2ps(ymmA, m);
- cc.evex().vcvtdq2ps(zmmA, m);
- cc.evex().vcvtpd2dq(xmmA, m128);
- cc.evex().vcvtpd2dq(xmmA, m256);
- cc.evex().vcvtpd2dq(ymmA, m512);
- cc.evex().vcvtpd2qq(xmmA, m);
- cc.evex().vcvtpd2qq(ymmA, m);
- cc.evex().vcvtpd2qq(zmmA, m);
- cc.evex().vcvtpd2udq(xmmA, m128);
- cc.evex().vcvtpd2udq(xmmA, m256);
- cc.evex().vcvtpd2udq(ymmA, m512);
- cc.evex().vcvtpd2uqq(xmmA, m);
- cc.evex().vcvtpd2uqq(ymmA, m);
- cc.evex().vcvtpd2uqq(zmmA, m);
- cc.evex().vcvtph2ps(xmmA, m);
- cc.evex().vcvtph2ps(ymmA, m);
- cc.evex().vcvtph2ps(zmmA, m);
- cc.evex().vcvtps2dq(xmmA, m);
- cc.evex().vcvtps2dq(ymmA, m);
- cc.evex().vcvtps2dq(zmmA, m);
- cc.evex().vcvtps2pd(xmmA, m);
- cc.evex().vcvtps2pd(ymmA, m);
- cc.evex().vcvtps2pd(zmmA, m);
- cc.evex().vcvtps2ph(m, xmmB, 0);
- cc.evex().vcvtps2ph(m, ymmB, 0);
- cc.evex().vcvtps2ph(m, zmmB, 0);
- cc.evex().vcvtps2qq(xmmA, m);
- cc.evex().vcvtps2qq(ymmA, m);
- cc.evex().vcvtps2qq(zmmA, m);
- cc.evex().vcvtps2udq(xmmA, m);
- cc.evex().vcvtps2udq(ymmA, m);
- cc.evex().vcvtps2udq(zmmA, m);
- cc.evex().vcvtps2uqq(xmmA, m);
- cc.evex().vcvtps2uqq(ymmA, m);
- cc.evex().vcvtps2uqq(zmmA, m);
- cc.evex().vcvtqq2pd(xmmA, m);
- cc.evex().vcvtqq2pd(ymmA, m);
- cc.evex().vcvtqq2pd(zmmA, m);
- cc.evex().vcvtqq2ps(xmmA, m128);
- cc.evex().vcvtqq2ps(xmmA, m256);
- cc.evex().vcvtqq2ps(ymmA, m512);
- cc.evex().vcvtsd2si(gpd, m);
- if (cc.is64Bit()) cc.evex().vcvtsd2si(gpq, m);
- cc.evex().vcvtsd2ss(xmmA, xmmB, m);
- cc.evex().vcvtsd2usi(gpd, m);
- if (cc.is64Bit()) cc.evex().vcvtsd2usi(gpq, m);
- cc.evex().vcvtsi2sd(xmmA, xmmB, m32);
- if (cc.is64Bit()) cc.evex().vcvtsi2sd(xmmA, xmmB, m64);
- cc.evex().vcvtsi2ss(xmmA, xmmB, m32);
- if (cc.is64Bit()) cc.evex().vcvtsi2ss(xmmA, xmmB, m64);
- cc.evex().vcvtss2sd(xmmA, xmmB, m);
- cc.evex().vcvtss2si(gpd, m);
- if (cc.is64Bit()) cc.evex().vcvtss2si(gpq, m);
- cc.evex().vcvtss2usi(gpd, m);
- if (cc.is64Bit()) cc.evex().vcvtss2usi(gpq, m);
- cc.evex().vcvttpd2dq(xmmA, m128);
- cc.evex().vcvttpd2dq(xmmA, m256);
- cc.evex().vcvttpd2dq(ymmA, m512);
- cc.evex().vcvttpd2qq(xmmA, m);
- cc.evex().vcvttpd2qq(ymmA, m);
- cc.evex().vcvttpd2qq(zmmA, m);
- cc.evex().vcvttpd2udq(xmmA, m128);
- cc.evex().vcvttpd2udq(xmmA, m256);
- cc.evex().vcvttpd2udq(ymmA, m512);
- cc.evex().vcvttpd2uqq(xmmA, m);
- cc.evex().vcvttpd2uqq(ymmA, m);
- cc.evex().vcvttpd2uqq(zmmA, m);
- cc.evex().vcvttps2dq(xmmA, m);
- cc.evex().vcvttps2dq(ymmA, m);
- cc.evex().vcvttps2dq(zmmA, m);
- cc.evex().vcvttps2qq(xmmA, m);
- cc.evex().vcvttps2qq(ymmA, m);
- cc.evex().vcvttps2qq(zmmA, m);
- cc.evex().vcvttps2udq(xmmA, m);
- cc.evex().vcvttps2udq(ymmA, m);
- cc.evex().vcvttps2udq(zmmA, m);
- cc.evex().vcvttps2uqq(xmmA, m);
- cc.evex().vcvttps2uqq(ymmA, m);
- cc.evex().vcvttps2uqq(zmmA, m);
- cc.evex().vcvttsd2si(gpd, m);
- if (cc.is64Bit()) cc.evex().vcvttsd2si(gpq, m);
- cc.evex().vcvttsd2usi(gpd, m);
- if (cc.is64Bit()) cc.evex().vcvttsd2usi(gpq, m);
- cc.evex().vcvttss2si(gpd, m);
- if (cc.is64Bit()) cc.evex().vcvttss2si(gpq, m);
- cc.evex().vcvttss2usi(gpd, m);
- if (cc.is64Bit()) cc.evex().vcvttss2usi(gpq, m);
- cc.evex().vcvtudq2pd(xmmA, m);
- cc.evex().vcvtudq2pd(ymmA, m);
- cc.evex().vcvtudq2pd(zmmA, m);
- cc.evex().vcvtudq2ps(xmmA, m);
- cc.evex().vcvtudq2ps(ymmA, m);
- cc.evex().vcvtudq2ps(zmmA, m);
- cc.evex().vcvtuqq2pd(xmmA, m);
- cc.evex().vcvtuqq2pd(ymmA, m);
- cc.evex().vcvtuqq2pd(zmmA, m);
- cc.evex().vcvtuqq2ps(xmmA, m128);
- cc.evex().vcvtuqq2ps(xmmA, m256);
- cc.evex().vcvtuqq2ps(ymmA, m512);
- cc.evex().vcvtusi2sd(xmmA, xmmB, m32);
- if (cc.is64Bit()) cc.evex().vcvtusi2sd(xmmA, xmmB, m64);
- cc.evex().vcvtusi2ss(xmmA, xmmB, m32);
- if (cc.is64Bit()) cc.evex().vcvtusi2ss(xmmA, xmmB, m64);
- cc.evex().vdbpsadbw(xmmA, xmmB, m, 0);
- cc.evex().vdbpsadbw(ymmA, ymmB, m, 0);
- cc.evex().vdbpsadbw(zmmA, zmmB, m, 0);
- cc.evex().vdivpd(xmmA, xmmB, m);
- cc.evex().vdivpd(ymmA, ymmB, m);
- cc.evex().vdivpd(zmmA, zmmB, m);
- cc.evex().vdivps(xmmA, xmmB, m);
- cc.evex().vdivps(ymmA, ymmB, m);
- cc.evex().vdivps(zmmA, zmmB, m);
- cc.evex().vdivsd(xmmA, xmmB, m);
- cc.evex().vdivss(xmmA, xmmB, m);
- cc.evex().vexp2pd(zmmA, m);
- cc.evex().vexp2ps(zmmA, m);
- cc.evex().vexpandpd(xmmA, m);
- cc.evex().vexpandpd(ymmA, m);
- cc.evex().vexpandpd(zmmA, m);
- cc.evex().vexpandps(xmmA, m);
- cc.evex().vexpandps(ymmA, m);
- cc.evex().vexpandps(zmmA, m);
- cc.evex().vextractf32x4(m, ymmB, 0);
- cc.evex().vextractf32x4(m, zmmB, 0);
- cc.evex().vextractf32x8(m, zmmB, 0);
- cc.evex().vextractf64x2(m, ymmB, 0);
- cc.evex().vextractf64x2(m, zmmB, 0);
- cc.evex().vextractf64x4(m, zmmB, 0);
- cc.evex().vextracti32x4(m, ymmB, 0);
- cc.evex().vextracti32x4(m, zmmB, 0);
- cc.evex().vextracti32x8(m, zmmB, 0);
- cc.evex().vextracti64x2(m, ymmB, 0);
- cc.evex().vextracti64x2(m, zmmB, 0);
- cc.evex().vextracti64x4(m, zmmB, 0);
- cc.evex().vextractps(m, xmmB, 0);
- cc.evex().vfixupimmpd(xmmA, xmmB, m, 0);
- cc.evex().vfixupimmpd(ymmA, ymmB, m, 0);
- cc.evex().vfixupimmpd(zmmA, zmmB, m, 0);
- cc.evex().vfixupimmps(xmmA, xmmB, m, 0);
- cc.evex().vfixupimmps(ymmA, ymmB, m, 0);
- cc.evex().vfixupimmps(zmmA, zmmB, m, 0);
- cc.evex().vfixupimmsd(xmmA, xmmB, m, 0);
- cc.evex().vfixupimmss(xmmA, xmmB, m, 0);
- cc.evex().vfmadd132pd(xmmA, xmmB, m);
- cc.evex().vfmadd132pd(ymmA, ymmB, m);
- cc.evex().vfmadd132pd(zmmA, zmmB, m);
- cc.evex().vfmadd132ps(xmmA, xmmB, m);
- cc.evex().vfmadd132ps(ymmA, ymmB, m);
- cc.evex().vfmadd132ps(zmmA, zmmB, m);
- cc.evex().vfmadd132sd(xmmA, xmmB, m);
- cc.evex().vfmadd132ss(xmmA, xmmB, m);
- cc.evex().vfmadd213pd(xmmA, xmmB, m);
- cc.evex().vfmadd213pd(ymmA, ymmB, m);
- cc.evex().vfmadd213pd(zmmA, zmmB, m);
- cc.evex().vfmadd213ps(xmmA, xmmB, m);
- cc.evex().vfmadd213ps(ymmA, ymmB, m);
- cc.evex().vfmadd213ps(zmmA, zmmB, m);
- cc.evex().vfmadd213sd(xmmA, xmmB, m);
- cc.evex().vfmadd213ss(xmmA, xmmB, m);
- cc.evex().vfmadd231pd(xmmA, xmmB, m);
- cc.evex().vfmadd231pd(ymmA, ymmB, m);
- cc.evex().vfmadd231pd(zmmA, zmmB, m);
- cc.evex().vfmadd231ps(xmmA, xmmB, m);
- cc.evex().vfmadd231ps(ymmA, ymmB, m);
- cc.evex().vfmadd231ps(zmmA, zmmB, m);
- cc.evex().vfmadd231sd(xmmA, xmmB, m);
- cc.evex().vfmadd231ss(xmmA, xmmB, m);
- cc.evex().vfmaddsub132pd(xmmA, xmmB, m);
- cc.evex().vfmaddsub132pd(ymmA, ymmB, m);
- cc.evex().vfmaddsub132pd(zmmA, zmmB, m);
- cc.evex().vfmaddsub132ps(xmmA, xmmB, m);
- cc.evex().vfmaddsub132ps(ymmA, ymmB, m);
- cc.evex().vfmaddsub132ps(zmmA, zmmB, m);
- cc.evex().vfmaddsub213pd(xmmA, xmmB, m);
- cc.evex().vfmaddsub213pd(ymmA, ymmB, m);
- cc.evex().vfmaddsub213pd(zmmA, zmmB, m);
- cc.evex().vfmaddsub213ps(xmmA, xmmB, m);
- cc.evex().vfmaddsub213ps(ymmA, ymmB, m);
- cc.evex().vfmaddsub213ps(zmmA, zmmB, m);
- cc.evex().vfmaddsub231pd(xmmA, xmmB, m);
- cc.evex().vfmaddsub231pd(ymmA, ymmB, m);
- cc.evex().vfmaddsub231pd(zmmA, zmmB, m);
- cc.evex().vfmaddsub231ps(xmmA, xmmB, m);
- cc.evex().vfmaddsub231ps(ymmA, ymmB, m);
- cc.evex().vfmaddsub231ps(zmmA, zmmB, m);
- cc.evex().vfmsub132pd(xmmA, xmmB, m);
- cc.evex().vfmsub132pd(ymmA, ymmB, m);
- cc.evex().vfmsub132pd(zmmA, zmmB, m);
- cc.evex().vfmsub132ps(xmmA, xmmB, m);
- cc.evex().vfmsub132ps(ymmA, ymmB, m);
- cc.evex().vfmsub132ps(zmmA, zmmB, m);
- cc.evex().vfmsub132sd(xmmA, xmmB, m);
- cc.evex().vfmsub132ss(xmmA, xmmB, m);
- cc.evex().vfmsub213pd(xmmA, xmmB, m);
- cc.evex().vfmsub213pd(ymmA, ymmB, m);
- cc.evex().vfmsub213pd(zmmA, zmmB, m);
- cc.evex().vfmsub213ps(xmmA, xmmB, m);
- cc.evex().vfmsub213ps(ymmA, ymmB, m);
- cc.evex().vfmsub213ps(zmmA, zmmB, m);
- cc.evex().vfmsub213sd(xmmA, xmmB, m);
- cc.evex().vfmsub213ss(xmmA, xmmB, m);
- cc.evex().vfmsub231pd(xmmA, xmmB, m);
- cc.evex().vfmsub231pd(ymmA, ymmB, m);
- cc.evex().vfmsub231pd(zmmA, zmmB, m);
- cc.evex().vfmsub231ps(xmmA, xmmB, m);
- cc.evex().vfmsub231ps(ymmA, ymmB, m);
- cc.evex().vfmsub231ps(zmmA, zmmB, m);
- cc.evex().vfmsub231sd(xmmA, xmmB, m);
- cc.evex().vfmsub231ss(xmmA, xmmB, m);
- cc.evex().vfmsubadd132pd(xmmA, xmmB, m);
- cc.evex().vfmsubadd132pd(ymmA, ymmB, m);
- cc.evex().vfmsubadd132pd(zmmA, zmmB, m);
- cc.evex().vfmsubadd132ps(xmmA, xmmB, m);
- cc.evex().vfmsubadd132ps(ymmA, ymmB, m);
- cc.evex().vfmsubadd132ps(zmmA, zmmB, m);
- cc.evex().vfmsubadd213pd(xmmA, xmmB, m);
- cc.evex().vfmsubadd213pd(ymmA, ymmB, m);
- cc.evex().vfmsubadd213pd(zmmA, zmmB, m);
- cc.evex().vfmsubadd213ps(xmmA, xmmB, m);
- cc.evex().vfmsubadd213ps(ymmA, ymmB, m);
- cc.evex().vfmsubadd213ps(zmmA, zmmB, m);
- cc.evex().vfmsubadd231pd(xmmA, xmmB, m);
- cc.evex().vfmsubadd231pd(ymmA, ymmB, m);
- cc.evex().vfmsubadd231pd(zmmA, zmmB, m);
- cc.evex().vfmsubadd231ps(xmmA, xmmB, m);
- cc.evex().vfmsubadd231ps(ymmA, ymmB, m);
- cc.evex().vfmsubadd231ps(zmmA, zmmB, m);
- cc.evex().vfnmadd132pd(xmmA, xmmB, m);
- cc.evex().vfnmadd132pd(ymmA, ymmB, m);
- cc.evex().vfnmadd132pd(zmmA, zmmB, m);
- cc.evex().vfnmadd132ps(xmmA, xmmB, m);
- cc.evex().vfnmadd132ps(ymmA, ymmB, m);
- cc.evex().vfnmadd132ps(zmmA, zmmB, m);
- cc.evex().vfnmadd132sd(xmmA, xmmB, m);
- cc.evex().vfnmadd132ss(xmmA, xmmB, m);
- cc.evex().vfnmadd213pd(xmmA, xmmB, m);
- cc.evex().vfnmadd213pd(ymmA, ymmB, m);
- cc.evex().vfnmadd213pd(zmmA, zmmB, m);
- cc.evex().vfnmadd213ps(xmmA, xmmB, m);
- cc.evex().vfnmadd213ps(ymmA, ymmB, m);
- cc.evex().vfnmadd213ps(zmmA, zmmB, m);
- cc.evex().vfnmadd213sd(xmmA, xmmB, m);
- cc.evex().vfnmadd213ss(xmmA, xmmB, m);
- cc.evex().vfnmadd231pd(xmmA, xmmB, m);
- cc.evex().vfnmadd231pd(ymmA, ymmB, m);
- cc.evex().vfnmadd231pd(zmmA, zmmB, m);
- cc.evex().vfnmadd231ps(xmmA, xmmB, m);
- cc.evex().vfnmadd231ps(ymmA, ymmB, m);
- cc.evex().vfnmadd231ps(zmmA, zmmB, m);
- cc.evex().vfnmadd231sd(xmmA, xmmB, m);
- cc.evex().vfnmadd231ss(xmmA, xmmB, m);
- cc.evex().vfnmsub132pd(xmmA, xmmB, m);
- cc.evex().vfnmsub132pd(ymmA, ymmB, m);
- cc.evex().vfnmsub132pd(zmmA, zmmB, m);
- cc.evex().vfnmsub132ps(xmmA, xmmB, m);
- cc.evex().vfnmsub132ps(ymmA, ymmB, m);
- cc.evex().vfnmsub132ps(zmmA, zmmB, m);
- cc.evex().vfnmsub132sd(xmmA, xmmB, m);
- cc.evex().vfnmsub132ss(xmmA, xmmB, m);
- cc.evex().vfnmsub213pd(xmmA, xmmB, m);
- cc.evex().vfnmsub213pd(ymmA, ymmB, m);
- cc.evex().vfnmsub213pd(zmmA, zmmB, m);
- cc.evex().vfnmsub213ps(xmmA, xmmB, m);
- cc.evex().vfnmsub213ps(ymmA, ymmB, m);
- cc.evex().vfnmsub213ps(zmmA, zmmB, m);
- cc.evex().vfnmsub213sd(xmmA, xmmB, m);
- cc.evex().vfnmsub213ss(xmmA, xmmB, m);
- cc.evex().vfnmsub231pd(xmmA, xmmB, m);
- cc.evex().vfnmsub231pd(ymmA, ymmB, m);
- cc.evex().vfnmsub231pd(zmmA, zmmB, m);
- cc.evex().vfnmsub231ps(xmmA, xmmB, m);
- cc.evex().vfnmsub231ps(ymmA, ymmB, m);
- cc.evex().vfnmsub231ps(zmmA, zmmB, m);
- cc.evex().vfnmsub231sd(xmmA, xmmB, m);
- cc.evex().vfnmsub231ss(xmmA, xmmB, m);
- cc.evex().vfpclasspd(kA, m128, 0);
- cc.evex().vfpclasspd(kA, m256, 0);
- cc.evex().vfpclasspd(kA, m512, 0);
- cc.evex().vfpclassps(kA, m128, 0);
- cc.evex().vfpclassps(kA, m256, 0);
- cc.evex().vfpclassps(kA, m512, 0);
- cc.evex().vfpclasssd(kA, m, 0);
- cc.evex().vfpclassss(kA, m, 0);
- cc.evex().k(kA).vgatherdpd(xmmA, vx_ptr);
- cc.evex().k(kA).vgatherdpd(ymmA, vx_ptr);
- cc.evex().k(kA).vgatherdpd(zmmA, vy_ptr);
- cc.evex().k(kA).vgatherdps(xmmA, vx_ptr);
- cc.evex().k(kA).vgatherdps(ymmA, vy_ptr);
- cc.evex().k(kA).vgatherdps(zmmA, vz_ptr);
- cc.evex().k(kA).vgatherpf0dpd(vy_ptr);
- cc.evex().k(kA).vgatherpf0dps(vz_ptr);
- cc.evex().k(kA).vgatherpf0qpd(vz_ptr);
- cc.evex().k(kA).vgatherpf0qps(vz_ptr);
- cc.evex().k(kA).vgatherpf1dpd(vy_ptr);
- cc.evex().k(kA).vgatherpf1dps(vz_ptr);
- cc.evex().k(kA).vgatherpf1qpd(vz_ptr);
- cc.evex().k(kA).vgatherpf1qps(vz_ptr);
- cc.evex().k(kA).vgatherqpd(xmmA, vx_ptr);
- cc.evex().k(kA).vgatherqpd(ymmA, vy_ptr);
- cc.evex().k(kA).vgatherqpd(zmmA, vz_ptr);
- cc.evex().k(kA).vgatherqps(xmmA, vx_ptr);
- cc.evex().k(kA).vgatherqps(xmmA, vy_ptr);
- cc.evex().k(kA).vgatherqps(ymmA, vz_ptr);
- cc.evex().vgetexppd(xmmA, m);
- cc.evex().vgetexppd(ymmA, m);
- cc.evex().vgetexppd(zmmA, m);
- cc.evex().vgetexpps(xmmA, m);
- cc.evex().vgetexpps(ymmA, m);
- cc.evex().vgetexpps(zmmA, m);
- cc.evex().vgetexpsd(xmmA, xmmB, m);
- cc.evex().vgetexpss(xmmA, xmmB, m);
- cc.evex().vgetmantpd(xmmA, m, 0);
- cc.evex().vgetmantpd(ymmA, m, 0);
- cc.evex().vgetmantpd(zmmA, m, 0);
- cc.evex().vgetmantps(xmmA, m, 0);
- cc.evex().vgetmantps(ymmA, m, 0);
- cc.evex().vgetmantps(zmmA, m, 0);
- cc.evex().vgetmantsd(xmmA, xmmB, m, 0);
- cc.evex().vgetmantss(xmmA, xmmB, m, 0);
- cc.evex().vinsertf32x4(ymmA, ymmB, m, 0);
- cc.evex().vinsertf32x4(zmmA, zmmB, m, 0);
- cc.evex().vinsertf32x8(zmmA, zmmB, m, 0);
- cc.evex().vinsertf64x2(ymmA, ymmB, m, 0);
- cc.evex().vinsertf64x2(zmmA, zmmB, m, 0);
- cc.evex().vinsertf64x4(zmmA, zmmB, m, 0);
- cc.evex().vinserti32x4(ymmA, ymmB, m, 0);
- cc.evex().vinserti32x4(zmmA, zmmB, m, 0);
- cc.evex().vinserti32x8(zmmA, zmmB, m, 0);
- cc.evex().vinserti64x2(ymmA, ymmB, m, 0);
- cc.evex().vinserti64x2(zmmA, zmmB, m, 0);
- cc.evex().vinserti64x4(zmmA, zmmB, m, 0);
- cc.evex().vinsertps(xmmA, xmmB, m, 0);
- cc.evex().vmaxpd(xmmA, xmmB, m);
- cc.evex().vmaxpd(ymmA, ymmB, m);
- cc.evex().vmaxpd(zmmA, zmmB, m);
- cc.evex().vmaxps(xmmA, xmmB, m);
- cc.evex().vmaxps(ymmA, ymmB, m);
- cc.evex().vmaxps(zmmA, zmmB, m);
- cc.evex().vmaxsd(xmmA, xmmB, m);
- cc.evex().vmaxss(xmmA, xmmB, m);
- cc.evex().vminpd(xmmA, xmmB, m);
- cc.evex().vminpd(ymmA, ymmB, m);
- cc.evex().vminpd(zmmA, zmmB, m);
- cc.evex().vminps(xmmA, xmmB, m);
- cc.evex().vminps(ymmA, ymmB, m);
- cc.evex().vminps(zmmA, zmmB, m);
- cc.evex().vminsd(xmmA, xmmB, m);
- cc.evex().vminss(xmmA, xmmB, m);
- cc.evex().vmovapd(xmmA, m);
- cc.evex().vmovapd(m, xmmB);
- cc.evex().vmovapd(ymmA, m);
- cc.evex().vmovapd(m, ymmB);
- cc.evex().vmovapd(zmmA, m);
- cc.evex().vmovapd(m, zmmB);
- cc.evex().vmovaps(xmmA, m);
- cc.evex().vmovaps(m, xmmB);
- cc.evex().vmovaps(ymmA, m);
- cc.evex().vmovaps(m, ymmB);
- cc.evex().vmovaps(zmmA, m);
- cc.evex().vmovaps(m, zmmB);
- cc.evex().vmovd(m, xmmB);
- cc.evex().vmovd(xmmA, m);
- cc.evex().vmovddup(xmmA, m);
- cc.evex().vmovddup(ymmA, m);
- cc.evex().vmovddup(zmmA, m);
- cc.evex().vmovdqa32(xmmA, m);
- cc.evex().vmovdqa32(m, xmmB);
- cc.evex().vmovdqa32(ymmA, m);
- cc.evex().vmovdqa32(m, ymmB);
- cc.evex().vmovdqa32(zmmA, m);
- cc.evex().vmovdqa32(m, zmmB);
- cc.evex().vmovdqa64(xmmA, m);
- cc.evex().vmovdqa64(m, xmmB);
- cc.evex().vmovdqa64(ymmA, m);
- cc.evex().vmovdqa64(m, ymmB);
- cc.evex().vmovdqa64(zmmA, m);
- cc.evex().vmovdqa64(m, zmmB);
- cc.evex().vmovdqu16(xmmA, m);
- cc.evex().vmovdqu16(m, xmmB);
- cc.evex().vmovdqu16(ymmA, m);
- cc.evex().vmovdqu16(m, ymmB);
- cc.evex().vmovdqu16(zmmA, m);
- cc.evex().vmovdqu16(m, zmmB);
- cc.evex().vmovdqu32(xmmA, m);
- cc.evex().vmovdqu32(m, xmmB);
- cc.evex().vmovdqu32(ymmA, m);
- cc.evex().vmovdqu32(m, ymmB);
- cc.evex().vmovdqu32(zmmA, m);
- cc.evex().vmovdqu32(m, zmmB);
- cc.evex().vmovdqu64(xmmA, m);
- cc.evex().vmovdqu64(m, xmmB);
- cc.evex().vmovdqu64(ymmA, m);
- cc.evex().vmovdqu64(m, ymmB);
- cc.evex().vmovdqu64(zmmA, m);
- cc.evex().vmovdqu64(m, zmmB);
- cc.evex().vmovdqu8(xmmA, m);
- cc.evex().vmovdqu8(m, xmmB);
- cc.evex().vmovdqu8(ymmA, m);
- cc.evex().vmovdqu8(m, ymmB);
- cc.evex().vmovdqu8(zmmA, m);
- cc.evex().vmovdqu8(m, zmmB);
- cc.evex().vmovhpd(m, xmmB);
- cc.evex().vmovhpd(xmmA, xmmB, m);
- cc.evex().vmovhps(m, xmmB);
- cc.evex().vmovhps(xmmA, xmmB, m);
- cc.evex().vmovlpd(m, xmmB);
- cc.evex().vmovlpd(xmmA, xmmB, m);
- cc.evex().vmovlps(m, xmmB);
- cc.evex().vmovlps(xmmA, xmmB, m);
- cc.evex().vmovntdq(m, xmmB);
- cc.evex().vmovntdq(m, ymmB);
- cc.evex().vmovntdq(m, zmmB);
- cc.evex().vmovntdqa(xmmA, m);
- cc.evex().vmovntdqa(ymmA, m);
- cc.evex().vmovntdqa(zmmA, m);
- cc.evex().vmovntpd(m, xmmB);
- cc.evex().vmovntpd(m, ymmB);
- cc.evex().vmovntpd(m, zmmB);
- cc.evex().vmovntps(m, xmmB);
- cc.evex().vmovntps(m, ymmB);
- cc.evex().vmovntps(m, zmmB);
- cc.evex().vmovq(m, xmmB);
- cc.evex().vmovq(xmmA, m);
- cc.evex().vmovq(xmmA, m);
- cc.evex().vmovq(m, xmmB);
- cc.evex().vmovsd(m, xmmB);
- cc.evex().vmovsd(xmmA, m);
- cc.evex().vmovshdup(xmmA, m);
- cc.evex().vmovshdup(ymmA, m);
- cc.evex().vmovshdup(zmmA, m);
- cc.evex().vmovsldup(xmmA, m);
- cc.evex().vmovsldup(ymmA, m);
- cc.evex().vmovsldup(zmmA, m);
- cc.evex().vmovss(m, xmmB);
- cc.evex().vmovss(xmmA, m);
- cc.evex().vmovupd(xmmA, m);
- cc.evex().vmovupd(m, xmmB);
- cc.evex().vmovupd(ymmA, m);
- cc.evex().vmovupd(m, ymmB);
- cc.evex().vmovupd(zmmA, m);
- cc.evex().vmovupd(m, zmmB);
- cc.evex().vmovups(xmmA, m);
- cc.evex().vmovups(m, xmmB);
- cc.evex().vmovups(ymmA, m);
- cc.evex().vmovups(m, ymmB);
- cc.evex().vmovups(zmmA, m);
- cc.evex().vmovups(m, zmmB);
- cc.evex().vmulpd(xmmA, xmmB, m);
- cc.evex().vmulpd(ymmA, ymmB, m);
- cc.evex().vmulpd(zmmA, zmmB, m);
- cc.evex().vmulps(xmmA, xmmB, m);
- cc.evex().vmulps(ymmA, ymmB, m);
- cc.evex().vmulps(zmmA, zmmB, m);
- cc.evex().vmulsd(xmmA, xmmB, m);
- cc.evex().vmulss(xmmA, xmmB, m);
- cc.evex().vorpd(xmmA, xmmB, m);
- cc.evex().vorpd(ymmA, ymmB, m);
- cc.evex().vorpd(zmmA, zmmB, m);
- cc.evex().vorps(xmmA, xmmB, m);
- cc.evex().vorps(ymmA, ymmB, m);
- cc.evex().vorps(zmmA, zmmB, m);
- cc.evex().vpabsb(xmmA, m);
- cc.evex().vpabsb(ymmA, m);
- cc.evex().vpabsb(zmmA, m);
- cc.evex().vpabsd(xmmA, m);
- cc.evex().vpabsd(ymmA, m);
- cc.evex().vpabsd(zmmA, m);
- cc.evex().vpabsq(xmmA, m);
- cc.evex().vpabsq(ymmA, m);
- cc.evex().vpabsq(zmmA, m);
- cc.evex().vpabsw(xmmA, m);
- cc.evex().vpabsw(ymmA, m);
- cc.evex().vpabsw(zmmA, m);
- cc.evex().vpackssdw(xmmA, xmmB, m);
- cc.evex().vpackssdw(ymmA, ymmB, m);
- cc.evex().vpackssdw(zmmA, zmmB, m);
- cc.evex().vpacksswb(xmmA, xmmB, m);
- cc.evex().vpacksswb(ymmA, ymmB, m);
- cc.evex().vpacksswb(zmmA, zmmB, m);
- cc.evex().vpackusdw(xmmA, xmmB, m);
- cc.evex().vpackusdw(ymmA, ymmB, m);
- cc.evex().vpackusdw(zmmA, zmmB, m);
- cc.evex().vpackuswb(xmmA, xmmB, m);
- cc.evex().vpackuswb(ymmA, ymmB, m);
- cc.evex().vpackuswb(zmmA, zmmB, m);
- cc.evex().vpaddb(xmmA, xmmB, m);
- cc.evex().vpaddb(ymmA, ymmB, m);
- cc.evex().vpaddb(zmmA, zmmB, m);
- cc.evex().vpaddd(xmmA, xmmB, m);
- cc.evex().vpaddd(ymmA, ymmB, m);
- cc.evex().vpaddd(zmmA, zmmB, m);
- cc.evex().vpaddq(xmmA, xmmB, m);
- cc.evex().vpaddq(ymmA, ymmB, m);
- cc.evex().vpaddq(zmmA, zmmB, m);
- cc.evex().vpaddsb(xmmA, xmmB, m);
- cc.evex().vpaddsb(ymmA, ymmB, m);
- cc.evex().vpaddsb(zmmA, zmmB, m);
- cc.evex().vpaddsw(xmmA, xmmB, m);
- cc.evex().vpaddsw(ymmA, ymmB, m);
- cc.evex().vpaddsw(zmmA, zmmB, m);
- cc.evex().vpaddusb(xmmA, xmmB, m);
- cc.evex().vpaddusb(ymmA, ymmB, m);
- cc.evex().vpaddusb(zmmA, zmmB, m);
- cc.evex().vpaddusw(xmmA, xmmB, m);
- cc.evex().vpaddusw(ymmA, ymmB, m);
- cc.evex().vpaddusw(zmmA, zmmB, m);
- cc.evex().vpaddw(xmmA, xmmB, m);
- cc.evex().vpaddw(ymmA, ymmB, m);
- cc.evex().vpaddw(zmmA, zmmB, m);
- cc.evex().vpalignr(xmmA, xmmB, m, 0);
- cc.evex().vpalignr(ymmA, ymmB, m, 0);
- cc.evex().vpalignr(zmmA, zmmB, m, 0);
- cc.evex().vpandd(xmmA, xmmB, m);
- cc.evex().vpandd(ymmA, ymmB, m);
- cc.evex().vpandd(zmmA, zmmB, m);
- cc.evex().vpandnd(xmmA, xmmB, m);
- cc.evex().vpandnd(ymmA, ymmB, m);
- cc.evex().vpandnd(zmmA, zmmB, m);
- cc.evex().vpandnq(xmmA, xmmB, m);
- cc.evex().vpandnq(ymmA, ymmB, m);
- cc.evex().vpandnq(zmmA, zmmB, m);
- cc.evex().vpandq(xmmA, xmmB, m);
- cc.evex().vpandq(ymmA, ymmB, m);
- cc.evex().vpandq(zmmA, zmmB, m);
- cc.evex().vpavgb(xmmA, xmmB, m);
- cc.evex().vpavgb(ymmA, ymmB, m);
- cc.evex().vpavgb(zmmA, zmmB, m);
- cc.evex().vpavgw(xmmA, xmmB, m);
- cc.evex().vpavgw(ymmA, ymmB, m);
- cc.evex().vpavgw(zmmA, zmmB, m);
- cc.evex().vpblendmb(xmmA, xmmB, m);
- cc.evex().vpblendmb(ymmA, ymmB, m);
- cc.evex().vpblendmb(zmmA, zmmB, m);
- cc.evex().vpblendmd(xmmA, xmmB, m);
- cc.evex().vpblendmd(ymmA, ymmB, m);
- cc.evex().vpblendmd(zmmA, zmmB, m);
- cc.evex().vpblendmq(xmmA, xmmB, m);
- cc.evex().vpblendmq(ymmA, ymmB, m);
- cc.evex().vpblendmq(zmmA, zmmB, m);
- cc.evex().vpblendmw(xmmA, xmmB, m);
- cc.evex().vpblendmw(ymmA, ymmB, m);
- cc.evex().vpblendmw(zmmA, zmmB, m);
- cc.evex().vpbroadcastb(xmmA, m);
- cc.evex().vpbroadcastb(ymmA, m);
- cc.evex().vpbroadcastb(zmmA, m);
- cc.evex().vpbroadcastd(xmmA, m);
- cc.evex().vpbroadcastd(ymmA, m);
- cc.evex().vpbroadcastd(zmmA, m);
- cc.evex().vpbroadcastq(xmmA, m);
- cc.evex().vpbroadcastq(ymmA, m);
- cc.evex().vpbroadcastq(zmmA, m);
- cc.evex().vpbroadcastw(xmmA, m);
- cc.evex().vpbroadcastw(ymmA, m);
- cc.evex().vpbroadcastw(zmmA, m);
- cc.evex().vpcmpb(kA, xmmB, m, 0);
- cc.evex().vpcmpb(kA, ymmB, m, 0);
- cc.evex().vpcmpb(kA, zmmB, m, 0);
- cc.evex().vpcmpd(kA, xmmB, m, 0);
- cc.evex().vpcmpd(kA, ymmB, m, 0);
- cc.evex().vpcmpd(kA, zmmB, m, 0);
- cc.evex().vpcmpeqb(kA, xmmB, m);
- cc.evex().vpcmpeqb(kA, ymmB, m);
- cc.evex().vpcmpeqb(kA, zmmB, m);
- cc.evex().vpcmpeqd(kA, xmmB, m);
- cc.evex().vpcmpeqd(kA, ymmB, m);
- cc.evex().vpcmpeqd(kA, zmmB, m);
- cc.evex().vpcmpeqq(kA, xmmB, m);
- cc.evex().vpcmpeqq(kA, ymmB, m);
- cc.evex().vpcmpeqq(kA, zmmB, m);
- cc.evex().vpcmpeqw(kA, xmmB, m);
- cc.evex().vpcmpeqw(kA, ymmB, m);
- cc.evex().vpcmpeqw(kA, zmmB, m);
- cc.evex().vpcmpgtb(kA, xmmB, m);
- cc.evex().vpcmpgtb(kA, ymmB, m);
- cc.evex().vpcmpgtb(kA, zmmB, m);
- cc.evex().vpcmpgtd(kA, xmmB, m);
- cc.evex().vpcmpgtd(kA, ymmB, m);
- cc.evex().vpcmpgtd(kA, zmmB, m);
- cc.evex().vpcmpgtq(kA, xmmB, m);
- cc.evex().vpcmpgtq(kA, ymmB, m);
- cc.evex().vpcmpgtq(kA, zmmB, m);
- cc.evex().vpcmpgtw(kA, xmmB, m);
- cc.evex().vpcmpgtw(kA, ymmB, m);
- cc.evex().vpcmpgtw(kA, zmmB, m);
- cc.evex().vpcmpq(kA, xmmB, m, 0);
- cc.evex().vpcmpq(kA, ymmB, m, 0);
- cc.evex().vpcmpq(kA, zmmB, m, 0);
- cc.evex().vpcmpub(kA, xmmB, m, 0);
- cc.evex().vpcmpub(kA, ymmB, m, 0);
- cc.evex().vpcmpub(kA, zmmB, m, 0);
- cc.evex().vpcmpud(kA, xmmB, m, 0);
- cc.evex().vpcmpud(kA, ymmB, m, 0);
- cc.evex().vpcmpud(kA, zmmB, m, 0);
- cc.evex().vpcmpuq(kA, xmmB, m, 0);
- cc.evex().vpcmpuq(kA, ymmB, m, 0);
- cc.evex().vpcmpuq(kA, zmmB, m, 0);
- cc.evex().vpcmpuw(kA, xmmB, m, 0);
- cc.evex().vpcmpuw(kA, ymmB, m, 0);
- cc.evex().vpcmpuw(kA, zmmB, m, 0);
- cc.evex().vpcmpw(kA, xmmB, m, 0);
- cc.evex().vpcmpw(kA, ymmB, m, 0);
- cc.evex().vpcmpw(kA, zmmB, m, 0);
- cc.evex().vpcompressd(m, xmmB);
- cc.evex().vpcompressd(m, ymmB);
- cc.evex().vpcompressd(m, zmmB);
- cc.evex().vpcompressq(m, xmmB);
- cc.evex().vpcompressq(m, ymmB);
- cc.evex().vpcompressq(m, zmmB);
- cc.evex().vpconflictd(xmmA, m);
- cc.evex().vpconflictd(ymmA, m);
- cc.evex().vpconflictd(zmmA, m);
- cc.evex().vpconflictq(xmmA, m);
- cc.evex().vpconflictq(ymmA, m);
- cc.evex().vpconflictq(zmmA, m);
- cc.evex().vpermb(xmmA, xmmB, m);
- cc.evex().vpermb(ymmA, ymmB, m);
- cc.evex().vpermb(zmmA, zmmB, m);
- cc.evex().vpermd(ymmA, ymmB, m);
- cc.evex().vpermd(zmmA, zmmB, m);
- cc.evex().vpermi2b(xmmA, xmmB, m);
- cc.evex().vpermi2b(ymmA, ymmB, m);
- cc.evex().vpermi2b(zmmA, zmmB, m);
- cc.evex().vpermi2d(xmmA, xmmB, m);
- cc.evex().vpermi2d(ymmA, ymmB, m);
- cc.evex().vpermi2d(zmmA, zmmB, m);
- cc.evex().vpermi2pd(xmmA, xmmB, m);
- cc.evex().vpermi2pd(ymmA, ymmB, m);
- cc.evex().vpermi2pd(zmmA, zmmB, m);
- cc.evex().vpermi2ps(xmmA, xmmB, m);
- cc.evex().vpermi2ps(ymmA, ymmB, m);
- cc.evex().vpermi2ps(zmmA, zmmB, m);
- cc.evex().vpermi2q(xmmA, xmmB, m);
- cc.evex().vpermi2q(ymmA, ymmB, m);
- cc.evex().vpermi2q(zmmA, zmmB, m);
- cc.evex().vpermi2w(xmmA, xmmB, m);
- cc.evex().vpermi2w(ymmA, ymmB, m);
- cc.evex().vpermi2w(zmmA, zmmB, m);
- cc.evex().vpermilpd(xmmA, xmmB, m);
- cc.evex().vpermilpd(ymmA, ymmB, m);
- cc.evex().vpermilpd(zmmA, zmmB, m);
- cc.evex().vpermilpd(xmmA, m, 0);
- cc.evex().vpermilpd(ymmA, m, 0);
- cc.evex().vpermilpd(zmmA, m, 0);
- cc.evex().vpermilps(xmmA, xmmB, m);
- cc.evex().vpermilps(ymmA, ymmB, m);
- cc.evex().vpermilps(zmmA, zmmB, m);
- cc.evex().vpermilps(xmmA, m, 0);
- cc.evex().vpermilps(ymmA, m, 0);
- cc.evex().vpermilps(zmmA, m, 0);
- cc.evex().vpermq(ymmA, ymmB, m);
- cc.evex().vpermq(zmmA, zmmB, m);
- cc.evex().vpermq(ymmA, m, 0);
- cc.evex().vpermq(zmmA, m, 0);
- cc.evex().vpermt2b(xmmA, xmmB, m);
- cc.evex().vpermt2b(ymmA, ymmB, m);
- cc.evex().vpermt2b(zmmA, zmmB, m);
- cc.evex().vpermt2d(xmmA, xmmB, m);
- cc.evex().vpermt2d(ymmA, ymmB, m);
- cc.evex().vpermt2d(zmmA, zmmB, m);
- cc.evex().vpermt2pd(xmmA, xmmB, m);
- cc.evex().vpermt2pd(ymmA, ymmB, m);
- cc.evex().vpermt2pd(zmmA, zmmB, m);
- cc.evex().vpermt2ps(xmmA, xmmB, m);
- cc.evex().vpermt2ps(ymmA, ymmB, m);
- cc.evex().vpermt2ps(zmmA, zmmB, m);
- cc.evex().vpermt2q(xmmA, xmmB, m);
- cc.evex().vpermt2q(ymmA, ymmB, m);
- cc.evex().vpermt2q(zmmA, zmmB, m);
- cc.evex().vpermt2w(xmmA, xmmB, m);
- cc.evex().vpermt2w(ymmA, ymmB, m);
- cc.evex().vpermt2w(zmmA, zmmB, m);
- cc.evex().vpermw(xmmA, xmmB, m);
- cc.evex().vpermw(ymmA, ymmB, m);
- cc.evex().vpermw(zmmA, zmmB, m);
- cc.evex().vpexpandd(xmmA, m);
- cc.evex().vpexpandd(ymmA, m);
- cc.evex().vpexpandd(zmmA, m);
- cc.evex().vpexpandq(xmmA, m);
- cc.evex().vpexpandq(ymmA, m);
- cc.evex().vpexpandq(zmmA, m);
- cc.evex().vpextrb(m, xmmB, 0);
- cc.evex().vpextrd(m, xmmB, 0);
- if (cc.is64Bit()) cc.evex().vpextrq(m, xmmB, 0);
- cc.evex().vpextrw(m, xmmB, 0);
- cc.evex().k(kA).vpgatherdd(xmmA, vx_ptr);
- cc.evex().k(kA).vpgatherdd(ymmA, vy_ptr);
- cc.evex().k(kA).vpgatherdd(zmmA, vz_ptr);
- cc.evex().k(kA).vpgatherdq(xmmA, vx_ptr);
- cc.evex().k(kA).vpgatherdq(ymmA, vx_ptr);
- cc.evex().k(kA).vpgatherdq(zmmA, vy_ptr);
- cc.evex().k(kA).vpgatherqd(xmmA, vx_ptr);
- cc.evex().k(kA).vpgatherqd(xmmA, vy_ptr);
- cc.evex().k(kA).vpgatherqd(ymmA, vz_ptr);
- cc.evex().k(kA).vpgatherqq(xmmA, vx_ptr);
- cc.evex().k(kA).vpgatherqq(ymmA, vy_ptr);
- cc.evex().k(kA).vpgatherqq(zmmA, vz_ptr);
- cc.evex().vpinsrb(xmmA, xmmB, m, 0);
- cc.evex().vpinsrd(xmmA, xmmB, m, 0);
- if (cc.is64Bit()) cc.evex().vpinsrq(xmmA, xmmB, m, 0);
- cc.evex().vpinsrw(xmmA, xmmB, m, 0);
- cc.evex().vplzcntd(xmmA, m);
- cc.evex().vplzcntd(ymmA, m);
- cc.evex().vplzcntd(zmmA, m);
- cc.evex().vplzcntq(xmmA, m);
- cc.evex().vplzcntq(ymmA, m);
- cc.evex().vplzcntq(zmmA, m);
- cc.evex().vpmadd52huq(xmmA, xmmB, m);
- cc.evex().vpmadd52huq(ymmA, ymmB, m);
- cc.evex().vpmadd52huq(zmmA, zmmB, m);
- cc.evex().vpmadd52luq(xmmA, xmmB, m);
- cc.evex().vpmadd52luq(ymmA, ymmB, m);
- cc.evex().vpmadd52luq(zmmA, zmmB, m);
- cc.evex().vpmaddubsw(xmmA, xmmB, m);
- cc.evex().vpmaddubsw(ymmA, ymmB, m);
- cc.evex().vpmaddubsw(zmmA, zmmB, m);
- cc.evex().vpmaddwd(xmmA, xmmB, m);
- cc.evex().vpmaddwd(ymmA, ymmB, m);
- cc.evex().vpmaddwd(zmmA, zmmB, m);
- cc.evex().vpmaxsb(xmmA, xmmB, m);
- cc.evex().vpmaxsb(ymmA, ymmB, m);
- cc.evex().vpmaxsb(zmmA, zmmB, m);
- cc.evex().vpmaxsd(xmmA, xmmB, m);
- cc.evex().vpmaxsd(ymmA, ymmB, m);
- cc.evex().vpmaxsd(zmmA, zmmB, m);
- cc.evex().vpmaxsq(xmmA, xmmB, m);
- cc.evex().vpmaxsq(ymmA, ymmB, m);
- cc.evex().vpmaxsq(zmmA, zmmB, m);
- cc.evex().vpmaxsw(xmmA, xmmB, m);
- cc.evex().vpmaxsw(ymmA, ymmB, m);
- cc.evex().vpmaxsw(zmmA, zmmB, m);
- cc.evex().vpmaxub(xmmA, xmmB, m);
- cc.evex().vpmaxub(ymmA, ymmB, m);
- cc.evex().vpmaxub(zmmA, zmmB, m);
- cc.evex().vpmaxud(xmmA, xmmB, m);
- cc.evex().vpmaxud(ymmA, ymmB, m);
- cc.evex().vpmaxud(zmmA, zmmB, m);
- cc.evex().vpmaxuq(xmmA, xmmB, m);
- cc.evex().vpmaxuq(ymmA, ymmB, m);
- cc.evex().vpmaxuq(zmmA, zmmB, m);
- cc.evex().vpmaxuw(xmmA, xmmB, m);
- cc.evex().vpmaxuw(ymmA, ymmB, m);
- cc.evex().vpmaxuw(zmmA, zmmB, m);
- cc.evex().vpminsb(xmmA, xmmB, m);
- cc.evex().vpminsb(ymmA, ymmB, m);
- cc.evex().vpminsb(zmmA, zmmB, m);
- cc.evex().vpminsd(xmmA, xmmB, m);
- cc.evex().vpminsd(ymmA, ymmB, m);
- cc.evex().vpminsd(zmmA, zmmB, m);
- cc.evex().vpminsq(xmmA, xmmB, m);
- cc.evex().vpminsq(ymmA, ymmB, m);
- cc.evex().vpminsq(zmmA, zmmB, m);
- cc.evex().vpminsw(xmmA, xmmB, m);
- cc.evex().vpminsw(ymmA, ymmB, m);
- cc.evex().vpminsw(zmmA, zmmB, m);
- cc.evex().vpminub(xmmA, xmmB, m);
- cc.evex().vpminub(ymmA, ymmB, m);
- cc.evex().vpminub(zmmA, zmmB, m);
- cc.evex().vpminud(xmmA, xmmB, m);
- cc.evex().vpminud(ymmA, ymmB, m);
- cc.evex().vpminud(zmmA, zmmB, m);
- cc.evex().vpminuq(xmmA, xmmB, m);
- cc.evex().vpminuq(ymmA, ymmB, m);
- cc.evex().vpminuq(zmmA, zmmB, m);
- cc.evex().vpminuw(xmmA, xmmB, m);
- cc.evex().vpminuw(ymmA, ymmB, m);
- cc.evex().vpminuw(zmmA, zmmB, m);
- cc.evex().vpmovdb(m, xmmB);
- cc.evex().vpmovdb(m, ymmB);
- cc.evex().vpmovdb(m, zmmB);
- cc.evex().vpmovdw(m, xmmB);
- cc.evex().vpmovdw(m, ymmB);
- cc.evex().vpmovdw(m, zmmB);
- cc.evex().vpmovqb(m, xmmB);
- cc.evex().vpmovqb(m, ymmB);
- cc.evex().vpmovqb(m, zmmB);
- cc.evex().vpmovqd(m, xmmB);
- cc.evex().vpmovqd(m, ymmB);
- cc.evex().vpmovqd(m, zmmB);
- cc.evex().vpmovqw(m, xmmB);
- cc.evex().vpmovqw(m, ymmB);
- cc.evex().vpmovqw(m, zmmB);
- cc.evex().vpmovsdb(m, xmmB);
- cc.evex().vpmovsdb(m, ymmB);
- cc.evex().vpmovsdb(m, zmmB);
- cc.evex().vpmovsdw(m, xmmB);
- cc.evex().vpmovsdw(m, ymmB);
- cc.evex().vpmovsdw(m, zmmB);
- cc.evex().vpmovsqb(m, xmmB);
- cc.evex().vpmovsqb(m, ymmB);
- cc.evex().vpmovsqb(m, zmmB);
- cc.evex().vpmovsqd(m, xmmB);
- cc.evex().vpmovsqd(m, ymmB);
- cc.evex().vpmovsqd(m, zmmB);
- cc.evex().vpmovsqw(m, xmmB);
- cc.evex().vpmovsqw(m, ymmB);
- cc.evex().vpmovsqw(m, zmmB);
- cc.evex().vpmovswb(m, xmmB);
- cc.evex().vpmovswb(m, ymmB);
- cc.evex().vpmovswb(m, zmmB);
- cc.evex().vpmovsxbd(xmmA, m);
- cc.evex().vpmovsxbd(ymmA, m);
- cc.evex().vpmovsxbd(zmmA, m);
- cc.evex().vpmovsxbq(xmmA, m);
- cc.evex().vpmovsxbq(ymmA, m);
- cc.evex().vpmovsxbq(zmmA, m);
- cc.evex().vpmovsxbw(xmmA, m);
- cc.evex().vpmovsxbw(ymmA, m);
- cc.evex().vpmovsxbw(zmmA, m);
- cc.evex().vpmovsxdq(xmmA, m);
- cc.evex().vpmovsxdq(ymmA, m);
- cc.evex().vpmovsxdq(zmmA, m);
- cc.evex().vpmovsxwd(xmmA, m);
- cc.evex().vpmovsxwd(ymmA, m);
- cc.evex().vpmovsxwd(zmmA, m);
- cc.evex().vpmovsxwq(xmmA, m);
- cc.evex().vpmovsxwq(ymmA, m);
- cc.evex().vpmovsxwq(zmmA, m);
- cc.evex().vpmovusdb(m, xmmB);
- cc.evex().vpmovusdb(m, ymmB);
- cc.evex().vpmovusdb(m, zmmB);
- cc.evex().vpmovusdw(m, xmmB);
- cc.evex().vpmovusdw(m, ymmB);
- cc.evex().vpmovusdw(m, zmmB);
- cc.evex().vpmovusqb(m, xmmB);
- cc.evex().vpmovusqb(m, ymmB);
- cc.evex().vpmovusqb(m, zmmB);
- cc.evex().vpmovusqd(m, xmmB);
- cc.evex().vpmovusqd(m, ymmB);
- cc.evex().vpmovusqd(m, zmmB);
- cc.evex().vpmovusqw(m, xmmB);
- cc.evex().vpmovusqw(m, ymmB);
- cc.evex().vpmovusqw(m, zmmB);
- cc.evex().vpmovuswb(m, xmmB);
- cc.evex().vpmovuswb(m, ymmB);
- cc.evex().vpmovuswb(m, zmmB);
- cc.evex().vpmovwb(m, xmmB);
- cc.evex().vpmovwb(m, ymmB);
- cc.evex().vpmovwb(m, zmmB);
- cc.evex().vpmovzxbd(xmmA, m);
- cc.evex().vpmovzxbd(ymmA, m);
- cc.evex().vpmovzxbd(zmmA, m);
- cc.evex().vpmovzxbq(xmmA, m);
- cc.evex().vpmovzxbq(ymmA, m);
- cc.evex().vpmovzxbq(zmmA, m);
- cc.evex().vpmovzxbw(xmmA, m);
- cc.evex().vpmovzxbw(ymmA, m);
- cc.evex().vpmovzxbw(zmmA, m);
- cc.evex().vpmovzxdq(xmmA, m);
- cc.evex().vpmovzxdq(ymmA, m);
- cc.evex().vpmovzxdq(zmmA, m);
- cc.evex().vpmovzxwd(xmmA, m);
- cc.evex().vpmovzxwd(ymmA, m);
- cc.evex().vpmovzxwd(zmmA, m);
- cc.evex().vpmovzxwq(xmmA, m);
- cc.evex().vpmovzxwq(ymmA, m);
- cc.evex().vpmovzxwq(zmmA, m);
- cc.evex().vpmuldq(xmmA, xmmB, m);
- cc.evex().vpmuldq(ymmA, ymmB, m);
- cc.evex().vpmuldq(zmmA, zmmB, m);
- cc.evex().vpmulhrsw(xmmA, xmmB, m);
- cc.evex().vpmulhrsw(ymmA, ymmB, m);
- cc.evex().vpmulhrsw(zmmA, zmmB, m);
- cc.evex().vpmulhuw(xmmA, xmmB, m);
- cc.evex().vpmulhuw(ymmA, ymmB, m);
- cc.evex().vpmulhuw(zmmA, zmmB, m);
- cc.evex().vpmulhw(xmmA, xmmB, m);
- cc.evex().vpmulhw(ymmA, ymmB, m);
- cc.evex().vpmulhw(zmmA, zmmB, m);
- cc.evex().vpmulld(xmmA, xmmB, m);
- cc.evex().vpmulld(ymmA, ymmB, m);
- cc.evex().vpmulld(zmmA, zmmB, m);
- cc.evex().vpmullq(xmmA, xmmB, m);
- cc.evex().vpmullq(ymmA, ymmB, m);
- cc.evex().vpmullq(zmmA, zmmB, m);
- cc.evex().vpmullw(xmmA, xmmB, m);
- cc.evex().vpmullw(ymmA, ymmB, m);
- cc.evex().vpmullw(zmmA, zmmB, m);
- cc.evex().vpmultishiftqb(xmmA, xmmB, m);
- cc.evex().vpmultishiftqb(ymmA, ymmB, m);
- cc.evex().vpmultishiftqb(zmmA, zmmB, m);
- cc.evex().vpmuludq(xmmA, xmmB, m);
- cc.evex().vpmuludq(ymmA, ymmB, m);
- cc.evex().vpmuludq(zmmA, zmmB, m);
- cc.evex().vpopcntd(zmmA, m);
- cc.evex().vpopcntq(zmmA, m);
- cc.evex().vpord(xmmA, xmmB, m);
- cc.evex().vpord(ymmA, ymmB, m);
- cc.evex().vpord(zmmA, zmmB, m);
- cc.evex().vporq(xmmA, xmmB, m);
- cc.evex().vporq(ymmA, ymmB, m);
- cc.evex().vporq(zmmA, zmmB, m);
- cc.evex().vprold(xmmA, m, 0);
- cc.evex().vprold(ymmA, m, 0);
- cc.evex().vprold(zmmA, m, 0);
- cc.evex().vprolq(xmmA, m, 0);
- cc.evex().vprolq(ymmA, m, 0);
- cc.evex().vprolq(zmmA, m, 0);
- cc.evex().vprolvd(xmmA, xmmB, m);
- cc.evex().vprolvd(ymmA, ymmB, m);
- cc.evex().vprolvd(zmmA, zmmB, m);
- cc.evex().vprolvq(xmmA, xmmB, m);
- cc.evex().vprolvq(ymmA, ymmB, m);
- cc.evex().vprolvq(zmmA, zmmB, m);
- cc.evex().vprord(xmmA, m, 0);
- cc.evex().vprord(ymmA, m, 0);
- cc.evex().vprord(zmmA, m, 0);
- cc.evex().vprorq(xmmA, m, 0);
- cc.evex().vprorq(ymmA, m, 0);
- cc.evex().vprorq(zmmA, m, 0);
- cc.evex().vprorvd(xmmA, xmmB, m);
- cc.evex().vprorvd(ymmA, ymmB, m);
- cc.evex().vprorvd(zmmA, zmmB, m);
- cc.evex().vprorvq(xmmA, xmmB, m);
- cc.evex().vprorvq(ymmA, ymmB, m);
- cc.evex().vprorvq(zmmA, zmmB, m);
- cc.evex().vpsadbw(xmmA, xmmB, m);
- cc.evex().vpsadbw(ymmA, ymmB, m);
- cc.evex().vpsadbw(zmmA, zmmB, m);
- cc.evex().k(kA).vpscatterdd(vx_ptr, xmmB);
- cc.evex().k(kA).vpscatterdd(vy_ptr, ymmB);
- cc.evex().k(kA).vpscatterdd(vz_ptr, zmmB);
- cc.evex().k(kA).vpscatterdq(vx_ptr, xmmB);
- cc.evex().k(kA).vpscatterdq(vx_ptr, ymmB);
- cc.evex().k(kA).vpscatterdq(vy_ptr, zmmB);
- cc.evex().k(kA).vpscatterqd(vx_ptr, xmmB);
- cc.evex().k(kA).vpscatterqd(vy_ptr, xmmB);
- cc.evex().k(kA).vpscatterqd(vz_ptr, ymmB);
- cc.evex().k(kA).vpscatterqq(vx_ptr, xmmB);
- cc.evex().k(kA).vpscatterqq(vy_ptr, ymmB);
- cc.evex().k(kA).vpscatterqq(vz_ptr, zmmB);
- cc.evex().vpshufb(xmmA, xmmB, m);
- cc.evex().vpshufb(ymmA, ymmB, m);
- cc.evex().vpshufb(zmmA, zmmB, m);
- cc.evex().vpshufd(xmmA, m, 0);
- cc.evex().vpshufd(ymmA, m, 0);
- cc.evex().vpshufd(zmmA, m, 0);
- cc.evex().vpshufhw(xmmA, m, 0);
- cc.evex().vpshufhw(ymmA, m, 0);
- cc.evex().vpshufhw(zmmA, m, 0);
- cc.evex().vpshuflw(xmmA, m, 0);
- cc.evex().vpshuflw(ymmA, m, 0);
- cc.evex().vpshuflw(zmmA, m, 0);
- cc.evex().vpslld(xmmA, xmmB, m);
- cc.evex().vpslld(xmmA, m, 0);
- cc.evex().vpslld(ymmA, ymmB, m);
- cc.evex().vpslld(ymmA, m, 0);
- cc.evex().vpslld(zmmA, zmmB, m);
- cc.evex().vpslld(zmmA, m, 0);
- cc.evex().vpslldq(xmmA, m, 0);
- cc.evex().vpslldq(ymmA, m, 0);
- cc.evex().vpslldq(zmmA, m, 0);
- cc.evex().vpsllq(xmmA, xmmB, m);
- cc.evex().vpsllq(xmmA, m, 0);
- cc.evex().vpsllq(ymmA, ymmB, m);
- cc.evex().vpsllq(ymmA, m, 0);
- cc.evex().vpsllq(zmmA, zmmB, m);
- cc.evex().vpsllq(zmmA, m, 0);
- cc.evex().vpsllvd(xmmA, xmmB, m);
- cc.evex().vpsllvd(ymmA, ymmB, m);
- cc.evex().vpsllvd(zmmA, zmmB, m);
- cc.evex().vpsllvq(xmmA, xmmB, m);
- cc.evex().vpsllvq(ymmA, ymmB, m);
- cc.evex().vpsllvq(zmmA, zmmB, m);
- cc.evex().vpsllvw(xmmA, xmmB, m);
- cc.evex().vpsllvw(ymmA, ymmB, m);
- cc.evex().vpsllvw(zmmA, zmmB, m);
- cc.evex().vpsllw(xmmA, xmmB, m);
- cc.evex().vpsllw(xmmA, m, 0);
- cc.evex().vpsllw(ymmA, ymmB, m);
- cc.evex().vpsllw(ymmA, m, 0);
- cc.evex().vpsllw(zmmA, zmmB, m);
- cc.evex().vpsllw(zmmA, m, 0);
- cc.evex().vpsrad(xmmA, xmmB, m);
- cc.evex().vpsrad(xmmA, m, 0);
- cc.evex().vpsrad(ymmA, ymmB, m);
- cc.evex().vpsrad(ymmA, m, 0);
- cc.evex().vpsrad(zmmA, zmmB, m);
- cc.evex().vpsrad(zmmA, m, 0);
- cc.evex().vpsraq(xmmA, xmmB, m);
- cc.evex().vpsraq(xmmA, m, 0);
- cc.evex().vpsraq(ymmA, ymmB, m);
- cc.evex().vpsraq(ymmA, m, 0);
- cc.evex().vpsraq(zmmA, zmmB, m);
- cc.evex().vpsraq(zmmA, m, 0);
- cc.evex().vpsravd(xmmA, xmmB, m);
- cc.evex().vpsravd(ymmA, ymmB, m);
- cc.evex().vpsravd(zmmA, zmmB, m);
- cc.evex().vpsravq(xmmA, xmmB, m);
- cc.evex().vpsravq(ymmA, ymmB, m);
- cc.evex().vpsravq(zmmA, zmmB, m);
- cc.evex().vpsravw(xmmA, xmmB, m);
- cc.evex().vpsravw(ymmA, ymmB, m);
- cc.evex().vpsravw(zmmA, zmmB, m);
- cc.evex().vpsraw(xmmA, xmmB, m);
- cc.evex().vpsraw(xmmA, m, 0);
- cc.evex().vpsraw(ymmA, ymmB, m);
- cc.evex().vpsraw(ymmA, m, 0);
- cc.evex().vpsraw(zmmA, zmmB, m);
- cc.evex().vpsraw(zmmA, m, 0);
- cc.evex().vpsrld(xmmA, xmmB, m);
- cc.evex().vpsrld(xmmA, m, 0);
- cc.evex().vpsrld(ymmA, ymmB, m);
- cc.evex().vpsrld(ymmA, m, 0);
- cc.evex().vpsrld(zmmA, zmmB, m);
- cc.evex().vpsrld(zmmA, m, 0);
- cc.evex().vpsrldq(xmmA, m, 0);
- cc.evex().vpsrldq(ymmA, m, 0);
- cc.evex().vpsrldq(zmmA, m, 0);
- cc.evex().vpsrlq(xmmA, xmmB, m);
- cc.evex().vpsrlq(xmmA, m, 0);
- cc.evex().vpsrlq(ymmA, ymmB, m);
- cc.evex().vpsrlq(ymmA, m, 0);
- cc.evex().vpsrlq(zmmA, zmmB, m);
- cc.evex().vpsrlq(zmmA, m, 0);
- cc.evex().vpsrlvd(xmmA, xmmB, m);
- cc.evex().vpsrlvd(ymmA, ymmB, m);
- cc.evex().vpsrlvd(zmmA, zmmB, m);
- cc.evex().vpsrlvq(xmmA, xmmB, m);
- cc.evex().vpsrlvq(ymmA, ymmB, m);
- cc.evex().vpsrlvq(zmmA, zmmB, m);
- cc.evex().vpsrlvw(xmmA, xmmB, m);
- cc.evex().vpsrlvw(ymmA, ymmB, m);
- cc.evex().vpsrlvw(zmmA, zmmB, m);
- cc.evex().vpsrlw(xmmA, xmmB, m);
- cc.evex().vpsrlw(xmmA, m, 0);
- cc.evex().vpsrlw(ymmA, ymmB, m);
- cc.evex().vpsrlw(ymmA, m, 0);
- cc.evex().vpsrlw(zmmA, zmmB, m);
- cc.evex().vpsrlw(zmmA, m, 0);
- cc.evex().vpsubb(xmmA, xmmB, m);
- cc.evex().vpsubb(ymmA, ymmB, m);
- cc.evex().vpsubb(zmmA, zmmB, m);
- cc.evex().vpsubd(xmmA, xmmB, m);
- cc.evex().vpsubd(ymmA, ymmB, m);
- cc.evex().vpsubd(zmmA, zmmB, m);
- cc.evex().vpsubq(xmmA, xmmB, m);
- cc.evex().vpsubq(ymmA, ymmB, m);
- cc.evex().vpsubq(zmmA, zmmB, m);
- cc.evex().vpsubsb(xmmA, xmmB, m);
- cc.evex().vpsubsb(ymmA, ymmB, m);
- cc.evex().vpsubsb(zmmA, zmmB, m);
- cc.evex().vpsubsw(xmmA, xmmB, m);
- cc.evex().vpsubsw(ymmA, ymmB, m);
- cc.evex().vpsubsw(zmmA, zmmB, m);
- cc.evex().vpsubusb(xmmA, xmmB, m);
- cc.evex().vpsubusb(ymmA, ymmB, m);
- cc.evex().vpsubusb(zmmA, zmmB, m);
- cc.evex().vpsubusw(xmmA, xmmB, m);
- cc.evex().vpsubusw(ymmA, ymmB, m);
- cc.evex().vpsubusw(zmmA, zmmB, m);
- cc.evex().vpsubw(xmmA, xmmB, m);
- cc.evex().vpsubw(ymmA, ymmB, m);
- cc.evex().vpsubw(zmmA, zmmB, m);
- cc.evex().vpternlogd(xmmA, xmmB, m, 0);
- cc.evex().vpternlogd(ymmA, ymmB, m, 0);
- cc.evex().vpternlogd(zmmA, zmmB, m, 0);
- cc.evex().vpternlogq(xmmA, xmmB, m, 0);
- cc.evex().vpternlogq(ymmA, ymmB, m, 0);
- cc.evex().vpternlogq(zmmA, zmmB, m, 0);
- cc.evex().vptestmb(kA, xmmB, m);
- cc.evex().vptestmb(kA, ymmB, m);
- cc.evex().vptestmb(kA, zmmB, m);
- cc.evex().vptestmd(kA, xmmB, m);
- cc.evex().vptestmd(kA, ymmB, m);
- cc.evex().vptestmd(kA, zmmB, m);
- cc.evex().vptestmq(kA, xmmB, m);
- cc.evex().vptestmq(kA, ymmB, m);
- cc.evex().vptestmq(kA, zmmB, m);
- cc.evex().vptestmw(kA, xmmB, m);
- cc.evex().vptestmw(kA, ymmB, m);
- cc.evex().vptestmw(kA, zmmB, m);
- cc.evex().vptestnmb(kA, xmmB, m);
- cc.evex().vptestnmb(kA, ymmB, m);
- cc.evex().vptestnmb(kA, zmmB, m);
- cc.evex().vptestnmd(kA, xmmB, m);
- cc.evex().vptestnmd(kA, ymmB, m);
- cc.evex().vptestnmd(kA, zmmB, m);
- cc.evex().vptestnmq(kA, xmmB, m);
- cc.evex().vptestnmq(kA, ymmB, m);
- cc.evex().vptestnmq(kA, zmmB, m);
- cc.evex().vptestnmw(kA, xmmB, m);
- cc.evex().vptestnmw(kA, ymmB, m);
- cc.evex().vptestnmw(kA, zmmB, m);
- cc.evex().vpunpckhbw(xmmA, xmmB, m);
- cc.evex().vpunpckhbw(ymmA, ymmB, m);
- cc.evex().vpunpckhbw(zmmA, zmmB, m);
- cc.evex().vpunpckhdq(xmmA, xmmB, m);
- cc.evex().vpunpckhdq(ymmA, ymmB, m);
- cc.evex().vpunpckhdq(zmmA, zmmB, m);
- cc.evex().vpunpckhqdq(xmmA, xmmB, m);
- cc.evex().vpunpckhqdq(ymmA, ymmB, m);
- cc.evex().vpunpckhqdq(zmmA, zmmB, m);
- cc.evex().vpunpckhwd(xmmA, xmmB, m);
- cc.evex().vpunpckhwd(ymmA, ymmB, m);
- cc.evex().vpunpckhwd(zmmA, zmmB, m);
- cc.evex().vpunpcklbw(xmmA, xmmB, m);
- cc.evex().vpunpcklbw(ymmA, ymmB, m);
- cc.evex().vpunpcklbw(zmmA, zmmB, m);
- cc.evex().vpunpckldq(xmmA, xmmB, m);
- cc.evex().vpunpckldq(ymmA, ymmB, m);
- cc.evex().vpunpckldq(zmmA, zmmB, m);
- cc.evex().vpunpcklqdq(xmmA, xmmB, m);
- cc.evex().vpunpcklqdq(ymmA, ymmB, m);
- cc.evex().vpunpcklqdq(zmmA, zmmB, m);
- cc.evex().vpunpcklwd(xmmA, xmmB, m);
- cc.evex().vpunpcklwd(ymmA, ymmB, m);
- cc.evex().vpunpcklwd(zmmA, zmmB, m);
- cc.evex().vpxord(xmmA, xmmB, m);
- cc.evex().vpxord(ymmA, ymmB, m);
- cc.evex().vpxord(zmmA, zmmB, m);
- cc.evex().vpxorq(xmmA, xmmB, m);
- cc.evex().vpxorq(ymmA, ymmB, m);
- cc.evex().vpxorq(zmmA, zmmB, m);
- cc.evex().vrangepd(xmmA, xmmB, m, 0);
- cc.evex().vrangepd(ymmA, ymmB, m, 0);
- cc.evex().vrangepd(zmmA, zmmB, m, 0);
- cc.evex().vrangeps(xmmA, xmmB, m, 0);
- cc.evex().vrangeps(ymmA, ymmB, m, 0);
- cc.evex().vrangeps(zmmA, zmmB, m, 0);
- cc.evex().vrangesd(xmmA, xmmB, m, 0);
- cc.evex().vrangess(xmmA, xmmB, m, 0);
- cc.evex().vrcp14pd(xmmA, m);
- cc.evex().vrcp14pd(ymmA, m);
- cc.evex().vrcp14pd(zmmA, m);
- cc.evex().vrcp14ps(xmmA, m);
- cc.evex().vrcp14ps(ymmA, m);
- cc.evex().vrcp14ps(zmmA, m);
- cc.evex().vrcp14sd(xmmA, xmmB, m);
- cc.evex().vrcp14ss(xmmA, xmmB, m);
- cc.evex().vrcp28pd(zmmA, m);
- cc.evex().vrcp28ps(zmmA, m);
- cc.evex().vrcp28sd(xmmA, xmmB, m);
- cc.evex().vrcp28ss(xmmA, xmmB, m);
- cc.evex().vreducepd(xmmA, m, 0);
- cc.evex().vreducepd(ymmA, m, 0);
- cc.evex().vreducepd(zmmA, m, 0);
- cc.evex().vreduceps(xmmA, m, 0);
- cc.evex().vreduceps(ymmA, m, 0);
- cc.evex().vreduceps(zmmA, m, 0);
- cc.evex().vreducesd(xmmA, xmmB, m, 0);
- cc.evex().vreducess(xmmA, xmmB, m, 0);
- cc.evex().vrndscalepd(xmmA, m, 0);
- cc.evex().vrndscalepd(ymmA, m, 0);
- cc.evex().vrndscalepd(zmmA, m, 0);
- cc.evex().vrndscaleps(xmmA, m, 0);
- cc.evex().vrndscaleps(ymmA, m, 0);
- cc.evex().vrndscaleps(zmmA, m, 0);
- cc.evex().vrndscalesd(xmmA, xmmB, m, 0);
- cc.evex().vrndscaless(xmmA, xmmB, m, 0);
- cc.evex().vrsqrt14pd(xmmA, m);
- cc.evex().vrsqrt14pd(ymmA, m);
- cc.evex().vrsqrt14pd(zmmA, m);
- cc.evex().vrsqrt14ps(xmmA, m);
- cc.evex().vrsqrt14ps(ymmA, m);
- cc.evex().vrsqrt14ps(zmmA, m);
- cc.evex().vrsqrt14sd(xmmA, xmmB, m);
- cc.evex().vrsqrt14ss(xmmA, xmmB, m);
- cc.evex().vrsqrt28pd(zmmA, m);
- cc.evex().vrsqrt28ps(zmmA, m);
- cc.evex().vrsqrt28sd(xmmA, xmmB, m);
- cc.evex().vrsqrt28ss(xmmA, xmmB, m);
- cc.evex().vscalefpd(xmmA, xmmB, m);
- cc.evex().vscalefpd(ymmA, ymmB, m);
- cc.evex().vscalefpd(zmmA, zmmB, m);
- cc.evex().vscalefps(xmmA, xmmB, m);
- cc.evex().vscalefps(ymmA, ymmB, m);
- cc.evex().vscalefps(zmmA, zmmB, m);
- cc.evex().vscalefsd(xmmA, xmmB, m);
- cc.evex().vscalefss(xmmA, xmmB, m);
- cc.evex().k(kA).vscatterdpd(vx_ptr, xmmB);
- cc.evex().k(kA).vscatterdpd(vx_ptr, ymmB);
- cc.evex().k(kA).vscatterdpd(vy_ptr, zmmB);
- cc.evex().k(kA).vscatterdps(vx_ptr, xmmB);
- cc.evex().k(kA).vscatterdps(vy_ptr, ymmB);
- cc.evex().k(kA).vscatterdps(vz_ptr, zmmB);
- cc.evex().k(kA).vscatterpf0dpd(vy_ptr);
- cc.evex().k(kA).vscatterpf0dps(vz_ptr);
- cc.evex().k(kA).vscatterpf0qpd(vz_ptr);
- cc.evex().k(kA).vscatterpf0qps(vz_ptr);
- cc.evex().k(kA).vscatterpf1dpd(vy_ptr);
- cc.evex().k(kA).vscatterpf1dps(vz_ptr);
- cc.evex().k(kA).vscatterpf1qpd(vz_ptr);
- cc.evex().k(kA).vscatterpf1qps(vz_ptr);
- cc.evex().k(kA).vscatterqpd(vx_ptr, xmmB);
- cc.evex().k(kA).vscatterqpd(vy_ptr, ymmB);
- cc.evex().k(kA).vscatterqpd(vz_ptr, zmmB);
- cc.evex().k(kA).vscatterqps(vx_ptr, xmmB);
- cc.evex().k(kA).vscatterqps(vy_ptr, xmmB);
- cc.evex().k(kA).vscatterqps(vz_ptr, ymmB);
- cc.evex().vshuff32x4(ymmA, ymmB, m, 0);
- cc.evex().vshuff32x4(zmmA, zmmB, m, 0);
- cc.evex().vshuff64x2(ymmA, ymmB, m, 0);
- cc.evex().vshuff64x2(zmmA, zmmB, m, 0);
- cc.evex().vshufi32x4(ymmA, ymmB, m, 0);
- cc.evex().vshufi32x4(zmmA, zmmB, m, 0);
- cc.evex().vshufi64x2(ymmA, ymmB, m, 0);
- cc.evex().vshufi64x2(zmmA, zmmB, m, 0);
- cc.evex().vshufpd(xmmA, xmmB, m, 0);
- cc.evex().vshufpd(ymmA, ymmB, m, 0);
- cc.evex().vshufpd(zmmA, zmmB, m, 0);
- cc.evex().vshufps(xmmA, xmmB, m, 0);
- cc.evex().vshufps(ymmA, ymmB, m, 0);
- cc.evex().vshufps(zmmA, zmmB, m, 0);
- cc.evex().vsqrtpd(xmmA, m);
- cc.evex().vsqrtpd(ymmA, m);
- cc.evex().vsqrtpd(zmmA, m);
- cc.evex().vsqrtps(xmmA, m);
- cc.evex().vsqrtps(ymmA, m);
- cc.evex().vsqrtps(zmmA, m);
- cc.evex().vsqrtsd(xmmA, xmmB, m);
- cc.evex().vsqrtss(xmmA, xmmB, m);
- cc.evex().vsubpd(xmmA, xmmB, m);
- cc.evex().vsubpd(ymmA, ymmB, m);
- cc.evex().vsubpd(zmmA, zmmB, m);
- cc.evex().vsubps(xmmA, xmmB, m);
- cc.evex().vsubps(ymmA, ymmB, m);
- cc.evex().vsubps(zmmA, zmmB, m);
- cc.evex().vsubsd(xmmA, xmmB, m);
- cc.evex().vsubss(xmmA, xmmB, m);
- cc.evex().vucomisd(xmmA, m);
- cc.evex().vucomiss(xmmA, m);
- cc.evex().vunpckhpd(xmmA, xmmB, m);
- cc.evex().vunpckhpd(ymmA, ymmB, m);
- cc.evex().vunpckhpd(zmmA, zmmB, m);
- cc.evex().vunpckhps(xmmA, xmmB, m);
- cc.evex().vunpckhps(ymmA, ymmB, m);
- cc.evex().vunpckhps(zmmA, zmmB, m);
- cc.evex().vunpcklpd(xmmA, xmmB, m);
- cc.evex().vunpcklpd(ymmA, ymmB, m);
- cc.evex().vunpcklpd(zmmA, zmmB, m);
- cc.evex().vunpcklps(xmmA, xmmB, m);
- cc.evex().vunpcklps(ymmA, ymmB, m);
- cc.evex().vunpcklps(zmmA, zmmB, m);
- cc.evex().vxorpd(xmmA, xmmB, m);
- cc.evex().vxorpd(ymmA, ymmB, m);
- cc.evex().vxorpd(zmmA, zmmB, m);
- cc.evex().vxorps(xmmA, xmmB, m);
- cc.evex().vxorps(ymmA, ymmB, m);
- cc.evex().vxorps(zmmA, zmmB, m);
- }
+ cc.kmovb(kA, m);
+ cc.kmovb(m, kB);
+ cc.kmovd(kA, m);
+ cc.kmovd(m, kB);
+ cc.kmovq(kA, m);
+ cc.kmovq(m, kB);
+ cc.kmovw(kA, m);
+ cc.kmovw(m, kB);
+
+ cc.evex().vaddpd(xmmA, xmmB, m);
+ cc.evex().vaddpd(ymmA, ymmB, m);
+ cc.evex().vaddpd(zmmA, zmmB, m);
+ cc.evex().vaddps(xmmA, xmmB, m);
+ cc.evex().vaddps(ymmA, ymmB, m);
+ cc.evex().vaddps(zmmA, zmmB, m);
+ cc.evex().vaddsd(xmmA, xmmB, m);
+ cc.evex().vaddss(xmmA, xmmB, m);
+ cc.evex().valignd(xmmA, xmmB, m, 0);
+ cc.evex().valignd(ymmA, ymmB, m, 0);
+ cc.evex().valignd(zmmA, zmmB, m, 0);
+ cc.evex().valignq(xmmA, xmmB, m, 0);
+ cc.evex().valignq(ymmA, ymmB, m, 0);
+ cc.evex().valignq(zmmA, zmmB, m, 0);
+ cc.evex().vandnpd(xmmA, xmmB, m);
+ cc.evex().vandnpd(ymmA, ymmB, m);
+ cc.evex().vandnpd(zmmA, zmmB, m);
+ cc.evex().vandnps(xmmA, xmmB, m);
+ cc.evex().vandnps(ymmA, ymmB, m);
+ cc.evex().vandnps(zmmA, zmmB, m);
+ cc.evex().vandpd(xmmA, xmmB, m);
+ cc.evex().vandpd(ymmA, ymmB, m);
+ cc.evex().vandpd(zmmA, zmmB, m);
+ cc.evex().vandps(xmmA, xmmB, m);
+ cc.evex().vandps(ymmA, ymmB, m);
+ cc.evex().vandps(zmmA, zmmB, m);
+ cc.evex().vblendmpd(xmmA, xmmB, m);
+ cc.evex().vblendmpd(ymmA, ymmB, m);
+ cc.evex().vblendmpd(zmmA, zmmB, m);
+ cc.evex().vblendmps(xmmA, xmmB, m);
+ cc.evex().vblendmps(ymmA, ymmB, m);
+ cc.evex().vblendmps(zmmA, zmmB, m);
+ cc.evex().vbroadcastf32x2(ymmA, m);
+ cc.evex().vbroadcastf32x2(zmmA, m);
+ cc.evex().vbroadcastf32x4(ymmA, m);
+ cc.evex().vbroadcastf32x4(zmmA, m);
+ cc.evex().vbroadcastf32x8(zmmA, m);
+ cc.evex().vbroadcastf64x2(ymmA, m);
+ cc.evex().vbroadcastf64x2(zmmA, m);
+ cc.evex().vbroadcastf64x4(zmmA, m);
+ cc.evex().vbroadcasti32x2(xmmA, m);
+ cc.evex().vbroadcasti32x2(ymmA, m);
+ cc.evex().vbroadcasti32x2(zmmA, m);
+ cc.evex().vbroadcasti32x4(ymmA, m);
+ cc.evex().vbroadcasti32x4(zmmA, m);
+ cc.evex().vbroadcasti32x8(zmmA, m);
+ cc.evex().vbroadcasti64x2(ymmA, m);
+ cc.evex().vbroadcasti64x2(zmmA, m);
+ cc.evex().vbroadcasti64x4(zmmA, m);
+ cc.evex().vbroadcastsd(ymmA, m);
+ cc.evex().vbroadcastsd(zmmA, m);
+ cc.evex().vbroadcastss(xmmA, m);
+ cc.evex().vbroadcastss(ymmA, m);
+ cc.evex().vbroadcastss(zmmA, m);
+ cc.evex().vcmppd(kA, xmmB, m, 0);
+ cc.evex().vcmppd(kA, ymmB, m, 0);
+ cc.evex().vcmppd(kA, zmmB, m, 0);
+ cc.evex().vcmpps(kA, xmmB, m, 0);
+ cc.evex().vcmpps(kA, ymmB, m, 0);
+ cc.evex().vcmpps(kA, zmmB, m, 0);
+ cc.evex().vcmpsd(kA, xmmB, m, 0);
+ cc.evex().vcmpss(kA, xmmB, m, 0);
+ cc.evex().vcomisd(xmmA, m);
+ cc.evex().vcomiss(xmmA, m);
+ cc.evex().vcompresspd(m, xmmB);
+ cc.evex().vcompresspd(m, ymmB);
+ cc.evex().vcompresspd(m, zmmB);
+ cc.evex().vcompressps(m, xmmB);
+ cc.evex().vcompressps(m, ymmB);
+ cc.evex().vcompressps(m, zmmB);
+ cc.evex().vcvtdq2pd(xmmA, m);
+ cc.evex().vcvtdq2pd(ymmA, m);
+ cc.evex().vcvtdq2pd(zmmA, m);
+ cc.evex().vcvtdq2ps(xmmA, m);
+ cc.evex().vcvtdq2ps(ymmA, m);
+ cc.evex().vcvtdq2ps(zmmA, m);
+ cc.evex().vcvtpd2dq(xmmA, m128);
+ cc.evex().vcvtpd2dq(xmmA, m256);
+ cc.evex().vcvtpd2dq(ymmA, m512);
+ cc.evex().vcvtpd2qq(xmmA, m);
+ cc.evex().vcvtpd2qq(ymmA, m);
+ cc.evex().vcvtpd2qq(zmmA, m);
+ cc.evex().vcvtpd2udq(xmmA, m128);
+ cc.evex().vcvtpd2udq(xmmA, m256);
+ cc.evex().vcvtpd2udq(ymmA, m512);
+ cc.evex().vcvtpd2uqq(xmmA, m);
+ cc.evex().vcvtpd2uqq(ymmA, m);
+ cc.evex().vcvtpd2uqq(zmmA, m);
+ cc.evex().vcvtph2ps(xmmA, m);
+ cc.evex().vcvtph2ps(ymmA, m);
+ cc.evex().vcvtph2ps(zmmA, m);
+ cc.evex().vcvtps2dq(xmmA, m);
+ cc.evex().vcvtps2dq(ymmA, m);
+ cc.evex().vcvtps2dq(zmmA, m);
+ cc.evex().vcvtps2pd(xmmA, m);
+ cc.evex().vcvtps2pd(ymmA, m);
+ cc.evex().vcvtps2pd(zmmA, m);
+ cc.evex().vcvtps2ph(m, xmmB, 0);
+ cc.evex().vcvtps2ph(m, ymmB, 0);
+ cc.evex().vcvtps2ph(m, zmmB, 0);
+ cc.evex().vcvtps2qq(xmmA, m);
+ cc.evex().vcvtps2qq(ymmA, m);
+ cc.evex().vcvtps2qq(zmmA, m);
+ cc.evex().vcvtps2udq(xmmA, m);
+ cc.evex().vcvtps2udq(ymmA, m);
+ cc.evex().vcvtps2udq(zmmA, m);
+ cc.evex().vcvtps2uqq(xmmA, m);
+ cc.evex().vcvtps2uqq(ymmA, m);
+ cc.evex().vcvtps2uqq(zmmA, m);
+ cc.evex().vcvtqq2pd(xmmA, m);
+ cc.evex().vcvtqq2pd(ymmA, m);
+ cc.evex().vcvtqq2pd(zmmA, m);
+ cc.evex().vcvtqq2ps(xmmA, m128);
+ cc.evex().vcvtqq2ps(xmmA, m256);
+ cc.evex().vcvtqq2ps(ymmA, m512);
+ cc.evex().vcvtsd2si(gpd, m);
+ cc.evex().vcvtsd2si(gpz, m);
+ cc.evex().vcvtsd2ss(xmmA, xmmB, m);
+ cc.evex().vcvtsd2usi(gpd, m);
+ cc.evex().vcvtsd2usi(gpz, m);
+ cc.evex().vcvtsi2sd(xmmA, xmmB, m32);
+ if (cc.is64Bit()) cc.evex().vcvtsi2sd(xmmA, xmmB, m64);
+ cc.evex().vcvtsi2ss(xmmA, xmmB, m32);
+ if (cc.is64Bit()) cc.evex().vcvtsi2ss(xmmA, xmmB, m64);
+ cc.evex().vcvtss2sd(xmmA, xmmB, m);
+ cc.evex().vcvtss2si(gpd, m);
+ cc.evex().vcvtss2si(gpz, m);
+ cc.evex().vcvtss2usi(gpd, m);
+ cc.evex().vcvtss2usi(gpz, m);
+ cc.evex().vcvttpd2dq(xmmA, m128);
+ cc.evex().vcvttpd2dq(xmmA, m256);
+ cc.evex().vcvttpd2dq(ymmA, m512);
+ cc.evex().vcvttpd2qq(xmmA, m);
+ cc.evex().vcvttpd2qq(ymmA, m);
+ cc.evex().vcvttpd2qq(zmmA, m);
+ cc.evex().vcvttpd2udq(xmmA, m128);
+ cc.evex().vcvttpd2udq(xmmA, m256);
+ cc.evex().vcvttpd2udq(ymmA, m512);
+ cc.evex().vcvttpd2uqq(xmmA, m);
+ cc.evex().vcvttpd2uqq(ymmA, m);
+ cc.evex().vcvttpd2uqq(zmmA, m);
+ cc.evex().vcvttps2dq(xmmA, m);
+ cc.evex().vcvttps2dq(ymmA, m);
+ cc.evex().vcvttps2dq(zmmA, m);
+ cc.evex().vcvttps2qq(xmmA, m);
+ cc.evex().vcvttps2qq(ymmA, m);
+ cc.evex().vcvttps2qq(zmmA, m);
+ cc.evex().vcvttps2udq(xmmA, m);
+ cc.evex().vcvttps2udq(ymmA, m);
+ cc.evex().vcvttps2udq(zmmA, m);
+ cc.evex().vcvttps2uqq(xmmA, m);
+ cc.evex().vcvttps2uqq(ymmA, m);
+ cc.evex().vcvttps2uqq(zmmA, m);
+ cc.evex().vcvttsd2si(gpd, m);
+ cc.evex().vcvttsd2si(gpz, m);
+ cc.evex().vcvttsd2usi(gpd, m);
+ cc.evex().vcvttsd2usi(gpz, m);
+ cc.evex().vcvttss2si(gpd, m);
+ cc.evex().vcvttss2si(gpz, m);
+ cc.evex().vcvttss2usi(gpd, m);
+ cc.evex().vcvttss2usi(gpz, m);
+ cc.evex().vcvtudq2pd(xmmA, m);
+ cc.evex().vcvtudq2pd(ymmA, m);
+ cc.evex().vcvtudq2pd(zmmA, m);
+ cc.evex().vcvtudq2ps(xmmA, m);
+ cc.evex().vcvtudq2ps(ymmA, m);
+ cc.evex().vcvtudq2ps(zmmA, m);
+ cc.evex().vcvtuqq2pd(xmmA, m);
+ cc.evex().vcvtuqq2pd(ymmA, m);
+ cc.evex().vcvtuqq2pd(zmmA, m);
+ cc.evex().vcvtuqq2ps(xmmA, m128);
+ cc.evex().vcvtuqq2ps(xmmA, m256);
+ cc.evex().vcvtuqq2ps(ymmA, m512);
+ cc.evex().vcvtusi2sd(xmmA, xmmB, m32);
+ if (cc.is64Bit()) cc.evex().vcvtusi2sd(xmmA, xmmB, m64);
+ cc.evex().vcvtusi2ss(xmmA, xmmB, m32);
+ if (cc.is64Bit()) cc.evex().vcvtusi2ss(xmmA, xmmB, m64);
+ cc.evex().vdbpsadbw(xmmA, xmmB, m, 0);
+ cc.evex().vdbpsadbw(ymmA, ymmB, m, 0);
+ cc.evex().vdbpsadbw(zmmA, zmmB, m, 0);
+ cc.evex().vdivpd(xmmA, xmmB, m);
+ cc.evex().vdivpd(ymmA, ymmB, m);
+ cc.evex().vdivpd(zmmA, zmmB, m);
+ cc.evex().vdivps(xmmA, xmmB, m);
+ cc.evex().vdivps(ymmA, ymmB, m);
+ cc.evex().vdivps(zmmA, zmmB, m);
+ cc.evex().vdivsd(xmmA, xmmB, m);
+ cc.evex().vdivss(xmmA, xmmB, m);
+ cc.evex().vexp2pd(zmmA, m);
+ cc.evex().vexp2ps(zmmA, m);
+ cc.evex().vexpandpd(xmmA, m);
+ cc.evex().vexpandpd(ymmA, m);
+ cc.evex().vexpandpd(zmmA, m);
+ cc.evex().vexpandps(xmmA, m);
+ cc.evex().vexpandps(ymmA, m);
+ cc.evex().vexpandps(zmmA, m);
+ cc.evex().vextractf32x4(m, ymmB, 0);
+ cc.evex().vextractf32x4(m, zmmB, 0);
+ cc.evex().vextractf32x8(m, zmmB, 0);
+ cc.evex().vextractf64x2(m, ymmB, 0);
+ cc.evex().vextractf64x2(m, zmmB, 0);
+ cc.evex().vextractf64x4(m, zmmB, 0);
+ cc.evex().vextracti32x4(m, ymmB, 0);
+ cc.evex().vextracti32x4(m, zmmB, 0);
+ cc.evex().vextracti32x8(m, zmmB, 0);
+ cc.evex().vextracti64x2(m, ymmB, 0);
+ cc.evex().vextracti64x2(m, zmmB, 0);
+ cc.evex().vextracti64x4(m, zmmB, 0);
+ cc.evex().vextractps(m, xmmB, 0);
+ cc.evex().vfixupimmpd(xmmA, xmmB, m, 0);
+ cc.evex().vfixupimmpd(ymmA, ymmB, m, 0);
+ cc.evex().vfixupimmpd(zmmA, zmmB, m, 0);
+ cc.evex().vfixupimmps(xmmA, xmmB, m, 0);
+ cc.evex().vfixupimmps(ymmA, ymmB, m, 0);
+ cc.evex().vfixupimmps(zmmA, zmmB, m, 0);
+ cc.evex().vfixupimmsd(xmmA, xmmB, m, 0);
+ cc.evex().vfixupimmss(xmmA, xmmB, m, 0);
+ cc.evex().vfmadd132pd(xmmA, xmmB, m);
+ cc.evex().vfmadd132pd(ymmA, ymmB, m);
+ cc.evex().vfmadd132pd(zmmA, zmmB, m);
+ cc.evex().vfmadd132ps(xmmA, xmmB, m);
+ cc.evex().vfmadd132ps(ymmA, ymmB, m);
+ cc.evex().vfmadd132ps(zmmA, zmmB, m);
+ cc.evex().vfmadd132sd(xmmA, xmmB, m);
+ cc.evex().vfmadd132ss(xmmA, xmmB, m);
+ cc.evex().vfmadd213pd(xmmA, xmmB, m);
+ cc.evex().vfmadd213pd(ymmA, ymmB, m);
+ cc.evex().vfmadd213pd(zmmA, zmmB, m);
+ cc.evex().vfmadd213ps(xmmA, xmmB, m);
+ cc.evex().vfmadd213ps(ymmA, ymmB, m);
+ cc.evex().vfmadd213ps(zmmA, zmmB, m);
+ cc.evex().vfmadd213sd(xmmA, xmmB, m);
+ cc.evex().vfmadd213ss(xmmA, xmmB, m);
+ cc.evex().vfmadd231pd(xmmA, xmmB, m);
+ cc.evex().vfmadd231pd(ymmA, ymmB, m);
+ cc.evex().vfmadd231pd(zmmA, zmmB, m);
+ cc.evex().vfmadd231ps(xmmA, xmmB, m);
+ cc.evex().vfmadd231ps(ymmA, ymmB, m);
+ cc.evex().vfmadd231ps(zmmA, zmmB, m);
+ cc.evex().vfmadd231sd(xmmA, xmmB, m);
+ cc.evex().vfmadd231ss(xmmA, xmmB, m);
+ cc.evex().vfmaddsub132pd(xmmA, xmmB, m);
+ cc.evex().vfmaddsub132pd(ymmA, ymmB, m);
+ cc.evex().vfmaddsub132pd(zmmA, zmmB, m);
+ cc.evex().vfmaddsub132ps(xmmA, xmmB, m);
+ cc.evex().vfmaddsub132ps(ymmA, ymmB, m);
+ cc.evex().vfmaddsub132ps(zmmA, zmmB, m);
+ cc.evex().vfmaddsub213pd(xmmA, xmmB, m);
+ cc.evex().vfmaddsub213pd(ymmA, ymmB, m);
+ cc.evex().vfmaddsub213pd(zmmA, zmmB, m);
+ cc.evex().vfmaddsub213ps(xmmA, xmmB, m);
+ cc.evex().vfmaddsub213ps(ymmA, ymmB, m);
+ cc.evex().vfmaddsub213ps(zmmA, zmmB, m);
+ cc.evex().vfmaddsub231pd(xmmA, xmmB, m);
+ cc.evex().vfmaddsub231pd(ymmA, ymmB, m);
+ cc.evex().vfmaddsub231pd(zmmA, zmmB, m);
+ cc.evex().vfmaddsub231ps(xmmA, xmmB, m);
+ cc.evex().vfmaddsub231ps(ymmA, ymmB, m);
+ cc.evex().vfmaddsub231ps(zmmA, zmmB, m);
+ cc.evex().vfmsub132pd(xmmA, xmmB, m);
+ cc.evex().vfmsub132pd(ymmA, ymmB, m);
+ cc.evex().vfmsub132pd(zmmA, zmmB, m);
+ cc.evex().vfmsub132ps(xmmA, xmmB, m);
+ cc.evex().vfmsub132ps(ymmA, ymmB, m);
+ cc.evex().vfmsub132ps(zmmA, zmmB, m);
+ cc.evex().vfmsub132sd(xmmA, xmmB, m);
+ cc.evex().vfmsub132ss(xmmA, xmmB, m);
+ cc.evex().vfmsub213pd(xmmA, xmmB, m);
+ cc.evex().vfmsub213pd(ymmA, ymmB, m);
+ cc.evex().vfmsub213pd(zmmA, zmmB, m);
+ cc.evex().vfmsub213ps(xmmA, xmmB, m);
+ cc.evex().vfmsub213ps(ymmA, ymmB, m);
+ cc.evex().vfmsub213ps(zmmA, zmmB, m);
+ cc.evex().vfmsub213sd(xmmA, xmmB, m);
+ cc.evex().vfmsub213ss(xmmA, xmmB, m);
+ cc.evex().vfmsub231pd(xmmA, xmmB, m);
+ cc.evex().vfmsub231pd(ymmA, ymmB, m);
+ cc.evex().vfmsub231pd(zmmA, zmmB, m);
+ cc.evex().vfmsub231ps(xmmA, xmmB, m);
+ cc.evex().vfmsub231ps(ymmA, ymmB, m);
+ cc.evex().vfmsub231ps(zmmA, zmmB, m);
+ cc.evex().vfmsub231sd(xmmA, xmmB, m);
+ cc.evex().vfmsub231ss(xmmA, xmmB, m);
+ cc.evex().vfmsubadd132pd(xmmA, xmmB, m);
+ cc.evex().vfmsubadd132pd(ymmA, ymmB, m);
+ cc.evex().vfmsubadd132pd(zmmA, zmmB, m);
+ cc.evex().vfmsubadd132ps(xmmA, xmmB, m);
+ cc.evex().vfmsubadd132ps(ymmA, ymmB, m);
+ cc.evex().vfmsubadd132ps(zmmA, zmmB, m);
+ cc.evex().vfmsubadd213pd(xmmA, xmmB, m);
+ cc.evex().vfmsubadd213pd(ymmA, ymmB, m);
+ cc.evex().vfmsubadd213pd(zmmA, zmmB, m);
+ cc.evex().vfmsubadd213ps(xmmA, xmmB, m);
+ cc.evex().vfmsubadd213ps(ymmA, ymmB, m);
+ cc.evex().vfmsubadd213ps(zmmA, zmmB, m);
+ cc.evex().vfmsubadd231pd(xmmA, xmmB, m);
+ cc.evex().vfmsubadd231pd(ymmA, ymmB, m);
+ cc.evex().vfmsubadd231pd(zmmA, zmmB, m);
+ cc.evex().vfmsubadd231ps(xmmA, xmmB, m);
+ cc.evex().vfmsubadd231ps(ymmA, ymmB, m);
+ cc.evex().vfmsubadd231ps(zmmA, zmmB, m);
+ cc.evex().vfnmadd132pd(xmmA, xmmB, m);
+ cc.evex().vfnmadd132pd(ymmA, ymmB, m);
+ cc.evex().vfnmadd132pd(zmmA, zmmB, m);
+ cc.evex().vfnmadd132ps(xmmA, xmmB, m);
+ cc.evex().vfnmadd132ps(ymmA, ymmB, m);
+ cc.evex().vfnmadd132ps(zmmA, zmmB, m);
+ cc.evex().vfnmadd132sd(xmmA, xmmB, m);
+ cc.evex().vfnmadd132ss(xmmA, xmmB, m);
+ cc.evex().vfnmadd213pd(xmmA, xmmB, m);
+ cc.evex().vfnmadd213pd(ymmA, ymmB, m);
+ cc.evex().vfnmadd213pd(zmmA, zmmB, m);
+ cc.evex().vfnmadd213ps(xmmA, xmmB, m);
+ cc.evex().vfnmadd213ps(ymmA, ymmB, m);
+ cc.evex().vfnmadd213ps(zmmA, zmmB, m);
+ cc.evex().vfnmadd213sd(xmmA, xmmB, m);
+ cc.evex().vfnmadd213ss(xmmA, xmmB, m);
+ cc.evex().vfnmadd231pd(xmmA, xmmB, m);
+ cc.evex().vfnmadd231pd(ymmA, ymmB, m);
+ cc.evex().vfnmadd231pd(zmmA, zmmB, m);
+ cc.evex().vfnmadd231ps(xmmA, xmmB, m);
+ cc.evex().vfnmadd231ps(ymmA, ymmB, m);
+ cc.evex().vfnmadd231ps(zmmA, zmmB, m);
+ cc.evex().vfnmadd231sd(xmmA, xmmB, m);
+ cc.evex().vfnmadd231ss(xmmA, xmmB, m);
+ cc.evex().vfnmsub132pd(xmmA, xmmB, m);
+ cc.evex().vfnmsub132pd(ymmA, ymmB, m);
+ cc.evex().vfnmsub132pd(zmmA, zmmB, m);
+ cc.evex().vfnmsub132ps(xmmA, xmmB, m);
+ cc.evex().vfnmsub132ps(ymmA, ymmB, m);
+ cc.evex().vfnmsub132ps(zmmA, zmmB, m);
+ cc.evex().vfnmsub132sd(xmmA, xmmB, m);
+ cc.evex().vfnmsub132ss(xmmA, xmmB, m);
+ cc.evex().vfnmsub213pd(xmmA, xmmB, m);
+ cc.evex().vfnmsub213pd(ymmA, ymmB, m);
+ cc.evex().vfnmsub213pd(zmmA, zmmB, m);
+ cc.evex().vfnmsub213ps(xmmA, xmmB, m);
+ cc.evex().vfnmsub213ps(ymmA, ymmB, m);
+ cc.evex().vfnmsub213ps(zmmA, zmmB, m);
+ cc.evex().vfnmsub213sd(xmmA, xmmB, m);
+ cc.evex().vfnmsub213ss(xmmA, xmmB, m);
+ cc.evex().vfnmsub231pd(xmmA, xmmB, m);
+ cc.evex().vfnmsub231pd(ymmA, ymmB, m);
+ cc.evex().vfnmsub231pd(zmmA, zmmB, m);
+ cc.evex().vfnmsub231ps(xmmA, xmmB, m);
+ cc.evex().vfnmsub231ps(ymmA, ymmB, m);
+ cc.evex().vfnmsub231ps(zmmA, zmmB, m);
+ cc.evex().vfnmsub231sd(xmmA, xmmB, m);
+ cc.evex().vfnmsub231ss(xmmA, xmmB, m);
+ cc.evex().vfpclasspd(kA, m128, 0);
+ cc.evex().vfpclasspd(kA, m256, 0);
+ cc.evex().vfpclasspd(kA, m512, 0);
+ cc.evex().vfpclassps(kA, m128, 0);
+ cc.evex().vfpclassps(kA, m256, 0);
+ cc.evex().vfpclassps(kA, m512, 0);
+ cc.evex().vfpclasssd(kA, m, 0);
+ cc.evex().vfpclassss(kA, m, 0);
+ cc.evex().k(kA).vgatherdpd(xmmA, vx_ptr);
+ cc.evex().k(kA).vgatherdpd(ymmA, vx_ptr);
+ cc.evex().k(kA).vgatherdpd(zmmA, vy_ptr);
+ cc.evex().k(kA).vgatherdps(xmmA, vx_ptr);
+ cc.evex().k(kA).vgatherdps(ymmA, vy_ptr);
+ cc.evex().k(kA).vgatherdps(zmmA, vz_ptr);
+ cc.evex().k(kA).vgatherpf0dpd(vy_ptr);
+ cc.evex().k(kA).vgatherpf0dps(vz_ptr);
+ cc.evex().k(kA).vgatherpf0qpd(vz_ptr);
+ cc.evex().k(kA).vgatherpf0qps(vz_ptr);
+ cc.evex().k(kA).vgatherpf1dpd(vy_ptr);
+ cc.evex().k(kA).vgatherpf1dps(vz_ptr);
+ cc.evex().k(kA).vgatherpf1qpd(vz_ptr);
+ cc.evex().k(kA).vgatherpf1qps(vz_ptr);
+ cc.evex().k(kA).vgatherqpd(xmmA, vx_ptr);
+ cc.evex().k(kA).vgatherqpd(ymmA, vy_ptr);
+ cc.evex().k(kA).vgatherqpd(zmmA, vz_ptr);
+ cc.evex().k(kA).vgatherqps(xmmA, vx_ptr);
+ cc.evex().k(kA).vgatherqps(xmmA, vy_ptr);
+ cc.evex().k(kA).vgatherqps(ymmA, vz_ptr);
+ cc.evex().vgetexppd(xmmA, m);
+ cc.evex().vgetexppd(ymmA, m);
+ cc.evex().vgetexppd(zmmA, m);
+ cc.evex().vgetexpps(xmmA, m);
+ cc.evex().vgetexpps(ymmA, m);
+ cc.evex().vgetexpps(zmmA, m);
+ cc.evex().vgetexpsd(xmmA, xmmB, m);
+ cc.evex().vgetexpss(xmmA, xmmB, m);
+ cc.evex().vgetmantpd(xmmA, m, 0);
+ cc.evex().vgetmantpd(ymmA, m, 0);
+ cc.evex().vgetmantpd(zmmA, m, 0);
+ cc.evex().vgetmantps(xmmA, m, 0);
+ cc.evex().vgetmantps(ymmA, m, 0);
+ cc.evex().vgetmantps(zmmA, m, 0);
+ cc.evex().vgetmantsd(xmmA, xmmB, m, 0);
+ cc.evex().vgetmantss(xmmA, xmmB, m, 0);
+ cc.evex().vinsertf32x4(ymmA, ymmB, m, 0);
+ cc.evex().vinsertf32x4(zmmA, zmmB, m, 0);
+ cc.evex().vinsertf32x8(zmmA, zmmB, m, 0);
+ cc.evex().vinsertf64x2(ymmA, ymmB, m, 0);
+ cc.evex().vinsertf64x2(zmmA, zmmB, m, 0);
+ cc.evex().vinsertf64x4(zmmA, zmmB, m, 0);
+ cc.evex().vinserti32x4(ymmA, ymmB, m, 0);
+ cc.evex().vinserti32x4(zmmA, zmmB, m, 0);
+ cc.evex().vinserti32x8(zmmA, zmmB, m, 0);
+ cc.evex().vinserti64x2(ymmA, ymmB, m, 0);
+ cc.evex().vinserti64x2(zmmA, zmmB, m, 0);
+ cc.evex().vinserti64x4(zmmA, zmmB, m, 0);
+ cc.evex().vinsertps(xmmA, xmmB, m, 0);
+ cc.evex().vmaxpd(xmmA, xmmB, m);
+ cc.evex().vmaxpd(ymmA, ymmB, m);
+ cc.evex().vmaxpd(zmmA, zmmB, m);
+ cc.evex().vmaxps(xmmA, xmmB, m);
+ cc.evex().vmaxps(ymmA, ymmB, m);
+ cc.evex().vmaxps(zmmA, zmmB, m);
+ cc.evex().vmaxsd(xmmA, xmmB, m);
+ cc.evex().vmaxss(xmmA, xmmB, m);
+ cc.evex().vminpd(xmmA, xmmB, m);
+ cc.evex().vminpd(ymmA, ymmB, m);
+ cc.evex().vminpd(zmmA, zmmB, m);
+ cc.evex().vminps(xmmA, xmmB, m);
+ cc.evex().vminps(ymmA, ymmB, m);
+ cc.evex().vminps(zmmA, zmmB, m);
+ cc.evex().vminsd(xmmA, xmmB, m);
+ cc.evex().vminss(xmmA, xmmB, m);
+ cc.evex().vmovapd(xmmA, m);
+ cc.evex().vmovapd(m, xmmB);
+ cc.evex().vmovapd(ymmA, m);
+ cc.evex().vmovapd(m, ymmB);
+ cc.evex().vmovapd(zmmA, m);
+ cc.evex().vmovapd(m, zmmB);
+ cc.evex().vmovaps(xmmA, m);
+ cc.evex().vmovaps(m, xmmB);
+ cc.evex().vmovaps(ymmA, m);
+ cc.evex().vmovaps(m, ymmB);
+ cc.evex().vmovaps(zmmA, m);
+ cc.evex().vmovaps(m, zmmB);
+ cc.evex().vmovd(m, xmmB);
+ cc.evex().vmovd(xmmA, m);
+ cc.evex().vmovddup(xmmA, m);
+ cc.evex().vmovddup(ymmA, m);
+ cc.evex().vmovddup(zmmA, m);
+ cc.evex().vmovdqa32(xmmA, m);
+ cc.evex().vmovdqa32(m, xmmB);
+ cc.evex().vmovdqa32(ymmA, m);
+ cc.evex().vmovdqa32(m, ymmB);
+ cc.evex().vmovdqa32(zmmA, m);
+ cc.evex().vmovdqa32(m, zmmB);
+ cc.evex().vmovdqa64(xmmA, m);
+ cc.evex().vmovdqa64(m, xmmB);
+ cc.evex().vmovdqa64(ymmA, m);
+ cc.evex().vmovdqa64(m, ymmB);
+ cc.evex().vmovdqa64(zmmA, m);
+ cc.evex().vmovdqa64(m, zmmB);
+ cc.evex().vmovdqu16(xmmA, m);
+ cc.evex().vmovdqu16(m, xmmB);
+ cc.evex().vmovdqu16(ymmA, m);
+ cc.evex().vmovdqu16(m, ymmB);
+ cc.evex().vmovdqu16(zmmA, m);
+ cc.evex().vmovdqu16(m, zmmB);
+ cc.evex().vmovdqu32(xmmA, m);
+ cc.evex().vmovdqu32(m, xmmB);
+ cc.evex().vmovdqu32(ymmA, m);
+ cc.evex().vmovdqu32(m, ymmB);
+ cc.evex().vmovdqu32(zmmA, m);
+ cc.evex().vmovdqu32(m, zmmB);
+ cc.evex().vmovdqu64(xmmA, m);
+ cc.evex().vmovdqu64(m, xmmB);
+ cc.evex().vmovdqu64(ymmA, m);
+ cc.evex().vmovdqu64(m, ymmB);
+ cc.evex().vmovdqu64(zmmA, m);
+ cc.evex().vmovdqu64(m, zmmB);
+ cc.evex().vmovdqu8(xmmA, m);
+ cc.evex().vmovdqu8(m, xmmB);
+ cc.evex().vmovdqu8(ymmA, m);
+ cc.evex().vmovdqu8(m, ymmB);
+ cc.evex().vmovdqu8(zmmA, m);
+ cc.evex().vmovdqu8(m, zmmB);
+ cc.evex().vmovhpd(m, xmmB);
+ cc.evex().vmovhpd(xmmA, xmmB, m);
+ cc.evex().vmovhps(m, xmmB);
+ cc.evex().vmovhps(xmmA, xmmB, m);
+ cc.evex().vmovlpd(m, xmmB);
+ cc.evex().vmovlpd(xmmA, xmmB, m);
+ cc.evex().vmovlps(m, xmmB);
+ cc.evex().vmovlps(xmmA, xmmB, m);
+ cc.evex().vmovntdq(m, xmmB);
+ cc.evex().vmovntdq(m, ymmB);
+ cc.evex().vmovntdq(m, zmmB);
+ cc.evex().vmovntdqa(xmmA, m);
+ cc.evex().vmovntdqa(ymmA, m);
+ cc.evex().vmovntdqa(zmmA, m);
+ cc.evex().vmovntpd(m, xmmB);
+ cc.evex().vmovntpd(m, ymmB);
+ cc.evex().vmovntpd(m, zmmB);
+ cc.evex().vmovntps(m, xmmB);
+ cc.evex().vmovntps(m, ymmB);
+ cc.evex().vmovntps(m, zmmB);
+ cc.evex().vmovq(m, xmmB);
+ cc.evex().vmovq(xmmA, m);
+ cc.evex().vmovq(xmmA, m);
+ cc.evex().vmovq(m, xmmB);
+ cc.evex().vmovsd(m, xmmB);
+ cc.evex().vmovsd(xmmA, m);
+ cc.evex().vmovshdup(xmmA, m);
+ cc.evex().vmovshdup(ymmA, m);
+ cc.evex().vmovshdup(zmmA, m);
+ cc.evex().vmovsldup(xmmA, m);
+ cc.evex().vmovsldup(ymmA, m);
+ cc.evex().vmovsldup(zmmA, m);
+ cc.evex().vmovss(m, xmmB);
+ cc.evex().vmovss(xmmA, m);
+ cc.evex().vmovupd(xmmA, m);
+ cc.evex().vmovupd(m, xmmB);
+ cc.evex().vmovupd(ymmA, m);
+ cc.evex().vmovupd(m, ymmB);
+ cc.evex().vmovupd(zmmA, m);
+ cc.evex().vmovupd(m, zmmB);
+ cc.evex().vmovups(xmmA, m);
+ cc.evex().vmovups(m, xmmB);
+ cc.evex().vmovups(ymmA, m);
+ cc.evex().vmovups(m, ymmB);
+ cc.evex().vmovups(zmmA, m);
+ cc.evex().vmovups(m, zmmB);
+ cc.evex().vmulpd(xmmA, xmmB, m);
+ cc.evex().vmulpd(ymmA, ymmB, m);
+ cc.evex().vmulpd(zmmA, zmmB, m);
+ cc.evex().vmulps(xmmA, xmmB, m);
+ cc.evex().vmulps(ymmA, ymmB, m);
+ cc.evex().vmulps(zmmA, zmmB, m);
+ cc.evex().vmulsd(xmmA, xmmB, m);
+ cc.evex().vmulss(xmmA, xmmB, m);
+ cc.evex().vorpd(xmmA, xmmB, m);
+ cc.evex().vorpd(ymmA, ymmB, m);
+ cc.evex().vorpd(zmmA, zmmB, m);
+ cc.evex().vorps(xmmA, xmmB, m);
+ cc.evex().vorps(ymmA, ymmB, m);
+ cc.evex().vorps(zmmA, zmmB, m);
+ cc.evex().vpabsb(xmmA, m);
+ cc.evex().vpabsb(ymmA, m);
+ cc.evex().vpabsb(zmmA, m);
+ cc.evex().vpabsd(xmmA, m);
+ cc.evex().vpabsd(ymmA, m);
+ cc.evex().vpabsd(zmmA, m);
+ cc.evex().vpabsq(xmmA, m);
+ cc.evex().vpabsq(ymmA, m);
+ cc.evex().vpabsq(zmmA, m);
+ cc.evex().vpabsw(xmmA, m);
+ cc.evex().vpabsw(ymmA, m);
+ cc.evex().vpabsw(zmmA, m);
+ cc.evex().vpackssdw(xmmA, xmmB, m);
+ cc.evex().vpackssdw(ymmA, ymmB, m);
+ cc.evex().vpackssdw(zmmA, zmmB, m);
+ cc.evex().vpacksswb(xmmA, xmmB, m);
+ cc.evex().vpacksswb(ymmA, ymmB, m);
+ cc.evex().vpacksswb(zmmA, zmmB, m);
+ cc.evex().vpackusdw(xmmA, xmmB, m);
+ cc.evex().vpackusdw(ymmA, ymmB, m);
+ cc.evex().vpackusdw(zmmA, zmmB, m);
+ cc.evex().vpackuswb(xmmA, xmmB, m);
+ cc.evex().vpackuswb(ymmA, ymmB, m);
+ cc.evex().vpackuswb(zmmA, zmmB, m);
+ cc.evex().vpaddb(xmmA, xmmB, m);
+ cc.evex().vpaddb(ymmA, ymmB, m);
+ cc.evex().vpaddb(zmmA, zmmB, m);
+ cc.evex().vpaddd(xmmA, xmmB, m);
+ cc.evex().vpaddd(ymmA, ymmB, m);
+ cc.evex().vpaddd(zmmA, zmmB, m);
+ cc.evex().vpaddq(xmmA, xmmB, m);
+ cc.evex().vpaddq(ymmA, ymmB, m);
+ cc.evex().vpaddq(zmmA, zmmB, m);
+ cc.evex().vpaddsb(xmmA, xmmB, m);
+ cc.evex().vpaddsb(ymmA, ymmB, m);
+ cc.evex().vpaddsb(zmmA, zmmB, m);
+ cc.evex().vpaddsw(xmmA, xmmB, m);
+ cc.evex().vpaddsw(ymmA, ymmB, m);
+ cc.evex().vpaddsw(zmmA, zmmB, m);
+ cc.evex().vpaddusb(xmmA, xmmB, m);
+ cc.evex().vpaddusb(ymmA, ymmB, m);
+ cc.evex().vpaddusb(zmmA, zmmB, m);
+ cc.evex().vpaddusw(xmmA, xmmB, m);
+ cc.evex().vpaddusw(ymmA, ymmB, m);
+ cc.evex().vpaddusw(zmmA, zmmB, m);
+ cc.evex().vpaddw(xmmA, xmmB, m);
+ cc.evex().vpaddw(ymmA, ymmB, m);
+ cc.evex().vpaddw(zmmA, zmmB, m);
+ cc.evex().vpalignr(xmmA, xmmB, m, 0);
+ cc.evex().vpalignr(ymmA, ymmB, m, 0);
+ cc.evex().vpalignr(zmmA, zmmB, m, 0);
+ cc.evex().vpandd(xmmA, xmmB, m);
+ cc.evex().vpandd(ymmA, ymmB, m);
+ cc.evex().vpandd(zmmA, zmmB, m);
+ cc.evex().vpandnd(xmmA, xmmB, m);
+ cc.evex().vpandnd(ymmA, ymmB, m);
+ cc.evex().vpandnd(zmmA, zmmB, m);
+ cc.evex().vpandnq(xmmA, xmmB, m);
+ cc.evex().vpandnq(ymmA, ymmB, m);
+ cc.evex().vpandnq(zmmA, zmmB, m);
+ cc.evex().vpandq(xmmA, xmmB, m);
+ cc.evex().vpandq(ymmA, ymmB, m);
+ cc.evex().vpandq(zmmA, zmmB, m);
+ cc.evex().vpavgb(xmmA, xmmB, m);
+ cc.evex().vpavgb(ymmA, ymmB, m);
+ cc.evex().vpavgb(zmmA, zmmB, m);
+ cc.evex().vpavgw(xmmA, xmmB, m);
+ cc.evex().vpavgw(ymmA, ymmB, m);
+ cc.evex().vpavgw(zmmA, zmmB, m);
+ cc.evex().vpblendmb(xmmA, xmmB, m);
+ cc.evex().vpblendmb(ymmA, ymmB, m);
+ cc.evex().vpblendmb(zmmA, zmmB, m);
+ cc.evex().vpblendmd(xmmA, xmmB, m);
+ cc.evex().vpblendmd(ymmA, ymmB, m);
+ cc.evex().vpblendmd(zmmA, zmmB, m);
+ cc.evex().vpblendmq(xmmA, xmmB, m);
+ cc.evex().vpblendmq(ymmA, ymmB, m);
+ cc.evex().vpblendmq(zmmA, zmmB, m);
+ cc.evex().vpblendmw(xmmA, xmmB, m);
+ cc.evex().vpblendmw(ymmA, ymmB, m);
+ cc.evex().vpblendmw(zmmA, zmmB, m);
+ cc.evex().vpbroadcastb(xmmA, m);
+ cc.evex().vpbroadcastb(ymmA, m);
+ cc.evex().vpbroadcastb(zmmA, m);
+ cc.evex().vpbroadcastd(xmmA, m);
+ cc.evex().vpbroadcastd(ymmA, m);
+ cc.evex().vpbroadcastd(zmmA, m);
+ cc.evex().vpbroadcastq(xmmA, m);
+ cc.evex().vpbroadcastq(ymmA, m);
+ cc.evex().vpbroadcastq(zmmA, m);
+ cc.evex().vpbroadcastw(xmmA, m);
+ cc.evex().vpbroadcastw(ymmA, m);
+ cc.evex().vpbroadcastw(zmmA, m);
+ cc.evex().vpcmpb(kA, xmmB, m, 0);
+ cc.evex().vpcmpb(kA, ymmB, m, 0);
+ cc.evex().vpcmpb(kA, zmmB, m, 0);
+ cc.evex().vpcmpd(kA, xmmB, m, 0);
+ cc.evex().vpcmpd(kA, ymmB, m, 0);
+ cc.evex().vpcmpd(kA, zmmB, m, 0);
+ cc.evex().vpcmpeqb(kA, xmmB, m);
+ cc.evex().vpcmpeqb(kA, ymmB, m);
+ cc.evex().vpcmpeqb(kA, zmmB, m);
+ cc.evex().vpcmpeqd(kA, xmmB, m);
+ cc.evex().vpcmpeqd(kA, ymmB, m);
+ cc.evex().vpcmpeqd(kA, zmmB, m);
+ cc.evex().vpcmpeqq(kA, xmmB, m);
+ cc.evex().vpcmpeqq(kA, ymmB, m);
+ cc.evex().vpcmpeqq(kA, zmmB, m);
+ cc.evex().vpcmpeqw(kA, xmmB, m);
+ cc.evex().vpcmpeqw(kA, ymmB, m);
+ cc.evex().vpcmpeqw(kA, zmmB, m);
+ cc.evex().vpcmpgtb(kA, xmmB, m);
+ cc.evex().vpcmpgtb(kA, ymmB, m);
+ cc.evex().vpcmpgtb(kA, zmmB, m);
+ cc.evex().vpcmpgtd(kA, xmmB, m);
+ cc.evex().vpcmpgtd(kA, ymmB, m);
+ cc.evex().vpcmpgtd(kA, zmmB, m);
+ cc.evex().vpcmpgtq(kA, xmmB, m);
+ cc.evex().vpcmpgtq(kA, ymmB, m);
+ cc.evex().vpcmpgtq(kA, zmmB, m);
+ cc.evex().vpcmpgtw(kA, xmmB, m);
+ cc.evex().vpcmpgtw(kA, ymmB, m);
+ cc.evex().vpcmpgtw(kA, zmmB, m);
+ cc.evex().vpcmpq(kA, xmmB, m, 0);
+ cc.evex().vpcmpq(kA, ymmB, m, 0);
+ cc.evex().vpcmpq(kA, zmmB, m, 0);
+ cc.evex().vpcmpub(kA, xmmB, m, 0);
+ cc.evex().vpcmpub(kA, ymmB, m, 0);
+ cc.evex().vpcmpub(kA, zmmB, m, 0);
+ cc.evex().vpcmpud(kA, xmmB, m, 0);
+ cc.evex().vpcmpud(kA, ymmB, m, 0);
+ cc.evex().vpcmpud(kA, zmmB, m, 0);
+ cc.evex().vpcmpuq(kA, xmmB, m, 0);
+ cc.evex().vpcmpuq(kA, ymmB, m, 0);
+ cc.evex().vpcmpuq(kA, zmmB, m, 0);
+ cc.evex().vpcmpuw(kA, xmmB, m, 0);
+ cc.evex().vpcmpuw(kA, ymmB, m, 0);
+ cc.evex().vpcmpuw(kA, zmmB, m, 0);
+ cc.evex().vpcmpw(kA, xmmB, m, 0);
+ cc.evex().vpcmpw(kA, ymmB, m, 0);
+ cc.evex().vpcmpw(kA, zmmB, m, 0);
+ cc.evex().vpcompressd(m, xmmB);
+ cc.evex().vpcompressd(m, ymmB);
+ cc.evex().vpcompressd(m, zmmB);
+ cc.evex().vpcompressq(m, xmmB);
+ cc.evex().vpcompressq(m, ymmB);
+ cc.evex().vpcompressq(m, zmmB);
+ cc.evex().vpconflictd(xmmA, m);
+ cc.evex().vpconflictd(ymmA, m);
+ cc.evex().vpconflictd(zmmA, m);
+ cc.evex().vpconflictq(xmmA, m);
+ cc.evex().vpconflictq(ymmA, m);
+ cc.evex().vpconflictq(zmmA, m);
+ cc.evex().vpermb(xmmA, xmmB, m);
+ cc.evex().vpermb(ymmA, ymmB, m);
+ cc.evex().vpermb(zmmA, zmmB, m);
+ cc.evex().vpermd(ymmA, ymmB, m);
+ cc.evex().vpermd(zmmA, zmmB, m);
+ cc.evex().vpermi2b(xmmA, xmmB, m);
+ cc.evex().vpermi2b(ymmA, ymmB, m);
+ cc.evex().vpermi2b(zmmA, zmmB, m);
+ cc.evex().vpermi2d(xmmA, xmmB, m);
+ cc.evex().vpermi2d(ymmA, ymmB, m);
+ cc.evex().vpermi2d(zmmA, zmmB, m);
+ cc.evex().vpermi2pd(xmmA, xmmB, m);
+ cc.evex().vpermi2pd(ymmA, ymmB, m);
+ cc.evex().vpermi2pd(zmmA, zmmB, m);
+ cc.evex().vpermi2ps(xmmA, xmmB, m);
+ cc.evex().vpermi2ps(ymmA, ymmB, m);
+ cc.evex().vpermi2ps(zmmA, zmmB, m);
+ cc.evex().vpermi2q(xmmA, xmmB, m);
+ cc.evex().vpermi2q(ymmA, ymmB, m);
+ cc.evex().vpermi2q(zmmA, zmmB, m);
+ cc.evex().vpermi2w(xmmA, xmmB, m);
+ cc.evex().vpermi2w(ymmA, ymmB, m);
+ cc.evex().vpermi2w(zmmA, zmmB, m);
+ cc.evex().vpermilpd(xmmA, xmmB, m);
+ cc.evex().vpermilpd(ymmA, ymmB, m);
+ cc.evex().vpermilpd(zmmA, zmmB, m);
+ cc.evex().vpermilpd(xmmA, m, 0);
+ cc.evex().vpermilpd(ymmA, m, 0);
+ cc.evex().vpermilpd(zmmA, m, 0);
+ cc.evex().vpermilps(xmmA, xmmB, m);
+ cc.evex().vpermilps(ymmA, ymmB, m);
+ cc.evex().vpermilps(zmmA, zmmB, m);
+ cc.evex().vpermilps(xmmA, m, 0);
+ cc.evex().vpermilps(ymmA, m, 0);
+ cc.evex().vpermilps(zmmA, m, 0);
+ cc.evex().vpermq(ymmA, ymmB, m);
+ cc.evex().vpermq(zmmA, zmmB, m);
+ cc.evex().vpermq(ymmA, m, 0);
+ cc.evex().vpermq(zmmA, m, 0);
+ cc.evex().vpermt2b(xmmA, xmmB, m);
+ cc.evex().vpermt2b(ymmA, ymmB, m);
+ cc.evex().vpermt2b(zmmA, zmmB, m);
+ cc.evex().vpermt2d(xmmA, xmmB, m);
+ cc.evex().vpermt2d(ymmA, ymmB, m);
+ cc.evex().vpermt2d(zmmA, zmmB, m);
+ cc.evex().vpermt2pd(xmmA, xmmB, m);
+ cc.evex().vpermt2pd(ymmA, ymmB, m);
+ cc.evex().vpermt2pd(zmmA, zmmB, m);
+ cc.evex().vpermt2ps(xmmA, xmmB, m);
+ cc.evex().vpermt2ps(ymmA, ymmB, m);
+ cc.evex().vpermt2ps(zmmA, zmmB, m);
+ cc.evex().vpermt2q(xmmA, xmmB, m);
+ cc.evex().vpermt2q(ymmA, ymmB, m);
+ cc.evex().vpermt2q(zmmA, zmmB, m);
+ cc.evex().vpermt2w(xmmA, xmmB, m);
+ cc.evex().vpermt2w(ymmA, ymmB, m);
+ cc.evex().vpermt2w(zmmA, zmmB, m);
+ cc.evex().vpermw(xmmA, xmmB, m);
+ cc.evex().vpermw(ymmA, ymmB, m);
+ cc.evex().vpermw(zmmA, zmmB, m);
+ cc.evex().vpexpandd(xmmA, m);
+ cc.evex().vpexpandd(ymmA, m);
+ cc.evex().vpexpandd(zmmA, m);
+ cc.evex().vpexpandq(xmmA, m);
+ cc.evex().vpexpandq(ymmA, m);
+ cc.evex().vpexpandq(zmmA, m);
+ cc.evex().vpextrb(m, xmmB, 0);
+ cc.evex().vpextrd(m, xmmB, 0);
+ if (cc.is64Bit()) cc.evex().vpextrq(m, xmmB, 0);
+ cc.evex().vpextrw(m, xmmB, 0);
+ cc.evex().k(kA).vpgatherdd(xmmA, vx_ptr);
+ cc.evex().k(kA).vpgatherdd(ymmA, vy_ptr);
+ cc.evex().k(kA).vpgatherdd(zmmA, vz_ptr);
+ cc.evex().k(kA).vpgatherdq(xmmA, vx_ptr);
+ cc.evex().k(kA).vpgatherdq(ymmA, vx_ptr);
+ cc.evex().k(kA).vpgatherdq(zmmA, vy_ptr);
+ cc.evex().k(kA).vpgatherqd(xmmA, vx_ptr);
+ cc.evex().k(kA).vpgatherqd(xmmA, vy_ptr);
+ cc.evex().k(kA).vpgatherqd(ymmA, vz_ptr);
+ cc.evex().k(kA).vpgatherqq(xmmA, vx_ptr);
+ cc.evex().k(kA).vpgatherqq(ymmA, vy_ptr);
+ cc.evex().k(kA).vpgatherqq(zmmA, vz_ptr);
+ cc.evex().vpinsrb(xmmA, xmmB, m, 0);
+ cc.evex().vpinsrd(xmmA, xmmB, m, 0);
+ if (cc.is64Bit()) cc.evex().vpinsrq(xmmA, xmmB, m, 0);
+ cc.evex().vpinsrw(xmmA, xmmB, m, 0);
+ cc.evex().vplzcntd(xmmA, m);
+ cc.evex().vplzcntd(ymmA, m);
+ cc.evex().vplzcntd(zmmA, m);
+ cc.evex().vplzcntq(xmmA, m);
+ cc.evex().vplzcntq(ymmA, m);
+ cc.evex().vplzcntq(zmmA, m);
+ cc.evex().vpmadd52huq(xmmA, xmmB, m);
+ cc.evex().vpmadd52huq(ymmA, ymmB, m);
+ cc.evex().vpmadd52huq(zmmA, zmmB, m);
+ cc.evex().vpmadd52luq(xmmA, xmmB, m);
+ cc.evex().vpmadd52luq(ymmA, ymmB, m);
+ cc.evex().vpmadd52luq(zmmA, zmmB, m);
+ cc.evex().vpmaddubsw(xmmA, xmmB, m);
+ cc.evex().vpmaddubsw(ymmA, ymmB, m);
+ cc.evex().vpmaddubsw(zmmA, zmmB, m);
+ cc.evex().vpmaddwd(xmmA, xmmB, m);
+ cc.evex().vpmaddwd(ymmA, ymmB, m);
+ cc.evex().vpmaddwd(zmmA, zmmB, m);
+ cc.evex().vpmaxsb(xmmA, xmmB, m);
+ cc.evex().vpmaxsb(ymmA, ymmB, m);
+ cc.evex().vpmaxsb(zmmA, zmmB, m);
+ cc.evex().vpmaxsd(xmmA, xmmB, m);
+ cc.evex().vpmaxsd(ymmA, ymmB, m);
+ cc.evex().vpmaxsd(zmmA, zmmB, m);
+ cc.evex().vpmaxsq(xmmA, xmmB, m);
+ cc.evex().vpmaxsq(ymmA, ymmB, m);
+ cc.evex().vpmaxsq(zmmA, zmmB, m);
+ cc.evex().vpmaxsw(xmmA, xmmB, m);
+ cc.evex().vpmaxsw(ymmA, ymmB, m);
+ cc.evex().vpmaxsw(zmmA, zmmB, m);
+ cc.evex().vpmaxub(xmmA, xmmB, m);
+ cc.evex().vpmaxub(ymmA, ymmB, m);
+ cc.evex().vpmaxub(zmmA, zmmB, m);
+ cc.evex().vpmaxud(xmmA, xmmB, m);
+ cc.evex().vpmaxud(ymmA, ymmB, m);
+ cc.evex().vpmaxud(zmmA, zmmB, m);
+ cc.evex().vpmaxuq(xmmA, xmmB, m);
+ cc.evex().vpmaxuq(ymmA, ymmB, m);
+ cc.evex().vpmaxuq(zmmA, zmmB, m);
+ cc.evex().vpmaxuw(xmmA, xmmB, m);
+ cc.evex().vpmaxuw(ymmA, ymmB, m);
+ cc.evex().vpmaxuw(zmmA, zmmB, m);
+ cc.evex().vpminsb(xmmA, xmmB, m);
+ cc.evex().vpminsb(ymmA, ymmB, m);
+ cc.evex().vpminsb(zmmA, zmmB, m);
+ cc.evex().vpminsd(xmmA, xmmB, m);
+ cc.evex().vpminsd(ymmA, ymmB, m);
+ cc.evex().vpminsd(zmmA, zmmB, m);
+ cc.evex().vpminsq(xmmA, xmmB, m);
+ cc.evex().vpminsq(ymmA, ymmB, m);
+ cc.evex().vpminsq(zmmA, zmmB, m);
+ cc.evex().vpminsw(xmmA, xmmB, m);
+ cc.evex().vpminsw(ymmA, ymmB, m);
+ cc.evex().vpminsw(zmmA, zmmB, m);
+ cc.evex().vpminub(xmmA, xmmB, m);
+ cc.evex().vpminub(ymmA, ymmB, m);
+ cc.evex().vpminub(zmmA, zmmB, m);
+ cc.evex().vpminud(xmmA, xmmB, m);
+ cc.evex().vpminud(ymmA, ymmB, m);
+ cc.evex().vpminud(zmmA, zmmB, m);
+ cc.evex().vpminuq(xmmA, xmmB, m);
+ cc.evex().vpminuq(ymmA, ymmB, m);
+ cc.evex().vpminuq(zmmA, zmmB, m);
+ cc.evex().vpminuw(xmmA, xmmB, m);
+ cc.evex().vpminuw(ymmA, ymmB, m);
+ cc.evex().vpminuw(zmmA, zmmB, m);
+ cc.evex().vpmovdb(m, xmmB);
+ cc.evex().vpmovdb(m, ymmB);
+ cc.evex().vpmovdb(m, zmmB);
+ cc.evex().vpmovdw(m, xmmB);
+ cc.evex().vpmovdw(m, ymmB);
+ cc.evex().vpmovdw(m, zmmB);
+ cc.evex().vpmovqb(m, xmmB);
+ cc.evex().vpmovqb(m, ymmB);
+ cc.evex().vpmovqb(m, zmmB);
+ cc.evex().vpmovqd(m, xmmB);
+ cc.evex().vpmovqd(m, ymmB);
+ cc.evex().vpmovqd(m, zmmB);
+ cc.evex().vpmovqw(m, xmmB);
+ cc.evex().vpmovqw(m, ymmB);
+ cc.evex().vpmovqw(m, zmmB);
+ cc.evex().vpmovsdb(m, xmmB);
+ cc.evex().vpmovsdb(m, ymmB);
+ cc.evex().vpmovsdb(m, zmmB);
+ cc.evex().vpmovsdw(m, xmmB);
+ cc.evex().vpmovsdw(m, ymmB);
+ cc.evex().vpmovsdw(m, zmmB);
+ cc.evex().vpmovsqb(m, xmmB);
+ cc.evex().vpmovsqb(m, ymmB);
+ cc.evex().vpmovsqb(m, zmmB);
+ cc.evex().vpmovsqd(m, xmmB);
+ cc.evex().vpmovsqd(m, ymmB);
+ cc.evex().vpmovsqd(m, zmmB);
+ cc.evex().vpmovsqw(m, xmmB);
+ cc.evex().vpmovsqw(m, ymmB);
+ cc.evex().vpmovsqw(m, zmmB);
+ cc.evex().vpmovswb(m, xmmB);
+ cc.evex().vpmovswb(m, ymmB);
+ cc.evex().vpmovswb(m, zmmB);
+ cc.evex().vpmovsxbd(xmmA, m);
+ cc.evex().vpmovsxbd(ymmA, m);
+ cc.evex().vpmovsxbd(zmmA, m);
+ cc.evex().vpmovsxbq(xmmA, m);
+ cc.evex().vpmovsxbq(ymmA, m);
+ cc.evex().vpmovsxbq(zmmA, m);
+ cc.evex().vpmovsxbw(xmmA, m);
+ cc.evex().vpmovsxbw(ymmA, m);
+ cc.evex().vpmovsxbw(zmmA, m);
+ cc.evex().vpmovsxdq(xmmA, m);
+ cc.evex().vpmovsxdq(ymmA, m);
+ cc.evex().vpmovsxdq(zmmA, m);
+ cc.evex().vpmovsxwd(xmmA, m);
+ cc.evex().vpmovsxwd(ymmA, m);
+ cc.evex().vpmovsxwd(zmmA, m);
+ cc.evex().vpmovsxwq(xmmA, m);
+ cc.evex().vpmovsxwq(ymmA, m);
+ cc.evex().vpmovsxwq(zmmA, m);
+ cc.evex().vpmovusdb(m, xmmB);
+ cc.evex().vpmovusdb(m, ymmB);
+ cc.evex().vpmovusdb(m, zmmB);
+ cc.evex().vpmovusdw(m, xmmB);
+ cc.evex().vpmovusdw(m, ymmB);
+ cc.evex().vpmovusdw(m, zmmB);
+ cc.evex().vpmovusqb(m, xmmB);
+ cc.evex().vpmovusqb(m, ymmB);
+ cc.evex().vpmovusqb(m, zmmB);
+ cc.evex().vpmovusqd(m, xmmB);
+ cc.evex().vpmovusqd(m, ymmB);
+ cc.evex().vpmovusqd(m, zmmB);
+ cc.evex().vpmovusqw(m, xmmB);
+ cc.evex().vpmovusqw(m, ymmB);
+ cc.evex().vpmovusqw(m, zmmB);
+ cc.evex().vpmovuswb(m, xmmB);
+ cc.evex().vpmovuswb(m, ymmB);
+ cc.evex().vpmovuswb(m, zmmB);
+ cc.evex().vpmovwb(m, xmmB);
+ cc.evex().vpmovwb(m, ymmB);
+ cc.evex().vpmovwb(m, zmmB);
+ cc.evex().vpmovzxbd(xmmA, m);
+ cc.evex().vpmovzxbd(ymmA, m);
+ cc.evex().vpmovzxbd(zmmA, m);
+ cc.evex().vpmovzxbq(xmmA, m);
+ cc.evex().vpmovzxbq(ymmA, m);
+ cc.evex().vpmovzxbq(zmmA, m);
+ cc.evex().vpmovzxbw(xmmA, m);
+ cc.evex().vpmovzxbw(ymmA, m);
+ cc.evex().vpmovzxbw(zmmA, m);
+ cc.evex().vpmovzxdq(xmmA, m);
+ cc.evex().vpmovzxdq(ymmA, m);
+ cc.evex().vpmovzxdq(zmmA, m);
+ cc.evex().vpmovzxwd(xmmA, m);
+ cc.evex().vpmovzxwd(ymmA, m);
+ cc.evex().vpmovzxwd(zmmA, m);
+ cc.evex().vpmovzxwq(xmmA, m);
+ cc.evex().vpmovzxwq(ymmA, m);
+ cc.evex().vpmovzxwq(zmmA, m);
+ cc.evex().vpmuldq(xmmA, xmmB, m);
+ cc.evex().vpmuldq(ymmA, ymmB, m);
+ cc.evex().vpmuldq(zmmA, zmmB, m);
+ cc.evex().vpmulhrsw(xmmA, xmmB, m);
+ cc.evex().vpmulhrsw(ymmA, ymmB, m);
+ cc.evex().vpmulhrsw(zmmA, zmmB, m);
+ cc.evex().vpmulhuw(xmmA, xmmB, m);
+ cc.evex().vpmulhuw(ymmA, ymmB, m);
+ cc.evex().vpmulhuw(zmmA, zmmB, m);
+ cc.evex().vpmulhw(xmmA, xmmB, m);
+ cc.evex().vpmulhw(ymmA, ymmB, m);
+ cc.evex().vpmulhw(zmmA, zmmB, m);
+ cc.evex().vpmulld(xmmA, xmmB, m);
+ cc.evex().vpmulld(ymmA, ymmB, m);
+ cc.evex().vpmulld(zmmA, zmmB, m);
+ cc.evex().vpmullq(xmmA, xmmB, m);
+ cc.evex().vpmullq(ymmA, ymmB, m);
+ cc.evex().vpmullq(zmmA, zmmB, m);
+ cc.evex().vpmullw(xmmA, xmmB, m);
+ cc.evex().vpmullw(ymmA, ymmB, m);
+ cc.evex().vpmullw(zmmA, zmmB, m);
+ cc.evex().vpmultishiftqb(xmmA, xmmB, m);
+ cc.evex().vpmultishiftqb(ymmA, ymmB, m);
+ cc.evex().vpmultishiftqb(zmmA, zmmB, m);
+ cc.evex().vpmuludq(xmmA, xmmB, m);
+ cc.evex().vpmuludq(ymmA, ymmB, m);
+ cc.evex().vpmuludq(zmmA, zmmB, m);
+ cc.evex().vpopcntd(zmmA, m);
+ cc.evex().vpopcntq(zmmA, m);
+ cc.evex().vpord(xmmA, xmmB, m);
+ cc.evex().vpord(ymmA, ymmB, m);
+ cc.evex().vpord(zmmA, zmmB, m);
+ cc.evex().vporq(xmmA, xmmB, m);
+ cc.evex().vporq(ymmA, ymmB, m);
+ cc.evex().vporq(zmmA, zmmB, m);
+ cc.evex().vprold(xmmA, m, 0);
+ cc.evex().vprold(ymmA, m, 0);
+ cc.evex().vprold(zmmA, m, 0);
+ cc.evex().vprolq(xmmA, m, 0);
+ cc.evex().vprolq(ymmA, m, 0);
+ cc.evex().vprolq(zmmA, m, 0);
+ cc.evex().vprolvd(xmmA, xmmB, m);
+ cc.evex().vprolvd(ymmA, ymmB, m);
+ cc.evex().vprolvd(zmmA, zmmB, m);
+ cc.evex().vprolvq(xmmA, xmmB, m);
+ cc.evex().vprolvq(ymmA, ymmB, m);
+ cc.evex().vprolvq(zmmA, zmmB, m);
+ cc.evex().vprord(xmmA, m, 0);
+ cc.evex().vprord(ymmA, m, 0);
+ cc.evex().vprord(zmmA, m, 0);
+ cc.evex().vprorq(xmmA, m, 0);
+ cc.evex().vprorq(ymmA, m, 0);
+ cc.evex().vprorq(zmmA, m, 0);
+ cc.evex().vprorvd(xmmA, xmmB, m);
+ cc.evex().vprorvd(ymmA, ymmB, m);
+ cc.evex().vprorvd(zmmA, zmmB, m);
+ cc.evex().vprorvq(xmmA, xmmB, m);
+ cc.evex().vprorvq(ymmA, ymmB, m);
+ cc.evex().vprorvq(zmmA, zmmB, m);
+ cc.evex().vpsadbw(xmmA, xmmB, m);
+ cc.evex().vpsadbw(ymmA, ymmB, m);
+ cc.evex().vpsadbw(zmmA, zmmB, m);
+ cc.evex().k(kA).vpscatterdd(vx_ptr, xmmB);
+ cc.evex().k(kA).vpscatterdd(vy_ptr, ymmB);
+ cc.evex().k(kA).vpscatterdd(vz_ptr, zmmB);
+ cc.evex().k(kA).vpscatterdq(vx_ptr, xmmB);
+ cc.evex().k(kA).vpscatterdq(vx_ptr, ymmB);
+ cc.evex().k(kA).vpscatterdq(vy_ptr, zmmB);
+ cc.evex().k(kA).vpscatterqd(vx_ptr, xmmB);
+ cc.evex().k(kA).vpscatterqd(vy_ptr, xmmB);
+ cc.evex().k(kA).vpscatterqd(vz_ptr, ymmB);
+ cc.evex().k(kA).vpscatterqq(vx_ptr, xmmB);
+ cc.evex().k(kA).vpscatterqq(vy_ptr, ymmB);
+ cc.evex().k(kA).vpscatterqq(vz_ptr, zmmB);
+ cc.evex().vpshufb(xmmA, xmmB, m);
+ cc.evex().vpshufb(ymmA, ymmB, m);
+ cc.evex().vpshufb(zmmA, zmmB, m);
+ cc.evex().vpshufd(xmmA, m, 0);
+ cc.evex().vpshufd(ymmA, m, 0);
+ cc.evex().vpshufd(zmmA, m, 0);
+ cc.evex().vpshufhw(xmmA, m, 0);
+ cc.evex().vpshufhw(ymmA, m, 0);
+ cc.evex().vpshufhw(zmmA, m, 0);
+ cc.evex().vpshuflw(xmmA, m, 0);
+ cc.evex().vpshuflw(ymmA, m, 0);
+ cc.evex().vpshuflw(zmmA, m, 0);
+ cc.evex().vpslld(xmmA, xmmB, m);
+ cc.evex().vpslld(xmmA, m, 0);
+ cc.evex().vpslld(ymmA, ymmB, m);
+ cc.evex().vpslld(ymmA, m, 0);
+ cc.evex().vpslld(zmmA, zmmB, m);
+ cc.evex().vpslld(zmmA, m, 0);
+ cc.evex().vpslldq(xmmA, m, 0);
+ cc.evex().vpslldq(ymmA, m, 0);
+ cc.evex().vpslldq(zmmA, m, 0);
+ cc.evex().vpsllq(xmmA, xmmB, m);
+ cc.evex().vpsllq(xmmA, m, 0);
+ cc.evex().vpsllq(ymmA, ymmB, m);
+ cc.evex().vpsllq(ymmA, m, 0);
+ cc.evex().vpsllq(zmmA, zmmB, m);
+ cc.evex().vpsllq(zmmA, m, 0);
+ cc.evex().vpsllvd(xmmA, xmmB, m);
+ cc.evex().vpsllvd(ymmA, ymmB, m);
+ cc.evex().vpsllvd(zmmA, zmmB, m);
+ cc.evex().vpsllvq(xmmA, xmmB, m);
+ cc.evex().vpsllvq(ymmA, ymmB, m);
+ cc.evex().vpsllvq(zmmA, zmmB, m);
+ cc.evex().vpsllvw(xmmA, xmmB, m);
+ cc.evex().vpsllvw(ymmA, ymmB, m);
+ cc.evex().vpsllvw(zmmA, zmmB, m);
+ cc.evex().vpsllw(xmmA, xmmB, m);
+ cc.evex().vpsllw(xmmA, m, 0);
+ cc.evex().vpsllw(ymmA, ymmB, m);
+ cc.evex().vpsllw(ymmA, m, 0);
+ cc.evex().vpsllw(zmmA, zmmB, m);
+ cc.evex().vpsllw(zmmA, m, 0);
+ cc.evex().vpsrad(xmmA, xmmB, m);
+ cc.evex().vpsrad(xmmA, m, 0);
+ cc.evex().vpsrad(ymmA, ymmB, m);
+ cc.evex().vpsrad(ymmA, m, 0);
+ cc.evex().vpsrad(zmmA, zmmB, m);
+ cc.evex().vpsrad(zmmA, m, 0);
+ cc.evex().vpsraq(xmmA, xmmB, m);
+ cc.evex().vpsraq(xmmA, m, 0);
+ cc.evex().vpsraq(ymmA, ymmB, m);
+ cc.evex().vpsraq(ymmA, m, 0);
+ cc.evex().vpsraq(zmmA, zmmB, m);
+ cc.evex().vpsraq(zmmA, m, 0);
+ cc.evex().vpsravd(xmmA, xmmB, m);
+ cc.evex().vpsravd(ymmA, ymmB, m);
+ cc.evex().vpsravd(zmmA, zmmB, m);
+ cc.evex().vpsravq(xmmA, xmmB, m);
+ cc.evex().vpsravq(ymmA, ymmB, m);
+ cc.evex().vpsravq(zmmA, zmmB, m);
+ cc.evex().vpsravw(xmmA, xmmB, m);
+ cc.evex().vpsravw(ymmA, ymmB, m);
+ cc.evex().vpsravw(zmmA, zmmB, m);
+ cc.evex().vpsraw(xmmA, xmmB, m);
+ cc.evex().vpsraw(xmmA, m, 0);
+ cc.evex().vpsraw(ymmA, ymmB, m);
+ cc.evex().vpsraw(ymmA, m, 0);
+ cc.evex().vpsraw(zmmA, zmmB, m);
+ cc.evex().vpsraw(zmmA, m, 0);
+ cc.evex().vpsrld(xmmA, xmmB, m);
+ cc.evex().vpsrld(xmmA, m, 0);
+ cc.evex().vpsrld(ymmA, ymmB, m);
+ cc.evex().vpsrld(ymmA, m, 0);
+ cc.evex().vpsrld(zmmA, zmmB, m);
+ cc.evex().vpsrld(zmmA, m, 0);
+ cc.evex().vpsrldq(xmmA, m, 0);
+ cc.evex().vpsrldq(ymmA, m, 0);
+ cc.evex().vpsrldq(zmmA, m, 0);
+ cc.evex().vpsrlq(xmmA, xmmB, m);
+ cc.evex().vpsrlq(xmmA, m, 0);
+ cc.evex().vpsrlq(ymmA, ymmB, m);
+ cc.evex().vpsrlq(ymmA, m, 0);
+ cc.evex().vpsrlq(zmmA, zmmB, m);
+ cc.evex().vpsrlq(zmmA, m, 0);
+ cc.evex().vpsrlvd(xmmA, xmmB, m);
+ cc.evex().vpsrlvd(ymmA, ymmB, m);
+ cc.evex().vpsrlvd(zmmA, zmmB, m);
+ cc.evex().vpsrlvq(xmmA, xmmB, m);
+ cc.evex().vpsrlvq(ymmA, ymmB, m);
+ cc.evex().vpsrlvq(zmmA, zmmB, m);
+ cc.evex().vpsrlvw(xmmA, xmmB, m);
+ cc.evex().vpsrlvw(ymmA, ymmB, m);
+ cc.evex().vpsrlvw(zmmA, zmmB, m);
+ cc.evex().vpsrlw(xmmA, xmmB, m);
+ cc.evex().vpsrlw(xmmA, m, 0);
+ cc.evex().vpsrlw(ymmA, ymmB, m);
+ cc.evex().vpsrlw(ymmA, m, 0);
+ cc.evex().vpsrlw(zmmA, zmmB, m);
+ cc.evex().vpsrlw(zmmA, m, 0);
+ cc.evex().vpsubb(xmmA, xmmB, m);
+ cc.evex().vpsubb(ymmA, ymmB, m);
+ cc.evex().vpsubb(zmmA, zmmB, m);
+ cc.evex().vpsubd(xmmA, xmmB, m);
+ cc.evex().vpsubd(ymmA, ymmB, m);
+ cc.evex().vpsubd(zmmA, zmmB, m);
+ cc.evex().vpsubq(xmmA, xmmB, m);
+ cc.evex().vpsubq(ymmA, ymmB, m);
+ cc.evex().vpsubq(zmmA, zmmB, m);
+ cc.evex().vpsubsb(xmmA, xmmB, m);
+ cc.evex().vpsubsb(ymmA, ymmB, m);
+ cc.evex().vpsubsb(zmmA, zmmB, m);
+ cc.evex().vpsubsw(xmmA, xmmB, m);
+ cc.evex().vpsubsw(ymmA, ymmB, m);
+ cc.evex().vpsubsw(zmmA, zmmB, m);
+ cc.evex().vpsubusb(xmmA, xmmB, m);
+ cc.evex().vpsubusb(ymmA, ymmB, m);
+ cc.evex().vpsubusb(zmmA, zmmB, m);
+ cc.evex().vpsubusw(xmmA, xmmB, m);
+ cc.evex().vpsubusw(ymmA, ymmB, m);
+ cc.evex().vpsubusw(zmmA, zmmB, m);
+ cc.evex().vpsubw(xmmA, xmmB, m);
+ cc.evex().vpsubw(ymmA, ymmB, m);
+ cc.evex().vpsubw(zmmA, zmmB, m);
+ cc.evex().vpternlogd(xmmA, xmmB, m, 0);
+ cc.evex().vpternlogd(ymmA, ymmB, m, 0);
+ cc.evex().vpternlogd(zmmA, zmmB, m, 0);
+ cc.evex().vpternlogq(xmmA, xmmB, m, 0);
+ cc.evex().vpternlogq(ymmA, ymmB, m, 0);
+ cc.evex().vpternlogq(zmmA, zmmB, m, 0);
+ cc.evex().vptestmb(kA, xmmB, m);
+ cc.evex().vptestmb(kA, ymmB, m);
+ cc.evex().vptestmb(kA, zmmB, m);
+ cc.evex().vptestmd(kA, xmmB, m);
+ cc.evex().vptestmd(kA, ymmB, m);
+ cc.evex().vptestmd(kA, zmmB, m);
+ cc.evex().vptestmq(kA, xmmB, m);
+ cc.evex().vptestmq(kA, ymmB, m);
+ cc.evex().vptestmq(kA, zmmB, m);
+ cc.evex().vptestmw(kA, xmmB, m);
+ cc.evex().vptestmw(kA, ymmB, m);
+ cc.evex().vptestmw(kA, zmmB, m);
+ cc.evex().vptestnmb(kA, xmmB, m);
+ cc.evex().vptestnmb(kA, ymmB, m);
+ cc.evex().vptestnmb(kA, zmmB, m);
+ cc.evex().vptestnmd(kA, xmmB, m);
+ cc.evex().vptestnmd(kA, ymmB, m);
+ cc.evex().vptestnmd(kA, zmmB, m);
+ cc.evex().vptestnmq(kA, xmmB, m);
+ cc.evex().vptestnmq(kA, ymmB, m);
+ cc.evex().vptestnmq(kA, zmmB, m);
+ cc.evex().vptestnmw(kA, xmmB, m);
+ cc.evex().vptestnmw(kA, ymmB, m);
+ cc.evex().vptestnmw(kA, zmmB, m);
+ cc.evex().vpunpckhbw(xmmA, xmmB, m);
+ cc.evex().vpunpckhbw(ymmA, ymmB, m);
+ cc.evex().vpunpckhbw(zmmA, zmmB, m);
+ cc.evex().vpunpckhdq(xmmA, xmmB, m);
+ cc.evex().vpunpckhdq(ymmA, ymmB, m);
+ cc.evex().vpunpckhdq(zmmA, zmmB, m);
+ cc.evex().vpunpckhqdq(xmmA, xmmB, m);
+ cc.evex().vpunpckhqdq(ymmA, ymmB, m);
+ cc.evex().vpunpckhqdq(zmmA, zmmB, m);
+ cc.evex().vpunpckhwd(xmmA, xmmB, m);
+ cc.evex().vpunpckhwd(ymmA, ymmB, m);
+ cc.evex().vpunpckhwd(zmmA, zmmB, m);
+ cc.evex().vpunpcklbw(xmmA, xmmB, m);
+ cc.evex().vpunpcklbw(ymmA, ymmB, m);
+ cc.evex().vpunpcklbw(zmmA, zmmB, m);
+ cc.evex().vpunpckldq(xmmA, xmmB, m);
+ cc.evex().vpunpckldq(ymmA, ymmB, m);
+ cc.evex().vpunpckldq(zmmA, zmmB, m);
+ cc.evex().vpunpcklqdq(xmmA, xmmB, m);
+ cc.evex().vpunpcklqdq(ymmA, ymmB, m);
+ cc.evex().vpunpcklqdq(zmmA, zmmB, m);
+ cc.evex().vpunpcklwd(xmmA, xmmB, m);
+ cc.evex().vpunpcklwd(ymmA, ymmB, m);
+ cc.evex().vpunpcklwd(zmmA, zmmB, m);
+ cc.evex().vpxord(xmmA, xmmB, m);
+ cc.evex().vpxord(ymmA, ymmB, m);
+ cc.evex().vpxord(zmmA, zmmB, m);
+ cc.evex().vpxorq(xmmA, xmmB, m);
+ cc.evex().vpxorq(ymmA, ymmB, m);
+ cc.evex().vpxorq(zmmA, zmmB, m);
+ cc.evex().vrangepd(xmmA, xmmB, m, 0);
+ cc.evex().vrangepd(ymmA, ymmB, m, 0);
+ cc.evex().vrangepd(zmmA, zmmB, m, 0);
+ cc.evex().vrangeps(xmmA, xmmB, m, 0);
+ cc.evex().vrangeps(ymmA, ymmB, m, 0);
+ cc.evex().vrangeps(zmmA, zmmB, m, 0);
+ cc.evex().vrangesd(xmmA, xmmB, m, 0);
+ cc.evex().vrangess(xmmA, xmmB, m, 0);
+ cc.evex().vrcp14pd(xmmA, m);
+ cc.evex().vrcp14pd(ymmA, m);
+ cc.evex().vrcp14pd(zmmA, m);
+ cc.evex().vrcp14ps(xmmA, m);
+ cc.evex().vrcp14ps(ymmA, m);
+ cc.evex().vrcp14ps(zmmA, m);
+ cc.evex().vrcp14sd(xmmA, xmmB, m);
+ cc.evex().vrcp14ss(xmmA, xmmB, m);
+ cc.evex().vrcp28pd(zmmA, m);
+ cc.evex().vrcp28ps(zmmA, m);
+ cc.evex().vrcp28sd(xmmA, xmmB, m);
+ cc.evex().vrcp28ss(xmmA, xmmB, m);
+ cc.evex().vreducepd(xmmA, m, 0);
+ cc.evex().vreducepd(ymmA, m, 0);
+ cc.evex().vreducepd(zmmA, m, 0);
+ cc.evex().vreduceps(xmmA, m, 0);
+ cc.evex().vreduceps(ymmA, m, 0);
+ cc.evex().vreduceps(zmmA, m, 0);
+ cc.evex().vreducesd(xmmA, xmmB, m, 0);
+ cc.evex().vreducess(xmmA, xmmB, m, 0);
+ cc.evex().vrndscalepd(xmmA, m, 0);
+ cc.evex().vrndscalepd(ymmA, m, 0);
+ cc.evex().vrndscalepd(zmmA, m, 0);
+ cc.evex().vrndscaleps(xmmA, m, 0);
+ cc.evex().vrndscaleps(ymmA, m, 0);
+ cc.evex().vrndscaleps(zmmA, m, 0);
+ cc.evex().vrndscalesd(xmmA, xmmB, m, 0);
+ cc.evex().vrndscaless(xmmA, xmmB, m, 0);
+ cc.evex().vrsqrt14pd(xmmA, m);
+ cc.evex().vrsqrt14pd(ymmA, m);
+ cc.evex().vrsqrt14pd(zmmA, m);
+ cc.evex().vrsqrt14ps(xmmA, m);
+ cc.evex().vrsqrt14ps(ymmA, m);
+ cc.evex().vrsqrt14ps(zmmA, m);
+ cc.evex().vrsqrt14sd(xmmA, xmmB, m);
+ cc.evex().vrsqrt14ss(xmmA, xmmB, m);
+ cc.evex().vrsqrt28pd(zmmA, m);
+ cc.evex().vrsqrt28ps(zmmA, m);
+ cc.evex().vrsqrt28sd(xmmA, xmmB, m);
+ cc.evex().vrsqrt28ss(xmmA, xmmB, m);
+ cc.evex().vscalefpd(xmmA, xmmB, m);
+ cc.evex().vscalefpd(ymmA, ymmB, m);
+ cc.evex().vscalefpd(zmmA, zmmB, m);
+ cc.evex().vscalefps(xmmA, xmmB, m);
+ cc.evex().vscalefps(ymmA, ymmB, m);
+ cc.evex().vscalefps(zmmA, zmmB, m);
+ cc.evex().vscalefsd(xmmA, xmmB, m);
+ cc.evex().vscalefss(xmmA, xmmB, m);
+ cc.evex().k(kA).vscatterdpd(vx_ptr, xmmB);
+ cc.evex().k(kA).vscatterdpd(vx_ptr, ymmB);
+ cc.evex().k(kA).vscatterdpd(vy_ptr, zmmB);
+ cc.evex().k(kA).vscatterdps(vx_ptr, xmmB);
+ cc.evex().k(kA).vscatterdps(vy_ptr, ymmB);
+ cc.evex().k(kA).vscatterdps(vz_ptr, zmmB);
+ cc.evex().k(kA).vscatterpf0dpd(vy_ptr);
+ cc.evex().k(kA).vscatterpf0dps(vz_ptr);
+ cc.evex().k(kA).vscatterpf0qpd(vz_ptr);
+ cc.evex().k(kA).vscatterpf0qps(vz_ptr);
+ cc.evex().k(kA).vscatterpf1dpd(vy_ptr);
+ cc.evex().k(kA).vscatterpf1dps(vz_ptr);
+ cc.evex().k(kA).vscatterpf1qpd(vz_ptr);
+ cc.evex().k(kA).vscatterpf1qps(vz_ptr);
+ cc.evex().k(kA).vscatterqpd(vx_ptr, xmmB);
+ cc.evex().k(kA).vscatterqpd(vy_ptr, ymmB);
+ cc.evex().k(kA).vscatterqpd(vz_ptr, zmmB);
+ cc.evex().k(kA).vscatterqps(vx_ptr, xmmB);
+ cc.evex().k(kA).vscatterqps(vy_ptr, xmmB);
+ cc.evex().k(kA).vscatterqps(vz_ptr, ymmB);
+ cc.evex().vshuff32x4(ymmA, ymmB, m, 0);
+ cc.evex().vshuff32x4(zmmA, zmmB, m, 0);
+ cc.evex().vshuff64x2(ymmA, ymmB, m, 0);
+ cc.evex().vshuff64x2(zmmA, zmmB, m, 0);
+ cc.evex().vshufi32x4(ymmA, ymmB, m, 0);
+ cc.evex().vshufi32x4(zmmA, zmmB, m, 0);
+ cc.evex().vshufi64x2(ymmA, ymmB, m, 0);
+ cc.evex().vshufi64x2(zmmA, zmmB, m, 0);
+ cc.evex().vshufpd(xmmA, xmmB, m, 0);
+ cc.evex().vshufpd(ymmA, ymmB, m, 0);
+ cc.evex().vshufpd(zmmA, zmmB, m, 0);
+ cc.evex().vshufps(xmmA, xmmB, m, 0);
+ cc.evex().vshufps(ymmA, ymmB, m, 0);
+ cc.evex().vshufps(zmmA, zmmB, m, 0);
+ cc.evex().vsqrtpd(xmmA, m);
+ cc.evex().vsqrtpd(ymmA, m);
+ cc.evex().vsqrtpd(zmmA, m);
+ cc.evex().vsqrtps(xmmA, m);
+ cc.evex().vsqrtps(ymmA, m);
+ cc.evex().vsqrtps(zmmA, m);
+ cc.evex().vsqrtsd(xmmA, xmmB, m);
+ cc.evex().vsqrtss(xmmA, xmmB, m);
+ cc.evex().vsubpd(xmmA, xmmB, m);
+ cc.evex().vsubpd(ymmA, ymmB, m);
+ cc.evex().vsubpd(zmmA, zmmB, m);
+ cc.evex().vsubps(xmmA, xmmB, m);
+ cc.evex().vsubps(ymmA, ymmB, m);
+ cc.evex().vsubps(zmmA, zmmB, m);
+ cc.evex().vsubsd(xmmA, xmmB, m);
+ cc.evex().vsubss(xmmA, xmmB, m);
+ cc.evex().vucomisd(xmmA, m);
+ cc.evex().vucomiss(xmmA, m);
+ cc.evex().vunpckhpd(xmmA, xmmB, m);
+ cc.evex().vunpckhpd(ymmA, ymmB, m);
+ cc.evex().vunpckhpd(zmmA, zmmB, m);
+ cc.evex().vunpckhps(xmmA, xmmB, m);
+ cc.evex().vunpckhps(ymmA, ymmB, m);
+ cc.evex().vunpckhps(zmmA, zmmB, m);
+ cc.evex().vunpcklpd(xmmA, xmmB, m);
+ cc.evex().vunpcklpd(ymmA, ymmB, m);
+ cc.evex().vunpcklpd(zmmA, zmmB, m);
+ cc.evex().vunpcklps(xmmA, xmmB, m);
+ cc.evex().vunpcklps(ymmA, ymmB, m);
+ cc.evex().vunpcklps(zmmA, zmmB, m);
+ cc.evex().vxorpd(xmmA, xmmB, m);
+ cc.evex().vxorpd(ymmA, ymmB, m);
+ cc.evex().vxorpd(zmmA, zmmB, m);
+ cc.evex().vxorps(xmmA, xmmB, m);
+ cc.evex().vxorps(ymmA, ymmB, m);
+ cc.evex().vxorps(zmmA, zmmB, m);
+}
+
+// Generates a long sequence of AVX512 instructions.
+template<typename Emitter>
+static void generateAvx512SequenceInternal(
+ Emitter& cc,
+ InstForm form,
+ const x86::Gp& gp,
+ const x86::KReg& kA, const x86::KReg& kB, const x86::KReg& kC,
+ const x86::Vec& vecA, const x86::Vec& vecB, const x86::Vec& vecC, const x86::Vec& vecD) {
+
+ if (form == InstForm::kReg)
+ generateAvx512SequenceInternalRegOnly(cc, gp, kA, kB, kC, vecA, vecB, vecC, vecD);
+ else
+ generateAvx512SequenceInternalRegMem(cc, gp, kA, kB, kC, vecA, vecB, vecC, vecD);
}
static void generateAvx512Sequence(BaseEmitter& emitter, InstForm form, bool emitPrologEpilog) {
@@ -4849,7 +4928,7 @@ static void generateAvx512Sequence(BaseEmitter& emitter, InstForm form, bool emi
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -4870,7 +4949,7 @@ static void generateAvx512Sequence(BaseEmitter& emitter, InstForm form, bool emi
if (emitPrologEpilog) {
FuncDetail func;
- func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
+ func.init(FuncSignature::build<void, void*, const void*, size_t>(), cc.environment());
FuncFrame frame;
frame.init(func);
@@ -4900,7 +4979,7 @@ static void generateAvx512Sequence(BaseEmitter& emitter, InstForm form, bool emi
KReg kB = cc.newKq("kB");
KReg kC = cc.newKq("kC");
- cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
+ cc.addFunc(FuncSignature::build<void>());
generateAvx512SequenceInternal(cc, form, gp, kA, kB, kC, vecA, vecB, vecC, vecD);
cc.endFunc();
}
@@ -4912,42 +4991,49 @@ static void benchmarkX86Function(Arch arch, uint32_t numIterations, const char*
CodeHolder code;
printf("%s:\n", description);
- bench<x86::Assembler>(code, arch, numIterations, "[raw]", [&](x86::Assembler& cc) {
+ uint32_t instCount = 0;
+
+#ifndef ASMJIT_NO_BUILDER
+ instCount = asmjit_perf_utils::calculateInstructionCount<x86::Builder>(code, arch, [&](x86::Builder& cc) {
emitterFn(cc, false);
});
+#endif
- bench<x86::Assembler>(code, arch, numIterations, "[validated]", [&](x86::Assembler& cc) {
- cc.addDiagnosticOptions(DiagnosticOptions::kValidateAssembler);
+ asmjit_perf_utils::bench<x86::Assembler>(code, arch, numIterations, "[raw]", instCount, [&](x86::Assembler& cc) {
emitterFn(cc, false);
});
- bench<x86::Assembler>(code, arch, numIterations, "[prolog/epilog]", [&](x86::Assembler& cc) {
+ asmjit_perf_utils::bench<x86::Assembler>(code, arch, numIterations, "[validated]", instCount, [&](x86::Assembler& cc) {
cc.addDiagnosticOptions(DiagnosticOptions::kValidateAssembler);
+ emitterFn(cc, false);
+ });
+
+ asmjit_perf_utils::bench<x86::Assembler>(code, arch, numIterations, "[prolog/epilog]", instCount, [&](x86::Assembler& cc) {
emitterFn(cc, true);
});
#ifndef ASMJIT_NO_BUILDER
- bench<x86::Builder>(code, arch, numIterations, "[no-asm]", [&](x86::Builder& cc) {
+ asmjit_perf_utils::bench<x86::Builder>(code, arch, numIterations, "[no-asm]", instCount, [&](x86::Builder& cc) {
emitterFn(cc, false);
});
- bench<x86::Builder>(code, arch, numIterations, "[finalized]", [&](x86::Builder& cc) {
+ asmjit_perf_utils::bench<x86::Builder>(code, arch, numIterations, "[finalized]", instCount, [&](x86::Builder& cc) {
emitterFn(cc, false);
cc.finalize();
});
- bench<x86::Builder>(code, arch, numIterations, "[prolog/epilog]", [&](x86::Builder& cc) {
+ asmjit_perf_utils::bench<x86::Builder>(code, arch, numIterations, "[prolog/epilog]", instCount, [&](x86::Builder& cc) {
emitterFn(cc, true);
cc.finalize();
});
#endif
#ifndef ASMJIT_NO_COMPILER
- bench<x86::Compiler>(code, arch, numIterations, "[no-asm]", [&](x86::Compiler& cc) {
+ asmjit_perf_utils::bench<x86::Compiler>(code, arch, numIterations, "[no-asm]", instCount, [&](x86::Compiler& cc) {
emitterFn(cc, true);
});
- bench<x86::Compiler>(code, arch, numIterations, "[finalized]", [&](x86::Compiler& cc) {
+ asmjit_perf_utils::bench<x86::Compiler>(code, arch, numIterations, "[finalized]", instCount, [&](x86::Compiler& cc) {
emitterFn(cc, true);
cc.finalize();
});
diff --git a/3rdparty/asmjit/test/asmjit_test_unit.cpp b/3rdparty/asmjit/test/asmjit_test_unit.cpp
index 5658ebc1d60..86d1f1a91fa 100644
--- a/3rdparty/asmjit/test/asmjit_test_unit.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_unit.cpp
@@ -109,7 +109,8 @@ static void dumpSizeOf(void) noexcept {
DUMP_TYPE(BaseBuilder);
DUMP_TYPE(BaseNode);
DUMP_TYPE(InstNode);
- DUMP_TYPE(InstExNode);
+ DUMP_TYPE(InstNodeWithOperands<InstNode::kBaseOpCapacity>);
+ DUMP_TYPE(InstNodeWithOperands<InstNode::kFullOpCapacity>);
DUMP_TYPE(AlignNode);
DUMP_TYPE(LabelNode);
DUMP_TYPE(EmbedDataNode);
diff --git a/3rdparty/asmjit/test/asmjit_test_x86_sections.cpp b/3rdparty/asmjit/test/asmjit_test_x86_sections.cpp
index 353b5e4fa1b..df763224d9b 100644
--- a/3rdparty/asmjit/test/asmjit_test_x86_sections.cpp
+++ b/3rdparty/asmjit/test/asmjit_test_x86_sections.cpp
@@ -17,7 +17,7 @@
// ----------------------------------------------------------------------------
#include <asmjit/core.h>
-#if !defined(ASMJIT_NO_X86) && ASMJIT_ARCH_X86
+#if ASMJIT_ARCH_X86 && !defined(ASMJIT_NO_X86) && !defined(ASMJIT_NO_JIT)
#include <asmjit/x86.h>
#include <stdio.h>
@@ -70,7 +70,7 @@ int main() {
Label data = a.newLabel();
FuncDetail func;
- func.init(FuncSignatureT<size_t, size_t>(CallConvId::kHost), code.environment());
+ func.init(FuncSignature::build<size_t, size_t>(), code.environment());
FuncFrame frame;
frame.init(func);
@@ -127,29 +127,26 @@ int main() {
}
// Allocate memory for the function and relocate it there.
- void* rxPtr;
- void* rwPtr;
- err = allocator.alloc(&rxPtr, &rwPtr, codeSize);
+ JitAllocator::Span span;
+ err = allocator.alloc(span, codeSize);
if (err)
fail("Failed to allocate executable memory", err);
// Relocate to the base-address of the allocated memory.
- code.relocateToBase(uint64_t(uintptr_t(rxPtr)));
+ code.relocateToBase(uint64_t(uintptr_t(span.rx())));
- VirtMem::protectJitMemory(VirtMem::ProtectJitAccess::kReadWrite);
-
- // Copy the flattened code into `mem.rw`. There are two ways. You can either copy
- // everything manually by iterating over all sections or use `copyFlattenedData`.
- // This code is similar to what `copyFlattenedData(p, codeSize, 0)` would do:
- for (Section* section : code.sectionsByOrder())
- memcpy(static_cast<uint8_t*>(rwPtr) + size_t(section->offset()), section->data(), section->bufferSize());
-
- VirtMem::protectJitMemory(VirtMem::ProtectJitAccess::kReadExecute);
- VirtMem::flushInstructionCache(rwPtr, code.codeSize());
+ allocator.write(span, [&](JitAllocator::Span& span) noexcept -> Error {
+ // Copy the flattened code into `mem.rw`. There are two ways. You can either copy
+ // everything manually by iterating over all sections or use `copyFlattenedData`.
+ // This code is similar to what `copyFlattenedData(p, codeSize, 0)` would do:
+ for (Section* section : code.sectionsByOrder())
+ memcpy(static_cast<uint8_t*>(span.rw()) + size_t(section->offset()), section->data(), section->bufferSize());
+ return kErrorOk;
+ });
// Execute the function and test whether it works.
typedef size_t (*Func)(size_t idx);
- Func fn = (Func)rxPtr;
+ Func fn = (Func)span.rx();
printf("\n");
if (fn(0) != dataArray[0] ||
@@ -166,7 +163,7 @@ int main() {
#else
int main() {
- printf("AsmJit X86 Sections Test is disabled on non-x86 host\n\n");
+ printf("AsmJit X86 Sections Test is disabled on non-x86 host or when compiled with ASMJIT_NO_JIT\n\n");
return 0;
}
-#endif // !ASMJIT_NO_X86 && ASMJIT_ARCH_X86
+#endif // ASMJIT_ARCH_X86 && !ASMJIT_NO_X86 && !ASMJIT_NO_JIT
diff --git a/3rdparty/asmjit/test/asmjitutils.h b/3rdparty/asmjit/test/asmjitutils.h
index d84d3d4c742..288801538af 100644
--- a/3rdparty/asmjit/test/asmjitutils.h
+++ b/3rdparty/asmjit/test/asmjitutils.h
@@ -8,7 +8,10 @@
#include <asmjit/core.h>
-static const char* asmjitArchAsString(asmjit::Arch arch) noexcept {
+namespace {
+
+ASMJIT_MAYBE_UNUSED
+static inline const char* asmjitArchAsString(asmjit::Arch arch) noexcept {
switch (arch) {
case asmjit::Arch::kX86 : return "X86";
case asmjit::Arch::kX64 : return "X64";
@@ -35,4 +38,23 @@ static const char* asmjitArchAsString(asmjit::Arch arch) noexcept {
}
}
+ASMJIT_MAYBE_UNUSED
+static inline void printIndented(const char* str, size_t indent) noexcept {
+ const char* start = str;
+ while (*str) {
+ if (*str == '\n') {
+ size_t size = (size_t)(str - start);
+ printf("%*s%.*s\n", size ? int(indent) : 0, "", int(size), start);
+ start = str + 1;
+ }
+ str++;
+ }
+
+ size_t size = (size_t)(str - start);
+ if (size)
+ printf("%*s%.*s\n", int(indent), "", int(size), start);
+}
+
+} // {anonymous}
+
#endif // ASMJITUTILS_H_INCLUDED
diff --git a/3rdparty/asmjit/test/broken.cpp b/3rdparty/asmjit/test/broken.cpp
index bb874fdc13b..c28ffa7288e 100644
--- a/3rdparty/asmjit/test/broken.cpp
+++ b/3rdparty/asmjit/test/broken.cpp
@@ -25,12 +25,11 @@
//
// For more information, please refer to <http://unlicense.org>
-#include "./broken.h"
+#include "broken.h"
#include <stdarg.h>
-// ============================================================================
-// [Broken - Global]
-// ============================================================================
+// Broken - Globals
+// ================
// Zero initialized globals.
struct BrokenGlobal {
@@ -56,9 +55,8 @@ struct BrokenGlobal {
};
static BrokenGlobal _brokenGlobal;
-// ============================================================================
-// [Broken - API]
-// ============================================================================
+// Broken - API
+// ============
// Get whether the string `a` starts with string `b`.
static bool BrokenAPI_startsWith(const char* a, const char* b) noexcept {
@@ -185,7 +183,7 @@ bool BrokenAPI::hasArg(const char* name) noexcept {
return _brokenGlobal.hasArg(name);
}
-void BrokenAPI::add(Unit* unit) noexcept {
+void BrokenAPI::addUnit(Unit* unit) noexcept {
Unit** pPrev = &_brokenGlobal._unitList;
Unit* current = *pPrev;
@@ -308,5 +306,5 @@ void BrokenAPI::fail(const char* file, int line, const char* expression, const c
fprintf(dst, " SOURCE: %s (Line: %d)\n", file, line);
fflush(dst);
- exit(1);
+ abort();
}
diff --git a/3rdparty/asmjit/test/broken.h b/3rdparty/asmjit/test/broken.h
index 701bc8b6e3c..74b901c3699 100644
--- a/3rdparty/asmjit/test/broken.h
+++ b/3rdparty/asmjit/test/broken.h
@@ -38,79 +38,125 @@
//! \cond
-// ============================================================================
-// [Broken - API]
-// ============================================================================
-
-struct BrokenAPI {
- //! Entry point of a unit test defined by `UNIT` macro.
- typedef void (*Entry)(void);
-
- enum Flags : unsigned {
- kFlagFinished = 0x1
- };
-
- //! Test defined by `UNIT` macro.
- struct Unit {
- Entry entry;
- const char* name;
- int priority;
- unsigned flags;
- Unit* next;
- };
-
- //! Automatic unit registration by using static initialization.
- struct AutoUnit : Unit {
- inline AutoUnit(Entry entry_, const char* name_, int priority_ = 0, int dummy_ = 0) noexcept {
- // Not used, only to trick `UNIT()` macro.
- (void)dummy_;
-
- this->entry = entry_;
- this->name = name_;
- this->priority = priority_;
- this->flags = 0;
- this->next = nullptr;
- BrokenAPI::add(this);
- }
- };
-
- static bool hasArg(const char* name) noexcept;
-
- //! Register a new unit test (called automatically by `AutoUnit` and `UNIT`).
- static void add(Unit* unit) noexcept;
-
- //! Set output file to a `file`.
- static void setOutputFile(FILE* file) noexcept;
-
- //! Initialize `Broken` framework.
- //!
- //! Returns `true` if `run()` should be called.
- static int run(int argc, const char* argv[], Entry onBeforeRun = nullptr, Entry onAfterRun = nullptr);
-
- //! Log message, adds automatically new line if not present.
- static void info(const char* fmt, ...) noexcept;
-
- //! Called on `EXPECT()` failure.
- static void fail(const char* file, int line, const char* expression, const char* fmt, ...) noexcept;
-
- //! Used internally by `EXPECT` macro.
- template<typename T>
- static inline void expect(const char* file, int line, const char* expression, const T& result) noexcept {
- if (!result)
- fail(file, line, expression, nullptr);
+// Broken - API
+// ============
+
+namespace BrokenAPI {
+
+//! Entry point of a unit test defined by `UNIT` macro.
+typedef void (*Entry)(void);
+
+enum Flags : unsigned {
+ kFlagFinished = 0x1
+};
+
+struct Unit;
+
+bool hasArg(const char* name) noexcept;
+
+//! Register a new unit test (called automatically by `AutoUnit` and `UNIT`).
+void addUnit(Unit* unit) noexcept;
+
+//! Set output file to a `file`.
+void setOutputFile(FILE* file) noexcept;
+
+//! Initialize `Broken` framework.
+//!
+//! Returns `true` if `run()` should be called.
+int run(int argc, const char* argv[], Entry onBeforeRun = nullptr, Entry onAfterRun = nullptr);
+
+//! Log message, adds automatically new line if not present.
+void info(const char* fmt, ...) noexcept;
+
+//! Called on `EXPECT()` failure.
+void fail(const char* file, int line, const char* expression, const char* fmt, ...) noexcept;
+
+//! Test defined by `UNIT` macro.
+struct Unit {
+ Entry entry;
+ const char* name;
+ int priority;
+ unsigned flags;
+ Unit* next;
+};
+
+//! Automatic unit registration by using static initialization.
+class AutoUnit : public Unit {
+public:
+ inline AutoUnit(Entry entry_, const char* name_, int priority_ = 0, int dummy_ = 0) noexcept {
+ // Not used, only to trick `UNIT()` macro.
+ (void)dummy_;
+
+ this->entry = entry_;
+ this->name = name_;
+ this->priority = priority_;
+ this->flags = 0;
+ this->next = nullptr;
+ addUnit(this);
+ }
+};
+
+class Failure {
+public:
+ const char* _file = nullptr;
+ const char* _expression = nullptr;
+ int _line = 0;
+ bool _handled = false;
+
+ inline Failure(const char* file, int line, const char* expression) noexcept
+ : _file(file),
+ _expression(expression),
+ _line(line) {}
+
+ inline ~Failure() noexcept {
+ if (!_handled)
+ fail(_file, _line, _expression, nullptr);
}
- //! Used internally by `EXPECT` macro.
- template<typename T, typename... Args>
- static inline void expect(const char* file, int line, const char* expression, const T& result, const char* fmt, Args&&... args) noexcept {
- if (!result)
- fail(file, line, expression, fmt, std::forward<Args>(args)...);
+ template<typename... Args>
+ inline void message(const char* fmt, Args&&... args) noexcept {
+ fail(_file, _line, _expression, fmt, std::forward<Args>(args)...);
+ _handled = true;
}
};
-// ============================================================================
-// [Broken - Macros]
-// ============================================================================
+template<typename Result>
+static inline bool check(Result&& result) noexcept { return !!result; }
+
+template<typename LHS, typename RHS>
+static inline bool checkEq(LHS&& lhs, RHS&& rhs) noexcept { return lhs == rhs; }
+
+template<typename LHS, typename RHS>
+static inline bool checkNe(LHS&& lhs, RHS&& rhs) noexcept { return lhs != rhs; }
+
+template<typename LHS, typename RHS>
+static inline bool checkGt(LHS&& lhs, RHS&& rhs) noexcept { return lhs > rhs; }
+
+template<typename LHS, typename RHS>
+static inline bool checkGe(LHS&& lhs, RHS&& rhs) noexcept { return lhs >= rhs; }
+
+template<typename LHS, typename RHS>
+static inline bool checkLt(LHS&& lhs, RHS&& rhs) noexcept { return lhs < rhs; }
+
+template<typename LHS, typename RHS>
+static inline bool checkLe(LHS&& lhs, RHS&& rhs) noexcept { return lhs <= rhs; }
+
+template<typename Result>
+static inline bool checkTrue(Result&& result) noexcept { return !!result; }
+
+template<typename Result>
+static inline bool checkFalse(Result&& result) noexcept { return !result; }
+
+template<typename Result>
+static inline bool checkNull(Result&& result) noexcept { return result == nullptr; }
+
+template<typename Result>
+static inline bool checkNotNull(Result&& result) noexcept { return result != nullptr; }
+
+} // {BrokenAPI}
+
+// Broken - Macros
+// ===============
//! Internal macro used by `UNIT()`.
#define BROKEN_UNIT_INTERNAL(NAME, PRIORITY) \
@@ -118,19 +164,14 @@ struct BrokenAPI {
static ::BrokenAPI::AutoUnit unit_##NAME##_autoinit(unit_##NAME##_entry, #NAME, PRIORITY); \
static void unit_##NAME##_entry(void)
-//! Stringifies the expression used by EXPECT().
-#define BROKEN_STRINFIGY_EXPRESSION_INTERNAL(EXP, ...) #EXP
-
//! \def UNIT(NAME [, PRIORITY])
//!
//! Define a unit test with an optional priority.
//!
-//! `NAME` can only contain ASCII characters, numbers and underscore. It has
-//! the same rules as identifiers in C and C++.
+//! `NAME` can only contain ASCII characters, numbers and underscore. It has the same rules as identifiers in C and C++.
//!
-//! `PRIORITY` specifies the order in which unit tests are run. Lesses value
-//! increases the priority. At the moment all units are first sorted by
-//! priority and then by name - this makes the run always deterministic.
+//! `PRIORITY` specifies the order in which unit tests are run. Lesses value increases the priority. At the moment all
+//!units are first sorted by priority and then by name - this makes the run always deterministic.
#define UNIT(NAME, ...) BROKEN_UNIT_INTERNAL(NAME, __VA_ARGS__ + 0)
//! #define INFO(FORMAT [, ...])
@@ -138,10 +179,21 @@ struct BrokenAPI {
//! Informative message printed to `stdout`.
#define INFO(...) ::BrokenAPI::info(__VA_ARGS__)
-//! #define INFO(EXP [, FORMAT [, ...]])
-//!
-//! Expect `EXP` to be true or evaluates to true, fail otherwise.
-#define EXPECT(...) ::BrokenAPI::expect(__FILE__, __LINE__, BROKEN_STRINFIGY_EXPRESSION_INTERNAL(__VA_ARGS__), __VA_ARGS__)
+#define BROKEN_EXPECT_INTERNAL(file, line, expression, result) \
+ for (bool _testInternalResult = (result); !_testInternalResult; _testInternalResult = true) \
+ ::BrokenAPI::Failure(file, line, expression)
+
+#define EXPECT(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT(" #__VA_ARGS__ ")", !!(__VA_ARGS__))
+#define EXPECT_EQ(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_EQ(" #__VA_ARGS__ ")", ::BrokenAPI::checkEq(__VA_ARGS__))
+#define EXPECT_NE(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_NE(" #__VA_ARGS__ ")", ::BrokenAPI::checkNe(__VA_ARGS__))
+#define EXPECT_GT(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_GT(" #__VA_ARGS__ ")", ::BrokenAPI::checkGt(__VA_ARGS__))
+#define EXPECT_GE(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_GE(" #__VA_ARGS__ ")", ::BrokenAPI::checkGe(__VA_ARGS__))
+#define EXPECT_LT(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_LT(" #__VA_ARGS__ ")", ::BrokenAPI::checkLt(__VA_ARGS__))
+#define EXPECT_LE(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_LE(" #__VA_ARGS__ ")", ::BrokenAPI::checkLe(__VA_ARGS__))
+#define EXPECT_TRUE(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_TRUE(" #__VA_ARGS__ ")", ::BrokenAPI::checkTrue(__VA_ARGS__))
+#define EXPECT_FALSE(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_FALSE(" #__VA_ARGS__ ")", ::BrokenAPI::checkFalse(__VA_ARGS__))
+#define EXPECT_NULL(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_NULL(" #__VA_ARGS__ ")", ::BrokenAPI::checkNull(__VA_ARGS__))
+#define EXPECT_NOT_NULL(...) BROKEN_EXPECT_INTERNAL(__FILE__, __LINE__, "EXPECT_NOT_NULL(" #__VA_ARGS__ ")", ::BrokenAPI::checkNotNull(__VA_ARGS__))
//! \endcond
diff --git a/3rdparty/asmjit/test/performancetimer.h b/3rdparty/asmjit/test/performancetimer.h
index baa0479fc34..c7a8ebe5d18 100644
--- a/3rdparty/asmjit/test/performancetimer.h
+++ b/3rdparty/asmjit/test/performancetimer.h
@@ -30,12 +30,4 @@ public:
}
};
-static inline double mbps(double duration, uint64_t outputSize) noexcept {
- if (duration == 0)
- return 0.0;
-
- double bytesTotal = double(outputSize);
- return (bytesTotal * 1000) / (duration * 1024 * 1024);
-}
-
#endif // PERFORMANCETIMER_H_INCLUDED
diff --git a/3rdparty/asmjit/tools/configure-makefiles.sh b/3rdparty/asmjit/tools/configure-makefiles.sh
index 69503dc28ef..69503dc28ef 100644..100755
--- a/3rdparty/asmjit/tools/configure-makefiles.sh
+++ b/3rdparty/asmjit/tools/configure-makefiles.sh
diff --git a/3rdparty/asmjit/tools/configure-ninja.sh b/3rdparty/asmjit/tools/configure-ninja.sh
index 84808d24363..84808d24363 100644..100755
--- a/3rdparty/asmjit/tools/configure-ninja.sh
+++ b/3rdparty/asmjit/tools/configure-ninja.sh
diff --git a/3rdparty/asmjit/tools/configure-sanitizers.sh b/3rdparty/asmjit/tools/configure-sanitizers.sh
index a9f64969b70..d35b9a4cad3 100644..100755
--- a/3rdparty/asmjit/tools/configure-sanitizers.sh
+++ b/3rdparty/asmjit/tools/configure-sanitizers.sh
@@ -11,3 +11,7 @@ echo ""
echo "== [Configuring Build - Release_UBSAN] =="
eval cmake "${CURRENT_DIR}/.." -B "${BUILD_DIR}/Release_UBSAN" ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release -DASMJIT_SANITIZE=undefined
echo ""
+
+echo "== [Configuring Build - Release_MSAN] =="
+eval cmake "${CURRENT_DIR}/.." -B "${BUILD_DIR}/Release_MSAN" ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release -DASMJIT_SANITIZE=memory
+echo ""
diff --git a/3rdparty/asmjit/tools/configure-xcode.sh b/3rdparty/asmjit/tools/configure-xcode.sh
index d9c7d983d75..d9c7d983d75 100644..100755
--- a/3rdparty/asmjit/tools/configure-xcode.sh
+++ b/3rdparty/asmjit/tools/configure-xcode.sh
diff --git a/3rdparty/asmjit/tools/enumgen.sh b/3rdparty/asmjit/tools/enumgen.sh
index 4783db2449d..4783db2449d 100644..100755
--- a/3rdparty/asmjit/tools/enumgen.sh
+++ b/3rdparty/asmjit/tools/enumgen.sh
diff --git a/3rdparty/asmjit/tools/generator-commons.js b/3rdparty/asmjit/tools/generator-commons.js
new file mode 100644
index 00000000000..eb3a0721ccc
--- /dev/null
+++ b/3rdparty/asmjit/tools/generator-commons.js
@@ -0,0 +1,592 @@
+// This file is part of AsmJit project <https://asmjit.com>
+//
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
+
+const hasOwn = Object.prototype.hasOwnProperty;
+function nop(x) { return x; }
+
+// Generator - Constants
+// ---------------------
+
+const kIndent = " ";
+exports.kIndent = kIndent;
+
+const kLineWidth = 120;
+
+// Generator - Logging
+// -------------------
+
+let VERBOSE = false;
+
+function setDebugVerbosity(value) {
+ VERBOSE = value;
+}
+exports.setDebugVerbosity = setDebugVerbosity;
+
+function DEBUG(msg) {
+ if (VERBOSE)
+ console.log(msg);
+}
+exports.DEBUG = DEBUG;
+
+function WARN(msg) {
+ console.log(msg);
+}
+exports.WARN = WARN;
+
+function FATAL(msg) {
+ console.log(`FATAL: ${msg}`);
+ throw new Error(msg);
+}
+exports.FATAL = FATAL;
+
+// Generator - Object Utilities
+// ----------------------------
+
+class ObjectUtils {
+ static clone(map) {
+ return Object.assign(Object.create(null), map);
+ }
+
+ static merge(a, b) {
+ if (a === b)
+ return a;
+
+ for (let k in b) {
+ let av = a[k];
+ let bv = b[k];
+
+ if (typeof av === "object" && typeof bv === "object")
+ ObjectUtils.merge(av, bv);
+ else
+ a[k] = bv;
+ }
+
+ return a;
+ }
+
+ static equals(a, b) {
+ if (a === b)
+ return true;
+
+ if (typeof a !== typeof b)
+ return false;
+
+ if (typeof a !== "object")
+ return a === b;
+
+ if (Array.isArray(a) || Array.isArray(b)) {
+ if (Array.isArray(a) !== Array.isArray(b))
+ return false;
+
+ const len = a.length;
+ if (b.length !== len)
+ return false;
+
+ for (let i = 0; i < len; i++)
+ if (!ObjectUtils.equals(a[i], b[i]))
+ return false;
+ }
+ else {
+ if (a === null || b === null)
+ return a === b;
+
+ for (let k in a)
+ if (!hasOwn.call(b, k) || !ObjectUtils.equals(a[k], b[k]))
+ return false;
+
+ for (let k in b)
+ if (!hasOwn.call(a, k))
+ return false;
+ }
+
+ return true;
+ }
+
+ static equalsExcept(a, b, except) {
+ if (a === b)
+ return true;
+
+ if (typeof a !== "object" || typeof b !== "object" || Array.isArray(a) || Array.isArray(b))
+ return ObjectUtils.equals(a, b);
+
+ for (let k in a)
+ if (!hasOwn.call(except, k) && (!hasOwn.call(b, k) || !ObjectUtils.equals(a[k], b[k])))
+ return false;
+
+ for (let k in b)
+ if (!hasOwn.call(except, k) && !hasOwn.call(a, k))
+ return false;
+
+ return true;
+ }
+
+ static findKey(map, keys) {
+ for (let key in keys)
+ if (hasOwn.call(map, key))
+ return key;
+ return undefined;
+ }
+
+ static hasAny(map, keys) {
+ for (let key in keys)
+ if (hasOwn.call(map, key))
+ return true;
+ return false;
+ }
+
+ static and(a, b) {
+ const out = Object.create(null);
+ for (let k in a)
+ if (hasOwn.call(b, k))
+ out[k] = true;
+ return out;
+ }
+
+ static xor(a, b) {
+ const out = Object.create(null);
+ for (let k in a) if (!hasOwn.call(b, k)) out[k] = true;
+ for (let k in b) if (!hasOwn.call(a, k)) out[k] = true;
+ return out;
+ }
+}
+exports.ObjectUtils = ObjectUtils;
+
+// Generator - Array Utilities
+// ---------------------------
+
+class ArrayUtils {
+ static min(arr, fn) {
+ if (!arr.length)
+ return null;
+
+ if (!fn)
+ fn = nop;
+
+ let v = fn(arr[0]);
+ for (let i = 1; i < arr.length; i++)
+ v = Math.min(v, fn(arr[i]));
+ return v;
+ }
+
+ static max(arr, fn) {
+ if (!arr.length)
+ return null;
+
+ if (!fn)
+ fn = nop;
+
+ let v = fn(arr[0]);
+ for (let i = 1; i < arr.length; i++)
+ v = Math.max(v, fn(arr[i]));
+ return v;
+ }
+
+ static sorted(obj, cmp) {
+ const out = Array.isArray(obj) ? obj.slice() : Object.getOwnPropertyNames(obj);
+ out.sort(cmp);
+ return out;
+ }
+
+ static deepIndexOf(arr, what) {
+ for (let i = 0; i < arr.length; i++)
+ if (ObjectUtils.equals(arr[i], what))
+ return i;
+ return -1;
+ }
+
+ static toDict(arr, value) {
+ if (value === undefined)
+ value = true;
+
+ const out = Object.create(null);
+ for (let i = 0; i < arr.length; i++)
+ out[arr[i]] = value;
+ return out;
+ }
+}
+exports.ArrayUtils = ArrayUtils;
+
+
+// Generator - String Utilities
+// ----------------------------
+
+class StringUtils {
+ static asString(x) { return String(x); }
+
+ static countOf(s, pattern) {
+ if (!pattern)
+ FATAL(`Pattern cannot be empty`);
+
+ let n = 0;
+ let pos = 0;
+
+ while ((pos = s.indexOf(pattern, pos)) >= 0) {
+ n++;
+ pos += pattern.length;
+ }
+
+ return n;
+ }
+
+ static trimLeft(s) { return s.replace(/^\s+/, ""); }
+ static trimRight(s) { return s.replace(/\s+$/, ""); }
+
+ static upFirst(s) {
+ if (!s) return "";
+ return s[0].toUpperCase() + s.substr(1);
+ }
+
+ static decToHex(n, nPad) {
+ let hex = Number(n < 0 ? 0x100000000 + n : n).toString(16);
+ while (nPad > hex.length)
+ hex = "0" + hex;
+ return "0x" + hex.toUpperCase();
+ }
+
+ static format(array, indent, showIndex, mapFn) {
+ if (!mapFn)
+ mapFn = StringUtils.asString;
+
+ let s = "";
+ let threshold = 80;
+
+ if (showIndex === -1)
+ s += indent;
+
+ for (let i = 0; i < array.length; i++) {
+ const item = array[i];
+ const last = i === array.length - 1;
+
+ if (showIndex !== -1)
+ s += indent;
+
+ s += mapFn(item);
+ if (showIndex > 0) {
+ s += `${last ? " " : ","} // #${i}`;
+ if (typeof array.refCountOf === "function")
+ s += ` [ref=${array.refCountOf(item)}x]`;
+ }
+ else if (!last) {
+ s += ",";
+ }
+
+ if (showIndex === -1) {
+ if (s.length >= threshold - 1 && !last) {
+ s += "\n" + indent;
+ threshold += 80;
+ }
+ else {
+ if (!last) s += " ";
+ }
+ }
+ else {
+ if (!last) s += "\n";
+ }
+ }
+
+ return s;
+ }
+
+ static makeCxxArray(array, code, indent) {
+ if (typeof indent !== "string")
+ indent = kIndent;
+
+ return `${code} = {\n${indent}` + array.join(`,\n${indent}`) + `\n};\n`;
+ }
+
+ static makeCxxArrayWithComment(array, code, indent) {
+ if (typeof indent !== "string")
+ indent = kIndent;
+
+ let s = "";
+ for (let i = 0; i < array.length; i++) {
+ const last = i === array.length - 1;
+ s += indent + array[i].data +
+ (last ? " // " : ", // ") + (array[i].refs ? "#" + String(i) : "").padEnd(5) + array[i].comment + "\n";
+ }
+ return `${code} = {\n${s}};\n`;
+ }
+
+ static formatCppStruct(...args) {
+ return "{ " + args.join(", ") + " }";
+ }
+
+ static formatCppFlags(obj, fn, none) {
+ if (none == null)
+ none = "0";
+
+ if (!fn)
+ fn = nop;
+
+ let out = "";
+ for (let k in obj) {
+ if (obj[k])
+ out += (out ? " | " : "") + fn(k);
+ }
+ return out ? out : none;
+ }
+
+ static formatRecords(array, indent, fn) {
+ if (typeof indent !== "string")
+ indent = kIndent;
+
+ if (!fn)
+ fn = nop;
+
+ let s = "";
+ let line = "";
+ for (let i = 0; i < array.length; i++) {
+ const item = fn(array[i]);
+ const combined = line ? line + ", " + item : item;
+
+ if (combined.length >= kLineWidth) {
+ s = s ? s + ",\n" + line : line;
+ line = item;
+ }
+ else {
+ line = combined;
+ }
+ }
+
+ if (line) {
+ s = s ? s + ",\n" + line : line;
+ }
+
+ return StringUtils.indent(s, indent);
+ }
+
+ static disclaimer(s) {
+ return "// ------------------- Automatically generated, do not edit -------------------\n" +
+ s +
+ "// ----------------------------------------------------------------------------\n";
+ }
+
+ static indent(s, indentation) {
+ if (typeof indentation === "number")
+ indentation = " ".repeat(indentation);
+
+ let lines = s.split(/\r?\n/g);
+ if (indentation) {
+ for (let i = 0; i < lines.length; i++) {
+ let line = lines[i];
+ if (line)
+ lines[i] = indentation + line;
+ }
+ }
+
+ return lines.join("\n");
+ }
+
+ static extract(s, start, end) {
+ const iStart = s.indexOf(start);
+ const iEnd = s.indexOf(end);
+
+ if (iStart === -1)
+ FATAL(`StringUtils.extract(): Couldn't locate start mark '${start}'`);
+
+ if (iEnd === -1)
+ FATAL(`StringUtils.extract(): Couldn't locate end mark '${end}'`);
+
+ return s.substring(iStart + start.length, iEnd).trim();
+ }
+
+ static inject(s, start, end, code) {
+ let iStart = s.indexOf(start);
+ let iEnd = s.indexOf(end);
+
+ if (iStart === -1)
+ FATAL(`StringUtils.inject(): Couldn't locate start mark '${start}'`);
+
+ if (iEnd === -1)
+ FATAL(`StringUtils.inject(): Couldn't locate end mark '${end}'`);
+
+ let nIndent = 0;
+ while (iStart > 0 && s[iStart-1] === " ") {
+ iStart--;
+ nIndent++;
+ }
+
+ if (nIndent) {
+ const indentation = " ".repeat(nIndent);
+ code = StringUtils.indent(code, indentation) + indentation;
+ }
+
+ return s.substr(0, iStart + start.length + nIndent) + code + s.substr(iEnd);
+ }
+
+ static makePriorityCompare(priorityArray) {
+ const map = Object.create(null);
+ priorityArray.forEach((str, index) => { map[str] = index; });
+
+ return function(a, b) {
+ const ax = hasOwn.call(map, a) ? map[a] : Infinity;
+ const bx = hasOwn.call(map, b) ? map[b] : Infinity;
+ return ax != bx ? ax - bx : a < b ? -1 : a > b ? 1 : 0;
+ }
+ }
+}
+exports.StringUtils = StringUtils;
+
+// Generator - Indexed Array
+// =========================
+
+// IndexedArray is an Array replacement that allows to index each item inserted to it. Its main purpose
+// is to avoid data duplication, if an item passed to `addIndexed()` is already within the Array then
+// it's not inserted and the existing index is returned instead.
+function IndexedArray_keyOf(item) {
+ return typeof item === "string" ? item : JSON.stringify(item);
+}
+
+class IndexedArray extends Array {
+ constructor() {
+ super();
+ this._index = Object.create(null);
+ }
+
+ refCountOf(item) {
+ const key = IndexedArray_keyOf(item);
+ const idx = this._index[key];
+
+ return idx !== undefined ? idx.refCount : 0;
+ }
+
+ addIndexed(item) {
+ const key = IndexedArray_keyOf(item);
+ let idx = this._index[key];
+
+ if (idx !== undefined) {
+ idx.refCount++;
+ return idx.data;
+ }
+
+ idx = this.length;
+ this._index[key] = {
+ data: idx,
+ refCount: 1
+ };
+ this.push(item);
+ return idx;
+ }
+}
+exports.IndexedArray = IndexedArray;
+
+// Generator - Indexed String
+// ==========================
+
+// IndexedString is mostly used to merge all instruction names into a single string with external
+// index. It's designed mostly for generating C++ tables. Consider the following cases in C++:
+//
+// a) static const char* const* instNames = { "add", "mov", "vpunpcklbw" };
+//
+// b) static const char instNames[] = { "add\0" "mov\0" "vpunpcklbw\0" };
+// static const uint16_t instNameIndex[] = { 0, 4, 8 };
+//
+// The latter (b) has an advantage that it doesn't have to be relocated by the linker, which saves
+// a lot of space in the resulting binary and a lot of CPU cycles (and memory) when the linker loads
+// it. AsmJit supports thousands of instructions so each optimization like this makes it smaller and
+// faster to load.
+class IndexedString {
+ constructor() {
+ this.map = Object.create(null);
+ this.array = [];
+ this.size = -1;
+ }
+
+ add(s) {
+ this.map[s] = -1;
+ }
+
+ index() {
+ const map = this.map;
+ const array = this.array;
+ const partialMap = Object.create(null);
+
+ let k, kp;
+ let i, len;
+
+ // Create a map that will contain all keys and partial keys.
+ for (k in map) {
+ if (!k) {
+ partialMap[k] = k;
+ }
+ else {
+ for (i = 0, len = k.length; i < len; i++) {
+ kp = k.substr(i);
+ if (!hasOwn.call(partialMap, kp) || partialMap[kp].length < len)
+ partialMap[kp] = k;
+ }
+ }
+ }
+
+ // Create an array that will only contain keys that are needed.
+ for (k in map)
+ if (partialMap[k] === k)
+ array.push(k);
+ array.sort();
+
+ // Create valid offsets to the `array`.
+ let offMap = Object.create(null);
+ let offset = 0;
+
+ for (i = 0, len = array.length; i < len; i++) {
+ k = array[i];
+
+ offMap[k] = offset;
+ offset += k.length + 1;
+ }
+ this.size = offset;
+
+ // Assign valid offsets to `map`.
+ for (kp in map) {
+ k = partialMap[kp];
+ map[kp] = offMap[k] + k.length - kp.length;
+ }
+ }
+
+ format(indent, justify) {
+ if (this.size === -1)
+ FATAL(`IndexedString.format(): not indexed yet, call index()`);
+
+ const array = this.array;
+ if (!justify) justify = 0;
+
+ let i;
+ let s = "";
+ let line = "";
+
+ for (i = 0; i < array.length; i++) {
+ const item = "\"" + array[i] + ((i !== array.length - 1) ? "\\0\"" : "\";");
+ const newl = line + (line ? " " : indent) + item;
+
+ if (newl.length <= justify) {
+ line = newl;
+ continue;
+ }
+ else {
+ s += line + "\n";
+ line = indent + item;
+ }
+ }
+
+ return s + line;
+ }
+
+ getSize() {
+ if (this.size === -1)
+ FATAL(`IndexedString.getSize(): Not indexed yet, call index()`);
+ return this.size;
+ }
+
+ getIndex(k) {
+ if (this.size === -1)
+ FATAL(`IndexedString.getIndex(): Not indexed yet, call index()`);
+
+ if (!hasOwn.call(this.map, k))
+ FATAL(`IndexedString.getIndex(): Key '${k}' not found.`);
+
+ return this.map[k];
+ }
+}
+exports.IndexedString = IndexedString;
diff --git a/3rdparty/asmjit/tools/generator-cxx.js b/3rdparty/asmjit/tools/generator-cxx.js
new file mode 100644
index 00000000000..b1b1d946cae
--- /dev/null
+++ b/3rdparty/asmjit/tools/generator-cxx.js
@@ -0,0 +1,270 @@
+// This file is part of AsmJit project <https://asmjit.com>
+//
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
+
+// C++ code generation helpers.
+const commons = require("./generator-commons.js");
+const FATAL = commons.FATAL;
+
+// Utilities to convert primitives to C++ code.
+class Utils {
+ static toHex(val, pad) {
+ if (val < 0)
+ val = 0xFFFFFFFF + val + 1;
+
+ let s = val.toString(16);
+ if (pad != null && s.length < pad)
+ s = "0".repeat(pad - s.length) + s;
+
+ return "0x" + s.toUpperCase();
+ }
+
+ static capitalize(s) {
+ s = String(s);
+ return !s ? s : s[0].toUpperCase() + s.substr(1);
+ }
+
+ static camelCase(s) {
+ if (s == null || s === "")
+ return s;
+
+ s = String(s);
+ if (/^[A-Z]+$/.test(s))
+ return s.toLowerCase();
+ else
+ return s[0].toLowerCase() + s.substr(1);
+ }
+
+ static normalizeSymbolName(s) {
+ switch (s) {
+ case "and":
+ case "or":
+ case "xor":
+ return s + "_";
+ default:
+ return s;
+ }
+ }
+
+ static indent(s, indentation) {
+ if (typeof indentation === "number")
+ indentation = " ".repeat(indentation);
+
+ var lines = s.split(/\r?\n/g);
+ if (indentation) {
+ for (var i = 0; i < lines.length; i++) {
+ var line = lines[i];
+ if (line)
+ lines[i] = indentation + line;
+ }
+ }
+
+ return lines.join("\n");
+ }
+}
+exports.Utils = Utils;
+
+// A node that represents a C++ construct.
+class Node {
+ constructor(kind) {
+ this.kind = kind;
+ }
+};
+exports.Node = Node;
+
+// A single line of C++ code that declares a variable with optional initialization.
+class Var extends Node {
+ constructor(type, name, init) {
+ super("var");
+
+ this.type = type;
+ this.name = name;
+ this.init = init || "";
+ }
+
+ toString() {
+ let s = this.type + " " + this.name;
+ if (this.init)
+ s += " = " + this.init;
+ return s + ";\n";
+ }
+};
+exports.Var = Var;
+
+// A single line of C++ code, which should not contain any branch or a variable declaration.
+class Line extends Node {
+ constructor(code) {
+ super("line");
+
+ this.code = code;
+ }
+
+ toString() {
+ return String(this.code) + "\n";
+ }
+};
+exports.Line = Line;
+
+// A block containing an array of `Node` items (may contain nested blocks, etc...).
+class Block extends Node {
+ constructor(nodes) {
+ super("block");
+
+ this.nodes = nodes || [];
+ }
+
+ isEmpty() {
+ return this.nodes.length === 0;
+ }
+
+ appendNode(node) {
+ if (!(node instanceof Node))
+ FATAL("Block.appendNode(): Node must be an instance of Node");
+
+ this.nodes.push(node);
+ return this;
+ }
+
+ prependNode(node) {
+ if (!(node instanceof Node))
+ FATAL("Block.prependNode(): Node must be an instance of Node");
+
+ this.nodes.unshift(node);
+ return this;
+ }
+
+ insertNode(index, node) {
+ if (!(node instanceof Node))
+ FATAL("Block.insertNode(): Node must be an instance of Node");
+
+ if (index >= this.nodes.length)
+ this.nodes.push(node);
+ else
+ this.nodes.splice(index, 0, node);
+
+ return this;
+ }
+
+ addVarDecl(type, name, init) {
+ let node = type;
+
+ if (!(node instanceof Var))
+ node = new Var(type, name, init);
+
+ let i = 0;
+ while (i < this.nodes.length) {
+ const n = this.nodes[i];
+ if (n.kind === "var" && n.name === node.name && n.init === node.init)
+ return this;
+
+ if (n.kind !== "var")
+ break;
+
+ i++;
+ }
+
+ this.insertNode(i, node);
+ return this;
+ }
+
+ addLine(code) {
+ if (typeof code !== "string")
+ FATAL("Block.addLine(): Line must be string");
+
+ this.nodes.push(new Line(code));
+ return this;
+ }
+
+ prependEmptyLine() {
+ if (!this.isEmpty())
+ this.nodes.splice(0, 0, new Line(""));
+ return this;
+ }
+
+ addEmptyLine() {
+ if (!this.isEmpty())
+ this.nodes.push(new Line(""));
+ return this;
+ }
+
+ toString() {
+ let s = "";
+ for (let node of this.nodes)
+ s += String(node);
+ return s;
+ }
+}
+exports.Block = Block;
+
+// A C++ 'condition' (if statement) and its 'body' if it's taken.
+class If extends Node {
+ constructor(cond, body) {
+ super("if");
+
+ if (body == null)
+ body = new Block();
+
+ if (!(body instanceof Block))
+ FATAL("If() - body must be a Block");
+
+ this.cond = cond;
+ this.body = body;
+ }
+
+ toString() {
+ const cond = String(this.cond);
+ const body = String(this.body);
+
+ return `if (${cond}) {\n` + Utils.indent(body, 2) + `}\n`;
+ }
+}
+exports.If = If;
+
+//! A C++ switch statement.
+class Case extends Node {
+ constructor(cond, body) {
+ super("case");
+
+ this.cond = cond;
+ this.body = body || new Block();
+ }
+
+ toString() {
+ let s = "";
+ for (let node of this.body.nodes)
+ s += String(node)
+
+ if (this.cond !== "default")
+ return `case ${this.cond}: {\n` + Utils.indent(s, 2) + `}\n`;
+ else
+ return `default: {\n` + Utils.indent(s, 2) + `}\n`;
+ }
+};
+exports.Case = Case;
+
+class Switch extends Node {
+ constructor(expression, cases) {
+ super("switch");
+
+ this.expression = expression;
+ this.cases = cases || [];
+ }
+
+ addCase(cond, body) {
+ this.cases.push(new Case(cond, body));
+ return this;
+ }
+
+ toString() {
+ let s = "";
+ for (let c of this.cases) {
+ if (s)
+ s += "\n";
+ s += String(c);
+ }
+
+ return `switch (${this.expression}) {\n` + Utils.indent(s, 2) + `}\n`;
+ }
+}
+exports.Switch = Switch;
diff --git a/3rdparty/asmjit/tools/tablegen-arm.js b/3rdparty/asmjit/tools/tablegen-a64.js
index e1c829358e2..1466fc63b01 100644
--- a/3rdparty/asmjit/tools/tablegen-arm.js
+++ b/3rdparty/asmjit/tools/tablegen-a64.js
@@ -1,37 +1,29 @@
-// [AsmJit]
-// Machine Code Generation for C++.
+// This file is part of AsmJit project <https://asmjit.com>
//
-// [License]
-// ZLIB - See LICENSE.md file in the package.
-
-// ============================================================================
-// tablegen-arm.js
-// ============================================================================
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
"use strict";
-const { executionAsyncResource } = require("async_hooks");
const core = require("./tablegen.js");
+const commons = require("./generator-commons.js");
const hasOwn = Object.prototype.hasOwnProperty;
const asmdb = core.asmdb;
-const kIndent = core.kIndent;
-const IndexedArray = core.IndexedArray;
-const StringUtils = core.StringUtils;
+const kIndent = commons.kIndent;
+const IndexedArray = commons.IndexedArray;
+const StringUtils = commons.StringUtils;
-const FAIL = core.FAIL;
+const FATAL = commons.FATAL;
// ============================================================================
// [ArmDB]
// ============================================================================
-// Create ARM ISA.
-const isa = new asmdb.arm.ISA();
-
-// ============================================================================
-// [tablegen.arm.GenUtils]
-// ============================================================================
+// Create AArch64 ISA.
+const isa = new asmdb.aarch64.ISA();
+/*
class GenUtils {
// Get a list of instructions based on `name` and optional `mode`.
static query(name, mode) {
@@ -76,6 +68,7 @@ class GenUtils {
return arr;
}
}
+*/
// ============================================================================
// [tablegen.arm.ArmTableGen]
@@ -133,11 +126,8 @@ class ArmTableGen extends core.TableGen {
// [06] OpcodeDataIndex.
"([^\\)]+)" +
- "\\s*,\\s*" +
-
- // [07] NameDataIndex.
- "([^\\)]+)" +
"\\s*\\)"
+
, "g");
var m;
@@ -168,14 +158,12 @@ class ArmTableGen extends core.TableGen {
opcodeData : opcodeData, // Opcode data.
opcodeDataIndex : -1, // Opcode data index.
rwInfo : rwInfo, // RW info.
- flags : instFlags, // Instruction flags.
-
- nameIndex : -1 // Index to InstDB::_nameData.
+ flags : instFlags // Instruction flags.
});
}
if (this.insts.length === 0 || this.insts.length !== StringUtils.countOf(stringData, "INST("))
- FAIL("ARMTableGen.parse(): Invalid parsing regexp (no data parsed)");
+ FATAL("ARMTableGen.parse(): Invalid parsing regexp (no data parsed)");
console.log("Number of Instructions: " + this.insts.length);
}
@@ -188,8 +176,7 @@ class ArmTableGen extends core.TableGen {
String(inst.opcodeData ).padEnd(86) + ", " +
String(inst.rwInfo ).padEnd(10) + ", " +
String(inst.flags ).padEnd(26) + ", " +
- String(inst.opcodeDataIndex ).padEnd( 3) + ", " +
- String(inst.nameIndex ).padEnd( 4) + ")";
+ String(inst.opcodeDataIndex ).padEnd( 3) + ")" ;
}) + "\n";
return this.inject("InstInfo", s, this.insts.length * 4);
}
diff --git a/3rdparty/asmjit/tools/tablegen-a64.sh b/3rdparty/asmjit/tools/tablegen-a64.sh
new file mode 100755
index 00000000000..2cbd85ece16
--- /dev/null
+++ b/3rdparty/asmjit/tools/tablegen-a64.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+node ./tablegen-a64.js
diff --git a/3rdparty/asmjit/tools/tablegen-arm.sh b/3rdparty/asmjit/tools/tablegen-arm.sh
deleted file mode 100644
index 8545c1e71ba..00000000000
--- a/3rdparty/asmjit/tools/tablegen-arm.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-node ./tablegen-arm.js
diff --git a/3rdparty/asmjit/tools/tablegen-x86.js b/3rdparty/asmjit/tools/tablegen-x86.js
index 4750edfa205..377a71045e7 100644
--- a/3rdparty/asmjit/tools/tablegen-x86.js
+++ b/3rdparty/asmjit/tools/tablegen-x86.js
@@ -3,86 +3,43 @@
// See asmjit.h or LICENSE.md for license and copyright information
// SPDX-License-Identifier: Zlib
-// ============================================================================
-// tablegen-x86.js
-//
-// The purpose of this script is to fetch all instructions' names into a single
-// string and to optimize common patterns that appear in instruction data. It
-// prevents relocation of small strings (instruction names) that has to be done
-// by a linker to make all pointers the binary application/library uses valid.
-// This approach decreases the final size of AsmJit binary and relocation data.
-//
-// NOTE: This script relies on 'asmdb' package. Either install it by using
-// node.js package manager (npm) or by copying/symlinking the whole asmdb
-// directory as [asmjit]/tools/asmdb.
-// ============================================================================
-
"use strict";
+const fs = require("fs");
+const path = require("path");
+
+const commons = require("./generator-commons.js");
+const cxx = require("./generator-cxx.js");
const core = require("./tablegen.js");
+
const asmdb = core.asmdb;
-const kIndent = core.kIndent;
-const Lang = core.Lang;
-const CxxUtils = core.CxxUtils;
-const MapUtils = core.MapUtils;
-const ArrayUtils = core.ArrayUtils;
-const StringUtils = core.StringUtils;
-const IndexedArray = core.IndexedArray;
+const DEBUG = commons.DEBUG;
+const FATAL = commons.FATAL;
+const kIndent = commons.kIndent;
+const ArrayUtils = commons.ArrayUtils;
+const IndexedArray = commons.IndexedArray;
+const ObjectUtils = commons.ObjectUtils;
+const StringUtils = commons.StringUtils;
const hasOwn = Object.prototype.hasOwnProperty;
const disclaimer = StringUtils.disclaimer;
-const FAIL = core.FAIL;
-const DEBUG = core.DEBUG;
-
const decToHex = StringUtils.decToHex;
+function readJSON(fileName) {
+ const content = fs.readFileSync(fileName);
+ return JSON.parse(content);
+}
+
+const x86data = readJSON(path.join(__dirname, "..", "db", asmdb.x86.dbName));
+
// ============================================================================
// [tablegen.x86.x86isa]
// ============================================================================
// Create the X86 database and add some special cases recognized by AsmJit.
-const x86isa = new asmdb.x86.ISA({
- instructions: [
- // Imul in [reg, imm] form is encoded as [reg, reg, imm].
- ["imul", "r16, ib" , "RMI" , "66 6B /r ib" , "ANY OF=W SF=W ZF=U AF=U PF=U CF=W"],
- ["imul", "r32, ib" , "RMI" , "6B /r ib" , "ANY OF=W SF=W ZF=U AF=U PF=U CF=W"],
- ["imul", "r64, ib" , "RMI" , "REX.W 6B /r ib", "X64 OF=W SF=W ZF=U AF=U PF=U CF=W"],
- ["imul", "r16, iw" , "RMI" , "66 69 /r iw" , "ANY OF=W SF=W ZF=U AF=U PF=U CF=W"],
- ["imul", "r32, id" , "RMI" , "69 /r id" , "ANY OF=W SF=W ZF=U AF=U PF=U CF=W"],
- ["imul", "r64, id" , "RMI" , "REX.W 69 /r id", "X64 OF=W SF=W ZF=U AF=U PF=U CF=W"],
-
- // Movabs (X64 only).
- ["movabs", "W:r64, iq/uq" , "I" , "REX.W B8+r iq", "X64"],
- ["movabs", "w:al, moff8" , "NONE", "A0" , "X64"],
- ["movabs", "w:ax, moff16" , "NONE", "66 A1" , "X64"],
- ["movabs", "W:eax, moff32", "NONE", "A1" , "X64"],
- ["movabs", "W:rax, moff64", "NONE", "REX.W A1" , "X64"],
- ["movabs", "W:moff8, al" , "NONE", "A2" , "X64"],
- ["movabs", "W:moff16, ax" , "NONE", "66 A3" , "X64"],
- ["movabs", "W:moff32, eax", "NONE", "A3" , "X64"],
- ["movabs", "W:moff64, rax", "NONE", "REX.W A3" , "X64"]
- ]
-});
-
-// Remapped instructions contain mapping between instructions that AsmJit expects
-// and instructions provided by asmdb. In general, AsmJit uses string instructions
-// (like cmps, movs, etc...) without the suffix, so we just remap these and keep
-// all others.
-const RemappedInsts = {
- __proto__: null,
-
- "cmpsd": { names: ["cmpsd"] , rep: false },
- "movsd": { names: ["movsd"] , rep: false },
- "cmps" : { names: ["cmpsb", "cmpsw", "cmpsd", "cmpsq"], rep: true },
- "movs" : { names: ["movsb", "movsw", "movsd", "movsq"], rep: true },
- "lods" : { names: ["lodsb", "lodsw", "lodsd", "lodsq"], rep: null },
- "scas" : { names: ["scasb", "scasw", "scasd", "scasq"], rep: null },
- "stos" : { names: ["stosb", "stosw", "stosd", "stosq"], rep: null },
- "ins" : { names: ["insb" , "insw" , "insd" ] , rep: null },
- "outs" : { names: ["outsb", "outsw", "outsd"] , rep: null }
-};
+const x86isa = new asmdb.x86.ISA(x86data);
// ============================================================================
// [tablegen.x86.Filter]
@@ -95,7 +52,7 @@ class Filter {
for (var i = 0; i < instArray.length; i++) {
const inst = instArray[i];
- if (inst.attributes.AltForm)
+ if (inst.altForm)
continue;
const s = inst.operands.map((op) => { return op.isImm() ? "imm" : op.toString(); }).join(", ");
@@ -113,7 +70,7 @@ class Filter {
const result = [];
for (var i = 0; i < instArray.length; i++) {
const inst = instArray[i];
- if (inst.attributes.AltForm)
+ if (inst.altForm)
continue;
result.push(inst);
}
@@ -167,7 +124,28 @@ class GenUtils {
}
static cpuFeaturesOf(dbInsts) {
- return ArrayUtils.sorted(dbInsts.unionCpuFeatures());
+ function cmp(a, b) {
+ if (a.startsWith("AVX512") && !b.startsWith("AVX512"))
+ return 1;
+ if (b.startsWith("AVX512") && !a.startsWith("AVX512"))
+ return -1;
+
+ if (a.startsWith("AVX") && !b.startsWith("AVX"))
+ return 1;
+ if (b.startsWith("AVX") && !a.startsWith("AVX"))
+ return -1;
+
+ if (a === "FPU" && b !== "FPU")
+ return 1;
+ if (b === "FPU" && a !== "FPU")
+ return -1;
+
+ return a < b ? -1 : a === b ? 0 : 1;
+ }
+
+ const features = Object.getOwnPropertyNames(dbInsts.unionCpuFeatures());
+ features.sort(cmp);
+ return features;
}
static assignVexEvexCompatibilityFlags(f, dbInsts) {
@@ -261,16 +239,16 @@ class GenUtils {
const dbInst = dbInsts[i];
const operands = dbInst.operands;
- if (dbInst.attributes.Lock ) f.Lock = true;
- if (dbInst.attributes.XAcquire ) f.XAcquire = true;
- if (dbInst.attributes.XRelease ) f.XRelease = true;
- if (dbInst.attributes.BND ) f.Rep = true;
- if (dbInst.attributes.REP ) f.Rep = true;
- if (dbInst.attributes.REPNE ) f.Rep = true;
- if (dbInst.attributes.RepIgnored ) f.RepIgnored = true;
- if (dbInst.attributes.ImplicitZeroing) f.Avx512ImplicitZ = true;
+ if (dbInst.prefixes.lock ) f.Lock = true;
+ if (dbInst.prefixes.xacquire ) f.XAcquire = true;
+ if (dbInst.prefixes.xrelease ) f.XRelease = true;
+ if (dbInst.prefixes.bnd ) f.Rep = true;
+ if (dbInst.prefixes.rep ) f.Rep = true;
+ if (dbInst.prefixes.repne ) f.Rep = true;
+ if (dbInst.prefixes.repIgnore ) f.RepIgnored = true;
+ if (dbInst.k === "zeroing" ) f.Avx512ImplicitZ = true;
- if (dbInst.fpu) {
+ if (dbInst.category.FPU) {
for (var j = 0; j < operands.length; j++) {
const op = operands[j];
if (op.memSize === 16) f.FpuM16 = true;
@@ -280,7 +258,7 @@ class GenUtils {
}
}
- if (dbInst.attributes.Tsib)
+ if (dbInst.tsib)
f.Tsib = true;
if (dbInst.vsibReg)
@@ -289,12 +267,11 @@ class GenUtils {
if (dbInst.prefix === "VEX" || dbInst.prefix === "XOP")
f.Vex = true;
+ if (dbInst.encodingPreference === "EVEX")
+ f.PreferEvex = true;
+
if (dbInst.prefix === "EVEX") {
f.Evex = true;
-
- if (dbInst.extensions["AVX512_VNNI"])
- f.PreferEvex = true;
-
if (dbInst.kmask) f.Avx512K = true;
if (dbInst.zmask) f.Avx512Z = true;
@@ -418,7 +395,7 @@ class GenUtils {
}
}
- static fixedRegOf(reg) {
+ static fixedRegOfRegName(reg) {
switch (reg) {
case "es" : return 1;
case "cs" : return 2;
@@ -447,11 +424,23 @@ class GenUtils {
}
}
+ static fixedRegOf(op) {
+ if (op.isReg()) {
+ return GenUtils.fixedRegOfRegName(op.reg);
+ }
+ else if (op.isMem() && op.memRegOnly) {
+ return GenUtils.fixedRegOfRegName(op.memRegOnly);
+ }
+ else {
+ return -1;
+ }
+ }
+
static controlFlow(dbInsts) {
- if (dbInsts.checkAttribute("Control", "Jump")) return "Jump";
- if (dbInsts.checkAttribute("Control", "Call")) return "Call";
- if (dbInsts.checkAttribute("Control", "Branch")) return "Branch";
- if (dbInsts.checkAttribute("Control", "Return")) return "Return";
+ if (dbInsts.checkAttribute("control", "jump")) return "Jump";
+ if (dbInsts.checkAttribute("control", "call")) return "Call";
+ if (dbInsts.checkAttribute("control", "branch")) return "Branch";
+ if (dbInsts.checkAttribute("control", "return")) return "Return";
return "Regular";
}
}
@@ -473,16 +462,7 @@ class X86TableGen extends core.TableGen {
// Get instructions (dbInsts) having the same name as understood by AsmJit.
query(name) {
- const remapped = RemappedInsts[name];
- if (!remapped) return x86isa.query(name);
-
- const dbInsts = x86isa.query(remapped.names);
- const rep = remapped.rep;
- if (rep === null) return dbInsts;
-
- return dbInsts.filter((inst) => {
- return rep === !!(inst.attributes.REP || inst.attributes.REPNE);
- });
+ return x86isa.query(name);
}
// --------------------------------------------------------------------------
@@ -500,9 +480,8 @@ class X86TableGen extends core.TableGen {
// --- autogenerated fields ---
"([^\\)]+)" + "," + // [05] MainOpcodeIndex.
"([^\\)]+)" + "," + // [06] AltOpcodeIndex.
- "([^\\)]+)" + "," + // [07] NameIndex.
- "([^\\)]+)" + "," + // [08] CommonDataIndex.
- "([^\\)]+)" + "\\)", // [09] OperationDataIndex.
+ "([^\\)]+)" + "," + // [07] CommonDataIndex.
+ "([^\\)]+)" + "\\)", // [08] OperationDataIndex.
"g");
var m;
@@ -515,7 +494,7 @@ class X86TableGen extends core.TableGen {
const dbInsts = this.query(name);
if (name && !dbInsts.length)
- FAIL(`Instruction '${name}' not found in asmdb`);
+ FATAL(`Instruction '${name}' not found in asmdb`);
const flags = GenUtils.flagsOf(dbInsts);
const controlFlow = GenUtils.controlFlow(dbInsts);
@@ -548,7 +527,7 @@ class X86TableGen extends core.TableGen {
}
if (this.insts.length === 0)
- FAIL("X86TableGen.parse(): Invalid parsing regexp (no data parsed)");
+ FATAL("X86TableGen.parse(): Invalid parsing regexp (no data parsed)");
console.log("Number of Instructions: " + this.insts.length);
}
@@ -562,7 +541,6 @@ class X86TableGen extends core.TableGen {
String(inst.opcode1 ).padEnd(26) + ", " +
String(inst.mainOpcodeIndex ).padEnd( 3) + ", " +
String(inst.altOpcodeIndex ).padEnd( 3) + ", " +
- String(inst.nameIndex ).padEnd( 5) + ", " +
String(inst.commonInfoIndex ).padEnd( 3) + ", " +
String(inst.additionalInfoIndex).padEnd( 3) + ")";
}) + "\n";
@@ -574,7 +552,7 @@ class X86TableGen extends core.TableGen {
// --------------------------------------------------------------------------
printMissing() {
- const ignored = MapUtils.arrayToMap([
+ const ignored = ArrayUtils.toDict([
"cmpsb", "cmpsw", "cmpsd", "cmpsq",
"lodsb", "lodsw", "lodsd", "lodsq",
"movsb", "movsw", "movsd", "movsq",
@@ -832,7 +810,7 @@ class IdEnum extends core.IdEnum {
var text = "";
var features = GenUtils.cpuFeaturesOf(dbInsts);
- const priorityFeatures = ["AVX_VNNI"];
+ const priorityFeatures = ["AVX_VNNI", "AVX_VNNI_INT8", "AVX_IFMA", "AVX_NE_CONVERT"];
if (features.length) {
text += "{";
@@ -970,7 +948,7 @@ class AltOpcodeTable extends core.Task {
components[2] = "00";
}
else {
- FAIL(`Failed to process opcode '${opcode}'`);
+ FATAL(`Failed to process opcode '${opcode}'`);
}
const newOpcode = joinOpcodeComponents(components);
@@ -1009,8 +987,8 @@ class AltOpcodeTable extends core.Task {
// [tablegen.x86.InstSignatureTable]
// ============================================================================
-const RegOp = MapUtils.arrayToMap(["al", "ah", "ax", "eax", "rax", "cl", "r8lo", "r8hi", "r16", "r32", "r64", "xmm", "ymm", "zmm", "mm", "k", "sreg", "creg", "dreg", "st", "bnd"]);
-const MemOp = MapUtils.arrayToMap(["m8", "m16", "m32", "m48", "m64", "m80", "m128", "m256", "m512", "m1024"]);
+const RegOp = ArrayUtils.toDict(["al", "ah", "ax", "eax", "rax", "cl", "r8lo", "r8hi", "r16", "r32", "r64", "xmm", "ymm", "zmm", "mm", "k", "sreg", "creg", "dreg", "st", "bnd"]);
+const MemOp = ArrayUtils.toDict(["m8", "m16", "m32", "m48", "m64", "m80", "m128", "m256", "m512", "m1024"]);
const cmpOp = StringUtils.makePriorityCompare([
"RegGpbLo", "RegGpbHi", "RegGpw", "RegGpd", "RegGpq", "RegXmm", "RegYmm", "RegZmm", "RegMm", "RegKReg", "RegSReg", "RegCReg", "RegDReg", "RegSt", "RegBnd", "RegTmm",
@@ -1037,7 +1015,7 @@ function StringifyOpArray(a, map) {
else if (hasOwn.call(map, op))
mapped = map[op];
else
- FAIL(`UNHANDLED OPERAND '${op}'`);
+ FATAL(`UNHANDLED OPERAND '${op}'`);
s += (s ? " | " : "") + mapped;
}
return s ? s : "0";
@@ -1049,11 +1027,11 @@ class OSignature {
}
equals(other) {
- return MapUtils.equals(this.flags, other.flags);
+ return ObjectUtils.equals(this.flags, other.flags);
}
xor(other) {
- const result = MapUtils.xor(this.flags, other.flags);
+ const result = ObjectUtils.xor(this.flags, other.flags);
return Object.getOwnPropertyNames(result).length === 0 ? null : result;
}
@@ -1254,14 +1232,14 @@ class ISignature extends Array {
mergeWith(other) {
// If both architectures are the same, it's fine to merge.
- var ok = this.x86 === other.x86 && this.x64 === other.x64;
+ const sameArch = this.x86 === other.x86 && this.x64 === other.x64;
// If the first arch is [X86|X64] and the second [X64] it's also fine.
- if (!ok && this.x86 && this.x64 && !other.x86 && other.x64)
- ok = true;
+ // if (!ok && this.x86 && this.x64 && !other.x86 && other.x64)
+ // ok = true;
// It's not ok if both signatures have different number of implicit operands.
- if (!ok || this.implicit !== other.implicit)
+ if (!sameArch || this.implicit !== other.implicit)
return false;
// It's not ok if both signatures have different number of operands.
@@ -1269,8 +1247,8 @@ class ISignature extends Array {
if (len !== other.length)
return false;
- var xorIndex = -1;
- for (var i = 0; i < len; i++) {
+ let xorIndex = -1;
+ for (let i = 0; i < len; i++) {
const xor = this[i].xor(other[i]);
if (xor === null) continue;
@@ -1281,12 +1259,9 @@ class ISignature extends Array {
}
// Bail if mergeWidth at operand-level failed.
- if (xorIndex !== -1 && !this[xorIndex].mergeWith(other[xorIndex]))
+ if (xorIndex === -1 || !this[xorIndex].mergeWith(other[xorIndex]))
return false;
- this.x86 = this.x86 || other.x86;
- this.x64 = this.x64 || other.x64;
-
return true;
}
@@ -1297,14 +1272,14 @@ class ISignature extends Array {
class SignatureArray extends Array {
// Iterate over all signatures and check which operands don't need explicit memory size.
- calcImplicitMemSize() {
+ calcImplicitMemSize(instName) {
// Calculates a hash-value (aka key) of all register operands specified by `regOps` in `inst`.
function keyOf(inst, regOps) {
var s = "";
for (var i = 0; i < inst.length; i++) {
const op = inst[i];
if (regOps & (1 << i))
- s += "{" + ArrayUtils.sorted(MapUtils.and(op.flags, RegOp)).join("|") + "}";
+ s += "{" + ArrayUtils.sorted(ObjectUtils.and(op.flags, RegOp)).join("|") + "}";
}
return s || "?";
}
@@ -1323,7 +1298,7 @@ class SignatureArray extends Array {
// Check if this instruction signature has a memory operand of explicit size.
for (i = 0; i < len; i++) {
const aOp = aInst[i];
- const mem = MapUtils.firstOf(aOp.flags, MemOp);
+ const mem = ObjectUtils.findKey(aOp.flags, MemOp);
if (mem) {
// Stop if the memory operand has implicit-size or if there is more than one.
@@ -1336,7 +1311,7 @@ class SignatureArray extends Array {
memPos = i;
}
}
- else if (MapUtils.anyOf(aOp.flags, RegOp)) {
+ else if (ObjectUtils.hasAny(aOp.flags, RegOp)) {
// Doesn't consider 'r/m' as we already checked 'm'.
regOps |= (1 << i);
}
@@ -1361,7 +1336,7 @@ class SignatureArray extends Array {
for (i = 0; i < len; i++) {
if (i === memPos) continue;
- const reg = MapUtils.anyOf(bInst[i].flags, RegOp);
+ const reg = ObjectUtils.hasAny(bInst[i].flags, RegOp);
if (regOps & (1 << i))
hasMatch &= reg;
else if (reg)
@@ -1372,7 +1347,7 @@ class SignatureArray extends Array {
const bOp = bInst[memPos];
if (bOp.flags.mem) continue;
- const mem = MapUtils.firstOf(bOp.flags, MemOp);
+ const mem = ObjectUtils.findKey(bOp.flags, MemOp);
if (mem === memOp) {
sameSizeSet.push(bInst);
}
@@ -1412,6 +1387,8 @@ class SignatureArray extends Array {
// then keep this implicit as it won't do any harm. These instructions
// cannot be mixed and it will make implicit the 32-bit one in cases
// where X64 introduced 64-bit ones like `cvtsi2ss`.
+ if (!/^(bndcl|bndcn|bndcu|ptwrite|(v)?cvtsi2ss|(v)?cvtsi2sd|vcvtusi2ss|vcvtusi2sd)$/.test(instName))
+ implicit = false;
}
else {
implicit = false;
@@ -1424,8 +1401,9 @@ class SignatureArray extends Array {
// Patch all instructions to accept implicit-size memory operand.
for (bIndex = 0; bIndex < sameSizeSet.length; bIndex++) {
const bInst = sameSizeSet[bIndex];
- if (implicit)
+ if (implicit) {
bInst[memPos].flags.mem = true;
+ }
if (!implicit)
DEBUG(`${this.name}: Explicit: ${bInst}`);
@@ -1594,7 +1572,9 @@ class InstSignatureTable extends core.Task {
}
makeSignatures(dbInsts) {
+ const instName = dbInsts.length ? dbInsts[0].name : "";
const signatures = new SignatureArray();
+
for (var i = 0; i < dbInsts.length; i++) {
const inst = dbInsts[i];
const ops = inst.operands;
@@ -1678,29 +1658,9 @@ class InstSignatureTable extends core.Task {
op.flags.implicit = true;
}
- const seg = iop.memSeg;
+ const seg = iop.memSegment;
if (seg) {
switch (inst.name) {
- case "cmpsb": op.flags.m8 = true; break;
- case "cmpsw": op.flags.m16 = true; break;
- case "cmpsd": op.flags.m32 = true; break;
- case "cmpsq": op.flags.m64 = true; break;
- case "lodsb": op.flags.m8 = true; break;
- case "lodsw": op.flags.m16 = true; break;
- case "lodsd": op.flags.m32 = true; break;
- case "lodsq": op.flags.m64 = true; break;
- case "movsb": op.flags.m8 = true; break;
- case "movsw": op.flags.m16 = true; break;
- case "movsd": op.flags.m32 = true; break;
- case "movsq": op.flags.m64 = true; break;
- case "scasb": op.flags.m8 = true; break;
- case "scasw": op.flags.m16 = true; break;
- case "scasd": op.flags.m32 = true; break;
- case "scasq": op.flags.m64 = true; break;
- case "stosb": op.flags.m8 = true; break;
- case "stosw": op.flags.m16 = true; break;
- case "stosd": op.flags.m32 = true; break;
- case "stosq": op.flags.m64 = true; break;
case "insb": op.flags.m8 = true; break;
case "insw": op.flags.m16 = true; break;
case "insd": op.flags.m32 = true; break;
@@ -1720,6 +1680,9 @@ class InstSignatureTable extends core.Task {
default: console.log(`UNKNOWN MEM IN INSTRUCTION '${inst.name}'`); break;
}
+ if (iop.memRegOnly)
+ reg = iop.memRegOnly;
+
if (seg === "ds") op.flags.memDS = true;
if (seg === "es") op.flags.memES = true;
if (reg === "reg") { op.flags.memBase = true; }
@@ -1732,30 +1695,37 @@ class InstSignatureTable extends core.Task {
else if (reg) {
if (reg == "r8") {
op.flags["r8lo"] = true;
- op.flags["r8hi"] = true;
+
+ if (!inst.w || inst.w === "W0")
+ op.flags["r8hi"] = true;
}
else {
op.flags[reg] = true;
}
}
+
if (mem) {
op.flags[mem] = true;
- // HACK: Allow LEA|CL*|PREFETCH* to use any memory size.
- if (/^(cldemote|clwb|clflush\w*|lea|prefetch\w*)$/.test(inst.name)) {
+ // HACK: Allow LEA to use any memory size.
+ if (/^(lea)$/.test(inst.name)) {
op.flags.mem = true;
Object.assign(op.flags, MemOp);
}
// HACK: These instructions specify explicit memory size, but it's just informational.
- if (inst.name === "enqcmd" || inst.name === "enqcmds" || inst.name === "movdir64b")
+ if (/^(call|enqcmd|enqcmds|lcall|ljmp|movdir64b)$/.test(inst.name)) {
op.flags.mem = true;
-
+ }
}
+
if (imm) {
if (iop.immSign === "any" || iop.immSign === "signed" ) op.flags["i" + imm] = true;
if (iop.immSign === "any" || iop.immSign === "unsigned") op.flags["u" + imm] = true;
}
- if (rel) op.flags["rel" + rel] = true;
+
+ if (rel) {
+ op.flags["rel" + rel] = true;
+ }
row.push(op);
}
@@ -1766,8 +1736,8 @@ class InstSignatureTable extends core.Task {
}
}
- if (signatures.length && GenUtils.canUseImplicitMemSize(dbInsts[0].name))
- signatures.calcImplicitMemSize();
+ if (signatures.length && GenUtils.canUseImplicitMemSize(instName))
+ signatures.calcImplicitMemSize(instName);
signatures.compact();
return signatures;
@@ -1839,7 +1809,7 @@ class AdditionalInfoTable extends core.Task {
break;
}
- const instFlagsIndex = instFlagsTable.addIndexed("InstRWFlags(" + CxxUtils.flags(instFlags, (f) => { return `FLAG(${f})`; }, "FLAG(None)") + ")");
+ const instFlagsIndex = instFlagsTable.addIndexed("InstRWFlags(" + StringUtils.formatCppFlags(instFlags, (f) => { return `FLAG(${f})`; }, "FLAG(None)") + ")");
const rwInfoIndex = rwInfoTable.addIndexed(`{ ${rData}, ${wData} }`);
inst.additionalInfoIndex = additionaInfoTable.addIndexed(`{ ${instFlagsIndex}, ${rwInfoIndex}, { ${features} } }`);
@@ -1870,7 +1840,7 @@ class AdditionalInfoTable extends core.Task {
if (dbInst.name === "mov")
continue;
- const specialRegs = dbInst.specialRegs;
+ const regs = dbInst.io;
// Mov is a special case, moving to/from control regs makes flags undefined,
// which we don't want to have in `X86InstDB::operationData`. This is, thus,
@@ -1878,28 +1848,28 @@ class AdditionalInfoTable extends core.Task {
if (dbInst.name === "mov")
continue;
- for (var specialReg in specialRegs) {
+ for (var reg in regs) {
var flag = "";
- switch (specialReg) {
- case "FLAGS.CF": flag = "CF"; break;
- case "FLAGS.OF": flag = "OF"; break;
- case "FLAGS.SF": flag = "SF"; break;
- case "FLAGS.ZF": flag = "ZF"; break;
- case "FLAGS.AF": flag = "AF"; break;
- case "FLAGS.PF": flag = "PF"; break;
- case "FLAGS.DF": flag = "DF"; break;
- case "FLAGS.IF": flag = "IF"; break;
- //case "FLAGS.TF": flag = "TF"; break;
- case "FLAGS.AC": flag = "AC"; break;
- case "X86SW.C0": flag = "C0"; break;
- case "X86SW.C1": flag = "C1"; break;
- case "X86SW.C2": flag = "C2"; break;
- case "X86SW.C3": flag = "C3"; break;
+ switch (reg) {
+ case "CF": flag = "CF"; break;
+ case "OF": flag = "OF"; break;
+ case "SF": flag = "SF"; break;
+ case "ZF": flag = "ZF"; break;
+ case "AF": flag = "AF"; break;
+ case "PF": flag = "PF"; break;
+ case "DF": flag = "DF"; break;
+ case "IF": flag = "IF"; break;
+ //case "TF": flag = "TF"; break;
+ case "AC": flag = "AC"; break;
+ case "C0": flag = "C0"; break;
+ case "C1": flag = "C1"; break;
+ case "C2": flag = "C2"; break;
+ case "C3": flag = "C3"; break;
default:
continue;
}
- switch (specialRegs[specialReg]) {
+ switch (regs[reg]) {
case "R":
r[flag] = true;
break;
@@ -1924,7 +1894,7 @@ class AdditionalInfoTable extends core.Task {
// [tablegen.x86.InstRWInfoTable]
// ============================================================================
-const NOT_MEM_AMBIGUOUS = MapUtils.arrayToMap([
+const NOT_MEM_AMBIGUOUS = ArrayUtils.toDict([
"call", "movq"
]);
@@ -1997,20 +1967,20 @@ class InstRWInfoTable extends core.Task {
run() {
const insts = this.ctx.insts;
- const noRmInfo = CxxUtils.struct(
+ const noRmInfo = StringUtils.formatCppStruct(
"InstDB::RWInfoRm::kCategory" + "None".padEnd(10),
StringUtils.decToHex(0, 2),
String(0).padEnd(2),
- CxxUtils.flags({}),
+ StringUtils.formatCppFlags({}),
"0"
);
- const noOpInfo = CxxUtils.struct(
+ const noOpInfo = StringUtils.formatCppStruct(
"0x0000000000000000u",
"0x0000000000000000u",
"0xFF",
"0",
- CxxUtils.struct(0),
+ StringUtils.formatCppStruct(0),
"OpRWFlags::kNone"
);
@@ -2049,7 +2019,7 @@ class InstRWInfoTable extends core.Task {
if (opAcc === "R") flags.Read = true;
if (opAcc === "W") flags.Write = true;
if (opAcc === "X") flags.RW = true;
- Lang.merge(flags, op.flags);
+ ObjectUtils.merge(flags, op.flags);
const rIndex = opAcc === "X" || opAcc === "R" ? op.index : -1;
const rWidth = opAcc === "X" || opAcc === "R" ? op.width : -1;
@@ -2058,23 +2028,23 @@ class InstRWInfoTable extends core.Task {
const consecutiveLeadCount = op.clc;
- const opData = CxxUtils.struct(
+ const opData = StringUtils.formatCppStruct(
this.byteMaskFromBitRanges([{ start: rIndex, end: rIndex + rWidth - 1 }]) + "u",
this.byteMaskFromBitRanges([{ start: wIndex, end: wIndex + wWidth - 1 }]) + "u",
StringUtils.decToHex(op.fixed === -1 ? 0xFF : op.fixed, 2),
String(consecutiveLeadCount),
- CxxUtils.struct(0),
- CxxUtils.flags(flags, function(flag) { return "OpRWFlags::k" + flag; }, "OpRWFlags::kNone")
+ StringUtils.formatCppStruct(0),
+ StringUtils.formatCppFlags(flags, function(flag) { return "OpRWFlags::k" + flag; }, "OpRWFlags::kNone")
);
rwOpsIndex.push(this.opInfoTable.addIndexed(opData));
}
- const rmData = CxxUtils.struct(
+ const rmData = StringUtils.formatCppStruct(
"InstDB::RWInfoRm::kCategory" + rmInfo.category.padEnd(10),
StringUtils.decToHex(rmInfo.rmIndexes, 2),
String(Math.max(rmInfo.memFixed, 0)).padEnd(2),
- CxxUtils.flags({
+ StringUtils.formatCppFlags({
"InstDB::RWInfoRm::kFlagAmbiguous": Boolean(rmInfo.memAmbiguous),
"InstDB::RWInfoRm::kFlagMovssMovsd": Boolean(inst.name === "movss" || inst.name === "movsd"),
"InstDB::RWInfoRm::kFlagPextrw": Boolean(inst.name === "pextrw"),
@@ -2083,10 +2053,10 @@ class InstRWInfoTable extends core.Task {
rmInfo.memExtension === "None" ? "0" : "uint32_t(CpuFeatures::X86::k" + rmInfo.memExtension + ")"
);
- const rwData = CxxUtils.struct(
+ const rwData = StringUtils.formatCppStruct(
"InstDB::RWInfo::kCategory" + rwInfo.category.padEnd(10),
String(this.rmInfoTable.addIndexed(rmData)).padEnd(2),
- CxxUtils.struct(...(rwOpsIndex.map(function(item) { return String(item).padEnd(2); })))
+ StringUtils.formatCppStruct(...(rwOpsIndex.map(function(item) { return String(item).padEnd(2); })))
);
if (i == 0)
@@ -2134,7 +2104,7 @@ class InstRWInfoTable extends core.Task {
for (var j = start; j <= end; j++) {
const bytePos = j >> 3;
if (bytePos < 0 || bytePos >= arr.length)
- FAIL(`Range ${start}:${end} cannot be used to create a byte-mask`);
+ FATAL(`Range ${start}:${end} cannot be used to create a byte-mask`);
arr[bytePos] = 1;
}
}
@@ -2165,7 +2135,7 @@ class InstRWInfoTable extends core.Task {
access: op.read && op.write ? "X" : op.read ? "R" : op.write ? "W" : "?",
clc: 0,
flags: {},
- fixed: GenUtils.fixedRegOf(op.reg),
+ fixed: GenUtils.fixedRegOf(op),
index: op.rwxIndex,
width: op.rwxWidth
};
@@ -2195,10 +2165,26 @@ class InstRWInfoTable extends core.Task {
if (op.consecutiveLeadCount)
d.clc = op.consecutiveLeadCount;
- if (op.isReg())
- d.fixed = GenUtils.fixedRegOf(op.reg);
- else
- d.fixed = GenUtils.fixedRegOf(op.mem);
+ const instName = dbInst.name;
+ // NOTE: Avoid push/pop here as PUSH/POP has many variations for segment registers,
+ // which would set 'd.fixed' field even for GP variation of the instuction.
+ if (instName !== "push" && instName !== "pop") {
+ d.fixed = GenUtils.fixedRegOf(op);
+ }
+
+ switch (instName) {
+ case "vfcmaddcph":
+ case "vfmaddcph":
+ case "vfcmaddcsh":
+ case "vfmaddcsh":
+ case "vfcmulcsh":
+ case "vfmulcsh":
+ case "vfcmulcph":
+ case "vfmulcph":
+ if (j === 0)
+ d.flags.Unique = true;
+ break;
+ }
if (op.zext)
d.flags.ZExt = true;
@@ -2215,7 +2201,7 @@ class InstRWInfoTable extends core.Task {
}
if (d.fixed !== -1) {
- if (op.memSeg)
+ if (op.memSegment)
d.flags.MemPhysId = true;
else
d.flags.RegPhysId = true;
@@ -2225,16 +2211,26 @@ class InstRWInfoTable extends core.Task {
rwOps[j] = d;
}
else {
- if (!Lang.deepEqExcept(rwOps[j], d, { "fixed": true, "flags": true }))
+ if (!ObjectUtils.equalsExcept(rwOps[j], d, { "fixed": true, "flags": true }))
return null;
if (rwOps[j].fixed === -1)
rwOps[j].fixed = d.fixed;
- Lang.merge(rwOps[j].flags, d.flags);
+ ObjectUtils.merge(rwOps[j].flags, d.flags);
}
}
}
- return { category: "Generic", rwOps };
+
+ const name = dbInsts.length ? dbInsts[0].name : "";
+
+ switch (name) {
+ case "vpternlogd":
+ case "vpternlogq":
+ return { category: "GenericEx", rwOps };
+
+ default:
+ return { category: "Generic", rwOps };
+ }
}
function queryRwByData(dbInsts, rwOpsArray) {
@@ -2243,12 +2239,13 @@ class InstRWInfoTable extends core.Task {
const operands = dbInst.operands;
const rwOps = nullOps();
- for (var j = 0; j < operands.length; j++)
+ for (var j = 0; j < operands.length; j++) {
rwOps[j] = makeRwFromOp(operands[j])
+ }
var match = 0;
for (var j = 0; j < rwOpsArray.length; j++)
- match |= Lang.deepEq(rwOps, rwOpsArray[j]);
+ match |= ObjectUtils.equals(rwOps, rwOpsArray[j]);
if (!match)
return false;
@@ -2292,7 +2289,7 @@ class InstRWInfoTable extends core.Task {
if (queryRwByData(dbInsts, this.rwCategoryByData[k]))
return { category: k, rwOps: nullOps() };
- // FAILURE: Missing data to categorize this instruction.
+ // FATALURE: Missing data to categorize this instruction.
if (name) {
const items = dumpRwToData(dbInsts)
console.log(`RW: ${dbInsts.length ? dbInsts[0].name : ""}:`);
@@ -2305,7 +2302,7 @@ class InstRWInfoTable extends core.Task {
}
rwOpFlagsForInstruction(instName, opIndex) {
- const toMap = MapUtils.arrayToMap;
+ const toMap = ArrayUtils.toDict;
// TODO: We should be able to get this information from asmdb.
switch (instName + "@" + opIndex) {
@@ -2382,7 +2379,7 @@ class InstRWInfoTable extends core.Task {
if (/^(punpcklbw|punpckldq|punpcklwd)$/.test(dbInst.name))
return "None";
- return StringUtils.capitalize(dbInst.name);
+ return cxx.Utils.capitalize(dbInst.name);
}
}
diff --git a/3rdparty/asmjit/tools/tablegen-x86.sh b/3rdparty/asmjit/tools/tablegen-x86.sh
index 40facf326dc..40facf326dc 100644..100755
--- a/3rdparty/asmjit/tools/tablegen-x86.sh
+++ b/3rdparty/asmjit/tools/tablegen-x86.sh
diff --git a/3rdparty/asmjit/tools/tablegen.js b/3rdparty/asmjit/tools/tablegen.js
index fdc65fd1cbd..a151805675b 100644
--- a/3rdparty/asmjit/tools/tablegen.js
+++ b/3rdparty/asmjit/tools/tablegen.js
@@ -12,618 +12,227 @@
"use strict";
-const VERBOSE = false;
-
// ============================================================================
// [Imports]
// ============================================================================
const fs = require("fs");
-const hasOwn = Object.prototype.hasOwnProperty;
-const asmdb = (function() {
- // Try to import a local 'asmdb' package, if available.
- try {
- return require("./asmdb");
- }
- catch (ex) {
- if (ex.code !== "MODULE_NOT_FOUND") {
- console.log(`FATAL ERROR: ${ex.message}`);
- throw ex;
- }
- }
+const commons = require("./generator-commons.js");
+const cxx = require("./generator-cxx.js");
+const asmdb = require("../db");
- // Try to import global 'asmdb' package as local package is not available.
- return require("asmdb");
-})();
exports.asmdb = asmdb;
+exports.exp = asmdb.base.exp;
-// ============================================================================
-// [Constants]
-// ============================================================================
+const hasOwn = Object.prototype.hasOwnProperty;
-const kIndent = " ";
-const kJustify = 119;
-const kAsmJitRoot = "..";
+const FATAL = commons.FATAL;
+const StringUtils = commons.StringUtils;
-exports.kIndent = kIndent;
-exports.kJustify = kJustify;
+const kAsmJitRoot = "..";
exports.kAsmJitRoot = kAsmJitRoot;
// ============================================================================
-// [Debugging]
+// [InstructionNameData]
// ============================================================================
-function DEBUG(msg) {
- if (VERBOSE)
- console.log(msg);
-}
-exports.DEBUG = DEBUG;
-
-function WARN(msg) {
- console.log(msg);
-}
-exports.WARN = WARN;
-
-function FAIL(msg) {
- console.log(`FATAL ERROR: ${msg}`);
- throw new Error(msg);
+function charTo5Bit(c) {
+ if (c >= 'a' && c <= 'z')
+ return 1 + (c.charCodeAt(0) - 'a'.charCodeAt(0));
+ else if (c >= '0' && c <= '4')
+ return 1 + 26 + (c.charCodeAt(0) - '0'.charCodeAt(0));
+ else
+ FATAL(`Character '${c}' cannot be encoded into a 5-bit string`);
}
-exports.FAIL = FAIL;
-
-// ============================================================================
-// [Lang]
-// ============================================================================
-
-function nop(x) { return x; }
-class Lang {
- static merge(a, b) {
- if (a === b)
- return a;
-
- for (var k in b) {
- var av = a[k];
- var bv = b[k];
-
- if (typeof av === "object" && typeof bv === "object")
- Lang.merge(av, bv);
- else
- a[k] = bv;
- }
-
- return a;
+class InstructionNameData {
+ constructor() {
+ this.names = [];
+ this.primaryTable = [];
+ this.stringTable = "";
+ this.size = 0;
+ this.indexComment = [];
+ this.maxNameLength = 0;
}
- static deepEq(a, b) {
- if (a === b)
- return true;
-
- if (typeof a !== typeof b)
- return false;
-
- if (typeof a !== "object")
- return a === b;
-
- if (Array.isArray(a) || Array.isArray(b)) {
- if (Array.isArray(a) !== Array.isArray(b))
- return false;
-
- const len = a.length;
- if (b.length !== len)
- return false;
-
- for (var i = 0; i < len; i++)
- if (!Lang.deepEq(a[i], b[i]))
- return false;
+ add(s) {
+ // First try to encode the string with 5-bit characters that fit into a 32-bit int.
+ if (/^[a-z0-4]{0,6}$/.test(s)) {
+ let index = 0;
+ for (let i = 0; i < s.length; i++)
+ index |= charTo5Bit(s[i]) << (i * 5);
+
+ this.names.push(s);
+ this.primaryTable.push(index | (1 << 31));
+ this.indexComment.push(`Small '${s}'.`);
}
else {
- if (a === null || b === null)
- return a === b;
-
- for (var k in a)
- if (!hasOwn.call(b, k) || !Lang.deepEq(a[k], b[k]))
- return false;
-
- for (var k in b)
- if (!hasOwn.call(a, k))
- return false;
+ // Put the string into a string table.
+ this.names.push(s);
+ this.primaryTable.push(-1);
+ this.indexComment.push(``);
}
- return true;
+ if (this.maxNameLength < s.length)
+ this.maxNameLength = s.length;
}
- static deepEqExcept(a, b, except) {
- if (a === b)
- return true;
-
- if (typeof a !== "object" || typeof b !== "object" || Array.isArray(a) || Array.isArray(b))
- return Lang.deepEq(a, b);
-
- for (var k in a)
- if (!hasOwn.call(except, k) && (!hasOwn.call(b, k) || !Lang.deepEq(a[k], b[k])))
- return false;
-
- for (var k in b)
- if (!hasOwn.call(except, k) && !hasOwn.call(a, k))
- return false;
-
- return true;
- }
-}
-exports.Lang = Lang;
-
-// ============================================================================
-// [StringUtils]
-// ============================================================================
-
-class StringUtils {
- static asString(x) { return String(x); }
-
- static countOf(s, pattern) {
- if (!pattern)
- FAIL(`Pattern cannot be empty`);
-
- var n = 0;
- var pos = 0;
+ index() {
+ const kMaxPrefixSize = 15;
+ const kMaxSuffixSize = 7;
+ const names = [];
- while ((pos = s.indexOf(pattern, pos)) >= 0) {
- n++;
- pos += pattern.length;
+ for (let idx = 0; idx < this.primaryTable.length; idx++) {
+ if (this.primaryTable[idx] === -1) {
+ names.push({ name: this.names[idx], index: idx });
+ }
}
- return n;
- }
+ names.sort(function(a, b) {
+ if (a.name.length > b.name.length)
+ return -1;
+ if (a.name.length < b.name.length)
+ return 1;
+ return (a > b) ? 1 : (a < b) ? -1 : 0;
+ });
- static capitalize(s) {
- s = String(s);
- return !s ? s : s[0].toUpperCase() + s.substr(1);
- }
+ for (let z = 0; z < names.length; z++) {
+ const idx = names[z].index;
+ const name = names[z].name;
- static trimLeft(s) { return s.replace(/^\s+/, ""); }
- static trimRight(s) { return s.replace(/\s+$/, ""); }
+ let done = false;
+ let longestPrefix = 0;
+ let longestSuffix = 0;
- static upFirst(s) {
- if (!s) return "";
- return s[0].toUpperCase() + s.substr(1);
- }
+ let prefix = "";
+ let suffix = "";
- static decToHex(n, nPad) {
- var hex = Number(n < 0 ? 0x100000000 + n : n).toString(16);
- while (nPad > hex.length)
- hex = "0" + hex;
- return "0x" + hex.toUpperCase();
- }
+ for (let i = Math.min(name.length, kMaxPrefixSize); i > 0; i--) {
+ prefix = name.substring(0, i);
+ suffix = name.substring(i);
- static format(array, indent, showIndex, mapFn) {
- if (!mapFn)
- mapFn = StringUtils.asString;
+ const prefixIndex = this.stringTable.indexOf(prefix);
+ const suffixIndex = this.stringTable.indexOf(suffix);
- var s = "";
- var threshold = 80;
+ // Matched both parts?
+ if (prefixIndex !== -1 && suffix === "") {
+ done = true;
+ break;
+ }
- if (showIndex === -1)
- s += indent;
+ if (prefixIndex !== -1 && suffixIndex !== -1) {
+ done = true;
+ break;
+ }
- for (var i = 0; i < array.length; i++) {
- const item = array[i];
- const last = i === array.length - 1;
+ if (prefixIndex !== -1 && longestPrefix === 0)
+ longestPrefix = prefix.length;
- if (showIndex !== -1)
- s += indent;
+ if (suffixIndex !== -1 && suffix.length > longestSuffix)
+ longestSuffix = suffix.length;
- s += mapFn(item);
- if (showIndex > 0) {
- s += `${last ? " " : ","} // #${i}`;
- if (typeof array.refCountOf === "function")
- s += ` [ref=${array.refCountOf(item)}x]`;
- }
- else if (!last) {
- s += ",";
+ if (suffix.length === kMaxSuffixSize)
+ break;
}
- if (showIndex === -1) {
- if (s.length >= threshold - 1 && !last) {
- s += "\n" + indent;
- threshold += 80;
+ if (!done) {
+ let minPrefixSize = name.length >= 8 ? name.length / 2 + 1 : name.length - 2;
+
+ prefix = "";
+ suffix = "";
+
+ if (longestPrefix >= minPrefixSize) {
+ prefix = name.substring(0, longestPrefix);
+ suffix = name.substring(longestPrefix);
+ }
+ else if (longestSuffix) {
+ const splitAt = Math.min(name.length - longestSuffix, kMaxPrefixSize);
+ prefix = name.substring(0, splitAt);
+ suffix = name.substring(splitAt);
+ }
+ else if (name.length > kMaxPrefixSize) {
+ prefix = name.substring(0, kMaxPrefixSize);
+ suffix = name.substring(kMaxPrefixSize);
}
else {
- if (!last) s += " ";
+ prefix = name;
+ suffix = "";
}
}
- else {
- if (!last) s += "\n";
- }
- }
- return s;
- }
+ if (suffix) {
+ const prefixIndex = this.addOrReferenceString(prefix);
+ const suffixIndex = this.addOrReferenceString(suffix);
- static makeCxxArray(array, code, indent) {
- if (!indent) indent = kIndent;
- return `${code} = {\n${indent}` + array.join(`,\n${indent}`) + `\n};\n`;
- }
-
- static makeCxxArrayWithComment(array, code, indent) {
- if (!indent) indent = kIndent;
- var s = "";
- for (var i = 0; i < array.length; i++) {
- const last = i === array.length - 1;
- s += indent + array[i].data +
- (last ? " // " : ", // ") + (array[i].refs ? "#" + String(i) : "").padEnd(5) + array[i].comment + "\n";
- }
- return `${code} = {\n${s}};\n`;
- }
-
- static disclaimer(s) {
- return "// ------------------- Automatically generated, do not edit -------------------\n" +
- s +
- "// ----------------------------------------------------------------------------\n";
- }
-
- static indent(s, indentation) {
- var lines = s.split(/\r?\n/g);
- if (indentation) {
- for (var i = 0; i < lines.length; i++) {
- var line = lines[i];
- if (line) lines[i] = indentation + line;
+ this.primaryTable[idx] = prefixIndex | (prefix.length << 12) | (suffixIndex << 16) | (suffix.length << 28);
+ this.indexComment[idx] = `Large '${prefix}|${suffix}'.`;
}
- }
-
- return lines.join("\n");
- }
-
- static extract(s, start, end) {
- var iStart = s.indexOf(start);
- var iEnd = s.indexOf(end);
-
- if (iStart === -1)
- FAIL(`StringUtils.extract(): Couldn't locate start mark '${start}'`);
-
- if (iEnd === -1)
- FAIL(`StringUtils.extract(): Couldn't locate end mark '${end}'`);
-
- return s.substring(iStart + start.length, iEnd).trim();
- }
-
- static inject(s, start, end, code) {
- var iStart = s.indexOf(start);
- var iEnd = s.indexOf(end);
-
- if (iStart === -1)
- FAIL(`StringUtils.inject(): Couldn't locate start mark '${start}'`);
-
- if (iEnd === -1)
- FAIL(`StringUtils.inject(): Couldn't locate end mark '${end}'`);
-
- var nIndent = 0;
- while (iStart > 0 && s[iStart-1] === " ") {
- iStart--;
- nIndent++;
- }
+ else {
+ const prefixIndex = this.addOrReferenceString(prefix);
- if (nIndent) {
- const indentation = " ".repeat(nIndent);
- code = StringUtils.indent(code, indentation) + indentation;
+ this.primaryTable[idx] = prefixIndex | (prefix.length << 12);
+ this.indexComment[idx] = `Large '${prefix}'.`;
+ }
}
-
- return s.substr(0, iStart + start.length + nIndent) + code + s.substr(iEnd);
}
- static makePriorityCompare(priorityArray) {
- const map = Object.create(null);
- priorityArray.forEach((str, index) => { map[str] = index; });
-
- return function(a, b) {
- const ax = hasOwn.call(map, a) ? map[a] : Infinity;
- const bx = hasOwn.call(map, b) ? map[b] : Infinity;
- return ax != bx ? ax - bx : a < b ? -1 : a > b ? 1 : 0;
+ addOrReferenceString(s) {
+ let index = this.stringTable.indexOf(s);
+ if (index === -1) {
+ index = this.stringTable.length;
+ this.stringTable += s;
}
+ return index;
}
-}
-exports.StringUtils = StringUtils;
-
-// ============================================================================
-// [ArrayUtils]
-// ============================================================================
-
-class ArrayUtils {
- static min(arr, fn) {
- if (!arr.length)
- return null;
-
- if (!fn)
- fn = nop;
-
- var v = fn(arr[0]);
- for (var i = 1; i < arr.length; i++)
- v = Math.min(v, fn(arr[i]));
- return v;
- }
-
- static max(arr, fn) {
- if (!arr.length)
- return null;
-
- if (!fn)
- fn = nop;
-
- var v = fn(arr[0]);
- for (var i = 1; i < arr.length; i++)
- v = Math.max(v, fn(arr[i]));
- return v;
- }
-
- static sorted(obj, cmp) {
- const out = Array.isArray(obj) ? obj.slice() : Object.getOwnPropertyNames(obj);
- out.sort(cmp);
- return out;
- }
-
- static deepIndexOf(arr, what) {
- for (var i = 0; i < arr.length; i++)
- if (Lang.deepEq(arr[i], what))
- return i;
- return -1;
- }
-}
-exports.ArrayUtils = ArrayUtils;
-
-// ============================================================================
-// [MapUtils]
-// ============================================================================
-
-class MapUtils {
- static clone(map) {
- return Object.assign(Object.create(null), map);
- }
-
- static arrayToMap(arr, value) {
- if (value === undefined)
- value = true;
-
- const out = Object.create(null);
- for (var i = 0; i < arr.length; i++)
- out[arr[i]] = value;
- return out;
- }
-
- static equals(a, b) {
- for (var k in a) if (!hasOwn.call(b, k)) return false;
- for (var k in b) if (!hasOwn.call(a, k)) return false;
- return true;
- }
-
- static firstOf(map, flags) {
- for (var k in flags)
- if (hasOwn.call(map, k))
- return k;
- return undefined;
- }
-
- static anyOf(map, flags) {
- for (var k in flags)
- if (hasOwn.call(map, k))
- return true;
- return false;
- }
-
- static add(a, b) {
- for (var k in b)
- a[k] = b[k];
- return a;
- }
-
- static and(a, b) {
- const out = Object.create(null);
- for (var k in a)
- if (hasOwn.call(b, k))
- out[k] = true;
- return out;
- }
-
- static xor(a, b) {
- const out = Object.create(null);
- for (var k in a) if (!hasOwn.call(b, k)) out[k] = true;
- for (var k in b) if (!hasOwn.call(a, k)) out[k] = true;
- return out;
- }
-};
-exports.MapUtils = MapUtils;
-
-// ============================================================================
-// [CxxUtils]
-// ============================================================================
-
-class CxxUtils {
- static flags(obj, fn, none) {
- if (none == null)
- none = "0";
-
- if (!fn)
- fn = nop;
-
- var out = "";
- for (var k in obj) {
- if (obj[k])
- out += (out ? " | " : "") + fn(k);
- }
- return out ? out : none;
- }
-
- static struct(...args) {
- return "{ " + args.join(", ") + " }";
- }
-};
-exports.CxxUtils = CxxUtils;
-
-// ============================================================================
-// [IndexedString]
-// ============================================================================
-
-// IndexedString is mostly used to merge all instruction names into a single
-// string with external index. It's designed mostly for generating C++ tables.
-//
-// Consider the following cases in C++:
-//
-// a) static const char* const* instNames = { "add", "mov", "vpunpcklbw" };
-//
-// b) static const char instNames[] = { "add\0" "mov\0" "vpunpcklbw\0" };
-// static const uint16_t instNameIndex[] = { 0, 4, 8 };
-//
-// The latter (b) has an advantage that it doesn't have to be relocated by the
-// linker, which saves a lot of space in the resulting binary and a lot of CPU
-// cycles (and memory) when the linker loads it. AsmJit supports thousands of
-// instructions so each optimization like this makes it smaller and faster to
-// load.
-class IndexedString {
- constructor() {
- this.map = Object.create(null);
- this.array = [];
- this.size = -1;
- }
-
- add(s) {
- this.map[s] = -1;
- }
-
- index() {
- const map = this.map;
- const array = this.array;
- const partialMap = Object.create(null);
-
- var k, kp;
- var i, len;
-
- // Create a map that will contain all keys and partial keys.
- for (k in map) {
- if (!k) {
- partialMap[k] = k;
- }
- else {
- for (i = 0, len = k.length; i < len; i++) {
- kp = k.substr(i);
- if (!hasOwn.call(partialMap, kp) || partialMap[kp].length < len)
- partialMap[kp] = k;
- }
- }
- }
-
- // Create an array that will only contain keys that are needed.
- for (k in map)
- if (partialMap[k] === k)
- array.push(k);
- array.sort();
-
- // Create valid offsets to the `array`.
- var offMap = Object.create(null);
- var offset = 0;
- for (i = 0, len = array.length; i < len; i++) {
- k = array[i];
+ formatIndexTable(tableName) {
+ if (this.size === -1)
+ FATAL(`IndexedString.formatIndexTable(): Not indexed yet, call index()`);
- offMap[k] = offset;
- offset += k.length + 1;
+ let s = "";
+ for (let i = 0; i < this.primaryTable.length; i++) {
+ s += cxx.Utils.toHex(this.primaryTable[i], 8);
+ s += i !== this.primaryTable.length - 1 ? "," : " ";
+ s += " // " + this.indexComment[i] + "\n";
}
- this.size = offset;
- // Assign valid offsets to `map`.
- for (kp in map) {
- k = partialMap[kp];
- map[kp] = offMap[k] + k.length - kp.length;
- }
+ return `const uint32_t ${tableName}[] = {\n${StringUtils.indent(s, " ")}};\n`;
}
- format(indent, justify) {
+ formatStringTable(tableName) {
if (this.size === -1)
- FAIL(`IndexedString.format(): not indexed yet, call index()`);
-
- const array = this.array;
- if (!justify) justify = 0;
-
- var i;
- var s = "";
- var line = "";
+ FATAL(`IndexedString.formatStringTable(): Not indexed yet, call index()`);
- for (i = 0; i < array.length; i++) {
- const item = "\"" + array[i] + ((i !== array.length - 1) ? "\\0\"" : "\";");
- const newl = line + (line ? " " : indent) + item;
-
- if (newl.length <= justify) {
- line = newl;
- continue;
- }
- else {
- s += line + "\n";
- line = indent + item;
- }
+ let s = "";
+ for (let i = 0; i < this.stringTable.length; i += 80) {
+ if (s)
+ s += "\n"
+ s += '"' + this.stringTable.substring(i, i + 80) + '"';
}
+ s += ";\n";
- return s + line;
+ return `const char ${tableName}[] =\n${StringUtils.indent(s, " ")}\n`;
}
getSize() {
if (this.size === -1)
- FAIL(`IndexedString.getSize(): Not indexed yet, call index()`);
- return this.size;
+ FATAL(`IndexedString.getSize(): Not indexed yet, call index()`);
+
+ return this.primaryTable.length * 4 + this.stringTable.length;
}
getIndex(k) {
if (this.size === -1)
- FAIL(`IndexedString.getIndex(): Not indexed yet, call index()`);
+ FATAL(`IndexedString.getIndex(): Not indexed yet, call index()`);
if (!hasOwn.call(this.map, k))
- FAIL(`IndexedString.getIndex(): Key '${k}' not found.`);
+ FATAL(`IndexedString.getIndex(): Key '${k}' not found.`);
return this.map[k];
}
}
-exports.IndexedString = IndexedString;
-
-// ============================================================================
-// [IndexedArray]
-// ============================================================================
-
-// IndexedArray is an Array replacement that allows to index each item inserted
-// to it. Its main purpose is to avoid data duplication, if an item passed to
-// `addIndexed()` is already within the Array then it's not inserted and the
-// existing index is returned instead.
-function IndexedArray_keyOf(item) {
- return typeof item === "string" ? item : JSON.stringify(item);
-}
-
-class IndexedArray extends Array {
- constructor() {
- super();
- this._index = Object.create(null);
- }
-
- refCountOf(item) {
- const key = IndexedArray_keyOf(item);
- const idx = this._index[key];
-
- return idx !== undefined ? idx.refCount : 0;
- }
-
- addIndexed(item) {
- const key = IndexedArray_keyOf(item);
- var idx = this._index[key];
-
- if (idx !== undefined) {
- idx.refCount++;
- return idx.data;
- }
-
- idx = this.length;
- this._index[key] = {
- data: idx,
- refCount: 1
- };
- this.push(item);
- return idx;
- }
-}
-exports.IndexedArray = IndexedArray;
+exports.InstructionNameData = InstructionNameData;
// ============================================================================
// [Task]
@@ -643,7 +252,7 @@ class Task {
}
run() {
- FAIL("Task.run(): Must be reimplemented");
+ FATAL("Task.run(): Must be reimplemented");
}
}
exports.Task = Task;
@@ -652,29 +261,12 @@ exports.Task = Task;
// [TableGen]
// ============================================================================
-// Main context used to load, generate, and store instruction tables. The idea
-// is to be extensible, so it stores 'Task's to be executed with minimal deps
-// management.
-class TableGen {
- constructor(arch) {
- this.arch = arch;
+class Injector {
+ constructor() {
this.files = Object.create(null);
this.tableSizes = Object.create(null);
-
- this.tasks = [];
- this.taskMap = Object.create(null);
-
- this.insts = [];
- this.instMap = Object.create(null);
-
- this.aliases = [];
- this.aliasMem = Object.create(null);
}
- // --------------------------------------------------------------------------
- // [File Management]
- // --------------------------------------------------------------------------
-
load(fileList) {
for (var i = 0; i < fileList.length; i++) {
const file = fileList[i];
@@ -705,7 +297,7 @@ class TableGen {
dataOfFile(file) {
const obj = this.files[file];
if (!obj)
- FAIL(`TableGen.dataOfFile(): File '${file}' not loaded`);
+ FATAL(`TableGen.dataOfFile(): File '${file}' not loaded`);
return obj.data;
}
@@ -726,7 +318,7 @@ class TableGen {
}
if (!done)
- FAIL(`TableGen.inject(): Cannot find '${key}'`);
+ FATAL(`TableGen.inject(): Cannot find '${key}'`);
if (size)
this.tableSizes[key] = size;
@@ -734,20 +326,56 @@ class TableGen {
return this;
}
+ dumpTableSizes() {
+ const sizes = this.tableSizes;
+
+ var pad = 26;
+ var total = 0;
+
+ for (var name in sizes) {
+ const size = sizes[name];
+ total += size;
+ console.log(("Size of " + name).padEnd(pad) + ": " + size);
+ }
+
+ console.log("Size of all tables".padEnd(pad) + ": " + total);
+ }
+}
+exports.Injector = Injector;
+
+// Main context used to load, generate, and store instruction tables. The idea
+// is to be extensible, so it stores 'Task's to be executed with minimal deps
+// management.
+class TableGen extends Injector{
+ constructor(arch) {
+ super();
+
+ this.arch = arch;
+
+ this.tasks = [];
+ this.taskMap = Object.create(null);
+
+ this.insts = [];
+ this.instMap = Object.create(null);
+
+ this.aliases = [];
+ this.aliasMem = Object.create(null);
+ }
+
// --------------------------------------------------------------------------
// [Task Management]
// --------------------------------------------------------------------------
addTask(task) {
if (!task.name)
- FAIL(`TableGen.addModule(): Module must have a name`);
+ FATAL(`TableGen.addModule(): Module must have a name`);
if (this.taskMap[task.name])
- FAIL(`TableGen.addModule(): Module '${task.name}' already added`);
+ FATAL(`TableGen.addModule(): Module '${task.name}' already added`);
task.deps.forEach((dependency) => {
if (!this.taskMap[dependency])
- FAIL(`TableGen.addModule(): Dependency '${dependency}' of module '${task.name}' doesn't exist`);
+ FATAL(`TableGen.addModule(): Dependency '${dependency}' of module '${task.name}' doesn't exist`);
});
this.tasks.push(task);
@@ -792,7 +420,7 @@ class TableGen {
addInst(inst) {
if (this.instMap[inst.name])
- FAIL(`TableGen.addInst(): Instruction '${inst.name}' already added`);
+ FATAL(`TableGen.addInst(): Instruction '${inst.name}' already added`);
inst.id = this.insts.length;
this.insts.push(inst);
@@ -819,25 +447,6 @@ class TableGen {
}
// --------------------------------------------------------------------------
- // [Other]
- // --------------------------------------------------------------------------
-
- dumpTableSizes() {
- const sizes = this.tableSizes;
-
- var pad = 26;
- var total = 0;
-
- for (var name in sizes) {
- const size = sizes[name];
- total += size;
- console.log(("Size of " + name).padEnd(pad) + ": " + size);
- }
-
- console.log("Size of all tables".padEnd(pad) + ": " + total);
- }
-
- // --------------------------------------------------------------------------
// [Hooks]
// --------------------------------------------------------------------------
@@ -856,7 +465,7 @@ class IdEnum extends Task {
}
comment(name) {
- FAIL("IdEnum.comment(): Must be reimplemented");
+ FATAL("IdEnum.comment(): Must be reimplemented");
}
run() {
@@ -885,63 +494,75 @@ exports.IdEnum = IdEnum;
// [NameTable]
// ============================================================================
-class NameTable extends Task {
- constructor(name, deps) {
- super(name || "NameTable", deps);
+class Output {
+ constructor() {
+ this.content = Object.create(null);
+ this.tableSize = Object.create(null);
}
- run() {
- const arch = this.ctx.arch;
- const none = "Inst::kIdNone";
+ add(id, content, tableSize) {
+ this.content[id] = content;
+ this.tableSize[id] = typeof tableSize === "number" ? tableSize : 0;
+ }
+};
+exports.Output = Output;
- const insts = this.ctx.insts;
- const instNames = new IndexedString();
+function generateNameData(out, instructions) {
+ const none = "Inst::kIdNone";
- const instFirst = new Array(26);
- const instLast = new Array(26);
+ const instFirst = new Array(26);
+ const instLast = new Array(26);
+ const instNameData = new InstructionNameData();
- var maxLength = 0;
- for (var i = 0; i < insts.length; i++) {
- const inst = insts[i];
- instNames.add(inst.displayName);
- maxLength = Math.max(maxLength, inst.displayName.length);
- }
- instNames.index();
+ for (let i = 0; i < instructions.length; i++)
+ instNameData.add(instructions[i].displayName);
+ instNameData.index();
- for (var i = 0; i < insts.length; i++) {
- const inst = insts[i];
- const name = inst.displayName;
- const nameIndex = instNames.getIndex(name);
+ for (let i = 0; i < instructions.length; i++) {
+ const inst = instructions[i];
+ const displayName = inst.displayName;
+ const alphaIndex = displayName.charCodeAt(0) - 'a'.charCodeAt(0);
- const index = name.charCodeAt(0) - 'a'.charCodeAt(0);
- if (index < 0 || index >= 26)
- FAIL(`TableGen.generateNameData(): Invalid lookup character '${name[0]}' of '${name}'`);
+ if (alphaIndex < 0 || alphaIndex >= 26)
+ FATAL(`generateNameData(): Invalid lookup character '${displayName[0]}' of '${displayName}'`);
- inst.nameIndex = nameIndex;
- if (instFirst[index] === undefined)
- instFirst[index] = `Inst::kId${inst.enum}`;
- instLast[index] = `Inst::kId${inst.enum}`;
- }
+ if (instFirst[alphaIndex] === undefined)
+ instFirst[alphaIndex] = `Inst::kId${inst.enum}`;
+ instLast[alphaIndex] = `Inst::kId${inst.enum}`;
+ }
- var s = "";
- s += `const char InstDB::_nameData[] =\n${instNames.format(kIndent, kJustify)}\n`;
+ var s = "";
+ s += `const InstNameIndex InstDB::instNameIndex = {{\n`;
+ for (var i = 0; i < instFirst.length; i++) {
+ const firstId = instFirst[i] || none;
+ const lastId = instLast[i] || none;
+
+ s += ` { ${String(firstId).padEnd(22)}, ${String(lastId).padEnd(22)} + 1 }`;
+ if (i !== 26 - 1)
+ s += `,`;
s += `\n`;
- s += `const InstDB::InstNameIndex InstDB::instNameIndex[26] = {\n`;
- for (var i = 0; i < instFirst.length; i++) {
- const firstId = instFirst[i] || none;
- const lastId = instLast[i] || none;
-
- s += ` { ${String(firstId).padEnd(22)}, ${String(lastId).padEnd(22)} + 1 }`;
- if (i !== 26 - 1)
- s += `,`;
- s += `\n`;
- }
- s += `};\n`;
+ }
+ s += `}, uint16_t(${instNameData.maxNameLength})};\n`;
+ s += `\n`;
+ s += instNameData.formatStringTable("InstDB::_instNameStringTable");
+ s += `\n`;
+ s += instNameData.formatIndexTable("InstDB::_instNameIndexTable");
+
+ const dataSize = instNameData.getSize() + 26 * 4;
+ out.add("NameData", StringUtils.disclaimer(s), dataSize);
+ return out;
+}
+exports.generateNameData = generateNameData;
- this.ctx.inject("NameLimits",
- StringUtils.disclaimer(`enum : uint32_t { kMaxNameSize = ${maxLength} };\n`));
+class NameTable extends Task {
+ constructor(name, deps) {
+ super(name || "NameTable", deps);
+ }
- return this.ctx.inject("NameData", StringUtils.disclaimer(s), instNames.getSize() + 26 * 4);
+ run() {
+ const output = new Output();
+ generateNameData(output, this.ctx.insts);
+ this.ctx.inject("NameData", output.content["NameData"], output.tableSize["NameData"]);
}
}
exports.NameTable = NameTable;
diff --git a/3rdparty/asmjit/tools/tablegen.sh b/3rdparty/asmjit/tools/tablegen.sh
index b2c9cac368c..0ef1e580634 100644..100755
--- a/3rdparty/asmjit/tools/tablegen.sh
+++ b/3rdparty/asmjit/tools/tablegen.sh
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -e
-node ./tablegen-arm.js $@
+node ./tablegen-a32.js $@
+node ./tablegen-a64.js $@
node ./tablegen-x86.js $@
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt b/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt
index 4023e0caa85..00ae473abe6 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2014-2022 Omar Cornut
+Copyright (c) 2014-2025 Omar Cornut
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h b/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h
index bb52b2380ec..11de530acbb 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h
@@ -1,67 +1,145 @@
//-----------------------------------------------------------------------------
-// USER IMPLEMENTATION
-// This file contains compile-time options for ImGui.
-// Other options (memory allocation overrides, callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO().
+// DEAR IMGUI COMPILE-TIME OPTIONS
+// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
+// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
+//-----------------------------------------------------------------------------
+// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it)
+// B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template.
+//-----------------------------------------------------------------------------
+// You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
+// files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
+// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
+// Call IMGUI_CHECKVERSION() from your .cpp file to verify that the data structures your files are using are matching the ones imgui.cpp is using.
//-----------------------------------------------------------------------------
#pragma once
+//---- Define assertion handler. Defaults to calling assert().
+// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
+//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
+//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
+
+//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
+// Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
+// - Windows DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
+// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
+//#define IMGUI_API __declspec(dllexport) // MSVC Windows: DLL export
+//#define IMGUI_API __declspec(dllimport) // MSVC Windows: DLL import
+//#define IMGUI_API __attribute__((visibility("default"))) // GCC/Clang: override visibility when set is hidden
+
+//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-#define IMGUI_DISABLE_OBSOLETE_KEYIO
#define IMGUI_DISABLE_DEFAULT_ALLOCATORS
-//---- Define your own ImVector<> type if you don't want to use the provided implementation defined in imgui.h
-//#include <vector>
-//#define ImVector std::vector
-//#define ImVector MyVector
+//---- Disable all of Dear ImGui or don't implement standard windows/tools.
+// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
+//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
+//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
+//#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowIDStackToolWindow() will be empty.
-//---- Define assertion handler. Defaults to calling assert().
-#include <assert.h>
-#define IM_ASSERT(_EXPR) assert(_EXPR)
+//---- Don't implement some functions to reduce linkage requirements.
+#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
+//#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
+#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
+//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, IME).
+//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
+//#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS // Don't implement default platform_io.Platform_OpenInShellFn() handler (Win32: ShellExecute(), require shell32.lib/.a, Mac/Linux: use system("")).
+//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
+//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
+//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
+//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
+//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
+//#define IMGUI_DISABLE_DEFAULT_FONT // Disable default embedded font (ProggyClean.ttf), remove ~9.5 KB from output binary. AddFontDefault() will assert.
+//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
-//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows.
-//#define IMGUI_API __declspec( dllexport )
-//#define IMGUI_API __declspec( dllimport )
+//---- Enable Test Engine / Automation features.
+//#define IMGUI_ENABLE_TEST_ENGINE // Enable imgui_test_engine hooks. Generally set automatically by include "imgui_te_config.h", see Test Engine for details.
-//---- Don't implement default handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions)
-#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
-#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
+//---- Include imgui_user.h at the end of imgui.h as a convenience
+// May be convenient for some users to only explicitly include vanilla imgui.h and have extra stuff included.
+#define IMGUI_INCLUDE_IMGUI_USER_H
+//#define IMGUI_USER_H_FILENAME "my_folder/my_imgui_user.h"
//---- Include imgui_user.inl at the end of imgui.cpp so you can include code that extends ImGui using its private data/functions.
#define IMGUI_INCLUDE_IMGUI_USER_INL
-//---- Include imgui_user.h at the end of imgui.h
-#define IMGUI_INCLUDE_IMGUI_USER_H
+//---- Pack vertex colors as BGRA8 instead of RGBA8 (to avoid converting from one to another). Need dedicated backend support.
+//#define IMGUI_USE_BGRA_PACKED_COLOR
-//---- Don't implement default handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions)
-#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
-#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
+//---- Use legacy CRC32-adler tables (used before 1.91.6), in order to preserve old .ini data that you cannot afford to invalidate.
+//#define IMGUI_USE_LEGACY_CRC32_ADLER
+
+//---- Use 32-bit for ImWchar (default is 16-bit) to support Unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
+//#define IMGUI_USE_WCHAR32
+
+//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
+// By default the embedded implementations are declared static and not available outside of Dear ImGui sources files.
+//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
+//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
+//#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if IMGUI_USE_STB_SPRINTF is defined.
+#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
+#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
+//#define IMGUI_DISABLE_STB_SPRINTF_IMPLEMENTATION // only disabled if IMGUI_USE_STB_SPRINTF is defined.
+
+//---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
+// Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by stb_sprintf.h.
+//#define IMGUI_USE_STB_SPRINTF
-//---- Don't implement help and test window functionality (ShowUserGuide()/ShowStyleEditor()/ShowTestWindow() methods will be empty)
-//#define IMGUI_DISABLE_TEST_WINDOWS
+//---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui)
+// Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided).
+// On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
+//#define IMGUI_ENABLE_FREETYPE
-//---- Implement STB libraries in a namespace to avoid conflicts
-//#define IMGUI_STB_NAMESPACE ImStb
+//---- Use FreeType + plutosvg or lunasvg to render OpenType SVG fonts (SVGinOT)
+// Only works in combination with IMGUI_ENABLE_FREETYPE.
+// - plutosvg is currently easier to install, as e.g. it is part of vcpkg. It will support more fonts and may load them faster. See misc/freetype/README for instructions.
+// - Both require headers to be available in the include path + program to be linked with the library code (not provided).
+// - (note: lunasvg implementation is based on Freetype's rsvg-port.c which is licensed under CeCILL-C Free Software License Agreement)
+//#define IMGUI_ENABLE_FREETYPE_PLUTOSVG
+//#define IMGUI_ENABLE_FREETYPE_LUNASVG
-//---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
+//---- Use stb_truetype to build and rasterize the font atlas (default)
+// The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend.
+//#define IMGUI_ENABLE_STB_TRUETYPE
+
+//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
+// This will be inlined as part of ImVec2 and ImVec4 class declarations.
/*
-#define IM_VEC2_CLASS_EXTRA \
- ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \
+#define IM_VEC2_CLASS_EXTRA \
+ constexpr ImVec2(const MyVec2& f) : x(f.x), y(f.y) {} \
operator MyVec2() const { return MyVec2(x,y); }
-#define IM_VEC4_CLASS_EXTRA \
- ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \
+#define IM_VEC4_CLASS_EXTRA \
+ constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \
operator MyVec4() const { return MyVec4(x,y,z,w); }
*/
+//---- ...Or use Dear ImGui's own very basic math operators.
+//#define IMGUI_DEFINE_MATH_OPERATORS
+
+//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
+// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
+// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
+// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
+//#define ImDrawIdx unsigned int
+
+//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
+//struct ImDrawList;
+//struct ImDrawCmd;
+//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
+//#define ImDrawCallback MyImDrawCallback
-//---- Freely implement extra functions within the ImGui:: namespace.
-//---- Declare helpers or widgets implemented in imgui_user.inl or elsewhere, so end-user doesn't need to include multiple files.
-//---- e.g. you can create variants of the ImGui::Value() helper for your low-level math types, or your own widgets/helpers.
+//---- Debug Tools: Macro to break in Debugger (we provide a default implementation of this in the codebase)
+// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
+//#define IM_DEBUG_BREAK IM_ASSERT(0)
+//#define IM_DEBUG_BREAK __debugbreak()
+
+//---- Debug Tools: Enable slower asserts
+//#define IMGUI_DEBUG_PARANOID
+
+//---- Tip: You can add extra functions within the ImGui:: namespace from anywhere (e.g. your own sources/header files)
/*
namespace ImGui
{
- void Value(const char* prefix, const MyVec2& v, const char* float_format = NULL);
- void Value(const char* prefix, const MyVec4& v, const char* float_format = NULL);
+ void MyFunction(const char* name, MyMatrix44* mtx);
}
*/
-
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
index bd3f95d77ae..7ec19227897 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
@@ -1,30 +1,37 @@
-// dear imgui, v1.90 WIP
+// dear imgui, v1.91.9b
// (main code and documentation)
// Help:
-// - Read FAQ at http://dearimgui.org/faq
-// - Newcomers, read 'Programmer guide' below for notes on how to setup Dear ImGui in your codebase.
+// - See links below.
// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that.
-// Read imgui.cpp for details, links and comments.
+// - Read top of imgui.cpp for more details, links and comments.
// Resources:
-// - FAQ http://dearimgui.org/faq
-// - Homepage & latest https://github.com/ocornut/imgui
-// - Releases & changelog https://github.com/ocornut/imgui/releases
-// - Gallery https://github.com/ocornut/imgui/issues/5243 (please post your screenshots/video there!)
-// - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there)
-// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
-// - Issues & support https://github.com/ocornut/imgui/issues
-
-// Getting Started?
-// - For first-time users having issues compiling/linking/running or issues loading fonts:
-// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above.
-
+// - FAQ ........................ https://dearimgui.com/faq (in repository as docs/FAQ.md)
+// - Homepage ................... https://github.com/ocornut/imgui
+// - Releases & changelog ....... https://github.com/ocornut/imgui/releases
+// - Gallery .................... https://github.com/ocornut/imgui/issues?q=label%3Agallery (please post your screenshots/video there!)
+// - Wiki ....................... https://github.com/ocornut/imgui/wiki (lots of good stuff there)
+// - Getting Started https://github.com/ocornut/imgui/wiki/Getting-Started (how to integrate in an existing app by adding ~25 lines of code)
+// - Third-party Extensions https://github.com/ocornut/imgui/wiki/Useful-Extensions (ImPlot & many more)
+// - Bindings/Backends https://github.com/ocornut/imgui/wiki/Bindings (language bindings, backends for various tech/engines)
+// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
+// - Debug Tools https://github.com/ocornut/imgui/wiki/Debug-Tools
+// - Software using Dear ImGui https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui
+// - Issues & support ........... https://github.com/ocornut/imgui/issues
+// - Test Engine & Automation ... https://github.com/ocornut/imgui_test_engine (test suite, test engine to automate your apps)
+
+// For first-time users having issues compiling/linking/running/loading fonts:
+// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above.
+// Everything else should be asked in 'Issues'! We are building a database of cross-linked knowledge there.
+
+// Copyright (c) 2014-2025 Omar Cornut
// Developed by Omar Cornut and every direct or indirect contributors to the GitHub.
// See LICENSE.txt for copyright and licensing details (standard MIT License).
// This library is free but needs your support to sustain development and maintenance.
-// Businesses: you can support continued development via invoiced technical support, maintenance and sponsoring contracts. Please reach out to "contact AT dearimgui.com".
-// Individuals: you can support continued development via donations. See docs/README or web page.
+// Businesses: you can support continued development via B2B invoiced technical support, maintenance and sponsoring contracts.
+// PLEASE reach out at omar AT dearimgui DOT com. See https://github.com/ocornut/imgui/wiki/Funding
+// Businesses: you can also purchase licenses for the Dear ImGui Automation/Test Engine.
// It is recommended that you don't modify imgui.cpp! It will become difficult for you to update the library.
// Note that 'ImGui::' being a namespace, you can add functions into the namespace from your own source files, without
@@ -39,17 +46,16 @@ Index of this file:
DOCUMENTATION
- MISSION STATEMENT
-- END-USER GUIDE
+- CONTROLS GUIDE
- PROGRAMMER GUIDE
- READ FIRST
- HOW TO UPDATE TO A NEWER VERSION OF DEAR IMGUI
- GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE
- HOW A SIMPLE APPLICATION MAY LOOK LIKE
- HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE
- - USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS
- API BREAKING CHANGES (read me when you update!)
- FREQUENTLY ASKED QUESTIONS (FAQ)
- - Read all answers online: https://www.dearimgui.org/faq, or in docs/FAQ.md (with a Markdown viewer)
+ - Read all answers online: https://www.dearimgui.com/faq, or in docs/FAQ.md (with a Markdown viewer)
CODE
(search for "[SECTION]" in the code to find them)
@@ -57,7 +63,7 @@ CODE
// [SECTION] INCLUDES
// [SECTION] FORWARD DECLARATIONS
// [SECTION] CONTEXT AND MEMORY ALLOCATORS
-// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO)
+// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO, ImGuiPlatformIO)
// [SECTION] MISC HELPERS/UTILITIES (Geometry functions)
// [SECTION] MISC HELPERS/UTILITIES (String, Format, Hash functions)
// [SECTION] MISC HELPERS/UTILITIES (File functions)
@@ -69,13 +75,17 @@ CODE
// [SECTION] ImGuiListClipper
// [SECTION] STYLING
// [SECTION] RENDER HELPERS
+// [SECTION] INITIALIZATION, SHUTDOWN
// [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!)
+// [SECTION] ID STACK
// [SECTION] INPUTS
-// [SECTION] ERROR CHECKING
+// [SECTION] ERROR CHECKING, STATE RECOVERY
+// [SECTION] ITEM SUBMISSION
// [SECTION] LAYOUT
// [SECTION] SCROLLING
// [SECTION] TOOLTIPS
// [SECTION] POPUPS
+// [SECTION] WINDOW FOCUS
// [SECTION] KEYBOARD/GAMEPAD NAVIGATION
// [SECTION] DRAG AND DROP
// [SECTION] LOGGING/CAPTURING
@@ -85,7 +95,7 @@ CODE
// [SECTION] PLATFORM DEPENDENT HELPERS
// [SECTION] METRICS/DEBUGGER WINDOW
// [SECTION] DEBUG LOG WINDOW
-// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, STACK TOOL)
+// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, ID STACK TOOL)
*/
@@ -107,33 +117,80 @@ CODE
- Portable, minimize dependencies, run on target (consoles, phones, etc.).
- Efficient runtime and memory consumption.
- Designed for developers and content-creators, not the typical end-user! Some of the current weaknesses includes:
+ Designed primarily for developers and content-creators, not the typical end-user!
+ Some of the current weaknesses (which we aim to address in the future) includes:
- - Doesn't look fancy, doesn't animate.
+ - Doesn't look fancy.
- Limited layout features, intricate layouts are typically crafted in code.
- END-USER GUIDE
+ CONTROLS GUIDE
==============
- - Double-click on title bar to collapse window.
- - Click upper right corner to close a window, available when 'bool* p_open' is passed to ImGui::Begin().
- - Click and drag on lower right corner to resize window (double-click to auto fit window to its contents).
- - Click and drag on any empty space to move window.
- - TAB/SHIFT+TAB to cycle through keyboard editable fields.
- - CTRL+Click on a slider or drag box to input value as text.
- - Use mouse wheel to scroll.
- - Text editor:
- - Hold SHIFT or use mouse to select text.
- - CTRL+Left/Right to word jump.
- - CTRL+Shift+Left/Right to select words.
- - CTRL+A or Double-Click to select all.
- - CTRL+X,CTRL+C,CTRL+V to use OS clipboard/
- - CTRL+Z,CTRL+Y to undo/redo.
- - ESCAPE to revert text to its original value.
- - Controls are automatically adjusted for OSX to match standard OSX text editing operations.
- - General Keyboard controls: enable with ImGuiConfigFlags_NavEnableKeyboard.
- - General Gamepad controls: enable with ImGuiConfigFlags_NavEnableGamepad. Download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets
+ - MOUSE CONTROLS
+ - Mouse wheel: Scroll vertically.
+ - SHIFT+Mouse wheel: Scroll horizontally.
+ - Click [X]: Close a window, available when 'bool* p_open' is passed to ImGui::Begin().
+ - Click ^, Double-Click title: Collapse window.
+ - Drag on corner/border: Resize window (double-click to auto fit window to its contents).
+ - Drag on any empty space: Move window (unless io.ConfigWindowsMoveFromTitleBarOnly = true).
+ - Left-click outside popup: Close popup stack (right-click over underlying popup: Partially close popup stack).
+
+ - TEXT EDITOR
+ - Hold SHIFT or Drag Mouse: Select text.
+ - CTRL+Left/Right: Word jump.
+ - CTRL+Shift+Left/Right: Select words.
+ - CTRL+A or Double-Click: Select All.
+ - CTRL+X, CTRL+C, CTRL+V: Use OS clipboard.
+ - CTRL+Z Undo.
+ - CTRL+Y or CTRL+Shift+Z: Redo.
+ - ESCAPE: Revert text to its original value.
+ - On OSX, controls are automatically adjusted to match standard OSX text editing 2ts and behaviors.
+
+ - KEYBOARD CONTROLS
+ - Basic:
+ - Tab, SHIFT+Tab Cycle through text editable fields.
+ - CTRL+Tab, CTRL+Shift+Tab Cycle through windows.
+ - CTRL+Click Input text into a Slider or Drag widget.
+ - Extended features with `io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard`:
+ - Tab, SHIFT+Tab: Cycle through every items.
+ - Arrow keys Move through items using directional navigation. Tweak value.
+ - Arrow keys + Alt, Shift Tweak slower, tweak faster (when using arrow keys).
+ - Enter Activate item (prefer text input when possible).
+ - Space Activate item (prefer tweaking with arrows when possible).
+ - Escape Deactivate item, leave child window, close popup.
+ - Page Up, Page Down Previous page, next page.
+ - Home, End Scroll to top, scroll to bottom.
+ - Alt Toggle between scrolling layer and menu layer.
+ - CTRL+Tab then Ctrl+Arrows Move window. Hold SHIFT to resize instead of moving.
+ - Output when ImGuiConfigFlags_NavEnableKeyboard set,
+ - io.WantCaptureKeyboard flag is set when keyboard is claimed.
+ - io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs flag set.
+ - io.NavVisible: true when the navigation cursor is visible (usually goes to back false when mouse is used).
+
+ - GAMEPAD CONTROLS
+ - Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
+ - Particularly useful to use Dear ImGui on a console system (e.g. PlayStation, Switch, Xbox) without a mouse!
+ - Download controller mapping PNG/PSD at http://dearimgui.com/controls_sheets
+ - Backend support: backend needs to:
+ - Set 'io.BackendFlags |= ImGuiBackendFlags_HasGamepad' + call io.AddKeyEvent/AddKeyAnalogEvent() with ImGuiKey_Gamepad_XXX keys.
+ - For analog values (0.0f to 1.0f), backend is responsible to handling a dead-zone and rescaling inputs accordingly.
+ Backend code will probably need to transform your raw inputs (such as e.g. remapping your 0.2..0.9 raw input range to 0.0..1.0 imgui range, etc.).
+ - If you need to share inputs between your game and the Dear ImGui interface, the easiest approach is to go all-or-nothing,
+ with a buttons combo to toggle the target. Please reach out if you think the game vs navigation input sharing could be improved.
+
+ - REMOTE INPUTS SHARING & MOUSE EMULATION
+ - PS4/PS5 users: Consider emulating a mouse cursor with DualShock touch pad or a spare analog stick as a mouse-emulation fallback.
+ - Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + run examples/libs/synergy/uSynergy.c (on your console/tablet/phone app)
+ in order to share your PC mouse/keyboard.
+ - See https://github.com/ocornut/imgui/wiki/Useful-Extensions#remoting for other remoting solutions.
+ - On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the io.ConfigNavMoveSetMousePos flag.
+ Enabling io.ConfigNavMoveSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs Dear ImGui to move your mouse cursor along with navigation movements.
+ When enabled, the NewFrame() function may alter 'io.MousePos' and set 'io.WantSetMousePos' to notify you that it wants the mouse cursor to be moved.
+ When that happens your backend NEEDS to move the OS or underlying mouse cursor on the next frame. Some of the backends in examples/ do that.
+ (If you set the NavEnableSetMousePos flag but don't honor 'io.WantSetMousePos' properly, Dear ImGui will misbehave as it will see your mouse moving back & forth!)
+ (In a setup when you may not have easy control over the mouse cursor, e.g. uSynergy.c doesn't expose moving remote mouse cursor, you may want
+ to set a boolean to ignore your other external mouse positions until the external source is moved again.)
PROGRAMMER GUIDE
@@ -142,9 +199,11 @@ CODE
READ FIRST
----------
- Remember to check the wonderful Wiki (https://github.com/ocornut/imgui/wiki)
- - Your code creates the UI, if your code doesn't run the UI is gone! The UI can be highly dynamic, there are no construction or
- destruction steps, less superfluous data retention on your side, less state duplication, less state synchronization, fewer bugs.
+ - Your code creates the UI every frame of your application loop, if your code doesn't run the UI is gone!
+ The UI can be highly dynamic, there are no construction or destruction steps, less superfluous
+ data retention on your side, less state duplication, less state synchronization, fewer bugs.
- Call and read ImGui::ShowDemoWindow() for demo code demonstrating most features.
+ Or browse https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html for interactive web version.
- The library is designed to be built from sources. Avoid pre-compiled binaries and packaged versions. See imconfig.h to configure your build.
- Dear ImGui is an implementation of the IMGUI paradigm (immediate-mode graphical user interface, a term coined by Casey Muratori).
You can learn about IMGUI principles at http://www.johno.se/book/imgui.html, http://mollyrocket.com/861 & more links in Wiki.
@@ -152,18 +211,38 @@ CODE
For every application frame, your UI code will be called only once. This is in contrast to e.g. Unity's implementation of an IMGUI,
where the UI code is called multiple times ("multiple passes") from a single entry point. There are pros and cons to both approaches.
- Our origin is on the top-left. In axis aligned bounding boxes, Min = top-left, Max = bottom-right.
- - This codebase is also optimized to yield decent performances with typical "Debug" builds settings.
- Please make sure you have asserts enabled (IM_ASSERT redirects to assert() by default, but can be redirected).
If you get an assert, read the messages and comments around the assert.
- - C++: this is a very C-ish codebase: we don't rely on C++11, we don't include any C++ headers, and ImGui:: is a namespace.
- - C++: ImVec2/ImVec4 do not expose math operators by default, because it is expected that you use your own math types.
- See FAQ "How can I use my own math types instead of ImVec2/ImVec4?" for details about setting up imconfig.h for that.
- However, imgui_internal.h can optionally export math operators for ImVec2/ImVec4, which we use in this codebase.
- - C++: pay attention that ImVector<> manipulates plain-old-data and does not honor construction/destruction (avoid using it in your code!).
+ - This codebase aims to be highly optimized:
+ - A typical idle frame should never call malloc/free.
+ - We rely on a maximum of constant-time or O(N) algorithms. Limiting searches/scans as much as possible.
+ - We put particular energy in making sure performances are decent with typical "Debug" build settings as well.
+ Which mean we tend to avoid over-relying on "zero-cost abstraction" as they aren't zero-cost at all.
+ - This codebase aims to be both highly opinionated and highly flexible:
+ - This code works because of the things it choose to solve or not solve.
+ - C++: this is a pragmatic C-ish codebase: we don't use fancy C++ features, we don't include C++ headers,
+ and ImGui:: is a namespace. We rarely use member functions (and when we did, I am mostly regretting it now).
+ This is to increase compatibility, increase maintainability and facilitate use from other languages.
+ - C++: ImVec2/ImVec4 do not expose math operators by default, because it is expected that you use your own math types.
+ See FAQ "How can I use my own math types instead of ImVec2/ImVec4?" for details about setting up imconfig.h for that.
+ We can can optionally export math operators for ImVec2/ImVec4 using IMGUI_DEFINE_MATH_OPERATORS, which we use internally.
+ - C++: pay attention that ImVector<> manipulates plain-old-data and does not honor construction/destruction
+ (so don't use ImVector in your code or at our own risk!).
+ - Building: We don't use nor mandate a build system for the main library.
+ This is in an effort to ensure that it works in the real world aka with any esoteric build setup.
+ This is also because providing a build system for the main library would be of little-value.
+ The build problems are almost never coming from the main library but from specific backends.
HOW TO UPDATE TO A NEWER VERSION OF DEAR IMGUI
----------------------------------------------
+ - Update submodule or copy/overwrite every file.
+ - About imconfig.h:
+ - You may modify your copy of imconfig.h, in this case don't overwrite it.
+ - or you may locally branch to modify imconfig.h and merge/rebase latest.
+ - or you may '#define IMGUI_USER_CONFIG "my_config_file.h"' globally from your build system to
+ specify a custom path for your imconfig.h file and instead not have to modify the default one.
+
- Overwrite all the sources files except for imconfig.h (if you have modified your copy of imconfig.h)
- Or maintain your own branch where you have imconfig.h modified as a top-most commit which you can regularly rebase over "master".
- You can also use '#define IMGUI_USER_CONFIG "my_config_file.h" to redirect configuration to your own file.
@@ -172,11 +251,12 @@ CODE
from the public API. If you have a problem with a missing function/symbols, search for its name in the code, there will
likely be a comment about it. Please report any issue to the GitHub page!
- To find out usage of old API, you can add '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' in your configuration file.
- - Try to keep your copy of Dear ImGui reasonably up to date.
+ - Try to keep your copy of Dear ImGui reasonably up to date!
GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE
---------------------------------------------------------------
+ - See https://github.com/ocornut/imgui/wiki/Getting-Started.
- Run and study the examples and demo in imgui_demo.cpp to get acquainted with the library.
- In the majority of cases you should be able to use unmodified backends files available in the backends/ folder.
- Add the Dear ImGui source files + selected backend source files to your projects or using your preferred build system.
@@ -240,7 +320,7 @@ CODE
// Build and load the texture atlas into a texture
// (In the examples/ app this is usually done within the ImGui_ImplXXX_Init() function from one of the demo Renderer)
int width, height;
- unsigned char* pixels = NULL;
+ unsigned char* pixels = nullptr;
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
// At this point you've got the texture data and you need to upload that to your graphic system:
@@ -284,7 +364,7 @@ CODE
To decide whether to dispatch mouse/keyboard inputs to Dear ImGui to the rest of your application,
you should read the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags!
- Please read the FAQ and example applications for details about this!
+ Please read the FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" about this.
HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE
@@ -343,40 +423,6 @@ CODE
}
- USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS
- ------------------------------------------
- - The gamepad/keyboard navigation is fairly functional and keeps being improved.
- - Gamepad support is particularly useful to use Dear ImGui on a console system (e.g. PlayStation, Switch, Xbox) without a mouse!
- - The initial focus was to support game controllers, but keyboard is becoming increasingly and decently usable.
- - Keyboard:
- - Application: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable.
- - When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard),
- the io.WantCaptureKeyboard flag will be set. For more advanced uses, you may want to read from:
- - io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs flag set.
- - io.NavVisible: true when the navigation cursor is visible (and usually goes false when mouse is used).
- - or query focus information with e.g. IsWindowFocused(ImGuiFocusedFlags_AnyWindow), IsItemFocused() etc. functions.
- Please reach out if you think the game vs navigation input sharing could be improved.
- - Gamepad:
- - Application: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable.
- - Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + call io.AddKeyEvent/AddKeyAnalogEvent() with ImGuiKey_Gamepad_XXX keys.
- For analog values (0.0f to 1.0f), backend is responsible to handling a dead-zone and rescaling inputs accordingly.
- Backend code will probably need to transform your raw inputs (such as e.g. remapping your 0.2..0.9 raw input range to 0.0..1.0 imgui range, etc.).
- - BEFORE 1.87, BACKENDS USED TO WRITE TO io.NavInputs[]. This is now obsolete. Please call io functions instead!
- - You can download PNG/PSD files depicting the gamepad controls for common controllers at: http://dearimgui.org/controls_sheets
- - If you need to share inputs between your game and the Dear ImGui interface, the easiest approach is to go all-or-nothing,
- with a buttons combo to toggle the target. Please reach out if you think the game vs navigation input sharing could be improved.
- - Mouse:
- - PS4/PS5 users: Consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick as a mouse-emulation fallback.
- - Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + uSynergy.c (on your console/tablet/phone app) to share your PC mouse/keyboard.
- - On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the ImGuiConfigFlags_NavEnableSetMousePos flag.
- Enabling ImGuiConfigFlags_NavEnableSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs dear imgui to move your mouse cursor along with navigation movements.
- When enabled, the NewFrame() function may alter 'io.MousePos' and set 'io.WantSetMousePos' to notify you that it wants the mouse cursor to be moved.
- When that happens your backend NEEDS to move the OS or underlying mouse cursor on the next frame. Some of the backends in examples/ do that.
- (If you set the NavEnableSetMousePos flag but don't honor 'io.WantSetMousePos' properly, imgui will misbehave as it will see your mouse moving back and forth!)
- (In a setup when you may not have easy control over the mouse cursor, e.g. uSynergy.c doesn't expose moving remote mouse cursor, you may want
- to set a boolean to ignore your other external mouse positions until the external source is moved again.)
-
-
API BREAKING CHANGES
====================
@@ -385,16 +431,196 @@ CODE
When you are not sure about an old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
- - 2022/10/26 (1.89) - commented out redirecting OpenPopupContextItem() which was briefly the name of OpenPopupOnItemClick() from 1.77 to 1.79.
- - 2022/10/12 (1.89) - removed runtime patching of invalid "%f"/"%0.f" format strings for DragInt()/SliderInt(). This was obsoleted in 1.61 (May 2018). See 1.61 changelog for details.
- - 2022/09/26 (1.89) - renamed and merged keyboard modifiers key enums and flags into a same set. Kept inline redirection enums (will obsolete).
- - ImGuiKey_ModCtrl and ImGuiModFlags_Ctrl -> ImGuiMod_Ctrl
- - ImGuiKey_ModShift and ImGuiModFlags_Shift -> ImGuiMod_Shift
- - ImGuiKey_ModAlt and ImGuiModFlags_Alt -> ImGuiMod_Alt
- - ImGuiKey_ModSuper and ImGuiModFlags_Super -> ImGuiMod_Super
- the ImGuiKey_ModXXX were introduced in 1.87 and mostly used by backends.
- the ImGuiModFlags_XXX have been exposed in imgui.h but not really used by any public api only by third-party extensions.
- exceptionally commenting out the older ImGuiKeyModFlags_XXX names ahead of obsolescence schedule to reduce confusion and because they were not meant to be used anyway.
+ - 2025/03/05 (1.91.9) - BeginMenu(): Internals: reworked mangling of menu windows to use "###Menu_00" etc. instead of "##Menu_00", allowing them to also store the menu name before it. This shouldn't affect code unless directly accessing menu window from their mangled name.
+ - 2025/02/27 (1.91.9) - Image(): removed 'tint_col' and 'border_col' parameter from Image() function. Added ImageWithBg() replacement. (#8131, #8238)
+ - old: void Image (ImTextureID tex_id, ImVec2 image_size, ImVec2 uv0 = (0,0), ImVec2 uv1 = (1,1), ImVec4 tint_col = (1,1,1,1), ImVec4 border_col = (0,0,0,0));
+ - new: void Image (ImTextureID tex_id, ImVec2 image_size, ImVec2 uv0 = (0,0), ImVec2 uv1 = (1,1));
+ - new: void ImageWithBg(ImTextureID tex_id, ImVec2 image_size, ImVec2 uv0 = (0,0), ImVec2 uv1 = (1,1), ImVec4 bg_col = (0,0,0,0), ImVec4 tint_col = (1,1,1,1));
+ - TL;DR: 'border_col' had misleading side-effect on layout, 'bg_col' was missing, parameter order couldn't be consistent with ImageButton().
+ - new behavior always use ImGuiCol_Border color + style.ImageBorderSize / ImGuiStyleVar_ImageBorderSize.
+ - old behavior altered border size (and therefore layout) based on border color's alpha, which caused variety of problems + old behavior a fixed 1.0f for border size which was not tweakable.
+ - kept legacy signature (will obsolete), which mimics the old behavior, but uses Max(1.0f, style.ImageBorderSize) when border_col is specified.
+ - added ImageWithBg() function which has both 'bg_col' (which was missing) and 'tint_col'. It was impossible to add 'bg_col' to Image() with a parameter order consistent with other functions, so we decided to remove 'tint_col' and introduce ImageWithBg().
+ - 2025/02/25 (1.91.9) - internals: fonts: ImFontAtlas::ConfigData[] has been renamed to ImFontAtlas::Sources[]. ImFont::ConfigData[], ConfigDataCount has been renamed to Sources[], SourcesCount.
+ - 2025/02/06 (1.91.9) - renamed ImFontConfig::GlyphExtraSpacing.x to ImFontConfig::GlyphExtraAdvanceX.
+ - 2025/01/22 (1.91.8) - removed ImGuiColorEditFlags_AlphaPreview (made value 0): it is now the default behavior.
+ prior to 1.91.8: alpha was made opaque in the preview by default _unless_ using ImGuiColorEditFlags_AlphaPreview. We now display the preview as transparent by default. You can use ImGuiColorEditFlags_AlphaOpaque to use old behavior.
+ the new flags (ImGuiColorEditFlags_AlphaOpaque, ImGuiColorEditFlags_AlphaNoBg + existing ImGuiColorEditFlags_AlphaPreviewHalf) may be combined better and allow finer controls:
+ - 2025/01/14 (1.91.7) - renamed ImGuiTreeNodeFlags_SpanTextWidth to ImGuiTreeNodeFlags_SpanLabelWidth for consistency with other names. Kept redirection enum (will obsolete). (#6937)
+ - 2024/11/27 (1.91.6) - changed CRC32 table from CRC32-adler to CRC32c polynomial in order to be compatible with the result of SSE 4.2 instructions.
+ As a result, old .ini data may be partially lost (docking and tables information particularly).
+ Because some users have crafted and storing .ini data as a way to workaround limitations of the docking API, we are providing a '#define IMGUI_USE_LEGACY_CRC32_ADLER' compile-time option to keep using old CRC32 tables if you cannot afford invalidating old .ini data.
+ - 2024/11/06 (1.91.5) - commented/obsoleted out pre-1.87 IO system (equivalent to using IMGUI_DISABLE_OBSOLETE_KEYIO or IMGUI_DISABLE_OBSOLETE_FUNCTIONS before)
+ - io.KeyMap[] and io.KeysDown[] are removed (obsoleted February 2022).
+ - io.NavInputs[] and ImGuiNavInput are removed (obsoleted July 2022).
+ - pre-1.87 backends are not supported:
+ - backends need to call io.AddKeyEvent(), io.AddMouseEvent() instead of writing to io.KeysDown[], io.MouseDown[] fields.
+ - backends need to call io.AddKeyAnalogEvent() for gamepad values instead of writing to io.NavInputs[] fields.
+ - for more reference:
+ - read 1.87 and 1.88 part of this section or read Changelog for 1.87 and 1.88.
+ - read https://github.com/ocornut/imgui/issues/4921
+ - if you have trouble updating a very old codebase using legacy backend-specific key codes: consider updating to 1.91.4 first, then #define IMGUI_DISABLE_OBSOLETE_KEYIO, then update to latest.
+ - obsoleted ImGuiKey_COUNT (it is unusually error-prone/misleading since valid keys don't start at 0). probably use ImGuiKey_NamedKey_BEGIN/ImGuiKey_NamedKey_END?
+ - fonts: removed const qualifiers from most font functions in prevision for upcoming font improvements.
+ - 2024/10/18 (1.91.4) - renamed ImGuiCol_NavHighlight to ImGuiCol_NavCursor (for consistency with newly exposed and reworked features). Kept inline redirection enum (will obsolete).
+ - 2024/10/14 (1.91.4) - moved ImGuiConfigFlags_NavEnableSetMousePos to standalone io.ConfigNavMoveSetMousePos bool.
+ moved ImGuiConfigFlags_NavNoCaptureKeyboard to standalone io.ConfigNavCaptureKeyboard bool (note the inverted value!).
+ kept legacy names (will obsolete) + code that copies settings once the first time. Dynamically changing the old value won't work. Switch to using the new value!
+ - 2024/10/10 (1.91.4) - the typedef for ImTextureID now defaults to ImU64 instead of void*. (#1641)
+ this removes the requirement to redefine it for backends which are e.g. storing descriptor sets or other 64-bits structures when building on 32-bits archs. It therefore simplify various building scripts/helpers.
+ you may have compile-time issues if you were casting to 'void*' instead of 'ImTextureID' when passing your types to functions taking ImTextureID values, e.g. ImGui::Image().
+ in doubt it is almost always better to do an intermediate intptr_t cast, since it allows casting any pointer/integer type without warning:
+ - May warn: ImGui::Image((void*)MyTextureData, ...);
+ - May warn: ImGui::Image((void*)(intptr_t)MyTextureData, ...);
+ - Won't warn: ImGui::Image((ImTextureID)(intptr_t)MyTextureData), ...);
+ - note that you can always define ImTextureID to be your own high-level structures (with dedicated constructors) if you like.
+ - 2024/10/03 (1.91.3) - drags: treat v_min==v_max as a valid clamping range when != 0.0f. Zero is a still special value due to legacy reasons, unless using ImGuiSliderFlags_ClampZeroRange. (#7968, #3361, #76)
+ - drags: extended behavior of ImGuiSliderFlags_AlwaysClamp to include _ClampZeroRange. It considers v_min==v_max==0.0f as a valid clamping range (aka edits not allowed).
+ although unlikely, it you wish to only clamp on text input but want v_min==v_max==0.0f to mean unclamped drags, you can use _ClampOnInput instead of _AlwaysClamp. (#7968, #3361, #76)
+ - 2024/09/10 (1.91.2) - internals: using multiple overlayed ButtonBehavior() with same ID will now have io.ConfigDebugHighlightIdConflicts=true feature emit a warning. (#8030)
+ it was one of the rare case where using same ID is legal. workarounds: (1) use single ButtonBehavior() call with multiple _MouseButton flags, or (2) surround the calls with PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag()
+ - 2024/08/23 (1.91.1) - renamed ImGuiChildFlags_Border to ImGuiChildFlags_Borders for consistency. kept inline redirection flag.
+ - 2024/08/22 (1.91.1) - moved some functions from ImGuiIO to ImGuiPlatformIO structure:
+ - io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn + changed 'void* user_data' to 'ImGuiContext* ctx'. Pull your user data from platform_io.ClipboardUserData.
+ - io.SetClipboardTextFn -> platform_io.Platform_SetClipboardTextFn + same as above line.
+ - io.PlatformOpenInShellFn -> platform_io.Platform_OpenInShellFn (#7660)
+ - io.PlatformSetImeDataFn -> platform_io.Platform_SetImeDataFn
+ - io.PlatformLocaleDecimalPoint -> platform_io.Platform_LocaleDecimalPoint (#7389, #6719, #2278)
+ - access those via GetPlatformIO() instead of GetIO().
+ some were introduced very recently and often automatically setup by core library and backends, so for those we are exceptionally not maintaining a legacy redirection symbol.
+ - commented the old ImageButton() signature obsoleted in 1.89 (~August 2022). As a reminder:
+ - old ImageButton() before 1.89 used ImTextureId as item id (created issue with e.g. multiple buttons in same scope, transient texture id values, opaque computation of ID)
+ - new ImageButton() since 1.89 requires an explicit 'const char* str_id'
+ - old ImageButton() before 1.89 had frame_padding' override argument.
+ - new ImageButton() since 1.89 always use style.FramePadding, which you can freely override with PushStyleVar()/PopStyleVar().
+ - 2024/07/25 (1.91.0) - obsoleted GetContentRegionMax(), GetWindowContentRegionMin() and GetWindowContentRegionMax(). (see #7838 on GitHub for more info)
+ you should never need those functions. you can do everything with GetCursorScreenPos() and GetContentRegionAvail() in a more simple way.
+ - instead of: GetWindowContentRegionMax().x - GetCursorPos().x
+ - you can use: GetContentRegionAvail().x
+ - instead of: GetWindowContentRegionMax().x + GetWindowPos().x
+ - you can use: GetCursorScreenPos().x + GetContentRegionAvail().x // when called from left edge of window
+ - instead of: GetContentRegionMax()
+ - you can use: GetContentRegionAvail() + GetCursorScreenPos() - GetWindowPos() // right edge in local coordinates
+ - instead of: GetWindowContentRegionMax().x - GetWindowContentRegionMin().x
+ - you can use: GetContentRegionAvail() // when called from left edge of window
+ - 2024/07/15 (1.91.0) - renamed ImGuiSelectableFlags_DontClosePopups to ImGuiSelectableFlags_NoAutoClosePopups. (#1379, #1468, #2200, #4936, #5216, #7302, #7573)
+ (internals: also renamed ImGuiItemFlags_SelectableDontClosePopup into ImGuiItemFlags_AutoClosePopups with inverted behaviors)
+ - 2024/07/15 (1.91.0) - obsoleted PushButtonRepeat()/PopButtonRepeat() in favor of using new PushItemFlag(ImGuiItemFlags_ButtonRepeat, ...)/PopItemFlag().
+ - 2024/07/02 (1.91.0) - commented out obsolete ImGuiModFlags (renamed to ImGuiKeyChord in 1.89). (#4921, #456)
+ - commented out obsolete ImGuiModFlags_XXX values (renamed to ImGuiMod_XXX in 1.89). (#4921, #456)
+ - ImGuiModFlags_Ctrl -> ImGuiMod_Ctrl, ImGuiModFlags_Shift -> ImGuiMod_Shift etc.
+ - 2024/07/02 (1.91.0) - IO, IME: renamed platform IME hook and added explicit context for consistency and future-proofness.
+ - old: io.SetPlatformImeDataFn(ImGuiViewport* viewport, ImGuiPlatformImeData* data);
+ - new: io.PlatformSetImeDataFn(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data);
+ - 2024/06/21 (1.90.9) - BeginChild: added ImGuiChildFlags_NavFlattened as a replacement for the window flag ImGuiWindowFlags_NavFlattened: the feature only ever made sense for BeginChild() anyhow.
+ - old: BeginChild("Name", size, 0, ImGuiWindowFlags_NavFlattened);
+ - new: BeginChild("Name", size, ImGuiChildFlags_NavFlattened, 0);
+ - 2024/06/21 (1.90.9) - io: ClearInputKeys() (first exposed in 1.89.8) doesn't clear mouse data, newly added ClearInputMouse() does.
+ - 2024/06/20 (1.90.9) - renamed ImGuiDragDropFlags_SourceAutoExpirePayload to ImGuiDragDropFlags_PayloadAutoExpire.
+ - 2024/06/18 (1.90.9) - style: renamed ImGuiCol_TabActive -> ImGuiCol_TabSelected, ImGuiCol_TabUnfocused -> ImGuiCol_TabDimmed, ImGuiCol_TabUnfocusedActive -> ImGuiCol_TabDimmedSelected.
+ - 2024/06/10 (1.90.9) - removed old nested structure: renaming ImGuiStorage::ImGuiStoragePair type to ImGuiStoragePair (simpler for many languages).
+ - 2024/06/06 (1.90.8) - reordered ImGuiInputTextFlags values. This should not be breaking unless you are using generated headers that have values not matching the main library.
+ - 2024/06/06 (1.90.8) - removed 'ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft', was mostly unused and misleading.
+ - 2024/05/27 (1.90.7) - commented out obsolete symbols marked obsolete in 1.88 (May 2022):
+ - old: CaptureKeyboardFromApp(bool)
+ - new: SetNextFrameWantCaptureKeyboard(bool)
+ - old: CaptureMouseFromApp(bool)
+ - new: SetNextFrameWantCaptureMouse(bool)
+ - 2024/05/22 (1.90.7) - inputs (internals): renamed ImGuiKeyOwner_None to ImGuiKeyOwner_NoOwner, to make use more explicit and reduce confusion with the default it is a non-zero value and cannot be the default value (never made public, but disclosing as I expect a few users caught on owner-aware inputs).
+ - inputs (internals): renamed ImGuiInputFlags_RouteGlobalLow -> ImGuiInputFlags_RouteGlobal, ImGuiInputFlags_RouteGlobal -> ImGuiInputFlags_RouteGlobalOverFocused, ImGuiInputFlags_RouteGlobalHigh -> ImGuiInputFlags_RouteGlobalHighest.
+ - inputs (internals): Shortcut(), SetShortcutRouting(): swapped last two parameters order in function signatures:
+ - old: Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
+ - new: Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0, ImGuiID owner_id = 0);
+ - inputs (internals): owner-aware versions of IsKeyPressed(), IsKeyChordPressed(), IsMouseClicked(): swapped last two parameters order in function signatures.
+ - old: IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
+ - new: IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0);
+ - old: IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0);
+ - new: IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);
+ for various reasons those changes makes sense. They are being made because making some of those API public.
+ only past users of imgui_internal.h with the extra parameters will be affected. Added asserts for valid flags in various functions to detect _some_ misuses, BUT NOT ALL.
+ - 2024/05/16 (1.90.7) - inputs: on macOS X, Cmd and Ctrl keys are now automatically swapped by io.AddKeyEvent() as this naturally align with how macOS X uses those keys.
+ - it shouldn't really affect you unless you had custom shortcut swapping in place for macOS X apps.
+ - removed ImGuiMod_Shortcut which was previously dynamically remapping to Ctrl or Cmd/Super. It is now unnecessary to specific cross-platform idiomatic shortcuts. (#2343, #4084, #5923, #456)
+ - 2024/05/14 (1.90.7) - backends: SDL_Renderer2 and SDL_Renderer3 backend now take a SDL_Renderer* in their RenderDrawData() functions.
+ - 2024/04/18 (1.90.6) - TreeNode: Fixed a layout inconsistency when using an empty/hidden label followed by a SameLine() call. (#7505, #282)
+ - old: TreeNode("##Hidden"); SameLine(); Text("Hello"); // <-- This was actually incorrect! BUT appeared to look ok with the default style where ItemSpacing.x == FramePadding.x * 2 (it didn't look aligned otherwise).
+ - new: TreeNode("##Hidden"); SameLine(0, 0); Text("Hello"); // <-- This is correct for all styles values.
+ with the fix, IF you were successfully using TreeNode("")+SameLine(); you will now have extra spacing between your TreeNode and the following item.
+ You'll need to change the SameLine() call to SameLine(0,0) to remove this extraneous spacing. This seemed like the more sensible fix that's not making things less consistent.
+ (Note: when using this idiom you are likely to also use ImGuiTreeNodeFlags_SpanAvailWidth).
+ - 2024/03/18 (1.90.5) - merged the radius_x/radius_y parameters in ImDrawList::AddEllipse(), AddEllipseFilled() and PathEllipticalArcTo() into a single ImVec2 parameter. Exceptionally, because those functions were added in 1.90, we are not adding inline redirection functions. The transition is easy and should affect few users. (#2743, #7417)
+ - 2024/03/08 (1.90.5) - inputs: more formally obsoleted GetKeyIndex() when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is set. It has been unnecessary and a no-op since 1.87 (it returns the same value as passed when used with a 1.87+ backend using io.AddKeyEvent() function). (#4921)
+ - IsKeyPressed(GetKeyIndex(ImGuiKey_XXX)) -> use IsKeyPressed(ImGuiKey_XXX)
+ - 2024/01/15 (1.90.2) - commented out obsolete ImGuiIO::ImeWindowHandle marked obsolete in 1.87, favor of writing to 'void* ImGuiViewport::PlatformHandleRaw'.
+ - 2023/12/19 (1.90.1) - commented out obsolete ImGuiKey_KeyPadEnter redirection to ImGuiKey_KeypadEnter.
+ - 2023/11/06 (1.90.1) - removed CalcListClipping() marked obsolete in 1.86. Prefer using ImGuiListClipper which can return non-contiguous ranges.
+ - 2023/11/05 (1.90.1) - imgui_freetype: commented out ImGuiFreeType::BuildFontAtlas() obsoleted in 1.81. prefer using #define IMGUI_ENABLE_FREETYPE or see commented code for manual calls.
+ - 2023/11/05 (1.90.1) - internals,columns: commented out legacy ImGuiColumnsFlags_XXX symbols redirecting to ImGuiOldColumnsFlags_XXX, obsoleted from imgui_internal.h in 1.80.
+ - 2023/11/09 (1.90.0) - removed IM_OFFSETOF() macro in favor of using offsetof() available in C++11. Kept redirection define (will obsolete).
+ - 2023/11/07 (1.90.0) - removed BeginChildFrame()/EndChildFrame() in favor of using BeginChild() with the ImGuiChildFlags_FrameStyle flag. kept inline redirection function (will obsolete).
+ those functions were merely PushStyle/PopStyle helpers, the removal isn't so much motivated by needing to add the feature in BeginChild(), but by the necessity to avoid BeginChildFrame() signature mismatching BeginChild() signature and features.
+ - 2023/11/02 (1.90.0) - BeginChild: upgraded 'bool border = true' parameter to 'ImGuiChildFlags flags' type, added ImGuiChildFlags_Border equivalent. As with our prior "bool-to-flags" API updates, the ImGuiChildFlags_Border value is guaranteed to be == true forever to ensure a smoother transition, meaning all existing calls will still work.
+ - old: BeginChild("Name", size, true)
+ - new: BeginChild("Name", size, ImGuiChildFlags_Border)
+ - old: BeginChild("Name", size, false)
+ - new: BeginChild("Name", size) or BeginChild("Name", 0) or BeginChild("Name", size, ImGuiChildFlags_None)
+ **AMEND FROM THE FUTURE: from 1.91.1, 'ImGuiChildFlags_Border' is called 'ImGuiChildFlags_Borders'**
+ - 2023/11/02 (1.90.0) - BeginChild: added child-flag ImGuiChildFlags_AlwaysUseWindowPadding as a replacement for the window-flag ImGuiWindowFlags_AlwaysUseWindowPadding: the feature only ever made sense for BeginChild() anyhow.
+ - old: BeginChild("Name", size, 0, ImGuiWindowFlags_AlwaysUseWindowPadding);
+ - new: BeginChild("Name", size, ImGuiChildFlags_AlwaysUseWindowPadding, 0);
+ - 2023/09/27 (1.90.0) - io: removed io.MetricsActiveAllocations introduced in 1.63. Same as 'g.DebugMemAllocCount - g.DebugMemFreeCount' (still displayed in Metrics, unlikely to be accessed by end-user).
+ - 2023/09/26 (1.90.0) - debug tools: Renamed ShowStackToolWindow() ("Stack Tool") to ShowIDStackToolWindow() ("ID Stack Tool"), as earlier name was misleading. Kept inline redirection function. (#4631)
+ - 2023/09/15 (1.90.0) - ListBox, Combo: changed signature of "name getter" callback in old one-liner ListBox()/Combo() apis. kept inline redirection function (will obsolete).
+ - old: bool Combo(const char* label, int* current_item, bool (*getter)(void* user_data, int idx, const char** out_text), ...)
+ - new: bool Combo(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), ...);
+ - old: bool ListBox(const char* label, int* current_item, bool (*getting)(void* user_data, int idx, const char** out_text), ...);
+ - new: bool ListBox(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), ...);
+ - 2023/09/08 (1.90.0) - commented out obsolete redirecting functions:
+ - GetWindowContentRegionWidth() -> use GetWindowContentRegionMax().x - GetWindowContentRegionMin().x. Consider that generally 'GetContentRegionAvail().x' is more useful.
+ - ImDrawCornerFlags_XXX -> use ImDrawFlags_RoundCornersXXX flags. Read 1.82 Changelog for details + grep commented names in sources.
+ - commented out runtime support for hardcoded ~0 or 0x01..0x0F rounding flags values for AddRect()/AddRectFilled()/PathRect()/AddImageRounded() -> use ImDrawFlags_RoundCornersXXX flags. Read 1.82 Changelog for details
+ - 2023/08/25 (1.89.9) - clipper: Renamed IncludeRangeByIndices() (also called ForceDisplayRangeByIndices() before 1.89.6) to IncludeItemsByIndex(). Kept inline redirection function. Sorry!
+ - 2023/07/12 (1.89.8) - ImDrawData: CmdLists now owned, changed from ImDrawList** to ImVector<ImDrawList*>. Majority of users shouldn't be affected, but you cannot compare to NULL nor reassign manually anymore. Instead use AddDrawList(). (#6406, #4879, #1878)
+ - 2023/06/28 (1.89.7) - overlapping items: obsoleted 'SetItemAllowOverlap()' (called after item) in favor of calling 'SetNextItemAllowOverlap()' (called before item). 'SetItemAllowOverlap()' didn't and couldn't work reliably since 1.89 (2022-11-15).
+ - 2023/06/28 (1.89.7) - overlapping items: renamed 'ImGuiTreeNodeFlags_AllowItemOverlap' to 'ImGuiTreeNodeFlags_AllowOverlap', 'ImGuiSelectableFlags_AllowItemOverlap' to 'ImGuiSelectableFlags_AllowOverlap'. Kept redirecting enums (will obsolete).
+ - 2023/06/28 (1.89.7) - overlapping items: IsItemHovered() now by default return false when querying an item using AllowOverlap mode which is being overlapped. Use ImGuiHoveredFlags_AllowWhenOverlappedByItem to revert to old behavior.
+ - 2023/06/28 (1.89.7) - overlapping items: Selectable and TreeNode don't allow overlap when active so overlapping widgets won't appear as hovered. While this fixes a common small visual issue, it also means that calling IsItemHovered() after a non-reactive elements - e.g. Text() - overlapping an active one may fail if you don't use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem). (#6610)
+ - 2023/06/20 (1.89.7) - moved io.HoverDelayShort/io.HoverDelayNormal to style.HoverDelayShort/style.HoverDelayNormal. As the fields were added in 1.89 and expected to be left unchanged by most users, or only tweaked once during app initialization, we are exceptionally accepting the breakage.
+ - 2023/05/30 (1.89.6) - backends: renamed "imgui_impl_sdlrenderer.cpp" to "imgui_impl_sdlrenderer2.cpp" and "imgui_impl_sdlrenderer.h" to "imgui_impl_sdlrenderer2.h". This is in prevision for the future release of SDL3.
+ - 2023/05/22 (1.89.6) - listbox: commented out obsolete/redirecting functions that were marked obsolete more than two years ago:
+ - ListBoxHeader() -> use BeginListBox() (note how two variants of ListBoxHeader() existed. Check commented versions in imgui.h for reference)
+ - ListBoxFooter() -> use EndListBox()
+ - 2023/05/15 (1.89.6) - clipper: commented out obsolete redirection constructor 'ImGuiListClipper(int items_count, float items_height = -1.0f)' that was marked obsolete in 1.79. Use default constructor + clipper.Begin().
+ - 2023/05/15 (1.89.6) - clipper: renamed ImGuiListClipper::ForceDisplayRangeByIndices() to ImGuiListClipper::IncludeRangeByIndices().
+ - 2023/03/14 (1.89.4) - commented out redirecting enums/functions names that were marked obsolete two years ago:
+ - ImGuiSliderFlags_ClampOnInput -> use ImGuiSliderFlags_AlwaysClamp
+ - ImGuiInputTextFlags_AlwaysInsertMode -> use ImGuiInputTextFlags_AlwaysOverwrite
+ - ImDrawList::AddBezierCurve() -> use ImDrawList::AddBezierCubic()
+ - ImDrawList::PathBezierCurveTo() -> use ImDrawList::PathBezierCubicCurveTo()
+ - 2023/03/09 (1.89.4) - renamed PushAllowKeyboardFocus()/PopAllowKeyboardFocus() to PushTabStop()/PopTabStop(). Kept inline redirection functions (will obsolete).
+ - 2023/03/09 (1.89.4) - tooltips: Added 'bool' return value to BeginTooltip() for API consistency. Please only submit contents and call EndTooltip() if BeginTooltip() returns true. In reality the function will _currently_ always return true, but further changes down the line may change this, best to clarify API sooner.
+ - 2023/02/15 (1.89.4) - moved the optional "courtesy maths operators" implementation from imgui_internal.h in imgui.h.
+ Even though we encourage using your own maths types and operators by setting up IM_VEC2_CLASS_EXTRA,
+ it has been frequently requested by people to use our own. We had an opt-in define which was
+ previously fulfilled in imgui_internal.h. It is now fulfilled in imgui.h. (#6164)
+ - OK: #define IMGUI_DEFINE_MATH_OPERATORS / #include "imgui.h" / #include "imgui_internal.h"
+ - Error: #include "imgui.h" / #define IMGUI_DEFINE_MATH_OPERATORS / #include "imgui_internal.h"
+ - 2023/02/07 (1.89.3) - backends: renamed "imgui_impl_sdl.cpp" to "imgui_impl_sdl2.cpp" and "imgui_impl_sdl.h" to "imgui_impl_sdl2.h". (#6146) This is in prevision for the future release of SDL3.
+ - 2022/10/26 (1.89) - commented out redirecting OpenPopupContextItem() which was briefly the name of OpenPopupOnItemClick() from 1.77 to 1.79.
+ - 2022/10/12 (1.89) - removed runtime patching of invalid "%f"/"%0.f" format strings for DragInt()/SliderInt(). This was obsoleted in 1.61 (May 2018). See 1.61 changelog for details.
+ - 2022/09/26 (1.89) - renamed and merged keyboard modifiers key enums and flags into a same set. Kept inline redirection enums (will obsolete).
+ - ImGuiKey_ModCtrl and ImGuiModFlags_Ctrl -> ImGuiMod_Ctrl
+ - ImGuiKey_ModShift and ImGuiModFlags_Shift -> ImGuiMod_Shift
+ - ImGuiKey_ModAlt and ImGuiModFlags_Alt -> ImGuiMod_Alt
+ - ImGuiKey_ModSuper and ImGuiModFlags_Super -> ImGuiMod_Super
+ the ImGuiKey_ModXXX were introduced in 1.87 and mostly used by backends.
+ the ImGuiModFlags_XXX have been exposed in imgui.h but not really used by any public api only by third-party extensions.
+ exceptionally commenting out the older ImGuiKeyModFlags_XXX names ahead of obsolescence schedule to reduce confusion and because they were not meant to be used anyway.
+ - 2022/09/20 (1.89) - ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers.
+ this will require uses of legacy backend-dependent indices to be casted, e.g.
+ - with imgui_impl_glfw: IsKeyPressed(GLFW_KEY_A) -> IsKeyPressed((ImGuiKey)GLFW_KEY_A);
+ - with imgui_impl_win32: IsKeyPressed('A') -> IsKeyPressed((ImGuiKey)'A')
+ - etc. However if you are upgrading code you might well use the better, backend-agnostic IsKeyPressed(ImGuiKey_A) now!
- 2022/09/12 (1.89) - removed the bizarre legacy default argument for 'TreePush(const void* ptr = NULL)', always pass a pointer value explicitly. NULL/nullptr is ok but require cast, e.g. TreePush((void*)nullptr);
- 2022/09/05 (1.89) - commented out redirecting functions/enums names that were marked obsolete in 1.77 and 1.78 (June 2020):
- DragScalar(), DragScalarN(), DragFloat(), DragFloat2(), DragFloat3(), DragFloat4(): For old signatures ending with (..., const char* format, float power = 1.0f) -> use (..., format ImGuiSliderFlags_Logarithmic) if power != 1.0f.
@@ -430,7 +656,7 @@ CODE
- 2022/04/05 (1.88) - inputs: renamed ImGuiKeyModFlags to ImGuiModFlags. Kept inline redirection enums (will obsolete). This was never used in public API functions but technically present in imgui.h and ImGuiIO.
- 2022/01/20 (1.87) - inputs: reworded gamepad IO.
- Backend writing to io.NavInputs[] -> backend should call io.AddKeyEvent()/io.AddKeyAnalogEvent() with ImGuiKey_GamepadXXX values.
- - 2022/01/19 (1.87) - sliders, drags: removed support for legacy arithmetic operators (+,+-,*,/) when inputing text. This doesn't break any api/code but a feature that used to be accessible by end-users (which seemingly no one used).
+ - 2022/01/19 (1.87) - sliders, drags: removed support for legacy arithmetic operators (+,+-,*,/) when inputting text. This doesn't break any api/code but a feature that used to be accessible by end-users (which seemingly no one used).
- 2022/01/17 (1.87) - inputs: reworked mouse IO.
- Backend writing to io.MousePos -> backend should call io.AddMousePosEvent()
- Backend writing to io.MouseDown[] -> backend should call io.AddMouseButtonEvent()
@@ -438,7 +664,7 @@ CODE
- Backend writing to io.MouseHoveredViewport -> backend should call io.AddMouseViewportEvent() [Docking branch w/ multi-viewports only]
note: for all calls to IO new functions, the Dear ImGui context should be bound/current.
read https://github.com/ocornut/imgui/issues/4921 for details.
- - 2022/01/10 (1.87) - inputs: reworked keyboard IO. Removed io.KeyMap[], io.KeysDown[] in favor of calling io.AddKeyEvent(). Removed GetKeyIndex(), now unecessary. All IsKeyXXX() functions now take ImGuiKey values. All features are still functional until IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Read Changelog and Release Notes for details.
+ - 2022/01/10 (1.87) - inputs: reworked keyboard IO. Removed io.KeyMap[], io.KeysDown[] in favor of calling io.AddKeyEvent(), ImGui::IsKeyDown(). Removed GetKeyIndex(), now unnecessary. All IsKeyXXX() functions now take ImGuiKey values. All features are still functional until IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Read Changelog and Release Notes for details.
- IsKeyPressed(MY_NATIVE_KEY_XXX) -> use IsKeyPressed(ImGuiKey_XXX)
- IsKeyPressed(GetKeyIndex(ImGuiKey_XXX)) -> use IsKeyPressed(ImGuiKey_XXX)
- Backend writing to io.KeyMap[],io.KeysDown[] -> backend should call io.AddKeyEvent() (+ call io.SetKeyEventNativeData() if you want legacy user code to stil function with legacy key codes).
@@ -752,7 +978,7 @@ CODE
================================
Read all answers online:
- https://www.dearimgui.org/faq or https://github.com/ocornut/imgui/blob/master/docs/FAQ.md (same url)
+ https://www.dearimgui.com/faq or https://github.com/ocornut/imgui/blob/master/docs/FAQ.md (same url)
Read all answers locally (with a text editor or ideally a Markdown viewer):
docs/FAQ.md
Some answers are copied down here to facilitate searching in code.
@@ -762,11 +988,12 @@ CODE
Q: Where is the documentation?
A: This library is poorly documented at the moment and expects the user to be acquainted with C/C++.
- - Run the examples/ and explore them.
+ - Run the examples/ applications and explore them.
+ - Read Getting Started (https://github.com/ocornut/imgui/wiki/Getting-Started) guide.
- See demo code in imgui_demo.cpp and particularly the ImGui::ShowDemoWindow() function.
- The demo covers most features of Dear ImGui, so you can read the code and see its output.
- See documentation and comments at the top of imgui.cpp + effectively imgui.h.
- - Dozens of standalone example applications using e.g. OpenGL/DirectX are provided in the
+ - 20+ standalone example applications using e.g. OpenGL/DirectX are provided in the
examples/ folder to explain how to integrate Dear ImGui with your own engine/application.
- The Wiki (https://github.com/ocornut/imgui/wiki) has many resources and links.
- The Glossary (https://github.com/ocornut/imgui/wiki/Glossary) page also may be useful.
@@ -776,24 +1003,24 @@ CODE
Q: What is this library called?
Q: Which version should I get?
>> This library is called "Dear ImGui", please don't call it "ImGui" :)
- >> See https://www.dearimgui.org/faq for details.
+ >> See https://www.dearimgui.com/faq for details.
Q&A: Integration
================
Q: How to get started?
- A: Read 'PROGRAMMER GUIDE' above. Read examples/README.txt.
+ A: Read https://github.com/ocornut/imgui/wiki/Getting-Started. Read 'PROGRAMMER GUIDE' above. Read examples/README.txt.
Q: How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?
A: You should read the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags!
- >> See https://www.dearimgui.org/faq for a fully detailed answer. You really want to read this.
+ >> See https://www.dearimgui.com/faq for a fully detailed answer. You really want to read this.
- Q. How can I enable keyboard controls?
- Q: How can I use this without a mouse, without a keyboard or without a screen? (gamepad, input share, remote display)
+ Q. How can I enable keyboard or gamepad controls?
+ Q: How can I use this on a machine without mouse, keyboard or screen? (input share, remote display)
Q: I integrated Dear ImGui in my engine and little squares are showing instead of text...
Q: I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around...
Q: I integrated Dear ImGui in my engine and some elements are displaying outside their expected windows boundaries...
- >> See https://www.dearimgui.org/faq
+ >> See https://www.dearimgui.com/faq
Q&A: Usage
----------
@@ -804,10 +1031,10 @@ CODE
- How can I have multiple widgets with the same label?
- How can I have multiple windows with the same label?
Q: How can I display an image? What is ImTextureID, how does it work?
- Q: How can I use my own math types instead of ImVec2/ImVec4?
+ Q: How can I use my own math types instead of ImVec2?
Q: How can I interact with standard C++ types (such as std::string and std::vector)?
Q: How can I display custom shapes? (using low-level ImDrawList API)
- >> See https://www.dearimgui.org/faq
+ >> See https://www.dearimgui.com/faq
Q&A: Fonts, Text
================
@@ -817,7 +1044,7 @@ CODE
Q: How can I easily use icons in my application?
Q: How can I load multiple fonts?
Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?
- >> See https://www.dearimgui.org/faq and https://github.com/ocornut/imgui/edit/master/docs/FONTS.md
+ >> See https://www.dearimgui.com/faq and https://github.com/ocornut/imgui/blob/master/docs/FONTS.md
Q&A: Concerns
=============
@@ -826,18 +1053,18 @@ CODE
Q: Can you create elaborate/serious tools with Dear ImGui?
Q: Can you reskin the look of Dear ImGui?
Q: Why using C++ (as opposed to C)?
- >> See https://www.dearimgui.org/faq
+ >> See https://www.dearimgui.com/faq
Q&A: Community
==============
Q: How can I help?
- A: - Businesses: please reach out to "contact AT dearimgui.com" if you work in a place using Dear ImGui!
+ A: - Businesses: please reach out to "omar AT dearimgui DOT com" if you work in a place using Dear ImGui!
We can discuss ways for your company to fund development via invoiced technical support, maintenance or sponsoring contacts.
- This is among the most useful thing you can do for Dear ImGui. With increased funding, we can hire more people working on this project.
- - Individuals: you can support continued development via PayPal donations. See README.
- - If you are experienced with Dear ImGui and C++, look at the GitHub issues, look at the Wiki, read docs/TODO.txt
- and see how you want to help and can help!
+ This is among the most useful thing you can do for Dear ImGui. With increased funding, we sustain and grow work on this project.
+ >>> See https://github.com/ocornut/imgui/wiki/Funding
+ - Businesses: you can also purchase licenses for the Dear ImGui Automation/Test Engine.
+ - If you are experienced with Dear ImGui and C++, look at the GitHub issues, look at the Wiki, and see how you want to help and can help!
- Disclose your usage of Dear ImGui via a dev blog post, a tweet, a screenshot, a mention somewhere etc.
You may post screenshot or links in the gallery threads. Visuals are ideal as they inspire other programmers.
But even without visuals, disclosing your use of dear imgui helps the library grow credibility, and help other teams and programmers with taking decisions.
@@ -853,21 +1080,17 @@ CODE
#define _CRT_SECURE_NO_WARNINGS
#endif
-#include "imgui.h"
-#ifndef IMGUI_DISABLE
-
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
+
+#include "imgui.h"
+#ifndef IMGUI_DISABLE
#include "imgui_internal.h"
// System includes
#include <stdio.h> // vsnprintf, sscanf, printf
-#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
-#include <stddef.h> // intptr_t
-#else
#include <stdint.h> // intptr_t
-#endif
// [Windows] On non-Visual Studio compilers, we default to IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS unless explicitly enabled
#if defined(_WIN32) && !defined(_MSC_VER) && !defined(IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS)
@@ -875,7 +1098,7 @@ CODE
#endif
// [Windows] OS specific includes (optional)
-#if defined(_WIN32) && defined(IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS)
+#if defined(_WIN32) && defined(IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) && defined(IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS)
#define IMGUI_DISABLE_WIN32_FUNCTIONS
#endif
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS)
@@ -890,9 +1113,11 @@ CODE
#else
#include <windows.h>
#endif
-#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) // UWP doesn't have all Win32 functions
+#if defined(WINAPI_FAMILY) && ((defined(WINAPI_FAMILY_APP) && WINAPI_FAMILY == WINAPI_FAMILY_APP) || (defined(WINAPI_FAMILY_GAMES) && WINAPI_FAMILY == WINAPI_FAMILY_GAMES))
+// The UWP and GDK Win32 API subsets don't support clipboard nor IME functions
#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
+#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
#endif
#endif
@@ -904,8 +1129,6 @@ CODE
// Visual Studio warnings
#ifdef _MSC_VER
#pragma warning (disable: 4127) // condition expression is constant
-#pragma warning (disable: 4201) // nonstandard extension used: nameless struct/union
-#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
#if defined(_MSC_VER) && _MSC_VER >= 1922 // MSVC 2019 16.2 or later
#pragma warning (disable: 5054) // operator '|': deprecated between enumerations of different types
@@ -923,52 +1146,58 @@ CODE
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants (typically 0.0f) is ok.
+#pragma clang diagnostic ignored "-Wformat" // warning: format specifies type 'int' but the argument has type 'unsigned int'
#pragma clang diagnostic ignored "-Wformat-nonliteral" // warning: format string is not a string literal // passing non-literal to vsnformat(). yes, user passing incorrect format strings can crash the code.
+#pragma clang diagnostic ignored "-Wformat-pedantic" // warning: format specifies type 'void *' but the argument has type 'xxxx *' // unreasonable, would lead to casting every %p arg to void*. probably enabled by -pedantic.
#pragma clang diagnostic ignored "-Wexit-time-destructors" // warning: declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals.
#pragma clang diagnostic ignored "-Wglobal-constructors" // warning: declaration requires a global destructor // similar to above, not sure what the exact difference is.
#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
-#pragma clang diagnostic ignored "-Wformat-pedantic" // warning: format specifies type 'void *' but the argument has type 'xxxx *' // unreasonable, would lead to casting every %p arg to void*. probably enabled by -pedantic.
#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning: cast to 'void *' from smaller integer type 'int'
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant // some standard header variations use #define NULL 0
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
+#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
+#pragma clang diagnostic ignored "-Wswitch-default" // warning: 'switch' missing 'default' label
#elif defined(__GNUC__)
// We disable -Wpragmas because GCC doesn't provide a has_warning equivalent and some forks/patches may not follow the warning/version association.
-#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
-#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
-#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
-#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'void*', but argument 6 has type 'ImGuiWindow*'
-#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
-#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
-#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
-#pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false
-#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
+#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
+#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
+#pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe
+#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'int'/'void*', but argument X has type 'unsigned int'/'ImGuiWindow*'
+#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
+#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
+#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
+#pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false
+#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
+#pragma GCC diagnostic ignored "-Wcast-qual" // warning: cast from type 'const xxxx *' to type 'xxxx *' casts away qualifiers
#endif
// Debug options
-#define IMGUI_DEBUG_NAV_SCORING 0 // Display navigation scoring preview when hovering items. Display last moving direction matches when holding CTRL
+#define IMGUI_DEBUG_NAV_SCORING 0 // Display navigation scoring preview when hovering items. Hold CTRL to display for all candidates. CTRL+Arrow to change last direction.
#define IMGUI_DEBUG_NAV_RECTS 0 // Display the reference navigation rectangle for each window
-#define IMGUI_DEBUG_INI_SETTINGS 0 // Save additional comments in .ini file (particularly helps for Docking, but makes saving slower)
// When using CTRL+TAB (or Gamepad Square+L/R) we delay the visual a little in order to reduce visual noise doing a fast switch.
static const float NAV_WINDOWING_HIGHLIGHT_DELAY = 0.20f; // Time before the highlight and screen dimming starts fading in
static const float NAV_WINDOWING_LIST_APPEAR_DELAY = 0.15f; // Time before the window list starts to appear
-
-// Window resizing from edges (when io.ConfigWindowsResizeFromEdges = true and ImGuiBackendFlags_HasMouseCursors is set in io.BackendFlags by backend)
-static const float WINDOWS_HOVER_PADDING = 4.0f; // Extend outside window for hovering/resizing (maxxed with TouchPadding) and inside windows for borders. Affect FindHoveredWindow().
+static const float NAV_ACTIVATE_HIGHLIGHT_TIMER = 0.10f; // Time to highlight an item activated by a shortcut.
static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER = 0.04f; // Reduce visual noise by only highlighting the border after a certain time.
static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 0.70f; // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certain time, unless mouse moved.
+// Tooltip offset
+static const ImVec2 TOOLTIP_DEFAULT_OFFSET_MOUSE = ImVec2(16, 10); // Multiplied by g.Style.MouseCursorScale
+static const ImVec2 TOOLTIP_DEFAULT_OFFSET_TOUCH = ImVec2(0, -20); // Multiplied by g.Style.MouseCursorScale
+static const ImVec2 TOOLTIP_DEFAULT_PIVOT_TOUCH = ImVec2(0.5f, 1.0f); // Multiplied by g.Style.MouseCursorScale
+
//-------------------------------------------------------------------------
// [SECTION] FORWARD DECLARATIONS
//-------------------------------------------------------------------------
static void SetCurrentWindow(ImGuiWindow* window);
-static void FindHoveredWindow();
static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags);
static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window);
-static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* draw_list);
static void AddWindowToSortBuffer(ImVector<ImGuiWindow*>* out_sorted_windows, ImGuiWindow* window);
// Settings
@@ -978,16 +1207,25 @@ static void WindowSettingsHandler_ReadLine(ImGuiContext*, ImGuiSetti
static void WindowSettingsHandler_ApplyAll(ImGuiContext*, ImGuiSettingsHandler*);
static void WindowSettingsHandler_WriteAll(ImGuiContext*, ImGuiSettingsHandler*, ImGuiTextBuffer* buf);
-// Platform Dependents default implementation for IO functions
-static const char* GetClipboardTextFn_DefaultImpl(void* user_data);
-static void SetClipboardTextFn_DefaultImpl(void* user_data, const char* text);
-static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatformImeData* data);
+// Platform Dependents default implementation for ImGuiPlatformIO functions
+static const char* Platform_GetClipboardTextFn_DefaultImpl(ImGuiContext* ctx);
+static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext* ctx, const char* text);
+static void Platform_SetImeDataFn_DefaultImpl(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data);
+static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext* ctx, const char* path);
namespace ImGui
{
+// Item
+static void ItemHandleShortcut(ImGuiID id);
+
+// Window Focus
+static int FindWindowFocusIndex(ImGuiWindow* window);
+static void UpdateWindowInFocusOrderList(ImGuiWindow* window, bool just_created, ImGuiWindowFlags new_flags);
+
// Navigation
static void NavUpdate();
static void NavUpdateWindowing();
+static void NavUpdateWindowingApplyFocus(ImGuiWindow* window);
static void NavUpdateWindowingOverlay();
static void NavUpdateCancelRequest();
static void NavUpdateCreateMoveRequest();
@@ -999,34 +1237,41 @@ static void NavEndFrame();
static bool NavScoreItem(ImGuiNavItemData* result);
static void NavApplyItemToResult(ImGuiNavItemData* result);
static void NavProcessItem();
-static void NavProcessItemForTabbingRequest(ImGuiID id);
+static void NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flags, ImGuiNavMoveFlags move_flags);
+static ImGuiInputSource NavCalcPreferredRefPosSource();
static ImVec2 NavCalcPreferredRefPos();
static void NavSaveLastChildNavWindowIntoParent(ImGuiWindow* nav_window);
static ImGuiWindow* NavRestoreLastChildNavWindow(ImGuiWindow* window);
static void NavRestoreLayer(ImGuiNavLayer layer);
-static void NavRestoreHighlightAfterMove();
-static int FindWindowFocusIndex(ImGuiWindow* window);
// Error Checking and Debug Tools
static void ErrorCheckNewFrameSanityChecks();
static void ErrorCheckEndFrameSanityChecks();
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
static void UpdateDebugToolItemPicker();
static void UpdateDebugToolStackQueries();
+static void UpdateDebugToolFlashStyleColor();
+#endif
-// Misc
-static void UpdateSettings();
+// Inputs
static void UpdateKeyboardInputs();
static void UpdateMouseInputs();
static void UpdateMouseWheel();
-static bool UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect);
+static void UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt);
+
+// Misc
+static void UpdateSettings();
+static int UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_hovered, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect);
static void RenderWindowOuterBorders(ImGuiWindow* window);
-static void RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size);
+static void RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, bool handle_borders_and_resize_grips, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size);
static void RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& title_bar_rect, const char* name, bool* p_open);
static void RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col);
static void RenderDimmedBackgrounds();
-static ImGuiWindow* FindBlockingModal(ImGuiWindow* window);
+static void SetLastItemDataForWindow(ImGuiWindow* window, const ImRect& rect);
+static void SetLastItemDataForChildWindowItem(ImGuiWindow* window, const ImRect& rect);
// Viewports
+const ImGuiID IMGUI_VIEWPORT_DEFAULT_ID = 0x11111111; // Using an arbitrary constant instead of e.g. ImHashStr("ViewportDefault", 0); so it's easier to spot in the debugger. The exact value doesn't matter.
static void UpdateViewportsNewFrame();
}
@@ -1074,51 +1319,68 @@ static ImGuiMemFreeFunc GImAllocatorFreeFunc = FreeWrapper;
static void* GImAllocatorUserData = NULL;
//-----------------------------------------------------------------------------
-// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO)
+// [SECTION] USER FACING STRUCTURES (ImGuiStyle, ImGuiIO, ImGuiPlatformIO)
//-----------------------------------------------------------------------------
ImGuiStyle::ImGuiStyle()
{
- Alpha = 1.0f; // Global alpha applies to everything in Dear ImGui.
- DisabledAlpha = 0.60f; // Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha.
- WindowPadding = ImVec2(8,8); // Padding within a window
- WindowRounding = 0.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.
- WindowBorderSize = 1.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested.
- WindowMinSize = ImVec2(32,32); // Minimum window size
- WindowTitleAlign = ImVec2(0.0f,0.5f);// Alignment for title bar text
- WindowMenuButtonPosition= ImGuiDir_Left; // Position of the collapsing/docking button in the title bar (left/right). Defaults to ImGuiDir_Left.
- ChildRounding = 0.0f; // Radius of child window corners rounding. Set to 0.0f to have rectangular child windows
- ChildBorderSize = 1.0f; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. Other values not well tested.
- PopupRounding = 0.0f; // Radius of popup window corners rounding. Set to 0.0f to have rectangular child windows
- PopupBorderSize = 1.0f; // Thickness of border around popup or tooltip windows. Generally set to 0.0f or 1.0f. Other values not well tested.
- FramePadding = ImVec2(4,3); // Padding within a framed rectangle (used by most widgets)
- FrameRounding = 0.0f; // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets).
- FrameBorderSize = 0.0f; // Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested.
- ItemSpacing = ImVec2(8,4); // Horizontal and vertical spacing between widgets/lines
- ItemInnerSpacing = ImVec2(4,4); // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
- CellPadding = ImVec2(4,2); // Padding within a table cell
- TouchExtraPadding = ImVec2(0,0); // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
- IndentSpacing = 21.0f; // Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
- ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
- ScrollbarSize = 14.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar
- ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar
- GrabMinSize = 12.0f; // Minimum width/height of a grab box for slider/scrollbar
- GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
- LogSliderDeadzone = 4.0f; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
- TabRounding = 4.0f; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
- TabBorderSize = 0.0f; // Thickness of border around tabs.
- TabMinWidthForCloseButton = 0.0f; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
- ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
- ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text.
- SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
- DisplayWindowPadding = ImVec2(19,19); // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows.
- DisplaySafeAreaPadding = ImVec2(3,3); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows.
- MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
- AntiAliasedLines = true; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU.
- AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering).
- AntiAliasedFill = true; // Enable anti-aliased filled shapes (rounded rectangles, circles, etc.).
- CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
- CircleTessellationMaxError = 0.30f; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.
+ Alpha = 1.0f; // Global alpha applies to everything in Dear ImGui.
+ DisabledAlpha = 0.60f; // Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha.
+ WindowPadding = ImVec2(8,8); // Padding within a window
+ WindowRounding = 0.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.
+ WindowBorderSize = 1.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested.
+ WindowBorderHoverPadding = 4.0f; // Hit-testing extent outside/inside resizing border. Also extend determination of hovered window. Generally meaningfully larger than WindowBorderSize to make it easy to reach borders.
+ WindowMinSize = ImVec2(32,32); // Minimum window size
+ WindowTitleAlign = ImVec2(0.0f,0.5f);// Alignment for title bar text
+ WindowMenuButtonPosition = ImGuiDir_Left; // Position of the collapsing/docking button in the title bar (left/right). Defaults to ImGuiDir_Left.
+ ChildRounding = 0.0f; // Radius of child window corners rounding. Set to 0.0f to have rectangular child windows
+ ChildBorderSize = 1.0f; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. Other values not well tested.
+ PopupRounding = 0.0f; // Radius of popup window corners rounding. Set to 0.0f to have rectangular child windows
+ PopupBorderSize = 1.0f; // Thickness of border around popup or tooltip windows. Generally set to 0.0f or 1.0f. Other values not well tested.
+ FramePadding = ImVec2(4,3); // Padding within a framed rectangle (used by most widgets)
+ FrameRounding = 0.0f; // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets).
+ FrameBorderSize = 0.0f; // Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested.
+ ItemSpacing = ImVec2(8,4); // Horizontal and vertical spacing between widgets/lines
+ ItemInnerSpacing = ImVec2(4,4); // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
+ CellPadding = ImVec2(4,2); // Padding within a table cell. Cellpadding.x is locked for entire table. CellPadding.y may be altered between different rows.
+ TouchExtraPadding = ImVec2(0,0); // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
+ IndentSpacing = 21.0f; // Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
+ ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
+ ScrollbarSize = 14.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar
+ ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar
+ GrabMinSize = 12.0f; // Minimum width/height of a grab box for slider/scrollbar
+ GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
+ LogSliderDeadzone = 4.0f; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
+ ImageBorderSize = 0.0f; // Thickness of border around tabs.
+ TabRounding = 5.0f; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
+ TabBorderSize = 0.0f; // Thickness of border around tabs.
+ TabCloseButtonMinWidthSelected = -1.0f; // -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width.
+ TabCloseButtonMinWidthUnselected = 0.0f; // -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width. FLT_MAX: never show close button when unselected.
+ TabBarBorderSize = 1.0f; // Thickness of tab-bar separator, which takes on the tab active color to denote focus.
+ TabBarOverlineSize = 1.0f; // Thickness of tab-bar overline, which highlights the selected tab-bar.
+ TableAngledHeadersAngle = 35.0f * (IM_PI / 180.0f); // Angle of angled headers (supported values range from -50 degrees to +50 degrees).
+ TableAngledHeadersTextAlign = ImVec2(0.5f,0.0f);// Alignment of angled headers within the cell
+ ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
+ ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text.
+ SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
+ SeparatorTextBorderSize = 3.0f; // Thickness of border in SeparatorText()
+ SeparatorTextAlign = ImVec2(0.0f,0.5f);// Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
+ SeparatorTextPadding = ImVec2(20.0f,3.f);// Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y.
+ DisplayWindowPadding = ImVec2(19,19); // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows.
+ DisplaySafeAreaPadding = ImVec2(3,3); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows.
+ MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
+ AntiAliasedLines = true; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU.
+ AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering).
+ AntiAliasedFill = true; // Enable anti-aliased filled shapes (rounded rectangles, circles, etc.).
+ CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
+ CircleTessellationMaxError = 0.30f; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.
+
+ // Behaviors
+ HoverStationaryDelay = 0.15f; // Delay for IsItemHovered(ImGuiHoveredFlags_Stationary). Time required to consider mouse stationary.
+ HoverDelayShort = 0.15f; // Delay for IsItemHovered(ImGuiHoveredFlags_DelayShort). Usually used along with HoverStationaryDelay.
+ HoverDelayNormal = 0.40f; // Delay for IsItemHovered(ImGuiHoveredFlags_DelayNormal). "
+ HoverFlagsForTooltipMouse = ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_AllowWhenDisabled; // Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using mouse.
+ HoverFlagsForTooltipNav = ImGuiHoveredFlags_NoSharedDelay | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_AllowWhenDisabled; // Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using keyboard/gamepad.
// Default theme
ImGui::StyleColorsDark(this);
@@ -1128,29 +1390,34 @@ ImGuiStyle::ImGuiStyle()
// Important: This operation is lossy because we round all sizes to integer. If you need to change your scale multiples, call this over a freshly initialized ImGuiStyle structure rather than scaling multiple times.
void ImGuiStyle::ScaleAllSizes(float scale_factor)
{
- WindowPadding = ImFloor(WindowPadding * scale_factor);
- WindowRounding = ImFloor(WindowRounding * scale_factor);
- WindowMinSize = ImFloor(WindowMinSize * scale_factor);
- ChildRounding = ImFloor(ChildRounding * scale_factor);
- PopupRounding = ImFloor(PopupRounding * scale_factor);
- FramePadding = ImFloor(FramePadding * scale_factor);
- FrameRounding = ImFloor(FrameRounding * scale_factor);
- ItemSpacing = ImFloor(ItemSpacing * scale_factor);
- ItemInnerSpacing = ImFloor(ItemInnerSpacing * scale_factor);
- CellPadding = ImFloor(CellPadding * scale_factor);
- TouchExtraPadding = ImFloor(TouchExtraPadding * scale_factor);
- IndentSpacing = ImFloor(IndentSpacing * scale_factor);
- ColumnsMinSpacing = ImFloor(ColumnsMinSpacing * scale_factor);
- ScrollbarSize = ImFloor(ScrollbarSize * scale_factor);
- ScrollbarRounding = ImFloor(ScrollbarRounding * scale_factor);
- GrabMinSize = ImFloor(GrabMinSize * scale_factor);
- GrabRounding = ImFloor(GrabRounding * scale_factor);
- LogSliderDeadzone = ImFloor(LogSliderDeadzone * scale_factor);
- TabRounding = ImFloor(TabRounding * scale_factor);
- TabMinWidthForCloseButton = (TabMinWidthForCloseButton != FLT_MAX) ? ImFloor(TabMinWidthForCloseButton * scale_factor) : FLT_MAX;
- DisplayWindowPadding = ImFloor(DisplayWindowPadding * scale_factor);
- DisplaySafeAreaPadding = ImFloor(DisplaySafeAreaPadding * scale_factor);
- MouseCursorScale = ImFloor(MouseCursorScale * scale_factor);
+ WindowPadding = ImTrunc(WindowPadding * scale_factor);
+ WindowRounding = ImTrunc(WindowRounding * scale_factor);
+ WindowMinSize = ImTrunc(WindowMinSize * scale_factor);
+ WindowBorderHoverPadding = ImTrunc(WindowBorderHoverPadding * scale_factor);
+ ChildRounding = ImTrunc(ChildRounding * scale_factor);
+ PopupRounding = ImTrunc(PopupRounding * scale_factor);
+ FramePadding = ImTrunc(FramePadding * scale_factor);
+ FrameRounding = ImTrunc(FrameRounding * scale_factor);
+ ItemSpacing = ImTrunc(ItemSpacing * scale_factor);
+ ItemInnerSpacing = ImTrunc(ItemInnerSpacing * scale_factor);
+ CellPadding = ImTrunc(CellPadding * scale_factor);
+ TouchExtraPadding = ImTrunc(TouchExtraPadding * scale_factor);
+ IndentSpacing = ImTrunc(IndentSpacing * scale_factor);
+ ColumnsMinSpacing = ImTrunc(ColumnsMinSpacing * scale_factor);
+ ScrollbarSize = ImTrunc(ScrollbarSize * scale_factor);
+ ScrollbarRounding = ImTrunc(ScrollbarRounding * scale_factor);
+ GrabMinSize = ImTrunc(GrabMinSize * scale_factor);
+ GrabRounding = ImTrunc(GrabRounding * scale_factor);
+ LogSliderDeadzone = ImTrunc(LogSliderDeadzone * scale_factor);
+ ImageBorderSize = ImTrunc(ImageBorderSize * scale_factor);
+ TabRounding = ImTrunc(TabRounding * scale_factor);
+ TabCloseButtonMinWidthSelected = (TabCloseButtonMinWidthSelected > 0.0f && TabCloseButtonMinWidthSelected != FLT_MAX) ? ImTrunc(TabCloseButtonMinWidthSelected * scale_factor) : TabCloseButtonMinWidthSelected;
+ TabCloseButtonMinWidthUnselected = (TabCloseButtonMinWidthUnselected > 0.0f && TabCloseButtonMinWidthUnselected != FLT_MAX) ? ImTrunc(TabCloseButtonMinWidthUnselected * scale_factor) : TabCloseButtonMinWidthUnselected;
+ TabBarOverlineSize = ImTrunc(TabBarOverlineSize * scale_factor);
+ SeparatorTextPadding = ImTrunc(SeparatorTextPadding * scale_factor);
+ DisplayWindowPadding = ImTrunc(DisplayWindowPadding * scale_factor);
+ DisplaySafeAreaPadding = ImTrunc(DisplaySafeAreaPadding * scale_factor);
+ MouseCursorScale = ImTrunc(MouseCursorScale * scale_factor);
}
ImGuiIO::ImGuiIO()
@@ -1167,16 +1434,6 @@ ImGuiIO::ImGuiIO()
IniSavingRate = 5.0f;
IniFilename = "imgui.ini"; // Important: "imgui.ini" is relative to current working dir, most apps will want to lock this to an absolute path (e.g. same path as executables).
LogFilename = "imgui_log.txt";
- MouseDoubleClickTime = 0.30f;
- MouseDoubleClickMaxDist = 6.0f;
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- for (int i = 0; i < ImGuiKey_COUNT; i++)
- KeyMap[i] = -1;
-#endif
- KeyRepeatDelay = 0.275f;
- KeyRepeatRate = 0.050f;
- HoverDelayNormal = 0.30f;
- HoverDelayShort = 0.10f;
UserData = NULL;
Fonts = NULL;
@@ -1185,6 +1442,15 @@ ImGuiIO::ImGuiIO()
FontAllowUserScaling = false;
DisplayFramebufferScale = ImVec2(1.0f, 1.0f);
+ // Keyboard/Gamepad Navigation options
+ ConfigNavSwapGamepadButtons = false;
+ ConfigNavMoveSetMousePos = false;
+ ConfigNavCaptureKeyboard = true;
+ ConfigNavEscapeClearFocusItem = true;
+ ConfigNavEscapeClearFocusWindow = false;
+ ConfigNavCursorVisibleAuto = true;
+ ConfigNavCursorVisibleAlways = false;
+
// Miscellaneous options
MouseDrawCursor = false;
#ifdef __APPLE__
@@ -1198,25 +1464,39 @@ ImGuiIO::ImGuiIO()
ConfigDragClickToInputText = false;
ConfigWindowsResizeFromEdges = true;
ConfigWindowsMoveFromTitleBarOnly = false;
+ ConfigWindowsCopyContentsWithCtrlC = false;
+ ConfigScrollbarScrollByPage = true;
ConfigMemoryCompactTimer = 60.0f;
+ ConfigDebugIsDebuggerPresent = false;
+ ConfigDebugHighlightIdConflicts = true;
+ ConfigDebugHighlightIdConflictsShowItemPicker = true;
+ ConfigDebugBeginReturnValueOnce = false;
+ ConfigDebugBeginReturnValueLoop = false;
+
+ ConfigErrorRecovery = true;
+ ConfigErrorRecoveryEnableAssert = true;
+ ConfigErrorRecoveryEnableDebugLog = true;
+ ConfigErrorRecoveryEnableTooltip = true;
+
+ // Inputs Behaviors
+ MouseDoubleClickTime = 0.30f;
+ MouseDoubleClickMaxDist = 6.0f;
+ MouseDragThreshold = 6.0f;
+ KeyRepeatDelay = 0.275f;
+ KeyRepeatRate = 0.050f;
// Platform Functions
+ // Note: Initialize() will setup default clipboard/ime handlers.
BackendPlatformName = BackendRendererName = NULL;
BackendPlatformUserData = BackendRendererUserData = BackendLanguageUserData = NULL;
- GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations
- SetClipboardTextFn = SetClipboardTextFn_DefaultImpl;
- ClipboardUserData = NULL;
- SetPlatformImeDataFn = SetPlatformImeDataFn_DefaultImpl;
// Input (NB: we already have memset zero the entire structure!)
MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX);
- MouseDragThreshold = 6.0f;
+ MouseSource = ImGuiMouseSource_Mouse;
for (int i = 0; i < IM_ARRAYSIZE(MouseDownDuration); i++) MouseDownDuration[i] = MouseDownDurationPrev[i] = -1.0f;
for (int i = 0; i < IM_ARRAYSIZE(KeysData); i++) { KeysData[i].DownDuration = KeysData[i].DownDurationPrev = -1.0f; }
AppAcceptingEvents = true;
- BackendUsingLegacyKeyArrays = (ImS8)-1;
- BackendUsingLegacyNavInputArray = true; // assume using legacy array until proven wrong
}
// Pass in translated ASCII characters for text input.
@@ -1225,14 +1505,15 @@ ImGuiIO::ImGuiIO()
// FIXME: Should in theory be called "AddCharacterEvent()" to be consistent with new API
void ImGuiIO::AddInputCharacter(unsigned int c)
{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(&g.IO == this && "Can only add events to current context.");
+ IM_ASSERT(Ctx != NULL);
+ ImGuiContext& g = *Ctx;
if (c == 0 || !AppAcceptingEvents)
return;
ImGuiInputEvent e;
e.Type = ImGuiInputEventType_Text;
e.Source = ImGuiInputSource_Keyboard;
+ e.EventId = g.InputEventsNextEventId++;
e.Text.Char = c;
g.InputEventsQueue.push_back(e);
}
@@ -1281,31 +1562,45 @@ void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars)
{
unsigned int c = 0;
utf8_chars += ImTextCharFromUtf8(&c, utf8_chars, NULL);
- if (c != 0)
- AddInputCharacter(c);
+ AddInputCharacter(c);
}
}
-// FIXME: Perhaps we could clear queued events as well?
-void ImGuiIO::ClearInputCharacters()
+// Clear all incoming events.
+void ImGuiIO::ClearEventsQueue()
{
- InputQueueCharacters.resize(0);
+ IM_ASSERT(Ctx != NULL);
+ ImGuiContext& g = *Ctx;
+ g.InputEventsQueue.clear();
}
-// FIXME: Perhaps we could clear queued events as well?
+// Clear current keyboard/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.
void ImGuiIO::ClearInputKeys()
{
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- memset(KeysDown, 0, sizeof(KeysDown));
-#endif
- for (int n = 0; n < IM_ARRAYSIZE(KeysData); n++)
+ ImGuiContext& g = *Ctx;
+ for (int key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key++)
{
- KeysData[n].Down = false;
- KeysData[n].DownDuration = -1.0f;
- KeysData[n].DownDurationPrev = -1.0f;
+ if (ImGui::IsMouseKey((ImGuiKey)key))
+ continue;
+ ImGuiKeyData* key_data = &g.IO.KeysData[key - ImGuiKey_NamedKey_BEGIN];
+ key_data->Down = false;
+ key_data->DownDuration = -1.0f;
+ key_data->DownDurationPrev = -1.0f;
}
KeyCtrl = KeyShift = KeyAlt = KeySuper = false;
KeyMods = ImGuiMod_None;
+ InputQueueCharacters.resize(0); // Behavior of old ClearInputCharacters().
+}
+
+void ImGuiIO::ClearInputMouse()
+{
+ for (ImGuiKey key = ImGuiKey_Mouse_BEGIN; key < ImGuiKey_Mouse_END; key = (ImGuiKey)(key + 1))
+ {
+ ImGuiKeyData* key_data = &KeysData[key - ImGuiKey_NamedKey_BEGIN];
+ key_data->Down = false;
+ key_data->DownDuration = -1.0f;
+ key_data->DownDurationPrev = -1.0f;
+ }
MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
for (int n = 0; n < IM_ARRAYSIZE(MouseDown); n++)
{
@@ -1315,9 +1610,18 @@ void ImGuiIO::ClearInputKeys()
MouseWheel = MouseWheelH = 0.0f;
}
-static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg = -1)
+// Removed this as it is ambiguous/misleading and generally incorrect to use with the existence of a higher-level input queue.
+// Current frame character buffer is now also cleared by ClearInputKeys().
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+void ImGuiIO::ClearInputCharacters()
{
- ImGuiContext& g = *GImGui;
+ InputQueueCharacters.resize(0);
+}
+#endif
+
+static ImGuiInputEvent* FindLatestInputEvent(ImGuiContext* ctx, ImGuiInputEventType type, int arg = -1)
+{
+ ImGuiContext& g = *ctx;
for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--)
{
ImGuiInputEvent* e = &g.InputEventsQueue[n];
@@ -1336,30 +1640,32 @@ static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg =
// - ImGuiKey key: Translated key (as in, generally ImGuiKey_A matches the key end-user would use to emit an 'A' character)
// - bool down: Is the key down? use false to signify a key release.
// - float analog_value: 0.0f..1.0f
+// IMPORTANT: THIS FUNCTION AND OTHER "ADD" GRABS THE CONTEXT FROM OUR INSTANCE.
+// WE NEED TO ENSURE THAT ALL FUNCTION CALLS ARE FULFILLING THIS, WHICH IS WHY GetKeyData() HAS AN EXPLICIT CONTEXT.
void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value)
{
//if (e->Down) { IMGUI_DEBUG_LOG_IO("AddKeyEvent() Key='%s' %d, NativeKeycode = %d, NativeScancode = %d\n", ImGui::GetKeyName(e->Key), e->Down, e->NativeKeycode, e->NativeScancode); }
+ IM_ASSERT(Ctx != NULL);
if (key == ImGuiKey_None || !AppAcceptingEvents)
return;
- ImGuiContext& g = *GImGui;
- IM_ASSERT(&g.IO == this && "Can only add events to current context.");
- IM_ASSERT(ImGui::IsNamedKeyOrModKey(key)); // Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API.
- IM_ASSERT(!ImGui::IsAliasKey(key)); // Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events.
-
- // Verify that backend isn't mixing up using new io.AddKeyEvent() api and old io.KeysDown[] + io.KeyMap[] data.
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- IM_ASSERT((BackendUsingLegacyKeyArrays == -1 || BackendUsingLegacyKeyArrays == 0) && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!");
- if (BackendUsingLegacyKeyArrays == -1)
- for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_NamedKey_END; n++)
- IM_ASSERT(KeyMap[n] == -1 && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!");
- BackendUsingLegacyKeyArrays = 0;
-#endif
- if (ImGui::IsGamepadKey(key))
- BackendUsingLegacyNavInputArray = false;
+ ImGuiContext& g = *Ctx;
+ IM_ASSERT(ImGui::IsNamedKeyOrMod(key)); // Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API.
+ IM_ASSERT(ImGui::IsAliasKey(key) == false); // Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events.
+
+ // MacOS: swap Cmd(Super) and Ctrl
+ if (g.IO.ConfigMacOSXBehaviors)
+ {
+ if (key == ImGuiMod_Super) { key = ImGuiMod_Ctrl; }
+ else if (key == ImGuiMod_Ctrl) { key = ImGuiMod_Super; }
+ else if (key == ImGuiKey_LeftSuper) { key = ImGuiKey_LeftCtrl; }
+ else if (key == ImGuiKey_RightSuper){ key = ImGuiKey_RightCtrl; }
+ else if (key == ImGuiKey_LeftCtrl) { key = ImGuiKey_LeftSuper; }
+ else if (key == ImGuiKey_RightCtrl) { key = ImGuiKey_RightSuper; }
+ }
// Filter duplicate (in particular: key mods and gamepad analog values are commonly spammed)
- const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_Key, (int)key);
- const ImGuiKeyData* key_data = ImGui::GetKeyData(key);
+ const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_Key, (int)key);
+ const ImGuiKeyData* key_data = ImGui::GetKeyData(&g, key);
const bool latest_key_down = latest_event ? latest_event->Key.Down : key_data->Down;
const float latest_key_analog = latest_event ? latest_event->Key.AnalogValue : key_data->AnalogValue;
if (latest_key_down == down && latest_key_analog == analog_value)
@@ -1369,6 +1675,7 @@ void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value)
ImGuiInputEvent e;
e.Type = ImGuiInputEventType_Key;
e.Source = ImGui::IsGamepadKey(key) ? ImGuiInputSource_Gamepad : ImGuiInputSource_Keyboard;
+ e.EventId = g.InputEventsNextEventId++;
e.Key.Key = key;
e.Key.Down = down;
e.Key.AnalogValue = analog_value;
@@ -1391,20 +1698,10 @@ void ImGuiIO::SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native
return;
IM_ASSERT(ImGui::IsNamedKey(key)); // >= 512
IM_ASSERT(native_legacy_index == -1 || ImGui::IsLegacyKey((ImGuiKey)native_legacy_index)); // >= 0 && <= 511
- IM_UNUSED(native_keycode); // Yet unused
- IM_UNUSED(native_scancode); // Yet unused
-
- // Build native->imgui map so old user code can still call key functions with native 0..511 values.
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- const int legacy_key = (native_legacy_index != -1) ? native_legacy_index : native_keycode;
- if (!ImGui::IsLegacyKey((ImGuiKey)legacy_key))
- return;
- KeyMap[legacy_key] = key;
- KeyMap[key] = legacy_key;
-#else
- IM_UNUSED(key);
- IM_UNUSED(native_legacy_index);
-#endif
+ IM_UNUSED(key); // Yet unused
+ IM_UNUSED(native_keycode); // Yet unused
+ IM_UNUSED(native_scancode); // Yet unused
+ IM_UNUSED(native_legacy_index); // Yet unused
}
// Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen.
@@ -1416,16 +1713,16 @@ void ImGuiIO::SetAppAcceptingEvents(bool accepting_events)
// Queue a mouse move event
void ImGuiIO::AddMousePosEvent(float x, float y)
{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(&g.IO == this && "Can only add events to current context.");
+ IM_ASSERT(Ctx != NULL);
+ ImGuiContext& g = *Ctx;
if (!AppAcceptingEvents)
return;
// Apply same flooring as UpdateMouseInputs()
- ImVec2 pos((x > -FLT_MAX) ? ImFloorSigned(x) : x, (y > -FLT_MAX) ? ImFloorSigned(y) : y);
+ ImVec2 pos((x > -FLT_MAX) ? ImFloor(x) : x, (y > -FLT_MAX) ? ImFloor(y) : y);
// Filter duplicate
- const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_MousePos);
+ const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_MousePos);
const ImVec2 latest_pos = latest_event ? ImVec2(latest_event->MousePos.PosX, latest_event->MousePos.PosY) : g.IO.MousePos;
if (latest_pos.x == pos.x && latest_pos.y == pos.y)
return;
@@ -1433,38 +1730,66 @@ void ImGuiIO::AddMousePosEvent(float x, float y)
ImGuiInputEvent e;
e.Type = ImGuiInputEventType_MousePos;
e.Source = ImGuiInputSource_Mouse;
+ e.EventId = g.InputEventsNextEventId++;
e.MousePos.PosX = pos.x;
e.MousePos.PosY = pos.y;
+ e.MousePos.MouseSource = g.InputEventsNextMouseSource;
g.InputEventsQueue.push_back(e);
}
void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down)
{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(&g.IO == this && "Can only add events to current context.");
+ IM_ASSERT(Ctx != NULL);
+ ImGuiContext& g = *Ctx;
IM_ASSERT(mouse_button >= 0 && mouse_button < ImGuiMouseButton_COUNT);
if (!AppAcceptingEvents)
return;
+ // On MacOS X: Convert Ctrl(Super)+Left click into Right-click: handle held button.
+ if (ConfigMacOSXBehaviors && mouse_button == 0 && MouseCtrlLeftAsRightClick)
+ {
+ // Order of both statements matterns: this event will still release mouse button 1
+ mouse_button = 1;
+ if (!down)
+ MouseCtrlLeftAsRightClick = false;
+ }
+
// Filter duplicate
- const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_MouseButton, (int)mouse_button);
+ const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_MouseButton, (int)mouse_button);
const bool latest_button_down = latest_event ? latest_event->MouseButton.Down : g.IO.MouseDown[mouse_button];
if (latest_button_down == down)
return;
+ // On MacOS X: Convert Ctrl(Super)+Left click into Right-click.
+ // - Note that this is actual physical Ctrl which is ImGuiMod_Super for us.
+ // - At this point we want from !down to down, so this is handling the initial press.
+ if (ConfigMacOSXBehaviors && mouse_button == 0 && down)
+ {
+ const ImGuiInputEvent* latest_super_event = FindLatestInputEvent(&g, ImGuiInputEventType_Key, (int)ImGuiMod_Super);
+ if (latest_super_event ? latest_super_event->Key.Down : g.IO.KeySuper)
+ {
+ IMGUI_DEBUG_LOG_IO("[io] Super+Left Click aliased into Right Click\n");
+ MouseCtrlLeftAsRightClick = true;
+ AddMouseButtonEvent(1, true); // This is just quicker to write that passing through, as we need to filter duplicate again.
+ return;
+ }
+ }
+
ImGuiInputEvent e;
e.Type = ImGuiInputEventType_MouseButton;
e.Source = ImGuiInputSource_Mouse;
+ e.EventId = g.InputEventsNextEventId++;
e.MouseButton.Button = mouse_button;
e.MouseButton.Down = down;
+ e.MouseButton.MouseSource = g.InputEventsNextMouseSource;
g.InputEventsQueue.push_back(e);
}
-// Queue a mouse wheel event (most mouse/API will only have a Y component)
+// Queue a mouse wheel event (some mouse/API may only have a Y component)
void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y)
{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(&g.IO == this && "Can only add events to current context.");
+ IM_ASSERT(Ctx != NULL);
+ ImGuiContext& g = *Ctx;
// Filter duplicate (unlike most events, wheel values are relative and easy to filter)
if (!AppAcceptingEvents || (wheel_x == 0.0f && wheel_y == 0.0f))
@@ -1473,28 +1798,47 @@ void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y)
ImGuiInputEvent e;
e.Type = ImGuiInputEventType_MouseWheel;
e.Source = ImGuiInputSource_Mouse;
+ e.EventId = g.InputEventsNextEventId++;
e.MouseWheel.WheelX = wheel_x;
e.MouseWheel.WheelY = wheel_y;
+ e.MouseWheel.MouseSource = g.InputEventsNextMouseSource;
g.InputEventsQueue.push_back(e);
}
+// This is not a real event, the data is latched in order to be stored in actual Mouse events.
+// This is so that duplicate events (e.g. Windows sending extraneous WM_MOUSEMOVE) gets filtered and are not leading to actual source changes.
+void ImGuiIO::AddMouseSourceEvent(ImGuiMouseSource source)
+{
+ IM_ASSERT(Ctx != NULL);
+ ImGuiContext& g = *Ctx;
+ g.InputEventsNextMouseSource = source;
+}
+
void ImGuiIO::AddFocusEvent(bool focused)
{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(&g.IO == this && "Can only add events to current context.");
+ IM_ASSERT(Ctx != NULL);
+ ImGuiContext& g = *Ctx;
// Filter duplicate
- const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_Focus);
+ const ImGuiInputEvent* latest_event = FindLatestInputEvent(&g, ImGuiInputEventType_Focus);
const bool latest_focused = latest_event ? latest_event->AppFocused.Focused : !g.IO.AppFocusLost;
- if (latest_focused == focused)
+ if (latest_focused == focused || (ConfigDebugIgnoreFocusLoss && !focused))
return;
ImGuiInputEvent e;
e.Type = ImGuiInputEventType_Focus;
+ e.EventId = g.InputEventsNextEventId++;
e.AppFocused.Focused = focused;
g.InputEventsQueue.push_back(e);
}
+ImGuiPlatformIO::ImGuiPlatformIO()
+{
+ // Most fields are initialized with zero
+ memset(this, 0, sizeof(*this));
+ Platform_LocaleDecimalPoint = '.';
+}
+
//-----------------------------------------------------------------------------
// [SECTION] MISC HELPERS/UTILITIES (Geometry functions)
//-----------------------------------------------------------------------------
@@ -1645,15 +1989,15 @@ void ImStrncpy(char* dst, const char* src, size_t count)
char* ImStrdup(const char* str)
{
- size_t len = strlen(str);
+ size_t len = ImStrlen(str);
void* buf = IM_ALLOC(len + 1);
return (char*)memcpy(buf, (const void*)str, len + 1);
}
char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* src)
{
- size_t dst_buf_size = p_dst_size ? *p_dst_size : strlen(dst) + 1;
- size_t src_size = strlen(src) + 1;
+ size_t dst_buf_size = p_dst_size ? *p_dst_size : ImStrlen(dst) + 1;
+ size_t src_size = ImStrlen(src) + 1;
if (dst_buf_size < src_size)
{
IM_FREE(dst);
@@ -1666,7 +2010,7 @@ char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* src)
const char* ImStrchrRange(const char* str, const char* str_end, char c)
{
- const char* p = (const char*)memchr(str, (int)c, str_end - str);
+ const char* p = (const char*)ImMemchr(str, (int)c, str_end - str);
return p;
}
@@ -1681,12 +2025,13 @@ int ImStrlenW(const ImWchar* str)
// Find end-of-line. Return pointer will point to either first \n, either str_end.
const char* ImStreolRange(const char* str, const char* str_end)
{
- const char* p = (const char*)memchr(str, '\n', str_end - str);
+ const char* p = (const char*)ImMemchr(str, '\n', str_end - str);
return p ? p : str_end;
}
-const ImWchar* ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin) // find beginning-of-line
+const char* ImStrbol(const char* buf_mid_line, const char* buf_begin) // find beginning-of-line
{
+ IM_ASSERT_PARANOID(buf_mid_line >= buf_begin && buf_mid_line <= buf_begin + ImStrlen(buf_begin));
while (buf_mid_line > buf_begin && buf_mid_line[-1] != '\n')
buf_mid_line--;
return buf_mid_line;
@@ -1695,7 +2040,7 @@ const ImWchar* ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin)
const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end)
{
if (!needle_end)
- needle_end = needle + strlen(needle);
+ needle_end = needle + ImStrlen(needle);
const char un0 = (char)ImToUpper(*needle);
while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end))
@@ -1747,13 +2092,15 @@ const char* ImStrSkipBlank(const char* str)
// and setup the wrapper yourself. (FIXME-OPT: Some of our high-level operations such as ImGuiTextBuffer::appendfv() are
// designed using two-passes worst case, which probably could be improved using the stbsp_vsprintfcb() function.)
#ifdef IMGUI_USE_STB_SPRINTF
+#ifndef IMGUI_DISABLE_STB_SPRINTF_IMPLEMENTATION
#define STB_SPRINTF_IMPLEMENTATION
+#endif
#ifdef IMGUI_STB_SPRINTF_FILENAME
#include IMGUI_STB_SPRINTF_FILENAME
#else
#include "stb_sprintf.h"
#endif
-#endif
+#endif // #ifdef IMGUI_USE_STB_SPRINTF
#if defined(_MSC_VER) && !defined(vsnprintf)
#define vsnprintf _vsnprintf
@@ -1795,28 +2142,55 @@ int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args)
void ImFormatStringToTempBuffer(const char** out_buf, const char** out_buf_end, const char* fmt, ...)
{
- ImGuiContext& g = *GImGui;
va_list args;
va_start(args, fmt);
- int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args);
- *out_buf = g.TempBuffer.Data;
- if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; }
+ ImFormatStringToTempBufferV(out_buf, out_buf_end, fmt, args);
va_end(args);
}
+// FIXME: Should rework API toward allowing multiple in-flight temp buffers (easier and safer for caller)
+// by making the caller acquire a temp buffer token, with either explicit or destructor release, e.g.
+// ImGuiTempBufferToken token;
+// ImFormatStringToTempBuffer(token, ...);
void ImFormatStringToTempBufferV(const char** out_buf, const char** out_buf_end, const char* fmt, va_list args)
{
ImGuiContext& g = *GImGui;
- int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args);
- *out_buf = g.TempBuffer.Data;
- if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; }
+ if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0)
+ {
+ const char* buf = va_arg(args, const char*); // Skip formatting when using "%s"
+ if (buf == NULL)
+ buf = "(null)";
+ *out_buf = buf;
+ if (out_buf_end) { *out_buf_end = buf + ImStrlen(buf); }
+ }
+ else if (fmt[0] == '%' && fmt[1] == '.' && fmt[2] == '*' && fmt[3] == 's' && fmt[4] == 0)
+ {
+ int buf_len = va_arg(args, int); // Skip formatting when using "%.*s"
+ const char* buf = va_arg(args, const char*);
+ if (buf == NULL)
+ {
+ buf = "(null)";
+ buf_len = ImMin(buf_len, 6);
+ }
+ *out_buf = buf;
+ *out_buf_end = buf + buf_len; // Disallow not passing 'out_buf_end' here. User is expected to use it.
+ }
+ else
+ {
+ int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args);
+ *out_buf = g.TempBuffer.Data;
+ if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; }
+ }
}
+#ifndef IMGUI_ENABLE_SSE4_2_CRC
// CRC32 needs a 1KB lookup table (not cache friendly)
// Although the code to generate the table is simple and shorter than the table itself, using a const table allows us to easily:
// - avoid an unnecessary branch/memory tap, - keep the ImHashXXX functions usable by static constructors, - make it thread-safe.
static const ImU32 GCrc32LookupTable[256] =
{
+#ifdef IMGUI_USE_LEGACY_CRC32_ADLER
+ // Legacy CRC32-adler table used pre 1.91.6 (before 2024/11/27). Only use if you cannot afford invalidating old .ini data.
0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3,0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91,
0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7,0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5,
0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B,0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59,
@@ -1833,19 +2207,51 @@ static const ImU32 GCrc32LookupTable[256] =
0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777,0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45,
0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB,0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9,
0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF,0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D,
+#else
+ // CRC32c table compatible with SSE 4.2 instructions
+ 0x00000000,0xF26B8303,0xE13B70F7,0x1350F3F4,0xC79A971F,0x35F1141C,0x26A1E7E8,0xD4CA64EB,0x8AD958CF,0x78B2DBCC,0x6BE22838,0x9989AB3B,0x4D43CFD0,0xBF284CD3,0xAC78BF27,0x5E133C24,
+ 0x105EC76F,0xE235446C,0xF165B798,0x030E349B,0xD7C45070,0x25AFD373,0x36FF2087,0xC494A384,0x9A879FA0,0x68EC1CA3,0x7BBCEF57,0x89D76C54,0x5D1D08BF,0xAF768BBC,0xBC267848,0x4E4DFB4B,
+ 0x20BD8EDE,0xD2D60DDD,0xC186FE29,0x33ED7D2A,0xE72719C1,0x154C9AC2,0x061C6936,0xF477EA35,0xAA64D611,0x580F5512,0x4B5FA6E6,0xB93425E5,0x6DFE410E,0x9F95C20D,0x8CC531F9,0x7EAEB2FA,
+ 0x30E349B1,0xC288CAB2,0xD1D83946,0x23B3BA45,0xF779DEAE,0x05125DAD,0x1642AE59,0xE4292D5A,0xBA3A117E,0x4851927D,0x5B016189,0xA96AE28A,0x7DA08661,0x8FCB0562,0x9C9BF696,0x6EF07595,
+ 0x417B1DBC,0xB3109EBF,0xA0406D4B,0x522BEE48,0x86E18AA3,0x748A09A0,0x67DAFA54,0x95B17957,0xCBA24573,0x39C9C670,0x2A993584,0xD8F2B687,0x0C38D26C,0xFE53516F,0xED03A29B,0x1F682198,
+ 0x5125DAD3,0xA34E59D0,0xB01EAA24,0x42752927,0x96BF4DCC,0x64D4CECF,0x77843D3B,0x85EFBE38,0xDBFC821C,0x2997011F,0x3AC7F2EB,0xC8AC71E8,0x1C661503,0xEE0D9600,0xFD5D65F4,0x0F36E6F7,
+ 0x61C69362,0x93AD1061,0x80FDE395,0x72966096,0xA65C047D,0x5437877E,0x4767748A,0xB50CF789,0xEB1FCBAD,0x197448AE,0x0A24BB5A,0xF84F3859,0x2C855CB2,0xDEEEDFB1,0xCDBE2C45,0x3FD5AF46,
+ 0x7198540D,0x83F3D70E,0x90A324FA,0x62C8A7F9,0xB602C312,0x44694011,0x5739B3E5,0xA55230E6,0xFB410CC2,0x092A8FC1,0x1A7A7C35,0xE811FF36,0x3CDB9BDD,0xCEB018DE,0xDDE0EB2A,0x2F8B6829,
+ 0x82F63B78,0x709DB87B,0x63CD4B8F,0x91A6C88C,0x456CAC67,0xB7072F64,0xA457DC90,0x563C5F93,0x082F63B7,0xFA44E0B4,0xE9141340,0x1B7F9043,0xCFB5F4A8,0x3DDE77AB,0x2E8E845F,0xDCE5075C,
+ 0x92A8FC17,0x60C37F14,0x73938CE0,0x81F80FE3,0x55326B08,0xA759E80B,0xB4091BFF,0x466298FC,0x1871A4D8,0xEA1A27DB,0xF94AD42F,0x0B21572C,0xDFEB33C7,0x2D80B0C4,0x3ED04330,0xCCBBC033,
+ 0xA24BB5A6,0x502036A5,0x4370C551,0xB11B4652,0x65D122B9,0x97BAA1BA,0x84EA524E,0x7681D14D,0x2892ED69,0xDAF96E6A,0xC9A99D9E,0x3BC21E9D,0xEF087A76,0x1D63F975,0x0E330A81,0xFC588982,
+ 0xB21572C9,0x407EF1CA,0x532E023E,0xA145813D,0x758FE5D6,0x87E466D5,0x94B49521,0x66DF1622,0x38CC2A06,0xCAA7A905,0xD9F75AF1,0x2B9CD9F2,0xFF56BD19,0x0D3D3E1A,0x1E6DCDEE,0xEC064EED,
+ 0xC38D26C4,0x31E6A5C7,0x22B65633,0xD0DDD530,0x0417B1DB,0xF67C32D8,0xE52CC12C,0x1747422F,0x49547E0B,0xBB3FFD08,0xA86F0EFC,0x5A048DFF,0x8ECEE914,0x7CA56A17,0x6FF599E3,0x9D9E1AE0,
+ 0xD3D3E1AB,0x21B862A8,0x32E8915C,0xC083125F,0x144976B4,0xE622F5B7,0xF5720643,0x07198540,0x590AB964,0xAB613A67,0xB831C993,0x4A5A4A90,0x9E902E7B,0x6CFBAD78,0x7FAB5E8C,0x8DC0DD8F,
+ 0xE330A81A,0x115B2B19,0x020BD8ED,0xF0605BEE,0x24AA3F05,0xD6C1BC06,0xC5914FF2,0x37FACCF1,0x69E9F0D5,0x9B8273D6,0x88D28022,0x7AB90321,0xAE7367CA,0x5C18E4C9,0x4F48173D,0xBD23943E,
+ 0xF36E6F75,0x0105EC76,0x12551F82,0xE03E9C81,0x34F4F86A,0xC69F7B69,0xD5CF889D,0x27A40B9E,0x79B737BA,0x8BDCB4B9,0x988C474D,0x6AE7C44E,0xBE2DA0A5,0x4C4623A6,0x5F16D052,0xAD7D5351
+#endif
};
+#endif
// Known size hash
// It is ok to call ImHashData on a string with known length but the ### operator won't be supported.
// FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements.
-ImGuiID ImHashData(const void* data_p, size_t data_size, ImU32 seed)
+ImGuiID ImHashData(const void* data_p, size_t data_size, ImGuiID seed)
{
ImU32 crc = ~seed;
const unsigned char* data = (const unsigned char*)data_p;
+ const unsigned char *data_end = (const unsigned char*)data_p + data_size;
+#ifndef IMGUI_ENABLE_SSE4_2_CRC
const ImU32* crc32_lut = GCrc32LookupTable;
- while (data_size-- != 0)
+ while (data < data_end)
crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *data++];
return ~crc;
+#else
+ while (data + 4 <= data_end)
+ {
+ crc = _mm_crc32_u32(crc, *(ImU32*)data);
+ data += 4;
+ }
+ while (data < data_end)
+ crc = _mm_crc32_u8(crc, *data++);
+ return ~crc;
+#endif
}
// Zero-terminated string hash, with support for ### to reset back to seed value
@@ -1854,12 +2260,14 @@ ImGuiID ImHashData(const void* data_p, size_t data_size, ImU32 seed)
// - If we reach ### in the string we discard the hash so far and reset to the seed.
// - We don't do 'current += 2; continue;' after handling ### to keep the code smaller/faster (measured ~10% diff in Debug build)
// FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements.
-ImGuiID ImHashStr(const char* data_p, size_t data_size, ImU32 seed)
+ImGuiID ImHashStr(const char* data_p, size_t data_size, ImGuiID seed)
{
seed = ~seed;
ImU32 crc = seed;
const unsigned char* data = (const unsigned char*)data_p;
+#ifndef IMGUI_ENABLE_SSE4_2_CRC
const ImU32* crc32_lut = GCrc32LookupTable;
+#endif
if (data_size != 0)
{
while (data_size-- != 0)
@@ -1867,7 +2275,11 @@ ImGuiID ImHashStr(const char* data_p, size_t data_size, ImU32 seed)
unsigned char c = *data++;
if (c == '#' && data_size >= 2 && data[0] == '#' && data[1] == '#')
crc = seed;
+#ifndef IMGUI_ENABLE_SSE4_2_CRC
crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
+#else
+ crc = _mm_crc32_u8(crc, c);
+#endif
}
}
else
@@ -1876,7 +2288,11 @@ ImGuiID ImHashStr(const char* data_p, size_t data_size, ImU32 seed)
{
if (c == '#' && data[0] == '#' && data[1] == '#')
crc = seed;
+#ifndef IMGUI_ENABLE_SSE4_2_CRC
crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
+#else
+ crc = _mm_crc32_u8(crc, c);
+#endif
}
}
return ~crc;
@@ -1891,16 +2307,23 @@ ImGuiID ImHashStr(const char* data_p, size_t data_size, ImU32 seed)
ImFileHandle ImFileOpen(const char* filename, const char* mode)
{
-#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(__CYGWIN__) && !defined(__GNUC__)
+#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && (defined(__MINGW32__) || (!defined(__CYGWIN__) && !defined(__GNUC__)))
// We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames.
// Previously we used ImTextCountCharsFromUtf8/ImTextStrFromUtf8 here but we now need to support ImWchar16 and ImWchar32!
const int filename_wsize = ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0);
const int mode_wsize = ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, NULL, 0);
- ImVector<ImWchar> buf;
- buf.resize(filename_wsize + mode_wsize);
- ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, (wchar_t*)&buf[0], filename_wsize);
- ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, (wchar_t*)&buf[filename_wsize], mode_wsize);
- return ::_wfopen((const wchar_t*)&buf[0], (const wchar_t*)&buf[filename_wsize]);
+
+ // Use stack buffer if possible, otherwise heap buffer. Sizes include zero terminator.
+ // We don't rely on current ImGuiContext as this is implied to be a helper function which doesn't depend on it (see #7314).
+ wchar_t local_temp_stack[FILENAME_MAX];
+ ImVector<wchar_t> local_temp_heap;
+ if (filename_wsize + mode_wsize > IM_ARRAYSIZE(local_temp_stack))
+ local_temp_heap.resize(filename_wsize + mode_wsize);
+ wchar_t* filename_wbuf = local_temp_heap.Data ? local_temp_heap.Data : local_temp_stack;
+ wchar_t* mode_wbuf = filename_wbuf + filename_wsize;
+ ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, filename_wbuf, filename_wsize);
+ ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, mode_wbuf, mode_wsize);
+ return ::_wfopen(filename_wbuf, mode_wbuf);
#else
return fopen(filename, mode);
#endif
@@ -1959,6 +2382,8 @@ void* ImFileLoadToMemory(const char* filename, const char* mode, size_t* out_f
// [SECTION] MISC HELPERS/UTILITIES (ImText* functions)
//-----------------------------------------------------------------------------
+IM_MSVC_RUNTIME_CHECKS_OFF
+
// Convert UTF-8 to 32-bit character, process single character input.
// A nearly-branchless UTF-8 decoder, based on work of Christopher Wellons (https://github.com/skeeto/branchless-utf8).
// We handle UTF-8 decoding error by skipping forward.
@@ -1970,7 +2395,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char*
static const int shiftc[] = { 0, 18, 12, 6, 0 };
static const int shifte[] = { 0, 6, 4, 2, 0 };
int len = lengths[*(const unsigned char*)in_text >> 3];
- int wanted = len + !len;
+ int wanted = len + (len ? 0 : 1);
if (in_text_end == NULL)
in_text_end = in_text + wanted; // Max length, nulls will be taken into account.
@@ -1994,7 +2419,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char*
int e = 0;
e = (*out_char < mins[len]) << 6; // non-canonical encoding
e |= ((*out_char >> 11) == 0x1b) << 7; // surrogate half?
- e |= (*out_char > IM_UNICODE_CODEPOINT_MAX) << 8; // out of range?
+ e |= (*out_char > IM_UNICODE_CODEPOINT_MAX) << 8; // out of range we can store in ImWchar (FIXME: May evolve)
e |= (s[1] & 0xc0) >> 2;
e |= (s[2] & 0xc0) >> 4;
e |= (s[3] ) >> 6;
@@ -2022,8 +2447,6 @@ int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const cha
{
unsigned int c;
in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
- if (c == 0)
- break;
*buf_out++ = (ImWchar)c;
}
*buf_out = 0;
@@ -2039,8 +2462,6 @@ int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
{
unsigned int c;
in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
- if (c == 0)
- break;
char_count++;
}
return char_count;
@@ -2135,6 +2556,33 @@ int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_e
return bytes_count;
}
+const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_text_curr)
+{
+ while (in_text_curr > in_text_start)
+ {
+ in_text_curr--;
+ if ((*in_text_curr & 0xC0) != 0x80)
+ return in_text_curr;
+ }
+ return in_text_start;
+}
+
+int ImTextCountLines(const char* in_text, const char* in_text_end)
+{
+ if (in_text_end == NULL)
+ in_text_end = in_text + ImStrlen(in_text); // FIXME-OPT: Not optimal approach, discourage use for now.
+ int count = 0;
+ while (in_text < in_text_end)
+ {
+ const char* line_end = (const char*)ImMemchr(in_text, '\n', in_text_end - in_text);
+ in_text = line_end ? line_end + 1 : in_text_end;
+ count++;
+ }
+ return count;
+}
+
+IM_MSVC_RUNTIME_CHECKS_RESTORE
+
//-----------------------------------------------------------------------------
// [SECTION] MISC HELPERS/UTILITIES (Color functions)
// Note: The Convert functions are early design which are not consistent with other API.
@@ -2226,18 +2674,16 @@ void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float&
//-----------------------------------------------------------------------------
// std::lower_bound but without the bullshit
-static ImGuiStorage::ImGuiStoragePair* LowerBound(ImVector<ImGuiStorage::ImGuiStoragePair>& data, ImGuiID key)
+ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key)
{
- ImGuiStorage::ImGuiStoragePair* first = data.Data;
- ImGuiStorage::ImGuiStoragePair* last = data.Data + data.Size;
- size_t count = (size_t)(last - first);
- while (count > 0)
+ ImGuiStoragePair* in_p = in_begin;
+ for (size_t count = (size_t)(in_end - in_p); count > 0; )
{
size_t count2 = count >> 1;
- ImGuiStorage::ImGuiStoragePair* mid = first + count2;
+ ImGuiStoragePair* mid = in_p + count2;
if (mid->key < key)
{
- first = ++mid;
+ in_p = ++mid;
count -= count2 + 1;
}
else
@@ -2245,29 +2691,28 @@ static ImGuiStorage::ImGuiStoragePair* LowerBound(ImVector<ImGuiStorage::ImGuiSt
count = count2;
}
}
- return first;
+ return in_p;
+}
+
+IM_MSVC_RUNTIME_CHECKS_OFF
+static int IMGUI_CDECL PairComparerByID(const void* lhs, const void* rhs)
+{
+ // We can't just do a subtraction because qsort uses signed integers and subtracting our ID doesn't play well with that.
+ ImGuiID lhs_v = ((const ImGuiStoragePair*)lhs)->key;
+ ImGuiID rhs_v = ((const ImGuiStoragePair*)rhs)->key;
+ return (lhs_v > rhs_v ? +1 : lhs_v < rhs_v ? -1 : 0);
}
// For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once.
void ImGuiStorage::BuildSortByKey()
{
- struct StaticFunc
- {
- static int IMGUI_CDECL PairComparerByID(const void* lhs, const void* rhs)
- {
- // We can't just do a subtraction because qsort uses signed integers and subtracting our ID doesn't play well with that.
- if (((const ImGuiStoragePair*)lhs)->key > ((const ImGuiStoragePair*)rhs)->key) return +1;
- if (((const ImGuiStoragePair*)lhs)->key < ((const ImGuiStoragePair*)rhs)->key) return -1;
- return 0;
- }
- };
- ImQsort(Data.Data, (size_t)Data.Size, sizeof(ImGuiStoragePair), StaticFunc::PairComparerByID);
+ ImQsort(Data.Data, (size_t)Data.Size, sizeof(ImGuiStoragePair), PairComparerByID);
}
int ImGuiStorage::GetInt(ImGuiID key, int default_val) const
{
- ImGuiStoragePair* it = LowerBound(const_cast<ImVector<ImGuiStoragePair>&>(Data), key);
- if (it == Data.end() || it->key != key)
+ ImGuiStoragePair* it = ImLowerBound(const_cast<ImGuiStoragePair*>(Data.Data), const_cast<ImGuiStoragePair*>(Data.Data + Data.Size), key);
+ if (it == Data.Data + Data.Size || it->key != key)
return default_val;
return it->val_i;
}
@@ -2279,16 +2724,16 @@ bool ImGuiStorage::GetBool(ImGuiID key, bool default_val) const
float ImGuiStorage::GetFloat(ImGuiID key, float default_val) const
{
- ImGuiStoragePair* it = LowerBound(const_cast<ImVector<ImGuiStoragePair>&>(Data), key);
- if (it == Data.end() || it->key != key)
+ ImGuiStoragePair* it = ImLowerBound(const_cast<ImGuiStoragePair*>(Data.Data), const_cast<ImGuiStoragePair*>(Data.Data + Data.Size), key);
+ if (it == Data.Data + Data.Size || it->key != key)
return default_val;
return it->val_f;
}
void* ImGuiStorage::GetVoidPtr(ImGuiID key) const
{
- ImGuiStoragePair* it = LowerBound(const_cast<ImVector<ImGuiStoragePair>&>(Data), key);
- if (it == Data.end() || it->key != key)
+ ImGuiStoragePair* it = ImLowerBound(const_cast<ImGuiStoragePair*>(Data.Data), const_cast<ImGuiStoragePair*>(Data.Data + Data.Size), key);
+ if (it == Data.Data + Data.Size || it->key != key)
return NULL;
return it->val_p;
}
@@ -2296,8 +2741,8 @@ void* ImGuiStorage::GetVoidPtr(ImGuiID key) const
// References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer.
int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val)
{
- ImGuiStoragePair* it = LowerBound(Data, key);
- if (it == Data.end() || it->key != key)
+ ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key);
+ if (it == Data.Data + Data.Size || it->key != key)
it = Data.insert(it, ImGuiStoragePair(key, default_val));
return &it->val_i;
}
@@ -2309,16 +2754,16 @@ bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val)
float* ImGuiStorage::GetFloatRef(ImGuiID key, float default_val)
{
- ImGuiStoragePair* it = LowerBound(Data, key);
- if (it == Data.end() || it->key != key)
+ ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key);
+ if (it == Data.Data + Data.Size || it->key != key)
it = Data.insert(it, ImGuiStoragePair(key, default_val));
return &it->val_f;
}
void** ImGuiStorage::GetVoidPtrRef(ImGuiID key, void* default_val)
{
- ImGuiStoragePair* it = LowerBound(Data, key);
- if (it == Data.end() || it->key != key)
+ ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key);
+ if (it == Data.Data + Data.Size || it->key != key)
it = Data.insert(it, ImGuiStoragePair(key, default_val));
return &it->val_p;
}
@@ -2326,13 +2771,11 @@ void** ImGuiStorage::GetVoidPtrRef(ImGuiID key, void* default_val)
// FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame)
void ImGuiStorage::SetInt(ImGuiID key, int val)
{
- ImGuiStoragePair* it = LowerBound(Data, key);
- if (it == Data.end() || it->key != key)
- {
+ ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key);
+ if (it == Data.Data + Data.Size || it->key != key)
Data.insert(it, ImGuiStoragePair(key, val));
- return;
- }
- it->val_i = val;
+ else
+ it->val_i = val;
}
void ImGuiStorage::SetBool(ImGuiID key, bool val)
@@ -2342,24 +2785,20 @@ void ImGuiStorage::SetBool(ImGuiID key, bool val)
void ImGuiStorage::SetFloat(ImGuiID key, float val)
{
- ImGuiStoragePair* it = LowerBound(Data, key);
- if (it == Data.end() || it->key != key)
- {
+ ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key);
+ if (it == Data.Data + Data.Size || it->key != key)
Data.insert(it, ImGuiStoragePair(key, val));
- return;
- }
- it->val_f = val;
+ else
+ it->val_f = val;
}
void ImGuiStorage::SetVoidPtr(ImGuiID key, void* val)
{
- ImGuiStoragePair* it = LowerBound(Data, key);
- if (it == Data.end() || it->key != key)
- {
+ ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key);
+ if (it == Data.Data + Data.Size || it->key != key)
Data.insert(it, ImGuiStoragePair(key, val));
- return;
- }
- it->val_p = val;
+ else
+ it->val_p = val;
}
void ImGuiStorage::SetAllInt(int v)
@@ -2367,6 +2806,7 @@ void ImGuiStorage::SetAllInt(int v)
for (int i = 0; i < Data.Size; i++)
Data[i].val_i = v;
}
+IM_MSVC_RUNTIME_CHECKS_RESTORE
//-----------------------------------------------------------------------------
// [SECTION] ImGuiTextFilter
@@ -2415,36 +2855,34 @@ void ImGuiTextFilter::ImGuiTextRange::split(char separator, ImVector<ImGuiTextRa
void ImGuiTextFilter::Build()
{
Filters.resize(0);
- ImGuiTextRange input_range(InputBuf, InputBuf + strlen(InputBuf));
+ ImGuiTextRange input_range(InputBuf, InputBuf + ImStrlen(InputBuf));
input_range.split(',', &Filters);
CountGrep = 0;
- for (int i = 0; i != Filters.Size; i++)
+ for (ImGuiTextRange& f : Filters)
{
- ImGuiTextRange& f = Filters[i];
while (f.b < f.e && ImCharIsBlankA(f.b[0]))
f.b++;
while (f.e > f.b && ImCharIsBlankA(f.e[-1]))
f.e--;
if (f.empty())
continue;
- if (Filters[i].b[0] != '-')
+ if (f.b[0] != '-')
CountGrep += 1;
}
}
bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const
{
- if (Filters.empty())
+ if (Filters.Size == 0)
return true;
if (text == NULL)
- text = "";
+ text = text_end = "";
- for (int i = 0; i != Filters.Size; i++)
+ for (const ImGuiTextRange& f : Filters)
{
- const ImGuiTextRange& f = Filters[i];
- if (f.empty())
+ if (f.b == f.e)
continue;
if (f.b[0] == '-')
{
@@ -2485,7 +2923,7 @@ char ImGuiTextBuffer::EmptyString[1] = { 0 };
void ImGuiTextBuffer::append(const char* str, const char* str_end)
{
- int len = str_end ? (int)(str_end - str) : (int)strlen(str);
+ int len = str_end ? (int)(str_end - str) : (int)ImStrlen(str);
// Add zero-terminator the first time
const int write_off = (Buf.Size != 0) ? Buf.Size : 1;
@@ -2544,7 +2982,7 @@ void ImGuiTextIndex::append(const char* base, int old_size, int new_size)
if (EndOffset == 0 || base[EndOffset - 1] == '\n')
LineOffsets.push_back(EndOffset);
const char* base_end = base + new_size;
- for (const char* p = base + old_size; (p = (const char*)memchr(p, '\n', base_end - p)) != 0; )
+ for (const char* p = base + old_size; (p = (const char*)ImMemchr(p, '\n', base_end - p)) != 0; )
if (++p < base_end) // Don't push a trailing offset on last \n
LineOffsets.push_back((int)(intptr_t)(p - base));
EndOffset = ImMax(EndOffset, new_size);
@@ -2552,8 +2990,6 @@ void ImGuiTextIndex::append(const char* base, int old_size, int new_size)
//-----------------------------------------------------------------------------
// [SECTION] ImGuiListClipper
-// This is currently not as flexible/powerful as it should be and really confusing/spaghetti, mostly because we changed
-// the API mid-way through development and support two ways to using the clipper, needs some rework (see TODO)
//-----------------------------------------------------------------------------
// FIXME-TABLE: This prevents us from using ImGuiListClipper _inside_ a table cell.
@@ -2564,54 +3000,6 @@ static bool GetSkipItemForListClipping()
return (g.CurrentTable ? g.CurrentTable->HostSkipItems : g.CurrentWindow->SkipItems);
}
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-// Legacy helper to calculate coarse clipping of large list of evenly sized items.
-// This legacy API is not ideal because it assumes we will return a single contiguous rectangle.
-// Prefer using ImGuiListClipper which can returns non-contiguous ranges.
-void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end)
-{
- ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
- if (g.LogEnabled)
- {
- // If logging is active, do not perform any clipping
- *out_items_display_start = 0;
- *out_items_display_end = items_count;
- return;
- }
- if (GetSkipItemForListClipping())
- {
- *out_items_display_start = *out_items_display_end = 0;
- return;
- }
-
- // We create the union of the ClipRect and the scoring rect which at worst should be 1 page away from ClipRect
- // We don't include g.NavId's rectangle in there (unless g.NavJustMovedToId is set) because the rectangle enlargement can get costly.
- ImRect rect = window->ClipRect;
- if (g.NavMoveScoringItems)
- rect.Add(g.NavScoringNoClipRect);
- if (g.NavJustMovedToId && window->NavLastIds[0] == g.NavJustMovedToId)
- rect.Add(WindowRectRelToAbs(window, window->NavRectRel[0])); // Could store and use NavJustMovedToRectRel
-
- const ImVec2 pos = window->DC.CursorPos;
- int start = (int)((rect.Min.y - pos.y) / items_height);
- int end = (int)((rect.Max.y - pos.y) / items_height);
-
- // When performing a navigation request, ensure we have one item extra in the direction we are moving to
- // FIXME: Verify this works with tabbing
- const bool is_nav_request = (g.NavMoveScoringItems && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav);
- if (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up)
- start--;
- if (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down)
- end++;
-
- start = ImClamp(start, 0, items_count);
- end = ImClamp(end + 1, start, items_count);
- *out_items_display_start = start;
- *out_items_display_end = end;
-}
-#endif
-
static void ImGuiListClipper_SortAndFuseRanges(ImVector<ImGuiListClipperRange>& ranges, int offset = 0)
{
if (ranges.Size - offset <= 1)
@@ -2661,19 +3049,9 @@ static void ImGuiListClipper_SeekCursorAndSetupPrevLine(float pos_y, float line_
}
}
-static void ImGuiListClipper_SeekCursorForItem(ImGuiListClipper* clipper, int item_n)
-{
- // StartPosY starts from ItemsFrozen hence the subtraction
- // Perform the add and multiply with double to allow seeking through larger ranges
- ImGuiListClipperData* data = (ImGuiListClipperData*)clipper->TempData;
- float pos_y = (float)((double)clipper->StartPosY + data->LossynessOffset + (double)(item_n - data->ItemsFrozen) * clipper->ItemsHeight);
- ImGuiListClipper_SeekCursorAndSetupPrevLine(pos_y, clipper->ItemsHeight);
-}
-
ImGuiListClipper::ImGuiListClipper()
{
memset(this, 0, sizeof(*this));
- ItemsCount = -1;
}
ImGuiListClipper::~ImGuiListClipper()
@@ -2683,7 +3061,10 @@ ImGuiListClipper::~ImGuiListClipper()
void ImGuiListClipper::Begin(int items_count, float items_height)
{
- ImGuiContext& g = *GImGui;
+ if (Ctx == NULL)
+ Ctx = ImGui::GetCurrentContext();
+
+ ImGuiContext& g = *Ctx;
ImGuiWindow* window = g.CurrentWindow;
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Begin(%d,%.2f) in '%s'\n", items_count, items_height, window->Name);
@@ -2704,17 +3085,18 @@ void ImGuiListClipper::Begin(int items_count, float items_height)
data->Reset(this);
data->LossynessOffset = window->DC.CursorStartPosLossyness.y;
TempData = data;
+ StartSeekOffsetY = data->LossynessOffset;
}
void ImGuiListClipper::End()
{
- ImGuiContext& g = *GImGui;
if (ImGuiListClipperData* data = (ImGuiListClipperData*)TempData)
{
// In theory here we should assert that we are already at the right position, but it seems saner to just seek at the end and not assert/crash the user.
+ ImGuiContext& g = *Ctx;
IMGUI_DEBUG_LOG_CLIPPER("Clipper: End() in '%s'\n", g.CurrentWindow->Name);
if (ItemsCount >= 0 && ItemsCount < INT_MAX && DisplayStart >= 0)
- ImGuiListClipper_SeekCursorForItem(this, ItemsCount);
+ SeekCursorForItem(ItemsCount);
// Restore temporary buffer and fix back pointers which may be invalidated when nesting
IM_ASSERT(data->ListClipper == this);
@@ -2729,18 +3111,29 @@ void ImGuiListClipper::End()
ItemsCount = -1;
}
-void ImGuiListClipper::ForceDisplayRangeByIndices(int item_min, int item_max)
+void ImGuiListClipper::IncludeItemsByIndex(int item_begin, int item_end)
{
ImGuiListClipperData* data = (ImGuiListClipperData*)TempData;
IM_ASSERT(DisplayStart < 0); // Only allowed after Begin() and if there has not been a specified range yet.
- IM_ASSERT(item_min <= item_max);
- if (item_min < item_max)
- data->Ranges.push_back(ImGuiListClipperRange::FromIndices(item_min, item_max));
+ IM_ASSERT(item_begin <= item_end);
+ if (item_begin < item_end)
+ data->Ranges.push_back(ImGuiListClipperRange::FromIndices(item_begin, item_end));
+}
+
+// This is already called while stepping.
+// The ONLY reason you may want to call this is if you passed INT_MAX to ImGuiListClipper::Begin() because you couldn't step item count beforehand.
+void ImGuiListClipper::SeekCursorForItem(int item_n)
+{
+ // - Perform the add and multiply with double to allow seeking through larger ranges.
+ // - StartPosY starts from ItemsFrozen, by adding SeekOffsetY we generally cancel that out (SeekOffsetY == LossynessOffset - ItemsFrozen * ItemsHeight).
+ // - The reason we store SeekOffsetY instead of inferring it, is because we want to allow user to perform Seek after the last step, where ImGuiListClipperData is already done.
+ float pos_y = (float)((double)StartPosY + StartSeekOffsetY + (double)item_n * ItemsHeight);
+ ImGuiListClipper_SeekCursorAndSetupPrevLine(pos_y, ItemsHeight);
}
static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
{
- ImGuiContext& g = *GImGui;
+ ImGuiContext& g = *clipper->Ctx;
ImGuiWindow* window = g.CurrentWindow;
ImGuiListClipperData* data = (ImGuiListClipperData*)clipper->TempData;
IM_ASSERT(data != NULL && "Called ImGuiListClipper::Step() too many times, or before ImGuiListClipper::Begin() ?");
@@ -2792,7 +3185,8 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
bool affected_by_floating_point_precision = ImIsFloatAboveGuaranteedIntegerPrecision(clipper->StartPosY) || ImIsFloatAboveGuaranteedIntegerPrecision(window->DC.CursorPos.y);
if (affected_by_floating_point_precision)
clipper->ItemsHeight = window->DC.PrevLineSize.y + g.Style.ItemSpacing.y; // FIXME: Technically wouldn't allow multi-line entries.
-
+ if (clipper->ItemsHeight == 0.0f && clipper->ItemsCount == INT_MAX) // Accept that no item have been submitted if in indeterminate mode.
+ return false;
IM_ASSERT(clipper->ItemsHeight > 0.0f && "Unable to calculate item height! First item hasn't moved the cursor vertically!");
calc_clipping = true; // If item height had to be calculated, calculate clipping afterwards.
}
@@ -2801,6 +3195,9 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
const int already_submitted = clipper->DisplayEnd;
if (calc_clipping)
{
+ // Record seek offset, this is so ImGuiListClipper::Seek() can be called after ImGuiListClipperData is done
+ clipper->StartSeekOffsetY = (double)data->LossynessOffset - data->ItemsFrozen * (double)clipper->ItemsHeight;
+
if (g.LogEnabled)
{
// If logging is active, do not perform any clipping
@@ -2812,7 +3209,7 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
const bool is_nav_request = (g.NavMoveScoringItems && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav);
if (is_nav_request)
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringNoClipRect.Min.y, g.NavScoringNoClipRect.Max.y, 0, 0));
- if (is_nav_request && (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) && g.NavTabbingDir == -1)
+ if (is_nav_request && (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) && g.NavTabbingDir == -1)
data->Ranges.push_back(ImGuiListClipperRange::FromIndices(clipper->ItemsCount - 1, clipper->ItemsCount));
// Add focused/active item
@@ -2821,63 +3218,86 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(nav_rect_abs.Min.y, nav_rect_abs.Max.y, 0, 0));
// Add visible range
+ float min_y = window->ClipRect.Min.y;
+ float max_y = window->ClipRect.Max.y;
+
+ // Add box selection range
+ ImGuiBoxSelectState* bs = &g.BoxSelectState;
+ if (bs->IsActive && bs->Window == window)
+ {
+ // FIXME: Selectable() use of half-ItemSpacing isn't consistent in matter of layout, as ItemAdd(bb) stray above ItemSize()'s CursorPos.
+ // RangeSelect's BoxSelect relies on comparing overlap of previous and current rectangle and is sensitive to that.
+ // As a workaround we currently half ItemSpacing worth on each side.
+ min_y -= g.Style.ItemSpacing.y;
+ max_y += g.Style.ItemSpacing.y;
+
+ // Box-select on 2D area requires different clipping.
+ if (bs->UnclipMode)
+ data->Ranges.push_back(ImGuiListClipperRange::FromPositions(bs->UnclipRect.Min.y, bs->UnclipRect.Max.y, 0, 0));
+ }
+
const int off_min = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up) ? -1 : 0;
const int off_max = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down) ? 1 : 0;
- data->Ranges.push_back(ImGuiListClipperRange::FromPositions(window->ClipRect.Min.y, window->ClipRect.Max.y, off_min, off_max));
+ data->Ranges.push_back(ImGuiListClipperRange::FromPositions(min_y, max_y, off_min, off_max));
}
// Convert position ranges to item index ranges
// - Very important: when a starting position is after our maximum item, we set Min to (ItemsCount - 1). This allows us to handle most forms of wrapping.
// - Due to how Selectable extra padding they tend to be "unaligned" with exact unit in the item list,
// which with the flooring/ceiling tend to lead to 2 items instead of one being submitted.
- for (int i = 0; i < data->Ranges.Size; i++)
- if (data->Ranges[i].PosToIndexConvert)
+ for (ImGuiListClipperRange& range : data->Ranges)
+ if (range.PosToIndexConvert)
{
- int m1 = (int)(((double)data->Ranges[i].Min - window->DC.CursorPos.y - data->LossynessOffset) / clipper->ItemsHeight);
- int m2 = (int)((((double)data->Ranges[i].Max - window->DC.CursorPos.y - data->LossynessOffset) / clipper->ItemsHeight) + 0.999999f);
- data->Ranges[i].Min = ImClamp(already_submitted + m1 + data->Ranges[i].PosToIndexOffsetMin, already_submitted, clipper->ItemsCount - 1);
- data->Ranges[i].Max = ImClamp(already_submitted + m2 + data->Ranges[i].PosToIndexOffsetMax, data->Ranges[i].Min + 1, clipper->ItemsCount);
- data->Ranges[i].PosToIndexConvert = false;
+ int m1 = (int)(((double)range.Min - window->DC.CursorPos.y - data->LossynessOffset) / clipper->ItemsHeight);
+ int m2 = (int)((((double)range.Max - window->DC.CursorPos.y - data->LossynessOffset) / clipper->ItemsHeight) + 0.999999f);
+ range.Min = ImClamp(already_submitted + m1 + range.PosToIndexOffsetMin, already_submitted, clipper->ItemsCount - 1);
+ range.Max = ImClamp(already_submitted + m2 + range.PosToIndexOffsetMax, range.Min + 1, clipper->ItemsCount);
+ range.PosToIndexConvert = false;
}
ImGuiListClipper_SortAndFuseRanges(data->Ranges, data->StepNo);
}
// Step 0+ (if item height is given in advance) or 1+: Display the next range in line.
- if (data->StepNo < data->Ranges.Size)
+ while (data->StepNo < data->Ranges.Size)
{
clipper->DisplayStart = ImMax(data->Ranges[data->StepNo].Min, already_submitted);
clipper->DisplayEnd = ImMin(data->Ranges[data->StepNo].Max, clipper->ItemsCount);
- if (clipper->DisplayStart > already_submitted) //-V1051
- ImGuiListClipper_SeekCursorForItem(clipper, clipper->DisplayStart);
data->StepNo++;
+ if (clipper->DisplayStart >= clipper->DisplayEnd)
+ continue;
+ if (clipper->DisplayStart > already_submitted)
+ clipper->SeekCursorForItem(clipper->DisplayStart);
return true;
}
// After the last step: Let the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd),
// Advance the cursor to the end of the list and then returns 'false' to end the loop.
if (clipper->ItemsCount < INT_MAX)
- ImGuiListClipper_SeekCursorForItem(clipper, clipper->ItemsCount);
+ clipper->SeekCursorForItem(clipper->ItemsCount);
return false;
}
bool ImGuiListClipper::Step()
{
- ImGuiContext& g = *GImGui;
+ ImGuiContext& g = *Ctx;
bool need_items_height = (ItemsHeight <= 0.0f);
bool ret = ImGuiListClipper_StepInternal(this);
- if (ret && (DisplayStart == DisplayEnd))
+ if (ret && (DisplayStart >= DisplayEnd))
ret = false;
if (g.CurrentTable && g.CurrentTable->IsUnfrozenRows == false)
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): inside frozen table row.\n");
if (need_items_height && ItemsHeight > 0.0f)
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): computed ItemsHeight: %.2f.\n", ItemsHeight);
if (ret)
+ {
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): display %d to %d.\n", DisplayStart, DisplayEnd);
+ }
else
+ {
IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): End.\n");
- if (!ret)
End();
+ }
return ret;
}
@@ -2913,13 +3333,14 @@ const ImVec4& ImGui::GetStyleColorVec4(ImGuiCol idx)
return style.Colors[idx];
}
-ImU32 ImGui::GetColorU32(ImU32 col)
+ImU32 ImGui::GetColorU32(ImU32 col, float alpha_mul)
{
ImGuiStyle& style = GImGui->Style;
- if (style.Alpha >= 1.0f)
+ alpha_mul *= style.Alpha;
+ if (alpha_mul >= 1.0f)
return col;
ImU32 a = (col & IM_COL32_A_MASK) >> IM_COL32_A_SHIFT;
- a = (ImU32)(a * style.Alpha); // We don't need to clamp 0..255 because Style.Alpha is in 0..1 range.
+ a = (ImU32)(a * alpha_mul); // We don't need to clamp 0..255 because alpha is in 0..1 range.
return (col & ~IM_COL32_A_MASK) | (a << IM_COL32_A_SHIFT);
}
@@ -2931,7 +3352,8 @@ void ImGui::PushStyleColor(ImGuiCol idx, ImU32 col)
backup.Col = idx;
backup.BackupValue = g.Style.Colors[idx];
g.ColorStack.push_back(backup);
- g.Style.Colors[idx] = ColorConvertU32ToFloat4(col);
+ if (g.DebugFlashStyleColorIdx != idx)
+ g.Style.Colors[idx] = ColorConvertU32ToFloat4(col);
}
void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col)
@@ -2941,7 +3363,8 @@ void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col)
backup.Col = idx;
backup.BackupValue = g.Style.Colors[idx];
g.ColorStack.push_back(backup);
- g.Style.Colors[idx] = col;
+ if (g.DebugFlashStyleColorIdx != idx)
+ g.Style.Colors[idx] = col;
}
void ImGui::PopStyleColor(int count)
@@ -2949,7 +3372,7 @@ void ImGui::PopStyleColor(int count)
ImGuiContext& g = *GImGui;
if (g.ColorStack.Size < count)
{
- IM_ASSERT_USER_ERROR(g.ColorStack.Size > count, "Calling PopStyleColor() too many times: stack underflow.");
+ IM_ASSERT_USER_ERROR(0, "Calling PopStyleColor() too many times!");
count = g.ColorStack.Size;
}
while (count > 0)
@@ -2961,76 +3384,105 @@ void ImGui::PopStyleColor(int count)
}
}
-struct ImGuiStyleVarInfo
-{
- ImGuiDataType Type;
- ImU32 Count;
- ImU32 Offset;
- void* GetVarPtr(ImGuiStyle* style) const { return (void*)((unsigned char*)style + Offset); }
-};
-
-static const ImGuiStyleVarInfo GStyleVarInfo[] =
-{
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, Alpha) }, // ImGuiStyleVar_Alpha
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, DisabledAlpha) }, // ImGuiStyleVar_DisabledAlpha
- { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowPadding) }, // ImGuiStyleVar_WindowPadding
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowRounding) }, // ImGuiStyleVar_WindowRounding
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowBorderSize) }, // ImGuiStyleVar_WindowBorderSize
- { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowMinSize) }, // ImGuiStyleVar_WindowMinSize
- { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowTitleAlign) }, // ImGuiStyleVar_WindowTitleAlign
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ChildRounding) }, // ImGuiStyleVar_ChildRounding
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ChildBorderSize) }, // ImGuiStyleVar_ChildBorderSize
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, PopupRounding) }, // ImGuiStyleVar_PopupRounding
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, PopupBorderSize) }, // ImGuiStyleVar_PopupBorderSize
- { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, FramePadding) }, // ImGuiStyleVar_FramePadding
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, FrameRounding) }, // ImGuiStyleVar_FrameRounding
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, FrameBorderSize) }, // ImGuiStyleVar_FrameBorderSize
- { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ItemSpacing) }, // ImGuiStyleVar_ItemSpacing
- { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ItemInnerSpacing) }, // ImGuiStyleVar_ItemInnerSpacing
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, IndentSpacing) }, // ImGuiStyleVar_IndentSpacing
- { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, CellPadding) }, // ImGuiStyleVar_CellPadding
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ScrollbarSize) }, // ImGuiStyleVar_ScrollbarSize
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ScrollbarRounding) }, // ImGuiStyleVar_ScrollbarRounding
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabMinSize) }, // ImGuiStyleVar_GrabMinSize
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabRounding) }, // ImGuiStyleVar_GrabRounding
- { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, TabRounding) }, // ImGuiStyleVar_TabRounding
- { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ButtonTextAlign) }, // ImGuiStyleVar_ButtonTextAlign
- { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, SelectableTextAlign) }, // ImGuiStyleVar_SelectableTextAlign
+static const ImGuiStyleVarInfo GStyleVarsInfo[] =
+{
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, Alpha) }, // ImGuiStyleVar_Alpha
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, DisabledAlpha) }, // ImGuiStyleVar_DisabledAlpha
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, WindowPadding) }, // ImGuiStyleVar_WindowPadding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, WindowRounding) }, // ImGuiStyleVar_WindowRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, WindowBorderSize) }, // ImGuiStyleVar_WindowBorderSize
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, WindowMinSize) }, // ImGuiStyleVar_WindowMinSize
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, WindowTitleAlign) }, // ImGuiStyleVar_WindowTitleAlign
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, ChildRounding) }, // ImGuiStyleVar_ChildRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, ChildBorderSize) }, // ImGuiStyleVar_ChildBorderSize
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, PopupRounding) }, // ImGuiStyleVar_PopupRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, PopupBorderSize) }, // ImGuiStyleVar_PopupBorderSize
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, FramePadding) }, // ImGuiStyleVar_FramePadding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, FrameRounding) }, // ImGuiStyleVar_FrameRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, FrameBorderSize) }, // ImGuiStyleVar_FrameBorderSize
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, ItemSpacing) }, // ImGuiStyleVar_ItemSpacing
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, ItemInnerSpacing) }, // ImGuiStyleVar_ItemInnerSpacing
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, IndentSpacing) }, // ImGuiStyleVar_IndentSpacing
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, CellPadding) }, // ImGuiStyleVar_CellPadding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, ScrollbarSize) }, // ImGuiStyleVar_ScrollbarSize
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, ScrollbarRounding) }, // ImGuiStyleVar_ScrollbarRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, GrabMinSize) }, // ImGuiStyleVar_GrabMinSize
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, GrabRounding) }, // ImGuiStyleVar_GrabRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, ImageBorderSize) }, // ImGuiStyleVar_ImageBorderSize
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, TabRounding) }, // ImGuiStyleVar_TabRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, TabBorderSize) }, // ImGuiStyleVar_TabBorderSize
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, TabBarBorderSize) }, // ImGuiStyleVar_TabBarBorderSize
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, TabBarOverlineSize) }, // ImGuiStyleVar_TabBarOverlineSize
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, TableAngledHeadersAngle)}, // ImGuiStyleVar_TableAngledHeadersAngle
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, TableAngledHeadersTextAlign)},// ImGuiStyleVar_TableAngledHeadersTextAlign
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, ButtonTextAlign) }, // ImGuiStyleVar_ButtonTextAlign
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, SelectableTextAlign) }, // ImGuiStyleVar_SelectableTextAlign
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, SeparatorTextBorderSize)}, // ImGuiStyleVar_SeparatorTextBorderSize
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, SeparatorTextAlign) }, // ImGuiStyleVar_SeparatorTextAlign
+ { 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, SeparatorTextPadding) }, // ImGuiStyleVar_SeparatorTextPadding
};
-static const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx)
+const ImGuiStyleVarInfo* ImGui::GetStyleVarInfo(ImGuiStyleVar idx)
{
IM_ASSERT(idx >= 0 && idx < ImGuiStyleVar_COUNT);
- IM_ASSERT(IM_ARRAYSIZE(GStyleVarInfo) == ImGuiStyleVar_COUNT);
- return &GStyleVarInfo[idx];
+ IM_STATIC_ASSERT(IM_ARRAYSIZE(GStyleVarsInfo) == ImGuiStyleVar_COUNT);
+ return &GStyleVarsInfo[idx];
}
void ImGui::PushStyleVar(ImGuiStyleVar idx, float val)
{
+ ImGuiContext& g = *GImGui;
const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx);
- if (var_info->Type == ImGuiDataType_Float && var_info->Count == 1)
+ if (var_info->DataType != ImGuiDataType_Float || var_info->Count != 1)
{
- ImGuiContext& g = *GImGui;
- float* pvar = (float*)var_info->GetVarPtr(&g.Style);
- g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar));
- *pvar = val;
+ IM_ASSERT_USER_ERROR(0, "Calling PushStyleVar() variant with wrong type!");
+ return;
+ }
+ float* pvar = (float*)var_info->GetVarPtr(&g.Style);
+ g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar));
+ *pvar = val;
+}
+
+void ImGui::PushStyleVarX(ImGuiStyleVar idx, float val_x)
+{
+ ImGuiContext& g = *GImGui;
+ const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx);
+ if (var_info->DataType != ImGuiDataType_Float || var_info->Count != 2)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling PushStyleVar() variant with wrong type!");
+ return;
+ }
+ ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style);
+ g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar));
+ pvar->x = val_x;
+}
+
+void ImGui::PushStyleVarY(ImGuiStyleVar idx, float val_y)
+{
+ ImGuiContext& g = *GImGui;
+ const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx);
+ if (var_info->DataType != ImGuiDataType_Float || var_info->Count != 2)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling PushStyleVar() variant with wrong type!");
return;
}
- IM_ASSERT(0 && "Called PushStyleVar() float variant but variable is not a float!");
+ ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style);
+ g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar));
+ pvar->y = val_y;
}
void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val)
{
+ ImGuiContext& g = *GImGui;
const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx);
- if (var_info->Type == ImGuiDataType_Float && var_info->Count == 2)
+ if (var_info->DataType != ImGuiDataType_Float || var_info->Count != 2)
{
- ImGuiContext& g = *GImGui;
- ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style);
- g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar));
- *pvar = val;
+ IM_ASSERT_USER_ERROR(0, "Calling PushStyleVar() variant with wrong type!");
return;
}
- IM_ASSERT(0 && "Called PushStyleVar() ImVec2 variant but variable is not a ImVec2!");
+ ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style);
+ g.StyleVarStack.push_back(ImGuiStyleMod(idx, *pvar));
+ *pvar = val;
}
void ImGui::PopStyleVar(int count)
@@ -3038,17 +3490,17 @@ void ImGui::PopStyleVar(int count)
ImGuiContext& g = *GImGui;
if (g.StyleVarStack.Size < count)
{
- IM_ASSERT_USER_ERROR(g.StyleVarStack.Size > count, "Calling PopStyleVar() too many times: stack underflow.");
+ IM_ASSERT_USER_ERROR(0, "Calling PopStyleVar() too many times!");
count = g.StyleVarStack.Size;
}
while (count > 0)
{
// We avoid a generic memcpy(data, &backup.Backup.., GDataTypeSize[info->Type] * info->Count), the overhead in Debug is not worth it.
ImGuiStyleMod& backup = g.StyleVarStack.back();
- const ImGuiStyleVarInfo* info = GetStyleVarInfo(backup.VarIdx);
- void* data = info->GetVarPtr(&g.Style);
- if (info->Type == ImGuiDataType_Float && info->Count == 1) { ((float*)data)[0] = backup.BackupFloat[0]; }
- else if (info->Type == ImGuiDataType_Float && info->Count == 2) { ((float*)data)[0] = backup.BackupFloat[0]; ((float*)data)[1] = backup.BackupFloat[1]; }
+ const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(backup.VarIdx);
+ void* data = var_info->GetVarPtr(&g.Style);
+ if (var_info->DataType == ImGuiDataType_Float && var_info->Count == 1) { ((float*)data)[0] = backup.BackupFloat[0]; }
+ else if (var_info->DataType == ImGuiDataType_Float && var_info->Count == 2) { ((float*)data)[0] = backup.BackupFloat[0]; ((float*)data)[1] = backup.BackupFloat[1]; }
g.StyleVarStack.pop_back();
count--;
}
@@ -3092,11 +3544,13 @@ const char* ImGui::GetStyleColorName(ImGuiCol idx)
case ImGuiCol_ResizeGrip: return "ResizeGrip";
case ImGuiCol_ResizeGripHovered: return "ResizeGripHovered";
case ImGuiCol_ResizeGripActive: return "ResizeGripActive";
- case ImGuiCol_Tab: return "Tab";
case ImGuiCol_TabHovered: return "TabHovered";
- case ImGuiCol_TabActive: return "TabActive";
- case ImGuiCol_TabUnfocused: return "TabUnfocused";
- case ImGuiCol_TabUnfocusedActive: return "TabUnfocusedActive";
+ case ImGuiCol_Tab: return "Tab";
+ case ImGuiCol_TabSelected: return "TabSelected";
+ case ImGuiCol_TabSelectedOverline: return "TabSelectedOverline";
+ case ImGuiCol_TabDimmed: return "TabDimmed";
+ case ImGuiCol_TabDimmedSelected: return "TabDimmedSelected";
+ case ImGuiCol_TabDimmedSelectedOverline: return "TabDimmedSelectedOverline";
case ImGuiCol_PlotLines: return "PlotLines";
case ImGuiCol_PlotLinesHovered: return "PlotLinesHovered";
case ImGuiCol_PlotHistogram: return "PlotHistogram";
@@ -3106,9 +3560,10 @@ const char* ImGui::GetStyleColorName(ImGuiCol idx)
case ImGuiCol_TableBorderLight: return "TableBorderLight";
case ImGuiCol_TableRowBg: return "TableRowBg";
case ImGuiCol_TableRowBgAlt: return "TableRowBgAlt";
+ case ImGuiCol_TextLink: return "TextLink";
case ImGuiCol_TextSelectedBg: return "TextSelectedBg";
case ImGuiCol_DragDropTarget: return "DragDropTarget";
- case ImGuiCol_NavHighlight: return "NavHighlight";
+ case ImGuiCol_NavCursor: return "NavCursor";
case ImGuiCol_NavWindowingHighlight: return "NavWindowingHighlight";
case ImGuiCol_NavWindowingDimBg: return "NavWindowingDimBg";
case ImGuiCol_ModalWindowDimBg: return "ModalWindowDimBg";
@@ -3117,7 +3572,6 @@ const char* ImGui::GetStyleColorName(ImGuiCol idx)
return "Unknown";
}
-
//-----------------------------------------------------------------------------
// [SECTION] RENDER HELPERS
// Some of those (internal) functions are currently quite a legacy mess - their signature and behavior will change,
@@ -3152,7 +3606,7 @@ void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool
else
{
if (!text_end)
- text_end = text + strlen(text); // FIXME-OPT
+ text_end = text + ImStrlen(text); // FIXME-OPT
text_display_end = text_end;
}
@@ -3170,7 +3624,7 @@ void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end
ImGuiWindow* window = g.CurrentWindow;
if (!text_end)
- text_end = text + strlen(text); // FIXME-OPT
+ text_end = text + ImStrlen(text); // FIXME-OPT
if (text != text_end)
{
@@ -3182,6 +3636,9 @@ void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end
// Default clip_rect uses (pos_min,pos_max)
// Handle clipping on CPU immediately (vs typically let the GPU clip the triangles that are overlapping the clipping rectangle edges)
+// FIXME-OPT: Since we have or calculate text_size we could coarse clip whole block immediately, especally for text above draw_list->DrawList.
+// Effectively as this is called from widget doing their own coarse clipping it's not very valuable presently. Next time function will take
+// better advantage of the render function taking size into account for coarse clipping.
void ImGui::RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_display_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect)
{
// Perform CPU side clipping for single clipped element to avoid using scissor state
@@ -3225,7 +3682,6 @@ void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, cons
LogRenderedText(&pos_min, text, text_display_end);
}
-
// Another overly complex function until we reorganize everything into a nice all-in-one helper.
// This is made more complex because we have dissociated the layout rectangle (pos_min..pos_max) which define _where_ the ellipsis is, from actual clipping of text and limit of the ellipsis display.
// This is because in the context of tabs we selectively hide part of the text when the Close Button appears, but we don't want the ellipsis to move.
@@ -3247,32 +3703,14 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con
// min max ellipsis_max
// <-> this is generally some padding value
- const ImFont* font = draw_list->_Data->Font;
+ ImFont* font = draw_list->_Data->Font;
const float font_size = draw_list->_Data->FontSize;
+ const float font_scale = draw_list->_Data->FontScale;
const char* text_end_ellipsis = NULL;
-
- ImWchar ellipsis_char = font->EllipsisChar;
- int ellipsis_char_count = 1;
- if (ellipsis_char == (ImWchar)-1)
- {
- ellipsis_char = font->DotChar;
- ellipsis_char_count = 3;
- }
- const ImFontGlyph* glyph = font->FindGlyph(ellipsis_char);
-
- float ellipsis_glyph_width = glyph->X1; // Width of the glyph with no padding on either side
- float ellipsis_total_width = ellipsis_glyph_width; // Full width of entire ellipsis
-
- if (ellipsis_char_count > 1)
- {
- // Full ellipsis size without free spacing after it.
- const float spacing_between_dots = 1.0f * (draw_list->_Data->FontSize / font->FontSize);
- ellipsis_glyph_width = glyph->X1 - glyph->X0 + spacing_between_dots;
- ellipsis_total_width = ellipsis_glyph_width * (float)ellipsis_char_count - spacing_between_dots;
- }
+ const float ellipsis_width = font->EllipsisWidth * font_scale;
// We can now claim the space between pos_max.x and ellipsis_max.x
- const float text_avail_width = ImMax((ImMax(pos_max.x, ellipsis_max_x) - ellipsis_total_width) - pos_min.x, 1.0f);
+ const float text_avail_width = ImMax((ImMax(pos_max.x, ellipsis_max_x) - ellipsis_width) - pos_min.x, 1.0f);
float text_size_clipped_x = font->CalcTextSizeA(font_size, text_avail_width, 0.0f, text, text_end_full, &text_end_ellipsis).x;
if (text == text_end_ellipsis && text_end_ellipsis < text_end_full)
{
@@ -3289,13 +3727,10 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con
// Render text, render ellipsis
RenderTextClippedEx(draw_list, pos_min, ImVec2(clip_max_x, pos_max.y), text, text_end_ellipsis, &text_size, ImVec2(0.0f, 0.0f));
- float ellipsis_x = pos_min.x + text_size_clipped_x;
- if (ellipsis_x + ellipsis_total_width <= ellipsis_max_x)
- for (int i = 0; i < ellipsis_char_count; i++)
- {
- font->RenderChar(draw_list, font_size, ImVec2(ellipsis_x, pos_min.y), GetColorU32(ImGuiCol_Text), ellipsis_char);
- ellipsis_x += ellipsis_glyph_width;
- }
+ ImVec2 ellipsis_pos = ImTrunc(ImVec2(pos_min.x + text_size_clipped_x, pos_min.y));
+ if (ellipsis_pos.x + ellipsis_width <= ellipsis_max_x)
+ for (int i = 0; i < font->EllipsisCharCount; i++, ellipsis_pos.x += font->EllipsisCharStep * font_scale)
+ font->RenderChar(draw_list, font_size, ellipsis_pos, GetColorU32(ImGuiCol_Text), font->EllipsisChar);
}
else
{
@@ -3307,13 +3742,13 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con
}
// Render a rectangle shaped with optional rounding and borders
-void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding)
+void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool borders, float rounding)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
window->DrawList->AddRectFilled(p_min, p_max, fill_col, rounding);
const float border_size = g.Style.FrameBorderSize;
- if (border && border_size > 0.0f)
+ if (borders && border_size > 0.0f)
{
window->DrawList->AddRect(p_min + ImVec2(1, 1), p_max + ImVec2(1, 1), GetColorU32(ImGuiCol_BorderShadow), rounding, 0, border_size);
window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, 0, border_size);
@@ -3332,74 +3767,537 @@ void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding)
}
}
-void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags)
+void ImGui::RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags)
{
ImGuiContext& g = *GImGui;
if (id != g.NavId)
return;
- if (g.NavDisableHighlight && !(flags & ImGuiNavHighlightFlags_AlwaysDraw))
+ if (!g.NavCursorVisible && !(flags & ImGuiNavRenderCursorFlags_AlwaysDraw))
+ return;
+ if (id == g.LastItemData.ID && (g.LastItemData.ItemFlags & ImGuiItemFlags_NoNav))
return;
ImGuiWindow* window = g.CurrentWindow;
if (window->DC.NavHideHighlightOneFrame)
return;
- float rounding = (flags & ImGuiNavHighlightFlags_NoRounding) ? 0.0f : g.Style.FrameRounding;
+ float rounding = (flags & ImGuiNavRenderCursorFlags_NoRounding) ? 0.0f : g.Style.FrameRounding;
ImRect display_rect = bb;
display_rect.ClipWith(window->ClipRect);
- if (flags & ImGuiNavHighlightFlags_TypeDefault)
+ const float thickness = 2.0f;
+ if (flags & ImGuiNavRenderCursorFlags_Compact)
+ {
+ window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, 0, thickness);
+ }
+ else
{
- const float THICKNESS = 2.0f;
- const float DISTANCE = 3.0f + THICKNESS * 0.5f;
- display_rect.Expand(ImVec2(DISTANCE, DISTANCE));
+ const float distance = 3.0f + thickness * 0.5f;
+ display_rect.Expand(ImVec2(distance, distance));
bool fully_visible = window->ClipRect.Contains(display_rect);
if (!fully_visible)
window->DrawList->PushClipRect(display_rect.Min, display_rect.Max);
- window->DrawList->AddRect(display_rect.Min + ImVec2(THICKNESS * 0.5f, THICKNESS * 0.5f), display_rect.Max - ImVec2(THICKNESS * 0.5f, THICKNESS * 0.5f), GetColorU32(ImGuiCol_NavHighlight), rounding, 0, THICKNESS);
+ window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, 0, thickness);
if (!fully_visible)
window->DrawList->PopClipRect();
}
- if (flags & ImGuiNavHighlightFlags_TypeThin)
- {
- window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavHighlight), rounding, 0, 1.0f);
- }
}
void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
{
ImGuiContext& g = *GImGui;
- IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT);
- for (int n = 0; n < g.Viewports.Size; n++)
+ if (mouse_cursor <= ImGuiMouseCursor_None || mouse_cursor >= ImGuiMouseCursor_COUNT) // We intentionally accept out of bound values.
+ mouse_cursor = ImGuiMouseCursor_Arrow;
+ ImFontAtlas* font_atlas = g.DrawListSharedData.Font->ContainerAtlas;
+ for (ImGuiViewportP* viewport : g.Viewports)
{
- ImGuiViewportP* viewport = g.Viewports[n];
- ImDrawList* draw_list = GetForegroundDrawList(viewport);
- ImFontAtlas* font_atlas = draw_list->_Data->Font->ContainerAtlas;
+ // We scale cursor with current viewport/monitor, however Windows 10 for its own hardware cursor seems to be using a different scale factor.
ImVec2 offset, size, uv[4];
- if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2]))
+ if (!ImFontAtlasGetMouseCursorTexData(font_atlas, mouse_cursor, &offset, &size, &uv[0], &uv[2]))
+ continue;
+ const ImVec2 pos = base_pos - offset;
+ const float scale = base_scale;
+ if (!viewport->GetMainRect().Overlaps(ImRect(pos, pos + ImVec2(size.x + 2, size.y + 2) * scale)))
+ continue;
+ ImDrawList* draw_list = GetForegroundDrawList(viewport);
+ ImTextureID tex_id = font_atlas->TexID;
+ draw_list->PushTextureID(tex_id);
+ draw_list->AddImage(tex_id, pos + ImVec2(1, 0) * scale, pos + (ImVec2(1, 0) + size) * scale, uv[2], uv[3], col_shadow);
+ draw_list->AddImage(tex_id, pos + ImVec2(2, 0) * scale, pos + (ImVec2(2, 0) + size) * scale, uv[2], uv[3], col_shadow);
+ draw_list->AddImage(tex_id, pos, pos + size * scale, uv[2], uv[3], col_border);
+ draw_list->AddImage(tex_id, pos, pos + size * scale, uv[0], uv[1], col_fill);
+ if (mouse_cursor == ImGuiMouseCursor_Wait || mouse_cursor == ImGuiMouseCursor_Progress)
{
- const ImVec2 pos = base_pos - offset;
- const float scale = base_scale;
- ImTextureID tex_id = font_atlas->TexID;
- draw_list->PushTextureID(tex_id);
- draw_list->AddImage(tex_id, pos + ImVec2(1, 0) * scale, pos + (ImVec2(1, 0) + size) * scale, uv[2], uv[3], col_shadow);
- draw_list->AddImage(tex_id, pos + ImVec2(2, 0) * scale, pos + (ImVec2(2, 0) + size) * scale, uv[2], uv[3], col_shadow);
- draw_list->AddImage(tex_id, pos, pos + size * scale, uv[2], uv[3], col_border);
- draw_list->AddImage(tex_id, pos, pos + size * scale, uv[0], uv[1], col_fill);
- draw_list->PopTextureID();
+ float a_min = ImFmod((float)g.Time * 5.0f, 2.0f * IM_PI);
+ float a_max = a_min + IM_PI * 1.65f;
+ draw_list->PathArcTo(pos + ImVec2(14, -1) * scale, 6.0f * scale, a_min, a_max);
+ draw_list->PathStroke(col_fill, ImDrawFlags_None, 3.0f * scale);
}
+ draw_list->PopTextureID();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] INITIALIZATION, SHUTDOWN
+//-----------------------------------------------------------------------------
+
+// Internal state access - if you want to share Dear ImGui state between modules (e.g. DLL) or allocate it yourself
+// Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module
+ImGuiContext* ImGui::GetCurrentContext()
+{
+ return GImGui;
+}
+
+void ImGui::SetCurrentContext(ImGuiContext* ctx)
+{
+#ifdef IMGUI_SET_CURRENT_CONTEXT_FUNC
+ IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx); // For custom thread-based hackery you may want to have control over this.
+#else
+ GImGui = ctx;
+#endif
+}
+
+void ImGui::SetAllocatorFunctions(ImGuiMemAllocFunc alloc_func, ImGuiMemFreeFunc free_func, void* user_data)
+{
+ GImAllocatorAllocFunc = alloc_func;
+ GImAllocatorFreeFunc = free_func;
+ GImAllocatorUserData = user_data;
+}
+
+// This is provided to facilitate copying allocators from one static/DLL boundary to another (e.g. retrieve default allocator of your executable address space)
+void ImGui::GetAllocatorFunctions(ImGuiMemAllocFunc* p_alloc_func, ImGuiMemFreeFunc* p_free_func, void** p_user_data)
+{
+ *p_alloc_func = GImAllocatorAllocFunc;
+ *p_free_func = GImAllocatorFreeFunc;
+ *p_user_data = GImAllocatorUserData;
+}
+
+ImGuiContext* ImGui::CreateContext(ImFontAtlas* shared_font_atlas)
+{
+ ImGuiContext* prev_ctx = GetCurrentContext();
+ ImGuiContext* ctx = IM_NEW(ImGuiContext)(shared_font_atlas);
+ SetCurrentContext(ctx);
+ Initialize();
+ if (prev_ctx != NULL)
+ SetCurrentContext(prev_ctx); // Restore previous context if any, else keep new one.
+ return ctx;
+}
+
+void ImGui::DestroyContext(ImGuiContext* ctx)
+{
+ ImGuiContext* prev_ctx = GetCurrentContext();
+ if (ctx == NULL) //-V1051
+ ctx = prev_ctx;
+ SetCurrentContext(ctx);
+ Shutdown();
+ SetCurrentContext((prev_ctx != ctx) ? prev_ctx : NULL);
+ IM_DELETE(ctx);
+}
+
+// IMPORTANT: interactive elements requires a fixed ###xxx suffix, it must be same in ALL languages to allow for automation.
+static const ImGuiLocEntry GLocalizationEntriesEnUS[] =
+{
+ { ImGuiLocKey_VersionStr, "Dear ImGui " IMGUI_VERSION " (" IM_STRINGIFY(IMGUI_VERSION_NUM) ")" },
+ { ImGuiLocKey_TableSizeOne, "Size column to fit###SizeOne" },
+ { ImGuiLocKey_TableSizeAllFit, "Size all columns to fit###SizeAll" },
+ { ImGuiLocKey_TableSizeAllDefault, "Size all columns to default###SizeAll" },
+ { ImGuiLocKey_TableResetOrder, "Reset order###ResetOrder" },
+ { ImGuiLocKey_WindowingMainMenuBar, "(Main menu bar)" },
+ { ImGuiLocKey_WindowingPopup, "(Popup)" },
+ { ImGuiLocKey_WindowingUntitled, "(Untitled)" },
+ { ImGuiLocKey_OpenLink_s, "Open '%s'" },
+ { ImGuiLocKey_CopyLink, "Copy Link###CopyLink" },
+};
+
+ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
+{
+ IO.Ctx = this;
+ InputTextState.Ctx = this;
+
+ Initialized = false;
+ FontAtlasOwnedByContext = shared_font_atlas ? false : true;
+ Font = NULL;
+ FontSize = FontBaseSize = FontScale = CurrentDpiScale = 0.0f;
+ IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)();
+ Time = 0.0f;
+ FrameCount = 0;
+ FrameCountEnded = FrameCountRendered = -1;
+ WithinEndChildID = 0;
+ WithinFrameScope = WithinFrameScopeWithImplicitWindow = false;
+ GcCompactAll = false;
+ TestEngineHookItems = false;
+ TestEngine = NULL;
+ memset(ContextName, 0, sizeof(ContextName));
+
+ InputEventsNextMouseSource = ImGuiMouseSource_Mouse;
+ InputEventsNextEventId = 1;
+
+ WindowsActiveCount = 0;
+ WindowsBorderHoverPadding = 0.0f;
+ CurrentWindow = NULL;
+ HoveredWindow = NULL;
+ HoveredWindowUnderMovingWindow = NULL;
+ HoveredWindowBeforeClear = NULL;
+ MovingWindow = NULL;
+ WheelingWindow = NULL;
+ WheelingWindowStartFrame = WheelingWindowScrolledFrame = -1;
+ WheelingWindowReleaseTimer = 0.0f;
+
+ DebugDrawIdConflicts = 0;
+ DebugHookIdInfo = 0;
+ HoveredId = HoveredIdPreviousFrame = 0;
+ HoveredIdPreviousFrameItemCount = 0;
+ HoveredIdAllowOverlap = false;
+ HoveredIdIsDisabled = false;
+ HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
+ ItemUnclipByLog = false;
+ ActiveId = 0;
+ ActiveIdIsAlive = 0;
+ ActiveIdTimer = 0.0f;
+ ActiveIdIsJustActivated = false;
+ ActiveIdAllowOverlap = false;
+ ActiveIdNoClearOnFocusLoss = false;
+ ActiveIdHasBeenPressedBefore = false;
+ ActiveIdHasBeenEditedBefore = false;
+ ActiveIdHasBeenEditedThisFrame = false;
+ ActiveIdFromShortcut = false;
+ ActiveIdClickOffset = ImVec2(-1, -1);
+ ActiveIdWindow = NULL;
+ ActiveIdSource = ImGuiInputSource_None;
+ ActiveIdMouseButton = -1;
+ ActiveIdPreviousFrame = 0;
+ memset(&DeactivatedItemData, 0, sizeof(DeactivatedItemData));
+ memset(&ActiveIdValueOnActivation, 0, sizeof(ActiveIdValueOnActivation));
+ LastActiveId = 0;
+ LastActiveIdTimer = 0.0f;
+
+ LastKeyboardKeyPressTime = LastKeyModsChangeTime = LastKeyModsChangeFromNoneTime = -1.0;
+
+ ActiveIdUsingNavDirMask = 0x00;
+ ActiveIdUsingAllKeyboardKeys = false;
+
+ CurrentFocusScopeId = 0;
+ CurrentItemFlags = ImGuiItemFlags_None;
+ DebugShowGroupRects = false;
+
+ NavCursorVisible = false;
+ NavHighlightItemUnderNav = false;
+ NavMousePosDirty = false;
+ NavIdIsAlive = false;
+ NavId = 0;
+ NavWindow = NULL;
+ NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = 0;
+ NavLayer = ImGuiNavLayer_Main;
+ NavNextActivateId = 0;
+ NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None;
+ NavHighlightActivatedId = 0;
+ NavHighlightActivatedTimer = 0.0f;
+ NavInputSource = ImGuiInputSource_Keyboard;
+ NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid;
+ NavCursorHideFrames = 0;
+
+ NavAnyRequest = false;
+ NavInitRequest = false;
+ NavInitRequestFromMove = false;
+ NavMoveSubmitted = false;
+ NavMoveScoringItems = false;
+ NavMoveForwardToNextFrame = false;
+ NavMoveFlags = ImGuiNavMoveFlags_None;
+ NavMoveScrollFlags = ImGuiScrollFlags_None;
+ NavMoveKeyMods = ImGuiMod_None;
+ NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None;
+ NavScoringDebugCount = 0;
+ NavTabbingDir = 0;
+ NavTabbingCounter = 0;
+
+ NavJustMovedFromFocusScopeId = NavJustMovedToId = NavJustMovedToFocusScopeId = 0;
+ NavJustMovedToKeyMods = ImGuiMod_None;
+ NavJustMovedToIsTabbing = false;
+ NavJustMovedToHasSelectionData = false;
+
+ // All platforms use Ctrl+Tab but Ctrl<>Super are swapped on Mac...
+ // FIXME: Because this value is stored, it annoyingly interfere with toggling io.ConfigMacOSXBehaviors updating this..
+ ConfigNavWindowingKeyNext = IO.ConfigMacOSXBehaviors ? (ImGuiMod_Super | ImGuiKey_Tab) : (ImGuiMod_Ctrl | ImGuiKey_Tab);
+ ConfigNavWindowingKeyPrev = IO.ConfigMacOSXBehaviors ? (ImGuiMod_Super | ImGuiMod_Shift | ImGuiKey_Tab) : (ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab);
+ NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL;
+ NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
+ NavWindowingToggleLayer = false;
+ NavWindowingToggleKey = ImGuiKey_None;
+
+ DimBgRatio = 0.0f;
+
+ DragDropActive = DragDropWithinSource = DragDropWithinTarget = false;
+ DragDropSourceFlags = ImGuiDragDropFlags_None;
+ DragDropSourceFrameCount = -1;
+ DragDropMouseButton = -1;
+ DragDropTargetId = 0;
+ DragDropAcceptFlags = ImGuiDragDropFlags_None;
+ DragDropAcceptIdCurrRectSurface = 0.0f;
+ DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0;
+ DragDropAcceptFrameCount = -1;
+ DragDropHoldJustPressedId = 0;
+ memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal));
+
+ ClipperTempDataStacked = 0;
+
+ CurrentTable = NULL;
+ TablesTempDataStacked = 0;
+ CurrentTabBar = NULL;
+ CurrentMultiSelect = NULL;
+ MultiSelectTempDataStacked = 0;
+
+ HoverItemDelayId = HoverItemDelayIdPreviousFrame = HoverItemUnlockedStationaryId = HoverWindowUnlockedStationaryId = 0;
+ HoverItemDelayTimer = HoverItemDelayClearTimer = 0.0f;
+
+ MouseCursor = ImGuiMouseCursor_Arrow;
+ MouseStationaryTimer = 0.0f;
+
+ TempInputId = 0;
+ memset(&DataTypeZeroValue, 0, sizeof(DataTypeZeroValue));
+ BeginMenuDepth = BeginComboDepth = 0;
+ ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
+ ColorEditCurrentID = ColorEditSavedID = 0;
+ ColorEditSavedHue = ColorEditSavedSat = 0.0f;
+ ColorEditSavedColor = 0;
+ WindowResizeRelativeMode = false;
+ ScrollbarSeekMode = 0;
+ ScrollbarClickDeltaToGrabCenter = 0.0f;
+ SliderGrabClickOffset = 0.0f;
+ SliderCurrentAccum = 0.0f;
+ SliderCurrentAccumDirty = false;
+ DragCurrentAccumDirty = false;
+ DragCurrentAccum = 0.0f;
+ DragSpeedDefaultRatio = 1.0f / 100.0f;
+ DisabledAlphaBackup = 0.0f;
+ DisabledStackSize = 0;
+ TooltipOverrideCount = 0;
+ TooltipPreviousWindow = NULL;
+
+ PlatformImeData.InputPos = ImVec2(0.0f, 0.0f);
+ PlatformImeDataPrev.InputPos = ImVec2(-1.0f, -1.0f); // Different to ensure initial submission
+
+ SettingsLoaded = false;
+ SettingsDirtyTimer = 0.0f;
+ HookIdNext = 0;
+
+ memset(LocalizationTable, 0, sizeof(LocalizationTable));
+
+ LogEnabled = false;
+ LogFlags = ImGuiLogFlags_None;
+ LogWindow = NULL;
+ LogNextPrefix = LogNextSuffix = NULL;
+ LogFile = NULL;
+ LogLinePosY = FLT_MAX;
+ LogLineFirstItem = false;
+ LogDepthRef = 0;
+ LogDepthToExpand = LogDepthToExpandDefault = 2;
+
+ ErrorCallback = NULL;
+ ErrorCallbackUserData = NULL;
+ ErrorFirst = true;
+ ErrorCountCurrentFrame = 0;
+ StackSizesInBeginForCurrentWindow = NULL;
+
+ DebugDrawIdConflictsCount = 0;
+ DebugLogFlags = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_OutputToTTY;
+ DebugLocateId = 0;
+ DebugLogSkippedErrors = 0;
+ DebugLogAutoDisableFlags = ImGuiDebugLogFlags_None;
+ DebugLogAutoDisableFrames = 0;
+ DebugLocateFrames = 0;
+ DebugBeginReturnValueCullDepth = -1;
+ DebugItemPickerActive = false;
+ DebugItemPickerMouseButton = ImGuiMouseButton_Left;
+ DebugItemPickerBreakId = 0;
+ DebugFlashStyleColorTime = 0.0f;
+ DebugFlashStyleColorIdx = ImGuiCol_COUNT;
+
+ // Same as DebugBreakClearData(). Those fields are scattered in their respective subsystem to stay in hot-data locations
+ DebugBreakInWindow = 0;
+ DebugBreakInTable = 0;
+ DebugBreakInLocateId = false;
+ DebugBreakKeyChord = ImGuiKey_Pause;
+ DebugBreakInShortcutRouting = ImGuiKey_None;
+
+ memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
+ FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0;
+ FramerateSecPerFrameAccum = 0.0f;
+ WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
+ memset(TempKeychordName, 0, sizeof(TempKeychordName));
+}
+
+void ImGui::Initialize()
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(!g.Initialized && !g.SettingsLoaded);
+
+ // Add .ini handle for ImGuiWindow and ImGuiTable types
+ {
+ ImGuiSettingsHandler ini_handler;
+ ini_handler.TypeName = "Window";
+ ini_handler.TypeHash = ImHashStr("Window");
+ ini_handler.ClearAllFn = WindowSettingsHandler_ClearAll;
+ ini_handler.ReadOpenFn = WindowSettingsHandler_ReadOpen;
+ ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine;
+ ini_handler.ApplyAllFn = WindowSettingsHandler_ApplyAll;
+ ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll;
+ AddSettingsHandler(&ini_handler);
+ }
+ TableSettingsAddSettingsHandler();
+
+ // Setup default localization table
+ LocalizeRegisterEntries(GLocalizationEntriesEnUS, IM_ARRAYSIZE(GLocalizationEntriesEnUS));
+
+ // Setup default ImGuiPlatformIO clipboard/IME handlers.
+ g.PlatformIO.Platform_GetClipboardTextFn = Platform_GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations
+ g.PlatformIO.Platform_SetClipboardTextFn = Platform_SetClipboardTextFn_DefaultImpl;
+ g.PlatformIO.Platform_OpenInShellFn = Platform_OpenInShellFn_DefaultImpl;
+ g.PlatformIO.Platform_SetImeDataFn = Platform_SetImeDataFn_DefaultImpl;
+
+ // Create default viewport
+ ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)();
+ viewport->ID = IMGUI_VIEWPORT_DEFAULT_ID;
+ g.Viewports.push_back(viewport);
+ g.TempBuffer.resize(1024 * 3 + 1, 0);
+
+ // Build KeysMayBeCharInput[] lookup table (1 bool per named key)
+ for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1))
+ if ((key >= ImGuiKey_0 && key <= ImGuiKey_9) || (key >= ImGuiKey_A && key <= ImGuiKey_Z) || (key >= ImGuiKey_Keypad0 && key <= ImGuiKey_Keypad9)
+ || key == ImGuiKey_Tab || key == ImGuiKey_Space || key == ImGuiKey_Apostrophe || key == ImGuiKey_Comma || key == ImGuiKey_Minus || key == ImGuiKey_Period
+ || key == ImGuiKey_Slash || key == ImGuiKey_Semicolon || key == ImGuiKey_Equal || key == ImGuiKey_LeftBracket || key == ImGuiKey_RightBracket || key == ImGuiKey_GraveAccent
+ || key == ImGuiKey_KeypadDecimal || key == ImGuiKey_KeypadDivide || key == ImGuiKey_KeypadMultiply || key == ImGuiKey_KeypadSubtract || key == ImGuiKey_KeypadAdd || key == ImGuiKey_KeypadEqual)
+ g.KeysMayBeCharInput.SetBit(key);
+
+#ifdef IMGUI_HAS_DOCK
+#endif
+
+ g.Initialized = true;
+}
+
+// This function is merely here to free heap allocations.
+void ImGui::Shutdown()
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT_USER_ERROR(g.IO.BackendPlatformUserData == NULL, "Forgot to shutdown Platform backend?");
+ IM_ASSERT_USER_ERROR(g.IO.BackendRendererUserData == NULL, "Forgot to shutdown Renderer backend?");
+
+ // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
+ if (g.IO.Fonts && g.FontAtlasOwnedByContext)
+ {
+ g.IO.Fonts->Locked = false;
+ IM_DELETE(g.IO.Fonts);
+ }
+ g.IO.Fonts = NULL;
+ g.DrawListSharedData.TempBuffer.clear();
+
+ // Cleanup of other data are conditional on actually having initialized Dear ImGui.
+ if (!g.Initialized)
+ return;
+
+ // Save settings (unless we haven't attempted to load them: CreateContext/DestroyContext without a call to NewFrame shouldn't save an empty file)
+ if (g.SettingsLoaded && g.IO.IniFilename != NULL)
+ SaveIniSettingsToDisk(g.IO.IniFilename);
+
+ CallContextHooks(&g, ImGuiContextHookType_Shutdown);
+
+ // Clear everything else
+ g.Windows.clear_delete();
+ g.WindowsFocusOrder.clear();
+ g.WindowsTempSortBuffer.clear();
+ g.CurrentWindow = NULL;
+ g.CurrentWindowStack.clear();
+ g.WindowsById.Clear();
+ g.NavWindow = NULL;
+ g.HoveredWindow = g.HoveredWindowUnderMovingWindow = NULL;
+ g.ActiveIdWindow = NULL;
+ g.MovingWindow = NULL;
+
+ g.KeysRoutingTable.Clear();
+
+ g.ColorStack.clear();
+ g.StyleVarStack.clear();
+ g.FontStack.clear();
+ g.OpenPopupStack.clear();
+ g.BeginPopupStack.clear();
+ g.TreeNodeStack.clear();
+
+ g.Viewports.clear_delete();
+
+ g.TabBars.Clear();
+ g.CurrentTabBarStack.clear();
+ g.ShrinkWidthBuffer.clear();
+
+ g.ClipperTempData.clear_destruct();
+
+ g.Tables.Clear();
+ g.TablesTempData.clear_destruct();
+ g.DrawChannelsTempMergeBuffer.clear();
+
+ g.MultiSelectStorage.Clear();
+ g.MultiSelectTempData.clear_destruct();
+
+ g.ClipboardHandlerData.clear();
+ g.MenusIdSubmittedThisFrame.clear();
+ g.InputTextState.ClearFreeMemory();
+ g.InputTextDeactivatedState.ClearFreeMemory();
+
+ g.SettingsWindows.clear();
+ g.SettingsHandlers.clear();
+
+ if (g.LogFile)
+ {
+#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
+ if (g.LogFile != stdout)
+#endif
+ ImFileClose(g.LogFile);
+ g.LogFile = NULL;
}
+ g.LogBuffer.clear();
+ g.DebugLogBuf.clear();
+ g.DebugLogIndex.clear();
+
+ g.Initialized = false;
}
+// No specific ordering/dependency support, will see as needed
+ImGuiID ImGui::AddContextHook(ImGuiContext* ctx, const ImGuiContextHook* hook)
+{
+ ImGuiContext& g = *ctx;
+ IM_ASSERT(hook->Callback != NULL && hook->HookId == 0 && hook->Type != ImGuiContextHookType_PendingRemoval_);
+ g.Hooks.push_back(*hook);
+ g.Hooks.back().HookId = ++g.HookIdNext;
+ return g.HookIdNext;
+}
+
+// Deferred removal, avoiding issue with changing vector while iterating it
+void ImGui::RemoveContextHook(ImGuiContext* ctx, ImGuiID hook_id)
+{
+ ImGuiContext& g = *ctx;
+ IM_ASSERT(hook_id != 0);
+ for (ImGuiContextHook& hook : g.Hooks)
+ if (hook.HookId == hook_id)
+ hook.Type = ImGuiContextHookType_PendingRemoval_;
+}
+
+// Call context hooks (used by e.g. test engine)
+// We assume a small number of hooks so all stored in same array
+void ImGui::CallContextHooks(ImGuiContext* ctx, ImGuiContextHookType hook_type)
+{
+ ImGuiContext& g = *ctx;
+ for (ImGuiContextHook& hook : g.Hooks)
+ if (hook.Type == hook_type)
+ hook.Callback(&g, &hook);
+}
//-----------------------------------------------------------------------------
// [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!)
//-----------------------------------------------------------------------------
// ImGuiWindow is mostly a dumb struct. It merely has a constructor and a few helper methods
-ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name) : DrawListInst(NULL)
+ImGuiWindow::ImGuiWindow(ImGuiContext* ctx, const char* name) : DrawListInst(NULL)
{
memset(this, 0, sizeof(*this));
+ Ctx = ctx;
Name = ImStrdup(name);
- NameBufLen = (int)strlen(name) + 1;
+ NameBufLen = (int)ImStrlen(name) + 1;
ID = ImHashStr(name);
IDStack.push_back(ID);
MoveId = GetID("#MOVE");
@@ -3407,15 +4305,17 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name) : DrawListInst
ScrollTargetCenterRatio = ImVec2(0.5f, 0.5f);
AutoFitFramesX = AutoFitFramesY = -1;
AutoPosLastDirection = ImGuiDir_None;
- SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing;
+ SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = 0;
SetWindowPosVal = SetWindowPosPivot = ImVec2(FLT_MAX, FLT_MAX);
LastFrameActive = -1;
LastTimeActive = -1.0f;
- FontWindowScale = 1.0f;
+ FontRefSize = 0.0f;
+ FontWindowScale = FontWindowScaleParents = 1.0f;
SettingsOffset = -1;
DrawList = &DrawListInst;
- DrawList->_Data = &context->DrawListSharedData;
DrawList->_OwnerName = Name;
+ DrawList->_Data = &Ctx->DrawListSharedData;
+ NavPreferredScoringPosRel[0] = NavPreferredScoringPosRel[1] = ImVec2(FLT_MAX, FLT_MAX);
}
ImGuiWindow::~ImGuiWindow()
@@ -3425,52 +4325,19 @@ ImGuiWindow::~ImGuiWindow()
ColumnsStorage.clear_destruct();
}
-ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end)
-{
- ImGuiID seed = IDStack.back();
- ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
- ImGuiContext& g = *GImGui;
- if (g.DebugHookIdInfo == id)
- ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
- return id;
-}
-
-ImGuiID ImGuiWindow::GetID(const void* ptr)
-{
- ImGuiID seed = IDStack.back();
- ImGuiID id = ImHashData(&ptr, sizeof(void*), seed);
- ImGuiContext& g = *GImGui;
- if (g.DebugHookIdInfo == id)
- ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL);
- return id;
-}
-
-ImGuiID ImGuiWindow::GetID(int n)
-{
- ImGuiID seed = IDStack.back();
- ImGuiID id = ImHashData(&n, sizeof(n), seed);
- ImGuiContext& g = *GImGui;
- if (g.DebugHookIdInfo == id)
- ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
- return id;
-}
-
-// This is only used in rare/specific situations to manufacture an ID out of nowhere.
-ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)
-{
- ImGuiID seed = IDStack.back();
- ImRect r_rel = ImGui::WindowRectAbsToRel(this, r_abs);
- ImGuiID id = ImHashData(&r_rel, sizeof(r_rel), seed);
- return id;
-}
-
static void SetCurrentWindow(ImGuiWindow* window)
{
ImGuiContext& g = *GImGui;
g.CurrentWindow = window;
+ g.StackSizesInBeginForCurrentWindow = g.CurrentWindow ? &g.CurrentWindowStack.back().StackSizesInBegin : NULL;
g.CurrentTable = window && window->DC.CurrentTableIdx != -1 ? g.Tables.GetByIndex(window->DC.CurrentTableIdx) : NULL;
+ g.CurrentDpiScale = 1.0f; // FIXME-DPI: WIP this is modified in docking
if (window)
+ {
g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize();
+ g.FontScale = g.DrawListSharedData.FontScale = g.FontSize / g.Font->FontSize;
+ ImGui::NavUpdateCurrentWindowIsScrollPushableX();
+ }
}
void ImGui::GcCompactTransientMiscBuffers()
@@ -3478,6 +4345,8 @@ void ImGui::GcCompactTransientMiscBuffers()
ImGuiContext& g = *GImGui;
g.ItemFlagsStack.clear();
g.GroupStack.clear();
+ g.MultiSelectTempDataStacked = 0;
+ g.MultiSelectTempData.clear_destruct();
TableGcCompactSettings();
}
@@ -3511,13 +4380,30 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
{
ImGuiContext& g = *GImGui;
- // While most behaved code would make an effort to not steal active id during window move/drag operations,
- // we at least need to be resilient to it. Cancelling the move is rather aggressive and users of 'master' branch
- // may prefer the weird ill-defined half working situation ('docking' did assert), so may need to rework that.
- if (g.MovingWindow != NULL && g.ActiveId == g.MovingWindow->MoveId)
+ // Clear previous active id
+ if (g.ActiveId != 0)
{
- IMGUI_DEBUG_LOG_ACTIVEID("SetActiveID() cancel MovingWindow\n");
- g.MovingWindow = NULL;
+ // While most behaved code would make an effort to not steal active id during window move/drag operations,
+ // we at least need to be resilient to it. Canceling the move is rather aggressive and users of 'master' branch
+ // may prefer the weird ill-defined half working situation ('docking' did assert), so may need to rework that.
+ if (g.MovingWindow != NULL && g.ActiveId == g.MovingWindow->MoveId)
+ {
+ IMGUI_DEBUG_LOG_ACTIVEID("SetActiveID() cancel MovingWindow\n");
+ g.MovingWindow = NULL;
+ }
+
+ // Store deactivate data
+ ImGuiDeactivatedItemData* deactivated_data = &g.DeactivatedItemData;
+ deactivated_data->ID = g.ActiveId;
+ deactivated_data->ElapseFrame = (g.LastItemData.ID == g.ActiveId) ? g.FrameCount : g.FrameCount + 1; // FIXME: OK to use LastItemData?
+ deactivated_data->HasBeenEditedBefore = g.ActiveIdHasBeenEditedBefore;
+ deactivated_data->IsAlive = (g.ActiveIdIsAlive == g.ActiveId);
+
+ // This could be written in a more general way (e.g associate a hook to ActiveId),
+ // but since this is currently quite an exception we'll leave it as is.
+ // One common scenario leading to this is: pressing Key ->NavMoveRequestApplyResult() -> ClearActiveID()
+ if (g.InputTextState.ID == g.ActiveId)
+ InputTextDeactivateHook(g.ActiveId);
}
// Set active id
@@ -3540,19 +4426,18 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
g.ActiveIdNoClearOnFocusLoss = false;
g.ActiveIdWindow = window;
g.ActiveIdHasBeenEditedThisFrame = false;
+ g.ActiveIdFromShortcut = false;
if (id)
{
g.ActiveIdIsAlive = id;
- g.ActiveIdSource = (g.NavActivateId == id || g.NavActivateInputId == id || g.NavJustMovedToId == id) ? (ImGuiInputSource)ImGuiInputSource_Nav : ImGuiInputSource_Mouse;
+ g.ActiveIdSource = (g.NavActivateId == id || g.NavJustMovedToId == id) ? g.NavInputSource : ImGuiInputSource_Mouse;
+ IM_ASSERT(g.ActiveIdSource != ImGuiInputSource_None);
}
// Clear declaration of inputs claimed by the widget
// (Please note that this is WIP and not all keys/inputs are thoroughly declared by all widgets yet)
g.ActiveIdUsingNavDirMask = 0x00;
g.ActiveIdUsingAllKeyboardKeys = false;
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- g.ActiveIdUsingNavInputMask = 0x00;
-#endif
}
void ImGui::ClearActiveID()
@@ -3575,31 +4460,31 @@ ImGuiID ImGui::GetHoveredID()
return g.HoveredId ? g.HoveredId : g.HoveredIdPreviousFrame;
}
-// This is called by ItemAdd().
-// Code not using ItemAdd() may need to call this manually otherwise ActiveId will be cleared. In IMGUI_VERSION_NUM < 18717 this was called by GetID().
-void ImGui::KeepAliveID(ImGuiID id)
-{
- ImGuiContext& g = *GImGui;
- if (g.ActiveId == id)
- g.ActiveIdIsAlive = id;
- if (g.ActiveIdPreviousFrame == id)
- g.ActiveIdPreviousFrameIsAlive = true;
-}
-
void ImGui::MarkItemEdited(ImGuiID id)
{
- // This marking is solely to be able to provide info for IsItemDeactivatedAfterEdit().
+ // This marking is to be able to provide info for IsItemDeactivatedAfterEdit().
// ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need to fill the data.
ImGuiContext& g = *GImGui;
- IM_ASSERT(g.ActiveId == id || g.ActiveId == 0 || g.DragDropActive);
- IM_UNUSED(id); // Avoid unused variable warnings when asserts are compiled out.
+ if (g.LastItemData.ItemFlags & ImGuiItemFlags_NoMarkEdited)
+ return;
+ if (g.ActiveId == id || g.ActiveId == 0)
+ {
+ // FIXME: Can't we fully rely on LastItemData yet?
+ g.ActiveIdHasBeenEditedThisFrame = true;
+ g.ActiveIdHasBeenEditedBefore = true;
+ if (g.DeactivatedItemData.ID == id)
+ g.DeactivatedItemData.HasBeenEditedBefore = true;
+ }
+
+ // We accept a MarkItemEdited() on drag and drop targets (see https://github.com/ocornut/imgui/issues/1875#issuecomment-978243343)
+ // We accept 'ActiveIdPreviousFrame == id' for InputText() returning an edit after it has been taken ActiveId away (#4714)
+ IM_ASSERT(g.DragDropActive || g.ActiveId == id || g.ActiveId == 0 || g.ActiveIdPreviousFrame == id || (g.CurrentMultiSelect != NULL && g.BoxSelectState.IsActive));
+
//IM_ASSERT(g.CurrentWindow->DC.LastItemId == id);
- g.ActiveIdHasBeenEditedThisFrame = true;
- g.ActiveIdHasBeenEditedBefore = true;
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Edited;
}
-static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
+bool ImGui::IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
{
// An active popup disable hovering on other windows (apart from its own children)
// FIXME-OPT: This could be cached/stored within the window.
@@ -3618,12 +4503,30 @@ static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFla
// Inhibit hover unless the window is within the stack of our modal/popup
if (want_inhibit)
- if (!ImGui::IsWindowWithinBeginStackOf(window->RootWindow, focused_root_window))
+ if (!IsWindowWithinBeginStackOf(window->RootWindow, focused_root_window))
return false;
}
return true;
}
+static inline float CalcDelayFromHoveredFlags(ImGuiHoveredFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ if (flags & ImGuiHoveredFlags_DelayNormal)
+ return g.Style.HoverDelayNormal;
+ if (flags & ImGuiHoveredFlags_DelayShort)
+ return g.Style.HoverDelayShort;
+ return 0.0f;
+}
+
+static ImGuiHoveredFlags ApplyHoverFlagsForTooltip(ImGuiHoveredFlags user_flags, ImGuiHoveredFlags shared_flags)
+{
+ // Allow instance flags to override shared flags
+ if (user_flags & (ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal))
+ shared_flags &= ~(ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal);
+ return user_flags | shared_flags;
+}
+
// This is roughly matching the behavior of internal-facing ItemHoverable()
// - we allow hovering to be true when ActiveId==window->MoveID, so that clicking on non-interactive items such as a Text() item still returns true with IsItemHovered()
// - this should work even for non-interactive items that have no ID, so we cannot use LastItemId
@@ -3631,12 +4534,17 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- if (g.NavDisableMouseHover && !g.NavDisableHighlight && !(flags & ImGuiHoveredFlags_NoNavOverride))
+ IM_ASSERT_USER_ERROR((flags & ~ImGuiHoveredFlags_AllowedMaskForIsItemHovered) == 0, "Invalid flags for IsItemHovered()!");
+
+ if (g.NavHighlightItemUnderNav && g.NavCursorVisible && !(flags & ImGuiHoveredFlags_NoNavOverride))
{
- if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
- return false;
if (!IsItemFocused())
return false;
+ if ((g.LastItemData.ItemFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
+ return false;
+
+ if (flags & ImGuiHoveredFlags_ForTooltip)
+ flags = ApplyHoverFlagsForTooltip(flags, g.Style.HoverFlagsForTooltipNav);
}
else
{
@@ -3644,7 +4552,9 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
ImGuiItemStatusFlags status_flags = g.LastItemData.StatusFlags;
if (!(status_flags & ImGuiItemStatusFlags_HoveredRect))
return false;
- IM_ASSERT((flags & (ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_NoPopupHierarchy)) == 0); // Flags not supported by this function
+
+ if (flags & ImGuiHoveredFlags_ForTooltip)
+ flags = ApplyHoverFlagsForTooltip(flags, g.Style.HoverFlagsForTooltipMouse);
// Done with rectangle culling so we can perform heavier checks now
// Test if we are hovering the right window (our window could be behind another window)
@@ -3653,127 +4563,190 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
// to use IsItemHovered() after EndChild() itself. Until a solution is found I believe reverting to the test from 2017/09/27 is safe since this was
// the test that has been running for a long while.
if (g.HoveredWindow != window && (status_flags & ImGuiItemStatusFlags_HoveredWindow) == 0)
- if ((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0)
+ if ((flags & ImGuiHoveredFlags_AllowWhenOverlappedByWindow) == 0)
return false;
// Test if another item is active (e.g. being dragged)
+ const ImGuiID id = g.LastItemData.ID;
if ((flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) == 0)
- if (g.ActiveId != 0 && g.ActiveId != g.LastItemData.ID && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId)
- return false;
+ if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap)
+ if (g.ActiveId != window->MoveId)
+ return false;
// Test if interactions on this window are blocked by an active popup or modal.
// The ImGuiHoveredFlags_AllowWhenBlockedByPopup flag will be tested here.
- if (!IsWindowContentHoverable(window, flags) && !(g.LastItemData.InFlags & ImGuiItemFlags_NoWindowHoverableCheck))
+ if (!IsWindowContentHoverable(window, flags) && !(g.LastItemData.ItemFlags & ImGuiItemFlags_NoWindowHoverableCheck))
return false;
// Test if the item is disabled
- if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
+ if ((g.LastItemData.ItemFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
return false;
// Special handling for calling after Begin() which represent the title bar or tab.
- // When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect the case.
- if (g.LastItemData.ID == window->MoveId && window->WriteAccessed)
+ // When the window is skipped/collapsed (SkipItems==true) that last item (always ->MoveId submitted by Begin)
+ // will never be overwritten so we need to detect the case.
+ if (id == window->MoveId && window->WriteAccessed)
return false;
+
+ // Test if using AllowOverlap and overlapped
+ if ((g.LastItemData.ItemFlags & ImGuiItemFlags_AllowOverlap) && id != 0)
+ if ((flags & ImGuiHoveredFlags_AllowWhenOverlappedByItem) == 0)
+ if (g.HoveredIdPreviousFrame != g.LastItemData.ID)
+ return false;
}
// Handle hover delay
// (some ideas: https://www.nngroup.com/articles/timing-exposing-content)
- float delay;
- if (flags & ImGuiHoveredFlags_DelayNormal)
- delay = g.IO.HoverDelayNormal;
- else if (flags & ImGuiHoveredFlags_DelayShort)
- delay = g.IO.HoverDelayShort;
- else
- delay = 0.0f;
- if (delay > 0.0f)
- {
- ImGuiID hover_delay_id = (g.LastItemData.ID != 0) ? g.LastItemData.ID : window->GetIDFromRectangle(g.LastItemData.Rect);
- if ((flags & ImGuiHoveredFlags_NoSharedDelay) && (g.HoverDelayIdPreviousFrame != hover_delay_id))
- g.HoverDelayTimer = 0.0f;
- g.HoverDelayId = hover_delay_id;
- return g.HoverDelayTimer >= delay;
+ const float delay = CalcDelayFromHoveredFlags(flags);
+ if (delay > 0.0f || (flags & ImGuiHoveredFlags_Stationary))
+ {
+ ImGuiID hover_delay_id = (g.LastItemData.ID != 0) ? g.LastItemData.ID : window->GetIDFromPos(g.LastItemData.Rect.Min);
+ if ((flags & ImGuiHoveredFlags_NoSharedDelay) && (g.HoverItemDelayIdPreviousFrame != hover_delay_id))
+ g.HoverItemDelayTimer = 0.0f;
+ g.HoverItemDelayId = hover_delay_id;
+
+ // When changing hovered item we requires a bit of stationary delay before activating hover timer,
+ // but once unlocked on a given item we also moving.
+ //if (g.HoverDelayTimer >= delay && (g.HoverDelayTimer - g.IO.DeltaTime < delay || g.MouseStationaryTimer - g.IO.DeltaTime < g.Style.HoverStationaryDelay)) { IMGUI_DEBUG_LOG("HoverDelayTimer = %f/%f, MouseStationaryTimer = %f\n", g.HoverDelayTimer, delay, g.MouseStationaryTimer); }
+ if ((flags & ImGuiHoveredFlags_Stationary) != 0 && g.HoverItemUnlockedStationaryId != hover_delay_id)
+ return false;
+
+ if (g.HoverItemDelayTimer < delay)
+ return false;
}
return true;
}
// Internal facing ItemHoverable() used when submitting widgets. Differs slightly from IsItemHovered().
-bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id)
+// (this does not rely on LastItemData it can be called from a ButtonBehavior() call not following an ItemAdd() call)
+// FIXME-LEGACY: the 'ImGuiItemFlags item_flags' parameter was added on 2023-06-28.
+// If you used this in your legacy/custom widgets code:
+// - Commonly: if your ItemHoverable() call comes after an ItemAdd() call: pass 'item_flags = g.LastItemData.ItemFlags'.
+// - Rare: otherwise you may pass 'item_flags = 0' (ImGuiItemFlags_None) unless you want to benefit from special behavior handled by ItemHoverable.
+bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flags)
{
ImGuiContext& g = *GImGui;
- if (g.HoveredId != 0 && g.HoveredId != id && !g.HoveredIdAllowOverlap)
- return false;
-
ImGuiWindow* window = g.CurrentWindow;
+
+ // Detect ID conflicts
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ if (id != 0 && g.HoveredIdPreviousFrame == id && (item_flags & ImGuiItemFlags_AllowDuplicateId) == 0)
+ {
+ g.HoveredIdPreviousFrameItemCount++;
+ if (g.DebugDrawIdConflicts == id)
+ window->DrawList->AddRect(bb.Min - ImVec2(1,1), bb.Max + ImVec2(1,1), IM_COL32(255, 0, 0, 255), 0.0f, ImDrawFlags_None, 2.0f);
+ }
+#endif
+
if (g.HoveredWindow != window)
return false;
- if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap)
- return false;
if (!IsMouseHoveringRect(bb.Min, bb.Max))
return false;
+ if (g.HoveredId != 0 && g.HoveredId != id && !g.HoveredIdAllowOverlap)
+ return false;
+ if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap)
+ if (!g.ActiveIdFromShortcut)
+ return false;
+
// Done with rectangle culling so we can perform heavier checks now.
- ImGuiItemFlags item_flags = (g.LastItemData.ID == id ? g.LastItemData.InFlags : g.CurrentItemFlags);
if (!(item_flags & ImGuiItemFlags_NoWindowHoverableCheck) && !IsWindowContentHoverable(window, ImGuiHoveredFlags_None))
{
- g.HoveredIdDisabled = true;
+ g.HoveredIdIsDisabled = true;
return false;
}
// We exceptionally allow this function to be called with id==0 to allow using it for easy high-level
// hover test in widgets code. We could also decide to split this function is two.
if (id != 0)
+ {
+ // Drag source doesn't report as hovered
+ if (g.DragDropActive && g.DragDropPayload.SourceId == id && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoDisableHover))
+ return false;
+
SetHoveredID(id);
+ // AllowOverlap mode (rarely used) requires previous frame HoveredId to be null or to match.
+ // This allows using patterns where a later submitted widget overlaps a previous one. Generally perceived as a front-to-back hit-test.
+ if (item_flags & ImGuiItemFlags_AllowOverlap)
+ {
+ g.HoveredIdAllowOverlap = true;
+ if (g.HoveredIdPreviousFrame != id)
+ return false;
+ }
+
+ // Display shortcut (only works with mouse)
+ // (ImGuiItemStatusFlags_HasShortcut in LastItemData denotes we want a tooltip)
+ if (id == g.LastItemData.ID && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasShortcut) && g.ActiveId != id)
+ if (IsItemHovered(ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_DelayNormal))
+ SetTooltip("%s", GetKeyChordName(g.LastItemData.Shortcut));
+ }
+
// When disabled we'll return false but still set HoveredId
if (item_flags & ImGuiItemFlags_Disabled)
{
// Release active id if turning disabled
- if (g.ActiveId == id)
+ if (g.ActiveId == id && id != 0)
ClearActiveID();
- g.HoveredIdDisabled = true;
+ g.HoveredIdIsDisabled = true;
return false;
}
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
if (id != 0)
{
// [DEBUG] Item Picker tool!
- // We perform the check here because SetHoveredID() is not frequently called (1~ time a frame), making
- // the cost of this tool near-zero. We can get slightly better call-stack and support picking non-hovered
- // items if we performed the test in ItemAdd(), but that would incur a small runtime cost.
+ // We perform the check here because reaching is path is rare (1~ time a frame),
+ // making the cost of this tool near-zero! We could get better call-stack and support picking non-hovered
+ // items if we performed the test in ItemAdd(), but that would incur a bigger runtime cost.
if (g.DebugItemPickerActive && g.HoveredIdPreviousFrame == id)
GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 255, 0, 255));
if (g.DebugItemPickerBreakId == id)
IM_DEBUG_BREAK();
}
+#endif
- if (g.NavDisableMouseHover)
+ if (g.NavHighlightItemUnderNav && (item_flags & ImGuiItemFlags_NoNavDisableMouseHover) == 0)
return false;
return true;
}
// FIXME: This is inlined/duplicated in ItemAdd()
+// FIXME: The id != 0 path is not used by our codebase, may get rid of it?
bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
if (!bb.Overlaps(window->ClipRect))
- if (id == 0 || (id != g.ActiveId && id != g.NavId))
- if (!g.LogEnabled)
+ if (id == 0 || (id != g.ActiveId && id != g.ActiveIdPreviousFrame && id != g.NavId && id != g.NavActivateId))
+ if (!g.ItemUnclipByLog)
return true;
return false;
}
// This is also inlined in ItemAdd()
-// Note: if ImGuiItemStatusFlags_HasDisplayRect is set, user needs to set window->DC.LastItemDisplayRect!
-void ImGui::SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags item_flags, const ImRect& item_rect)
+// Note: if ImGuiItemStatusFlags_HasDisplayRect is set, user needs to set g.LastItemData.DisplayRect.
+void ImGui::SetLastItemData(ImGuiID item_id, ImGuiItemFlags item_flags, ImGuiItemStatusFlags status_flags, const ImRect& item_rect)
{
ImGuiContext& g = *GImGui;
g.LastItemData.ID = item_id;
- g.LastItemData.InFlags = in_flags;
- g.LastItemData.StatusFlags = item_flags;
- g.LastItemData.Rect = item_rect;
+ g.LastItemData.ItemFlags = item_flags;
+ g.LastItemData.StatusFlags = status_flags;
+ g.LastItemData.Rect = g.LastItemData.NavRect = item_rect;
+}
+
+static void ImGui::SetLastItemDataForWindow(ImGuiWindow* window, const ImRect& rect)
+{
+ ImGuiContext& g = *GImGui;
+ SetLastItemData(window->MoveId, g.CurrentItemFlags, window->DC.WindowItemStatusFlags, rect);
+}
+
+static void ImGui::SetLastItemDataForChildWindowItem(ImGuiWindow* window, const ImRect& rect)
+{
+ ImGuiContext& g = *GImGui;
+ SetLastItemData(window->ChildId, g.CurrentItemFlags, window->DC.ChildItemStatusFlags, rect);
}
float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
@@ -3803,31 +4776,62 @@ float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
// IM_ALLOC() == ImGui::MemAlloc()
void* ImGui::MemAlloc(size_t size)
{
+ void* ptr = (*GImAllocatorAllocFunc)(size, GImAllocatorUserData);
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
if (ImGuiContext* ctx = GImGui)
- ctx->IO.MetricsActiveAllocations++;
- return (*GImAllocatorAllocFunc)(size, GImAllocatorUserData);
+ DebugAllocHook(&ctx->DebugAllocInfo, ctx->FrameCount, ptr, size);
+#endif
+ return ptr;
}
// IM_FREE() == ImGui::MemFree()
void ImGui::MemFree(void* ptr)
{
- if (ptr)
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ if (ptr != NULL)
if (ImGuiContext* ctx = GImGui)
- ctx->IO.MetricsActiveAllocations--;
+ DebugAllocHook(&ctx->DebugAllocInfo, ctx->FrameCount, ptr, (size_t)-1);
+#endif
return (*GImAllocatorFreeFunc)(ptr, GImAllocatorUserData);
}
+// We record the number of allocation in recent frames, as a way to audit/sanitize our guiding principles of "no allocations on idle/repeating frames"
+void ImGui::DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr, size_t size)
+{
+ ImGuiDebugAllocEntry* entry = &info->LastEntriesBuf[info->LastEntriesIdx];
+ IM_UNUSED(ptr);
+ if (entry->FrameCount != frame_count)
+ {
+ info->LastEntriesIdx = (info->LastEntriesIdx + 1) % IM_ARRAYSIZE(info->LastEntriesBuf);
+ entry = &info->LastEntriesBuf[info->LastEntriesIdx];
+ entry->FrameCount = frame_count;
+ entry->AllocCount = entry->FreeCount = 0;
+ }
+ if (size != (size_t)-1)
+ {
+ //printf("[%05d] MemAlloc(%d) -> 0x%p\n", frame_count, (int)size, ptr);
+ entry->AllocCount++;
+ info->TotalAllocCount++;
+ }
+ else
+ {
+ //printf("[%05d] MemFree(0x%p)\n", frame_count, ptr);
+ entry->FreeCount++;
+ info->TotalFreeCount++;
+ }
+}
+
const char* ImGui::GetClipboardText()
{
ImGuiContext& g = *GImGui;
- return g.IO.GetClipboardTextFn ? g.IO.GetClipboardTextFn(g.IO.ClipboardUserData) : "";
+ return g.PlatformIO.Platform_GetClipboardTextFn ? g.PlatformIO.Platform_GetClipboardTextFn(&g) : "";
}
void ImGui::SetClipboardText(const char* text)
{
ImGuiContext& g = *GImGui;
- if (g.IO.SetClipboardTextFn)
- g.IO.SetClipboardTextFn(g.IO.ClipboardUserData, text);
+ if (g.PlatformIO.Platform_SetClipboardTextFn != NULL)
+ g.PlatformIO.Platform_SetClipboardTextFn(&g, text);
}
const char* ImGui::GetVersion()
@@ -3835,93 +4839,30 @@ const char* ImGui::GetVersion()
return IMGUI_VERSION;
}
-// Internal state access - if you want to share Dear ImGui state between modules (e.g. DLL) or allocate it yourself
-// Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module
-ImGuiContext* ImGui::GetCurrentContext()
-{
- return GImGui;
-}
-
-void ImGui::SetCurrentContext(ImGuiContext* ctx)
-{
-#ifdef IMGUI_SET_CURRENT_CONTEXT_FUNC
- IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx); // For custom thread-based hackery you may want to have control over this.
-#else
- GImGui = ctx;
-#endif
-}
-
-void ImGui::SetAllocatorFunctions(ImGuiMemAllocFunc alloc_func, ImGuiMemFreeFunc free_func, void* user_data)
-{
- GImAllocatorAllocFunc = alloc_func;
- GImAllocatorFreeFunc = free_func;
- GImAllocatorUserData = user_data;
-}
-
-// This is provided to facilitate copying allocators from one static/DLL boundary to another (e.g. retrieve default allocator of your executable address space)
-void ImGui::GetAllocatorFunctions(ImGuiMemAllocFunc* p_alloc_func, ImGuiMemFreeFunc* p_free_func, void** p_user_data)
-{
- *p_alloc_func = GImAllocatorAllocFunc;
- *p_free_func = GImAllocatorFreeFunc;
- *p_user_data = GImAllocatorUserData;
-}
-
-ImGuiContext* ImGui::CreateContext(ImFontAtlas* shared_font_atlas)
-{
- ImGuiContext* prev_ctx = GetCurrentContext();
- ImGuiContext* ctx = IM_NEW(ImGuiContext)(shared_font_atlas);
- SetCurrentContext(ctx);
- Initialize();
- if (prev_ctx != NULL)
- SetCurrentContext(prev_ctx); // Restore previous context if any, else keep new one.
- return ctx;
-}
-
-void ImGui::DestroyContext(ImGuiContext* ctx)
-{
- ImGuiContext* prev_ctx = GetCurrentContext();
- if (ctx == NULL) //-V1051
- ctx = prev_ctx;
- SetCurrentContext(ctx);
- Shutdown();
- SetCurrentContext((prev_ctx != ctx) ? prev_ctx : NULL);
- IM_DELETE(ctx);
-}
-
-// No specific ordering/dependency support, will see as needed
-ImGuiID ImGui::AddContextHook(ImGuiContext* ctx, const ImGuiContextHook* hook)
+ImGuiIO& ImGui::GetIO()
{
- ImGuiContext& g = *ctx;
- IM_ASSERT(hook->Callback != NULL && hook->HookId == 0 && hook->Type != ImGuiContextHookType_PendingRemoval_);
- g.Hooks.push_back(*hook);
- g.Hooks.back().HookId = ++g.HookIdNext;
- return g.HookIdNext;
+ IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
+ return GImGui->IO;
}
-// Deferred removal, avoiding issue with changing vector while iterating it
-void ImGui::RemoveContextHook(ImGuiContext* ctx, ImGuiID hook_id)
+// This variant exists to facilitate backends experimenting with multi-threaded parallel context. (#8069, #6293, #5856)
+ImGuiIO& ImGui::GetIO(ImGuiContext* ctx)
{
- ImGuiContext& g = *ctx;
- IM_ASSERT(hook_id != 0);
- for (int n = 0; n < g.Hooks.Size; n++)
- if (g.Hooks[n].HookId == hook_id)
- g.Hooks[n].Type = ImGuiContextHookType_PendingRemoval_;
+ IM_ASSERT(ctx != NULL);
+ return ctx->IO;
}
-// Call context hooks (used by e.g. test engine)
-// We assume a small number of hooks so all stored in same array
-void ImGui::CallContextHooks(ImGuiContext* ctx, ImGuiContextHookType hook_type)
+ImGuiPlatformIO& ImGui::GetPlatformIO()
{
- ImGuiContext& g = *ctx;
- for (int n = 0; n < g.Hooks.Size; n++)
- if (g.Hooks[n].Type == hook_type)
- g.Hooks[n].Callback(&g, &g.Hooks[n]);
+ IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext()?");
+ return GImGui->PlatformIO;
}
-ImGuiIO& ImGui::GetIO()
+// This variant exists to facilitate backends experimenting with multi-threaded parallel context. (#8069, #6293, #5856)
+ImGuiPlatformIO& ImGui::GetPlatformIO(ImGuiContext* ctx)
{
- IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
- return GImGui->IO;
+ IM_ASSERT(ctx != NULL);
+ return ctx->PlatformIO;
}
// Pass this to your backend rendering function! Valid after Render() and until the next call to NewFrame()
@@ -3942,33 +4883,33 @@ int ImGui::GetFrameCount()
return GImGui->FrameCount;
}
-static ImDrawList* GetViewportDrawList(ImGuiViewportP* viewport, size_t drawlist_no, const char* drawlist_name)
+static ImDrawList* GetViewportBgFgDrawList(ImGuiViewportP* viewport, size_t drawlist_no, const char* drawlist_name)
{
// Create the draw list on demand, because they are not frequently used for all viewports
ImGuiContext& g = *GImGui;
- IM_ASSERT(drawlist_no < IM_ARRAYSIZE(viewport->DrawLists));
- ImDrawList* draw_list = viewport->DrawLists[drawlist_no];
+ IM_ASSERT(drawlist_no < IM_ARRAYSIZE(viewport->BgFgDrawLists));
+ ImDrawList* draw_list = viewport->BgFgDrawLists[drawlist_no];
if (draw_list == NULL)
{
draw_list = IM_NEW(ImDrawList)(&g.DrawListSharedData);
draw_list->_OwnerName = drawlist_name;
- viewport->DrawLists[drawlist_no] = draw_list;
+ viewport->BgFgDrawLists[drawlist_no] = draw_list;
}
// Our ImDrawList system requires that there is always a command
- if (viewport->DrawListsLastFrame[drawlist_no] != g.FrameCount)
+ if (viewport->BgFgDrawListsLastFrame[drawlist_no] != g.FrameCount)
{
draw_list->_ResetForNewFrame();
draw_list->PushTextureID(g.IO.Fonts->TexID);
draw_list->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size, false);
- viewport->DrawListsLastFrame[drawlist_no] = g.FrameCount;
+ viewport->BgFgDrawListsLastFrame[drawlist_no] = g.FrameCount;
}
return draw_list;
}
ImDrawList* ImGui::GetBackgroundDrawList(ImGuiViewport* viewport)
{
- return GetViewportDrawList((ImGuiViewportP*)viewport, 0, "##Background");
+ return GetViewportBgFgDrawList((ImGuiViewportP*)viewport, 0, "##Background");
}
ImDrawList* ImGui::GetBackgroundDrawList()
@@ -3979,7 +4920,7 @@ ImDrawList* ImGui::GetBackgroundDrawList()
ImDrawList* ImGui::GetForegroundDrawList(ImGuiViewport* viewport)
{
- return GetViewportDrawList((ImGuiViewportP*)viewport, 1, "##Foreground");
+ return GetViewportBgFgDrawList((ImGuiViewportP*)viewport, 1, "##Foreground");
}
ImDrawList* ImGui::GetForegroundDrawList()
@@ -4001,7 +4942,8 @@ void ImGui::StartMouseMovingWindow(ImGuiWindow* window)
ImGuiContext& g = *GImGui;
FocusWindow(window);
SetActiveID(window->MoveId, window);
- g.NavDisableHighlight = true;
+ if (g.IO.ConfigNavCursorVisibleAuto)
+ g.NavCursorVisible = false;
g.ActiveIdClickOffset = g.IO.MouseClickedPos[0] - window->RootWindow->Pos;
g.ActiveIdNoClearOnFocusLoss = true;
SetActiveIdUsingAllKeyboardKeys();
@@ -4015,7 +4957,7 @@ void ImGui::StartMouseMovingWindow(ImGuiWindow* window)
// Handle mouse moving window
// Note: moving window with the navigation keys (Square + d-pad / CTRL+TAB + Arrows) are processed in NavUpdateWindowing()
-// FIXME: We don't have strong guarantee that g.MovingWindow stay synched with g.ActiveId == g.MovingWindow->MoveId.
+// FIXME: We don't have strong guarantee that g.MovingWindow stay synced with g.ActiveId == g.MovingWindow->MoveId.
// This is currently enforced by the fact that BeginDragDropSource() is setting all g.ActiveIdUsingXXXX flags to inhibit navigation inputs,
// but if we should more thoroughly test cases where g.ActiveId or g.MovingWindow gets changed and not the other.
void ImGui::UpdateMouseMovingWindowNewFrame()
@@ -4052,12 +4994,13 @@ void ImGui::UpdateMouseMovingWindowNewFrame()
}
}
-// Initiate moving window when clicking on empty space or title bar.
+// Initiate focusing and moving window when clicking on empty space or title bar.
+// Initiate focusing window when clicking on a disabled item.
// Handle left-click and right-click focus.
void ImGui::UpdateMouseMovingWindowEndFrame()
{
ImGuiContext& g = *GImGui;
- if (g.ActiveId != 0 || g.HoveredId != 0)
+ if (g.ActiveId != 0 || (g.HoveredId != 0 && !g.HoveredIdIsDisabled))
return;
// Unless we just made a window/popup appear
@@ -4078,25 +5021,27 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
StartMouseMovingWindow(g.HoveredWindow); //-V595
// Cancel moving if clicked outside of title bar
- if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(root_window->Flags & ImGuiWindowFlags_NoTitleBar))
- if (!root_window->TitleBarRect().Contains(g.IO.MouseClickedPos[0]))
- g.MovingWindow = NULL;
-
- // Cancel moving if clicked over an item which was disabled or inhibited by popups (note that we know HoveredId == 0 already)
- if (g.HoveredIdDisabled)
+ if (g.IO.ConfigWindowsMoveFromTitleBarOnly)
+ if (!(root_window->Flags & ImGuiWindowFlags_NoTitleBar))
+ if (!root_window->TitleBarRect().Contains(g.IO.MouseClickedPos[0]))
+ g.MovingWindow = NULL;
+
+ // Cancel moving if clicked over an item which was disabled or inhibited by popups
+ // (when g.HoveredIdIsDisabled == true && g.HoveredId == 0 we are inhibited by popups, when g.HoveredIdIsDisabled == true && g.HoveredId != 0 we are over a disabled item)0 already)
+ if (g.HoveredIdIsDisabled)
g.MovingWindow = NULL;
}
- else if (root_window == NULL && g.NavWindow != NULL && GetTopMostPopupModal() == NULL)
+ else if (root_window == NULL && g.NavWindow != NULL)
{
// Clicking on void disable focus
- FocusWindow(NULL);
+ FocusWindow(NULL, ImGuiFocusRequestFlags_UnlessBelowModal);
}
}
// With right mouse button we close popups without changing focus based on where the mouse is aimed
// Instead, focus will be restored to the window under the bottom-most closed popup.
// (The left mouse button path calls FocusWindow on the hovered window, which will lead NewFrame->ClosePopupsOverWindow to trigger)
- if (g.IO.MouseClicked[1])
+ if (g.IO.MouseClicked[1] && g.HoveredId == 0)
{
// Find the top-most window between HoveredWindow and the top-most Modal Window.
// This is where we can trim the popup stack.
@@ -4111,361 +5056,30 @@ static bool IsWindowActiveAndVisible(ImGuiWindow* window)
return (window->Active) && (!window->Hidden);
}
-static void UpdateAliasKey(ImGuiKey key, bool v, float analog_value)
-{
- IM_ASSERT(ImGui::IsAliasKey(key));
- ImGuiKeyData* key_data = ImGui::GetKeyData(key);
- key_data->Down = v;
- key_data->AnalogValue = analog_value;
-}
-
-// Rewrite routing data buffers to strip old entries + sort by key to make queries not touch scattered data.
-// Entries D,A,B,B,A,C,B --> A,A,B,B,B,C,D
-// Index A:1 B:2 C:5 D:0 --> A:0 B:2 C:5 D:6
-// See 'Metrics->Key Owners & Shortcut Routing' to visualize the result of that operation.
-static void UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt)
-{
- ImGuiContext& g = *GImGui;
- rt->EntriesNext.resize(0);
- for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1))
- {
- const int new_routing_start_idx = rt->EntriesNext.Size;
- ImGuiKeyRoutingData* routing_entry;
- for (int old_routing_idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; old_routing_idx != -1; old_routing_idx = routing_entry->NextEntryIndex)
- {
- routing_entry = &rt->Entries[old_routing_idx];
- routing_entry->RoutingCurr = routing_entry->RoutingNext; // Update entry
- routing_entry->RoutingNext = ImGuiKeyOwner_None;
- routing_entry->RoutingNextScore = 255;
- if (routing_entry->RoutingCurr == ImGuiKeyOwner_None)
- continue;
- rt->EntriesNext.push_back(*routing_entry); // Write alive ones into new buffer
-
- // Apply routing to owner if there's no owner already (RoutingCurr == None at this point)
- if (routing_entry->Mods == g.IO.KeyMods)
- {
- ImGuiKeyOwnerData* owner_data = ImGui::GetKeyOwnerData(key);
- if (owner_data->OwnerCurr == ImGuiKeyOwner_None)
- owner_data->OwnerCurr = routing_entry->RoutingCurr;
- }
- }
-
- // Rewrite linked-list
- rt->Index[key - ImGuiKey_NamedKey_BEGIN] = (ImGuiKeyRoutingIndex)(new_routing_start_idx < rt->EntriesNext.Size ? new_routing_start_idx : -1);
- for (int n = new_routing_start_idx; n < rt->EntriesNext.Size; n++)
- rt->EntriesNext[n].NextEntryIndex = (ImGuiKeyRoutingIndex)((n + 1 < rt->EntriesNext.Size) ? n + 1 : -1);
- }
- rt->Entries.swap(rt->EntriesNext); // Swap new and old indexes
-}
-
-// [Internal] Do not use directly (should read io.KeyMods instead)
-static ImGuiKeyChord GetMergedModsFromBools()
-{
- ImGuiContext& g = *GImGui;
- ImGuiKeyChord key_chord = 0;
- if (g.IO.KeyCtrl) { key_chord |= ImGuiMod_Ctrl; }
- if (g.IO.KeyShift) { key_chord |= ImGuiMod_Shift; }
- if (g.IO.KeyAlt) { key_chord |= ImGuiMod_Alt; }
- if (g.IO.KeySuper) { key_chord |= ImGuiMod_Super; }
- return key_chord;
-}
-
-static void ImGui::UpdateKeyboardInputs()
-{
- ImGuiContext& g = *GImGui;
- ImGuiIO& io = g.IO;
-
- // Import legacy keys or verify they are not used
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- if (io.BackendUsingLegacyKeyArrays == 0)
- {
- // Backend used new io.AddKeyEvent() API: Good! Verify that old arrays are never written to externally.
- for (int n = 0; n < ImGuiKey_LegacyNativeKey_END; n++)
- IM_ASSERT((io.KeysDown[n] == false || IsKeyDown((ImGuiKey)n)) && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!");
- }
- else
- {
- if (g.FrameCount == 0)
- for (int n = ImGuiKey_LegacyNativeKey_BEGIN; n < ImGuiKey_LegacyNativeKey_END; n++)
- IM_ASSERT(g.IO.KeyMap[n] == -1 && "Backend is not allowed to write to io.KeyMap[0..511]!");
-
- // Build reverse KeyMap (Named -> Legacy)
- for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_NamedKey_END; n++)
- if (io.KeyMap[n] != -1)
- {
- IM_ASSERT(IsLegacyKey((ImGuiKey)io.KeyMap[n]));
- io.KeyMap[io.KeyMap[n]] = n;
- }
-
- // Import legacy keys into new ones
- for (int n = ImGuiKey_LegacyNativeKey_BEGIN; n < ImGuiKey_LegacyNativeKey_END; n++)
- if (io.KeysDown[n] || io.BackendUsingLegacyKeyArrays == 1)
- {
- const ImGuiKey key = (ImGuiKey)(io.KeyMap[n] != -1 ? io.KeyMap[n] : n);
- IM_ASSERT(io.KeyMap[n] == -1 || IsNamedKey(key));
- io.KeysData[key].Down = io.KeysDown[n];
- if (key != n)
- io.KeysDown[key] = io.KeysDown[n]; // Allow legacy code using io.KeysDown[GetKeyIndex()] with old backends
- io.BackendUsingLegacyKeyArrays = 1;
- }
- if (io.BackendUsingLegacyKeyArrays == 1)
- {
- GetKeyData(ImGuiMod_Ctrl)->Down = io.KeyCtrl;
- GetKeyData(ImGuiMod_Shift)->Down = io.KeyShift;
- GetKeyData(ImGuiMod_Alt)->Down = io.KeyAlt;
- GetKeyData(ImGuiMod_Super)->Down = io.KeySuper;
- }
- }
-
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
- if (io.BackendUsingLegacyNavInputArray && nav_gamepad_active)
- {
- #define MAP_LEGACY_NAV_INPUT_TO_KEY1(_KEY, _NAV1) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f); io.KeysData[_KEY].AnalogValue = io.NavInputs[_NAV1]; } while (0)
- #define MAP_LEGACY_NAV_INPUT_TO_KEY2(_KEY, _NAV1, _NAV2) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f) || (io.NavInputs[_NAV2] > 0.0f); io.KeysData[_KEY].AnalogValue = ImMax(io.NavInputs[_NAV1], io.NavInputs[_NAV2]); } while (0)
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceDown, ImGuiNavInput_Activate);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceRight, ImGuiNavInput_Cancel);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceLeft, ImGuiNavInput_Menu);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceUp, ImGuiNavInput_Input);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadLeft, ImGuiNavInput_DpadLeft);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadRight, ImGuiNavInput_DpadRight);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadUp, ImGuiNavInput_DpadUp);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadDown, ImGuiNavInput_DpadDown);
- MAP_LEGACY_NAV_INPUT_TO_KEY2(ImGuiKey_GamepadL1, ImGuiNavInput_FocusPrev, ImGuiNavInput_TweakSlow);
- MAP_LEGACY_NAV_INPUT_TO_KEY2(ImGuiKey_GamepadR1, ImGuiNavInput_FocusNext, ImGuiNavInput_TweakFast);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickLeft, ImGuiNavInput_LStickLeft);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickRight, ImGuiNavInput_LStickRight);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickUp, ImGuiNavInput_LStickUp);
- MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickDown, ImGuiNavInput_LStickDown);
- #undef NAV_MAP_KEY
- }
-#endif
-
-#endif
-
- // Synchronize io.KeyMods with individual modifiers io.KeyXXX bools, update aliases
- io.KeyMods = GetMergedModsFromBools();
- for (int n = 0; n < ImGuiMouseButton_COUNT; n++)
- UpdateAliasKey(MouseButtonToKey(n), io.MouseDown[n], io.MouseDown[n] ? 1.0f : 0.0f);
- UpdateAliasKey(ImGuiKey_MouseWheelX, io.MouseWheelH != 0.0f, io.MouseWheelH);
- UpdateAliasKey(ImGuiKey_MouseWheelY, io.MouseWheel != 0.0f, io.MouseWheel);
-
- // Clear gamepad data if disabled
- if ((io.BackendFlags & ImGuiBackendFlags_HasGamepad) == 0)
- for (int i = ImGuiKey_Gamepad_BEGIN; i < ImGuiKey_Gamepad_END; i++)
- {
- io.KeysData[i - ImGuiKey_KeysData_OFFSET].Down = false;
- io.KeysData[i - ImGuiKey_KeysData_OFFSET].AnalogValue = 0.0f;
- }
-
- // Update keys
- for (int i = 0; i < ImGuiKey_KeysData_SIZE; i++)
- {
- ImGuiKeyData* key_data = &io.KeysData[i];
- key_data->DownDurationPrev = key_data->DownDuration;
- key_data->DownDuration = key_data->Down ? (key_data->DownDuration < 0.0f ? 0.0f : key_data->DownDuration + io.DeltaTime) : -1.0f;
- }
-
- // Update keys/input owner (named keys only): one entry per key
- for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1))
- {
- ImGuiKeyData* key_data = &io.KeysData[key - ImGuiKey_KeysData_OFFSET];
- ImGuiKeyOwnerData* owner_data = &g.KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN];
- owner_data->OwnerCurr = owner_data->OwnerNext;
- if (!key_data->Down) // Important: ownership is released on the frame after a release. Ensure a 'MouseDown -> CloseWindow -> MouseUp' chain doesn't lead to someone else seeing the MouseUp.
- owner_data->OwnerNext = ImGuiKeyOwner_None;
- owner_data->LockThisFrame = owner_data->LockUntilRelease = owner_data->LockUntilRelease && key_data->Down; // Clear LockUntilRelease when key is not Down anymore
- }
-
- UpdateKeyRoutingTable(&g.KeysRoutingTable);
-}
-
-static void ImGui::UpdateMouseInputs()
-{
- ImGuiContext& g = *GImGui;
- ImGuiIO& io = g.IO;
-
- // Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't support them well)
- if (IsMousePosValid(&io.MousePos))
- io.MousePos = g.MouseLastValidPos = ImFloorSigned(io.MousePos);
-
- // If mouse just appeared or disappeared (usually denoted by -FLT_MAX components) we cancel out movement in MouseDelta
- if (IsMousePosValid(&io.MousePos) && IsMousePosValid(&io.MousePosPrev))
- io.MouseDelta = io.MousePos - io.MousePosPrev;
- else
- io.MouseDelta = ImVec2(0.0f, 0.0f);
-
- // If mouse moved we re-enable mouse hovering in case it was disabled by gamepad/keyboard. In theory should use a >0.0f threshold but would need to reset in everywhere we set this to true.
- if (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f)
- g.NavDisableMouseHover = false;
-
- io.MousePosPrev = io.MousePos;
- for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++)
- {
- io.MouseClicked[i] = io.MouseDown[i] && io.MouseDownDuration[i] < 0.0f;
- io.MouseClickedCount[i] = 0; // Will be filled below
- io.MouseReleased[i] = !io.MouseDown[i] && io.MouseDownDuration[i] >= 0.0f;
- io.MouseDownDurationPrev[i] = io.MouseDownDuration[i];
- io.MouseDownDuration[i] = io.MouseDown[i] ? (io.MouseDownDuration[i] < 0.0f ? 0.0f : io.MouseDownDuration[i] + io.DeltaTime) : -1.0f;
- if (io.MouseClicked[i])
- {
- bool is_repeated_click = false;
- if ((float)(g.Time - io.MouseClickedTime[i]) < io.MouseDoubleClickTime)
- {
- ImVec2 delta_from_click_pos = IsMousePosValid(&io.MousePos) ? (io.MousePos - io.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f);
- if (ImLengthSqr(delta_from_click_pos) < io.MouseDoubleClickMaxDist * io.MouseDoubleClickMaxDist)
- is_repeated_click = true;
- }
- if (is_repeated_click)
- io.MouseClickedLastCount[i]++;
- else
- io.MouseClickedLastCount[i] = 1;
- io.MouseClickedTime[i] = g.Time;
- io.MouseClickedPos[i] = io.MousePos;
- io.MouseClickedCount[i] = io.MouseClickedLastCount[i];
- io.MouseDragMaxDistanceSqr[i] = 0.0f;
- }
- else if (io.MouseDown[i])
- {
- // Maintain the maximum distance we reaching from the initial click position, which is used with dragging threshold
- float delta_sqr_click_pos = IsMousePosValid(&io.MousePos) ? ImLengthSqr(io.MousePos - io.MouseClickedPos[i]) : 0.0f;
- io.MouseDragMaxDistanceSqr[i] = ImMax(io.MouseDragMaxDistanceSqr[i], delta_sqr_click_pos);
- }
-
- // We provide io.MouseDoubleClicked[] as a legacy service
- io.MouseDoubleClicked[i] = (io.MouseClickedCount[i] == 2);
-
- // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation
- if (io.MouseClicked[i])
- g.NavDisableMouseHover = false;
- }
-}
-
-static void LockWheelingWindow(ImGuiWindow* window, float wheel_amount)
-{
- ImGuiContext& g = *GImGui;
- if (window)
- g.WheelingWindowReleaseTimer = ImMin(g.WheelingWindowReleaseTimer + ImAbs(wheel_amount) * WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER, WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER);
- else
- g.WheelingWindowReleaseTimer = 0.0f;
- if (g.WheelingWindow == window)
- return;
- IMGUI_DEBUG_LOG_IO("LockWheelingWindow() \"%s\"\n", window ? window->Name : "NULL");
- g.WheelingWindow = window;
- g.WheelingWindowRefMousePos = g.IO.MousePos;
-}
-
-void ImGui::UpdateMouseWheel()
-{
- ImGuiContext& g = *GImGui;
-
- // Reset the locked window if we move the mouse or after the timer elapses
- if (g.WheelingWindow != NULL)
- {
- g.WheelingWindowReleaseTimer -= g.IO.DeltaTime;
- if (IsMousePosValid() && ImLengthSqr(g.IO.MousePos - g.WheelingWindowRefMousePos) > g.IO.MouseDragThreshold * g.IO.MouseDragThreshold)
- g.WheelingWindowReleaseTimer = 0.0f;
- if (g.WheelingWindowReleaseTimer <= 0.0f)
- LockWheelingWindow(NULL, 0.0f);
- }
-
- ImVec2 wheel;
- wheel.x = TestKeyOwner(ImGuiKey_MouseWheelX, ImGuiKeyOwner_None) ? g.IO.MouseWheelH : 0.0f;
- wheel.y = TestKeyOwner(ImGuiKey_MouseWheelY, ImGuiKeyOwner_None) ? g.IO.MouseWheel : 0.0f;
- if (wheel.x == 0.0f && wheel.y == 0.0f)
- return;
-
- //IMGUI_DEBUG_LOG("MouseWheel X:%.3f Y:%.3f\n", wheel_x, wheel_y);
- ImGuiWindow* mouse_window = g.WheelingWindow ? g.WheelingWindow : g.HoveredWindow;
- if (!mouse_window || mouse_window->Collapsed)
- return;
-
- // Zoom / Scale window
- // FIXME-OBSOLETE: This is an old feature, it still works but pretty much nobody is using it and may be best redesigned.
- if (wheel.y != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling)
- {
- LockWheelingWindow(mouse_window, wheel.y);
- ImGuiWindow* window = mouse_window;
- const float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f);
- const float scale = new_font_scale / window->FontWindowScale;
- window->FontWindowScale = new_font_scale;
- if (window == window->RootWindow)
- {
- const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size;
- SetWindowPos(window, window->Pos + offset, 0);
- window->Size = ImFloor(window->Size * scale);
- window->SizeFull = ImFloor(window->SizeFull * scale);
- }
- return;
- }
- if (g.IO.KeyCtrl)
- return;
-
- // Mouse wheel scrolling
- // As a standard behavior holding SHIFT while using Vertical Mouse Wheel triggers Horizontal scroll instead
- // (we avoid doing it on OSX as it the OS input layer handles this already)
- const bool swap_axis = g.IO.KeyShift && !g.IO.ConfigMacOSXBehaviors;
- if (swap_axis)
- {
- wheel.x = wheel.y;
- wheel.y = 0.0f;
- }
-
- // Vertical Mouse Wheel scrolling
- // Bubble up into parent window if:
- // - a child window doesn't allow any scrolling.
- // - a child window doesn't need scrolling because it is already at the edge for the direction we are going in.
- // - a child window has the ImGuiWindowFlags_NoScrollWithMouse flag.
- if (wheel.y != 0.0f)
- {
- ImGuiWindow* window = mouse_window;
- while ((window->Flags & ImGuiWindowFlags_ChildWindow) && ((window->ScrollMax.y == 0.0f) || ((window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs))))
- window = window->ParentWindow;
- if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs))
- {
- LockWheelingWindow(mouse_window, wheel.y);
- float max_step = window->InnerRect.GetHeight() * 0.67f;
- float scroll_step = ImFloor(ImMin(5 * window->CalcFontSize(), max_step));
- SetScrollY(window, window->Scroll.y - wheel.y * scroll_step);
- }
- }
-
- // Horizontal Mouse Wheel scrolling, or Vertical Mouse Wheel w/ Shift held
- if (wheel.x != 0.0f)
- {
- ImGuiWindow* window = mouse_window;
- while ((window->Flags & ImGuiWindowFlags_ChildWindow) && ((window->ScrollMax.x == 0.0f) || ((window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs))))
- window = window->ParentWindow;
- if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs))
- {
- LockWheelingWindow(mouse_window, wheel.x);
- float max_step = window->InnerRect.GetWidth() * 0.67f;
- float scroll_step = ImFloor(ImMin(2 * window->CalcFontSize(), max_step));
- SetScrollX(window, window->Scroll.x - wheel.x * scroll_step);
- }
- }
-}
-
// The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app)
void ImGui::UpdateHoveredWindowAndCaptureFlags()
{
ImGuiContext& g = *GImGui;
ImGuiIO& io = g.IO;
- g.WindowsHoverPadding = ImMax(g.Style.TouchExtraPadding, ImVec2(WINDOWS_HOVER_PADDING, WINDOWS_HOVER_PADDING));
+
+ // FIXME-DPI: This storage was added on 2021/03/31 for test engine, but if we want to multiply WINDOWS_HOVER_PADDING
+ // by DpiScale, we need to make this window-agnostic anyhow, maybe need storing inside ImGuiWindow.
+ g.WindowsBorderHoverPadding = ImMax(ImMax(g.Style.TouchExtraPadding.x, g.Style.TouchExtraPadding.y), g.Style.WindowBorderHoverPadding);
// Find the window hovered by mouse:
// - Child windows can extend beyond the limit of their parent so we need to derive HoveredRootWindow from HoveredWindow.
// - When moving a window we can skip the search, which also conveniently bypasses the fact that window->WindowRectClipped is lagging as this point of the frame.
// - We also support the moved window toggling the NoInputs flag after moving has started in order to be able to detect windows below it, which is useful for e.g. docking mechanisms.
bool clear_hovered_windows = false;
- FindHoveredWindow();
+ FindHoveredWindowEx(g.IO.MousePos, false, &g.HoveredWindow, &g.HoveredWindowUnderMovingWindow);
+ g.HoveredWindowBeforeClear = g.HoveredWindow;
// Modal windows prevents mouse from hovering behind them.
ImGuiWindow* modal_window = GetTopMostPopupModal();
if (modal_window && g.HoveredWindow && !IsWindowWithinBeginStackOf(g.HoveredWindow->RootWindow, modal_window))
clear_hovered_windows = true;
- // Disabled mouse?
+ // Disabled mouse hovering (we don't currently clear MousePos, we could)
if (io.ConfigFlags & ImGuiConfigFlags_NoMouse)
clear_hovered_windows = true;
@@ -4483,7 +5097,7 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags()
io.MouseDownOwnedUnlessPopupClose[i] = (g.HoveredWindow != NULL) || has_open_modal;
}
mouse_any_down |= io.MouseDown[i];
- if (io.MouseDown[i])
+ if (io.MouseDown[i] || io.MouseReleased[i]) // Increase release frame for our evaluation of earliest button (#1392)
if (mouse_earliest_down == -1 || io.MouseClickedTime[i] < io.MouseClickedTime[mouse_earliest_down])
mouse_earliest_down = i;
}
@@ -4512,17 +5126,44 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags()
}
// Update io.WantCaptureKeyboard for the user application (true = dispatch keyboard info to Dear ImGui only, false = dispatch keyboard info to Dear ImGui + underlying app)
- if (g.WantCaptureKeyboardNextFrame != -1)
+ io.WantCaptureKeyboard = false;
+ if ((io.ConfigFlags & ImGuiConfigFlags_NoKeyboard) == 0)
+ {
+ if ((g.ActiveId != 0) || (modal_window != NULL))
+ io.WantCaptureKeyboard = true;
+ else if (io.NavActive && (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && io.ConfigNavCaptureKeyboard)
+ io.WantCaptureKeyboard = true;
+ }
+ if (g.WantCaptureKeyboardNextFrame != -1) // Manual override
io.WantCaptureKeyboard = (g.WantCaptureKeyboardNextFrame != 0);
- else
- io.WantCaptureKeyboard = (g.ActiveId != 0) || (modal_window != NULL);
- if (io.NavActive && (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && !(io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard))
- io.WantCaptureKeyboard = true;
// Update io.WantTextInput flag, this is to allow systems without a keyboard (e.g. mobile, hand-held) to show a software keyboard if possible
io.WantTextInput = (g.WantTextInputNextFrame != -1) ? (g.WantTextInputNextFrame != 0) : false;
}
+// Called once a frame. Followed by SetCurrentFont() which sets up the remaining data.
+// FIXME-VIEWPORT: the concept of a single ClipRectFullscreen is not ideal!
+static void SetupDrawListSharedData()
+{
+ ImGuiContext& g = *GImGui;
+ ImRect virtual_space(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
+ for (ImGuiViewportP* viewport : g.Viewports)
+ virtual_space.Add(viewport->GetMainRect());
+ g.DrawListSharedData.ClipRectFullscreen = virtual_space.ToVec4();
+ g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol;
+ g.DrawListSharedData.SetCircleTessellationMaxError(g.Style.CircleTessellationMaxError);
+ g.DrawListSharedData.InitialFlags = ImDrawListFlags_None;
+ if (g.Style.AntiAliasedLines)
+ g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLines;
+ if (g.Style.AntiAliasedLinesUseTex && !(g.IO.Fonts->Flags & ImFontAtlasFlags_NoBakedLines))
+ g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLinesUseTex;
+ if (g.Style.AntiAliasedFill)
+ g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill;
+ if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset)
+ g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset;
+ g.DrawListSharedData.InitialFringeScale = 1.0f; // FIXME-DPI: Change this for some DPI scaling experiments.
+}
+
void ImGui::NewFrame()
{
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
@@ -4556,39 +5197,33 @@ void ImGui::NewFrame()
g.FramerateSecPerFrameCount = ImMin(g.FramerateSecPerFrameCount + 1, IM_ARRAYSIZE(g.FramerateSecPerFrame));
g.IO.Framerate = (g.FramerateSecPerFrameAccum > 0.0f) ? (1.0f / (g.FramerateSecPerFrameAccum / (float)g.FramerateSecPerFrameCount)) : FLT_MAX;
+ // Process input queue (trickle as many events as possible), turn events into writes to IO structure
+ g.InputEventsTrail.resize(0);
+ UpdateInputEvents(g.IO.ConfigInputTrickleEventQueue);
+
+ // Update viewports (after processing input queue, so io.MouseHoveredViewport is set)
UpdateViewportsNewFrame();
// Setup current font and draw list shared data
g.IO.Fonts->Locked = true;
+ SetupDrawListSharedData();
SetCurrentFont(GetDefaultFont());
IM_ASSERT(g.Font->IsLoaded());
- ImRect virtual_space(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
- for (int n = 0; n < g.Viewports.Size; n++)
- virtual_space.Add(g.Viewports[n]->GetMainRect());
- g.DrawListSharedData.ClipRectFullscreen = virtual_space.ToVec4();
- g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol;
- g.DrawListSharedData.SetCircleTessellationMaxError(g.Style.CircleTessellationMaxError);
- g.DrawListSharedData.InitialFlags = ImDrawListFlags_None;
- if (g.Style.AntiAliasedLines)
- g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLines;
- if (g.Style.AntiAliasedLinesUseTex && !(g.Font->ContainerAtlas->Flags & ImFontAtlasFlags_NoBakedLines))
- g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLinesUseTex;
- if (g.Style.AntiAliasedFill)
- g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill;
- if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset)
- g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset;
// Mark rendering data as invalid to prevent user who may have a handle on it to use it.
- for (int n = 0; n < g.Viewports.Size; n++)
- {
- ImGuiViewportP* viewport = g.Viewports[n];
- viewport->DrawDataP.Clear();
- }
+ for (ImGuiViewportP* viewport : g.Viewports)
+ viewport->DrawDataP.Valid = false;
// Drag and drop keep the source ID alive so even if the source disappear our state is consistent
if (g.DragDropActive && g.DragDropPayload.SourceId == g.ActiveId)
KeepAliveID(g.DragDropPayload.SourceId);
+ // [DEBUG]
+ if (!g.IO.ConfigDebugHighlightIdConflicts || !g.IO.KeyCtrl) // Count is locked while holding CTRL
+ g.DebugDrawIdConflicts = 0;
+ if (g.IO.ConfigDebugHighlightIdConflicts && g.HoveredIdPreviousFrameItemCount > 1)
+ g.DebugDrawIdConflicts = g.HoveredIdPreviousFrame;
+
// Update HoveredId data
if (!g.HoveredIdPreviousFrame)
g.HoveredIdTimer = 0.0f;
@@ -4599,9 +5234,10 @@ void ImGui::NewFrame()
if (g.HoveredId && g.ActiveId != g.HoveredId)
g.HoveredIdNotActiveTimer += g.IO.DeltaTime;
g.HoveredIdPreviousFrame = g.HoveredId;
+ g.HoveredIdPreviousFrameItemCount = 0;
g.HoveredId = 0;
g.HoveredIdAllowOverlap = false;
- g.HoveredIdDisabled = false;
+ g.HoveredIdIsDisabled = false;
// Clear ActiveID if the item is not alive anymore.
// In 1.87, the common most call to KeepAliveID() was moved from GetID() to ItemAdd().
@@ -4617,11 +5253,8 @@ void ImGui::NewFrame()
g.ActiveIdTimer += g.IO.DeltaTime;
g.LastActiveIdTimer += g.IO.DeltaTime;
g.ActiveIdPreviousFrame = g.ActiveId;
- g.ActiveIdPreviousFrameWindow = g.ActiveIdWindow;
- g.ActiveIdPreviousFrameHasBeenEditedBefore = g.ActiveIdHasBeenEditedBefore;
g.ActiveIdIsAlive = 0;
g.ActiveIdHasBeenEditedThisFrame = false;
- g.ActiveIdPreviousFrameIsAlive = false;
g.ActiveIdIsJustActivated = false;
if (g.TempInputId != 0 && g.ActiveId != g.TempInputId)
g.TempInputId = 0;
@@ -4629,40 +5262,38 @@ void ImGui::NewFrame()
{
g.ActiveIdUsingNavDirMask = 0x00;
g.ActiveIdUsingAllKeyboardKeys = false;
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- g.ActiveIdUsingNavInputMask = 0x00;
-#endif
- }
-
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- if (g.ActiveId == 0)
- g.ActiveIdUsingNavInputMask = 0;
- else if (g.ActiveIdUsingNavInputMask != 0)
- {
- // If your custom widget code used: { g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel); }
- // Since IMGUI_VERSION_NUM >= 18804 it should be: { SetKeyOwner(ImGuiKey_Escape, g.ActiveId); SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId); }
- if (g.ActiveIdUsingNavInputMask & (1 << ImGuiNavInput_Cancel))
- SetKeyOwner(ImGuiKey_Escape, g.ActiveId);
- if (g.ActiveIdUsingNavInputMask & ~(1 << ImGuiNavInput_Cancel))
- IM_ASSERT(0); // Other values unsupported
}
-#endif
+ if (g.DeactivatedItemData.ElapseFrame < g.FrameCount)
+ g.DeactivatedItemData.ID = 0;
+ g.DeactivatedItemData.IsAlive = false;
+
+ // Record when we have been stationary as this state is preserved while over same item.
+ // FIXME: The way this is expressed means user cannot alter HoverStationaryDelay during the frame to use varying values.
+ // To allow this we should store HoverItemMaxStationaryTime+ID and perform the >= check in IsItemHovered() function.
+ if (g.HoverItemDelayId != 0 && g.MouseStationaryTimer >= g.Style.HoverStationaryDelay)
+ g.HoverItemUnlockedStationaryId = g.HoverItemDelayId;
+ else if (g.HoverItemDelayId == 0)
+ g.HoverItemUnlockedStationaryId = 0;
+ if (g.HoveredWindow != NULL && g.MouseStationaryTimer >= g.Style.HoverStationaryDelay)
+ g.HoverWindowUnlockedStationaryId = g.HoveredWindow->ID;
+ else if (g.HoveredWindow == NULL)
+ g.HoverWindowUnlockedStationaryId = 0;
// Update hover delay for IsItemHovered() with delays and tooltips
- g.HoverDelayIdPreviousFrame = g.HoverDelayId;
- if (g.HoverDelayId != 0)
+ g.HoverItemDelayIdPreviousFrame = g.HoverItemDelayId;
+ if (g.HoverItemDelayId != 0)
{
- //if (g.IO.MouseDelta.x == 0.0f && g.IO.MouseDelta.y == 0.0f) // Need design/flags
- g.HoverDelayTimer += g.IO.DeltaTime;
- g.HoverDelayClearTimer = 0.0f;
- g.HoverDelayId = 0;
+ g.HoverItemDelayTimer += g.IO.DeltaTime;
+ g.HoverItemDelayClearTimer = 0.0f;
+ g.HoverItemDelayId = 0;
}
- else if (g.HoverDelayTimer > 0.0f)
+ else if (g.HoverItemDelayTimer > 0.0f)
{
// This gives a little bit of leeway before clearing the hover timer, allowing mouse to cross gaps
- g.HoverDelayClearTimer += g.IO.DeltaTime;
- if (g.HoverDelayClearTimer >= ImMax(0.20f, g.IO.DeltaTime * 2.0f)) // ~6 frames at 30 Hz + allow for low framerate
- g.HoverDelayTimer = g.HoverDelayClearTimer = 0.0f; // May want a decaying timer, in which case need to clamp at max first, based on max of caller last requested timer.
+ // We could expose 0.25f as style.HoverClearDelay but I am not sure of the logic yet, this is particularly subtle.
+ g.HoverItemDelayClearTimer += g.IO.DeltaTime;
+ if (g.HoverItemDelayClearTimer >= ImMax(0.25f, g.IO.DeltaTime * 2.0f)) // ~7 frames at 30 Hz + allow for low framerate
+ g.HoverItemDelayTimer = g.HoverItemDelayClearTimer = 0.0f; // May want a decaying timer, in which case need to clamp at max first, based on max of caller last requested timer.
}
// Drag and drop
@@ -4672,15 +5303,12 @@ void ImGui::NewFrame()
g.DragDropWithinSource = false;
g.DragDropWithinTarget = false;
g.DragDropHoldJustPressedId = 0;
+ g.TooltipPreviousWindow = NULL;
// Close popups on focus lost (currently wip/opt-in)
//if (g.IO.AppFocusLost)
// ClosePopupsExceptModals();
- // Process input queue (trickle as many events as possible)
- g.InputEventsTrail.resize(0);
- UpdateInputEvents(g.IO.ConfigInputTrickleEventQueue);
-
// Update keyboard input state
UpdateKeyboardInputs();
@@ -4689,14 +5317,31 @@ void ImGui::NewFrame()
//IM_ASSERT(g.IO.KeyAlt == IsKeyDown(ImGuiKey_LeftAlt) || IsKeyDown(ImGuiKey_RightAlt));
//IM_ASSERT(g.IO.KeySuper == IsKeyDown(ImGuiKey_LeftSuper) || IsKeyDown(ImGuiKey_RightSuper));
- // Update gamepad/keyboard navigation
+ // Update keyboard/gamepad navigation
NavUpdate();
// Update mouse input state
UpdateMouseInputs();
+ // Mark all windows as not visible and compact unused memory.
+ IM_ASSERT(g.WindowsFocusOrder.Size <= g.Windows.Size);
+ const float memory_compact_start_time = (g.GcCompactAll || g.IO.ConfigMemoryCompactTimer < 0.0f) ? FLT_MAX : (float)g.Time - g.IO.ConfigMemoryCompactTimer;
+ for (ImGuiWindow* window : g.Windows)
+ {
+ window->WasActive = window->Active;
+ window->Active = false;
+ window->WriteAccessed = false;
+ window->BeginCountPreviousFrame = window->BeginCount;
+ window->BeginCount = 0;
+
+ // Garbage collect transient buffers of recently unused windows
+ if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time)
+ GcCompactTransientWindowBuffers(window);
+ }
+
// Find hovered window
// (needs to be before UpdateMouseMovingWindowNewFrame so we fill g.HoveredWindowUnderMovingWindow on the mouse release frame)
+ // (currently needs to be done after the WasActive=Active loop and FindHoveredWindowEx uses ->Active)
UpdateHoveredWindowAndCaptureFlags();
// Handle user moving window with mouse (at the beginning of the frame to avoid input lag or sheering)
@@ -4718,51 +5363,47 @@ void ImGui::NewFrame()
// Mouse wheel scrolling, scale
UpdateMouseWheel();
- // Mark all windows as not visible and compact unused memory.
- IM_ASSERT(g.WindowsFocusOrder.Size <= g.Windows.Size);
- const float memory_compact_start_time = (g.GcCompactAll || g.IO.ConfigMemoryCompactTimer < 0.0f) ? FLT_MAX : (float)g.Time - g.IO.ConfigMemoryCompactTimer;
- for (int i = 0; i != g.Windows.Size; i++)
- {
- ImGuiWindow* window = g.Windows[i];
- window->WasActive = window->Active;
- window->Active = false;
- window->WriteAccessed = false;
- window->BeginCountPreviousFrame = window->BeginCount;
- window->BeginCount = 0;
-
- // Garbage collect transient buffers of recently unused windows
- if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time)
- GcCompactTransientWindowBuffers(window);
- }
-
// Garbage collect transient buffers of recently unused tables
for (int i = 0; i < g.TablesLastTimeActive.Size; i++)
if (g.TablesLastTimeActive[i] >= 0.0f && g.TablesLastTimeActive[i] < memory_compact_start_time)
TableGcCompactTransientBuffers(g.Tables.GetByIndex(i));
- for (int i = 0; i < g.TablesTempData.Size; i++)
- if (g.TablesTempData[i].LastTimeActive >= 0.0f && g.TablesTempData[i].LastTimeActive < memory_compact_start_time)
- TableGcCompactTransientBuffers(&g.TablesTempData[i]);
+ for (ImGuiTableTempData& table_temp_data : g.TablesTempData)
+ if (table_temp_data.LastTimeActive >= 0.0f && table_temp_data.LastTimeActive < memory_compact_start_time)
+ TableGcCompactTransientBuffers(&table_temp_data);
if (g.GcCompactAll)
GcCompactTransientMiscBuffers();
g.GcCompactAll = false;
// Closing the focused window restore focus to the first active root window in descending z-order
if (g.NavWindow && !g.NavWindow->WasActive)
- FocusTopMostWindowUnderOne(NULL, NULL);
+ FocusTopMostWindowUnderOne(NULL, NULL, NULL, ImGuiFocusRequestFlags_RestoreFocusedChild);
// No window should be open at the beginning of the frame.
// But in order to allow the user to call NewFrame() multiple times without calling Render(), we are doing an explicit clear.
g.CurrentWindowStack.resize(0);
g.BeginPopupStack.resize(0);
g.ItemFlagsStack.resize(0);
- g.ItemFlagsStack.push_back(ImGuiItemFlags_None);
+ g.ItemFlagsStack.push_back(ImGuiItemFlags_AutoClosePopups); // Default flags
+ g.CurrentItemFlags = g.ItemFlagsStack.back();
g.GroupStack.resize(0);
// [DEBUG] Update debug features
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
UpdateDebugToolItemPicker();
UpdateDebugToolStackQueries();
+ UpdateDebugToolFlashStyleColor();
if (g.DebugLocateFrames > 0 && --g.DebugLocateFrames == 0)
+ {
g.DebugLocateId = 0;
+ g.DebugBreakInLocateId = false;
+ }
+ if (g.DebugLogAutoDisableFrames > 0 && --g.DebugLogAutoDisableFrames == 0)
+ {
+ DebugLog("(Debug Log: Auto-disabled some ImGuiDebugLogFlags after 2 frames)\n");
+ g.DebugLogFlags &= ~g.DebugLogAutoDisableFlags;
+ g.DebugLogAutoDisableFlags = ImGuiDebugLogFlags_None;
+ }
+#endif
// Create implicit/fallback window - which we will only render it if the user has added something to it.
// We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags.
@@ -4772,129 +5413,20 @@ void ImGui::NewFrame()
Begin("Debug##Default");
IM_ASSERT(g.CurrentWindow->IsFallbackWindow == true);
- CallContextHooks(&g, ImGuiContextHookType_NewFramePost);
-}
-
-// IMPORTANT: ###xxx suffixes must be same in ALL languages
-static const ImGuiLocEntry GLocalizationEntriesEnUS[] =
-{
- { ImGuiLocKey_TableSizeOne, "Size column to fit###SizeOne" },
- { ImGuiLocKey_TableSizeAllFit, "Size all columns to fit###SizeAll" },
- { ImGuiLocKey_TableSizeAllDefault, "Size all columns to default###SizeAll" },
- { ImGuiLocKey_TableResetOrder, "Reset order###ResetOrder" },
- { ImGuiLocKey_WindowingMainMenuBar, "(Main menu bar)" },
- { ImGuiLocKey_WindowingPopup, "(Popup)" },
- { ImGuiLocKey_WindowingUntitled, "(Untitled)" },
-};
-
-void ImGui::Initialize()
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(!g.Initialized && !g.SettingsLoaded);
-
- // Add .ini handle for ImGuiWindow and ImGuiTable types
- {
- ImGuiSettingsHandler ini_handler;
- ini_handler.TypeName = "Window";
- ini_handler.TypeHash = ImHashStr("Window");
- ini_handler.ClearAllFn = WindowSettingsHandler_ClearAll;
- ini_handler.ReadOpenFn = WindowSettingsHandler_ReadOpen;
- ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine;
- ini_handler.ApplyAllFn = WindowSettingsHandler_ApplyAll;
- ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll;
- AddSettingsHandler(&ini_handler);
- }
- TableSettingsAddSettingsHandler();
-
- // Setup default localization table
- LocalizeRegisterEntries(GLocalizationEntriesEnUS, IM_ARRAYSIZE(GLocalizationEntriesEnUS));
-
- // Create default viewport
- ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)();
- g.Viewports.push_back(viewport);
- g.TempBuffer.resize(1024 * 3 + 1, 0);
-
-#ifdef IMGUI_HAS_DOCK
-#endif
-
- g.Initialized = true;
-}
-
-// This function is merely here to free heap allocations.
-void ImGui::Shutdown()
-{
- // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
- ImGuiContext& g = *GImGui;
- if (g.IO.Fonts && g.FontAtlasOwnedByContext)
- {
- g.IO.Fonts->Locked = false;
- IM_DELETE(g.IO.Fonts);
- }
- g.IO.Fonts = NULL;
- g.DrawListSharedData.TempBuffer.clear();
-
- // Cleanup of other data are conditional on actually having initialized Dear ImGui.
- if (!g.Initialized)
- return;
-
- // Save settings (unless we haven't attempted to load them: CreateContext/DestroyContext without a call to NewFrame shouldn't save an empty file)
- if (g.SettingsLoaded && g.IO.IniFilename != NULL)
- SaveIniSettingsToDisk(g.IO.IniFilename);
-
- CallContextHooks(&g, ImGuiContextHookType_Shutdown);
-
- // Clear everything else
- g.Windows.clear_delete();
- g.WindowsFocusOrder.clear();
- g.WindowsTempSortBuffer.clear();
- g.CurrentWindow = NULL;
- g.CurrentWindowStack.clear();
- g.WindowsById.Clear();
- g.NavWindow = NULL;
- g.HoveredWindow = g.HoveredWindowUnderMovingWindow = NULL;
- g.ActiveIdWindow = g.ActiveIdPreviousFrameWindow = NULL;
- g.MovingWindow = NULL;
-
- g.KeysRoutingTable.Clear();
-
- g.ColorStack.clear();
- g.StyleVarStack.clear();
- g.FontStack.clear();
- g.OpenPopupStack.clear();
- g.BeginPopupStack.clear();
+ // Store stack sizes
+ g.ErrorCountCurrentFrame = 0;
+ ErrorRecoveryStoreState(&g.StackSizesInNewFrame);
- g.Viewports.clear_delete();
-
- g.TabBars.Clear();
- g.CurrentTabBarStack.clear();
- g.ShrinkWidthBuffer.clear();
-
- g.ClipperTempData.clear_destruct();
-
- g.Tables.Clear();
- g.TablesTempData.clear_destruct();
- g.DrawChannelsTempMergeBuffer.clear();
-
- g.ClipboardHandlerData.clear();
- g.MenusIdSubmittedThisFrame.clear();
- g.InputTextState.ClearFreeMemory();
-
- g.SettingsWindows.clear();
- g.SettingsHandlers.clear();
-
- if (g.LogFile)
- {
-#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
- if (g.LogFile != stdout)
+ // [DEBUG] When io.ConfigDebugBeginReturnValue is set, we make Begin()/BeginChild() return false at different level of the window-stack,
+ // allowing to validate correct Begin/End behavior in user code.
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ if (g.IO.ConfigDebugBeginReturnValueLoop)
+ g.DebugBeginReturnValueCullDepth = (g.DebugBeginReturnValueCullDepth == -1) ? 0 : ((g.DebugBeginReturnValueCullDepth + ((g.FrameCount % 4) == 0 ? 1 : 0)) % 10);
+ else
+ g.DebugBeginReturnValueCullDepth = -1;
#endif
- ImFileClose(g.LogFile);
- g.LogFile = NULL;
- }
- g.LogBuffer.clear();
- g.DebugLogBuf.clear();
- g.DebugLogIndex.clear();
- g.Initialized = false;
+ CallContextHooks(&g, ImGuiContextHookType_NewFramePost);
}
// FIXME: Add a more explicit sort order in the window structure.
@@ -4925,53 +5457,17 @@ static void AddWindowToSortBuffer(ImVector<ImGuiWindow*>* out_sorted_windows, Im
}
}
-static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* draw_list)
-{
- if (draw_list->CmdBuffer.Size == 0)
- return;
- if (draw_list->CmdBuffer.Size == 1 && draw_list->CmdBuffer[0].ElemCount == 0 && draw_list->CmdBuffer[0].UserCallback == NULL)
- return;
-
- // Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
- // May trigger for you if you are using PrimXXX functions incorrectly.
- IM_ASSERT(draw_list->VtxBuffer.Size == 0 || draw_list->_VtxWritePtr == draw_list->VtxBuffer.Data + draw_list->VtxBuffer.Size);
- IM_ASSERT(draw_list->IdxBuffer.Size == 0 || draw_list->_IdxWritePtr == draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size);
- if (!(draw_list->Flags & ImDrawListFlags_AllowVtxOffset))
- IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size);
-
- // Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = unsigned short = 2 bytes = 64K vertices per ImDrawList = per window)
- // If this assert triggers because you are drawing lots of stuff manually:
- // - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
- // Be mindful that the ImDrawList API doesn't filter vertices. Use the Metrics/Debugger window to inspect draw list contents.
- // - If you want large meshes with more than 64K vertices, you can either:
- // (A) Handle the ImDrawCmd::VtxOffset value in your renderer backend, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
- // Most example backends already support this from 1.71. Pre-1.71 backends won't.
- // Some graphics API such as GL ES 1/2 don't have a way to offset the starting vertex so it is not supported for them.
- // (B) Or handle 32-bit indices in your renderer backend, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h.
- // Most example backends already support this. For example, the OpenGL example code detect index size at compile-time:
- // glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
- // Your own engine or render API may use different parameters or function calls to specify index sizes.
- // 2 and 4 bytes indices are generally supported by most graphics API.
- // - If for some reason neither of those solutions works for you, a workaround is to call BeginChild()/EndChild() before reaching
- // the 64K limit to split your draw commands in multiple draw lists.
- if (sizeof(ImDrawIdx) == 2)
- IM_ASSERT(draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above");
-
- out_list->push_back(draw_list);
-}
-
static void AddWindowToDrawData(ImGuiWindow* window, int layer)
{
ImGuiContext& g = *GImGui;
ImGuiViewportP* viewport = g.Viewports[0];
g.IO.MetricsRenderWindows++;
- AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[layer], window->DrawList);
- for (int i = 0; i < window->DC.ChildWindows.Size; i++)
- {
- ImGuiWindow* child = window->DC.ChildWindows[i];
+ if (window->DrawList->_Splitter._Count > 1)
+ window->DrawList->ChannelsMerge(); // Merge if user forgot to merge back. Also required in Docking branch for ImGuiWindowFlags_DockNodeHost windows.
+ ImGui::AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[layer], window->DrawList);
+ for (ImGuiWindow* child : window->DC.ChildWindows)
if (IsWindowActiveAndVisible(child)) // Clipped children may have been marked not active
AddWindowToDrawData(child, layer);
- }
}
static inline int GetWindowDisplayLayer(ImGuiWindow* window)
@@ -4985,42 +5481,41 @@ static inline void AddRootWindowToDrawData(ImGuiWindow* window)
AddWindowToDrawData(window, GetWindowDisplayLayer(window));
}
-void ImDrawDataBuilder::FlattenIntoSingleLayer()
+static void FlattenDrawDataIntoSingleLayer(ImDrawDataBuilder* builder)
{
- int n = Layers[0].Size;
- int size = n;
- for (int i = 1; i < IM_ARRAYSIZE(Layers); i++)
- size += Layers[i].Size;
- Layers[0].resize(size);
- for (int layer_n = 1; layer_n < IM_ARRAYSIZE(Layers); layer_n++)
+ int n = builder->Layers[0]->Size;
+ int full_size = n;
+ for (int i = 1; i < IM_ARRAYSIZE(builder->Layers); i++)
+ full_size += builder->Layers[i]->Size;
+ builder->Layers[0]->resize(full_size);
+ for (int layer_n = 1; layer_n < IM_ARRAYSIZE(builder->Layers); layer_n++)
{
- ImVector<ImDrawList*>& layer = Layers[layer_n];
- if (layer.empty())
+ ImVector<ImDrawList*>* layer = builder->Layers[layer_n];
+ if (layer->empty())
continue;
- memcpy(&Layers[0][n], &layer[0], layer.Size * sizeof(ImDrawList*));
- n += layer.Size;
- layer.resize(0);
+ memcpy(builder->Layers[0]->Data + n, layer->Data, layer->Size * sizeof(ImDrawList*));
+ n += layer->Size;
+ layer->resize(0);
}
}
-static void SetupViewportDrawData(ImGuiViewportP* viewport, ImVector<ImDrawList*>* draw_lists)
+static void InitViewportDrawData(ImGuiViewportP* viewport)
{
ImGuiIO& io = ImGui::GetIO();
ImDrawData* draw_data = &viewport->DrawDataP;
+
+ viewport->DrawDataBuilder.Layers[0] = &draw_data->CmdLists;
+ viewport->DrawDataBuilder.Layers[1] = &viewport->DrawDataBuilder.LayerData1;
+ viewport->DrawDataBuilder.Layers[0]->resize(0);
+ viewport->DrawDataBuilder.Layers[1]->resize(0);
+
draw_data->Valid = true;
- draw_data->CmdLists = (draw_lists->Size > 0) ? draw_lists->Data : NULL;
- draw_data->CmdListsCount = draw_lists->Size;
+ draw_data->CmdListsCount = 0;
draw_data->TotalVtxCount = draw_data->TotalIdxCount = 0;
draw_data->DisplayPos = viewport->Pos;
draw_data->DisplaySize = viewport->Size;
draw_data->FramebufferScale = io.DisplayFramebufferScale;
- for (int n = 0; n < draw_lists->Size; n++)
- {
- ImDrawList* draw_list = draw_lists->Data[n];
- draw_list->_PopUnusedDrawCmd();
- draw_data->TotalVtxCount += draw_list->VtxBuffer.Size;
- draw_data->TotalIdxCount += draw_list->IdxBuffer.Size;
- }
+ draw_data->OwnerViewport = viewport;
}
// Push a clipping rectangle for both ImGui logic (hit-testing etc.) and low-level ImDrawList rendering.
@@ -5029,6 +5524,8 @@ static void SetupViewportDrawData(ImGuiViewportP* viewport, ImVector<ImDrawList*
// - If the code here changes, may need to update code of functions like NextColumn() and PushColumnClipRect():
// some frequently called functions which to modify both channels and clipping simultaneously tend to use the
// more specialized SetWindowClipRectBeforeSetChannel() to avoid extraneous updates of underlying ImDrawCmds.
+// - This is analoguous to PushFont()/PopFont() in the sense that are a mixing a global stack and a window stack,
+// which in the case of ClipRect is not so problematic but tends to be more restrictive for fonts.
void ImGui::PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -5059,14 +5556,14 @@ static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32
ImDrawList* draw_list = window->RootWindow->DrawList;
if (draw_list->CmdBuffer.Size == 0)
draw_list->AddDrawCmd();
- draw_list->PushClipRect(viewport_rect.Min - ImVec2(1, 1), viewport_rect.Max + ImVec2(1, 1), false); // Ensure ImDrawCmd are not merged
+ draw_list->PushClipRect(viewport_rect.Min - ImVec2(1, 1), viewport_rect.Max + ImVec2(1, 1), false); // FIXME: Need to stricty ensure ImDrawCmd are not merged (ElemCount==6 checks below will verify that)
draw_list->AddRectFilled(viewport_rect.Min, viewport_rect.Max, col);
ImDrawCmd cmd = draw_list->CmdBuffer.back();
IM_ASSERT(cmd.ElemCount == 6);
draw_list->CmdBuffer.pop_back();
draw_list->CmdBuffer.push_front(cmd);
- draw_list->PopClipRect();
draw_list->AddDrawCmd(); // We need to create a command as CmdBuffer.back().IdxOffset won't be correct if we append to same command.
+ draw_list->PopClipRect();
}
}
@@ -5102,11 +5599,11 @@ static void ImGui::RenderDimmedBackgrounds()
{
// Draw dimming behind modal or a begin stack child, whichever comes first in draw order.
ImGuiWindow* dim_behind_window = FindBottomMostVisibleWindowWithinBeginStack(modal_window);
- RenderDimmedBackgroundBehindWindow(dim_behind_window, GetColorU32(ImGuiCol_ModalWindowDimBg, g.DimBgRatio));
+ RenderDimmedBackgroundBehindWindow(dim_behind_window, GetColorU32(modal_window->DC.ModalDimBgColor, g.DimBgRatio));
}
else if (dim_bg_for_window_list)
{
- // Draw dimming behind CTRL+Tab target window
+ // Draw dimming behind CTRL+Tab target window and behind CTRL+Tab UI window
RenderDimmedBackgroundBehindWindow(g.NavWindowingTargetAnim, GetColorU32(ImGuiCol_NavWindowingDimBg, g.DimBgRatio));
// Draw border around CTRL+Tab target window
@@ -5138,11 +5635,20 @@ void ImGui::EndFrame()
CallContextHooks(&g, ImGuiContextHookType_EndFramePre);
+ // [EXPERIMENTAL] Recover from errors
+ if (g.IO.ConfigErrorRecovery)
+ ErrorRecoveryTryToRecoverState(&g.StackSizesInNewFrame);
ErrorCheckEndFrameSanityChecks();
+ ErrorCheckEndFrameFinalizeErrorTooltip();
// Notify Platform/OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME)
- if (g.IO.SetPlatformImeDataFn && memcmp(&g.PlatformImeData, &g.PlatformImeDataPrev, sizeof(ImGuiPlatformImeData)) != 0)
- g.IO.SetPlatformImeDataFn(GetMainViewport(), &g.PlatformImeData);
+ ImGuiPlatformImeData* ime_data = &g.PlatformImeData;
+ if (g.PlatformIO.Platform_SetImeDataFn != NULL && memcmp(ime_data, &g.PlatformImeDataPrev, sizeof(ImGuiPlatformImeData)) != 0)
+ {
+ IMGUI_DEBUG_LOG_IO("[io] Calling Platform_SetImeDataFn(): WantVisible: %d, InputPos (%.2f,%.2f)\n", ime_data->WantVisible, ime_data->InputPos.x, ime_data->InputPos.y);
+ ImGuiViewport* viewport = GetMainViewport();
+ g.PlatformIO.Platform_SetImeDataFn(&g, viewport, ime_data);
+ }
// Hide implicit/fallback "Debug" window if it hasn't been used
g.WithinFrameScopeWithImplicitWindow = false;
@@ -5157,13 +5663,17 @@ void ImGui::EndFrame()
if (g.DragDropActive)
{
bool is_delivered = g.DragDropPayload.Delivery;
- bool is_elapsed = (g.DragDropPayload.DataFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton));
+ bool is_elapsed = (g.DragDropSourceFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_PayloadAutoExpire) || g.DragDropMouseButton == -1 || !IsMouseDown(g.DragDropMouseButton));
if (is_delivered || is_elapsed)
ClearDragDrop();
}
- // Drag and Drop: Fallback for source tooltip. This is not ideal but better than nothing.
- if (g.DragDropActive && g.DragDropSourceFrameCount < g.FrameCount && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip))
+ // Drag and Drop: Fallback for missing source tooltip. This is not ideal but better than nothing.
+ // If you want to handle source item disappearing: instead of submitting your description tooltip
+ // in the BeginDragDropSource() block of the dragged item, you can submit them from a safe single spot
+ // (e.g. end of your item loop, or before EndFrame) by reading payload data.
+ // In the typical case, the contents of drag tooltip should be possible to infer solely from payload data.
+ if (g.DragDropActive && g.DragDropSourceFrameCount + 1 < g.FrameCount && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip))
{
g.DragDropWithinSource = true;
SetTooltip("...");
@@ -5181,9 +5691,8 @@ void ImGui::EndFrame()
// We cannot do that on FocusWindow() because children may not exist yet
g.WindowsTempSortBuffer.resize(0);
g.WindowsTempSortBuffer.reserve(g.Windows.Size);
- for (int i = 0; i != g.Windows.Size; i++)
+ for (ImGuiWindow* window : g.Windows)
{
- ImGuiWindow* window = g.Windows[i];
if (window->Active && (window->Flags & ImGuiWindowFlags_ChildWindow)) // if a child is active its parent will add it
continue;
AddWindowToSortBuffer(&g.WindowsTempSortBuffer, window);
@@ -5198,6 +5707,7 @@ void ImGui::EndFrame()
g.IO.Fonts->Locked = false;
// Clear Input data for next frame
+ g.IO.MousePosPrev = g.IO.MousePos;
g.IO.AppFocusLost = false;
g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f;
g.IO.InputQueueCharacters.resize(0);
@@ -5215,32 +5725,30 @@ void ImGui::Render()
if (g.FrameCountEnded != g.FrameCount)
EndFrame();
- const bool first_render_of_frame = (g.FrameCountRendered != g.FrameCount);
+ if (g.FrameCountRendered == g.FrameCount)
+ return;
g.FrameCountRendered = g.FrameCount;
- g.IO.MetricsRenderWindows = 0;
+ g.IO.MetricsRenderWindows = 0;
CallContextHooks(&g, ImGuiContextHookType_RenderPre);
// Add background ImDrawList (for each active viewport)
- for (int n = 0; n != g.Viewports.Size; n++)
+ for (ImGuiViewportP* viewport : g.Viewports)
{
- ImGuiViewportP* viewport = g.Viewports[n];
- viewport->DrawDataBuilder.Clear();
- if (viewport->DrawLists[0] != NULL)
- AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport));
+ InitViewportDrawData(viewport);
+ if (viewport->BgFgDrawLists[0] != NULL)
+ AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport));
}
// Draw modal/window whitening backgrounds
- if (first_render_of_frame)
- RenderDimmedBackgrounds();
+ RenderDimmedBackgrounds();
// Add ImDrawList to render
ImGuiWindow* windows_to_render_top_most[2];
windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
windows_to_render_top_most[1] = (g.NavWindowingTarget ? g.NavWindowingListWindow : NULL);
- for (int n = 0; n != g.Windows.Size; n++)
+ for (ImGuiWindow* window : g.Windows)
{
- ImGuiWindow* window = g.Windows[n];
IM_MSVC_WARNING_SUPPRESS(6011); // Static Analysis false positive "warning C6011: Dereferencing NULL pointer 'window'"
if (IsWindowActiveAndVisible(window) && (window->Flags & ImGuiWindowFlags_ChildWindow) == 0 && window != windows_to_render_top_most[0] && window != windows_to_render_top_most[1])
AddRootWindowToDrawData(window);
@@ -5250,22 +5758,25 @@ void ImGui::Render()
AddRootWindowToDrawData(windows_to_render_top_most[n]);
// Draw software mouse cursor if requested by io.MouseDrawCursor flag
- if (g.IO.MouseDrawCursor && first_render_of_frame && g.MouseCursor != ImGuiMouseCursor_None)
+ if (g.IO.MouseDrawCursor && g.MouseCursor != ImGuiMouseCursor_None)
RenderMouseCursor(g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48));
// Setup ImDrawData structures for end-user
g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = 0;
- for (int n = 0; n < g.Viewports.Size; n++)
+ for (ImGuiViewportP* viewport : g.Viewports)
{
- ImGuiViewportP* viewport = g.Viewports[n];
- viewport->DrawDataBuilder.FlattenIntoSingleLayer();
+ FlattenDrawDataIntoSingleLayer(&viewport->DrawDataBuilder);
// Add foreground ImDrawList (for each active viewport)
- if (viewport->DrawLists[1] != NULL)
- AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetForegroundDrawList(viewport));
+ if (viewport->BgFgDrawLists[1] != NULL)
+ AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetForegroundDrawList(viewport));
- SetupViewportDrawData(viewport, &viewport->DrawDataBuilder.Layers[0]);
+ // We call _PopUnusedDrawCmd() last thing, as RenderDimmedBackgrounds() rely on a valid command being there (especially in docking branch).
ImDrawData* draw_data = &viewport->DrawDataP;
+ IM_ASSERT(draw_data->CmdLists.Size == draw_data->CmdListsCount);
+ for (ImDrawList* draw_list : draw_data->CmdLists)
+ draw_list->_PopUnusedDrawCmd();
+
g.IO.MetricsRenderVertices += draw_data->TotalVtxCount;
g.IO.MetricsRenderIndices += draw_data->TotalIdxCount;
}
@@ -5296,42 +5807,40 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
// FIXME: Investigate using ceilf or e.g.
// - https://git.musl-libc.org/cgit/musl/tree/src/math/ceilf.c
// - https://embarkstudios.github.io/rust-gpu/api/src/libm/math/ceilf.rs.html
- text_size.x = IM_FLOOR(text_size.x + 0.99999f);
+ text_size.x = IM_TRUNC(text_size.x + 0.99999f);
return text_size;
}
// Find window given position, search front-to-back
-// FIXME: Note that we have an inconsequential lag here: OuterRectClipped is updated in Begin(), so windows moved programmatically
-// with SetWindowPos() and not SetNextWindowPos() will have that rectangle lagging by a frame at the time FindHoveredWindow() is
-// called, aka before the next Begin(). Moving window isn't affected.
-static void FindHoveredWindow()
+// - Typically write output back to g.HoveredWindow and g.HoveredWindowUnderMovingWindow.
+// - FIXME: Note that we have an inconsequential lag here: OuterRectClipped is updated in Begin(), so windows moved programmatically
+// with SetWindowPos() and not SetNextWindowPos() will have that rectangle lagging by a frame at the time FindHoveredWindow() is
+// called, aka before the next Begin(). Moving window isn't affected.
+// - The 'find_first_and_in_any_viewport = true' mode is only used by TestEngine. It is simpler to maintain here.
+void ImGui::FindHoveredWindowEx(const ImVec2& pos, bool find_first_and_in_any_viewport, ImGuiWindow** out_hovered_window, ImGuiWindow** out_hovered_window_under_moving_window)
{
ImGuiContext& g = *GImGui;
-
ImGuiWindow* hovered_window = NULL;
- ImGuiWindow* hovered_window_ignoring_moving_window = NULL;
- if (g.MovingWindow && !(g.MovingWindow->Flags & ImGuiWindowFlags_NoMouseInputs))
+ ImGuiWindow* hovered_window_under_moving_window = NULL;
+
+ if (find_first_and_in_any_viewport == false && g.MovingWindow && !(g.MovingWindow->Flags & ImGuiWindowFlags_NoMouseInputs))
hovered_window = g.MovingWindow;
ImVec2 padding_regular = g.Style.TouchExtraPadding;
- ImVec2 padding_for_resize = g.IO.ConfigWindowsResizeFromEdges ? g.WindowsHoverPadding : padding_regular;
+ ImVec2 padding_for_resize = ImMax(g.Style.TouchExtraPadding, ImVec2(g.Style.WindowBorderHoverPadding, g.Style.WindowBorderHoverPadding));
for (int i = g.Windows.Size - 1; i >= 0; i--)
{
ImGuiWindow* window = g.Windows[i];
IM_MSVC_WARNING_SUPPRESS(28182); // [Static Analyzer] Dereferencing NULL pointer.
- if (!window->Active || window->Hidden)
+ if (!window->WasActive || window->Hidden)
continue;
if (window->Flags & ImGuiWindowFlags_NoMouseInputs)
continue;
// Using the clipped AABB, a child window will typically be clipped by its parent (not always)
- ImRect bb(window->OuterRectClipped);
- if (window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize))
- bb.Expand(padding_regular);
- else
- bb.Expand(padding_for_resize);
- if (!bb.Contains(g.IO.MousePos))
+ ImVec2 hit_padding = (window->Flags & (ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize)) ? padding_regular : padding_for_resize;
+ if (!window->OuterRectClipped.ContainsWithPad(pos, hit_padding))
continue;
// Support for one rectangular hole in any given window
@@ -5340,21 +5849,30 @@ static void FindHoveredWindow()
{
ImVec2 hole_pos(window->Pos.x + (float)window->HitTestHoleOffset.x, window->Pos.y + (float)window->HitTestHoleOffset.y);
ImVec2 hole_size((float)window->HitTestHoleSize.x, (float)window->HitTestHoleSize.y);
- if (ImRect(hole_pos, hole_pos + hole_size).Contains(g.IO.MousePos))
+ if (ImRect(hole_pos, hole_pos + hole_size).Contains(pos))
continue;
}
- if (hovered_window == NULL)
+ if (find_first_and_in_any_viewport)
+ {
hovered_window = window;
- IM_MSVC_WARNING_SUPPRESS(28182); // [Static Analyzer] Dereferencing NULL pointer.
- if (hovered_window_ignoring_moving_window == NULL && (!g.MovingWindow || window->RootWindow != g.MovingWindow->RootWindow))
- hovered_window_ignoring_moving_window = window;
- if (hovered_window && hovered_window_ignoring_moving_window)
break;
+ }
+ else
+ {
+ if (hovered_window == NULL)
+ hovered_window = window;
+ IM_MSVC_WARNING_SUPPRESS(28182); // [Static Analyzer] Dereferencing NULL pointer.
+ if (hovered_window_under_moving_window == NULL && (!g.MovingWindow || window->RootWindow != g.MovingWindow->RootWindow))
+ hovered_window_under_moving_window = window;
+ if (hovered_window && hovered_window_under_moving_window)
+ break;
+ }
}
- g.HoveredWindow = hovered_window;
- g.HoveredWindowUnderMovingWindow = hovered_window_ignoring_moving_window;
+ *out_hovered_window = hovered_window;
+ if (out_hovered_window_under_moving_window != NULL)
+ *out_hovered_window_under_moving_window = hovered_window_under_moving_window;
}
bool ImGui::IsItemActive()
@@ -5379,22 +5897,20 @@ bool ImGui::IsItemDeactivated()
ImGuiContext& g = *GImGui;
if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasDeactivated)
return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Deactivated) != 0;
- return (g.ActiveIdPreviousFrame == g.LastItemData.ID && g.ActiveIdPreviousFrame != 0 && g.ActiveId != g.LastItemData.ID);
+ return (g.DeactivatedItemData.ID == g.LastItemData.ID && g.LastItemData.ID != 0 && g.DeactivatedItemData.ElapseFrame >= g.FrameCount);
}
bool ImGui::IsItemDeactivatedAfterEdit()
{
ImGuiContext& g = *GImGui;
- return IsItemDeactivated() && (g.ActiveIdPreviousFrameHasBeenEditedBefore || (g.ActiveId == 0 && g.ActiveIdHasBeenEditedBefore));
+ return IsItemDeactivated() && g.DeactivatedItemData.HasBeenEditedBefore;
}
-// == GetItemID() == GetFocusID()
+// == (GetItemID() == GetFocusID() && GetFocusID() != 0)
bool ImGui::IsItemFocused()
{
ImGuiContext& g = *GImGui;
- if (g.NavId != g.LastItemData.ID || g.NavId == 0)
- return false;
- return true;
+ return g.NavId == g.LastItemData.ID && g.NavId != 0;
}
// Important: this can be useful but it is NOT equivalent to the behavior of e.g.Button()!
@@ -5410,12 +5926,21 @@ bool ImGui::IsItemToggledOpen()
return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_ToggledOpen) ? true : false;
}
+// Call after a Selectable() or TreeNode() involved in multi-selection.
+// Useful if you need the per-item information before reaching EndMultiSelect(), e.g. for rendering purpose.
+// This is only meant to be called inside a BeginMultiSelect()/EndMultiSelect() block.
+// (Outside of multi-select, it would be misleading/ambiguous to report this signal, as widgets
+// return e.g. a pressed event and user code is in charge of altering selection in ways we cannot predict.)
bool ImGui::IsItemToggledSelection()
{
ImGuiContext& g = *GImGui;
+ IM_ASSERT(g.CurrentMultiSelect != NULL); // Can only be used inside a BeginMultiSelect()/EndMultiSelect()
return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_ToggledSelection) ? true : false;
}
+// IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app,
+// you should not use this function! Use the 'io.WantCaptureMouse' boolean for that!
+// Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details.
bool ImGui::IsAnyItemHovered()
{
ImGuiContext& g = *GImGui;
@@ -5431,7 +5956,7 @@ bool ImGui::IsAnyItemActive()
bool ImGui::IsAnyItemFocused()
{
ImGuiContext& g = *GImGui;
- return g.NavId != 0 && !g.NavDisableHighlight;
+ return g.NavId != 0 && g.NavCursorVisible;
}
bool ImGui::IsItemVisible()
@@ -5446,19 +5971,31 @@ bool ImGui::IsItemEdited()
return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Edited) != 0;
}
+// Allow next item to be overlapped by subsequent items.
+// This works by requiring HoveredId to match for two subsequent frames,
+// so if a following items overwrite it our interactions will naturally be disabled.
+void ImGui::SetNextItemAllowOverlap()
+{
+ ImGuiContext& g = *GImGui;
+ g.NextItemData.ItemFlags |= ImGuiItemFlags_AllowOverlap;
+}
+
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
// Allow last item to be overlapped by a subsequent item. Both may be activated during the same frame before the later one takes priority.
-// FIXME: Although this is exposed, its interaction and ideal idiom with using ImGuiButtonFlags_AllowItemOverlap flag are extremely confusing, need rework.
+// FIXME-LEGACY: Use SetNextItemAllowOverlap() *before* your item instead.
void ImGui::SetItemAllowOverlap()
{
ImGuiContext& g = *GImGui;
ImGuiID id = g.LastItemData.ID;
if (g.HoveredId == id)
g.HoveredIdAllowOverlap = true;
- if (g.ActiveId == id)
+ if (g.ActiveId == id) // Before we made this obsolete, most calls to SetItemAllowOverlap() used to avoid this path by testing g.ActiveId != id.
g.ActiveIdAllowOverlap = true;
}
+#endif
-// FIXME: It might be undesirable that this will likely disable KeyOwner-aware shortcuts systems. Consider a more fine-tuned version for the two users of this function.
+// This is a shortcut for not taking ownership of 100+ keys, frequently used by drag operations.
+// FIXME: It might be undesirable that this will likely disable KeyOwner-aware shortcuts systems. Consider a more fine-tuned version if needed?
void ImGui::SetActiveIdUsingAllKeyboardKeys()
{
ImGuiContext& g = *GImGui;
@@ -5468,6 +6005,12 @@ void ImGui::SetActiveIdUsingAllKeyboardKeys()
NavMoveRequestCancel();
}
+ImGuiID ImGui::GetItemID()
+{
+ ImGuiContext& g = *GImGui;
+ return g.LastItemData.ID;
+}
+
ImVec2 ImGui::GetItemRectMin()
{
ImGuiContext& g = *GImGui;
@@ -5486,40 +6029,127 @@ ImVec2 ImGui::GetItemRectSize()
return g.LastItemData.Rect.GetSize();
}
-bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags)
+// Prior to v1.90 2023/10/16, the BeginChild() function took a 'bool border = false' parameter instead of 'ImGuiChildFlags child_flags = 0'.
+// ImGuiChildFlags_Borders is defined as always == 1 in order to allow old code passing 'true'. Read comments in imgui.h for details!
+bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags)
+{
+ ImGuiID id = GetCurrentWindow()->GetID(str_id);
+ return BeginChildEx(str_id, id, size_arg, child_flags, window_flags);
+}
+
+bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags)
+{
+ return BeginChildEx(NULL, id, size_arg, child_flags, window_flags);
+}
+
+bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* parent_window = g.CurrentWindow;
+ IM_ASSERT(id != 0);
- flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_ChildWindow;
- flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag
-
- // Size
- const ImVec2 content_avail = GetContentRegionAvail();
- ImVec2 size = ImFloor(size_arg);
- const int auto_fit_axises = ((size.x == 0.0f) ? (1 << ImGuiAxis_X) : 0x00) | ((size.y == 0.0f) ? (1 << ImGuiAxis_Y) : 0x00);
- if (size.x <= 0.0f)
- size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too many issues)
- if (size.y <= 0.0f)
- size.y = ImMax(content_avail.y + size.y, 4.0f);
+ // Sanity check as it is likely that some user will accidentally pass ImGuiWindowFlags into the ImGuiChildFlags argument.
+ const ImGuiChildFlags ImGuiChildFlags_SupportedMask_ = ImGuiChildFlags_Borders | ImGuiChildFlags_AlwaysUseWindowPadding | ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY | ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize | ImGuiChildFlags_FrameStyle | ImGuiChildFlags_NavFlattened;
+ IM_UNUSED(ImGuiChildFlags_SupportedMask_);
+ IM_ASSERT((child_flags & ~ImGuiChildFlags_SupportedMask_) == 0 && "Illegal ImGuiChildFlags value. Did you pass ImGuiWindowFlags values instead of ImGuiChildFlags?");
+ IM_ASSERT((window_flags & ImGuiWindowFlags_AlwaysAutoResize) == 0 && "Cannot specify ImGuiWindowFlags_AlwaysAutoResize for BeginChild(). Use ImGuiChildFlags_AlwaysAutoResize!");
+ if (child_flags & ImGuiChildFlags_AlwaysAutoResize)
+ {
+ IM_ASSERT((child_flags & (ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY)) == 0 && "Cannot use ImGuiChildFlags_ResizeX or ImGuiChildFlags_ResizeY with ImGuiChildFlags_AlwaysAutoResize!");
+ IM_ASSERT((child_flags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY)) != 0 && "Must use ImGuiChildFlags_AutoResizeX or ImGuiChildFlags_AutoResizeY with ImGuiChildFlags_AlwaysAutoResize!");
+ }
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ if (window_flags & ImGuiWindowFlags_AlwaysUseWindowPadding)
+ child_flags |= ImGuiChildFlags_AlwaysUseWindowPadding;
+ if (window_flags & ImGuiWindowFlags_NavFlattened)
+ child_flags |= ImGuiChildFlags_NavFlattened;
+#endif
+ if (child_flags & ImGuiChildFlags_AutoResizeX)
+ child_flags &= ~ImGuiChildFlags_ResizeX;
+ if (child_flags & ImGuiChildFlags_AutoResizeY)
+ child_flags &= ~ImGuiChildFlags_ResizeY;
+
+ // Set window flags
+ window_flags |= ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_NoTitleBar;
+ window_flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag
+ if (child_flags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize))
+ window_flags |= ImGuiWindowFlags_AlwaysAutoResize;
+ if ((child_flags & (ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY)) == 0)
+ window_flags |= ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings;
+
+ // Special framed style
+ if (child_flags & ImGuiChildFlags_FrameStyle)
+ {
+ PushStyleColor(ImGuiCol_ChildBg, g.Style.Colors[ImGuiCol_FrameBg]);
+ PushStyleVar(ImGuiStyleVar_ChildRounding, g.Style.FrameRounding);
+ PushStyleVar(ImGuiStyleVar_ChildBorderSize, g.Style.FrameBorderSize);
+ PushStyleVar(ImGuiStyleVar_WindowPadding, g.Style.FramePadding);
+ child_flags |= ImGuiChildFlags_Borders | ImGuiChildFlags_AlwaysUseWindowPadding;
+ window_flags |= ImGuiWindowFlags_NoMove;
+ }
+
+ // Forward size
+ // Important: Begin() has special processing to switch condition to ImGuiCond_FirstUseEver for a given axis when ImGuiChildFlags_ResizeXXX is set.
+ // (the alternative would to store conditional flags per axis, which is possible but more code)
+ const ImVec2 size_avail = GetContentRegionAvail();
+ const ImVec2 size_default((child_flags & ImGuiChildFlags_AutoResizeX) ? 0.0f : size_avail.x, (child_flags & ImGuiChildFlags_AutoResizeY) ? 0.0f : size_avail.y);
+ ImVec2 size = CalcItemSize(size_arg, size_default.x, size_default.y);
+
+ // A SetNextWindowSize() call always has priority (#8020)
+ // (since the code in Begin() never supported SizeVal==0.0f aka auto-resize via SetNextWindowSize() call, we don't support it here for now)
+ // FIXME: We only support ImGuiCond_Always in this path. Supporting other paths would requires to obtain window pointer.
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) != 0 && (g.NextWindowData.SizeCond & ImGuiCond_Always) != 0)
+ {
+ if (g.NextWindowData.SizeVal.x > 0.0f)
+ {
+ size.x = g.NextWindowData.SizeVal.x;
+ child_flags &= ~ImGuiChildFlags_ResizeX;
+ }
+ if (g.NextWindowData.SizeVal.y > 0.0f)
+ {
+ size.y = g.NextWindowData.SizeVal.y;
+ child_flags &= ~ImGuiChildFlags_ResizeY;
+ }
+ }
SetNextWindowSize(size);
+ // Forward child flags (we allow prior settings to merge but it'll only work for adding flags)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasChildFlags)
+ g.NextWindowData.ChildFlags |= child_flags;
+ else
+ g.NextWindowData.ChildFlags = child_flags;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasChildFlags;
+
// Build up name. If you need to append to a same child from multiple location in the ID stack, use BeginChild(ImGuiID id) with a stable value.
+ // FIXME: 2023/11/14: commented out shorted version. We had an issue with multiple ### in child window path names, which the trailing hash helped workaround.
+ // e.g. "ParentName###ParentIdentifier/ChildName###ChildIdentifier" would get hashed incorrectly by ImHashStr(), trailing _%08X somehow fixes it.
const char* temp_window_name;
+ /*if (name && parent_window->IDStack.back() == parent_window->ID)
+ ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%s", parent_window->Name, name); // May omit ID if in root of ID stack
+ else*/
if (name)
ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%s_%08X", parent_window->Name, name, id);
else
ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%08X", parent_window->Name, id);
+ // Set style
const float backup_border_size = g.Style.ChildBorderSize;
- if (!border)
+ if ((child_flags & ImGuiChildFlags_Borders) == 0)
g.Style.ChildBorderSize = 0.0f;
- bool ret = Begin(temp_window_name, NULL, flags);
+
+ // Begin into window
+ const bool ret = Begin(temp_window_name, NULL, window_flags);
+
+ // Restore style
g.Style.ChildBorderSize = backup_border_size;
+ if (child_flags & ImGuiChildFlags_FrameStyle)
+ {
+ PopStyleVar(3);
+ PopStyleColor();
+ }
ImGuiWindow* child_window = g.CurrentWindow;
child_window->ChildId = id;
- child_window->AutoFitChildAxises = (ImS8)auto_fit_axises;
// Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually.
// While this is not really documented/defined, it seems that the expected thing to do.
@@ -5527,92 +6157,69 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
parent_window->DC.CursorPos = child_window->Pos;
// Process navigation-in immediately so NavInit can run on first frame
- if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavHasScroll))
+ // Can enter a child if (A) it has navigable items or (B) it can be scrolled.
+ const ImGuiID temp_id_for_activation = ImHashStr("##Child", 0, id);
+ if (g.ActiveId == temp_id_for_activation)
+ ClearActiveID();
+ if (g.NavActivateId == id && !(child_flags & ImGuiChildFlags_NavFlattened) && (child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavWindowHasScrollY))
{
FocusWindow(child_window);
NavInitWindow(child_window, false);
- SetActiveID(id + 1, child_window); // Steal ActiveId with another arbitrary id so that key-press won't activate child item
- g.ActiveIdSource = ImGuiInputSource_Nav;
+ SetActiveID(temp_id_for_activation, child_window); // Steal ActiveId with another arbitrary id so that key-press won't activate child item
+ g.ActiveIdSource = g.NavInputSource;
}
return ret;
}
-bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
-{
- ImGuiWindow* window = GetCurrentWindow();
- return BeginChildEx(str_id, window->GetID(str_id), size_arg, border, extra_flags);
-}
-
-bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
-{
- IM_ASSERT(id != 0);
- return BeginChildEx(NULL, id, size_arg, border, extra_flags);
-}
-
void ImGui::EndChild()
{
ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
+ ImGuiWindow* child_window = g.CurrentWindow;
- IM_ASSERT(g.WithinEndChild == false);
- IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() calls
+ const ImGuiID backup_within_end_child_id = g.WithinEndChildID;
+ IM_ASSERT(child_window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() calls
- g.WithinEndChild = true;
- if (window->BeginCount > 1)
- {
- End();
- }
- else
+ g.WithinEndChildID = child_window->ID;
+ ImVec2 child_size = child_window->Size;
+ End();
+ if (child_window->BeginCount == 1)
{
- ImVec2 sz = window->Size;
- if (window->AutoFitChildAxises & (1 << ImGuiAxis_X)) // Arbitrary minimum zero-ish child size of 4.0f causes less trouble than a 0.0f
- sz.x = ImMax(4.0f, sz.x);
- if (window->AutoFitChildAxises & (1 << ImGuiAxis_Y))
- sz.y = ImMax(4.0f, sz.y);
- End();
-
ImGuiWindow* parent_window = g.CurrentWindow;
- ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz);
- ItemSize(sz);
- if ((window->DC.NavLayersActiveMask != 0 || window->DC.NavHasScroll) && !(window->Flags & ImGuiWindowFlags_NavFlattened))
+ ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + child_size);
+ ItemSize(child_size);
+ const bool nav_flattened = (child_window->ChildFlags & ImGuiChildFlags_NavFlattened) != 0;
+ if ((child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavWindowHasScrollY) && !nav_flattened)
{
- ItemAdd(bb, window->ChildId);
- RenderNavHighlight(bb, window->ChildId);
+ ItemAdd(bb, child_window->ChildId);
+ RenderNavCursor(bb, child_window->ChildId);
// When browsing a window that has no activable items (scroll only) we keep a highlight on the child (pass g.NavId to trick into always displaying)
- if (window->DC.NavLayersActiveMask == 0 && window == g.NavWindow)
- RenderNavHighlight(ImRect(bb.Min - ImVec2(2, 2), bb.Max + ImVec2(2, 2)), g.NavId, ImGuiNavHighlightFlags_TypeThin);
+ if (child_window->DC.NavLayersActiveMask == 0 && child_window == g.NavWindow)
+ RenderNavCursor(ImRect(bb.Min - ImVec2(2, 2), bb.Max + ImVec2(2, 2)), g.NavId, ImGuiNavRenderCursorFlags_Compact);
}
else
{
// Not navigable into
- ItemAdd(bb, 0);
+ // - This is a bit of a fringe use case, mostly useful for undecorated, non-scrolling contents childs, or empty childs.
+ // - We could later decide to not apply this path if ImGuiChildFlags_FrameStyle or ImGuiChildFlags_Borders is set.
+ ItemAdd(bb, child_window->ChildId, NULL, ImGuiItemFlags_NoNav);
+
+ // But when flattened we directly reach items, adjust active layer mask accordingly
+ if (nav_flattened)
+ parent_window->DC.NavLayersActiveMaskNext |= child_window->DC.NavLayersActiveMaskNext;
}
- if (g.HoveredWindow == window)
+ if (g.HoveredWindow == child_window)
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow;
+ child_window->DC.ChildItemStatusFlags = g.LastItemData.StatusFlags;
+ //SetLastItemDataForChildWindowItem(child_window, child_window->Rect()); // Not needed, effectively done by ItemAdd()
+ }
+ else
+ {
+ SetLastItemDataForChildWindowItem(child_window, child_window->Rect());
}
- g.WithinEndChild = false;
- g.LogLinePosY = -FLT_MAX; // To enforce a carriage return
-}
-
-// Helper to create a child window / scrolling region that looks like a normal widget frame.
-bool ImGui::BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags extra_flags)
-{
- ImGuiContext& g = *GImGui;
- const ImGuiStyle& style = g.Style;
- PushStyleColor(ImGuiCol_ChildBg, style.Colors[ImGuiCol_FrameBg]);
- PushStyleVar(ImGuiStyleVar_ChildRounding, style.FrameRounding);
- PushStyleVar(ImGuiStyleVar_ChildBorderSize, style.FrameBorderSize);
- PushStyleVar(ImGuiStyleVar_WindowPadding, style.FramePadding);
- bool ret = BeginChild(id, size, true, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysUseWindowPadding | extra_flags);
- PopStyleVar(3);
- PopStyleColor();
- return ret;
-}
-void ImGui::EndChildFrame()
-{
- EndChild();
+ g.WithinEndChildID = backup_within_end_child_id;
+ g.LogLinePosY = -FLT_MAX; // To enforce a carriage return
}
static void SetWindowConditionAllowFlags(ImGuiWindow* window, ImGuiCond flags, bool enabled)
@@ -5636,61 +6243,29 @@ ImGuiWindow* ImGui::FindWindowByName(const char* name)
static void ApplyWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* settings)
{
- window->Pos = ImFloor(ImVec2(settings->Pos.x, settings->Pos.y));
+ window->Pos = ImTrunc(ImVec2(settings->Pos.x, settings->Pos.y));
if (settings->Size.x > 0 && settings->Size.y > 0)
- window->Size = window->SizeFull = ImFloor(ImVec2(settings->Size.x, settings->Size.y));
+ window->Size = window->SizeFull = ImTrunc(ImVec2(settings->Size.x, settings->Size.y));
window->Collapsed = settings->Collapsed;
}
-static void UpdateWindowInFocusOrderList(ImGuiWindow* window, bool just_created, ImGuiWindowFlags new_flags)
-{
- ImGuiContext& g = *GImGui;
-
- const bool new_is_explicit_child = (new_flags & ImGuiWindowFlags_ChildWindow) != 0 && ((new_flags & ImGuiWindowFlags_Popup) == 0 || (new_flags & ImGuiWindowFlags_ChildMenu) != 0);
- const bool child_flag_changed = new_is_explicit_child != window->IsExplicitChild;
- if ((just_created || child_flag_changed) && !new_is_explicit_child)
- {
- IM_ASSERT(!g.WindowsFocusOrder.contains(window));
- g.WindowsFocusOrder.push_back(window);
- window->FocusOrder = (short)(g.WindowsFocusOrder.Size - 1);
- }
- else if (!just_created && child_flag_changed && new_is_explicit_child)
- {
- IM_ASSERT(g.WindowsFocusOrder[window->FocusOrder] == window);
- for (int n = window->FocusOrder + 1; n < g.WindowsFocusOrder.Size; n++)
- g.WindowsFocusOrder[n]->FocusOrder--;
- g.WindowsFocusOrder.erase(g.WindowsFocusOrder.Data + window->FocusOrder);
- window->FocusOrder = -1;
- }
- window->IsExplicitChild = new_is_explicit_child;
-}
-
-static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
+static void InitOrLoadWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* settings)
{
- ImGuiContext& g = *GImGui;
- //IMGUI_DEBUG_LOG("CreateNewWindow '%s', flags = 0x%08X\n", name, flags);
-
- // Create window the first time
- ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name);
- window->Flags = flags;
- g.WindowsById.SetVoidPtr(window->ID, window);
-
- // Default/arbitrary window position. Use SetNextWindowPos() with the appropriate condition flag to change the initial position of a window.
+ // Initial window state with e.g. default/arbitrary window position
+ // Use SetNextWindowPos() with the appropriate condition flag to change the initial position of a window.
const ImGuiViewport* main_viewport = ImGui::GetMainViewport();
window->Pos = main_viewport->Pos + ImVec2(60, 60);
+ window->Size = window->SizeFull = ImVec2(0, 0);
+ window->SetWindowPosAllowFlags = window->SetWindowSizeAllowFlags = window->SetWindowCollapsedAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing;
- // User can disable loading and saving of settings. Tooltip and child windows also don't store settings.
- if (!(flags & ImGuiWindowFlags_NoSavedSettings))
- if (ImGuiWindowSettings* settings = ImGui::FindWindowSettings(window->ID))
- {
- // Retrieve settings from .ini file
- window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
- SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false);
- ApplyWindowSettings(window, settings);
- }
+ if (settings != NULL)
+ {
+ SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false);
+ ApplyWindowSettings(window, settings);
+ }
window->DC.CursorStartPos = window->DC.CursorMaxPos = window->DC.IdealMaxPos = window->Pos; // So first call to CalcWindowContentSizes() doesn't return crazy values
- if ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0)
+ if ((window->Flags & ImGuiWindowFlags_AlwaysAutoResize) != 0)
{
window->AutoFitFramesX = window->AutoFitFramesY = 2;
window->AutoFitOnlyGrows = false;
@@ -5703,6 +6278,23 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
window->AutoFitFramesY = 2;
window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0);
}
+}
+
+static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
+{
+ // Create window the first time
+ //IMGUI_DEBUG_LOG("CreateNewWindow '%s', flags = 0x%08X\n", name, flags);
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name);
+ window->Flags = flags;
+ g.WindowsById.SetVoidPtr(window->ID, window);
+
+ ImGuiWindowSettings* settings = NULL;
+ if (!(flags & ImGuiWindowFlags_NoSavedSettings))
+ if ((settings = ImGui::FindWindowSettingsByWindow(window)) != 0)
+ window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
+
+ InitOrLoadWindowSettings(window, settings);
if (flags & ImGuiWindowFlags_NoBringToFrontOnFocus)
g.Windows.push_front(window); // Quite slow but rare and only once
@@ -5712,13 +6304,37 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
return window;
}
+static inline ImVec2 CalcWindowMinSize(ImGuiWindow* window)
+{
+ // We give windows non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups)
+ // FIXME: Essentially we want to restrict manual resizing to WindowMinSize+Decoration, and allow api resizing to be smaller.
+ // Perhaps should tend further a neater test for this.
+ ImGuiContext& g = *GImGui;
+ ImVec2 size_min;
+ if ((window->Flags & ImGuiWindowFlags_ChildWindow) && !(window->Flags & ImGuiWindowFlags_Popup))
+ {
+ size_min.x = (window->ChildFlags & ImGuiChildFlags_ResizeX) ? g.Style.WindowMinSize.x : 4.0f;
+ size_min.y = (window->ChildFlags & ImGuiChildFlags_ResizeY) ? g.Style.WindowMinSize.y : 4.0f;
+ }
+ else
+ {
+ size_min.x = ((window->Flags & ImGuiWindowFlags_AlwaysAutoResize) == 0) ? g.Style.WindowMinSize.x : 4.0f;
+ size_min.y = ((window->Flags & ImGuiWindowFlags_AlwaysAutoResize) == 0) ? g.Style.WindowMinSize.y : 4.0f;
+ }
+
+ // Reduce artifacts with very small windows
+ ImGuiWindow* window_for_height = window;
+ size_min.y = ImMax(size_min.y, window_for_height->TitleBarHeight + window_for_height->MenuBarHeight + ImMax(0.0f, g.Style.WindowRounding - 1.0f));
+ return size_min;
+}
+
static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, const ImVec2& size_desired)
{
ImGuiContext& g = *GImGui;
ImVec2 new_size = size_desired;
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSizeConstraint)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSizeConstraint)
{
- // Using -1,-1 on either X/Y axis to preserve the current size.
+ // See comments in SetNextWindowSizeConstraints() for details about setting size_min an size_max.
ImRect cr = g.NextWindowData.SizeConstraintRect;
new_size.x = (cr.Min.x >= 0 && cr.Max.x >= 0) ? ImClamp(new_size.x, cr.Min.x, cr.Max.x) : window->SizeFull.x;
new_size.y = (cr.Min.y >= 0 && cr.Max.y >= 0) ? ImClamp(new_size.y, cr.Min.y, cr.Max.y) : window->SizeFull.y;
@@ -5732,19 +6348,13 @@ static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, const ImVec2& s
g.NextWindowData.SizeCallback(&data);
new_size = data.DesiredSize;
}
- new_size.x = IM_FLOOR(new_size.x);
- new_size.y = IM_FLOOR(new_size.y);
+ new_size.x = IM_TRUNC(new_size.x);
+ new_size.y = IM_TRUNC(new_size.y);
}
// Minimum size
- if (!(window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_AlwaysAutoResize)))
- {
- ImGuiWindow* window_for_height = window;
- const float decoration_up_height = window_for_height->TitleBarHeight() + window_for_height->MenuBarHeight();
- new_size = ImMax(new_size, g.Style.WindowMinSize);
- new_size.y = ImMax(new_size.y, decoration_up_height + ImMax(0.0f, g.Style.WindowRounding - 1.0f)); // Reduce artifacts with very small windows
- }
- return new_size;
+ ImVec2 size_min = CalcWindowMinSize(window);
+ return ImMax(new_size, size_min);
}
static void CalcWindowContentSizes(ImGuiWindow* window, ImVec2* content_size_current, ImVec2* content_size_ideal)
@@ -5761,19 +6371,20 @@ static void CalcWindowContentSizes(ImGuiWindow* window, ImVec2* content_size_cur
return;
}
- content_size_current->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_FLOOR(window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x);
- content_size_current->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_FLOOR(window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y);
- content_size_ideal->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_FLOOR(ImMax(window->DC.CursorMaxPos.x, window->DC.IdealMaxPos.x) - window->DC.CursorStartPos.x);
- content_size_ideal->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_FLOOR(ImMax(window->DC.CursorMaxPos.y, window->DC.IdealMaxPos.y) - window->DC.CursorStartPos.y);
+ content_size_current->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_TRUNC(window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x);
+ content_size_current->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_TRUNC(window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y);
+ content_size_ideal->x = (window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : IM_TRUNC(ImMax(window->DC.CursorMaxPos.x, window->DC.IdealMaxPos.x) - window->DC.CursorStartPos.x);
+ content_size_ideal->y = (window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : IM_TRUNC(ImMax(window->DC.CursorMaxPos.y, window->DC.IdealMaxPos.y) - window->DC.CursorStartPos.y);
}
static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_contents)
{
ImGuiContext& g = *GImGui;
ImGuiStyle& style = g.Style;
- const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight();
+ const float decoration_w_without_scrollbars = window->DecoOuterSizeX1 + window->DecoOuterSizeX2 - window->ScrollbarSizes.x;
+ const float decoration_h_without_scrollbars = window->DecoOuterSizeY1 + window->DecoOuterSizeY2 - window->ScrollbarSizes.y;
ImVec2 size_pad = window->WindowPadding * 2.0f;
- ImVec2 size_desired = size_contents + size_pad + ImVec2(0.0f, decoration_up_height);
+ ImVec2 size_desired = size_contents + size_pad + ImVec2(decoration_w_without_scrollbars, decoration_h_without_scrollbars);
if (window->Flags & ImGuiWindowFlags_Tooltip)
{
// Tooltip always resize
@@ -5782,20 +6393,23 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont
else
{
// Maximum window size is determined by the viewport size or monitor size
- const bool is_popup = (window->Flags & ImGuiWindowFlags_Popup) != 0;
- const bool is_menu = (window->Flags & ImGuiWindowFlags_ChildMenu) != 0;
- ImVec2 size_min = style.WindowMinSize;
- if (is_popup || is_menu) // Popups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups)
- size_min = ImMin(size_min, ImVec2(4.0f, 4.0f));
-
- ImVec2 avail_size = ImGui::GetMainViewport()->WorkSize;
- ImVec2 size_auto_fit = ImClamp(size_desired, size_min, ImMax(size_min, avail_size - style.DisplaySafeAreaPadding * 2.0f));
+ ImVec2 size_min = CalcWindowMinSize(window);
+ ImVec2 size_max = ((window->Flags & ImGuiWindowFlags_ChildWindow) && !(window->Flags & ImGuiWindowFlags_Popup)) ? ImVec2(FLT_MAX, FLT_MAX) : ImGui::GetMainViewport()->WorkSize - style.DisplaySafeAreaPadding * 2.0f;
+ ImVec2 size_auto_fit = ImClamp(size_desired, size_min, size_max);
+
+ // FIXME: CalcWindowAutoFitSize() doesn't take into account that only one axis may be auto-fit when calculating scrollbars,
+ // we may need to compute/store three variants of size_auto_fit, for x/y/xy.
+ // Here we implement a workaround for child windows only, but a full solution would apply to normal windows as well:
+ if ((window->ChildFlags & ImGuiChildFlags_ResizeX) && !(window->ChildFlags & ImGuiChildFlags_ResizeY))
+ size_auto_fit.y = window->SizeFull.y;
+ else if (!(window->ChildFlags & ImGuiChildFlags_ResizeX) && (window->ChildFlags & ImGuiChildFlags_ResizeY))
+ size_auto_fit.x = window->SizeFull.x;
// When the window cannot fit all contents (either because of constraints, either because screen is too small),
// we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than ViewportSize-WindowPadding.
ImVec2 size_auto_fit_after_constraint = CalcWindowSizeAfterConstraint(window, size_auto_fit);
- bool will_have_scrollbar_x = (size_auto_fit_after_constraint.x - size_pad.x - 0.0f < size_contents.x && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (window->Flags & ImGuiWindowFlags_HorizontalScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar);
- bool will_have_scrollbar_y = (size_auto_fit_after_constraint.y - size_pad.y - decoration_up_height < size_contents.y && !(window->Flags & ImGuiWindowFlags_NoScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysVerticalScrollbar);
+ bool will_have_scrollbar_x = (size_auto_fit_after_constraint.x - size_pad.x - decoration_w_without_scrollbars < size_contents.x && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (window->Flags & ImGuiWindowFlags_HorizontalScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar);
+ bool will_have_scrollbar_y = (size_auto_fit_after_constraint.y - size_pad.y - decoration_h_without_scrollbars < size_contents.y && !(window->Flags & ImGuiWindowFlags_NoScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysVerticalScrollbar);
if (will_have_scrollbar_x)
size_auto_fit.y += style.ScrollbarSize;
if (will_have_scrollbar_y)
@@ -5837,7 +6451,7 @@ static void CalcResizePosSizeFromAnyCorner(ImGuiWindow* window, const ImVec2& co
*out_size = size_constrained;
}
-// Data for resizing from corner
+// Data for resizing from resize grip / corner
struct ImGuiResizeGripDef
{
ImVec2 CornerPosN;
@@ -5855,9 +6469,9 @@ static const ImGuiResizeGripDef resize_grip_def[4] =
// Data for resizing from borders
struct ImGuiResizeBorderDef
{
- ImVec2 InnerDir;
- ImVec2 SegmentN1, SegmentN2;
- float OuterAngle;
+ ImVec2 InnerDir; // Normal toward inside
+ ImVec2 SegmentN1, SegmentN2; // End positions, normalized (0,0: upper left)
+ float OuterAngle; // Angle toward outside
};
static const ImGuiResizeBorderDef resize_border_def[4] =
{
@@ -5903,7 +6517,7 @@ ImGuiID ImGui::GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir)
// Handle resize for: Resize Grips, Borders, Gamepad
// Return true when using auto-fit (double-click on resize grip)
-static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect)
+static int ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_hovered, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect)
{
ImGuiContext& g = *GImGui;
ImGuiWindowFlags flags = window->Flags;
@@ -5913,11 +6527,15 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
if (window->WasActive == false) // Early out to avoid running this code for e.g. a hidden implicit/fallback Debug window.
return false;
- bool ret_auto_fit = false;
- const int resize_border_count = g.IO.ConfigWindowsResizeFromEdges ? 4 : 0;
- const float grip_draw_size = IM_FLOOR(ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f));
- const float grip_hover_inner_size = IM_FLOOR(grip_draw_size * 0.75f);
- const float grip_hover_outer_size = g.IO.ConfigWindowsResizeFromEdges ? WINDOWS_HOVER_PADDING : 0.0f;
+ int ret_auto_fit_mask = 0x00;
+ const float grip_draw_size = IM_TRUNC(ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f));
+ const float grip_hover_inner_size = (resize_grip_count > 0) ? IM_TRUNC(grip_draw_size * 0.75f) : 0.0f;
+ const float grip_hover_outer_size = g.WindowsBorderHoverPadding;
+
+ ImRect clamp_rect = visibility_rect;
+ const bool window_move_from_title_bar = g.IO.ConfigWindowsMoveFromTitleBarOnly && !(window->Flags & ImGuiWindowFlags_NoTitleBar);
+ if (window_move_from_title_bar)
+ clamp_rect.Min.y -= window->TitleBarHeight;
ImVec2 pos_target(FLT_MAX, FLT_MAX);
ImVec2 size_target(FLT_MAX, FLT_MAX);
@@ -5942,21 +6560,21 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
ButtonBehavior(resize_rect, resize_grip_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus);
//GetForegroundDrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255));
if (hovered || held)
- g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE;
+ SetMouseCursor((resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE);
- if (held && g.IO.MouseClickedCount[0] == 2 && resize_grip_n == 0)
+ if (held && g.IO.MouseDoubleClicked[0])
{
- // Manual auto-fit when double-clicking
+ // Auto-fit when double-clicking
size_target = CalcWindowSizeAfterConstraint(window, size_auto_fit);
- ret_auto_fit = true;
+ ret_auto_fit_mask = 0x03; // Both axes
ClearActiveID();
}
else if (held)
{
// Resize from any of the four corners
// We don't use an incremental MouseDelta but rather compute an absolute target size based on mouse position
- ImVec2 clamp_min = ImVec2(def.CornerPosN.x == 1.0f ? visibility_rect.Min.x : -FLT_MAX, def.CornerPosN.y == 1.0f ? visibility_rect.Min.y : -FLT_MAX);
- ImVec2 clamp_max = ImVec2(def.CornerPosN.x == 0.0f ? visibility_rect.Max.x : +FLT_MAX, def.CornerPosN.y == 0.0f ? visibility_rect.Max.y : +FLT_MAX);
+ ImVec2 clamp_min = ImVec2(def.CornerPosN.x == 1.0f ? clamp_rect.Min.x : -FLT_MAX, (def.CornerPosN.y == 1.0f || (def.CornerPosN.y == 0.0f && window_move_from_title_bar)) ? clamp_rect.Min.y : -FLT_MAX);
+ ImVec2 clamp_max = ImVec2(def.CornerPosN.x == 0.0f ? clamp_rect.Max.x : +FLT_MAX, def.CornerPosN.y == 0.0f ? clamp_rect.Max.y : +FLT_MAX);
ImVec2 corner_target = g.IO.MousePos - g.ActiveIdClickOffset + ImLerp(def.InnerDir * grip_hover_outer_size, def.InnerDir * -grip_hover_inner_size, def.CornerPosN); // Corner of the window corresponding to our corner grip
corner_target = ImClamp(corner_target, clamp_min, clamp_max);
CalcResizePosSizeFromAnyCorner(window, corner_target, def.CornerPosN, &pos_target, &size_target);
@@ -5966,32 +6584,96 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
if (resize_grip_n == 0 || held || hovered)
resize_grip_col[resize_grip_n] = GetColorU32(held ? ImGuiCol_ResizeGripActive : hovered ? ImGuiCol_ResizeGripHovered : ImGuiCol_ResizeGrip);
}
- for (int border_n = 0; border_n < resize_border_count; border_n++)
+
+ int resize_border_mask = 0x00;
+ if (window->Flags & ImGuiWindowFlags_ChildWindow)
+ resize_border_mask |= ((window->ChildFlags & ImGuiChildFlags_ResizeX) ? 0x02 : 0) | ((window->ChildFlags & ImGuiChildFlags_ResizeY) ? 0x08 : 0);
+ else
+ resize_border_mask = g.IO.ConfigWindowsResizeFromEdges ? 0x0F : 0x00;
+ for (int border_n = 0; border_n < 4; border_n++)
{
+ if ((resize_border_mask & (1 << border_n)) == 0)
+ continue;
const ImGuiResizeBorderDef& def = resize_border_def[border_n];
const ImGuiAxis axis = (border_n == ImGuiDir_Left || border_n == ImGuiDir_Right) ? ImGuiAxis_X : ImGuiAxis_Y;
bool hovered, held;
- ImRect border_rect = GetResizeBorderRect(window, border_n, grip_hover_inner_size, WINDOWS_HOVER_PADDING);
+ ImRect border_rect = GetResizeBorderRect(window, border_n, grip_hover_inner_size, g.WindowsBorderHoverPadding);
ImGuiID border_id = window->GetID(border_n + 4); // == GetWindowResizeBorderID()
ItemAdd(border_rect, border_id, NULL, ImGuiItemFlags_NoNav);
ButtonBehavior(border_rect, border_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus);
- //GetForegroundDrawLists(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255));
- if ((hovered && g.HoveredIdTimer > WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) || held)
+ //GetForegroundDrawList(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255));
+ if (hovered && g.HoveredIdTimer <= WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER)
+ hovered = false;
+ if (hovered || held)
+ SetMouseCursor((axis == ImGuiAxis_X) ? ImGuiMouseCursor_ResizeEW : ImGuiMouseCursor_ResizeNS);
+ if (held && g.IO.MouseDoubleClicked[0])
{
- g.MouseCursor = (axis == ImGuiAxis_X) ? ImGuiMouseCursor_ResizeEW : ImGuiMouseCursor_ResizeNS;
- if (held)
- *border_held = border_n;
+ // Double-clicking bottom or right border auto-fit on this axis
+ // FIXME: CalcWindowAutoFitSize() doesn't take into account that only one side may be auto-fit when calculating scrollbars.
+ // FIXME: Support top and right borders: rework CalcResizePosSizeFromAnyCorner() to be reusable in both cases.
+ if (border_n == 1 || border_n == 3) // Right and bottom border
+ {
+ size_target[axis] = CalcWindowSizeAfterConstraint(window, size_auto_fit)[axis];
+ ret_auto_fit_mask |= (1 << axis);
+ hovered = held = false; // So border doesn't show highlighted at new position
+ }
+ ClearActiveID();
}
- if (held)
+ else if (held)
{
- ImVec2 clamp_min(border_n == ImGuiDir_Right ? visibility_rect.Min.x : -FLT_MAX, border_n == ImGuiDir_Down ? visibility_rect.Min.y : -FLT_MAX);
- ImVec2 clamp_max(border_n == ImGuiDir_Left ? visibility_rect.Max.x : +FLT_MAX, border_n == ImGuiDir_Up ? visibility_rect.Max.y : +FLT_MAX);
+ // Switch to relative resizing mode when border geometry moved (e.g. resizing a child altering parent scroll), in order to avoid resizing feedback loop.
+ // Currently only using relative mode on resizable child windows, as the problem to solve is more likely noticeable for them, but could apply for all windows eventually.
+ // FIXME: May want to generalize this idiom at lower-level, so more widgets can use it!
+ const bool just_scrolled_manually_while_resizing = (g.WheelingWindow != NULL && g.WheelingWindowScrolledFrame == g.FrameCount && IsWindowChildOf(window, g.WheelingWindow, false));
+ if (g.ActiveIdIsJustActivated || just_scrolled_manually_while_resizing)
+ {
+ g.WindowResizeBorderExpectedRect = border_rect;
+ g.WindowResizeRelativeMode = false;
+ }
+ if ((window->Flags & ImGuiWindowFlags_ChildWindow) && memcmp(&g.WindowResizeBorderExpectedRect, &border_rect, sizeof(ImRect)) != 0)
+ g.WindowResizeRelativeMode = true;
+
+ const ImVec2 border_curr = (window->Pos + ImMin(def.SegmentN1, def.SegmentN2) * window->Size);
+ const float border_target_rel_mode_for_axis = border_curr[axis] + g.IO.MouseDelta[axis];
+ const float border_target_abs_mode_for_axis = g.IO.MousePos[axis] - g.ActiveIdClickOffset[axis] + g.WindowsBorderHoverPadding; // Match ButtonBehavior() padding above.
+
+ // Use absolute mode position
ImVec2 border_target = window->Pos;
- border_target[axis] = g.IO.MousePos[axis] - g.ActiveIdClickOffset[axis] + WINDOWS_HOVER_PADDING;
+ border_target[axis] = border_target_abs_mode_for_axis;
+
+ // Use relative mode target for child window, ignore resize when moving back toward the ideal absolute position.
+ bool ignore_resize = false;
+ if (g.WindowResizeRelativeMode)
+ {
+ //GetForegroundDrawList()->AddText(GetMainViewport()->WorkPos, IM_COL32_WHITE, "Relative Mode");
+ border_target[axis] = border_target_rel_mode_for_axis;
+ if (g.IO.MouseDelta[axis] == 0.0f || (g.IO.MouseDelta[axis] > 0.0f) == (border_target_rel_mode_for_axis > border_target_abs_mode_for_axis))
+ ignore_resize = true;
+ }
+
+ // Clamp, apply
+ ImVec2 clamp_min(border_n == ImGuiDir_Right ? clamp_rect.Min.x : -FLT_MAX, border_n == ImGuiDir_Down || (border_n == ImGuiDir_Up && window_move_from_title_bar) ? clamp_rect.Min.y : -FLT_MAX);
+ ImVec2 clamp_max(border_n == ImGuiDir_Left ? clamp_rect.Max.x : +FLT_MAX, border_n == ImGuiDir_Up ? clamp_rect.Max.y : +FLT_MAX);
border_target = ImClamp(border_target, clamp_min, clamp_max);
- CalcResizePosSizeFromAnyCorner(window, border_target, ImMin(def.SegmentN1, def.SegmentN2), &pos_target, &size_target);
+ if (flags & ImGuiWindowFlags_ChildWindow) // Clamp resizing of childs within parent
+ {
+ ImGuiWindow* parent_window = window->ParentWindow;
+ ImGuiWindowFlags parent_flags = parent_window->Flags;
+ ImRect border_limit_rect = parent_window->InnerRect;
+ border_limit_rect.Expand(ImVec2(-ImMax(parent_window->WindowPadding.x, parent_window->WindowBorderSize), -ImMax(parent_window->WindowPadding.y, parent_window->WindowBorderSize)));
+ if ((axis == ImGuiAxis_X) && ((parent_flags & (ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar)) == 0 || (parent_flags & ImGuiWindowFlags_NoScrollbar)))
+ border_target.x = ImClamp(border_target.x, border_limit_rect.Min.x, border_limit_rect.Max.x);
+ if ((axis == ImGuiAxis_Y) && (parent_flags & ImGuiWindowFlags_NoScrollbar))
+ border_target.y = ImClamp(border_target.y, border_limit_rect.Min.y, border_limit_rect.Max.y);
+ }
+ if (!ignore_resize)
+ CalcResizePosSizeFromAnyCorner(window, border_target, ImMin(def.SegmentN1, def.SegmentN2), &pos_target, &size_target);
}
+ if (hovered)
+ *border_hovered = border_n;
+ if (held)
+ *border_held = border_n;
}
PopID();
@@ -6005,19 +6687,19 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
{
ImVec2 nav_resize_dir;
if (g.NavInputSource == ImGuiInputSource_Keyboard && g.IO.KeyShift)
- nav_resize_dir = GetKeyVector2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow);
+ nav_resize_dir = GetKeyMagnitude2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow);
if (g.NavInputSource == ImGuiInputSource_Gamepad)
- nav_resize_dir = GetKeyVector2d(ImGuiKey_GamepadDpadLeft, ImGuiKey_GamepadDpadRight, ImGuiKey_GamepadDpadUp, ImGuiKey_GamepadDpadDown);
+ nav_resize_dir = GetKeyMagnitude2d(ImGuiKey_GamepadDpadLeft, ImGuiKey_GamepadDpadRight, ImGuiKey_GamepadDpadUp, ImGuiKey_GamepadDpadDown);
if (nav_resize_dir.x != 0.0f || nav_resize_dir.y != 0.0f)
{
const float NAV_RESIZE_SPEED = 600.0f;
const float resize_step = NAV_RESIZE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y);
g.NavWindowingAccumDeltaSize += nav_resize_dir * resize_step;
- g.NavWindowingAccumDeltaSize = ImMax(g.NavWindowingAccumDeltaSize, visibility_rect.Min - window->Pos - window->Size); // We need Pos+Size >= visibility_rect.Min, so Size >= visibility_rect.Min - Pos, so size_delta >= visibility_rect.Min - window->Pos - window->Size
+ g.NavWindowingAccumDeltaSize = ImMax(g.NavWindowingAccumDeltaSize, clamp_rect.Min - window->Pos - window->Size); // We need Pos+Size >= clmap_rect.Min, so Size >= clmap_rect.Min - Pos, so size_delta >= clmap_rect.Min - window->Pos - window->Size
g.NavWindowingToggleLayer = false;
- g.NavDisableMouseHover = true;
+ g.NavHighlightItemUnderNav = true;
resize_grip_col[0] = GetColorU32(ImGuiCol_ResizeGripActive);
- ImVec2 accum_floored = ImFloor(g.NavWindowingAccumDeltaSize);
+ ImVec2 accum_floored = ImTrunc(g.NavWindowingAccumDeltaSize);
if (accum_floored.x != 0.0f || accum_floored.y != 0.0f)
{
// FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck.
@@ -6028,19 +6710,24 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
}
// Apply back modified position/size to window
- if (size_target.x != FLT_MAX)
- {
- window->SizeFull = size_target;
+ const ImVec2 curr_pos = window->Pos;
+ const ImVec2 curr_size = window->SizeFull;
+ if (size_target.x != FLT_MAX && (window->Size.x != size_target.x || window->SizeFull.x != size_target.x))
+ window->Size.x = window->SizeFull.x = size_target.x;
+ if (size_target.y != FLT_MAX && (window->Size.y != size_target.y || window->SizeFull.y != size_target.y))
+ window->Size.y = window->SizeFull.y = size_target.y;
+ if (pos_target.x != FLT_MAX && window->Pos.x != ImTrunc(pos_target.x))
+ window->Pos.x = ImTrunc(pos_target.x);
+ if (pos_target.y != FLT_MAX && window->Pos.y != ImTrunc(pos_target.y))
+ window->Pos.y = ImTrunc(pos_target.y);
+ if (curr_pos.x != window->Pos.x || curr_pos.y != window->Pos.y || curr_size.x != window->SizeFull.x || curr_size.y != window->SizeFull.y)
MarkIniSettingsDirty(window);
- }
- if (pos_target.x != FLT_MAX)
- {
- window->Pos = ImFloor(pos_target);
- MarkIniSettingsDirty(window);
- }
- window->Size = window->SizeFull;
- return ret_auto_fit;
+ // Recalculate next expected border expected coordinates
+ if (*border_held != -1)
+ g.WindowResizeBorderExpectedRect = GetResizeBorderRect(window, *border_held, grip_hover_inner_size, g.WindowsBorderHoverPadding);
+
+ return ret_auto_fit_mask;
}
static inline void ClampWindowPos(ImGuiWindow* window, const ImRect& visibility_rect)
@@ -6048,45 +6735,59 @@ static inline void ClampWindowPos(ImGuiWindow* window, const ImRect& visibility_
ImGuiContext& g = *GImGui;
ImVec2 size_for_clamping = window->Size;
if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(window->Flags & ImGuiWindowFlags_NoTitleBar))
- size_for_clamping.y = window->TitleBarHeight();
+ size_for_clamping.y = window->TitleBarHeight;
window->Pos = ImClamp(window->Pos, visibility_rect.Min - size_for_clamping, visibility_rect.Max);
}
+static void RenderWindowOuterSingleBorder(ImGuiWindow* window, int border_n, ImU32 border_col, float border_size)
+{
+ const ImGuiResizeBorderDef& def = resize_border_def[border_n];
+ const float rounding = window->WindowRounding;
+ const ImRect border_r = GetResizeBorderRect(window, border_n, rounding, 0.0f);
+ window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN1) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle - IM_PI * 0.25f, def.OuterAngle);
+ window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN2) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle, def.OuterAngle + IM_PI * 0.25f);
+ window->DrawList->PathStroke(border_col, ImDrawFlags_None, border_size);
+}
+
static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window)
{
ImGuiContext& g = *GImGui;
- float rounding = window->WindowRounding;
- float border_size = window->WindowBorderSize;
- if (border_size > 0.0f && !(window->Flags & ImGuiWindowFlags_NoBackground))
- window->DrawList->AddRect(window->Pos, window->Pos + window->Size, GetColorU32(ImGuiCol_Border), rounding, 0, border_size);
-
- int border_held = window->ResizeBorderHeld;
- if (border_held != -1)
+ const float border_size = window->WindowBorderSize;
+ const ImU32 border_col = GetColorU32(ImGuiCol_Border);
+ if (border_size > 0.0f && (window->Flags & ImGuiWindowFlags_NoBackground) == 0)
+ window->DrawList->AddRect(window->Pos, window->Pos + window->Size, border_col, window->WindowRounding, 0, window->WindowBorderSize);
+ else if (border_size > 0.0f)
+ {
+ if (window->ChildFlags & ImGuiChildFlags_ResizeX) // Similar code as 'resize_border_mask' computation in UpdateWindowManualResize() but we specifically only always draw explicit child resize border.
+ RenderWindowOuterSingleBorder(window, 1, border_col, border_size);
+ if (window->ChildFlags & ImGuiChildFlags_ResizeY)
+ RenderWindowOuterSingleBorder(window, 3, border_col, border_size);
+ }
+ if (window->ResizeBorderHovered != -1 || window->ResizeBorderHeld != -1)
{
- const ImGuiResizeBorderDef& def = resize_border_def[border_held];
- ImRect border_r = GetResizeBorderRect(window, border_held, rounding, 0.0f);
- window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN1) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle - IM_PI * 0.25f, def.OuterAngle);
- window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN2) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle, def.OuterAngle + IM_PI * 0.25f);
- window->DrawList->PathStroke(GetColorU32(ImGuiCol_SeparatorActive), 0, ImMax(2.0f, border_size)); // Thicker than usual
+ const int border_n = (window->ResizeBorderHeld != -1) ? window->ResizeBorderHeld : window->ResizeBorderHovered;
+ const ImU32 border_col_resizing = GetColorU32((window->ResizeBorderHeld != -1) ? ImGuiCol_SeparatorActive : ImGuiCol_SeparatorHovered);
+ RenderWindowOuterSingleBorder(window, border_n, border_col_resizing, ImMax(2.0f, window->WindowBorderSize)); // Thicker than usual
}
if (g.Style.FrameBorderSize > 0 && !(window->Flags & ImGuiWindowFlags_NoTitleBar))
{
- float y = window->Pos.y + window->TitleBarHeight() - 1;
- window->DrawList->AddLine(ImVec2(window->Pos.x + border_size, y), ImVec2(window->Pos.x + window->Size.x - border_size, y), GetColorU32(ImGuiCol_Border), g.Style.FrameBorderSize);
+ float y = window->Pos.y + window->TitleBarHeight - 1;
+ window->DrawList->AddLine(ImVec2(window->Pos.x + border_size * 0.5f, y), ImVec2(window->Pos.x + window->Size.x - border_size * 0.5f, y), border_col, g.Style.FrameBorderSize);
}
}
// Draw background and borders
// Draw and handle scrollbars
-void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size)
+void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, bool handle_borders_and_resize_grips, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size)
{
ImGuiContext& g = *GImGui;
ImGuiStyle& style = g.Style;
ImGuiWindowFlags flags = window->Flags;
- // Ensure that ScrollBar doesn't read last frame's SkipItems
+ // Ensure that Scrollbar() doesn't read last frame's SkipItems
IM_ASSERT(window->BeginCount == 0);
window->SkipItems = false;
+ window->DC.NavLayerCurrent = ImGuiNavLayer_Menu;
// Draw window + handle manual resize
// As we highlight the title bar when want_focus is set, multiple reappearing windows will have their title bar highlighted on their reappearing frame.
@@ -6095,9 +6796,9 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
if (window->Collapsed)
{
// Title bar only
- float backup_border_size = style.FrameBorderSize;
+ const float backup_border_size = style.FrameBorderSize;
g.Style.FrameBorderSize = window->WindowBorderSize;
- ImU32 title_bar_col = GetColorU32((title_bar_is_highlight && !g.NavDisableHighlight) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBgCollapsed);
+ ImU32 title_bar_col = GetColorU32((title_bar_is_highlight && g.NavCursorVisible) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBgCollapsed);
RenderFrame(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, true, window_rounding);
g.Style.FrameBorderSize = backup_border_size;
}
@@ -6109,14 +6810,14 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
ImU32 bg_col = GetColorU32(GetWindowBgColorIdx(window));
bool override_alpha = false;
float alpha = 1.0f;
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasBgAlpha)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasBgAlpha)
{
alpha = g.NextWindowData.BgAlphaVal;
override_alpha = true;
}
if (override_alpha)
bg_col = (bg_col & ~IM_COL32_A_MASK) | (IM_F32_TO_INT8_SAT(alpha) << IM_COL32_A_SHIFT);
- window->DrawList->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight()), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? 0 : ImDrawFlags_RoundCornersBottom);
+ window->DrawList->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? 0 : ImDrawFlags_RoundCornersBottom);
}
// Title bar
@@ -6131,9 +6832,9 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
{
ImRect menu_bar_rect = window->MenuBarRect();
menu_bar_rect.ClipWith(window->Rect()); // Soft clipping, in particular child window don't have minimum size covering the menu bar so this is useful for them.
- window->DrawList->AddRectFilled(menu_bar_rect.Min + ImVec2(window_border_size, 0), menu_bar_rect.Max - ImVec2(window_border_size, 0), GetColorU32(ImGuiCol_MenuBarBg), (flags & ImGuiWindowFlags_NoTitleBar) ? window_rounding : 0.0f, ImDrawFlags_RoundCornersTop);
+ window->DrawList->AddRectFilled(menu_bar_rect.Min, menu_bar_rect.Max, GetColorU32(ImGuiCol_MenuBarBg), (flags & ImGuiWindowFlags_NoTitleBar) ? window_rounding : 0.0f, ImDrawFlags_RoundCornersTop);
if (style.FrameBorderSize > 0.0f && menu_bar_rect.Max.y < window->Pos.y + window->Size.y)
- window->DrawList->AddLine(menu_bar_rect.GetBL(), menu_bar_rect.GetBR(), GetColorU32(ImGuiCol_Border), style.FrameBorderSize);
+ window->DrawList->AddLine(menu_bar_rect.GetBL() + ImVec2(window_border_size * 0.5f, 0.0f), menu_bar_rect.GetBR() - ImVec2(window_border_size * 0.5f, 0.0f), GetColorU32(ImGuiCol_Border), style.FrameBorderSize);
}
// Scrollbars
@@ -6143,22 +6844,28 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
Scrollbar(ImGuiAxis_Y);
// Render resize grips (after their input handling so we don't have a frame of latency)
- if (!(flags & ImGuiWindowFlags_NoResize))
+ if (handle_borders_and_resize_grips && !(flags & ImGuiWindowFlags_NoResize))
{
for (int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++)
{
+ const ImU32 col = resize_grip_col[resize_grip_n];
+ if ((col & IM_COL32_A_MASK) == 0)
+ continue;
const ImGuiResizeGripDef& grip = resize_grip_def[resize_grip_n];
const ImVec2 corner = ImLerp(window->Pos, window->Pos + window->Size, grip.CornerPosN);
- window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(window_border_size, resize_grip_draw_size) : ImVec2(resize_grip_draw_size, window_border_size)));
- window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(resize_grip_draw_size, window_border_size) : ImVec2(window_border_size, resize_grip_draw_size)));
- window->DrawList->PathArcToFast(ImVec2(corner.x + grip.InnerDir.x * (window_rounding + window_border_size), corner.y + grip.InnerDir.y * (window_rounding + window_border_size)), window_rounding, grip.AngleMin12, grip.AngleMax12);
- window->DrawList->PathFillConvex(resize_grip_col[resize_grip_n]);
+ const float border_inner = IM_ROUND(window_border_size * 0.5f);
+ window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(border_inner, resize_grip_draw_size) : ImVec2(resize_grip_draw_size, border_inner)));
+ window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(resize_grip_draw_size, border_inner) : ImVec2(border_inner, resize_grip_draw_size)));
+ window->DrawList->PathArcToFast(ImVec2(corner.x + grip.InnerDir.x * (window_rounding + border_inner), corner.y + grip.InnerDir.y * (window_rounding + border_inner)), window_rounding, grip.AngleMin12, grip.AngleMax12);
+ window->DrawList->PathFillConvex(col);
}
}
// Borders
- RenderWindowOuterBorders(window);
+ if (handle_borders_and_resize_grips)
+ RenderWindowOuterBorders(window);
}
+ window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
}
// Render title text, collapse button, close button
@@ -6186,18 +6893,18 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
ImVec2 collapse_button_pos;
if (has_close_button)
{
- pad_r += button_sz;
- close_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - style.FramePadding.x, title_bar_rect.Min.y);
+ close_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - button_sz, title_bar_rect.Min.y + style.FramePadding.y);
+ pad_r += button_sz + style.ItemInnerSpacing.x;
}
if (has_collapse_button && style.WindowMenuButtonPosition == ImGuiDir_Right)
{
- pad_r += button_sz;
- collapse_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - style.FramePadding.x, title_bar_rect.Min.y);
+ collapse_button_pos = ImVec2(title_bar_rect.Max.x - pad_r - button_sz, title_bar_rect.Min.y + style.FramePadding.y);
+ pad_r += button_sz + style.ItemInnerSpacing.x;
}
if (has_collapse_button && style.WindowMenuButtonPosition == ImGuiDir_Left)
{
- collapse_button_pos = ImVec2(title_bar_rect.Min.x + pad_l - style.FramePadding.x, title_bar_rect.Min.y);
- pad_l += button_sz;
+ collapse_button_pos = ImVec2(title_bar_rect.Min.x + pad_l, title_bar_rect.Min.y + style.FramePadding.y);
+ pad_l += button_sz + style.ItemInnerSpacing.x;
}
// Collapse button (submitting first so it gets priority when choosing a navigation init fallback)
@@ -6260,43 +6967,48 @@ void ImGui::UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags
window->RootWindowPopupTree = parent_window->RootWindowPopupTree;
if (parent_window && !(flags & ImGuiWindowFlags_Modal) && (flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Popup)))
window->RootWindowForTitleBarHighlight = parent_window->RootWindowForTitleBarHighlight;
- while (window->RootWindowForNav->Flags & ImGuiWindowFlags_NavFlattened)
+ while (window->RootWindowForNav->ChildFlags & ImGuiChildFlags_NavFlattened)
{
IM_ASSERT(window->RootWindowForNav->ParentWindow != NULL);
window->RootWindowForNav = window->RootWindowForNav->ParentWindow;
}
}
-// When a modal popup is open, newly created windows that want focus (i.e. are not popups and do not specify ImGuiWindowFlags_NoFocusOnAppearing)
-// should be positioned behind that modal window, unless the window was created inside the modal begin-stack.
-// In case of multiple stacked modals newly created window honors begin stack order and does not go below its own modal parent.
-// - Window // FindBlockingModal() returns Modal1
-// - Window // .. returns Modal1
-// - Modal1 // .. returns Modal2
-// - Window // .. returns Modal2
-// - Window // .. returns Modal2
-// - Modal2 // .. returns Modal2
-static ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window)
+// [EXPERIMENTAL] Called by Begin(). NextWindowData is valid at this point.
+// This is designed as a toy/test-bed for
+void ImGui::UpdateWindowSkipRefresh(ImGuiWindow* window)
{
ImGuiContext& g = *GImGui;
- if (g.OpenPopupStack.Size <= 0)
- return NULL;
-
- // Find a modal that has common parent with specified window. Specified window should be positioned behind that modal.
- for (int i = g.OpenPopupStack.Size - 1; i >= 0; i--)
+ window->SkipRefresh = false;
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasRefreshPolicy) == 0)
+ return;
+ if (g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_TryToAvoidRefresh)
{
- ImGuiWindow* popup_window = g.OpenPopupStack.Data[i].Window;
- if (popup_window == NULL || !(popup_window->Flags & ImGuiWindowFlags_Modal))
- continue;
- if (!popup_window->Active && !popup_window->WasActive) // Check WasActive, because this code may run before popup renders on current frame, also check Active to handle newly created windows.
- continue;
- if (IsWindowWithinBeginStackOf(window, popup_window)) // Window is rendered over last modal, no render order change needed.
- break;
- for (ImGuiWindow* parent = popup_window->ParentWindowInBeginStack->RootWindow; parent != NULL; parent = parent->ParentWindowInBeginStack->RootWindow)
- if (IsWindowWithinBeginStackOf(window, parent))
- return popup_window; // Place window above its begin stack parent.
+ // FIXME-IDLE: Tests for e.g. mouse clicks or keyboard while focused.
+ if (window->Appearing) // If currently appearing
+ return;
+ if (window->Hidden) // If was hidden (previous frame)
+ return;
+ if ((g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_RefreshOnHover) && g.HoveredWindow)
+ if (window->RootWindow == g.HoveredWindow->RootWindow || IsWindowWithinBeginStackOf(g.HoveredWindow->RootWindow, window))
+ return;
+ if ((g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_RefreshOnFocus) && g.NavWindow)
+ if (window->RootWindow == g.NavWindow->RootWindow || IsWindowWithinBeginStackOf(g.NavWindow->RootWindow, window))
+ return;
+ window->DrawList = NULL;
+ window->SkipRefresh = true;
}
- return NULL;
+}
+
+static void SetWindowActiveForSkipRefresh(ImGuiWindow* window)
+{
+ window->Active = true;
+ for (ImGuiWindow* child : window->DC.ChildWindows)
+ if (!child->Hidden)
+ {
+ child->Active = child->SkipRefresh = true;
+ SetWindowActiveForSkipRefresh(child);
+ }
}
// Push a new Dear ImGui window to add widgets to.
@@ -6320,13 +7032,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
if (window_just_created)
window = CreateNewWindow(name, flags);
+ // [DEBUG] Debug break requested by user
+ if (g.DebugBreakInWindow == window->ID)
+ IM_DEBUG_BREAK();
+
// Automatically disable manual moving/resizing when NoInputs is set
if ((flags & ImGuiWindowFlags_NoInputs) == ImGuiWindowFlags_NoInputs)
flags |= ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize;
- if (flags & ImGuiWindowFlags_NavFlattened)
- IM_ASSERT(flags & ImGuiWindowFlags_ChildWindow);
-
const int current_frame = g.FrameCount;
const bool first_begin_of_the_frame = (window->LastFrameActive != current_frame);
window->IsFallbackWindow = (g.CurrentWindowStack.Size == 0 && g.WithinFrameScopeWithImplicitWindow);
@@ -6348,6 +7061,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
{
UpdateWindowInFocusOrderList(window, window_just_created, flags);
window->Flags = (ImGuiWindowFlags)flags;
+ window->ChildFlags = (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasChildFlags) ? g.NextWindowData.ChildFlags : 0;
window->LastFrameActive = current_frame;
window->LastTimeActive = (float)g.Time;
window->BeginOrderWithinParent = 0;
@@ -6368,29 +7082,37 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->IDStack.push_back(window->ID);
// Add to stack
- // We intentionally set g.CurrentWindow to NULL to prevent usage until when the viewport is set, then will call SetCurrentWindow()
g.CurrentWindow = window;
- ImGuiWindowStackData window_stack_data;
+ g.CurrentWindowStack.resize(g.CurrentWindowStack.Size + 1);
+ ImGuiWindowStackData& window_stack_data = g.CurrentWindowStack.back();
window_stack_data.Window = window;
window_stack_data.ParentLastItemDataBackup = g.LastItemData;
- window_stack_data.StackSizesOnBegin.SetToCurrentState();
- g.CurrentWindowStack.push_back(window_stack_data);
+ window_stack_data.DisabledOverrideReenable = (flags & ImGuiWindowFlags_Tooltip) && (g.CurrentItemFlags & ImGuiItemFlags_Disabled);
+ window_stack_data.DisabledOverrideReenableAlphaBackup = 0.0f;
+ ErrorRecoveryStoreState(&window_stack_data.StackSizesInBegin);
+ g.StackSizesInBeginForCurrentWindow = &window_stack_data.StackSizesInBegin;
if (flags & ImGuiWindowFlags_ChildMenu)
- g.BeginMenuCount++;
+ g.BeginMenuDepth++;
// Update ->RootWindow and others pointers (before any possible call to FocusWindow)
if (first_begin_of_the_frame)
{
UpdateWindowParentAndRootLinks(window, flags, parent_window);
window->ParentWindowInBeginStack = parent_window_in_stack;
+
+ // There's little point to expose a flag to set this: because the interesting cases won't be using parent_window_in_stack,
+ // e.g. linking a tool window in a standalone viewport to a document window, regardless of their Begin() stack parenting. (#6798)
+ window->ParentWindowForFocusRoute = (flags & ImGuiWindowFlags_ChildWindow) ? parent_window_in_stack : NULL;
+
+ // Inherent SetWindowFontScale() from parent until we fix this system...
+ window->FontWindowScaleParents = parent_window ? parent_window->FontWindowScaleParents * parent_window->FontWindowScale : 1.0f;
}
// Add to focus scope stack
- PushFocusScope(window->ID);
+ PushFocusScope((window->ChildFlags & ImGuiChildFlags_NavFlattened) ? g.CurrentFocusScopeId : window->ID);
window->NavRootFocusScopeId = g.CurrentFocusScopeId;
- g.CurrentWindow = NULL;
- // Add to popup stack
+ // Add to popup stacks: update OpenPopupStack[] data, push to BeginPopupStack[]
if (flags & ImGuiWindowFlags_Popup)
{
ImGuiPopupData& popup_ref = g.OpenPopupStack[g.BeginPopupStack.Size];
@@ -6404,7 +7126,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// (FIXME: Consider splitting the HasXXX flags into X/Y components
bool window_pos_set_by_api = false;
bool window_size_x_set_by_api = false, window_size_y_set_by_api = false;
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasPos)
{
window_pos_set_by_api = (window->SetWindowPosAllowFlags & g.NextWindowData.PosCond) != 0;
if (window_pos_set_by_api && ImLengthSqr(g.NextWindowData.PosPivotVal) > 0.00001f)
@@ -6420,13 +7142,17 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
SetWindowPos(window, g.NextWindowData.PosVal, g.NextWindowData.PosCond);
}
}
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize)
{
window_size_x_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.x > 0.0f);
window_size_y_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.y > 0.0f);
+ if ((window->ChildFlags & ImGuiChildFlags_ResizeX) && (window->SetWindowSizeAllowFlags & ImGuiCond_FirstUseEver) == 0) // Axis-specific conditions for BeginChild()
+ g.NextWindowData.SizeVal.x = window->SizeFull.x;
+ if ((window->ChildFlags & ImGuiChildFlags_ResizeY) && (window->SetWindowSizeAllowFlags & ImGuiCond_FirstUseEver) == 0)
+ g.NextWindowData.SizeVal.y = window->SizeFull.y;
SetWindowSize(window, g.NextWindowData.SizeVal, g.NextWindowData.SizeCond);
}
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasScroll)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasScroll)
{
if (g.NextWindowData.ScrollVal.x >= 0.0f)
{
@@ -6439,19 +7165,29 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->ScrollTargetCenterRatio.y = 0.0f;
}
}
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasContentSize)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasContentSize)
window->ContentSizeExplicit = g.NextWindowData.ContentSizeVal;
else if (first_begin_of_the_frame)
window->ContentSizeExplicit = ImVec2(0.0f, 0.0f);
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasCollapsed)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasCollapsed)
SetWindowCollapsed(window, g.NextWindowData.CollapsedVal, g.NextWindowData.CollapsedCond);
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasFocus)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasFocus)
FocusWindow(window);
if (window->Appearing)
SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, false);
+ // [EXPERIMENTAL] Skip Refresh mode
+ UpdateWindowSkipRefresh(window);
+
+ // Nested root windows (typically tooltips) override disabled state
+ if (window_stack_data.DisabledOverrideReenable && window->RootWindow == window)
+ BeginDisabledOverrideReenable();
+
+ // We intentionally set g.CurrentWindow to NULL to prevent usage until when the viewport is set, then will call SetCurrentWindow()
+ g.CurrentWindow = NULL;
+
// When reusing window again multiple times a frame, just append content (don't need to setup again)
- if (first_begin_of_the_frame)
+ if (first_begin_of_the_frame && !window->SkipRefresh)
{
// Initialize
const bool window_is_child_tooltip = (flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_Tooltip); // FIXME-WIP: Undocumented behavior of Child+Tooltip for pinned tooltip (#1345)
@@ -6470,7 +7206,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Update stored window name when it changes (which can _only_ happen with the "###" operator, so the ID would stay unchanged).
// The title bar always display the 'name' parameter, so we only update the string storage if it needs to be visible to the end-user elsewhere.
bool window_title_visible_elsewhere = false;
- if (g.NavWindowingListWindow != NULL && (window->Flags & ImGuiWindowFlags_NoNavFocus) == 0) // Window titles visible when using CTRL+TAB
+ if (g.NavWindowingListWindow != NULL && (flags & ImGuiWindowFlags_NoNavFocus) == 0) // Window titles visible when using CTRL+TAB
+ window_title_visible_elsewhere = true;
+ if (flags & ImGuiWindowFlags_ChildMenu)
window_title_visible_elsewhere = true;
if (window_title_visible_elsewhere && !window_just_created && strcmp(name, window->Name) != 0)
{
@@ -6523,24 +7261,35 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
else
window->WindowBorderSize = ((flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) && !(flags & ImGuiWindowFlags_Modal)) ? style.PopupBorderSize : style.WindowBorderSize;
window->WindowPadding = style.WindowPadding;
- if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & (ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_Popup)) && window->WindowBorderSize == 0.0f)
+ if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !(window->ChildFlags & ImGuiChildFlags_AlwaysUseWindowPadding) && window->WindowBorderSize == 0.0f)
window->WindowPadding = ImVec2(0.0f, (flags & ImGuiWindowFlags_MenuBar) ? style.WindowPadding.y : 0.0f);
// Lock menu offset so size calculation can use it as menu-bar windows need a minimum size.
window->DC.MenuBarOffset.x = ImMax(ImMax(window->WindowPadding.x, style.ItemSpacing.x), g.NextWindowData.MenuBarOffsetMinVal.x);
window->DC.MenuBarOffset.y = g.NextWindowData.MenuBarOffsetMinVal.y;
+ window->TitleBarHeight = (flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : g.FontSize + g.Style.FramePadding.y * 2.0f;
+ window->MenuBarHeight = (flags & ImGuiWindowFlags_MenuBar) ? window->DC.MenuBarOffset.y + g.FontSize + g.Style.FramePadding.y * 2.0f : 0.0f;
+ window->FontRefSize = g.FontSize; // Lock this to discourage calling window->CalcFontSize() outside of current window.
+ // Depending on condition we use previous or current window size to compare against contents size to decide if a scrollbar should be visible.
+ // Those flags will be altered further down in the function depending on more conditions.
bool use_current_size_for_scrollbar_x = window_just_created;
bool use_current_size_for_scrollbar_y = window_just_created;
+ if (window_size_x_set_by_api && window->ContentSizeExplicit.x != 0.0f)
+ use_current_size_for_scrollbar_x = true;
+ if (window_size_y_set_by_api && window->ContentSizeExplicit.y != 0.0f) // #7252
+ use_current_size_for_scrollbar_y = true;
// Collapse window by double-clicking on title bar
// At this point we don't have a clipping rectangle setup yet, so we can use the title bar area for hit detection and drawing
if (!(flags & ImGuiWindowFlags_NoTitleBar) && !(flags & ImGuiWindowFlags_NoCollapse))
{
- // We don't use a regular button+id to test for double-click on title bar (mostly due to legacy reason, could be fixed), so verify that we don't have items over the title bar.
+ // We don't use a regular button+id to test for double-click on title bar (mostly due to legacy reason, could be fixed),
+ // so verify that we don't have items over the title bar.
ImRect title_bar_rect = window->TitleBarRect();
- if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseClickedCount[0] == 2)
- window->WantCollapseToggle = true;
+ if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && g.ActiveId == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max))
+ if (g.IO.MouseClickedCount[0] == 2 && GetKeyOwner(ImGuiKey_MouseLeft) == ImGuiKeyOwner_NoOwner)
+ window->WantCollapseToggle = true;
if (window->WantCollapseToggle)
{
window->Collapsed = !window->Collapsed;
@@ -6557,6 +7306,15 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// SIZE
+ // Outer Decoration Sizes
+ // (we need to clear ScrollbarSize immediately as CalcWindowAutoFitSize() needs it and can be called from other locations).
+ const ImVec2 scrollbar_sizes_from_last_frame = window->ScrollbarSizes;
+ window->DecoOuterSizeX1 = 0.0f;
+ window->DecoOuterSizeX2 = 0.0f;
+ window->DecoOuterSizeY1 = window->TitleBarHeight + window->MenuBarHeight;
+ window->DecoOuterSizeY2 = 0.0f;
+ window->ScrollbarSizes = ImVec2(0.0f, 0.0f);
+
// Calculate auto-fit size, handle automatic resize
const ImVec2 size_auto_fit = CalcWindowAutoFitSize(window, window->ContentSizeIdeal);
if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && !window->Collapsed)
@@ -6595,9 +7353,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->SizeFull = CalcWindowSizeAfterConstraint(window, window->SizeFull);
window->Size = window->Collapsed && !(flags & ImGuiWindowFlags_ChildWindow) ? window->TitleBarRect().GetSize() : window->SizeFull;
- // Decoration size
- const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight();
-
// POSITION
// Popup latch its initial position, will position itself when it appears next frame
@@ -6640,7 +7395,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
if (!window_pos_set_by_api && !(flags & ImGuiWindowFlags_ChildWindow))
if (viewport_rect.GetWidth() > 0.0f && viewport_rect.GetHeight() > 0.0f)
ClampWindowPos(window, visibility_rect);
- window->Pos = ImFloor(window->Pos);
+ window->Pos = ImTrunc(window->Pos);
// Lock window rounding for the frame (so that altering them doesn't cause inconsistencies)
// Large values tend to lead to variety of artifacts and are not recommended.
@@ -6658,44 +7413,37 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
want_focus = true;
else if ((flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Tooltip)) == 0)
want_focus = true;
-
- ImGuiWindow* modal = GetTopMostPopupModal();
- if (modal != NULL && !IsWindowWithinBeginStackOf(window, modal))
- {
- // Avoid focusing a window that is created outside of active modal. This will prevent active modal from being closed.
- // Since window is not focused it would reappear at the same display position like the last time it was visible.
- // In case of completely new windows it would go to the top (over current modal), but input to such window would still be blocked by modal.
- // Position window behind a modal that is not a begin-parent of this window.
- want_focus = false;
- if (window == window->RootWindow)
- {
- ImGuiWindow* blocking_modal = FindBlockingModal(window);
- IM_ASSERT(blocking_modal != NULL);
- BringWindowToDisplayBehind(window, blocking_modal);
- }
- }
}
- // [Test Engine] Register whole window in the item system
+ // [Test Engine] Register whole window in the item system (before submitting further decorations)
#ifdef IMGUI_ENABLE_TEST_ENGINE
if (g.TestEngineHookItems)
{
IM_ASSERT(window->IDStack.Size == 1);
window->IDStack.Size = 0; // As window->IDStack[0] == window->ID here, make sure TestEngine doesn't erroneously see window as parent of itself.
- IMGUI_TEST_ENGINE_ITEM_ADD(window->Rect(), window->ID);
+ window->DC.NavLayerCurrent = ImGuiNavLayer_Menu;
+ IMGUI_TEST_ENGINE_ITEM_ADD(window->ID, window->Rect(), NULL);
IMGUI_TEST_ENGINE_ITEM_INFO(window->ID, window->Name, (g.HoveredWindow == window) ? ImGuiItemStatusFlags_HoveredRect : 0);
window->IDStack.Size = 1;
+ window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
+
}
#endif
// Handle manual resize: Resize Grips, Borders, Gamepad
- int border_held = -1;
+ int border_hovered = -1, border_held = -1;
ImU32 resize_grip_col[4] = {};
- const int resize_grip_count = g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // Allow resize from lower-left if we have the mouse cursor feedback for it.
- const float resize_grip_draw_size = IM_FLOOR(ImMax(g.FontSize * 1.10f, window->WindowRounding + 1.0f + g.FontSize * 0.2f));
+ const int resize_grip_count = ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup)) ? 0 : g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // Allow resize from lower-left if we have the mouse cursor feedback for it.
+ const float resize_grip_draw_size = IM_TRUNC(ImMax(g.FontSize * 1.10f, window->WindowRounding + 1.0f + g.FontSize * 0.2f));
if (!window->Collapsed)
- if (UpdateWindowManualResize(window, size_auto_fit, &border_held, resize_grip_count, &resize_grip_col[0], visibility_rect))
- use_current_size_for_scrollbar_x = use_current_size_for_scrollbar_y = true;
+ if (int auto_fit_mask = UpdateWindowManualResize(window, size_auto_fit, &border_hovered, &border_held, resize_grip_count, &resize_grip_col[0], visibility_rect))
+ {
+ if (auto_fit_mask & (1 << ImGuiAxis_X))
+ use_current_size_for_scrollbar_x = true;
+ if (auto_fit_mask & (1 << ImGuiAxis_Y))
+ use_current_size_for_scrollbar_y = true;
+ }
+ window->ResizeBorderHovered = (signed char)border_hovered;
window->ResizeBorderHeld = (signed char)border_held;
// SCROLLBAR VISIBILITY
@@ -6704,18 +7452,37 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
if (!window->Collapsed)
{
// When reading the current size we need to read it after size constraints have been applied.
- // When we use InnerRect here we are intentionally reading last frame size, same for ScrollbarSizes values before we set them again.
- ImVec2 avail_size_from_current_frame = ImVec2(window->SizeFull.x, window->SizeFull.y - decoration_up_height);
- ImVec2 avail_size_from_last_frame = window->InnerRect.GetSize() + window->ScrollbarSizes;
+ // Intentionally use previous frame values for InnerRect and ScrollbarSizes.
+ // And when we use window->DecorationUp here it doesn't have ScrollbarSizes.y applied yet.
+ ImVec2 avail_size_from_current_frame = ImVec2(window->SizeFull.x, window->SizeFull.y - (window->DecoOuterSizeY1 + window->DecoOuterSizeY2));
+ ImVec2 avail_size_from_last_frame = window->InnerRect.GetSize() + scrollbar_sizes_from_last_frame;
ImVec2 needed_size_from_last_frame = window_just_created ? ImVec2(0, 0) : window->ContentSize + window->WindowPadding * 2.0f;
float size_x_for_scrollbars = use_current_size_for_scrollbar_x ? avail_size_from_current_frame.x : avail_size_from_last_frame.x;
float size_y_for_scrollbars = use_current_size_for_scrollbar_y ? avail_size_from_current_frame.y : avail_size_from_last_frame.y;
+ bool scrollbar_x_prev = window->ScrollbarX;
//bool scrollbar_y_from_last_frame = window->ScrollbarY; // FIXME: May want to use that in the ScrollbarX expression? How many pros vs cons?
window->ScrollbarY = (flags & ImGuiWindowFlags_AlwaysVerticalScrollbar) || ((needed_size_from_last_frame.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar));
window->ScrollbarX = (flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar) || ((needed_size_from_last_frame.x > size_x_for_scrollbars - (window->ScrollbarY ? style.ScrollbarSize : 0.0f)) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar));
+
+ // Track when ScrollbarX visibility keeps toggling, which is a sign of a feedback loop, and stabilize by enforcing visibility (#3285, #8488)
+ // (Feedback loops of this sort can manifest in various situations, but combining horizontal + vertical scrollbar + using a clipper with varying width items is one frequent cause.
+ // The better solution is to, either (1) enforce visibility by using ImGuiWindowFlags_AlwaysHorizontalScrollbar or (2) declare stable contents width with SetNextWindowContentSize(), if you can compute it)
+ window->ScrollbarXStabilizeToggledHistory <<= 1;
+ window->ScrollbarXStabilizeToggledHistory |= (scrollbar_x_prev != window->ScrollbarX) ? 0x01 : 0x00;
+ const bool scrollbar_x_stabilize = (window->ScrollbarXStabilizeToggledHistory != 0) && ImCountSetBits(window->ScrollbarXStabilizeToggledHistory) >= 4; // 4 == half of bits in our U8 history.
+ if (scrollbar_x_stabilize)
+ window->ScrollbarX = true;
+ //if (scrollbar_x_stabilize && !window->ScrollbarXStabilizeEnabled)
+ // IMGUI_DEBUG_LOG("[scroll] Stabilize ScrollbarX for Window '%s'\n", window->Name);
+ window->ScrollbarXStabilizeEnabled = scrollbar_x_stabilize;
+
if (window->ScrollbarX && !window->ScrollbarY)
- window->ScrollbarY = (needed_size_from_last_frame.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar);
+ window->ScrollbarY = (needed_size_from_last_frame.y > size_y_for_scrollbars - style.ScrollbarSize) && !(flags & ImGuiWindowFlags_NoScrollbar);
window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->ScrollbarX ? style.ScrollbarSize : 0.0f);
+
+ // Amend the partially filled window->DecorationXXX values.
+ window->DecoOuterSizeX2 += window->ScrollbarSizes.x;
+ window->DecoOuterSizeY2 += window->ScrollbarSizes.y;
}
// UPDATE RECTANGLES (1- THOSE NOT AFFECTED BY SCROLLING)
@@ -6739,30 +7506,36 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// - ScrollToRectEx()
// - NavUpdatePageUpPageDown()
// - Scrollbar()
- window->InnerRect.Min.x = window->Pos.x;
- window->InnerRect.Min.y = window->Pos.y + decoration_up_height;
- window->InnerRect.Max.x = window->Pos.x + window->Size.x - window->ScrollbarSizes.x;
- window->InnerRect.Max.y = window->Pos.y + window->Size.y - window->ScrollbarSizes.y;
+ window->InnerRect.Min.x = window->Pos.x + window->DecoOuterSizeX1;
+ window->InnerRect.Min.y = window->Pos.y + window->DecoOuterSizeY1;
+ window->InnerRect.Max.x = window->Pos.x + window->Size.x - window->DecoOuterSizeX2;
+ window->InnerRect.Max.y = window->Pos.y + window->Size.y - window->DecoOuterSizeY2;
// Inner clipping rectangle.
- // Will extend a little bit outside the normal work region.
- // This is to allow e.g. Selectable or CollapsingHeader or some separators to cover that space.
- // Force round operator last to ensure that e.g. (int)(max.x-min.x) in user's render code produce correct result.
+ // - Extend a outside of normal work region up to borders.
+ // - This is to allow e.g. Selectable or CollapsingHeader or some separators to cover that space.
+ // - It also makes clipped items be more noticeable.
+ // - And is consistent on both axis (prior to 2024/05/03 ClipRect used WindowPadding.x * 0.5f on left and right edge), see #3312
+ // - Force round operator last to ensure that e.g. (int)(max.x-min.x) in user's render code produce correct result.
// Note that if our window is collapsed we will end up with an inverted (~null) clipping rectangle which is the correct behavior.
// Affected by window/frame border size. Used by:
// - Begin() initial clip rect
float top_border_size = (((flags & ImGuiWindowFlags_MenuBar) || !(flags & ImGuiWindowFlags_NoTitleBar)) ? style.FrameBorderSize : window->WindowBorderSize);
- window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerRect.Min.x + ImMax(ImFloor(window->WindowPadding.x * 0.5f), window->WindowBorderSize));
- window->InnerClipRect.Min.y = ImFloor(0.5f + window->InnerRect.Min.y + top_border_size);
- window->InnerClipRect.Max.x = ImFloor(0.5f + window->InnerRect.Max.x - ImMax(ImFloor(window->WindowPadding.x * 0.5f), window->WindowBorderSize));
- window->InnerClipRect.Max.y = ImFloor(0.5f + window->InnerRect.Max.y - window->WindowBorderSize);
+
+ // Try to match the fact that our border is drawn centered over the window rectangle, rather than inner.
+ // This is why we do a *0.5f here. We don't currently even technically support large values for WindowBorderSize,
+ // see e.g #7887 #7888, but may do after we move the window border to become an inner border (and then we can remove the 0.5f here).
+ window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerRect.Min.x + window->WindowBorderSize * 0.5f);
+ window->InnerClipRect.Min.y = ImFloor(0.5f + window->InnerRect.Min.y + top_border_size * 0.5f);
+ window->InnerClipRect.Max.x = ImFloor(window->InnerRect.Max.x - window->WindowBorderSize * 0.5f);
+ window->InnerClipRect.Max.y = ImFloor(window->InnerRect.Max.y - window->WindowBorderSize * 0.5f);
window->InnerClipRect.ClipWithFull(host_rect);
// Default item width. Make it proportional to window size if window manually resizes
if (window->Size.x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_AlwaysAutoResize))
- window->ItemWidthDefault = ImFloor(window->Size.x * 0.65f);
+ window->ItemWidthDefault = ImTrunc(window->Size.x * 0.65f);
else
- window->ItemWidthDefault = ImFloor(g.FontSize * 16.0f);
+ window->ItemWidthDefault = ImTrunc(g.FontSize * 16.0f);
// SCROLLING
@@ -6775,6 +7548,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Apply scrolling
window->Scroll = CalcNextScrollFromScrollTargetAndClamp(window);
window->ScrollTarget = ImVec2(FLT_MAX, FLT_MAX);
+ window->DecoInnerSizeX1 = window->DecoInnerSizeY1 = 0.0f;
// DRAWING
@@ -6794,8 +7568,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// - We disable this when the parent window has zero vertices, which is a common pattern leading to laying out multiple overlapping childs
ImGuiWindow* previous_child = parent_window->DC.ChildWindows.Size >= 2 ? parent_window->DC.ChildWindows[parent_window->DC.ChildWindows.Size - 2] : NULL;
bool previous_child_overlapping = previous_child ? previous_child->Rect().Overlaps(window->Rect()) : false;
- bool parent_is_empty = parent_window->DrawList->VtxBuffer.Size > 0;
- if (window->DrawList->CmdBuffer.back().ElemCount == 0 && parent_is_empty && !previous_child_overlapping)
+ bool parent_is_empty = (parent_window->DrawList->VtxBuffer.Size == 0);
+ if (window->DrawList->CmdBuffer.back().ElemCount == 0 && !parent_is_empty && !previous_child_overlapping)
render_decorations_in_parent = true;
}
if (render_decorations_in_parent)
@@ -6804,7 +7578,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Handle title bar, scrollbar, resize grips and resize borders
const ImGuiWindow* window_to_highlight = g.NavWindowingTarget ? g.NavWindowingTarget : g.NavWindow;
const bool title_bar_is_highlight = want_focus || (window_to_highlight && window->RootWindowForTitleBarHighlight == window_to_highlight->RootWindowForTitleBarHighlight);
- RenderWindowDecorations(window, title_bar_rect, title_bar_is_highlight, resize_grip_count, resize_grip_col, resize_grip_draw_size);
+ const bool handle_borders_and_resize_grips = true; // This exists to facilitate merge with 'docking' branch.
+ RenderWindowDecorations(window, title_bar_rect, title_bar_is_highlight, handle_borders_and_resize_grips, resize_grip_count, resize_grip_col, resize_grip_draw_size);
if (render_decorations_in_parent)
window->DrawList = &window->DrawListInst;
@@ -6819,33 +7594,34 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// - BeginTabBar() for right-most edge
const bool allow_scrollbar_x = !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar);
const bool allow_scrollbar_y = !(flags & ImGuiWindowFlags_NoScrollbar);
- const float work_rect_size_x = (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : ImMax(allow_scrollbar_x ? window->ContentSize.x : 0.0f, window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x));
- const float work_rect_size_y = (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : ImMax(allow_scrollbar_y ? window->ContentSize.y : 0.0f, window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y));
- window->WorkRect.Min.x = ImFloor(window->InnerRect.Min.x - window->Scroll.x + ImMax(window->WindowPadding.x, window->WindowBorderSize));
- window->WorkRect.Min.y = ImFloor(window->InnerRect.Min.y - window->Scroll.y + ImMax(window->WindowPadding.y, window->WindowBorderSize));
+ const float work_rect_size_x = (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : ImMax(allow_scrollbar_x ? window->ContentSize.x : 0.0f, window->Size.x - window->WindowPadding.x * 2.0f - (window->DecoOuterSizeX1 + window->DecoOuterSizeX2)));
+ const float work_rect_size_y = (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : ImMax(allow_scrollbar_y ? window->ContentSize.y : 0.0f, window->Size.y - window->WindowPadding.y * 2.0f - (window->DecoOuterSizeY1 + window->DecoOuterSizeY2)));
+ window->WorkRect.Min.x = ImTrunc(window->InnerRect.Min.x - window->Scroll.x + ImMax(window->WindowPadding.x, window->WindowBorderSize));
+ window->WorkRect.Min.y = ImTrunc(window->InnerRect.Min.y - window->Scroll.y + ImMax(window->WindowPadding.y, window->WindowBorderSize));
window->WorkRect.Max.x = window->WorkRect.Min.x + work_rect_size_x;
window->WorkRect.Max.y = window->WorkRect.Min.y + work_rect_size_y;
window->ParentWorkRect = window->WorkRect;
// [LEGACY] Content Region
// FIXME-OBSOLETE: window->ContentRegionRect.Max is currently very misleading / partly faulty, but some BeginChild() patterns relies on it.
+ // Unless explicit content size is specified by user, this currently represent the region leading to no scrolling.
// Used by:
// - Mouse wheel scrolling + many other things
- window->ContentRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x;
- window->ContentRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + decoration_up_height;
- window->ContentRegionRect.Max.x = window->ContentRegionRect.Min.x + (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : (window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x));
- window->ContentRegionRect.Max.y = window->ContentRegionRect.Min.y + (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : (window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y));
+ window->ContentRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x + window->DecoOuterSizeX1;
+ window->ContentRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + window->DecoOuterSizeY1;
+ window->ContentRegionRect.Max.x = window->ContentRegionRect.Min.x + (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : (window->Size.x - window->WindowPadding.x * 2.0f - (window->DecoOuterSizeX1 + window->DecoOuterSizeX2)));
+ window->ContentRegionRect.Max.y = window->ContentRegionRect.Min.y + (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : (window->Size.y - window->WindowPadding.y * 2.0f - (window->DecoOuterSizeY1 + window->DecoOuterSizeY2)));
// Setup drawing context
// (NB: That term "drawing context / DC" lost its meaning a long time ago. Initially was meant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.)
- window->DC.Indent.x = 0.0f + window->WindowPadding.x - window->Scroll.x;
+ window->DC.Indent.x = window->DecoOuterSizeX1 + window->WindowPadding.x - window->Scroll.x;
window->DC.GroupOffset.x = 0.0f;
window->DC.ColumnsOffset.x = 0.0f;
// Record the loss of precision of CursorStartPos which can happen due to really large scrolling amount.
// This is used by clipper to compensate and fix the most common use case of large scroll area. Easy and cheap, next best thing compared to switching everything to double or ImU64.
- double start_pos_highp_x = (double)window->Pos.x + window->WindowPadding.x - (double)window->Scroll.x + window->DC.ColumnsOffset.x;
- double start_pos_highp_y = (double)window->Pos.y + window->WindowPadding.y - (double)window->Scroll.y + decoration_up_height;
+ double start_pos_highp_x = (double)window->Pos.x + window->WindowPadding.x - (double)window->Scroll.x + window->DecoOuterSizeX1 + window->DC.ColumnsOffset.x;
+ double start_pos_highp_y = (double)window->Pos.y + window->WindowPadding.y - (double)window->Scroll.y + window->DecoOuterSizeY1;
window->DC.CursorStartPos = ImVec2((float)start_pos_highp_x, (float)start_pos_highp_y);
window->DC.CursorStartPosLossyness = ImVec2((float)(start_pos_highp_x - window->DC.CursorStartPos.x), (float)(start_pos_highp_y - window->DC.CursorStartPos.y));
window->DC.CursorPos = window->DC.CursorStartPos;
@@ -6859,13 +7635,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
window->DC.NavLayersActiveMask = window->DC.NavLayersActiveMaskNext;
window->DC.NavLayersActiveMaskNext = 0x00;
+ window->DC.NavIsScrollPushableX = true;
window->DC.NavHideHighlightOneFrame = false;
- window->DC.NavHasScroll = (window->ScrollMax.y > 0.0f);
+ window->DC.NavWindowHasScrollY = (window->ScrollMax.y > 0.0f);
window->DC.MenuBarAppending = false;
window->DC.MenuColumns.Update(style.ItemSpacing.x, window_just_activated_by_user);
window->DC.TreeDepth = 0;
- window->DC.TreeJumpToParentOnPopMask = 0x00;
+ window->DC.TreeHasStackDataDepthMask = 0x00;
window->DC.ChildWindows.resize(0);
window->DC.StateStorage = &window->StateStorage;
window->DC.CurrentColumns = NULL;
@@ -6876,6 +7653,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->DC.TextWrapPos = -1.0f; // disabled
window->DC.ItemWidthStack.resize(0);
window->DC.TextWrapPosStack.resize(0);
+ if (flags & ImGuiWindowFlags_Modal)
+ window->DC.ModalDimBgColor = ColorConvertFloat4ToU32(GetStyleColorVec4(ImGuiCol_ModalWindowDimBg));
if (window->AutoFitFramesX > 0)
window->AutoFitFramesX--;
@@ -6883,11 +7662,20 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->AutoFitFramesY--;
// Apply focus (we need to call FocusWindow() AFTER setting DC.CursorStartPos so our initial navigation reference rectangle can start around there)
+ // We ImGuiFocusRequestFlags_UnlessBelowModal to:
+ // - Avoid focusing a window that is created outside of a modal. This will prevent active modal from being closed.
+ // - Position window behind the modal that is not a begin-parent of this window.
if (want_focus)
- {
- FocusWindow(window);
+ FocusWindow(window, ImGuiFocusRequestFlags_UnlessBelowModal);
+ if (want_focus && window == g.NavWindow)
NavInitWindow(window, false); // <-- this is in the way for us to be able to defer and sort reappearing FocusWindow() calls
- }
+
+ // Pressing CTRL+C copy window content into the clipboard
+ // [EXPERIMENTAL] Breaks on nested Begin/End pairs. We need to work that out and add better logging scope.
+ // [EXPERIMENTAL] Text outputs has many issues.
+ if (g.IO.ConfigWindowsCopyContentsWithCtrlC)
+ if (g.NavWindow && g.NavWindow->RootWindow == window && g.ActiveId == 0 && Shortcut(ImGuiMod_Ctrl | ImGuiKey_C))
+ LogToClipboard(0);
// Title bar
if (!(flags & ImGuiWindowFlags_NoTitleBar))
@@ -6896,19 +7684,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Clear hit test shape every frame
window->HitTestHoleSize.x = window->HitTestHoleSize.y = 0;
- // Pressing CTRL+C while holding on a window copy its content to the clipboard
- // This works but 1. doesn't handle multiple Begin/End pairs, 2. recursing into another Begin/End pair - so we need to work that out and add better logging scope.
- // Maybe we can support CTRL+C on every element?
- /*
- //if (g.NavWindow == window && g.ActiveId == 0)
- if (g.ActiveId == window->MoveId)
- if (g.IO.KeyCtrl && IsKeyPressed(ImGuiKey_C))
- LogToClipboard();
- */
+ if (flags & ImGuiWindowFlags_Tooltip)
+ g.TooltipPreviousWindow = window;
// We fill last item data based on Title Bar/Tab, in order for IsItemHovered() and IsItemActive() to be usable after Begin().
// This is useful to allow creating context menus on title bar only, etc.
- SetLastItemData(window->MoveId, g.CurrentItemFlags, IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0, title_bar_rect);
+ window->DC.WindowItemStatusFlags = ImGuiItemStatusFlags_None;
+ window->DC.WindowItemStatusFlags |= IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0;
+ SetLastItemDataForWindow(window, title_bar_rect);
// [DEBUG]
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
@@ -6916,19 +7699,29 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
DebugLocateItemResolveWithLastItem();
#endif
- // [Test Engine] Register title bar / tab
+ // [Test Engine] Register title bar / tab with MoveId.
#ifdef IMGUI_ENABLE_TEST_ENGINE
if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
- IMGUI_TEST_ENGINE_ITEM_ADD(g.LastItemData.Rect, g.LastItemData.ID);
+ {
+ window->DC.NavLayerCurrent = ImGuiNavLayer_Menu;
+ IMGUI_TEST_ENGINE_ITEM_ADD(g.LastItemData.ID, g.LastItemData.Rect, &g.LastItemData);
+ window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
+ }
#endif
}
else
{
+ // Skip refresh always mark active
+ if (window->SkipRefresh)
+ SetWindowActiveForSkipRefresh(window);
+
// Append
SetCurrentWindow(window);
+ SetLastItemDataForWindow(window, window->TitleBarRect());
}
- PushClipRect(window->InnerClipRect.Min, window->InnerClipRect.Max, true);
+ if (!window->SkipRefresh)
+ PushClipRect(window->InnerClipRect.Min, window->InnerClipRect.Max, true);
// Clear 'accessed' flag last thing (After PushClipRect which will set the flag. We want the flag to stay false when the default "Debug" window is unused)
window->WriteAccessed = false;
@@ -6936,25 +7729,27 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
g.NextWindowData.ClearFlags();
// Update visibility
- if (first_begin_of_the_frame)
+ if (first_begin_of_the_frame && !window->SkipRefresh)
{
- if (flags & ImGuiWindowFlags_ChildWindow)
+ if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_ChildMenu))
{
// Child window can be out of sight and have "negative" clip windows.
// Mark them as collapsed so commands are skipped earlier (we can't manually collapse them because they have no title bar).
IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0);
- if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) // FIXME: Doesn't make sense for ChildWindow??
- {
- const bool nav_request = (flags & ImGuiWindowFlags_NavFlattened) && (g.NavAnyRequest && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav);
- if (!g.LogEnabled && !nav_request)
- if (window->OuterRectClipped.Min.x >= window->OuterRectClipped.Max.x || window->OuterRectClipped.Min.y >= window->OuterRectClipped.Max.y)
+ const bool nav_request = (window->ChildFlags & ImGuiChildFlags_NavFlattened) && (g.NavAnyRequest && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav);
+ if (!g.LogEnabled && !nav_request)
+ if (window->OuterRectClipped.Min.x >= window->OuterRectClipped.Max.x || window->OuterRectClipped.Min.y >= window->OuterRectClipped.Max.y)
+ {
+ if (window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0)
+ window->HiddenFramesCannotSkipItems = 1;
+ else
window->HiddenFramesCanSkipItems = 1;
- }
+ }
// Hide along with parent or if parent is collapsed
if (parent_window && (parent_window->Collapsed || parent_window->HiddenFramesCanSkipItems > 0))
window->HiddenFramesCanSkipItems = 1;
- if (parent_window && (parent_window->Collapsed || parent_window->HiddenFramesCannotSkipItems > 0))
+ if (parent_window && parent_window->HiddenFramesCannotSkipItems > 0)
window->HiddenFramesCannotSkipItems = 1;
}
@@ -6980,6 +7775,23 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
skip_items = true;
window->SkipItems = skip_items;
}
+ else if (first_begin_of_the_frame)
+ {
+ // Skip refresh mode
+ window->SkipItems = true;
+ }
+
+ // [DEBUG] io.ConfigDebugBeginReturnValue override return value to test Begin/End and BeginChild/EndChild behaviors.
+ // (The implicit fallback window is NOT automatically ended allowing it to always be able to receive commands without crashing)
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ if (!window->IsFallbackWindow)
+ if ((g.IO.ConfigDebugBeginReturnValueOnce && window_just_created) || (g.IO.ConfigDebugBeginReturnValueLoop && g.DebugBeginReturnValueCullDepth == g.CurrentWindowStack.Size))
+ {
+ if (window->AutoFitFramesX > 0) { window->AutoFitFramesX++; }
+ if (window->AutoFitFramesY > 0) { window->AutoFitFramesY++; }
+ return false;
+ }
+#endif
return !window->SkipItems;
}
@@ -6995,184 +7807,47 @@ void ImGui::End()
IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size > 1, "Calling End() too many times!");
return;
}
- IM_ASSERT(g.CurrentWindowStack.Size > 0);
+ ImGuiWindowStackData& window_stack_data = g.CurrentWindowStack.back();
// Error checking: verify that user doesn't directly call End() on a child window.
if (window->Flags & ImGuiWindowFlags_ChildWindow)
- IM_ASSERT_USER_ERROR(g.WithinEndChild, "Must call EndChild() and not End()!");
+ IM_ASSERT_USER_ERROR(g.WithinEndChildID == window->ID, "Must call EndChild() and not End()!");
// Close anything that is open
if (window->DC.CurrentColumns)
EndColumns();
- PopClipRect(); // Inner window clip rectangle
+ if (!window->SkipRefresh)
+ PopClipRect(); // Inner window clip rectangle
PopFocusScope();
+ if (window_stack_data.DisabledOverrideReenable && window->RootWindow == window)
+ EndDisabledOverrideReenable();
+
+ if (window->SkipRefresh)
+ {
+ IM_ASSERT(window->DrawList == NULL);
+ window->DrawList = &window->DrawListInst;
+ }
// Stop logging
- if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging
+ if (g.LogWindow == window) // FIXME: add more options for scope of logging
LogFinish();
if (window->DC.IsSetPos)
ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
// Pop from window stack
- g.LastItemData = g.CurrentWindowStack.back().ParentLastItemDataBackup;
+ g.LastItemData = window_stack_data.ParentLastItemDataBackup;
if (window->Flags & ImGuiWindowFlags_ChildMenu)
- g.BeginMenuCount--;
+ g.BeginMenuDepth--;
if (window->Flags & ImGuiWindowFlags_Popup)
g.BeginPopupStack.pop_back();
- g.CurrentWindowStack.back().StackSizesOnBegin.CompareWithCurrentState();
- g.CurrentWindowStack.pop_back();
- SetCurrentWindow(g.CurrentWindowStack.Size == 0 ? NULL : g.CurrentWindowStack.back().Window);
-}
-
-void ImGui::BringWindowToFocusFront(ImGuiWindow* window)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(window == window->RootWindow);
-
- const int cur_order = window->FocusOrder;
- IM_ASSERT(g.WindowsFocusOrder[cur_order] == window);
- if (g.WindowsFocusOrder.back() == window)
- return;
-
- const int new_order = g.WindowsFocusOrder.Size - 1;
- for (int n = cur_order; n < new_order; n++)
- {
- g.WindowsFocusOrder[n] = g.WindowsFocusOrder[n + 1];
- g.WindowsFocusOrder[n]->FocusOrder--;
- IM_ASSERT(g.WindowsFocusOrder[n]->FocusOrder == n);
- }
- g.WindowsFocusOrder[new_order] = window;
- window->FocusOrder = (short)new_order;
-}
-
-void ImGui::BringWindowToDisplayFront(ImGuiWindow* window)
-{
- ImGuiContext& g = *GImGui;
- ImGuiWindow* current_front_window = g.Windows.back();
- if (current_front_window == window || current_front_window->RootWindow == window) // Cheap early out (could be better)
- return;
- for (int i = g.Windows.Size - 2; i >= 0; i--) // We can ignore the top-most window
- if (g.Windows[i] == window)
- {
- memmove(&g.Windows[i], &g.Windows[i + 1], (size_t)(g.Windows.Size - i - 1) * sizeof(ImGuiWindow*));
- g.Windows[g.Windows.Size - 1] = window;
- break;
- }
-}
-
-void ImGui::BringWindowToDisplayBack(ImGuiWindow* window)
-{
- ImGuiContext& g = *GImGui;
- if (g.Windows[0] == window)
- return;
- for (int i = 0; i < g.Windows.Size; i++)
- if (g.Windows[i] == window)
- {
- memmove(&g.Windows[1], &g.Windows[0], (size_t)i * sizeof(ImGuiWindow*));
- g.Windows[0] = window;
- break;
- }
-}
-
-void ImGui::BringWindowToDisplayBehind(ImGuiWindow* window, ImGuiWindow* behind_window)
-{
- IM_ASSERT(window != NULL && behind_window != NULL);
- ImGuiContext& g = *GImGui;
- window = window->RootWindow;
- behind_window = behind_window->RootWindow;
- int pos_wnd = FindWindowDisplayIndex(window);
- int pos_beh = FindWindowDisplayIndex(behind_window);
- if (pos_wnd < pos_beh)
- {
- size_t copy_bytes = (pos_beh - pos_wnd - 1) * sizeof(ImGuiWindow*);
- memmove(&g.Windows.Data[pos_wnd], &g.Windows.Data[pos_wnd + 1], copy_bytes);
- g.Windows[pos_beh - 1] = window;
- }
- else
- {
- size_t copy_bytes = (pos_wnd - pos_beh) * sizeof(ImGuiWindow*);
- memmove(&g.Windows.Data[pos_beh + 1], &g.Windows.Data[pos_beh], copy_bytes);
- g.Windows[pos_beh] = window;
- }
-}
-int ImGui::FindWindowDisplayIndex(ImGuiWindow* window)
-{
- ImGuiContext& g = *GImGui;
- return g.Windows.index_from_ptr(g.Windows.find(window));
-}
+ // Error handling, state recovery
+ if (g.IO.ConfigErrorRecovery)
+ ErrorRecoveryTryToRecoverWindowState(&window_stack_data.StackSizesInBegin);
-// Moving window to front of display and set focus (which happens to be back of our sorted list)
-void ImGui::FocusWindow(ImGuiWindow* window)
-{
- ImGuiContext& g = *GImGui;
-
- if (g.NavWindow != window)
- {
- SetNavWindow(window);
- if (window && g.NavDisableMouseHover)
- g.NavMousePosDirty = true;
- g.NavId = window ? window->NavLastIds[0] : 0; // Restore NavId
- g.NavLayer = ImGuiNavLayer_Main;
- g.NavFocusScopeId = window ? window->NavRootFocusScopeId : 0;
- g.NavIdIsAlive = false;
-
- // Close popups if any
- ClosePopupsOverWindow(window, false);
- }
-
- // Move the root window to the top of the pile
- IM_ASSERT(window == NULL || window->RootWindow != NULL);
- ImGuiWindow* focus_front_window = window ? window->RootWindow : NULL; // NB: In docking branch this is window->RootWindowDockStop
- ImGuiWindow* display_front_window = window ? window->RootWindow : NULL;
-
- // Steal active widgets. Some of the cases it triggers includes:
- // - Focus a window while an InputText in another window is active, if focus happens before the old InputText can run.
- // - When using Nav to activate menu items (due to timing of activating on press->new window appears->losing ActiveId)
- if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != focus_front_window)
- if (!g.ActiveIdNoClearOnFocusLoss)
- ClearActiveID();
-
- // Passing NULL allow to disable keyboard focus
- if (!window)
- return;
-
- // Bring to front
- BringWindowToFocusFront(focus_front_window);
- if (((window->Flags | display_front_window->Flags) & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0)
- BringWindowToDisplayFront(display_front_window);
-}
-
-void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window)
-{
- ImGuiContext& g = *GImGui;
- int start_idx = g.WindowsFocusOrder.Size - 1;
- if (under_this_window != NULL)
- {
- // Aim at root window behind us, if we are in a child window that's our own root (see #4640)
- int offset = -1;
- while (under_this_window->Flags & ImGuiWindowFlags_ChildWindow)
- {
- under_this_window = under_this_window->ParentWindow;
- offset = 0;
- }
- start_idx = FindWindowFocusIndex(under_this_window) + offset;
- }
- for (int i = start_idx; i >= 0; i--)
- {
- // We may later decide to test for different NoXXXInputs based on the active navigation input (mouse vs nav) but that may feel more confusing to the user.
- ImGuiWindow* window = g.WindowsFocusOrder[i];
- IM_ASSERT(window == window->RootWindow);
- if (window != ignore_window && window->WasActive)
- if ((window->Flags & (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) != (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs))
- {
- ImGuiWindow* focus_window = NavRestoreLastChildNavWindow(window);
- FocusWindow(focus_window);
- return;
- }
- }
- FocusWindow(NULL);
+ g.CurrentWindowStack.pop_back();
+ SetCurrentWindow(g.CurrentWindowStack.Size == 0 ? NULL : g.CurrentWindowStack.back().Window);
}
// Important: this alone doesn't alter current ImDrawList state. This is called by PushFont/PopFont only.
@@ -7184,30 +7859,45 @@ void ImGui::SetCurrentFont(ImFont* font)
g.Font = font;
g.FontBaseSize = ImMax(1.0f, g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale);
g.FontSize = g.CurrentWindow ? g.CurrentWindow->CalcFontSize() : 0.0f;
+ g.FontScale = g.FontSize / g.Font->FontSize;
ImFontAtlas* atlas = g.Font->ContainerAtlas;
g.DrawListSharedData.TexUvWhitePixel = atlas->TexUvWhitePixel;
g.DrawListSharedData.TexUvLines = atlas->TexUvLines;
g.DrawListSharedData.Font = g.Font;
g.DrawListSharedData.FontSize = g.FontSize;
+ g.DrawListSharedData.FontScale = g.FontScale;
}
+// Use ImDrawList::_SetTextureID(), making our shared g.FontStack[] authorative against window-local ImDrawList.
+// - Whereas ImDrawList::PushTextureID()/PopTextureID() is not to be used across Begin() calls.
+// - Note that we don't propagate current texture id when e.g. Begin()-ing into a new window, we never really did...
+// - Some code paths never really fully worked with multiple atlas textures.
+// - The right-ish solution may be to remove _SetTextureID() and make AddText/RenderText lazily call PushTextureID()/PopTextureID()
+// the same way AddImage() does, but then all other primitives would also need to? I don't think we should tackle this problem
+// because we have a concrete need and a test bed for multiple atlas textures.
void ImGui::PushFont(ImFont* font)
{
ImGuiContext& g = *GImGui;
- if (!font)
+ if (font == NULL)
font = GetDefaultFont();
- SetCurrentFont(font);
g.FontStack.push_back(font);
- g.CurrentWindow->DrawList->PushTextureID(font->ContainerAtlas->TexID);
+ SetCurrentFont(font);
+ g.CurrentWindow->DrawList->_SetTextureID(font->ContainerAtlas->TexID);
}
void ImGui::PopFont()
{
ImGuiContext& g = *GImGui;
- g.CurrentWindow->DrawList->PopTextureID();
+ if (g.FontStack.Size <= 0)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling PopFont() too many times!");
+ return;
+ }
g.FontStack.pop_back();
- SetCurrentFont(g.FontStack.empty() ? GetDefaultFont() : g.FontStack.back());
+ ImFont* font = g.FontStack.Size == 0 ? GetDefaultFont() : g.FontStack.back();
+ SetCurrentFont(font);
+ g.CurrentWindow->DrawList->_SetTextureID(font->ContainerAtlas->TexID);
}
void ImGui::PushItemFlag(ImGuiItemFlags option, bool enabled)
@@ -7226,7 +7916,11 @@ void ImGui::PushItemFlag(ImGuiItemFlags option, bool enabled)
void ImGui::PopItemFlag()
{
ImGuiContext& g = *GImGui;
- IM_ASSERT(g.ItemFlagsStack.Size > 1); // Too many calls to PopItemFlag() - we always leave a 0 at the bottom of the stack.
+ if (g.ItemFlagsStack.Size <= 1)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling PopItemFlag() too many times!");
+ return;
+ }
g.ItemFlagsStack.pop_back();
g.CurrentItemFlags = g.ItemFlagsStack.back();
}
@@ -7235,8 +7929,9 @@ void ImGui::PopItemFlag()
// - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled)
// - Visually this is currently altering alpha, but it is expected that in a future styling system this would work differently.
// - Feedback welcome at https://github.com/ocornut/imgui/issues/211
-// - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(False)/EndDisabled() best to avoid it.
-// - Optimized shortcuts instead of PushStyleVar() + PushItemFlag()
+// - BeginDisabled(false)/EndDisabled() essentially does nothing but is provided to facilitate use of boolean expressions.
+// (as a micro-optimization: if you have tens of thousands of BeginDisabled(false)/EndDisabled() pairs, you might want to reformulate your code to avoid making those calls)
+// - Note: mixing up BeginDisabled() and PushItemFlag(ImGuiItemFlags_Disabled) is currently NOT SUPPORTED.
void ImGui::BeginDisabled(bool disabled)
{
ImGuiContext& g = *GImGui;
@@ -7248,14 +7943,18 @@ void ImGui::BeginDisabled(bool disabled)
}
if (was_disabled || disabled)
g.CurrentItemFlags |= ImGuiItemFlags_Disabled;
- g.ItemFlagsStack.push_back(g.CurrentItemFlags);
+ g.ItemFlagsStack.push_back(g.CurrentItemFlags); // FIXME-OPT: can we simply skip this and use DisabledStackSize?
g.DisabledStackSize++;
}
void ImGui::EndDisabled()
{
ImGuiContext& g = *GImGui;
- IM_ASSERT(g.DisabledStackSize > 0);
+ if (g.DisabledStackSize <= 0)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling EndDisabled() too many times!");
+ return;
+ }
g.DisabledStackSize--;
bool was_disabled = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0;
//PopItemFlag();
@@ -7265,37 +7964,47 @@ void ImGui::EndDisabled()
g.Style.Alpha = g.DisabledAlphaBackup; //PopStyleVar();
}
-// FIXME: Look into renaming this once we have settled the new Focus/Activation/TabStop system.
-void ImGui::PushAllowKeyboardFocus(bool allow_keyboard_focus)
-{
- PushItemFlag(ImGuiItemFlags_NoTabStop, !allow_keyboard_focus);
-}
-
-void ImGui::PopAllowKeyboardFocus()
+// Could have been called BeginDisabledDisable() but it didn't want to be award nominated for most awkward function name.
+// Ideally we would use a shared e.g. BeginDisabled()->BeginDisabledEx() but earlier needs to be optimal.
+// The whole code for this is awkward, will reevaluate if we find a way to implement SetNextItemDisabled().
+void ImGui::BeginDisabledOverrideReenable()
{
- PopItemFlag();
-}
-
-void ImGui::PushButtonRepeat(bool repeat)
-{
- PushItemFlag(ImGuiItemFlags_ButtonRepeat, repeat);
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(g.CurrentItemFlags & ImGuiItemFlags_Disabled);
+ g.CurrentWindowStack.back().DisabledOverrideReenableAlphaBackup = g.Style.Alpha;
+ g.Style.Alpha = g.DisabledAlphaBackup;
+ g.CurrentItemFlags &= ~ImGuiItemFlags_Disabled;
+ g.ItemFlagsStack.push_back(g.CurrentItemFlags);
+ g.DisabledStackSize++;
}
-void ImGui::PopButtonRepeat()
+void ImGui::EndDisabledOverrideReenable()
{
- PopItemFlag();
+ ImGuiContext& g = *GImGui;
+ g.DisabledStackSize--;
+ IM_ASSERT(g.DisabledStackSize > 0);
+ g.ItemFlagsStack.pop_back();
+ g.CurrentItemFlags = g.ItemFlagsStack.back();
+ g.Style.Alpha = g.CurrentWindowStack.back().DisabledOverrideReenableAlphaBackup;
}
void ImGui::PushTextWrapPos(float wrap_pos_x)
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
window->DC.TextWrapPosStack.push_back(window->DC.TextWrapPos);
window->DC.TextWrapPos = wrap_pos_x;
}
void ImGui::PopTextWrapPos()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ if (window->DC.TextWrapPosStack.Size <= 0)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling PopTextWrapPos() too many times!");
+ return;
+ }
window->DC.TextWrapPos = window->DC.TextWrapPosStack.back();
window->DC.TextWrapPosStack.pop_back();
}
@@ -7362,10 +8071,15 @@ bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_b
return false;
}
+// Is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See ImGuiHoveredFlags_ for options.
+// IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app,
+// you should not use this function! Use the 'io.WantCaptureMouse' boolean for that!
+// Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details.
bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags)
{
- IM_ASSERT((flags & (ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled)) == 0); // Flags not supported by this function
ImGuiContext& g = *GImGui;
+ IM_ASSERT_USER_ERROR((flags & ~ImGuiHoveredFlags_AllowedMaskForIsWindowHovered) == 0, "Invalid flags for IsWindowHovered()!");
+
ImGuiWindow* ref_window = g.HoveredWindow;
ImGuiWindow* cur_window = g.CurrentWindow;
if (ref_window == NULL)
@@ -7392,37 +8106,18 @@ bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags)
if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem))
if (g.ActiveId != 0 && !g.ActiveIdAllowOverlap && g.ActiveId != ref_window->MoveId)
return false;
- return true;
-}
-bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags)
-{
- ImGuiContext& g = *GImGui;
- ImGuiWindow* ref_window = g.NavWindow;
- ImGuiWindow* cur_window = g.CurrentWindow;
-
- if (ref_window == NULL)
+ // When changing hovered window we requires a bit of stationary delay before activating hover timer.
+ // FIXME: We don't support delay other than stationary one for now, other delay would need a way
+ // to fulfill the possibility that multiple IsWindowHovered() with varying flag could return true
+ // for different windows of the hierarchy. Possibly need a Hash(Current+Flags) ==> (Timer) cache.
+ // We can implement this for _Stationary because the data is linked to HoveredWindow rather than CurrentWindow.
+ if (flags & ImGuiHoveredFlags_ForTooltip)
+ flags = ApplyHoverFlagsForTooltip(flags, g.Style.HoverFlagsForTooltipMouse);
+ if ((flags & ImGuiHoveredFlags_Stationary) != 0 && g.HoverWindowUnlockedStationaryId != ref_window->ID)
return false;
- if (flags & ImGuiFocusedFlags_AnyWindow)
- return true;
-
- IM_ASSERT(cur_window); // Not inside a Begin()/End()
- const bool popup_hierarchy = (flags & ImGuiFocusedFlags_NoPopupHierarchy) == 0;
- if (flags & ImGuiHoveredFlags_RootWindow)
- cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy);
-
- if (flags & ImGuiHoveredFlags_ChildWindows)
- return IsWindowChildOf(ref_window, cur_window, popup_hierarchy);
- else
- return (ref_window == cur_window);
-}
-// Can we focus this window with CTRL+TAB (or PadMenu + PadFocusPrev/PadFocusNext)
-// Note that NoNavFocus makes the window not reachable with CTRL+TAB but it can still be focused with mouse or programmatically.
-// If you want a window to never be focused, you may use the e.g. NoInputs flag.
-bool ImGui::IsWindowNavFocusable(ImGuiWindow* window)
-{
- return window->WasActive && window == window->RootWindow && !(window->Flags & ImGuiWindowFlags_NoNavFocus);
+ return true;
}
float ImGui::GetWindowWidth()
@@ -7456,7 +8151,7 @@ void ImGui::SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond)
// Set
const ImVec2 old_pos = window->Pos;
- window->Pos = ImFloor(pos);
+ window->Pos = ImTrunc(pos);
ImVec2 offset = window->Pos - old_pos;
if (offset.x == 0.0f && offset.y == 0.0f)
return;
@@ -7494,18 +8189,22 @@ void ImGui::SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond con
IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags.
window->SetWindowSizeAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing);
+ // Enable auto-fit (not done in BeginChild() path unless appearing or combined with ImGuiChildFlags_AlwaysAutoResize)
+ if ((window->Flags & ImGuiWindowFlags_ChildWindow) == 0 || window->Appearing || (window->ChildFlags & ImGuiChildFlags_AlwaysAutoResize) != 0)
+ window->AutoFitFramesX = (size.x <= 0.0f) ? 2 : 0;
+ if ((window->Flags & ImGuiWindowFlags_ChildWindow) == 0 || window->Appearing || (window->ChildFlags & ImGuiChildFlags_AlwaysAutoResize) != 0)
+ window->AutoFitFramesY = (size.y <= 0.0f) ? 2 : 0;
+
// Set
ImVec2 old_size = window->SizeFull;
- window->AutoFitFramesX = (size.x <= 0.0f) ? 2 : 0;
- window->AutoFitFramesY = (size.y <= 0.0f) ? 2 : 0;
if (size.x <= 0.0f)
window->AutoFitOnlyGrows = false;
else
- window->SizeFull.x = IM_FLOOR(size.x);
+ window->SizeFull.x = IM_TRUNC(size.x);
if (size.y <= 0.0f)
window->AutoFitOnlyGrows = false;
else
- window->SizeFull.y = IM_FLOOR(size.y);
+ window->SizeFull.y = IM_TRUNC(size.y);
if (old_size.x != window->SizeFull.x || old_size.y != window->SizeFull.y)
MarkIniSettingsDirty(window);
}
@@ -7539,6 +8238,12 @@ void ImGui::SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const I
window->HitTestHoleOffset = ImVec2ih(pos - window->Pos);
}
+void ImGui::SetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window)
+{
+ window->Hidden = window->SkipItems = true;
+ window->HiddenFramesCanSkipItems = 1;
+}
+
void ImGui::SetWindowCollapsed(bool collapsed, ImGuiCond cond)
{
SetWindowCollapsed(GImGui->CurrentWindow, collapsed, cond);
@@ -7562,29 +8267,11 @@ void ImGui::SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond)
SetWindowCollapsed(window, collapsed, cond);
}
-void ImGui::SetWindowFocus()
-{
- FocusWindow(GImGui->CurrentWindow);
-}
-
-void ImGui::SetWindowFocus(const char* name)
-{
- if (name)
- {
- if (ImGuiWindow* window = FindWindowByName(name))
- FocusWindow(window);
- }
- else
- {
- FocusWindow(NULL);
- }
-}
-
void ImGui::SetNextWindowPos(const ImVec2& pos, ImGuiCond cond, const ImVec2& pivot)
{
ImGuiContext& g = *GImGui;
IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags.
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasPos;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasPos;
g.NextWindowData.PosVal = pos;
g.NextWindowData.PosPivotVal = pivot;
g.NextWindowData.PosCond = cond ? cond : ImGuiCond_Always;
@@ -7594,15 +8281,19 @@ void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiCond cond)
{
ImGuiContext& g = *GImGui;
IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags.
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasSize;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasSize;
g.NextWindowData.SizeVal = size;
g.NextWindowData.SizeCond = cond ? cond : ImGuiCond_Always;
}
+// For each axis:
+// - Use 0.0f as min or FLT_MAX as max if you don't want limits, e.g. size_min = (500.0f, 0.0f), size_max = (FLT_MAX, FLT_MAX) sets a minimum width.
+// - Use -1 for both min and max of same axis to preserve current size which itself is a constraint.
+// - See "Demo->Examples->Constrained-resizing window" for examples.
void ImGui::SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback, void* custom_callback_user_data)
{
ImGuiContext& g = *GImGui;
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasSizeConstraint;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasSizeConstraint;
g.NextWindowData.SizeConstraintRect = ImRect(size_min, size_max);
g.NextWindowData.SizeCallback = custom_callback;
g.NextWindowData.SizeCallbackUserData = custom_callback_user_data;
@@ -7613,14 +8304,14 @@ void ImGui::SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& s
void ImGui::SetNextWindowContentSize(const ImVec2& size)
{
ImGuiContext& g = *GImGui;
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasContentSize;
- g.NextWindowData.ContentSizeVal = ImFloor(size);
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasContentSize;
+ g.NextWindowData.ContentSizeVal = ImTrunc(size);
}
void ImGui::SetNextWindowScroll(const ImVec2& scroll)
{
ImGuiContext& g = *GImGui;
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasScroll;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasScroll;
g.NextWindowData.ScrollVal = scroll;
}
@@ -7628,22 +8319,24 @@ void ImGui::SetNextWindowCollapsed(bool collapsed, ImGuiCond cond)
{
ImGuiContext& g = *GImGui;
IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags.
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasCollapsed;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasCollapsed;
g.NextWindowData.CollapsedVal = collapsed;
g.NextWindowData.CollapsedCond = cond ? cond : ImGuiCond_Always;
}
-void ImGui::SetNextWindowFocus()
+void ImGui::SetNextWindowBgAlpha(float alpha)
{
ImGuiContext& g = *GImGui;
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasFocus;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasBgAlpha;
+ g.NextWindowData.BgAlphaVal = alpha;
}
-void ImGui::SetNextWindowBgAlpha(float alpha)
+// This is experimental and meant to be a toy for exploring a future/wider range of features.
+void ImGui::SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags)
{
ImGuiContext& g = *GImGui;
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasBgAlpha;
- g.NextWindowData.BgAlphaVal = alpha;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasRefreshPolicy;
+ g.NextWindowData.RefreshFlagsVal = flags;
}
ImDrawList* ImGui::GetWindowDrawList()
@@ -7674,37 +8367,92 @@ void ImGui::SetWindowFontScale(float scale)
ImGuiWindow* window = GetCurrentWindow();
window->FontWindowScale = scale;
g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize();
-}
-
-void ImGui::ActivateItem(ImGuiID id)
-{
- ImGuiContext& g = *GImGui;
- g.NavNextActivateId = id;
- g.NavNextActivateFlags = ImGuiActivateFlags_None;
+ g.FontScale = g.DrawListSharedData.FontScale = g.FontSize / g.Font->FontSize;
}
void ImGui::PushFocusScope(ImGuiID id)
{
ImGuiContext& g = *GImGui;
- g.FocusScopeStack.push_back(id);
+ ImGuiFocusScopeData data;
+ data.ID = id;
+ data.WindowID = g.CurrentWindow->ID;
+ g.FocusScopeStack.push_back(data);
g.CurrentFocusScopeId = id;
}
void ImGui::PopFocusScope()
{
ImGuiContext& g = *GImGui;
- IM_ASSERT(g.FocusScopeStack.Size > 0); // Too many PopFocusScope() ?
+ if (g.FocusScopeStack.Size <= g.StackSizesInBeginForCurrentWindow->SizeOfFocusScopeStack)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling PopFocusScope() too many times!");
+ return;
+ }
g.FocusScopeStack.pop_back();
- g.CurrentFocusScopeId = g.FocusScopeStack.Size ? g.FocusScopeStack.back() : 0;
+ g.CurrentFocusScopeId = g.FocusScopeStack.Size ? g.FocusScopeStack.back().ID : 0;
+}
+
+void ImGui::SetNavFocusScope(ImGuiID focus_scope_id)
+{
+ ImGuiContext& g = *GImGui;
+ g.NavFocusScopeId = focus_scope_id;
+ g.NavFocusRoute.resize(0); // Invalidate
+ if (focus_scope_id == 0)
+ return;
+ IM_ASSERT(g.NavWindow != NULL);
+
+ // Store current path (in reverse order)
+ if (focus_scope_id == g.CurrentFocusScopeId)
+ {
+ // Top of focus stack contains local focus scopes inside current window
+ for (int n = g.FocusScopeStack.Size - 1; n >= 0 && g.FocusScopeStack.Data[n].WindowID == g.CurrentWindow->ID; n--)
+ g.NavFocusRoute.push_back(g.FocusScopeStack.Data[n]);
+ }
+ else if (focus_scope_id == g.NavWindow->NavRootFocusScopeId)
+ g.NavFocusRoute.push_back({ focus_scope_id, g.NavWindow->ID });
+ else
+ return;
+
+ // Then follow on manually set ParentWindowForFocusRoute field (#6798)
+ for (ImGuiWindow* window = g.NavWindow->ParentWindowForFocusRoute; window != NULL; window = window->ParentWindowForFocusRoute)
+ g.NavFocusRoute.push_back({ window->NavRootFocusScopeId, window->ID });
+ IM_ASSERT(g.NavFocusRoute.Size < 100); // Maximum depth is technically 251 as per CalcRoutingScore(): 254 - 3
+}
+
+// Focus = move navigation cursor, set scrolling, set focus window.
+void ImGui::FocusItem()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ IMGUI_DEBUG_LOG_FOCUS("FocusItem(0x%08x) in window \"%s\"\n", g.LastItemData.ID, window->Name);
+ if (g.DragDropActive || g.MovingWindow != NULL) // FIXME: Opt-in flags for this?
+ {
+ IMGUI_DEBUG_LOG_FOCUS("FocusItem() ignored while DragDropActive!\n");
+ return;
+ }
+
+ ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_FocusApi | ImGuiNavMoveFlags_NoSetNavCursorVisible | ImGuiNavMoveFlags_NoSelect;
+ ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY;
+ SetNavWindow(window);
+ NavMoveRequestSubmit(ImGuiDir_None, ImGuiDir_Up, move_flags, scroll_flags);
+ NavMoveRequestResolveWithLastItem(&g.NavMoveResultLocal);
+}
+
+void ImGui::ActivateItemByID(ImGuiID id)
+{
+ ImGuiContext& g = *GImGui;
+ g.NavNextActivateId = id;
+ g.NavNextActivateFlags = ImGuiActivateFlags_None;
}
// Note: this will likely be called ActivateItem() once we rework our Focus/Activation system!
+// But ActivateItem() should function without altering scroll/focus?
void ImGui::SetKeyboardFocusHere(int offset)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
IM_ASSERT(offset >= -1); // -1 is allowed but not below
- IMGUI_DEBUG_LOG_ACTIVEID("SetKeyboardFocusHere(%d) in window \"%s\"\n", offset, window->Name);
+ IMGUI_DEBUG_LOG_FOCUS("SetKeyboardFocusHere(%d) in window \"%s\"\n", offset, window->Name);
// It makes sense in the vast majority of cases to never interrupt a drag and drop.
// When we refactor this function into ActivateItem() we may want to make this an option.
@@ -7712,14 +8460,15 @@ void ImGui::SetKeyboardFocusHere(int offset)
// is also automatically dropped in the event g.ActiveId is stolen.
if (g.DragDropActive || g.MovingWindow != NULL)
{
- IMGUI_DEBUG_LOG_ACTIVEID("SetKeyboardFocusHere() ignored while DragDropActive!\n");
+ IMGUI_DEBUG_LOG_FOCUS("SetKeyboardFocusHere() ignored while DragDropActive!\n");
return;
}
SetNavWindow(window);
+ ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_Activate | ImGuiNavMoveFlags_FocusApi | ImGuiNavMoveFlags_NoSetNavCursorVisible;
ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY;
- NavMoveRequestSubmit(ImGuiDir_None, offset < 0 ? ImGuiDir_Up : ImGuiDir_Down, ImGuiNavMoveFlags_Tabbing | ImGuiNavMoveFlags_FocusApi, scroll_flags); // FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
+ NavMoveRequestSubmit(ImGuiDir_None, offset < 0 ? ImGuiDir_Up : ImGuiDir_Down, move_flags, scroll_flags); // FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
if (offset == -1)
{
NavMoveRequestResolveWithLastItem(&g.NavMoveResultLocal);
@@ -7737,16 +8486,15 @@ void ImGui::SetItemDefaultFocus()
ImGuiWindow* window = g.CurrentWindow;
if (!window->Appearing)
return;
- if (g.NavWindow != window->RootWindowForNav || (!g.NavInitRequest && g.NavInitResultId == 0) || g.NavLayer != window->DC.NavLayerCurrent)
+ if (g.NavWindow != window->RootWindowForNav || (!g.NavInitRequest && g.NavInitResult.ID == 0) || g.NavLayer != window->DC.NavLayerCurrent)
return;
g.NavInitRequest = false;
- g.NavInitResultId = g.LastItemData.ID;
- g.NavInitResultRectRel = WindowRectAbsToRel(window, g.LastItemData.Rect);
+ NavApplyItemToResult(&g.NavInitResult);
NavUpdateAnyRequestFlag();
// Scroll could be done in NavInitRequestApplyResult() via an opt-in flag (we however don't want regular init requests to scroll)
- if (!IsItemVisible())
+ if (!window->ClipRect.Contains(g.LastItemData.Rect))
ScrollToRectEx(window, g.LastItemData.Rect, ImGuiScrollFlags_None);
}
@@ -7762,6 +8510,80 @@ ImGuiStorage* ImGui::GetStateStorage()
return window->DC.StateStorage;
}
+bool ImGui::IsRectVisible(const ImVec2& size)
+{
+ ImGuiWindow* window = GImGui->CurrentWindow;
+ return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size));
+}
+
+bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max)
+{
+ ImGuiWindow* window = GImGui->CurrentWindow;
+ return window->ClipRect.Overlaps(ImRect(rect_min, rect_max));
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] ID STACK
+//-----------------------------------------------------------------------------
+
+// This is one of the very rare legacy case where we use ImGuiWindow methods,
+// it should ideally be flattened at some point but it's been used a lots by widgets.
+IM_MSVC_RUNTIME_CHECKS_OFF
+ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end)
+{
+ ImGuiID seed = IDStack.back();
+ ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ ImGuiContext& g = *Ctx;
+ if (g.DebugHookIdInfo == id)
+ ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
+#endif
+ return id;
+}
+
+ImGuiID ImGuiWindow::GetID(const void* ptr)
+{
+ ImGuiID seed = IDStack.back();
+ ImGuiID id = ImHashData(&ptr, sizeof(void*), seed);
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ ImGuiContext& g = *Ctx;
+ if (g.DebugHookIdInfo == id)
+ ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL);
+#endif
+ return id;
+}
+
+ImGuiID ImGuiWindow::GetID(int n)
+{
+ ImGuiID seed = IDStack.back();
+ ImGuiID id = ImHashData(&n, sizeof(n), seed);
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ ImGuiContext& g = *Ctx;
+ if (g.DebugHookIdInfo == id)
+ ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
+#endif
+ return id;
+}
+
+// This is only used in rare/specific situations to manufacture an ID out of nowhere.
+// FIXME: Consider instead storing last non-zero ID + count of successive zero-ID, and combine those?
+ImGuiID ImGuiWindow::GetIDFromPos(const ImVec2& p_abs)
+{
+ ImGuiID seed = IDStack.back();
+ ImVec2 p_rel = ImGui::WindowPosAbsToRel(this, p_abs);
+ ImGuiID id = ImHashData(&p_rel, sizeof(p_rel), seed);
+ return id;
+}
+
+// "
+ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)
+{
+ ImGuiID seed = IDStack.back();
+ ImRect r_rel = ImGui::WindowRectAbsToRel(this, r_abs);
+ ImGuiID id = ImHashData(&r_rel, sizeof(r_rel), seed);
+ return id;
+}
+
void ImGui::PushID(const char* str_id)
{
ImGuiContext& g = *GImGui;
@@ -7799,27 +8621,46 @@ void ImGui::PushOverrideID(ImGuiID id)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
if (g.DebugHookIdInfo == id)
DebugHookIdInfo(id, ImGuiDataType_ID, NULL, NULL);
+#endif
window->IDStack.push_back(id);
}
// Helper to avoid a common series of PushOverrideID -> GetID() -> PopID() call
-// (note that when using this pattern, TestEngine's "Stack Tool" will tend to not display the intermediate stack level.
+// (note that when using this pattern, ID Stack Tool will tend to not display the intermediate stack level.
// for that to work we would need to do PushOverrideID() -> ItemAdd() -> PopID() which would alter widget code a little more)
ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed)
{
ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
ImGuiContext& g = *GImGui;
if (g.DebugHookIdInfo == id)
DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
+#endif
+ return id;
+}
+
+ImGuiID ImGui::GetIDWithSeed(int n, ImGuiID seed)
+{
+ ImGuiID id = ImHashData(&n, sizeof(n), seed);
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ ImGuiContext& g = *GImGui;
+ if (g.DebugHookIdInfo == id)
+ DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
+#endif
return id;
}
void ImGui::PopID()
{
ImGuiWindow* window = GImGui->CurrentWindow;
- IM_ASSERT(window->IDStack.Size > 1); // Too many PopID(), or could be popping in a wrong/different window?
+ if (window->IDStack.Size <= 1)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling PopID() too many times!");
+ return;
+ }
window->IDStack.pop_back();
}
@@ -7841,75 +8682,114 @@ ImGuiID ImGui::GetID(const void* ptr_id)
return window->GetID(ptr_id);
}
-bool ImGui::IsRectVisible(const ImVec2& size)
-{
- ImGuiWindow* window = GImGui->CurrentWindow;
- return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size));
-}
-
-bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max)
+ImGuiID ImGui::GetID(int int_id)
{
ImGuiWindow* window = GImGui->CurrentWindow;
- return window->ClipRect.Overlaps(ImRect(rect_min, rect_max));
+ return window->GetID(int_id);
}
-
+IM_MSVC_RUNTIME_CHECKS_RESTORE
//-----------------------------------------------------------------------------
// [SECTION] INPUTS
//-----------------------------------------------------------------------------
+// - GetModForLRModKey() [Internal]
+// - FixupKeyChord() [Internal]
+// - GetKeyData() [Internal]
+// - GetKeyIndex() [Internal]
+// - GetKeyName()
+// - GetKeyChordName() [Internal]
+// - CalcTypematicRepeatAmount() [Internal]
+// - GetTypematicRepeatRate() [Internal]
+// - GetKeyPressedAmount() [Internal]
+// - GetKeyMagnitude2d() [Internal]
+//-----------------------------------------------------------------------------
+// - UpdateKeyRoutingTable() [Internal]
+// - GetRoutingIdFromOwnerId() [Internal]
+// - GetShortcutRoutingData() [Internal]
+// - CalcRoutingScore() [Internal]
+// - SetShortcutRouting() [Internal]
+// - TestShortcutRouting() [Internal]
+//-----------------------------------------------------------------------------
+// - IsKeyDown()
+// - IsKeyPressed()
+// - IsKeyReleased()
+//-----------------------------------------------------------------------------
+// - IsMouseDown()
+// - IsMouseClicked()
+// - IsMouseReleased()
+// - IsMouseDoubleClicked()
+// - GetMouseClickedCount()
+// - IsMouseHoveringRect() [Internal]
+// - IsMouseDragPastThreshold() [Internal]
+// - IsMouseDragging()
+// - GetMousePos()
+// - SetMousePos() [Internal]
+// - GetMousePosOnOpeningCurrentPopup()
+// - IsMousePosValid()
+// - IsAnyMouseDown()
+// - GetMouseDragDelta()
+// - ResetMouseDragDelta()
+// - GetMouseCursor()
+// - SetMouseCursor()
+//-----------------------------------------------------------------------------
+// - UpdateAliasKey()
+// - GetMergedModsFromKeys()
+// - UpdateKeyboardInputs()
+// - UpdateMouseInputs()
+//-----------------------------------------------------------------------------
+// - LockWheelingWindow [Internal]
+// - FindBestWheelingWindow [Internal]
+// - UpdateMouseWheel() [Internal]
+//-----------------------------------------------------------------------------
+// - SetNextFrameWantCaptureKeyboard()
+// - SetNextFrameWantCaptureMouse()
+//-----------------------------------------------------------------------------
+// - GetInputSourceName() [Internal]
+// - DebugPrintInputEvent() [Internal]
+// - UpdateInputEvents() [Internal]
+//-----------------------------------------------------------------------------
+// - GetKeyOwner() [Internal]
+// - TestKeyOwner() [Internal]
+// - SetKeyOwner() [Internal]
+// - SetItemKeyOwner() [Internal]
+// - Shortcut() [Internal]
+//-----------------------------------------------------------------------------
-// Test if mouse cursor is hovering given rectangle
-// NB- Rectangle is clipped by our current clip setting
-// NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding)
-bool ImGui::IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip)
+static ImGuiKeyChord GetModForLRModKey(ImGuiKey key)
{
- ImGuiContext& g = *GImGui;
-
- // Clip
- ImRect rect_clipped(r_min, r_max);
- if (clip)
- rect_clipped.ClipWith(g.CurrentWindow->ClipRect);
+ if (key == ImGuiKey_LeftCtrl || key == ImGuiKey_RightCtrl)
+ return ImGuiMod_Ctrl;
+ if (key == ImGuiKey_LeftShift || key == ImGuiKey_RightShift)
+ return ImGuiMod_Shift;
+ if (key == ImGuiKey_LeftAlt || key == ImGuiKey_RightAlt)
+ return ImGuiMod_Alt;
+ if (key == ImGuiKey_LeftSuper || key == ImGuiKey_RightSuper)
+ return ImGuiMod_Super;
+ return ImGuiMod_None;
+}
- // Expand for touch input
- const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Style.TouchExtraPadding);
- if (!rect_for_touch.Contains(g.IO.MousePos))
- return false;
- return true;
+ImGuiKeyChord ImGui::FixupKeyChord(ImGuiKeyChord key_chord)
+{
+ // Add ImGuiMod_XXXX when a corresponding ImGuiKey_LeftXXX/ImGuiKey_RightXXX is specified.
+ ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
+ if (IsLRModKey(key))
+ key_chord |= GetModForLRModKey(key);
+ return key_chord;
}
-ImGuiKeyData* ImGui::GetKeyData(ImGuiKey key)
+ImGuiKeyData* ImGui::GetKeyData(ImGuiContext* ctx, ImGuiKey key)
{
- ImGuiContext& g = *GImGui;
+ ImGuiContext& g = *ctx;
// Special storage location for mods
if (key & ImGuiMod_Mask_)
key = ConvertSingleModFlagToKey(key);
- int index;
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- IM_ASSERT(key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_NamedKey_END);
- if (IsLegacyKey(key))
- index = (g.IO.KeyMap[key] != -1) ? g.IO.KeyMap[key] : key; // Remap native->imgui or imgui->native
- else
- index = key;
-#else
IM_ASSERT(IsNamedKey(key) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend & user code.");
- index = key - ImGuiKey_NamedKey_BEGIN;
-#endif
- return &g.IO.KeysData[index];
+ return &g.IO.KeysData[key - ImGuiKey_NamedKey_BEGIN];
}
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
-ImGuiKey ImGui::GetKeyIndex(ImGuiKey key)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(IsNamedKey(key));
- const ImGuiKeyData* key_data = GetKeyData(key);
- return (ImGuiKey)(key_data - g.IO.KeysData);
-}
-#endif
-
-// Those names a provided for debugging purpose and are not meant to be saved persistently not compared.
+// Those names are provided for debugging purpose and are not meant to be saved persistently nor compared.
static const char* const GKeyNames[] =
{
"Tab", "LeftArrow", "RightArrow", "UpArrow", "DownArrow", "PageUp", "PageDown",
@@ -7918,11 +8798,13 @@ static const char* const GKeyNames[] =
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H",
"I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
+ "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24",
"Apostrophe", "Comma", "Minus", "Period", "Slash", "Semicolon", "Equal", "LeftBracket",
"Backslash", "RightBracket", "GraveAccent", "CapsLock", "ScrollLock", "NumLock", "PrintScreen",
"Pause", "Keypad0", "Keypad1", "Keypad2", "Keypad3", "Keypad4", "Keypad5", "Keypad6",
"Keypad7", "Keypad8", "Keypad9", "KeypadDecimal", "KeypadDivide", "KeypadMultiply",
"KeypadSubtract", "KeypadAdd", "KeypadEnter", "KeypadEqual",
+ "AppBack", "AppForward", "Oem102",
"GamepadStart", "GamepadBack",
"GamepadFaceLeft", "GamepadFaceRight", "GamepadFaceUp", "GamepadFaceDown",
"GamepadDpadLeft", "GamepadDpadRight", "GamepadDpadUp", "GamepadDpadDown",
@@ -7936,20 +8818,9 @@ IM_STATIC_ASSERT(ImGuiKey_NamedKey_COUNT == IM_ARRAYSIZE(GKeyNames));
const char* ImGui::GetKeyName(ImGuiKey key)
{
-#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
- IM_ASSERT((IsNamedKey(key) || key == ImGuiKey_None) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code.");
-#else
- if (IsLegacyKey(key))
- {
- ImGuiIO& io = GetIO();
- if (io.KeyMap[key] == -1)
- return "N/A";
- IM_ASSERT(IsNamedKey((ImGuiKey)io.KeyMap[key]));
- key = (ImGuiKey)io.KeyMap[key];
- }
-#endif
if (key == ImGuiKey_None)
return "None";
+ IM_ASSERT(IsNamedKeyOrMod(key) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code.");
if (key & ImGuiMod_Mask_)
key = ConvertSingleModFlagToKey(key);
if (!IsNamedKey(key))
@@ -7958,15 +8829,26 @@ const char* ImGui::GetKeyName(ImGuiKey key)
return GKeyNames[key - ImGuiKey_NamedKey_BEGIN];
}
-void ImGui::GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size)
+// Return untranslated names: on macOS, Cmd key will show as Ctrl, Ctrl key will show as super.
+// Lifetime of return value: valid until next call to same function.
+const char* ImGui::GetKeyChordName(ImGuiKeyChord key_chord)
{
ImGuiContext& g = *GImGui;
- ImFormatString(out_buf, (size_t)out_buf_size, "%s%s%s%s%s",
+
+ const ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
+ if (IsLRModKey(key))
+ key_chord &= ~GetModForLRModKey(key); // Return "Ctrl+LeftShift" instead of "Ctrl+Shift+LeftShift"
+ ImFormatString(g.TempKeychordName, IM_ARRAYSIZE(g.TempKeychordName), "%s%s%s%s%s",
(key_chord & ImGuiMod_Ctrl) ? "Ctrl+" : "",
(key_chord & ImGuiMod_Shift) ? "Shift+" : "",
(key_chord & ImGuiMod_Alt) ? "Alt+" : "",
- (key_chord & ImGuiMod_Super) ? (g.IO.ConfigMacOSXBehaviors ? "Cmd+" : "Super+") : "",
- GetKeyName((ImGuiKey)(key_chord & ~ImGuiMod_Mask_)));
+ (key_chord & ImGuiMod_Super) ? "Super+" : "",
+ (key != ImGuiKey_None || key_chord == ImGuiKey_None) ? GetKeyName(key) : "");
+ size_t len;
+ if (key == ImGuiKey_None && key_chord != 0)
+ if ((len = ImStrlen(g.TempKeychordName)) != 0) // Remove trailing '+'
+ g.TempKeychordName[len - 1] = 0;
+ return g.TempKeychordName;
}
// t0 = previous time (e.g.: g.Time - g.IO.DeltaTime)
@@ -8011,18 +8893,62 @@ int ImGui::GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float repeat_ra
}
// Return 2D vector representing the combination of four cardinal direction, with analog value support (for e.g. ImGuiKey_GamepadLStick* values).
-ImVec2 ImGui::GetKeyVector2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down)
+ImVec2 ImGui::GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down)
{
return ImVec2(
GetKeyData(key_right)->AnalogValue - GetKeyData(key_left)->AnalogValue,
GetKeyData(key_down)->AnalogValue - GetKeyData(key_up)->AnalogValue);
}
+// Rewrite routing data buffers to strip old entries + sort by key to make queries not touch scattered data.
+// Entries D,A,B,B,A,C,B --> A,A,B,B,B,C,D
+// Index A:1 B:2 C:5 D:0 --> A:0 B:2 C:5 D:6
+// See 'Metrics->Key Owners & Shortcut Routing' to visualize the result of that operation.
+static void ImGui::UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt)
+{
+ ImGuiContext& g = *GImGui;
+ rt->EntriesNext.resize(0);
+ for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1))
+ {
+ const int new_routing_start_idx = rt->EntriesNext.Size;
+ ImGuiKeyRoutingData* routing_entry;
+ for (int old_routing_idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; old_routing_idx != -1; old_routing_idx = routing_entry->NextEntryIndex)
+ {
+ routing_entry = &rt->Entries[old_routing_idx];
+ routing_entry->RoutingCurrScore = routing_entry->RoutingNextScore;
+ routing_entry->RoutingCurr = routing_entry->RoutingNext; // Update entry
+ routing_entry->RoutingNext = ImGuiKeyOwner_NoOwner;
+ routing_entry->RoutingNextScore = 255;
+ if (routing_entry->RoutingCurr == ImGuiKeyOwner_NoOwner)
+ continue;
+ rt->EntriesNext.push_back(*routing_entry); // Write alive ones into new buffer
+
+ // Apply routing to owner if there's no owner already (RoutingCurr == None at this point)
+ // This is the result of previous frame's SetShortcutRouting() call.
+ if (routing_entry->Mods == g.IO.KeyMods)
+ {
+ ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key);
+ if (owner_data->OwnerCurr == ImGuiKeyOwner_NoOwner)
+ {
+ owner_data->OwnerCurr = routing_entry->RoutingCurr;
+ //IMGUI_DEBUG_LOG("SetKeyOwner(%s, owner_id=0x%08X) via Routing\n", GetKeyName(key), routing_entry->RoutingCurr);
+ }
+ }
+ }
+
+ // Rewrite linked-list
+ rt->Index[key - ImGuiKey_NamedKey_BEGIN] = (ImGuiKeyRoutingIndex)(new_routing_start_idx < rt->EntriesNext.Size ? new_routing_start_idx : -1);
+ for (int n = new_routing_start_idx; n < rt->EntriesNext.Size; n++)
+ rt->EntriesNext[n].NextEntryIndex = (ImGuiKeyRoutingIndex)((n + 1 < rt->EntriesNext.Size) ? n + 1 : -1);
+ }
+ rt->Entries.swap(rt->EntriesNext); // Swap new and old indexes
+}
+
// owner_id may be None/Any, but routing_id needs to be always be set, so we default to GetCurrentFocusScope().
static inline ImGuiID GetRoutingIdFromOwnerId(ImGuiID owner_id)
{
ImGuiContext& g = *GImGui;
- return (owner_id != ImGuiKeyOwner_None && owner_id != ImGuiKeyOwner_Any) ? owner_id : g.CurrentFocusScopeId;
+ return (owner_id != ImGuiKeyOwner_NoOwner && owner_id != ImGuiKeyOwner_Any) ? owner_id : g.CurrentFocusScopeId;
}
ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord)
@@ -8062,20 +8988,18 @@ ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord)
}
// Current score encoding (lower is highest priority):
-// - 0: ImGuiInputFlags_RouteGlobalHigh
-// - 1: ImGuiInputFlags_RouteFocused (if item active)
-// - 2: ImGuiInputFlags_RouteGlobal
+// - 0: ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverActive
+// - 1: ImGuiInputFlags_ActiveItem or ImGuiInputFlags_RouteFocused (if item active)
+// - 2: ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverFocused
// - 3+: ImGuiInputFlags_RouteFocused (if window in focus-stack)
-// - 254: ImGuiInputFlags_RouteGlobalLow
+// - 254: ImGuiInputFlags_RouteGlobal
// - 255: never route
// 'flags' should include an explicit routing policy
-static int CalcRoutingScore(ImGuiWindow* location, ImGuiID owner_id, ImGuiInputFlags flags)
+static int CalcRoutingScore(ImGuiID focus_scope_id, ImGuiID owner_id, ImGuiInputFlags flags)
{
+ ImGuiContext& g = *GImGui;
if (flags & ImGuiInputFlags_RouteFocused)
{
- ImGuiContext& g = *GImGui;
- ImGuiWindow* focused = g.NavWindow;
-
// ActiveID gets top priority
// (we don't check g.ActiveIdUsingAllKeys here. Routing is applied but if input ownership is tested later it may discard it)
if (owner_id != 0 && g.ActiveId == owner_id)
@@ -8087,65 +9011,139 @@ static int CalcRoutingScore(ImGuiWindow* location, ImGuiID owner_id, ImGuiInputF
// - When Window/ChildB is focused -> Window scores 4, Window/ChildB scores 3 (best)
// Assuming only WindowA is submitting a routing request,
// - When Window/ChildB is focused -> Window scores 4 (best), Window/ChildB doesn't have a score.
- if (focused != NULL && focused->RootWindow == location->RootWindow)
- for (int next_score = 3; focused != NULL; next_score++)
- {
- if (focused == location)
- {
- IM_ASSERT(next_score < 255);
- return next_score;
- }
- focused = (focused->RootWindow != focused) ? focused->ParentWindow : NULL; // FIXME: This could be later abstracted as a focus path
- }
+ // This essentially follow the window->ParentWindowForFocusRoute chain.
+ if (focus_scope_id == 0)
+ return 255;
+ for (int index_in_focus_path = 0; index_in_focus_path < g.NavFocusRoute.Size; index_in_focus_path++)
+ if (g.NavFocusRoute.Data[index_in_focus_path].ID == focus_scope_id)
+ return 3 + index_in_focus_path;
return 255;
}
-
- // ImGuiInputFlags_RouteGlobalHigh is default, so calls without flags are not conditional
- if (flags & ImGuiInputFlags_RouteGlobal)
- return 2;
- if (flags & ImGuiInputFlags_RouteGlobalLow)
+ else if (flags & ImGuiInputFlags_RouteActive)
+ {
+ if (owner_id != 0 && g.ActiveId == owner_id)
+ return 1;
+ return 255;
+ }
+ else if (flags & ImGuiInputFlags_RouteGlobal)
+ {
+ if (flags & ImGuiInputFlags_RouteOverActive)
+ return 0;
+ if (flags & ImGuiInputFlags_RouteOverFocused)
+ return 2;
return 254;
+ }
+ IM_ASSERT(0);
return 0;
}
+// - We need this to filter some Shortcut() routes when an item e.g. an InputText() is active
+// e.g. ImGuiKey_G won't be considered a shortcut when item is active, but ImGuiMod|ImGuiKey_G can be.
+// - This is also used by UpdateInputEvents() to avoid trickling in the most common case of e.g. pressing ImGuiKey_G also emitting a G character.
+static bool IsKeyChordPotentiallyCharInput(ImGuiKeyChord key_chord)
+{
+ // Mimic 'ignore_char_inputs' logic in InputText()
+ ImGuiContext& g = *GImGui;
+
+ // When the right mods are pressed it cannot be a char input so we won't filter the shortcut out.
+ ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_);
+ const bool ignore_char_inputs = ((mods & ImGuiMod_Ctrl) && !(mods & ImGuiMod_Alt)) || (g.IO.ConfigMacOSXBehaviors && (mods & ImGuiMod_Ctrl));
+ if (ignore_char_inputs)
+ return false;
+
+ // Return true for A-Z, 0-9 and other keys associated to char inputs. Other keys such as F1-F12 won't be filtered.
+ ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
+ if (key == ImGuiKey_None)
+ return false;
+ return g.KeysMayBeCharInput.TestBit(key);
+}
+
// Request a desired route for an input chord (key + mods).
// Return true if the route is available this frame.
// - Routes and key ownership are attributed at the beginning of next frame based on best score and mod state.
// (Conceptually this does a "Submit for next frame" + "Test for current frame".
// As such, it could be called TrySetXXX or SubmitXXX, or the Submit and Test operations should be separate.)
-// - Using 'owner_id == ImGuiKeyOwner_Any/0': auto-assign an owner based on current focus scope (each window has its focus scope by default)
-// - Using 'owner_id == ImGuiKeyOwner_None': allows disabling/locking a shortcut.
-bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags)
+bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id)
{
ImGuiContext& g = *GImGui;
- if ((flags & ImGuiInputFlags_RouteMask_) == 0)
- flags |= ImGuiInputFlags_RouteGlobalHigh; // IMPORTANT: This is the default for SetShortcutRouting() but NOT Shortcut()
+ if ((flags & ImGuiInputFlags_RouteTypeMask_) == 0)
+ flags |= ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive; // IMPORTANT: This is the default for SetShortcutRouting() but NOT Shortcut()
else
- IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiInputFlags_RouteMask_)); // Check that only 1 routing flag is used
+ IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiInputFlags_RouteTypeMask_)); // Check that only 1 routing flag is used
+ IM_ASSERT(owner_id != ImGuiKeyOwner_Any && owner_id != ImGuiKeyOwner_NoOwner);
+ if (flags & (ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused))
+ IM_ASSERT(flags & ImGuiInputFlags_RouteGlobal);
+
+ // Add ImGuiMod_XXXX when a corresponding ImGuiKey_LeftXXX/ImGuiKey_RightXXX is specified.
+ key_chord = FixupKeyChord(key_chord);
+
+ // [DEBUG] Debug break requested by user
+ if (g.DebugBreakInShortcutRouting == key_chord)
+ IM_DEBUG_BREAK();
if (flags & ImGuiInputFlags_RouteUnlessBgFocused)
if (g.NavWindow == NULL)
return false;
+
+ // Note how ImGuiInputFlags_RouteAlways won't set routing and thus won't set owner. May want to rework this?
if (flags & ImGuiInputFlags_RouteAlways)
+ {
+ IMGUI_DEBUG_LOG_INPUTROUTING("SetShortcutRouting(%s, flags=%04X, owner_id=0x%08X) -> always, no register\n", GetKeyChordName(key_chord), flags, owner_id);
return true;
+ }
+
+ // Specific culling when there's an active item.
+ if (g.ActiveId != 0 && g.ActiveId != owner_id)
+ {
+ if (flags & ImGuiInputFlags_RouteActive)
+ return false;
- const int score = CalcRoutingScore(g.CurrentWindow, owner_id, flags);
+ // Cull shortcuts with no modifiers when it could generate a character.
+ // e.g. Shortcut(ImGuiKey_G) also generates 'g' character, should not trigger when InputText() is active.
+ // but Shortcut(Ctrl+G) should generally trigger when InputText() is active.
+ // TL;DR: lettered shortcut with no mods or with only Alt mod will not trigger while an item reading text input is active.
+ // (We cannot filter based on io.InputQueueCharacters[] contents because of trickling and key<>chars submission order are undefined)
+ if (g.IO.WantTextInput && IsKeyChordPotentiallyCharInput(key_chord))
+ {
+ IMGUI_DEBUG_LOG_INPUTROUTING("SetShortcutRouting(%s, flags=%04X, owner_id=0x%08X) -> filtered as potential char input\n", GetKeyChordName(key_chord), flags, owner_id);
+ return false;
+ }
+
+ // ActiveIdUsingAllKeyboardKeys trumps all for ActiveId
+ if ((flags & ImGuiInputFlags_RouteOverActive) == 0 && g.ActiveIdUsingAllKeyboardKeys)
+ {
+ ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
+ if (key == ImGuiKey_None)
+ key = ConvertSingleModFlagToKey((ImGuiKey)(key_chord & ImGuiMod_Mask_));
+ if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END)
+ return false;
+ }
+ }
+
+ // Where do we evaluate route for?
+ ImGuiID focus_scope_id = g.CurrentFocusScopeId;
+ if (flags & ImGuiInputFlags_RouteFromRootWindow)
+ focus_scope_id = g.CurrentWindow->RootWindow->ID; // See PushFocusScope() call in Begin()
+
+ const int score = CalcRoutingScore(focus_scope_id, owner_id, flags);
+ IMGUI_DEBUG_LOG_INPUTROUTING("SetShortcutRouting(%s, flags=%04X, owner_id=0x%08X) -> score %d\n", GetKeyChordName(key_chord), flags, owner_id, score);
if (score == 255)
return false;
// Submit routing for NEXT frame (assuming score is sufficient)
// FIXME: Could expose a way to use a "serve last" policy for same score resolution (using <= instead of <).
ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord);
- const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id);
//const bool set_route = (flags & ImGuiInputFlags_ServeLast) ? (score <= routing_data->RoutingNextScore) : (score < routing_data->RoutingNextScore);
if (score < routing_data->RoutingNextScore)
{
- routing_data->RoutingNext = routing_id;
+ routing_data->RoutingNext = owner_id;
routing_data->RoutingNextScore = (ImU8)score;
}
// Return routing state for CURRENT frame
- return routing_data->RoutingCurr == routing_id;
+ if (routing_data->RoutingCurr == owner_id)
+ IMGUI_DEBUG_LOG_INPUTROUTING("--> granting current route\n");
+ return routing_data->RoutingCurr == owner_id;
}
// Currently unused by core (but used by tests)
@@ -8153,7 +9151,8 @@ bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiI
bool ImGui::TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id)
{
const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id);
- ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord);
+ key_chord = FixupKeyChord(key_chord);
+ ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord); // FIXME: Could avoid creating entry.
return routing_data->RoutingCurr == routing_id;
}
@@ -8176,11 +9175,11 @@ bool ImGui::IsKeyDown(ImGuiKey key, ImGuiID owner_id)
bool ImGui::IsKeyPressed(ImGuiKey key, bool repeat)
{
- return IsKeyPressed(key, ImGuiKeyOwner_Any, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None);
+ return IsKeyPressed(key, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None, ImGuiKeyOwner_Any);
}
-// Important: unless legacy IsKeyPressed(ImGuiKey, bool repeat=true) which DEFAULT to repeat, this requires EXPLICIT repeat.
-bool ImGui::IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags)
+// Important: unlike legacy IsKeyPressed(ImGuiKey, bool repeat=true) which DEFAULT to repeat, this requires EXPLICIT repeat.
+bool ImGui::IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id)
{
const ImGuiKeyData* key_data = GetKeyData(key);
if (!key_data->Down) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitates eating mechanism (until we finish work on key ownership)
@@ -8189,13 +9188,28 @@ bool ImGui::IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags)
if (t < 0.0f)
return false;
IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsKeyPressed) == 0); // Passing flags not supported by this function!
+ if (flags & (ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_)) // Setting any _RepeatXXX option enables _Repeat
+ flags |= ImGuiInputFlags_Repeat;
bool pressed = (t == 0.0f);
- if (!pressed && ((flags & ImGuiInputFlags_Repeat) != 0))
+ if (!pressed && (flags & ImGuiInputFlags_Repeat) != 0)
{
float repeat_delay, repeat_rate;
GetTypematicRepeatRate(flags, &repeat_delay, &repeat_rate);
pressed = (t > repeat_delay) && GetKeyPressedAmount(key, repeat_delay, repeat_rate) > 0;
+ if (pressed && (flags & ImGuiInputFlags_RepeatUntilMask_))
+ {
+ // Slightly bias 'key_pressed_time' as DownDuration is an accumulation of DeltaTime which we compare to an absolute time value.
+ // Ideally we'd replace DownDuration with KeyPressedTime but it would break user's code.
+ ImGuiContext& g = *GImGui;
+ double key_pressed_time = g.Time - t + 0.00001f;
+ if ((flags & ImGuiInputFlags_RepeatUntilKeyModsChange) && (g.LastKeyModsChangeTime > key_pressed_time))
+ pressed = false;
+ if ((flags & ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone) && (g.LastKeyModsChangeFromNoneTime > key_pressed_time))
+ pressed = false;
+ if ((flags & ImGuiInputFlags_RepeatUntilOtherKeyPress) && (g.LastKeyboardKeyPressTime > key_pressed_time))
+ pressed = false;
+ }
}
if (!pressed)
return false;
@@ -8235,10 +9249,10 @@ bool ImGui::IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id)
bool ImGui::IsMouseClicked(ImGuiMouseButton button, bool repeat)
{
- return IsMouseClicked(button, ImGuiKeyOwner_Any, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None);
+ return IsMouseClicked(button, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None, ImGuiKeyOwner_Any);
}
-bool ImGui::IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags)
+bool ImGui::IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id)
{
ImGuiContext& g = *GImGui;
IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
@@ -8247,7 +9261,7 @@ bool ImGui::IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInput
const float t = g.IO.MouseDownDuration[button];
if (t < 0.0f)
return false;
- IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsKeyPressed) == 0); // Passing flags not supported by this function!
+ IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsMouseClicked) == 0); // Passing flags not supported by this function! // FIXME: Could support RepeatRate and RepeatUntil flags here.
const bool repeat = (flags & ImGuiInputFlags_Repeat) != 0;
const bool pressed = (t == 0.0f) || (repeat && t > g.IO.KeyRepeatDelay && CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0);
@@ -8274,6 +9288,17 @@ bool ImGui::IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id)
return g.IO.MouseReleased[button] && TestKeyOwner(MouseButtonToKey(button), owner_id); // Should be same as IsKeyReleased(MouseButtonToKey(button), owner_id)
}
+// Use if you absolutely need to distinguish single-click from double-click by introducing a delay.
+// Generally use with 'delay >= io.MouseDoubleClickTime' + combined with a 'io.MouseClickedLastCount == 1' test.
+// This is a very rarely used UI idiom, but some apps use this: e.g. MS Explorer single click on an icon to rename.
+bool ImGui::IsMouseReleasedWithDelay(ImGuiMouseButton button, float delay)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ const float time_since_release = (float)(g.Time - g.IO.MouseReleasedTime[button]);
+ return !IsMouseDown(button) && (time_since_release - g.IO.DeltaTime < delay) && (time_since_release >= delay);
+}
+
bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button)
{
ImGuiContext& g = *GImGui;
@@ -8281,6 +9306,13 @@ bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button)
return g.IO.MouseClickedCount[button] == 2 && TestKeyOwner(MouseButtonToKey(button), ImGuiKeyOwner_Any);
}
+bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ return g.IO.MouseClickedCount[button] == 2 && TestKeyOwner(MouseButtonToKey(button), owner_id);
+}
+
int ImGui::GetMouseClickedCount(ImGuiMouseButton button)
{
ImGuiContext& g = *GImGui;
@@ -8288,6 +9320,24 @@ int ImGui::GetMouseClickedCount(ImGuiMouseButton button)
return g.IO.MouseClickedCount[button];
}
+// Test if mouse cursor is hovering given rectangle
+// NB- Rectangle is clipped by our current clip setting
+// NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding)
+bool ImGui::IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip)
+{
+ ImGuiContext& g = *GImGui;
+
+ // Clip
+ ImRect rect_clipped(r_min, r_max);
+ if (clip)
+ rect_clipped.ClipWith(g.CurrentWindow->ClipRect);
+
+ // Hit testing, expanded for touch input
+ if (!rect_clipped.ContainsWithPad(g.IO.MousePos, g.Style.TouchExtraPadding))
+ return false;
+ return true;
+}
+
// Return if a mouse click/drag went past the given threshold. Valid to call during the MouseReleased frame.
// [Internal] This doesn't test if the button is pressed
bool ImGui::IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold)
@@ -8314,6 +9364,17 @@ ImVec2 ImGui::GetMousePos()
return g.IO.MousePos;
}
+// This is called TeleportMousePos() and not SetMousePos() to emphasis that setting MousePosPrev will effectively clear mouse delta as well.
+// It is expected you only call this if (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos) is set and supported by backend.
+void ImGui::TeleportMousePos(const ImVec2& pos)
+{
+ ImGuiContext& g = *GImGui;
+ g.IO.MousePos = g.IO.MousePosPrev = pos;
+ g.IO.MouseDelta = ImVec2(0.0f, 0.0f);
+ g.IO.WantSetMousePos = true;
+ //IMGUI_DEBUG_LOG_IO("TeleportMousePos: (%.1f,%.1f)\n", io.MousePos.x, io.MousePos.y);
+}
+
// NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed!
ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup()
{
@@ -8378,12 +9439,324 @@ ImGuiMouseCursor ImGui::GetMouseCursor()
return g.MouseCursor;
}
+// We intentionally accept values of ImGuiMouseCursor that are outside our bounds, in case users needs to hack-in a custom cursor value.
+// Custom cursors may be handled by custom backends. If you are using a standard backend and want to hack in a custom cursor, you may
+// handle it before the backend _NewFrame() call and temporarily set ImGuiConfigFlags_NoMouseCursorChange during the backend _NewFrame() call.
void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type)
{
ImGuiContext& g = *GImGui;
g.MouseCursor = cursor_type;
}
+static void UpdateAliasKey(ImGuiKey key, bool v, float analog_value)
+{
+ IM_ASSERT(ImGui::IsAliasKey(key));
+ ImGuiKeyData* key_data = ImGui::GetKeyData(key);
+ key_data->Down = v;
+ key_data->AnalogValue = analog_value;
+}
+
+// [Internal] Do not use directly
+static ImGuiKeyChord GetMergedModsFromKeys()
+{
+ ImGuiKeyChord mods = 0;
+ if (ImGui::IsKeyDown(ImGuiMod_Ctrl)) { mods |= ImGuiMod_Ctrl; }
+ if (ImGui::IsKeyDown(ImGuiMod_Shift)) { mods |= ImGuiMod_Shift; }
+ if (ImGui::IsKeyDown(ImGuiMod_Alt)) { mods |= ImGuiMod_Alt; }
+ if (ImGui::IsKeyDown(ImGuiMod_Super)) { mods |= ImGuiMod_Super; }
+ return mods;
+}
+
+static void ImGui::UpdateKeyboardInputs()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiIO& io = g.IO;
+
+ if (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard)
+ io.ClearInputKeys();
+
+ // Update aliases
+ for (int n = 0; n < ImGuiMouseButton_COUNT; n++)
+ UpdateAliasKey(MouseButtonToKey(n), io.MouseDown[n], io.MouseDown[n] ? 1.0f : 0.0f);
+ UpdateAliasKey(ImGuiKey_MouseWheelX, io.MouseWheelH != 0.0f, io.MouseWheelH);
+ UpdateAliasKey(ImGuiKey_MouseWheelY, io.MouseWheel != 0.0f, io.MouseWheel);
+
+ // Synchronize io.KeyMods and io.KeyCtrl/io.KeyShift/etc. values.
+ // - New backends (1.87+): send io.AddKeyEvent(ImGuiMod_XXX) -> -> (here) deriving io.KeyMods + io.KeyXXX from key array.
+ // - Legacy backends: set io.KeyXXX bools -> (above) set key array from io.KeyXXX -> (here) deriving io.KeyMods + io.KeyXXX from key array.
+ // So with legacy backends the 4 values will do a unnecessary back-and-forth but it makes the code simpler and future facing.
+ const ImGuiKeyChord prev_key_mods = io.KeyMods;
+ io.KeyMods = GetMergedModsFromKeys();
+ io.KeyCtrl = (io.KeyMods & ImGuiMod_Ctrl) != 0;
+ io.KeyShift = (io.KeyMods & ImGuiMod_Shift) != 0;
+ io.KeyAlt = (io.KeyMods & ImGuiMod_Alt) != 0;
+ io.KeySuper = (io.KeyMods & ImGuiMod_Super) != 0;
+ if (prev_key_mods != io.KeyMods)
+ g.LastKeyModsChangeTime = g.Time;
+ if (prev_key_mods != io.KeyMods && prev_key_mods == 0)
+ g.LastKeyModsChangeFromNoneTime = g.Time;
+
+ // Clear gamepad data if disabled
+ if ((io.BackendFlags & ImGuiBackendFlags_HasGamepad) == 0)
+ for (int key = ImGuiKey_Gamepad_BEGIN; key < ImGuiKey_Gamepad_END; key++)
+ {
+ io.KeysData[key - ImGuiKey_NamedKey_BEGIN].Down = false;
+ io.KeysData[key - ImGuiKey_NamedKey_BEGIN].AnalogValue = 0.0f;
+ }
+
+ // Update keys
+ for (int key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key++)
+ {
+ ImGuiKeyData* key_data = &io.KeysData[key - ImGuiKey_NamedKey_BEGIN];
+ key_data->DownDurationPrev = key_data->DownDuration;
+ key_data->DownDuration = key_data->Down ? (key_data->DownDuration < 0.0f ? 0.0f : key_data->DownDuration + io.DeltaTime) : -1.0f;
+ if (key_data->DownDuration == 0.0f)
+ {
+ if (IsKeyboardKey((ImGuiKey)key))
+ g.LastKeyboardKeyPressTime = g.Time;
+ else if (key == ImGuiKey_ReservedForModCtrl || key == ImGuiKey_ReservedForModShift || key == ImGuiKey_ReservedForModAlt || key == ImGuiKey_ReservedForModSuper)
+ g.LastKeyboardKeyPressTime = g.Time;
+ }
+ }
+
+ // Update keys/input owner (named keys only): one entry per key
+ for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1))
+ {
+ ImGuiKeyData* key_data = &io.KeysData[key - ImGuiKey_NamedKey_BEGIN];
+ ImGuiKeyOwnerData* owner_data = &g.KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN];
+ owner_data->OwnerCurr = owner_data->OwnerNext;
+ if (!key_data->Down) // Important: ownership is released on the frame after a release. Ensure a 'MouseDown -> CloseWindow -> MouseUp' chain doesn't lead to someone else seeing the MouseUp.
+ owner_data->OwnerNext = ImGuiKeyOwner_NoOwner;
+ owner_data->LockThisFrame = owner_data->LockUntilRelease = owner_data->LockUntilRelease && key_data->Down; // Clear LockUntilRelease when key is not Down anymore
+ }
+
+ // Update key routing (for e.g. shortcuts)
+ UpdateKeyRoutingTable(&g.KeysRoutingTable);
+}
+
+static void ImGui::UpdateMouseInputs()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiIO& io = g.IO;
+
+ // Mouse Wheel swapping flag
+ // As a standard behavior holding SHIFT while using Vertical Mouse Wheel triggers Horizontal scroll instead
+ // - We avoid doing it on OSX as it the OS input layer handles this already.
+ // - FIXME: However this means when running on OSX over Emscripten, Shift+WheelY will incur two swapping (1 in OS, 1 here), canceling the feature.
+ // - FIXME: When we can distinguish e.g. touchpad scroll events from mouse ones, we'll set this accordingly based on input source.
+ io.MouseWheelRequestAxisSwap = io.KeyShift && !io.ConfigMacOSXBehaviors;
+
+ // Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't support them well)
+ if (IsMousePosValid(&io.MousePos))
+ io.MousePos = g.MouseLastValidPos = ImFloor(io.MousePos);
+
+ // If mouse just appeared or disappeared (usually denoted by -FLT_MAX components) we cancel out movement in MouseDelta
+ if (IsMousePosValid(&io.MousePos) && IsMousePosValid(&io.MousePosPrev))
+ io.MouseDelta = io.MousePos - io.MousePosPrev;
+ else
+ io.MouseDelta = ImVec2(0.0f, 0.0f);
+
+ // Update stationary timer.
+ // FIXME: May need to rework again to have some tolerance for occasional small movement, while being functional on high-framerates.
+ const float mouse_stationary_threshold = (io.MouseSource == ImGuiMouseSource_Mouse) ? 2.0f : 3.0f; // Slightly higher threshold for ImGuiMouseSource_TouchScreen/ImGuiMouseSource_Pen, may need rework.
+ const bool mouse_stationary = (ImLengthSqr(io.MouseDelta) <= mouse_stationary_threshold * mouse_stationary_threshold);
+ g.MouseStationaryTimer = mouse_stationary ? (g.MouseStationaryTimer + io.DeltaTime) : 0.0f;
+ //IMGUI_DEBUG_LOG("%.4f\n", g.MouseStationaryTimer);
+
+ // If mouse moved we re-enable mouse hovering in case it was disabled by keyboard/gamepad. In theory should use a >0.0f threshold but would need to reset in everywhere we set this to true.
+ if (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f)
+ g.NavHighlightItemUnderNav = false;
+
+ for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++)
+ {
+ io.MouseClicked[i] = io.MouseDown[i] && io.MouseDownDuration[i] < 0.0f;
+ io.MouseClickedCount[i] = 0; // Will be filled below
+ io.MouseReleased[i] = !io.MouseDown[i] && io.MouseDownDuration[i] >= 0.0f;
+ if (io.MouseReleased[i])
+ io.MouseReleasedTime[i] = g.Time;
+ io.MouseDownDurationPrev[i] = io.MouseDownDuration[i];
+ io.MouseDownDuration[i] = io.MouseDown[i] ? (io.MouseDownDuration[i] < 0.0f ? 0.0f : io.MouseDownDuration[i] + io.DeltaTime) : -1.0f;
+ if (io.MouseClicked[i])
+ {
+ bool is_repeated_click = false;
+ if ((float)(g.Time - io.MouseClickedTime[i]) < io.MouseDoubleClickTime)
+ {
+ ImVec2 delta_from_click_pos = IsMousePosValid(&io.MousePos) ? (io.MousePos - io.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f);
+ if (ImLengthSqr(delta_from_click_pos) < io.MouseDoubleClickMaxDist * io.MouseDoubleClickMaxDist)
+ is_repeated_click = true;
+ }
+ if (is_repeated_click)
+ io.MouseClickedLastCount[i]++;
+ else
+ io.MouseClickedLastCount[i] = 1;
+ io.MouseClickedTime[i] = g.Time;
+ io.MouseClickedPos[i] = io.MousePos;
+ io.MouseClickedCount[i] = io.MouseClickedLastCount[i];
+ io.MouseDragMaxDistanceSqr[i] = 0.0f;
+ }
+ else if (io.MouseDown[i])
+ {
+ // Maintain the maximum distance we reaching from the initial click position, which is used with dragging threshold
+ float delta_sqr_click_pos = IsMousePosValid(&io.MousePos) ? ImLengthSqr(io.MousePos - io.MouseClickedPos[i]) : 0.0f;
+ io.MouseDragMaxDistanceSqr[i] = ImMax(io.MouseDragMaxDistanceSqr[i], delta_sqr_click_pos);
+ }
+
+ // We provide io.MouseDoubleClicked[] as a legacy service
+ io.MouseDoubleClicked[i] = (io.MouseClickedCount[i] == 2);
+
+ // Clicking any mouse button reactivate mouse hovering which may have been deactivated by keyboard/gamepad navigation
+ if (io.MouseClicked[i])
+ g.NavHighlightItemUnderNav = false;
+ }
+}
+
+static void LockWheelingWindow(ImGuiWindow* window, float wheel_amount)
+{
+ ImGuiContext& g = *GImGui;
+ if (window)
+ g.WheelingWindowReleaseTimer = ImMin(g.WheelingWindowReleaseTimer + ImAbs(wheel_amount) * WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER, WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER);
+ else
+ g.WheelingWindowReleaseTimer = 0.0f;
+ if (g.WheelingWindow == window)
+ return;
+ IMGUI_DEBUG_LOG_IO("[io] LockWheelingWindow() \"%s\"\n", window ? window->Name : "NULL");
+ g.WheelingWindow = window;
+ g.WheelingWindowRefMousePos = g.IO.MousePos;
+ if (window == NULL)
+ {
+ g.WheelingWindowStartFrame = -1;
+ g.WheelingAxisAvg = ImVec2(0.0f, 0.0f);
+ }
+}
+
+static ImGuiWindow* FindBestWheelingWindow(const ImVec2& wheel)
+{
+ // For each axis, find window in the hierarchy that may want to use scrolling
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* windows[2] = { NULL, NULL };
+ for (int axis = 0; axis < 2; axis++)
+ if (wheel[axis] != 0.0f)
+ for (ImGuiWindow* window = windows[axis] = g.HoveredWindow; window->Flags & ImGuiWindowFlags_ChildWindow; window = windows[axis] = window->ParentWindow)
+ {
+ // Bubble up into parent window if:
+ // - a child window doesn't allow any scrolling.
+ // - a child window has the ImGuiWindowFlags_NoScrollWithMouse flag.
+ //// - a child window doesn't need scrolling because it is already at the edge for the direction we are going in (FIXME-WIP)
+ const bool has_scrolling = (window->ScrollMax[axis] != 0.0f);
+ const bool inputs_disabled = (window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs);
+ //const bool scrolling_past_limits = (wheel_v < 0.0f) ? (window->Scroll[axis] <= 0.0f) : (window->Scroll[axis] >= window->ScrollMax[axis]);
+ if (has_scrolling && !inputs_disabled) // && !scrolling_past_limits)
+ break; // select this window
+ }
+ if (windows[0] == NULL && windows[1] == NULL)
+ return NULL;
+
+ // If there's only one window or only one axis then there's no ambiguity
+ if (windows[0] == windows[1] || windows[0] == NULL || windows[1] == NULL)
+ return windows[1] ? windows[1] : windows[0];
+
+ // If candidate are different windows we need to decide which one to prioritize
+ // - First frame: only find a winner if one axis is zero.
+ // - Subsequent frames: only find a winner when one is more than the other.
+ if (g.WheelingWindowStartFrame == -1)
+ g.WheelingWindowStartFrame = g.FrameCount;
+ if ((g.WheelingWindowStartFrame == g.FrameCount && wheel.x != 0.0f && wheel.y != 0.0f) || (g.WheelingAxisAvg.x == g.WheelingAxisAvg.y))
+ {
+ g.WheelingWindowWheelRemainder = wheel;
+ return NULL;
+ }
+ return (g.WheelingAxisAvg.x > g.WheelingAxisAvg.y) ? windows[0] : windows[1];
+}
+
+// Called by NewFrame()
+void ImGui::UpdateMouseWheel()
+{
+ // Reset the locked window if we move the mouse or after the timer elapses.
+ // FIXME: Ideally we could refactor to have one timer for "changing window w/ same axis" and a shorter timer for "changing window or axis w/ other axis" (#3795)
+ ImGuiContext& g = *GImGui;
+ if (g.WheelingWindow != NULL)
+ {
+ g.WheelingWindowReleaseTimer -= g.IO.DeltaTime;
+ if (IsMousePosValid() && ImLengthSqr(g.IO.MousePos - g.WheelingWindowRefMousePos) > g.IO.MouseDragThreshold * g.IO.MouseDragThreshold)
+ g.WheelingWindowReleaseTimer = 0.0f;
+ if (g.WheelingWindowReleaseTimer <= 0.0f)
+ LockWheelingWindow(NULL, 0.0f);
+ }
+
+ ImVec2 wheel;
+ wheel.x = TestKeyOwner(ImGuiKey_MouseWheelX, ImGuiKeyOwner_NoOwner) ? g.IO.MouseWheelH : 0.0f;
+ wheel.y = TestKeyOwner(ImGuiKey_MouseWheelY, ImGuiKeyOwner_NoOwner) ? g.IO.MouseWheel : 0.0f;
+
+ //IMGUI_DEBUG_LOG("MouseWheel X:%.3f Y:%.3f\n", wheel_x, wheel_y);
+ ImGuiWindow* mouse_window = g.WheelingWindow ? g.WheelingWindow : g.HoveredWindow;
+ if (!mouse_window || mouse_window->Collapsed)
+ return;
+
+ // Zoom / Scale window
+ // FIXME-OBSOLETE: This is an old feature, it still works but pretty much nobody is using it and may be best redesigned.
+ if (wheel.y != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling)
+ {
+ LockWheelingWindow(mouse_window, wheel.y);
+ ImGuiWindow* window = mouse_window;
+ const float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f);
+ const float scale = new_font_scale / window->FontWindowScale;
+ window->FontWindowScale = new_font_scale;
+ if (window == window->RootWindow)
+ {
+ const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size;
+ SetWindowPos(window, window->Pos + offset, 0);
+ window->Size = ImTrunc(window->Size * scale);
+ window->SizeFull = ImTrunc(window->SizeFull * scale);
+ }
+ return;
+ }
+ if (g.IO.KeyCtrl)
+ return;
+
+ // Mouse wheel scrolling
+ // Read about io.MouseWheelRequestAxisSwap and its issue on Mac+Emscripten in UpdateMouseInputs()
+ if (g.IO.MouseWheelRequestAxisSwap)
+ wheel = ImVec2(wheel.y, 0.0f);
+
+ // Maintain a rough average of moving magnitude on both axes
+ // FIXME: should by based on wall clock time rather than frame-counter
+ g.WheelingAxisAvg.x = ImExponentialMovingAverage(g.WheelingAxisAvg.x, ImAbs(wheel.x), 30);
+ g.WheelingAxisAvg.y = ImExponentialMovingAverage(g.WheelingAxisAvg.y, ImAbs(wheel.y), 30);
+
+ // In the rare situation where FindBestWheelingWindow() had to defer first frame of wheeling due to ambiguous main axis, reinject it now.
+ wheel += g.WheelingWindowWheelRemainder;
+ g.WheelingWindowWheelRemainder = ImVec2(0.0f, 0.0f);
+ if (wheel.x == 0.0f && wheel.y == 0.0f)
+ return;
+
+ // Mouse wheel scrolling: find target and apply
+ // - don't renew lock if axis doesn't apply on the window.
+ // - select a main axis when both axes are being moved.
+ if (ImGuiWindow* window = (g.WheelingWindow ? g.WheelingWindow : FindBestWheelingWindow(wheel)))
+ if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs))
+ {
+ bool do_scroll[2] = { wheel.x != 0.0f && window->ScrollMax.x != 0.0f, wheel.y != 0.0f && window->ScrollMax.y != 0.0f };
+ if (do_scroll[ImGuiAxis_X] && do_scroll[ImGuiAxis_Y])
+ do_scroll[(g.WheelingAxisAvg.x > g.WheelingAxisAvg.y) ? ImGuiAxis_Y : ImGuiAxis_X] = false;
+ if (do_scroll[ImGuiAxis_X])
+ {
+ LockWheelingWindow(window, wheel.x);
+ float max_step = window->InnerRect.GetWidth() * 0.67f;
+ float scroll_step = ImTrunc(ImMin(2 * window->FontRefSize, max_step));
+ SetScrollX(window, window->Scroll.x - wheel.x * scroll_step);
+ g.WheelingWindowScrolledFrame = g.FrameCount;
+ }
+ if (do_scroll[ImGuiAxis_Y])
+ {
+ LockWheelingWindow(window, wheel.y);
+ float max_step = window->InnerRect.GetHeight() * 0.67f;
+ float scroll_step = ImTrunc(ImMin(5 * window->FontRefSize, max_step));
+ SetScrollY(window, window->Scroll.y - wheel.y * scroll_step);
+ g.WheelingWindowScrolledFrame = g.FrameCount;
+ }
+ }
+}
+
void ImGui::SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard)
{
ImGuiContext& g = *GImGui;
@@ -8399,19 +9772,25 @@ void ImGui::SetNextFrameWantCaptureMouse(bool want_capture_mouse)
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
static const char* GetInputSourceName(ImGuiInputSource source)
{
- const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad", "Nav", "Clipboard" };
+ const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad" };
IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT && source >= 0 && source < ImGuiInputSource_COUNT);
return input_source_names[source];
}
+static const char* GetMouseSourceName(ImGuiMouseSource source)
+{
+ const char* mouse_source_names[] = { "Mouse", "TouchScreen", "Pen" };
+ IM_ASSERT(IM_ARRAYSIZE(mouse_source_names) == ImGuiMouseSource_COUNT && source >= 0 && source < ImGuiMouseSource_COUNT);
+ return mouse_source_names[source];
+}
static void DebugPrintInputEvent(const char* prefix, const ImGuiInputEvent* e)
{
ImGuiContext& g = *GImGui;
- if (e->Type == ImGuiInputEventType_MousePos) { if (e->MousePos.PosX == -FLT_MAX && e->MousePos.PosY == -FLT_MAX) IMGUI_DEBUG_LOG_IO("%s: MousePos (-FLT_MAX, -FLT_MAX)\n", prefix); else IMGUI_DEBUG_LOG_IO("%s: MousePos (%.1f, %.1f)\n", prefix, e->MousePos.PosX, e->MousePos.PosY); return; }
- if (e->Type == ImGuiInputEventType_MouseButton) { IMGUI_DEBUG_LOG_IO("%s: MouseButton %d %s\n", prefix, e->MouseButton.Button, e->MouseButton.Down ? "Down" : "Up"); return; }
- if (e->Type == ImGuiInputEventType_MouseWheel) { IMGUI_DEBUG_LOG_IO("%s: MouseWheel (%.1f, %.1f)\n", prefix, e->MouseWheel.WheelX, e->MouseWheel.WheelY); return; }
- if (e->Type == ImGuiInputEventType_Key) { IMGUI_DEBUG_LOG_IO("%s: Key \"%s\" %s\n", prefix, ImGui::GetKeyName(e->Key.Key), e->Key.Down ? "Down" : "Up"); return; }
- if (e->Type == ImGuiInputEventType_Text) { IMGUI_DEBUG_LOG_IO("%s: Text: %c (U+%08X)\n", prefix, e->Text.Char, e->Text.Char); return; }
- if (e->Type == ImGuiInputEventType_Focus) { IMGUI_DEBUG_LOG_IO("%s: AppFocused %d\n", prefix, e->AppFocused.Focused); return; }
+ if (e->Type == ImGuiInputEventType_MousePos) { if (e->MousePos.PosX == -FLT_MAX && e->MousePos.PosY == -FLT_MAX) IMGUI_DEBUG_LOG_IO("[io] %s: MousePos (-FLT_MAX, -FLT_MAX)\n", prefix); else IMGUI_DEBUG_LOG_IO("[io] %s: MousePos (%.1f, %.1f) (%s)\n", prefix, e->MousePos.PosX, e->MousePos.PosY, GetMouseSourceName(e->MousePos.MouseSource)); return; }
+ if (e->Type == ImGuiInputEventType_MouseButton) { IMGUI_DEBUG_LOG_IO("[io] %s: MouseButton %d %s (%s)\n", prefix, e->MouseButton.Button, e->MouseButton.Down ? "Down" : "Up", GetMouseSourceName(e->MouseButton.MouseSource)); return; }
+ if (e->Type == ImGuiInputEventType_MouseWheel) { IMGUI_DEBUG_LOG_IO("[io] %s: MouseWheel (%.3f, %.3f) (%s)\n", prefix, e->MouseWheel.WheelX, e->MouseWheel.WheelY, GetMouseSourceName(e->MouseWheel.MouseSource)); return; }
+ if (e->Type == ImGuiInputEventType_Key) { IMGUI_DEBUG_LOG_IO("[io] %s: Key \"%s\" %s\n", prefix, ImGui::GetKeyName(e->Key.Key), e->Key.Down ? "Down" : "Up"); return; }
+ if (e->Type == ImGuiInputEventType_Text) { IMGUI_DEBUG_LOG_IO("[io] %s: Text: %c (U+%08X)\n", prefix, e->Text.Char, e->Text.Char); return; }
+ if (e->Type == ImGuiInputEventType_Focus) { IMGUI_DEBUG_LOG_IO("[io] %s: AppFocused %d\n", prefix, e->AppFocused.Focused); return; }
}
#endif
@@ -8427,11 +9806,11 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs)
// Only trickle chars<>key when working with InputText()
// FIXME: InputText() could parse event trail?
// FIXME: Could specialize chars<>keys trickling rules for control keys (those not typically associated to characters)
- const bool trickle_interleaved_keys_and_text = (trickle_fast_inputs && g.WantTextInputNextFrame == 1);
+ const bool trickle_interleaved_nonchar_keys_and_text = (trickle_fast_inputs && g.WantTextInputNextFrame == 1);
- bool mouse_moved = false, mouse_wheeled = false, key_changed = false, text_inputted = false;
+ bool mouse_moved = false, mouse_wheeled = false, key_changed = false, key_changed_nonchar = false, text_inputted = false;
int mouse_button_changed = 0x00;
- ImBitArray<ImGuiKey_KeysData_SIZE> key_changed_mask;
+ ImBitArray<ImGuiKey_NamedKey_COUNT> key_changed_mask;
int event_n = 0;
for (; event_n < g.InputEventsQueue.Size; event_n++)
@@ -8439,11 +9818,14 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs)
ImGuiInputEvent* e = &g.InputEventsQueue[event_n];
if (e->Type == ImGuiInputEventType_MousePos)
{
+ if (g.IO.WantSetMousePos)
+ continue;
// Trickling Rule: Stop processing queued events if we already handled a mouse button change
ImVec2 event_pos(e->MousePos.PosX, e->MousePos.PosY);
if (trickle_fast_inputs && (mouse_button_changed != 0 || mouse_wheeled || key_changed || text_inputted))
break;
io.MousePos = event_pos;
+ io.MouseSource = e->MousePos.MouseSource;
mouse_moved = true;
}
else if (e->Type == ImGuiInputEventType_MouseButton)
@@ -8453,7 +9835,10 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs)
IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT);
if (trickle_fast_inputs && ((mouse_button_changed & (1 << button)) || mouse_wheeled))
break;
+ if (trickle_fast_inputs && e->MouseButton.MouseSource == ImGuiMouseSource_TouchScreen && mouse_moved) // #2702: TouchScreen have no initial hover.
+ break;
io.MouseDown[button] = e->MouseButton.Down;
+ io.MouseSource = e->MouseButton.MouseSource;
mouse_button_changed |= (1 << button);
}
else if (e->Type == ImGuiInputEventType_MouseWheel)
@@ -8463,46 +9848,44 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs)
break;
io.MouseWheelH += e->MouseWheel.WheelX;
io.MouseWheel += e->MouseWheel.WheelY;
+ io.MouseSource = e->MouseWheel.MouseSource;
mouse_wheeled = true;
}
else if (e->Type == ImGuiInputEventType_Key)
{
// Trickling Rule: Stop processing queued events if we got multiple action on the same button
+ if (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard)
+ continue;
ImGuiKey key = e->Key.Key;
IM_ASSERT(key != ImGuiKey_None);
ImGuiKeyData* key_data = GetKeyData(key);
const int key_data_index = (int)(key_data - g.IO.KeysData);
- if (trickle_fast_inputs && key_data->Down != e->Key.Down && (key_changed_mask.TestBit(key_data_index) || text_inputted || mouse_button_changed != 0))
+ if (trickle_fast_inputs && key_data->Down != e->Key.Down && (key_changed_mask.TestBit(key_data_index) || mouse_button_changed != 0))
break;
+
+ const bool key_is_potentially_for_char_input = IsKeyChordPotentiallyCharInput(GetMergedModsFromKeys() | key);
+ if (trickle_interleaved_nonchar_keys_and_text && (text_inputted && !key_is_potentially_for_char_input))
+ break;
+
key_data->Down = e->Key.Down;
key_data->AnalogValue = e->Key.AnalogValue;
key_changed = true;
key_changed_mask.SetBit(key_data_index);
-
- if (key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super)
- {
- if (key == ImGuiMod_Ctrl) { io.KeyCtrl = key_data->Down; }
- if (key == ImGuiMod_Shift) { io.KeyShift = key_data->Down; }
- if (key == ImGuiMod_Alt) { io.KeyAlt = key_data->Down; }
- if (key == ImGuiMod_Super) { io.KeySuper = key_data->Down; }
- io.KeyMods = GetMergedModsFromBools();
- }
-
- // Allow legacy code using io.KeysDown[GetKeyIndex()] with new backends
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- io.KeysDown[key_data_index] = key_data->Down;
- if (io.KeyMap[key_data_index] != -1)
- io.KeysDown[io.KeyMap[key_data_index]] = key_data->Down;
-#endif
+ if (trickle_interleaved_nonchar_keys_and_text && !key_is_potentially_for_char_input)
+ key_changed_nonchar = true;
}
else if (e->Type == ImGuiInputEventType_Text)
{
+ if (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard)
+ continue;
// Trickling Rule: Stop processing queued events if keys/mouse have been interacted with
- if (trickle_fast_inputs && ((key_changed && trickle_interleaved_keys_and_text) || mouse_button_changed != 0 || mouse_moved || mouse_wheeled))
+ if (trickle_fast_inputs && (mouse_button_changed != 0 || mouse_moved || mouse_wheeled))
+ break;
+ if (trickle_interleaved_nonchar_keys_and_text && key_changed_nonchar)
break;
unsigned int c = e->Text.Char;
io.InputQueueCharacters.push_back(c <= IM_UNICODE_CODEPOINT_MAX ? (ImWchar)c : IM_UNICODE_CODEPOINT_INVALID);
- if (trickle_interleaved_keys_and_text)
+ if (trickle_interleaved_nonchar_keys_and_text)
text_inputted = true;
}
else if (e->Type == ImGuiInputEventType_Focus)
@@ -8541,21 +9924,24 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs)
// - we clear in EndFrame() and not now in order allow application/user code polling this flag
// (e.g. custom backend may want to clear additional data, custom widgets may want to react with a "canceling" event).
if (g.IO.AppFocusLost)
+ {
g.IO.ClearInputKeys();
+ g.IO.ClearInputMouse();
+ }
}
ImGuiID ImGui::GetKeyOwner(ImGuiKey key)
{
- if (!IsNamedKeyOrModKey(key))
- return ImGuiKeyOwner_None;
+ if (!IsNamedKeyOrMod(key))
+ return ImGuiKeyOwner_NoOwner;
ImGuiContext& g = *GImGui;
- ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key);
+ ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key);
ImGuiID owner_id = owner_data->OwnerCurr;
if (g.ActiveIdUsingAllKeyboardKeys && owner_id != g.ActiveId && owner_id != ImGuiKeyOwner_Any)
if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END)
- return ImGuiKeyOwner_None;
+ return ImGuiKeyOwner_NoOwner;
return owner_id;
}
@@ -8566,7 +9952,7 @@ ImGuiID ImGui::GetKeyOwner(ImGuiKey key)
// All paths are also testing for key not being locked, for the rare cases that key have been locked with using ImGuiInputFlags_LockXXX flags.
bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id)
{
- if (!IsNamedKeyOrModKey(key))
+ if (!IsNamedKeyOrMod(key))
return true;
ImGuiContext& g = *GImGui;
@@ -8574,7 +9960,7 @@ bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id)
if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END)
return false;
- ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key);
+ ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key);
if (owner_id == ImGuiKeyOwner_Any)
return (owner_data->LockThisFrame == false);
@@ -8585,7 +9971,7 @@ bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id)
{
if (owner_data->LockThisFrame)
return false;
- if (owner_data->OwnerCurr != ImGuiKeyOwner_None)
+ if (owner_data->OwnerCurr != ImGuiKeyOwner_NoOwner)
return false;
}
@@ -8599,10 +9985,12 @@ bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id)
// - SetKeyOwner(..., Any or None, Lock) : set lock
void ImGui::SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags)
{
- IM_ASSERT(IsNamedKeyOrModKey(key) && (owner_id != ImGuiKeyOwner_Any || (flags & (ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease)))); // Can only use _Any with _LockXXX flags (to eat a key away without an ID to retrieve it)
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(IsNamedKeyOrMod(key) && (owner_id != ImGuiKeyOwner_Any || (flags & (ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease)))); // Can only use _Any with _LockXXX flags (to eat a key away without an ID to retrieve it)
IM_ASSERT((flags & ~ImGuiInputFlags_SupportedBySetKeyOwner) == 0); // Passing flags not supported by this function!
+ //IMGUI_DEBUG_LOG("SetKeyOwner(%s, owner_id=0x%08X, flags=%08X)\n", GetKeyName(key), owner_id, flags);
- ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key);
+ ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key);
owner_data->OwnerCurr = owner_data->OwnerNext = owner_id;
// We cannot lock by default as it would likely break lots of legacy code.
@@ -8611,6 +9999,16 @@ void ImGui::SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags)
owner_data->LockThisFrame = (flags & ImGuiInputFlags_LockThisFrame) != 0 || (owner_data->LockUntilRelease);
}
+// Rarely used helper
+void ImGui::SetKeyOwnersForKeyChord(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags)
+{
+ if (key_chord & ImGuiMod_Ctrl) { SetKeyOwner(ImGuiMod_Ctrl, owner_id, flags); }
+ if (key_chord & ImGuiMod_Shift) { SetKeyOwner(ImGuiMod_Shift, owner_id, flags); }
+ if (key_chord & ImGuiMod_Alt) { SetKeyOwner(ImGuiMod_Alt, owner_id, flags); }
+ if (key_chord & ImGuiMod_Super) { SetKeyOwner(ImGuiMod_Super, owner_id, flags); }
+ if (key_chord & ~ImGuiMod_Mask_) { SetKeyOwner((ImGuiKey)(key_chord & ~ImGuiMod_Mask_), owner_id, flags); }
+}
+
// This is more or less equivalent to:
// if (IsItemHovered() || IsItemActive())
// SetKeyOwner(key, GetItemID());
@@ -8632,57 +10030,142 @@ void ImGui::SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags)
}
}
-// - Need to decide how to handle shortcut translations for Non-Mac <> Mac
-// - Ideas: https://github.com/ocornut/imgui/issues/456#issuecomment-264390864
-bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags)
+void ImGui::SetItemKeyOwner(ImGuiKey key)
{
- ImGuiContext& g = *GImGui;
+ SetItemKeyOwner(key, ImGuiInputFlags_None);
+}
- // When using (owner_id == 0/Any): SetShortcutRouting() will use CurrentFocusScopeId and filter with this, so IsKeyPressed() is fine with he 0/Any.
- if ((flags & ImGuiInputFlags_RouteMask_) == 0)
- flags |= ImGuiInputFlags_RouteFocused;
- if (!SetShortcutRouting(key_chord, owner_id, flags))
- return false;
+// This is the only public API until we expose owner_id versions of the API as replacements.
+bool ImGui::IsKeyChordPressed(ImGuiKeyChord key_chord)
+{
+ return IsKeyChordPressed(key_chord, ImGuiInputFlags_None, ImGuiKeyOwner_Any);
+}
- ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
+// This is equivalent to comparing KeyMods + doing a IsKeyPressed()
+bool ImGui::IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id)
+{
+ ImGuiContext& g = *GImGui;
+ key_chord = FixupKeyChord(key_chord);
ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_);
if (g.IO.KeyMods != mods)
return false;
// Special storage location for mods
+ ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
if (key == ImGuiKey_None)
key = ConvertSingleModFlagToKey(mods);
+ if (!IsKeyPressed(key, (flags & ImGuiInputFlags_RepeatMask_), owner_id))
+ return false;
+ return true;
+}
+
+void ImGui::SetNextItemShortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasShortcut;
+ g.NextItemData.Shortcut = key_chord;
+ g.NextItemData.ShortcutFlags = flags;
+}
+
+// Called from within ItemAdd: at this point we can read from NextItemData and write to LastItemData
+void ImGui::ItemHandleShortcut(ImGuiID id)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiInputFlags flags = g.NextItemData.ShortcutFlags;
+ IM_ASSERT((flags & ~ImGuiInputFlags_SupportedBySetNextItemShortcut) == 0); // Passing flags not supported by SetNextItemShortcut()!
- if (!IsKeyPressed(key, owner_id, (flags & (ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_))))
+ if (g.LastItemData.ItemFlags & ImGuiItemFlags_Disabled)
+ return;
+ if (flags & ImGuiInputFlags_Tooltip)
+ {
+ g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HasShortcut;
+ g.LastItemData.Shortcut = g.NextItemData.Shortcut;
+ }
+ if (!Shortcut(g.NextItemData.Shortcut, flags & ImGuiInputFlags_SupportedByShortcut, id) || g.NavActivateId != 0)
+ return;
+
+ // FIXME: Generalize Activation queue?
+ g.NavActivateId = id; // Will effectively disable clipping.
+ g.NavActivateFlags = ImGuiActivateFlags_PreferInput | ImGuiActivateFlags_FromShortcut;
+ //if (g.ActiveId == 0 || g.ActiveId == id)
+ g.NavActivateDownId = g.NavActivatePressedId = id;
+ NavHighlightActivated(id);
+}
+
+bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags)
+{
+ return Shortcut(key_chord, flags, ImGuiKeyOwner_Any);
+}
+
+bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id)
+{
+ ImGuiContext& g = *GImGui;
+ //IMGUI_DEBUG_LOG("Shortcut(%s, flags=%X, owner_id=0x%08X)\n", GetKeyChordName(key_chord, g.TempBuffer.Data, g.TempBuffer.Size), flags, owner_id);
+
+ // When using (owner_id == 0/Any): SetShortcutRouting() will use CurrentFocusScopeId and filter with this, so IsKeyPressed() is fine with he 0/Any.
+ if ((flags & ImGuiInputFlags_RouteTypeMask_) == 0)
+ flags |= ImGuiInputFlags_RouteFocused;
+
+ // Using 'owner_id == ImGuiKeyOwner_Any/0': auto-assign an owner based on current focus scope (each window has its focus scope by default)
+ // Effectively makes Shortcut() always input-owner aware.
+ if (owner_id == ImGuiKeyOwner_Any || owner_id == ImGuiKeyOwner_NoOwner)
+ owner_id = GetRoutingIdFromOwnerId(owner_id);
+
+ if (g.CurrentItemFlags & ImGuiItemFlags_Disabled)
return false;
- IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByShortcut) == 0); // Passing flags not supported by this function!
+ // Submit route
+ if (!SetShortcutRouting(key_chord, flags, owner_id))
+ return false;
+
+ // Default repeat behavior for Shortcut()
+ // So e.g. pressing Ctrl+W and releasing Ctrl while holding W will not trigger the W shortcut.
+ if ((flags & ImGuiInputFlags_Repeat) != 0 && (flags & ImGuiInputFlags_RepeatUntilMask_) == 0)
+ flags |= ImGuiInputFlags_RepeatUntilKeyModsChange;
+
+ if (!IsKeyChordPressed(key_chord, flags, owner_id))
+ return false;
+
+ // Claim mods during the press
+ SetKeyOwnersForKeyChord(key_chord & ImGuiMod_Mask_, owner_id);
+
+ IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByShortcut) == 0); // Passing flags not supported by this function!
return true;
}
-
//-----------------------------------------------------------------------------
-// [SECTION] ERROR CHECKING
+// [SECTION] ERROR CHECKING, STATE RECOVERY
+//-----------------------------------------------------------------------------
+// - DebugCheckVersionAndDataLayout() (called via IMGUI_CHECKVERSION() macros)
+// - ErrorCheckUsingSetCursorPosToExtendParentBoundaries()
+// - ErrorCheckNewFrameSanityChecks()
+// - ErrorCheckEndFrameSanityChecks()
+// - ErrorRecoveryStoreState()
+// - ErrorRecoveryTryToRecoverState()
+// - ErrorRecoveryTryToRecoverWindowState()
+// - ErrorLog()
//-----------------------------------------------------------------------------
-// Helper function to verify ABI compatibility between caller code and compiled version of Dear ImGui.
+// Verify ABI compatibility between caller code and compiled version of Dear ImGui. This helps detects some build issues.
+// Called by IMGUI_CHECKVERSION().
// Verify that the type sizes are matching between the calling file's compilation unit and imgui.cpp's compilation unit
-// If this triggers you have an issue:
-// - Most commonly: mismatched headers and compiled code version.
-// - Or: mismatched configuration #define, compilation settings, packing pragma etc.
-// The configuration settings mentioned in imconfig.h must be set for all compilation units involved with Dear ImGui,
-// which is way it is required you put them in your imconfig file (and not just before including imgui.h).
-// Otherwise it is possible that different compilation units would see different structure layout
+// If this triggers you have mismatched headers and compiled code versions.
+// - It could be because of a build issue (using new headers with old compiled code)
+// - It could be because of mismatched configuration #define, compilation settings, packing pragma etc.
+// THE CONFIGURATION SETTINGS MENTIONED IN imconfig.h MUST BE SET FOR ALL COMPILATION UNITS INVOLVED WITH DEAR IMGUI.
+// Which is why it is required you put them in your imconfig file (and NOT only before including imgui.h).
+// Otherwise it is possible that different compilation units would see different structure layout.
+// If you don't want to modify imconfig.h you can use the IMGUI_USER_CONFIG define to change filename.
bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_vert, size_t sz_idx)
{
bool error = false;
if (strcmp(version, IMGUI_VERSION) != 0) { error = true; IM_ASSERT(strcmp(version, IMGUI_VERSION) == 0 && "Mismatched version string!"); }
- if (sz_io != sizeof(ImGuiIO)) { error = true; IM_ASSERT(sz_io == sizeof(ImGuiIO) && "Mismatched struct layout!"); }
+ if (sz_io != sizeof(ImGuiIO)) { error = true; IM_ASSERT(sz_io == sizeof(ImGuiIO) && "Mismatched struct layout!"); }
if (sz_style != sizeof(ImGuiStyle)) { error = true; IM_ASSERT(sz_style == sizeof(ImGuiStyle) && "Mismatched struct layout!"); }
- if (sz_vec2 != sizeof(ImVec2)) { error = true; IM_ASSERT(sz_vec2 == sizeof(ImVec2) && "Mismatched struct layout!"); }
- if (sz_vec4 != sizeof(ImVec4)) { error = true; IM_ASSERT(sz_vec4 == sizeof(ImVec4) && "Mismatched struct layout!"); }
- if (sz_vert != sizeof(ImDrawVert)) { error = true; IM_ASSERT(sz_vert == sizeof(ImDrawVert) && "Mismatched struct layout!"); }
- if (sz_idx != sizeof(ImDrawIdx)) { error = true; IM_ASSERT(sz_idx == sizeof(ImDrawIdx) && "Mismatched struct layout!"); }
+ if (sz_vec2 != sizeof(ImVec2)) { error = true; IM_ASSERT(sz_vec2 == sizeof(ImVec2) && "Mismatched struct layout!"); }
+ if (sz_vec4 != sizeof(ImVec4)) { error = true; IM_ASSERT(sz_vec4 == sizeof(ImVec4) && "Mismatched struct layout!"); }
+ if (sz_vert != sizeof(ImDrawVert)) { error = true; IM_ASSERT(sz_vert == sizeof(ImDrawVert) && "Mismatched struct layout!"); }
+ if (sz_idx != sizeof(ImDrawIdx)) { error = true; IM_ASSERT(sz_idx == sizeof(ImDrawIdx) && "Mismatched struct layout!"); }
return !error;
}
@@ -8730,6 +10213,13 @@ static void ImGui::ErrorCheckNewFrameSanityChecks()
// #define IM_ASSERT(EXPR) do { if (SomeCode(EXPR)) SomeMoreCode(); } while (0) // Correct!
if (true) IM_ASSERT(1); else IM_ASSERT(0);
+ // Emscripten backends are often imprecise in their submission of DeltaTime. (#6114, #3644)
+ // Ideally the Emscripten app/backend should aim to fix or smooth this value and avoid feeding zero, but we tolerate it.
+#ifdef __EMSCRIPTEN__
+ if (g.IO.DeltaTime <= 0.0f && g.FrameCount > 0)
+ g.IO.DeltaTime = 0.00001f;
+#endif
+
// Check user data
// (We pass an error message in the assert expression to make it visible to programmers who are not using a debugger, as most assert handlers display their argument)
IM_ASSERT(g.Initialized);
@@ -8740,264 +10230,346 @@ static void ImGui::ErrorCheckNewFrameSanityChecks()
IM_ASSERT(g.Style.CurveTessellationTol > 0.0f && "Invalid style setting!");
IM_ASSERT(g.Style.CircleTessellationMaxError > 0.0f && "Invalid style setting!");
IM_ASSERT(g.Style.Alpha >= 0.0f && g.Style.Alpha <= 1.0f && "Invalid style setting!"); // Allows us to avoid a few clamps in color computations
- IM_ASSERT(g.Style.WindowMinSize.x >= 1.0f && g.Style.WindowMinSize.y >= 1.0f && "Invalid style setting.");
+ IM_ASSERT(g.Style.WindowMinSize.x >= 1.0f && g.Style.WindowMinSize.y >= 1.0f && "Invalid style setting!");
+ IM_ASSERT(g.Style.WindowBorderHoverPadding > 0.0f && "Invalid style setting!"); // Required otherwise cannot resize from borders.
IM_ASSERT(g.Style.WindowMenuButtonPosition == ImGuiDir_None || g.Style.WindowMenuButtonPosition == ImGuiDir_Left || g.Style.WindowMenuButtonPosition == ImGuiDir_Right);
IM_ASSERT(g.Style.ColorButtonPosition == ImGuiDir_Left || g.Style.ColorButtonPosition == ImGuiDir_Right);
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_COUNT; n++)
- IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < ImGuiKey_LegacyNativeKey_END && "io.KeyMap[] contains an out of bound value (need to be 0..511, or -1 for unmapped key)");
- // Check: required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was only added in 1.60 WIP)
- if ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && g.IO.BackendUsingLegacyKeyArrays == 1)
- IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation.");
-#endif
+ // Error handling: we do not accept 100% silent recovery! Please contact me if you feel this is getting in your way.
+ if (g.IO.ConfigErrorRecovery)
+ IM_ASSERT(g.IO.ConfigErrorRecoveryEnableAssert || g.IO.ConfigErrorRecoveryEnableDebugLog || g.IO.ConfigErrorRecoveryEnableTooltip || g.ErrorCallback != NULL);
- // Check: the io.ConfigWindowsResizeFromEdges option requires backend to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly.
- if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors))
- g.IO.ConfigWindowsResizeFromEdges = false;
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ // Remap legacy names
+ if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos)
+ {
+ g.IO.ConfigNavMoveSetMousePos = true;
+ g.IO.ConfigFlags &= ~ImGuiConfigFlags_NavEnableSetMousePos;
+ }
+ if (g.IO.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard)
+ {
+ g.IO.ConfigNavCaptureKeyboard = false;
+ g.IO.ConfigFlags &= ~ImGuiConfigFlags_NavNoCaptureKeyboard;
+ }
+
+ // Remap legacy clipboard handlers (OBSOLETED in 1.91.1, August 2024)
+ if (g.IO.GetClipboardTextFn != NULL && (g.PlatformIO.Platform_GetClipboardTextFn == NULL || g.PlatformIO.Platform_GetClipboardTextFn == Platform_GetClipboardTextFn_DefaultImpl))
+ g.PlatformIO.Platform_GetClipboardTextFn = [](ImGuiContext* ctx) { return ctx->IO.GetClipboardTextFn(ctx->IO.ClipboardUserData); };
+ if (g.IO.SetClipboardTextFn != NULL && (g.PlatformIO.Platform_SetClipboardTextFn == NULL || g.PlatformIO.Platform_SetClipboardTextFn == Platform_SetClipboardTextFn_DefaultImpl))
+ g.PlatformIO.Platform_SetClipboardTextFn = [](ImGuiContext* ctx, const char* text) { return ctx->IO.SetClipboardTextFn(ctx->IO.ClipboardUserData, text); };
+#endif
}
static void ImGui::ErrorCheckEndFrameSanityChecks()
{
- ImGuiContext& g = *GImGui;
-
// Verify that io.KeyXXX fields haven't been tampered with. Key mods should not be modified between NewFrame() and EndFrame()
// One possible reason leading to this assert is that your backends update inputs _AFTER_ NewFrame().
// It is known that when some modal native windows called mid-frame takes focus away, some backends such as GLFW will
// send key release events mid-frame. This would normally trigger this assertion and lead to sheared inputs.
- // We silently accommodate for this case by ignoring/ the case where all io.KeyXXX modifiers were released (aka key_mod_flags == 0),
+ // We silently accommodate for this case by ignoring the case where all io.KeyXXX modifiers were released (aka key_mod_flags == 0),
// while still correctly asserting on mid-frame key press events.
- const ImGuiKeyChord key_mods = GetMergedModsFromBools();
+ ImGuiContext& g = *GImGui;
+ const ImGuiKeyChord key_mods = GetMergedModsFromKeys();
+ IM_UNUSED(g);
+ IM_UNUSED(key_mods);
IM_ASSERT((key_mods == 0 || g.IO.KeyMods == key_mods) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods");
IM_UNUSED(key_mods);
- // [EXPERIMENTAL] Recover from errors: You may call this yourself before EndFrame().
- //ErrorCheckEndFrameRecover();
-
- // Report when there is a mismatch of Begin/BeginChild vs End/EndChild calls. Important: Remember that the Begin/BeginChild API requires you
- // to always call End/EndChild even if Begin/BeginChild returns false! (this is unfortunately inconsistent with most other Begin* API).
- if (g.CurrentWindowStack.Size != 1)
- {
- if (g.CurrentWindowStack.Size > 1)
- {
- IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?");
- while (g.CurrentWindowStack.Size > 1)
- End();
- }
- else
- {
- IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you call End/EndChild too much?");
- }
- }
+ IM_ASSERT(g.CurrentWindowStack.Size == 1);
+ IM_ASSERT(g.CurrentWindowStack[0].Window->IsFallbackWindow);
+}
- IM_ASSERT_USER_ERROR(g.GroupStack.Size == 0, "Missing EndGroup call!");
+// Save current stack sizes. Called e.g. by NewFrame() and by Begin() but may be called for manual recovery.
+void ImGui::ErrorRecoveryStoreState(ImGuiErrorRecoveryState* state_out)
+{
+ ImGuiContext& g = *GImGui;
+ state_out->SizeOfWindowStack = (short)g.CurrentWindowStack.Size;
+ state_out->SizeOfIDStack = (short)g.CurrentWindow->IDStack.Size;
+ state_out->SizeOfTreeStack = (short)g.CurrentWindow->DC.TreeDepth; // NOT g.TreeNodeStack.Size which is a partial stack!
+ state_out->SizeOfColorStack = (short)g.ColorStack.Size;
+ state_out->SizeOfStyleVarStack = (short)g.StyleVarStack.Size;
+ state_out->SizeOfFontStack = (short)g.FontStack.Size;
+ state_out->SizeOfFocusScopeStack = (short)g.FocusScopeStack.Size;
+ state_out->SizeOfGroupStack = (short)g.GroupStack.Size;
+ state_out->SizeOfItemFlagsStack = (short)g.ItemFlagsStack.Size;
+ state_out->SizeOfBeginPopupStack = (short)g.BeginPopupStack.Size;
+ state_out->SizeOfDisabledStack = (short)g.DisabledStackSize;
}
-// Experimental recovery from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls.
-// Must be called during or before EndFrame().
-// This is generally flawed as we are not necessarily End/Popping things in the right order.
-// FIXME: Can't recover from inside BeginTabItem/EndTabItem yet.
-// FIXME: Can't recover from interleaved BeginTabBar/Begin
-void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data)
+// Chosen name "Try to recover" over e.g. "Restore" to suggest this is not a 100% guaranteed recovery.
+// Called by e.g. EndFrame() but may be called for manual recovery.
+// Attempt to recover full window stack.
+void ImGui::ErrorRecoveryTryToRecoverState(const ImGuiErrorRecoveryState* state_in)
{
// PVS-Studio V1044 is "Loop break conditions do not depend on the number of iterations"
ImGuiContext& g = *GImGui;
- while (g.CurrentWindowStack.Size > 0) //-V1044
+ while (g.CurrentWindowStack.Size > state_in->SizeOfWindowStack) //-V1044
{
- ErrorCheckEndWindowRecover(log_callback, user_data);
+ // Recap:
+ // - Begin()/BeginChild() return false to indicate the window is collapsed or fully clipped.
+ // - Always call a matching End() for each Begin() call, regardless of its return value!
+ // - Begin/End and BeginChild/EndChild logic is KNOWN TO BE INCONSISTENT WITH ALL OTHER BEGIN/END FUNCTIONS.
+ // - We will fix that in a future major update.
ImGuiWindow* window = g.CurrentWindow;
- if (g.CurrentWindowStack.Size == 1)
- {
- IM_ASSERT(window->IsFallbackWindow);
- break;
- }
if (window->Flags & ImGuiWindowFlags_ChildWindow)
{
- if (log_callback) log_callback(user_data, "Recovered from missing EndChild() for '%s'", window->Name);
- EndChild();
+ if (g.CurrentTable != NULL && g.CurrentTable->InnerWindow == g.CurrentWindow)
+ {
+ IM_ASSERT_USER_ERROR(0, "Missing EndTable()");
+ EndTable();
+ }
+ else
+ {
+ IM_ASSERT_USER_ERROR(0, "Missing EndChild()");
+ EndChild();
+ }
}
else
{
- if (log_callback) log_callback(user_data, "Recovered from missing End() for '%s'", window->Name);
+ IM_ASSERT_USER_ERROR(0, "Missing End()");
End();
}
}
+ if (g.CurrentWindowStack.Size == state_in->SizeOfWindowStack)
+ ErrorRecoveryTryToRecoverWindowState(state_in);
}
-// Must be called before End()/EndChild()
-void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data)
+// Called by e.g. End() but may be called for manual recovery.
+// Read '// Error Handling [BETA]' block in imgui_internal.h for details.
+// Attempt to recover from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls.
+void ImGui::ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in)
{
ImGuiContext& g = *GImGui;
- while (g.CurrentTable && (g.CurrentTable->OuterWindow == g.CurrentWindow || g.CurrentTable->InnerWindow == g.CurrentWindow))
+
+ while (g.CurrentTable != NULL && g.CurrentTable->InnerWindow == g.CurrentWindow) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing EndTable() in '%s'", g.CurrentTable->OuterWindow->Name);
+ IM_ASSERT_USER_ERROR(0, "Missing EndTable()");
EndTable();
}
ImGuiWindow* window = g.CurrentWindow;
- ImGuiStackSizes* stack_sizes = &g.CurrentWindowStack.back().StackSizesOnBegin;
- IM_ASSERT(window != NULL);
- while (g.CurrentTabBar != NULL) //-V1044
+
+ // FIXME: Can't recover from inside BeginTabItem/EndTabItem yet.
+ while (g.CurrentTabBar != NULL && g.CurrentTabBar->Window == window) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing EndTabBar() in '%s'", window->Name);
+ IM_ASSERT_USER_ERROR(0, "Missing EndTabBar()");
EndTabBar();
}
- while (window->DC.TreeDepth > 0)
+ while (g.CurrentMultiSelect != NULL && g.CurrentMultiSelect->Storage->Window == window) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing TreePop() in '%s'", window->Name);
+ IM_ASSERT_USER_ERROR(0, "Missing EndMultiSelect()");
+ EndMultiSelect();
+ }
+ if (window->DC.MenuBarAppending) //-V1044
+ {
+ IM_ASSERT_USER_ERROR(0, "Missing EndMenuBar()");
+ EndMenuBar();
+ }
+ while (window->DC.TreeDepth > state_in->SizeOfTreeStack) //-V1044
+ {
+ IM_ASSERT_USER_ERROR(0, "Missing TreePop()");
TreePop();
}
- while (g.GroupStack.Size > stack_sizes->SizeOfGroupStack) //-V1044
+ while (g.GroupStack.Size > state_in->SizeOfGroupStack) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing EndGroup() in '%s'", window->Name);
+ IM_ASSERT_USER_ERROR(0, "Missing EndGroup()");
EndGroup();
}
- while (window->IDStack.Size > 1)
+ IM_ASSERT(g.GroupStack.Size == state_in->SizeOfGroupStack);
+ while (window->IDStack.Size > state_in->SizeOfIDStack) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing PopID() in '%s'", window->Name);
+ IM_ASSERT_USER_ERROR(0, "Missing PopID()");
PopID();
}
- while (g.DisabledStackSize > stack_sizes->SizeOfDisabledStack) //-V1044
+ while (g.DisabledStackSize > state_in->SizeOfDisabledStack) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing EndDisabled() in '%s'", window->Name);
- EndDisabled();
+ IM_ASSERT_USER_ERROR(0, "Missing EndDisabled()");
+ if (g.CurrentItemFlags & ImGuiItemFlags_Disabled)
+ EndDisabled();
+ else
+ {
+ EndDisabledOverrideReenable();
+ g.CurrentWindowStack.back().DisabledOverrideReenable = false;
+ }
}
- while (g.ColorStack.Size > stack_sizes->SizeOfColorStack)
+ IM_ASSERT(g.DisabledStackSize == state_in->SizeOfDisabledStack);
+ while (g.ColorStack.Size > state_in->SizeOfColorStack) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing PopStyleColor() in '%s' for ImGuiCol_%s", window->Name, GetStyleColorName(g.ColorStack.back().Col));
+ IM_ASSERT_USER_ERROR(0, "Missing PopStyleColor()");
PopStyleColor();
}
- while (g.ItemFlagsStack.Size > stack_sizes->SizeOfItemFlagsStack) //-V1044
+ while (g.ItemFlagsStack.Size > state_in->SizeOfItemFlagsStack) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing PopItemFlag() in '%s'", window->Name);
+ IM_ASSERT_USER_ERROR(0, "Missing PopItemFlag()");
PopItemFlag();
}
- while (g.StyleVarStack.Size > stack_sizes->SizeOfStyleVarStack) //-V1044
+ while (g.StyleVarStack.Size > state_in->SizeOfStyleVarStack) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing PopStyleVar() in '%s'", window->Name);
+ IM_ASSERT_USER_ERROR(0, "Missing PopStyleVar()");
PopStyleVar();
}
- while (g.FocusScopeStack.Size > stack_sizes->SizeOfFocusScopeStack + 1) //-V1044
+ while (g.FontStack.Size > state_in->SizeOfFontStack) //-V1044
+ {
+ IM_ASSERT_USER_ERROR(0, "Missing PopFont()");
+ PopFont();
+ }
+ while (g.FocusScopeStack.Size > state_in->SizeOfFocusScopeStack) //-V1044
{
- if (log_callback) log_callback(user_data, "Recovered from missing PopFocusScope() in '%s'", window->Name);
+ IM_ASSERT_USER_ERROR(0, "Missing PopFocusScope()");
PopFocusScope();
}
+ //IM_ASSERT(g.FocusScopeStack.Size == state_in->SizeOfFocusScopeStack);
}
-// Save current stack sizes for later compare
-void ImGuiStackSizes::SetToCurrentState()
+bool ImGui::ErrorLog(const char* msg)
{
ImGuiContext& g = *GImGui;
+
+ // Output to debug log
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
ImGuiWindow* window = g.CurrentWindow;
- SizeOfIDStack = (short)window->IDStack.Size;
- SizeOfColorStack = (short)g.ColorStack.Size;
- SizeOfStyleVarStack = (short)g.StyleVarStack.Size;
- SizeOfFontStack = (short)g.FontStack.Size;
- SizeOfFocusScopeStack = (short)g.FocusScopeStack.Size;
- SizeOfGroupStack = (short)g.GroupStack.Size;
- SizeOfItemFlagsStack = (short)g.ItemFlagsStack.Size;
- SizeOfBeginPopupStack = (short)g.BeginPopupStack.Size;
- SizeOfDisabledStack = (short)g.DisabledStackSize;
+
+ if (g.IO.ConfigErrorRecoveryEnableDebugLog)
+ {
+ if (g.ErrorFirst)
+ IMGUI_DEBUG_LOG_ERROR("[imgui-error] (current settings: Assert=%d, Log=%d, Tooltip=%d)\n",
+ g.IO.ConfigErrorRecoveryEnableAssert, g.IO.ConfigErrorRecoveryEnableDebugLog, g.IO.ConfigErrorRecoveryEnableTooltip);
+ IMGUI_DEBUG_LOG_ERROR("[imgui-error] In window '%s': %s\n", window ? window->Name : "NULL", msg);
+ }
+ g.ErrorFirst = false;
+
+ // Output to tooltip
+ if (g.IO.ConfigErrorRecoveryEnableTooltip)
+ {
+ if (g.WithinFrameScope && BeginErrorTooltip())
+ {
+ if (g.ErrorCountCurrentFrame < 20)
+ {
+ Text("In window '%s': %s", window ? window->Name : "NULL", msg);
+ if (window && (!window->IsFallbackWindow || window->WasActive))
+ GetForegroundDrawList(window)->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 0, 0, 255));
+ }
+ if (g.ErrorCountCurrentFrame == 20)
+ Text("(and more errors)");
+ // EndFrame() will amend debug buttons to this window, after all errors have been submitted.
+ EndErrorTooltip();
+ }
+ g.ErrorCountCurrentFrame++;
+ }
+#endif
+
+ // Output to callback
+ if (g.ErrorCallback != NULL)
+ g.ErrorCallback(&g, g.ErrorCallbackUserData, msg);
+
+ // Return whether we should assert
+ return g.IO.ConfigErrorRecoveryEnableAssert;
}
-// Compare to detect usage errors
-void ImGuiStackSizes::CompareWithCurrentState()
+void ImGui::ErrorCheckEndFrameFinalizeErrorTooltip()
{
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
- IM_UNUSED(window);
+ if (g.DebugDrawIdConflicts != 0 && g.IO.KeyCtrl == false)
+ g.DebugDrawIdConflictsCount = g.HoveredIdPreviousFrameItemCount;
+ if (g.DebugDrawIdConflicts != 0 && g.DebugItemPickerActive == false && BeginErrorTooltip())
+ {
+ Text("Programmer error: %d visible items with conflicting ID!", g.DebugDrawIdConflictsCount);
+ BulletText("Code should use PushID()/PopID() in loops, or append \"##xx\" to same-label identifiers!");
+ BulletText("Empty label e.g. Button(\"\") == same ID as parent widget/node. Use Button(\"##xx\") instead!");
+ //BulletText("Code intending to use duplicate ID may use e.g. PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag()"); // Not making this too visible for fear of it being abused.
+ BulletText("Set io.ConfigDebugHighlightIdConflicts=false to disable this warning in non-programmers builds.");
+ Separator();
+ if (g.IO.ConfigDebugHighlightIdConflictsShowItemPicker)
+ {
+ Text("(Hold CTRL to: use ");
+ SameLine(0.0f, 0.0f);
+ if (SmallButton("Item Picker"))
+ DebugStartItemPicker();
+ SameLine(0.0f, 0.0f);
+ Text(" to break in item call-stack, or ");
+ }
+ else
+ {
+ Text("(Hold CTRL to ");
+ }
+ SameLine(0.0f, 0.0f);
+ if (SmallButton("Open FAQ->About ID Stack System") && g.PlatformIO.Platform_OpenInShellFn != NULL)
+ g.PlatformIO.Platform_OpenInShellFn(&g, "https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#qa-usage");
+ SameLine(0.0f, 0.0f);
+ Text(")");
+ EndErrorTooltip();
+ }
- // Window stacks
- // NOT checking: DC.ItemWidth, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
- IM_ASSERT(SizeOfIDStack == window->IDStack.Size && "PushID/PopID or TreeNode/TreePop Mismatch!");
+ if (g.ErrorCountCurrentFrame > 0 && BeginErrorTooltip()) // Amend at end of frame
+ {
+ Separator();
+ Text("(Hold CTRL to:");
+ SameLine();
+ if (SmallButton("Enable Asserts"))
+ g.IO.ConfigErrorRecoveryEnableAssert = true;
+ //SameLine();
+ //if (SmallButton("Hide Error Tooltips"))
+ // g.IO.ConfigErrorRecoveryEnableTooltip = false; // Too dangerous
+ SameLine(0, 0);
+ Text(")");
+ EndErrorTooltip();
+ }
+#endif
+}
- // Global stacks
- // For color, style and font stacks there is an incentive to use Push/Begin/Pop/.../End patterns, so we relax our checks a little to allow them.
- IM_ASSERT(SizeOfGroupStack == g.GroupStack.Size && "BeginGroup/EndGroup Mismatch!");
- IM_ASSERT(SizeOfBeginPopupStack == g.BeginPopupStack.Size && "BeginPopup/EndPopup or BeginMenu/EndMenu Mismatch!");
- IM_ASSERT(SizeOfDisabledStack == g.DisabledStackSize && "BeginDisabled/EndDisabled Mismatch!");
- IM_ASSERT(SizeOfItemFlagsStack >= g.ItemFlagsStack.Size && "PushItemFlag/PopItemFlag Mismatch!");
- IM_ASSERT(SizeOfColorStack >= g.ColorStack.Size && "PushStyleColor/PopStyleColor Mismatch!");
- IM_ASSERT(SizeOfStyleVarStack >= g.StyleVarStack.Size && "PushStyleVar/PopStyleVar Mismatch!");
- IM_ASSERT(SizeOfFontStack >= g.FontStack.Size && "PushFont/PopFont Mismatch!");
- IM_ASSERT(SizeOfFocusScopeStack == g.FocusScopeStack.Size && "PushFocusScope/PopFocusScope Mismatch!");
+// Pseudo-tooltip. Follow mouse until CTRL is held. When CTRL is held we lock position, allowing to click it.
+bool ImGui::BeginErrorTooltip()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = FindWindowByName("##Tooltip_Error");
+ const bool use_locked_pos = (g.IO.KeyCtrl && window && window->WasActive);
+ PushStyleColor(ImGuiCol_PopupBg, ImLerp(g.Style.Colors[ImGuiCol_PopupBg], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.15f));
+ if (use_locked_pos)
+ SetNextWindowPos(g.ErrorTooltipLockedPos);
+ bool is_visible = Begin("##Tooltip_Error", NULL, ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize);
+ PopStyleColor();
+ if (is_visible && g.CurrentWindow->BeginCount == 1)
+ {
+ SeparatorText("MESSAGE FROM DEAR IMGUI");
+ BringWindowToDisplayFront(g.CurrentWindow);
+ BringWindowToFocusFront(g.CurrentWindow);
+ g.ErrorTooltipLockedPos = GetWindowPos();
+ }
+ else if (!is_visible)
+ {
+ End();
+ }
+ return is_visible;
}
+void ImGui::EndErrorTooltip()
+{
+ End();
+}
//-----------------------------------------------------------------------------
-// [SECTION] LAYOUT
+// [SECTION] ITEM SUBMISSION
//-----------------------------------------------------------------------------
-// - ItemSize()
+// - KeepAliveID()
// - ItemAdd()
-// - SameLine()
-// - GetCursorScreenPos()
-// - SetCursorScreenPos()
-// - GetCursorPos(), GetCursorPosX(), GetCursorPosY()
-// - SetCursorPos(), SetCursorPosX(), SetCursorPosY()
-// - GetCursorStartPos()
-// - Indent()
-// - Unindent()
-// - SetNextItemWidth()
-// - PushItemWidth()
-// - PushMultiItemsWidths()
-// - PopItemWidth()
-// - CalcItemWidth()
-// - CalcItemSize()
-// - GetTextLineHeight()
-// - GetTextLineHeightWithSpacing()
-// - GetFrameHeight()
-// - GetFrameHeightWithSpacing()
-// - GetContentRegionMax()
-// - GetContentRegionMaxAbs() [Internal]
-// - GetContentRegionAvail(),
-// - GetWindowContentRegionMin(), GetWindowContentRegionMax()
-// - BeginGroup()
-// - EndGroup()
-// Also see in imgui_widgets: tab bars, and in imgui_tables: tables, columns.
//-----------------------------------------------------------------------------
-// Advance cursor given item size for layout.
-// Register minimum needed size so it can extend the bounding box used for auto-fit calculation.
-// See comments in ItemAdd() about how/why the size provided to ItemSize() vs ItemAdd() may often different.
-void ImGui::ItemSize(const ImVec2& size, float text_baseline_y)
+// Code not using ItemAdd() may need to call this manually otherwise ActiveId will be cleared. In IMGUI_VERSION_NUM < 18717 this was called by GetID().
+void ImGui::KeepAliveID(ImGuiID id)
{
ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
- if (window->SkipItems)
- return;
-
- // We increase the height in this function to accommodate for baseline offset.
- // In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor,
- // but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect.
- const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f;
-
- const float line_y1 = window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y;
- const float line_height = ImMax(window->DC.CurrLineSize.y, /*ImMax(*/window->DC.CursorPos.y - line_y1/*, 0.0f)*/ + size.y + offset_to_match_baseline_y);
-
- // Always align ourselves on pixel boundaries
- //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG]
- window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x;
- window->DC.CursorPosPrevLine.y = line_y1;
- window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); // Next line
- window->DC.CursorPos.y = IM_FLOOR(line_y1 + line_height + g.Style.ItemSpacing.y); // Next line
- window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
- window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y);
- //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG]
-
- window->DC.PrevLineSize.y = line_height;
- window->DC.CurrLineSize.y = 0.0f;
- window->DC.PrevLineTextBaseOffset = ImMax(window->DC.CurrLineTextBaseOffset, text_baseline_y);
- window->DC.CurrLineTextBaseOffset = 0.0f;
- window->DC.IsSameLine = window->DC.IsSetPos = false;
-
- // Horizontal layout mode
- if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
- SameLine();
+ if (g.ActiveId == id)
+ g.ActiveIdIsAlive = id;
+ if (g.DeactivatedItemData.ID == id)
+ g.DeactivatedItemData.IsAlive = true;
}
// Declare item bounding box for clipping and interaction.
// Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface
// declare their minimum size requirement to ItemSize() and provide a larger region to ItemAdd() which is used drawing/interaction.
+// THIS IS IN THE PERFORMANCE CRITICAL PATH (UNTIL THE CLIPPING TEST AND EARLY-RETURN)
+IM_MSVC_RUNTIME_CHECKS_OFF
bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGuiItemFlags extra_flags)
{
ImGuiContext& g = *GImGui;
@@ -9008,14 +10580,15 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
g.LastItemData.ID = id;
g.LastItemData.Rect = bb;
g.LastItemData.NavRect = nav_bb_arg ? *nav_bb_arg : bb;
- g.LastItemData.InFlags = g.CurrentItemFlags | extra_flags;
+ g.LastItemData.ItemFlags = g.CurrentItemFlags | g.NextItemData.ItemFlags | extra_flags;
g.LastItemData.StatusFlags = ImGuiItemStatusFlags_None;
+ // Note: we don't copy 'g.NextItemData.SelectionUserData' to an hypothetical g.LastItemData.SelectionUserData: since the former is not cleared.
- // Directional navigation processing
if (id != 0)
{
KeepAliveID(id);
+ // Directional navigation processing
// Runs prior to clipping early-out
// (a) So that NavInitRequest can be honored, for newly opened windows to select a default widget
// (b) So that we can scroll up/down past clipped items. This adds a small O(N) cost to regular navigation requests
@@ -9025,44 +10598,57 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
// to reach unclipped widgets. This would work if user had explicit scrolling control (e.g. mapped on a stick).
// We intentionally don't check if g.NavWindow != NULL because g.NavAnyRequest should only be set when it is non null.
// If we crash on a NULL g.NavWindow we need to fix the bug elsewhere.
- if (!(g.LastItemData.InFlags & ImGuiItemFlags_NoNav))
+ if (!(g.LastItemData.ItemFlags & ImGuiItemFlags_NoNav))
{
+ // FIMXE-NAV: investigate changing the window tests into a simple 'if (g.NavFocusScopeId == g.CurrentFocusScopeId)' test.
window->DC.NavLayersActiveMaskNext |= (1 << window->DC.NavLayerCurrent);
if (g.NavId == id || g.NavAnyRequest)
if (g.NavWindow->RootWindowForNav == window->RootWindowForNav)
- if (window == g.NavWindow || ((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened))
+ if (window == g.NavWindow || ((window->ChildFlags | g.NavWindow->ChildFlags) & ImGuiChildFlags_NavFlattened))
NavProcessItem();
}
- // [DEBUG] People keep stumbling on this problem and using "" as identifier in the root of a window instead of "##something".
- // Empty identifier are valid and useful in a small amount of cases, but 99.9% of the time you want to use "##something".
- // READ THE FAQ: https://dearimgui.org/faq
- IM_ASSERT(id != window->ID && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!");
+ if (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasShortcut)
+ ItemHandleShortcut(id);
}
- g.NextItemData.Flags = ImGuiNextItemDataFlags_None;
+
+ // Lightweight clear of SetNextItemXXX data.
+ g.NextItemData.HasFlags = ImGuiNextItemDataFlags_None;
+ g.NextItemData.ItemFlags = ImGuiItemFlags_None;
#ifdef IMGUI_ENABLE_TEST_ENGINE
if (id != 0)
- IMGUI_TEST_ENGINE_ITEM_ADD(nav_bb_arg ? *nav_bb_arg : bb, id);
+ IMGUI_TEST_ENGINE_ITEM_ADD(id, g.LastItemData.NavRect, &g.LastItemData);
#endif
// Clipping test
- // (FIXME: This is a modified copy of IsClippedEx() so we can reuse the is_rect_visible value)
- //const bool is_clipped = IsClippedEx(bb, id);
- //if (is_clipped)
- // return false;
+ // (this is an inline copy of IsClippedEx() so we can reuse the is_rect_visible value, otherwise we'd do 'if (IsClippedEx(bb, id)) return false')
+ // g.NavActivateId is not necessarily == g.NavId, in the case of remote activation (e.g. shortcuts)
const bool is_rect_visible = bb.Overlaps(window->ClipRect);
if (!is_rect_visible)
- if (id == 0 || (id != g.ActiveId && id != g.NavId))
- if (!g.LogEnabled)
+ if (id == 0 || (id != g.ActiveId && id != g.ActiveIdPreviousFrame && id != g.NavId && id != g.NavActivateId))
+ if (!g.ItemUnclipByLog)
return false;
// [DEBUG]
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
- if (id != 0 && id == g.DebugLocateId)
- DebugLocateItemResolveWithLastItem();
-#endif
+ if (id != 0)
+ {
+ if (id == g.DebugLocateId)
+ DebugLocateItemResolveWithLastItem();
+
+ // [DEBUG] People keep stumbling on this problem and using "" as identifier in the root of a window instead of "##something".
+ // Empty identifier are valid and useful in a small amount of cases, but 99.9% of the time you want to use "##something".
+ // READ THE FAQ: https://dearimgui.com/faq
+ IM_ASSERT(id != window->ID && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!");
+ }
//if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG]
+ //if ((g.LastItemData.ItemFlags & ImGuiItemFlags_NoNav) == 0)
+ // window->DrawList->AddRect(g.LastItemData.NavRect.Min, g.LastItemData.NavRect.Max, IM_COL32(255,255,0,255)); // [DEBUG]
+#endif
+
+ if (id != 0 && g.DeactivatedItemData.ID == id)
+ g.DeactivatedItemData.ElapseFrame = g.FrameCount;
// We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them)
if (is_rect_visible)
@@ -9071,11 +10657,83 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredRect;
return true;
}
+IM_MSVC_RUNTIME_CHECKS_RESTORE
+
+//-----------------------------------------------------------------------------
+// [SECTION] LAYOUT
+//-----------------------------------------------------------------------------
+// - ItemSize()
+// - SameLine()
+// - GetCursorScreenPos()
+// - SetCursorScreenPos()
+// - GetCursorPos(), GetCursorPosX(), GetCursorPosY()
+// - SetCursorPos(), SetCursorPosX(), SetCursorPosY()
+// - GetCursorStartPos()
+// - Indent()
+// - Unindent()
+// - SetNextItemWidth()
+// - PushItemWidth()
+// - PushMultiItemsWidths()
+// - PopItemWidth()
+// - CalcItemWidth()
+// - CalcItemSize()
+// - GetTextLineHeight()
+// - GetTextLineHeightWithSpacing()
+// - GetFrameHeight()
+// - GetFrameHeightWithSpacing()
+// - GetContentRegionMax()
+// - GetContentRegionAvail(),
+// - BeginGroup()
+// - EndGroup()
+// Also see in imgui_widgets: tab bars, and in imgui_tables: tables, columns.
+//-----------------------------------------------------------------------------
+
+// Advance cursor given item size for layout.
+// Register minimum needed size so it can extend the bounding box used for auto-fit calculation.
+// See comments in ItemAdd() about how/why the size provided to ItemSize() vs ItemAdd() may often different.
+// THIS IS IN THE PERFORMANCE CRITICAL PATH.
+IM_MSVC_RUNTIME_CHECKS_OFF
+void ImGui::ItemSize(const ImVec2& size, float text_baseline_y)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ if (window->SkipItems)
+ return;
+
+ // We increase the height in this function to accommodate for baseline offset.
+ // In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor,
+ // but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect.
+ const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f;
+
+ const float line_y1 = window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y;
+ const float line_height = ImMax(window->DC.CurrLineSize.y, /*ImMax(*/window->DC.CursorPos.y - line_y1/*, 0.0f)*/ + size.y + offset_to_match_baseline_y);
+
+ // Always align ourselves on pixel boundaries
+ //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG]
+ window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x;
+ window->DC.CursorPosPrevLine.y = line_y1;
+ window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); // Next line
+ window->DC.CursorPos.y = IM_TRUNC(line_y1 + line_height + g.Style.ItemSpacing.y); // Next line
+ window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
+ window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y);
+ //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG]
+
+ window->DC.PrevLineSize.y = line_height;
+ window->DC.CurrLineSize.y = 0.0f;
+ window->DC.PrevLineTextBaseOffset = ImMax(window->DC.CurrLineTextBaseOffset, text_baseline_y);
+ window->DC.CurrLineTextBaseOffset = 0.0f;
+ window->DC.IsSameLine = window->DC.IsSetPos = false;
+
+ // Horizontal layout mode
+ if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
+ SameLine();
+}
+IM_MSVC_RUNTIME_CHECKS_RESTORE
// Gets back to previous line and continue with horizontal layout
// offset_from_start_x == 0 : follow right after previous item
// offset_from_start_x != 0 : align to specified x position (relative to window/group left)
-// spacing_w < 0 : use default spacing if pos_x == 0, no spacing if pos_x != 0
+// spacing_w < 0 : use default spacing if offset_from_start_x == 0, no spacing if offset_from_start_x != 0
// spacing_w >= 0 : enforce spacing amount
void ImGui::SameLine(float offset_from_start_x, float spacing_w)
{
@@ -9109,9 +10767,6 @@ ImVec2 ImGui::GetCursorScreenPos()
return window->DC.CursorPos;
}
-// 2022/08/05: Setting cursor position also extend boundaries (via modifying CursorMaxPos) used to compute window size, group size etc.
-// I believe this was is a judicious choice but it's probably being relied upon (it has been the case since 1.31 and 1.50)
-// It would be sane if we requested user to use SetCursorPos() + Dummy(ImVec2(0,0)) to extend CursorMaxPos...
void ImGui::SetCursorScreenPos(const ImVec2& pos)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -9190,7 +10845,7 @@ void ImGui::Unindent(float indent_w)
void ImGui::SetNextItemWidth(float item_width)
{
ImGuiContext& g = *GImGui;
- g.NextItemData.Flags |= ImGuiNextItemDataFlags_HasWidth;
+ g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasWidth;
g.NextItemData.Width = item_width;
}
@@ -9201,27 +10856,37 @@ void ImGui::PushItemWidth(float item_width)
ImGuiWindow* window = g.CurrentWindow;
window->DC.ItemWidthStack.push_back(window->DC.ItemWidth); // Backup current width
window->DC.ItemWidth = (item_width == 0.0f ? window->ItemWidthDefault : item_width);
- g.NextItemData.Flags &= ~ImGuiNextItemDataFlags_HasWidth;
+ g.NextItemData.HasFlags &= ~ImGuiNextItemDataFlags_HasWidth;
}
void ImGui::PushMultiItemsWidths(int components, float w_full)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
+ IM_ASSERT(components > 0);
const ImGuiStyle& style = g.Style;
- const float w_item_one = ImMax(1.0f, IM_FLOOR((w_full - (style.ItemInnerSpacing.x) * (components - 1)) / (float)components));
- const float w_item_last = ImMax(1.0f, IM_FLOOR(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components - 1)));
window->DC.ItemWidthStack.push_back(window->DC.ItemWidth); // Backup current width
- window->DC.ItemWidthStack.push_back(w_item_last);
- for (int i = 0; i < components - 2; i++)
- window->DC.ItemWidthStack.push_back(w_item_one);
- window->DC.ItemWidth = (components == 1) ? w_item_last : w_item_one;
- g.NextItemData.Flags &= ~ImGuiNextItemDataFlags_HasWidth;
+ float w_items = w_full - style.ItemInnerSpacing.x * (components - 1);
+ float prev_split = w_items;
+ for (int i = components - 1; i > 0; i--)
+ {
+ float next_split = IM_TRUNC(w_items * i / components);
+ window->DC.ItemWidthStack.push_back(ImMax(prev_split - next_split, 1.0f));
+ prev_split = next_split;
+ }
+ window->DC.ItemWidth = ImMax(prev_split, 1.0f);
+ g.NextItemData.HasFlags &= ~ImGuiNextItemDataFlags_HasWidth;
}
void ImGui::PopItemWidth()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ if (window->DC.ItemWidthStack.Size <= 0)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling PopItemWidth() too many times!");
+ return;
+ }
window->DC.ItemWidth = window->DC.ItemWidthStack.back();
window->DC.ItemWidthStack.pop_back();
}
@@ -9233,16 +10898,16 @@ float ImGui::CalcItemWidth()
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
float w;
- if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasWidth)
+ if (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasWidth)
w = g.NextItemData.Width;
else
w = window->DC.ItemWidth;
if (w < 0.0f)
{
- float region_max_x = GetContentRegionMaxAbs().x;
- w = ImMax(1.0f, region_max_x - window->DC.CursorPos.x + w);
+ float region_avail_x = GetContentRegionAvail().x;
+ w = ImMax(1.0f, region_avail_x + w);
}
- w = IM_FLOOR(w);
+ w = IM_TRUNC(w);
return w;
}
@@ -9252,22 +10917,19 @@ float ImGui::CalcItemWidth()
// The 4.0f here may be changed to match CalcItemWidth() and/or BeginChild() (right now we have a mismatch which is harmless but undesirable)
ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_w, float default_h)
{
- ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
-
- ImVec2 region_max;
+ ImVec2 avail;
if (size.x < 0.0f || size.y < 0.0f)
- region_max = GetContentRegionMaxAbs();
+ avail = GetContentRegionAvail();
if (size.x == 0.0f)
size.x = default_w;
else if (size.x < 0.0f)
- size.x = ImMax(4.0f, region_max.x - window->DC.CursorPos.x + size.x);
+ size.x = ImMax(4.0f, avail.x + size.x); // <-- size.x is negative here so we are subtracting
if (size.y == 0.0f)
size.y = default_h;
else if (size.y < 0.0f)
- size.y = ImMax(4.0f, region_max.y - window->DC.CursorPos.y + size.y);
+ size.y = ImMax(4.0f, avail.y + size.y); // <-- size.y is negative here so we are subtracting
return size;
}
@@ -9296,37 +10958,23 @@ float ImGui::GetFrameHeightWithSpacing()
return g.FontSize + g.Style.FramePadding.y * 2.0f + g.Style.ItemSpacing.y;
}
-// FIXME: All the Contents Region function are messy or misleading. WE WILL AIM TO OBSOLETE ALL OF THEM WITH A NEW "WORK RECT" API. Thanks for your patience!
-
-// FIXME: This is in window space (not screen space!).
-ImVec2 ImGui::GetContentRegionMax()
+ImVec2 ImGui::GetContentRegionAvail()
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- ImVec2 mx = window->ContentRegionRect.Max - window->Pos;
- if (window->DC.CurrentColumns || g.CurrentTable)
- mx.x = window->WorkRect.Max.x - window->Pos.x;
- return mx;
+ ImVec2 mx = (window->DC.CurrentColumns || g.CurrentTable) ? window->WorkRect.Max : window->ContentRegionRect.Max;
+ return mx - window->DC.CursorPos;
}
-// [Internal] Absolute coordinate. Saner. This is not exposed until we finishing refactoring work rect features.
-ImVec2 ImGui::GetContentRegionMaxAbs()
-{
- ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
- ImVec2 mx = window->ContentRegionRect.Max;
- if (window->DC.CurrentColumns || g.CurrentTable)
- mx.x = window->WorkRect.Max.x;
- return mx;
-}
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-ImVec2 ImGui::GetContentRegionAvail()
+// You should never need those functions. Always use GetCursorScreenPos() and GetContentRegionAvail()!
+// They are bizarre local-coordinates which don't play well with scrolling.
+ImVec2 ImGui::GetContentRegionMax()
{
- ImGuiWindow* window = GImGui->CurrentWindow;
- return GetContentRegionMaxAbs() - window->DC.CursorPos;
+ return GetContentRegionAvail() + GetCursorScreenPos() - GetWindowPos();
}
-// In window space (not screen space!)
ImVec2 ImGui::GetWindowContentRegionMin()
{
ImGuiWindow* window = GImGui->CurrentWindow;
@@ -9338,6 +10986,7 @@ ImVec2 ImGui::GetWindowContentRegionMax()
ImGuiWindow* window = GImGui->CurrentWindow;
return window->ContentRegionRect.Max - window->Pos;
}
+#endif
// Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)
// Groups are currently a mishmash of functionalities which should perhaps be clarified and separated.
@@ -9351,6 +11000,7 @@ void ImGui::BeginGroup()
ImGuiGroupData& group_data = g.GroupStack.back();
group_data.WindowID = window->ID;
group_data.BackupCursorPos = window->DC.CursorPos;
+ group_data.BackupCursorPosPrevLine = window->DC.CursorPosPrevLine;
group_data.BackupCursorMaxPos = window->DC.CursorMaxPos;
group_data.BackupIndent = window->DC.Indent;
group_data.BackupGroupOffset = window->DC.GroupOffset;
@@ -9358,7 +11008,8 @@ void ImGui::BeginGroup()
group_data.BackupCurrLineTextBaseOffset = window->DC.CurrLineTextBaseOffset;
group_data.BackupActiveIdIsAlive = g.ActiveIdIsAlive;
group_data.BackupHoveredIdIsAlive = g.HoveredId != 0;
- group_data.BackupActiveIdPreviousFrameIsAlive = g.ActiveIdPreviousFrameIsAlive;
+ group_data.BackupIsSameLine = window->DC.IsSameLine;
+ group_data.BackupDeactivatedIdIsAlive = g.DeactivatedItemData.IsAlive;
group_data.EmitItem = true;
window->DC.GroupOffset.x = window->DC.CursorPos.x - window->Pos.x - window->DC.ColumnsOffset.x;
@@ -9381,14 +11032,16 @@ void ImGui::EndGroup()
if (window->DC.IsSetPos)
ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
- ImRect group_bb(group_data.BackupCursorPos, ImMax(window->DC.CursorMaxPos, group_data.BackupCursorPos));
-
+ // Include LastItemData.Rect.Max as a workaround for e.g. EndTable() undershooting with CursorMaxPos report. (#7543)
+ ImRect group_bb(group_data.BackupCursorPos, ImMax(ImMax(window->DC.CursorMaxPos, g.LastItemData.Rect.Max), group_data.BackupCursorPos));
window->DC.CursorPos = group_data.BackupCursorPos;
- window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos);
+ window->DC.CursorPosPrevLine = group_data.BackupCursorPosPrevLine;
+ window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, group_bb.Max);
window->DC.Indent = group_data.BackupIndent;
window->DC.GroupOffset = group_data.BackupGroupOffset;
window->DC.CurrLineSize = group_data.BackupCurrLineSize;
window->DC.CurrLineTextBaseOffset = group_data.BackupCurrLineTextBaseOffset;
+ window->DC.IsSameLine = group_data.BackupIsSameLine;
if (g.LogEnabled)
g.LogLinePosY = -FLT_MAX; // To enforce a carriage return
@@ -9398,7 +11051,7 @@ void ImGui::EndGroup()
return;
}
- window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now.
+ window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now.
ItemSize(group_bb.GetSize());
ItemAdd(group_bb, 0, NULL, ImGuiItemFlags_NoTabStop);
@@ -9407,11 +11060,11 @@ void ImGui::EndGroup()
// Also if you grep for LastItemId you'll notice it is only used in that context.
// (The two tests not the same because ActiveIdIsAlive is an ID itself, in order to be able to handle ActiveId being overwritten during the frame.)
const bool group_contains_curr_active_id = (group_data.BackupActiveIdIsAlive != g.ActiveId) && (g.ActiveIdIsAlive == g.ActiveId) && g.ActiveId;
- const bool group_contains_prev_active_id = (group_data.BackupActiveIdPreviousFrameIsAlive == false) && (g.ActiveIdPreviousFrameIsAlive == true);
+ const bool group_contains_deactivated_id = (group_data.BackupDeactivatedIdIsAlive == false) && (g.DeactivatedItemData.IsAlive == true);
if (group_contains_curr_active_id)
g.LastItemData.ID = g.ActiveId;
- else if (group_contains_prev_active_id)
- g.LastItemData.ID = g.ActiveIdPreviousFrame;
+ else if (group_contains_deactivated_id)
+ g.LastItemData.ID = g.DeactivatedItemData.ID;
g.LastItemData.Rect = group_bb;
// Forward Hovered flag
@@ -9425,11 +11078,12 @@ void ImGui::EndGroup()
// Forward Deactivated flag
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HasDeactivated;
- if (group_contains_prev_active_id && g.ActiveId != g.ActiveIdPreviousFrame)
+ if (group_contains_deactivated_id)
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Deactivated;
g.GroupStack.pop_back();
- //window->DrawList->AddRect(group_bb.Min, group_bb.Max, IM_COL32(255,0,255,255)); // [Debug]
+ if (g.DebugShowGroupRects)
+ window->DrawList->AddRect(group_bb.Min, group_bb.Max, IM_COL32(255,0,255,255)); // [Debug]
}
@@ -9453,38 +11107,24 @@ static float CalcScrollEdgeSnap(float target, float snap_min, float snap_max, fl
static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window)
{
ImVec2 scroll = window->Scroll;
- if (window->ScrollTarget.x < FLT_MAX)
- {
- float decoration_total_width = window->ScrollbarSizes.x;
- float center_x_ratio = window->ScrollTargetCenterRatio.x;
- float scroll_target_x = window->ScrollTarget.x;
- if (window->ScrollTargetEdgeSnapDist.x > 0.0f)
- {
- float snap_x_min = 0.0f;
- float snap_x_max = window->ScrollMax.x + window->SizeFull.x - decoration_total_width;
- scroll_target_x = CalcScrollEdgeSnap(scroll_target_x, snap_x_min, snap_x_max, window->ScrollTargetEdgeSnapDist.x, center_x_ratio);
- }
- scroll.x = scroll_target_x - center_x_ratio * (window->SizeFull.x - decoration_total_width);
- }
- if (window->ScrollTarget.y < FLT_MAX)
+ ImVec2 decoration_size(window->DecoOuterSizeX1 + window->DecoInnerSizeX1 + window->DecoOuterSizeX2, window->DecoOuterSizeY1 + window->DecoInnerSizeY1 + window->DecoOuterSizeY2);
+ for (int axis = 0; axis < 2; axis++)
{
- float decoration_total_height = window->TitleBarHeight() + window->MenuBarHeight() + window->ScrollbarSizes.y;
- float center_y_ratio = window->ScrollTargetCenterRatio.y;
- float scroll_target_y = window->ScrollTarget.y;
- if (window->ScrollTargetEdgeSnapDist.y > 0.0f)
+ if (window->ScrollTarget[axis] < FLT_MAX)
{
- float snap_y_min = 0.0f;
- float snap_y_max = window->ScrollMax.y + window->SizeFull.y - decoration_total_height;
- scroll_target_y = CalcScrollEdgeSnap(scroll_target_y, snap_y_min, snap_y_max, window->ScrollTargetEdgeSnapDist.y, center_y_ratio);
+ float center_ratio = window->ScrollTargetCenterRatio[axis];
+ float scroll_target = window->ScrollTarget[axis];
+ if (window->ScrollTargetEdgeSnapDist[axis] > 0.0f)
+ {
+ float snap_min = 0.0f;
+ float snap_max = window->ScrollMax[axis] + window->SizeFull[axis] - decoration_size[axis];
+ scroll_target = CalcScrollEdgeSnap(scroll_target, snap_min, snap_max, window->ScrollTargetEdgeSnapDist[axis], center_ratio);
+ }
+ scroll[axis] = scroll_target - center_ratio * (window->SizeFull[axis] - decoration_size[axis]);
}
- scroll.y = scroll_target_y - center_y_ratio * (window->SizeFull.y - decoration_total_height);
- }
- scroll.x = IM_FLOOR(ImMax(scroll.x, 0.0f));
- scroll.y = IM_FLOOR(ImMax(scroll.y, 0.0f));
- if (!window->Collapsed && !window->SkipItems)
- {
- scroll.x = ImMin(scroll.x, window->ScrollMax.x);
- scroll.y = ImMin(scroll.y, window->ScrollMax.y);
+ scroll[axis] = IM_ROUND(ImMax(scroll[axis], 0.0f));
+ if (!window->Collapsed && !window->SkipItems)
+ scroll[axis] = ImMin(scroll[axis], window->ScrollMax[axis]);
}
return scroll;
}
@@ -9505,8 +11145,11 @@ void ImGui::ScrollToRect(ImGuiWindow* window, const ImRect& item_rect, ImGuiScro
ImVec2 ImGui::ScrollToRectEx(ImGuiWindow* window, const ImRect& item_rect, ImGuiScrollFlags flags)
{
ImGuiContext& g = *GImGui;
- ImRect window_rect(window->InnerRect.Min - ImVec2(1, 1), window->InnerRect.Max + ImVec2(1, 1));
- //GetForegroundDrawList(window)->AddRect(window_rect.Min, window_rect.Max, IM_COL32_WHITE); // [DEBUG]
+ ImRect scroll_rect(window->InnerRect.Min - ImVec2(1, 1), window->InnerRect.Max + ImVec2(1, 1));
+ scroll_rect.Min.x = ImMin(scroll_rect.Min.x + window->DecoInnerSizeX1, scroll_rect.Max.x);
+ scroll_rect.Min.y = ImMin(scroll_rect.Min.y + window->DecoInnerSizeY1, scroll_rect.Max.y);
+ //GetForegroundDrawList(window)->AddRect(item_rect.Min, item_rect.Max, IM_COL32(255,0,0,255), 0.0f, 0, 5.0f); // [DEBUG]
+ //GetForegroundDrawList(window)->AddRect(scroll_rect.Min, scroll_rect.Max, IM_COL32_WHITE); // [DEBUG]
// Check that only one behavior is selected per axis
IM_ASSERT((flags & ImGuiScrollFlags_MaskX_) == 0 || ImIsPowerOfTwo(flags & ImGuiScrollFlags_MaskX_));
@@ -9519,35 +11162,39 @@ ImVec2 ImGui::ScrollToRectEx(ImGuiWindow* window, const ImRect& item_rect, ImGui
if ((flags & ImGuiScrollFlags_MaskY_) == 0)
flags |= window->Appearing ? ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeY;
- const bool fully_visible_x = item_rect.Min.x >= window_rect.Min.x && item_rect.Max.x <= window_rect.Max.x;
- const bool fully_visible_y = item_rect.Min.y >= window_rect.Min.y && item_rect.Max.y <= window_rect.Max.y;
- const bool can_be_fully_visible_x = (item_rect.GetWidth() + g.Style.ItemSpacing.x * 2.0f) <= window_rect.GetWidth();
- const bool can_be_fully_visible_y = (item_rect.GetHeight() + g.Style.ItemSpacing.y * 2.0f) <= window_rect.GetHeight();
+ const bool fully_visible_x = item_rect.Min.x >= scroll_rect.Min.x && item_rect.Max.x <= scroll_rect.Max.x;
+ const bool fully_visible_y = item_rect.Min.y >= scroll_rect.Min.y && item_rect.Max.y <= scroll_rect.Max.y;
+ const bool can_be_fully_visible_x = (item_rect.GetWidth() + g.Style.ItemSpacing.x * 2.0f) <= scroll_rect.GetWidth() || (window->AutoFitFramesX > 0) || (window->Flags & ImGuiWindowFlags_AlwaysAutoResize) != 0;
+ const bool can_be_fully_visible_y = (item_rect.GetHeight() + g.Style.ItemSpacing.y * 2.0f) <= scroll_rect.GetHeight() || (window->AutoFitFramesY > 0) || (window->Flags & ImGuiWindowFlags_AlwaysAutoResize) != 0;
if ((flags & ImGuiScrollFlags_KeepVisibleEdgeX) && !fully_visible_x)
{
- if (item_rect.Min.x < window_rect.Min.x || !can_be_fully_visible_x)
+ if (item_rect.Min.x < scroll_rect.Min.x || !can_be_fully_visible_x)
SetScrollFromPosX(window, item_rect.Min.x - g.Style.ItemSpacing.x - window->Pos.x, 0.0f);
- else if (item_rect.Max.x >= window_rect.Max.x)
+ else if (item_rect.Max.x >= scroll_rect.Max.x)
SetScrollFromPosX(window, item_rect.Max.x + g.Style.ItemSpacing.x - window->Pos.x, 1.0f);
}
else if (((flags & ImGuiScrollFlags_KeepVisibleCenterX) && !fully_visible_x) || (flags & ImGuiScrollFlags_AlwaysCenterX))
{
- float target_x = can_be_fully_visible_x ? ImFloor((item_rect.Min.x + item_rect.Max.x - window->InnerRect.GetWidth()) * 0.5f) : item_rect.Min.x;
- SetScrollFromPosX(window, target_x - window->Pos.x, 0.0f);
+ if (can_be_fully_visible_x)
+ SetScrollFromPosX(window, ImTrunc((item_rect.Min.x + item_rect.Max.x) * 0.5f) - window->Pos.x, 0.5f);
+ else
+ SetScrollFromPosX(window, item_rect.Min.x - window->Pos.x, 0.0f);
}
if ((flags & ImGuiScrollFlags_KeepVisibleEdgeY) && !fully_visible_y)
{
- if (item_rect.Min.y < window_rect.Min.y || !can_be_fully_visible_y)
+ if (item_rect.Min.y < scroll_rect.Min.y || !can_be_fully_visible_y)
SetScrollFromPosY(window, item_rect.Min.y - g.Style.ItemSpacing.y - window->Pos.y, 0.0f);
- else if (item_rect.Max.y >= window_rect.Max.y)
+ else if (item_rect.Max.y >= scroll_rect.Max.y)
SetScrollFromPosY(window, item_rect.Max.y + g.Style.ItemSpacing.y - window->Pos.y, 1.0f);
}
else if (((flags & ImGuiScrollFlags_KeepVisibleCenterY) && !fully_visible_y) || (flags & ImGuiScrollFlags_AlwaysCenterY))
{
- float target_y = can_be_fully_visible_y ? ImFloor((item_rect.Min.y + item_rect.Max.y - window->InnerRect.GetHeight()) * 0.5f) : item_rect.Min.y;
- SetScrollFromPosY(window, target_y - window->Pos.y, 0.0f);
+ if (can_be_fully_visible_y)
+ SetScrollFromPosY(window, ImTrunc((item_rect.Min.y + item_rect.Max.y) * 0.5f) - window->Pos.y, 0.5f);
+ else
+ SetScrollFromPosY(window, item_rect.Min.y - window->Pos.y, 0.0f);
}
ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window);
@@ -9630,7 +11277,7 @@ void ImGui::SetScrollY(float scroll_y)
void ImGui::SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio)
{
IM_ASSERT(center_x_ratio >= 0.0f && center_x_ratio <= 1.0f);
- window->ScrollTarget.x = IM_FLOOR(local_x + window->Scroll.x); // Convert local position to scroll offset
+ window->ScrollTarget.x = IM_TRUNC(local_x - window->DecoOuterSizeX1 - window->DecoInnerSizeX1 + window->Scroll.x); // Convert local position to scroll offset
window->ScrollTargetCenterRatio.x = center_x_ratio;
window->ScrollTargetEdgeSnapDist.x = 0.0f;
}
@@ -9638,9 +11285,7 @@ void ImGui::SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x
void ImGui::SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y_ratio)
{
IM_ASSERT(center_y_ratio >= 0.0f && center_y_ratio <= 1.0f);
- const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight(); // FIXME: Would be nice to have a more standardized access to our scrollable/client rect;
- local_y -= decoration_up_height;
- window->ScrollTarget.y = IM_FLOOR(local_y + window->Scroll.y); // Convert local position to scroll offset
+ window->ScrollTarget.y = IM_TRUNC(local_y - window->DecoOuterSizeY1 - window->DecoInnerSizeY1 + window->Scroll.y); // Convert local position to scroll offset
window->ScrollTargetCenterRatio.y = center_y_ratio;
window->ScrollTargetEdgeSnapDist.y = 0.0f;
}
@@ -9687,41 +11332,62 @@ void ImGui::SetScrollHereY(float center_y_ratio)
// [SECTION] TOOLTIPS
//-----------------------------------------------------------------------------
-void ImGui::BeginTooltip()
+bool ImGui::BeginTooltip()
{
- BeginTooltipEx(ImGuiTooltipFlags_None, ImGuiWindowFlags_None);
+ return BeginTooltipEx(ImGuiTooltipFlags_None, ImGuiWindowFlags_None);
}
-void ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags)
+bool ImGui::BeginItemTooltip()
+{
+ if (!IsItemHovered(ImGuiHoveredFlags_ForTooltip))
+ return false;
+ return BeginTooltipEx(ImGuiTooltipFlags_None, ImGuiWindowFlags_None);
+}
+
+bool ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags)
{
ImGuiContext& g = *GImGui;
- if (g.DragDropWithinSource || g.DragDropWithinTarget)
+ const bool is_dragdrop_tooltip = g.DragDropWithinSource || g.DragDropWithinTarget;
+ if (is_dragdrop_tooltip)
{
- // The default tooltip position is a little offset to give space to see the context menu (it's also clamped within the current viewport/monitor)
- // In the context of a dragging tooltip we try to reduce that offset and we enforce following the cursor.
- // Whatever we do we want to call SetNextWindowPos() to enforce a tooltip position and disable clipping the tooltip without our display area, like regular tooltip do.
+ // Drag and Drop tooltips are positioning differently than other tooltips:
+ // - offset visibility to increase visibility around mouse.
+ // - never clamp within outer viewport boundary.
+ // We call SetNextWindowPos() to enforce position and disable clamping.
+ // See FindBestWindowPosForPopup() for positionning logic of other tooltips (not drag and drop ones).
//ImVec2 tooltip_pos = g.IO.MousePos - g.ActiveIdClickOffset - g.Style.WindowPadding;
- ImVec2 tooltip_pos = g.IO.MousePos + ImVec2(16 * g.Style.MouseCursorScale, 8 * g.Style.MouseCursorScale);
- SetNextWindowPos(tooltip_pos);
+ const bool is_touchscreen = (g.IO.MouseSource == ImGuiMouseSource_TouchScreen);
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasPos) == 0)
+ {
+ ImVec2 tooltip_pos = is_touchscreen ? (g.IO.MousePos + TOOLTIP_DEFAULT_OFFSET_TOUCH * g.Style.MouseCursorScale) : (g.IO.MousePos + TOOLTIP_DEFAULT_OFFSET_MOUSE * g.Style.MouseCursorScale);
+ ImVec2 tooltip_pivot = is_touchscreen ? TOOLTIP_DEFAULT_PIVOT_TOUCH : ImVec2(0.0f, 0.0f);
+ SetNextWindowPos(tooltip_pos, ImGuiCond_None, tooltip_pivot);
+ }
+
SetNextWindowBgAlpha(g.Style.Colors[ImGuiCol_PopupBg].w * 0.60f);
//PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * 0.60f); // This would be nice but e.g ColorButton with checkboard has issue with transparent colors :(
- tooltip_flags |= ImGuiTooltipFlags_OverridePreviousTooltip;
+ tooltip_flags |= ImGuiTooltipFlags_OverridePrevious;
}
- char window_name[16];
- ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", g.TooltipOverrideCount);
- if (tooltip_flags & ImGuiTooltipFlags_OverridePreviousTooltip)
- if (ImGuiWindow* window = FindWindowByName(window_name))
- if (window->Active)
- {
- // Hide previous tooltip from being displayed. We can't easily "reset" the content of a window so we create a new one.
- window->Hidden = true;
- window->HiddenFramesCanSkipItems = 1; // FIXME: This may not be necessary?
- ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", ++g.TooltipOverrideCount);
- }
+ const char* window_name_template = is_dragdrop_tooltip ? "##Tooltip_DragDrop_%02d" : "##Tooltip_%02d";
+ char window_name[32];
+ ImFormatString(window_name, IM_ARRAYSIZE(window_name), window_name_template, g.TooltipOverrideCount);
+ if ((tooltip_flags & ImGuiTooltipFlags_OverridePrevious) && g.TooltipPreviousWindow != NULL && g.TooltipPreviousWindow->Active)
+ {
+ // Hide previous tooltip from being displayed. We can't easily "reset" the content of a window so we create a new one.
+ //IMGUI_DEBUG_LOG("[tooltip] '%s' already active, using +1 for this frame\n", window_name);
+ SetWindowHiddenAndSkipItemsForCurrentFrame(g.TooltipPreviousWindow);
+ ImFormatString(window_name, IM_ARRAYSIZE(window_name), window_name_template, ++g.TooltipOverrideCount);
+ }
ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize;
Begin(window_name, NULL, flags | extra_window_flags);
+ // 2023-03-09: Added bool return value to the API, but currently always returning true.
+ // If this ever returns false we need to update BeginDragDropSource() accordingly.
+ //if (!ret)
+ // End();
+ //return ret;
+ return true;
}
void ImGui::EndTooltip()
@@ -9730,21 +11396,40 @@ void ImGui::EndTooltip()
End();
}
+void ImGui::SetTooltip(const char* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ SetTooltipV(fmt, args);
+ va_end(args);
+}
+
void ImGui::SetTooltipV(const char* fmt, va_list args)
{
- BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None);
+ if (!BeginTooltipEx(ImGuiTooltipFlags_OverridePrevious, ImGuiWindowFlags_None))
+ return;
TextV(fmt, args);
EndTooltip();
}
-void ImGui::SetTooltip(const char* fmt, ...)
+// Shortcut to use 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav'.
+// Defaults to == ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort when using the mouse.
+void ImGui::SetItemTooltip(const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
- SetTooltipV(fmt, args);
+ if (IsItemHovered(ImGuiHoveredFlags_ForTooltip))
+ SetTooltipV(fmt, args);
va_end(args);
}
+void ImGui::SetItemTooltipV(const char* fmt, va_list args)
+{
+ if (IsItemHovered(ImGuiHoveredFlags_ForTooltip))
+ SetTooltipV(fmt, args);
+}
+
+
//-----------------------------------------------------------------------------
// [SECTION] POPUPS
//-----------------------------------------------------------------------------
@@ -9790,6 +11475,7 @@ bool ImGui::IsPopupOpen(const char* str_id, ImGuiPopupFlags popup_flags)
return IsPopupOpen(id, popup_flags);
}
+// Also see FindBlockingModal(NULL)
ImGuiWindow* ImGui::GetTopMostPopupModal()
{
ImGuiContext& g = *GImGui;
@@ -9800,6 +11486,7 @@ ImGuiWindow* ImGui::GetTopMostPopupModal()
return NULL;
}
+// See Demo->Stacked Modal to confirm what this is for.
ImGuiWindow* ImGui::GetTopMostAndVisiblePopupModal()
{
ImGuiContext& g = *GImGui;
@@ -9810,11 +11497,48 @@ ImGuiWindow* ImGui::GetTopMostAndVisiblePopupModal()
return NULL;
}
+
+// When a modal popup is open, newly created windows that want focus (i.e. are not popups and do not specify ImGuiWindowFlags_NoFocusOnAppearing)
+// should be positioned behind that modal window, unless the window was created inside the modal begin-stack.
+// In case of multiple stacked modals newly created window honors begin stack order and does not go below its own modal parent.
+// - WindowA // FindBlockingModal() returns Modal1
+// - WindowB // .. returns Modal1
+// - Modal1 // .. returns Modal2
+// - WindowC // .. returns Modal2
+// - WindowD // .. returns Modal2
+// - Modal2 // .. returns Modal2
+// - WindowE // .. returns NULL
+// Notes:
+// - FindBlockingModal(NULL) == NULL is generally equivalent to GetTopMostPopupModal() == NULL.
+// Only difference is here we check for ->Active/WasActive but it may be unnecessary.
+ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ if (g.OpenPopupStack.Size <= 0)
+ return NULL;
+
+ // Find a modal that has common parent with specified window. Specified window should be positioned behind that modal.
+ for (ImGuiPopupData& popup_data : g.OpenPopupStack)
+ {
+ ImGuiWindow* popup_window = popup_data.Window;
+ if (popup_window == NULL || !(popup_window->Flags & ImGuiWindowFlags_Modal))
+ continue;
+ if (!popup_window->Active && !popup_window->WasActive) // Check WasActive, because this code may run before popup renders on current frame, also check Active to handle newly created windows.
+ continue;
+ if (window == NULL) // FindBlockingModal(NULL) test for if FocusWindow(NULL) is naturally possible via a mouse click.
+ return popup_window;
+ if (IsWindowWithinBeginStackOf(window, popup_window)) // Window may be over modal
+ continue;
+ return popup_window; // Place window right below first block modal
+ }
+ return NULL;
+}
+
void ImGui::OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags)
{
ImGuiContext& g = *GImGui;
ImGuiID id = g.CurrentWindow->GetID(str_id);
- IMGUI_DEBUG_LOG_POPUP("[popup] OpenPopup(\"%s\" -> 0x%08X\n", str_id, id);
+ IMGUI_DEBUG_LOG_POPUP("[popup] OpenPopup(\"%s\" -> 0x%08X)\n", str_id, id);
OpenPopupEx(id, popup_flags);
}
@@ -9834,13 +11558,13 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags)
const int current_stack_size = g.BeginPopupStack.Size;
if (popup_flags & ImGuiPopupFlags_NoOpenOverExistingPopup)
- if (IsPopupOpen(0u, ImGuiPopupFlags_AnyPopupId))
+ if (IsPopupOpen((ImGuiID)0, ImGuiPopupFlags_AnyPopupId))
return;
ImGuiPopupData popup_ref; // Tagged as new ref as Window will be set back to NULL if we write this into OpenPopupStack.
popup_ref.PopupId = id;
popup_ref.Window = NULL;
- popup_ref.BackupNavWindow = g.NavWindow; // When popup closes focus may be restored to NavWindow (depend on window type).
+ popup_ref.RestoreNavWindow = g.NavWindow; // When popup closes focus may be restored to NavWindow (depend on window type).
popup_ref.OpenFrameCount = g.FrameCount;
popup_ref.OpenParentId = parent_window->IDStack.back();
popup_ref.OpenPopupPos = NavCalcPreferredRefPos();
@@ -9853,17 +11577,23 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags)
}
else
{
- // Gently handle the user mistakenly calling OpenPopup() every frame. It is a programming mistake! However, if we were to run the regular code path, the ui
- // would become completely unusable because the popup will always be in hidden-while-calculating-size state _while_ claiming focus. Which would be a very confusing
- // situation for the programmer. Instead, we silently allow the popup to proceed, it will keep reappearing and the programming error will be more obvious to understand.
- if (g.OpenPopupStack[current_stack_size].PopupId == id && g.OpenPopupStack[current_stack_size].OpenFrameCount == g.FrameCount - 1)
+ // Gently handle the user mistakenly calling OpenPopup() every frames: it is likely a programming mistake!
+ // However, if we were to run the regular code path, the ui would become completely unusable because the popup will always be
+ // in hidden-while-calculating-size state _while_ claiming focus. Which is extremely confusing situation for the programmer.
+ // Instead, for successive frames calls to OpenPopup(), we silently avoid reopening even if ImGuiPopupFlags_NoReopen is not specified.
+ bool keep_existing = false;
+ if (g.OpenPopupStack[current_stack_size].PopupId == id)
+ if ((g.OpenPopupStack[current_stack_size].OpenFrameCount == g.FrameCount - 1) || (popup_flags & ImGuiPopupFlags_NoReopen))
+ keep_existing = true;
+ if (keep_existing)
{
+ // No reopen
g.OpenPopupStack[current_stack_size].OpenFrameCount = popup_ref.OpenFrameCount;
}
else
{
- // Close child popups if any, then flag popup for open/reopen
- ClosePopupToLevel(current_stack_size, false);
+ // Reopen: close child popups if any, then flag popup for open/reopen (set position, focus, init navigation)
+ ClosePopupToLevel(current_stack_size, true);
g.OpenPopupStack.push_back(popup_ref);
}
@@ -9883,6 +11613,7 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to
return;
// Don't close our own child popup windows.
+ //IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupsOverWindow(\"%s\") restore_under=%d\n", ref_window ? ref_window->Name : "<NULL>", restore_focus_to_window_under_popup);
int popup_count_to_keep = 0;
if (ref_window)
{
@@ -9893,14 +11624,15 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to
if (!popup.Window)
continue;
IM_ASSERT((popup.Window->Flags & ImGuiWindowFlags_Popup) != 0);
- if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow)
- continue;
// Trim the stack unless the popup is a direct parent of the reference window (the reference window is often the NavWindow)
- // - With this stack of window, clicking/focusing Popup1 will close Popup2 and Popup3:
- // Window -> Popup1 -> Popup2 -> Popup3
+ // - Clicking/Focusing Window2 won't close Popup1:
+ // Window -> Popup1 -> Window2(Ref)
+ // - Clicking/focusing Popup1 will close Popup2 and Popup3:
+ // Window -> Popup1(Ref) -> Popup2 -> Popup3
// - Each popups may contain child windows, which is why we compare ->RootWindow!
// Window -> Popup1 -> Popup1_Child -> Popup2 -> Popup2_Child
+ // We step through every popup from bottom to top to validate their position relative to reference window.
bool ref_window_is_descendent_of_popup = false;
for (int n = popup_count_to_keep; n < g.OpenPopupStack.Size; n++)
if (ImGuiWindow* popup_window = g.OpenPopupStack[n].Window)
@@ -9928,7 +11660,7 @@ void ImGui::ClosePopupsExceptModals()
for (popup_count_to_keep = g.OpenPopupStack.Size; popup_count_to_keep > 0; popup_count_to_keep--)
{
ImGuiWindow* window = g.OpenPopupStack[popup_count_to_keep - 1].Window;
- if (!window || window->Flags & ImGuiWindowFlags_Modal)
+ if (!window || (window->Flags & ImGuiWindowFlags_Modal))
break;
}
if (popup_count_to_keep < g.OpenPopupStack.Size) // This test is not required but it allows to set a convenient breakpoint on the statement below
@@ -9938,28 +11670,25 @@ void ImGui::ClosePopupsExceptModals()
void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup)
{
ImGuiContext& g = *GImGui;
- IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupToLevel(%d), restore_focus_to_window_under_popup=%d\n", remaining, restore_focus_to_window_under_popup);
+ IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupToLevel(%d), restore_under=%d\n", remaining, restore_focus_to_window_under_popup);
IM_ASSERT(remaining >= 0 && remaining < g.OpenPopupStack.Size);
+ if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup)
+ for (int n = remaining; n < g.OpenPopupStack.Size; n++)
+ IMGUI_DEBUG_LOG_POPUP("[popup] - Closing PopupID 0x%08X Window \"%s\"\n", g.OpenPopupStack[n].PopupId, g.OpenPopupStack[n].Window ? g.OpenPopupStack[n].Window->Name : NULL);
// Trim open popup stack
- ImGuiWindow* popup_window = g.OpenPopupStack[remaining].Window;
- ImGuiWindow* popup_backup_nav_window = g.OpenPopupStack[remaining].BackupNavWindow;
+ ImGuiPopupData prev_popup = g.OpenPopupStack[remaining];
g.OpenPopupStack.resize(remaining);
- if (restore_focus_to_window_under_popup)
+ // Restore focus (unless popup window was not yet submitted, and didn't have a chance to take focus anyhow. See #7325 for an edge case)
+ if (restore_focus_to_window_under_popup && prev_popup.Window)
{
- ImGuiWindow* focus_window = (popup_window && popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : popup_backup_nav_window;
- if (focus_window && !focus_window->WasActive && popup_window)
- {
- // Fallback
- FocusTopMostWindowUnderOne(popup_window, NULL);
- }
+ ImGuiWindow* popup_window = prev_popup.Window;
+ ImGuiWindow* focus_window = (popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow;
+ if (focus_window && !focus_window->WasActive)
+ FocusTopMostWindowUnderOne(popup_window, NULL, NULL, ImGuiFocusRequestFlags_RestoreFocusedChild); // Fallback
else
- {
- if (g.NavLayer == ImGuiNavLayer_Main && focus_window)
- focus_window = NavRestoreLastChildNavWindow(focus_window);
- FocusWindow(focus_window);
- }
+ FocusWindow(focus_window, (g.NavLayer == ImGuiNavLayer_Main) ? ImGuiFocusRequestFlags_RestoreFocusedChild : ImGuiFocusRequestFlags_None);
}
}
@@ -9994,8 +11723,8 @@ void ImGui::CloseCurrentPopup()
window->DC.NavHideHighlightOneFrame = true;
}
-// Attention! BeginPopup() adds default flags which BeginPopupEx()!
-bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags)
+// Attention! BeginPopup() adds default flags when calling BeginPopupEx()!
+bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_window_flags)
{
ImGuiContext& g = *GImGui;
if (!IsPopupOpen(id, ImGuiPopupFlags_None))
@@ -10005,16 +11734,32 @@ bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags)
}
char name[20];
- if (flags & ImGuiWindowFlags_ChildMenu)
- ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginMenuCount); // Recycle windows based on depth
- else
- ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame
+ IM_ASSERT((extra_window_flags & ImGuiWindowFlags_ChildMenu) == 0); // Use BeginPopupMenuEx()
+ ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // No recycling, so we can close/open during the same frame
- flags |= ImGuiWindowFlags_Popup;
- bool is_open = Begin(name, NULL, flags);
+ bool is_open = Begin(name, NULL, extra_window_flags | ImGuiWindowFlags_Popup);
if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display)
EndPopup();
+ //g.CurrentWindow->FocusRouteParentWindow = g.CurrentWindow->ParentWindowInBeginStack;
+ return is_open;
+}
+
+bool ImGui::BeginPopupMenuEx(ImGuiID id, const char* label, ImGuiWindowFlags extra_window_flags)
+{
+ ImGuiContext& g = *GImGui;
+ if (!IsPopupOpen(id, ImGuiPopupFlags_None))
+ {
+ g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
+ return false;
+ }
+ char name[128];
+ IM_ASSERT(extra_window_flags & ImGuiWindowFlags_ChildMenu);
+ ImFormatString(name, IM_ARRAYSIZE(name), "%s###Menu_%02d", label, g.BeginMenuDepth); // Recycle windows based on depth
+ bool is_open = Begin(name, NULL, extra_window_flags | ImGuiWindowFlags_Popup);
+ if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display)
+ EndPopup();
+ //g.CurrentWindow->FocusRouteParentWindow = g.CurrentWindow->ParentWindowInBeginStack;
return is_open;
}
@@ -10032,7 +11777,9 @@ bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags)
}
// If 'p_open' is specified for a modal popup window, the popup will have a regular close button which will close the popup.
-// Note that popup visibility status is owned by Dear ImGui (and manipulated with e.g. OpenPopup) so the actual value of *p_open is meaningless here.
+// Note that popup visibility status is owned by Dear ImGui (and manipulated with e.g. OpenPopup).
+// - *p_open set back to false in BeginPopupModal() when popup is not open.
+// - if you set *p_open to false before calling BeginPopupModal(), it will close the popup.
bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags flags)
{
ImGuiContext& g = *GImGui;
@@ -10041,13 +11788,15 @@ bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags fla
if (!IsPopupOpen(id, ImGuiPopupFlags_None))
{
g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
+ if (p_open && *p_open)
+ *p_open = false;
return false;
}
// Center modal windows by default for increased visibility
// (this won't really last as settings will kick in, and is mostly for backward compatibility. user may do the same themselves)
// FIXME: Should test for (PosCond & window->SetWindowPosAllowFlags) with the upcoming window.
- if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos) == 0)
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasPos) == 0)
{
const ImGuiViewport* viewport = GetMainViewport();
SetNextWindowPos(viewport->GetCenter(), ImGuiCond_FirstUseEver, ImVec2(0.5f, 0.5f));
@@ -10077,11 +11826,11 @@ void ImGui::EndPopup()
NavMoveRequestTryWrapping(window, ImGuiNavMoveFlags_LoopY);
// Child-popups don't need to be laid out
- IM_ASSERT(g.WithinEndChild == false);
+ const ImGuiID backup_within_end_child_id = g.WithinEndChildID;
if (window->Flags & ImGuiWindowFlags_ChildWindow)
- g.WithinEndChild = true;
+ g.WithinEndChildID = window->ID;
End();
- g.WithinEndChild = false;
+ g.WithinEndChildID = backup_within_end_child_id;
}
// Helper to open a popup if mouse button is released over the item
@@ -10272,21 +12021,305 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window)
}
if (window->Flags & ImGuiWindowFlags_Tooltip)
{
- // Position tooltip (always follows mouse)
- float sc = g.Style.MouseCursorScale;
- ImVec2 ref_pos = NavCalcPreferredRefPos();
+ // Position tooltip (always follows mouse + clamp within outer boundaries)
+ // FIXME:
+ // - Too many paths. One problem is that FindBestWindowPosForPopupEx() doesn't allow passing a suggested position (so touch screen path doesn't use it by default).
+ // - Drag and drop tooltips are not using this path either: BeginTooltipEx() manually sets their position.
+ // - Require some tidying up. In theory we could handle both cases in same location, but requires a bit of shuffling
+ // as drag and drop tooltips are calling SetNextWindowPos() leading to 'window_pos_set_by_api' being set in Begin().
+ IM_ASSERT(g.CurrentWindow == window);
+ const float scale = g.Style.MouseCursorScale;
+ const ImVec2 ref_pos = NavCalcPreferredRefPos();
+
+ if (g.IO.MouseSource == ImGuiMouseSource_TouchScreen && NavCalcPreferredRefPosSource() == ImGuiInputSource_Mouse)
+ {
+ ImVec2 tooltip_pos = ref_pos + TOOLTIP_DEFAULT_OFFSET_TOUCH * scale - (TOOLTIP_DEFAULT_PIVOT_TOUCH * window->Size);
+ if (r_outer.Contains(ImRect(tooltip_pos, tooltip_pos + window->Size)))
+ return tooltip_pos;
+ }
+
+ ImVec2 tooltip_pos = ref_pos + TOOLTIP_DEFAULT_OFFSET_MOUSE * scale;
ImRect r_avoid;
- if (!g.NavDisableHighlight && g.NavDisableMouseHover && !(g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos))
+ if (g.NavCursorVisible && g.NavHighlightItemUnderNav && !g.IO.ConfigNavMoveSetMousePos)
r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 16, ref_pos.y + 8);
else
- r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 24 * sc, ref_pos.y + 24 * sc); // FIXME: Hard-coded based on mouse cursor shape expectation. Exact dimension not very important.
- return FindBestWindowPosForPopupEx(ref_pos, window->Size, &window->AutoPosLastDirection, r_outer, r_avoid, ImGuiPopupPositionPolicy_Tooltip);
+ r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 24 * scale, ref_pos.y + 24 * scale); // FIXME: Hard-coded based on mouse cursor shape expectation. Exact dimension not very important.
+ //GetForegroundDrawList()->AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255, 0, 255, 255));
+
+ return FindBestWindowPosForPopupEx(tooltip_pos, window->Size, &window->AutoPosLastDirection, r_outer, r_avoid, ImGuiPopupPositionPolicy_Tooltip);
}
IM_ASSERT(0);
return window->Pos;
}
//-----------------------------------------------------------------------------
+// [SECTION] WINDOW FOCUS
+//----------------------------------------------------------------------------
+// - SetWindowFocus()
+// - SetNextWindowFocus()
+// - IsWindowFocused()
+// - UpdateWindowInFocusOrderList() [Internal]
+// - BringWindowToFocusFront() [Internal]
+// - BringWindowToDisplayFront() [Internal]
+// - BringWindowToDisplayBack() [Internal]
+// - BringWindowToDisplayBehind() [Internal]
+// - FindWindowDisplayIndex() [Internal]
+// - FocusWindow() [Internal]
+// - FocusTopMostWindowUnderOne() [Internal]
+//-----------------------------------------------------------------------------
+
+void ImGui::SetWindowFocus()
+{
+ FocusWindow(GImGui->CurrentWindow);
+}
+
+void ImGui::SetWindowFocus(const char* name)
+{
+ if (name)
+ {
+ if (ImGuiWindow* window = FindWindowByName(name))
+ FocusWindow(window);
+ }
+ else
+ {
+ FocusWindow(NULL);
+ }
+}
+
+void ImGui::SetNextWindowFocus()
+{
+ ImGuiContext& g = *GImGui;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasFocus;
+}
+
+// Similar to IsWindowHovered()
+bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* ref_window = g.NavWindow;
+ ImGuiWindow* cur_window = g.CurrentWindow;
+
+ if (ref_window == NULL)
+ return false;
+ if (flags & ImGuiFocusedFlags_AnyWindow)
+ return true;
+
+ IM_ASSERT(cur_window); // Not inside a Begin()/End()
+ const bool popup_hierarchy = (flags & ImGuiFocusedFlags_NoPopupHierarchy) == 0;
+ if (flags & ImGuiHoveredFlags_RootWindow)
+ cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy);
+
+ if (flags & ImGuiHoveredFlags_ChildWindows)
+ return IsWindowChildOf(ref_window, cur_window, popup_hierarchy);
+ else
+ return (ref_window == cur_window);
+}
+
+static int ImGui::FindWindowFocusIndex(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ IM_UNUSED(g);
+ int order = window->FocusOrder;
+ IM_ASSERT(window->RootWindow == window); // No child window (not testing _ChildWindow because of docking)
+ IM_ASSERT(g.WindowsFocusOrder[order] == window);
+ return order;
+}
+
+static void ImGui::UpdateWindowInFocusOrderList(ImGuiWindow* window, bool just_created, ImGuiWindowFlags new_flags)
+{
+ ImGuiContext& g = *GImGui;
+
+ const bool new_is_explicit_child = (new_flags & ImGuiWindowFlags_ChildWindow) != 0 && ((new_flags & ImGuiWindowFlags_Popup) == 0 || (new_flags & ImGuiWindowFlags_ChildMenu) != 0);
+ const bool child_flag_changed = new_is_explicit_child != window->IsExplicitChild;
+ if ((just_created || child_flag_changed) && !new_is_explicit_child)
+ {
+ IM_ASSERT(!g.WindowsFocusOrder.contains(window));
+ g.WindowsFocusOrder.push_back(window);
+ window->FocusOrder = (short)(g.WindowsFocusOrder.Size - 1);
+ }
+ else if (!just_created && child_flag_changed && new_is_explicit_child)
+ {
+ IM_ASSERT(g.WindowsFocusOrder[window->FocusOrder] == window);
+ for (int n = window->FocusOrder + 1; n < g.WindowsFocusOrder.Size; n++)
+ g.WindowsFocusOrder[n]->FocusOrder--;
+ g.WindowsFocusOrder.erase(g.WindowsFocusOrder.Data + window->FocusOrder);
+ window->FocusOrder = -1;
+ }
+ window->IsExplicitChild = new_is_explicit_child;
+}
+
+void ImGui::BringWindowToFocusFront(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(window == window->RootWindow);
+
+ const int cur_order = window->FocusOrder;
+ IM_ASSERT(g.WindowsFocusOrder[cur_order] == window);
+ if (g.WindowsFocusOrder.back() == window)
+ return;
+
+ const int new_order = g.WindowsFocusOrder.Size - 1;
+ for (int n = cur_order; n < new_order; n++)
+ {
+ g.WindowsFocusOrder[n] = g.WindowsFocusOrder[n + 1];
+ g.WindowsFocusOrder[n]->FocusOrder--;
+ IM_ASSERT(g.WindowsFocusOrder[n]->FocusOrder == n);
+ }
+ g.WindowsFocusOrder[new_order] = window;
+ window->FocusOrder = (short)new_order;
+}
+
+// Note technically focus related but rather adjacent and close to BringWindowToFocusFront()
+void ImGui::BringWindowToDisplayFront(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* current_front_window = g.Windows.back();
+ if (current_front_window == window || current_front_window->RootWindow == window) // Cheap early out (could be better)
+ return;
+ for (int i = g.Windows.Size - 2; i >= 0; i--) // We can ignore the top-most window
+ if (g.Windows[i] == window)
+ {
+ memmove(&g.Windows[i], &g.Windows[i + 1], (size_t)(g.Windows.Size - i - 1) * sizeof(ImGuiWindow*));
+ g.Windows[g.Windows.Size - 1] = window;
+ break;
+ }
+}
+
+void ImGui::BringWindowToDisplayBack(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ if (g.Windows[0] == window)
+ return;
+ for (int i = 0; i < g.Windows.Size; i++)
+ if (g.Windows[i] == window)
+ {
+ memmove(&g.Windows[1], &g.Windows[0], (size_t)i * sizeof(ImGuiWindow*));
+ g.Windows[0] = window;
+ break;
+ }
+}
+
+void ImGui::BringWindowToDisplayBehind(ImGuiWindow* window, ImGuiWindow* behind_window)
+{
+ IM_ASSERT(window != NULL && behind_window != NULL);
+ ImGuiContext& g = *GImGui;
+ window = window->RootWindow;
+ behind_window = behind_window->RootWindow;
+ int pos_wnd = FindWindowDisplayIndex(window);
+ int pos_beh = FindWindowDisplayIndex(behind_window);
+ if (pos_wnd < pos_beh)
+ {
+ size_t copy_bytes = (pos_beh - pos_wnd - 1) * sizeof(ImGuiWindow*);
+ memmove(&g.Windows.Data[pos_wnd], &g.Windows.Data[pos_wnd + 1], copy_bytes);
+ g.Windows[pos_beh - 1] = window;
+ }
+ else
+ {
+ size_t copy_bytes = (pos_wnd - pos_beh) * sizeof(ImGuiWindow*);
+ memmove(&g.Windows.Data[pos_beh + 1], &g.Windows.Data[pos_beh], copy_bytes);
+ g.Windows[pos_beh] = window;
+ }
+}
+
+int ImGui::FindWindowDisplayIndex(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ return g.Windows.index_from_ptr(g.Windows.find(window));
+}
+
+// Moving window to front of display and set focus (which happens to be back of our sorted list)
+void ImGui::FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+
+ // Modal check?
+ if ((flags & ImGuiFocusRequestFlags_UnlessBelowModal) && (g.NavWindow != window)) // Early out in common case.
+ if (ImGuiWindow* blocking_modal = FindBlockingModal(window))
+ {
+ // This block would typically be reached in two situations:
+ // - API call to FocusWindow() with a window under a modal and ImGuiFocusRequestFlags_UnlessBelowModal flag.
+ // - User clicking on void or anything behind a modal while a modal is open (window == NULL)
+ IMGUI_DEBUG_LOG_FOCUS("[focus] FocusWindow(\"%s\", UnlessBelowModal): prevented by \"%s\".\n", window ? window->Name : "<NULL>", blocking_modal->Name);
+ if (window && window == window->RootWindow && (window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0)
+ BringWindowToDisplayBehind(window, blocking_modal); // Still bring right under modal. (FIXME: Could move in focus list too?)
+ ClosePopupsOverWindow(GetTopMostPopupModal(), false); // Note how we need to use GetTopMostPopupModal() aad NOT blocking_modal, to handle nested modals
+ return;
+ }
+
+ // Find last focused child (if any) and focus it instead.
+ if ((flags & ImGuiFocusRequestFlags_RestoreFocusedChild) && window != NULL)
+ window = NavRestoreLastChildNavWindow(window);
+
+ // Apply focus
+ if (g.NavWindow != window)
+ {
+ SetNavWindow(window);
+ if (window && g.NavHighlightItemUnderNav)
+ g.NavMousePosDirty = true;
+ g.NavId = window ? window->NavLastIds[0] : 0; // Restore NavId
+ g.NavLayer = ImGuiNavLayer_Main;
+ SetNavFocusScope(window ? window->NavRootFocusScopeId : 0);
+ g.NavIdIsAlive = false;
+ g.NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid;
+
+ // Close popups if any
+ ClosePopupsOverWindow(window, false);
+ }
+
+ // Move the root window to the top of the pile
+ IM_ASSERT(window == NULL || window->RootWindow != NULL);
+ ImGuiWindow* focus_front_window = window ? window->RootWindow : NULL; // NB: In docking branch this is window->RootWindowDockStop
+ ImGuiWindow* display_front_window = window ? window->RootWindow : NULL;
+
+ // Steal active widgets. Some of the cases it triggers includes:
+ // - Focus a window while an InputText in another window is active, if focus happens before the old InputText can run.
+ // - When using Nav to activate menu items (due to timing of activating on press->new window appears->losing ActiveId)
+ if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != focus_front_window)
+ if (!g.ActiveIdNoClearOnFocusLoss)
+ ClearActiveID();
+
+ // Passing NULL allow to disable keyboard focus
+ if (!window)
+ return;
+
+ // Bring to front
+ BringWindowToFocusFront(focus_front_window);
+ if (((window->Flags | display_front_window->Flags) & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0)
+ BringWindowToDisplayFront(display_front_window);
+}
+
+void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ IM_UNUSED(filter_viewport); // Unused in master branch.
+ int start_idx = g.WindowsFocusOrder.Size - 1;
+ if (under_this_window != NULL)
+ {
+ // Aim at root window behind us, if we are in a child window that's our own root (see #4640)
+ int offset = -1;
+ while (under_this_window->Flags & ImGuiWindowFlags_ChildWindow)
+ {
+ under_this_window = under_this_window->ParentWindow;
+ offset = 0;
+ }
+ start_idx = FindWindowFocusIndex(under_this_window) + offset;
+ }
+ for (int i = start_idx; i >= 0; i--)
+ {
+ // We may later decide to test for different NoXXXInputs based on the active navigation input (mouse vs nav) but that may feel more confusing to the user.
+ ImGuiWindow* window = g.WindowsFocusOrder[i];
+ if (window == ignore_window || !window->WasActive)
+ continue;
+ if ((window->Flags & (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) != (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs))
+ {
+ FocusWindow(window, flags);
+ return;
+ }
+ }
+ FocusWindow(NULL, flags);
+}
+
+//-----------------------------------------------------------------------------
// [SECTION] KEYBOARD/GAMEPAD NAVIGATION
//-----------------------------------------------------------------------------
@@ -10294,6 +12327,23 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window)
// In our terminology those should be interchangeable, yet right now this is super confusing.
// Those two functions are merely a legacy artifact, so at minimum naming should be clarified.
+void ImGui::SetNavCursorVisible(bool visible)
+{
+ ImGuiContext& g = *GImGui;
+ if (g.IO.ConfigNavCursorVisibleAlways)
+ visible = true;
+ g.NavCursorVisible = visible;
+}
+
+// (was called NavRestoreHighlightAfterMove() before 1.91.4)
+void ImGui::SetNavCursorVisibleAfterMove()
+{
+ ImGuiContext& g = *GImGui;
+ if (g.IO.ConfigNavCursorVisibleAuto)
+ g.NavCursorVisible = true;
+ g.NavHighlightItemUnderNav = g.NavMousePosDirty = true;
+}
+
void ImGui::SetNavWindow(ImGuiWindow* window)
{
ImGuiContext& g = *GImGui;
@@ -10301,11 +12351,25 @@ void ImGui::SetNavWindow(ImGuiWindow* window)
{
IMGUI_DEBUG_LOG_FOCUS("[focus] SetNavWindow(\"%s\")\n", window ? window->Name : "<NULL>");
g.NavWindow = window;
+ g.NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid;
}
g.NavInitRequest = g.NavMoveSubmitted = g.NavMoveScoringItems = false;
NavUpdateAnyRequestFlag();
}
+void ImGui::NavHighlightActivated(ImGuiID id)
+{
+ ImGuiContext& g = *GImGui;
+ g.NavHighlightActivatedId = id;
+ g.NavHighlightActivatedTimer = NAV_ACTIVATE_HIGHLIGHT_TIMER;
+}
+
+void ImGui::NavClearPreferredPosForAxis(ImGuiAxis axis)
+{
+ ImGuiContext& g = *GImGui;
+ g.NavWindow->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer][axis] = FLT_MAX;
+}
+
void ImGui::SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel)
{
ImGuiContext& g = *GImGui;
@@ -10313,9 +12377,13 @@ void ImGui::SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id
IM_ASSERT(nav_layer == ImGuiNavLayer_Main || nav_layer == ImGuiNavLayer_Menu);
g.NavId = id;
g.NavLayer = nav_layer;
- g.NavFocusScopeId = focus_scope_id;
+ SetNavFocusScope(focus_scope_id);
g.NavWindow->NavLastIds[nav_layer] = id;
g.NavWindow->NavRectRel[nav_layer] = rect_rel;
+
+ // Clear preferred scoring position (NavMoveRequestApplyResult() will tend to restore it)
+ NavClearPreferredPosForAxis(ImGuiAxis_X);
+ NavClearPreferredPosForAxis(ImGuiAxis_Y);
}
void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window)
@@ -10331,48 +12399,38 @@ void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window)
const ImGuiNavLayer nav_layer = window->DC.NavLayerCurrent;
g.NavId = id;
g.NavLayer = nav_layer;
- g.NavFocusScopeId = g.CurrentFocusScopeId;
+ SetNavFocusScope(g.CurrentFocusScopeId);
window->NavLastIds[nav_layer] = id;
if (g.LastItemData.ID == id)
window->NavRectRel[nav_layer] = WindowRectAbsToRel(window, g.LastItemData.NavRect);
- if (g.ActiveIdSource == ImGuiInputSource_Nav)
- g.NavDisableMouseHover = true;
- else
- g.NavDisableHighlight = true;
+ if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad)
+ g.NavHighlightItemUnderNav = true;
+ else if (g.IO.ConfigNavCursorVisibleAuto)
+ g.NavCursorVisible = false;
+
+ // Clear preferred scoring position (NavMoveRequestApplyResult() will tend to restore it)
+ NavClearPreferredPosForAxis(ImGuiAxis_X);
+ NavClearPreferredPosForAxis(ImGuiAxis_Y);
}
-ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy)
+static ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy)
{
if (ImFabs(dx) > ImFabs(dy))
return (dx > 0.0f) ? ImGuiDir_Right : ImGuiDir_Left;
return (dy > 0.0f) ? ImGuiDir_Down : ImGuiDir_Up;
}
-static float inline NavScoreItemDistInterval(float a0, float a1, float b0, float b1)
+static float inline NavScoreItemDistInterval(float cand_min, float cand_max, float curr_min, float curr_max)
{
- if (a1 < b0)
- return a1 - b0;
- if (b1 < a0)
- return a0 - b1;
+ if (cand_max < curr_min)
+ return cand_max - curr_min;
+ if (curr_max < cand_min)
+ return cand_min - curr_max;
return 0.0f;
}
-static void inline NavClampRectToVisibleAreaForMoveDir(ImGuiDir move_dir, ImRect& r, const ImRect& clip_rect)
-{
- if (move_dir == ImGuiDir_Left || move_dir == ImGuiDir_Right)
- {
- r.Min.y = ImClamp(r.Min.y, clip_rect.Min.y, clip_rect.Max.y);
- r.Max.y = ImClamp(r.Max.y, clip_rect.Min.y, clip_rect.Max.y);
- }
- else // FIXME: PageUp/PageDown are leaving move_dir == None
- {
- r.Min.x = ImClamp(r.Min.x, clip_rect.Min.x, clip_rect.Max.x);
- r.Max.x = ImClamp(r.Max.x, clip_rect.Min.x, clip_rect.Max.x);
- }
-}
-
-// Scoring function for gamepad/keyboard directional navigation. Based on https://gist.github.com/rygorous/6981057
+// Scoring function for keyboard/gamepad directional navigation. Based on https://gist.github.com/rygorous/6981057
static bool ImGui::NavScoreItem(ImGuiNavItemData* result)
{
ImGuiContext& g = *GImGui;
@@ -10388,16 +12446,12 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result)
// When entering through a NavFlattened border, we consider child window items as fully clipped for scoring
if (window->ParentWindow == g.NavWindow)
{
- IM_ASSERT((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened);
+ IM_ASSERT((window->ChildFlags | g.NavWindow->ChildFlags) & ImGuiChildFlags_NavFlattened);
if (!window->ClipRect.Overlaps(cand))
return false;
cand.ClipWithFull(window->ClipRect); // This allows the scored item to not overlap other candidates in the parent window
}
- // We perform scoring on items bounding box clipped by the current clipping rectangle on the other axis (clipping on our movement axis would give us equal scores for all clipped items)
- // For example, this ensures that items in one column are not reached when moving vertically from items in another column.
- NavClampRectToVisibleAreaForMoveDir(g.NavMoveClipDir, cand, window->ClipRect);
-
// Compute distance between boxes
// FIXME-NAV: Introducing biases for vertical navigation, needs to be removed.
float dbx = NavScoreItemDistInterval(cand.Min.x, cand.Max.x, curr.Min.x, curr.Max.x);
@@ -10417,6 +12471,9 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result)
if (dbx != 0.0f || dby != 0.0f)
{
// For non-overlapping boxes, use distance between boxes
+ // FIXME-NAV: Quadrant may be incorrect because of (1) dbx bias and (2) curr.Max.y bias applied by NavBiasScoringRect() where typically curr.Max.y==curr.Min.y
+ // One typical case where this happens, with style.WindowMenuButtonPosition == ImGuiDir_Right, pressing Left to navigate from Close to Collapse tends to fail.
+ // Also see #6344. Calling ImGetDirQuadrantFromDelta() with unbiased values may be good but side-effects are plenty.
dax = dbx;
day = dby;
dist_axial = dist_box;
@@ -10436,32 +12493,41 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result)
quadrant = (g.LastItemData.ID < g.NavId) ? ImGuiDir_Left : ImGuiDir_Right;
}
+ const ImGuiDir move_dir = g.NavMoveDir;
#if IMGUI_DEBUG_NAV_SCORING
- char buf[128];
- if (IsMouseHoveringRect(cand.Min, cand.Max))
- {
- ImFormatString(buf, IM_ARRAYSIZE(buf), "dbox (%.2f,%.2f->%.4f)\ndcen (%.2f,%.2f->%.4f)\nd (%.2f,%.2f->%.4f)\nnav %c, quadrant %c", dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial, "WENS"[g.NavMoveDir], "WENS"[quadrant]);
- ImDrawList* draw_list = GetForegroundDrawList(window);
- draw_list->AddRect(curr.Min, curr.Max, IM_COL32(255,200,0,100));
- draw_list->AddRect(cand.Min, cand.Max, IM_COL32(255,255,0,200));
- draw_list->AddRectFilled(cand.Max - ImVec2(4, 4), cand.Max + CalcTextSize(buf) + ImVec2(4, 4), IM_COL32(40,0,0,150));
- draw_list->AddText(cand.Max, ~0U, buf);
- }
- else if (g.IO.KeyCtrl) // Hold to preview score in matching quadrant. Press C to rotate.
+ char buf[200];
+ if (g.IO.KeyCtrl) // Hold CTRL to preview score in matching quadrant. CTRL+Arrow to rotate.
{
- if (quadrant == g.NavMoveDir)
+ if (quadrant == move_dir)
{
ImFormatString(buf, IM_ARRAYSIZE(buf), "%.0f/%.0f", dist_box, dist_center);
ImDrawList* draw_list = GetForegroundDrawList(window);
- draw_list->AddRectFilled(cand.Min, cand.Max, IM_COL32(255, 0, 0, 200));
+ draw_list->AddRectFilled(cand.Min, cand.Max, IM_COL32(255, 0, 0, 80));
+ draw_list->AddRectFilled(cand.Min, cand.Min + CalcTextSize(buf), IM_COL32(255, 0, 0, 200));
draw_list->AddText(cand.Min, IM_COL32(255, 255, 255, 255), buf);
}
}
+ const bool debug_hovering = IsMouseHoveringRect(cand.Min, cand.Max);
+ const bool debug_tty = (g.IO.KeyCtrl && IsKeyPressed(ImGuiKey_Space));
+ if (debug_hovering || debug_tty)
+ {
+ ImFormatString(buf, IM_ARRAYSIZE(buf),
+ "d-box (%7.3f,%7.3f) -> %7.3f\nd-center (%7.3f,%7.3f) -> %7.3f\nd-axial (%7.3f,%7.3f) -> %7.3f\nnav %c, quadrant %c",
+ dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial, "-WENS"[move_dir+1], "-WENS"[quadrant+1]);
+ if (debug_hovering)
+ {
+ ImDrawList* draw_list = GetForegroundDrawList(window);
+ draw_list->AddRect(curr.Min, curr.Max, IM_COL32(255, 200, 0, 100));
+ draw_list->AddRect(cand.Min, cand.Max, IM_COL32(255, 255, 0, 200));
+ draw_list->AddRectFilled(cand.Max - ImVec2(4, 4), cand.Max + CalcTextSize(buf) + ImVec2(4, 4), IM_COL32(40, 0, 0, 200));
+ draw_list->AddText(cand.Max, ~0U, buf);
+ }
+ if (debug_tty) { IMGUI_DEBUG_LOG_NAV("id 0x%08X\n%s\n", g.LastItemData.ID, buf); }
+ }
#endif
// Is it in the quadrant we're interested in moving to?
bool new_best = false;
- const ImGuiDir move_dir = g.NavMoveDir;
if (quadrant == move_dir)
{
// Does it beat the current best candidate?
@@ -10513,29 +12579,49 @@ static void ImGui::NavApplyItemToResult(ImGuiNavItemData* result)
result->Window = window;
result->ID = g.LastItemData.ID;
result->FocusScopeId = g.CurrentFocusScopeId;
- result->InFlags = g.LastItemData.InFlags;
+ result->ItemFlags = g.LastItemData.ItemFlags;
result->RectRel = WindowRectAbsToRel(window, g.LastItemData.NavRect);
+ if (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData)
+ {
+ IM_ASSERT(g.NextItemData.SelectionUserData != ImGuiSelectionUserData_Invalid);
+ result->SelectionUserData = g.NextItemData.SelectionUserData; // INTENTIONAL: At this point this field is not cleared in NextItemData. Avoid unnecessary copy to LastItemData.
+ }
+}
+
+// True when current work location may be scrolled horizontally when moving left / right.
+// This is generally always true UNLESS within a column. We don't have a vertical equivalent.
+void ImGui::NavUpdateCurrentWindowIsScrollPushableX()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ window->DC.NavIsScrollPushableX = (g.CurrentTable == NULL && window->DC.CurrentColumns == NULL);
}
// We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above)
-// This is called after LastItemData is set.
+// This is called after LastItemData is set, but NextItemData is also still valid.
static void ImGui::NavProcessItem()
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
const ImGuiID id = g.LastItemData.ID;
+ const ImGuiItemFlags item_flags = g.LastItemData.ItemFlags;
+
+ // When inside a container that isn't scrollable with Left<>Right, clip NavRect accordingly (#2221)
+ if (window->DC.NavIsScrollPushableX == false)
+ {
+ g.LastItemData.NavRect.Min.x = ImClamp(g.LastItemData.NavRect.Min.x, window->ClipRect.Min.x, window->ClipRect.Max.x);
+ g.LastItemData.NavRect.Max.x = ImClamp(g.LastItemData.NavRect.Max.x, window->ClipRect.Min.x, window->ClipRect.Max.x);
+ }
const ImRect nav_bb = g.LastItemData.NavRect;
- const ImGuiItemFlags item_flags = g.LastItemData.InFlags;
// Process Init Request
if (g.NavInitRequest && g.NavLayer == window->DC.NavLayerCurrent && (item_flags & ImGuiItemFlags_Disabled) == 0)
{
// Even if 'ImGuiItemFlags_NoNavDefaultFocus' is on (typically collapse/close button) we record the first ResultId so they can be used as a fallback
const bool candidate_for_nav_default_focus = (item_flags & ImGuiItemFlags_NoNavDefaultFocus) == 0;
- if (candidate_for_nav_default_focus || g.NavInitResultId == 0)
+ if (candidate_for_nav_default_focus || g.NavInitResult.ID == 0)
{
- g.NavInitResultId = id;
- g.NavInitResultRectRel = WindowRectAbsToRel(window, nav_bb);
+ NavApplyItemToResult(&g.NavInitResult);
}
if (candidate_for_nav_default_focus)
{
@@ -10546,20 +12632,18 @@ static void ImGui::NavProcessItem()
// Process Move Request (scoring for navigation)
// FIXME-NAV: Consider policy for double scoring (scoring from NavScoringRect + scoring from a rect wrapped according to current wrapping policy)
- if (g.NavMoveScoringItems)
+ if (g.NavMoveScoringItems && (item_flags & ImGuiItemFlags_Disabled) == 0)
{
- const bool is_tab_stop = (item_flags & ImGuiItemFlags_Inputable) && (item_flags & (ImGuiItemFlags_NoTabStop | ImGuiItemFlags_Disabled)) == 0;
- const bool is_tabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) != 0;
- if (is_tabbing)
+ if ((g.NavMoveFlags & ImGuiNavMoveFlags_FocusApi) || (window->Flags & ImGuiWindowFlags_NoNavInputs) == 0)
{
- if (is_tab_stop || (g.NavMoveFlags & ImGuiNavMoveFlags_FocusApi))
- NavProcessItemForTabbingRequest(id);
- }
- else if ((g.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) && !(item_flags & ImGuiItemFlags_Disabled))
- {
- ImGuiNavItemData* result = (window == g.NavWindow) ? &g.NavMoveResultLocal : &g.NavMoveResultOther;
- if (!is_tabbing)
+ const bool is_tabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) != 0;
+ if (is_tabbing)
+ {
+ NavProcessItemForTabbingRequest(id, item_flags, g.NavMoveFlags);
+ }
+ else if (g.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId))
{
+ ImGuiNavItemData* result = (window == g.NavWindow) ? &g.NavMoveResultLocal : &g.NavMoveResultOther;
if (NavScoreItem(result))
NavApplyItemToResult(result);
@@ -10573,15 +12657,21 @@ static void ImGui::NavProcessItem()
}
}
- // Update window-relative bounding box of navigated item
+ // Update information for currently focused/navigated item
if (g.NavId == id)
{
if (g.NavWindow != window)
SetNavWindow(window); // Always refresh g.NavWindow, because some operations such as FocusItem() may not have a window.
g.NavLayer = window->DC.NavLayerCurrent;
+ SetNavFocusScope(g.CurrentFocusScopeId); // Will set g.NavFocusScopeId AND store g.NavFocusScopePath
g.NavFocusScopeId = g.CurrentFocusScopeId;
g.NavIdIsAlive = true;
- window->NavRectRel[window->DC.NavLayerCurrent] = WindowRectAbsToRel(window, nav_bb); // Store item bounding box (relative to window position)
+ if (g.LastItemData.ItemFlags & ImGuiItemFlags_HasSelectionUserData)
+ {
+ IM_ASSERT(g.NextItemData.SelectionUserData != ImGuiSelectionUserData_Invalid);
+ g.NavLastValidSelectionUserData = g.NextItemData.SelectionUserData; // INTENTIONAL: At this point this field is not cleared in NextItemData. Avoid unnecessary copy to LastItemData.
+ }
+ window->NavRectRel[window->DC.NavLayerCurrent] = WindowRectAbsToRel(window, nav_bb); // Store item bounding box (relative to window position)
}
}
@@ -10592,18 +12682,35 @@ static void ImGui::NavProcessItem()
// - Case 3: tab forward wrap: set result to first eligible item (preemptively), on ref id set counter, on next frame if counter hasn't elapsed store result. // FIXME-TABBING: Could be done as a next-frame forwarded request
// - Case 4: tab backward: store all results, on ref id pick prev, stop storing
// - Case 5: tab backward wrap: store all results, on ref id if no result keep storing until last // FIXME-TABBING: Could be done as next-frame forwarded requested
-void ImGui::NavProcessItemForTabbingRequest(ImGuiID id)
+void ImGui::NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flags, ImGuiNavMoveFlags move_flags)
{
ImGuiContext& g = *GImGui;
+ if ((move_flags & ImGuiNavMoveFlags_FocusApi) == 0)
+ {
+ if (g.NavLayer != g.CurrentWindow->DC.NavLayerCurrent)
+ return;
+ if (g.NavFocusScopeId != g.CurrentFocusScopeId)
+ return;
+ }
+
+ // - Can always land on an item when using API call.
+ // - Tabbing with _NavEnableKeyboard (space/enter/arrows): goes through every item.
+ // - Tabbing without _NavEnableKeyboard: goes through inputable items only.
+ bool can_stop;
+ if (move_flags & ImGuiNavMoveFlags_FocusApi)
+ can_stop = true;
+ else
+ can_stop = (item_flags & ImGuiItemFlags_NoTabStop) == 0 && ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) || (item_flags & ImGuiItemFlags_Inputable));
+
// Always store in NavMoveResultLocal (unlike directional request which uses NavMoveResultOther on sibling/flattened windows)
ImGuiNavItemData* result = &g.NavMoveResultLocal;
if (g.NavTabbingDir == +1)
{
// Tab Forward or SetKeyboardFocusHere() with >= 0
- if (g.NavTabbingResultFirst.ID == 0)
+ if (can_stop && g.NavTabbingResultFirst.ID == 0)
NavApplyItemToResult(&g.NavTabbingResultFirst);
- if (--g.NavTabbingCounter == 0)
+ if (can_stop && g.NavTabbingCounter > 0 && --g.NavTabbingCounter == 0)
NavMoveRequestResolveWithLastItem(result);
else if (g.NavId == id)
g.NavTabbingCounter = 1;
@@ -10619,16 +12726,18 @@ void ImGui::NavProcessItemForTabbingRequest(ImGuiID id)
NavUpdateAnyRequestFlag();
}
}
- else
+ else if (can_stop)
{
+ // Keep applying until reaching NavId
NavApplyItemToResult(result);
}
}
else if (g.NavTabbingDir == 0)
{
- // Tab Init
- if (g.NavTabbingResultFirst.ID == 0)
- NavMoveRequestResolveWithLastItem(&g.NavTabbingResultFirst);
+ if (can_stop && g.NavId == id)
+ NavMoveRequestResolveWithLastItem(result);
+ if (can_stop && g.NavTabbingResultFirst.ID == 0) // Tab init
+ NavApplyItemToResult(&g.NavTabbingResultFirst);
}
}
@@ -10643,8 +12752,9 @@ void ImGui::NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavM
{
ImGuiContext& g = *GImGui;
IM_ASSERT(g.NavWindow != NULL);
+ //IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequestSubmit: dir %c, window \"%s\"\n", "-WENS"[move_dir + 1], g.NavWindow->Name);
- if (move_flags & ImGuiNavMoveFlags_Tabbing)
+ if (move_flags & ImGuiNavMoveFlags_IsTabbing)
move_flags |= ImGuiNavMoveFlags_AllowCurrentNavId;
g.NavMoveSubmitted = g.NavMoveScoringItems = true;
@@ -10654,7 +12764,7 @@ void ImGui::NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavM
g.NavMoveFlags = move_flags;
g.NavMoveScrollFlags = scroll_flags;
g.NavMoveForwardToNextFrame = false;
- g.NavMoveKeyMods = g.IO.KeyMods;
+ g.NavMoveKeyMods = (move_flags & ImGuiNavMoveFlags_FocusApi) ? 0 : g.IO.KeyMods;
g.NavMoveResultLocal.Clear();
g.NavMoveResultLocalVisible.Clear();
g.NavMoveResultOther.Clear();
@@ -10671,6 +12781,19 @@ void ImGui::NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result)
NavUpdateAnyRequestFlag();
}
+// Called by TreePop() to implement ImGuiTreeNodeFlags_NavLeftJumpsBackHere
+void ImGui::NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGuiTreeNodeStackData* tree_node_data)
+{
+ ImGuiContext& g = *GImGui;
+ g.NavMoveScoringItems = false;
+ g.LastItemData.ID = tree_node_data->ID;
+ g.LastItemData.ItemFlags = tree_node_data->ItemFlags & ~ImGuiItemFlags_HasSelectionUserData; // Losing SelectionUserData, recovered next-frame (cheaper).
+ g.LastItemData.NavRect = tree_node_data->NavRect;
+ NavApplyItemToResult(result); // Result this instead of implementing a NavApplyPastTreeNodeToResult()
+ NavClearPreferredPosForAxis(ImGuiAxis_Y);
+ NavUpdateAnyRequestFlag();
+}
+
void ImGui::NavMoveRequestCancel()
{
ImGuiContext& g = *GImGui;
@@ -10696,10 +12819,12 @@ void ImGui::NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNav
void ImGui::NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags wrap_flags)
{
ImGuiContext& g = *GImGui;
- IM_ASSERT(wrap_flags != 0); // Call with _WrapX, _WrapY, _LoopX, _LoopY
- // In theory we should test for NavMoveRequestButNoResultYet() but there's no point doing it, NavEndFrame() will do the same test
+ IM_ASSERT((wrap_flags & ImGuiNavMoveFlags_WrapMask_ ) != 0 && (wrap_flags & ~ImGuiNavMoveFlags_WrapMask_) == 0); // Call with _WrapX, _WrapY, _LoopX, _LoopY
+
+ // In theory we should test for NavMoveRequestButNoResultYet() but there's no point doing it:
+ // as NavEndFrame() will do the same test. It will end up calling NavUpdateCreateWrappingRequest().
if (g.NavWindow == window && g.NavMoveScoringItems && g.NavLayer == ImGuiNavLayer_Main)
- g.NavMoveFlags |= wrap_flags;
+ g.NavMoveFlags = (g.NavMoveFlags & ~ImGuiNavMoveFlags_WrapMask_) | wrap_flags;
}
// FIXME: This could be replaced by updating a frame number in each window when (window == NavWindow) and (NavLayer == 0).
@@ -10729,6 +12854,7 @@ void ImGui::NavRestoreLayer(ImGuiNavLayer layer)
{
ImGuiWindow* prev_nav_window = g.NavWindow;
g.NavWindow = NavRestoreLastChildNavWindow(g.NavWindow); // FIXME-NAV: Should clear ongoing nav requests?
+ g.NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid;
if (prev_nav_window)
IMGUI_DEBUG_LOG_FOCUS("[focus] NavRestoreLayer: from \"%s\" to SetNavWindow(\"%s\")\n", prev_nav_window->Name, g.NavWindow->Name);
}
@@ -10744,13 +12870,6 @@ void ImGui::NavRestoreLayer(ImGuiNavLayer layer)
}
}
-void ImGui::NavRestoreHighlightAfterMove()
-{
- ImGuiContext& g = *GImGui;
- g.NavDisableHighlight = false;
- g.NavDisableMouseHover = g.NavMousePosDirty = true;
-}
-
static inline void ImGui::NavUpdateAnyRequestFlag()
{
ImGuiContext& g = *GImGui;
@@ -10768,7 +12887,7 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit)
if (window->Flags & ImGuiWindowFlags_NoNavInputs)
{
g.NavId = 0;
- g.NavFocusScopeId = window->NavRootFocusScopeId;
+ SetNavFocusScope(window->NavRootFocusScopeId);
return;
}
@@ -10781,22 +12900,39 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit)
SetNavID(0, g.NavLayer, window->NavRootFocusScopeId, ImRect());
g.NavInitRequest = true;
g.NavInitRequestFromMove = false;
- g.NavInitResultId = 0;
- g.NavInitResultRectRel = ImRect();
+ g.NavInitResult.ID = 0;
NavUpdateAnyRequestFlag();
}
else
{
g.NavId = window->NavLastIds[0];
- g.NavFocusScopeId = window->NavRootFocusScopeId;
+ SetNavFocusScope(window->NavRootFocusScopeId);
}
}
+static ImGuiInputSource ImGui::NavCalcPreferredRefPosSource()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.NavWindow;
+ const bool activated_shortcut = g.ActiveId != 0 && g.ActiveIdFromShortcut && g.ActiveId == g.LastItemData.ID;
+
+ // Testing for !activated_shortcut here could in theory be removed if we decided that activating a remote shortcut altered one of the g.NavDisableXXX flag.
+ if ((!g.NavCursorVisible || !g.NavHighlightItemUnderNav || !window) && !activated_shortcut)
+ return ImGuiInputSource_Mouse;
+ else
+ return ImGuiInputSource_Keyboard; // or Nav in general
+}
+
static ImVec2 ImGui::NavCalcPreferredRefPos()
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.NavWindow;
- if (g.NavDisableHighlight || !g.NavDisableMouseHover || !window)
+ ImGuiInputSource source = NavCalcPreferredRefPosSource();
+
+ const bool activated_shortcut = g.ActiveId != 0 && g.ActiveIdFromShortcut && g.ActiveId == g.LastItemData.ID;
+
+ // Testing for !activated_shortcut here could in theory be removed if we decided that activating a remote shortcut altered one of the g.NavDisableXXX flag.
+ if (source == ImGuiInputSource_Mouse)
{
// Mouse (we need a fallback in case the mouse becomes invalid after being used)
// The +1.0f offset when stored by OpenPopupEx() allows reopening this or another popup (same or another mouse button) while not moving the mouse, it is pretty standard.
@@ -10807,16 +12943,21 @@ static ImVec2 ImGui::NavCalcPreferredRefPos()
else
{
// When navigation is active and mouse is disabled, pick a position around the bottom left of the currently navigated item
+ ImRect ref_rect;
+ if (activated_shortcut)
+ ref_rect = g.LastItemData.NavRect;
+ else
+ ref_rect = WindowRectRelToAbs(window, window->NavRectRel[g.NavLayer]);
+
// Take account of upcoming scrolling (maybe set mouse pos should be done in EndFrame?)
- ImRect rect_rel = WindowRectRelToAbs(window, window->NavRectRel[g.NavLayer]);
if (window->LastFrameActive != g.FrameCount && (window->ScrollTarget.x != FLT_MAX || window->ScrollTarget.y != FLT_MAX))
{
ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window);
- rect_rel.Translate(window->Scroll - next_scroll);
+ ref_rect.Translate(window->Scroll - next_scroll);
}
- ImVec2 pos = ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight()));
+ ImVec2 pos = ImVec2(ref_rect.Min.x + ImMin(g.Style.FramePadding.x * 4, ref_rect.GetWidth()), ref_rect.Max.y - ImMin(g.Style.FramePadding.y, ref_rect.GetHeight()));
ImGuiViewport* viewport = GetMainViewport();
- return ImFloor(ImClamp(pos, viewport->Pos, viewport->Pos + viewport->Size)); // ImFloor() is important because non-integer mouse position application in backend might be lossy and result in undesirable non-zero delta.
+ return ImTrunc(ImClamp(pos, viewport->Pos, viewport->Pos + viewport->Size)); // ImTrunc() is important because non-integer mouse position application in backend might be lossy and result in undesirable non-zero delta.
}
}
@@ -10867,23 +13008,27 @@ static void ImGui::NavUpdate()
g.NavInputSource = ImGuiInputSource_Keyboard;
// Process navigation init request (select first/default focus)
- if (g.NavInitResultId != 0)
+ g.NavJustMovedToId = 0;
+ g.NavJustMovedToFocusScopeId = g.NavJustMovedFromFocusScopeId = 0;
+ if (g.NavInitResult.ID != 0)
NavInitRequestApplyResult();
g.NavInitRequest = false;
g.NavInitRequestFromMove = false;
- g.NavInitResultId = 0;
- g.NavJustMovedToId = 0;
+ g.NavInitResult.ID = 0;
// Process navigation move request
if (g.NavMoveSubmitted)
NavMoveRequestApplyResult();
g.NavTabbingCounter = 0;
g.NavMoveSubmitted = g.NavMoveScoringItems = false;
+ if (g.NavCursorHideFrames > 0)
+ if (--g.NavCursorHideFrames == 0)
+ g.NavCursorVisible = true;
// Schedule mouse position update (will be done at the bottom of this function, after 1) processing all move requests and 2) updating scrolling)
bool set_mouse_pos = false;
if (g.NavMousePosDirty && g.NavIdIsAlive)
- if (!g.NavDisableHighlight && g.NavDisableMouseHover && g.NavWindow)
+ if (g.NavCursorVisible && g.NavHighlightItemUnderNav && g.NavWindow)
set_mouse_pos = true;
g.NavMousePosDirty = false;
IM_ASSERT(g.NavLayer == ImGuiNavLayer_Main || g.NavLayer == ImGuiNavLayer_Menu);
@@ -10899,20 +13044,20 @@ static void ImGui::NavUpdate()
// Set output flags for user application
io.NavActive = (nav_keyboard_active || nav_gamepad_active) && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs);
- io.NavVisible = (io.NavActive && g.NavId != 0 && !g.NavDisableHighlight) || (g.NavWindowingTarget != NULL);
+ io.NavVisible = (io.NavActive && g.NavId != 0 && g.NavCursorVisible) || (g.NavWindowingTarget != NULL);
// Process NavCancel input (to close a popup, get back to parent, clear focus)
NavUpdateCancelRequest();
// Process manual activation request
- g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavActivateInputId = 0;
+ g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = 0;
g.NavActivateFlags = ImGuiActivateFlags_None;
- if (g.NavId != 0 && !g.NavDisableHighlight && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs))
+ if (g.NavId != 0 && g.NavCursorVisible && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs))
{
- const bool activate_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Space)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadActivate));
- const bool activate_pressed = activate_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Space, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadActivate, false)));
- const bool input_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Enter)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadInput));
- const bool input_pressed = input_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Enter, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadInput, false)));
+ const bool activate_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Space, ImGuiKeyOwner_NoOwner)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadActivate, ImGuiKeyOwner_NoOwner));
+ const bool activate_pressed = activate_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Space, 0, ImGuiKeyOwner_NoOwner)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadActivate, 0, ImGuiKeyOwner_NoOwner)));
+ const bool input_down = (nav_keyboard_active && (IsKeyDown(ImGuiKey_Enter, ImGuiKeyOwner_NoOwner) || IsKeyDown(ImGuiKey_KeypadEnter, ImGuiKeyOwner_NoOwner))) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadInput, ImGuiKeyOwner_NoOwner));
+ const bool input_pressed = input_down && ((nav_keyboard_active && (IsKeyPressed(ImGuiKey_Enter, 0, ImGuiKeyOwner_NoOwner) || IsKeyPressed(ImGuiKey_KeypadEnter, 0, ImGuiKeyOwner_NoOwner))) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadInput, 0, ImGuiKeyOwner_NoOwner)));
if (g.ActiveId == 0 && activate_pressed)
{
g.NavActivateId = g.NavId;
@@ -10920,27 +13065,35 @@ static void ImGui::NavUpdate()
}
if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && input_pressed)
{
- g.NavActivateInputId = g.NavId;
+ g.NavActivateId = g.NavId;
g.NavActivateFlags = ImGuiActivateFlags_PreferInput;
}
- if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && activate_down)
+ if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && (activate_down || input_down))
g.NavActivateDownId = g.NavId;
- if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && activate_pressed)
+ if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && (activate_pressed || input_pressed))
+ {
g.NavActivatePressedId = g.NavId;
+ NavHighlightActivated(g.NavId);
+ }
}
if (g.NavWindow && (g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs))
- g.NavDisableHighlight = true;
+ g.NavCursorVisible = false;
+ else if (g.IO.ConfigNavCursorVisibleAlways && g.NavCursorHideFrames == 0)
+ g.NavCursorVisible = true;
if (g.NavActivateId != 0)
IM_ASSERT(g.NavActivateDownId == g.NavActivateId);
+ // Highlight
+ if (g.NavHighlightActivatedTimer > 0.0f)
+ g.NavHighlightActivatedTimer = ImMax(0.0f, g.NavHighlightActivatedTimer - io.DeltaTime);
+ if (g.NavHighlightActivatedTimer == 0.0f)
+ g.NavHighlightActivatedId = 0;
+
// Process programmatic activation request
// FIXME-NAV: Those should eventually be queued (unlike focus they don't cancel each others)
if (g.NavNextActivateId != 0)
{
- if (g.NavNextActivateFlags & ImGuiActivateFlags_PreferInput)
- g.NavActivateInputId = g.NavNextActivateId;
- else
- g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavNextActivateId;
+ g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavNextActivateId;
g.NavActivateFlags = g.NavNextActivateFlags;
}
g.NavNextActivateId = 0;
@@ -10957,53 +13110,49 @@ static void ImGui::NavUpdate()
{
// *Fallback* manual-scroll with Nav directional keys when window has no navigable item
ImGuiWindow* window = g.NavWindow;
- const float scroll_speed = IM_ROUND(window->CalcFontSize() * 100 * io.DeltaTime); // We need round the scrolling speed because sub-pixel scroll isn't reliably supported.
+ const float scroll_speed = IM_ROUND(window->FontRefSize * 100 * io.DeltaTime); // We need round the scrolling speed because sub-pixel scroll isn't reliably supported.
const ImGuiDir move_dir = g.NavMoveDir;
- if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavHasScroll && move_dir != ImGuiDir_None)
+ if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavWindowHasScrollY && move_dir != ImGuiDir_None)
{
if (move_dir == ImGuiDir_Left || move_dir == ImGuiDir_Right)
- SetScrollX(window, ImFloor(window->Scroll.x + ((move_dir == ImGuiDir_Left) ? -1.0f : +1.0f) * scroll_speed));
+ SetScrollX(window, ImTrunc(window->Scroll.x + ((move_dir == ImGuiDir_Left) ? -1.0f : +1.0f) * scroll_speed));
if (move_dir == ImGuiDir_Up || move_dir == ImGuiDir_Down)
- SetScrollY(window, ImFloor(window->Scroll.y + ((move_dir == ImGuiDir_Up) ? -1.0f : +1.0f) * scroll_speed));
+ SetScrollY(window, ImTrunc(window->Scroll.y + ((move_dir == ImGuiDir_Up) ? -1.0f : +1.0f) * scroll_speed));
}
// *Normal* Manual scroll with LStick
// Next movement request will clamp the NavId reference rectangle to the visible area, so navigation will resume within those bounds.
if (nav_gamepad_active)
{
- const ImVec2 scroll_dir = GetKeyVector2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown);
+ const ImVec2 scroll_dir = GetKeyMagnitude2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown);
const float tweak_factor = IsKeyDown(ImGuiKey_NavGamepadTweakSlow) ? 1.0f / 10.0f : IsKeyDown(ImGuiKey_NavGamepadTweakFast) ? 10.0f : 1.0f;
if (scroll_dir.x != 0.0f && window->ScrollbarX)
- SetScrollX(window, ImFloor(window->Scroll.x + scroll_dir.x * scroll_speed * tweak_factor));
+ SetScrollX(window, ImTrunc(window->Scroll.x + scroll_dir.x * scroll_speed * tweak_factor));
if (scroll_dir.y != 0.0f)
- SetScrollY(window, ImFloor(window->Scroll.y + scroll_dir.y * scroll_speed * tweak_factor));
+ SetScrollY(window, ImTrunc(window->Scroll.y + scroll_dir.y * scroll_speed * tweak_factor));
}
}
// Always prioritize mouse highlight if navigation is disabled
if (!nav_keyboard_active && !nav_gamepad_active)
{
- g.NavDisableHighlight = true;
- g.NavDisableMouseHover = set_mouse_pos = false;
+ g.NavCursorVisible = false;
+ g.NavHighlightItemUnderNav = set_mouse_pos = false;
}
// Update mouse position if requested
// (This will take into account the possibility that a Scroll was queued in the window to offset our absolute mouse position before scroll has been applied)
- if (set_mouse_pos && (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos))
- {
- io.MousePos = io.MousePosPrev = NavCalcPreferredRefPos();
- io.WantSetMousePos = true;
- //IMGUI_DEBUG_LOG_IO("SetMousePos: (%.1f,%.1f)\n", io.MousePos.x, io.MousePos.y);
- }
+ if (set_mouse_pos && io.ConfigNavMoveSetMousePos && (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos))
+ TeleportMousePos(NavCalcPreferredRefPos());
// [DEBUG]
g.NavScoringDebugCount = 0;
#if IMGUI_DEBUG_NAV_RECTS
- if (g.NavWindow)
+ if (ImGuiWindow* debug_window = g.NavWindow)
{
- ImDrawList* draw_list = GetForegroundDrawList(g.NavWindow);
- if (1) { for (int layer = 0; layer < 2; layer++) { ImRect r = WindowRectRelToAbs(g.NavWindow, g.NavWindow->NavRectRel[layer]); draw_list->AddRect(r.Min, r.Max, IM_COL32(255,200,0,255)); } } // [DEBUG]
- if (1) { ImU32 col = (!g.NavWindow->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); draw_list->AddCircleFilled(p, 3.0f, col); draw_list->AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); }
+ ImDrawList* draw_list = GetForegroundDrawList(debug_window);
+ int layer = g.NavLayer; /* for (int layer = 0; layer < 2; layer++)*/ { ImRect r = WindowRectRelToAbs(debug_window, debug_window->NavRectRel[layer]); draw_list->AddRect(r.Min, r.Max, IM_COL32(255, 200, 0, 255)); }
+ //if (1) { ImU32 col = (!debug_window->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); draw_list->AddCircleFilled(p, 3.0f, col); draw_list->AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); }
}
#endif
}
@@ -11015,13 +13164,51 @@ void ImGui::NavInitRequestApplyResult()
if (!g.NavWindow)
return;
+ ImGuiNavItemData* result = &g.NavInitResult;
+ if (g.NavId != result->ID)
+ {
+ g.NavJustMovedFromFocusScopeId = g.NavFocusScopeId;
+ g.NavJustMovedToId = result->ID;
+ g.NavJustMovedToFocusScopeId = result->FocusScopeId;
+ g.NavJustMovedToKeyMods = 0;
+ g.NavJustMovedToIsTabbing = false;
+ g.NavJustMovedToHasSelectionData = (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData) != 0;
+ }
+
// Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called)
// FIXME-NAV: On _NavFlattened windows, g.NavWindow will only be updated during subsequent frame. Not a problem currently.
- IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: ApplyResult: NavID 0x%08X in Layer %d Window \"%s\"\n", g.NavInitResultId, g.NavLayer, g.NavWindow->Name);
- SetNavID(g.NavInitResultId, g.NavLayer, 0, g.NavInitResultRectRel);
+ IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: ApplyResult: NavID 0x%08X in Layer %d Window \"%s\"\n", result->ID, g.NavLayer, g.NavWindow->Name);
+ SetNavID(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel);
g.NavIdIsAlive = true; // Mark as alive from previous frame as we got a result
+ if (result->SelectionUserData != ImGuiSelectionUserData_Invalid)
+ g.NavLastValidSelectionUserData = result->SelectionUserData;
if (g.NavInitRequestFromMove)
- NavRestoreHighlightAfterMove();
+ SetNavCursorVisibleAfterMove();
+}
+
+// Bias scoring rect ahead of scoring + update preferred pos (if missing) using source position
+static void NavBiasScoringRect(ImRect& r, ImVec2& preferred_pos_rel, ImGuiDir move_dir, ImGuiNavMoveFlags move_flags)
+{
+ // Bias initial rect
+ ImGuiContext& g = *GImGui;
+ const ImVec2 rel_to_abs_offset = g.NavWindow->DC.CursorStartPos;
+
+ // Initialize bias on departure if we don't have any. So mouse-click + arrow will record bias.
+ // - We default to L/U bias, so moving down from a large source item into several columns will land on left-most column.
+ // - But each successful move sets new bias on one axis, only cleared when using mouse.
+ if ((move_flags & ImGuiNavMoveFlags_Forwarded) == 0)
+ {
+ if (preferred_pos_rel.x == FLT_MAX)
+ preferred_pos_rel.x = ImMin(r.Min.x + 1.0f, r.Max.x) - rel_to_abs_offset.x;
+ if (preferred_pos_rel.y == FLT_MAX)
+ preferred_pos_rel.y = r.GetCenter().y - rel_to_abs_offset.y;
+ }
+
+ // Apply general bias on the other axis
+ if ((move_dir == ImGuiDir_Up || move_dir == ImGuiDir_Down) && preferred_pos_rel.x != FLT_MAX)
+ r.Min.x = r.Max.x = preferred_pos_rel.x + rel_to_abs_offset.x;
+ else if ((move_dir == ImGuiDir_Left || move_dir == ImGuiDir_Right) && preferred_pos_rel.y != FLT_MAX)
+ r.Min.y = r.Max.y = preferred_pos_rel.y + rel_to_abs_offset.y;
}
void ImGui::NavUpdateCreateMoveRequest()
@@ -11048,11 +13235,11 @@ void ImGui::NavUpdateCreateMoveRequest()
g.NavMoveScrollFlags = ImGuiScrollFlags_None;
if (window && !g.NavWindowingTarget && !(window->Flags & ImGuiWindowFlags_NoNavInputs))
{
- const ImGuiInputFlags repeat_mode = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateNavMove;
- if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadLeft, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_LeftArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Left; }
- if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadRight, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_RightArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Right; }
- if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadUp, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_UpArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Up; }
- if (!IsActiveIdUsingNavDir(ImGuiDir_Down) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadDown, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_DownArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Down; }
+ const ImGuiInputFlags repeat_mode = ImGuiInputFlags_Repeat | (ImGuiInputFlags)ImGuiInputFlags_RepeatRateNavMove;
+ if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadLeft, repeat_mode, ImGuiKeyOwner_NoOwner)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_LeftArrow, repeat_mode, ImGuiKeyOwner_NoOwner)))) { g.NavMoveDir = ImGuiDir_Left; }
+ if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadRight, repeat_mode, ImGuiKeyOwner_NoOwner)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_RightArrow, repeat_mode, ImGuiKeyOwner_NoOwner)))) { g.NavMoveDir = ImGuiDir_Right; }
+ if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadUp, repeat_mode, ImGuiKeyOwner_NoOwner)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_UpArrow, repeat_mode, ImGuiKeyOwner_NoOwner)))) { g.NavMoveDir = ImGuiDir_Up; }
+ if (!IsActiveIdUsingNavDir(ImGuiDir_Down) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadDown, repeat_mode, ImGuiKeyOwner_NoOwner)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_DownArrow, repeat_mode, ImGuiKeyOwner_NoOwner)))) { g.NavMoveDir = ImGuiDir_Down; }
}
g.NavMoveClipDir = g.NavMoveDir;
g.NavScoringNoClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX);
@@ -11069,13 +13256,15 @@ void ImGui::NavUpdateCreateMoveRequest()
g.NavScoringNoClipRect.TranslateY(scoring_rect_offset_y);
}
- // [DEBUG] Always send a request
+ // [DEBUG] Always send a request when holding CTRL. Hold CTRL + Arrow change the direction.
#if IMGUI_DEBUG_NAV_SCORING
- if (io.KeyCtrl && IsKeyPressed(ImGuiKey_C))
- g.NavMoveDirForDebug = (ImGuiDir)((g.NavMoveDirForDebug + 1) & 3);
- if (io.KeyCtrl && g.NavMoveDir == ImGuiDir_None)
+ //if (io.KeyCtrl && IsKeyPressed(ImGuiKey_C))
+ // g.NavMoveDirForDebug = (ImGuiDir)((g.NavMoveDirForDebug + 1) & 3);
+ if (io.KeyCtrl)
{
- g.NavMoveDir = g.NavMoveDirForDebug;
+ if (g.NavMoveDir == ImGuiDir_None)
+ g.NavMoveDir = g.NavMoveDirForDebug;
+ g.NavMoveClipDir = g.NavMoveDir;
g.NavMoveFlags |= ImGuiNavMoveFlags_DebugNoResult;
}
#endif
@@ -11090,23 +13279,29 @@ void ImGui::NavUpdateCreateMoveRequest()
{
IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from move, window \"%s\", layer=%d\n", window ? window->Name : "<NULL>", g.NavLayer);
g.NavInitRequest = g.NavInitRequestFromMove = true;
- g.NavInitResultId = 0;
- g.NavDisableHighlight = false;
+ g.NavInitResult.ID = 0;
+ if (g.IO.ConfigNavCursorVisibleAuto)
+ g.NavCursorVisible = true;
}
// When using gamepad, we project the reference nav bounding box into window visible area.
- // This is to allow resuming navigation inside the visible area after doing a large amount of scrolling, since with gamepad all movements are relative
- // (can't focus a visible object like we can with the mouse).
+ // This is to allow resuming navigation inside the visible area after doing a large amount of scrolling,
+ // since with gamepad all movements are relative (can't focus a visible object like we can with the mouse).
if (g.NavMoveSubmitted && g.NavInputSource == ImGuiInputSource_Gamepad && g.NavLayer == ImGuiNavLayer_Main && window != NULL)// && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded))
{
bool clamp_x = (g.NavMoveFlags & (ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_WrapX)) == 0;
bool clamp_y = (g.NavMoveFlags & (ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapY)) == 0;
ImRect inner_rect_rel = WindowRectAbsToRel(window, ImRect(window->InnerRect.Min - ImVec2(1, 1), window->InnerRect.Max + ImVec2(1, 1)));
+
+ // Take account of changing scroll to handle triggering a new move request on a scrolling frame. (#6171)
+ // Otherwise 'inner_rect_rel' would be off on the move result frame.
+ inner_rect_rel.Translate(CalcNextScrollFromScrollTargetAndClamp(window) - window->Scroll);
+
if ((clamp_x || clamp_y) && !inner_rect_rel.Contains(window->NavRectRel[g.NavLayer]))
{
- //IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: clamp NavRectRel for gamepad move\n");
- float pad_x = ImMin(inner_rect_rel.GetWidth(), window->CalcFontSize() * 0.5f);
- float pad_y = ImMin(inner_rect_rel.GetHeight(), window->CalcFontSize() * 0.5f); // Terrible approximation for the intent of starting navigation from first fully visible item
+ IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: clamp NavRectRel for gamepad move\n");
+ float pad_x = ImMin(inner_rect_rel.GetWidth(), window->FontRefSize * 0.5f);
+ float pad_y = ImMin(inner_rect_rel.GetHeight(), window->FontRefSize * 0.5f); // Terrible approximation for the intent of starting navigation from first fully visible item
inner_rect_rel.Min.x = clamp_x ? (inner_rect_rel.Min.x + pad_x) : -FLT_MAX;
inner_rect_rel.Max.x = clamp_x ? (inner_rect_rel.Max.x - pad_x) : +FLT_MAX;
inner_rect_rel.Min.y = clamp_y ? (inner_rect_rel.Min.y + pad_y) : -FLT_MAX;
@@ -11123,9 +13318,9 @@ void ImGui::NavUpdateCreateMoveRequest()
ImRect nav_rect_rel = !window->NavRectRel[g.NavLayer].IsInverted() ? window->NavRectRel[g.NavLayer] : ImRect(0, 0, 0, 0);
scoring_rect = WindowRectRelToAbs(window, nav_rect_rel);
scoring_rect.TranslateY(scoring_rect_offset_y);
- scoring_rect.Min.x = ImMin(scoring_rect.Min.x + 1.0f, scoring_rect.Max.x);
- scoring_rect.Max.x = scoring_rect.Min.x;
- IM_ASSERT(!scoring_rect.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allow us to remove extraneous ImFabs() calls in NavScoreItem().
+ if (g.NavMoveSubmitted)
+ NavBiasScoringRect(scoring_rect, window->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer], g.NavMoveDir, g.NavMoveFlags);
+ IM_ASSERT(!scoring_rect.IsInverted()); // Ensure we have a non-inverted bounding box here will allow us to remove extraneous ImFabs() calls in NavScoreItem().
//GetForegroundDrawList()->AddRect(scoring_rect.Min, scoring_rect.Max, IM_COL32(255,200,0,255)); // [DEBUG]
//if (!g.NavScoringNoClipRect.IsInverted()) { GetForegroundDrawList()->AddRect(g.NavScoringNoClipRect.Min, g.NavScoringNoClipRect.Max, IM_COL32(255, 200, 0, 255)); } // [DEBUG]
}
@@ -11141,19 +13336,22 @@ void ImGui::NavUpdateCreateTabbingRequest()
if (window == NULL || g.NavWindowingTarget != NULL || (window->Flags & ImGuiWindowFlags_NoNavInputs))
return;
- const bool tab_pressed = IsKeyPressed(ImGuiKey_Tab, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat) && !g.IO.KeyCtrl && !g.IO.KeyAlt;
+ const bool tab_pressed = IsKeyPressed(ImGuiKey_Tab, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner) && !g.IO.KeyCtrl && !g.IO.KeyAlt;
if (!tab_pressed)
return;
// Initiate tabbing request
// (this is ALWAYS ENABLED, regardless of ImGuiConfigFlags_NavEnableKeyboard flag!)
- // Initially this was designed to use counters and modulo arithmetic, but that could not work with unsubmitted items (list clipper). Instead we use a strategy close to other move requests.
// See NavProcessItemForTabbingRequest() for a description of the various forward/backward tabbing cases with and without wrapping.
- //// FIXME: We use (g.ActiveId == 0) but (g.NavDisableHighlight == false) might be righter once we can tab through anything
- g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.ActiveId == 0) ? 0 : +1;
+ const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
+ if (nav_keyboard_active)
+ g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.NavCursorVisible == false && g.ActiveId == 0) ? 0 : +1;
+ else
+ g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.ActiveId == 0) ? 0 : +1;
+ ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_Activate;
ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY;
ImGuiDir clip_dir = (g.NavTabbingDir < 0) ? ImGuiDir_Up : ImGuiDir_Down;
- NavMoveRequestSubmit(ImGuiDir_None, clip_dir, ImGuiNavMoveFlags_Tabbing, scroll_flags); // FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
+ NavMoveRequestSubmit(ImGuiDir_None, clip_dir, move_flags, scroll_flags); // FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
g.NavTabbingCounter = -1;
}
@@ -11170,17 +13368,20 @@ void ImGui::NavMoveRequestApplyResult()
ImGuiNavItemData* result = (g.NavMoveResultLocal.ID != 0) ? &g.NavMoveResultLocal : (g.NavMoveResultOther.ID != 0) ? &g.NavMoveResultOther : NULL;
// Tabbing forward wrap
- if (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing)
+ if ((g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) && result == NULL)
if ((g.NavTabbingCounter == 1 || g.NavTabbingDir == 0) && g.NavTabbingResultFirst.ID)
result = &g.NavTabbingResultFirst;
// In a situation when there are no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result)
+ const ImGuiAxis axis = (g.NavMoveDir == ImGuiDir_Up || g.NavMoveDir == ImGuiDir_Down) ? ImGuiAxis_Y : ImGuiAxis_X;
if (result == NULL)
{
- if (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing)
- g.NavMoveFlags |= ImGuiNavMoveFlags_DontSetNavHighlight;
- if (g.NavId != 0 && (g.NavMoveFlags & ImGuiNavMoveFlags_DontSetNavHighlight) == 0)
- NavRestoreHighlightAfterMove();
+ if (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing)
+ g.NavMoveFlags |= ImGuiNavMoveFlags_NoSetNavCursorVisible;
+ if (g.NavId != 0 && (g.NavMoveFlags & ImGuiNavMoveFlags_NoSetNavCursorVisible) == 0)
+ SetNavCursorVisibleAfterMove();
+ NavClearPreferredPosForAxis(axis); // On a failed move, clear preferred pos for this axis.
+ IMGUI_DEBUG_LOG_NAV("[nav] NavMoveSubmitted but not led to a result!\n");
return;
}
@@ -11198,59 +13399,77 @@ void ImGui::NavMoveRequestApplyResult()
// Scroll to keep newly navigated item fully into view.
if (g.NavLayer == ImGuiNavLayer_Main)
{
+ ImRect rect_abs = WindowRectRelToAbs(result->Window, result->RectRel);
+ ScrollToRectEx(result->Window, rect_abs, g.NavMoveScrollFlags);
+
if (g.NavMoveFlags & ImGuiNavMoveFlags_ScrollToEdgeY)
{
- // FIXME: Should remove this
+ // FIXME: Should remove this? Or make more precise: use ScrollToRectEx() with edge?
float scroll_target = (g.NavMoveDir == ImGuiDir_Up) ? result->Window->ScrollMax.y : 0.0f;
SetScrollY(result->Window, scroll_target);
}
- else
- {
- ImRect rect_abs = WindowRectRelToAbs(result->Window, result->RectRel);
- ScrollToRectEx(result->Window, rect_abs, g.NavMoveScrollFlags);
- }
}
if (g.NavWindow != result->Window)
{
IMGUI_DEBUG_LOG_FOCUS("[focus] NavMoveRequest: SetNavWindow(\"%s\")\n", result->Window->Name);
g.NavWindow = result->Window;
+ g.NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid;
}
- if (g.ActiveId != result->ID)
+
+ // Clear active id unless requested not to
+ // FIXME: ImGuiNavMoveFlags_NoClearActiveId is currently unused as we don't have a clear strategy to preserve active id after interaction,
+ // so this is mostly provided as a gateway for further experiments (see #1418, #2890)
+ if (g.ActiveId != result->ID && (g.NavMoveFlags & ImGuiNavMoveFlags_NoClearActiveId) == 0)
ClearActiveID();
- if (g.NavId != result->ID)
+
+ // Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId)
+ // PageUp/PageDown however sets always set NavJustMovedTo (vs Home/End which doesn't) mimicking Windows behavior.
+ if ((g.NavId != result->ID || (g.NavMoveFlags & ImGuiNavMoveFlags_IsPageMove)) && (g.NavMoveFlags & ImGuiNavMoveFlags_NoSelect) == 0)
{
- // Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId)
+ g.NavJustMovedFromFocusScopeId = g.NavFocusScopeId;
g.NavJustMovedToId = result->ID;
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
g.NavJustMovedToKeyMods = g.NavMoveKeyMods;
+ g.NavJustMovedToIsTabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) != 0;
+ g.NavJustMovedToHasSelectionData = (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData) != 0;
+ //IMGUI_DEBUG_LOG_NAV("[nav] NavJustMovedFromFocusScopeId = 0x%08X, NavJustMovedToFocusScopeId = 0x%08X\n", g.NavJustMovedFromFocusScopeId, g.NavJustMovedToFocusScopeId);
}
- // Focus
+ // Apply new NavID/Focus
IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", result->ID, g.NavLayer, g.NavWindow->Name);
+ ImVec2 preferred_scoring_pos_rel = g.NavWindow->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer];
SetNavID(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel);
+ if (result->SelectionUserData != ImGuiSelectionUserData_Invalid)
+ g.NavLastValidSelectionUserData = result->SelectionUserData;
- // Tabbing: Activates Inputable or Focus non-Inputable
- if ((g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) && (result->InFlags & ImGuiItemFlags_Inputable))
+ // Restore last preferred position for current axis
+ // (storing in RootWindowForNav-> as the info is desirable at the beginning of a Move Request. In theory all storage should use RootWindowForNav..)
+ if ((g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) == 0)
{
- g.NavNextActivateId = result->ID;
- g.NavNextActivateFlags = ImGuiActivateFlags_PreferInput | ImGuiActivateFlags_TryToPreserveState;
- g.NavMoveFlags |= ImGuiNavMoveFlags_DontSetNavHighlight;
+ preferred_scoring_pos_rel[axis] = result->RectRel.GetCenter()[axis];
+ g.NavWindow->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer] = preferred_scoring_pos_rel;
}
+ // Tabbing: Activates Inputable, otherwise only Focus
+ if ((g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) && (result->ItemFlags & ImGuiItemFlags_Inputable) == 0)
+ g.NavMoveFlags &= ~ImGuiNavMoveFlags_Activate;
+
// Activate
if (g.NavMoveFlags & ImGuiNavMoveFlags_Activate)
{
g.NavNextActivateId = result->ID;
g.NavNextActivateFlags = ImGuiActivateFlags_None;
+ if (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing)
+ g.NavNextActivateFlags |= ImGuiActivateFlags_PreferInput | ImGuiActivateFlags_TryToPreserveState | ImGuiActivateFlags_FromTabbing;
}
- // Enable nav highlight
- if ((g.NavMoveFlags & ImGuiNavMoveFlags_DontSetNavHighlight) == 0)
- NavRestoreHighlightAfterMove();
+ // Make nav cursor visible
+ if ((g.NavMoveFlags & ImGuiNavMoveFlags_NoSetNavCursorVisible) == 0)
+ SetNavCursorVisibleAfterMove();
}
-// Process NavCancel input (to close a popup, get back to parent, clear focus)
+// Process Escape/NavCancel input (to close a popup, get back to parent, clear focus)
// FIXME: In order to support e.g. Escape to clear a selection we'll need:
// - either to store the equivalent of ActiveIdUsingKeyInputMask for a FocusScope and test for it.
// - either to move most/all of those tests to the epilogue/end functions of the scope they are dealing with (e.g. exit child window in EndChild()) or in EndFrame(), to allow an earlier intercept
@@ -11259,7 +13478,7 @@ static void ImGui::NavUpdateCancelRequest()
ImGuiContext& g = *GImGui;
const bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (g.IO.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
- if (!(nav_keyboard_active && IsKeyPressed(ImGuiKey_Escape, ImGuiKeyOwner_None)) && !(nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadCancel, ImGuiKeyOwner_None)))
+ if (!(nav_keyboard_active && IsKeyPressed(ImGuiKey_Escape, 0, ImGuiKeyOwner_NoOwner)) && !(nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadCancel, 0, ImGuiKeyOwner_NoOwner)))
return;
IMGUI_DEBUG_LOG_NAV("[nav] NavUpdateCancelRequest()\n");
@@ -11271,18 +13490,17 @@ static void ImGui::NavUpdateCancelRequest()
{
// Leave the "menu" layer
NavRestoreLayer(ImGuiNavLayer_Main);
- NavRestoreHighlightAfterMove();
+ SetNavCursorVisibleAfterMove();
}
- else if (g.NavWindow && g.NavWindow != g.NavWindow->RootWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->ParentWindow)
+ else if (g.NavWindow && g.NavWindow != g.NavWindow->RootWindow && !(g.NavWindow->RootWindowForNav->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->RootWindowForNav->ParentWindow)
{
// Exit child window
- ImGuiWindow* child_window = g.NavWindow;
- ImGuiWindow* parent_window = g.NavWindow->ParentWindow;
+ ImGuiWindow* child_window = g.NavWindow->RootWindowForNav;
+ ImGuiWindow* parent_window = child_window->ParentWindow;
IM_ASSERT(child_window->ChildId != 0);
- ImRect child_rect = child_window->Rect();
FocusWindow(parent_window);
- SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_rect));
- NavRestoreHighlightAfterMove();
+ SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_window->Rect()));
+ SetNavCursorVisibleAfterMove();
}
else if (g.OpenPopupStack.Size > 0 && g.OpenPopupStack.back().Window != NULL && !(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))
{
@@ -11292,9 +13510,16 @@ static void ImGui::NavUpdateCancelRequest()
else
{
// Clear NavLastId for popups but keep it for regular child window so we can leave one and come back where we were
- if (g.NavWindow && ((g.NavWindow->Flags & ImGuiWindowFlags_Popup) || !(g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow)))
- g.NavWindow->NavLastIds[0] = 0;
- g.NavId = 0;
+ // FIXME-NAV: This should happen on window appearing.
+ if (g.IO.ConfigNavEscapeClearFocusItem || g.IO.ConfigNavEscapeClearFocusWindow)
+ if (g.NavWindow && ((g.NavWindow->Flags & ImGuiWindowFlags_Popup)))// || !(g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow)))
+ g.NavWindow->NavLastIds[0] = 0;
+
+ // Clear nav focus
+ if (g.IO.ConfigNavEscapeClearFocusItem || g.IO.ConfigNavEscapeClearFocusWindow)
+ g.NavId = 0;
+ if (g.IO.ConfigNavEscapeClearFocusWindow)
+ FocusWindow(NULL);
}
}
@@ -11309,22 +13534,22 @@ static float ImGui::NavUpdatePageUpPageDown()
if ((window->Flags & ImGuiWindowFlags_NoNavInputs) || g.NavWindowingTarget != NULL)
return 0.0f;
- const bool page_up_held = IsKeyDown(ImGuiKey_PageUp, ImGuiKeyOwner_None);
- const bool page_down_held = IsKeyDown(ImGuiKey_PageDown, ImGuiKeyOwner_None);
- const bool home_pressed = IsKeyPressed(ImGuiKey_Home, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat);
- const bool end_pressed = IsKeyPressed(ImGuiKey_End, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat);
+ const bool page_up_held = IsKeyDown(ImGuiKey_PageUp, ImGuiKeyOwner_NoOwner);
+ const bool page_down_held = IsKeyDown(ImGuiKey_PageDown, ImGuiKeyOwner_NoOwner);
+ const bool home_pressed = IsKeyPressed(ImGuiKey_Home, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner);
+ const bool end_pressed = IsKeyPressed(ImGuiKey_End, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner);
if (page_up_held == page_down_held && home_pressed == end_pressed) // Proceed if either (not both) are pressed, otherwise early out
return 0.0f;
if (g.NavLayer != ImGuiNavLayer_Main)
NavRestoreLayer(ImGuiNavLayer_Main);
- if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavHasScroll)
+ if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavWindowHasScrollY)
{
// Fallback manual-scroll when window has no navigable item
- if (IsKeyPressed(ImGuiKey_PageUp, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat))
+ if (IsKeyPressed(ImGuiKey_PageUp, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner))
SetScrollY(window, window->Scroll.y - window->InnerRect.GetHeight());
- else if (IsKeyPressed(ImGuiKey_PageDown, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat))
+ else if (IsKeyPressed(ImGuiKey_PageDown, ImGuiInputFlags_Repeat, ImGuiKeyOwner_NoOwner))
SetScrollY(window, window->Scroll.y + window->InnerRect.GetHeight());
else if (home_pressed)
SetScrollY(window, 0.0f);
@@ -11334,21 +13559,21 @@ static float ImGui::NavUpdatePageUpPageDown()
else
{
ImRect& nav_rect_rel = window->NavRectRel[g.NavLayer];
- const float page_offset_y = ImMax(0.0f, window->InnerRect.GetHeight() - window->CalcFontSize() * 1.0f + nav_rect_rel.GetHeight());
+ const float page_offset_y = ImMax(0.0f, window->InnerRect.GetHeight() - window->FontRefSize * 1.0f + nav_rect_rel.GetHeight());
float nav_scoring_rect_offset_y = 0.0f;
if (IsKeyPressed(ImGuiKey_PageUp, true))
{
nav_scoring_rect_offset_y = -page_offset_y;
g.NavMoveDir = ImGuiDir_Down; // Because our scoring rect is offset up, we request the down direction (so we can always land on the last item)
g.NavMoveClipDir = ImGuiDir_Up;
- g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet;
+ g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet | ImGuiNavMoveFlags_IsPageMove;
}
else if (IsKeyPressed(ImGuiKey_PageDown, true))
{
nav_scoring_rect_offset_y = +page_offset_y;
g.NavMoveDir = ImGuiDir_Up; // Because our scoring rect is offset down, we request the up direction (so we can always land on the last item)
g.NavMoveClipDir = ImGuiDir_Down;
- g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet;
+ g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet | ImGuiNavMoveFlags_IsPageMove;
}
else if (home_pressed)
{
@@ -11387,8 +13612,7 @@ static void ImGui::NavEndFrame()
// Perform wrap-around in menus
// FIXME-NAV: Wrap may need to apply a weight bias on the other axis. e.g. 4x4 grid with 2 last items missing on last item won't handle LoopY/WrapY correctly.
// FIXME-NAV: Wrap (not Loop) support could be handled by the scoring function and then WrapX would function without an extra frame.
- const ImGuiNavMoveFlags wanted_flags = ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY;
- if (g.NavWindow && NavMoveRequestButNoResultYet() && (g.NavMoveFlags & wanted_flags) && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded) == 0)
+ if (g.NavWindow && NavMoveRequestButNoResultYet() && (g.NavMoveFlags & ImGuiNavMoveFlags_WrapMask_) && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded) == 0)
NavUpdateCreateWrappingRequest();
}
@@ -11400,7 +13624,9 @@ static void ImGui::NavUpdateCreateWrappingRequest()
bool do_forward = false;
ImRect bb_rel = window->NavRectRel[g.NavLayer];
ImGuiDir clip_dir = g.NavMoveDir;
+
const ImGuiNavMoveFlags move_flags = g.NavMoveFlags;
+ //const ImGuiAxis move_axis = (g.NavMoveDir == ImGuiDir_Up || g.NavMoveDir == ImGuiDir_Down) ? ImGuiAxis_Y : ImGuiAxis_X;
if (g.NavMoveDir == ImGuiDir_Left && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX)))
{
bb_rel.Min.x = bb_rel.Max.x = window->ContentSize.x + window->WindowPadding.x;
@@ -11444,17 +13670,17 @@ static void ImGui::NavUpdateCreateWrappingRequest()
if (!do_forward)
return;
window->NavRectRel[g.NavLayer] = bb_rel;
+ NavClearPreferredPosForAxis(ImGuiAxis_X);
+ NavClearPreferredPosForAxis(ImGuiAxis_Y);
NavMoveRequestForward(g.NavMoveDir, clip_dir, move_flags, g.NavMoveScrollFlags);
}
-static int ImGui::FindWindowFocusIndex(ImGuiWindow* window)
+// Can we focus this window with CTRL+TAB (or PadMenu + PadFocusPrev/PadFocusNext)
+// Note that NoNavFocus makes the window not reachable with CTRL+TAB but it can still be focused with mouse or programmatically.
+// If you want a window to never be focused, you may use the e.g. NoInputs flag.
+bool ImGui::IsWindowNavFocusable(ImGuiWindow* window)
{
- ImGuiContext& g = *GImGui;
- IM_UNUSED(g);
- int order = window->FocusOrder;
- IM_ASSERT(window->RootWindow == window); // No child window (not testing _ChildWindow because of docking)
- IM_ASSERT(g.WindowsFocusOrder[order] == window);
- return order;
+ return window->WasActive && window == window->RootWindow && !(window->Flags & ImGuiWindowFlags_NoNavFocus);
}
static ImGuiWindow* FindWindowNavFocusable(int i_start, int i_stop, int dir) // FIXME-OPT O(N)
@@ -11466,7 +13692,7 @@ static ImGuiWindow* FindWindowNavFocusable(int i_start, int i_stop, int dir) //
return NULL;
}
-static void NavUpdateWindowingHighlightWindow(int focus_change_dir)
+static void NavUpdateWindowingTarget(int focus_change_dir)
{
ImGuiContext& g = *GImGui;
IM_ASSERT(g.NavWindowingTarget);
@@ -11485,6 +13711,33 @@ static void NavUpdateWindowingHighlightWindow(int focus_change_dir)
g.NavWindowingToggleLayer = false;
}
+// Apply focus and close overlay
+static void ImGui::NavUpdateWindowingApplyFocus(ImGuiWindow* apply_focus_window)
+{
+ ImGuiContext& g = *GImGui;
+ if (g.NavWindow == NULL || apply_focus_window != g.NavWindow->RootWindow)
+ {
+ ClearActiveID();
+ SetNavCursorVisibleAfterMove();
+ ClosePopupsOverWindow(apply_focus_window, false);
+ FocusWindow(apply_focus_window, ImGuiFocusRequestFlags_RestoreFocusedChild);
+ apply_focus_window = g.NavWindow;
+ if (apply_focus_window->NavLastIds[0] == 0)
+ NavInitWindow(apply_focus_window, false);
+
+ // If the window has ONLY a menu layer (no main layer), select it directly
+ // Use NavLayersActiveMaskNext since windows didn't have a chance to be Begin()-ed on this frame,
+ // so CTRL+Tab where the keys are only held for 1 frame will be able to use correct layers mask since
+ // the target window as already been previewed once.
+ // FIXME-NAV: This should be done in NavInit.. or in FocusWindow... However in both of those cases,
+ // we won't have a guarantee that windows has been visible before and therefore NavLayersActiveMask*
+ // won't be valid.
+ if (apply_focus_window->DC.NavLayersActiveMaskNext == (1 << ImGuiNavLayer_Menu))
+ g.NavLayer = ImGuiNavLayer_Menu;
+ }
+ g.NavWindowingTarget = NULL;
+}
+
// Windowing management mode
// Keyboard: CTRL+Tab (change focus/move/resize), Alt (toggle menu layer)
// Gamepad: Hold Menu/Square (change focus/move/resize), Tap Menu/Square (toggle menu layer)
@@ -11497,7 +13750,7 @@ static void ImGui::NavUpdateWindowing()
bool apply_toggle_layer = false;
ImGuiWindow* modal_window = GetTopMostPopupModal();
- bool allow_windowing = (modal_window == NULL);
+ bool allow_windowing = (modal_window == NULL); // FIXME: This prevent CTRL+TAB from being usable with windows that are inside the Begin-stack of that modal.
if (!allow_windowing)
g.NavWindowingTarget = NULL;
@@ -11510,20 +13763,29 @@ static void ImGui::NavUpdateWindowing()
}
// Start CTRL+Tab or Square+L/R window selection
+ // (g.ConfigNavWindowingKeyNext/g.ConfigNavWindowingKeyPrev defaults are ImGuiMod_Ctrl|ImGuiKey_Tab and ImGuiMod_Ctrl|ImGuiMod_Shift|ImGuiKey_Tab)
+ const ImGuiID owner_id = ImHashStr("##NavUpdateWindowing");
const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
- const bool keyboard_next_window = allow_windowing && g.ConfigNavWindowingKeyNext && Shortcut(g.ConfigNavWindowingKeyNext, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways);
- const bool keyboard_prev_window = allow_windowing && g.ConfigNavWindowingKeyPrev && Shortcut(g.ConfigNavWindowingKeyPrev, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways);
- const bool start_windowing_with_gamepad = allow_windowing && nav_gamepad_active && !g.NavWindowingTarget && IsKeyPressed(ImGuiKey_NavGamepadMenu, 0, ImGuiInputFlags_None);
+ const bool keyboard_next_window = allow_windowing && g.ConfigNavWindowingKeyNext && Shortcut(g.ConfigNavWindowingKeyNext, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways, owner_id);
+ const bool keyboard_prev_window = allow_windowing && g.ConfigNavWindowingKeyPrev && Shortcut(g.ConfigNavWindowingKeyPrev, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways, owner_id);
+ const bool start_windowing_with_gamepad = allow_windowing && nav_gamepad_active && !g.NavWindowingTarget && IsKeyPressed(ImGuiKey_NavGamepadMenu, ImGuiInputFlags_None);
const bool start_windowing_with_keyboard = allow_windowing && !g.NavWindowingTarget && (keyboard_next_window || keyboard_prev_window); // Note: enabled even without NavEnableKeyboard!
+ bool just_started_windowing_from_null_focus = false;
if (start_windowing_with_gamepad || start_windowing_with_keyboard)
if (ImGuiWindow* window = g.NavWindow ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1))
{
- g.NavWindowingTarget = g.NavWindowingTargetAnim = window->RootWindow;
+ g.NavWindowingTarget = g.NavWindowingTargetAnim = window->RootWindow; // Current location
g.NavWindowingTimer = g.NavWindowingHighlightAlpha = 0.0f;
g.NavWindowingAccumDeltaPos = g.NavWindowingAccumDeltaSize = ImVec2(0.0f, 0.0f);
g.NavWindowingToggleLayer = start_windowing_with_gamepad ? true : false; // Gamepad starts toggling layer
g.NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_Keyboard : ImGuiInputSource_Gamepad;
+ if (g.NavWindow == NULL)
+ just_started_windowing_from_null_focus = true;
+
+ // Manually register ownership of our mods. Using a global route in the Shortcut() calls instead would probably be correct but may have more side-effects.
+ if (keyboard_next_window || keyboard_prev_window)
+ SetKeyOwnersForKeyChord((g.ConfigNavWindowingKeyNext | g.ConfigNavWindowingKeyPrev) & ImGuiMod_Mask_, owner_id);
}
// Gamepad update
@@ -11535,9 +13797,9 @@ static void ImGui::NavUpdateWindowing()
// Select window to focus
const int focus_change_dir = (int)IsKeyPressed(ImGuiKey_GamepadL1) - (int)IsKeyPressed(ImGuiKey_GamepadR1);
- if (focus_change_dir != 0)
+ if (focus_change_dir != 0 && !just_started_windowing_from_null_focus)
{
- NavUpdateWindowingHighlightWindow(focus_change_dir);
+ NavUpdateWindowingTarget(focus_change_dir);
g.NavWindowingHighlightAlpha = 1.0f;
}
@@ -11560,35 +13822,45 @@ static void ImGui::NavUpdateWindowing()
ImGuiKeyChord shared_mods = ((g.ConfigNavWindowingKeyNext ? g.ConfigNavWindowingKeyNext : ImGuiMod_Mask_) & (g.ConfigNavWindowingKeyPrev ? g.ConfigNavWindowingKeyPrev : ImGuiMod_Mask_)) & ImGuiMod_Mask_;
IM_ASSERT(shared_mods != 0); // Next/Prev shortcut currently needs a shared modifier to "hold", otherwise Prev actions would keep cycling between two windows.
g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY) / 0.05f)); // 1.0f
- if (keyboard_next_window || keyboard_prev_window)
- NavUpdateWindowingHighlightWindow(keyboard_next_window ? -1 : +1);
+ if ((keyboard_next_window || keyboard_prev_window) && !just_started_windowing_from_null_focus)
+ NavUpdateWindowingTarget(keyboard_next_window ? -1 : +1);
else if ((io.KeyMods & shared_mods) != shared_mods)
apply_focus_window = g.NavWindowingTarget;
}
// Keyboard: Press and Release ALT to toggle menu layer
- // - Testing that only Alt is tested prevents Alt+Shift or AltGR from toggling menu layer.
- // - AltGR is normally Alt+Ctrl but we can't reliably detect it (not all backends/systems/layout emit it as Alt+Ctrl). But even on keyboards without AltGR we don't want Alt+Ctrl to open menu anyway.
- if (nav_keyboard_active && IsKeyPressed(ImGuiMod_Alt, ImGuiKeyOwner_None))
- {
- g.NavWindowingToggleLayer = true;
- g.NavInputSource = ImGuiInputSource_Keyboard;
- }
+ const ImGuiKey windowing_toggle_keys[] = { ImGuiKey_LeftAlt, ImGuiKey_RightAlt };
+ bool windowing_toggle_layer_start = false;
+ if (g.NavWindow != NULL && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs))
+ for (ImGuiKey windowing_toggle_key : windowing_toggle_keys)
+ if (nav_keyboard_active && IsKeyPressed(windowing_toggle_key, 0, ImGuiKeyOwner_NoOwner))
+ {
+ windowing_toggle_layer_start = true;
+ g.NavWindowingToggleLayer = true;
+ g.NavWindowingToggleKey = windowing_toggle_key;
+ g.NavInputSource = ImGuiInputSource_Keyboard;
+ break;
+ }
if (g.NavWindowingToggleLayer && g.NavInputSource == ImGuiInputSource_Keyboard)
{
// We cancel toggling nav layer when any text has been typed (generally while holding Alt). (See #370)
// We cancel toggling nav layer when other modifiers are pressed. (See #4439)
+ // - AltGR is Alt+Ctrl on some layout but we can't reliably detect it (not all backends/systems/layout emit it as Alt+Ctrl).
// We cancel toggling nav layer if an owner has claimed the key.
- if (io.InputQueueCharacters.Size > 0 || io.KeyCtrl || io.KeyShift || io.KeySuper || TestKeyOwner(ImGuiMod_Alt, ImGuiKeyOwner_None) == false)
+ if (io.InputQueueCharacters.Size > 0 || io.KeyCtrl || io.KeyShift || io.KeySuper)
+ g.NavWindowingToggleLayer = false;
+ else if (windowing_toggle_layer_start == false && g.LastKeyboardKeyPressTime == g.Time)
+ g.NavWindowingToggleLayer = false;
+ else if (TestKeyOwner(g.NavWindowingToggleKey, ImGuiKeyOwner_NoOwner) == false || TestKeyOwner(ImGuiMod_Alt, ImGuiKeyOwner_NoOwner) == false)
g.NavWindowingToggleLayer = false;
- // Apply layer toggle on release
+ // Apply layer toggle on Alt release
// Important: as before version <18314 we lacked an explicit IO event for focus gain/loss, we also compare mouse validity to detect old backends clearing mouse pos on focus loss.
- if (IsKeyReleased(ImGuiMod_Alt) && g.NavWindowingToggleLayer)
+ if (IsKeyReleased(g.NavWindowingToggleKey) && g.NavWindowingToggleLayer)
if (g.ActiveId == 0 || g.ActiveIdAllowOverlap)
if (IsMousePosValid(&io.MousePos) == IsMousePosValid(&io.MousePosPrev))
apply_toggle_layer = true;
- if (!IsKeyDown(ImGuiMod_Alt))
+ if (!IsKeyDown(g.NavWindowingToggleKey))
g.NavWindowingToggleLayer = false;
}
@@ -11597,16 +13869,16 @@ static void ImGui::NavUpdateWindowing()
{
ImVec2 nav_move_dir;
if (g.NavInputSource == ImGuiInputSource_Keyboard && !io.KeyShift)
- nav_move_dir = GetKeyVector2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow);
+ nav_move_dir = GetKeyMagnitude2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow);
if (g.NavInputSource == ImGuiInputSource_Gamepad)
- nav_move_dir = GetKeyVector2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown);
+ nav_move_dir = GetKeyMagnitude2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown);
if (nav_move_dir.x != 0.0f || nav_move_dir.y != 0.0f)
{
const float NAV_MOVE_SPEED = 800.0f;
const float move_step = NAV_MOVE_SPEED * io.DeltaTime * ImMin(io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y);
g.NavWindowingAccumDeltaPos += nav_move_dir * move_step;
- g.NavDisableMouseHover = true;
- ImVec2 accum_floored = ImFloor(g.NavWindowingAccumDeltaPos);
+ g.NavHighlightItemUnderNav = true;
+ ImVec2 accum_floored = ImTrunc(g.NavWindowingAccumDeltaPos);
if (accum_floored.x != 0.0f || accum_floored.y != 0.0f)
{
ImGuiWindow* moving_window = g.NavWindowingTarget->RootWindow;
@@ -11617,28 +13889,8 @@ static void ImGui::NavUpdateWindowing()
}
// Apply final focus
- if (apply_focus_window && (g.NavWindow == NULL || apply_focus_window != g.NavWindow->RootWindow))
- {
- ClearActiveID();
- NavRestoreHighlightAfterMove();
- apply_focus_window = NavRestoreLastChildNavWindow(apply_focus_window);
- ClosePopupsOverWindow(apply_focus_window, false);
- FocusWindow(apply_focus_window);
- if (apply_focus_window->NavLastIds[0] == 0)
- NavInitWindow(apply_focus_window, false);
-
- // If the window has ONLY a menu layer (no main layer), select it directly
- // Use NavLayersActiveMaskNext since windows didn't have a chance to be Begin()-ed on this frame,
- // so CTRL+Tab where the keys are only held for 1 frame will be able to use correct layers mask since
- // the target window as already been previewed once.
- // FIXME-NAV: This should be done in NavInit.. or in FocusWindow... However in both of those cases,
- // we won't have a guarantee that windows has been visible before and therefore NavLayersActiveMask*
- // won't be valid.
- if (apply_focus_window->DC.NavLayersActiveMaskNext == (1 << ImGuiNavLayer_Menu))
- g.NavLayer = ImGuiNavLayer_Menu;
- }
if (apply_focus_window)
- g.NavWindowingTarget = NULL;
+ NavUpdateWindowingApplyFocus(apply_focus_window);
// Apply menu/layer toggle
if (apply_toggle_layer && g.NavWindow)
@@ -11667,7 +13919,7 @@ static void ImGui::NavUpdateWindowing()
if (new_nav_layer == ImGuiNavLayer_Menu)
g.NavWindow->NavLastIds[new_nav_layer] = 0;
NavRestoreLayer(new_nav_layer);
- NavRestoreHighlightAfterMove();
+ SetNavCursorVisibleAfterMove();
}
}
}
@@ -11692,12 +13944,14 @@ void ImGui::NavUpdateWindowingOverlay()
return;
if (g.NavWindowingListWindow == NULL)
- g.NavWindowingListWindow = FindWindowByName("###NavWindowingList");
+ g.NavWindowingListWindow = FindWindowByName("##NavWindowingOverlay");
const ImGuiViewport* viewport = GetMainViewport();
SetNextWindowSizeConstraints(ImVec2(viewport->Size.x * 0.20f, viewport->Size.y * 0.20f), ImVec2(FLT_MAX, FLT_MAX));
SetNextWindowPos(viewport->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
PushStyleVar(ImGuiStyleVar_WindowPadding, g.Style.WindowPadding * 2.0f);
- Begin("###NavWindowingList", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings);
+ Begin("##NavWindowingOverlay", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings);
+ if (g.ContextName[0] != 0)
+ SeparatorText(g.ContextName);
for (int n = g.WindowsFocusOrder.Size - 1; n >= 0; n--)
{
ImGuiWindow* window = g.WindowsFocusOrder[n];
@@ -11713,7 +13967,6 @@ void ImGui::NavUpdateWindowingOverlay()
PopStyleVar();
}
-
//-----------------------------------------------------------------------------
// [SECTION] DRAG AND DROP
//-----------------------------------------------------------------------------
@@ -11727,6 +13980,8 @@ bool ImGui::IsDragDropActive()
void ImGui::ClearDragDrop()
{
ImGuiContext& g = *GImGui;
+ if (g.DragDropActive)
+ IMGUI_DEBUG_LOG_ACTIVEID("[dragdrop] ClearDragDrop()\n");
g.DragDropActive = false;
g.DragDropPayload.Clear();
g.DragDropAcceptFlags = ImGuiDragDropFlags_None;
@@ -11738,6 +13993,14 @@ void ImGui::ClearDragDrop()
memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal));
}
+bool ImGui::BeginTooltipHidden()
+{
+ ImGuiContext& g = *GImGui;
+ bool ret = Begin("##Tooltip_Hidden", NULL, ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize);
+ SetWindowHiddenAndSkipItemsForCurrentFrame(g.CurrentWindow);
+ return ret;
+}
+
// When this returns true you need to: a) call SetDragDropPayload() exactly once, b) you may render the payload visual/description, c) call EndDragDropSource()
// If the item has an identifier:
// - This assume/require the item to be activated (typically via ButtonBehavior).
@@ -11757,7 +14020,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
bool source_drag_active = false;
ImGuiID source_id = 0;
ImGuiID source_parent_id = 0;
- if (!(flags & ImGuiDragDropFlags_SourceExtern))
+ if ((flags & ImGuiDragDropFlags_SourceExtern) == 0)
{
source_id = g.LastItemData.ID;
if (source_id != 0)
@@ -11794,7 +14057,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
// Rely on keeping other window->LastItemXXX fields intact.
source_id = g.LastItemData.ID = window->GetIDFromRectangle(g.LastItemData.Rect);
KeepAliveID(source_id);
- bool is_hovered = ItemHoverable(g.LastItemData.Rect, source_id);
+ bool is_hovered = ItemHoverable(g.LastItemData.Rect, source_id, g.LastItemData.ItemFlags);
if (is_hovered && g.IO.MouseClicked[mouse_button])
{
SetActiveID(source_id, window);
@@ -11813,48 +14076,55 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
}
else
{
+ // When ImGuiDragDropFlags_SourceExtern is set:
window = NULL;
source_id = ImHashStr("#SourceExtern");
source_drag_active = true;
+ mouse_button = g.IO.MouseDown[0] ? 0 : -1;
+ KeepAliveID(source_id);
+ SetActiveID(source_id, NULL);
}
- if (source_drag_active)
- {
- if (!g.DragDropActive)
- {
- IM_ASSERT(source_id != 0);
- ClearDragDrop();
- ImGuiPayload& payload = g.DragDropPayload;
- payload.SourceId = source_id;
- payload.SourceParentId = source_parent_id;
- g.DragDropActive = true;
- g.DragDropSourceFlags = flags;
- g.DragDropMouseButton = mouse_button;
- if (payload.SourceId == g.ActiveId)
- g.ActiveIdNoClearOnFocusLoss = true;
- }
- g.DragDropSourceFrameCount = g.FrameCount;
- g.DragDropWithinSource = true;
+ IM_ASSERT(g.DragDropWithinTarget == false); // Can't nest BeginDragDropSource() and BeginDragDropTarget()
+ if (!source_drag_active)
+ return false;
- if (!(flags & ImGuiDragDropFlags_SourceNoPreviewTooltip))
- {
- // Target can request the Source to not display its tooltip (we use a dedicated flag to make this request explicit)
- // We unfortunately can't just modify the source flags and skip the call to BeginTooltip, as caller may be emitting contents.
- BeginTooltip();
- if (g.DragDropAcceptIdPrev && (g.DragDropAcceptFlags & ImGuiDragDropFlags_AcceptNoPreviewTooltip))
- {
- ImGuiWindow* tooltip_window = g.CurrentWindow;
- tooltip_window->Hidden = tooltip_window->SkipItems = true;
- tooltip_window->HiddenFramesCanSkipItems = 1;
- }
- }
+ // Activate drag and drop
+ if (!g.DragDropActive)
+ {
+ IM_ASSERT(source_id != 0);
+ ClearDragDrop();
+ IMGUI_DEBUG_LOG_ACTIVEID("[dragdrop] BeginDragDropSource() DragDropActive = true, source_id = 0x%08X%s\n",
+ source_id, (flags & ImGuiDragDropFlags_SourceExtern) ? " (EXTERN)" : "");
+ ImGuiPayload& payload = g.DragDropPayload;
+ payload.SourceId = source_id;
+ payload.SourceParentId = source_parent_id;
+ g.DragDropActive = true;
+ g.DragDropSourceFlags = flags;
+ g.DragDropMouseButton = mouse_button;
+ if (payload.SourceId == g.ActiveId)
+ g.ActiveIdNoClearOnFocusLoss = true;
+ }
+ g.DragDropSourceFrameCount = g.FrameCount;
+ g.DragDropWithinSource = true;
+
+ if (!(flags & ImGuiDragDropFlags_SourceNoPreviewTooltip))
+ {
+ // Target can request the Source to not display its tooltip (we use a dedicated flag to make this request explicit)
+ // We unfortunately can't just modify the source flags and skip the call to BeginTooltip, as caller may be emitting contents.
+ bool ret;
+ if (g.DragDropAcceptIdPrev && (g.DragDropAcceptFlags & ImGuiDragDropFlags_AcceptNoPreviewTooltip))
+ ret = BeginTooltipHidden();
+ else
+ ret = BeginTooltip();
+ IM_ASSERT(ret); // FIXME-NEWBEGIN: If this ever becomes false, we need to Begin("##Hidden", NULL, ImGuiWindowFlags_NoSavedSettings) + SetWindowHiddendAndSkipItemsForCurrentFrame().
+ IM_UNUSED(ret);
+ }
- if (!(flags & ImGuiDragDropFlags_SourceNoDisableHover) && !(flags & ImGuiDragDropFlags_SourceExtern))
- g.LastItemData.StatusFlags &= ~ImGuiItemStatusFlags_HoveredRect;
+ if (!(flags & ImGuiDragDropFlags_SourceNoDisableHover) && !(flags & ImGuiDragDropFlags_SourceExtern))
+ g.LastItemData.StatusFlags &= ~ImGuiItemStatusFlags_HoveredRect;
- return true;
- }
- return false;
+ return true;
}
void ImGui::EndDragDropSource()
@@ -11881,10 +14151,10 @@ bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_s
cond = ImGuiCond_Always;
IM_ASSERT(type != NULL);
- IM_ASSERT(strlen(type) < IM_ARRAYSIZE(payload.DataType) && "Payload type can be at most 32 characters long");
+ IM_ASSERT(ImStrlen(type) < IM_ARRAYSIZE(payload.DataType) && "Payload type can be at most 32 characters long");
IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0));
IM_ASSERT(cond == ImGuiCond_Always || cond == ImGuiCond_Once);
- IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource()
+ IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource()
if (cond == ImGuiCond_Always || payload.DataFrameCount == -1)
{
@@ -11933,15 +14203,16 @@ bool ImGui::BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id)
if (window->SkipItems)
return false;
- IM_ASSERT(g.DragDropWithinTarget == false);
+ IM_ASSERT(g.DragDropWithinTarget == false && g.DragDropWithinSource == false); // Can't nest BeginDragDropSource() and BeginDragDropTarget()
g.DragDropTargetRect = bb;
+ g.DragDropTargetClipRect = window->ClipRect; // May want to be overridden by user depending on use case?
g.DragDropTargetId = id;
g.DragDropWithinTarget = true;
return true;
}
// We don't use BeginDragDropTargetCustom() and duplicate its code because:
-// 1) we use LastItemRectHoveredRect which handles items that push a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them.
+// 1) we use LastItemData's ImGuiItemStatusFlags_HoveredRect which handles items that push a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them.
// 2) and it's faster. as this code may be very frequently called, we want to early out as fast as we can.
// Also note how the HoveredWindow test is positioned differently in both functions (in both functions we optimize for the cheapest early out case)
bool ImGui::BeginDragDropTarget()
@@ -11967,8 +14238,9 @@ bool ImGui::BeginDragDropTarget()
if (g.DragDropPayload.SourceId == id)
return false;
- IM_ASSERT(g.DragDropWithinTarget == false);
+ IM_ASSERT(g.DragDropWithinTarget == false && g.DragDropWithinSource == false); // Can't nest BeginDragDropSource() and BeginDragDropTarget()
g.DragDropTargetRect = display_rect;
+ g.DragDropTargetClipRect = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasClipRect) ? g.LastItemData.ClipRect : window->ClipRect;
g.DragDropTargetId = id;
g.DragDropWithinTarget = true;
return true;
@@ -11983,7 +14255,6 @@ bool ImGui::IsDragDropPayloadBeingAccepted()
const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags)
{
ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
ImGuiPayload& payload = g.DragDropPayload;
IM_ASSERT(g.DragDropActive); // Not called between BeginDragDropTarget() and EndDragDropTarget() ?
IM_ASSERT(payload.DataFrameCount != -1); // Forgot to call EndDragDropTarget() ?
@@ -11995,31 +14266,47 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop
const bool was_accepted_previously = (g.DragDropAcceptIdPrev == g.DragDropTargetId);
ImRect r = g.DragDropTargetRect;
float r_surface = r.GetWidth() * r.GetHeight();
- if (r_surface <= g.DragDropAcceptIdCurrRectSurface)
- {
- g.DragDropAcceptFlags = flags;
- g.DragDropAcceptIdCurr = g.DragDropTargetId;
- g.DragDropAcceptIdCurrRectSurface = r_surface;
- }
+ if (r_surface > g.DragDropAcceptIdCurrRectSurface)
+ return NULL;
+
+ g.DragDropAcceptFlags = flags;
+ g.DragDropAcceptIdCurr = g.DragDropTargetId;
+ g.DragDropAcceptIdCurrRectSurface = r_surface;
+ //IMGUI_DEBUG_LOG("AcceptDragDropPayload(): %08X: accept\n", g.DragDropTargetId);
// Render default drop visuals
payload.Preview = was_accepted_previously;
flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that live for 1 frame)
if (!(flags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect) && payload.Preview)
- window->DrawList->AddRect(r.Min - ImVec2(3.5f,3.5f), r.Max + ImVec2(3.5f, 3.5f), GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f);
+ RenderDragDropTargetRect(r, g.DragDropTargetClipRect);
g.DragDropAcceptFrameCount = g.FrameCount;
- payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting os window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased()
+ if ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceExtern) && g.DragDropMouseButton == -1)
+ payload.Delivery = was_accepted_previously && (g.DragDropSourceFrameCount < g.FrameCount);
+ else
+ payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting OS window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased()
if (!payload.Delivery && !(flags & ImGuiDragDropFlags_AcceptBeforeDelivery))
return NULL;
+ if (payload.Delivery)
+ IMGUI_DEBUG_LOG_ACTIVEID("[dragdrop] AcceptDragDropPayload(): 0x%08X: payload delivery\n", g.DragDropTargetId);
return &payload;
}
-// FIXME-DRAGDROP: Settle on a proper default visuals for drop target.
-void ImGui::RenderDragDropTargetRect(const ImRect& bb)
+// FIXME-STYLE FIXME-DRAGDROP: Settle on a proper default visuals for drop target.
+void ImGui::RenderDragDropTargetRect(const ImRect& bb, const ImRect& item_clip_rect)
{
- GetWindowDrawList()->AddRect(bb.Min - ImVec2(3.5f, 3.5f), bb.Max + ImVec2(3.5f, 3.5f), GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f);
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ ImRect bb_display = bb;
+ bb_display.ClipWith(item_clip_rect); // Clip THEN expand so we have a way to visualize that target is not entirely visible.
+ bb_display.Expand(3.5f);
+ bool push_clip_rect = !window->ClipRect.Contains(bb_display);
+ if (push_clip_rect)
+ window->DrawList->PushClipRectFullScreen();
+ window->DrawList->AddRect(bb_display.Min, bb_display.Max, GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f);
+ if (push_clip_rect)
+ window->DrawList->PopClipRect();
}
const ImGuiPayload* ImGui::GetDragDropPayload()
@@ -12028,13 +14315,16 @@ const ImGuiPayload* ImGui::GetDragDropPayload()
return (g.DragDropActive && g.DragDropPayload.DataFrameCount != -1) ? &g.DragDropPayload : NULL;
}
-// We don't really use/need this now, but added it for the sake of consistency and because we might need it later.
void ImGui::EndDragDropTarget()
{
ImGuiContext& g = *GImGui;
IM_ASSERT(g.DragDropActive);
IM_ASSERT(g.DragDropWithinTarget);
g.DragDropWithinTarget = false;
+
+ // Clear drag and drop state payload right after delivery
+ if (g.DragDropPayload.Delivery)
+ ClearDragDrop();
}
//-----------------------------------------------------------------------------
@@ -12105,7 +14395,7 @@ void ImGui::LogRenderedText(const ImVec2* ref_pos, const char* text, const char*
}
if (prefix)
- LogRenderedText(ref_pos, prefix, prefix + strlen(prefix)); // Calculate end ourself to ensure "##" are included here.
+ LogRenderedText(ref_pos, prefix, prefix + ImStrlen(prefix)); // Calculate end ourself to ensure "##" are included here.
// Re-adjust padding if we have popped out of our starting depth
if (g.LogDepthRef > window->DC.TreeDepth)
@@ -12138,19 +14428,21 @@ void ImGui::LogRenderedText(const ImVec2* ref_pos, const char* text, const char*
}
if (suffix)
- LogRenderedText(ref_pos, suffix, suffix + strlen(suffix));
+ LogRenderedText(ref_pos, suffix, suffix + ImStrlen(suffix));
}
// Start logging/capturing text output
-void ImGui::LogBegin(ImGuiLogType type, int auto_open_depth)
+void ImGui::LogBegin(ImGuiLogFlags flags, int auto_open_depth)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
IM_ASSERT(g.LogEnabled == false);
- IM_ASSERT(g.LogFile == NULL);
- IM_ASSERT(g.LogBuffer.empty());
- g.LogEnabled = true;
- g.LogType = type;
+ IM_ASSERT(g.LogFile == NULL && g.LogBuffer.empty());
+ IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiLogFlags_OutputMask_)); // Check that only 1 type flag is used
+
+ g.LogEnabled = g.ItemUnclipByLog = true;
+ g.LogFlags = flags;
+ g.LogWindow = window;
g.LogNextPrefix = g.LogNextSuffix = NULL;
g.LogDepthRef = window->DC.TreeDepth;
g.LogDepthToExpand = ((auto_open_depth >= 0) ? auto_open_depth : g.LogDepthToExpandDefault);
@@ -12173,7 +14465,7 @@ void ImGui::LogToTTY(int auto_open_depth)
return;
IM_UNUSED(auto_open_depth);
#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
- LogBegin(ImGuiLogType_TTY, auto_open_depth);
+ LogBegin(ImGuiLogFlags_OutputTTY, auto_open_depth);
g.LogFile = stdout;
#endif
}
@@ -12199,7 +14491,7 @@ void ImGui::LogToFile(int auto_open_depth, const char* filename)
return;
}
- LogBegin(ImGuiLogType_File, auto_open_depth);
+ LogBegin(ImGuiLogFlags_OutputFile, auto_open_depth);
g.LogFile = f;
}
@@ -12209,7 +14501,7 @@ void ImGui::LogToClipboard(int auto_open_depth)
ImGuiContext& g = *GImGui;
if (g.LogEnabled)
return;
- LogBegin(ImGuiLogType_Clipboard, auto_open_depth);
+ LogBegin(ImGuiLogFlags_OutputClipboard, auto_open_depth);
}
void ImGui::LogToBuffer(int auto_open_depth)
@@ -12217,7 +14509,7 @@ void ImGui::LogToBuffer(int auto_open_depth)
ImGuiContext& g = *GImGui;
if (g.LogEnabled)
return;
- LogBegin(ImGuiLogType_Buffer, auto_open_depth);
+ LogBegin(ImGuiLogFlags_OutputBuffer, auto_open_depth);
}
void ImGui::LogFinish()
@@ -12227,29 +14519,29 @@ void ImGui::LogFinish()
return;
LogText(IM_NEWLINE);
- switch (g.LogType)
+ switch (g.LogFlags & ImGuiLogFlags_OutputMask_)
{
- case ImGuiLogType_TTY:
+ case ImGuiLogFlags_OutputTTY:
#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
fflush(g.LogFile);
#endif
break;
- case ImGuiLogType_File:
+ case ImGuiLogFlags_OutputFile:
ImFileClose(g.LogFile);
break;
- case ImGuiLogType_Buffer:
+ case ImGuiLogFlags_OutputBuffer:
break;
- case ImGuiLogType_Clipboard:
+ case ImGuiLogFlags_OutputClipboard:
if (!g.LogBuffer.empty())
SetClipboardText(g.LogBuffer.begin());
break;
- case ImGuiLogType_None:
+ default:
IM_ASSERT(0);
break;
}
- g.LogEnabled = false;
- g.LogType = ImGuiLogType_None;
+ g.LogEnabled = g.ItemUnclipByLog = false;
+ g.LogFlags = ImGuiLogFlags_None;
g.LogFile = NULL;
g.LogBuffer.clear();
}
@@ -12268,10 +14560,10 @@ void ImGui::LogButtons()
#endif
const bool log_to_file = Button("Log To File"); SameLine();
const bool log_to_clipboard = Button("Log To Clipboard"); SameLine();
- PushAllowKeyboardFocus(false);
+ PushItemFlag(ImGuiItemFlags_NoTabStop, true);
SetNextItemWidth(80.0f);
SliderInt("Default Depth", &g.LogDepthToExpandDefault, 0, 9, NULL);
- PopAllowKeyboardFocus();
+ PopItemFlag();
PopID();
// Start logging at the end of the function so that the buttons don't appear in the log
@@ -12283,21 +14575,22 @@ void ImGui::LogButtons()
LogToClipboard();
}
-
//-----------------------------------------------------------------------------
// [SECTION] SETTINGS
//-----------------------------------------------------------------------------
// - UpdateSettings() [Internal]
// - MarkIniSettingsDirty() [Internal]
-// - CreateNewWindowSettings() [Internal]
-// - FindWindowSettings() [Internal]
-// - FindOrCreateWindowSettings() [Internal]
// - FindSettingsHandler() [Internal]
// - ClearIniSettings() [Internal]
// - LoadIniSettingsFromDisk()
// - LoadIniSettingsFromMemory()
// - SaveIniSettingsToDisk()
// - SaveIniSettingsToMemory()
+//-----------------------------------------------------------------------------
+// - CreateNewWindowSettings() [Internal]
+// - FindWindowSettingsByID() [Internal]
+// - FindWindowSettingsByWindow() [Internal]
+// - ClearWindowSettings() [Internal]
// - WindowSettingsHandler_***() [Internal]
//-----------------------------------------------------------------------------
@@ -12344,44 +14637,6 @@ void ImGui::MarkIniSettingsDirty(ImGuiWindow* window)
g.SettingsDirtyTimer = g.IO.IniSavingRate;
}
-ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
-{
- ImGuiContext& g = *GImGui;
-
-#if !IMGUI_DEBUG_INI_SETTINGS
- // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
- // Preserve the full string when IMGUI_DEBUG_INI_SETTINGS is set to make .ini inspection easier.
- if (const char* p = strstr(name, "###"))
- name = p;
-#endif
- const size_t name_len = strlen(name);
-
- // Allocate chunk
- const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1;
- ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size);
- IM_PLACEMENT_NEW(settings) ImGuiWindowSettings();
- settings->ID = ImHashStr(name, name_len);
- memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator
-
- return settings;
-}
-
-ImGuiWindowSettings* ImGui::FindWindowSettings(ImGuiID id)
-{
- ImGuiContext& g = *GImGui;
- for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
- if (settings->ID == id)
- return settings;
- return NULL;
-}
-
-ImGuiWindowSettings* ImGui::FindOrCreateWindowSettings(const char* name)
-{
- if (ImGuiWindowSettings* settings = FindWindowSettings(ImHashStr(name)))
- return settings;
- return CreateNewWindowSettings(name);
-}
-
void ImGui::AddSettingsHandler(const ImGuiSettingsHandler* handler)
{
ImGuiContext& g = *GImGui;
@@ -12400,19 +14655,20 @@ ImGuiSettingsHandler* ImGui::FindSettingsHandler(const char* type_name)
{
ImGuiContext& g = *GImGui;
const ImGuiID type_hash = ImHashStr(type_name);
- for (int handler_n = 0; handler_n < g.SettingsHandlers.Size; handler_n++)
- if (g.SettingsHandlers[handler_n].TypeHash == type_hash)
- return &g.SettingsHandlers[handler_n];
+ for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
+ if (handler.TypeHash == type_hash)
+ return &handler;
return NULL;
}
+// Clear all settings (windows, tables, docking etc.)
void ImGui::ClearIniSettings()
{
ImGuiContext& g = *GImGui;
g.SettingsIniData.clear();
- for (int handler_n = 0; handler_n < g.SettingsHandlers.Size; handler_n++)
- if (g.SettingsHandlers[handler_n].ClearAllFn)
- g.SettingsHandlers[handler_n].ClearAllFn(&g, &g.SettingsHandlers[handler_n]);
+ for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
+ if (handler.ClearAllFn != NULL)
+ handler.ClearAllFn(&g, &handler);
}
void ImGui::LoadIniSettingsFromDisk(const char* ini_filename)
@@ -12427,6 +14683,7 @@ void ImGui::LoadIniSettingsFromDisk(const char* ini_filename)
}
// Zero-tolerance, no error reporting, cheap .ini parsing
+// Set ini_size==0 to let us use strlen(ini_data). Do not call this function with a 0 if your buffer is actually empty!
void ImGui::LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size)
{
ImGuiContext& g = *GImGui;
@@ -12437,7 +14694,7 @@ void ImGui::LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size)
// For user convenience, we allow passing a non zero-terminated string (hence the ini_size parameter).
// For our convenience and to make the code simpler, we'll also write zero-terminators within the buffer. So let's create a writable copy..
if (ini_size == 0)
- ini_size = strlen(ini_data);
+ ini_size = ImStrlen(ini_data);
g.SettingsIniData.Buf.resize((int)ini_size + 1);
char* const buf = g.SettingsIniData.Buf.Data;
char* const buf_end = buf + ini_size;
@@ -12446,9 +14703,9 @@ void ImGui::LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size)
// Call pre-read handlers
// Some types will clear their data (e.g. dock information) some types will allow merge/override (window)
- for (int handler_n = 0; handler_n < g.SettingsHandlers.Size; handler_n++)
- if (g.SettingsHandlers[handler_n].ReadInitFn)
- g.SettingsHandlers[handler_n].ReadInitFn(&g, &g.SettingsHandlers[handler_n]);
+ for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
+ if (handler.ReadInitFn != NULL)
+ handler.ReadInitFn(&g, &handler);
void* entry_data = NULL;
ImGuiSettingsHandler* entry_handler = NULL;
@@ -12492,9 +14749,9 @@ void ImGui::LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size)
memcpy(buf, ini_data, ini_size);
// Call post-read handlers
- for (int handler_n = 0; handler_n < g.SettingsHandlers.Size; handler_n++)
- if (g.SettingsHandlers[handler_n].ApplyAllFn)
- g.SettingsHandlers[handler_n].ApplyAllFn(&g, &g.SettingsHandlers[handler_n]);
+ for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
+ if (handler.ApplyAllFn != NULL)
+ handler.ApplyAllFn(&g, &handler);
}
void ImGui::SaveIniSettingsToDisk(const char* ini_filename)
@@ -12520,29 +14777,86 @@ const char* ImGui::SaveIniSettingsToMemory(size_t* out_size)
g.SettingsDirtyTimer = 0.0f;
g.SettingsIniData.Buf.resize(0);
g.SettingsIniData.Buf.push_back(0);
- for (int handler_n = 0; handler_n < g.SettingsHandlers.Size; handler_n++)
- {
- ImGuiSettingsHandler* handler = &g.SettingsHandlers[handler_n];
- handler->WriteAllFn(&g, handler, &g.SettingsIniData);
- }
+ for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
+ handler.WriteAllFn(&g, &handler, &g.SettingsIniData);
if (out_size)
*out_size = (size_t)g.SettingsIniData.size();
return g.SettingsIniData.c_str();
}
+ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
+{
+ ImGuiContext& g = *GImGui;
+
+ if (g.IO.ConfigDebugIniSettings == false)
+ {
+ // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
+ // Preserve the full string when ConfigDebugVerboseIniSettings is set to make .ini inspection easier.
+ if (const char* p = strstr(name, "###"))
+ name = p;
+ }
+ const size_t name_len = ImStrlen(name);
+
+ // Allocate chunk
+ const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1;
+ ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size);
+ IM_PLACEMENT_NEW(settings) ImGuiWindowSettings();
+ settings->ID = ImHashStr(name, name_len);
+ memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator
+
+ return settings;
+}
+
+// We don't provide a FindWindowSettingsByName() because Docking system doesn't always hold on names.
+// This is called once per window .ini entry + once per newly instantiated window.
+ImGuiWindowSettings* ImGui::FindWindowSettingsByID(ImGuiID id)
+{
+ ImGuiContext& g = *GImGui;
+ for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
+ if (settings->ID == id && !settings->WantDelete)
+ return settings;
+ return NULL;
+}
+
+// This is faster if you are holding on a Window already as we don't need to perform a search.
+ImGuiWindowSettings* ImGui::FindWindowSettingsByWindow(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ if (window->SettingsOffset != -1)
+ return g.SettingsWindows.ptr_from_offset(window->SettingsOffset);
+ return FindWindowSettingsByID(window->ID);
+}
+
+// This will revert window to its initial state, including enabling the ImGuiCond_FirstUseEver/ImGuiCond_Once conditions once more.
+void ImGui::ClearWindowSettings(const char* name)
+{
+ //IMGUI_DEBUG_LOG("ClearWindowSettings('%s')\n", name);
+ ImGuiWindow* window = FindWindowByName(name);
+ if (window != NULL)
+ {
+ window->Flags |= ImGuiWindowFlags_NoSavedSettings;
+ InitOrLoadWindowSettings(window, NULL);
+ }
+ if (ImGuiWindowSettings* settings = window ? FindWindowSettingsByWindow(window) : FindWindowSettingsByID(ImHashStr(name)))
+ settings->WantDelete = true;
+}
+
static void WindowSettingsHandler_ClearAll(ImGuiContext* ctx, ImGuiSettingsHandler*)
{
ImGuiContext& g = *ctx;
- for (int i = 0; i != g.Windows.Size; i++)
- g.Windows[i]->SettingsOffset = -1;
+ for (ImGuiWindow* window : g.Windows)
+ window->SettingsOffset = -1;
g.SettingsWindows.clear();
}
static void* WindowSettingsHandler_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*, const char* name)
{
- ImGuiWindowSettings* settings = ImGui::FindOrCreateWindowSettings(name);
- ImGuiID id = settings->ID;
- *settings = ImGuiWindowSettings(); // Clear existing if recycling previous entry
+ ImGuiID id = ImHashStr(name);
+ ImGuiWindowSettings* settings = ImGui::FindWindowSettingsByID(id);
+ if (settings)
+ *settings = ImGuiWindowSettings(); // Clear existing if recycling previous entry
+ else
+ settings = ImGui::CreateNewWindowSettings(name);
settings->ID = id;
settings->WantApply = true;
return (void*)settings;
@@ -12556,6 +14870,7 @@ static void WindowSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler*,
if (sscanf(line, "Pos=%i,%i", &x, &y) == 2) { settings->Pos = ImVec2ih((short)x, (short)y); }
else if (sscanf(line, "Size=%i,%i", &x, &y) == 2) { settings->Size = ImVec2ih((short)x, (short)y); }
else if (sscanf(line, "Collapsed=%d", &i) == 1) { settings->Collapsed = (i != 0); }
+ else if (sscanf(line, "IsChild=%d", &i) == 1) { settings->IsChild = (i != 0); }
}
// Apply to existing windows (if any)
@@ -12576,13 +14891,12 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
// Gather data from windows that were active during this session
// (if a window wasn't opened in this session we preserve its settings)
ImGuiContext& g = *ctx;
- for (int i = 0; i != g.Windows.Size; i++)
+ for (ImGuiWindow* window : g.Windows)
{
- ImGuiWindow* window = g.Windows[i];
if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
continue;
- ImGuiWindowSettings* settings = (window->SettingsOffset != -1) ? g.SettingsWindows.ptr_from_offset(window->SettingsOffset) : ImGui::FindWindowSettings(window->ID);
+ ImGuiWindowSettings* settings = ImGui::FindWindowSettingsByWindow(window);
if (!settings)
{
settings = ImGui::CreateNewWindowSettings(window->Name);
@@ -12591,24 +14905,35 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
IM_ASSERT(settings->ID == window->ID);
settings->Pos = ImVec2ih(window->Pos);
settings->Size = ImVec2ih(window->SizeFull);
-
+ settings->IsChild = (window->Flags & ImGuiWindowFlags_ChildWindow) != 0;
settings->Collapsed = window->Collapsed;
+ settings->WantDelete = false;
}
// Write to text buffer
buf->reserve(buf->size() + g.SettingsWindows.size() * 6); // ballpark reserve
for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
{
+ if (settings->WantDelete)
+ continue;
const char* settings_name = settings->GetName();
buf->appendf("[%s][%s]\n", handler->TypeName, settings_name);
- buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
- buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
- buf->appendf("Collapsed=%d\n", settings->Collapsed);
+ if (settings->IsChild)
+ {
+ buf->appendf("IsChild=1\n");
+ buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
+ }
+ else
+ {
+ buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
+ buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
+ if (settings->Collapsed)
+ buf->appendf("Collapsed=1\n");
+ }
buf->append("\n");
}
}
-
//-----------------------------------------------------------------------------
// [SECTION] LOCALIZATION
//-----------------------------------------------------------------------------
@@ -12620,12 +14945,12 @@ void ImGui::LocalizeRegisterEntries(const ImGuiLocEntry* entries, int count)
g.LocalizationTable[entries[n].Key] = entries[n].Text;
}
-
//-----------------------------------------------------------------------------
// [SECTION] VIEWPORTS, PLATFORM WINDOWS
//-----------------------------------------------------------------------------
// - GetMainViewport()
// - SetWindowViewport() [Internal]
+// - ScaleWindowsInViewport() [Internal]
// - UpdateViewportsNewFrame() [Internal]
// (this section is more complete in the 'docking' branch)
//-----------------------------------------------------------------------------
@@ -12641,6 +14966,24 @@ void ImGui::SetWindowViewport(ImGuiWindow* window, ImGuiViewportP* viewport)
window->Viewport = viewport;
}
+static void ScaleWindow(ImGuiWindow* window, float scale)
+{
+ ImVec2 origin = window->Viewport->Pos;
+ window->Pos = ImFloor((window->Pos - origin) * scale + origin);
+ window->Size = ImTrunc(window->Size * scale);
+ window->SizeFull = ImTrunc(window->SizeFull * scale);
+ window->ContentSize = ImTrunc(window->ContentSize * scale);
+}
+
+// Scale all windows (position, size). Use when e.g. changing DPI. (This is a lossy operation!)
+void ImGui::ScaleWindowsInViewport(ImGuiViewportP* viewport, float scale)
+{
+ ImGuiContext& g = *GImGui;
+ for (ImGuiWindow* window : g.Windows)
+ if (window->Viewport == viewport)
+ ScaleWindow(window, scale);
+}
+
// Update viewports and monitor infos
static void ImGui::UpdateViewportsNewFrame()
{
@@ -12654,14 +14997,13 @@ static void ImGui::UpdateViewportsNewFrame()
main_viewport->Pos = ImVec2(0.0f, 0.0f);
main_viewport->Size = g.IO.DisplaySize;
- for (int n = 0; n < g.Viewports.Size; n++)
+ for (ImGuiViewportP* viewport : g.Viewports)
{
- ImGuiViewportP* viewport = g.Viewports[n];
-
- // Lock down space taken by menu bars and status bars, reset the offset for fucntions like BeginMainMenuBar() to alter them again.
- viewport->WorkOffsetMin = viewport->BuildWorkOffsetMin;
- viewport->WorkOffsetMax = viewport->BuildWorkOffsetMax;
- viewport->BuildWorkOffsetMin = viewport->BuildWorkOffsetMax = ImVec2(0.0f, 0.0f);
+ // Lock down space taken by menu bars and status bars
+ // Setup initial value for functions like BeginMainMenuBar(), DockSpaceOverViewport() etc.
+ viewport->WorkInsetMin = viewport->BuildWorkInsetMin;
+ viewport->WorkInsetMax = viewport->BuildWorkInsetMax;
+ viewport->BuildWorkInsetMin = viewport->BuildWorkInsetMax = ImVec2(0.0f, 0.0f);
viewport->UpdateWorkRect();
}
}
@@ -12676,6 +15018,10 @@ static void ImGui::UpdateViewportsNewFrame()
//-----------------------------------------------------------------------------
// [SECTION] PLATFORM DEPENDENT HELPERS
//-----------------------------------------------------------------------------
+// - Default clipboard handlers
+// - Default shell function handlers
+// - Default IME handlers
+//-----------------------------------------------------------------------------
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS)
@@ -12686,9 +15032,9 @@ static void ImGui::UpdateViewportsNewFrame()
// Win32 clipboard implementation
// We use g.ClipboardHandlerData for temporary storage to ensure it is freed on Shutdown()
-static const char* GetClipboardTextFn_DefaultImpl(void*)
+static const char* Platform_GetClipboardTextFn_DefaultImpl(ImGuiContext* ctx)
{
- ImGuiContext& g = *GImGui;
+ ImGuiContext& g = *ctx;
g.ClipboardHandlerData.clear();
if (!::OpenClipboard(NULL))
return NULL;
@@ -12709,7 +15055,7 @@ static const char* GetClipboardTextFn_DefaultImpl(void*)
return g.ClipboardHandlerData.Data;
}
-static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
+static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext*, const char* text)
{
if (!::OpenClipboard(NULL))
return;
@@ -12736,12 +15082,12 @@ static PasteboardRef main_clipboard = 0;
// OSX clipboard implementation
// If you enable this you will need to add '-framework ApplicationServices' to your linker command-line!
-static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
+static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext*, const char* text)
{
if (!main_clipboard)
PasteboardCreate(kPasteboardClipboard, &main_clipboard);
PasteboardClear(main_clipboard);
- CFDataRef cf_data = CFDataCreate(kCFAllocatorDefault, (const UInt8*)text, strlen(text));
+ CFDataRef cf_data = CFDataCreate(kCFAllocatorDefault, (const UInt8*)text, ImStrlen(text));
if (cf_data)
{
PasteboardPutItemFlavor(main_clipboard, (PasteboardItemID)1, CFSTR("public.utf8-plain-text"), cf_data, 0);
@@ -12749,8 +15095,9 @@ static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
}
}
-static const char* GetClipboardTextFn_DefaultImpl(void*)
+static const char* Platform_GetClipboardTextFn_DefaultImpl(ImGuiContext* ctx)
{
+ ImGuiContext& g = *ctx;
if (!main_clipboard)
PasteboardCreate(kPasteboardClipboard, &main_clipboard);
PasteboardSynchronize(main_clipboard);
@@ -12768,7 +15115,6 @@ static const char* GetClipboardTextFn_DefaultImpl(void*)
CFDataRef cf_data;
if (PasteboardCopyItemFlavorData(main_clipboard, item_id, CFSTR("public.utf8-plain-text"), &cf_data) == noErr)
{
- ImGuiContext& g = *GImGui;
g.ClipboardHandlerData.clear();
int length = (int)CFDataGetLength(cf_data);
g.ClipboardHandlerData.resize(length + 1);
@@ -12785,23 +15131,83 @@ static const char* GetClipboardTextFn_DefaultImpl(void*)
#else
// Local Dear ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers.
-static const char* GetClipboardTextFn_DefaultImpl(void*)
+static const char* Platform_GetClipboardTextFn_DefaultImpl(ImGuiContext* ctx)
{
- ImGuiContext& g = *GImGui;
+ ImGuiContext& g = *ctx;
return g.ClipboardHandlerData.empty() ? NULL : g.ClipboardHandlerData.begin();
}
-static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
+static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext* ctx, const char* text)
{
- ImGuiContext& g = *GImGui;
+ ImGuiContext& g = *ctx;
g.ClipboardHandlerData.clear();
- const char* text_end = text + strlen(text);
+ const char* text_end = text + ImStrlen(text);
g.ClipboardHandlerData.resize((int)(text_end - text) + 1);
memcpy(&g.ClipboardHandlerData[0], text, (size_t)(text_end - text));
g.ClipboardHandlerData[(int)(text_end - text)] = 0;
}
+#endif // Default clipboard handlers
+
+//-----------------------------------------------------------------------------
+
+#ifndef IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
+#if defined(__APPLE__) && TARGET_OS_IPHONE
+#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
+#endif
+#if defined(__3DS__)
+#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
+#endif
+#if defined(_WIN32) && defined(IMGUI_DISABLE_WIN32_FUNCTIONS)
+#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
+#endif
+#endif // #ifndef IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
+
+#ifndef IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
+#ifdef _WIN32
+#include <shellapi.h> // ShellExecuteA()
+#ifdef _MSC_VER
+#pragma comment(lib, "shell32")
+#endif
+static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
+{
+ const int path_wsize = ::MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
+ ImVector<wchar_t> path_wbuf;
+ path_wbuf.resize(path_wsize);
+ ::MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wbuf.Data, path_wsize);
+ return (INT_PTR)::ShellExecuteW(NULL, L"open", path_wbuf.Data, NULL, NULL, SW_SHOWDEFAULT) > 32;
+}
+#else
+#include <sys/wait.h>
+#include <unistd.h>
+static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
+{
+#if defined(__APPLE__)
+ const char* args[] { "open", "--", path, NULL };
+#else
+ const char* args[] { "xdg-open", path, NULL };
#endif
+ pid_t pid = fork();
+ if (pid < 0)
+ return false;
+ if (!pid)
+ {
+ execvp(args[0], const_cast<char **>(args));
+ exit(-1);
+ }
+ else
+ {
+ int status;
+ waitpid(pid, &status, 0);
+ return WEXITSTATUS(status) == 0;
+ }
+}
+#endif
+#else
+static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char*) { return false; }
+#endif // Default shell handlers
+
+//-----------------------------------------------------------------------------
// Win32 API IME support (for Asian languages, etc.)
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS)
@@ -12811,14 +15217,10 @@ static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
#pragma comment(lib, "imm32")
#endif
-static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatformImeData* data)
+static void Platform_SetImeDataFn_DefaultImpl(ImGuiContext*, ImGuiViewport* viewport, ImGuiPlatformImeData* data)
{
// Notify OS Input Method Editor of text input position
HWND hwnd = (HWND)viewport->PlatformHandleRaw;
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- if (hwnd == 0)
- hwnd = (HWND)ImGui::GetIO().ImeWindowHandle;
-#endif
if (hwnd == 0)
return;
@@ -12841,14 +15243,14 @@ static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatf
#else
-static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport*, ImGuiPlatformImeData*) {}
+static void Platform_SetImeDataFn_DefaultImpl(ImGuiContext*, ImGuiViewport*, ImGuiPlatformImeData*) {}
-#endif
+#endif // Default IME handlers
//-----------------------------------------------------------------------------
// [SECTION] METRICS/DEBUGGER WINDOW
//-----------------------------------------------------------------------------
-// - RenderViewportThumbnail() [Internal]
+// - DebugRenderViewportThumbnail() [Internal]
// - RenderViewportsThumbnails() [Internal]
// - DebugTextEncoding()
// - MetricsHelpMarker() [Internal]
@@ -12879,16 +15281,15 @@ void ImGui::DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP*
ImVec2 off = bb.Min - viewport->Pos * scale;
float alpha_mul = 1.0f;
window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_Border, alpha_mul * 0.40f));
- for (int i = 0; i != g.Windows.Size; i++)
+ for (ImGuiWindow* thumb_window : g.Windows)
{
- ImGuiWindow* thumb_window = g.Windows[i];
if (!thumb_window->WasActive || (thumb_window->Flags & ImGuiWindowFlags_ChildWindow))
continue;
ImRect thumb_r = thumb_window->Rect();
ImRect title_r = thumb_window->TitleBarRect();
- thumb_r = ImRect(ImFloor(off + thumb_r.Min * scale), ImFloor(off + thumb_r.Max * scale));
- title_r = ImRect(ImFloor(off + title_r.Min * scale), ImFloor(off + ImVec2(title_r.Max.x, title_r.Min.y) * scale) + ImVec2(0,5)); // Exaggerate title bar height
+ thumb_r = ImRect(ImTrunc(off + thumb_r.Min * scale), ImTrunc(off + thumb_r.Max * scale));
+ title_r = ImRect(ImTrunc(off + title_r.Min * scale), ImTrunc(off + ImVec2(title_r.Max.x, title_r.Min.y + title_r.GetHeight() * 3.0f) * scale)); // Exaggerate title bar height
thumb_r.ClipWithFull(bb);
title_r.ClipWithFull(bb);
const bool window_is_focused = (g.NavWindow && thumb_window->RootWindowForTitleBarHighlight == g.NavWindow->RootWindowForTitleBarHighlight);
@@ -12898,6 +15299,8 @@ void ImGui::DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP*
window->DrawList->AddText(g.Font, g.FontSize * 1.0f, title_r.Min, GetColorU32(ImGuiCol_Text, alpha_mul), thumb_window->Name, FindRenderedTextEnd(thumb_window->Name));
}
draw_list->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_Border, alpha_mul));
+ if (viewport->ID == g.DebugMetricsConfig.HighlightViewportID)
+ window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255, 255, 0, 255));
}
static void RenderViewportsThumbnails()
@@ -12905,27 +15308,75 @@ static void RenderViewportsThumbnails()
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- // We don't display full monitor bounds (we could, but it often looks awkward), instead we display just enough to cover all of our viewports.
float SCALE = 1.0f / 8.0f;
- ImRect bb_full(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
- for (int n = 0; n < g.Viewports.Size; n++)
- bb_full.Add(g.Viewports[n]->GetMainRect());
+ ImRect bb_full(g.Viewports[0]->Pos, g.Viewports[0]->Pos + g.Viewports[0]->Size);
ImVec2 p = window->DC.CursorPos;
ImVec2 off = p - bb_full.Min * SCALE;
- for (int n = 0; n < g.Viewports.Size; n++)
+
+ // Draw viewports
+ for (ImGuiViewportP* viewport : g.Viewports)
{
- ImGuiViewportP* viewport = g.Viewports[n];
ImRect viewport_draw_bb(off + (viewport->Pos) * SCALE, off + (viewport->Pos + viewport->Size) * SCALE);
ImGui::DebugRenderViewportThumbnail(window->DrawList, viewport, viewport_draw_bb);
}
ImGui::Dummy(bb_full.GetSize() * SCALE);
}
+// Draw an arbitrary US keyboard layout to visualize translated keys
+void ImGui::DebugRenderKeyboardPreview(ImDrawList* draw_list)
+{
+ const float scale = ImGui::GetFontSize() / 13.0f;
+ const ImVec2 key_size = ImVec2(35.0f, 35.0f) * scale;
+ const float key_rounding = 3.0f * scale;
+ const ImVec2 key_face_size = ImVec2(25.0f, 25.0f) * scale;
+ const ImVec2 key_face_pos = ImVec2(5.0f, 3.0f) * scale;
+ const float key_face_rounding = 2.0f * scale;
+ const ImVec2 key_label_pos = ImVec2(7.0f, 4.0f) * scale;
+ const ImVec2 key_step = ImVec2(key_size.x - 1.0f, key_size.y - 1.0f);
+ const float key_row_offset = 9.0f * scale;
+
+ ImVec2 board_min = GetCursorScreenPos();
+ ImVec2 board_max = ImVec2(board_min.x + 3 * key_step.x + 2 * key_row_offset + 10.0f, board_min.y + 3 * key_step.y + 10.0f);
+ ImVec2 start_pos = ImVec2(board_min.x + 5.0f - key_step.x, board_min.y);
+
+ struct KeyLayoutData { int Row, Col; const char* Label; ImGuiKey Key; };
+ const KeyLayoutData keys_to_display[] =
+ {
+ { 0, 0, "", ImGuiKey_Tab }, { 0, 1, "Q", ImGuiKey_Q }, { 0, 2, "W", ImGuiKey_W }, { 0, 3, "E", ImGuiKey_E }, { 0, 4, "R", ImGuiKey_R },
+ { 1, 0, "", ImGuiKey_CapsLock }, { 1, 1, "A", ImGuiKey_A }, { 1, 2, "S", ImGuiKey_S }, { 1, 3, "D", ImGuiKey_D }, { 1, 4, "F", ImGuiKey_F },
+ { 2, 0, "", ImGuiKey_LeftShift },{ 2, 1, "Z", ImGuiKey_Z }, { 2, 2, "X", ImGuiKey_X }, { 2, 3, "C", ImGuiKey_C }, { 2, 4, "V", ImGuiKey_V }
+ };
+
+ // Elements rendered manually via ImDrawList API are not clipped automatically.
+ // While not strictly necessary, here IsItemVisible() is used to avoid rendering these shapes when they are out of view.
+ Dummy(board_max - board_min);
+ if (!IsItemVisible())
+ return;
+ draw_list->PushClipRect(board_min, board_max, true);
+ for (int n = 0; n < IM_ARRAYSIZE(keys_to_display); n++)
+ {
+ const KeyLayoutData* key_data = &keys_to_display[n];
+ ImVec2 key_min = ImVec2(start_pos.x + key_data->Col * key_step.x + key_data->Row * key_row_offset, start_pos.y + key_data->Row * key_step.y);
+ ImVec2 key_max = key_min + key_size;
+ draw_list->AddRectFilled(key_min, key_max, IM_COL32(204, 204, 204, 255), key_rounding);
+ draw_list->AddRect(key_min, key_max, IM_COL32(24, 24, 24, 255), key_rounding);
+ ImVec2 face_min = ImVec2(key_min.x + key_face_pos.x, key_min.y + key_face_pos.y);
+ ImVec2 face_max = ImVec2(face_min.x + key_face_size.x, face_min.y + key_face_size.y);
+ draw_list->AddRect(face_min, face_max, IM_COL32(193, 193, 193, 255), key_face_rounding, ImDrawFlags_None, 2.0f);
+ draw_list->AddRectFilled(face_min, face_max, IM_COL32(252, 252, 252, 255), key_face_rounding);
+ ImVec2 label_min = ImVec2(key_min.x + key_label_pos.x, key_min.y + key_label_pos.y);
+ draw_list->AddText(label_min, IM_COL32(64, 64, 64, 255), key_data->Label);
+ if (IsKeyDown(key_data->Key))
+ draw_list->AddRectFilled(key_min, key_max, IM_COL32(255, 0, 0, 128), key_rounding);
+ }
+ draw_list->PopClipRect();
+}
+
// Helper tool to diagnose between text encoding issues and font loading issues. Pass your UTF-8 string and verify that there are correct.
void ImGui::DebugTextEncoding(const char* str)
{
Text("Text: \"%s\"", str);
- if (!BeginTable("list", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit))
+ if (!BeginTable("##DebugTextEncoding", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Resizable))
return;
TableSetupColumn("Offset");
TableSetupColumn("UTF-8");
@@ -12957,13 +15408,52 @@ void ImGui::DebugTextEncoding(const char* str)
EndTable();
}
+static void DebugFlashStyleColorStop()
+{
+ ImGuiContext& g = *GImGui;
+ if (g.DebugFlashStyleColorIdx != ImGuiCol_COUNT)
+ g.Style.Colors[g.DebugFlashStyleColorIdx] = g.DebugFlashStyleColorBackup;
+ g.DebugFlashStyleColorIdx = ImGuiCol_COUNT;
+}
+
+// Flash a given style color for some + inhibit modifications of this color via PushStyleColor() calls.
+void ImGui::DebugFlashStyleColor(ImGuiCol idx)
+{
+ ImGuiContext& g = *GImGui;
+ DebugFlashStyleColorStop();
+ g.DebugFlashStyleColorTime = 0.5f;
+ g.DebugFlashStyleColorIdx = idx;
+ g.DebugFlashStyleColorBackup = g.Style.Colors[idx];
+}
+
+void ImGui::UpdateDebugToolFlashStyleColor()
+{
+ ImGuiContext& g = *GImGui;
+ if (g.DebugFlashStyleColorTime <= 0.0f)
+ return;
+ ColorConvertHSVtoRGB(ImCos(g.DebugFlashStyleColorTime * 6.0f) * 0.5f + 0.5f, 0.5f, 0.5f, g.Style.Colors[g.DebugFlashStyleColorIdx].x, g.Style.Colors[g.DebugFlashStyleColorIdx].y, g.Style.Colors[g.DebugFlashStyleColorIdx].z);
+ g.Style.Colors[g.DebugFlashStyleColorIdx].w = 1.0f;
+ if ((g.DebugFlashStyleColorTime -= g.IO.DeltaTime) <= 0.0f)
+ DebugFlashStyleColorStop();
+}
+
+static const char* FormatTextureIDForDebugDisplay(char* buf, int buf_size, ImTextureID tex_id)
+{
+ union { void* ptr; int integer; } tex_id_opaque;
+ memcpy(&tex_id_opaque, &tex_id, ImMin(sizeof(void*), sizeof(tex_id)));
+ if (sizeof(tex_id) >= sizeof(void*))
+ ImFormatString(buf, buf_size, "0x%p", tex_id_opaque.ptr);
+ else
+ ImFormatString(buf, buf_size, "0x%04X", tex_id_opaque.integer);
+ return buf;
+}
+
// Avoid naming collision with imgui_demo.cpp's HelpMarker() for unity builds.
static void MetricsHelpMarker(const char* desc)
{
ImGui::TextDisabled("(?)");
- if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort))
+ if (ImGui::BeginItemTooltip())
{
- ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
ImGui::TextUnformatted(desc);
ImGui::PopTextWrapPos();
@@ -12974,18 +15464,18 @@ static void MetricsHelpMarker(const char* desc)
// [DEBUG] List fonts in a font atlas and display its texture
void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
{
- for (int i = 0; i < atlas->Fonts.Size; i++)
+ for (ImFont* font : atlas->Fonts)
{
- ImFont* font = atlas->Fonts[i];
PushID(font);
DebugNodeFont(font);
PopID();
}
- if (TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
+ if (TreeNode("Font Atlas", "Font Atlas (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
{
- ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
- ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f);
- Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), tint_col, border_col);
+ ImGuiContext& g = *GImGui;
+ PushStyleVar(ImGuiStyleVar_ImageBorderSize, ImMax(1.0f, g.Style.ImageBorderSize));
+ ImageWithBg(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
+ PopStyleVar();
TreePop();
}
}
@@ -12997,8 +15487,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
if (cfg->ShowDebugLog)
ShowDebugLogWindow(&cfg->ShowDebugLog);
- if (cfg->ShowStackTool)
- ShowStackToolWindow(&cfg->ShowStackTool);
+ if (cfg->ShowIDStackTool)
+ ShowIDStackToolWindow(&cfg->ShowIDStackTool);
if (!Begin("Dear ImGui Metrics/Debugger", p_open) || GetCurrentWindow()->BeginCount > 1)
{
@@ -13006,11 +15496,19 @@ void ImGui::ShowMetricsWindow(bool* p_open)
return;
}
+ // [DEBUG] Clear debug breaks hooks after exactly one cycle.
+ DebugBreakClearData();
+
// Basic info
- Text("Dear ImGui %s", GetVersion());
+ Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM);
+ if (g.ContextName[0] != 0)
+ {
+ SameLine();
+ Text("(Context Name: \"%s\")", g.ContextName);
+ }
Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
Text("%d vertices, %d indices (%d triangles)", io.MetricsRenderVertices, io.MetricsRenderIndices, io.MetricsRenderIndices / 3);
- Text("%d visible windows, %d active allocations", io.MetricsRenderWindows, io.MetricsActiveAllocations);
+ Text("%d visible windows, %d current allocations", io.MetricsRenderWindows, g.DebugAllocInfo.TotalAllocCount - g.DebugAllocInfo.TotalFreeCount);
//SameLine(); if (SmallButton("GC")) { g.GcCompactAll = true; }
Separator();
@@ -13039,10 +15537,10 @@ void ImGui::ShowMetricsWindow(bool* p_open)
else if (rect_type == TRT_ColumnsRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->MinX, table->InnerClipRect.Min.y, c->MaxX, table->InnerClipRect.Min.y + table_instance->LastOuterHeight); }
else if (rect_type == TRT_ColumnsWorkRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->WorkRect.Min.y, c->WorkMaxX, table->WorkRect.Max.y); }
else if (rect_type == TRT_ColumnsClipRect) { ImGuiTableColumn* c = &table->Columns[n]; return c->ClipRect; }
- else if (rect_type == TRT_ColumnsContentHeadersUsed){ ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersUsed, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); } // Note: y1/y2 not always accurate
- else if (rect_type == TRT_ColumnsContentHeadersIdeal){ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersIdeal, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); }
- else if (rect_type == TRT_ColumnsContentFrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXFrozen, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); }
- else if (rect_type == TRT_ColumnsContentUnfrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight, c->ContentMaxXUnfrozen, table->InnerClipRect.Max.y); }
+ else if (rect_type == TRT_ColumnsContentHeadersUsed){ ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersUsed, table->InnerClipRect.Min.y + table_instance->LastTopHeadersRowHeight); } // Note: y1/y2 not always accurate
+ else if (rect_type == TRT_ColumnsContentHeadersIdeal){ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersIdeal, table->InnerClipRect.Min.y + table_instance->LastTopHeadersRowHeight); }
+ else if (rect_type == TRT_ColumnsContentFrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXFrozen, table->InnerClipRect.Min.y + table_instance->LastFrozenHeight); }
+ else if (rect_type == TRT_ColumnsContentUnfrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y + table_instance->LastFrozenHeight, c->ContentMaxXUnfrozen, table->InnerClipRect.Max.y); }
IM_ASSERT(0);
return ImRect();
}
@@ -13054,7 +15552,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
else if (rect_type == WRT_InnerRect) { return window->InnerRect; }
else if (rect_type == WRT_InnerClipRect) { return window->InnerClipRect; }
else if (rect_type == WRT_WorkRect) { return window->WorkRect; }
- else if (rect_type == WRT_Content) { ImVec2 min = window->InnerRect.Min - window->Scroll + window->WindowPadding; return ImRect(min, min + window->ContentSize); }
+ else if (rect_type == WRT_Content) { ImVec2 min = window->InnerRect.Min - window->Scroll + window->WindowPadding; return ImRect(min, min + window->ContentSize); }
else if (rect_type == WRT_ContentIdeal) { ImVec2 min = window->InnerRect.Min - window->Scroll + window->WindowPadding; return ImRect(min, min + window->ContentSizeIdeal); }
else if (rect_type == WRT_ContentRegionRect) { return window->ContentRegionRect; }
IM_ASSERT(0);
@@ -13065,34 +15563,24 @@ void ImGui::ShowMetricsWindow(bool* p_open)
// Tools
if (TreeNode("Tools"))
{
- bool show_encoding_viewer = TreeNode("UTF-8 Encoding viewer");
- SameLine();
- MetricsHelpMarker("You can also call ImGui::DebugTextEncoding() from your code with a given string to test that your UTF-8 encoding settings are correct.");
- if (show_encoding_viewer)
- {
- static char buf[100] = "";
- SetNextItemWidth(-FLT_MIN);
- InputText("##Text", buf, IM_ARRAYSIZE(buf));
- if (buf[0] != 0)
- DebugTextEncoding(buf);
- TreePop();
- }
-
+ // Debug Break features
// The Item Picker tool is super useful to visually select an item and break into the call-stack of where it was submitted.
- if (Checkbox("Show Item Picker", &g.DebugItemPickerActive) && g.DebugItemPickerActive)
- DebugStartItemPicker();
+ SeparatorTextEx(0, "Debug breaks", NULL, CalcTextSize("(?)").x + g.Style.SeparatorTextPadding.x);
SameLine();
MetricsHelpMarker("Will call the IM_DEBUG_BREAK() macro to break in debugger.\nWarning: If you don't have a debugger attached, this will probably crash.");
+ if (Checkbox("Show Item Picker", &g.DebugItemPickerActive) && g.DebugItemPickerActive)
+ DebugStartItemPicker();
+ Checkbox("Show \"Debug Break\" buttons in other sections (io.ConfigDebugIsDebuggerPresent)", &g.IO.ConfigDebugIsDebuggerPresent);
+
+ SeparatorText("Visualize");
- // Stack Tool is your best friend!
Checkbox("Show Debug Log", &cfg->ShowDebugLog);
SameLine();
MetricsHelpMarker("You can also call ImGui::ShowDebugLogWindow() from your code.");
- // Stack Tool is your best friend!
- Checkbox("Show Stack Tool", &cfg->ShowStackTool);
+ Checkbox("Show ID Stack Tool", &cfg->ShowIDStackTool);
SameLine();
- MetricsHelpMarker("You can also call ImGui::ShowStackToolWindow() from your code.");
+ MetricsHelpMarker("You can also call ImGui::ShowIDStackToolWindow() from your code.");
Checkbox("Show windows begin order", &cfg->ShowWindowsBeginOrder);
Checkbox("Show windows rectangles", &cfg->ShowWindowsRects);
@@ -13155,6 +15643,25 @@ void ImGui::ShowMetricsWindow(bool* p_open)
Unindent();
}
}
+ Checkbox("Show groups rectangles", &g.DebugShowGroupRects); // Storing in context as this is used by group code and prefers to be in hot-data
+
+ SeparatorText("Validate");
+
+ Checkbox("Debug Begin/BeginChild return value", &io.ConfigDebugBeginReturnValueLoop);
+ SameLine();
+ MetricsHelpMarker("Some calls to Begin()/BeginChild() will return false.\n\nWill cycle through window depths then repeat. Windows should be flickering while running.");
+
+ Checkbox("UTF-8 Encoding viewer", &cfg->ShowTextEncodingViewer);
+ SameLine();
+ MetricsHelpMarker("You can also call ImGui::DebugTextEncoding() from your code with a given string to test that your UTF-8 encoding settings are correct.");
+ if (cfg->ShowTextEncodingViewer)
+ {
+ static char buf[64] = "";
+ SetNextItemWidth(-FLT_MIN);
+ InputText("##DebugTextEncodingBuf", buf, IM_ARRAYSIZE(buf));
+ if (buf[0] != 0)
+ DebugTextEncoding(buf);
+ }
TreePop();
}
@@ -13170,9 +15677,9 @@ void ImGui::ShowMetricsWindow(bool* p_open)
// Here we display windows in their submitted order/hierarchy, however note that the Begin stack doesn't constitute a Parent<>Child relationship!
ImVector<ImGuiWindow*>& temp_buffer = g.WindowsTempSortBuffer;
temp_buffer.resize(0);
- for (int i = 0; i < g.Windows.Size; i++)
- if (g.Windows[i]->LastFrameActive + 1 >= g.FrameCount)
- temp_buffer.push_back(g.Windows[i]);
+ for (ImGuiWindow* window : g.Windows)
+ if (window->LastFrameActive + 1 >= g.FrameCount)
+ temp_buffer.push_back(window);
struct Func { static int IMGUI_CDECL WindowComparerByBeginOrder(const void* lhs, const void* rhs) { return ((int)(*(const ImGuiWindow* const *)lhs)->BeginOrderWithinContext - (*(const ImGuiWindow* const*)rhs)->BeginOrderWithinContext); } };
ImQsort(temp_buffer.Data, (size_t)temp_buffer.Size, sizeof(ImGuiWindow*), Func::WindowComparerByBeginOrder);
DebugNodeWindowsListByBeginStackParent(temp_buffer.Data, temp_buffer.Size, NULL);
@@ -13184,44 +15691,44 @@ void ImGui::ShowMetricsWindow(bool* p_open)
// DrawLists
int drawlist_count = 0;
- for (int viewport_i = 0; viewport_i < g.Viewports.Size; viewport_i++)
- drawlist_count += g.Viewports[viewport_i]->DrawDataBuilder.GetDrawListCount();
+ for (ImGuiViewportP* viewport : g.Viewports)
+ drawlist_count += viewport->DrawDataP.CmdLists.Size;
if (TreeNode("DrawLists", "DrawLists (%d)", drawlist_count))
{
Checkbox("Show ImDrawCmd mesh when hovering", &cfg->ShowDrawCmdMesh);
Checkbox("Show ImDrawCmd bounding boxes when hovering", &cfg->ShowDrawCmdBoundingBoxes);
- for (int viewport_i = 0; viewport_i < g.Viewports.Size; viewport_i++)
- {
- ImGuiViewportP* viewport = g.Viewports[viewport_i];
- for (int layer_i = 0; layer_i < IM_ARRAYSIZE(viewport->DrawDataBuilder.Layers); layer_i++)
- for (int draw_list_i = 0; draw_list_i < viewport->DrawDataBuilder.Layers[layer_i].Size; draw_list_i++)
- DebugNodeDrawList(NULL, viewport->DrawDataBuilder.Layers[layer_i][draw_list_i], "DrawList");
- }
+ for (ImGuiViewportP* viewport : g.Viewports)
+ for (ImDrawList* draw_list : viewport->DrawDataP.CmdLists)
+ DebugNodeDrawList(NULL, viewport, draw_list, "DrawList");
TreePop();
}
// Viewports
if (TreeNode("Viewports", "Viewports (%d)", g.Viewports.Size))
{
- Indent(GetTreeNodeToLabelSpacing());
- RenderViewportsThumbnails();
- Unindent(GetTreeNodeToLabelSpacing());
- for (int i = 0; i < g.Viewports.Size; i++)
- DebugNodeViewport(g.Viewports[i]);
+ SetNextItemOpen(true, ImGuiCond_Once);
+ if (TreeNode("Windows Minimap"))
+ {
+ RenderViewportsThumbnails();
+ TreePop();
+ }
+ cfg->HighlightViewportID = 0;
+
+ for (ImGuiViewportP* viewport : g.Viewports)
+ DebugNodeViewport(viewport);
TreePop();
}
// Details for Popups
if (TreeNode("Popups", "Popups (%d)", g.OpenPopupStack.Size))
{
- for (int i = 0; i < g.OpenPopupStack.Size; i++)
+ for (const ImGuiPopupData& popup_data : g.OpenPopupStack)
{
// As it's difficult to interact with tree nodes while popups are open, we display everything inline.
- const ImGuiPopupData* popup_data = &g.OpenPopupStack[i];
- ImGuiWindow* window = popup_data->Window;
- BulletText("PopupID: %08x, Window: '%s' (%s%s), BackupNavWindow '%s', ParentWindow '%s'",
- popup_data->PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? "Child;" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? "Menu;" : "",
- popup_data->BackupNavWindow ? popup_data->BackupNavWindow->Name : "NULL", window && window->ParentWindow ? window->ParentWindow->Name : "NULL");
+ ImGuiWindow* window = popup_data.Window;
+ BulletText("PopupID: %08x, Window: '%s' (%s%s), RestoreNavWindow '%s', ParentWindow '%s'",
+ popup_data.PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? "Child;" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? "Menu;" : "",
+ popup_data.RestoreNavWindow ? popup_data.RestoreNavWindow->Name : "NULL", window && window->ParentWindow ? window->ParentWindow->Name : "NULL");
}
TreePop();
}
@@ -13263,6 +15770,24 @@ void ImGui::ShowMetricsWindow(bool* p_open)
TreePop();
}
+ // Details for TypingSelect
+ if (TreeNode("TypingSelect", "TypingSelect (%d)", g.TypingSelectState.SearchBuffer[0] != 0 ? 1 : 0))
+ {
+ DebugNodeTypingSelectState(&g.TypingSelectState);
+ TreePop();
+ }
+
+ // Details for MultiSelect
+ if (TreeNode("MultiSelect", "MultiSelect (%d)", g.MultiSelectStorage.GetAliveCount()))
+ {
+ ImGuiBoxSelectState* bs = &g.BoxSelectState;
+ BulletText("BoxSelect ID=0x%08X, Starting = %d, Active %d", bs->ID, bs->IsStarting, bs->IsActive);
+ for (int n = 0; n < g.MultiSelectStorage.GetMapSize(); n++)
+ if (ImGuiMultiSelectState* state = g.MultiSelectStorage.TryGetMapData(n))
+ DebugNodeMultiSelectState(state);
+ TreePop();
+ }
+
// Details for Docking
#ifdef IMGUI_HAS_DOCK
if (TreeNode("Docking"))
@@ -13287,11 +15812,12 @@ void ImGui::ShowMetricsWindow(bool* p_open)
Text("\"%s\"", g.IO.IniFilename);
else
TextUnformatted("<NULL>");
+ Checkbox("io.ConfigDebugIniSettings", &io.ConfigDebugIniSettings);
Text("SettingsDirtyTimer %.2f", g.SettingsDirtyTimer);
if (TreeNode("SettingsHandlers", "Settings handlers: (%d)", g.SettingsHandlers.Size))
{
- for (int n = 0; n < g.SettingsHandlers.Size; n++)
- BulletText("%s", g.SettingsHandlers[n].TypeName);
+ for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
+ BulletText("\"%s\"", handler.TypeName);
TreePop();
}
if (TreeNode("SettingsWindows", "Settings packed data: Windows: %d bytes", g.SettingsWindows.size()))
@@ -13319,41 +15845,114 @@ void ImGui::ShowMetricsWindow(bool* p_open)
TreePop();
}
- if (TreeNode("Key Owners & Shortcut Routing"))
- {
- TextUnformatted("Key Owners:");
- if (BeginListBox("##owners", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8)))
+ // Settings
+ if (TreeNode("Memory allocations"))
+ {
+ ImGuiDebugAllocInfo* info = &g.DebugAllocInfo;
+ Text("%d current allocations", info->TotalAllocCount - info->TotalFreeCount);
+ if (SmallButton("GC now")) { g.GcCompactAll = true; }
+ Text("Recent frames with allocations:");
+ int buf_size = IM_ARRAYSIZE(info->LastEntriesBuf);
+ for (int n = buf_size - 1; n >= 0; n--)
{
- for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1))
+ ImGuiDebugAllocEntry* entry = &info->LastEntriesBuf[(info->LastEntriesIdx - n + buf_size) % buf_size];
+ BulletText("Frame %06d: %+3d ( %2d alloc, %2d free )", entry->FrameCount, entry->AllocCount - entry->FreeCount, entry->AllocCount, entry->FreeCount);
+ if (n == 0)
{
- ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key);
- if (owner_data->OwnerCurr == ImGuiKeyOwner_None)
- continue;
- Text("%s: 0x%08X%s", GetKeyName(key), owner_data->OwnerCurr,
- owner_data->LockUntilRelease ? " LockUntilRelease" : owner_data->LockThisFrame ? " LockThisFrame" : "");
- DebugLocateItemOnHover(owner_data->OwnerCurr);
+ SameLine();
+ Text("<- %d frames ago", g.FrameCount - entry->FrameCount);
}
- EndListBox();
}
- TextUnformatted("Shortcut Routing:");
- if (BeginListBox("##routes", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8)))
+ TreePop();
+ }
+
+ if (TreeNode("Inputs"))
+ {
+ Text("KEYBOARD/GAMEPAD/MOUSE KEYS");
{
- for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1))
- {
- ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable;
- for (ImGuiKeyRoutingIndex idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; idx != -1; )
+ // User code should never have to go through such hoops! You can generally iterate between ImGuiKey_NamedKey_BEGIN and ImGuiKey_NamedKey_END.
+ Indent();
+ Text("Keys down:"); for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (!IsKeyDown(key)) continue; SameLine(); Text(IsNamedKey(key) ? "\"%s\"" : "\"%s\" %d", GetKeyName(key), key); SameLine(); Text("(%.02f)", GetKeyData(key)->DownDuration); }
+ Text("Keys pressed:"); for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (!IsKeyPressed(key)) continue; SameLine(); Text(IsNamedKey(key) ? "\"%s\"" : "\"%s\" %d", GetKeyName(key), key); }
+ Text("Keys released:"); for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (!IsKeyReleased(key)) continue; SameLine(); Text(IsNamedKey(key) ? "\"%s\"" : "\"%s\" %d", GetKeyName(key), key); }
+ Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : "");
+ Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; SameLine(); Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public.
+ DebugRenderKeyboardPreview(GetWindowDrawList());
+ Unindent();
+ }
+
+ Text("MOUSE STATE");
+ {
+ Indent();
+ if (IsMousePosValid())
+ Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y);
+ else
+ Text("Mouse pos: <INVALID>");
+ Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y);
+ int count = IM_ARRAYSIZE(io.MouseDown);
+ Text("Mouse down:"); for (int i = 0; i < count; i++) if (IsMouseDown(i)) { SameLine(); Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); }
+ Text("Mouse clicked:"); for (int i = 0; i < count; i++) if (IsMouseClicked(i)) { SameLine(); Text("b%d (%d)", i, io.MouseClickedCount[i]); }
+ Text("Mouse released:"); for (int i = 0; i < count; i++) if (IsMouseReleased(i)) { SameLine(); Text("b%d", i); }
+ Text("Mouse wheel: %.1f", io.MouseWheel);
+ Text("MouseStationaryTimer: %.2f", g.MouseStationaryTimer);
+ Text("Mouse source: %s", GetMouseSourceName(io.MouseSource));
+ Text("Pen Pressure: %.1f", io.PenPressure); // Note: currently unused
+ Unindent();
+ }
+
+ Text("MOUSE WHEELING");
+ {
+ Indent();
+ Text("WheelingWindow: '%s'", g.WheelingWindow ? g.WheelingWindow->Name : "NULL");
+ Text("WheelingWindowReleaseTimer: %.2f", g.WheelingWindowReleaseTimer);
+ Text("WheelingAxisAvg[] = { %.3f, %.3f }, Main Axis: %s", g.WheelingAxisAvg.x, g.WheelingAxisAvg.y, (g.WheelingAxisAvg.x > g.WheelingAxisAvg.y) ? "X" : (g.WheelingAxisAvg.x < g.WheelingAxisAvg.y) ? "Y" : "<none>");
+ Unindent();
+ }
+
+ Text("KEY OWNERS");
+ {
+ Indent();
+ if (BeginChild("##owners", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY, ImGuiWindowFlags_NoSavedSettings))
+ for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1))
+ {
+ ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(&g, key);
+ if (owner_data->OwnerCurr == ImGuiKeyOwner_NoOwner)
+ continue;
+ Text("%s: 0x%08X%s", GetKeyName(key), owner_data->OwnerCurr,
+ owner_data->LockUntilRelease ? " LockUntilRelease" : owner_data->LockThisFrame ? " LockThisFrame" : "");
+ DebugLocateItemOnHover(owner_data->OwnerCurr);
+ }
+ EndChild();
+ Unindent();
+ }
+ Text("SHORTCUT ROUTING");
+ SameLine();
+ MetricsHelpMarker("Declared shortcut routes automatically set key owner when mods matches.");
+ {
+ Indent();
+ if (BeginChild("##routes", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY, ImGuiWindowFlags_NoSavedSettings))
+ for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1))
{
- char key_chord_name[64];
- ImGuiKeyRoutingData* routing_data = &rt->Entries[idx];
- GetKeyChordName(key | routing_data->Mods, key_chord_name, IM_ARRAYSIZE(key_chord_name));
- Text("%s: 0x%08X", key_chord_name, routing_data->RoutingCurr);
- DebugLocateItemOnHover(routing_data->RoutingCurr);
- idx = routing_data->NextEntryIndex;
+ ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable;
+ for (ImGuiKeyRoutingIndex idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; idx != -1; )
+ {
+ ImGuiKeyRoutingData* routing_data = &rt->Entries[idx];
+ ImGuiKeyChord key_chord = key | routing_data->Mods;
+ Text("%s: 0x%08X (scored %d)", GetKeyChordName(key_chord), routing_data->RoutingCurr, routing_data->RoutingCurrScore);
+ DebugLocateItemOnHover(routing_data->RoutingCurr);
+ if (g.IO.ConfigDebugIsDebuggerPresent)
+ {
+ SameLine();
+ if (DebugBreakButton("**DebugBreak**", "in SetShortcutRouting() for this KeyChord"))
+ g.DebugBreakInShortcutRouting = key_chord;
+ }
+ idx = routing_data->NextEntryIndex;
+ }
}
- }
- EndListBox();
+ EndChild();
+ Text("(ActiveIdUsing: AllKeyboardKeys: %d, NavDirMask: 0x%X)", g.ActiveIdUsingAllKeyboardKeys, g.ActiveIdUsingNavDirMask);
+ Unindent();
}
- Text("(ActiveIdUsing: AllKeyboardKeys: %d, NavDirMask: 0x%X)", g.ActiveIdUsingAllKeyboardKeys, g.ActiveIdUsingNavDirMask);
TreePop();
}
@@ -13374,7 +15973,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
Text("ActiveIdWindow: '%s'", g.ActiveIdWindow ? g.ActiveIdWindow->Name : "NULL");
Text("ActiveIdUsing: AllKeyboardKeys: %d, NavDirMask: %X", g.ActiveIdUsingAllKeyboardKeys, g.ActiveIdUsingNavDirMask);
Text("HoveredId: 0x%08X (%.2f sec), AllowOverlap: %d", g.HoveredIdPreviousFrame, g.HoveredIdTimer, g.HoveredIdAllowOverlap); // Not displaying g.HoveredId as it is update mid-frame
- Text("HoverDelayId: 0x%08X, Timer: %.2f, ClearTimer: %.2f", g.HoverDelayId, g.HoverDelayTimer, g.HoverDelayClearTimer);
+ Text("HoverItemDelayId: 0x%08X, Timer: %.2f, ClearTimer: %.2f", g.HoverItemDelayId, g.HoverItemDelayTimer, g.HoverItemDelayClearTimer);
Text("DragDrop: %d, SourceId = 0x%08X, Payload \"%s\" (%d bytes)", g.DragDropActive, g.DragDropPayload.SourceId, g.DragDropPayload.DataType, g.DragDropPayload.DataSize);
DebugLocateItemOnHover(g.DragDropPayload.SourceId);
Unindent();
@@ -13385,11 +15984,20 @@ void ImGui::ShowMetricsWindow(bool* p_open)
Text("NavId: 0x%08X, NavLayer: %d", g.NavId, g.NavLayer);
DebugLocateItemOnHover(g.NavId);
Text("NavInputSource: %s", GetInputSourceName(g.NavInputSource));
+ Text("NavLastValidSelectionUserData = %" IM_PRId64 " (0x%" IM_PRIX64 ")", g.NavLastValidSelectionUserData, g.NavLastValidSelectionUserData);
Text("NavActive: %d, NavVisible: %d", g.IO.NavActive, g.IO.NavVisible);
- Text("NavActivateId/DownId/PressedId/InputId: %08X/%08X/%08X/%08X", g.NavActivateId, g.NavActivateDownId, g.NavActivatePressedId, g.NavActivateInputId);
+ Text("NavActivateId/DownId/PressedId: %08X/%08X/%08X", g.NavActivateId, g.NavActivateDownId, g.NavActivatePressedId);
Text("NavActivateFlags: %04X", g.NavActivateFlags);
- Text("NavDisableHighlight: %d, NavDisableMouseHover: %d", g.NavDisableHighlight, g.NavDisableMouseHover);
+ Text("NavCursorVisible: %d, NavHighlightItemUnderNav: %d", g.NavCursorVisible, g.NavHighlightItemUnderNav);
Text("NavFocusScopeId = 0x%08X", g.NavFocusScopeId);
+ Text("NavFocusRoute[] = ");
+ for (int path_n = g.NavFocusRoute.Size - 1; path_n >= 0; path_n--)
+ {
+ const ImGuiFocusScopeData& focus_scope = g.NavFocusRoute[path_n];
+ SameLine(0.0f, 0.0f);
+ Text("0x%08X/", focus_scope.ID);
+ SetItemTooltip("In window \"%s\"", FindWindowByID(focus_scope.WindowID)->Name);
+ }
Text("NavWindowingTarget: '%s'", g.NavWindowingTarget ? g.NavWindowingTarget->Name : "NULL");
Unindent();
@@ -13399,9 +16007,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
// Overlay: Display windows Rectangles and Begin Order
if (cfg->ShowWindowsRects || cfg->ShowWindowsBeginOrder)
{
- for (int n = 0; n < g.Windows.Size; n++)
+ for (ImGuiWindow* window : g.Windows)
{
- ImGuiWindow* window = g.Windows[n];
if (!window->WasActive)
continue;
ImDrawList* draw_list = GetForegroundDrawList(window);
@@ -13458,21 +16065,80 @@ void ImGui::ShowMetricsWindow(bool* p_open)
End();
}
+void ImGui::DebugBreakClearData()
+{
+ // Those fields are scattered in their respective subsystem to stay in hot-data locations
+ ImGuiContext& g = *GImGui;
+ g.DebugBreakInWindow = 0;
+ g.DebugBreakInTable = 0;
+ g.DebugBreakInShortcutRouting = ImGuiKey_None;
+}
+
+void ImGui::DebugBreakButtonTooltip(bool keyboard_only, const char* description_of_location)
+{
+ if (!BeginItemTooltip())
+ return;
+ Text("To call IM_DEBUG_BREAK() %s:", description_of_location);
+ Separator();
+ TextUnformatted(keyboard_only ? "- Press 'Pause/Break' on keyboard." : "- Press 'Pause/Break' on keyboard.\n- or Click (may alter focus/active id).\n- or navigate using keyboard and press space.");
+ Separator();
+ TextUnformatted("Choose one way that doesn't interfere with what you are trying to debug!\nYou need a debugger attached or this will crash!");
+ EndTooltip();
+}
+
+// Special button that doesn't take focus, doesn't take input owner, and can be activated without a click etc.
+// In order to reduce interferences with the contents we are trying to debug into.
+bool ImGui::DebugBreakButton(const char* label, const char* description_of_location)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
+
+ ImGuiContext& g = *GImGui;
+ const ImGuiID id = window->GetID(label);
+ const ImVec2 label_size = CalcTextSize(label, NULL, true);
+ ImVec2 pos = window->DC.CursorPos + ImVec2(0.0f, window->DC.CurrLineTextBaseOffset);
+ ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x * 2.0f, label_size.y);
+
+ const ImRect bb(pos, pos + size);
+ ItemSize(size, 0.0f);
+ if (!ItemAdd(bb, id))
+ return false;
+
+ // WE DO NOT USE ButtonEx() or ButtonBehavior() in order to reduce our side-effects.
+ bool hovered = ItemHoverable(bb, id, g.CurrentItemFlags);
+ bool pressed = hovered && (IsKeyChordPressed(g.DebugBreakKeyChord) || IsMouseClicked(0) || g.NavActivateId == id);
+ DebugBreakButtonTooltip(false, description_of_location);
+
+ ImVec4 col4f = GetStyleColorVec4(hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
+ ImVec4 hsv;
+ ColorConvertRGBtoHSV(col4f.x, col4f.y, col4f.z, hsv.x, hsv.y, hsv.z);
+ ColorConvertHSVtoRGB(hsv.x + 0.20f, hsv.y, hsv.z, col4f.x, col4f.y, col4f.z);
+
+ RenderNavCursor(bb, id);
+ RenderFrame(bb.Min, bb.Max, GetColorU32(col4f), true, g.Style.FrameRounding);
+ RenderTextClipped(bb.Min, bb.Max, label, NULL, &label_size, g.Style.ButtonTextAlign, &bb);
+
+ IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
+ return pressed;
+}
+
// [DEBUG] Display contents of Columns
void ImGui::DebugNodeColumns(ImGuiOldColumns* columns)
{
if (!TreeNode((void*)(uintptr_t)columns->ID, "Columns Id: 0x%08X, Count: %d, Flags: 0x%04X", columns->ID, columns->Count, columns->Flags))
return;
BulletText("Width: %.1f (MinX: %.1f, MaxX: %.1f)", columns->OffMaxX - columns->OffMinX, columns->OffMinX, columns->OffMaxX);
- for (int column_n = 0; column_n < columns->Columns.Size; column_n++)
- BulletText("Column %02d: OffsetNorm %.3f (= %.1f px)", column_n, columns->Columns[column_n].OffsetNorm, GetColumnOffsetFromNorm(columns, columns->Columns[column_n].OffsetNorm));
+ for (ImGuiOldColumnData& column : columns->Columns)
+ BulletText("Column %02d: OffsetNorm %.3f (= %.1f px)", (int)columns->Columns.index_from_ptr(&column), column.OffsetNorm, GetColumnOffsetFromNorm(columns, column.OffsetNorm));
TreePop();
}
// [DEBUG] Display contents of ImDrawList
-void ImGui::DebugNodeDrawList(ImGuiWindow* window, const ImDrawList* draw_list, const char* label)
+void ImGui::DebugNodeDrawList(ImGuiWindow* window, ImGuiViewportP* viewport, const ImDrawList* draw_list, const char* label)
{
ImGuiContext& g = *GImGui;
+ IM_UNUSED(viewport); // Used in docking branch
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
int cmd_count = draw_list->CmdBuffer.Size;
if (cmd_count > 0 && draw_list->CmdBuffer.back().ElemCount == 0 && draw_list->CmdBuffer.back().UserCallback == NULL)
@@ -13504,10 +16170,11 @@ void ImGui::DebugNodeDrawList(ImGuiWindow* window, const ImDrawList* draw_list,
continue;
}
+ char texid_desc[20];
+ FormatTextureIDForDebugDisplay(texid_desc, IM_ARRAYSIZE(texid_desc), pcmd->TextureId);
char buf[300];
- ImFormatString(buf, IM_ARRAYSIZE(buf), "DrawCmd:%5d tris, Tex 0x%p, ClipRect (%4.0f,%4.0f)-(%4.0f,%4.0f)",
- pcmd->ElemCount / 3, (void*)(intptr_t)pcmd->TextureId,
- pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w);
+ ImFormatString(buf, IM_ARRAYSIZE(buf), "DrawCmd:%5d tris, Tex %s, ClipRect (%4.0f,%4.0f)-(%4.0f,%4.0f)",
+ pcmd->ElemCount / 3, texid_desc, pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w);
bool pcmd_node_open = TreeNode((void*)(pcmd - draw_list->CmdBuffer.begin()), "%s", buf);
if (IsItemHovered() && (cfg->ShowDrawCmdMesh || cfg->ShowDrawCmdBoundingBoxes) && fg_draw_list)
DebugNodeDrawCmdShowMeshAndBoundingBox(fg_draw_list, draw_list, pcmd, cfg->ShowDrawCmdMesh, cfg->ShowDrawCmdBoundingBoxes);
@@ -13587,8 +16254,8 @@ void ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, co
// Draw bounding boxes
if (show_aabb)
{
- out_draw_list->AddRect(ImFloor(clip_rect.Min), ImFloor(clip_rect.Max), IM_COL32(255, 0, 255, 255)); // In pink: clipping rectangle submitted to GPU
- out_draw_list->AddRect(ImFloor(vtxs_rect.Min), ImFloor(vtxs_rect.Max), IM_COL32(0, 255, 255, 255)); // In cyan: bounding box of triangles
+ out_draw_list->AddRect(ImTrunc(clip_rect.Min), ImTrunc(clip_rect.Max), IM_COL32(255, 0, 255, 255)); // In pink: clipping rectangle submitted to GPU
+ out_draw_list->AddRect(ImTrunc(vtxs_rect.Min), ImTrunc(vtxs_rect.Max), IM_COL32(0, 255, 255, 255)); // In cyan: bounding box of triangles
}
out_draw_list->Flags = backup_flags;
}
@@ -13596,24 +16263,30 @@ void ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, co
// [DEBUG] Display details for a single font, called by ShowStyleEditor().
void ImGui::DebugNodeFont(ImFont* font)
{
- bool opened = TreeNode(font, "Font: \"%s\"\n%.2f px, %d glyphs, %d file(s)",
- font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size, font->ConfigDataCount);
- SameLine();
- if (SmallButton("Set as default"))
- GetIO().FontDefault = font;
- if (!opened)
- return;
+ bool opened = TreeNode(font, "Font: \"%s\": %.2f px, %d glyphs, %d sources(s)",
+ font->Sources ? font->Sources[0].Name : "", font->FontSize, font->Glyphs.Size, font->SourcesCount);
// Display preview text
+ if (!opened)
+ Indent();
+ Indent();
PushFont(font);
Text("The quick brown fox jumps over the lazy dog");
PopFont();
+ if (!opened)
+ {
+ Unindent();
+ Unindent();
+ return;
+ }
+ if (SmallButton("Set as default"))
+ GetIO().FontDefault = font;
// Display details
SetNextItemWidth(GetFontSize() * 8);
DragFloat("Font scale", &font->Scale, 0.005f, 0.3f, 2.0f, "%.1f");
SameLine(); MetricsHelpMarker(
- "Note than the default embedded font is NOT meant to be scaled.\n\n"
+ "Note that the default embedded font is NOT meant to be scaled.\n\n"
"Font are currently rendered into bitmaps at a given size at the time of building the atlas. "
"You may oversample them to get some flexibility with scaling. "
"You can also render at multiple sizes and select which one to use at runtime.\n\n"
@@ -13624,65 +16297,71 @@ void ImGui::DebugNodeFont(ImFont* font)
Text("Ellipsis character: '%s' (U+%04X)", ImTextCharToUtf8(c_str, font->EllipsisChar), font->EllipsisChar);
const int surface_sqrt = (int)ImSqrt((float)font->MetricsTotalSurface);
Text("Texture Area: about %d px ~%dx%d px", font->MetricsTotalSurface, surface_sqrt, surface_sqrt);
- for (int config_i = 0; config_i < font->ConfigDataCount; config_i++)
- if (font->ConfigData)
- if (const ImFontConfig* cfg = &font->ConfigData[config_i])
- BulletText("Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d, Offset: (%.1f,%.1f)",
- config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH, cfg->GlyphOffset.x, cfg->GlyphOffset.y);
+ for (int config_i = 0; config_i < font->SourcesCount; config_i++)
+ if (font->Sources)
+ {
+ const ImFontConfig* src = &font->Sources[config_i];
+ int oversample_h, oversample_v;
+ ImFontAtlasBuildGetOversampleFactors(src, &oversample_h, &oversample_v);
+ BulletText("Input %d: \'%s\', Oversample: (%d=>%d,%d=>%d), PixelSnapH: %d, Offset: (%.1f,%.1f)",
+ config_i, src->Name, src->OversampleH, oversample_h, src->OversampleV, oversample_v, src->PixelSnapH, src->GlyphOffset.x, src->GlyphOffset.y);
+ }
// Display all glyphs of the fonts in separate pages of 256 characters
- if (TreeNode("Glyphs", "Glyphs (%d)", font->Glyphs.Size))
- {
- ImDrawList* draw_list = GetWindowDrawList();
- const ImU32 glyph_col = GetColorU32(ImGuiCol_Text);
- const float cell_size = font->FontSize * 1;
- const float cell_spacing = GetStyle().ItemSpacing.y;
- for (unsigned int base = 0; base <= IM_UNICODE_CODEPOINT_MAX; base += 256)
- {
- // Skip ahead if a large bunch of glyphs are not present in the font (test in chunks of 4k)
- // This is only a small optimization to reduce the number of iterations when IM_UNICODE_MAX_CODEPOINT
- // is large // (if ImWchar==ImWchar32 we will do at least about 272 queries here)
- if (!(base & 4095) && font->IsGlyphRangeUnused(base, base + 4095))
+ {
+ if (TreeNode("Glyphs", "Glyphs (%d)", font->Glyphs.Size))
+ {
+ ImDrawList* draw_list = GetWindowDrawList();
+ const ImU32 glyph_col = GetColorU32(ImGuiCol_Text);
+ const float cell_size = font->FontSize * 1;
+ const float cell_spacing = GetStyle().ItemSpacing.y;
+ for (unsigned int base = 0; base <= IM_UNICODE_CODEPOINT_MAX; base += 256)
{
- base += 4096 - 256;
- continue;
- }
-
- int count = 0;
- for (unsigned int n = 0; n < 256; n++)
- if (font->FindGlyphNoFallback((ImWchar)(base + n)))
- count++;
- if (count <= 0)
- continue;
- if (!TreeNode((void*)(intptr_t)base, "U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ? "glyphs" : "glyph"))
- continue;
+ // Skip ahead if a large bunch of glyphs are not present in the font (test in chunks of 4k)
+ // This is only a small optimization to reduce the number of iterations when IM_UNICODE_MAX_CODEPOINT
+ // is large // (if ImWchar==ImWchar32 we will do at least about 272 queries here)
+ if (!(base & 8191) && font->IsGlyphRangeUnused(base, base + 8191))
+ {
+ base += 8192 - 256;
+ continue;
+ }
- // Draw a 16x16 grid of glyphs
- ImVec2 base_pos = GetCursorScreenPos();
- for (unsigned int n = 0; n < 256; n++)
- {
- // We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions
- // available here and thus cannot easily generate a zero-terminated UTF-8 encoded string.
- ImVec2 cell_p1(base_pos.x + (n % 16) * (cell_size + cell_spacing), base_pos.y + (n / 16) * (cell_size + cell_spacing));
- ImVec2 cell_p2(cell_p1.x + cell_size, cell_p1.y + cell_size);
- const ImFontGlyph* glyph = font->FindGlyphNoFallback((ImWchar)(base + n));
- draw_list->AddRect(cell_p1, cell_p2, glyph ? IM_COL32(255, 255, 255, 100) : IM_COL32(255, 255, 255, 50));
- if (!glyph)
+ int count = 0;
+ for (unsigned int n = 0; n < 256; n++)
+ if (font->FindGlyphNoFallback((ImWchar)(base + n)))
+ count++;
+ if (count <= 0)
+ continue;
+ if (!TreeNode((void*)(intptr_t)base, "U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ? "glyphs" : "glyph"))
continue;
- font->RenderChar(draw_list, cell_size, cell_p1, glyph_col, (ImWchar)(base + n));
- if (IsMouseHoveringRect(cell_p1, cell_p2))
+
+ // Draw a 16x16 grid of glyphs
+ ImVec2 base_pos = GetCursorScreenPos();
+ for (unsigned int n = 0; n < 256; n++)
{
- BeginTooltip();
- DebugNodeFontGlyph(font, glyph);
- EndTooltip();
+ // We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions
+ // available here and thus cannot easily generate a zero-terminated UTF-8 encoded string.
+ ImVec2 cell_p1(base_pos.x + (n % 16) * (cell_size + cell_spacing), base_pos.y + (n / 16) * (cell_size + cell_spacing));
+ ImVec2 cell_p2(cell_p1.x + cell_size, cell_p1.y + cell_size);
+ const ImFontGlyph* glyph = font->FindGlyphNoFallback((ImWchar)(base + n));
+ draw_list->AddRect(cell_p1, cell_p2, glyph ? IM_COL32(255, 255, 255, 100) : IM_COL32(255, 255, 255, 50));
+ if (!glyph)
+ continue;
+ font->RenderChar(draw_list, cell_size, cell_p1, glyph_col, (ImWchar)(base + n));
+ if (IsMouseHoveringRect(cell_p1, cell_p2) && BeginTooltip())
+ {
+ DebugNodeFontGlyph(font, glyph);
+ EndTooltip();
+ }
}
+ Dummy(ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16));
+ TreePop();
}
- Dummy(ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16));
TreePop();
}
- TreePop();
}
TreePop();
+ Unindent();
}
void ImGui::DebugNodeFontGlyph(ImFont*, const ImFontGlyph* glyph)
@@ -13700,10 +16379,10 @@ void ImGui::DebugNodeStorage(ImGuiStorage* storage, const char* label)
{
if (!TreeNode(label, "%s: %d entries, %d bytes", label, storage->Data.Size, storage->Data.size_in_bytes()))
return;
- for (int n = 0; n < storage->Data.Size; n++)
+ for (const ImGuiStoragePair& p : storage->Data)
{
- const ImGuiStorage::ImGuiStoragePair& p = storage->Data[n];
BulletText("Key 0x%08X Value { i: %d }", p.key, p.val_i); // Important: we currently don't store a type, real value may not be integer.
+ DebugLocateItemOnHover(p.key);
}
TreePop();
}
@@ -13716,13 +16395,11 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label)
char* p = buf;
const char* buf_end = buf + IM_ARRAYSIZE(buf);
const bool is_active = (tab_bar->PrevFrameVisible >= GetFrameCount() - 2);
- p += ImFormatString(p, buf_end - p, "%s 0x%08X (%d tabs)%s", label, tab_bar->ID, tab_bar->Tabs.Size, is_active ? "" : " *Inactive*");
- p += ImFormatString(p, buf_end - p, " { ");
+ p += ImFormatString(p, buf_end - p, "%s 0x%08X (%d tabs)%s {", label, tab_bar->ID, tab_bar->Tabs.Size, is_active ? "" : " *Inactive*");
for (int tab_n = 0; tab_n < ImMin(tab_bar->Tabs.Size, 3); tab_n++)
{
ImGuiTabItem* tab = &tab_bar->Tabs[tab_n];
- p += ImFormatString(p, buf_end - p, "%s'%s'",
- tab_n > 0 ? ", " : "", (tab->NameOffset != -1) ? tab_bar->GetTabName(tab) : "???");
+ p += ImFormatString(p, buf_end - p, "%s'%s'", tab_n > 0 ? ", " : "", TabBarGetTabName(tab_bar, tab));
}
p += ImFormatString(p, buf_end - p, (tab_bar->Tabs.Size > 3) ? " ... }" : " } ");
if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); }
@@ -13739,12 +16416,12 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label)
{
for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++)
{
- const ImGuiTabItem* tab = &tab_bar->Tabs[tab_n];
+ ImGuiTabItem* tab = &tab_bar->Tabs[tab_n];
PushID(tab);
if (SmallButton("<")) { TabBarQueueReorder(tab_bar, tab, -1); } SameLine(0, 2);
if (SmallButton(">")) { TabBarQueueReorder(tab_bar, tab, +1); } SameLine();
Text("%02d%c Tab 0x%08X '%s' Offset: %.2f, Width: %.2f/%.2f",
- tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, (tab->NameOffset != -1) ? tab_bar->GetTabName(tab) : "???", tab->Offset, tab->Width, tab->ContentWidth);
+ tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, TabBarGetTabName(tab_bar, tab), tab->Offset, tab->Width, tab->ContentWidth);
PopID();
}
TreePop();
@@ -13753,20 +16430,23 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label)
void ImGui::DebugNodeViewport(ImGuiViewportP* viewport)
{
+ ImGuiContext& g = *GImGui;
SetNextItemOpen(true, ImGuiCond_Once);
- if (TreeNode("viewport0", "Viewport #%d", 0))
+ bool open = TreeNode("viewport0", "Viewport #%d", 0);
+ if (IsItemHovered())
+ g.DebugMetricsConfig.HighlightViewportID = viewport->ID;
+ if (open)
{
ImGuiWindowFlags flags = viewport->Flags;
- BulletText("Main Pos: (%.0f,%.0f), Size: (%.0f,%.0f)\nWorkArea Offset Left: %.0f Top: %.0f, Right: %.0f, Bottom: %.0f",
+ BulletText("Main Pos: (%.0f,%.0f), Size: (%.0f,%.0f)\nWorkArea Inset Left: %.0f Top: %.0f, Right: %.0f, Bottom: %.0f",
viewport->Pos.x, viewport->Pos.y, viewport->Size.x, viewport->Size.y,
- viewport->WorkOffsetMin.x, viewport->WorkOffsetMin.y, viewport->WorkOffsetMax.x, viewport->WorkOffsetMax.y);
+ viewport->WorkInsetMin.x, viewport->WorkInsetMin.y, viewport->WorkInsetMax.x, viewport->WorkInsetMax.y);
BulletText("Flags: 0x%04X =%s%s%s", viewport->Flags,
(flags & ImGuiViewportFlags_IsPlatformWindow) ? " IsPlatformWindow" : "",
(flags & ImGuiViewportFlags_IsPlatformMonitor) ? " IsPlatformMonitor" : "",
(flags & ImGuiViewportFlags_OwnedByApp) ? " OwnedByApp" : "");
- for (int layer_i = 0; layer_i < IM_ARRAYSIZE(viewport->DrawDataBuilder.Layers); layer_i++)
- for (int draw_list_i = 0; draw_list_i < viewport->DrawDataBuilder.Layers[layer_i].Size; draw_list_i++)
- DebugNodeDrawList(NULL, viewport->DrawDataBuilder.Layers[layer_i][draw_list_i], "DrawList");
+ for (ImDrawList* draw_list : viewport->DrawDataP.CmdLists)
+ DebugNodeDrawList(NULL, viewport, draw_list, "DrawList");
TreePop();
}
}
@@ -13793,33 +16473,46 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label)
if (window->MemoryCompacted)
TextDisabled("Note: some memory buffers have been compacted/freed.");
+ if (g.IO.ConfigDebugIsDebuggerPresent && DebugBreakButton("**DebugBreak**", "in Begin()"))
+ g.DebugBreakInWindow = window->ID;
+
ImGuiWindowFlags flags = window->Flags;
- DebugNodeDrawList(window, window->DrawList, "DrawList");
+ DebugNodeDrawList(window, window->Viewport, window->DrawList, "DrawList");
BulletText("Pos: (%.1f,%.1f), Size: (%.1f,%.1f), ContentSize (%.1f,%.1f) Ideal (%.1f,%.1f)", window->Pos.x, window->Pos.y, window->Size.x, window->Size.y, window->ContentSize.x, window->ContentSize.y, window->ContentSizeIdeal.x, window->ContentSizeIdeal.y);
BulletText("Flags: 0x%08X (%s%s%s%s%s%s%s%s%s..)", flags,
(flags & ImGuiWindowFlags_ChildWindow) ? "Child " : "", (flags & ImGuiWindowFlags_Tooltip) ? "Tooltip " : "", (flags & ImGuiWindowFlags_Popup) ? "Popup " : "",
(flags & ImGuiWindowFlags_Modal) ? "Modal " : "", (flags & ImGuiWindowFlags_ChildMenu) ? "ChildMenu " : "", (flags & ImGuiWindowFlags_NoSavedSettings) ? "NoSavedSettings " : "",
(flags & ImGuiWindowFlags_NoMouseInputs)? "NoMouseInputs":"", (flags & ImGuiWindowFlags_NoNavInputs) ? "NoNavInputs" : "", (flags & ImGuiWindowFlags_AlwaysAutoResize) ? "AlwaysAutoResize" : "");
+ if (flags & ImGuiWindowFlags_ChildWindow)
+ BulletText("ChildFlags: 0x%08X (%s%s%s%s..)", window->ChildFlags,
+ (window->ChildFlags & ImGuiChildFlags_Borders) ? "Borders " : "",
+ (window->ChildFlags & ImGuiChildFlags_ResizeX) ? "ResizeX " : "",
+ (window->ChildFlags & ImGuiChildFlags_ResizeY) ? "ResizeY " : "",
+ (window->ChildFlags & ImGuiChildFlags_NavFlattened) ? "NavFlattened " : "");
BulletText("Scroll: (%.2f/%.2f,%.2f/%.2f) Scrollbar:%s%s", window->Scroll.x, window->ScrollMax.x, window->Scroll.y, window->ScrollMax.y, window->ScrollbarX ? "X" : "", window->ScrollbarY ? "Y" : "");
BulletText("Active: %d/%d, WriteAccessed: %d, BeginOrderWithinContext: %d", window->Active, window->WasActive, window->WriteAccessed, (window->Active || window->WasActive) ? window->BeginOrderWithinContext : -1);
BulletText("Appearing: %d, Hidden: %d (CanSkip %d Cannot %d), SkipItems: %d", window->Appearing, window->Hidden, window->HiddenFramesCanSkipItems, window->HiddenFramesCannotSkipItems, window->SkipItems);
for (int layer = 0; layer < ImGuiNavLayer_COUNT; layer++)
{
ImRect r = window->NavRectRel[layer];
- if (r.Min.x >= r.Max.y && r.Min.y >= r.Max.y)
+ if (r.Min.x >= r.Max.x && r.Min.y >= r.Max.y)
BulletText("NavLastIds[%d]: 0x%08X", layer, window->NavLastIds[layer]);
else
BulletText("NavLastIds[%d]: 0x%08X at +(%.1f,%.1f)(%.1f,%.1f)", layer, window->NavLastIds[layer], r.Min.x, r.Min.y, r.Max.x, r.Max.y);
DebugLocateItemOnHover(window->NavLastIds[layer]);
}
+ const ImVec2* pr = window->NavPreferredScoringPosRel;
+ for (int layer = 0; layer < ImGuiNavLayer_COUNT; layer++)
+ BulletText("NavPreferredScoringPosRel[%d] = {%.1f,%.1f)", layer, (pr[layer].x == FLT_MAX ? -99999.0f : pr[layer].x), (pr[layer].y == FLT_MAX ? -99999.0f : pr[layer].y)); // Display as 99999.0f so it looks neater.
BulletText("NavLayersActiveMask: %X, NavLastChildNavWindow: %s", window->DC.NavLayersActiveMask, window->NavLastChildNavWindow ? window->NavLastChildNavWindow->Name : "NULL");
- if (window->RootWindow != window) { DebugNodeWindow(window->RootWindow, "RootWindow"); }
- if (window->ParentWindow != NULL) { DebugNodeWindow(window->ParentWindow, "ParentWindow"); }
- if (window->DC.ChildWindows.Size > 0) { DebugNodeWindowsList(&window->DC.ChildWindows, "ChildWindows"); }
+ if (window->RootWindow != window) { DebugNodeWindow(window->RootWindow, "RootWindow"); }
+ if (window->ParentWindow != NULL) { DebugNodeWindow(window->ParentWindow, "ParentWindow"); }
+ if (window->ParentWindowForFocusRoute != NULL) { DebugNodeWindow(window->ParentWindowForFocusRoute, "ParentWindowForFocusRoute"); }
+ if (window->DC.ChildWindows.Size > 0) { DebugNodeWindowsList(&window->DC.ChildWindows, "ChildWindows"); }
if (window->ColumnsStorage.Size > 0 && TreeNode("Columns", "Columns sets (%d)", window->ColumnsStorage.Size))
{
- for (int n = 0; n < window->ColumnsStorage.Size; n++)
- DebugNodeColumns(&window->ColumnsStorage[n]);
+ for (ImGuiOldColumns& columns : window->ColumnsStorage)
+ DebugNodeColumns(&columns);
TreePop();
}
DebugNodeStorage(&window->StateStorage, "Storage");
@@ -13828,8 +16521,12 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label)
void ImGui::DebugNodeWindowSettings(ImGuiWindowSettings* settings)
{
+ if (settings->WantDelete)
+ BeginDisabled();
Text("0x%08X \"%s\" Pos (%d,%d) Size (%d,%d) Collapsed=%d",
settings->ID, settings->GetName(), settings->Pos.x, settings->Pos.y, settings->Size.x, settings->Size.y, settings->Collapsed);
+ if (settings->WantDelete)
+ EndDisabled();
}
void ImGui::DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* label)
@@ -13879,17 +16576,62 @@ void ImGui::DebugLogV(const char* fmt, va_list args)
{
ImGuiContext& g = *GImGui;
const int old_size = g.DebugLogBuf.size();
- g.DebugLogBuf.appendf("[%05d] ", g.FrameCount);
+ if (g.ContextName[0] != 0)
+ g.DebugLogBuf.appendf("[%s] [%05d] ", g.ContextName, g.FrameCount);
+ else
+ g.DebugLogBuf.appendf("[%05d] ", g.FrameCount);
g.DebugLogBuf.appendfv(fmt, args);
+ g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size());
if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTTY)
IMGUI_DEBUG_PRINTF("%s", g.DebugLogBuf.begin() + old_size);
- g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size());
+#ifdef IMGUI_ENABLE_TEST_ENGINE
+ // IMGUI_TEST_ENGINE_LOG() adds a trailing \n automatically
+ const int new_size = g.DebugLogBuf.size();
+ const bool trailing_carriage_return = (g.DebugLogBuf[new_size - 1] == '\n');
+ if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTestEngine)
+ IMGUI_TEST_ENGINE_LOG("%.*s", new_size - old_size - (trailing_carriage_return ? 1 : 0), g.DebugLogBuf.begin() + old_size);
+#endif
+}
+
+// FIXME-LAYOUT: To be done automatically via layout mode once we rework ItemSize/ItemAdd into ItemLayout.
+static void SameLineOrWrap(const ImVec2& size)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ ImVec2 pos(window->DC.CursorPosPrevLine.x + g.Style.ItemSpacing.x, window->DC.CursorPosPrevLine.y);
+ if (window->WorkRect.Contains(ImRect(pos, pos + size)))
+ ImGui::SameLine();
+}
+
+static void ShowDebugLogFlag(const char* name, ImGuiDebugLogFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ ImVec2 size(ImGui::GetFrameHeight() + g.Style.ItemInnerSpacing.x + ImGui::CalcTextSize(name).x, ImGui::GetFrameHeight());
+ SameLineOrWrap(size); // FIXME-LAYOUT: To be done automatically once we rework ItemSize/ItemAdd into ItemLayout.
+
+ bool highlight_errors = (flags == ImGuiDebugLogFlags_EventError && g.DebugLogSkippedErrors > 0);
+ if (highlight_errors)
+ ImGui::PushStyleColor(ImGuiCol_Text, ImLerp(g.Style.Colors[ImGuiCol_Text], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.30f));
+ if (ImGui::CheckboxFlags(name, &g.DebugLogFlags, flags) && g.IO.KeyShift && (g.DebugLogFlags & flags) != 0)
+ {
+ g.DebugLogAutoDisableFrames = 2;
+ g.DebugLogAutoDisableFlags |= flags;
+ }
+ if (highlight_errors)
+ {
+ ImGui::PopStyleColor();
+ ImGui::SetItemTooltip("%d past errors skipped.", g.DebugLogSkippedErrors);
+ }
+ else
+ {
+ ImGui::SetItemTooltip("Hold SHIFT when clicking to enable for 2 frames only (useful for spammy log entries)");
+ }
}
void ImGui::ShowDebugLogWindow(bool* p_open)
{
ImGuiContext& g = *GImGui;
- if (!(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize))
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0)
SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 12.0f), ImGuiCond_FirstUseEver);
if (!Begin("Dear ImGui Debug Log", p_open) || GetCurrentWindow()->BeginCount > 1)
{
@@ -13897,49 +16639,57 @@ void ImGui::ShowDebugLogWindow(bool* p_open)
return;
}
- AlignTextToFramePadding();
- Text("Log events:");
- SameLine(); CheckboxFlags("All", &g.DebugLogFlags, ImGuiDebugLogFlags_EventMask_);
- SameLine(); CheckboxFlags("ActiveId", &g.DebugLogFlags, ImGuiDebugLogFlags_EventActiveId);
- SameLine(); CheckboxFlags("Focus", &g.DebugLogFlags, ImGuiDebugLogFlags_EventFocus);
- SameLine(); CheckboxFlags("Popup", &g.DebugLogFlags, ImGuiDebugLogFlags_EventPopup);
- SameLine(); CheckboxFlags("Nav", &g.DebugLogFlags, ImGuiDebugLogFlags_EventNav);
- SameLine(); CheckboxFlags("Clipper", &g.DebugLogFlags, ImGuiDebugLogFlags_EventClipper);
- SameLine(); CheckboxFlags("IO", &g.DebugLogFlags, ImGuiDebugLogFlags_EventIO);
+ ImGuiDebugLogFlags all_enable_flags = ImGuiDebugLogFlags_EventMask_ & ~ImGuiDebugLogFlags_EventInputRouting;
+ CheckboxFlags("All", &g.DebugLogFlags, all_enable_flags);
+ SetItemTooltip("(except InputRouting which is spammy)");
+
+ ShowDebugLogFlag("Errors", ImGuiDebugLogFlags_EventError);
+ ShowDebugLogFlag("ActiveId", ImGuiDebugLogFlags_EventActiveId);
+ ShowDebugLogFlag("Clipper", ImGuiDebugLogFlags_EventClipper);
+ ShowDebugLogFlag("Focus", ImGuiDebugLogFlags_EventFocus);
+ ShowDebugLogFlag("IO", ImGuiDebugLogFlags_EventIO);
+ //ShowDebugLogFlag("Font", ImGuiDebugLogFlags_EventFont);
+ ShowDebugLogFlag("Nav", ImGuiDebugLogFlags_EventNav);
+ ShowDebugLogFlag("Popup", ImGuiDebugLogFlags_EventPopup);
+ ShowDebugLogFlag("Selection", ImGuiDebugLogFlags_EventSelection);
+ ShowDebugLogFlag("InputRouting", ImGuiDebugLogFlags_EventInputRouting);
if (SmallButton("Clear"))
{
g.DebugLogBuf.clear();
g.DebugLogIndex.clear();
+ g.DebugLogSkippedErrors = 0;
}
SameLine();
if (SmallButton("Copy"))
SetClipboardText(g.DebugLogBuf.c_str());
- BeginChild("##log", ImVec2(0.0f, 0.0f), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar);
+ SameLine();
+ if (SmallButton("Configure Outputs.."))
+ OpenPopup("Outputs");
+ if (BeginPopup("Outputs"))
+ {
+ CheckboxFlags("OutputToTTY", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTTY);
+#ifndef IMGUI_ENABLE_TEST_ENGINE
+ BeginDisabled();
+#endif
+ CheckboxFlags("OutputToTestEngine", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTestEngine);
+#ifndef IMGUI_ENABLE_TEST_ENGINE
+ EndDisabled();
+#endif
+ EndPopup();
+ }
+
+ BeginChild("##log", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Borders, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar);
+
+ const ImGuiDebugLogFlags backup_log_flags = g.DebugLogFlags;
+ g.DebugLogFlags &= ~ImGuiDebugLogFlags_EventClipper;
ImGuiListClipper clipper;
clipper.Begin(g.DebugLogIndex.size());
while (clipper.Step())
for (int line_no = clipper.DisplayStart; line_no < clipper.DisplayEnd; line_no++)
- {
- const char* line_begin = g.DebugLogIndex.get_line_begin(g.DebugLogBuf.c_str(), line_no);
- const char* line_end = g.DebugLogIndex.get_line_end(g.DebugLogBuf.c_str(), line_no);
- TextUnformatted(line_begin, line_end);
- ImRect text_rect = g.LastItemData.Rect;
- if (IsItemHovered())
- for (const char* p = line_begin; p < line_end - 10; p++)
- {
- ImGuiID id = 0;
- if (p[0] != '0' || (p[1] != 'x' && p[1] != 'X') || sscanf(p + 2, "%X", &id) != 1)
- continue;
- ImVec2 p0 = CalcTextSize(line_begin, p);
- ImVec2 p1 = CalcTextSize(p, p + 10);
- g.LastItemData.Rect = ImRect(text_rect.Min + ImVec2(p0.x, 0.0f), text_rect.Min + ImVec2(p0.x + p1.x, p1.y));
- if (IsMouseHoveringRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, true))
- DebugLocateItemOnHover(id);
- p += 10;
- }
- }
+ DebugTextUnformattedWithLocateItem(g.DebugLogIndex.get_line_begin(g.DebugLogBuf.c_str(), line_no), g.DebugLogIndex.get_line_end(g.DebugLogBuf.c_str(), line_no));
+ g.DebugLogFlags = backup_log_flags;
if (GetScrollY() >= GetScrollMaxY())
SetScrollHereY(1.0f);
EndChild();
@@ -13947,10 +16697,64 @@ void ImGui::ShowDebugLogWindow(bool* p_open)
End();
}
+// Display line, search for 0xXXXXXXXX identifiers and call DebugLocateItemOnHover() when hovered.
+void ImGui::DebugTextUnformattedWithLocateItem(const char* line_begin, const char* line_end)
+{
+ TextUnformatted(line_begin, line_end);
+ if (!IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem))
+ return;
+ ImGuiContext& g = *GImGui;
+ ImRect text_rect = g.LastItemData.Rect;
+ for (const char* p = line_begin; p <= line_end - 10; p++)
+ {
+ ImGuiID id = 0;
+ if (p[0] != '0' || (p[1] != 'x' && p[1] != 'X') || sscanf(p + 2, "%X", &id) != 1 || ImCharIsXdigitA(p[10]))
+ continue;
+ ImVec2 p0 = CalcTextSize(line_begin, p);
+ ImVec2 p1 = CalcTextSize(p, p + 10);
+ g.LastItemData.Rect = ImRect(text_rect.Min + ImVec2(p0.x, 0.0f), text_rect.Min + ImVec2(p0.x + p1.x, p1.y));
+ if (IsMouseHoveringRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, true))
+ DebugLocateItemOnHover(id);
+ p += 10;
+ }
+}
+
//-----------------------------------------------------------------------------
-// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, STACK TOOL)
+// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, ID STACK TOOL)
//-----------------------------------------------------------------------------
+// Draw a small cross at current CursorPos in current window's DrawList
+void ImGui::DebugDrawCursorPos(ImU32 col)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ ImVec2 pos = window->DC.CursorPos;
+ window->DrawList->AddLine(ImVec2(pos.x, pos.y - 3.0f), ImVec2(pos.x, pos.y + 4.0f), col, 1.0f);
+ window->DrawList->AddLine(ImVec2(pos.x - 3.0f, pos.y), ImVec2(pos.x + 4.0f, pos.y), col, 1.0f);
+}
+
+// Draw a 10px wide rectangle around CurposPos.x using Line Y1/Y2 in current window's DrawList
+void ImGui::DebugDrawLineExtents(ImU32 col)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ float curr_x = window->DC.CursorPos.x;
+ float line_y1 = (window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y);
+ float line_y2 = line_y1 + (window->DC.IsSameLine ? window->DC.PrevLineSize.y : window->DC.CurrLineSize.y);
+ window->DrawList->AddLine(ImVec2(curr_x - 5.0f, line_y1), ImVec2(curr_x + 5.0f, line_y1), col, 1.0f);
+ window->DrawList->AddLine(ImVec2(curr_x - 0.5f, line_y1), ImVec2(curr_x - 0.5f, line_y2), col, 1.0f);
+ window->DrawList->AddLine(ImVec2(curr_x - 5.0f, line_y2), ImVec2(curr_x + 5.0f, line_y2), col, 1.0f);
+}
+
+// Draw last item rect in ForegroundDrawList (so it is always visible)
+void ImGui::DebugDrawItemRect(ImU32 col)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ GetForegroundDrawList(window)->AddRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, col);
+}
+
+// [DEBUG] Locate item position/rectangle given an ID.
static const ImU32 DEBUG_LOCATE_ITEM_COLOR = IM_COL32(0, 255, 0, 255); // Green
void ImGui::DebugLocateItem(ImGuiID target_id)
@@ -13958,8 +16762,10 @@ void ImGui::DebugLocateItem(ImGuiID target_id)
ImGuiContext& g = *GImGui;
g.DebugLocateId = target_id;
g.DebugLocateFrames = 2;
+ g.DebugBreakInLocateId = false;
}
+// FIXME: Doesn't work over through a modal window, because they clear HoveredWindow.
void ImGui::DebugLocateItemOnHover(ImGuiID target_id)
{
if (target_id == 0 || !IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenBlockedByPopup))
@@ -13967,11 +16773,24 @@ void ImGui::DebugLocateItemOnHover(ImGuiID target_id)
ImGuiContext& g = *GImGui;
DebugLocateItem(target_id);
GetForegroundDrawList(g.CurrentWindow)->AddRect(g.LastItemData.Rect.Min - ImVec2(3.0f, 3.0f), g.LastItemData.Rect.Max + ImVec2(3.0f, 3.0f), DEBUG_LOCATE_ITEM_COLOR);
+
+ // Can't easily use a context menu here because it will mess with focus, active id etc.
+ if (g.IO.ConfigDebugIsDebuggerPresent && g.MouseStationaryTimer > 1.0f)
+ {
+ DebugBreakButtonTooltip(false, "in ItemAdd()");
+ if (IsKeyChordPressed(g.DebugBreakKeyChord))
+ g.DebugBreakInLocateId = true;
+ }
}
void ImGui::DebugLocateItemResolveWithLastItem()
{
ImGuiContext& g = *GImGui;
+
+ // [DEBUG] Debug break requested by user
+ if (g.DebugBreakInLocateId)
+ IM_DEBUG_BREAK();
+
ImGuiLastItemData item_data = g.LastItemData;
g.DebugLocateId = 0;
ImDrawList* draw_list = GetForegroundDrawList(g.CurrentWindow);
@@ -13983,6 +16802,12 @@ void ImGui::DebugLocateItemResolveWithLastItem()
draw_list->AddLine(p1, p2, DEBUG_LOCATE_ITEM_COLOR);
}
+void ImGui::DebugStartItemPicker()
+{
+ ImGuiContext& g = *GImGui;
+ g.DebugItemPickerActive = true;
+}
+
// [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack.
void ImGui::UpdateDebugToolItemPicker()
{
@@ -14005,7 +16830,8 @@ void ImGui::UpdateDebugToolItemPicker()
if (change_mapping && IsMouseClicked(mouse_button))
g.DebugItemPickerMouseButton = (ImU8)mouse_button;
SetNextWindowBgAlpha(0.70f);
- BeginTooltip();
+ if (!BeginTooltip())
+ return;
Text("HoveredId: 0x%08X", hovered_id);
Text("Press ESC to abort picking.");
const char* mouse_button_names[] = { "Left", "Right", "Middle" };
@@ -14016,13 +16842,13 @@ void ImGui::UpdateDebugToolItemPicker()
EndTooltip();
}
-// [DEBUG] Stack Tool: update queries. Called by NewFrame()
+// [DEBUG] ID Stack Tool: update queries. Called by NewFrame()
void ImGui::UpdateDebugToolStackQueries()
{
ImGuiContext& g = *GImGui;
- ImGuiStackTool* tool = &g.DebugStackTool;
+ ImGuiIDStackTool* tool = &g.DebugIDStackTool;
- // Clear hook when stack tool is not visible
+ // Clear hook when id stack tool is not visible
g.DebugHookIdInfo = 0;
if (g.FrameCount != tool->LastActiveFrame + 1)
return;
@@ -14056,12 +16882,12 @@ void ImGui::UpdateDebugToolStackQueries()
}
}
-// [DEBUG] Stack tool: hooks called by GetID() family functions
+// [DEBUG] ID Stack tool: hooks called by GetID() family functions
void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- ImGuiStackTool* tool = &g.DebugStackTool;
+ ImGuiIDStackTool* tool = &g.DebugIDStackTool;
// Step 0: stack query
// This assumes that the ID was computed with the current ID stack, which tends to be the case for our widget.
@@ -14087,7 +16913,7 @@ void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* dat
ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "%d", (int)(intptr_t)data_id);
break;
case ImGuiDataType_String:
- ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "%.*s", data_id_end ? (int)((const char*)data_id_end - (const char*)data_id) : (int)strlen((const char*)data_id), (const char*)data_id);
+ ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "%.*s", data_id_end ? (int)((const char*)data_id_end - (const char*)data_id) : (int)ImStrlen((const char*)data_id), (const char*)data_id);
break;
case ImGuiDataType_Pointer:
ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "(void*)0x%p", data_id);
@@ -14104,7 +16930,7 @@ void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* dat
info->DataType = data_type;
}
-static int StackToolFormatLevelInfo(ImGuiStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size)
+static int StackToolFormatLevelInfo(ImGuiIDStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size)
{
ImGuiStackLevelInfo* info = &tool->Results[n];
ImGuiWindow* window = (info->Desc[0] == 0 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL;
@@ -14121,56 +16947,58 @@ static int StackToolFormatLevelInfo(ImGuiStackTool* tool, int n, bool format_for
return ImFormatString(buf, buf_size, "???");
}
-// Stack Tool: Display UI
-void ImGui::ShowStackToolWindow(bool* p_open)
+// ID Stack Tool: Display UI
+void ImGui::ShowIDStackToolWindow(bool* p_open)
{
ImGuiContext& g = *GImGui;
- if (!(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize))
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0)
SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 8.0f), ImGuiCond_FirstUseEver);
- if (!Begin("Dear ImGui Stack Tool", p_open) || GetCurrentWindow()->BeginCount > 1)
+ if (!Begin("Dear ImGui ID Stack Tool", p_open) || GetCurrentWindow()->BeginCount > 1)
{
End();
return;
}
// Display hovered/active status
- ImGuiStackTool* tool = &g.DebugStackTool;
- const ImGuiID hovered_id = g.HoveredIdPreviousFrame;
- const ImGuiID active_id = g.ActiveId;
-#ifdef IMGUI_ENABLE_TEST_ENGINE
- Text("HoveredId: 0x%08X (\"%s\"), ActiveId: 0x%08X (\"%s\")", hovered_id, hovered_id ? ImGuiTestEngine_FindItemDebugLabel(&g, hovered_id) : "", active_id, active_id ? ImGuiTestEngine_FindItemDebugLabel(&g, active_id) : "");
-#else
- Text("HoveredId: 0x%08X, ActiveId: 0x%08X", hovered_id, active_id);
-#endif
+ ImGuiIDStackTool* tool = &g.DebugIDStackTool;
+
+ // Build and display path
+ tool->ResultPathBuf.resize(0);
+ for (int stack_n = 0; stack_n < tool->Results.Size; stack_n++)
+ {
+ char level_desc[256];
+ StackToolFormatLevelInfo(tool, stack_n, false, level_desc, IM_ARRAYSIZE(level_desc));
+ tool->ResultPathBuf.append(stack_n == 0 ? "//" : "/");
+ for (int n = 0; level_desc[n]; n++)
+ {
+ if (level_desc[n] == '/')
+ tool->ResultPathBuf.append("\\");
+ tool->ResultPathBuf.append(level_desc + n, level_desc + n + 1);
+ }
+ }
+ Text("0x%08X", tool->QueryId);
SameLine();
MetricsHelpMarker("Hover an item with the mouse to display elements of the ID Stack leading to the item's final ID.\nEach level of the stack correspond to a PushID() call.\nAll levels of the stack are hashed together to make the final ID of a widget (ID displayed at the bottom level of the stack).\nRead FAQ entry about the ID stack for details.");
// CTRL+C to copy path
const float time_since_copy = (float)g.Time - tool->CopyToClipboardLastTime;
- Checkbox("Ctrl+C: copy path to clipboard", &tool->CopyToClipboardOnCtrlC);
+ SameLine();
+ PushStyleVarY(ImGuiStyleVar_FramePadding, 0.0f); Checkbox("Ctrl+C: copy path", &tool->CopyToClipboardOnCtrlC); PopStyleVar();
SameLine();
TextColored((time_since_copy >= 0.0f && time_since_copy < 0.75f && ImFmod(time_since_copy, 0.25f) < 0.25f * 0.5f) ? ImVec4(1.f, 1.f, 0.3f, 1.f) : ImVec4(), "*COPIED*");
- if (tool->CopyToClipboardOnCtrlC && IsKeyDown(ImGuiMod_Ctrl) && IsKeyPressed(ImGuiKey_C))
+ if (tool->CopyToClipboardOnCtrlC && Shortcut(ImGuiMod_Ctrl | ImGuiKey_C, ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverFocused))
{
tool->CopyToClipboardLastTime = (float)g.Time;
- char* p = g.TempBuffer.Data;
- char* p_end = p + g.TempBuffer.Size;
- for (int stack_n = 0; stack_n < tool->Results.Size && p + 3 < p_end; stack_n++)
- {
- *p++ = '/';
- char level_desc[256];
- StackToolFormatLevelInfo(tool, stack_n, false, level_desc, IM_ARRAYSIZE(level_desc));
- for (int n = 0; level_desc[n] && p + 2 < p_end; n++)
- {
- if (level_desc[n] == '/')
- *p++ = '\\';
- *p++ = level_desc[n];
- }
- }
- *p = '\0';
- SetClipboardText(g.TempBuffer.Data);
+ SetClipboardText(tool->ResultPathBuf.c_str());
}
+ Text("- Path \"%s\"", tool->ResultPathBuf.c_str());
+#ifdef IMGUI_ENABLE_TEST_ENGINE
+ Text("- Label \"%s\"", tool->QueryId ? ImGuiTestEngine_FindItemDebugLabel(&g, tool->QueryId) : "");
+#endif
+
+ Separator();
+
// Display decorated stack
tool->LastActiveFrame = g.FrameCount;
if (tool->Results.Size > 0 && BeginTable("##table", 3, ImGuiTableFlags_Borders))
@@ -14203,7 +17031,7 @@ void ImGui::ShowStackToolWindow(bool* p_open)
void ImGui::ShowMetricsWindow(bool*) {}
void ImGui::ShowFontAtlas(ImFontAtlas*) {}
void ImGui::DebugNodeColumns(ImGuiOldColumns*) {}
-void ImGui::DebugNodeDrawList(ImGuiWindow*, const ImDrawList*, const char*) {}
+void ImGui::DebugNodeDrawList(ImGuiWindow*, ImGuiViewportP*, const ImDrawList*, const char*) {}
void ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList*, const ImDrawList*, const ImDrawCmd*, bool, bool) {}
void ImGui::DebugNodeFont(ImFont*) {}
void ImGui::DebugNodeStorage(ImGuiStorage*, const char*) {}
@@ -14213,13 +17041,10 @@ void ImGui::DebugNodeWindowSettings(ImGuiWindowSettings*) {}
void ImGui::DebugNodeWindowsList(ImVector<ImGuiWindow*>*, const char*) {}
void ImGui::DebugNodeViewport(ImGuiViewportP*) {}
-void ImGui::DebugLog(const char*, ...) {}
-void ImGui::DebugLogV(const char*, va_list) {}
void ImGui::ShowDebugLogWindow(bool*) {}
-void ImGui::ShowStackToolWindow(bool*) {}
+void ImGui::ShowIDStackToolWindow(bool*) {}
+void ImGui::DebugStartItemPicker() {}
void ImGui::DebugHookIdInfo(ImGuiID, ImGuiDataType, const void*, const void*) {}
-void ImGui::UpdateDebugToolItemPicker() {}
-void ImGui::UpdateDebugToolStackQueries() {}
#endif // #ifndef IMGUI_DISABLE_DEBUG_TOOLS
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
index a626c79f4b0..75750ae1090 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
@@ -1,29 +1,35 @@
-// dear imgui, v1.89.1 WIP
+// dear imgui, v1.91.9b
// (headers)
// Help:
-// - Read FAQ at http://dearimgui.org/faq
-// - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase.
+// - See links below.
// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that.
-// Read imgui.cpp for details, links and comments.
+// - Read top of imgui.cpp for more details, links and comments.
+// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4.
// Resources:
-// - FAQ http://dearimgui.org/faq
-// - Homepage & latest https://github.com/ocornut/imgui
-// - Releases & changelog https://github.com/ocornut/imgui/releases
-// - Gallery https://github.com/ocornut/imgui/issues/5243 (please post your screenshots/video there!)
-// - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there)
-// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
-// - Issues & support https://github.com/ocornut/imgui/issues
-
-// Getting Started?
-// - For first-time users having issues compiling/linking/running or issues loading fonts:
-// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above.
+// - FAQ ........................ https://dearimgui.com/faq (in repository as docs/FAQ.md)
+// - Homepage ................... https://github.com/ocornut/imgui
+// - Releases & changelog ....... https://github.com/ocornut/imgui/releases
+// - Gallery .................... https://github.com/ocornut/imgui/issues?q=label%3Agallery (please post your screenshots/video there!)
+// - Wiki ....................... https://github.com/ocornut/imgui/wiki (lots of good stuff there)
+// - Getting Started https://github.com/ocornut/imgui/wiki/Getting-Started (how to integrate in an existing app by adding ~25 lines of code)
+// - Third-party Extensions https://github.com/ocornut/imgui/wiki/Useful-Extensions (ImPlot & many more)
+// - Bindings/Backends https://github.com/ocornut/imgui/wiki/Bindings (language bindings, backends for various tech/engines)
+// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
+// - Debug Tools https://github.com/ocornut/imgui/wiki/Debug-Tools
+// - Software using Dear ImGui https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui
+// - Issues & support ........... https://github.com/ocornut/imgui/issues
+// - Test Engine & Automation ... https://github.com/ocornut/imgui_test_engine (test suite, test engine to automate your apps)
+
+// For first-time users having issues compiling/linking/running/loading fonts:
+// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above.
+// Everything else should be asked in 'Issues'! We are building a database of cross-linked knowledge there.
// Library Version
-// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345')
-#define IMGUI_VERSION "1.89.1 WIP"
-#define IMGUI_VERSION_NUM 18903
+// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
+#define IMGUI_VERSION "1.91.9b"
+#define IMGUI_VERSION_NUM 19191
#define IMGUI_HAS_TABLE
/*
@@ -31,17 +37,20 @@
Index of this file:
// [SECTION] Header mess
// [SECTION] Forward declarations and basic types
+// [SECTION] Texture identifier (ImTextureID)
// [SECTION] Dear ImGui end-user API functions
// [SECTION] Flags & Enumerations
-// [SECTION] Helpers: Memory allocations macros, ImVector<>
+// [SECTION] Tables API flags and structures (ImGuiTableFlags, ImGuiTableColumnFlags, ImGuiTableRowFlags, ImGuiTableBgTarget, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs)
+// [SECTION] Helpers: Debug log, Memory allocations macros, ImVector<>
// [SECTION] ImGuiStyle
// [SECTION] ImGuiIO
-// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs)
-// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor)
+// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload)
+// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor)
+// [SECTION] Multi-Select API flags and structures (ImGuiMultiSelectFlags, ImGuiMultiSelectIO, ImGuiSelectionRequest, ImGuiSelectionBasicStorage, ImGuiSelectionExternalStorage)
// [SECTION] Drawing API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawFlags, ImDrawListFlags, ImDrawList, ImDrawData)
// [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont)
// [SECTION] Viewports (ImGuiViewportFlags, ImGuiViewport)
-// [SECTION] Platform Dependent Interfaces (ImGuiPlatformImeData)
+// [SECTION] ImGuiPlatformIO + other Platform Dependent Interfaces (ImGuiPlatformImeData)
// [SECTION] Obsolete functions and types
*/
@@ -49,7 +58,7 @@ Index of this file:
#pragma once
// Configuration file with compile-time options
-// (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system')
+// (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system)
#ifdef IMGUI_USER_CONFIG
#include IMGUI_USER_CONFIG
#endif
@@ -69,7 +78,7 @@ Index of this file:
// Define attributes of all API symbols declarations (e.g. for DLL under Windows)
// IMGUI_API is used for core imgui functions, IMGUI_IMPL_API is used for the default backends files (imgui_impl_xxx.h)
-// Using dear imgui via a shared library is not recommended, because we don't guarantee backward nor forward ABI compatibility (also function call overhead, as dear imgui is a call-heavy API)
+// Using dear imgui via a shared library is not recommended: we don't guarantee backward nor forward ABI compatibility + this is a call-heavy library and function call overhead adds up.
#ifndef IMGUI_API
#define IMGUI_API
#endif
@@ -84,10 +93,13 @@ Index of this file:
#endif
#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR) / sizeof(*(_ARR)))) // Size of a static C-style array. Don't use on pointers!
#define IM_UNUSED(_VAR) ((void)(_VAR)) // Used to silence "unused variable warnings". Often useful as asserts may be stripped out from final builds.
-#define IM_OFFSETOF(_TYPE,_MEMBER) offsetof(_TYPE, _MEMBER) // Offset of _MEMBER within _TYPE. Standardized as offsetof() in C++11
+
+// Check that version and structures layouts are matching between compiled imgui code and caller. Read comments above DebugCheckVersionAndDataLayout() for details.
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
// Helper Macros - IM_FMTARGS, IM_FMTLIST: Apply printf-style warnings to our formatting functions.
+// (MSVC provides an equivalent mechanism via SAL Annotations but it would require the macros in a different
+// location. e.g. #include <sal.h> + void myprintf(_Printf_format_string_ const char* format, ...))
#if !defined(IMGUI_USE_STB_SPRINTF) && defined(__MINGW32__) && !defined(__clang__)
#define IM_FMTARGS(FMT) __attribute__((format(gnu_printf, FMT, FMT+1)))
#define IM_FMTLIST(FMT) __attribute__((format(gnu_printf, FMT, 0)))
@@ -115,21 +127,39 @@ Index of this file:
#endif
#if defined(__clang__)
#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wold-style-cast"
-#if __has_warning("-Wzero-as-null-pointer-constant")
-#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
+#if __has_warning("-Wunknown-warning-option")
+#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx'
#endif
+#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
+#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast
+#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe
+#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant
+#pragma clang diagnostic ignored "-Wreserved-identifier" // warning: identifier '_Xxx' is reserved because it starts with '_' followed by a capital letter
+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
+#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
#elif defined(__GNUC__)
#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
-#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
+#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
+#pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe
+#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
#endif
//-----------------------------------------------------------------------------
// [SECTION] Forward declarations and basic types
//-----------------------------------------------------------------------------
-// Forward declarations
+// Scalar data types
+typedef unsigned int ImGuiID;// A unique ID used by widgets (typically the result of hashing a stack of string)
+typedef signed char ImS8; // 8-bit signed integer
+typedef unsigned char ImU8; // 8-bit unsigned integer
+typedef signed short ImS16; // 16-bit signed integer
+typedef unsigned short ImU16; // 16-bit unsigned integer
+typedef signed int ImS32; // 32-bit signed integer == int
+typedef unsigned int ImU32; // 32-bit unsigned integer (often used to store packed colors)
+typedef signed long long ImS64; // 64-bit signed integer
+typedef unsigned long long ImU64; // 64-bit unsigned integer
+
+// Forward declarations: ImDrawList, ImFontAtlas layer
struct ImDrawChannel; // Temporary storage to output draw commands out of order, used by ImDrawListSplitter and ImDrawList::ChannelsSplit()
struct ImDrawCmd; // A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call, unless it is a callback)
struct ImDrawData; // All draw command lists required to render the frame + pos/size coordinates to use for the projection matrix.
@@ -144,16 +174,24 @@ struct ImFontConfig; // Configuration data when adding a font or
struct ImFontGlyph; // A single font glyph (code point + coordinates within in ImFontAtlas + offset)
struct ImFontGlyphRangesBuilder; // Helper to build glyph ranges from text/string data
struct ImColor; // Helper functions to create a color that can be converted to either u32 or float4 (*OBSOLETE* please avoid using)
+
+// Forward declarations: ImGui layer
struct ImGuiContext; // Dear ImGui context (opaque structure, unless including imgui_internal.h)
-struct ImGuiIO; // Main configuration and I/O between your application and ImGui
+struct ImGuiIO; // Main configuration and I/O between your application and ImGui (also see: ImGuiPlatformIO)
struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
struct ImGuiKeyData; // Storage for ImGuiIO and IsKeyDown(), IsKeyPressed() etc functions.
struct ImGuiListClipper; // Helper to manually clip large list of items
+struct ImGuiMultiSelectIO; // Structure to interact with a BeginMultiSelect()/EndMultiSelect() block
struct ImGuiOnceUponAFrame; // Helper for running a block of code not more than once a frame
struct ImGuiPayload; // User data payload for drag and drop operations
-struct ImGuiPlatformImeData; // Platform IME data for io.SetPlatformImeDataFn() function.
+struct ImGuiPlatformIO; // Interface between platform/renderer backends and ImGui (e.g. Clipboard, IME hooks). Extends ImGuiIO. In docking branch, this gets extended to support multi-viewports.
+struct ImGuiPlatformImeData; // Platform IME data for io.PlatformSetImeDataFn() function.
+struct ImGuiSelectionBasicStorage; // Optional helper to store multi-selection state + apply multi-selection requests.
+struct ImGuiSelectionExternalStorage;//Optional helper to apply multi-selection requests to existing randomly accessible storage.
+struct ImGuiSelectionRequest; // A selection request (stored in ImGuiMultiSelectIO)
struct ImGuiSizeCallbackData; // Callback data when using SetNextWindowSizeConstraints() (rare/advanced use)
-struct ImGuiStorage; // Helper for key->value storage
+struct ImGuiStorage; // Helper for key->value storage (container sorted by key)
+struct ImGuiStoragePair; // Helper for key->value storage (pair)
struct ImGuiStyle; // Runtime data for styling/colors
struct ImGuiTableSortSpecs; // Sorting specifications for a table (often handling sort specs for a single column, occasionally more)
struct ImGuiTableColumnSortSpecs; // Sorting specification for one column of a table
@@ -164,37 +202,44 @@ struct ImGuiViewport; // A Platform Window (always only one in 'ma
// Enumerations
// - We don't use strongly typed enums much because they add constraints (can't extend in private code, can't store typed in bit fields, extra casting on iteration)
// - Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists!
-// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
-// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
+// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
+// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments.
+// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments.
+enum ImGuiDir : int; // -> enum ImGuiDir // Enum: A cardinal direction (Left, Right, Up, Down)
enum ImGuiKey : int; // -> enum ImGuiKey // Enum: A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value)
+enum ImGuiMouseSource : int; // -> enum ImGuiMouseSource // Enum; A mouse input source identifier (Mouse, TouchScreen, Pen)
+enum ImGuiSortDirection : ImU8; // -> enum ImGuiSortDirection // Enum: A sorting direction (ascending or descending)
typedef int ImGuiCol; // -> enum ImGuiCol_ // Enum: A color identifier for styling
typedef int ImGuiCond; // -> enum ImGuiCond_ // Enum: A condition for many Set*() functions
typedef int ImGuiDataType; // -> enum ImGuiDataType_ // Enum: A primary data type
-typedef int ImGuiDir; // -> enum ImGuiDir_ // Enum: A cardinal direction
typedef int ImGuiMouseButton; // -> enum ImGuiMouseButton_ // Enum: A mouse button identifier (0=left, 1=right, 2=middle)
typedef int ImGuiMouseCursor; // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor shape
-typedef int ImGuiSortDirection; // -> enum ImGuiSortDirection_ // Enum: A sorting direction (ascending or descending)
typedef int ImGuiStyleVar; // -> enum ImGuiStyleVar_ // Enum: A variable identifier for styling
typedef int ImGuiTableBgTarget; // -> enum ImGuiTableBgTarget_ // Enum: A color target for TableSetBgColor()
-// Flags (declared as int for compatibility with old C++, to allow using as flags without overhead, and to not pollute the top of this file)
+// Flags (declared as int to allow using as flags without overhead, and to not pollute the top of this file)
// - Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists!
-// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
-// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
+// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
+// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments.
+// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments.
typedef int ImDrawFlags; // -> enum ImDrawFlags_ // Flags: for ImDrawList functions
typedef int ImDrawListFlags; // -> enum ImDrawListFlags_ // Flags: for ImDrawList instance
typedef int ImFontAtlasFlags; // -> enum ImFontAtlasFlags_ // Flags: for ImFontAtlas build
typedef int ImGuiBackendFlags; // -> enum ImGuiBackendFlags_ // Flags: for io.BackendFlags
typedef int ImGuiButtonFlags; // -> enum ImGuiButtonFlags_ // Flags: for InvisibleButton()
+typedef int ImGuiChildFlags; // -> enum ImGuiChildFlags_ // Flags: for BeginChild()
typedef int ImGuiColorEditFlags; // -> enum ImGuiColorEditFlags_ // Flags: for ColorEdit4(), ColorPicker4() etc.
typedef int ImGuiConfigFlags; // -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags
typedef int ImGuiComboFlags; // -> enum ImGuiComboFlags_ // Flags: for BeginCombo()
typedef int ImGuiDragDropFlags; // -> enum ImGuiDragDropFlags_ // Flags: for BeginDragDropSource(), AcceptDragDropPayload()
typedef int ImGuiFocusedFlags; // -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused()
typedef int ImGuiHoveredFlags; // -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
+typedef int ImGuiInputFlags; // -> enum ImGuiInputFlags_ // Flags: for Shortcut(), SetNextItemShortcut()
typedef int ImGuiInputTextFlags; // -> enum ImGuiInputTextFlags_ // Flags: for InputText(), InputTextMultiline()
-typedef int ImGuiKeyChord; // -> ImGuiKey | ImGuiMod_XXX // Flags: for storage only for now: an ImGuiKey optionally OR-ed with one or more ImGuiMod_XXX values.
+typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag(), shared by all items
+typedef int ImGuiKeyChord; // -> ImGuiKey | ImGuiMod_XXX // Flags: for IsKeyChordPressed(), Shortcut() etc. an ImGuiKey optionally OR-ed with one or more ImGuiMod_XXX values.
typedef int ImGuiPopupFlags; // -> enum ImGuiPopupFlags_ // Flags: for OpenPopup*(), BeginPopupContext*(), IsPopupOpen()
+typedef int ImGuiMultiSelectFlags; // -> enum ImGuiMultiSelectFlags_// Flags: for BeginMultiSelect()
typedef int ImGuiSelectableFlags; // -> enum ImGuiSelectableFlags_ // Flags: for Selectable()
typedef int ImGuiSliderFlags; // -> enum ImGuiSliderFlags_ // Flags: for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
typedef int ImGuiTabBarFlags; // -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar()
@@ -206,41 +251,21 @@ typedef int ImGuiTreeNodeFlags; // -> enum ImGuiTreeNodeFlags_ // Flags: f
typedef int ImGuiViewportFlags; // -> enum ImGuiViewportFlags_ // Flags: for ImGuiViewport
typedef int ImGuiWindowFlags; // -> enum ImGuiWindowFlags_ // Flags: for Begin(), BeginChild()
-// ImTexture: user data for renderer backend to identify a texture [Compile-time configurable type]
-// - To use something else than an opaque void* pointer: override with e.g. '#define ImTextureID MyTextureType*' in your imconfig.h file.
-// - This can be whatever to you want it to be! read the FAQ about ImTextureID for details.
-#ifndef ImTextureID
-typedef void* ImTextureID; // Default: store a pointer or an integer fitting in a pointer (most renderer backends are ok with that)
-#endif
-
-// ImDrawIdx: vertex index. [Compile-time configurable type]
-// - To use 16-bit indices + allow large meshes: backend need to set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset (recommended).
-// - To use 32-bit indices: override with '#define ImDrawIdx unsigned int' in your imconfig.h file.
-#ifndef ImDrawIdx
-typedef unsigned short ImDrawIdx; // Default: 16-bit (for maximum compatibility with renderer backends)
-#endif
-
-// Scalar data types
-typedef unsigned int ImGuiID;// A unique ID used by widgets (typically the result of hashing a stack of string)
-typedef signed char ImS8; // 8-bit signed integer
-typedef unsigned char ImU8; // 8-bit unsigned integer
-typedef signed short ImS16; // 16-bit signed integer
-typedef unsigned short ImU16; // 16-bit unsigned integer
-typedef signed int ImS32; // 32-bit signed integer == int
-typedef unsigned int ImU32; // 32-bit unsigned integer (often used to store packed colors)
-typedef signed long long ImS64; // 64-bit signed integer
-typedef unsigned long long ImU64; // 64-bit unsigned integer
-
// Character types
// (we generally use UTF-8 encoded string in the API. This is storage specifically for a decoded character used for keyboard input and display)
-typedef unsigned short ImWchar16; // A single decoded U16 character/code point. We encode them as multi bytes UTF-8 when used in strings.
typedef unsigned int ImWchar32; // A single decoded U32 character/code point. We encode them as multi bytes UTF-8 when used in strings.
+typedef unsigned short ImWchar16; // A single decoded U16 character/code point. We encode them as multi bytes UTF-8 when used in strings.
#ifdef IMGUI_USE_WCHAR32 // ImWchar [configurable type: override in imconfig.h with '#define IMGUI_USE_WCHAR32' to support Unicode planes 1-16]
typedef ImWchar32 ImWchar;
#else
typedef ImWchar16 ImWchar;
#endif
+// Multi-Selection item index or identifier when using BeginMultiSelect()
+// - Used by SetNextItemSelectionUserData() + and inside ImGuiMultiSelectIO structure.
+// - Most users are likely to use this store an item INDEX but this may be used to store a POINTER/ID as well. Read comments near ImGuiMultiSelectIO for details.
+typedef ImS64 ImGuiSelectionUserData;
+
// Callback and functions types
typedef int (*ImGuiInputTextCallback)(ImGuiInputTextCallbackData* data); // Callback function for ImGui::InputText()
typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data); // Callback function for ImGui::SetNextWindowSizeConstraints()
@@ -248,15 +273,16 @@ typedef void* (*ImGuiMemAllocFunc)(size_t sz, void* user_data);
typedef void (*ImGuiMemFreeFunc)(void* ptr, void* user_data); // Function signature for ImGui::SetAllocatorFunctions()
// ImVec2: 2D vector used to store positions, sizes etc. [Compile-time configurable type]
-// This is a frequently used type in the API. Consider using IM_VEC2_CLASS_EXTRA to create implicit cast from/to our preferred type.
+// - This is a frequently used type in the API. Consider using IM_VEC2_CLASS_EXTRA to create implicit cast from/to our preferred type.
+// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4.
IM_MSVC_RUNTIME_CHECKS_OFF
struct ImVec2
{
float x, y;
constexpr ImVec2() : x(0.0f), y(0.0f) { }
constexpr ImVec2(float _x, float _y) : x(_x), y(_y) { }
- float operator[] (size_t idx) const { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine.
- float& operator[] (size_t idx) { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine.
+ float& operator[] (size_t idx) { IM_ASSERT(idx == 0 || idx == 1); return ((float*)(void*)(char*)this)[idx]; } // We very rarely use this [] operator, so the assert overhead is fine.
+ float operator[] (size_t idx) const { IM_ASSERT(idx == 0 || idx == 1); return ((const float*)(const void*)(const char*)this)[idx]; }
#ifdef IM_VEC2_CLASS_EXTRA
IM_VEC2_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec2.
#endif
@@ -275,6 +301,19 @@ struct ImVec4
IM_MSVC_RUNTIME_CHECKS_RESTORE
//-----------------------------------------------------------------------------
+// [SECTION] Texture identifier (ImTextureID)
+//-----------------------------------------------------------------------------
+
+// ImTexture: user data for renderer backend to identify a texture [Compile-time configurable type]
+// - To use something else than an opaque void* pointer: override with e.g. '#define ImTextureID MyTextureType*' in your imconfig.h file.
+// - This can be whatever to you want it to be! read the FAQ about ImTextureID for details.
+// - You can make this a structure with various constructors if you need. You will have to implement ==/!= operators.
+// - (note: before v1.91.4 (2024/10/08) the default type for ImTextureID was void*. Use intermediary intptr_t cast and read FAQ if you have casting warnings)
+#ifndef ImTextureID
+typedef ImU64 ImTextureID; // Default: store a pointer or an integer fitting in a pointer (most renderer backends are ok with that)
+#endif
+
+//-----------------------------------------------------------------------------
// [SECTION] Dear ImGui end-user API functions
// (Note that ImGui:: being a namespace, you can add extra ImGui:: functions in your own separate file. Please don't modify imgui source files!)
//-----------------------------------------------------------------------------
@@ -291,8 +330,9 @@ namespace ImGui
IMGUI_API void SetCurrentContext(ImGuiContext* ctx);
// Main
- IMGUI_API ImGuiIO& GetIO(); // access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)
- IMGUI_API ImGuiStyle& GetStyle(); // access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame!
+ IMGUI_API ImGuiIO& GetIO(); // access the ImGuiIO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)
+ IMGUI_API ImGuiPlatformIO& GetPlatformIO(); // access the ImGuiPlatformIO structure (mostly hooks/functions to connect to platform/renderer and OS Clipboard, IME etc.)
+ IMGUI_API ImGuiStyle& GetStyle(); // access the Style structure (colors, sizes). Always use PushStyleColor(), PushStyleVar() to modify style mid-frame!
IMGUI_API void NewFrame(); // start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().
IMGUI_API void EndFrame(); // ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all!
IMGUI_API void Render(); // ends the Dear ImGui frame, finalize the draw data. You can then get call GetDrawData().
@@ -302,7 +342,7 @@ namespace ImGui
IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!
IMGUI_API void ShowMetricsWindow(bool* p_open = NULL); // create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.
IMGUI_API void ShowDebugLogWindow(bool* p_open = NULL); // create Debug Log window. display a simplified log of important dear imgui events.
- IMGUI_API void ShowStackToolWindow(bool* p_open = NULL); // create Stack Tool window. hover items with mouse to query information about the source of their unique ID.
+ IMGUI_API void ShowIDStackToolWindow(bool* p_open = NULL); // create Stack Tool window. hover items with mouse to query information about the source of their unique ID.
IMGUI_API void ShowAboutWindow(bool* p_open = NULL); // create About window. display Dear ImGui version, credits and build/system information.
IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)
IMGUI_API bool ShowStyleSelector(const char* label); // add style selector block (not a window), essentially a combo listing the default styles.
@@ -323,23 +363,33 @@ namespace ImGui
// Some information such as 'flags' or 'p_open' will only be considered by the first call to Begin().
// - Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting
// anything to the window. Always call a matching End() for each Begin() call, regardless of its return value!
- // [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu,
- // BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function
- // returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
+ // [Important: due to legacy reason, Begin/End and BeginChild/EndChild are inconsistent with all other functions
+ // such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding
+ // BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
// - Note that the bottom of window stack always contains a window called "Debug".
IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0);
IMGUI_API void End();
// Child Windows
// - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child.
- // - For each independent axis of 'size': ==0.0f: use remaining host window size / >0.0f: fixed size / <0.0f: use remaining window size minus abs(size) / Each axis can use a different mode, e.g. ImVec2(0,400).
- // - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window.
- // Always call a matching EndChild() for each BeginChild() call, regardless of its return value.
- // [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu,
- // BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function
- // returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
- IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0, 0), bool border = false, ImGuiWindowFlags flags = 0);
- IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0, 0), bool border = false, ImGuiWindowFlags flags = 0);
+ // - Before 1.90 (November 2023), the "ImGuiChildFlags child_flags = 0" parameter was "bool border = false".
+ // This API is backward compatible with old code, as we guarantee that ImGuiChildFlags_Borders == true.
+ // Consider updating your old code:
+ // BeginChild("Name", size, false) -> Begin("Name", size, 0); or Begin("Name", size, ImGuiChildFlags_None);
+ // BeginChild("Name", size, true) -> Begin("Name", size, ImGuiChildFlags_Borders);
+ // - Manual sizing (each axis can use a different setting e.g. ImVec2(0.0f, 400.0f)):
+ // == 0.0f: use remaining parent window size for this axis.
+ // > 0.0f: use specified size for this axis.
+ // < 0.0f: right/bottom-align to specified distance from available content boundaries.
+ // - Specifying ImGuiChildFlags_AutoResizeX or ImGuiChildFlags_AutoResizeY makes the sizing automatic based on child contents.
+ // Combining both ImGuiChildFlags_AutoResizeX _and_ ImGuiChildFlags_AutoResizeY defeats purpose of a scrolling region and is NOT recommended.
+ // - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting
+ // anything to the window. Always call a matching EndChild() for each BeginChild() call, regardless of its return value.
+ // [Important: due to legacy reason, Begin/End and BeginChild/EndChild are inconsistent with all other functions
+ // such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding
+ // BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
+ IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0, 0), ImGuiChildFlags child_flags = 0, ImGuiWindowFlags window_flags = 0);
+ IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0, 0), ImGuiChildFlags child_flags = 0, ImGuiWindowFlags window_flags = 0);
IMGUI_API void EndChild();
// Windows Utilities
@@ -347,18 +397,18 @@ namespace ImGui
IMGUI_API bool IsWindowAppearing();
IMGUI_API bool IsWindowCollapsed();
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0); // is current window focused? or its root/child, depending on flags. see flags for options.
- IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0); // is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ!
+ IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0); // is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See ImGuiHoveredFlags_ for options. IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app, you should not use this function! Use the 'io.WantCaptureMouse' boolean for that! Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details.
IMGUI_API ImDrawList* GetWindowDrawList(); // get draw list associated to the current window, to append your own drawing primitives
- IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (useful if you want to do your own drawing via the DrawList API)
- IMGUI_API ImVec2 GetWindowSize(); // get current window size
- IMGUI_API float GetWindowWidth(); // get current window width (shortcut for GetWindowSize().x)
- IMGUI_API float GetWindowHeight(); // get current window height (shortcut for GetWindowSize().y)
+ IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)
+ IMGUI_API ImVec2 GetWindowSize(); // get current window size (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)
+ IMGUI_API float GetWindowWidth(); // get current window width (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().x.
+ IMGUI_API float GetWindowHeight(); // get current window height (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().y.
// Window manipulation
// - Prefer using SetNextXXX functions (before Begin) rather that SetXXX functions (after Begin).
IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2(0, 0)); // set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.
IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
- IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down. Use callback to apply non-trivial programmatic constraints.
+ IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use 0.0f or FLT_MAX if you don't want limits. Use -1 for both min and max of same axis to preserve current size (which itself is a constraint). Use callback to apply non-trivial programmatic constraints.
IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before Begin()
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin()
IMGUI_API void SetNextWindowFocus(); // set next window to be focused / top-most. call before Begin()
@@ -374,14 +424,6 @@ namespace ImGui
IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond = 0); // set named window collapsed state
IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / top-most. use NULL to remove focus.
- // Content region
- // - Retrieve available space from a given point. GetContentRegionAvail() is frequently useful.
- // - Those functions are bound to be redesigned (they are confusing, incomplete and the Min/Max return values are in local window coordinates which increases confusion)
- IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos()
- IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
- IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min for the full window (roughly (0,0)-Scroll), in window coordinates
- IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be overridden with SetNextWindowContentSize(), in window coordinates
-
// Windows Scrolling
// - Any change of Scroll will be applied at the beginning of next frame in the first call to Begin().
// - You may instead use SetNextWindowScroll() prior to calling Begin() to avoid this delay, as an alternative to using SetScrollX()/SetScrollY().
@@ -402,13 +444,13 @@ namespace ImGui
IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col); // modify a style color. always use this if you modify the style after NewFrame().
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4& col);
IMGUI_API void PopStyleColor(int count = 1);
- IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); // modify a style float variable. always use this if you modify the style after NewFrame().
- IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); // modify a style ImVec2 variable. always use this if you modify the style after NewFrame().
+ IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); // modify a style float variable. always use this if you modify the style after NewFrame()!
+ IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); // modify a style ImVec2 variable. "
+ IMGUI_API void PushStyleVarX(ImGuiStyleVar idx, float val_x); // modify X component of a style ImVec2 variable. "
+ IMGUI_API void PushStyleVarY(ImGuiStyleVar idx, float val_y); // modify Y component of a style ImVec2 variable. "
IMGUI_API void PopStyleVar(int count = 1);
- IMGUI_API void PushAllowKeyboardFocus(bool allow_keyboard_focus); // == tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
- IMGUI_API void PopAllowKeyboardFocus();
- IMGUI_API void PushButtonRepeat(bool repeat); // in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.
- IMGUI_API void PopButtonRepeat();
+ IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); // modify specified shared item flag, e.g. PushItemFlag(ImGuiItemFlags_NoTabStop, true)
+ IMGUI_API void PopItemFlag();
// Parameters stacks (current window)
IMGUI_API void PushItemWidth(float item_width); // push width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side).
@@ -419,22 +461,37 @@ namespace ImGui
IMGUI_API void PopTextWrapPos();
// Style read access
- // - Use the style editor (ShowStyleEditor() function) to interactively see what the colors are)
+ // - Use the ShowStyleEditor() function to interactively see/edit the colors.
IMGUI_API ImFont* GetFont(); // get current font
IMGUI_API float GetFontSize(); // get current font size (= height in pixels) of current font with current scale applied
- IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API
+ IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a white pixel, useful to draw custom shapes via the ImDrawList API
IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f); // retrieve given style color with style alpha applied and optional extra alpha multiplier, packed as a 32-bit value suitable for ImDrawList
IMGUI_API ImU32 GetColorU32(const ImVec4& col); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
- IMGUI_API ImU32 GetColorU32(ImU32 col); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
+ IMGUI_API ImU32 GetColorU32(ImU32 col, float alpha_mul = 1.0f); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
IMGUI_API const ImVec4& GetStyleColorVec4(ImGuiCol idx); // retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwise use GetColorU32() to get style color with style alpha baked in.
- // Cursor / Layout
+ // Layout cursor positioning
// - By "cursor" we mean the current output position.
// - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down.
// - You can call SameLine() between widgets to undo the last carriage return and output at the right of the preceding widget.
+ // - YOU CAN DO 99% OF WHAT YOU NEED WITH ONLY GetCursorScreenPos() and GetContentRegionAvail().
// - Attention! We currently have inconsistencies between window-local and absolute positions we will aim to fix with future API:
- // Window-local coordinates: SameLine(), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), GetContentRegionMax(), GetWindowContentRegion*(), PushTextWrapPos()
- // Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions.
+ // - Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. -> this is the preferred way forward.
+ // - Window-local coordinates: SameLine(offset), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), PushTextWrapPos()
+ // - Window-local coordinates: GetContentRegionMax(), GetWindowContentRegionMin(), GetWindowContentRegionMax() --> all obsoleted. YOU DON'T NEED THEM.
+ // - GetCursorScreenPos() = GetCursorPos() + GetWindowPos(). GetWindowPos() is almost only ever useful to convert from window-local to absolute coordinates. Try not to use it.
+ IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND (prefer using this rather than GetCursorPos(), also more useful to work with ImDrawList API).
+ IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND.
+ IMGUI_API ImVec2 GetContentRegionAvail(); // available space from current position. THIS IS YOUR BEST FRIEND.
+ IMGUI_API ImVec2 GetCursorPos(); // [window-local] cursor position in window-local coordinates. This is not your best friend.
+ IMGUI_API float GetCursorPosX(); // [window-local] "
+ IMGUI_API float GetCursorPosY(); // [window-local] "
+ IMGUI_API void SetCursorPos(const ImVec2& local_pos); // [window-local] "
+ IMGUI_API void SetCursorPosX(float local_x); // [window-local] "
+ IMGUI_API void SetCursorPosY(float local_y); // [window-local] "
+ IMGUI_API ImVec2 GetCursorStartPos(); // [window-local] initial cursor position, in window-local coordinates. Call GetCursorScreenPos() after Begin() to get the absolute coordinates version.
+
+ // Other layout functions
IMGUI_API void Separator(); // separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f); // call between widgets or groups to layout them horizontally. X position given in window coordinates.
IMGUI_API void NewLine(); // undo a SameLine() or force a new line when in a horizontal-layout context.
@@ -444,15 +501,6 @@ namespace ImGui
IMGUI_API void Unindent(float indent_w = 0.0f); // move content position back to the left, by indent_w, or style.IndentSpacing if indent_w <= 0
IMGUI_API void BeginGroup(); // lock horizontal starting position
IMGUI_API void EndGroup(); // unlock horizontal starting position + capture the whole group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)
- IMGUI_API ImVec2 GetCursorPos(); // cursor position in window coordinates (relative to window position)
- IMGUI_API float GetCursorPosX(); // (some functions are using window-relative coordinates, such as: GetCursorPos, GetCursorStartPos, GetContentRegionMax, GetWindowContentRegion* etc.
- IMGUI_API float GetCursorPosY(); // other functions such as GetCursorScreenPos or everything in ImDrawList::
- IMGUI_API void SetCursorPos(const ImVec2& local_pos); // are using the main, absolute coordinate system.
- IMGUI_API void SetCursorPosX(float local_x); // GetWindowPos() + GetCursorPos() == GetCursorScreenPos() etc.)
- IMGUI_API void SetCursorPosY(float local_y); //
- IMGUI_API ImVec2 GetCursorStartPos(); // initial cursor position in window coordinates
- IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position in absolute coordinates (useful to work with ImDrawList API). generally top-left == GetMainViewport()->Pos == (0,0) in single viewport mode, and bottom-right == GetMainViewport()->Pos+Size == io.DisplaySize in single-viewport mode.
- IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position in absolute coordinates
IMGUI_API void AlignTextToFramePadding(); // vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item)
IMGUI_API float GetTextLineHeight(); // ~ FontSize
IMGUI_API float GetTextLineHeightWithSpacing(); // ~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)
@@ -460,7 +508,7 @@ namespace ImGui
IMGUI_API float GetFrameHeightWithSpacing(); // ~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)
// ID stack/scopes
- // Read the FAQ (docs/FAQ.md or http://dearimgui.org/faq) for more details about how ID are handled in dear imgui.
+ // Read the FAQ (docs/FAQ.md or http://dearimgui.com/faq) for more details about how ID are handled in dear imgui.
// - Those questions are answered and impacted by understanding of the ID stack system:
// - "Q: Why is my widget not reacting when I click on it?"
// - "Q: How can I have widgets with an empty label?"
@@ -478,6 +526,7 @@ namespace ImGui
IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself
IMGUI_API ImGuiID GetID(const char* str_id_begin, const char* str_id_end);
IMGUI_API ImGuiID GetID(const void* ptr_id);
+ IMGUI_API ImGuiID GetID(int int_id);
// Widgets: Text
IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text.
@@ -493,12 +542,13 @@ namespace ImGui
IMGUI_API void LabelTextV(const char* label, const char* fmt, va_list args) IM_FMTLIST(2);
IMGUI_API void BulletText(const char* fmt, ...) IM_FMTARGS(1); // shortcut for Bullet()+Text()
IMGUI_API void BulletTextV(const char* fmt, va_list args) IM_FMTLIST(1);
+ IMGUI_API void SeparatorText(const char* label); // currently: formatted text with a horizontal line
// Widgets: Main
// - Most widgets return true when the value has been changed or when pressed/selected
// - You may also use one of the many IsItemXXX functions (e.g. IsItemActive, IsItemHovered, etc.) to query widget state.
IMGUI_API bool Button(const char* label, const ImVec2& size = ImVec2(0, 0)); // button
- IMGUI_API bool SmallButton(const char* label); // button with FramePadding=(0,0) to easily embed within text
+ IMGUI_API bool SmallButton(const char* label); // button with (FramePadding.y == 0) to easily embed within text
IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size, ImGuiButtonFlags flags = 0); // flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)
IMGUI_API bool ArrowButton(const char* str_id, ImGuiDir dir); // square button with an arrow shape
IMGUI_API bool Checkbox(const char* label, bool* v);
@@ -508,11 +558,17 @@ namespace ImGui
IMGUI_API bool RadioButton(const char* label, int* v, int v_button); // shortcut to handle the above pattern when value is an integer
IMGUI_API void ProgressBar(float fraction, const ImVec2& size_arg = ImVec2(-FLT_MIN, 0), const char* overlay = NULL);
IMGUI_API void Bullet(); // draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
+ IMGUI_API bool TextLink(const char* label); // hyperlink text button, return true when clicked
+ IMGUI_API void TextLinkOpenURL(const char* label, const char* url = NULL); // hyperlink text button, automatically open file/url when clicked
// Widgets: Images
// - Read about ImTextureID here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
- IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& tint_col = ImVec4(1, 1, 1, 1), const ImVec4& border_col = ImVec4(0, 0, 0, 0));
- IMGUI_API bool ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1));
+ // - 'uv0' and 'uv1' are texture coordinates. Read about them from the same link above.
+ // - Image() pads adds style.ImageBorderSize on each side, ImageButton() adds style.FramePadding on each side.
+ // - ImageButton() draws a background based on regular Button() color + optionally an inner background if specified.
+ IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1));
+ IMGUI_API void ImageWithBg(ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1));
+ IMGUI_API bool ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1));
// Widgets: Combo Box (Dropdown)
// - The BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() items.
@@ -521,7 +577,7 @@ namespace ImGui
IMGUI_API void EndCombo(); // only call EndCombo() if BeginCombo() returns true!
IMGUI_API bool Combo(const char* label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1);
IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1); // Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0"
- IMGUI_API bool Combo(const char* label, int* current_item, bool(*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_max_height_in_items = -1);
+ IMGUI_API bool Combo(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int popup_max_height_in_items = -1);
// Widgets: Drag Sliders
// - CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped by default and can go off-bounds. Use ImGuiSliderFlags_AlwaysClamp to always clamp.
@@ -529,7 +585,7 @@ namespace ImGui
// the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x
// - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
// - Format string may also be set to NULL or use the default format ("%f" or "%d").
- // - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision).
+ // - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For keyboard/gamepad navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision).
// - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits if ImGuiSliderFlags_AlwaysClamp is not used.
// - Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum.
// - We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them.
@@ -609,13 +665,14 @@ namespace ImGui
IMGUI_API bool TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_FMTARGS(3);
IMGUI_API bool TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3);
IMGUI_API bool TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3);
- IMGUI_API void TreePush(const char* str_id); // ~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired.
+ IMGUI_API void TreePush(const char* str_id); // ~ Indent()+PushID(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired.
IMGUI_API void TreePush(const void* ptr_id); // "
- IMGUI_API void TreePop(); // ~ Unindent()+PopId()
+ IMGUI_API void TreePop(); // ~ Unindent()+PopID()
IMGUI_API float GetTreeNodeToLabelSpacing(); // horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode
IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop().
IMGUI_API bool CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFlags flags = 0); // when 'p_visible != NULL': if '*p_visible==true' display an additional small close button on upper right of the header which will set the bool to false when clicked, if '*p_visible==false' don't display the header.
IMGUI_API void SetNextItemOpen(bool is_open, ImGuiCond cond = 0); // set next TreeNode/CollapsingHeader open state.
+ IMGUI_API void SetNextItemStorageID(ImGuiID storage_id); // set id to use for open/close storage (default to same as item id).
// Widgets: Selectables
// - A selectable highlights when hovered, and can display another color when selected.
@@ -623,23 +680,36 @@ namespace ImGui
IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // "bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // "bool* p_selected" point to the selection state (read-write), as a convenient helper.
+ // Multi-selection system for Selectable(), Checkbox(), TreeNode() functions [BETA]
+ // - This enables standard multi-selection/range-selection idioms (CTRL+Mouse/Keyboard, SHIFT+Mouse/Keyboard, etc.) in a way that also allow a clipper to be used.
+ // - ImGuiSelectionUserData is often used to store your item index within the current view (but may store something else).
+ // - Read comments near ImGuiMultiSelectIO for instructions/details and see 'Demo->Widgets->Selection State & Multi-Select' for demo.
+ // - TreeNode() is technically supported but... using this correctly is more complicated. You need some sort of linear/random access to your tree,
+ // which is suited to advanced trees setups already implementing filters and clipper. We will work simplifying the current demo.
+ // - 'selection_size' and 'items_count' parameters are optional and used by a few features. If they are costly for you to compute, you may avoid them.
+ IMGUI_API ImGuiMultiSelectIO* BeginMultiSelect(ImGuiMultiSelectFlags flags, int selection_size = -1, int items_count = -1);
+ IMGUI_API ImGuiMultiSelectIO* EndMultiSelect();
+ IMGUI_API void SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data);
+ IMGUI_API bool IsItemToggledSelection(); // Was the last item selection state toggled? Useful if you need the per-item information _before_ reaching EndMultiSelect(). We only returns toggle _event_ in order to handle clipping correctly.
+
// Widgets: List Boxes
- // - This is essentially a thin wrapper to using BeginChild/EndChild with some stylistic changes.
- // - The BeginListBox()/EndListBox() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() or any items.
+ // - This is essentially a thin wrapper to using BeginChild/EndChild with the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label.
+ // - If you don't need a label you can probably simply use BeginChild() with the ImGuiChildFlags_FrameStyle flag for the same result.
+ // - You can submit contents and manage your selection state however you want it, by creating e.g. Selectable() or any other items.
// - The simplified/old ListBox() api are helpers over BeginListBox()/EndListBox() which are kept available for convenience purpose. This is analoguous to how Combos are created.
// - Choose frame width: size.x > 0.0f: custom / size.x < 0.0f or -FLT_MIN: right-align / size.x = 0.0f (default): use current ItemWidth
// - Choose frame height: size.y > 0.0f: custom / size.y < 0.0f or -FLT_MIN: bottom-align / size.y = 0.0f (default): arbitrary default height which can fit ~7 items
IMGUI_API bool BeginListBox(const char* label, const ImVec2& size = ImVec2(0, 0)); // open a framed scrolling region
IMGUI_API void EndListBox(); // only call EndListBox() if BeginListBox() returned true!
IMGUI_API bool ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_in_items = -1);
- IMGUI_API bool ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
+ IMGUI_API bool ListBox(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int height_in_items = -1);
// Widgets: Data Plotting
// - Consider using ImPlot (https://github.com/epezent/implot) which is much better!
IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float));
IMGUI_API void PlotLines(const char* label, float(*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0));
IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float));
- IMGUI_API void PlotHistogram(const char* label, float(*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0));
+ IMGUI_API void PlotHistogram(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0));
// Widgets: Value() Helpers.
// - Those are merely shortcut to calling Text() with a format string. Output single value in "name: value" format (tip: freely declare more in your code to handle your types. you can add functions to the ImGui namespace)
@@ -663,12 +733,22 @@ namespace ImGui
IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true); // return true when activated + toggle (*p_selected) if p_selected != NULL
// Tooltips
- // - Tooltip are windows following the mouse. They do not take focus away.
- IMGUI_API void BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of items).
- IMGUI_API void EndTooltip();
- IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip().
+ // - Tooltips are windows following the mouse. They do not take focus away.
+ // - A tooltip window can contain items of any types.
+ // - SetTooltip() is more or less a shortcut for the 'if (BeginTooltip()) { Text(...); EndTooltip(); }' idiom (with a subtlety that it discard any previously submitted tooltip)
+ IMGUI_API bool BeginTooltip(); // begin/append a tooltip window.
+ IMGUI_API void EndTooltip(); // only call EndTooltip() if BeginTooltip()/BeginItemTooltip() returns true!
+ IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip. Often used after a ImGui::IsItemHovered() check. Override any previous call to SetTooltip().
IMGUI_API void SetTooltipV(const char* fmt, va_list args) IM_FMTLIST(1);
+ // Tooltips: helpers for showing a tooltip when hovering an item
+ // - BeginItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_ForTooltip) && BeginTooltip())' idiom.
+ // - SetItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_ForTooltip)) { SetTooltip(...); }' idiom.
+ // - Where 'ImGuiHoveredFlags_ForTooltip' itself is a shortcut to use 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' depending on active input type. For mouse it defaults to 'ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort'.
+ IMGUI_API bool BeginItemTooltip(); // begin/append a tooltip window if preceding item was hovered.
+ IMGUI_API void SetItemTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip if preceding item was hovered. override any previous call to SetTooltip().
+ IMGUI_API void SetItemTooltipV(const char* fmt, va_list args) IM_FMTLIST(1);
+
// Popups, Modals
// - They block normal mouse hovering detection (and therefore most mouse interactions) behind them.
// - If not modal: they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
@@ -677,9 +757,7 @@ namespace ImGui
// - You can bypass the hovering restriction by using ImGuiHoveredFlags_AllowWhenBlockedByPopup when calling IsItemHovered() or IsWindowHovered().
// - IMPORTANT: Popup identifiers are relative to the current ID stack, so OpenPopup and BeginPopup generally needs to be at the same level of the stack.
// This is sometimes leading to confusing mistakes. May rework this in the future.
-
- // Popups: begin/end functions
- // - BeginPopup(): query popup state, if open start appending into the window. Call EndPopup() afterwards. ImGuiWindowFlags are forwarded to the window.
+ // - BeginPopup(): query popup state, if open start appending into the window. Call EndPopup() afterwards if returned true. ImGuiWindowFlags are forwarded to the window.
// - BeginPopupModal(): block every interaction behind the window, cannot be closed by user, add a dimming background, has a title bar.
IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0); // return true if the popup is open, and you can start outputting to it.
IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // return true if the modal is open, and you can start outputting to it.
@@ -729,14 +807,12 @@ namespace ImGui
// TableNextColumn() will automatically wrap-around into the next row if needed.
// - IMPORTANT: Comparatively to the old Columns() API, we need to call TableNextColumn() for the first column!
// - Summary of possible call flow:
- // --------------------------------------------------------------------------------------------------------
- // TableNextRow() -> TableSetColumnIndex(0) -> Text("Hello 0") -> TableSetColumnIndex(1) -> Text("Hello 1") // OK
- // TableNextRow() -> TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK
- // TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK: TableNextColumn() automatically gets to next row!
- // TableNextRow() -> Text("Hello 0") // Not OK! Missing TableSetColumnIndex() or TableNextColumn()! Text will not appear!
- // --------------------------------------------------------------------------------------------------------
+ // - TableNextRow() -> TableSetColumnIndex(0) -> Text("Hello 0") -> TableSetColumnIndex(1) -> Text("Hello 1") // OK
+ // - TableNextRow() -> TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK
+ // - TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK: TableNextColumn() automatically gets to next row!
+ // - TableNextRow() -> Text("Hello 0") // Not OK! Missing TableSetColumnIndex() or TableNextColumn()! Text will not appear!
// - 5. Call EndTable()
- IMGUI_API bool BeginTable(const char* str_id, int column, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0.0f, 0.0f), float inner_width = 0.0f);
+ IMGUI_API bool BeginTable(const char* str_id, int columns, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0.0f, 0.0f), float inner_width = 0.0f);
IMGUI_API void EndTable(); // only call EndTable() if BeginTable() returns true!
IMGUI_API void TableNextRow(ImGuiTableRowFlags row_flags = 0, float min_row_height = 0.0f); // append into the first cell of a new row.
IMGUI_API bool TableNextColumn(); // append into the next column (or first column of next row if currently in last column). Return true when column is visible.
@@ -752,8 +828,9 @@ namespace ImGui
// - Use TableSetupScrollFreeze() to lock columns/rows so they stay visible when scrolled.
IMGUI_API void TableSetupColumn(const char* label, ImGuiTableColumnFlags flags = 0, float init_width_or_weight = 0.0f, ImGuiID user_id = 0);
IMGUI_API void TableSetupScrollFreeze(int cols, int rows); // lock columns/rows so they stay visible when scrolled.
- IMGUI_API void TableHeadersRow(); // submit all headers cells based on data provided to TableSetupColumn() + submit context menu
IMGUI_API void TableHeader(const char* label); // submit one header cell manually (rarely used)
+ IMGUI_API void TableHeadersRow(); // submit a row with headers cells based on data provided to TableSetupColumn() + submit context menu
+ IMGUI_API void TableAngledHeadersRow(); // submit a row with angled headers for every column with the ImGuiTableColumnFlags_AngledHeader flag. MUST BE FIRST ROW.
// Tables: Sorting & Miscellaneous functions
// - Sorting: call TableGetSortSpecs() to retrieve latest sort specs for the table. NULL when not sorting.
@@ -768,11 +845,12 @@ namespace ImGui
IMGUI_API const char* TableGetColumnName(int column_n = -1); // return "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.
IMGUI_API ImGuiTableColumnFlags TableGetColumnFlags(int column_n = -1); // return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
IMGUI_API void TableSetColumnEnabled(int column_n, bool v);// change user accessible enabled/disabled state of a column. Set to false to hide the column. User can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody)
+ IMGUI_API int TableGetHoveredColumn(); // return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered. Can also use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead.
IMGUI_API void TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n = -1); // change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details.
// Legacy Columns API (prefer using Tables!)
// - You can also use SameLine(pos_x) to mimic simplified columns.
- IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border = true);
+ IMGUI_API void Columns(int count = 1, const char* id = NULL, bool borders = true);
IMGUI_API void NextColumn(); // next column, defaults to current row or next row if the current row is finished
IMGUI_API int GetColumnIndex(); // get current column index
IMGUI_API float GetColumnWidth(int column_index = -1); // get column width (in pixels). pass -1 to use current column
@@ -782,6 +860,7 @@ namespace ImGui
IMGUI_API int GetColumnsCount();
// Tab Bars, Tabs
+ // - Note: Tabs are automatically created by the docking system (when in 'docking' branch). Use this to create tab bars/tabs yourself.
IMGUI_API bool BeginTabBar(const char* str_id, ImGuiTabBarFlags flags = 0); // create and append into a TabBar
IMGUI_API void EndTabBar(); // only call EndTabBar() if BeginTabBar() returns true!
IMGUI_API bool BeginTabItem(const char* label, bool* p_open = NULL, ImGuiTabItemFlags flags = 0); // create a Tab. Returns true if the Tab is selected.
@@ -810,12 +889,13 @@ namespace ImGui
IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()
IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.
IMGUI_API void EndDragDropTarget(); // only call EndDragDropTarget() if BeginDragDropTarget() returns true!
- IMGUI_API const ImGuiPayload* GetDragDropPayload(); // peek directly into the current payload from anywhere. may return NULL. use ImGuiPayload::IsDataType() to test for the payload type.
+ IMGUI_API const ImGuiPayload* GetDragDropPayload(); // peek directly into the current payload from anywhere. returns NULL when drag and drop is finished or inactive. use ImGuiPayload::IsDataType() to test for the payload type.
// Disabling [BETA API]
// - Disable all user interactions and dim items visuals (applying style.DisabledAlpha over current colors)
// - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled)
- // - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(False)/EndDisabled() best to avoid it.
+ // - Tooltips windows by exception are opted out of disabling.
+ // - BeginDisabled(false)/EndDisabled() essentially does nothing but is provided to facilitate use of boolean expressions (as a micro-optimization: if you have tens of thousands of BeginDisabled(false)/EndDisabled() pairs, you might want to reformulate your code to avoid making those calls)
IMGUI_API void BeginDisabled(bool disabled = true);
IMGUI_API void EndDisabled();
@@ -825,10 +905,15 @@ namespace ImGui
IMGUI_API void PopClipRect();
// Focus, Activation
- // - Prefer using "SetItemDefaultFocus()" over "if (IsWindowAppearing()) SetScrollHereY()" when applicable to signify "this is the default item"
- IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a window.
+ IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a newly appearing window.
IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
+ // Keyboard/Gamepad Navigation
+ IMGUI_API void SetNavCursorVisible(bool visible); // alter visibility of keyboard/gamepad cursor. by default: show when using an arrow key, hide when clicking with mouse.
+
+ // Overlapping mode
+ IMGUI_API void SetNextItemAllowOverlap(); // allow next item to be overlapped by a subsequent item. Useful with invisible buttons, selectable, treenode covering an area where subsequent items may need to be added. Note that both Selectable() and TreeNode() have dedicated flags doing this.
+
// Item/Widgets Utilities and Query Functions
// - Most of the functions are referring to the previous Item that has been submitted.
// - See Demo Window under "Widgets->Querying Status" for an interactive visualization of most of those functions.
@@ -845,10 +930,10 @@ namespace ImGui
IMGUI_API bool IsAnyItemHovered(); // is any item hovered?
IMGUI_API bool IsAnyItemActive(); // is any item active?
IMGUI_API bool IsAnyItemFocused(); // is any item focused?
+ IMGUI_API ImGuiID GetItemID(); // get ID of last item (~~ often same ImGui::GetID(label) beforehand)
IMGUI_API ImVec2 GetItemRectMin(); // get upper-left bounding rectangle of the last item (screen space)
IMGUI_API ImVec2 GetItemRectMax(); // get lower-right bounding rectangle of the last item (screen space)
IMGUI_API ImVec2 GetItemRectSize(); // get size of last item
- IMGUI_API void SetItemAllowOverlap(); // allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.
// Viewports
// - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
@@ -869,8 +954,6 @@ namespace ImGui
IMGUI_API const char* GetStyleColorName(ImGuiCol idx); // get a string corresponding to the enum value (for display, saving, etc.).
IMGUI_API void SetStateStorage(ImGuiStorage* storage); // replace current window storage with our own (if you want to manipulate it yourself, typically clear subsection of it)
IMGUI_API ImGuiStorage* GetStateStorage();
- IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame
- IMGUI_API void EndChildFrame(); // always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window)
// Text Utilities
IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
@@ -881,19 +964,44 @@ namespace ImGui
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v);
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
- // Inputs Utilities: Keyboard
- // Without IMGUI_DISABLE_OBSOLETE_KEYIO: (legacy support)
- // - For 'ImGuiKey key' you can still use your legacy native/user indices according to how your backend/engine stored them in io.KeysDown[].
- // With IMGUI_DISABLE_OBSOLETE_KEYIO: (this is the way forward)
- // - Any use of 'ImGuiKey' will assert when key < 512 will be passed, previously reserved as native/user keys indices
- // - GetKeyIndex() is pass-through and therefore deprecated (gone if IMGUI_DISABLE_OBSOLETE_KEYIO is defined)
+ // Inputs Utilities: Keyboard/Mouse/Gamepad
+ // - the ImGuiKey enum contains all possible keyboard, mouse and gamepad inputs (e.g. ImGuiKey_A, ImGuiKey_MouseLeft, ImGuiKey_GamepadDpadUp...).
+ // - (legacy: before v1.87, we used ImGuiKey to carry native/user indices as defined by each backends. This was obsoleted in 1.87 (2022-02) and completely removed in 1.91.5 (2024-11). See https://github.com/ocornut/imgui/issues/4921)
+ // - (legacy: any use of ImGuiKey will assert when key < 512 to detect passing legacy native/user indices)
IMGUI_API bool IsKeyDown(ImGuiKey key); // is key being held.
IMGUI_API bool IsKeyPressed(ImGuiKey key, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
IMGUI_API bool IsKeyReleased(ImGuiKey key); // was key released (went from Down to !Down)?
+ IMGUI_API bool IsKeyChordPressed(ImGuiKeyChord key_chord); // was key chord (mods + key) pressed, e.g. you can pass 'ImGuiMod_Ctrl | ImGuiKey_S' as a key-chord. This doesn't do any routing or focus check, please consider using Shortcut() function instead.
IMGUI_API int GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
- IMGUI_API const char* GetKeyName(ImGuiKey key); // [DEBUG] returns English name of the key. Those names a provided for debugging purpose and are not meant to be saved persistently not compared.
+ IMGUI_API const char* GetKeyName(ImGuiKey key); // [DEBUG] returns English name of the key. Those names are provided for debugging purpose and are not meant to be saved persistently nor compared.
IMGUI_API void SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard); // Override io.WantCaptureKeyboard flag next frame (said flag is left for your application to handle, typically when true it instructs your app to ignore inputs). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard"; after the next NewFrame() call.
+ // Inputs Utilities: Shortcut Testing & Routing [BETA]
+ // - ImGuiKeyChord = a ImGuiKey + optional ImGuiMod_Alt/ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Super.
+ // ImGuiKey_C // Accepted by functions taking ImGuiKey or ImGuiKeyChord arguments)
+ // ImGuiMod_Ctrl | ImGuiKey_C // Accepted by functions taking ImGuiKeyChord arguments)
+ // only ImGuiMod_XXX values are legal to combine with an ImGuiKey. You CANNOT combine two ImGuiKey values.
+ // - The general idea is that several callers may register interest in a shortcut, and only one owner gets it.
+ // Parent -> call Shortcut(Ctrl+S) // When Parent is focused, Parent gets the shortcut.
+ // Child1 -> call Shortcut(Ctrl+S) // When Child1 is focused, Child1 gets the shortcut (Child1 overrides Parent shortcuts)
+ // Child2 -> no call // When Child2 is focused, Parent gets the shortcut.
+ // The whole system is order independent, so if Child1 makes its calls before Parent, results will be identical.
+ // This is an important property as it facilitate working with foreign code or larger codebase.
+ // - To understand the difference:
+ // - IsKeyChordPressed() compares mods and call IsKeyPressed() -> function has no side-effect.
+ // - Shortcut() submits a route, routes are resolved, if it currently can be routed it calls IsKeyChordPressed() -> function has (desirable) side-effects as it can prevents another call from getting the route.
+ // - Visualize registered routes in 'Metrics/Debugger->Inputs'.
+ IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0);
+ IMGUI_API void SetNextItemShortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0);
+
+ // Inputs Utilities: Key/Input Ownership [BETA]
+ // - One common use case would be to allow your items to disable standard inputs behaviors such
+ // as Tab or Alt key handling, Mouse Wheel scrolling, etc.
+ // e.g. Button(...); SetItemKeyOwner(ImGuiKey_MouseWheelY); to make hovering/activating a button disable wheel for scrolling.
+ // - Reminder ImGuiKey enum include access to mouse buttons and gamepad, so key ownership can apply to them.
+ // - Many related features are still in imgui_internal.h. For instance, most IsKeyXXX()/IsMouseXXX() functions have an owner-id-aware version.
+ IMGUI_API void SetItemKeyOwner(ImGuiKey key); // Set key owner to last item ID if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
+
// Inputs Utilities: Mouse
// - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right.
// - You can also use regular integer: it is forever guaranteed that 0=Left, 1=Right, 2=Middle.
@@ -902,14 +1010,15 @@ namespace ImGui
IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat = false); // did mouse button clicked? (went from !Down to Down). Same as GetMouseClickedCount() == 1.
IMGUI_API bool IsMouseReleased(ImGuiMouseButton button); // did mouse button released? (went from Down to !Down)
IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button); // did mouse button double-clicked? Same as GetMouseClickedCount() == 2. (note that a double-click will also report IsMouseClicked() == true)
+ IMGUI_API bool IsMouseReleasedWithDelay(ImGuiMouseButton button, float delay); // delayed mouse release (use very sparingly!). Generally used with 'delay >= io.MouseDoubleClickTime' + combined with a 'io.MouseClickedLastCount==1' test. This is a very rarely used UI idiom, but some apps use this: e.g. MS Explorer single click on an icon to rename.
IMGUI_API int GetMouseClickedCount(ImGuiMouseButton button); // return the number of successive mouse-clicks at the time where a click happen (otherwise 0).
IMGUI_API bool IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true);// is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
IMGUI_API bool IsMousePosValid(const ImVec2* mouse_pos = NULL); // by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available
IMGUI_API bool IsAnyMouseDown(); // [WILL OBSOLETE] is any mouse button held? This was designed for backends, but prefer having backend maintain a mask of held mouse buttons, because upcoming input queue system will make this invalid.
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to avoid user backing that value themselves)
- IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f); // is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
- IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f); // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
+ IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f); // is mouse dragging? (uses io.MouseDraggingThreshold if lock_threshold < 0.0f)
+ IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f); // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (uses io.MouseDraggingThreshold if lock_threshold < 0.0f)
IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button = 0); //
IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired mouse cursor shape. Important: reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type); // set desired mouse cursor shape
@@ -930,8 +1039,15 @@ namespace ImGui
IMGUI_API const char* SaveIniSettingsToMemory(size_t* out_ini_size = NULL); // return a zero-terminated string with the .ini data which you can save by your own mean. call when io.WantSaveIniSettings is set, then save data by your own mean and clear io.WantSaveIniSettings.
// Debug Utilities
+ // - Your main debugging friend is the ShowMetricsWindow() function, which is also accessible from Demo->Tools->Metrics Debugger
IMGUI_API void DebugTextEncoding(const char* text);
+ IMGUI_API void DebugFlashStyleColor(ImGuiCol idx);
+ IMGUI_API void DebugStartItemPicker();
IMGUI_API bool DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx); // This is called by IMGUI_CHECKVERSION() macro.
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ IMGUI_API void DebugLog(const char* fmt, ...) IM_FMTARGS(1); // Call via IMGUI_DEBUG_LOG() for maximum stripping in caller code!
+ IMGUI_API void DebugLogV(const char* fmt, va_list args) IM_FMTLIST(1);
+#endif
// Memory Allocators
// - Those functions are not reliant on the current context.
@@ -969,54 +1085,109 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, // Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus)
ImGuiWindowFlags_AlwaysVerticalScrollbar= 1 << 14, // Always show vertical scrollbar (even if ContentSize.y < Size.y)
ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 15, // Always show horizontal scrollbar (even if ContentSize.x < Size.x)
- ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient)
- ImGuiWindowFlags_NoNavInputs = 1 << 18, // No gamepad/keyboard navigation within the window
- ImGuiWindowFlags_NoNavFocus = 1 << 19, // No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
- ImGuiWindowFlags_UnsavedDocument = 1 << 20, // Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.
+ ImGuiWindowFlags_NoNavInputs = 1 << 16, // No keyboard/gamepad navigation within the window
+ ImGuiWindowFlags_NoNavFocus = 1 << 17, // No focusing toward this window with keyboard/gamepad navigation (e.g. skipped by CTRL+TAB)
+ ImGuiWindowFlags_UnsavedDocument = 1 << 18, // Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.
ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
ImGuiWindowFlags_NoDecoration = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse,
ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
// [Internal]
- ImGuiWindowFlags_NavFlattened = 1 << 23, // [BETA] On child window: allow gamepad/keyboard navigation to cross over parent border to this child or between sibling child windows.
ImGuiWindowFlags_ChildWindow = 1 << 24, // Don't use! For internal use by BeginChild()
ImGuiWindowFlags_Tooltip = 1 << 25, // Don't use! For internal use by BeginTooltip()
ImGuiWindowFlags_Popup = 1 << 26, // Don't use! For internal use by BeginPopup()
ImGuiWindowFlags_Modal = 1 << 27, // Don't use! For internal use by BeginPopupModal()
ImGuiWindowFlags_ChildMenu = 1 << 28, // Don't use! For internal use by BeginMenu()
+
+ // Obsolete names
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiWindowFlags_NavFlattened = 1 << 29, // Obsoleted in 1.90.9: Use ImGuiChildFlags_NavFlattened in BeginChild() call.
+ ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 30, // Obsoleted in 1.90.0: Use ImGuiChildFlags_AlwaysUseWindowPadding in BeginChild() call.
+#endif
+};
+
+// Flags for ImGui::BeginChild()
+// (Legacy: bit 0 must always correspond to ImGuiChildFlags_Borders to be backward compatible with old API using 'bool border = false'.
+// About using AutoResizeX/AutoResizeY flags:
+// - May be combined with SetNextWindowSizeConstraints() to set a min/max size for each axis (see "Demo->Child->Auto-resize with Constraints").
+// - Size measurement for a given axis is only performed when the child window is within visible boundaries, or is just appearing.
+// - This allows BeginChild() to return false when not within boundaries (e.g. when scrolling), which is more optimal. BUT it won't update its auto-size while clipped.
+// While not perfect, it is a better default behavior as the always-on performance gain is more valuable than the occasional "resizing after becoming visible again" glitch.
+// - You may also use ImGuiChildFlags_AlwaysAutoResize to force an update even when child window is not in view.
+// HOWEVER PLEASE UNDERSTAND THAT DOING SO WILL PREVENT BeginChild() FROM EVER RETURNING FALSE, disabling benefits of coarse clipping.
+enum ImGuiChildFlags_
+{
+ ImGuiChildFlags_None = 0,
+ ImGuiChildFlags_Borders = 1 << 0, // Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == true for legacy reason)
+ ImGuiChildFlags_AlwaysUseWindowPadding = 1 << 1, // Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense)
+ ImGuiChildFlags_ResizeX = 1 << 2, // Allow resize from right border (layout direction). Enable .ini saving (unless ImGuiWindowFlags_NoSavedSettings passed to window flags)
+ ImGuiChildFlags_ResizeY = 1 << 3, // Allow resize from bottom border (layout direction). "
+ ImGuiChildFlags_AutoResizeX = 1 << 4, // Enable auto-resizing width. Read "IMPORTANT: Size measurement" details above.
+ ImGuiChildFlags_AutoResizeY = 1 << 5, // Enable auto-resizing height. Read "IMPORTANT: Size measurement" details above.
+ ImGuiChildFlags_AlwaysAutoResize = 1 << 6, // Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return true, always disable clipping optimization! NOT RECOMMENDED.
+ ImGuiChildFlags_FrameStyle = 1 << 7, // Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding.
+ ImGuiChildFlags_NavFlattened = 1 << 8, // [BETA] Share focus scope, allow keyboard/gamepad navigation to cross over parent border to this child or between sibling child windows.
+
+ // Obsolete names
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiChildFlags_Border = ImGuiChildFlags_Borders, // Renamed in 1.91.1 (August 2024) for consistency.
+#endif
+};
+
+// Flags for ImGui::PushItemFlag()
+// (Those are shared by all items)
+enum ImGuiItemFlags_
+{
+ ImGuiItemFlags_None = 0, // (Default)
+ ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav.
+ ImGuiItemFlags_NoNav = 1 << 1, // false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls).
+ ImGuiItemFlags_NoNavDefaultFocus = 1 << 2, // false // Disable item being a candidate for default focus (e.g. used by title bar items).
+ ImGuiItemFlags_ButtonRepeat = 1 << 3, // false // Any button-like behavior will have repeat mode enabled (based on io.KeyRepeatDelay and io.KeyRepeatRate values). Note that you can also call IsItemActive() after any button to tell if it is being held.
+ ImGuiItemFlags_AutoClosePopups = 1 << 4, // true // MenuItem()/Selectable() automatically close their parent popup window.
+ ImGuiItemFlags_AllowDuplicateId = 1 << 5, // false // Allow submitting an item with the same identifier as an item already submitted this frame without triggering a warning tooltip if io.ConfigDebugHighlightIdConflicts is set.
};
// Flags for ImGui::InputText()
// (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigInputTextCursorBlink and io.ConfigInputTextEnterKeepActive)
enum ImGuiInputTextFlags_
{
+ // Basic filters (also see ImGuiInputTextFlags_CallbackCharFilter)
ImGuiInputTextFlags_None = 0,
ImGuiInputTextFlags_CharsDecimal = 1 << 0, // Allow 0123456789.+-*/
ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, // Allow 0123456789ABCDEFabcdef
- ImGuiInputTextFlags_CharsUppercase = 1 << 2, // Turn a..z into A..Z
- ImGuiInputTextFlags_CharsNoBlank = 1 << 3, // Filter out spaces, tabs
- ImGuiInputTextFlags_AutoSelectAll = 1 << 4, // Select entire text when first taking mouse focus
- ImGuiInputTextFlags_EnterReturnsTrue = 1 << 5, // Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider looking at the IsItemDeactivatedAfterEdit() function.
- ImGuiInputTextFlags_CallbackCompletion = 1 << 6, // Callback on pressing TAB (for completion handling)
- ImGuiInputTextFlags_CallbackHistory = 1 << 7, // Callback on pressing Up/Down arrows (for history handling)
- ImGuiInputTextFlags_CallbackAlways = 1 << 8, // Callback on each iteration. User code may query cursor position, modify text buffer.
- ImGuiInputTextFlags_CallbackCharFilter = 1 << 9, // Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard.
- ImGuiInputTextFlags_AllowTabInput = 1 << 10, // Pressing TAB input a '\t' character into the text field
- ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 11, // In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter, add line with Enter).
- ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12, // Disable following the cursor horizontally
- ImGuiInputTextFlags_AlwaysOverwrite = 1 << 13, // Overwrite mode
- ImGuiInputTextFlags_ReadOnly = 1 << 14, // Read-only mode
- ImGuiInputTextFlags_Password = 1 << 15, // Password mode, display all characters as '*'
+ ImGuiInputTextFlags_CharsScientific = 1 << 2, // Allow 0123456789.+-*/eE (Scientific notation input)
+ ImGuiInputTextFlags_CharsUppercase = 1 << 3, // Turn a..z into A..Z
+ ImGuiInputTextFlags_CharsNoBlank = 1 << 4, // Filter out spaces, tabs
+
+ // Inputs
+ ImGuiInputTextFlags_AllowTabInput = 1 << 5, // Pressing TAB input a '\t' character into the text field
+ ImGuiInputTextFlags_EnterReturnsTrue = 1 << 6, // Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider using IsItemDeactivatedAfterEdit() instead!
+ ImGuiInputTextFlags_EscapeClearsAll = 1 << 7, // Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert)
+ ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 8, // In multi-line mode, validate with Enter, add new line with Ctrl+Enter (default is opposite: validate with Ctrl+Enter, add line with Enter).
+
+ // Other options
+ ImGuiInputTextFlags_ReadOnly = 1 << 9, // Read-only mode
+ ImGuiInputTextFlags_Password = 1 << 10, // Password mode, display all characters as '*', disable copy
+ ImGuiInputTextFlags_AlwaysOverwrite = 1 << 11, // Overwrite mode
+ ImGuiInputTextFlags_AutoSelectAll = 1 << 12, // Select entire text when first taking mouse focus
+ ImGuiInputTextFlags_ParseEmptyRefVal = 1 << 13, // InputFloat(), InputInt(), InputScalar() etc. only: parse empty string as zero value.
+ ImGuiInputTextFlags_DisplayEmptyRefVal = 1 << 14, // InputFloat(), InputInt(), InputScalar() etc. only: when value is zero, do not display it. Generally used with ImGuiInputTextFlags_ParseEmptyRefVal.
+ ImGuiInputTextFlags_NoHorizontalScroll = 1 << 15, // Disable following the cursor horizontally
ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
- ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input)
- ImGuiInputTextFlags_CallbackResize = 1 << 18, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this)
- ImGuiInputTextFlags_CallbackEdit = 1 << 19, // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active)
- ImGuiInputTextFlags_EscapeClearsAll = 1 << 20, // Escape key clears content if not empty, and deactivate otherwise (constrast to default behavior of Escape to revert)
- // Obsolete names (will be removed soon)
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior
-#endif
+ // Elide display / Alignment
+ ImGuiInputTextFlags_ElideLeft = 1 << 17, // When text doesn't fit, elide left side to ensure right side stays visible. Useful for path/filenames. Single-line only!
+
+ // Callback features
+ ImGuiInputTextFlags_CallbackCompletion = 1 << 18, // Callback on pressing TAB (for completion handling)
+ ImGuiInputTextFlags_CallbackHistory = 1 << 19, // Callback on pressing Up/Down arrows (for history handling)
+ ImGuiInputTextFlags_CallbackAlways = 1 << 20, // Callback on each iteration. User code may query cursor position, modify text buffer.
+ ImGuiInputTextFlags_CallbackCharFilter = 1 << 21, // Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard.
+ ImGuiInputTextFlags_CallbackResize = 1 << 22, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this)
+ ImGuiInputTextFlags_CallbackEdit = 1 << 23, // Callback on any edit. Note that InputText() already returns true on edit + you can always use IsItemEdited(). The callback is useful to manipulate the underlying buffer while focus is active.
+
+ // Obsolete names
+ //ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior
};
// Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()
@@ -1025,25 +1196,33 @@ enum ImGuiTreeNodeFlags_
ImGuiTreeNodeFlags_None = 0,
ImGuiTreeNodeFlags_Selected = 1 << 0, // Draw as selected
ImGuiTreeNodeFlags_Framed = 1 << 1, // Draw frame with background (e.g. for CollapsingHeader)
- ImGuiTreeNodeFlags_AllowItemOverlap = 1 << 2, // Hit testing to allow subsequent widgets to overlap this one
+ ImGuiTreeNodeFlags_AllowOverlap = 1 << 2, // Hit testing to allow subsequent widgets to overlap this one
ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3, // Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4, // Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
ImGuiTreeNodeFlags_DefaultOpen = 1 << 5, // Default node to be open
- ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, // Need double-click to open node
- ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, // Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
+ ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, // Open on double-click instead of simple click (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined.
+ ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, // Open when clicking on the arrow part (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined.
ImGuiTreeNodeFlags_Leaf = 1 << 8, // No collapsing, no arrow (use as a convenience for leaf nodes).
- ImGuiTreeNodeFlags_Bullet = 1 << 9, // Display a bullet instead of arrow
- ImGuiTreeNodeFlags_FramePadding = 1 << 10, // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().
- ImGuiTreeNodeFlags_SpanAvailWidth = 1 << 11, // Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line. In the future we may refactor the hit system to be front-to-back, allowing natural overlaps and then this can become the default.
- ImGuiTreeNodeFlags_SpanFullWidth = 1 << 12, // Extend hit box to the left-most and right-most edges (bypass the indented area).
- ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
- //ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
+ ImGuiTreeNodeFlags_Bullet = 1 << 9, // Display a bullet instead of arrow. IMPORTANT: node can still be marked open/close if you don't set the _Leaf flag!
+ ImGuiTreeNodeFlags_FramePadding = 1 << 10, // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding() before the node.
+ ImGuiTreeNodeFlags_SpanAvailWidth = 1 << 11, // Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line without using AllowOverlap mode.
+ ImGuiTreeNodeFlags_SpanFullWidth = 1 << 12, // Extend hit box to the left-most and right-most edges (cover the indent area).
+ ImGuiTreeNodeFlags_SpanLabelWidth = 1 << 13, // Narrow hit box + narrow hovering highlight, will only cover the label text.
+ ImGuiTreeNodeFlags_SpanAllColumns = 1 << 14, // Frame will span all columns of its container table (label will still fit in current column)
+ ImGuiTreeNodeFlags_LabelSpanAllColumns = 1 << 15, // Label will span all columns of its container table
+ //ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 16, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
+ ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 17, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog,
+
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiTreeNodeFlags_AllowItemOverlap = ImGuiTreeNodeFlags_AllowOverlap, // Renamed in 1.89.7
+ ImGuiTreeNodeFlags_SpanTextWidth = ImGuiTreeNodeFlags_SpanLabelWidth,// Renamed in 1.90.7
+#endif
};
// Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions.
-// - To be backward compatible with older API which took an 'int mouse_button = 1' argument, we need to treat
-// small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags.
+// - To be backward compatible with older API which took an 'int mouse_button = 1' argument instead of 'ImGuiPopupFlags flags',
+// we need to treat small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags.
// It is therefore guaranteed to be legal to pass a mouse button index in ImGuiPopupFlags.
// - For the same reason, we exceptionally default the ImGuiPopupFlags argument of BeginPopupContextXXX functions to 1 instead of 0.
// IMPORTANT: because the default parameter is 1 (==ImGuiPopupFlags_MouseButtonRight), if you rely on the default parameter
@@ -1057,10 +1236,12 @@ enum ImGuiPopupFlags_
ImGuiPopupFlags_MouseButtonMiddle = 2, // For BeginPopupContext*(): open on Middle Mouse release. Guaranteed to always be == 2 (same as ImGuiMouseButton_Middle)
ImGuiPopupFlags_MouseButtonMask_ = 0x1F,
ImGuiPopupFlags_MouseButtonDefault_ = 1,
- ImGuiPopupFlags_NoOpenOverExistingPopup = 1 << 5, // For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack
- ImGuiPopupFlags_NoOpenOverItems = 1 << 6, // For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space
- ImGuiPopupFlags_AnyPopupId = 1 << 7, // For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup.
- ImGuiPopupFlags_AnyPopupLevel = 1 << 8, // For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level)
+ ImGuiPopupFlags_NoReopen = 1 << 5, // For OpenPopup*(), BeginPopupContext*(): don't reopen same popup if already open (won't reposition, won't reinitialize navigation)
+ //ImGuiPopupFlags_NoReopenAlwaysNavInit = 1 << 6, // For OpenPopup*(), BeginPopupContext*(): focus and initialize navigation even when not reopening.
+ ImGuiPopupFlags_NoOpenOverExistingPopup = 1 << 7, // For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack
+ ImGuiPopupFlags_NoOpenOverItems = 1 << 8, // For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space
+ ImGuiPopupFlags_AnyPopupId = 1 << 10, // For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup.
+ ImGuiPopupFlags_AnyPopupLevel = 1 << 11, // For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level)
ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevel,
};
@@ -1068,11 +1249,17 @@ enum ImGuiPopupFlags_
enum ImGuiSelectableFlags_
{
ImGuiSelectableFlags_None = 0,
- ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this doesn't close parent popup window
- ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Selectable frame can span all columns (text will still fit in current column)
+ ImGuiSelectableFlags_NoAutoClosePopups = 1 << 0, // Clicking this doesn't close parent popup window (overrides ImGuiItemFlags_AutoClosePopups)
+ ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Frame will span all columns of its container table (text will still fit in current column)
ImGuiSelectableFlags_AllowDoubleClick = 1 << 2, // Generate press events on double clicks too
ImGuiSelectableFlags_Disabled = 1 << 3, // Cannot be selected, display grayed out text
- ImGuiSelectableFlags_AllowItemOverlap = 1 << 4, // (WIP) Hit testing to allow subsequent widgets to overlap this one
+ ImGuiSelectableFlags_AllowOverlap = 1 << 4, // (WIP) Hit testing to allow subsequent widgets to overlap this one
+ ImGuiSelectableFlags_Highlight = 1 << 5, // Make the item be displayed as if it is hovered
+
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiSelectableFlags_DontClosePopups = ImGuiSelectableFlags_NoAutoClosePopups, // Renamed in 1.91.0
+ ImGuiSelectableFlags_AllowItemOverlap = ImGuiSelectableFlags_AllowOverlap, // Renamed in 1.89.7
+#endif
};
// Flags for ImGui::BeginCombo()
@@ -1086,6 +1273,7 @@ enum ImGuiComboFlags_
ImGuiComboFlags_HeightLargest = 1 << 4, // As many fitting items as possible
ImGuiComboFlags_NoArrowButton = 1 << 5, // Display on the preview box without the square arrow button
ImGuiComboFlags_NoPreview = 1 << 6, // Display only a square arrow button
+ ImGuiComboFlags_WidthFitPreview = 1 << 7, // Width dynamically calculated from preview contents
ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest,
};
@@ -1096,11 +1284,12 @@ enum ImGuiTabBarFlags_
ImGuiTabBarFlags_Reorderable = 1 << 0, // Allow manually dragging tabs to re-order them + New tabs are appended at the end of list
ImGuiTabBarFlags_AutoSelectNewTabs = 1 << 1, // Automatically select new tabs when they appear
ImGuiTabBarFlags_TabListPopupButton = 1 << 2, // Disable buttons to open the tab list popup
- ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 1 << 3, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
+ ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 1 << 3, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
ImGuiTabBarFlags_NoTabListScrollingButtons = 1 << 4, // Disable scrolling buttons (apply when fitting policy is ImGuiTabBarFlags_FittingPolicyScroll)
ImGuiTabBarFlags_NoTooltip = 1 << 5, // Disable tooltips when hovering a tab
- ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 6, // Resize tabs when they don't fit
- ImGuiTabBarFlags_FittingPolicyScroll = 1 << 7, // Add scroll buttons when tabs don't fit
+ ImGuiTabBarFlags_DrawSelectedOverline = 1 << 6, // Draw selected overline markers over selected tab
+ ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 7, // Resize tabs when they don't fit
+ ImGuiTabBarFlags_FittingPolicyScroll = 1 << 8, // Add scroll buttons when tabs don't fit
ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll,
ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown,
};
@@ -1109,147 +1298,15 @@ enum ImGuiTabBarFlags_
enum ImGuiTabItemFlags_
{
ImGuiTabItemFlags_None = 0,
- ImGuiTabItemFlags_UnsavedDocument = 1 << 0, // Display a dot next to the title + tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.
+ ImGuiTabItemFlags_UnsavedDocument = 1 << 0, // Display a dot next to the title + set ImGuiTabItemFlags_NoAssumedClosure.
ImGuiTabItemFlags_SetSelected = 1 << 1, // Trigger flag to programmatically make the tab selected when calling BeginTabItem()
- ImGuiTabItemFlags_NoCloseWithMiddleMouseButton = 1 << 2, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
- ImGuiTabItemFlags_NoPushId = 1 << 3, // Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem()
+ ImGuiTabItemFlags_NoCloseWithMiddleMouseButton = 1 << 2, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
+ ImGuiTabItemFlags_NoPushId = 1 << 3, // Don't call PushID()/PopID() on BeginTabItem()/EndTabItem()
ImGuiTabItemFlags_NoTooltip = 1 << 4, // Disable tooltip for the given tab
ImGuiTabItemFlags_NoReorder = 1 << 5, // Disable reordering this tab or having another tab cross over this tab
ImGuiTabItemFlags_Leading = 1 << 6, // Enforce the tab position to the left of the tab bar (after the tab list popup button)
ImGuiTabItemFlags_Trailing = 1 << 7, // Enforce the tab position to the right of the tab bar (before the scrolling buttons)
-};
-
-// Flags for ImGui::BeginTable()
-// - Important! Sizing policies have complex and subtle side effects, much more so than you would expect.
-// Read comments/demos carefully + experiment with live demos to get acquainted with them.
-// - The DEFAULT sizing policies are:
-// - Default to ImGuiTableFlags_SizingFixedFit if ScrollX is on, or if host window has ImGuiWindowFlags_AlwaysAutoResize.
-// - Default to ImGuiTableFlags_SizingStretchSame if ScrollX is off.
-// - When ScrollX is off:
-// - Table defaults to ImGuiTableFlags_SizingStretchSame -> all Columns defaults to ImGuiTableColumnFlags_WidthStretch with same weight.
-// - Columns sizing policy allowed: Stretch (default), Fixed/Auto.
-// - Fixed Columns (if any) will generally obtain their requested width (unless the table cannot fit them all).
-// - Stretch Columns will share the remaining width according to their respective weight.
-// - Mixed Fixed/Stretch columns is possible but has various side-effects on resizing behaviors.
-// The typical use of mixing sizing policies is: any number of LEADING Fixed columns, followed by one or two TRAILING Stretch columns.
-// (this is because the visible order of columns have subtle but necessary effects on how they react to manual resizing).
-// - When ScrollX is on:
-// - Table defaults to ImGuiTableFlags_SizingFixedFit -> all Columns defaults to ImGuiTableColumnFlags_WidthFixed
-// - Columns sizing policy allowed: Fixed/Auto mostly.
-// - Fixed Columns can be enlarged as needed. Table will show a horizontal scrollbar if needed.
-// - When using auto-resizing (non-resizable) fixed columns, querying the content width to use item right-alignment e.g. SetNextItemWidth(-FLT_MIN) doesn't make sense, would create a feedback loop.
-// - Using Stretch columns OFTEN DOES NOT MAKE SENSE if ScrollX is on, UNLESS you have specified a value for 'inner_width' in BeginTable().
-// If you specify a value for 'inner_width' then effectively the scrolling space is known and Stretch or mixed Fixed/Stretch columns become meaningful again.
-// - Read on documentation at the top of imgui_tables.cpp for details.
-enum ImGuiTableFlags_
-{
- // Features
- ImGuiTableFlags_None = 0,
- ImGuiTableFlags_Resizable = 1 << 0, // Enable resizing columns.
- ImGuiTableFlags_Reorderable = 1 << 1, // Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers)
- ImGuiTableFlags_Hideable = 1 << 2, // Enable hiding/disabling columns in context menu.
- ImGuiTableFlags_Sortable = 1 << 3, // Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see ImGuiTableFlags_SortMulti and ImGuiTableFlags_SortTristate.
- ImGuiTableFlags_NoSavedSettings = 1 << 4, // Disable persisting columns order, width and sort settings in the .ini file.
- ImGuiTableFlags_ContextMenuInBody = 1 << 5, // Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
- // Decorations
- ImGuiTableFlags_RowBg = 1 << 6, // Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
- ImGuiTableFlags_BordersInnerH = 1 << 7, // Draw horizontal borders between rows.
- ImGuiTableFlags_BordersOuterH = 1 << 8, // Draw horizontal borders at the top and bottom.
- ImGuiTableFlags_BordersInnerV = 1 << 9, // Draw vertical borders between columns.
- ImGuiTableFlags_BordersOuterV = 1 << 10, // Draw vertical borders on the left and right sides.
- ImGuiTableFlags_BordersH = ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterH, // Draw horizontal borders.
- ImGuiTableFlags_BordersV = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersOuterV, // Draw vertical borders.
- ImGuiTableFlags_BordersInner = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH, // Draw inner borders.
- ImGuiTableFlags_BordersOuter = ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH, // Draw outer borders.
- ImGuiTableFlags_Borders = ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter, // Draw all borders.
- ImGuiTableFlags_NoBordersInBody = 1 << 11, // [ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style
- ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 12, // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style
- // Sizing Policy (read above for defaults)
- ImGuiTableFlags_SizingFixedFit = 1 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width.
- ImGuiTableFlags_SizingFixedSame = 2 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible.
- ImGuiTableFlags_SizingStretchProp = 3 << 13, // Columns default to _WidthStretch with default weights proportional to each columns contents widths.
- ImGuiTableFlags_SizingStretchSame = 4 << 13, // Columns default to _WidthStretch with default weights all equal, unless overridden by TableSetupColumn().
- // Sizing Extra Options
- ImGuiTableFlags_NoHostExtendX = 1 << 16, // Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
- ImGuiTableFlags_NoHostExtendY = 1 << 17, // Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible.
- ImGuiTableFlags_NoKeepColumnsVisible = 1 << 18, // Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable.
- ImGuiTableFlags_PreciseWidths = 1 << 19, // Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
- // Clipping
- ImGuiTableFlags_NoClip = 1 << 20, // Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
- // Padding
- ImGuiTableFlags_PadOuterX = 1 << 21, // Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers.
- ImGuiTableFlags_NoPadOuterX = 1 << 22, // Default if BordersOuterV is off. Disable outermost padding.
- ImGuiTableFlags_NoPadInnerX = 1 << 23, // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
- // Scrolling
- ImGuiTableFlags_ScrollX = 1 << 24, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX.
- ImGuiTableFlags_ScrollY = 1 << 25, // Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
- // Sorting
- ImGuiTableFlags_SortMulti = 1 << 26, // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
- ImGuiTableFlags_SortTristate = 1 << 27, // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
-
- // [Internal] Combinations and masks
- ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame,
-};
-
-// Flags for ImGui::TableSetupColumn()
-enum ImGuiTableColumnFlags_
-{
- // Input configuration flags
- ImGuiTableColumnFlags_None = 0,
- ImGuiTableColumnFlags_Disabled = 1 << 0, // Overriding/master disable flag: hide column, won't show in context menu (unlike calling TableSetColumnEnabled() which manipulates the user accessible state)
- ImGuiTableColumnFlags_DefaultHide = 1 << 1, // Default as a hidden/disabled column.
- ImGuiTableColumnFlags_DefaultSort = 1 << 2, // Default as a sorting column.
- ImGuiTableColumnFlags_WidthStretch = 1 << 3, // Column will stretch. Preferable with horizontal scrolling disabled (default if table sizing policy is _SizingStretchSame or _SizingStretchProp).
- ImGuiTableColumnFlags_WidthFixed = 1 << 4, // Column will not stretch. Preferable with horizontal scrolling enabled (default if table sizing policy is _SizingFixedFit and table is resizable).
- ImGuiTableColumnFlags_NoResize = 1 << 5, // Disable manual resizing.
- ImGuiTableColumnFlags_NoReorder = 1 << 6, // Disable manual reordering this column, this will also prevent other columns from crossing over this column.
- ImGuiTableColumnFlags_NoHide = 1 << 7, // Disable ability to hide/disable this column.
- ImGuiTableColumnFlags_NoClip = 1 << 8, // Disable clipping for this column (all NoClip columns will render in a same draw command).
- ImGuiTableColumnFlags_NoSort = 1 << 9, // Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table).
- ImGuiTableColumnFlags_NoSortAscending = 1 << 10, // Disable ability to sort in the ascending direction.
- ImGuiTableColumnFlags_NoSortDescending = 1 << 11, // Disable ability to sort in the descending direction.
- ImGuiTableColumnFlags_NoHeaderLabel = 1 << 12, // TableHeadersRow() will not submit label for this column. Convenient for some small columns. Name will still appear in context menu.
- ImGuiTableColumnFlags_NoHeaderWidth = 1 << 13, // Disable header text width contribution to automatic column width.
- ImGuiTableColumnFlags_PreferSortAscending = 1 << 14, // Make the initial sort direction Ascending when first sorting on this column (default).
- ImGuiTableColumnFlags_PreferSortDescending = 1 << 15, // Make the initial sort direction Descending when first sorting on this column.
- ImGuiTableColumnFlags_IndentEnable = 1 << 16, // Use current Indent value when entering cell (default for column 0).
- ImGuiTableColumnFlags_IndentDisable = 1 << 17, // Ignore current Indent value when entering cell (default for columns > 0). Indentation changes _within_ the cell will still be honored.
-
- // Output status flags, read-only via TableGetColumnFlags()
- ImGuiTableColumnFlags_IsEnabled = 1 << 24, // Status: is enabled == not hidden by user/api (referred to as "Hide" in _DefaultHide and _NoHide) flags.
- ImGuiTableColumnFlags_IsVisible = 1 << 25, // Status: is visible == is enabled AND not clipped by scrolling.
- ImGuiTableColumnFlags_IsSorted = 1 << 26, // Status: is currently part of the sort specs
- ImGuiTableColumnFlags_IsHovered = 1 << 27, // Status: is hovered by mouse
-
- // [Internal] Combinations and masks
- ImGuiTableColumnFlags_WidthMask_ = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_WidthFixed,
- ImGuiTableColumnFlags_IndentMask_ = ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_IndentDisable,
- ImGuiTableColumnFlags_StatusMask_ = ImGuiTableColumnFlags_IsEnabled | ImGuiTableColumnFlags_IsVisible | ImGuiTableColumnFlags_IsSorted | ImGuiTableColumnFlags_IsHovered,
- ImGuiTableColumnFlags_NoDirectResize_ = 1 << 30, // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge)
-};
-
-// Flags for ImGui::TableNextRow()
-enum ImGuiTableRowFlags_
-{
- ImGuiTableRowFlags_None = 0,
- ImGuiTableRowFlags_Headers = 1 << 0, // Identify header row (set default background color + width of its contents accounted differently for auto column width)
-};
-
-// Enum for ImGui::TableSetBgColor()
-// Background colors are rendering in 3 layers:
-// - Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set.
-// - Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set.
-// - Layer 2: draw with CellBg color if set.
-// The purpose of the two row/columns layers is to let you decide if a background color change should override or blend with the existing color.
-// When using ImGuiTableFlags_RowBg on the table, each row has the RowBg0 color automatically set for odd/even rows.
-// If you set the color of RowBg0 target, your color will override the existing RowBg0 color.
-// If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color.
-enum ImGuiTableBgTarget_
-{
- ImGuiTableBgTarget_None = 0,
- ImGuiTableBgTarget_RowBg0 = 1, // Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
- ImGuiTableBgTarget_RowBg1 = 2, // Set row background color 1 (generally used for selection marking)
- ImGuiTableBgTarget_CellBg = 3, // Set cell background color (top-most color)
+ ImGuiTabItemFlags_NoAssumedClosure = 1 << 8, // Tab is selected when trying to close + closure is not immediately assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.
};
// Flags for ImGui::IsWindowFocused()
@@ -1278,16 +1335,30 @@ enum ImGuiHoveredFlags_
ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 5, // Return true even if a popup window is normally blocking access to this item/window
//ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 6, // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet.
ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 7, // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns.
- ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 8, // IsItemHovered() only: Return true even if the position is obstructed or overlapped by another window
- ImGuiHoveredFlags_AllowWhenDisabled = 1 << 9, // IsItemHovered() only: Return true even if the item is disabled
- ImGuiHoveredFlags_NoNavOverride = 1 << 10, // Disable using gamepad/keyboard navigation state when active, always query mouse.
+ ImGuiHoveredFlags_AllowWhenOverlappedByItem = 1 << 8, // IsItemHovered() only: Return true even if the item uses AllowOverlap mode and is overlapped by another hoverable item.
+ ImGuiHoveredFlags_AllowWhenOverlappedByWindow = 1 << 9, // IsItemHovered() only: Return true even if the position is obstructed or overlapped by another window.
+ ImGuiHoveredFlags_AllowWhenDisabled = 1 << 10, // IsItemHovered() only: Return true even if the item is disabled
+ ImGuiHoveredFlags_NoNavOverride = 1 << 11, // IsItemHovered() only: Disable using keyboard/gamepad navigation state when active, always query mouse
+ ImGuiHoveredFlags_AllowWhenOverlapped = ImGuiHoveredFlags_AllowWhenOverlappedByItem | ImGuiHoveredFlags_AllowWhenOverlappedByWindow,
ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped,
ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows,
- // Hovering delays (for tooltips)
- ImGuiHoveredFlags_DelayNormal = 1 << 11, // Return true after io.HoverDelayNormal elapsed (~0.30 sec)
- ImGuiHoveredFlags_DelayShort = 1 << 12, // Return true after io.HoverDelayShort elapsed (~0.10 sec)
- ImGuiHoveredFlags_NoSharedDelay = 1 << 13, // Disable shared delay system where moving from one item to the next keeps the previous timer for a short time (standard for tooltips with long delays)
+ // Tooltips mode
+ // - typically used in IsItemHovered() + SetTooltip() sequence.
+ // - this is a shortcut to pull flags from 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' where you can reconfigure desired behavior.
+ // e.g. 'TooltipHoveredFlagsForMouse' defaults to 'ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort'.
+ // - for frequently actioned or hovered items providing a tooltip, you want may to use ImGuiHoveredFlags_ForTooltip (stationary + delay) so the tooltip doesn't show too often.
+ // - for items which main purpose is to be hovered, or items with low affordance, or in less consistent apps, prefer no delay or shorter delay.
+ ImGuiHoveredFlags_ForTooltip = 1 << 12, // Shortcut for standard flags when using IsItemHovered() + SetTooltip() sequence.
+
+ // (Advanced) Mouse Hovering delays.
+ // - generally you can use ImGuiHoveredFlags_ForTooltip to use application-standardized flags.
+ // - use those if you need specific overrides.
+ ImGuiHoveredFlags_Stationary = 1 << 13, // Require mouse to be stationary for style.HoverStationaryDelay (~0.15 sec) _at least one time_. After this, can move on same item/window. Using the stationary test tends to reduces the need for a long delay.
+ ImGuiHoveredFlags_DelayNone = 1 << 14, // IsItemHovered() only: Return true immediately (default). As this is the default you generally ignore this.
+ ImGuiHoveredFlags_DelayShort = 1 << 15, // IsItemHovered() only: Return true after style.HoverDelayShort elapsed (~0.15 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item).
+ ImGuiHoveredFlags_DelayNormal = 1 << 16, // IsItemHovered() only: Return true after style.HoverDelayNormal elapsed (~0.40 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item).
+ ImGuiHoveredFlags_NoSharedDelay = 1 << 17, // IsItemHovered() only: Disable shared delay system where moving from one item to the next keeps the previous timer for a short time (standard for tooltips with long delays)
};
// Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload()
@@ -1295,17 +1366,23 @@ enum ImGuiDragDropFlags_
{
ImGuiDragDropFlags_None = 0,
// BeginDragDropSource() flags
- ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior.
+ ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // Disable preview tooltip. By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior.
ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, // By default, when dragging we clear data so that IsItemHovered() will return false, to avoid subsequent user code submitting tooltips. This flag disables this behavior so you can still call IsItemHovered() on the source item.
ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item.
ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit.
ImGuiDragDropFlags_SourceExtern = 1 << 4, // External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously.
- ImGuiDragDropFlags_SourceAutoExpirePayload = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged)
+ ImGuiDragDropFlags_PayloadAutoExpire = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged)
+ ImGuiDragDropFlags_PayloadNoCrossContext = 1 << 6, // Hint to specify that the payload may not be copied outside current dear imgui context.
+ ImGuiDragDropFlags_PayloadNoCrossProcess = 1 << 7, // Hint to specify that the payload may not be copied outside current process.
// AcceptDragDropPayload() flags
ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered.
ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, // Do not draw the default highlight rectangle when hovering over target.
ImGuiDragDropFlags_AcceptNoPreviewTooltip = 1 << 12, // Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site.
ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect, // For peeking ahead and inspecting the payload before delivery.
+
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiDragDropFlags_SourceAutoExpirePayload = ImGuiDragDropFlags_PayloadAutoExpire, // Renamed in 1.90.9
+#endif
};
// Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui.
@@ -1325,11 +1402,13 @@ enum ImGuiDataType_
ImGuiDataType_U64, // unsigned long long / unsigned __int64
ImGuiDataType_Float, // float
ImGuiDataType_Double, // double
+ ImGuiDataType_Bool, // bool (provided for user convenience, not supported by scalar widgets)
+ ImGuiDataType_String, // char* (provided for user convenience, not supported by scalar widgets)
ImGuiDataType_COUNT
};
// A cardinal direction
-enum ImGuiDir_
+enum ImGuiDir : int
{
ImGuiDir_None = -1,
ImGuiDir_Left = 0,
@@ -1340,20 +1419,25 @@ enum ImGuiDir_
};
// A sorting direction
-enum ImGuiSortDirection_
+enum ImGuiSortDirection : ImU8
{
ImGuiSortDirection_None = 0,
ImGuiSortDirection_Ascending = 1, // Ascending = 0->9, A->Z etc.
ImGuiSortDirection_Descending = 2 // Descending = 9->0, Z->A etc.
};
-// A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value)
-// All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87)
-// Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey.
+// A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value): can represent Keyboard, Mouse and Gamepad values.
+// All our named keys are >= 512. Keys value 0 to 511 are left unused and were legacy native/opaque key values (< 1.87).
+// Support for legacy keys was completely removed in 1.91.5.
+// Read details about the 1.87+ transition : https://github.com/ocornut/imgui/issues/4921
+// Note that "Keys" related to physical keys and are not the same concept as input "Characters", the later are submitted via io.AddInputCharacter().
+// The keyboard key enum values are named after the keys on a standard US keyboard, and on other keyboard types the keys reported may not match the keycaps.
enum ImGuiKey : int
{
// Keyboard
ImGuiKey_None = 0,
+ ImGuiKey_NamedKey_BEGIN = 512, // First valid key value (other than 0)
+
ImGuiKey_Tab = 512, // == ImGuiKey_NamedKey_BEGIN
ImGuiKey_LeftArrow,
ImGuiKey_RightArrow,
@@ -1378,6 +1462,8 @@ enum ImGuiKey : int
ImGuiKey_U, ImGuiKey_V, ImGuiKey_W, ImGuiKey_X, ImGuiKey_Y, ImGuiKey_Z,
ImGuiKey_F1, ImGuiKey_F2, ImGuiKey_F3, ImGuiKey_F4, ImGuiKey_F5, ImGuiKey_F6,
ImGuiKey_F7, ImGuiKey_F8, ImGuiKey_F9, ImGuiKey_F10, ImGuiKey_F11, ImGuiKey_F12,
+ ImGuiKey_F13, ImGuiKey_F14, ImGuiKey_F15, ImGuiKey_F16, ImGuiKey_F17, ImGuiKey_F18,
+ ImGuiKey_F19, ImGuiKey_F20, ImGuiKey_F21, ImGuiKey_F22, ImGuiKey_F23, ImGuiKey_F24,
ImGuiKey_Apostrophe, // '
ImGuiKey_Comma, // ,
ImGuiKey_Minus, // -
@@ -1403,9 +1489,12 @@ enum ImGuiKey : int
ImGuiKey_KeypadAdd,
ImGuiKey_KeypadEnter,
ImGuiKey_KeypadEqual,
+ ImGuiKey_AppBack, // Available on some keyboard/mouses. Often referred as "Browser Back"
+ ImGuiKey_AppForward,
+ ImGuiKey_Oem102, // Non-US backslash.
- // Gamepad (some of those are analog values, 0.0f to 1.0f) // GAME NAVIGATION ACTION
- // (download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets)
+ // Gamepad (some of those are analog values, 0.0f to 1.0f) // NAVIGATION ACTION
+ // (download controller mapping PNG/PSD at http://dearimgui.com/controls_sheets)
ImGuiKey_GamepadStart, // Menu (Xbox) + (Switch) Start/Options (PS)
ImGuiKey_GamepadBack, // View (Xbox) - (Switch) Share (PS)
ImGuiKey_GamepadFaceLeft, // X (Xbox) Y (Switch) Square (PS) // Tap: Toggle Menu. Hold: Windowing mode (Focus/Move/Resize windows)
@@ -1431,13 +1520,13 @@ enum ImGuiKey : int
ImGuiKey_GamepadRStickUp, // [Analog]
ImGuiKey_GamepadRStickDown, // [Analog]
- // Mouse Buttons (auto-submitted from AddMouseButtonEvent() calls)
+ // Aliases: Mouse Buttons (auto-submitted from AddMouseButtonEvent() calls)
// - This is mirroring the data also written to io.MouseDown[], io.MouseWheel, in a format allowing them to be accessed via standard key API.
ImGuiKey_MouseLeft, ImGuiKey_MouseRight, ImGuiKey_MouseMiddle, ImGuiKey_MouseX1, ImGuiKey_MouseX2, ImGuiKey_MouseWheelX, ImGuiKey_MouseWheelY,
// [Internal] Reserved for mod storage
ImGuiKey_ReservedForModCtrl, ImGuiKey_ReservedForModShift, ImGuiKey_ReservedForModAlt, ImGuiKey_ReservedForModSuper,
- ImGuiKey_COUNT,
+ ImGuiKey_NamedKey_END,
// Keyboard Modifiers (explicitly submitted by backend via AddKeyEvent() calls)
// - This is mirroring the data also written to io.KeyCtrl, io.KeyShift, io.KeyAlt, io.KeySuper, in a format allowing
@@ -1447,63 +1536,70 @@ enum ImGuiKey : int
// - In theory the value of keyboard modifiers should be roughly equivalent to a logical or of the equivalent left/right keys.
// In practice: it's complicated; mods are often provided from different sources. Keyboard layout, IME, sticky keys and
// backends tend to interfere and break that equivalence. The safer decision is to relay that ambiguity down to the end-user...
+ // - On macOS, we swap Cmd(Super) and Ctrl keys at the time of the io.AddKeyEvent() call.
ImGuiMod_None = 0,
- ImGuiMod_Ctrl = 1 << 12,
- ImGuiMod_Shift = 1 << 13,
+ ImGuiMod_Ctrl = 1 << 12, // Ctrl (non-macOS), Cmd (macOS)
+ ImGuiMod_Shift = 1 << 13, // Shift
ImGuiMod_Alt = 1 << 14, // Option/Menu
- ImGuiMod_Super = 1 << 15, // Cmd/Super/Windows
- ImGuiMod_Mask_ = 0xF000,
-#if defined(__APPLE__)
- ImGuiMod_Shortcut = ImGuiMod_Super,
-#else
- ImGuiMod_Shortcut = ImGuiMod_Ctrl,
-#endif
+ ImGuiMod_Super = 1 << 15, // Windows/Super (non-macOS), Ctrl (macOS)
+ ImGuiMod_Mask_ = 0xF000, // 4-bits
- // [Internal] Prior to 1.87 we required user to fill io.KeysDown[512] using their own native index + the io.KeyMap[] array.
- // We are ditching this method but keeping a legacy path for user code doing e.g. IsKeyPressed(MY_NATIVE_KEY_CODE)
- ImGuiKey_NamedKey_BEGIN = 512,
- ImGuiKey_NamedKey_END = ImGuiKey_COUNT,
+ // [Internal] If you need to iterate all keys (for e.g. an input mapper) you may use ImGuiKey_NamedKey_BEGIN..ImGuiKey_NamedKey_END.
ImGuiKey_NamedKey_COUNT = ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN,
-#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
- ImGuiKey_KeysData_SIZE = ImGuiKey_NamedKey_COUNT, // Size of KeysData[]: only hold named keys
- ImGuiKey_KeysData_OFFSET = ImGuiKey_NamedKey_BEGIN, // First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
-#else
- ImGuiKey_KeysData_SIZE = ImGuiKey_COUNT, // Size of KeysData[]: hold legacy 0..512 keycodes + named keys
- ImGuiKey_KeysData_OFFSET = 0, // First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
-#endif
+ //ImGuiKey_KeysData_SIZE = ImGuiKey_NamedKey_COUNT, // Size of KeysData[]: only hold named keys
+ //ImGuiKey_KeysData_OFFSET = ImGuiKey_NamedKey_BEGIN, // Accesses to io.KeysData[] must use (key - ImGuiKey_NamedKey_BEGIN) index.
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiKey_COUNT = ImGuiKey_NamedKey_END, // Obsoleted in 1.91.5 because it was extremely misleading (since named keys don't start at 0 anymore)
+ ImGuiMod_Shortcut = ImGuiMod_Ctrl, // Removed in 1.90.7, you can now simply use ImGuiMod_Ctrl
ImGuiKey_ModCtrl = ImGuiMod_Ctrl, ImGuiKey_ModShift = ImGuiMod_Shift, ImGuiKey_ModAlt = ImGuiMod_Alt, ImGuiKey_ModSuper = ImGuiMod_Super, // Renamed in 1.89
- ImGuiKey_KeyPadEnter = ImGuiKey_KeypadEnter, // Renamed in 1.87
+ //ImGuiKey_KeyPadEnter = ImGuiKey_KeypadEnter, // Renamed in 1.87
#endif
};
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
-// OBSOLETED in 1.88 (from July 2022): ImGuiNavInput and io.NavInputs[].
-// Official backends between 1.60 and 1.86: will keep working and feed gamepad inputs as long as IMGUI_DISABLE_OBSOLETE_KEYIO is not set.
-// Custom backends: feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
-enum ImGuiNavInput
+// Flags for Shortcut(), SetNextItemShortcut(),
+// (and for upcoming extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner() that are still in imgui_internal.h)
+// Don't mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function)
+enum ImGuiInputFlags_
{
- ImGuiNavInput_Activate, ImGuiNavInput_Cancel, ImGuiNavInput_Input, ImGuiNavInput_Menu, ImGuiNavInput_DpadLeft, ImGuiNavInput_DpadRight, ImGuiNavInput_DpadUp, ImGuiNavInput_DpadDown,
- ImGuiNavInput_LStickLeft, ImGuiNavInput_LStickRight, ImGuiNavInput_LStickUp, ImGuiNavInput_LStickDown, ImGuiNavInput_FocusPrev, ImGuiNavInput_FocusNext, ImGuiNavInput_TweakSlow, ImGuiNavInput_TweakFast,
- ImGuiNavInput_COUNT,
+ ImGuiInputFlags_None = 0,
+ ImGuiInputFlags_Repeat = 1 << 0, // Enable repeat. Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1.
+
+ // Flags for Shortcut(), SetNextItemShortcut()
+ // - Routing policies: RouteGlobal+OverActive >> RouteActive or RouteFocused (if owner is active item) >> RouteGlobal+OverFocused >> RouteFocused (if in focused window stack) >> RouteGlobal.
+ // - Default policy is RouteFocused. Can select only 1 policy among all available.
+ ImGuiInputFlags_RouteActive = 1 << 10, // Route to active item only.
+ ImGuiInputFlags_RouteFocused = 1 << 11, // Route to windows in the focus stack (DEFAULT). Deep-most focused window takes inputs. Active item takes inputs over deep-most focused window.
+ ImGuiInputFlags_RouteGlobal = 1 << 12, // Global route (unless a focused window or active item registered the route).
+ ImGuiInputFlags_RouteAlways = 1 << 13, // Do not register route, poll keys directly.
+ // - Routing options
+ ImGuiInputFlags_RouteOverFocused = 1 << 14, // Option: global route: higher priority than focused route (unless active item in focused route).
+ ImGuiInputFlags_RouteOverActive = 1 << 15, // Option: global route: higher priority than active item. Unlikely you need to use that: will interfere with every active items, e.g. CTRL+A registered by InputText will be overridden by this. May not be fully honored as user/internal code is likely to always assume they can access keys when active.
+ ImGuiInputFlags_RouteUnlessBgFocused = 1 << 16, // Option: global route: will not be applied if underlying background/void is focused (== no Dear ImGui windows are focused). Useful for overlay applications.
+ ImGuiInputFlags_RouteFromRootWindow = 1 << 17, // Option: route evaluated from the point of view of root window rather than current window.
+
+ // Flags for SetNextItemShortcut()
+ ImGuiInputFlags_Tooltip = 1 << 18, // Automatically display a tooltip when hovering item [BETA] Unsure of right api (opt-in/opt-out)
};
-#endif
// Configuration flags stored in io.ConfigFlags. Set by user/application.
enum ImGuiConfigFlags_
{
ImGuiConfigFlags_None = 0,
- ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag.
+ ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. Enable full Tabbing + directional arrows + space/enter to activate.
ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. Backend also needs to set ImGuiBackendFlags_HasGamepad.
- ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your backend, otherwise ImGui will react as if the mouse is jumping around back and forth.
- ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set.
- ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the backend.
+ ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct dear imgui to disable mouse inputs and interactions.
ImGuiConfigFlags_NoMouseCursorChange = 1 << 5, // Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead.
+ ImGuiConfigFlags_NoKeyboard = 1 << 6, // Instruct dear imgui to disable keyboard inputs and interactions. This is done by ignoring keyboard events and clearing existing states.
// User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are NOT used by core Dear ImGui)
ImGuiConfigFlags_IsSRGB = 1 << 20, // Application is SRGB-aware.
ImGuiConfigFlags_IsTouchScreen = 1 << 21, // Application is using a touch screen instead of a mouse.
+
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // [moved/renamed in 1.91.4] -> use bool io.ConfigNavMoveSetMousePos
+ ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // [moved/renamed in 1.91.4] -> use bool io.ConfigNavCaptureKeyboard
+#endif
};
// Backend capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom backend.
@@ -1512,7 +1608,7 @@ enum ImGuiBackendFlags_
ImGuiBackendFlags_None = 0,
ImGuiBackendFlags_HasGamepad = 1 << 0, // Backend Platform supports gamepad and currently has one connected.
ImGuiBackendFlags_HasMouseCursors = 1 << 1, // Backend Platform supports honoring GetMouseCursor() value to change the OS cursor shape.
- ImGuiBackendFlags_HasSetMousePos = 1 << 2, // Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
+ ImGuiBackendFlags_HasSetMousePos = 1 << 2, // Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if io.ConfigNavMoveSetMousePos is set).
ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3, // Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices.
};
@@ -1529,15 +1625,15 @@ enum ImGuiCol_
ImGuiCol_FrameBg, // Background of checkbox, radio button, plot, slider, text input
ImGuiCol_FrameBgHovered,
ImGuiCol_FrameBgActive,
- ImGuiCol_TitleBg,
- ImGuiCol_TitleBgActive,
- ImGuiCol_TitleBgCollapsed,
+ ImGuiCol_TitleBg, // Title bar
+ ImGuiCol_TitleBgActive, // Title bar when focused
+ ImGuiCol_TitleBgCollapsed, // Title bar when collapsed
ImGuiCol_MenuBarBg,
ImGuiCol_ScrollbarBg,
ImGuiCol_ScrollbarGrab,
ImGuiCol_ScrollbarGrabHovered,
ImGuiCol_ScrollbarGrabActive,
- ImGuiCol_CheckMark,
+ ImGuiCol_CheckMark, // Checkbox tick and RadioButton circle
ImGuiCol_SliderGrab,
ImGuiCol_SliderGrabActive,
ImGuiCol_Button,
@@ -1552,11 +1648,13 @@ enum ImGuiCol_
ImGuiCol_ResizeGrip, // Resize grip in lower-right and lower-left corners of windows.
ImGuiCol_ResizeGripHovered,
ImGuiCol_ResizeGripActive,
- ImGuiCol_Tab, // TabItem in a TabBar
- ImGuiCol_TabHovered,
- ImGuiCol_TabActive,
- ImGuiCol_TabUnfocused,
- ImGuiCol_TabUnfocusedActive,
+ ImGuiCol_TabHovered, // Tab background, when hovered
+ ImGuiCol_Tab, // Tab background, when tab-bar is focused & tab is unselected
+ ImGuiCol_TabSelected, // Tab background, when tab-bar is focused & tab is selected
+ ImGuiCol_TabSelectedOverline, // Tab horizontal overline, when tab-bar is focused & tab is selected
+ ImGuiCol_TabDimmed, // Tab background, when tab-bar is unfocused & tab is unselected
+ ImGuiCol_TabDimmedSelected, // Tab background, when tab-bar is unfocused & tab is selected
+ ImGuiCol_TabDimmedSelectedOverline,//..horizontal overline, when tab-bar is unfocused & tab is selected
ImGuiCol_PlotLines,
ImGuiCol_PlotLinesHovered,
ImGuiCol_PlotHistogram,
@@ -1566,50 +1664,68 @@ enum ImGuiCol_
ImGuiCol_TableBorderLight, // Table inner borders (prefer using Alpha=1.0 here)
ImGuiCol_TableRowBg, // Table row background (even rows)
ImGuiCol_TableRowBgAlt, // Table row background (odd rows)
+ ImGuiCol_TextLink, // Hyperlink color
ImGuiCol_TextSelectedBg,
ImGuiCol_DragDropTarget, // Rectangle highlighting a drop target
- ImGuiCol_NavHighlight, // Gamepad/keyboard: current highlighted item
+ ImGuiCol_NavCursor, // Color of keyboard/gamepad navigation cursor/rectangle, when visible
ImGuiCol_NavWindowingHighlight, // Highlight window when using CTRL+TAB
ImGuiCol_NavWindowingDimBg, // Darken/colorize entire screen behind the CTRL+TAB window list, when active
ImGuiCol_ModalWindowDimBg, // Darken/colorize entire screen behind a modal window, when one is active
- ImGuiCol_COUNT
+ ImGuiCol_COUNT,
+
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiCol_TabActive = ImGuiCol_TabSelected, // [renamed in 1.90.9]
+ ImGuiCol_TabUnfocused = ImGuiCol_TabDimmed, // [renamed in 1.90.9]
+ ImGuiCol_TabUnfocusedActive = ImGuiCol_TabDimmedSelected, // [renamed in 1.90.9]
+ ImGuiCol_NavHighlight = ImGuiCol_NavCursor, // [renamed in 1.91.4]
+#endif
};
// Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure.
// - The enum only refers to fields of ImGuiStyle which makes sense to be pushed/popped inside UI code.
// During initialization or between frames, feel free to just poke into ImGuiStyle directly.
// - Tip: Use your programming IDE navigation facilities on the names in the _second column_ below to find the actual members and their description.
-// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
-// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
+// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
+// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments.
+// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments.
// - When changing this enum, you need to update the associated internal table GStyleVarInfo[] accordingly. This is where we link enum values to members offset/type.
enum ImGuiStyleVar_
{
- // Enum name --------------------- // Member in ImGuiStyle structure (see ImGuiStyle for descriptions)
- ImGuiStyleVar_Alpha, // float Alpha
- ImGuiStyleVar_DisabledAlpha, // float DisabledAlpha
- ImGuiStyleVar_WindowPadding, // ImVec2 WindowPadding
- ImGuiStyleVar_WindowRounding, // float WindowRounding
- ImGuiStyleVar_WindowBorderSize, // float WindowBorderSize
- ImGuiStyleVar_WindowMinSize, // ImVec2 WindowMinSize
- ImGuiStyleVar_WindowTitleAlign, // ImVec2 WindowTitleAlign
- ImGuiStyleVar_ChildRounding, // float ChildRounding
- ImGuiStyleVar_ChildBorderSize, // float ChildBorderSize
- ImGuiStyleVar_PopupRounding, // float PopupRounding
- ImGuiStyleVar_PopupBorderSize, // float PopupBorderSize
- ImGuiStyleVar_FramePadding, // ImVec2 FramePadding
- ImGuiStyleVar_FrameRounding, // float FrameRounding
- ImGuiStyleVar_FrameBorderSize, // float FrameBorderSize
- ImGuiStyleVar_ItemSpacing, // ImVec2 ItemSpacing
- ImGuiStyleVar_ItemInnerSpacing, // ImVec2 ItemInnerSpacing
- ImGuiStyleVar_IndentSpacing, // float IndentSpacing
- ImGuiStyleVar_CellPadding, // ImVec2 CellPadding
- ImGuiStyleVar_ScrollbarSize, // float ScrollbarSize
- ImGuiStyleVar_ScrollbarRounding, // float ScrollbarRounding
- ImGuiStyleVar_GrabMinSize, // float GrabMinSize
- ImGuiStyleVar_GrabRounding, // float GrabRounding
- ImGuiStyleVar_TabRounding, // float TabRounding
- ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign
- ImGuiStyleVar_SelectableTextAlign, // ImVec2 SelectableTextAlign
+ // Enum name -------------------------- // Member in ImGuiStyle structure (see ImGuiStyle for descriptions)
+ ImGuiStyleVar_Alpha, // float Alpha
+ ImGuiStyleVar_DisabledAlpha, // float DisabledAlpha
+ ImGuiStyleVar_WindowPadding, // ImVec2 WindowPadding
+ ImGuiStyleVar_WindowRounding, // float WindowRounding
+ ImGuiStyleVar_WindowBorderSize, // float WindowBorderSize
+ ImGuiStyleVar_WindowMinSize, // ImVec2 WindowMinSize
+ ImGuiStyleVar_WindowTitleAlign, // ImVec2 WindowTitleAlign
+ ImGuiStyleVar_ChildRounding, // float ChildRounding
+ ImGuiStyleVar_ChildBorderSize, // float ChildBorderSize
+ ImGuiStyleVar_PopupRounding, // float PopupRounding
+ ImGuiStyleVar_PopupBorderSize, // float PopupBorderSize
+ ImGuiStyleVar_FramePadding, // ImVec2 FramePadding
+ ImGuiStyleVar_FrameRounding, // float FrameRounding
+ ImGuiStyleVar_FrameBorderSize, // float FrameBorderSize
+ ImGuiStyleVar_ItemSpacing, // ImVec2 ItemSpacing
+ ImGuiStyleVar_ItemInnerSpacing, // ImVec2 ItemInnerSpacing
+ ImGuiStyleVar_IndentSpacing, // float IndentSpacing
+ ImGuiStyleVar_CellPadding, // ImVec2 CellPadding
+ ImGuiStyleVar_ScrollbarSize, // float ScrollbarSize
+ ImGuiStyleVar_ScrollbarRounding, // float ScrollbarRounding
+ ImGuiStyleVar_GrabMinSize, // float GrabMinSize
+ ImGuiStyleVar_GrabRounding, // float GrabRounding
+ ImGuiStyleVar_ImageBorderSize, // float ImageBorderSize
+ ImGuiStyleVar_TabRounding, // float TabRounding
+ ImGuiStyleVar_TabBorderSize, // float TabBorderSize
+ ImGuiStyleVar_TabBarBorderSize, // float TabBarBorderSize
+ ImGuiStyleVar_TabBarOverlineSize, // float TabBarOverlineSize
+ ImGuiStyleVar_TableAngledHeadersAngle, // float TableAngledHeadersAngle
+ ImGuiStyleVar_TableAngledHeadersTextAlign,// ImVec2 TableAngledHeadersTextAlign
+ ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign
+ ImGuiStyleVar_SelectableTextAlign, // ImVec2 SelectableTextAlign
+ ImGuiStyleVar_SeparatorTextBorderSize, // float SeparatorTextBorderSize
+ ImGuiStyleVar_SeparatorTextAlign, // ImVec2 SeparatorTextAlign
+ ImGuiStyleVar_SeparatorTextPadding, // ImVec2 SeparatorTextPadding
ImGuiStyleVar_COUNT
};
@@ -1620,10 +1736,8 @@ enum ImGuiButtonFlags_
ImGuiButtonFlags_MouseButtonLeft = 1 << 0, // React on left mouse button (default)
ImGuiButtonFlags_MouseButtonRight = 1 << 1, // React on right mouse button
ImGuiButtonFlags_MouseButtonMiddle = 1 << 2, // React on center mouse button
-
- // [Internal]
- ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle,
- ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft,
+ ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle, // [Internal]
+ ImGuiButtonFlags_EnableNav = 1 << 3, // InvisibleButton(): do not disable navigation/tabbing. Otherwise disabled by default.
};
// Flags for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton()
@@ -1641,10 +1755,16 @@ enum ImGuiColorEditFlags_
ImGuiColorEditFlags_NoDragDrop = 1 << 9, // // ColorEdit: disable drag and drop target. ColorButton: disable drag and drop source.
ImGuiColorEditFlags_NoBorder = 1 << 10, // // ColorButton: disable border (which is enforced by default)
+ // Alpha preview
+ // - Prior to 1.91.8 (2025/01/21): alpha was made opaque in the preview by default using old name ImGuiColorEditFlags_AlphaPreview.
+ // - We now display the preview as transparent by default. You can use ImGuiColorEditFlags_AlphaOpaque to use old behavior.
+ // - The new flags may be combined better and allow finer controls.
+ ImGuiColorEditFlags_AlphaOpaque = 1 << 11, // // ColorEdit, ColorPicker, ColorButton: disable alpha in the preview,. Contrary to _NoAlpha it may still be edited when calling ColorEdit4()/ColorPicker4(). For ColorButton() this does the same as _NoAlpha.
+ ImGuiColorEditFlags_AlphaNoBg = 1 << 12, // // ColorEdit, ColorPicker, ColorButton: disable rendering a checkerboard background behind transparent color.
+ ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 13, // // ColorEdit, ColorPicker, ColorButton: display half opaque / half transparent preview.
+
// User Options (right-click on widget to change some of them).
ImGuiColorEditFlags_AlphaBar = 1 << 16, // // ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker.
- ImGuiColorEditFlags_AlphaPreview = 1 << 17, // // ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque.
- ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 18, // // ColorEdit, ColorPicker, ColorButton: display half opaque / half checkerboard, instead of opaque.
ImGuiColorEditFlags_HDR = 1 << 19, // // (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well).
ImGuiColorEditFlags_DisplayRGB = 1 << 20, // [Display] // ColorEdit: override _display_ type among RGB/HSV/Hex. ColorPicker: select any combination using one or more of RGB/HSV/Hex.
ImGuiColorEditFlags_DisplayHSV = 1 << 21, // [Display] // "
@@ -1661,31 +1781,34 @@ enum ImGuiColorEditFlags_
ImGuiColorEditFlags_DefaultOptions_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar,
// [Internal] Masks
+ ImGuiColorEditFlags_AlphaMask_ = ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaOpaque | ImGuiColorEditFlags_AlphaNoBg | ImGuiColorEditFlags_AlphaPreviewHalf,
ImGuiColorEditFlags_DisplayMask_ = ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHex,
ImGuiColorEditFlags_DataTypeMask_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_Float,
ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar,
ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV,
- // Obsolete names (will be removed)
- // ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69]
+ // Obsolete names
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiColorEditFlags_AlphaPreview = 0, // [Removed in 1.91.8] This is the default now. Will display a checkerboard unless ImGuiColorEditFlags_AlphaNoBg is set.
+#endif
+ //ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69]
};
// Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
// We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them.
-// (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigDragClickToInputText)
+// (Those are per-item flags. There is shared behavior flag too: ImGuiIO: io.ConfigDragClickToInputText)
enum ImGuiSliderFlags_
{
- ImGuiSliderFlags_None = 0,
- ImGuiSliderFlags_AlwaysClamp = 1 << 4, // Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.
- ImGuiSliderFlags_Logarithmic = 1 << 5, // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
- ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits)
- ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget
- ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed.
-
- // Obsolete names (will be removed)
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79]
-#endif
+ ImGuiSliderFlags_None = 0,
+ ImGuiSliderFlags_Logarithmic = 1 << 5, // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
+ ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits).
+ ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget.
+ ImGuiSliderFlags_WrapAround = 1 << 8, // Enable wrapping around from max to min and from min to max. Only supported by DragXXX() functions for now.
+ ImGuiSliderFlags_ClampOnInput = 1 << 9, // Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.
+ ImGuiSliderFlags_ClampZeroRange = 1 << 10, // Clamp even if min==max==0.0f. Otherwise due to legacy reason DragXXX functions don't clamp with those values. When your clamping limits are dynamic you almost always want to use it.
+ ImGuiSliderFlags_NoSpeedTweaks = 1 << 11, // Disable keyboard modifiers altering tweak speed. Useful if you want to alter tweak speed yourself based on your own logic.
+ ImGuiSliderFlags_AlwaysClamp = ImGuiSliderFlags_ClampOnInput | ImGuiSliderFlags_ClampZeroRange,
+ ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed.
};
// Identify a mouse button.
@@ -1711,11 +1834,25 @@ enum ImGuiMouseCursor_
ImGuiMouseCursor_ResizeNESW, // When hovering over the bottom-left corner of a window
ImGuiMouseCursor_ResizeNWSE, // When hovering over the bottom-right corner of a window
ImGuiMouseCursor_Hand, // (Unused by Dear ImGui functions. Use for e.g. hyperlinks)
+ ImGuiMouseCursor_Wait, // When waiting for something to process/load.
+ ImGuiMouseCursor_Progress, // When waiting for something to process/load, but application is still interactive.
ImGuiMouseCursor_NotAllowed, // When hovering something with disallowed interaction. Usually a crossed circle.
ImGuiMouseCursor_COUNT
};
-// Enumeration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions
+// Enumeration for AddMouseSourceEvent() actual source of Mouse Input data.
+// Historically we use "Mouse" terminology everywhere to indicate pointer data, e.g. MousePos, IsMousePressed(), io.AddMousePosEvent()
+// But that "Mouse" data can come from different source which occasionally may be useful for application to know about.
+// You can submit a change of pointer type using io.AddMouseSourceEvent().
+enum ImGuiMouseSource : int
+{
+ ImGuiMouseSource_Mouse = 0, // Input is coming from an actual mouse.
+ ImGuiMouseSource_TouchScreen, // Input is coming from a touch screen (no hovering prior to initial press, less precise initial press aiming, dual-axis wheeling possible).
+ ImGuiMouseSource_Pen, // Input is coming from a pressure/magnetic pen (often used in conjunction with high-sampling rates).
+ ImGuiMouseSource_COUNT
+};
+
+// Enumeration for ImGui::SetNextWindow***(), SetWindow***(), SetNextItem***() functions
// Represent a condition.
// Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.
enum ImGuiCond_
@@ -1728,10 +1865,184 @@ enum ImGuiCond_
};
//-----------------------------------------------------------------------------
-// [SECTION] Helpers: Memory allocations macros, ImVector<>
+// [SECTION] Tables API flags and structures (ImGuiTableFlags, ImGuiTableColumnFlags, ImGuiTableRowFlags, ImGuiTableBgTarget, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs)
+//-----------------------------------------------------------------------------
+
+// Flags for ImGui::BeginTable()
+// - Important! Sizing policies have complex and subtle side effects, much more so than you would expect.
+// Read comments/demos carefully + experiment with live demos to get acquainted with them.
+// - The DEFAULT sizing policies are:
+// - Default to ImGuiTableFlags_SizingFixedFit if ScrollX is on, or if host window has ImGuiWindowFlags_AlwaysAutoResize.
+// - Default to ImGuiTableFlags_SizingStretchSame if ScrollX is off.
+// - When ScrollX is off:
+// - Table defaults to ImGuiTableFlags_SizingStretchSame -> all Columns defaults to ImGuiTableColumnFlags_WidthStretch with same weight.
+// - Columns sizing policy allowed: Stretch (default), Fixed/Auto.
+// - Fixed Columns (if any) will generally obtain their requested width (unless the table cannot fit them all).
+// - Stretch Columns will share the remaining width according to their respective weight.
+// - Mixed Fixed/Stretch columns is possible but has various side-effects on resizing behaviors.
+// The typical use of mixing sizing policies is: any number of LEADING Fixed columns, followed by one or two TRAILING Stretch columns.
+// (this is because the visible order of columns have subtle but necessary effects on how they react to manual resizing).
+// - When ScrollX is on:
+// - Table defaults to ImGuiTableFlags_SizingFixedFit -> all Columns defaults to ImGuiTableColumnFlags_WidthFixed
+// - Columns sizing policy allowed: Fixed/Auto mostly.
+// - Fixed Columns can be enlarged as needed. Table will show a horizontal scrollbar if needed.
+// - When using auto-resizing (non-resizable) fixed columns, querying the content width to use item right-alignment e.g. SetNextItemWidth(-FLT_MIN) doesn't make sense, would create a feedback loop.
+// - Using Stretch columns OFTEN DOES NOT MAKE SENSE if ScrollX is on, UNLESS you have specified a value for 'inner_width' in BeginTable().
+// If you specify a value for 'inner_width' then effectively the scrolling space is known and Stretch or mixed Fixed/Stretch columns become meaningful again.
+// - Read on documentation at the top of imgui_tables.cpp for details.
+enum ImGuiTableFlags_
+{
+ // Features
+ ImGuiTableFlags_None = 0,
+ ImGuiTableFlags_Resizable = 1 << 0, // Enable resizing columns.
+ ImGuiTableFlags_Reorderable = 1 << 1, // Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers)
+ ImGuiTableFlags_Hideable = 1 << 2, // Enable hiding/disabling columns in context menu.
+ ImGuiTableFlags_Sortable = 1 << 3, // Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see ImGuiTableFlags_SortMulti and ImGuiTableFlags_SortTristate.
+ ImGuiTableFlags_NoSavedSettings = 1 << 4, // Disable persisting columns order, width and sort settings in the .ini file.
+ ImGuiTableFlags_ContextMenuInBody = 1 << 5, // Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
+ // Decorations
+ ImGuiTableFlags_RowBg = 1 << 6, // Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
+ ImGuiTableFlags_BordersInnerH = 1 << 7, // Draw horizontal borders between rows.
+ ImGuiTableFlags_BordersOuterH = 1 << 8, // Draw horizontal borders at the top and bottom.
+ ImGuiTableFlags_BordersInnerV = 1 << 9, // Draw vertical borders between columns.
+ ImGuiTableFlags_BordersOuterV = 1 << 10, // Draw vertical borders on the left and right sides.
+ ImGuiTableFlags_BordersH = ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterH, // Draw horizontal borders.
+ ImGuiTableFlags_BordersV = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersOuterV, // Draw vertical borders.
+ ImGuiTableFlags_BordersInner = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH, // Draw inner borders.
+ ImGuiTableFlags_BordersOuter = ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH, // Draw outer borders.
+ ImGuiTableFlags_Borders = ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter, // Draw all borders.
+ ImGuiTableFlags_NoBordersInBody = 1 << 11, // [ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style
+ ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 12, // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style
+ // Sizing Policy (read above for defaults)
+ ImGuiTableFlags_SizingFixedFit = 1 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width.
+ ImGuiTableFlags_SizingFixedSame = 2 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible.
+ ImGuiTableFlags_SizingStretchProp = 3 << 13, // Columns default to _WidthStretch with default weights proportional to each columns contents widths.
+ ImGuiTableFlags_SizingStretchSame = 4 << 13, // Columns default to _WidthStretch with default weights all equal, unless overridden by TableSetupColumn().
+ // Sizing Extra Options
+ ImGuiTableFlags_NoHostExtendX = 1 << 16, // Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
+ ImGuiTableFlags_NoHostExtendY = 1 << 17, // Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible.
+ ImGuiTableFlags_NoKeepColumnsVisible = 1 << 18, // Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable.
+ ImGuiTableFlags_PreciseWidths = 1 << 19, // Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
+ // Clipping
+ ImGuiTableFlags_NoClip = 1 << 20, // Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
+ // Padding
+ ImGuiTableFlags_PadOuterX = 1 << 21, // Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers.
+ ImGuiTableFlags_NoPadOuterX = 1 << 22, // Default if BordersOuterV is off. Disable outermost padding.
+ ImGuiTableFlags_NoPadInnerX = 1 << 23, // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
+ // Scrolling
+ ImGuiTableFlags_ScrollX = 1 << 24, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX.
+ ImGuiTableFlags_ScrollY = 1 << 25, // Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
+ // Sorting
+ ImGuiTableFlags_SortMulti = 1 << 26, // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
+ ImGuiTableFlags_SortTristate = 1 << 27, // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
+ // Miscellaneous
+ ImGuiTableFlags_HighlightHoveredColumn = 1 << 28, // Highlight column headers when hovered (may evolve into a fuller highlight)
+
+ // [Internal] Combinations and masks
+ ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame,
+};
+
+// Flags for ImGui::TableSetupColumn()
+enum ImGuiTableColumnFlags_
+{
+ // Input configuration flags
+ ImGuiTableColumnFlags_None = 0,
+ ImGuiTableColumnFlags_Disabled = 1 << 0, // Overriding/master disable flag: hide column, won't show in context menu (unlike calling TableSetColumnEnabled() which manipulates the user accessible state)
+ ImGuiTableColumnFlags_DefaultHide = 1 << 1, // Default as a hidden/disabled column.
+ ImGuiTableColumnFlags_DefaultSort = 1 << 2, // Default as a sorting column.
+ ImGuiTableColumnFlags_WidthStretch = 1 << 3, // Column will stretch. Preferable with horizontal scrolling disabled (default if table sizing policy is _SizingStretchSame or _SizingStretchProp).
+ ImGuiTableColumnFlags_WidthFixed = 1 << 4, // Column will not stretch. Preferable with horizontal scrolling enabled (default if table sizing policy is _SizingFixedFit and table is resizable).
+ ImGuiTableColumnFlags_NoResize = 1 << 5, // Disable manual resizing.
+ ImGuiTableColumnFlags_NoReorder = 1 << 6, // Disable manual reordering this column, this will also prevent other columns from crossing over this column.
+ ImGuiTableColumnFlags_NoHide = 1 << 7, // Disable ability to hide/disable this column.
+ ImGuiTableColumnFlags_NoClip = 1 << 8, // Disable clipping for this column (all NoClip columns will render in a same draw command).
+ ImGuiTableColumnFlags_NoSort = 1 << 9, // Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table).
+ ImGuiTableColumnFlags_NoSortAscending = 1 << 10, // Disable ability to sort in the ascending direction.
+ ImGuiTableColumnFlags_NoSortDescending = 1 << 11, // Disable ability to sort in the descending direction.
+ ImGuiTableColumnFlags_NoHeaderLabel = 1 << 12, // TableHeadersRow() will submit an empty label for this column. Convenient for some small columns. Name will still appear in context menu or in angled headers. You may append into this cell by calling TableSetColumnIndex() right after the TableHeadersRow() call.
+ ImGuiTableColumnFlags_NoHeaderWidth = 1 << 13, // Disable header text width contribution to automatic column width.
+ ImGuiTableColumnFlags_PreferSortAscending = 1 << 14, // Make the initial sort direction Ascending when first sorting on this column (default).
+ ImGuiTableColumnFlags_PreferSortDescending = 1 << 15, // Make the initial sort direction Descending when first sorting on this column.
+ ImGuiTableColumnFlags_IndentEnable = 1 << 16, // Use current Indent value when entering cell (default for column 0).
+ ImGuiTableColumnFlags_IndentDisable = 1 << 17, // Ignore current Indent value when entering cell (default for columns > 0). Indentation changes _within_ the cell will still be honored.
+ ImGuiTableColumnFlags_AngledHeader = 1 << 18, // TableHeadersRow() will submit an angled header row for this column. Note this will add an extra row.
+
+ // Output status flags, read-only via TableGetColumnFlags()
+ ImGuiTableColumnFlags_IsEnabled = 1 << 24, // Status: is enabled == not hidden by user/api (referred to as "Hide" in _DefaultHide and _NoHide) flags.
+ ImGuiTableColumnFlags_IsVisible = 1 << 25, // Status: is visible == is enabled AND not clipped by scrolling.
+ ImGuiTableColumnFlags_IsSorted = 1 << 26, // Status: is currently part of the sort specs
+ ImGuiTableColumnFlags_IsHovered = 1 << 27, // Status: is hovered by mouse
+
+ // [Internal] Combinations and masks
+ ImGuiTableColumnFlags_WidthMask_ = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_WidthFixed,
+ ImGuiTableColumnFlags_IndentMask_ = ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_IndentDisable,
+ ImGuiTableColumnFlags_StatusMask_ = ImGuiTableColumnFlags_IsEnabled | ImGuiTableColumnFlags_IsVisible | ImGuiTableColumnFlags_IsSorted | ImGuiTableColumnFlags_IsHovered,
+ ImGuiTableColumnFlags_NoDirectResize_ = 1 << 30, // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge)
+};
+
+// Flags for ImGui::TableNextRow()
+enum ImGuiTableRowFlags_
+{
+ ImGuiTableRowFlags_None = 0,
+ ImGuiTableRowFlags_Headers = 1 << 0, // Identify header row (set default background color + width of its contents accounted differently for auto column width)
+};
+
+// Enum for ImGui::TableSetBgColor()
+// Background colors are rendering in 3 layers:
+// - Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set.
+// - Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set.
+// - Layer 2: draw with CellBg color if set.
+// The purpose of the two row/columns layers is to let you decide if a background color change should override or blend with the existing color.
+// When using ImGuiTableFlags_RowBg on the table, each row has the RowBg0 color automatically set for odd/even rows.
+// If you set the color of RowBg0 target, your color will override the existing RowBg0 color.
+// If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color.
+enum ImGuiTableBgTarget_
+{
+ ImGuiTableBgTarget_None = 0,
+ ImGuiTableBgTarget_RowBg0 = 1, // Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
+ ImGuiTableBgTarget_RowBg1 = 2, // Set row background color 1 (generally used for selection marking)
+ ImGuiTableBgTarget_CellBg = 3, // Set cell background color (top-most color)
+};
+
+// Sorting specifications for a table (often handling sort specs for a single column, occasionally more)
+// Obtained by calling TableGetSortSpecs().
+// When 'SpecsDirty == true' you can sort your data. It will be true with sorting specs have changed since last call, or the first time.
+// Make sure to set 'SpecsDirty = false' after sorting, else you may wastefully sort your data every frame!
+struct ImGuiTableSortSpecs
+{
+ const ImGuiTableColumnSortSpecs* Specs; // Pointer to sort spec array.
+ int SpecsCount; // Sort spec count. Most often 1. May be > 1 when ImGuiTableFlags_SortMulti is enabled. May be == 0 when ImGuiTableFlags_SortTristate is enabled.
+ bool SpecsDirty; // Set to true when specs have changed since last time! Use this to sort again, then clear the flag.
+
+ ImGuiTableSortSpecs() { memset(this, 0, sizeof(*this)); }
+};
+
+// Sorting specification for one column of a table (sizeof == 12 bytes)
+struct ImGuiTableColumnSortSpecs
+{
+ ImGuiID ColumnUserID; // User id of the column (if specified by a TableSetupColumn() call)
+ ImS16 ColumnIndex; // Index of the column
+ ImS16 SortOrder; // Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here)
+ ImGuiSortDirection SortDirection; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
+
+ ImGuiTableColumnSortSpecs() { memset(this, 0, sizeof(*this)); }
+};
+
+//-----------------------------------------------------------------------------
+// [SECTION] Helpers: Debug log, memory allocations macros, ImVector<>
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+// Debug Logging into ShowDebugLogWindow(), tty and more.
+//-----------------------------------------------------------------------------
+
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+#define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__)
+#else
+#define IMGUI_DEBUG_LOG(...) ((void)0)
+#endif
+
+//-----------------------------------------------------------------------------
// IM_MALLOC(), IM_FREE(), IM_NEW(), IM_PLACEMENT_NEW(), IM_DELETE()
// We call C++ constructor on own allocated memory via the placement "new(ptr) Type()" syntax.
// Defining a custom placement new() with a custom parameter allows us to bypass including <new> which on some platforms complains when user has disabled exceptions.
@@ -1816,6 +2127,7 @@ struct ImVector
inline bool contains(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; }
inline T* find(const T& v) { T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data == v) break; else ++data; return data; }
inline const T* find(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data == v) break; else ++data; return data; }
+ inline int find_index(const T& v) const { const T* data_end = Data + Size; const T* it = find(v); if (it == data_end) return -1; const ptrdiff_t off = it - Data; return (int)off; }
inline bool find_erase(const T& v) { const T* it = find(v); if (it < Data + Size) { erase(it); return true; } return false; }
inline bool find_erase_unsorted(const T& v) { const T* it = find(v); if (it < Data + Size) { erase_unsorted(it); return true; } return false; }
inline int index_from_ptr(const T* it) const { IM_ASSERT(it >= Data && it < Data + Size); const ptrdiff_t off = it - Data; return (int)off; }
@@ -1837,6 +2149,7 @@ struct ImGuiStyle
ImVec2 WindowPadding; // Padding within a window.
float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.
float WindowBorderSize; // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
+ float WindowBorderHoverPadding; // Hit-testing extent outside/inside resizing border. Also extend determination of hovered window. Generally meaningfully larger than WindowBorderSize to make it easy to reach borders.
ImVec2 WindowMinSize; // Minimum window size. This is a global setting. If you want to constrain individual windows, use SetNextWindowSizeConstraints().
ImVec2 WindowTitleAlign; // Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
ImGuiDir WindowMenuButtonPosition; // Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left.
@@ -1849,7 +2162,7 @@ struct ImGuiStyle
float FrameBorderSize; // Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines.
ImVec2 ItemInnerSpacing; // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
- ImVec2 CellPadding; // Padding within a table cell
+ ImVec2 CellPadding; // Padding within a table cell. Cellpadding.x is locked for entire table. CellPadding.y may be altered between different rows.
ImVec2 TouchExtraPadding; // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
float IndentSpacing; // Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
float ColumnsMinSpacing; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
@@ -1858,24 +2171,48 @@ struct ImGuiStyle
float GrabMinSize; // Minimum width/height of a grab box for slider/scrollbar.
float GrabRounding; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
float LogSliderDeadzone; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
+ float ImageBorderSize; // Thickness of border around Image() calls.
float TabRounding; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
float TabBorderSize; // Thickness of border around tabs.
- float TabMinWidthForCloseButton; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
+ float TabCloseButtonMinWidthSelected; // -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width.
+ float TabCloseButtonMinWidthUnselected; // -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width. FLT_MAX: never show close button when unselected.
+ float TabBarBorderSize; // Thickness of tab-bar separator, which takes on the tab active color to denote focus.
+ float TabBarOverlineSize; // Thickness of tab-bar overline, which highlights the selected tab-bar.
+ float TableAngledHeadersAngle; // Angle of angled headers (supported values range from -50.0f degrees to +50.0f degrees).
+ ImVec2 TableAngledHeadersTextAlign;// Alignment of angled headers within the cell
ImGuiDir ColorButtonPosition; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).
ImVec2 SelectableTextAlign; // Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
- ImVec2 DisplayWindowPadding; // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows.
- ImVec2 DisplaySafeAreaPadding; // If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly!
- float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
+ float SeparatorTextBorderSize; // Thickness of border in SeparatorText()
+ ImVec2 SeparatorTextAlign; // Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
+ ImVec2 SeparatorTextPadding; // Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y.
+ ImVec2 DisplayWindowPadding; // Apply to regular windows: amount which we enforce to keep visible when moving near edges of your screen.
+ ImVec2 DisplaySafeAreaPadding; // Apply to every windows, menus, popups, tooltips: amount where we avoid displaying contents. Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).
+ float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). We apply per-monitor DPI scaling over this scale. May be removed later.
bool AntiAliasedLines; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).
bool AntiAliasedLinesUseTex; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering). Latched at the beginning of the frame (copied to ImDrawList).
bool AntiAliasedFill; // Enable anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
float CircleTessellationMaxError; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.
+
+ // Colors
ImVec4 Colors[ImGuiCol_COUNT];
+ // Behaviors
+ // (It is possible to modify those fields mid-frame if specific behavior need it, unlike e.g. configuration fields in ImGuiIO)
+ float HoverStationaryDelay; // Delay for IsItemHovered(ImGuiHoveredFlags_Stationary). Time required to consider mouse stationary.
+ float HoverDelayShort; // Delay for IsItemHovered(ImGuiHoveredFlags_DelayShort). Usually used along with HoverStationaryDelay.
+ float HoverDelayNormal; // Delay for IsItemHovered(ImGuiHoveredFlags_DelayNormal). "
+ ImGuiHoveredFlags HoverFlagsForTooltipMouse;// Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using mouse.
+ ImGuiHoveredFlags HoverFlagsForTooltipNav; // Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using keyboard/gamepad.
+
IMGUI_API ImGuiStyle();
IMGUI_API void ScaleAllSizes(float scale_factor);
+
+ // Obsolete names
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ // TabMinWidthForCloseButton = TabCloseButtonMinWidthUnselected // Renamed in 1.91.9.
+#endif
};
//-----------------------------------------------------------------------------
@@ -1883,6 +2220,11 @@ struct ImGuiStyle
//-----------------------------------------------------------------------------
// Communicate most settings and inputs/outputs to Dear ImGui using this structure.
// Access via ImGui::GetIO(). Read 'Programmer guide' section in .cpp file for general usage.
+// It is generally expected that:
+// - initialization: backends and user code writes to ImGuiIO.
+// - main loop: backends writes to ImGuiIO, user code and imgui code reads from ImGuiIO.
+//-----------------------------------------------------------------------------
+// Also see ImGui::GetPlatformIO() and ImGuiPlatformIO struct for OS/platform related functions: clipboard, IME etc.
//-----------------------------------------------------------------------------
// [Internal] Storage used by IsKeyDown(), IsKeyPressed() etc functions.
@@ -1901,44 +2243,110 @@ struct ImGuiIO
// Configuration // Default value
//------------------------------------------------------------------
- ImGuiConfigFlags ConfigFlags; // = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc.
+ ImGuiConfigFlags ConfigFlags; // = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Keyboard/Gamepad navigation options, etc.
ImGuiBackendFlags BackendFlags; // = 0 // See ImGuiBackendFlags_ enum. Set by backend (imgui_impl_xxx files or custom backend) to communicate features supported by the backend.
ImVec2 DisplaySize; // <unset> // Main display size, in pixels (generally == GetMainViewport()->Size). May change every frame.
float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds. May change every frame.
float IniSavingRate; // = 5.0f // Minimum time between saving positions/sizes to .ini file, in seconds.
const char* IniFilename; // = "imgui.ini" // Path to .ini file (important: default "imgui.ini" is relative to current working dir!). Set NULL to disable automatic .ini loading/saving or if you want to manually call LoadIniSettingsXXX() / SaveIniSettingsXXX() functions.
const char* LogFilename; // = "imgui_log.txt"// Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
- float MouseDoubleClickTime; // = 0.30f // Time for a double-click, in seconds.
- float MouseDoubleClickMaxDist; // = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
- float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging.
- float KeyRepeatDelay; // = 0.275f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
- float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
- float HoverDelayNormal; // = 0.30 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayNormal) returns true.
- float HoverDelayShort; // = 0.10 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayShort) returns true.
- void* UserData; // = NULL // Store your own data for retrieval by callbacks.
+ void* UserData; // = NULL // Store your own data.
+ // Font system
ImFontAtlas*Fonts; // <auto> // Font atlas: load, rasterize and pack one or more fonts into a single texture.
float FontGlobalScale; // = 1.0f // Global scale all fonts
- bool FontAllowUserScaling; // = false // Allow user scaling text of individual window with CTRL+Wheel.
+ bool FontAllowUserScaling; // = false // [OBSOLETE] Allow user scaling text of individual window with CTRL+Wheel.
ImFont* FontDefault; // = NULL // Font to use on NewFrame(). Use NULL to uses Fonts->Fonts[0].
ImVec2 DisplayFramebufferScale; // = (1, 1) // For retina display or other situations where window coordinates are different from framebuffer coordinates. This generally ends up in ImDrawData::FramebufferScale.
+ // Keyboard/Gamepad Navigation options
+ bool ConfigNavSwapGamepadButtons; // = false // Swap Activate<>Cancel (A<>B) buttons, matching typical "Nintendo/Japanese style" gamepad layout.
+ bool ConfigNavMoveSetMousePos; // = false // Directional/tabbing navigation teleports the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is difficult. Will update io.MousePos and set io.WantSetMousePos=true.
+ bool ConfigNavCaptureKeyboard; // = true // Sets io.WantCaptureKeyboard when io.NavActive is set.
+ bool ConfigNavEscapeClearFocusItem; // = true // Pressing Escape can clear focused item + navigation id/highlight. Set to false if you want to always keep highlight on.
+ bool ConfigNavEscapeClearFocusWindow;// = false // Pressing Escape can clear focused window as well (super set of io.ConfigNavEscapeClearFocusItem).
+ bool ConfigNavCursorVisibleAuto; // = true // Using directional navigation key makes the cursor visible. Mouse click hides the cursor.
+ bool ConfigNavCursorVisibleAlways; // = false // Navigation cursor is always visible.
+
// Miscellaneous options
+ // (you can visualize and interact with all options in 'Demo->Configuration')
bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations.
- bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl.
+ bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // Swap Cmd<>Ctrl keys + OS X style text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl.
bool ConfigInputTrickleEventQueue; // = true // Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates.
bool ConfigInputTextCursorBlink; // = true // Enable blinking cursor (optional as some users consider it to be distracting).
bool ConfigInputTextEnterKeepActive; // = false // [BETA] Pressing Enter will keep item active and select contents (single-line only).
bool ConfigDragClickToInputText; // = false // [BETA] Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving). Not desirable on devices without a keyboard.
- bool ConfigWindowsResizeFromEdges; // = true // Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag)
- bool ConfigWindowsMoveFromTitleBarOnly; // = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar.
+ bool ConfigWindowsResizeFromEdges; // = true // Enable resizing of windows from their edges and from the lower-left corner. This requires ImGuiBackendFlags_HasMouseCursors for better mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag)
+ bool ConfigWindowsMoveFromTitleBarOnly; // = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar.
+ bool ConfigWindowsCopyContentsWithCtrlC; // = false // [EXPERIMENTAL] CTRL+C copy the contents of focused window into the clipboard. Experimental because: (1) has known issues with nested Begin/End pairs (2) text output quality varies (3) text output is in submission order rather than spatial order.
+ bool ConfigScrollbarScrollByPage; // = true // Enable scrolling page by page when clicking outside the scrollbar grab. When disabled, always scroll to clicked location. When enabled, Shift+Click scrolls to clicked location.
float ConfigMemoryCompactTimer; // = 60.0f // Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable.
+ // Inputs Behaviors
+ // (other variables, ones which are expected to be tweaked within UI code, are exposed in ImGuiStyle)
+ float MouseDoubleClickTime; // = 0.30f // Time for a double-click, in seconds.
+ float MouseDoubleClickMaxDist; // = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
+ float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging.
+ float KeyRepeatDelay; // = 0.275f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
+ float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
+
+ //------------------------------------------------------------------
+ // Debug options
+ //------------------------------------------------------------------
+
+ // Options to configure Error Handling and how we handle recoverable errors [EXPERIMENTAL]
+ // - Error recovery is provided as a way to facilitate:
+ // - Recovery after a programming error (native code or scripting language - the later tends to facilitate iterating on code while running).
+ // - Recovery after running an exception handler or any error processing which may skip code after an error has been detected.
+ // - Error recovery is not perfect nor guaranteed! It is a feature to ease development.
+ // You not are not supposed to rely on it in the course of a normal application run.
+ // - Functions that support error recovery are using IM_ASSERT_USER_ERROR() instead of IM_ASSERT().
+ // - By design, we do NOT allow error recovery to be 100% silent. One of the three options needs to be checked!
+ // - Always ensure that on programmers seats you have at minimum Asserts or Tooltips enabled when making direct imgui API calls!
+ // Otherwise it would severely hinder your ability to catch and correct mistakes!
+ // Read https://github.com/ocornut/imgui/wiki/Error-Handling for details.
+ // - Programmer seats: keep asserts (default), or disable asserts and keep error tooltips (new and nice!)
+ // - Non-programmer seats: maybe disable asserts, but make sure errors are resurfaced (tooltips, visible log entries, use callback etc.)
+ // - Recovery after error/exception: record stack sizes with ErrorRecoveryStoreState(), disable assert, set log callback (to e.g. trigger high-level breakpoint), recover with ErrorRecoveryTryToRecoverState(), restore settings.
+ bool ConfigErrorRecovery; // = true // Enable error recovery support. Some errors won't be detected and lead to direct crashes if recovery is disabled.
+ bool ConfigErrorRecoveryEnableAssert; // = true // Enable asserts on recoverable error. By default call IM_ASSERT() when returning from a failing IM_ASSERT_USER_ERROR()
+ bool ConfigErrorRecoveryEnableDebugLog; // = true // Enable debug log output on recoverable errors.
+ bool ConfigErrorRecoveryEnableTooltip; // = true // Enable tooltip on recoverable errors. The tooltip include a way to enable asserts if they were disabled.
+
+ // Option to enable various debug tools showing buttons that will call the IM_DEBUG_BREAK() macro.
+ // - The Item Picker tool will be available regardless of this being enabled, in order to maximize its discoverability.
+ // - Requires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application.
+ // e.g. io.ConfigDebugIsDebuggerPresent = ::IsDebuggerPresent() on Win32, or refer to ImOsIsDebuggerPresent() imgui_test_engine/imgui_te_utils.cpp for a Unix compatible version).
+ bool ConfigDebugIsDebuggerPresent; // = false // Enable various tools calling IM_DEBUG_BREAK().
+
+ // Tools to detect code submitting items with conflicting/duplicate IDs
+ // - Code should use PushID()/PopID() in loops, or append "##xx" to same-label identifiers.
+ // - Empty label e.g. Button("") == same ID as parent widget/node. Use Button("##xx") instead!
+ // - See FAQ https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-about-the-id-stack-system
+ bool ConfigDebugHighlightIdConflicts;// = true // Highlight and show an error message popup when multiple items have conflicting identifiers.
+ bool ConfigDebugHighlightIdConflictsShowItemPicker;//=true // Show "Item Picker" button in aforementioned popup.
+
+ // Tools to test correct Begin/End and BeginChild/EndChild behaviors.
+ // - Presently Begin()/End() and BeginChild()/EndChild() needs to ALWAYS be called in tandem, regardless of return value of BeginXXX()
+ // - This is inconsistent with other BeginXXX functions and create confusion for many users.
+ // - We expect to update the API eventually. In the meanwhile we provide tools to facilitate checking user-code behavior.
+ bool ConfigDebugBeginReturnValueOnce;// = false // First-time calls to Begin()/BeginChild() will return false. NEEDS TO BE SET AT APPLICATION BOOT TIME if you don't want to miss windows.
+ bool ConfigDebugBeginReturnValueLoop;// = false // Some calls to Begin()/BeginChild() will return false. Will cycle through window depths then repeat. Suggested use: add "io.ConfigDebugBeginReturnValue = io.KeyShift" in your main loop then occasionally press SHIFT. Windows should be flickering while running.
+
+ // Option to deactivate io.AddFocusEvent(false) handling.
+ // - May facilitate interactions with a debugger when focus loss leads to clearing inputs data.
+ // - Backends may have other side-effects on focus loss, so this will reduce side-effects but not necessary remove all of them.
+ bool ConfigDebugIgnoreFocusLoss; // = false // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys()/io.ClearInputMouse() in input processing.
+
+ // Option to audit .ini data
+ bool ConfigDebugIniSettings; // = false // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower)
+
//------------------------------------------------------------------
- // Platform Functions
+ // Platform Identifiers
// (the imgui_impl_xxxx backend files are setting those up for you)
//------------------------------------------------------------------
+ // Nowadays those would be stored in ImGuiPlatformIO but we are leaving them here for legacy reasons.
// Optional: Platform/Renderer backend name (informational only! will be displayed in About Window) + User data for backend/wrappers to store their own stuff.
const char* BackendPlatformName; // = NULL
const char* BackendRendererName; // = NULL
@@ -1946,21 +2354,6 @@ struct ImGuiIO
void* BackendRendererUserData; // = NULL // User data for renderer backend
void* BackendLanguageUserData; // = NULL // User data for non C++ programming language backend
- // Optional: Access OS clipboard
- // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
- const char* (*GetClipboardTextFn)(void* user_data);
- void (*SetClipboardTextFn)(void* user_data, const char* text);
- void* ClipboardUserData;
-
- // Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows)
- // (default to use native imm32 api on Windows)
- void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data);
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- void* ImeWindowHandle; // = NULL // [Obsolete] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning.
-#else
- void* _UnusedPadding; // Unused field to keep data structure the same size.
-#endif
-
//------------------------------------------------------------------
// Input - Call before calling NewFrame()
//------------------------------------------------------------------
@@ -1970,7 +2363,8 @@ struct ImGuiIO
IMGUI_API void AddKeyAnalogEvent(ImGuiKey key, bool down, float v); // Queue a new key down/up event for analog values (e.g. ImGuiKey_Gamepad_ values). Dead-zones should be handled by the backend.
IMGUI_API void AddMousePosEvent(float x, float y); // Queue a mouse position update. Use -FLT_MAX,-FLT_MAX to signify no mouse (e.g. app not focused and not hovered)
IMGUI_API void AddMouseButtonEvent(int button, bool down); // Queue a mouse button change
- IMGUI_API void AddMouseWheelEvent(float wh_x, float wh_y); // Queue a mouse wheel update
+ IMGUI_API void AddMouseWheelEvent(float wheel_x, float wheel_y); // Queue a mouse wheel update. wheel_y<0: scroll down, wheel_y>0: scroll up, wheel_x<0: scroll right, wheel_x>0: scroll left.
+ IMGUI_API void AddMouseSourceEvent(ImGuiMouseSource source); // Queue a mouse source change (Mouse/TouchScreen/Pen)
IMGUI_API void AddFocusEvent(bool focused); // Queue a gain/loss of focus for the application (generally based on OS/platform focus of your window)
IMGUI_API void AddInputCharacter(unsigned int c); // Queue a new character input
IMGUI_API void AddInputCharacterUTF16(ImWchar16 c); // Queue a new character input from a UTF-16 character, it can be a surrogate
@@ -1978,8 +2372,12 @@ struct ImGuiIO
IMGUI_API void SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index = -1); // [Optional] Specify index for legacy <1.87 IsKeyXXX() functions with native indices + specify native keycode, scancode.
IMGUI_API void SetAppAcceptingEvents(bool accepting_events); // Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen.
- IMGUI_API void ClearInputCharacters(); // [Internal] Clear the text input buffer manually
- IMGUI_API void ClearInputKeys(); // [Internal] Release all keys
+ IMGUI_API void ClearEventsQueue(); // Clear all incoming events.
+ IMGUI_API void ClearInputKeys(); // Clear current keyboard/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.
+ IMGUI_API void ClearInputMouse(); // Clear current mouse state.
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ IMGUI_API void ClearInputCharacters(); // [Obsoleted in 1.89.8] Clear the current frame text input buffer. Now included within ClearInputKeys().
+#endif
//------------------------------------------------------------------
// Output - Updated by NewFrame() or EndFrame()/Render()
@@ -1990,46 +2388,39 @@ struct ImGuiIO
bool WantCaptureMouse; // Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.).
bool WantCaptureKeyboard; // Set when Dear ImGui will use keyboard inputs, in this case do not dispatch them to your main game/application (either way, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.).
bool WantTextInput; // Mobile/console: when set, you may display an on-screen keyboard. This is set by Dear ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
- bool WantSetMousePos; // MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
+ bool WantSetMousePos; // MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when io.ConfigNavMoveSetMousePos is enabled.
bool WantSaveIniSettings; // When manual .ini load/save is active (io.IniFilename == NULL), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. Important: clear io.WantSaveIniSettings yourself after saving!
bool NavActive; // Keyboard/Gamepad navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
- bool NavVisible; // Keyboard/Gamepad navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
+ bool NavVisible; // Keyboard/Gamepad navigation highlight is visible and allowed (will handle ImGuiKey_NavXXX events).
float Framerate; // Estimate of application framerate (rolling average over 60 frames, based on io.DeltaTime), in frame per second. Solely for convenience. Slow applications may not want to use a moving average or may want to reset underlying buffers occasionally.
int MetricsRenderVertices; // Vertices output during last call to Render()
int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3
int MetricsRenderWindows; // Number of visible windows
int MetricsActiveWindows; // Number of active windows
- int MetricsActiveAllocations; // Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.
ImVec2 MouseDelta; // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta.
- // Legacy: before 1.87, we required backend to fill io.KeyMap[] (imgui->native map) during initialization and io.KeysDown[] (native indices) every frame.
- // This is still temporarily supported as a legacy feature. However the new preferred scheme is for backend to call io.AddKeyEvent().
- // Old (<1.87): ImGui::IsKeyPressed(ImGui::GetIO().KeyMap[ImGuiKey_Space]) --> New (1.87+) ImGui::IsKeyPressed(ImGuiKey_Space)
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- int KeyMap[ImGuiKey_COUNT]; // [LEGACY] Input: map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. The first 512 are now unused and should be kept zero. Legacy backend will write into KeyMap[] using ImGuiKey_ indices which are always >512.
- bool KeysDown[ImGuiKey_COUNT]; // [LEGACY] Input: Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow.
- float NavInputs[ImGuiNavInput_COUNT]; // [LEGACY] Since 1.88, NavInputs[] was removed. Backends from 1.60 to 1.86 won't build. Feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
-#endif
-
//------------------------------------------------------------------
// [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed!
//------------------------------------------------------------------
+ ImGuiContext* Ctx; // Parent UI context (needs to be set explicitly by parent).
+
// Main Input State
// (this block used to be written by backend, since 1.87 it is best to NOT write to those directly, call the AddXXX functions above instead)
// (reading from those variables is fair game, as they are extremely unlikely to be moving anywhere)
ImVec2 MousePos; // Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.)
bool MouseDown[5]; // Mouse buttons: 0=left, 1=right, 2=middle + extras (ImGuiMouseButton_COUNT == 5). Dear ImGui mostly uses left and right buttons. Other buttons allow us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
- float MouseWheel; // Mouse wheel Vertical: 1 unit scrolls about 5 lines text.
- float MouseWheelH; // Mouse wheel Horizontal. Most users don't have a mouse with a horizontal wheel, may not be filled by all backends.
+ float MouseWheel; // Mouse wheel Vertical: 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down. Hold SHIFT to turn vertical scroll into horizontal scroll.
+ float MouseWheelH; // Mouse wheel Horizontal. >0 scrolls Left, <0 scrolls Right. Most users don't have a mouse with a horizontal wheel, may not be filled by all backends.
+ ImGuiMouseSource MouseSource; // Mouse actual input peripheral (Mouse/TouchScreen/Pen).
bool KeyCtrl; // Keyboard modifier down: Control
bool KeyShift; // Keyboard modifier down: Shift
bool KeyAlt; // Keyboard modifier down: Alt
bool KeySuper; // Keyboard modifier down: Cmd/Super/Windows
// Other state maintained from data above + IO function calls
- ImGuiKeyChord KeyMods; // Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags). Read-only, updated by NewFrame()
- ImGuiKeyData KeysData[ImGuiKey_KeysData_SIZE]; // Key state for all known keys. Use IsKeyXXX() functions to access this.
+ ImGuiKeyChord KeyMods; // Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags. Read-only, updated by NewFrame()
+ ImGuiKeyData KeysData[ImGuiKey_NamedKey_COUNT];// Key state for all known keys. Use IsKeyXXX() functions to access this.
bool WantCaptureMouseUnlessPopupClose; // Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup.
ImVec2 MousePosPrev; // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
ImVec2 MouseClickedPos[5]; // Position at time of clicking
@@ -2039,30 +2430,49 @@ struct ImGuiIO
ImU16 MouseClickedCount[5]; // == 0 (not clicked), == 1 (same as MouseClicked[]), == 2 (double-clicked), == 3 (triple-clicked) etc. when going from !Down to Down
ImU16 MouseClickedLastCount[5]; // Count successive number of clicks. Stays valid after mouse release. Reset after another click is done.
bool MouseReleased[5]; // Mouse button went from Down to !Down
+ double MouseReleasedTime[5]; // Time of last released (rarely used! but useful to handle delayed single-click when trying to disambiguate them from double-click).
bool MouseDownOwned[5]; // Track if button was clicked inside a dear imgui window or over void blocked by a popup. We don't request mouse capture from the application if click started outside ImGui bounds.
bool MouseDownOwnedUnlessPopupClose[5]; // Track if button was clicked inside a dear imgui window.
+ bool MouseWheelRequestAxisSwap; // On a non-Mac system, holding SHIFT requests WheelY to perform the equivalent of a WheelX event. On a Mac system this is already enforced by the system.
+ bool MouseCtrlLeftAsRightClick; // (OSX) Set to true when the current click was a Ctrl+click that spawned a simulated right click
float MouseDownDuration[5]; // Duration the mouse button has been down (0.0f == just clicked)
float MouseDownDurationPrev[5]; // Previous time the mouse button has been down
float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the clicking point (used for moving thresholds)
float PenPressure; // Touch/Pen pressure (0.0f to 1.0f, should be >0.0f only when MouseDown[0] == true). Helper storage currently unused by Dear ImGui.
bool AppFocusLost; // Only modify via AddFocusEvent()
bool AppAcceptingEvents; // Only modify via SetAppAcceptingEvents()
- ImS8 BackendUsingLegacyKeyArrays; // -1: unknown, 0: using AddKeyEvent(), 1: using legacy io.KeysDown[]
- bool BackendUsingLegacyNavInputArray; // 0: using AddKeyAnalogEvent(), 1: writing to legacy io.NavInputs[] directly
ImWchar16 InputQueueSurrogate; // For AddInputCharacterUTF16()
ImVector<ImWchar> InputQueueCharacters; // Queue of _characters_ input (obtained by platform backend). Fill using AddInputCharacter() helper.
+ // Legacy: before 1.87, we required backend to fill io.KeyMap[] (imgui->native map) during initialization and io.KeysDown[] (native indices) every frame.
+ // This is still temporarily supported as a legacy feature. However the new preferred scheme is for backend to call io.AddKeyEvent().
+ // Old (<1.87): ImGui::IsKeyPressed(ImGui::GetIO().KeyMap[ImGuiKey_Space]) --> New (1.87+) ImGui::IsKeyPressed(ImGuiKey_Space)
+ // Old (<1.87): ImGui::IsKeyPressed(MYPLATFORM_KEY_SPACE) --> New (1.87+) ImGui::IsKeyPressed(ImGuiKey_Space)
+ // Read https://github.com/ocornut/imgui/issues/4921 for details.
+ //int KeyMap[ImGuiKey_COUNT]; // [LEGACY] Input: map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. The first 512 are now unused and should be kept zero. Legacy backend will write into KeyMap[] using ImGuiKey_ indices which are always >512.
+ //bool KeysDown[ImGuiKey_COUNT]; // [LEGACY] Input: Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow.
+ //float NavInputs[ImGuiNavInput_COUNT]; // [LEGACY] Since 1.88, NavInputs[] was removed. Backends from 1.60 to 1.86 won't build. Feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
+ //void* ImeWindowHandle; // [Obsoleted in 1.87] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning.
+
+ // Legacy: before 1.91.1, clipboard functions were stored in ImGuiIO instead of ImGuiPlatformIO.
+ // As this is will affect all users of custom engines/backends, we are providing proper legacy redirection (will obsolete).
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ const char* (*GetClipboardTextFn)(void* user_data);
+ void (*SetClipboardTextFn)(void* user_data, const char* text);
+ void* ClipboardUserData;
+#endif
+
IMGUI_API ImGuiIO();
};
//-----------------------------------------------------------------------------
-// [SECTION] Misc data structures
+// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload)
//-----------------------------------------------------------------------------
// Shared state of InputText(), passed as an argument to your callback when a ImGuiInputTextFlags_Callback* flag is used.
// The callback function should return 0 by default.
// Callbacks (follow a flag name and see comments in ImGuiInputTextFlags_ declarations for more details)
-// - ImGuiInputTextFlags_CallbackEdit: Callback on buffer edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active)
+// - ImGuiInputTextFlags_CallbackEdit: Callback on buffer edit. Note that InputText() already returns true on edit + you can always use IsItemEdited(). The callback is useful to manipulate the underlying buffer while focus is active.
// - ImGuiInputTextFlags_CallbackAlways: Callback on each iteration
// - ImGuiInputTextFlags_CallbackCompletion: Callback on pressing TAB
// - ImGuiInputTextFlags_CallbackHistory: Callback on pressing Up/Down arrows
@@ -2070,11 +2480,14 @@ struct ImGuiIO
// - ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.
struct ImGuiInputTextCallbackData
{
+ ImGuiContext* Ctx; // Parent UI context
ImGuiInputTextFlags EventFlag; // One ImGuiInputTextFlags_Callback* // Read-only
ImGuiInputTextFlags Flags; // What user passed to InputText() // Read-only
void* UserData; // What user passed to InputText() // Read-only
// Arguments for the different callback events
+ // - During Resize callback, Buf will be same as your input buffer.
+ // - However, during Completion/History/Always callback, Buf always points to our own internal data (it is not the same as your buffer)! Changes to it will be reflected into your own buffer shortly after the callback.
// - To modify the text buffer in a callback, prefer using the InsertChars() / DeleteChars() function. InsertChars() will take care of calling the resize callback if necessary.
// - If you know your edits are not going to resize the underlying buffer allocation, you may modify the contents of 'Buf[]' directly. You need to update 'BufTextLen' accordingly (0 <= BufTextLen < BufSize) and set 'BufDirty'' to true so InputText can update its internal state.
ImWchar EventChar; // Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0;
@@ -2129,32 +2542,8 @@ struct ImGuiPayload
bool IsDelivery() const { return Delivery; }
};
-// Sorting specification for one column of a table (sizeof == 12 bytes)
-struct ImGuiTableColumnSortSpecs
-{
- ImGuiID ColumnUserID; // User id of the column (if specified by a TableSetupColumn() call)
- ImS16 ColumnIndex; // Index of the column
- ImS16 SortOrder; // Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here)
- ImGuiSortDirection SortDirection : 8; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending (you can use this or SortSign, whichever is more convenient for your sort function)
-
- ImGuiTableColumnSortSpecs() { memset(this, 0, sizeof(*this)); }
-};
-
-// Sorting specifications for a table (often handling sort specs for a single column, occasionally more)
-// Obtained by calling TableGetSortSpecs().
-// When 'SpecsDirty == true' you can sort your data. It will be true with sorting specs have changed since last call, or the first time.
-// Make sure to set 'SpecsDirty = false' after sorting, else you may wastefully sort your data every frame!
-struct ImGuiTableSortSpecs
-{
- const ImGuiTableColumnSortSpecs* Specs; // Pointer to sort spec array.
- int SpecsCount; // Sort spec count. Most often 1. May be > 1 when ImGuiTableFlags_SortMulti is enabled. May be == 0 when ImGuiTableFlags_SortTristate is enabled.
- bool SpecsDirty; // Set to true when specs have changed since last time! Use this to sort again, then clear the flag.
-
- ImGuiTableSortSpecs() { memset(this, 0, sizeof(*this)); }
-};
-
//-----------------------------------------------------------------------------
-// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor)
+// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor)
//-----------------------------------------------------------------------------
// Helper: Unicode defines
@@ -2210,10 +2599,11 @@ struct ImGuiTextBuffer
ImGuiTextBuffer() { }
inline char operator[](int i) const { IM_ASSERT(Buf.Data != NULL); return Buf.Data[i]; }
const char* begin() const { return Buf.Data ? &Buf.front() : EmptyString; }
- const char* end() const { return Buf.Data ? &Buf.back() : EmptyString; } // Buf is zero-terminated, so end() will point on the zero-terminator
+ const char* end() const { return Buf.Data ? &Buf.back() : EmptyString; } // Buf is zero-terminated, so end() will point on the zero-terminator
int size() const { return Buf.Size ? Buf.Size - 1 : 0; }
bool empty() const { return Buf.Size <= 1; }
void clear() { Buf.clear(); }
+ void resize(int size) { if (Buf.Size > size) Buf.Data[size] = 0; Buf.resize(size ? size + 1 : 0, 0); } // Similar to resize(0) on ImVector: empty string but don't free buffer.
void reserve(int capacity) { Buf.reserve(capacity); }
const char* c_str() const { return Buf.Data ? Buf.Data : EmptyString; }
IMGUI_API void append(const char* str, const char* str_end = NULL);
@@ -2221,6 +2611,16 @@ struct ImGuiTextBuffer
IMGUI_API void appendfv(const char* fmt, va_list args) IM_FMTLIST(2);
};
+// [Internal] Key+Value for ImGuiStorage
+struct ImGuiStoragePair
+{
+ ImGuiID key;
+ union { int val_i; float val_f; void* val_p; };
+ ImGuiStoragePair(ImGuiID _key, int _val) { key = _key; val_i = _val; }
+ ImGuiStoragePair(ImGuiID _key, float _val) { key = _key; val_f = _val; }
+ ImGuiStoragePair(ImGuiID _key, void* _val) { key = _key; val_p = _val; }
+};
+
// Helper: Key->Value storage
// Typically you don't have to worry about this since a storage is held within each Window.
// We use it to e.g. store collapse state for a tree (Int 0/1)
@@ -2232,15 +2632,6 @@ struct ImGuiTextBuffer
struct ImGuiStorage
{
// [Internal]
- struct ImGuiStoragePair
- {
- ImGuiID key;
- union { int val_i; float val_f; void* val_p; };
- ImGuiStoragePair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; }
- ImGuiStoragePair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
- ImGuiStoragePair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
- };
-
ImVector<ImGuiStoragePair> Data;
// - Get***() functions find pair, never add/allocate. Pairs are sorted so a query is O(log N)
@@ -2265,11 +2656,14 @@ struct ImGuiStorage
IMGUI_API float* GetFloatRef(ImGuiID key, float default_val = 0.0f);
IMGUI_API void** GetVoidPtrRef(ImGuiID key, void* default_val = NULL);
- // Use on your own storage if you know only integer are being stored (open/close all tree nodes)
+ // Advanced: for quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once.
+ IMGUI_API void BuildSortByKey();
+ // Obsolete: use on your own storage if you know only integer are being stored (open/close all tree nodes)
IMGUI_API void SetAllInt(int val);
- // For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once.
- IMGUI_API void BuildSortByKey();
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ //typedef ::ImGuiStoragePair ImGuiStoragePair; // 1.90.8: moved type outside struct
+#endif
};
// Helper: Manually clip large list of items.
@@ -2294,14 +2688,16 @@ struct ImGuiStorage
// - The clipper also handles various subtleties related to keyboard/gamepad navigation, wrapping etc.
struct ImGuiListClipper
{
+ ImGuiContext* Ctx; // Parent UI context
int DisplayStart; // First item to display, updated by each call to Step()
int DisplayEnd; // End of items to display (exclusive)
int ItemsCount; // [Internal] Number of items
float ItemsHeight; // [Internal] Height of item after a first step and item submission can calculate it
float StartPosY; // [Internal] Cursor position at the time of Begin() or after table frozen rows are all processed
+ double StartSeekOffsetY; // [Internal] Account for frozen rows in a table and initial loss of precision in very large windows.
void* TempData; // [Internal] Internal data
- // items_count: Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step)
+ // items_count: Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step, and you can call SeekCursorForItem() manually if you need)
// items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
IMGUI_API ImGuiListClipper();
IMGUI_API ~ImGuiListClipper();
@@ -2309,16 +2705,57 @@ struct ImGuiListClipper
IMGUI_API void End(); // Automatically called on the last call of Step() that returns false.
IMGUI_API bool Step(); // Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.
- // Call ForceDisplayRangeByIndices() before first call to Step() if you need a range of items to be displayed regardless of visibility.
- IMGUI_API void ForceDisplayRangeByIndices(int item_min, int item_max); // item_max is exclusive e.g. use (42, 42+1) to make item 42 always visible BUT due to alignment/padding of certain items it is likely that an extra item may be included on either end of the display range.
+ // Call IncludeItemByIndex() or IncludeItemsByIndex() *BEFORE* first call to Step() if you need a range of items to not be clipped, regardless of their visibility.
+ // (Due to alignment / padding of certain items it is possible that an extra item may be included on either end of the display range).
+ inline void IncludeItemByIndex(int item_index) { IncludeItemsByIndex(item_index, item_index + 1); }
+ IMGUI_API void IncludeItemsByIndex(int item_begin, int item_end); // item_end is exclusive e.g. use (42, 42+1) to make item 42 never clipped.
+
+ // Seek cursor toward given item. This is automatically called while stepping.
+ // - The only reason to call this is: you can use ImGuiListClipper::Begin(INT_MAX) if you don't know item count ahead of time.
+ // - In this case, after all steps are done, you'll want to call SeekCursorForItem(item_count).
+ IMGUI_API void SeekCursorForItem(int item_index);
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- inline ImGuiListClipper(int items_count, float items_height = -1.0f) { memset(this, 0, sizeof(*this)); ItemsCount = -1; Begin(items_count, items_height); } // [removed in 1.79]
+ inline void IncludeRangeByIndices(int item_begin, int item_end) { IncludeItemsByIndex(item_begin, item_end); } // [renamed in 1.89.9]
+ inline void ForceDisplayRangeByIndices(int item_begin, int item_end) { IncludeItemsByIndex(item_begin, item_end); } // [renamed in 1.89.6]
+ //inline ImGuiListClipper(int items_count, float items_height = -1.0f) { memset(this, 0, sizeof(*this)); ItemsCount = -1; Begin(items_count, items_height); } // [removed in 1.79]
#endif
};
+// Helpers: ImVec2/ImVec4 operators
+// - It is important that we are keeping those disabled by default so they don't leak in user space.
+// - This is in order to allow user enabling implicit cast operators between ImVec2/ImVec4 and their own types (using IM_VEC2_CLASS_EXTRA in imconfig.h)
+// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4.
+// - We intentionally provide ImVec2*float but not float*ImVec2: this is rare enough and we want to reduce the surface for possible user mistake.
+#ifdef IMGUI_DEFINE_MATH_OPERATORS
+#define IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED
+IM_MSVC_RUNTIME_CHECKS_OFF
+static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x * rhs, lhs.y * rhs); }
+static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x / rhs, lhs.y / rhs); }
+static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); }
+static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); }
+static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
+static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); }
+static inline ImVec2 operator-(const ImVec2& lhs) { return ImVec2(-lhs.x, -lhs.y); }
+static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; }
+static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; }
+static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }
+static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
+static inline ImVec2& operator*=(ImVec2& lhs, const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y; return lhs; }
+static inline ImVec2& operator/=(ImVec2& lhs, const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y; return lhs; }
+static inline bool operator==(const ImVec2& lhs, const ImVec2& rhs) { return lhs.x == rhs.x && lhs.y == rhs.y; }
+static inline bool operator!=(const ImVec2& lhs, const ImVec2& rhs) { return lhs.x != rhs.x || lhs.y != rhs.y; }
+static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); }
+static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); }
+static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); }
+static inline bool operator==(const ImVec4& lhs, const ImVec4& rhs) { return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.w == rhs.w; }
+static inline bool operator!=(const ImVec4& lhs, const ImVec4& rhs) { return lhs.x != rhs.x || lhs.y != rhs.y || lhs.z != rhs.z || lhs.w != rhs.w; }
+IM_MSVC_RUNTIME_CHECKS_RESTORE
+#endif
+
// Helpers macros to generate 32-bit encoded colors
-// User can declare their own format by #defining the 5 _SHIFT/_MASK macros in their imconfig file.
+// - User can declare their own format by #defining the 5 _SHIFT/_MASK macros in their imconfig file.
+// - Any setting other than the default will need custom backend support. The only standard backend that supports anything else than the default is DirectX9.
#ifndef IM_COL32_R_SHIFT
#ifdef IMGUI_USE_BGRA_PACKED_COLOR
#define IM_COL32_R_SHIFT 16
@@ -2350,8 +2787,8 @@ struct ImColor
constexpr ImColor() { }
constexpr ImColor(float r, float g, float b, float a = 1.0f) : Value(r, g, b, a) { }
constexpr ImColor(const ImVec4& col) : Value(col) {}
- ImColor(int r, int g, int b, int a = 255) { float sc = 1.0f / 255.0f; Value.x = (float)r * sc; Value.y = (float)g * sc; Value.z = (float)b * sc; Value.w = (float)a * sc; }
- ImColor(ImU32 rgba) { float sc = 1.0f / 255.0f; Value.x = (float)((rgba >> IM_COL32_R_SHIFT) & 0xFF) * sc; Value.y = (float)((rgba >> IM_COL32_G_SHIFT) & 0xFF) * sc; Value.z = (float)((rgba >> IM_COL32_B_SHIFT) & 0xFF) * sc; Value.w = (float)((rgba >> IM_COL32_A_SHIFT) & 0xFF) * sc; }
+ constexpr ImColor(int r, int g, int b, int a = 255) : Value((float)r * (1.0f / 255.0f), (float)g * (1.0f / 255.0f), (float)b * (1.0f / 255.0f), (float)a* (1.0f / 255.0f)) {}
+ constexpr ImColor(ImU32 rgba) : Value((float)((rgba >> IM_COL32_R_SHIFT) & 0xFF) * (1.0f / 255.0f), (float)((rgba >> IM_COL32_G_SHIFT) & 0xFF) * (1.0f / 255.0f), (float)((rgba >> IM_COL32_B_SHIFT) & 0xFF) * (1.0f / 255.0f), (float)((rgba >> IM_COL32_A_SHIFT) & 0xFF) * (1.0f / 255.0f)) {}
inline operator ImU32() const { return ImGui::ColorConvertFloat4ToU32(Value); }
inline operator ImVec4() const { return Value; }
@@ -2361,13 +2798,168 @@ struct ImColor
};
//-----------------------------------------------------------------------------
+// [SECTION] Multi-Select API flags and structures (ImGuiMultiSelectFlags, ImGuiSelectionRequestType, ImGuiSelectionRequest, ImGuiMultiSelectIO, ImGuiSelectionBasicStorage)
+//-----------------------------------------------------------------------------
+
+// Multi-selection system
+// Documentation at: https://github.com/ocornut/imgui/wiki/Multi-Select
+// - Refer to 'Demo->Widgets->Selection State & Multi-Select' for demos using this.
+// - This system implements standard multi-selection idioms (CTRL+Mouse/Keyboard, SHIFT+Mouse/Keyboard, etc)
+// with support for clipper (skipping non-visible items), box-select and many other details.
+// - Selectable(), Checkbox() are supported but custom widgets may use it as well.
+// - TreeNode() is technically supported but... using this correctly is more complicated: you need some sort of linear/random access to your tree,
+// which is suited to advanced trees setups also implementing filters and clipper. We will work toward simplifying and demoing it.
+// - In the spirit of Dear ImGui design, your code owns actual selection data.
+// This is designed to allow all kinds of selection storage you may use in your application e.g. set/map/hash.
+// About ImGuiSelectionBasicStorage:
+// - This is an optional helper to store a selection state and apply selection requests.
+// - It is used by our demos and provided as a convenience to quickly implement multi-selection.
+// Usage:
+// - Identify submitted items with SetNextItemSelectionUserData(), most likely using an index into your current data-set.
+// - Store and maintain actual selection data using persistent object identifiers.
+// - Usage flow:
+// BEGIN - (1) Call BeginMultiSelect() and retrieve the ImGuiMultiSelectIO* result.
+// - (2) Honor request list (SetAll/SetRange requests) by updating your selection data. Same code as Step 6.
+// - (3) [If using clipper] You need to make sure RangeSrcItem is always submitted. Calculate its index and pass to clipper.IncludeItemByIndex(). If storing indices in ImGuiSelectionUserData, a simple clipper.IncludeItemByIndex(ms_io->RangeSrcItem) call will work.
+// LOOP - (4) Submit your items with SetNextItemSelectionUserData() + Selectable()/TreeNode() calls.
+// END - (5) Call EndMultiSelect() and retrieve the ImGuiMultiSelectIO* result.
+// - (6) Honor request list (SetAll/SetRange requests) by updating your selection data. Same code as Step 2.
+// If you submit all items (no clipper), Step 2 and 3 are optional and will be handled by each item themselves. It is fine to always honor those steps.
+// About ImGuiSelectionUserData:
+// - This can store an application-defined identifier (e.g. index or pointer) submitted via SetNextItemSelectionUserData().
+// - In return we store them into RangeSrcItem/RangeFirstItem/RangeLastItem and other fields in ImGuiMultiSelectIO.
+// - Most applications will store an object INDEX, hence the chosen name and type. Storing an index is natural, because
+// SetRange requests will give you two end-points and you will need to iterate/interpolate between them to update your selection.
+// - However it is perfectly possible to store a POINTER or another IDENTIFIER inside ImGuiSelectionUserData.
+// Our system never assume that you identify items by indices, it never attempts to interpolate between two values.
+// - If you enable ImGuiMultiSelectFlags_NoRangeSelect then it is guaranteed that you will never have to interpolate
+// between two ImGuiSelectionUserData, which may be a convenient way to use part of the feature with less code work.
+// - As most users will want to store an index, for convenience and to reduce confusion we use ImS64 instead of void*,
+// being syntactically easier to downcast. Feel free to reinterpret_cast and store a pointer inside.
+
+// Flags for BeginMultiSelect()
+enum ImGuiMultiSelectFlags_
+{
+ ImGuiMultiSelectFlags_None = 0,
+ ImGuiMultiSelectFlags_SingleSelect = 1 << 0, // Disable selecting more than one item. This is available to allow single-selection code to share same code/logic if desired. It essentially disables the main purpose of BeginMultiSelect() tho!
+ ImGuiMultiSelectFlags_NoSelectAll = 1 << 1, // Disable CTRL+A shortcut to select all.
+ ImGuiMultiSelectFlags_NoRangeSelect = 1 << 2, // Disable Shift+selection mouse/keyboard support (useful for unordered 2D selection). With BoxSelect is also ensure contiguous SetRange requests are not combined into one. This allows not handling interpolation in SetRange requests.
+ ImGuiMultiSelectFlags_NoAutoSelect = 1 << 3, // Disable selecting items when navigating (useful for e.g. supporting range-select in a list of checkboxes).
+ ImGuiMultiSelectFlags_NoAutoClear = 1 << 4, // Disable clearing selection when navigating or selecting another one (generally used with ImGuiMultiSelectFlags_NoAutoSelect. useful for e.g. supporting range-select in a list of checkboxes).
+ ImGuiMultiSelectFlags_NoAutoClearOnReselect = 1 << 5, // Disable clearing selection when clicking/selecting an already selected item.
+ ImGuiMultiSelectFlags_BoxSelect1d = 1 << 6, // Enable box-selection with same width and same x pos items (e.g. full row Selectable()). Box-selection works better with little bit of spacing between items hit-box in order to be able to aim at empty space.
+ ImGuiMultiSelectFlags_BoxSelect2d = 1 << 7, // Enable box-selection with varying width or varying x pos items support (e.g. different width labels, or 2D layout/grid). This is slower: alters clipping logic so that e.g. horizontal movements will update selection of normally clipped items.
+ ImGuiMultiSelectFlags_BoxSelectNoScroll = 1 << 8, // Disable scrolling when box-selecting near edges of scope.
+ ImGuiMultiSelectFlags_ClearOnEscape = 1 << 9, // Clear selection when pressing Escape while scope is focused.
+ ImGuiMultiSelectFlags_ClearOnClickVoid = 1 << 10, // Clear selection when clicking on empty location within scope.
+ ImGuiMultiSelectFlags_ScopeWindow = 1 << 11, // Scope for _BoxSelect and _ClearOnClickVoid is whole window (Default). Use if BeginMultiSelect() covers a whole window or used a single time in same window.
+ ImGuiMultiSelectFlags_ScopeRect = 1 << 12, // Scope for _BoxSelect and _ClearOnClickVoid is rectangle encompassing BeginMultiSelect()/EndMultiSelect(). Use if BeginMultiSelect() is called multiple times in same window.
+ ImGuiMultiSelectFlags_SelectOnClick = 1 << 13, // Apply selection on mouse down when clicking on unselected item. (Default)
+ ImGuiMultiSelectFlags_SelectOnClickRelease = 1 << 14, // Apply selection on mouse release when clicking an unselected item. Allow dragging an unselected item without altering selection.
+ //ImGuiMultiSelectFlags_RangeSelect2d = 1 << 15, // Shift+Selection uses 2d geometry instead of linear sequence, so possible to use Shift+up/down to select vertically in grid. Analogous to what BoxSelect does.
+ ImGuiMultiSelectFlags_NavWrapX = 1 << 16, // [Temporary] Enable navigation wrapping on X axis. Provided as a convenience because we don't have a design for the general Nav API for this yet. When the more general feature be public we may obsolete this flag in favor of new one.
+};
+
+// Main IO structure returned by BeginMultiSelect()/EndMultiSelect().
+// This mainly contains a list of selection requests.
+// - Use 'Demo->Tools->Debug Log->Selection' to see requests as they happen.
+// - Some fields are only useful if your list is dynamic and allows deletion (getting post-deletion focus/state right is shown in the demo)
+// - Below: who reads/writes each fields? 'r'=read, 'w'=write, 'ms'=multi-select code, 'app'=application/user code.
+struct ImGuiMultiSelectIO
+{
+ //------------------------------------------// BeginMultiSelect / EndMultiSelect
+ ImVector<ImGuiSelectionRequest> Requests; // ms:w, app:r / ms:w app:r // Requests to apply to your selection data.
+ ImGuiSelectionUserData RangeSrcItem; // ms:w app:r / // (If using clipper) Begin: Source item (often the first selected item) must never be clipped: use clipper.IncludeItemByIndex() to ensure it is submitted.
+ ImGuiSelectionUserData NavIdItem; // ms:w, app:r / // (If using deletion) Last known SetNextItemSelectionUserData() value for NavId (if part of submitted items).
+ bool NavIdSelected; // ms:w, app:r / app:r // (If using deletion) Last known selection state for NavId (if part of submitted items).
+ bool RangeSrcReset; // app:w / ms:r // (If using deletion) Set before EndMultiSelect() to reset ResetSrcItem (e.g. if deleted selection).
+ int ItemsCount; // ms:w, app:r / app:r // 'int items_count' parameter to BeginMultiSelect() is copied here for convenience, allowing simpler calls to your ApplyRequests handler. Not used internally.
+};
+
+// Selection request type
+enum ImGuiSelectionRequestType
+{
+ ImGuiSelectionRequestType_None = 0,
+ ImGuiSelectionRequestType_SetAll, // Request app to clear selection (if Selected==false) or select all items (if Selected==true). We cannot set RangeFirstItem/RangeLastItem as its contents is entirely up to user (not necessarily an index)
+ ImGuiSelectionRequestType_SetRange, // Request app to select/unselect [RangeFirstItem..RangeLastItem] items (inclusive) based on value of Selected. Only EndMultiSelect() request this, app code can read after BeginMultiSelect() and it will always be false.
+};
+
+// Selection request item
+struct ImGuiSelectionRequest
+{
+ //------------------------------------------// BeginMultiSelect / EndMultiSelect
+ ImGuiSelectionRequestType Type; // ms:w, app:r / ms:w, app:r // Request type. You'll most often receive 1 Clear + 1 SetRange with a single-item range.
+ bool Selected; // ms:w, app:r / ms:w, app:r // Parameter for SetAll/SetRange requests (true = select, false = unselect)
+ ImS8 RangeDirection; // / ms:w app:r // Parameter for SetRange request: +1 when RangeFirstItem comes before RangeLastItem, -1 otherwise. Useful if you want to preserve selection order on a backward Shift+Click.
+ ImGuiSelectionUserData RangeFirstItem; // / ms:w, app:r // Parameter for SetRange request (this is generally == RangeSrcItem when shift selecting from top to bottom).
+ ImGuiSelectionUserData RangeLastItem; // / ms:w, app:r // Parameter for SetRange request (this is generally == RangeSrcItem when shift selecting from bottom to top). Inclusive!
+};
+
+// Optional helper to store multi-selection state + apply multi-selection requests.
+// - Used by our demos and provided as a convenience to easily implement basic multi-selection.
+// - Iterate selection with 'void* it = NULL; ImGuiID id; while (selection.GetNextSelectedItem(&it, &id)) { ... }'
+// Or you can check 'if (Contains(id)) { ... }' for each possible object if their number is not too high to iterate.
+// - USING THIS IS NOT MANDATORY. This is only a helper and not a required API.
+// To store a multi-selection, in your application you could:
+// - Use this helper as a convenience. We use our simple key->value ImGuiStorage as a std::set<ImGuiID> replacement.
+// - Use your own external storage: e.g. std::set<MyObjectId>, std::vector<MyObjectId>, interval trees, intrusively stored selection etc.
+// In ImGuiSelectionBasicStorage we:
+// - always use indices in the multi-selection API (passed to SetNextItemSelectionUserData(), retrieved in ImGuiMultiSelectIO)
+// - use the AdapterIndexToStorageId() indirection layer to abstract how persistent selection data is derived from an index.
+// - use decently optimized logic to allow queries and insertion of very large selection sets.
+// - do not preserve selection order.
+// Many combinations are possible depending on how you prefer to store your items and how you prefer to store your selection.
+// Large applications are likely to eventually want to get rid of this indirection layer and do their own thing.
+// See https://github.com/ocornut/imgui/wiki/Multi-Select for details and pseudo-code using this helper.
+struct ImGuiSelectionBasicStorage
+{
+ // Members
+ int Size; // // Number of selected items, maintained by this helper.
+ bool PreserveOrder; // = false // GetNextSelectedItem() will return ordered selection (currently implemented by two additional sorts of selection. Could be improved)
+ void* UserData; // = NULL // User data for use by adapter function // e.g. selection.UserData = (void*)my_items;
+ ImGuiID (*AdapterIndexToStorageId)(ImGuiSelectionBasicStorage* self, int idx); // e.g. selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { return ((MyItems**)self->UserData)[idx]->ID; };
+ int _SelectionOrder;// [Internal] Increasing counter to store selection order
+ ImGuiStorage _Storage; // [Internal] Selection set. Think of this as similar to e.g. std::set<ImGuiID>. Prefer not accessing directly: iterate with GetNextSelectedItem().
+
+ // Methods
+ IMGUI_API ImGuiSelectionBasicStorage();
+ IMGUI_API void ApplyRequests(ImGuiMultiSelectIO* ms_io); // Apply selection requests coming from BeginMultiSelect() and EndMultiSelect() functions. It uses 'items_count' passed to BeginMultiSelect()
+ IMGUI_API bool Contains(ImGuiID id) const; // Query if an item id is in selection.
+ IMGUI_API void Clear(); // Clear selection
+ IMGUI_API void Swap(ImGuiSelectionBasicStorage& r); // Swap two selections
+ IMGUI_API void SetItemSelected(ImGuiID id, bool selected); // Add/remove an item from selection (generally done by ApplyRequests() function)
+ IMGUI_API bool GetNextSelectedItem(void** opaque_it, ImGuiID* out_id); // Iterate selection with 'void* it = NULL; ImGuiID id; while (selection.GetNextSelectedItem(&it, &id)) { ... }'
+ inline ImGuiID GetStorageIdFromIndex(int idx) { return AdapterIndexToStorageId(this, idx); } // Convert index to item id based on provided adapter.
+};
+
+// Optional helper to apply multi-selection requests to existing randomly accessible storage.
+// Convenient if you want to quickly wire multi-select API on e.g. an array of bool or items storing their own selection state.
+struct ImGuiSelectionExternalStorage
+{
+ // Members
+ void* UserData; // User data for use by adapter function // e.g. selection.UserData = (void*)my_items;
+ void (*AdapterSetItemSelected)(ImGuiSelectionExternalStorage* self, int idx, bool selected); // e.g. AdapterSetItemSelected = [](ImGuiSelectionExternalStorage* self, int idx, bool selected) { ((MyItems**)self->UserData)[idx]->Selected = selected; }
+
+ // Methods
+ IMGUI_API ImGuiSelectionExternalStorage();
+ IMGUI_API void ApplyRequests(ImGuiMultiSelectIO* ms_io); // Apply selection requests by using AdapterSetItemSelected() calls
+};
+
+//-----------------------------------------------------------------------------
// [SECTION] Drawing API (ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawListFlags, ImDrawList, ImDrawData)
// Hold a series of drawing commands. The user provides a renderer for ImDrawData which essentially contains an array of ImDrawList.
//-----------------------------------------------------------------------------
// The maximum line width to bake anti-aliased textures for. Build atlas with ImFontAtlasFlags_NoBakedLines to disable baking.
#ifndef IM_DRAWLIST_TEX_LINES_WIDTH_MAX
-#define IM_DRAWLIST_TEX_LINES_WIDTH_MAX (63)
+#define IM_DRAWLIST_TEX_LINES_WIDTH_MAX (32)
+#endif
+
+// ImDrawIdx: vertex index. [Compile-time configurable type]
+// - To use 16-bit indices + allow large meshes: backend need to set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset (recommended).
+// - To use 32-bit indices: override with '#define ImDrawIdx unsigned int' in your imconfig.h file.
+#ifndef ImDrawIdx
+typedef unsigned short ImDrawIdx; // Default: 16-bit (for maximum compatibility with renderer backends)
#endif
// ImDrawCallback: Draw callbacks for advanced uses [configurable type: override in imconfig.h]
@@ -2383,9 +2975,9 @@ typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* c
// Special Draw callback value to request renderer backend to reset the graphics/render state.
// The renderer backend needs to handle this special value, otherwise it will crash trying to call a function at this address.
-// This is useful for example if you submitted callbacks which you know have altered the render state and you want it to be restored.
-// It is not done by default because they are many perfectly useful way of altering render state for imgui contents (e.g. changing shader/blending settings before an Image call).
-#define ImDrawCallback_ResetRenderState (ImDrawCallback)(-1)
+// This is useful, for example, if you submitted callbacks which you know have altered the render state and you want it to be restored.
+// Render state is not reset by default because they are many perfectly useful way of altering render state (e.g. changing shader/blending settings before an Image call).
+#define ImDrawCallback_ResetRenderState (ImDrawCallback)(-8)
// Typically, 1 command = 1 GPU draw call (unless command is a callback)
// - VtxOffset: When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' is enabled,
@@ -2400,9 +2992,11 @@ struct ImDrawCmd
unsigned int IdxOffset; // 4 // Start offset in index buffer.
unsigned int ElemCount; // 4 // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
ImDrawCallback UserCallback; // 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
- void* UserCallbackData; // 4-8 // The draw callback code can access this.
+ void* UserCallbackData; // 4-8 // Callback user data (when UserCallback != NULL). If called AddCallback() with size == 0, this is a copy of the AddCallback() argument. If called AddCallback() with size > 0, this is pointing to a buffer where data is stored.
+ int UserCallbackDataSize; // 4 // Size of callback user data when using storage, otherwise 0.
+ int UserCallbackDataOffset;// 4 // [Internal] Offset of callback user data when using storage, otherwise -1.
- ImDrawCmd() { memset(this, 0, sizeof(*this)); } // Also ensure our padding fields are zeroed
+ ImDrawCmd() { memset(this, 0, sizeof(*this)); } // Also ensure our padding fields are zeroed
// Since 1.83: returns ImTextureID associated with this draw call. Warning: DO NOT assume this is always same as 'TextureId' (we will change this function for an upcoming feature)
inline ImTextureID GetTexID() const { return TextureId; }
@@ -2439,7 +3033,6 @@ struct ImDrawChannel
ImVector<ImDrawIdx> _IdxBuffer;
};
-
// Split/Merge functions are used to split the draw list into different layers which can be drawn into out of order.
// This is used by the Columns/Tables API, so items of each column can be batched together in a same draw call.
struct ImDrawListSplitter
@@ -2495,7 +3088,7 @@ enum ImDrawListFlags_
// access the current window draw list and draw custom primitives.
// You can interleave normal ImGui:: calls and adding primitives to the current draw list.
// In single viewport mode, top-left is == GetMainViewport()->Pos (generally 0,0), bottom-right is == GetMainViewport()->Pos+Size (generally io.DisplaySize).
-// You are totally free to apply whatever transformation matrix to want to the data (depending on the use of the transformation you may want to apply it to ClipRect as well!)
+// You are totally free to apply whatever transformation matrix you want to the data (depending on the use of the transformation you may want to apply it to ClipRect as well!)
// Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui:: functions), if you use this API a lot consider coarse culling your drawn objects.
struct ImDrawList
{
@@ -2508,20 +3101,22 @@ struct ImDrawList
// [Internal, used while building lists]
unsigned int _VtxCurrentIdx; // [Internal] generally == VtxBuffer.Size unless we are past 64K vertices, in which case this gets reset to 0.
ImDrawListSharedData* _Data; // Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context)
- const char* _OwnerName; // Pointer to owner window's name for debugging
ImDrawVert* _VtxWritePtr; // [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
ImDrawIdx* _IdxWritePtr; // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
- ImVector<ImVec4> _ClipRectStack; // [Internal]
- ImVector<ImTextureID> _TextureIdStack; // [Internal]
ImVector<ImVec2> _Path; // [Internal] current path building
ImDrawCmdHeader _CmdHeader; // [Internal] template of active commands. Fields should match those of CmdBuffer.back().
ImDrawListSplitter _Splitter; // [Internal] for channels api (note: prefer using your own persistent instance of ImDrawListSplitter!)
+ ImVector<ImVec4> _ClipRectStack; // [Internal]
+ ImVector<ImTextureID> _TextureIdStack; // [Internal]
+ ImVector<ImU8> _CallbacksDataBuf; // [Internal]
float _FringeScale; // [Internal] anti-alias fringe is scaled by this value, this helps to keep things sharp while zooming at vertex buffer content
+ const char* _OwnerName; // Pointer to owner window's name for debugging
- // If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData() or create and use your own ImDrawListSharedData (so you can use ImDrawList without ImGui)
- ImDrawList(ImDrawListSharedData* shared_data) { memset(this, 0, sizeof(*this)); _Data = shared_data; }
+ // If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData().
+ // (advanced: you may create and use your own ImDrawListSharedData so you can use ImDrawList without ImGui, but that's more involved)
+ IMGUI_API ImDrawList(ImDrawListSharedData* shared_data);
+ IMGUI_API ~ImDrawList();
- ~ImDrawList() { _ClearFreeMemory(); }
IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
IMGUI_API void PushClipRectFullScreen();
IMGUI_API void PopClipRect();
@@ -2549,13 +3144,20 @@ struct ImDrawList
IMGUI_API void AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments = 0);
IMGUI_API void AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness = 1.0f);
IMGUI_API void AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments);
+ IMGUI_API void AddEllipse(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot = 0.0f, int num_segments = 0, float thickness = 1.0f);
+ IMGUI_API void AddEllipseFilled(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot = 0.0f, int num_segments = 0);
IMGUI_API void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL);
- IMGUI_API void AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL);
- IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness);
- IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col);
+ IMGUI_API void AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL);
IMGUI_API void AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0); // Cubic Bezier (4 control points)
IMGUI_API void AddBezierQuadratic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments = 0); // Quadratic Bezier (3 control points)
+ // General polygon
+ // - Only simple polygons are supported by filling functions (no self-intersections, no holes).
+ // - Concave polygon fill is more expensive than convex one: it has O(N^2) complexity. Provided as a convenience for the user but not used by the main library.
+ IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness);
+ IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col);
+ IMGUI_API void AddConcavePolyFilled(const ImVec2* points, int num_points, ImU32 col);
+
// Image primitives
// - Read FAQ to understand what ImTextureID is.
// - "p_min" and "p_max" represent the upper-left and lower-right corners of the rectangle.
@@ -2565,27 +3167,40 @@ struct ImDrawList
IMGUI_API void AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawFlags flags = 0);
// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
- // - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
+ // - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
+ // so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
inline void PathClear() { _Path.Size = 0; }
inline void PathLineTo(const ImVec2& pos) { _Path.push_back(pos); }
inline void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || memcmp(&_Path.Data[_Path.Size - 1], &pos, 8) != 0) _Path.push_back(pos); }
inline void PathFillConvex(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; }
+ inline void PathFillConcave(ImU32 col) { AddConcavePolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; }
inline void PathStroke(ImU32 col, ImDrawFlags flags = 0, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, flags, thickness); _Path.Size = 0; }
IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 0);
IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
+ IMGUI_API void PathEllipticalArcTo(const ImVec2& center, const ImVec2& radius, float rot, float a_min, float a_max, int num_segments = 0); // Ellipse
IMGUI_API void PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0); // Cubic Bezier (4 control points)
IMGUI_API void PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments = 0); // Quadratic Bezier (3 control points)
IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, ImDrawFlags flags = 0);
- // Advanced
- IMGUI_API void AddCallback(ImDrawCallback callback, void* callback_data); // Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles.
+ // Advanced: Draw Callbacks
+ // - May be used to alter render state (change sampler, blending, current shader). May be used to emit custom rendering commands (difficult to do correctly, but possible).
+ // - Use special ImDrawCallback_ResetRenderState callback to instruct backend to reset its render state to the default.
+ // - Your rendering loop must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles. All standard backends are honoring this.
+ // - For some backends, the callback may access selected render-states exposed by the backend in a ImGui_ImplXXXX_RenderState structure pointed to by platform_io.Renderer_RenderState.
+ // - IMPORTANT: please be mindful of the different level of indirection between using size==0 (copying argument) and using size>0 (copying pointed data into a buffer).
+ // - If userdata_size == 0: we copy/store the 'userdata' argument as-is. It will be available unmodified in ImDrawCmd::UserCallbackData during render.
+ // - If userdata_size > 0, we copy/store 'userdata_size' bytes pointed to by 'userdata'. We store them in a buffer stored inside the drawlist. ImDrawCmd::UserCallbackData will point inside that buffer so you have to retrieve data from there. Your callback may need to use ImDrawCmd::UserCallbackDataSize if you expect dynamically-sized data.
+ // - Support for userdata_size > 0 was added in v1.91.4, October 2024. So earlier code always only allowed to copy/store a simple void*.
+ IMGUI_API void AddCallback(ImDrawCallback callback, void* userdata, size_t userdata_size = 0);
+
+ // Advanced: Miscellaneous
IMGUI_API void AddDrawCmd(); // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible
IMGUI_API ImDrawList* CloneOutput() const; // Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer.
// Advanced: Channels
// - Use to split render into layers. By switching channels to can render out-of-order (e.g. submit FG primitives before BG primitives)
// - Use to minimize draw calls (e.g. if going back-and-forth between multiple clipping rectangles, prefer to append into separate channels then merge at the end)
- // - FIXME-OBSOLETE: This API shouldn't have been in ImDrawList in the first place!
+ // - This API shouldn't have been in ImDrawList in the first place!
// Prefer using your own persistent instance of ImDrawListSplitter as you can stack them.
// Using the ImDrawList::ChannelsXXXX you cannot stack a split over another.
inline void ChannelsSplit(int count) { _Splitter.Split(this, count); }
@@ -2604,10 +3219,12 @@ struct ImDrawList
inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; }
inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); } // Write vertex with unique index
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
- inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
-#endif
+ // Obsolete names
+ //inline void AddEllipse(const ImVec2& center, float radius_x, float radius_y, ImU32 col, float rot = 0.0f, int num_segments = 0, float thickness = 1.0f) { AddEllipse(center, ImVec2(radius_x, radius_y), col, rot, num_segments, thickness); } // OBSOLETED in 1.90.5 (Mar 2024)
+ //inline void AddEllipseFilled(const ImVec2& center, float radius_x, float radius_y, ImU32 col, float rot = 0.0f, int num_segments = 0) { AddEllipseFilled(center, ImVec2(radius_x, radius_y), col, rot, num_segments); } // OBSOLETED in 1.90.5 (Mar 2024)
+ //inline void PathEllipticalArcTo(const ImVec2& center, float radius_x, float radius_y, float rot, float a_min, float a_max, int num_segments = 0) { PathEllipticalArcTo(center, ImVec2(radius_x, radius_y), rot, a_min, a_max, num_segments); } // OBSOLETED in 1.90.5 (Mar 2024)
+ //inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
+ //inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
// [Internal helpers]
IMGUI_API void _ResetForNewFrame();
@@ -2617,6 +3234,7 @@ struct ImDrawList
IMGUI_API void _OnChangedClipRect();
IMGUI_API void _OnChangedTextureID();
IMGUI_API void _OnChangedVtxOffset();
+ IMGUI_API void _SetTextureID(ImTextureID texture_id);
IMGUI_API int _CalcCircleAutoSegmentCount(float radius) const;
IMGUI_API void _PathArcToFastEx(const ImVec2& center, float radius, int a_min_sample, int a_max_sample, int a_step);
IMGUI_API void _PathArcToN(const ImVec2& center, float radius, float a_min, float a_max, int num_segments);
@@ -2627,18 +3245,20 @@ struct ImDrawList
// as this is one of the oldest structure exposed by the library! Basically, ImDrawList == CmdList)
struct ImDrawData
{
- bool Valid; // Only valid after Render() is called and before the next NewFrame() is called.
- int CmdListsCount; // Number of ImDrawList* to render
- int TotalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size
- int TotalVtxCount; // For convenience, sum of all ImDrawList's VtxBuffer.Size
- ImDrawList** CmdLists; // Array of ImDrawList* to render. The ImDrawList are owned by ImGuiContext and only pointed to from here.
- ImVec2 DisplayPos; // Top-left position of the viewport to render (== top-left of the orthogonal projection matrix to use) (== GetMainViewport()->Pos for the main viewport, == (0.0) in most single-viewport applications)
- ImVec2 DisplaySize; // Size of the viewport to render (== GetMainViewport()->Size for the main viewport, == io.DisplaySize in most single-viewport applications)
- ImVec2 FramebufferScale; // Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display.
+ bool Valid; // Only valid after Render() is called and before the next NewFrame() is called.
+ int CmdListsCount; // Number of ImDrawList* to render (should always be == CmdLists.size)
+ int TotalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size
+ int TotalVtxCount; // For convenience, sum of all ImDrawList's VtxBuffer.Size
+ ImVector<ImDrawList*> CmdLists; // Array of ImDrawList* to render. The ImDrawLists are owned by ImGuiContext and only pointed to from here.
+ ImVec2 DisplayPos; // Top-left position of the viewport to render (== top-left of the orthogonal projection matrix to use) (== GetMainViewport()->Pos for the main viewport, == (0.0) in most single-viewport applications)
+ ImVec2 DisplaySize; // Size of the viewport to render (== GetMainViewport()->Size for the main viewport, == io.DisplaySize in most single-viewport applications)
+ ImVec2 FramebufferScale; // Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display.
+ ImGuiViewport* OwnerViewport; // Viewport carrying the ImDrawData instance, might be of use to the renderer (generally not).
// Functions
ImDrawData() { Clear(); }
- void Clear() { memset(this, 0, sizeof(*this)); } // The ImDrawList are owned by ImGuiContext!
+ IMGUI_API void Clear();
+ IMGUI_API void AddDrawList(ImDrawList* draw_list); // Helper to add an external draw list into an existing ImDrawData.
IMGUI_API void DeIndexAllBuffers(); // Helper to convert all buffers from indexed to non-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
IMGUI_API void ScaleClipRects(const ImVec2& fb_scale); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than Dear ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
};
@@ -2647,25 +3267,28 @@ struct ImDrawData
// [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontAtlasFlags, ImFontAtlas, ImFontGlyphRangesBuilder, ImFont)
//-----------------------------------------------------------------------------
+// A font input/source (we may rename this to ImFontSource in the future)
struct ImFontConfig
{
void* FontData; // // TTF/OTF data
int FontDataSize; // // TTF/OTF data size
bool FontDataOwnedByAtlas; // true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
+ bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
+ bool PixelSnapH; // false // Align every glyph AdvanceX to pixel boundaries. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1.
int FontNo; // 0 // Index of font within TTF/OTF file
+ int OversampleH; // 0 (2) // Rasterize at higher quality for sub-pixel positioning. 0 == auto == 1 or 2 depending on size. Note the difference between 2 and 3 is minimal. You can reduce this to 1 for large glyphs save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
+ int OversampleV; // 0 (1) // Rasterize at higher quality for sub-pixel positioning. 0 == auto == 1. This is not really useful as we don't use sub-pixel positions on the Y axis.
float SizePixels; // // Size in pixels for rasterizer (more or less maps to the resulting font height).
- int OversampleH; // 3 // Rasterize at higher quality for sub-pixel positioning. Note the difference between 2 and 3 is minimal so you can reduce this to 2 to save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
- int OversampleV; // 1 // Rasterize at higher quality for sub-pixel positioning. This is not really useful as we don't use sub-pixel positions on the Y axis.
- bool PixelSnapH; // false // Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1.
- ImVec2 GlyphExtraSpacing; // 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
+ //ImVec2 GlyphExtraSpacing; // 0, 0 // (REMOVED IN 1.91.9: use GlyphExtraAdvanceX)
ImVec2 GlyphOffset; // 0, 0 // Offset all glyphs from this font input.
- const ImWchar* GlyphRanges; // NULL // Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
+ const ImWchar* GlyphRanges; // NULL // THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list).
float GlyphMinAdvanceX; // 0 // Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font
float GlyphMaxAdvanceX; // FLT_MAX // Maximum AdvanceX for glyphs
- bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
+ float GlyphExtraAdvanceX; // 0 // Extra spacing (in pixels) between glyphs. Please contact us if you are using this.
unsigned int FontBuilderFlags; // 0 // Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.
- float RasterizerMultiply; // 1.0f // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.
- ImWchar EllipsisChar; // -1 // Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
+ float RasterizerMultiply; // 1.0f // Linearly brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable. This is a silly thing we may remove in the future.
+ float RasterizerDensity; // 1.0f // DPI scale for rasterization, not altering other font metrics: make it easy to swap between e.g. a 100% and a 400% fonts for a zooming display. IMPORTANT: If you increase this it is expected that you increase font scale accordingly, otherwise quality may look lowered.
+ ImWchar EllipsisChar; // 0 // Explicitly specify Unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
// [Internal]
char Name[40]; // Name (strictly to ease debugging)
@@ -2681,7 +3304,7 @@ struct ImFontGlyph
unsigned int Colored : 1; // Flag to indicate glyph is colored and should generally ignore tinting (make it usable with no shift on little-endian as this is used in loops)
unsigned int Visible : 1; // Flag to indicate glyph has no visible pixels (e.g. space). Allow early out when rendering.
unsigned int Codepoint : 30; // 0x0000..0x10FFFF
- float AdvanceX; // Distance to next character (= data from font + ImFontConfig::GlyphExtraSpacing.x baked in)
+ float AdvanceX; // Horizontal distance to advance layout with
float X0, Y0, X1, Y1; // Glyph corners
float U0, V0, U1, V1; // Texture coordinates
};
@@ -2705,13 +3328,16 @@ struct ImFontGlyphRangesBuilder
// See ImFontAtlas::AddCustomRectXXX functions.
struct ImFontAtlasCustomRect
{
- unsigned short Width, Height; // Input // Desired rectangle dimension
unsigned short X, Y; // Output // Packed position in Atlas
- unsigned int GlyphID; // Input // For custom font glyphs only (ID < 0x110000)
+
+ // [Internal]
+ unsigned short Width, Height; // Input // Desired rectangle dimension
+ unsigned int GlyphID : 31; // Input // For custom font glyphs only (ID < 0x110000)
+ unsigned int GlyphColored : 1; // Input // For custom font glyphs only: glyph is colored, removed tinting.
float GlyphAdvanceX; // Input // For custom font glyphs only: glyph xadvance
ImVec2 GlyphOffset; // Input // For custom font glyphs only: glyph display offset
ImFont* Font; // Input // For custom font glyphs only: target font
- ImFontAtlasCustomRect() { Width = Height = 0; X = Y = 0xFFFF; GlyphID = 0; GlyphAdvanceX = 0.0f; GlyphOffset = ImVec2(0, 0); Font = NULL; }
+ ImFontAtlasCustomRect() { X = Y = 0xFFFF; Width = Height = 0; GlyphID = 0; GlyphColored = 0; GlyphAdvanceX = 0.0f; GlyphOffset = ImVec2(0, 0); Font = NULL; }
bool IsPacked() const { return X != 0xFFFF; }
};
@@ -2748,12 +3374,12 @@ struct ImFontAtlas
IMGUI_API ImFont* AddFont(const ImFontConfig* font_cfg);
IMGUI_API ImFont* AddFontDefault(const ImFontConfig* font_cfg = NULL);
IMGUI_API ImFont* AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL);
- IMGUI_API ImFont* AddFontFromMemoryTTF(void* font_data, int font_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas. Set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
- IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_font_data, int compressed_font_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
+ IMGUI_API ImFont* AddFontFromMemoryTTF(void* font_data, int font_data_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas. Set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
+ IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_font_data, int compressed_font_data_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
IMGUI_API ImFont* AddFontFromMemoryCompressedBase85TTF(const char* compressed_font_data_base85, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter.
IMGUI_API void ClearInputData(); // Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.
+ IMGUI_API void ClearFonts(); // Clear input+output font data (same as ClearInputData() + glyphs storage, UV coordinates).
IMGUI_API void ClearTexData(); // Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory.
- IMGUI_API void ClearFonts(); // Clear output font data (glyphs storage, UV coordinates).
IMGUI_API void Clear(); // Clear all input and output.
// Build atlas, retrieve pixel data.
@@ -2772,7 +3398,8 @@ struct ImFontAtlas
//-------------------------------------------
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
- // NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details.
+ // NB: Make sure that your string are UTF-8 and NOT in your local code page.
+ // Read https://github.com/ocornut/imgui/blob/master/docs/FONTS.md/#about-utf-8-encoding for details.
// NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data.
IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
IMGUI_API const ImWchar* GetGlyphRangesGreek(); // Default + Greek and Coptic
@@ -2785,12 +3412,12 @@ struct ImFontAtlas
IMGUI_API const ImWchar* GetGlyphRangesVietnamese(); // Default + Vietnamese characters
//-------------------------------------------
- // [BETA] Custom Rectangles/Glyphs API
+ // [ALPHA] Custom Rectangles/Glyphs API
//-------------------------------------------
// You can request arbitrary rectangles to be packed into the atlas, for your own purposes.
// - After calling Build(), you can query the rectangle position and render your pixels.
- // - If you render colored output, set 'atlas->TexPixelsUseColors = true' as this may help some backends decide of prefered texture format.
+ // - If you render colored output, set 'atlas->TexPixelsUseColors = true' as this may help some backends decide of preferred texture format.
// - You can also request your rectangles to be mapped as font glyph (given a font + Unicode point),
// so you can render e.g. custom colorful icons and use them as regular glyphs.
// - Read docs/FONTS.md for more details about using colorful icons.
@@ -2801,20 +3428,21 @@ struct ImFontAtlas
// [Internal]
IMGUI_API void CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max) const;
- IMGUI_API bool GetMouseCursorTexData(ImGuiMouseCursor cursor, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]);
//-------------------------------------------
// Members
//-------------------------------------------
+ // Input
ImFontAtlasFlags Flags; // Build flags (see ImFontAtlasFlags_)
ImTextureID TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.
int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
- int TexGlyphPadding; // Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0 (will also need to set AntiAliasedLinesUseTex = false).
- bool Locked; // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
+ int TexGlyphPadding; // FIXME: Should be called "TexPackPadding". Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0 (will also need to set AntiAliasedLinesUseTex = false).
+ void* UserData; // Store your own atlas related user-data (if e.g. you have multiple font atlas).
// [Internal]
// NB: Access texture data via GetTexData*() calls! Which will setup a default font for you.
+ bool Locked; // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
bool TexReady; // Set when texture was built matching current font input
bool TexPixelsUseColors; // Tell whether our texture data is known to use colors (rather than just alpha channel), in order to help backend select a format.
unsigned char* TexPixelsAlpha8; // 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
@@ -2825,7 +3453,7 @@ struct ImFontAtlas
ImVec2 TexUvWhitePixel; // Texture coordinates to a white pixel
ImVector<ImFont*> Fonts; // Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font.
ImVector<ImFontAtlasCustomRect> CustomRects; // Rectangles for packing custom texture data into the atlas.
- ImVector<ImFontConfig> ConfigData; // Configuration data
+ ImVector<ImFontConfig> Sources; // Source/configuration data
ImVec4 TexUvLines[IM_DRAWLIST_TEX_LINES_WIDTH_MAX + 1]; // UVs for baked anti-aliased lines
// [Internal] Font builder
@@ -2837,52 +3465,56 @@ struct ImFontAtlas
int PackIdLines; // Custom texture rectangle ID for baked anti-aliased lines
// [Obsolete]
- //typedef ImFontAtlasCustomRect CustomRect; // OBSOLETED in 1.72+
- //typedef ImFontGlyphRangesBuilder GlyphRangesBuilder; // OBSOLETED in 1.67+
+ //typedef ImFontAtlasCustomRect CustomRect; // OBSOLETED in 1.72+
+ //typedef ImFontGlyphRangesBuilder GlyphRangesBuilder; // OBSOLETED in 1.67+
};
// Font runtime data and rendering
// ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32().
struct ImFont
{
- // Members: Hot ~20/24 bytes (for CalcTextSize)
- ImVector<float> IndexAdvanceX; // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this this info, and are often bottleneck in large UI).
+ // [Internal] Members: Hot ~20/24 bytes (for CalcTextSize)
+ ImVector<float> IndexAdvanceX; // 12-16 // out // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this info, and are often bottleneck in large UI).
float FallbackAdvanceX; // 4 // out // = FallbackGlyph->AdvanceX
- float FontSize; // 4 // in // // Height of characters/line, set during loading (don't change after loading)
-
- // Members: Hot ~28/40 bytes (for CalcTextSize + render loop)
- ImVector<ImWchar> IndexLookup; // 12-16 // out // // Sparse. Index glyphs by Unicode code-point.
- ImVector<ImFontGlyph> Glyphs; // 12-16 // out // // All glyphs.
- const ImFontGlyph* FallbackGlyph; // 4-8 // out // = FindGlyph(FontFallbackChar)
-
- // Members: Cold ~32/40 bytes
- ImFontAtlas* ContainerAtlas; // 4-8 // out // // What we has been loaded into
- const ImFontConfig* ConfigData; // 4-8 // in // // Pointer within ContainerAtlas->ConfigData
- short ConfigDataCount; // 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
- ImWchar FallbackChar; // 2 // out // = FFFD/'?' // Character used if a glyph isn't found.
- ImWchar EllipsisChar; // 2 // out // = '...' // Character used for ellipsis rendering.
- ImWchar DotChar; // 2 // out // = '.' // Character used for ellipsis rendering (if a single '...' character isn't found)
+ float FontSize; // 4 // in // Height of characters/line, set during loading (don't change after loading)
+
+ // [Internal] Members: Hot ~28/40 bytes (for RenderText loop)
+ ImVector<ImU16> IndexLookup; // 12-16 // out // Sparse. Index glyphs by Unicode code-point.
+ ImVector<ImFontGlyph> Glyphs; // 12-16 // out // All glyphs.
+ ImFontGlyph* FallbackGlyph; // 4-8 // out // = FindGlyph(FontFallbackChar)
+
+ // [Internal] Members: Cold ~32/40 bytes
+ // Conceptually Sources[] is the list of font sources merged to create this font.
+ ImFontAtlas* ContainerAtlas; // 4-8 // out // What we has been loaded into
+ ImFontConfig* Sources; // 4-8 // in // Pointer within ContainerAtlas->Sources[], to SourcesCount instances
+ short SourcesCount; // 2 // in // Number of ImFontConfig involved in creating this font. Usually 1, or >1 when merging multiple font sources into one ImFont.
+ short EllipsisCharCount; // 1 // out // 1 or 3
+ ImWchar EllipsisChar; // 2-4 // out // Character used for ellipsis rendering ('...').
+ ImWchar FallbackChar; // 2-4 // out // Character used if a glyph isn't found (U+FFFD, '?')
+ float EllipsisWidth; // 4 // out // Total ellipsis Width
+ float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0
+ float Scale; // 4 // in // Base font scale (1.0f), multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
+ float Ascent, Descent; // 4+4 // out // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] (unscaled)
+ int MetricsTotalSurface;// 4 // out // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
bool DirtyLookupTables; // 1 // out //
- float Scale; // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
- float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
- int MetricsTotalSurface;// 4 // out // // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
- ImU8 Used4kPagesMap[(IM_UNICODE_CODEPOINT_MAX+1)/4096/8]; // 2 bytes if ImWchar=ImWchar16, 34 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints.
+ ImU8 Used8kPagesMap[(IM_UNICODE_CODEPOINT_MAX+1)/8192/8]; // 1 bytes if ImWchar=ImWchar16, 16 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints.
// Methods
IMGUI_API ImFont();
IMGUI_API ~ImFont();
- IMGUI_API const ImFontGlyph*FindGlyph(ImWchar c) const;
- IMGUI_API const ImFontGlyph*FindGlyphNoFallback(ImWchar c) const;
- float GetCharAdvance(ImWchar c) const { return ((int)c < IndexAdvanceX.Size) ? IndexAdvanceX[(int)c] : FallbackAdvanceX; }
- bool IsLoaded() const { return ContainerAtlas != NULL; }
- const char* GetDebugName() const { return ConfigData ? ConfigData->Name : "<unknown>"; }
+ IMGUI_API ImFontGlyph* FindGlyph(ImWchar c);
+ IMGUI_API ImFontGlyph* FindGlyphNoFallback(ImWchar c);
+ float GetCharAdvance(ImWchar c) { return ((int)c < IndexAdvanceX.Size) ? IndexAdvanceX[(int)c] : FallbackAdvanceX; }
+ bool IsLoaded() const { return ContainerAtlas != NULL; }
+ const char* GetDebugName() const { return Sources ? Sources->Name : "<unknown>"; }
+ // [Internal] Don't use!
// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
- IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL) const; // utf8
- IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const;
- IMGUI_API void RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c) const;
- IMGUI_API void RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, bool cpu_fine_clip = false) const;
+ IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL); // utf8
+ IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width);
+ IMGUI_API void RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c);
+ IMGUI_API void RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, bool cpu_fine_clip = false);
// [Internal] Don't use!
IMGUI_API void BuildLookupTable();
@@ -2890,7 +3522,6 @@ struct ImFont
IMGUI_API void GrowIndex(int new_size);
IMGUI_API void AddGlyph(const ImFontConfig* src_cfg, ImWchar c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x);
IMGUI_API void AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true); // Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.
- IMGUI_API void SetGlyphVisible(ImWchar c, bool visible);
IMGUI_API bool IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last);
};
@@ -2904,7 +3535,7 @@ enum ImGuiViewportFlags_
ImGuiViewportFlags_None = 0,
ImGuiViewportFlags_IsPlatformWindow = 1 << 0, // Represent a Platform Window
ImGuiViewportFlags_IsPlatformMonitor = 1 << 1, // Represent a Platform Monitor (unused yet)
- ImGuiViewportFlags_OwnedByApp = 1 << 2, // Platform Window: is created/managed by the application (rather than a dear imgui backend)
+ ImGuiViewportFlags_OwnedByApp = 1 << 2, // Platform Window: Is created/managed by the application (rather than a dear imgui backend)
};
// - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
@@ -2916,6 +3547,7 @@ enum ImGuiViewportFlags_
// - Windows are generally trying to stay within the Work Area of their host viewport.
struct ImGuiViewport
{
+ ImGuiID ID; // Unique identifier for the viewport
ImGuiViewportFlags Flags; // See ImGuiViewportFlags_
ImVec2 Pos; // Main Area: Position of the viewport (Dear ImGui coordinates are the same as OS desktop/native coordinates)
ImVec2 Size; // Main Area: Size of the viewport.
@@ -2923,6 +3555,7 @@ struct ImGuiViewport
ImVec2 WorkSize; // Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size)
// Platform/Backend Dependent Data
+ void* PlatformHandle; // void* to hold higher-level, platform window handle (e.g. HWND, GLFWWindow*, SDL_Window*)
void* PlatformHandleRaw; // void* to hold lower-level, platform-native window handle (under Win32 this is expected to be a HWND, unused for other platforms)
ImGuiViewport() { memset(this, 0, sizeof(*this)); }
@@ -2936,7 +3569,45 @@ struct ImGuiViewport
// [SECTION] Platform Dependent Interfaces
//-----------------------------------------------------------------------------
-// (Optional) Support for IME (Input Method Editor) via the io.SetPlatformImeDataFn() function.
+// Access via ImGui::GetPlatformIO()
+struct ImGuiPlatformIO
+{
+ IMGUI_API ImGuiPlatformIO();
+
+ //------------------------------------------------------------------
+ // Input - Interface with OS and Platform backend (most common stuff)
+ //------------------------------------------------------------------
+
+ // Optional: Access OS clipboard
+ // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
+ const char* (*Platform_GetClipboardTextFn)(ImGuiContext* ctx);
+ void (*Platform_SetClipboardTextFn)(ImGuiContext* ctx, const char* text);
+ void* Platform_ClipboardUserData;
+
+ // Optional: Open link/folder/file in OS Shell
+ // (default to use ShellExecuteW() on Windows, system() on Linux/Mac)
+ bool (*Platform_OpenInShellFn)(ImGuiContext* ctx, const char* path);
+ void* Platform_OpenInShellUserData;
+
+ // Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows)
+ // (default to use native imm32 api on Windows)
+ void (*Platform_SetImeDataFn)(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data);
+ void* Platform_ImeUserData;
+ //void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data); // [Renamed to platform_io.PlatformSetImeDataFn in 1.91.1]
+
+ // Optional: Platform locale
+ // [Experimental] Configure decimal point e.g. '.' or ',' useful for some languages (e.g. German), generally pulled from *localeconv()->decimal_point
+ ImWchar Platform_LocaleDecimalPoint; // '.'
+
+ //------------------------------------------------------------------
+ // Input - Interface with Renderer Backend
+ //------------------------------------------------------------------
+
+ // Written by some backends during ImGui_ImplXXXX_RenderDrawData() call to point backend_specific ImGui_ImplXXXX_RenderState* structure.
+ void* Renderer_RenderState;
+};
+
+// (Optional) Support for IME (Input Method Editor) via the platform_io.Platform_SetImeDataFn() function.
struct ImGuiPlatformImeData
{
bool WantVisible; // A widget wants the IME to be visible
@@ -2952,33 +3623,50 @@ struct ImGuiPlatformImeData
// Please keep your copy of dear imgui up to date! Occasionally set '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' in imconfig.h to stay ahead.
//-----------------------------------------------------------------------------
-namespace ImGui
-{
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- IMGUI_API ImGuiKey GetKeyIndex(ImGuiKey key); // map ImGuiKey_* values into legacy native key index. == io.KeyMap[key]
-#else
- static inline ImGuiKey GetKeyIndex(ImGuiKey key) { IM_ASSERT(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END && "ImGuiKey and native_index was merged together and native_index is disabled by IMGUI_DISABLE_OBSOLETE_KEYIO. Please switch to ImGuiKey."); return key; }
-#endif
-}
-
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
namespace ImGui
{
- // OBSOLETED in 1.89 (from August 2022)
- IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // Use new ImageButton() signature (explicit item id, regular FramePadding)
- // OBSOLETED in 1.88 (from May 2022)
- static inline void CaptureKeyboardFromApp(bool want_capture_keyboard = true) { SetNextFrameWantCaptureKeyboard(want_capture_keyboard); } // Renamed as name was misleading + removed default value.
- static inline void CaptureMouseFromApp(bool want_capture_mouse = true) { SetNextFrameWantCaptureMouse(want_capture_mouse); } // Renamed as name was misleading + removed default value.
- // OBSOLETED in 1.86 (from November 2021)
- IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // Calculate coarse clipping for large list of evenly sized items. Prefer using ImGuiListClipper.
- // OBSOLETED in 1.85 (from August 2021)
- static inline float GetWindowContentRegionWidth() { return GetWindowContentRegionMax().x - GetWindowContentRegionMin().x; }
- // OBSOLETED in 1.81 (from February 2021)
- IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // Helper to calculate size from items_count and height_in_items
- static inline bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0, 0)) { return BeginListBox(label, size); }
- static inline void ListBoxFooter() { EndListBox(); }
+ // OBSOLETED in 1.91.9 (from February 2025)
+ IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col); // <-- border_col was removed in favor of ImGuiCol_ImageBorder.
+ // OBSOLETED in 1.91.0 (from July 2024)
+ static inline void PushButtonRepeat(bool repeat) { PushItemFlag(ImGuiItemFlags_ButtonRepeat, repeat); }
+ static inline void PopButtonRepeat() { PopItemFlag(); }
+ static inline void PushTabStop(bool tab_stop) { PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); }
+ static inline void PopTabStop() { PopItemFlag(); }
+ IMGUI_API ImVec2 GetContentRegionMax(); // Content boundaries max (e.g. window boundaries including scrolling, or current column boundaries). You should never need this. Always use GetCursorScreenPos() and GetContentRegionAvail()!
+ IMGUI_API ImVec2 GetWindowContentRegionMin(); // Content boundaries min for the window (roughly (0,0)-Scroll), in window-local coordinates. You should never need this. Always use GetCursorScreenPos() and GetContentRegionAvail()!
+ IMGUI_API ImVec2 GetWindowContentRegionMax(); // Content boundaries max for the window (roughly (0,0)+Size-Scroll), in window-local coordinates. You should never need this. Always use GetCursorScreenPos() and GetContentRegionAvail()!
+ // OBSOLETED in 1.90.0 (from September 2023)
+ static inline bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags window_flags = 0) { return BeginChild(id, size, ImGuiChildFlags_FrameStyle, window_flags); }
+ static inline void EndChildFrame() { EndChild(); }
+ //static inline bool BeginChild(const char* str_id, const ImVec2& size_arg, bool borders, ImGuiWindowFlags window_flags){ return BeginChild(str_id, size_arg, borders ? ImGuiChildFlags_Borders : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Borders
+ //static inline bool BeginChild(ImGuiID id, const ImVec2& size_arg, bool borders, ImGuiWindowFlags window_flags) { return BeginChild(id, size_arg, borders ? ImGuiChildFlags_Borders : ImGuiChildFlags_None, window_flags); } // Unnecessary as true == ImGuiChildFlags_Borders
+ static inline void ShowStackToolWindow(bool* p_open = NULL) { ShowIDStackToolWindow(p_open); }
+ IMGUI_API bool Combo(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int popup_max_height_in_items = -1);
+ IMGUI_API bool ListBox(const char* label, int* current_item, bool (*old_callback)(void* user_data, int idx, const char** out_text), void* user_data, int items_count, int height_in_items = -1);
+ // OBSOLETED in 1.89.7 (from June 2023)
+ IMGUI_API void SetItemAllowOverlap(); // Use SetNextItemAllowOverlap() before item.
+ // OBSOLETED in 1.89.4 (from March 2023)
+ static inline void PushAllowKeyboardFocus(bool tab_stop) { PushItemFlag(ImGuiItemFlags_NoTabStop, !tab_stop); }
+ static inline void PopAllowKeyboardFocus() { PopItemFlag(); }
// Some of the older obsolete names along with their replacement (commented out so they are not reported in IDE)
+ //-- OBSOLETED in 1.89 (from August 2022)
+ //IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // --> Use new ImageButton() signature (explicit item id, regular FramePadding). Refer to code in 1.91 if you want to grab a copy of this version.
+ //-- OBSOLETED in 1.88 (from May 2022)
+ //static inline void CaptureKeyboardFromApp(bool want_capture_keyboard = true) { SetNextFrameWantCaptureKeyboard(want_capture_keyboard); } // Renamed as name was misleading + removed default value.
+ //static inline void CaptureMouseFromApp(bool want_capture_mouse = true) { SetNextFrameWantCaptureMouse(want_capture_mouse); } // Renamed as name was misleading + removed default value.
+ //-- OBSOLETED in 1.87 (from February 2022, more formally obsoleted April 2024)
+ //IMGUI_API ImGuiKey GetKeyIndex(ImGuiKey key); { IM_ASSERT(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END); const ImGuiKeyData* key_data = GetKeyData(key); return (ImGuiKey)(key_data - g.IO.KeysData); } // Map ImGuiKey_* values into legacy native key index. == io.KeyMap[key]. When using a 1.87+ backend using io.AddKeyEvent(), calling GetKeyIndex() with ANY ImGuiKey_XXXX values will return the same value!
+ //static inline ImGuiKey GetKeyIndex(ImGuiKey key) { IM_ASSERT(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END); return key; }
+ //-- OBSOLETED in 1.86 (from November 2021)
+ //IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // Code removed, see 1.90 for last version of the code. Calculate range of visible items for large list of evenly sized items. Prefer using ImGuiListClipper.
+ //-- OBSOLETED in 1.85 (from August 2021)
+ //static inline float GetWindowContentRegionWidth() { return GetWindowContentRegionMax().x - GetWindowContentRegionMin().x; }
+ //-- OBSOLETED in 1.81 (from February 2021)
+ //static inline bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0, 0)) { return BeginListBox(label, size); }
+ //static inline bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1) { float height = GetTextLineHeightWithSpacing() * ((height_in_items < 0 ? ImMin(items_count, 7) : height_in_items) + 0.25f) + GetStyle().FramePadding.y * 2.0f; return BeginListBox(label, ImVec2(0.0f, height)); } // Helper to calculate size from items_count and height_in_items
+ //static inline void ListBoxFooter() { EndListBox(); }
//-- OBSOLETED in 1.79 (from August 2020)
//static inline void OpenPopupContextItem(const char* str_id = NULL, ImGuiMouseButton mb = 1) { OpenPopupOnItemClick(str_id, mb); } // Bool return value removed. Use IsWindowAppearing() in BeginPopup() instead. Renamed in 1.77, renamed back in 1.79. Sorry!
//-- OBSOLETED in 1.78 (from June 2020): Old drag/sliders functions that took a 'float power > 1.0f' argument instead of ImGuiSliderFlags_Logarithmic. See github.com/ocornut/imgui/issues/3361 for details.
@@ -3025,36 +3713,35 @@ namespace ImGui
//static inline void SetScrollPosHere() { SetScrollHere(); } // OBSOLETED in 1.42
}
-// OBSOLETED in 1.82 (from Mars 2021): flags for AddRect(), AddRectFilled(), AddImageRounded(), PathRect()
-typedef ImDrawFlags ImDrawCornerFlags;
-enum ImDrawCornerFlags_
-{
- ImDrawCornerFlags_None = ImDrawFlags_RoundCornersNone, // Was == 0 prior to 1.82, this is now == ImDrawFlags_RoundCornersNone which is != 0 and not implicit
- ImDrawCornerFlags_TopLeft = ImDrawFlags_RoundCornersTopLeft, // Was == 0x01 (1 << 0) prior to 1.82. Order matches ImDrawFlags_NoRoundCorner* flag (we exploit this internally).
- ImDrawCornerFlags_TopRight = ImDrawFlags_RoundCornersTopRight, // Was == 0x02 (1 << 1) prior to 1.82.
- ImDrawCornerFlags_BotLeft = ImDrawFlags_RoundCornersBottomLeft, // Was == 0x04 (1 << 2) prior to 1.82.
- ImDrawCornerFlags_BotRight = ImDrawFlags_RoundCornersBottomRight, // Was == 0x08 (1 << 3) prior to 1.82.
- ImDrawCornerFlags_All = ImDrawFlags_RoundCornersAll, // Was == 0x0F prior to 1.82
- ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight,
- ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight,
- ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft,
- ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight,
-};
+//-- OBSOLETED in 1.82 (from Mars 2021): flags for AddRect(), AddRectFilled(), AddImageRounded(), PathRect()
+//typedef ImDrawFlags ImDrawCornerFlags;
+//enum ImDrawCornerFlags_
+//{
+// ImDrawCornerFlags_None = ImDrawFlags_RoundCornersNone, // Was == 0 prior to 1.82, this is now == ImDrawFlags_RoundCornersNone which is != 0 and not implicit
+// ImDrawCornerFlags_TopLeft = ImDrawFlags_RoundCornersTopLeft, // Was == 0x01 (1 << 0) prior to 1.82. Order matches ImDrawFlags_NoRoundCorner* flag (we exploit this internally).
+// ImDrawCornerFlags_TopRight = ImDrawFlags_RoundCornersTopRight, // Was == 0x02 (1 << 1) prior to 1.82.
+// ImDrawCornerFlags_BotLeft = ImDrawFlags_RoundCornersBottomLeft, // Was == 0x04 (1 << 2) prior to 1.82.
+// ImDrawCornerFlags_BotRight = ImDrawFlags_RoundCornersBottomRight, // Was == 0x08 (1 << 3) prior to 1.82.
+// ImDrawCornerFlags_All = ImDrawFlags_RoundCornersAll, // Was == 0x0F prior to 1.82
+// ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight,
+// ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight,
+// ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft,
+// ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight,
+//};
// RENAMED and MERGED both ImGuiKey_ModXXX and ImGuiModFlags_XXX into ImGuiMod_XXX (from September 2022)
// RENAMED ImGuiKeyModFlags -> ImGuiModFlags in 1.88 (from April 2022). Exceptionally commented out ahead of obscolescence schedule to reduce confusion and because they were not meant to be used in the first place.
-typedef ImGuiKeyChord ImGuiModFlags; // == int. We generally use ImGuiKeyChord to mean "a ImGuiKey or-ed with any number of ImGuiMod_XXX value", but you may store only mods in there.
-enum ImGuiModFlags_ { ImGuiModFlags_None = 0, ImGuiModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiModFlags_Shift = ImGuiMod_Shift, ImGuiModFlags_Alt = ImGuiMod_Alt, ImGuiModFlags_Super = ImGuiMod_Super };
+//typedef ImGuiKeyChord ImGuiModFlags; // == int. We generally use ImGuiKeyChord to mean "a ImGuiKey or-ed with any number of ImGuiMod_XXX value", so you may store mods in there.
+//enum ImGuiModFlags_ { ImGuiModFlags_None = 0, ImGuiModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiModFlags_Shift = ImGuiMod_Shift, ImGuiModFlags_Alt = ImGuiMod_Alt, ImGuiModFlags_Super = ImGuiMod_Super };
//typedef ImGuiKeyChord ImGuiKeyModFlags; // == int
//enum ImGuiKeyModFlags_ { ImGuiKeyModFlags_None = 0, ImGuiKeyModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiKeyModFlags_Shift = ImGuiMod_Shift, ImGuiKeyModFlags_Alt = ImGuiMod_Alt, ImGuiKeyModFlags_Super = ImGuiMod_Super };
+#define IM_OFFSETOF(_TYPE,_MEMBER) offsetof(_TYPE, _MEMBER) // OBSOLETED IN 1.90 (now using C++11 standard version)
+
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
// RENAMED IMGUI_DISABLE_METRICS_WINDOW > IMGUI_DISABLE_DEBUG_TOOLS in 1.88 (from June 2022)
-#if defined(IMGUI_DISABLE_METRICS_WINDOW) && !defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && !defined(IMGUI_DISABLE_DEBUG_TOOLS)
-#define IMGUI_DISABLE_DEBUG_TOOLS
-#endif
-#if defined(IMGUI_DISABLE_METRICS_WINDOW) && defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS)
+#ifdef IMGUI_DISABLE_METRICS_WINDOW
#error IMGUI_DISABLE_METRICS_WINDOW was renamed to IMGUI_DISABLE_DEBUG_TOOLS, please use new name.
#endif
@@ -3070,9 +3757,14 @@ enum ImGuiModFlags_ { ImGuiModFlags_None = 0, ImGuiModFlags_Ctrl = ImGuiMod_Ctrl
#pragma warning (pop)
#endif
-// Include imgui_user.h at the end of imgui.h (convenient for user to only explicitly include vanilla imgui.h)
+// Include imgui_user.h at the end of imgui.h
+// May be convenient for some users to only explicitly include vanilla imgui.h and have extra stuff included.
#ifdef IMGUI_INCLUDE_IMGUI_USER_H
+#ifdef IMGUI_USER_H_FILENAME
+#include IMGUI_USER_H_FILENAME
+#else
#include "imgui_user.h"
#endif
+#endif
#endif // #ifndef IMGUI_DISABLE
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
index 56058693377..10fa434dca7 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
@@ -1,16 +1,23 @@
-// dear imgui, v1.89.1 WIP
+// dear imgui, v1.91.9b
// (demo code)
// Help:
-// - Read FAQ at http://dearimgui.org/faq
-// - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase.
+// - Read FAQ at http://dearimgui.com/faq
// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that.
-// Read imgui.cpp for more details, documentation and comments.
+// - Need help integrating Dear ImGui in your codebase?
+// - Read Getting Started https://github.com/ocornut/imgui/wiki/Getting-Started
+// - Read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase.
+// Read top of imgui.cpp and imgui.h for many details, documentation, comments, links.
// Get the latest version at https://github.com/ocornut/imgui
-// -------------------------------------------------
+// How to easily locate code?
+// - Use Tools->Item Picker to debug break in code by clicking any widgets: https://github.com/ocornut/imgui/wiki/Debug-Tools
+// - Browse an online version the demo with code linked to hovered widgets: https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html
+// - Find a visible string and search for it in the code!
+
+//---------------------------------------------------
// PLEASE DO NOT REMOVE THIS FILE FROM YOUR PROJECT!
-// -------------------------------------------------
+//---------------------------------------------------
// Message to the person tempted to delete this file when integrating Dear ImGui into their codebase:
// Think again! It is the most useful reference code that you and other coders will want to refer to and call.
// Have the ImGui::ShowDemoWindow() function wired in an always-available debug menu of your game/app!
@@ -24,27 +31,38 @@
// Thank you,
// -Your beloved friend, imgui_demo.cpp (which you won't delete)
-// Message to beginner C/C++ programmers about the meaning of the 'static' keyword:
-// In this demo code, we frequently use 'static' variables inside functions. A static variable persists across calls,
-// so it is essentially like a global variable but declared inside the scope of the function. We do this as a way to
-// gather code and data in the same place, to make the demo source code faster to read, faster to write, and smaller
-// in size. It also happens to be a convenient way of storing simple UI related information as long as your function
-// doesn't need to be reentrant or used in multiple threads. This might be a pattern you will want to use in your code,
-// but most of the real data you would be editing is likely going to be stored outside your functions.
-
+//--------------------------------------------
+// ABOUT THE MEANING OF THE 'static' KEYWORD:
+//--------------------------------------------
+// In this demo code, we frequently use 'static' variables inside functions.
+// A static variable persists across calls. It is essentially a global variable but declared inside the scope of the function.
+// Think of "static int n = 0;" as "global int n = 0;" !
+// We do this IN THE DEMO because we want:
+// - to gather code and data in the same place.
+// - to make the demo source code faster to read, faster to change, smaller in size.
+// - it is also a convenient way of storing simple UI related information as long as your function
+// doesn't need to be reentrant or used in multiple threads.
+// This might be a pattern you will want to use in your code, but most of the data you would be working
+// with in a complex codebase is likely going to be stored outside your functions.
+
+//-----------------------------------------
+// ABOUT THE CODING STYLE OF OUR DEMO CODE
+//-----------------------------------------
// The Demo code in this file is designed to be easy to copy-and-paste into your application!
// Because of this:
// - We never omit the ImGui:: prefix when calling functions, even though most code here is in the same namespace.
// - We try to declare static variables in the local scope, as close as possible to the code using them.
// - We never use any of the helpers/facilities used internally by Dear ImGui, unless available in the public API.
// - We never use maths operators on ImVec2/ImVec4. For our other sources files we use them, and they are provided
-// by imgui_internal.h using the IMGUI_DEFINE_MATH_OPERATORS define. For your own sources file they are optional
+// by imgui.h using the IMGUI_DEFINE_MATH_OPERATORS define. For your own sources file they are optional
// and require you either enable those, either provide your own via IM_VEC2_CLASS_EXTRA in imconfig.h.
// Because we can't assume anything about your support of maths operators, we cannot use them in imgui_demo.cpp.
// Navigating this file:
-// - In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
-// - With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
+// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
+// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments.
+// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments.
+// - You can search/grep for all sections listed in the index to find the section.
/*
@@ -53,12 +71,37 @@ Index of this file:
// [SECTION] Forward Declarations
// [SECTION] Helpers
// [SECTION] Demo Window / ShowDemoWindow()
-// - ShowDemoWindow()
-// - sub section: ShowDemoWindowWidgets()
-// - sub section: ShowDemoWindowLayout()
-// - sub section: ShowDemoWindowPopups()
-// - sub section: ShowDemoWindowTables()
-// - sub section: ShowDemoWindowInputs()
+// [SECTION] DemoWindowMenuBar()
+// [SECTION] Helpers: ExampleTreeNode, ExampleMemberInfo (for use by Property Editor & Multi-Select demos)
+// [SECTION] DemoWindowWidgetsBasic()
+// [SECTION] DemoWindowWidgetsBullets()
+// [SECTION] DemoWindowWidgetsCollapsingHeaders()
+// [SECTION] DemoWindowWidgetsComboBoxes()
+// [SECTION] DemoWindowWidgetsColorAndPickers()
+// [SECTION] DemoWindowWidgetsDataTypes()
+// [SECTION] DemoWindowWidgetsDisableBlocks()
+// [SECTION] DemoWindowWidgetsDragAndDrop()
+// [SECTION] DemoWindowWidgetsDragsAndSliders()
+// [SECTION] DemoWindowWidgetsImages()
+// [SECTION] DemoWindowWidgetsListBoxes()
+// [SECTION] DemoWindowWidgetsMultiComponents()
+// [SECTION] DemoWindowWidgetsPlotting()
+// [SECTION] DemoWindowWidgetsProgressBars()
+// [SECTION] DemoWindowWidgetsQueryingStatuses()
+// [SECTION] DemoWindowWidgetsSelectables()
+// [SECTION] DemoWindowWidgetsSelectionAndMultiSelect()
+// [SECTION] DemoWindowWidgetsTabs()
+// [SECTION] DemoWindowWidgetsText()
+// [SECTION] DemoWindowWidgetsTextFilter()
+// [SECTION] DemoWindowWidgetsTextInput()
+// [SECTION] DemoWindowWidgetsTooltips()
+// [SECTION] DemoWindowWidgetsTreeNodes()
+// [SECTION] DemoWindowWidgetsVerticalSliders()
+// [SECTION] DemoWindowWidgets()
+// [SECTION] DemoWindowLayout()
+// [SECTION] DemoWindowPopups()
+// [SECTION] DemoWindowTables()
+// [SECTION] DemoWindowInputs()
// [SECTION] About Window / ShowAboutWindow()
// [SECTION] Style Editor / ShowStyleEditor()
// [SECTION] User Guide / ShowUserGuide()
@@ -75,6 +118,7 @@ Index of this file:
// [SECTION] Example App: Manipulating window titles / ShowExampleAppWindowTitles()
// [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering()
// [SECTION] Example App: Documents Handling / ShowExampleAppDocuments()
+// [SECTION] Example App: Assets Browser / ShowExampleAppAssetsBrowser()
*/
@@ -91,10 +135,12 @@ Index of this file:
#include <math.h> // sqrtf, powf, cosf, sinf, floorf, ceilf
#include <stdio.h> // vsnprintf, sscanf, printf
#include <stdlib.h> // NULL, malloc, free, atoi
-#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
-#include <stddef.h> // intptr_t
-#else
#include <stdint.h> // intptr_t
+#if !defined(_MSC_VER) || _MSC_VER >= 1800
+#include <inttypes.h> // PRId64/PRIu64, not avail in some MinGW headers.
+#endif
+#ifdef __EMSCRIPTEN__
+#include <emscripten/version.h> // __EMSCRIPTEN_major__ etc.
#endif
// Visual Studio warnings
@@ -113,6 +159,7 @@ Index of this file:
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
#pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning: 'xx' is deprecated: The POSIX name for this.. // for strdup used in demo code (so user can copy & paste the code)
#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning: cast to 'void *' from smaller integer type
+#pragma clang diagnostic ignored "-Wformat" // warning: format specifies type 'int' but the argument has type 'unsigned int'
#pragma clang diagnostic ignored "-Wformat-security" // warning: format string is not a string literal
#pragma clang diagnostic ignored "-Wexit-time-destructors" // warning: declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals.
#pragma clang diagnostic ignored "-Wunused-macros" // warning: macro is not used // we define snprintf/vsnprintf on Windows so they are available, but not always used.
@@ -120,13 +167,19 @@ Index of this file:
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning: macro name is a reserved identifier
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
+#pragma clang diagnostic ignored "-Wswitch-default" // warning: 'switch' missing 'default' label
#elif defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
-#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
-#pragma GCC diagnostic ignored "-Wformat-security" // warning: format string is not a string literal (potentially insecure)
-#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
-#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
-#pragma GCC diagnostic ignored "-Wmisleading-indentation" // [__GNUC__ >= 6] warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub.
+#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
+#pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
+#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'int'/'void*', but argument X has type 'unsigned int'/'ImGuiWindow*'
+#pragma GCC diagnostic ignored "-Wformat-security" // warning: format string is not a string literal (potentially insecure)
+#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
+#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
+#pragma GCC diagnostic ignored "-Wmisleading-indentation" // [__GNUC__ >= 6] warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub.
+#pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when simplifying division / ..when changing X +- C1 cmp C2 to X cmp C2 -+ C1
+#pragma GCC diagnostic ignored "-Wcast-qual" // warning: cast from type 'const xxxx *' to type 'xxxx *' casts away qualifiers
#endif
// Play it nice with Windows users (Update: May 2018, Notepad now supports Unix-style carriage returns!)
@@ -144,14 +197,13 @@ Index of this file:
#define vsnprintf _vsnprintf
#endif
-// Format specifiers, printing 64-bit hasn't been decently standardized...
-// In a real application you should be using PRId64 and PRIu64 from <inttypes.h> (non-windows) and on Windows define them yourself.
-#ifdef _MSC_VER
-#define IM_PRId64 "I64d"
-#define IM_PRIu64 "I64u"
-#else
-#define IM_PRId64 "lld"
-#define IM_PRIu64 "llu"
+// Format specifiers for 64-bit values (hasn't been decently standardized before VS2013)
+#if !defined(PRId64) && defined(_MSC_VER)
+#define PRId64 "I64d"
+#define PRIu64 "I64u"
+#elif !defined(PRId64)
+#define PRId64 "lld"
+#define PRIu64 "llu"
#endif
// Helpers macros
@@ -162,7 +214,8 @@ Index of this file:
#define IM_MAX(A, B) (((A) >= (B)) ? (A) : (B))
#define IM_CLAMP(V, MN, MX) ((V) < (MN) ? (MN) : (V) > (MX) ? (MX) : (V))
-// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
+// Enforce cdecl calling convention for functions called by the standard library,
+// in case compilation settings changed the default to e.g. __vectorcall
#ifndef IMGUI_CDECL
#ifdef _MSC_VER
#define IMGUI_CDECL __cdecl
@@ -172,35 +225,43 @@ Index of this file:
#endif
//-----------------------------------------------------------------------------
-// [SECTION] Forward Declarations, Helpers
+// [SECTION] Forward Declarations
//-----------------------------------------------------------------------------
#if !defined(IMGUI_DISABLE_DEMO_WINDOWS)
// Forward Declarations
-static void ShowExampleAppDocuments(bool* p_open);
+struct ImGuiDemoWindowData;
static void ShowExampleAppMainMenuBar();
+static void ShowExampleAppAssetsBrowser(bool* p_open);
static void ShowExampleAppConsole(bool* p_open);
+static void ShowExampleAppCustomRendering(bool* p_open);
+static void ShowExampleAppDocuments(bool* p_open);
static void ShowExampleAppLog(bool* p_open);
static void ShowExampleAppLayout(bool* p_open);
-static void ShowExampleAppPropertyEditor(bool* p_open);
-static void ShowExampleAppLongText(bool* p_open);
+static void ShowExampleAppPropertyEditor(bool* p_open, ImGuiDemoWindowData* demo_data);
+static void ShowExampleAppSimpleOverlay(bool* p_open);
static void ShowExampleAppAutoResize(bool* p_open);
static void ShowExampleAppConstrainedResize(bool* p_open);
-static void ShowExampleAppSimpleOverlay(bool* p_open);
static void ShowExampleAppFullscreen(bool* p_open);
+static void ShowExampleAppLongText(bool* p_open);
static void ShowExampleAppWindowTitles(bool* p_open);
-static void ShowExampleAppCustomRendering(bool* p_open);
static void ShowExampleMenuFile();
// We split the contents of the big ShowDemoWindow() function into smaller functions
-// (because the link time of very large functions grow non-linearly)
-static void ShowDemoWindowWidgets();
-static void ShowDemoWindowLayout();
-static void ShowDemoWindowPopups();
-static void ShowDemoWindowTables();
-static void ShowDemoWindowColumns();
-static void ShowDemoWindowInputs();
+// (because the link time of very large functions tends to grow non-linearly)
+static void DemoWindowMenuBar(ImGuiDemoWindowData* demo_data);
+static void DemoWindowWidgets(ImGuiDemoWindowData* demo_data);
+static void DemoWindowLayout();
+static void DemoWindowPopups();
+static void DemoWindowTables();
+static void DemoWindowColumns();
+static void DemoWindowInputs();
+
+// Helper tree functions used by Property Editor & Multi-Select demos
+struct ExampleTreeNode;
+static ExampleTreeNode* ExampleTree_CreateNode(const char* name, int uid, ExampleTreeNode* parent);
+static void ExampleTree_DestroyNode(ExampleTreeNode* node);
//-----------------------------------------------------------------------------
// [SECTION] Helpers
@@ -211,9 +272,8 @@ static void ShowDemoWindowInputs();
static void HelpMarker(const char* desc)
{
ImGui::TextDisabled("(?)");
- if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort))
+ if (ImGui::BeginItemTooltip())
{
- ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
ImGui::TextUnformatted(desc);
ImGui::PopTextWrapPos();
@@ -232,14 +292,39 @@ void* GImGuiDemoMarkerCallbackUserData = NULL;
//-----------------------------------------------------------------------------
// [SECTION] Demo Window / ShowDemoWindow()
//-----------------------------------------------------------------------------
-// - ShowDemoWindow()
-// - ShowDemoWindowWidgets()
-// - ShowDemoWindowLayout()
-// - ShowDemoWindowPopups()
-// - ShowDemoWindowTables()
-// - ShowDemoWindowColumns()
-// - ShowDemoWindowInputs()
-//-----------------------------------------------------------------------------
+
+// Data to be shared across different functions of the demo.
+struct ImGuiDemoWindowData
+{
+ // Examples Apps (accessible from the "Examples" menu)
+ bool ShowMainMenuBar = false;
+ bool ShowAppAssetsBrowser = false;
+ bool ShowAppConsole = false;
+ bool ShowAppCustomRendering = false;
+ bool ShowAppDocuments = false;
+ bool ShowAppLog = false;
+ bool ShowAppLayout = false;
+ bool ShowAppPropertyEditor = false;
+ bool ShowAppSimpleOverlay = false;
+ bool ShowAppAutoResize = false;
+ bool ShowAppConstrainedResize = false;
+ bool ShowAppFullscreen = false;
+ bool ShowAppLongText = false;
+ bool ShowAppWindowTitles = false;
+
+ // Dear ImGui Tools (accessible from the "Tools" menu)
+ bool ShowMetrics = false;
+ bool ShowDebugLog = false;
+ bool ShowIDStackTool = false;
+ bool ShowStyleEditor = false;
+ bool ShowAbout = false;
+
+ // Other data
+ bool DisableSections = false;
+ ExampleTreeNode* DemoTree = NULL;
+
+ ~ImGuiDemoWindowData() { if (DemoTree) ExampleTree_DestroyNode(DemoTree); }
+};
// Demonstrate most Dear ImGui features (this is big function!)
// You may execute this function to experiment with the UI and understand what it does.
@@ -247,56 +332,39 @@ void* GImGuiDemoMarkerCallbackUserData = NULL;
void ImGui::ShowDemoWindow(bool* p_open)
{
// Exceptionally add an extra assert here for people confused about initial Dear ImGui setup
- // Most functions would normally just crash if the context is missing.
- IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing dear imgui context. Refer to examples app!");
+ // Most functions would normally just assert/crash if the context is missing.
+ IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing Dear ImGui context. Refer to examples app!");
+
+ // Verify ABI compatibility between caller code and compiled version of Dear ImGui. This helps detects some build issues.
+ IMGUI_CHECKVERSION();
+
+ // Stored data
+ static ImGuiDemoWindowData demo_data;
// Examples Apps (accessible from the "Examples" menu)
- static bool show_app_main_menu_bar = false;
- static bool show_app_documents = false;
- static bool show_app_console = false;
- static bool show_app_log = false;
- static bool show_app_layout = false;
- static bool show_app_property_editor = false;
- static bool show_app_long_text = false;
- static bool show_app_auto_resize = false;
- static bool show_app_constrained_resize = false;
- static bool show_app_simple_overlay = false;
- static bool show_app_fullscreen = false;
- static bool show_app_window_titles = false;
- static bool show_app_custom_rendering = false;
-
- if (show_app_main_menu_bar) ShowExampleAppMainMenuBar();
- if (show_app_documents) ShowExampleAppDocuments(&show_app_documents);
- if (show_app_console) ShowExampleAppConsole(&show_app_console);
- if (show_app_log) ShowExampleAppLog(&show_app_log);
- if (show_app_layout) ShowExampleAppLayout(&show_app_layout);
- if (show_app_property_editor) ShowExampleAppPropertyEditor(&show_app_property_editor);
- if (show_app_long_text) ShowExampleAppLongText(&show_app_long_text);
- if (show_app_auto_resize) ShowExampleAppAutoResize(&show_app_auto_resize);
- if (show_app_constrained_resize) ShowExampleAppConstrainedResize(&show_app_constrained_resize);
- if (show_app_simple_overlay) ShowExampleAppSimpleOverlay(&show_app_simple_overlay);
- if (show_app_fullscreen) ShowExampleAppFullscreen(&show_app_fullscreen);
- if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles);
- if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering);
-
- // Dear ImGui Tools/Apps (accessible from the "Tools" menu)
- static bool show_app_metrics = false;
- static bool show_app_debug_log = false;
- static bool show_app_stack_tool = false;
- static bool show_app_about = false;
- static bool show_app_style_editor = false;
-
- if (show_app_metrics)
- ImGui::ShowMetricsWindow(&show_app_metrics);
- if (show_app_debug_log)
- ImGui::ShowDebugLogWindow(&show_app_debug_log);
- if (show_app_stack_tool)
- ImGui::ShowStackToolWindow(&show_app_stack_tool);
- if (show_app_about)
- ImGui::ShowAboutWindow(&show_app_about);
- if (show_app_style_editor)
- {
- ImGui::Begin("Dear ImGui Style Editor", &show_app_style_editor);
+ if (demo_data.ShowMainMenuBar) { ShowExampleAppMainMenuBar(); }
+ if (demo_data.ShowAppDocuments) { ShowExampleAppDocuments(&demo_data.ShowAppDocuments); }
+ if (demo_data.ShowAppAssetsBrowser) { ShowExampleAppAssetsBrowser(&demo_data.ShowAppAssetsBrowser); }
+ if (demo_data.ShowAppConsole) { ShowExampleAppConsole(&demo_data.ShowAppConsole); }
+ if (demo_data.ShowAppCustomRendering) { ShowExampleAppCustomRendering(&demo_data.ShowAppCustomRendering); }
+ if (demo_data.ShowAppLog) { ShowExampleAppLog(&demo_data.ShowAppLog); }
+ if (demo_data.ShowAppLayout) { ShowExampleAppLayout(&demo_data.ShowAppLayout); }
+ if (demo_data.ShowAppPropertyEditor) { ShowExampleAppPropertyEditor(&demo_data.ShowAppPropertyEditor, &demo_data); }
+ if (demo_data.ShowAppSimpleOverlay) { ShowExampleAppSimpleOverlay(&demo_data.ShowAppSimpleOverlay); }
+ if (demo_data.ShowAppAutoResize) { ShowExampleAppAutoResize(&demo_data.ShowAppAutoResize); }
+ if (demo_data.ShowAppConstrainedResize) { ShowExampleAppConstrainedResize(&demo_data.ShowAppConstrainedResize); }
+ if (demo_data.ShowAppFullscreen) { ShowExampleAppFullscreen(&demo_data.ShowAppFullscreen); }
+ if (demo_data.ShowAppLongText) { ShowExampleAppLongText(&demo_data.ShowAppLongText); }
+ if (demo_data.ShowAppWindowTitles) { ShowExampleAppWindowTitles(&demo_data.ShowAppWindowTitles); }
+
+ // Dear ImGui Tools (accessible from the "Tools" menu)
+ if (demo_data.ShowMetrics) { ImGui::ShowMetricsWindow(&demo_data.ShowMetrics); }
+ if (demo_data.ShowDebugLog) { ImGui::ShowDebugLogWindow(&demo_data.ShowDebugLog); }
+ if (demo_data.ShowIDStackTool) { ImGui::ShowIDStackToolWindow(&demo_data.ShowIDStackTool); }
+ if (demo_data.ShowAbout) { ImGui::ShowAboutWindow(&demo_data.ShowAbout); }
+ if (demo_data.ShowStyleEditor)
+ {
+ ImGui::Begin("Dear ImGui Style Editor", &demo_data.ShowStyleEditor);
ImGui::ShowStyleEditor();
ImGui::End();
}
@@ -342,56 +410,11 @@ void ImGui::ShowDemoWindow(bool* p_open)
}
// Most "big" widgets share a common width settings by default. See 'Demo->Layout->Widgets Width' for details.
- // e.g. Use 2/3 of the space for widgets and 1/3 for labels (right align)
- //ImGui::PushItemWidth(-ImGui::GetWindowWidth() * 0.35f);
- // e.g. Leave a fixed amount of width for labels (by passing a negative value), the rest goes to widgets.
- ImGui::PushItemWidth(ImGui::GetFontSize() * -12);
+ ImGui::PushItemWidth(ImGui::GetFontSize() * -12); // e.g. Leave a fixed amount of width for labels (by passing a negative value), the rest goes to widgets.
+ //ImGui::PushItemWidth(-ImGui::GetWindowWidth() * 0.35f); // e.g. Use 2/3 of the space for widgets and 1/3 for labels (right align)
// Menu Bar
- if (ImGui::BeginMenuBar())
- {
- if (ImGui::BeginMenu("Menu"))
- {
- IMGUI_DEMO_MARKER("Menu/File");
- ShowExampleMenuFile();
- ImGui::EndMenu();
- }
- if (ImGui::BeginMenu("Examples"))
- {
- IMGUI_DEMO_MARKER("Menu/Examples");
- ImGui::MenuItem("Main menu bar", NULL, &show_app_main_menu_bar);
- ImGui::MenuItem("Console", NULL, &show_app_console);
- ImGui::MenuItem("Log", NULL, &show_app_log);
- ImGui::MenuItem("Simple layout", NULL, &show_app_layout);
- ImGui::MenuItem("Property editor", NULL, &show_app_property_editor);
- ImGui::MenuItem("Long text display", NULL, &show_app_long_text);
- ImGui::MenuItem("Auto-resizing window", NULL, &show_app_auto_resize);
- ImGui::MenuItem("Constrained-resizing window", NULL, &show_app_constrained_resize);
- ImGui::MenuItem("Simple overlay", NULL, &show_app_simple_overlay);
- ImGui::MenuItem("Fullscreen window", NULL, &show_app_fullscreen);
- ImGui::MenuItem("Manipulating window titles", NULL, &show_app_window_titles);
- ImGui::MenuItem("Custom rendering", NULL, &show_app_custom_rendering);
- ImGui::MenuItem("Documents", NULL, &show_app_documents);
- ImGui::EndMenu();
- }
- //if (ImGui::MenuItem("MenuItem")) {} // You can also use MenuItem() inside a menu bar!
- if (ImGui::BeginMenu("Tools"))
- {
- IMGUI_DEMO_MARKER("Menu/Tools");
-#ifndef IMGUI_DISABLE_DEBUG_TOOLS
- const bool has_debug_tools = true;
-#else
- const bool has_debug_tools = false;
-#endif
- ImGui::MenuItem("Metrics/Debugger", NULL, &show_app_metrics, has_debug_tools);
- ImGui::MenuItem("Debug Log", NULL, &show_app_debug_log, has_debug_tools);
- ImGui::MenuItem("Stack Tool", NULL, &show_app_stack_tool, has_debug_tools);
- ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor);
- ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about);
- ImGui::EndMenu();
- }
- ImGui::EndMenuBar();
- }
+ DemoWindowMenuBar(&demo_data);
ImGui::Text("dear imgui says hello! (%s) (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM);
ImGui::Spacing();
@@ -399,23 +422,23 @@ void ImGui::ShowDemoWindow(bool* p_open)
IMGUI_DEMO_MARKER("Help");
if (ImGui::CollapsingHeader("Help"))
{
- ImGui::Text("ABOUT THIS DEMO:");
+ ImGui::SeparatorText("ABOUT THIS DEMO:");
ImGui::BulletText("Sections below are demonstrating many aspects of the library.");
ImGui::BulletText("The \"Examples\" menu above leads to more demo contents.");
ImGui::BulletText("The \"Tools\" menu above gives access to: About Box, Style Editor,\n"
"and Metrics/Debugger (general purpose Dear ImGui debugging tool).");
- ImGui::Separator();
- ImGui::Text("PROGRAMMER GUIDE:");
+ ImGui::SeparatorText("PROGRAMMER GUIDE:");
ImGui::BulletText("See the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
ImGui::BulletText("See comments in imgui.cpp.");
ImGui::BulletText("See example applications in the examples/ folder.");
- ImGui::BulletText("Read the FAQ at http://www.dearimgui.org/faq/");
+ ImGui::BulletText("Read the FAQ at ");
+ ImGui::SameLine(0, 0);
+ ImGui::TextLinkOpenURL("https://www.dearimgui.com/faq/");
ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
- ImGui::Separator();
- ImGui::Text("USER GUIDE:");
+ ImGui::SeparatorText("USER GUIDE:");
ImGui::ShowUserGuide();
}
@@ -426,42 +449,107 @@ void ImGui::ShowDemoWindow(bool* p_open)
if (ImGui::TreeNode("Configuration##2"))
{
+ ImGui::SeparatorText("General");
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", &io.ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard);
ImGui::SameLine(); HelpMarker("Enable keyboard controls.");
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableGamepad", &io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad);
ImGui::SameLine(); HelpMarker("Enable gamepad controls. Require backend to set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details.");
- ImGui::CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", &io.ConfigFlags, ImGuiConfigFlags_NavEnableSetMousePos);
- ImGui::SameLine(); HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos.");
ImGui::CheckboxFlags("io.ConfigFlags: NoMouse", &io.ConfigFlags, ImGuiConfigFlags_NoMouse);
+ ImGui::SameLine(); HelpMarker("Instruct dear imgui to disable mouse inputs and interactions.");
+
+ // The "NoMouse" option can get us stuck with a disabled mouse! Let's provide an alternative way to fix it:
if (io.ConfigFlags & ImGuiConfigFlags_NoMouse)
{
- // The "NoMouse" option can get us stuck with a disabled mouse! Let's provide an alternative way to fix it:
if (fmodf((float)ImGui::GetTime(), 0.40f) < 0.20f)
{
ImGui::SameLine();
ImGui::Text("<<PRESS SPACE TO DISABLE>>");
}
- if (ImGui::IsKeyPressed(ImGuiKey_Space))
+ // Prevent both being checked
+ if (ImGui::IsKeyPressed(ImGuiKey_Space) || (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard))
io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse;
}
- ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", &io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange);
+
+ ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", &io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange);
ImGui::SameLine(); HelpMarker("Instruct backend to not alter mouse cursor shape and visibility.");
+ ImGui::CheckboxFlags("io.ConfigFlags: NoKeyboard", &io.ConfigFlags, ImGuiConfigFlags_NoKeyboard);
+ ImGui::SameLine(); HelpMarker("Instruct dear imgui to disable keyboard inputs and interactions.");
+
ImGui::Checkbox("io.ConfigInputTrickleEventQueue", &io.ConfigInputTrickleEventQueue);
ImGui::SameLine(); HelpMarker("Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates.");
+ ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor);
+ ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor itself. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).");
+
+ ImGui::SeparatorText("Keyboard/Gamepad Navigation");
+ ImGui::Checkbox("io.ConfigNavSwapGamepadButtons", &io.ConfigNavSwapGamepadButtons);
+ ImGui::Checkbox("io.ConfigNavMoveSetMousePos", &io.ConfigNavMoveSetMousePos);
+ ImGui::SameLine(); HelpMarker("Directional/tabbing navigation teleports the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is difficult");
+ ImGui::Checkbox("io.ConfigNavCaptureKeyboard", &io.ConfigNavCaptureKeyboard);
+ ImGui::Checkbox("io.ConfigNavEscapeClearFocusItem", &io.ConfigNavEscapeClearFocusItem);
+ ImGui::SameLine(); HelpMarker("Pressing Escape clears focused item.");
+ ImGui::Checkbox("io.ConfigNavEscapeClearFocusWindow", &io.ConfigNavEscapeClearFocusWindow);
+ ImGui::SameLine(); HelpMarker("Pressing Escape clears focused window.");
+ ImGui::Checkbox("io.ConfigNavCursorVisibleAuto", &io.ConfigNavCursorVisibleAuto);
+ ImGui::SameLine(); HelpMarker("Using directional navigation key makes the cursor visible. Mouse click hides the cursor.");
+ ImGui::Checkbox("io.ConfigNavCursorVisibleAlways", &io.ConfigNavCursorVisibleAlways);
+ ImGui::SameLine(); HelpMarker("Navigation cursor is always visible.");
+
+ ImGui::SeparatorText("Windows");
+ ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges);
+ ImGui::SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires ImGuiBackendFlags_HasMouseCursors for better mouse cursor feedback.");
+ ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly);
+ ImGui::Checkbox("io.ConfigWindowsCopyContentsWithCtrlC", &io.ConfigWindowsCopyContentsWithCtrlC); // [EXPERIMENTAL]
+ ImGui::SameLine(); HelpMarker("*EXPERIMENTAL* CTRL+C copy the contents of focused window into the clipboard.\n\nExperimental because:\n- (1) has known issues with nested Begin/End pairs.\n- (2) text output quality varies.\n- (3) text output is in submission order rather than spatial order.");
+ ImGui::Checkbox("io.ConfigScrollbarScrollByPage", &io.ConfigScrollbarScrollByPage);
+ ImGui::SameLine(); HelpMarker("Enable scrolling page by page when clicking outside the scrollbar grab.\nWhen disabled, always scroll to clicked location.\nWhen enabled, Shift+Click scrolls to clicked location.");
+
+ ImGui::SeparatorText("Widgets");
ImGui::Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink);
ImGui::SameLine(); HelpMarker("Enable blinking cursor (optional as some users consider it to be distracting).");
ImGui::Checkbox("io.ConfigInputTextEnterKeepActive", &io.ConfigInputTextEnterKeepActive);
ImGui::SameLine(); HelpMarker("Pressing Enter will keep item active and select contents (single-line only).");
ImGui::Checkbox("io.ConfigDragClickToInputText", &io.ConfigDragClickToInputText);
ImGui::SameLine(); HelpMarker("Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving).");
- ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges);
- ImGui::SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback.");
- ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly);
- ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor);
- ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor itself. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).");
+ ImGui::Checkbox("io.ConfigMacOSXBehaviors", &io.ConfigMacOSXBehaviors);
+ ImGui::SameLine(); HelpMarker("Swap Cmd<>Ctrl keys, enable various MacOS style behaviors.");
ImGui::Text("Also see Style->Rendering for rendering options.");
+
+ // Also read: https://github.com/ocornut/imgui/wiki/Error-Handling
+ ImGui::SeparatorText("Error Handling");
+
+ ImGui::Checkbox("io.ConfigErrorRecovery", &io.ConfigErrorRecovery);
+ ImGui::SameLine(); HelpMarker(
+ "Options to configure how we handle recoverable errors.\n"
+ "- Error recovery is not perfect nor guaranteed! It is a feature to ease development.\n"
+ "- You not are not supposed to rely on it in the course of a normal application run.\n"
+ "- Possible usage: facilitate recovery from errors triggered from a scripting language or after specific exceptions handlers.\n"
+ "- Always ensure that on programmers seat you have at minimum Asserts or Tooltips enabled when making direct imgui API call! "
+ "Otherwise it would severely hinder your ability to catch and correct mistakes!");
+ ImGui::Checkbox("io.ConfigErrorRecoveryEnableAssert", &io.ConfigErrorRecoveryEnableAssert);
+ ImGui::Checkbox("io.ConfigErrorRecoveryEnableDebugLog", &io.ConfigErrorRecoveryEnableDebugLog);
+ ImGui::Checkbox("io.ConfigErrorRecoveryEnableTooltip", &io.ConfigErrorRecoveryEnableTooltip);
+ if (!io.ConfigErrorRecoveryEnableAssert && !io.ConfigErrorRecoveryEnableDebugLog && !io.ConfigErrorRecoveryEnableTooltip)
+ io.ConfigErrorRecoveryEnableAssert = io.ConfigErrorRecoveryEnableDebugLog = io.ConfigErrorRecoveryEnableTooltip = true;
+
+ // Also read: https://github.com/ocornut/imgui/wiki/Debug-Tools
+ ImGui::SeparatorText("Debug");
+ ImGui::Checkbox("io.ConfigDebugIsDebuggerPresent", &io.ConfigDebugIsDebuggerPresent);
+ ImGui::SameLine(); HelpMarker("Enable various tools calling IM_DEBUG_BREAK().\n\nRequires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application.");
+ ImGui::Checkbox("io.ConfigDebugHighlightIdConflicts", &io.ConfigDebugHighlightIdConflicts);
+ ImGui::SameLine(); HelpMarker("Highlight and show an error message when multiple items have conflicting identifiers.");
+ ImGui::BeginDisabled();
+ ImGui::Checkbox("io.ConfigDebugBeginReturnValueOnce", &io.ConfigDebugBeginReturnValueOnce);
+ ImGui::EndDisabled();
+ ImGui::SameLine(); HelpMarker("First calls to Begin()/BeginChild() will return false.\n\nTHIS OPTION IS DISABLED because it needs to be set at application boot-time to make sense. Showing the disabled option is a way to make this feature easier to discover.");
+ ImGui::Checkbox("io.ConfigDebugBeginReturnValueLoop", &io.ConfigDebugBeginReturnValueLoop);
+ ImGui::SameLine(); HelpMarker("Some calls to Begin()/BeginChild() will return false.\n\nWill cycle through window depths then repeat. Windows should be flickering while running.");
+ ImGui::Checkbox("io.ConfigDebugIgnoreFocusLoss", &io.ConfigDebugIgnoreFocusLoss);
+ ImGui::SameLine(); HelpMarker("Option to deactivate io.AddFocusEvent(false) handling. May facilitate interactions with a debugger when focus loss leads to clearing inputs data.");
+ ImGui::Checkbox("io.ConfigDebugIniSettings", &io.ConfigDebugIniSettings);
+ ImGui::SameLine(); HelpMarker("Option to save .ini data with extra comments (particularly helpful for Docking, but makes saving slower).");
+
ImGui::TreePop();
- ImGui::Separator();
+ ImGui::Spacing();
}
IMGUI_DEMO_MARKER("Configuration/Backend Flags");
@@ -471,24 +559,26 @@ void ImGui::ShowDemoWindow(bool* p_open)
"Those flags are set by the backends (imgui_impl_xxx files) to specify their capabilities.\n"
"Here we expose them as read-only fields to avoid breaking interactions with your backend.");
- // Make a local copy to avoid modifying actual backend flags.
- // FIXME: We don't use BeginDisabled() to keep label bright, maybe we need a BeginReadonly() equivalent..
- ImGuiBackendFlags backend_flags = io.BackendFlags;
- ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", &backend_flags, ImGuiBackendFlags_HasGamepad);
- ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", &backend_flags, ImGuiBackendFlags_HasMouseCursors);
- ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", &backend_flags, ImGuiBackendFlags_HasSetMousePos);
- ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &backend_flags, ImGuiBackendFlags_RendererHasVtxOffset);
+ // FIXME: Maybe we need a BeginReadonly() equivalent to keep label bright?
+ ImGui::BeginDisabled();
+ ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", &io.BackendFlags, ImGuiBackendFlags_HasGamepad);
+ ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", &io.BackendFlags, ImGuiBackendFlags_HasMouseCursors);
+ ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", &io.BackendFlags, ImGuiBackendFlags_HasSetMousePos);
+ ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &io.BackendFlags, ImGuiBackendFlags_RendererHasVtxOffset);
+ ImGui::EndDisabled();
+
ImGui::TreePop();
- ImGui::Separator();
+ ImGui::Spacing();
}
IMGUI_DEMO_MARKER("Configuration/Style");
if (ImGui::TreeNode("Style"))
{
+ ImGui::Checkbox("Style Editor", &demo_data.ShowStyleEditor);
+ ImGui::SameLine();
HelpMarker("The same contents can be accessed in 'Tools->Style Editor' or by calling the ShowStyleEditor() function.");
- ImGui::ShowStyleEditor();
ImGui::TreePop();
- ImGui::Separator();
+ ImGui::Spacing();
}
IMGUI_DEMO_MARKER("Configuration/Capture, Logging");
@@ -532,30 +622,194 @@ void ImGui::ShowDemoWindow(bool* p_open)
}
// All demo contents
- ShowDemoWindowWidgets();
- ShowDemoWindowLayout();
- ShowDemoWindowPopups();
- ShowDemoWindowTables();
- ShowDemoWindowInputs();
+ DemoWindowWidgets(&demo_data);
+ DemoWindowLayout();
+ DemoWindowPopups();
+ DemoWindowTables();
+ DemoWindowInputs();
// End of ShowDemoWindow()
ImGui::PopItemWidth();
ImGui::End();
}
-static void ShowDemoWindowWidgets()
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowMenuBar()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowMenuBar(ImGuiDemoWindowData* demo_data)
{
- IMGUI_DEMO_MARKER("Widgets");
- if (!ImGui::CollapsingHeader("Widgets"))
- return;
+ IMGUI_DEMO_MARKER("Menu");
+ if (ImGui::BeginMenuBar())
+ {
+ if (ImGui::BeginMenu("Menu"))
+ {
+ IMGUI_DEMO_MARKER("Menu/File");
+ ShowExampleMenuFile();
+ ImGui::EndMenu();
+ }
+ if (ImGui::BeginMenu("Examples"))
+ {
+ IMGUI_DEMO_MARKER("Menu/Examples");
+ ImGui::MenuItem("Main menu bar", NULL, &demo_data->ShowMainMenuBar);
+
+ ImGui::SeparatorText("Mini apps");
+ ImGui::MenuItem("Assets Browser", NULL, &demo_data->ShowAppAssetsBrowser);
+ ImGui::MenuItem("Console", NULL, &demo_data->ShowAppConsole);
+ ImGui::MenuItem("Custom rendering", NULL, &demo_data->ShowAppCustomRendering);
+ ImGui::MenuItem("Documents", NULL, &demo_data->ShowAppDocuments);
+ ImGui::MenuItem("Log", NULL, &demo_data->ShowAppLog);
+ ImGui::MenuItem("Property editor", NULL, &demo_data->ShowAppPropertyEditor);
+ ImGui::MenuItem("Simple layout", NULL, &demo_data->ShowAppLayout);
+ ImGui::MenuItem("Simple overlay", NULL, &demo_data->ShowAppSimpleOverlay);
+
+ ImGui::SeparatorText("Concepts");
+ ImGui::MenuItem("Auto-resizing window", NULL, &demo_data->ShowAppAutoResize);
+ ImGui::MenuItem("Constrained-resizing window", NULL, &demo_data->ShowAppConstrainedResize);
+ ImGui::MenuItem("Fullscreen window", NULL, &demo_data->ShowAppFullscreen);
+ ImGui::MenuItem("Long text display", NULL, &demo_data->ShowAppLongText);
+ ImGui::MenuItem("Manipulating window titles", NULL, &demo_data->ShowAppWindowTitles);
- static bool disable_all = false; // The Checkbox for that is inside the "Disabled" section at the bottom
- if (disable_all)
- ImGui::BeginDisabled();
+ ImGui::EndMenu();
+ }
+ //if (ImGui::MenuItem("MenuItem")) {} // You can also use MenuItem() inside a menu bar!
+ if (ImGui::BeginMenu("Tools"))
+ {
+ IMGUI_DEMO_MARKER("Menu/Tools");
+ ImGuiIO& io = ImGui::GetIO();
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ const bool has_debug_tools = true;
+#else
+ const bool has_debug_tools = false;
+#endif
+ ImGui::MenuItem("Metrics/Debugger", NULL, &demo_data->ShowMetrics, has_debug_tools);
+ if (ImGui::BeginMenu("Debug Options"))
+ {
+ ImGui::BeginDisabled(!has_debug_tools);
+ ImGui::Checkbox("Highlight ID Conflicts", &io.ConfigDebugHighlightIdConflicts);
+ ImGui::EndDisabled();
+ ImGui::Checkbox("Assert on error recovery", &io.ConfigErrorRecoveryEnableAssert);
+ ImGui::TextDisabled("(see Demo->Configuration for details & more)");
+ ImGui::EndMenu();
+ }
+ ImGui::MenuItem("Debug Log", NULL, &demo_data->ShowDebugLog, has_debug_tools);
+ ImGui::MenuItem("ID Stack Tool", NULL, &demo_data->ShowIDStackTool, has_debug_tools);
+ bool is_debugger_present = io.ConfigDebugIsDebuggerPresent;
+ if (ImGui::MenuItem("Item Picker", NULL, false, has_debug_tools))// && is_debugger_present))
+ ImGui::DebugStartItemPicker();
+ if (!is_debugger_present)
+ ImGui::SetItemTooltip("Requires io.ConfigDebugIsDebuggerPresent=true to be set.\n\nWe otherwise disable some extra features to avoid casual users crashing the application.");
+ ImGui::MenuItem("Style Editor", NULL, &demo_data->ShowStyleEditor);
+ ImGui::MenuItem("About Dear ImGui", NULL, &demo_data->ShowAbout);
+
+ ImGui::EndMenu();
+ }
+ ImGui::EndMenuBar();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] Helpers: ExampleTreeNode, ExampleMemberInfo (for use by Property Editor & Multi-Select demos)
+//-----------------------------------------------------------------------------
+
+// Simple representation for a tree
+// (this is designed to be simple to understand for our demos, not to be fancy or efficient etc.)
+struct ExampleTreeNode
+{
+ // Tree structure
+ char Name[28] = "";
+ int UID = 0;
+ ExampleTreeNode* Parent = NULL;
+ ImVector<ExampleTreeNode*> Childs;
+ unsigned short IndexInParent = 0; // Maintaining this allows us to implement linear traversal more easily
+
+ // Leaf Data
+ bool HasData = false; // All leaves have data
+ bool DataMyBool = true;
+ int DataMyInt = 128;
+ ImVec2 DataMyVec2 = ImVec2(0.0f, 3.141592f);
+};
+// Simple representation of struct metadata/serialization data.
+// (this is a minimal version of what a typical advanced application may provide)
+struct ExampleMemberInfo
+{
+ const char* Name; // Member name
+ ImGuiDataType DataType; // Member type
+ int DataCount; // Member count (1 when scalar)
+ int Offset; // Offset inside parent structure
+};
+
+// Metadata description of ExampleTreeNode struct.
+static const ExampleMemberInfo ExampleTreeNodeMemberInfos[]
+{
+ { "MyName", ImGuiDataType_String, 1, offsetof(ExampleTreeNode, Name) },
+ { "MyBool", ImGuiDataType_Bool, 1, offsetof(ExampleTreeNode, DataMyBool) },
+ { "MyInt", ImGuiDataType_S32, 1, offsetof(ExampleTreeNode, DataMyInt) },
+ { "MyVec2", ImGuiDataType_Float, 2, offsetof(ExampleTreeNode, DataMyVec2) },
+};
+
+static ExampleTreeNode* ExampleTree_CreateNode(const char* name, int uid, ExampleTreeNode* parent)
+{
+ ExampleTreeNode* node = IM_NEW(ExampleTreeNode);
+ snprintf(node->Name, IM_ARRAYSIZE(node->Name), "%s", name);
+ node->UID = uid;
+ node->Parent = parent;
+ node->IndexInParent = parent ? (unsigned short)parent->Childs.Size : 0;
+ if (parent)
+ parent->Childs.push_back(node);
+ return node;
+}
+
+static void ExampleTree_DestroyNode(ExampleTreeNode* node)
+{
+ for (ExampleTreeNode* child_node : node->Childs)
+ ExampleTree_DestroyNode(child_node);
+ IM_DELETE(node);
+}
+
+// Create example tree data
+// (this allocates _many_ more times than most other code in either Dear ImGui or others demo)
+static ExampleTreeNode* ExampleTree_CreateDemoTree()
+{
+ static const char* root_names[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pear", "Pineapple", "Strawberry", "Watermelon" };
+ const size_t NAME_MAX_LEN = sizeof(ExampleTreeNode::Name);
+ char name_buf[NAME_MAX_LEN];
+ int uid = 0;
+ ExampleTreeNode* node_L0 = ExampleTree_CreateNode("<ROOT>", ++uid, NULL);
+ const int root_items_multiplier = 2;
+ for (int idx_L0 = 0; idx_L0 < IM_ARRAYSIZE(root_names) * root_items_multiplier; idx_L0++)
+ {
+ snprintf(name_buf, IM_ARRAYSIZE(name_buf), "%s %d", root_names[idx_L0 / root_items_multiplier], idx_L0 % root_items_multiplier);
+ ExampleTreeNode* node_L1 = ExampleTree_CreateNode(name_buf, ++uid, node_L0);
+ const int number_of_childs = (int)strlen(node_L1->Name);
+ for (int idx_L1 = 0; idx_L1 < number_of_childs; idx_L1++)
+ {
+ snprintf(name_buf, IM_ARRAYSIZE(name_buf), "Child %d", idx_L1);
+ ExampleTreeNode* node_L2 = ExampleTree_CreateNode(name_buf, ++uid, node_L1);
+ node_L2->HasData = true;
+ if (idx_L1 == 0)
+ {
+ snprintf(name_buf, IM_ARRAYSIZE(name_buf), "Sub-child %d", 0);
+ ExampleTreeNode* node_L3 = ExampleTree_CreateNode(name_buf, ++uid, node_L2);
+ node_L3->HasData = true;
+ }
+ }
+ }
+ return node_L0;
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsBasic()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsBasic()
+{
IMGUI_DEMO_MARKER("Widgets/Basic");
if (ImGui::TreeNode("Basic"))
{
+ ImGui::SeparatorText("General");
+
IMGUI_DEMO_MARKER("Widgets/Basic/Button");
static int clicked = 0;
if (ImGui::Button("Button"))
@@ -602,27 +856,20 @@ static void ShowDemoWindowWidgets()
IMGUI_DEMO_MARKER("Widgets/Basic/Buttons (Repeating)");
static int counter = 0;
float spacing = ImGui::GetStyle().ItemInnerSpacing.x;
- ImGui::PushButtonRepeat(true);
+ ImGui::PushItemFlag(ImGuiItemFlags_ButtonRepeat, true);
if (ImGui::ArrowButton("##left", ImGuiDir_Left)) { counter--; }
ImGui::SameLine(0.0f, spacing);
if (ImGui::ArrowButton("##right", ImGuiDir_Right)) { counter++; }
- ImGui::PopButtonRepeat();
+ ImGui::PopItemFlag();
ImGui::SameLine();
ImGui::Text("%d", counter);
- ImGui::Separator();
+ ImGui::Button("Tooltip");
+ ImGui::SetItemTooltip("I am a tooltip");
+
ImGui::LabelText("label", "Value");
- {
- // Using the _simplified_ one-liner Combo() api here
- // See "Combo" section for examples of how to use the more flexible BeginCombo()/EndCombo() api.
- IMGUI_DEMO_MARKER("Widgets/Basic/Combo");
- const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIIIIII", "JJJJ", "KKKKKKK" };
- static int item_current = 0;
- ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items));
- ImGui::SameLine(); HelpMarker(
- "Using the simplified one-liner Combo API here.\nRefer to the \"Combo\" section below for an explanation of how to use the more flexible and general BeginCombo/EndCombo API.");
- }
+ ImGui::SeparatorText("Inputs");
{
// To wire InputText() with std::string or any other custom string type,
@@ -635,8 +882,8 @@ static void ShowDemoWindowWidgets()
"Hold SHIFT or use mouse to select text.\n"
"CTRL+Left/Right to word jump.\n"
"CTRL+A or Double-Click to select all.\n"
- "CTRL+X,CTRL+C,CTRL+V clipboard.\n"
- "CTRL+Z,CTRL+Y undo/redo.\n"
+ "CTRL+X,CTRL+C,CTRL+V for clipboard.\n"
+ "CTRL+Z to undo, CTRL+Y/CTRL+SHIFT+Z to redo.\n"
"ESCAPE to revert.\n\n"
"PROGRAMMER:\n"
"You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputText() "
@@ -666,22 +913,27 @@ static void ShowDemoWindowWidgets()
ImGui::InputFloat3("input float3", vec4a);
}
+ ImGui::SeparatorText("Drags");
+
{
IMGUI_DEMO_MARKER("Widgets/Basic/DragInt, DragFloat");
- static int i1 = 50, i2 = 42;
+ static int i1 = 50, i2 = 42, i3 = 128;
ImGui::DragInt("drag int", &i1, 1);
ImGui::SameLine(); HelpMarker(
"Click and drag to edit value.\n"
"Hold SHIFT/ALT for faster/slower edit.\n"
"Double-click or CTRL+click to input value.");
-
ImGui::DragInt("drag int 0..100", &i2, 1, 0, 100, "%d%%", ImGuiSliderFlags_AlwaysClamp);
+ ImGui::DragInt("drag int wrap 100..200", &i3, 1, 100, 200, "%d", ImGuiSliderFlags_WrapAround);
static float f1 = 1.00f, f2 = 0.0067f;
ImGui::DragFloat("drag float", &f1, 0.005f);
ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns");
+ //ImGui::DragFloat("drag wrap -1..1", &f3, 0.005f, -1.0f, 1.0f, NULL, ImGuiSliderFlags_WrapAround);
}
+ ImGui::SeparatorText("Sliders");
+
{
IMGUI_DEMO_MARKER("Widgets/Basic/SliderInt, SliderFloat");
static int i1 = 0;
@@ -704,10 +956,12 @@ static void ShowDemoWindowWidgets()
static int elem = Element_Fire;
const char* elems_names[Element_COUNT] = { "Fire", "Earth", "Air", "Water" };
const char* elem_name = (elem >= 0 && elem < Element_COUNT) ? elems_names[elem] : "Unknown";
- ImGui::SliderInt("slider enum", &elem, 0, Element_COUNT - 1, elem_name);
+ ImGui::SliderInt("slider enum", &elem, 0, Element_COUNT - 1, elem_name); // Use ImGuiSliderFlags_NoInput flag to disable CTRL+Click here.
ImGui::SameLine(); HelpMarker("Using the format string parameter to display a name instead of the underlying integer.");
}
+ ImGui::SeparatorText("Selectors/Pickers");
+
{
IMGUI_DEMO_MARKER("Widgets/Basic/ColorEdit3, ColorEdit4");
static float col1[3] = { 1.0f, 0.0f, 0.2f };
@@ -723,6 +977,18 @@ static void ShowDemoWindowWidgets()
}
{
+ // Using the _simplified_ one-liner Combo() api here
+ // See "Combo" section for examples of how to use the more flexible BeginCombo()/EndCombo() api.
+ IMGUI_DEMO_MARKER("Widgets/Basic/Combo");
+ const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIIIIII", "JJJJ", "KKKKKKK" };
+ static int item_current = 0;
+ ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items));
+ ImGui::SameLine(); HelpMarker(
+ "Using the simplified one-liner Combo API here.\n"
+ "Refer to the \"Combo\" section below for an explanation of how to use the more flexible and general BeginCombo/EndCombo API.");
+ }
+
+ {
// Using the _simplified_ one-liner ListBox() api here
// See "List boxes" section for examples of how to use the more flexible BeginListBox()/EndListBox() api.
IMGUI_DEMO_MARKER("Widgets/Basic/ListBox");
@@ -730,160 +996,48 @@ static void ShowDemoWindowWidgets()
static int item_current = 1;
ImGui::ListBox("listbox", &item_current, items, IM_ARRAYSIZE(items), 4);
ImGui::SameLine(); HelpMarker(
- "Using the simplified one-liner ListBox API here.\nRefer to the \"List boxes\" section below for an explanation of how to use the more flexible and general BeginListBox/EndListBox API.");
+ "Using the simplified one-liner ListBox API here.\n"
+ "Refer to the \"List boxes\" section below for an explanation of how to use the more flexible and general BeginListBox/EndListBox API.");
}
- {
- // Tooltips
- IMGUI_DEMO_MARKER("Widgets/Basic/Tooltips");
- ImGui::AlignTextToFramePadding();
- ImGui::Text("Tooltips:");
-
- ImGui::SameLine();
- ImGui::Button("Button");
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip("I am a tooltip");
-
- ImGui::SameLine();
- ImGui::Button("Fancy");
- if (ImGui::IsItemHovered())
- {
- ImGui::BeginTooltip();
- ImGui::Text("I am a fancy tooltip");
- static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
- ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr));
- ImGui::Text("Sin(time) = %f", sinf((float)ImGui::GetTime()));
- ImGui::EndTooltip();
- }
-
- ImGui::SameLine();
- ImGui::Button("Delayed");
- if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) // Delay best used on items that highlight on hover, so this not a great example!
- ImGui::SetTooltip("I am a tooltip with a delay.");
-
- ImGui::SameLine();
- HelpMarker(
- "Tooltip are created by using the IsItemHovered() function over any kind of item.");
-
- }
+ // Testing ImGuiOnceUponAFrame helper.
+ //static ImGuiOnceUponAFrame once;
+ //for (int i = 0; i < 5; i++)
+ // if (once)
+ // ImGui::Text("This will be displayed only once.");
ImGui::TreePop();
}
+}
- // Testing ImGuiOnceUponAFrame helper.
- //static ImGuiOnceUponAFrame once;
- //for (int i = 0; i < 5; i++)
- // if (once)
- // ImGui::Text("This will be displayed only once.");
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsBullets()
+//-----------------------------------------------------------------------------
- IMGUI_DEMO_MARKER("Widgets/Trees");
- if (ImGui::TreeNode("Trees"))
+static void DemoWindowWidgetsBullets()
+{
+ IMGUI_DEMO_MARKER("Widgets/Bullets");
+ if (ImGui::TreeNode("Bullets"))
{
- IMGUI_DEMO_MARKER("Widgets/Trees/Basic trees");
- if (ImGui::TreeNode("Basic trees"))
- {
- for (int i = 0; i < 5; i++)
- {
- // Use SetNextItemOpen() so set the default state of a node to be open. We could
- // also use TreeNodeEx() with the ImGuiTreeNodeFlags_DefaultOpen flag to achieve the same thing!
- if (i == 0)
- ImGui::SetNextItemOpen(true, ImGuiCond_Once);
-
- if (ImGui::TreeNode((void*)(intptr_t)i, "Child %d", i))
- {
- ImGui::Text("blah blah");
- ImGui::SameLine();
- if (ImGui::SmallButton("button")) {}
- ImGui::TreePop();
- }
- }
- ImGui::TreePop();
- }
-
- IMGUI_DEMO_MARKER("Widgets/Trees/Advanced, with Selectable nodes");
- if (ImGui::TreeNode("Advanced, with Selectable nodes"))
+ ImGui::BulletText("Bullet point 1");
+ ImGui::BulletText("Bullet point 2\nOn multiple lines");
+ if (ImGui::TreeNode("Tree node"))
{
- HelpMarker(
- "This is a more typical looking tree with selectable nodes.\n"
- "Click to select, CTRL+Click to toggle, click on arrows or double-click to open.");
- static ImGuiTreeNodeFlags base_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_SpanAvailWidth;
- static bool align_label_with_current_x_position = false;
- static bool test_drag_and_drop = false;
- ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnArrow", &base_flags, ImGuiTreeNodeFlags_OpenOnArrow);
- ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnDoubleClick", &base_flags, ImGuiTreeNodeFlags_OpenOnDoubleClick);
- ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAvailWidth", &base_flags, ImGuiTreeNodeFlags_SpanAvailWidth); ImGui::SameLine(); HelpMarker("Extend hit area to all available width instead of allowing more items to be laid out after the node.");
- ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanFullWidth", &base_flags, ImGuiTreeNodeFlags_SpanFullWidth);
- ImGui::Checkbox("Align label with current X position", &align_label_with_current_x_position);
- ImGui::Checkbox("Test tree node as drag source", &test_drag_and_drop);
- ImGui::Text("Hello!");
- if (align_label_with_current_x_position)
- ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing());
-
- // 'selection_mask' is dumb representation of what may be user-side selection state.
- // You may retain selection state inside or outside your objects in whatever format you see fit.
- // 'node_clicked' is temporary storage of what node we have clicked to process selection at the end
- /// of the loop. May be a pointer to your own node type, etc.
- static int selection_mask = (1 << 2);
- int node_clicked = -1;
- for (int i = 0; i < 6; i++)
- {
- // Disable the default "open on single-click behavior" + set Selected flag according to our selection.
- // To alter selection we use IsItemClicked() && !IsItemToggledOpen(), so clicking on an arrow doesn't alter selection.
- ImGuiTreeNodeFlags node_flags = base_flags;
- const bool is_selected = (selection_mask & (1 << i)) != 0;
- if (is_selected)
- node_flags |= ImGuiTreeNodeFlags_Selected;
- if (i < 3)
- {
- // Items 0..2 are Tree Node
- bool node_open = ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Node %d", i);
- if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen())
- node_clicked = i;
- if (test_drag_and_drop && ImGui::BeginDragDropSource())
- {
- ImGui::SetDragDropPayload("_TREENODE", NULL, 0);
- ImGui::Text("This is a drag and drop source");
- ImGui::EndDragDropSource();
- }
- if (node_open)
- {
- ImGui::BulletText("Blah blah\nBlah Blah");
- ImGui::TreePop();
- }
- }
- else
- {
- // Items 3..5 are Tree Leaves
- // The only reason we use TreeNode at all is to allow selection of the leaf. Otherwise we can
- // use BulletText() or advance the cursor by GetTreeNodeToLabelSpacing() and call Text().
- node_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen; // ImGuiTreeNodeFlags_Bullet
- ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Leaf %d", i);
- if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen())
- node_clicked = i;
- if (test_drag_and_drop && ImGui::BeginDragDropSource())
- {
- ImGui::SetDragDropPayload("_TREENODE", NULL, 0);
- ImGui::Text("This is a drag and drop source");
- ImGui::EndDragDropSource();
- }
- }
- }
- if (node_clicked != -1)
- {
- // Update selection state
- // (process outside of tree loop to avoid visual inconsistencies during the clicking frame)
- if (ImGui::GetIO().KeyCtrl)
- selection_mask ^= (1 << node_clicked); // CTRL+click to toggle
- else //if (!(selection_mask & (1 << node_clicked))) // Depending on selection behavior you want, may want to preserve selection when clicking on item that is part of the selection
- selection_mask = (1 << node_clicked); // Click to single-select
- }
- if (align_label_with_current_x_position)
- ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing());
+ ImGui::BulletText("Another bullet point");
ImGui::TreePop();
}
+ ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");
+ ImGui::Bullet(); ImGui::SmallButton("Button");
ImGui::TreePop();
}
+}
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsCollapsingHeaders()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsCollapsingHeaders()
+{
IMGUI_DEMO_MARKER("Widgets/Collapsing Headers");
if (ImGui::TreeNode("Collapsing Headers"))
{
@@ -907,97 +1061,670 @@ static void ShowDemoWindowWidgets()
*/
ImGui::TreePop();
}
+}
- IMGUI_DEMO_MARKER("Widgets/Bullets");
- if (ImGui::TreeNode("Bullets"))
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsColorAndPickers()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsColorAndPickers()
+{
+ IMGUI_DEMO_MARKER("Widgets/Color");
+ if (ImGui::TreeNode("Color/Picker Widgets"))
{
- ImGui::BulletText("Bullet point 1");
- ImGui::BulletText("Bullet point 2\nOn multiple lines");
- if (ImGui::TreeNode("Tree node"))
+ static ImVec4 color = ImVec4(114.0f / 255.0f, 144.0f / 255.0f, 154.0f / 255.0f, 200.0f / 255.0f);
+ static ImGuiColorEditFlags base_flags = ImGuiColorEditFlags_None;
+
+ ImGui::SeparatorText("Options");
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_NoAlpha", &base_flags, ImGuiColorEditFlags_NoAlpha);
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_AlphaOpaque", &base_flags, ImGuiColorEditFlags_AlphaOpaque);
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_AlphaNoBg", &base_flags, ImGuiColorEditFlags_AlphaNoBg);
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_AlphaPreviewHalf", &base_flags, ImGuiColorEditFlags_AlphaPreviewHalf);
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_NoDragDrop", &base_flags, ImGuiColorEditFlags_NoDragDrop);
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_NoOptions", &base_flags, ImGuiColorEditFlags_NoOptions); ImGui::SameLine(); HelpMarker("Right-click on the individual color widget to show options.");
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_HDR", &base_flags, ImGuiColorEditFlags_HDR); ImGui::SameLine(); HelpMarker("Currently all this does is to lift the 0..1 limits on dragging widgets.");
+
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit");
+ ImGui::SeparatorText("Inline color editor");
+ ImGui::Text("Color widget:");
+ ImGui::SameLine(); HelpMarker(
+ "Click on the color square to open a color picker.\n"
+ "CTRL+click on individual component to input value.\n");
+ ImGui::ColorEdit3("MyColor##1", (float*)&color, base_flags);
+
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit (HSV, with Alpha)");
+ ImGui::Text("Color widget HSV with Alpha:");
+ ImGui::ColorEdit4("MyColor##2", (float*)&color, ImGuiColorEditFlags_DisplayHSV | base_flags);
+
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit (float display)");
+ ImGui::Text("Color widget with Float Display:");
+ ImGui::ColorEdit4("MyColor##2f", (float*)&color, ImGuiColorEditFlags_Float | base_flags);
+
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorButton (with Picker)");
+ ImGui::Text("Color button with Picker:");
+ ImGui::SameLine(); HelpMarker(
+ "With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\n"
+ "With the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only "
+ "be used for the tooltip and picker popup.");
+ ImGui::ColorEdit4("MyColor##3", (float*)&color, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | base_flags);
+
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorButton (with custom Picker popup)");
+ ImGui::Text("Color button with Custom Picker Popup:");
+
+ // Generate a default palette. The palette will persist and can be edited.
+ static bool saved_palette_init = true;
+ static ImVec4 saved_palette[32] = {};
+ if (saved_palette_init)
{
- ImGui::BulletText("Another bullet point");
- ImGui::TreePop();
+ for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++)
+ {
+ ImGui::ColorConvertHSVtoRGB(n / 31.0f, 0.8f, 0.8f,
+ saved_palette[n].x, saved_palette[n].y, saved_palette[n].z);
+ saved_palette[n].w = 1.0f; // Alpha
+ }
+ saved_palette_init = false;
}
- ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");
- ImGui::Bullet(); ImGui::SmallButton("Button");
+
+ static ImVec4 backup_color;
+ bool open_popup = ImGui::ColorButton("MyColor##3b", color, base_flags);
+ ImGui::SameLine(0, ImGui::GetStyle().ItemInnerSpacing.x);
+ open_popup |= ImGui::Button("Palette");
+ if (open_popup)
+ {
+ ImGui::OpenPopup("mypicker");
+ backup_color = color;
+ }
+ if (ImGui::BeginPopup("mypicker"))
+ {
+ ImGui::Text("MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!");
+ ImGui::Separator();
+ ImGui::ColorPicker4("##picker", (float*)&color, base_flags | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoSmallPreview);
+ ImGui::SameLine();
+
+ ImGui::BeginGroup(); // Lock X position
+ ImGui::Text("Current");
+ ImGui::ColorButton("##current", color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60, 40));
+ ImGui::Text("Previous");
+ if (ImGui::ColorButton("##previous", backup_color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60, 40)))
+ color = backup_color;
+ ImGui::Separator();
+ ImGui::Text("Palette");
+ for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++)
+ {
+ ImGui::PushID(n);
+ if ((n % 8) != 0)
+ ImGui::SameLine(0.0f, ImGui::GetStyle().ItemSpacing.y);
+
+ ImGuiColorEditFlags palette_button_flags = ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoTooltip;
+ if (ImGui::ColorButton("##palette", saved_palette[n], palette_button_flags, ImVec2(20, 20)))
+ color = ImVec4(saved_palette[n].x, saved_palette[n].y, saved_palette[n].z, color.w); // Preserve alpha!
+
+ // Allow user to drop colors into each palette entry. Note that ColorButton() is already a
+ // drag source by default, unless specifying the ImGuiColorEditFlags_NoDragDrop flag.
+ if (ImGui::BeginDragDropTarget())
+ {
+ if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F))
+ memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 3);
+ if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F))
+ memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 4);
+ ImGui::EndDragDropTarget();
+ }
+
+ ImGui::PopID();
+ }
+ ImGui::EndGroup();
+ ImGui::EndPopup();
+ }
+
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorButton (simple)");
+ ImGui::Text("Color button only:");
+ static bool no_border = false;
+ ImGui::Checkbox("ImGuiColorEditFlags_NoBorder", &no_border);
+ ImGui::ColorButton("MyColor##3c", *(ImVec4*)&color, base_flags | (no_border ? ImGuiColorEditFlags_NoBorder : 0), ImVec2(80, 80));
+
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorPicker");
+ ImGui::SeparatorText("Color picker");
+
+ static bool ref_color = false;
+ static ImVec4 ref_color_v(1.0f, 0.0f, 1.0f, 0.5f);
+ static int picker_mode = 0;
+ static int display_mode = 0;
+ static ImGuiColorEditFlags color_picker_flags = ImGuiColorEditFlags_AlphaBar;
+
+ ImGui::PushID("Color picker");
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_NoAlpha", &color_picker_flags, ImGuiColorEditFlags_NoAlpha);
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_AlphaBar", &color_picker_flags, ImGuiColorEditFlags_AlphaBar);
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_NoSidePreview", &color_picker_flags, ImGuiColorEditFlags_NoSidePreview);
+ if (color_picker_flags & ImGuiColorEditFlags_NoSidePreview)
+ {
+ ImGui::SameLine();
+ ImGui::Checkbox("With Ref Color", &ref_color);
+ if (ref_color)
+ {
+ ImGui::SameLine();
+ ImGui::ColorEdit4("##RefColor", &ref_color_v.x, ImGuiColorEditFlags_NoInputs | base_flags);
+ }
+ }
+
+ ImGui::Combo("Picker Mode", &picker_mode, "Auto/Current\0ImGuiColorEditFlags_PickerHueBar\0ImGuiColorEditFlags_PickerHueWheel\0");
+ ImGui::SameLine(); HelpMarker("When not specified explicitly, user can right-click the picker to change mode.");
+
+ ImGui::Combo("Display Mode", &display_mode, "Auto/Current\0ImGuiColorEditFlags_NoInputs\0ImGuiColorEditFlags_DisplayRGB\0ImGuiColorEditFlags_DisplayHSV\0ImGuiColorEditFlags_DisplayHex\0");
+ ImGui::SameLine(); HelpMarker(
+ "ColorEdit defaults to displaying RGB inputs if you don't specify a display mode, "
+ "but the user can change it with a right-click on those inputs.\n\nColorPicker defaults to displaying RGB+HSV+Hex "
+ "if you don't specify a display mode.\n\nYou can change the defaults using SetColorEditOptions().");
+
+ ImGuiColorEditFlags flags = base_flags | color_picker_flags;
+ if (picker_mode == 1) flags |= ImGuiColorEditFlags_PickerHueBar;
+ if (picker_mode == 2) flags |= ImGuiColorEditFlags_PickerHueWheel;
+ if (display_mode == 1) flags |= ImGuiColorEditFlags_NoInputs; // Disable all RGB/HSV/Hex displays
+ if (display_mode == 2) flags |= ImGuiColorEditFlags_DisplayRGB; // Override display mode
+ if (display_mode == 3) flags |= ImGuiColorEditFlags_DisplayHSV;
+ if (display_mode == 4) flags |= ImGuiColorEditFlags_DisplayHex;
+ ImGui::ColorPicker4("MyColor##4", (float*)&color, flags, ref_color ? &ref_color_v.x : NULL);
+
+ ImGui::Text("Set defaults in code:");
+ ImGui::SameLine(); HelpMarker(
+ "SetColorEditOptions() is designed to allow you to set boot-time default.\n"
+ "We don't have Push/Pop functions because you can force options on a per-widget basis if needed, "
+ "and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid "
+ "encouraging you to persistently save values that aren't forward-compatible.");
+ if (ImGui::Button("Default: Uint8 + HSV + Hue Bar"))
+ ImGui::SetColorEditOptions(ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_PickerHueBar);
+ if (ImGui::Button("Default: Float + HDR + Hue Wheel"))
+ ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel);
+
+ // Always display a small version of both types of pickers
+ // (that's in order to make it more visible in the demo to people who are skimming quickly through it)
+ ImGui::Text("Both types:");
+ float w = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.y) * 0.40f;
+ ImGui::SetNextItemWidth(w);
+ ImGui::ColorPicker3("##MyColor##5", (float*)&color, ImGuiColorEditFlags_PickerHueBar | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoAlpha);
+ ImGui::SameLine();
+ ImGui::SetNextItemWidth(w);
+ ImGui::ColorPicker3("##MyColor##6", (float*)&color, ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoAlpha);
+ ImGui::PopID();
+
+ // HSV encoded support (to avoid RGB<>HSV round trips and singularities when S==0 or V==0)
+ static ImVec4 color_hsv(0.23f, 1.0f, 1.0f, 1.0f); // Stored as HSV!
+ ImGui::Spacing();
+ ImGui::Text("HSV encoded colors");
+ ImGui::SameLine(); HelpMarker(
+ "By default, colors are given to ColorEdit and ColorPicker in RGB, but ImGuiColorEditFlags_InputHSV "
+ "allows you to store colors as HSV and pass them to ColorEdit and ColorPicker as HSV. This comes with the "
+ "added benefit that you can manipulate hue values with the picker even when saturation or value are zero.");
+ ImGui::Text("Color widget with InputHSV:");
+ ImGui::ColorEdit4("HSV shown as RGB##1", (float*)&color_hsv, ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputHSV | ImGuiColorEditFlags_Float);
+ ImGui::ColorEdit4("HSV shown as HSV##1", (float*)&color_hsv, ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_InputHSV | ImGuiColorEditFlags_Float);
+ ImGui::DragFloat4("Raw HSV values", (float*)&color_hsv, 0.01f, 0.0f, 1.0f);
+
ImGui::TreePop();
}
+}
- IMGUI_DEMO_MARKER("Widgets/Text");
- if (ImGui::TreeNode("Text"))
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsComboBoxes()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsComboBoxes()
+{
+ IMGUI_DEMO_MARKER("Widgets/Combo");
+ if (ImGui::TreeNode("Combo"))
{
- IMGUI_DEMO_MARKER("Widgets/Text/Colored Text");
- if (ImGui::TreeNode("Colorful Text"))
+ // Combo Boxes are also called "Dropdown" in other systems
+ // Expose flags as checkbox for the demo
+ static ImGuiComboFlags flags = 0;
+ ImGui::CheckboxFlags("ImGuiComboFlags_PopupAlignLeft", &flags, ImGuiComboFlags_PopupAlignLeft);
+ ImGui::SameLine(); HelpMarker("Only makes a difference if the popup is larger than the combo");
+ if (ImGui::CheckboxFlags("ImGuiComboFlags_NoArrowButton", &flags, ImGuiComboFlags_NoArrowButton))
+ flags &= ~ImGuiComboFlags_NoPreview; // Clear incompatible flags
+ if (ImGui::CheckboxFlags("ImGuiComboFlags_NoPreview", &flags, ImGuiComboFlags_NoPreview))
+ flags &= ~(ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_WidthFitPreview); // Clear incompatible flags
+ if (ImGui::CheckboxFlags("ImGuiComboFlags_WidthFitPreview", &flags, ImGuiComboFlags_WidthFitPreview))
+ flags &= ~ImGuiComboFlags_NoPreview;
+
+ // Override default popup height
+ if (ImGui::CheckboxFlags("ImGuiComboFlags_HeightSmall", &flags, ImGuiComboFlags_HeightSmall))
+ flags &= ~(ImGuiComboFlags_HeightMask_ & ~ImGuiComboFlags_HeightSmall);
+ if (ImGui::CheckboxFlags("ImGuiComboFlags_HeightRegular", &flags, ImGuiComboFlags_HeightRegular))
+ flags &= ~(ImGuiComboFlags_HeightMask_ & ~ImGuiComboFlags_HeightRegular);
+ if (ImGui::CheckboxFlags("ImGuiComboFlags_HeightLargest", &flags, ImGuiComboFlags_HeightLargest))
+ flags &= ~(ImGuiComboFlags_HeightMask_ & ~ImGuiComboFlags_HeightLargest);
+
+ // Using the generic BeginCombo() API, you have full control over how to display the combo contents.
+ // (your selection data could be an index, a pointer to the object, an id for the object, a flag intrusively
+ // stored in the object itself, etc.)
+ const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" };
+ static int item_selected_idx = 0; // Here we store our selection data as an index.
+
+ // Pass in the preview value visible before opening the combo (it could technically be different contents or not pulled from items[])
+ const char* combo_preview_value = items[item_selected_idx];
+ if (ImGui::BeginCombo("combo 1", combo_preview_value, flags))
{
- // Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility.
- ImGui::TextColored(ImVec4(1.0f, 0.0f, 1.0f, 1.0f), "Pink");
- ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "Yellow");
- ImGui::TextDisabled("Disabled");
- ImGui::SameLine(); HelpMarker("The TextDisabled color is stored in ImGuiStyle.");
+ for (int n = 0; n < IM_ARRAYSIZE(items); n++)
+ {
+ const bool is_selected = (item_selected_idx == n);
+ if (ImGui::Selectable(items[n], is_selected))
+ item_selected_idx = n;
+
+ // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
+ if (is_selected)
+ ImGui::SetItemDefaultFocus();
+ }
+ ImGui::EndCombo();
+ }
+
+ // Show case embedding a filter using a simple trick: displaying the filter inside combo contents.
+ // See https://github.com/ocornut/imgui/issues/718 for advanced/esoteric alternatives.
+ if (ImGui::BeginCombo("combo 2 (w/ filter)", combo_preview_value, flags))
+ {
+ static ImGuiTextFilter filter;
+ if (ImGui::IsWindowAppearing())
+ {
+ ImGui::SetKeyboardFocusHere();
+ filter.Clear();
+ }
+ ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_F);
+ filter.Draw("##Filter", -FLT_MIN);
+
+ for (int n = 0; n < IM_ARRAYSIZE(items); n++)
+ {
+ const bool is_selected = (item_selected_idx == n);
+ if (filter.PassFilter(items[n]))
+ if (ImGui::Selectable(items[n], is_selected))
+ item_selected_idx = n;
+ }
+ ImGui::EndCombo();
+ }
+
+ ImGui::Spacing();
+ ImGui::SeparatorText("One-liner variants");
+ HelpMarker("The Combo() function is not greatly useful apart from cases were you want to embed all options in a single strings.\nFlags above don't apply to this section.");
+
+ // Simplified one-liner Combo() API, using values packed in a single constant string
+ // This is a convenience for when the selection set is small and known at compile-time.
+ static int item_current_2 = 0;
+ ImGui::Combo("combo 3 (one-liner)", &item_current_2, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
+
+ // Simplified one-liner Combo() using an array of const char*
+ // This is not very useful (may obsolete): prefer using BeginCombo()/EndCombo() for full control.
+ static int item_current_3 = -1; // If the selection isn't within 0..count, Combo won't display a preview
+ ImGui::Combo("combo 4 (array)", &item_current_3, items, IM_ARRAYSIZE(items));
+
+ // Simplified one-liner Combo() using an accessor function
+ static int item_current_4 = 0;
+ ImGui::Combo("combo 5 (function)", &item_current_4, [](void* data, int n) { return ((const char**)data)[n]; }, items, IM_ARRAYSIZE(items));
+
+ ImGui::TreePop();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsDataTypes()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsDataTypes()
+{
+ IMGUI_DEMO_MARKER("Widgets/Data Types");
+ if (ImGui::TreeNode("Data Types"))
+ {
+ // DragScalar/InputScalar/SliderScalar functions allow various data types
+ // - signed/unsigned
+ // - 8/16/32/64-bits
+ // - integer/float/double
+ // To avoid polluting the public API with all possible combinations, we use the ImGuiDataType enum
+ // to pass the type, and passing all arguments by pointer.
+ // This is the reason the test code below creates local variables to hold "zero" "one" etc. for each type.
+ // In practice, if you frequently use a given type that is not covered by the normal API entry points,
+ // you can wrap it yourself inside a 1 line function which can take typed argument as value instead of void*,
+ // and then pass their address to the generic function. For example:
+ // bool MySliderU64(const char *label, u64* value, u64 min = 0, u64 max = 0, const char* format = "%lld")
+ // {
+ // return SliderScalar(label, ImGuiDataType_U64, value, &min, &max, format);
+ // }
+
+ // Setup limits (as helper variables so we can take their address, as explained above)
+ // Note: SliderScalar() functions have a maximum usable range of half the natural type maximum, hence the /2.
+ #ifndef LLONG_MIN
+ ImS64 LLONG_MIN = -9223372036854775807LL - 1;
+ ImS64 LLONG_MAX = 9223372036854775807LL;
+ ImU64 ULLONG_MAX = (2ULL * 9223372036854775807LL + 1);
+ #endif
+ const char s8_zero = 0, s8_one = 1, s8_fifty = 50, s8_min = -128, s8_max = 127;
+ const ImU8 u8_zero = 0, u8_one = 1, u8_fifty = 50, u8_min = 0, u8_max = 255;
+ const short s16_zero = 0, s16_one = 1, s16_fifty = 50, s16_min = -32768, s16_max = 32767;
+ const ImU16 u16_zero = 0, u16_one = 1, u16_fifty = 50, u16_min = 0, u16_max = 65535;
+ const ImS32 s32_zero = 0, s32_one = 1, s32_fifty = 50, s32_min = INT_MIN/2, s32_max = INT_MAX/2, s32_hi_a = INT_MAX/2 - 100, s32_hi_b = INT_MAX/2;
+ const ImU32 u32_zero = 0, u32_one = 1, u32_fifty = 50, u32_min = 0, u32_max = UINT_MAX/2, u32_hi_a = UINT_MAX/2 - 100, u32_hi_b = UINT_MAX/2;
+ const ImS64 s64_zero = 0, s64_one = 1, s64_fifty = 50, s64_min = LLONG_MIN/2, s64_max = LLONG_MAX/2, s64_hi_a = LLONG_MAX/2 - 100, s64_hi_b = LLONG_MAX/2;
+ const ImU64 u64_zero = 0, u64_one = 1, u64_fifty = 50, u64_min = 0, u64_max = ULLONG_MAX/2, u64_hi_a = ULLONG_MAX/2 - 100, u64_hi_b = ULLONG_MAX/2;
+ const float f32_zero = 0.f, f32_one = 1.f, f32_lo_a = -10000000000.0f, f32_hi_a = +10000000000.0f;
+ const double f64_zero = 0., f64_one = 1., f64_lo_a = -1000000000000000.0, f64_hi_a = +1000000000000000.0;
+
+ // State
+ static char s8_v = 127;
+ static ImU8 u8_v = 255;
+ static short s16_v = 32767;
+ static ImU16 u16_v = 65535;
+ static ImS32 s32_v = -1;
+ static ImU32 u32_v = (ImU32)-1;
+ static ImS64 s64_v = -1;
+ static ImU64 u64_v = (ImU64)-1;
+ static float f32_v = 0.123f;
+ static double f64_v = 90000.01234567890123456789;
+
+ const float drag_speed = 0.2f;
+ static bool drag_clamp = false;
+ IMGUI_DEMO_MARKER("Widgets/Data Types/Drags");
+ ImGui::SeparatorText("Drags");
+ ImGui::Checkbox("Clamp integers to 0..50", &drag_clamp);
+ ImGui::SameLine(); HelpMarker(
+ "As with every widget in dear imgui, we never modify values unless there is a user interaction.\n"
+ "You can override the clamping limits by using CTRL+Click to input a value.");
+ ImGui::DragScalar("drag s8", ImGuiDataType_S8, &s8_v, drag_speed, drag_clamp ? &s8_zero : NULL, drag_clamp ? &s8_fifty : NULL);
+ ImGui::DragScalar("drag u8", ImGuiDataType_U8, &u8_v, drag_speed, drag_clamp ? &u8_zero : NULL, drag_clamp ? &u8_fifty : NULL, "%u ms");
+ ImGui::DragScalar("drag s16", ImGuiDataType_S16, &s16_v, drag_speed, drag_clamp ? &s16_zero : NULL, drag_clamp ? &s16_fifty : NULL);
+ ImGui::DragScalar("drag u16", ImGuiDataType_U16, &u16_v, drag_speed, drag_clamp ? &u16_zero : NULL, drag_clamp ? &u16_fifty : NULL, "%u ms");
+ ImGui::DragScalar("drag s32", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL);
+ ImGui::DragScalar("drag s32 hex", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL, "0x%08X");
+ ImGui::DragScalar("drag u32", ImGuiDataType_U32, &u32_v, drag_speed, drag_clamp ? &u32_zero : NULL, drag_clamp ? &u32_fifty : NULL, "%u ms");
+ ImGui::DragScalar("drag s64", ImGuiDataType_S64, &s64_v, drag_speed, drag_clamp ? &s64_zero : NULL, drag_clamp ? &s64_fifty : NULL);
+ ImGui::DragScalar("drag u64", ImGuiDataType_U64, &u64_v, drag_speed, drag_clamp ? &u64_zero : NULL, drag_clamp ? &u64_fifty : NULL);
+ ImGui::DragScalar("drag float", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f");
+ ImGui::DragScalar("drag float log", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", ImGuiSliderFlags_Logarithmic);
+ ImGui::DragScalar("drag double", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, NULL, "%.10f grams");
+ ImGui::DragScalar("drag double log",ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, &f64_one, "0 < %.10f < 1", ImGuiSliderFlags_Logarithmic);
+
+ IMGUI_DEMO_MARKER("Widgets/Data Types/Sliders");
+ ImGui::SeparatorText("Sliders");
+ ImGui::SliderScalar("slider s8 full", ImGuiDataType_S8, &s8_v, &s8_min, &s8_max, "%d");
+ ImGui::SliderScalar("slider u8 full", ImGuiDataType_U8, &u8_v, &u8_min, &u8_max, "%u");
+ ImGui::SliderScalar("slider s16 full", ImGuiDataType_S16, &s16_v, &s16_min, &s16_max, "%d");
+ ImGui::SliderScalar("slider u16 full", ImGuiDataType_U16, &u16_v, &u16_min, &u16_max, "%u");
+ ImGui::SliderScalar("slider s32 low", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty,"%d");
+ ImGui::SliderScalar("slider s32 high", ImGuiDataType_S32, &s32_v, &s32_hi_a, &s32_hi_b, "%d");
+ ImGui::SliderScalar("slider s32 full", ImGuiDataType_S32, &s32_v, &s32_min, &s32_max, "%d");
+ ImGui::SliderScalar("slider s32 hex", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty, "0x%04X");
+ ImGui::SliderScalar("slider u32 low", ImGuiDataType_U32, &u32_v, &u32_zero, &u32_fifty,"%u");
+ ImGui::SliderScalar("slider u32 high", ImGuiDataType_U32, &u32_v, &u32_hi_a, &u32_hi_b, "%u");
+ ImGui::SliderScalar("slider u32 full", ImGuiDataType_U32, &u32_v, &u32_min, &u32_max, "%u");
+ ImGui::SliderScalar("slider s64 low", ImGuiDataType_S64, &s64_v, &s64_zero, &s64_fifty,"%" PRId64);
+ ImGui::SliderScalar("slider s64 high", ImGuiDataType_S64, &s64_v, &s64_hi_a, &s64_hi_b, "%" PRId64);
+ ImGui::SliderScalar("slider s64 full", ImGuiDataType_S64, &s64_v, &s64_min, &s64_max, "%" PRId64);
+ ImGui::SliderScalar("slider u64 low", ImGuiDataType_U64, &u64_v, &u64_zero, &u64_fifty,"%" PRIu64 " ms");
+ ImGui::SliderScalar("slider u64 high", ImGuiDataType_U64, &u64_v, &u64_hi_a, &u64_hi_b, "%" PRIu64 " ms");
+ ImGui::SliderScalar("slider u64 full", ImGuiDataType_U64, &u64_v, &u64_min, &u64_max, "%" PRIu64 " ms");
+ ImGui::SliderScalar("slider float low", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one);
+ ImGui::SliderScalar("slider float low log", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one, "%.10f", ImGuiSliderFlags_Logarithmic);
+ ImGui::SliderScalar("slider float high", ImGuiDataType_Float, &f32_v, &f32_lo_a, &f32_hi_a, "%e");
+ ImGui::SliderScalar("slider double low", ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f grams");
+ ImGui::SliderScalar("slider double low log",ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f", ImGuiSliderFlags_Logarithmic);
+ ImGui::SliderScalar("slider double high", ImGuiDataType_Double, &f64_v, &f64_lo_a, &f64_hi_a, "%e grams");
+
+ ImGui::SeparatorText("Sliders (reverse)");
+ ImGui::SliderScalar("slider s8 reverse", ImGuiDataType_S8, &s8_v, &s8_max, &s8_min, "%d");
+ ImGui::SliderScalar("slider u8 reverse", ImGuiDataType_U8, &u8_v, &u8_max, &u8_min, "%u");
+ ImGui::SliderScalar("slider s32 reverse", ImGuiDataType_S32, &s32_v, &s32_fifty, &s32_zero, "%d");
+ ImGui::SliderScalar("slider u32 reverse", ImGuiDataType_U32, &u32_v, &u32_fifty, &u32_zero, "%u");
+ ImGui::SliderScalar("slider s64 reverse", ImGuiDataType_S64, &s64_v, &s64_fifty, &s64_zero, "%" PRId64);
+ ImGui::SliderScalar("slider u64 reverse", ImGuiDataType_U64, &u64_v, &u64_fifty, &u64_zero, "%" PRIu64 " ms");
+
+ IMGUI_DEMO_MARKER("Widgets/Data Types/Inputs");
+ static bool inputs_step = true;
+ static ImGuiInputTextFlags flags = ImGuiInputTextFlags_None;
+ ImGui::SeparatorText("Inputs");
+ ImGui::Checkbox("Show step buttons", &inputs_step);
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_ReadOnly", &flags, ImGuiInputTextFlags_ReadOnly);
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_ParseEmptyRefVal", &flags, ImGuiInputTextFlags_ParseEmptyRefVal);
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_DisplayEmptyRefVal", &flags, ImGuiInputTextFlags_DisplayEmptyRefVal);
+ ImGui::InputScalar("input s8", ImGuiDataType_S8, &s8_v, inputs_step ? &s8_one : NULL, NULL, "%d", flags);
+ ImGui::InputScalar("input u8", ImGuiDataType_U8, &u8_v, inputs_step ? &u8_one : NULL, NULL, "%u", flags);
+ ImGui::InputScalar("input s16", ImGuiDataType_S16, &s16_v, inputs_step ? &s16_one : NULL, NULL, "%d", flags);
+ ImGui::InputScalar("input u16", ImGuiDataType_U16, &u16_v, inputs_step ? &u16_one : NULL, NULL, "%u", flags);
+ ImGui::InputScalar("input s32", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%d", flags);
+ ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%04X", flags);
+ ImGui::InputScalar("input u32", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%u", flags);
+ ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X", flags);
+ ImGui::InputScalar("input s64", ImGuiDataType_S64, &s64_v, inputs_step ? &s64_one : NULL, NULL, NULL, flags);
+ ImGui::InputScalar("input u64", ImGuiDataType_U64, &u64_v, inputs_step ? &u64_one : NULL, NULL, NULL, flags);
+ ImGui::InputScalar("input float", ImGuiDataType_Float, &f32_v, inputs_step ? &f32_one : NULL, NULL, NULL, flags);
+ ImGui::InputScalar("input double", ImGuiDataType_Double, &f64_v, inputs_step ? &f64_one : NULL, NULL, NULL, flags);
+
+ ImGui::TreePop();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsDisableBlocks()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsDisableBlocks(ImGuiDemoWindowData* demo_data)
+{
+ IMGUI_DEMO_MARKER("Widgets/Disable Blocks");
+ if (ImGui::TreeNode("Disable Blocks"))
+ {
+ ImGui::Checkbox("Disable entire section above", &demo_data->DisableSections);
+ ImGui::SameLine(); HelpMarker("Demonstrate using BeginDisabled()/EndDisabled() across other sections.");
+ ImGui::TreePop();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsDragAndDrop()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsDragAndDrop()
+{
+ IMGUI_DEMO_MARKER("Widgets/Drag and drop");
+ if (ImGui::TreeNode("Drag and Drop"))
+ {
+ IMGUI_DEMO_MARKER("Widgets/Drag and drop/Standard widgets");
+ if (ImGui::TreeNode("Drag and drop in standard widgets"))
+ {
+ // ColorEdit widgets automatically act as drag source and drag target.
+ // They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F
+ // to allow your own widgets to use colors in their drag and drop interaction.
+ // Also see 'Demo->Widgets->Color/Picker Widgets->Palette' demo.
+ HelpMarker("You can drag from the color squares.");
+ static float col1[3] = { 1.0f, 0.0f, 0.2f };
+ static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
+ ImGui::ColorEdit3("color 1", col1);
+ ImGui::ColorEdit4("color 2", col2);
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Widgets/Text/Word Wrapping");
- if (ImGui::TreeNode("Word Wrapping"))
+ IMGUI_DEMO_MARKER("Widgets/Drag and drop/Copy-swap items");
+ if (ImGui::TreeNode("Drag and drop to copy/swap items"))
{
- // Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility.
- ImGui::TextWrapped(
- "This text should automatically wrap on the edge of the window. The current implementation "
- "for text wrapping follows simple rules suitable for English and possibly other languages.");
- ImGui::Spacing();
+ enum Mode
+ {
+ Mode_Copy,
+ Mode_Move,
+ Mode_Swap
+ };
+ static int mode = 0;
+ if (ImGui::RadioButton("Copy", mode == Mode_Copy)) { mode = Mode_Copy; } ImGui::SameLine();
+ if (ImGui::RadioButton("Move", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine();
+ if (ImGui::RadioButton("Swap", mode == Mode_Swap)) { mode = Mode_Swap; }
+ static const char* names[9] =
+ {
+ "Bobby", "Beatrice", "Betty",
+ "Brianna", "Barry", "Bernard",
+ "Bibi", "Blaine", "Bryn"
+ };
+ for (int n = 0; n < IM_ARRAYSIZE(names); n++)
+ {
+ ImGui::PushID(n);
+ if ((n % 3) != 0)
+ ImGui::SameLine();
+ ImGui::Button(names[n], ImVec2(60, 60));
- static float wrap_width = 200.0f;
- ImGui::SliderFloat("Wrap width", &wrap_width, -20, 600, "%.0f");
+ // Our buttons are both drag sources and drag targets here!
+ if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None))
+ {
+ // Set payload to carry the index of our item (could be anything)
+ ImGui::SetDragDropPayload("DND_DEMO_CELL", &n, sizeof(int));
- ImDrawList* draw_list = ImGui::GetWindowDrawList();
- for (int n = 0; n < 2; n++)
+ // Display preview (could be anything, e.g. when dragging an image we could decide to display
+ // the filename and a small preview of the image, etc.)
+ if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); }
+ if (mode == Mode_Move) { ImGui::Text("Move %s", names[n]); }
+ if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); }
+ ImGui::EndDragDropSource();
+ }
+ if (ImGui::BeginDragDropTarget())
+ {
+ if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("DND_DEMO_CELL"))
+ {
+ IM_ASSERT(payload->DataSize == sizeof(int));
+ int payload_n = *(const int*)payload->Data;
+ if (mode == Mode_Copy)
+ {
+ names[n] = names[payload_n];
+ }
+ if (mode == Mode_Move)
+ {
+ names[n] = names[payload_n];
+ names[payload_n] = "";
+ }
+ if (mode == Mode_Swap)
+ {
+ const char* tmp = names[n];
+ names[n] = names[payload_n];
+ names[payload_n] = tmp;
+ }
+ }
+ ImGui::EndDragDropTarget();
+ }
+ ImGui::PopID();
+ }
+ ImGui::TreePop();
+ }
+
+ IMGUI_DEMO_MARKER("Widgets/Drag and Drop/Drag to reorder items (simple)");
+ if (ImGui::TreeNode("Drag to reorder items (simple)"))
+ {
+ // FIXME: there is temporary (usually single-frame) ID Conflict during reordering as a same item may be submitting twice.
+ // This code was always slightly faulty but in a way which was not easily noticeable.
+ // Until we fix this, enable ImGuiItemFlags_AllowDuplicateId to disable detecting the issue.
+ ImGui::PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true);
+
+ // Simple reordering
+ HelpMarker(
+ "We don't use the drag and drop api at all here! "
+ "Instead we query when the item is held but not hovered, and order items accordingly.");
+ static const char* item_names[] = { "Item One", "Item Two", "Item Three", "Item Four", "Item Five" };
+ for (int n = 0; n < IM_ARRAYSIZE(item_names); n++)
{
- ImGui::Text("Test paragraph %d:", n);
- ImVec2 pos = ImGui::GetCursorScreenPos();
- ImVec2 marker_min = ImVec2(pos.x + wrap_width, pos.y);
- ImVec2 marker_max = ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight());
- ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
- if (n == 0)
- ImGui::Text("The lazy dog is a good dog. This paragraph should fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width);
- else
- ImGui::Text("aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee ffffffff. gggggggg!hhhhhhhh");
+ const char* item = item_names[n];
+ ImGui::Selectable(item);
- // Draw actual text bounding box, following by marker of our expected limit (should not overlap!)
- draw_list->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255, 255, 0, 255));
- draw_list->AddRectFilled(marker_min, marker_max, IM_COL32(255, 0, 255, 255));
- ImGui::PopTextWrapPos();
+ if (ImGui::IsItemActive() && !ImGui::IsItemHovered())
+ {
+ int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.f ? -1 : 1);
+ if (n_next >= 0 && n_next < IM_ARRAYSIZE(item_names))
+ {
+ item_names[n] = item_names[n_next];
+ item_names[n_next] = item;
+ ImGui::ResetMouseDragDelta();
+ }
+ }
}
+ ImGui::PopItemFlag();
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Widgets/Text/UTF-8 Text");
- if (ImGui::TreeNode("UTF-8 Text"))
+ IMGUI_DEMO_MARKER("Widgets/Drag and Drop/Tooltip at target location");
+ if (ImGui::TreeNode("Tooltip at target location"))
{
- // UTF-8 test with Japanese characters
- // (Needs a suitable font? Try "Google Noto" or "Arial Unicode". See docs/FONTS.md for details.)
- // - From C++11 you can use the u8"my text" syntax to encode literal strings as UTF-8
- // - For earlier compiler, you may be able to encode your sources as UTF-8 (e.g. in Visual Studio, you
- // can save your source files as 'UTF-8 without signature').
- // - FOR THIS DEMO FILE ONLY, BECAUSE WE WANT TO SUPPORT OLD COMPILERS, WE ARE *NOT* INCLUDING RAW UTF-8
- // CHARACTERS IN THIS SOURCE FILE. Instead we are encoding a few strings with hexadecimal constants.
- // Don't do this in your application! Please use u8"text in any language" in your application!
- // Note that characters values are preserved even by InputText() if the font cannot be displayed,
- // so you can safely copy & paste garbled characters into another application.
- ImGui::TextWrapped(
- "CJK text will only appear if the font was loaded with the appropriate CJK character ranges. "
- "Call io.Fonts->AddFontFromFileTTF() manually to load extra character ranges. "
- "Read docs/FONTS.md for details.");
- ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)"); // Normally we would use u8"blah blah" with the proper characters directly in the string.
- ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
- static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
- //static char buf[32] = u8"NIHONGO"; // <- this is how you would write it with C++11, using real kanjis
- ImGui::InputText("UTF-8 input", buf, IM_ARRAYSIZE(buf));
+ for (int n = 0; n < 2; n++)
+ {
+ // Drop targets
+ ImGui::Button(n ? "drop here##1" : "drop here##0");
+ if (ImGui::BeginDragDropTarget())
+ {
+ ImGuiDragDropFlags drop_target_flags = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoPreviewTooltip;
+ if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F, drop_target_flags))
+ {
+ IM_UNUSED(payload);
+ ImGui::SetMouseCursor(ImGuiMouseCursor_NotAllowed);
+ ImGui::SetTooltip("Cannot drop here!");
+ }
+ ImGui::EndDragDropTarget();
+ }
+
+ // Drop source
+ static ImVec4 col4 = { 1.0f, 0.0f, 0.2f, 1.0f };
+ if (n == 0)
+ ImGui::ColorButton("drag me", col4);
+
+ }
ImGui::TreePop();
}
+
ImGui::TreePop();
}
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsDragsAndSliders()
+//-----------------------------------------------------------------------------
+static void DemoWindowWidgetsDragsAndSliders()
+{
+ IMGUI_DEMO_MARKER("Widgets/Drag and Slider Flags");
+ if (ImGui::TreeNode("Drag/Slider Flags"))
+ {
+ // Demonstrate using advanced flags for DragXXX and SliderXXX functions. Note that the flags are the same!
+ static ImGuiSliderFlags flags = ImGuiSliderFlags_None;
+ ImGui::CheckboxFlags("ImGuiSliderFlags_AlwaysClamp", &flags, ImGuiSliderFlags_AlwaysClamp);
+ ImGui::CheckboxFlags("ImGuiSliderFlags_ClampOnInput", &flags, ImGuiSliderFlags_ClampOnInput);
+ ImGui::SameLine(); HelpMarker("Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.");
+ ImGui::CheckboxFlags("ImGuiSliderFlags_ClampZeroRange", &flags, ImGuiSliderFlags_ClampZeroRange);
+ ImGui::SameLine(); HelpMarker("Clamp even if min==max==0.0f. Otherwise DragXXX functions don't clamp.");
+ ImGui::CheckboxFlags("ImGuiSliderFlags_Logarithmic", &flags, ImGuiSliderFlags_Logarithmic);
+ ImGui::SameLine(); HelpMarker("Enable logarithmic editing (more precision for small values).");
+ ImGui::CheckboxFlags("ImGuiSliderFlags_NoRoundToFormat", &flags, ImGuiSliderFlags_NoRoundToFormat);
+ ImGui::SameLine(); HelpMarker("Disable rounding underlying value to match precision of the format string (e.g. %.3f values are rounded to those 3 digits).");
+ ImGui::CheckboxFlags("ImGuiSliderFlags_NoInput", &flags, ImGuiSliderFlags_NoInput);
+ ImGui::SameLine(); HelpMarker("Disable CTRL+Click or Enter key allowing to input text directly into the widget.");
+ ImGui::CheckboxFlags("ImGuiSliderFlags_NoSpeedTweaks", &flags, ImGuiSliderFlags_NoSpeedTweaks);
+ ImGui::SameLine(); HelpMarker("Disable keyboard modifiers altering tweak speed. Useful if you want to alter tweak speed yourself based on your own logic.");
+ ImGui::CheckboxFlags("ImGuiSliderFlags_WrapAround", &flags, ImGuiSliderFlags_WrapAround);
+ ImGui::SameLine(); HelpMarker("Enable wrapping around from max to min and from min to max (only supported by DragXXX() functions)");
+
+ // Drags
+ static float drag_f = 0.5f;
+ static int drag_i = 50;
+ ImGui::Text("Underlying float value: %f", drag_f);
+ ImGui::DragFloat("DragFloat (0 -> 1)", &drag_f, 0.005f, 0.0f, 1.0f, "%.3f", flags);
+ ImGui::DragFloat("DragFloat (0 -> +inf)", &drag_f, 0.005f, 0.0f, FLT_MAX, "%.3f", flags);
+ ImGui::DragFloat("DragFloat (-inf -> 1)", &drag_f, 0.005f, -FLT_MAX, 1.0f, "%.3f", flags);
+ ImGui::DragFloat("DragFloat (-inf -> +inf)", &drag_f, 0.005f, -FLT_MAX, +FLT_MAX, "%.3f", flags);
+ //ImGui::DragFloat("DragFloat (0 -> 0)", &drag_f, 0.005f, 0.0f, 0.0f, "%.3f", flags); // To test ClampZeroRange
+ //ImGui::DragFloat("DragFloat (100 -> 100)", &drag_f, 0.005f, 100.0f, 100.0f, "%.3f", flags);
+ ImGui::DragInt("DragInt (0 -> 100)", &drag_i, 0.5f, 0, 100, "%d", flags);
+
+ // Sliders
+ static float slider_f = 0.5f;
+ static int slider_i = 50;
+ const ImGuiSliderFlags flags_for_sliders = flags & ~ImGuiSliderFlags_WrapAround;
+ ImGui::Text("Underlying float value: %f", slider_f);
+ ImGui::SliderFloat("SliderFloat (0 -> 1)", &slider_f, 0.0f, 1.0f, "%.3f", flags_for_sliders);
+ ImGui::SliderInt("SliderInt (0 -> 100)", &slider_i, 0, 100, "%d", flags_for_sliders);
+
+ ImGui::TreePop();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsImages()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsImages()
+{
IMGUI_DEMO_MARKER("Widgets/Images");
if (ImGui::TreeNode("Images"))
{
@@ -1030,12 +1757,10 @@ static void ShowDemoWindowWidgets()
ImVec2 pos = ImGui::GetCursorScreenPos();
ImVec2 uv_min = ImVec2(0.0f, 0.0f); // Top-left
ImVec2 uv_max = ImVec2(1.0f, 1.0f); // Lower-right
- ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint
- ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f); // 50% opaque white
- ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, tint_col, border_col);
- if (ImGui::IsItemHovered())
+ ImGui::PushStyleVar(ImGuiStyleVar_ImageBorderSize, IM_MAX(1.0f, ImGui::GetStyle().ImageBorderSize));
+ ImGui::ImageWithBg(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
+ if (ImGui::BeginItemTooltip())
{
- ImGui::BeginTooltip();
float region_sz = 32.0f;
float region_x = io.MousePos.x - pos.x - region_sz * 0.5f;
float region_y = io.MousePos.y - pos.y - region_sz * 0.5f;
@@ -1048,9 +1773,10 @@ static void ShowDemoWindowWidgets()
ImGui::Text("Max: (%.2f, %.2f)", region_x + region_sz, region_y + region_sz);
ImVec2 uv0 = ImVec2((region_x) / my_tex_w, (region_y) / my_tex_h);
ImVec2 uv1 = ImVec2((region_x + region_sz) / my_tex_w, (region_y + region_sz) / my_tex_h);
- ImGui::Image(my_tex_id, ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1, tint_col, border_col);
+ ImGui::ImageWithBg(my_tex_id, ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
ImGui::EndTooltip();
}
+ ImGui::PopStyleVar();
}
IMGUI_DEMO_MARKER("Widgets/Images/Textured buttons");
@@ -1080,74 +1806,42 @@ static void ShowDemoWindowWidgets()
ImGui::Text("Pressed %d times.", pressed_count);
ImGui::TreePop();
}
+}
- IMGUI_DEMO_MARKER("Widgets/Combo");
- if (ImGui::TreeNode("Combo"))
- {
- // Combo Boxes are also called "Dropdown" in other systems
- // Expose flags as checkbox for the demo
- static ImGuiComboFlags flags = 0;
- ImGui::CheckboxFlags("ImGuiComboFlags_PopupAlignLeft", &flags, ImGuiComboFlags_PopupAlignLeft);
- ImGui::SameLine(); HelpMarker("Only makes a difference if the popup is larger than the combo");
- if (ImGui::CheckboxFlags("ImGuiComboFlags_NoArrowButton", &flags, ImGuiComboFlags_NoArrowButton))
- flags &= ~ImGuiComboFlags_NoPreview; // Clear the other flag, as we cannot combine both
- if (ImGui::CheckboxFlags("ImGuiComboFlags_NoPreview", &flags, ImGuiComboFlags_NoPreview))
- flags &= ~ImGuiComboFlags_NoArrowButton; // Clear the other flag, as we cannot combine both
-
- // Using the generic BeginCombo() API, you have full control over how to display the combo contents.
- // (your selection data could be an index, a pointer to the object, an id for the object, a flag intrusively
- // stored in the object itself, etc.)
- const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" };
- static int item_current_idx = 0; // Here we store our selection data as an index.
- const char* combo_preview_value = items[item_current_idx]; // Pass in the preview value visible before opening the combo (it could be anything)
- if (ImGui::BeginCombo("combo 1", combo_preview_value, flags))
- {
- for (int n = 0; n < IM_ARRAYSIZE(items); n++)
- {
- const bool is_selected = (item_current_idx == n);
- if (ImGui::Selectable(items[n], is_selected))
- item_current_idx = n;
-
- // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
- if (is_selected)
- ImGui::SetItemDefaultFocus();
- }
- ImGui::EndCombo();
- }
-
- // Simplified one-liner Combo() API, using values packed in a single constant string
- // This is a convenience for when the selection set is small and known at compile-time.
- static int item_current_2 = 0;
- ImGui::Combo("combo 2 (one-liner)", &item_current_2, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
-
- // Simplified one-liner Combo() using an array of const char*
- // This is not very useful (may obsolete): prefer using BeginCombo()/EndCombo() for full control.
- static int item_current_3 = -1; // If the selection isn't within 0..count, Combo won't display a preview
- ImGui::Combo("combo 3 (array)", &item_current_3, items, IM_ARRAYSIZE(items));
-
- // Simplified one-liner Combo() using an accessor function
- struct Funcs { static bool ItemGetter(void* data, int n, const char** out_str) { *out_str = ((const char**)data)[n]; return true; } };
- static int item_current_4 = 0;
- ImGui::Combo("combo 4 (function)", &item_current_4, &Funcs::ItemGetter, items, IM_ARRAYSIZE(items));
-
- ImGui::TreePop();
- }
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsListBoxes()
+//-----------------------------------------------------------------------------
+static void DemoWindowWidgetsListBoxes()
+{
IMGUI_DEMO_MARKER("Widgets/List Boxes");
- if (ImGui::TreeNode("List boxes"))
+ if (ImGui::TreeNode("List Boxes"))
{
+ // BeginListBox() is essentially a thin wrapper to using BeginChild()/EndChild()
+ // using the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label.
+ // You may be tempted to simply use BeginChild() directly. However note that BeginChild() requires EndChild()
+ // to always be called (inconsistent with BeginListBox()/EndListBox()).
+
// Using the generic BeginListBox() API, you have full control over how to display the combo contents.
// (your selection data could be an index, a pointer to the object, an id for the object, a flag intrusively
// stored in the object itself, etc.)
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" };
- static int item_current_idx = 0; // Here we store our selection data as an index.
+ static int item_selected_idx = 0; // Here we store our selected data as an index.
+
+ static bool item_highlight = false;
+ int item_highlighted_idx = -1; // Here we store our highlighted data as an index.
+ ImGui::Checkbox("Highlight hovered item in second listbox", &item_highlight);
+
if (ImGui::BeginListBox("listbox 1"))
{
for (int n = 0; n < IM_ARRAYSIZE(items); n++)
{
- const bool is_selected = (item_current_idx == n);
+ const bool is_selected = (item_selected_idx == n);
if (ImGui::Selectable(items[n], is_selected))
- item_current_idx = n;
+ item_selected_idx = n;
+
+ if (item_highlight && ImGui::IsItemHovered())
+ item_highlighted_idx = n;
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
if (is_selected)
@@ -1155,6 +1849,7 @@ static void ShowDemoWindowWidgets()
}
ImGui::EndListBox();
}
+ ImGui::SameLine(); HelpMarker("Here we are sharing selection state between both boxes.");
// Custom size: use all width, 5 items tall
ImGui::Text("Full-width:");
@@ -1162,9 +1857,10 @@ static void ShowDemoWindowWidgets()
{
for (int n = 0; n < IM_ARRAYSIZE(items); n++)
{
- const bool is_selected = (item_current_idx == n);
- if (ImGui::Selectable(items[n], is_selected))
- item_current_idx = n;
+ bool is_selected = (item_selected_idx == n);
+ ImGuiSelectableFlags flags = (item_highlighted_idx == n) ? ImGuiSelectableFlags_Highlight : 0;
+ if (ImGui::Selectable(items[n], is_selected, flags))
+ item_selected_idx = n;
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
if (is_selected)
@@ -1175,8 +1871,376 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsMultiComponents()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsMultiComponents()
+{
+ IMGUI_DEMO_MARKER("Widgets/Multi-component Widgets");
+ if (ImGui::TreeNode("Multi-component Widgets"))
+ {
+ static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
+ static int vec4i[4] = { 1, 5, 100, 255 };
+
+ ImGui::SeparatorText("2-wide");
+ ImGui::InputFloat2("input float2", vec4f);
+ ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f);
+ ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f);
+ ImGui::InputInt2("input int2", vec4i);
+ ImGui::DragInt2("drag int2", vec4i, 1, 0, 255);
+ ImGui::SliderInt2("slider int2", vec4i, 0, 255);
+
+ ImGui::SeparatorText("3-wide");
+ ImGui::InputFloat3("input float3", vec4f);
+ ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f);
+ ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f);
+ ImGui::InputInt3("input int3", vec4i);
+ ImGui::DragInt3("drag int3", vec4i, 1, 0, 255);
+ ImGui::SliderInt3("slider int3", vec4i, 0, 255);
+
+ ImGui::SeparatorText("4-wide");
+ ImGui::InputFloat4("input float4", vec4f);
+ ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f);
+ ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f);
+ ImGui::InputInt4("input int4", vec4i);
+ ImGui::DragInt4("drag int4", vec4i, 1, 0, 255);
+ ImGui::SliderInt4("slider int4", vec4i, 0, 255);
+
+ ImGui::SeparatorText("Ranges");
+ static float begin = 10, end = 90;
+ static int begin_i = 100, end_i = 1000;
+ ImGui::DragFloatRange2("range float", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%", ImGuiSliderFlags_AlwaysClamp);
+ ImGui::DragIntRange2("range int", &begin_i, &end_i, 5, 0, 1000, "Min: %d units", "Max: %d units");
+ ImGui::DragIntRange2("range int (no bounds)", &begin_i, &end_i, 5, 0, 0, "Min: %d units", "Max: %d units");
+
+ ImGui::TreePop();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsPlotting()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsPlotting()
+{
+ // Plot/Graph widgets are not very good.
+// Consider using a third-party library such as ImPlot: https://github.com/epezent/implot
+// (see others https://github.com/ocornut/imgui/wiki/Useful-Extensions)
+ IMGUI_DEMO_MARKER("Widgets/Plotting");
+ if (ImGui::TreeNode("Plotting"))
+ {
+ ImGui::Text("Need better plotting and graphing? Consider using ImPlot:");
+ ImGui::TextLinkOpenURL("https://github.com/epezent/implot");
+ ImGui::Separator();
+
+ static bool animate = true;
+ ImGui::Checkbox("Animate", &animate);
+
+ // Plot as lines and plot as histogram
+ static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
+ ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr));
+ ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0, 80.0f));
+ //ImGui::SameLine(); HelpMarker("Consider using ImPlot instead!");
+
+ // Fill an array of contiguous float values to plot
+ // Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float
+ // and the sizeof() of your structure in the "stride" parameter.
+ static float values[90] = {};
+ static int values_offset = 0;
+ static double refresh_time = 0.0;
+ if (!animate || refresh_time == 0.0)
+ refresh_time = ImGui::GetTime();
+ while (refresh_time < ImGui::GetTime()) // Create data at fixed 60 Hz rate for the demo
+ {
+ static float phase = 0.0f;
+ values[values_offset] = cosf(phase);
+ values_offset = (values_offset + 1) % IM_ARRAYSIZE(values);
+ phase += 0.10f * values_offset;
+ refresh_time += 1.0f / 60.0f;
+ }
+
+ // Plots can display overlay texts
+ // (in this example, we will display an average value)
+ {
+ float average = 0.0f;
+ for (int n = 0; n < IM_ARRAYSIZE(values); n++)
+ average += values[n];
+ average /= (float)IM_ARRAYSIZE(values);
+ char overlay[32];
+ sprintf(overlay, "avg %f", average);
+ ImGui::PlotLines("Lines", values, IM_ARRAYSIZE(values), values_offset, overlay, -1.0f, 1.0f, ImVec2(0, 80.0f));
+ }
+
+ // Use functions to generate output
+ // FIXME: This is actually VERY awkward because current plot API only pass in indices.
+ // We probably want an API passing floats and user provide sample rate/count.
+ struct Funcs
+ {
+ static float Sin(void*, int i) { return sinf(i * 0.1f); }
+ static float Saw(void*, int i) { return (i & 1) ? 1.0f : -1.0f; }
+ };
+ static int func_type = 0, display_count = 70;
+ ImGui::SeparatorText("Functions");
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
+ ImGui::Combo("func", &func_type, "Sin\0Saw\0");
+ ImGui::SameLine();
+ ImGui::SliderInt("Sample count", &display_count, 1, 400);
+ float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw;
+ ImGui::PlotLines("Lines##2", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80));
+ ImGui::PlotHistogram("Histogram##2", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80));
+
+ ImGui::TreePop();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsProgressBars()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsProgressBars()
+{
+ IMGUI_DEMO_MARKER("Widgets/Progress Bars");
+ if (ImGui::TreeNode("Progress Bars"))
+ {
+ // Animate a simple progress bar
+ static float progress = 0.0f, progress_dir = 1.0f;
+ progress += progress_dir * 0.4f * ImGui::GetIO().DeltaTime;
+ if (progress >= +1.1f) { progress = +1.1f; progress_dir *= -1.0f; }
+ if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; }
+
+ // Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width,
+ // or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth.
+ ImGui::ProgressBar(progress, ImVec2(0.0f, 0.0f));
+ ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
+ ImGui::Text("Progress Bar");
+
+ float progress_saturated = IM_CLAMP(progress, 0.0f, 1.0f);
+ char buf[32];
+ sprintf(buf, "%d/%d", (int)(progress_saturated * 1753), 1753);
+ ImGui::ProgressBar(progress, ImVec2(0.f, 0.f), buf);
+
+ // Pass an animated negative value, e.g. -1.0f * (float)ImGui::GetTime() is the recommended value.
+ // Adjust the factor if you want to adjust the animation speed.
+ ImGui::ProgressBar(-1.0f * (float)ImGui::GetTime(), ImVec2(0.0f, 0.0f), "Searching..");
+ ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
+ ImGui::Text("Indeterminate");
+
+ ImGui::TreePop();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsQueryingStatuses()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsQueryingStatuses()
+{
+ IMGUI_DEMO_MARKER("Widgets/Querying Item Status (Edited,Active,Hovered etc.)");
+ if (ImGui::TreeNode("Querying Item Status (Edited/Active/Hovered etc.)"))
+ {
+ // Select an item type
+ const char* item_names[] =
+ {
+ "Text", "Button", "Button (w/ repeat)", "Checkbox", "SliderFloat", "InputText", "InputTextMultiline", "InputFloat",
+ "InputFloat3", "ColorEdit4", "Selectable", "MenuItem", "TreeNode", "TreeNode (w/ double-click)", "Combo", "ListBox"
+ };
+ static int item_type = 4;
+ static bool item_disabled = false;
+ ImGui::Combo("Item Type", &item_type, item_names, IM_ARRAYSIZE(item_names), IM_ARRAYSIZE(item_names));
+ ImGui::SameLine();
+ HelpMarker("Testing how various types of items are interacting with the IsItemXXX functions. Note that the bool return value of most ImGui function is generally equivalent to calling ImGui::IsItemHovered().");
+ ImGui::Checkbox("Item Disabled", &item_disabled);
+
+ // Submit selected items so we can query their status in the code following it.
+ bool ret = false;
+ static bool b = false;
+ static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
+ static char str[16] = {};
+ if (item_disabled)
+ ImGui::BeginDisabled(true);
+ if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction
+ if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button
+ if (item_type == 2) { ImGui::PushItemFlag(ImGuiItemFlags_ButtonRepeat, true); ret = ImGui::Button("ITEM: Button"); ImGui::PopItemFlag(); } // Testing button (with repeater)
+ if (item_type == 3) { ret = ImGui::Checkbox("ITEM: Checkbox", &b); } // Testing checkbox
+ if (item_type == 4) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item
+ if (item_type == 5) { ret = ImGui::InputText("ITEM: InputText", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which handles tabbing)
+ if (item_type == 6) { ret = ImGui::InputTextMultiline("ITEM: InputTextMultiline", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which uses a child window)
+ if (item_type == 7) { ret = ImGui::InputFloat("ITEM: InputFloat", col4f, 1.0f); } // Testing +/- buttons on scalar input
+ if (item_type == 8) { ret = ImGui::InputFloat3("ITEM: InputFloat3", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged)
+ if (item_type == 9) { ret = ImGui::ColorEdit4("ITEM: ColorEdit4", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged)
+ if (item_type == 10) { ret = ImGui::Selectable("ITEM: Selectable"); } // Testing selectable item
+ if (item_type == 11) { ret = ImGui::MenuItem("ITEM: MenuItem"); } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy)
+ if (item_type == 12) { ret = ImGui::TreeNode("ITEM: TreeNode"); if (ret) ImGui::TreePop(); } // Testing tree node
+ if (item_type == 13) { ret = ImGui::TreeNodeEx("ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen); } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy.
+ if (item_type == 14) { const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::Combo("ITEM: Combo", &current, items, IM_ARRAYSIZE(items)); }
+ if (item_type == 15) { const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", &current, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); }
+
+ bool hovered_delay_none = ImGui::IsItemHovered();
+ bool hovered_delay_stationary = ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary);
+ bool hovered_delay_short = ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort);
+ bool hovered_delay_normal = ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal);
+ bool hovered_delay_tooltip = ImGui::IsItemHovered(ImGuiHoveredFlags_ForTooltip); // = Normal + Stationary
+
+ // Display the values of IsItemHovered() and other common item state functions.
+ // Note that the ImGuiHoveredFlags_XXX flags can be combined.
+ // Because BulletText is an item itself and that would affect the output of IsItemXXX functions,
+ // we query every state in a single call to avoid storing them and to simplify the code.
+ ImGui::BulletText(
+ "Return value = %d\n"
+ "IsItemFocused() = %d\n"
+ "IsItemHovered() = %d\n"
+ "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
+ "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
+ "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
+ "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
+ "IsItemHovered(_AllowWhenDisabled) = %d\n"
+ "IsItemHovered(_RectOnly) = %d\n"
+ "IsItemActive() = %d\n"
+ "IsItemEdited() = %d\n"
+ "IsItemActivated() = %d\n"
+ "IsItemDeactivated() = %d\n"
+ "IsItemDeactivatedAfterEdit() = %d\n"
+ "IsItemVisible() = %d\n"
+ "IsItemClicked() = %d\n"
+ "IsItemToggledOpen() = %d\n"
+ "GetItemRectMin() = (%.1f, %.1f)\n"
+ "GetItemRectMax() = (%.1f, %.1f)\n"
+ "GetItemRectSize() = (%.1f, %.1f)",
+ ret,
+ ImGui::IsItemFocused(),
+ ImGui::IsItemHovered(),
+ ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup),
+ ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
+ ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlappedByItem),
+ ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlappedByWindow),
+ ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled),
+ ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly),
+ ImGui::IsItemActive(),
+ ImGui::IsItemEdited(),
+ ImGui::IsItemActivated(),
+ ImGui::IsItemDeactivated(),
+ ImGui::IsItemDeactivatedAfterEdit(),
+ ImGui::IsItemVisible(),
+ ImGui::IsItemClicked(),
+ ImGui::IsItemToggledOpen(),
+ ImGui::GetItemRectMin().x, ImGui::GetItemRectMin().y,
+ ImGui::GetItemRectMax().x, ImGui::GetItemRectMax().y,
+ ImGui::GetItemRectSize().x, ImGui::GetItemRectSize().y
+ );
+ ImGui::BulletText(
+ "with Hovering Delay or Stationary test:\n"
+ "IsItemHovered() = = %d\n"
+ "IsItemHovered(_Stationary) = %d\n"
+ "IsItemHovered(_DelayShort) = %d\n"
+ "IsItemHovered(_DelayNormal) = %d\n"
+ "IsItemHovered(_Tooltip) = %d",
+ hovered_delay_none, hovered_delay_stationary, hovered_delay_short, hovered_delay_normal, hovered_delay_tooltip);
+
+ if (item_disabled)
+ ImGui::EndDisabled();
+
+ char buf[1] = "";
+ ImGui::InputText("unused", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_ReadOnly);
+ ImGui::SameLine();
+ HelpMarker("This widget is only here to be able to tab-out of the widgets above and see e.g. Deactivated() status.");
+
+ ImGui::TreePop();
+ }
+
+ IMGUI_DEMO_MARKER("Widgets/Querying Window Status (Focused,Hovered etc.)");
+ if (ImGui::TreeNode("Querying Window Status (Focused/Hovered etc.)"))
+ {
+ static bool embed_all_inside_a_child_window = false;
+ ImGui::Checkbox("Embed everything inside a child window for testing _RootWindow flag.", &embed_all_inside_a_child_window);
+ if (embed_all_inside_a_child_window)
+ ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20.0f), ImGuiChildFlags_Borders);
+
+ // Testing IsWindowFocused() function with its various flags.
+ ImGui::BulletText(
+ "IsWindowFocused() = %d\n"
+ "IsWindowFocused(_ChildWindows) = %d\n"
+ "IsWindowFocused(_ChildWindows|_NoPopupHierarchy) = %d\n"
+ "IsWindowFocused(_ChildWindows|_RootWindow) = %d\n"
+ "IsWindowFocused(_ChildWindows|_RootWindow|_NoPopupHierarchy) = %d\n"
+ "IsWindowFocused(_RootWindow) = %d\n"
+ "IsWindowFocused(_RootWindow|_NoPopupHierarchy) = %d\n"
+ "IsWindowFocused(_AnyWindow) = %d\n",
+ ImGui::IsWindowFocused(),
+ ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows),
+ ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_NoPopupHierarchy),
+ ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_RootWindow),
+ ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_NoPopupHierarchy),
+ ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow),
+ ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_NoPopupHierarchy),
+ ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow));
+
+ // Testing IsWindowHovered() function with its various flags.
+ ImGui::BulletText(
+ "IsWindowHovered() = %d\n"
+ "IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n"
+ "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n"
+ "IsWindowHovered(_ChildWindows) = %d\n"
+ "IsWindowHovered(_ChildWindows|_NoPopupHierarchy) = %d\n"
+ "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n"
+ "IsWindowHovered(_ChildWindows|_RootWindow|_NoPopupHierarchy) = %d\n"
+ "IsWindowHovered(_RootWindow) = %d\n"
+ "IsWindowHovered(_RootWindow|_NoPopupHierarchy) = %d\n"
+ "IsWindowHovered(_ChildWindows|_AllowWhenBlockedByPopup) = %d\n"
+ "IsWindowHovered(_AnyWindow) = %d\n"
+ "IsWindowHovered(_Stationary) = %d\n",
+ ImGui::IsWindowHovered(),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_NoPopupHierarchy),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_NoPopupHierarchy),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_NoPopupHierarchy),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_AllowWhenBlockedByPopup),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow),
+ ImGui::IsWindowHovered(ImGuiHoveredFlags_Stationary));
+
+ ImGui::BeginChild("child", ImVec2(0, 50), ImGuiChildFlags_Borders);
+ ImGui::Text("This is another child window for testing the _ChildWindows flag.");
+ ImGui::EndChild();
+ if (embed_all_inside_a_child_window)
+ ImGui::EndChild();
+
+ // Calling IsItemHovered() after begin returns the hovered status of the title bar.
+ // This is useful in particular if you want to create a context menu associated to the title bar of a window.
+ static bool test_window = false;
+ ImGui::Checkbox("Hovered/Active tests after Begin() for title bar testing", &test_window);
+ if (test_window)
+ {
+ ImGui::Begin("Title bar Hovered/Active tests", &test_window);
+ if (ImGui::BeginPopupContextItem()) // <-- This is using IsItemHovered()
+ {
+ if (ImGui::MenuItem("Close")) { test_window = false; }
+ ImGui::EndPopup();
+ }
+ ImGui::Text(
+ "IsItemHovered() after begin = %d (== is title bar hovered)\n"
+ "IsItemActive() after begin = %d (== is window being clicked/moved)\n",
+ ImGui::IsItemHovered(), ImGui::IsItemActive());
+ ImGui::End();
+ }
+
+ ImGui::TreePop();
+ }
+}
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsSelectables()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsSelectables()
+{
IMGUI_DEMO_MARKER("Widgets/Selectables");
+ //ImGui::SetNextItemOpen(true, ImGuiCond_Once);
if (ImGui::TreeNode("Selectables"))
{
// Selectable() has 2 overloads:
@@ -1188,60 +2252,30 @@ static void ShowDemoWindowWidgets()
IMGUI_DEMO_MARKER("Widgets/Selectables/Basic");
if (ImGui::TreeNode("Basic"))
{
- static bool selection[5] = { false, true, false, false, false };
+ static bool selection[5] = { false, true, false, false };
ImGui::Selectable("1. I am selectable", &selection[0]);
ImGui::Selectable("2. I am selectable", &selection[1]);
- ImGui::Text("(I am not selectable)");
- ImGui::Selectable("4. I am selectable", &selection[3]);
- if (ImGui::Selectable("5. I am double clickable", selection[4], ImGuiSelectableFlags_AllowDoubleClick))
+ ImGui::Selectable("3. I am selectable", &selection[2]);
+ if (ImGui::Selectable("4. I am double clickable", selection[3], ImGuiSelectableFlags_AllowDoubleClick))
if (ImGui::IsMouseDoubleClicked(0))
- selection[4] = !selection[4];
+ selection[3] = !selection[3];
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Widgets/Selectables/Single Selection");
- if (ImGui::TreeNode("Selection State: Single Selection"))
- {
- static int selected = -1;
- for (int n = 0; n < 5; n++)
- {
- char buf[32];
- sprintf(buf, "Object %d", n);
- if (ImGui::Selectable(buf, selected == n))
- selected = n;
- }
- ImGui::TreePop();
- }
- IMGUI_DEMO_MARKER("Widgets/Selectables/Multiple Selection");
- if (ImGui::TreeNode("Selection State: Multiple Selection"))
- {
- HelpMarker("Hold CTRL and click to select multiple items.");
- static bool selection[5] = { false, false, false, false, false };
- for (int n = 0; n < 5; n++)
- {
- char buf[32];
- sprintf(buf, "Object %d", n);
- if (ImGui::Selectable(buf, selection[n]))
- {
- if (!ImGui::GetIO().KeyCtrl) // Clear selection when CTRL is not held
- memset(selection, 0, sizeof(selection));
- selection[n] ^= 1;
- }
- }
- ImGui::TreePop();
- }
- IMGUI_DEMO_MARKER("Widgets/Selectables/Rendering more text into the same line");
- if (ImGui::TreeNode("Rendering more text into the same line"))
+
+ IMGUI_DEMO_MARKER("Widgets/Selectables/Rendering more items on the same line");
+ if (ImGui::TreeNode("Rendering more items on the same line"))
{
- // Using the Selectable() override that takes "bool* p_selected" parameter,
- // this function toggle your bool value automatically.
+ // (1) Using SetNextItemAllowOverlap()
+ // (2) Using the Selectable() override that takes "bool* p_selected" parameter, the bool value is toggled automatically.
static bool selected[3] = { false, false, false };
- ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
- ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes");
- ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
+ ImGui::SetNextItemAllowOverlap(); ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(); ImGui::SmallButton("Link 1");
+ ImGui::SetNextItemAllowOverlap(); ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(); ImGui::SmallButton("Link 2");
+ ImGui::SetNextItemAllowOverlap(); ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(); ImGui::SmallButton("Link 3");
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Widgets/Selectables/In columns");
- if (ImGui::TreeNode("In columns"))
+
+ IMGUI_DEMO_MARKER("Widgets/Selectables/In Tables");
+ if (ImGui::TreeNode("In Tables"))
{
static bool selected[10] = {};
@@ -1275,6 +2309,7 @@ static void ShowDemoWindowWidgets()
}
ImGui::TreePop();
}
+
IMGUI_DEMO_MARKER("Widgets/Selectables/Grid");
if (ImGui::TreeNode("Grid"))
{
@@ -1333,175 +2368,981 @@ static void ShowDemoWindowWidgets()
}
ImGui::TreePop();
}
+}
- // To wire InputText() with std::string or any other custom string type,
- // see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file.
- IMGUI_DEMO_MARKER("Widgets/Text Input");
- if (ImGui::TreeNode("Text Input"))
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsSelectionAndMultiSelect()
+//-----------------------------------------------------------------------------
+// Multi-selection demos
+// Also read: https://github.com/ocornut/imgui/wiki/Multi-Select
+//-----------------------------------------------------------------------------
+
+static const char* ExampleNames[] =
+{
+ "Artichoke", "Arugula", "Asparagus", "Avocado", "Bamboo Shoots", "Bean Sprouts", "Beans", "Beet", "Belgian Endive", "Bell Pepper",
+ "Bitter Gourd", "Bok Choy", "Broccoli", "Brussels Sprouts", "Burdock Root", "Cabbage", "Calabash", "Capers", "Carrot", "Cassava",
+ "Cauliflower", "Celery", "Celery Root", "Celcuce", "Chayote", "Chinese Broccoli", "Corn", "Cucumber"
+};
+
+// Extra functions to add deletion support to ImGuiSelectionBasicStorage
+struct ExampleSelectionWithDeletion : ImGuiSelectionBasicStorage
+{
+ // Find which item should be Focused after deletion.
+ // Call _before_ item submission. Retunr an index in the before-deletion item list, your item loop should call SetKeyboardFocusHere() on it.
+ // The subsequent ApplyDeletionPostLoop() code will use it to apply Selection.
+ // - We cannot provide this logic in core Dear ImGui because we don't have access to selection data.
+ // - We don't actually manipulate the ImVector<> here, only in ApplyDeletionPostLoop(), but using similar API for consistency and flexibility.
+ // - Important: Deletion only works if the underlying ImGuiID for your items are stable: aka not depend on their index, but on e.g. item id/ptr.
+ // FIXME-MULTISELECT: Doesn't take account of the possibility focus target will be moved during deletion. Need refocus or scroll offset.
+ int ApplyDeletionPreLoop(ImGuiMultiSelectIO* ms_io, int items_count)
{
- IMGUI_DEMO_MARKER("Widgets/Text Input/Multi-line Text Input");
- if (ImGui::TreeNode("Multi-line Text Input"))
+ if (Size == 0)
+ return -1;
+
+ // If focused item is not selected...
+ const int focused_idx = (int)ms_io->NavIdItem; // Index of currently focused item
+ if (ms_io->NavIdSelected == false) // This is merely a shortcut, == Contains(adapter->IndexToStorage(items, focused_idx))
{
- // Note: we are using a fixed-sized buffer for simplicity here. See ImGuiInputTextFlags_CallbackResize
- // and the code in misc/cpp/imgui_stdlib.h for how to setup InputText() for dynamically resizing strings.
- static char text[1024 * 16] =
- "/*\n"
- " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n"
- " the hexadecimal encoding of one offending instruction,\n"
- " more formally, the invalid operand with locked CMPXCHG8B\n"
- " instruction bug, is a design flaw in the majority of\n"
- " Intel Pentium, Pentium MMX, and Pentium OverDrive\n"
- " processors (all in the P5 microarchitecture).\n"
- "*/\n\n"
- "label:\n"
- "\tlock cmpxchg8b eax\n";
+ ms_io->RangeSrcReset = true; // Request to recover RangeSrc from NavId next frame. Would be ok to reset even when NavIdSelected==true, but it would take an extra frame to recover RangeSrc when deleting a selected item.
+ return focused_idx; // Request to focus same item after deletion.
+ }
- static ImGuiInputTextFlags flags = ImGuiInputTextFlags_AllowTabInput;
- HelpMarker("You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputTextMultiline() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example. (This is not demonstrated in imgui_demo.cpp because we don't want to include <string> in here)");
- ImGui::CheckboxFlags("ImGuiInputTextFlags_ReadOnly", &flags, ImGuiInputTextFlags_ReadOnly);
- ImGui::CheckboxFlags("ImGuiInputTextFlags_AllowTabInput", &flags, ImGuiInputTextFlags_AllowTabInput);
- ImGui::CheckboxFlags("ImGuiInputTextFlags_CtrlEnterForNewLine", &flags, ImGuiInputTextFlags_CtrlEnterForNewLine);
- ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16), flags);
+ // If focused item is selected: land on first unselected item after focused item.
+ for (int idx = focused_idx + 1; idx < items_count; idx++)
+ if (!Contains(GetStorageIdFromIndex(idx)))
+ return idx;
+
+ // If focused item is selected: otherwise return last unselected item before focused item.
+ for (int idx = IM_MIN(focused_idx, items_count) - 1; idx >= 0; idx--)
+ if (!Contains(GetStorageIdFromIndex(idx)))
+ return idx;
+
+ return -1;
+ }
+
+ // Rewrite item list (delete items) + update selection.
+ // - Call after EndMultiSelect()
+ // - We cannot provide this logic in core Dear ImGui because we don't have access to your items, nor to selection data.
+ template<typename ITEM_TYPE>
+ void ApplyDeletionPostLoop(ImGuiMultiSelectIO* ms_io, ImVector<ITEM_TYPE>& items, int item_curr_idx_to_select)
+ {
+ // Rewrite item list (delete items) + convert old selection index (before deletion) to new selection index (after selection).
+ // If NavId was not part of selection, we will stay on same item.
+ ImVector<ITEM_TYPE> new_items;
+ new_items.reserve(items.Size - Size);
+ int item_next_idx_to_select = -1;
+ for (int idx = 0; idx < items.Size; idx++)
+ {
+ if (!Contains(GetStorageIdFromIndex(idx)))
+ new_items.push_back(items[idx]);
+ if (item_curr_idx_to_select == idx)
+ item_next_idx_to_select = new_items.Size - 1;
+ }
+ items.swap(new_items);
+
+ // Update selection
+ Clear();
+ if (item_next_idx_to_select != -1 && ms_io->NavIdSelected)
+ SetItemSelected(GetStorageIdFromIndex(item_next_idx_to_select), true);
+ }
+};
+
+// Example: Implement dual list box storage and interface
+struct ExampleDualListBox
+{
+ ImVector<ImGuiID> Items[2]; // ID is index into ExampleName[]
+ ImGuiSelectionBasicStorage Selections[2]; // Store ExampleItemId into selection
+ bool OptKeepSorted = true;
+
+ void MoveAll(int src, int dst)
+ {
+ IM_ASSERT((src == 0 && dst == 1) || (src == 1 && dst == 0));
+ for (ImGuiID item_id : Items[src])
+ Items[dst].push_back(item_id);
+ Items[src].clear();
+ SortItems(dst);
+ Selections[src].Swap(Selections[dst]);
+ Selections[src].Clear();
+ }
+ void MoveSelected(int src, int dst)
+ {
+ for (int src_n = 0; src_n < Items[src].Size; src_n++)
+ {
+ ImGuiID item_id = Items[src][src_n];
+ if (!Selections[src].Contains(item_id))
+ continue;
+ Items[src].erase(&Items[src][src_n]); // FIXME-OPT: Could be implemented more optimally (rebuild src items and swap)
+ Items[dst].push_back(item_id);
+ src_n--;
+ }
+ if (OptKeepSorted)
+ SortItems(dst);
+ Selections[src].Swap(Selections[dst]);
+ Selections[src].Clear();
+ }
+ void ApplySelectionRequests(ImGuiMultiSelectIO* ms_io, int side)
+ {
+ // In this example we store item id in selection (instead of item index)
+ Selections[side].UserData = Items[side].Data;
+ Selections[side].AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { ImGuiID* items = (ImGuiID*)self->UserData; return items[idx]; };
+ Selections[side].ApplyRequests(ms_io);
+ }
+ static int IMGUI_CDECL CompareItemsByValue(const void* lhs, const void* rhs)
+ {
+ const int* a = (const int*)lhs;
+ const int* b = (const int*)rhs;
+ return (*a - *b) > 0 ? +1 : -1;
+ }
+ void SortItems(int n)
+ {
+ qsort(Items[n].Data, (size_t)Items[n].Size, sizeof(Items[n][0]), CompareItemsByValue);
+ }
+ void Show()
+ {
+ //ImGui::Checkbox("Sorted", &OptKeepSorted);
+ if (ImGui::BeginTable("split", 3, ImGuiTableFlags_None))
+ {
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch); // Left side
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed); // Buttons
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch); // Right side
+ ImGui::TableNextRow();
+
+ int request_move_selected = -1;
+ int request_move_all = -1;
+ float child_height_0 = 0.0f;
+ for (int side = 0; side < 2; side++)
+ {
+ // FIXME-MULTISELECT: Dual List Box: Add context menus
+ // FIXME-NAV: Using ImGuiWindowFlags_NavFlattened exhibit many issues.
+ ImVector<ImGuiID>& items = Items[side];
+ ImGuiSelectionBasicStorage& selection = Selections[side];
+
+ ImGui::TableSetColumnIndex((side == 0) ? 0 : 2);
+ ImGui::Text("%s (%d)", (side == 0) ? "Available" : "Basket", items.Size);
+
+ // Submit scrolling range to avoid glitches on moving/deletion
+ const float items_height = ImGui::GetTextLineHeightWithSpacing();
+ ImGui::SetNextWindowContentSize(ImVec2(0.0f, items.Size * items_height));
+
+ bool child_visible;
+ if (side == 0)
+ {
+ // Left child is resizable
+ ImGui::SetNextWindowSizeConstraints(ImVec2(0.0f, ImGui::GetFrameHeightWithSpacing() * 4), ImVec2(FLT_MAX, FLT_MAX));
+ child_visible = ImGui::BeginChild("0", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY);
+ child_height_0 = ImGui::GetWindowSize().y;
+ }
+ else
+ {
+ // Right child use same height as left one
+ child_visible = ImGui::BeginChild("1", ImVec2(-FLT_MIN, child_height_0), ImGuiChildFlags_FrameStyle);
+ }
+ if (child_visible)
+ {
+ ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_None;
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, items.Size);
+ ApplySelectionRequests(ms_io, side);
+
+ for (int item_n = 0; item_n < items.Size; item_n++)
+ {
+ ImGuiID item_id = items[item_n];
+ bool item_is_selected = selection.Contains(item_id);
+ ImGui::SetNextItemSelectionUserData(item_n);
+ ImGui::Selectable(ExampleNames[item_id], item_is_selected, ImGuiSelectableFlags_AllowDoubleClick);
+ if (ImGui::IsItemFocused())
+ {
+ // FIXME-MULTISELECT: Dual List Box: Transfer focus
+ if (ImGui::IsKeyPressed(ImGuiKey_Enter) || ImGui::IsKeyPressed(ImGuiKey_KeypadEnter))
+ request_move_selected = side;
+ if (ImGui::IsMouseDoubleClicked(0)) // FIXME-MULTISELECT: Double-click on multi-selection?
+ request_move_selected = side;
+ }
+ }
+
+ ms_io = ImGui::EndMultiSelect();
+ ApplySelectionRequests(ms_io, side);
+ }
+ ImGui::EndChild();
+ }
+
+ // Buttons columns
+ ImGui::TableSetColumnIndex(1);
+ ImGui::NewLine();
+ //ImVec2 button_sz = { ImGui::CalcTextSize(">>").x + ImGui::GetStyle().FramePadding.x * 2.0f, ImGui::GetFrameHeight() + padding.y * 2.0f };
+ ImVec2 button_sz = { ImGui::GetFrameHeight(), ImGui::GetFrameHeight() };
+
+ // (Using BeginDisabled()/EndDisabled() works but feels distracting given how it is currently visualized)
+ if (ImGui::Button(">>", button_sz))
+ request_move_all = 0;
+ if (ImGui::Button(">", button_sz))
+ request_move_selected = 0;
+ if (ImGui::Button("<", button_sz))
+ request_move_selected = 1;
+ if (ImGui::Button("<<", button_sz))
+ request_move_all = 1;
+
+ // Process requests
+ if (request_move_all != -1)
+ MoveAll(request_move_all, request_move_all ^ 1);
+ if (request_move_selected != -1)
+ MoveSelected(request_move_selected, request_move_selected ^ 1);
+
+ // FIXME-MULTISELECT: Support action from outside
+ /*
+ if (OptKeepSorted == false)
+ {
+ ImGui::NewLine();
+ if (ImGui::ArrowButton("MoveUp", ImGuiDir_Up)) {}
+ if (ImGui::ArrowButton("MoveDown", ImGuiDir_Down)) {}
+ }
+ */
+
+ ImGui::EndTable();
+ }
+ }
+};
+
+static void DemoWindowWidgetsSelectionAndMultiSelect(ImGuiDemoWindowData* demo_data)
+{
+ IMGUI_DEMO_MARKER("Widgets/Selection State & Multi-Select");
+ if (ImGui::TreeNode("Selection State & Multi-Select"))
+ {
+ HelpMarker("Selections can be built using Selectable(), TreeNode() or other widgets. Selection state is owned by application code/data.");
+
+ // Without any fancy API: manage single-selection yourself.
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Single-Select");
+ if (ImGui::TreeNode("Single-Select"))
+ {
+ static int selected = -1;
+ for (int n = 0; n < 5; n++)
+ {
+ char buf[32];
+ sprintf(buf, "Object %d", n);
+ if (ImGui::Selectable(buf, selected == n))
+ selected = n;
+ }
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Widgets/Text Input/Filtered Text Input");
- if (ImGui::TreeNode("Filtered Text Input"))
+ // Demonstrate implementation a most-basic form of multi-selection manually
+ // This doesn't support the SHIFT modifier which requires BeginMultiSelect()!
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (manual/simplified, without BeginMultiSelect)");
+ if (ImGui::TreeNode("Multi-Select (manual/simplified, without BeginMultiSelect)"))
{
- struct TextFilters
+ HelpMarker("Hold CTRL and click to select multiple items.");
+ static bool selection[5] = { false, false, false, false, false };
+ for (int n = 0; n < 5; n++)
{
- // Return 0 (pass) if the character is 'i' or 'm' or 'g' or 'u' or 'i'
- static int FilterImGuiLetters(ImGuiInputTextCallbackData* data)
+ char buf[32];
+ sprintf(buf, "Object %d", n);
+ if (ImGui::Selectable(buf, selection[n]))
{
- if (data->EventChar < 256 && strchr("imgui", (char)data->EventChar))
- return 0;
- return 1;
+ if (!ImGui::GetIO().KeyCtrl) // Clear selection when CTRL is not held
+ memset(selection, 0, sizeof(selection));
+ selection[n] ^= 1; // Toggle current item
}
- };
+ }
+ ImGui::TreePop();
+ }
+
+ // Demonstrate handling proper multi-selection using the BeginMultiSelect/EndMultiSelect API.
+ // SHIFT+Click w/ CTRL and other standard features are supported.
+ // We use the ImGuiSelectionBasicStorage helper which you may freely reimplement.
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select");
+ if (ImGui::TreeNode("Multi-Select"))
+ {
+ ImGui::Text("Supported features:");
+ ImGui::BulletText("Keyboard navigation (arrows, page up/down, home/end, space).");
+ ImGui::BulletText("Ctrl modifier to preserve and toggle selection.");
+ ImGui::BulletText("Shift modifier for range selection.");
+ ImGui::BulletText("CTRL+A to select all.");
+ ImGui::BulletText("Escape to clear selection.");
+ ImGui::BulletText("Click and drag to box-select.");
+ ImGui::Text("Tip: Use 'Demo->Tools->Debug Log->Selection' to see selection requests as they happen.");
+
+ // Use default selection.Adapter: Pass index to SetNextItemSelectionUserData(), store index in Selection
+ const int ITEMS_COUNT = 50;
+ static ImGuiSelectionBasicStorage selection;
+ ImGui::Text("Selection: %d/%d", selection.Size, ITEMS_COUNT);
- static char buf1[64] = ""; ImGui::InputText("default", buf1, 64);
- static char buf2[64] = ""; ImGui::InputText("decimal", buf2, 64, ImGuiInputTextFlags_CharsDecimal);
- static char buf3[64] = ""; ImGui::InputText("hexadecimal", buf3, 64, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase);
- static char buf4[64] = ""; ImGui::InputText("uppercase", buf4, 64, ImGuiInputTextFlags_CharsUppercase);
- static char buf5[64] = ""; ImGui::InputText("no blank", buf5, 64, ImGuiInputTextFlags_CharsNoBlank);
- static char buf6[64] = ""; ImGui::InputText("\"imgui\" letters", buf6, 64, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterImGuiLetters);
+ // The BeginChild() has no purpose for selection logic, other that offering a scrolling region.
+ if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY))
+ {
+ ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d;
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, ITEMS_COUNT);
+ selection.ApplyRequests(ms_io);
+
+ for (int n = 0; n < ITEMS_COUNT; n++)
+ {
+ char label[64];
+ sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]);
+ bool item_is_selected = selection.Contains((ImGuiID)n);
+ ImGui::SetNextItemSelectionUserData(n);
+ ImGui::Selectable(label, item_is_selected);
+ }
+
+ ms_io = ImGui::EndMultiSelect();
+ selection.ApplyRequests(ms_io);
+ }
+ ImGui::EndChild();
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Widgets/Text Input/Password input");
- if (ImGui::TreeNode("Password Input"))
+ // Demonstrate using the clipper with BeginMultiSelect()/EndMultiSelect()
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (with clipper)");
+ if (ImGui::TreeNode("Multi-Select (with clipper)"))
{
- static char password[64] = "password123";
- ImGui::InputText("password", password, IM_ARRAYSIZE(password), ImGuiInputTextFlags_Password);
- ImGui::SameLine(); HelpMarker("Display all characters as '*'.\nDisable clipboard cut and copy.\nDisable logging.\n");
- ImGui::InputTextWithHint("password (w/ hint)", "<password>", password, IM_ARRAYSIZE(password), ImGuiInputTextFlags_Password);
- ImGui::InputText("password (clear)", password, IM_ARRAYSIZE(password));
+ // Use default selection.Adapter: Pass index to SetNextItemSelectionUserData(), store index in Selection
+ static ImGuiSelectionBasicStorage selection;
+
+ ImGui::Text("Added features:");
+ ImGui::BulletText("Using ImGuiListClipper.");
+
+ const int ITEMS_COUNT = 10000;
+ ImGui::Text("Selection: %d/%d", selection.Size, ITEMS_COUNT);
+ if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY))
+ {
+ ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d;
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, ITEMS_COUNT);
+ selection.ApplyRequests(ms_io);
+
+ ImGuiListClipper clipper;
+ clipper.Begin(ITEMS_COUNT);
+ if (ms_io->RangeSrcItem != -1)
+ clipper.IncludeItemByIndex((int)ms_io->RangeSrcItem); // Ensure RangeSrc item is not clipped.
+ while (clipper.Step())
+ {
+ for (int n = clipper.DisplayStart; n < clipper.DisplayEnd; n++)
+ {
+ char label[64];
+ sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]);
+ bool item_is_selected = selection.Contains((ImGuiID)n);
+ ImGui::SetNextItemSelectionUserData(n);
+ ImGui::Selectable(label, item_is_selected);
+ }
+ }
+
+ ms_io = ImGui::EndMultiSelect();
+ selection.ApplyRequests(ms_io);
+ }
+ ImGui::EndChild();
ImGui::TreePop();
}
- if (ImGui::TreeNode("Completion, History, Edit Callbacks"))
+ // Demonstrate dynamic item list + deletion support using the BeginMultiSelect/EndMultiSelect API.
+ // In order to support Deletion without any glitches you need to:
+ // - (1) If items are submitted in their own scrolling area, submit contents size SetNextWindowContentSize() ahead of time to prevent one-frame readjustment of scrolling.
+ // - (2) Items needs to have persistent ID Stack identifier = ID needs to not depends on their index. PushID(index) = KO. PushID(item_id) = OK. This is in order to focus items reliably after a selection.
+ // - (3) BeginXXXX process
+ // - (4) Focus process
+ // - (5) EndXXXX process
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (with deletion)");
+ if (ImGui::TreeNode("Multi-Select (with deletion)"))
+ {
+ // Storing items data separately from selection data.
+ // (you may decide to store selection data inside your item (aka intrusive storage) if you don't need multiple views over same items)
+ // Use a custom selection.Adapter: store item identifier in Selection (instead of index)
+ static ImVector<ImGuiID> items;
+ static ExampleSelectionWithDeletion selection;
+ selection.UserData = (void*)&items;
+ selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { ImVector<ImGuiID>* p_items = (ImVector<ImGuiID>*)self->UserData; return (*p_items)[idx]; }; // Index -> ID
+
+ ImGui::Text("Added features:");
+ ImGui::BulletText("Dynamic list with Delete key support.");
+ ImGui::Text("Selection size: %d/%d", selection.Size, items.Size);
+
+ // Initialize default list with 50 items + button to add/remove items.
+ static ImGuiID items_next_id = 0;
+ if (items_next_id == 0)
+ for (ImGuiID n = 0; n < 50; n++)
+ items.push_back(items_next_id++);
+ if (ImGui::SmallButton("Add 20 items")) { for (int n = 0; n < 20; n++) { items.push_back(items_next_id++); } }
+ ImGui::SameLine();
+ if (ImGui::SmallButton("Remove 20 items")) { for (int n = IM_MIN(20, items.Size); n > 0; n--) { selection.SetItemSelected(items.back(), false); items.pop_back(); } }
+
+ // (1) Extra to support deletion: Submit scrolling range to avoid glitches on deletion
+ const float items_height = ImGui::GetTextLineHeightWithSpacing();
+ ImGui::SetNextWindowContentSize(ImVec2(0.0f, items.Size * items_height));
+
+ if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY))
+ {
+ ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d;
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, items.Size);
+ selection.ApplyRequests(ms_io);
+
+ const bool want_delete = ImGui::Shortcut(ImGuiKey_Delete, ImGuiInputFlags_Repeat) && (selection.Size > 0);
+ const int item_curr_idx_to_focus = want_delete ? selection.ApplyDeletionPreLoop(ms_io, items.Size) : -1;
+
+ for (int n = 0; n < items.Size; n++)
+ {
+ const ImGuiID item_id = items[n];
+ char label[64];
+ sprintf(label, "Object %05u: %s", item_id, ExampleNames[item_id % IM_ARRAYSIZE(ExampleNames)]);
+
+ bool item_is_selected = selection.Contains(item_id);
+ ImGui::SetNextItemSelectionUserData(n);
+ ImGui::Selectable(label, item_is_selected);
+ if (item_curr_idx_to_focus == n)
+ ImGui::SetKeyboardFocusHere(-1);
+ }
+
+ // Apply multi-select requests
+ ms_io = ImGui::EndMultiSelect();
+ selection.ApplyRequests(ms_io);
+ if (want_delete)
+ selection.ApplyDeletionPostLoop(ms_io, items, item_curr_idx_to_focus);
+ }
+ ImGui::EndChild();
+ ImGui::TreePop();
+ }
+
+ // Implement a Dual List Box (#6648)
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (dual list box)");
+ if (ImGui::TreeNode("Multi-Select (dual list box)"))
{
- struct Funcs
+ // Init default state
+ static ExampleDualListBox dlb;
+ if (dlb.Items[0].Size == 0 && dlb.Items[1].Size == 0)
+ for (int item_id = 0; item_id < IM_ARRAYSIZE(ExampleNames); item_id++)
+ dlb.Items[0].push_back((ImGuiID)item_id);
+
+ // Show
+ dlb.Show();
+
+ ImGui::TreePop();
+ }
+
+ // Demonstrate using the clipper with BeginMultiSelect()/EndMultiSelect()
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (in a table)");
+ if (ImGui::TreeNode("Multi-Select (in a table)"))
+ {
+ static ImGuiSelectionBasicStorage selection;
+
+ const int ITEMS_COUNT = 10000;
+ ImGui::Text("Selection: %d/%d", selection.Size, ITEMS_COUNT);
+ if (ImGui::BeginTable("##Basket", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter))
{
- static int MyCallback(ImGuiInputTextCallbackData* data)
+ ImGui::TableSetupColumn("Object");
+ ImGui::TableSetupColumn("Action");
+ ImGui::TableSetupScrollFreeze(0, 1);
+ ImGui::TableHeadersRow();
+
+ ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d;
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, ITEMS_COUNT);
+ selection.ApplyRequests(ms_io);
+
+ ImGuiListClipper clipper;
+ clipper.Begin(ITEMS_COUNT);
+ if (ms_io->RangeSrcItem != -1)
+ clipper.IncludeItemByIndex((int)ms_io->RangeSrcItem); // Ensure RangeSrc item is not clipped.
+ while (clipper.Step())
{
- if (data->EventFlag == ImGuiInputTextFlags_CallbackCompletion)
+ for (int n = clipper.DisplayStart; n < clipper.DisplayEnd; n++)
{
- data->InsertChars(data->CursorPos, "..");
+ ImGui::TableNextRow();
+ ImGui::TableNextColumn();
+ char label[64];
+ sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]);
+ bool item_is_selected = selection.Contains((ImGuiID)n);
+ ImGui::SetNextItemSelectionUserData(n);
+ ImGui::Selectable(label, item_is_selected, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap);
+ ImGui::TableNextColumn();
+ ImGui::SmallButton("hello");
}
- else if (data->EventFlag == ImGuiInputTextFlags_CallbackHistory)
+ }
+
+ ms_io = ImGui::EndMultiSelect();
+ selection.ApplyRequests(ms_io);
+ ImGui::EndTable();
+ }
+ ImGui::TreePop();
+ }
+
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (checkboxes)");
+ if (ImGui::TreeNode("Multi-Select (checkboxes)"))
+ {
+ ImGui::Text("In a list of checkboxes (not selectable):");
+ ImGui::BulletText("Using _NoAutoSelect + _NoAutoClear flags.");
+ ImGui::BulletText("Shift+Click to check multiple boxes.");
+ ImGui::BulletText("Shift+Keyboard to copy current value to other boxes.");
+
+ // If you have an array of checkboxes, you may want to use NoAutoSelect + NoAutoClear and the ImGuiSelectionExternalStorage helper.
+ static bool items[20] = {};
+ static ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_NoAutoSelect | ImGuiMultiSelectFlags_NoAutoClear | ImGuiMultiSelectFlags_ClearOnEscape;
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoSelect", &flags, ImGuiMultiSelectFlags_NoAutoSelect);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoClear", &flags, ImGuiMultiSelectFlags_NoAutoClear);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelect2d", &flags, ImGuiMultiSelectFlags_BoxSelect2d); // Cannot use ImGuiMultiSelectFlags_BoxSelect1d as checkboxes are varying width.
+
+ if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeY))
+ {
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, -1, IM_ARRAYSIZE(items));
+ ImGuiSelectionExternalStorage storage_wrapper;
+ storage_wrapper.UserData = (void*)items;
+ storage_wrapper.AdapterSetItemSelected = [](ImGuiSelectionExternalStorage* self, int n, bool selected) { bool* array = (bool*)self->UserData; array[n] = selected; };
+ storage_wrapper.ApplyRequests(ms_io);
+ for (int n = 0; n < 20; n++)
+ {
+ char label[32];
+ sprintf(label, "Item %d", n);
+ ImGui::SetNextItemSelectionUserData(n);
+ ImGui::Checkbox(label, &items[n]);
+ }
+ ms_io = ImGui::EndMultiSelect();
+ storage_wrapper.ApplyRequests(ms_io);
+ }
+ ImGui::EndChild();
+
+ ImGui::TreePop();
+ }
+
+ // Demonstrate individual selection scopes in same window
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (multiple scopes)");
+ if (ImGui::TreeNode("Multi-Select (multiple scopes)"))
+ {
+ // Use default select: Pass index to SetNextItemSelectionUserData(), store index in Selection
+ const int SCOPES_COUNT = 3;
+ const int ITEMS_COUNT = 8; // Per scope
+ static ImGuiSelectionBasicStorage selections_data[SCOPES_COUNT];
+
+ // Use ImGuiMultiSelectFlags_ScopeRect to not affect other selections in same window.
+ static ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ScopeRect | ImGuiMultiSelectFlags_ClearOnEscape;// | ImGuiMultiSelectFlags_ClearOnClickVoid;
+ if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ScopeWindow", &flags, ImGuiMultiSelectFlags_ScopeWindow) && (flags & ImGuiMultiSelectFlags_ScopeWindow))
+ flags &= ~ImGuiMultiSelectFlags_ScopeRect;
+ if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ScopeRect", &flags, ImGuiMultiSelectFlags_ScopeRect) && (flags & ImGuiMultiSelectFlags_ScopeRect))
+ flags &= ~ImGuiMultiSelectFlags_ScopeWindow;
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ClearOnClickVoid", &flags, ImGuiMultiSelectFlags_ClearOnClickVoid);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelect1d", &flags, ImGuiMultiSelectFlags_BoxSelect1d);
+
+ for (int selection_scope_n = 0; selection_scope_n < SCOPES_COUNT; selection_scope_n++)
+ {
+ ImGui::PushID(selection_scope_n);
+ ImGuiSelectionBasicStorage* selection = &selections_data[selection_scope_n];
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection->Size, ITEMS_COUNT);
+ selection->ApplyRequests(ms_io);
+
+ ImGui::SeparatorText("Selection scope");
+ ImGui::Text("Selection size: %d/%d", selection->Size, ITEMS_COUNT);
+
+ for (int n = 0; n < ITEMS_COUNT; n++)
+ {
+ char label[64];
+ sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]);
+ bool item_is_selected = selection->Contains((ImGuiID)n);
+ ImGui::SetNextItemSelectionUserData(n);
+ ImGui::Selectable(label, item_is_selected);
+ }
+
+ // Apply multi-select requests
+ ms_io = ImGui::EndMultiSelect();
+ selection->ApplyRequests(ms_io);
+ ImGui::PopID();
+ }
+ ImGui::TreePop();
+ }
+
+ // See ShowExampleAppAssetsBrowser()
+ if (ImGui::TreeNode("Multi-Select (tiled assets browser)"))
+ {
+ ImGui::Checkbox("Assets Browser", &demo_data->ShowAppAssetsBrowser);
+ ImGui::Text("(also access from 'Examples->Assets Browser' in menu)");
+ ImGui::TreePop();
+ }
+
+ // Demonstrate supporting multiple-selection in a tree.
+ // - We don't use linear indices for selection user data, but our ExampleTreeNode* pointer directly!
+ // This showcase how SetNextItemSelectionUserData() never assume indices!
+ // - The difficulty here is to "interpolate" from RangeSrcItem to RangeDstItem in the SetAll/SetRange request.
+ // We want this interpolation to match what the user sees: in visible order, skipping closed nodes.
+ // This is implemented by our TreeGetNextNodeInVisibleOrder() user-space helper.
+ // - Important: In a real codebase aiming to implement full-featured selectable tree with custom filtering, you
+ // are more likely to build an array mapping sequential indices to visible tree nodes, since your
+ // filtering/search + clipping process will benefit from it. Having this will make this interpolation much easier.
+ // - Consider this a prototype: we are working toward simplifying some of it.
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (trees)");
+ if (ImGui::TreeNode("Multi-Select (trees)"))
+ {
+ HelpMarker(
+ "This is rather advanced and experimental. If you are getting started with multi-select, "
+ "please don't start by looking at how to use it for a tree!\n\n"
+ "Future versions will try to simplify and formalize some of this.");
+
+ struct ExampleTreeFuncs
+ {
+ static void DrawNode(ExampleTreeNode* node, ImGuiSelectionBasicStorage* selection)
+ {
+ ImGuiTreeNodeFlags tree_node_flags = ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick;
+ tree_node_flags |= ImGuiTreeNodeFlags_NavLeftJumpsBackHere; // Enable pressing left to jump to parent
+ if (node->Childs.Size == 0)
+ tree_node_flags |= ImGuiTreeNodeFlags_Bullet | ImGuiTreeNodeFlags_Leaf;
+ if (selection->Contains((ImGuiID)node->UID))
+ tree_node_flags |= ImGuiTreeNodeFlags_Selected;
+
+ // Using SetNextItemStorageID() to specify storage id, so we can easily peek into
+ // the storage holding open/close stage, using our TreeNodeGetOpen/TreeNodeSetOpen() functions.
+ ImGui::SetNextItemSelectionUserData((ImGuiSelectionUserData)(intptr_t)node);
+ ImGui::SetNextItemStorageID((ImGuiID)node->UID);
+ if (ImGui::TreeNodeEx(node->Name, tree_node_flags))
{
- if (data->EventKey == ImGuiKey_UpArrow)
+ for (ExampleTreeNode* child : node->Childs)
+ DrawNode(child, selection);
+ ImGui::TreePop();
+ }
+ else if (ImGui::IsItemToggledOpen())
+ {
+ TreeCloseAndUnselectChildNodes(node, selection);
+ }
+ }
+
+ static bool TreeNodeGetOpen(ExampleTreeNode* node)
+ {
+ return ImGui::GetStateStorage()->GetBool((ImGuiID)node->UID);
+ }
+
+ static void TreeNodeSetOpen(ExampleTreeNode* node, bool open)
+ {
+ ImGui::GetStateStorage()->SetBool((ImGuiID)node->UID, open);
+ }
+
+ // When closing a node: 1) close and unselect all child nodes, 2) select parent if any child was selected.
+ // FIXME: This is currently handled by user logic but I'm hoping to eventually provide tree node
+ // features to do this automatically, e.g. a ImGuiTreeNodeFlags_AutoCloseChildNodes etc.
+ static int TreeCloseAndUnselectChildNodes(ExampleTreeNode* node, ImGuiSelectionBasicStorage* selection, int depth = 0)
+ {
+ // Recursive close (the test for depth == 0 is because we call this on a node that was just closed!)
+ int unselected_count = selection->Contains((ImGuiID)node->UID) ? 1 : 0;
+ if (depth == 0 || TreeNodeGetOpen(node))
+ {
+ for (ExampleTreeNode* child : node->Childs)
+ unselected_count += TreeCloseAndUnselectChildNodes(child, selection, depth + 1);
+ TreeNodeSetOpen(node, false);
+ }
+
+ // Select root node if any of its child was selected, otherwise unselect
+ selection->SetItemSelected((ImGuiID)node->UID, (depth == 0 && unselected_count > 0));
+ return unselected_count;
+ }
+
+ // Apply multi-selection requests
+ static void ApplySelectionRequests(ImGuiMultiSelectIO* ms_io, ExampleTreeNode* tree, ImGuiSelectionBasicStorage* selection)
+ {
+ for (ImGuiSelectionRequest& req : ms_io->Requests)
+ {
+ if (req.Type == ImGuiSelectionRequestType_SetAll)
{
- data->DeleteChars(0, data->BufTextLen);
- data->InsertChars(0, "Pressed Up!");
- data->SelectAll();
+ if (req.Selected)
+ TreeSetAllInOpenNodes(tree, selection, req.Selected);
+ else
+ selection->Clear();
}
- else if (data->EventKey == ImGuiKey_DownArrow)
+ else if (req.Type == ImGuiSelectionRequestType_SetRange)
{
- data->DeleteChars(0, data->BufTextLen);
- data->InsertChars(0, "Pressed Down!");
- data->SelectAll();
+ ExampleTreeNode* first_node = (ExampleTreeNode*)(intptr_t)req.RangeFirstItem;
+ ExampleTreeNode* last_node = (ExampleTreeNode*)(intptr_t)req.RangeLastItem;
+ for (ExampleTreeNode* node = first_node; node != NULL; node = TreeGetNextNodeInVisibleOrder(node, last_node))
+ selection->SetItemSelected((ImGuiID)node->UID, req.Selected);
}
}
- else if (data->EventFlag == ImGuiInputTextFlags_CallbackEdit)
- {
- // Toggle casing of first character
- char c = data->Buf[0];
- if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) data->Buf[0] ^= 32;
- data->BufDirty = true;
+ }
- // Increment a counter
- int* p_int = (int*)data->UserData;
- *p_int = *p_int + 1;
+ static void TreeSetAllInOpenNodes(ExampleTreeNode* node, ImGuiSelectionBasicStorage* selection, bool selected)
+ {
+ if (node->Parent != NULL) // Root node isn't visible nor selectable in our scheme
+ selection->SetItemSelected((ImGuiID)node->UID, selected);
+ if (node->Parent == NULL || TreeNodeGetOpen(node))
+ for (ExampleTreeNode* child : node->Childs)
+ TreeSetAllInOpenNodes(child, selection, selected);
+ }
+
+ // Interpolate in *user-visible order* AND only *over opened nodes*.
+ // If you have a sequential mapping tables (e.g. generated after a filter/search pass) this would be simpler.
+ // Here the tricks are that:
+ // - we store/maintain ExampleTreeNode::IndexInParent which allows implementing a linear iterator easily, without searches, without recursion.
+ // this could be replaced by a search in parent, aka 'int index_in_parent = curr_node->Parent->Childs.find_index(curr_node)'
+ // which would only be called when crossing from child to a parent, aka not too much.
+ // - we call SetNextItemStorageID() before our TreeNode() calls with an ID which doesn't relate to UI stack,
+ // making it easier to call TreeNodeGetOpen()/TreeNodeSetOpen() from any location.
+ static ExampleTreeNode* TreeGetNextNodeInVisibleOrder(ExampleTreeNode* curr_node, ExampleTreeNode* last_node)
+ {
+ // Reached last node
+ if (curr_node == last_node)
+ return NULL;
+
+ // Recurse into childs. Query storage to tell if the node is open.
+ if (curr_node->Childs.Size > 0 && TreeNodeGetOpen(curr_node))
+ return curr_node->Childs[0];
+
+ // Next sibling, then into our own parent
+ while (curr_node->Parent != NULL)
+ {
+ if (curr_node->IndexInParent + 1 < curr_node->Parent->Childs.Size)
+ return curr_node->Parent->Childs[curr_node->IndexInParent + 1];
+ curr_node = curr_node->Parent;
}
- return 0;
+ return NULL;
}
- };
- static char buf1[64];
- ImGui::InputText("Completion", buf1, 64, ImGuiInputTextFlags_CallbackCompletion, Funcs::MyCallback);
- ImGui::SameLine(); HelpMarker("Here we append \"..\" each time Tab is pressed. See 'Examples>Console' for a more meaningful demonstration of using this callback.");
- static char buf2[64];
- ImGui::InputText("History", buf2, 64, ImGuiInputTextFlags_CallbackHistory, Funcs::MyCallback);
- ImGui::SameLine(); HelpMarker("Here we replace and select text each time Up/Down are pressed. See 'Examples>Console' for a more meaningful demonstration of using this callback.");
+ }; // ExampleTreeFuncs
- static char buf3[64];
- static int edit_count = 0;
- ImGui::InputText("Edit", buf3, 64, ImGuiInputTextFlags_CallbackEdit, Funcs::MyCallback, (void*)&edit_count);
- ImGui::SameLine(); HelpMarker("Here we toggle the casing of the first character on every edit + count edits.");
- ImGui::SameLine(); ImGui::Text("(%d)", edit_count);
+ static ImGuiSelectionBasicStorage selection;
+ if (demo_data->DemoTree == NULL)
+ demo_data->DemoTree = ExampleTree_CreateDemoTree(); // Create tree once
+ ImGui::Text("Selection size: %d", selection.Size);
+
+ if (ImGui::BeginChild("##Tree", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY))
+ {
+ ExampleTreeNode* tree = demo_data->DemoTree;
+ ImGuiMultiSelectFlags ms_flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect2d;
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(ms_flags, selection.Size, -1);
+ ExampleTreeFuncs::ApplySelectionRequests(ms_io, tree, &selection);
+ for (ExampleTreeNode* node : tree->Childs)
+ ExampleTreeFuncs::DrawNode(node, &selection);
+ ms_io = ImGui::EndMultiSelect();
+ ExampleTreeFuncs::ApplySelectionRequests(ms_io, tree, &selection);
+ }
+ ImGui::EndChild();
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Widgets/Text Input/Resize Callback");
- if (ImGui::TreeNode("Resize Callback"))
- {
- // To wire InputText() with std::string or any other custom string type,
- // you can use the ImGuiInputTextFlags_CallbackResize flag + create a custom ImGui::InputText() wrapper
- // using your preferred type. See misc/cpp/imgui_stdlib.h for an implementation of this using std::string.
- HelpMarker(
- "Using ImGuiInputTextFlags_CallbackResize to wire your custom string type to InputText().\n\n"
- "See misc/cpp/imgui_stdlib.h for an implementation of this for std::string.");
- struct Funcs
+ // Advanced demonstration of BeginMultiSelect()
+ // - Showcase clipping.
+ // - Showcase deletion.
+ // - Showcase basic drag and drop.
+ // - Showcase TreeNode variant (note that tree node don't expand in the demo: supporting expanding tree nodes + clipping a separate thing).
+ // - Showcase using inside a table.
+ IMGUI_DEMO_MARKER("Widgets/Selection State/Multi-Select (advanced)");
+ //ImGui::SetNextItemOpen(true, ImGuiCond_Once);
+ if (ImGui::TreeNode("Multi-Select (advanced)"))
+ {
+ // Options
+ enum WidgetType { WidgetType_Selectable, WidgetType_TreeNode };
+ static bool use_clipper = true;
+ static bool use_deletion = true;
+ static bool use_drag_drop = true;
+ static bool show_in_table = false;
+ static bool show_color_button = true;
+ static ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d;
+ static WidgetType widget_type = WidgetType_Selectable;
+
+ if (ImGui::TreeNode("Options"))
+ {
+ if (ImGui::RadioButton("Selectables", widget_type == WidgetType_Selectable)) { widget_type = WidgetType_Selectable; }
+ ImGui::SameLine();
+ if (ImGui::RadioButton("Tree nodes", widget_type == WidgetType_TreeNode)) { widget_type = WidgetType_TreeNode; }
+ ImGui::SameLine();
+ HelpMarker("TreeNode() is technically supported but... using this correctly is more complicated (you need some sort of linear/random access to your tree, which is suited to advanced trees setups already implementing filters and clipper. We will work toward simplifying and demoing this.\n\nFor now the tree demo is actually a little bit meaningless because it is an empty tree with only root nodes.");
+ ImGui::Checkbox("Enable clipper", &use_clipper);
+ ImGui::Checkbox("Enable deletion", &use_deletion);
+ ImGui::Checkbox("Enable drag & drop", &use_drag_drop);
+ ImGui::Checkbox("Show in a table", &show_in_table);
+ ImGui::Checkbox("Show color button", &show_color_button);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_SingleSelect", &flags, ImGuiMultiSelectFlags_SingleSelect);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoSelectAll", &flags, ImGuiMultiSelectFlags_NoSelectAll);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoRangeSelect", &flags, ImGuiMultiSelectFlags_NoRangeSelect);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoSelect", &flags, ImGuiMultiSelectFlags_NoAutoSelect);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoClear", &flags, ImGuiMultiSelectFlags_NoAutoClear);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoClearOnReselect", &flags, ImGuiMultiSelectFlags_NoAutoClearOnReselect);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelect1d", &flags, ImGuiMultiSelectFlags_BoxSelect1d);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelect2d", &flags, ImGuiMultiSelectFlags_BoxSelect2d);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_BoxSelectNoScroll", &flags, ImGuiMultiSelectFlags_BoxSelectNoScroll);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ClearOnEscape", &flags, ImGuiMultiSelectFlags_ClearOnEscape);
+ ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ClearOnClickVoid", &flags, ImGuiMultiSelectFlags_ClearOnClickVoid);
+ if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ScopeWindow", &flags, ImGuiMultiSelectFlags_ScopeWindow) && (flags & ImGuiMultiSelectFlags_ScopeWindow))
+ flags &= ~ImGuiMultiSelectFlags_ScopeRect;
+ if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_ScopeRect", &flags, ImGuiMultiSelectFlags_ScopeRect) && (flags & ImGuiMultiSelectFlags_ScopeRect))
+ flags &= ~ImGuiMultiSelectFlags_ScopeWindow;
+ if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_SelectOnClick", &flags, ImGuiMultiSelectFlags_SelectOnClick) && (flags & ImGuiMultiSelectFlags_SelectOnClick))
+ flags &= ~ImGuiMultiSelectFlags_SelectOnClickRelease;
+ if (ImGui::CheckboxFlags("ImGuiMultiSelectFlags_SelectOnClickRelease", &flags, ImGuiMultiSelectFlags_SelectOnClickRelease) && (flags & ImGuiMultiSelectFlags_SelectOnClickRelease))
+ flags &= ~ImGuiMultiSelectFlags_SelectOnClick;
+ ImGui::SameLine(); HelpMarker("Allow dragging an unselected item without altering selection.");
+ ImGui::TreePop();
+ }
+
+ // Initialize default list with 1000 items.
+ // Use default selection.Adapter: Pass index to SetNextItemSelectionUserData(), store index in Selection
+ static ImVector<int> items;
+ static int items_next_id = 0;
+ if (items_next_id == 0) { for (int n = 0; n < 1000; n++) { items.push_back(items_next_id++); } }
+ static ExampleSelectionWithDeletion selection;
+ static bool request_deletion_from_menu = false; // Queue deletion triggered from context menu
+
+ ImGui::Text("Selection size: %d/%d", selection.Size, items.Size);
+
+ const float items_height = (widget_type == WidgetType_TreeNode) ? ImGui::GetTextLineHeight() : ImGui::GetTextLineHeightWithSpacing();
+ ImGui::SetNextWindowContentSize(ImVec2(0.0f, items.Size * items_height));
+ if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY))
{
- static int MyResizeCallback(ImGuiInputTextCallbackData* data)
+ ImVec2 color_button_sz(ImGui::GetFontSize(), ImGui::GetFontSize());
+ if (widget_type == WidgetType_TreeNode)
+ ImGui::PushStyleVarY(ImGuiStyleVar_ItemSpacing, 0.0f);
+
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, items.Size);
+ selection.ApplyRequests(ms_io);
+
+ const bool want_delete = (ImGui::Shortcut(ImGuiKey_Delete, ImGuiInputFlags_Repeat) && (selection.Size > 0)) || request_deletion_from_menu;
+ const int item_curr_idx_to_focus = want_delete ? selection.ApplyDeletionPreLoop(ms_io, items.Size) : -1;
+ request_deletion_from_menu = false;
+
+ if (show_in_table)
{
- if (data->EventFlag == ImGuiInputTextFlags_CallbackResize)
+ if (widget_type == WidgetType_TreeNode)
+ ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(0.0f, 0.0f));
+ ImGui::BeginTable("##Split", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_NoPadOuterX);
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch, 0.70f);
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch, 0.30f);
+ //ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacingY, 0.0f);
+ }
+
+ ImGuiListClipper clipper;
+ if (use_clipper)
+ {
+ clipper.Begin(items.Size);
+ if (item_curr_idx_to_focus != -1)
+ clipper.IncludeItemByIndex(item_curr_idx_to_focus); // Ensure focused item is not clipped.
+ if (ms_io->RangeSrcItem != -1)
+ clipper.IncludeItemByIndex((int)ms_io->RangeSrcItem); // Ensure RangeSrc item is not clipped.
+ }
+
+ while (!use_clipper || clipper.Step())
+ {
+ const int item_begin = use_clipper ? clipper.DisplayStart : 0;
+ const int item_end = use_clipper ? clipper.DisplayEnd : items.Size;
+ for (int n = item_begin; n < item_end; n++)
{
- ImVector<char>* my_str = (ImVector<char>*)data->UserData;
- IM_ASSERT(my_str->begin() == data->Buf);
- my_str->resize(data->BufSize); // NB: On resizing calls, generally data->BufSize == data->BufTextLen + 1
- data->Buf = my_str->begin();
+ if (show_in_table)
+ ImGui::TableNextColumn();
+
+ const int item_id = items[n];
+ const char* item_category = ExampleNames[item_id % IM_ARRAYSIZE(ExampleNames)];
+ char label[64];
+ sprintf(label, "Object %05d: %s", item_id, item_category);
+
+ // IMPORTANT: for deletion refocus to work we need object ID to be stable,
+ // aka not depend on their index in the list. Here we use our persistent item_id
+ // instead of index to build a unique ID that will persist.
+ // (If we used PushID(index) instead, focus wouldn't be restored correctly after deletion).
+ ImGui::PushID(item_id);
+
+ // Emit a color button, to test that Shift+LeftArrow landing on an item that is not part
+ // of the selection scope doesn't erroneously alter our selection.
+ if (show_color_button)
+ {
+ ImU32 dummy_col = (ImU32)((unsigned int)n * 0xC250B74B) | IM_COL32_A_MASK;
+ ImGui::ColorButton("##", ImColor(dummy_col), ImGuiColorEditFlags_NoTooltip, color_button_sz);
+ ImGui::SameLine();
+ }
+
+ // Submit item
+ bool item_is_selected = selection.Contains((ImGuiID)n);
+ bool item_is_open = false;
+ ImGui::SetNextItemSelectionUserData(n);
+ if (widget_type == WidgetType_Selectable)
+ {
+ ImGui::Selectable(label, item_is_selected, ImGuiSelectableFlags_None);
+ }
+ else if (widget_type == WidgetType_TreeNode)
+ {
+ ImGuiTreeNodeFlags tree_node_flags = ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick;
+ if (item_is_selected)
+ tree_node_flags |= ImGuiTreeNodeFlags_Selected;
+ item_is_open = ImGui::TreeNodeEx(label, tree_node_flags);
+ }
+
+ // Focus (for after deletion)
+ if (item_curr_idx_to_focus == n)
+ ImGui::SetKeyboardFocusHere(-1);
+
+ // Drag and Drop
+ if (use_drag_drop && ImGui::BeginDragDropSource())
+ {
+ // Create payload with full selection OR single unselected item.
+ // (the later is only possible when using ImGuiMultiSelectFlags_SelectOnClickRelease)
+ if (ImGui::GetDragDropPayload() == NULL)
+ {
+ ImVector<int> payload_items;
+ void* it = NULL;
+ ImGuiID id = 0;
+ if (!item_is_selected)
+ payload_items.push_back(item_id);
+ else
+ while (selection.GetNextSelectedItem(&it, &id))
+ payload_items.push_back((int)id);
+ ImGui::SetDragDropPayload("MULTISELECT_DEMO_ITEMS", payload_items.Data, (size_t)payload_items.size_in_bytes());
+ }
+
+ // Display payload content in tooltip
+ const ImGuiPayload* payload = ImGui::GetDragDropPayload();
+ const int* payload_items = (int*)payload->Data;
+ const int payload_count = (int)payload->DataSize / (int)sizeof(int);
+ if (payload_count == 1)
+ ImGui::Text("Object %05d: %s", payload_items[0], ExampleNames[payload_items[0] % IM_ARRAYSIZE(ExampleNames)]);
+ else
+ ImGui::Text("Dragging %d objects", payload_count);
+
+ ImGui::EndDragDropSource();
+ }
+
+ if (widget_type == WidgetType_TreeNode && item_is_open)
+ ImGui::TreePop();
+
+ // Right-click: context menu
+ if (ImGui::BeginPopupContextItem())
+ {
+ ImGui::BeginDisabled(!use_deletion || selection.Size == 0);
+ sprintf(label, "Delete %d item(s)###DeleteSelected", selection.Size);
+ if (ImGui::Selectable(label))
+ request_deletion_from_menu = true;
+ ImGui::EndDisabled();
+ ImGui::Selectable("Close");
+ ImGui::EndPopup();
+ }
+
+ // Demo content within a table
+ if (show_in_table)
+ {
+ ImGui::TableNextColumn();
+ ImGui::SetNextItemWidth(-FLT_MIN);
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
+ ImGui::InputText("###NoLabel", (char*)(void*)item_category, strlen(item_category), ImGuiInputTextFlags_ReadOnly);
+ ImGui::PopStyleVar();
+ }
+
+ ImGui::PopID();
}
- return 0;
+ if (!use_clipper)
+ break;
}
- // Note: Because ImGui:: is a namespace you would typically add your own function into the namespace.
- // For example, you code may declare a function 'ImGui::InputText(const char* label, MyString* my_str)'
- static bool MyInputTextMultiline(const char* label, ImVector<char>* my_str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0)
+ if (show_in_table)
{
- IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
- return ImGui::InputTextMultiline(label, my_str->begin(), (size_t)my_str->size(), size, flags | ImGuiInputTextFlags_CallbackResize, Funcs::MyResizeCallback, (void*)my_str);
+ ImGui::EndTable();
+ if (widget_type == WidgetType_TreeNode)
+ ImGui::PopStyleVar();
}
- };
- // For this demo we are using ImVector as a string container.
- // Note that because we need to store a terminating zero character, our size/capacity are 1 more
- // than usually reported by a typical string class.
- static ImVector<char> my_str;
- if (my_str.empty())
- my_str.push_back(0);
- Funcs::MyInputTextMultiline("##MyStr", &my_str, ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16));
- ImGui::Text("Data: %p\nSize: %d\nCapacity: %d", (void*)my_str.begin(), my_str.size(), my_str.capacity());
+ // Apply multi-select requests
+ ms_io = ImGui::EndMultiSelect();
+ selection.ApplyRequests(ms_io);
+ if (want_delete)
+ selection.ApplyDeletionPostLoop(ms_io, items, item_curr_idx_to_focus);
+
+ if (widget_type == WidgetType_TreeNode)
+ ImGui::PopStyleVar();
+ }
+ ImGui::EndChild();
ImGui::TreePop();
}
-
ImGui::TreePop();
}
+}
- // Tabs
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsTabs()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsTabs()
+{
IMGUI_DEMO_MARKER("Widgets/Tabs");
if (ImGui::TreeNode("Tabs"))
{
@@ -1541,6 +3382,7 @@ static void ShowDemoWindowWidgets()
ImGui::CheckboxFlags("ImGuiTabBarFlags_AutoSelectNewTabs", &tab_bar_flags, ImGuiTabBarFlags_AutoSelectNewTabs);
ImGui::CheckboxFlags("ImGuiTabBarFlags_TabListPopupButton", &tab_bar_flags, ImGuiTabBarFlags_TabListPopupButton);
ImGui::CheckboxFlags("ImGuiTabBarFlags_NoCloseWithMiddleMouseButton", &tab_bar_flags, ImGuiTabBarFlags_NoCloseWithMiddleMouseButton);
+ ImGui::CheckboxFlags("ImGuiTabBarFlags_DrawSelectedOverline", &tab_bar_flags, ImGuiTabBarFlags_DrawSelectedOverline);
if ((tab_bar_flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0)
tab_bar_flags |= ImGuiTabBarFlags_FittingPolicyDefault_;
if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyResizeDown", &tab_bar_flags, ImGuiTabBarFlags_FittingPolicyResizeDown))
@@ -1549,11 +3391,13 @@ static void ShowDemoWindowWidgets()
tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyScroll);
// Tab Bar
+ ImGui::AlignTextToFramePadding();
+ ImGui::Text("Opened:");
const char* names[4] = { "Artichoke", "Beetroot", "Celery", "Daikon" };
static bool opened[4] = { true, true, true, true }; // Persistent user state
for (int n = 0; n < IM_ARRAYSIZE(opened); n++)
{
- if (n > 0) { ImGui::SameLine(); }
+ ImGui::SameLine();
ImGui::Checkbox(names[n], &opened[n]);
}
@@ -1612,8 +3456,9 @@ static void ShowDemoWindowWidgets()
ImGui::EndPopup();
}
- // Demo Trailing Tabs: click the "+" button to add a new tab (in your app you may want to use a font icon instead of the "+")
- // Note that we submit it before the regular tabs, but because of the ImGuiTabItemFlags_Trailing flag it will always appear at the end.
+ // Demo Trailing Tabs: click the "+" button to add a new tab.
+ // (In your app you may want to use a font icon instead of the "+")
+ // We submit it before the regular tabs, but thanks to the ImGuiTabItemFlags_Trailing flag it will always appear at the end.
if (show_trailing_button)
if (ImGui::TabItemButton("+", ImGuiTabItemFlags_Trailing | ImGuiTabItemFlags_NoTooltip))
active_tabs.push_back(next_tab_id++); // Add new tab
@@ -1643,484 +3488,568 @@ static void ShowDemoWindowWidgets()
}
ImGui::TreePop();
}
+}
- // Plot/Graph widgets are not very good.
- // Consider using a third-party library such as ImPlot: https://github.com/epezent/implot
- // (see others https://github.com/ocornut/imgui/wiki/Useful-Extensions)
- IMGUI_DEMO_MARKER("Widgets/Plotting");
- if (ImGui::TreeNode("Plotting"))
- {
- static bool animate = true;
- ImGui::Checkbox("Animate", &animate);
-
- // Plot as lines and plot as histogram
- IMGUI_DEMO_MARKER("Widgets/Plotting/PlotLines, PlotHistogram");
- static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
- ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr));
- ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0, 80.0f));
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsText()
+//-----------------------------------------------------------------------------
- // Fill an array of contiguous float values to plot
- // Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float
- // and the sizeof() of your structure in the "stride" parameter.
- static float values[90] = {};
- static int values_offset = 0;
- static double refresh_time = 0.0;
- if (!animate || refresh_time == 0.0)
- refresh_time = ImGui::GetTime();
- while (refresh_time < ImGui::GetTime()) // Create data at fixed 60 Hz rate for the demo
+static void DemoWindowWidgetsText()
+{
+ IMGUI_DEMO_MARKER("Widgets/Text");
+ if (ImGui::TreeNode("Text"))
+ {
+ IMGUI_DEMO_MARKER("Widgets/Text/Colored Text");
+ if (ImGui::TreeNode("Colorful Text"))
{
- static float phase = 0.0f;
- values[values_offset] = cosf(phase);
- values_offset = (values_offset + 1) % IM_ARRAYSIZE(values);
- phase += 0.10f * values_offset;
- refresh_time += 1.0f / 60.0f;
+ // Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility.
+ ImGui::TextColored(ImVec4(1.0f, 0.0f, 1.0f, 1.0f), "Pink");
+ ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "Yellow");
+ ImGui::TextDisabled("Disabled");
+ ImGui::SameLine(); HelpMarker("The TextDisabled color is stored in ImGuiStyle.");
+ ImGui::TreePop();
}
- // Plots can display overlay texts
- // (in this example, we will display an average value)
+ IMGUI_DEMO_MARKER("Widgets/Text/Word Wrapping");
+ if (ImGui::TreeNode("Word Wrapping"))
{
- float average = 0.0f;
- for (int n = 0; n < IM_ARRAYSIZE(values); n++)
- average += values[n];
- average /= (float)IM_ARRAYSIZE(values);
- char overlay[32];
- sprintf(overlay, "avg %f", average);
- ImGui::PlotLines("Lines", values, IM_ARRAYSIZE(values), values_offset, overlay, -1.0f, 1.0f, ImVec2(0, 80.0f));
- }
+ // Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility.
+ ImGui::TextWrapped(
+ "This text should automatically wrap on the edge of the window. The current implementation "
+ "for text wrapping follows simple rules suitable for English and possibly other languages.");
+ ImGui::Spacing();
- // Use functions to generate output
- // FIXME: This is rather awkward because current plot API only pass in indices.
- // We probably want an API passing floats and user provide sample rate/count.
- struct Funcs
- {
- static float Sin(void*, int i) { return sinf(i * 0.1f); }
- static float Saw(void*, int i) { return (i & 1) ? 1.0f : -1.0f; }
- };
- static int func_type = 0, display_count = 70;
- ImGui::Separator();
- ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
- ImGui::Combo("func", &func_type, "Sin\0Saw\0");
- ImGui::SameLine();
- ImGui::SliderInt("Sample count", &display_count, 1, 400);
- float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw;
- ImGui::PlotLines("Lines", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80));
- ImGui::PlotHistogram("Histogram", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80));
- ImGui::Separator();
+ static float wrap_width = 200.0f;
+ ImGui::SliderFloat("Wrap width", &wrap_width, -20, 600, "%.0f");
- // Animate a simple progress bar
- IMGUI_DEMO_MARKER("Widgets/Plotting/ProgressBar");
- static float progress = 0.0f, progress_dir = 1.0f;
- if (animate)
- {
- progress += progress_dir * 0.4f * ImGui::GetIO().DeltaTime;
- if (progress >= +1.1f) { progress = +1.1f; progress_dir *= -1.0f; }
- if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; }
- }
+ ImDrawList* draw_list = ImGui::GetWindowDrawList();
+ for (int n = 0; n < 2; n++)
+ {
+ ImGui::Text("Test paragraph %d:", n);
+ ImVec2 pos = ImGui::GetCursorScreenPos();
+ ImVec2 marker_min = ImVec2(pos.x + wrap_width, pos.y);
+ ImVec2 marker_max = ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight());
+ ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
+ if (n == 0)
+ ImGui::Text("The lazy dog is a good dog. This paragraph should fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width);
+ else
+ ImGui::Text("aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee ffffffff. gggggggg!hhhhhhhh");
- // Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width,
- // or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth.
- ImGui::ProgressBar(progress, ImVec2(0.0f, 0.0f));
- ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
- ImGui::Text("Progress Bar");
+ // Draw actual text bounding box, following by marker of our expected limit (should not overlap!)
+ draw_list->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255, 255, 0, 255));
+ draw_list->AddRectFilled(marker_min, marker_max, IM_COL32(255, 0, 255, 255));
+ ImGui::PopTextWrapPos();
+ }
- float progress_saturated = IM_CLAMP(progress, 0.0f, 1.0f);
- char buf[32];
- sprintf(buf, "%d/%d", (int)(progress_saturated * 1753), 1753);
- ImGui::ProgressBar(progress, ImVec2(0.f, 0.f), buf);
+ ImGui::TreePop();
+ }
+
+ IMGUI_DEMO_MARKER("Widgets/Text/UTF-8 Text");
+ if (ImGui::TreeNode("UTF-8 Text"))
+ {
+ // UTF-8 test with Japanese characters
+ // (Needs a suitable font? Try "Google Noto" or "Arial Unicode". See docs/FONTS.md for details.)
+ // - From C++11 you can use the u8"my text" syntax to encode literal strings as UTF-8
+ // - For earlier compiler, you may be able to encode your sources as UTF-8 (e.g. in Visual Studio, you
+ // can save your source files as 'UTF-8 without signature').
+ // - FOR THIS DEMO FILE ONLY, BECAUSE WE WANT TO SUPPORT OLD COMPILERS, WE ARE *NOT* INCLUDING RAW UTF-8
+ // CHARACTERS IN THIS SOURCE FILE. Instead we are encoding a few strings with hexadecimal constants.
+ // Don't do this in your application! Please use u8"text in any language" in your application!
+ // Note that characters values are preserved even by InputText() if the font cannot be displayed,
+ // so you can safely copy & paste garbled characters into another application.
+ ImGui::TextWrapped(
+ "CJK text will only appear if the font was loaded with the appropriate CJK character ranges. "
+ "Call io.Fonts->AddFontFromFileTTF() manually to load extra character ranges. "
+ "Read docs/FONTS.md for details.");
+ ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)");
+ ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
+ static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
+ //static char buf[32] = u8"NIHONGO"; // <- this is how you would write it with C++11, using real kanjis
+ ImGui::InputText("UTF-8 input", buf, IM_ARRAYSIZE(buf));
+ ImGui::TreePop();
+ }
ImGui::TreePop();
}
+}
- IMGUI_DEMO_MARKER("Widgets/Color");
- if (ImGui::TreeNode("Color/Picker Widgets"))
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsTextFilter()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsTextFilter()
+{
+ IMGUI_DEMO_MARKER("Widgets/Text Filter");
+ if (ImGui::TreeNode("Text Filter"))
{
- static ImVec4 color = ImVec4(114.0f / 255.0f, 144.0f / 255.0f, 154.0f / 255.0f, 200.0f / 255.0f);
+ // Helper class to easy setup a text filter.
+ // You may want to implement a more feature-full filtering scheme in your own application.
+ HelpMarker("Not a widget per-se, but ImGuiTextFilter is a helper to perform simple filtering on text strings.");
+ static ImGuiTextFilter filter;
+ ImGui::Text("Filter usage:\n"
+ " \"\" display all lines\n"
+ " \"xxx\" display lines containing \"xxx\"\n"
+ " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
+ " \"-xxx\" hide lines containing \"xxx\"");
+ filter.Draw();
+ const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
+ for (int i = 0; i < IM_ARRAYSIZE(lines); i++)
+ if (filter.PassFilter(lines[i]))
+ ImGui::BulletText("%s", lines[i]);
+ ImGui::TreePop();
+ }
+}
- static bool alpha_preview = true;
- static bool alpha_half_preview = false;
- static bool drag_and_drop = true;
- static bool options_menu = true;
- static bool hdr = false;
- ImGui::Checkbox("With Alpha Preview", &alpha_preview);
- ImGui::Checkbox("With Half Alpha Preview", &alpha_half_preview);
- ImGui::Checkbox("With Drag and Drop", &drag_and_drop);
- ImGui::Checkbox("With Options Menu", &options_menu); ImGui::SameLine(); HelpMarker("Right-click on the individual color widget to show options.");
- ImGui::Checkbox("With HDR", &hdr); ImGui::SameLine(); HelpMarker("Currently all this does is to lift the 0..1 limits on dragging widgets.");
- ImGuiColorEditFlags misc_flags = (hdr ? ImGuiColorEditFlags_HDR : 0) | (drag_and_drop ? 0 : ImGuiColorEditFlags_NoDragDrop) | (alpha_half_preview ? ImGuiColorEditFlags_AlphaPreviewHalf : (alpha_preview ? ImGuiColorEditFlags_AlphaPreview : 0)) | (options_menu ? 0 : ImGuiColorEditFlags_NoOptions);
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsTextInput()
+//-----------------------------------------------------------------------------
- IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit");
- ImGui::Text("Color widget:");
- ImGui::SameLine(); HelpMarker(
- "Click on the color square to open a color picker.\n"
- "CTRL+click on individual component to input value.\n");
- ImGui::ColorEdit3("MyColor##1", (float*)&color, misc_flags);
+static void DemoWindowWidgetsTextInput()
+{
+ // To wire InputText() with std::string or any other custom string type,
+ // see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file.
+ IMGUI_DEMO_MARKER("Widgets/Text Input");
+ if (ImGui::TreeNode("Text Input"))
+ {
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Multi-line Text Input");
+ if (ImGui::TreeNode("Multi-line Text Input"))
+ {
+ // Note: we are using a fixed-sized buffer for simplicity here. See ImGuiInputTextFlags_CallbackResize
+ // and the code in misc/cpp/imgui_stdlib.h for how to setup InputText() for dynamically resizing strings.
+ static char text[1024 * 16] =
+ "/*\n"
+ " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n"
+ " the hexadecimal encoding of one offending instruction,\n"
+ " more formally, the invalid operand with locked CMPXCHG8B\n"
+ " instruction bug, is a design flaw in the majority of\n"
+ " Intel Pentium, Pentium MMX, and Pentium OverDrive\n"
+ " processors (all in the P5 microarchitecture).\n"
+ "*/\n\n"
+ "label:\n"
+ "\tlock cmpxchg8b eax\n";
- IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit (HSV, with Alpha)");
- ImGui::Text("Color widget HSV with Alpha:");
- ImGui::ColorEdit4("MyColor##2", (float*)&color, ImGuiColorEditFlags_DisplayHSV | misc_flags);
+ static ImGuiInputTextFlags flags = ImGuiInputTextFlags_AllowTabInput;
+ HelpMarker("You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputTextMultiline() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example. (This is not demonstrated in imgui_demo.cpp because we don't want to include <string> in here)");
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_ReadOnly", &flags, ImGuiInputTextFlags_ReadOnly);
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_AllowTabInput", &flags, ImGuiInputTextFlags_AllowTabInput);
+ ImGui::SameLine(); HelpMarker("When _AllowTabInput is set, passing through the widget with Tabbing doesn't automatically activate it, in order to also cycling through subsequent widgets.");
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_CtrlEnterForNewLine", &flags, ImGuiInputTextFlags_CtrlEnterForNewLine);
+ ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16), flags);
+ ImGui::TreePop();
+ }
- IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit (float display)");
- ImGui::Text("Color widget with Float Display:");
- ImGui::ColorEdit4("MyColor##2f", (float*)&color, ImGuiColorEditFlags_Float | misc_flags);
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Filtered Text Input");
+ if (ImGui::TreeNode("Filtered Text Input"))
+ {
+ struct TextFilters
+ {
+ // Modify character input by altering 'data->Eventchar' (ImGuiInputTextFlags_CallbackCharFilter callback)
+ static int FilterCasingSwap(ImGuiInputTextCallbackData* data)
+ {
+ if (data->EventChar >= 'a' && data->EventChar <= 'z') { data->EventChar -= 'a' - 'A'; } // Lowercase becomes uppercase
+ else if (data->EventChar >= 'A' && data->EventChar <= 'Z') { data->EventChar += 'a' - 'A'; } // Uppercase becomes lowercase
+ return 0;
+ }
- IMGUI_DEMO_MARKER("Widgets/Color/ColorButton (with Picker)");
- ImGui::Text("Color button with Picker:");
- ImGui::SameLine(); HelpMarker(
- "With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\n"
- "With the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only "
- "be used for the tooltip and picker popup.");
- ImGui::ColorEdit4("MyColor##3", (float*)&color, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | misc_flags);
+ // Return 0 (pass) if the character is 'i' or 'm' or 'g' or 'u' or 'i', otherwise return 1 (filter out)
+ static int FilterImGuiLetters(ImGuiInputTextCallbackData* data)
+ {
+ if (data->EventChar < 256 && strchr("imgui", (char)data->EventChar))
+ return 0;
+ return 1;
+ }
+ };
- IMGUI_DEMO_MARKER("Widgets/Color/ColorButton (with custom Picker popup)");
- ImGui::Text("Color button with Custom Picker Popup:");
+ static char buf1[32] = ""; ImGui::InputText("default", buf1, 32);
+ static char buf2[32] = ""; ImGui::InputText("decimal", buf2, 32, ImGuiInputTextFlags_CharsDecimal);
+ static char buf3[32] = ""; ImGui::InputText("hexadecimal", buf3, 32, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase);
+ static char buf4[32] = ""; ImGui::InputText("uppercase", buf4, 32, ImGuiInputTextFlags_CharsUppercase);
+ static char buf5[32] = ""; ImGui::InputText("no blank", buf5, 32, ImGuiInputTextFlags_CharsNoBlank);
+ static char buf6[32] = ""; ImGui::InputText("casing swap", buf6, 32, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterCasingSwap); // Use CharFilter callback to replace characters.
+ static char buf7[32] = ""; ImGui::InputText("\"imgui\"", buf7, 32, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterImGuiLetters); // Use CharFilter callback to disable some characters.
+ ImGui::TreePop();
+ }
- // Generate a default palette. The palette will persist and can be edited.
- static bool saved_palette_init = true;
- static ImVec4 saved_palette[32] = {};
- if (saved_palette_init)
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Password input");
+ if (ImGui::TreeNode("Password Input"))
{
- for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++)
- {
- ImGui::ColorConvertHSVtoRGB(n / 31.0f, 0.8f, 0.8f,
- saved_palette[n].x, saved_palette[n].y, saved_palette[n].z);
- saved_palette[n].w = 1.0f; // Alpha
- }
- saved_palette_init = false;
+ static char password[64] = "password123";
+ ImGui::InputText("password", password, IM_ARRAYSIZE(password), ImGuiInputTextFlags_Password);
+ ImGui::SameLine(); HelpMarker("Display all characters as '*'.\nDisable clipboard cut and copy.\nDisable logging.\n");
+ ImGui::InputTextWithHint("password (w/ hint)", "<password>", password, IM_ARRAYSIZE(password), ImGuiInputTextFlags_Password);
+ ImGui::InputText("password (clear)", password, IM_ARRAYSIZE(password));
+ ImGui::TreePop();
}
- static ImVec4 backup_color;
- bool open_popup = ImGui::ColorButton("MyColor##3b", color, misc_flags);
- ImGui::SameLine(0, ImGui::GetStyle().ItemInnerSpacing.x);
- open_popup |= ImGui::Button("Palette");
- if (open_popup)
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Completion, History, Edit Callbacks");
+ if (ImGui::TreeNode("Completion, History, Edit Callbacks"))
{
- ImGui::OpenPopup("mypicker");
- backup_color = color;
+ struct Funcs
+ {
+ static int MyCallback(ImGuiInputTextCallbackData* data)
+ {
+ if (data->EventFlag == ImGuiInputTextFlags_CallbackCompletion)
+ {
+ data->InsertChars(data->CursorPos, "..");
+ }
+ else if (data->EventFlag == ImGuiInputTextFlags_CallbackHistory)
+ {
+ if (data->EventKey == ImGuiKey_UpArrow)
+ {
+ data->DeleteChars(0, data->BufTextLen);
+ data->InsertChars(0, "Pressed Up!");
+ data->SelectAll();
+ }
+ else if (data->EventKey == ImGuiKey_DownArrow)
+ {
+ data->DeleteChars(0, data->BufTextLen);
+ data->InsertChars(0, "Pressed Down!");
+ data->SelectAll();
+ }
+ }
+ else if (data->EventFlag == ImGuiInputTextFlags_CallbackEdit)
+ {
+ // Toggle casing of first character
+ char c = data->Buf[0];
+ if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) data->Buf[0] ^= 32;
+ data->BufDirty = true;
+
+ // Increment a counter
+ int* p_int = (int*)data->UserData;
+ *p_int = *p_int + 1;
+ }
+ return 0;
+ }
+ };
+ static char buf1[64];
+ ImGui::InputText("Completion", buf1, 64, ImGuiInputTextFlags_CallbackCompletion, Funcs::MyCallback);
+ ImGui::SameLine(); HelpMarker(
+ "Here we append \"..\" each time Tab is pressed. "
+ "See 'Examples>Console' for a more meaningful demonstration of using this callback.");
+
+ static char buf2[64];
+ ImGui::InputText("History", buf2, 64, ImGuiInputTextFlags_CallbackHistory, Funcs::MyCallback);
+ ImGui::SameLine(); HelpMarker(
+ "Here we replace and select text each time Up/Down are pressed. "
+ "See 'Examples>Console' for a more meaningful demonstration of using this callback.");
+
+ static char buf3[64];
+ static int edit_count = 0;
+ ImGui::InputText("Edit", buf3, 64, ImGuiInputTextFlags_CallbackEdit, Funcs::MyCallback, (void*)&edit_count);
+ ImGui::SameLine(); HelpMarker(
+ "Here we toggle the casing of the first character on every edit + count edits.");
+ ImGui::SameLine(); ImGui::Text("(%d)", edit_count);
+
+ ImGui::TreePop();
}
- if (ImGui::BeginPopup("mypicker"))
- {
- ImGui::Text("MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!");
- ImGui::Separator();
- ImGui::ColorPicker4("##picker", (float*)&color, misc_flags | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoSmallPreview);
- ImGui::SameLine();
- ImGui::BeginGroup(); // Lock X position
- ImGui::Text("Current");
- ImGui::ColorButton("##current", color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60, 40));
- ImGui::Text("Previous");
- if (ImGui::ColorButton("##previous", backup_color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60, 40)))
- color = backup_color;
- ImGui::Separator();
- ImGui::Text("Palette");
- for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++)
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Resize Callback");
+ if (ImGui::TreeNode("Resize Callback"))
+ {
+ // To wire InputText() with std::string or any other custom string type,
+ // you can use the ImGuiInputTextFlags_CallbackResize flag + create a custom ImGui::InputText() wrapper
+ // using your preferred type. See misc/cpp/imgui_stdlib.h for an implementation of this using std::string.
+ HelpMarker(
+ "Using ImGuiInputTextFlags_CallbackResize to wire your custom string type to InputText().\n\n"
+ "See misc/cpp/imgui_stdlib.h for an implementation of this for std::string.");
+ struct Funcs
{
- ImGui::PushID(n);
- if ((n % 8) != 0)
- ImGui::SameLine(0.0f, ImGui::GetStyle().ItemSpacing.y);
-
- ImGuiColorEditFlags palette_button_flags = ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoTooltip;
- if (ImGui::ColorButton("##palette", saved_palette[n], palette_button_flags, ImVec2(20, 20)))
- color = ImVec4(saved_palette[n].x, saved_palette[n].y, saved_palette[n].z, color.w); // Preserve alpha!
+ static int MyResizeCallback(ImGuiInputTextCallbackData* data)
+ {
+ if (data->EventFlag == ImGuiInputTextFlags_CallbackResize)
+ {
+ ImVector<char>* my_str = (ImVector<char>*)data->UserData;
+ IM_ASSERT(my_str->begin() == data->Buf);
+ my_str->resize(data->BufSize); // NB: On resizing calls, generally data->BufSize == data->BufTextLen + 1
+ data->Buf = my_str->begin();
+ }
+ return 0;
+ }
- // Allow user to drop colors into each palette entry. Note that ColorButton() is already a
- // drag source by default, unless specifying the ImGuiColorEditFlags_NoDragDrop flag.
- if (ImGui::BeginDragDropTarget())
+ // Note: Because ImGui:: is a namespace you would typically add your own function into the namespace.
+ // For example, you code may declare a function 'ImGui::InputText(const char* label, MyString* my_str)'
+ static bool MyInputTextMultiline(const char* label, ImVector<char>* my_str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0)
{
- if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F))
- memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 3);
- if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F))
- memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 4);
- ImGui::EndDragDropTarget();
+ IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
+ return ImGui::InputTextMultiline(label, my_str->begin(), (size_t)my_str->size(), size, flags | ImGuiInputTextFlags_CallbackResize, Funcs::MyResizeCallback, (void*)my_str);
}
+ };
- ImGui::PopID();
- }
- ImGui::EndGroup();
- ImGui::EndPopup();
+ // For this demo we are using ImVector as a string container.
+ // Note that because we need to store a terminating zero character, our size/capacity are 1 more
+ // than usually reported by a typical string class.
+ static ImVector<char> my_str;
+ if (my_str.empty())
+ my_str.push_back(0);
+ Funcs::MyInputTextMultiline("##MyStr", &my_str, ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16));
+ ImGui::Text("Data: %p\nSize: %d\nCapacity: %d", (void*)my_str.begin(), my_str.size(), my_str.capacity());
+ ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Widgets/Color/ColorButton (simple)");
- ImGui::Text("Color button only:");
- static bool no_border = false;
- ImGui::Checkbox("ImGuiColorEditFlags_NoBorder", &no_border);
- ImGui::ColorButton("MyColor##3c", *(ImVec4*)&color, misc_flags | (no_border ? ImGuiColorEditFlags_NoBorder : 0), ImVec2(80, 80));
-
- IMGUI_DEMO_MARKER("Widgets/Color/ColorPicker");
- ImGui::Text("Color picker:");
- static bool alpha = true;
- static bool alpha_bar = true;
- static bool side_preview = true;
- static bool ref_color = false;
- static ImVec4 ref_color_v(1.0f, 0.0f, 1.0f, 0.5f);
- static int display_mode = 0;
- static int picker_mode = 0;
- ImGui::Checkbox("With Alpha", &alpha);
- ImGui::Checkbox("With Alpha Bar", &alpha_bar);
- ImGui::Checkbox("With Side Preview", &side_preview);
- if (side_preview)
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Eliding, Alignment");
+ if (ImGui::TreeNode("Eliding, Alignment"))
{
- ImGui::SameLine();
- ImGui::Checkbox("With Ref Color", &ref_color);
- if (ref_color)
- {
- ImGui::SameLine();
- ImGui::ColorEdit4("##RefColor", &ref_color_v.x, ImGuiColorEditFlags_NoInputs | misc_flags);
- }
+ static char buf1[128] = "/path/to/some/folder/with/long/filename.cpp";
+ static ImGuiInputTextFlags flags = ImGuiInputTextFlags_ElideLeft;
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_ElideLeft", &flags, ImGuiInputTextFlags_ElideLeft);
+ ImGui::InputText("Path", buf1, IM_ARRAYSIZE(buf1), flags);
+ ImGui::TreePop();
}
- ImGui::Combo("Display Mode", &display_mode, "Auto/Current\0None\0RGB Only\0HSV Only\0Hex Only\0");
- ImGui::SameLine(); HelpMarker(
- "ColorEdit defaults to displaying RGB inputs if you don't specify a display mode, "
- "but the user can change it with a right-click on those inputs.\n\nColorPicker defaults to displaying RGB+HSV+Hex "
- "if you don't specify a display mode.\n\nYou can change the defaults using SetColorEditOptions().");
- ImGui::SameLine(); HelpMarker("When not specified explicitly (Auto/Current mode), user can right-click the picker to change mode.");
- ImGuiColorEditFlags flags = misc_flags;
- if (!alpha) flags |= ImGuiColorEditFlags_NoAlpha; // This is by default if you call ColorPicker3() instead of ColorPicker4()
- if (alpha_bar) flags |= ImGuiColorEditFlags_AlphaBar;
- if (!side_preview) flags |= ImGuiColorEditFlags_NoSidePreview;
- if (picker_mode == 1) flags |= ImGuiColorEditFlags_PickerHueBar;
- if (picker_mode == 2) flags |= ImGuiColorEditFlags_PickerHueWheel;
- if (display_mode == 1) flags |= ImGuiColorEditFlags_NoInputs; // Disable all RGB/HSV/Hex displays
- if (display_mode == 2) flags |= ImGuiColorEditFlags_DisplayRGB; // Override display mode
- if (display_mode == 3) flags |= ImGuiColorEditFlags_DisplayHSV;
- if (display_mode == 4) flags |= ImGuiColorEditFlags_DisplayHex;
- ImGui::ColorPicker4("MyColor##4", (float*)&color, flags, ref_color ? &ref_color_v.x : NULL);
- ImGui::Text("Set defaults in code:");
- ImGui::SameLine(); HelpMarker(
- "SetColorEditOptions() is designed to allow you to set boot-time default.\n"
- "We don't have Push/Pop functions because you can force options on a per-widget basis if needed,"
- "and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid"
- "encouraging you to persistently save values that aren't forward-compatible.");
- if (ImGui::Button("Default: Uint8 + HSV + Hue Bar"))
- ImGui::SetColorEditOptions(ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_PickerHueBar);
- if (ImGui::Button("Default: Float + HDR + Hue Wheel"))
- ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel);
-
- // Always both a small version of both types of pickers (to make it more visible in the demo to people who are skimming quickly through it)
- ImGui::Text("Both types:");
- float w = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.y) * 0.40f;
- ImGui::SetNextItemWidth(w);
- ImGui::ColorPicker3("##MyColor##5", (float*)&color, ImGuiColorEditFlags_PickerHueBar | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoAlpha);
- ImGui::SameLine();
- ImGui::SetNextItemWidth(w);
- ImGui::ColorPicker3("##MyColor##6", (float*)&color, ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoAlpha);
-
- // HSV encoded support (to avoid RGB<>HSV round trips and singularities when S==0 or V==0)
- static ImVec4 color_hsv(0.23f, 1.0f, 1.0f, 1.0f); // Stored as HSV!
- ImGui::Spacing();
- ImGui::Text("HSV encoded colors");
- ImGui::SameLine(); HelpMarker(
- "By default, colors are given to ColorEdit and ColorPicker in RGB, but ImGuiColorEditFlags_InputHSV"
- "allows you to store colors as HSV and pass them to ColorEdit and ColorPicker as HSV. This comes with the"
- "added benefit that you can manipulate hue values with the picker even when saturation or value are zero.");
- ImGui::Text("Color widget with InputHSV:");
- ImGui::ColorEdit4("HSV shown as RGB##1", (float*)&color_hsv, ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputHSV | ImGuiColorEditFlags_Float);
- ImGui::ColorEdit4("HSV shown as HSV##1", (float*)&color_hsv, ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_InputHSV | ImGuiColorEditFlags_Float);
- ImGui::DragFloat4("Raw HSV values", (float*)&color_hsv, 0.01f, 0.0f, 1.0f);
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Miscellaneous");
+ if (ImGui::TreeNode("Miscellaneous"))
+ {
+ static char buf1[16];
+ static ImGuiInputTextFlags flags = ImGuiInputTextFlags_EscapeClearsAll;
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_EscapeClearsAll", &flags, ImGuiInputTextFlags_EscapeClearsAll);
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_ReadOnly", &flags, ImGuiInputTextFlags_ReadOnly);
+ ImGui::CheckboxFlags("ImGuiInputTextFlags_NoUndoRedo", &flags, ImGuiInputTextFlags_NoUndoRedo);
+ ImGui::InputText("Hello", buf1, IM_ARRAYSIZE(buf1), flags);
+ ImGui::TreePop();
+ }
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Widgets/Drag and Slider Flags");
- if (ImGui::TreeNode("Drag/Slider Flags"))
- {
- // Demonstrate using advanced flags for DragXXX and SliderXXX functions. Note that the flags are the same!
- static ImGuiSliderFlags flags = ImGuiSliderFlags_None;
- ImGui::CheckboxFlags("ImGuiSliderFlags_AlwaysClamp", &flags, ImGuiSliderFlags_AlwaysClamp);
- ImGui::SameLine(); HelpMarker("Always clamp value to min/max bounds (if any) when input manually with CTRL+Click.");
- ImGui::CheckboxFlags("ImGuiSliderFlags_Logarithmic", &flags, ImGuiSliderFlags_Logarithmic);
- ImGui::SameLine(); HelpMarker("Enable logarithmic editing (more precision for small values).");
- ImGui::CheckboxFlags("ImGuiSliderFlags_NoRoundToFormat", &flags, ImGuiSliderFlags_NoRoundToFormat);
- ImGui::SameLine(); HelpMarker("Disable rounding underlying value to match precision of the format string (e.g. %.3f values are rounded to those 3 digits).");
- ImGui::CheckboxFlags("ImGuiSliderFlags_NoInput", &flags, ImGuiSliderFlags_NoInput);
- ImGui::SameLine(); HelpMarker("Disable CTRL+Click or Enter key allowing to input text directly into the widget.");
+}
- // Drags
- static float drag_f = 0.5f;
- static int drag_i = 50;
- ImGui::Text("Underlying float value: %f", drag_f);
- ImGui::DragFloat("DragFloat (0 -> 1)", &drag_f, 0.005f, 0.0f, 1.0f, "%.3f", flags);
- ImGui::DragFloat("DragFloat (0 -> +inf)", &drag_f, 0.005f, 0.0f, FLT_MAX, "%.3f", flags);
- ImGui::DragFloat("DragFloat (-inf -> 1)", &drag_f, 0.005f, -FLT_MAX, 1.0f, "%.3f", flags);
- ImGui::DragFloat("DragFloat (-inf -> +inf)", &drag_f, 0.005f, -FLT_MAX, +FLT_MAX, "%.3f", flags);
- ImGui::DragInt("DragInt (0 -> 100)", &drag_i, 0.5f, 0, 100, "%d", flags);
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsTooltips()
+//-----------------------------------------------------------------------------
- // Sliders
- static float slider_f = 0.5f;
- static int slider_i = 50;
- ImGui::Text("Underlying float value: %f", slider_f);
- ImGui::SliderFloat("SliderFloat (0 -> 1)", &slider_f, 0.0f, 1.0f, "%.3f", flags);
- ImGui::SliderInt("SliderInt (0 -> 100)", &slider_i, 0, 100, "%d", flags);
+static void DemoWindowWidgetsTooltips()
+{
+ IMGUI_DEMO_MARKER("Widgets/Tooltips");
+ if (ImGui::TreeNode("Tooltips"))
+ {
+ // Tooltips are windows following the mouse. They do not take focus away.
+ ImGui::SeparatorText("General");
- ImGui::TreePop();
- }
+ // Typical use cases:
+ // - Short-form (text only): SetItemTooltip("Hello");
+ // - Short-form (any contents): if (BeginItemTooltip()) { Text("Hello"); EndTooltip(); }
- IMGUI_DEMO_MARKER("Widgets/Range Widgets");
- if (ImGui::TreeNode("Range Widgets"))
- {
- static float begin = 10, end = 90;
- static int begin_i = 100, end_i = 1000;
- ImGui::DragFloatRange2("range float", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%", ImGuiSliderFlags_AlwaysClamp);
- ImGui::DragIntRange2("range int", &begin_i, &end_i, 5, 0, 1000, "Min: %d units", "Max: %d units");
- ImGui::DragIntRange2("range int (no bounds)", &begin_i, &end_i, 5, 0, 0, "Min: %d units", "Max: %d units");
- ImGui::TreePop();
- }
+ // - Full-form (text only): if (IsItemHovered(...)) { SetTooltip("Hello"); }
+ // - Full-form (any contents): if (IsItemHovered(...) && BeginTooltip()) { Text("Hello"); EndTooltip(); }
- IMGUI_DEMO_MARKER("Widgets/Data Types");
- if (ImGui::TreeNode("Data Types"))
- {
- // DragScalar/InputScalar/SliderScalar functions allow various data types
- // - signed/unsigned
- // - 8/16/32/64-bits
- // - integer/float/double
- // To avoid polluting the public API with all possible combinations, we use the ImGuiDataType enum
- // to pass the type, and passing all arguments by pointer.
- // This is the reason the test code below creates local variables to hold "zero" "one" etc. for each type.
- // In practice, if you frequently use a given type that is not covered by the normal API entry points,
- // you can wrap it yourself inside a 1 line function which can take typed argument as value instead of void*,
- // and then pass their address to the generic function. For example:
- // bool MySliderU64(const char *label, u64* value, u64 min = 0, u64 max = 0, const char* format = "%lld")
- // {
- // return SliderScalar(label, ImGuiDataType_U64, value, &min, &max, format);
- // }
+ HelpMarker(
+ "Tooltip are typically created by using a IsItemHovered() + SetTooltip() sequence.\n\n"
+ "We provide a helper SetItemTooltip() function to perform the two with standards flags.");
- // Setup limits (as helper variables so we can take their address, as explained above)
- // Note: SliderScalar() functions have a maximum usable range of half the natural type maximum, hence the /2.
- #ifndef LLONG_MIN
- ImS64 LLONG_MIN = -9223372036854775807LL - 1;
- ImS64 LLONG_MAX = 9223372036854775807LL;
- ImU64 ULLONG_MAX = (2ULL * 9223372036854775807LL + 1);
- #endif
- const char s8_zero = 0, s8_one = 1, s8_fifty = 50, s8_min = -128, s8_max = 127;
- const ImU8 u8_zero = 0, u8_one = 1, u8_fifty = 50, u8_min = 0, u8_max = 255;
- const short s16_zero = 0, s16_one = 1, s16_fifty = 50, s16_min = -32768, s16_max = 32767;
- const ImU16 u16_zero = 0, u16_one = 1, u16_fifty = 50, u16_min = 0, u16_max = 65535;
- const ImS32 s32_zero = 0, s32_one = 1, s32_fifty = 50, s32_min = INT_MIN/2, s32_max = INT_MAX/2, s32_hi_a = INT_MAX/2 - 100, s32_hi_b = INT_MAX/2;
- const ImU32 u32_zero = 0, u32_one = 1, u32_fifty = 50, u32_min = 0, u32_max = UINT_MAX/2, u32_hi_a = UINT_MAX/2 - 100, u32_hi_b = UINT_MAX/2;
- const ImS64 s64_zero = 0, s64_one = 1, s64_fifty = 50, s64_min = LLONG_MIN/2, s64_max = LLONG_MAX/2, s64_hi_a = LLONG_MAX/2 - 100, s64_hi_b = LLONG_MAX/2;
- const ImU64 u64_zero = 0, u64_one = 1, u64_fifty = 50, u64_min = 0, u64_max = ULLONG_MAX/2, u64_hi_a = ULLONG_MAX/2 - 100, u64_hi_b = ULLONG_MAX/2;
- const float f32_zero = 0.f, f32_one = 1.f, f32_lo_a = -10000000000.0f, f32_hi_a = +10000000000.0f;
- const double f64_zero = 0., f64_one = 1., f64_lo_a = -1000000000000000.0, f64_hi_a = +1000000000000000.0;
+ ImVec2 sz = ImVec2(-FLT_MIN, 0.0f);
- // State
- static char s8_v = 127;
- static ImU8 u8_v = 255;
- static short s16_v = 32767;
- static ImU16 u16_v = 65535;
- static ImS32 s32_v = -1;
- static ImU32 u32_v = (ImU32)-1;
- static ImS64 s64_v = -1;
- static ImU64 u64_v = (ImU64)-1;
- static float f32_v = 0.123f;
- static double f64_v = 90000.01234567890123456789;
+ ImGui::Button("Basic", sz);
+ ImGui::SetItemTooltip("I am a tooltip");
- const float drag_speed = 0.2f;
- static bool drag_clamp = false;
- IMGUI_DEMO_MARKER("Widgets/Data Types/Drags");
- ImGui::Text("Drags:");
- ImGui::Checkbox("Clamp integers to 0..50", &drag_clamp);
- ImGui::SameLine(); HelpMarker(
- "As with every widget in dear imgui, we never modify values unless there is a user interaction.\n"
- "You can override the clamping limits by using CTRL+Click to input a value.");
- ImGui::DragScalar("drag s8", ImGuiDataType_S8, &s8_v, drag_speed, drag_clamp ? &s8_zero : NULL, drag_clamp ? &s8_fifty : NULL);
- ImGui::DragScalar("drag u8", ImGuiDataType_U8, &u8_v, drag_speed, drag_clamp ? &u8_zero : NULL, drag_clamp ? &u8_fifty : NULL, "%u ms");
- ImGui::DragScalar("drag s16", ImGuiDataType_S16, &s16_v, drag_speed, drag_clamp ? &s16_zero : NULL, drag_clamp ? &s16_fifty : NULL);
- ImGui::DragScalar("drag u16", ImGuiDataType_U16, &u16_v, drag_speed, drag_clamp ? &u16_zero : NULL, drag_clamp ? &u16_fifty : NULL, "%u ms");
- ImGui::DragScalar("drag s32", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL);
- ImGui::DragScalar("drag s32 hex", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL, "0x%08X");
- ImGui::DragScalar("drag u32", ImGuiDataType_U32, &u32_v, drag_speed, drag_clamp ? &u32_zero : NULL, drag_clamp ? &u32_fifty : NULL, "%u ms");
- ImGui::DragScalar("drag s64", ImGuiDataType_S64, &s64_v, drag_speed, drag_clamp ? &s64_zero : NULL, drag_clamp ? &s64_fifty : NULL);
- ImGui::DragScalar("drag u64", ImGuiDataType_U64, &u64_v, drag_speed, drag_clamp ? &u64_zero : NULL, drag_clamp ? &u64_fifty : NULL);
- ImGui::DragScalar("drag float", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f");
- ImGui::DragScalar("drag float log", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", ImGuiSliderFlags_Logarithmic);
- ImGui::DragScalar("drag double", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, NULL, "%.10f grams");
- ImGui::DragScalar("drag double log",ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, &f64_one, "0 < %.10f < 1", ImGuiSliderFlags_Logarithmic);
+ ImGui::Button("Fancy", sz);
+ if (ImGui::BeginItemTooltip())
+ {
+ ImGui::Text("I am a fancy tooltip");
+ static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
+ ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr));
+ ImGui::Text("Sin(time) = %f", sinf((float)ImGui::GetTime()));
+ ImGui::EndTooltip();
+ }
- IMGUI_DEMO_MARKER("Widgets/Data Types/Sliders");
- ImGui::Text("Sliders");
- ImGui::SliderScalar("slider s8 full", ImGuiDataType_S8, &s8_v, &s8_min, &s8_max, "%d");
- ImGui::SliderScalar("slider u8 full", ImGuiDataType_U8, &u8_v, &u8_min, &u8_max, "%u");
- ImGui::SliderScalar("slider s16 full", ImGuiDataType_S16, &s16_v, &s16_min, &s16_max, "%d");
- ImGui::SliderScalar("slider u16 full", ImGuiDataType_U16, &u16_v, &u16_min, &u16_max, "%u");
- ImGui::SliderScalar("slider s32 low", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty,"%d");
- ImGui::SliderScalar("slider s32 high", ImGuiDataType_S32, &s32_v, &s32_hi_a, &s32_hi_b, "%d");
- ImGui::SliderScalar("slider s32 full", ImGuiDataType_S32, &s32_v, &s32_min, &s32_max, "%d");
- ImGui::SliderScalar("slider s32 hex", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty, "0x%04X");
- ImGui::SliderScalar("slider u32 low", ImGuiDataType_U32, &u32_v, &u32_zero, &u32_fifty,"%u");
- ImGui::SliderScalar("slider u32 high", ImGuiDataType_U32, &u32_v, &u32_hi_a, &u32_hi_b, "%u");
- ImGui::SliderScalar("slider u32 full", ImGuiDataType_U32, &u32_v, &u32_min, &u32_max, "%u");
- ImGui::SliderScalar("slider s64 low", ImGuiDataType_S64, &s64_v, &s64_zero, &s64_fifty,"%" IM_PRId64);
- ImGui::SliderScalar("slider s64 high", ImGuiDataType_S64, &s64_v, &s64_hi_a, &s64_hi_b, "%" IM_PRId64);
- ImGui::SliderScalar("slider s64 full", ImGuiDataType_S64, &s64_v, &s64_min, &s64_max, "%" IM_PRId64);
- ImGui::SliderScalar("slider u64 low", ImGuiDataType_U64, &u64_v, &u64_zero, &u64_fifty,"%" IM_PRIu64 " ms");
- ImGui::SliderScalar("slider u64 high", ImGuiDataType_U64, &u64_v, &u64_hi_a, &u64_hi_b, "%" IM_PRIu64 " ms");
- ImGui::SliderScalar("slider u64 full", ImGuiDataType_U64, &u64_v, &u64_min, &u64_max, "%" IM_PRIu64 " ms");
- ImGui::SliderScalar("slider float low", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one);
- ImGui::SliderScalar("slider float low log", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one, "%.10f", ImGuiSliderFlags_Logarithmic);
- ImGui::SliderScalar("slider float high", ImGuiDataType_Float, &f32_v, &f32_lo_a, &f32_hi_a, "%e");
- ImGui::SliderScalar("slider double low", ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f grams");
- ImGui::SliderScalar("slider double low log",ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f", ImGuiSliderFlags_Logarithmic);
- ImGui::SliderScalar("slider double high", ImGuiDataType_Double, &f64_v, &f64_lo_a, &f64_hi_a, "%e grams");
+ ImGui::SeparatorText("Always On");
- ImGui::Text("Sliders (reverse)");
- ImGui::SliderScalar("slider s8 reverse", ImGuiDataType_S8, &s8_v, &s8_max, &s8_min, "%d");
- ImGui::SliderScalar("slider u8 reverse", ImGuiDataType_U8, &u8_v, &u8_max, &u8_min, "%u");
- ImGui::SliderScalar("slider s32 reverse", ImGuiDataType_S32, &s32_v, &s32_fifty, &s32_zero, "%d");
- ImGui::SliderScalar("slider u32 reverse", ImGuiDataType_U32, &u32_v, &u32_fifty, &u32_zero, "%u");
- ImGui::SliderScalar("slider s64 reverse", ImGuiDataType_S64, &s64_v, &s64_fifty, &s64_zero, "%" IM_PRId64);
- ImGui::SliderScalar("slider u64 reverse", ImGuiDataType_U64, &u64_v, &u64_fifty, &u64_zero, "%" IM_PRIu64 " ms");
+ // Showcase NOT relying on a IsItemHovered() to emit a tooltip.
+ // Here the tooltip is always emitted when 'always_on == true'.
+ static int always_on = 0;
+ ImGui::RadioButton("Off", &always_on, 0);
+ ImGui::SameLine();
+ ImGui::RadioButton("Always On (Simple)", &always_on, 1);
+ ImGui::SameLine();
+ ImGui::RadioButton("Always On (Advanced)", &always_on, 2);
+ if (always_on == 1)
+ ImGui::SetTooltip("I am following you around.");
+ else if (always_on == 2 && ImGui::BeginTooltip())
+ {
+ ImGui::ProgressBar(sinf((float)ImGui::GetTime()) * 0.5f + 0.5f, ImVec2(ImGui::GetFontSize() * 25, 0.0f));
+ ImGui::EndTooltip();
+ }
- IMGUI_DEMO_MARKER("Widgets/Data Types/Inputs");
- static bool inputs_step = true;
- ImGui::Text("Inputs");
- ImGui::Checkbox("Show step buttons", &inputs_step);
- ImGui::InputScalar("input s8", ImGuiDataType_S8, &s8_v, inputs_step ? &s8_one : NULL, NULL, "%d");
- ImGui::InputScalar("input u8", ImGuiDataType_U8, &u8_v, inputs_step ? &u8_one : NULL, NULL, "%u");
- ImGui::InputScalar("input s16", ImGuiDataType_S16, &s16_v, inputs_step ? &s16_one : NULL, NULL, "%d");
- ImGui::InputScalar("input u16", ImGuiDataType_U16, &u16_v, inputs_step ? &u16_one : NULL, NULL, "%u");
- ImGui::InputScalar("input s32", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%d");
- ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%04X");
- ImGui::InputScalar("input u32", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%u");
- ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X");
- ImGui::InputScalar("input s64", ImGuiDataType_S64, &s64_v, inputs_step ? &s64_one : NULL);
- ImGui::InputScalar("input u64", ImGuiDataType_U64, &u64_v, inputs_step ? &u64_one : NULL);
- ImGui::InputScalar("input float", ImGuiDataType_Float, &f32_v, inputs_step ? &f32_one : NULL);
- ImGui::InputScalar("input double", ImGuiDataType_Double, &f64_v, inputs_step ? &f64_one : NULL);
+ ImGui::SeparatorText("Custom");
+
+ HelpMarker(
+ "Passing ImGuiHoveredFlags_ForTooltip to IsItemHovered() is the preferred way to standardize "
+ "tooltip activation details across your application. You may however decide to use custom "
+ "flags for a specific tooltip instance.");
+
+ // The following examples are passed for documentation purpose but may not be useful to most users.
+ // Passing ImGuiHoveredFlags_ForTooltip to IsItemHovered() will pull ImGuiHoveredFlags flags values from
+ // 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' depending on whether mouse or keyboard/gamepad is being used.
+ // With default settings, ImGuiHoveredFlags_ForTooltip is equivalent to ImGuiHoveredFlags_DelayShort + ImGuiHoveredFlags_Stationary.
+ ImGui::Button("Manual", sz);
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_ForTooltip))
+ ImGui::SetTooltip("I am a manually emitted tooltip.");
+
+ ImGui::Button("DelayNone", sz);
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNone))
+ ImGui::SetTooltip("I am a tooltip with no delay.");
+
+ ImGui::Button("DelayShort", sz);
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_NoSharedDelay))
+ ImGui::SetTooltip("I am a tooltip with a short delay (%0.2f sec).", ImGui::GetStyle().HoverDelayShort);
+
+ ImGui::Button("DelayLong", sz);
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay))
+ ImGui::SetTooltip("I am a tooltip with a long delay (%0.2f sec).", ImGui::GetStyle().HoverDelayNormal);
+
+ ImGui::Button("Stationary", sz);
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
+ ImGui::SetTooltip("I am a tooltip requiring mouse to be stationary before activating.");
+
+ // Using ImGuiHoveredFlags_ForTooltip will pull flags from 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav',
+ // which default value include the ImGuiHoveredFlags_AllowWhenDisabled flag.
+ ImGui::BeginDisabled();
+ ImGui::Button("Disabled item", sz);
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_ForTooltip))
+ ImGui::SetTooltip("I am a a tooltip for a disabled item.");
+ ImGui::EndDisabled();
ImGui::TreePop();
}
+}
- IMGUI_DEMO_MARKER("Widgets/Multi-component Widgets");
- if (ImGui::TreeNode("Multi-component Widgets"))
- {
- static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
- static int vec4i[4] = { 1, 5, 100, 255 };
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsTreeNodes()
+//-----------------------------------------------------------------------------
- ImGui::InputFloat2("input float2", vec4f);
- ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f);
- ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f);
- ImGui::InputInt2("input int2", vec4i);
- ImGui::DragInt2("drag int2", vec4i, 1, 0, 255);
- ImGui::SliderInt2("slider int2", vec4i, 0, 255);
- ImGui::Spacing();
+static void DemoWindowWidgetsTreeNodes()
+{
+ IMGUI_DEMO_MARKER("Widgets/Tree Nodes");
+ if (ImGui::TreeNode("Tree Nodes"))
+ {
+ IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Basic trees");
+ if (ImGui::TreeNode("Basic trees"))
+ {
+ for (int i = 0; i < 5; i++)
+ {
+ // Use SetNextItemOpen() so set the default state of a node to be open. We could
+ // also use TreeNodeEx() with the ImGuiTreeNodeFlags_DefaultOpen flag to achieve the same thing!
+ if (i == 0)
+ ImGui::SetNextItemOpen(true, ImGuiCond_Once);
- ImGui::InputFloat3("input float3", vec4f);
- ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f);
- ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f);
- ImGui::InputInt3("input int3", vec4i);
- ImGui::DragInt3("drag int3", vec4i, 1, 0, 255);
- ImGui::SliderInt3("slider int3", vec4i, 0, 255);
- ImGui::Spacing();
+ // Here we use PushID() to generate a unique base ID, and then the "" used as TreeNode id won't conflict.
+ // An alternative to using 'PushID() + TreeNode("", ...)' to generate a unique ID is to use 'TreeNode((void*)(intptr_t)i, ...)',
+ // aka generate a dummy pointer-sized value to be hashed. The demo below uses that technique. Both are fine.
+ ImGui::PushID(i);
+ if (ImGui::TreeNode("", "Child %d", i))
+ {
+ ImGui::Text("blah blah");
+ ImGui::SameLine();
+ if (ImGui::SmallButton("button")) {}
+ ImGui::TreePop();
+ }
+ ImGui::PopID();
+ }
+ ImGui::TreePop();
+ }
- ImGui::InputFloat4("input float4", vec4f);
- ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f);
- ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f);
- ImGui::InputInt4("input int4", vec4i);
- ImGui::DragInt4("drag int4", vec4i, 1, 0, 255);
- ImGui::SliderInt4("slider int4", vec4i, 0, 255);
+ IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Advanced, with Selectable nodes");
+ if (ImGui::TreeNode("Advanced, with Selectable nodes"))
+ {
+ HelpMarker(
+ "This is a more typical looking tree with selectable nodes.\n"
+ "Click to select, CTRL+Click to toggle, click on arrows or double-click to open.");
+ static ImGuiTreeNodeFlags base_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_SpanAvailWidth;
+ static bool align_label_with_current_x_position = false;
+ static bool test_drag_and_drop = false;
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnArrow", &base_flags, ImGuiTreeNodeFlags_OpenOnArrow);
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnDoubleClick", &base_flags, ImGuiTreeNodeFlags_OpenOnDoubleClick);
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAvailWidth", &base_flags, ImGuiTreeNodeFlags_SpanAvailWidth); ImGui::SameLine(); HelpMarker("Extend hit area to all available width instead of allowing more items to be laid out after the node.");
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanFullWidth", &base_flags, ImGuiTreeNodeFlags_SpanFullWidth);
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanLabelWidth", &base_flags, ImGuiTreeNodeFlags_SpanLabelWidth); ImGui::SameLine(); HelpMarker("Reduce hit area to the text label and a bit of margin.");
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAllColumns", &base_flags, ImGuiTreeNodeFlags_SpanAllColumns); ImGui::SameLine(); HelpMarker("For use in Tables only.");
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_AllowOverlap", &base_flags, ImGuiTreeNodeFlags_AllowOverlap);
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_Framed", &base_flags, ImGuiTreeNodeFlags_Framed); ImGui::SameLine(); HelpMarker("Draw frame with background (e.g. for CollapsingHeader)");
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_NavLeftJumpsBackHere", &base_flags, ImGuiTreeNodeFlags_NavLeftJumpsBackHere);
+ ImGui::Checkbox("Align label with current X position", &align_label_with_current_x_position);
+ ImGui::Checkbox("Test tree node as drag source", &test_drag_and_drop);
+ ImGui::Text("Hello!");
+ if (align_label_with_current_x_position)
+ ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing());
+ // 'selection_mask' is dumb representation of what may be user-side selection state.
+ // You may retain selection state inside or outside your objects in whatever format you see fit.
+ // 'node_clicked' is temporary storage of what node we have clicked to process selection at the end
+ /// of the loop. May be a pointer to your own node type, etc.
+ static int selection_mask = (1 << 2);
+ int node_clicked = -1;
+ for (int i = 0; i < 6; i++)
+ {
+ // Disable the default "open on single-click behavior" + set Selected flag according to our selection.
+ // To alter selection we use IsItemClicked() && !IsItemToggledOpen(), so clicking on an arrow doesn't alter selection.
+ ImGuiTreeNodeFlags node_flags = base_flags;
+ const bool is_selected = (selection_mask & (1 << i)) != 0;
+ if (is_selected)
+ node_flags |= ImGuiTreeNodeFlags_Selected;
+ if (i < 3)
+ {
+ // Items 0..2 are Tree Node
+ bool node_open = ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Node %d", i);
+ if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen())
+ node_clicked = i;
+ if (test_drag_and_drop && ImGui::BeginDragDropSource())
+ {
+ ImGui::SetDragDropPayload("_TREENODE", NULL, 0);
+ ImGui::Text("This is a drag and drop source");
+ ImGui::EndDragDropSource();
+ }
+ if (i == 2 && (base_flags & ImGuiTreeNodeFlags_SpanLabelWidth))
+ {
+ // Item 2 has an additional inline button to help demonstrate SpanLabelWidth.
+ ImGui::SameLine();
+ if (ImGui::SmallButton("button")) {}
+ }
+ if (node_open)
+ {
+ ImGui::BulletText("Blah blah\nBlah Blah");
+ ImGui::SameLine();
+ ImGui::SmallButton("Button");
+ ImGui::TreePop();
+ }
+ }
+ else
+ {
+ // Items 3..5 are Tree Leaves
+ // The only reason we use TreeNode at all is to allow selection of the leaf. Otherwise we can
+ // use BulletText() or advance the cursor by GetTreeNodeToLabelSpacing() and call Text().
+ node_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen; // ImGuiTreeNodeFlags_Bullet
+ ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Leaf %d", i);
+ if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen())
+ node_clicked = i;
+ if (test_drag_and_drop && ImGui::BeginDragDropSource())
+ {
+ ImGui::SetDragDropPayload("_TREENODE", NULL, 0);
+ ImGui::Text("This is a drag and drop source");
+ ImGui::EndDragDropSource();
+ }
+ }
+ }
+ if (node_clicked != -1)
+ {
+ // Update selection state
+ // (process outside of tree loop to avoid visual inconsistencies during the clicking frame)
+ if (ImGui::GetIO().KeyCtrl)
+ selection_mask ^= (1 << node_clicked); // CTRL+click to toggle
+ else //if (!(selection_mask & (1 << node_clicked))) // Depending on selection behavior you want, may want to preserve selection when clicking on item that is part of the selection
+ selection_mask = (1 << node_clicked); // Click to single-select
+ }
+ if (align_label_with_current_x_position)
+ ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing());
+ ImGui::TreePop();
+ }
ImGui::TreePop();
}
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsVerticalSliders()
+//-----------------------------------------------------------------------------
+static void DemoWindowWidgetsVerticalSliders()
+{
IMGUI_DEMO_MARKER("Widgets/Vertical Sliders");
if (ImGui::TreeNode("Vertical Sliders"))
{
@@ -2185,340 +4114,63 @@ static void ShowDemoWindowWidgets()
ImGui::PopStyleVar();
ImGui::TreePop();
}
+}
- IMGUI_DEMO_MARKER("Widgets/Drag and drop");
- if (ImGui::TreeNode("Drag and Drop"))
- {
- IMGUI_DEMO_MARKER("Widgets/Drag and drop/Standard widgets");
- if (ImGui::TreeNode("Drag and drop in standard widgets"))
- {
- // ColorEdit widgets automatically act as drag source and drag target.
- // They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F
- // to allow your own widgets to use colors in their drag and drop interaction.
- // Also see 'Demo->Widgets->Color/Picker Widgets->Palette' demo.
- HelpMarker("You can drag from the color squares.");
- static float col1[3] = { 1.0f, 0.0f, 0.2f };
- static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
- ImGui::ColorEdit3("color 1", col1);
- ImGui::ColorEdit4("color 2", col2);
- ImGui::TreePop();
- }
-
- IMGUI_DEMO_MARKER("Widgets/Drag and drop/Copy-swap items");
- if (ImGui::TreeNode("Drag and drop to copy/swap items"))
- {
- enum Mode
- {
- Mode_Copy,
- Mode_Move,
- Mode_Swap
- };
- static int mode = 0;
- if (ImGui::RadioButton("Copy", mode == Mode_Copy)) { mode = Mode_Copy; } ImGui::SameLine();
- if (ImGui::RadioButton("Move", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine();
- if (ImGui::RadioButton("Swap", mode == Mode_Swap)) { mode = Mode_Swap; }
- static const char* names[9] =
- {
- "Bobby", "Beatrice", "Betty",
- "Brianna", "Barry", "Bernard",
- "Bibi", "Blaine", "Bryn"
- };
- for (int n = 0; n < IM_ARRAYSIZE(names); n++)
- {
- ImGui::PushID(n);
- if ((n % 3) != 0)
- ImGui::SameLine();
- ImGui::Button(names[n], ImVec2(60, 60));
-
- // Our buttons are both drag sources and drag targets here!
- if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None))
- {
- // Set payload to carry the index of our item (could be anything)
- ImGui::SetDragDropPayload("DND_DEMO_CELL", &n, sizeof(int));
-
- // Display preview (could be anything, e.g. when dragging an image we could decide to display
- // the filename and a small preview of the image, etc.)
- if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); }
- if (mode == Mode_Move) { ImGui::Text("Move %s", names[n]); }
- if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); }
- ImGui::EndDragDropSource();
- }
- if (ImGui::BeginDragDropTarget())
- {
- if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("DND_DEMO_CELL"))
- {
- IM_ASSERT(payload->DataSize == sizeof(int));
- int payload_n = *(const int*)payload->Data;
- if (mode == Mode_Copy)
- {
- names[n] = names[payload_n];
- }
- if (mode == Mode_Move)
- {
- names[n] = names[payload_n];
- names[payload_n] = "";
- }
- if (mode == Mode_Swap)
- {
- const char* tmp = names[n];
- names[n] = names[payload_n];
- names[payload_n] = tmp;
- }
- }
- ImGui::EndDragDropTarget();
- }
- ImGui::PopID();
- }
- ImGui::TreePop();
- }
-
- IMGUI_DEMO_MARKER("Widgets/Drag and Drop/Drag to reorder items (simple)");
- if (ImGui::TreeNode("Drag to reorder items (simple)"))
- {
- // Simple reordering
- HelpMarker(
- "We don't use the drag and drop api at all here! "
- "Instead we query when the item is held but not hovered, and order items accordingly.");
- static const char* item_names[] = { "Item One", "Item Two", "Item Three", "Item Four", "Item Five" };
- for (int n = 0; n < IM_ARRAYSIZE(item_names); n++)
- {
- const char* item = item_names[n];
- ImGui::Selectable(item);
-
- if (ImGui::IsItemActive() && !ImGui::IsItemHovered())
- {
- int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.f ? -1 : 1);
- if (n_next >= 0 && n_next < IM_ARRAYSIZE(item_names))
- {
- item_names[n] = item_names[n_next];
- item_names[n_next] = item;
- ImGui::ResetMouseDragDelta();
- }
- }
- }
- ImGui::TreePop();
- }
-
- ImGui::TreePop();
- }
-
- IMGUI_DEMO_MARKER("Widgets/Querying Item Status (Edited,Active,Hovered etc.)");
- if (ImGui::TreeNode("Querying Item Status (Edited/Active/Hovered etc.)"))
- {
- // Select an item type
- const char* item_names[] =
- {
- "Text", "Button", "Button (w/ repeat)", "Checkbox", "SliderFloat", "InputText", "InputTextMultiline", "InputFloat",
- "InputFloat3", "ColorEdit4", "Selectable", "MenuItem", "TreeNode", "TreeNode (w/ double-click)", "Combo", "ListBox"
- };
- static int item_type = 4;
- static bool item_disabled = false;
- ImGui::Combo("Item Type", &item_type, item_names, IM_ARRAYSIZE(item_names), IM_ARRAYSIZE(item_names));
- ImGui::SameLine();
- HelpMarker("Testing how various types of items are interacting with the IsItemXXX functions. Note that the bool return value of most ImGui function is generally equivalent to calling ImGui::IsItemHovered().");
- ImGui::Checkbox("Item Disabled", &item_disabled);
-
- // Submit selected items so we can query their status in the code following it.
- bool ret = false;
- static bool b = false;
- static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
- static char str[16] = {};
- if (item_disabled)
- ImGui::BeginDisabled(true);
- if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction
- if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button
- if (item_type == 2) { ImGui::PushButtonRepeat(true); ret = ImGui::Button("ITEM: Button"); ImGui::PopButtonRepeat(); } // Testing button (with repeater)
- if (item_type == 3) { ret = ImGui::Checkbox("ITEM: Checkbox", &b); } // Testing checkbox
- if (item_type == 4) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item
- if (item_type == 5) { ret = ImGui::InputText("ITEM: InputText", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which handles tabbing)
- if (item_type == 6) { ret = ImGui::InputTextMultiline("ITEM: InputTextMultiline", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which uses a child window)
- if (item_type == 7) { ret = ImGui::InputFloat("ITEM: InputFloat", col4f, 1.0f); } // Testing +/- buttons on scalar input
- if (item_type == 8) { ret = ImGui::InputFloat3("ITEM: InputFloat3", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged)
- if (item_type == 9) { ret = ImGui::ColorEdit4("ITEM: ColorEdit4", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged)
- if (item_type == 10){ ret = ImGui::Selectable("ITEM: Selectable"); } // Testing selectable item
- if (item_type == 11){ ret = ImGui::MenuItem("ITEM: MenuItem"); } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy)
- if (item_type == 12){ ret = ImGui::TreeNode("ITEM: TreeNode"); if (ret) ImGui::TreePop(); } // Testing tree node
- if (item_type == 13){ ret = ImGui::TreeNodeEx("ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen); } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy.
- if (item_type == 14){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::Combo("ITEM: Combo", &current, items, IM_ARRAYSIZE(items)); }
- if (item_type == 15){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", &current, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); }
-
- bool hovered_delay_none = ImGui::IsItemHovered();
- bool hovered_delay_short = ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort);
- bool hovered_delay_normal = ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal);
-
- // Display the values of IsItemHovered() and other common item state functions.
- // Note that the ImGuiHoveredFlags_XXX flags can be combined.
- // Because BulletText is an item itself and that would affect the output of IsItemXXX functions,
- // we query every state in a single call to avoid storing them and to simplify the code.
- ImGui::BulletText(
- "Return value = %d\n"
- "IsItemFocused() = %d\n"
- "IsItemHovered() = %d\n"
- "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
- "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
- "IsItemHovered(_AllowWhenOverlapped) = %d\n"
- "IsItemHovered(_AllowWhenDisabled) = %d\n"
- "IsItemHovered(_RectOnly) = %d\n"
- "IsItemActive() = %d\n"
- "IsItemEdited() = %d\n"
- "IsItemActivated() = %d\n"
- "IsItemDeactivated() = %d\n"
- "IsItemDeactivatedAfterEdit() = %d\n"
- "IsItemVisible() = %d\n"
- "IsItemClicked() = %d\n"
- "IsItemToggledOpen() = %d\n"
- "GetItemRectMin() = (%.1f, %.1f)\n"
- "GetItemRectMax() = (%.1f, %.1f)\n"
- "GetItemRectSize() = (%.1f, %.1f)",
- ret,
- ImGui::IsItemFocused(),
- ImGui::IsItemHovered(),
- ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup),
- ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
- ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlapped),
- ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled),
- ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly),
- ImGui::IsItemActive(),
- ImGui::IsItemEdited(),
- ImGui::IsItemActivated(),
- ImGui::IsItemDeactivated(),
- ImGui::IsItemDeactivatedAfterEdit(),
- ImGui::IsItemVisible(),
- ImGui::IsItemClicked(),
- ImGui::IsItemToggledOpen(),
- ImGui::GetItemRectMin().x, ImGui::GetItemRectMin().y,
- ImGui::GetItemRectMax().x, ImGui::GetItemRectMax().y,
- ImGui::GetItemRectSize().x, ImGui::GetItemRectSize().y
- );
- ImGui::BulletText(
- "w/ Hovering Delay: None = %d, Fast %d, Normal = %d", hovered_delay_none, hovered_delay_short, hovered_delay_normal);
-
- if (item_disabled)
- ImGui::EndDisabled();
-
- char buf[1] = "";
- ImGui::InputText("unused", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_ReadOnly);
- ImGui::SameLine();
- HelpMarker("This widget is only here to be able to tab-out of the widgets above and see e.g. Deactivated() status.");
-
- ImGui::TreePop();
- }
-
- IMGUI_DEMO_MARKER("Widgets/Querying Window Status (Focused,Hovered etc.)");
- if (ImGui::TreeNode("Querying Window Status (Focused/Hovered etc.)"))
- {
- static bool embed_all_inside_a_child_window = false;
- ImGui::Checkbox("Embed everything inside a child window for testing _RootWindow flag.", &embed_all_inside_a_child_window);
- if (embed_all_inside_a_child_window)
- ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20.0f), true);
-
- // Testing IsWindowFocused() function with its various flags.
- ImGui::BulletText(
- "IsWindowFocused() = %d\n"
- "IsWindowFocused(_ChildWindows) = %d\n"
- "IsWindowFocused(_ChildWindows|_NoPopupHierarchy) = %d\n"
- "IsWindowFocused(_ChildWindows|_RootWindow) = %d\n"
- "IsWindowFocused(_ChildWindows|_RootWindow|_NoPopupHierarchy) = %d\n"
- "IsWindowFocused(_RootWindow) = %d\n"
- "IsWindowFocused(_RootWindow|_NoPopupHierarchy) = %d\n"
- "IsWindowFocused(_AnyWindow) = %d\n",
- ImGui::IsWindowFocused(),
- ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows),
- ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_NoPopupHierarchy),
- ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_RootWindow),
- ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_NoPopupHierarchy),
- ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow),
- ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_NoPopupHierarchy),
- ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow));
-
- // Testing IsWindowHovered() function with its various flags.
- ImGui::BulletText(
- "IsWindowHovered() = %d\n"
- "IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n"
- "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n"
- "IsWindowHovered(_ChildWindows) = %d\n"
- "IsWindowHovered(_ChildWindows|_NoPopupHierarchy) = %d\n"
- "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n"
- "IsWindowHovered(_ChildWindows|_RootWindow|_NoPopupHierarchy) = %d\n"
- "IsWindowHovered(_RootWindow) = %d\n"
- "IsWindowHovered(_RootWindow|_NoPopupHierarchy) = %d\n"
- "IsWindowHovered(_ChildWindows|_AllowWhenBlockedByPopup) = %d\n"
- "IsWindowHovered(_AnyWindow) = %d\n",
- ImGui::IsWindowHovered(),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_NoPopupHierarchy),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_NoPopupHierarchy),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_NoPopupHierarchy),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_AllowWhenBlockedByPopup),
- ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow));
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgets()
+//-----------------------------------------------------------------------------
- ImGui::BeginChild("child", ImVec2(0, 50), true);
- ImGui::Text("This is another child window for testing the _ChildWindows flag.");
- ImGui::EndChild();
- if (embed_all_inside_a_child_window)
- ImGui::EndChild();
+static void DemoWindowWidgets(ImGuiDemoWindowData* demo_data)
+{
+ IMGUI_DEMO_MARKER("Widgets");
+ //ImGui::SetNextItemOpen(true, ImGuiCond_Once);
+ if (!ImGui::CollapsingHeader("Widgets"))
+ return;
- // Calling IsItemHovered() after begin returns the hovered status of the title bar.
- // This is useful in particular if you want to create a context menu associated to the title bar of a window.
- static bool test_window = false;
- ImGui::Checkbox("Hovered/Active tests after Begin() for title bar testing", &test_window);
- if (test_window)
- {
- ImGui::Begin("Title bar Hovered/Active tests", &test_window);
- if (ImGui::BeginPopupContextItem()) // <-- This is using IsItemHovered()
- {
- if (ImGui::MenuItem("Close")) { test_window = false; }
- ImGui::EndPopup();
- }
- ImGui::Text(
- "IsItemHovered() after begin = %d (== is title bar hovered)\n"
- "IsItemActive() after begin = %d (== is window being clicked/moved)\n",
- ImGui::IsItemHovered(), ImGui::IsItemActive());
- ImGui::End();
- }
+ const bool disable_all = demo_data->DisableSections; // The Checkbox for that is inside the "Disabled" section at the bottom
+ if (disable_all)
+ ImGui::BeginDisabled();
- ImGui::TreePop();
- }
+ DemoWindowWidgetsBasic();
+ DemoWindowWidgetsBullets();
+ DemoWindowWidgetsCollapsingHeaders();
+ DemoWindowWidgetsComboBoxes();
+ DemoWindowWidgetsColorAndPickers();
+ DemoWindowWidgetsDataTypes();
- // Demonstrate BeginDisabled/EndDisabled using a checkbox located at the bottom of the section (which is a bit odd:
- // logically we'd have this checkbox at the top of the section, but we don't want this feature to steal that space)
if (disable_all)
ImGui::EndDisabled();
+ DemoWindowWidgetsDisableBlocks(demo_data);
+ if (disable_all)
+ ImGui::BeginDisabled();
- IMGUI_DEMO_MARKER("Widgets/Disable Block");
- if (ImGui::TreeNode("Disable block"))
- {
- ImGui::Checkbox("Disable entire section above", &disable_all);
- ImGui::SameLine(); HelpMarker("Demonstrate using BeginDisabled()/EndDisabled() across this section.");
- ImGui::TreePop();
- }
+ DemoWindowWidgetsDragAndDrop();
+ DemoWindowWidgetsDragsAndSliders();
+ DemoWindowWidgetsImages();
+ DemoWindowWidgetsListBoxes();
+ DemoWindowWidgetsMultiComponents();
+ DemoWindowWidgetsPlotting();
+ DemoWindowWidgetsProgressBars();
+ DemoWindowWidgetsQueryingStatuses();
+ DemoWindowWidgetsSelectables();
+ DemoWindowWidgetsSelectionAndMultiSelect(demo_data);
+ DemoWindowWidgetsTabs();
+ DemoWindowWidgetsText();
+ DemoWindowWidgetsTextFilter();
+ DemoWindowWidgetsTextInput();
+ DemoWindowWidgetsTooltips();
+ DemoWindowWidgetsTreeNodes();
+ DemoWindowWidgetsVerticalSliders();
- IMGUI_DEMO_MARKER("Widgets/Text Filter");
- if (ImGui::TreeNode("Text Filter"))
- {
- // Helper class to easy setup a text filter.
- // You may want to implement a more feature-full filtering scheme in your own application.
- HelpMarker("Not a widget per-se, but ImGuiTextFilter is a helper to perform simple filtering on text strings.");
- static ImGuiTextFilter filter;
- ImGui::Text("Filter usage:\n"
- " \"\" display all lines\n"
- " \"xxx\" display lines containing \"xxx\"\n"
- " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
- " \"-xxx\" hide lines containing \"xxx\"");
- filter.Draw();
- const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
- for (int i = 0; i < IM_ARRAYSIZE(lines); i++)
- if (filter.PassFilter(lines[i]))
- ImGui::BulletText("%s", lines[i]);
- ImGui::TreePop();
- }
+ if (disable_all)
+ ImGui::EndDisabled();
}
-static void ShowDemoWindowLayout()
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowLayout()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowLayout()
{
IMGUI_DEMO_MARKER("Layout");
if (!ImGui::CollapsingHeader("Layout & Scrolling"))
@@ -2527,6 +4179,8 @@ static void ShowDemoWindowLayout()
IMGUI_DEMO_MARKER("Layout/Child windows");
if (ImGui::TreeNode("Child windows"))
{
+ ImGui::SeparatorText("Child windows");
+
HelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window.");
static bool disable_mouse_wheel = false;
static bool disable_menu = false;
@@ -2538,7 +4192,7 @@ static void ShowDemoWindowLayout()
ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar;
if (disable_mouse_wheel)
window_flags |= ImGuiWindowFlags_NoScrollWithMouse;
- ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 260), false, window_flags);
+ ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 260), ImGuiChildFlags_None, window_flags);
for (int i = 0; i < 100; i++)
ImGui::Text("%04d: scrollable region", i);
ImGui::EndChild();
@@ -2554,7 +4208,7 @@ static void ShowDemoWindowLayout()
if (!disable_menu)
window_flags |= ImGuiWindowFlags_MenuBar;
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
- ImGui::BeginChild("ChildR", ImVec2(0, 260), true, window_flags);
+ ImGui::BeginChild("ChildR", ImVec2(0, 260), ImGuiChildFlags_Borders, window_flags);
if (!disable_menu && ImGui::BeginMenuBar())
{
if (ImGui::BeginMenu("Menu"))
@@ -2579,7 +4233,39 @@ static void ShowDemoWindowLayout()
ImGui::PopStyleVar();
}
- ImGui::Separator();
+ // Child 3: manual-resize
+ ImGui::SeparatorText("Manual-resize");
+ {
+ HelpMarker("Drag bottom border to resize. Double-click bottom border to auto-fit to vertical contents.");
+ //if (ImGui::Button("Set Height to 200"))
+ // ImGui::SetNextWindowSize(ImVec2(-FLT_MIN, 200.0f));
+
+ ImGui::PushStyleColor(ImGuiCol_ChildBg, ImGui::GetStyleColorVec4(ImGuiCol_FrameBg));
+ if (ImGui::BeginChild("ResizableChild", ImVec2(-FLT_MIN, ImGui::GetTextLineHeightWithSpacing() * 8), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeY))
+ for (int n = 0; n < 10; n++)
+ ImGui::Text("Line %04d", n);
+ ImGui::PopStyleColor();
+ ImGui::EndChild();
+ }
+
+ // Child 4: auto-resizing height with a limit
+ ImGui::SeparatorText("Auto-resize with constraints");
+ {
+ static int draw_lines = 3;
+ static int max_height_in_lines = 10;
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
+ ImGui::DragInt("Lines Count", &draw_lines, 0.2f);
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
+ ImGui::DragInt("Max Height (in Lines)", &max_height_in_lines, 0.2f);
+
+ ImGui::SetNextWindowSizeConstraints(ImVec2(0.0f, ImGui::GetTextLineHeightWithSpacing() * 1), ImVec2(FLT_MAX, ImGui::GetTextLineHeightWithSpacing() * max_height_in_lines));
+ if (ImGui::BeginChild("ConstrainedChild", ImVec2(-FLT_MIN, 0.0f), ImGuiChildFlags_Borders | ImGuiChildFlags_AutoResizeY))
+ for (int n = 0; n < draw_lines; n++)
+ ImGui::Text("Line %04d", n);
+ ImGui::EndChild();
+ }
+
+ ImGui::SeparatorText("Misc/Advanced");
// Demonstrate a few extra things
// - Changing ImGuiCol_ChildBg (which is transparent black in default styles)
@@ -2590,19 +4276,33 @@ static void ShowDemoWindowLayout()
// the POV of the parent window). See 'Demo->Querying Status (Edited/Active/Hovered etc.)' for details.
{
static int offset_x = 0;
+ static bool override_bg_color = true;
+ static ImGuiChildFlags child_flags = ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY;
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
ImGui::DragInt("Offset X", &offset_x, 1.0f, -1000, 1000);
+ ImGui::Checkbox("Override ChildBg color", &override_bg_color);
+ ImGui::CheckboxFlags("ImGuiChildFlags_Borders", &child_flags, ImGuiChildFlags_Borders);
+ ImGui::CheckboxFlags("ImGuiChildFlags_AlwaysUseWindowPadding", &child_flags, ImGuiChildFlags_AlwaysUseWindowPadding);
+ ImGui::CheckboxFlags("ImGuiChildFlags_ResizeX", &child_flags, ImGuiChildFlags_ResizeX);
+ ImGui::CheckboxFlags("ImGuiChildFlags_ResizeY", &child_flags, ImGuiChildFlags_ResizeY);
+ ImGui::CheckboxFlags("ImGuiChildFlags_FrameStyle", &child_flags, ImGuiChildFlags_FrameStyle);
+ ImGui::SameLine(); HelpMarker("Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding.");
+ if (child_flags & ImGuiChildFlags_FrameStyle)
+ override_bg_color = false;
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (float)offset_x);
- ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(255, 0, 0, 100));
- ImGui::BeginChild("Red", ImVec2(200, 100), true, ImGuiWindowFlags_None);
+ if (override_bg_color)
+ ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(255, 0, 0, 100));
+ ImGui::BeginChild("Red", ImVec2(200, 100), child_flags, ImGuiWindowFlags_None);
+ if (override_bg_color)
+ ImGui::PopStyleColor();
+
for (int n = 0; n < 50; n++)
ImGui::Text("Some test %d", n);
ImGui::EndChild();
bool child_is_hovered = ImGui::IsItemHovered();
ImVec2 child_rect_min = ImGui::GetItemRectMin();
ImVec2 child_rect_max = ImGui::GetItemRectMax();
- ImGui::PopStyleColor();
ImGui::Text("Hovered: %d", child_is_hovered);
ImGui::Text("Rect of child window is: (%.0f,%.0f) (%.0f,%.0f)", child_rect_min.x, child_rect_min.y, child_rect_max.x, child_rect_max.y);
}
@@ -2695,11 +4395,11 @@ static void ShowDemoWindowLayout()
// Text
IMGUI_DEMO_MARKER("Layout/Basic Horizontal Layout/SameLine");
ImGui::Text("Two items: Hello"); ImGui::SameLine();
- ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
+ ImGui::TextColored(ImVec4(1, 1, 0, 1), "Sailor");
// Adjust spacing
ImGui::Text("More spacing: Hello"); ImGui::SameLine(0, 20);
- ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
+ ImGui::TextColored(ImVec4(1, 1, 0, 1), "Sailor");
// Button
ImGui::AlignTextToFramePadding();
@@ -2750,7 +4450,7 @@ static void ShowDemoWindowLayout()
ImGui::PushID(i);
ImGui::ListBox("", &selection[i], items, IM_ARRAYSIZE(items));
ImGui::PopID();
- //if (ImGui::IsItemHovered()) ImGui::SetTooltip("ListBox %d hovered", i);
+ //ImGui::SetItemTooltip("ListBox %d hovered", i);
}
ImGui::PopItemWidth();
@@ -2767,7 +4467,7 @@ static void ShowDemoWindowLayout()
ImGui::Text("Manual wrapping:");
ImGuiStyle& style = ImGui::GetStyle();
int buttons_count = 20;
- float window_visible_x2 = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMax().x;
+ float window_visible_x2 = ImGui::GetCursorScreenPos().x + ImGui::GetContentRegionAvail().x;
for (int n = 0; n < buttons_count; n++)
{
ImGui::PushID(n);
@@ -2803,8 +4503,7 @@ static void ShowDemoWindowLayout()
ImGui::SameLine();
ImGui::Button("EEE");
ImGui::EndGroup();
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip("First group hovered");
+ ImGui::SetItemTooltip("First group hovered");
}
// Capture the group size and create widgets using the same size
ImVec2 size = ImGui::GetItemRectSize();
@@ -2849,7 +4548,7 @@ static void ShowDemoWindowLayout()
// down by FramePadding.y ahead of time)
ImGui::AlignTextToFramePadding();
ImGui::Text("OK Blahblah"); ImGui::SameLine();
- ImGui::Button("Some framed item"); ImGui::SameLine();
+ ImGui::Button("Some framed item##2"); ImGui::SameLine();
HelpMarker("We call AlignTextToFramePadding() to vertically align the text baseline by +FramePadding.y");
// SmallButton() uses the same vertical padding as Text
@@ -2992,7 +4691,7 @@ static void ShowDemoWindowLayout()
const ImGuiWindowFlags child_flags = enable_extra_decorations ? ImGuiWindowFlags_MenuBar : 0;
const ImGuiID child_id = ImGui::GetID((void*)(intptr_t)i);
- const bool child_is_visible = ImGui::BeginChild(child_id, ImVec2(child_w, 200.0f), true, child_flags);
+ const bool child_is_visible = ImGui::BeginChild(child_id, ImVec2(child_w, 200.0f), ImGuiChildFlags_Borders, child_flags);
if (ImGui::BeginMenuBar())
{
ImGui::TextUnformatted("abc");
@@ -3039,7 +4738,7 @@ static void ShowDemoWindowLayout()
float child_height = ImGui::GetTextLineHeight() + style.ScrollbarSize + style.WindowPadding.y * 2.0f;
ImGuiWindowFlags child_flags = ImGuiWindowFlags_HorizontalScrollbar | (enable_extra_decorations ? ImGuiWindowFlags_AlwaysVerticalScrollbar : 0);
ImGuiID child_id = ImGui::GetID((void*)(intptr_t)i);
- bool child_is_visible = ImGui::BeginChild(child_id, ImVec2(-100, child_height), true, child_flags);
+ bool child_is_visible = ImGui::BeginChild(child_id, ImVec2(-100, child_height), ImGuiChildFlags_Borders, child_flags);
if (scroll_to_off)
ImGui::SetScrollX(scroll_to_off_px);
if (scroll_to_pos)
@@ -3081,7 +4780,7 @@ static void ShowDemoWindowLayout()
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f));
ImVec2 scrolling_child_size = ImVec2(0, ImGui::GetFrameHeightWithSpacing() * 7 + 30);
- ImGui::BeginChild("scrolling", scrolling_child_size, true, ImGuiWindowFlags_HorizontalScrollbar);
+ ImGui::BeginChild("scrolling", scrolling_child_size, ImGuiChildFlags_Borders, ImGuiWindowFlags_HorizontalScrollbar);
for (int line = 0; line < lines; line++)
{
// Display random stuff. For the sake of this trivial demo we are using basic Button() + SameLine()
@@ -3150,7 +4849,9 @@ static void ShowDemoWindowLayout()
IMGUI_DEMO_MARKER("Layout/Scrolling/Horizontal contents size demo window");
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2, 0));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 0));
- HelpMarker("Test of different widgets react and impact the work rectangle growing when horizontal scrolling is enabled.\n\nUse 'Metrics->Tools->Show windows rectangles' to visualize rectangles.");
+ HelpMarker(
+ "Test how different widgets react and impact the work rectangle growing when horizontal scrolling is enabled.\n\n"
+ "Use 'Metrics->Tools->Show windows rectangles' to visualize rectangles.");
ImGui::Checkbox("H-scrollbar", &show_h_scrollbar);
ImGui::Checkbox("Button", &show_button); // Will grow contents size (unless explicitly overwritten)
ImGui::Checkbox("Tree nodes", &show_tree_nodes); // Will grow contents size and display highlight over full width
@@ -3225,7 +4926,7 @@ static void ShowDemoWindowLayout()
}
if (show_child)
{
- ImGui::BeginChild("child", ImVec2(0, 0), true);
+ ImGui::BeginChild("child", ImVec2(0, 0), ImGuiChildFlags_Borders);
ImGui::EndChild();
}
ImGui::End();
@@ -3234,8 +4935,8 @@ static void ShowDemoWindowLayout()
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Layout/Clipping");
- if (ImGui::TreeNode("Clipping"))
+ IMGUI_DEMO_MARKER("Layout/Text Clipping");
+ if (ImGui::TreeNode("Text Clipping"))
{
static ImVec2 size(100.0f, 100.0f);
static ImVec2 offset(30.0f, 30.0f);
@@ -3298,9 +4999,44 @@ static void ShowDemoWindowLayout()
ImGui::TreePop();
}
+
+ IMGUI_DEMO_MARKER("Layout/Overlap Mode");
+ if (ImGui::TreeNode("Overlap Mode"))
+ {
+ static bool enable_allow_overlap = true;
+
+ HelpMarker(
+ "Hit-testing is by default performed in item submission order, which generally is perceived as 'back-to-front'.\n\n"
+ "By using SetNextItemAllowOverlap() you can notify that an item may be overlapped by another. "
+ "Doing so alters the hovering logic: items using AllowOverlap mode requires an extra frame to accept hovered state.");
+ ImGui::Checkbox("Enable AllowOverlap", &enable_allow_overlap);
+
+ ImVec2 button1_pos = ImGui::GetCursorScreenPos();
+ ImVec2 button2_pos = ImVec2(button1_pos.x + 50.0f, button1_pos.y + 50.0f);
+ if (enable_allow_overlap)
+ ImGui::SetNextItemAllowOverlap();
+ ImGui::Button("Button 1", ImVec2(80, 80));
+ ImGui::SetCursorScreenPos(button2_pos);
+ ImGui::Button("Button 2", ImVec2(80, 80));
+
+ // This is typically used with width-spanning items.
+ // (note that Selectable() has a dedicated flag ImGuiSelectableFlags_AllowOverlap, which is a shortcut
+ // for using SetNextItemAllowOverlap(). For demo purpose we use SetNextItemAllowOverlap() here.)
+ if (enable_allow_overlap)
+ ImGui::SetNextItemAllowOverlap();
+ ImGui::Selectable("Some Selectable", false);
+ ImGui::SameLine();
+ ImGui::SmallButton("++");
+
+ ImGui::TreePop();
+ }
}
-static void ShowDemoWindowPopups()
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowPopups()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowPopups()
{
IMGUI_DEMO_MARKER("Popups");
if (!ImGui::CollapsingHeader("Popups & Modal windows"))
@@ -3343,8 +5079,7 @@ static void ShowDemoWindowPopups()
ImGui::TextUnformatted(selected_fish == -1 ? "<None>" : names[selected_fish]);
if (ImGui::BeginPopup("my_select_popup"))
{
- ImGui::Text("Aquarium");
- ImGui::Separator();
+ ImGui::SeparatorText("Aquarium");
for (int i = 0; i < IM_ARRAYSIZE(names); i++)
if (ImGui::Selectable(names[i]))
selected_fish = i;
@@ -3366,8 +5101,7 @@ static void ShowDemoWindowPopups()
ImGui::Separator();
ImGui::Text("Tooltip here");
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip("I am a tooltip over a popup");
+ ImGui::SetItemTooltip("I am a tooltip over a popup");
if (ImGui::Button("Stacked Popup"))
ImGui::OpenPopup("another popup");
@@ -3438,18 +5172,20 @@ static void ShowDemoWindowPopups()
// and BeginPopupContextItem() will use the last item ID as the popup ID.
{
const char* names[5] = { "Label1", "Label2", "Label3", "Label4", "Label5" };
+ static int selected = -1;
for (int n = 0; n < 5; n++)
{
- ImGui::Selectable(names[n]);
+ if (ImGui::Selectable(names[n], selected == n))
+ selected = n;
if (ImGui::BeginPopupContextItem()) // <-- use last item id as popup id
{
+ selected = n;
ImGui::Text("This a popup for \"%s\"!", names[n]);
if (ImGui::Button("Close"))
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
}
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip("Right-click to open popup");
+ ImGui::SetItemTooltip("Right-click to open popup");
}
}
@@ -3518,7 +5254,7 @@ static void ShowDemoWindowPopups()
if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize))
{
- ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n");
+ ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!");
ImGui::Separator();
//static int unused_i = 0;
@@ -3555,7 +5291,7 @@ static void ShowDemoWindowPopups()
static int item = 1;
static float color[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
ImGui::Combo("Combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
- ImGui::ColorEdit4("color", color);
+ ImGui::ColorEdit4("Color", color);
if (ImGui::Button("Add another modal.."))
ImGui::OpenPopup("Stacked 2");
@@ -3567,6 +5303,7 @@ static void ShowDemoWindowPopups()
if (ImGui::BeginPopupModal("Stacked 2", &unused_open))
{
ImGui::Text("Hello from Stacked The Second!");
+ ImGui::ColorEdit4("Color", color); // Allow opening another nested popup
if (ImGui::Button("Close"))
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
@@ -3629,6 +5366,14 @@ struct MyItem
// very often by the sorting algorithm it would be a little wasteful.
static const ImGuiTableSortSpecs* s_current_sort_specs;
+ static void SortWithSortSpecs(ImGuiTableSortSpecs* sort_specs, MyItem* items, int items_count)
+ {
+ s_current_sort_specs = sort_specs; // Store in variable accessible by the sort function.
+ if (items_count > 1)
+ qsort(items, (size_t)items_count, sizeof(items[0]), MyItem::CompareWithSortSpecs);
+ s_current_sort_specs = NULL;
+ }
+
// Compare function to be used by qsort()
static int IMGUI_CDECL CompareWithSortSpecs(const void* lhs, const void* rhs)
{
@@ -3655,7 +5400,8 @@ struct MyItem
}
// qsort() is instable so always return a way to differenciate items.
- // Your own compare function may want to avoid fallback on implicit sort specs e.g. a Name compare if it wasn't already part of the sort specs.
+ // Your own compare function may want to avoid fallback on implicit sort specs.
+ // e.g. a Name compare if it wasn't already part of the sort specs.
return (a->ID - b->ID);
}
};
@@ -3666,8 +5412,8 @@ const ImGuiTableSortSpecs* MyItem::s_current_sort_specs = NULL;
static void PushStyleCompact()
{
ImGuiStyle& style = ImGui::GetStyle();
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(style.FramePadding.x, (float)(int)(style.FramePadding.y * 0.60f)));
- ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x, (float)(int)(style.ItemSpacing.y * 0.60f)));
+ ImGui::PushStyleVarY(ImGuiStyleVar_FramePadding, (float)(int)(style.FramePadding.y * 0.60f));
+ ImGui::PushStyleVarY(ImGuiStyleVar_ItemSpacing, (float)(int)(style.ItemSpacing.y * 0.60f));
}
static void PopStyleCompact()
@@ -3701,9 +5447,8 @@ static void EditTableSizingFlags(ImGuiTableFlags* p_flags)
}
ImGui::SameLine();
ImGui::TextDisabled("(?)");
- if (ImGui::IsItemHovered())
+ if (ImGui::BeginItemTooltip())
{
- ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 50.0f);
for (int m = 0; m < IM_ARRAYSIZE(policies); m++)
{
@@ -3740,6 +5485,7 @@ static void EditTableColumnsFlags(ImGuiTableColumnFlags* p_flags)
ImGui::CheckboxFlags("_PreferSortDescending", p_flags, ImGuiTableColumnFlags_PreferSortDescending);
ImGui::CheckboxFlags("_IndentEnable", p_flags, ImGuiTableColumnFlags_IndentEnable); ImGui::SameLine(); HelpMarker("Default for column 0");
ImGui::CheckboxFlags("_IndentDisable", p_flags, ImGuiTableColumnFlags_IndentDisable); ImGui::SameLine(); HelpMarker("Default for column >0");
+ ImGui::CheckboxFlags("_AngledHeader", p_flags, ImGuiTableColumnFlags_AngledHeader);
}
static void ShowTableColumnsStatusFlags(ImGuiTableColumnFlags flags)
@@ -3750,7 +5496,11 @@ static void ShowTableColumnsStatusFlags(ImGuiTableColumnFlags flags)
ImGui::CheckboxFlags("_IsHovered", &flags, ImGuiTableColumnFlags_IsHovered);
}
-static void ShowDemoWindowTables()
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowTables()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowTables()
{
//ImGui::SetNextItemOpen(true, ImGuiCond_Once);
IMGUI_DEMO_MARKER("Tables");
@@ -3764,10 +5514,10 @@ static void ShowDemoWindowTables()
ImGui::PushID("Tables");
int open_action = -1;
- if (ImGui::Button("Open all"))
+ if (ImGui::Button("Expand all"))
open_action = 1;
ImGui::SameLine();
- if (ImGui::Button("Close all"))
+ if (ImGui::Button("Collapse all"))
open_action = 0;
ImGui::SameLine();
@@ -3838,8 +5588,9 @@ static void ShowDemoWindowTables()
// as TableNextColumn() will automatically wrap around and create new rows as needed.
// This is generally more convenient when your cells all contains the same type of data.
HelpMarker(
- "Only using TableNextColumn(), which tends to be convenient for tables where every cell contains the same type of contents.\n"
- "This is also more similar to the old NextColumn() function of the Columns API, and provided to facilitate the Columns->Tables API transition.");
+ "Only using TableNextColumn(), which tends to be convenient for tables where every cell contains "
+ "the same type of contents.\n This is also more similar to the old NextColumn() function of the "
+ "Columns API, and provided to facilitate the Columns->Tables API transition.");
if (ImGui::BeginTable("table3", 3))
{
for (int item = 0; item < 14; item++)
@@ -3867,7 +5618,7 @@ static void ShowDemoWindowTables()
PushStyleCompact();
ImGui::CheckboxFlags("ImGuiTableFlags_RowBg", &flags, ImGuiTableFlags_RowBg);
ImGui::CheckboxFlags("ImGuiTableFlags_Borders", &flags, ImGuiTableFlags_Borders);
- ImGui::SameLine(); HelpMarker("ImGuiTableFlags_Borders\n = ImGuiTableFlags_BordersInnerV\n | ImGuiTableFlags_BordersOuterV\n | ImGuiTableFlags_BordersInnerV\n | ImGuiTableFlags_BordersOuterH");
+ ImGui::SameLine(); HelpMarker("ImGuiTableFlags_Borders\n = ImGuiTableFlags_BordersInnerV\n | ImGuiTableFlags_BordersOuterV\n | ImGuiTableFlags_BordersInnerH\n | ImGuiTableFlags_BordersOuterH");
ImGui::Indent();
ImGui::CheckboxFlags("ImGuiTableFlags_BordersH", &flags, ImGuiTableFlags_BordersH);
@@ -3895,8 +5646,8 @@ static void ShowDemoWindowTables()
if (ImGui::BeginTable("table1", 3, flags))
{
- // Display headers so we can inspect their interaction with borders.
- // (Headers are not the main purpose of this section of the demo, so we are not elaborating on them too much. See other sections for details)
+ // Display headers so we can inspect their interaction with borders
+ // (Headers are not the main purpose of this section of the demo, so we are not elaborating on them now. See other sections for details)
if (display_headers)
{
ImGui::TableSetupColumn("One");
@@ -3935,7 +5686,9 @@ static void ShowDemoWindowTables()
PushStyleCompact();
ImGui::CheckboxFlags("ImGuiTableFlags_Resizable", &flags, ImGuiTableFlags_Resizable);
ImGui::CheckboxFlags("ImGuiTableFlags_BordersV", &flags, ImGuiTableFlags_BordersV);
- ImGui::SameLine(); HelpMarker("Using the _Resizable flag automatically enables the _BordersInnerV flag as well, this is why the resize borders are still showing when unchecking this.");
+ ImGui::SameLine(); HelpMarker(
+ "Using the _Resizable flag automatically enables the _BordersInnerV flag as well, "
+ "this is why the resize borders are still showing when unchecking this.");
PopStyleCompact();
if (ImGui::BeginTable("table1", 3, flags))
@@ -4053,6 +5806,7 @@ static void ShowDemoWindowTables()
ImGui::CheckboxFlags("ImGuiTableFlags_Hideable", &flags, ImGuiTableFlags_Hideable);
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody", &flags, ImGuiTableFlags_NoBordersInBody);
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize", &flags, ImGuiTableFlags_NoBordersInBodyUntilResize); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers)");
+ ImGui::CheckboxFlags("ImGuiTableFlags_HighlightHoveredColumn", &flags, ImGuiTableFlags_HighlightHoveredColumn);
PopStyleCompact();
if (ImGui::BeginTable("table1", 3, flags))
@@ -4075,7 +5829,8 @@ static void ShowDemoWindowTables()
ImGui::EndTable();
}
- // Use outer_size.x == 0.0f instead of default to make the table as tight as possible (only valid when no scrolling and no stretch column)
+ // Use outer_size.x == 0.0f instead of default to make the table as tight as possible
+ // (only valid when no scrolling and no stretch column)
if (ImGui::BeginTable("table2", 3, flags | ImGuiTableFlags_SizingFixedFit, ImVec2(0.0f, 0.0f)))
{
ImGui::TableSetupColumn("One");
@@ -4108,7 +5863,8 @@ static void ShowDemoWindowTables()
"e.g.:\n"
"- BorderOuterV\n"
"- any form of row selection\n"
- "Because of this, activating BorderOuterV sets the default to PadOuterX. Using PadOuterX or NoPadOuterX you can override the default.\n\n"
+ "Because of this, activating BorderOuterV sets the default to PadOuterX. "
+ "Using PadOuterX or NoPadOuterX you can override the default.\n\n"
"Actual padding values are using style.CellPadding.\n\n"
"In this demo we don't show horizontal borders to emphasize how they don't affect default horizontal padding.");
@@ -4224,7 +5980,8 @@ static void ShowDemoWindowTables()
EditTableSizingFlags(&sizing_policy_flags[table_n]);
// To make it easier to understand the different sizing policy,
- // For each policy: we display one table where the columns have equal contents width, and one where the columns have different contents width.
+ // For each policy: we display one table where the columns have equal contents width,
+ // and one where the columns have different contents width.
if (ImGui::BeginTable("table1", 3, sizing_policy_flags[table_n] | flags1))
{
for (int row = 0; row < 3; row++)
@@ -4253,7 +6010,9 @@ static void ShowDemoWindowTables()
ImGui::Spacing();
ImGui::TextUnformatted("Advanced");
ImGui::SameLine();
- HelpMarker("This section allows you to interact and see the effect of various sizing policies depending on whether Scroll is enabled and the contents of your columns.");
+ HelpMarker(
+ "This section allows you to interact and see the effect of various sizing policies "
+ "depending on whether Scroll is enabled and the contents of your columns.");
enum ContentsType { CT_ShowWidth, CT_ShortText, CT_LongText, CT_Button, CT_FillButton, CT_InputText };
static ImGuiTableFlags flags = ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_Resizable;
@@ -4268,7 +6027,9 @@ static void ShowDemoWindowTables()
if (contents_type == CT_FillButton)
{
ImGui::SameLine();
- HelpMarker("Be mindful that using right-alignment (e.g. size.x = -FLT_MIN) creates a feedback loop where contents width can feed into auto-column width can feed into contents width.");
+ HelpMarker(
+ "Be mindful that using right-alignment (e.g. size.x = -FLT_MIN) creates a feedback loop "
+ "where contents width can feed into auto-column width can feed into contents width.");
}
ImGui::DragInt("Columns", &column_count, 0.1f, 1, 64, "%d", ImGuiSliderFlags_AlwaysClamp);
ImGui::CheckboxFlags("ImGuiTableFlags_Resizable", &flags, ImGuiTableFlags_Resizable);
@@ -4314,7 +6075,9 @@ static void ShowDemoWindowTables()
IMGUI_DEMO_MARKER("Tables/Vertical scrolling, with clipping");
if (ImGui::TreeNode("Vertical scrolling, with clipping"))
{
- HelpMarker("Here we activate ScrollY, which will create a child window container to allow hosting scrollable contents.\n\nWe also demonstrate using ImGuiListClipper to virtualize the submission of many items.");
+ HelpMarker(
+ "Here we activate ScrollY, which will create a child window container to allow hosting scrollable contents.\n\n"
+ "We also demonstrate using ImGuiListClipper to virtualize the submission of many items.");
static ImGuiTableFlags flags = ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable;
PushStyleCompact();
@@ -4360,8 +6123,9 @@ static void ShowDemoWindowTables()
HelpMarker(
"When ScrollX is enabled, the default sizing policy becomes ImGuiTableFlags_SizingFixedFit, "
"as automatically stretching columns doesn't make much sense with horizontal scrolling.\n\n"
- "Also note that as of the current version, you will almost always want to enable ScrollY along with ScrollX,"
- "because the container window won't automatically extend vertically to fix contents (this may be improved in future versions).");
+ "Also note that as of the current version, you will almost always want to enable ScrollY along with ScrollX, "
+ "because the container window won't automatically extend vertically to fix contents "
+ "(this may be improved in future versions).");
static ImGuiTableFlags flags = ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable;
static int freeze_cols = 1;
static int freeze_rows = 1;
@@ -4418,7 +6182,8 @@ static void ShowDemoWindowTables()
HelpMarker(
"Showcase using Stretch columns + ScrollX together: "
"this is rather unusual and only makes sense when specifying an 'inner_width' for the table!\n"
- "Without an explicit value, inner_width is == outer_size.x and therefore using Stretch columns + ScrollX together doesn't make sense.");
+ "Without an explicit value, inner_width is == outer_size.x and therefore using Stretch columns "
+ "along with ScrollX doesn't make sense.");
static ImGuiTableFlags flags2 = ImGuiTableFlags_SizingStretchSame | ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_RowBg | ImGuiTableFlags_ContextMenuInBody;
static float inner_width = 1000.0f;
PushStyleCompact();
@@ -4476,8 +6241,9 @@ static void ShowDemoWindowTables()
}
// Create the real table we care about for the example!
- // We use a scrolling table to be able to showcase the difference between the _IsEnabled and _IsVisible flags above, otherwise in
- // a non-scrolling table columns are always visible (unless using ImGuiTableFlags_NoKeepColumnsVisible + resizing the parent window down)
+ // We use a scrolling table to be able to showcase the difference between the _IsEnabled and _IsVisible flags above,
+ // otherwise in a non-scrolling table columns are always visible (unless using ImGuiTableFlags_NoKeepColumnsVisible
+ // + resizing the parent window down).
const ImGuiTableFlags flags
= ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY
| ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV
@@ -4485,15 +6251,22 @@ static void ShowDemoWindowTables()
ImVec2 outer_size = ImVec2(0.0f, TEXT_BASE_HEIGHT * 9);
if (ImGui::BeginTable("table_columns_flags", column_count, flags, outer_size))
{
+ bool has_angled_header = false;
for (int column = 0; column < column_count; column++)
+ {
+ has_angled_header |= (column_flags[column] & ImGuiTableColumnFlags_AngledHeader) != 0;
ImGui::TableSetupColumn(column_names[column], column_flags[column]);
+ }
+ if (has_angled_header)
+ ImGui::TableAngledHeadersRow();
ImGui::TableHeadersRow();
for (int column = 0; column < column_count; column++)
column_flags_out[column] = ImGui::TableGetColumnFlags(column);
float indent_step = (float)((int)TEXT_BASE_WIDTH / 2);
for (int row = 0; row < 8; row++)
{
- ImGui::Indent(indent_step); // Add some indentation to demonstrate usage of per-column IndentEnable/IndentDisable flags.
+ // Add some indentation to demonstrate usage of per-column IndentEnable/IndentDisable flags.
+ ImGui::Indent(indent_step);
ImGui::TableNextRow();
for (int column = 0; column < column_count; column++)
{
@@ -4542,7 +6315,9 @@ static void ShowDemoWindowTables()
ImGui::EndTable();
}
- HelpMarker("Using TableSetupColumn() to setup explicit width.\n\nUnless _NoKeepColumnsVisible is set, fixed columns with set width may still be shrunk down if there's not enough space in the host.");
+ HelpMarker(
+ "Using TableSetupColumn() to setup explicit width.\n\nUnless _NoKeepColumnsVisible is set, "
+ "fixed columns with set width may still be shrunk down if there's not enough space in the host.");
static ImGuiTableFlags flags2 = ImGuiTableFlags_None;
PushStyleCompact();
@@ -4552,7 +6327,8 @@ static void ShowDemoWindowTables()
PopStyleCompact();
if (ImGui::BeginTable("table2", 4, flags2))
{
- // We could also set ImGuiTableFlags_SizingFixedFit on the table and all columns will default to ImGuiTableColumnFlags_WidthFixed.
+ // We could also set ImGuiTableFlags_SizingFixedFit on the table and then all columns
+ // will default to ImGuiTableColumnFlags_WidthFixed.
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 100.0f);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, TEXT_BASE_WIDTH * 15.0f);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, TEXT_BASE_WIDTH * 30.0f);
@@ -4624,10 +6400,13 @@ static void ShowDemoWindowTables()
IMGUI_DEMO_MARKER("Tables/Row height");
if (ImGui::TreeNode("Row height"))
{
- HelpMarker("You can pass a 'min_row_height' to TableNextRow().\n\nRows are padded with 'style.CellPadding.y' on top and bottom, so effectively the minimum row height will always be >= 'style.CellPadding.y * 2.0f'.\n\nWe cannot honor a _maximum_ row height as that would require a unique clipping rectangle per row.");
- if (ImGui::BeginTable("table_row_height", 1, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInnerV))
+ HelpMarker(
+ "You can pass a 'min_row_height' to TableNextRow().\n\nRows are padded with 'style.CellPadding.y' on top and bottom, "
+ "so effectively the minimum row height will always be >= 'style.CellPadding.y * 2.0f'.\n\n"
+ "We cannot honor a _maximum_ row height as that would require a unique clipping rectangle per row.");
+ if (ImGui::BeginTable("table_row_height", 1, ImGuiTableFlags_Borders))
{
- for (int row = 0; row < 10; row++)
+ for (int row = 0; row < 8; row++)
{
float min_row_height = (float)(int)(TEXT_BASE_HEIGHT * 0.30f * row);
ImGui::TableNextRow(ImGuiTableRowFlags_None, min_row_height);
@@ -4636,6 +6415,48 @@ static void ShowDemoWindowTables()
}
ImGui::EndTable();
}
+
+ HelpMarker(
+ "Showcase using SameLine(0,0) to share Current Line Height between cells.\n\n"
+ "Please note that Tables Row Height is not the same thing as Current Line Height, "
+ "as a table cell may contains multiple lines.");
+ if (ImGui::BeginTable("table_share_lineheight", 2, ImGuiTableFlags_Borders))
+ {
+ ImGui::TableNextRow();
+ ImGui::TableNextColumn();
+ ImGui::ColorButton("##1", ImVec4(0.13f, 0.26f, 0.40f, 1.0f), ImGuiColorEditFlags_None, ImVec2(40, 40));
+ ImGui::TableNextColumn();
+ ImGui::Text("Line 1");
+ ImGui::Text("Line 2");
+
+ ImGui::TableNextRow();
+ ImGui::TableNextColumn();
+ ImGui::ColorButton("##2", ImVec4(0.13f, 0.26f, 0.40f, 1.0f), ImGuiColorEditFlags_None, ImVec2(40, 40));
+ ImGui::TableNextColumn();
+ ImGui::SameLine(0.0f, 0.0f); // Reuse line height from previous column
+ ImGui::Text("Line 1, with SameLine(0,0)");
+ ImGui::Text("Line 2");
+
+ ImGui::EndTable();
+ }
+
+ HelpMarker("Showcase altering CellPadding.y between rows. Note that CellPadding.x is locked for the entire table.");
+ if (ImGui::BeginTable("table_changing_cellpadding_y", 1, ImGuiTableFlags_Borders))
+ {
+ ImGuiStyle& style = ImGui::GetStyle();
+ for (int row = 0; row < 8; row++)
+ {
+ if ((row % 3) == 2)
+ ImGui::PushStyleVarY(ImGuiStyleVar_CellPadding, 20.0f);
+ ImGui::TableNextRow(ImGuiTableRowFlags_None);
+ ImGui::TableNextColumn();
+ ImGui::Text("CellPadding.y = %.2f", style.CellPadding.y);
+ if ((row % 3) == 2)
+ ImGui::PopStyleVar();
+ }
+ ImGui::EndTable();
+ }
+
ImGui::TreePop();
}
@@ -4769,9 +6590,17 @@ static void ShowDemoWindowTables()
IMGUI_DEMO_MARKER("Tables/Tree view");
if (ImGui::TreeNode("Tree view"))
{
- static ImGuiTableFlags flags = ImGuiTableFlags_BordersV | ImGuiTableFlags_BordersOuterH | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody;
+ static ImGuiTableFlags table_flags = ImGuiTableFlags_BordersV | ImGuiTableFlags_BordersOuterH | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody;
+
+ static ImGuiTreeNodeFlags tree_node_flags_base = ImGuiTreeNodeFlags_SpanAllColumns;
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanFullWidth", &tree_node_flags_base, ImGuiTreeNodeFlags_SpanFullWidth);
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanLabelWidth", &tree_node_flags_base, ImGuiTreeNodeFlags_SpanLabelWidth);
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAllColumns", &tree_node_flags_base, ImGuiTreeNodeFlags_SpanAllColumns);
+ ImGui::CheckboxFlags("ImGuiTreeNodeFlags_LabelSpanAllColumns", &tree_node_flags_base, ImGuiTreeNodeFlags_LabelSpanAllColumns);
+ ImGui::SameLine(); HelpMarker("Useful if you know that you aren't displaying contents in other columns");
- if (ImGui::BeginTable("3ways", 3, flags))
+ HelpMarker("See \"Columns flags\" section to configure how indentation is applied to individual columns.");
+ if (ImGui::BeginTable("3ways", 3, table_flags))
{
// The first column will use the default _WidthStretch when ScrollX is Off and _WidthFixed when ScrollX is On
ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_NoHide);
@@ -4792,13 +6621,21 @@ static void ShowDemoWindowTables()
ImGui::TableNextRow();
ImGui::TableNextColumn();
const bool is_folder = (node->ChildCount > 0);
+
+ ImGuiTreeNodeFlags node_flags = tree_node_flags_base;
+ if (node != &all_nodes[0])
+ node_flags &= ~ImGuiTreeNodeFlags_LabelSpanAllColumns; // Only demonstrate this on the root node.
+
if (is_folder)
{
- bool open = ImGui::TreeNodeEx(node->Name, ImGuiTreeNodeFlags_SpanFullWidth);
- ImGui::TableNextColumn();
- ImGui::TextDisabled("--");
- ImGui::TableNextColumn();
- ImGui::TextUnformatted(node->Type);
+ bool open = ImGui::TreeNodeEx(node->Name, node_flags);
+ if ((node_flags & ImGuiTreeNodeFlags_LabelSpanAllColumns) == 0)
+ {
+ ImGui::TableNextColumn();
+ ImGui::TextDisabled("--");
+ ImGui::TableNextColumn();
+ ImGui::TextUnformatted(node->Type);
+ }
if (open)
{
for (int child_n = 0; child_n < node->ChildCount; child_n++)
@@ -4808,7 +6645,7 @@ static void ShowDemoWindowTables()
}
else
{
- ImGui::TreeNodeEx(node->Name, ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_Bullet | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_SpanFullWidth);
+ ImGui::TreeNodeEx(node->Name, node_flags | ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_Bullet | ImGuiTreeNodeFlags_NoTreePushOnOpen);
ImGui::TableNextColumn();
ImGui::Text("%d", node->Size);
ImGui::TableNextColumn();
@@ -4818,7 +6655,7 @@ static void ShowDemoWindowTables()
};
static const MyTreeNode nodes[] =
{
- { "Root", "Folder", -1, 1, 3 }, // 0
+ { "Root with Long Name", "Folder", -1, 1, 3 }, // 0
{ "Music", "Folder", -1, 4, 2 }, // 1
{ "Textures", "Folder", -1, 6, 3 }, // 2
{ "desktop.ini", "System file", 1024, -1,-1 }, // 3
@@ -4843,7 +6680,8 @@ static void ShowDemoWindowTables()
{
HelpMarker(
"Showcase using PushItemWidth() and how it is preserved on a per-column basis.\n\n"
- "Note that on auto-resizing non-resizable fixed columns, querying the content width for e.g. right-alignment doesn't make sense.");
+ "Note that on auto-resizing non-resizable fixed columns, querying the content width for "
+ "e.g. right-alignment doesn't make sense.");
if (ImGui::BeginTable("table_item_width", 3, ImGuiTableFlags_Borders))
{
ImGui::TableSetupColumn("small");
@@ -4898,7 +6736,11 @@ static void ShowDemoWindowTables()
// FIXME: It would be nice to actually demonstrate full-featured selection using those checkbox.
static bool column_selected[3] = {};
- // Instead of calling TableHeadersRow() we'll submit custom headers ourselves
+ // Instead of calling TableHeadersRow() we'll submit custom headers ourselves.
+ // (A different approach is also possible:
+ // - Specify ImGuiTableColumnFlags_NoHeaderLabel in some TableSetupColumn() call.
+ // - Call TableHeadersRow() normally. This will submit TableHeader() with no name.
+ // - Then call TableSetColumnIndex() to position yourself in the column and submit your stuff e.g. Checkbox().)
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
for (int column = 0; column < COLUMNS_COUNT; column++)
{
@@ -4913,6 +6755,7 @@ static void ShowDemoWindowTables()
ImGui::PopID();
}
+ // Submit table contents
for (int row = 0; row < 5; row++)
{
ImGui::TableNextRow();
@@ -4929,13 +6772,84 @@ static void ShowDemoWindowTables()
ImGui::TreePop();
}
- // Demonstrate creating custom context menus inside columns, while playing it nice with context menus provided by TableHeadersRow()/TableHeader()
+ // Demonstrate using ImGuiTableColumnFlags_AngledHeader flag to create angled headers
+ if (open_action != -1)
+ ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Angled headers");
+ if (ImGui::TreeNode("Angled headers"))
+ {
+ const char* column_names[] = { "Track", "cabasa", "ride", "smash", "tom-hi", "tom-mid", "tom-low", "hihat-o", "hihat-c", "snare-s", "snare-c", "clap", "rim", "kick" };
+ const int columns_count = IM_ARRAYSIZE(column_names);
+ const int rows_count = 12;
+
+ static ImGuiTableFlags table_flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_Hideable | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_HighlightHoveredColumn;
+ static ImGuiTableColumnFlags column_flags = ImGuiTableColumnFlags_AngledHeader | ImGuiTableColumnFlags_WidthFixed;
+ static bool bools[columns_count * rows_count] = {}; // Dummy storage selection storage
+ static int frozen_cols = 1;
+ static int frozen_rows = 2;
+ ImGui::CheckboxFlags("_ScrollX", &table_flags, ImGuiTableFlags_ScrollX);
+ ImGui::CheckboxFlags("_ScrollY", &table_flags, ImGuiTableFlags_ScrollY);
+ ImGui::CheckboxFlags("_Resizable", &table_flags, ImGuiTableFlags_Resizable);
+ ImGui::CheckboxFlags("_Sortable", &table_flags, ImGuiTableFlags_Sortable);
+ ImGui::CheckboxFlags("_NoBordersInBody", &table_flags, ImGuiTableFlags_NoBordersInBody);
+ ImGui::CheckboxFlags("_HighlightHoveredColumn", &table_flags, ImGuiTableFlags_HighlightHoveredColumn);
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
+ ImGui::SliderInt("Frozen columns", &frozen_cols, 0, 2);
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
+ ImGui::SliderInt("Frozen rows", &frozen_rows, 0, 2);
+ ImGui::CheckboxFlags("Disable header contributing to column width", &column_flags, ImGuiTableColumnFlags_NoHeaderWidth);
+
+ if (ImGui::TreeNode("Style settings"))
+ {
+ ImGui::SameLine();
+ HelpMarker("Giving access to some ImGuiStyle value in this demo for convenience.");
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
+ ImGui::SliderAngle("style.TableAngledHeadersAngle", &ImGui::GetStyle().TableAngledHeadersAngle, -50.0f, +50.0f);
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
+ ImGui::SliderFloat2("style.TableAngledHeadersTextAlign", (float*)&ImGui::GetStyle().TableAngledHeadersTextAlign, 0.0f, 1.0f, "%.2f");
+ ImGui::TreePop();
+ }
+
+ if (ImGui::BeginTable("table_angled_headers", columns_count, table_flags, ImVec2(0.0f, TEXT_BASE_HEIGHT * 12)))
+ {
+ ImGui::TableSetupColumn(column_names[0], ImGuiTableColumnFlags_NoHide | ImGuiTableColumnFlags_NoReorder);
+ for (int n = 1; n < columns_count; n++)
+ ImGui::TableSetupColumn(column_names[n], column_flags);
+ ImGui::TableSetupScrollFreeze(frozen_cols, frozen_rows);
+
+ ImGui::TableAngledHeadersRow(); // Draw angled headers for all columns with the ImGuiTableColumnFlags_AngledHeader flag.
+ ImGui::TableHeadersRow(); // Draw remaining headers and allow access to context-menu and other functions.
+ for (int row = 0; row < rows_count; row++)
+ {
+ ImGui::PushID(row);
+ ImGui::TableNextRow();
+ ImGui::TableSetColumnIndex(0);
+ ImGui::AlignTextToFramePadding();
+ ImGui::Text("Track %d", row);
+ for (int column = 1; column < columns_count; column++)
+ if (ImGui::TableSetColumnIndex(column))
+ {
+ ImGui::PushID(column);
+ ImGui::Checkbox("", &bools[row * columns_count + column]);
+ ImGui::PopID();
+ }
+ ImGui::PopID();
+ }
+ ImGui::EndTable();
+ }
+ ImGui::TreePop();
+ }
+
+ // Demonstrate creating custom context menus inside columns,
+ // while playing it nice with context menus provided by TableHeadersRow()/TableHeader()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
IMGUI_DEMO_MARKER("Tables/Context menus");
if (ImGui::TreeNode("Context menus"))
{
- HelpMarker("By default, right-clicking over a TableHeadersRow()/TableHeader() line will open the default context-menu.\nUsing ImGuiTableFlags_ContextMenuInBody we also allow right-clicking over columns body.");
+ HelpMarker(
+ "By default, right-clicking over a TableHeadersRow()/TableHeader() line will open the default context-menu.\n"
+ "Using ImGuiTableFlags_ContextMenuInBody we also allow right-clicking over columns body.");
static ImGuiTableFlags flags1 = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_ContextMenuInBody;
PushStyleCompact();
@@ -4972,7 +6886,9 @@ static void ShowDemoWindowTables()
// [2.1] Right-click on the TableHeadersRow() line to open the default table context menu.
// [2.2] Right-click on the ".." to open a custom popup
// [2.3] Right-click in columns to open another custom popup
- HelpMarker("Demonstrate mixing table context menu (over header), item context button (over button) and custom per-colum context menu (over column body).");
+ HelpMarker(
+ "Demonstrate mixing table context menu (over header), item context button (over button) "
+ "and custom per-colunm context menu (over column body).");
ImGuiTableFlags flags2 = ImGuiTableFlags_Resizable | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders;
if (ImGui::BeginTable("table_context_menu_2", COLUMNS_COUNT, flags2))
{
@@ -5043,18 +6959,25 @@ static void ShowDemoWindowTables()
if (ImGui::TreeNode("Synced instances"))
{
HelpMarker("Multiple tables with the same identifier will share their settings, width, visibility, order etc.");
+
+ static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoSavedSettings;
+ ImGui::CheckboxFlags("ImGuiTableFlags_Resizable", &flags, ImGuiTableFlags_Resizable);
+ ImGui::CheckboxFlags("ImGuiTableFlags_ScrollY", &flags, ImGuiTableFlags_ScrollY);
+ ImGui::CheckboxFlags("ImGuiTableFlags_SizingFixedFit", &flags, ImGuiTableFlags_SizingFixedFit);
+ ImGui::CheckboxFlags("ImGuiTableFlags_HighlightHoveredColumn", &flags, ImGuiTableFlags_HighlightHoveredColumn);
for (int n = 0; n < 3; n++)
{
char buf[32];
sprintf(buf, "Synced Table %d", n);
bool open = ImGui::CollapsingHeader(buf, ImGuiTreeNodeFlags_DefaultOpen);
- if (open && ImGui::BeginTable("Table", 3, ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoSavedSettings))
+ if (open && ImGui::BeginTable("Table", 3, flags, ImVec2(0.0f, ImGui::GetTextLineHeightWithSpacing() * 5)))
{
ImGui::TableSetupColumn("One");
ImGui::TableSetupColumn("Two");
ImGui::TableSetupColumn("Three");
ImGui::TableHeadersRow();
- for (int cell = 0; cell < 9; cell++)
+ const int cell_count = (n == 1) ? 27 : 9; // Make second table have a scrollbar to verify that additional decoration is not affecting column positions.
+ for (int cell = 0; cell < cell_count; cell++)
{
ImGui::TableNextColumn();
ImGui::Text("this cell %d", cell);
@@ -5122,14 +7045,11 @@ static void ShowDemoWindowTables()
ImGui::TableHeadersRow();
// Sort our data if sort specs have been changed!
- if (ImGuiTableSortSpecs* sorts_specs = ImGui::TableGetSortSpecs())
- if (sorts_specs->SpecsDirty)
+ if (ImGuiTableSortSpecs* sort_specs = ImGui::TableGetSortSpecs())
+ if (sort_specs->SpecsDirty)
{
- MyItem::s_current_sort_specs = sorts_specs; // Store in variable accessible by the sort function.
- if (items.Size > 1)
- qsort(&items[0], (size_t)items.Size, sizeof(items[0]), MyItem::CompareWithSortSpecs);
- MyItem::s_current_sort_specs = NULL;
- sorts_specs->SpecsDirty = false;
+ MyItem::SortWithSortSpecs(sort_specs, items.Data, items.Size);
+ sort_specs->SpecsDirty = false;
}
// Demonstrate using clipper for large vertical lists
@@ -5172,6 +7092,7 @@ static void ShowDemoWindowTables()
| ImGuiTableFlags_RowBg | ImGuiTableFlags_Borders | ImGuiTableFlags_NoBordersInBody
| ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY
| ImGuiTableFlags_SizingFixedFit;
+ static ImGuiTableColumnFlags columns_base_flags = ImGuiTableColumnFlags_None;
enum ContentsType { CT_Text, CT_Button, CT_SmallButton, CT_FillButton, CT_Selectable, CT_SelectableSpanRow };
static int contents_type = CT_SelectableSpanRow;
@@ -5265,9 +7186,17 @@ static void ShowDemoWindowTables()
ImGui::TreePop();
}
- if (ImGui::TreeNodeEx("Other:", ImGuiTreeNodeFlags_DefaultOpen))
+ if (ImGui::TreeNodeEx("Headers:", ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::Checkbox("show_headers", &show_headers);
+ ImGui::CheckboxFlags("ImGuiTableFlags_HighlightHoveredColumn", &flags, ImGuiTableFlags_HighlightHoveredColumn);
+ ImGui::CheckboxFlags("ImGuiTableColumnFlags_AngledHeader", &columns_base_flags, ImGuiTableColumnFlags_AngledHeader);
+ ImGui::SameLine(); HelpMarker("Enable AngledHeader on all columns. Best enabled on selected narrow columns (see \"Angled headers\" section of the demo).");
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNodeEx("Other:", ImGuiTreeNodeFlags_DefaultOpen))
+ {
ImGui::Checkbox("show_wrapped_text", &show_wrapped_text);
ImGui::DragFloat2("##OuterSize", &outer_size_value.x);
@@ -5328,24 +7257,22 @@ static void ShowDemoWindowTables()
// Declare columns
// We use the "user_id" parameter of TableSetupColumn() to specify a user id that will be stored in the sort specifications.
// This is so our sort function can identify a column given our own identifier. We could also identify them based on their index!
- ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_DefaultSort | ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHide, 0.0f, MyItemColumnID_ID);
- ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_Name);
- ImGui::TableSetupColumn("Action", ImGuiTableColumnFlags_NoSort | ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_Action);
- ImGui::TableSetupColumn("Quantity", ImGuiTableColumnFlags_PreferSortDescending, 0.0f, MyItemColumnID_Quantity);
- ImGui::TableSetupColumn("Description", (flags & ImGuiTableFlags_NoHostExtendX) ? 0 : ImGuiTableColumnFlags_WidthStretch, 0.0f, MyItemColumnID_Description);
- ImGui::TableSetupColumn("Hidden", ImGuiTableColumnFlags_DefaultHide | ImGuiTableColumnFlags_NoSort);
+ ImGui::TableSetupColumn("ID", columns_base_flags | ImGuiTableColumnFlags_DefaultSort | ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHide, 0.0f, MyItemColumnID_ID);
+ ImGui::TableSetupColumn("Name", columns_base_flags | ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_Name);
+ ImGui::TableSetupColumn("Action", columns_base_flags | ImGuiTableColumnFlags_NoSort | ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_Action);
+ ImGui::TableSetupColumn("Quantity", columns_base_flags | ImGuiTableColumnFlags_PreferSortDescending, 0.0f, MyItemColumnID_Quantity);
+ ImGui::TableSetupColumn("Description", columns_base_flags | ((flags & ImGuiTableFlags_NoHostExtendX) ? 0 : ImGuiTableColumnFlags_WidthStretch), 0.0f, MyItemColumnID_Description);
+ ImGui::TableSetupColumn("Hidden", columns_base_flags | ImGuiTableColumnFlags_DefaultHide | ImGuiTableColumnFlags_NoSort);
ImGui::TableSetupScrollFreeze(freeze_cols, freeze_rows);
// Sort our data if sort specs have been changed!
- ImGuiTableSortSpecs* sorts_specs = ImGui::TableGetSortSpecs();
- if (sorts_specs && sorts_specs->SpecsDirty)
+ ImGuiTableSortSpecs* sort_specs = ImGui::TableGetSortSpecs();
+ if (sort_specs && sort_specs->SpecsDirty)
items_need_sort = true;
- if (sorts_specs && items_need_sort && items.Size > 1)
+ if (sort_specs && items_need_sort && items.Size > 1)
{
- MyItem::s_current_sort_specs = sorts_specs; // Store in variable accessible by the sort function.
- qsort(&items[0], (size_t)items.Size, sizeof(items[0]), MyItem::CompareWithSortSpecs);
- MyItem::s_current_sort_specs = NULL;
- sorts_specs->SpecsDirty = false;
+ MyItem::SortWithSortSpecs(sort_specs, items.Data, items.Size);
+ sort_specs->SpecsDirty = false;
}
items_need_sort = false;
@@ -5354,12 +7281,13 @@ static void ShowDemoWindowTables()
const bool sorts_specs_using_quantity = (ImGui::TableGetColumnFlags(3) & ImGuiTableColumnFlags_IsSorted) != 0;
// Show headers
+ if (show_headers && (columns_base_flags & ImGuiTableColumnFlags_AngledHeader) != 0)
+ ImGui::TableAngledHeadersRow();
if (show_headers)
ImGui::TableHeadersRow();
// Show data
// FIXME-TABLE FIXME-NAV: How we can get decent up/down even though we have the buttons here?
- ImGui::PushButtonRepeat(true);
#if 1
// Demonstrate using clipper for large vertical lists
ImGuiListClipper clipper;
@@ -5395,7 +7323,7 @@ static void ShowDemoWindowTables()
ImGui::Button(label, ImVec2(-FLT_MIN, 0.0f));
else if (contents_type == CT_Selectable || contents_type == CT_SelectableSpanRow)
{
- ImGuiSelectableFlags selectable_flags = (contents_type == CT_SelectableSpanRow) ? ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowItemOverlap : ImGuiSelectableFlags_None;
+ ImGuiSelectableFlags selectable_flags = (contents_type == CT_SelectableSpanRow) ? ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap : ImGuiSelectableFlags_None;
if (ImGui::Selectable(label, item_is_selected, selectable_flags, ImVec2(0, row_min_height)))
{
if (ImGui::GetIO().KeyCtrl)
@@ -5419,7 +7347,7 @@ static void ShowDemoWindowTables()
// Here we demonstrate marking our data set as needing to be sorted again if we modified a quantity,
// and we are currently sorting on the column showing the Quantity.
// To avoid triggering a sort while holding the button, we only trigger it when the button has been released.
- // You will probably need a more advanced system in your code if you want to automatically sort when a specific entry changes.
+ // You will probably need some extra logic if you want to automatically sort when a specific entry changes.
if (ImGui::TableSetColumnIndex(2))
{
if (ImGui::SmallButton("Chop")) { item->Quantity += 1; }
@@ -5444,7 +7372,6 @@ static void ShowDemoWindowTables()
ImGui::PopID();
}
}
- ImGui::PopButtonRepeat();
// Store some info to display debug details below
table_scroll_cur = ImVec2(ImGui::GetScrollX(), ImGui::GetScrollY());
@@ -5470,7 +7397,7 @@ static void ShowDemoWindowTables()
ImGui::PopID();
- ShowDemoWindowColumns();
+ DemoWindowColumns();
if (disable_indent)
ImGui::PopStyleVar();
@@ -5478,7 +7405,7 @@ static void ShowDemoWindowTables()
// Demonstrate old/legacy Columns API!
// [2020: Columns are under-featured and not maintained. Prefer using the more flexible and powerful BeginTable() API!]
-static void ShowDemoWindowColumns()
+static void DemoWindowColumns()
{
IMGUI_DEMO_MARKER("Columns (legacy API)");
bool open = ImGui::TreeNode("Legacy Columns API");
@@ -5554,12 +7481,14 @@ static void ShowDemoWindowColumns()
{
if (h_borders && ImGui::GetColumnIndex() == 0)
ImGui::Separator();
+ ImGui::PushID(i);
ImGui::Text("%c%c%c", 'a' + i, 'a' + i, 'a' + i);
ImGui::Text("Width %.2f", ImGui::GetColumnWidth());
ImGui::Text("Avail %.2f", ImGui::GetContentRegionAvail().x);
ImGui::Text("Offset %.2f", ImGui::GetColumnOffset());
ImGui::Text("Long text that is likely to clip");
ImGui::Button("Button", ImVec2(-FLT_MIN, 0.0f));
+ ImGui::PopID();
ImGui::NextColumn();
}
ImGui::Columns(1);
@@ -5621,7 +7550,7 @@ static void ShowDemoWindowColumns()
{
ImGui::SetNextWindowContentSize(ImVec2(1500.0f, 0.0f));
ImVec2 child_size = ImVec2(0, ImGui::GetFontSize() * 20.0f);
- ImGui::BeginChild("##ScrollingRegion", child_size, false, ImGuiWindowFlags_HorizontalScrollbar);
+ ImGui::BeginChild("##ScrollingRegion", child_size, ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar);
ImGui::Columns(10);
// Also demonstrate using clipper for large vertical lists
@@ -5682,19 +7611,65 @@ static void ShowDemoWindowColumns()
ImGui::TreePop();
}
-namespace ImGui { extern ImGuiKeyData* GetKeyData(ImGuiKey key); }
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowInputs()
+//-----------------------------------------------------------------------------
-static void ShowDemoWindowInputs()
+static void DemoWindowInputs()
{
- IMGUI_DEMO_MARKER("Inputs, Navigation & Focus");
- if (ImGui::CollapsingHeader("Inputs, Navigation & Focus"))
+ IMGUI_DEMO_MARKER("Inputs & Focus");
+ if (ImGui::CollapsingHeader("Inputs & Focus"))
{
ImGuiIO& io = ImGui::GetIO();
+ // Display inputs submitted to ImGuiIO
+ IMGUI_DEMO_MARKER("Inputs & Focus/Inputs");
+ ImGui::SetNextItemOpen(true, ImGuiCond_Once);
+ bool inputs_opened = ImGui::TreeNode("Inputs");
+ ImGui::SameLine();
+ HelpMarker(
+ "This is a simplified view. See more detailed input state:\n"
+ "- in 'Tools->Metrics/Debugger->Inputs'.\n"
+ "- in 'Tools->Debug Log->IO'.");
+ if (inputs_opened)
+ {
+ if (ImGui::IsMousePosValid())
+ ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y);
+ else
+ ImGui::Text("Mouse pos: <INVALID>");
+ ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y);
+ ImGui::Text("Mouse down:");
+ for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDown(i)) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); }
+ ImGui::Text("Mouse wheel: %.1f", io.MouseWheel);
+ ImGui::Text("Mouse clicked count:");
+ for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (io.MouseClickedCount[i] > 0) { ImGui::SameLine(); ImGui::Text("b%d: %d", i, io.MouseClickedCount[i]); }
+
+ // We iterate both legacy native range and named ImGuiKey ranges. This is a little unusual/odd but this allows
+ // displaying the data for old/new backends.
+ // User code should never have to go through such hoops!
+ // You can generally iterate between ImGuiKey_NamedKey_BEGIN and ImGuiKey_NamedKey_END.
+ struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } };
+ ImGuiKey start_key = ImGuiKey_NamedKey_BEGIN;
+ ImGui::Text("Keys down:"); for (ImGuiKey key = start_key; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); }
+ ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : "");
+ ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public.
+
+ ImGui::TreePop();
+ }
+
// Display ImGuiIO output flags
- IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Output");
+ IMGUI_DEMO_MARKER("Inputs & Focus/Outputs");
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
- if (ImGui::TreeNode("Output"))
+ bool outputs_opened = ImGui::TreeNode("Outputs");
+ ImGui::SameLine();
+ HelpMarker(
+ "The value of io.WantCaptureMouse and io.WantCaptureKeyboard are normally set by Dear ImGui "
+ "to instruct your application of how to route inputs. Typically, when a value is true, it means "
+ "Dear ImGui wants the corresponding inputs and we expect the underlying application to ignore them.\n\n"
+ "The most typical case is: when hovering a window, Dear ImGui set io.WantCaptureMouse to true, "
+ "and underlying application should ignore mouse inputs (in practice there are many and more subtle "
+ "rules leading to how those flags are set).");
+ if (outputs_opened)
{
ImGui::Text("io.WantCaptureMouse: %d", io.WantCaptureMouse);
ImGui::Text("io.WantCaptureMouseUnlessPopupClose: %d", io.WantCaptureMouseUnlessPopupClose);
@@ -5702,37 +7677,139 @@ static void ShowDemoWindowInputs()
ImGui::Text("io.WantTextInput: %d", io.WantTextInput);
ImGui::Text("io.WantSetMousePos: %d", io.WantSetMousePos);
ImGui::Text("io.NavActive: %d, io.NavVisible: %d", io.NavActive, io.NavVisible);
+
+ IMGUI_DEMO_MARKER("Inputs & Focus/Outputs/WantCapture override");
+ if (ImGui::TreeNode("WantCapture override"))
+ {
+ HelpMarker(
+ "Hovering the colored canvas will override io.WantCaptureXXX fields.\n"
+ "Notice how normally (when set to none), the value of io.WantCaptureKeyboard would be false when hovering "
+ "and true when clicking.");
+ static int capture_override_mouse = -1;
+ static int capture_override_keyboard = -1;
+ const char* capture_override_desc[] = { "None", "Set to false", "Set to true" };
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
+ ImGui::SliderInt("SetNextFrameWantCaptureMouse() on hover", &capture_override_mouse, -1, +1, capture_override_desc[capture_override_mouse + 1], ImGuiSliderFlags_AlwaysClamp);
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
+ ImGui::SliderInt("SetNextFrameWantCaptureKeyboard() on hover", &capture_override_keyboard, -1, +1, capture_override_desc[capture_override_keyboard + 1], ImGuiSliderFlags_AlwaysClamp);
+
+ ImGui::ColorButton("##panel", ImVec4(0.7f, 0.1f, 0.7f, 1.0f), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoDragDrop, ImVec2(128.0f, 96.0f)); // Dummy item
+ if (ImGui::IsItemHovered() && capture_override_mouse != -1)
+ ImGui::SetNextFrameWantCaptureMouse(capture_override_mouse == 1);
+ if (ImGui::IsItemHovered() && capture_override_keyboard != -1)
+ ImGui::SetNextFrameWantCaptureKeyboard(capture_override_keyboard == 1);
+
+ ImGui::TreePop();
+ }
ImGui::TreePop();
}
- // Display Mouse state
- IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Mouse State");
- if (ImGui::TreeNode("Mouse State"))
- {
- if (ImGui::IsMousePosValid())
- ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y);
- else
- ImGui::Text("Mouse pos: <INVALID>");
- ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y);
+ // Demonstrate using Shortcut() and Routing Policies.
+ // The general flow is:
+ // - Code interested in a chord (e.g. "Ctrl+A") declares their intent.
+ // - Multiple locations may be interested in same chord! Routing helps find a winner.
+ // - Every frame, we resolve all claims and assign one owner if the modifiers are matching.
+ // - The lower-level function is 'bool SetShortcutRouting()', returns true when caller got the route.
+ // - Most of the times, SetShortcutRouting() is not called directly. User mostly calls Shortcut() with routing flags.
+ // - If you call Shortcut() WITHOUT any routing option, it uses ImGuiInputFlags_RouteFocused.
+ // TL;DR: Most uses will simply be:
+ // - Shortcut(ImGuiMod_Ctrl | ImGuiKey_A); // Use ImGuiInputFlags_RouteFocused policy.
+ IMGUI_DEMO_MARKER("Inputs & Focus/Shortcuts");
+ if (ImGui::TreeNode("Shortcuts"))
+ {
+ static ImGuiInputFlags route_options = ImGuiInputFlags_Repeat;
+ static ImGuiInputFlags route_type = ImGuiInputFlags_RouteFocused;
+ ImGui::CheckboxFlags("ImGuiInputFlags_Repeat", &route_options, ImGuiInputFlags_Repeat);
+ ImGui::RadioButton("ImGuiInputFlags_RouteActive", &route_type, ImGuiInputFlags_RouteActive);
+ ImGui::RadioButton("ImGuiInputFlags_RouteFocused (default)", &route_type, ImGuiInputFlags_RouteFocused);
+ ImGui::RadioButton("ImGuiInputFlags_RouteGlobal", &route_type, ImGuiInputFlags_RouteGlobal);
+ ImGui::Indent();
+ ImGui::BeginDisabled(route_type != ImGuiInputFlags_RouteGlobal);
+ ImGui::CheckboxFlags("ImGuiInputFlags_RouteOverFocused", &route_options, ImGuiInputFlags_RouteOverFocused);
+ ImGui::CheckboxFlags("ImGuiInputFlags_RouteOverActive", &route_options, ImGuiInputFlags_RouteOverActive);
+ ImGui::CheckboxFlags("ImGuiInputFlags_RouteUnlessBgFocused", &route_options, ImGuiInputFlags_RouteUnlessBgFocused);
+ ImGui::EndDisabled();
+ ImGui::Unindent();
+ ImGui::RadioButton("ImGuiInputFlags_RouteAlways", &route_type, ImGuiInputFlags_RouteAlways);
+ ImGuiInputFlags flags = route_type | route_options; // Merged flags
+ if (route_type != ImGuiInputFlags_RouteGlobal)
+ flags &= ~(ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused);
+
+ ImGui::SeparatorText("Using SetNextItemShortcut()");
+ ImGui::Text("Ctrl+S");
+ ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_S, flags | ImGuiInputFlags_Tooltip);
+ ImGui::Button("Save");
+ ImGui::Text("Alt+F");
+ ImGui::SetNextItemShortcut(ImGuiMod_Alt | ImGuiKey_F, flags | ImGuiInputFlags_Tooltip);
+ static float f = 0.5f;
+ ImGui::SliderFloat("Factor", &f, 0.0f, 1.0f);
+
+ ImGui::SeparatorText("Using Shortcut()");
+ const float line_height = ImGui::GetTextLineHeightWithSpacing();
+ const ImGuiKeyChord key_chord = ImGuiMod_Ctrl | ImGuiKey_A;
+
+ ImGui::Text("Ctrl+A");
+ ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags) ? "PRESSED" : "...");
+
+ ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(1.0f, 0.0f, 1.0f, 0.1f));
+
+ ImGui::BeginChild("WindowA", ImVec2(-FLT_MIN, line_height * 14), true);
+ ImGui::Text("Press CTRL+A and see who receives it!");
+ ImGui::Separator();
+
+ // 1: Window polling for CTRL+A
+ ImGui::Text("(in WindowA)");
+ ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags) ? "PRESSED" : "...");
+
+ // 2: InputText also polling for CTRL+A: it always uses _RouteFocused internally (gets priority when active)
+ // (Commmented because the owner-aware version of Shortcut() is still in imgui_internal.h)
+ //char str[16] = "Press CTRL+A";
+ //ImGui::Spacing();
+ //ImGui::InputText("InputTextB", str, IM_ARRAYSIZE(str), ImGuiInputTextFlags_ReadOnly);
+ //ImGuiID item_id = ImGui::GetItemID();
+ //ImGui::SameLine(); HelpMarker("Internal widgets always use _RouteFocused");
+ //ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags, item_id) ? "PRESSED" : "...");
+
+ // 3: Dummy child is not claiming the route: focusing them shouldn't steal route away from WindowA
+ ImGui::BeginChild("ChildD", ImVec2(-FLT_MIN, line_height * 4), true);
+ ImGui::Text("(in ChildD: not using same Shortcut)");
+ ImGui::Text("IsWindowFocused: %d", ImGui::IsWindowFocused());
+ ImGui::EndChild();
+
+ // 4: Child window polling for CTRL+A. It is deeper than WindowA and gets priority when focused.
+ ImGui::BeginChild("ChildE", ImVec2(-FLT_MIN, line_height * 4), true);
+ ImGui::Text("(in ChildE: using same Shortcut)");
+ ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags) ? "PRESSED" : "...");
+ ImGui::EndChild();
+
+ // 5: In a popup
+ if (ImGui::Button("Open Popup"))
+ ImGui::OpenPopup("PopupF");
+ if (ImGui::BeginPopup("PopupF"))
+ {
+ ImGui::Text("(in PopupF)");
+ ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags) ? "PRESSED" : "...");
+ // (Commmented because the owner-aware version of Shortcut() is still in imgui_internal.h)
+ //ImGui::InputText("InputTextG", str, IM_ARRAYSIZE(str), ImGuiInputTextFlags_ReadOnly);
+ //ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags, ImGui::GetItemID()) ? "PRESSED" : "...");
+ ImGui::EndPopup();
+ }
+ ImGui::EndChild();
+ ImGui::PopStyleColor();
- int count = IM_ARRAYSIZE(io.MouseDown);
- ImGui::Text("Mouse down:"); for (int i = 0; i < count; i++) if (ImGui::IsMouseDown(i)) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); }
- ImGui::Text("Mouse clicked:"); for (int i = 0; i < count; i++) if (ImGui::IsMouseClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d (%d)", i, ImGui::GetMouseClickedCount(i)); }
- ImGui::Text("Mouse released:"); for (int i = 0; i < count; i++) if (ImGui::IsMouseReleased(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
- ImGui::Text("Mouse wheel: %.1f", io.MouseWheel);
- ImGui::Text("Pen Pressure: %.1f", io.PenPressure); // Note: currently unused
ImGui::TreePop();
}
// Display mouse cursors
- IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Mouse Cursors");
+ IMGUI_DEMO_MARKER("Inputs & Focus/Mouse Cursors");
if (ImGui::TreeNode("Mouse Cursors"))
{
- const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "NotAllowed" };
+ const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "Wait", "Progress", "NotAllowed" };
IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_COUNT);
ImGuiMouseCursor current = ImGui::GetMouseCursor();
- ImGui::Text("Current mouse cursor = %d: %s", current, mouse_cursors_names[current]);
+ const char* cursor_name = (current >= ImGuiMouseCursor_Arrow) && (current < ImGuiMouseCursor_COUNT) ? mouse_cursors_names[current] : "N/A";
+ ImGui::Text("Current mouse cursor = %d: %s", current, cursor_name);
ImGui::BeginDisabled(true);
ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", &io.BackendFlags, ImGuiBackendFlags_HasMouseCursors);
ImGui::EndDisabled();
@@ -5753,113 +7830,7 @@ static void ShowDemoWindowInputs()
ImGui::TreePop();
}
- // Display Keyboard/Mouse state
- IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Keyboard, Gamepad & Navigation State");
- if (ImGui::TreeNode("Keyboard, Gamepad & Navigation State"))
- {
- // We iterate both legacy native range and named ImGuiKey ranges, which is a little odd but this allows displaying the data for old/new backends.
- // User code should never have to go through such hoops: old code may use native keycodes, new code may use ImGuiKey codes.
-#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
- struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } };
- const ImGuiKey key_first = (ImGuiKey)ImGuiKey_NamedKey_BEGIN;
-#else
- struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array
- const ImGuiKey key_first = (ImGuiKey)0;
- //ImGui::Text("Legacy raw:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key++) { if (io.KeysDown[key]) { ImGui::SameLine(); ImGui::Text("\"%s\" %d", ImGui::GetKeyName(key), key); } }
-#endif
- ImGui::Text("Keys down:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key)) continue; if (ImGui::IsKeyDown(key)) { ImGui::SameLine(); ImGui::Text("\"%s\" %d (%.02f)", ImGui::GetKeyName(key), key, ImGui::GetKeyData(key)->DownDuration); } }
- ImGui::Text("Keys pressed:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key)) continue; if (ImGui::IsKeyPressed(key)) { ImGui::SameLine(); ImGui::Text("\"%s\" %d", ImGui::GetKeyName(key), key); } }
- ImGui::Text("Keys released:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key)) continue; if (ImGui::IsKeyReleased(key)) { ImGui::SameLine(); ImGui::Text("\"%s\" %d", ImGui::GetKeyName(key), key); } }
- ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : "");
- ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public.
-
- // Draw an arbitrary US keyboard layout to visualize translated keys
- {
- const ImVec2 key_size = ImVec2(35.0f, 35.0f);
- const float key_rounding = 3.0f;
- const ImVec2 key_face_size = ImVec2(25.0f, 25.0f);
- const ImVec2 key_face_pos = ImVec2(5.0f, 3.0f);
- const float key_face_rounding = 2.0f;
- const ImVec2 key_label_pos = ImVec2(7.0f, 4.0f);
- const ImVec2 key_step = ImVec2(key_size.x - 1.0f, key_size.y - 1.0f);
- const float key_row_offset = 9.0f;
-
- ImVec2 board_min = ImGui::GetCursorScreenPos();
- ImVec2 board_max = ImVec2(board_min.x + 3 * key_step.x + 2 * key_row_offset + 10.0f, board_min.y + 3 * key_step.y + 10.0f);
- ImVec2 start_pos = ImVec2(board_min.x + 5.0f - key_step.x, board_min.y);
-
- struct KeyLayoutData { int Row, Col; const char* Label; ImGuiKey Key; };
- const KeyLayoutData keys_to_display[] =
- {
- { 0, 0, "", ImGuiKey_Tab }, { 0, 1, "Q", ImGuiKey_Q }, { 0, 2, "W", ImGuiKey_W }, { 0, 3, "E", ImGuiKey_E }, { 0, 4, "R", ImGuiKey_R },
- { 1, 0, "", ImGuiKey_CapsLock }, { 1, 1, "A", ImGuiKey_A }, { 1, 2, "S", ImGuiKey_S }, { 1, 3, "D", ImGuiKey_D }, { 1, 4, "F", ImGuiKey_F },
- { 2, 0, "", ImGuiKey_LeftShift },{ 2, 1, "Z", ImGuiKey_Z }, { 2, 2, "X", ImGuiKey_X }, { 2, 3, "C", ImGuiKey_C }, { 2, 4, "V", ImGuiKey_V }
- };
-
- // Elements rendered manually via ImDrawList API are not clipped automatically.
- // While not strictly necessary, here IsItemVisible() is used to avoid rendering these shapes when they are out of view.
- ImGui::Dummy(ImVec2(board_max.x - board_min.x, board_max.y - board_min.y));
- if (ImGui::IsItemVisible())
- {
- ImDrawList* draw_list = ImGui::GetWindowDrawList();
- draw_list->PushClipRect(board_min, board_max, true);
- for (int n = 0; n < IM_ARRAYSIZE(keys_to_display); n++)
- {
- const KeyLayoutData* key_data = &keys_to_display[n];
- ImVec2 key_min = ImVec2(start_pos.x + key_data->Col * key_step.x + key_data->Row * key_row_offset, start_pos.y + key_data->Row * key_step.y);
- ImVec2 key_max = ImVec2(key_min.x + key_size.x, key_min.y + key_size.y);
- draw_list->AddRectFilled(key_min, key_max, IM_COL32(204, 204, 204, 255), key_rounding);
- draw_list->AddRect(key_min, key_max, IM_COL32(24, 24, 24, 255), key_rounding);
- ImVec2 face_min = ImVec2(key_min.x + key_face_pos.x, key_min.y + key_face_pos.y);
- ImVec2 face_max = ImVec2(face_min.x + key_face_size.x, face_min.y + key_face_size.y);
- draw_list->AddRect(face_min, face_max, IM_COL32(193, 193, 193, 255), key_face_rounding, ImDrawFlags_None, 2.0f);
- draw_list->AddRectFilled(face_min, face_max, IM_COL32(252, 252, 252, 255), key_face_rounding);
- ImVec2 label_min = ImVec2(key_min.x + key_label_pos.x, key_min.y + key_label_pos.y);
- draw_list->AddText(label_min, IM_COL32(64, 64, 64, 255), key_data->Label);
- if (ImGui::IsKeyDown(key_data->Key))
- draw_list->AddRectFilled(key_min, key_max, IM_COL32(255, 0, 0, 128), key_rounding);
- }
- draw_list->PopClipRect();
- }
- }
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Capture override"))
- {
- HelpMarker(
- "The value of io.WantCaptureMouse and io.WantCaptureKeyboard are normally set by Dear ImGui "
- "to instruct your application of how to route inputs. Typically, when a value is true, it means "
- "Dear ImGui wants the corresponding inputs and we expect the underlying application to ignore them.\n\n"
- "The most typical case is: when hovering a window, Dear ImGui set io.WantCaptureMouse to true, "
- "and underlying application should ignore mouse inputs (in practice there are many and more subtle "
- "rules leading to how those flags are set).");
-
- ImGui::Text("io.WantCaptureMouse: %d", io.WantCaptureMouse);
- ImGui::Text("io.WantCaptureMouseUnlessPopupClose: %d", io.WantCaptureMouseUnlessPopupClose);
- ImGui::Text("io.WantCaptureKeyboard: %d", io.WantCaptureKeyboard);
-
- HelpMarker(
- "Hovering the colored canvas will override io.WantCaptureXXX fields.\n"
- "Notice how normally (when set to none), the value of io.WantCaptureKeyboard would be false when hovering and true when clicking.");
- static int capture_override_mouse = -1;
- static int capture_override_keyboard = -1;
- const char* capture_override_desc[] = { "None", "Set to false", "Set to true" };
- ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
- ImGui::SliderInt("SetNextFrameWantCaptureMouse()", &capture_override_mouse, -1, +1, capture_override_desc[capture_override_mouse + 1], ImGuiSliderFlags_AlwaysClamp);
- ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
- ImGui::SliderInt("SetNextFrameWantCaptureKeyboard()", &capture_override_keyboard, -1, +1, capture_override_desc[capture_override_keyboard + 1], ImGuiSliderFlags_AlwaysClamp);
-
- ImGui::ColorButton("##panel", ImVec4(0.7f, 0.1f, 0.7f, 1.0f), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoDragDrop, ImVec2(256.0f, 192.0f)); // Dummy item
- if (ImGui::IsItemHovered() && capture_override_mouse != -1)
- ImGui::SetNextFrameWantCaptureMouse(capture_override_mouse == 1);
- if (ImGui::IsItemHovered() && capture_override_keyboard != -1)
- ImGui::SetNextFrameWantCaptureKeyboard(capture_override_keyboard == 1);
-
- ImGui::TreePop();
- }
-
- IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Tabbing");
+ IMGUI_DEMO_MARKER("Inputs & Focus/Tabbing");
if (ImGui::TreeNode("Tabbing"))
{
ImGui::Text("Use TAB/SHIFT+TAB to cycle through keyboard editable fields.");
@@ -5867,15 +7838,15 @@ static void ShowDemoWindowInputs()
ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
ImGui::InputText("3", buf, IM_ARRAYSIZE(buf));
- ImGui::PushAllowKeyboardFocus(false);
+ ImGui::PushItemFlag(ImGuiItemFlags_NoTabStop, true);
ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf));
ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab.");
- ImGui::PopAllowKeyboardFocus();
+ ImGui::PopItemFlag();
ImGui::InputText("5", buf, IM_ARRAYSIZE(buf));
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Focus from code");
+ IMGUI_DEMO_MARKER("Inputs & Focus/Focus from code");
if (ImGui::TreeNode("Focus from code"))
{
bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine();
@@ -5892,12 +7863,12 @@ static void ShowDemoWindowInputs()
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
if (ImGui::IsItemActive()) has_focus = 2;
- ImGui::PushAllowKeyboardFocus(false);
+ ImGui::PushItemFlag(ImGuiItemFlags_NoTabStop, true);
if (focus_3) ImGui::SetKeyboardFocusHere();
ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf));
if (ImGui::IsItemActive()) has_focus = 3;
ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab.");
- ImGui::PopAllowKeyboardFocus();
+ ImGui::PopItemFlag();
if (has_focus)
ImGui::Text("Item with focus: %d", has_focus);
@@ -5917,7 +7888,7 @@ static void ShowDemoWindowInputs()
ImGui::TreePop();
}
- IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Dragging");
+ IMGUI_DEMO_MARKER("Inputs & Focus/Dragging");
if (ImGui::TreeNode("Dragging"))
{
ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget.");
@@ -5961,10 +7932,23 @@ void ImGui::ShowAboutWindow(bool* p_open)
return;
}
IMGUI_DEMO_MARKER("Tools/About Dear ImGui");
- ImGui::Text("Dear ImGui %s", ImGui::GetVersion());
+ ImGui::Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM);
+
+ ImGui::TextLinkOpenURL("Homepage", "https://github.com/ocornut/imgui");
+ ImGui::SameLine();
+ ImGui::TextLinkOpenURL("FAQ", "https://github.com/ocornut/imgui/blob/master/docs/FAQ.md");
+ ImGui::SameLine();
+ ImGui::TextLinkOpenURL("Wiki", "https://github.com/ocornut/imgui/wiki");
+ ImGui::SameLine();
+ ImGui::TextLinkOpenURL("Releases", "https://github.com/ocornut/imgui/releases");
+ ImGui::SameLine();
+ ImGui::TextLinkOpenURL("Funding", "https://github.com/ocornut/imgui/wiki/Funding");
+
ImGui::Separator();
- ImGui::Text("By Omar Cornut and all Dear ImGui contributors.");
+ ImGui::Text("(c) 2014-2025 Omar Cornut");
+ ImGui::Text("Developed by Omar Cornut and all Dear ImGui contributors.");
ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
+ ImGui::Text("If your company uses this, please consider funding the project.");
static bool show_config_info = false;
ImGui::Checkbox("Config/Build Information", &show_config_info);
@@ -5975,7 +7959,7 @@ void ImGui::ShowAboutWindow(bool* p_open)
bool copy_to_clipboard = ImGui::Button("Copy to clipboard");
ImVec2 child_size = ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 18);
- ImGui::BeginChildFrame(ImGui::GetID("cfg_infos"), child_size, ImGuiWindowFlags_NoMove);
+ ImGui::BeginChild(ImGui::GetID("cfg_infos"), child_size, ImGuiChildFlags_FrameStyle);
if (copy_to_clipboard)
{
ImGui::LogToClipboard();
@@ -5989,9 +7973,6 @@ void ImGui::ShowAboutWindow(bool* p_open)
#ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
ImGui::Text("define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS");
#endif
-#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
- ImGui::Text("define: IMGUI_DISABLE_OBSOLETE_KEYIO");
-#endif
#ifdef IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
ImGui::Text("define: IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS");
#endif
@@ -6001,6 +7982,9 @@ void ImGui::ShowAboutWindow(bool* p_open)
#ifdef IMGUI_DISABLE_WIN32_FUNCTIONS
ImGui::Text("define: IMGUI_DISABLE_WIN32_FUNCTIONS");
#endif
+#ifdef IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
+ ImGui::Text("define: IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS");
+#endif
#ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
ImGui::Text("define: IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS");
#endif
@@ -6049,18 +8033,23 @@ void ImGui::ShowAboutWindow(bool* p_open)
#ifdef __clang_version__
ImGui::Text("define: __clang_version__=%s", __clang_version__);
#endif
+#ifdef __EMSCRIPTEN__
+ ImGui::Text("define: __EMSCRIPTEN__");
+ ImGui::Text("Emscripten: %d.%d.%d", __EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__);
+#endif
ImGui::Separator();
ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL");
ImGui::Text("io.BackendRendererName: %s", io.BackendRendererName ? io.BackendRendererName : "NULL");
ImGui::Text("io.ConfigFlags: 0x%08X", io.ConfigFlags);
if (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) ImGui::Text(" NavEnableKeyboard");
if (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) ImGui::Text(" NavEnableGamepad");
- if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) ImGui::Text(" NavEnableSetMousePos");
- if (io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard) ImGui::Text(" NavNoCaptureKeyboard");
if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) ImGui::Text(" NoMouse");
if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) ImGui::Text(" NoMouseCursorChange");
+ if (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard) ImGui::Text(" NoKeyboard");
if (io.MouseDrawCursor) ImGui::Text("io.MouseDrawCursor");
if (io.ConfigMacOSXBehaviors) ImGui::Text("io.ConfigMacOSXBehaviors");
+ if (io.ConfigNavMoveSetMousePos) ImGui::Text("io.ConfigNavMoveSetMousePos");
+ if (io.ConfigNavCaptureKeyboard) ImGui::Text("io.ConfigNavCaptureKeyboard");
if (io.ConfigInputTextCursorBlink) ImGui::Text("io.ConfigInputTextCursorBlink");
if (io.ConfigWindowsResizeFromEdges) ImGui::Text("io.ConfigWindowsResizeFromEdges");
if (io.ConfigWindowsMoveFromTitleBarOnly) ImGui::Text("io.ConfigWindowsMoveFromTitleBarOnly");
@@ -6088,7 +8077,7 @@ void ImGui::ShowAboutWindow(bool* p_open)
ImGui::LogText("\n```\n");
ImGui::LogFinish();
}
- ImGui::EndChildFrame();
+ ImGui::EndChild();
}
ImGui::End();
}
@@ -6112,12 +8101,13 @@ void ImGui::ShowFontSelector(const char* label)
ImFont* font_current = ImGui::GetFont();
if (ImGui::BeginCombo(label, font_current->GetDebugName()))
{
- for (int n = 0; n < io.Fonts->Fonts.Size; n++)
+ for (ImFont* font : io.Fonts->Fonts)
{
- ImFont* font = io.Fonts->Fonts[n];
ImGui::PushID((void*)font);
if (ImGui::Selectable(font->GetDebugName(), font == font_current))
io.FontDefault = font;
+ if (font == font_current)
+ ImGui::SetItemDefaultFocus();
ImGui::PopID();
}
ImGui::EndCombo();
@@ -6197,44 +8187,80 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
{
if (ImGui::BeginTabItem("Sizes"))
{
- ImGui::Text("Main");
+ ImGui::SeparatorText("Main");
ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f");
- ImGui::SliderFloat2("CellPadding", (float*)&style.CellPadding, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f");
ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f");
- ImGui::Text("Borders");
+
+ ImGui::SeparatorText("Borders");
ImGui::SliderFloat("WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f, "%.0f");
ImGui::SliderFloat("ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f, "%.0f");
ImGui::SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f");
ImGui::SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f");
- ImGui::SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f");
- ImGui::Text("Rounding");
+
+ ImGui::SeparatorText("Rounding");
ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 12.0f, "%.0f");
ImGui::SliderFloat("ChildRounding", &style.ChildRounding, 0.0f, 12.0f, "%.0f");
ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f");
ImGui::SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 12.0f, "%.0f");
ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f");
ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f");
- ImGui::SliderFloat("LogSliderDeadzone", &style.LogSliderDeadzone, 0.0f, 12.0f, "%.0f");
+
+ ImGui::SeparatorText("Tabs");
+ ImGui::SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f");
+ ImGui::SliderFloat("TabBarBorderSize", &style.TabBarBorderSize, 0.0f, 2.0f, "%.0f");
+ ImGui::SliderFloat("TabBarOverlineSize", &style.TabBarOverlineSize, 0.0f, 3.0f, "%.0f");
+ ImGui::SameLine(); HelpMarker("Overline is only drawn over the selected tab when ImGuiTabBarFlags_DrawSelectedOverline is set.");
+ ImGui::DragFloat("TabCloseButtonMinWidthSelected", &style.TabCloseButtonMinWidthSelected, 0.1f, -1.0f, 100.0f, (style.TabCloseButtonMinWidthSelected < 0.0f) ? "%.0f (Always)" : "%.0f");
+ ImGui::DragFloat("TabCloseButtonMinWidthUnselected", &style.TabCloseButtonMinWidthUnselected, 0.1f, -1.0f, 100.0f, (style.TabCloseButtonMinWidthUnselected < 0.0f) ? "%.0f (Always)" : "%.0f");
ImGui::SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f");
- ImGui::Text("Alignment");
+
+ ImGui::SeparatorText("Tables");
+ ImGui::SliderFloat2("CellPadding", (float*)&style.CellPadding, 0.0f, 20.0f, "%.0f");
+ ImGui::SliderAngle("TableAngledHeadersAngle", &style.TableAngledHeadersAngle, -50.0f, +50.0f);
+ ImGui::SliderFloat2("TableAngledHeadersTextAlign", (float*)&style.TableAngledHeadersTextAlign, 0.0f, 1.0f, "%.2f");
+
+ ImGui::SeparatorText("Windows");
ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f");
+ ImGui::SliderFloat("WindowBorderHoverPadding", &style.WindowBorderHoverPadding, 1.0f, 20.0f, "%.0f");
int window_menu_button_position = style.WindowMenuButtonPosition + 1;
if (ImGui::Combo("WindowMenuButtonPosition", (int*)&window_menu_button_position, "None\0Left\0Right\0"))
- style.WindowMenuButtonPosition = window_menu_button_position - 1;
+ style.WindowMenuButtonPosition = (ImGuiDir)(window_menu_button_position - 1);
+
+ ImGui::SeparatorText("Widgets");
ImGui::Combo("ColorButtonPosition", (int*)&style.ColorButtonPosition, "Left\0Right\0");
ImGui::SliderFloat2("ButtonTextAlign", (float*)&style.ButtonTextAlign, 0.0f, 1.0f, "%.2f");
ImGui::SameLine(); HelpMarker("Alignment applies when a button is larger than its text content.");
ImGui::SliderFloat2("SelectableTextAlign", (float*)&style.SelectableTextAlign, 0.0f, 1.0f, "%.2f");
ImGui::SameLine(); HelpMarker("Alignment applies when a selectable is larger than its text content.");
- ImGui::Text("Safe Area Padding");
- ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).");
- ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f");
+ ImGui::SliderFloat("SeparatorTextBorderSize", &style.SeparatorTextBorderSize, 0.0f, 10.0f, "%.0f");
+ ImGui::SliderFloat2("SeparatorTextAlign", (float*)&style.SeparatorTextAlign, 0.0f, 1.0f, "%.2f");
+ ImGui::SliderFloat2("SeparatorTextPadding", (float*)&style.SeparatorTextPadding, 0.0f, 40.0f, "%.0f");
+ ImGui::SliderFloat("LogSliderDeadzone", &style.LogSliderDeadzone, 0.0f, 12.0f, "%.0f");
+ ImGui::SliderFloat("ImageBorderSize", &style.ImageBorderSize, 0.0f, 1.0f, "%.0f");
+
+ ImGui::SeparatorText("Tooltips");
+ for (int n = 0; n < 2; n++)
+ if (ImGui::TreeNodeEx(n == 0 ? "HoverFlagsForTooltipMouse" : "HoverFlagsForTooltipNav"))
+ {
+ ImGuiHoveredFlags* p = (n == 0) ? &style.HoverFlagsForTooltipMouse : &style.HoverFlagsForTooltipNav;
+ ImGui::CheckboxFlags("ImGuiHoveredFlags_DelayNone", p, ImGuiHoveredFlags_DelayNone);
+ ImGui::CheckboxFlags("ImGuiHoveredFlags_DelayShort", p, ImGuiHoveredFlags_DelayShort);
+ ImGui::CheckboxFlags("ImGuiHoveredFlags_DelayNormal", p, ImGuiHoveredFlags_DelayNormal);
+ ImGui::CheckboxFlags("ImGuiHoveredFlags_Stationary", p, ImGuiHoveredFlags_Stationary);
+ ImGui::CheckboxFlags("ImGuiHoveredFlags_NoSharedDelay", p, ImGuiHoveredFlags_NoSharedDelay);
+ ImGui::TreePop();
+ }
+
+ ImGui::SeparatorText("Misc");
+ ImGui::SliderFloat2("DisplayWindowPadding", (float*)&style.DisplayWindowPadding, 0.0f, 30.0f, "%.0f"); ImGui::SameLine(); HelpMarker("Apply to regular windows: amount which we enforce to keep visible when moving near edges of your screen.");
+ ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); ImGui::SameLine(); HelpMarker("Apply to every windows, menus, popups, tooltips: amount where we avoid displaying contents. Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).");
+
ImGui::EndTabItem();
}
@@ -6266,22 +8292,29 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
filter.Draw("Filter colors", ImGui::GetFontSize() * 16);
static ImGuiColorEditFlags alpha_flags = 0;
- if (ImGui::RadioButton("Opaque", alpha_flags == ImGuiColorEditFlags_None)) { alpha_flags = ImGuiColorEditFlags_None; } ImGui::SameLine();
- if (ImGui::RadioButton("Alpha", alpha_flags == ImGuiColorEditFlags_AlphaPreview)) { alpha_flags = ImGuiColorEditFlags_AlphaPreview; } ImGui::SameLine();
- if (ImGui::RadioButton("Both", alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) { alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; } ImGui::SameLine();
+ if (ImGui::RadioButton("Opaque", alpha_flags == ImGuiColorEditFlags_AlphaOpaque)) { alpha_flags = ImGuiColorEditFlags_AlphaOpaque; } ImGui::SameLine();
+ if (ImGui::RadioButton("Alpha", alpha_flags == ImGuiColorEditFlags_None)) { alpha_flags = ImGuiColorEditFlags_None; } ImGui::SameLine();
+ if (ImGui::RadioButton("Both", alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) { alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; } ImGui::SameLine();
HelpMarker(
"In the color list:\n"
"Left-click on color square to open color picker,\n"
"Right-click to open edit options menu.");
- ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened);
- ImGui::PushItemWidth(-160);
+ ImGui::SetNextWindowSizeConstraints(ImVec2(0.0f, ImGui::GetTextLineHeightWithSpacing() * 10), ImVec2(FLT_MAX, FLT_MAX));
+ ImGui::BeginChild("##colors", ImVec2(0, 0), ImGuiChildFlags_Borders | ImGuiChildFlags_NavFlattened, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar);
+ ImGui::PushItemWidth(ImGui::GetFontSize() * -12);
for (int i = 0; i < ImGuiCol_COUNT; i++)
{
const char* name = ImGui::GetStyleColorName(i);
if (!filter.PassFilter(name))
continue;
ImGui::PushID(i);
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ if (ImGui::Button("?"))
+ ImGui::DebugFlashStyleColor((ImGuiCol)i);
+ ImGui::SetItemTooltip("Flash given color to identify places where it is used.");
+ ImGui::SameLine();
+#endif
ImGui::ColorEdit4("##color", (float*)&style.Colors[i], ImGuiColorEditFlags_AlphaBar | alpha_flags);
if (memcmp(&style.Colors[i], &ref->Colors[i], sizeof(ImVec4)) != 0)
{
@@ -6344,14 +8377,15 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
// When editing the "Circle Segment Max Error" value, draw a preview of its effect on auto-tessellated circles.
ImGui::DragFloat("Circle Tessellation Max Error", &style.CircleTessellationMaxError , 0.005f, 0.10f, 5.0f, "%.2f", ImGuiSliderFlags_AlwaysClamp);
- if (ImGui::IsItemActive())
- {
+ const bool show_samples = ImGui::IsItemActive();
+ if (show_samples)
ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos());
- ImGui::BeginTooltip();
- ImGui::TextUnformatted("(R = radius, N = number of segments)");
+ if (show_samples && ImGui::BeginTooltip())
+ {
+ ImGui::TextUnformatted("(R = radius, N = approx number of segments)");
ImGui::Spacing();
ImDrawList* draw_list = ImGui::GetWindowDrawList();
- const float min_widget_width = ImGui::CalcTextSize("N: MMM\nR: MMM").x;
+ const float min_widget_width = ImGui::CalcTextSize("R: MMM\nN: MMM").x;
for (int n = 0; n < 8; n++)
{
const float RAD_MIN = 5.0f;
@@ -6360,6 +8394,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
ImGui::BeginGroup();
+ // N is not always exact here due to how PathArcTo() function work internally
ImGui::Text("R: %.f\nN: %d", rad, draw_list->_CalcCircleAutoSegmentCount(rad));
const float canvas_width = IM_MAX(min_widget_width, rad * 2.0f);
@@ -6382,7 +8417,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
ImGui::EndTooltip();
}
ImGui::SameLine();
- HelpMarker("When drawing circle primitives with \"num_segments == 0\" tesselation will be calculated automatically.");
+ HelpMarker("When drawing circle primitives with \"num_segments == 0\" tessellation will be calculated automatically.");
ImGui::DragFloat("Global Alpha", &style.Alpha, 0.005f, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI (zero alpha clips all widgets). But application code could have a toggle to switch between zero and non-zero.
ImGui::DragFloat("Disabled Alpha", &style.DisabledAlpha, 0.005f, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Additional alpha multiplier for disabled items (multiply over current value of Alpha).");
@@ -6413,12 +8448,12 @@ void ImGui::ShowUserGuide()
ImGui::BulletText("CTRL+Tab to select a window.");
if (io.FontAllowUserScaling)
ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents.");
- ImGui::BulletText("While inputing text:\n");
+ ImGui::BulletText("While inputting text:\n");
ImGui::Indent();
ImGui::BulletText("CTRL+Left/Right to word jump.");
ImGui::BulletText("CTRL+A or double-click to select all.");
ImGui::BulletText("CTRL+X/C/V to use clipboard cut/copy/paste.");
- ImGui::BulletText("CTRL+Z,CTRL+Y to undo/redo.");
+ ImGui::BulletText("CTRL+Z to undo, CTRL+Y/CTRL+SHIFT+Z to redo.");
ImGui::BulletText("ESCAPE to revert.");
ImGui::Unindent();
ImGui::BulletText("With keyboard navigation enabled:");
@@ -6454,7 +8489,7 @@ static void ShowExampleAppMainMenuBar()
if (ImGui::BeginMenu("Edit"))
{
if (ImGui::MenuItem("Undo", "CTRL+Z")) {}
- if (ImGui::MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item
+ if (ImGui::MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item
ImGui::Separator();
if (ImGui::MenuItem("Cut", "CTRL+X")) {}
if (ImGui::MenuItem("Copy", "CTRL+C")) {}
@@ -6500,7 +8535,7 @@ static void ShowExampleMenuFile()
{
static bool enabled = true;
ImGui::MenuItem("Enabled", "", &enabled);
- ImGui::BeginChild("child", ImVec2(0, 60), true);
+ ImGui::BeginChild("child", ImVec2(0, 60), ImGuiChildFlags_Borders);
for (int i = 0; i < 10; i++)
ImGui::Text("Scrolling Text %d", i);
ImGui::EndChild();
@@ -6544,6 +8579,7 @@ static void ShowExampleMenuFile()
IM_ASSERT(0);
}
if (ImGui::MenuItem("Checked", NULL, true)) {}
+ ImGui::Separator();
if (ImGui::MenuItem("Quit", "Alt+F4")) {}
}
@@ -6584,19 +8620,19 @@ struct ExampleAppConsole
{
ClearLog();
for (int i = 0; i < History.Size; i++)
- free(History[i]);
+ ImGui::MemFree(History[i]);
}
// Portable helpers
static int Stricmp(const char* s1, const char* s2) { int d; while ((d = toupper(*s2) - toupper(*s1)) == 0 && *s1) { s1++; s2++; } return d; }
static int Strnicmp(const char* s1, const char* s2, int n) { int d = 0; while (n > 0 && (d = toupper(*s2) - toupper(*s1)) == 0 && *s1) { s1++; s2++; n--; } return d; }
- static char* Strdup(const char* s) { IM_ASSERT(s); size_t len = strlen(s) + 1; void* buf = malloc(len); IM_ASSERT(buf); return (char*)memcpy(buf, (const void*)s, len); }
+ static char* Strdup(const char* s) { IM_ASSERT(s); size_t len = strlen(s) + 1; void* buf = ImGui::MemAlloc(len); IM_ASSERT(buf); return (char*)memcpy(buf, (const void*)s, len); }
static void Strtrim(char* s) { char* str_end = s + strlen(s); while (str_end > s && str_end[-1] == ' ') str_end--; *str_end = 0; }
void ClearLog()
{
for (int i = 0; i < Items.Size; i++)
- free(Items[i]);
+ ImGui::MemFree(Items[i]);
Items.clear();
}
@@ -6657,6 +8693,7 @@ struct ExampleAppConsole
}
// Options, Filter
+ ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_O, ImGuiInputFlags_Tooltip);
if (ImGui::Button("Options"))
ImGui::OpenPopup("Options");
ImGui::SameLine();
@@ -6665,7 +8702,7 @@ struct ExampleAppConsole
// Reserve enough left-over height for 1 separator + 1 input text
const float footer_height_to_reserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing();
- if (ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), false, ImGuiWindowFlags_HorizontalScrollbar))
+ if (ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), ImGuiChildFlags_NavFlattened, ImGuiWindowFlags_HorizontalScrollbar))
{
if (ImGui::BeginPopupContextWindow())
{
@@ -6700,9 +8737,8 @@ struct ExampleAppConsole
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4, 1)); // Tighten spacing
if (copy_to_clipboard)
ImGui::LogToClipboard();
- for (int i = 0; i < Items.Size; i++)
+ for (const char* item : Items)
{
- const char* item = Items[i];
if (!Filter.PassFilter(item))
continue;
@@ -6763,7 +8799,7 @@ struct ExampleAppConsole
for (int i = History.Size - 1; i >= 0; i--)
if (Stricmp(History[i], command_line) == 0)
{
- free(History[i]);
+ ImGui::MemFree(History[i]);
History.erase(History.begin() + i);
break;
}
@@ -6843,7 +8879,7 @@ struct ExampleAppConsole
else
{
// Multiple matches. Complete as much as we can..
- // So inputing "C"+Tab will complete to "CL" then display "CLEAR" and "CLASSIFY" as matches.
+ // So inputting "C"+Tab will complete to "CL" then display "CLEAR" and "CLASSIFY" as matches.
int match_len = (int)(word_end - word_start);
for (;;)
{
@@ -6977,7 +9013,7 @@ struct ExampleAppLog
ImGui::Separator();
- if (ImGui::BeginChild("scrolling", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar))
+ if (ImGui::BeginChild("scrolling", ImVec2(0, 0), ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar))
{
if (clear)
Clear();
@@ -7087,7 +9123,7 @@ static void ShowExampleAppLayout(bool* p_open)
{
if (ImGui::BeginMenu("File"))
{
- if (ImGui::MenuItem("Close")) *p_open = false;
+ if (ImGui::MenuItem("Close", "Ctrl+W")) { *p_open = false; }
ImGui::EndMenu();
}
ImGui::EndMenuBar();
@@ -7096,7 +9132,7 @@ static void ShowExampleAppLayout(bool* p_open)
// Left
static int selected = 0;
{
- ImGui::BeginChild("left pane", ImVec2(150, 0), true);
+ ImGui::BeginChild("left pane", ImVec2(150, 0), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeX);
for (int i = 0; i < 100; i++)
{
// FIXME: Good candidate to use ImGuiSelectableFlags_SelectOnNav
@@ -7142,56 +9178,138 @@ static void ShowExampleAppLayout(bool* p_open)
//-----------------------------------------------------------------------------
// [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor()
//-----------------------------------------------------------------------------
+// Some of the interactions are a bit lack-luster:
+// - We would want pressing validating or leaving the filter to somehow restore focus.
+// - We may want more advanced filtering (child nodes) and clipper support: both will need extra work.
+// - We would want to customize some keyboard interactions to easily keyboard navigate between the tree and the properties.
+//-----------------------------------------------------------------------------
-static void ShowPlaceholderObject(const char* prefix, int uid)
+struct ExampleAppPropertyEditor
{
- // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID.
- ImGui::PushID(uid);
-
- // Text and Tree nodes are less high than framed widgets, using AlignTextToFramePadding() we add vertical spacing to make the tree lines equal high.
- ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0);
- ImGui::AlignTextToFramePadding();
- bool node_open = ImGui::TreeNode("Object", "%s_%u", prefix, uid);
- ImGui::TableSetColumnIndex(1);
- ImGui::Text("my sailor is rich");
+ ImGuiTextFilter Filter;
+ ExampleTreeNode* VisibleNode = NULL;
- if (node_open)
+ void Draw(ExampleTreeNode* root_node)
{
- static float placeholder_members[8] = { 0.0f, 0.0f, 1.0f, 3.1416f, 100.0f, 999.0f };
- for (int i = 0; i < 8; i++)
+ // Left side: draw tree
+ // - Currently using a table to benefit from RowBg feature
+ if (ImGui::BeginChild("##tree", ImVec2(300, 0), ImGuiChildFlags_ResizeX | ImGuiChildFlags_Borders | ImGuiChildFlags_NavFlattened))
{
- ImGui::PushID(i); // Use field index as identifier.
- if (i < 2)
+ ImGui::SetNextItemWidth(-FLT_MIN);
+ ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_F, ImGuiInputFlags_Tooltip);
+ ImGui::PushItemFlag(ImGuiItemFlags_NoNavDefaultFocus, true);
+ if (ImGui::InputTextWithHint("##Filter", "incl,-excl", Filter.InputBuf, IM_ARRAYSIZE(Filter.InputBuf), ImGuiInputTextFlags_EscapeClearsAll))
+ Filter.Build();
+ ImGui::PopItemFlag();
+
+ if (ImGui::BeginTable("##bg", 1, ImGuiTableFlags_RowBg))
{
- ShowPlaceholderObject("Child", 424242);
+ for (ExampleTreeNode* node : root_node->Childs)
+ if (Filter.PassFilter(node->Name)) // Filter root node
+ DrawTreeNode(node);
+ ImGui::EndTable();
}
- else
- {
- // Here we use a TreeNode to highlight on hover (we could use e.g. Selectable as well)
- ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0);
- ImGui::AlignTextToFramePadding();
- ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_Bullet;
- ImGui::TreeNodeEx("Field", flags, "Field_%d", i);
+ }
+ ImGui::EndChild();
- ImGui::TableSetColumnIndex(1);
- ImGui::SetNextItemWidth(-FLT_MIN);
- if (i >= 5)
- ImGui::InputFloat("##value", &placeholder_members[i], 1.0f);
- else
- ImGui::DragFloat("##value", &placeholder_members[i], 0.01f);
- ImGui::NextColumn();
+ // Right side: draw properties
+ ImGui::SameLine();
+
+ ImGui::BeginGroup(); // Lock X position
+ if (ExampleTreeNode* node = VisibleNode)
+ {
+ ImGui::Text("%s", node->Name);
+ ImGui::TextDisabled("UID: 0x%08X", node->UID);
+ ImGui::Separator();
+ if (ImGui::BeginTable("##properties", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY))
+ {
+ // Push object ID after we entered the table, so table is shared for all objects
+ ImGui::PushID((int)node->UID);
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed);
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch, 2.0f); // Default twice larger
+ if (node->HasData)
+ {
+ // In a typical application, the structure description would be derived from a data-driven system.
+ // - We try to mimic this with our ExampleMemberInfo structure and the ExampleTreeNodeMemberInfos[] array.
+ // - Limits and some details are hard-coded to simplify the demo.
+ for (const ExampleMemberInfo& field_desc : ExampleTreeNodeMemberInfos)
+ {
+ ImGui::TableNextRow();
+ ImGui::PushID(field_desc.Name);
+ ImGui::TableNextColumn();
+ ImGui::AlignTextToFramePadding();
+ ImGui::TextUnformatted(field_desc.Name);
+ ImGui::TableNextColumn();
+ void* field_ptr = (void*)(((unsigned char*)node) + field_desc.Offset);
+ switch (field_desc.DataType)
+ {
+ case ImGuiDataType_Bool:
+ {
+ IM_ASSERT(field_desc.DataCount == 1);
+ ImGui::Checkbox("##Editor", (bool*)field_ptr);
+ break;
+ }
+ case ImGuiDataType_S32:
+ {
+ int v_min = INT_MIN, v_max = INT_MAX;
+ ImGui::SetNextItemWidth(-FLT_MIN);
+ ImGui::DragScalarN("##Editor", field_desc.DataType, field_ptr, field_desc.DataCount, 1.0f, &v_min, &v_max);
+ break;
+ }
+ case ImGuiDataType_Float:
+ {
+ float v_min = 0.0f, v_max = 1.0f;
+ ImGui::SetNextItemWidth(-FLT_MIN);
+ ImGui::SliderScalarN("##Editor", field_desc.DataType, field_ptr, field_desc.DataCount, &v_min, &v_max);
+ break;
+ }
+ case ImGuiDataType_String:
+ {
+ ImGui::InputText("##Editor", reinterpret_cast<char*>(field_ptr), 28);
+ break;
+ }
+ }
+ ImGui::PopID();
+ }
+ }
+ ImGui::PopID();
+ ImGui::EndTable();
}
- ImGui::PopID();
}
- ImGui::TreePop();
+ ImGui::EndGroup();
}
- ImGui::PopID();
-}
-// Demonstrate create a simple property editor.
-static void ShowExampleAppPropertyEditor(bool* p_open)
+ void DrawTreeNode(ExampleTreeNode* node)
+ {
+ ImGui::TableNextRow();
+ ImGui::TableNextColumn();
+ ImGui::PushID(node->UID);
+ ImGuiTreeNodeFlags tree_flags = ImGuiTreeNodeFlags_None;
+ tree_flags |= ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick; // Standard opening mode as we are likely to want to add selection afterwards
+ tree_flags |= ImGuiTreeNodeFlags_NavLeftJumpsBackHere; // Left arrow support
+ if (node == VisibleNode)
+ tree_flags |= ImGuiTreeNodeFlags_Selected;
+ if (node->Childs.Size == 0)
+ tree_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_Bullet;
+ if (node->DataMyBool == false)
+ ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]);
+ bool node_open = ImGui::TreeNodeEx("", tree_flags, "%s", node->Name);
+ if (node->DataMyBool == false)
+ ImGui::PopStyleColor();
+ if (ImGui::IsItemFocused())
+ VisibleNode = node;
+ if (node_open)
+ {
+ for (ExampleTreeNode* child : node->Childs)
+ DrawTreeNode(child);
+ ImGui::TreePop();
+ }
+ ImGui::PopID();
+ }
+};
+
+// Demonstrate creating a simple property editor.
+static void ShowExampleAppPropertyEditor(bool* p_open, ImGuiDemoWindowData* demo_data)
{
ImGui::SetNextWindowSize(ImVec2(430, 450), ImGuiCond_FirstUseEver);
if (!ImGui::Begin("Example: Property editor", p_open))
@@ -7199,26 +9317,13 @@ static void ShowExampleAppPropertyEditor(bool* p_open)
ImGui::End();
return;
}
- IMGUI_DEMO_MARKER("Examples/Property Editor");
- HelpMarker(
- "This example shows how you may implement a property editor using two columns.\n"
- "All objects/fields data are dummies here.\n"
- "Remember that in many simple cases, you can use ImGui::SameLine(xxx) to position\n"
- "your cursor horizontally instead of using the Columns() API.");
+ IMGUI_DEMO_MARKER("Examples/Property Editor");
+ static ExampleAppPropertyEditor property_editor;
+ if (demo_data->DemoTree == NULL)
+ demo_data->DemoTree = ExampleTree_CreateDemoTree();
+ property_editor.Draw(demo_data->DemoTree);
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 2));
- if (ImGui::BeginTable("split", 2, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_Resizable))
- {
- // Iterate placeholder objects (all the same data)
- for (int obj_i = 0; obj_i < 4; obj_i++)
- {
- ShowPlaceholderObject("Object", obj_i);
- //ImGui::Separator();
- }
- ImGui::EndTable();
- }
- ImGui::PopStyleVar();
ImGui::End();
}
@@ -7322,18 +9427,31 @@ static void ShowExampleAppConstrainedResize(bool* p_open)
{
// Helper functions to demonstrate programmatic constraints
// FIXME: This doesn't take account of decoration size (e.g. title bar), library should make this easier.
- static void AspectRatio(ImGuiSizeCallbackData* data) { float aspect_ratio = *(float*)data->UserData; data->DesiredSize.x = IM_MAX(data->CurrentSize.x, data->CurrentSize.y); data->DesiredSize.y = (float)(int)(data->DesiredSize.x / aspect_ratio); }
- static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize.x = data->DesiredSize.y = IM_MAX(data->CurrentSize.x, data->CurrentSize.y); }
- static void Step(ImGuiSizeCallbackData* data) { float step = *(float*)data->UserData; data->DesiredSize = ImVec2((int)(data->CurrentSize.x / step + 0.5f) * step, (int)(data->CurrentSize.y / step + 0.5f) * step); }
+ // FIXME: None of the three demos works consistently when resizing from borders.
+ static void AspectRatio(ImGuiSizeCallbackData* data)
+ {
+ float aspect_ratio = *(float*)data->UserData;
+ data->DesiredSize.y = (float)(int)(data->DesiredSize.x / aspect_ratio);
+ }
+ static void Square(ImGuiSizeCallbackData* data)
+ {
+ data->DesiredSize.x = data->DesiredSize.y = IM_MAX(data->DesiredSize.x, data->DesiredSize.y);
+ }
+ static void Step(ImGuiSizeCallbackData* data)
+ {
+ float step = *(float*)data->UserData;
+ data->DesiredSize = ImVec2((int)(data->DesiredSize.x / step + 0.5f) * step, (int)(data->DesiredSize.y / step + 0.5f) * step);
+ }
};
const char* test_desc[] =
{
"Between 100x100 and 500x500",
"At least 100x100",
- "Resize vertical only",
- "Resize horizontal only",
+ "Resize vertical + lock current width",
+ "Resize horizontal + lock current height",
"Width Between 400 and 500",
+ "Height at least 400",
"Custom: Aspect Ratio 16:9",
"Custom: Always Square",
"Custom: Fixed Steps (100)",
@@ -7342,7 +9460,7 @@ static void ShowExampleAppConstrainedResize(bool* p_open)
// Options
static bool auto_resize = false;
static bool window_padding = true;
- static int type = 5; // Aspect Ratio
+ static int type = 6; // Aspect Ratio
static int display_lines = 10;
// Submit constraint
@@ -7350,12 +9468,13 @@ static void ShowExampleAppConstrainedResize(bool* p_open)
float fixed_step = 100.0f;
if (type == 0) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(500, 500)); // Between 100x100 and 500x500
if (type == 1) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(FLT_MAX, FLT_MAX)); // Width > 100, Height > 100
- if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Vertical only
- if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Horizontal only
+ if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Resize vertical + lock current width
+ if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Resize horizontal + lock current height
if (type == 4) ImGui::SetNextWindowSizeConstraints(ImVec2(400, -1), ImVec2(500, -1)); // Width Between and 400 and 500
- if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::AspectRatio, (void*)&aspect_ratio); // Aspect ratio
- if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square
- if (type == 7) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)&fixed_step); // Fixed Step
+ if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 400), ImVec2(-1, FLT_MAX)); // Height at least 400
+ if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::AspectRatio, (void*)&aspect_ratio); // Aspect ratio
+ if (type == 7) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square
+ if (type == 8) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)&fixed_step); // Fixed Step
// Submit window
if (!window_padding)
@@ -7462,7 +9581,7 @@ static void ShowExampleAppFullscreen(bool* p_open)
static ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings;
// We demonstrate using the full viewport area or the work area (without menu-bars, task-bars etc.)
- // Based on your use case you may want one of the other.
+ // Based on your use case you may want one or the other.
const ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(use_work_area ? viewport->WorkPos : viewport->Pos);
ImGui::SetNextWindowSize(use_work_area ? viewport->WorkSize : viewport->Size);
@@ -7527,6 +9646,14 @@ static void ShowExampleAppWindowTitles(bool*)
// [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering()
//-----------------------------------------------------------------------------
+// Add a |_| looking shape
+static void PathConcaveShape(ImDrawList* draw_list, float x, float y, float sz)
+{
+ const ImVec2 pos_norms[] = { { 0.0f, 0.0f }, { 0.3f, 0.0f }, { 0.3f, 0.7f }, { 0.7f, 0.7f }, { 0.7f, 0.0f }, { 1.0f, 0.0f }, { 1.0f, 1.0f }, { 0.0f, 1.0f } };
+ for (const ImVec2& p : pos_norms)
+ draw_list->PathLineTo(ImVec2(x + 0.5f + (int)(sz * p.x), y + 0.5f + (int)(sz * p.y)));
+}
+
// Demonstrate using the low-level ImDrawList to draw custom shapes.
static void ShowExampleAppCustomRendering(bool* p_open)
{
@@ -7599,6 +9726,9 @@ static void ShowExampleAppCustomRendering(bool* p_open)
const float rounding = sz / 5.0f;
const int circle_segments = circle_segments_override ? circle_segments_override_v : 0;
const int curve_segments = curve_segments_override ? curve_segments_override_v : 0;
+ const ImVec2 cp3[3] = { ImVec2(0.0f, sz * 0.6f), ImVec2(sz * 0.5f, -sz * 0.4f), ImVec2(sz, sz) }; // Control points for curves
+ const ImVec2 cp4[4] = { ImVec2(0.0f, 0.0f), ImVec2(sz * 1.3f, sz * 0.3f), ImVec2(sz - sz * 1.3f, sz - sz * 0.3f), ImVec2(sz, sz) };
+
float x = p.x + 4.0f;
float y = p.y + 4.0f;
for (int n = 0; n < 2; n++)
@@ -7607,39 +9737,63 @@ static void ShowExampleAppCustomRendering(bool* p_open)
float th = (n == 0) ? 1.0f : thickness;
draw_list->AddNgon(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, ngon_sides, th); x += sz + spacing; // N-gon
draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, circle_segments, th); x += sz + spacing; // Circle
+ draw_list->AddEllipse(ImVec2(x + sz*0.5f, y + sz*0.5f), ImVec2(sz*0.5f, sz*0.3f), col, -0.3f, circle_segments, th); x += sz + spacing; // Ellipse
draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 0.0f, ImDrawFlags_None, th); x += sz + spacing; // Square
draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, ImDrawFlags_None, th); x += sz + spacing; // Square with all rounded corners
draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, corners_tl_br, th); x += sz + spacing; // Square with two rounded corners
draw_list->AddTriangle(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col, th);x += sz + spacing; // Triangle
//draw_list->AddTriangle(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col, th);x+= sz*0.4f + spacing; // Thin triangle
+ PathConcaveShape(draw_list, x, y, sz); draw_list->PathStroke(col, ImDrawFlags_Closed, th); x += sz + spacing; // Concave Shape
+ //draw_list->AddPolyline(concave_shape, IM_ARRAYSIZE(concave_shape), col, ImDrawFlags_Closed, th);
draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y), col, th); x += sz + spacing; // Horizontal line (note: drawing a filled rectangle will be faster!)
draw_list->AddLine(ImVec2(x, y), ImVec2(x, y + sz), col, th); x += spacing; // Vertical line (note: drawing a filled rectangle will be faster!)
draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y + sz), col, th); x += sz + spacing; // Diagonal line
+ // Path
+ draw_list->PathArcTo(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, 3.141592f, 3.141592f * -0.5f);
+ draw_list->PathStroke(col, ImDrawFlags_None, th);
+ x += sz + spacing;
+
// Quadratic Bezier Curve (3 control points)
- ImVec2 cp3[3] = { ImVec2(x, y + sz * 0.6f), ImVec2(x + sz * 0.5f, y - sz * 0.4f), ImVec2(x + sz, y + sz) };
- draw_list->AddBezierQuadratic(cp3[0], cp3[1], cp3[2], col, th, curve_segments); x += sz + spacing;
+ draw_list->AddBezierQuadratic(ImVec2(x + cp3[0].x, y + cp3[0].y), ImVec2(x + cp3[1].x, y + cp3[1].y), ImVec2(x + cp3[2].x, y + cp3[2].y), col, th, curve_segments);
+ x += sz + spacing;
// Cubic Bezier Curve (4 control points)
- ImVec2 cp4[4] = { ImVec2(x, y), ImVec2(x + sz * 1.3f, y + sz * 0.3f), ImVec2(x + sz - sz * 1.3f, y + sz - sz * 0.3f), ImVec2(x + sz, y + sz) };
- draw_list->AddBezierCubic(cp4[0], cp4[1], cp4[2], cp4[3], col, th, curve_segments);
+ draw_list->AddBezierCubic(ImVec2(x + cp4[0].x, y + cp4[0].y), ImVec2(x + cp4[1].x, y + cp4[1].y), ImVec2(x + cp4[2].x, y + cp4[2].y), ImVec2(x + cp4[3].x, y + cp4[3].y), col, th, curve_segments);
x = p.x + 4;
y += sz + spacing;
}
- draw_list->AddNgonFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz*0.5f, col, ngon_sides); x += sz + spacing; // N-gon
- draw_list->AddCircleFilled(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, circle_segments); x += sz + spacing; // Circle
+
+ // Filled shapes
+ draw_list->AddNgonFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz * 0.5f, col, ngon_sides); x += sz + spacing; // N-gon
+ draw_list->AddCircleFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz * 0.5f, col, circle_segments); x += sz + spacing; // Circle
+ draw_list->AddEllipseFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), ImVec2(sz * 0.5f, sz * 0.3f), col, -0.3f, circle_segments); x += sz + spacing;// Ellipse
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col); x += sz + spacing; // Square
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f); x += sz + spacing; // Square with all rounded corners
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_tl_br); x += sz + spacing; // Square with two rounded corners
draw_list->AddTriangleFilled(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col); x += sz + spacing; // Triangle
//draw_list->AddTriangleFilled(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col); x += sz*0.4f + spacing; // Thin triangle
+ PathConcaveShape(draw_list, x, y, sz); draw_list->PathFillConcave(col); x += sz + spacing; // Concave shape
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + thickness), col); x += sz + spacing; // Horizontal line (faster than AddLine, but only handle integer thickness)
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + thickness, y + sz), col); x += spacing * 2.0f;// Vertical line (faster than AddLine, but only handle integer thickness)
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + 1, y + 1), col); x += sz; // Pixel (faster than AddLine)
+
+ // Path
+ draw_list->PathArcTo(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz * 0.5f, 3.141592f * -0.5f, 3.141592f);
+ draw_list->PathFillConvex(col);
+ x += sz + spacing;
+
+ // Quadratic Bezier Curve (3 control points)
+ draw_list->PathLineTo(ImVec2(x + cp3[0].x, y + cp3[0].y));
+ draw_list->PathBezierQuadraticCurveTo(ImVec2(x + cp3[1].x, y + cp3[1].y), ImVec2(x + cp3[2].x, y + cp3[2].y), curve_segments);
+ draw_list->PathFillConvex(col);
+ x += sz + spacing;
+
draw_list->AddRectFilledMultiColor(ImVec2(x, y), ImVec2(x + sz, y + sz), IM_COL32(0, 0, 0, 255), IM_COL32(255, 0, 0, 255), IM_COL32(255, 255, 0, 255), IM_COL32(0, 255, 0, 255));
+ x += sz + spacing;
- ImGui::Dummy(ImVec2((sz + spacing) * 10.2f, (sz + spacing) * 3.0f));
+ ImGui::Dummy(ImVec2((sz + spacing) * 13.2f, (sz + spacing) * 3.0f));
ImGui::PopItemWidth();
ImGui::EndTabItem();
}
@@ -7661,7 +9815,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
// To use a child window instead we could use, e.g:
// ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0)); // Disable padding
// ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(50, 50, 50, 255)); // Set a background color
- // ImGui::BeginChild("canvas", ImVec2(0.0f, 0.0f), true, ImGuiWindowFlags_NoMove);
+ // ImGui::BeginChild("canvas", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Borders, ImGuiWindowFlags_NoMove);
// ImGui::PopStyleColor();
// ImGui::PopStyleVar();
// [...]
@@ -7759,6 +9913,43 @@ static void ShowExampleAppCustomRendering(bool* p_open)
ImGui::EndTabItem();
}
+ // Demonstrate out-of-order rendering via channels splitting
+ // We use functions in ImDrawList as each draw list contains a convenience splitter,
+ // but you can also instantiate your own ImDrawListSplitter if you need to nest them.
+ if (ImGui::BeginTabItem("Draw Channels"))
+ {
+ ImDrawList* draw_list = ImGui::GetWindowDrawList();
+ {
+ ImGui::Text("Blue shape is drawn first: appears in back");
+ ImGui::Text("Red shape is drawn after: appears in front");
+ ImVec2 p0 = ImGui::GetCursorScreenPos();
+ draw_list->AddRectFilled(ImVec2(p0.x, p0.y), ImVec2(p0.x + 50, p0.y + 50), IM_COL32(0, 0, 255, 255)); // Blue
+ draw_list->AddRectFilled(ImVec2(p0.x + 25, p0.y + 25), ImVec2(p0.x + 75, p0.y + 75), IM_COL32(255, 0, 0, 255)); // Red
+ ImGui::Dummy(ImVec2(75, 75));
+ }
+ ImGui::Separator();
+ {
+ ImGui::Text("Blue shape is drawn first, into channel 1: appears in front");
+ ImGui::Text("Red shape is drawn after, into channel 0: appears in back");
+ ImVec2 p1 = ImGui::GetCursorScreenPos();
+
+ // Create 2 channels and draw a Blue shape THEN a Red shape.
+ // You can create any number of channels. Tables API use 1 channel per column in order to better batch draw calls.
+ draw_list->ChannelsSplit(2);
+ draw_list->ChannelsSetCurrent(1);
+ draw_list->AddRectFilled(ImVec2(p1.x, p1.y), ImVec2(p1.x + 50, p1.y + 50), IM_COL32(0, 0, 255, 255)); // Blue
+ draw_list->ChannelsSetCurrent(0);
+ draw_list->AddRectFilled(ImVec2(p1.x + 25, p1.y + 25), ImVec2(p1.x + 75, p1.y + 75), IM_COL32(255, 0, 0, 255)); // Red
+
+ // Flatten/reorder channels. Red shape is in channel 0 and it appears below the Blue shape in channel 1.
+ // This works by copying draw indices only (vertices are not copied).
+ draw_list->ChannelsMerge();
+ ImGui::Dummy(ImVec2(75, 75));
+ ImGui::Text("After reordering, contents of channel 0 appears below channel 1.");
+ }
+ ImGui::EndTabItem();
+ }
+
ImGui::EndTabBar();
}
@@ -7772,93 +9963,119 @@ static void ShowExampleAppCustomRendering(bool* p_open)
// Simplified structure to mimic a Document model
struct MyDocument
{
- const char* Name; // Document title
+ char Name[32]; // Document title
+ int UID; // Unique ID (necessary as we can change title)
bool Open; // Set when open (we keep an array of all available documents to simplify demo code!)
bool OpenPrev; // Copy of Open from last update.
bool Dirty; // Set when the document has been modified
- bool WantClose; // Set when the document
ImVec4 Color; // An arbitrary variable associated to the document
- MyDocument(const char* name, bool open = true, const ImVec4& color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f))
+ MyDocument(int uid, const char* name, bool open = true, const ImVec4& color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f))
{
- Name = name;
+ UID = uid;
+ snprintf(Name, sizeof(Name), "%s", name);
Open = OpenPrev = open;
Dirty = false;
- WantClose = false;
Color = color;
}
void DoOpen() { Open = true; }
- void DoQueueClose() { WantClose = true; }
void DoForceClose() { Open = false; Dirty = false; }
void DoSave() { Dirty = false; }
+};
+
+struct ExampleAppDocuments
+{
+ ImVector<MyDocument> Documents;
+ ImVector<MyDocument*> CloseQueue;
+ MyDocument* RenamingDoc = NULL;
+ bool RenamingStarted = false;
+
+ ExampleAppDocuments()
+ {
+ Documents.push_back(MyDocument(0, "Lettuce", true, ImVec4(0.4f, 0.8f, 0.4f, 1.0f)));
+ Documents.push_back(MyDocument(1, "Eggplant", true, ImVec4(0.8f, 0.5f, 1.0f, 1.0f)));
+ Documents.push_back(MyDocument(2, "Carrot", true, ImVec4(1.0f, 0.8f, 0.5f, 1.0f)));
+ Documents.push_back(MyDocument(3, "Tomato", false, ImVec4(1.0f, 0.3f, 0.4f, 1.0f)));
+ Documents.push_back(MyDocument(4, "A Rather Long Title", false, ImVec4(0.4f, 0.8f, 0.8f, 1.0f)));
+ Documents.push_back(MyDocument(5, "Some Document", false, ImVec4(0.8f, 0.8f, 1.0f, 1.0f)));
+ }
+
+ // As we allow to change document name, we append a never-changing document ID so tabs are stable
+ void GetTabName(MyDocument* doc, char* out_buf, size_t out_buf_size)
+ {
+ snprintf(out_buf, out_buf_size, "%s###doc%d", doc->Name, doc->UID);
+ }
// Display placeholder contents for the Document
- static void DisplayContents(MyDocument* doc)
+ void DisplayDocContents(MyDocument* doc)
{
ImGui::PushID(doc);
ImGui::Text("Document \"%s\"", doc->Name);
ImGui::PushStyleColor(ImGuiCol_Text, doc->Color);
ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
ImGui::PopStyleColor();
- if (ImGui::Button("Modify", ImVec2(100, 0)))
+
+ ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_R, ImGuiInputFlags_Tooltip);
+ if (ImGui::Button("Rename.."))
+ {
+ RenamingDoc = doc;
+ RenamingStarted = true;
+ }
+ ImGui::SameLine();
+
+ ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_M, ImGuiInputFlags_Tooltip);
+ if (ImGui::Button("Modify"))
doc->Dirty = true;
+
ImGui::SameLine();
- if (ImGui::Button("Save", ImVec2(100, 0)))
+ ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_S, ImGuiInputFlags_Tooltip);
+ if (ImGui::Button("Save"))
doc->DoSave();
+
+ ImGui::SameLine();
+ ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_W, ImGuiInputFlags_Tooltip);
+ if (ImGui::Button("Close"))
+ CloseQueue.push_back(doc);
ImGui::ColorEdit3("color", &doc->Color.x); // Useful to test drag and drop and hold-dragged-to-open-tab behavior.
ImGui::PopID();
}
// Display context menu for the Document
- static void DisplayContextMenu(MyDocument* doc)
+ void DisplayDocContextMenu(MyDocument* doc)
{
if (!ImGui::BeginPopupContextItem())
return;
char buf[256];
sprintf(buf, "Save %s", doc->Name);
- if (ImGui::MenuItem(buf, "CTRL+S", false, doc->Open))
+ if (ImGui::MenuItem(buf, "Ctrl+S", false, doc->Open))
doc->DoSave();
- if (ImGui::MenuItem("Close", "CTRL+W", false, doc->Open))
- doc->DoQueueClose();
+ if (ImGui::MenuItem("Rename...", "Ctrl+R", false, doc->Open))
+ RenamingDoc = doc;
+ if (ImGui::MenuItem("Close", "Ctrl+W", false, doc->Open))
+ CloseQueue.push_back(doc);
ImGui::EndPopup();
}
-};
-struct ExampleAppDocuments
-{
- ImVector<MyDocument> Documents;
-
- ExampleAppDocuments()
+ // [Optional] Notify the system of Tabs/Windows closure that happened outside the regular tab interface.
+ // If a tab has been closed programmatically (aka closed from another source such as the Checkbox() in the demo,
+ // as opposed to clicking on the regular tab closing button) and stops being submitted, it will take a frame for
+ // the tab bar to notice its absence. During this frame there will be a gap in the tab bar, and if the tab that has
+ // disappeared was the selected one, the tab bar will report no selected tab during the frame. This will effectively
+ // give the impression of a flicker for one frame.
+ // We call SetTabItemClosed() to manually notify the Tab Bar or Docking system of removed tabs to avoid this glitch.
+ // Note that this completely optional, and only affect tab bars with the ImGuiTabBarFlags_Reorderable flag.
+ void NotifyOfDocumentsClosedElsewhere()
{
- Documents.push_back(MyDocument("Lettuce", true, ImVec4(0.4f, 0.8f, 0.4f, 1.0f)));
- Documents.push_back(MyDocument("Eggplant", true, ImVec4(0.8f, 0.5f, 1.0f, 1.0f)));
- Documents.push_back(MyDocument("Carrot", true, ImVec4(1.0f, 0.8f, 0.5f, 1.0f)));
- Documents.push_back(MyDocument("Tomato", false, ImVec4(1.0f, 0.3f, 0.4f, 1.0f)));
- Documents.push_back(MyDocument("A Rather Long Title", false));
- Documents.push_back(MyDocument("Some Document", false));
+ for (MyDocument& doc : Documents)
+ {
+ if (!doc.Open && doc.OpenPrev)
+ ImGui::SetTabItemClosed(doc.Name);
+ doc.OpenPrev = doc.Open;
+ }
}
};
-// [Optional] Notify the system of Tabs/Windows closure that happened outside the regular tab interface.
-// If a tab has been closed programmatically (aka closed from another source such as the Checkbox() in the demo,
-// as opposed to clicking on the regular tab closing button) and stops being submitted, it will take a frame for
-// the tab bar to notice its absence. During this frame there will be a gap in the tab bar, and if the tab that has
-// disappeared was the selected one, the tab bar will report no selected tab during the frame. This will effectively
-// give the impression of a flicker for one frame.
-// We call SetTabItemClosed() to manually notify the Tab Bar or Docking system of removed tabs to avoid this glitch.
-// Note that this completely optional, and only affect tab bars with the ImGuiTabBarFlags_Reorderable flag.
-static void NotifyOfDocumentsClosedElsewhere(ExampleAppDocuments& app)
-{
- for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++)
- {
- MyDocument* doc = &app.Documents[doc_n];
- if (!doc->Open && doc->OpenPrev)
- ImGui::SetTabItemClosed(doc->Name);
- doc->OpenPrev = doc->Open;
- }
-}
-
void ShowExampleAppDocuments(bool* p_open)
{
static ExampleAppDocuments app;
@@ -7880,24 +10097,20 @@ void ShowExampleAppDocuments(bool* p_open)
if (ImGui::BeginMenu("File"))
{
int open_count = 0;
- for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++)
- open_count += app.Documents[doc_n].Open ? 1 : 0;
+ for (MyDocument& doc : app.Documents)
+ open_count += doc.Open ? 1 : 0;
if (ImGui::BeginMenu("Open", open_count < app.Documents.Size))
{
- for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++)
- {
- MyDocument* doc = &app.Documents[doc_n];
- if (!doc->Open)
- if (ImGui::MenuItem(doc->Name))
- doc->DoOpen();
- }
+ for (MyDocument& doc : app.Documents)
+ if (!doc.Open && ImGui::MenuItem(doc.Name))
+ doc.DoOpen();
ImGui::EndMenu();
}
if (ImGui::MenuItem("Close All Documents", NULL, false, open_count > 0))
- for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++)
- app.Documents[doc_n].DoQueueClose();
- if (ImGui::MenuItem("Exit", "Ctrl+F4") && p_open)
+ for (MyDocument& doc : app.Documents)
+ app.CloseQueue.push_back(&doc);
+ if (ImGui::MenuItem("Exit") && p_open)
*p_open = false;
ImGui::EndMenu();
}
@@ -7907,13 +10120,13 @@ void ShowExampleAppDocuments(bool* p_open)
// [Debug] List documents with one checkbox for each
for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++)
{
- MyDocument* doc = &app.Documents[doc_n];
+ MyDocument& doc = app.Documents[doc_n];
if (doc_n > 0)
ImGui::SameLine();
- ImGui::PushID(doc);
- if (ImGui::Checkbox(doc->Name, &doc->Open))
- if (!doc->Open)
- doc->DoForceClose();
+ ImGui::PushID(&doc);
+ if (ImGui::Checkbox(doc.Name, &doc.Open))
+ if (!doc.Open)
+ doc.DoForceClose();
ImGui::PopID();
}
@@ -7932,36 +10145,39 @@ void ShowExampleAppDocuments(bool* p_open)
// Submit Tab Bar and Tabs
{
ImGuiTabBarFlags tab_bar_flags = (opt_fitting_flags) | (opt_reorderable ? ImGuiTabBarFlags_Reorderable : 0);
+ tab_bar_flags |= ImGuiTabBarFlags_DrawSelectedOverline;
if (ImGui::BeginTabBar("##tabs", tab_bar_flags))
{
if (opt_reorderable)
- NotifyOfDocumentsClosedElsewhere(app);
+ app.NotifyOfDocumentsClosedElsewhere();
// [DEBUG] Stress tests
//if ((ImGui::GetFrameCount() % 30) == 0) docs[1].Open ^= 1; // [DEBUG] Automatically show/hide a tab. Test various interactions e.g. dragging with this on.
//if (ImGui::GetIO().KeyCtrl) ImGui::SetTabItemSelected(docs[1].Name); // [DEBUG] Test SetTabItemSelected(), probably not very useful as-is anyway..
// Submit Tabs
- for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++)
+ for (MyDocument& doc : app.Documents)
{
- MyDocument* doc = &app.Documents[doc_n];
- if (!doc->Open)
+ if (!doc.Open)
continue;
- ImGuiTabItemFlags tab_flags = (doc->Dirty ? ImGuiTabItemFlags_UnsavedDocument : 0);
- bool visible = ImGui::BeginTabItem(doc->Name, &doc->Open, tab_flags);
+ // As we allow to change document name, we append a never-changing document id so tabs are stable
+ char doc_name_buf[64];
+ app.GetTabName(&doc, doc_name_buf, sizeof(doc_name_buf));
+ ImGuiTabItemFlags tab_flags = (doc.Dirty ? ImGuiTabItemFlags_UnsavedDocument : 0);
+ bool visible = ImGui::BeginTabItem(doc_name_buf, &doc.Open, tab_flags);
// Cancel attempt to close when unsaved add to save queue so we can display a popup.
- if (!doc->Open && doc->Dirty)
+ if (!doc.Open && doc.Dirty)
{
- doc->Open = true;
- doc->DoQueueClose();
+ doc.Open = true;
+ app.CloseQueue.push_back(&doc);
}
- MyDocument::DisplayContextMenu(doc);
+ app.DisplayDocContextMenu(&doc);
if (visible)
{
- MyDocument::DisplayContents(doc);
+ app.DisplayDocContents(&doc);
ImGui::EndTabItem();
}
}
@@ -7970,36 +10186,44 @@ void ShowExampleAppDocuments(bool* p_open)
}
}
- // Update closing queue
- static ImVector<MyDocument*> close_queue;
- if (close_queue.empty())
+ // Display renaming UI
+ if (app.RenamingDoc != NULL)
{
- // Close queue is locked once we started a popup
- for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++)
+ if (app.RenamingStarted)
+ ImGui::OpenPopup("Rename");
+ if (ImGui::BeginPopup("Rename"))
{
- MyDocument* doc = &app.Documents[doc_n];
- if (doc->WantClose)
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 30);
+ if (ImGui::InputText("###Name", app.RenamingDoc->Name, IM_ARRAYSIZE(app.RenamingDoc->Name), ImGuiInputTextFlags_EnterReturnsTrue))
{
- doc->WantClose = false;
- close_queue.push_back(doc);
+ ImGui::CloseCurrentPopup();
+ app.RenamingDoc = NULL;
}
+ if (app.RenamingStarted)
+ ImGui::SetKeyboardFocusHere(-1);
+ ImGui::EndPopup();
}
+ else
+ {
+ app.RenamingDoc = NULL;
+ }
+ app.RenamingStarted = false;
}
// Display closing confirmation UI
- if (!close_queue.empty())
+ if (!app.CloseQueue.empty())
{
int close_queue_unsaved_documents = 0;
- for (int n = 0; n < close_queue.Size; n++)
- if (close_queue[n]->Dirty)
+ for (int n = 0; n < app.CloseQueue.Size; n++)
+ if (app.CloseQueue[n]->Dirty)
close_queue_unsaved_documents++;
if (close_queue_unsaved_documents == 0)
{
// Close documents when all are unsaved
- for (int n = 0; n < close_queue.Size; n++)
- close_queue[n]->DoForceClose();
- close_queue.clear();
+ for (int n = 0; n < app.CloseQueue.Size; n++)
+ app.CloseQueue[n]->DoForceClose();
+ app.CloseQueue.clear();
}
else
{
@@ -8009,38 +10233,36 @@ void ShowExampleAppDocuments(bool* p_open)
{
ImGui::Text("Save change to the following items?");
float item_height = ImGui::GetTextLineHeightWithSpacing();
- if (ImGui::BeginChildFrame(ImGui::GetID("frame"), ImVec2(-FLT_MIN, 6.25f * item_height)))
- {
- for (int n = 0; n < close_queue.Size; n++)
- if (close_queue[n]->Dirty)
- ImGui::Text("%s", close_queue[n]->Name);
- ImGui::EndChildFrame();
- }
+ if (ImGui::BeginChild(ImGui::GetID("frame"), ImVec2(-FLT_MIN, 6.25f * item_height), ImGuiChildFlags_FrameStyle))
+ for (MyDocument* doc : app.CloseQueue)
+ if (doc->Dirty)
+ ImGui::Text("%s", doc->Name);
+ ImGui::EndChild();
ImVec2 button_size(ImGui::GetFontSize() * 7.0f, 0.0f);
if (ImGui::Button("Yes", button_size))
{
- for (int n = 0; n < close_queue.Size; n++)
+ for (MyDocument* doc : app.CloseQueue)
{
- if (close_queue[n]->Dirty)
- close_queue[n]->DoSave();
- close_queue[n]->DoForceClose();
+ if (doc->Dirty)
+ doc->DoSave();
+ doc->DoForceClose();
}
- close_queue.clear();
+ app.CloseQueue.clear();
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
if (ImGui::Button("No", button_size))
{
- for (int n = 0; n < close_queue.Size; n++)
- close_queue[n]->DoForceClose();
- close_queue.clear();
+ for (MyDocument* doc : app.CloseQueue)
+ doc->DoForceClose();
+ app.CloseQueue.clear();
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
if (ImGui::Button("Cancel", button_size))
{
- close_queue.clear();
+ app.CloseQueue.clear();
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
@@ -8051,6 +10273,404 @@ void ShowExampleAppDocuments(bool* p_open)
ImGui::End();
}
+//-----------------------------------------------------------------------------
+// [SECTION] Example App: Assets Browser / ShowExampleAppAssetsBrowser()
+//-----------------------------------------------------------------------------
+
+//#include "imgui_internal.h" // NavMoveRequestTryWrapping()
+
+struct ExampleAsset
+{
+ ImGuiID ID;
+ int Type;
+
+ ExampleAsset(ImGuiID id, int type) { ID = id; Type = type; }
+
+ static const ImGuiTableSortSpecs* s_current_sort_specs;
+
+ static void SortWithSortSpecs(ImGuiTableSortSpecs* sort_specs, ExampleAsset* items, int items_count)
+ {
+ s_current_sort_specs = sort_specs; // Store in variable accessible by the sort function.
+ if (items_count > 1)
+ qsort(items, (size_t)items_count, sizeof(items[0]), ExampleAsset::CompareWithSortSpecs);
+ s_current_sort_specs = NULL;
+ }
+
+ // Compare function to be used by qsort()
+ static int IMGUI_CDECL CompareWithSortSpecs(const void* lhs, const void* rhs)
+ {
+ const ExampleAsset* a = (const ExampleAsset*)lhs;
+ const ExampleAsset* b = (const ExampleAsset*)rhs;
+ for (int n = 0; n < s_current_sort_specs->SpecsCount; n++)
+ {
+ const ImGuiTableColumnSortSpecs* sort_spec = &s_current_sort_specs->Specs[n];
+ int delta = 0;
+ if (sort_spec->ColumnIndex == 0)
+ delta = ((int)a->ID - (int)b->ID);
+ else if (sort_spec->ColumnIndex == 1)
+ delta = (a->Type - b->Type);
+ if (delta > 0)
+ return (sort_spec->SortDirection == ImGuiSortDirection_Ascending) ? +1 : -1;
+ if (delta < 0)
+ return (sort_spec->SortDirection == ImGuiSortDirection_Ascending) ? -1 : +1;
+ }
+ return ((int)a->ID - (int)b->ID);
+ }
+};
+const ImGuiTableSortSpecs* ExampleAsset::s_current_sort_specs = NULL;
+
+struct ExampleAssetsBrowser
+{
+ // Options
+ bool ShowTypeOverlay = true;
+ bool AllowSorting = true;
+ bool AllowDragUnselected = false;
+ bool AllowBoxSelect = true;
+ float IconSize = 32.0f;
+ int IconSpacing = 10;
+ int IconHitSpacing = 4; // Increase hit-spacing if you want to make it possible to clear or box-select from gaps. Some spacing is required to able to amend with Shift+box-select. Value is small in Explorer.
+ bool StretchSpacing = true;
+
+ // State
+ ImVector<ExampleAsset> Items; // Our items
+ ExampleSelectionWithDeletion Selection; // Our selection (ImGuiSelectionBasicStorage + helper funcs to handle deletion)
+ ImGuiID NextItemId = 0; // Unique identifier when creating new items
+ bool RequestDelete = false; // Deferred deletion request
+ bool RequestSort = false; // Deferred sort request
+ float ZoomWheelAccum = 0.0f; // Mouse wheel accumulator to handle smooth wheels better
+
+ // Calculated sizes for layout, output of UpdateLayoutSizes(). Could be locals but our code is simpler this way.
+ ImVec2 LayoutItemSize;
+ ImVec2 LayoutItemStep; // == LayoutItemSize + LayoutItemSpacing
+ float LayoutItemSpacing = 0.0f;
+ float LayoutSelectableSpacing = 0.0f;
+ float LayoutOuterPadding = 0.0f;
+ int LayoutColumnCount = 0;
+ int LayoutLineCount = 0;
+
+ // Functions
+ ExampleAssetsBrowser()
+ {
+ AddItems(10000);
+ }
+ void AddItems(int count)
+ {
+ if (Items.Size == 0)
+ NextItemId = 0;
+ Items.reserve(Items.Size + count);
+ for (int n = 0; n < count; n++, NextItemId++)
+ Items.push_back(ExampleAsset(NextItemId, (NextItemId % 20) < 15 ? 0 : (NextItemId % 20) < 18 ? 1 : 2));
+ RequestSort = true;
+ }
+ void ClearItems()
+ {
+ Items.clear();
+ Selection.Clear();
+ }
+
+ // Logic would be written in the main code BeginChild() and outputing to local variables.
+ // We extracted it into a function so we can call it easily from multiple places.
+ void UpdateLayoutSizes(float avail_width)
+ {
+ // Layout: when not stretching: allow extending into right-most spacing.
+ LayoutItemSpacing = (float)IconSpacing;
+ if (StretchSpacing == false)
+ avail_width += floorf(LayoutItemSpacing * 0.5f);
+
+ // Layout: calculate number of icon per line and number of lines
+ LayoutItemSize = ImVec2(floorf(IconSize), floorf(IconSize));
+ LayoutColumnCount = IM_MAX((int)(avail_width / (LayoutItemSize.x + LayoutItemSpacing)), 1);
+ LayoutLineCount = (Items.Size + LayoutColumnCount - 1) / LayoutColumnCount;
+
+ // Layout: when stretching: allocate remaining space to more spacing. Round before division, so item_spacing may be non-integer.
+ if (StretchSpacing && LayoutColumnCount > 1)
+ LayoutItemSpacing = floorf(avail_width - LayoutItemSize.x * LayoutColumnCount) / LayoutColumnCount;
+
+ LayoutItemStep = ImVec2(LayoutItemSize.x + LayoutItemSpacing, LayoutItemSize.y + LayoutItemSpacing);
+ LayoutSelectableSpacing = IM_MAX(floorf(LayoutItemSpacing) - IconHitSpacing, 0.0f);
+ LayoutOuterPadding = floorf(LayoutItemSpacing * 0.5f);
+ }
+
+ void Draw(const char* title, bool* p_open)
+ {
+ ImGui::SetNextWindowSize(ImVec2(IconSize * 25, IconSize * 15), ImGuiCond_FirstUseEver);
+ if (!ImGui::Begin(title, p_open, ImGuiWindowFlags_MenuBar))
+ {
+ ImGui::End();
+ return;
+ }
+
+ // Menu bar
+ if (ImGui::BeginMenuBar())
+ {
+ if (ImGui::BeginMenu("File"))
+ {
+ if (ImGui::MenuItem("Add 10000 items"))
+ AddItems(10000);
+ if (ImGui::MenuItem("Clear items"))
+ ClearItems();
+ ImGui::Separator();
+ if (ImGui::MenuItem("Close", NULL, false, p_open != NULL))
+ *p_open = false;
+ ImGui::EndMenu();
+ }
+ if (ImGui::BeginMenu("Edit"))
+ {
+ if (ImGui::MenuItem("Delete", "Del", false, Selection.Size > 0))
+ RequestDelete = true;
+ ImGui::EndMenu();
+ }
+ if (ImGui::BeginMenu("Options"))
+ {
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 10);
+
+ ImGui::SeparatorText("Contents");
+ ImGui::Checkbox("Show Type Overlay", &ShowTypeOverlay);
+ ImGui::Checkbox("Allow Sorting", &AllowSorting);
+
+ ImGui::SeparatorText("Selection Behavior");
+ ImGui::Checkbox("Allow dragging unselected item", &AllowDragUnselected);
+ ImGui::Checkbox("Allow box-selection", &AllowBoxSelect);
+
+ ImGui::SeparatorText("Layout");
+ ImGui::SliderFloat("Icon Size", &IconSize, 16.0f, 128.0f, "%.0f");
+ ImGui::SameLine(); HelpMarker("Use CTRL+Wheel to zoom");
+ ImGui::SliderInt("Icon Spacing", &IconSpacing, 0, 32);
+ ImGui::SliderInt("Icon Hit Spacing", &IconHitSpacing, 0, 32);
+ ImGui::Checkbox("Stretch Spacing", &StretchSpacing);
+ ImGui::PopItemWidth();
+ ImGui::EndMenu();
+ }
+ ImGui::EndMenuBar();
+ }
+
+ // Show a table with ONLY one header row to showcase the idea/possibility of using this to provide a sorting UI
+ if (AllowSorting)
+ {
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
+ ImGuiTableFlags table_flags_for_sort_specs = ImGuiTableFlags_Sortable | ImGuiTableFlags_SortMulti | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Borders;
+ if (ImGui::BeginTable("for_sort_specs_only", 2, table_flags_for_sort_specs, ImVec2(0.0f, ImGui::GetFrameHeight())))
+ {
+ ImGui::TableSetupColumn("Index");
+ ImGui::TableSetupColumn("Type");
+ ImGui::TableHeadersRow();
+ if (ImGuiTableSortSpecs* sort_specs = ImGui::TableGetSortSpecs())
+ if (sort_specs->SpecsDirty || RequestSort)
+ {
+ ExampleAsset::SortWithSortSpecs(sort_specs, Items.Data, Items.Size);
+ sort_specs->SpecsDirty = RequestSort = false;
+ }
+ ImGui::EndTable();
+ }
+ ImGui::PopStyleVar();
+ }
+
+ ImGuiIO& io = ImGui::GetIO();
+ ImGui::SetNextWindowContentSize(ImVec2(0.0f, LayoutOuterPadding + LayoutLineCount * (LayoutItemSize.y + LayoutItemSpacing)));
+ if (ImGui::BeginChild("Assets", ImVec2(0.0f, -ImGui::GetTextLineHeightWithSpacing()), ImGuiChildFlags_Borders, ImGuiWindowFlags_NoMove))
+ {
+ ImDrawList* draw_list = ImGui::GetWindowDrawList();
+
+ const float avail_width = ImGui::GetContentRegionAvail().x;
+ UpdateLayoutSizes(avail_width);
+
+ // Calculate and store start position.
+ ImVec2 start_pos = ImGui::GetCursorScreenPos();
+ start_pos = ImVec2(start_pos.x + LayoutOuterPadding, start_pos.y + LayoutOuterPadding);
+ ImGui::SetCursorScreenPos(start_pos);
+
+ // Multi-select
+ ImGuiMultiSelectFlags ms_flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_ClearOnClickVoid;
+
+ // - Enable box-select (in 2D mode, so that changing box-select rectangle X1/X2 boundaries will affect clipped items)
+ if (AllowBoxSelect)
+ ms_flags |= ImGuiMultiSelectFlags_BoxSelect2d;
+
+ // - This feature allows dragging an unselected item without selecting it (rarely used)
+ if (AllowDragUnselected)
+ ms_flags |= ImGuiMultiSelectFlags_SelectOnClickRelease;
+
+ // - Enable keyboard wrapping on X axis
+ // (FIXME-MULTISELECT: We haven't designed/exposed a general nav wrapping api yet, so this flag is provided as a courtesy to avoid doing:
+ // ImGui::NavMoveRequestTryWrapping(ImGui::GetCurrentWindow(), ImGuiNavMoveFlags_WrapX);
+ // When we finish implementing a more general API for this, we will obsolete this flag in favor of the new system)
+ ms_flags |= ImGuiMultiSelectFlags_NavWrapX;
+
+ ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(ms_flags, Selection.Size, Items.Size);
+
+ // Use custom selection adapter: store ID in selection (recommended)
+ Selection.UserData = this;
+ Selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self_, int idx) { ExampleAssetsBrowser* self = (ExampleAssetsBrowser*)self_->UserData; return self->Items[idx].ID; };
+ Selection.ApplyRequests(ms_io);
+
+ const bool want_delete = (ImGui::Shortcut(ImGuiKey_Delete, ImGuiInputFlags_Repeat) && (Selection.Size > 0)) || RequestDelete;
+ const int item_curr_idx_to_focus = want_delete ? Selection.ApplyDeletionPreLoop(ms_io, Items.Size) : -1;
+ RequestDelete = false;
+
+ // Push LayoutSelectableSpacing (which is LayoutItemSpacing minus hit-spacing, if we decide to have hit gaps between items)
+ // Altering style ItemSpacing may seem unnecessary as we position every items using SetCursorScreenPos()...
+ // But it is necessary for two reasons:
+ // - Selectables uses it by default to visually fill the space between two items.
+ // - The vertical spacing would be measured by Clipper to calculate line height if we didn't provide it explicitly (here we do).
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(LayoutSelectableSpacing, LayoutSelectableSpacing));
+
+ // Rendering parameters
+ const ImU32 icon_type_overlay_colors[3] = { 0, IM_COL32(200, 70, 70, 255), IM_COL32(70, 170, 70, 255) };
+ const ImU32 icon_bg_color = ImGui::GetColorU32(IM_COL32(35, 35, 35, 220));
+ const ImVec2 icon_type_overlay_size = ImVec2(4.0f, 4.0f);
+ const bool display_label = (LayoutItemSize.x >= ImGui::CalcTextSize("999").x);
+
+ const int column_count = LayoutColumnCount;
+ ImGuiListClipper clipper;
+ clipper.Begin(LayoutLineCount, LayoutItemStep.y);
+ if (item_curr_idx_to_focus != -1)
+ clipper.IncludeItemByIndex(item_curr_idx_to_focus / column_count); // Ensure focused item line is not clipped.
+ if (ms_io->RangeSrcItem != -1)
+ clipper.IncludeItemByIndex((int)ms_io->RangeSrcItem / column_count); // Ensure RangeSrc item line is not clipped.
+ while (clipper.Step())
+ {
+ for (int line_idx = clipper.DisplayStart; line_idx < clipper.DisplayEnd; line_idx++)
+ {
+ const int item_min_idx_for_current_line = line_idx * column_count;
+ const int item_max_idx_for_current_line = IM_MIN((line_idx + 1) * column_count, Items.Size);
+ for (int item_idx = item_min_idx_for_current_line; item_idx < item_max_idx_for_current_line; ++item_idx)
+ {
+ ExampleAsset* item_data = &Items[item_idx];
+ ImGui::PushID((int)item_data->ID);
+
+ // Position item
+ ImVec2 pos = ImVec2(start_pos.x + (item_idx % column_count) * LayoutItemStep.x, start_pos.y + line_idx * LayoutItemStep.y);
+ ImGui::SetCursorScreenPos(pos);
+
+ ImGui::SetNextItemSelectionUserData(item_idx);
+ bool item_is_selected = Selection.Contains((ImGuiID)item_data->ID);
+ bool item_is_visible = ImGui::IsRectVisible(LayoutItemSize);
+ ImGui::Selectable("", item_is_selected, ImGuiSelectableFlags_None, LayoutItemSize);
+
+ // Update our selection state immediately (without waiting for EndMultiSelect() requests)
+ // because we use this to alter the color of our text/icon.
+ if (ImGui::IsItemToggledSelection())
+ item_is_selected = !item_is_selected;
+
+ // Focus (for after deletion)
+ if (item_curr_idx_to_focus == item_idx)
+ ImGui::SetKeyboardFocusHere(-1);
+
+ // Drag and drop
+ if (ImGui::BeginDragDropSource())
+ {
+ // Create payload with full selection OR single unselected item.
+ // (the later is only possible when using ImGuiMultiSelectFlags_SelectOnClickRelease)
+ if (ImGui::GetDragDropPayload() == NULL)
+ {
+ ImVector<ImGuiID> payload_items;
+ void* it = NULL;
+ ImGuiID id = 0;
+ if (!item_is_selected)
+ payload_items.push_back(item_data->ID);
+ else
+ while (Selection.GetNextSelectedItem(&it, &id))
+ payload_items.push_back(id);
+ ImGui::SetDragDropPayload("ASSETS_BROWSER_ITEMS", payload_items.Data, (size_t)payload_items.size_in_bytes());
+ }
+
+ // Display payload content in tooltip, by extracting it from the payload data
+ // (we could read from selection, but it is more correct and reusable to read from payload)
+ const ImGuiPayload* payload = ImGui::GetDragDropPayload();
+ const int payload_count = (int)payload->DataSize / (int)sizeof(ImGuiID);
+ ImGui::Text("%d assets", payload_count);
+
+ ImGui::EndDragDropSource();
+ }
+
+ // Render icon (a real app would likely display an image/thumbnail here)
+ // Because we use ImGuiMultiSelectFlags_BoxSelect2d, clipping vertical may occasionally be larger, so we coarse-clip our rendering as well.
+ if (item_is_visible)
+ {
+ ImVec2 box_min(pos.x - 1, pos.y - 1);
+ ImVec2 box_max(box_min.x + LayoutItemSize.x + 2, box_min.y + LayoutItemSize.y + 2); // Dubious
+ draw_list->AddRectFilled(box_min, box_max, icon_bg_color); // Background color
+ if (ShowTypeOverlay && item_data->Type != 0)
+ {
+ ImU32 type_col = icon_type_overlay_colors[item_data->Type % IM_ARRAYSIZE(icon_type_overlay_colors)];
+ draw_list->AddRectFilled(ImVec2(box_max.x - 2 - icon_type_overlay_size.x, box_min.y + 2), ImVec2(box_max.x - 2, box_min.y + 2 + icon_type_overlay_size.y), type_col);
+ }
+ if (display_label)
+ {
+ ImU32 label_col = ImGui::GetColorU32(item_is_selected ? ImGuiCol_Text : ImGuiCol_TextDisabled);
+ char label[32];
+ sprintf(label, "%d", item_data->ID);
+ draw_list->AddText(ImVec2(box_min.x, box_max.y - ImGui::GetFontSize()), label_col, label);
+ }
+ }
+
+ ImGui::PopID();
+ }
+ }
+ }
+ clipper.End();
+ ImGui::PopStyleVar(); // ImGuiStyleVar_ItemSpacing
+
+ // Context menu
+ if (ImGui::BeginPopupContextWindow())
+ {
+ ImGui::Text("Selection: %d items", Selection.Size);
+ ImGui::Separator();
+ if (ImGui::MenuItem("Delete", "Del", false, Selection.Size > 0))
+ RequestDelete = true;
+ ImGui::EndPopup();
+ }
+
+ ms_io = ImGui::EndMultiSelect();
+ Selection.ApplyRequests(ms_io);
+ if (want_delete)
+ Selection.ApplyDeletionPostLoop(ms_io, Items, item_curr_idx_to_focus);
+
+ // Zooming with CTRL+Wheel
+ if (ImGui::IsWindowAppearing())
+ ZoomWheelAccum = 0.0f;
+ if (ImGui::IsWindowHovered() && io.MouseWheel != 0.0f && ImGui::IsKeyDown(ImGuiMod_Ctrl) && ImGui::IsAnyItemActive() == false)
+ {
+ ZoomWheelAccum += io.MouseWheel;
+ if (fabsf(ZoomWheelAccum) >= 1.0f)
+ {
+ // Calculate hovered item index from mouse location
+ // FIXME: Locking aiming on 'hovered_item_idx' (with a cool-down timer) would ensure zoom keeps on it.
+ const float hovered_item_nx = (io.MousePos.x - start_pos.x + LayoutItemSpacing * 0.5f) / LayoutItemStep.x;
+ const float hovered_item_ny = (io.MousePos.y - start_pos.y + LayoutItemSpacing * 0.5f) / LayoutItemStep.y;
+ const int hovered_item_idx = ((int)hovered_item_ny * LayoutColumnCount) + (int)hovered_item_nx;
+ //ImGui::SetTooltip("%f,%f -> item %d", hovered_item_nx, hovered_item_ny, hovered_item_idx); // Move those 4 lines in block above for easy debugging
+
+ // Zoom
+ IconSize *= powf(1.1f, (float)(int)ZoomWheelAccum);
+ IconSize = IM_CLAMP(IconSize, 16.0f, 128.0f);
+ ZoomWheelAccum -= (int)ZoomWheelAccum;
+ UpdateLayoutSizes(avail_width);
+
+ // Manipulate scroll to that we will land at the same Y location of currently hovered item.
+ // - Calculate next frame position of item under mouse
+ // - Set new scroll position to be used in next ImGui::BeginChild() call.
+ float hovered_item_rel_pos_y = ((float)(hovered_item_idx / LayoutColumnCount) + fmodf(hovered_item_ny, 1.0f)) * LayoutItemStep.y;
+ hovered_item_rel_pos_y += ImGui::GetStyle().WindowPadding.y;
+ float mouse_local_y = io.MousePos.y - ImGui::GetWindowPos().y;
+ ImGui::SetScrollY(hovered_item_rel_pos_y - mouse_local_y);
+ }
+ }
+ }
+ ImGui::EndChild();
+
+ ImGui::Text("Selected: %d/%d items", Selection.Size, Items.Size);
+ ImGui::End();
+ }
+};
+
+void ShowExampleAppAssetsBrowser(bool* p_open)
+{
+ IMGUI_DEMO_MARKER("Examples/Assets Browser");
+ static ExampleAssetsBrowser assets_browser;
+ assets_browser.Draw("Example: Assets Browser", p_open);
+}
+
// End of Demo code
#else
@@ -8058,6 +10678,8 @@ void ImGui::ShowAboutWindow(bool*) {}
void ImGui::ShowDemoWindow(bool*) {}
void ImGui::ShowUserGuide() {}
void ImGui::ShowStyleEditor(ImGuiStyle*) {}
+bool ImGui::ShowStyleSelector(const char* label) { return false; }
+void ImGui::ShowFontSelector(const char* label) {}
#endif
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
index 859b62e7e97..27310152918 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.89.1 WIP
+// dear imgui, v1.91.9b
// (drawing and font code)
/*
@@ -8,12 +8,13 @@ Index of this file:
// [SECTION] STB libraries implementation
// [SECTION] Style functions
// [SECTION] ImDrawList
+// [SECTION] ImTriangulator, ImDrawList concave polygon fill
// [SECTION] ImDrawListSplitter
// [SECTION] ImDrawData
// [SECTION] Helpers ShadeVertsXXX functions
// [SECTION] ImFontConfig
// [SECTION] ImFontAtlas
-// [SECTION] ImFontAtlas glyph ranges helpers
+// [SECTION] ImFontAtlas: glyph ranges helpers
// [SECTION] ImFontGlyphRangesBuilder
// [SECTION] ImFont
// [SECTION] ImGui Internal Render Helpers
@@ -26,13 +27,12 @@ Index of this file:
#define _CRT_SECURE_NO_WARNINGS
#endif
-#include "imgui.h"
-#ifndef IMGUI_DISABLE
-
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
+#include "imgui.h"
+#ifndef IMGUI_DISABLE
#include "imgui_internal.h"
#ifdef IMGUI_ENABLE_FREETYPE
#include "misc/freetype/imgui_freetype.h"
@@ -64,13 +64,21 @@ Index of this file:
#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning: macro name is a reserved identifier
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
+#pragma clang diagnostic ignored "-Wreserved-identifier" // warning: identifier '_Xxx' is reserved because it starts with '_' followed by a capital letter
+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
+#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
+#pragma clang diagnostic ignored "-Wcast-qual" // warning: cast from 'const xxxx *' to 'xxx *' drops const qualifier
+#pragma clang diagnostic ignored "-Wswitch-default" // warning: 'switch' missing 'default' label
#elif defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
-#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
-#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
-#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
-#pragma GCC diagnostic ignored "-Wstack-protector" // warning: stack protector not protecting local variables: variable length buffer
-#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
+#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
+#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
+#pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe
+#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
+#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
+#pragma GCC diagnostic ignored "-Wstack-protector" // warning: stack protector not protecting local variables: variable length buffer
+#pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when simplifying division / ..when changing X +- C1 cmp C2 to X cmp C2 -+ C1
+#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
+#pragma GCC diagnostic ignored "-Wcast-qual" // warning: cast from type 'const xxxx *' to type 'xxxx *' casts away qualifiers
#endif
//-------------------------------------------------------------------------
@@ -99,16 +107,15 @@ namespace IMGUI_STB_NAMESPACE
#if defined(__clang__)
#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-function"
+#pragma clang diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
-#pragma clang diagnostic ignored "-Wcast-qual" // warning: cast from 'const xxxx *' to 'xxx *' drops const qualifier
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtype-limits" // warning: comparison is always true due to limited range of data type [-Wtype-limits]
-#pragma GCC diagnostic ignored "-Wcast-qual" // warning: cast from type 'const xxxx *' to type 'xxxx *' casts away qualifiers
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" // warning: this statement may fall through
#endif
#ifndef STB_RECT_PACK_IMPLEMENTATION // in case the user already have an implementation in the _same_ compilation unit (e.g. unity builds)
@@ -135,8 +142,9 @@ namespace IMGUI_STB_NAMESPACE
#define STBTT_sqrt(x) ImSqrt(x)
#define STBTT_pow(x,y) ImPow(x,y)
#define STBTT_fabs(x) ImFabs(x)
-#define STBTT_ifloor(x) ((int)ImFloorSigned(x))
+#define STBTT_ifloor(x) ((int)ImFloor(x))
#define STBTT_iceil(x) ((int)ImCeil(x))
+#define STBTT_strlen(x) ImStrlen(x)
#define STBTT_STATIC
#define STB_TRUETYPE_IMPLEMENTATION
#else
@@ -209,11 +217,13 @@ void ImGui::StyleColorsDark(ImGuiStyle* dst)
colors[ImGuiCol_ResizeGrip] = ImVec4(0.26f, 0.59f, 0.98f, 0.20f);
colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f);
- colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f);
colors[ImGuiCol_TabHovered] = colors[ImGuiCol_HeaderHovered];
- colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f);
- colors[ImGuiCol_TabUnfocused] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f);
- colors[ImGuiCol_TabUnfocusedActive] = ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f);
+ colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f);
+ colors[ImGuiCol_TabSelected] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f);
+ colors[ImGuiCol_TabSelectedOverline] = colors[ImGuiCol_HeaderActive];
+ colors[ImGuiCol_TabDimmed] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f);
+ colors[ImGuiCol_TabDimmedSelected] = ImLerp(colors[ImGuiCol_TabSelected], colors[ImGuiCol_TitleBg], 0.40f);
+ colors[ImGuiCol_TabDimmedSelectedOverline] = ImVec4(0.50f, 0.50f, 0.50f, 0.00f);
colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
@@ -223,9 +233,10 @@ void ImGui::StyleColorsDark(ImGuiStyle* dst)
colors[ImGuiCol_TableBorderLight] = ImVec4(0.23f, 0.23f, 0.25f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.06f);
+ colors[ImGuiCol_TextLink] = colors[ImGuiCol_HeaderActive];
colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f);
colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f);
- colors[ImGuiCol_NavHighlight] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
+ colors[ImGuiCol_NavCursor] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f);
colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f);
colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f);
@@ -269,11 +280,13 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst)
colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f);
colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.78f, 0.82f, 1.00f, 0.60f);
colors[ImGuiCol_ResizeGripActive] = ImVec4(0.78f, 0.82f, 1.00f, 0.90f);
- colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f);
colors[ImGuiCol_TabHovered] = colors[ImGuiCol_HeaderHovered];
- colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f);
- colors[ImGuiCol_TabUnfocused] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f);
- colors[ImGuiCol_TabUnfocusedActive] = ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f);
+ colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f);
+ colors[ImGuiCol_TabSelected] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f);
+ colors[ImGuiCol_TabSelectedOverline] = colors[ImGuiCol_HeaderActive];
+ colors[ImGuiCol_TabDimmed] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f);
+ colors[ImGuiCol_TabDimmedSelected] = ImLerp(colors[ImGuiCol_TabSelected], colors[ImGuiCol_TitleBg], 0.40f);
+ colors[ImGuiCol_TabDimmedSelectedOverline] = ImVec4(0.53f, 0.53f, 0.87f, 0.00f);
colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
@@ -283,9 +296,10 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst)
colors[ImGuiCol_TableBorderLight] = ImVec4(0.26f, 0.26f, 0.28f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.07f);
+ colors[ImGuiCol_TextLink] = colors[ImGuiCol_HeaderActive];
colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f);
colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f);
- colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered];
+ colors[ImGuiCol_NavCursor] = colors[ImGuiCol_HeaderHovered];
colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f);
colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f);
colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
@@ -330,11 +344,13 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst)
colors[ImGuiCol_ResizeGrip] = ImVec4(0.35f, 0.35f, 0.35f, 0.17f);
colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f);
- colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.90f);
colors[ImGuiCol_TabHovered] = colors[ImGuiCol_HeaderHovered];
- colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f);
- colors[ImGuiCol_TabUnfocused] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f);
- colors[ImGuiCol_TabUnfocusedActive] = ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f);
+ colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.90f);
+ colors[ImGuiCol_TabSelected] = ImLerp(colors[ImGuiCol_HeaderActive], colors[ImGuiCol_TitleBgActive], 0.60f);
+ colors[ImGuiCol_TabSelectedOverline] = colors[ImGuiCol_HeaderActive];
+ colors[ImGuiCol_TabDimmed] = ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f);
+ colors[ImGuiCol_TabDimmedSelected] = ImLerp(colors[ImGuiCol_TabSelected], colors[ImGuiCol_TitleBg], 0.40f);
+ colors[ImGuiCol_TabDimmedSelectedOverline] = ImVec4(0.26f, 0.59f, 1.00f, 0.00f);
colors[ImGuiCol_PlotLines] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
@@ -344,9 +360,10 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst)
colors[ImGuiCol_TableBorderLight] = ImVec4(0.68f, 0.68f, 0.74f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_TableRowBgAlt] = ImVec4(0.30f, 0.30f, 0.30f, 0.09f);
+ colors[ImGuiCol_TextLink] = colors[ImGuiCol_HeaderActive];
colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f);
colors[ImGuiCol_DragDropTarget] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f);
- colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered];
+ colors[ImGuiCol_NavCursor] = colors[ImGuiCol_HeaderHovered];
colors[ImGuiCol_NavWindowingHighlight] = ImVec4(0.70f, 0.70f, 0.70f, 0.70f);
colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.20f);
colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
@@ -359,6 +376,7 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst)
ImDrawListSharedData::ImDrawListSharedData()
{
memset(this, 0, sizeof(*this));
+ InitialFringeScale = 1.0f;
for (int i = 0; i < IM_ARRAYSIZE(ArcFastVtx); i++)
{
const float a = ((float)i * 2 * IM_PI) / (float)IM_ARRAYSIZE(ArcFastVtx);
@@ -382,13 +400,27 @@ void ImDrawListSharedData::SetCircleTessellationMaxError(float max_error)
ArcFastRadiusCutoff = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(IM_DRAWLIST_ARCFAST_SAMPLE_MAX, CircleSegmentMaxError);
}
+ImDrawList::ImDrawList(ImDrawListSharedData* shared_data)
+{
+ memset(this, 0, sizeof(*this));
+ _Data = shared_data;
+}
+
+ImDrawList::~ImDrawList()
+{
+ _ClearFreeMemory();
+}
+
// Initialize before use in a new frame. We always have a command ready in the buffer.
+// In the majority of cases, you would want to call PushClipRect() and PushTextureID() after this.
void ImDrawList::_ResetForNewFrame()
{
// Verify that the ImDrawCmd fields we want to memcmp() are contiguous in memory.
- IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0);
- IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4));
- IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID));
+ IM_STATIC_ASSERT(offsetof(ImDrawCmd, ClipRect) == 0);
+ IM_STATIC_ASSERT(offsetof(ImDrawCmd, TextureId) == sizeof(ImVec4));
+ IM_STATIC_ASSERT(offsetof(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID));
+ if (_Splitter._Count > 1)
+ _Splitter.Merge(this);
CmdBuffer.resize(0);
IdxBuffer.resize(0);
@@ -400,10 +432,11 @@ void ImDrawList::_ResetForNewFrame()
_IdxWritePtr = NULL;
_ClipRectStack.resize(0);
_TextureIdStack.resize(0);
+ _CallbacksDataBuf.resize(0);
_Path.resize(0);
_Splitter.Clear();
CmdBuffer.push_back(ImDrawCmd());
- _FringeScale = 1.0f;
+ _FringeScale = _Data->InitialFringeScale;
}
void ImDrawList::_ClearFreeMemory()
@@ -417,6 +450,7 @@ void ImDrawList::_ClearFreeMemory()
_IdxWritePtr = NULL;
_ClipRectStack.clear();
_TextureIdStack.clear();
+ _CallbacksDataBuf.clear();
_Path.clear();
_Splitter.ClearFreeMemory();
}
@@ -447,14 +481,16 @@ void ImDrawList::AddDrawCmd()
// Note that this leaves the ImDrawList in a state unfit for further commands, as most code assume that CmdBuffer.Size > 0 && CmdBuffer.back().UserCallback == NULL
void ImDrawList::_PopUnusedDrawCmd()
{
- if (CmdBuffer.Size == 0)
- return;
- ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
- if (curr_cmd->ElemCount == 0 && curr_cmd->UserCallback == NULL)
+ while (CmdBuffer.Size > 0)
+ {
+ ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
+ if (curr_cmd->ElemCount != 0 || curr_cmd->UserCallback != NULL)
+ return;// break;
CmdBuffer.pop_back();
+ }
}
-void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
+void ImDrawList::AddCallback(ImDrawCallback callback, void* userdata, size_t userdata_size)
{
IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
@@ -464,14 +500,32 @@ void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
AddDrawCmd();
curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
}
+
curr_cmd->UserCallback = callback;
- curr_cmd->UserCallbackData = callback_data;
+ if (userdata_size == 0)
+ {
+ // Store user data directly in command (no indirection)
+ curr_cmd->UserCallbackData = userdata;
+ curr_cmd->UserCallbackDataSize = 0;
+ curr_cmd->UserCallbackDataOffset = -1;
+ }
+ else
+ {
+ // Copy and store user data in a buffer
+ IM_ASSERT(userdata != NULL);
+ IM_ASSERT(userdata_size < (1u << 31));
+ curr_cmd->UserCallbackData = NULL; // Will be resolved during Render()
+ curr_cmd->UserCallbackDataSize = (int)userdata_size;
+ curr_cmd->UserCallbackDataOffset = _CallbacksDataBuf.Size;
+ _CallbacksDataBuf.resize(_CallbacksDataBuf.Size + (int)userdata_size);
+ memcpy(_CallbacksDataBuf.Data + (size_t)curr_cmd->UserCallbackDataOffset, userdata, userdata_size);
+ }
AddDrawCmd(); // Force a new command after us (see comment below)
}
// Compare ClipRect, TextureId and VtxOffset with a single memcmp()
-#define ImDrawCmd_HeaderSize (IM_OFFSETOF(ImDrawCmd, VtxOffset) + sizeof(unsigned int))
+#define ImDrawCmd_HeaderSize (offsetof(ImDrawCmd, VtxOffset) + sizeof(unsigned int))
#define ImDrawCmd_HeaderCompare(CMD_LHS, CMD_RHS) (memcmp(CMD_LHS, CMD_RHS, ImDrawCmd_HeaderSize)) // Compare ClipRect, TextureId, VtxOffset
#define ImDrawCmd_HeaderCopy(CMD_DST, CMD_SRC) (memcpy(CMD_DST, CMD_SRC, ImDrawCmd_HeaderSize)) // Copy ClipRect, TextureId, VtxOffset
#define ImDrawCmd_AreSequentialIdxOffset(CMD_0, CMD_1) (CMD_0->IdxOffset + CMD_0->ElemCount == CMD_1->IdxOffset)
@@ -510,7 +564,6 @@ void ImDrawList::_OnChangedClipRect()
CmdBuffer.pop_back();
return;
}
-
curr_cmd->ClipRect = _CmdHeader.ClipRect;
}
@@ -533,7 +586,6 @@ void ImDrawList::_OnChangedTextureID()
CmdBuffer.pop_back();
return;
}
-
curr_cmd->TextureId = _CmdHeader.TextureId;
}
@@ -557,7 +609,7 @@ int ImDrawList::_CalcCircleAutoSegmentCount(float radius) const
{
// Automatic segment count
const int radius_idx = (int)(radius + 0.999999f); // ceil to never reduce accuracy
- if (radius_idx < IM_ARRAYSIZE(_Data->CircleSegmentCounts))
+ if (radius_idx >= 0 && radius_idx < IM_ARRAYSIZE(_Data->CircleSegmentCounts))
return _Data->CircleSegmentCounts[radius_idx]; // Use cached value
else
return IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, _Data->CircleSegmentMaxError);
@@ -609,6 +661,15 @@ void ImDrawList::PopTextureID()
_OnChangedTextureID();
}
+// This is used by ImGui::PushFont()/PopFont(). It works because we never use _TextureIdStack[] elsewhere than in PushTextureID()/PopTextureID().
+void ImDrawList::_SetTextureID(ImTextureID texture_id)
+{
+ if (_CmdHeader.TextureId == texture_id)
+ return;
+ _CmdHeader.TextureId = texture_id;
+ _OnChangedTextureID();
+}
+
// Reserve space for a number of vertices and indices.
// You must finish filling your reserved data before calling PrimReserve() again, as it may reallocate or
// submit the intermediate results. PrimUnreserve() can be used to release unused allocations.
@@ -637,7 +698,7 @@ void ImDrawList::PrimReserve(int idx_count, int vtx_count)
_IdxWritePtr = IdxBuffer.Data + idx_buffer_old_size;
}
-// Release the a number of reserved vertices/indices from the end of the last reservation made with PrimReserve().
+// Release the number of reserved vertices/indices from the end of the last reservation made with PrimReserve().
void ImDrawList::PrimUnreserve(int idx_count, int vtx_count)
{
IM_ASSERT_PARANOID(idx_count >= 0 && vtx_count >= 0);
@@ -704,7 +765,7 @@ void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, c
// We avoid using the ImVec2 math operators here to reduce cost to a minimum for debug/non-inlined builds.
void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, ImDrawFlags flags, float thickness)
{
- if (points_count < 2)
+ if (points_count < 2 || (col & IM_COL32_A_MASK) == 0)
return;
const bool closed = (flags & ImDrawFlags_Closed) != 0;
@@ -962,7 +1023,7 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col)
{
- if (points_count < 3)
+ if (points_count < 3 || (col & IM_COL32_A_MASK) == 0)
return;
const ImVec2 uv = _Data->TexUvWhitePixel;
@@ -1187,8 +1248,8 @@ void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, floa
const float a_min_sample_f = IM_DRAWLIST_ARCFAST_SAMPLE_MAX * a_min / (IM_PI * 2.0f);
const float a_max_sample_f = IM_DRAWLIST_ARCFAST_SAMPLE_MAX * a_max / (IM_PI * 2.0f);
- const int a_min_sample = a_is_reverse ? (int)ImFloorSigned(a_min_sample_f) : (int)ImCeil(a_min_sample_f);
- const int a_max_sample = a_is_reverse ? (int)ImCeil(a_max_sample_f) : (int)ImFloorSigned(a_max_sample_f);
+ const int a_min_sample = a_is_reverse ? (int)ImFloor(a_min_sample_f) : (int)ImCeil(a_min_sample_f);
+ const int a_max_sample = a_is_reverse ? (int)ImCeil(a_max_sample_f) : (int)ImFloor(a_max_sample_f);
const int a_mid_samples = a_is_reverse ? ImMax(a_min_sample - a_max_sample, 0) : ImMax(a_max_sample - a_min_sample, 0);
const float a_min_segment_angle = a_min_sample * IM_PI * 2.0f / IM_DRAWLIST_ARCFAST_SAMPLE_MAX;
@@ -1213,6 +1274,26 @@ void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, floa
}
}
+void ImDrawList::PathEllipticalArcTo(const ImVec2& center, const ImVec2& radius, float rot, float a_min, float a_max, int num_segments)
+{
+ if (num_segments <= 0)
+ num_segments = _CalcCircleAutoSegmentCount(ImMax(radius.x, radius.y)); // A bit pessimistic, maybe there's a better computation to do here.
+
+ _Path.reserve(_Path.Size + (num_segments + 1));
+
+ const float cos_rot = ImCos(rot);
+ const float sin_rot = ImSin(rot);
+ for (int i = 0; i <= num_segments; i++)
+ {
+ const float a = a_min + ((float)i / (float)num_segments) * (a_max - a_min);
+ ImVec2 point(ImCos(a) * radius.x, ImSin(a) * radius.y);
+ const ImVec2 rel((point.x * cos_rot) - (point.y * sin_rot), (point.x * sin_rot) + (point.y * cos_rot));
+ point.x = rel.x + center.x;
+ point.y = rel.y + center.y;
+ _Path.push_back(point);
+ }
+}
+
ImVec2 ImBezierCubicCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t)
{
float u = 1.0f - t;
@@ -1308,33 +1389,22 @@ void ImDrawList::PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3,
}
}
-IM_STATIC_ASSERT(ImDrawFlags_RoundCornersTopLeft == (1 << 4));
static inline ImDrawFlags FixRectCornerFlags(ImDrawFlags flags)
{
+ /*
+ IM_STATIC_ASSERT(ImDrawFlags_RoundCornersTopLeft == (1 << 4));
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- // Obsoleted in 1.82 (from February 2021)
- // Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All)
- // ~0 --> ImDrawFlags_RoundCornersAll or 0
- if (flags == ~0)
- return ImDrawFlags_RoundCornersAll;
-
- // Legacy Support for hard coded 0x01 to 0x0F (matching 15 out of 16 old flags combinations)
- // 0x01 --> ImDrawFlags_RoundCornersTopLeft (VALUE 0x01 OVERLAPS ImDrawFlags_Closed but ImDrawFlags_Closed is never valid in this path!)
- // 0x02 --> ImDrawFlags_RoundCornersTopRight
- // 0x03 --> ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight
- // 0x04 --> ImDrawFlags_RoundCornersBotLeft
- // 0x05 --> ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersBotLeft
- // ...
- // 0x0F --> ImDrawFlags_RoundCornersAll or 0
- // (See all values in ImDrawCornerFlags_)
- if (flags >= 0x01 && flags <= 0x0F)
- return (flags << 4);
-
+ // Obsoleted in 1.82 (from February 2021). This code was stripped/simplified and mostly commented in 1.90 (from September 2023)
+ // - Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All)
+ if (flags == ~0) { return ImDrawFlags_RoundCornersAll; }
+ // - Legacy Support for hard coded 0x01 to 0x0F (matching 15 out of 16 old flags combinations). Read details in older version of this code.
+ if (flags >= 0x01 && flags <= 0x0F) { return (flags << 4); }
// We cannot support hard coded 0x00 with 'float rounding > 0.0f' --> replace with ImDrawFlags_RoundCornersNone or use 'float rounding = 0.0f'
#endif
-
- // If this triggers, please update your code replacing hardcoded values with new ImDrawFlags_RoundCorners* values.
- // Note that ImDrawFlags_Closed (== 0x01) is an invalid flag for AddRect(), AddRectFilled(), PathRect() etc...
+ */
+ // If this assert triggers, please update your code replacing hardcoded values with new ImDrawFlags_RoundCorners* values.
+ // Note that ImDrawFlags_Closed (== 0x01) is an invalid flag for AddRect(), AddRectFilled(), PathRect() etc. anyway.
+ // See details in 1.82 Changelog as well as 2021/03/12 and 2023/09/08 entries in "API BREAKING CHANGES" section.
IM_ASSERT((flags & 0x0F) == 0 && "Misuse of legacy hardcoded ImDrawCornerFlags values!");
if ((flags & ImDrawFlags_RoundCornersMask_) == 0)
@@ -1345,10 +1415,12 @@ static inline ImDrawFlags FixRectCornerFlags(ImDrawFlags flags)
void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, ImDrawFlags flags)
{
- flags = FixRectCornerFlags(flags);
- rounding = ImMin(rounding, ImFabs(b.x - a.x) * ( ((flags & ImDrawFlags_RoundCornersTop) == ImDrawFlags_RoundCornersTop) || ((flags & ImDrawFlags_RoundCornersBottom) == ImDrawFlags_RoundCornersBottom) ? 0.5f : 1.0f ) - 1.0f);
- rounding = ImMin(rounding, ImFabs(b.y - a.y) * ( ((flags & ImDrawFlags_RoundCornersLeft) == ImDrawFlags_RoundCornersLeft) || ((flags & ImDrawFlags_RoundCornersRight) == ImDrawFlags_RoundCornersRight) ? 0.5f : 1.0f ) - 1.0f);
-
+ if (rounding >= 0.5f)
+ {
+ flags = FixRectCornerFlags(flags);
+ rounding = ImMin(rounding, ImFabs(b.x - a.x) * (((flags & ImDrawFlags_RoundCornersTop) == ImDrawFlags_RoundCornersTop) || ((flags & ImDrawFlags_RoundCornersBottom) == ImDrawFlags_RoundCornersBottom) ? 0.5f : 1.0f) - 1.0f);
+ rounding = ImMin(rounding, ImFabs(b.y - a.y) * (((flags & ImDrawFlags_RoundCornersLeft) == ImDrawFlags_RoundCornersLeft) || ((flags & ImDrawFlags_RoundCornersRight) == ImDrawFlags_RoundCornersRight) ? 0.5f : 1.0f) - 1.0f);
+ }
if (rounding < 0.5f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
{
PathLineTo(a);
@@ -1541,6 +1613,35 @@ void ImDrawList::AddNgonFilled(const ImVec2& center, float radius, ImU32 col, in
PathFillConvex(col);
}
+// Ellipse
+void ImDrawList::AddEllipse(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot, int num_segments, float thickness)
+{
+ if ((col & IM_COL32_A_MASK) == 0)
+ return;
+
+ if (num_segments <= 0)
+ num_segments = _CalcCircleAutoSegmentCount(ImMax(radius.x, radius.y)); // A bit pessimistic, maybe there's a better computation to do here.
+
+ // Because we are filling a closed shape we remove 1 from the count of segments/points
+ const float a_max = IM_PI * 2.0f * ((float)num_segments - 1.0f) / (float)num_segments;
+ PathEllipticalArcTo(center, radius, rot, 0.0f, a_max, num_segments - 1);
+ PathStroke(col, true, thickness);
+}
+
+void ImDrawList::AddEllipseFilled(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot, int num_segments)
+{
+ if ((col & IM_COL32_A_MASK) == 0)
+ return;
+
+ if (num_segments <= 0)
+ num_segments = _CalcCircleAutoSegmentCount(ImMax(radius.x, radius.y)); // A bit pessimistic, maybe there's a better computation to do here.
+
+ // Because we are filling a closed shape we remove 1 from the count of segments/points
+ const float a_max = IM_PI * 2.0f * ((float)num_segments - 1.0f) / (float)num_segments;
+ PathEllipticalArcTo(center, radius, rot, 0.0f, a_max, num_segments - 1);
+ PathFillConvex(col);
+}
+
// Cubic Bezier takes 4 controls points
void ImDrawList::AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments)
{
@@ -1563,15 +1664,15 @@ void ImDrawList::AddBezierQuadratic(const ImVec2& p1, const ImVec2& p2, const Im
PathStroke(col, 0, thickness);
}
-void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect)
+void ImDrawList::AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect)
{
if ((col & IM_COL32_A_MASK) == 0)
return;
- if (text_end == NULL)
- text_end = text_begin + strlen(text_begin);
- if (text_begin == text_end)
+ // Accept null ranges
+ if (text_begin == text_end || text_begin[0] == 0)
return;
+ // No need to strlen() here: font->RenderText() will do it and may early out.
// Pull default font/size from the shared ImDrawListSharedData instance
if (font == NULL)
@@ -1594,7 +1695,7 @@ void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos,
void ImDrawList::AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end)
{
- AddText(NULL, 0.0f, pos, col, text_begin, text_end);
+ AddText(_Data->Font, _Data->FontSize, pos, col, text_begin, text_end);
}
void ImDrawList::AddImage(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col)
@@ -1655,6 +1756,316 @@ void ImDrawList::AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_mi
PopTextureID();
}
+//-----------------------------------------------------------------------------
+// [SECTION] ImTriangulator, ImDrawList concave polygon fill
+//-----------------------------------------------------------------------------
+// Triangulate concave polygons. Based on "Triangulation by Ear Clipping" paper, O(N^2) complexity.
+// Reference: https://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf
+// Provided as a convenience for user but not used by main library.
+//-----------------------------------------------------------------------------
+// - ImTriangulator [Internal]
+// - AddConcavePolyFilled()
+//-----------------------------------------------------------------------------
+
+enum ImTriangulatorNodeType
+{
+ ImTriangulatorNodeType_Convex,
+ ImTriangulatorNodeType_Ear,
+ ImTriangulatorNodeType_Reflex
+};
+
+struct ImTriangulatorNode
+{
+ ImTriangulatorNodeType Type;
+ int Index;
+ ImVec2 Pos;
+ ImTriangulatorNode* Next;
+ ImTriangulatorNode* Prev;
+
+ void Unlink() { Next->Prev = Prev; Prev->Next = Next; }
+};
+
+struct ImTriangulatorNodeSpan
+{
+ ImTriangulatorNode** Data = NULL;
+ int Size = 0;
+
+ void push_back(ImTriangulatorNode* node) { Data[Size++] = node; }
+ void find_erase_unsorted(int idx) { for (int i = Size - 1; i >= 0; i--) if (Data[i]->Index == idx) { Data[i] = Data[Size - 1]; Size--; return; } }
+};
+
+struct ImTriangulator
+{
+ static int EstimateTriangleCount(int points_count) { return (points_count < 3) ? 0 : points_count - 2; }
+ static int EstimateScratchBufferSize(int points_count) { return sizeof(ImTriangulatorNode) * points_count + sizeof(ImTriangulatorNode*) * points_count * 2; }
+
+ void Init(const ImVec2* points, int points_count, void* scratch_buffer);
+ void GetNextTriangle(unsigned int out_triangle[3]); // Return relative indexes for next triangle
+
+ // Internal functions
+ void BuildNodes(const ImVec2* points, int points_count);
+ void BuildReflexes();
+ void BuildEars();
+ void FlipNodeList();
+ bool IsEar(int i0, int i1, int i2, const ImVec2& v0, const ImVec2& v1, const ImVec2& v2) const;
+ void ReclassifyNode(ImTriangulatorNode* node);
+
+ // Internal members
+ int _TrianglesLeft = 0;
+ ImTriangulatorNode* _Nodes = NULL;
+ ImTriangulatorNodeSpan _Ears;
+ ImTriangulatorNodeSpan _Reflexes;
+};
+
+// Distribute storage for nodes, ears and reflexes.
+// FIXME-OPT: if everything is convex, we could report it to caller and let it switch to an convex renderer
+// (this would require first building reflexes to bail to convex if empty, without even building nodes)
+void ImTriangulator::Init(const ImVec2* points, int points_count, void* scratch_buffer)
+{
+ IM_ASSERT(scratch_buffer != NULL && points_count >= 3);
+ _TrianglesLeft = EstimateTriangleCount(points_count);
+ _Nodes = (ImTriangulatorNode*)scratch_buffer; // points_count x Node
+ _Ears.Data = (ImTriangulatorNode**)(_Nodes + points_count); // points_count x Node*
+ _Reflexes.Data = (ImTriangulatorNode**)(_Nodes + points_count) + points_count; // points_count x Node*
+ BuildNodes(points, points_count);
+ BuildReflexes();
+ BuildEars();
+}
+
+void ImTriangulator::BuildNodes(const ImVec2* points, int points_count)
+{
+ for (int i = 0; i < points_count; i++)
+ {
+ _Nodes[i].Type = ImTriangulatorNodeType_Convex;
+ _Nodes[i].Index = i;
+ _Nodes[i].Pos = points[i];
+ _Nodes[i].Next = _Nodes + i + 1;
+ _Nodes[i].Prev = _Nodes + i - 1;
+ }
+ _Nodes[0].Prev = _Nodes + points_count - 1;
+ _Nodes[points_count - 1].Next = _Nodes;
+}
+
+void ImTriangulator::BuildReflexes()
+{
+ ImTriangulatorNode* n1 = _Nodes;
+ for (int i = _TrianglesLeft; i >= 0; i--, n1 = n1->Next)
+ {
+ if (ImTriangleIsClockwise(n1->Prev->Pos, n1->Pos, n1->Next->Pos))
+ continue;
+ n1->Type = ImTriangulatorNodeType_Reflex;
+ _Reflexes.push_back(n1);
+ }
+}
+
+void ImTriangulator::BuildEars()
+{
+ ImTriangulatorNode* n1 = _Nodes;
+ for (int i = _TrianglesLeft; i >= 0; i--, n1 = n1->Next)
+ {
+ if (n1->Type != ImTriangulatorNodeType_Convex)
+ continue;
+ if (!IsEar(n1->Prev->Index, n1->Index, n1->Next->Index, n1->Prev->Pos, n1->Pos, n1->Next->Pos))
+ continue;
+ n1->Type = ImTriangulatorNodeType_Ear;
+ _Ears.push_back(n1);
+ }
+}
+
+void ImTriangulator::GetNextTriangle(unsigned int out_triangle[3])
+{
+ if (_Ears.Size == 0)
+ {
+ FlipNodeList();
+
+ ImTriangulatorNode* node = _Nodes;
+ for (int i = _TrianglesLeft; i >= 0; i--, node = node->Next)
+ node->Type = ImTriangulatorNodeType_Convex;
+ _Reflexes.Size = 0;
+ BuildReflexes();
+ BuildEars();
+
+ // If we still don't have ears, it means geometry is degenerated.
+ if (_Ears.Size == 0)
+ {
+ // Return first triangle available, mimicking the behavior of convex fill.
+ IM_ASSERT(_TrianglesLeft > 0); // Geometry is degenerated
+ _Ears.Data[0] = _Nodes;
+ _Ears.Size = 1;
+ }
+ }
+
+ ImTriangulatorNode* ear = _Ears.Data[--_Ears.Size];
+ out_triangle[0] = ear->Prev->Index;
+ out_triangle[1] = ear->Index;
+ out_triangle[2] = ear->Next->Index;
+
+ ear->Unlink();
+ if (ear == _Nodes)
+ _Nodes = ear->Next;
+
+ ReclassifyNode(ear->Prev);
+ ReclassifyNode(ear->Next);
+ _TrianglesLeft--;
+}
+
+void ImTriangulator::FlipNodeList()
+{
+ ImTriangulatorNode* prev = _Nodes;
+ ImTriangulatorNode* temp = _Nodes;
+ ImTriangulatorNode* current = _Nodes->Next;
+ prev->Next = prev;
+ prev->Prev = prev;
+ while (current != _Nodes)
+ {
+ temp = current->Next;
+
+ current->Next = prev;
+ prev->Prev = current;
+ _Nodes->Next = current;
+ current->Prev = _Nodes;
+
+ prev = current;
+ current = temp;
+ }
+ _Nodes = prev;
+}
+
+// A triangle is an ear is no other vertex is inside it. We can test reflexes vertices only (see reference algorithm)
+bool ImTriangulator::IsEar(int i0, int i1, int i2, const ImVec2& v0, const ImVec2& v1, const ImVec2& v2) const
+{
+ ImTriangulatorNode** p_end = _Reflexes.Data + _Reflexes.Size;
+ for (ImTriangulatorNode** p = _Reflexes.Data; p < p_end; p++)
+ {
+ ImTriangulatorNode* reflex = *p;
+ if (reflex->Index != i0 && reflex->Index != i1 && reflex->Index != i2)
+ if (ImTriangleContainsPoint(v0, v1, v2, reflex->Pos))
+ return false;
+ }
+ return true;
+}
+
+void ImTriangulator::ReclassifyNode(ImTriangulatorNode* n1)
+{
+ // Classify node
+ ImTriangulatorNodeType type;
+ const ImTriangulatorNode* n0 = n1->Prev;
+ const ImTriangulatorNode* n2 = n1->Next;
+ if (!ImTriangleIsClockwise(n0->Pos, n1->Pos, n2->Pos))
+ type = ImTriangulatorNodeType_Reflex;
+ else if (IsEar(n0->Index, n1->Index, n2->Index, n0->Pos, n1->Pos, n2->Pos))
+ type = ImTriangulatorNodeType_Ear;
+ else
+ type = ImTriangulatorNodeType_Convex;
+
+ // Update lists when a type changes
+ if (type == n1->Type)
+ return;
+ if (n1->Type == ImTriangulatorNodeType_Reflex)
+ _Reflexes.find_erase_unsorted(n1->Index);
+ else if (n1->Type == ImTriangulatorNodeType_Ear)
+ _Ears.find_erase_unsorted(n1->Index);
+ if (type == ImTriangulatorNodeType_Reflex)
+ _Reflexes.push_back(n1);
+ else if (type == ImTriangulatorNodeType_Ear)
+ _Ears.push_back(n1);
+ n1->Type = type;
+}
+
+// Use ear-clipping algorithm to triangulate a simple polygon (no self-interaction, no holes).
+// (Reminder: we don't perform any coarse clipping/culling in ImDrawList layer!
+// It is up to caller to ensure not making costly calls that will be outside of visible area.
+// As concave fill is noticeably more expensive than other primitives, be mindful of this...
+// Caller can build AABB of points, and avoid filling if 'draw_list->_CmdHeader.ClipRect.Overlays(points_bb) == false')
+void ImDrawList::AddConcavePolyFilled(const ImVec2* points, const int points_count, ImU32 col)
+{
+ if (points_count < 3 || (col & IM_COL32_A_MASK) == 0)
+ return;
+
+ const ImVec2 uv = _Data->TexUvWhitePixel;
+ ImTriangulator triangulator;
+ unsigned int triangle[3];
+ if (Flags & ImDrawListFlags_AntiAliasedFill)
+ {
+ // Anti-aliased Fill
+ const float AA_SIZE = _FringeScale;
+ const ImU32 col_trans = col & ~IM_COL32_A_MASK;
+ const int idx_count = (points_count - 2) * 3 + points_count * 6;
+ const int vtx_count = (points_count * 2);
+ PrimReserve(idx_count, vtx_count);
+
+ // Add indexes for fill
+ unsigned int vtx_inner_idx = _VtxCurrentIdx;
+ unsigned int vtx_outer_idx = _VtxCurrentIdx + 1;
+
+ _Data->TempBuffer.reserve_discard((ImTriangulator::EstimateScratchBufferSize(points_count) + sizeof(ImVec2)) / sizeof(ImVec2));
+ triangulator.Init(points, points_count, _Data->TempBuffer.Data);
+ while (triangulator._TrianglesLeft > 0)
+ {
+ triangulator.GetNextTriangle(triangle);
+ _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx + (triangle[0] << 1)); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx + (triangle[1] << 1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_inner_idx + (triangle[2] << 1));
+ _IdxWritePtr += 3;
+ }
+
+ // Compute normals
+ _Data->TempBuffer.reserve_discard(points_count);
+ ImVec2* temp_normals = _Data->TempBuffer.Data;
+ for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++)
+ {
+ const ImVec2& p0 = points[i0];
+ const ImVec2& p1 = points[i1];
+ float dx = p1.x - p0.x;
+ float dy = p1.y - p0.y;
+ IM_NORMALIZE2F_OVER_ZERO(dx, dy);
+ temp_normals[i0].x = dy;
+ temp_normals[i0].y = -dx;
+ }
+
+ for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++)
+ {
+ // Average normals
+ const ImVec2& n0 = temp_normals[i0];
+ const ImVec2& n1 = temp_normals[i1];
+ float dm_x = (n0.x + n1.x) * 0.5f;
+ float dm_y = (n0.y + n1.y) * 0.5f;
+ IM_FIXNORMAL2F(dm_x, dm_y);
+ dm_x *= AA_SIZE * 0.5f;
+ dm_y *= AA_SIZE * 0.5f;
+
+ // Add vertices
+ _VtxWritePtr[0].pos.x = (points[i1].x - dm_x); _VtxWritePtr[0].pos.y = (points[i1].y - dm_y); _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; // Inner
+ _VtxWritePtr[1].pos.x = (points[i1].x + dm_x); _VtxWritePtr[1].pos.y = (points[i1].y + dm_y); _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col_trans; // Outer
+ _VtxWritePtr += 2;
+
+ // Add indexes for fringes
+ _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx + (i1 << 1)); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx + (i0 << 1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_outer_idx + (i0 << 1));
+ _IdxWritePtr[3] = (ImDrawIdx)(vtx_outer_idx + (i0 << 1)); _IdxWritePtr[4] = (ImDrawIdx)(vtx_outer_idx + (i1 << 1)); _IdxWritePtr[5] = (ImDrawIdx)(vtx_inner_idx + (i1 << 1));
+ _IdxWritePtr += 6;
+ }
+ _VtxCurrentIdx += (ImDrawIdx)vtx_count;
+ }
+ else
+ {
+ // Non Anti-aliased Fill
+ const int idx_count = (points_count - 2) * 3;
+ const int vtx_count = points_count;
+ PrimReserve(idx_count, vtx_count);
+ for (int i = 0; i < vtx_count; i++)
+ {
+ _VtxWritePtr[0].pos = points[i]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col;
+ _VtxWritePtr++;
+ }
+ _Data->TempBuffer.reserve_discard((ImTriangulator::EstimateScratchBufferSize(points_count) + sizeof(ImVec2)) / sizeof(ImVec2));
+ triangulator.Init(points, points_count, _Data->TempBuffer.Data);
+ while (triangulator._TrianglesLeft > 0)
+ {
+ triangulator.GetNextTriangle(triangle);
+ _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx + triangle[0]); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx + triangle[1]); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx + triangle[2]);
+ _IdxWritePtr += 3;
+ }
+ _VtxCurrentIdx += (ImDrawIdx)vtx_count;
+ }
+}
//-----------------------------------------------------------------------------
// [SECTION] ImDrawListSplitter
@@ -1805,6 +2216,69 @@ void ImDrawListSplitter::SetCurrentChannel(ImDrawList* draw_list, int idx)
// [SECTION] ImDrawData
//-----------------------------------------------------------------------------
+void ImDrawData::Clear()
+{
+ Valid = false;
+ CmdListsCount = TotalIdxCount = TotalVtxCount = 0;
+ CmdLists.resize(0); // The ImDrawList are NOT owned by ImDrawData but e.g. by ImGuiContext, so we don't clear them.
+ DisplayPos = DisplaySize = FramebufferScale = ImVec2(0.0f, 0.0f);
+ OwnerViewport = NULL;
+}
+
+// Important: 'out_list' is generally going to be draw_data->CmdLists, but may be another temporary list
+// as long at it is expected that the result will be later merged into draw_data->CmdLists[].
+void ImGui::AddDrawListToDrawDataEx(ImDrawData* draw_data, ImVector<ImDrawList*>* out_list, ImDrawList* draw_list)
+{
+ if (draw_list->CmdBuffer.Size == 0)
+ return;
+ if (draw_list->CmdBuffer.Size == 1 && draw_list->CmdBuffer[0].ElemCount == 0 && draw_list->CmdBuffer[0].UserCallback == NULL)
+ return;
+
+ // Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
+ // May trigger for you if you are using PrimXXX functions incorrectly.
+ IM_ASSERT(draw_list->VtxBuffer.Size == 0 || draw_list->_VtxWritePtr == draw_list->VtxBuffer.Data + draw_list->VtxBuffer.Size);
+ IM_ASSERT(draw_list->IdxBuffer.Size == 0 || draw_list->_IdxWritePtr == draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size);
+ if (!(draw_list->Flags & ImDrawListFlags_AllowVtxOffset))
+ IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size);
+
+ // Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = unsigned short = 2 bytes = 64K vertices per ImDrawList = per window)
+ // If this assert triggers because you are drawing lots of stuff manually:
+ // - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
+ // Be mindful that the lower-level ImDrawList API doesn't filter vertices. Use the Metrics/Debugger window to inspect draw list contents.
+ // - If you want large meshes with more than 64K vertices, you can either:
+ // (A) Handle the ImDrawCmd::VtxOffset value in your renderer backend, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
+ // Most example backends already support this from 1.71. Pre-1.71 backends won't.
+ // Some graphics API such as GL ES 1/2 don't have a way to offset the starting vertex so it is not supported for them.
+ // (B) Or handle 32-bit indices in your renderer backend, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h.
+ // Most example backends already support this. For example, the OpenGL example code detect index size at compile-time:
+ // glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
+ // Your own engine or render API may use different parameters or function calls to specify index sizes.
+ // 2 and 4 bytes indices are generally supported by most graphics API.
+ // - If for some reason neither of those solutions works for you, a workaround is to call BeginChild()/EndChild() before reaching
+ // the 64K limit to split your draw commands in multiple draw lists.
+ if (sizeof(ImDrawIdx) == 2)
+ IM_ASSERT(draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above");
+
+ // Resolve callback data pointers
+ if (draw_list->_CallbacksDataBuf.Size > 0)
+ for (ImDrawCmd& cmd : draw_list->CmdBuffer)
+ if (cmd.UserCallback != NULL && cmd.UserCallbackDataOffset != -1 && cmd.UserCallbackDataSize > 0)
+ cmd.UserCallbackData = draw_list->_CallbacksDataBuf.Data + cmd.UserCallbackDataOffset;
+
+ // Add to output list + records state in ImDrawData
+ out_list->push_back(draw_list);
+ draw_data->CmdListsCount++;
+ draw_data->TotalVtxCount += draw_list->VtxBuffer.Size;
+ draw_data->TotalIdxCount += draw_list->IdxBuffer.Size;
+}
+
+void ImDrawData::AddDrawList(ImDrawList* draw_list)
+{
+ IM_ASSERT(CmdLists.Size == CmdListsCount);
+ draw_list->_PopUnusedDrawCmd();
+ ImGui::AddDrawListToDrawDataEx(this, &CmdLists, draw_list);
+}
+
// For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
void ImDrawData::DeIndexAllBuffers()
{
@@ -1829,15 +2303,9 @@ void ImDrawData::DeIndexAllBuffers()
// or if there is a difference between your window resolution and framebuffer resolution.
void ImDrawData::ScaleClipRects(const ImVec2& fb_scale)
{
- for (int i = 0; i < CmdListsCount; i++)
- {
- ImDrawList* cmd_list = CmdLists[i];
- for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
- {
- ImDrawCmd* cmd = &cmd_list->CmdBuffer[cmd_i];
- cmd->ClipRect = ImVec4(cmd->ClipRect.x * fb_scale.x, cmd->ClipRect.y * fb_scale.y, cmd->ClipRect.z * fb_scale.x, cmd->ClipRect.w * fb_scale.y);
- }
- }
+ for (ImDrawList* draw_list : CmdLists)
+ for (ImDrawCmd& cmd : draw_list->CmdBuffer)
+ cmd.ClipRect = ImVec4(cmd.ClipRect.x * fb_scale.x, cmd.ClipRect.y * fb_scale.y, cmd.ClipRect.z * fb_scale.x, cmd.ClipRect.w * fb_scale.y);
}
//-----------------------------------------------------------------------------
@@ -1893,6 +2361,14 @@ void ImGui::ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int ve
}
}
+void ImGui::ShadeVertsTransformPos(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& pivot_in, float cos_a, float sin_a, const ImVec2& pivot_out)
+{
+ ImDrawVert* vert_start = draw_list->VtxBuffer.Data + vert_start_idx;
+ ImDrawVert* vert_end = draw_list->VtxBuffer.Data + vert_end_idx;
+ for (ImDrawVert* vertex = vert_start; vertex < vert_end; ++vertex)
+ vertex->pos = ImRotate(vertex->pos- pivot_in, cos_a, sin_a) + pivot_out;
+}
+
//-----------------------------------------------------------------------------
// [SECTION] ImFontConfig
//-----------------------------------------------------------------------------
@@ -1901,16 +2377,49 @@ ImFontConfig::ImFontConfig()
{
memset(this, 0, sizeof(*this));
FontDataOwnedByAtlas = true;
- OversampleH = 3; // FIXME: 2 may be a better default?
- OversampleV = 1;
+ OversampleH = 0; // Auto == 1 or 2 depending on size
+ OversampleV = 0; // Auto == 1
GlyphMaxAdvanceX = FLT_MAX;
RasterizerMultiply = 1.0f;
- EllipsisChar = (ImWchar)-1;
+ RasterizerDensity = 1.0f;
+ EllipsisChar = 0;
}
//-----------------------------------------------------------------------------
// [SECTION] ImFontAtlas
//-----------------------------------------------------------------------------
+// - Default texture data encoded in ASCII
+// - ImFontAtlas::ClearInputData()
+// - ImFontAtlas::ClearTexData()
+// - ImFontAtlas::ClearFonts()
+// - ImFontAtlas::Clear()
+// - ImFontAtlas::GetTexDataAsAlpha8()
+// - ImFontAtlas::GetTexDataAsRGBA32()
+// - ImFontAtlas::AddFont()
+// - ImFontAtlas::AddFontDefault()
+// - ImFontAtlas::AddFontFromFileTTF()
+// - ImFontAtlas::AddFontFromMemoryTTF()
+// - ImFontAtlas::AddFontFromMemoryCompressedTTF()
+// - ImFontAtlas::AddFontFromMemoryCompressedBase85TTF()
+// - ImFontAtlas::AddCustomRectRegular()
+// - ImFontAtlas::AddCustomRectFontGlyph()
+// - ImFontAtlas::CalcCustomRectUV()
+// - ImFontAtlasGetMouseCursorTexData()
+// - ImFontAtlas::Build()
+// - ImFontAtlasBuildMultiplyCalcLookupTable()
+// - ImFontAtlasBuildMultiplyRectAlpha8()
+// - ImFontAtlasBuildWithStbTruetype()
+// - ImFontAtlasGetBuilderForStbTruetype()
+// - ImFontAtlasUpdateSourcesPointers()
+// - ImFontAtlasBuildSetupFont()
+// - ImFontAtlasBuildPackCustomRects()
+// - ImFontAtlasBuildRender8bppRectFromString()
+// - ImFontAtlasBuildRender32bppRectFromString()
+// - ImFontAtlasBuildRenderDefaultTexData()
+// - ImFontAtlasBuildRenderLinesTexData()
+// - ImFontAtlasBuildInit()
+// - ImFontAtlasBuildFinish()
+//-----------------------------------------------------------------------------
// A work of art lies ahead! (. = white layer, X = black layer, others are blank)
// The 2x2 white texels on the top left are the ones we'll use everywhere in Dear ImGui to render filled shapes.
@@ -1959,6 +2468,8 @@ static const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[ImGuiMouseCursor_COUNT][3
{ ImVec2(73,0), ImVec2(17,17), ImVec2( 8, 8) }, // ImGuiMouseCursor_ResizeNESW
{ ImVec2(55,0), ImVec2(17,17), ImVec2( 8, 8) }, // ImGuiMouseCursor_ResizeNWSE
{ ImVec2(91,0), ImVec2(17,22), ImVec2( 5, 0) }, // ImGuiMouseCursor_Hand
+ { ImVec2(0,3), ImVec2(12,19), ImVec2(0, 0) }, // ImGuiMouseCursor_Wait // Arrow + custom code in ImGui::RenderMouseCursor()
+ { ImVec2(0,3), ImVec2(12,19), ImVec2(0, 0) }, // ImGuiMouseCursor_Progress // Arrow + custom code in ImGui::RenderMouseCursor()
{ ImVec2(109,0),ImVec2(13,15), ImVec2( 6, 7) }, // ImGuiMouseCursor_NotAllowed
};
@@ -1978,21 +2489,21 @@ ImFontAtlas::~ImFontAtlas()
void ImFontAtlas::ClearInputData()
{
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
- for (int i = 0; i < ConfigData.Size; i++)
- if (ConfigData[i].FontData && ConfigData[i].FontDataOwnedByAtlas)
+ for (ImFontConfig& font_cfg : Sources)
+ if (font_cfg.FontData && font_cfg.FontDataOwnedByAtlas)
{
- IM_FREE(ConfigData[i].FontData);
- ConfigData[i].FontData = NULL;
+ IM_FREE(font_cfg.FontData);
+ font_cfg.FontData = NULL;
}
// When clearing this we lose access to the font name and other information used to build the font.
- for (int i = 0; i < Fonts.Size; i++)
- if (Fonts[i]->ConfigData >= ConfigData.Data && Fonts[i]->ConfigData < ConfigData.Data + ConfigData.Size)
+ for (ImFont* font : Fonts)
+ if (font->Sources >= Sources.Data && font->Sources < Sources.Data + Sources.Size)
{
- Fonts[i]->ConfigData = NULL;
- Fonts[i]->ConfigDataCount = 0;
+ font->Sources = NULL;
+ font->SourcesCount = 0;
}
- ConfigData.clear();
+ Sources.clear();
CustomRects.clear();
PackIdMouseCursors = PackIdLines = -1;
// Important: we leave TexReady untouched
@@ -2014,6 +2525,7 @@ void ImFontAtlas::ClearTexData()
void ImFontAtlas::ClearFonts()
{
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
+ ClearInputData();
Fonts.clear_delete();
TexReady = false;
}
@@ -2065,16 +2577,17 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
{
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
IM_ASSERT(font_cfg->FontData != NULL && font_cfg->FontDataSize > 0);
- IM_ASSERT(font_cfg->SizePixels > 0.0f);
+ IM_ASSERT(font_cfg->SizePixels > 0.0f && "Is ImFontConfig struct correctly initialized?");
+ IM_ASSERT(font_cfg->RasterizerDensity > 0.0f && "Is ImFontConfig struct correctly initialized?");
// Create new font
if (!font_cfg->MergeMode)
Fonts.push_back(IM_NEW(ImFont));
else
- IM_ASSERT(!Fonts.empty() && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font.
+ IM_ASSERT(Fonts.Size > 0 && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font.
- ConfigData.push_back(*font_cfg);
- ImFontConfig& new_font_cfg = ConfigData.back();
+ Sources.push_back(*font_cfg);
+ ImFontConfig& new_font_cfg = Sources.back();
if (new_font_cfg.DstFont == NULL)
new_font_cfg.DstFont = Fonts.back();
if (!new_font_cfg.FontDataOwnedByAtlas)
@@ -2084,8 +2597,14 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
memcpy(new_font_cfg.FontData, font_cfg->FontData, (size_t)new_font_cfg.FontDataSize);
}
- if (new_font_cfg.DstFont->EllipsisChar == (ImWchar)-1)
- new_font_cfg.DstFont->EllipsisChar = font_cfg->EllipsisChar;
+ // Round font size
+ // - We started rounding in 1.90 WIP (18991) as our layout system currently doesn't support non-rounded font size well yet.
+ // - Note that using io.FontGlobalScale or SetWindowFontScale(), with are legacy-ish, partially supported features, can still lead to unrounded sizes.
+ // - We may support it better later and remove this rounding.
+ new_font_cfg.SizePixels = ImTrunc(new_font_cfg.SizePixels);
+
+ // Pointers to Sources data are otherwise dangling
+ ImFontAtlasUpdateSourcesPointers(this);
// Invalidate texture
TexReady = false;
@@ -2096,7 +2615,6 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
// Default font TTF is compressed with stb_compress then base85 encoded (see misc/fonts/binary_to_compressed_c.cpp for encoder)
static unsigned int stb_decompress_length(const unsigned char* input);
static unsigned int stb_decompress(unsigned char* output, const unsigned char* input, unsigned int length);
-static const char* GetDefaultCompressedFontDataTTFBase85();
static unsigned int Decode85Byte(char c) { return c >= '\\' ? c-36 : c-35; }
static void Decode85(const unsigned char* src, unsigned char* dst)
{
@@ -2108,10 +2626,14 @@ static void Decode85(const unsigned char* src, unsigned char* dst)
dst += 4;
}
}
+#ifndef IMGUI_DISABLE_DEFAULT_FONT
+static const char* GetDefaultCompressedFontDataTTF(int* out_size);
+#endif
// Load embedded ProggyClean.ttf at size 13, disable oversampling
ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template)
{
+#ifndef IMGUI_DISABLE_DEFAULT_FONT
ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
if (!font_cfg_template)
{
@@ -2123,12 +2645,18 @@ ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template)
if (font_cfg.Name[0] == '\0')
ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "ProggyClean.ttf, %dpx", (int)font_cfg.SizePixels);
font_cfg.EllipsisChar = (ImWchar)0x0085;
- font_cfg.GlyphOffset.y = 1.0f * IM_FLOOR(font_cfg.SizePixels / 13.0f); // Add +1 offset per 13 units
+ font_cfg.GlyphOffset.y = 1.0f * IM_TRUNC(font_cfg.SizePixels / 13.0f); // Add +1 offset per 13 units
- const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85();
+ int ttf_compressed_size = 0;
+ const char* ttf_compressed = GetDefaultCompressedFontDataTTF(&ttf_compressed_size);
const ImWchar* glyph_ranges = font_cfg.GlyphRanges != NULL ? font_cfg.GlyphRanges : GetGlyphRangesDefault();
- ImFont* font = AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, font_cfg.SizePixels, &font_cfg, glyph_ranges);
+ ImFont* font = AddFontFromMemoryCompressedTTF(ttf_compressed, ttf_compressed_size, font_cfg.SizePixels, &font_cfg, glyph_ranges);
return font;
+#else
+ IM_ASSERT(0 && "AddFontDefault() disabled in this build.");
+ IM_UNUSED(font_cfg_template);
+ return NULL;
+#endif // #ifndef IMGUI_DISABLE_DEFAULT_FONT
}
ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
@@ -2146,20 +2674,21 @@ ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels,
{
// Store a short copy of filename into into the font name for convenience
const char* p;
- for (p = filename + strlen(filename); p > filename && p[-1] != '/' && p[-1] != '\\'; p--) {}
+ for (p = filename + ImStrlen(filename); p > filename && p[-1] != '/' && p[-1] != '\\'; p--) {}
ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "%s, %.0fpx", p, size_pixels);
}
return AddFontFromMemoryTTF(data, (int)data_size, size_pixels, &font_cfg, glyph_ranges);
}
// NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build().
-ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
+ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* font_data, int font_data_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
{
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
IM_ASSERT(font_cfg.FontData == NULL);
- font_cfg.FontData = ttf_data;
- font_cfg.FontDataSize = ttf_size;
+ IM_ASSERT(font_data_size > 100 && "Incorrect value for font_data_size!"); // Heuristic to prevent accidentally passing a wrong value to font_data_size.
+ font_cfg.FontData = font_data;
+ font_cfg.FontDataSize = font_data_size;
font_cfg.SizePixels = size_pixels > 0.0f ? size_pixels : font_cfg.SizePixels;
if (glyph_ranges)
font_cfg.GlyphRanges = glyph_ranges;
@@ -2180,7 +2709,7 @@ ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compressed_ttf_d
ImFont* ImFontAtlas::AddFontFromMemoryCompressedBase85TTF(const char* compressed_ttf_data_base85, float size_pixels, const ImFontConfig* font_cfg, const ImWchar* glyph_ranges)
{
- int compressed_ttf_size = (((int)strlen(compressed_ttf_data_base85) + 4) / 5) * 4;
+ int compressed_ttf_size = (((int)ImStrlen(compressed_ttf_data_base85) + 4) / 5) * 4;
void* compressed_ttf = IM_ALLOC((size_t)compressed_ttf_size);
Decode85((const unsigned char*)compressed_ttf_data_base85, (unsigned char*)compressed_ttf);
ImFont* font = AddFontFromMemoryCompressedTTF(compressed_ttf, compressed_ttf_size, size_pixels, font_cfg, glyph_ranges);
@@ -2211,6 +2740,7 @@ int ImFontAtlas::AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int
r.Width = (unsigned short)width;
r.Height = (unsigned short)height;
r.GlyphID = id;
+ r.GlyphColored = 0; // Set to 1 manually to mark glyph as colored // FIXME: No official API for that (#8133)
r.GlyphAdvanceX = advance_x;
r.GlyphOffset = offset;
r.Font = font;
@@ -2226,24 +2756,24 @@ void ImFontAtlas::CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* ou
*out_uv_max = ImVec2((float)(rect->X + rect->Width) * TexUvScale.x, (float)(rect->Y + rect->Height) * TexUvScale.y);
}
-bool ImFontAtlas::GetMouseCursorTexData(ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2])
+bool ImFontAtlasGetMouseCursorTexData(ImFontAtlas* atlas, ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2])
{
if (cursor_type <= ImGuiMouseCursor_None || cursor_type >= ImGuiMouseCursor_COUNT)
return false;
- if (Flags & ImFontAtlasFlags_NoMouseCursors)
+ if (atlas->Flags & ImFontAtlasFlags_NoMouseCursors)
return false;
- IM_ASSERT(PackIdMouseCursors != -1);
- ImFontAtlasCustomRect* r = GetCustomRectByIndex(PackIdMouseCursors);
+ IM_ASSERT(atlas->PackIdMouseCursors != -1);
+ ImFontAtlasCustomRect* r = atlas->GetCustomRectByIndex(atlas->PackIdMouseCursors);
ImVec2 pos = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][0] + ImVec2((float)r->X, (float)r->Y);
ImVec2 size = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][1];
*out_size = size;
*out_offset = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][2];
- out_uv_border[0] = (pos) * TexUvScale;
- out_uv_border[1] = (pos + size) * TexUvScale;
+ out_uv_border[0] = (pos) * atlas->TexUvScale;
+ out_uv_border[1] = (pos + size) * atlas->TexUvScale;
pos.x += FONT_ATLAS_DEFAULT_TEX_DATA_W + 1;
- out_uv_fill[0] = (pos) * TexUvScale;
- out_uv_fill[1] = (pos + size) * TexUvScale;
+ out_uv_fill[0] = (pos) * atlas->TexUvScale;
+ out_uv_fill[1] = (pos + size) * atlas->TexUvScale;
return true;
}
@@ -2252,7 +2782,7 @@ bool ImFontAtlas::Build()
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
// Default font is none are specified
- if (ConfigData.Size == 0)
+ if (Sources.Size == 0)
AddFontDefault();
// Select builder
@@ -2294,6 +2824,13 @@ void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsig
*data = table[*data];
}
+void ImFontAtlasBuildGetOversampleFactors(const ImFontConfig* src, int* out_oversample_h, int* out_oversample_v)
+{
+ // Automatically disable horizontal oversampling over size 36
+ *out_oversample_h = (src->OversampleH != 0) ? src->OversampleH : (src->SizePixels * src->RasterizerDensity > 36.0f || src->PixelSnapH) ? 1 : 2;
+ *out_oversample_v = (src->OversampleV != 0) ? src->OversampleV : 1;
+}
+
#ifdef IMGUI_ENABLE_STB_TRUETYPE
// Temporary data for one source font (multiple source fonts can be merged into one destination ImFont)
// (C++03 doesn't allow instancing ImVector<> with function-local types so we declare the type here.)
@@ -2334,7 +2871,7 @@ static void UnpackBitVectorToFlatIndexList(const ImBitVector* in, ImVector<int>*
static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
{
- IM_ASSERT(atlas->ConfigData.Size > 0);
+ IM_ASSERT(atlas->Sources.Size > 0);
ImFontAtlasBuildInit(atlas);
@@ -2348,39 +2885,48 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
// Temporary storage for building
ImVector<ImFontBuildSrcData> src_tmp_array;
ImVector<ImFontBuildDstData> dst_tmp_array;
- src_tmp_array.resize(atlas->ConfigData.Size);
+ src_tmp_array.resize(atlas->Sources.Size);
dst_tmp_array.resize(atlas->Fonts.Size);
memset(src_tmp_array.Data, 0, (size_t)src_tmp_array.size_in_bytes());
memset(dst_tmp_array.Data, 0, (size_t)dst_tmp_array.size_in_bytes());
// 1. Initialize font loading structure, check font data validity
- for (int src_i = 0; src_i < atlas->ConfigData.Size; src_i++)
+ for (int src_i = 0; src_i < atlas->Sources.Size; src_i++)
{
ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
- ImFontConfig& cfg = atlas->ConfigData[src_i];
- IM_ASSERT(cfg.DstFont && (!cfg.DstFont->IsLoaded() || cfg.DstFont->ContainerAtlas == atlas));
+ ImFontConfig& src = atlas->Sources[src_i];
+ IM_ASSERT(src.DstFont && (!src.DstFont->IsLoaded() || src.DstFont->ContainerAtlas == atlas));
- // Find index from cfg.DstFont (we allow the user to set cfg.DstFont. Also it makes casual debugging nicer than when storing indices)
+ // Find index from src.DstFont (we allow the user to set cfg.DstFont. Also it makes casual debugging nicer than when storing indices)
src_tmp.DstIndex = -1;
for (int output_i = 0; output_i < atlas->Fonts.Size && src_tmp.DstIndex == -1; output_i++)
- if (cfg.DstFont == atlas->Fonts[output_i])
+ if (src.DstFont == atlas->Fonts[output_i])
src_tmp.DstIndex = output_i;
if (src_tmp.DstIndex == -1)
{
- IM_ASSERT(src_tmp.DstIndex != -1); // cfg.DstFont not pointing within atlas->Fonts[] array?
+ IM_ASSERT(src_tmp.DstIndex != -1); // src.DstFont not pointing within atlas->Fonts[] array?
return false;
}
// Initialize helper structure for font loading and verify that the TTF/OTF data is correct
- const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)cfg.FontData, cfg.FontNo);
+ const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)src.FontData, src.FontNo);
IM_ASSERT(font_offset >= 0 && "FontData is incorrect, or FontNo cannot be found.");
- if (!stbtt_InitFont(&src_tmp.FontInfo, (unsigned char*)cfg.FontData, font_offset))
+ if (!stbtt_InitFont(&src_tmp.FontInfo, (unsigned char*)src.FontData, font_offset))
+ {
+ IM_ASSERT(0 && "stbtt_InitFont(): failed to parse FontData. It is correct and complete? Check FontDataSize.");
return false;
+ }
// Measure highest codepoints
ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex];
- src_tmp.SrcRanges = cfg.GlyphRanges ? cfg.GlyphRanges : atlas->GetGlyphRangesDefault();
+ src_tmp.SrcRanges = src.GlyphRanges ? src.GlyphRanges : atlas->GetGlyphRangesDefault();
for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
+ {
+ // Check for valid range. This may also help detect *some* dangling pointers, because a common
+ // user error is to setup ImFontConfig::GlyphRanges with a pointer to data that isn't persistent,
+ // or to forget to zero-terminate the glyph range array.
+ IM_ASSERT(src_range[0] <= src_range[1] && "Invalid range: is your glyph range array persistent? it is zero-terminated?");
src_tmp.GlyphsHighest = ImMax(src_tmp.GlyphsHighest, (int)src_range[1]);
+ }
dst_tmp.SrcCount++;
dst_tmp.GlyphsHighest = ImMax(dst_tmp.GlyphsHighest, src_tmp.GlyphsHighest);
}
@@ -2438,6 +2984,7 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
int total_surface = 0;
int buf_rects_out_n = 0;
int buf_packedchars_out_n = 0;
+ const int pack_padding = atlas->TexGlyphPadding;
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
{
ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
@@ -2449,30 +2996,35 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
buf_rects_out_n += src_tmp.GlyphsCount;
buf_packedchars_out_n += src_tmp.GlyphsCount;
+ // Automatic selection of oversampling parameters
+ ImFontConfig& src = atlas->Sources[src_i];
+ int oversample_h, oversample_v;
+ ImFontAtlasBuildGetOversampleFactors(&src, &oversample_h, &oversample_v);
+
// Convert our ranges in the format stb_truetype wants
- ImFontConfig& cfg = atlas->ConfigData[src_i];
- src_tmp.PackRange.font_size = cfg.SizePixels;
+ src_tmp.PackRange.font_size = src.SizePixels * src.RasterizerDensity;
src_tmp.PackRange.first_unicode_codepoint_in_range = 0;
src_tmp.PackRange.array_of_unicode_codepoints = src_tmp.GlyphsList.Data;
src_tmp.PackRange.num_chars = src_tmp.GlyphsList.Size;
src_tmp.PackRange.chardata_for_range = src_tmp.PackedChars;
- src_tmp.PackRange.h_oversample = (unsigned char)cfg.OversampleH;
- src_tmp.PackRange.v_oversample = (unsigned char)cfg.OversampleV;
+ src_tmp.PackRange.h_oversample = (unsigned char)oversample_h;
+ src_tmp.PackRange.v_oversample = (unsigned char)oversample_v;
// Gather the sizes of all rectangles we will need to pack (this loop is based on stbtt_PackFontRangesGatherRects)
- const float scale = (cfg.SizePixels > 0) ? stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, cfg.SizePixels) : stbtt_ScaleForMappingEmToPixels(&src_tmp.FontInfo, -cfg.SizePixels);
- const int padding = atlas->TexGlyphPadding;
+ const float scale = (src.SizePixels > 0.0f) ? stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, src.SizePixels * src.RasterizerDensity) : stbtt_ScaleForMappingEmToPixels(&src_tmp.FontInfo, -src.SizePixels * src.RasterizerDensity);
for (int glyph_i = 0; glyph_i < src_tmp.GlyphsList.Size; glyph_i++)
{
int x0, y0, x1, y1;
const int glyph_index_in_font = stbtt_FindGlyphIndex(&src_tmp.FontInfo, src_tmp.GlyphsList[glyph_i]);
IM_ASSERT(glyph_index_in_font != 0);
- stbtt_GetGlyphBitmapBoxSubpixel(&src_tmp.FontInfo, glyph_index_in_font, scale * cfg.OversampleH, scale * cfg.OversampleV, 0, 0, &x0, &y0, &x1, &y1);
- src_tmp.Rects[glyph_i].w = (stbrp_coord)(x1 - x0 + padding + cfg.OversampleH - 1);
- src_tmp.Rects[glyph_i].h = (stbrp_coord)(y1 - y0 + padding + cfg.OversampleV - 1);
+ stbtt_GetGlyphBitmapBoxSubpixel(&src_tmp.FontInfo, glyph_index_in_font, scale * oversample_h, scale * oversample_v, 0, 0, &x0, &y0, &x1, &y1);
+ src_tmp.Rects[glyph_i].w = (stbrp_coord)(x1 - x0 + pack_padding + oversample_h - 1);
+ src_tmp.Rects[glyph_i].h = (stbrp_coord)(y1 - y0 + pack_padding + oversample_v - 1);
total_surface += src_tmp.Rects[glyph_i].w * src_tmp.Rects[glyph_i].h;
}
}
+ for (int i = 0; i < atlas->CustomRects.Size; i++)
+ total_surface += (atlas->CustomRects[i].Width + pack_padding) * (atlas->CustomRects[i].Height + pack_padding);
// We need a width for the skyline algorithm, any width!
// The exact width doesn't really matter much, but some API/GPU have texture size limitations and increasing width can decrease height.
@@ -2488,7 +3040,8 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
// Pack our extra data rectangles first, so it will be on the upper-left corner of our texture (UV will have small values).
const int TEX_HEIGHT_MAX = 1024 * 32;
stbtt_pack_context spc = {};
- stbtt_PackBegin(&spc, NULL, atlas->TexWidth, TEX_HEIGHT_MAX, 0, atlas->TexGlyphPadding, NULL);
+ stbtt_PackBegin(&spc, NULL, atlas->TexWidth, TEX_HEIGHT_MAX, 0, 0, NULL);
+ spc.padding = atlas->TexGlyphPadding; // Because we mixup stbtt_PackXXX and stbrp_PackXXX there's a bit of a hack here, not passing the value to stbtt_PackBegin() allows us to still pack a TexWidth-1 wide item. (#8107)
ImFontAtlasBuildPackCustomRects(atlas, spc.pack_info);
// 6. Pack each source font. No rendering yet, we are working with rectangles in an infinitely tall texture at this point.
@@ -2518,7 +3071,7 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
// 8. Render/rasterize font characters into the texture
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
{
- ImFontConfig& cfg = atlas->ConfigData[src_i];
+ ImFontConfig& src = atlas->Sources[src_i];
ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
if (src_tmp.GlyphsCount == 0)
continue;
@@ -2526,10 +3079,10 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
stbtt_PackFontRangesRenderIntoRects(&spc, &src_tmp.FontInfo, &src_tmp.PackRange, 1, src_tmp.Rects);
// Apply multiply operator
- if (cfg.RasterizerMultiply != 1.0f)
+ if (src.RasterizerMultiply != 1.0f)
{
unsigned char multiply_table[256];
- ImFontAtlasBuildMultiplyCalcLookupTable(multiply_table, cfg.RasterizerMultiply);
+ ImFontAtlasBuildMultiplyCalcLookupTable(multiply_table, src.RasterizerMultiply);
stbrp_rect* r = &src_tmp.Rects[0];
for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++, r++)
if (r->was_packed)
@@ -2545,25 +3098,24 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
// 9. Setup ImFont and glyphs for runtime
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
{
- ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
- if (src_tmp.GlyphsCount == 0)
- continue;
-
// When merging fonts with MergeMode=true:
// - We can have multiple input fonts writing into a same destination font.
- // - dst_font->ConfigData is != from cfg which is our source configuration.
- ImFontConfig& cfg = atlas->ConfigData[src_i];
- ImFont* dst_font = cfg.DstFont;
+ // - dst_font->Sources is != from src which is our source configuration.
+ ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
+ ImFontConfig& src = atlas->Sources[src_i];
+ ImFont* dst_font = src.DstFont;
- const float font_scale = stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, cfg.SizePixels);
+ const float font_scale = stbtt_ScaleForPixelHeight(&src_tmp.FontInfo, src.SizePixels);
int unscaled_ascent, unscaled_descent, unscaled_line_gap;
stbtt_GetFontVMetrics(&src_tmp.FontInfo, &unscaled_ascent, &unscaled_descent, &unscaled_line_gap);
- const float ascent = ImFloor(unscaled_ascent * font_scale + ((unscaled_ascent > 0.0f) ? +1 : -1));
- const float descent = ImFloor(unscaled_descent * font_scale + ((unscaled_descent > 0.0f) ? +1 : -1));
- ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent);
- const float font_off_x = cfg.GlyphOffset.x;
- const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent);
+ const float ascent = ImCeil(unscaled_ascent * font_scale);
+ const float descent = ImFloor(unscaled_descent * font_scale);
+ ImFontAtlasBuildSetupFont(atlas, dst_font, &src, ascent, descent);
+ const float font_off_x = src.GlyphOffset.x;
+ const float font_off_y = src.GlyphOffset.y + IM_ROUND(dst_font->Ascent);
+
+ const float inv_rasterization_scale = 1.0f / src.RasterizerDensity;
for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++)
{
@@ -2573,7 +3125,11 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
stbtt_aligned_quad q;
float unused_x = 0.0f, unused_y = 0.0f;
stbtt_GetPackedQuad(src_tmp.PackedChars, atlas->TexWidth, atlas->TexHeight, glyph_i, &unused_x, &unused_y, &q, 0);
- dst_font->AddGlyph(&cfg, (ImWchar)codepoint, q.x0 + font_off_x, q.y0 + font_off_y, q.x1 + font_off_x, q.y1 + font_off_y, q.s0, q.t0, q.s1, q.t1, pc.xadvance);
+ float x0 = q.x0 * inv_rasterization_scale + font_off_x;
+ float y0 = q.y0 * inv_rasterization_scale + font_off_y;
+ float x1 = q.x1 * inv_rasterization_scale + font_off_x;
+ float y1 = q.y1 * inv_rasterization_scale + font_off_y;
+ dst_font->AddGlyph(&src, (ImWchar)codepoint, x0, y0, x1, y1, q.s0, q.t0, q.s1, q.t1, pc.xadvance * inv_rasterization_scale);
}
}
@@ -2593,19 +3149,31 @@ const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype()
#endif // IMGUI_ENABLE_STB_TRUETYPE
+void ImFontAtlasUpdateSourcesPointers(ImFontAtlas* atlas)
+{
+ for (ImFontConfig& src : atlas->Sources)
+ {
+ ImFont* font = src.DstFont;
+ if (!src.MergeMode)
+ {
+ font->Sources = &src;
+ font->SourcesCount = 0;
+ }
+ font->SourcesCount++;
+ }
+}
+
void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent)
{
if (!font_config->MergeMode)
{
font->ClearOutputData();
font->FontSize = font_config->SizePixels;
- font->ConfigData = font_config;
- font->ConfigDataCount = 0;
+ IM_ASSERT(font->Sources == font_config);
font->ContainerAtlas = atlas;
font->Ascent = ascent;
font->Descent = descent;
}
- font->ConfigDataCount++;
}
void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opaque)
@@ -2615,14 +3183,18 @@ void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opa
ImVector<ImFontAtlasCustomRect>& user_rects = atlas->CustomRects;
IM_ASSERT(user_rects.Size >= 1); // We expect at least the default custom rects to be registered, else something went wrong.
+#ifdef __GNUC__
+ if (user_rects.Size < 1) { __builtin_unreachable(); } // Workaround for GCC bug if IM_ASSERT() is defined to conditionally throw (see #5343)
+#endif
+ const int pack_padding = atlas->TexGlyphPadding;
ImVector<stbrp_rect> pack_rects;
pack_rects.resize(user_rects.Size);
memset(pack_rects.Data, 0, (size_t)pack_rects.size_in_bytes());
for (int i = 0; i < user_rects.Size; i++)
{
- pack_rects[i].w = user_rects[i].Width;
- pack_rects[i].h = user_rects[i].Height;
+ pack_rects[i].w = user_rects[i].Width + pack_padding;
+ pack_rects[i].h = user_rects[i].Height + pack_padding;
}
stbrp_pack_rects(pack_context, &pack_rects[0], pack_rects.Size);
for (int i = 0; i < pack_rects.Size; i++)
@@ -2630,7 +3202,7 @@ void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opa
{
user_rects[i].X = (unsigned short)pack_rects[i].x;
user_rects[i].Y = (unsigned short)pack_rects[i].y;
- IM_ASSERT(pack_rects[i].w == user_rects[i].Width && pack_rects[i].h == user_rects[i].Height);
+ IM_ASSERT(pack_rects[i].w == user_rects[i].Width + pack_padding && pack_rects[i].h == user_rects[i].Height + pack_padding);
atlas->TexHeight = ImMax(atlas->TexHeight, pack_rects[i].y + pack_rects[i].h);
}
}
@@ -2661,35 +3233,35 @@ static void ImFontAtlasBuildRenderDefaultTexData(ImFontAtlas* atlas)
IM_ASSERT(r->IsPacked());
const int w = atlas->TexWidth;
- if (!(atlas->Flags & ImFontAtlasFlags_NoMouseCursors))
+ if (atlas->Flags & ImFontAtlasFlags_NoMouseCursors)
{
- // Render/copy pixels
- IM_ASSERT(r->Width == FONT_ATLAS_DEFAULT_TEX_DATA_W * 2 + 1 && r->Height == FONT_ATLAS_DEFAULT_TEX_DATA_H);
- const int x_for_white = r->X;
- const int x_for_black = r->X + FONT_ATLAS_DEFAULT_TEX_DATA_W + 1;
+ // White pixels only
+ IM_ASSERT(r->Width == 2 && r->Height == 2);
+ const int offset = (int)r->X + (int)r->Y * w;
if (atlas->TexPixelsAlpha8 != NULL)
{
- ImFontAtlasBuildRender8bppRectFromString(atlas, x_for_white, r->Y, FONT_ATLAS_DEFAULT_TEX_DATA_W, FONT_ATLAS_DEFAULT_TEX_DATA_H, FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS, '.', 0xFF);
- ImFontAtlasBuildRender8bppRectFromString(atlas, x_for_black, r->Y, FONT_ATLAS_DEFAULT_TEX_DATA_W, FONT_ATLAS_DEFAULT_TEX_DATA_H, FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS, 'X', 0xFF);
+ atlas->TexPixelsAlpha8[offset] = atlas->TexPixelsAlpha8[offset + 1] = atlas->TexPixelsAlpha8[offset + w] = atlas->TexPixelsAlpha8[offset + w + 1] = 0xFF;
}
else
{
- ImFontAtlasBuildRender32bppRectFromString(atlas, x_for_white, r->Y, FONT_ATLAS_DEFAULT_TEX_DATA_W, FONT_ATLAS_DEFAULT_TEX_DATA_H, FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS, '.', IM_COL32_WHITE);
- ImFontAtlasBuildRender32bppRectFromString(atlas, x_for_black, r->Y, FONT_ATLAS_DEFAULT_TEX_DATA_W, FONT_ATLAS_DEFAULT_TEX_DATA_H, FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS, 'X', IM_COL32_WHITE);
+ atlas->TexPixelsRGBA32[offset] = atlas->TexPixelsRGBA32[offset + 1] = atlas->TexPixelsRGBA32[offset + w] = atlas->TexPixelsRGBA32[offset + w + 1] = IM_COL32_WHITE;
}
}
else
{
- // Render 4 white pixels
- IM_ASSERT(r->Width == 2 && r->Height == 2);
- const int offset = (int)r->X + (int)r->Y * w;
+ // White pixels and mouse cursor
+ IM_ASSERT(r->Width == FONT_ATLAS_DEFAULT_TEX_DATA_W * 2 + 1 && r->Height == FONT_ATLAS_DEFAULT_TEX_DATA_H);
+ const int x_for_white = r->X;
+ const int x_for_black = r->X + FONT_ATLAS_DEFAULT_TEX_DATA_W + 1;
if (atlas->TexPixelsAlpha8 != NULL)
{
- atlas->TexPixelsAlpha8[offset] = atlas->TexPixelsAlpha8[offset + 1] = atlas->TexPixelsAlpha8[offset + w] = atlas->TexPixelsAlpha8[offset + w + 1] = 0xFF;
+ ImFontAtlasBuildRender8bppRectFromString(atlas, x_for_white, r->Y, FONT_ATLAS_DEFAULT_TEX_DATA_W, FONT_ATLAS_DEFAULT_TEX_DATA_H, FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS, '.', 0xFF);
+ ImFontAtlasBuildRender8bppRectFromString(atlas, x_for_black, r->Y, FONT_ATLAS_DEFAULT_TEX_DATA_W, FONT_ATLAS_DEFAULT_TEX_DATA_H, FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS, 'X', 0xFF);
}
else
{
- atlas->TexPixelsRGBA32[offset] = atlas->TexPixelsRGBA32[offset + 1] = atlas->TexPixelsRGBA32[offset + w] = atlas->TexPixelsRGBA32[offset + w + 1] = IM_COL32_WHITE;
+ ImFontAtlasBuildRender32bppRectFromString(atlas, x_for_white, r->Y, FONT_ATLAS_DEFAULT_TEX_DATA_W, FONT_ATLAS_DEFAULT_TEX_DATA_H, FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS, '.', IM_COL32_WHITE);
+ ImFontAtlasBuildRender32bppRectFromString(atlas, x_for_black, r->Y, FONT_ATLAS_DEFAULT_TEX_DATA_W, FONT_ATLAS_DEFAULT_TEX_DATA_H, FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS, 'X', IM_COL32_WHITE);
}
}
atlas->TexUvWhitePixel = ImVec2((r->X + 0.5f) * atlas->TexUvScale.x, (r->Y + 0.5f) * atlas->TexUvScale.y);
@@ -2703,38 +3275,38 @@ static void ImFontAtlasBuildRenderLinesTexData(ImFontAtlas* atlas)
// This generates a triangular shape in the texture, with the various line widths stacked on top of each other to allow interpolation between them
ImFontAtlasCustomRect* r = atlas->GetCustomRectByIndex(atlas->PackIdLines);
IM_ASSERT(r->IsPacked());
- for (unsigned int n = 0; n < IM_DRAWLIST_TEX_LINES_WIDTH_MAX + 1; n++) // +1 because of the zero-width row
+ for (int n = 0; n < IM_DRAWLIST_TEX_LINES_WIDTH_MAX + 1; n++) // +1 because of the zero-width row
{
// Each line consists of at least two empty pixels at the ends, with a line of solid pixels in the middle
- unsigned int y = n;
- unsigned int line_width = n;
- unsigned int pad_left = (r->Width - line_width) / 2;
- unsigned int pad_right = r->Width - (pad_left + line_width);
+ int y = n;
+ int line_width = n;
+ int pad_left = (r->Width - line_width) / 2;
+ int pad_right = r->Width - (pad_left + line_width);
// Write each slice
IM_ASSERT(pad_left + line_width + pad_right == r->Width && y < r->Height); // Make sure we're inside the texture bounds before we start writing pixels
if (atlas->TexPixelsAlpha8 != NULL)
{
unsigned char* write_ptr = &atlas->TexPixelsAlpha8[r->X + ((r->Y + y) * atlas->TexWidth)];
- for (unsigned int i = 0; i < pad_left; i++)
+ for (int i = 0; i < pad_left; i++)
*(write_ptr + i) = 0x00;
- for (unsigned int i = 0; i < line_width; i++)
+ for (int i = 0; i < line_width; i++)
*(write_ptr + pad_left + i) = 0xFF;
- for (unsigned int i = 0; i < pad_right; i++)
+ for (int i = 0; i < pad_right; i++)
*(write_ptr + pad_left + line_width + i) = 0x00;
}
else
{
unsigned int* write_ptr = &atlas->TexPixelsRGBA32[r->X + ((r->Y + y) * atlas->TexWidth)];
- for (unsigned int i = 0; i < pad_left; i++)
+ for (int i = 0; i < pad_left; i++)
*(write_ptr + i) = IM_COL32(255, 255, 255, 0);
- for (unsigned int i = 0; i < line_width; i++)
+ for (int i = 0; i < line_width; i++)
*(write_ptr + pad_left + i) = IM_COL32_WHITE;
- for (unsigned int i = 0; i < pad_right; i++)
+ for (int i = 0; i < pad_right; i++)
*(write_ptr + pad_left + line_width + i) = IM_COL32(255, 255, 255, 0);
}
@@ -2782,21 +3354,37 @@ void ImFontAtlasBuildFinish(ImFontAtlas* atlas)
if (r->Font == NULL || r->GlyphID == 0)
continue;
- // Will ignore ImFontConfig settings: GlyphMinAdvanceX, GlyphMinAdvanceY, GlyphExtraSpacing, PixelSnapH
+ // Will ignore ImFontConfig settings: GlyphMinAdvanceX, GlyphMinAdvanceY, PixelSnapH
IM_ASSERT(r->Font->ContainerAtlas == atlas);
ImVec2 uv0, uv1;
atlas->CalcCustomRectUV(r, &uv0, &uv1);
r->Font->AddGlyph(NULL, (ImWchar)r->GlyphID, r->GlyphOffset.x, r->GlyphOffset.y, r->GlyphOffset.x + r->Width, r->GlyphOffset.y + r->Height, uv0.x, uv0.y, uv1.x, uv1.y, r->GlyphAdvanceX);
+ if (r->GlyphColored)
+ r->Font->Glyphs.back().Colored = 1;
}
// Build all fonts lookup tables
- for (int i = 0; i < atlas->Fonts.Size; i++)
- if (atlas->Fonts[i]->DirtyLookupTables)
- atlas->Fonts[i]->BuildLookupTable();
+ for (ImFont* font : atlas->Fonts)
+ if (font->DirtyLookupTables)
+ font->BuildLookupTable();
atlas->TexReady = true;
}
+//-------------------------------------------------------------------------
+// [SECTION] ImFontAtlas: glyph ranges helpers
+//-------------------------------------------------------------------------
+// - GetGlyphRangesDefault()
+// - GetGlyphRangesGreek()
+// - GetGlyphRangesKorean()
+// - GetGlyphRangesChineseFull()
+// - GetGlyphRangesChineseSimplifiedCommon()
+// - GetGlyphRangesJapanese()
+// - GetGlyphRangesCyrillic()
+// - GetGlyphRangesThai()
+// - GetGlyphRangesVietnamese()
+//-----------------------------------------------------------------------------
+
// Retrieve list of range (2 int per range, values are inclusive)
const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
{
@@ -2858,10 +3446,6 @@ static void UnpackAccumulativeOffsetsIntoRanges(int base_codepoint, const short*
out_ranges[0] = 0;
}
-//-------------------------------------------------------------------------
-// [SECTION] ImFontAtlas glyph ranges helpers
-//-------------------------------------------------------------------------
-
const ImWchar* ImFontAtlas::GetGlyphRangesChineseSimplifiedCommon()
{
// Store 2500 regularly used characters for Simplified Chinese.
@@ -2935,19 +3519,19 @@ const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
// 2999 ideograms code points for Japanese
// - 2136 Joyo (meaning "for regular use" or "for common use") Kanji code points
// - 863 Jinmeiyo (meaning "for personal name") Kanji code points
- // - Sourced from the character information database of the Information-technology Promotion Agency, Japan
- // - https://mojikiban.ipa.go.jp/mji/
- // - Available under the terms of the Creative Commons Attribution-ShareAlike 2.1 Japan (CC BY-SA 2.1 JP).
- // - https://creativecommons.org/licenses/by-sa/2.1/jp/deed.en
- // - https://creativecommons.org/licenses/by-sa/2.1/jp/legalcode
- // - You can generate this code by the script at:
- // - https://github.com/vaiorabbit/everyday_use_kanji
+ // - Sourced from official information provided by the government agencies of Japan:
+ // - List of Joyo Kanji by the Agency for Cultural Affairs
+ // - https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kijun/naikaku/kanji/
+ // - List of Jinmeiyo Kanji by the Ministry of Justice
+ // - http://www.moj.go.jp/MINJI/minji86.html
+ // - Available under the terms of the Creative Commons Attribution 4.0 International (CC BY 4.0).
+ // - https://creativecommons.org/licenses/by/4.0/legalcode
+ // - You can generate this code by the script at:
+ // - https://github.com/vaiorabbit/everyday_use_kanji
// - References:
// - List of Joyo Kanji
- // - (Official list by the Agency for Cultural Affairs) https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kakuki/14/tosin02/index.html
// - (Wikipedia) https://en.wikipedia.org/wiki/List_of_j%C5%8Dy%C5%8D_kanji
// - List of Jinmeiyo Kanji
- // - (Official list by the Ministry of Justice) http://www.moj.go.jp/MINJI/minji86.html
// - (Wikipedia) https://en.wikipedia.org/wiki/Jinmeiy%C5%8D_kanji
// - Missing 1 Joyo Kanji: U+20B9F (Kun'yomi: Shikaru, On'yomi: Shitsu,shichi), see https://github.com/ocornut/imgui/pull/3627 for details.
// You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters.
@@ -3106,20 +3690,8 @@ void ImFontGlyphRangesBuilder::BuildRanges(ImVector<ImWchar>* out_ranges)
ImFont::ImFont()
{
- FontSize = 0.0f;
- FallbackAdvanceX = 0.0f;
- FallbackChar = (ImWchar)-1;
- EllipsisChar = (ImWchar)-1;
- DotChar = (ImWchar)-1;
- FallbackGlyph = NULL;
- ContainerAtlas = NULL;
- ConfigData = NULL;
- ConfigDataCount = 0;
- DirtyLookupTables = false;
+ memset(this, 0, sizeof(*this));
Scale = 1.0f;
- Ascent = Descent = 0.0f;
- MetricsTotalSurface = 0;
- memset(Used4kPagesMap, 0, sizeof(Used4kPagesMap));
}
ImFont::~ImFont()
@@ -3139,6 +3711,7 @@ void ImFont::ClearOutputData()
DirtyLookupTables = true;
Ascent = Descent = 0.0f;
MetricsTotalSurface = 0;
+ memset(Used8kPagesMap, 0, sizeof(Used8kPagesMap));
}
static ImWchar FindFirstExistingGlyph(ImFont* font, const ImWchar* candidate_chars, int candidate_chars_count)
@@ -3146,7 +3719,7 @@ static ImWchar FindFirstExistingGlyph(ImFont* font, const ImWchar* candidate_cha
for (int n = 0; n < candidate_chars_count; n++)
if (font->FindGlyphNoFallback(candidate_chars[n]) != NULL)
return candidate_chars[n];
- return (ImWchar)-1;
+ return 0;
}
void ImFont::BuildLookupTable()
@@ -3156,21 +3729,22 @@ void ImFont::BuildLookupTable()
max_codepoint = ImMax(max_codepoint, (int)Glyphs[i].Codepoint);
// Build lookup table
+ IM_ASSERT(Glyphs.Size > 0 && "Font has not loaded glyph!");
IM_ASSERT(Glyphs.Size < 0xFFFF); // -1 is reserved
IndexAdvanceX.clear();
IndexLookup.clear();
DirtyLookupTables = false;
- memset(Used4kPagesMap, 0, sizeof(Used4kPagesMap));
+ memset(Used8kPagesMap, 0, sizeof(Used8kPagesMap));
GrowIndex(max_codepoint + 1);
for (int i = 0; i < Glyphs.Size; i++)
{
int codepoint = (int)Glyphs[i].Codepoint;
IndexAdvanceX[codepoint] = Glyphs[i].AdvanceX;
- IndexLookup[codepoint] = (ImWchar)i;
+ IndexLookup[codepoint] = (ImU16)i;
// Mark 4K page as used
- const int page_n = codepoint / 4096;
- Used4kPagesMap[page_n >> 3] |= 1 << (page_n & 7);
+ const int page_n = codepoint / 8192;
+ Used8kPagesMap[page_n >> 3] |= 1 << (page_n & 7);
}
// Create a glyph to handle TAB
@@ -3184,24 +3758,16 @@ void ImFont::BuildLookupTable()
tab_glyph.Codepoint = '\t';
tab_glyph.AdvanceX *= IM_TABSIZE;
IndexAdvanceX[(int)tab_glyph.Codepoint] = (float)tab_glyph.AdvanceX;
- IndexLookup[(int)tab_glyph.Codepoint] = (ImWchar)(Glyphs.Size - 1);
+ IndexLookup[(int)tab_glyph.Codepoint] = (ImU16)(Glyphs.Size - 1);
}
// Mark special glyphs as not visible (note that AddGlyph already mark as non-visible glyphs with zero-size polygons)
- SetGlyphVisible((ImWchar)' ', false);
- SetGlyphVisible((ImWchar)'\t', false);
-
- // Ellipsis character is required for rendering elided text. We prefer using U+2026 (horizontal ellipsis).
- // However some old fonts may contain ellipsis at U+0085. Here we auto-detect most suitable ellipsis character.
- // FIXME: Note that 0x2026 is rarely included in our font ranges. Because of this we are more likely to use three individual dots.
- const ImWchar ellipsis_chars[] = { (ImWchar)0x2026, (ImWchar)0x0085 };
- const ImWchar dots_chars[] = { (ImWchar)'.', (ImWchar)0xFF0E };
- if (EllipsisChar == (ImWchar)-1)
- EllipsisChar = FindFirstExistingGlyph(this, ellipsis_chars, IM_ARRAYSIZE(ellipsis_chars));
- if (DotChar == (ImWchar)-1)
- DotChar = FindFirstExistingGlyph(this, dots_chars, IM_ARRAYSIZE(dots_chars));
+ if (ImFontGlyph* glyph = (ImFontGlyph*)(void*)FindGlyph((ImWchar)' '))
+ glyph->Visible = false;
+ if (ImFontGlyph* glyph = (ImFontGlyph*)(void*)FindGlyph((ImWchar)'\t'))
+ glyph->Visible = false;
- // Setup fallback character
+ // Setup Fallback character
const ImWchar fallback_chars[] = { (ImWchar)IM_UNICODE_CODEPOINT_INVALID, (ImWchar)'?', (ImWchar)' ' };
FallbackGlyph = FindGlyphNoFallback(FallbackChar);
if (FallbackGlyph == NULL)
@@ -3214,68 +3780,84 @@ void ImFont::BuildLookupTable()
FallbackChar = (ImWchar)FallbackGlyph->Codepoint;
}
}
-
FallbackAdvanceX = FallbackGlyph->AdvanceX;
for (int i = 0; i < max_codepoint + 1; i++)
if (IndexAdvanceX[i] < 0.0f)
IndexAdvanceX[i] = FallbackAdvanceX;
+
+ // Setup Ellipsis character. It is required for rendering elided text. We prefer using U+2026 (horizontal ellipsis).
+ // However some old fonts may contain ellipsis at U+0085. Here we auto-detect most suitable ellipsis character.
+ // FIXME: Note that 0x2026 is rarely included in our font ranges. Because of this we are more likely to use three individual dots.
+ const ImWchar ellipsis_chars[] = { Sources->EllipsisChar, (ImWchar)0x2026, (ImWchar)0x0085 };
+ const ImWchar dots_chars[] = { (ImWchar)'.', (ImWchar)0xFF0E };
+ if (EllipsisChar == 0)
+ EllipsisChar = FindFirstExistingGlyph(this, ellipsis_chars, IM_ARRAYSIZE(ellipsis_chars));
+ const ImWchar dot_char = FindFirstExistingGlyph(this, dots_chars, IM_ARRAYSIZE(dots_chars));
+ if (EllipsisChar != 0)
+ {
+ EllipsisCharCount = 1;
+ EllipsisWidth = EllipsisCharStep = FindGlyph(EllipsisChar)->X1;
+ }
+ else if (dot_char != 0)
+ {
+ const ImFontGlyph* dot_glyph = FindGlyph(dot_char);
+ EllipsisChar = dot_char;
+ EllipsisCharCount = 3;
+ EllipsisCharStep = (float)(int)(dot_glyph->X1 - dot_glyph->X0) + 1.0f;
+ EllipsisWidth = ImMax(dot_glyph->AdvanceX, dot_glyph->X0 + EllipsisCharStep * 3.0f - 1.0f); // FIXME: Slightly odd for normally mono-space fonts but since this is used for trailing contents.
+ }
}
-// API is designed this way to avoid exposing the 4K page size
+// API is designed this way to avoid exposing the 8K page size
// e.g. use with IsGlyphRangeUnused(0, 255)
bool ImFont::IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last)
{
- unsigned int page_begin = (c_begin / 4096);
- unsigned int page_last = (c_last / 4096);
+ unsigned int page_begin = (c_begin / 8192);
+ unsigned int page_last = (c_last / 8192);
for (unsigned int page_n = page_begin; page_n <= page_last; page_n++)
- if ((page_n >> 3) < sizeof(Used4kPagesMap))
- if (Used4kPagesMap[page_n >> 3] & (1 << (page_n & 7)))
+ if ((page_n >> 3) < sizeof(Used8kPagesMap))
+ if (Used8kPagesMap[page_n >> 3] & (1 << (page_n & 7)))
return false;
return true;
}
-void ImFont::SetGlyphVisible(ImWchar c, bool visible)
-{
- if (ImFontGlyph* glyph = (ImFontGlyph*)(void*)FindGlyph((ImWchar)c))
- glyph->Visible = visible ? 1 : 0;
-}
-
void ImFont::GrowIndex(int new_size)
{
IM_ASSERT(IndexAdvanceX.Size == IndexLookup.Size);
if (new_size <= IndexLookup.Size)
return;
IndexAdvanceX.resize(new_size, -1.0f);
- IndexLookup.resize(new_size, (ImWchar)-1);
+ IndexLookup.resize(new_size, (ImU16)-1);
}
// x0/y0/x1/y1 are offset from the character upper-left layout position, in pixels. Therefore x0/y0 are often fairly close to zero.
// Not to be mistaken with texture coordinates, which are held by u0/v0/u1/v1 in normalized format (0.0..1.0 on each texture axis).
-// 'cfg' is not necessarily == 'this->ConfigData' because multiple source fonts+configs can be used to build one target font.
-void ImFont::AddGlyph(const ImFontConfig* cfg, ImWchar codepoint, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x)
+// 'src' is not necessarily == 'this->Sources' because multiple source fonts+configs can be used to build one target font.
+void ImFont::AddGlyph(const ImFontConfig* src, ImWchar codepoint, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x)
{
- if (cfg != NULL)
+ if (src != NULL)
{
// Clamp & recenter if needed
const float advance_x_original = advance_x;
- advance_x = ImClamp(advance_x, cfg->GlyphMinAdvanceX, cfg->GlyphMaxAdvanceX);
+ advance_x = ImClamp(advance_x, src->GlyphMinAdvanceX, src->GlyphMaxAdvanceX);
if (advance_x != advance_x_original)
{
- float char_off_x = cfg->PixelSnapH ? ImFloor((advance_x - advance_x_original) * 0.5f) : (advance_x - advance_x_original) * 0.5f;
+ float char_off_x = src->PixelSnapH ? ImTrunc((advance_x - advance_x_original) * 0.5f) : (advance_x - advance_x_original) * 0.5f;
x0 += char_off_x;
x1 += char_off_x;
}
// Snap to pixel
- if (cfg->PixelSnapH)
+ if (src->PixelSnapH)
advance_x = IM_ROUND(advance_x);
- // Bake spacing
- advance_x += cfg->GlyphExtraSpacing.x;
+ // Bake extra spacing
+ advance_x += src->GlyphExtraAdvanceX;
}
+ int glyph_idx = Glyphs.Size;
Glyphs.resize(Glyphs.Size + 1);
- ImFontGlyph& glyph = Glyphs.back();
+ ImFontGlyph& glyph = Glyphs[glyph_idx];
glyph.Codepoint = (unsigned int)codepoint;
glyph.Visible = (x0 != x1) && (y0 != y1);
glyph.Colored = false;
@@ -3288,6 +3870,7 @@ void ImFont::AddGlyph(const ImFontConfig* cfg, ImWchar codepoint, float x0, floa
glyph.U1 = u1;
glyph.V1 = v1;
glyph.AdvanceX = advance_x;
+ IM_ASSERT(Glyphs.Size < 0xFFFF); // IndexLookup[] hold 16-bit values and -1 is reserved.
// Compute rough surface usage metrics (+1 to account for average padding, +0.99 to round)
// We use (U1-U0)*TexWidth instead of X1-X0 to account for oversampling.
@@ -3301,37 +3884,38 @@ void ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst)
IM_ASSERT(IndexLookup.Size > 0); // Currently this can only be called AFTER the font has been built, aka after calling ImFontAtlas::GetTexDataAs*() function.
unsigned int index_size = (unsigned int)IndexLookup.Size;
- if (dst < index_size && IndexLookup.Data[dst] == (ImWchar)-1 && !overwrite_dst) // 'dst' already exists
+ if (dst < index_size && IndexLookup.Data[dst] == (ImU16)-1 && !overwrite_dst) // 'dst' already exists
return;
if (src >= index_size && dst >= index_size) // both 'dst' and 'src' don't exist -> no-op
return;
GrowIndex(dst + 1);
- IndexLookup[dst] = (src < index_size) ? IndexLookup.Data[src] : (ImWchar)-1;
+ IndexLookup[dst] = (src < index_size) ? IndexLookup.Data[src] : (ImU16)-1;
IndexAdvanceX[dst] = (src < index_size) ? IndexAdvanceX.Data[src] : 1.0f;
}
-const ImFontGlyph* ImFont::FindGlyph(ImWchar c) const
+// Find glyph, return fallback if missing
+ImFontGlyph* ImFont::FindGlyph(ImWchar c)
{
if (c >= (size_t)IndexLookup.Size)
return FallbackGlyph;
- const ImWchar i = IndexLookup.Data[c];
- if (i == (ImWchar)-1)
+ const ImU16 i = IndexLookup.Data[c];
+ if (i == (ImU16)-1)
return FallbackGlyph;
return &Glyphs.Data[i];
}
-const ImFontGlyph* ImFont::FindGlyphNoFallback(ImWchar c) const
+ImFontGlyph* ImFont::FindGlyphNoFallback(ImWchar c)
{
if (c >= (size_t)IndexLookup.Size)
return NULL;
- const ImWchar i = IndexLookup.Data[c];
- if (i == (ImWchar)-1)
+ const ImU16 i = IndexLookup.Data[c];
+ if (i == (ImU16)-1)
return NULL;
return &Glyphs.Data[i];
}
-// Wrapping skips upcoming blanks
+// Trim trailing space and find beginning of next line
static inline const char* CalcWordWrapNextLineStartA(const char* text, const char* text_end)
{
while (text < text_end && ImCharIsBlankA(*text))
@@ -3341,10 +3925,12 @@ static inline const char* CalcWordWrapNextLineStartA(const char* text, const cha
return text;
}
+#define ImFontGetCharAdvanceX(_FONT, _CH) ((int)(_CH) < (_FONT)->IndexAdvanceX.Size ? (_FONT)->IndexAdvanceX.Data[_CH] : (_FONT)->FallbackAdvanceX)
+
// Simple word-wrapping for English, not full-featured. Please submit failing cases!
// This will return the next location to wrap from. If no wrapping if necessary, this will fast-forward to e.g. text_end.
// FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
-const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const
+const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width)
{
// For references, possible wrap point marked with ^
// "aaa bbb, ccc,ddd. eee fff. ggg!"
@@ -3367,6 +3953,7 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
bool inside_word = true;
const char* s = text;
+ IM_ASSERT(text_end != NULL);
while (s < text_end)
{
unsigned int c = (unsigned int)*s;
@@ -3375,8 +3962,6 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
next_s = s + 1;
else
next_s = s + ImTextCharFromUtf8(&c, s, text_end);
- if (c == 0)
- break;
if (c < 32)
{
@@ -3394,7 +3979,7 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
}
}
- const float char_width = ((int)c < IndexAdvanceX.Size ? IndexAdvanceX.Data[c] : FallbackAdvanceX);
+ const float char_width = ImFontGetCharAdvanceX(this, c);
if (ImCharIsBlankW(c))
{
if (inside_word)
@@ -3443,10 +4028,10 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
return s;
}
-ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end, const char** remaining) const
+ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end, const char** remaining)
{
if (!text_end)
- text_end = text_begin + strlen(text_begin); // FIXME-OPT: Need to avoid this.
+ text_end = text_begin + ImStrlen(text_begin); // FIXME-OPT: Need to avoid this.
const float line_height = size;
const float scale = size / FontSize;
@@ -3482,15 +4067,9 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
const char* prev_s = s;
unsigned int c = (unsigned int)*s;
if (c < 0x80)
- {
s += 1;
- }
else
- {
s += ImTextCharFromUtf8(&c, s, text_end);
- if (c == 0) // Malformed UTF-8?
- break;
- }
if (c < 32)
{
@@ -3505,7 +4084,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
continue;
}
- const float char_width = ((int)c < IndexAdvanceX.Size ? IndexAdvanceX.Data[c] : FallbackAdvanceX) * scale;
+ const float char_width = ImFontGetCharAdvanceX(this, c) * scale;
if (line_width + char_width >= max_width)
{
s = prev_s;
@@ -3528,7 +4107,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
}
// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
-void ImFont::RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c) const
+void ImFont::RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c)
{
const ImFontGlyph* glyph = FindGlyph(c);
if (!glyph || !glyph->Visible)
@@ -3536,27 +4115,27 @@ void ImFont::RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, Im
if (glyph->Colored)
col |= ~IM_COL32_A_MASK;
float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f;
- float x = IM_FLOOR(pos.x);
- float y = IM_FLOOR(pos.y);
+ float x = IM_TRUNC(pos.x);
+ float y = IM_TRUNC(pos.y);
draw_list->PrimReserve(6, 4);
draw_list->PrimRectUV(ImVec2(x + glyph->X0 * scale, y + glyph->Y0 * scale), ImVec2(x + glyph->X1 * scale, y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col);
}
// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
-void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const
+void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip)
{
- if (!text_end)
- text_end = text_begin + strlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls.
-
// Align to be pixel perfect
- float x = IM_FLOOR(pos.x);
- float y = IM_FLOOR(pos.y);
+ float x = IM_TRUNC(pos.x);
+ float y = IM_TRUNC(pos.y);
if (y > clip_rect.w)
return;
- const float start_x = x;
+ if (!text_end)
+ text_end = text_begin + ImStrlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls.
+
const float scale = size / FontSize;
const float line_height = FontSize * scale;
+ const float origin_x = x;
const bool word_wrap_enabled = (wrap_width > 0.0f);
// Fast-forward to first visible line
@@ -3564,13 +4143,13 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
if (y + line_height < clip_rect.y)
while (y + line_height < clip_rect.y && s < text_end)
{
- const char* line_end = (const char*)memchr(s, '\n', text_end - s);
+ const char* line_end = (const char*)ImMemchr(s, '\n', text_end - s);
if (word_wrap_enabled)
{
// FIXME-OPT: This is not optimal as do first do a search for \n before calling CalcWordWrapPositionA().
// If the specs for CalcWordWrapPositionA() were reworked to optionally return on \n we could combine both.
// However it is still better than nothing performing the fast-forward!
- s = CalcWordWrapPositionA(scale, s, line_end, wrap_width);
+ s = CalcWordWrapPositionA(scale, s, line_end ? line_end : text_end, wrap_width);
s = CalcWordWrapNextLineStartA(s, text_end);
}
else
@@ -3588,7 +4167,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
float y_end = y;
while (y_end < clip_rect.w && s_end < text_end)
{
- s_end = (const char*)memchr(s_end, '\n', text_end - s_end);
+ s_end = (const char*)ImMemchr(s_end, '\n', text_end - s_end);
s_end = s_end ? s_end + 1 : text_end;
y_end += line_height;
}
@@ -3602,10 +4181,9 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
const int idx_count_max = (int)(text_end - s) * 6;
const int idx_expected_size = draw_list->IdxBuffer.Size + idx_count_max;
draw_list->PrimReserve(idx_count_max, vtx_count_max);
-
- ImDrawVert* vtx_write = draw_list->_VtxWritePtr;
- ImDrawIdx* idx_write = draw_list->_IdxWritePtr;
- unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx;
+ ImDrawVert* vtx_write = draw_list->_VtxWritePtr;
+ ImDrawIdx* idx_write = draw_list->_IdxWritePtr;
+ unsigned int vtx_index = draw_list->_VtxCurrentIdx;
const ImU32 col_untinted = col | ~IM_COL32_A_MASK;
const char* word_wrap_eol = NULL;
@@ -3616,12 +4194,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
{
// Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
if (!word_wrap_eol)
- word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - start_x));
+ word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - origin_x));
if (s >= word_wrap_eol)
{
- x = start_x;
+ x = origin_x;
y += line_height;
+ if (y > clip_rect.w)
+ break; // break out of main loop
word_wrap_eol = NULL;
s = CalcWordWrapNextLineStartA(s, text_end); // Wrapping skips upcoming blanks
continue;
@@ -3631,21 +4211,15 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
// Decode and advance source
unsigned int c = (unsigned int)*s;
if (c < 0x80)
- {
s += 1;
- }
else
- {
s += ImTextCharFromUtf8(&c, s, text_end);
- if (c == 0) // Malformed UTF-8?
- break;
- }
if (c < 32)
{
if (c == '\n')
{
- x = start_x;
+ x = origin_x;
y += line_height;
if (y > clip_rect.w)
break; // break out of main loop
@@ -3710,14 +4284,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
// We are NOT calling PrimRectUV() here because non-inlined causes too much overhead in a debug builds. Inlined here:
{
- idx_write[0] = (ImDrawIdx)(vtx_current_idx); idx_write[1] = (ImDrawIdx)(vtx_current_idx+1); idx_write[2] = (ImDrawIdx)(vtx_current_idx+2);
- idx_write[3] = (ImDrawIdx)(vtx_current_idx); idx_write[4] = (ImDrawIdx)(vtx_current_idx+2); idx_write[5] = (ImDrawIdx)(vtx_current_idx+3);
vtx_write[0].pos.x = x1; vtx_write[0].pos.y = y1; vtx_write[0].col = glyph_col; vtx_write[0].uv.x = u1; vtx_write[0].uv.y = v1;
vtx_write[1].pos.x = x2; vtx_write[1].pos.y = y1; vtx_write[1].col = glyph_col; vtx_write[1].uv.x = u2; vtx_write[1].uv.y = v1;
vtx_write[2].pos.x = x2; vtx_write[2].pos.y = y2; vtx_write[2].col = glyph_col; vtx_write[2].uv.x = u2; vtx_write[2].uv.y = v2;
vtx_write[3].pos.x = x1; vtx_write[3].pos.y = y2; vtx_write[3].col = glyph_col; vtx_write[3].uv.x = u1; vtx_write[3].uv.y = v2;
+ idx_write[0] = (ImDrawIdx)(vtx_index); idx_write[1] = (ImDrawIdx)(vtx_index + 1); idx_write[2] = (ImDrawIdx)(vtx_index + 2);
+ idx_write[3] = (ImDrawIdx)(vtx_index); idx_write[4] = (ImDrawIdx)(vtx_index + 2); idx_write[5] = (ImDrawIdx)(vtx_index + 3);
vtx_write += 4;
- vtx_current_idx += 4;
+ vtx_index += 4;
idx_write += 6;
}
}
@@ -3731,7 +4305,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
draw_list->CmdBuffer[draw_list->CmdBuffer.Size - 1].ElemCount -= (idx_expected_size - draw_list->IdxBuffer.Size);
draw_list->_VtxWritePtr = vtx_write;
draw_list->_IdxWritePtr = idx_write;
- draw_list->_VtxCurrentIdx = vtx_current_idx;
+ draw_list->_VtxCurrentIdx = vtx_index;
}
//-----------------------------------------------------------------------------
@@ -3783,6 +4357,7 @@ void ImGui::RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir d
void ImGui::RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col)
{
+ // FIXME-OPT: This should be baked in font.
draw_list->AddCircleFilled(pos, draw_list->_Data->FontSize * 0.20f, col, 8);
}
@@ -3856,8 +4431,8 @@ void ImGui::RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, Im
}
else
{
- draw_list->PathArcTo(ImVec2(x0, p1.y - rounding), rounding, IM_PI - arc0_e, IM_PI - arc0_b, 3); // BL
- draw_list->PathArcTo(ImVec2(x0, p0.y + rounding), rounding, IM_PI + arc0_b, IM_PI + arc0_e, 3); // TR
+ draw_list->PathArcTo(ImVec2(x0, p1.y - rounding), rounding, IM_PI - arc0_e, IM_PI - arc0_b); // BL
+ draw_list->PathArcTo(ImVec2(x0, p0.y + rounding), rounding, IM_PI + arc0_b, IM_PI + arc0_e); // TR
}
if (p1.x > rect.Min.x + rounding)
{
@@ -3876,8 +4451,8 @@ void ImGui::RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, Im
}
else
{
- draw_list->PathArcTo(ImVec2(x1, p0.y + rounding), rounding, -arc1_e, -arc1_b, 3); // TR
- draw_list->PathArcTo(ImVec2(x1, p1.y - rounding), rounding, +arc1_b, +arc1_e, 3); // BR
+ draw_list->PathArcTo(ImVec2(x1, p0.y + rounding), rounding, -arc1_e, -arc1_b); // TR
+ draw_list->PathArcTo(ImVec2(x1, p1.y - rounding), rounding, +arc1_b, +arc1_e); // BR
}
}
draw_list->PathFillConvex(col);
@@ -4064,104 +4639,190 @@ static unsigned int stb_decompress(unsigned char *output, const unsigned char *i
//-----------------------------------------------------------------------------
// ProggyClean.ttf
// Copyright (c) 2004, 2005 Tristan Grimmer
-// MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip)
-// Download and more information at http://upperbounds.net
+// MIT license (see License.txt in http://www.proggyfonts.net/index.php?menu=download)
+// Download and more information at http://www.proggyfonts.net or http://upperboundsinteractive.com/fonts.php
//-----------------------------------------------------------------------------
+
+#ifndef IMGUI_DISABLE_DEFAULT_FONT
+
// File: 'ProggyClean.ttf' (41208 bytes)
-// Exported using misc/fonts/binary_to_compressed_c.cpp (with compression + base85 string encoding).
-// The purpose of encoding as base85 instead of "0x00,0x01,..." style is only save on _source code_ size.
-//-----------------------------------------------------------------------------
-static const char proggy_clean_ttf_compressed_data_base85[11980 + 1] =
- "7])#######hV0qs'/###[),##/l:$#Q6>##5[n42>c-TH`->>#/e>11NNV=Bv(*:.F?uu#(gRU.o0XGH`$vhLG1hxt9?W`#,5LsCp#-i>.r$<$6pD>Lb';9Crc6tgXmKVeU2cD4Eo3R/"
- "2*>]b(MC;$jPfY.;h^`IWM9<Lh2TlS+f-s$o6Q<BWH`YiU.xfLq$N;$0iR/GX:U(jcW2p/W*q?-qmnUCI;jHSAiFWM.R*kU@C=GH?a9wp8f$e.-4^Qg1)Q-GL(lf(r/7GrRgwV%MS=C#"
- "`8ND>Qo#t'X#(v#Y9w0#1D$CIf;W'#pWUPXOuxXuU(H9M(1<q-UE31#^-V'8IRUo7Qf./L>=Ke$$'5F%)]0^#0X@U.a<r:QLtFsLcL6##lOj)#.Y5<-R&KgLwqJfLgN&;Q?gI^#DY2uL"
- "i@^rMl9t=cWq6##weg>$FBjVQTSDgEKnIS7EM9>ZY9w0#L;>>#Mx&4Mvt//L[MkA#W@lK.N'[0#7RL_&#w+F%HtG9M#XL`N&.,GM4Pg;-<nLENhvx>-VsM.M0rJfLH2eTM`*oJMHRC`N"
- "kfimM2J,W-jXS:)r0wK#@Fge$U>`w'N7G#$#fB#$E^$#:9:hk+eOe--6x)F7*E%?76%^GMHePW-Z5l'&GiF#$956:rS?dA#fiK:)Yr+`&#0j@'DbG&#^$PG.Ll+DNa<XCMKEV*N)LN/N"
- "*b=%Q6pia-Xg8I$<MR&,VdJe$<(7G;Ckl'&hF;;$<_=X(b.RS%%)###MPBuuE1V:v&cX&#2m#(&cV]`k9OhLMbn%s$G2,B$BfD3X*sp5#l,$R#]x_X1xKX%b5U*[r5iMfUo9U`N99hG)"
- "tm+/Us9pG)XPu`<0s-)WTt(gCRxIg(%6sfh=ktMKn3j)<6<b5Sk_/0(^]AaN#(p/L>&VZ>1i%h1S9u5o@YaaW$e+b<TWFn/Z:Oh(Cx2$lNEoN^e)#CFY@@I;BOQ*sRwZtZxRcU7uW6CX"
- "ow0i(?$Q[cjOd[P4d)]>ROPOpxTO7Stwi1::iB1q)C_=dV26J;2,]7op$]uQr@_V7$q^%lQwtuHY]=DX,n3L#0PHDO4f9>dC@O>HBuKPpP*E,N+b3L#lpR/MrTEH.IAQk.a>D[.e;mc."
- "x]Ip.PH^'/aqUO/$1WxLoW0[iLA<QT;5HKD+@qQ'NQ(3_PLhE48R.qAPSwQ0/WK?Z,[x?-J;jQTWA0X@KJ(_Y8N-:/M74:/-ZpKrUss?d#dZq]DAbkU*JqkL+nwX@@47`5>w=4h(9.`G"
- "CRUxHPeR`5Mjol(dUWxZa(>STrPkrJiWx`5U7F#.g*jrohGg`cg:lSTvEY/EV_7H4Q9[Z%cnv;JQYZ5q.l7Zeas:HOIZOB?G<Nald$qs]@]L<J7bR*>gv:[7MI2k).'2($5FNP&EQ(,)"
- "U]W]+fh18.vsai00);D3@4ku5P?DP8aJt+;qUM]=+b'8@;mViBKx0DE[-auGl8:PJ&Dj+M6OC]O^((##]`0i)drT;-7X`=-H3[igUnPG-NZlo.#k@h#=Ork$m>a>$-?Tm$UV(?#P6YY#"
- "'/###xe7q.73rI3*pP/$1>s9)W,JrM7SN]'/4C#v$U`0#V.[0>xQsH$fEmPMgY2u7Kh(G%siIfLSoS+MK2eTM$=5,M8p`A.;_R%#u[K#$x4AG8.kK/HSB==-'Ie/QTtG?-.*^N-4B/ZM"
- "_3YlQC7(p7q)&](`6_c)$/*JL(L-^(]$wIM`dPtOdGA,U3:w2M-0<q-]L_?^)1vw'.,MRsqVr.L;aN&#/EgJ)PBc[-f>+WomX2u7lqM2iEumMTcsF?-aT=Z-97UEnXglEn1K-bnEO`gu"
- "Ft(c%=;Am_Qs@jLooI&NX;]0#j4#F14;gl8-GQpgwhrq8'=l_f-b49'UOqkLu7-##oDY2L(te+Mch&gLYtJ,MEtJfLh'x'M=$CS-ZZ%P]8bZ>#S?YY#%Q&q'3^Fw&?D)UDNrocM3A76/"
- "/oL?#h7gl85[qW/NDOk%16ij;+:1a'iNIdb-ou8.P*w,v5#EI$TWS>Pot-R*H'-SEpA:g)f+O$%%`kA#G=8RMmG1&O`>to8bC]T&$,n.LoO>29sp3dt-52U%VM#q7'DHpg+#Z9%H[K<L"
- "%a2E-grWVM3@2=-k22tL]4$##6We'8UJCKE[d_=%wI;'6X-GsLX4j^SgJ$##R*w,vP3wK#iiW&#*h^D&R?jp7+/u&#(AP##XU8c$fSYW-J95_-Dp[g9wcO&#M-h1OcJlc-*vpw0xUX&#"
- "OQFKNX@QI'IoPp7nb,QU//MQ&ZDkKP)X<WSVL(68uVl&#c'[0#(s1X&xm$Y%B7*K:eDA323j998GXbA#pwMs-jgD$9QISB-A_(aN4xoFM^@C58D0+Q+q3n0#3U1InDjF682-SjMXJK)("
- "h$hxua_K]ul92%'BOU&#BRRh-slg8KDlr:%L71Ka:.A;%YULjDPmL<LYs8i#XwJOYaKPKc1h:'9Ke,g)b),78=I39B;xiY$bgGw-&.Zi9InXDuYa%G*f2Bq7mn9^#p1vv%#(Wi-;/Z5h"
- "o;#2:;%d&#x9v68C5g?ntX0X)pT`;%pB3q7mgGN)3%(P8nTd5L7GeA-GL@+%J3u2:(Yf>et`e;)f#Km8&+DC$I46>#Kr]]u-[=99tts1.qb#q72g1WJO81q+eN'03'eM>&1XxY-caEnO"
- "j%2n8)),?ILR5^.Ibn<-X-Mq7[a82Lq:F&#ce+S9wsCK*x`569E8ew'He]h:sI[2LM$[guka3ZRd6:t%IG:;$%YiJ:Nq=?eAw;/:nnDq0(CYcMpG)qLN4$##&J<j$UpK<Q4a1]MupW^-"
- "sj_$%[HK%'F####QRZJ::Y3EGl4'@%FkiAOg#p[##O`gukTfBHagL<LHw%q&OV0##F=6/:chIm0@eCP8X]:kFI%hl8hgO@RcBhS-@Qb$%+m=hPDLg*%K8ln(wcf3/'DW-$.lR?n[nCH-"
- "eXOONTJlh:.RYF%3'p6sq:UIMA945&^HFS87@$EP2iG<-lCO$%c`uKGD3rC$x0BL8aFn--`ke%#HMP'vh1/R&O_J9'um,.<tx[@%wsJk&bUT2`0uMv7gg#qp/ij.L56'hl;.s5CUrxjO"
- "M7-##.l+Au'A&O:-T72L]P`&=;ctp'XScX*rU.>-XTt,%OVU4)S1+R-#dg0/Nn?Ku1^0f$B*P:Rowwm-`0PKjYDDM'3]d39VZHEl4,.j']Pk-M.h^&:0FACm$maq-&sgw0t7/6(^xtk%"
- "LuH88Fj-ekm>GA#_>568x6(OFRl-IZp`&b,_P'$M<Jnq79VsJW/mWS*PUiq76;]/NM_>hLbxfc$mj`,O;&%W2m`Zh:/)Uetw:aJ%]K9h:TcF]u_-Sj9,VK3M.*'&0D[Ca]J9gp8,kAW]"
- "%(?A%R$f<->Zts'^kn=-^@c4%-pY6qI%J%1IGxfLU9CP8cbPlXv);C=b),<2mOvP8up,UVf3839acAWAW-W?#ao/^#%KYo8fRULNd2.>%m]UK:n%r$'sw]J;5pAoO_#2mO3n,'=H5(et"
- "Hg*`+RLgv>=4U8guD$I%D:W>-r5V*%j*W:Kvej.Lp$<M-SGZ':+Q_k+uvOSLiEo(<aD/K<CCc`'Lx>'?;++O'>()jLR-^u68PHm8ZFWe+ej8h:9r6L*0//c&iH&R8pRbA#Kjm%upV1g:"
- "a_#Ur7FuA#(tRh#.Y5K+@?3<-8m0$PEn;J:rh6?I6uG<-`wMU'ircp0LaE_OtlMb&1#6T.#FDKu#1Lw%u%+GM+X'e?YLfjM[VO0MbuFp7;>Q&#WIo)0@F%q7c#4XAXN-U&VB<HFF*qL("
- "$/V,;(kXZejWO`<[5?\?ewY(*9=%wDc;,u<'9t3W-(H1th3+G]ucQ]kLs7df($/*JL]@*t7Bu_G3_7mp7<iaQjO@.kLg;x3B0lqp7Hf,^Ze7-##@/c58Mo(3;knp0%)A7?-W+eI'o8)b<"
- "nKnw'Ho8C=Y>pqB>0ie&jhZ[?iLR@@_AvA-iQC(=ksRZRVp7`.=+NpBC%rh&3]R:8XDmE5^V8O(x<<aG/1N$#FX$0V5Y6x'aErI3I$7x%E`v<-BY,)%-?Psf*l?%C3.mM(=/M0:JxG'?"
- "7WhH%o'a<-80g0NBxoO(GH<dM]n.+%q@jH?f.UsJ2Ggs&4<-e47&Kl+f//9@`b+?.TeN_&B8Ss?v;^Trk;f#YvJkl&w$]>-+k?'(<S:68tq*WoDfZu';mM?8X[ma8W%*`-=;D.(nc7/;"
- ")g:T1=^J$&BRV(-lTmNB6xqB[@0*o.erM*<SWF]u2=st-*(6v>^](H.aREZSi,#1:[IXaZFOm<-ui#qUq2$##Ri;u75OK#(RtaW-K-F`S+cF]uN`-KMQ%rP/Xri.LRcB##=YL3BgM/3M"
- "D?@f&1'BW-)Ju<L25gl8uhVm1hL$##*8###'A3/LkKW+(^rWX?5W_8g)a(m&K8P>#bmmWCMkk&#TR`C,5d>g)F;t,4:@_l8G/5h4vUd%&%950:VXD'QdWoY-F$BtUwmfe$YqL'8(PWX("
- "P?^@Po3$##`MSs?DWBZ/S>+4%>fX,VWv/w'KD`LP5IbH;rTV>n3cEK8U#bX]l-/V+^lj3;vlMb&[5YQ8#pekX9JP3XUC72L,,?+Ni&co7ApnO*5NK,((W-i:$,kp'UDAO(G0Sq7MVjJs"
- "bIu)'Z,*[>br5fX^:FPAWr-m2KgL<LUN098kTF&#lvo58=/vjDo;.;)Ka*hLR#/k=rKbxuV`>Q_nN6'8uTG&#1T5g)uLv:873UpTLgH+#FgpH'_o1780Ph8KmxQJ8#H72L4@768@Tm&Q"
- "h4CB/5OvmA&,Q&QbUoi$a_%3M01H)4x7I^&KQVgtFnV+;[Pc>[m4k//,]1?#`VY[Jr*3&&slRfLiVZJ:]?=K3Sw=[$=uRB?3xk48@aeg<Z'<$#4H)6,>e0jT6'N#(q%.O=?2S]u*(m<-"
- "V8J'(1)G][68hW$5'q[GC&5j`TE?m'esFGNRM)j,ffZ?-qx8;->g4t*:CIP/[Qap7/9'#(1sao7w-.qNUdkJ)tCF&#B^;xGvn2r9FEPFFFcL@.iFNkTve$m%#QvQS8U@)2Z+3K:AKM5i"
- "sZ88+dKQ)W6>J%CL<KE>`.d*(B`-n8D9oK<Up]c$X$(,)M8Zt7/[rdkqTgl-0cuGMv'?>-XV1q['-5k'cAZ69e;D_?$ZPP&s^+7])$*$#@QYi9,5P&#9r+$%CE=68>K8r0=dSC%%(@p7"
- ".m7jilQ02'0-VWAg<a/''3u.=4L$Y)6k/K:_[3=&jvL<L0C/2'v:^;-DIBW,B4E68:kZ;%?8(Q8BH=kO65BW?xSG&#@uU,DS*,?.+(o(#1vCS8#CHF>TlGW'b)Tq7VT9q^*^$$.:&N@@"
- "$&)WHtPm*5_rO0&e%K&#-30j(E4#'Zb.o/(Tpm$>K'f@[PvFl,hfINTNU6u'0pao7%XUp9]5.>%h`8_=VYbxuel.NTSsJfLacFu3B'lQSu/m6-Oqem8T+oE--$0a/k]uj9EwsG>%veR*"
- "hv^BFpQj:K'#SJ,sB-'#](j.Lg92rTw-*n%@/;39rrJF,l#qV%OrtBeC6/,;qB3ebNW[?,Hqj2L.1NP&GjUR=1D8QaS3Up&@*9wP?+lo7b?@%'k4`p0Z$22%K3+iCZj?XJN4Nm&+YF]u"
- "@-W$U%VEQ/,,>>#)D<h#`)h0:<Q6909ua+&VU%n2:cG3FJ-%@Bj-DgLr`Hw&HAKjKjseK</xKT*)B,N9X3]krc12t'pgTV(Lv-tL[xg_%=M_q7a^x?7Ubd>#%8cY#YZ?=,`Wdxu/ae&#"
- "w6)R89tI#6@s'(6Bf7a&?S=^ZI_kS&ai`&=tE72L_D,;^R)7[$s<Eh#c&)q.MXI%#v9ROa5FZO%sF7q7Nwb&#ptUJ:aqJe$Sl68%.D###EC><?-aF&#RNQv>o8lKN%5/$(vdfq7+ebA#"
- "u1p]ovUKW&Y%q]'>$1@-[xfn$7ZTp7mM,G,Ko7a&Gu%G[RMxJs[0MM%wci.LFDK)(<c`Q8N)jEIF*+?P2a8g%)$q]o2aH8C&<SibC/q,(e:v;-b#6[$NtDZ84Je2KNvB#$P5?tQ3nt(0"
- "d=j.LQf./Ll33+(;q3L-w=8dX$#WF&uIJ@-bfI>%:_i2B5CsR8&9Z&#=mPEnm0f`<&c)QL5uJ#%u%lJj+D-r;BoF&#4DoS97h5g)E#o:&S4weDF,9^Hoe`h*L+_a*NrLW-1pG_&2UdB8"
- "6e%B/:=>)N4xeW.*wft-;$'58-ESqr<b?UI(_%@[P46>#U`'6AQ]m&6/`Z>#S?YY#Vc;r7U2&326d=w&H####?TZ`*4?&.MK?LP8Vxg>$[QXc%QJv92.(Db*B)gb*BM9dM*hJMAo*c&#"
- "b0v=Pjer]$gG&JXDf->'StvU7505l9$AFvgYRI^&<^b68?j#q9QX4SM'RO#&sL1IM.rJfLUAj221]d##DW=m83u5;'bYx,*Sl0hL(W;;$doB&O/TQ:(Z^xBdLjL<Lni;''X.`$#8+1GD"
- ":k$YUWsbn8ogh6rxZ2Z9]%nd+>V#*8U_72Lh+2Q8Cj0i:6hp&$C/:p(HK>T8Y[gHQ4`4)'$Ab(Nof%V'8hL&#<NEdtg(n'=S1A(Q1/I&4([%dM`,Iu'1:_hL>SfD07&6D<fp8dHM7/g+"
- "tlPN9J*rKaPct&?'uBCem^jn%9_K)<,C5K3s=5g&GmJb*[SYq7K;TRLGCsM-$$;S%:Y@r7AK0pprpL<Lrh,q7e/%KWK:50I^+m'vi`3?%Zp+<-d+$L-Sv:@.o19n$s0&39;kn;S%BSq*"
- "$3WoJSCLweV[aZ'MQIjO<7;X-X;&+dMLvu#^UsGEC9WEc[X(wI7#2.(F0jV*eZf<-Qv3J-c+J5AlrB#$p(H68LvEA'q3n0#m,[`*8Ft)FcYgEud]CWfm68,(aLA$@EFTgLXoBq/UPlp7"
- ":d[/;r_ix=:TF`S5H-b<LI&HY(K=h#)]Lk$K14lVfm:x$H<3^Ql<M`$OhapBnkup'D#L$Pb_`N*g]2e;X/Dtg,bsj&K#2[-:iYr'_wgH)NUIR8a1n#S?Yej'h8^58UbZd+^FKD*T@;6A"
- "7aQC[K8d-(v6GI$x:T<&'Gp5Uf>@M.*J:;$-rv29'M]8qMv-tLp,'886iaC=Hb*YJoKJ,(j%K=H`K.v9HggqBIiZu'QvBT.#=)0ukruV&.)3=(^1`o*Pj4<-<aN((^7('#Z0wK#5GX@7"
- "u][`*S^43933A4rl][`*O4CgLEl]v$1Q3AeF37dbXk,.)vj#x'd`;qgbQR%FW,2(?LO=s%Sc68%NP'##Aotl8x=BE#j1UD([3$M(]UI2LX3RpKN@;/#f'f/&_mt&F)XdF<9t4)Qa.*kT"
- "LwQ'(TTB9.xH'>#MJ+gLq9-##@HuZPN0]u:h7.T..G:;$/Usj(T7`Q8tT72LnYl<-qx8;-HV7Q-&Xdx%1a,hC=0u+HlsV>nuIQL-5<N?)NBS)QN*_I,?&)2'IM%L3I)X((e/dl2&8'<M"
- ":^#M*Q+[T.Xri.LYS3v%fF`68h;b-X[/En'CR.q7E)p'/kle2HM,u;^%OKC-N+Ll%F9CF<Nf'^#t2L,;27W:0O@6##U6W7:$rJfLWHj$#)woqBefIZ.PK<b*t7ed;p*_m;4ExK#h@&]>"
- "_>@kXQtMacfD.m-VAb8;IReM3$wf0''hra*so568'Ip&vRs849'MRYSp%:t:h5qSgwpEr$B>Q,;s(C#$)`svQuF$##-D,##,g68@2[T;.XSdN9Qe)rpt._K-#5wF)sP'##p#C0c%-Gb%"
- "hd+<-j'Ai*x&&HMkT]C'OSl##5RG[JXaHN;d'uA#x._U;.`PU@(Z3dt4r152@:v,'R.Sj'w#0<-;kPI)FfJ&#AYJ&#//)>-k=m=*XnK$>=)72L]0I%>.G690a:$##<,);?;72#?x9+d;"
- "^V'9;jY@;)br#q^YQpx:X#Te$Z^'=-=bGhLf:D6&bNwZ9-ZD#n^9HhLMr5G;']d&6'wYmTFmL<LD)F^%[tC'8;+9E#C$g%#5Y>q9wI>P(9mI[>kC-ekLC/R&CH+s'B;K-M6$EB%is00:"
- "+A4[7xks.LrNk0&E)wILYF@2L'0Nb$+pv<(2.768/FrY&h$^3i&@+G%JT'<-,v`3;_)I9M^AE]CN?Cl2AZg+%4iTpT3<n-&%H%b<FDj2M<hH=&Eh<2Len$b*aTX=-8QxN)k11IM1c^j%"
- "9s<L<NFSo)B?+<-(GxsF,^-Eh@$4dXhN$+#rxK8'je'D7k`e;)2pYwPA'_p9&@^18ml1^[@g4t*[JOa*[=Qp7(qJ_oOL^('7fB&Hq-:sf,sNj8xq^>$U4O]GKx'm9)b@p7YsvK3w^YR-"
- "CdQ*:Ir<($u&)#(&?L9Rg3H)4fiEp^iI9O8KnTj,]H?D*r7'M;PwZ9K0E^k&-cpI;.p/6_vwoFMV<->#%Xi.LxVnrU(4&8/P+:hLSKj$#U%]49t'I:rgMi'FL@a:0Y-uA[39',(vbma*"
- "hU%<-SRF`Tt:542R_VV$p@[p8DV[A,?1839FWdF<TddF<9Ah-6&9tWoDlh]&1SpGMq>Ti1O*H&#(AL8[_P%.M>v^-))qOT*F5Cq0`Ye%+$B6i:7@0IX<N+T+0MlMBPQ*Vj>SsD<U4JHY"
- "8kD2)2fU/M#$e.)T4,_=8hLim[&);?UkK'-x?'(:siIfL<$pFM`i<?%W(mGDHM%>iWP,##P`%/L<eXi:@Z9C.7o=@(pXdAO/NLQ8lPl+HPOQa8wD8=^GlPa8TKI1CjhsCTSLJM'/Wl>-"
- "S(qw%sf/@%#B6;/U7K]uZbi^Oc^2n<bhPmUkMw>%t<)'mEVE''n`WnJra$^TKvX5B>;_aSEK',(hwa0:i4G?.Bci.(X[?b*($,=-n<.Q%`(X=?+@Am*Js0&=3bh8K]mL<LoNs'6,'85`"
- "0?t/'_U59@]ddF<#LdF<eWdF<OuN/45rY<-L@&#+fm>69=Lb,OcZV/);TTm8VI;?%OtJ<(b4mq7M6:u?KRdF<gR@2L=FNU-<b[(9c/ML3m;Z[$oF3g)GAWqpARc=<ROu7cL5l;-[A]%/"
- "+fsd;l#SafT/f*W]0=O'$(Tb<[)*@e775R-:Yob%g*>l*:xP?Yb.5)%w_I?7uk5JC+FS(m#i'k.'a0i)9<7b'fs'59hq$*5Uhv##pi^8+hIEBF`nvo`;'l0.^S1<-wUK2/Coh58KKhLj"
- "M=SO*rfO`+qC`W-On.=AJ56>>i2@2LH6A:&5q`?9I3@@'04&p2/LVa*T-4<-i3;M9UvZd+N7>b*eIwg:CC)c<>nO&#<IGe;__.thjZl<%w(Wk2xmp4Q@I#I9,DF]u7-P=.-_:YJ]aS@V"
- "?6*C()dOp7:WL,b&3Rg/.cmM9&r^>$(>.Z-I&J(Q0Hd5Q%7Co-b`-c<N(6r@ip+AurK<m86QIth*#v;-OBqi+L7wDE-Ir8K['m+DDSLwK&/.?-V%U_%3:qKNu$_b*B-kp7NaD'QdWQPK"
- "Yq[@>P)hI;*_F]u`Rb[.j8_Q/<&>uu+VsH$sM9TA%?)(vmJ80),P7E>)tjD%2L=-t#fK[%`v=Q8<FfNkgg^oIbah*#8/Qt$F&:K*-(N/'+1vMB,u()-a.VUU*#[e%gAAO(S>WlA2);Sa"
- ">gXm8YB`1d@K#n]76-a$U,mF<fX]idqd)<3,]J7JmW4`6]uks=4-72L(jEk+:bJ0M^q-8Dm_Z?0olP1C9Sa&H[d&c$ooQUj]Exd*3ZM@-WGW2%s',B-_M%>%Ul:#/'xoFM9QX-$.QN'>"
- "[%$Z$uF6pA6Ki2O5:8w*vP1<-1`[G,)-m#>0`P&#eb#.3i)rtB61(o'$?X3B</R90;eZ]%Ncq;-Tl]#F>2Qft^ae_5tKL9MUe9b*sLEQ95C&`=G?@Mj=wh*'3E>=-<)Gt*Iw)'QG:`@I"
- "wOf7&]1i'S01B+Ev/Nac#9S;=;YQpg_6U`*kVY39xK,[/6Aj7:'1Bm-_1EYfa1+o&o4hp7KN_Q(OlIo@S%;jVdn0'1<Vc52=u`3^o-n1'g4v58Hj&6_t7$##?M)c<$bgQ_'SY((-xkA#"
- "Y(,p'H9rIVY-b,'%bCPF7.J<Up^,(dU1VY*5#WkTU>h19w,WQhLI)3S#f$2(eb,jr*b;3Vw]*7NH%$c4Vs,eD9>XW8?N]o+(*pgC%/72LV-u<Hp,3@e^9UB1J+ak9-TN/mhKPg+AJYd$"
- "MlvAF_jCK*.O-^(63adMT->W%iewS8W6m2rtCpo'RS1R84=@paTKt)>=%&1[)*vp'u+x,VrwN;&]kuO9JDbg=pO$J*.jVe;u'm0dr9l,<*wMK*Oe=g8lV_KEBFkO'oU]^=[-792#ok,)"
- "i]lR8qQ2oA8wcRCZ^7w/Njh;?.stX?Q1>S1q4Bn$)K1<-rGdO'$Wr.Lc.CG)$/*JL4tNR/,SVO3,aUw'DJN:)Ss;wGn9A32ijw%FL+Z0Fn.U9;reSq)bmI32U==5ALuG&#Vf1398/pVo"
- "1*c-(aY168o<`JsSbk-,1N;$>0:OUas(3:8Z972LSfF8eb=c-;>SPw7.6hn3m`9^Xkn(r.qS[0;T%&Qc=+STRxX'q1BNk3&*eu2;&8q$&x>Q#Q7^Tf+6<(d%ZVmj2bDi%.3L2n+4W'$P"
- "iDDG)g,r%+?,$@?uou5tSe2aN_AQU*<h`e-GI7)?OK2A.d7_c)?wQ5AS@DL3r#7fSkgl6-++D:'A,uq7SvlB$pcpH'q3n0#_%dY#xCpr-l<F0NR@-##FEV6NTF6##$l84N1w?AO>'IAO"
- "URQ##V^Fv-XFbGM7Fl(N<3DhLGF%q.1rC$#:T__&Pi68%0xi_&[qFJ(77j_&JWoF.V735&T,[R*:xFR*K5>>#`bW-?4Ne_&6Ne_&6Ne_&n`kr-#GJcM6X;uM6X;uM(.a..^2TkL%oR(#"
- ";u.T%fAr%4tJ8&><1=GHZ_+m9/#H1F^R#SC#*N=BA9(D?v[UiFY>>^8p,KKF.W]L29uLkLlu/+4T<XoIB&hx=T1PcDaB&;HH+-AFr?(m9HZV)FKS8JCw;SD=6[^/DZUL`EUDf]GGlG&>"
- "w$)F./^n3+rlo+DB;5sIYGNk+i1t-69Jg--0pao7Sm#K)pdHW&;LuDNH@H>#/X-TI(;P>#,Gc>#0Su>#4`1?#8lC?#<xU?#@.i?#D:%@#HF7@#LRI@#P_[@#Tkn@#Xw*A#]-=A#a9OA#"
- "d<F&#*;G##.GY##2Sl##6`($#:l:$#>xL$#B.`$#F:r$#JF.%#NR@%#R_R%#Vke%#Zww%#_-4&#3^Rh%Sflr-k'MS.o?.5/sWel/wpEM0%3'/1)K^f1-d>G21&v(35>V`39V7A4=onx4"
- "A1OY5EI0;6Ibgr6M$HS7Q<)58C5w,;WoA*#[%T*#`1g*#d=#+#hI5+#lUG+#pbY+#tnl+#x$),#&1;,#*=M,#.I`,#2Ur,#6b.-#;w[H#iQtA#m^0B#qjBB#uvTB##-hB#'9$C#+E6C#"
- "/QHC#3^ZC#7jmC#;v)D#?,<D#C8ND#GDaD#KPsD#O]/E#g1A5#KA*1#gC17#MGd;#8(02#L-d3#rWM4#Hga1#,<w0#T.j<#O#'2#CYN1#qa^:#_4m3#o@/=#eG8=#t8J5#`+78#4uI-#"
- "m3B2#SB[8#Q0@8#i[*9#iOn8#1Nm;#^sN9#qh<9#:=x-#P;K2#$%X9#bC+.#Rg;<#mN=.#MTF.#RZO.#2?)4#Y#(/#[)1/#b;L/#dAU/#0Sv;#lY$0#n`-0#sf60#(F24#wrH0#%/e0#"
- "TmD<#%JSMFove:CTBEXI:<eh2g)B,3h2^G3i;#d3jD>)4kMYD4lVu`4m`:&5niUA5@(A5BA1]PBB:xlBCC=2CDLXMCEUtiCf&0g2'tN?PGT4CPGT4CPGT4CPGT4CPGT4CPGT4CPGT4CP"
- "GT4CPGT4CPGT4CPGT4CPGT4CPGT4CP-qekC`.9kEg^+F$kwViFJTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5o,^<-28ZI'O?;xp"
- "O?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xp;7q-#lLYI:xvD=#";
-
-static const char* GetDefaultCompressedFontDataTTFBase85()
-{
- return proggy_clean_ttf_compressed_data_base85;
+// Exported using binary_to_compressed_c.exe -u8 "ProggyClean.ttf" proggy_clean_ttf
+static const unsigned int proggy_clean_ttf_compressed_size = 9583;
+static const unsigned char proggy_clean_ttf_compressed_data[9583] =
+{
+ 87,188,0,0,0,0,0,0,0,0,160,248,0,4,0,0,55,0,1,0,0,0,12,0,128,0,3,0,64,79,83,47,50,136,235,116,144,0,0,1,72,130,21,44,78,99,109,97,112,2,18,35,117,0,0,3,160,130,19,36,82,99,118,116,
+ 32,130,23,130,2,33,4,252,130,4,56,2,103,108,121,102,18,175,137,86,0,0,7,4,0,0,146,128,104,101,97,100,215,145,102,211,130,27,32,204,130,3,33,54,104,130,16,39,8,66,1,195,0,0,1,4,130,
+ 15,59,36,104,109,116,120,138,0,126,128,0,0,1,152,0,0,2,6,108,111,99,97,140,115,176,216,0,0,5,130,30,41,2,4,109,97,120,112,1,174,0,218,130,31,32,40,130,16,44,32,110,97,109,101,37,89,
+ 187,150,0,0,153,132,130,19,44,158,112,111,115,116,166,172,131,239,0,0,155,36,130,51,44,210,112,114,101,112,105,2,1,18,0,0,4,244,130,47,32,8,132,203,46,1,0,0,60,85,233,213,95,15,60,
+ 245,0,3,8,0,131,0,34,183,103,119,130,63,43,0,0,189,146,166,215,0,0,254,128,3,128,131,111,130,241,33,2,0,133,0,32,1,130,65,38,192,254,64,0,0,3,128,131,16,130,5,32,1,131,7,138,3,33,2,
+ 0,130,17,36,1,1,0,144,0,130,121,130,23,38,2,0,8,0,64,0,10,130,9,32,118,130,9,130,6,32,0,130,59,33,1,144,131,200,35,2,188,2,138,130,16,32,143,133,7,37,1,197,0,50,2,0,131,0,33,4,9,131,
+ 5,145,3,43,65,108,116,115,0,64,0,0,32,172,8,0,131,0,35,5,0,1,128,131,77,131,3,33,3,128,191,1,33,1,128,130,184,35,0,0,128,0,130,3,131,11,32,1,130,7,33,0,128,131,1,32,1,136,9,32,0,132,
+ 15,135,5,32,1,131,13,135,27,144,35,32,1,149,25,131,21,32,0,130,0,32,128,132,103,130,35,132,39,32,0,136,45,136,97,133,17,130,5,33,0,0,136,19,34,0,128,1,133,13,133,5,32,128,130,15,132,
+ 131,32,3,130,5,32,3,132,27,144,71,32,0,133,27,130,29,130,31,136,29,131,63,131,3,65,63,5,132,5,132,205,130,9,33,0,0,131,9,137,119,32,3,132,19,138,243,130,55,32,1,132,35,135,19,131,201,
+ 136,11,132,143,137,13,130,41,32,0,131,3,144,35,33,128,0,135,1,131,223,131,3,141,17,134,13,136,63,134,15,136,53,143,15,130,96,33,0,3,131,4,130,3,34,28,0,1,130,5,34,0,0,76,130,17,131,
+ 9,36,28,0,4,0,48,130,17,46,8,0,8,0,2,0,0,0,127,0,255,32,172,255,255,130,9,34,0,0,129,132,9,130,102,33,223,213,134,53,132,22,33,1,6,132,6,64,4,215,32,129,165,216,39,177,0,1,141,184,
+ 1,255,133,134,45,33,198,0,193,1,8,190,244,1,28,1,158,2,20,2,136,2,252,3,20,3,88,3,156,3,222,4,20,4,50,4,80,4,98,4,162,5,22,5,102,5,188,6,18,6,116,6,214,7,56,7,126,7,236,8,78,8,108,
+ 8,150,8,208,9,16,9,74,9,136,10,22,10,128,11,4,11,86,11,200,12,46,12,130,12,234,13,94,13,164,13,234,14,80,14,150,15,40,15,176,16,18,16,116,16,224,17,82,17,182,18,4,18,110,18,196,19,
+ 76,19,172,19,246,20,88,20,174,20,234,21,64,21,128,21,166,21,184,22,18,22,126,22,198,23,52,23,142,23,224,24,86,24,186,24,238,25,54,25,150,25,212,26,72,26,156,26,240,27,92,27,200,28,
+ 4,28,76,28,150,28,234,29,42,29,146,29,210,30,64,30,142,30,224,31,36,31,118,31,166,31,166,32,16,130,1,52,46,32,138,32,178,32,200,33,20,33,116,33,152,33,238,34,98,34,134,35,12,130,1,
+ 33,128,35,131,1,60,152,35,176,35,216,36,0,36,74,36,104,36,144,36,174,37,6,37,96,37,130,37,248,37,248,38,88,38,170,130,1,8,190,216,39,64,39,154,40,10,40,104,40,168,41,14,41,32,41,184,
+ 41,248,42,54,42,96,42,96,43,2,43,42,43,94,43,172,43,230,44,32,44,52,44,154,45,40,45,92,45,120,45,170,45,232,46,38,46,166,47,38,47,182,47,244,48,94,48,200,49,62,49,180,50,30,50,158,
+ 51,30,51,130,51,238,52,92,52,206,53,58,53,134,53,212,54,38,54,114,54,230,55,118,55,216,56,58,56,166,57,18,57,116,57,174,58,46,58,154,59,6,59,124,59,232,60,58,60,150,61,34,61,134,61,
+ 236,62,86,62,198,63,42,63,154,64,18,64,106,64,208,65,54,65,162,66,8,66,64,66,122,66,184,66,240,67,98,67,204,68,42,68,138,68,238,69,88,69,182,69,226,70,84,70,180,71,20,71,122,71,218,
+ 72,84,72,198,73,64,0,36,70,21,8,8,77,3,0,7,0,11,0,15,0,19,0,23,0,27,0,31,0,35,0,39,0,43,0,47,0,51,0,55,0,59,0,63,0,67,0,71,0,75,0,79,0,83,0,87,0,91,0,95,0,99,0,103,0,107,0,111,0,115,
+ 0,119,0,123,0,127,0,131,0,135,0,139,0,143,0,0,17,53,51,21,49,150,3,32,5,130,23,32,33,130,3,211,7,151,115,32,128,133,0,37,252,128,128,2,128,128,190,5,133,74,32,4,133,6,206,5,42,0,7,
+ 1,128,0,0,2,0,4,0,0,65,139,13,37,0,1,53,51,21,7,146,3,32,3,130,19,32,1,141,133,32,3,141,14,131,13,38,255,0,128,128,0,6,1,130,84,35,2,128,4,128,140,91,132,89,32,51,65,143,6,139,7,33,
+ 1,0,130,57,32,254,130,3,32,128,132,4,32,4,131,14,138,89,35,0,0,24,0,130,0,33,3,128,144,171,66,55,33,148,115,65,187,19,32,5,130,151,143,155,163,39,32,1,136,182,32,253,134,178,132,7,
+ 132,200,145,17,32,3,65,48,17,165,17,39,0,0,21,0,128,255,128,3,65,175,17,65,3,27,132,253,131,217,139,201,155,233,155,27,131,67,131,31,130,241,33,255,0,131,181,137,232,132,15,132,4,138,
+ 247,34,255,0,128,179,238,32,0,130,0,32,20,65,239,48,33,0,19,67,235,10,32,51,65,203,14,65,215,11,32,7,154,27,135,39,32,33,130,35,33,128,128,130,231,32,253,132,231,32,128,132,232,34,
+ 128,128,254,133,13,136,8,32,253,65,186,5,130,36,130,42,176,234,133,231,34,128,0,0,66,215,44,33,0,1,68,235,6,68,211,19,32,49,68,239,14,139,207,139,47,66,13,7,32,51,130,47,33,1,0,130,
+ 207,35,128,128,1,0,131,222,131,5,130,212,130,6,131,212,32,0,130,10,133,220,130,233,130,226,32,254,133,255,178,233,39,3,1,128,3,0,2,0,4,68,15,7,68,99,12,130,89,130,104,33,128,4,133,
+ 93,130,10,38,0,0,11,1,0,255,0,68,63,16,70,39,9,66,215,8,32,7,68,77,6,68,175,14,32,29,68,195,6,132,7,35,2,0,128,255,131,91,132,4,65,178,5,141,111,67,129,23,165,135,140,107,142,135,33,
+ 21,5,69,71,6,131,7,33,1,0,140,104,132,142,130,4,137,247,140,30,68,255,12,39,11,0,128,0,128,3,0,3,69,171,15,67,251,7,65,15,8,66,249,11,65,229,7,67,211,7,66,13,7,35,1,128,128,254,133,
+ 93,32,254,131,145,132,4,132,18,32,2,151,128,130,23,34,0,0,9,154,131,65,207,8,68,107,15,68,51,7,32,7,70,59,7,135,121,130,82,32,128,151,111,41,0,0,4,0,128,255,0,1,128,1,137,239,33,0,
+ 37,70,145,10,65,77,10,65,212,14,37,0,0,0,5,0,128,66,109,5,70,123,10,33,0,19,72,33,18,133,237,70,209,11,33,0,2,130,113,137,119,136,115,33,1,0,133,43,130,5,34,0,0,10,69,135,6,70,219,
+ 13,66,155,7,65,9,12,66,157,11,66,9,11,32,7,130,141,132,252,66,151,9,137,9,66,15,30,36,0,20,0,128,0,130,218,71,11,42,68,51,8,65,141,7,73,19,15,69,47,23,143,39,66,81,7,32,1,66,55,6,34,
+ 1,128,128,68,25,5,69,32,6,137,6,136,25,32,254,131,42,32,3,66,88,26,148,26,32,0,130,0,32,14,164,231,70,225,12,66,233,7,67,133,19,71,203,15,130,161,32,255,130,155,32,254,139,127,134,
+ 12,164,174,33,0,15,164,159,33,59,0,65,125,20,66,25,7,32,5,68,191,6,66,29,7,144,165,65,105,9,35,128,128,255,0,137,2,133,182,164,169,33,128,128,197,171,130,155,68,235,7,32,21,70,77,19,
+ 66,21,10,68,97,8,66,30,5,66,4,43,34,0,17,0,71,19,41,65,253,20,71,25,23,65,91,15,65,115,7,34,2,128,128,66,9,8,130,169,33,1,0,66,212,13,132,28,72,201,43,35,0,0,0,18,66,27,38,76,231,5,
+ 68,157,20,135,157,32,7,68,185,13,65,129,28,66,20,5,32,253,66,210,11,65,128,49,133,61,32,0,65,135,6,74,111,37,72,149,12,66,203,19,65,147,19,68,93,7,68,85,8,76,4,5,33,255,0,133,129,34,
+ 254,0,128,68,69,8,181,197,34,0,0,12,65,135,32,65,123,20,69,183,27,133,156,66,50,5,72,87,10,67,137,32,33,0,19,160,139,78,251,13,68,55,20,67,119,19,65,91,36,69,177,15,32,254,143,16,65,
+ 98,53,32,128,130,0,32,0,66,43,54,70,141,23,66,23,15,131,39,69,47,11,131,15,70,129,19,74,161,9,36,128,255,0,128,254,130,153,65,148,32,67,41,9,34,0,0,4,79,15,5,73,99,10,71,203,8,32,3,
+ 72,123,6,72,43,8,32,2,133,56,131,99,130,9,34,0,0,6,72,175,5,73,159,14,144,63,135,197,132,189,133,66,33,255,0,73,6,7,70,137,12,35,0,0,0,10,130,3,73,243,25,67,113,12,65,73,7,69,161,7,
+ 138,7,37,21,2,0,128,128,254,134,3,73,116,27,33,128,128,130,111,39,12,0,128,1,0,3,128,2,72,219,21,35,43,0,47,0,67,47,20,130,111,33,21,1,68,167,13,81,147,8,133,230,32,128,77,73,6,32,
+ 128,131,142,134,18,130,6,32,255,75,18,12,131,243,37,128,0,128,3,128,3,74,231,21,135,123,32,29,134,107,135,7,32,21,74,117,7,135,7,134,96,135,246,74,103,23,132,242,33,0,10,67,151,28,
+ 67,133,20,66,141,11,131,11,32,3,77,71,6,32,128,130,113,32,1,81,4,6,134,218,66,130,24,131,31,34,0,26,0,130,0,77,255,44,83,15,11,148,155,68,13,7,32,49,78,231,18,79,7,11,73,243,11,32,
+ 33,65,187,10,130,63,65,87,8,73,239,19,35,0,128,1,0,131,226,32,252,65,100,6,32,128,139,8,33,1,0,130,21,32,253,72,155,44,73,255,20,32,128,71,67,8,81,243,39,67,15,20,74,191,23,68,121,
+ 27,32,1,66,150,6,32,254,79,19,11,131,214,32,128,130,215,37,2,0,128,253,0,128,136,5,65,220,24,147,212,130,210,33,0,24,72,219,42,84,255,13,67,119,16,69,245,19,72,225,19,65,3,15,69,93,
+ 19,131,55,132,178,71,115,14,81,228,6,142,245,33,253,0,132,43,172,252,65,16,11,75,219,8,65,219,31,66,223,24,75,223,10,33,29,1,80,243,10,66,175,8,131,110,134,203,133,172,130,16,70,30,
+ 7,164,183,130,163,32,20,65,171,48,65,163,36,65,143,23,65,151,19,65,147,13,65,134,17,133,17,130,216,67,114,5,164,217,65,137,12,72,147,48,79,71,19,74,169,22,80,251,8,65,173,7,66,157,
+ 15,74,173,15,32,254,65,170,8,71,186,45,72,131,6,77,143,40,187,195,152,179,65,123,38,68,215,57,68,179,15,65,85,7,69,187,14,32,21,66,95,15,67,19,25,32,1,83,223,6,32,2,76,240,7,77,166,
+ 43,65,8,5,130,206,32,0,67,39,54,143,167,66,255,19,82,193,11,151,47,85,171,5,67,27,17,132,160,69,172,11,69,184,56,66,95,6,33,12,1,130,237,32,2,68,179,27,68,175,16,80,135,15,72,55,7,
+ 71,87,12,73,3,12,132,12,66,75,32,76,215,5,169,139,147,135,148,139,81,12,12,81,185,36,75,251,7,65,23,27,76,215,9,87,165,12,65,209,15,72,157,7,65,245,31,32,128,71,128,6,32,1,82,125,5,
+ 34,0,128,254,131,169,32,254,131,187,71,180,9,132,27,32,2,88,129,44,32,0,78,47,40,65,79,23,79,171,14,32,21,71,87,8,72,15,14,65,224,33,130,139,74,27,62,93,23,7,68,31,7,75,27,7,139,15,
+ 74,3,7,74,23,27,65,165,11,65,177,15,67,123,5,32,1,130,221,32,252,71,96,5,74,12,12,133,244,130,25,34,1,0,128,130,2,139,8,93,26,8,65,9,32,65,57,14,140,14,32,0,73,79,67,68,119,11,135,
+ 11,32,51,90,75,14,139,247,65,43,7,131,19,139,11,69,159,11,65,247,6,36,1,128,128,253,0,90,71,9,33,1,0,132,14,32,128,89,93,14,69,133,6,130,44,131,30,131,6,65,20,56,33,0,16,72,179,40,
+ 75,47,12,65,215,19,74,95,19,65,43,11,131,168,67,110,5,75,23,17,69,106,6,75,65,5,71,204,43,32,0,80,75,47,71,203,15,159,181,68,91,11,67,197,7,73,101,13,68,85,6,33,128,128,130,214,130,
+ 25,32,254,74,236,48,130,194,37,0,18,0,128,255,128,77,215,40,65,139,64,32,51,80,159,10,65,147,39,130,219,84,212,43,130,46,75,19,97,74,33,11,65,201,23,65,173,31,33,1,0,79,133,6,66,150,
+ 5,67,75,48,85,187,6,70,207,37,32,71,87,221,13,73,163,14,80,167,15,132,15,83,193,19,82,209,8,78,99,9,72,190,11,77,110,49,89,63,5,80,91,35,99,63,32,70,235,23,81,99,10,69,148,10,65,110,
+ 36,32,0,65,99,47,95,219,11,68,171,51,66,87,7,72,57,7,74,45,17,143,17,65,114,50,33,14,0,65,111,40,159,195,98,135,15,35,7,53,51,21,100,78,9,95,146,16,32,254,82,114,6,32,128,67,208,37,
+ 130,166,99,79,58,32,17,96,99,14,72,31,19,72,87,31,82,155,7,67,47,14,32,21,131,75,134,231,72,51,17,72,78,8,133,8,80,133,6,33,253,128,88,37,9,66,124,36,72,65,12,134,12,71,55,43,66,139,
+ 27,85,135,10,91,33,12,65,35,11,66,131,11,71,32,8,90,127,6,130,244,71,76,11,168,207,33,0,12,66,123,32,32,0,65,183,15,68,135,11,66,111,7,67,235,11,66,111,15,32,254,97,66,12,160,154,67,
+ 227,52,80,33,15,87,249,15,93,45,31,75,111,12,93,45,11,77,99,9,160,184,81,31,12,32,15,98,135,30,104,175,7,77,249,36,69,73,15,78,5,12,32,254,66,151,19,34,128,128,4,87,32,12,149,35,133,
+ 21,96,151,31,32,19,72,35,5,98,173,15,143,15,32,21,143,99,158,129,33,0,0,65,35,52,65,11,15,147,15,98,75,11,33,1,0,143,151,132,15,32,254,99,200,37,132,43,130,4,39,0,10,0,128,1,128,3,
+ 0,104,151,14,97,187,20,69,131,15,67,195,11,87,227,7,33,128,128,132,128,33,254,0,68,131,9,65,46,26,42,0,0,0,7,0,0,255,128,3,128,0,88,223,15,33,0,21,89,61,22,66,209,12,65,2,12,37,0,2,
+ 1,0,3,128,101,83,8,36,0,1,53,51,29,130,3,34,21,1,0,66,53,8,32,0,68,215,6,100,55,25,107,111,9,66,193,11,72,167,8,73,143,31,139,31,33,1,0,131,158,32,254,132,5,33,253,128,65,16,9,133,
+ 17,89,130,25,141,212,33,0,0,93,39,8,90,131,25,93,39,14,66,217,6,106,179,8,159,181,71,125,15,139,47,138,141,87,11,14,76,23,14,65,231,26,140,209,66,122,8,81,179,5,101,195,26,32,47,74,
+ 75,13,69,159,11,83,235,11,67,21,16,136,167,131,106,130,165,130,15,32,128,101,90,24,134,142,32,0,65,103,51,108,23,11,101,231,15,75,173,23,74,237,23,66,15,6,66,46,17,66,58,17,65,105,
+ 49,66,247,55,71,179,12,70,139,15,86,229,7,84,167,15,32,1,95,72,12,89,49,6,33,128,128,65,136,38,66,30,9,32,0,100,239,7,66,247,29,70,105,20,65,141,19,69,81,15,130,144,32,128,83,41,5,
+ 32,255,131,177,68,185,5,133,126,65,97,37,32,0,130,0,33,21,0,130,55,66,195,28,67,155,13,34,79,0,83,66,213,13,73,241,19,66,59,19,65,125,11,135,201,66,249,16,32,128,66,44,11,66,56,17,
+ 68,143,8,68,124,38,67,183,12,96,211,9,65,143,29,112,171,5,32,0,68,131,63,34,33,53,51,71,121,11,32,254,98,251,16,32,253,74,231,10,65,175,37,133,206,37,0,0,8,1,0,0,107,123,11,113,115,
+ 9,33,0,1,130,117,131,3,73,103,7,66,51,18,66,44,5,133,75,70,88,5,32,254,65,39,12,68,80,9,34,12,0,128,107,179,28,68,223,6,155,111,86,147,15,32,2,131,82,141,110,33,254,0,130,15,32,4,103,
+ 184,15,141,35,87,176,5,83,11,5,71,235,23,114,107,11,65,189,16,70,33,15,86,153,31,135,126,86,145,30,65,183,41,32,0,130,0,32,10,65,183,24,34,35,0,39,67,85,9,65,179,15,143,15,33,1,0,65,
+ 28,17,157,136,130,123,32,20,130,3,32,0,97,135,24,115,167,19,80,71,12,32,51,110,163,14,78,35,19,131,19,155,23,77,229,8,78,9,17,151,17,67,231,46,94,135,8,73,31,31,93,215,56,82,171,25,
+ 72,77,8,162,179,169,167,99,131,11,69,85,19,66,215,15,76,129,13,68,115,22,72,79,35,67,113,5,34,0,0,19,70,31,46,65,89,52,73,223,15,85,199,33,95,33,8,132,203,73,29,32,67,48,16,177,215,
+ 101,13,15,65,141,43,69,141,15,75,89,5,70,0,11,70,235,21,178,215,36,10,0,128,0,0,71,207,24,33,0,19,100,67,6,80,215,11,66,67,7,80,43,12,71,106,7,80,192,5,65,63,5,66,217,26,33,0,13,156,
+ 119,68,95,5,72,233,12,134,129,85,81,11,76,165,20,65,43,8,73,136,8,75,10,31,38,128,128,0,0,0,13,1,130,4,32,3,106,235,29,114,179,12,66,131,23,32,7,77,133,6,67,89,12,131,139,116,60,9,
+ 89,15,37,32,0,74,15,7,103,11,22,65,35,5,33,55,0,93,81,28,67,239,23,78,85,5,107,93,14,66,84,17,65,193,26,74,183,10,66,67,34,143,135,79,91,15,32,7,117,111,8,75,56,9,84,212,9,154,134,
+ 32,0,130,0,32,18,130,3,70,171,41,83,7,16,70,131,19,84,191,15,84,175,19,84,167,30,84,158,12,154,193,68,107,15,33,0,0,65,79,42,65,71,7,73,55,7,118,191,16,83,180,9,32,255,76,166,9,154,
+ 141,32,0,130,0,69,195,52,65,225,15,151,15,75,215,31,80,56,10,68,240,17,100,32,9,70,147,39,65,93,12,71,71,41,92,85,15,84,135,23,78,35,15,110,27,10,84,125,8,107,115,29,136,160,38,0,0,
+ 14,0,128,255,0,82,155,24,67,239,8,119,255,11,69,131,11,77,29,6,112,31,8,134,27,105,203,8,32,2,75,51,11,75,195,12,74,13,29,136,161,37,128,0,0,0,11,1,130,163,82,115,8,125,191,17,69,35,
+ 12,74,137,15,143,15,32,1,65,157,12,136,12,161,142,65,43,40,65,199,6,65,19,24,102,185,11,76,123,11,99,6,12,135,12,32,254,130,8,161,155,101,23,9,39,8,0,0,1,128,3,128,2,78,63,17,72,245,
+ 12,67,41,11,90,167,9,32,128,97,49,9,32,128,109,51,14,132,97,81,191,8,130,97,125,99,12,121,35,9,127,75,15,71,79,12,81,151,23,87,97,7,70,223,15,80,245,16,105,97,15,32,254,113,17,6,32,
+ 128,130,8,105,105,8,76,122,18,65,243,21,74,63,7,38,4,1,0,255,0,2,0,119,247,28,133,65,32,255,141,91,35,0,0,0,16,67,63,36,34,59,0,63,77,59,9,119,147,11,143,241,66,173,15,66,31,11,67,
+ 75,8,81,74,16,32,128,131,255,87,181,42,127,43,5,34,255,128,2,120,235,11,37,19,0,23,0,0,37,109,191,14,118,219,7,127,43,14,65,79,14,35,0,0,0,3,73,91,5,130,5,38,3,0,7,0,11,0,0,70,205,
+ 11,88,221,12,32,0,73,135,7,87,15,22,73,135,10,79,153,15,97,71,19,65,49,11,32,1,131,104,121,235,11,80,65,11,142,179,144,14,81,123,46,32,1,88,217,5,112,5,8,65,201,15,83,29,15,122,147,
+ 11,135,179,142,175,143,185,67,247,39,66,199,7,35,5,0,128,3,69,203,15,123,163,12,67,127,7,130,119,71,153,10,141,102,70,175,8,32,128,121,235,30,136,89,100,191,11,116,195,11,111,235,15,
+ 72,39,7,32,2,97,43,5,132,5,94,67,8,131,8,125,253,10,32,3,65,158,16,146,16,130,170,40,0,21,0,128,0,0,3,128,5,88,219,15,24,64,159,32,135,141,65,167,15,68,163,10,97,73,49,32,255,82,58,
+ 7,93,80,8,97,81,16,24,67,87,52,34,0,0,5,130,231,33,128,2,80,51,13,65,129,8,113,61,6,132,175,65,219,5,130,136,77,152,17,32,0,95,131,61,70,215,6,33,21,51,90,53,10,78,97,23,105,77,31,
+ 65,117,7,139,75,24,68,195,9,24,64,22,9,33,0,128,130,11,33,128,128,66,25,5,121,38,5,134,5,134,45,66,40,36,66,59,18,34,128,0,0,66,59,81,135,245,123,103,19,120,159,19,77,175,12,33,255,
+ 0,87,29,10,94,70,21,66,59,54,39,3,1,128,3,0,2,128,4,24,65,7,15,66,47,7,72,98,12,37,0,0,0,3,1,0,24,65,55,21,131,195,32,1,67,178,6,33,4,0,77,141,8,32,6,131,47,74,67,16,24,69,3,20,24,
+ 65,251,7,133,234,130,229,94,108,17,35,0,0,6,0,141,175,86,59,5,162,79,85,166,8,70,112,13,32,13,24,64,67,26,24,71,255,7,123,211,12,80,121,11,69,215,15,66,217,11,69,71,10,131,113,132,
+ 126,119,90,9,66,117,19,132,19,32,0,130,0,24,64,47,59,33,7,0,73,227,5,68,243,15,85,13,12,76,37,22,74,254,15,130,138,33,0,4,65,111,6,137,79,65,107,16,32,1,77,200,6,34,128,128,3,75,154,
+ 12,37,0,16,0,0,2,0,104,115,36,140,157,68,67,19,68,51,15,106,243,15,134,120,70,37,10,68,27,10,140,152,65,121,24,32,128,94,155,7,67,11,8,24,74,11,25,65,3,12,83,89,18,82,21,37,67,200,
+ 5,130,144,24,64,172,12,33,4,0,134,162,74,80,14,145,184,32,0,130,0,69,251,20,32,19,81,243,5,82,143,8,33,5,53,89,203,5,133,112,79,109,15,33,0,21,130,71,80,175,41,36,75,0,79,0,83,121,
+ 117,9,87,89,27,66,103,11,70,13,15,75,191,11,135,67,87,97,20,109,203,5,69,246,8,108,171,5,78,195,38,65,51,13,107,203,11,77,3,17,24,75,239,17,65,229,28,79,129,39,130,175,32,128,123,253,
+ 7,132,142,24,65,51,15,65,239,41,36,128,128,0,0,13,65,171,5,66,163,28,136,183,118,137,11,80,255,15,67,65,7,74,111,8,32,0,130,157,32,253,24,76,35,10,103,212,5,81,175,9,69,141,7,66,150,
+ 29,131,158,24,75,199,28,124,185,7,76,205,15,68,124,14,32,3,123,139,16,130,16,33,128,128,108,199,6,33,0,3,65,191,35,107,11,6,73,197,11,24,70,121,15,83,247,15,24,70,173,23,69,205,14,
+ 32,253,131,140,32,254,136,4,94,198,9,32,3,78,4,13,66,127,13,143,13,32,0,130,0,33,16,0,24,69,59,39,109,147,12,76,253,19,24,69,207,15,69,229,15,130,195,71,90,10,139,10,130,152,73,43,
+ 40,91,139,10,65,131,37,35,75,0,79,0,84,227,12,143,151,68,25,15,80,9,23,95,169,11,34,128,2,128,112,186,5,130,6,83,161,19,76,50,6,130,37,65,145,44,110,83,5,32,16,67,99,6,71,67,15,76,
+ 55,17,140,215,67,97,23,76,69,15,77,237,11,104,211,23,77,238,11,65,154,43,33,0,10,83,15,28,83,13,20,67,145,19,67,141,14,97,149,21,68,9,15,86,251,5,66,207,5,66,27,37,82,1,23,127,71,12,
+ 94,235,10,110,175,24,98,243,15,132,154,132,4,24,66,69,10,32,4,67,156,43,130,198,35,2,1,0,4,75,27,9,69,85,9,95,240,7,32,128,130,35,32,28,66,43,40,24,82,63,23,83,123,12,72,231,15,127,
+ 59,23,116,23,19,117,71,7,24,77,99,15,67,111,15,71,101,8,36,2,128,128,252,128,127,60,11,32,1,132,16,130,18,141,24,67,107,9,32,3,68,194,15,175,15,38,0,11,0,128,1,128,2,80,63,25,32,0,
+ 24,65,73,11,69,185,15,83,243,16,32,0,24,81,165,8,130,86,77,35,6,155,163,88,203,5,24,66,195,30,70,19,19,24,80,133,15,32,1,75,211,8,32,254,108,133,8,79,87,20,65,32,9,41,0,0,7,0,128,0,
+ 0,2,128,2,68,87,15,66,1,16,92,201,16,24,76,24,17,133,17,34,128,0,30,66,127,64,34,115,0,119,73,205,9,66,43,11,109,143,15,24,79,203,11,90,143,15,131,15,155,31,65,185,15,86,87,11,35,128,
+ 128,253,0,69,7,6,130,213,33,1,0,119,178,15,142,17,66,141,74,83,28,6,36,7,0,0,4,128,82,39,18,76,149,12,67,69,21,32,128,79,118,15,32,0,130,0,32,8,131,206,32,2,79,83,9,100,223,14,102,
+ 113,23,115,115,7,24,65,231,12,130,162,32,4,68,182,19,130,102,93,143,8,69,107,29,24,77,255,12,143,197,72,51,7,76,195,15,132,139,85,49,15,130,152,131,18,71,81,23,70,14,11,36,0,10,0,128,
+ 2,69,59,9,89,151,15,66,241,11,76,165,12,71,43,15,75,49,13,65,12,23,132,37,32,0,179,115,130,231,95,181,16,132,77,32,254,67,224,8,65,126,20,79,171,8,32,2,89,81,5,75,143,6,80,41,8,34,
+ 2,0,128,24,81,72,9,32,0,130,0,35,17,0,0,255,77,99,39,95,65,36,67,109,15,24,69,93,11,77,239,5,95,77,23,35,128,1,0,128,24,86,7,8,132,167,32,2,69,198,41,130,202,33,0,26,120,75,44,24,89,
+ 51,15,71,243,12,70,239,11,24,84,3,11,66,7,11,71,255,10,32,21,69,155,35,88,151,12,32,128,74,38,10,65,210,8,74,251,5,65,226,5,75,201,13,32,3,65,9,41,146,41,40,0,0,0,9,1,0,1,0,2,91,99,
+ 19,32,35,106,119,13,70,219,15,83,239,12,137,154,32,2,67,252,19,36,128,0,0,4,1,130,196,32,2,130,8,91,107,8,32,0,135,81,24,73,211,8,132,161,73,164,13,36,0,8,0,128,2,105,123,26,139,67,
+ 76,99,15,34,1,0,128,135,76,83,156,20,92,104,8,67,251,30,24,86,47,27,123,207,12,24,86,7,15,71,227,8,32,4,65,20,20,131,127,32,0,130,123,32,0,71,223,26,32,19,90,195,22,71,223,15,84,200,
+ 6,32,128,133,241,24,84,149,9,67,41,25,36,0,0,0,22,0,88,111,49,32,87,66,21,5,77,3,27,123,75,7,71,143,19,135,183,71,183,19,130,171,74,252,5,131,5,89,87,17,32,1,132,18,130,232,68,11,10,
+ 33,1,128,70,208,16,66,230,18,147,18,130,254,223,255,75,27,23,65,59,15,135,39,155,255,34,128,128,254,104,92,8,33,0,128,65,32,11,65,1,58,33,26,0,130,0,72,71,18,78,55,17,76,11,19,86,101,
+ 12,75,223,11,89,15,11,24,76,87,15,75,235,15,131,15,72,95,7,85,71,11,72,115,11,73,64,6,34,1,128,128,66,215,9,34,128,254,128,134,14,33,128,255,67,102,5,32,0,130,16,70,38,11,66,26,57,
+ 88,11,8,24,76,215,34,78,139,7,95,245,7,32,7,24,73,75,23,32,128,131,167,130,170,101,158,9,82,49,22,118,139,6,32,18,67,155,44,116,187,9,108,55,14,80,155,23,66,131,15,93,77,10,131,168,
+ 32,128,73,211,12,24,75,187,22,32,4,96,71,20,67,108,19,132,19,120,207,8,32,5,76,79,15,66,111,21,66,95,8,32,3,190,211,111,3,8,211,212,32,20,65,167,44,34,75,0,79,97,59,13,32,33,112,63,
+ 10,65,147,19,69,39,19,143,39,24,66,71,9,130,224,65,185,43,94,176,12,65,183,24,71,38,8,24,72,167,7,65,191,38,136,235,24,96,167,12,65,203,62,115,131,13,65,208,42,175,235,67,127,6,32,
+ 4,76,171,29,114,187,5,32,71,65,211,5,65,203,68,72,51,8,164,219,32,0,172,214,71,239,58,78,3,27,66,143,15,77,19,15,147,31,35,33,53,51,21,66,183,10,173,245,66,170,30,150,30,34,0,0,23,
+ 80,123,54,76,1,16,73,125,15,82,245,11,167,253,24,76,85,12,70,184,5,32,254,131,185,37,254,0,128,1,0,128,133,16,117,158,18,92,27,38,65,3,17,130,251,35,17,0,128,254,24,69,83,39,140,243,
+ 121,73,19,109,167,7,81,41,15,24,95,175,12,102,227,15,121,96,11,24,95,189,7,32,3,145,171,154,17,24,77,47,9,33,0,5,70,71,37,68,135,7,32,29,117,171,11,69,87,15,24,79,97,19,24,79,149,23,
+ 131,59,32,1,75,235,5,72,115,11,72,143,7,132,188,71,27,46,131,51,32,0,69,95,6,175,215,32,21,131,167,81,15,19,151,191,151,23,131,215,71,43,5,32,254,24,79,164,24,74,109,8,77,166,13,65,
+ 176,26,88,162,5,98,159,6,171,219,120,247,6,79,29,8,99,169,10,103,59,19,65,209,35,131,35,91,25,19,112,94,15,83,36,8,173,229,33,20,0,88,75,43,71,31,12,65,191,71,33,1,0,130,203,32,254,
+ 131,4,68,66,7,67,130,6,104,61,13,173,215,38,13,1,0,0,0,2,128,67,111,28,74,129,16,104,35,19,79,161,16,87,14,7,138,143,132,10,67,62,36,114,115,5,162,151,67,33,16,108,181,15,143,151,67,
+ 5,5,24,100,242,15,170,153,34,0,0,14,65,51,34,32,55,79,75,9,32,51,74,7,10,65,57,38,132,142,32,254,72,0,14,139,163,32,128,80,254,8,67,158,21,65,63,7,32,4,72,227,27,95,155,12,67,119,19,
+ 124,91,24,149,154,72,177,34,97,223,8,155,151,24,108,227,15,88,147,16,72,117,19,68,35,11,92,253,15,70,199,15,24,87,209,17,32,2,87,233,7,32,1,24,88,195,10,119,24,8,32,3,81,227,24,65,
+ 125,21,35,128,128,0,25,76,59,48,24,90,187,9,97,235,12,66,61,11,91,105,19,24,79,141,11,24,79,117,15,24,79,129,27,90,53,13,130,13,32,253,131,228,24,79,133,40,69,70,8,66,137,31,65,33,
+ 19,96,107,8,68,119,29,66,7,5,68,125,16,65,253,19,65,241,27,24,90,179,13,24,79,143,18,33,128,128,130,246,32,254,130,168,68,154,36,77,51,9,97,47,5,167,195,32,21,131,183,78,239,27,155,
+ 195,78,231,14,201,196,77,11,6,32,5,73,111,37,97,247,12,77,19,31,155,207,78,215,19,162,212,69,17,14,66,91,19,80,143,57,78,203,39,159,215,32,128,93,134,8,24,80,109,24,66,113,15,169,215,
+ 66,115,6,32,4,69,63,33,32,0,101,113,7,86,227,35,143,211,36,49,53,51,21,1,77,185,14,65,159,28,69,251,34,67,56,8,33,9,0,24,107,175,25,90,111,12,110,251,11,119,189,24,119,187,34,87,15,
+ 9,32,4,66,231,37,90,39,7,66,239,8,84,219,15,69,105,23,24,85,27,27,87,31,11,33,1,128,76,94,6,32,1,85,241,7,33,128,128,106,48,10,33,128,128,69,136,11,133,13,24,79,116,49,84,236,8,24,
+ 91,87,9,32,5,165,255,69,115,12,66,27,15,159,15,24,72,247,12,74,178,5,24,80,64,15,33,0,128,143,17,77,89,51,130,214,24,81,43,7,170,215,74,49,8,159,199,143,31,139,215,69,143,5,32,254,
+ 24,81,50,35,181,217,84,123,70,143,195,159,15,65,187,16,66,123,7,65,175,15,65,193,29,68,207,39,79,27,5,70,131,6,32,4,68,211,33,33,67,0,83,143,14,159,207,143,31,140,223,33,0,128,24,80,
+ 82,14,24,93,16,23,32,253,65,195,5,68,227,40,133,214,107,31,7,32,5,67,115,27,87,9,8,107,31,43,66,125,6,32,0,103,177,23,131,127,72,203,36,32,0,110,103,8,155,163,73,135,6,32,19,24,112,
+ 99,10,65,71,11,73,143,19,143,31,126,195,5,24,85,21,9,24,76,47,14,32,254,24,93,77,36,68,207,11,39,25,0,0,255,128,3,128,4,66,51,37,95,247,13,82,255,24,76,39,19,147,221,66,85,27,24,118,
+ 7,8,24,74,249,12,76,74,8,91,234,8,67,80,17,131,222,33,253,0,121,30,44,73,0,16,69,15,6,32,0,65,23,38,69,231,12,65,179,6,98,131,16,86,31,27,24,108,157,14,80,160,8,24,65,46,17,33,4,0,
+ 96,2,18,144,191,65,226,8,68,19,5,171,199,80,9,15,180,199,67,89,5,32,255,24,79,173,28,174,201,24,79,179,50,32,1,24,122,5,10,82,61,10,180,209,83,19,8,32,128,24,80,129,27,111,248,43,131,
+ 71,24,115,103,8,67,127,41,78,213,24,100,247,19,66,115,39,75,107,5,32,254,165,219,78,170,40,24,112,163,49,32,1,97,203,6,65,173,64,32,0,83,54,7,133,217,88,37,12,32,254,131,28,33,128,
+ 3,67,71,44,84,183,6,32,5,69,223,33,96,7,7,123,137,16,192,211,24,112,14,9,32,255,67,88,29,68,14,10,84,197,38,33,0,22,116,47,50,32,87,106,99,9,116,49,15,89,225,15,97,231,23,70,41,19,
+ 82,85,8,93,167,6,32,253,132,236,108,190,7,89,251,5,116,49,58,33,128,128,131,234,32,15,24,74,67,38,70,227,24,24,83,45,23,89,219,12,70,187,12,89,216,19,32,2,69,185,24,141,24,70,143,66,
+ 24,82,119,56,78,24,10,32,253,133,149,132,6,24,106,233,7,69,198,48,178,203,81,243,12,68,211,15,106,255,23,66,91,15,69,193,7,100,39,10,24,83,72,16,176,204,33,19,0,88,207,45,68,21,12,
+ 68,17,10,65,157,53,68,17,6,32,254,92,67,10,65,161,25,69,182,43,24,118,91,47,69,183,18,181,209,111,253,12,89,159,8,66,112,12,69,184,45,35,0,0,0,9,24,80,227,26,73,185,16,118,195,15,131,
+ 15,33,1,0,65,59,15,66,39,27,160,111,66,205,12,148,111,143,110,33,128,128,156,112,24,81,199,8,75,199,23,66,117,20,155,121,32,254,68,126,12,72,213,29,134,239,149,123,89,27,16,148,117,
+ 65,245,8,24,71,159,14,141,134,134,28,73,51,55,109,77,15,105,131,11,68,67,11,76,169,27,107,209,12,102,174,8,32,128,72,100,18,116,163,56,79,203,11,75,183,44,85,119,19,71,119,23,151,227,
+ 32,1,93,27,8,65,122,5,77,102,8,110,120,20,66,23,8,66,175,17,66,63,12,133,12,79,35,8,74,235,33,67,149,16,69,243,15,78,57,15,69,235,16,67,177,7,151,192,130,23,67,84,29,141,192,174,187,
+ 77,67,15,69,11,12,159,187,77,59,10,199,189,24,70,235,50,96,83,19,66,53,23,105,65,19,77,47,12,163,199,66,67,37,78,207,50,67,23,23,174,205,67,228,6,71,107,13,67,22,14,66,85,11,83,187,
+ 38,124,47,49,95,7,19,66,83,23,67,23,19,24,96,78,17,80,101,16,71,98,40,33,0,7,88,131,22,24,89,245,12,84,45,12,102,213,5,123,12,9,32,2,126,21,14,43,255,0,128,128,0,0,20,0,128,255,128,
+ 3,126,19,39,32,75,106,51,7,113,129,15,24,110,135,19,126,47,15,115,117,11,69,47,11,32,2,109,76,9,102,109,9,32,128,75,2,10,130,21,32,254,69,47,6,32,3,94,217,47,32,0,65,247,10,69,15,46,
+ 65,235,31,65,243,15,101,139,10,66,174,14,65,247,16,72,102,28,69,17,14,84,243,9,165,191,88,47,48,66,53,12,32,128,71,108,6,203,193,32,17,75,187,42,73,65,16,65,133,52,114,123,9,167,199,
+ 69,21,37,86,127,44,75,171,11,180,197,78,213,12,148,200,81,97,46,24,95,243,9,32,4,66,75,33,113,103,9,87,243,36,143,225,24,84,27,31,90,145,8,148,216,67,49,5,24,84,34,14,75,155,27,67,
+ 52,13,140,13,36,0,20,0,128,255,24,135,99,46,88,59,43,155,249,80,165,7,136,144,71,161,23,32,253,132,33,32,254,88,87,44,136,84,35,128,0,0,21,81,103,5,94,47,44,76,51,12,143,197,151,15,
+ 65,215,31,24,64,77,13,65,220,20,65,214,14,71,4,40,65,213,13,32,0,130,0,35,21,1,2,0,135,0,34,36,0,72,134,10,36,1,0,26,0,130,134,11,36,2,0,14,0,108,134,11,32,3,138,23,32,4,138,11,34,
+ 5,0,20,134,33,34,0,0,6,132,23,32,1,134,15,32,18,130,25,133,11,37,1,0,13,0,49,0,133,11,36,2,0,7,0,38,134,11,36,3,0,17,0,45,134,11,32,4,138,35,36,5,0,10,0,62,134,23,32,6,132,23,36,3,
+ 0,1,4,9,130,87,131,167,133,11,133,167,133,11,133,167,133,11,37,3,0,34,0,122,0,133,11,133,167,133,11,133,167,133,11,133,167,34,50,0,48,130,1,34,52,0,47,134,5,8,49,49,0,53,98,121,32,
+ 84,114,105,115,116,97,110,32,71,114,105,109,109,101,114,82,101,103,117,108,97,114,84,84,88,32,80,114,111,103,103,121,67,108,101,97,110,84,84,50,48,48,52,47,130,2,53,49,53,0,98,0,121,
+ 0,32,0,84,0,114,0,105,0,115,0,116,0,97,0,110,130,15,32,71,132,15,36,109,0,109,0,101,130,9,32,82,130,5,36,103,0,117,0,108,130,29,32,114,130,43,34,84,0,88,130,35,32,80,130,25,34,111,
+ 0,103,130,1,34,121,0,67,130,27,32,101,132,59,32,84,130,31,33,0,0,65,155,9,34,20,0,0,65,11,6,130,8,135,2,33,1,1,130,9,8,120,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14,
+ 1,15,1,16,1,17,1,18,1,19,1,20,1,21,1,22,1,23,1,24,1,25,1,26,1,27,1,28,1,29,1,30,1,31,1,32,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15,0,16,0,17,0,18,0,19,0,20,0,21,0,
+ 22,0,23,0,24,0,25,0,26,0,27,0,28,0,29,0,30,0,31,130,187,8,66,33,0,34,0,35,0,36,0,37,0,38,0,39,0,40,0,41,0,42,0,43,0,44,0,45,0,46,0,47,0,48,0,49,0,50,0,51,0,52,0,53,0,54,0,55,0,56,0,
+ 57,0,58,0,59,0,60,0,61,0,62,0,63,0,64,0,65,0,66,130,243,9,75,68,0,69,0,70,0,71,0,72,0,73,0,74,0,75,0,76,0,77,0,78,0,79,0,80,0,81,0,82,0,83,0,84,0,85,0,86,0,87,0,88,0,89,0,90,0,91,0,
+ 92,0,93,0,94,0,95,0,96,0,97,1,33,1,34,1,35,1,36,1,37,1,38,1,39,1,40,1,41,1,42,1,43,1,44,1,45,1,46,1,47,1,48,1,49,1,50,1,51,1,52,1,53,1,54,1,55,1,56,1,57,1,58,1,59,1,60,1,61,1,62,1,
+ 63,1,64,1,65,0,172,0,163,0,132,0,133,0,189,0,150,0,232,0,134,0,142,0,139,0,157,0,169,0,164,0,239,0,138,0,218,0,131,0,147,0,242,0,243,0,141,0,151,0,136,0,195,0,222,0,241,0,158,0,170,
+ 0,245,0,244,0,246,0,162,0,173,0,201,0,199,0,174,0,98,0,99,0,144,0,100,0,203,0,101,0,200,0,202,0,207,0,204,0,205,0,206,0,233,0,102,0,211,0,208,0,209,0,175,0,103,0,240,0,145,0,214,0,
+ 212,0,213,0,104,0,235,0,237,0,137,0,106,0,105,0,107,0,109,0,108,0,110,0,160,0,111,0,113,0,112,0,114,0,115,0,117,0,116,0,118,0,119,0,234,0,120,0,122,0,121,0,123,0,125,0,124,0,184,0,
+ 161,0,127,0,126,0,128,0,129,0,236,0,238,0,186,14,117,110,105,99,111,100,101,35,48,120,48,48,48,49,141,14,32,50,141,14,32,51,141,14,32,52,141,14,32,53,141,14,32,54,141,14,32,55,141,
+ 14,32,56,141,14,32,57,141,14,32,97,141,14,32,98,141,14,32,99,141,14,32,100,141,14,32,101,141,14,32,102,140,14,33,49,48,141,14,141,239,32,49,141,239,32,49,141,239,32,49,141,239,32,49,
+ 141,239,32,49,141,239,32,49,141,239,32,49,141,239,32,49,141,239,32,49,141,239,32,49,141,239,32,49,141,239,32,49,141,239,32,49,141,239,45,49,102,6,100,101,108,101,116,101,4,69,117,114,
+ 111,140,236,32,56,141,236,32,56,141,236,32,56,141,236,32,56,141,236,32,56,141,236,32,56,141,236,32,56,141,236,32,56,141,236,32,56,141,236,32,56,141,236,32,56,141,236,32,56,141,236,
+ 32,56,141,236,32,56,141,236,32,56,65,220,13,32,57,65,220,13,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,
+ 239,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,239,35,57,102,0,0,5,250,72,249,98,247,
+};
+
+static const char* GetDefaultCompressedFontDataTTF(int* out_size)
+{
+ *out_size = proggy_clean_ttf_compressed_size;
+ return (const char*)proggy_clean_ttf_compressed_data;
}
+#endif // #ifndef IMGUI_DISABLE_DEFAULT_FONT
#endif // #ifndef IMGUI_DISABLE
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
index 015f6b65756..ddf9ea3e9af 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
@@ -1,10 +1,7 @@
-// dear imgui, v1.89.1 WIP
+// dear imgui, v1.91.9b
// (internal structures/api)
-// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
-// Set:
-// #define IMGUI_DEFINE_MATH_OPERATORS
-// To implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators)
+// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.
/*
@@ -17,16 +14,22 @@ Index of this file:
// [SECTION] Macros
// [SECTION] Generic helpers
// [SECTION] ImDrawList support
+// [SECTION] Style support
+// [SECTION] Data types support
// [SECTION] Widgets support: flags, enums, data structures
+// [SECTION] Popup support
// [SECTION] Inputs support
// [SECTION] Clipper support
// [SECTION] Navigation support
+// [SECTION] Typing-select support
// [SECTION] Columns support
+// [SECTION] Box-select support
// [SECTION] Multi-select support
// [SECTION] Docking support
// [SECTION] Viewport support
// [SECTION] Settings support
// [SECTION] Localization support
+// [SECTION] Error handling, State recovery support
// [SECTION] Metrics, Debug tools
// [SECTION] Generic context hooks
// [SECTION] ImGuiContext (main imgui context)
@@ -56,9 +59,17 @@ Index of this file:
#include <limits.h> // INT_MIN, INT_MAX
// Enable SSE intrinsics if available
-#if (defined __SSE__ || defined __x86_64__ || defined _M_X64) && !defined(IMGUI_DISABLE_SSE)
+#if (defined __SSE__ || defined __x86_64__ || defined _M_X64 || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))) && !defined(IMGUI_DISABLE_SSE)
#define IMGUI_ENABLE_SSE
#include <immintrin.h>
+#if (defined __AVX__ || defined __SSE4_2__)
+#define IMGUI_ENABLE_SSE4_2
+#include <nmmintrin.h>
+#endif
+#endif
+// Emscripten has partial SSE 4.2 support where _mm_crc32_u32 is not available. See https://emscripten.org/docs/porting/simd.html#id11 and #8213
+#if defined(IMGUI_ENABLE_SSE4_2) && !defined(IMGUI_USE_LEGACY_CRC32_ADLER) && !defined(__EMSCRIPTEN__)
+#define IMGUI_ENABLE_SSE4_2_CRC
#endif
// Visual Studio warnings
@@ -79,18 +90,27 @@ Index of this file:
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx'
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
-#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok, for ImFloorSigned()
-#pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h
-#pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h
-#pragma clang diagnostic ignored "-Wold-style-cast"
-#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
-#pragma clang diagnostic ignored "-Wdouble-promotion"
+#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok, for ImFloor()
+#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast
+#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant
+#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
#pragma clang diagnostic ignored "-Wmissing-noreturn" // warning: function 'xxx' could be declared with attribute 'noreturn'
+#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
+#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
#elif defined(__GNUC__)
#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
-#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
+#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
+#pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe
+#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
+#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
+#endif
+
+// In 1.89.4, we moved the implementation of "courtesy maths operators" from imgui_internal.h in imgui.h
+// As they are frequently requested, we do not want to encourage to many people using imgui_internal.h
+#if defined(IMGUI_DEFINE_MATH_OPERATORS) && !defined(IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED)
+#error Please '#define IMGUI_DEFINE_MATH_OPERATORS' _BEFORE_ including imgui.h!
#endif
// Legacy defines
@@ -111,20 +131,33 @@ Index of this file:
// [SECTION] Forward declarations
//-----------------------------------------------------------------------------
+// Utilities
+// (other types which are not forwarded declared are: ImBitArray<>, ImSpan<>, ImSpanAllocator<>, ImPool<>, ImChunkStream<>)
struct ImBitVector; // Store 1-bit per value
struct ImRect; // An axis-aligned rectangle (2 points)
+struct ImGuiTextIndex; // Maintain a line index for a text buffer.
+
+// ImDrawList/ImFontAtlas
struct ImDrawDataBuilder; // Helper to build a ImDrawData instance
struct ImDrawListSharedData; // Data shared between all ImDrawList instances
+
+// ImGui
+struct ImGuiBoxSelectState; // Box-selection state (currently used by multi-selection, could potentially be used by others)
struct ImGuiColorMod; // Stacked color modifier, backup of modified data so we can restore it
struct ImGuiContext; // Main Dear ImGui context
struct ImGuiContextHook; // Hook for extensions like ImGuiTestEngine
struct ImGuiDataTypeInfo; // Type information associated to a ImGuiDataType enum
+struct ImGuiDeactivatedItemData; // Data for IsItemDeactivated()/IsItemDeactivatedAfterEdit() function.
+struct ImGuiErrorRecoveryState; // Storage of stack sizes for error handling and recovery
struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup()
struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box
+struct ImGuiInputTextDeactivateData;// Short term storage to backup text of a deactivating InputText() while another is stealing active id
struct ImGuiLastItemData; // Status storage for last submitted items
struct ImGuiLocEntry; // A localization entry.
struct ImGuiMenuColumns; // Simple column measurement, currently used for MenuItem() only
-struct ImGuiNavItemData; // Result of a gamepad/keyboard directional navigation move query result
+struct ImGuiMultiSelectState; // Multi-selection persistent state (for focused selection).
+struct ImGuiMultiSelectTempData; // Multi-selection temporary state (while traversing).
+struct ImGuiNavItemData; // Result of a keyboard/gamepad directional navigation move query result
struct ImGuiMetricsConfig; // Storage for ShowMetricsWindow() and DebugNodeXXX() functions
struct ImGuiNextWindowData; // Storage for SetNextWindow** functions
struct ImGuiNextItemData; // Storage for SetNextItem** functions
@@ -132,16 +165,20 @@ struct ImGuiOldColumnData; // Storage data for a single column for lega
struct ImGuiOldColumns; // Storage data for a columns set for legacy Columns() api
struct ImGuiPopupData; // Storage for current popup stack
struct ImGuiSettingsHandler; // Storage for one type registered in the .ini file
-struct ImGuiStackSizes; // Storage of stack sizes for debugging/asserting
struct ImGuiStyleMod; // Stacked style modifier, backup of modified data so we can restore it
+struct ImGuiStyleVarInfo; // Style variable information (e.g. to access style variables from an enum)
struct ImGuiTabBar; // Storage for a tab bar
struct ImGuiTabItem; // Storage for a tab item (within a tab bar)
struct ImGuiTable; // Storage for a table
+struct ImGuiTableHeaderData; // Storage for TableAngledHeadersRow()
struct ImGuiTableColumn; // Storage for one column of a table
struct ImGuiTableInstanceData; // Storage for one instance of a same table
struct ImGuiTableTempData; // Temporary storage for one table (one per table in the stack), shared between tables.
struct ImGuiTableSettings; // Storage for a table .ini settings
struct ImGuiTableColumnsSettings; // Storage for a column .ini settings
+struct ImGuiTreeNodeStackData; // Temporary storage for TreeNode().
+struct ImGuiTypingSelectState; // Storage for GetTypingSelectRequest()
+struct ImGuiTypingSelectRequest; // Storage for GetTypingSelectRequest() (aimed to be public)
struct ImGuiWindow; // Storage for one window
struct ImGuiWindowTempData; // Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame, in practice we currently keep it for each window)
struct ImGuiWindowSettings; // Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session)
@@ -154,11 +191,11 @@ typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // E
// Flags
typedef int ImGuiActivateFlags; // -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later)
typedef int ImGuiDebugLogFlags; // -> enum ImGuiDebugLogFlags_ // Flags: for ShowDebugLogWindow(), g.DebugLogFlags
-typedef int ImGuiInputFlags; // -> enum ImGuiInputFlags_ // Flags: for IsKeyPressed(), IsMouseClicked(), SetKeyOwner(), SetItemKeyOwner() etc.
-typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag(), g.LastItemData.InFlags
+typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow()
typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for g.LastItemData.StatusFlags
typedef int ImGuiOldColumnFlags; // -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns()
-typedef int ImGuiNavHighlightFlags; // -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
+typedef int ImGuiLogFlags; // -> enum ImGuiLogFlags_ // Flags: for LogBegin() text capturing function
+typedef int ImGuiNavRenderCursorFlags; // -> enum ImGuiNavRenderCursorFlags_//Flags: for RenderNavCursor()
typedef int ImGuiNavMoveFlags; // -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests
typedef int ImGuiNextItemDataFlags; // -> enum ImGuiNextItemDataFlags_ // Flags: for SetNextItemXXX() functions
typedef int ImGuiNextWindowDataFlags; // -> enum ImGuiNextWindowDataFlags_// Flags: for SetNextWindowXXX() functions
@@ -166,8 +203,8 @@ typedef int ImGuiScrollFlags; // -> enum ImGuiScrollFlags_ // F
typedef int ImGuiSeparatorFlags; // -> enum ImGuiSeparatorFlags_ // Flags: for SeparatorEx()
typedef int ImGuiTextFlags; // -> enum ImGuiTextFlags_ // Flags: for TextEx()
typedef int ImGuiTooltipFlags; // -> enum ImGuiTooltipFlags_ // Flags: for BeginTooltipEx()
-
-typedef void (*ImGuiErrorLogCallback)(void* user_data, const char* fmt, ...);
+typedef int ImGuiTypingSelectFlags; // -> enum ImGuiTypingSelectFlags_ // Flags: for GetTypingSelectRequest()
+typedef int ImGuiWindowRefreshFlags; // -> enum ImGuiWindowRefreshFlags_ // Flags: for SetNextWindowRefreshPolicy()
//-----------------------------------------------------------------------------
// [SECTION] Context pointer
@@ -178,24 +215,6 @@ typedef void (*ImGuiErrorLogCallback)(void* user_data, const char* fmt, ...);
extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
#endif
-//-------------------------------------------------------------------------
-// [SECTION] STB libraries includes
-//-------------------------------------------------------------------------
-
-namespace ImStb
-{
-
-#undef STB_TEXTEDIT_STRING
-#undef STB_TEXTEDIT_CHARTYPE
-#define STB_TEXTEDIT_STRING ImGuiInputTextState
-#define STB_TEXTEDIT_CHARTYPE ImWchar
-#define STB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
-#define STB_TEXTEDIT_UNDOSTATECOUNT 99
-#define STB_TEXTEDIT_UNDOCHARCOUNT 999
-#include "imstb_textedit.h"
-
-} // namespace ImStb
-
//-----------------------------------------------------------------------------
// [SECTION] Macros
//-----------------------------------------------------------------------------
@@ -206,18 +225,21 @@ namespace ImStb
#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
#define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__)
#else
-#define IMGUI_DEBUG_PRINTF(_FMT,...)
+#define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0)
#endif
#endif
// Debug Logging for ShowDebugLogWindow(). This is designed for relatively rare events so please don't spam.
-#define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__)
-#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
-#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
-#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
-#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
-#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
-#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_ERROR(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventError) IMGUI_DEBUG_LOG(__VA_ARGS__); else g.DebugLogSkippedErrors++; } while (0)
+#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_FONT(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFont) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_INPUTROUTING(...) do{if (g.DebugLogFlags & ImGuiDebugLogFlags_EventInputRouting)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
// Static Asserts
#define IM_STATIC_ASSERT(_COND) static_assert(_COND, "")
@@ -231,12 +253,6 @@ namespace ImStb
#define IM_ASSERT_PARANOID(_EXPR)
#endif
-// Error handling
-// Down the line in some frameworks/languages we would like to have a way to redirect those to the programmer and recover from more faults.
-#ifndef IM_ASSERT_USER_ERROR
-#define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG) // Recoverable User Error
-#endif
-
// Misc Macros
#define IM_PI 3.14159265358979323846f
#ifdef _WIN32
@@ -250,8 +266,22 @@ namespace ImStb
#define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1)) // Memory align e.g. IM_ALIGN(0,4)=0, IM_ALIGN(1,4)=4, IM_ALIGN(4,4)=4, IM_ALIGN(5,4)=8
#define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose
#define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255
-#define IM_FLOOR(_VAL) ((float)(int)(_VAL)) // ImFloor() is not inlined in MSVC debug builds
+#define IM_TRUNC(_VAL) ((float)(int)(_VAL)) // ImTrunc() is not inlined in MSVC debug builds
#define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) //
+#define IM_STRINGIFY_HELPER(_X) #_X
+#define IM_STRINGIFY(_X) IM_STRINGIFY_HELPER(_X) // Preprocessor idiom to stringify e.g. an integer.
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+#define IM_FLOOR IM_TRUNC
+#endif
+
+// Hint for branch prediction
+#if (defined(__cplusplus) && (__cplusplus >= 202002L)) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 202002L))
+#define IM_LIKELY [[likely]]
+#define IM_UNLIKELY [[unlikely]]
+#else
+#define IM_LIKELY
+#define IM_UNLIKELY
+#endif
// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
#ifdef _MSC_VER
@@ -276,16 +306,28 @@ namespace ImStb
#elif defined(__clang__)
#define IM_DEBUG_BREAK() __builtin_debugtrap()
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
-#define IM_DEBUG_BREAK() __asm__ volatile("int $0x03")
+#define IM_DEBUG_BREAK() __asm__ volatile("int3;nop")
#elif defined(__GNUC__) && defined(__thumb__)
#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01")
#elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__)
-#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0");
+#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0")
#else
#define IM_DEBUG_BREAK() IM_ASSERT(0) // It is expected that you define IM_DEBUG_BREAK() into something that will break nicely in a debugger!
#endif
#endif // #ifndef IM_DEBUG_BREAK
+// Format specifiers, printing 64-bit hasn't been decently standardized...
+// In a real application you should be using PRId64 and PRIu64 from <inttypes.h> (non-windows) and on Windows define them yourself.
+#if defined(_MSC_VER) && !defined(__clang__)
+#define IM_PRId64 "I64d"
+#define IM_PRIu64 "I64u"
+#define IM_PRIX64 "I64X"
+#else
+#define IM_PRId64 "lld"
+#define IM_PRIu64 "llu"
+#define IM_PRIX64 "llX"
+#endif
+
//-----------------------------------------------------------------------------
// [SECTION] Generic helpers
// Note that the ImXXX helpers functions are lower-level than ImGui functions.
@@ -309,11 +351,12 @@ namespace ImStb
// - Helper: ImPool<>
// - Helper: ImChunkStream<>
// - Helper: ImGuiTextIndex
+// - Helper: ImGuiStorage
//-----------------------------------------------------------------------------
// Helpers: Hashing
-IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImU32 seed = 0);
-IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImU32 seed = 0);
+IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImGuiID seed = 0);
+IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImGuiID seed = 0);
// Helpers: Sorting
#ifndef ImQsort
@@ -324,27 +367,31 @@ static inline void ImQsort(void* base, size_t count, size_t size_of_element
IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
// Helpers: Bit manipulation
-static inline bool ImIsPowerOfTwo(int v) { return v != 0 && (v & (v - 1)) == 0; }
-static inline bool ImIsPowerOfTwo(ImU64 v) { return v != 0 && (v & (v - 1)) == 0; }
-static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; }
+static inline bool ImIsPowerOfTwo(int v) { return v != 0 && (v & (v - 1)) == 0; }
+static inline bool ImIsPowerOfTwo(ImU64 v) { return v != 0 && (v & (v - 1)) == 0; }
+static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; }
+static inline unsigned int ImCountSetBits(unsigned int v) { unsigned int count = 0; while (v > 0) { v = v & (v - 1); count++; } return count; }
// Helpers: String
-IMGUI_API int ImStricmp(const char* str1, const char* str2);
-IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count);
-IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count);
-IMGUI_API char* ImStrdup(const char* str);
-IMGUI_API char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* str);
-IMGUI_API const char* ImStrchrRange(const char* str_begin, const char* str_end, char c);
-IMGUI_API int ImStrlenW(const ImWchar* str);
+#define ImStrlen strlen
+#define ImMemchr memchr
+IMGUI_API int ImStricmp(const char* str1, const char* str2); // Case insensitive compare.
+IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count); // Case insensitive compare to a certain count.
+IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count); // Copy to a certain count and always zero terminate (strncpy doesn't).
+IMGUI_API char* ImStrdup(const char* str); // Duplicate a string.
+IMGUI_API char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* str); // Copy in provided buffer, recreate buffer if needed.
+IMGUI_API const char* ImStrchrRange(const char* str_begin, const char* str_end, char c); // Find first occurrence of 'c' in string range.
IMGUI_API const char* ImStreolRange(const char* str, const char* str_end); // End end-of-line
-IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin); // Find beginning-of-line
-IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end);
-IMGUI_API void ImStrTrimBlanks(char* str);
-IMGUI_API const char* ImStrSkipBlank(const char* str);
+IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end); // Find a substring in a string range.
+IMGUI_API void ImStrTrimBlanks(char* str); // Remove leading and trailing blanks from a buffer.
+IMGUI_API const char* ImStrSkipBlank(const char* str); // Find first non-blank character.
+IMGUI_API int ImStrlenW(const ImWchar* str); // Computer string length (ImWchar string)
+IMGUI_API const char* ImStrbol(const char* buf_mid_line, const char* buf_begin); // Find beginning-of-line
IM_MSVC_RUNTIME_CHECKS_OFF
static inline char ImToUpper(char c) { return (c >= 'a' && c <= 'z') ? c &= ~32 : c; }
static inline bool ImCharIsBlankA(char c) { return c == ' ' || c == '\t'; }
static inline bool ImCharIsBlankW(unsigned int c) { return c == ' ' || c == '\t' || c == 0x3000; }
+static inline bool ImCharIsXdigitA(char c) { return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); }
IM_MSVC_RUNTIME_CHECKS_RESTORE
// Helpers: Formatting
@@ -367,29 +414,8 @@ IMGUI_API int ImTextStrFromUtf8(ImWchar* out_buf, int out_buf_size, co
IMGUI_API int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end); // return number of UTF-8 code-points (NOT bytes count)
IMGUI_API int ImTextCountUtf8BytesFromChar(const char* in_text, const char* in_text_end); // return number of bytes to express one char in UTF-8
IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string in UTF-8
-
-// Helpers: ImVec2/ImVec4 operators
-// We are keeping those disabled by default so they don't leak in user space, to allow user enabling implicit cast operators between ImVec2 and their own types (using IM_VEC2_CLASS_EXTRA etc.)
-// We unfortunately don't have a unary- operator for ImVec2 because this would needs to be defined inside the class itself.
-#ifdef IMGUI_DEFINE_MATH_OPERATORS
-IM_MSVC_RUNTIME_CHECKS_OFF
-static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x * rhs, lhs.y * rhs); }
-static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x / rhs, lhs.y / rhs); }
-static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); }
-static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); }
-static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
-static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); }
-static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; }
-static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; }
-static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }
-static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
-static inline ImVec2& operator*=(ImVec2& lhs, const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y; return lhs; }
-static inline ImVec2& operator/=(ImVec2& lhs, const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y; return lhs; }
-static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); }
-static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); }
-static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); }
-IM_MSVC_RUNTIME_CHECKS_RESTORE
-#endif
+IMGUI_API const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_text_curr); // return previous UTF-8 code-point.
+IMGUI_API int ImTextCountLines(const char* in_text, const char* in_text_end); // return number of lines taken by text. trailing carriage return doesn't count as an extra line.
// Helpers: File System
#ifdef IMGUI_DISABLE_FILE_FUNCTIONS
@@ -425,7 +451,6 @@ IM_MSVC_RUNTIME_CHECKS_OFF
#define ImAcos(X) acosf(X)
#define ImAtan2(Y, X) atan2f((Y), (X))
#define ImAtof(STR) atof(STR)
-//#define ImFloorStd(X) floorf(X) // We use our own, see ImFloor() and ImFloorSigned()
#define ImCeil(X) ceilf(X)
static inline float ImPow(float x, float y) { return powf(x, y); } // DragBehaviorT/SliderBehaviorT uses ImPow with either float/double and need the precision
static inline double ImPow(double x, double y) { return pow(x, y); }
@@ -455,7 +480,7 @@ template<typename T> static inline T ImSubClampOverflow(T a, T b, T mn, T mx)
// - Misc maths helpers
static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y); }
static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x >= rhs.x ? lhs.x : rhs.x, lhs.y >= rhs.y ? lhs.y : rhs.y); }
-static inline ImVec2 ImClamp(const ImVec2& v, const ImVec2& mn, ImVec2 mx) { return ImVec2((v.x < mn.x) ? mn.x : (v.x > mx.x) ? mx.x : v.x, (v.y < mn.y) ? mn.y : (v.y > mx.y) ? mx.y : v.y); }
+static inline ImVec2 ImClamp(const ImVec2& v, const ImVec2&mn, const ImVec2&mx) { return ImVec2((v.x < mn.x) ? mn.x : (v.x > mx.x) ? mx.x : v.x, (v.y < mn.y) ? mn.y : (v.y > mx.y) ? mx.y : v.y); }
static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t) { return ImVec2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); }
static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t) { return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); }
static inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t) { return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); }
@@ -463,16 +488,18 @@ static inline float ImSaturate(float f)
static inline float ImLengthSqr(const ImVec2& lhs) { return (lhs.x * lhs.x) + (lhs.y * lhs.y); }
static inline float ImLengthSqr(const ImVec4& lhs) { return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = (lhs.x * lhs.x) + (lhs.y * lhs.y); if (d > 0.0f) return ImRsqrt(d); return fail_value; }
-static inline float ImFloor(float f) { return (float)(int)(f); }
-static inline float ImFloorSigned(float f) { return (float)((f >= 0 || (float)(int)f == f) ? (int)f : (int)f - 1); } // Decent replacement for floorf()
-static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2((float)(int)(v.x), (float)(int)(v.y)); }
-static inline ImVec2 ImFloorSigned(const ImVec2& v) { return ImVec2(ImFloorSigned(v.x), ImFloorSigned(v.y)); }
+static inline float ImTrunc(float f) { return (float)(int)(f); }
+static inline ImVec2 ImTrunc(const ImVec2& v) { return ImVec2((float)(int)(v.x), (float)(int)(v.y)); }
+static inline float ImFloor(float f) { return (float)((f >= 0 || (float)(int)f == f) ? (int)f : (int)f - 1); } // Decent replacement for floorf()
+static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2(ImFloor(v.x), ImFloor(v.y)); }
static inline int ImModPositive(int a, int b) { return (a + b) % b; }
static inline float ImDot(const ImVec2& a, const ImVec2& b) { return a.x * b.x + a.y * b.y; }
static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) { return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); }
static inline float ImLinearSweep(float current, float target, float speed) { if (current < target) return ImMin(current + speed, target); if (current > target) return ImMax(current - speed, target); return current; }
+static inline float ImLinearRemapClamp(float s0, float s1, float d0, float d1, float x) { return ImSaturate((x - s0) / (s1 - s0)) * (d1 - d0) + d0; }
static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(float f) { return f <= -16777216 || f >= 16777216; }
+static inline float ImExponentialMovingAverage(float avg, float sample, int n) { avg -= avg / n; avg += sample / n; return avg; }
IM_MSVC_RUNTIME_CHECKS_RESTORE
// Helpers: Geometry
@@ -484,8 +511,8 @@ IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const
IMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
IMGUI_API void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w);
-inline float ImTriangleArea(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ImFabs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) * 0.5f; }
-IMGUI_API ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy);
+inline float ImTriangleArea(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ImFabs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) * 0.5f; }
+inline bool ImTriangleIsClockwise(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ((b.x - a.x) * (c.y - b.y)) - ((c.x - b.x) * (b.y - a.y)) > 0.0f; }
// Helper: ImVec1 (1D vector)
// (this odd construct is used to facilitate the transition between 1D and 2D, and the maintenance of some branches/patches)
@@ -529,6 +556,7 @@ struct IMGUI_API ImRect
ImVec2 GetBR() const { return Max; } // Bottom-right
bool Contains(const ImVec2& p) const { return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
bool Contains(const ImRect& r) const { return r.Min.x >= Min.x && r.Min.y >= Min.y && r.Max.x <= Max.x && r.Max.y <= Max.y; }
+ bool ContainsWithPad(const ImVec2& p, const ImVec2& pad) const { return p.x >= Min.x - pad.x && p.y >= Min.y - pad.y && p.x < Max.x + pad.x && p.y < Max.y + pad.y; }
bool Overlaps(const ImRect& r) const { return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; }
void Add(const ImVec2& p) { if (Min.x > p.x) Min.x = p.x; if (Min.y > p.y) Min.y = p.y; if (Max.x < p.x) Max.x = p.x; if (Max.y < p.y) Max.y = p.y; }
void Add(const ImRect& r) { if (Min.x > r.Min.x) Min.x = r.Min.x; if (Min.y > r.Min.y) Min.y = r.Min.y; if (Max.x < r.Max.x) Max.x = r.Max.x; if (Max.y < r.Max.y) Max.y = r.Max.y; }
@@ -539,13 +567,16 @@ struct IMGUI_API ImRect
void TranslateY(float dy) { Min.y += dy; Max.y += dy; }
void ClipWith(const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); } // Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.
void ClipWithFull(const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); } // Full version, ensure both points are fully clipped.
- void Floor() { Min.x = IM_FLOOR(Min.x); Min.y = IM_FLOOR(Min.y); Max.x = IM_FLOOR(Max.x); Max.y = IM_FLOOR(Max.y); }
+ void Floor() { Min.x = IM_TRUNC(Min.x); Min.y = IM_TRUNC(Min.y); Max.x = IM_TRUNC(Max.x); Max.y = IM_TRUNC(Max.y); }
bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; }
ImVec4 ToVec4() const { return ImVec4(Min.x, Min.y, Max.x, Max.y); }
};
-IM_MSVC_RUNTIME_CHECKS_RESTORE
// Helper: ImBitArray
+#define IM_BITARRAY_TESTBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] & ((ImU32)1 << ((_N) & 31))) != 0) // Macro version of ImBitArrayTestBit(): ensure args have side-effect or are costly!
+#define IM_BITARRAY_CLEARBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] &= ~((ImU32)1 << ((_N) & 31)))) // Macro version of ImBitArrayClearBit(): ensure args have side-effect or are costly!
+inline size_t ImBitArrayGetStorageSizeInBytes(int bitcount) { return (size_t)((bitcount + 31) >> 5) << 2; }
+inline void ImBitArrayClearAllBits(ImU32* arr, int bitcount){ memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); }
inline bool ImBitArrayTestBit(const ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); return (arr[n >> 5] & mask) != 0; }
inline void ImBitArrayClearBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
inline void ImBitArraySetBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
@@ -562,6 +593,8 @@ inline void ImBitArraySetBitRange(ImU32* arr, int n, int n2) // Works on ran
}
}
+typedef ImU32* ImBitArrayPtr; // Name for use in structs
+
// Helper: ImBitArray class (wrapper over ImBitArray functions)
// Store 1-bit per value.
template<int BITCOUNT, int OFFSET = 0>
@@ -571,11 +604,11 @@ struct ImBitArray
ImBitArray() { ClearAllBits(); }
void ClearAllBits() { memset(Storage, 0, sizeof(Storage)); }
void SetAllBits() { memset(Storage, 255, sizeof(Storage)); }
- bool TestBit(int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return ImBitArrayTestBit(Storage, n); }
+ bool TestBit(int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return IM_BITARRAY_TESTBIT(Storage, n); }
void SetBit(int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Storage, n); }
void ClearBit(int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
void SetBitRange(int n, int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Storage, n, n2); } // Works on range [n..n2)
- bool operator[](int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return ImBitArrayTestBit(Storage, n); }
+ bool operator[](int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return IM_BITARRAY_TESTBIT(Storage, n); }
};
// Helper: ImBitVector
@@ -585,10 +618,11 @@ struct IMGUI_API ImBitVector
ImVector<ImU32> Storage;
void Create(int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (size_t)Storage.Size * sizeof(Storage.Data[0])); }
void Clear() { Storage.clear(); }
- bool TestBit(int n) const { IM_ASSERT(n < (Storage.Size << 5)); return ImBitArrayTestBit(Storage.Data, n); }
+ bool TestBit(int n) const { IM_ASSERT(n < (Storage.Size << 5)); return IM_BITARRAY_TESTBIT(Storage.Data, n); }
void SetBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
void ClearBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
};
+IM_MSVC_RUNTIME_CHECKS_RESTORE
// Helper: ImSpan<>
// Pointing to a span of data we don't own.
@@ -672,9 +706,6 @@ struct ImPool
int GetBufSize() const { return Buf.Size; }
int GetMapSize() const { return Map.Data.Size; } // It is the map we need iterate to find valid items, since we don't have "alive" storage anywhere
T* TryGetMapData(ImPoolIdx n) { int idx = Map.Data[n].val_i; if (idx == -1) return NULL; return GetByIndex(idx); }
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- int GetSize() { return GetMapSize(); } // For ImPlot: should use GetMapSize() from (IMGUI_VERSION_NUM >= 18304)
-#endif
};
// Helper: ImChunkStream<>
@@ -698,10 +729,9 @@ struct ImChunkStream
int offset_from_ptr(const T* p) { IM_ASSERT(p >= begin() && p < end()); const ptrdiff_t off = (const char*)p - Buf.Data; return (int)off; }
T* ptr_from_offset(int off) { IM_ASSERT(off >= 4 && off < Buf.Size); return (T*)(void*)(Buf.Data + off); }
void swap(ImChunkStream<T>& rhs) { rhs.Buf.swap(Buf); }
-
};
-// Helper: ImGuiTextIndex<>
+// Helper: ImGuiTextIndex
// Maintain a line index for a text buffer. This is a strong candidate to be moved into the public API.
struct ImGuiTextIndex
{
@@ -715,6 +745,9 @@ struct ImGuiTextIndex
void append(const char* base, int old_size, int new_size);
};
+// Helper: ImGuiStorage
+IMGUI_API ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key);
+
//-----------------------------------------------------------------------------
// [SECTION] ImDrawList support
//-----------------------------------------------------------------------------
@@ -745,25 +778,27 @@ struct ImGuiTextIndex
#define IM_DRAWLIST_ARCFAST_SAMPLE_MAX IM_DRAWLIST_ARCFAST_TABLE_SIZE // Sample index _PathArcToFastEx() for 360 angle.
// Data shared between all ImDrawList instances
-// You may want to create your own instance of this if you want to use ImDrawList completely without ImGui. In that case, watch out for future changes to this structure.
+// Conceptually this could have been called e.g. ImDrawListSharedContext
+// Typically one ImGui context would create and maintain one of this.
+// You may want to create your own instance of you try to ImDrawList completely without ImGui. In that case, watch out for future changes to this structure.
struct IMGUI_API ImDrawListSharedData
{
ImVec2 TexUvWhitePixel; // UV of white pixel in the atlas
+ const ImVec4* TexUvLines; // UV of anti-aliased lines in the atlas
ImFont* Font; // Current/default font (optional, for simplified AddText overload)
float FontSize; // Current/default font size (optional, for simplified AddText overload)
+ float FontScale; // Current/default font scale (== FontSize / Font->FontSize)
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo()
float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc
- ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
+ float InitialFringeScale; // Initial scale to apply to AA fringe
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
+ ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
+ ImVector<ImVec2> TempBuffer; // Temporary write buffer
- // [Internal] Temp write buffer
- ImVector<ImVec2> TempBuffer;
-
- // [Internal] Lookup tables
+ // Lookup tables
ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE]; // Sample points on the quarter of the circle.
float ArcFastRadiusCutoff; // Cutoff radius after which arc drawing will fallback to slower PathArcTo()
ImU8 CircleSegmentCounts[64]; // Precomputed segment count for given radius before we calculate it dynamically (to avoid calculation overhead)
- const ImVec4* TexUvLines; // UV of anti-aliased lines in the atlas
ImDrawListSharedData();
void SetCircleTessellationMaxError(float max_error);
@@ -771,39 +806,93 @@ struct IMGUI_API ImDrawListSharedData
struct ImDrawDataBuilder
{
- ImVector<ImDrawList*> Layers[2]; // Global layers for: regular, tooltip
+ ImVector<ImDrawList*>* Layers[2]; // Pointers to global layers for: regular, tooltip. LayersP[0] is owned by DrawData.
+ ImVector<ImDrawList*> LayerData1;
- void Clear() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); }
- void ClearFreeMemory() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); }
- int GetDrawListCount() const { int count = 0; for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) count += Layers[n].Size; return count; }
- IMGUI_API void FlattenIntoSingleLayer();
+ ImDrawDataBuilder() { memset(this, 0, sizeof(*this)); }
+};
+
+//-----------------------------------------------------------------------------
+// [SECTION] Style support
+//-----------------------------------------------------------------------------
+
+struct ImGuiStyleVarInfo
+{
+ ImU32 Count : 8; // 1+
+ ImGuiDataType DataType : 8;
+ ImU32 Offset : 16; // Offset in parent structure
+ void* GetVarPtr(void* parent) const { return (void*)((unsigned char*)parent + Offset); }
+};
+
+// Stacked color modifier, backup of modified data so we can restore it
+struct ImGuiColorMod
+{
+ ImGuiCol Col;
+ ImVec4 BackupValue;
+};
+
+// Stacked style modifier, backup of modified data so we can restore it. Data type inferred from the variable.
+struct ImGuiStyleMod
+{
+ ImGuiStyleVar VarIdx;
+ union { int BackupInt[2]; float BackupFloat[2]; };
+ ImGuiStyleMod(ImGuiStyleVar idx, int v) { VarIdx = idx; BackupInt[0] = v; }
+ ImGuiStyleMod(ImGuiStyleVar idx, float v) { VarIdx = idx; BackupFloat[0] = v; }
+ ImGuiStyleMod(ImGuiStyleVar idx, ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
+};
+
+//-----------------------------------------------------------------------------
+// [SECTION] Data types support
+//-----------------------------------------------------------------------------
+
+struct ImGuiDataTypeStorage
+{
+ ImU8 Data[8]; // Opaque storage to fit any data up to ImGuiDataType_COUNT
+};
+
+// Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo().
+struct ImGuiDataTypeInfo
+{
+ size_t Size; // Size in bytes
+ const char* Name; // Short descriptive name for the type, for debugging
+ const char* PrintFmt; // Default printf format for the type
+ const char* ScanFmt; // Default scanf format for the type
+};
+
+// Extend ImGuiDataType_
+enum ImGuiDataTypePrivate_
+{
+ ImGuiDataType_Pointer = ImGuiDataType_COUNT,
+ ImGuiDataType_ID,
};
//-----------------------------------------------------------------------------
// [SECTION] Widgets support: flags, enums, data structures
//-----------------------------------------------------------------------------
-// Flags used by upcoming items
-// - input: PushItemFlag() manipulates g.CurrentItemFlags, ItemAdd() calls may add extra flags.
-// - output: stored in g.LastItemData.InFlags
-// Current window shared by all windows.
-// This is going to be exposed in imgui.h when stabilized enough.
-enum ImGuiItemFlags_
+// Extend ImGuiItemFlags
+// - input: PushItemFlag() manipulates g.CurrentItemFlags, g.NextItemData.ItemFlags, ItemAdd() calls may add extra flags too.
+// - output: stored in g.LastItemData.ItemFlags
+enum ImGuiItemFlagsPrivate_
{
// Controlled by user
- ImGuiItemFlags_None = 0,
- ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing (FIXME: should merge with _NoNav)
- ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
- ImGuiItemFlags_Disabled = 1 << 2, // false // Disable interactions but doesn't affect visuals. See BeginDisabled()/EndDisabled(). See github.com/ocornut/imgui/issues/211
- ImGuiItemFlags_NoNav = 1 << 3, // false // Disable keyboard/gamepad directional navigation (FIXME: should merge with _NoTabStop)
- ImGuiItemFlags_NoNavDefaultFocus = 1 << 4, // false // Disable item being a candidate for default focus (e.g. used by title bar items)
- ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // Disable MenuItem/Selectable() automatically closing their popup window
- ImGuiItemFlags_MixedValue = 1 << 6, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
- ImGuiItemFlags_ReadOnly = 1 << 7, // false // [ALPHA] Allow hovering interactions but underlying value is not changed.
- ImGuiItemFlags_NoWindowHoverableCheck = 1 << 8, // false // Disable hoverable check in ItemHoverable()
+ ImGuiItemFlags_Disabled = 1 << 10, // false // Disable interactions (DOES NOT affect visuals. DO NOT mix direct use of this with BeginDisabled(). See BeginDisabled()/EndDisabled() for full disable feature, and github #211).
+ ImGuiItemFlags_ReadOnly = 1 << 11, // false // [ALPHA] Allow hovering interactions but underlying value is not changed.
+ ImGuiItemFlags_MixedValue = 1 << 12, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
+ ImGuiItemFlags_NoWindowHoverableCheck = 1 << 13, // false // Disable hoverable check in ItemHoverable()
+ ImGuiItemFlags_AllowOverlap = 1 << 14, // false // Allow being overlapped by another widget. Not-hovered to Hovered transition deferred by a frame.
+ ImGuiItemFlags_NoNavDisableMouseHover = 1 << 15, // false // Nav keyboard/gamepad mode doesn't disable hover highlight (behave as if NavHighlightItemUnderNav==false).
+ ImGuiItemFlags_NoMarkEdited = 1 << 16, // false // Skip calling MarkItemEdited()
// Controlled by widget code
- ImGuiItemFlags_Inputable = 1 << 10, // false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
+ ImGuiItemFlags_Inputable = 1 << 20, // false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
+ ImGuiItemFlags_HasSelectionUserData = 1 << 21, // false // Set by SetNextItemSelectionUserData()
+ ImGuiItemFlags_IsMultiSelect = 1 << 22, // false // Set by SetNextItemSelectionUserData()
+
+ ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups, // Please don't change, use PushItemFlag() instead.
+
+ // Obsolete
+ //ImGuiItemFlags_SelectableDontClosePopup = !ImGuiItemFlags_AutoClosePopups, // Can't have a redirect as we inverted the behavior
};
// Status flags for an already submitted item
@@ -819,24 +908,35 @@ enum ImGuiItemStatusFlags_
ImGuiItemStatusFlags_HasDeactivated = 1 << 5, // Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag.
ImGuiItemStatusFlags_Deactivated = 1 << 6, // Only valid if ImGuiItemStatusFlags_HasDeactivated is set.
ImGuiItemStatusFlags_HoveredWindow = 1 << 7, // Override the HoveredWindow test to allow cross-window hover testing.
- ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, // Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon)
- ImGuiItemStatusFlags_Visible = 1 << 9, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()).
+ ImGuiItemStatusFlags_Visible = 1 << 8, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()).
+ ImGuiItemStatusFlags_HasClipRect = 1 << 9, // g.LastItemData.ClipRect is valid.
+ ImGuiItemStatusFlags_HasShortcut = 1 << 10, // g.LastItemData.Shortcut valid. Set by SetNextItemShortcut() -> ItemAdd().
+ // Additional status + semantic for ImGuiTestEngine
#ifdef IMGUI_ENABLE_TEST_ENGINE
ImGuiItemStatusFlags_Openable = 1 << 20, // Item is an openable (e.g. TreeNode)
- ImGuiItemStatusFlags_Opened = 1 << 21, //
+ ImGuiItemStatusFlags_Opened = 1 << 21, // Opened status
ImGuiItemStatusFlags_Checkable = 1 << 22, // Item is a checkable (e.g. CheckBox, MenuItem)
- ImGuiItemStatusFlags_Checked = 1 << 23, //
+ ImGuiItemStatusFlags_Checked = 1 << 23, // Checked status
+ ImGuiItemStatusFlags_Inputable = 1 << 24, // Item is a text-inputable (e.g. InputText, SliderXXX, DragXXX)
#endif
};
+// Extend ImGuiHoveredFlags_
+enum ImGuiHoveredFlagsPrivate_
+{
+ ImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay,
+ ImGuiHoveredFlags_AllowedMaskForIsWindowHovered = ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_NoPopupHierarchy | ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary,
+ ImGuiHoveredFlags_AllowedMaskForIsItemHovered = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_NoNavOverride | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayMask_,
+};
+
// Extend ImGuiInputTextFlags_
enum ImGuiInputTextFlagsPrivate_
{
// [Internal]
ImGuiInputTextFlags_Multiline = 1 << 26, // For internal use by InputTextMultiline()
- ImGuiInputTextFlags_NoMarkEdited = 1 << 27, // For internal use by functions using InputText() before reformatting data
- ImGuiInputTextFlags_MergedItem = 1 << 28, // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match.
+ ImGuiInputTextFlags_MergedItem = 1 << 27, // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match.
+ ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 28, // For internal use by InputScalar() and TempInputScalar()
};
// Extend ImGuiButtonFlags_
@@ -848,15 +948,15 @@ enum ImGuiButtonFlagsPrivate_
ImGuiButtonFlags_PressedOnRelease = 1 << 7, // return true on release (default requires click+release)
ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8, // return true on double-click (default requires click+release)
ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9, // return true when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers)
- ImGuiButtonFlags_Repeat = 1 << 10, // hold to repeat
+ //ImGuiButtonFlags_Repeat = 1 << 10, // hold to repeat -> use ImGuiItemFlags_ButtonRepeat instead.
ImGuiButtonFlags_FlattenChildren = 1 << 11, // allow interactions even if a child window is overlapping
- ImGuiButtonFlags_AllowItemOverlap = 1 << 12, // require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap()
- ImGuiButtonFlags_DontClosePopups = 1 << 13, // disable automatically closing parent popup on press // [UNUSED]
+ ImGuiButtonFlags_AllowOverlap = 1 << 12, // require previous frame HoveredId to either match id or be null before being usable.
+ //ImGuiButtonFlags_DontClosePopups = 1 << 13, // disable automatically closing parent popup on press
//ImGuiButtonFlags_Disabled = 1 << 14, // disable interactions -> use BeginDisabled() or ImGuiItemFlags_Disabled
ImGuiButtonFlags_AlignTextBaseLine = 1 << 15, // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine
- ImGuiButtonFlags_NoKeyModifiers = 1 << 16, // disable mouse interaction if a key modifier is held
+ ImGuiButtonFlags_NoKeyModsAllowed = 1 << 16, // disable mouse interaction if a key modifier is held
ImGuiButtonFlags_NoHoldingActiveId = 1 << 17, // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
- ImGuiButtonFlags_NoNavFocus = 1 << 18, // don't override navigation focus when activated (FIXME: this is essentially used everytime an item uses ImGuiItemFlags_NoNav, but because legacy specs don't requires LastItemData to be set ButtonBehavior(), we can't poll g.LastItemData.InFlags)
+ ImGuiButtonFlags_NoNavFocus = 1 << 18, // don't override navigation focus when activated (FIXME: this is essentially used every time an item uses ImGuiItemFlags_NoNav, but because legacy specs don't requires LastItemData to be set ButtonBehavior(), we can't poll g.LastItemData.ItemFlags)
ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19, // don't report as hovered when nav focus is on this item
ImGuiButtonFlags_NoSetKeyOwner = 1 << 20, // don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
ImGuiButtonFlags_NoTestKeyOwner = 1 << 21, // don't test key/input owner when polling the key (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
@@ -874,7 +974,7 @@ enum ImGuiComboFlagsPrivate_
enum ImGuiSliderFlagsPrivate_
{
ImGuiSliderFlags_Vertical = 1 << 20, // Should this slider be orientated vertically?
- ImGuiSliderFlags_ReadOnly = 1 << 21,
+ ImGuiSliderFlags_ReadOnly = 1 << 21, // Consider using g.NextItemData.ItemFlags |= ImGuiItemFlags_ReadOnly instead.
};
// Extend ImGuiSelectableFlags_
@@ -886,16 +986,17 @@ enum ImGuiSelectableFlagsPrivate_
ImGuiSelectableFlags_SelectOnClick = 1 << 22, // Override button behavior to react on Click (default is Click+Release)
ImGuiSelectableFlags_SelectOnRelease = 1 << 23, // Override button behavior to react on Release (default is Click+Release)
ImGuiSelectableFlags_SpanAvailWidth = 1 << 24, // Span all avail width even if we declared less for layout purpose. FIXME: We may be able to remove this (added in 6251d379, 2bcafc86 for menus)
- ImGuiSelectableFlags_DrawHoveredWhenHeld = 1 << 25, // Always show active when held, even is not hovered. This concept could probably be renamed/formalized somehow.
- ImGuiSelectableFlags_SetNavIdOnHover = 1 << 26, // Set Nav/Focus ID on mouse hover (used by MenuItem)
- ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 27, // Disable padding each side with ItemSpacing * 0.5f
- ImGuiSelectableFlags_NoSetKeyOwner = 1 << 28, // Don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
+ ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25, // Set Nav/Focus ID on mouse hover (used by MenuItem)
+ ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26, // Disable padding each side with ItemSpacing * 0.5f
+ ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27, // Don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
};
// Extend ImGuiTreeNodeFlags_
enum ImGuiTreeNodeFlagsPrivate_
{
- ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20,
+ ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 28,// FIXME-WIP: Hard-coded for CollapsingHeader()
+ ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29,// FIXME-WIP: Turn Down arrow into an Up arrow, for reversed trees (#6517)
+ ImGuiTreeNodeFlags_OpenOnMask_ = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow,
};
enum ImGuiSeparatorFlags_
@@ -903,7 +1004,17 @@ enum ImGuiSeparatorFlags_
ImGuiSeparatorFlags_None = 0,
ImGuiSeparatorFlags_Horizontal = 1 << 0, // Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar
ImGuiSeparatorFlags_Vertical = 1 << 1,
- ImGuiSeparatorFlags_SpanAllColumns = 1 << 2,
+ ImGuiSeparatorFlags_SpanAllColumns = 1 << 2, // Make separator cover all columns of a legacy Columns() set.
+};
+
+// Flags for FocusWindow(). This is not called ImGuiFocusFlags to avoid confusion with public-facing ImGuiFocusedFlags.
+// FIXME: Once we finishing replacing more uses of GetTopMostPopupModal()+IsWindowWithinBeginStackOf()
+// and FindBlockingModal() with this, we may want to change the flag to be opt-out instead of opt-in.
+enum ImGuiFocusRequestFlags_
+{
+ ImGuiFocusRequestFlags_None = 0,
+ ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0, // Find last focused child (if any) and focus it instead.
+ ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1, // Do not set focus if the window is below a modal.
};
enum ImGuiTextFlags_
@@ -915,7 +1026,7 @@ enum ImGuiTextFlags_
enum ImGuiTooltipFlags_
{
ImGuiTooltipFlags_None = 0,
- ImGuiTooltipFlags_OverridePreviousTooltip = 1 << 0, // Override will clear/ignore previously submitted tooltip (defaults to append)
+ ImGuiTooltipFlags_OverridePrevious = 1 << 1, // Clear/ignore previously submitted tooltip (defaults to append)
};
// FIXME: this is in development, not exposed/functional as a generic feature yet.
@@ -926,13 +1037,16 @@ enum ImGuiLayoutType_
ImGuiLayoutType_Vertical = 1
};
-enum ImGuiLogType
+// Flags for LogBegin() text capturing function
+enum ImGuiLogFlags_
{
- ImGuiLogType_None = 0,
- ImGuiLogType_TTY,
- ImGuiLogType_File,
- ImGuiLogType_Buffer,
- ImGuiLogType_Clipboard,
+ ImGuiLogFlags_None = 0,
+
+ ImGuiLogFlags_OutputTTY = 1 << 0,
+ ImGuiLogFlags_OutputFile = 1 << 1,
+ ImGuiLogFlags_OutputBuffer = 1 << 2,
+ ImGuiLogFlags_OutputClipboard = 1 << 3,
+ ImGuiLogFlags_OutputMask_ = ImGuiLogFlags_OutputTTY | ImGuiLogFlags_OutputFile | ImGuiLogFlags_OutputBuffer | ImGuiLogFlags_OutputClipboard,
};
// X/Y enums are fixed to 0/1 so they may be used to index ImVec2
@@ -949,52 +1063,6 @@ enum ImGuiPlotType
ImGuiPlotType_Histogram,
};
-enum ImGuiPopupPositionPolicy
-{
- ImGuiPopupPositionPolicy_Default,
- ImGuiPopupPositionPolicy_ComboBox,
- ImGuiPopupPositionPolicy_Tooltip,
-};
-
-struct ImGuiDataTypeTempStorage
-{
- ImU8 Data[8]; // Can fit any data up to ImGuiDataType_COUNT
-};
-
-// Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo().
-struct ImGuiDataTypeInfo
-{
- size_t Size; // Size in bytes
- const char* Name; // Short descriptive name for the type, for debugging
- const char* PrintFmt; // Default printf format for the type
- const char* ScanFmt; // Default scanf format for the type
-};
-
-// Extend ImGuiDataType_
-enum ImGuiDataTypePrivate_
-{
- ImGuiDataType_String = ImGuiDataType_COUNT + 1,
- ImGuiDataType_Pointer,
- ImGuiDataType_ID,
-};
-
-// Stacked color modifier, backup of modified data so we can restore it
-struct ImGuiColorMod
-{
- ImGuiCol Col;
- ImVec4 BackupValue;
-};
-
-// Stacked style modifier, backup of modified data so we can restore it. Data type inferred from the variable.
-struct ImGuiStyleMod
-{
- ImGuiStyleVar VarIdx;
- union { int BackupInt[2]; float BackupFloat[2]; };
- ImGuiStyleMod(ImGuiStyleVar idx, int v) { VarIdx = idx; BackupInt[0] = v; }
- ImGuiStyleMod(ImGuiStyleVar idx, float v) { VarIdx = idx; BackupFloat[0] = v; }
- ImGuiStyleMod(ImGuiStyleVar idx, ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; }
-};
-
// Storage data for BeginComboPreview()/EndComboPreview()
struct IMGUI_API ImGuiComboPreviewData
{
@@ -1014,13 +1082,15 @@ struct IMGUI_API ImGuiGroupData
ImGuiID WindowID;
ImVec2 BackupCursorPos;
ImVec2 BackupCursorMaxPos;
+ ImVec2 BackupCursorPosPrevLine;
ImVec1 BackupIndent;
ImVec1 BackupGroupOffset;
ImVec2 BackupCurrLineSize;
float BackupCurrLineTextBaseOffset;
ImGuiID BackupActiveIdIsAlive;
- bool BackupActiveIdPreviousFrameIsAlive;
+ bool BackupDeactivatedIdIsAlive;
bool BackupHoveredIdIsAlive;
+ bool BackupIsSameLine;
bool EmitItem;
};
@@ -1042,56 +1112,84 @@ struct IMGUI_API ImGuiMenuColumns
void CalcNextTotalWidth(bool update_offsets);
};
+// Internal temporary state for deactivating InputText() instances.
+struct IMGUI_API ImGuiInputTextDeactivatedState
+{
+ ImGuiID ID; // widget id owning the text state (which just got deactivated)
+ ImVector<char> TextA; // text buffer
+
+ ImGuiInputTextDeactivatedState() { memset(this, 0, sizeof(*this)); }
+ void ClearFreeMemory() { ID = 0; TextA.clear(); }
+};
+
+// Forward declare imstb_textedit.h structure + make its main configuration define accessible
+#undef IMSTB_TEXTEDIT_STRING
+#undef IMSTB_TEXTEDIT_CHARTYPE
+#define IMSTB_TEXTEDIT_STRING ImGuiInputTextState
+#define IMSTB_TEXTEDIT_CHARTYPE char
+#define IMSTB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
+#define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99
+#define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999
+namespace ImStb { struct STB_TexteditState; }
+typedef ImStb::STB_TexteditState ImStbTexteditState;
+
// Internal state of the currently focused/edited text input box
// For a given item ID, access with ImGui::GetInputTextState()
struct IMGUI_API ImGuiInputTextState
{
+ ImGuiContext* Ctx; // parent UI context (needs to be set explicitly by parent).
+ ImStbTexteditState* Stb; // State for stb_textedit.h
+ ImGuiInputTextFlags Flags; // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set.
ImGuiID ID; // widget id owning the text state
- int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not.
- ImVector<ImWchar> TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
- ImVector<char> TextA; // temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity.
- ImVector<char> InitialTextA; // backup of end-user buffer at the time of focus (in UTF-8, unaltered)
- bool TextAIsValid; // temporary UTF8 buffer is not initially valid before we make the widget active (until then we pull the data from user argument)
- int BufCapacityA; // end-user buffer capacity
- float ScrollX; // horizontal scrolling/offset
- ImStb::STB_TexteditState Stb; // state for stb_textedit.h
+ int TextLen; // UTF-8 length of the string in TextA (in bytes)
+ const char* TextSrc; // == TextA.Data unless read-only, in which case == buf passed to InputText(). Field only set and valid _inside_ the call InputText() call.
+ ImVector<char> TextA; // main UTF8 buffer. TextA.Size is a buffer size! Should always be >= buf_size passed by user (and of course >= CurLenA + 1).
+ ImVector<char> TextToRevertTo; // value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered)
+ ImVector<char> CallbackTextBackup; // temporary storage for callback to support automatic reconcile of undo-stack
+ int BufCapacity; // end-user buffer capacity (include zero terminator)
+ ImVec2 Scroll; // horizontal offset (managed manually) + vertical scrolling (pulled from child window's own Scroll.y)
float CursorAnim; // timer for cursor blink, reset on every user action so the cursor reappears immediately
bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!)
bool SelectedAllMouseLock; // after a double-click to select all, we ignore further mouse drags to update selection
bool Edited; // edited this frame
- ImGuiInputTextFlags Flags; // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set.
-
- ImGuiInputTextState() { memset(this, 0, sizeof(*this)); }
- void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); }
- void ClearFreeMemory() { TextW.clear(); TextA.clear(); InitialTextA.clear(); }
- int GetUndoAvailCount() const { return Stb.undostate.undo_point; }
- int GetRedoAvailCount() const { return STB_TEXTEDIT_UNDOSTATECOUNT - Stb.undostate.redo_point; }
+ bool WantReloadUserBuf; // force a reload of user buf so it may be modified externally. may be automatic in future version.
+ int ReloadSelectionStart;
+ int ReloadSelectionEnd;
+
+ ImGuiInputTextState();
+ ~ImGuiInputTextState();
+ void ClearText() { TextLen = 0; TextA[0] = 0; CursorClamp(); }
+ void ClearFreeMemory() { TextA.clear(); TextToRevertTo.clear(); }
void OnKeyPressed(int key); // Cannot be inline because we call in code in stb_textedit.h implementation
+ void OnCharPressed(unsigned int c);
// Cursor & Selection
- void CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking
- void CursorClamp() { Stb.cursor = ImMin(Stb.cursor, CurLenW); Stb.select_start = ImMin(Stb.select_start, CurLenW); Stb.select_end = ImMin(Stb.select_end, CurLenW); }
- bool HasSelection() const { return Stb.select_start != Stb.select_end; }
- void ClearSelection() { Stb.select_start = Stb.select_end = Stb.cursor; }
- int GetCursorPos() const { return Stb.cursor; }
- int GetSelectionStart() const { return Stb.select_start; }
- int GetSelectionEnd() const { return Stb.select_end; }
- void SelectAll() { Stb.select_start = 0; Stb.cursor = Stb.select_end = CurLenW; Stb.has_preferred_x = 0; }
-};
-
-// Storage for current popup stack
-struct ImGuiPopupData
-{
- ImGuiID PopupId; // Set on OpenPopup()
- ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
- ImGuiWindow* BackupNavWindow;// Set on OpenPopup(), a NavWindow that will be restored on popup close
- int ParentNavLayer; // Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as "not any of layers" value
- int OpenFrameCount; // Set on OpenPopup()
- ImGuiID OpenParentId; // Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
- ImVec2 OpenPopupPos; // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
- ImVec2 OpenMousePos; // Set on OpenPopup(), copy of mouse position at the time of opening popup
-
- ImGuiPopupData() { memset(this, 0, sizeof(*this)); ParentNavLayer = OpenFrameCount = -1; }
+ void CursorAnimReset();
+ void CursorClamp();
+ bool HasSelection() const;
+ void ClearSelection();
+ int GetCursorPos() const;
+ int GetSelectionStart() const;
+ int GetSelectionEnd() const;
+ void SelectAll();
+
+ // Reload user buf (WIP #2890)
+ // If you modify underlying user-passed const char* while active you need to call this (InputText V2 may lift this)
+ // strcpy(my_buf, "hello");
+ // if (ImGuiInputTextState* state = ImGui::GetInputTextState(id)) // id may be ImGui::GetItemID() is last item
+ // state->ReloadUserBufAndSelectAll();
+ void ReloadUserBufAndSelectAll();
+ void ReloadUserBufAndKeepSelection();
+ void ReloadUserBufAndMoveToEnd();
+};
+
+enum ImGuiWindowRefreshFlags_
+{
+ ImGuiWindowRefreshFlags_None = 0,
+ ImGuiWindowRefreshFlags_TryToAvoidRefresh = 1 << 0, // [EXPERIMENTAL] Try to keep existing contents, USER MUST NOT HONOR BEGIN() RETURNING FALSE AND NOT APPEND.
+ ImGuiWindowRefreshFlags_RefreshOnHover = 1 << 1, // [EXPERIMENTAL] Always refresh on hover
+ ImGuiWindowRefreshFlags_RefreshOnFocus = 1 << 2, // [EXPERIMENTAL] Always refresh on focus
+ // Refresh policy/frequency, Load Balancing etc.
};
enum ImGuiNextWindowDataFlags_
@@ -1105,12 +1203,17 @@ enum ImGuiNextWindowDataFlags_
ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
ImGuiNextWindowDataFlags_HasScroll = 1 << 7,
+ ImGuiNextWindowDataFlags_HasWindowFlags = 1 << 8,
+ ImGuiNextWindowDataFlags_HasChildFlags = 1 << 9,
+ ImGuiNextWindowDataFlags_HasRefreshPolicy = 1 << 10,
};
// Storage for SetNexWindow** functions
struct ImGuiNextWindowData
{
- ImGuiNextWindowDataFlags Flags;
+ ImGuiNextWindowDataFlags HasFlags;
+
+ // Members below are NOT cleared. Always rely on HasFlags.
ImGuiCond PosCond;
ImGuiCond SizeCond;
ImGuiCond CollapsedCond;
@@ -1119,52 +1222,84 @@ struct ImGuiNextWindowData
ImVec2 SizeVal;
ImVec2 ContentSizeVal;
ImVec2 ScrollVal;
+ ImGuiWindowFlags WindowFlags; // Only honored by BeginTable()
+ ImGuiChildFlags ChildFlags;
bool CollapsedVal;
ImRect SizeConstraintRect;
ImGuiSizeCallback SizeCallback;
void* SizeCallbackUserData;
float BgAlphaVal; // Override background alpha
ImVec2 MenuBarOffsetMinVal; // (Always on) This is not exposed publicly, so we don't clear it and it doesn't have a corresponding flag (could we? for consistency?)
+ ImGuiWindowRefreshFlags RefreshFlagsVal;
ImGuiNextWindowData() { memset(this, 0, sizeof(*this)); }
- inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
+ inline void ClearFlags() { HasFlags = ImGuiNextWindowDataFlags_None; }
};
enum ImGuiNextItemDataFlags_
{
- ImGuiNextItemDataFlags_None = 0,
- ImGuiNextItemDataFlags_HasWidth = 1 << 0,
- ImGuiNextItemDataFlags_HasOpen = 1 << 1,
+ ImGuiNextItemDataFlags_None = 0,
+ ImGuiNextItemDataFlags_HasWidth = 1 << 0,
+ ImGuiNextItemDataFlags_HasOpen = 1 << 1,
+ ImGuiNextItemDataFlags_HasShortcut = 1 << 2,
+ ImGuiNextItemDataFlags_HasRefVal = 1 << 3,
+ ImGuiNextItemDataFlags_HasStorageID = 1 << 4,
};
struct ImGuiNextItemData
{
- ImGuiNextItemDataFlags Flags;
- float Width; // Set by SetNextItemWidth()
- ImGuiID FocusScopeId; // Set by SetNextItemMultiSelectData() (!= 0 signify value has been set, so it's an alternate version of HasSelectionData, we don't use Flags for this because they are cleared too early. This is mostly used for debugging)
- ImGuiCond OpenCond;
- bool OpenVal; // Set by SetNextItemOpen()
+ ImGuiNextItemDataFlags HasFlags; // Called HasFlags instead of Flags to avoid mistaking this
+ ImGuiItemFlags ItemFlags; // Currently only tested/used for ImGuiItemFlags_AllowOverlap and ImGuiItemFlags_HasSelectionUserData.
+
+ // Members below are NOT cleared by ItemAdd() meaning they are still valid during e.g. NavProcessItem(). Always rely on HasFlags.
+ ImGuiID FocusScopeId; // Set by SetNextItemSelectionUserData()
+ ImGuiSelectionUserData SelectionUserData; // Set by SetNextItemSelectionUserData() (note that NULL/0 is a valid value, we use -1 == ImGuiSelectionUserData_Invalid to mark invalid values)
+ float Width; // Set by SetNextItemWidth()
+ ImGuiKeyChord Shortcut; // Set by SetNextItemShortcut()
+ ImGuiInputFlags ShortcutFlags; // Set by SetNextItemShortcut()
+ bool OpenVal; // Set by SetNextItemOpen()
+ ImU8 OpenCond; // Set by SetNextItemOpen()
+ ImGuiDataTypeStorage RefVal; // Not exposed yet, for ImGuiInputTextFlags_ParseEmptyAsRefVal
+ ImGuiID StorageId; // Set by SetNextItemStorageID()
- ImGuiNextItemData() { memset(this, 0, sizeof(*this)); }
- inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; } // Also cleared manually by ItemAdd()!
+ ImGuiNextItemData() { memset(this, 0, sizeof(*this)); SelectionUserData = -1; }
+ inline void ClearFlags() { HasFlags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; } // Also cleared manually by ItemAdd()!
};
// Status storage for the last submitted item
struct ImGuiLastItemData
{
ImGuiID ID;
- ImGuiItemFlags InFlags; // See ImGuiItemFlags_
+ ImGuiItemFlags ItemFlags; // See ImGuiItemFlags_ (called 'InFlags' before v1.91.4).
ImGuiItemStatusFlags StatusFlags; // See ImGuiItemStatusFlags_
ImRect Rect; // Full rectangle
ImRect NavRect; // Navigation scoring rectangle (not displayed)
- ImRect DisplayRect; // Display rectangle (only if ImGuiItemStatusFlags_HasDisplayRect is set)
+ // Rarely used fields are not explicitly cleared, only valid when the corresponding ImGuiItemStatusFlags are set.
+ ImRect DisplayRect; // Display rectangle. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasDisplayRect) is set.
+ ImRect ClipRect; // Clip rectangle at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasClipRect) is set..
+ ImGuiKeyChord Shortcut; // Shortcut at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasShortcut) is set..
ImGuiLastItemData() { memset(this, 0, sizeof(*this)); }
};
-struct IMGUI_API ImGuiStackSizes
+// Store data emitted by TreeNode() for usage by TreePop()
+// - To implement ImGuiTreeNodeFlags_NavLeftJumpsBackHere: store the minimum amount of data
+// which we can't infer in TreePop(), to perform the equivalent of NavApplyItemToResult().
+// Only stored when the node is a potential candidate for landing on a Left arrow jump.
+struct ImGuiTreeNodeStackData
{
+ ImGuiID ID;
+ ImGuiTreeNodeFlags TreeFlags;
+ ImGuiItemFlags ItemFlags; // Used for nav landing
+ ImRect NavRect; // Used for nav landing
+};
+
+// sizeof() = 20
+struct IMGUI_API ImGuiErrorRecoveryState
+{
+ short SizeOfWindowStack;
short SizeOfIDStack;
+ short SizeOfTreeStack;
short SizeOfColorStack;
short SizeOfStyleVarStack;
short SizeOfFontStack;
@@ -1174,9 +1309,7 @@ struct IMGUI_API ImGuiStackSizes
short SizeOfBeginPopupStack;
short SizeOfDisabledStack;
- ImGuiStackSizes() { memset(this, 0, sizeof(*this)); }
- void SetToCurrentState();
- void CompareWithCurrentState();
+ ImGuiErrorRecoveryState() { memset(this, 0, sizeof(*this)); }
};
// Data saved for each window pushed into the stack
@@ -1184,7 +1317,9 @@ struct ImGuiWindowStackData
{
ImGuiWindow* Window;
ImGuiLastItemData ParentLastItemDataBackup;
- ImGuiStackSizes StackSizesOnBegin; // Store size of various stacks for asserting
+ ImGuiErrorRecoveryState StackSizesInBegin; // Store size of various stacks for asserting
+ bool DisabledOverrideReenable; // Non-child window override disabled flag
+ float DisabledOverrideReenableAlphaBackup;
};
struct ImGuiShrinkWidthItem
@@ -1203,10 +1338,46 @@ struct ImGuiPtrOrIndex
ImGuiPtrOrIndex(int index) { Ptr = NULL; Index = index; }
};
+// Data used by IsItemDeactivated()/IsItemDeactivatedAfterEdit() functions
+struct ImGuiDeactivatedItemData
+{
+ ImGuiID ID;
+ int ElapseFrame;
+ bool HasBeenEditedBefore;
+ bool IsAlive;
+};
+
+//-----------------------------------------------------------------------------
+// [SECTION] Popup support
+//-----------------------------------------------------------------------------
+
+enum ImGuiPopupPositionPolicy
+{
+ ImGuiPopupPositionPolicy_Default,
+ ImGuiPopupPositionPolicy_ComboBox,
+ ImGuiPopupPositionPolicy_Tooltip,
+};
+
+// Storage for popup stacks (g.OpenPopupStack and g.BeginPopupStack)
+struct ImGuiPopupData
+{
+ ImGuiID PopupId; // Set on OpenPopup()
+ ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
+ ImGuiWindow* RestoreNavWindow;// Set on OpenPopup(), a NavWindow that will be restored on popup close
+ int ParentNavLayer; // Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as "not any of layers" value
+ int OpenFrameCount; // Set on OpenPopup()
+ ImGuiID OpenParentId; // Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
+ ImVec2 OpenPopupPos; // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
+ ImVec2 OpenMousePos; // Set on OpenPopup(), copy of mouse position at the time of opening popup
+
+ ImGuiPopupData() { memset(this, 0, sizeof(*this)); ParentNavLayer = OpenFrameCount = -1; }
+};
+
//-----------------------------------------------------------------------------
// [SECTION] Inputs support
//-----------------------------------------------------------------------------
+// Bit array for named keys
typedef ImBitArray<ImGuiKey_NamedKey_COUNT, -ImGuiKey_NamedKey_BEGIN> ImBitArrayForNamedKeys;
// [Internal] Key ranges
@@ -1226,8 +1397,8 @@ typedef ImBitArray<ImGuiKey_NamedKey_COUNT, -ImGuiKey_NamedKey_BEGIN> ImBitAr
#define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift
#define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1
#define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1
-#define ImGuiKey_NavGamepadActivate ImGuiKey_GamepadFaceDown
-#define ImGuiKey_NavGamepadCancel ImGuiKey_GamepadFaceRight
+#define ImGuiKey_NavGamepadActivate (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceRight : ImGuiKey_GamepadFaceDown)
+#define ImGuiKey_NavGamepadCancel (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceDown : ImGuiKey_GamepadFaceRight)
#define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft
#define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp
@@ -1246,19 +1417,17 @@ enum ImGuiInputEventType
enum ImGuiInputSource
{
ImGuiInputSource_None = 0,
- ImGuiInputSource_Mouse,
+ ImGuiInputSource_Mouse, // Note: may be Mouse or TouchScreen or Pen. See io.MouseSource to distinguish them.
ImGuiInputSource_Keyboard,
ImGuiInputSource_Gamepad,
- ImGuiInputSource_Clipboard, // Currently only used by InputText()
- ImGuiInputSource_Nav, // Stored in g.ActiveIdSource only
ImGuiInputSource_COUNT
};
// FIXME: Structures in the union below need to be declared as anonymous unions appears to be an extension?
// Using ImVec2() would fail on Clang 'union member 'MousePos' has a non-trivial default constructor'
-struct ImGuiInputEventMousePos { float PosX, PosY; };
-struct ImGuiInputEventMouseWheel { float WheelX, WheelY; };
-struct ImGuiInputEventMouseButton { int Button; bool Down; };
+struct ImGuiInputEventMousePos { float PosX, PosY; ImGuiMouseSource MouseSource; };
+struct ImGuiInputEventMouseWheel { float WheelX, WheelY; ImGuiMouseSource MouseSource; };
+struct ImGuiInputEventMouseButton { int Button; bool Down; ImGuiMouseSource MouseSource; };
struct ImGuiInputEventKey { ImGuiKey Key; bool Down; float AnalogValue; };
struct ImGuiInputEventText { unsigned int Char; };
struct ImGuiInputEventAppFocused { bool Focused; };
@@ -1267,6 +1436,7 @@ struct ImGuiInputEvent
{
ImGuiInputEventType Type;
ImGuiInputSource Source;
+ ImU32 EventId; // Unique, sequential increasing integer to identify an event (if you need to correlate them to other data).
union
{
ImGuiInputEventMousePos MousePos; // if Type == ImGuiInputEventType_MousePos
@@ -1283,7 +1453,8 @@ struct ImGuiInputEvent
// Input function taking an 'ImGuiID owner_id' argument defaults to (ImGuiKeyOwner_Any == 0) aka don't test ownership, which matches legacy behavior.
#define ImGuiKeyOwner_Any ((ImGuiID)0) // Accept key that have an owner, UNLESS a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease.
-#define ImGuiKeyOwner_None ((ImGuiID)-1) // Require key to have no owner.
+#define ImGuiKeyOwner_NoOwner ((ImGuiID)-1) // Require key to have no owner.
+//#define ImGuiKeyOwner_None ImGuiKeyOwner_NoOwner // We previously called this 'ImGuiKeyOwner_None' but it was inconsistent with our pattern that _None values == 0 and quite dangerous. Also using _NoOwner makes the IsKeyPressed() calls more explicit.
typedef ImS16 ImGuiKeyRoutingIndex;
@@ -1291,12 +1462,13 @@ typedef ImS16 ImGuiKeyRoutingIndex;
struct ImGuiKeyRoutingData
{
ImGuiKeyRoutingIndex NextEntryIndex;
- ImU16 Mods; // Technically we'd only need 4 bits but for simplify we store ImGuiMod_ values which need 16 bits.
+ ImU16 Mods; // Technically we'd only need 4-bits but for simplify we store ImGuiMod_ values which need 16-bits.
+ ImU8 RoutingCurrScore; // [DEBUG] For debug display
ImU8 RoutingNextScore; // Lower is better (0: perfect score)
ImGuiID RoutingCurr;
ImGuiID RoutingNext;
- ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_None; }
+ ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingCurrScore = RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_NoOwner; }
};
// Routing table: maintain a desired owner for each possible key-chord (key + mods), and setup owner in NewFrame() when mods are matching.
@@ -1320,53 +1492,47 @@ struct ImGuiKeyOwnerData
bool LockThisFrame; // Reading this key requires explicit owner id (until end of frame). Set by ImGuiInputFlags_LockThisFrame.
bool LockUntilRelease; // Reading this key requires explicit owner id (until key is released). Set by ImGuiInputFlags_LockUntilRelease. When this is true LockThisFrame is always true as well.
- ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_None; LockThisFrame = LockUntilRelease = false; }
+ ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_NoOwner; LockThisFrame = LockUntilRelease = false; }
};
+// Extend ImGuiInputFlags_
// Flags for extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner()
-// Don't mistake with ImGuiInputTextFlags! (for ImGui::InputText() function)
-enum ImGuiInputFlags_
-{
- // Flags for IsKeyPressed(), IsMouseClicked(), Shortcut()
- ImGuiInputFlags_None = 0,
- ImGuiInputFlags_Repeat = 1 << 0, // Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1.
- ImGuiInputFlags_RepeatRateDefault = 1 << 1, // Repeat rate: Regular (default)
- ImGuiInputFlags_RepeatRateNavMove = 1 << 2, // Repeat rate: Fast
- ImGuiInputFlags_RepeatRateNavTweak = 1 << 3, // Repeat rate: Faster
- ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
-
- // Flags for SetItemKeyOwner()
- ImGuiInputFlags_CondHovered = 1 << 4, // Only set if item is hovered (default to both)
- ImGuiInputFlags_CondActive = 1 << 5, // Only set if item is active (default to both)
- ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
- ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
+// Don't mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function)
+enum ImGuiInputFlagsPrivate_
+{
+ // Flags for IsKeyPressed(), IsKeyChordPressed(), IsMouseClicked(), Shortcut()
+ // - Repeat mode: Repeat rate selection
+ ImGuiInputFlags_RepeatRateDefault = 1 << 1, // Repeat rate: Regular (default)
+ ImGuiInputFlags_RepeatRateNavMove = 1 << 2, // Repeat rate: Fast
+ ImGuiInputFlags_RepeatRateNavTweak = 1 << 3, // Repeat rate: Faster
+ // - Repeat mode: Specify when repeating key pressed can be interrupted.
+ // - In theory ImGuiInputFlags_RepeatUntilOtherKeyPress may be a desirable default, but it would break too many behavior so everything is opt-in.
+ ImGuiInputFlags_RepeatUntilRelease = 1 << 4, // Stop repeating when released (default for all functions except Shortcut). This only exists to allow overriding Shortcut() default behavior.
+ ImGuiInputFlags_RepeatUntilKeyModsChange = 1 << 5, // Stop repeating when released OR if keyboard mods are changed (default for Shortcut)
+ ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone = 1 << 6, // Stop repeating when released OR if keyboard mods are leaving the None state. Allows going from Mod+Key to Key by releasing Mod.
+ ImGuiInputFlags_RepeatUntilOtherKeyPress = 1 << 7, // Stop repeating when released OR if any other keyboard key is pressed during the repeat
// Flags for SetKeyOwner(), SetItemKeyOwner()
- ImGuiInputFlags_LockThisFrame = 1 << 6, // Access to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared at end of frame. This is useful to make input-owner-aware code steal keys from non-input-owner-aware code.
- ImGuiInputFlags_LockUntilRelease = 1 << 7, // Access to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared when the key is released or at end of each frame if key is released. This is useful to make input-owner-aware code steal keys from non-input-owner-aware code.
+ // - Locking key away from non-input aware code. Locking is useful to make input-owner-aware code steal keys from non-input-owner-aware code. If all code is input-owner-aware locking would never be necessary.
+ ImGuiInputFlags_LockThisFrame = 1 << 20, // Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared at end of frame.
+ ImGuiInputFlags_LockUntilRelease = 1 << 21, // Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared when the key is released or at end of each frame if key is released.
- // Routing policies for Shortcut() + low-level SetShortcutRouting()
- // - The general idea is that several callers register interest in a shortcut, and only one owner gets it.
- // - When a policy (other than _RouteAlways) is set, Shortcut() will register itself with SetShortcutRouting(),
- // allowing the system to decide where to route the input among other route-aware calls.
- // - Shortcut() uses ImGuiInputFlags_RouteFocused by default: meaning that a simple Shortcut() poll
- // will register a route and only succeed when parent window is in the focus stack and if no-one
- // with a higher priority is claiming the shortcut.
- // - Using ImGuiInputFlags_RouteAlways is roughly equivalent to doing e.g. IsKeyPressed(key) + testing mods.
- // - Priorities: GlobalHigh > Focused (when owner is active item) > Global > Focused (when focused window) > GlobalLow.
- // - Can select only 1 policy among all available.
- ImGuiInputFlags_RouteFocused = 1 << 8, // (Default) Register focused route: Accept inputs if window is in focus stack. Deep-most focused window takes inputs. ActiveId takes inputs over deep-most focused window.
- ImGuiInputFlags_RouteGlobalLow = 1 << 9, // Register route globally (lowest priority: unless a focused window or active item registered the route) -> recommended Global priority.
- ImGuiInputFlags_RouteGlobal = 1 << 10, // Register route globally (medium priority: unless an active item registered the route, e.g. CTRL+A registered by InputText).
- ImGuiInputFlags_RouteGlobalHigh = 1 << 11, // Register route globally (highest priority: unlikely you need to use that: will interfere with every active items)
- ImGuiInputFlags_RouteMask_ = ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteGlobalLow | ImGuiInputFlags_RouteGlobalHigh, // _Always not part of this!
- ImGuiInputFlags_RouteAlways = 1 << 12, // Do not register route, poll keys directly.
- ImGuiInputFlags_RouteUnlessBgFocused= 1 << 13, // Global routes will not be applied if underlying background/void is focused (== no Dear ImGui windows are focused). Useful for overlay applications.
- ImGuiInputFlags_RouteExtraMask_ = ImGuiInputFlags_RouteAlways | ImGuiInputFlags_RouteUnlessBgFocused,
+ // - Condition for SetItemKeyOwner()
+ ImGuiInputFlags_CondHovered = 1 << 22, // Only set if item is hovered (default to both)
+ ImGuiInputFlags_CondActive = 1 << 23, // Only set if item is active (default to both)
+ ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
// [Internal] Mask of which function support which flags
- ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_,
- ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RouteMask_ | ImGuiInputFlags_RouteExtraMask_,
+ ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
+ ImGuiInputFlags_RepeatUntilMask_ = ImGuiInputFlags_RepeatUntilRelease | ImGuiInputFlags_RepeatUntilKeyModsChange | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone | ImGuiInputFlags_RepeatUntilOtherKeyPress,
+ ImGuiInputFlags_RepeatMask_ = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_,
+ ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
+ ImGuiInputFlags_RouteTypeMask_ = ImGuiInputFlags_RouteActive | ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteAlways,
+ ImGuiInputFlags_RouteOptionsMask_ = ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused | ImGuiInputFlags_RouteFromRootWindow,
+ ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_RepeatMask_,
+ ImGuiInputFlags_SupportedByIsMouseClicked = ImGuiInputFlags_Repeat,
+ ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_,
+ ImGuiInputFlags_SupportedBySetNextItemShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | ImGuiInputFlags_Tooltip,
ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease,
ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_,
};
@@ -1375,6 +1541,7 @@ enum ImGuiInputFlags_
// [SECTION] Clipper support
//-----------------------------------------------------------------------------
+// Note that Max is exclusive, so perhaps should be using a Begin/End convention.
struct ImGuiListClipperRange
{
int Min;
@@ -1407,9 +1574,11 @@ struct ImGuiListClipperData
enum ImGuiActivateFlags_
{
ImGuiActivateFlags_None = 0,
- ImGuiActivateFlags_PreferInput = 1 << 0, // Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default if keyboard is available.
- ImGuiActivateFlags_PreferTweak = 1 << 1, // Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default if keyboard is not available.
+ ImGuiActivateFlags_PreferInput = 1 << 0, // Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default for Enter key.
+ ImGuiActivateFlags_PreferTweak = 1 << 1, // Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default for Space key and if keyboard is not used.
ImGuiActivateFlags_TryToPreserveState = 1 << 2, // Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection)
+ ImGuiActivateFlags_FromTabbing = 1 << 3, // Activation requested by a tabbing request
+ ImGuiActivateFlags_FromShortcut = 1 << 4, // Activation requested by an item shortcut via SetNextItemShortcut() function.
};
// Early work-in-progress API for ScrollToItem()
@@ -1427,13 +1596,18 @@ enum ImGuiScrollFlags_
ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
};
-enum ImGuiNavHighlightFlags_
+enum ImGuiNavRenderCursorFlags_
{
- ImGuiNavHighlightFlags_None = 0,
- ImGuiNavHighlightFlags_TypeDefault = 1 << 0,
- ImGuiNavHighlightFlags_TypeThin = 1 << 1,
- ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) _even_ when using the mouse.
- ImGuiNavHighlightFlags_NoRounding = 1 << 3,
+ ImGuiNavRenderCursorFlags_None = 0,
+ ImGuiNavRenderCursorFlags_Compact = 1 << 1, // Compact highlight, no padding/distance from focused item
+ ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) even when g.NavCursorVisible == false, aka even when using the mouse.
+ ImGuiNavRenderCursorFlags_NoRounding = 1 << 3,
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiNavHighlightFlags_None = ImGuiNavRenderCursorFlags_None, // Renamed in 1.91.4
+ ImGuiNavHighlightFlags_Compact = ImGuiNavRenderCursorFlags_Compact, // Renamed in 1.91.4
+ ImGuiNavHighlightFlags_AlwaysDraw = ImGuiNavRenderCursorFlags_AlwaysDraw, // Renamed in 1.91.4
+ ImGuiNavHighlightFlags_NoRounding = ImGuiNavRenderCursorFlags_NoRounding, // Renamed in 1.91.4
+#endif
};
enum ImGuiNavMoveFlags_
@@ -1443,15 +1617,19 @@ enum ImGuiNavMoveFlags_
ImGuiNavMoveFlags_LoopY = 1 << 1,
ImGuiNavMoveFlags_WrapX = 1 << 2, // On failed request, request from opposite side one line down (when NavDir==right) or one line up (when NavDir==left)
ImGuiNavMoveFlags_WrapY = 1 << 3, // This is not super useful but provided for completeness
+ ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY,
ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4, // Allow scoring and considering the current NavId as a move target candidate. This is used when the move source is offset (e.g. pressing PageDown actually needs to send a Up move request, if we are pressing PageDown from the bottom-most item we need to stay in place)
ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5, // Store alternate result in NavMoveResultLocalVisible that only comprise elements that are already fully visible (used by PageUp/PageDown)
ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6, // Force scrolling to min/max (used by Home/End) // FIXME-NAV: Aim to remove or reword, probably unnecessary
ImGuiNavMoveFlags_Forwarded = 1 << 7,
ImGuiNavMoveFlags_DebugNoResult = 1 << 8, // Dummy scoring for debug purpose, don't apply result
- ImGuiNavMoveFlags_FocusApi = 1 << 9,
- ImGuiNavMoveFlags_Tabbing = 1 << 10, // == Focus + Activate if item is Inputable + DontChangeNavHighlight
- ImGuiNavMoveFlags_Activate = 1 << 11,
- ImGuiNavMoveFlags_DontSetNavHighlight = 1 << 12, // Do not alter the visible state of keyboard vs mouse nav highlight
+ ImGuiNavMoveFlags_FocusApi = 1 << 9, // Requests from focus API can land/focus/activate items even if they are marked with _NoTabStop (see NavProcessItemForTabbingRequest() for details)
+ ImGuiNavMoveFlags_IsTabbing = 1 << 10, // == Focus + Activate if item is Inputable + DontChangeNavHighlight
+ ImGuiNavMoveFlags_IsPageMove = 1 << 11, // Identify a PageDown/PageUp request.
+ ImGuiNavMoveFlags_Activate = 1 << 12, // Activate/select target item.
+ ImGuiNavMoveFlags_NoSelect = 1 << 13, // Don't trigger selection by not setting g.NavJustMovedTo
+ ImGuiNavMoveFlags_NoSetNavCursorVisible = 1 << 14, // Do not alter the nav cursor visible state
+ ImGuiNavMoveFlags_NoClearActiveId = 1 << 15, // (Experimental) Do not clear active id when applying move result
};
enum ImGuiNavLayer
@@ -1461,26 +1639,72 @@ enum ImGuiNavLayer
ImGuiNavLayer_COUNT
};
+// Storage for navigation query/results
struct ImGuiNavItemData
{
ImGuiWindow* Window; // Init,Move // Best candidate window (result->ItemWindow->RootWindowForNav == request->Window)
ImGuiID ID; // Init,Move // Best candidate item ID
ImGuiID FocusScopeId; // Init,Move // Best candidate focus scope ID
ImRect RectRel; // Init,Move // Best candidate bounding box in window relative space
- ImGuiItemFlags InFlags; // ????,Move // Best candidate item flags
+ ImGuiItemFlags ItemFlags; // ????,Move // Best candidate item flags
float DistBox; // Move // Best candidate box distance to current NavId
float DistCenter; // Move // Best candidate center distance to current NavId
float DistAxial; // Move // Best candidate axial distance to current NavId
+ ImGuiSelectionUserData SelectionUserData;//I+Mov // Best candidate SetNextItemSelectionUserData() value. Valid if (ItemFlags & ImGuiItemFlags_HasSelectionUserData)
ImGuiNavItemData() { Clear(); }
- void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; DistBox = DistCenter = DistAxial = FLT_MAX; }
+ void Clear() { Window = NULL; ID = FocusScopeId = 0; ItemFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
+};
+
+// Storage for PushFocusScope(), g.FocusScopeStack[], g.NavFocusRoute[]
+struct ImGuiFocusScopeData
+{
+ ImGuiID ID;
+ ImGuiID WindowID;
+};
+
+//-----------------------------------------------------------------------------
+// [SECTION] Typing-select support
+//-----------------------------------------------------------------------------
+
+// Flags for GetTypingSelectRequest()
+enum ImGuiTypingSelectFlags_
+{
+ ImGuiTypingSelectFlags_None = 0,
+ ImGuiTypingSelectFlags_AllowBackspace = 1 << 0, // Backspace to delete character inputs. If using: ensure GetTypingSelectRequest() is not called more than once per frame (filter by e.g. focus state)
+ ImGuiTypingSelectFlags_AllowSingleCharMode = 1 << 1, // Allow "single char" search mode which is activated when pressing the same character multiple times.
+};
+
+// Returned by GetTypingSelectRequest(), designed to eventually be public.
+struct IMGUI_API ImGuiTypingSelectRequest
+{
+ ImGuiTypingSelectFlags Flags; // Flags passed to GetTypingSelectRequest()
+ int SearchBufferLen;
+ const char* SearchBuffer; // Search buffer contents (use full string. unless SingleCharMode is set, in which case use SingleCharSize).
+ bool SelectRequest; // Set when buffer was modified this frame, requesting a selection.
+ bool SingleCharMode; // Notify when buffer contains same character repeated, to implement special mode. In this situation it preferred to not display any on-screen search indication.
+ ImS8 SingleCharSize; // Length in bytes of first letter codepoint (1 for ascii, 2-4 for UTF-8). If (SearchBufferLen==RepeatCharSize) only 1 letter has been input.
+};
+
+// Storage for GetTypingSelectRequest()
+struct IMGUI_API ImGuiTypingSelectState
+{
+ ImGuiTypingSelectRequest Request; // User-facing data
+ char SearchBuffer[64]; // Search buffer: no need to make dynamic as this search is very transient.
+ ImGuiID FocusScope;
+ int LastRequestFrame = 0;
+ float LastRequestTime = 0.0f;
+ bool SingleCharModeLock = false; // After a certain single char repeat count we lock into SingleCharMode. Two benefits: 1) buffer never fill, 2) we can provide an immediate SingleChar mode without timer elapsing.
+
+ ImGuiTypingSelectState() { memset(this, 0, sizeof(*this)); }
+ void Clear() { SearchBuffer[0] = 0; SingleCharModeLock = false; } // We preserve remaining data for easier debugging
};
//-----------------------------------------------------------------------------
// [SECTION] Columns support
//-----------------------------------------------------------------------------
-// Flags for internal's BeginColumns(). Prefix using BeginTable() nowadays!
+// Flags for internal's BeginColumns(). This is an obsolete API. Prefer using BeginTable() nowadays!
enum ImGuiOldColumnFlags_
{
ImGuiOldColumnFlags_None = 0,
@@ -1488,16 +1712,16 @@ enum ImGuiOldColumnFlags_
ImGuiOldColumnFlags_NoResize = 1 << 1, // Disable resizing columns when clicking on the dividers
ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2, // Disable column width preservation when adjusting columns
ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3, // Disable forcing columns to fit within window
- ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4, // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
+ ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4, // Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
// Obsolete names (will be removed)
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None,
- ImGuiColumnsFlags_NoBorder = ImGuiOldColumnFlags_NoBorder,
- ImGuiColumnsFlags_NoResize = ImGuiOldColumnFlags_NoResize,
- ImGuiColumnsFlags_NoPreserveWidths = ImGuiOldColumnFlags_NoPreserveWidths,
- ImGuiColumnsFlags_NoForceWithinWindow = ImGuiOldColumnFlags_NoForceWithinWindow,
- ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize,
+ //ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None,
+ //ImGuiColumnsFlags_NoBorder = ImGuiOldColumnFlags_NoBorder,
+ //ImGuiColumnsFlags_NoResize = ImGuiOldColumnFlags_NoResize,
+ //ImGuiColumnsFlags_NoPreserveWidths = ImGuiOldColumnFlags_NoPreserveWidths,
+ //ImGuiColumnsFlags_NoForceWithinWindow = ImGuiOldColumnFlags_NoForceWithinWindow,
+ //ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize,
#endif
};
@@ -1533,12 +1757,79 @@ struct ImGuiOldColumns
};
//-----------------------------------------------------------------------------
+// [SECTION] Box-select support
+//-----------------------------------------------------------------------------
+
+struct ImGuiBoxSelectState
+{
+ // Active box-selection data (persistent, 1 active at a time)
+ ImGuiID ID;
+ bool IsActive;
+ bool IsStarting;
+ bool IsStartedFromVoid; // Starting click was not from an item.
+ bool IsStartedSetNavIdOnce;
+ bool RequestClear;
+ ImGuiKeyChord KeyMods : 16; // Latched key-mods for box-select logic.
+ ImVec2 StartPosRel; // Start position in window-contents relative space (to support scrolling)
+ ImVec2 EndPosRel; // End position in window-contents relative space
+ ImVec2 ScrollAccum; // Scrolling accumulator (to behave at high-frame spaces)
+ ImGuiWindow* Window;
+
+ // Temporary/Transient data
+ bool UnclipMode; // (Temp/Transient, here in hot area). Set/cleared by the BeginMultiSelect()/EndMultiSelect() owning active box-select.
+ ImRect UnclipRect; // Rectangle where ItemAdd() clipping may be temporarily disabled. Need support by multi-select supporting widgets.
+ ImRect BoxSelectRectPrev; // Selection rectangle in absolute coordinates (derived every frame from BoxSelectStartPosRel and MousePos)
+ ImRect BoxSelectRectCurr;
+
+ ImGuiBoxSelectState() { memset(this, 0, sizeof(*this)); }
+};
+
+//-----------------------------------------------------------------------------
// [SECTION] Multi-select support
//-----------------------------------------------------------------------------
-#ifdef IMGUI_HAS_MULTI_SELECT
-// <this is filled in 'range_select' branch>
-#endif // #ifdef IMGUI_HAS_MULTI_SELECT
+// We always assume that -1 is an invalid value (which works for indices and pointers)
+#define ImGuiSelectionUserData_Invalid ((ImGuiSelectionUserData)-1)
+
+// Temporary storage for multi-select
+struct IMGUI_API ImGuiMultiSelectTempData
+{
+ ImGuiMultiSelectIO IO; // MUST BE FIRST FIELD. Requests are set and returned by BeginMultiSelect()/EndMultiSelect() + written to by user during the loop.
+ ImGuiMultiSelectState* Storage;
+ ImGuiID FocusScopeId; // Copied from g.CurrentFocusScopeId (unless another selection scope was pushed manually)
+ ImGuiMultiSelectFlags Flags;
+ ImVec2 ScopeRectMin;
+ ImVec2 BackupCursorMaxPos;
+ ImGuiSelectionUserData LastSubmittedItem; // Copy of last submitted item data, used to merge output ranges.
+ ImGuiID BoxSelectId;
+ ImGuiKeyChord KeyMods;
+ ImS8 LoopRequestSetAll; // -1: no operation, 0: clear all, 1: select all.
+ bool IsEndIO; // Set when switching IO from BeginMultiSelect() to EndMultiSelect() state.
+ bool IsFocused; // Set if currently focusing the selection scope (any item of the selection). May be used if you have custom shortcut associated to selection.
+ bool IsKeyboardSetRange; // Set by BeginMultiSelect() when using Shift+Navigation. Because scrolling may be affected we can't afford a frame of lag with Shift+Navigation.
+ bool NavIdPassedBy;
+ bool RangeSrcPassedBy; // Set by the item that matches RangeSrcItem.
+ bool RangeDstPassedBy; // Set by the item that matches NavJustMovedToId when IsSetRange is set.
+
+ ImGuiMultiSelectTempData() { Clear(); }
+ void Clear() { size_t io_sz = sizeof(IO); ClearIO(); memset((void*)(&IO + 1), 0, sizeof(*this) - io_sz); } // Zero-clear except IO as we preserve IO.Requests[] buffer allocation.
+ void ClearIO() { IO.Requests.resize(0); IO.RangeSrcItem = IO.NavIdItem = ImGuiSelectionUserData_Invalid; IO.NavIdSelected = IO.RangeSrcReset = false; }
+};
+
+// Persistent storage for multi-select (as long as selection is alive)
+struct IMGUI_API ImGuiMultiSelectState
+{
+ ImGuiWindow* Window;
+ ImGuiID ID;
+ int LastFrameActive; // Last used frame-count, for GC.
+ int LastSelectionSize; // Set by BeginMultiSelect() based on optional info provided by user. May be -1 if unknown.
+ ImS8 RangeSelected; // -1 (don't have) or true/false
+ ImS8 NavIdSelected; // -1 (don't have) or true/false
+ ImGuiSelectionUserData RangeSrcItem; //
+ ImGuiSelectionUserData NavIdItem; // SetNextItemSelectionUserData() value for NavId (if part of submitted items)
+
+ ImGuiMultiSelectState() { Window = NULL; ID = 0; LastFrameActive = LastSelectionSize = 0; RangeSelected = NavIdSelected = -1; RangeSrcItem = NavIdItem = ImGuiSelectionUserData_Invalid; }
+};
//-----------------------------------------------------------------------------
// [SECTION] Docking support
@@ -1556,28 +1847,32 @@ struct ImGuiOldColumns
// Every instance of ImGuiViewport is in fact a ImGuiViewportP.
struct ImGuiViewportP : public ImGuiViewport
{
- int DrawListsLastFrame[2]; // Last frame number the background (0) and foreground (1) draw lists were used
- ImDrawList* DrawLists[2]; // Convenience background (0) and foreground (1) draw lists. We use them to draw software mouser cursor when io.MouseDrawCursor is set and to draw most debug overlays.
+ int BgFgDrawListsLastFrame[2]; // Last frame number the background (0) and foreground (1) draw lists were used
+ ImDrawList* BgFgDrawLists[2]; // Convenience background (0) and foreground (1) draw lists. We use them to draw software mouser cursor when io.MouseDrawCursor is set and to draw most debug overlays.
ImDrawData DrawDataP;
- ImDrawDataBuilder DrawDataBuilder;
+ ImDrawDataBuilder DrawDataBuilder; // Temporary data while building final ImDrawData
- ImVec2 WorkOffsetMin; // Work Area: Offset from Pos to top-left corner of Work Area. Generally (0,0) or (0,+main_menu_bar_height). Work Area is Full Area but without menu-bars/status-bars (so WorkArea always fit inside Pos/Size!)
- ImVec2 WorkOffsetMax; // Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height).
- ImVec2 BuildWorkOffsetMin; // Work Area: Offset being built during current frame. Generally >= 0.0f.
- ImVec2 BuildWorkOffsetMax; // Work Area: Offset being built during current frame. Generally <= 0.0f.
+ // Per-viewport work area
+ // - Insets are >= 0.0f values, distance from viewport corners to work area.
+ // - BeginMainMenuBar() and DockspaceOverViewport() tend to use work area to avoid stepping over existing contents.
+ // - Generally 'safeAreaInsets' in iOS land, 'DisplayCutout' in Android land.
+ ImVec2 WorkInsetMin; // Work Area inset locked for the frame. GetWorkRect() always fits within GetMainRect().
+ ImVec2 WorkInsetMax; // "
+ ImVec2 BuildWorkInsetMin; // Work Area inset accumulator for current frame, to become next frame's WorkInset
+ ImVec2 BuildWorkInsetMax; // "
- ImGuiViewportP() { DrawListsLastFrame[0] = DrawListsLastFrame[1] = -1; DrawLists[0] = DrawLists[1] = NULL; }
- ~ImGuiViewportP() { if (DrawLists[0]) IM_DELETE(DrawLists[0]); if (DrawLists[1]) IM_DELETE(DrawLists[1]); }
+ ImGuiViewportP() { BgFgDrawListsLastFrame[0] = BgFgDrawListsLastFrame[1] = -1; BgFgDrawLists[0] = BgFgDrawLists[1] = NULL; }
+ ~ImGuiViewportP() { if (BgFgDrawLists[0]) IM_DELETE(BgFgDrawLists[0]); if (BgFgDrawLists[1]) IM_DELETE(BgFgDrawLists[1]); }
// Calculate work rect pos/size given a set of offset (we have 1 pair of offset for rect locked from last frame data, and 1 pair for currently building rect)
- ImVec2 CalcWorkRectPos(const ImVec2& off_min) const { return ImVec2(Pos.x + off_min.x, Pos.y + off_min.y); }
- ImVec2 CalcWorkRectSize(const ImVec2& off_min, const ImVec2& off_max) const { return ImVec2(ImMax(0.0f, Size.x - off_min.x + off_max.x), ImMax(0.0f, Size.y - off_min.y + off_max.y)); }
- void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkOffsetMin); WorkSize = CalcWorkRectSize(WorkOffsetMin, WorkOffsetMax); } // Update public fields
+ ImVec2 CalcWorkRectPos(const ImVec2& inset_min) const { return ImVec2(Pos.x + inset_min.x, Pos.y + inset_min.y); }
+ ImVec2 CalcWorkRectSize(const ImVec2& inset_min, const ImVec2& inset_max) const { return ImVec2(ImMax(0.0f, Size.x - inset_min.x - inset_max.x), ImMax(0.0f, Size.y - inset_min.y - inset_max.y)); }
+ void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkInsetMin); WorkSize = CalcWorkRectSize(WorkInsetMin, WorkInsetMax); } // Update public fields
// Helpers to retrieve ImRect (we don't need to store BuildWorkRect as every access tend to change it, hence the code asymmetry)
ImRect GetMainRect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
ImRect GetWorkRect() const { return ImRect(WorkPos.x, WorkPos.y, WorkPos.x + WorkSize.x, WorkPos.y + WorkSize.y); }
- ImRect GetBuildWorkRect() const { ImVec2 pos = CalcWorkRectPos(BuildWorkOffsetMin); ImVec2 size = CalcWorkRectSize(BuildWorkOffsetMin, BuildWorkOffsetMax); return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); }
+ ImRect GetBuildWorkRect() const { ImVec2 pos = CalcWorkRectPos(BuildWorkInsetMin); ImVec2 size = CalcWorkRectSize(BuildWorkInsetMin, BuildWorkInsetMax); return ImRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); }
};
//-----------------------------------------------------------------------------
@@ -1593,7 +1888,9 @@ struct ImGuiWindowSettings
ImVec2ih Pos;
ImVec2ih Size;
bool Collapsed;
+ bool IsChild;
bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
+ bool WantDelete; // Set to invalidate/delete the settings entry
ImGuiWindowSettings() { memset(this, 0, sizeof(*this)); }
char* GetName() { return (char*)(this + 1); }
@@ -1621,6 +1918,7 @@ struct ImGuiSettingsHandler
// This is experimental and not officially supported, it'll probably fall short of features, if/when it does we may backtrack.
enum ImGuiLocKey : int
{
+ ImGuiLocKey_VersionStr,
ImGuiLocKey_TableSizeOne,
ImGuiLocKey_TableSizeAllFit,
ImGuiLocKey_TableSizeAllDefault,
@@ -1628,6 +1926,8 @@ enum ImGuiLocKey : int
ImGuiLocKey_WindowingMainMenuBar,
ImGuiLocKey_WindowingPopup,
ImGuiLocKey_WindowingUntitled,
+ ImGuiLocKey_OpenLink_s,
+ ImGuiLocKey_CopyLink,
ImGuiLocKey_COUNT
};
@@ -1637,44 +1937,80 @@ struct ImGuiLocEntry
const char* Text;
};
+//-----------------------------------------------------------------------------
+// [SECTION] Error handling, State recovery support
+//-----------------------------------------------------------------------------
+
+// Macros used by Recoverable Error handling
+// - Only dispatch error if _EXPR: evaluate as assert (similar to an assert macro).
+// - The message will always be a string literal, in order to increase likelihood of being display by an assert handler.
+// - See 'Demo->Configuration->Error Handling' and ImGuiIO definitions for details on error handling.
+// - Read https://github.com/ocornut/imgui/wiki/Error-Handling for details on error handling.
+#ifndef IM_ASSERT_USER_ERROR
+#define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0) // Recoverable User Error
+#endif
+
+// The error callback is currently not public, as it is expected that only advanced users will rely on it.
+typedef void (*ImGuiErrorCallback)(ImGuiContext* ctx, void* user_data, const char* msg); // Function signature for g.ErrorCallback
//-----------------------------------------------------------------------------
// [SECTION] Metrics, Debug Tools
//-----------------------------------------------------------------------------
+// See IMGUI_DEBUG_LOG() and IMGUI_DEBUG_LOG_XXX() macros.
enum ImGuiDebugLogFlags_
{
// Event types
- ImGuiDebugLogFlags_None = 0,
- ImGuiDebugLogFlags_EventActiveId = 1 << 0,
- ImGuiDebugLogFlags_EventFocus = 1 << 1,
- ImGuiDebugLogFlags_EventPopup = 1 << 2,
- ImGuiDebugLogFlags_EventNav = 1 << 3,
- ImGuiDebugLogFlags_EventClipper = 1 << 4,
- ImGuiDebugLogFlags_EventIO = 1 << 5,
- ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventIO,
- ImGuiDebugLogFlags_OutputToTTY = 1 << 10, // Also send output to TTY
+ ImGuiDebugLogFlags_None = 0,
+ ImGuiDebugLogFlags_EventError = 1 << 0, // Error submitted by IM_ASSERT_USER_ERROR()
+ ImGuiDebugLogFlags_EventActiveId = 1 << 1,
+ ImGuiDebugLogFlags_EventFocus = 1 << 2,
+ ImGuiDebugLogFlags_EventPopup = 1 << 3,
+ ImGuiDebugLogFlags_EventNav = 1 << 4,
+ ImGuiDebugLogFlags_EventClipper = 1 << 5,
+ ImGuiDebugLogFlags_EventSelection = 1 << 6,
+ ImGuiDebugLogFlags_EventIO = 1 << 7,
+ ImGuiDebugLogFlags_EventFont = 1 << 8,
+ ImGuiDebugLogFlags_EventInputRouting = 1 << 9,
+ ImGuiDebugLogFlags_EventDocking = 1 << 10, // Unused in this branch
+ ImGuiDebugLogFlags_EventViewport = 1 << 11, // Unused in this branch
+
+ ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventFont | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
+ ImGuiDebugLogFlags_OutputToTTY = 1 << 20, // Also send output to TTY
+ ImGuiDebugLogFlags_OutputToTestEngine = 1 << 21, // Also send output to Test Engine
+};
+
+struct ImGuiDebugAllocEntry
+{
+ int FrameCount;
+ ImS16 AllocCount;
+ ImS16 FreeCount;
+};
+
+struct ImGuiDebugAllocInfo
+{
+ int TotalAllocCount; // Number of call to MemAlloc().
+ int TotalFreeCount;
+ ImS16 LastEntriesIdx; // Current index in buffer
+ ImGuiDebugAllocEntry LastEntriesBuf[6]; // Track last 6 frames that had allocations
+
+ ImGuiDebugAllocInfo() { memset(this, 0, sizeof(*this)); }
};
struct ImGuiMetricsConfig
{
- bool ShowDebugLog;
- bool ShowStackTool;
- bool ShowWindowsRects;
- bool ShowWindowsBeginOrder;
- bool ShowTablesRects;
- bool ShowDrawCmdMesh;
- bool ShowDrawCmdBoundingBoxes;
- int ShowWindowsRectsType;
- int ShowTablesRectsType;
-
- ImGuiMetricsConfig()
- {
- ShowDebugLog = ShowStackTool = ShowWindowsRects = ShowWindowsBeginOrder = ShowTablesRects = false;
- ShowDrawCmdMesh = true;
- ShowDrawCmdBoundingBoxes = true;
- ShowWindowsRectsType = ShowTablesRectsType = -1;
- }
+ bool ShowDebugLog = false;
+ bool ShowIDStackTool = false;
+ bool ShowWindowsRects = false;
+ bool ShowWindowsBeginOrder = false;
+ bool ShowTablesRects = false;
+ bool ShowDrawCmdMesh = true;
+ bool ShowDrawCmdBoundingBoxes = true;
+ bool ShowTextEncodingViewer = false;
+ int ShowWindowsRectsType = -1;
+ int ShowTablesRectsType = -1;
+ int HighlightMonitorIdx = -1;
+ ImGuiID HighlightViewportID = 0;
};
struct ImGuiStackLevelInfo
@@ -1688,8 +2024,8 @@ struct ImGuiStackLevelInfo
ImGuiStackLevelInfo() { memset(this, 0, sizeof(*this)); }
};
-// State for Stack tool queries
-struct ImGuiStackTool
+// State for ID Stack tool queries
+struct ImGuiIDStackTool
{
int LastActiveFrame;
int StackLevel; // -1: query stack and resize Results, >= 0: individual stack level
@@ -1697,8 +2033,9 @@ struct ImGuiStackTool
ImVector<ImGuiStackLevelInfo> Results;
bool CopyToClipboardOnCtrlC;
float CopyToClipboardLastTime;
+ ImGuiTextBuffer ResultPathBuf;
- ImGuiStackTool() { memset(this, 0, sizeof(*this)); CopyToClipboardLastTime = -FLT_MAX; }
+ ImGuiIDStackTool() { memset(this, 0, sizeof(*this)); CopyToClipboardLastTime = -FLT_MAX; }
};
//-----------------------------------------------------------------------------
@@ -1728,23 +2065,31 @@ struct ImGuiContext
bool Initialized;
bool FontAtlasOwnedByContext; // IO.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
ImGuiIO IO;
- ImVector<ImGuiInputEvent> InputEventsQueue; // Input events which will be tricked/written into IO structure.
- ImVector<ImGuiInputEvent> InputEventsTrail; // Past input events processed in NewFrame(). This is to allow domain-specific application to access e.g mouse/pen trail.
+ ImGuiPlatformIO PlatformIO;
ImGuiStyle Style;
ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back()
float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window.
float FontBaseSize; // (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Base text height.
+ float FontScale; // == FontSize / Font->FontSize
+ float CurrentDpiScale; // Current window/viewport DpiScale
ImDrawListSharedData DrawListSharedData;
double Time;
int FrameCount;
int FrameCountEnded;
int FrameCountRendered;
+ ImGuiID WithinEndChildID; // Set within EndChild()
bool WithinFrameScope; // Set by NewFrame(), cleared by EndFrame()
bool WithinFrameScopeWithImplicitWindow; // Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed
- bool WithinEndChild; // Set within EndChild()
bool GcCompactAll; // Request full GC
bool TestEngineHookItems; // Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log()
void* TestEngine; // Test engine user data
+ char ContextName[16]; // Storage for a context name (to facilitate debugging multi-context setups)
+
+ // Inputs
+ ImVector<ImGuiInputEvent> InputEventsQueue; // Input events which will be trickled/written into IO structure.
+ ImVector<ImGuiInputEvent> InputEventsTrail; // Past input events processed in NewFrame(). This is to allow domain-specific application to access e.g mouse/pen trail.
+ ImGuiMouseSource InputEventsNextMouseSource;
+ ImU32 InputEventsNextEventId;
// Windows state
ImVector<ImGuiWindow*> Windows; // Windows, sorted in display order, back to front
@@ -1753,23 +2098,32 @@ struct ImGuiContext
ImVector<ImGuiWindowStackData> CurrentWindowStack;
ImGuiStorage WindowsById; // Map window's ImGuiID to ImGuiWindow*
int WindowsActiveCount; // Number of unique windows submitted by frame
- ImVec2 WindowsHoverPadding; // Padding around resizable windows for which hovering on counts as hovering the window == ImMax(style.TouchExtraPadding, WINDOWS_HOVER_PADDING)
+ float WindowsBorderHoverPadding; // Padding around resizable windows for which hovering on counts as hovering the window == ImMax(style.TouchExtraPadding, style.WindowBorderHoverPadding). This isn't so multi-dpi friendly.
+ ImGuiID DebugBreakInWindow; // Set to break in Begin() call.
ImGuiWindow* CurrentWindow; // Window being drawn into
ImGuiWindow* HoveredWindow; // Window the mouse is hovering. Will typically catch mouse inputs.
ImGuiWindow* HoveredWindowUnderMovingWindow; // Hovered window ignoring MovingWindow. Only set if MovingWindow is set.
+ ImGuiWindow* HoveredWindowBeforeClear; // Window the mouse is hovering. Filled even with _NoMouse. This is currently useful for multi-context compositors.
ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindow.
ImGuiWindow* WheelingWindow; // Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window.
ImVec2 WheelingWindowRefMousePos;
+ int WheelingWindowStartFrame; // This may be set one frame before WheelingWindow is != NULL
+ int WheelingWindowScrolledFrame;
float WheelingWindowReleaseTimer;
+ ImVec2 WheelingWindowWheelRemainder;
+ ImVec2 WheelingAxisAvg;
// Item/widgets state and tracking information
- ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
+ ImGuiID DebugDrawIdConflicts; // Set when we detect multiple items with the same identifier
+ ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by ID Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
ImGuiID HoveredId; // Hovered widget, filled during the frame
ImGuiID HoveredIdPreviousFrame;
- bool HoveredIdAllowOverlap;
- bool HoveredIdDisabled; // At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be true even if HoveredId == 0.
+ int HoveredIdPreviousFrameItemCount; // Count numbers of items using the same ID as last frame's hovered id
float HoveredIdTimer; // Measure contiguous hovering time
float HoveredIdNotActiveTimer; // Measure contiguous hovering time where the item has not been active
+ bool HoveredIdAllowOverlap;
+ bool HoveredIdIsDisabled; // At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be true even if HoveredId == 0.
+ bool ItemUnclipByLog; // Disable ItemAdd() clipping, essentially a memory-locality friendly copy of LogEnabled
ImGuiID ActiveId; // Active widget
ImGuiID ActiveIdIsAlive; // Active widget has been seen this frame (we can't use a bool as the ActiveId may change within the frame)
float ActiveIdTimer;
@@ -1779,78 +2133,85 @@ struct ImGuiContext
bool ActiveIdHasBeenPressedBefore; // Track whether the active id led to a press (this is to allow changing between PressOnClick and PressOnRelease without pressing twice). Used by range_select branch.
bool ActiveIdHasBeenEditedBefore; // Was the value associated to the widget Edited over the course of the Active state.
bool ActiveIdHasBeenEditedThisFrame;
+ bool ActiveIdFromShortcut;
+ int ActiveIdMouseButton : 8;
ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
ImGuiWindow* ActiveIdWindow;
- ImGuiInputSource ActiveIdSource; // Activating with mouse or nav (gamepad/keyboard)
- int ActiveIdMouseButton;
+ ImGuiInputSource ActiveIdSource; // Activating source: ImGuiInputSource_Mouse OR ImGuiInputSource_Keyboard OR ImGuiInputSource_Gamepad
ImGuiID ActiveIdPreviousFrame;
- bool ActiveIdPreviousFrameIsAlive;
- bool ActiveIdPreviousFrameHasBeenEditedBefore;
- ImGuiWindow* ActiveIdPreviousFrameWindow;
+ ImGuiDeactivatedItemData DeactivatedItemData;
+ ImGuiDataTypeStorage ActiveIdValueOnActivation; // Backup of initial value at the time of activation. ONLY SET BY SPECIFIC WIDGETS: DragXXX and SliderXXX.
ImGuiID LastActiveId; // Store the last non-zero ActiveId, useful for animation.
float LastActiveIdTimer; // Store the last non-zero ActiveId timer since the beginning of activation, useful for animation.
- // [EXPERIMENTAL] Key/Input Ownership + Shortcut Routing system
+ // Key/Input Ownership + Shortcut Routing system
// - The idea is that instead of "eating" a given key, we can link to an owner.
- // - Input query can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_None (== -1) or a custom ID.
+ // - Input query can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_NoOwner (== -1) or a custom ID.
// - Routing is requested ahead of time for a given chord (Key + Mods) and granted in NewFrame().
+ double LastKeyModsChangeTime; // Record the last time key mods changed (affect repeat delay when using shortcut logic)
+ double LastKeyModsChangeFromNoneTime; // Record the last time key mods changed away from being 0 (affect repeat delay when using shortcut logic)
+ double LastKeyboardKeyPressTime; // Record the last time a keyboard key (ignore mouse/gamepad ones) was pressed.
+ ImBitArrayForNamedKeys KeysMayBeCharInput; // Lookup to tell if a key can emit char input, see IsKeyChordPotentiallyCharInput(). sizeof() = 20 bytes
ImGuiKeyOwnerData KeysOwnerData[ImGuiKey_NamedKey_COUNT];
ImGuiKeyRoutingTable KeysRoutingTable;
ImU32 ActiveIdUsingNavDirMask; // Active widget will want to read those nav move requests (e.g. can activate a button and move away from it)
- bool ActiveIdUsingAllKeyboardKeys; // Active widget will want to read all keyboard keys inputs. (FIXME: This is a shortcut for not taking ownership of 100+ keys but perhaps best to not have the inconsistency)
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- ImU32 ActiveIdUsingNavInputMask; // If you used this. Since (IMGUI_VERSION_NUM >= 18804) : 'g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel);' becomes 'SetKeyOwner(ImGuiKey_Escape, g.ActiveId) and/or SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId);'
-#endif
+ bool ActiveIdUsingAllKeyboardKeys; // Active widget will want to read all keyboard keys inputs. (this is a shortcut for not taking ownership of 100+ keys, frequently used by drag operations)
+ ImGuiKeyChord DebugBreakInShortcutRouting; // Set to break in SetShortcutRouting()/Shortcut() calls.
+ //ImU32 ActiveIdUsingNavInputMask; // [OBSOLETE] Since (IMGUI_VERSION_NUM >= 18804) : 'g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel);' becomes --> 'SetKeyOwner(ImGuiKey_Escape, g.ActiveId) and/or SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId);'
// Next window/item data
- ImGuiID CurrentFocusScopeId; // == g.FocusScopeStack.back()
- ImGuiItemFlags CurrentItemFlags; // == g.ItemFlagsStack.back()
+ ImGuiID CurrentFocusScopeId; // Value for currently appending items == g.FocusScopeStack.back(). Not to be mistaken with g.NavFocusScopeId.
+ ImGuiItemFlags CurrentItemFlags; // Value for currently appending items == g.ItemFlagsStack.back()
ImGuiID DebugLocateId; // Storage for DebugLocateItemOnHover() feature: this is read by ItemAdd() so we keep it in a hot/cached location
ImGuiNextItemData NextItemData; // Storage for SetNextItem** functions
ImGuiLastItemData LastItemData; // Storage for last submitted item (setup by ItemAdd)
ImGuiNextWindowData NextWindowData; // Storage for SetNextWindow** functions
+ bool DebugShowGroupRects;
// Shared stacks
- ImVector<ImGuiColorMod> ColorStack; // Stack for PushStyleColor()/PopStyleColor() - inherited by Begin()
- ImVector<ImGuiStyleMod> StyleVarStack; // Stack for PushStyleVar()/PopStyleVar() - inherited by Begin()
- ImVector<ImFont*> FontStack; // Stack for PushFont()/PopFont() - inherited by Begin()
- ImVector<ImGuiID> FocusScopeStack; // Stack for PushFocusScope()/PopFocusScope() - inherited by BeginChild(), pushed into by Begin()
- ImVector<ImGuiItemFlags>ItemFlagsStack; // Stack for PushItemFlag()/PopItemFlag() - inherited by Begin()
- ImVector<ImGuiGroupData>GroupStack; // Stack for BeginGroup()/EndGroup() - not inherited by Begin()
- ImVector<ImGuiPopupData>OpenPopupStack; // Which popups are open (persistent)
- ImVector<ImGuiPopupData>BeginPopupStack; // Which level of BeginPopup() we are in (reset every frame)
- int BeginMenuCount;
+ ImGuiCol DebugFlashStyleColorIdx; // (Keep close to ColorStack to share cache line)
+ ImVector<ImGuiColorMod> ColorStack; // Stack for PushStyleColor()/PopStyleColor() - inherited by Begin()
+ ImVector<ImGuiStyleMod> StyleVarStack; // Stack for PushStyleVar()/PopStyleVar() - inherited by Begin()
+ ImVector<ImFont*> FontStack; // Stack for PushFont()/PopFont() - inherited by Begin()
+ ImVector<ImGuiFocusScopeData> FocusScopeStack; // Stack for PushFocusScope()/PopFocusScope() - inherited by BeginChild(), pushed into by Begin()
+ ImVector<ImGuiItemFlags> ItemFlagsStack; // Stack for PushItemFlag()/PopItemFlag() - inherited by Begin()
+ ImVector<ImGuiGroupData> GroupStack; // Stack for BeginGroup()/EndGroup() - not inherited by Begin()
+ ImVector<ImGuiPopupData> OpenPopupStack; // Which popups are open (persistent)
+ ImVector<ImGuiPopupData> BeginPopupStack; // Which level of BeginPopup() we are in (reset every frame)
+ ImVector<ImGuiTreeNodeStackData>TreeNodeStack; // Stack for TreeNode()
// Viewports
ImVector<ImGuiViewportP*> Viewports; // Active viewports (Size==1 in 'master' branch). Each viewports hold their copy of ImDrawData.
- // Gamepad/keyboard Navigation
- ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow'
+ // Keyboard/Gamepad Navigation
+ bool NavCursorVisible; // Nav focus cursor/rectangle is visible? We hide it after a mouse click. We show it after a nav move.
+ bool NavHighlightItemUnderNav; // Disable mouse hovering highlight. Highlight navigation focused item instead of mouse hovered item.
+ //bool NavDisableHighlight; // Old name for !g.NavCursorVisible before 1.91.4 (2024/10/18). OPPOSITE VALUE (g.NavDisableHighlight == !g.NavCursorVisible)
+ //bool NavDisableMouseHover; // Old name for g.NavHighlightItemUnderNav before 1.91.1 (2024/10/18) this was called When user starts using keyboard/gamepad, we hide mouse hovering highlight until mouse is touched again.
+ bool NavMousePosDirty; // When set we will update mouse position if io.ConfigNavMoveSetMousePos is set (not enabled by default)
+ bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRectRel is valid
ImGuiID NavId; // Focused item for navigation
- ImGuiID NavFocusScopeId; // Identify a selection scope (selection code often wants to "clear other items" when landing on an item of the selection set)
- ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem()
- ImGuiID NavActivateDownId; // ~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0
- ImGuiID NavActivatePressedId; // ~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat)
- ImGuiID NavActivateInputId; // ~~ IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadInput) ? NavId : 0; ImGuiActivateFlags_PreferInput will be set and NavActivateId will be 0.
+ ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow'
+ ImGuiID NavFocusScopeId; // Focused focus scope (e.g. selection code often wants to "clear other items" when landing on an item of the same scope)
+ ImGuiNavLayer NavLayer; // Focused layer (main scrolling layer, or menu/title bar layer)
+ ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem()
+ ImGuiID NavActivateDownId; // ~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0
+ ImGuiID NavActivatePressedId; // ~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat)
ImGuiActivateFlags NavActivateFlags;
- ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest).
- ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest).
- ImGuiKeyChord NavJustMovedToKeyMods;
+ ImVector<ImGuiFocusScopeData> NavFocusRoute; // Reversed copy focus scope stack for NavId (should contains NavFocusScopeId). This essentially follow the window->ParentWindowForFocusRoute chain.
+ ImGuiID NavHighlightActivatedId;
+ float NavHighlightActivatedTimer;
ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame.
ImGuiActivateFlags NavNextActivateFlags;
- ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard.
- ImGuiNavLayer NavLayer; // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
- bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRectRel is valid
- bool NavMousePosDirty; // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
- bool NavDisableHighlight; // When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover)
- bool NavDisableMouseHover; // When user starts using gamepad/keyboard, we hide mouse hovering highlight until mouse is touched again.
+ ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Mouse
+ ImGuiSelectionUserData NavLastValidSelectionUserData; // Last valid data passed to SetNextItemSelectionUser(), or -1. For current window. Not reset when focusing an item that doesn't have selection data.
+ ImS8 NavCursorHideFrames;
// Navigation: Init & Move Requests
bool NavAnyRequest; // ~~ NavMoveRequest || NavInitRequest this is to perform early out in ItemAdd()
bool NavInitRequest; // Init request for appearing window to select first item
bool NavInitRequestFromMove;
- ImGuiID NavInitResultId; // Init request result (first item of the window, or one for which SetItemDefaultFocus() was called)
- ImRect NavInitResultRectRel; // Init request result rectangle (relative to parent window)
+ ImGuiNavItemData NavInitResult; // Init request result (first item of the window, or one for which SetItemDefaultFocus() was called)
bool NavMoveSubmitted; // Move request submitted, will process result on next NewFrame()
bool NavMoveScoringItems; // Move request submitted, still scoring incoming items
bool NavMoveForwardToNextFrame;
@@ -1870,21 +2231,29 @@ struct ImGuiContext
ImGuiNavItemData NavMoveResultOther; // Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
ImGuiNavItemData NavTabbingResultFirst; // First tabbing request candidate within NavWindow and flattened hierarchy
+ // Navigation: record of last move request
+ ImGuiID NavJustMovedFromFocusScopeId; // Just navigated from this focus scope id (result of a successfully MoveRequest).
+ ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest).
+ ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest).
+ ImGuiKeyChord NavJustMovedToKeyMods;
+ bool NavJustMovedToIsTabbing; // Copy of ImGuiNavMoveFlags_IsTabbing. Maybe we should store whole flags.
+ bool NavJustMovedToHasSelectionData; // Copy of move result's ItemFlags & ImGuiItemFlags_HasSelectionUserData). Maybe we should just store ImGuiNavItemData.
+
// Navigation: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize)
- ImGuiKeyChord ConfigNavWindowingKeyNext; // = ImGuiMod_Ctrl | ImGuiKey_Tab, for reconfiguration (see #4828)
- ImGuiKeyChord ConfigNavWindowingKeyPrev; // = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab
+ ImGuiKeyChord ConfigNavWindowingKeyNext; // = ImGuiMod_Ctrl | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiKey_Tab on OS X). For reconfiguration (see #4828)
+ ImGuiKeyChord ConfigNavWindowingKeyPrev; // = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiMod_Shift | ImGuiKey_Tab on OS X)
ImGuiWindow* NavWindowingTarget; // Target window when doing CTRL+Tab (or Pad Menu + FocusPrev/Next), this window is temporarily displayed top-most!
ImGuiWindow* NavWindowingTargetAnim; // Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0f, so the fade-out can stay on it.
ImGuiWindow* NavWindowingListWindow; // Internal window actually listing the CTRL+Tab contents
float NavWindowingTimer;
float NavWindowingHighlightAlpha;
bool NavWindowingToggleLayer;
+ ImGuiKey NavWindowingToggleKey;
ImVec2 NavWindowingAccumDeltaPos;
ImVec2 NavWindowingAccumDeltaSize;
// Render
float DimBgRatio; // 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list)
- ImGuiMouseCursor MouseCursor;
// Drag and Drop
bool DragDropActive;
@@ -1895,6 +2264,7 @@ struct ImGuiContext
int DragDropMouseButton;
ImGuiPayload DragDropPayload;
ImRect DragDropTargetRect; // Store rectangle of current target candidate (we favor small targets when overlapping)
+ ImRect DragDropTargetClipRect; // Store ClipRect at the time of item's drawing
ImGuiID DragDropTargetId;
ImGuiDragDropFlags DragDropAcceptFlags;
float DragDropAcceptIdCurrRectSurface; // Target item surface (we resolve overlapping targets by prioritizing the smaller surface)
@@ -1911,6 +2281,7 @@ struct ImGuiContext
// Tables
ImGuiTable* CurrentTable;
+ ImGuiID DebugBreakInTable; // Set to break in BeginTable() call.
int TablesTempDataStacked; // Temporary table data size (because we leave previous instances undestructed, we generally don't use TablesTempData.Size)
ImVector<ImGuiTableTempData> TablesTempData; // Temporary table data (buffers reused/shared across instances, support nesting)
ImPool<ImGuiTable> Tables; // Persistent table data
@@ -1923,40 +2294,63 @@ struct ImGuiContext
ImVector<ImGuiPtrOrIndex> CurrentTabBarStack;
ImVector<ImGuiShrinkWidthItem> ShrinkWidthBuffer;
+ // Multi-Select state
+ ImGuiBoxSelectState BoxSelectState;
+ ImGuiMultiSelectTempData* CurrentMultiSelect;
+ int MultiSelectTempDataStacked; // Temporary multi-select data size (because we leave previous instances undestructed, we generally don't use MultiSelectTempData.Size)
+ ImVector<ImGuiMultiSelectTempData> MultiSelectTempData;
+ ImPool<ImGuiMultiSelectState> MultiSelectStorage;
+
// Hover Delay system
- ImGuiID HoverDelayId;
- ImGuiID HoverDelayIdPreviousFrame;
- float HoverDelayTimer; // Currently used IsItemHovered(), generally inferred from g.HoveredIdTimer but kept uncleared until clear timer elapse.
- float HoverDelayClearTimer; // Currently used IsItemHovered(): grace time before g.TooltipHoverTimer gets cleared.
+ ImGuiID HoverItemDelayId;
+ ImGuiID HoverItemDelayIdPreviousFrame;
+ float HoverItemDelayTimer; // Currently used by IsItemHovered()
+ float HoverItemDelayClearTimer; // Currently used by IsItemHovered(): grace time before g.TooltipHoverTimer gets cleared.
+ ImGuiID HoverItemUnlockedStationaryId; // Mouse has once been stationary on this item. Only reset after departing the item.
+ ImGuiID HoverWindowUnlockedStationaryId; // Mouse has once been stationary on this window. Only reset after departing the window.
+
+ // Mouse state
+ ImGuiMouseCursor MouseCursor;
+ float MouseStationaryTimer; // Time the mouse has been stationary (with some loose heuristic)
+ ImVec2 MouseLastValidPos;
// Widget state
- ImVec2 MouseLastValidPos;
ImGuiInputTextState InputTextState;
+ ImGuiInputTextDeactivatedState InputTextDeactivatedState;
ImFont InputTextPasswordFont;
ImGuiID TempInputId; // Temporary text input when CTRL+clicking on a slider, etc.
+ ImGuiDataTypeStorage DataTypeZeroValue; // 0 for all data types
+ int BeginMenuDepth;
+ int BeginComboDepth;
ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets
- float ColorEditLastHue; // Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips
- float ColorEditLastSat; // Backup of last Saturation associated to LastColor, so we can restore Saturation in lossy RGB<>HSV round trips
- ImU32 ColorEditLastColor; // RGB value with alpha set to 0.
+ ImGuiID ColorEditCurrentID; // Set temporarily while inside of the parent-most ColorEdit4/ColorPicker4 (because they call each others).
+ ImGuiID ColorEditSavedID; // ID we are saving/restoring HS for
+ float ColorEditSavedHue; // Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips
+ float ColorEditSavedSat; // Backup of last Saturation associated to LastColor, so we can restore Saturation in lossy RGB<>HSV round trips
+ ImU32 ColorEditSavedColor; // RGB value with alpha set to 0.
ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker.
ImGuiComboPreviewData ComboPreviewData;
+ ImRect WindowResizeBorderExpectedRect; // Expected border rect, switch to relative edit if moving
+ bool WindowResizeRelativeMode;
+ short ScrollbarSeekMode; // 0: scroll to clicked location, -1/+1: prev/next page.
+ float ScrollbarClickDeltaToGrabCenter; // When scrolling to mouse location: distance between mouse and center of grab box, normalized in parent space.
float SliderGrabClickOffset;
float SliderCurrentAccum; // Accumulated slider delta when using navigation controls.
bool SliderCurrentAccumDirty; // Has the accumulated slider delta changed since last time we tried to apply it?
bool DragCurrentAccumDirty;
float DragCurrentAccum; // Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings
float DragSpeedDefaultRatio; // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
- float ScrollbarClickDeltaToGrabCenter; // Distance between mouse and center of grab box, normalized in parent space. Use storage?
float DisabledAlphaBackup; // Backup for style.Alpha for BeginDisabled()
short DisabledStackSize;
short TooltipOverrideCount;
+ ImGuiWindow* TooltipPreviousWindow; // Window of last tooltip submitted during the frame
ImVector<char> ClipboardHandlerData; // If no custom clipboard handler is defined
ImVector<ImGuiID> MenusIdSubmittedThisFrame; // A list of menu IDs that were rendered at least once
+ ImGuiTypingSelectState TypingSelectState; // State for GetTypingSelectRequest()
// Platform support
ImGuiPlatformImeData PlatformImeData; // Data updated by current frame
- ImGuiPlatformImeData PlatformImeDataPrev; // Previous frame data (when changing we will call io.SetPlatformImeDataFn
- char PlatformLocaleDecimalPoint; // '.' or *localeconv()->decimal_point
+ ImGuiPlatformImeData PlatformImeDataPrev; // Previous frame data. When changed we call the platform_io.Platform_SetImeDataFn() handler.
// Settings
bool SettingsLoaded;
@@ -1973,7 +2367,8 @@ struct ImGuiContext
// Capture/Logging
bool LogEnabled; // Currently capturing
- ImGuiLogType LogType; // Capture target
+ ImGuiLogFlags LogFlags; // Capture flags/type
+ ImGuiWindow* LogWindow;
ImFileHandle LogFile; // If != NULL log to stdout/ file
ImGuiTextBuffer LogBuffer; // Accumulation buffer when log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators.
const char* LogNextPrefix;
@@ -1984,16 +2379,36 @@ struct ImGuiContext
int LogDepthToExpand;
int LogDepthToExpandDefault; // Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call.
+ // Error Handling
+ ImGuiErrorCallback ErrorCallback; // = NULL. May be exposed in public API eventually.
+ void* ErrorCallbackUserData; // = NULL
+ ImVec2 ErrorTooltipLockedPos;
+ bool ErrorFirst;
+ int ErrorCountCurrentFrame; // [Internal] Number of errors submitted this frame.
+ ImGuiErrorRecoveryState StackSizesInNewFrame; // [Internal]
+ ImGuiErrorRecoveryState*StackSizesInBeginForCurrentWindow; // [Internal]
+
// Debug Tools
+ // (some of the highly frequently used data are interleaved in other structures above: DebugBreakXXX fields, DebugHookIdInfo, DebugLocateId etc.)
+ int DebugDrawIdConflictsCount; // Locked count (preserved when holding CTRL)
ImGuiDebugLogFlags DebugLogFlags;
ImGuiTextBuffer DebugLogBuf;
ImGuiTextIndex DebugLogIndex;
+ int DebugLogSkippedErrors;
+ ImGuiDebugLogFlags DebugLogAutoDisableFlags;
+ ImU8 DebugLogAutoDisableFrames;
ImU8 DebugLocateFrames; // For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above.
+ bool DebugBreakInLocateId; // Debug break in ItemAdd() call for g.DebugLocateId.
+ ImGuiKeyChord DebugBreakKeyChord; // = ImGuiKey_Pause
+ ImS8 DebugBeginReturnValueCullDepth; // Cycle between 0..9 then wrap around.
bool DebugItemPickerActive; // Item picker is active (started with DebugStartItemPicker())
ImU8 DebugItemPickerMouseButton;
ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this ID
+ float DebugFlashStyleColorTime;
+ ImVec4 DebugFlashStyleColorBackup;
ImGuiMetricsConfig DebugMetricsConfig;
- ImGuiStackTool DebugStackTool;
+ ImGuiIDStackTool DebugIDStackTool;
+ ImGuiDebugAllocInfo DebugAllocInfo;
// Misc
float FramerateSecPerFrame[60]; // Calculate estimate of framerate for user over the last 60 frames..
@@ -2004,167 +2419,9 @@ struct ImGuiContext
int WantCaptureKeyboardNextFrame; // "
int WantTextInputNextFrame;
ImVector<char> TempBuffer; // Temporary text buffer
+ char TempKeychordName[64];
- ImGuiContext(ImFontAtlas* shared_font_atlas)
- {
- Initialized = false;
- FontAtlasOwnedByContext = shared_font_atlas ? false : true;
- Font = NULL;
- FontSize = FontBaseSize = 0.0f;
- IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)();
- Time = 0.0f;
- FrameCount = 0;
- FrameCountEnded = FrameCountRendered = -1;
- WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false;
- GcCompactAll = false;
- TestEngineHookItems = false;
- TestEngine = NULL;
-
- WindowsActiveCount = 0;
- CurrentWindow = NULL;
- HoveredWindow = NULL;
- HoveredWindowUnderMovingWindow = NULL;
- MovingWindow = NULL;
- WheelingWindow = NULL;
- WheelingWindowReleaseTimer = 0.0f;
-
- DebugHookIdInfo = 0;
- HoveredId = HoveredIdPreviousFrame = 0;
- HoveredIdAllowOverlap = false;
- HoveredIdDisabled = false;
- HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
- ActiveId = 0;
- ActiveIdIsAlive = 0;
- ActiveIdTimer = 0.0f;
- ActiveIdIsJustActivated = false;
- ActiveIdAllowOverlap = false;
- ActiveIdNoClearOnFocusLoss = false;
- ActiveIdHasBeenPressedBefore = false;
- ActiveIdHasBeenEditedBefore = false;
- ActiveIdHasBeenEditedThisFrame = false;
- ActiveIdClickOffset = ImVec2(-1, -1);
- ActiveIdWindow = NULL;
- ActiveIdSource = ImGuiInputSource_None;
- ActiveIdMouseButton = -1;
- ActiveIdPreviousFrame = 0;
- ActiveIdPreviousFrameIsAlive = false;
- ActiveIdPreviousFrameHasBeenEditedBefore = false;
- ActiveIdPreviousFrameWindow = NULL;
- LastActiveId = 0;
- LastActiveIdTimer = 0.0f;
-
- ActiveIdUsingNavDirMask = 0x00;
- ActiveIdUsingAllKeyboardKeys = false;
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- ActiveIdUsingNavInputMask = 0x00;
-#endif
-
- CurrentFocusScopeId = 0;
- CurrentItemFlags = ImGuiItemFlags_None;
- BeginMenuCount = 0;
-
- NavWindow = NULL;
- NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavActivateInputId = 0;
- NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0;
- NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None;
- NavJustMovedToKeyMods = ImGuiMod_None;
- NavInputSource = ImGuiInputSource_None;
- NavLayer = ImGuiNavLayer_Main;
- NavIdIsAlive = false;
- NavMousePosDirty = false;
- NavDisableHighlight = true;
- NavDisableMouseHover = false;
- NavAnyRequest = false;
- NavInitRequest = false;
- NavInitRequestFromMove = false;
- NavInitResultId = 0;
- NavMoveSubmitted = false;
- NavMoveScoringItems = false;
- NavMoveForwardToNextFrame = false;
- NavMoveFlags = ImGuiNavMoveFlags_None;
- NavMoveScrollFlags = ImGuiScrollFlags_None;
- NavMoveKeyMods = ImGuiMod_None;
- NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None;
- NavScoringDebugCount = 0;
- NavTabbingDir = 0;
- NavTabbingCounter = 0;
-
- ConfigNavWindowingKeyNext = ImGuiMod_Ctrl | ImGuiKey_Tab;
- ConfigNavWindowingKeyPrev = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab;
- NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL;
- NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
- NavWindowingToggleLayer = false;
-
- DimBgRatio = 0.0f;
- MouseCursor = ImGuiMouseCursor_Arrow;
-
- DragDropActive = DragDropWithinSource = DragDropWithinTarget = false;
- DragDropSourceFlags = ImGuiDragDropFlags_None;
- DragDropSourceFrameCount = -1;
- DragDropMouseButton = -1;
- DragDropTargetId = 0;
- DragDropAcceptFlags = ImGuiDragDropFlags_None;
- DragDropAcceptIdCurrRectSurface = 0.0f;
- DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0;
- DragDropAcceptFrameCount = -1;
- DragDropHoldJustPressedId = 0;
- memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal));
-
- ClipperTempDataStacked = 0;
-
- CurrentTable = NULL;
- TablesTempDataStacked = 0;
- CurrentTabBar = NULL;
-
- HoverDelayId = HoverDelayIdPreviousFrame = 0;
- HoverDelayTimer = HoverDelayClearTimer = 0.0f;
-
- TempInputId = 0;
- ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
- ColorEditLastHue = ColorEditLastSat = 0.0f;
- ColorEditLastColor = 0;
- SliderGrabClickOffset = 0.0f;
- SliderCurrentAccum = 0.0f;
- SliderCurrentAccumDirty = false;
- DragCurrentAccumDirty = false;
- DragCurrentAccum = 0.0f;
- DragSpeedDefaultRatio = 1.0f / 100.0f;
- ScrollbarClickDeltaToGrabCenter = 0.0f;
- DisabledAlphaBackup = 0.0f;
- DisabledStackSize = 0;
- TooltipOverrideCount = 0;
-
- PlatformImeData.InputPos = ImVec2(0.0f, 0.0f);
- PlatformImeDataPrev.InputPos = ImVec2(-1.0f, -1.0f); // Different to ensure initial submission
- PlatformLocaleDecimalPoint = '.';
-
- SettingsLoaded = false;
- SettingsDirtyTimer = 0.0f;
- HookIdNext = 0;
-
- memset(LocalizationTable, 0, sizeof(LocalizationTable));
-
- LogEnabled = false;
- LogType = ImGuiLogType_None;
- LogNextPrefix = LogNextSuffix = NULL;
- LogFile = NULL;
- LogLinePosY = FLT_MAX;
- LogLineFirstItem = false;
- LogDepthRef = 0;
- LogDepthToExpand = LogDepthToExpandDefault = 2;
-
- DebugLogFlags = ImGuiDebugLogFlags_OutputToTTY;
- DebugLocateId = 0;
- DebugLocateFrames = 0;
- DebugItemPickerActive = false;
- DebugItemPickerMouseButton = ImGuiMouseButton_Left;
- DebugItemPickerBreakId = 0;
-
- memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
- FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0;
- FramerateSecPerFrameAccum = 0.0f;
- WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
- }
+ ImGuiContext(ImFontAtlas* shared_font_atlas);
};
//-----------------------------------------------------------------------------
@@ -2191,27 +2448,31 @@ struct IMGUI_API ImGuiWindowTempData
ImVec1 Indent; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
ImVec1 ColumnsOffset; // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
ImVec1 GroupOffset;
- ImVec2 CursorStartPosLossyness;// Record the loss of precision of CursorStartPos due to really large scrolling amount. This is used by clipper to compensentate and fix the most common use case of large scroll area.
+ ImVec2 CursorStartPosLossyness;// Record the loss of precision of CursorStartPos due to really large scrolling amount. This is used by clipper to compensate and fix the most common use case of large scroll area.
// Keyboard/Gamepad navigation
ImGuiNavLayer NavLayerCurrent; // Current layer, 0..31 (we currently only use 0..1)
short NavLayersActiveMask; // Which layers have been written to (result from previous frame)
short NavLayersActiveMaskNext;// Which layers have been written to (accumulator for current frame)
+ bool NavIsScrollPushableX; // Set when current work location may be scrolled horizontally when moving left / right. This is generally always true UNLESS within a column.
bool NavHideHighlightOneFrame;
- bool NavHasScroll; // Set when scrolling can be used (ScrollMax > 0.0f)
+ bool NavWindowHasScrollY; // Set per window when scrolling can be used (== ScrollMax.y > 0.0f)
// Miscellaneous
bool MenuBarAppending; // FIXME: Remove this
ImVec2 MenuBarOffset; // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
ImGuiMenuColumns MenuColumns; // Simplified columns storage for menu items measurement
int TreeDepth; // Current tree depth.
- ImU32 TreeJumpToParentOnPopMask; // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31.. Could be turned into a ImU64 if necessary.
+ ImU32 TreeHasStackDataDepthMask; // Store whether given depth has ImGuiTreeNodeStackData data. Could be turned into a ImU64 if necessary.
ImVector<ImGuiWindow*> ChildWindows;
ImGuiStorage* StateStorage; // Current persistent per-window storage (store e.g. tree node open/close state)
ImGuiOldColumns* CurrentColumns; // Current columns set
int CurrentTableIdx; // Current table index (into g.Tables)
ImGuiLayoutType LayoutType;
ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin()
+ ImU32 ModalDimBgColor;
+ ImGuiItemStatusFlags WindowItemStatusFlags;
+ ImGuiItemStatusFlags ChildItemStatusFlags;
// Local parameters stacks
// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
@@ -2224,9 +2485,11 @@ struct IMGUI_API ImGuiWindowTempData
// Storage for one window
struct IMGUI_API ImGuiWindow
{
+ ImGuiContext* Ctx; // Parent UI context (needs to be set explicitly by parent).
char* Name; // Window name, owned by the window.
ImGuiID ID; // == ImHashStr(Name)
ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_
+ ImGuiChildFlags ChildFlags; // Set when window is a child window. See enum ImGuiChildFlags_
ImGuiViewportP* Viewport; // Always set in Begin(). Inactive windows may have a NULL value here if their viewport was discarded.
ImVec2 Pos; // Position (always rounded-up to nearest pixel)
ImVec2 Size; // Current size (==SizeFull or collapsed title bar size)
@@ -2237,9 +2500,14 @@ struct IMGUI_API ImGuiWindow
ImVec2 WindowPadding; // Window padding at the time of Begin().
float WindowRounding; // Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc.
float WindowBorderSize; // Window border size at the time of Begin().
+ float TitleBarHeight, MenuBarHeight; // Note that those used to be function before 2024/05/28. If you have old code calling TitleBarHeight() you can change it to TitleBarHeight.
+ float DecoOuterSizeX1, DecoOuterSizeY1; // Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0f. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin().
+ float DecoOuterSizeX2, DecoOuterSizeY2; // Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y).
+ float DecoInnerSizeX1, DecoInnerSizeY1; // Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes).
int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)!
ImGuiID MoveId; // == window->GetID("#MOVE")
ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window)
+ ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
ImVec2 Scroll;
ImVec2 ScrollMax;
ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
@@ -2247,26 +2515,28 @@ struct IMGUI_API ImGuiWindow
ImVec2 ScrollTargetEdgeSnapDist; // 0.0f = no snapping, >0.0f snapping threshold
ImVec2 ScrollbarSizes; // Size taken by each scrollbars on their smaller axis. Pay attention! ScrollbarSizes.x == width of the vertical scrollbar, ScrollbarSizes.y = height of the horizontal scrollbar.
bool ScrollbarX, ScrollbarY; // Are scrollbars visible?
+ bool ScrollbarXStabilizeEnabled; // Was ScrollbarX previously auto-stabilized?
+ ImU8 ScrollbarXStabilizeToggledHistory; // Used to stabilize scrollbar visibility in case of feedback loops
bool Active; // Set to true on Begin(), unless Collapsed
bool WasActive;
bool WriteAccessed; // Set to true when any widget access the current window
bool Collapsed; // Set when collapsing window to become only title-bar
bool WantCollapseToggle;
bool SkipItems; // Set when items can safely be all clipped (e.g. window not visible or collapsed)
+ bool SkipRefresh; // [EXPERIMENTAL] Reuse previous frame drawn contents, Begin() returns false.
bool Appearing; // Set during the frame where the window is appearing (or re-appearing)
bool Hidden; // Do not display (== HiddenFrames*** > 0)
bool IsFallbackWindow; // Set on the "Debug##Default" window.
bool IsExplicitChild; // Set when passed _ChildWindow, left to false by BeginDocked()
bool HasCloseButton; // Set when the window has a close button (p_open != NULL)
+ signed char ResizeBorderHovered; // Current border being hovered for resize (-1: none, otherwise 0-3)
signed char ResizeBorderHeld; // Current border being held for resize (-1: none, otherwise 0-3)
short BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
short BeginCountPreviousFrame; // Number of Begin() during the previous frame
short BeginOrderWithinParent; // Begin() order within immediate parent window, if we are a child window. Otherwise 0.
short BeginOrderWithinContext; // Begin() order within entire imgui context. This is mostly used for debugging submission order related issues.
short FocusOrder; // Order within WindowsFocusOrder[], altered when windows are focused.
- ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
ImS8 AutoFitFramesX, AutoFitFramesY;
- ImS8 AutoFitChildAxises;
bool AutoFitOnlyGrows;
ImGuiDir AutoPosLastDirection;
ImS8 HiddenFramesCanSkipItems; // Hide the window for N frames
@@ -2300,6 +2570,8 @@ struct IMGUI_API ImGuiWindow
ImGuiStorage StateStorage;
ImVector<ImGuiOldColumns> ColumnsStorage;
float FontWindowScale; // User scale multiplier per-window, via SetWindowFontScale()
+ float FontWindowScaleParents;
+ float FontRefSize; // This is a copy of window->CalcFontSize() at the time of Begin(), trying to phase out CalcFontSize() especially as it may be called on non-current window.
int SettingsOffset; // Offset into SettingsWindows[] (offsets are always valid as we only grow the array from the back)
ImDrawList* DrawList; // == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer)
@@ -2310,10 +2582,12 @@ struct IMGUI_API ImGuiWindow
ImGuiWindow* RootWindowPopupTree; // Point to ourself or first ancestor that is not a child window. Cross through popups parent<>child.
ImGuiWindow* RootWindowForTitleBarHighlight; // Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
ImGuiWindow* RootWindowForNav; // Point to ourself or first ancestor which doesn't have the NavFlattened flag.
+ ImGuiWindow* ParentWindowForFocusRoute; // Set to manual link a window to its logical parent so that Shortcut() chain are honoerd (e.g. Tool linked to Document)
ImGuiWindow* NavLastChildNavWindow; // When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
ImGuiID NavLastIds[ImGuiNavLayer_COUNT]; // Last known NavId for this window, per layer (0/1)
ImRect NavRectRel[ImGuiNavLayer_COUNT]; // Reference rectangle, in window relative space
+ ImVec2 NavPreferredScoringPosRel[ImGuiNavLayer_COUNT]; // Preferred X/Y position updated when moving on a given axis, reset to FLT_MAX.
ImGuiID NavRootFocusScopeId; // Focus Scope ID at the time of Begin()
int MemoryDrawListIdxCapacity; // Backup of last idx/vtx count, so when waking up the window we can preallocate and avoid iterative alloc/copy
@@ -2327,15 +2601,14 @@ public:
ImGuiID GetID(const char* str, const char* str_end = NULL);
ImGuiID GetID(const void* ptr);
ImGuiID GetID(int n);
+ ImGuiID GetIDFromPos(const ImVec2& p_abs);
ImGuiID GetIDFromRectangle(const ImRect& r_abs);
// We don't use g.FontSize because the window may be != g.CurrentWindow.
ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
- float CalcFontSize() const { ImGuiContext& g = *GImGui; float scale = g.FontBaseSize * FontWindowScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; }
- float TitleBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; }
- ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); }
- float MenuBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; }
- ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); }
+ float CalcFontSize() const { ImGuiContext& g = *Ctx; return g.FontBaseSize * FontWindowScale * FontWindowScaleParents; }
+ ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight)); }
+ ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight; return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight); }
};
//-----------------------------------------------------------------------------
@@ -2356,6 +2629,8 @@ enum ImGuiTabItemFlagsPrivate_
ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
ImGuiTabItemFlags_NoCloseButton = 1 << 20, // Track whether p_open was set or not (we'll need this info on the next frame to recompute ContentWidth during layout)
ImGuiTabItemFlags_Button = 1 << 21, // Used by TabItemButton, change the tab item behavior to mimic a button
+ ImGuiTabItemFlags_Invisible = 1 << 22, // To reserve space e.g. with ImGuiTabItemFlags_Leading
+ //ImGuiTabItemFlags_Unsorted = 1 << 23, // [Docking] Trailing tabs with the _Unsorted flag will be sorted based on the DockOrder of their Window.
};
// Storage for one active tab item (sizeof() 40 bytes)
@@ -2371,15 +2646,16 @@ struct ImGuiTabItem
float RequestedWidth; // Width optionally requested by caller, -1.0f is unused
ImS32 NameOffset; // When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames
ImS16 BeginOrder; // BeginTabItem() order, used to re-order tabs after toggling ImGuiTabBarFlags_Reorderable
- ImS16 IndexDuringLayout; // Index only used during TabBarLayout()
+ ImS16 IndexDuringLayout; // Index only used during TabBarLayout(). Tabs gets reordered so 'Tabs[n].IndexDuringLayout == n' but may mismatch during additions.
bool WantClose; // Marked as closed by SetTabItemClosed()
ImGuiTabItem() { memset(this, 0, sizeof(*this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
};
-// Storage for a tab bar (sizeof() 152 bytes)
+// Storage for a tab bar (sizeof() 160 bytes)
struct IMGUI_API ImGuiTabBar
{
+ ImGuiWindow* Window;
ImVector<ImGuiTabItem> Tabs;
ImGuiTabBarFlags Flags;
ImGuiID ID; // Zero for tab-bars used by docking
@@ -2399,6 +2675,8 @@ struct IMGUI_API ImGuiTabBar
float ScrollingSpeed;
float ScrollingRectMinX;
float ScrollingRectMaxX;
+ float SeparatorMinX;
+ float SeparatorMaxX;
ImGuiID ReorderRequestTabId;
ImS16 ReorderRequestOffset;
ImS8 BeginCount;
@@ -2413,12 +2691,6 @@ struct IMGUI_API ImGuiTabBar
ImGuiTextBuffer TabsNames; // For non-docking tab bar we re-append names in a contiguous buffer.
ImGuiTabBar();
- int GetTabOrder(const ImGuiTabItem* tab) const { return Tabs.index_from_ptr(tab); }
- const char* GetTabName(const ImGuiTabItem* tab) const
- {
- IM_ASSERT(tab->NameOffset != -1 && tab->NameOffset < TabsNames.Buf.Size);
- return TabsNames.Buf.Data + tab->NameOffset;
- }
};
//-----------------------------------------------------------------------------
@@ -2426,14 +2698,13 @@ struct IMGUI_API ImGuiTabBar
//-----------------------------------------------------------------------------
#define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color.
-#define IMGUI_TABLE_MAX_COLUMNS 64 // sizeof(ImU64) * 8. This is solely because we frequently encode columns set in a ImU64.
-#define IMGUI_TABLE_MAX_DRAW_CHANNELS (4 + 64 * 2) // See TableSetupDrawChannels()
+#define IMGUI_TABLE_MAX_COLUMNS 512 // May be further lifted
// Our current column maximum is 64 but we may raise that in the future.
-typedef ImS8 ImGuiTableColumnIdx;
-typedef ImU8 ImGuiTableDrawChannelIdx;
+typedef ImS16 ImGuiTableColumnIdx;
+typedef ImU16 ImGuiTableDrawChannelIdx;
-// [Internal] sizeof() ~ 104
+// [Internal] sizeof() ~ 112
// We use the terminology "Enabled" to refer to a column that is not Hidden by user/api.
// We use the terminology "Clipped" to refer to a column that is out of sight because of scrolling/clipping.
// This is in contrast with some user-facing api such as IsItemVisible() / IsRectVisible() which use "Visible" to mean "not clipped".
@@ -2445,6 +2716,7 @@ struct ImGuiTableColumn
float MaxX;
float WidthRequest; // Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout()
float WidthAuto; // Automatic width
+ float WidthMax; // Maximum width (FIXME: overwritten by each instance)
float StretchWeight; // Master width weight when (Flags & _WidthStretch). Often around ~1.0f initially.
float InitStretchWeightOrWidth; // Value passed to TableSetupColumn(). For Width it is a content width (_without padding_).
ImRect ClipRect; // Clipping rectangle for the column
@@ -2479,7 +2751,7 @@ struct ImGuiTableColumn
ImU8 SortDirection : 2; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
ImU8 SortDirectionsAvailCount : 2; // Number of available sort directions (0 to 3)
ImU8 SortDirectionsAvailMask : 4; // Mask of available sort directions (1-bit each)
- ImU8 SortDirectionsAvailList; // Ordered of available sort directions (2-bits each)
+ ImU8 SortDirectionsAvailList; // Ordered list of available sort directions (2-bits each, total 8-bits)
ImGuiTableColumn()
{
@@ -2495,47 +2767,63 @@ struct ImGuiTableColumn
};
// Transient cell data stored per row.
-// sizeof() ~ 6
+// sizeof() ~ 6 bytes
struct ImGuiTableCellData
{
ImU32 BgColor; // Actual color
ImGuiTableColumnIdx Column; // Column number
};
-// Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs, does that needs they could be moved to ImGuiTableTempData ?)
+// Parameters for TableAngledHeadersRowEx()
+// This may end up being refactored for more general purpose.
+// sizeof() ~ 12 bytes
+struct ImGuiTableHeaderData
+{
+ ImGuiTableColumnIdx Index; // Column index
+ ImU32 TextColor;
+ ImU32 BgColor0;
+ ImU32 BgColor1;
+};
+
+// Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs. Does that means they could be moved to ImGuiTableTempData?)
+// sizeof() ~ 24 bytes
struct ImGuiTableInstanceData
{
- float LastOuterHeight; // Outer height from last frame // FIXME: multi-instance issue (#3955)
- float LastFirstRowHeight; // Height of first row from last frame // FIXME: possible multi-instance issue?
+ ImGuiID TableInstanceID;
+ float LastOuterHeight; // Outer height from last frame
+ float LastTopHeadersRowHeight; // Height of first consecutive header rows from last frame (FIXME: this is used assuming consecutive headers are in same frozen set)
+ float LastFrozenHeight; // Height of frozen section from last frame
+ int HoveredRowLast; // Index of row which was hovered last frame.
+ int HoveredRowNext; // Index of row hovered this frame, set after encountering it.
- ImGuiTableInstanceData() { LastOuterHeight = LastFirstRowHeight = 0.0f; }
+ ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastTopHeadersRowHeight = LastFrozenHeight = 0.0f; HoveredRowLast = HoveredRowNext = -1; }
};
-// FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
+// sizeof() ~ 592 bytes + heap allocs described in TableBeginInitMemory()
struct IMGUI_API ImGuiTable
{
ImGuiID ID;
ImGuiTableFlags Flags;
- void* RawData; // Single allocation to hold Columns[], DisplayOrderToIndex[] and RowCellData[]
+ void* RawData; // Single allocation to hold Columns[], DisplayOrderToIndex[], and RowCellData[]
ImGuiTableTempData* TempData; // Transient data while table is active. Point within g.CurrentTableStack[]
ImSpan<ImGuiTableColumn> Columns; // Point within RawData[]
ImSpan<ImGuiTableColumnIdx> DisplayOrderToIndex; // Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1)
ImSpan<ImGuiTableCellData> RowCellData; // Point within RawData[]. Store cells background requests for current row.
- ImU64 EnabledMaskByDisplayOrder; // Column DisplayOrder -> IsEnabled map
- ImU64 EnabledMaskByIndex; // Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data
- ImU64 VisibleMaskByIndex; // Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect)
- ImU64 RequestOutputMaskByIndex; // Column Index -> IsVisible || AutoFit (== expect user to submit items)
+ ImBitArrayPtr EnabledMaskByDisplayOrder; // Column DisplayOrder -> IsEnabled map
+ ImBitArrayPtr EnabledMaskByIndex; // Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data
+ ImBitArrayPtr VisibleMaskByIndex; // Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect)
ImGuiTableFlags SettingsLoadedFlags; // Which data were loaded from the .ini file (e.g. when order is not altered we won't save order)
int SettingsOffset; // Offset in g.SettingsTables
int LastFrameActive;
int ColumnsCount; // Number of columns declared in BeginTable()
int CurrentRow;
int CurrentColumn;
- ImS16 InstanceCurrent; // Count of BeginTable() calls with same ID in the same frame (generally 0). This is a little bit similar to BeginCount for a window, but multiple table with same ID look are multiple tables, they are just synched.
+ ImS16 InstanceCurrent; // Count of BeginTable() calls with same ID in the same frame (generally 0). This is a little bit similar to BeginCount for a window, but multiple tables with the same ID are multiple tables, they are just synced.
ImS16 InstanceInteracted; // Mark which instance (generally 0) of the same ID is being interacted with
float RowPosY1;
float RowPosY2;
float RowMinHeight; // Height submitted to TableNextRow()
+ float RowCellPaddingY; // Top and bottom padding. Reloaded during row change.
float RowTextBaseline;
float RowIndentOffsetX;
ImGuiTableRowFlags RowFlags : 16; // Current row flags, see ImGuiTableRowFlags_
@@ -2549,9 +2837,8 @@ struct IMGUI_API ImGuiTable
float HostIndentX;
float MinColumnWidth;
float OuterPaddingX;
- float CellPaddingX; // Padding from each borders
- float CellPaddingY;
- float CellSpacingX1; // Spacing between non-bordered cells
+ float CellPaddingX; // Padding from each borders. Locked in BeginTable()/Layout.
+ float CellSpacingX1; // Spacing between non-bordered cells. Locked in BeginTable()/Layout.
float CellSpacingX2;
float InnerWidth; // User value passed to BeginTable(), see comments at the top of BeginTable() for details.
float ColumnsGivenWidth; // Sum of current column width
@@ -2560,8 +2847,10 @@ struct IMGUI_API ImGuiTable
float ResizedColumnNextWidth;
float ResizeLockMinContentsX2; // Lock minimum contents width while resizing down in order to not create feedback loops. But we allow growing the table.
float RefScale; // Reference scale to be able to rescale columns on font/dpi changes.
+ float AngledHeadersHeight; // Set by TableAngledHeadersRow(), used in TableUpdateLayout()
+ float AngledHeadersSlope; // Set by TableAngledHeadersRow(), used in TableUpdateLayout()
ImRect OuterRect; // Note: for non-scrolling table, OuterRect.Max.y is often FLT_MAX until EndTable(), unless a height has been specified in BeginTable().
- ImRect InnerRect; // InnerRect but without decoration. As with OuterRect, for non-scrolling tables, InnerRect.Max.y is
+ ImRect InnerRect; // InnerRect but without decoration. As with OuterRect, for non-scrolling tables, InnerRect.Max.y is "
ImRect WorkRect;
ImRect InnerClipRect;
ImRect BgClipRect; // We use this to cpu-clip cell background color fill, evolve during the frame as we cross frozen rows boundaries
@@ -2580,10 +2869,12 @@ struct IMGUI_API ImGuiTable
ImGuiTableSortSpecs SortSpecs; // Public facing sorts specs, this is what we return in TableGetSortSpecs()
ImGuiTableColumnIdx SortSpecsCount;
ImGuiTableColumnIdx ColumnsEnabledCount; // Number of enabled columns (<= ColumnsCount)
- ImGuiTableColumnIdx ColumnsEnabledFixedCount; // Number of enabled columns (<= ColumnsCount)
+ ImGuiTableColumnIdx ColumnsEnabledFixedCount; // Number of enabled columns using fixed width (<= ColumnsCount)
ImGuiTableColumnIdx DeclColumnsCount; // Count calls to TableSetupColumn()
+ ImGuiTableColumnIdx AngledHeadersCount; // Count columns with angled headers
ImGuiTableColumnIdx HoveredColumnBody; // Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column!
ImGuiTableColumnIdx HoveredColumnBorder; // Index of column whose right-border is being hovered (for resizing).
+ ImGuiTableColumnIdx HighlightColumnHeader; // Index of column which should be highlighted.
ImGuiTableColumnIdx AutoFitSingleColumn; // Index of single column requesting auto-fit.
ImGuiTableColumnIdx ResizedColumn; // Index of column being resized. Reset when InstanceCurrent==0.
ImGuiTableColumnIdx LastResizedColumn; // Index of column being resized from previous frame.
@@ -2603,12 +2894,14 @@ struct IMGUI_API ImGuiTable
ImGuiTableDrawChannelIdx DummyDrawChannel; // Redirect non-visible columns here.
ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent; // For Selectable() and other widgets drawing across columns after the freezing line. Index within DrawSplitter.Channels[]
ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
+ ImS8 NavLayer; // ImGuiNavLayer at the time of BeginTable().
bool IsLayoutLocked; // Set by TableUpdateLayout() which is called when beginning the first row.
bool IsInsideRow; // Set when inside TableBeginRow()/TableEndRow().
bool IsInitializing;
bool IsSortSpecsDirty;
bool IsUsingHeaders; // Set when the first row had the ImGuiTableRowFlags_Headers flag.
bool IsContextPopupOpen; // Set when default context menu is open (also see: ContextPopupColumn, InstanceInteracted).
+ bool DisableDefaultContextMenu; // Disable default context menu contents. You may submit your own using TableBeginContextMenuPopup()/EndPopup()
bool IsSettingsRequestLoad;
bool IsSettingsDirty; // Set when table settings have changed and needs to be reported into ImGuiTableSetttings data.
bool IsDefaultDisplayOrder; // Set when display order is unchanged from default (DisplayOrder contains 0...Count-1)
@@ -2616,6 +2909,10 @@ struct IMGUI_API ImGuiTable
bool IsResetDisplayOrderRequest;
bool IsUnfrozenRows; // Set when we got past the frozen row.
bool IsDefaultSizingPolicy; // Set if user didn't explicitly set a sizing policy in BeginTable()
+ bool IsActiveIdAliveBeforeTable;
+ bool IsActiveIdInTable;
+ bool HasScrollbarYCurr; // Whether ANY instance of this table had a vertical scrollbar during the current frame.
+ bool HasScrollbarYPrev; // Whether ANY instance of this table had a vertical scrollbar during the previous.
bool MemoryCompacted;
bool HostSkipItems; // Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
@@ -2626,10 +2923,14 @@ struct IMGUI_API ImGuiTable
// Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table).
// - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure.
// - We also leave out of this structure data that tend to be particularly useful for debugging/metrics.
+// FIXME-TABLE: more transient data could be stored in a stacked ImGuiTableTempData: e.g. SortSpecs.
+// sizeof() ~ 136 bytes.
struct IMGUI_API ImGuiTableTempData
{
int TableIndex; // Index in g.Tables.Buf[] pool
float LastTimeActive; // Last timestamp this structure was used
+ float AngledHeadersExtraWidth; // Used in EndTable()
+ ImVector<ImGuiTableHeaderData> AngledHeadersRequests; // Used in TableAngledHeadersRow()
ImVec2 UserOuterSize; // outer_size.x passed to BeginTable()
ImDrawListSplitter DrawSplitter;
@@ -2646,7 +2947,7 @@ struct IMGUI_API ImGuiTableTempData
ImGuiTableTempData() { memset(this, 0, sizeof(*this)); LastTimeActive = -1.0f; }
};
-// sizeof() ~ 12
+// sizeof() ~ 16
struct ImGuiTableColumnSettings
{
float WidthOrWeight;
@@ -2655,7 +2956,7 @@ struct ImGuiTableColumnSettings
ImGuiTableColumnIdx DisplayOrder;
ImGuiTableColumnIdx SortOrder;
ImU8 SortDirection : 2;
- ImU8 IsEnabled : 1; // "Visible" in ini file
+ ImS8 IsEnabled : 2; // "Visible" in ini file
ImU8 IsStretch : 1;
ImGuiTableColumnSettings()
@@ -2665,7 +2966,7 @@ struct ImGuiTableColumnSettings
Index = -1;
DisplayOrder = SortOrder = -1;
SortDirection = ImGuiSortDirection_None;
- IsEnabled = 1;
+ IsEnabled = -1;
IsStretch = 0;
}
};
@@ -2693,14 +2994,17 @@ namespace ImGui
{
// Windows
// We should always have a CurrentWindow in the stack (there is an implicit "Debug" window)
- // If this ever crash because g.CurrentWindow is NULL it means that either
+ // If this ever crashes because g.CurrentWindow is NULL, it means that either:
// - ImGui::NewFrame() has never been called, which is illegal.
// - You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
+ IMGUI_API ImGuiIO& GetIO(ImGuiContext* ctx);
+ IMGUI_API ImGuiPlatformIO& GetPlatformIO(ImGuiContext* ctx);
inline ImGuiWindow* GetCurrentWindowRead() { ImGuiContext& g = *GImGui; return g.CurrentWindow; }
inline ImGuiWindow* GetCurrentWindow() { ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed = true; return g.CurrentWindow; }
IMGUI_API ImGuiWindow* FindWindowByID(ImGuiID id);
IMGUI_API ImGuiWindow* FindWindowByName(const char* name);
IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window);
+ IMGUI_API void UpdateWindowSkipRefresh(ImGuiWindow* window);
IMGUI_API ImVec2 CalcWindowNextAutoFitSize(ImGuiWindow* window);
IMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent, bool popup_hierarchy);
IMGUI_API bool IsWindowWithinBeginStackOf(ImGuiWindow* window, ImGuiWindow* potential_parent);
@@ -2710,12 +3014,16 @@ namespace ImGui
IMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond = 0);
IMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond = 0);
IMGUI_API void SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size);
+ IMGUI_API void SetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window);
+ inline void SetWindowParentWindowForFocusRoute(ImGuiWindow* window, ImGuiWindow* parent_window) { window->ParentWindowForFocusRoute = parent_window; }
inline ImRect WindowRectAbsToRel(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x - off.x, r.Min.y - off.y, r.Max.x - off.x, r.Max.y - off.y); }
inline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x + off.x, r.Min.y + off.y, r.Max.x + off.x, r.Max.y + off.y); }
+ inline ImVec2 WindowPosAbsToRel(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x - off.x, p.y - off.y); }
+ inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x + off.x, p.y + off.y); }
// Windows: Display Order and Focus Order
- IMGUI_API void FocusWindow(ImGuiWindow* window);
- IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window);
+ IMGUI_API void FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);
+ IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags);
IMGUI_API void BringWindowToFocusFront(ImGuiWindow* window);
IMGUI_API void BringWindowToDisplayFront(ImGuiWindow* window);
IMGUI_API void BringWindowToDisplayBack(ImGuiWindow* window);
@@ -2723,12 +3031,17 @@ namespace ImGui
IMGUI_API int FindWindowDisplayIndex(ImGuiWindow* window);
IMGUI_API ImGuiWindow* FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window);
+ // Windows: Idle, Refresh Policies [EXPERIMENTAL]
+ IMGUI_API void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);
+
// Fonts, drawing
IMGUI_API void SetCurrentFont(ImFont* font);
inline ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
+ IMGUI_API void PushPasswordFont();
inline ImDrawList* GetForegroundDrawList(ImGuiWindow* window) { IM_UNUSED(window); return GetForegroundDrawList(); } // This seemingly unnecessary wrapper simplifies compatibility between the 'master' and 'docking' branches.
IMGUI_API ImDrawList* GetBackgroundDrawList(ImGuiViewport* viewport); // get background draw list for the given viewport. this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
IMGUI_API ImDrawList* GetForegroundDrawList(ImGuiViewport* viewport); // get foreground draw list for the given viewport. this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.
+ IMGUI_API void AddDrawListToDrawDataEx(ImDrawData* draw_data, ImVector<ImDrawList*>* out_list, ImDrawList* draw_list);
// Init
IMGUI_API void Initialize();
@@ -2737,6 +3050,7 @@ namespace ImGui
// NewFrame
IMGUI_API void UpdateInputEvents(bool trickle_fast_inputs);
IMGUI_API void UpdateHoveredWindowAndCaptureFlags();
+ IMGUI_API void FindHoveredWindowEx(const ImVec2& pos, bool find_first_and_in_any_viewport, ImGuiWindow** out_hovered_window, ImGuiWindow** out_hovered_window_under_moving_window);
IMGUI_API void StartMouseMovingWindow(ImGuiWindow* window);
IMGUI_API void UpdateMouseMovingWindowNewFrame();
IMGUI_API void UpdateMouseMovingWindowEndFrame();
@@ -2747,19 +3061,23 @@ namespace ImGui
IMGUI_API void CallContextHooks(ImGuiContext* context, ImGuiContextHookType type);
// Viewports
+ IMGUI_API void ScaleWindowsInViewport(ImGuiViewportP* viewport, float scale);
IMGUI_API void SetWindowViewport(ImGuiWindow* window, ImGuiViewportP* viewport);
// Settings
IMGUI_API void MarkIniSettingsDirty();
IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window);
IMGUI_API void ClearIniSettings();
- IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name);
- IMGUI_API ImGuiWindowSettings* FindWindowSettings(ImGuiID id);
- IMGUI_API ImGuiWindowSettings* FindOrCreateWindowSettings(const char* name);
IMGUI_API void AddSettingsHandler(const ImGuiSettingsHandler* handler);
IMGUI_API void RemoveSettingsHandler(const char* type_name);
IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);
+ // Settings - Windows
+ IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name);
+ IMGUI_API ImGuiWindowSettings* FindWindowSettingsByID(ImGuiID id);
+ IMGUI_API ImGuiWindowSettings* FindWindowSettingsByWindow(ImGuiWindow* window);
+ IMGUI_API void ClearWindowSettings(const char* name);
+
// Localization
IMGUI_API void LocalizeRegisterEntries(const ImGuiLocEntry* entries, int count);
inline const char* LocalizeGetMsg(ImGuiLocKey key) { ImGuiContext& g = *GImGui; const char* msg = g.LocalizationTable[key]; return msg ? msg : "*Missing Text*"; }
@@ -2779,9 +3097,8 @@ namespace ImGui
//#endif
// Basic Accessors
- inline ImGuiID GetItemID() { ImGuiContext& g = *GImGui; return g.LastItemData.ID; } // Get ID of last item (~~ often same ImGui::GetID(label) beforehand)
- inline ImGuiItemStatusFlags GetItemStatusFlags(){ ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; }
- inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.InFlags; }
+ inline ImGuiItemStatusFlags GetItemStatusFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; }
+ inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.ItemFlags; }
inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; }
inline ImGuiID GetFocusID() { ImGuiContext& g = *GImGui; return g.NavId; }
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);
@@ -2793,46 +3110,54 @@ namespace ImGui
IMGUI_API void MarkItemEdited(ImGuiID id); // Mark data associated to given item as "edited", used by IsItemDeactivatedAfterEdit() function.
IMGUI_API void PushOverrideID(ImGuiID id); // Push given value as-is at the top of the ID stack (whereas PushID combines old and new hashes)
IMGUI_API ImGuiID GetIDWithSeed(const char* str_id_begin, const char* str_id_end, ImGuiID seed);
+ IMGUI_API ImGuiID GetIDWithSeed(int n, ImGuiID seed);
// Basic Helpers for widget code
IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f);
inline void ItemSize(const ImRect& bb, float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); } // FIXME: This is a misleading API since we expect CursorPos to be bb.Min.
IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);
- IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id);
+ IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flags);
+ IMGUI_API bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags = 0);
IMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id);
- IMGUI_API void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags, const ImRect& item_rect);
+ IMGUI_API void SetLastItemData(ImGuiID item_id, ImGuiItemFlags item_flags, ImGuiItemStatusFlags status_flags, const ImRect& item_rect);
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_w, float default_h);
IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x);
IMGUI_API void PushMultiItemsWidths(int components, float width_full);
- IMGUI_API bool IsItemToggledSelection(); // Was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly)
- IMGUI_API ImVec2 GetContentRegionMaxAbs();
IMGUI_API void ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess);
// Parameter stacks (shared)
- IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);
- IMGUI_API void PopItemFlag();
+ IMGUI_API const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx);
+ IMGUI_API void BeginDisabledOverrideReenable();
+ IMGUI_API void EndDisabledOverrideReenable();
// Logging/Capture
- IMGUI_API void LogBegin(ImGuiLogType type, int auto_open_depth); // -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.
+ IMGUI_API void LogBegin(ImGuiLogFlags flags, int auto_open_depth); // -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.
IMGUI_API void LogToBuffer(int auto_open_depth = -1); // Start logging/capturing to internal buffer
IMGUI_API void LogRenderedText(const ImVec2* ref_pos, const char* text, const char* text_end = NULL);
IMGUI_API void LogSetNextTextDecoration(const char* prefix, const char* suffix);
- // Popups, Modals, Tooltips
- IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags);
+ // Childs
+ IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);
+
+ // Popups, Modals
+ IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_window_flags);
+ IMGUI_API bool BeginPopupMenuEx(ImGuiID id, const char* label, ImGuiWindowFlags extra_window_flags);
IMGUI_API void OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
IMGUI_API void ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup);
IMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup);
IMGUI_API void ClosePopupsExceptModals();
IMGUI_API bool IsPopupOpen(ImGuiID id, ImGuiPopupFlags popup_flags);
- IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags);
- IMGUI_API void BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window);
IMGUI_API ImGuiWindow* GetTopMostPopupModal();
IMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal();
+ IMGUI_API ImGuiWindow* FindBlockingModal(ImGuiWindow* window);
IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window);
IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
+ // Tooltips
+ IMGUI_API bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
+ IMGUI_API bool BeginTooltipHidden();
+
// Menus
IMGUI_API bool BeginViewportSideBar(const char* name, ImGuiViewport* viewport, ImGuiDir dir, float size, ImGuiWindowFlags window_flags);
IMGUI_API bool BeginMenuEx(const char* label, const char* icon, bool enabled = true);
@@ -2843,29 +3168,42 @@ namespace ImGui
IMGUI_API bool BeginComboPreview();
IMGUI_API void EndComboPreview();
- // Gamepad/Keyboard Navigation
+ // Keyboard/Gamepad Navigation
IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit);
IMGUI_API void NavInitRequestApplyResult();
IMGUI_API bool NavMoveRequestButNoResultYet();
IMGUI_API void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
IMGUI_API void NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result);
+ IMGUI_API void NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGuiTreeNodeStackData* tree_node_data);
IMGUI_API void NavMoveRequestCancel();
IMGUI_API void NavMoveRequestApplyResult();
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
- IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.
+ IMGUI_API void NavHighlightActivated(ImGuiID id);
+ IMGUI_API void NavClearPreferredPosForAxis(ImGuiAxis axis);
+ IMGUI_API void SetNavCursorVisibleAfterMove();
+ IMGUI_API void NavUpdateCurrentWindowIsScrollPushableX();
IMGUI_API void SetNavWindow(ImGuiWindow* window);
IMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel);
+ IMGUI_API void SetNavFocusScope(ImGuiID focus_scope_id);
+
+ // Focus/Activation
+ // This should be part of a larger set of API: FocusItem(offset = -1), FocusItemByID(id), ActivateItem(offset = -1), ActivateItemByID(id) etc. which are
+ // much harder to design and implement than expected. I have a couple of private branches on this matter but it's not simple. For now implementing the easy ones.
+ IMGUI_API void FocusItem(); // Focus last item (no selection/activation).
+ IMGUI_API void ActivateItemByID(ImGuiID id); // Activate an item by ID (button, checkbox, tree node etc.). Activation is queued and processed on the next frame when the item is encountered again.
// Inputs
// FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.
- inline bool IsNamedKey(ImGuiKey key) { return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
- inline bool IsNamedKeyOrModKey(ImGuiKey key) { return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super; }
- inline bool IsLegacyKey(ImGuiKey key) { return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
- inline bool IsKeyboardKey(ImGuiKey key) { return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
- inline bool IsGamepadKey(ImGuiKey key) { return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
- inline bool IsMouseKey(ImGuiKey key) { return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
- inline bool IsAliasKey(ImGuiKey key) { return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
+ inline bool IsNamedKey(ImGuiKey key) { return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
+ inline bool IsNamedKeyOrMod(ImGuiKey key) { return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super; }
+ inline bool IsLegacyKey(ImGuiKey key) { return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
+ inline bool IsKeyboardKey(ImGuiKey key) { return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
+ inline bool IsGamepadKey(ImGuiKey key) { return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
+ inline bool IsMouseKey(ImGuiKey key) { return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
+ inline bool IsAliasKey(ImGuiKey key) { return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
+ inline bool IsLRModKey(ImGuiKey key) { return key >= ImGuiKey_LeftCtrl && key <= ImGuiKey_RightSuper; }
+ ImGuiKeyChord FixupKeyChord(ImGuiKeyChord key_chord);
inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
{
if (key == ImGuiMod_Ctrl) return ImGuiKey_ReservedForModCtrl;
@@ -2875,21 +3213,23 @@ namespace ImGui
return key;
}
- IMGUI_API ImGuiKeyData* GetKeyData(ImGuiKey key);
- IMGUI_API void GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size);
+ IMGUI_API ImGuiKeyData* GetKeyData(ImGuiContext* ctx, ImGuiKey key);
+ inline ImGuiKeyData* GetKeyData(ImGuiKey key) { ImGuiContext& g = *GImGui; return GetKeyData(&g, key); }
+ IMGUI_API const char* GetKeyChordName(ImGuiKeyChord key_chord);
inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT); return (ImGuiKey)(ImGuiKey_MouseLeft + button); }
IMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f);
- IMGUI_API ImVec2 GetKeyVector2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
+ IMGUI_API ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
IMGUI_API float GetNavTweakPressedAmount(ImGuiAxis axis);
IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate);
IMGUI_API void GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate);
+ IMGUI_API void TeleportMousePos(const ImVec2& pos);
IMGUI_API void SetActiveIdUsingAllKeyboardKeys();
inline bool IsActiveIdUsingNavDir(ImGuiDir dir) { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
// [EXPERIMENTAL] Low-Level: Key/Input Ownership
// - The idea is that instead of "eating" a given input, we can link to an owner id.
// - Ownership is most often claimed as a result of reacting to a press/down event (but occasionally may be claimed ahead).
- // - Input queries can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_None (== -1) or a custom ID.
+ // - Input queries can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_NoOwner (== -1) or a custom ID.
// - Legacy input queries (without specifying an owner or _Any or _None) are equivalent to using ImGuiKeyOwner_Any (== 0).
// - Input ownership is automatically released on the frame after a key is released. Therefore:
// - for ownership registration happening as a result of a down/press event, the SetKeyOwner() call may be done once (common case).
@@ -2897,11 +3237,12 @@ namespace ImGui
// - SetItemKeyOwner() is a shortcut for common simple case. A custom widget will probably want to call SetKeyOwner() multiple times directly based on its interaction state.
// - This is marked experimental because not all widgets are fully honoring the Set/Test idioms. We will need to move forward step by step.
// Please open a GitHub Issue to submit your usage scenario or if there's a use case you need solved.
- IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
- IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
- IMGUI_API void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags = 0); // Set key owner to last item if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
- IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id); // Test that key is either not owned, either owned by 'owner_id'
- inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key)); return &GImGui->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; }
+ IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
+ IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
+ IMGUI_API void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
+ IMGUI_API void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags); // Set key owner to last item if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
+ IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id); // Test that key is either not owned, either owned by 'owner_id'
+ inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiContext* ctx, ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key)); return &ctx->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; }
// [EXPERIMENTAL] High-Level: Input Access functions w/ support for Key/Input Ownership
// - Important: legacy IsKeyPressed(ImGuiKey, bool repeat=true) _DEFAULTS_ to repeat, new IsKeyPressed() requires _EXPLICIT_ ImGuiInputFlags_Repeat flag.
@@ -2909,26 +3250,32 @@ namespace ImGui
// - Specifying a value for 'ImGuiID owner' will test that EITHER the key is NOT owned (UNLESS locked), EITHER the key is owned by 'owner'.
// Legacy functions use ImGuiKeyOwner_Any meaning that they typically ignore ownership, unless a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease.
// - Binding generators may want to ignore those for now, or suffix them with Ex() until we decide if this gets moved into public API.
- IMGUI_API bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
- IMGUI_API bool IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0); // Important: when transitioning from old to new IsKeyPressed(): old API has "bool repeat = true", so would default to repeat. New API requiress explicit ImGuiInputFlags_Repeat.
- IMGUI_API bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
- IMGUI_API bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
- IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0);
- IMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
-
- // [EXPERIMENTAL] Shortcut Routing
- // - ImGuiKeyChord = a ImGuiKey optionally OR-red with ImGuiMod_Alt/ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Super.
- // ImGuiKey_C (accepted by functions taking ImGuiKey or ImGuiKeyChord)
- // ImGuiKey_C | ImGuiMod_Ctrl (accepted by functions taking ImGuiKeyChord)
- // ONLY ImGuiMod_XXX values are legal to 'OR' with an ImGuiKey. You CANNOT 'OR' two ImGuiKey values.
- // - When using one of the routing flags (e.g. ImGuiInputFlags_RouteFocused): routes requested ahead of time given a chord (key + modifiers) and a routing policy.
- // - Routes are resolved during NewFrame(): if keyboard modifiers are matching current ones: SetKeyOwner() is called + route is granted for the frame.
- // - Route is granted to a single owner. When multiple requests are made we have policies to select the winning route.
- // - Multiple read sites may use the same owner id and will all get the granted route.
- // - For routing: when owner_id is 0 we use the current Focus Scope ID as a default owner in order to identify our location.
- IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
- IMGUI_API bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
- IMGUI_API bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
+ IMGUI_API bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
+ IMGUI_API bool IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0); // Important: when transitioning from old to new IsKeyPressed(): old API has "bool repeat = true", so would default to repeat. New API requiress explicit ImGuiInputFlags_Repeat.
+ IMGUI_API bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
+ IMGUI_API bool IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id = 0);
+ IMGUI_API bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
+ IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);
+ IMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
+ IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id);
+
+ // Shortcut Testing & Routing
+ // - Set Shortcut() and SetNextItemShortcut() in imgui.h
+ // - When a policy (except for ImGuiInputFlags_RouteAlways *) is set, Shortcut() will register itself with SetShortcutRouting(),
+ // allowing the system to decide where to route the input among other route-aware calls.
+ // (* using ImGuiInputFlags_RouteAlways is roughly equivalent to calling IsKeyChordPressed(key) and bypassing route registration and check)
+ // - When using one of the routing option:
+ // - The default route is ImGuiInputFlags_RouteFocused (accept inputs if window is in focus stack. Deep-most focused window takes inputs. ActiveId takes inputs over deep-most focused window.)
+ // - Routes are requested given a chord (key + modifiers) and a routing policy.
+ // - Routes are resolved during NewFrame(): if keyboard modifiers are matching current ones: SetKeyOwner() is called + route is granted for the frame.
+ // - Each route may be granted to a single owner. When multiple requests are made we have policies to select the winning route (e.g. deep most window).
+ // - Multiple read sites may use the same owner id can all access the granted route.
+ // - When owner_id is 0 we use the current Focus Scope ID as a owner ID in order to identify our location.
+ // - You can chain two unrelated windows in the focus stack using SetWindowParentWindowForFocusRoute()
+ // e.g. if you have a tool window associated to a document, and you want document shortcuts to run when the tool is focused.
+ IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);
+ IMGUI_API bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id); // owner_id needs to be explicit and cannot be 0
+ IMGUI_API bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
IMGUI_API ImGuiKeyRoutingData* GetShortcutRoutingData(ImGuiKeyChord key_chord);
// [EXPERIMENTAL] Focus Scope
@@ -2948,7 +3295,27 @@ namespace ImGui
IMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id);
IMGUI_API void ClearDragDrop();
IMGUI_API bool IsDragDropPayloadBeingAccepted();
- IMGUI_API void RenderDragDropTargetRect(const ImRect& bb);
+ IMGUI_API void RenderDragDropTargetRect(const ImRect& bb, const ImRect& item_clip_rect);
+
+ // Typing-Select API
+ // (provide Windows Explorer style "select items by typing partial name" + "cycle through items by typing same letter" feature)
+ // (this is currently not documented nor used by main library, but should work. See "widgets_typingselect" in imgui_test_suite for usage code. Please let us know if you use this!)
+ IMGUI_API ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);
+ IMGUI_API int TypingSelectFindMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx);
+ IMGUI_API int TypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx);
+ IMGUI_API int TypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data);
+
+ // Box-Select API
+ IMGUI_API bool BeginBoxSelect(const ImRect& scope_rect, ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags);
+ IMGUI_API void EndBoxSelect(const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags);
+
+ // Multi-Select API
+ IMGUI_API void MultiSelectItemHeader(ImGuiID id, bool* p_selected, ImGuiButtonFlags* p_button_flags);
+ IMGUI_API void MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed);
+ IMGUI_API void MultiSelectAddSetAll(ImGuiMultiSelectTempData* ms, bool selected);
+ IMGUI_API void MultiSelectAddSetRange(ImGuiMultiSelectTempData* ms, bool selected, int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item);
+ inline ImGuiBoxSelectState* GetBoxSelectState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.BoxSelectState.ID == id && g.BoxSelectState.IsActive) ? &g.BoxSelectState : NULL; }
+ inline ImGuiMultiSelectState* GetMultiSelectState(ImGuiID id) { ImGuiContext& g = *GImGui; return g.MultiSelectStorage.GetByKey(id); }
// Internal Columns API (this is not exposed because we will encourage transitioning to the Tables API)
IMGUI_API void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window, const ImRect& clip_rect);
@@ -2966,10 +3333,12 @@ namespace ImGui
IMGUI_API void TableOpenContextMenu(int column_n = -1);
IMGUI_API void TableSetColumnWidth(int column_n, float width);
IMGUI_API void TableSetColumnSortDirection(int column_n, ImGuiSortDirection sort_direction, bool append_to_sort_specs);
- IMGUI_API int TableGetHoveredColumn(); // May use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. Return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
+ IMGUI_API int TableGetHoveredRow(); // Retrieve *PREVIOUS FRAME* hovered row. This difference with TableGetHoveredColumn() is the reason why this is not public yet.
IMGUI_API float TableGetHeaderRowHeight();
+ IMGUI_API float TableGetHeaderAngledMaxLabelWidth();
IMGUI_API void TablePushBackgroundChannel();
IMGUI_API void TablePopBackgroundChannel();
+ IMGUI_API void TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count);
// Tables: Internals
inline ImGuiTable* GetCurrentTable() { ImGuiContext& g = *GImGui; return g.CurrentTable; }
@@ -2982,10 +3351,11 @@ namespace ImGui
IMGUI_API void TableUpdateBorders(ImGuiTable* table);
IMGUI_API void TableUpdateColumnsWeightFromWidth(ImGuiTable* table);
IMGUI_API void TableDrawBorders(ImGuiTable* table);
- IMGUI_API void TableDrawContextMenu(ImGuiTable* table);
+ IMGUI_API void TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);
IMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table);
IMGUI_API void TableMergeDrawChannels(ImGuiTable* table);
- inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; }
+ inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; }
+ inline ImGuiID TableGetInstanceID(ImGuiTable* table, int instance_no) { return TableGetInstanceData(table, instance_no)->TableInstanceID; }
IMGUI_API void TableSortSpecsSanitize(ImGuiTable* table);
IMGUI_API void TableSortSpecsBuild(ImGuiTable* table);
IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);
@@ -2997,8 +3367,8 @@ namespace ImGui
IMGUI_API void TableEndCell(ImGuiTable* table);
IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n);
IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n);
- IMGUI_API ImGuiID TableGetColumnResizeID(const ImGuiTable* table, int column_n, int instance_no = 0);
- IMGUI_API float TableGetMaxColumnWidth(const ImGuiTable* table, int column_n);
+ IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0);
+ IMGUI_API float TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n);
IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n);
IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table);
IMGUI_API void TableRemove(ImGuiTable* table);
@@ -3016,15 +3386,24 @@ namespace ImGui
IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID id);
// Tab Bars
+ inline ImGuiTabBar* GetCurrentTabBar() { ImGuiContext& g = *GImGui; return g.CurrentTabBar; }
IMGUI_API bool BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& bb, ImGuiTabBarFlags flags);
IMGUI_API ImGuiTabItem* TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id);
+ IMGUI_API ImGuiTabItem* TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order);
+ IMGUI_API ImGuiTabItem* TabBarGetCurrentTab(ImGuiTabBar* tab_bar);
+ inline int TabBarGetTabOrder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) { return tab_bar->Tabs.index_from_ptr(tab); }
+ IMGUI_API const char* TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
IMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id);
IMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
- IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int offset);
- IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, ImVec2 mouse_pos);
+ IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
+ IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, const char* tab_name);
+ IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset);
+ IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, ImVec2 mouse_pos);
IMGUI_API bool TabBarProcessReorder(ImGuiTabBar* tab_bar);
- IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags);
+ IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window);
+ IMGUI_API void TabItemSpacing(const char* str_id, ImGuiTabItemFlags flags, float width);
IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker);
+ IMGUI_API ImVec2 TabItemCalcSize(ImGuiWindow* window);
IMGUI_API void TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
IMGUI_API void TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImVec2 frame_padding, const char* label, ImGuiID tab_id, ImGuiID close_button_id, bool is_contents_visible, bool* out_just_closed, bool* out_text_clipped);
@@ -3036,10 +3415,13 @@ namespace ImGui
IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);
IMGUI_API void RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);
IMGUI_API void RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float clip_max_x, float ellipsis_max_x, const char* text, const char* text_end, const ImVec2* text_size_if_known);
- IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f);
+ IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool borders = true, float rounding = 0.0f);
IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f);
IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding = 0.0f, ImDrawFlags flags = 0);
- IMGUI_API void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault); // Navigation highlight
+ IMGUI_API void RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None); // Navigation highlight
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ inline void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None) { RenderNavCursor(bb, id, flags); } // Renamed in 1.91.4
+#endif
IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text.
IMGUI_API void RenderMouseCursor(ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
@@ -3054,29 +3436,35 @@ namespace ImGui
// Widgets
IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0);
IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
+ IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0);
+ IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0);
+ IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags, float thickness = 1.0f);
+ IMGUI_API void SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_width);
+ IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value);
+ IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value);
+
+ // Widgets: Window Decorations
IMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos);
IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2& pos);
- IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0);
IMGUI_API void Scrollbar(ImGuiAxis axis);
- IMGUI_API bool ScrollbarEx(const ImRect& bb, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags flags);
- IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col);
+ IMGUI_API bool ScrollbarEx(const ImRect& bb, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags draw_rounding_flags = 0);
IMGUI_API ImRect GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis);
IMGUI_API ImGuiID GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis);
IMGUI_API ImGuiID GetWindowResizeCornerID(ImGuiWindow* window, int n); // 0..3: corners
IMGUI_API ImGuiID GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir);
- IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags);
- IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value);
- IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value);
// Widgets low-level behaviors
IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);
IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags);
IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb);
- IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f);
+ IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f, ImU32 bg_col = 0);
+
+ // Widgets: Tree Nodes
IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);
IMGUI_API void TreePushOverrideID(ImGuiID id);
- IMGUI_API void TreeNodeSetOpen(ImGuiID id, bool open);
- IMGUI_API bool TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags); // Return open state. Consume previous SetNextItemOpen() data, if any. May return true when logging.
+ IMGUI_API bool TreeNodeGetOpen(ImGuiID storage_id);
+ IMGUI_API void TreeNodeSetOpen(ImGuiID storage_id, bool open);
+ IMGUI_API bool TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags); // Return open state. Consume previous SetNextItemOpen() data, if any. May return true when logging.
// Template functions are instantiated in imgui_widgets.cpp for a finite number of types.
// To use them externally (for custom widget) you may need an "extern template" statement in your code in order to link to existing instances and silence Clang warnings (see #2036).
@@ -3092,16 +3480,20 @@ namespace ImGui
IMGUI_API const ImGuiDataTypeInfo* DataTypeGetInfo(ImGuiDataType data_type);
IMGUI_API int DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format);
IMGUI_API void DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, const void* arg_1, const void* arg_2);
- IMGUI_API bool DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format);
+ IMGUI_API bool DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format, void* p_data_when_empty = NULL);
IMGUI_API int DataTypeCompare(ImGuiDataType data_type, const void* arg_1, const void* arg_2);
IMGUI_API bool DataTypeClamp(ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max);
+ IMGUI_API bool DataTypeIsZero(ImGuiDataType data_type, const void* p_data);
// InputText
IMGUI_API bool InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
+ IMGUI_API void InputTextDeactivateHook(ImGuiID id);
IMGUI_API bool TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags);
IMGUI_API bool TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min = NULL, const void* p_clamp_max = NULL);
inline bool TempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.ActiveId == id && g.TempInputId == id); }
inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active
+ IMGUI_API void SetNextItemRefVal(ImGuiDataType data_type, void* p_data);
+ inline bool IsItemActiveAsInputText() { ImGuiContext& g = *GImGui; return g.ActiveId != 0 && g.ActiveId == g.LastItemData.ID && g.InputTextState.ID == g.LastItemData.ID; } // This may be useful to apply workaround that a based on distinguish whenever an item is active as a text input field.
// Color
IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags);
@@ -3109,34 +3501,44 @@ namespace ImGui
IMGUI_API void ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags);
// Plot
- IMGUI_API int PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size);
+ IMGUI_API int PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, const ImVec2& size_arg);
// Shade functions (write over already created vertices)
IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);
IMGUI_API void ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp);
+ IMGUI_API void ShadeVertsTransformPos(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& pivot_in, float cos_a, float sin_a, const ImVec2& pivot_out);
// Garbage collection
IMGUI_API void GcCompactTransientMiscBuffers();
IMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow* window);
IMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow* window);
- // Debug Log
- IMGUI_API void DebugLog(const char* fmt, ...) IM_FMTARGS(1);
- IMGUI_API void DebugLogV(const char* fmt, va_list args) IM_FMTLIST(1);
+ // Error handling, State Recovery
+ IMGUI_API bool ErrorLog(const char* msg);
+ IMGUI_API void ErrorRecoveryStoreState(ImGuiErrorRecoveryState* state_out);
+ IMGUI_API void ErrorRecoveryTryToRecoverState(const ImGuiErrorRecoveryState* state_in);
+ IMGUI_API void ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in);
+ IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
+ IMGUI_API void ErrorCheckEndFrameFinalizeErrorTooltip();
+ IMGUI_API bool BeginErrorTooltip();
+ IMGUI_API void EndErrorTooltip();
// Debug Tools
- IMGUI_API void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
- IMGUI_API void ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
- IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
+ IMGUI_API void DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr, size_t size); // size >= 0 : alloc, size = -1 : free
+ IMGUI_API void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255));
+ IMGUI_API void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255));
+ IMGUI_API void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255));
+ IMGUI_API void DebugTextUnformattedWithLocateItem(const char* line_begin, const char* line_end);
IMGUI_API void DebugLocateItem(ImGuiID target_id); // Call sparingly: only 1 at the same time!
IMGUI_API void DebugLocateItemOnHover(ImGuiID target_id); // Only call on reaction to a mouse Hover: because only 1 at the same time!
IMGUI_API void DebugLocateItemResolveWithLastItem();
- inline void DebugDrawItemRect(ImU32 col = IM_COL32(255,0,0,255)) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; GetForegroundDrawList(window)->AddRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, col); }
- inline void DebugStartItemPicker() { ImGuiContext& g = *GImGui; g.DebugItemPickerActive = true; }
+ IMGUI_API void DebugBreakClearData();
+ IMGUI_API bool DebugBreakButton(const char* label, const char* description_of_location);
+ IMGUI_API void DebugBreakButtonTooltip(bool keyboard_only, const char* description_of_location);
IMGUI_API void ShowFontAtlas(ImFontAtlas* atlas);
IMGUI_API void DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end);
IMGUI_API void DebugNodeColumns(ImGuiOldColumns* columns);
- IMGUI_API void DebugNodeDrawList(ImGuiWindow* window, const ImDrawList* draw_list, const char* label);
+ IMGUI_API void DebugNodeDrawList(ImGuiWindow* window, ImGuiViewportP* viewport, const ImDrawList* draw_list, const char* label);
IMGUI_API void DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, const ImDrawList* draw_list, const ImDrawCmd* draw_cmd, bool show_mesh, bool show_aabb);
IMGUI_API void DebugNodeFont(ImFont* font);
IMGUI_API void DebugNodeFontGlyph(ImFont* font, const ImFontGlyph* glyph);
@@ -3145,28 +3547,28 @@ namespace ImGui
IMGUI_API void DebugNodeTable(ImGuiTable* table);
IMGUI_API void DebugNodeTableSettings(ImGuiTableSettings* settings);
IMGUI_API void DebugNodeInputTextState(ImGuiInputTextState* state);
+ IMGUI_API void DebugNodeTypingSelectState(ImGuiTypingSelectState* state);
+ IMGUI_API void DebugNodeMultiSelectState(ImGuiMultiSelectState* state);
IMGUI_API void DebugNodeWindow(ImGuiWindow* window, const char* label);
IMGUI_API void DebugNodeWindowSettings(ImGuiWindowSettings* settings);
IMGUI_API void DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* label);
IMGUI_API void DebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows, int windows_size, ImGuiWindow* parent_in_begin_stack);
IMGUI_API void DebugNodeViewport(ImGuiViewportP* viewport);
+ IMGUI_API void DebugRenderKeyboardPreview(ImDrawList* draw_list);
IMGUI_API void DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb);
// Obsolete functions
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); } // Changed in 1.89
- inline bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0) { return TreeNodeUpdateNextOpen(id, flags); } // Renamed in 1.89
+ //inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); } // Changed in 1.89
+ //inline bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0) { return TreeNodeUpdateNextOpen(id, flags); } // Renamed in 1.89
+ //inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { IM_ASSERT(IsNamedKey(key)); return IsKeyPressed(key, repeat); } // Removed in 1.87: Mapping from named key is always identity!
- // Refactored focus/nav/tabbing system in 1.82 and 1.84. If you have old/custom copy-and-pasted widgets that used FocusableItemRegister():
+ // Refactored focus/nav/tabbing system in 1.82 and 1.84. If you have old/custom copy-and-pasted widgets which used FocusableItemRegister():
// (Old) IMGUI_VERSION_NUM < 18209: using 'ItemAdd(....)' and 'bool tab_focused = FocusableItemRegister(...)'
- // (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
- // (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedTabbing) != 0 || g.NavActivateInputId == id' (WIP)
- // Widget code are simplified as there's no need to call FocusableItemUnregister() while managing the transition from regular widget to TempInputText()
- inline bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id) { IM_ASSERT(0); IM_UNUSED(window); IM_UNUSED(id); return false; } // -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd()
- inline void FocusableItemUnregister(ImGuiWindow* window) { IM_ASSERT(0); IM_UNUSED(window); } // -> unnecessary: TempInputText() uses ImGuiInputTextFlags_MergedItem
-#endif
-#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
- inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { IM_ASSERT(IsNamedKey(key)); return IsKeyPressed(key, repeat); } // Removed in 1.87: Mapping from named key is always identity!
+ // (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool tab_focused = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Focused) != 0'
+ // (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))'
+ //inline bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id) // -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd()
+ //inline void FocusableItemUnregister(ImGuiWindow* window) // -> unnecessary: TempInputText() uses ImGuiInputTextFlags_MergedItem
#endif
} // namespace ImGui
@@ -3176,7 +3578,8 @@ namespace ImGui
// [SECTION] ImFontAtlas internal API
//-----------------------------------------------------------------------------
-// This structure is likely to evolve as we add support for incremental atlas updates
+// This structure is likely to evolve as we add support for incremental atlas updates.
+// Conceptually this could be in ImGuiPlatformIO, but we are far from ready to make this public.
struct ImFontBuilderIO
{
bool (*FontBuilder_Build)(ImFontAtlas* atlas);
@@ -3186,28 +3589,33 @@ struct ImFontBuilderIO
#ifdef IMGUI_ENABLE_STB_TRUETYPE
IMGUI_API const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype();
#endif
+IMGUI_API void ImFontAtlasUpdateSourcesPointers(ImFontAtlas* atlas);
IMGUI_API void ImFontAtlasBuildInit(ImFontAtlas* atlas);
-IMGUI_API void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent);
+IMGUI_API void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* src, float ascent, float descent);
IMGUI_API void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opaque);
IMGUI_API void ImFontAtlasBuildFinish(ImFontAtlas* atlas);
IMGUI_API void ImFontAtlasBuildRender8bppRectFromString(ImFontAtlas* atlas, int x, int y, int w, int h, const char* in_str, char in_marker_char, unsigned char in_marker_pixel_value);
IMGUI_API void ImFontAtlasBuildRender32bppRectFromString(ImFontAtlas* atlas, int x, int y, int w, int h, const char* in_str, char in_marker_char, unsigned int in_marker_pixel_value);
IMGUI_API void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], float in_multiply_factor);
IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride);
+IMGUI_API void ImFontAtlasBuildGetOversampleFactors(const ImFontConfig* src, int* out_oversample_h, int* out_oversample_v);
+
+IMGUI_API bool ImFontAtlasGetMouseCursorTexData(ImFontAtlas* atlas, ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]);
//-----------------------------------------------------------------------------
// [SECTION] Test Engine specific hooks (imgui_test_engine)
//-----------------------------------------------------------------------------
#ifdef IMGUI_ENABLE_TEST_ENGINE
-extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id);
+extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, ImGuiID id, const ImRect& bb, const ImGuiLastItemData* item_data); // item_data may be NULL
extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags flags);
extern void ImGuiTestEngineHook_Log(ImGuiContext* ctx, const char* fmt, ...);
extern const char* ImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ctx, ImGuiID id);
-#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID) // Register item bounding box
-#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional)
-#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
+// In IMGUI_VERSION_NUM >= 18934: changed IMGUI_TEST_ENGINE_ITEM_ADD(bb,id) to IMGUI_TEST_ENGINE_ITEM_ADD(id,bb,item_data);
+#define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA) // Register item bounding box
+#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional)
+#define IMGUI_TEST_ENGINE_LOG(_FMT,...) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
#else
#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp
index 66a46573b95..c98aea2d1cc 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.89.1 WIP
+// dear imgui, v1.91b
// (tables and columns code)
/*
@@ -24,8 +24,9 @@ Index of this file:
*/
// Navigating this file:
-// - In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
-// - With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
+// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
+// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments.
+// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments.
//-----------------------------------------------------------------------------
// [SECTION] Commentary
@@ -48,7 +49,8 @@ Index of this file:
// - TableUpdateLayout() [Internal] followup to BeginTable(): setup everything: widths, columns positions, clipping rectangles. Automatically called by the FIRST call to TableNextRow() or TableHeadersRow().
// | TableSetupDrawChannels() - setup ImDrawList channels
// | TableUpdateBorders() - detect hovering columns for resize, ahead of contents submission
-// | TableDrawContextMenu() - draw right-click context menu
+// | TableBeginContextMenuPopup()
+// | - TableDrawDefaultContextMenu() - draw right-click context menu contents
//-----------------------------------------------------------------------------
// - TableHeadersRow() or TableHeader() user submit a headers row (optional)
// | TableSortSpecsClickColumn() - when left-clicked: alter sort order and sort direction
@@ -80,20 +82,20 @@ Index of this file:
// - outer_size.x <= 0.0f -> Right-align from window/work-rect right-most edge. With -FLT_MIN or 0.0f will align exactly on right-most edge.
// - outer_size.x > 0.0f -> Set Fixed width.
// Y with ScrollX/ScrollY disabled: we output table directly in current window
-// - outer_size.y < 0.0f -> Bottom-align (but will auto extend, unless _NoHostExtendY is set). Not meaningful is parent window can vertically scroll.
+// - outer_size.y < 0.0f -> Bottom-align (but will auto extend, unless _NoHostExtendY is set). Not meaningful if parent window can vertically scroll.
// - outer_size.y = 0.0f -> No minimum height (but will auto extend, unless _NoHostExtendY is set)
-// - outer_size.y > 0.0f -> Set Minimum height (but will auto extend, unless _NoHostExtenY is set)
+// - outer_size.y > 0.0f -> Set Minimum height (but will auto extend, unless _NoHostExtendY is set)
// Y with ScrollX/ScrollY enabled: using a child window for scrolling
-// - outer_size.y < 0.0f -> Bottom-align. Not meaningful is parent window can vertically scroll.
+// - outer_size.y < 0.0f -> Bottom-align. Not meaningful if parent window can vertically scroll.
// - outer_size.y = 0.0f -> Bottom-align, consistent with BeginChild(). Not recommended unless table is last item in parent window.
// - outer_size.y > 0.0f -> Set Exact height. Recommended when using Scrolling on any axis.
//-----------------------------------------------------------------------------
// Outer size is also affected by the NoHostExtendX/NoHostExtendY flags.
-// Important to that note how the two flags have slightly different behaviors!
+// Important to note how the two flags have slightly different behaviors!
// - ImGuiTableFlags_NoHostExtendX -> Make outer width auto-fit to columns (overriding outer_size.x value). Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
// - ImGuiTableFlags_NoHostExtendY -> Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY is disabled. Data below the limit will be clipped and not visible.
// In theory ImGuiTableFlags_NoHostExtendY could be the default and any non-scrolling tables with outer_size.y != 0.0f would use exact height.
-// This would be consistent but perhaps less useful and more confusing (as vertically clipped items are not easily noticeable)
+// This would be consistent but perhaps less useful and more confusing (as vertically clipped items are not useful and not easily noticeable).
//-----------------------------------------------------------------------------
// About 'inner_width':
// With ScrollX disabled:
@@ -112,15 +114,16 @@ Index of this file:
//-----------------------------------------------------------------------------
// COLUMNS SIZING POLICIES
+// (Reference: ImGuiTableFlags_SizingXXX flags and ImGuiTableColumnFlags_WidthXXX flags)
//-----------------------------------------------------------------------------
// About overriding column sizing policy and width/weight with TableSetupColumn():
-// We use a default parameter of 'init_width_or_weight == -1'.
+// We use a default parameter of -1 for 'init_width'/'init_weight'.
// - with ImGuiTableColumnFlags_WidthFixed, init_width <= 0 (default) --> width is automatic
// - with ImGuiTableColumnFlags_WidthFixed, init_width > 0 (explicit) --> width is custom
// - with ImGuiTableColumnFlags_WidthStretch, init_weight <= 0 (default) --> weight is 1.0f
// - with ImGuiTableColumnFlags_WidthStretch, init_weight > 0 (explicit) --> weight is custom
// Widths are specified _without_ CellPadding. If you specify a width of 100.0f, the column will be cover (100.0f + Padding * 2.0f)
-// and you can fit a 100.0f wide item in it without clipping and with full padding.
+// and you can fit a 100.0f wide item in it without clipping and with padding honored.
//-----------------------------------------------------------------------------
// About default sizing policy (if you don't specify a ImGuiTableColumnFlags_WidthXXXX flag)
// - with Table policy ImGuiTableFlags_SizingFixedFit --> default Column policy is ImGuiTableColumnFlags_WidthFixed, default Width is equal to contents width
@@ -134,10 +137,10 @@ Index of this file:
// - using mixed policies with ScrollX does not make much sense, as using Stretch columns with ScrollX does not make much sense in the first place!
// that is, unless 'inner_width' is passed to BeginTable() to explicitly provide a total width to layout columns in.
// - when using ImGuiTableFlags_SizingFixedSame with mixed columns, only the Fixed/Auto columns will match their widths to the width of the maximum contents.
-// - when using ImGuiTableFlags_SizingStretchSame with mixed columns, only the Stretch columns will match their weight/widths.
+// - when using ImGuiTableFlags_SizingStretchSame with mixed columns, only the Stretch columns will match their weights/widths.
//-----------------------------------------------------------------------------
// About using column width:
-// If a column is manual resizable or has a width specified with TableSetupColumn():
+// If a column is manually resizable or has a width specified with TableSetupColumn():
// - you may use GetContentRegionAvail().x to query the width available in a given column.
// - right-side alignment features such as SetNextItemWidth(-x) or PushItemWidth(-x) will rely on this width.
// If the column is not resizable and has no width specified with TableSetupColumn():
@@ -151,7 +154,7 @@ Index of this file:
// TABLES CLIPPING/CULLING
//-----------------------------------------------------------------------------
// About clipping/culling of Rows in Tables:
-// - For large numbers of rows, it is recommended you use ImGuiListClipper to only submit visible rows.
+// - For large numbers of rows, it is recommended you use ImGuiListClipper to submit only visible rows.
// ImGuiListClipper is reliant on the fact that rows are of equal height.
// See 'Demo->Tables->Vertical Scrolling' or 'Demo->Tables->Advanced' for a demo of using the clipper.
// - Note that auto-resizing columns don't play well with using the clipper.
@@ -168,7 +171,7 @@ Index of this file:
// - Case C: column is hidden explicitly by the user (e.g. via the context menu, or _DefaultHide column flag, etc.).
//
// [A] [B] [C]
-// TableNextColumn(): true false false -> [userland] when TableNextColumn() / TableSetColumnIndex() return false, user can skip submitting items but only if the column doesn't contribute to row height.
+// TableNextColumn(): true false false -> [userland] when TableNextColumn() / TableSetColumnIndex() returns false, user can skip submitting items but only if the column doesn't contribute to row height.
// SkipItems: false false true -> [internal] when SkipItems is true, most widgets will early out if submitted, resulting is no layout output.
// ClipRect: normal zero-width zero-width -> [internal] when ClipRect is zero, ItemAdd() will return false and most widgets will early out mid-way.
// ImDrawList output: normal dummy dummy -> [internal] when using the dummy channel, ImDrawList submissions (if any) will be wasted (because cliprect is zero-width anyway).
@@ -188,20 +191,16 @@ Index of this file:
#define _CRT_SECURE_NO_WARNINGS
#endif
-#include "imgui.h"
-#ifndef IMGUI_DISABLE
-
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
+
+#include "imgui.h"
+#ifndef IMGUI_DISABLE
#include "imgui_internal.h"
// System includes
-#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
-#include <stddef.h> // intptr_t
-#else
#include <stdint.h> // intptr_t
-#endif
// Visual Studio warnings
#ifdef _MSC_VER
@@ -222,6 +221,7 @@ Index of this file:
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants (typically 0.0f) is ok.
+#pragma clang diagnostic ignored "-Wformat" // warning: format specifies type 'int' but the argument has type 'unsigned int'
#pragma clang diagnostic ignored "-Wformat-nonliteral" // warning: format string is not a string literal // passing non-literal to vsnformat(). yes, user passing incorrect format strings can crash the code.
#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant // some standard header variations use #define NULL 0
@@ -229,9 +229,16 @@ Index of this file:
#pragma clang diagnostic ignored "-Wenum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_')
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
+#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
+#pragma clang diagnostic ignored "-Wswitch-default" // warning: 'switch' missing 'default' label
#elif defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
+#pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
+#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
+#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'int'/'void*', but argument X has type 'unsigned int'/'ImGuiWindow*'
+#pragma GCC diagnostic ignored "-Wstrict-overflow"
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
#endif
@@ -315,28 +322,36 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
return false;
// Sanity checks
- IM_ASSERT(columns_count > 0 && columns_count <= IMGUI_TABLE_MAX_COLUMNS && "Only 1..64 columns allowed!");
+ IM_ASSERT(columns_count > 0 && columns_count < IMGUI_TABLE_MAX_COLUMNS);
if (flags & ImGuiTableFlags_ScrollX)
IM_ASSERT(inner_width >= 0.0f);
- // If an outer size is specified ahead we will be able to early out when not visible. Exact clipping rules may evolve.
+ // If an outer size is specified ahead we will be able to early out when not visible. Exact clipping criteria may evolve.
+ // FIXME: coarse clipping because access to table data causes two issues:
+ // - instance numbers varying/unstable. may not be a direct problem for users, but could make outside access broken or confusing, e.g. TestEngine.
+ // - can't implement support for ImGuiChildFlags_ResizeY as we need to somehow pull the height data from somewhere. this also needs stable instance numbers.
+ // The side-effects of accessing table data on coarse clip would be:
+ // - always reserving the pooled ImGuiTable data ahead for a fully clipped table (minor IMHO). Also the 'outer_window_is_measuring_size' criteria may already be defeating this in some situations.
+ // - always performing the GetOrAddByKey() O(log N) query in g.Tables.Map[].
const bool use_child_window = (flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) != 0;
const ImVec2 avail_size = GetContentRegionAvail();
- ImVec2 actual_outer_size = CalcItemSize(outer_size, ImMax(avail_size.x, 1.0f), use_child_window ? ImMax(avail_size.y, 1.0f) : 0.0f);
- ImRect outer_rect(outer_window->DC.CursorPos, outer_window->DC.CursorPos + actual_outer_size);
- if (use_child_window && IsClippedEx(outer_rect, 0))
+ const ImVec2 actual_outer_size = ImTrunc(CalcItemSize(outer_size, ImMax(avail_size.x, 1.0f), use_child_window ? ImMax(avail_size.y, 1.0f) : 0.0f));
+ const ImRect outer_rect(outer_window->DC.CursorPos, outer_window->DC.CursorPos + actual_outer_size);
+ const bool outer_window_is_measuring_size = (outer_window->AutoFitFramesX > 0) || (outer_window->AutoFitFramesY > 0); // Doesn't apply to AlwaysAutoResize windows!
+ if (use_child_window && IsClippedEx(outer_rect, 0) && !outer_window_is_measuring_size)
{
ItemSize(outer_rect);
+ ItemAdd(outer_rect, id);
+ g.NextWindowData.ClearFlags();
return false;
}
+ // [DEBUG] Debug break requested by user
+ if (g.DebugBreakInTable == id)
+ IM_DEBUG_BREAK();
+
// Acquire storage for the table
ImGuiTable* table = g.Tables.GetOrAddByKey(id);
- const int instance_no = (table->LastFrameActive != g.FrameCount) ? 0 : table->InstanceCurrent + 1;
- const ImGuiID instance_id = id + instance_no;
- const ImGuiTableFlags table_last_flags = table->Flags;
- if (instance_no > 0)
- IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID");
// Acquire temporary buffers
const int table_idx = g.Tables.GetIndex(table);
@@ -352,17 +367,35 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
flags = TableFixFlags(flags, outer_window);
// Initialize
+ const int previous_frame_active = table->LastFrameActive;
+ const int instance_no = (previous_frame_active != g.FrameCount) ? 0 : table->InstanceCurrent + 1;
+ const ImGuiTableFlags previous_flags = table->Flags;
table->ID = id;
table->Flags = flags;
- table->InstanceCurrent = (ImS16)instance_no;
table->LastFrameActive = g.FrameCount;
table->OuterWindow = table->InnerWindow = outer_window;
table->ColumnsCount = columns_count;
table->IsLayoutLocked = false;
table->InnerWidth = inner_width;
+ table->NavLayer = (ImS8)outer_window->DC.NavLayerCurrent;
temp_data->UserOuterSize = outer_size;
- if (instance_no > 0 && table->InstanceDataExtra.Size < instance_no)
- table->InstanceDataExtra.push_back(ImGuiTableInstanceData());
+
+ // Instance data (for instance 0, TableID == TableInstanceID)
+ ImGuiID instance_id;
+ table->InstanceCurrent = (ImS16)instance_no;
+ if (instance_no > 0)
+ {
+ IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID");
+ if (table->InstanceDataExtra.Size < instance_no)
+ table->InstanceDataExtra.push_back(ImGuiTableInstanceData());
+ instance_id = GetIDWithSeed(instance_no, GetIDWithSeed("##Instances", NULL, id)); // Push "##Instances" followed by (int)instance_no in ID stack.
+ }
+ else
+ {
+ instance_id = id;
+ }
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
+ table_instance->TableInstanceID = instance_id;
// When not using a child window, WorkRect.Max will grow as we append contents.
if (use_child_window)
@@ -384,27 +417,46 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
SetNextWindowContentSize(ImVec2(override_content_size.x != FLT_MAX ? override_content_size.x : 0.0f, override_content_size.y != FLT_MAX ? override_content_size.y : 0.0f));
// Reset scroll if we are reactivating it
- if ((table_last_flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) == 0)
- SetNextWindowScroll(ImVec2(0.0f, 0.0f));
+ if ((previous_flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) == 0)
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasScroll) == 0)
+ SetNextWindowScroll(ImVec2(0.0f, 0.0f));
// Create scrolling region (without border and zero window padding)
- ImGuiWindowFlags child_flags = (flags & ImGuiTableFlags_ScrollX) ? ImGuiWindowFlags_HorizontalScrollbar : ImGuiWindowFlags_None;
- BeginChildEx(name, instance_id, outer_rect.GetSize(), false, child_flags);
+ ImGuiChildFlags child_child_flags = (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasChildFlags) ? g.NextWindowData.ChildFlags : ImGuiChildFlags_None;
+ ImGuiWindowFlags child_window_flags = (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasWindowFlags) ? g.NextWindowData.WindowFlags : ImGuiWindowFlags_None;
+ if (flags & ImGuiTableFlags_ScrollX)
+ child_window_flags |= ImGuiWindowFlags_HorizontalScrollbar;
+ BeginChildEx(name, instance_id, outer_rect.GetSize(), child_child_flags, child_window_flags);
table->InnerWindow = g.CurrentWindow;
table->WorkRect = table->InnerWindow->WorkRect;
table->OuterRect = table->InnerWindow->Rect();
table->InnerRect = table->InnerWindow->InnerRect;
IM_ASSERT(table->InnerWindow->WindowPadding.x == 0.0f && table->InnerWindow->WindowPadding.y == 0.0f && table->InnerWindow->WindowBorderSize == 0.0f);
+
+ // Allow submitting when host is measuring
+ if (table->InnerWindow->SkipItems && outer_window_is_measuring_size)
+ table->InnerWindow->SkipItems = false;
+
+ // When using multiple instances, ensure they have the same amount of horizontal decorations (aka vertical scrollbar) so stretched columns can be aligned)
+ if (instance_no == 0)
+ {
+ table->HasScrollbarYPrev = table->HasScrollbarYCurr;
+ table->HasScrollbarYCurr = false;
+ }
+ table->HasScrollbarYCurr |= table->InnerWindow->ScrollbarY;
}
else
{
// For non-scrolling tables, WorkRect == OuterRect == InnerRect.
// But at this point we do NOT have a correct value for .Max.y (unless a height has been explicitly passed in). It will only be updated in EndTable().
table->WorkRect = table->OuterRect = table->InnerRect = outer_rect;
+ table->HasScrollbarYPrev = table->HasScrollbarYCurr = false;
}
// Push a standardized ID for both child-using and not-child-using tables
- PushOverrideID(instance_id);
+ PushOverrideID(id);
+ if (instance_no > 0)
+ PushOverrideID(instance_id); // FIXME: Somehow this is not resolved by stack-tool, even tho GetIDWithSeed() submitted the symbol.
// Backup a copy of host window members we will modify
ImGuiWindow* inner_window = table->InnerWindow;
@@ -421,6 +473,29 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
temp_data->HostBackupItemWidthStackSize = outer_window->DC.ItemWidthStack.Size;
inner_window->DC.PrevLineSize = inner_window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
+ // Make borders not overlap our contents by offsetting HostClipRect (#6765, #7428, #3752)
+ // (we normally shouldn't alter HostClipRect as we rely on TableMergeDrawChannels() expanding non-clipped column toward the
+ // limits of that rectangle, in order for ImDrawListSplitter::Merge() to merge the draw commands. However since the overlap
+ // problem only affect scrolling tables in this case we can get away with doing it without extra cost).
+ if (inner_window != outer_window)
+ {
+ // FIXME: Because inner_window's Scrollbar doesn't know about border size, since it's not encoded in window->WindowBorderSize,
+ // it already overlaps it and doesn't need an extra offset. Ideally we should be able to pass custom border size with
+ // different x/y values to BeginChild().
+ if (flags & ImGuiTableFlags_BordersOuterV)
+ {
+ table->HostClipRect.Min.x = ImMin(table->HostClipRect.Min.x + TABLE_BORDER_SIZE, table->HostClipRect.Max.x);
+ if (inner_window->DecoOuterSizeX2 == 0.0f)
+ table->HostClipRect.Max.x = ImMax(table->HostClipRect.Max.x - TABLE_BORDER_SIZE, table->HostClipRect.Min.x);
+ }
+ if (flags & ImGuiTableFlags_BordersOuterH)
+ {
+ table->HostClipRect.Min.y = ImMin(table->HostClipRect.Min.y + TABLE_BORDER_SIZE, table->HostClipRect.Max.y);
+ if (inner_window->DecoOuterSizeY2 == 0.0f)
+ table->HostClipRect.Max.y = ImMax(table->HostClipRect.Max.y - TABLE_BORDER_SIZE, table->HostClipRect.Min.y);
+ }
+ }
+
// Padding and Spacing
// - None ........Content..... Pad .....Content........
// - PadOuter | Pad ..Content..... Pad .....Content.. Pad |
@@ -434,7 +509,6 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
table->CellSpacingX1 = inner_spacing_explicit + inner_spacing_for_border;
table->CellSpacingX2 = inner_spacing_explicit;
table->CellPaddingX = inner_padding_explicit;
- table->CellPaddingY = g.Style.CellPadding.y;
const float outer_padding_for_border = (flags & ImGuiTableFlags_BordersOuterV) ? TABLE_BORDER_SIZE : 0.0f;
const float outer_padding_explicit = pad_outer_x ? g.Style.CellPadding.x : 0.0f;
@@ -447,29 +521,35 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
table->InnerClipRect = (inner_window == outer_window) ? table->WorkRect : inner_window->ClipRect;
table->InnerClipRect.ClipWith(table->WorkRect); // We need this to honor inner_width
table->InnerClipRect.ClipWithFull(table->HostClipRect);
- table->InnerClipRect.Max.y = (flags & ImGuiTableFlags_NoHostExtendY) ? ImMin(table->InnerClipRect.Max.y, inner_window->WorkRect.Max.y) : inner_window->ClipRect.Max.y;
+ table->InnerClipRect.Max.y = (flags & ImGuiTableFlags_NoHostExtendY) ? ImMin(table->InnerClipRect.Max.y, inner_window->WorkRect.Max.y) : table->HostClipRect.Max.y;
table->RowPosY1 = table->RowPosY2 = table->WorkRect.Min.y; // This is needed somehow
table->RowTextBaseline = 0.0f; // This will be cleared again by TableBeginRow()
+ table->RowCellPaddingY = 0.0f;
table->FreezeRowsRequest = table->FreezeRowsCount = 0; // This will be setup by TableSetupScrollFreeze(), if any
table->FreezeColumnsRequest = table->FreezeColumnsCount = 0;
table->IsUnfrozenRows = true;
- table->DeclColumnsCount = 0;
+ table->DeclColumnsCount = table->AngledHeadersCount = 0;
+ if (previous_frame_active + 1 < g.FrameCount)
+ table->IsActiveIdInTable = false;
+ table->AngledHeadersHeight = 0.0f;
+ temp_data->AngledHeadersExtraWidth = 0.0f;
- // Using opaque colors facilitate overlapping elements of the grid
+ // Using opaque colors facilitate overlapping lines of the grid, otherwise we'd need to improve TableDrawBorders()
table->BorderColorStrong = GetColorU32(ImGuiCol_TableBorderStrong);
table->BorderColorLight = GetColorU32(ImGuiCol_TableBorderLight);
// Make table current
g.CurrentTable = table;
+ outer_window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX();
outer_window->DC.CurrentTableIdx = table_idx;
if (inner_window != outer_window) // So EndChild() within the inner window can restore the table properly.
inner_window->DC.CurrentTableIdx = table_idx;
- if ((table_last_flags & ImGuiTableFlags_Reorderable) && (flags & ImGuiTableFlags_Reorderable) == 0)
+ if ((previous_flags & ImGuiTableFlags_Reorderable) && (flags & ImGuiTableFlags_Reorderable) == 0)
table->IsResetDisplayOrderRequest = true;
- // Mark as used
+ // Mark as used to avoid GC
if (table_idx >= g.TablesLastTimeActive.Size)
g.TablesLastTimeActive.resize(table_idx + 1, -1.0f);
g.TablesLastTimeActive[table_idx] = (float)g.Time;
@@ -499,6 +579,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
// Initialize
table->SettingsOffset = -1;
table->IsSortSpecsDirty = true;
+ table->IsSettingsDirty = true; // Records itself into .ini file even when in default state (#7934)
table->InstanceInteracted = -1;
table->ContextPopupColumn = -1;
table->ReorderColumn = table->ResizedColumn = table->LastResizedColumn = -1;
@@ -562,34 +643,40 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
}
// For reference, the average total _allocation count_ for a table is:
-// + 0 (for ImGuiTable instance, we are pooling allocations in g.Tables)
+// + 0 (for ImGuiTable instance, we are pooling allocations in g.Tables[])
// + 1 (for table->RawData allocated below)
// + 1 (for table->ColumnsNames, if names are used)
-// Shared allocations per number of nested tables
+// Shared allocations for the maximum number of simultaneously nested tables (generally a very small number)
// + 1 (for table->Splitter._Channels)
// + 2 * active_channels_count (for ImDrawCmd and ImDrawIdx buffers inside channels)
-// Where active_channels_count is variable but often == columns_count or columns_count + 1, see TableSetupDrawChannels() for details.
+// Where active_channels_count is variable but often == columns_count or == columns_count + 1, see TableSetupDrawChannels() for details.
// Unused channels don't perform their +2 allocations.
void ImGui::TableBeginInitMemory(ImGuiTable* table, int columns_count)
{
// Allocate single buffer for our arrays
- ImSpanAllocator<3> span_allocator;
+ const int columns_bit_array_size = (int)ImBitArrayGetStorageSizeInBytes(columns_count);
+ ImSpanAllocator<6> span_allocator;
span_allocator.Reserve(0, columns_count * sizeof(ImGuiTableColumn));
span_allocator.Reserve(1, columns_count * sizeof(ImGuiTableColumnIdx));
span_allocator.Reserve(2, columns_count * sizeof(ImGuiTableCellData), 4);
+ for (int n = 3; n < 6; n++)
+ span_allocator.Reserve(n, columns_bit_array_size);
table->RawData = IM_ALLOC(span_allocator.GetArenaSizeInBytes());
memset(table->RawData, 0, span_allocator.GetArenaSizeInBytes());
span_allocator.SetArenaBasePtr(table->RawData);
span_allocator.GetSpan(0, &table->Columns);
span_allocator.GetSpan(1, &table->DisplayOrderToIndex);
span_allocator.GetSpan(2, &table->RowCellData);
+ table->EnabledMaskByDisplayOrder = (ImU32*)span_allocator.GetSpanPtrBegin(3);
+ table->EnabledMaskByIndex = (ImU32*)span_allocator.GetSpanPtrBegin(4);
+ table->VisibleMaskByIndex = (ImU32*)span_allocator.GetSpanPtrBegin(5);
}
// Apply queued resizing/reordering/hiding requests
void ImGui::TableBeginApplyRequests(ImGuiTable* table)
{
// Handle resizing request
- // (We process this at the first TableBegin of the frame)
+ // (We process this in the TableBegin() of the first instance of each table)
// FIXME-TABLE: Contains columns if our work area doesn't allow for scrolling?
if (table->InstanceCurrent == 0)
{
@@ -634,8 +721,7 @@ void ImGui::TableBeginApplyRequests(ImGuiTable* table)
table->Columns[table->DisplayOrderToIndex[order_n]].DisplayOrder -= (ImGuiTableColumnIdx)reorder_dir;
IM_ASSERT(dst_column->DisplayOrder == dst_order - reorder_dir);
- // Display order is stored in both columns->IndexDisplayOrder and table->DisplayOrder[],
- // rebuild the later from the former.
+ // Display order is stored in both columns->IndexDisplayOrder and table->DisplayOrder[]. Rebuild later from the former.
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
table->DisplayOrderToIndex[table->Columns[column_n].DisplayOrder] = (ImGuiTableColumnIdx)column_n;
table->ReorderColumnDir = 0;
@@ -709,8 +795,8 @@ static void TableSetupColumnFlags(ImGuiTable* table, ImGuiTableColumn* column, I
}
}
-// Layout columns for the frame. This is in essence the followup to BeginTable().
-// Runs on the first call to TableNextRow(), to give a chance for TableSetupColumn() to be called first.
+// Layout columns for the frame. This is in essence the followup to BeginTable() and this is our largest function.
+// Runs on the first call to TableNextRow(), to give a chance for TableSetupColumn() and other TableSetupXXXXX() functions to be called first.
// FIXME-TABLE: Our width (and therefore our WorkRect) will be minimal in the first frame for _WidthAuto columns.
// Increase feedback side-effect with widgets relying on WorkRect.Max.x... Maybe provide a default distribution for _WidthAuto columns?
void ImGui::TableUpdateLayout(ImGuiTable* table)
@@ -721,8 +807,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
const ImGuiTableFlags table_sizing_policy = (table->Flags & ImGuiTableFlags_SizingMask_);
table->IsDefaultDisplayOrder = true;
table->ColumnsEnabledCount = 0;
- table->EnabledMaskByIndex = 0x00;
- table->EnabledMaskByDisplayOrder = 0x00;
+ ImBitArrayClearAllBits(table->EnabledMaskByIndex, table->ColumnsCount);
+ ImBitArrayClearAllBits(table->EnabledMaskByDisplayOrder, table->ColumnsCount);
table->LeftMostEnabledColumn = -1;
table->MinColumnWidth = ImMax(1.0f, g.Style.FramePadding.x * 1.0f); // g.Style.ColumnsMinSpacing; // FIXME-TABLE
@@ -787,14 +873,14 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
else
table->LeftMostEnabledColumn = (ImGuiTableColumnIdx)column_n;
column->IndexWithinEnabledSet = table->ColumnsEnabledCount++;
- table->EnabledMaskByIndex |= (ImU64)1 << column_n;
- table->EnabledMaskByDisplayOrder |= (ImU64)1 << column->DisplayOrder;
+ ImBitArraySetBit(table->EnabledMaskByIndex, column_n);
+ ImBitArraySetBit(table->EnabledMaskByDisplayOrder, column->DisplayOrder);
prev_visible_column_idx = column_n;
IM_ASSERT(column->IndexWithinEnabledSet <= column->DisplayOrder);
// Calculate ideal/auto column width (that's the width required for all contents to be visible without clipping)
// Combine width from regular rows + width from headers unless requested not to.
- if (!column->IsPreserveWidthAuto)
+ if (!column->IsPreserveWidthAuto && table->InstanceCurrent == 0)
column->WidthAuto = TableGetColumnWidthAuto(table, column);
// Non-resizable columns keep their requested width (apply user value regardless of IsPreserveWidthAuto)
@@ -822,8 +908,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
table->RightMostEnabledColumn = (ImGuiTableColumnIdx)prev_visible_column_idx;
IM_ASSERT(table->LeftMostEnabledColumn >= 0 && table->RightMostEnabledColumn >= 0);
- // [Part 2] Disable child window clipping while fitting columns. This is not strictly necessary but makes it possible
- // to avoid the column fitting having to wait until the first visible frame of the child container (may or not be a good thing).
+ // [Part 2] Disable child window clipping while fitting columns. This is not strictly necessary but makes it possible to avoid
+ // the column fitting having to wait until the first visible frame of the child container (may or not be a good thing). Also see #6510.
// FIXME-TABLE: for always auto-resizing columns may not want to do that all the time.
if (has_auto_fit_request && table->OuterWindow != table->InnerWindow)
table->InnerWindow->SkipItems = false;
@@ -831,12 +917,12 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
table->IsSettingsDirty = true;
// [Part 3] Fix column flags and record a few extra information.
- float sum_width_requests = 0.0f; // Sum of all width for fixed and auto-resize columns, excluding width contributed by Stretch columns but including spacing/padding.
- float stretch_sum_weights = 0.0f; // Sum of all weights for stretch columns.
+ float sum_width_requests = 0.0f; // Sum of all width for fixed and auto-resize columns, excluding width contributed by Stretch columns but including spacing/padding.
+ float stretch_sum_weights = 0.0f; // Sum of all weights for stretch columns.
table->LeftMostStretchedColumn = table->RightMostStretchedColumn = -1;
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
{
- if (!(table->EnabledMaskByIndex & ((ImU64)1 << column_n)))
+ if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
continue;
ImGuiTableColumn* column = &table->Columns[column_n];
@@ -852,7 +938,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
// Latch initial size for fixed columns and update it constantly for auto-resizing column (unless clipped!)
if (column->AutoFitQueue != 0x00)
column->WidthRequest = width_auto;
- else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)))
+ else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && column->IsRequestOutput)
column->WidthRequest = width_auto;
// FIXME-TABLE: Increase minimum size during init frame to avoid biasing auto-fitting widgets
@@ -893,13 +979,14 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
// [Part 4] Apply final widths based on requested widths
const ImRect work_rect = table->WorkRect;
const float width_spacings = (table->OuterPaddingX * 2.0f) + (table->CellSpacingX1 + table->CellSpacingX2) * (table->ColumnsEnabledCount - 1);
- const float width_avail = ((table->Flags & ImGuiTableFlags_ScrollX) && table->InnerWidth == 0.0f) ? table->InnerClipRect.GetWidth() : work_rect.GetWidth();
+ const float width_removed = (table->HasScrollbarYPrev && !table->InnerWindow->ScrollbarY) ? g.Style.ScrollbarSize : 0.0f; // To synchronize decoration width of synced tables with mismatching scrollbar state (#5920)
+ const float width_avail = ImMax(1.0f, (((table->Flags & ImGuiTableFlags_ScrollX) && table->InnerWidth == 0.0f) ? table->InnerClipRect.GetWidth() : work_rect.GetWidth()) - width_removed);
const float width_avail_for_stretched_columns = width_avail - width_spacings - sum_width_requests;
float width_remaining_for_stretched_columns = width_avail_for_stretched_columns;
table->ColumnsGivenWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount;
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
{
- if (!(table->EnabledMaskByIndex & ((ImU64)1 << column_n)))
+ if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
continue;
ImGuiTableColumn* column = &table->Columns[column_n];
@@ -907,7 +994,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
if (column->Flags & ImGuiTableColumnFlags_WidthStretch)
{
float weight_ratio = column->StretchWeight / stretch_sum_weights;
- column->WidthRequest = IM_FLOOR(ImMax(width_avail_for_stretched_columns * weight_ratio, table->MinColumnWidth) + 0.01f);
+ column->WidthRequest = IM_TRUNC(ImMax(width_avail_for_stretched_columns * weight_ratio, table->MinColumnWidth) + 0.01f);
width_remaining_for_stretched_columns -= column->WidthRequest;
}
@@ -917,7 +1004,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
column->Flags |= ImGuiTableColumnFlags_NoDirectResize_;
// Assign final width, record width in case we will need to shrink
- column->WidthGiven = ImFloor(ImMax(column->WidthRequest, table->MinColumnWidth));
+ column->WidthGiven = ImTrunc(ImMax(column->WidthRequest, table->MinColumnWidth));
table->ColumnsGivenWidth += column->WidthGiven;
}
@@ -926,7 +1013,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
if (width_remaining_for_stretched_columns >= 1.0f && !(table->Flags & ImGuiTableFlags_PreciseWidths))
for (int order_n = table->ColumnsCount - 1; stretch_sum_weights > 0.0f && width_remaining_for_stretched_columns >= 1.0f && order_n >= 0; order_n--)
{
- if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
+ if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
continue;
ImGuiTableColumn* column = &table->Columns[table->DisplayOrderToIndex[order_n]];
if (!(column->Flags & ImGuiTableColumnFlags_WidthStretch))
@@ -942,29 +1029,37 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
// clear ActiveId, which is equivalent to the change provided by _AllowWhenBLockedByActiveItem).
// - This allows columns to be marked as hovered when e.g. clicking a button inside the column, or using drag and drop.
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
- table->HoveredColumnBody = -1;
- table->HoveredColumnBorder = -1;
+ table_instance->HoveredRowLast = table_instance->HoveredRowNext;
+ table_instance->HoveredRowNext = -1;
+ table->HoveredColumnBody = table->HoveredColumnBorder = -1;
const ImRect mouse_hit_rect(table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.Max.x, ImMax(table->OuterRect.Max.y, table->OuterRect.Min.y + table_instance->LastOuterHeight));
const ImGuiID backup_active_id = g.ActiveId;
g.ActiveId = 0;
- const bool is_hovering_table = ItemHoverable(mouse_hit_rect, 0);
+ const bool is_hovering_table = ItemHoverable(mouse_hit_rect, 0, ImGuiItemFlags_None);
g.ActiveId = backup_active_id;
+ // Determine skewed MousePos.x to support angled headers.
+ float mouse_skewed_x = g.IO.MousePos.x;
+ if (table->AngledHeadersHeight > 0.0f)
+ if (g.IO.MousePos.y >= table->OuterRect.Min.y && g.IO.MousePos.y <= table->OuterRect.Min.y + table->AngledHeadersHeight)
+ mouse_skewed_x += ImTrunc((table->OuterRect.Min.y + table->AngledHeadersHeight - g.IO.MousePos.y) * table->AngledHeadersSlope);
+
// [Part 6] Setup final position, offset, skip/clip states and clipping rectangles, detect hovered column
// Process columns in their visible orders as we are comparing the visible order and adjusting host_clip_rect while looping.
int visible_n = 0;
+ bool has_at_least_one_column_requesting_output = false;
bool offset_x_frozen = (table->FreezeColumnsCount > 0);
float offset_x = ((table->FreezeColumnsCount > 0) ? table->OuterRect.Min.x : work_rect.Min.x) + table->OuterPaddingX - table->CellSpacingX1;
ImRect host_clip_rect = table->InnerClipRect;
//host_clip_rect.Max.x += table->CellPaddingX + table->CellSpacingX2;
- table->VisibleMaskByIndex = 0x00;
- table->RequestOutputMaskByIndex = 0x00;
+ ImBitArrayClearAllBits(table->VisibleMaskByIndex, table->ColumnsCount);
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
{
const int column_n = table->DisplayOrderToIndex[order_n];
ImGuiTableColumn* column = &table->Columns[column_n];
- column->NavLayerCurrent = (ImS8)((table->FreezeRowsCount > 0 || column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main);
+ // Initial nav layer: using FreezeRowsCount, NOT FreezeRowsRequest, so Header line changes layer when frozen
+ column->NavLayerCurrent = (ImS8)(table->FreezeRowsCount > 0 ? ImGuiNavLayer_Menu : (ImGuiNavLayer)table->NavLayer);
if (offset_x_frozen && table->FreezeColumnsCount == visible_n)
{
@@ -975,7 +1070,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
// Clear status flags
column->Flags &= ~ImGuiTableColumnFlags_StatusMask_;
- if ((table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)) == 0)
+ if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
{
// Hidden column: clear a few fields and we are done with it for the remainder of the function.
// We set a zero-width clip rect but set Min.y/Max.y properly to not interfere with the clipper.
@@ -990,16 +1085,12 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
continue;
}
- // Detect hovered column
- if (is_hovering_table && g.IO.MousePos.x >= column->ClipRect.Min.x && g.IO.MousePos.x < column->ClipRect.Max.x)
- table->HoveredColumnBody = (ImGuiTableColumnIdx)column_n;
-
// Lock start position
column->MinX = offset_x;
// Lock width based on start position and minimum/maximum width for this position
- float max_width = TableGetMaxColumnWidth(table, column_n);
- column->WidthGiven = ImMin(column->WidthGiven, max_width);
+ column->WidthMax = TableCalcMaxColumnWidth(table, column_n);
+ column->WidthGiven = ImMin(column->WidthGiven, column->WidthMax);
column->WidthGiven = ImMax(column->WidthGiven, ImMin(column->WidthRequest, table->MinColumnWidth));
column->MaxX = offset_x + column->WidthGiven + table->CellSpacingX1 + table->CellSpacingX2 + table->CellPaddingX * 2.0f;
@@ -1008,9 +1099,10 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
// - ClipRect.Max.x: using WorkMaxX instead of MaxX (aka including padding) makes things more consistent when resizing down, tho slightly detrimental to visibility in very-small column.
// - ClipRect.Max.x: using MaxX makes it easier for header to receive hover highlight with no discontinuity and display sorting arrow.
// - FIXME-TABLE: We want equal width columns to have equal (ClipRect.Max.x - WorkMinX) width, which means ClipRect.max.x cannot stray off host_clip_rect.Max.x else right-most column may appear shorter.
+ const float previous_instance_work_min_x = column->WorkMinX;
column->WorkMinX = column->MinX + table->CellPaddingX + table->CellSpacingX1;
column->WorkMaxX = column->MaxX - table->CellPaddingX - table->CellSpacingX2; // Expected max
- column->ItemWidth = ImFloor(column->WidthGiven * 0.65f);
+ column->ItemWidth = ImTrunc(column->WidthGiven * 0.65f);
column->ClipRect.Min.x = column->MinX;
column->ClipRect.Min.y = work_rect.Min.y;
column->ClipRect.Max.x = column->MaxX; //column->WorkMaxX;
@@ -1028,17 +1120,18 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
column->IsVisibleY = true; // (column->ClipRect.Max.y > column->ClipRect.Min.y);
const bool is_visible = column->IsVisibleX; //&& column->IsVisibleY;
if (is_visible)
- table->VisibleMaskByIndex |= ((ImU64)1 << column_n);
+ ImBitArraySetBit(table->VisibleMaskByIndex, column_n);
// Mark column as requesting output from user. Note that fixed + non-resizable sets are auto-fitting at all times and therefore always request output.
column->IsRequestOutput = is_visible || column->AutoFitQueue != 0 || column->CannotSkipItemsQueue != 0;
- if (column->IsRequestOutput)
- table->RequestOutputMaskByIndex |= ((ImU64)1 << column_n);
// Mark column as SkipItems (ignoring all items/layout)
+ // (table->HostSkipItems is a copy of inner_window->SkipItems before we cleared it above in Part 2)
column->IsSkipItems = !column->IsEnabled || table->HostSkipItems;
if (column->IsSkipItems)
IM_ASSERT(!is_visible);
+ if (column->IsRequestOutput && !column->IsSkipItems)
+ has_at_least_one_column_requesting_output = true;
// Update status flags
column->Flags |= ImGuiTableColumnFlags_IsEnabled;
@@ -1046,8 +1139,13 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
column->Flags |= ImGuiTableColumnFlags_IsVisible;
if (column->SortOrder != -1)
column->Flags |= ImGuiTableColumnFlags_IsSorted;
- if (table->HoveredColumnBody == column_n)
+
+ // Detect hovered column
+ if (is_hovering_table && mouse_skewed_x >= column->ClipRect.Min.x && mouse_skewed_x < column->ClipRect.Max.x)
+ {
column->Flags |= ImGuiTableColumnFlags_IsHovered;
+ table->HoveredColumnBody = (ImGuiTableColumnIdx)column_n;
+ }
// Alignment
// FIXME-TABLE: This align based on the whole column width, not per-cell, and therefore isn't useful in
@@ -1059,11 +1157,25 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
// column->WorkMinX = ImLerp(column->WorkMinX, ImMax(column->StartX, column->MaxX - column->ContentWidthRowsUnfrozen), 0.5f);
// Reset content width variables
- column->ContentMaxXFrozen = column->ContentMaxXUnfrozen = column->WorkMinX;
- column->ContentMaxXHeadersUsed = column->ContentMaxXHeadersIdeal = column->WorkMinX;
+ if (table->InstanceCurrent == 0)
+ {
+ column->ContentMaxXFrozen = column->WorkMinX;
+ column->ContentMaxXUnfrozen = column->WorkMinX;
+ column->ContentMaxXHeadersUsed = column->WorkMinX;
+ column->ContentMaxXHeadersIdeal = column->WorkMinX;
+ }
+ else
+ {
+ // As we store an absolute value to make per-cell updates faster, we need to offset values used for width computation.
+ const float offset_from_previous_instance = column->WorkMinX - previous_instance_work_min_x;
+ column->ContentMaxXFrozen += offset_from_previous_instance;
+ column->ContentMaxXUnfrozen += offset_from_previous_instance;
+ column->ContentMaxXHeadersUsed += offset_from_previous_instance;
+ column->ContentMaxXHeadersIdeal += offset_from_previous_instance;
+ }
// Don't decrement auto-fit counters until container window got a chance to submit its items
- if (table->HostSkipItems == false)
+ if (table->HostSkipItems == false && table->InstanceCurrent == 0)
{
column->AutoFitQueue >>= 1;
column->CannotSkipItemsQueue >>= 1;
@@ -1076,18 +1188,26 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
visible_n++;
}
+ // In case the table is visible (e.g. decorations) but all columns clipped, we keep a column visible.
+ // Else if give no chance to a clipper-savy user to submit rows and therefore total contents height used by scrollbar.
+ if (has_at_least_one_column_requesting_output == false)
+ {
+ table->Columns[table->LeftMostEnabledColumn].IsRequestOutput = true;
+ table->Columns[table->LeftMostEnabledColumn].IsSkipItems = false;
+ }
+
// [Part 7] Detect/store when we are hovering the unused space after the right-most column (so e.g. context menus can react on it)
// Clear Resizable flag if none of our column are actually resizable (either via an explicit _NoResize flag, either
// because of using _WidthAuto/_WidthStretch). This will hide the resizing option from the context menu.
const float unused_x1 = ImMax(table->WorkRect.Min.x, table->Columns[table->RightMostEnabledColumn].ClipRect.Max.x);
if (is_hovering_table && table->HoveredColumnBody == -1)
- {
- if (g.IO.MousePos.x >= unused_x1)
+ if (mouse_skewed_x >= unused_x1)
table->HoveredColumnBody = (ImGuiTableColumnIdx)table->ColumnsCount;
- }
if (has_resizable == false && (table->Flags & ImGuiTableFlags_Resizable))
table->Flags &= ~ImGuiTableFlags_Resizable;
+ table->IsActiveIdAliveBeforeTable = (g.ActiveIdIsAlive != 0);
+
// [Part 8] Lock actual OuterRect/WorkRect right-most position.
// This is done late to handle the case of fixed-columns tables not claiming more widths that they need.
// Because of this we are careful with uses of WorkRect and InnerClipRect before this point.
@@ -1099,8 +1219,16 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
table->InnerClipRect.Max.x = ImMin(table->InnerClipRect.Max.x, unused_x1);
}
table->InnerWindow->ParentWorkRect = table->WorkRect;
- table->BorderX1 = table->InnerClipRect.Min.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : -1.0f);
- table->BorderX2 = table->InnerClipRect.Max.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : +1.0f);
+ table->BorderX1 = table->InnerClipRect.Min.x;
+ table->BorderX2 = table->InnerClipRect.Max.x;
+
+ // Setup window's WorkRect.Max.y for GetContentRegionAvail(). Other values will be updated in each TableBeginCell() call.
+ float window_content_max_y;
+ if (table->Flags & ImGuiTableFlags_NoHostExtendY)
+ window_content_max_y = table->OuterRect.Max.y;
+ else
+ window_content_max_y = ImMax(table->InnerWindow->ContentRegionRect.Max.y, (table->Flags & ImGuiTableFlags_ScrollY) ? 0.0f : table->OuterRect.Max.y);
+ table->InnerWindow->WorkRect.Max.y = ImClamp(window_content_max_y - g.Style.CellPadding.y, table->InnerWindow->WorkRect.Min.y, table->InnerWindow->WorkRect.Max.y);
// [Part 9] Allocate draw channels and setup background cliprect
TableSetupDrawChannels(table);
@@ -1108,34 +1236,51 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
// [Part 10] Hit testing on borders
if (table->Flags & ImGuiTableFlags_Resizable)
TableUpdateBorders(table);
- table_instance->LastFirstRowHeight = 0.0f;
+ table_instance->LastTopHeadersRowHeight = 0.0f;
table->IsLayoutLocked = true;
table->IsUsingHeaders = false;
- // [Part 11] Context menu
- if (TableBeginContextMenuPopup(table))
+ // Highlight header
+ table->HighlightColumnHeader = -1;
+ if (table->IsContextPopupOpen && table->ContextPopupColumn != -1 && table->InstanceInteracted == table->InstanceCurrent)
+ table->HighlightColumnHeader = table->ContextPopupColumn;
+ else if ((table->Flags & ImGuiTableFlags_HighlightHoveredColumn) && table->HoveredColumnBody != -1 && table->HoveredColumnBody != table->ColumnsCount && table->HoveredColumnBorder == -1)
+ if (g.ActiveId == 0 || (table->IsActiveIdInTable || g.DragDropActive))
+ table->HighlightColumnHeader = table->HoveredColumnBody;
+
+ // [Part 11] Default context menu
+ // - To append to this menu: you can call TableBeginContextMenuPopup()/.../EndPopup().
+ // - To modify or replace this: set table->IsContextPopupNoDefaultContents = true, then call TableBeginContextMenuPopup()/.../EndPopup().
+ // - You may call TableDrawDefaultContextMenu() with selected flags to display specific sections of the default menu,
+ // e.g. TableDrawDefaultContextMenu(table, table->Flags & ~ImGuiTableFlags_Hideable) will display everything EXCEPT columns visibility options.
+ if (table->DisableDefaultContextMenu == false && TableBeginContextMenuPopup(table))
{
- TableDrawContextMenu(table);
+ TableDrawDefaultContextMenu(table, table->Flags);
EndPopup();
}
- // [Part 13] Sanitize and build sort specs before we have a change to use them for display.
+ // [Part 12] Sanitize and build sort specs before we have a chance to use them for display.
// This path will only be exercised when sort specs are modified before header rows (e.g. init or visibility change)
if (table->IsSortSpecsDirty && (table->Flags & ImGuiTableFlags_Sortable))
TableSortSpecsBuild(table);
+ // [Part 13] Setup inner window decoration size (for scrolling / nav tracking to properly take account of frozen rows/columns)
+ if (table->FreezeColumnsRequest > 0)
+ table->InnerWindow->DecoInnerSizeX1 = table->Columns[table->DisplayOrderToIndex[table->FreezeColumnsRequest - 1]].MaxX - table->OuterRect.Min.x;
+ if (table->FreezeRowsRequest > 0)
+ table->InnerWindow->DecoInnerSizeY1 = table_instance->LastFrozenHeight;
+ table_instance->LastFrozenHeight = 0.0f;
+
// Initial state
ImGuiWindow* inner_window = table->InnerWindow;
if (table->Flags & ImGuiTableFlags_NoClip)
table->DrawSplitter->SetCurrentChannel(inner_window->DrawList, TABLE_DRAW_CHANNEL_NOCLIP);
else
- inner_window->DrawList->PushClipRect(inner_window->ClipRect.Min, inner_window->ClipRect.Max, false);
+ inner_window->DrawList->PushClipRect(inner_window->InnerClipRect.Min, inner_window->InnerClipRect.Max, false); // FIXME: use table->InnerClipRect?
}
// Process hit-testing on resizing borders. Actual size change will be applied in EndTable()
-// - Set table->HoveredColumnBorder with a short delay/timer to reduce feedback noise
-// - Submit ahead of table contents and header, use ImGuiButtonFlags_AllowItemOverlap to prioritize widgets
-// overlapping the same area.
+// - Set table->HoveredColumnBorder with a short delay/timer to reduce visual feedback noise.
void ImGui::TableUpdateBorders(ImGuiTable* table)
{
ImGuiContext& g = *GImGui;
@@ -1146,14 +1291,14 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
// really problematic (whereas the actual visual will be displayed in EndTable() and using the current frame height).
// Actual columns highlight/render will be performed in EndTable() and not be affected.
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
- const float hit_half_width = TABLE_RESIZE_SEPARATOR_HALF_THICKNESS;
- const float hit_y1 = table->OuterRect.Min.y;
- const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table_instance->LastOuterHeight);
- const float hit_y2_head = hit_y1 + table_instance->LastFirstRowHeight;
+ const float hit_half_width = ImTrunc(TABLE_RESIZE_SEPARATOR_HALF_THICKNESS * g.CurrentDpiScale);
+ const float hit_y1 = (table->FreezeRowsCount >= 1 ? table->OuterRect.Min.y : table->WorkRect.Min.y) + table->AngledHeadersHeight;
+ const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table_instance->LastOuterHeight - table->AngledHeadersHeight);
+ const float hit_y2_head = hit_y1 + table_instance->LastTopHeadersRowHeight;
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
{
- if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
+ if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
continue;
const int column_n = table->DisplayOrderToIndex[order_n];
@@ -1175,12 +1320,12 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
//GetForegroundDrawList()->AddRect(hit_rect.Min, hit_rect.Max, IM_COL32(255, 0, 0, 100));
bool hovered = false, held = false;
- bool pressed = ButtonBehavior(hit_rect, column_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap | ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_NoNavFocus);
+ bool pressed = ButtonBehavior(hit_rect, column_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_NoNavFocus);
if (pressed && IsMouseDoubleClicked(0))
{
TableSetColumnWidthAutoSingle(table, column_n);
ClearActiveID();
- held = hovered = false;
+ held = false;
}
if (held)
{
@@ -1201,7 +1346,11 @@ void ImGui::EndTable()
{
ImGuiContext& g = *GImGui;
ImGuiTable* table = g.CurrentTable;
- IM_ASSERT(table != NULL && "Only call EndTable() if BeginTable() returns true!");
+ if (table == NULL)
+ {
+ IM_ASSERT_USER_ERROR(table != NULL, "EndTable() call should only be done while in BeginTable() scope!");
+ return;
+ }
// This assert would be very useful to catch a common error... unfortunately it would probably trigger in some
// cases, and for consistency user may sometimes output empty tables (and still benefit from e.g. outer border)
@@ -1243,7 +1392,7 @@ void ImGui::EndTable()
// Setup inner scrolling range
// FIXME: This ideally should be done earlier, in BeginTable() SetNextWindowContentSize call, just like writing to inner_window->DC.CursorMaxPos.y,
- // but since the later is likely to be impossible to do we'd rather update both axises together.
+ // but since the later is likely to be impossible to do we'd rather update both axes together.
if (table->Flags & ImGuiTableFlags_ScrollX)
{
const float outer_padding_for_border = (table->Flags & ImGuiTableFlags_BordersOuterV) ? TABLE_BORDER_SIZE : 0.0f;
@@ -1252,7 +1401,7 @@ void ImGui::EndTable()
max_pos_x = ImMax(max_pos_x, table->Columns[table->RightMostEnabledColumn].WorkMaxX + table->CellPaddingX + table->OuterPaddingX - outer_padding_for_border);
if (table->ResizedColumn != -1)
max_pos_x = ImMax(max_pos_x, table->ResizeLockMinContentsX2);
- table->InnerWindow->DC.CursorMaxPos.x = max_pos_x;
+ table->InnerWindow->DC.CursorMaxPos.x = max_pos_x + table->TempData->AngledHeadersExtraWidth;
}
// Pop clipping rect
@@ -1289,7 +1438,7 @@ void ImGui::EndTable()
float auto_fit_width_for_stretched = 0.0f;
float auto_fit_width_for_stretched_min = 0.0f;
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
- if (table->EnabledMaskByIndex & ((ImU64)1 << column_n))
+ if (IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
{
ImGuiTableColumn* column = &table->Columns[column_n];
float column_width_request = ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !(column->Flags & ImGuiTableColumnFlags_NoResize)) ? column->WidthRequest : TableGetColumnWidthAuto(table, column);
@@ -1323,14 +1472,18 @@ void ImGui::EndTable()
if (table->ResizedColumn != -1 && table->InstanceCurrent == table->InstanceInteracted)
{
ImGuiTableColumn* column = &table->Columns[table->ResizedColumn];
- const float new_x2 = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + TABLE_RESIZE_SEPARATOR_HALF_THICKNESS);
- const float new_width = ImFloor(new_x2 - column->MinX - table->CellSpacingX1 - table->CellPaddingX * 2.0f);
+ const float new_x2 = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + ImTrunc(TABLE_RESIZE_SEPARATOR_HALF_THICKNESS * g.CurrentDpiScale));
+ const float new_width = ImTrunc(new_x2 - column->MinX - table->CellSpacingX1 - table->CellPaddingX * 2.0f);
table->ResizedColumnNextWidth = new_width;
}
+ table->IsActiveIdInTable = (g.ActiveIdIsAlive != 0 && table->IsActiveIdAliveBeforeTable == false);
+
// Pop from id stack
- IM_ASSERT_USER_ERROR(inner_window->IDStack.back() == table->ID + table->InstanceCurrent, "Mismatching PushID/PopID!");
+ IM_ASSERT_USER_ERROR(inner_window->IDStack.back() == table_instance->TableInstanceID, "Mismatching PushID/PopID!");
IM_ASSERT_USER_ERROR(outer_window->DC.ItemWidthStack.Size >= temp_data->HostBackupItemWidthStackSize, "Too many PopItemWidth!");
+ if (table->InstanceCurrent > 0)
+ PopID();
PopID();
// Restore window data that we modified
@@ -1348,7 +1501,12 @@ void ImGui::EndTable()
// CursorPosPrevLine and CursorMaxPos manually. That should be a more general layout feature, see same problem e.g. #3414)
if (inner_window != outer_window)
{
+ short backup_nav_layers_active_mask = inner_window->DC.NavLayersActiveMask;
+ inner_window->DC.NavLayersActiveMask |= 1 << table->NavLayer; // So empty table don't appear to navigate differently.
+ g.CurrentTable = NULL; // To avoid error recovery recursing
EndChild();
+ g.CurrentTable = table;
+ inner_window->DC.NavLayersActiveMask = backup_nav_layers_active_mask;
}
else
{
@@ -1366,9 +1524,13 @@ void ImGui::EndTable()
}
else if (temp_data->UserOuterSize.x <= 0.0f)
{
- const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollX) ? inner_window->ScrollbarSizes.x : 0.0f;
- outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, table->OuterRect.Min.x + table->ColumnsAutoFitWidth + decoration_size - temp_data->UserOuterSize.x);
- outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, table->OuterRect.Min.x + table->ColumnsAutoFitWidth));
+ // Some references for this: #7651 + tests "table_reported_size", "table_reported_size_outer" equivalent Y block
+ // - Checking for ImGuiTableFlags_ScrollX/ScrollY flag makes us a frame ahead when disabling those flags.
+ // - FIXME-TABLE: Would make sense to pre-compute expected scrollbar visibility/sizes to generally save a frame of feedback.
+ const float inner_content_max_x = table->OuterRect.Min.x + table->ColumnsAutoFitWidth; // Slightly misleading name but used for code symmetry with inner_content_max_y
+ const float decoration_size = table->TempData->AngledHeadersExtraWidth + ((table->Flags & ImGuiTableFlags_ScrollY) ? inner_window->ScrollbarSizes.x : 0.0f);
+ outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, inner_content_max_x + decoration_size - temp_data->UserOuterSize.x);
+ outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, inner_content_max_x + decoration_size));
}
else
{
@@ -1376,9 +1538,9 @@ void ImGui::EndTable()
}
if (temp_data->UserOuterSize.y <= 0.0f)
{
- const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollY) ? inner_window->ScrollbarSizes.y : 0.0f;
+ const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollX) ? inner_window->ScrollbarSizes.y : 0.0f;
outer_window->DC.IdealMaxPos.y = ImMax(outer_window->DC.IdealMaxPos.y, inner_content_max_y + decoration_size - temp_data->UserOuterSize.y);
- outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, inner_content_max_y));
+ outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, inner_content_max_y + decoration_size));
}
else
{
@@ -1402,16 +1564,46 @@ void ImGui::EndTable()
g.CurrentTable->DrawSplitter = &temp_data->DrawSplitter;
}
outer_window->DC.CurrentTableIdx = g.CurrentTable ? g.Tables.GetIndex(g.CurrentTable) : -1;
+ NavUpdateCurrentWindowIsScrollPushableX();
+}
+
+// Called in TableSetupColumn() when initializing and in TableLoadSettings() for defaults before applying stored settings.
+// 'init_mask' specify which fields to initialize.
+static void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column, ImGuiTableColumnFlags init_mask)
+{
+ ImGuiTableColumnFlags flags = column->Flags;
+ if (init_mask & ImGuiTableFlags_Resizable)
+ {
+ float init_width_or_weight = column->InitStretchWeightOrWidth;
+ column->WidthRequest = ((flags & ImGuiTableColumnFlags_WidthFixed) && init_width_or_weight > 0.0f) ? init_width_or_weight : -1.0f;
+ column->StretchWeight = (init_width_or_weight > 0.0f && (flags & ImGuiTableColumnFlags_WidthStretch)) ? init_width_or_weight : -1.0f;
+ if (init_width_or_weight > 0.0f) // Disable auto-fit if an explicit width/weight has been specified
+ column->AutoFitQueue = 0x00;
+ }
+ if (init_mask & ImGuiTableFlags_Reorderable)
+ column->DisplayOrder = (ImGuiTableColumnIdx)table->Columns.index_from_ptr(column);
+ if (init_mask & ImGuiTableFlags_Hideable)
+ column->IsUserEnabled = column->IsUserEnabledNextFrame = (flags & ImGuiTableColumnFlags_DefaultHide) ? 0 : 1;
+ if (init_mask & ImGuiTableFlags_Sortable)
+ {
+ // Multiple columns using _DefaultSort will be reassigned unique SortOrder values when building the sort specs.
+ column->SortOrder = (flags & ImGuiTableColumnFlags_DefaultSort) ? 0 : -1;
+ column->SortDirection = (flags & ImGuiTableColumnFlags_DefaultSort) ? ((flags & ImGuiTableColumnFlags_PreferSortDescending) ? (ImS8)ImGuiSortDirection_Descending : (ImU8)(ImGuiSortDirection_Ascending)) : (ImS8)ImGuiSortDirection_None;
+ }
}
-// See "COLUMN SIZING POLICIES" comments at the top of this file
+// See "COLUMNS SIZING POLICIES" comments at the top of this file
// If (init_width_or_weight <= 0.0f) it is ignored
void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_id)
{
ImGuiContext& g = *GImGui;
ImGuiTable* table = g.CurrentTable;
- IM_ASSERT(table != NULL && "Need to call TableSetupColumn() after BeginTable()!");
- IM_ASSERT(table->IsLayoutLocked == false && "Need to call call TableSetupColumn() before first row!");
+ if (table == NULL)
+ {
+ IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
+ return;
+ }
+ IM_ASSERT(table->IsLayoutLocked == false && "Need to call TableSetupColumn() before first row!");
IM_ASSERT((flags & ImGuiTableColumnFlags_StatusMask_) == 0 && "Illegal to pass StatusMask values to TableSetupColumn()");
if (table->DeclColumnsCount >= table->ColumnsCount)
{
@@ -1428,10 +1620,15 @@ void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, flo
IM_ASSERT(init_width_or_weight <= 0.0f && "Can only specify width/weight if sizing policy is set explicitly in either Table or Column.");
// When passing a width automatically enforce WidthFixed policy
- // (whereas TableSetupColumnFlags would default to WidthAuto if table is not Resizable)
+ // (whereas TableSetupColumnFlags would default to WidthAuto if table is not resizable)
if ((flags & ImGuiTableColumnFlags_WidthMask_) == 0 && init_width_or_weight > 0.0f)
if ((table->Flags & ImGuiTableFlags_SizingMask_) == ImGuiTableFlags_SizingFixedFit || (table->Flags & ImGuiTableFlags_SizingMask_) == ImGuiTableFlags_SizingFixedSame)
flags |= ImGuiTableColumnFlags_WidthFixed;
+ if (flags & ImGuiTableColumnFlags_AngledHeader)
+ {
+ flags |= ImGuiTableColumnFlags_NoHeaderLabel;
+ table->AngledHeadersCount++;
+ }
TableSetupColumnFlags(table, column, flags);
column->UserID = user_id;
@@ -1441,35 +1638,19 @@ void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, flo
column->InitStretchWeightOrWidth = init_width_or_weight;
if (table->IsInitializing)
{
- // Init width or weight
+ ImGuiTableFlags init_flags = ~table->SettingsLoadedFlags;
if (column->WidthRequest < 0.0f && column->StretchWeight < 0.0f)
- {
- if ((flags & ImGuiTableColumnFlags_WidthFixed) && init_width_or_weight > 0.0f)
- column->WidthRequest = init_width_or_weight;
- if (flags & ImGuiTableColumnFlags_WidthStretch)
- column->StretchWeight = (init_width_or_weight > 0.0f) ? init_width_or_weight : -1.0f;
-
- // Disable auto-fit if an explicit width/weight has been specified
- if (init_width_or_weight > 0.0f)
- column->AutoFitQueue = 0x00;
- }
-
- // Init default visibility/sort state
- if ((flags & ImGuiTableColumnFlags_DefaultHide) && (table->SettingsLoadedFlags & ImGuiTableFlags_Hideable) == 0)
- column->IsUserEnabled = column->IsUserEnabledNextFrame = false;
- if (flags & ImGuiTableColumnFlags_DefaultSort && (table->SettingsLoadedFlags & ImGuiTableFlags_Sortable) == 0)
- {
- column->SortOrder = 0; // Multiple columns using _DefaultSort will be reassigned unique SortOrder values when building the sort specs.
- column->SortDirection = (column->Flags & ImGuiTableColumnFlags_PreferSortDescending) ? (ImS8)ImGuiSortDirection_Descending : (ImU8)(ImGuiSortDirection_Ascending);
- }
+ init_flags |= ImGuiTableFlags_Resizable;
+ TableInitColumnDefaults(table, column, init_flags);
}
// Store name (append with zero-terminator in contiguous buffer)
+ // FIXME: If we recorded the number of \n in names we could compute header row height
column->NameOffset = -1;
if (label != NULL && label[0] != 0)
{
column->NameOffset = (ImS16)table->ColumnsNames.size();
- table->ColumnsNames.append(label, label + strlen(label) + 1);
+ table->ColumnsNames.append(label, label + ImStrlen(label) + 1);
}
}
@@ -1478,7 +1659,11 @@ void ImGui::TableSetupScrollFreeze(int columns, int rows)
{
ImGuiContext& g = *GImGui;
ImGuiTable* table = g.CurrentTable;
- IM_ASSERT(table != NULL && "Need to call TableSetupColumn() after BeginTable()!");
+ if (table == NULL)
+ {
+ IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
+ return;
+ }
IM_ASSERT(table->IsLayoutLocked == false && "Need to call TableSetupColumn() before first row!");
IM_ASSERT(columns >= 0 && columns < IMGUI_TABLE_MAX_COLUMNS);
IM_ASSERT(rows >= 0 && rows < 128); // Arbitrary limit
@@ -1513,6 +1698,7 @@ void ImGui::TableSetupScrollFreeze(int columns, int rows)
// - TableGetCellBgRect() [Internal]
// - TableGetColumnResizeID() [Internal]
// - TableGetHoveredColumn() [Internal]
+// - TableGetHoveredRow() [Internal]
// - TableSetBgColor()
//-----------------------------------------------------------------------------
@@ -1554,9 +1740,11 @@ void ImGui::TableSetColumnEnabled(int column_n, bool enabled)
{
ImGuiContext& g = *GImGui;
ImGuiTable* table = g.CurrentTable;
- IM_ASSERT(table != NULL);
- if (!table)
+ if (table == NULL)
+ {
+ IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
return;
+ }
IM_ASSERT(table->Flags & ImGuiTableFlags_Hideable); // See comments above
if (column_n < 0)
column_n = table->CurrentColumn;
@@ -1600,14 +1788,14 @@ ImRect ImGui::TableGetCellBgRect(const ImGuiTable* table, int column_n)
}
// Return the resizing ID for the right-side of the given column.
-ImGuiID ImGui::TableGetColumnResizeID(const ImGuiTable* table, int column_n, int instance_no)
+ImGuiID ImGui::TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no)
{
IM_ASSERT(column_n >= 0 && column_n < table->ColumnsCount);
- ImGuiID id = table->ID + 1 + (instance_no * table->ColumnsCount) + column_n;
- return id;
+ ImGuiID instance_id = TableGetInstanceID(table, instance_no);
+ return instance_id + 1 + column_n; // FIXME: #6140: still not ideal
}
-// Return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
+// Return -1 when table is not hovered. return columns_count if hovering the unused space at the right of the right-most visible column.
int ImGui::TableGetHoveredColumn()
{
ImGuiContext& g = *GImGui;
@@ -1617,6 +1805,19 @@ int ImGui::TableGetHoveredColumn()
return (int)table->HoveredColumnBody;
}
+// Return -1 when table is not hovered. Return maxrow+1 if in table but below last submitted row.
+// *IMPORTANT* Unlike TableGetHoveredColumn(), this has a one frame latency in updating the value.
+// This difference with is the reason why this is not public yet.
+int ImGui::TableGetHoveredRow()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiTable* table = g.CurrentTable;
+ if (!table)
+ return -1;
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
+ return (int)table_instance->HoveredRowLast;
+}
+
void ImGui::TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n)
{
ImGuiContext& g = *GImGui;
@@ -1635,7 +1836,7 @@ void ImGui::TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n
return;
if (column_n == -1)
column_n = table->CurrentColumn;
- if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0)
+ if (!IM_BITARRAY_TESTBIT(table->VisibleMaskByIndex, column_n))
return;
if (table->RowCellDataCurrent < 0 || table->RowCellData[table->RowCellDataCurrent].Column != column_n)
table->RowCellDataCurrent++;
@@ -1691,19 +1892,20 @@ void ImGui::TableNextRow(ImGuiTableRowFlags row_flags, float row_min_height)
table->LastRowFlags = table->RowFlags;
table->RowFlags = row_flags;
+ table->RowCellPaddingY = g.Style.CellPadding.y;
table->RowMinHeight = row_min_height;
TableBeginRow(table);
// We honor min_row_height requested by user, but cannot guarantee per-row maximum height,
// because that would essentially require a unique clipping rectangle per-cell.
- table->RowPosY2 += table->CellPaddingY * 2.0f;
+ table->RowPosY2 += table->RowCellPaddingY * 2.0f;
table->RowPosY2 = ImMax(table->RowPosY2, table->RowPosY1 + row_min_height);
// Disable output until user calls TableNextColumn()
table->InnerWindow->SkipItems = true;
}
-// [Internal] Called by TableNextRow()
+// [Internal] Only called by TableNextRow()
void ImGui::TableBeginRow(ImGuiTable* table)
{
ImGuiWindow* window = table->InnerWindow;
@@ -1724,8 +1926,10 @@ void ImGui::TableBeginRow(ImGuiTable* table)
table->RowPosY1 = table->RowPosY2 = next_y1;
table->RowTextBaseline = 0.0f;
table->RowIndentOffsetX = window->DC.Indent.x - table->HostIndentX; // Lock indent
+
window->DC.PrevLineTextBaseOffset = 0.0f;
- window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
+ window->DC.CursorPosPrevLine = ImVec2(window->DC.CursorPos.x, window->DC.CursorPos.y + table->RowCellPaddingY); // This allows users to call SameLine() to share LineSize between columns.
+ window->DC.PrevLineSize = window->DC.CurrLineSize = ImVec2(0.0f, 0.0f); // This allows users to call SameLine() to share LineSize between columns, and to call it from first column too.
window->DC.IsSameLine = window->DC.IsSetPos = false;
window->DC.CursorMaxPos.y = next_y1;
@@ -1762,12 +1966,17 @@ void ImGui::TableEndRow(ImGuiTable* table)
const float bg_y2 = table->RowPosY2;
const bool unfreeze_rows_actual = (table->CurrentRow + 1 == table->FreezeRowsCount);
const bool unfreeze_rows_request = (table->CurrentRow + 1 == table->FreezeRowsRequest);
- if (table->CurrentRow == 0)
- TableGetInstanceData(table, table->InstanceCurrent)->LastFirstRowHeight = bg_y2 - bg_y1;
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
+ if ((table->RowFlags & ImGuiTableRowFlags_Headers) && (table->CurrentRow == 0 || (table->LastRowFlags & ImGuiTableRowFlags_Headers)))
+ table_instance->LastTopHeadersRowHeight += bg_y2 - bg_y1;
const bool is_visible = (bg_y2 >= table->InnerClipRect.Min.y && bg_y1 <= table->InnerClipRect.Max.y);
if (is_visible)
{
+ // Update data for TableGetHoveredRow()
+ if (table->HoveredColumnBody != -1 && g.IO.MousePos.y >= bg_y1 && g.IO.MousePos.y < bg_y2 && table_instance->HoveredRowNext < 0)
+ table_instance->HoveredRowNext = table->CurrentRow;
+
// Decide of background color for the row
ImU32 bg_col0 = 0;
ImU32 bg_col1 = 0;
@@ -1779,15 +1988,14 @@ void ImGui::TableEndRow(ImGuiTable* table)
bg_col1 = table->RowBgColor[1];
// Decide of top border color
- ImU32 border_col = 0;
+ ImU32 top_border_col = 0;
const float border_size = TABLE_BORDER_SIZE;
- if (table->CurrentRow > 0 || table->InnerWindow == table->OuterWindow)
- if (table->Flags & ImGuiTableFlags_BordersInnerH)
- border_col = (table->LastRowFlags & ImGuiTableRowFlags_Headers) ? table->BorderColorStrong : table->BorderColorLight;
+ if (table->CurrentRow > 0 && (table->Flags & ImGuiTableFlags_BordersInnerH))
+ top_border_col = (table->LastRowFlags & ImGuiTableRowFlags_Headers) ? table->BorderColorStrong : table->BorderColorLight;
const bool draw_cell_bg_color = table->RowCellDataCurrent >= 0;
const bool draw_strong_bottom_border = unfreeze_rows_actual;
- if ((bg_col0 | bg_col1 | border_col) != 0 || draw_strong_bottom_border || draw_cell_bg_color)
+ if ((bg_col0 | bg_col1 | top_border_col) != 0 || draw_strong_bottom_border || draw_cell_bg_color)
{
// In theory we could call SetWindowClipRectBeforeSetChannel() but since we know TableEndRow() is
// always followed by a change of clipping rectangle we perform the smallest overwrite possible here.
@@ -1821,13 +2029,14 @@ void ImGui::TableEndRow(ImGuiTable* table)
cell_bg_rect.ClipWith(table->BgClipRect);
cell_bg_rect.Min.x = ImMax(cell_bg_rect.Min.x, column->ClipRect.Min.x); // So that first column after frozen one gets clipped when scrolling
cell_bg_rect.Max.x = ImMin(cell_bg_rect.Max.x, column->MaxX);
- window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor);
+ if (cell_bg_rect.Min.y < cell_bg_rect.Max.y)
+ window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor);
}
}
// Draw top border
- if (border_col && bg_y1 >= table->BgClipRect.Min.y && bg_y1 < table->BgClipRect.Max.y)
- window->DrawList->AddLine(ImVec2(table->BorderX1, bg_y1), ImVec2(table->BorderX2, bg_y1), border_col, border_size);
+ if (top_border_col && bg_y1 >= table->BgClipRect.Min.y && bg_y1 < table->BgClipRect.Max.y)
+ window->DrawList->AddLine(ImVec2(table->BorderX1, bg_y1), ImVec2(table->BorderX2, bg_y1), top_border_col, border_size);
// Draw bottom border at the row unfreezing mark (always strong)
if (draw_strong_bottom_border && bg_y2 >= table->BgClipRect.Min.y && bg_y2 < table->BgClipRect.Max.y)
@@ -1838,36 +2047,37 @@ void ImGui::TableEndRow(ImGuiTable* table)
// We need to do that in TableEndRow() instead of TableBeginRow() so the list clipper can mark end of row and
// get the new cursor position.
if (unfreeze_rows_request)
- for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
- {
- ImGuiTableColumn* column = &table->Columns[column_n];
- column->NavLayerCurrent = (ImS8)((column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main);
- }
- if (unfreeze_rows_actual)
{
- IM_ASSERT(table->IsUnfrozenRows == false);
- table->IsUnfrozenRows = true;
-
- // BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
- float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y);
- table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, window->InnerClipRect.Max.y);
- table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = window->InnerClipRect.Max.y;
- table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
- IM_ASSERT(table->Bg2ClipRectForDrawCmd.Min.y <= table->Bg2ClipRectForDrawCmd.Max.y);
-
- float row_height = table->RowPosY2 - table->RowPosY1;
- table->RowPosY2 = window->DC.CursorPos.y = table->WorkRect.Min.y + table->RowPosY2 - table->OuterRect.Min.y;
- table->RowPosY1 = table->RowPosY2 - row_height;
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
+ table->Columns[column_n].NavLayerCurrent = table->NavLayer;
+ const float y0 = ImMax(table->RowPosY2 + 1, table->InnerClipRect.Min.y);
+ table_instance->LastFrozenHeight = y0 - table->OuterRect.Min.y;
+
+ if (unfreeze_rows_actual)
{
- ImGuiTableColumn* column = &table->Columns[column_n];
- column->DrawChannelCurrent = column->DrawChannelUnfrozen;
- column->ClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y;
- }
+ IM_ASSERT(table->IsUnfrozenRows == false);
+ table->IsUnfrozenRows = true;
+
+ // BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
+ table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, table->InnerClipRect.Max.y);
+ table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = table->InnerClipRect.Max.y;
+ table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
+ IM_ASSERT(table->Bg2ClipRectForDrawCmd.Min.y <= table->Bg2ClipRectForDrawCmd.Max.y);
+
+ float row_height = table->RowPosY2 - table->RowPosY1;
+ table->RowPosY2 = window->DC.CursorPos.y = table->WorkRect.Min.y + table->RowPosY2 - table->OuterRect.Min.y;
+ table->RowPosY1 = table->RowPosY2 - row_height;
+ for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
+ {
+ ImGuiTableColumn* column = &table->Columns[column_n];
+ column->DrawChannelCurrent = column->DrawChannelUnfrozen;
+ column->ClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y;
+ }
- // Update cliprect ahead of TableBeginCell() so clipper can access to new ClipRect->Min.y
- SetWindowClipRectBeforeSetChannel(window, table->Columns[0].ClipRect);
- table->DrawSplitter->SetCurrentChannel(window->DrawList, table->Columns[0].DrawChannelCurrent);
+ // Update cliprect ahead of TableBeginCell() so clipper can access to new ClipRect->Min.y
+ SetWindowClipRectBeforeSetChannel(window, table->Columns[0].ClipRect);
+ table->DrawSplitter->SetCurrentChannel(window->DrawList, table->Columns[0].DrawChannelCurrent);
+ }
}
if (!(table->RowFlags & ImGuiTableRowFlags_Headers))
@@ -1906,13 +2116,17 @@ bool ImGui::TableSetColumnIndex(int column_n)
{
if (table->CurrentColumn != -1)
TableEndCell(table);
- IM_ASSERT(column_n >= 0 && table->ColumnsCount);
+ if ((column_n >= 0 && column_n < table->ColumnsCount) == false)
+ {
+ IM_ASSERT_USER_ERROR(column_n >= 0 && column_n < table->ColumnsCount, "TableSetColumnIndex() invalid column index!");
+ return false;
+ }
TableBeginCell(table, column_n);
}
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
- return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0;
+ return table->Columns[column_n].IsRequestOutput;
}
// [Public] Append into the next column, wrap and create a new row when already on last column
@@ -1937,8 +2151,7 @@ bool ImGui::TableNextColumn()
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
- int column_n = table->CurrentColumn;
- return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0;
+ return table->Columns[table->CurrentColumn].IsRequestOutput;
}
@@ -1947,6 +2160,7 @@ bool ImGui::TableNextColumn()
// FIXME-TABLE FIXME-OPT: Could probably shortcut some things for non-active or clipped columns.
void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
{
+ ImGuiContext& g = *GImGui;
ImGuiTableColumn* column = &table->Columns[column_n];
ImGuiWindow* window = table->InnerWindow;
table->CurrentColumn = column_n;
@@ -1957,25 +2171,22 @@ void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
start_x += table->RowIndentOffsetX; // ~~ += window.DC.Indent.x - table->HostIndentX, except we locked it for the row.
window->DC.CursorPos.x = start_x;
- window->DC.CursorPos.y = table->RowPosY1 + table->CellPaddingY;
+ window->DC.CursorPos.y = table->RowPosY1 + table->RowCellPaddingY;
window->DC.CursorMaxPos.x = window->DC.CursorPos.x;
window->DC.ColumnsOffset.x = start_x - window->Pos.x - window->DC.Indent.x; // FIXME-WORKRECT
+ window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x; // PrevLine.y is preserved. This allows users to call SameLine() to share LineSize between columns.
window->DC.CurrLineTextBaseOffset = table->RowTextBaseline;
window->DC.NavLayerCurrent = (ImGuiNavLayer)column->NavLayerCurrent;
+ // Note how WorkRect.Max.y is only set once during layout
window->WorkRect.Min.y = window->DC.CursorPos.y;
window->WorkRect.Min.x = column->WorkMinX;
window->WorkRect.Max.x = column->WorkMaxX;
window->DC.ItemWidth = column->ItemWidth;
- // To allow ImGuiListClipper to function we propagate our row height
- if (!column->IsEnabled)
- window->DC.CursorPos.y = ImMax(window->DC.CursorPos.y, table->RowPosY2);
-
window->SkipItems = column->IsSkipItems;
if (column->IsSkipItems)
{
- ImGuiContext& g = *GImGui;
g.LastItemData.ID = 0;
g.LastItemData.StatusFlags = 0;
}
@@ -1994,7 +2205,6 @@ void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
}
// Logging
- ImGuiContext& g = *GImGui;
if (g.LogEnabled && !column->IsSkipItems)
{
LogRenderedText(&window->DC.CursorPos, "|");
@@ -2018,7 +2228,8 @@ void ImGui::TableEndCell(ImGuiTable* table)
else
p_max_pos_x = table->IsUnfrozenRows ? &column->ContentMaxXUnfrozen : &column->ContentMaxXFrozen;
*p_max_pos_x = ImMax(*p_max_pos_x, window->DC.CursorMaxPos.x);
- table->RowPosY2 = ImMax(table->RowPosY2, window->DC.CursorMaxPos.y + table->CellPaddingY);
+ if (column->IsEnabled)
+ table->RowPosY2 = ImMax(table->RowPosY2, window->DC.CursorMaxPos.y + table->RowCellPaddingY);
column->ItemWidth = window->DC.ItemWidth;
// Propagate text baseline for the entire row
@@ -2036,9 +2247,11 @@ void ImGui::TableEndCell(ImGuiTable* table)
// - TableSetColumnWidthAutoAll() [Internal]
// - TableUpdateColumnsWeightFromWidth() [Internal]
//-------------------------------------------------------------------------
+// Note that actual columns widths are computed in TableUpdateLayout().
+//-------------------------------------------------------------------------
-// Maximum column content width given current layout. Use column->MinX so this value on a per-column basis.
-float ImGui::TableGetMaxColumnWidth(const ImGuiTable* table, int column_n)
+// Maximum column content width given current layout. Use column->MinX so this value differs on a per-column basis.
+float ImGui::TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n)
{
const ImGuiTableColumn* column = &table->Columns[column_n];
float max_width = FLT_MAX;
@@ -2100,7 +2313,7 @@ void ImGui::TableSetColumnWidth(int column_n, float width)
// Compare both requested and actual given width to avoid overwriting requested width when column is stuck (minimum size, bounded)
IM_ASSERT(table->MinColumnWidth > 0.0f);
const float min_width = table->MinColumnWidth;
- const float max_width = ImMax(min_width, TableGetMaxColumnWidth(table, column_n));
+ const float max_width = ImMax(min_width, column_0->WidthMax); // Don't use TableCalcMaxColumnWidth() here as it would rely on MinX from last instance (#7933)
column_0_width = ImClamp(column_0_width, min_width, max_width);
if (column_0->WidthGiven == column_0_width || column_0->WidthRequest == column_0_width)
return;
@@ -2113,7 +2326,7 @@ void ImGui::TableSetColumnWidth(int column_n, float width)
// - All stretch: easy.
// - One or more fixed + one stretch: easy.
// - One or more fixed + more than one stretch: tricky.
- // Qt when manual resize is enabled only support a single _trailing_ stretch column.
+ // Qt when manual resize is enabled only supports a single _trailing_ stretch column, we support more cases here.
// When forwarding resize from Wn| to Fn+1| we need to be considerate of the _NoResize flag on Fn+1.
// FIXME-TABLE: Find a way to rewrite all of this so interactions feel more consistent for the user.
@@ -2196,7 +2409,7 @@ void ImGui::TableUpdateColumnsWeightFromWidth(ImGuiTable* table)
{
IM_ASSERT(table->LeftMostStretchedColumn != -1 && table->RightMostStretchedColumn != -1);
- // Measure existing quantity
+ // Measure existing quantities
float visible_weight = 0.0f;
float visible_width = 0.0f;
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
@@ -2228,6 +2441,7 @@ void ImGui::TableUpdateColumnsWeightFromWidth(ImGuiTable* table)
// - TablePopBackgroundChannel() [Internal]
// - TableSetupDrawChannels() [Internal]
// - TableMergeDrawChannels() [Internal]
+// - TableGetColumnBorderCol() [Internal]
// - TableDrawBorders() [Internal]
//-------------------------------------------------------------------------
@@ -2278,7 +2492,7 @@ void ImGui::TableSetupDrawChannels(ImGuiTable* table)
const int freeze_row_multiplier = (table->FreezeRowsCount > 0) ? 2 : 1;
const int channels_for_row = (table->Flags & ImGuiTableFlags_NoClip) ? 1 : table->ColumnsEnabledCount;
const int channels_for_bg = 1 + 1 * freeze_row_multiplier;
- const int channels_for_dummy = (table->ColumnsEnabledCount < table->ColumnsCount || table->VisibleMaskByIndex != table->EnabledMaskByIndex) ? +1 : 0;
+ const int channels_for_dummy = (table->ColumnsEnabledCount < table->ColumnsCount || (memcmp(table->VisibleMaskByIndex, table->EnabledMaskByIndex, ImBitArrayGetStorageSizeInBytes(table->ColumnsCount)) != 0)) ? +1 : 0;
const int channels_total = channels_for_bg + (channels_for_row * freeze_row_multiplier) + channels_for_dummy;
table->DrawSplitter->Split(table->InnerWindow->DrawList, channels_total);
table->DummyDrawChannel = (ImGuiTableDrawChannelIdx)((channels_for_dummy > 0) ? channels_total - 1 : -1);
@@ -2352,19 +2566,26 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
// Track which groups we are going to attempt to merge, and which channels goes into each group.
struct MergeGroup
{
- ImRect ClipRect;
- int ChannelsCount;
- ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> ChannelsMask;
-
- MergeGroup() { ChannelsCount = 0; }
+ ImRect ClipRect;
+ int ChannelsCount = 0;
+ ImBitArrayPtr ChannelsMask = NULL;
};
int merge_group_mask = 0x00;
MergeGroup merge_groups[4];
+ // Use a reusable temp buffer for the merge masks as they are dynamically sized.
+ const int max_draw_channels = (4 + table->ColumnsCount * 2);
+ const int size_for_masks_bitarrays_one = (int)ImBitArrayGetStorageSizeInBytes(max_draw_channels);
+ g.TempBuffer.reserve(size_for_masks_bitarrays_one * 5);
+ memset(g.TempBuffer.Data, 0, size_for_masks_bitarrays_one * 5);
+ for (int n = 0; n < IM_ARRAYSIZE(merge_groups); n++)
+ merge_groups[n].ChannelsMask = (ImBitArrayPtr)(void*)(g.TempBuffer.Data + (size_for_masks_bitarrays_one * n));
+ ImBitArrayPtr remaining_mask = (ImBitArrayPtr)(void*)(g.TempBuffer.Data + (size_for_masks_bitarrays_one * 4));
+
// 1. Scan channels and take note of those which can be merged
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
{
- if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0)
+ if (!IM_BITARRAY_TESTBIT(table->VisibleMaskByIndex, column_n))
continue;
ImGuiTableColumn* column = &table->Columns[column_n];
@@ -2396,11 +2617,11 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
}
const int merge_group_n = (has_freeze_h && column_n < table->FreezeColumnsCount ? 0 : 1) + (has_freeze_v && merge_group_sub_n == 0 ? 0 : 2);
- IM_ASSERT(channel_no < IMGUI_TABLE_MAX_DRAW_CHANNELS);
+ IM_ASSERT(channel_no < max_draw_channels);
MergeGroup* merge_group = &merge_groups[merge_group_n];
if (merge_group->ChannelsCount == 0)
merge_group->ClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX);
- merge_group->ChannelsMask.SetBit(channel_no);
+ ImBitArraySetBit(merge_group->ChannelsMask, channel_no);
merge_group->ChannelsCount++;
merge_group->ClipRect.Add(src_channel->_CmdBuffer[0].ClipRect);
merge_group_mask |= (1 << merge_group_n);
@@ -2436,9 +2657,8 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
const int LEADING_DRAW_CHANNELS = 2;
g.DrawChannelsTempMergeBuffer.resize(splitter->_Count - LEADING_DRAW_CHANNELS); // Use shared temporary storage so the allocation gets amortized
ImDrawChannel* dst_tmp = g.DrawChannelsTempMergeBuffer.Data;
- ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> remaining_mask; // We need 132-bit of storage
- remaining_mask.SetBitRange(LEADING_DRAW_CHANNELS, splitter->_Count);
- remaining_mask.ClearBit(table->Bg2DrawChannelUnfrozen);
+ ImBitArraySetBitRange(remaining_mask, LEADING_DRAW_CHANNELS, splitter->_Count);
+ ImBitArrayClearBit(remaining_mask, table->Bg2DrawChannelUnfrozen);
IM_ASSERT(has_freeze_v == false || table->Bg2DrawChannelUnfrozen != TABLE_DRAW_CHANNEL_BG2_FROZEN);
int remaining_count = splitter->_Count - (has_freeze_v ? LEADING_DRAW_CHANNELS + 1 : LEADING_DRAW_CHANNELS);
//ImRect host_rect = (table->InnerWindow == table->OuterWindow) ? table->InnerClipRect : table->HostClipRect;
@@ -2465,20 +2685,18 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
merge_clip_rect.Max.x = ImMax(merge_clip_rect.Max.x, host_rect.Max.x);
if ((merge_group_n & 2) != 0 && (table->Flags & ImGuiTableFlags_NoHostExtendY) == 0)
merge_clip_rect.Max.y = ImMax(merge_clip_rect.Max.y, host_rect.Max.y);
-#if 0
- GetOverlayDrawList()->AddRect(merge_group->ClipRect.Min, merge_group->ClipRect.Max, IM_COL32(255, 0, 0, 200), 0.0f, 0, 1.0f);
- GetOverlayDrawList()->AddLine(merge_group->ClipRect.Min, merge_clip_rect.Min, IM_COL32(255, 100, 0, 200));
- GetOverlayDrawList()->AddLine(merge_group->ClipRect.Max, merge_clip_rect.Max, IM_COL32(255, 100, 0, 200));
-#endif
+ //GetForegroundDrawList()->AddRect(merge_group->ClipRect.Min, merge_group->ClipRect.Max, IM_COL32(255, 0, 0, 200), 0.0f, 0, 1.0f); // [DEBUG]
+ //GetForegroundDrawList()->AddLine(merge_group->ClipRect.Min, merge_clip_rect.Min, IM_COL32(255, 100, 0, 200));
+ //GetForegroundDrawList()->AddLine(merge_group->ClipRect.Max, merge_clip_rect.Max, IM_COL32(255, 100, 0, 200));
remaining_count -= merge_group->ChannelsCount;
- for (int n = 0; n < IM_ARRAYSIZE(remaining_mask.Storage); n++)
- remaining_mask.Storage[n] &= ~merge_group->ChannelsMask.Storage[n];
+ for (int n = 0; n < (size_for_masks_bitarrays_one >> 2); n++)
+ remaining_mask[n] &= ~merge_group->ChannelsMask[n];
for (int n = 0; n < splitter->_Count && merge_channels_count != 0; n++)
{
// Copy + overwrite new clip rect
- if (!merge_group->ChannelsMask.TestBit(n))
+ if (!IM_BITARRAY_TESTBIT(merge_group->ChannelsMask, n))
continue;
- merge_group->ChannelsMask.ClearBit(n);
+ IM_BITARRAY_CLEARBIT(merge_group->ChannelsMask, n);
merge_channels_count--;
ImDrawChannel* channel = &splitter->_Channels[n];
@@ -2496,7 +2714,7 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
// Append unmergeable channels that we didn't reorder at the end of the list
for (int n = 0; n < splitter->_Count && remaining_count != 0; n++)
{
- if (!remaining_mask.TestBit(n))
+ if (!IM_BITARRAY_TESTBIT(remaining_mask, n))
continue;
ImDrawChannel* channel = &splitter->_Channels[n];
memcpy(dst_tmp++, channel, sizeof(ImDrawChannel));
@@ -2507,6 +2725,18 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
}
}
+static ImU32 TableGetColumnBorderCol(ImGuiTable* table, int order_n, int column_n)
+{
+ const bool is_hovered = (table->HoveredColumnBorder == column_n);
+ const bool is_resized = (table->ResizedColumn == column_n) && (table->InstanceInteracted == table->InstanceCurrent);
+ const bool is_frozen_separator = (table->FreezeColumnsCount == order_n + 1);
+ if (is_resized || is_hovered)
+ return ImGui::GetColorU32(is_resized ? ImGuiCol_SeparatorActive : ImGuiCol_SeparatorHovered);
+ if (is_frozen_separator || (table->Flags & (ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_NoBordersInBodyUntilResize)))
+ return table->BorderColorStrong;
+ return table->BorderColorLight;
+}
+
// FIXME-TABLE: This is a mess, need to redesign how we render borders (as some are also done in TableEndRow)
void ImGui::TableDrawBorders(ImGuiTable* table)
{
@@ -2521,14 +2751,14 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
// Draw inner border and resizing feedback
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
const float border_size = TABLE_BORDER_SIZE;
- const float draw_y1 = table->InnerRect.Min.y;
+ const float draw_y1 = ImMax(table->InnerRect.Min.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table->AngledHeadersHeight) + ((table->Flags & ImGuiTableFlags_BordersOuterH) ? 1.0f : 0.0f);
const float draw_y2_body = table->InnerRect.Max.y;
- const float draw_y2_head = table->IsUsingHeaders ? ImMin(table->InnerRect.Max.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table_instance->LastFirstRowHeight) : draw_y1;
+ const float draw_y2_head = table->IsUsingHeaders ? ImMin(table->InnerRect.Max.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table_instance->LastTopHeadersRowHeight) : draw_y1;
if (table->Flags & ImGuiTableFlags_BordersInnerV)
{
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
{
- if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
+ if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
continue;
const int column_n = table->DisplayOrderToIndex[order_n];
@@ -2549,21 +2779,9 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
// Draw in outer window so right-most column won't be clipped
// Always draw full height border when being resized/hovered, or on the delimitation of frozen column scrolling.
- ImU32 col;
- float draw_y2;
- if (is_hovered || is_resized || is_frozen_separator)
- {
- draw_y2 = draw_y2_body;
- col = is_resized ? GetColorU32(ImGuiCol_SeparatorActive) : is_hovered ? GetColorU32(ImGuiCol_SeparatorHovered) : table->BorderColorStrong;
- }
- else
- {
- draw_y2 = (table->Flags & (ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_NoBordersInBodyUntilResize)) ? draw_y2_head : draw_y2_body;
- col = (table->Flags & (ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_NoBordersInBodyUntilResize)) ? table->BorderColorStrong : table->BorderColorLight;
- }
-
+ float draw_y2 = (is_hovered || is_resized || is_frozen_separator || (table->Flags & (ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_NoBordersInBodyUntilResize)) == 0) ? draw_y2_body : draw_y2_head;
if (draw_y2 > draw_y1)
- inner_drawlist->AddLine(ImVec2(column->MaxX, draw_y1), ImVec2(column->MaxX, draw_y2), col, border_size);
+ inner_drawlist->AddLine(ImVec2(column->MaxX, draw_y1), ImVec2(column->MaxX, draw_y2), TableGetColumnBorderCol(table, order_n, column_n), border_size);
}
}
@@ -2595,7 +2813,7 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
}
if ((table->Flags & ImGuiTableFlags_BordersInnerH) && table->RowPosY2 < table->OuterRect.Max.y)
{
- // Draw bottom-most row border
+ // Draw bottom-most row border between it is above outer border.
const float border_y = table->RowPosY2;
if (border_y >= table->BgClipRect.Min.y && border_y < table->BgClipRect.Max.y)
inner_drawlist->AddLine(ImVec2(table->BorderX1, border_y), ImVec2(table->BorderX2, border_y), table->BorderColorLight, border_size);
@@ -2616,8 +2834,9 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
//-------------------------------------------------------------------------
// Return NULL if no sort specs (most often when ImGuiTableFlags_Sortable is not set)
-// You can sort your data again when 'SpecsChanged == true'. It will be true with sorting specs have changed since
-// last call, or the first time.
+// When 'sort_specs->SpecsDirty == true' you should sort your data. It will be true when sorting specs have
+// changed since last call, or the first time. Make sure to set 'SpecsDirty = false' after sorting,
+// else you may wastefully sort your data every frame!
// Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable()!
ImGuiTableSortSpecs* ImGui::TableGetSortSpecs()
{
@@ -2633,14 +2852,13 @@ ImGuiTableSortSpecs* ImGui::TableGetSortSpecs()
TableUpdateLayout(table);
TableSortSpecsBuild(table);
-
return &table->SortSpecs;
}
static inline ImGuiSortDirection TableGetColumnAvailSortDirection(ImGuiTableColumn* column, int n)
{
IM_ASSERT(n < column->SortDirectionsAvailCount);
- return (column->SortDirectionsAvailList >> (n << 1)) & 0x03;
+ return (ImGuiSortDirection)((column->SortDirectionsAvailList >> (n << 1)) & 0x03);
}
// Fix sort direction if currently set on a value which is unavailable (e.g. activating NoSortAscending/NoSortDescending)
@@ -2752,7 +2970,7 @@ void ImGui::TableSortSpecsSanitize(ImGuiTable* table)
}
}
- // Fallback default sort order (if no column had the ImGuiTableColumnFlags_DefaultSort flag)
+ // Fallback default sort order (if no column with the ImGuiTableColumnFlags_DefaultSort flag)
if (sort_order_count == 0 && !(table->Flags & ImGuiTableFlags_SortTristate))
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
{
@@ -2781,6 +2999,7 @@ void ImGui::TableSortSpecsBuild(ImGuiTable* table)
}
// Write output
+ // May be able to move all SortSpecs data from table (48 bytes) to ImGuiTableTempData if we decide to write it back on every BeginTable()
ImGuiTableColumnSortSpecs* sort_specs = (table->SortSpecsCount == 0) ? NULL : (table->SortSpecsCount == 1) ? &table->SortSpecsSingle : table->SortSpecsMulti.Data;
if (dirty && sort_specs != NULL)
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
@@ -2793,7 +3012,7 @@ void ImGui::TableSortSpecsBuild(ImGuiTable* table)
sort_spec->ColumnUserID = column->UserID;
sort_spec->ColumnIndex = (ImGuiTableColumnIdx)column_n;
sort_spec->SortOrder = (ImGuiTableColumnIdx)column->SortOrder;
- sort_spec->SortDirection = column->SortDirection;
+ sort_spec->SortDirection = (ImGuiSortDirection)column->SortDirection;
}
table->SortSpecs.Specs = sort_specs;
@@ -2804,8 +3023,11 @@ void ImGui::TableSortSpecsBuild(ImGuiTable* table)
// [SECTION] Tables: Headers
//-------------------------------------------------------------------------
// - TableGetHeaderRowHeight() [Internal]
+// - TableGetHeaderAngledMaxLabelWidth() [Internal]
// - TableHeadersRow()
// - TableHeader()
+// - TableAngledHeadersRow()
+// - TableAngledHeadersRowEx() [Internal]
//-------------------------------------------------------------------------
float ImGui::TableGetHeaderRowHeight()
@@ -2814,38 +3036,54 @@ float ImGui::TableGetHeaderRowHeight()
// Calculate row height, for the unlikely case that some labels may be taller than others.
// If we didn't do that, uneven header height would highlight but smaller one before the tallest wouldn't catch input for all height.
// In your custom header row you may omit this all together and just call TableNextRow() without a height...
- float row_height = GetTextLineHeight();
- int columns_count = TableGetColumnCount();
- for (int column_n = 0; column_n < columns_count; column_n++)
- {
- ImGuiTableColumnFlags flags = TableGetColumnFlags(column_n);
- if ((flags & ImGuiTableColumnFlags_IsEnabled) && !(flags & ImGuiTableColumnFlags_NoHeaderLabel))
- row_height = ImMax(row_height, CalcTextSize(TableGetColumnName(column_n)).y);
- }
- row_height += GetStyle().CellPadding.y * 2.0f;
- return row_height;
+ ImGuiContext& g = *GImGui;
+ ImGuiTable* table = g.CurrentTable;
+ float row_height = g.FontSize;
+ for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
+ if (IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
+ if ((table->Columns[column_n].Flags & ImGuiTableColumnFlags_NoHeaderLabel) == 0)
+ row_height = ImMax(row_height, CalcTextSize(TableGetColumnName(table, column_n)).y);
+ return row_height + g.Style.CellPadding.y * 2.0f;
+}
+
+float ImGui::TableGetHeaderAngledMaxLabelWidth()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiTable* table = g.CurrentTable;
+ float width = 0.0f;
+ for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
+ if (IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
+ if (table->Columns[column_n].Flags & ImGuiTableColumnFlags_AngledHeader)
+ width = ImMax(width, CalcTextSize(TableGetColumnName(table, column_n), NULL, true).x);
+ return width + g.Style.CellPadding.y * 2.0f; // Swap padding
}
// [Public] This is a helper to output TableHeader() calls based on the column names declared in TableSetupColumn().
// The intent is that advanced users willing to create customized headers would not need to use this helper
-// and can create their own! For example: TableHeader() may be preceeded by Checkbox() or other custom widgets.
+// and can create their own! For example: TableHeader() may be preceded by Checkbox() or other custom widgets.
// See 'Demo->Tables->Custom headers' for a demonstration of implementing a custom version of this.
-// This code is constructed to not make much use of internal functions, as it is intended to be a template to copy.
+// This code is intentionally written to not make much use of internal functions, to give you better direction
+// if you need to write your own.
// FIXME-TABLE: TableOpenContextMenu() and TableGetHeaderRowHeight() are not public.
void ImGui::TableHeadersRow()
{
ImGuiContext& g = *GImGui;
ImGuiTable* table = g.CurrentTable;
- IM_ASSERT(table != NULL && "Need to call TableHeadersRow() after BeginTable()!");
+ if (table == NULL)
+ {
+ IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
+ return;
+ }
- // Layout if not already done (this is automatically done by TableNextRow, we do it here solely to facilitate stepping in debugger as it is frequent to step in TableUpdateLayout)
+ // Call layout if not already done. This is automatically done by TableNextRow: we do it here _only_ to make
+ // it easier to debug-step in TableUpdateLayout(). Your own version of this function doesn't need this.
if (!table->IsLayoutLocked)
TableUpdateLayout(table);
// Open row
- const float row_y1 = GetCursorScreenPos().y;
const float row_height = TableGetHeaderRowHeight();
TableNextRow(ImGuiTableRowFlags_Headers, row_height);
+ const float row_y1 = GetCursorScreenPos().y;
if (table->HostSkipItems) // Merely an optimization, you may skip in your own code.
return;
@@ -2855,11 +3093,9 @@ void ImGui::TableHeadersRow()
if (!TableSetColumnIndex(column_n))
continue;
- // Push an id to allow unnamed labels (generally accidental, but let's behave nicely with them)
- // - in your own code you may omit the PushID/PopID all-together, provided you know they won't collide
- // - table->InstanceCurrent is only >0 when we use multiple BeginTable/EndTable calls with same identifier.
+ // Push an id to allow empty/unnamed headers. This is also idiomatic as it ensure there is a consistent ID path to access columns (for e.g. automation)
const char* name = (TableGetColumnFlags(column_n) & ImGuiTableColumnFlags_NoHeaderLabel) ? "" : TableGetColumnName(column_n);
- PushID(table->InstanceCurrent * table->ColumnsCount + column_n);
+ PushID(column_n);
TableHeader(name);
PopID();
}
@@ -2868,7 +3104,7 @@ void ImGui::TableHeadersRow()
ImVec2 mouse_pos = ImGui::GetMousePos();
if (IsMouseReleased(1) && TableGetHoveredColumn() == columns_count)
if (mouse_pos.y >= row_y1 && mouse_pos.y < row_y1 + row_height)
- TableOpenContextMenu(-1); // Will open a non-column-specific popup.
+ TableOpenContextMenu(columns_count); // Will open a non-column-specific popup.
}
// Emit a column header (text + optional sort order)
@@ -2882,7 +3118,12 @@ void ImGui::TableHeader(const char* label)
return;
ImGuiTable* table = g.CurrentTable;
- IM_ASSERT(table != NULL && "Need to call TableHeader() after BeginTable()!");
+ if (table == NULL)
+ {
+ IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
+ return;
+ }
+
IM_ASSERT(table->CurrentColumn != -1);
const int column_n = table->CurrentColumn;
ImGuiTableColumn* column = &table->Columns[column_n];
@@ -2897,16 +3138,19 @@ void ImGui::TableHeader(const char* label)
// If we already got a row height, there's use that.
// FIXME-TABLE: Padding problem if the correct outer-padding CellBgRect strays off our ClipRect?
ImRect cell_r = TableGetCellBgRect(table, column_n);
- float label_height = ImMax(label_size.y, table->RowMinHeight - table->CellPaddingY * 2.0f);
+ float label_height = ImMax(label_size.y, table->RowMinHeight - table->RowCellPaddingY * 2.0f);
// Calculate ideal size for sort order arrow
float w_arrow = 0.0f;
float w_sort_text = 0.0f;
+ bool sort_arrow = false;
char sort_order_suf[4] = "";
const float ARROW_SCALE = 0.65f;
if ((table->Flags & ImGuiTableFlags_Sortable) && !(column->Flags & ImGuiTableColumnFlags_NoSort))
{
- w_arrow = ImFloor(g.FontSize * ARROW_SCALE + g.Style.FramePadding.x);
+ w_arrow = ImTrunc(g.FontSize * ARROW_SCALE + g.Style.FramePadding.x);
+ if (column->SortOrder != -1)
+ sort_arrow = true;
if (column->SortOrder > 0)
{
ImFormatString(sort_order_suf, IM_ARRAYSIZE(sort_order_suf), "%d", column->SortOrder + 1);
@@ -2914,13 +3158,12 @@ void ImGui::TableHeader(const char* label)
}
}
- // We feed our unclipped width to the column without writing on CursorMaxPos, so that column is still considering for merging.
+ // We feed our unclipped width to the column without writing on CursorMaxPos, so that column is still considered for merging.
float max_pos_x = label_pos.x + label_size.x + w_sort_text + w_arrow;
- column->ContentMaxXHeadersUsed = ImMax(column->ContentMaxXHeadersUsed, column->WorkMaxX);
+ column->ContentMaxXHeadersUsed = ImMax(column->ContentMaxXHeadersUsed, sort_arrow ? cell_r.Max.x : ImMin(max_pos_x, cell_r.Max.x));
column->ContentMaxXHeadersIdeal = ImMax(column->ContentMaxXHeadersIdeal, max_pos_x);
// Keep header highlighted when context menu is open.
- const bool selected = (table->IsContextPopupOpen && table->ContextPopupColumn == column_n && table->InstanceInteracted == table->InstanceCurrent);
ImGuiID id = window->GetID(label);
ImRect bb(cell_r.Min.x, cell_r.Min.y, cell_r.Max.x, ImMax(cell_r.Max.y, cell_r.Min.y + label_height + g.Style.CellPadding.y * 2.0f));
ItemSize(ImVec2(0.0f, label_height)); // Don't declare unclipped width, it'll be fed ContentMaxPosHeadersIdeal
@@ -2930,12 +3173,11 @@ void ImGui::TableHeader(const char* label)
//GetForegroundDrawList()->AddRect(cell_r.Min, cell_r.Max, IM_COL32(255, 0, 0, 255)); // [DEBUG]
//GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 0, 0, 255)); // [DEBUG]
- // Using AllowItemOverlap mode because we cover the whole cell, and we want user to be able to submit subsequent items.
+ // Using AllowOverlap mode because we cover the whole cell, and we want user to be able to submit subsequent items.
+ const bool highlight = (table->HighlightColumnHeader == column_n);
bool hovered, held;
- bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_AllowItemOverlap);
- if (g.ActiveId != id)
- SetItemAllowOverlap();
- if (held || hovered || selected)
+ bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_AllowOverlap);
+ if (held || hovered || highlight)
{
const ImU32 col = GetColorU32(held ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
//RenderFrame(bb.Min, bb.Max, col, false, 0.0f);
@@ -2947,7 +3189,7 @@ void ImGui::TableHeader(const char* label)
if ((table->RowFlags & ImGuiTableRowFlags_Headers) == 0)
TableSetBgColor(ImGuiTableBgTarget_CellBg, GetColorU32(ImGuiCol_TableHeaderBg), table->CurrentColumn);
}
- RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_TypeThin | ImGuiNavHighlightFlags_NoRounding);
+ RenderNavCursor(bb, id, ImGuiNavRenderCursorFlags_Compact | ImGuiNavRenderCursorFlags_NoRounding);
if (held)
table->HeldHeaderColumn = (ImGuiTableColumnIdx)column_n;
window->DC.CursorPos.y -= g.Style.ItemSpacing.y * 0.5f;
@@ -2974,7 +3216,7 @@ void ImGui::TableHeader(const char* label)
}
// Sort order arrow
- const float ellipsis_max = cell_r.Max.x - w_arrow - w_sort_text;
+ const float ellipsis_max = ImMax(cell_r.Max.x - w_arrow - w_sort_text, label_pos.x);
if ((table->Flags & ImGuiTableFlags_Sortable) && !(column->Flags & ImGuiTableColumnFlags_NoSort))
{
if (column->SortOrder != -1)
@@ -3005,19 +3247,194 @@ void ImGui::TableHeader(const char* label)
RenderTextEllipsis(window->DrawList, label_pos, ImVec2(ellipsis_max, label_pos.y + label_height + g.Style.FramePadding.y), ellipsis_max, ellipsis_max, label, label_end, &label_size);
const bool text_clipped = label_size.x > (ellipsis_max - label_pos.x);
- if (text_clipped && hovered && g.ActiveId == 0 && IsItemHovered(ImGuiHoveredFlags_DelayNormal))
- SetTooltip("%.*s", (int)(label_end - label), label);
+ if (text_clipped && hovered && g.ActiveId == 0)
+ SetItemTooltip("%.*s", (int)(label_end - label), label);
// We don't use BeginPopupContextItem() because we want the popup to stay up even after the column is hidden
if (IsMouseReleased(1) && IsItemHovered())
TableOpenContextMenu(column_n);
}
+// Unlike TableHeadersRow() it is not expected that you can reimplement or customize this with custom widgets.
+// FIXME: No hit-testing/button on the angled header.
+void ImGui::TableAngledHeadersRow()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiTable* table = g.CurrentTable;
+ ImGuiTableTempData* temp_data = table->TempData;
+ temp_data->AngledHeadersRequests.resize(0);
+ temp_data->AngledHeadersRequests.reserve(table->ColumnsEnabledCount);
+
+ // Which column needs highlight?
+ const ImGuiID row_id = GetID("##AngledHeaders");
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
+ int highlight_column_n = table->HighlightColumnHeader;
+ if (highlight_column_n == -1 && table->HoveredColumnBody != -1)
+ if (table_instance->HoveredRowLast == 0 && table->HoveredColumnBorder == -1 && (g.ActiveId == 0 || g.ActiveId == row_id || (table->IsActiveIdInTable || g.DragDropActive)))
+ highlight_column_n = table->HoveredColumnBody;
+
+ // Build up request
+ ImU32 col_header_bg = GetColorU32(ImGuiCol_TableHeaderBg);
+ ImU32 col_text = GetColorU32(ImGuiCol_Text);
+ for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
+ if (IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
+ {
+ const int column_n = table->DisplayOrderToIndex[order_n];
+ ImGuiTableColumn* column = &table->Columns[column_n];
+ if ((column->Flags & ImGuiTableColumnFlags_AngledHeader) == 0) // Note: can't rely on ImGuiTableColumnFlags_IsVisible test here.
+ continue;
+ ImGuiTableHeaderData request = { (ImGuiTableColumnIdx)column_n, col_text, col_header_bg, (column_n == highlight_column_n) ? GetColorU32(ImGuiCol_Header) : 0 };
+ temp_data->AngledHeadersRequests.push_back(request);
+ }
+
+ // Render row
+ TableAngledHeadersRowEx(row_id, g.Style.TableAngledHeadersAngle, 0.0f, temp_data->AngledHeadersRequests.Data, temp_data->AngledHeadersRequests.Size);
+}
+
+// Important: data must be fed left to right
+void ImGui::TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiTable* table = g.CurrentTable;
+ ImGuiWindow* window = g.CurrentWindow;
+ ImDrawList* draw_list = window->DrawList;
+ if (table == NULL)
+ {
+ IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
+ return;
+ }
+ IM_ASSERT(table->CurrentRow == -1 && "Must be first row");
+
+ if (max_label_width == 0.0f)
+ max_label_width = TableGetHeaderAngledMaxLabelWidth();
+
+ // Angle argument expressed in (-IM_PI/2 .. +IM_PI/2) as it is easier to think about for user.
+ const bool flip_label = (angle < 0.0f);
+ angle -= IM_PI * 0.5f;
+ const float cos_a = ImCos(angle);
+ const float sin_a = ImSin(angle);
+ const float label_cos_a = flip_label ? ImCos(angle + IM_PI) : cos_a;
+ const float label_sin_a = flip_label ? ImSin(angle + IM_PI) : sin_a;
+ const ImVec2 unit_right = ImVec2(cos_a, sin_a);
+
+ // Calculate our base metrics and set angled headers data _before_ the first call to TableNextRow()
+ // FIXME-STYLE: Would it be better for user to submit 'max_label_width' or 'row_height' ? One can be derived from the other.
+ const float header_height = g.FontSize + g.Style.CellPadding.x * 2.0f;
+ const float row_height = ImTrunc(ImFabs(ImRotate(ImVec2(max_label_width, flip_label ? +header_height : -header_height), cos_a, sin_a).y));
+ table->AngledHeadersHeight = row_height;
+ table->AngledHeadersSlope = (sin_a != 0.0f) ? (cos_a / sin_a) : 0.0f;
+ const ImVec2 header_angled_vector = unit_right * (row_height / -sin_a); // vector from bottom-left to top-left, and from bottom-right to top-right
+
+ // Declare row, override and draw our own background
+ TableNextRow(ImGuiTableRowFlags_Headers, row_height);
+ TableNextColumn();
+ const ImRect row_r(table->WorkRect.Min.x, table->BgClipRect.Min.y, table->WorkRect.Max.x, table->RowPosY2);
+ table->DrawSplitter->SetCurrentChannel(draw_list, TABLE_DRAW_CHANNEL_BG0);
+ float clip_rect_min_x = table->BgClipRect.Min.x;
+ if (table->FreezeColumnsCount > 0)
+ clip_rect_min_x = ImMax(clip_rect_min_x, table->Columns[table->FreezeColumnsCount - 1].MaxX);
+ TableSetBgColor(ImGuiTableBgTarget_RowBg0, 0); // Cancel
+ PushClipRect(table->BgClipRect.Min, table->BgClipRect.Max, false); // Span all columns
+ draw_list->AddRectFilled(ImVec2(table->BgClipRect.Min.x, row_r.Min.y), ImVec2(table->BgClipRect.Max.x, row_r.Max.y), GetColorU32(ImGuiCol_TableHeaderBg, 0.25f)); // FIXME-STYLE: Change row background with an arbitrary color.
+ PushClipRect(ImVec2(clip_rect_min_x, table->BgClipRect.Min.y), table->BgClipRect.Max, true); // Span all columns
+
+ ButtonBehavior(row_r, row_id, NULL, NULL);
+ KeepAliveID(row_id);
+
+ const float ascent_scaled = g.Font->Ascent * g.FontScale; // FIXME: Standardize those scaling factors better
+ const float line_off_for_ascent_x = (ImMax((g.FontSize - ascent_scaled) * 0.5f, 0.0f) / -sin_a) * (flip_label ? -1.0f : 1.0f);
+ const ImVec2 padding = g.Style.CellPadding; // We will always use swapped component
+ const ImVec2 align = g.Style.TableAngledHeadersTextAlign;
+
+ // Draw background and labels in first pass, then all borders.
+ float max_x = -FLT_MAX;
+ for (int pass = 0; pass < 2; pass++)
+ for (int order_n = 0; order_n < data_count; order_n++)
+ {
+ const ImGuiTableHeaderData* request = &data[order_n];
+ const int column_n = request->Index;
+ ImGuiTableColumn* column = &table->Columns[column_n];
+
+ ImVec2 bg_shape[4];
+ bg_shape[0] = ImVec2(column->MaxX, row_r.Max.y);
+ bg_shape[1] = ImVec2(column->MinX, row_r.Max.y);
+ bg_shape[2] = bg_shape[1] + header_angled_vector;
+ bg_shape[3] = bg_shape[0] + header_angled_vector;
+ if (pass == 0)
+ {
+ // Draw shape
+ draw_list->AddQuadFilled(bg_shape[0], bg_shape[1], bg_shape[2], bg_shape[3], request->BgColor0);
+ draw_list->AddQuadFilled(bg_shape[0], bg_shape[1], bg_shape[2], bg_shape[3], request->BgColor1); // Optional highlight
+ max_x = ImMax(max_x, bg_shape[3].x);
+
+ // Draw label
+ // - First draw at an offset where RenderTextXXX() function won't meddle with applying current ClipRect, then transform to final offset.
+ // - Handle multiple lines manually, as we want each lines to follow on the horizontal border, rather than see a whole block rotated.
+ const char* label_name = TableGetColumnName(table, column_n);
+ const char* label_name_end = FindRenderedTextEnd(label_name);
+ const float line_off_step_x = (g.FontSize / -sin_a);
+ const int label_lines = ImTextCountLines(label_name, label_name_end);
+
+ // Left<>Right alignment
+ float line_off_curr_x = flip_label ? (label_lines - 1) * line_off_step_x : 0.0f;
+ float line_off_for_align_x = ImMax((((column->MaxX - column->MinX) - padding.x * 2.0f) - (label_lines * line_off_step_x)), 0.0f) * align.x;
+ line_off_curr_x += line_off_for_align_x - line_off_for_ascent_x;
+
+ // Register header width
+ column->ContentMaxXHeadersUsed = column->ContentMaxXHeadersIdeal = column->WorkMinX + ImCeil(label_lines * line_off_step_x - line_off_for_align_x);
+
+ while (label_name < label_name_end)
+ {
+ const char* label_name_eol = strchr(label_name, '\n');
+ if (label_name_eol == NULL)
+ label_name_eol = label_name_end;
+
+ // FIXME: Individual line clipping for right-most column is broken for negative angles.
+ ImVec2 label_size = CalcTextSize(label_name, label_name_eol);
+ float clip_width = max_label_width - padding.y; // Using padding.y*2.0f would be symmetrical but hide more text.
+ float clip_height = ImMin(label_size.y, column->ClipRect.Max.x - column->WorkMinX - line_off_curr_x);
+ ImRect clip_r(window->ClipRect.Min, window->ClipRect.Min + ImVec2(clip_width, clip_height));
+ int vtx_idx_begin = draw_list->_VtxCurrentIdx;
+ PushStyleColor(ImGuiCol_Text, request->TextColor);
+ RenderTextEllipsis(draw_list, clip_r.Min, clip_r.Max, clip_r.Max.x, clip_r.Max.x, label_name, label_name_eol, &label_size);
+ PopStyleColor();
+ int vtx_idx_end = draw_list->_VtxCurrentIdx;
+
+ // Up<>Down alignment
+ const float available_space = ImMax(clip_width - label_size.x + ImAbs(padding.x * cos_a) * 2.0f - ImAbs(padding.y * sin_a) * 2.0f, 0.0f);
+ const float vertical_offset = available_space * align.y * (flip_label ? -1.0f : 1.0f);
+
+ // Rotate and offset label
+ ImVec2 pivot_in = ImVec2(window->ClipRect.Min.x - vertical_offset, window->ClipRect.Min.y + label_size.y);
+ ImVec2 pivot_out = ImVec2(column->WorkMinX, row_r.Max.y);
+ line_off_curr_x += flip_label ? -line_off_step_x : line_off_step_x;
+ pivot_out += unit_right * padding.y;
+ if (flip_label)
+ pivot_out += unit_right * (clip_width - ImMax(0.0f, clip_width - label_size.x));
+ pivot_out.x += flip_label ? line_off_curr_x + line_off_step_x : line_off_curr_x;
+ ShadeVertsTransformPos(draw_list, vtx_idx_begin, vtx_idx_end, pivot_in, label_cos_a, label_sin_a, pivot_out); // Rotate and offset
+ //if (g.IO.KeyShift) { ImDrawList* fg_dl = GetForegroundDrawList(); vtx_idx_begin = fg_dl->_VtxCurrentIdx; fg_dl->AddRect(clip_r.Min, clip_r.Max, IM_COL32(0, 255, 0, 255), 0.0f, 0, 1.0f); ShadeVertsTransformPos(fg_dl, vtx_idx_begin, fg_dl->_VtxCurrentIdx, pivot_in, label_cos_a, label_sin_a, pivot_out); }
+
+ label_name = label_name_eol + 1;
+ }
+ }
+ if (pass == 1)
+ {
+ // Draw border
+ draw_list->AddLine(bg_shape[0], bg_shape[3], TableGetColumnBorderCol(table, order_n, column_n));
+ }
+ }
+ PopClipRect();
+ PopClipRect();
+ table->TempData->AngledHeadersExtraWidth = ImMax(0.0f, max_x - table->Columns[table->RightMostEnabledColumn].MaxX);
+}
+
//-------------------------------------------------------------------------
// [SECTION] Tables: Context Menu
//-------------------------------------------------------------------------
// - TableOpenContextMenu() [Internal]
-// - TableDrawContextMenu() [Internal]
+// - TableBeginContextMenuPopup() [Internal]
+// - TableDrawDefaultContextMenu() [Internal]
//-------------------------------------------------------------------------
// Use -1 to open menu not specific to a given column.
@@ -3053,7 +3470,13 @@ bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table)
// Output context menu into current window (generally a popup)
// FIXME-TABLE: Ideally this should be writable by the user. Full programmatic access to that data?
-void ImGui::TableDrawContextMenu(ImGuiTable* table)
+// Sections to display are pulled from 'flags_for_section_to_display', which is typically == table->Flags.
+// - ImGuiTableFlags_Resizable -> display Sizing menu items
+// - ImGuiTableFlags_Reorderable -> display "Reset Order"
+////- ImGuiTableFlags_Sortable -> display sorting options (disabled)
+// - ImGuiTableFlags_Hideable -> display columns visibility menu items
+// It means if you have a custom context menus you can call this section and omit some sections, and add your own.
+void ImGui::TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
@@ -3065,7 +3488,7 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
ImGuiTableColumn* column = (column_n != -1) ? &table->Columns[column_n] : NULL;
// Sizing
- if (table->Flags & ImGuiTableFlags_Resizable)
+ if (flags_for_section_to_display & ImGuiTableFlags_Resizable)
{
if (column != NULL)
{
@@ -3085,7 +3508,7 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
}
// Ordering
- if (table->Flags & ImGuiTableFlags_Reorderable)
+ if (flags_for_section_to_display & ImGuiTableFlags_Reorderable)
{
if (MenuItem(LocalizeGetMsg(ImGuiLocKey_TableResetOrder), NULL, false, !table->IsDefaultDisplayOrder))
table->IsResetDisplayOrderRequest = true;
@@ -3099,7 +3522,7 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
// Sorting
// (modify TableOpenContextMenu() to add _Sortable flag if enabling this)
#if 0
- if ((table->Flags & ImGuiTableFlags_Sortable) && column != NULL && (column->Flags & ImGuiTableColumnFlags_NoSort) == 0)
+ if ((flags_for_section_to_display & ImGuiTableFlags_Sortable) && column != NULL && (column->Flags & ImGuiTableColumnFlags_NoSort) == 0)
{
if (want_separator)
Separator();
@@ -3114,13 +3537,13 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
#endif
// Hiding / Visibility
- if (table->Flags & ImGuiTableFlags_Hideable)
+ if (flags_for_section_to_display & ImGuiTableFlags_Hideable)
{
if (want_separator)
Separator();
want_separator = true;
- PushItemFlag(ImGuiItemFlags_SelectableDontClosePopup, true);
+ PushItemFlag(ImGuiItemFlags_AutoClosePopups, false);
for (int other_column_n = 0; other_column_n < table->ColumnsCount; other_column_n++)
{
ImGuiTableColumn* other_column = &table->Columns[other_column_n];
@@ -3310,6 +3733,14 @@ void ImGui::TableLoadSettings(ImGuiTable* table)
table->SettingsLoadedFlags = settings->SaveFlags;
table->RefScale = settings->RefScale;
+ // Initialize default columns settings
+ for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
+ {
+ ImGuiTableColumn* column = &table->Columns[column_n];
+ TableInitColumnDefaults(table, column, ~0);
+ column->AutoFitQueue = 0x00;
+ }
+
// Serialize ImGuiTableSettings/ImGuiTableColumnSettings into ImGuiTable/ImGuiTableColumn
ImGuiTableColumnSettings* column_settings = settings->GetColumnSettings();
ImU64 display_order_mask = 0;
@@ -3326,14 +3757,12 @@ void ImGui::TableLoadSettings(ImGuiTable* table)
column->StretchWeight = column_settings->WidthOrWeight;
else
column->WidthRequest = column_settings->WidthOrWeight;
- column->AutoFitQueue = 0x00;
}
if (settings->SaveFlags & ImGuiTableFlags_Reorderable)
column->DisplayOrder = column_settings->DisplayOrder;
- else
- column->DisplayOrder = (ImGuiTableColumnIdx)column_n;
display_order_mask |= (ImU64)1 << column->DisplayOrder;
- column->IsUserEnabled = column->IsUserEnabledNextFrame = column_settings->IsEnabled;
+ if ((settings->SaveFlags & ImGuiTableFlags_Hideable) && column_settings->IsEnabled != -1)
+ column->IsUserEnabled = column->IsUserEnabledNextFrame = column_settings->IsEnabled == 1;
column->SortOrder = column_settings->SortOrder;
column->SortDirection = column_settings->SortDirection;
}
@@ -3429,8 +3858,7 @@ static void TableSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandle
const bool save_visible = (settings->SaveFlags & ImGuiTableFlags_Hideable) != 0;
const bool save_order = (settings->SaveFlags & ImGuiTableFlags_Reorderable) != 0;
const bool save_sort = (settings->SaveFlags & ImGuiTableFlags_Sortable) != 0;
- if (!save_size && !save_visible && !save_order && !save_sort)
- continue;
+ // We need to save the [Table] entry even if all the bools are false, since this records a table with "default settings".
buf->reserve(buf->size() + 30 + settings->ColumnsCount * 50); // ballpark reserve
buf->appendf("[%s][0x%08X,%d]\n", handler->TypeName, settings->ID, settings->ColumnsCount);
@@ -3444,12 +3872,12 @@ static void TableSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandle
if (!save_column)
continue;
buf->appendf("Column %-2d", column_n);
- if (column->UserID != 0) buf->appendf(" UserID=%08X", column->UserID);
- if (save_size && column->IsStretch) buf->appendf(" Weight=%.4f", column->WidthOrWeight);
- if (save_size && !column->IsStretch) buf->appendf(" Width=%d", (int)column->WidthOrWeight);
- if (save_visible) buf->appendf(" Visible=%d", column->IsEnabled);
- if (save_order) buf->appendf(" Order=%d", column->DisplayOrder);
- if (save_sort && column->SortOrder != -1) buf->appendf(" Sort=%d%c", column->SortOrder, (column->SortDirection == ImGuiSortDirection_Ascending) ? 'v' : '^');
+ if (column->UserID != 0) { buf->appendf(" UserID=%08X", column->UserID); }
+ if (save_size && column->IsStretch) { buf->appendf(" Weight=%.4f", column->WidthOrWeight); }
+ if (save_size && !column->IsStretch) { buf->appendf(" Width=%d", (int)column->WidthOrWeight); }
+ if (save_visible) { buf->appendf(" Visible=%d", column->IsEnabled); }
+ if (save_order) { buf->appendf(" Order=%d", column->DisplayOrder); }
+ if (save_sort && column->SortOrder != -1) { buf->appendf(" Sort=%d%c", column->SortOrder, (column->SortDirection == ImGuiSortDirection_Ascending) ? 'v' : '^'); }
buf->append("\n");
}
buf->append("\n");
@@ -3497,7 +3925,7 @@ void ImGui::TableGcCompactTransientBuffers(ImGuiTable* table)
IM_ASSERT(table->MemoryCompacted == false);
table->SortSpecs.Specs = NULL;
table->SortSpecsMulti.clear();
- table->IsSortSpecsDirty = true; // FIXME: shouldn't have to leak into user performing a sort
+ table->IsSortSpecsDirty = true; // FIXME: In theory shouldn't have to leak into user performing a sort on resume.
table->ColumnsNames.clear();
table->MemoryCompacted = true;
for (int n = 0; n < table->ColumnsCount; n++)
@@ -3550,13 +3978,10 @@ static const char* DebugNodeTableGetSizingPolicyDesc(ImGuiTableFlags sizing_poli
void ImGui::DebugNodeTable(ImGuiTable* table)
{
- char buf[512];
- char* p = buf;
- const char* buf_end = buf + IM_ARRAYSIZE(buf);
- const bool is_active = (table->LastFrameActive >= ImGui::GetFrameCount() - 2); // Note that fully clipped early out scrolling tables will appear as inactive here.
- ImFormatString(p, buf_end - p, "Table 0x%08X (%d columns, in '%s')%s", table->ID, table->ColumnsCount, table->OuterWindow->Name, is_active ? "" : " *Inactive*");
+ ImGuiContext& g = *GImGui;
+ const bool is_active = (table->LastFrameActive >= g.FrameCount - 2); // Note that fully clipped early out scrolling tables will appear as inactive here.
if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); }
- bool open = TreeNode(table, "%s", buf);
+ bool open = TreeNode(table, "Table 0x%08X (%d columns, in '%s')%s", table->ID, table->ColumnsCount, table->OuterWindow->Name, is_active ? "" : " *Inactive*");
if (!is_active) { PopStyleColor(); }
if (IsItemHovered())
GetForegroundDrawList()->AddRect(table->OuterRect.Min, table->OuterRect.Max, IM_COL32(255, 255, 0, 255));
@@ -3565,13 +3990,25 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
if (!open)
return;
if (table->InstanceCurrent > 0)
- ImGui::Text("** %d instances of same table! Some data below will refer to last instance.", table->InstanceCurrent + 1);
+ Text("** %d instances of same table! Some data below will refer to last instance.", table->InstanceCurrent + 1);
+ if (g.IO.ConfigDebugIsDebuggerPresent)
+ {
+ if (DebugBreakButton("**DebugBreak**", "in BeginTable()"))
+ g.DebugBreakInTable = table->ID;
+ SameLine();
+ }
+
bool clear_settings = SmallButton("Clear settings");
BulletText("OuterRect: Pos: (%.1f,%.1f) Size: (%.1f,%.1f) Sizing: '%s'", table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.GetWidth(), table->OuterRect.GetHeight(), DebugNodeTableGetSizingPolicyDesc(table->Flags));
BulletText("ColumnsGivenWidth: %.1f, ColumnsAutoFitWidth: %.1f, InnerWidth: %.1f%s", table->ColumnsGivenWidth, table->ColumnsAutoFitWidth, table->InnerWidth, table->InnerWidth == 0.0f ? " (auto)" : "");
BulletText("CellPaddingX: %.1f, CellSpacingX: %.1f/%.1f, OuterPaddingX: %.1f", table->CellPaddingX, table->CellSpacingX1, table->CellSpacingX2, table->OuterPaddingX);
BulletText("HoveredColumnBody: %d, HoveredColumnBorder: %d", table->HoveredColumnBody, table->HoveredColumnBorder);
BulletText("ResizedColumn: %d, ReorderColumn: %d, HeldHeaderColumn: %d", table->ResizedColumn, table->ReorderColumn, table->HeldHeaderColumn);
+ for (int n = 0; n < table->InstanceCurrent + 1; n++)
+ {
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, n);
+ BulletText("Instance %d: HoveredRow: %d, LastOuterHeight: %.2f", n, table_instance->HoveredRowLast, table_instance->LastOuterHeight);
+ }
//BulletText("BgDrawChannels: %d/%d", 0, table->BgDrawChannelUnfrozen);
float sum_weights = 0.0f;
for (int n = 0; n < table->ColumnsCount; n++)
@@ -3581,6 +4018,7 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
{
ImGuiTableColumn* column = &table->Columns[n];
const char* name = TableGetColumnName(table, n);
+ char buf[512];
ImFormatString(buf, IM_ARRAYSIZE(buf),
"Column %d order %d '%s': offset %+.2f to %+.2f%s\n"
"Enabled: %d, VisibleX/Y: %d/%d, RequestOutput: %d, SkipItems: %d, DrawChannels: %d,%d\n"
@@ -3696,7 +4134,7 @@ float ImGui::GetColumnNormFromOffset(const ImGuiOldColumns* columns, float offse
return offset / (columns->OffMaxX - columns->OffMinX);
}
-static const float COLUMNS_HIT_RECT_HALF_WIDTH = 4.0f;
+static const float COLUMNS_HIT_RECT_HALF_THICKNESS = 4.0f;
static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column_index)
{
@@ -3707,7 +4145,7 @@ static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column_index)
IM_ASSERT(column_index > 0); // We are not supposed to drag column 0.
IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index));
- float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + COLUMNS_HIT_RECT_HALF_WIDTH - window->Pos.x;
+ float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + ImTrunc(COLUMNS_HIT_RECT_HALF_THICKNESS * g.CurrentDpiScale) - window->Pos.x;
x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing);
if ((columns->Flags & ImGuiOldColumnFlags_NoPreserveWidths))
x = ImMin(x, ImGui::GetColumnOffset(column_index + 1) - g.Style.ColumnsMinSpacing);
@@ -3869,6 +4307,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl
columns->Count = columns_count;
columns->Flags = flags;
window->DC.CurrentColumns = columns;
+ window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX();
columns->HostCursorPosY = window->DC.CursorPos.y;
columns->HostCursorMaxPosX = window->DC.CursorMaxPos.x;
@@ -3879,7 +4318,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl
// Set state for first column
// We aim so that the right-most column will have the same clipping width as other after being clipped by parent ClipRect
const float column_padding = g.Style.ItemSpacing.x;
- const float half_clip_extend_x = ImFloor(ImMax(window->WindowPadding.x * 0.5f, window->WindowBorderSize));
+ const float half_clip_extend_x = ImTrunc(ImMax(window->WindowPadding.x * 0.5f, window->WindowBorderSize));
const float max_1 = window->WorkRect.Max.x + column_padding - ImMax(column_padding - window->WindowPadding.x, 0.0f);
const float max_2 = window->WorkRect.Max.x + half_clip_extend_x;
columns->OffMinX = window->DC.Indent.x - column_padding + ImMax(column_padding - window->WindowPadding.x, 0.0f);
@@ -3926,8 +4365,9 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl
float width = offset_1 - offset_0;
PushItemWidth(width * 0.65f);
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
- window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
+ window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding;
+ window->WorkRect.Max.y = window->ContentRegionRect.Max.y;
}
void ImGui::NextColumn()
@@ -3941,7 +4381,7 @@ void ImGui::NextColumn()
if (columns->Count == 1)
{
- window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
+ window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
IM_ASSERT(columns->Current == 0);
return;
}
@@ -3973,7 +4413,7 @@ void ImGui::NextColumn()
window->DC.IsSameLine = false;
columns->LineMinY = columns->LineMaxY;
}
- window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
+ window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
window->DC.CursorPos.y = columns->LineMinY;
window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
window->DC.CurrLineTextBaseOffset = 0.0f;
@@ -4020,7 +4460,7 @@ void ImGui::EndColumns()
ImGuiOldColumnData* column = &columns->Columns[n];
float x = window->Pos.x + GetColumnOffset(n);
const ImGuiID column_id = columns->ID + ImGuiID(n);
- const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH;
+ const float column_hit_hw = ImTrunc(COLUMNS_HIT_RECT_HALF_THICKNESS * g.CurrentDpiScale);
const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2));
if (!ItemAdd(column_hit_rect, column_id, NULL, ImGuiItemFlags_NoNav))
continue;
@@ -4030,14 +4470,14 @@ void ImGui::EndColumns()
{
ButtonBehavior(column_hit_rect, column_id, &hovered, &held);
if (hovered || held)
- g.MouseCursor = ImGuiMouseCursor_ResizeEW;
+ SetMouseCursor(ImGuiMouseCursor_ResizeEW);
if (held && !(column->Flags & ImGuiOldColumnFlags_NoResize))
dragging_column = n;
}
// Draw column
const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : hovered ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator);
- const float xi = IM_FLOOR(x);
+ const float xi = IM_TRUNC(x);
window->DrawList->AddLine(ImVec2(xi, y1 + 1.0f), ImVec2(xi, y2), col);
}
@@ -4058,15 +4498,16 @@ void ImGui::EndColumns()
window->ParentWorkRect = columns->HostBackupParentWorkRect;
window->DC.CurrentColumns = NULL;
window->DC.ColumnsOffset.x = 0.0f;
- window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
+ window->DC.CursorPos.x = IM_TRUNC(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
+ NavUpdateCurrentWindowIsScrollPushableX();
}
-void ImGui::Columns(int columns_count, const char* id, bool border)
+void ImGui::Columns(int columns_count, const char* id, bool borders)
{
ImGuiWindow* window = GetCurrentWindow();
IM_ASSERT(columns_count >= 1);
- ImGuiOldColumnFlags flags = (border ? 0 : ImGuiOldColumnFlags_NoBorder);
+ ImGuiOldColumnFlags flags = (borders ? 0 : ImGuiOldColumnFlags_NoBorder);
//flags |= ImGuiOldColumnFlags_NoPreserveWidths; // NB: Legacy behavior
ImGuiOldColumns* columns = window->DC.CurrentColumns;
if (columns != NULL && columns->Count == columns_count && columns->Flags == flags)
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
index 3b8be01e7d4..7b03b4eb3ea 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.89.1 WIP
+// dear imgui, v1.91b
// (widgets code)
/*
@@ -18,6 +18,10 @@ Index of this file:
// [SECTION] Widgets: ColorEdit, ColorPicker, ColorButton, etc.
// [SECTION] Widgets: TreeNode, CollapsingHeader, etc.
// [SECTION] Widgets: Selectable
+// [SECTION] Widgets: Typing-Select support
+// [SECTION] Widgets: Box-Select support
+// [SECTION] Widgets: Multi-Select support
+// [SECTION] Widgets: Multi-Select helpers
// [SECTION] Widgets: ListBox
// [SECTION] Widgets: PlotLines, PlotHistogram
// [SECTION] Widgets: Value helpers
@@ -32,20 +36,16 @@ Index of this file:
#define _CRT_SECURE_NO_WARNINGS
#endif
-#include "imgui.h"
-#ifndef IMGUI_DISABLE
-
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
+
+#include "imgui.h"
+#ifndef IMGUI_DISABLE
#include "imgui_internal.h"
// System includes
-#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
-#include <stddef.h> // intptr_t
-#else
#include <stdint.h> // intptr_t
-#endif
//-------------------------------------------------------------------------
// Warnings
@@ -70,18 +70,28 @@ Index of this file:
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants (typically 0.0f) is ok.
+#pragma clang diagnostic ignored "-Wformat" // warning: format specifies type 'int' but the argument has type 'unsigned int'
#pragma clang diagnostic ignored "-Wformat-nonliteral" // warning: format string is not a string literal // passing non-literal to vsnformat(). yes, user passing incorrect format strings can crash the code.
#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
+#pragma clang diagnostic ignored "-Wunused-macros" // warning: macro is not used // we define snprintf/vsnprintf on Windows so they are available, but not always used.
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant // some standard header variations use #define NULL 0
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
#pragma clang diagnostic ignored "-Wenum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_')
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
+#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
+#pragma clang diagnostic ignored "-Wswitch-default" // warning: 'switch' missing 'default' label
#elif defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
+#pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe
+#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'int'/'void*', but argument X has type 'unsigned int'/'ImGuiWindow*'
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
-#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
+#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
+#pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when simplifying division / ..when changing X +- C1 cmp C2 to X cmp C2 -+ C1
+#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
+#pragma GCC diagnostic ignored "-Wcast-qual" // warning: cast from type 'const xxxx *' to type 'xxxx *' casts away qualifiers
#endif
//-------------------------------------------------------------------------
@@ -124,9 +134,9 @@ static const ImU64 IM_U64_MAX = (2ULL * 9223372036854775807LL + 1);
//-------------------------------------------------------------------------
// For InputTextEx()
-static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data, ImGuiInputSource input_source);
-static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end);
-static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false);
+static bool InputTextFilterCharacter(ImGuiContext* ctx, unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data, bool input_source_is_clipboard = false);
+static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end);
+static ImVec2 InputTextCalcTextSize(ImGuiContext* ctx, const char* text_begin, const char* text_end, const char** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false);
//-------------------------------------------------------------------------
// [SECTION] Widgets: Text, etc.
@@ -161,7 +171,7 @@ void ImGui::TextEx(const char* text, const char* text_end, ImGuiTextFlags flags)
// Calculate length
const char* text_begin = text;
if (text_end == NULL)
- text_end = text + strlen(text); // FIXME-OPT
+ text_end = text + ImStrlen(text); // FIXME-OPT
const ImVec2 text_pos(window->DC.CursorPos.x, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset);
const float wrap_pos_x = window->DC.TextWrapPos;
@@ -201,7 +211,7 @@ void ImGui::TextEx(const char* text, const char* text_end, ImGuiTextFlags flags)
int lines_skipped = 0;
while (line < text_end && lines_skipped < lines_skippable)
{
- const char* line_end = (const char*)memchr(line, '\n', text_end - line);
+ const char* line_end = (const char*)ImMemchr(line, '\n', text_end - line);
if (!line_end)
line_end = text_end;
if ((flags & ImGuiTextFlags_NoWidthForLargeClippedText) == 0)
@@ -222,7 +232,7 @@ void ImGui::TextEx(const char* text, const char* text_end, ImGuiTextFlags flags)
if (IsClippedEx(line_rect, 0))
break;
- const char* line_end = (const char*)memchr(line, '\n', text_end - line);
+ const char* line_end = (const char*)ImMemchr(line, '\n', text_end - line);
if (!line_end)
line_end = text_end;
text_size.x = ImMax(text_size.x, CalcTextSize(line, line_end).x);
@@ -237,7 +247,7 @@ void ImGui::TextEx(const char* text, const char* text_end, ImGuiTextFlags flags)
int lines_skipped = 0;
while (line < text_end)
{
- const char* line_end = (const char*)memchr(line, '\n', text_end - line);
+ const char* line_end = (const char*)ImMemchr(line, '\n', text_end - line);
if (!line_end)
line_end = text_end;
if ((flags & ImGuiTextFlags_NoWidthForLargeClippedText) == 0)
@@ -274,7 +284,6 @@ void ImGui::TextV(const char* fmt, va_list args)
if (window->SkipItems)
return;
- // FIXME-OPT: Handle the %s shortcut?
const char* text, *text_end;
ImFormatStringToTempBufferV(&text, &text_end, fmt, args);
TextEx(text, text_end, ImGuiTextFlags_NoWidthForLargeClippedText);
@@ -291,10 +300,7 @@ void ImGui::TextColored(const ImVec4& col, const char* fmt, ...)
void ImGui::TextColoredV(const ImVec4& col, const char* fmt, va_list args)
{
PushStyleColor(ImGuiCol_Text, col);
- if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0)
- TextEx(va_arg(args, const char*), NULL, ImGuiTextFlags_NoWidthForLargeClippedText); // Skip formatting
- else
- TextV(fmt, args);
+ TextV(fmt, args);
PopStyleColor();
}
@@ -310,10 +316,7 @@ void ImGui::TextDisabledV(const char* fmt, va_list args)
{
ImGuiContext& g = *GImGui;
PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]);
- if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0)
- TextEx(va_arg(args, const char*), NULL, ImGuiTextFlags_NoWidthForLargeClippedText); // Skip formatting
- else
- TextV(fmt, args);
+ TextV(fmt, args);
PopStyleColor();
}
@@ -328,13 +331,10 @@ void ImGui::TextWrapped(const char* fmt, ...)
void ImGui::TextWrappedV(const char* fmt, va_list args)
{
ImGuiContext& g = *GImGui;
- bool need_backup = (g.CurrentWindow->DC.TextWrapPos < 0.0f); // Keep existing wrap position if one is already set
+ const bool need_backup = (g.CurrentWindow->DC.TextWrapPos < 0.0f); // Keep existing wrap position if one is already set
if (need_backup)
PushTextWrapPos(0.0f);
- if (fmt[0] == '%' && fmt[1] == 's' && fmt[2] == 0)
- TextEx(va_arg(args, const char*), NULL, ImGuiTextFlags_NoWidthForLargeClippedText); // Skip formatting
- else
- TextV(fmt, args);
+ TextV(fmt, args);
if (need_backup)
PopTextWrapPos();
}
@@ -433,6 +433,7 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
// - RadioButton()
// - ProgressBar()
// - Bullet()
+// - Hyperlink()
//-------------------------------------------------------------------------
// The ButtonBehavior() function is key to many interactions and used by many/most widgets.
@@ -478,7 +479,7 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
// - PressedOnDragDropHold can generally be associated with any flag.
// - PressedOnDoubleClick can be associated by PressedOnClickRelease/PressedOnRelease, in which case the second release event won't be reported.
//------------------------------------------------------------------------------------------------------------------------------------------------
-// The behavior of the return-value changes when ImGuiButtonFlags_Repeat is set:
+// The behavior of the return-value changes when ImGuiItemFlags_ButtonRepeat is set:
// Repeat+ Repeat+ Repeat+ Repeat+
// PressedOnClickRelease PressedOnClick PressedOnRelease PressedOnDoubleClick
//-------------------------------------------------------------------------------------------------------------------------------------------------
@@ -489,18 +490,32 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
// Frame N + RepeatDelay + RepeatRate*N true true - true
//-------------------------------------------------------------------------------------------------------------------------------------------------
+// - FIXME: For refactor we could output flags, incl mouse hovered vs nav keyboard vs nav triggered etc.
+// And better standardize how widgets use 'GetColor32((held && hovered) ? ... : hovered ? ...)' vs 'GetColor32(held ? ... : hovered ? ...);'
+// For mouse feedback we typically prefer the 'held && hovered' test, but for nav feedback not always. Outputting hovered=true on Activation may be misleading.
+// - Since v1.91.2 (Sept 2024) we included io.ConfigDebugHighlightIdConflicts feature.
+// One idiom which was previously valid which will now emit a warning is when using multiple overlayed ButtonBehavior()
+// with same ID and different MouseButton (see #8030). You can fix it by:
+// (1) switching to use a single ButtonBehavior() with multiple _MouseButton flags.
+// or (2) surrounding those calls with PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag()
bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
+ // Default behavior inherited from item flags
+ // Note that _both_ ButtonFlags and ItemFlags are valid sources, so copy one into the item_flags and only check that.
+ ImGuiItemFlags item_flags = (g.LastItemData.ID == id ? g.LastItemData.ItemFlags : g.CurrentItemFlags);
+ if (flags & ImGuiButtonFlags_AllowOverlap)
+ item_flags |= ImGuiItemFlags_AllowOverlap;
+
// Default only reacts to left mouse button
if ((flags & ImGuiButtonFlags_MouseButtonMask_) == 0)
- flags |= ImGuiButtonFlags_MouseButtonDefault_;
+ flags |= ImGuiButtonFlags_MouseButtonLeft;
// Default behavior requires click + release inside bounding box
if ((flags & ImGuiButtonFlags_PressedOnMask_) == 0)
- flags |= ImGuiButtonFlags_PressedOnDefault_;
+ flags |= (item_flags & ImGuiItemFlags_ButtonRepeat) ? ImGuiButtonFlags_PressedOnClick : ImGuiButtonFlags_PressedOnDefault_;
ImGuiWindow* backup_hovered_window = g.HoveredWindow;
const bool flatten_hovered_children = (flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredWindow && g.HoveredWindow->RootWindow == window;
@@ -508,16 +523,13 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
g.HoveredWindow = window;
#ifdef IMGUI_ENABLE_TEST_ENGINE
- if (id != 0 && g.LastItemData.ID != id)
- IMGUI_TEST_ENGINE_ITEM_ADD(bb, id);
+ // Alternate registration spot, for when caller didn't use ItemAdd()
+ if (g.LastItemData.ID != id)
+ IMGUI_TEST_ENGINE_ITEM_ADD(id, bb, NULL);
#endif
bool pressed = false;
- bool hovered = ItemHoverable(bb, id);
-
- // Drag source doesn't report as hovered
- if (hovered && g.DragDropActive && g.DragDropPayload.SourceId == id && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoDisableHover))
- hovered = false;
+ bool hovered = ItemHoverable(bb, id, item_flags);
// Special mode for Drag and Drop where holding button pressed for a long time while dragging another item triggers the button
if (g.DragDropActive && (flags & ImGuiButtonFlags_PressedOnDragDropHold) && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoHoldToOpenOthers))
@@ -536,21 +548,28 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
if (flatten_hovered_children)
g.HoveredWindow = backup_hovered_window;
- // AllowOverlap mode (rarely used) requires previous frame HoveredId to be null or to match. This allows using patterns where a later submitted widget overlaps a previous one.
- if (hovered && (flags & ImGuiButtonFlags_AllowItemOverlap) && (g.HoveredIdPreviousFrame != id && g.HoveredIdPreviousFrame != 0))
- hovered = false;
-
// Mouse handling
const ImGuiID test_owner_id = (flags & ImGuiButtonFlags_NoTestKeyOwner) ? ImGuiKeyOwner_Any : id;
if (hovered)
{
- if (!(flags & ImGuiButtonFlags_NoKeyModifiers) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt))
+ IM_ASSERT(id != 0); // Lazily check inside rare path.
+
+ // Poll mouse buttons
+ // - 'mouse_button_clicked' is generally carried into ActiveIdMouseButton when setting ActiveId.
+ // - Technically we only need some values in one code path, but since this is gated by hovered test this is fine.
+ int mouse_button_clicked = -1;
+ int mouse_button_released = -1;
+ for (int button = 0; button < 3; button++)
+ if (flags & (ImGuiButtonFlags_MouseButtonLeft << button)) // Handle ImGuiButtonFlags_MouseButtonRight and ImGuiButtonFlags_MouseButtonMiddle here.
+ {
+ if (IsMouseClicked(button, ImGuiInputFlags_None, test_owner_id) && mouse_button_clicked == -1) { mouse_button_clicked = button; }
+ if (IsMouseReleased(button, test_owner_id) && mouse_button_released == -1) { mouse_button_released = button; }
+ }
+
+ // Process initial action
+ const bool mods_ok = !(flags & ImGuiButtonFlags_NoKeyModsAllowed) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt);
+ if (mods_ok)
{
- // Poll buttons
- int mouse_button_clicked = -1;
- if ((flags & ImGuiButtonFlags_MouseButtonLeft) && IsMouseClicked(0, test_owner_id)) { mouse_button_clicked = 0; }
- else if ((flags & ImGuiButtonFlags_MouseButtonRight) && IsMouseClicked(1, test_owner_id)) { mouse_button_clicked = 1; }
- else if ((flags & ImGuiButtonFlags_MouseButtonMiddle) && IsMouseClicked(2, test_owner_id)) { mouse_button_clicked = 2; }
if (mouse_button_clicked != -1 && g.ActiveId != id)
{
if (!(flags & ImGuiButtonFlags_NoSetKeyOwner))
@@ -560,8 +579,14 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
SetActiveID(id, window);
g.ActiveIdMouseButton = mouse_button_clicked;
if (!(flags & ImGuiButtonFlags_NoNavFocus))
+ {
SetFocusID(id, window);
- FocusWindow(window);
+ FocusWindow(window);
+ }
+ else
+ {
+ FocusWindow(window, ImGuiFocusRequestFlags_RestoreFocusedChild); // Still need to focus and bring to front, but try to avoid losing NavId when navigating a child
+ }
}
if ((flags & ImGuiButtonFlags_PressedOnClick) || ((flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseClickedCount[mouse_button_clicked] == 2))
{
@@ -570,55 +595,58 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
ClearActiveID();
else
SetActiveID(id, window); // Hold on ID
+ g.ActiveIdMouseButton = mouse_button_clicked;
if (!(flags & ImGuiButtonFlags_NoNavFocus))
+ {
SetFocusID(id, window);
- g.ActiveIdMouseButton = mouse_button_clicked;
- FocusWindow(window);
+ FocusWindow(window);
+ }
+ else
+ {
+ FocusWindow(window, ImGuiFocusRequestFlags_RestoreFocusedChild); // Still need to focus and bring to front, but try to avoid losing NavId when navigating a child
+ }
}
}
if (flags & ImGuiButtonFlags_PressedOnRelease)
{
- int mouse_button_released = -1;
- if ((flags & ImGuiButtonFlags_MouseButtonLeft) && IsMouseReleased(0, test_owner_id)) { mouse_button_released = 0; }
- else if ((flags & ImGuiButtonFlags_MouseButtonRight) && IsMouseReleased(1, test_owner_id)) { mouse_button_released = 1; }
- else if ((flags & ImGuiButtonFlags_MouseButtonMiddle) && IsMouseReleased(2, test_owner_id)) { mouse_button_released = 2; }
if (mouse_button_released != -1)
{
- const bool has_repeated_at_least_once = (flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[mouse_button_released] >= g.IO.KeyRepeatDelay; // Repeat mode trumps on release behavior
+ const bool has_repeated_at_least_once = (item_flags & ImGuiItemFlags_ButtonRepeat) && g.IO.MouseDownDurationPrev[mouse_button_released] >= g.IO.KeyRepeatDelay; // Repeat mode trumps on release behavior
if (!has_repeated_at_least_once)
pressed = true;
if (!(flags & ImGuiButtonFlags_NoNavFocus))
- SetFocusID(id, window);
+ SetFocusID(id, window); // FIXME: Lack of FocusWindow() call here is inconsistent with other paths. Research why.
ClearActiveID();
}
}
// 'Repeat' mode acts when held regardless of _PressedOn flags (see table above).
// Relies on repeat logic of IsMouseClicked() but we may as well do it ourselves if we end up exposing finer RepeatDelay/RepeatRate settings.
- if (g.ActiveId == id && (flags & ImGuiButtonFlags_Repeat))
- if (g.IO.MouseDownDuration[g.ActiveIdMouseButton] > 0.0f && IsMouseClicked(g.ActiveIdMouseButton, test_owner_id, ImGuiInputFlags_Repeat))
+ if (g.ActiveId == id && (item_flags & ImGuiItemFlags_ButtonRepeat))
+ if (g.IO.MouseDownDuration[g.ActiveIdMouseButton] > 0.0f && IsMouseClicked(g.ActiveIdMouseButton, ImGuiInputFlags_Repeat, test_owner_id))
pressed = true;
}
- if (pressed)
- g.NavDisableHighlight = true;
+ if (pressed && g.IO.ConfigNavCursorVisibleAuto)
+ g.NavCursorVisible = false;
}
- // Gamepad/Keyboard navigation
- // We report navigated item as hovered but we don't set g.HoveredId to not interfere with mouse.
- if (g.NavId == id && !g.NavDisableHighlight && g.NavDisableMouseHover && (g.ActiveId == 0 || g.ActiveId == id || g.ActiveId == window->MoveId))
+ // Keyboard/Gamepad navigation handling
+ // We report navigated and navigation-activated items as hovered but we don't set g.HoveredId to not interfere with mouse.
+ if (g.NavId == id && g.NavCursorVisible && g.NavHighlightItemUnderNav)
if (!(flags & ImGuiButtonFlags_NoHoveredOnFocus))
hovered = true;
if (g.NavActivateDownId == id)
{
bool nav_activated_by_code = (g.NavActivateId == id);
bool nav_activated_by_inputs = (g.NavActivatePressedId == id);
- if (!nav_activated_by_inputs && (flags & ImGuiButtonFlags_Repeat))
+ if (!nav_activated_by_inputs && (item_flags & ImGuiItemFlags_ButtonRepeat))
{
- // Avoid pressing both keys from triggering double amount of repeat events
+ // Avoid pressing multiple keys from triggering excessive amount of repeat events
const ImGuiKeyData* key1 = GetKeyData(ImGuiKey_Space);
- const ImGuiKeyData* key2 = GetKeyData(ImGuiKey_NavGamepadActivate);
- const float t1 = ImMax(key1->DownDuration, key2->DownDuration);
+ const ImGuiKeyData* key2 = GetKeyData(ImGuiKey_Enter);
+ const ImGuiKeyData* key3 = GetKeyData(ImGuiKey_NavGamepadActivate);
+ const float t1 = ImMax(ImMax(key1->DownDuration, key2->DownDuration), key3->DownDuration);
nav_activated_by_inputs = CalcTypematicRepeatAmount(t1 - g.IO.DeltaTime, t1, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0;
}
if (nav_activated_by_code || nav_activated_by_inputs)
@@ -626,9 +654,11 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
// Set active id so it can be queried by user via IsItemActive(), equivalent of holding the mouse button.
pressed = true;
SetActiveID(id, window);
- g.ActiveIdSource = ImGuiInputSource_Nav;
- if (!(flags & ImGuiButtonFlags_NoNavFocus))
+ g.ActiveIdSource = g.NavInputSource;
+ if (!(flags & ImGuiButtonFlags_NoNavFocus) && !(g.NavActivateFlags & ImGuiActivateFlags_FromShortcut))
SetFocusID(id, window);
+ if (g.NavActivateFlags & ImGuiActivateFlags_FromShortcut)
+ g.ActiveIdFromShortcut = true;
}
}
@@ -642,7 +672,12 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
g.ActiveIdClickOffset = g.IO.MousePos - bb.Min;
const int mouse_button = g.ActiveIdMouseButton;
- if (IsMouseDown(mouse_button, test_owner_id))
+ if (mouse_button == -1)
+ {
+ // Fallback for the rare situation were g.ActiveId was set programmatically or from another widget (e.g. #6304).
+ ClearActiveID();
+ }
+ else if (IsMouseDown(mouse_button, test_owner_id))
{
held = true;
}
@@ -654,26 +689,32 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
{
// Report as pressed when releasing the mouse (this is the most common path)
bool is_double_click_release = (flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseReleased[mouse_button] && g.IO.MouseClickedLastCount[mouse_button] == 2;
- bool is_repeating_already = (flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[mouse_button] >= g.IO.KeyRepeatDelay; // Repeat mode trumps <on release>
+ bool is_repeating_already = (item_flags & ImGuiItemFlags_ButtonRepeat) && g.IO.MouseDownDurationPrev[mouse_button] >= g.IO.KeyRepeatDelay; // Repeat mode trumps <on release>
bool is_button_avail_or_owned = TestKeyOwner(MouseButtonToKey(mouse_button), test_owner_id);
if (!is_double_click_release && !is_repeating_already && is_button_avail_or_owned)
pressed = true;
}
ClearActiveID();
}
- if (!(flags & ImGuiButtonFlags_NoNavFocus))
- g.NavDisableHighlight = true;
+ if (!(flags & ImGuiButtonFlags_NoNavFocus) && g.IO.ConfigNavCursorVisibleAuto)
+ g.NavCursorVisible = false;
}
- else if (g.ActiveIdSource == ImGuiInputSource_Nav)
+ else if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad)
{
// When activated using Nav, we hold on the ActiveID until activation button is released
- if (g.NavActivateDownId != id)
+ if (g.NavActivateDownId == id)
+ held = true; // hovered == true not true as we are already likely hovered on direct activation.
+ else
ClearActiveID();
}
if (pressed)
g.ActiveIdHasBeenPressedBefore = true;
}
+ // Activation highlight (this may be a remote activation)
+ if (g.NavHighlightActivatedId == id)
+ hovered = true;
+
if (out_hovered) *out_hovered = hovered;
if (out_held) *out_held = held;
@@ -701,15 +742,12 @@ bool ImGui::ButtonEx(const char* label, const ImVec2& size_arg, ImGuiButtonFlags
if (!ItemAdd(bb, id))
return false;
- if (g.LastItemData.InFlags & ImGuiItemFlags_ButtonRepeat)
- flags |= ImGuiButtonFlags_Repeat;
-
bool hovered, held;
bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);
// Render
const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
- RenderNavHighlight(bb, id);
+ RenderNavCursor(bb, id);
RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
if (g.LogEnabled)
@@ -756,11 +794,12 @@ bool ImGui::InvisibleButton(const char* str_id, const ImVec2& size_arg, ImGuiBut
ImVec2 size = CalcItemSize(size_arg, 0.0f, 0.0f);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
ItemSize(size);
- if (!ItemAdd(bb, id))
+ if (!ItemAdd(bb, id, NULL, (flags & ImGuiButtonFlags_EnableNav) ? ImGuiItemFlags_None : ImGuiItemFlags_NoNav))
return false;
bool hovered, held;
bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);
+ RenderNavCursor(bb, id);
IMGUI_TEST_ENGINE_ITEM_INFO(id, str_id, g.LastItemData.StatusFlags);
return pressed;
@@ -780,16 +819,13 @@ bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiBu
if (!ItemAdd(bb, id))
return false;
- if (g.LastItemData.InFlags & ImGuiItemFlags_ButtonRepeat)
- flags |= ImGuiButtonFlags_Repeat;
-
bool hovered, held;
bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);
// Render
const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
const ImU32 text_col = GetColorU32(ImGuiCol_Text);
- RenderNavHighlight(bb, id);
+ RenderNavCursor(bb, id);
RenderFrame(bb.Min, bb.Max, bg_col, true, g.Style.FrameRounding);
RenderArrow(window->DrawList, bb.Min + ImVec2(ImMax(0.0f, (size.x - g.FontSize) * 0.5f), ImMax(0.0f, (size.y - g.FontSize) * 0.5f)), text_col, dir);
@@ -811,14 +847,14 @@ bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos)
// Tweak 1: Shrink hit-testing area if button covers an abnormally large proportion of the visible region. That's in order to facilitate moving the window away. (#3825)
// This may better be applied as a general hit-rect reduction mechanism for all widgets to ensure the area to move window is always accessible?
- const ImRect bb(pos, pos + ImVec2(g.FontSize, g.FontSize) + g.Style.FramePadding * 2.0f);
+ const ImRect bb(pos, pos + ImVec2(g.FontSize, g.FontSize));
ImRect bb_interact = bb;
const float area_to_visible_ratio = window->OuterRectClipped.GetArea() / bb.GetArea();
if (area_to_visible_ratio < 1.5f)
- bb_interact.Expand(ImFloor(bb_interact.GetSize() * -0.25f));
+ bb_interact.Expand(ImTrunc(bb_interact.GetSize() * -0.25f));
// Tweak 2: We intentionally allow interaction when clipped so that a mechanical Alt,Right,Activate sequence can always close a window.
- // (this isn't the regular behavior of buttons, but it doesn't affect the user much because navigation tends to keep items visible).
+ // (this isn't the common behavior of buttons, but it doesn't affect the user because navigation tends to keep items visible in scrolling layer).
bool is_clipped = !ItemAdd(bb_interact, id);
bool hovered, held;
@@ -827,17 +863,15 @@ bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos)
return pressed;
// Render
- // FIXME: Clarify this mess
- ImU32 col = GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered);
- ImVec2 center = bb.GetCenter();
+ ImU32 bg_col = GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered);
if (hovered)
- window->DrawList->AddCircleFilled(center, ImMax(2.0f, g.FontSize * 0.5f + 1.0f), col, 12);
-
- float cross_extent = g.FontSize * 0.5f * 0.7071f - 1.0f;
+ window->DrawList->AddRectFilled(bb.Min, bb.Max, bg_col);
+ RenderNavCursor(bb, id, ImGuiNavRenderCursorFlags_Compact);
ImU32 cross_col = GetColorU32(ImGuiCol_Text);
- center -= ImVec2(0.5f, 0.5f);
- window->DrawList->AddLine(center + ImVec2(+cross_extent, +cross_extent), center + ImVec2(-cross_extent, -cross_extent), cross_col, 1.0f);
- window->DrawList->AddLine(center + ImVec2(+cross_extent, -cross_extent), center + ImVec2(-cross_extent, +cross_extent), cross_col, 1.0f);
+ ImVec2 cross_center = bb.GetCenter() - ImVec2(0.5f, 0.5f);
+ float cross_extent = g.FontSize * 0.5f * 0.7071f - 1.0f;
+ window->DrawList->AddLine(cross_center + ImVec2(+cross_extent, +cross_extent), cross_center + ImVec2(-cross_extent, -cross_extent), cross_col, 1.0f);
+ window->DrawList->AddLine(cross_center + ImVec2(+cross_extent, -cross_extent), cross_center + ImVec2(-cross_extent, +cross_extent), cross_col, 1.0f);
return pressed;
}
@@ -847,17 +881,20 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos)
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- ImRect bb(pos, pos + ImVec2(g.FontSize, g.FontSize) + g.Style.FramePadding * 2.0f);
- ItemAdd(bb, id);
+ ImRect bb(pos, pos + ImVec2(g.FontSize, g.FontSize));
+ bool is_clipped = !ItemAdd(bb, id);
bool hovered, held;
bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_None);
+ if (is_clipped)
+ return pressed;
// Render
ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
ImU32 text_col = GetColorU32(ImGuiCol_Text);
if (hovered || held)
- window->DrawList->AddCircleFilled(bb.GetCenter()/*+ ImVec2(0.0f, -0.5f)*/, g.FontSize * 0.5f + 1.0f, bg_col, 12);
- RenderArrow(window->DrawList, bb.Min + g.Style.FramePadding, text_col, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f);
+ window->DrawList->AddRectFilled(bb.Min, bb.Max, bg_col);
+ RenderNavCursor(bb, id, ImGuiNavRenderCursorFlags_Compact);
+ RenderArrow(window->DrawList, bb.Min, text_col, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f);
// Switch to moving the window after mouse is moved beyond the initial drag threshold
if (IsItemActive() && IsMouseDragging(0))
@@ -874,15 +911,17 @@ ImGuiID ImGui::GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis)
// Return scrollbar rectangle, must only be called for corresponding axis if window->ScrollbarX/Y is set.
ImRect ImGui::GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis)
{
+ ImGuiContext& g = *GImGui;
const ImRect outer_rect = window->Rect();
const ImRect inner_rect = window->InnerRect;
- const float border_size = window->WindowBorderSize;
const float scrollbar_size = window->ScrollbarSizes[axis ^ 1]; // (ScrollbarSizes.x = width of Y scrollbar; ScrollbarSizes.y = height of X scrollbar)
- IM_ASSERT(scrollbar_size > 0.0f);
+ IM_ASSERT(scrollbar_size >= 0.0f);
+ const float border_size = IM_ROUND(window->WindowBorderSize * 0.5f);
+ const float border_top = (window->Flags & ImGuiWindowFlags_MenuBar) ? IM_ROUND(g.Style.FrameBorderSize * 0.5f) : 0.0f;
if (axis == ImGuiAxis_X)
- return ImRect(inner_rect.Min.x, ImMax(outer_rect.Min.y, outer_rect.Max.y - border_size - scrollbar_size), inner_rect.Max.x, outer_rect.Max.y);
+ return ImRect(inner_rect.Min.x + border_size, ImMax(outer_rect.Min.y + border_size, outer_rect.Max.y - border_size - scrollbar_size), inner_rect.Max.x - border_size, outer_rect.Max.y - border_size);
else
- return ImRect(ImMax(outer_rect.Min.x, outer_rect.Max.x - border_size - scrollbar_size), inner_rect.Min.y, outer_rect.Max.x, inner_rect.Max.y);
+ return ImRect(ImMax(outer_rect.Min.x, outer_rect.Max.x - border_size - scrollbar_size), inner_rect.Min.y + border_top, outer_rect.Max.x - border_size, inner_rect.Max.y - border_size);
}
void ImGui::Scrollbar(ImGuiAxis axis)
@@ -907,10 +946,10 @@ void ImGui::Scrollbar(ImGuiAxis axis)
if (!window->ScrollbarX)
rounding_corners |= ImDrawFlags_RoundCornersBottomRight;
}
- float size_avail = window->InnerRect.Max[axis] - window->InnerRect.Min[axis];
+ float size_visible = window->InnerRect.Max[axis] - window->InnerRect.Min[axis];
float size_contents = window->ContentSize[axis] + window->WindowPadding[axis] * 2.0f;
ImS64 scroll = (ImS64)window->Scroll[axis];
- ScrollbarEx(bb, id, axis, &scroll, (ImS64)size_avail, (ImS64)size_contents, rounding_corners);
+ ScrollbarEx(bb, id, axis, &scroll, (ImS64)size_visible, (ImS64)size_contents, rounding_corners);
window->Scroll[axis] = (float)scroll;
}
@@ -920,7 +959,7 @@ void ImGui::Scrollbar(ImGuiAxis axis)
// - We store values as normalized ratio and in a form that allows the window content to change while we are holding on a scrollbar
// - We handle both horizontal and vertical scrollbars, which makes the terminology not ideal.
// Still, the code should probably be made simpler..
-bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 size_avail_v, ImS64 size_contents_v, ImDrawFlags flags)
+bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 size_visible_v, ImS64 size_contents_v, ImDrawFlags draw_rounding_flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
@@ -934,8 +973,8 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6
// When we are too small, start hiding and disabling the grab (this reduce visual noise on very small window and facilitate using the window resize grab)
float alpha = 1.0f;
- if ((axis == ImGuiAxis_Y) && bb_frame_height < g.FontSize + g.Style.FramePadding.y * 2.0f)
- alpha = ImSaturate((bb_frame_height - g.FontSize) / (g.Style.FramePadding.y * 2.0f));
+ if ((axis == ImGuiAxis_Y) && bb_frame_height < bb_frame_width)
+ alpha = ImSaturate(bb_frame_height / ImMax(bb_frame_width * 2.0f, 1.0f));
if (alpha <= 0.0f)
return false;
@@ -943,16 +982,17 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6
const bool allow_interaction = (alpha >= 1.0f);
ImRect bb = bb_frame;
- bb.Expand(ImVec2(-ImClamp(IM_FLOOR((bb_frame_width - 2.0f) * 0.5f), 0.0f, 3.0f), -ImClamp(IM_FLOOR((bb_frame_height - 2.0f) * 0.5f), 0.0f, 3.0f)));
+ bb.Expand(ImVec2(-ImClamp(IM_TRUNC((bb_frame_width - 2.0f) * 0.5f), 0.0f, 3.0f), -ImClamp(IM_TRUNC((bb_frame_height - 2.0f) * 0.5f), 0.0f, 3.0f)));
// V denote the main, longer axis of the scrollbar (= height for a vertical scrollbar)
const float scrollbar_size_v = (axis == ImGuiAxis_X) ? bb.GetWidth() : bb.GetHeight();
// Calculate the height of our grabbable box. It generally represent the amount visible (vs the total scrollable amount)
// But we maintain a minimum size in pixel to allow for the user to still aim inside.
- IM_ASSERT(ImMax(size_contents_v, size_avail_v) > 0.0f); // Adding this assert to check if the ImMax(XXX,1.0f) is still needed. PLEASE CONTACT ME if this triggers.
- const ImS64 win_size_v = ImMax(ImMax(size_contents_v, size_avail_v), (ImS64)1);
- const float grab_h_pixels = ImClamp(scrollbar_size_v * ((float)size_avail_v / (float)win_size_v), style.GrabMinSize, scrollbar_size_v);
+ IM_ASSERT(ImMax(size_contents_v, size_visible_v) > 0.0f); // Adding this assert to check if the ImMax(XXX,1.0f) is still needed. PLEASE CONTACT ME if this triggers.
+ const ImS64 win_size_v = ImMax(ImMax(size_contents_v, size_visible_v), (ImS64)1);
+ const float grab_h_minsize = ImMin(bb.GetSize()[axis], style.GrabMinSize);
+ const float grab_h_pixels = ImClamp(scrollbar_size_v * ((float)size_visible_v / (float)win_size_v), grab_h_minsize, scrollbar_size_v);
const float grab_h_norm = grab_h_pixels / scrollbar_size_v;
// Handle input right away. None of the code of Begin() is relying on scrolling position before calling Scrollbar().
@@ -961,7 +1001,7 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6
ItemAdd(bb_frame, id, NULL, ImGuiItemFlags_NoNav);
ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_NoNavFocus);
- const ImS64 scroll_max = ImMax((ImS64)1, size_contents_v - size_avail_v);
+ const ImS64 scroll_max = ImMax((ImS64)1, size_contents_v - size_visible_v);
float scroll_ratio = ImSaturate((float)*p_scroll_v / (float)scroll_max);
float grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v; // Grab position in normalized space
if (held && allow_interaction && grab_h_norm < 1.0f)
@@ -971,37 +1011,47 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6
// Click position in scrollbar normalized space (0.0f->1.0f)
const float clicked_v_norm = ImSaturate((mouse_pos_v - scrollbar_pos_v) / scrollbar_size_v);
- SetHoveredID(id);
- bool seek_absolute = false;
+ const int held_dir = (clicked_v_norm < grab_v_norm) ? -1 : (clicked_v_norm > grab_v_norm + grab_h_norm) ? +1 : 0;
if (g.ActiveIdIsJustActivated)
{
- // On initial click calculate the distance between mouse and the center of the grab
- seek_absolute = (clicked_v_norm < grab_v_norm || clicked_v_norm > grab_v_norm + grab_h_norm);
- if (seek_absolute)
- g.ScrollbarClickDeltaToGrabCenter = 0.0f;
- else
- g.ScrollbarClickDeltaToGrabCenter = clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f;
+ // On initial click when held_dir == 0 (clicked over grab): calculate the distance between mouse and the center of the grab
+ const bool scroll_to_clicked_location = (g.IO.ConfigScrollbarScrollByPage == false || g.IO.KeyShift || held_dir == 0);
+ g.ScrollbarSeekMode = scroll_to_clicked_location ? 0 : (short)held_dir;
+ g.ScrollbarClickDeltaToGrabCenter = (held_dir == 0 && !g.IO.KeyShift) ? clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f : 0.0f;
}
// Apply scroll (p_scroll_v will generally point on one member of window->Scroll)
// It is ok to modify Scroll here because we are being called in Begin() after the calculation of ContentSize and before setting up our starting position
- const float scroll_v_norm = ImSaturate((clicked_v_norm - g.ScrollbarClickDeltaToGrabCenter - grab_h_norm * 0.5f) / (1.0f - grab_h_norm));
- *p_scroll_v = (ImS64)(scroll_v_norm * scroll_max);
+ if (g.ScrollbarSeekMode == 0)
+ {
+ // Absolute seeking
+ const float scroll_v_norm = ImSaturate((clicked_v_norm - g.ScrollbarClickDeltaToGrabCenter - grab_h_norm * 0.5f) / (1.0f - grab_h_norm));
+ *p_scroll_v = (ImS64)(scroll_v_norm * scroll_max);
+ }
+ else
+ {
+ // Page by page
+ if (IsMouseClicked(ImGuiMouseButton_Left, ImGuiInputFlags_Repeat) && held_dir == g.ScrollbarSeekMode)
+ {
+ float page_dir = (g.ScrollbarSeekMode > 0.0f) ? +1.0f : -1.0f;
+ *p_scroll_v = ImClamp(*p_scroll_v + (ImS64)(page_dir * size_visible_v), (ImS64)0, scroll_max);
+ }
+ }
// Update values for rendering
scroll_ratio = ImSaturate((float)*p_scroll_v / (float)scroll_max);
grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v;
- // Update distance to grab now that we have seeked and saturated
- if (seek_absolute)
- g.ScrollbarClickDeltaToGrabCenter = clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f;
+ // Update distance to grab now that we have seek'ed and saturated
+ //if (seek_absolute)
+ // g.ScrollbarClickDeltaToGrabCenter = clicked_v_norm - grab_v_norm - grab_h_norm * 0.5f;
}
// Render
const ImU32 bg_col = GetColorU32(ImGuiCol_ScrollbarBg);
const ImU32 grab_col = GetColorU32(held ? ImGuiCol_ScrollbarGrabActive : hovered ? ImGuiCol_ScrollbarGrabHovered : ImGuiCol_ScrollbarGrab, alpha);
- window->DrawList->AddRectFilled(bb_frame.Min, bb_frame.Max, bg_col, window->WindowRounding, flags);
+ window->DrawList->AddRectFilled(bb_frame.Min, bb_frame.Max, bg_col, window->WindowRounding, draw_rounding_flags);
ImRect grab_rect;
if (axis == ImGuiAxis_X)
grab_rect = ImRect(ImLerp(bb.Min.x, bb.Max.x, grab_v_norm), bb.Min.y, ImLerp(bb.Min.x, bb.Max.x, grab_v_norm) + grab_h_pixels, bb.Max.y);
@@ -1012,33 +1062,48 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6
return held;
}
-void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col)
+// - Read about ImTextureID here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
+// - 'uv0' and 'uv1' are texture coordinates. Read about them from the same link above.
+void ImGui::ImageWithBg(ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col)
{
+ ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
- ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
- if (border_col.w > 0.0f)
- bb.Max += ImVec2(2, 2);
+ const ImVec2 padding(g.Style.ImageBorderSize, g.Style.ImageBorderSize);
+ const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + image_size + padding * 2.0f);
ItemSize(bb);
if (!ItemAdd(bb, 0))
return;
- if (border_col.w > 0.0f)
- {
- window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(border_col), 0.0f);
- window->DrawList->AddImage(user_texture_id, bb.Min + ImVec2(1, 1), bb.Max - ImVec2(1, 1), uv0, uv1, GetColorU32(tint_col));
- }
- else
- {
- window->DrawList->AddImage(user_texture_id, bb.Min, bb.Max, uv0, uv1, GetColorU32(tint_col));
- }
+ // Render
+ if (g.Style.ImageBorderSize > 0.0f)
+ window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_Border), 0.0f, ImDrawFlags_None, g.Style.ImageBorderSize);
+ if (bg_col.w > 0.0f)
+ window->DrawList->AddRectFilled(bb.Min + padding, bb.Max - padding, GetColorU32(bg_col));
+ window->DrawList->AddImage(user_texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, GetColorU32(tint_col));
}
-// ImageButton() is flawed as 'id' is always derived from 'texture_id' (see #2464 #1390)
-// We provide this internal helper to write your own variant while we figure out how to redesign the public ImageButton() API.
-bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col)
+void ImGui::Image(ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1)
+{
+ ImageWithBg(user_texture_id, image_size, uv0, uv1);
+}
+
+// 1.91.9 (February 2025) removed 'tint_col' and 'border_col' parameters, made border size not depend on color value. (#8131, #8238)
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+void ImGui::Image(ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col)
+{
+ ImGuiContext& g = *GImGui;
+ PushStyleVar(ImGuiStyleVar_ImageBorderSize, (border_col.w > 0.0f) ? ImMax(1.0f, g.Style.ImageBorderSize) : 0.0f); // Preserve legacy behavior where border is always visible when border_col's Alpha is >0.0f
+ PushStyleColor(ImGuiCol_Border, border_col);
+ ImageWithBg(user_texture_id, image_size, uv0, uv1, ImVec4(0, 0, 0, 0), tint_col);
+ PopStyleColor();
+ PopStyleVar();
+}
+#endif
+
+bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
@@ -1046,59 +1111,57 @@ bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size
return false;
const ImVec2 padding = g.Style.FramePadding;
- const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding * 2.0f);
+ const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + image_size + padding * 2.0f);
ItemSize(bb);
if (!ItemAdd(bb, id))
return false;
bool hovered, held;
- bool pressed = ButtonBehavior(bb, id, &hovered, &held);
+ bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);
// Render
const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
- RenderNavHighlight(bb, id);
+ RenderNavCursor(bb, id);
RenderFrame(bb.Min, bb.Max, col, true, ImClamp((float)ImMin(padding.x, padding.y), 0.0f, g.Style.FrameRounding));
if (bg_col.w > 0.0f)
window->DrawList->AddRectFilled(bb.Min + padding, bb.Max - padding, GetColorU32(bg_col));
- window->DrawList->AddImage(texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, GetColorU32(tint_col));
+ window->DrawList->AddImage(user_texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, GetColorU32(tint_col));
return pressed;
}
-bool ImGui::ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col)
+// - ImageButton() adds style.FramePadding*2.0f to provided size. This is in order to facilitate fitting an image in a button.
+// - ImageButton() draws a background based on regular Button() color + optionally an inner background if specified. (#8165) // FIXME: Maybe that's not the best design?
+bool ImGui::ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
if (window->SkipItems)
return false;
- return ImageButtonEx(window->GetID(str_id), user_texture_id, size, uv0, uv1, bg_col, tint_col);
+ return ImageButtonEx(window->GetID(str_id), user_texture_id, image_size, uv0, uv1, bg_col, tint_col);
}
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
// Legacy API obsoleted in 1.89. Two differences with new ImageButton()
-// - new ImageButton() requires an explicit 'const char* str_id' Old ImageButton() used opaque imTextureId (created issue with: multiple buttons with same image, transient texture id values, opaque computation of ID)
-// - new ImageButton() always use style.FramePadding Old ImageButton() had an override argument.
-// If you need to change padding with new ImageButton() you can use PushStyleVar(ImGuiStyleVar_FramePadding, value), consistent with other Button functions.
+// - old ImageButton() used ImTextureID as item id (created issue with multiple buttons with same image, transient texture id values, opaque computation of ID)
+// - new ImageButton() requires an explicit 'const char* str_id'
+// - old ImageButton() had frame_padding' override argument.
+// - new ImageButton() always use style.FramePadding.
+/*
bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col)
{
- ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
- if (window->SkipItems)
- return false;
-
// Default to using texture ID as ID. User can still push string/integer prefixes.
- PushID((void*)(intptr_t)user_texture_id);
- const ImGuiID id = window->GetID("#image");
- PopID();
-
+ PushID((ImTextureID)(intptr_t)user_texture_id);
if (frame_padding >= 0)
PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2((float)frame_padding, (float)frame_padding));
- bool ret = ImageButtonEx(id, user_texture_id, size, uv0, uv1, bg_col, tint_col);
+ bool ret = ImageButton("", user_texture_id, size, uv0, uv1, bg_col, tint_col);
if (frame_padding >= 0)
PopStyleVar();
+ PopID();
return ret;
}
+*/
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
bool ImGui::Checkbox(const char* label, bool* v)
@@ -1116,42 +1179,60 @@ bool ImGui::Checkbox(const char* label, bool* v)
const ImVec2 pos = window->DC.CursorPos;
const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f));
ItemSize(total_bb, style.FramePadding.y);
- if (!ItemAdd(total_bb, id))
- {
- IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
- return false;
- }
+ const bool is_visible = ItemAdd(total_bb, id);
+ const bool is_multi_select = (g.LastItemData.ItemFlags & ImGuiItemFlags_IsMultiSelect) != 0;
+ if (!is_visible)
+ if (!is_multi_select || !g.BoxSelectState.UnclipMode || !g.BoxSelectState.UnclipRect.Overlaps(total_bb)) // Extra layer of "no logic clip" for box-select support
+ {
+ IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
+ return false;
+ }
+
+ // Range-Selection/Multi-selection support (header)
+ bool checked = *v;
+ if (is_multi_select)
+ MultiSelectItemHeader(id, &checked, NULL);
bool hovered, held;
bool pressed = ButtonBehavior(total_bb, id, &hovered, &held);
- if (pressed)
+
+ // Range-Selection/Multi-selection support (footer)
+ if (is_multi_select)
+ MultiSelectItemFooter(id, &checked, &pressed);
+ else if (pressed)
+ checked = !checked;
+
+ if (*v != checked)
{
- *v = !(*v);
+ *v = checked;
+ pressed = true; // return value
MarkItemEdited(id);
}
const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz));
- RenderNavHighlight(total_bb, id);
- RenderFrame(check_bb.Min, check_bb.Max, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding);
- ImU32 check_col = GetColorU32(ImGuiCol_CheckMark);
- bool mixed_value = (g.LastItemData.InFlags & ImGuiItemFlags_MixedValue) != 0;
- if (mixed_value)
+ const bool mixed_value = (g.LastItemData.ItemFlags & ImGuiItemFlags_MixedValue) != 0;
+ if (is_visible)
{
- // Undocumented tristate/mixed/indeterminate checkbox (#2644)
- // This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all widgets (not just checkbox)
- ImVec2 pad(ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)), ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)));
- window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding);
- }
- else if (*v)
- {
- const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f));
- RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad * 2.0f);
+ RenderNavCursor(total_bb, id);
+ RenderFrame(check_bb.Min, check_bb.Max, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding);
+ ImU32 check_col = GetColorU32(ImGuiCol_CheckMark);
+ if (mixed_value)
+ {
+ // Undocumented tristate/mixed/indeterminate checkbox (#2644)
+ // This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all widgets (not just checkbox)
+ ImVec2 pad(ImMax(1.0f, IM_TRUNC(square_sz / 3.6f)), ImMax(1.0f, IM_TRUNC(square_sz / 3.6f)));
+ window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding);
+ }
+ else if (*v)
+ {
+ const float pad = ImMax(1.0f, IM_TRUNC(square_sz / 6.0f));
+ RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad * 2.0f);
+ }
}
-
- ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y);
+ const ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y);
if (g.LogEnabled)
LogRenderedText(&label_pos, mixed_value ? "[~]" : *v ? "[x]" : "[ ]");
- if (label_size.x > 0.0f)
+ if (is_visible && label_size.x > 0.0f)
RenderText(label_pos, label);
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
@@ -1167,10 +1248,8 @@ bool ImGui::CheckboxFlagsT(const char* label, T* flags, T flags_value)
if (!all_on && any_on)
{
ImGuiContext& g = *GImGui;
- ImGuiItemFlags backup_item_flags = g.CurrentItemFlags;
- g.CurrentItemFlags |= ImGuiItemFlags_MixedValue;
+ g.NextItemData.ItemFlags |= ImGuiItemFlags_MixedValue;
pressed = Checkbox(label, &all_on);
- g.CurrentItemFlags = backup_item_flags;
}
else
{
@@ -1236,18 +1315,19 @@ bool ImGui::RadioButton(const char* label, bool active)
if (pressed)
MarkItemEdited(id);
- RenderNavHighlight(total_bb, id);
- window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), 16);
+ RenderNavCursor(total_bb, id);
+ const int num_segment = window->DrawList->_CalcCircleAutoSegmentCount(radius);
+ window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), num_segment);
if (active)
{
- const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f));
- window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(ImGuiCol_CheckMark), 16);
+ const float pad = ImMax(1.0f, IM_TRUNC(square_sz / 6.0f));
+ window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(ImGuiCol_CheckMark));
}
if (style.FrameBorderSize > 0.0f)
{
- window->DrawList->AddCircle(center + ImVec2(1, 1), radius, GetColorU32(ImGuiCol_BorderShadow), 16, style.FrameBorderSize);
- window->DrawList->AddCircle(center, radius, GetColorU32(ImGuiCol_Border), 16, style.FrameBorderSize);
+ window->DrawList->AddCircle(center + ImVec2(1, 1), radius, GetColorU32(ImGuiCol_BorderShadow), num_segment, style.FrameBorderSize);
+ window->DrawList->AddCircle(center, radius, GetColorU32(ImGuiCol_Border), num_segment, style.FrameBorderSize);
}
ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y);
@@ -1286,24 +1366,47 @@ void ImGui::ProgressBar(float fraction, const ImVec2& size_arg, const char* over
if (!ItemAdd(bb, 0))
return;
+ // Fraction < 0.0f will display an indeterminate progress bar animation
+ // The value must be animated along with time, so e.g. passing '-1.0f * ImGui::GetTime()' as fraction works.
+ const bool is_indeterminate = (fraction < 0.0f);
+ if (!is_indeterminate)
+ fraction = ImSaturate(fraction);
+
+ // Out of courtesy we accept a NaN fraction without crashing
+ float fill_n0 = 0.0f;
+ float fill_n1 = (fraction == fraction) ? fraction : 0.0f;
+
+ if (is_indeterminate)
+ {
+ const float fill_width_n = 0.2f;
+ fill_n0 = ImFmod(-fraction, 1.0f) * (1.0f + fill_width_n) - fill_width_n;
+ fill_n1 = ImSaturate(fill_n0 + fill_width_n);
+ fill_n0 = ImSaturate(fill_n0);
+ }
+
// Render
- fraction = ImSaturate(fraction);
RenderFrame(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding);
bb.Expand(ImVec2(-style.FrameBorderSize, -style.FrameBorderSize));
- const ImVec2 fill_br = ImVec2(ImLerp(bb.Min.x, bb.Max.x, fraction), bb.Max.y);
- RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0f, fraction, style.FrameRounding);
+ RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), fill_n0, fill_n1, style.FrameRounding);
// Default displaying the fraction as percentage string, but user can override it
+ // Don't display text for indeterminate bars by default
char overlay_buf[32];
- if (!overlay)
+ if (!is_indeterminate || overlay != NULL)
{
- ImFormatString(overlay_buf, IM_ARRAYSIZE(overlay_buf), "%.0f%%", fraction * 100 + 0.01f);
- overlay = overlay_buf;
- }
+ if (!overlay)
+ {
+ ImFormatString(overlay_buf, IM_ARRAYSIZE(overlay_buf), "%.0f%%", fraction * 100 + 0.01f);
+ overlay = overlay_buf;
+ }
- ImVec2 overlay_size = CalcTextSize(overlay, NULL);
- if (overlay_size.x > 0.0f)
- RenderTextClipped(ImVec2(ImClamp(fill_br.x + style.ItemSpacing.x, bb.Min.x, bb.Max.x - overlay_size.x - style.ItemInnerSpacing.x), bb.Min.y), bb.Max, overlay, NULL, &overlay_size, ImVec2(0.0f, 0.5f), &bb);
+ ImVec2 overlay_size = CalcTextSize(overlay, NULL);
+ if (overlay_size.x > 0.0f)
+ {
+ float text_x = is_indeterminate ? (bb.Min.x + bb.Max.x - overlay_size.x) * 0.5f : ImLerp(bb.Min.x, bb.Max.x, fill_n1) + style.ItemSpacing.x;
+ RenderTextClipped(ImVec2(ImClamp(text_x, bb.Min.x, bb.Max.x - overlay_size.x - style.ItemInnerSpacing.x), bb.Min.y), bb.Max, overlay, NULL, &overlay_size, ImVec2(0.0f, 0.5f), &bb);
+ }
+ }
}
void ImGui::Bullet()
@@ -1329,6 +1432,79 @@ void ImGui::Bullet()
SameLine(0, style.FramePadding.x * 2.0f);
}
+// This is provided as a convenience for being an often requested feature.
+// FIXME-STYLE: we delayed adding as there is a larger plan to revamp the styling system.
+// Because of this we currently don't provide many styling options for this widget
+// (e.g. hovered/active colors are automatically inferred from a single color).
+bool ImGui::TextLink(const char* label)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
+
+ ImGuiContext& g = *GImGui;
+ const ImGuiID id = window->GetID(label);
+ const char* label_end = FindRenderedTextEnd(label);
+
+ ImVec2 pos(window->DC.CursorPos.x, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset);
+ ImVec2 size = CalcTextSize(label, label_end, true);
+ ImRect bb(pos, pos + size);
+ ItemSize(size, 0.0f);
+ if (!ItemAdd(bb, id))
+ return false;
+
+ bool hovered, held;
+ bool pressed = ButtonBehavior(bb, id, &hovered, &held);
+ RenderNavCursor(bb, id);
+
+ if (hovered)
+ SetMouseCursor(ImGuiMouseCursor_Hand);
+
+ ImVec4 text_colf = g.Style.Colors[ImGuiCol_TextLink];
+ ImVec4 line_colf = text_colf;
+ {
+ // FIXME-STYLE: Read comments above. This widget is NOT written in the same style as some earlier widgets,
+ // as we are currently experimenting/planning a different styling system.
+ float h, s, v;
+ ColorConvertRGBtoHSV(text_colf.x, text_colf.y, text_colf.z, h, s, v);
+ if (held || hovered)
+ {
+ v = ImSaturate(v + (held ? 0.4f : 0.3f));
+ h = ImFmod(h + 0.02f, 1.0f);
+ }
+ ColorConvertHSVtoRGB(h, s, v, text_colf.x, text_colf.y, text_colf.z);
+ v = ImSaturate(v - 0.20f);
+ ColorConvertHSVtoRGB(h, s, v, line_colf.x, line_colf.y, line_colf.z);
+ }
+
+ float line_y = bb.Max.y + ImFloor(g.Font->Descent * g.FontScale * 0.20f);
+ window->DrawList->AddLine(ImVec2(bb.Min.x, line_y), ImVec2(bb.Max.x, line_y), GetColorU32(line_colf)); // FIXME-TEXT: Underline mode.
+
+ PushStyleColor(ImGuiCol_Text, GetColorU32(text_colf));
+ RenderText(bb.Min, label, label_end);
+ PopStyleColor();
+
+ IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
+ return pressed;
+}
+
+void ImGui::TextLinkOpenURL(const char* label, const char* url)
+{
+ ImGuiContext& g = *GImGui;
+ if (url == NULL)
+ url = label;
+ if (TextLink(label))
+ if (g.PlatformIO.Platform_OpenInShellFn != NULL)
+ g.PlatformIO.Platform_OpenInShellFn(&g, url);
+ SetItemTooltip(LocalizeGetMsg(ImGuiLocKey_OpenLink_s), url); // It is more reassuring for user to _always_ display URL when we same as label
+ if (BeginPopupContextItem())
+ {
+ if (MenuItem(LocalizeGetMsg(ImGuiLocKey_CopyLink)))
+ SetClipboardText(url);
+ EndPopup();
+ }
+}
+
//-------------------------------------------------------------------------
// [SECTION] Widgets: Low-level Layout helpers
//-------------------------------------------------------------------------
@@ -1390,7 +1566,9 @@ void ImGui::AlignTextToFramePadding()
}
// Horizontal/vertical separating line
-void ImGui::SeparatorEx(ImGuiSeparatorFlags flags)
+// FIXME: Surprisingly, this seemingly trivial widget is a victim of many different legacy/tricky layout issues.
+// Note how thickness == 1.0f is handled specifically as not moving CursorPos by 'thickness', but other values are.
+void ImGui::SeparatorEx(ImGuiSeparatorFlags flags, float thickness)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
@@ -1398,55 +1576,50 @@ void ImGui::SeparatorEx(ImGuiSeparatorFlags flags)
ImGuiContext& g = *GImGui;
IM_ASSERT(ImIsPowerOfTwo(flags & (ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical))); // Check that only 1 option is selected
+ IM_ASSERT(thickness > 0.0f);
- float thickness_draw = 1.0f;
- float thickness_layout = 0.0f;
if (flags & ImGuiSeparatorFlags_Vertical)
{
- // Vertical separator, for menu bars (use current line height). Not exposed because it is misleading and it doesn't have an effect on regular layout.
+ // Vertical separator, for menu bars (use current line height).
float y1 = window->DC.CursorPos.y;
float y2 = window->DC.CursorPos.y + window->DC.CurrLineSize.y;
- const ImRect bb(ImVec2(window->DC.CursorPos.x, y1), ImVec2(window->DC.CursorPos.x + thickness_draw, y2));
- ItemSize(ImVec2(thickness_layout, 0.0f));
+ const ImRect bb(ImVec2(window->DC.CursorPos.x, y1), ImVec2(window->DC.CursorPos.x + thickness, y2));
+ ItemSize(ImVec2(thickness, 0.0f));
if (!ItemAdd(bb, 0))
return;
// Draw
- window->DrawList->AddLine(ImVec2(bb.Min.x, bb.Min.y), ImVec2(bb.Min.x, bb.Max.y), GetColorU32(ImGuiCol_Separator));
+ window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_Separator));
if (g.LogEnabled)
LogText(" |");
}
else if (flags & ImGuiSeparatorFlags_Horizontal)
{
// Horizontal Separator
- float x1 = window->Pos.x;
- float x2 = window->Pos.x + window->Size.x;
-
- // FIXME-WORKRECT: old hack (#205) until we decide of consistent behavior with WorkRect/Indent and Separator
- if (g.GroupStack.Size > 0 && g.GroupStack.back().WindowID == window->ID)
- x1 += window->DC.Indent.x;
-
- // FIXME-WORKRECT: In theory we should simply be using WorkRect.Min.x/Max.x everywhere but it isn't aesthetically what we want,
- // need to introduce a variant of WorkRect for that purpose. (#4787)
- if (ImGuiTable* table = g.CurrentTable)
- {
- x1 = table->Columns[table->CurrentColumn].MinX;
- x2 = table->Columns[table->CurrentColumn].MaxX;
- }
+ float x1 = window->DC.CursorPos.x;
+ float x2 = window->WorkRect.Max.x;
+ // Preserve legacy behavior inside Columns()
+ // Before Tables API happened, we relied on Separator() to span all columns of a Columns() set.
+ // We currently don't need to provide the same feature for tables because tables naturally have border features.
ImGuiOldColumns* columns = (flags & ImGuiSeparatorFlags_SpanAllColumns) ? window->DC.CurrentColumns : NULL;
if (columns)
+ {
+ x1 = window->Pos.x + window->DC.Indent.x; // Used to be Pos.x before 2023/10/03
+ x2 = window->Pos.x + window->Size.x;
PushColumnsBackground();
+ }
// We don't provide our width to the layout so that it doesn't get feed back into AutoFit
// FIXME: This prevents ->CursorMaxPos based bounding box evaluation from working (e.g. TableEndCell)
- const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y + thickness_draw));
- ItemSize(ImVec2(0.0f, thickness_layout));
- const bool item_visible = ItemAdd(bb, 0);
- if (item_visible)
+ const float thickness_for_layout = (thickness == 1.0f) ? 0.0f : thickness; // FIXME: See 1.70/1.71 Separator() change: makes legacy 1-px separator not affect layout yet. Should change.
+ const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y + thickness));
+ ItemSize(ImVec2(0.0f, thickness_for_layout));
+
+ if (ItemAdd(bb, 0))
{
// Draw
- window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x, bb.Min.y), GetColorU32(ImGuiCol_Separator));
+ window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_Separator));
if (g.LogEnabled)
LogRenderedText(&bb.Min, "--------------------------------\n");
@@ -1466,14 +1639,84 @@ void ImGui::Separator()
if (window->SkipItems)
return;
- // Those flags should eventually be overridable by the user
+ // Those flags should eventually be configurable by the user
+ // FIXME: We cannot g.Style.SeparatorTextBorderSize for thickness as it relates to SeparatorText() which is a decorated separator, not defaulting to 1.0f.
ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal;
- flags |= ImGuiSeparatorFlags_SpanAllColumns; // NB: this only applies to legacy Columns() api as they relied on Separator() a lot.
- SeparatorEx(flags);
+
+ // Only applies to legacy Columns() api as they relied on Separator() a lot.
+ if (window->DC.CurrentColumns)
+ flags |= ImGuiSeparatorFlags_SpanAllColumns;
+
+ SeparatorEx(flags, 1.0f);
+}
+
+void ImGui::SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_w)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ ImGuiStyle& style = g.Style;
+
+ const ImVec2 label_size = CalcTextSize(label, label_end, false);
+ const ImVec2 pos = window->DC.CursorPos;
+ const ImVec2 padding = style.SeparatorTextPadding;
+
+ const float separator_thickness = style.SeparatorTextBorderSize;
+ const ImVec2 min_size(label_size.x + extra_w + padding.x * 2.0f, ImMax(label_size.y + padding.y * 2.0f, separator_thickness));
+ const ImRect bb(pos, ImVec2(window->WorkRect.Max.x, pos.y + min_size.y));
+ const float text_baseline_y = ImTrunc((bb.GetHeight() - label_size.y) * style.SeparatorTextAlign.y + 0.99999f); //ImMax(padding.y, ImFloor((style.SeparatorTextSize - label_size.y) * 0.5f));
+ ItemSize(min_size, text_baseline_y);
+ if (!ItemAdd(bb, id))
+ return;
+
+ const float sep1_x1 = pos.x;
+ const float sep2_x2 = bb.Max.x;
+ const float seps_y = ImTrunc((bb.Min.y + bb.Max.y) * 0.5f + 0.99999f);
+
+ const float label_avail_w = ImMax(0.0f, sep2_x2 - sep1_x1 - padding.x * 2.0f);
+ const ImVec2 label_pos(pos.x + padding.x + ImMax(0.0f, (label_avail_w - label_size.x - extra_w) * style.SeparatorTextAlign.x), pos.y + text_baseline_y); // FIXME-ALIGN
+
+ // This allows using SameLine() to position something in the 'extra_w'
+ window->DC.CursorPosPrevLine.x = label_pos.x + label_size.x;
+
+ const ImU32 separator_col = GetColorU32(ImGuiCol_Separator);
+ if (label_size.x > 0.0f)
+ {
+ const float sep1_x2 = label_pos.x - style.ItemSpacing.x;
+ const float sep2_x1 = label_pos.x + label_size.x + extra_w + style.ItemSpacing.x;
+ if (sep1_x2 > sep1_x1 && separator_thickness > 0.0f)
+ window->DrawList->AddLine(ImVec2(sep1_x1, seps_y), ImVec2(sep1_x2, seps_y), separator_col, separator_thickness);
+ if (sep2_x2 > sep2_x1 && separator_thickness > 0.0f)
+ window->DrawList->AddLine(ImVec2(sep2_x1, seps_y), ImVec2(sep2_x2, seps_y), separator_col, separator_thickness);
+ if (g.LogEnabled)
+ LogSetNextTextDecoration("---", NULL);
+ RenderTextEllipsis(window->DrawList, label_pos, ImVec2(bb.Max.x, bb.Max.y + style.ItemSpacing.y), bb.Max.x, bb.Max.x, label, label_end, &label_size);
+ }
+ else
+ {
+ if (g.LogEnabled)
+ LogText("---");
+ if (separator_thickness > 0.0f)
+ window->DrawList->AddLine(ImVec2(sep1_x1, seps_y), ImVec2(sep2_x2, seps_y), separator_col, separator_thickness);
+ }
+}
+
+void ImGui::SeparatorText(const char* label)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return;
+
+ // The SeparatorText() vs SeparatorTextEx() distinction is designed to be considerate that we may want:
+ // - allow separator-text to be draggable items (would require a stable ID + a noticeable highlight)
+ // - this high-level entry point to allow formatting? (which in turns may require ID separate from formatted string)
+ // - because of this we probably can't turn 'const char* label' into 'const char* fmt, ...'
+ // Otherwise, we can decide that users wanting to drag this would layout a dedicated drag-item,
+ // and then we can turn this into a format function.
+ SeparatorTextEx(0, label, FindRenderedTextEnd(label), 0.0f);
}
// Using 'hover_visibility_delay' allows us to hide the highlight and mouse cursor for a short time, which can be convenient to reduce visual noise.
-bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend, float hover_visibility_delay)
+bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend, float hover_visibility_delay, ImU32 bg_col)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
@@ -1481,14 +1724,20 @@ bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float
if (!ItemAdd(bb, id, NULL, ImGuiItemFlags_NoNav))
return false;
+ // FIXME: AFAIK the only leftover reason for passing ImGuiButtonFlags_AllowOverlap here is
+ // to allow caller of SplitterBehavior() to call SetItemAllowOverlap() after the item.
+ // Nowadays we would instead want to use SetNextItemAllowOverlap() before the item.
+ ImGuiButtonFlags button_flags = ImGuiButtonFlags_FlattenChildren;
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ button_flags |= ImGuiButtonFlags_AllowOverlap;
+#endif
+
bool hovered, held;
ImRect bb_interact = bb;
bb_interact.Expand(axis == ImGuiAxis_Y ? ImVec2(0.0f, hover_extend) : ImVec2(hover_extend, 0.0f));
- ButtonBehavior(bb_interact, id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap);
+ ButtonBehavior(bb_interact, id, &hovered, &held, button_flags);
if (hovered)
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredRect; // for IsItemHovered(), because bb_interact is larger than bb
- if (g.ActiveId != id)
- SetItemAllowOverlap();
if (held || (hovered && g.HoveredIdPreviousFrame == id && g.HoveredIdTimer >= hover_visibility_delay))
SetMouseCursor(axis == ImGuiAxis_Y ? ImGuiMouseCursor_ResizeNS : ImGuiMouseCursor_ResizeEW);
@@ -1496,8 +1745,7 @@ bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float
ImRect bb_render = bb;
if (held)
{
- ImVec2 mouse_delta_2d = g.IO.MousePos - g.ActiveIdClickOffset - bb_interact.Min;
- float mouse_delta = (axis == ImGuiAxis_Y) ? mouse_delta_2d.y : mouse_delta_2d.x;
+ float mouse_delta = (g.IO.MousePos - g.ActiveIdClickOffset - bb_interact.Min)[axis];
// Minimum pane size
float size_1_maximum_delta = ImMax(0.0f, *size1 - min_size1);
@@ -1510,18 +1758,16 @@ bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float
// Apply resize
if (mouse_delta != 0.0f)
{
- if (mouse_delta < 0.0f)
- IM_ASSERT(*size1 + mouse_delta >= min_size1);
- if (mouse_delta > 0.0f)
- IM_ASSERT(*size2 - mouse_delta >= min_size2);
- *size1 += mouse_delta;
- *size2 -= mouse_delta;
+ *size1 = ImMax(*size1 + mouse_delta, min_size1);
+ *size2 = ImMax(*size2 - mouse_delta, min_size2);
bb_render.Translate((axis == ImGuiAxis_X) ? ImVec2(mouse_delta, 0.0f) : ImVec2(0.0f, mouse_delta));
MarkItemEdited(id);
}
}
- // Render
+ // Render at new position
+ if (bg_col & IM_COL32_A_MASK)
+ window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, bg_col, 0.0f);
const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : (hovered && g.HoveredIdTimer >= hover_visibility_delay) ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator);
window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, col, 0.0f);
@@ -1567,7 +1813,7 @@ void ImGui::ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_exc
width_excess = 0.0f;
for (int n = 0; n < count; n++)
{
- float width_rounded = ImFloor(items[n].Width);
+ float width_rounded = ImTrunc(items[n].Width);
width_excess += items[n].Width - width_rounded;
items[n].Width = width_rounded;
}
@@ -1605,7 +1851,7 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF
ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
- ImGuiNextWindowDataFlags backup_next_window_data_flags = g.NextWindowData.Flags;
+ ImGuiNextWindowDataFlags backup_next_window_data_flags = g.NextWindowData.HasFlags;
g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
if (window->SkipItems)
return false;
@@ -1613,10 +1859,13 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
IM_ASSERT((flags & (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)) != (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)); // Can't use both flags together
+ if (flags & ImGuiComboFlags_WidthFitPreview)
+ IM_ASSERT((flags & (ImGuiComboFlags_NoPreview | (ImGuiComboFlags)ImGuiComboFlags_CustomPreview)) == 0);
const float arrow_size = (flags & ImGuiComboFlags_NoArrowButton) ? 0.0f : GetFrameHeight();
const ImVec2 label_size = CalcTextSize(label, NULL, true);
- const float w = (flags & ImGuiComboFlags_NoPreview) ? arrow_size : CalcItemWidth();
+ const float preview_width = ((flags & ImGuiComboFlags_WidthFitPreview) && (preview_value != NULL)) ? CalcTextSize(preview_value, NULL, true).x : 0.0f;
+ const float w = (flags & ImGuiComboFlags_NoPreview) ? arrow_size : ((flags & ImGuiComboFlags_WidthFitPreview) ? (arrow_size + preview_width + style.FramePadding.x * 2.0f) : CalcItemWidth());
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y * 2.0f));
const ImRect total_bb(bb.Min, bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
ItemSize(total_bb, style.FramePadding.y);
@@ -1637,7 +1886,7 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF
// Render shape
const ImU32 frame_col = GetColorU32(hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg);
const float value_x2 = ImMax(bb.Min.x, bb.Max.x - arrow_size);
- RenderNavHighlight(bb, id);
+ RenderNavCursor(bb, id);
if (!(flags & ImGuiComboFlags_NoPreview))
window->DrawList->AddRectFilled(bb.Min, ImVec2(value_x2, bb.Max.y), frame_col, style.FrameRounding, (flags & ImGuiComboFlags_NoArrowButton) ? ImDrawFlags_RoundCornersAll : ImDrawFlags_RoundCornersLeft);
if (!(flags & ImGuiComboFlags_NoArrowButton))
@@ -1671,7 +1920,7 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF
if (!popup_open)
return false;
- g.NextWindowData.Flags = backup_next_window_data_flags;
+ g.NextWindowData.HasFlags = backup_next_window_data_flags;
return BeginComboPopup(popup_id, bb, flags);
}
@@ -1686,7 +1935,7 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags
// Set popup size
float w = bb.GetWidth();
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSizeConstraint)
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSizeConstraint)
{
g.NextWindowData.SizeConstraintRect.Min.x = ImMax(g.NextWindowData.SizeConstraintRect.Min.x, w);
}
@@ -1699,12 +1948,17 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags
if (flags & ImGuiComboFlags_HeightRegular) popup_max_height_in_items = 8;
else if (flags & ImGuiComboFlags_HeightSmall) popup_max_height_in_items = 4;
else if (flags & ImGuiComboFlags_HeightLarge) popup_max_height_in_items = 20;
- SetNextWindowSizeConstraints(ImVec2(w, 0.0f), ImVec2(FLT_MAX, CalcMaxPopupHeightFromItemCount(popup_max_height_in_items)));
+ ImVec2 constraint_min(0.0f, 0.0f), constraint_max(FLT_MAX, FLT_MAX);
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0 || g.NextWindowData.SizeVal.x <= 0.0f) // Don't apply constraints if user specified a size
+ constraint_min.x = w;
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0 || g.NextWindowData.SizeVal.y <= 0.0f)
+ constraint_max.y = CalcMaxPopupHeightFromItemCount(popup_max_height_in_items);
+ SetNextWindowSizeConstraints(constraint_min, constraint_max);
}
// This is essentially a specialized version of BeginPopupEx()
char name[16];
- ImFormatString(name, IM_ARRAYSIZE(name), "##Combo_%02d", g.BeginPopupStack.Size); // Recycle windows based on depth
+ ImFormatString(name, IM_ARRAYSIZE(name), "##Combo_%02d", g.BeginComboDepth); // Recycle windows based on depth
// Set position given a custom constraint (peak into expected window size so we can position it)
// FIXME: This might be easier to express with an hypothetical SetNextWindowPosConstraints() function?
@@ -1722,7 +1976,7 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags
// We don't use BeginPopupEx() solely because we have a custom name string, which we could make an argument to BeginPopupEx()
ImGuiWindowFlags window_flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoMove;
- PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(g.Style.FramePadding.x, g.Style.WindowPadding.y)); // Horizontally align ourselves with the framed text
+ PushStyleVarX(ImGuiStyleVar_WindowPadding, g.Style.FramePadding.x); // Horizontally align ourselves with the framed text
bool ret = Begin(name, NULL, window_flags);
PopStyleVar();
if (!ret)
@@ -1731,12 +1985,15 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags
IM_ASSERT(0); // This should never happen as we tested for IsPopupOpen() above
return false;
}
+ g.BeginComboDepth++;
return true;
}
void ImGui::EndCombo()
{
+ ImGuiContext& g = *GImGui;
EndPopup();
+ g.BeginComboDepth--;
}
// Call directly after the BeginCombo/EndCombo block. The preview is designed to only host non-interactive elements
@@ -1750,7 +2007,7 @@ bool ImGui::BeginComboPreview()
if (window->SkipItems || !(g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible))
return false;
IM_ASSERT(g.LastItemData.Rect.Min.x == preview_data->PreviewRect.Min.x && g.LastItemData.Rect.Min.y == preview_data->PreviewRect.Min.y); // Didn't call after BeginCombo/EndCombo block or forgot to pass ImGuiComboFlags_CustomPreview flag?
- if (!window->ClipRect.Contains(preview_data->PreviewRect)) // Narrower test (optional)
+ if (!window->ClipRect.Overlaps(preview_data->PreviewRect)) // Narrower test (optional)
return false;
// FIXME: This could be contained in a PushWorkRect() api
@@ -1793,18 +2050,15 @@ void ImGui::EndComboPreview()
}
// Getter for the old Combo() API: const char*[]
-static bool Items_ArrayGetter(void* data, int idx, const char** out_text)
+static const char* Items_ArrayGetter(void* data, int idx)
{
const char* const* items = (const char* const*)data;
- if (out_text)
- *out_text = items[idx];
- return true;
+ return items[idx];
}
// Getter for the old Combo() API: "item1\0item2\0item3\0"
-static bool Items_SingleStringGetter(void* data, int idx, const char** out_text)
+static const char* Items_SingleStringGetter(void* data, int idx)
{
- // FIXME-OPT: we could pre-compute the indices to fasten this. But only 1 active combo means the waste is limited.
const char* items_separated_by_zeros = (const char*)data;
int items_count = 0;
const char* p = items_separated_by_zeros;
@@ -1812,55 +2066,54 @@ static bool Items_SingleStringGetter(void* data, int idx, const char** out_text)
{
if (idx == items_count)
break;
- p += strlen(p) + 1;
+ p += ImStrlen(p) + 1;
items_count++;
}
- if (!*p)
- return false;
- if (out_text)
- *out_text = p;
- return true;
+ return *p ? p : NULL;
}
// Old API, prefer using BeginCombo() nowadays if you can.
-bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int popup_max_height_in_items)
+bool ImGui::Combo(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int popup_max_height_in_items)
{
ImGuiContext& g = *GImGui;
// Call the getter to obtain the preview string which is a parameter to BeginCombo()
const char* preview_value = NULL;
if (*current_item >= 0 && *current_item < items_count)
- items_getter(data, *current_item, &preview_value);
+ preview_value = getter(user_data, *current_item);
// The old Combo() API exposed "popup_max_height_in_items". The new more general BeginCombo() API doesn't have/need it, but we emulate it here.
- if (popup_max_height_in_items != -1 && !(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSizeConstraint))
+ if (popup_max_height_in_items != -1 && !(g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSizeConstraint))
SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, CalcMaxPopupHeightFromItemCount(popup_max_height_in_items)));
if (!BeginCombo(label, preview_value, ImGuiComboFlags_None))
return false;
// Display items
- // FIXME-OPT: Use clipper (but we need to disable it on the appearing frame to make sure our call to SetItemDefaultFocus() is processed)
bool value_changed = false;
- for (int i = 0; i < items_count; i++)
- {
- PushID(i);
- const bool item_selected = (i == *current_item);
- const char* item_text;
- if (!items_getter(data, i, &item_text))
- item_text = "*Unknown item*";
- if (Selectable(item_text, item_selected))
+ ImGuiListClipper clipper;
+ clipper.Begin(items_count);
+ clipper.IncludeItemByIndex(*current_item);
+ while (clipper.Step())
+ for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
{
- value_changed = true;
- *current_item = i;
+ const char* item_text = getter(user_data, i);
+ if (item_text == NULL)
+ item_text = "*Unknown item*";
+
+ PushID(i);
+ const bool item_selected = (i == *current_item);
+ if (Selectable(item_text, item_selected) && *current_item != i)
+ {
+ value_changed = true;
+ *current_item = i;
+ }
+ if (item_selected)
+ SetItemDefaultFocus();
+ PopID();
}
- if (item_selected)
- SetItemDefaultFocus();
- PopID();
- }
EndCombo();
-
if (value_changed)
MarkItemEdited(g.LastItemData.ID);
@@ -1881,20 +2134,44 @@ bool ImGui::Combo(const char* label, int* current_item, const char* items_separa
const char* p = items_separated_by_zeros; // FIXME-OPT: Avoid computing this, or at least only when combo is open
while (*p)
{
- p += strlen(p) + 1;
+ p += ImStrlen(p) + 1;
items_count++;
}
bool value_changed = Combo(label, current_item, Items_SingleStringGetter, (void*)items_separated_by_zeros, items_count, height_in_items);
return value_changed;
}
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+
+struct ImGuiGetNameFromIndexOldToNewCallbackData { void* UserData; bool (*OldCallback)(void*, int, const char**); };
+static const char* ImGuiGetNameFromIndexOldToNewCallback(void* user_data, int idx)
+{
+ ImGuiGetNameFromIndexOldToNewCallbackData* data = (ImGuiGetNameFromIndexOldToNewCallbackData*)user_data;
+ const char* s = NULL;
+ data->OldCallback(data->UserData, idx, &s);
+ return s;
+}
+
+bool ImGui::ListBox(const char* label, int* current_item, bool (*old_getter)(void*, int, const char**), void* user_data, int items_count, int height_in_items)
+{
+ ImGuiGetNameFromIndexOldToNewCallbackData old_to_new_data = { user_data, old_getter };
+ return ListBox(label, current_item, ImGuiGetNameFromIndexOldToNewCallback, &old_to_new_data, items_count, height_in_items);
+}
+bool ImGui::Combo(const char* label, int* current_item, bool (*old_getter)(void*, int, const char**), void* user_data, int items_count, int popup_max_height_in_items)
+{
+ ImGuiGetNameFromIndexOldToNewCallbackData old_to_new_data = { user_data, old_getter };
+ return Combo(label, current_item, ImGuiGetNameFromIndexOldToNewCallback, &old_to_new_data, items_count, popup_max_height_in_items);
+}
+
+#endif
+
//-------------------------------------------------------------------------
// [SECTION] Data Type and Data Formatting Helpers [Internal]
//-------------------------------------------------------------------------
// - DataTypeGetInfo()
// - DataTypeFormatString()
// - DataTypeApplyOp()
-// - DataTypeApplyOpFromText()
+// - DataTypeApplyFromText()
// - DataTypeCompare()
// - DataTypeClamp()
// - GetMinimumStepAtDecimalPrecision
@@ -1918,6 +2195,8 @@ static const ImGuiDataTypeInfo GDataTypeInfo[] =
#endif
{ sizeof(float), "float", "%.3f","%f" }, // ImGuiDataType_Float (float are promoted to double in va_arg)
{ sizeof(double), "double","%f", "%lf" }, // ImGuiDataType_Double
+ { sizeof(bool), "bool", "%d", "%d" }, // ImGuiDataType_Bool
+ { 0, "char*","%s", "%s" }, // ImGuiDataType_String
};
IM_STATIC_ASSERT(IM_ARRAYSIZE(GDataTypeInfo) == ImGuiDataType_COUNT);
@@ -2002,20 +2281,28 @@ void ImGui::DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, const
// User can input math operators (e.g. +100) to edit a numerical values.
// NB: This is _not_ a full expression evaluator. We should probably add one and replace this dumb mess..
-bool ImGui::DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format)
+bool ImGui::DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format, void* p_data_when_empty)
{
+ // Copy the value in an opaque buffer so we can compare at the end of the function if it changed at all.
+ const ImGuiDataTypeInfo* type_info = DataTypeGetInfo(data_type);
+ ImGuiDataTypeStorage data_backup;
+ memcpy(&data_backup, p_data, type_info->Size);
+
while (ImCharIsBlankA(*buf))
buf++;
if (!buf[0])
+ {
+ if (p_data_when_empty != NULL)
+ {
+ memcpy(p_data, p_data_when_empty, type_info->Size);
+ return memcmp(&data_backup, p_data, type_info->Size) != 0;
+ }
return false;
-
- // Copy the value in an opaque buffer so we can compare at the end of the function if it changed at all.
- const ImGuiDataTypeInfo* type_info = DataTypeGetInfo(data_type);
- ImGuiDataTypeTempStorage data_backup;
- memcpy(&data_backup, p_data, type_info->Size);
+ }
// Sanitize format
- // For float/double we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in, so force them into %f and %lf
+ // - For float/double we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in, so force them into %f and %lf
+ // - In theory could treat empty format as using default, but this would only cover rare/bizarre case of using InputScalar() + integer + format string without %.
char format_sanitized[32];
if (data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double)
format = type_info->ScanFmt;
@@ -2100,6 +2387,12 @@ bool ImGui::DataTypeClamp(ImGuiDataType data_type, void* p_data, const void* p_m
return false;
}
+bool ImGui::DataTypeIsZero(ImGuiDataType data_type, const void* p_data)
+{
+ ImGuiContext& g = *GImGui;
+ return DataTypeCompare(data_type, p_data, &g.DataTypeZeroValue) == 0;
+}
+
static float GetMinimumStepAtDecimalPrecision(int decimal_precision)
{
static const float min_steps[10] = { 1.0f, 0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f, 0.0000001f, 0.00000001f, 0.000000001f };
@@ -2133,6 +2426,8 @@ TYPE ImGui::RoundScalarWithFormatT(const char* format, ImGuiDataType data_type,
return v;
}
+template float ImGui::RoundScalarWithFormatT<float>(const char* format, ImGuiDataType data_type, float v);
+
//-------------------------------------------------------------------------
// [SECTION] Widgets: DragScalar, DragFloat, DragInt, etc.
//-------------------------------------------------------------------------
@@ -2158,12 +2453,13 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const
{
ImGuiContext& g = *GImGui;
const ImGuiAxis axis = (flags & ImGuiSliderFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X;
- const bool is_clamped = (v_min < v_max);
+ const bool is_bounded = (v_min < v_max) || ((v_min == v_max) && (v_min != 0.0f || (flags & ImGuiSliderFlags_ClampZeroRange)));
+ const bool is_wrapped = is_bounded && (flags & ImGuiSliderFlags_WrapAround);
const bool is_logarithmic = (flags & ImGuiSliderFlags_Logarithmic) != 0;
const bool is_floating_point = (data_type == ImGuiDataType_Float) || (data_type == ImGuiDataType_Double);
// Default tweak speed
- if (v_speed == 0.0f && is_clamped && (v_max - v_min < FLT_MAX))
+ if (v_speed == 0.0f && is_bounded && (v_max - v_min < FLT_MAX))
v_speed = (float)((v_max - v_min) * g.DragSpeedDefaultRatio);
// Inputs accumulates into g.DragCurrentAccum, which is flushed into the current value as soon as it makes a difference with our precision settings
@@ -2171,17 +2467,17 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const
if (g.ActiveIdSource == ImGuiInputSource_Mouse && IsMousePosValid() && IsMouseDragPastThreshold(0, g.IO.MouseDragThreshold * DRAG_MOUSE_THRESHOLD_FACTOR))
{
adjust_delta = g.IO.MouseDelta[axis];
- if (g.IO.KeyAlt)
+ if (g.IO.KeyAlt && !(flags & ImGuiSliderFlags_NoSpeedTweaks))
adjust_delta *= 1.0f / 100.0f;
- if (g.IO.KeyShift)
+ if (g.IO.KeyShift && !(flags & ImGuiSliderFlags_NoSpeedTweaks))
adjust_delta *= 10.0f;
}
- else if (g.ActiveIdSource == ImGuiInputSource_Nav)
+ else if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad)
{
const int decimal_precision = is_floating_point ? ImParseFormatPrecision(format, 3) : 0;
const bool tweak_slow = IsKeyDown((g.NavInputSource == ImGuiInputSource_Gamepad) ? ImGuiKey_NavGamepadTweakSlow : ImGuiKey_NavKeyboardTweakSlow);
const bool tweak_fast = IsKeyDown((g.NavInputSource == ImGuiInputSource_Gamepad) ? ImGuiKey_NavGamepadTweakFast : ImGuiKey_NavKeyboardTweakFast);
- const float tweak_factor = tweak_slow ? 1.0f / 1.0f : tweak_fast ? 10.0f : 1.0f;
+ const float tweak_factor = (flags & ImGuiSliderFlags_NoSpeedTweaks) ? 1.0f : tweak_slow ? 1.0f / 10.0f : tweak_fast ? 10.0f : 1.0f;
adjust_delta = GetNavTweakPressedAmount(axis) * tweak_factor;
v_speed = ImMax(v_speed, GetMinimumStepAtDecimalPrecision(decimal_precision));
}
@@ -2197,8 +2493,8 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const
// Clear current value on activation
// Avoid altering values and clamping when we are _already_ past the limits and heading in the same direction, so e.g. if range is 0..255, current value is 300 and we are pushing to the right side, keep the 300.
- bool is_just_activated = g.ActiveIdIsJustActivated;
- bool is_already_past_limits_and_pushing_outward = is_clamped && ((*v >= v_max && adjust_delta > 0.0f) || (*v <= v_min && adjust_delta < 0.0f));
+ const bool is_just_activated = g.ActiveIdIsJustActivated;
+ const bool is_already_past_limits_and_pushing_outward = is_bounded && !is_wrapped && ((*v >= v_max && adjust_delta > 0.0f) || (*v <= v_min && adjust_delta < 0.0f));
if (is_just_activated || is_already_past_limits_and_pushing_outward)
{
g.DragCurrentAccum = 0.0f;
@@ -2256,13 +2552,24 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const
if (v_cur == (TYPE)-0)
v_cur = (TYPE)0;
- // Clamp values (+ handle overflow/wrap-around for integer types)
- if (*v != v_cur && is_clamped)
+ if (*v != v_cur && is_bounded)
{
- if (v_cur < v_min || (v_cur > *v && adjust_delta < 0.0f && !is_floating_point))
- v_cur = v_min;
- if (v_cur > v_max || (v_cur < *v && adjust_delta > 0.0f && !is_floating_point))
- v_cur = v_max;
+ if (is_wrapped)
+ {
+ // Wrap values
+ if (v_cur < v_min)
+ v_cur += v_max - v_min + (is_floating_point ? 0 : 1);
+ if (v_cur > v_max)
+ v_cur -= v_max - v_min + (is_floating_point ? 0 : 1);
+ }
+ else
+ {
+ // Clamp values + handle overflow/wrap-around for integer types.
+ if (v_cur < v_min || (v_cur > *v && adjust_delta < 0.0f && !is_floating_point))
+ v_cur = v_min;
+ if (v_cur > v_max || (v_cur < *v && adjust_delta > 0.0f && !is_floating_point))
+ v_cur = v_max;
+ }
}
// Apply result
@@ -2275,7 +2582,7 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const
bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags)
{
// Read imgui.cpp "API BREAKING CHANGES" section for 1.78 if you hit this assert.
- IM_ASSERT((flags == 1 || (flags & ImGuiSliderFlags_InvalidMask_) == 0) && "Invalid ImGuiSliderFlags flags! Has the 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead.");
+ IM_ASSERT((flags == 1 || (flags & ImGuiSliderFlags_InvalidMask_) == 0) && "Invalid ImGuiSliderFlags flags! Has the legacy 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead.");
ImGuiContext& g = *GImGui;
if (g.ActiveId == id)
@@ -2283,12 +2590,12 @@ bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v
// Those are the things we can do easily outside the DragBehaviorT<> template, saves code generation.
if (g.ActiveIdSource == ImGuiInputSource_Mouse && !g.IO.MouseDown[0])
ClearActiveID();
- else if (g.ActiveIdSource == ImGuiInputSource_Nav && g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated)
+ else if ((g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad) && g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated)
ClearActiveID();
}
if (g.ActiveId != id)
return false;
- if ((g.LastItemData.InFlags & ImGuiItemFlags_ReadOnly) || (flags & ImGuiSliderFlags_ReadOnly))
+ if ((g.LastItemData.ItemFlags & ImGuiItemFlags_ReadOnly) || (flags & ImGuiSliderFlags_ReadOnly))
return false;
switch (data_type)
@@ -2335,30 +2642,33 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data,
if (format == NULL)
format = DataTypeGetInfo(data_type)->PrintFmt;
- const bool hovered = ItemHoverable(frame_bb, id);
+ const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags);
bool temp_input_is_active = temp_input_allowed && TempInputIsActive(id);
if (!temp_input_is_active)
{
- // Tabbing or CTRL-clicking on Drag turns it into an InputText
- const bool input_requested_by_tabbing = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
- const bool clicked = hovered && IsMouseClicked(0, id);
+ // Tabbing or CTRL+click on Drag turns it into an InputText
+ const bool clicked = hovered && IsMouseClicked(0, ImGuiInputFlags_None, id);
const bool double_clicked = (hovered && g.IO.MouseClickedCount[0] == 2 && TestKeyOwner(ImGuiKey_MouseLeft, id));
- const bool make_active = (input_requested_by_tabbing || clicked || double_clicked || g.NavActivateId == id || g.NavActivateInputId == id);
+ const bool make_active = (clicked || double_clicked || g.NavActivateId == id);
if (make_active && (clicked || double_clicked))
SetKeyOwner(ImGuiKey_MouseLeft, id);
if (make_active && temp_input_allowed)
- if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || double_clicked || g.NavActivateInputId == id)
+ if ((clicked && g.IO.KeyCtrl) || double_clicked || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput)))
temp_input_is_active = true;
// (Optional) simple click (without moving) turns Drag into an InputText
if (g.IO.ConfigDragClickToInputText && temp_input_allowed && !temp_input_is_active)
if (g.ActiveId == id && hovered && g.IO.MouseReleased[0] && !IsMouseDragPastThreshold(0, g.IO.MouseDragThreshold * DRAG_MOUSE_THRESHOLD_FACTOR))
{
- g.NavActivateId = g.NavActivateInputId = id;
+ g.NavActivateId = id;
g.NavActivateFlags = ImGuiActivateFlags_PreferInput;
temp_input_is_active = true;
}
+ // Store initial value (not used by main lib but available as a convenience but some mods e.g. to revert)
+ if (make_active)
+ memcpy(&g.ActiveIdValueOnActivation, p_data, DataTypeGetInfo(data_type)->Size);
+
if (make_active && !temp_input_is_active)
{
SetActiveID(id, window);
@@ -2370,14 +2680,22 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data,
if (temp_input_is_active)
{
- // Only clamp CTRL+Click input when ImGuiSliderFlags_AlwaysClamp is set
- const bool is_clamp_input = (flags & ImGuiSliderFlags_AlwaysClamp) != 0 && (p_min == NULL || p_max == NULL || DataTypeCompare(data_type, p_min, p_max) < 0);
- return TempInputScalar(frame_bb, id, label, data_type, p_data, format, is_clamp_input ? p_min : NULL, is_clamp_input ? p_max : NULL);
+ // Only clamp CTRL+Click input when ImGuiSliderFlags_ClampOnInput is set (generally via ImGuiSliderFlags_AlwaysClamp)
+ bool clamp_enabled = false;
+ if ((flags & ImGuiSliderFlags_ClampOnInput) && (p_min != NULL || p_max != NULL))
+ {
+ const int clamp_range_dir = (p_min != NULL && p_max != NULL) ? DataTypeCompare(data_type, p_min, p_max) : 0; // -1 when *p_min < *p_max, == 0 when *p_min == *p_max
+ if (p_min == NULL || p_max == NULL || clamp_range_dir < 0)
+ clamp_enabled = true;
+ else if (clamp_range_dir == 0)
+ clamp_enabled = DataTypeIsZero(data_type, p_min) ? ((flags & ImGuiSliderFlags_ClampZeroRange) != 0) : true;
+ }
+ return TempInputScalar(frame_bb, id, label, data_type, p_data, format, clamp_enabled ? p_min : NULL, clamp_enabled ? p_max : NULL);
}
// Draw frame
const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg);
- RenderNavHighlight(frame_bb, id);
+ RenderNavCursor(frame_bb, id);
RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, style.FrameRounding);
// Drag behavior
@@ -2395,7 +2713,7 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data,
if (label_size.x > 0.0f)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
- IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
+ IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | (temp_input_allowed ? ImGuiItemStatusFlags_Inputable : 0));
return value_changed;
}
@@ -2688,20 +3006,7 @@ TYPE ImGui::ScaleValueFromRatioT(ImGuiDataType data_type, float t, TYPE v_min, T
return result;
}
-namespace ImGui
-{
-
-float RoundScalarWithFormatFloat(const char* format, ImGuiDataType data_type, float v)
-{
- return RoundScalarWithFormatT<float>(format, data_type, v);
-}
-
-float SliderCalcRatioFromValueFloat(ImGuiDataType data_type, float v, float v_min, float v_max, float power, float linear_zero_pos)
-{
- return ScaleRatioFromValueT<float, float, float>(data_type, v, v_min, v_max, false, power, linear_zero_pos);
-}
-
-} // namespace ImGui
+template float ImGui::ScaleRatioFromValueT<float, float, float>(ImGuiDataType data_type, float v, float v_min, float v_max, bool is_logarithmic, float logarithmic_zero_epsilon, float zero_deadzone_halfsize);
// FIXME: Try to move more of the code into shared SliderBehavior()
template<typename TYPE, typename SIGNEDTYPE, typename FLOATTYPE>
@@ -2713,14 +3018,14 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
const ImGuiAxis axis = (flags & ImGuiSliderFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X;
const bool is_logarithmic = (flags & ImGuiSliderFlags_Logarithmic) != 0;
const bool is_floating_point = (data_type == ImGuiDataType_Float) || (data_type == ImGuiDataType_Double);
- const SIGNEDTYPE v_range = (v_min < v_max ? v_max - v_min : v_min - v_max);
+ const float v_range_f = (float)(v_min < v_max ? v_max - v_min : v_min - v_max); // We don't need high precision for what we do with it.
// Calculate bounds
const float grab_padding = 2.0f; // FIXME: Should be part of style.
const float slider_sz = (bb.Max[axis] - bb.Min[axis]) - grab_padding * 2.0f;
float grab_sz = style.GrabMinSize;
- if (!is_floating_point && v_range >= 0) // v_range < 0 may happen on integer overflows
- grab_sz = ImMax((float)(slider_sz / (v_range + 1)), style.GrabMinSize); // For integer sliders: if possible have the grab size represent 1 unit
+ if (!is_floating_point && v_range_f >= 0.0f) // v_range_f < 0 may happen on integer overflows
+ grab_sz = ImMax(slider_sz / (v_range_f + 1), style.GrabMinSize); // For integer sliders: if possible have the grab size represent 1 unit
grab_sz = ImMin(grab_sz, slider_sz);
const float slider_usable_sz = slider_sz - grab_sz;
const float slider_usable_pos_min = bb.Min[axis] + grab_padding + grab_sz * 0.5f;
@@ -2767,7 +3072,7 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
set_new_value = true;
}
}
- else if (g.ActiveIdSource == ImGuiInputSource_Nav)
+ else if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad)
{
if (g.ActiveIdIsJustActivated)
{
@@ -2783,14 +3088,14 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
const int decimal_precision = is_floating_point ? ImParseFormatPrecision(format, 3) : 0;
if (decimal_precision > 0)
{
- input_delta /= 100.0f; // Gamepad/keyboard tweak speeds in % of slider bounds
+ input_delta /= 100.0f; // Keyboard/Gamepad tweak speeds in % of slider bounds
if (tweak_slow)
input_delta /= 10.0f;
}
else
{
- if ((v_range >= -100.0f && v_range <= 100.0f) || tweak_slow)
- input_delta = ((input_delta < 0.0f) ? -1.0f : +1.0f) / (float)v_range; // Gamepad/keyboard tweak speeds in integer steps
+ if ((v_range_f >= -100.0f && v_range_f <= 100.0f && v_range_f != 0.0f) || tweak_slow)
+ input_delta = ((input_delta < 0.0f) ? -1.0f : +1.0f) / v_range_f; // Keyboard/Gamepad tweak speeds in integer steps
else
input_delta /= 100.0f;
}
@@ -2838,6 +3143,10 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
}
if (set_new_value)
+ if ((g.LastItemData.ItemFlags & ImGuiItemFlags_ReadOnly) || (flags & ImGuiSliderFlags_ReadOnly))
+ set_new_value = false;
+
+ if (set_new_value)
{
TYPE v_new = ScaleValueFromRatioT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, clicked_t, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);
@@ -2880,12 +3189,8 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb)
{
// Read imgui.cpp "API BREAKING CHANGES" section for 1.78 if you hit this assert.
- IM_ASSERT((flags == 1 || (flags & ImGuiSliderFlags_InvalidMask_) == 0) && "Invalid ImGuiSliderFlags flag! Has the 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead.");
-
- // Those are the things we can do easily outside the SliderBehaviorT<> template, saves code generation.
- ImGuiContext& g = *GImGui;
- if ((g.LastItemData.InFlags & ImGuiItemFlags_ReadOnly) || (flags & ImGuiSliderFlags_ReadOnly))
- return false;
+ IM_ASSERT((flags == 1 || (flags & ImGuiSliderFlags_InvalidMask_) == 0) && "Invalid ImGuiSliderFlags flags! Has the legacy 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead.");
+ IM_ASSERT((flags & ImGuiSliderFlags_WrapAround) == 0); // Not supported by SliderXXX(), only by DragXXX()
switch (data_type)
{
@@ -2943,20 +3248,23 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat
if (format == NULL)
format = DataTypeGetInfo(data_type)->PrintFmt;
- const bool hovered = ItemHoverable(frame_bb, id);
+ const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags);
bool temp_input_is_active = temp_input_allowed && TempInputIsActive(id);
if (!temp_input_is_active)
{
- // Tabbing or CTRL-clicking on Slider turns it into an input box
- const bool input_requested_by_tabbing = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
- const bool clicked = hovered && IsMouseClicked(0, id);
- const bool make_active = (input_requested_by_tabbing || clicked || g.NavActivateId == id || g.NavActivateInputId == id);
+ // Tabbing or CTRL+click on Slider turns it into an input box
+ const bool clicked = hovered && IsMouseClicked(0, ImGuiInputFlags_None, id);
+ const bool make_active = (clicked || g.NavActivateId == id);
if (make_active && clicked)
SetKeyOwner(ImGuiKey_MouseLeft, id);
if (make_active && temp_input_allowed)
- if (input_requested_by_tabbing || (clicked && g.IO.KeyCtrl) || g.NavActivateInputId == id)
+ if ((clicked && g.IO.KeyCtrl) || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput)))
temp_input_is_active = true;
+ // Store initial value (not used by main lib but available as a convenience but some mods e.g. to revert)
+ if (make_active)
+ memcpy(&g.ActiveIdValueOnActivation, p_data, DataTypeGetInfo(data_type)->Size);
+
if (make_active && !temp_input_is_active)
{
SetActiveID(id, window);
@@ -2968,14 +3276,14 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat
if (temp_input_is_active)
{
- // Only clamp CTRL+Click input when ImGuiSliderFlags_AlwaysClamp is set
- const bool is_clamp_input = (flags & ImGuiSliderFlags_AlwaysClamp) != 0;
- return TempInputScalar(frame_bb, id, label, data_type, p_data, format, is_clamp_input ? p_min : NULL, is_clamp_input ? p_max : NULL);
+ // Only clamp CTRL+Click input when ImGuiSliderFlags_ClampOnInput is set (generally via ImGuiSliderFlags_AlwaysClamp)
+ const bool clamp_enabled = (flags & ImGuiSliderFlags_ClampOnInput) != 0;
+ return TempInputScalar(frame_bb, id, label, data_type, p_data, format, clamp_enabled ? p_min : NULL, clamp_enabled ? p_max : NULL);
}
// Draw frame
const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg);
- RenderNavHighlight(frame_bb, id);
+ RenderNavCursor(frame_bb, id);
RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, g.Style.FrameRounding);
// Slider behavior
@@ -2998,7 +3306,7 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat
if (label_size.x > 0.0f)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
- IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
+ IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | (temp_input_allowed ? ImGuiItemStatusFlags_Inputable : 0));
return value_changed;
}
@@ -3064,7 +3372,8 @@ bool ImGui::SliderAngle(const char* label, float* v_rad, float v_degrees_min, fl
format = "%.0f deg";
float v_deg = (*v_rad) * 360.0f / (2 * IM_PI);
bool value_changed = SliderFloat(label, &v_deg, v_degrees_min, v_degrees_max, format, flags);
- *v_rad = v_deg * (2 * IM_PI) / 360.0f;
+ if (value_changed)
+ *v_rad = v_deg * (2 * IM_PI) / 360.0f;
return value_changed;
}
@@ -3110,9 +3419,9 @@ bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType d
if (format == NULL)
format = DataTypeGetInfo(data_type)->PrintFmt;
- const bool hovered = ItemHoverable(frame_bb, id);
- const bool clicked = hovered && IsMouseClicked(0, id);
- if (clicked || g.NavActivateId == id || g.NavActivateInputId == id)
+ const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags);
+ const bool clicked = hovered && IsMouseClicked(0, ImGuiInputFlags_None, id);
+ if (clicked || g.NavActivateId == id)
{
if (clicked)
SetKeyOwner(ImGuiKey_MouseLeft, id);
@@ -3124,7 +3433,7 @@ bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType d
// Draw frame
const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg);
- RenderNavHighlight(frame_bb, id);
+ RenderNavCursor(frame_bb, id);
RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, g.Style.FrameRounding);
// Slider behavior
@@ -3213,7 +3522,7 @@ const char* ImParseFormatFindEnd(const char* fmt)
}
// Extract the format out of a format string with leading or trailing decorations
-// fmt = "blah blah" -> return fmt
+// fmt = "blah blah" -> return ""
// fmt = "%.3f" -> return fmt
// fmt = "hello %.3f" -> return fmt + 6
// fmt = "%.3f hello" -> return buf written with "%.3f"
@@ -3221,7 +3530,7 @@ const char* ImParseFormatTrimDecorations(const char* fmt, char* buf, size_t buf_
{
const char* fmt_start = ImParseFormatFindStart(fmt);
if (fmt_start[0] != '%')
- return fmt;
+ return "";
const char* fmt_end = ImParseFormatFindEnd(fmt_start);
if (fmt_end[0] == 0) // If we only have leading decoration, we don't need to copy the data.
return fmt_start;
@@ -3246,7 +3555,7 @@ void ImParseFormatSanitizeForPrinting(const char* fmt_in, char* fmt_out, size_t
*fmt_out = 0; // Zero-terminate
}
-// - For scanning we need to remove all width and precision fields "%3.7f" -> "%f". BUT don't strip types like "%I64d" which includes digits. ! "%07I64d" -> "%I64d"
+// - For scanning we need to remove all width and precision fields and flags "%+3.7f" -> "%f". BUT don't strip types like "%I64d" which includes digits. ! "%07I64d" -> "%I64d"
const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out, size_t fmt_out_size)
{
const char* fmt_end = ImParseFormatFindEnd(fmt_in);
@@ -3257,7 +3566,7 @@ const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out,
while (fmt_in < fmt_end)
{
char c = *fmt_in++;
- if (!has_type && ((c >= '0' && c <= '9') || c == '.'))
+ if (!has_type && ((c >= '0' && c <= '9') || c == '.' || c == '+' || c == '#'))
continue;
has_type |= ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); // Stop skipping digits
if (c != '\'' && c != '$' && c != '_') // Custom flags provided by stb_sprintf.h. POSIX 2008 also supports '.
@@ -3306,6 +3615,8 @@ int ImParseFormatPrecision(const char* fmt, int default_precision)
// Create text input in place of another active widget (e.g. used when doing a CTRL+Click on drag/slider widgets)
// FIXME: Facilitate using this in variety of other situations.
+// FIXME: Among other things, setting ImGuiItemFlags_AllowDuplicateId in LastItemData is currently correct but
+// the expected relationship between TempInputXXX functions and LastItemData is a little fishy.
bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags)
{
// On the first frame, g.TempInputTextId == 0, then on subsequent frames it becomes == id.
@@ -3316,6 +3627,7 @@ bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char*
ClearActiveID();
g.CurrentWindow->DC.CursorPos = bb.Min;
+ g.LastItemData.ItemFlags |= ImGuiItemFlags_AllowDuplicateId;
bool value_changed = InputTextEx(label, NULL, buf, buf_size, bb.GetSize(), flags | ImGuiInputTextFlags_MergedItem);
if (init)
{
@@ -3326,38 +3638,35 @@ bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char*
return value_changed;
}
-static inline ImGuiInputTextFlags InputScalar_DefaultCharsFilter(ImGuiDataType data_type, const char* format)
-{
- if (data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double)
- return ImGuiInputTextFlags_CharsScientific;
- const char format_last_char = format[0] ? format[strlen(format) - 1] : 0;
- return (format_last_char == 'x' || format_last_char == 'X') ? ImGuiInputTextFlags_CharsHexadecimal : ImGuiInputTextFlags_CharsDecimal;
-}
-
// Note that Drag/Slider functions are only forwarding the min/max values clamping values if the ImGuiSliderFlags_AlwaysClamp flag is set!
// This is intended: this way we allow CTRL+Click manual input to set a value out of bounds, for maximum flexibility.
// However this may not be ideal for all uses, as some user code may break on out of bound values.
bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min, const void* p_clamp_max)
{
+ // FIXME: May need to clarify display behavior if format doesn't contain %.
+ // "%d" -> "%d" / "There are %d items" -> "%d" / "items" -> "%d" (fallback). Also see #6405
+ ImGuiContext& g = *GImGui;
+ const ImGuiDataTypeInfo* type_info = DataTypeGetInfo(data_type);
char fmt_buf[32];
char data_buf[32];
format = ImParseFormatTrimDecorations(format, fmt_buf, IM_ARRAYSIZE(fmt_buf));
+ if (format[0] == 0)
+ format = type_info->PrintFmt;
DataTypeFormatString(data_buf, IM_ARRAYSIZE(data_buf), data_type, p_data, format);
ImStrTrimBlanks(data_buf);
- ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited;
- flags |= InputScalar_DefaultCharsFilter(data_type, format);
-
+ ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | (ImGuiInputTextFlags)ImGuiInputTextFlags_LocalizeDecimalPoint;
+ g.LastItemData.ItemFlags |= ImGuiItemFlags_NoMarkEdited; // Because TempInputText() uses ImGuiInputTextFlags_MergedItem it doesn't submit a new item, so we poke LastItemData.
bool value_changed = false;
if (TempInputText(bb, id, label, data_buf, IM_ARRAYSIZE(data_buf), flags))
{
// Backup old value
- size_t data_type_size = DataTypeGetInfo(data_type)->Size;
- ImGuiDataTypeTempStorage data_backup;
+ size_t data_type_size = type_info->Size;
+ ImGuiDataTypeStorage data_backup;
memcpy(&data_backup, p_data, data_type_size);
// Apply new value (or operations) then clamp
- DataTypeApplyFromText(data_buf, data_type, p_data, format);
+ DataTypeApplyFromText(data_buf, data_type, p_data, format, NULL);
if (p_clamp_min || p_clamp_max)
{
if (p_clamp_min && p_clamp_max && DataTypeCompare(data_type, p_clamp_min, p_clamp_max) > 0)
@@ -3366,6 +3675,7 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG
}
// Only mark as edited if new value is different
+ g.LastItemData.ItemFlags &= ~ImGuiItemFlags_NoMarkEdited;
value_changed = memcmp(&data_backup, p_data, data_type_size) != 0;
if (value_changed)
MarkItemEdited(id);
@@ -3373,6 +3683,13 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG
return value_changed;
}
+void ImGui::SetNextItemRefVal(ImGuiDataType data_type, void* p_data)
+{
+ ImGuiContext& g = *GImGui;
+ g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasRefVal;
+ memcpy(&g.NextItemData.RefVal, p_data, DataTypeGetInfo(data_type)->Size);
+}
+
// Note: p_data, p_step, p_step_fast are _pointers_ to a memory address holding the data. For an Input widget, p_step and p_step_fast are optional.
// Read code of e.g. InputFloat(), InputInt() etc. or examples in 'Demo->Widgets->Data Types' to understand how to use this function directly.
bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_step, const void* p_step_fast, const char* format, ImGuiInputTextFlags flags)
@@ -3383,20 +3700,31 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
ImGuiContext& g = *GImGui;
ImGuiStyle& style = g.Style;
+ IM_ASSERT((flags & ImGuiInputTextFlags_EnterReturnsTrue) == 0); // Not supported by InputScalar(). Please open an issue if you this would be useful to you. Otherwise use IsItemDeactivatedAfterEdit()!
if (format == NULL)
format = DataTypeGetInfo(data_type)->PrintFmt;
+ void* p_data_default = (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasRefVal) ? &g.NextItemData.RefVal : &g.DataTypeZeroValue;
+
char buf[64];
- DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, p_data, format);
+ if ((flags & ImGuiInputTextFlags_DisplayEmptyRefVal) && DataTypeCompare(data_type, p_data, p_data_default) == 0)
+ buf[0] = 0;
+ else
+ DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, p_data, format);
- // Testing ActiveId as a minor optimization as filtering is not needed until active
- if (g.ActiveId == 0 && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0)
- flags |= InputScalar_DefaultCharsFilter(data_type, format);
- flags |= ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited; // We call MarkItemEdited() ourselves by comparing the actual data rather than the string.
+ // Disable the MarkItemEdited() call in InputText but keep ImGuiItemStatusFlags_Edited.
+ // We call MarkItemEdited() ourselves by comparing the actual data rather than the string.
+ g.NextItemData.ItemFlags |= ImGuiItemFlags_NoMarkEdited;
+ flags |= ImGuiInputTextFlags_AutoSelectAll | (ImGuiInputTextFlags)ImGuiInputTextFlags_LocalizeDecimalPoint;
bool value_changed = false;
- if (p_step != NULL)
+ if (p_step == NULL)
+ {
+ if (InputText(label, buf, IM_ARRAYSIZE(buf), flags))
+ value_changed = DataTypeApplyFromText(buf, data_type, p_data, format, (flags & ImGuiInputTextFlags_ParseEmptyRefVal) ? p_data_default : NULL);
+ }
+ else
{
const float button_size = GetFrameHeight();
@@ -3404,27 +3732,28 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
PushID(label);
SetNextItemWidth(ImMax(1.0f, CalcItemWidth() - (button_size + style.ItemInnerSpacing.x) * 2));
if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view
- value_changed = DataTypeApplyFromText(buf, data_type, p_data, format);
- IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags);
+ value_changed = DataTypeApplyFromText(buf, data_type, p_data, format, (flags & ImGuiInputTextFlags_ParseEmptyRefVal) ? p_data_default : NULL);
+ IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Inputable);
// Step buttons
const ImVec2 backup_frame_padding = style.FramePadding;
style.FramePadding.x = style.FramePadding.y;
- ImGuiButtonFlags button_flags = ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups;
if (flags & ImGuiInputTextFlags_ReadOnly)
BeginDisabled();
+ PushItemFlag(ImGuiItemFlags_ButtonRepeat, true);
SameLine(0, style.ItemInnerSpacing.x);
- if (ButtonEx("-", ImVec2(button_size, button_size), button_flags))
+ if (ButtonEx("-", ImVec2(button_size, button_size)))
{
DataTypeApplyOp(data_type, '-', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step);
value_changed = true;
}
SameLine(0, style.ItemInnerSpacing.x);
- if (ButtonEx("+", ImVec2(button_size, button_size), button_flags))
+ if (ButtonEx("+", ImVec2(button_size, button_size)))
{
DataTypeApplyOp(data_type, '+', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step);
value_changed = true;
}
+ PopItemFlag();
if (flags & ImGuiInputTextFlags_ReadOnly)
EndDisabled();
@@ -3439,11 +3768,8 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
PopID();
EndGroup();
}
- else
- {
- if (InputText(label, buf, IM_ARRAYSIZE(buf), flags))
- value_changed = DataTypeApplyFromText(buf, data_type, p_data, format);
- }
+
+ g.LastItemData.ItemFlags &= ~ImGuiItemFlags_NoMarkEdited;
if (value_changed)
MarkItemEdited(g.LastItemData.ID);
@@ -3487,7 +3813,6 @@ bool ImGui::InputScalarN(const char* label, ImGuiDataType data_type, void* p_dat
bool ImGui::InputFloat(const char* label, float* v, float step, float step_fast, const char* format, ImGuiInputTextFlags flags)
{
- flags |= ImGuiInputTextFlags_CharsScientific;
return InputScalar(label, ImGuiDataType_Float, (void*)v, (void*)(step > 0.0f ? &step : NULL), (void*)(step_fast > 0.0f ? &step_fast : NULL), format, flags);
}
@@ -3530,13 +3855,13 @@ bool ImGui::InputInt4(const char* label, int v[4], ImGuiInputTextFlags flags)
bool ImGui::InputDouble(const char* label, double* v, double step, double step_fast, const char* format, ImGuiInputTextFlags flags)
{
- flags |= ImGuiInputTextFlags_CharsScientific;
return InputScalar(label, ImGuiDataType_Double, (void*)v, (void*)(step > 0.0 ? &step : NULL), (void*)(step_fast > 0.0 ? &step_fast : NULL), format, flags);
}
//-------------------------------------------------------------------------
// [SECTION] Widgets: InputText, InputTextMultiline, InputTextWithHint
//-------------------------------------------------------------------------
+// - imstb_textedit.h include
// - InputText()
// - InputTextWithHint()
// - InputTextMultiline()
@@ -3547,6 +3872,11 @@ bool ImGui::InputDouble(const char* label, double* v, double step, double step_f
// - DebugNodeInputTextState() [Internal]
//-------------------------------------------------------------------------
+namespace ImStb
+{
+#include "imstb_textedit.h"
+}
+
bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
{
IM_ASSERT(!(flags & ImGuiInputTextFlags_Multiline)); // call InputTextMultiline()
@@ -3564,23 +3894,30 @@ bool ImGui::InputTextWithHint(const char* label, const char* hint, char* buf, si
return InputTextEx(label, hint, buf, (int)buf_size, ImVec2(0, 0), flags, callback, user_data);
}
+// This is only used in the path where the multiline widget is inactivate.
static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end)
{
int line_count = 0;
const char* s = text_begin;
- while (char c = *s++) // We are only matching for \n so we can ignore UTF-8 decoding
- if (c == '\n')
- line_count++;
- s--;
- if (s[0] != '\n' && s[0] != '\r')
+ while (true)
+ {
+ const char* s_eol = strchr(s, '\n');
line_count++;
+ if (s_eol == NULL)
+ {
+ s = s + ImStrlen(s);
+ break;
+ }
+ s = s_eol + 1;
+ }
*out_text_end = s;
return line_count;
}
-static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line)
+// FIXME: Ideally we'd share code with ImFont::CalcTextSizeA()
+static ImVec2 InputTextCalcTextSize(ImGuiContext* ctx, const char* text_begin, const char* text_end, const char** remaining, ImVec2* out_offset, bool stop_on_new_line)
{
- ImGuiContext& g = *GImGui;
+ ImGuiContext& g = *ctx;
ImFont* font = g.Font;
const float line_height = g.FontSize;
const float scale = line_height / font->FontSize;
@@ -3588,10 +3925,15 @@ static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* t
ImVec2 text_size = ImVec2(0, 0);
float line_width = 0.0f;
- const ImWchar* s = text_begin;
+ const char* s = text_begin;
while (s < text_end)
{
- unsigned int c = (unsigned int)(*s++);
+ unsigned int c = (unsigned int)*s;
+ if (c < 0x80)
+ s += 1;
+ else
+ s += ImTextCharFromUtf8(&c, s, text_end);
+
if (c == '\n')
{
text_size.x = ImMax(text_size.x, line_width);
@@ -3604,7 +3946,7 @@ static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* t
if (c == '\r')
continue;
- const float char_width = font->GetCharAdvance((ImWchar)c) * scale;
+ const float char_width = ((int)c < font->IndexAdvanceX.Size ? font->IndexAdvanceX.Data[c] : font->FallbackAdvanceX) * scale;
line_width += char_width;
}
@@ -3624,19 +3966,21 @@ static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* t
}
// Wrapper for stb_textedit.h to edit text (our wrapper is for: statically sized buffer, single-line, wchar characters. InputText converts between UTF-8 and wchar)
+// With our UTF-8 use of stb_textedit:
+// - STB_TEXTEDIT_GETCHAR is nothing more than a a "GETBYTE". It's only used to compare to ascii or to copy blocks of text so we are fine.
+// - One exception is the STB_TEXTEDIT_IS_SPACE feature which would expect a full char in order to handle full-width space such as 0x3000 (see ImCharIsBlankW).
+// - ...but we don't use that feature.
namespace ImStb
{
-
-static int STB_TEXTEDIT_STRINGLEN(const ImGuiInputTextState* obj) { return obj->CurLenW; }
-static ImWchar STB_TEXTEDIT_GETCHAR(const ImGuiInputTextState* obj, int idx) { return obj->TextW[idx]; }
-static float STB_TEXTEDIT_GETWIDTH(ImGuiInputTextState* obj, int line_start_idx, int char_idx) { ImWchar c = obj->TextW[line_start_idx + char_idx]; if (c == '\n') return STB_TEXTEDIT_GETWIDTH_NEWLINE; ImGuiContext& g = *GImGui; return g.Font->GetCharAdvance(c) * (g.FontSize / g.Font->FontSize); }
-static int STB_TEXTEDIT_KEYTOTEXT(int key) { return key >= 0x200000 ? 0 : key; }
-static ImWchar STB_TEXTEDIT_NEWLINE = '\n';
+static int STB_TEXTEDIT_STRINGLEN(const ImGuiInputTextState* obj) { return obj->TextLen; }
+static char STB_TEXTEDIT_GETCHAR(const ImGuiInputTextState* obj, int idx) { IM_ASSERT(idx <= obj->TextLen); return obj->TextSrc[idx]; }
+static float STB_TEXTEDIT_GETWIDTH(ImGuiInputTextState* obj, int line_start_idx, int char_idx) { unsigned int c; ImTextCharFromUtf8(&c, obj->TextSrc + line_start_idx + char_idx, obj->TextSrc + obj->TextLen); if ((ImWchar)c == '\n') return IMSTB_TEXTEDIT_GETWIDTH_NEWLINE; ImGuiContext& g = *obj->Ctx; return g.Font->GetCharAdvance((ImWchar)c) * g.FontScale; }
+static char STB_TEXTEDIT_NEWLINE = '\n';
static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, ImGuiInputTextState* obj, int line_start_idx)
{
- const ImWchar* text = obj->TextW.Data;
- const ImWchar* text_remaining = NULL;
- const ImVec2 size = InputTextCalcTextSizeW(text + line_start_idx, text + obj->CurLenW, &text_remaining, NULL, true);
+ const char* text = obj->TextSrc;
+ const char* text_remaining = NULL;
+ const ImVec2 size = InputTextCalcTextSize(obj->Ctx, text + line_start_idx, text + obj->TextLen, &text_remaining, NULL, true);
r->x0 = 0.0f;
r->x1 = size.x;
r->baseline_y_delta = size.y;
@@ -3645,61 +3989,137 @@ static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, ImGuiInputTextState* ob
r->num_chars = (int)(text_remaining - (text + line_start_idx));
}
-// When ImGuiInputTextFlags_Password is set, we don't want actions such as CTRL+Arrow to leak the fact that underlying data are blanks or separators.
-static bool is_separator(unsigned int c) { return ImCharIsBlankW(c) || c==',' || c==';' || c=='(' || c==')' || c=='{' || c=='}' || c=='[' || c==']' || c=='|' || c=='\n' || c=='\r'; }
-static int is_word_boundary_from_right(ImGuiInputTextState* obj, int idx) { if (obj->Flags & ImGuiInputTextFlags_Password) return 0; return idx > 0 ? (is_separator(obj->TextW[idx - 1]) && !is_separator(obj->TextW[idx]) ) : 1; }
-static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx) { if (obj->Flags & ImGuiInputTextFlags_Password) return 0; return idx > 0 ? (!is_separator(obj->TextW[idx - 1]) && is_separator(obj->TextW[idx])) : 1; }
-static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(ImGuiInputTextState* obj, int idx) { idx--; while (idx >= 0 && !is_word_boundary_from_right(obj, idx)) idx--; return idx < 0 ? 0 : idx; }
-static int STB_TEXTEDIT_MOVEWORDRIGHT_MAC(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_left(obj, idx)) idx++; return idx > len ? len : idx; }
-static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; }
-static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(ImGuiInputTextState* obj, int idx) { if (ImGui::GetIO().ConfigMacOSXBehaviors) return STB_TEXTEDIT_MOVEWORDRIGHT_MAC(obj, idx); else return STB_TEXTEDIT_MOVEWORDRIGHT_WIN(obj, idx); }
-#define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h
-#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_IMPL
+#define IMSTB_TEXTEDIT_GETNEXTCHARINDEX IMSTB_TEXTEDIT_GETNEXTCHARINDEX_IMPL
+#define IMSTB_TEXTEDIT_GETPREVCHARINDEX IMSTB_TEXTEDIT_GETPREVCHARINDEX_IMPL
-static void STB_TEXTEDIT_DELETECHARS(ImGuiInputTextState* obj, int pos, int n)
+static int IMSTB_TEXTEDIT_GETNEXTCHARINDEX_IMPL(ImGuiInputTextState* obj, int idx)
{
- ImWchar* dst = obj->TextW.Data + pos;
+ if (idx >= obj->TextLen)
+ return obj->TextLen + 1;
+ unsigned int c;
+ return idx + ImTextCharFromUtf8(&c, obj->TextSrc + idx, obj->TextSrc + obj->TextLen);
+}
- // We maintain our buffer length in both UTF-8 and wchar formats
- obj->Edited = true;
- obj->CurLenA -= ImTextCountUtf8BytesFromStr(dst, dst + n);
- obj->CurLenW -= n;
+static int IMSTB_TEXTEDIT_GETPREVCHARINDEX_IMPL(ImGuiInputTextState* obj, int idx)
+{
+ if (idx <= 0)
+ return -1;
+ const char* p = ImTextFindPreviousUtf8Codepoint(obj->TextSrc, obj->TextSrc + idx);
+ return (int)(p - obj->TextSrc);
+}
- // Offset remaining text (FIXME-OPT: Use memmove)
- const ImWchar* src = obj->TextW.Data + pos + n;
- while (ImWchar c = *src++)
- *dst++ = c;
- *dst = '\0';
+static bool ImCharIsSeparatorW(unsigned int c)
+{
+ static const unsigned int separator_list[] =
+ {
+ ',', 0x3001, '.', 0x3002, ';', 0xFF1B, '(', 0xFF08, ')', 0xFF09, '{', 0xFF5B, '}', 0xFF5D,
+ '[', 0x300C, ']', 0x300D, '|', 0xFF5C, '!', 0xFF01, '\\', 0xFFE5, '/', 0x30FB, 0xFF0F,
+ '\n', '\r',
+ };
+ for (unsigned int separator : separator_list)
+ if (c == separator)
+ return true;
+ return false;
}
-static bool STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const ImWchar* new_text, int new_text_len)
+static int is_word_boundary_from_right(ImGuiInputTextState* obj, int idx)
+{
+ // When ImGuiInputTextFlags_Password is set, we don't want actions such as CTRL+Arrow to leak the fact that underlying data are blanks or separators.
+ if ((obj->Flags & ImGuiInputTextFlags_Password) || idx <= 0)
+ return 0;
+
+ const char* curr_p = obj->TextSrc + idx;
+ const char* prev_p = ImTextFindPreviousUtf8Codepoint(obj->TextSrc, curr_p);
+ unsigned int curr_c; ImTextCharFromUtf8(&curr_c, curr_p, obj->TextSrc + obj->TextLen);
+ unsigned int prev_c; ImTextCharFromUtf8(&prev_c, prev_p, obj->TextSrc + obj->TextLen);
+
+ bool prev_white = ImCharIsBlankW(prev_c);
+ bool prev_separ = ImCharIsSeparatorW(prev_c);
+ bool curr_white = ImCharIsBlankW(curr_c);
+ bool curr_separ = ImCharIsSeparatorW(curr_c);
+ return ((prev_white || prev_separ) && !(curr_separ || curr_white)) || (curr_separ && !prev_separ);
+}
+static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx)
+{
+ if ((obj->Flags & ImGuiInputTextFlags_Password) || idx <= 0)
+ return 0;
+
+ const char* curr_p = obj->TextSrc + idx;
+ const char* prev_p = ImTextFindPreviousUtf8Codepoint(obj->TextSrc, curr_p);
+ unsigned int prev_c; ImTextCharFromUtf8(&prev_c, curr_p, obj->TextSrc + obj->TextLen);
+ unsigned int curr_c; ImTextCharFromUtf8(&curr_c, prev_p, obj->TextSrc + obj->TextLen);
+
+ bool prev_white = ImCharIsBlankW(prev_c);
+ bool prev_separ = ImCharIsSeparatorW(prev_c);
+ bool curr_white = ImCharIsBlankW(curr_c);
+ bool curr_separ = ImCharIsSeparatorW(curr_c);
+ return ((prev_white) && !(curr_separ || curr_white)) || (curr_separ && !prev_separ);
+}
+static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(ImGuiInputTextState* obj, int idx)
+{
+ idx = IMSTB_TEXTEDIT_GETPREVCHARINDEX(obj, idx);
+ while (idx >= 0 && !is_word_boundary_from_right(obj, idx))
+ idx = IMSTB_TEXTEDIT_GETPREVCHARINDEX(obj, idx);
+ return idx < 0 ? 0 : idx;
+}
+static int STB_TEXTEDIT_MOVEWORDRIGHT_MAC(ImGuiInputTextState* obj, int idx)
+{
+ int len = obj->TextLen;
+ idx = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx);
+ while (idx < len && !is_word_boundary_from_left(obj, idx))
+ idx = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx);
+ return idx > len ? len : idx;
+}
+static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx)
+{
+ idx = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx);
+ int len = obj->TextLen;
+ while (idx < len && !is_word_boundary_from_right(obj, idx))
+ idx = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx);
+ return idx > len ? len : idx;
+}
+static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(ImGuiInputTextState* obj, int idx) { ImGuiContext& g = *obj->Ctx; if (g.IO.ConfigMacOSXBehaviors) return STB_TEXTEDIT_MOVEWORDRIGHT_MAC(obj, idx); else return STB_TEXTEDIT_MOVEWORDRIGHT_WIN(obj, idx); }
+#define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h
+#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_IMPL
+
+static void STB_TEXTEDIT_DELETECHARS(ImGuiInputTextState* obj, int pos, int n)
+{
+ // Offset remaining text (+ copy zero terminator)
+ IM_ASSERT(obj->TextSrc == obj->TextA.Data);
+ char* dst = obj->TextA.Data + pos;
+ char* src = obj->TextA.Data + pos + n;
+ memmove(dst, src, obj->TextLen - n - pos + 1);
+ obj->Edited = true;
+ obj->TextLen -= n;
+}
+
+static bool STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const char* new_text, int new_text_len)
{
const bool is_resizable = (obj->Flags & ImGuiInputTextFlags_CallbackResize) != 0;
- const int text_len = obj->CurLenW;
+ const int text_len = obj->TextLen;
IM_ASSERT(pos <= text_len);
- const int new_text_len_utf8 = ImTextCountUtf8BytesFromStr(new_text, new_text + new_text_len);
- if (!is_resizable && (new_text_len_utf8 + obj->CurLenA + 1 > obj->BufCapacityA))
+ if (!is_resizable && (new_text_len + obj->TextLen + 1 > obj->BufCapacity))
return false;
// Grow internal buffer if needed
- if (new_text_len + text_len + 1 > obj->TextW.Size)
+ IM_ASSERT(obj->TextSrc == obj->TextA.Data);
+ if (new_text_len + text_len + 1 > obj->TextA.Size)
{
if (!is_resizable)
return false;
- IM_ASSERT(text_len < obj->TextW.Size);
- obj->TextW.resize(text_len + ImClamp(new_text_len * 4, 32, ImMax(256, new_text_len)) + 1);
+ obj->TextA.resize(text_len + ImClamp(new_text_len, 32, ImMax(256, new_text_len)) + 1);
+ obj->TextSrc = obj->TextA.Data;
}
- ImWchar* text = obj->TextW.Data;
+ char* text = obj->TextA.Data;
if (pos != text_len)
- memmove(text + pos + new_text_len, text + pos, (size_t)(text_len - pos) * sizeof(ImWchar));
- memcpy(text + pos, new_text, (size_t)new_text_len * sizeof(ImWchar));
+ memmove(text + pos + new_text_len, text + pos, (size_t)(text_len - pos));
+ memcpy(text + pos, new_text, (size_t)new_text_len);
obj->Edited = true;
- obj->CurLenW += new_text_len;
- obj->CurLenA += new_text_len_utf8;
- obj->TextW[obj->CurLenW] = '\0';
+ obj->TextLen += new_text_len;
+ obj->TextA[obj->TextLen] = '\0';
return true;
}
@@ -3723,15 +4143,16 @@ static bool STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const Im
#define STB_TEXTEDIT_K_PGDOWN 0x20000F // keyboard input to move cursor down a page
#define STB_TEXTEDIT_K_SHIFT 0x400000
-#define STB_TEXTEDIT_IMPLEMENTATION
+#define IMSTB_TEXTEDIT_IMPLEMENTATION
+#define IMSTB_TEXTEDIT_memmove memmove
#include "imstb_textedit.h"
// stb_textedit internally allows for a single undo record to do addition and deletion, but somehow, calling
// the stb_textedit_paste() function creates two separate records, so we perform it manually. (FIXME: Report to nothings/stb?)
-static void stb_textedit_replace(ImGuiInputTextState* str, STB_TexteditState* state, const STB_TEXTEDIT_CHARTYPE* text, int text_len)
+static void stb_textedit_replace(ImGuiInputTextState* str, STB_TexteditState* state, const IMSTB_TEXTEDIT_CHARTYPE* text, int text_len)
{
- stb_text_makeundo_replace(str, state, 0, str->CurLenW, text_len);
- ImStb::STB_TEXTEDIT_DELETECHARS(str, 0, str->CurLenW);
+ stb_text_makeundo_replace(str, state, 0, str->TextLen, text_len);
+ ImStb::STB_TEXTEDIT_DELETECHARS(str, 0, str->TextLen);
state->cursor = state->select_start = state->select_end = 0;
if (text_len <= 0)
return;
@@ -3746,29 +4167,65 @@ static void stb_textedit_replace(ImGuiInputTextState* str, STB_TexteditState* st
} // namespace ImStb
+// We added an extra indirection where 'Stb' is heap-allocated, in order facilitate the work of bindings generators.
+ImGuiInputTextState::ImGuiInputTextState()
+{
+ memset(this, 0, sizeof(*this));
+ Stb = IM_NEW(ImStbTexteditState);
+ memset(Stb, 0, sizeof(*Stb));
+}
+
+ImGuiInputTextState::~ImGuiInputTextState()
+{
+ IM_DELETE(Stb);
+}
+
void ImGuiInputTextState::OnKeyPressed(int key)
{
- stb_textedit_key(this, &Stb, key);
+ stb_textedit_key(this, Stb, key);
+ CursorFollow = true;
+ CursorAnimReset();
+}
+
+void ImGuiInputTextState::OnCharPressed(unsigned int c)
+{
+ // Convert the key to a UTF8 byte sequence.
+ // The changes we had to make to stb_textedit_key made it very much UTF-8 specific which is not too great.
+ char utf8[5];
+ ImTextCharToUtf8(utf8, c);
+ stb_textedit_text(this, Stb, utf8, (int)ImStrlen(utf8));
CursorFollow = true;
CursorAnimReset();
}
+// Those functions are not inlined in imgui_internal.h, allowing us to hide ImStbTexteditState from that header.
+void ImGuiInputTextState::CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking
+void ImGuiInputTextState::CursorClamp() { Stb->cursor = ImMin(Stb->cursor, TextLen); Stb->select_start = ImMin(Stb->select_start, TextLen); Stb->select_end = ImMin(Stb->select_end, TextLen); }
+bool ImGuiInputTextState::HasSelection() const { return Stb->select_start != Stb->select_end; }
+void ImGuiInputTextState::ClearSelection() { Stb->select_start = Stb->select_end = Stb->cursor; }
+int ImGuiInputTextState::GetCursorPos() const { return Stb->cursor; }
+int ImGuiInputTextState::GetSelectionStart() const { return Stb->select_start; }
+int ImGuiInputTextState::GetSelectionEnd() const { return Stb->select_end; }
+void ImGuiInputTextState::SelectAll() { Stb->select_start = 0; Stb->cursor = Stb->select_end = TextLen; Stb->has_preferred_x = 0; }
+void ImGuiInputTextState::ReloadUserBufAndSelectAll() { WantReloadUserBuf = true; ReloadSelectionStart = 0; ReloadSelectionEnd = INT_MAX; }
+void ImGuiInputTextState::ReloadUserBufAndKeepSelection() { WantReloadUserBuf = true; ReloadSelectionStart = Stb->select_start; ReloadSelectionEnd = Stb->select_end; }
+void ImGuiInputTextState::ReloadUserBufAndMoveToEnd() { WantReloadUserBuf = true; ReloadSelectionStart = ReloadSelectionEnd = INT_MAX; }
+
ImGuiInputTextCallbackData::ImGuiInputTextCallbackData()
{
memset(this, 0, sizeof(*this));
}
-// Public API to manipulate UTF-8 text
-// We expose UTF-8 to the user (unlike the STB_TEXTEDIT_* functions which are manipulating wchar)
+// Public API to manipulate UTF-8 text from within a callback.
// FIXME: The existence of this rarely exercised code path is a bit of a nuisance.
+// Historically they existed because STB_TEXTEDIT_INSERTCHARS() etc. worked on our ImWchar
+// buffer, but nowadays they both work on UTF-8 data. Should aim to merge both.
void ImGuiInputTextCallbackData::DeleteChars(int pos, int bytes_count)
{
IM_ASSERT(pos + bytes_count <= BufTextLen);
char* dst = Buf + pos;
const char* src = Buf + pos + bytes_count;
- while (char c = *src++)
- *dst++ = c;
- *dst = '\0';
+ memmove(dst, src, BufTextLen - bytes_count - pos + 1);
if (CursorPos >= pos + bytes_count)
CursorPos -= bytes_count;
@@ -3781,22 +4238,27 @@ void ImGuiInputTextCallbackData::DeleteChars(int pos, int bytes_count)
void ImGuiInputTextCallbackData::InsertChars(int pos, const char* new_text, const char* new_text_end)
{
+ // Accept null ranges
+ if (new_text == new_text_end)
+ return;
+
+ // Grow internal buffer if needed
const bool is_resizable = (Flags & ImGuiInputTextFlags_CallbackResize) != 0;
- const int new_text_len = new_text_end ? (int)(new_text_end - new_text) : (int)strlen(new_text);
+ const int new_text_len = new_text_end ? (int)(new_text_end - new_text) : (int)ImStrlen(new_text);
if (new_text_len + BufTextLen >= BufSize)
{
if (!is_resizable)
return;
- // Contrary to STB_TEXTEDIT_INSERTCHARS() this is working in the UTF8 buffer, hence the mildly similar code (until we remove the U16 buffer altogether!)
- ImGuiContext& g = *GImGui;
+ ImGuiContext& g = *Ctx;
ImGuiInputTextState* edit_state = &g.InputTextState;
IM_ASSERT(edit_state->ID != 0 && g.ActiveId == edit_state->ID);
IM_ASSERT(Buf == edit_state->TextA.Data);
int new_buf_size = BufTextLen + ImClamp(new_text_len * 4, 32, ImMax(256, new_text_len)) + 1;
- edit_state->TextA.reserve(new_buf_size + 1);
+ edit_state->TextA.resize(new_buf_size + 1);
+ edit_state->TextSrc = edit_state->TextA.Data;
Buf = edit_state->TextA.Data;
- BufSize = edit_state->BufCapacityA = new_buf_size;
+ BufSize = edit_state->BufCapacity = new_buf_size;
}
if (BufTextLen != pos)
@@ -3811,10 +4273,26 @@ void ImGuiInputTextCallbackData::InsertChars(int pos, const char* new_text, cons
BufTextLen += new_text_len;
}
+void ImGui::PushPasswordFont()
+{
+ ImGuiContext& g = *GImGui;
+ ImFont* in_font = g.Font;
+ ImFont* out_font = &g.InputTextPasswordFont;
+ ImFontGlyph* glyph = in_font->FindGlyph('*');
+ out_font->FontSize = in_font->FontSize;
+ out_font->Scale = in_font->Scale;
+ out_font->Ascent = in_font->Ascent;
+ out_font->Descent = in_font->Descent;
+ out_font->ContainerAtlas = in_font->ContainerAtlas;
+ out_font->FallbackGlyph = glyph;
+ out_font->FallbackAdvanceX = glyph->AdvanceX;
+ IM_ASSERT(out_font->Glyphs.Size == 0 && out_font->IndexAdvanceX.Size == 0 && out_font->IndexLookup.Size == 0);
+ PushFont(out_font);
+}
+
// Return false to discard a character.
-static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data, ImGuiInputSource input_source)
+static bool InputTextFilterCharacter(ImGuiContext* ctx, unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data, bool input_source_is_clipboard)
{
- IM_ASSERT(input_source == ImGuiInputSource_Keyboard || input_source == ImGuiInputSource_Clipboard);
unsigned int c = *p_char;
// Filter non-printable (NB: isprint is unreliable! see #2467)
@@ -3822,14 +4300,20 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
if (c < 0x20)
{
bool pass = false;
- pass |= (c == '\n' && (flags & ImGuiInputTextFlags_Multiline)); // Note that an Enter KEY will emit \r and be ignored (we poll for KEY in InputText() code)
- pass |= (c == '\t' && (flags & ImGuiInputTextFlags_AllowTabInput));
+ pass |= (c == '\n') && (flags & ImGuiInputTextFlags_Multiline) != 0; // Note that an Enter KEY will emit \r and be ignored (we poll for KEY in InputText() code)
+ if (c == '\n' && input_source_is_clipboard && (flags & ImGuiInputTextFlags_Multiline) == 0) // In single line mode, replace \n with a space
+ {
+ c = *p_char = ' ';
+ pass = true;
+ }
+ pass |= (c == '\n') && (flags & ImGuiInputTextFlags_Multiline) != 0;
+ pass |= (c == '\t') && (flags & ImGuiInputTextFlags_AllowTabInput) != 0;
if (!pass)
return false;
apply_named_filters = false; // Override named filters below so newline and tabs can still be inserted.
}
- if (input_source != ImGuiInputSource_Clipboard)
+ if (input_source_is_clipboard == false)
{
// We ignore Ascii representation of delete (emitted from Backspace on OSX, see #2578, #2817)
if (c == 127)
@@ -3845,16 +4329,19 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
return false;
// Generic named filters
- if (apply_named_filters && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific)))
+ if (apply_named_filters && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific | (ImGuiInputTextFlags)ImGuiInputTextFlags_LocalizeDecimalPoint)))
{
// The libc allows overriding locale, with e.g. 'setlocale(LC_NUMERIC, "de_DE.UTF-8");' which affect the output/input of printf/scanf to use e.g. ',' instead of '.'.
// The standard mandate that programs starts in the "C" locale where the decimal point is '.'.
// We don't really intend to provide widespread support for it, but out of empathy for people stuck with using odd API, we support the bare minimum aka overriding the decimal point.
// Change the default decimal_point with:
- // ImGui::GetCurrentContext()->PlatformLocaleDecimalPoint = *localeconv()->decimal_point;
+ // ImGui::GetPlatformIO()->Platform_LocaleDecimalPoint = *localeconv()->decimal_point;
// Users of non-default decimal point (in particular ',') may be affected by word-selection logic (is_word_boundary_from_right/is_word_boundary_from_left) functions.
- ImGuiContext& g = *GImGui;
- const unsigned c_decimal_point = (unsigned int)g.PlatformLocaleDecimalPoint;
+ ImGuiContext& g = *ctx;
+ const unsigned c_decimal_point = (unsigned int)g.PlatformIO.Platform_LocaleDecimalPoint;
+ if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsScientific | (ImGuiInputTextFlags)ImGuiInputTextFlags_LocalizeDecimalPoint))
+ if (c == '.' || c == ',')
+ c = c_decimal_point;
// Full-width -> half-width conversion for numeric fields (https://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms_(Unicode_block)
// While this is mostly convenient, this has the side-effect for uninformed users accidentally inputting full-width characters that they may
@@ -3893,8 +4380,9 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
// Custom callback filter
if (flags & ImGuiInputTextFlags_CallbackCharFilter)
{
+ ImGuiContext& g = *GImGui;
ImGuiInputTextCallbackData callback_data;
- memset(&callback_data, 0, sizeof(ImGuiInputTextCallbackData));
+ callback_data.Ctx = &g;
callback_data.EventFlag = ImGuiInputTextFlags_CallbackCharFilter;
callback_data.EventChar = (ImWchar)c;
callback_data.Flags = flags;
@@ -3909,19 +4397,11 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
return true;
}
-// Find the shortest single replacement we can make to get the new text from the old text.
-// Important: needs to be run before TextW is rewritten with the new characters because calling STB_TEXTEDIT_GETCHAR() at the end.
+// Find the shortest single replacement we can make to get from old_buf to new_buf
+// Note that this doesn't directly alter state->TextA, state->TextLen. They are expected to be made valid separately.
// FIXME: Ideally we should transition toward (1) making InsertChars()/DeleteChars() update undo-stack (2) discourage (and keep reconcile) or obsolete (and remove reconcile) accessing buffer directly.
-static void InputTextReconcileUndoStateAfterUserCallback(ImGuiInputTextState* state, const char* new_buf_a, int new_length_a)
+static void InputTextReconcileUndoState(ImGuiInputTextState* state, const char* old_buf, int old_length, const char* new_buf, int new_length)
{
- ImGuiContext& g = *GImGui;
- const ImWchar* old_buf = state->TextW.Data;
- const int old_length = state->CurLenW;
- const int new_length = ImTextCountCharsFromUtf8(new_buf_a, new_buf_a + new_length_a);
- g.TempBuffer.reserve_discard((new_length + 1) * sizeof(ImWchar));
- ImWchar* new_buf = (ImWchar*)(void*)g.TempBuffer.Data;
- ImTextStrFromUtf8(new_buf, new_length + 1, new_buf_a, new_buf_a + new_length_a);
-
const int shorter_length = ImMin(old_length, new_length);
int first_diff;
for (first_diff = 0; first_diff < shorter_length; first_diff++)
@@ -3930,7 +4410,7 @@ static void InputTextReconcileUndoStateAfterUserCallback(ImGuiInputTextState* st
if (first_diff == old_length && first_diff == new_length)
return;
- int old_last_diff = old_length - 1;
+ int old_last_diff = old_length - 1;
int new_last_diff = new_length - 1;
for (; old_last_diff >= first_diff && new_last_diff >= first_diff; old_last_diff--, new_last_diff--)
if (old_buf[old_last_diff] != new_buf[new_last_diff])
@@ -3939,9 +4419,33 @@ static void InputTextReconcileUndoStateAfterUserCallback(ImGuiInputTextState* st
const int insert_len = new_last_diff - first_diff + 1;
const int delete_len = old_last_diff - first_diff + 1;
if (insert_len > 0 || delete_len > 0)
- if (STB_TEXTEDIT_CHARTYPE* p = stb_text_createundo(&state->Stb.undostate, first_diff, delete_len, insert_len))
+ if (IMSTB_TEXTEDIT_CHARTYPE* p = stb_text_createundo(&state->Stb->undostate, first_diff, delete_len, insert_len))
for (int i = 0; i < delete_len; i++)
- p[i] = ImStb::STB_TEXTEDIT_GETCHAR(state, first_diff + i);
+ p[i] = old_buf[first_diff + i];
+}
+
+// As InputText() retain textual data and we currently provide a path for user to not retain it (via local variables)
+// we need some form of hook to reapply data back to user buffer on deactivation frame. (#4714)
+// It would be more desirable that we discourage users from taking advantage of the "user not retaining data" trick,
+// but that more likely be attractive when we do have _NoLiveEdit flag available.
+void ImGui::InputTextDeactivateHook(ImGuiID id)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiInputTextState* state = &g.InputTextState;
+ if (id == 0 || state->ID != id)
+ return;
+ g.InputTextDeactivatedState.ID = state->ID;
+ if (state->Flags & ImGuiInputTextFlags_ReadOnly)
+ {
+ g.InputTextDeactivatedState.TextA.resize(0); // In theory this data won't be used, but clear to be neat.
+ }
+ else
+ {
+ IM_ASSERT(state->TextA.Data != 0);
+ IM_ASSERT(state->TextA[state->TextLen] == 0);
+ g.InputTextDeactivatedState.TextA.resize(state->TextLen + 1);
+ memcpy(g.InputTextDeactivatedState.TextA.Data, state->TextA.Data, state->TextLen + 1);
+ }
}
// Edit a string of text
@@ -3961,6 +4465,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
IM_ASSERT(buf != NULL && buf_size >= 0);
IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackHistory) && (flags & ImGuiInputTextFlags_Multiline))); // Can't use both together (they both use up/down keys)
IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackCompletion) && (flags & ImGuiInputTextFlags_AllowTabInput))); // Can't use both together (they both use tab key)
+ IM_ASSERT(!((flags & ImGuiInputTextFlags_ElideLeft) && (flags & ImGuiInputTextFlags_Multiline))); // Multiline will not work with left-trimming
ImGuiContext& g = *GImGui;
ImGuiIO& io = g.IO;
@@ -3968,12 +4473,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
const bool RENDER_SELECTION_WHEN_INACTIVE = false;
const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0;
- const bool is_readonly = (flags & ImGuiInputTextFlags_ReadOnly) != 0;
- const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0;
- const bool is_undoable = (flags & ImGuiInputTextFlags_NoUndoRedo) == 0;
- const bool is_resizable = (flags & ImGuiInputTextFlags_CallbackResize) != 0;
- if (is_resizable)
- IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag!
if (is_multiline) // Open group before calling GetID() because groups tracks id created within their scope (including the scrollbar)
BeginGroup();
@@ -3987,7 +4486,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
ImGuiWindow* draw_window = window;
ImVec2 inner_size = frame_size;
- ImGuiItemStatusFlags item_status_flags = 0;
ImGuiLastItemData item_data_backup;
if (is_multiline)
{
@@ -3998,17 +4496,25 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
EndGroup();
return false;
}
- item_status_flags = g.LastItemData.StatusFlags;
item_data_backup = g.LastItemData;
window->DC.CursorPos = backup_pos;
+ // Prevent NavActivation from Tabbing when our widget accepts Tab inputs: this allows cycling through widgets without stopping.
+ if (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_FromTabbing) && (flags & ImGuiInputTextFlags_AllowTabInput))
+ g.NavActivateId = 0;
+
+ // Prevent NavActivate reactivating in BeginChild() when we are already active.
+ const ImGuiID backup_activate_id = g.NavActivateId;
+ if (g.ActiveId == id) // Prevent reactivation
+ g.NavActivateId = 0;
+
// We reproduce the contents of BeginChildFrame() in order to provide 'label' so our window internal data are easier to read/debug.
- // FIXME-NAV: Pressing NavActivate will trigger general child activation right before triggering our own below. Harmless but bizarre.
PushStyleColor(ImGuiCol_ChildBg, style.Colors[ImGuiCol_FrameBg]);
PushStyleVar(ImGuiStyleVar_ChildRounding, style.FrameRounding);
PushStyleVar(ImGuiStyleVar_ChildBorderSize, style.FrameBorderSize);
PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0)); // Ensure no clip rect so mouse hover can reach FramePadding edges
- bool child_visible = BeginChildEx(label, id, frame_bb.GetSize(), true, ImGuiWindowFlags_NoMove);
+ bool child_visible = BeginChildEx(label, id, frame_bb.GetSize(), ImGuiChildFlags_Borders, ImGuiWindowFlags_NoMove);
+ g.NavActivateId = backup_activate_id;
PopStyleVar(3);
PopStyleColor();
if (!child_visible)
@@ -4029,17 +4535,28 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (!(flags & ImGuiInputTextFlags_MergedItem))
if (!ItemAdd(total_bb, id, &frame_bb, ImGuiItemFlags_Inputable))
return false;
- item_status_flags = g.LastItemData.StatusFlags;
}
- const bool hovered = ItemHoverable(frame_bb, id);
+
+ // Ensure mouse cursor is set even after switching to keyboard/gamepad mode. May generalize further? (#6417)
+ bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags | ImGuiItemFlags_NoNavDisableMouseHover);
if (hovered)
- g.MouseCursor = ImGuiMouseCursor_TextInput;
+ SetMouseCursor(ImGuiMouseCursor_TextInput);
+ if (hovered && g.NavHighlightItemUnderNav)
+ hovered = false;
// We are only allowed to access the state if we are already the active widget.
ImGuiInputTextState* state = GetInputTextState(id);
- const bool input_requested_by_tabbing = (item_status_flags & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
- const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateInputId == id) || (g.NavActivateId == id && g.NavInputSource == ImGuiInputSource_Keyboard));
+ if (g.LastItemData.ItemFlags & ImGuiItemFlags_ReadOnly)
+ flags |= ImGuiInputTextFlags_ReadOnly;
+ const bool is_readonly = (flags & ImGuiInputTextFlags_ReadOnly) != 0;
+ const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0;
+ const bool is_undoable = (flags & ImGuiInputTextFlags_NoUndoRedo) == 0;
+ const bool is_resizable = (flags & ImGuiInputTextFlags_CallbackResize) != 0;
+ if (is_resizable)
+ IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag!
+
+ const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateId == id) && ((g.NavActivateFlags & ImGuiActivateFlags_PreferInput) || (g.NavInputSource == ImGuiInputSource_Keyboard)));
const bool user_clicked = hovered && io.MouseClicked[0];
const bool user_scroll_finish = is_multiline && state != NULL && g.ActiveId == 0 && g.ActiveIdPreviousFrame == GetWindowScrollbarID(draw_window, ImGuiAxis_Y);
@@ -4049,47 +4566,65 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
float scroll_y = is_multiline ? draw_window->Scroll.y : FLT_MAX;
- const bool init_changed_specs = (state != NULL && state->Stb.single_line != !is_multiline);
- const bool init_make_active = (user_clicked || user_scroll_finish || input_requested_by_nav || input_requested_by_tabbing);
+ const bool init_reload_from_user_buf = (state != NULL && state->WantReloadUserBuf);
+ const bool init_changed_specs = (state != NULL && state->Stb->single_line != !is_multiline); // state != NULL means its our state.
+ const bool init_make_active = (user_clicked || user_scroll_finish || input_requested_by_nav);
const bool init_state = (init_make_active || user_scroll_active);
- if ((init_state && g.ActiveId != id) || init_changed_specs)
+ if (init_reload_from_user_buf)
+ {
+ int new_len = (int)ImStrlen(buf);
+ IM_ASSERT(new_len + 1 <= buf_size && "Is your input buffer properly zero-terminated?");
+ state->WantReloadUserBuf = false;
+ InputTextReconcileUndoState(state, state->TextA.Data, state->TextLen, buf, new_len);
+ state->TextA.resize(buf_size + 1); // we use +1 to make sure that .Data is always pointing to at least an empty string.
+ state->TextLen = new_len;
+ memcpy(state->TextA.Data, buf, state->TextLen + 1);
+ state->Stb->select_start = state->ReloadSelectionStart;
+ state->Stb->cursor = state->Stb->select_end = state->ReloadSelectionEnd;
+ state->CursorClamp();
+ }
+ else if ((init_state && g.ActiveId != id) || init_changed_specs)
{
// Access state even if we don't own it yet.
state = &g.InputTextState;
state->CursorAnimReset();
- // Take a copy of the initial buffer value (both in original UTF-8 format and converted to wchar)
- // From the moment we focused we are ignoring the content of 'buf' (unless we are in read-only mode)
- const int buf_len = (int)strlen(buf);
- state->InitialTextA.resize(buf_len + 1); // UTF-8. we use +1 to make sure that .Data is always pointing to at least an empty string.
- memcpy(state->InitialTextA.Data, buf, buf_len + 1);
+ // Backup state of deactivating item so they'll have a chance to do a write to output buffer on the same frame they report IsItemDeactivatedAfterEdit (#4714)
+ InputTextDeactivateHook(state->ID);
+
+ // Take a copy of the initial buffer value.
+ // From the moment we focused we are normally ignoring the content of 'buf' (unless we are in read-only mode)
+ const int buf_len = (int)ImStrlen(buf);
+ IM_ASSERT(buf_len + 1 <= buf_size && "Is your input buffer properly zero-terminated?");
+ state->TextToRevertTo.resize(buf_len + 1); // UTF-8. we use +1 to make sure that .Data is always pointing to at least an empty string.
+ memcpy(state->TextToRevertTo.Data, buf, buf_len + 1);
// Preserve cursor position and undo/redo stack if we come back to same widget
- // FIXME: Since we reworked this on 2022/06, may want to differenciate recycle_cursor vs recycle_undostate?
+ // FIXME: Since we reworked this on 2022/06, may want to differentiate recycle_cursor vs recycle_undostate?
bool recycle_state = (state->ID == id && !init_changed_specs);
- if (recycle_state && (state->CurLenA != buf_len || (state->TextAIsValid && strncmp(state->TextA.Data, buf, buf_len) != 0)))
+ if (recycle_state && (state->TextLen != buf_len || (state->TextA.Data == NULL || strncmp(state->TextA.Data, buf, buf_len) != 0)))
recycle_state = false;
// Start edition
- const char* buf_end = NULL;
state->ID = id;
- state->TextW.resize(buf_size + 1); // wchar count <= UTF-8 count. we use +1 to make sure that .Data is always pointing to at least an empty string.
- state->TextA.resize(0);
- state->TextAIsValid = false; // TextA is not valid yet (we will display buf until then)
- state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, buf_size, buf, NULL, &buf_end);
- state->CurLenA = (int)(buf_end - buf); // We can't get the result from ImStrncpy() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
+ state->TextLen = buf_len;
+ if (!is_readonly)
+ {
+ state->TextA.resize(buf_size + 1); // we use +1 to make sure that .Data is always pointing to at least an empty string.
+ memcpy(state->TextA.Data, buf, state->TextLen + 1);
+ }
+
+ // Find initial scroll position for right alignment
+ state->Scroll = ImVec2(0.0f, 0.0f);
+ if (flags & ImGuiInputTextFlags_ElideLeft)
+ state->Scroll.x += ImMax(0.0f, CalcTextSize(buf).x - frame_size.x + style.FramePadding.x * 2.0f);
+ // Recycle existing cursor/selection/undo stack but clamp position
+ // Note a single mouse click will override the cursor/position immediately by calling stb_textedit_click handler.
if (recycle_state)
- {
- // Recycle existing cursor/selection/undo stack but clamp position
- // Note a single mouse click will override the cursor/position immediately by calling stb_textedit_click handler.
state->CursorClamp();
- }
else
- {
- state->ScrollX = 0.0f;
- stb_textedit_initialize_state(&state->Stb, !is_multiline);
- }
+ stb_textedit_initialize_state(state->Stb, !is_multiline);
if (!is_multiline)
{
@@ -4097,14 +4632,15 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
select_all = true;
if (input_requested_by_nav && (!recycle_state || !(g.NavActivateFlags & ImGuiActivateFlags_TryToPreserveState)))
select_all = true;
- if (input_requested_by_tabbing || (user_clicked && io.KeyCtrl))
+ if (user_clicked && io.KeyCtrl)
select_all = true;
}
if (flags & ImGuiInputTextFlags_AlwaysOverwrite)
- state->Stb.insert_mode = 1; // stb field name is indeed incorrect (see #2863)
+ state->Stb->insert_mode = 1; // stb field name is indeed incorrect (see #2863)
}
+ const bool is_osx = io.ConfigMacOSXBehaviors;
if (g.ActiveId != id && init_make_active)
{
IM_ASSERT(state && state->ID == id);
@@ -4115,21 +4651,40 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (g.ActiveId == id)
{
// Declare some inputs, the other are registered and polled via Shortcut() routing system.
+ // FIXME: The reason we don't use Shortcut() is we would need a routing flag to specify multiple mods, or to all mods combinaison into individual shortcuts.
+ const ImGuiKey always_owned_keys[] = { ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_Enter, ImGuiKey_KeypadEnter, ImGuiKey_Delete, ImGuiKey_Backspace, ImGuiKey_Home, ImGuiKey_End };
+ for (ImGuiKey key : always_owned_keys)
+ SetKeyOwner(key, id);
if (user_clicked)
SetKeyOwner(ImGuiKey_MouseLeft, id);
g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right);
if (is_multiline || (flags & ImGuiInputTextFlags_CallbackHistory))
+ {
g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down);
- SetKeyOwner(ImGuiKey_Home, id);
- SetKeyOwner(ImGuiKey_End, id);
+ SetKeyOwner(ImGuiKey_UpArrow, id);
+ SetKeyOwner(ImGuiKey_DownArrow, id);
+ }
if (is_multiline)
{
SetKeyOwner(ImGuiKey_PageUp, id);
SetKeyOwner(ImGuiKey_PageDown, id);
}
- if (flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_AllowTabInput)) // Disable keyboard tabbing out as we will use the \t character.
- SetKeyOwner(ImGuiKey_Tab, id);
+ // FIXME: May be a problem to always steal Alt on OSX, would ideally still allow an uninterrupted Alt down-up to toggle menu
+ if (is_osx)
+ SetKeyOwner(ImGuiMod_Alt, id);
+
+ // Expose scroll in a manner that is agnostic to us using a child window
+ if (is_multiline && state != NULL)
+ state->Scroll.y = draw_window->Scroll.y;
+
+ // Read-only mode always ever read from source buffer. Refresh TextLen when active.
+ if (is_readonly && state != NULL)
+ state->TextLen = (int)ImStrlen(buf);
+ //if (is_readonly && state != NULL)
+ // state->TextA.clear(); // Uncomment to facilitate debugging, but we otherwise prefer to keep/amortize th allocation.
}
+ if (state != NULL)
+ state->TextSrc = is_readonly ? buf : state->TextA.Data;
// We have an edge case if ActiveId was set through another widget (e.g. widget being swapped), clear id immediately (don't wait until the end of the function)
if (g.ActiveId == id && state == NULL)
@@ -4145,58 +4700,30 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
bool value_changed = false;
bool validated = false;
- // When read-only we always use the live data passed to the function
- // FIXME-OPT: Because our selection/cursor code currently needs the wide text we need to convert it when active, which is not ideal :(
- if (is_readonly && state != NULL && (render_cursor || render_selection))
- {
- const char* buf_end = NULL;
- state->TextW.resize(buf_size + 1);
- state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, state->TextW.Size, buf, NULL, &buf_end);
- state->CurLenA = (int)(buf_end - buf);
- state->CursorClamp();
- render_selection &= state->HasSelection();
- }
-
// Select the buffer to render.
- const bool buf_display_from_state = (render_cursor || render_selection || g.ActiveId == id) && !is_readonly && state && state->TextAIsValid;
- const bool is_displaying_hint = (hint != NULL && (buf_display_from_state ? state->TextA.Data : buf)[0] == 0);
+ const bool buf_display_from_state = (render_cursor || render_selection || g.ActiveId == id) && !is_readonly && state;
+ bool is_displaying_hint = (hint != NULL && (buf_display_from_state ? state->TextA.Data : buf)[0] == 0);
// Password pushes a temporary font with only a fallback glyph
if (is_password && !is_displaying_hint)
- {
- const ImFontGlyph* glyph = g.Font->FindGlyph('*');
- ImFont* password_font = &g.InputTextPasswordFont;
- password_font->FontSize = g.Font->FontSize;
- password_font->Scale = g.Font->Scale;
- password_font->Ascent = g.Font->Ascent;
- password_font->Descent = g.Font->Descent;
- password_font->ContainerAtlas = g.Font->ContainerAtlas;
- password_font->FallbackGlyph = glyph;
- password_font->FallbackAdvanceX = glyph->AdvanceX;
- IM_ASSERT(password_font->Glyphs.empty() && password_font->IndexAdvanceX.empty() && password_font->IndexLookup.empty());
- PushFont(password_font);
- }
+ PushPasswordFont();
// Process mouse inputs and character inputs
- int backup_current_text_length = 0;
if (g.ActiveId == id)
{
IM_ASSERT(state != NULL);
- backup_current_text_length = state->CurLenA;
state->Edited = false;
- state->BufCapacityA = buf_size;
+ state->BufCapacity = buf_size;
state->Flags = flags;
// Although we are active we don't prevent mouse from hovering other elements unless we are interacting right now with the widget.
// Down the line we should have a cleaner library-wide concept of Selected vs Active.
g.ActiveIdAllowOverlap = !io.MouseDown[0];
- g.WantTextInputNextFrame = 1;
// Edit in progress
- const float mouse_x = (io.MousePos.x - frame_bb.Min.x - style.FramePadding.x) + state->ScrollX;
+ const float mouse_x = (io.MousePos.x - frame_bb.Min.x - style.FramePadding.x) + state->Scroll.x;
const float mouse_y = (is_multiline ? (io.MousePos.y - draw_window->DC.CursorPos.y) : (g.FontSize * 0.5f));
- const bool is_osx = io.ConfigMacOSXBehaviors;
if (select_all)
{
state->SelectAll();
@@ -4204,34 +4731,34 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
else if (hovered && io.MouseClickedCount[0] >= 2 && !io.KeyShift)
{
- stb_textedit_click(state, &state->Stb, mouse_x, mouse_y);
+ stb_textedit_click(state, state->Stb, mouse_x, mouse_y);
const int multiclick_count = (io.MouseClickedCount[0] - 2);
if ((multiclick_count % 2) == 0)
{
// Double-click: Select word
// We always use the "Mac" word advance for double-click select vs CTRL+Right which use the platform dependent variant:
// FIXME: There are likely many ways to improve this behavior, but there's no "right" behavior (depends on use-case, software, OS)
- const bool is_bol = (state->Stb.cursor == 0) || ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb.cursor - 1) == '\n';
- if (STB_TEXT_HAS_SELECTION(&state->Stb) || !is_bol)
+ const bool is_bol = (state->Stb->cursor == 0) || ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb->cursor - 1) == '\n';
+ if (STB_TEXT_HAS_SELECTION(state->Stb) || !is_bol)
state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT);
//state->OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT);
- if (!STB_TEXT_HAS_SELECTION(&state->Stb))
- ImStb::stb_textedit_prep_selection_at_cursor(&state->Stb);
- state->Stb.cursor = ImStb::STB_TEXTEDIT_MOVEWORDRIGHT_MAC(state, state->Stb.cursor);
- state->Stb.select_end = state->Stb.cursor;
- ImStb::stb_textedit_clamp(state, &state->Stb);
+ if (!STB_TEXT_HAS_SELECTION(state->Stb))
+ ImStb::stb_textedit_prep_selection_at_cursor(state->Stb);
+ state->Stb->cursor = ImStb::STB_TEXTEDIT_MOVEWORDRIGHT_MAC(state, state->Stb->cursor);
+ state->Stb->select_end = state->Stb->cursor;
+ ImStb::stb_textedit_clamp(state, state->Stb);
}
else
{
// Triple-click: Select line
- const bool is_eol = ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb.cursor) == '\n';
+ const bool is_eol = ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb->cursor) == '\n';
state->OnKeyPressed(STB_TEXTEDIT_K_LINESTART);
state->OnKeyPressed(STB_TEXTEDIT_K_LINEEND | STB_TEXTEDIT_K_SHIFT);
state->OnKeyPressed(STB_TEXTEDIT_K_RIGHT | STB_TEXTEDIT_K_SHIFT);
if (!is_eol && is_multiline)
{
- ImSwap(state->Stb.select_start, state->Stb.select_end);
- state->Stb.cursor = state->Stb.select_end;
+ ImSwap(state->Stb->select_start, state->Stb->select_end);
+ state->Stb->cursor = state->Stb->select_end;
}
state->CursorFollow = false;
}
@@ -4242,15 +4769,15 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (hovered)
{
if (io.KeyShift)
- stb_textedit_drag(state, &state->Stb, mouse_x, mouse_y);
+ stb_textedit_drag(state, state->Stb, mouse_x, mouse_y);
else
- stb_textedit_click(state, &state->Stb, mouse_x, mouse_y);
+ stb_textedit_click(state, state->Stb, mouse_x, mouse_y);
state->CursorAnimReset();
}
}
else if (io.MouseDown[0] && !state->SelectedAllMouseLock && (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f))
{
- stb_textedit_drag(state, &state->Stb, mouse_x, mouse_y);
+ stb_textedit_drag(state, state->Stb, mouse_x, mouse_y);
state->CursorAnimReset();
state->CursorFollow = true;
}
@@ -4259,16 +4786,25 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// We expect backends to emit a Tab key but some also emit a Tab character which we ignore (#2467, #1336)
// (For Tab and Enter: Win32/SFML/Allegro are sending both keys and chars, GLFW and SDL are only sending keys. For Space they all send all threes)
- const bool ignore_char_inputs = (io.KeyCtrl && !io.KeyAlt) || (is_osx && io.KeySuper);
- if ((flags & ImGuiInputTextFlags_AllowTabInput) && IsKeyPressed(ImGuiKey_Tab) && !ignore_char_inputs && !io.KeyShift && !is_readonly)
+ if ((flags & ImGuiInputTextFlags_AllowTabInput) && !is_readonly)
{
- unsigned int c = '\t'; // Insert TAB
- if (InputTextFilterCharacter(&c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard))
- state->OnKeyPressed((int)c);
+ if (Shortcut(ImGuiKey_Tab, ImGuiInputFlags_Repeat, id))
+ {
+ unsigned int c = '\t'; // Insert TAB
+ if (InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data))
+ state->OnCharPressed(c);
+ }
+ // FIXME: Implement Shift+Tab
+ /*
+ if (Shortcut(ImGuiKey_Tab | ImGuiMod_Shift, ImGuiInputFlags_Repeat, id))
+ {
+ }
+ */
}
// Process regular text input (before we check for Return because using some IME will effectively send a Return?)
// We ignore CTRL inputs, but need to allow ALT+CTRL as some keyboards (e.g. German) use AltGR (which _is_ Alt+Ctrl) to input certain characters.
+ const bool ignore_char_inputs = (io.KeyCtrl && !io.KeyAlt) || (is_osx && io.KeyCtrl);
if (io.InputQueueCharacters.Size > 0)
{
if (!ignore_char_inputs && !is_readonly && !input_requested_by_nav)
@@ -4278,8 +4814,8 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
unsigned int c = (unsigned int)io.InputQueueCharacters[n];
if (c == '\t') // Skip Tab, see above.
continue;
- if (InputTextFilterCharacter(&c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard))
- state->OnKeyPressed((int)c);
+ if (InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data))
+ state->OnCharPressed(c);
}
// Consume characters
@@ -4294,30 +4830,30 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
IM_ASSERT(state != NULL);
const int row_count_per_page = ImMax((int)((inner_size.y - style.FramePadding.y) / g.FontSize), 1);
- state->Stb.row_count_per_page = row_count_per_page;
+ state->Stb->row_count_per_page = row_count_per_page;
const int k_mask = (io.KeyShift ? STB_TEXTEDIT_K_SHIFT : 0);
- const bool is_osx = io.ConfigMacOSXBehaviors;
const bool is_wordmove_key_down = is_osx ? io.KeyAlt : io.KeyCtrl; // OS X style: Text editing cursor movement using Alt instead of Ctrl
- const bool is_startend_key_down = is_osx && io.KeySuper && !io.KeyCtrl && !io.KeyAlt; // OS X style: Line/Text Start and End using Cmd+Arrows instead of Home/End
+ const bool is_startend_key_down = is_osx && io.KeyCtrl && !io.KeySuper && !io.KeyAlt; // OS X style: Line/Text Start and End using Cmd+Arrows instead of Home/End
- // Using Shortcut() with ImGuiInputFlags_RouteFocused (default policy) to allow routing operations for other code (e.g. calling window trying to use CTRL+A and CTRL+B: formet would be handled by InputText)
+ // Using Shortcut() with ImGuiInputFlags_RouteFocused (default policy) to allow routing operations for other code (e.g. calling window trying to use CTRL+A and CTRL+B: former would be handled by InputText)
// Otherwise we could simply assume that we own the keys as we are active.
const ImGuiInputFlags f_repeat = ImGuiInputFlags_Repeat;
- const bool is_cut = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_X, id, f_repeat) || Shortcut(ImGuiMod_Shift | ImGuiKey_Delete, id, f_repeat)) && !is_readonly && !is_password && (!is_multiline || state->HasSelection());
- const bool is_copy = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_C, id) || Shortcut(ImGuiMod_Ctrl | ImGuiKey_Insert, id)) && !is_password && (!is_multiline || state->HasSelection());
- const bool is_paste = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_V, id, f_repeat) || Shortcut(ImGuiMod_Shift | ImGuiKey_Insert, id, f_repeat)) && !is_readonly;
- const bool is_undo = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_Z, id, f_repeat)) && !is_readonly && is_undoable;
- const bool is_redo = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_Y, id, f_repeat) || (is_osx && Shortcut(ImGuiMod_Shortcut | ImGuiMod_Shift | ImGuiKey_Z, id, f_repeat))) && !is_readonly && is_undoable;
- const bool is_select_all = Shortcut(ImGuiMod_Shortcut | ImGuiKey_A, id);
+ const bool is_cut = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_X, f_repeat, id) || Shortcut(ImGuiMod_Shift | ImGuiKey_Delete, f_repeat, id)) && !is_readonly && !is_password && (!is_multiline || state->HasSelection());
+ const bool is_copy = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_C, 0, id) || Shortcut(ImGuiMod_Ctrl | ImGuiKey_Insert, 0, id)) && !is_password && (!is_multiline || state->HasSelection());
+ const bool is_paste = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_V, f_repeat, id) || Shortcut(ImGuiMod_Shift | ImGuiKey_Insert, f_repeat, id)) && !is_readonly;
+ const bool is_undo = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_Z, f_repeat, id)) && !is_readonly && is_undoable;
+ const bool is_redo = (Shortcut(ImGuiMod_Ctrl | ImGuiKey_Y, f_repeat, id) || Shortcut(ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Z, f_repeat, id)) && !is_readonly && is_undoable;
+ const bool is_select_all = Shortcut(ImGuiMod_Ctrl | ImGuiKey_A, 0, id);
// We allow validate/cancel with Nav source (gamepad) to makes it easier to undo an accidental NavInput press with no keyboard wired, but otherwise it isn't very useful.
const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
const bool is_enter_pressed = IsKeyPressed(ImGuiKey_Enter, true) || IsKeyPressed(ImGuiKey_KeypadEnter, true);
const bool is_gamepad_validate = nav_gamepad_active && (IsKeyPressed(ImGuiKey_NavGamepadActivate, false) || IsKeyPressed(ImGuiKey_NavGamepadInput, false));
- const bool is_cancel = Shortcut(ImGuiKey_Escape, id, f_repeat) || (nav_gamepad_active && Shortcut(ImGuiKey_NavGamepadCancel, id, f_repeat));
+ const bool is_cancel = Shortcut(ImGuiKey_Escape, f_repeat, id) || (nav_gamepad_active && Shortcut(ImGuiKey_NavGamepadCancel, f_repeat, id));
// FIXME: Should use more Shortcut() and reduce IsKeyPressed()+SetKeyOwner(), but requires modifiers combination to be taken account of.
+ // FIXME-OSX: Missing support for Alt(option)+Right/Left = go to end of line, or next line if already in end of line.
if (IsKeyPressed(ImGuiKey_LeftArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINESTART : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDLEFT : STB_TEXTEDIT_K_LEFT) | k_mask); }
else if (IsKeyPressed(ImGuiKey_RightArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINEEND : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDRIGHT : STB_TEXTEDIT_K_RIGHT) | k_mask); }
else if (IsKeyPressed(ImGuiKey_UpArrow) && is_multiline) { if (io.KeyCtrl) SetScrollY(draw_window, ImMax(draw_window->Scroll.y - g.FontSize, 0.0f)); else state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTSTART : STB_TEXTEDIT_K_UP) | k_mask); }
@@ -4326,14 +4862,23 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
else if (IsKeyPressed(ImGuiKey_PageDown) && is_multiline) { state->OnKeyPressed(STB_TEXTEDIT_K_PGDOWN | k_mask); scroll_y += row_count_per_page * g.FontSize; }
else if (IsKeyPressed(ImGuiKey_Home)) { state->OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTSTART | k_mask : STB_TEXTEDIT_K_LINESTART | k_mask); }
else if (IsKeyPressed(ImGuiKey_End)) { state->OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTEND | k_mask : STB_TEXTEDIT_K_LINEEND | k_mask); }
- else if (IsKeyPressed(ImGuiKey_Delete) && !is_readonly && !is_cut) { state->OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask); }
+ else if (IsKeyPressed(ImGuiKey_Delete) && !is_readonly && !is_cut)
+ {
+ if (!state->HasSelection())
+ {
+ // OSX doesn't seem to have Super+Delete to delete until end-of-line, so we don't emulate that (as opposed to Super+Backspace)
+ if (is_wordmove_key_down)
+ state->OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT);
+ }
+ state->OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask);
+ }
else if (IsKeyPressed(ImGuiKey_Backspace) && !is_readonly)
{
if (!state->HasSelection())
{
if (is_wordmove_key_down)
state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT | STB_TEXTEDIT_K_SHIFT);
- else if (is_osx && io.KeySuper && !io.KeyAlt && !io.KeyCtrl)
+ else if (is_osx && io.KeyCtrl && !io.KeyAlt && !io.KeySuper)
state->OnKeyPressed(STB_TEXTEDIT_K_LINESTART | STB_TEXTEDIT_K_SHIFT);
}
state->OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask);
@@ -4353,15 +4898,15 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
else if (!is_readonly)
{
unsigned int c = '\n'; // Insert new line
- if (InputTextFilterCharacter(&c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard))
- state->OnKeyPressed((int)c);
+ if (InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data))
+ state->OnCharPressed(c);
}
}
else if (is_cancel)
{
if (flags & ImGuiInputTextFlags_EscapeClearsAll)
{
- if (state->CurLenA > 0)
+ if (buf[0] != 0)
{
revert_edit = true;
}
@@ -4390,22 +4935,22 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
else if (is_cut || is_copy)
{
// Cut, Copy
- if (io.SetClipboardTextFn)
+ if (g.PlatformIO.Platform_SetClipboardTextFn != NULL)
{
- const int ib = state->HasSelection() ? ImMin(state->Stb.select_start, state->Stb.select_end) : 0;
- const int ie = state->HasSelection() ? ImMax(state->Stb.select_start, state->Stb.select_end) : state->CurLenW;
- const int clipboard_data_len = ImTextCountUtf8BytesFromStr(state->TextW.Data + ib, state->TextW.Data + ie) + 1;
- char* clipboard_data = (char*)IM_ALLOC(clipboard_data_len * sizeof(char));
- ImTextStrToUtf8(clipboard_data, clipboard_data_len, state->TextW.Data + ib, state->TextW.Data + ie);
- SetClipboardText(clipboard_data);
- MemFree(clipboard_data);
+ // SetClipboardText() only takes null terminated strings + state->TextSrc may point to read-only user buffer, so we need to make a copy.
+ const int ib = state->HasSelection() ? ImMin(state->Stb->select_start, state->Stb->select_end) : 0;
+ const int ie = state->HasSelection() ? ImMax(state->Stb->select_start, state->Stb->select_end) : state->TextLen;
+ g.TempBuffer.reserve(ie - ib + 1);
+ memcpy(g.TempBuffer.Data, state->TextSrc + ib, ie - ib);
+ g.TempBuffer.Data[ie - ib] = 0;
+ SetClipboardText(g.TempBuffer.Data);
}
if (is_cut)
{
if (!state->HasSelection())
state->SelectAll();
state->CursorFollow = true;
- stb_textedit_cut(state, &state->Stb);
+ stb_textedit_cut(state, state->Stb);
}
}
else if (is_paste)
@@ -4413,26 +4958,28 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (const char* clipboard = GetClipboardText())
{
// Filter pasted buffer
- const int clipboard_len = (int)strlen(clipboard);
- ImWchar* clipboard_filtered = (ImWchar*)IM_ALLOC((clipboard_len + 1) * sizeof(ImWchar));
- int clipboard_filtered_len = 0;
- for (const char* s = clipboard; *s; )
+ const int clipboard_len = (int)ImStrlen(clipboard);
+ ImVector<char> clipboard_filtered;
+ clipboard_filtered.reserve(clipboard_len + 1);
+ for (const char* s = clipboard; *s != 0; )
{
unsigned int c;
- s += ImTextCharFromUtf8(&c, s, NULL);
- if (c == 0)
- break;
- if (!InputTextFilterCharacter(&c, flags, callback, callback_user_data, ImGuiInputSource_Clipboard))
+ int in_len = ImTextCharFromUtf8(&c, s, NULL);
+ s += in_len;
+ if (!InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data, true))
continue;
- clipboard_filtered[clipboard_filtered_len++] = (ImWchar)c;
+ char c_utf8[5];
+ ImTextCharToUtf8(c_utf8, c);
+ int out_len = (int)ImStrlen(c_utf8);
+ clipboard_filtered.resize(clipboard_filtered.Size + out_len);
+ memcpy(clipboard_filtered.Data + clipboard_filtered.Size - out_len, c_utf8, out_len);
}
- clipboard_filtered[clipboard_filtered_len] = 0;
- if (clipboard_filtered_len > 0) // If everything was filtered, ignore the pasting operation
+ if (clipboard_filtered.Size > 0) // If everything was filtered, ignore the pasting operation
{
- stb_textedit_paste(state, &state->Stb, clipboard_filtered, clipboard_filtered_len);
+ clipboard_filtered.push_back(0);
+ stb_textedit_paste(state, state->Stb, clipboard_filtered.Data, clipboard_filtered.Size - 1);
state->CursorFollow = true;
}
- MemFree(clipboard_filtered);
}
}
@@ -4451,45 +4998,36 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (flags & ImGuiInputTextFlags_EscapeClearsAll)
{
// Clear input
+ IM_ASSERT(buf[0] != 0);
apply_new_text = "";
apply_new_text_length = 0;
- STB_TEXTEDIT_CHARTYPE empty_string;
- stb_textedit_replace(state, &state->Stb, &empty_string, 0);
+ value_changed = true;
+ IMSTB_TEXTEDIT_CHARTYPE empty_string;
+ stb_textedit_replace(state, state->Stb, &empty_string, 0);
}
- else if (strcmp(buf, state->InitialTextA.Data) != 0)
+ else if (strcmp(buf, state->TextToRevertTo.Data) != 0)
{
+ apply_new_text = state->TextToRevertTo.Data;
+ apply_new_text_length = state->TextToRevertTo.Size - 1;
+
// Restore initial value. Only return true if restoring to the initial value changes the current buffer contents.
// Push records into the undo stack so we can CTRL+Z the revert operation itself
- apply_new_text = state->InitialTextA.Data;
- apply_new_text_length = state->InitialTextA.Size - 1;
- ImVector<ImWchar> w_text;
- if (apply_new_text_length > 0)
- {
- w_text.resize(ImTextCountCharsFromUtf8(apply_new_text, apply_new_text + apply_new_text_length) + 1);
- ImTextStrFromUtf8(w_text.Data, w_text.Size, apply_new_text, apply_new_text + apply_new_text_length);
- }
- stb_textedit_replace(state, &state->Stb, w_text.Data, (apply_new_text_length > 0) ? (w_text.Size - 1) : 0);
+ value_changed = true;
+ stb_textedit_replace(state, state->Stb, state->TextToRevertTo.Data, state->TextToRevertTo.Size - 1);
}
}
- // Apply ASCII value
- if (!is_readonly)
- {
- state->TextAIsValid = true;
- state->TextA.resize(state->TextW.Size * 4 + 1);
- ImTextStrToUtf8(state->TextA.Data, state->TextA.Size, state->TextW.Data, NULL);
- }
-
- // When using 'ImGuiInputTextFlags_EnterReturnsTrue' as a special case we reapply the live buffer back to the input buffer before clearing ActiveId, even though strictly speaking it wasn't modified on this frame.
- // If we didn't do that, code like InputInt() with ImGuiInputTextFlags_EnterReturnsTrue would fail.
- // This also allows the user to use InputText() with ImGuiInputTextFlags_EnterReturnsTrue without maintaining any user-side storage (please note that if you use this property along ImGuiInputTextFlags_CallbackResize you can end up with your temporary string object unnecessarily allocating once a frame, either store your string data, either if you don't then don't use ImGuiInputTextFlags_CallbackResize).
- const bool apply_edit_back_to_user_buffer = !revert_edit || (validated && (flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0);
+ // FIXME-OPT: We always reapply the live buffer back to the input buffer before clearing ActiveId,
+ // even though strictly speaking it wasn't modified on this frame. Should mark dirty state from the stb_textedit callbacks.
+ // If we do that, need to ensure that as special case, 'validated == true' also writes back.
+ // This also allows the user to use InputText() without maintaining any user-side storage.
+ // (please note that if you use this property along ImGuiInputTextFlags_CallbackResize you can end up with your temporary string object
+ // unnecessarily allocating once a frame, either store your string data, either if you don't then don't use ImGuiInputTextFlags_CallbackResize).
+ const bool apply_edit_back_to_user_buffer = true;// !revert_edit || (validated && (flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0);
if (apply_edit_back_to_user_buffer)
{
- // Apply new value immediately - copy modified buffer back
+ // Apply current edited text immediately.
// Note that as soon as the input box is active, the in-widget value gets priority over any underlying modification of the input buffer
- // FIXME: We actually always render 'buf' when calling DrawList->AddText, making the comment above incorrect.
- // FIXME-OPT: CPU waste to do this every time the widget is active, should mark dirty state from the stb_textedit callbacks.
// User callback
if ((flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory | ImGuiInputTextFlags_CallbackEdit | ImGuiInputTextFlags_CallbackAlways)) != 0)
@@ -4499,7 +5037,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// The reason we specify the usage semantic (Completion/History) is that Completion needs to disable keyboard TABBING at the moment.
ImGuiInputTextFlags event_flag = 0;
ImGuiKey event_key = ImGuiKey_None;
- if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && IsKeyPressed(ImGuiKey_Tab))
+ if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && Shortcut(ImGuiKey_Tab, 0, id))
{
event_flag = ImGuiInputTextFlags_CallbackCompletion;
event_key = ImGuiKey_Tab;
@@ -4526,23 +5064,26 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (event_flag)
{
ImGuiInputTextCallbackData callback_data;
- memset(&callback_data, 0, sizeof(ImGuiInputTextCallbackData));
+ callback_data.Ctx = &g;
callback_data.EventFlag = event_flag;
callback_data.Flags = flags;
callback_data.UserData = callback_user_data;
+ // FIXME-OPT: Undo stack reconcile needs a backup of the data until we rework API, see #7925
char* callback_buf = is_readonly ? buf : state->TextA.Data;
+ IM_ASSERT(callback_buf == state->TextSrc);
+ state->CallbackTextBackup.resize(state->TextLen + 1);
+ memcpy(state->CallbackTextBackup.Data, callback_buf, state->TextLen + 1);
+
callback_data.EventKey = event_key;
callback_data.Buf = callback_buf;
- callback_data.BufTextLen = state->CurLenA;
- callback_data.BufSize = state->BufCapacityA;
+ callback_data.BufTextLen = state->TextLen;
+ callback_data.BufSize = state->BufCapacity;
callback_data.BufDirty = false;
- // We have to convert from wchar-positions to UTF-8-positions, which can be pretty slow (an incentive to ditch the ImWchar buffer, see https://github.com/nothings/stb/issues/188)
- ImWchar* text = state->TextW.Data;
- const int utf8_cursor_pos = callback_data.CursorPos = ImTextCountUtf8BytesFromStr(text, text + state->Stb.cursor);
- const int utf8_selection_start = callback_data.SelectionStart = ImTextCountUtf8BytesFromStr(text, text + state->Stb.select_start);
- const int utf8_selection_end = callback_data.SelectionEnd = ImTextCountUtf8BytesFromStr(text, text + state->Stb.select_end);
+ const int utf8_cursor_pos = callback_data.CursorPos = state->Stb->cursor;
+ const int utf8_selection_start = callback_data.SelectionStart = state->Stb->select_start;
+ const int utf8_selection_end = callback_data.SelectionEnd = state->Stb->select_end;
// Call user code
callback(&callback_data);
@@ -4550,45 +5091,57 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// Read back what user may have modified
callback_buf = is_readonly ? buf : state->TextA.Data; // Pointer may have been invalidated by a resize callback
IM_ASSERT(callback_data.Buf == callback_buf); // Invalid to modify those fields
- IM_ASSERT(callback_data.BufSize == state->BufCapacityA);
+ IM_ASSERT(callback_data.BufSize == state->BufCapacity);
IM_ASSERT(callback_data.Flags == flags);
const bool buf_dirty = callback_data.BufDirty;
- if (callback_data.CursorPos != utf8_cursor_pos || buf_dirty) { state->Stb.cursor = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.CursorPos); state->CursorFollow = true; }
- if (callback_data.SelectionStart != utf8_selection_start || buf_dirty) { state->Stb.select_start = (callback_data.SelectionStart == callback_data.CursorPos) ? state->Stb.cursor : ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionStart); }
- if (callback_data.SelectionEnd != utf8_selection_end || buf_dirty) { state->Stb.select_end = (callback_data.SelectionEnd == callback_data.SelectionStart) ? state->Stb.select_start : ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd); }
+ if (callback_data.CursorPos != utf8_cursor_pos || buf_dirty) { state->Stb->cursor = callback_data.CursorPos; state->CursorFollow = true; }
+ if (callback_data.SelectionStart != utf8_selection_start || buf_dirty) { state->Stb->select_start = (callback_data.SelectionStart == callback_data.CursorPos) ? state->Stb->cursor : callback_data.SelectionStart; }
+ if (callback_data.SelectionEnd != utf8_selection_end || buf_dirty) { state->Stb->select_end = (callback_data.SelectionEnd == callback_data.SelectionStart) ? state->Stb->select_start : callback_data.SelectionEnd; }
if (buf_dirty)
{
- IM_ASSERT((flags & ImGuiInputTextFlags_ReadOnly) == 0);
- IM_ASSERT(callback_data.BufTextLen == (int)strlen(callback_data.Buf)); // You need to maintain BufTextLen if you change the text!
- InputTextReconcileUndoStateAfterUserCallback(state, callback_data.Buf, callback_data.BufTextLen); // FIXME: Move the rest of this block inside function and rename to InputTextReconcileStateAfterUserCallback() ?
- if (callback_data.BufTextLen > backup_current_text_length && is_resizable)
- state->TextW.resize(state->TextW.Size + (callback_data.BufTextLen - backup_current_text_length)); // Worse case scenario resize
- state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, state->TextW.Size, callback_data.Buf, NULL);
- state->CurLenA = callback_data.BufTextLen; // Assume correct length and valid UTF-8 from user, saves us an extra strlen()
+ // Callback may update buffer and thus set buf_dirty even in read-only mode.
+ IM_ASSERT(callback_data.BufTextLen == (int)ImStrlen(callback_data.Buf)); // You need to maintain BufTextLen if you change the text!
+ InputTextReconcileUndoState(state, state->CallbackTextBackup.Data, state->CallbackTextBackup.Size - 1, callback_data.Buf, callback_data.BufTextLen);
+ state->TextLen = callback_data.BufTextLen; // Assume correct length and valid UTF-8 from user, saves us an extra strlen()
state->CursorAnimReset();
}
}
}
// Will copy result string if modified
- if (!is_readonly && strcmp(state->TextA.Data, buf) != 0)
+ if (!is_readonly && strcmp(state->TextSrc, buf) != 0)
{
- apply_new_text = state->TextA.Data;
- apply_new_text_length = state->CurLenA;
+ apply_new_text = state->TextSrc;
+ apply_new_text_length = state->TextLen;
+ value_changed = true;
}
}
}
+ // Handle reapplying final data on deactivation (see InputTextDeactivateHook() for details)
+ if (g.InputTextDeactivatedState.ID == id)
+ {
+ if (g.ActiveId != id && IsItemDeactivatedAfterEdit() && !is_readonly && strcmp(g.InputTextDeactivatedState.TextA.Data, buf) != 0)
+ {
+ apply_new_text = g.InputTextDeactivatedState.TextA.Data;
+ apply_new_text_length = g.InputTextDeactivatedState.TextA.Size - 1;
+ value_changed = true;
+ //IMGUI_DEBUG_LOG("InputText(): apply Deactivated data for 0x%08X: \"%.*s\".\n", id, apply_new_text_length, apply_new_text);
+ }
+ g.InputTextDeactivatedState.ID = 0;
+ }
+
// Copy result to user buffer. This can currently only happen when (g.ActiveId == id)
if (apply_new_text != NULL)
{
- // We cannot test for 'backup_current_text_length != apply_new_text_length' here because we have no guarantee that the size
- // of our owned buffer matches the size of the string object held by the user, and by design we allow InputText() to be used
- // without any storage on user's side.
+ //// We cannot test for 'backup_current_text_length != apply_new_text_length' here because we have no guarantee that the size
+ //// of our owned buffer matches the size of the string object held by the user, and by design we allow InputText() to be used
+ //// without any storage on user's side.
IM_ASSERT(apply_new_text_length >= 0);
if (is_resizable)
{
ImGuiInputTextCallbackData callback_data;
+ callback_data.Ctx = &g;
callback_data.EventFlag = ImGuiInputTextFlags_CallbackResize;
callback_data.Flags = flags;
callback_data.Buf = buf;
@@ -4605,17 +5158,19 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// If the underlying buffer resize was denied or not carried to the next frame, apply_new_text_length+1 may be >= buf_size.
ImStrncpy(buf, apply_new_text, ImMin(apply_new_text_length + 1, buf_size));
- value_changed = true;
}
// Release active ID at the end of the function (so e.g. pressing Return still does a final application of the value)
- if (clear_active_id && g.ActiveId == id)
+ // Otherwise request text input ahead for next frame.
+ if (g.ActiveId == id && clear_active_id)
ClearActiveID();
+ else if (g.ActiveId == id)
+ g.WantTextInputNextFrame = 1;
// Render frame
if (!is_multiline)
{
- RenderNavHighlight(frame_bb, id);
+ RenderNavCursor(frame_bb, id);
RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding);
}
@@ -4629,10 +5184,22 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
const int buf_display_max_length = 2 * 1024 * 1024;
const char* buf_display = buf_display_from_state ? state->TextA.Data : buf; //-V595
const char* buf_display_end = NULL; // We have specialized paths below for setting the length
+
+ // Display hint when contents is empty
+ // At this point we need to handle the possibility that a callback could have modified the underlying buffer (#8368)
+ const bool new_is_displaying_hint = (hint != NULL && (buf_display_from_state ? state->TextA.Data : buf)[0] == 0);
+ if (new_is_displaying_hint != is_displaying_hint)
+ {
+ if (is_password && !is_displaying_hint)
+ PopFont();
+ is_displaying_hint = new_is_displaying_hint;
+ if (is_password && !is_displaying_hint)
+ PushPasswordFont();
+ }
if (is_displaying_hint)
{
buf_display = hint;
- buf_display_end = hint + strlen(hint);
+ buf_display_end = hint + ImStrlen(hint);
}
// Render text. We currently only render selection when the widget is active or while scrolling.
@@ -4641,7 +5208,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
{
IM_ASSERT(state != NULL);
if (!is_displaying_hint)
- buf_display_end = buf_display + state->CurLenA;
+ buf_display_end = buf_display + state->TextLen;
// Render text (with cursor and selection)
// This is going to be messy. We need to:
@@ -4650,52 +5217,40 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// - Measure text height (for scrollbar)
// We are attempting to do most of that in **one main pass** to minimize the computation cost (non-negligible for large amount of text) + 2nd pass for selection rendering (we could merge them by an extra refactoring effort)
// FIXME: This should occur on buf_display but we'd need to maintain cursor/select_start/select_end for UTF-8.
- const ImWchar* text_begin = state->TextW.Data;
+ const char* text_begin = buf_display;
+ const char* text_end = text_begin + state->TextLen;
ImVec2 cursor_offset, select_start_offset;
{
- // Find lines numbers straddling 'cursor' (slot 0) and 'select_start' (slot 1) positions.
- const ImWchar* searches_input_ptr[2] = { NULL, NULL };
- int searches_result_line_no[2] = { -1000, -1000 };
- int searches_remaining = 0;
- if (render_cursor)
- {
- searches_input_ptr[0] = text_begin + state->Stb.cursor;
- searches_result_line_no[0] = -1;
- searches_remaining++;
- }
- if (render_selection)
+ // Find lines numbers straddling cursor and selection min position
+ int cursor_line_no = render_cursor ? -1 : -1000;
+ int selmin_line_no = render_selection ? -1 : -1000;
+ const char* cursor_ptr = render_cursor ? text_begin + state->Stb->cursor : NULL;
+ const char* selmin_ptr = render_selection ? text_begin + ImMin(state->Stb->select_start, state->Stb->select_end) : NULL;
+
+ // Count lines and find line number for cursor and selection ends
+ int line_count = 1;
+ if (is_multiline)
{
- searches_input_ptr[1] = text_begin + ImMin(state->Stb.select_start, state->Stb.select_end);
- searches_result_line_no[1] = -1;
- searches_remaining++;
- }
-
- // Iterate all lines to find our line numbers
- // In multi-line mode, we never exit the loop until all lines are counted, so add one extra to the searches_remaining counter.
- searches_remaining += is_multiline ? 1 : 0;
- int line_count = 0;
- //for (const ImWchar* s = text_begin; (s = (const ImWchar*)wcschr((const wchar_t*)s, (wchar_t)'\n')) != NULL; s++) // FIXME-OPT: Could use this when wchar_t are 16-bit
- for (const ImWchar* s = text_begin; *s != 0; s++)
- if (*s == '\n')
+ for (const char* s = text_begin; (s = (const char*)ImMemchr(s, '\n', (size_t)(text_end - s))) != NULL; s++)
{
+ if (cursor_line_no == -1 && s >= cursor_ptr) { cursor_line_no = line_count; }
+ if (selmin_line_no == -1 && s >= selmin_ptr) { selmin_line_no = line_count; }
line_count++;
- if (searches_result_line_no[0] == -1 && s >= searches_input_ptr[0]) { searches_result_line_no[0] = line_count; if (--searches_remaining <= 0) break; }
- if (searches_result_line_no[1] == -1 && s >= searches_input_ptr[1]) { searches_result_line_no[1] = line_count; if (--searches_remaining <= 0) break; }
}
- line_count++;
- if (searches_result_line_no[0] == -1)
- searches_result_line_no[0] = line_count;
- if (searches_result_line_no[1] == -1)
- searches_result_line_no[1] = line_count;
+ }
+ if (cursor_line_no == -1)
+ cursor_line_no = line_count;
+ if (selmin_line_no == -1)
+ selmin_line_no = line_count;
// Calculate 2d position by finding the beginning of the line and measuring distance
- cursor_offset.x = InputTextCalcTextSizeW(ImStrbolW(searches_input_ptr[0], text_begin), searches_input_ptr[0]).x;
- cursor_offset.y = searches_result_line_no[0] * g.FontSize;
- if (searches_result_line_no[1] >= 0)
+ cursor_offset.x = InputTextCalcTextSize(&g, ImStrbol(cursor_ptr, text_begin), cursor_ptr).x;
+ cursor_offset.y = cursor_line_no * g.FontSize;
+ if (selmin_line_no >= 0)
{
- select_start_offset.x = InputTextCalcTextSizeW(ImStrbolW(searches_input_ptr[1], text_begin), searches_input_ptr[1]).x;
- select_start_offset.y = searches_result_line_no[1] * g.FontSize;
+ select_start_offset.x = InputTextCalcTextSize(&g, ImStrbol(selmin_ptr, text_begin), selmin_ptr).x;
+ select_start_offset.y = selmin_line_no * g.FontSize;
}
// Store text height (note that we haven't calculated text width at all, see GitHub issues #383, #1224)
@@ -4711,14 +5266,14 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
{
const float scroll_increment_x = inner_size.x * 0.25f;
const float visible_width = inner_size.x - style.FramePadding.x;
- if (cursor_offset.x < state->ScrollX)
- state->ScrollX = IM_FLOOR(ImMax(0.0f, cursor_offset.x - scroll_increment_x));
- else if (cursor_offset.x - visible_width >= state->ScrollX)
- state->ScrollX = IM_FLOOR(cursor_offset.x - visible_width + scroll_increment_x);
+ if (cursor_offset.x < state->Scroll.x)
+ state->Scroll.x = IM_TRUNC(ImMax(0.0f, cursor_offset.x - scroll_increment_x));
+ else if (cursor_offset.x - visible_width >= state->Scroll.x)
+ state->Scroll.x = IM_TRUNC(cursor_offset.x - visible_width + scroll_increment_x);
}
else
{
- state->ScrollX = 0.0f;
+ state->Scroll.y = 0.0f;
}
// Vertical scroll
@@ -4739,43 +5294,41 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
// Draw selection
- const ImVec2 draw_scroll = ImVec2(state->ScrollX, 0.0f);
+ const ImVec2 draw_scroll = ImVec2(state->Scroll.x, 0.0f);
if (render_selection)
{
- const ImWchar* text_selected_begin = text_begin + ImMin(state->Stb.select_start, state->Stb.select_end);
- const ImWchar* text_selected_end = text_begin + ImMax(state->Stb.select_start, state->Stb.select_end);
+ const char* text_selected_begin = text_begin + ImMin(state->Stb->select_start, state->Stb->select_end);
+ const char* text_selected_end = text_begin + ImMax(state->Stb->select_start, state->Stb->select_end);
ImU32 bg_color = GetColorU32(ImGuiCol_TextSelectedBg, render_cursor ? 1.0f : 0.6f); // FIXME: current code flow mandate that render_cursor is always true here, we are leaving the transparent one for tests.
float bg_offy_up = is_multiline ? 0.0f : -1.0f; // FIXME: those offsets should be part of the style? they don't play so well with multi-line selection.
float bg_offy_dn = is_multiline ? 0.0f : 2.0f;
ImVec2 rect_pos = draw_pos + select_start_offset - draw_scroll;
- for (const ImWchar* p = text_selected_begin; p < text_selected_end; )
+ for (const char* p = text_selected_begin; p < text_selected_end; )
{
if (rect_pos.y > clip_rect.w + g.FontSize)
break;
if (rect_pos.y < clip_rect.y)
{
- //p = (const ImWchar*)wmemchr((const wchar_t*)p, '\n', text_selected_end - p); // FIXME-OPT: Could use this when wchar_t are 16-bit
- //p = p ? p + 1 : text_selected_end;
- while (p < text_selected_end)
- if (*p++ == '\n')
- break;
+ p = (const char*)ImMemchr((void*)p, '\n', text_selected_end - p);
+ p = p ? p + 1 : text_selected_end;
}
else
{
- ImVec2 rect_size = InputTextCalcTextSizeW(p, text_selected_end, &p, NULL, true);
- if (rect_size.x <= 0.0f) rect_size.x = IM_FLOOR(g.Font->GetCharAdvance((ImWchar)' ') * 0.50f); // So we can see selected empty lines
+ ImVec2 rect_size = InputTextCalcTextSize(&g, p, text_selected_end, &p, NULL, true);
+ if (rect_size.x <= 0.0f) rect_size.x = IM_TRUNC(g.Font->GetCharAdvance((ImWchar)' ') * 0.50f); // So we can see selected empty lines
ImRect rect(rect_pos + ImVec2(0.0f, bg_offy_up - g.FontSize), rect_pos + ImVec2(rect_size.x, bg_offy_dn));
rect.ClipWith(clip_rect);
if (rect.Overlaps(clip_rect))
draw_window->DrawList->AddRectFilled(rect.Min, rect.Max, bg_color);
+ rect_pos.x = draw_pos.x - draw_scroll.x;
}
- rect_pos.x = draw_pos.x - draw_scroll.x;
rect_pos.y += g.FontSize;
}
}
// We test for 'buf_display_max_length' as a way to avoid some pathological cases (e.g. single-line 1 MB string) which would make ImDrawList crash.
+ // FIXME-OPT: Multiline could submit a smaller amount of contents to AddText() since we already iterated through it.
if (is_multiline || (buf_display_end - buf_display) < buf_display_max_length)
{
ImU32 col = GetColorU32(is_displaying_hint ? ImGuiCol_TextDisabled : ImGuiCol_Text);
@@ -4787,7 +5340,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
{
state->CursorAnim += io.DeltaTime;
bool cursor_is_visible = (!g.IO.ConfigInputTextCursorBlink) || (state->CursorAnim <= 0.0f) || ImFmod(state->CursorAnim, 1.20f) <= 0.80f;
- ImVec2 cursor_screen_pos = ImFloor(draw_pos + cursor_offset - draw_scroll);
+ ImVec2 cursor_screen_pos = ImTrunc(draw_pos + cursor_offset - draw_scroll);
ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y - g.FontSize + 0.5f, cursor_screen_pos.x + 1.0f, cursor_screen_pos.y - 1.5f);
if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect))
draw_window->DrawList->AddLine(cursor_screen_rect.Min, cursor_screen_rect.GetBL(), GetColorU32(ImGuiCol_Text));
@@ -4807,14 +5360,19 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (is_multiline)
text_size = ImVec2(inner_size.x, InputTextCalcTextLenAndLineCount(buf_display, &buf_display_end) * g.FontSize); // We don't need width
else if (!is_displaying_hint && g.ActiveId == id)
- buf_display_end = buf_display + state->CurLenA;
+ buf_display_end = buf_display + state->TextLen;
else if (!is_displaying_hint)
- buf_display_end = buf_display + strlen(buf_display);
+ buf_display_end = buf_display + ImStrlen(buf_display);
if (is_multiline || (buf_display_end - buf_display) < buf_display_max_length)
{
+ // Find render position for right alignment
+ if (flags & ImGuiInputTextFlags_ElideLeft)
+ draw_pos.x = ImMin(draw_pos.x, frame_bb.Max.x - CalcTextSize(buf_display, NULL).x - style.FramePadding.x);
+
+ const ImVec2 draw_scroll = /*state ? ImVec2(state->Scroll.x, 0.0f) :*/ ImVec2(0.0f, 0.0f); // Preserve scroll when inactive?
ImU32 col = GetColorU32(is_displaying_hint ? ImGuiCol_TextDisabled : ImGuiCol_Text);
- draw_window->DrawList->AddText(g.Font, g.FontSize, draw_pos, col, buf_display, buf_display_end, 0.0f, is_multiline ? NULL : &clip_rect);
+ draw_window->DrawList->AddText(g.Font, g.FontSize, draw_pos - draw_scroll, col, buf_display, buf_display_end, 0.0f, is_multiline ? NULL : &clip_rect);
}
}
@@ -4823,24 +5381,24 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (is_multiline)
{
- // For focus requests to work on our multiline we need to ensure our child ItemAdd() call specifies the ImGuiItemFlags_Inputable (ref issue #4761)...
+ // For focus requests to work on our multiline we need to ensure our child ItemAdd() call specifies the ImGuiItemFlags_Inputable (see #4761, #7870)...
Dummy(ImVec2(text_size.x, text_size.y + style.FramePadding.y));
- ImGuiItemFlags backup_item_flags = g.CurrentItemFlags;
- g.CurrentItemFlags |= ImGuiItemFlags_Inputable | ImGuiItemFlags_NoTabStop;
+ g.NextItemData.ItemFlags |= (ImGuiItemFlags)ImGuiItemFlags_Inputable | ImGuiItemFlags_NoTabStop;
EndChild();
item_data_backup.StatusFlags |= (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredWindow);
- g.CurrentItemFlags = backup_item_flags;
// ...and then we need to undo the group overriding last item data, which gets a bit messy as EndGroup() tries to forward scrollbar being active...
// FIXME: This quite messy/tricky, should attempt to get rid of the child window.
EndGroup();
- if (g.LastItemData.ID == 0)
+ if (g.LastItemData.ID == 0 || g.LastItemData.ID != GetWindowScrollbarID(draw_window, ImGuiAxis_Y))
{
g.LastItemData.ID = id;
- g.LastItemData.InFlags = item_data_backup.InFlags;
+ g.LastItemData.ItemFlags = item_data_backup.ItemFlags;
g.LastItemData.StatusFlags = item_data_backup.StatusFlags;
}
}
+ if (state)
+ state->TextSrc = NULL;
// Log as text
if (g.LogEnabled && (!is_password || is_displaying_hint))
@@ -4852,10 +5410,10 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (label_size.x > 0)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
- if (value_changed && !(flags & ImGuiInputTextFlags_NoMarkEdited))
+ if (value_changed)
MarkItemEdited(id);
- IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
+ IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Inputable);
if ((flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0)
return validated;
else
@@ -4866,26 +5424,28 @@ void ImGui::DebugNodeInputTextState(ImGuiInputTextState* state)
{
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
ImGuiContext& g = *GImGui;
- ImStb::STB_TexteditState* stb_state = &state->Stb;
+ ImStb::STB_TexteditState* stb_state = state->Stb;
ImStb::StbUndoState* undo_state = &stb_state->undostate;
Text("ID: 0x%08X, ActiveID: 0x%08X", state->ID, g.ActiveId);
DebugLocateItemOnHover(state->ID);
- Text("CurLenW: %d, CurLenA: %d, Cursor: %d, Selection: %d..%d", state->CurLenA, state->CurLenW, stb_state->cursor, stb_state->select_start, stb_state->select_end);
+ Text("CurLenA: %d, Cursor: %d, Selection: %d..%d", state->TextLen, stb_state->cursor, stb_state->select_start, stb_state->select_end);
+ Text("BufCapacityA: %d", state->BufCapacity);
+ Text("(Internal Buffer: TextA Size: %d, Capacity: %d)", state->TextA.Size, state->TextA.Capacity);
+ Text("has_preferred_x: %d (%.2f)", stb_state->has_preferred_x, stb_state->preferred_x);
Text("undo_point: %d, redo_point: %d, undo_char_point: %d, redo_char_point: %d", undo_state->undo_point, undo_state->redo_point, undo_state->undo_char_point, undo_state->redo_char_point);
- if (BeginChild("undopoints", ImVec2(0.0f, GetTextLineHeight() * 15), true)) // Visualize undo state
+ if (BeginChild("undopoints", ImVec2(0.0f, GetTextLineHeight() * 10), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeY)) // Visualize undo state
{
PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
- for (int n = 0; n < STB_TEXTEDIT_UNDOSTATECOUNT; n++)
+ for (int n = 0; n < IMSTB_TEXTEDIT_UNDOSTATECOUNT; n++)
{
ImStb::StbUndoRecord* undo_rec = &undo_state->undo_rec[n];
const char undo_rec_type = (n < undo_state->undo_point) ? 'u' : (n >= undo_state->redo_point) ? 'r' : ' ';
if (undo_rec_type == ' ')
BeginDisabled();
- char buf[64] = "";
- if (undo_rec_type != ' ' && undo_rec->char_storage != -1)
- ImTextStrToUtf8(buf, IM_ARRAYSIZE(buf), undo_state->undo_char + undo_rec->char_storage, undo_state->undo_char + undo_rec->char_storage + undo_rec->insert_length);
- Text("%c [%02d] where %03d, insert %03d, delete %03d, char_storage %03d \"%s\"",
- undo_rec_type, n, undo_rec->where, undo_rec->insert_length, undo_rec->delete_length, undo_rec->char_storage, buf);
+ const int buf_preview_len = (undo_rec_type != ' ' && undo_rec->char_storage != -1) ? undo_rec->insert_length : 0;
+ const char* buf_preview_str = undo_state->undo_char + undo_rec->char_storage;
+ Text("%c [%02d] where %03d, insert %03d, delete %03d, char_storage %03d \"%.*s\"",
+ undo_rec_type, n, undo_rec->where, undo_rec->insert_length, undo_rec->delete_length, undo_rec->char_storage, buf_preview_len, buf_preview_str);
if (undo_rec_type == ' ')
EndDisabled();
}
@@ -4917,33 +5477,37 @@ bool ImGui::ColorEdit3(const char* label, float col[3], ImGuiColorEditFlags flag
return ColorEdit4(label, col, flags | ImGuiColorEditFlags_NoAlpha);
}
+static void ColorEditRestoreH(const float* col, float* H)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(g.ColorEditCurrentID != 0);
+ if (g.ColorEditSavedID != g.ColorEditCurrentID || g.ColorEditSavedColor != ImGui::ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0)))
+ return;
+ *H = g.ColorEditSavedHue;
+}
+
// ColorEdit supports RGB and HSV inputs. In case of RGB input resulting color may have undefined hue and/or saturation.
// Since widget displays both RGB and HSV values we must preserve hue and saturation to prevent these values resetting.
static void ColorEditRestoreHS(const float* col, float* H, float* S, float* V)
{
- // This check is optional. Suppose we have two color widgets side by side, both widgets display different colors, but both colors have hue and/or saturation undefined.
- // With color check: hue/saturation is preserved in one widget. Editing color in one widget would reset hue/saturation in another one.
- // Without color check: common hue/saturation would be displayed in all widgets that have hue/saturation undefined.
- // g.ColorEditLastColor is stored as ImU32 RGB value: this essentially gives us color equality check with reduced precision.
- // Tiny external color changes would not be detected and this check would still pass. This is OK, since we only restore hue/saturation _only_ if they are undefined,
- // therefore this change flipping hue/saturation from undefined to a very tiny value would still be represented in color picker.
ImGuiContext& g = *GImGui;
- if (g.ColorEditLastColor != ImGui::ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0)))
+ IM_ASSERT(g.ColorEditCurrentID != 0);
+ if (g.ColorEditSavedID != g.ColorEditCurrentID || g.ColorEditSavedColor != ImGui::ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0)))
return;
// When S == 0, H is undefined.
// When H == 1 it wraps around to 0.
- if (*S == 0.0f || (*H == 0.0f && g.ColorEditLastHue == 1))
- *H = g.ColorEditLastHue;
+ if (*S == 0.0f || (*H == 0.0f && g.ColorEditSavedHue == 1))
+ *H = g.ColorEditSavedHue;
// When V == 0, S is undefined.
if (*V == 0.0f)
- *S = g.ColorEditLastSat;
+ *S = g.ColorEditSavedSat;
}
// Edit colors components (each component in 0.0f..1.0f range).
// See enum ImGuiColorEditFlags_ for available options. e.g. Only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set.
-// With typical options: Left-click on color square to open color picker. Right-click to open option menu. CTRL-Click over input fields to edit them and TAB to go to next item.
+// With typical options: Left-click on color square to open color picker. Right-click to open option menu. CTRL+Click over input fields to edit them and TAB to go to next item.
bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -4953,14 +5517,15 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
const float square_sz = GetFrameHeight();
- const float w_full = CalcItemWidth();
- const float w_button = (flags & ImGuiColorEditFlags_NoSmallPreview) ? 0.0f : (square_sz + style.ItemInnerSpacing.x);
- const float w_inputs = w_full - w_button;
const char* label_display_end = FindRenderedTextEnd(label);
+ float w_full = CalcItemWidth();
g.NextItemData.ClearFlags();
BeginGroup();
PushID(label);
+ const bool set_current_color_edit_id = (g.ColorEditCurrentID == 0);
+ if (set_current_color_edit_id)
+ g.ColorEditCurrentID = window->IDStack.back();
// If we're not showing any slider there's no point in doing any HSV conversions
const ImGuiColorEditFlags flags_untouched = flags;
@@ -4987,6 +5552,9 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
const bool alpha = (flags & ImGuiColorEditFlags_NoAlpha) == 0;
const bool hdr = (flags & ImGuiColorEditFlags_HDR) != 0;
const int components = alpha ? 4 : 3;
+ const float w_button = (flags & ImGuiColorEditFlags_NoSmallPreview) ? 0.0f : (square_sz + style.ItemInnerSpacing.x);
+ const float w_inputs = ImMax(w_full - w_button, 1.0f);
+ w_full = w_inputs + w_button;
// Convert to the formats we need
float f[4] = { col[0], col[1], col[2], alpha ? col[3] : 1.0f };
@@ -4994,7 +5562,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]);
else if ((flags & ImGuiColorEditFlags_InputRGB) && (flags & ImGuiColorEditFlags_DisplayHSV))
{
- // Hue is lost when converting from greyscale rgb (saturation=0). Restore it.
+ // Hue is lost when converting from grayscale rgb (saturation=0). Restore it.
ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]);
ColorEditRestoreHS(col, &f[0], &f[1], &f[2]);
}
@@ -5010,10 +5578,9 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
if ((flags & (ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV)) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0)
{
// RGB/HSV 0..255 Sliders
- const float w_item_one = ImMax(1.0f, IM_FLOOR((w_inputs - (style.ItemInnerSpacing.x) * (components - 1)) / (float)components));
- const float w_item_last = ImMax(1.0f, IM_FLOOR(w_inputs - (w_item_one + style.ItemInnerSpacing.x) * (components - 1)));
+ const float w_items = w_inputs - style.ItemInnerSpacing.x * (components - 1);
- const bool hide_prefix = (w_item_one <= CalcTextSize((flags & ImGuiColorEditFlags_Float) ? "M:0.000" : "M:000").x);
+ const bool hide_prefix = (IM_TRUNC(w_items / components) <= CalcTextSize((flags & ImGuiColorEditFlags_Float) ? "M:0.000" : "M:000").x);
static const char* ids[4] = { "##X", "##Y", "##Z", "##W" };
static const char* fmt_table_int[3][4] =
{
@@ -5029,11 +5596,14 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
};
const int fmt_idx = hide_prefix ? 0 : (flags & ImGuiColorEditFlags_DisplayHSV) ? 2 : 1;
+ float prev_split = 0.0f;
for (int n = 0; n < components; n++)
{
if (n > 0)
SameLine(0, style.ItemInnerSpacing.x);
- SetNextItemWidth((n + 1 < components) ? w_item_one : w_item_last);
+ float next_split = IM_TRUNC(w_items * (n + 1) / components);
+ SetNextItemWidth(ImMax(next_split - prev_split, 1.0f));
+ prev_split = next_split;
// FIXME: When ImGuiColorEditFlags_HDR flag is passed HS values snap in weird ways when SV values go below 0.
if (flags & ImGuiColorEditFlags_Float)
@@ -5058,7 +5628,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
else
ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", ImClamp(i[0], 0, 255), ImClamp(i[1], 0, 255), ImClamp(i[2], 0, 255));
SetNextItemWidth(w_inputs);
- if (InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase))
+ if (InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsUppercase))
{
value_changed = true;
char* p = buf;
@@ -5133,10 +5703,11 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
f[n] = i[n] / 255.0f;
if ((flags & ImGuiColorEditFlags_DisplayHSV) && (flags & ImGuiColorEditFlags_InputRGB))
{
- g.ColorEditLastHue = f[0];
- g.ColorEditLastSat = f[1];
+ g.ColorEditSavedHue = f[0];
+ g.ColorEditSavedSat = f[1];
ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]);
- g.ColorEditLastColor = ColorConvertFloat4ToU32(ImVec4(f[0], f[1], f[2], 0));
+ g.ColorEditSavedID = g.ColorEditCurrentID;
+ g.ColorEditSavedColor = ColorConvertFloat4ToU32(ImVec4(f[0], f[1], f[2], 0));
}
if ((flags & ImGuiColorEditFlags_DisplayRGB) && (flags & ImGuiColorEditFlags_InputHSV))
ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]);
@@ -5148,12 +5719,14 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
col[3] = f[3];
}
+ if (set_current_color_edit_id)
+ g.ColorEditCurrentID = 0;
PopID();
EndGroup();
// Drag and Drop Target
// NB: The flag test is merely an optional micro-optimization, BeginDragDropTarget() does the same test.
- if ((g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredRect) && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropTarget())
+ if ((g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredRect) && !(g.LastItemData.ItemFlags & ImGuiItemFlags_ReadOnly) && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropTarget())
{
bool accepted_drag_drop = false;
if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F))
@@ -5218,9 +5791,13 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
ImGuiIO& io = g.IO;
const float width = CalcItemWidth();
+ const bool is_readonly = ((g.NextItemData.ItemFlags | g.CurrentItemFlags) & ImGuiItemFlags_ReadOnly) != 0;
g.NextItemData.ClearFlags();
PushID(label);
+ const bool set_current_color_edit_id = (g.ColorEditCurrentID == 0);
+ if (set_current_color_edit_id)
+ g.ColorEditCurrentID = window->IDStack.back();
BeginGroup();
if (!(flags & ImGuiColorEditFlags_NoSidePreview))
@@ -5249,7 +5826,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
float sv_picker_size = ImMax(bars_width * 1, width - (alpha_bar ? 2 : 1) * (bars_width + style.ItemInnerSpacing.x)); // Saturation/Value picking box
float bar0_pos_x = picker_pos.x + sv_picker_size + style.ItemInnerSpacing.x;
float bar1_pos_x = bar0_pos_x + bars_width + style.ItemInnerSpacing.x;
- float bars_triangles_half_sz = IM_FLOOR(bars_width * 0.20f);
+ float bars_triangles_half_sz = IM_TRUNC(bars_width * 0.20f);
float backup_initial_col[4];
memcpy(backup_initial_col, col, components * sizeof(float));
@@ -5269,7 +5846,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
float R = col[0], G = col[1], B = col[2];
if (flags & ImGuiColorEditFlags_InputRGB)
{
- // Hue is lost when converting from greyscale rgb (saturation=0). Restore it.
+ // Hue is lost when converting from grayscale rgb (saturation=0). Restore it.
ColorConvertRGBtoHSV(R, G, B, H, S, V);
ColorEditRestoreHS(col, &H, &S, &V);
}
@@ -5285,7 +5862,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
{
// Hue wheel + SV triangle logic
InvisibleButton("hsv", ImVec2(sv_picker_size + style.ItemInnerSpacing.x + bars_width, sv_picker_size));
- if (IsItemActive())
+ if (IsItemActive() && !is_readonly)
{
ImVec2 initial_off = g.IO.MouseClickedPos[0] - wheel_center;
ImVec2 current_off = g.IO.MousePos - wheel_center;
@@ -5320,14 +5897,11 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
{
// SV rectangle logic
InvisibleButton("sv", ImVec2(sv_picker_size, sv_picker_size));
- if (IsItemActive())
+ if (IsItemActive() && !is_readonly)
{
S = ImSaturate((io.MousePos.x - picker_pos.x) / (sv_picker_size - 1));
V = 1.0f - ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size - 1));
-
- // Greatly reduces hue jitter and reset to 0 when hue == 255 and color is rapidly modified using SV square.
- if (g.ColorEditLastColor == ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0)))
- H = g.ColorEditLastHue;
+ ColorEditRestoreH(col, &H); // Greatly reduces hue jitter and reset to 0 when hue == 255 and color is rapidly modified using SV square.
value_changed = value_changed_sv = true;
}
if (!(flags & ImGuiColorEditFlags_NoOptions))
@@ -5336,7 +5910,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
// Hue bar logic
SetCursorScreenPos(ImVec2(bar0_pos_x, picker_pos.y));
InvisibleButton("hue", ImVec2(bars_width, sv_picker_size));
- if (IsItemActive())
+ if (IsItemActive() && !is_readonly)
{
H = ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size - 1));
value_changed = value_changed_h = true;
@@ -5380,7 +5954,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
if ((flags & ImGuiColorEditFlags_NoLabel))
Text("Current");
- ImGuiColorEditFlags sub_flags_to_forward = ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf | ImGuiColorEditFlags_NoTooltip;
+ ImGuiColorEditFlags sub_flags_to_forward = ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_AlphaMask_ | ImGuiColorEditFlags_NoTooltip;
ColorButton("##current", col_v4, (flags & sub_flags_to_forward), ImVec2(square_sz * 3, square_sz * 2));
if (ref_col != NULL)
{
@@ -5402,9 +5976,10 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
if (flags & ImGuiColorEditFlags_InputRGB)
{
ColorConvertHSVtoRGB(H, S, V, col[0], col[1], col[2]);
- g.ColorEditLastHue = H;
- g.ColorEditLastSat = S;
- g.ColorEditLastColor = ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0));
+ g.ColorEditSavedHue = H;
+ g.ColorEditSavedSat = S;
+ g.ColorEditSavedID = g.ColorEditCurrentID;
+ g.ColorEditSavedColor = ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 0));
}
else if (flags & ImGuiColorEditFlags_InputHSV)
{
@@ -5419,7 +5994,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
if ((flags & ImGuiColorEditFlags_NoInputs) == 0)
{
PushItemWidth((alpha_bar ? bar1_pos_x : bar0_pos_x) + bars_width - picker_pos.x);
- ImGuiColorEditFlags sub_flags_to_forward = ImGuiColorEditFlags_DataTypeMask_ | ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoSmallPreview | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf;
+ ImGuiColorEditFlags sub_flags_to_forward = ImGuiColorEditFlags_DataTypeMask_ | ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_AlphaMask_ | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoSmallPreview;
ImGuiColorEditFlags sub_flags = (flags & sub_flags_to_forward) | ImGuiColorEditFlags_NoPicker;
if (flags & ImGuiColorEditFlags_DisplayRGB || (flags & ImGuiColorEditFlags_DisplayMask_) == 0)
if (ColorEdit4("##rgb", col, sub_flags | ImGuiColorEditFlags_DisplayRGB))
@@ -5506,7 +6081,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
float sin_hue_angle = ImSin(H * 2.0f * IM_PI);
ImVec2 hue_cursor_pos(wheel_center.x + cos_hue_angle * (wheel_r_inner + wheel_r_outer) * 0.5f, wheel_center.y + sin_hue_angle * (wheel_r_inner + wheel_r_outer) * 0.5f);
float hue_cursor_rad = value_changed_h ? wheel_thickness * 0.65f : wheel_thickness * 0.55f;
- int hue_cursor_segments = ImClamp((int)(hue_cursor_rad / 1.4f), 9, 32);
+ int hue_cursor_segments = draw_list->_CalcCircleAutoSegmentCount(hue_cursor_rad); // Lock segment count so the +1 one matches others.
draw_list->AddCircleFilled(hue_cursor_pos, hue_cursor_rad, hue_color32, hue_cursor_segments);
draw_list->AddCircle(hue_cursor_pos, hue_cursor_rad + 1, col_midgrey, hue_cursor_segments);
draw_list->AddCircle(hue_cursor_pos, hue_cursor_rad, col_white, hue_cursor_segments);
@@ -5516,13 +6091,10 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
ImVec2 trb = wheel_center + ImRotate(triangle_pb, cos_hue_angle, sin_hue_angle);
ImVec2 trc = wheel_center + ImRotate(triangle_pc, cos_hue_angle, sin_hue_angle);
ImVec2 uv_white = GetFontTexUvWhitePixel();
- draw_list->PrimReserve(6, 6);
+ draw_list->PrimReserve(3, 3);
draw_list->PrimVtx(tra, uv_white, hue_color32);
- draw_list->PrimVtx(trb, uv_white, hue_color32);
- draw_list->PrimVtx(trc, uv_white, col_white);
- draw_list->PrimVtx(tra, uv_white, 0);
draw_list->PrimVtx(trb, uv_white, col_black);
- draw_list->PrimVtx(trc, uv_white, 0);
+ draw_list->PrimVtx(trc, uv_white, col_white);
draw_list->AddTriangle(tra, trb, trc, col_midgrey, 1.5f);
sv_cursor_pos = ImLerp(ImLerp(trc, tra, ImSaturate(S)), trb, ImSaturate(1 - V));
}
@@ -5544,10 +6116,11 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
}
// Render cursor/preview circle (clamp S/V within 0..1 range because floating points colors may lead HSV values to be out of range)
- float sv_cursor_rad = value_changed_sv ? 10.0f : 6.0f;
- draw_list->AddCircleFilled(sv_cursor_pos, sv_cursor_rad, user_col32_striped_of_alpha, 12);
- draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad + 1, col_midgrey, 12);
- draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad, col_white, 12);
+ float sv_cursor_rad = value_changed_sv ? wheel_thickness * 0.55f : wheel_thickness * 0.40f;
+ int sv_cursor_segments = draw_list->_CalcCircleAutoSegmentCount(sv_cursor_rad); // Lock segment count so the +1 one matches others.
+ draw_list->AddCircleFilled(sv_cursor_pos, sv_cursor_rad, user_col32_striped_of_alpha, sv_cursor_segments);
+ draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad + 1, col_midgrey, sv_cursor_segments);
+ draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad, col_white, sv_cursor_segments);
// Render alpha bar
if (alpha_bar)
@@ -5568,6 +6141,8 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
if (value_changed && g.LastItemData.ID != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId
MarkItemEdited(g.LastItemData.ID);
+ if (set_current_color_edit_id)
+ g.ColorEditCurrentID = 0;
PopID();
return value_changed;
@@ -5595,8 +6170,8 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
bool hovered, held;
bool pressed = ButtonBehavior(bb, id, &hovered, &held);
- if (flags & ImGuiColorEditFlags_NoAlpha)
- flags &= ~(ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf);
+ if (flags & (ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaOpaque))
+ flags &= ~(ImGuiColorEditFlags_AlphaNoBg | ImGuiColorEditFlags_AlphaPreviewHalf);
ImVec4 col_rgb = col;
if (flags & ImGuiColorEditFlags_InputHSV)
@@ -5615,25 +6190,28 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
if ((flags & ImGuiColorEditFlags_AlphaPreviewHalf) && col_rgb.w < 1.0f)
{
float mid_x = IM_ROUND((bb_inner.Min.x + bb_inner.Max.x) * 0.5f);
- RenderColorRectWithAlphaCheckerboard(window->DrawList, ImVec2(bb_inner.Min.x + grid_step, bb_inner.Min.y), bb_inner.Max, GetColorU32(col_rgb), grid_step, ImVec2(-grid_step + off, off), rounding, ImDrawFlags_RoundCornersRight);
+ if ((flags & ImGuiColorEditFlags_AlphaNoBg) == 0)
+ RenderColorRectWithAlphaCheckerboard(window->DrawList, ImVec2(bb_inner.Min.x + grid_step, bb_inner.Min.y), bb_inner.Max, GetColorU32(col_rgb), grid_step, ImVec2(-grid_step + off, off), rounding, ImDrawFlags_RoundCornersRight);
+ else
+ window->DrawList->AddRectFilled(ImVec2(bb_inner.Min.x + grid_step, bb_inner.Min.y), bb_inner.Max, GetColorU32(col_rgb), rounding, ImDrawFlags_RoundCornersRight);
window->DrawList->AddRectFilled(bb_inner.Min, ImVec2(mid_x, bb_inner.Max.y), GetColorU32(col_rgb_without_alpha), rounding, ImDrawFlags_RoundCornersLeft);
}
else
{
// Because GetColorU32() multiplies by the global style Alpha and we don't want to display a checkerboard if the source code had no alpha
- ImVec4 col_source = (flags & ImGuiColorEditFlags_AlphaPreview) ? col_rgb : col_rgb_without_alpha;
- if (col_source.w < 1.0f)
+ ImVec4 col_source = (flags & ImGuiColorEditFlags_AlphaOpaque) ? col_rgb_without_alpha : col_rgb;
+ if (col_source.w < 1.0f && (flags & ImGuiColorEditFlags_AlphaNoBg) == 0)
RenderColorRectWithAlphaCheckerboard(window->DrawList, bb_inner.Min, bb_inner.Max, GetColorU32(col_source), grid_step, ImVec2(off, off), rounding);
else
window->DrawList->AddRectFilled(bb_inner.Min, bb_inner.Max, GetColorU32(col_source), rounding);
}
- RenderNavHighlight(bb, id);
+ RenderNavCursor(bb, id);
if ((flags & ImGuiColorEditFlags_NoBorder) == 0)
{
if (g.Style.FrameBorderSize > 0.0f)
RenderFrameBorder(bb.Min, bb.Max, rounding);
else
- window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), rounding); // Color button are often in need of some sort of border
+ window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), rounding); // Color buttons are often in need of some sort of border
}
// Drag and Drop Source
@@ -5651,8 +6229,8 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
}
// Tooltip
- if (!(flags & ImGuiColorEditFlags_NoTooltip) && hovered)
- ColorTooltip(desc_id, &col.x, flags & (ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf));
+ if (!(flags & ImGuiColorEditFlags_NoTooltip) && hovered && IsItemHovered(ImGuiHoveredFlags_ForTooltip))
+ ColorTooltip(desc_id, &col.x, flags & (ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_AlphaMask_));
return pressed;
}
@@ -5681,7 +6259,8 @@ void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags
{
ImGuiContext& g = *GImGui;
- BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None);
+ if (!BeginTooltipEx(ImGuiTooltipFlags_OverridePrevious, ImGuiWindowFlags_None))
+ return;
const char* text_end = text ? FindRenderedTextEnd(text, NULL) : text;
if (text_end > text)
{
@@ -5692,7 +6271,8 @@ void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags
ImVec2 sz(g.FontSize * 3 + g.Style.FramePadding.y * 2, g.FontSize * 3 + g.Style.FramePadding.y * 2);
ImVec4 cf(col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]);
int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]);
- ColorButton("##preview", cf, (flags & (ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf)) | ImGuiColorEditFlags_NoTooltip, sz);
+ ImGuiColorEditFlags flags_to_forward = ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_AlphaMask_;
+ ColorButton("##preview", cf, (flags & flags_to_forward) | ImGuiColorEditFlags_NoTooltip, sz);
SameLine();
if ((flags & ImGuiColorEditFlags_InputRGB) || !(flags & ImGuiColorEditFlags_InputMask_))
{
@@ -5717,7 +6297,9 @@ void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags)
bool allow_opt_datatype = !(flags & ImGuiColorEditFlags_DataTypeMask_);
if ((!allow_opt_inputs && !allow_opt_datatype) || !BeginPopup("context"))
return;
+
ImGuiContext& g = *GImGui;
+ PushItemFlag(ImGuiItemFlags_NoMarkEdited, true);
ImGuiColorEditFlags opts = g.ColorEditOptions;
if (allow_opt_inputs)
{
@@ -5759,6 +6341,7 @@ void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags)
}
g.ColorEditOptions = opts;
+ PopItemFlag();
EndPopup();
}
@@ -5768,7 +6351,9 @@ void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags fl
bool allow_opt_alpha_bar = !(flags & ImGuiColorEditFlags_NoAlpha) && !(flags & ImGuiColorEditFlags_AlphaBar);
if ((!allow_opt_picker && !allow_opt_alpha_bar) || !BeginPopup("context"))
return;
+
ImGuiContext& g = *GImGui;
+ PushItemFlag(ImGuiItemFlags_NoMarkEdited, true);
if (allow_opt_picker)
{
ImVec2 picker_size(g.FontSize * 8, ImMax(g.FontSize * 8 - (GetFrameHeight() + g.Style.ItemInnerSpacing.x), 1.0f)); // FIXME: Picker size copied from main picker function
@@ -5797,6 +6382,7 @@ void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags fl
if (allow_opt_picker) Separator();
CheckboxFlags("Alpha Bar", &g.ColorEditOptions, ImGuiColorEditFlags_AlphaBar);
}
+ PopItemFlag();
EndPopup();
}
@@ -5838,7 +6424,8 @@ bool ImGui::TreeNode(const char* label)
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
- return TreeNodeBehavior(window->GetID(label), 0, label, NULL);
+ ImGuiID id = window->GetID(label);
+ return TreeNodeBehavior(id, ImGuiTreeNodeFlags_None, label, NULL);
}
bool ImGui::TreeNodeV(const char* str_id, const char* fmt, va_list args)
@@ -5856,8 +6443,8 @@ bool ImGui::TreeNodeEx(const char* label, ImGuiTreeNodeFlags flags)
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
-
- return TreeNodeBehavior(window->GetID(label), flags, label, NULL);
+ ImGuiID id = window->GetID(label);
+ return TreeNodeBehavior(id, flags, label, NULL);
}
bool ImGui::TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...)
@@ -5884,9 +6471,10 @@ bool ImGui::TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char
if (window->SkipItems)
return false;
+ ImGuiID id = window->GetID(str_id);
const char* label, *label_end;
ImFormatStringToTempBufferV(&label, &label_end, fmt, args);
- return TreeNodeBehavior(window->GetID(str_id), flags, label, label_end);
+ return TreeNodeBehavior(id, flags, label, label_end);
}
bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args)
@@ -5895,44 +6483,52 @@ bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char
if (window->SkipItems)
return false;
+ ImGuiID id = window->GetID(ptr_id);
const char* label, *label_end;
ImFormatStringToTempBufferV(&label, &label_end, fmt, args);
- return TreeNodeBehavior(window->GetID(ptr_id), flags, label, label_end);
+ return TreeNodeBehavior(id, flags, label, label_end);
+}
+
+bool ImGui::TreeNodeGetOpen(ImGuiID storage_id)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiStorage* storage = g.CurrentWindow->DC.StateStorage;
+ return storage->GetInt(storage_id, 0) != 0;
}
-void ImGui::TreeNodeSetOpen(ImGuiID id, bool open)
+void ImGui::TreeNodeSetOpen(ImGuiID storage_id, bool open)
{
ImGuiContext& g = *GImGui;
ImGuiStorage* storage = g.CurrentWindow->DC.StateStorage;
- storage->SetInt(id, open ? 1 : 0);
+ storage->SetInt(storage_id, open ? 1 : 0);
}
-bool ImGui::TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags)
+bool ImGui::TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags)
{
if (flags & ImGuiTreeNodeFlags_Leaf)
return true;
- // We only write to the tree storage if the user clicks (or explicitly use the SetNextItemOpen function)
+ // We only write to the tree storage if the user clicks, or explicitly use the SetNextItemOpen function
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
ImGuiStorage* storage = window->DC.StateStorage;
bool is_open;
- if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasOpen)
+ if (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasOpen)
{
if (g.NextItemData.OpenCond & ImGuiCond_Always)
{
is_open = g.NextItemData.OpenVal;
- TreeNodeSetOpen(id, is_open);
+ TreeNodeSetOpen(storage_id, is_open);
}
else
{
// We treat ImGuiCond_Once and ImGuiCond_FirstUseEver the same because tree node state are not saved persistently.
- const int stored_value = storage->GetInt(id, -1);
+ const int stored_value = storage->GetInt(storage_id, -1);
if (stored_value == -1)
{
is_open = g.NextItemData.OpenVal;
- TreeNodeSetOpen(id, is_open);
+ TreeNodeSetOpen(storage_id, is_open);
}
else
{
@@ -5942,7 +6538,7 @@ bool ImGui::TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags)
}
else
{
- is_open = storage->GetInt(id, (flags & ImGuiTreeNodeFlags_DefaultOpen) ? 1 : 0) != 0;
+ is_open = storage->GetInt(storage_id, (flags & ImGuiTreeNodeFlags_DefaultOpen) ? 1 : 0) != 0;
}
// When logging is enabled, we automatically expand tree nodes (but *NOT* collapsing headers.. seems like sensible behavior).
@@ -5953,6 +6549,23 @@ bool ImGui::TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags)
return is_open;
}
+// Store ImGuiTreeNodeStackData for just submitted node.
+// Currently only supports 32 level deep and we are fine with (1 << Depth) overflowing into a zero, easy to increase.
+static void TreeNodeStoreStackData(ImGuiTreeNodeFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+
+ g.TreeNodeStack.resize(g.TreeNodeStack.Size + 1);
+ ImGuiTreeNodeStackData* tree_node_data = &g.TreeNodeStack.back();
+ tree_node_data->ID = g.LastItemData.ID;
+ tree_node_data->TreeFlags = flags;
+ tree_node_data->ItemFlags = g.LastItemData.ItemFlags;
+ tree_node_data->NavRect = g.LastItemData.NavRect;
+ window->DC.TreeHasStackDataDepthMask |= (1 << window->DC.TreeDepth);
+}
+
+// When using public API, currently 'id == storage_id' is always true, but we separate the values to facilitate advanced user code doing storage queries outside of UI loop.
bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -5968,55 +6581,90 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
label_end = FindRenderedTextEnd(label);
const ImVec2 label_size = CalcTextSize(label, label_end, false);
+ const float text_offset_x = g.FontSize + (display_frame ? padding.x * 3 : padding.x * 2); // Collapsing arrow width + Spacing
+ const float text_offset_y = ImMax(padding.y, window->DC.CurrLineTextBaseOffset); // Latch before ItemSize changes it
+ const float text_width = g.FontSize + label_size.x + padding.x * 2; // Include collapsing arrow
+
// We vertically grow up to current line height up the typical widget height.
const float frame_height = ImMax(ImMin(window->DC.CurrLineSize.y, g.FontSize + style.FramePadding.y * 2), label_size.y + padding.y * 2);
+ const bool span_all_columns = (flags & ImGuiTreeNodeFlags_SpanAllColumns) != 0 && (g.CurrentTable != NULL);
+ const bool span_all_columns_label = (flags & ImGuiTreeNodeFlags_LabelSpanAllColumns) != 0 && (g.CurrentTable != NULL);
ImRect frame_bb;
- frame_bb.Min.x = (flags & ImGuiTreeNodeFlags_SpanFullWidth) ? window->WorkRect.Min.x : window->DC.CursorPos.x;
+ frame_bb.Min.x = span_all_columns ? window->ParentWorkRect.Min.x : (flags & ImGuiTreeNodeFlags_SpanFullWidth) ? window->WorkRect.Min.x : window->DC.CursorPos.x;
frame_bb.Min.y = window->DC.CursorPos.y;
- frame_bb.Max.x = window->WorkRect.Max.x;
+ frame_bb.Max.x = span_all_columns ? window->ParentWorkRect.Max.x : (flags & ImGuiTreeNodeFlags_SpanLabelWidth) ? window->DC.CursorPos.x + text_width + padding.x : window->WorkRect.Max.x;
frame_bb.Max.y = window->DC.CursorPos.y + frame_height;
if (display_frame)
{
- // Framed header expand a little outside the default padding, to the edge of InnerClipRect
- // (FIXME: May remove this at some point and make InnerClipRect align with WindowPadding.x instead of WindowPadding.x*0.5f)
- frame_bb.Min.x -= IM_FLOOR(window->WindowPadding.x * 0.5f - 1.0f);
- frame_bb.Max.x += IM_FLOOR(window->WindowPadding.x * 0.5f);
+ const float outer_extend = IM_TRUNC(window->WindowPadding.x * 0.5f); // Framed header expand a little outside of current limits
+ frame_bb.Min.x -= outer_extend;
+ frame_bb.Max.x += outer_extend;
}
- const float text_offset_x = g.FontSize + (display_frame ? padding.x * 3 : padding.x * 2); // Collapser arrow width + Spacing
- const float text_offset_y = ImMax(padding.y, window->DC.CurrLineTextBaseOffset); // Latch before ItemSize changes it
- const float text_width = g.FontSize + (label_size.x > 0.0f ? label_size.x + padding.x * 2 : 0.0f); // Include collapser
ImVec2 text_pos(window->DC.CursorPos.x + text_offset_x, window->DC.CursorPos.y + text_offset_y);
ItemSize(ImVec2(text_width, frame_height), padding.y);
// For regular tree nodes, we arbitrary allow to click past 2 worth of ItemSpacing
ImRect interact_bb = frame_bb;
- if (!display_frame && (flags & (ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_SpanFullWidth)) == 0)
- interact_bb.Max.x = frame_bb.Min.x + text_width + style.ItemSpacing.x * 2.0f;
+ if ((flags & (ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_SpanLabelWidth | ImGuiTreeNodeFlags_SpanAllColumns)) == 0)
+ interact_bb.Max.x = frame_bb.Min.x + text_width + (label_size.x > 0.0f ? style.ItemSpacing.x * 2.0f : 0.0f);
- // Store a flag for the current depth to tell if we will allow closing this node when navigating one of its child.
- // For this purpose we essentially compare if g.NavIdIsAlive went from 0 to 1 between TreeNode() and TreePop().
- // This is currently only support 32 level deep and we are fine with (1 << Depth) overflowing into a zero.
- const bool is_leaf = (flags & ImGuiTreeNodeFlags_Leaf) != 0;
- bool is_open = TreeNodeUpdateNextOpen(id, flags);
- if (is_open && !g.NavIdIsAlive && (flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
- window->DC.TreeJumpToParentOnPopMask |= (1 << window->DC.TreeDepth);
+ // Compute open and multi-select states before ItemAdd() as it clear NextItem data.
+ ImGuiID storage_id = (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasStorageID) ? g.NextItemData.StorageId : id;
+ bool is_open = TreeNodeUpdateNextOpen(storage_id, flags);
- bool item_add = ItemAdd(interact_bb, id);
+ bool is_visible;
+ if (span_all_columns || span_all_columns_label)
+ {
+ // Modify ClipRect for the ItemAdd(), faster than doing a PushColumnsBackground/PushTableBackgroundChannel for every Selectable..
+ const float backup_clip_rect_min_x = window->ClipRect.Min.x;
+ const float backup_clip_rect_max_x = window->ClipRect.Max.x;
+ window->ClipRect.Min.x = window->ParentWorkRect.Min.x;
+ window->ClipRect.Max.x = window->ParentWorkRect.Max.x;
+ is_visible = ItemAdd(interact_bb, id);
+ window->ClipRect.Min.x = backup_clip_rect_min_x;
+ window->ClipRect.Max.x = backup_clip_rect_max_x;
+ }
+ else
+ {
+ is_visible = ItemAdd(interact_bb, id);
+ }
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HasDisplayRect;
g.LastItemData.DisplayRect = frame_bb;
- if (!item_add)
+ // If a NavLeft request is happening and ImGuiTreeNodeFlags_NavLeftJumpsBackHere enabled:
+ // Store data for the current depth to allow returning to this node from any child item.
+ // For this purpose we essentially compare if g.NavIdIsAlive went from 0 to 1 between TreeNode() and TreePop().
+ // It will become tempting to enable ImGuiTreeNodeFlags_NavLeftJumpsBackHere by default or move it to ImGuiStyle.
+ bool store_tree_node_stack_data = false;
+ if (!(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
+ {
+ if ((flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && is_open && !g.NavIdIsAlive)
+ if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet())
+ store_tree_node_stack_data = true;
+ }
+
+ const bool is_leaf = (flags & ImGuiTreeNodeFlags_Leaf) != 0;
+ if (!is_visible)
{
+ if (store_tree_node_stack_data && is_open)
+ TreeNodeStoreStackData(flags); // Call before TreePushOverrideID()
if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
TreePushOverrideID(id);
IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0));
return is_open;
}
+ if (span_all_columns || span_all_columns_label)
+ {
+ TablePushBackgroundChannel();
+ g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HasClipRect;
+ g.LastItemData.ClipRect = window->ClipRect;
+ }
+
ImGuiButtonFlags button_flags = ImGuiTreeNodeFlags_None;
- if (flags & ImGuiTreeNodeFlags_AllowItemOverlap)
- button_flags |= ImGuiButtonFlags_AllowItemOverlap;
+ if ((flags & ImGuiTreeNodeFlags_AllowOverlap) || (g.LastItemData.ItemFlags & ImGuiItemFlags_AllowOverlap))
+ button_flags |= ImGuiButtonFlags_AllowOverlap;
if (!is_leaf)
button_flags |= ImGuiButtonFlags_PressedOnDragDropHold;
@@ -6026,8 +6674,10 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
const float arrow_hit_x1 = (text_pos.x - text_offset_x) - style.TouchExtraPadding.x;
const float arrow_hit_x2 = (text_pos.x - text_offset_x) + (g.FontSize + padding.x * 2.0f) + style.TouchExtraPadding.x;
const bool is_mouse_x_over_arrow = (g.IO.MousePos.x >= arrow_hit_x1 && g.IO.MousePos.x < arrow_hit_x2);
- if (window != g.HoveredWindow || !is_mouse_x_over_arrow)
- button_flags |= ImGuiButtonFlags_NoKeyModifiers;
+
+ const bool is_multi_select = (g.LastItemData.ItemFlags & ImGuiItemFlags_IsMultiSelect) != 0;
+ if (is_multi_select) // We absolutely need to distinguish open vs select so _OpenOnArrow comes by default
+ flags |= (flags & ImGuiTreeNodeFlags_OpenOnMask_) == 0 ? ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick : ImGuiTreeNodeFlags_OpenOnArrow;
// Open behaviors can be altered with the _OpenOnArrow and _OnOnDoubleClick flags.
// Some alteration have subtle effects (e.g. toggle on MouseUp vs MouseDown events) due to requirements for multi-selection and drag and drop support.
@@ -6048,6 +6698,20 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
bool selected = (flags & ImGuiTreeNodeFlags_Selected) != 0;
const bool was_selected = selected;
+ // Multi-selection support (header)
+ if (is_multi_select)
+ {
+ // Handle multi-select + alter button flags for it
+ MultiSelectItemHeader(id, &selected, &button_flags);
+ if (is_mouse_x_over_arrow)
+ button_flags = (button_flags | ImGuiButtonFlags_PressedOnClick) & ~ImGuiButtonFlags_PressedOnClickRelease;
+ }
+ else
+ {
+ if (window != g.HoveredWindow || !is_mouse_x_over_arrow)
+ button_flags |= ImGuiButtonFlags_NoKeyModsAllowed;
+ }
+
bool hovered, held;
bool pressed = ButtonBehavior(interact_bb, id, &hovered, &held, button_flags);
bool toggled = false;
@@ -6055,87 +6719,113 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
{
if (pressed && g.DragDropHoldJustPressedId != id)
{
- if ((flags & (ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick)) == 0 || (g.NavActivateId == id))
- toggled = true;
+ if ((flags & ImGuiTreeNodeFlags_OpenOnMask_) == 0 || (g.NavActivateId == id && !is_multi_select))
+ toggled = true; // Single click
if (flags & ImGuiTreeNodeFlags_OpenOnArrow)
- toggled |= is_mouse_x_over_arrow && !g.NavDisableMouseHover; // Lightweight equivalent of IsMouseHoveringRect() since ButtonBehavior() already did the job
+ toggled |= is_mouse_x_over_arrow && !g.NavHighlightItemUnderNav; // Lightweight equivalent of IsMouseHoveringRect() since ButtonBehavior() already did the job
if ((flags & ImGuiTreeNodeFlags_OpenOnDoubleClick) && g.IO.MouseClickedCount[0] == 2)
- toggled = true;
+ toggled = true; // Double click
}
else if (pressed && g.DragDropHoldJustPressedId == id)
{
IM_ASSERT(button_flags & ImGuiButtonFlags_PressedOnDragDropHold);
if (!is_open) // When using Drag and Drop "hold to open" we keep the node highlighted after opening, but never close it again.
toggled = true;
+ else
+ pressed = false; // Cancel press so it doesn't trigger selection.
}
if (g.NavId == id && g.NavMoveDir == ImGuiDir_Left && is_open)
{
toggled = true;
+ NavClearPreferredPosForAxis(ImGuiAxis_X);
NavMoveRequestCancel();
}
if (g.NavId == id && g.NavMoveDir == ImGuiDir_Right && !is_open) // If there's something upcoming on the line we may want to give it the priority?
{
toggled = true;
+ NavClearPreferredPosForAxis(ImGuiAxis_X);
NavMoveRequestCancel();
}
if (toggled)
{
is_open = !is_open;
- window->DC.StateStorage->SetInt(id, is_open);
+ window->DC.StateStorage->SetInt(storage_id, is_open);
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_ToggledOpen;
}
}
- if (flags & ImGuiTreeNodeFlags_AllowItemOverlap)
- SetItemAllowOverlap();
- // In this branch, TreeNodeBehavior() cannot toggle the selection so this will never trigger.
- if (selected != was_selected) //-V547
+ // Multi-selection support (footer)
+ if (is_multi_select)
+ {
+ bool pressed_copy = pressed && !toggled;
+ MultiSelectItemFooter(id, &selected, &pressed_copy);
+ if (pressed)
+ SetNavID(id, window->DC.NavLayerCurrent, g.CurrentFocusScopeId, interact_bb);
+ }
+
+ if (selected != was_selected)
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_ToggledSelection;
// Render
- const ImU32 text_col = GetColorU32(ImGuiCol_Text);
- ImGuiNavHighlightFlags nav_highlight_flags = ImGuiNavHighlightFlags_TypeThin;
- if (display_frame)
- {
- // Framed type
- const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
- RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, true, style.FrameRounding);
- RenderNavHighlight(frame_bb, id, nav_highlight_flags);
- if (flags & ImGuiTreeNodeFlags_Bullet)
- RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.60f, text_pos.y + g.FontSize * 0.5f), text_col);
- else if (!is_leaf)
- RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 1.0f);
- else // Leaf without bullet, left-adjusted text
- text_pos.x -= text_offset_x;
- if (flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton)
- frame_bb.Max.x -= g.FontSize + style.FramePadding.x;
-
- if (g.LogEnabled)
- LogSetNextTextDecoration("###", "###");
- RenderTextClipped(text_pos, frame_bb.Max, label, label_end, &label_size);
- }
- else
{
- // Unframed typed for tree nodes
- if (hovered || selected)
+ const ImU32 text_col = GetColorU32(ImGuiCol_Text);
+ ImGuiNavRenderCursorFlags nav_render_cursor_flags = ImGuiNavRenderCursorFlags_Compact;
+ if (is_multi_select)
+ nav_render_cursor_flags |= ImGuiNavRenderCursorFlags_AlwaysDraw; // Always show the nav rectangle
+ if (display_frame)
{
+ // Framed type
const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
- RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false);
+ RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, true, style.FrameRounding);
+ RenderNavCursor(frame_bb, id, nav_render_cursor_flags);
+ if (flags & ImGuiTreeNodeFlags_Bullet)
+ RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.60f, text_pos.y + g.FontSize * 0.5f), text_col);
+ else if (!is_leaf)
+ RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 1.0f);
+ else // Leaf without bullet, left-adjusted text
+ text_pos.x -= text_offset_x - padding.x;
+ if (flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton)
+ frame_bb.Max.x -= g.FontSize + style.FramePadding.x;
+ if (g.LogEnabled)
+ LogSetNextTextDecoration("###", "###");
}
- RenderNavHighlight(frame_bb, id, nav_highlight_flags);
- if (flags & ImGuiTreeNodeFlags_Bullet)
- RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col);
- else if (!is_leaf)
- RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 0.70f);
- if (g.LogEnabled)
- LogSetNextTextDecoration(">", NULL);
- RenderText(text_pos, label, label_end, false);
+ else
+ {
+ // Unframed typed for tree nodes
+ if (hovered || selected)
+ {
+ const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
+ RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false);
+ }
+ RenderNavCursor(frame_bb, id, nav_render_cursor_flags);
+ if (flags & ImGuiTreeNodeFlags_Bullet)
+ RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col);
+ else if (!is_leaf)
+ RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 0.70f);
+ if (g.LogEnabled)
+ LogSetNextTextDecoration(">", NULL);
+ }
+
+ if (span_all_columns && !span_all_columns_label)
+ TablePopBackgroundChannel();
+
+ // Label
+ if (display_frame)
+ RenderTextClipped(text_pos, frame_bb.Max, label, label_end, &label_size);
+ else
+ RenderText(text_pos, label, label_end, false);
+
+ if (span_all_columns_label)
+ TablePopBackgroundChannel();
}
+ if (store_tree_node_stack_data && is_open)
+ TreeNodeStoreStackData(flags); // Call before TreePushOverrideID()
if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
- TreePushOverrideID(id);
+ TreePushOverrideID(id); // Could use TreePush(label) but this avoid computing twice
+
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0));
return is_open;
}
@@ -6174,14 +6864,19 @@ void ImGui::TreePop()
window->DC.TreeDepth--;
ImU32 tree_depth_mask = (1 << window->DC.TreeDepth);
- // Handle Left arrow to move to parent tree node (when ImGuiTreeNodeFlags_NavLeftJumpsBackHere is enabled)
- if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet())
- if (g.NavIdIsAlive && (window->DC.TreeJumpToParentOnPopMask & tree_depth_mask))
+ if (window->DC.TreeHasStackDataDepthMask & tree_depth_mask) // Only set during request
+ {
+ ImGuiTreeNodeStackData* data = &g.TreeNodeStack.back();
+ IM_ASSERT(data->ID == window->IDStack.back());
+ if (data->TreeFlags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere)
{
- SetNavID(window->IDStack.back(), g.NavLayer, 0, ImRect());
- NavMoveRequestCancel();
+ // Handle Left arrow to move to parent tree node (when ImGuiTreeNodeFlags_NavLeftJumpsBackHere is enabled)
+ if (g.NavIdIsAlive && g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet())
+ NavMoveRequestResolveWithPastTreeNode(&g.NavMoveResultLocal, data);
}
- window->DC.TreeJumpToParentOnPopMask &= tree_depth_mask - 1;
+ g.TreeNodeStack.pop_back();
+ window->DC.TreeHasStackDataDepthMask &= ~tree_depth_mask;
+ }
IM_ASSERT(window->IDStack.Size > 1); // There should always be 1 element in the IDStack (pushed during window creation). If this triggers you called TreePop/PopID too much.
PopID();
@@ -6200,9 +6895,19 @@ void ImGui::SetNextItemOpen(bool is_open, ImGuiCond cond)
ImGuiContext& g = *GImGui;
if (g.CurrentWindow->SkipItems)
return;
- g.NextItemData.Flags |= ImGuiNextItemDataFlags_HasOpen;
+ g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasOpen;
g.NextItemData.OpenVal = is_open;
- g.NextItemData.OpenCond = cond ? cond : ImGuiCond_Always;
+ g.NextItemData.OpenCond = (ImU8)(cond ? cond : ImGuiCond_Always);
+}
+
+// Set next TreeNode/CollapsingHeader storage id.
+void ImGui::SetNextItemStorageID(ImGuiID storage_id)
+{
+ ImGuiContext& g = *GImGui;
+ if (g.CurrentWindow->SkipItems)
+ return;
+ g.NextItemData.HasFlags |= ImGuiNextItemDataFlags_HasStorageID;
+ g.NextItemData.StorageId = storage_id;
}
// CollapsingHeader returns true when opened but do not indent nor push into the ID stack (because of the ImGuiTreeNodeFlags_NoTreePushOnOpen flag).
@@ -6212,8 +6917,8 @@ bool ImGui::CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags)
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
-
- return TreeNodeBehavior(window->GetID(label), flags | ImGuiTreeNodeFlags_CollapsingHeader, label);
+ ImGuiID id = window->GetID(label);
+ return TreeNodeBehavior(id, flags | ImGuiTreeNodeFlags_CollapsingHeader, label);
}
// p_visible == NULL : regular collapsing header
@@ -6232,7 +6937,7 @@ bool ImGui::CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFl
ImGuiID id = window->GetID(label);
flags |= ImGuiTreeNodeFlags_CollapsingHeader;
if (p_visible)
- flags |= ImGuiTreeNodeFlags_AllowItemOverlap | ImGuiTreeNodeFlags_ClipLabelForTrailingButton;
+ flags |= ImGuiTreeNodeFlags_AllowOverlap | (ImGuiTreeNodeFlags)ImGuiTreeNodeFlags_ClipLabelForTrailingButton;
bool is_open = TreeNodeBehavior(id, flags, label);
if (p_visible != NULL)
{
@@ -6242,8 +6947,8 @@ bool ImGui::CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFl
ImGuiContext& g = *GImGui;
ImGuiLastItemData last_item_backup = g.LastItemData;
float button_size = g.FontSize;
- float button_x = ImMax(g.LastItemData.Rect.Min.x, g.LastItemData.Rect.Max.x - g.Style.FramePadding.x * 2.0f - button_size);
- float button_y = g.LastItemData.Rect.Min.y;
+ float button_x = ImMax(g.LastItemData.Rect.Min.x, g.LastItemData.Rect.Max.x - g.Style.FramePadding.x - button_size);
+ float button_y = g.LastItemData.Rect.Min.y + g.Style.FramePadding.y;
ImGuiID close_button_id = GetIDWithSeed("#CLOSE", NULL, id);
if (CloseButton(close_button_id, ImVec2(button_x, button_y)))
*p_visible = false;
@@ -6261,7 +6966,7 @@ bool ImGui::CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFl
// Tip: pass a non-visible label (e.g. "##hello") then you can use the space to draw other text or image.
// But you need to make sure the ID is unique, e.g. enclose calls in PushID/PopID or use ##unique_id.
-// With this scheme, ImGuiSelectableFlags_SpanAllColumns and ImGuiSelectableFlags_AllowItemOverlap are also frequently used flags.
+// With this scheme, ImGuiSelectableFlags_SpanAllColumns and ImGuiSelectableFlags_AllowOverlap are also frequently used flags.
// FIXME: Selectable() with (size.x == 0.0f) and (SelectableTextAlign.x > 0.0f) followed by SameLine() is currently not supported.
bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags flags, const ImVec2& size_arg)
{
@@ -6288,18 +6993,15 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_SpanAvailWidth))
size.x = ImMax(label_size.x, max_x - min_x);
- // Text stays at the submission position, but bounding box may be extended on both sides
- const ImVec2 text_min = pos;
- const ImVec2 text_max(min_x + size.x, pos.y + size.y);
-
// Selectables are meant to be tightly packed together with no click-gap, so we extend their box to cover spacing between selectable.
- ImRect bb(min_x, pos.y, text_max.x, text_max.y);
+ // FIXME: Not part of layout so not included in clipper calculation, but ItemSize currently doesn't allow offsetting CursorPos.
+ ImRect bb(min_x, pos.y, min_x + size.x, pos.y + size.y);
if ((flags & ImGuiSelectableFlags_NoPadWithHalfSpacing) == 0)
{
const float spacing_x = span_all_columns ? 0.0f : style.ItemSpacing.x;
const float spacing_y = style.ItemSpacing.y;
- const float spacing_L = IM_FLOOR(spacing_x * 0.50f);
- const float spacing_U = IM_FLOOR(spacing_y * 0.50f);
+ const float spacing_L = IM_TRUNC(spacing_x * 0.50f);
+ const float spacing_U = IM_TRUNC(spacing_y * 0.50f);
bb.Min.x -= spacing_L;
bb.Min.y -= spacing_U;
bb.Max.x += (spacing_x - spacing_L);
@@ -6307,25 +7009,29 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
}
//if (g.IO.KeyCtrl) { GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(0, 255, 0, 255)); }
- // Modify ClipRect for the ItemAdd(), faster than doing a PushColumnsBackground/PushTableBackground for every Selectable..
- const float backup_clip_rect_min_x = window->ClipRect.Min.x;
- const float backup_clip_rect_max_x = window->ClipRect.Max.x;
+ const bool disabled_item = (flags & ImGuiSelectableFlags_Disabled) != 0;
+ const ImGuiItemFlags extra_item_flags = disabled_item ? (ImGuiItemFlags)ImGuiItemFlags_Disabled : ImGuiItemFlags_None;
+ bool is_visible;
if (span_all_columns)
{
+ // Modify ClipRect for the ItemAdd(), faster than doing a PushColumnsBackground/PushTableBackgroundChannel for every Selectable..
+ const float backup_clip_rect_min_x = window->ClipRect.Min.x;
+ const float backup_clip_rect_max_x = window->ClipRect.Max.x;
window->ClipRect.Min.x = window->ParentWorkRect.Min.x;
window->ClipRect.Max.x = window->ParentWorkRect.Max.x;
- }
-
- const bool disabled_item = (flags & ImGuiSelectableFlags_Disabled) != 0;
- const bool item_add = ItemAdd(bb, id, NULL, disabled_item ? ImGuiItemFlags_Disabled : ImGuiItemFlags_None);
- if (span_all_columns)
- {
+ is_visible = ItemAdd(bb, id, NULL, extra_item_flags);
window->ClipRect.Min.x = backup_clip_rect_min_x;
window->ClipRect.Max.x = backup_clip_rect_max_x;
}
+ else
+ {
+ is_visible = ItemAdd(bb, id, NULL, extra_item_flags);
+ }
- if (!item_add)
- return false;
+ const bool is_multi_select = (g.LastItemData.ItemFlags & ImGuiItemFlags_IsMultiSelect) != 0;
+ if (!is_visible)
+ if (!is_multi_select || !g.BoxSelectState.UnclipMode || !g.BoxSelectState.UnclipRect.Overlaps(bb)) // Extra layer of "no logic clip" for box-select support (would be more overhead to add to ItemAdd)
+ return false;
const bool disabled_global = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0;
if (disabled_item && !disabled_global) // Only testing this as an optimization
@@ -6333,10 +7039,15 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
// FIXME: We can standardize the behavior of those two, we could also keep the fast path of override ClipRect + full push on render only,
// which would be advantageous since most selectable are not selected.
- if (span_all_columns && window->DC.CurrentColumns)
- PushColumnsBackground();
- else if (span_all_columns && g.CurrentTable)
- TablePushBackgroundChannel();
+ if (span_all_columns)
+ {
+ if (g.CurrentTable)
+ TablePushBackgroundChannel();
+ else if (window->DC.CurrentColumns)
+ PushColumnsBackground();
+ g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HasClipRect;
+ g.LastItemData.ClipRect = window->ClipRect;
+ }
// We use NoHoldingActiveID on menus so user can click and _hold_ on a menu then drag to browse child entries
ImGuiButtonFlags button_flags = 0;
@@ -6345,66 +7056,95 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
if (flags & ImGuiSelectableFlags_SelectOnClick) { button_flags |= ImGuiButtonFlags_PressedOnClick; }
if (flags & ImGuiSelectableFlags_SelectOnRelease) { button_flags |= ImGuiButtonFlags_PressedOnRelease; }
if (flags & ImGuiSelectableFlags_AllowDoubleClick) { button_flags |= ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick; }
- if (flags & ImGuiSelectableFlags_AllowItemOverlap) { button_flags |= ImGuiButtonFlags_AllowItemOverlap; }
+ if ((flags & ImGuiSelectableFlags_AllowOverlap) || (g.LastItemData.ItemFlags & ImGuiItemFlags_AllowOverlap)) { button_flags |= ImGuiButtonFlags_AllowOverlap; }
+ // Multi-selection support (header)
const bool was_selected = selected;
+ if (is_multi_select)
+ {
+ // Handle multi-select + alter button flags for it
+ MultiSelectItemHeader(id, &selected, &button_flags);
+ }
+
bool hovered, held;
bool pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags);
- // Auto-select when moved into
- // - This will be more fully fleshed in the range-select branch
- // - This is not exposed as it won't nicely work with some user side handling of shift/control
- // - We cannot do 'if (g.NavJustMovedToId != id) { selected = false; pressed = was_selected; }' for two reasons
- // - (1) it would require focus scope to be set, need exposing PushFocusScope() or equivalent (e.g. BeginSelection() calling PushFocusScope())
- // - (2) usage will fail with clipped items
- // The multi-select API aim to fix those issues, e.g. may be replaced with a BeginSelection() API.
- if ((flags & ImGuiSelectableFlags_SelectOnNav) && g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == g.CurrentFocusScopeId)
- if (g.NavJustMovedToId == id)
- selected = pressed = true;
-
- // Update NavId when clicking or when Hovering (this doesn't happen on most widgets), so navigation can be resumed with gamepad/keyboard
+ // Multi-selection support (footer)
+ if (is_multi_select)
+ {
+ MultiSelectItemFooter(id, &selected, &pressed);
+ }
+ else
+ {
+ // Auto-select when moved into
+ // - This will be more fully fleshed in the range-select branch
+ // - This is not exposed as it won't nicely work with some user side handling of shift/control
+ // - We cannot do 'if (g.NavJustMovedToId != id) { selected = false; pressed = was_selected; }' for two reasons
+ // - (1) it would require focus scope to be set, need exposing PushFocusScope() or equivalent (e.g. BeginSelection() calling PushFocusScope())
+ // - (2) usage will fail with clipped items
+ // The multi-select API aim to fix those issues, e.g. may be replaced with a BeginSelection() API.
+ if ((flags & ImGuiSelectableFlags_SelectOnNav) && g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == g.CurrentFocusScopeId)
+ if (g.NavJustMovedToId == id)
+ selected = pressed = true;
+ }
+
+ // Update NavId when clicking or when Hovering (this doesn't happen on most widgets), so navigation can be resumed with keyboard/gamepad
if (pressed || (hovered && (flags & ImGuiSelectableFlags_SetNavIdOnHover)))
{
- if (!g.NavDisableMouseHover && g.NavWindow == window && g.NavLayer == window->DC.NavLayerCurrent)
+ if (!g.NavHighlightItemUnderNav && g.NavWindow == window && g.NavLayer == window->DC.NavLayerCurrent)
{
SetNavID(id, window->DC.NavLayerCurrent, g.CurrentFocusScopeId, WindowRectAbsToRel(window, bb)); // (bb == NavRect)
- g.NavDisableHighlight = true;
+ if (g.IO.ConfigNavCursorVisibleAuto)
+ g.NavCursorVisible = false;
}
}
if (pressed)
MarkItemEdited(id);
- if (flags & ImGuiSelectableFlags_AllowItemOverlap)
- SetItemAllowOverlap();
-
- // In this branch, Selectable() cannot toggle the selection so this will never trigger.
- if (selected != was_selected) //-V547
+ if (selected != was_selected)
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_ToggledSelection;
// Render
- if (held && (flags & ImGuiSelectableFlags_DrawHoveredWhenHeld))
- hovered = true;
- if (hovered || selected)
+ if (is_visible)
{
- const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
- RenderFrame(bb.Min, bb.Max, col, false, 0.0f);
+ const bool highlighted = hovered || (flags & ImGuiSelectableFlags_Highlight);
+ if (highlighted || selected)
+ {
+ // Between 1.91.0 and 1.91.4 we made selected Selectable use an arbitrary lerp between _Header and _HeaderHovered. Removed that now. (#8106)
+ ImU32 col = GetColorU32((held && highlighted) ? ImGuiCol_HeaderActive : highlighted ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
+ RenderFrame(bb.Min, bb.Max, col, false, 0.0f);
+ }
+ if (g.NavId == id)
+ {
+ ImGuiNavRenderCursorFlags nav_render_cursor_flags = ImGuiNavRenderCursorFlags_Compact | ImGuiNavRenderCursorFlags_NoRounding;
+ if (is_multi_select)
+ nav_render_cursor_flags |= ImGuiNavRenderCursorFlags_AlwaysDraw; // Always show the nav rectangle
+ RenderNavCursor(bb, id, nav_render_cursor_flags);
+ }
}
- RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_TypeThin | ImGuiNavHighlightFlags_NoRounding);
- if (span_all_columns && window->DC.CurrentColumns)
- PopColumnsBackground();
- else if (span_all_columns && g.CurrentTable)
- TablePopBackgroundChannel();
+ if (span_all_columns)
+ {
+ if (g.CurrentTable)
+ TablePopBackgroundChannel();
+ else if (window->DC.CurrentColumns)
+ PopColumnsBackground();
+ }
- RenderTextClipped(text_min, text_max, label, NULL, &label_size, style.SelectableTextAlign, &bb);
+ // Text stays at the submission position. Alignment/clipping extents ignore SpanAllColumns.
+ if (is_visible)
+ RenderTextClipped(pos, ImVec2(ImMin(pos.x + size.x, window->WorkRect.Max.x), pos.y + size.y), label, NULL, &label_size, style.SelectableTextAlign, &bb);
// Automatically close popups
- if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(g.LastItemData.InFlags & ImGuiItemFlags_SelectableDontClosePopup))
+ if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_NoAutoClosePopups) && (g.LastItemData.ItemFlags & ImGuiItemFlags_AutoClosePopups))
CloseCurrentPopup();
if (disabled_item && !disabled_global)
EndDisabled();
+ // Selectable() always returns a pressed state!
+ // Users of BeginMultiSelect()/EndMultiSelect() scope: you may call ImGui::IsItemToggledSelection() to retrieve
+ // selection toggle, only useful if you need that state updated (e.g. for rendering purpose) before reaching EndMultiSelect().
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
return pressed; //-V1020
}
@@ -6419,6 +7159,1131 @@ bool ImGui::Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags
return false;
}
+
+//-------------------------------------------------------------------------
+// [SECTION] Widgets: Typing-Select support
+//-------------------------------------------------------------------------
+
+// [Experimental] Currently not exposed in public API.
+// Consume character inputs and return search request, if any.
+// This would typically only be called on the focused window or location you want to grab inputs for, e.g.
+// if (ImGui::IsWindowFocused(...))
+// if (ImGuiTypingSelectRequest* req = ImGui::GetTypingSelectRequest())
+// focus_idx = ImGui::TypingSelectFindMatch(req, my_items.size(), [](void*, int n) { return my_items[n]->Name; }, &my_items, -1);
+// However the code is written in a way where calling it from multiple locations is safe (e.g. to obtain buffer).
+ImGuiTypingSelectRequest* ImGui::GetTypingSelectRequest(ImGuiTypingSelectFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiTypingSelectState* data = &g.TypingSelectState;
+ ImGuiTypingSelectRequest* out_request = &data->Request;
+
+ // Clear buffer
+ const float TYPING_SELECT_RESET_TIMER = 1.80f; // FIXME: Potentially move to IO config.
+ const int TYPING_SELECT_SINGLE_CHAR_COUNT_FOR_LOCK = 4; // Lock single char matching when repeating same char 4 times
+ if (data->SearchBuffer[0] != 0)
+ {
+ bool clear_buffer = false;
+ clear_buffer |= (g.NavFocusScopeId != data->FocusScope);
+ clear_buffer |= (data->LastRequestTime + TYPING_SELECT_RESET_TIMER < g.Time);
+ clear_buffer |= g.NavAnyRequest;
+ clear_buffer |= g.ActiveId != 0 && g.NavActivateId == 0; // Allow temporary SPACE activation to not interfere
+ clear_buffer |= IsKeyPressed(ImGuiKey_Escape) || IsKeyPressed(ImGuiKey_Enter);
+ clear_buffer |= IsKeyPressed(ImGuiKey_Backspace) && (flags & ImGuiTypingSelectFlags_AllowBackspace) == 0;
+ //if (clear_buffer) { IMGUI_DEBUG_LOG("GetTypingSelectRequest(): Clear SearchBuffer.\n"); }
+ if (clear_buffer)
+ data->Clear();
+ }
+
+ // Append to buffer
+ const int buffer_max_len = IM_ARRAYSIZE(data->SearchBuffer) - 1;
+ int buffer_len = (int)ImStrlen(data->SearchBuffer);
+ bool select_request = false;
+ for (ImWchar w : g.IO.InputQueueCharacters)
+ {
+ const int w_len = ImTextCountUtf8BytesFromStr(&w, &w + 1);
+ if (w < 32 || (buffer_len == 0 && ImCharIsBlankW(w)) || (buffer_len + w_len > buffer_max_len)) // Ignore leading blanks
+ continue;
+ char w_buf[5];
+ ImTextCharToUtf8(w_buf, (unsigned int)w);
+ if (data->SingleCharModeLock && w_len == out_request->SingleCharSize && memcmp(w_buf, data->SearchBuffer, w_len) == 0)
+ {
+ select_request = true; // Same character: don't need to append to buffer.
+ continue;
+ }
+ if (data->SingleCharModeLock)
+ {
+ data->Clear(); // Different character: clear
+ buffer_len = 0;
+ }
+ memcpy(data->SearchBuffer + buffer_len, w_buf, w_len + 1); // Append
+ buffer_len += w_len;
+ select_request = true;
+ }
+ g.IO.InputQueueCharacters.resize(0);
+
+ // Handle backspace
+ if ((flags & ImGuiTypingSelectFlags_AllowBackspace) && IsKeyPressed(ImGuiKey_Backspace, ImGuiInputFlags_Repeat))
+ {
+ char* p = (char*)(void*)ImTextFindPreviousUtf8Codepoint(data->SearchBuffer, data->SearchBuffer + buffer_len);
+ *p = 0;
+ buffer_len = (int)(p - data->SearchBuffer);
+ }
+
+ // Return request if any
+ if (buffer_len == 0)
+ return NULL;
+ if (select_request)
+ {
+ data->FocusScope = g.NavFocusScopeId;
+ data->LastRequestFrame = g.FrameCount;
+ data->LastRequestTime = (float)g.Time;
+ }
+ out_request->Flags = flags;
+ out_request->SearchBufferLen = buffer_len;
+ out_request->SearchBuffer = data->SearchBuffer;
+ out_request->SelectRequest = (data->LastRequestFrame == g.FrameCount);
+ out_request->SingleCharMode = false;
+ out_request->SingleCharSize = 0;
+
+ // Calculate if buffer contains the same character repeated.
+ // - This can be used to implement a special search mode on first character.
+ // - Performed on UTF-8 codepoint for correctness.
+ // - SingleCharMode is always set for first input character, because it usually leads to a "next".
+ if (flags & ImGuiTypingSelectFlags_AllowSingleCharMode)
+ {
+ const char* buf_begin = out_request->SearchBuffer;
+ const char* buf_end = out_request->SearchBuffer + out_request->SearchBufferLen;
+ const int c0_len = ImTextCountUtf8BytesFromChar(buf_begin, buf_end);
+ const char* p = buf_begin + c0_len;
+ for (; p < buf_end; p += c0_len)
+ if (memcmp(buf_begin, p, (size_t)c0_len) != 0)
+ break;
+ const int single_char_count = (p == buf_end) ? (out_request->SearchBufferLen / c0_len) : 0;
+ out_request->SingleCharMode = (single_char_count > 0 || data->SingleCharModeLock);
+ out_request->SingleCharSize = (ImS8)c0_len;
+ data->SingleCharModeLock |= (single_char_count >= TYPING_SELECT_SINGLE_CHAR_COUNT_FOR_LOCK); // From now on we stop search matching to lock to single char mode.
+ }
+
+ return out_request;
+}
+
+static int ImStrimatchlen(const char* s1, const char* s1_end, const char* s2)
+{
+ int match_len = 0;
+ while (s1 < s1_end && ImToUpper(*s1++) == ImToUpper(*s2++))
+ match_len++;
+ return match_len;
+}
+
+// Default handler for finding a result for typing-select. You may implement your own.
+// You might want to display a tooltip to visualize the current request SearchBuffer
+// When SingleCharMode is set:
+// - it is better to NOT display a tooltip of other on-screen display indicator.
+// - the index of the currently focused item is required.
+// if your SetNextItemSelectionUserData() values are indices, you can obtain it from ImGuiMultiSelectIO::NavIdItem, otherwise from g.NavLastValidSelectionUserData.
+int ImGui::TypingSelectFindMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx)
+{
+ if (req == NULL || req->SelectRequest == false) // Support NULL parameter so both calls can be done from same spot.
+ return -1;
+ int idx = -1;
+ if (req->SingleCharMode && (req->Flags & ImGuiTypingSelectFlags_AllowSingleCharMode))
+ idx = TypingSelectFindNextSingleCharMatch(req, items_count, get_item_name_func, user_data, nav_item_idx);
+ else
+ idx = TypingSelectFindBestLeadingMatch(req, items_count, get_item_name_func, user_data);
+ if (idx != -1)
+ SetNavCursorVisibleAfterMove();
+ return idx;
+}
+
+// Special handling when a single character is repeated: perform search on a single letter and goes to next.
+int ImGui::TypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx)
+{
+ // FIXME: Assume selection user data is index. Would be extremely practical.
+ //if (nav_item_idx == -1)
+ // nav_item_idx = (int)g.NavLastValidSelectionUserData;
+
+ int first_match_idx = -1;
+ bool return_next_match = false;
+ for (int idx = 0; idx < items_count; idx++)
+ {
+ const char* item_name = get_item_name_func(user_data, idx);
+ if (ImStrimatchlen(req->SearchBuffer, req->SearchBuffer + req->SingleCharSize, item_name) < req->SingleCharSize)
+ continue;
+ if (return_next_match) // Return next matching item after current item.
+ return idx;
+ if (first_match_idx == -1 && nav_item_idx == -1) // Return first match immediately if we don't have a nav_item_idx value.
+ return idx;
+ if (first_match_idx == -1) // Record first match for wrapping.
+ first_match_idx = idx;
+ if (nav_item_idx == idx) // Record that we encountering nav_item so we can return next match.
+ return_next_match = true;
+ }
+ return first_match_idx; // First result
+}
+
+int ImGui::TypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data)
+{
+ int longest_match_idx = -1;
+ int longest_match_len = 0;
+ for (int idx = 0; idx < items_count; idx++)
+ {
+ const char* item_name = get_item_name_func(user_data, idx);
+ const int match_len = ImStrimatchlen(req->SearchBuffer, req->SearchBuffer + req->SearchBufferLen, item_name);
+ if (match_len <= longest_match_len)
+ continue;
+ longest_match_idx = idx;
+ longest_match_len = match_len;
+ if (match_len == req->SearchBufferLen)
+ break;
+ }
+ return longest_match_idx;
+}
+
+void ImGui::DebugNodeTypingSelectState(ImGuiTypingSelectState* data)
+{
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ Text("SearchBuffer = \"%s\"", data->SearchBuffer);
+ Text("SingleCharMode = %d, Size = %d, Lock = %d", data->Request.SingleCharMode, data->Request.SingleCharSize, data->SingleCharModeLock);
+ Text("LastRequest = time: %.2f, frame: %d", data->LastRequestTime, data->LastRequestFrame);
+#else
+ IM_UNUSED(data);
+#endif
+}
+
+//-------------------------------------------------------------------------
+// [SECTION] Widgets: Box-Select support
+// This has been extracted away from Multi-Select logic in the hope that it could eventually be used elsewhere, but hasn't been yet.
+//-------------------------------------------------------------------------
+// Extra logic in MultiSelectItemFooter() and ImGuiListClipper::Step()
+//-------------------------------------------------------------------------
+// - BoxSelectPreStartDrag() [Internal]
+// - BoxSelectActivateDrag() [Internal]
+// - BoxSelectDeactivateDrag() [Internal]
+// - BoxSelectScrollWithMouseDrag() [Internal]
+// - BeginBoxSelect() [Internal]
+// - EndBoxSelect() [Internal]
+//-------------------------------------------------------------------------
+
+// Call on the initial click.
+static void BoxSelectPreStartDrag(ImGuiID id, ImGuiSelectionUserData clicked_item)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiBoxSelectState* bs = &g.BoxSelectState;
+ bs->ID = id;
+ bs->IsStarting = true; // Consider starting box-select.
+ bs->IsStartedFromVoid = (clicked_item == ImGuiSelectionUserData_Invalid);
+ bs->IsStartedSetNavIdOnce = bs->IsStartedFromVoid;
+ bs->KeyMods = g.IO.KeyMods;
+ bs->StartPosRel = bs->EndPosRel = ImGui::WindowPosAbsToRel(g.CurrentWindow, g.IO.MousePos);
+ bs->ScrollAccum = ImVec2(0.0f, 0.0f);
+}
+
+static void BoxSelectActivateDrag(ImGuiBoxSelectState* bs, ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ IMGUI_DEBUG_LOG_SELECTION("[selection] BeginBoxSelect() 0X%08X: Activate\n", bs->ID);
+ bs->IsActive = true;
+ bs->Window = window;
+ bs->IsStarting = false;
+ ImGui::SetActiveID(bs->ID, window);
+ ImGui::SetActiveIdUsingAllKeyboardKeys();
+ if (bs->IsStartedFromVoid && (bs->KeyMods & (ImGuiMod_Ctrl | ImGuiMod_Shift)) == 0)
+ bs->RequestClear = true;
+}
+
+static void BoxSelectDeactivateDrag(ImGuiBoxSelectState* bs)
+{
+ ImGuiContext& g = *GImGui;
+ bs->IsActive = bs->IsStarting = false;
+ if (g.ActiveId == bs->ID)
+ {
+ IMGUI_DEBUG_LOG_SELECTION("[selection] BeginBoxSelect() 0X%08X: Deactivate\n", bs->ID);
+ ImGui::ClearActiveID();
+ }
+ bs->ID = 0;
+}
+
+static void BoxSelectScrollWithMouseDrag(ImGuiBoxSelectState* bs, ImGuiWindow* window, const ImRect& inner_r)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(bs->Window == window);
+ for (int n = 0; n < 2; n++) // each axis
+ {
+ const float mouse_pos = g.IO.MousePos[n];
+ const float dist = (mouse_pos > inner_r.Max[n]) ? mouse_pos - inner_r.Max[n] : (mouse_pos < inner_r.Min[n]) ? mouse_pos - inner_r.Min[n] : 0.0f;
+ const float scroll_curr = window->Scroll[n];
+ if (dist == 0.0f || (dist < 0.0f && scroll_curr < 0.0f) || (dist > 0.0f && scroll_curr >= window->ScrollMax[n]))
+ continue;
+
+ const float speed_multiplier = ImLinearRemapClamp(g.FontSize, g.FontSize * 5.0f, 1.0f, 4.0f, ImAbs(dist)); // x1 to x4 depending on distance
+ const float scroll_step = g.FontSize * 35.0f * speed_multiplier * ImSign(dist) * g.IO.DeltaTime;
+ bs->ScrollAccum[n] += scroll_step;
+
+ // Accumulate into a stored value so we can handle high-framerate
+ const float scroll_step_i = ImFloor(bs->ScrollAccum[n]);
+ if (scroll_step_i == 0.0f)
+ continue;
+ if (n == 0)
+ ImGui::SetScrollX(window, scroll_curr + scroll_step_i);
+ else
+ ImGui::SetScrollY(window, scroll_curr + scroll_step_i);
+ bs->ScrollAccum[n] -= scroll_step_i;
+ }
+}
+
+bool ImGui::BeginBoxSelect(const ImRect& scope_rect, ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiBoxSelectState* bs = &g.BoxSelectState;
+ KeepAliveID(box_select_id);
+ if (bs->ID != box_select_id)
+ return false;
+
+ // IsStarting is set by MultiSelectItemFooter() when considering a possible box-select. We validate it here and lock geometry.
+ bs->UnclipMode = false;
+ bs->RequestClear = false;
+ if (bs->IsStarting && IsMouseDragPastThreshold(0))
+ BoxSelectActivateDrag(bs, window);
+ else if ((bs->IsStarting || bs->IsActive) && g.IO.MouseDown[0] == false)
+ BoxSelectDeactivateDrag(bs);
+ if (!bs->IsActive)
+ return false;
+
+ // Current frame absolute prev/current rectangles are used to toggle selection.
+ // They are derived from positions relative to scrolling space.
+ ImVec2 start_pos_abs = WindowPosRelToAbs(window, bs->StartPosRel);
+ ImVec2 prev_end_pos_abs = WindowPosRelToAbs(window, bs->EndPosRel); // Clamped already
+ ImVec2 curr_end_pos_abs = g.IO.MousePos;
+ if (ms_flags & ImGuiMultiSelectFlags_ScopeWindow) // Box-select scrolling only happens with ScopeWindow
+ curr_end_pos_abs = ImClamp(curr_end_pos_abs, scope_rect.Min, scope_rect.Max);
+ bs->BoxSelectRectPrev.Min = ImMin(start_pos_abs, prev_end_pos_abs);
+ bs->BoxSelectRectPrev.Max = ImMax(start_pos_abs, prev_end_pos_abs);
+ bs->BoxSelectRectCurr.Min = ImMin(start_pos_abs, curr_end_pos_abs);
+ bs->BoxSelectRectCurr.Max = ImMax(start_pos_abs, curr_end_pos_abs);
+
+ // Box-select 2D mode detects horizontal changes (vertical ones are already picked by Clipper)
+ // Storing an extra rect used by widgets supporting box-select.
+ if (ms_flags & ImGuiMultiSelectFlags_BoxSelect2d)
+ if (bs->BoxSelectRectPrev.Min.x != bs->BoxSelectRectCurr.Min.x || bs->BoxSelectRectPrev.Max.x != bs->BoxSelectRectCurr.Max.x)
+ {
+ bs->UnclipMode = true;
+ bs->UnclipRect = bs->BoxSelectRectPrev; // FIXME-OPT: UnclipRect x coordinates could be intersection of Prev and Curr rect on X axis.
+ bs->UnclipRect.Add(bs->BoxSelectRectCurr);
+ }
+
+ //GetForegroundDrawList()->AddRect(bs->UnclipRect.Min, bs->UnclipRect.Max, IM_COL32(255,0,0,200), 0.0f, 0, 3.0f);
+ //GetForegroundDrawList()->AddRect(bs->BoxSelectRectPrev.Min, bs->BoxSelectRectPrev.Max, IM_COL32(255,0,0,200), 0.0f, 0, 3.0f);
+ //GetForegroundDrawList()->AddRect(bs->BoxSelectRectCurr.Min, bs->BoxSelectRectCurr.Max, IM_COL32(0,255,0,200), 0.0f, 0, 1.0f);
+ return true;
+}
+
+void ImGui::EndBoxSelect(const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ ImGuiBoxSelectState* bs = &g.BoxSelectState;
+ IM_ASSERT(bs->IsActive);
+ bs->UnclipMode = false;
+
+ // Render selection rectangle
+ bs->EndPosRel = WindowPosAbsToRel(window, ImClamp(g.IO.MousePos, scope_rect.Min, scope_rect.Max)); // Clamp stored position according to current scrolling view
+ ImRect box_select_r = bs->BoxSelectRectCurr;
+ box_select_r.ClipWith(scope_rect);
+ window->DrawList->AddRectFilled(box_select_r.Min, box_select_r.Max, GetColorU32(ImGuiCol_SeparatorHovered, 0.30f)); // FIXME-MULTISELECT: Styling
+ window->DrawList->AddRect(box_select_r.Min, box_select_r.Max, GetColorU32(ImGuiCol_NavCursor)); // FIXME-MULTISELECT: Styling
+
+ // Scroll
+ const bool enable_scroll = (ms_flags & ImGuiMultiSelectFlags_ScopeWindow) && (ms_flags & ImGuiMultiSelectFlags_BoxSelectNoScroll) == 0;
+ if (enable_scroll)
+ {
+ ImRect scroll_r = scope_rect;
+ scroll_r.Expand(-g.FontSize);
+ //GetForegroundDrawList()->AddRect(scroll_r.Min, scroll_r.Max, IM_COL32(0, 255, 0, 255));
+ if (!scroll_r.Contains(g.IO.MousePos))
+ BoxSelectScrollWithMouseDrag(bs, window, scroll_r);
+ }
+}
+
+//-------------------------------------------------------------------------
+// [SECTION] Widgets: Multi-Select support
+//-------------------------------------------------------------------------
+// - DebugLogMultiSelectRequests() [Internal]
+// - CalcScopeRect() [Internal]
+// - BeginMultiSelect()
+// - EndMultiSelect()
+// - SetNextItemSelectionUserData()
+// - MultiSelectItemHeader() [Internal]
+// - MultiSelectItemFooter() [Internal]
+// - DebugNodeMultiSelectState() [Internal]
+//-------------------------------------------------------------------------
+
+static void DebugLogMultiSelectRequests(const char* function, const ImGuiMultiSelectIO* io)
+{
+ ImGuiContext& g = *GImGui;
+ IM_UNUSED(function);
+ for (const ImGuiSelectionRequest& req : io->Requests)
+ {
+ if (req.Type == ImGuiSelectionRequestType_SetAll) IMGUI_DEBUG_LOG_SELECTION("[selection] %s: Request: SetAll %d (= %s)\n", function, req.Selected, req.Selected ? "SelectAll" : "Clear");
+ if (req.Type == ImGuiSelectionRequestType_SetRange) IMGUI_DEBUG_LOG_SELECTION("[selection] %s: Request: SetRange %" IM_PRId64 "..%" IM_PRId64 " (0x%" IM_PRIX64 "..0x%" IM_PRIX64 ") = %d (dir %d)\n", function, req.RangeFirstItem, req.RangeLastItem, req.RangeFirstItem, req.RangeLastItem, req.Selected, req.RangeDirection);
+ }
+}
+
+static ImRect CalcScopeRect(ImGuiMultiSelectTempData* ms, ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ if (ms->Flags & ImGuiMultiSelectFlags_ScopeRect)
+ {
+ // Warning: this depends on CursorMaxPos so it means to be called by EndMultiSelect() only
+ return ImRect(ms->ScopeRectMin, ImMax(window->DC.CursorMaxPos, ms->ScopeRectMin));
+ }
+ else
+ {
+ // When a table, pull HostClipRect, which allows us to predict ClipRect before first row/layout is performed. (#7970)
+ ImRect scope_rect = window->InnerClipRect;
+ if (g.CurrentTable != NULL)
+ scope_rect = g.CurrentTable->HostClipRect;
+
+ // Add inner table decoration (#7821) // FIXME: Why not baking in InnerClipRect?
+ scope_rect.Min = ImMin(scope_rect.Min + ImVec2(window->DecoInnerSizeX1, window->DecoInnerSizeY1), scope_rect.Max);
+ return scope_rect;
+ }
+}
+
+// Return ImGuiMultiSelectIO structure.
+// Lifetime: don't hold on ImGuiMultiSelectIO* pointers over multiple frames or past any subsequent call to BeginMultiSelect() or EndMultiSelect().
+// Passing 'selection_size' and 'items_count' parameters is currently optional.
+// - 'selection_size' is useful to disable some shortcut routing: e.g. ImGuiMultiSelectFlags_ClearOnEscape won't claim Escape key when selection_size 0,
+// allowing a first press to clear selection THEN the second press to leave child window and return to parent.
+// - 'items_count' is stored in ImGuiMultiSelectIO which makes it a convenient way to pass the information to your ApplyRequest() handler (but you may pass it differently).
+// - If they are costly for you to compute (e.g. external intrusive selection without maintaining size), you may avoid them and pass -1.
+// - If you can easily tell if your selection is empty or not, you may pass 0/1, or you may enable ImGuiMultiSelectFlags_ClearOnEscape flag dynamically.
+ImGuiMultiSelectIO* ImGui::BeginMultiSelect(ImGuiMultiSelectFlags flags, int selection_size, int items_count)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+
+ if (++g.MultiSelectTempDataStacked > g.MultiSelectTempData.Size)
+ g.MultiSelectTempData.resize(g.MultiSelectTempDataStacked, ImGuiMultiSelectTempData());
+ ImGuiMultiSelectTempData* ms = &g.MultiSelectTempData[g.MultiSelectTempDataStacked - 1];
+ IM_STATIC_ASSERT(offsetof(ImGuiMultiSelectTempData, IO) == 0); // Clear() relies on that.
+ g.CurrentMultiSelect = ms;
+ if ((flags & (ImGuiMultiSelectFlags_ScopeWindow | ImGuiMultiSelectFlags_ScopeRect)) == 0)
+ flags |= ImGuiMultiSelectFlags_ScopeWindow;
+ if (flags & ImGuiMultiSelectFlags_SingleSelect)
+ flags &= ~(ImGuiMultiSelectFlags_BoxSelect2d | ImGuiMultiSelectFlags_BoxSelect1d);
+ if (flags & ImGuiMultiSelectFlags_BoxSelect2d)
+ flags &= ~ImGuiMultiSelectFlags_BoxSelect1d;
+
+ // FIXME: Workaround to the fact we override CursorMaxPos, meaning size measurement are lost. (#8250)
+ // They should perhaps be stacked properly?
+ if (ImGuiTable* table = g.CurrentTable)
+ if (table->CurrentColumn != -1)
+ TableEndCell(table); // This is currently safe to call multiple time. If that properly is lost we can extract the "save measurement" part of it.
+
+ // FIXME: BeginFocusScope()
+ const ImGuiID id = window->IDStack.back();
+ ms->Clear();
+ ms->FocusScopeId = id;
+ ms->Flags = flags;
+ ms->IsFocused = (ms->FocusScopeId == g.NavFocusScopeId);
+ ms->BackupCursorMaxPos = window->DC.CursorMaxPos;
+ ms->ScopeRectMin = window->DC.CursorMaxPos = window->DC.CursorPos;
+ PushFocusScope(ms->FocusScopeId);
+ if (flags & ImGuiMultiSelectFlags_ScopeWindow) // Mark parent child window as navigable into, with highlight. Assume user will always submit interactive items.
+ window->DC.NavLayersActiveMask |= 1 << ImGuiNavLayer_Main;
+
+ // Use copy of keyboard mods at the time of the request, otherwise we would requires mods to be held for an extra frame.
+ ms->KeyMods = g.NavJustMovedToId ? (g.NavJustMovedToIsTabbing ? 0 : g.NavJustMovedToKeyMods) : g.IO.KeyMods;
+ if (flags & ImGuiMultiSelectFlags_NoRangeSelect)
+ ms->KeyMods &= ~ImGuiMod_Shift;
+
+ // Bind storage
+ ImGuiMultiSelectState* storage = g.MultiSelectStorage.GetOrAddByKey(id);
+ storage->ID = id;
+ storage->LastFrameActive = g.FrameCount;
+ storage->LastSelectionSize = selection_size;
+ storage->Window = window;
+ ms->Storage = storage;
+
+ // Output to user
+ ms->IO.Requests.resize(0);
+ ms->IO.RangeSrcItem = storage->RangeSrcItem;
+ ms->IO.NavIdItem = storage->NavIdItem;
+ ms->IO.NavIdSelected = (storage->NavIdSelected == 1) ? true : false;
+ ms->IO.ItemsCount = items_count;
+
+ // Clear when using Navigation to move within the scope
+ // (we compare FocusScopeId so it possible to use multiple selections inside a same window)
+ bool request_clear = false;
+ bool request_select_all = false;
+ if (g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == ms->FocusScopeId && g.NavJustMovedToHasSelectionData)
+ {
+ if (ms->KeyMods & ImGuiMod_Shift)
+ ms->IsKeyboardSetRange = true;
+ if (ms->IsKeyboardSetRange)
+ IM_ASSERT(storage->RangeSrcItem != ImGuiSelectionUserData_Invalid); // Not ready -> could clear?
+ if ((ms->KeyMods & (ImGuiMod_Ctrl | ImGuiMod_Shift)) == 0 && (flags & (ImGuiMultiSelectFlags_NoAutoClear | ImGuiMultiSelectFlags_NoAutoSelect)) == 0)
+ request_clear = true;
+ }
+ else if (g.NavJustMovedFromFocusScopeId == ms->FocusScopeId)
+ {
+ // Also clear on leaving scope (may be optional?)
+ if ((ms->KeyMods & (ImGuiMod_Ctrl | ImGuiMod_Shift)) == 0 && (flags & (ImGuiMultiSelectFlags_NoAutoClear | ImGuiMultiSelectFlags_NoAutoSelect)) == 0)
+ request_clear = true;
+ }
+
+ // Box-select handling: update active state.
+ ImGuiBoxSelectState* bs = &g.BoxSelectState;
+ if (flags & (ImGuiMultiSelectFlags_BoxSelect1d | ImGuiMultiSelectFlags_BoxSelect2d))
+ {
+ ms->BoxSelectId = GetID("##BoxSelect");
+ if (BeginBoxSelect(CalcScopeRect(ms, window), window, ms->BoxSelectId, flags))
+ request_clear |= bs->RequestClear;
+ }
+
+ if (ms->IsFocused)
+ {
+ // Shortcut: Clear selection (Escape)
+ // - Only claim shortcut if selection is not empty, allowing further presses on Escape to e.g. leave current child window.
+ // - Box select also handle Escape and needs to pass an id to bypass ActiveIdUsingAllKeyboardKeys lock.
+ if (flags & ImGuiMultiSelectFlags_ClearOnEscape)
+ {
+ if (selection_size != 0 || bs->IsActive)
+ if (Shortcut(ImGuiKey_Escape, ImGuiInputFlags_None, bs->IsActive ? bs->ID : 0))
+ {
+ request_clear = true;
+ if (bs->IsActive)
+ BoxSelectDeactivateDrag(bs);
+ }
+ }
+
+ // Shortcut: Select all (CTRL+A)
+ if (!(flags & ImGuiMultiSelectFlags_SingleSelect) && !(flags & ImGuiMultiSelectFlags_NoSelectAll))
+ if (Shortcut(ImGuiMod_Ctrl | ImGuiKey_A))
+ request_select_all = true;
+ }
+
+ if (request_clear || request_select_all)
+ {
+ MultiSelectAddSetAll(ms, request_select_all);
+ if (!request_select_all)
+ storage->LastSelectionSize = 0;
+ }
+ ms->LoopRequestSetAll = request_select_all ? 1 : request_clear ? 0 : -1;
+ ms->LastSubmittedItem = ImGuiSelectionUserData_Invalid;
+
+ if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection)
+ DebugLogMultiSelectRequests("BeginMultiSelect", &ms->IO);
+
+ return &ms->IO;
+}
+
+// Return updated ImGuiMultiSelectIO structure.
+// Lifetime: don't hold on ImGuiMultiSelectIO* pointers over multiple frames or past any subsequent call to BeginMultiSelect() or EndMultiSelect().
+ImGuiMultiSelectIO* ImGui::EndMultiSelect()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect;
+ ImGuiMultiSelectState* storage = ms->Storage;
+ ImGuiWindow* window = g.CurrentWindow;
+ IM_ASSERT_USER_ERROR(ms->FocusScopeId == g.CurrentFocusScopeId, "EndMultiSelect() FocusScope mismatch!");
+ IM_ASSERT(g.CurrentMultiSelect != NULL && storage->Window == g.CurrentWindow);
+ IM_ASSERT(g.MultiSelectTempDataStacked > 0 && &g.MultiSelectTempData[g.MultiSelectTempDataStacked - 1] == g.CurrentMultiSelect);
+
+ ImRect scope_rect = CalcScopeRect(ms, window);
+ if (ms->IsFocused)
+ {
+ // We currently don't allow user code to modify RangeSrcItem by writing to BeginIO's version, but that would be an easy change here.
+ if (ms->IO.RangeSrcReset || (ms->RangeSrcPassedBy == false && ms->IO.RangeSrcItem != ImGuiSelectionUserData_Invalid)) // Can't read storage->RangeSrcItem here -> we want the state at begining of the scope (see tests for easy failure)
+ {
+ IMGUI_DEBUG_LOG_SELECTION("[selection] EndMultiSelect: Reset RangeSrcItem.\n"); // Will set be to NavId.
+ storage->RangeSrcItem = ImGuiSelectionUserData_Invalid;
+ }
+ if (ms->NavIdPassedBy == false && storage->NavIdItem != ImGuiSelectionUserData_Invalid)
+ {
+ IMGUI_DEBUG_LOG_SELECTION("[selection] EndMultiSelect: Reset NavIdItem.\n");
+ storage->NavIdItem = ImGuiSelectionUserData_Invalid;
+ storage->NavIdSelected = -1;
+ }
+
+ if ((ms->Flags & (ImGuiMultiSelectFlags_BoxSelect1d | ImGuiMultiSelectFlags_BoxSelect2d)) && GetBoxSelectState(ms->BoxSelectId))
+ EndBoxSelect(scope_rect, ms->Flags);
+ }
+
+ if (ms->IsEndIO == false)
+ ms->IO.Requests.resize(0);
+
+ // Clear selection when clicking void?
+ // We specifically test for IsMouseDragPastThreshold(0) == false to allow box-selection!
+ // The InnerRect test is necessary for non-child/decorated windows.
+ bool scope_hovered = IsWindowHovered() && window->InnerRect.Contains(g.IO.MousePos);
+ if (scope_hovered && (ms->Flags & ImGuiMultiSelectFlags_ScopeRect))
+ scope_hovered &= scope_rect.Contains(g.IO.MousePos);
+ if (scope_hovered && g.HoveredId == 0 && g.ActiveId == 0)
+ {
+ if (ms->Flags & (ImGuiMultiSelectFlags_BoxSelect1d | ImGuiMultiSelectFlags_BoxSelect2d))
+ {
+ if (!g.BoxSelectState.IsActive && !g.BoxSelectState.IsStarting && g.IO.MouseClickedCount[0] == 1)
+ {
+ BoxSelectPreStartDrag(ms->BoxSelectId, ImGuiSelectionUserData_Invalid);
+ FocusWindow(window, ImGuiFocusRequestFlags_UnlessBelowModal);
+ SetHoveredID(ms->BoxSelectId);
+ if (ms->Flags & ImGuiMultiSelectFlags_ScopeRect)
+ SetNavID(0, ImGuiNavLayer_Main, ms->FocusScopeId, ImRect(g.IO.MousePos, g.IO.MousePos)); // Automatically switch FocusScope for initial click from void to box-select.
+ }
+ }
+
+ if (ms->Flags & ImGuiMultiSelectFlags_ClearOnClickVoid)
+ if (IsMouseReleased(0) && IsMouseDragPastThreshold(0) == false && g.IO.KeyMods == ImGuiMod_None)
+ MultiSelectAddSetAll(ms, false);
+ }
+
+ // Courtesy nav wrapping helper flag
+ if (ms->Flags & ImGuiMultiSelectFlags_NavWrapX)
+ {
+ IM_ASSERT(ms->Flags & ImGuiMultiSelectFlags_ScopeWindow); // Only supported at window scope
+ ImGui::NavMoveRequestTryWrapping(ImGui::GetCurrentWindow(), ImGuiNavMoveFlags_WrapX);
+ }
+
+ // Unwind
+ window->DC.CursorMaxPos = ImMax(ms->BackupCursorMaxPos, window->DC.CursorMaxPos);
+ PopFocusScope();
+
+ if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection)
+ DebugLogMultiSelectRequests("EndMultiSelect", &ms->IO);
+
+ ms->FocusScopeId = 0;
+ ms->Flags = ImGuiMultiSelectFlags_None;
+ g.CurrentMultiSelect = (--g.MultiSelectTempDataStacked > 0) ? &g.MultiSelectTempData[g.MultiSelectTempDataStacked - 1] : NULL;
+
+ return &ms->IO;
+}
+
+void ImGui::SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data)
+{
+ // Note that flags will be cleared by ItemAdd(), so it's only useful for Navigation code!
+ // This designed so widgets can also cheaply set this before calling ItemAdd(), so we are not tied to MultiSelect api.
+ ImGuiContext& g = *GImGui;
+ g.NextItemData.SelectionUserData = selection_user_data;
+ g.NextItemData.FocusScopeId = g.CurrentFocusScopeId;
+
+ if (ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect)
+ {
+ // Auto updating RangeSrcPassedBy for cases were clipper is not used (done before ItemAdd() clipping)
+ g.NextItemData.ItemFlags |= ImGuiItemFlags_HasSelectionUserData | ImGuiItemFlags_IsMultiSelect;
+ if (ms->IO.RangeSrcItem == selection_user_data)
+ ms->RangeSrcPassedBy = true;
+ }
+ else
+ {
+ g.NextItemData.ItemFlags |= ImGuiItemFlags_HasSelectionUserData;
+ }
+}
+
+// In charge of:
+// - Applying SetAll for submitted items.
+// - Applying SetRange for submitted items and record end points.
+// - Altering button behavior flags to facilitate use with drag and drop.
+void ImGui::MultiSelectItemHeader(ImGuiID id, bool* p_selected, ImGuiButtonFlags* p_button_flags)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect;
+
+ bool selected = *p_selected;
+ if (ms->IsFocused)
+ {
+ ImGuiMultiSelectState* storage = ms->Storage;
+ ImGuiSelectionUserData item_data = g.NextItemData.SelectionUserData;
+ IM_ASSERT(g.NextItemData.FocusScopeId == g.CurrentFocusScopeId && "Forgot to call SetNextItemSelectionUserData() prior to item, required in BeginMultiSelect()/EndMultiSelect() scope");
+
+ // Apply SetAll (Clear/SelectAll) requests requested by BeginMultiSelect().
+ // This is only useful if the user hasn't processed them already, and this only works if the user isn't using the clipper.
+ // If you are using a clipper you need to process the SetAll request after calling BeginMultiSelect()
+ if (ms->LoopRequestSetAll != -1)
+ selected = (ms->LoopRequestSetAll == 1);
+
+ // When using SHIFT+Nav: because it can incur scrolling we cannot afford a frame of lag with the selection highlight (otherwise scrolling would happen before selection)
+ // For this to work, we need someone to set 'RangeSrcPassedBy = true' at some point (either clipper either SetNextItemSelectionUserData() function)
+ if (ms->IsKeyboardSetRange)
+ {
+ IM_ASSERT(id != 0 && (ms->KeyMods & ImGuiMod_Shift) != 0);
+ const bool is_range_dst = (ms->RangeDstPassedBy == false) && g.NavJustMovedToId == id; // Assume that g.NavJustMovedToId is not clipped.
+ if (is_range_dst)
+ ms->RangeDstPassedBy = true;
+ if (is_range_dst && storage->RangeSrcItem == ImGuiSelectionUserData_Invalid) // If we don't have RangeSrc, assign RangeSrc = RangeDst
+ {
+ storage->RangeSrcItem = item_data;
+ storage->RangeSelected = selected ? 1 : 0;
+ }
+ const bool is_range_src = storage->RangeSrcItem == item_data;
+ if (is_range_src || is_range_dst || ms->RangeSrcPassedBy != ms->RangeDstPassedBy)
+ {
+ // Apply range-select value to visible items
+ IM_ASSERT(storage->RangeSrcItem != ImGuiSelectionUserData_Invalid && storage->RangeSelected != -1);
+ selected = (storage->RangeSelected != 0);
+ }
+ else if ((ms->KeyMods & ImGuiMod_Ctrl) == 0 && (ms->Flags & ImGuiMultiSelectFlags_NoAutoClear) == 0)
+ {
+ // Clear other items
+ selected = false;
+ }
+ }
+ *p_selected = selected;
+ }
+
+ // Alter button behavior flags
+ // To handle drag and drop of multiple items we need to avoid clearing selection on click.
+ // Enabling this test makes actions using CTRL+SHIFT delay their effect on MouseUp which is annoying, but it allows drag and drop of multiple items.
+ if (p_button_flags != NULL)
+ {
+ ImGuiButtonFlags button_flags = *p_button_flags;
+ button_flags |= ImGuiButtonFlags_NoHoveredOnFocus;
+ if ((!selected || (g.ActiveId == id && g.ActiveIdHasBeenPressedBefore)) && !(ms->Flags & ImGuiMultiSelectFlags_SelectOnClickRelease))
+ button_flags = (button_flags | ImGuiButtonFlags_PressedOnClick) & ~ImGuiButtonFlags_PressedOnClickRelease;
+ else
+ button_flags |= ImGuiButtonFlags_PressedOnClickRelease;
+ *p_button_flags = button_flags;
+ }
+}
+
+// In charge of:
+// - Auto-select on navigation.
+// - Box-select toggle handling.
+// - Right-click handling.
+// - Altering selection based on Ctrl/Shift modifiers, both for keyboard and mouse.
+// - Record current selection state for RangeSrc
+// This is all rather complex, best to run and refer to "widgets_multiselect_xxx" tests in imgui_test_suite.
+void ImGui::MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+
+ bool selected = *p_selected;
+ bool pressed = *p_pressed;
+ ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect;
+ ImGuiMultiSelectState* storage = ms->Storage;
+ if (pressed)
+ ms->IsFocused = true;
+
+ bool hovered = false;
+ if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredRect)
+ hovered = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup);
+ if (!ms->IsFocused && !hovered)
+ return;
+
+ ImGuiSelectionUserData item_data = g.NextItemData.SelectionUserData;
+
+ ImGuiMultiSelectFlags flags = ms->Flags;
+ const bool is_singleselect = (flags & ImGuiMultiSelectFlags_SingleSelect) != 0;
+ bool is_ctrl = (ms->KeyMods & ImGuiMod_Ctrl) != 0;
+ bool is_shift = (ms->KeyMods & ImGuiMod_Shift) != 0;
+
+ bool apply_to_range_src = false;
+
+ if (g.NavId == id && storage->RangeSrcItem == ImGuiSelectionUserData_Invalid)
+ apply_to_range_src = true;
+ if (ms->IsEndIO == false)
+ {
+ ms->IO.Requests.resize(0);
+ ms->IsEndIO = true;
+ }
+
+ // Auto-select as you navigate a list
+ if (g.NavJustMovedToId == id)
+ {
+ if ((flags & ImGuiMultiSelectFlags_NoAutoSelect) == 0)
+ {
+ if (is_ctrl && is_shift)
+ pressed = true;
+ else if (!is_ctrl)
+ selected = pressed = true;
+ }
+ else
+ {
+ // With NoAutoSelect, using Shift+keyboard performs a write/copy
+ if (is_shift)
+ pressed = true;
+ else if (!is_ctrl)
+ apply_to_range_src = true; // Since if (pressed) {} main block is not running we update this
+ }
+ }
+
+ if (apply_to_range_src)
+ {
+ storage->RangeSrcItem = item_data;
+ storage->RangeSelected = selected; // Will be updated at the end of this function anyway.
+ }
+
+ // Box-select toggle handling
+ if (ms->BoxSelectId != 0)
+ if (ImGuiBoxSelectState* bs = GetBoxSelectState(ms->BoxSelectId))
+ {
+ const bool rect_overlap_curr = bs->BoxSelectRectCurr.Overlaps(g.LastItemData.Rect);
+ const bool rect_overlap_prev = bs->BoxSelectRectPrev.Overlaps(g.LastItemData.Rect);
+ if ((rect_overlap_curr && !rect_overlap_prev && !selected) || (rect_overlap_prev && !rect_overlap_curr))
+ {
+ if (storage->LastSelectionSize <= 0 && bs->IsStartedSetNavIdOnce)
+ {
+ pressed = true; // First item act as a pressed: code below will emit selection request and set NavId (whatever we emit here will be overridden anyway)
+ bs->IsStartedSetNavIdOnce = false;
+ }
+ else
+ {
+ selected = !selected;
+ MultiSelectAddSetRange(ms, selected, +1, item_data, item_data);
+ }
+ storage->LastSelectionSize = ImMax(storage->LastSelectionSize + 1, 1);
+ }
+ }
+
+ // Right-click handling.
+ // FIXME-MULTISELECT: Currently filtered out by ImGuiMultiSelectFlags_NoAutoSelect but maybe should be moved to Selectable(). See https://github.com/ocornut/imgui/pull/5816
+ if (hovered && IsMouseClicked(1) && (flags & ImGuiMultiSelectFlags_NoAutoSelect) == 0)
+ {
+ if (g.ActiveId != 0 && g.ActiveId != id)
+ ClearActiveID();
+ SetFocusID(id, window);
+ if (!pressed && !selected)
+ {
+ pressed = true;
+ is_ctrl = is_shift = false;
+ }
+ }
+
+ // Unlike Space, Enter doesn't alter selection (but can still return a press) unless current item is not selected.
+ // The later, "unless current item is not select", may become optional? It seems like a better default if Enter doesn't necessarily open something
+ // (unlike e.g. Windows explorer). For use case where Enter always open something, we might decide to make this optional?
+ const bool enter_pressed = pressed && (g.NavActivateId == id) && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput);
+
+ // Alter selection
+ if (pressed && (!enter_pressed || !selected))
+ {
+ // Box-select
+ ImGuiInputSource input_source = (g.NavJustMovedToId == id || g.NavActivateId == id) ? g.NavInputSource : ImGuiInputSource_Mouse;
+ if (flags & (ImGuiMultiSelectFlags_BoxSelect1d | ImGuiMultiSelectFlags_BoxSelect2d))
+ if (selected == false && !g.BoxSelectState.IsActive && !g.BoxSelectState.IsStarting && input_source == ImGuiInputSource_Mouse && g.IO.MouseClickedCount[0] == 1)
+ BoxSelectPreStartDrag(ms->BoxSelectId, item_data);
+
+ //----------------------------------------------------------------------------------------
+ // ACTION | Begin | Pressed/Activated | End
+ //----------------------------------------------------------------------------------------
+ // Keys Navigated: | Clear | Src=item, Sel=1 SetRange 1
+ // Keys Navigated: Ctrl | n/a | n/a
+ // Keys Navigated: Shift | n/a | Dst=item, Sel=1, => Clear + SetRange 1
+ // Keys Navigated: Ctrl+Shift | n/a | Dst=item, Sel=Src => Clear + SetRange Src-Dst
+ // Keys Activated: | n/a | Src=item, Sel=1 => Clear + SetRange 1
+ // Keys Activated: Ctrl | n/a | Src=item, Sel=!Sel => SetSange 1
+ // Keys Activated: Shift | n/a | Dst=item, Sel=1 => Clear + SetSange 1
+ //----------------------------------------------------------------------------------------
+ // Mouse Pressed: | n/a | Src=item, Sel=1, => Clear + SetRange 1
+ // Mouse Pressed: Ctrl | n/a | Src=item, Sel=!Sel => SetRange 1
+ // Mouse Pressed: Shift | n/a | Dst=item, Sel=1, => Clear + SetRange 1
+ // Mouse Pressed: Ctrl+Shift | n/a | Dst=item, Sel=!Sel => SetRange Src-Dst
+ //----------------------------------------------------------------------------------------
+
+ if ((flags & ImGuiMultiSelectFlags_NoAutoClear) == 0)
+ {
+ bool request_clear = false;
+ if (is_singleselect)
+ request_clear = true;
+ else if ((input_source == ImGuiInputSource_Mouse || g.NavActivateId == id) && !is_ctrl)
+ request_clear = (flags & ImGuiMultiSelectFlags_NoAutoClearOnReselect) ? !selected : true;
+ else if ((input_source == ImGuiInputSource_Keyboard || input_source == ImGuiInputSource_Gamepad) && is_shift && !is_ctrl)
+ request_clear = true; // With is_shift==false the RequestClear was done in BeginIO, not necessary to do again.
+ if (request_clear)
+ MultiSelectAddSetAll(ms, false);
+ }
+
+ int range_direction;
+ bool range_selected;
+ if (is_shift && !is_singleselect)
+ {
+ //IM_ASSERT(storage->HasRangeSrc && storage->HasRangeValue);
+ if (storage->RangeSrcItem == ImGuiSelectionUserData_Invalid)
+ storage->RangeSrcItem = item_data;
+ if ((flags & ImGuiMultiSelectFlags_NoAutoSelect) == 0)
+ {
+ // Shift+Arrow always select
+ // Ctrl+Shift+Arrow copy source selection state (already stored by BeginMultiSelect() in storage->RangeSelected)
+ range_selected = (is_ctrl && storage->RangeSelected != -1) ? (storage->RangeSelected != 0) : true;
+ }
+ else
+ {
+ // Shift+Arrow copy source selection state
+ // Shift+Click always copy from target selection state
+ if (ms->IsKeyboardSetRange)
+ range_selected = (storage->RangeSelected != -1) ? (storage->RangeSelected != 0) : true;
+ else
+ range_selected = !selected;
+ }
+ range_direction = ms->RangeSrcPassedBy ? +1 : -1;
+ }
+ else
+ {
+ // Ctrl inverts selection, otherwise always select
+ if ((flags & ImGuiMultiSelectFlags_NoAutoSelect) == 0)
+ selected = is_ctrl ? !selected : true;
+ else
+ selected = !selected;
+ storage->RangeSrcItem = item_data;
+ range_selected = selected;
+ range_direction = +1;
+ }
+ MultiSelectAddSetRange(ms, range_selected, range_direction, storage->RangeSrcItem, item_data);
+ }
+
+ // Update/store the selection state of the Source item (used by CTRL+SHIFT, when Source is unselected we perform a range unselect)
+ if (storage->RangeSrcItem == item_data)
+ storage->RangeSelected = selected ? 1 : 0;
+
+ // Update/store the selection state of focused item
+ if (g.NavId == id)
+ {
+ storage->NavIdItem = item_data;
+ storage->NavIdSelected = selected ? 1 : 0;
+ }
+ if (storage->NavIdItem == item_data)
+ ms->NavIdPassedBy = true;
+ ms->LastSubmittedItem = item_data;
+
+ *p_selected = selected;
+ *p_pressed = pressed;
+}
+
+void ImGui::MultiSelectAddSetAll(ImGuiMultiSelectTempData* ms, bool selected)
+{
+ ImGuiSelectionRequest req = { ImGuiSelectionRequestType_SetAll, selected, 0, ImGuiSelectionUserData_Invalid, ImGuiSelectionUserData_Invalid };
+ ms->IO.Requests.resize(0); // Can always clear previous requests
+ ms->IO.Requests.push_back(req); // Add new request
+}
+
+void ImGui::MultiSelectAddSetRange(ImGuiMultiSelectTempData* ms, bool selected, int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item)
+{
+ // Merge contiguous spans into same request (unless NoRangeSelect is set which guarantees single-item ranges)
+ if (ms->IO.Requests.Size > 0 && first_item == last_item && (ms->Flags & ImGuiMultiSelectFlags_NoRangeSelect) == 0)
+ {
+ ImGuiSelectionRequest* prev = &ms->IO.Requests.Data[ms->IO.Requests.Size - 1];
+ if (prev->Type == ImGuiSelectionRequestType_SetRange && prev->RangeLastItem == ms->LastSubmittedItem && prev->Selected == selected)
+ {
+ prev->RangeLastItem = last_item;
+ return;
+ }
+ }
+
+ ImGuiSelectionRequest req = { ImGuiSelectionRequestType_SetRange, selected, (ImS8)range_dir, (range_dir > 0) ? first_item : last_item, (range_dir > 0) ? last_item : first_item };
+ ms->IO.Requests.push_back(req); // Add new request
+}
+
+void ImGui::DebugNodeMultiSelectState(ImGuiMultiSelectState* storage)
+{
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ const bool is_active = (storage->LastFrameActive >= GetFrameCount() - 2); // Note that fully clipped early out scrolling tables will appear as inactive here.
+ if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); }
+ bool open = TreeNode((void*)(intptr_t)storage->ID, "MultiSelect 0x%08X in '%s'%s", storage->ID, storage->Window ? storage->Window->Name : "N/A", is_active ? "" : " *Inactive*");
+ if (!is_active) { PopStyleColor(); }
+ if (!open)
+ return;
+ Text("RangeSrcItem = %" IM_PRId64 " (0x%" IM_PRIX64 "), RangeSelected = %d", storage->RangeSrcItem, storage->RangeSrcItem, storage->RangeSelected);
+ Text("NavIdItem = %" IM_PRId64 " (0x%" IM_PRIX64 "), NavIdSelected = %d", storage->NavIdItem, storage->NavIdItem, storage->NavIdSelected);
+ Text("LastSelectionSize = %d", storage->LastSelectionSize); // Provided by user
+ TreePop();
+#else
+ IM_UNUSED(storage);
+#endif
+}
+
+//-------------------------------------------------------------------------
+// [SECTION] Widgets: Multi-Select helpers
+//-------------------------------------------------------------------------
+// - ImGuiSelectionBasicStorage
+// - ImGuiSelectionExternalStorage
+//-------------------------------------------------------------------------
+
+ImGuiSelectionBasicStorage::ImGuiSelectionBasicStorage()
+{
+ Size = 0;
+ PreserveOrder = false;
+ UserData = NULL;
+ AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage*, int idx) { return (ImGuiID)idx; };
+ _SelectionOrder = 1; // Always >0
+}
+
+void ImGuiSelectionBasicStorage::Clear()
+{
+ Size = 0;
+ _SelectionOrder = 1; // Always >0
+ _Storage.Data.resize(0);
+}
+
+void ImGuiSelectionBasicStorage::Swap(ImGuiSelectionBasicStorage& r)
+{
+ ImSwap(Size, r.Size);
+ ImSwap(_SelectionOrder, r._SelectionOrder);
+ _Storage.Data.swap(r._Storage.Data);
+}
+
+bool ImGuiSelectionBasicStorage::Contains(ImGuiID id) const
+{
+ return _Storage.GetInt(id, 0) != 0;
+}
+
+static int IMGUI_CDECL PairComparerByValueInt(const void* lhs, const void* rhs)
+{
+ int lhs_v = ((const ImGuiStoragePair*)lhs)->val_i;
+ int rhs_v = ((const ImGuiStoragePair*)rhs)->val_i;
+ return (lhs_v > rhs_v ? +1 : lhs_v < rhs_v ? -1 : 0);
+}
+
+// GetNextSelectedItem() is an abstraction allowing us to change our underlying actual storage system without impacting user.
+// (e.g. store unselected vs compact down, compact down on demand, use raw ImVector<ImGuiID> instead of ImGuiStorage...)
+bool ImGuiSelectionBasicStorage::GetNextSelectedItem(void** opaque_it, ImGuiID* out_id)
+{
+ ImGuiStoragePair* it = (ImGuiStoragePair*)*opaque_it;
+ ImGuiStoragePair* it_end = _Storage.Data.Data + _Storage.Data.Size;
+ if (PreserveOrder && it == NULL && it_end != NULL)
+ ImQsort(_Storage.Data.Data, (size_t)_Storage.Data.Size, sizeof(ImGuiStoragePair), PairComparerByValueInt); // ~ImGuiStorage::BuildSortByValueInt()
+ if (it == NULL)
+ it = _Storage.Data.Data;
+ IM_ASSERT(it >= _Storage.Data.Data && it <= it_end);
+ if (it != it_end)
+ while (it->val_i == 0 && it < it_end)
+ it++;
+ const bool has_more = (it != it_end);
+ *opaque_it = has_more ? (void**)(it + 1) : (void**)(it);
+ *out_id = has_more ? it->key : 0;
+ if (PreserveOrder && !has_more)
+ _Storage.BuildSortByKey();
+ return has_more;
+}
+
+void ImGuiSelectionBasicStorage::SetItemSelected(ImGuiID id, bool selected)
+{
+ int* p_int = _Storage.GetIntRef(id, 0);
+ if (selected && *p_int == 0) { *p_int = _SelectionOrder++; Size++; }
+ else if (!selected && *p_int != 0) { *p_int = 0; Size--; }
+}
+
+// Optimized for batch edits (with same value of 'selected')
+static void ImGuiSelectionBasicStorage_BatchSetItemSelected(ImGuiSelectionBasicStorage* selection, ImGuiID id, bool selected, int size_before_amends, int selection_order)
+{
+ ImGuiStorage* storage = &selection->_Storage;
+ ImGuiStoragePair* it = ImLowerBound(storage->Data.Data, storage->Data.Data + size_before_amends, id);
+ const bool is_contained = (it != storage->Data.Data + size_before_amends) && (it->key == id);
+ if (selected == (is_contained && it->val_i != 0))
+ return;
+ if (selected && !is_contained)
+ storage->Data.push_back(ImGuiStoragePair(id, selection_order)); // Push unsorted at end of vector, will be sorted in SelectionMultiAmendsFinish()
+ else if (is_contained)
+ it->val_i = selected ? selection_order : 0; // Modify in-place.
+ selection->Size += selected ? +1 : -1;
+}
+
+static void ImGuiSelectionBasicStorage_BatchFinish(ImGuiSelectionBasicStorage* selection, bool selected, int size_before_amends)
+{
+ ImGuiStorage* storage = &selection->_Storage;
+ if (selected && selection->Size != size_before_amends)
+ storage->BuildSortByKey(); // When done selecting: sort everything
+}
+
+// Apply requests coming from BeginMultiSelect() and EndMultiSelect().
+// - Enable 'Demo->Tools->Debug Log->Selection' to see selection requests as they happen.
+// - Honoring SetRange requests requires that you can iterate/interpolate between RangeFirstItem and RangeLastItem.
+// - In this demo we often submit indices to SetNextItemSelectionUserData() + store the same indices in persistent selection.
+// - Your code may do differently. If you store pointers or objects ID in ImGuiSelectionUserData you may need to perform
+// a lookup in order to have some way to iterate/interpolate between two items.
+// - A full-featured application is likely to allow search/filtering which is likely to lead to using indices
+// and constructing a view index <> object id/ptr data structure anyway.
+// WHEN YOUR APPLICATION SETTLES ON A CHOICE, YOU WILL PROBABLY PREFER TO GET RID OF THIS UNNECESSARY 'ImGuiSelectionBasicStorage' INDIRECTION LOGIC.
+// Notice that with the simplest adapter (using indices everywhere), all functions return their parameters.
+// The most simple implementation (using indices everywhere) would look like:
+// for (ImGuiSelectionRequest& req : ms_io->Requests)
+// {
+// if (req.Type == ImGuiSelectionRequestType_SetAll) { Clear(); if (req.Selected) { for (int n = 0; n < items_count; n++) { SetItemSelected(n, true); } }
+// if (req.Type == ImGuiSelectionRequestType_SetRange) { for (int n = (int)ms_io->RangeFirstItem; n <= (int)ms_io->RangeLastItem; n++) { SetItemSelected(n, ms_io->Selected); } }
+// }
+void ImGuiSelectionBasicStorage::ApplyRequests(ImGuiMultiSelectIO* ms_io)
+{
+ // For convenience we obtain ItemsCount as passed to BeginMultiSelect(), which is optional.
+ // It makes sense when using ImGuiSelectionBasicStorage to simply pass your items count to BeginMultiSelect().
+ // Other scheme may handle SetAll differently.
+ IM_ASSERT(ms_io->ItemsCount != -1 && "Missing value for items_count in BeginMultiSelect() call!");
+ IM_ASSERT(AdapterIndexToStorageId != NULL);
+
+ // This is optimized/specialized to cope with very large selections (e.g. 100k+ items)
+ // - A simpler version could call SetItemSelected() directly instead of ImGuiSelectionBasicStorage_BatchSetItemSelected() + ImGuiSelectionBasicStorage_BatchFinish().
+ // - Optimized select can append unsorted, then sort in a second pass. Optimized unselect can clear in-place then compact in a second pass.
+ // - A more optimal version wouldn't even use ImGuiStorage but directly a ImVector<ImGuiID> to reduce bandwidth, but this is a reasonable trade off to reuse code.
+ // - There are many ways this could be better optimized. The worse case scenario being: using BoxSelect2d in a grid, box-select scrolling down while wiggling
+ // left and right: it affects coarse clipping + can emit multiple SetRange with 1 item each.)
+ // FIXME-OPT: For each block of consecutive SetRange request:
+ // - add all requests to a sorted list, store ID, selected, offset in ImGuiStorage.
+ // - rewrite sorted storage a single time.
+ for (ImGuiSelectionRequest& req : ms_io->Requests)
+ {
+ if (req.Type == ImGuiSelectionRequestType_SetAll)
+ {
+ Clear();
+ if (req.Selected)
+ {
+ _Storage.Data.reserve(ms_io->ItemsCount);
+ const int size_before_amends = _Storage.Data.Size;
+ for (int idx = 0; idx < ms_io->ItemsCount; idx++, _SelectionOrder++)
+ ImGuiSelectionBasicStorage_BatchSetItemSelected(this, GetStorageIdFromIndex(idx), req.Selected, size_before_amends, _SelectionOrder);
+ ImGuiSelectionBasicStorage_BatchFinish(this, req.Selected, size_before_amends);
+ }
+ }
+ else if (req.Type == ImGuiSelectionRequestType_SetRange)
+ {
+ const int selection_changes = (int)req.RangeLastItem - (int)req.RangeFirstItem + 1;
+ //ImGuiContext& g = *GImGui; IMGUI_DEBUG_LOG_SELECTION("Req %d/%d: set %d to %d\n", ms_io->Requests.index_from_ptr(&req), ms_io->Requests.Size, selection_changes, req.Selected);
+ if (selection_changes == 1 || (selection_changes < Size / 100))
+ {
+ // Multiple sorted insertion + copy likely to be faster.
+ // Technically we could do a single copy with a little more work (sort sequential SetRange requests)
+ for (int idx = (int)req.RangeFirstItem; idx <= (int)req.RangeLastItem; idx++)
+ SetItemSelected(GetStorageIdFromIndex(idx), req.Selected);
+ }
+ else
+ {
+ // Append insertion + single sort likely be faster.
+ // Use req.RangeDirection to set order field so that shift+clicking from 1 to 5 is different than shift+clicking from 5 to 1
+ const int size_before_amends = _Storage.Data.Size;
+ int selection_order = _SelectionOrder + ((req.RangeDirection < 0) ? selection_changes - 1 : 0);
+ for (int idx = (int)req.RangeFirstItem; idx <= (int)req.RangeLastItem; idx++, selection_order += req.RangeDirection)
+ ImGuiSelectionBasicStorage_BatchSetItemSelected(this, GetStorageIdFromIndex(idx), req.Selected, size_before_amends, selection_order);
+ if (req.Selected)
+ _SelectionOrder += selection_changes;
+ ImGuiSelectionBasicStorage_BatchFinish(this, req.Selected, size_before_amends);
+ }
+ }
+ }
+}
+
+//-------------------------------------------------------------------------
+
+ImGuiSelectionExternalStorage::ImGuiSelectionExternalStorage()
+{
+ UserData = NULL;
+ AdapterSetItemSelected = NULL;
+}
+
+// Apply requests coming from BeginMultiSelect() and EndMultiSelect().
+// We also pull 'ms_io->ItemsCount' as passed for BeginMultiSelect() for consistency with ImGuiSelectionBasicStorage
+// This makes no assumption about underlying storage.
+void ImGuiSelectionExternalStorage::ApplyRequests(ImGuiMultiSelectIO* ms_io)
+{
+ IM_ASSERT(AdapterSetItemSelected);
+ for (ImGuiSelectionRequest& req : ms_io->Requests)
+ {
+ if (req.Type == ImGuiSelectionRequestType_SetAll)
+ for (int idx = 0; idx < ms_io->ItemsCount; idx++)
+ AdapterSetItemSelected(this, idx, req.Selected);
+ if (req.Type == ImGuiSelectionRequestType_SetRange)
+ for (int idx = (int)req.RangeFirstItem; idx <= (int)req.RangeLastItem; idx++)
+ AdapterSetItemSelected(this, idx, req.Selected);
+ }
+}
+
//-------------------------------------------------------------------------
// [SECTION] Widgets: ListBox
//-------------------------------------------------------------------------
@@ -6427,8 +8292,11 @@ bool ImGui::Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags
// - ListBox()
//-------------------------------------------------------------------------
+// This is essentially a thin wrapper to using BeginChild/EndChild with the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label.
+// This handle some subtleties with capturing info from the label.
+// If you don't need a label you can pretty much directly use ImGui::BeginChild() with ImGuiChildFlags_FrameStyle.
// Tip: To have a list filling the entire window width, use size.x = -FLT_MIN and pass an non-visible label e.g. "##empty"
-// Tip: If your vertical size is calculated from an item count (e.g. 10 * item_height) consider adding a fractional part to facilitate seeing scrolling boundaries (e.g. 10.25 * item_height).
+// Tip: If your vertical size is calculated from an item count (e.g. 10 * item_height) consider adding a fractional part to facilitate seeing scrolling boundaries (e.g. 10.5f * item_height).
bool ImGui::BeginListBox(const char* label, const ImVec2& size_arg)
{
ImGuiContext& g = *GImGui;
@@ -6442,7 +8310,7 @@ bool ImGui::BeginListBox(const char* label, const ImVec2& size_arg)
// Size default to hold ~7.25 items.
// Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar.
- ImVec2 size = ImFloor(CalcItemSize(size_arg, CalcItemWidth(), GetTextLineHeightWithSpacing() * 7.25f + style.FramePadding.y * 2.0f));
+ ImVec2 size = ImTrunc(CalcItemSize(size_arg, CalcItemWidth(), GetTextLineHeightWithSpacing() * 7.25f + style.FramePadding.y * 2.0f));
ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y));
ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
@@ -6452,36 +8320,24 @@ bool ImGui::BeginListBox(const char* label, const ImVec2& size_arg)
{
ItemSize(bb.GetSize(), style.FramePadding.y);
ItemAdd(bb, 0, &frame_bb);
+ g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
return false;
}
- // FIXME-OPT: We could omit the BeginGroup() if label_size.x but would need to omit the EndGroup() as well.
+ // FIXME-OPT: We could omit the BeginGroup() if label_size.x == 0.0f but would need to omit the EndGroup() as well.
BeginGroup();
if (label_size.x > 0.0f)
{
ImVec2 label_pos = ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y);
RenderText(label_pos, label);
window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, label_pos + label_size);
+ AlignTextToFramePadding();
}
- BeginChildFrame(id, frame_bb.GetSize());
+ BeginChild(id, frame_bb.GetSize(), ImGuiChildFlags_FrameStyle);
return true;
}
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-// OBSOLETED in 1.81 (from February 2021)
-bool ImGui::ListBoxHeader(const char* label, int items_count, int height_in_items)
-{
- // If height_in_items == -1, default height is maximum 7.
- ImGuiContext& g = *GImGui;
- float height_in_items_f = (height_in_items < 0 ? ImMin(items_count, 7) : height_in_items) + 0.25f;
- ImVec2 size;
- size.x = 0.0f;
- size.y = GetTextLineHeightWithSpacing() * height_in_items_f + g.Style.FramePadding.y * 2.0f;
- return BeginListBox(label, size);
-}
-#endif
-
void ImGui::EndListBox()
{
ImGuiContext& g = *GImGui;
@@ -6489,7 +8345,7 @@ void ImGui::EndListBox()
IM_ASSERT((window->Flags & ImGuiWindowFlags_ChildWindow) && "Mismatched BeginListBox/EndListBox calls. Did you test the return value of BeginListBox?");
IM_UNUSED(window);
- EndChildFrame();
+ EndChild();
EndGroup(); // This is only required to be able to do IsItemXXX query on the whole ListBox including label
}
@@ -6501,7 +8357,7 @@ bool ImGui::ListBox(const char* label, int* current_item, const char* const item
// This is merely a helper around BeginListBox(), EndListBox().
// Considering using those directly to submit custom data or store selection differently.
-bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items)
+bool ImGui::ListBox(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int height_in_items)
{
ImGuiContext& g = *GImGui;
@@ -6509,7 +8365,7 @@ bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(v
if (height_in_items < 0)
height_in_items = ImMin(items_count, 7);
float height_in_items_f = height_in_items + 0.25f;
- ImVec2 size(0.0f, ImFloor(GetTextLineHeightWithSpacing() * height_in_items_f + g.Style.FramePadding.y * 2.0f));
+ ImVec2 size(0.0f, ImTrunc(GetTextLineHeightWithSpacing() * height_in_items_f + g.Style.FramePadding.y * 2.0f));
if (!BeginListBox(label, size))
return false;
@@ -6519,11 +8375,12 @@ bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(v
bool value_changed = false;
ImGuiListClipper clipper;
clipper.Begin(items_count, GetTextLineHeightWithSpacing()); // We know exactly our line height here so we pass it as a minor optimization, but generally you don't need to.
+ clipper.IncludeItemByIndex(*current_item);
while (clipper.Step())
for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
{
- const char* item_text;
- if (!items_getter(data, i, &item_text))
+ const char* item_text = getter(user_data, i);
+ if (item_text == NULL)
item_text = "*Unknown item*";
PushID(i);
@@ -6558,7 +8415,7 @@ bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(v
// - others https://github.com/ocornut/imgui/wiki/Useful-Extensions
//-------------------------------------------------------------------------
-int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size)
+int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, const ImVec2& size_arg)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
@@ -6569,18 +8426,16 @@ int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_get
const ImGuiID id = window->GetID(label);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
- if (frame_size.x == 0.0f)
- frame_size.x = CalcItemWidth();
- if (frame_size.y == 0.0f)
- frame_size.y = label_size.y + (style.FramePadding.y * 2);
+ const ImVec2 frame_size = CalcItemSize(size_arg, CalcItemWidth(), label_size.y + style.FramePadding.y * 2.0f);
const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding);
const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0));
ItemSize(total_bb, style.FramePadding.y);
- if (!ItemAdd(total_bb, 0, &frame_bb))
+ if (!ItemAdd(total_bb, id, &frame_bb, ImGuiItemFlags_NoNav))
return -1;
- const bool hovered = ItemHoverable(frame_bb, id);
+ bool hovered;
+ ButtonBehavior(frame_bb, id, &hovered, NULL);
// Determine scale from values if not specified
if (scale_min == FLT_MAX || scale_max == FLT_MAX)
@@ -6820,12 +8675,13 @@ bool ImGui::BeginMenuBar()
IM_ASSERT(!window->DC.MenuBarAppending);
BeginGroup(); // Backup position on layer 0 // FIXME: Misleading to use a group for that backup/restore
- PushID("##menubar");
+ PushID("##MenuBar");
// We don't clip with current window clipping rectangle as it is already set to the area below. However we clip with window full rect.
// We remove 1 worth of rounding to Max.x to that text in long menus and small windows don't tend to display over the lower-right rounded area, which looks particularly glitchy.
+ const float border_top = ImMax(window->WindowBorderSize * 0.5f - window->TitleBarHeight, 0.0f);
ImRect bar_rect = window->MenuBarRect();
- ImRect clip_rect(IM_ROUND(bar_rect.Min.x + window->WindowBorderSize), IM_ROUND(bar_rect.Min.y + window->WindowBorderSize), IM_ROUND(ImMax(bar_rect.Min.x, bar_rect.Max.x - ImMax(window->WindowRounding, window->WindowBorderSize))), IM_ROUND(bar_rect.Max.y));
+ ImRect clip_rect(IM_ROUND(bar_rect.Min.x + window->WindowBorderSize * 0.5f), IM_ROUND(bar_rect.Min.y + border_top), IM_ROUND(ImMax(bar_rect.Min.x, bar_rect.Max.x - ImMax(window->WindowRounding, window->WindowBorderSize * 0.5f))), IM_ROUND(bar_rect.Max.y));
clip_rect.ClipWith(window->OuterRectClipped);
PushClipRect(clip_rect.Min, clip_rect.Max, false);
@@ -6846,6 +8702,10 @@ void ImGui::EndMenuBar()
return;
ImGuiContext& g = *GImGui;
+ IM_MSVC_WARNING_SUPPRESS(6011); // Static Analysis false positive "warning C6011: Dereferencing NULL pointer 'window'"
+ IM_ASSERT(window->Flags & ImGuiWindowFlags_MenuBar);
+ IM_ASSERT(window->DC.MenuBarAppending);
+
// Nav: When a move request within one of our child menu failed, capture the request to navigate among our siblings.
if (NavMoveRequestButNoResultYet() && (g.NavMoveDir == ImGuiDir_Left || g.NavMoveDir == ImGuiDir_Right) && (g.NavWindow->Flags & ImGuiWindowFlags_ChildMenu))
{
@@ -6861,24 +8721,32 @@ void ImGui::EndMenuBar()
IM_ASSERT(window->DC.NavLayersActiveMaskNext & (1 << layer)); // Sanity check (FIXME: Seems unnecessary)
FocusWindow(window);
SetNavID(window->NavLastIds[layer], layer, 0, window->NavRectRel[layer]);
- g.NavDisableHighlight = true; // Hide highlight for the current frame so we don't see the intermediary selection.
- g.NavDisableMouseHover = g.NavMousePosDirty = true;
+ // FIXME-NAV: How to deal with this when not using g.IO.ConfigNavCursorVisibleAuto?
+ if (g.NavCursorVisible)
+ {
+ g.NavCursorVisible = false; // Hide nav cursor for the current frame so we don't see the intermediary selection. Will be set again
+ g.NavCursorHideFrames = 2;
+ }
+ g.NavHighlightItemUnderNav = g.NavMousePosDirty = true;
NavMoveRequestForward(g.NavMoveDir, g.NavMoveClipDir, g.NavMoveFlags, g.NavMoveScrollFlags); // Repeat
}
}
- IM_MSVC_WARNING_SUPPRESS(6011); // Static Analysis false positive "warning C6011: Dereferencing NULL pointer 'window'"
- IM_ASSERT(window->Flags & ImGuiWindowFlags_MenuBar);
- IM_ASSERT(window->DC.MenuBarAppending);
PopClipRect();
PopID();
window->DC.MenuBarOffset.x = window->DC.CursorPos.x - window->Pos.x; // Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos.
- g.GroupStack.back().EmitItem = false;
- EndGroup(); // Restore position on layer 0
+
+ // FIXME: Extremely confusing, cleanup by (a) working on WorkRect stack system (b) not using a Group confusingly here.
+ ImGuiGroupData& group_data = g.GroupStack.back();
+ group_data.EmitItem = false;
+ ImVec2 restore_cursor_max_pos = group_data.BackupCursorMaxPos;
+ window->DC.IdealMaxPos.x = ImMax(window->DC.IdealMaxPos.x, window->DC.CursorMaxPos.x - window->Scroll.x); // Convert ideal extents for scrolling layer equivalent.
+ EndGroup(); // Restore position on layer 0 // FIXME: Misleading to use a group for that backup/restore
window->DC.LayoutType = ImGuiLayoutType_Vertical;
window->DC.IsSameLine = false;
window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
window->DC.MenuBarAppending = false;
+ window->DC.CursorMaxPos = restore_cursor_max_pos;
}
// Important: calling order matters!
@@ -6905,9 +8773,9 @@ bool ImGui::BeginViewportSideBar(const char* name, ImGuiViewport* viewport_p, Im
// Report our size into work area (for next frame) using actual window size
if (dir == ImGuiDir_Up || dir == ImGuiDir_Left)
- viewport->BuildWorkOffsetMin[axis] += axis_size;
+ viewport->BuildWorkInsetMin[axis] += axis_size;
else if (dir == ImGuiDir_Down || dir == ImGuiDir_Right)
- viewport->BuildWorkOffsetMax[axis] -= axis_size;
+ viewport->BuildWorkInsetMax[axis] += axis_size;
}
window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
@@ -6932,23 +8800,34 @@ bool ImGui::BeginMainMenuBar()
float height = GetFrameHeight();
bool is_open = BeginViewportSideBar("##MainMenuBar", viewport, ImGuiDir_Up, height, window_flags);
g.NextWindowData.MenuBarOffsetMinVal = ImVec2(0.0f, 0.0f);
-
- if (is_open)
- BeginMenuBar();
- else
+ if (!is_open)
+ {
End();
+ return false;
+ }
+
+ // Temporarily disable _NoSavedSettings, in the off-chance that tables or child windows submitted within the menu-bar may want to use settings. (#8356)
+ g.CurrentWindow->Flags &= ~ImGuiWindowFlags_NoSavedSettings;
+ BeginMenuBar();
return is_open;
}
void ImGui::EndMainMenuBar()
{
+ ImGuiContext& g = *GImGui;
+ if (!g.CurrentWindow->DC.MenuBarAppending)
+ {
+ IM_ASSERT_USER_ERROR(0, "Calling EndMainMenuBar() not from a menu-bar!"); // Not technically testing that it is the main menu bar
+ return;
+ }
+
EndMenuBar();
+ g.CurrentWindow->Flags |= ImGuiWindowFlags_NoSavedSettings; // Restore _NoSavedSettings (#8356)
// When the user has left the menu layer (typically: closed menus through activation of an item), we restore focus to the previous window
// FIXME: With this strategy we won't be able to restore a NULL focus.
- ImGuiContext& g = *GImGui;
- if (g.CurrentWindow == g.NavWindow && g.NavLayer == ImGuiNavLayer_Main && !g.NavAnyRequest)
- FocusTopMostWindowUnderOne(g.NavWindow, NULL);
+ if (g.CurrentWindow == g.NavWindow && g.NavLayer == ImGuiNavLayer_Main && !g.NavAnyRequest && g.ActiveId == 0)
+ FocusTopMostWindowUnderOne(g.NavWindow, NULL, NULL, ImGuiFocusRequestFlags_UnlessBelowModal | ImGuiFocusRequestFlags_RestoreFocusedChild);
End();
}
@@ -6962,9 +8841,9 @@ static bool IsRootOfOpenMenuSet()
// Initially we used 'upper_popup->OpenParentId == window->IDStack.back()' to differentiate multiple menu sets from each others
// (e.g. inside menu bar vs loose menu items) based on parent ID.
- // This would however prevent the use of e.g. PuhsID() user code submitting menus.
+ // This would however prevent the use of e.g. PushID() user code submitting menus.
// Previously this worked between popup and a first child menu because the first child menu always had the _ChildWindow flag,
- // making hovering on parent popup possible while first child menu was focused - but this was generally a bug with other side effects.
+ // making hovering on parent popup possible while first child menu was focused - but this was generally a bug with other side effects.
// Instead we don't treat Popup specifically (in order to consistently support menu features in them), maybe the first child menu of a Popup
// doesn't have the _ChildWindow flag, and we rely on this IsRootOfOpenMenuSet() check to allow hovering between root window/popup and first child menu.
// In the end, lack of ID check made it so we could no longer differentiate between separate menu sets. To compensate for that, we at least check parent window nav layer.
@@ -6972,7 +8851,9 @@ static bool IsRootOfOpenMenuSet()
// open on hover, but that should be a lesser problem, because if such menus are close in proximity in window content then it won't feel weird and if they are far apart
// it likely won't be a problem anyone runs into.
const ImGuiPopupData* upper_popup = &g.OpenPopupStack[g.BeginPopupStack.Size];
- return (window->DC.NavLayerCurrent == upper_popup->ParentNavLayer && upper_popup->Window && (upper_popup->Window->Flags & ImGuiWindowFlags_ChildMenu));
+ if (window->DC.NavLayerCurrent != upper_popup->ParentNavLayer)
+ return false;
+ return upper_popup->Window && (upper_popup->Window->Flags & ImGuiWindowFlags_ChildMenu) && ImGui::IsWindowChildOf(upper_popup->Window, window, true);
}
bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
@@ -6998,7 +8879,7 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
if (g.MenusIdSubmittedThisFrame.contains(id))
{
if (menu_is_open)
- menu_is_open = BeginPopupEx(id, window_flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
+ menu_is_open = BeginPopupMenuEx(id, label, window_flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
else
g.NextWindowData.ClearFlags(); // we behave like Begin() and need to consume those values
return menu_is_open;
@@ -7026,21 +8907,22 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
bool pressed;
// We use ImGuiSelectableFlags_NoSetKeyOwner to allow down on one menu item, move, up on another.
- const ImGuiSelectableFlags selectable_flags = ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_NoSetKeyOwner | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_DontClosePopups;
+ const ImGuiSelectableFlags selectable_flags = ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_NoSetKeyOwner | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_NoAutoClosePopups;
if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
{
- // Menu inside an horizontal menu bar
+ // Menu inside a horizontal menu bar
// Selectable extend their highlight by half ItemSpacing in each direction.
// For ChildMenu, the popup position will be overwritten by the call to FindBestWindowPosForPopup() in Begin()
- popup_pos = ImVec2(pos.x - 1.0f - IM_FLOOR(style.ItemSpacing.x * 0.5f), pos.y - style.FramePadding.y + window->MenuBarHeight());
- window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f);
- PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y));
+ popup_pos = ImVec2(pos.x - 1.0f - IM_TRUNC(style.ItemSpacing.x * 0.5f), pos.y - style.FramePadding.y + window->MenuBarHeight);
+ window->DC.CursorPos.x += IM_TRUNC(style.ItemSpacing.x * 0.5f);
+ PushStyleVarX(ImGuiStyleVar_ItemSpacing, style.ItemSpacing.x * 2.0f);
float w = label_size.x;
ImVec2 text_pos(window->DC.CursorPos.x + offsets->OffsetLabel, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset);
- pressed = Selectable("", menu_is_open, selectable_flags, ImVec2(w, 0.0f));
+ pressed = Selectable("", menu_is_open, selectable_flags, ImVec2(w, label_size.y));
+ LogSetNextTextDecoration("[", "]");
RenderText(text_pos, label);
PopStyleVar();
- window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
+ window->DC.CursorPos.x += IM_TRUNC(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
}
else
{
@@ -7049,11 +8931,12 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
// Only when they are other items sticking out we're going to add spacing, yet only register minimum width into the layout system.
popup_pos = ImVec2(pos.x, pos.y - style.WindowPadding.y);
float icon_w = (icon && icon[0]) ? CalcTextSize(icon, NULL).x : 0.0f;
- float checkmark_w = IM_FLOOR(g.FontSize * 1.20f);
+ float checkmark_w = IM_TRUNC(g.FontSize * 1.20f);
float min_w = window->DC.MenuColumns.DeclColumns(icon_w, label_size.x, 0.0f, checkmark_w); // Feedback to next frame
float extra_w = ImMax(0.0f, GetContentRegionAvail().x - min_w);
ImVec2 text_pos(window->DC.CursorPos.x + offsets->OffsetLabel, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset);
- pressed = Selectable("", menu_is_open, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, 0.0f));
+ pressed = Selectable("", menu_is_open, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, label_size.y));
+ LogSetNextTextDecoration("", ">");
RenderText(text_pos, label);
if (icon_w > 0.0f)
RenderText(pos + ImVec2(offsets->OffsetIcon, 0.0f), icon);
@@ -7062,11 +8945,12 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
if (!enabled)
EndDisabled();
- const bool hovered = (g.HoveredId == id) && enabled && !g.NavDisableMouseHover;
+ const bool hovered = (g.HoveredId == id) && enabled && !g.NavHighlightItemUnderNav;
if (menuset_is_open)
PopItemFlag();
bool want_open = false;
+ bool want_open_nav_init = false;
bool want_close = false;
if (window->DC.LayoutType == ImGuiLayoutType_Vertical) // (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu))
{
@@ -7077,18 +8961,18 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
ImGuiWindow* child_menu_window = (child_popup && child_popup->Window && child_popup->Window->ParentWindow == window) ? child_popup->Window : NULL;
if (g.HoveredWindow == window && child_menu_window != NULL)
{
- float ref_unit = g.FontSize; // FIXME-DPI
- float child_dir = (window->Pos.x < child_menu_window->Pos.x) ? 1.0f : -1.0f;
- ImRect next_window_rect = child_menu_window->Rect();
+ const float ref_unit = g.FontSize; // FIXME-DPI
+ const float child_dir = (window->Pos.x < child_menu_window->Pos.x) ? 1.0f : -1.0f;
+ const ImRect next_window_rect = child_menu_window->Rect();
ImVec2 ta = (g.IO.MousePos - g.IO.MouseDelta);
ImVec2 tb = (child_dir > 0.0f) ? next_window_rect.GetTL() : next_window_rect.GetTR();
ImVec2 tc = (child_dir > 0.0f) ? next_window_rect.GetBL() : next_window_rect.GetBR();
- float extra = ImClamp(ImFabs(ta.x - tb.x) * 0.30f, ref_unit * 0.5f, ref_unit * 2.5f); // add a bit of extra slack.
+ const float pad_farmost_h = ImClamp(ImFabs(ta.x - tb.x) * 0.30f, ref_unit * 0.5f, ref_unit * 2.5f); // Add a bit of extra slack.
ta.x += child_dir * -0.5f;
tb.x += child_dir * ref_unit;
tc.x += child_dir * ref_unit;
- tb.y = ta.y + ImMax((tb.y - extra) - ta.y, -ref_unit * 8.0f); // triangle has maximum height to limit the slope and the bias toward large sub-menus
- tc.y = ta.y + ImMin((tc.y + extra) - ta.y, +ref_unit * 8.0f);
+ tb.y = ta.y + ImMax((tb.y - pad_farmost_h) - ta.y, -ref_unit * 8.0f); // Triangle has maximum height to limit the slope and the bias toward large sub-menus
+ tc.y = ta.y + ImMin((tc.y + pad_farmost_h) - ta.y, +ref_unit * 8.0f);
moving_toward_child_menu = ImTriangleContainsPoint(ta, tb, tc, g.IO.MousePos);
//GetForegroundDrawList()->AddTriangleFilled(ta, tb, tc, moving_toward_child_menu ? IM_COL32(0,128,0,128) : IM_COL32(128,0,0,128)); // [DEBUG]
}
@@ -7096,18 +8980,22 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
// The 'HovereWindow == window' check creates an inconsistency (e.g. moving away from menu slowly tends to hit same window, whereas moving away fast does not)
// But we also need to not close the top-menu menu when moving over void. Perhaps we should extend the triangle check to a larger polygon.
// (Remember to test this on BeginPopup("A")->BeginMenu("B") sequence which behaves slightly differently as B isn't a Child of A and hovering isn't shared.)
- if (menu_is_open && !hovered && g.HoveredWindow == window && !moving_toward_child_menu && !g.NavDisableMouseHover)
+ if (menu_is_open && !hovered && g.HoveredWindow == window && !moving_toward_child_menu && !g.NavHighlightItemUnderNav && g.ActiveId == 0)
want_close = true;
// Open
+ // (note: at this point 'hovered' actually includes the NavDisableMouseHover == false test)
if (!menu_is_open && pressed) // Click/activate to open
want_open = true;
else if (!menu_is_open && hovered && !moving_toward_child_menu) // Hover to open
want_open = true;
+ else if (!menu_is_open && hovered && g.HoveredIdTimer >= 0.30f && g.MouseStationaryTimer >= 0.30f) // Hover to open (timer fallback)
+ want_open = true;
if (g.NavId == id && g.NavMoveDir == ImGuiDir_Right) // Nav-Right to open
{
- want_open = true;
+ want_open = want_open_nav_init = true;
NavMoveRequestCancel();
+ SetNavCursorVisibleAfterMove();
}
}
else
@@ -7139,13 +9027,13 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
if (want_open && !menu_is_open && g.OpenPopupStack.Size > g.BeginPopupStack.Size)
{
- // Don't reopen/recycle same menu level in the same frame, first close the other menu and yield for a frame.
+ // Don't reopen/recycle same menu level in the same frame if it is a different menu ID, first close the other menu and yield for a frame.
OpenPopup(label);
}
else if (want_open)
{
menu_is_open = true;
- OpenPopup(label);
+ OpenPopup(label, ImGuiPopupFlags_NoReopen);// | (want_open_nav_init ? ImGuiPopupFlags_NoReopenAlwaysNavInit : 0));
}
if (menu_is_open)
@@ -7153,10 +9041,18 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
ImGuiLastItemData last_item_in_parent = g.LastItemData;
SetNextWindowPos(popup_pos, ImGuiCond_Always); // Note: misleading: the value will serve as reference for FindBestWindowPosForPopup(), not actual pos.
PushStyleVar(ImGuiStyleVar_ChildRounding, style.PopupRounding); // First level will use _PopupRounding, subsequent will use _ChildRounding
- menu_is_open = BeginPopupEx(id, window_flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
+ menu_is_open = BeginPopupMenuEx(id, label, window_flags); // menu_is_open may be 'false' when the popup is completely clipped (e.g. zero size display)
PopStyleVar();
if (menu_is_open)
{
+ // Implement what ImGuiPopupFlags_NoReopenAlwaysNavInit would do:
+ // Perform an init request in the case the popup was already open (via a previous mouse hover)
+ if (want_open && want_open_nav_init && !g.NavInitRequest)
+ {
+ FocusWindow(g.CurrentWindow, ImGuiFocusRequestFlags_UnlessBelowModal);
+ NavInitWindow(g.CurrentWindow, false);
+ }
+
// Restore LastItemData so IsItemXXXX functions can work after BeginMenu()/EndMenu()
// (This fixes using IsItemClicked() and IsItemHovered(), but IsItemHovered() also relies on its support for ImGuiItemFlags_NoWindowHoverableCheck)
g.LastItemData = last_item_in_parent;
@@ -7226,14 +9122,14 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut
// Mimic the exact layout spacing of BeginMenu() to allow MenuItem() inside a menu bar, which is a little misleading but may be useful
// Note that in this situation: we don't render the shortcut, we render a highlight instead of the selected tick mark.
float w = label_size.x;
- window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f);
+ window->DC.CursorPos.x += IM_TRUNC(style.ItemSpacing.x * 0.5f);
ImVec2 text_pos(window->DC.CursorPos.x + offsets->OffsetLabel, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset);
- PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y));
+ PushStyleVarX(ImGuiStyleVar_ItemSpacing, style.ItemSpacing.x * 2.0f);
pressed = Selectable("", selected, selectable_flags, ImVec2(w, 0.0f));
PopStyleVar();
if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible)
RenderText(text_pos, label);
- window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
+ window->DC.CursorPos.x += IM_TRUNC(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
}
else
{
@@ -7242,10 +9138,10 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut
// Only when they are other items sticking out we're going to add spacing, yet only register minimum width into the layout system.
float icon_w = (icon && icon[0]) ? CalcTextSize(icon, NULL).x : 0.0f;
float shortcut_w = (shortcut && shortcut[0]) ? CalcTextSize(shortcut, NULL).x : 0.0f;
- float checkmark_w = IM_FLOOR(g.FontSize * 1.20f);
+ float checkmark_w = IM_TRUNC(g.FontSize * 1.20f);
float min_w = window->DC.MenuColumns.DeclColumns(icon_w, label_size.x, shortcut_w, checkmark_w); // Feedback for next frame
float stretch_w = ImMax(0.0f, GetContentRegionAvail().x - min_w);
- pressed = Selectable("", false, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, 0.0f));
+ pressed = Selectable("", false, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, label_size.y));
if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible)
{
RenderText(pos + ImVec2(offsets->OffsetLabel, 0.0f), label);
@@ -7254,6 +9150,7 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut
if (shortcut_w > 0.0f)
{
PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]);
+ LogSetNextTextDecoration("(", ")");
RenderText(pos + ImVec2(offsets->OffsetShortcut + stretch_w, 0.0f), shortcut, NULL, false);
PopStyleColor();
}
@@ -7297,11 +9194,17 @@ bool ImGui::MenuItem(const char* label, const char* shortcut, bool* p_selected,
// - TabBarCalcTabID() [Internal]
// - TabBarCalcMaxTabWidth() [Internal]
// - TabBarFindTabById() [Internal]
+// - TabBarFindTabByOrder() [Internal]
+// - TabBarGetCurrentTab() [Internal]
+// - TabBarGetTabName() [Internal]
// - TabBarRemoveTab() [Internal]
// - TabBarCloseTab() [Internal]
// - TabBarScrollClamp() [Internal]
// - TabBarScrollToTab() [Internal]
-// - TabBarQueueChangeTabOrder() [Internal]
+// - TabBarQueueFocus() [Internal]
+// - TabBarQueueReorder() [Internal]
+// - TabBarProcessReorderFromMousePos() [Internal]
+// - TabBarProcessReorder() [Internal]
// - TabBarScrollingButtons() [Internal]
// - TabBarTabListPopupButton() [Internal]
//-------------------------------------------------------------------------
@@ -7318,7 +9221,7 @@ struct ImGuiTabBarSection
namespace ImGui
{
static void TabBarLayout(ImGuiTabBar* tab_bar);
- static ImU32 TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label);
+ static ImU32 TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label, ImGuiWindow* docked_window);
static float TabBarCalcMaxTabWidth();
static float TabBarScrollClamp(ImGuiTabBar* tab_bar, float scrolling);
static void TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiID tab_id, ImGuiTabBarSection* sections);
@@ -7381,7 +9284,11 @@ bool ImGui::BeginTabBar(const char* str_id, ImGuiTabBarFlags flags)
ImGuiTabBar* tab_bar = g.TabBars.GetOrAddByKey(id);
ImRect tab_bar_bb = ImRect(window->DC.CursorPos.x, window->DC.CursorPos.y, window->WorkRect.Max.x, window->DC.CursorPos.y + g.FontSize + g.Style.FramePadding.y * 2);
tab_bar->ID = id;
- return BeginTabBarEx(tab_bar, tab_bar_bb, flags | ImGuiTabBarFlags_IsFocused);
+ tab_bar->SeparatorMinX = tab_bar->BarRect.Min.x - IM_TRUNC(window->WindowPadding.x * 0.5f);
+ tab_bar->SeparatorMaxX = tab_bar->BarRect.Max.x + IM_TRUNC(window->WindowPadding.x * 0.5f);
+ //if (g.NavWindow && IsWindowChildOf(g.NavWindow, window, false, false))
+ flags |= ImGuiTabBarFlags_IsFocused;
+ return BeginTabBarEx(tab_bar, tab_bar_bb, flags);
}
bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImGuiTabBarFlags flags)
@@ -7391,12 +9298,14 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG
if (window->SkipItems)
return false;
+ IM_ASSERT(tab_bar->ID != 0);
if ((flags & ImGuiTabBarFlags_DockNode) == 0)
PushOverrideID(tab_bar->ID);
// Add to stack
g.CurrentTabBarStack.push_back(GetTabBarRefFromTabBar(tab_bar));
g.CurrentTabBar = tab_bar;
+ tab_bar->Window = window;
// Append with multiple BeginTabBar()/EndTabBar() pairs.
tab_bar->BackupCursorPos = window->DC.CursorPos;
@@ -7426,18 +9335,19 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG
tab_bar->ItemSpacingY = g.Style.ItemSpacing.y;
tab_bar->FramePadding = g.Style.FramePadding;
tab_bar->TabsActiveCount = 0;
+ tab_bar->LastTabItemIdx = -1;
tab_bar->BeginCount = 1;
// Set cursor pos in a way which only be used in the off-chance the user erroneously submits item before BeginTabItem(): items will overlap
window->DC.CursorPos = ImVec2(tab_bar->BarRect.Min.x, tab_bar->BarRect.Max.y + tab_bar->ItemSpacingY);
// Draw separator
- const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive);
- const float y = tab_bar->BarRect.Max.y - 1.0f;
+ // (it would be misleading to draw this in EndTabBar() suggesting that it may be drawn over tabs, as tab bar are appendable)
+ const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabSelected : ImGuiCol_TabDimmedSelected);
+ if (g.Style.TabBarBorderSize > 0.0f)
{
- const float separator_min_x = tab_bar->BarRect.Min.x - IM_FLOOR(window->WindowPadding.x * 0.5f);
- const float separator_max_x = tab_bar->BarRect.Max.x + IM_FLOOR(window->WindowPadding.x * 0.5f);
- window->DrawList->AddLine(ImVec2(separator_min_x, y), ImVec2(separator_max_x, y), col, 1.0f);
+ const float y = tab_bar->BarRect.Max.y;
+ window->DrawList->AddRectFilled(ImVec2(tab_bar->SeparatorMinX, y - g.Style.TabBarBorderSize), ImVec2(tab_bar->SeparatorMaxX, y), col);
}
return true;
}
@@ -7474,6 +9384,7 @@ void ImGui::EndTabBar()
if (tab_bar->BeginCount > 1)
window->DC.CursorPos = tab_bar->BackupCursorPos;
+ tab_bar->LastTabItemIdx = -1;
if ((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0)
PopID();
@@ -7481,6 +9392,12 @@ void ImGui::EndTabBar()
g.CurrentTabBar = g.CurrentTabBarStack.empty() ? NULL : GetTabBarFromTabBarRef(g.CurrentTabBarStack.back());
}
+// Scrolling happens only in the central section (leading/trailing sections are not scrolling)
+static float TabBarCalcScrollableWidth(ImGuiTabBar* tab_bar, ImGuiTabBarSection* sections)
+{
+ return tab_bar->BarRect.GetWidth() - sections[0].Width - sections[2].Width - sections[1].Spacing;
+}
+
// This is called only once a frame before by the first call to ItemTab()
// The reason we're not calling it in BeginTabBar() is to leave a chance to the user to call the SetTabItemClosed() functions.
static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
@@ -7583,7 +9500,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
// Refresh tab width immediately, otherwise changes of style e.g. style.FramePadding.x would noticeably lag in the tab bar.
// Additionally, when using TabBarAddTab() to manipulate tab bar order we occasionally insert new tabs that don't have a width yet,
// and we cannot wait for the next BeginTabItem() call. We cannot compute this width within TabBarAddTab() because font size depends on the active window.
- const char* tab_name = tab_bar->GetTabName(tab);
+ const char* tab_name = TabBarGetTabName(tab_bar, tab);
const bool has_close_button_or_unsaved_marker = (tab->Flags & ImGuiTabItemFlags_NoCloseButton) == 0 || (tab->Flags & ImGuiTabItemFlags_UnsavedDocument);
tab->ContentWidth = (tab->RequestedWidth >= 0.0f) ? tab->RequestedWidth : TabItemCalcSize(tab_name, has_close_button_or_unsaved_marker).x;
@@ -7637,7 +9554,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
for (int tab_n = shrink_data_offset; tab_n < shrink_data_offset + shrink_data_count; tab_n++)
{
ImGuiTabItem* tab = &tab_bar->Tabs[g.ShrinkWidthBuffer[tab_n].Index];
- float shrinked_width = IM_FLOOR(g.ShrinkWidthBuffer[tab_n].Width);
+ float shrinked_width = IM_TRUNC(g.ShrinkWidthBuffer[tab_n].Width);
if (shrinked_width < 0.0f)
continue;
@@ -7662,6 +9579,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
{
ImGuiTabItem* tab = &tab_bar->Tabs[section_tab_index + tab_n];
tab->Offset = tab_offset;
+ tab->NameOffset = -1;
tab_offset += tab->Width + (tab_n < section->TabCount - 1 ? g.Style.ItemInnerSpacing.x : 0.0f);
}
tab_bar->WidthAllTabs += ImMax(section->Width + section->Spacing, 0.0f);
@@ -7669,6 +9587,9 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
section_tab_index += section->TabCount;
}
+ // Clear name buffers
+ tab_bar->TabsNames.Buf.resize(0);
+
// If we have lost the selected tab, select the next most recently active one
if (found_selected_tab_id == false)
tab_bar->SelectedTabId = 0;
@@ -7679,9 +9600,23 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
tab_bar->VisibleTabId = tab_bar->SelectedTabId;
tab_bar->VisibleTabWasSubmitted = false;
- // Update scrolling
+ // Apply request requests
if (scroll_to_tab_id != 0)
TabBarScrollToTab(tab_bar, scroll_to_tab_id, sections);
+ else if ((tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyScroll) && IsMouseHoveringRect(tab_bar->BarRect.Min, tab_bar->BarRect.Max, true) && IsWindowContentHoverable(g.CurrentWindow))
+ {
+ const float wheel = g.IO.MouseWheelRequestAxisSwap ? g.IO.MouseWheel : g.IO.MouseWheelH;
+ const ImGuiKey wheel_key = g.IO.MouseWheelRequestAxisSwap ? ImGuiKey_MouseWheelY : ImGuiKey_MouseWheelX;
+ if (TestKeyOwner(wheel_key, tab_bar->ID) && wheel != 0.0f)
+ {
+ const float scroll_step = wheel * TabBarCalcScrollableWidth(tab_bar, sections) / 3.0f;
+ tab_bar->ScrollingTargetDistToVisibility = 0.0f;
+ tab_bar->ScrollingTarget = TabBarScrollClamp(tab_bar, tab_bar->ScrollingTarget - scroll_step);
+ }
+ SetKeyOwner(wheel_key, tab_bar->ID);
+ }
+
+ // Update scrolling
tab_bar->ScrollingAnim = TabBarScrollClamp(tab_bar, tab_bar->ScrollingAnim);
tab_bar->ScrollingTarget = TabBarScrollClamp(tab_bar, tab_bar->ScrollingTarget);
if (tab_bar->ScrollingAnim != tab_bar->ScrollingTarget)
@@ -7700,10 +9635,6 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
tab_bar->ScrollingRectMinX = tab_bar->BarRect.Min.x + sections[0].Width + sections[0].Spacing;
tab_bar->ScrollingRectMaxX = tab_bar->BarRect.Max.x - sections[2].Width - sections[1].Spacing;
- // Clear name buffers
- if ((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0)
- tab_bar->TabsNames.Buf.resize(0);
-
// Actual layout in host window (we don't do it in BeginTabBar() so as not to waste an extra frame)
ImGuiWindow* window = g.CurrentWindow;
window->DC.CursorPos = tab_bar->BarRect.Min;
@@ -7711,9 +9642,11 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
window->DC.IdealMaxPos.x = ImMax(window->DC.IdealMaxPos.x, tab_bar->BarRect.Min.x + tab_bar->WidthAllTabsIdeal);
}
-// Dockables uses Name/ID in the global namespace. Non-dockable items use the ID stack.
-static ImU32 ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label)
+// Dockable windows uses Name/ID in the global namespace. Non-dockable items use the ID stack.
+static ImU32 ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label, ImGuiWindow* docked_window)
{
+ IM_ASSERT(docked_window == NULL); // master branch only
+ IM_UNUSED(docked_window);
if (tab_bar->Flags & ImGuiTabBarFlags_DockNode)
{
ImGuiID id = ImHashStr(label);
@@ -7742,7 +9675,30 @@ ImGuiTabItem* ImGui::TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id)
return NULL;
}
-// The *TabId fields be already set by the docking system _before_ the actual TabItem was created, so we clear them regardless.
+// Order = visible order, not submission order! (which is tab->BeginOrder)
+ImGuiTabItem* ImGui::TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order)
+{
+ if (order < 0 || order >= tab_bar->Tabs.Size)
+ return NULL;
+ return &tab_bar->Tabs[order];
+}
+
+ImGuiTabItem* ImGui::TabBarGetCurrentTab(ImGuiTabBar* tab_bar)
+{
+ if (tab_bar->LastTabItemIdx < 0 || tab_bar->LastTabItemIdx >= tab_bar->Tabs.Size)
+ return NULL;
+ return &tab_bar->Tabs[tab_bar->LastTabItemIdx];
+}
+
+const char* ImGui::TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
+{
+ if (tab->NameOffset == -1)
+ return "N/A";
+ IM_ASSERT(tab->NameOffset < tab_bar->TabsNames.Buf.Size);
+ return tab_bar->TabsNames.Buf.Data + tab->NameOffset;
+}
+
+// The *TabId fields are already set by the docking system _before_ the actual TabItem was created, so we clear them regardless.
void ImGui::TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id)
{
if (ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, tab_id))
@@ -7758,7 +9714,7 @@ void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
if (tab->Flags & ImGuiTabItemFlags_Button)
return; // A button appended with TabItemButton().
- if (!(tab->Flags & ImGuiTabItemFlags_UnsavedDocument))
+ if ((tab->Flags & (ImGuiTabItemFlags_UnsavedDocument | ImGuiTabItemFlags_NoAssumedClosure)) == 0)
{
// This will remove a frame of lag for selecting another tab on closure.
// However we don't run it in the case where the 'Unsaved' flag is set, so user gets a chance to fully undo the closure
@@ -7773,7 +9729,7 @@ void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
{
// Actually select before expecting closure attempt (on an UnsavedDocument tab user is expect to e.g. show a popup)
if (tab_bar->VisibleTabId != tab->ID)
- tab_bar->NextSelectedTabId = tab->ID;
+ TabBarQueueFocus(tab_bar, tab);
}
}
@@ -7794,11 +9750,10 @@ static void ImGui::TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiID tab_id, ImGui
ImGuiContext& g = *GImGui;
float margin = g.FontSize * 1.0f; // When to scroll to make Tab N+1 visible always make a bit of N visible to suggest more scrolling area (since we don't have a scrollbar)
- int order = tab_bar->GetTabOrder(tab);
+ int order = TabBarGetTabOrder(tab_bar, tab);
// Scrolling happens only in the central section (leading/trailing sections are not scrolling)
- // FIXME: This is all confusing.
- float scrollable_width = tab_bar->BarRect.GetWidth() - sections[0].Width - sections[2].Width - sections[1].Spacing;
+ float scrollable_width = TabBarCalcScrollableWidth(tab_bar, sections);
// We make all tabs positions all relative Sections[0].Width to make code simpler
float tab_x1 = tab->Offset - sections[0].Width + (order > sections[0].TabCount - 1 ? -margin : 0.0f);
@@ -7818,7 +9773,19 @@ static void ImGui::TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiID tab_id, ImGui
}
}
-void ImGui::TabBarQueueReorder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int offset)
+void ImGui::TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
+{
+ tab_bar->NextSelectedTabId = tab->ID;
+}
+
+void ImGui::TabBarQueueFocus(ImGuiTabBar* tab_bar, const char* tab_name)
+{
+ IM_ASSERT((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0); // Only supported for manual/explicit tab bars
+ ImGuiID tab_id = TabBarCalcTabID(tab_bar, tab_name, NULL);
+ tab_bar->NextSelectedTabId = tab_id;
+}
+
+void ImGui::TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset)
{
IM_ASSERT(offset != 0);
IM_ASSERT(tab_bar->ReorderRequestTabId == 0);
@@ -7826,7 +9793,7 @@ void ImGui::TabBarQueueReorder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, in
tab_bar->ReorderRequestOffset = (ImS16)offset;
}
-void ImGui::TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, const ImGuiTabItem* src_tab, ImVec2 mouse_pos)
+void ImGui::TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* src_tab, ImVec2 mouse_pos)
{
ImGuiContext& g = *GImGui;
IM_ASSERT(tab_bar->ReorderRequestTabId == 0);
@@ -7869,7 +9836,7 @@ bool ImGui::TabBarProcessReorder(ImGuiTabBar* tab_bar)
return false;
//IM_ASSERT(tab_bar->Flags & ImGuiTabBarFlags_Reorderable); // <- this may happen when using debug tools
- int tab2_order = tab_bar->GetTabOrder(tab1) + tab_bar->ReorderRequestOffset;
+ int tab2_order = TabBarGetTabOrder(tab_bar, tab1) + tab_bar->ReorderRequestOffset;
if (tab2_order < 0 || tab2_order >= tab_bar->Tabs.Size)
return false;
@@ -7910,17 +9877,19 @@ static ImGuiTabItem* ImGui::TabBarScrollingButtons(ImGuiTabBar* tab_bar)
PushStyleColor(ImGuiCol_Text, arrow_col);
PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
+ PushItemFlag(ImGuiItemFlags_ButtonRepeat, true);
const float backup_repeat_delay = g.IO.KeyRepeatDelay;
const float backup_repeat_rate = g.IO.KeyRepeatRate;
g.IO.KeyRepeatDelay = 0.250f;
g.IO.KeyRepeatRate = 0.200f;
float x = ImMax(tab_bar->BarRect.Min.x, tab_bar->BarRect.Max.x - scrolling_buttons_width);
window->DC.CursorPos = ImVec2(x, tab_bar->BarRect.Min.y);
- if (ArrowButtonEx("##<", ImGuiDir_Left, arrow_button_size, ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat))
+ if (ArrowButtonEx("##<", ImGuiDir_Left, arrow_button_size, ImGuiButtonFlags_PressedOnClick))
select_dir = -1;
window->DC.CursorPos = ImVec2(x + arrow_button_size.x, tab_bar->BarRect.Min.y);
- if (ArrowButtonEx("##>", ImGuiDir_Right, arrow_button_size, ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat))
+ if (ArrowButtonEx("##>", ImGuiDir_Right, arrow_button_size, ImGuiButtonFlags_PressedOnClick))
select_dir = +1;
+ PopItemFlag();
PopStyleColor(2);
g.IO.KeyRepeatRate = backup_repeat_rate;
g.IO.KeyRepeatDelay = backup_repeat_delay;
@@ -7929,7 +9898,7 @@ static ImGuiTabItem* ImGui::TabBarScrollingButtons(ImGuiTabBar* tab_bar)
if (select_dir != 0)
if (ImGuiTabItem* tab_item = TabBarFindTabByID(tab_bar, tab_bar->SelectedTabId))
{
- int selected_order = tab_bar->GetTabOrder(tab_item);
+ int selected_order = TabBarGetTabOrder(tab_bar, tab_item);
int target_order = selected_order + select_dir;
// Skip tab item buttons until another tab item is found or end is reached
@@ -7981,7 +9950,7 @@ static ImGuiTabItem* ImGui::TabBarTabListPopupButton(ImGuiTabBar* tab_bar)
if (tab->Flags & ImGuiTabItemFlags_Button)
continue;
- const char* tab_name = tab_bar->GetTabName(tab);
+ const char* tab_name = TabBarGetTabName(tab_bar, tab);
if (Selectable(tab_name, tab_bar->SelectedTabId == tab->ID))
tab_to_select = tab;
}
@@ -8018,9 +9987,9 @@ bool ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags f
IM_ASSERT_USER_ERROR(tab_bar, "Needs to be called between BeginTabBar() and EndTabBar()!");
return false;
}
- IM_ASSERT(!(flags & ImGuiTabItemFlags_Button)); // BeginTabItem() Can't be used with button flags, use TabItemButton() instead!
+ IM_ASSERT((flags & ImGuiTabItemFlags_Button) == 0); // BeginTabItem() Can't be used with button flags, use TabItemButton() instead!
- bool ret = TabItemEx(tab_bar, label, p_open, flags);
+ bool ret = TabItemEx(tab_bar, label, p_open, flags, NULL);
if (ret && !(flags & ImGuiTabItemFlags_NoPushId))
{
ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
@@ -8061,10 +10030,27 @@ bool ImGui::TabItemButton(const char* label, ImGuiTabItemFlags flags)
IM_ASSERT_USER_ERROR(tab_bar != NULL, "Needs to be called between BeginTabBar() and EndTabBar()!");
return false;
}
- return TabItemEx(tab_bar, label, NULL, flags | ImGuiTabItemFlags_Button | ImGuiTabItemFlags_NoReorder);
+ return TabItemEx(tab_bar, label, NULL, flags | ImGuiTabItemFlags_Button | ImGuiTabItemFlags_NoReorder, NULL);
}
-bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags)
+void ImGui::TabItemSpacing(const char* str_id, ImGuiTabItemFlags flags, float width)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ if (window->SkipItems)
+ return;
+
+ ImGuiTabBar* tab_bar = g.CurrentTabBar;
+ if (tab_bar == NULL)
+ {
+ IM_ASSERT_USER_ERROR(tab_bar != NULL, "Needs to be called between BeginTabBar() and EndTabBar()!");
+ return;
+ }
+ SetNextItemWidth(width);
+ TabItemEx(tab_bar, str_id, NULL, flags | ImGuiTabItemFlags_Button | ImGuiTabItemFlags_NoReorder | ImGuiTabItemFlags_Invisible, NULL);
+}
+
+bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window)
{
// Layout whole tab bar if not already done
ImGuiContext& g = *GImGui;
@@ -8079,7 +10065,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
return false;
const ImGuiStyle& style = g.Style;
- const ImGuiID id = TabBarCalcTabID(tab_bar, label);
+ const ImGuiID id = TabBarCalcTabID(tab_bar, label, docked_window);
// If the user called us with *p_open == false, we early out and don't render.
// We make a call to ItemAdd() so that attempts to use a contextual popup menu with an implicit ID won't use an older ID.
@@ -8114,7 +10100,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
// Calculate tab contents size
ImVec2 size = TabItemCalcSize(label, (p_open != NULL) || (flags & ImGuiTabItemFlags_UnsavedDocument));
tab->RequestedWidth = -1.0f;
- if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasWidth)
+ if (g.NextItemData.HasFlags & ImGuiNextItemDataFlags_HasWidth)
size.x = tab->RequestedWidth = g.NextItemData.Width;
if (tab_is_new)
tab->Width = ImMax(1.0f, size.x);
@@ -8129,18 +10115,25 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
tab->LastFrameVisible = g.FrameCount;
tab->Flags = flags;
- // Append name with zero-terminator
- tab->NameOffset = (ImS32)tab_bar->TabsNames.size();
- tab_bar->TabsNames.append(label, label + strlen(label) + 1);
+ // Append name _WITH_ the zero-terminator
+ if (docked_window != NULL)
+ {
+ IM_ASSERT(docked_window == NULL); // master branch only
+ }
+ else
+ {
+ tab->NameOffset = (ImS32)tab_bar->TabsNames.size();
+ tab_bar->TabsNames.append(label, label + ImStrlen(label) + 1);
+ }
// Update selected tab
if (!is_tab_button)
{
if (tab_appearing && (tab_bar->Flags & ImGuiTabBarFlags_AutoSelectNewTabs) && tab_bar->NextSelectedTabId == 0)
if (!tab_bar_appearing || tab_bar->SelectedTabId == 0)
- tab_bar->NextSelectedTabId = id; // New tabs gets activated
+ TabBarQueueFocus(tab_bar, tab); // New tabs gets activated
if ((flags & ImGuiTabItemFlags_SetSelected) && (tab_bar->SelectedTabId != id)) // _SetSelected can only be passed on explicit tab bar
- tab_bar->NextSelectedTabId = id;
+ TabBarQueueFocus(tab_bar, tab);
}
// Lock visibility
@@ -8174,7 +10167,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
const bool is_central_section = (tab->Flags & ImGuiTabItemFlags_SectionMask_) == 0;
size.x = tab->Width;
if (is_central_section)
- window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(IM_FLOOR(tab->Offset - tab_bar->ScrollingAnim), 0.0f);
+ window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(IM_TRUNC(tab->Offset - tab_bar->ScrollingAnim), 0.0f);
else
window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(tab->Offset, 0.0f);
ImVec2 pos = window->DC.CursorPos;
@@ -8198,17 +10191,17 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
}
// Click to Select a tab
- ImGuiButtonFlags button_flags = ((is_tab_button ? ImGuiButtonFlags_PressedOnClickRelease : ImGuiButtonFlags_PressedOnClick) | ImGuiButtonFlags_AllowItemOverlap);
+ // Allow the close button to overlap
+ ImGuiButtonFlags button_flags = ((is_tab_button ? ImGuiButtonFlags_PressedOnClickRelease : ImGuiButtonFlags_PressedOnClick) | ImGuiButtonFlags_AllowOverlap);
if (g.DragDropActive)
button_flags |= ImGuiButtonFlags_PressedOnDragDropHold;
- bool hovered, held;
- bool pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags);
+ bool hovered, held, pressed;
+ if (flags & ImGuiTabItemFlags_Invisible)
+ hovered = held = pressed = false;
+ else
+ pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags);
if (pressed && !is_tab_button)
- tab_bar->NextSelectedTabId = id;
-
- // Allow the close button to overlap unless we are dragging (in which case we don't want any overlapping tabs to be hovered)
- if (g.ActiveId != id)
- SetItemAllowOverlap();
+ TabBarQueueFocus(tab_bar, tab);
// Drag and drop: re-order tabs
if (held && !tab_appearing && IsMouseDragging(0))
@@ -8231,36 +10224,66 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
if (hovered && g.HoveredIdNotActiveTimer > TOOLTIP_DELAY && bb.GetWidth() < tab->ContentWidth)
{
// Enlarge tab display when hovering
- bb.Max.x = bb.Min.x + IM_FLOOR(ImLerp(bb.GetWidth(), tab->ContentWidth, ImSaturate((g.HoveredIdNotActiveTimer - 0.40f) * 6.0f)));
+ bb.Max.x = bb.Min.x + IM_TRUNC(ImLerp(bb.GetWidth(), tab->ContentWidth, ImSaturate((g.HoveredIdNotActiveTimer - 0.40f) * 6.0f)));
display_draw_list = GetForegroundDrawList(window);
TabItemBackground(display_draw_list, bb, flags, GetColorU32(ImGuiCol_TitleBgActive));
}
#endif
// Render tab shape
- ImDrawList* display_draw_list = window->DrawList;
- const ImU32 tab_col = GetColorU32((held || hovered) ? ImGuiCol_TabHovered : tab_contents_visible ? (tab_bar_focused ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive) : (tab_bar_focused ? ImGuiCol_Tab : ImGuiCol_TabUnfocused));
- TabItemBackground(display_draw_list, bb, flags, tab_col);
- RenderNavHighlight(bb, id);
-
- // Select with right mouse button. This is so the common idiom for context menu automatically highlight the current widget.
- const bool hovered_unblocked = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup);
- if (hovered_unblocked && (IsMouseClicked(1) || IsMouseReleased(1)))
- if (!is_tab_button)
- tab_bar->NextSelectedTabId = id;
-
- if (tab_bar->Flags & ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)
- flags |= ImGuiTabItemFlags_NoCloseWithMiddleMouseButton;
-
- // Render tab label, process close button
- const ImGuiID close_button_id = p_open ? GetIDWithSeed("#CLOSE", NULL, id) : 0;
- bool just_closed;
- bool text_clipped;
- TabItemLabelAndCloseButton(display_draw_list, bb, tab_just_unsaved ? (flags & ~ImGuiTabItemFlags_UnsavedDocument) : flags, tab_bar->FramePadding, label, id, close_button_id, tab_contents_visible, &just_closed, &text_clipped);
- if (just_closed && p_open != NULL)
+ const bool is_visible = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible) && !(flags & ImGuiTabItemFlags_Invisible);
+ if (is_visible)
{
- *p_open = false;
- TabBarCloseTab(tab_bar, tab);
+ ImDrawList* display_draw_list = window->DrawList;
+ const ImU32 tab_col = GetColorU32((held || hovered) ? ImGuiCol_TabHovered : tab_contents_visible ? (tab_bar_focused ? ImGuiCol_TabSelected : ImGuiCol_TabDimmedSelected) : (tab_bar_focused ? ImGuiCol_Tab : ImGuiCol_TabDimmed));
+ TabItemBackground(display_draw_list, bb, flags, tab_col);
+ if (tab_contents_visible && (tab_bar->Flags & ImGuiTabBarFlags_DrawSelectedOverline) && style.TabBarOverlineSize > 0.0f)
+ {
+ // Might be moved to TabItemBackground() ?
+ ImVec2 tl = bb.GetTL() + ImVec2(0, 1.0f * g.CurrentDpiScale);
+ ImVec2 tr = bb.GetTR() + ImVec2(0, 1.0f * g.CurrentDpiScale);
+ ImU32 overline_col = GetColorU32(tab_bar_focused ? ImGuiCol_TabSelectedOverline : ImGuiCol_TabDimmedSelectedOverline);
+ if (style.TabRounding > 0.0f)
+ {
+ float rounding = style.TabRounding;
+ display_draw_list->PathArcToFast(tl + ImVec2(+rounding, +rounding), rounding, 7, 9);
+ display_draw_list->PathArcToFast(tr + ImVec2(-rounding, +rounding), rounding, 9, 11);
+ display_draw_list->PathStroke(overline_col, 0, style.TabBarOverlineSize);
+ }
+ else
+ {
+ display_draw_list->AddLine(tl - ImVec2(0.5f, 0.5f), tr - ImVec2(0.5f, 0.5f), overline_col, style.TabBarOverlineSize);
+ }
+ }
+ RenderNavCursor(bb, id);
+
+ // Select with right mouse button. This is so the common idiom for context menu automatically highlight the current widget.
+ const bool hovered_unblocked = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup);
+ if (tab_bar->SelectedTabId != tab->ID && hovered_unblocked && (IsMouseClicked(1) || IsMouseReleased(1)) && !is_tab_button)
+ TabBarQueueFocus(tab_bar, tab);
+
+ if (tab_bar->Flags & ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)
+ flags |= ImGuiTabItemFlags_NoCloseWithMiddleMouseButton;
+
+ // Render tab label, process close button
+ const ImGuiID close_button_id = p_open ? GetIDWithSeed("#CLOSE", NULL, id) : 0;
+ bool just_closed;
+ bool text_clipped;
+ TabItemLabelAndCloseButton(display_draw_list, bb, tab_just_unsaved ? (flags & ~ImGuiTabItemFlags_UnsavedDocument) : flags, tab_bar->FramePadding, label, id, close_button_id, tab_contents_visible, &just_closed, &text_clipped);
+ if (just_closed && p_open != NULL)
+ {
+ *p_open = false;
+ TabBarCloseTab(tab_bar, tab);
+ }
+
+ // Tooltip
+ // (Won't work over the close button because ItemOverlap systems messes up with HoveredIdTimer-> seems ok)
+ // (We test IsItemHovered() to discard e.g. when another item is active or drag and drop over the tab bar, which g.HoveredId ignores)
+ // FIXME: This is a mess.
+ // FIXME: We may want disabled tab to still display the tooltip?
+ if (text_clipped && g.HoveredId == id && !held)
+ if (!(tab_bar->Flags & ImGuiTabBarFlags_NoTooltip) && !(tab->Flags & ImGuiTabItemFlags_NoTooltip))
+ SetItemTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label);
}
// Restore main window position so user can draw there
@@ -8268,16 +10291,6 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
PopClipRect();
window->DC.CursorPos = backup_main_cursor_pos;
- // Tooltip
- // (Won't work over the close button because ItemOverlap systems messes up with HoveredIdTimer-> seems ok)
- // (We test IsItemHovered() to discard e.g. when another item is active or drag and drop over the tab bar, which g.HoveredId ignores)
- // FIXME: This is a mess.
- // FIXME: We may want disabled tab to still display the tooltip?
- if (text_clipped && g.HoveredId == id && !held)
- if (!(tab_bar->Flags & ImGuiTabBarFlags_NoTooltip) && !(tab->Flags & ImGuiTabItemFlags_NoTooltip))
- if (IsItemHovered(ImGuiHoveredFlags_DelayNormal))
- SetTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label);
-
IM_ASSERT(!is_tab_button || !(tab_bar->SelectedTabId == tab->ID && is_tab_button)); // TabItemButton should not be selected
if (is_tab_button)
return pressed;
@@ -8294,7 +10307,7 @@ void ImGui::SetTabItemClosed(const char* label)
if (is_within_manual_tab_bar)
{
ImGuiTabBar* tab_bar = g.CurrentTabBar;
- ImGuiID tab_id = TabBarCalcTabID(tab_bar, label);
+ ImGuiID tab_id = TabBarCalcTabID(tab_bar, label, NULL);
if (ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, tab_id))
tab->WantClose = true; // Will be processed by next call to TabBarLayout()
}
@@ -8312,6 +10325,12 @@ ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button_or_unsave
return ImVec2(ImMin(size.x, TabBarCalcMaxTabWidth()), size.y);
}
+ImVec2 ImGui::TabItemCalcSize(ImGuiWindow*)
+{
+ IM_ASSERT(0); // This function exists to facilitate merge with 'docking' branch.
+ return ImVec2(0.0f, 0.0f);
+}
+
void ImGui::TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col)
{
// While rendering tabs, we trim 1 pixel off the top of our bounding box so they can fit within a regular frame height while looking "detached" from it.
@@ -8321,7 +10340,7 @@ void ImGui::TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabI
IM_ASSERT(width > 0.0f);
const float rounding = ImMax(0.0f, ImMin((flags & ImGuiTabItemFlags_Button) ? g.Style.FrameRounding : g.Style.TabRounding, width * 0.5f - 1.0f));
const float y1 = bb.Min.y + 1.0f;
- const float y2 = bb.Max.y - 1.0f;
+ const float y2 = bb.Max.y - g.Style.TabBarBorderSize;
draw_list->PathLineTo(ImVec2(bb.Min.x, y2));
draw_list->PathArcToFast(ImVec2(bb.Min.x + rounding, y1 + rounding), rounding, 6, 9);
draw_list->PathArcToFast(ImVec2(bb.Max.x - rounding, y1 + rounding), rounding, 9, 12);
@@ -8372,7 +10391,7 @@ void ImGui::TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb,
}
const float button_sz = g.FontSize;
- const ImVec2 button_pos(ImMax(bb.Min.x, bb.Max.x - frame_padding.x * 2.0f - button_sz), bb.Min.y);
+ const ImVec2 button_pos(ImMax(bb.Min.x, bb.Max.x - frame_padding.x - button_sz), bb.Min.y + frame_padding.y);
// Close Button & Unsaved Marker
// We are relying on a subtle and confusing distinction between 'hovered' and 'g.HoveredId' which happens because we are using ImGuiButtonFlags_AllowOverlapMode + SetItemAllowOverlap()
@@ -8381,30 +10400,34 @@ void ImGui::TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb,
// 'g.ActiveId==close_button_id' will be true when we are holding on the close button, in which case both hovered booleans are false
bool close_button_pressed = false;
bool close_button_visible = false;
+ bool is_hovered = g.HoveredId == tab_id || g.HoveredId == close_button_id || g.ActiveId == tab_id || g.ActiveId == close_button_id; // Any interaction account for this too.
+
if (close_button_id != 0)
- if (is_contents_visible || bb.GetWidth() >= ImMax(button_sz, g.Style.TabMinWidthForCloseButton))
- if (g.HoveredId == tab_id || g.HoveredId == close_button_id || g.ActiveId == tab_id || g.ActiveId == close_button_id)
- close_button_visible = true;
- bool unsaved_marker_visible = (flags & ImGuiTabItemFlags_UnsavedDocument) != 0 && (button_pos.x + button_sz <= bb.Max.x);
+ {
+ if (is_contents_visible)
+ close_button_visible = (g.Style.TabCloseButtonMinWidthSelected < 0.0f) ? true : (is_hovered && bb.GetWidth() >= ImMax(button_sz, g.Style.TabCloseButtonMinWidthSelected));
+ else
+ close_button_visible = (g.Style.TabCloseButtonMinWidthUnselected < 0.0f) ? true : (is_hovered && bb.GetWidth() >= ImMax(button_sz, g.Style.TabCloseButtonMinWidthUnselected));
+ }
- if (close_button_visible)
+ // When tabs/document is unsaved, the unsaved marker takes priority over the close button.
+ const bool unsaved_marker_visible = (flags & ImGuiTabItemFlags_UnsavedDocument) != 0 && (button_pos.x + button_sz <= bb.Max.x) && (!close_button_visible || !is_hovered);
+ if (unsaved_marker_visible)
+ {
+ const ImRect bullet_bb(button_pos, button_pos + ImVec2(button_sz, button_sz));
+ RenderBullet(draw_list, bullet_bb.GetCenter(), GetColorU32(ImGuiCol_Text));
+ }
+ else if (close_button_visible)
{
ImGuiLastItemData last_item_backup = g.LastItemData;
- PushStyleVar(ImGuiStyleVar_FramePadding, frame_padding);
if (CloseButton(close_button_id, button_pos))
close_button_pressed = true;
- PopStyleVar();
g.LastItemData = last_item_backup;
// Close with middle mouse button
- if (!(flags & ImGuiTabItemFlags_NoCloseWithMiddleMouseButton) && IsMouseClicked(2))
+ if (is_hovered && !(flags & ImGuiTabItemFlags_NoCloseWithMiddleMouseButton) && IsMouseClicked(2))
close_button_pressed = true;
}
- else if (unsaved_marker_visible)
- {
- const ImRect bullet_bb(button_pos, button_pos + ImVec2(button_sz, button_sz) + g.Style.FramePadding * 2.0f);
- RenderBullet(draw_list, bullet_bb.GetCenter(), GetColorU32(ImGuiCol_Text));
- }
// This is all rather complicated
// (the main idea is that because the close button only appears on hover, we don't want it to alter the ellipsis position)
@@ -8416,6 +10439,7 @@ void ImGui::TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb,
text_ellipsis_clip_bb.Max.x -= unsaved_marker_visible ? (button_sz * 0.80f) : 0.0f;
ellipsis_max_x = text_pixel_clip_bb.Max.x;
}
+ LogSetNextTextDecoration("/", "\\");
RenderTextEllipsis(draw_list, text_ellipsis_clip_bb.Min, text_ellipsis_clip_bb.Max, text_pixel_clip_bb.Max.x, ellipsis_max_x, label, NULL, &label_size);
#if 0
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl
index ce34f5d6427..5ddaf707e59 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl
@@ -55,10 +55,10 @@ namespace ImGui
int data_editing_addr_backup = DataEditingAddr;
if (DataEditingAddr != -1)
{
- if (IsKeyPressed(GetKeyIndex(ImGuiKey_UpArrow)) && DataEditingAddr >= Rows) { DataEditingAddr -= Rows; DataEditingTakeFocus = true; }
- else if (IsKeyPressed(GetKeyIndex(ImGuiKey_DownArrow)) && DataEditingAddr < mem_size - Rows) { DataEditingAddr += Rows; DataEditingTakeFocus = true; }
- else if (IsKeyPressed(GetKeyIndex(ImGuiKey_LeftArrow)) && DataEditingAddr > 0) { DataEditingAddr -= 1; DataEditingTakeFocus = true; }
- else if (IsKeyPressed(GetKeyIndex(ImGuiKey_RightArrow)) && DataEditingAddr < mem_size - 1) { DataEditingAddr += 1; DataEditingTakeFocus = true; }
+ if (IsKeyPressed(ImGuiKey_UpArrow) && DataEditingAddr >= Rows) { DataEditingAddr -= Rows; DataEditingTakeFocus = true; }
+ else if (IsKeyPressed(ImGuiKey_DownArrow) && DataEditingAddr < mem_size - Rows) { DataEditingAddr += Rows; DataEditingTakeFocus = true; }
+ else if (IsKeyPressed(ImGuiKey_LeftArrow) && DataEditingAddr > 0) { DataEditingAddr -= 1; DataEditingTakeFocus = true; }
+ else if (IsKeyPressed(ImGuiKey_RightArrow) && DataEditingAddr < mem_size - 1) { DataEditingAddr += 1; DataEditingTakeFocus = true; }
}
if ((DataEditingAddr / Rows) != (data_editing_addr_backup / Rows))
@@ -207,7 +207,7 @@ namespace ImGui
AlignTextToFramePadding();
PushItemWidth(50);
- PushAllowKeyboardFocus(false);
+ PushItemFlag(ImGuiItemFlags_NoTabStop, true);
int rows_backup = Rows;
if (DragInt("##rows", &Rows, 0.2f, 4, 32, "%.0f rows"))
{
@@ -216,7 +216,7 @@ namespace ImGui
SetWindowSize(new_window_size);
}
- PopAllowKeyboardFocus();
+ PopItemFlag();
PopItemWidth();
SameLine();
Text("Range %0*x..%0*x", addr_digits_count, (int)base_display_addr, addr_digits_count, (int)base_display_addr+mem_size-1);
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl
index 419ec763872..659da723e03 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl
@@ -4,10 +4,6 @@
namespace ImGui
{
-extern float RoundScalarWithFormatFloat(const char* format, ImGuiDataType data_type, float v);
-
-extern float SliderCalcRatioFromValueFloat(ImGuiDataType data_type, float v, float v_min, float v_max, float power, float linear_zero_pos);
-
// ~80% common code with ImGui::SliderBehavior
bool RangeSliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v1, float* v2, float v_min, float v_max, float power, int decimal_precision, ImGuiSliderFlags flags)
{
@@ -91,7 +87,7 @@ bool RangeSliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v1, float* v
snprintf(fmt, 64, "%%.%df", decimal_precision);
// Round past decimal precision
- new_value = RoundScalarWithFormatFloat(fmt, ImGuiDataType_Float, new_value);
+ new_value = RoundScalarWithFormatT<float>(fmt, ImGuiDataType_Float, new_value);
if (*v1 != new_value || *v2 != new_value)
{
if (fabsf(*v1 - new_value) < fabsf(*v2 - new_value))
@@ -112,7 +108,7 @@ bool RangeSliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v1, float* v
}
// Calculate slider grab positioning
- float grab_t = SliderCalcRatioFromValueFloat(ImGuiDataType_Float, *v1, v_min, v_max, power, linear_zero_pos);
+ float grab_t = ScaleRatioFromValueT<float, float, float>(ImGuiDataType_Float, *v1, v_min, v_max, false, power, linear_zero_pos);
// Draw
if (!is_horizontal)
@@ -126,7 +122,7 @@ bool RangeSliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v1, float* v
window->DrawList->AddRectFilled(grab_bb1.Min, grab_bb1.Max, GetColorU32(g.ActiveId == id ? ImGuiCol_SliderGrabActive : ImGuiCol_SliderGrab), style.GrabRounding);
// Calculate slider grab positioning
- grab_t = SliderCalcRatioFromValueFloat(ImGuiDataType_Float, *v2, v_min, v_max, power, linear_zero_pos);
+ grab_t = ScaleRatioFromValueT<float, float, float>(ImGuiDataType_Float, *v2, v_min, v_max, false, power, linear_zero_pos);
// Draw
if (!is_horizontal)
@@ -173,7 +169,7 @@ bool RangeSliderFloat(const char* label, float* v1, float* v2, float v_min, floa
return false;
}
- const bool hovered = ItemHoverable(frame_bb, id);
+ const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.ItemFlags);
if (hovered)
SetHoveredID(id);
@@ -183,13 +179,12 @@ bool RangeSliderFloat(const char* label, float* v1, float* v2, float v_min, floa
// Tabbing or CTRL-clicking on Slider turns it into an input box
bool start_text_input = false;
- const bool tab_focus_requested = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
- if (tab_focus_requested || (hovered && g.IO.MouseClicked[0]))
+ if (hovered && g.IO.MouseClicked[0])
{
SetActiveID(id, window);
FocusWindow(window);
- if (tab_focus_requested || g.IO.KeyCtrl)
+ if (g.IO.KeyCtrl)
{
start_text_input = true;
g.TempInputId = 0;
diff --git a/3rdparty/bgfx/3rdparty/stb/stb_textedit.h b/3rdparty/bgfx/3rdparty/stb/stb_textedit.h
index 7644670975c..b7a761c8538 100644
--- a/3rdparty/bgfx/3rdparty/stb/stb_textedit.h
+++ b/3rdparty/bgfx/3rdparty/stb/stb_textedit.h
@@ -1,10 +1,14 @@
// [DEAR IMGUI]
-// This is a slightly modified version of stb_textedit.h 1.13.
+// This is a slightly modified version of stb_textedit.h 1.14.
// Those changes would need to be pushed into nothings/stb:
// - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321)
+// - Fix in stb_textedit_find_charpos to handle last line (see https://github.com/ocornut/imgui/issues/6000 + #6783)
+// - Added name to struct or it may be forward declared in our code.
+// - Added UTF-8 support (see https://github.com/nothings/stb/issues/188 + https://github.com/ocornut/imgui/pull/7925)
// Grep for [DEAR IMGUI] to find the changes.
+// - Also renamed macros used or defined outside of IMSTB_TEXTEDIT_IMPLEMENTATION block from STB_TEXTEDIT_* to IMSTB_TEXTEDIT_*
-// stb_textedit.h - v1.13 - public domain - Sean Barrett
+// stb_textedit.h - v1.14 - public domain - Sean Barrett
// Development of this library was sponsored by RAD Game Tools
//
// This C header file implements the guts of a multi-line text-editing
@@ -19,7 +23,7 @@
// texts, as its performance does not scale and it has limited undo).
//
// Non-trivial behaviors are modelled after Windows text controls.
-//
+//
//
// LICENSE
//
@@ -29,16 +33,17 @@
// DEPENDENCIES
//
// Uses the C runtime function 'memmove', which you can override
-// by defining STB_TEXTEDIT_memmove before the implementation.
+// by defining IMSTB_TEXTEDIT_memmove before the implementation.
// Uses no other functions. Performs no runtime allocations.
//
//
// VERSION HISTORY
//
+// 1.14 (2021-07-11) page up/down, various fixes
// 1.13 (2019-02-07) fix bug in undo size management
// 1.12 (2018-01-29) user can change STB_TEXTEDIT_KEYTYPE, fix redo to avoid crash
// 1.11 (2017-03-03) fix HOME on last line, dragging off single-line textfield
-// 1.10 (2016-10-25) supress warnings about casting away const with -Wcast-qual
+// 1.10 (2016-10-25) suppress warnings about casting away const with -Wcast-qual
// 1.9 (2016-08-27) customizable move-by-word
// 1.8 (2016-04-02) better keyboard handling when mouse button is down
// 1.7 (2015-09-13) change y range handling in case baseline is non-0
@@ -58,6 +63,7 @@
// Ulf Winklemann: move-by-word in 1.1
// Fabian Giesen: secondary key inputs in 1.5
// Martins Mozeiko: STB_TEXTEDIT_memmove in 1.6
+// Louis Schnellbach: page up/down in 1.14
//
// Bugfixes:
// Scott Graham
@@ -93,8 +99,8 @@
// moderate sizes. The undo system does no memory allocations, so
// it grows STB_TexteditState by the worst-case storage which is (in bytes):
//
-// [4 + 3 * sizeof(STB_TEXTEDIT_POSITIONTYPE)] * STB_TEXTEDIT_UNDOSTATE_COUNT
-// + sizeof(STB_TEXTEDIT_CHARTYPE) * STB_TEXTEDIT_UNDOCHAR_COUNT
+// [4 + 3 * sizeof(STB_TEXTEDIT_POSITIONTYPE)] * STB_TEXTEDIT_UNDOSTATECOUNT
+// + sizeof(STB_TEXTEDIT_CHARTYPE) * STB_TEXTEDIT_UNDOCHARCOUNT
//
//
// Implementation mode:
@@ -205,6 +211,7 @@
// int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
// int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int len)
// void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXEDIT_KEYTYPE key)
+// void stb_textedit_text(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int text_len)
//
// Each of these functions potentially updates the string and updates the
// state.
@@ -217,20 +224,20 @@
// call this with the mouse x,y on a mouse down; it will update the cursor
// and reset the selection start/end to the cursor point. the x,y must
// be relative to the text widget, with (0,0) being the top left.
-//
+//
// drag:
// call this with the mouse x,y on a mouse drag/up; it will update the
// cursor and the selection end point
-//
+//
// cut:
// call this to delete the current selection; returns true if there was
// one. you should FIRST copy the current selection to the system paste buffer.
// (To copy, just copy the current selection out of the string yourself.)
-//
+//
// paste:
// call this to paste text at the current cursor point or over the current
// selection if there is one.
-//
+//
// key:
// call this for keyboard inputs sent to the textfield. you can use it
// for "key down" events or for "translated" key events. if you need to
@@ -239,9 +246,14 @@
// various definitions like STB_TEXTEDIT_K_LEFT have the is-key-event bit
// set, and make STB_TEXTEDIT_KEYTOCHAR check that the is-key-event bit is
// clear. STB_TEXTEDIT_KEYTYPE defaults to int, but you can #define it to
-// anything other type you wante before including.
+// anything other type you want before including.
+// if the STB_TEXTEDIT_KEYTOTEXT function is defined, selected keys are
+// transformed into text and stb_textedit_text() is automatically called.
+//
+// text: [DEAR IMGUI] added 2024-09
+// call this to text inputs sent to the textfield.
+//
//
-//
// When rendering, you can read the cursor position and selection state from
// the STB_TexteditState.
//
@@ -271,8 +283,8 @@
////
////
-#ifndef INCLUDE_STB_TEXTEDIT_H
-#define INCLUDE_STB_TEXTEDIT_H
+#ifndef INCLUDE_IMSTB_TEXTEDIT_H
+#define INCLUDE_IMSTB_TEXTEDIT_H
////////////////////////////////////////////////////////////////////////
//
@@ -283,38 +295,38 @@
// and undo state.
//
-#ifndef STB_TEXTEDIT_UNDOSTATECOUNT
-#define STB_TEXTEDIT_UNDOSTATECOUNT 99
+#ifndef IMSTB_TEXTEDIT_UNDOSTATECOUNT
+#define IMSTB_TEXTEDIT_UNDOSTATECOUNT 99
#endif
-#ifndef STB_TEXTEDIT_UNDOCHARCOUNT
-#define STB_TEXTEDIT_UNDOCHARCOUNT 999
+#ifndef IMSTB_TEXTEDIT_UNDOCHARCOUNT
+#define IMSTB_TEXTEDIT_UNDOCHARCOUNT 999
#endif
-#ifndef STB_TEXTEDIT_CHARTYPE
-#define STB_TEXTEDIT_CHARTYPE int
+#ifndef IMSTB_TEXTEDIT_CHARTYPE
+#define IMSTB_TEXTEDIT_CHARTYPE int
#endif
-#ifndef STB_TEXTEDIT_POSITIONTYPE
-#define STB_TEXTEDIT_POSITIONTYPE int
+#ifndef IMSTB_TEXTEDIT_POSITIONTYPE
+#define IMSTB_TEXTEDIT_POSITIONTYPE int
#endif
typedef struct
{
// private data
- STB_TEXTEDIT_POSITIONTYPE where;
- STB_TEXTEDIT_POSITIONTYPE insert_length;
- STB_TEXTEDIT_POSITIONTYPE delete_length;
+ IMSTB_TEXTEDIT_POSITIONTYPE where;
+ IMSTB_TEXTEDIT_POSITIONTYPE insert_length;
+ IMSTB_TEXTEDIT_POSITIONTYPE delete_length;
int char_storage;
} StbUndoRecord;
typedef struct
{
// private data
- StbUndoRecord undo_rec [STB_TEXTEDIT_UNDOSTATECOUNT];
- STB_TEXTEDIT_CHARTYPE undo_char[STB_TEXTEDIT_UNDOCHARCOUNT];
+ StbUndoRecord undo_rec [IMSTB_TEXTEDIT_UNDOSTATECOUNT];
+ IMSTB_TEXTEDIT_CHARTYPE undo_char[IMSTB_TEXTEDIT_UNDOCHARCOUNT];
short undo_point, redo_point;
int undo_char_point, redo_char_point;
} StbUndoState;
-typedef struct
+typedef struct STB_TexteditState
{
/////////////////////
//
@@ -368,7 +380,7 @@ typedef struct
float ymin,ymax; // height of row above and below baseline
int num_chars;
} StbTexteditRow;
-#endif //INCLUDE_STB_TEXTEDIT_H
+#endif //INCLUDE_IMSTB_TEXTEDIT_H
////////////////////////////////////////////////////////////////////////////
@@ -381,11 +393,11 @@ typedef struct
// implementation isn't include-guarded, since it might have indirectly
// included just the "header" portion
-#ifdef STB_TEXTEDIT_IMPLEMENTATION
+#ifdef IMSTB_TEXTEDIT_IMPLEMENTATION
-#ifndef STB_TEXTEDIT_memmove
+#ifndef IMSTB_TEXTEDIT_memmove
#include <string.h>
-#define STB_TEXTEDIT_memmove memmove
+#define IMSTB_TEXTEDIT_memmove memmove
#endif
@@ -395,7 +407,7 @@ typedef struct
//
// traverse the layout to locate the nearest character to a display position
-static int stb_text_locate_coord(STB_TEXTEDIT_STRING *str, float x, float y)
+static int stb_text_locate_coord(IMSTB_TEXTEDIT_STRING *str, float x, float y)
{
StbTexteditRow r;
int n = STB_TEXTEDIT_STRINGLEN(str);
@@ -434,13 +446,13 @@ static int stb_text_locate_coord(STB_TEXTEDIT_STRING *str, float x, float y)
if (x < r.x1) {
// search characters in row for one that straddles 'x'
prev_x = r.x0;
- for (k=0; k < r.num_chars; ++k) {
+ for (k=0; k < r.num_chars; k = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, i + k) - i) {
float w = STB_TEXTEDIT_GETWIDTH(str, i, k);
if (x < prev_x+w) {
if (x < prev_x+w/2)
return k+i;
else
- return k+i+1;
+ return IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, i + k);
}
prev_x += w;
}
@@ -455,7 +467,7 @@ static int stb_text_locate_coord(STB_TEXTEDIT_STRING *str, float x, float y)
}
// API click: on mouse down, move the cursor to the clicked location, and reset the selection
-static void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y)
+static void stb_textedit_click(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y)
{
// In single-line mode, just always make y = 0. This lets the drag keep working if the mouse
// goes off the top or bottom of the text
@@ -473,7 +485,7 @@ static void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *stat
}
// API drag: on mouse drag, move the cursor and selection endpoint to the clicked location
-static void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y)
+static void stb_textedit_drag(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y)
{
int p = 0;
@@ -499,11 +511,11 @@ static void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state
//
// forward declarations
-static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state);
-static void stb_text_redo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state);
-static void stb_text_makeundo_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length);
+static void stb_text_undo(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state);
+static void stb_text_redo(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state);
+static void stb_text_makeundo_delete(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length);
static void stb_text_makeundo_insert(STB_TexteditState *state, int where, int length);
-static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length);
+static void stb_text_makeundo_replace(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length);
typedef struct
{
@@ -515,36 +527,21 @@ typedef struct
// find the x/y location of a character, and remember info about the previous row in
// case we get a move-up event (for page up, we'll have to rescan)
-static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *str, int n, int single_line)
+static void stb_textedit_find_charpos(StbFindState *find, IMSTB_TEXTEDIT_STRING *str, int n, int single_line)
{
StbTexteditRow r;
int prev_start = 0;
int z = STB_TEXTEDIT_STRINGLEN(str);
int i=0, first;
- if (n == z) {
- // if it's at the end, then find the last line -- simpler than trying to
- // explicitly handle this case in the regular code
- if (single_line) {
- STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
- find->y = 0;
- find->first_char = 0;
- find->length = z;
- find->height = r.ymax - r.ymin;
- find->x = r.x1;
- } else {
- find->y = 0;
- find->x = 0;
- find->height = 1;
- while (i < z) {
- STB_TEXTEDIT_LAYOUTROW(&r, str, i);
- prev_start = i;
- i += r.num_chars;
- }
- find->first_char = i;
- find->length = 0;
- find->prev_first = prev_start;
- }
+ if (n == z && single_line) {
+ // special case if it's at the end (may not be needed?)
+ STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
+ find->y = 0;
+ find->first_char = 0;
+ find->length = z;
+ find->height = r.ymax - r.ymin;
+ find->x = r.x1;
return;
}
@@ -555,9 +552,16 @@ static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *s
STB_TEXTEDIT_LAYOUTROW(&r, str, i);
if (n < i + r.num_chars)
break;
+ if (i + r.num_chars == z && z > 0 && STB_TEXTEDIT_GETCHAR(str, z - 1) != STB_TEXTEDIT_NEWLINE) // [DEAR IMGUI] special handling for last line
+ break; // [DEAR IMGUI]
prev_start = i;
i += r.num_chars;
find->y += r.baseline_y_delta;
+ if (i == z) // [DEAR IMGUI]
+ {
+ r.num_chars = 0; // [DEAR IMGUI]
+ break; // [DEAR IMGUI]
+ }
}
find->first_char = first = i;
@@ -567,14 +571,14 @@ static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *s
// now scan to find xpos
find->x = r.x0;
- for (i=0; first+i < n; ++i)
+ for (i=0; first+i < n; i = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, first + i) - first)
find->x += STB_TEXTEDIT_GETWIDTH(str, first, i);
}
#define STB_TEXT_HAS_SELECTION(s) ((s)->select_start != (s)->select_end)
// make the selection/cursor state valid if client altered the string
-static void stb_textedit_clamp(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
+static void stb_textedit_clamp(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
int n = STB_TEXTEDIT_STRINGLEN(str);
if (STB_TEXT_HAS_SELECTION(state)) {
@@ -588,7 +592,7 @@ static void stb_textedit_clamp(STB_TEXTEDIT_STRING *str, STB_TexteditState *stat
}
// delete characters while updating undo
-static void stb_textedit_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int len)
+static void stb_textedit_delete(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int len)
{
stb_text_makeundo_delete(str, state, where, len);
STB_TEXTEDIT_DELETECHARS(str, where, len);
@@ -596,7 +600,7 @@ static void stb_textedit_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *sta
}
// delete the section
-static void stb_textedit_delete_selection(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
+static void stb_textedit_delete_selection(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
stb_textedit_clamp(str, state);
if (STB_TEXT_HAS_SELECTION(state)) {
@@ -633,7 +637,7 @@ static void stb_textedit_move_to_first(STB_TexteditState *state)
}
// move cursor to last character of selection
-static void stb_textedit_move_to_last(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
+static void stb_textedit_move_to_last(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
if (STB_TEXT_HAS_SELECTION(state)) {
stb_textedit_sortselection(state);
@@ -644,14 +648,25 @@ static void stb_textedit_move_to_last(STB_TEXTEDIT_STRING *str, STB_TexteditStat
}
}
+// [DEAR IMGUI]
+// Functions must be implemented for UTF8 support
+// Code in this file that uses those functions is modified for [DEAR IMGUI] and deviates from the original stb_textedit.
+// There is not necessarily a '[DEAR IMGUI]' at the usage sites.
+#ifndef IMSTB_TEXTEDIT_GETPREVCHARINDEX
+#define IMSTB_TEXTEDIT_GETPREVCHARINDEX(obj, idx) (idx - 1)
+#endif
+#ifndef IMSTB_TEXTEDIT_GETNEXTCHARINDEX
+#define IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx) (idx + 1)
+#endif
+
#ifdef STB_TEXTEDIT_IS_SPACE
-static int is_word_boundary( STB_TEXTEDIT_STRING *str, int idx )
+static int is_word_boundary( IMSTB_TEXTEDIT_STRING *str, int idx )
{
return idx > 0 ? (STB_TEXTEDIT_IS_SPACE( STB_TEXTEDIT_GETCHAR(str,idx-1) ) && !STB_TEXTEDIT_IS_SPACE( STB_TEXTEDIT_GETCHAR(str, idx) ) ) : 1;
}
#ifndef STB_TEXTEDIT_MOVEWORDLEFT
-static int stb_textedit_move_to_word_previous( STB_TEXTEDIT_STRING *str, int c )
+static int stb_textedit_move_to_word_previous( IMSTB_TEXTEDIT_STRING *str, int c )
{
--c; // always move at least one character
while( c >= 0 && !is_word_boundary( str, c ) )
@@ -666,7 +681,7 @@ static int stb_textedit_move_to_word_previous( STB_TEXTEDIT_STRING *str, int c )
#endif
#ifndef STB_TEXTEDIT_MOVEWORDRIGHT
-static int stb_textedit_move_to_word_next( STB_TEXTEDIT_STRING *str, int c )
+static int stb_textedit_move_to_word_next( IMSTB_TEXTEDIT_STRING *str, int c )
{
const int len = STB_TEXTEDIT_STRINGLEN(str);
++c; // always move at least one character
@@ -693,7 +708,7 @@ static void stb_textedit_prep_selection_at_cursor(STB_TexteditState *state)
}
// API cut: delete selection
-static int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
+static int stb_textedit_cut(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
if (STB_TEXT_HAS_SELECTION(state)) {
stb_textedit_delete_selection(str,state); // implicitly clamps
@@ -704,7 +719,7 @@ static int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
}
// API paste: replace existing selection with passed-in text
-static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int len)
+static int stb_textedit_paste_internal(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, IMSTB_TEXTEDIT_CHARTYPE *text, int len)
{
// if there's a selection, the paste should delete it
stb_textedit_clamp(str, state);
@@ -716,9 +731,7 @@ static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditSta
state->has_preferred_x = 0;
return 1;
}
- // remove the undo since we didn't actually insert the characters
- if (state->undostate.undo_point)
- --state->undostate.undo_point;
+ // note: paste failure will leave deleted selection, may be restored with an undo (see https://github.com/nothings/stb/issues/734 for details)
return 0;
}
@@ -726,36 +739,44 @@ static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditSta
#define STB_TEXTEDIT_KEYTYPE int
#endif
+// [DEAR IMGUI] Added stb_textedit_text(), extracted out and called by stb_textedit_key() for backward compatibility.
+static void stb_textedit_text(IMSTB_TEXTEDIT_STRING* str, STB_TexteditState* state, const IMSTB_TEXTEDIT_CHARTYPE* text, int text_len)
+{
+ // can't add newline in single-line mode
+ if (text[0] == '\n' && state->single_line)
+ return;
+
+ if (state->insert_mode && !STB_TEXT_HAS_SELECTION(state) && state->cursor < STB_TEXTEDIT_STRINGLEN(str)) {
+ stb_text_makeundo_replace(str, state, state->cursor, 1, 1);
+ STB_TEXTEDIT_DELETECHARS(str, state->cursor, 1);
+ if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, text, text_len)) {
+ state->cursor += text_len;
+ state->has_preferred_x = 0;
+ }
+ }
+ else {
+ stb_textedit_delete_selection(str, state); // implicitly clamps
+ if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, text, text_len)) {
+ stb_text_makeundo_insert(state, state->cursor, text_len);
+ state->cursor += text_len;
+ state->has_preferred_x = 0;
+ }
+ }
+}
+
// API key: process a keyboard input
-static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_KEYTYPE key)
+static void stb_textedit_key(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_KEYTYPE key)
{
retry:
switch (key) {
default: {
+#ifdef STB_TEXTEDIT_KEYTOTEXT
int c = STB_TEXTEDIT_KEYTOTEXT(key);
if (c > 0) {
- STB_TEXTEDIT_CHARTYPE ch = (STB_TEXTEDIT_CHARTYPE) c;
-
- // can't add newline in single-line mode
- if (c == '\n' && state->single_line)
- break;
-
- if (state->insert_mode && !STB_TEXT_HAS_SELECTION(state) && state->cursor < STB_TEXTEDIT_STRINGLEN(str)) {
- stb_text_makeundo_replace(str, state, state->cursor, 1, 1);
- STB_TEXTEDIT_DELETECHARS(str, state->cursor, 1);
- if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) {
- ++state->cursor;
- state->has_preferred_x = 0;
- }
- } else {
- stb_textedit_delete_selection(str,state); // implicitly clamps
- if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) {
- stb_text_makeundo_insert(state, state->cursor, 1);
- ++state->cursor;
- state->has_preferred_x = 0;
- }
- }
+ IMSTB_TEXTEDIT_CHARTYPE ch = (IMSTB_TEXTEDIT_CHARTYPE)c;
+ stb_textedit_text(str, state, &ch, 1);
}
+#endif
break;
}
@@ -764,7 +785,7 @@ retry:
state->insert_mode = !state->insert_mode;
break;
#endif
-
+
case STB_TEXTEDIT_K_UNDO:
stb_text_undo(str, state);
state->has_preferred_x = 0;
@@ -779,9 +800,9 @@ retry:
// if currently there's a selection, move cursor to start of selection
if (STB_TEXT_HAS_SELECTION(state))
stb_textedit_move_to_first(state);
- else
+ else
if (state->cursor > 0)
- --state->cursor;
+ state->cursor = IMSTB_TEXTEDIT_GETPREVCHARINDEX(str, state->cursor);
state->has_preferred_x = 0;
break;
@@ -790,7 +811,7 @@ retry:
if (STB_TEXT_HAS_SELECTION(state))
stb_textedit_move_to_last(str, state);
else
- ++state->cursor;
+ state->cursor = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor);
stb_textedit_clamp(str, state);
state->has_preferred_x = 0;
break;
@@ -800,7 +821,7 @@ retry:
stb_textedit_prep_selection_at_cursor(state);
// move selection left
if (state->select_end > 0)
- --state->select_end;
+ state->select_end = IMSTB_TEXTEDIT_GETPREVCHARINDEX(str, state->select_end);
state->cursor = state->select_end;
state->has_preferred_x = 0;
break;
@@ -828,7 +849,7 @@ retry:
#ifdef STB_TEXTEDIT_MOVEWORDRIGHT
case STB_TEXTEDIT_K_WORDRIGHT:
- if (STB_TEXT_HAS_SELECTION(state))
+ if (STB_TEXT_HAS_SELECTION(state))
stb_textedit_move_to_last(str, state);
else {
state->cursor = STB_TEXTEDIT_MOVEWORDRIGHT(str, state->cursor);
@@ -850,7 +871,7 @@ retry:
case STB_TEXTEDIT_K_RIGHT | STB_TEXTEDIT_K_SHIFT:
stb_textedit_prep_selection_at_cursor(state);
// move selection right
- ++state->select_end;
+ state->select_end = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->select_end);
stb_textedit_clamp(str, state);
state->cursor = state->select_end;
state->has_preferred_x = 0;
@@ -899,14 +920,14 @@ retry:
x = row.x0;
for (i=0; i < row.num_chars; ++i) {
float dx = STB_TEXTEDIT_GETWIDTH(str, start, i);
- #ifdef STB_TEXTEDIT_GETWIDTH_NEWLINE
- if (dx == STB_TEXTEDIT_GETWIDTH_NEWLINE)
+ #ifdef IMSTB_TEXTEDIT_GETWIDTH_NEWLINE
+ if (dx == IMSTB_TEXTEDIT_GETWIDTH_NEWLINE)
break;
#endif
x += dx;
if (x > goal_x)
break;
- ++state->cursor;
+ state->cursor = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor);
}
stb_textedit_clamp(str, state);
@@ -922,7 +943,7 @@ retry:
}
break;
}
-
+
case STB_TEXTEDIT_K_UP:
case STB_TEXTEDIT_K_UP | STB_TEXTEDIT_K_SHIFT:
case STB_TEXTEDIT_K_PGUP:
@@ -961,14 +982,14 @@ retry:
x = row.x0;
for (i=0; i < row.num_chars; ++i) {
float dx = STB_TEXTEDIT_GETWIDTH(str, find.prev_first, i);
- #ifdef STB_TEXTEDIT_GETWIDTH_NEWLINE
- if (dx == STB_TEXTEDIT_GETWIDTH_NEWLINE)
+ #ifdef IMSTB_TEXTEDIT_GETWIDTH_NEWLINE
+ if (dx == IMSTB_TEXTEDIT_GETWIDTH_NEWLINE)
break;
#endif
x += dx;
if (x > goal_x)
break;
- ++state->cursor;
+ state->cursor = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor);
}
stb_textedit_clamp(str, state);
@@ -996,7 +1017,7 @@ retry:
else {
int n = STB_TEXTEDIT_STRINGLEN(str);
if (state->cursor < n)
- stb_textedit_delete(str, state, state->cursor, 1);
+ stb_textedit_delete(str, state, state->cursor, IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor) - state->cursor);
}
state->has_preferred_x = 0;
break;
@@ -1008,13 +1029,14 @@ retry:
else {
stb_textedit_clamp(str, state);
if (state->cursor > 0) {
- stb_textedit_delete(str, state, state->cursor-1, 1);
- --state->cursor;
+ int prev = IMSTB_TEXTEDIT_GETPREVCHARINDEX(str, state->cursor);
+ stb_textedit_delete(str, state, prev, state->cursor - prev);
+ state->cursor = prev;
}
}
state->has_preferred_x = 0;
break;
-
+
#ifdef STB_TEXTEDIT_K_TEXTSTART2
case STB_TEXTEDIT_K_TEXTSTART2:
#endif
@@ -1031,7 +1053,7 @@ retry:
state->select_start = state->select_end = 0;
state->has_preferred_x = 0;
break;
-
+
#ifdef STB_TEXTEDIT_K_TEXTSTART2
case STB_TEXTEDIT_K_TEXTSTART2 | STB_TEXTEDIT_K_SHIFT:
#endif
@@ -1119,8 +1141,8 @@ retry:
static void stb_textedit_flush_redo(StbUndoState *state)
{
- state->redo_point = STB_TEXTEDIT_UNDOSTATECOUNT;
- state->redo_char_point = STB_TEXTEDIT_UNDOCHARCOUNT;
+ state->redo_point = IMSTB_TEXTEDIT_UNDOSTATECOUNT;
+ state->redo_char_point = IMSTB_TEXTEDIT_UNDOCHARCOUNT;
}
// discard the oldest entry in the undo list
@@ -1132,13 +1154,13 @@ static void stb_textedit_discard_undo(StbUndoState *state)
int n = state->undo_rec[0].insert_length, i;
// delete n characters from all other records
state->undo_char_point -= n;
- STB_TEXTEDIT_memmove(state->undo_char, state->undo_char + n, (size_t) (state->undo_char_point*sizeof(STB_TEXTEDIT_CHARTYPE)));
+ IMSTB_TEXTEDIT_memmove(state->undo_char, state->undo_char + n, (size_t) (state->undo_char_point*sizeof(IMSTB_TEXTEDIT_CHARTYPE)));
for (i=0; i < state->undo_point; ++i)
if (state->undo_rec[i].char_storage >= 0)
state->undo_rec[i].char_storage -= n; // @OPTIMIZE: get rid of char_storage and infer it
}
--state->undo_point;
- STB_TEXTEDIT_memmove(state->undo_rec, state->undo_rec+1, (size_t) (state->undo_point*sizeof(state->undo_rec[0])));
+ IMSTB_TEXTEDIT_memmove(state->undo_rec, state->undo_rec+1, (size_t) (state->undo_point*sizeof(state->undo_rec[0])));
}
}
@@ -1148,7 +1170,7 @@ static void stb_textedit_discard_undo(StbUndoState *state)
// fill up even though the undo buffer didn't
static void stb_textedit_discard_redo(StbUndoState *state)
{
- int k = STB_TEXTEDIT_UNDOSTATECOUNT-1;
+ int k = IMSTB_TEXTEDIT_UNDOSTATECOUNT-1;
if (state->redo_point <= k) {
// if the k'th undo state has characters, clean those up
@@ -1156,7 +1178,7 @@ static void stb_textedit_discard_redo(StbUndoState *state)
int n = state->undo_rec[k].insert_length, i;
// move the remaining redo character data to the end of the buffer
state->redo_char_point += n;
- STB_TEXTEDIT_memmove(state->undo_char + state->redo_char_point, state->undo_char + state->redo_char_point-n, (size_t) ((STB_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point)*sizeof(STB_TEXTEDIT_CHARTYPE)));
+ IMSTB_TEXTEDIT_memmove(state->undo_char + state->redo_char_point, state->undo_char + state->redo_char_point-n, (size_t) ((IMSTB_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point)*sizeof(IMSTB_TEXTEDIT_CHARTYPE)));
// adjust the position of all the other records to account for above memmove
for (i=state->redo_point; i < k; ++i)
if (state->undo_rec[i].char_storage >= 0)
@@ -1164,12 +1186,12 @@ static void stb_textedit_discard_redo(StbUndoState *state)
}
// now move all the redo records towards the end of the buffer; the first one is at 'redo_point'
// [DEAR IMGUI]
- size_t move_size = (size_t)((STB_TEXTEDIT_UNDOSTATECOUNT - state->redo_point - 1) * sizeof(state->undo_rec[0]));
+ size_t move_size = (size_t)((IMSTB_TEXTEDIT_UNDOSTATECOUNT - state->redo_point - 1) * sizeof(state->undo_rec[0]));
const char* buf_begin = (char*)state->undo_rec; (void)buf_begin;
const char* buf_end = (char*)state->undo_rec + sizeof(state->undo_rec); (void)buf_end;
IM_ASSERT(((char*)(state->undo_rec + state->redo_point)) >= buf_begin);
IM_ASSERT(((char*)(state->undo_rec + state->redo_point + 1) + move_size) <= buf_end);
- STB_TEXTEDIT_memmove(state->undo_rec + state->redo_point+1, state->undo_rec + state->redo_point, move_size);
+ IMSTB_TEXTEDIT_memmove(state->undo_rec + state->redo_point+1, state->undo_rec + state->redo_point, move_size);
// now move redo_point to point to the new one
++state->redo_point;
@@ -1183,32 +1205,32 @@ static StbUndoRecord *stb_text_create_undo_record(StbUndoState *state, int numch
// if we have no free records, we have to make room, by sliding the
// existing records down
- if (state->undo_point == STB_TEXTEDIT_UNDOSTATECOUNT)
+ if (state->undo_point == IMSTB_TEXTEDIT_UNDOSTATECOUNT)
stb_textedit_discard_undo(state);
// if the characters to store won't possibly fit in the buffer, we can't undo
- if (numchars > STB_TEXTEDIT_UNDOCHARCOUNT) {
+ if (numchars > IMSTB_TEXTEDIT_UNDOCHARCOUNT) {
state->undo_point = 0;
state->undo_char_point = 0;
return NULL;
}
// if we don't have enough free characters in the buffer, we have to make room
- while (state->undo_char_point + numchars > STB_TEXTEDIT_UNDOCHARCOUNT)
+ while (state->undo_char_point + numchars > IMSTB_TEXTEDIT_UNDOCHARCOUNT)
stb_textedit_discard_undo(state);
return &state->undo_rec[state->undo_point++];
}
-static STB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos, int insert_len, int delete_len)
+static IMSTB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos, int insert_len, int delete_len)
{
StbUndoRecord *r = stb_text_create_undo_record(state, insert_len);
if (r == NULL)
return NULL;
r->where = pos;
- r->insert_length = (STB_TEXTEDIT_POSITIONTYPE) insert_len;
- r->delete_length = (STB_TEXTEDIT_POSITIONTYPE) delete_len;
+ r->insert_length = (IMSTB_TEXTEDIT_POSITIONTYPE) insert_len;
+ r->delete_length = (IMSTB_TEXTEDIT_POSITIONTYPE) delete_len;
if (insert_len == 0) {
r->char_storage = -1;
@@ -1220,7 +1242,7 @@ static STB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos,
}
}
-static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
+static void stb_text_undo(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
StbUndoState *s = &state->undostate;
StbUndoRecord u, *r;
@@ -1247,7 +1269,7 @@ static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
// characters stored for *undoing* don't leave room for redo
// if the last is true, we have to bail
- if (s->undo_char_point + u.delete_length >= STB_TEXTEDIT_UNDOCHARCOUNT) {
+ if (s->undo_char_point + u.delete_length >= IMSTB_TEXTEDIT_UNDOCHARCOUNT) {
// the undo records take up too much character space; there's no space to store the redo characters
r->insert_length = 0;
} else {
@@ -1256,7 +1278,7 @@ static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
// there's definitely room to store the characters eventually
while (s->undo_char_point + u.delete_length > s->redo_char_point) {
// should never happen:
- if (s->redo_point == STB_TEXTEDIT_UNDOSTATECOUNT)
+ if (s->redo_point == IMSTB_TEXTEDIT_UNDOSTATECOUNT)
return;
// there's currently not enough room, so discard a redo record
stb_textedit_discard_redo(s);
@@ -1288,11 +1310,11 @@ static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
s->redo_point--;
}
-static void stb_text_redo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
+static void stb_text_redo(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
StbUndoState *s = &state->undostate;
StbUndoRecord *u, r;
- if (s->redo_point == STB_TEXTEDIT_UNDOSTATECOUNT)
+ if (s->redo_point == IMSTB_TEXTEDIT_UNDOSTATECOUNT)
return;
// we need to do two things: apply the redo record, and create an undo record
@@ -1344,20 +1366,20 @@ static void stb_text_makeundo_insert(STB_TexteditState *state, int where, int le
stb_text_createundo(&state->undostate, where, 0, length);
}
-static void stb_text_makeundo_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length)
+static void stb_text_makeundo_delete(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length)
{
int i;
- STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, length, 0);
+ IMSTB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, length, 0);
if (p) {
for (i=0; i < length; ++i)
p[i] = STB_TEXTEDIT_GETCHAR(str, where+i);
}
}
-static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length)
+static void stb_text_makeundo_replace(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length)
{
int i;
- STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, old_length, new_length);
+ IMSTB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, old_length, new_length);
if (p) {
for (i=0; i < old_length; ++i)
p[i] = STB_TEXTEDIT_GETCHAR(str, where+i);
@@ -1369,8 +1391,8 @@ static void stb_textedit_clear_state(STB_TexteditState *state, int is_single_lin
{
state->undostate.undo_point = 0;
state->undostate.undo_char_point = 0;
- state->undostate.redo_point = STB_TEXTEDIT_UNDOSTATECOUNT;
- state->undostate.redo_char_point = STB_TEXTEDIT_UNDOCHARCOUNT;
+ state->undostate.redo_point = IMSTB_TEXTEDIT_UNDOSTATECOUNT;
+ state->undostate.redo_char_point = IMSTB_TEXTEDIT_UNDOCHARCOUNT;
state->select_end = state->select_start = 0;
state->cursor = 0;
state->has_preferred_x = 0;
@@ -1393,16 +1415,16 @@ static void stb_textedit_initialize_state(STB_TexteditState *state, int is_singl
#pragma GCC diagnostic ignored "-Wcast-qual"
#endif
-static int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE const *ctext, int len)
+static int stb_textedit_paste(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, IMSTB_TEXTEDIT_CHARTYPE const *ctext, int len)
{
- return stb_textedit_paste_internal(str, state, (STB_TEXTEDIT_CHARTYPE *) ctext, len);
+ return stb_textedit_paste_internal(str, state, (IMSTB_TEXTEDIT_CHARTYPE *) ctext, len);
}
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
-#endif//STB_TEXTEDIT_IMPLEMENTATION
+#endif//IMSTB_TEXTEDIT_IMPLEMENTATION
/*
------------------------------------------------------------------------------
@@ -1410,38 +1432,38 @@ This software is available under 2 licenses -- choose whichever you prefer.
------------------------------------------------------------------------------
ALTERNATIVE A - MIT License
Copyright (c) 2017 Sean Barrett
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all
+The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
-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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
ALTERNATIVE B - Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
-Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
-software, either in source code form or as a compiled binary, for any purpose,
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
-In jurisdictions that recognize copyright laws, the author or authors of this
-software dedicate any and all copyright interest in the software to the public
-domain. We make this dedication for the benefit of the public at large and to
-the detriment of our heirs and successors. We intend this dedication to be an
-overt act of relinquishment in perpetuity of all present and future rights to
+In jurisdictions that recognize copyright laws, the author or authors of this
+software dedicate any and all copyright interest in the software to the public
+domain. We make this dedication for the benefit of the public at large and to
+the detriment of our heirs and successors. We intend this dedication to be an
+overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.
-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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF 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/3rdparty/bgfx/3rdparty/stb/stb_truetype.h b/3rdparty/bgfx/3rdparty/stb/stb_truetype.h
index 8696839559a..976f09cb927 100644
--- a/3rdparty/bgfx/3rdparty/stb/stb_truetype.h
+++ b/3rdparty/bgfx/3rdparty/stb/stb_truetype.h
@@ -1,5 +1,10 @@
-// stb_truetype.h - v1.24 - public domain
-// authored from 2009-2020 by Sean Barrett / RAD Game Tools
+// [DEAR IMGUI]
+// This is a slightly modified version of stb_truetype.h 1.26.
+// Mostly fixing for compiler and static analyzer warnings.
+// Grep for [DEAR IMGUI] to find the changes.
+
+// stb_truetype.h - v1.26 - public domain
+// authored from 2009-2021 by Sean Barrett / RAD Game Tools
//
// =======================================================================
//
@@ -53,11 +58,13 @@
// Johan Duparc Thomas Fields
// Hou Qiming Derek Vinyard
// Rob Loach Cort Stratton
-// Kenney Phillis Jr. Brian Costabile
-// Ken Voskuil (kaesve)
+// Kenney Phillis Jr. Brian Costabile
+// Ken Voskuil (kaesve)
//
// VERSION HISTORY
//
+// 1.26 (2021-08-28) fix broken rasterizer
+// 1.25 (2021-07-11) many fixes
// 1.24 (2020-02-05) fix warning
// 1.23 (2020-02-02) query SVG data for glyphs; query whole kerning table (but only kern not GPOS)
// 1.22 (2019-08-11) minimize missing-glyph duplication; fix kerning if both 'GPOS' and 'kern' are defined
@@ -270,8 +277,8 @@
//// SAMPLE PROGRAMS
////
//
-// Incomplete text-in-3d-api example, which draws quads properly aligned to be lossless
-//
+// Incomplete text-in-3d-api example, which draws quads properly aligned to be lossless.
+// See "tests/truetype_demo_win32.c" for a complete version.
#if 0
#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation
#include "stb_truetype.h"
@@ -297,6 +304,8 @@ void my_stbtt_initfont(void)
void my_stbtt_print(float x, float y, char *text)
{
// assume orthographic projection with units = screen pixels, origin at top left
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, ftex);
glBegin(GL_QUADS);
@@ -304,10 +313,10 @@ void my_stbtt_print(float x, float y, char *text)
if (*text >= 32 && *text < 128) {
stbtt_aligned_quad q;
stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl & d3d10+,0=d3d9
- glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y0);
- glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y0);
- glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y1);
- glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y1);
+ glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y0);
+ glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y0);
+ glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y1);
+ glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y1);
}
++text;
}
@@ -647,7 +656,7 @@ STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h
STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip);
// If skip != 0, this tells stb_truetype to skip any codepoints for which
// there is no corresponding glyph. If skip=0, which is the default, then
-// codepoints without a glyph recived the font's "missing character" glyph,
+// codepoints without a glyph received the font's "missing character" glyph,
// typically an empty box by convention.
STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above
@@ -853,6 +862,7 @@ STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, s
STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices);
// frees the data allocated above
+STBTT_DEF unsigned char *stbtt_FindSVGDoc(const stbtt_fontinfo *info, int gl);
STBTT_DEF int stbtt_GetCodepointSVG(const stbtt_fontinfo *info, int unicode_codepoint, const char **svg);
STBTT_DEF int stbtt_GetGlyphSVG(const stbtt_fontinfo *info, int gl, const char **svg);
// fills svg with the character's SVG data.
@@ -1539,12 +1549,12 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep
search += 2;
{
- stbtt_uint16 offset, start;
+ stbtt_uint16 offset, start, last;
stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1);
- STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item));
start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item);
- if (unicode_codepoint < start)
+ last = ttUSHORT(data + endCount + 2*item);
+ if (unicode_codepoint < start || unicode_codepoint > last)
return 0;
offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item);
@@ -1576,7 +1586,8 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep
}
return 0; // not found
}
-
+ // @TODO
+ STBTT_assert(0);
return 0;
}
@@ -1870,7 +1881,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s
if (comp_verts) STBTT_free(comp_verts, info->userdata);
return 0;
}
- if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex));
+ if (num_vertices > 0 && vertices) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex));
STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex));
if (vertices) STBTT_free(vertices, info->userdata);
vertices = tmp;
@@ -1997,7 +2008,7 @@ static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info, int gly
start = end;
}
}
- if (fdselector == -1) stbtt__new_buf(NULL, 0);
+ if (fdselector == -1) return stbtt__new_buf(NULL, 0); // [DEAR IMGUI] fixed, see #6007 and nothings/stb#1422
return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector));
}
@@ -2133,7 +2144,7 @@ static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, st
subrs = stbtt__cid_get_glyph_subrs(info, glyph_index);
has_subrs = 1;
}
- // fallthrough
+ // FALLTHROUGH
case 0x1D: // callgsubr
if (sp < 1) return STBTT__CSERR("call(g|)subr stack");
v = (int) s[--sp];
@@ -2238,7 +2249,7 @@ static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, st
} break;
default:
- if (b0 != 255 && b0 != 28 && (b0 < 32 || b0 > 254))
+ if (b0 != 255 && b0 != 28 && b0 < 32)
return STBTT__CSERR("reserved operator");
// push immediate
@@ -2350,7 +2361,7 @@ STBTT_DEF int stbtt_GetKerningTable(const stbtt_fontinfo *info, stbtt_kerningent
return length;
}
-static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2)
+static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2)
{
stbtt_uint8 *data = info->data + info->kern;
stbtt_uint32 needle, straw;
@@ -2380,243 +2391,225 @@ static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph
return 0;
}
-static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyph)
-{
- stbtt_uint16 coverageFormat = ttUSHORT(coverageTable);
- switch(coverageFormat) {
- case 1: {
- stbtt_uint16 glyphCount = ttUSHORT(coverageTable + 2);
-
- // Binary search.
- stbtt_int32 l=0, r=glyphCount-1, m;
- int straw, needle=glyph;
- while (l <= r) {
- stbtt_uint8 *glyphArray = coverageTable + 4;
- stbtt_uint16 glyphID;
- m = (l + r) >> 1;
- glyphID = ttUSHORT(glyphArray + 2 * m);
- straw = glyphID;
- if (needle < straw)
- r = m - 1;
- else if (needle > straw)
- l = m + 1;
- else {
- return m;
- }
+static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyph)
+{
+ stbtt_uint16 coverageFormat = ttUSHORT(coverageTable);
+ switch (coverageFormat) {
+ case 1: {
+ stbtt_uint16 glyphCount = ttUSHORT(coverageTable + 2);
+
+ // Binary search.
+ stbtt_int32 l=0, r=glyphCount-1, m;
+ int straw, needle=glyph;
+ while (l <= r) {
+ stbtt_uint8 *glyphArray = coverageTable + 4;
+ stbtt_uint16 glyphID;
+ m = (l + r) >> 1;
+ glyphID = ttUSHORT(glyphArray + 2 * m);
+ straw = glyphID;
+ if (needle < straw)
+ r = m - 1;
+ else if (needle > straw)
+ l = m + 1;
+ else {
+ return m;
}
- } break;
-
- case 2: {
- stbtt_uint16 rangeCount = ttUSHORT(coverageTable + 2);
- stbtt_uint8 *rangeArray = coverageTable + 4;
-
- // Binary search.
- stbtt_int32 l=0, r=rangeCount-1, m;
- int strawStart, strawEnd, needle=glyph;
- while (l <= r) {
- stbtt_uint8 *rangeRecord;
- m = (l + r) >> 1;
- rangeRecord = rangeArray + 6 * m;
- strawStart = ttUSHORT(rangeRecord);
- strawEnd = ttUSHORT(rangeRecord + 2);
- if (needle < strawStart)
- r = m - 1;
- else if (needle > strawEnd)
- l = m + 1;
- else {
- stbtt_uint16 startCoverageIndex = ttUSHORT(rangeRecord + 4);
- return startCoverageIndex + glyph - strawStart;
- }
+ }
+ break;
+ }
+
+ case 2: {
+ stbtt_uint16 rangeCount = ttUSHORT(coverageTable + 2);
+ stbtt_uint8 *rangeArray = coverageTable + 4;
+
+ // Binary search.
+ stbtt_int32 l=0, r=rangeCount-1, m;
+ int strawStart, strawEnd, needle=glyph;
+ while (l <= r) {
+ stbtt_uint8 *rangeRecord;
+ m = (l + r) >> 1;
+ rangeRecord = rangeArray + 6 * m;
+ strawStart = ttUSHORT(rangeRecord);
+ strawEnd = ttUSHORT(rangeRecord + 2);
+ if (needle < strawStart)
+ r = m - 1;
+ else if (needle > strawEnd)
+ l = m + 1;
+ else {
+ stbtt_uint16 startCoverageIndex = ttUSHORT(rangeRecord + 4);
+ return startCoverageIndex + glyph - strawStart;
}
- } break;
+ }
+ break;
+ }
- default: {
- // There are no other cases.
- STBTT_assert(0);
- } break;
- }
+ default: return -1; // unsupported
+ }
- return -1;
+ return -1;
}
static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph)
{
- stbtt_uint16 classDefFormat = ttUSHORT(classDefTable);
- switch(classDefFormat)
- {
- case 1: {
- stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2);
- stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4);
- stbtt_uint8 *classDef1ValueArray = classDefTable + 6;
-
- if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount)
- return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID));
-
- classDefTable = classDef1ValueArray + 2 * glyphCount;
- } break;
-
- case 2: {
- stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2);
- stbtt_uint8 *classRangeRecords = classDefTable + 4;
-
- // Binary search.
- stbtt_int32 l=0, r=classRangeCount-1, m;
- int strawStart, strawEnd, needle=glyph;
- while (l <= r) {
- stbtt_uint8 *classRangeRecord;
- m = (l + r) >> 1;
- classRangeRecord = classRangeRecords + 6 * m;
- strawStart = ttUSHORT(classRangeRecord);
- strawEnd = ttUSHORT(classRangeRecord + 2);
- if (needle < strawStart)
- r = m - 1;
- else if (needle > strawEnd)
- l = m + 1;
- else
- return (stbtt_int32)ttUSHORT(classRangeRecord + 4);
- }
+ stbtt_uint16 classDefFormat = ttUSHORT(classDefTable);
+ switch (classDefFormat)
+ {
+ case 1: {
+ stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2);
+ stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4);
+ stbtt_uint8 *classDef1ValueArray = classDefTable + 6;
+
+ if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount)
+ return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID));
+ break;
+ }
- classDefTable = classRangeRecords + 6 * classRangeCount;
- } break;
+ case 2: {
+ stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2);
+ stbtt_uint8 *classRangeRecords = classDefTable + 4;
+
+ // Binary search.
+ stbtt_int32 l=0, r=classRangeCount-1, m;
+ int strawStart, strawEnd, needle=glyph;
+ while (l <= r) {
+ stbtt_uint8 *classRangeRecord;
+ m = (l + r) >> 1;
+ classRangeRecord = classRangeRecords + 6 * m;
+ strawStart = ttUSHORT(classRangeRecord);
+ strawEnd = ttUSHORT(classRangeRecord + 2);
+ if (needle < strawStart)
+ r = m - 1;
+ else if (needle > strawEnd)
+ l = m + 1;
+ else
+ return (stbtt_int32)ttUSHORT(classRangeRecord + 4);
+ }
+ break;
+ }
- default: {
- // There are no other cases.
- STBTT_assert(0);
- } break;
- }
+ default:
+ return -1; // Unsupported definition type, return an error.
+ }
- return -1;
+ // "All glyphs not assigned to a class fall into class 0". (OpenType spec)
+ return 0;
}
// Define to STBTT_assert(x) if you want to break on unimplemented formats.
#define STBTT_GPOS_TODO_assert(x)
-static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2)
-{
- stbtt_uint16 lookupListOffset;
- stbtt_uint8 *lookupList;
- stbtt_uint16 lookupCount;
- stbtt_uint8 *data;
- stbtt_int32 i;
-
- if (!info->gpos) return 0;
-
- data = info->data + info->gpos;
-
- if (ttUSHORT(data+0) != 1) return 0; // Major version 1
- if (ttUSHORT(data+2) != 0) return 0; // Minor version 0
-
- lookupListOffset = ttUSHORT(data+8);
- lookupList = data + lookupListOffset;
- lookupCount = ttUSHORT(lookupList);
-
- for (i=0; i<lookupCount; ++i) {
- stbtt_uint16 lookupOffset = ttUSHORT(lookupList + 2 + 2 * i);
- stbtt_uint8 *lookupTable = lookupList + lookupOffset;
-
- stbtt_uint16 lookupType = ttUSHORT(lookupTable);
- stbtt_uint16 subTableCount = ttUSHORT(lookupTable + 4);
- stbtt_uint8 *subTableOffsets = lookupTable + 6;
- switch(lookupType) {
- case 2: { // Pair Adjustment Positioning Subtable
- stbtt_int32 sti;
- for (sti=0; sti<subTableCount; sti++) {
- stbtt_uint16 subtableOffset = ttUSHORT(subTableOffsets + 2 * sti);
- stbtt_uint8 *table = lookupTable + subtableOffset;
- stbtt_uint16 posFormat = ttUSHORT(table);
- stbtt_uint16 coverageOffset = ttUSHORT(table + 2);
- stbtt_int32 coverageIndex = stbtt__GetCoverageIndex(table + coverageOffset, glyph1);
- if (coverageIndex == -1) continue;
-
- switch (posFormat) {
- case 1: {
- stbtt_int32 l, r, m;
- int straw, needle;
- stbtt_uint16 valueFormat1 = ttUSHORT(table + 4);
- stbtt_uint16 valueFormat2 = ttUSHORT(table + 6);
- stbtt_int32 valueRecordPairSizeInBytes = 2;
- stbtt_uint16 pairSetCount = ttUSHORT(table + 8);
- stbtt_uint16 pairPosOffset = ttUSHORT(table + 10 + 2 * coverageIndex);
- stbtt_uint8 *pairValueTable = table + pairPosOffset;
- stbtt_uint16 pairValueCount = ttUSHORT(pairValueTable);
- stbtt_uint8 *pairValueArray = pairValueTable + 2;
- // TODO: Support more formats.
- STBTT_GPOS_TODO_assert(valueFormat1 == 4);
- if (valueFormat1 != 4) return 0;
- STBTT_GPOS_TODO_assert(valueFormat2 == 0);
- if (valueFormat2 != 0) return 0;
-
- STBTT_assert(coverageIndex < pairSetCount);
- STBTT__NOTUSED(pairSetCount);
-
- needle=glyph2;
- r=pairValueCount-1;
- l=0;
-
- // Binary search.
- while (l <= r) {
- stbtt_uint16 secondGlyph;
- stbtt_uint8 *pairValue;
- m = (l + r) >> 1;
- pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m;
- secondGlyph = ttUSHORT(pairValue);
- straw = secondGlyph;
- if (needle < straw)
- r = m - 1;
- else if (needle > straw)
- l = m + 1;
- else {
- stbtt_int16 xAdvance = ttSHORT(pairValue + 2);
- return xAdvance;
- }
- }
- } break;
-
- case 2: {
- stbtt_uint16 valueFormat1 = ttUSHORT(table + 4);
- stbtt_uint16 valueFormat2 = ttUSHORT(table + 6);
-
- stbtt_uint16 classDef1Offset = ttUSHORT(table + 8);
- stbtt_uint16 classDef2Offset = ttUSHORT(table + 10);
- int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1);
- int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2);
-
- stbtt_uint16 class1Count = ttUSHORT(table + 12);
- stbtt_uint16 class2Count = ttUSHORT(table + 14);
- STBTT_assert(glyph1class < class1Count);
- STBTT_assert(glyph2class < class2Count);
-
- // TODO: Support more formats.
- STBTT_GPOS_TODO_assert(valueFormat1 == 4);
- if (valueFormat1 != 4) return 0;
- STBTT_GPOS_TODO_assert(valueFormat2 == 0);
- if (valueFormat2 != 0) return 0;
-
- if (glyph1class >= 0 && glyph1class < class1Count && glyph2class >= 0 && glyph2class < class2Count) {
- stbtt_uint8 *class1Records = table + 16;
- stbtt_uint8 *class2Records = class1Records + 2 * (glyph1class * class2Count);
- stbtt_int16 xAdvance = ttSHORT(class2Records + 2 * glyph2class);
- return xAdvance;
- }
- } break;
-
- default: {
- // There are no other cases.
- STBTT_assert(0);
- break;
- };
- }
- }
- break;
- };
+static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2)
+{
+ stbtt_uint16 lookupListOffset;
+ stbtt_uint8 *lookupList;
+ stbtt_uint16 lookupCount;
+ stbtt_uint8 *data;
+ stbtt_int32 i, sti;
+
+ if (!info->gpos) return 0;
+
+ data = info->data + info->gpos;
+
+ if (ttUSHORT(data+0) != 1) return 0; // Major version 1
+ if (ttUSHORT(data+2) != 0) return 0; // Minor version 0
+
+ lookupListOffset = ttUSHORT(data+8);
+ lookupList = data + lookupListOffset;
+ lookupCount = ttUSHORT(lookupList);
+
+ for (i=0; i<lookupCount; ++i) {
+ stbtt_uint16 lookupOffset = ttUSHORT(lookupList + 2 + 2 * i);
+ stbtt_uint8 *lookupTable = lookupList + lookupOffset;
+
+ stbtt_uint16 lookupType = ttUSHORT(lookupTable);
+ stbtt_uint16 subTableCount = ttUSHORT(lookupTable + 4);
+ stbtt_uint8 *subTableOffsets = lookupTable + 6;
+ if (lookupType != 2) // Pair Adjustment Positioning Subtable
+ continue;
+
+ for (sti=0; sti<subTableCount; sti++) {
+ stbtt_uint16 subtableOffset = ttUSHORT(subTableOffsets + 2 * sti);
+ stbtt_uint8 *table = lookupTable + subtableOffset;
+ stbtt_uint16 posFormat = ttUSHORT(table);
+ stbtt_uint16 coverageOffset = ttUSHORT(table + 2);
+ stbtt_int32 coverageIndex = stbtt__GetCoverageIndex(table + coverageOffset, glyph1);
+ if (coverageIndex == -1) continue;
+
+ switch (posFormat) {
+ case 1: {
+ stbtt_int32 l, r, m;
+ int straw, needle;
+ stbtt_uint16 valueFormat1 = ttUSHORT(table + 4);
+ stbtt_uint16 valueFormat2 = ttUSHORT(table + 6);
+ if (valueFormat1 == 4 && valueFormat2 == 0) { // Support more formats?
+ stbtt_int32 valueRecordPairSizeInBytes = 2;
+ stbtt_uint16 pairSetCount = ttUSHORT(table + 8);
+ stbtt_uint16 pairPosOffset = ttUSHORT(table + 10 + 2 * coverageIndex);
+ stbtt_uint8 *pairValueTable = table + pairPosOffset;
+ stbtt_uint16 pairValueCount = ttUSHORT(pairValueTable);
+ stbtt_uint8 *pairValueArray = pairValueTable + 2;
+
+ if (coverageIndex >= pairSetCount) return 0;
+
+ needle=glyph2;
+ r=pairValueCount-1;
+ l=0;
+
+ // Binary search.
+ while (l <= r) {
+ stbtt_uint16 secondGlyph;
+ stbtt_uint8 *pairValue;
+ m = (l + r) >> 1;
+ pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m;
+ secondGlyph = ttUSHORT(pairValue);
+ straw = secondGlyph;
+ if (needle < straw)
+ r = m - 1;
+ else if (needle > straw)
+ l = m + 1;
+ else {
+ stbtt_int16 xAdvance = ttSHORT(pairValue + 2);
+ return xAdvance;
+ }
+ }
+ } else
+ return 0;
+ break;
+ }
+
+ case 2: {
+ stbtt_uint16 valueFormat1 = ttUSHORT(table + 4);
+ stbtt_uint16 valueFormat2 = ttUSHORT(table + 6);
+ if (valueFormat1 == 4 && valueFormat2 == 0) { // Support more formats?
+ stbtt_uint16 classDef1Offset = ttUSHORT(table + 8);
+ stbtt_uint16 classDef2Offset = ttUSHORT(table + 10);
+ int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1);
+ int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2);
+
+ stbtt_uint16 class1Count = ttUSHORT(table + 12);
+ stbtt_uint16 class2Count = ttUSHORT(table + 14);
+ stbtt_uint8 *class1Records, *class2Records;
+ stbtt_int16 xAdvance;
+
+ if (glyph1class < 0 || glyph1class >= class1Count) return 0; // malformed
+ if (glyph2class < 0 || glyph2class >= class2Count) return 0; // malformed
+
+ class1Records = table + 16;
+ class2Records = class1Records + 2 * (glyph1class * class2Count);
+ xAdvance = ttSHORT(class2Records + 2 * glyph2class);
+ return xAdvance;
+ } else
+ return 0;
+ break;
+ }
default:
- // TODO: Implement other stuff.
- break;
- }
- }
+ return 0; // Unsupported position format
+ }
+ }
+ }
- return 0;
+ return 0;
}
STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int g1, int g2)
@@ -3074,6 +3067,23 @@ static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edg
}
}
+static float stbtt__sized_trapezoid_area(float height, float top_width, float bottom_width)
+{
+ STBTT_assert(top_width >= 0);
+ STBTT_assert(bottom_width >= 0);
+ return (top_width + bottom_width) / 2.0f * height;
+}
+
+static float stbtt__position_trapezoid_area(float height, float tx0, float tx1, float bx0, float bx1)
+{
+ return stbtt__sized_trapezoid_area(height, tx1 - tx0, bx1 - bx0);
+}
+
+static float stbtt__sized_triangle_area(float height, float width)
+{
+ return height * width / 2;
+}
+
static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top)
{
float y_bottom = y_top+1;
@@ -3128,13 +3138,13 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill,
float height;
// simple case, only spans one pixel
int x = (int) x_top;
- height = sy1 - sy0;
+ height = (sy1 - sy0) * e->direction;
STBTT_assert(x >= 0 && x < len);
- scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height;
- scanline_fill[x] += e->direction * height; // everything right of this pixel is filled
+ scanline[x] += stbtt__position_trapezoid_area(height, x_top, x+1.0f, x_bottom, x+1.0f);
+ scanline_fill[x] += height; // everything right of this pixel is filled
} else {
int x,x1,x2;
- float y_crossing, step, sign, area;
+ float y_crossing, y_final, step, sign, area;
// covers 2+ pixels
if (x_top > x_bottom) {
// flip scanline vertically; signed area is the same
@@ -3147,29 +3157,82 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill,
dy = -dy;
t = x0, x0 = xb, xb = t;
}
+ STBTT_assert(dy >= 0);
+ STBTT_assert(dx >= 0);
x1 = (int) x_top;
x2 = (int) x_bottom;
// compute intersection with y axis at x1+1
- y_crossing = (x1+1 - x0) * dy + y_top;
+ y_crossing = y_top + dy * (x1+1 - x0);
+
+ // compute intersection with y axis at x2
+ y_final = y_top + dy * (x2 - x0);
+
+ // x1 x_top x2 x_bottom
+ // y_top +------|-----+------------+------------+--------|---+------------+
+ // | | | | | |
+ // | | | | | |
+ // sy0 | Txxxxx|............|............|............|............|
+ // y_crossing | *xxxxx.......|............|............|............|
+ // | | xxxxx..|............|............|............|
+ // | | /- xx*xxxx........|............|............|
+ // | | dy < | xxxxxx..|............|............|
+ // y_final | | \- | xx*xxx.........|............|
+ // sy1 | | | | xxxxxB...|............|
+ // | | | | | |
+ // | | | | | |
+ // y_bottom +------------+------------+------------+------------+------------+
+ //
+ // goal is to measure the area covered by '.' in each pixel
+
+ // if x2 is right at the right edge of x1, y_crossing can blow up, github #1057
+ // @TODO: maybe test against sy1 rather than y_bottom?
+ if (y_crossing > y_bottom)
+ y_crossing = y_bottom;
sign = e->direction;
- // area of the rectangle covered from y0..y_crossing
+
+ // area of the rectangle covered from sy0..y_crossing
area = sign * (y_crossing-sy0);
- // area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing)
- scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2);
- step = sign * dy;
+ // area of the triangle (x_top,sy0), (x1+1,sy0), (x1+1,y_crossing)
+ scanline[x1] += stbtt__sized_triangle_area(area, x1+1 - x_top);
+
+ // check if final y_crossing is blown up; no test case for this
+ if (y_final > y_bottom) {
+ int denom = (x2 - (x1+1));
+ y_final = y_bottom;
+ if (denom != 0) { // [DEAR IMGUI] Avoid div by zero (https://github.com/nothings/stb/issues/1316)
+ dy = (y_final - y_crossing ) / denom; // if denom=0, y_final = y_crossing, so y_final <= y_bottom
+ }
+ }
+
+ // in second pixel, area covered by line segment found in first pixel
+ // is always a rectangle 1 wide * the height of that line segment; this
+ // is exactly what the variable 'area' stores. it also gets a contribution
+ // from the line segment within it. the THIRD pixel will get the first
+ // pixel's rectangle contribution, the second pixel's rectangle contribution,
+ // and its own contribution. the 'own contribution' is the same in every pixel except
+ // the leftmost and rightmost, a trapezoid that slides down in each pixel.
+ // the second pixel's contribution to the third pixel will be the
+ // rectangle 1 wide times the height change in the second pixel, which is dy.
+
+ step = sign * dy * 1; // dy is dy/dx, change in y for every 1 change in x,
+ // which multiplied by 1-pixel-width is how much pixel area changes for each step in x
+ // so the area advances by 'step' every time
+
for (x = x1+1; x < x2; ++x) {
- scanline[x] += area + step/2;
+ scanline[x] += area + step/2; // area of trapezoid is 1*step/2
area += step;
}
- y_crossing += dy * (x2 - (x1+1));
-
- STBTT_assert(STBTT_fabs(area) <= 1.01f);
+ STBTT_assert(STBTT_fabs(area) <= 1.01f); // accumulated error from area += step unless we round step down
+ STBTT_assert(sy1 > y_final-0.01f);
- scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing);
+ // area covered in the last pixel is the rectangle from all the pixels to the left,
+ // plus the trapezoid filled by the line segment in this pixel all the way to the right edge
+ scanline[x2] += area + sign * stbtt__position_trapezoid_area(sy1-y_final, (float) x2, x2+1.0f, x_bottom, x2+1.0f);
+ // the rest of the line is filled based on the total height of the line segment in this pixel
scanline_fill[x2] += sign * (sy1-sy0);
}
} else {
@@ -3177,6 +3240,9 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill,
// clipping logic. since this does not match the intended use
// of this library, we use a different, very slow brute
// force implementation
+ // note though that this does happen some of the time because
+ // x_top and x_bottom can be extrapolated at the top & bottom of
+ // the shape and actually lie outside the bounding box
int x;
for (x=0; x < len; ++x) {
// cases:
@@ -4244,7 +4310,7 @@ STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect
STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges)
{
stbtt_fontinfo info;
- int i,j,n, return_value = 1;
+ int i, j, n, return_value; // [DEAR IMGUI] removed = 1;
//stbrp_context *context = (stbrp_context *) spc->pack_info;
stbrp_rect *rects;
@@ -4413,15 +4479,14 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex
float y_frac;
int winding = 0;
- orig[0] = x;
- orig[1] = y;
-
// make sure y never passes through a vertex of the shape
y_frac = (float) STBTT_fmod(y, 1.0f);
if (y_frac < 0.01f)
y += 0.01f;
else if (y_frac > 0.99f)
y -= 0.01f;
+
+ orig[0] = x;
orig[1] = y;
// test a ray from (-infinity,y) to (x,y)
@@ -4483,35 +4548,35 @@ static float stbtt__cuberoot( float x )
return (float) STBTT_pow( x,1.0f/3.0f);
}
-// x^3 + c*x^2 + b*x + a = 0
+// x^3 + a*x^2 + b*x + c = 0
static int stbtt__solve_cubic(float a, float b, float c, float* r)
{
- float s = -a / 3;
- float p = b - a*a / 3;
- float q = a * (2*a*a - 9*b) / 27 + c;
+ float s = -a / 3;
+ float p = b - a*a / 3;
+ float q = a * (2*a*a - 9*b) / 27 + c;
float p3 = p*p*p;
- float d = q*q + 4*p3 / 27;
- if (d >= 0) {
- float z = (float) STBTT_sqrt(d);
- float u = (-q + z) / 2;
- float v = (-q - z) / 2;
- u = stbtt__cuberoot(u);
- v = stbtt__cuberoot(v);
- r[0] = s + u + v;
- return 1;
- } else {
- float u = (float) STBTT_sqrt(-p/3);
- float v = (float) STBTT_acos(-STBTT_sqrt(-27/p3) * q / 2) / 3; // p3 must be negative, since d is negative
- float m = (float) STBTT_cos(v);
+ float d = q*q + 4*p3 / 27;
+ if (d >= 0) {
+ float z = (float) STBTT_sqrt(d);
+ float u = (-q + z) / 2;
+ float v = (-q - z) / 2;
+ u = stbtt__cuberoot(u);
+ v = stbtt__cuberoot(v);
+ r[0] = s + u + v;
+ return 1;
+ } else {
+ float u = (float) STBTT_sqrt(-p/3);
+ float v = (float) STBTT_acos(-STBTT_sqrt(-27/p3) * q / 2) / 3; // p3 must be negative, since d is negative
+ float m = (float) STBTT_cos(v);
float n = (float) STBTT_cos(v-3.141592/2)*1.732050808f;
- r[0] = s + u * 2 * m;
- r[1] = s - u * (m + n);
- r[2] = s - u * (m - n);
+ r[0] = s + u * 2 * m;
+ r[1] = s - u * (m + n);
+ r[2] = s - u * (m - n);
//STBTT_assert( STBTT_fabs(((r[0]+a)*r[0]+b)*r[0]+c) < 0.05f); // these asserts may not be safe at all scales, though they're in bezier t parameter units so maybe?
//STBTT_assert( STBTT_fabs(((r[1]+a)*r[1]+b)*r[1]+c) < 0.05f);
//STBTT_assert( STBTT_fabs(((r[2]+a)*r[2]+b)*r[2]+c) < 0.05f);
- return 3;
+ return 3;
}
}
@@ -4588,18 +4653,17 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc
for (i=0; i < num_verts; ++i) {
float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y;
- // check against every point here rather than inside line/curve primitives -- @TODO: wrong if multiple 'moves' in a row produce a garbage point, and given culling, probably more efficient to do within line/curve
- float dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy);
- if (dist2 < min_dist*min_dist)
- min_dist = (float) STBTT_sqrt(dist2);
-
- if (verts[i].type == STBTT_vline) {
+ if (verts[i].type == STBTT_vline && precompute[i] != 0.0f) {
float x1 = verts[i-1].x*scale_x, y1 = verts[i-1].y*scale_y;
+ float dist,dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy);
+ if (dist2 < min_dist*min_dist)
+ min_dist = (float) STBTT_sqrt(dist2);
+
// coarse culling against bbox
//if (sx > STBTT_min(x0,x1)-min_dist && sx < STBTT_max(x0,x1)+min_dist &&
// sy > STBTT_min(y0,y1)-min_dist && sy < STBTT_max(y0,y1)+min_dist)
- float dist = (float) STBTT_fabs((x1-x0)*(y0-sy) - (y1-y0)*(x0-sx)) * precompute[i];
+ dist = (float) STBTT_fabs((x1-x0)*(y0-sy) - (y1-y0)*(x0-sx)) * precompute[i];
STBTT_assert(i != 0);
if (dist < min_dist) {
// check position along line
@@ -4626,7 +4690,8 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc
float ax = x1-x0, ay = y1-y0;
float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2;
float mx = x0 - sx, my = y0 - sy;
- float res[3],px,py,t,it;
+ float res[3] = {0.f,0.f,0.f};
+ float px,py,t,it,dist2;
float a_inv = precompute[i];
if (a_inv == 0.0) { // if a_inv is 0, it's 2nd degree so use quadratic formula
float a = 3*(ax*bx + ay*by);
@@ -4653,6 +4718,10 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc
float d = (mx*ax+my*ay) * a_inv;
num = stbtt__solve_cubic(b, c, d, res);
}
+ dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy);
+ if (dist2 < min_dist*min_dist)
+ min_dist = (float) STBTT_sqrt(dist2);
+
if (num >= 1 && res[0] >= 0.0f && res[0] <= 1.0f) {
t = res[0], it = 1.0f - t;
px = it*it*x0 + 2*t*it*x1 + t*t*x2;
@@ -4912,6 +4981,12 @@ STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const
// FULL VERSION HISTORY
//
+// 1.25 (2021-07-11) many fixes
+// 1.24 (2020-02-05) fix warning
+// 1.23 (2020-02-02) query SVG data for glyphs; query whole kerning table (but only kern not GPOS)
+// 1.22 (2019-08-11) minimize missing-glyph duplication; fix kerning if both 'GPOS' and 'kern' are defined
+// 1.21 (2019-02-25) fix warning
+// 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics()
// 1.19 (2018-02-11) OpenType GPOS kerning (horizontal only), STBTT_fmod
// 1.18 (2018-01-29) add missing function
// 1.17 (2017-07-23) make more arguments const; doc fix
diff --git a/3rdparty/bgfx/examples/22-windows/windows.cpp b/3rdparty/bgfx/examples/22-windows/windows.cpp
index 54d8671bf76..da1742079a1 100644
--- a/3rdparty/bgfx/examples/22-windows/windows.cpp
+++ b/3rdparty/bgfx/examples/22-windows/windows.cpp
@@ -204,6 +204,20 @@ public:
m_fbh[viewId].idx = bgfx::kInvalidHandle;
}
+ // Before we reattach a SwapChain to the window
+ // we must actually free up the previous one.
+ // The DestroyFrameBuffer command goes in the
+ // cmdPost CommandBuffer, which happens after
+ // the frame. The CreateFrameBuffer command goes
+ // int the cmdPre CommandBuffer, which happens
+ // at the beginning of the frame. Without this
+ // bgfx::frame() call, the creation would happen
+ // before it's destroyed, which would cause
+ // the platform window to have two SwapChains
+ // associated with it.
+ // Ideally, we have an operation of ResizeFrameBuffer.
+ bgfx::frame();
+
win.m_nwh = m_state.m_nwh;
win.m_width = m_state.m_width;
win.m_height = m_state.m_height;
@@ -276,6 +290,7 @@ public:
int64_t now = bx::getHPCounter();
float time = (float)( (now-m_timeOffset)/double(bx::getHPFrequency() ) );
+ bgfx::dbgTextClear();
if (NULL != m_bindings)
{
bgfx::dbgTextPrintf(0, 1, 0x2f, "Press 'c' to create or 'd' to destroy window.");
diff --git a/3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp b/3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp
index 67c276c2e3c..8330b8afcf6 100644
--- a/3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp
+++ b/3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp
@@ -68,11 +68,15 @@ public:
static void remapIndices(uint32_t* _indices, uint32_t _num)
{
uint32_t target = 0;
- for (uint32_t i = 0; i < _num; i++) {
+ for (uint32_t i = 0; i < _num; i++)
+ {
uint32_t map = _indices[i];
- if (i != map) {
+ if (i != map)
+ {
_indices[i] = _indices[map];
- } else {
+ }
+ else
+ {
_indices[i] = target;
++target;
}
diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp
index 07621f3cd25..dc3e97488ea 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry.cpp
@@ -767,6 +767,7 @@ restart:
handle = size->m_handle;
_width = size->m_width;
_height = size->m_height;
+ BX_TRACE("Window resize event: %d: %dx%d", handle, _width, _height);
needReset = true;
}
@@ -800,6 +801,7 @@ restart:
&& needReset)
{
_reset = s_reset;
+ BX_TRACE("bgfx::reset(%d, %d, 0x%x)", _width, _height, _reset)
bgfx::reset(_width, _height, _reset);
inputSetMouseResolution(uint16_t(_width), uint16_t(_height) );
}
@@ -979,6 +981,7 @@ restart:
if (needReset)
{
_reset = s_reset;
+ BX_TRACE("bgfx::reset(%d, %d, 0x%x)", s_window[0].m_width, s_window[0].m_height, _reset)
bgfx::reset(s_window[0].m_width, s_window[0].m_height, _reset);
inputSetMouseResolution(uint16_t(s_window[0].m_width), uint16_t(s_window[0].m_height) );
}
diff --git a/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
index d27745d1390..4c699f23a5e 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
@@ -15,13 +15,9 @@
#endif // GLFW_VERSION_MINOR < 2
#if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
-# include <wayland-egl.h>
-# define GLFW_EXPOSE_NATIVE_WAYLAND
-# else
-# define GLFW_EXPOSE_NATIVE_X11
-# define GLFW_EXPOSE_NATIVE_GLX
-# endif
+# define GLFW_EXPOSE_NATIVE_WAYLAND
+# define GLFW_EXPOSE_NATIVE_X11
+# define GLFW_EXPOSE_NATIVE_GLX
#elif BX_PLATFORM_OSX
# define GLFW_EXPOSE_NATIVE_COCOA
# define GLFW_EXPOSE_NATIVE_NSGL
@@ -45,22 +41,14 @@ namespace entry
static void* glfwNativeWindowHandle(GLFWwindow* _window)
{
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- wl_egl_window *win_impl = (wl_egl_window*)glfwGetWindowUserPointer(_window);
- if(!win_impl)
+ if (glfwGetPlatform() == GLFW_PLATFORM_WAYLAND)
+ {
+ return glfwGetWaylandWindow(_window);
+ }
+ else
{
- int width, height;
- glfwGetWindowSize(_window, &width, &height);
- struct wl_surface* surface = (struct wl_surface*)glfwGetWaylandWindow(_window);
- if(!surface)
- return nullptr;
- win_impl = wl_egl_window_create(surface, width, height);
- glfwSetWindowUserPointer(_window, (void*)(uintptr_t)win_impl);
+ return (void*)(uintptr_t)glfwGetX11Window(_window);
}
- return (void*)(uintptr_t)win_impl;
-# else
- return (void*)(uintptr_t)glfwGetX11Window(_window);
-# endif
# elif BX_PLATFORM_OSX
return glfwGetCocoaWindow(_window);
# elif BX_PLATFORM_WINDOWS
@@ -68,23 +56,6 @@ namespace entry
# endif // BX_PLATFORM_
}
- static void glfwDestroyWindowImpl(GLFWwindow *_window)
- {
- if(!_window)
- return;
-# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- wl_egl_window *win_impl = (wl_egl_window*)glfwGetWindowUserPointer(_window);
- if(win_impl)
- {
- glfwSetWindowUserPointer(_window, nullptr);
- wl_egl_window_destroy(win_impl);
- }
-# endif
-# endif
- glfwDestroyWindow(_window);
- }
-
static uint8_t translateKeyModifiers(int _glfw)
{
uint8_t modifiers = 0;
@@ -525,7 +496,7 @@ namespace entry
{
GLFWwindow* window = m_window[msg->m_handle.idx];
m_eventQueue.postWindowEvent(msg->m_handle);
- glfwDestroyWindowImpl(window);
+ glfwDestroyWindow(window);
m_window[msg->m_handle.idx] = NULL;
}
}
@@ -617,7 +588,7 @@ namespace entry
m_eventQueue.postExitEvent();
m_thread.shutdown();
- glfwDestroyWindowImpl(m_window[0]);
+ glfwDestroyWindow(m_window[0]);
glfwTerminate();
return m_thread.getExitCode();
@@ -865,11 +836,14 @@ namespace entry
void* getNativeDisplayHandle()
{
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- return glfwGetWaylandDisplay();
-# else
- return glfwGetX11Display();
-# endif // ENTRY_CONFIG_USE_WAYLAND
+ if (glfwGetPlatform() == GLFW_PLATFORM_WAYLAND)
+ {
+ return glfwGetWaylandDisplay();
+ }
+ else
+ {
+ return glfwGetX11Display();
+ }
# else
return NULL;
# endif // BX_PLATFORM_*
@@ -878,11 +852,14 @@ namespace entry
bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle)
{
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- return bgfx::NativeWindowHandleType::Wayland;
-# else
- return bgfx::NativeWindowHandleType::Default;
-# endif // ENTRY_CONFIG_USE_WAYLAND
+ if (glfwGetPlatform() == GLFW_PLATFORM_WAYLAND)
+ {
+ return bgfx::NativeWindowHandleType::Wayland;
+ }
+ else
+ {
+ return bgfx::NativeWindowHandleType::Default;
+ }
# else
return bgfx::NativeWindowHandleType::Default;
# endif // BX_PLATFORM_*
diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h
index 59307c2f040..3c01e3459c8 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_p.h
+++ b/3rdparty/bgfx/examples/common/entry/entry_p.h
@@ -25,10 +25,6 @@
# define ENTRY_CONFIG_USE_GLFW 0
#endif // ENTRY_CONFIG_USE_GLFW
-#ifndef ENTRY_CONFIG_USE_WAYLAND
-# define ENTRY_CONFIG_USE_WAYLAND 0
-#endif // ENTRY_CONFIG_USE_WAYLAND
-
#if !defined(ENTRY_CONFIG_USE_NATIVE) \
&& !ENTRY_CONFIG_USE_NOOP \
&& !ENTRY_CONFIG_USE_SDL \
diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
index 5a862c0ca05..bbcdb069257 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
@@ -8,9 +8,6 @@
#if ENTRY_CONFIG_USE_SDL
#if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
-# include <wayland-egl.h>
-# endif
#elif BX_PLATFORM_WINDOWS
# define SDL_MAIN_HANDLED
#endif
@@ -49,25 +46,14 @@ namespace entry
}
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- if (wmi.subsystem == SDL_SYSWM_WAYLAND)
- {
- wl_egl_window *win_impl = (wl_egl_window*)SDL_GetWindowData(_window, "wl_egl_window");
- if(!win_impl)
- {
- int width, height;
- SDL_GetWindowSize(_window, &width, &height);
- struct wl_surface* surface = wmi.info.wl.surface;
- if(!surface)
- return nullptr;
- win_impl = wl_egl_window_create(surface, width, height);
- SDL_SetWindowData(_window, "wl_egl_window", win_impl);
- }
- return (void*)(uintptr_t)win_impl;
- }
- else
-# endif // ENTRY_CONFIG_USE_WAYLAND
- return (void*)wmi.info.x11.window;
+ if (wmi.subsystem == SDL_SYSWM_WAYLAND)
+ {
+ return (void*)wmi.info.wl.surface;
+ }
+ else
+ {
+ return (void*)wmi.info.x11.window;
+ }
# elif BX_PLATFORM_OSX || BX_PLATFORM_IOS
return wmi.info.cocoa.window;
# elif BX_PLATFORM_WINDOWS
@@ -77,23 +63,6 @@ namespace entry
# endif // BX_PLATFORM_
}
- static void sdlDestroyWindow(SDL_Window* _window)
- {
- if(!_window)
- return;
-# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- wl_egl_window *win_impl = (wl_egl_window*)SDL_GetWindowData(_window, "wl_egl_window");
- if(win_impl)
- {
- SDL_SetWindowData(_window, "wl_egl_window", nullptr);
- wl_egl_window_destroy(win_impl);
- }
-# endif
-# endif
- SDL_DestroyWindow(_window);
- }
-
static uint8_t translateKeyModifiers(uint16_t _sdl)
{
uint8_t modifiers = 0;
@@ -493,7 +462,7 @@ namespace entry
// Force window resolution...
WindowHandle defaultWindow = { 0 };
- setWindowSize(defaultWindow, m_width, m_height, true);
+ entry::setWindowSize(defaultWindow, m_width, m_height);
SDL_EventState(SDL_DROPFILE, SDL_ENABLE);
@@ -671,7 +640,15 @@ namespace entry
case SDL_WINDOWEVENT_SIZE_CHANGED:
{
WindowHandle handle = findHandle(wev.windowID);
- setWindowSize(handle, wev.data1, wev.data2);
+ uint32_t width = wev.data1;
+ uint32_t height = wev.data2;
+ if (width != m_width
+ || height != m_height)
+ {
+ m_width = width;
+ m_height = height;
+ m_eventQueue.postSizeEvent(handle, m_width, m_height);
+ }
}
break;
@@ -865,7 +842,7 @@ namespace entry
if (isValid(handle) )
{
m_eventQueue.postWindowEvent(handle);
- sdlDestroyWindow(m_window[handle.idx]);
+ SDL_DestroyWindow(m_window[handle.idx]);
m_window[handle.idx] = NULL;
}
}
@@ -916,7 +893,7 @@ namespace entry
Msg* msg = (Msg*)uev.data2;
if (isValid(handle) )
{
- setWindowSize(handle, msg->m_width, msg->m_height);
+ SDL_SetWindowSize(m_window[handle.idx], msg->m_width, msg->m_height);
}
delete msg;
}
@@ -959,7 +936,7 @@ namespace entry
while (bgfx::RenderFrame::NoContext != bgfx::renderFrame() ) {};
m_thread.shutdown();
- sdlDestroyWindow(m_window[0]);
+ SDL_DestroyWindow(m_window[0]);
SDL_Quit();
return m_thread.getExitCode();
@@ -988,20 +965,6 @@ namespace entry
return invalid;
}
- void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height, bool _force = false)
- {
- if (_width != m_width
- || _height != m_height
- || _force)
- {
- m_width = _width;
- m_height = _height;
-
- SDL_SetWindowSize(m_window[_handle.idx], m_width, m_height);
- m_eventQueue.postSizeEvent(_handle, m_width, m_height);
- }
- }
-
GamepadHandle findGamepad(SDL_JoystickID _jid)
{
for (uint32_t ii = 0, num = m_gamepadAlloc.getNumHandles(); ii < num; ++ii)
@@ -1102,6 +1065,7 @@ namespace entry
void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height)
{
+ // Function to set the window size programmatically from the examples/tools.
Msg* msg = new Msg;
msg->m_width = _width;
msg->m_height = _height;
@@ -1149,12 +1113,10 @@ namespace entry
return NULL;
}
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- if (wmi.subsystem == SDL_SYSWM_WAYLAND)
- return wmi.info.wl.display;
- else
-# endif // ENTRY_CONFIG_USE_WAYLAND
- return wmi.info.x11.display;
+ if (wmi.subsystem == SDL_SYSWM_WAYLAND)
+ return wmi.info.wl.display;
+ else
+ return wmi.info.x11.display;
# else
return NULL;
# endif // BX_PLATFORM_*
@@ -1169,11 +1131,9 @@ namespace entry
return bgfx::NativeWindowHandleType::Default;
}
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
if (wmi.subsystem == SDL_SYSWM_WAYLAND)
return bgfx::NativeWindowHandleType::Wayland;
else
-# endif // ENTRY_CONFIG_USE_WAYLAND
return bgfx::NativeWindowHandleType::Default;
# else
return bgfx::NativeWindowHandleType::Default;
diff --git a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
index 754039a6db7..e731977737e 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
@@ -851,14 +851,18 @@ namespace entry
if (utf16[0] >= 0xD800 && utf16[0] <= 0xDBFF) {
m_surrogate = utf16[0];
- } else {
+ }
+ else
+ {
int utf16_len;
if (utf16[0] >= 0xDC00 && utf16[0] <= 0xDFFF) {
utf16[1] = utf16[0];
utf16[0] = m_surrogate;
m_surrogate = 0;
utf16_len = 2;
- } else {
+ }
+ else
+ {
utf16_len = 1;
}
diff --git a/3rdparty/bgfx/examples/common/example-glue.cpp b/3rdparty/bgfx/examples/common/example-glue.cpp
index 74ff3719f18..3c51db6ee0f 100644
--- a/3rdparty/bgfx/examples/common/example-glue.cpp
+++ b/3rdparty/bgfx/examples/common/example-glue.cpp
@@ -290,6 +290,8 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
}
}
}
+#else
+ ImGui::Text("Renderer: %s", bgfx::getRendererName(bgfx::getRendererType()));
#endif // 0
const bgfx::Stats* stats = bgfx::getStats();
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc b/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc
index f07729cb94c..0b9c9828b2c 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc
+++ b/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc
@@ -7,5 +7,5 @@ SAMPLER2D(s_tex, 0);
void main()
{
vec4 texel = texture2D(s_tex, v_texcoord0);
- gl_FragColor = texel * v_color0;
+ gl_FragColor = texel * v_color0;
}
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
index 951c118ed76..d553d9d43e1 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
@@ -14,12 +14,14 @@
#include "imgui.h"
#include "../bgfx_utils.h"
-//#define USE_ENTRY 1
-
#ifndef USE_ENTRY
# define USE_ENTRY 0
#endif // USE_ENTRY
+#ifndef USE_LOCAL_STB
+# define USE_LOCAL_STB 1
+#endif // USE_LOCAL_STB
+
#if USE_ENTRY
# include "../entry/entry.h"
# include "../entry/input.h"
@@ -66,10 +68,13 @@ struct OcornutImguiContext
void render(ImDrawData* _drawData)
{
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
- int fb_width = (int)(_drawData->DisplaySize.x * _drawData->FramebufferScale.x);
- int fb_height = (int)(_drawData->DisplaySize.y * _drawData->FramebufferScale.y);
- if (fb_width <= 0 || fb_height <= 0)
+ int32_t dispWidth = int32_t(_drawData->DisplaySize.x * _drawData->FramebufferScale.x);
+ int32_t dispHeight = int32_t(_drawData->DisplaySize.y * _drawData->FramebufferScale.y);
+ if (dispWidth <= 0
+ || dispHeight <= 0)
+ {
return;
+ }
bgfx::setViewName(m_viewId, "ImGui");
bgfx::setViewMode(m_viewId, bgfx::ViewMode::Sequential);
@@ -134,14 +139,16 @@ struct OcornutImguiContext
bgfx::TextureHandle th = m_texture;
bgfx::ProgramHandle program = m_program;
- if (NULL != cmd->TextureId)
+ if (ImU64(0) != cmd->TextureId)
{
union { ImTextureID ptr; struct { bgfx::TextureHandle handle; uint8_t flags; uint8_t mip; } s; } texture = { cmd->TextureId };
+
state |= 0 != (IMGUI_FLAGS_ALPHA_BLEND & texture.s.flags)
? BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
: BGFX_STATE_NONE
;
th = texture.s.handle;
+
if (0 != texture.s.mip)
{
const float lodEnabled[4] = { float(texture.s.mip), 1.0f, 0.0f, 0.0f };
@@ -161,8 +168,8 @@ struct OcornutImguiContext
clipRect.z = (cmd->ClipRect.z - clipPos.x) * clipScale.x;
clipRect.w = (cmd->ClipRect.w - clipPos.y) * clipScale.y;
- if (clipRect.x < fb_width
- && clipRect.y < fb_height
+ if (clipRect.x < dispWidth
+ && clipRect.y < dispHeight
&& clipRect.z >= 0.0f
&& clipRect.w >= 0.0f)
{
@@ -188,6 +195,8 @@ struct OcornutImguiContext
void create(float _fontSize, bx::AllocatorI* _allocator)
{
+ IMGUI_CHECKVERSION();
+
m_allocator = _allocator;
if (NULL == _allocator)
@@ -462,12 +471,13 @@ struct OcornutImguiContext
m_lastScroll = _scroll;
#if USE_ENTRY
- uint8_t modifiers = inputGetModifiersState();
- io.AddKeyEvent(ImGuiKey_ModShift, 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) ) );
- io.AddKeyEvent(ImGuiKey_ModCtrl, 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) ) );
- io.AddKeyEvent(ImGuiKey_ModAlt, 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) ) );
- io.AddKeyEvent(ImGuiKey_ModSuper, 0 != (modifiers & (entry::Modifier::LeftMeta | entry::Modifier::RightMeta ) ) );
- for (int32_t ii = 0; ii < (int32_t)entry::Key::Count; ++ii)
+ const uint8_t modifiers = inputGetModifiersState();
+ io.AddKeyEvent(ImGuiMod_Shift, 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) ) );
+ io.AddKeyEvent(ImGuiMod_Ctrl, 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) ) );
+ io.AddKeyEvent(ImGuiMod_Alt, 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) ) );
+ io.AddKeyEvent(ImGuiMod_Super, 0 != (modifiers & (entry::Modifier::LeftMeta | entry::Modifier::RightMeta ) ) );
+
+ for (int32_t ii = 0; ii < int32_t(entry::Key::Count); ++ii)
{
io.AddKeyEvent(m_keyMap[ii], inputGetKeyState(entry::Key::Enum(ii) ) );
io.SetKeyEventNativeData(m_keyMap[ii], 0, 0, ii);
@@ -559,15 +569,29 @@ namespace ImGui
} // namespace ImGui
+#if USE_LOCAL_STB
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4505); // error C4505: '' : unreferenced local function has been removed
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wunused-function"); // warning: 'int rect_width_compare(const void*, const void*)' defined but not used
-BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunknown-pragmas")
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wtype-limits"); // warning: comparison is always true due to limited range of data type
-#define STBTT_malloc(_size, _userData) memAlloc(_size, _userData)
-#define STBTT_free(_ptr, _userData) memFree(_ptr, _userData)
-#define STB_RECT_PACK_IMPLEMENTATION
-#include <stb/stb_rect_pack.h>
-#define STB_TRUETYPE_IMPLEMENTATION
-#include <stb/stb_truetype.h>
-BX_PRAGMA_DIAGNOSTIC_POP();
+
+# define STBTT_ifloor(_a) int32_t(bx::floor(_a) )
+# define STBTT_iceil(_a) int32_t(bx::ceil(_a) )
+# define STBTT_sqrt(_a) bx::sqrt(_a)
+# define STBTT_pow(_a, _b) bx::pow(_a, _b)
+# define STBTT_fmod(_a, _b) bx::mod(_a, _b)
+# define STBTT_cos(_a) bx::cos(_a)
+# define STBTT_acos(_a) bx::acos(_a)
+# define STBTT_fabs(_a) bx::abs(_a)
+# define STBTT_strlen(_str) bx::strLen(_str)
+
+# define STBTT_memcpy(_dst, _src, _numBytes) bx::memCopy(_dst, _src, _numBytes)
+# define STBTT_memset(_dst, _ch, _numBytes) bx::memSet(_dst, _ch, _numBytes)
+# define STBTT_malloc(_size, _userData) memAlloc(_size, _userData)
+# define STBTT_free(_ptr, _userData) memFree(_ptr, _userData)
+
+# define STB_RECT_PACK_IMPLEMENTATION
+# include <stb/stb_rect_pack.h>
+# define STB_TRUETYPE_IMPLEMENTATION
+# include <stb/stb_truetype.h>
+#endif // USE_LOCAL_STB
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.h b/3rdparty/bgfx/examples/common/imgui/imgui.h
index 98072777530..81e9ec49854 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.h
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2025 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
@@ -62,7 +62,7 @@ namespace ImGui
, const ImVec4& _borderCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
)
{
- Image(toId(_handle, _flags, _mip), _size, _uv0, _uv1, _tintCol, _borderCol);
+ ImageWithBg(toId(_handle, _flags, _mip), _size, _uv0, _uv1, _tintCol, _borderCol);
}
// Helper function for passing bgfx::TextureHandle to ImGui::Image.
diff --git a/3rdparty/bgfx/examples/common/imgui/makefile b/3rdparty/bgfx/examples/common/imgui/makefile
index 1979d957d9e..7b26cb84a85 100644
--- a/3rdparty/bgfx/examples/common/imgui/makefile
+++ b/3rdparty/bgfx/examples/common/imgui/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2025 Branimir Karadzic. All rights reserved.
# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
diff --git a/3rdparty/bgfx/scripts/example-common.lua b/3rdparty/bgfx/scripts/example-common.lua
index c6ddb81fd6c..6dbddd670ec 100644
--- a/3rdparty/bgfx/scripts/example-common.lua
+++ b/3rdparty/bgfx/scripts/example-common.lua
@@ -75,12 +75,6 @@ project ("example-common")
}
end
- if _OPTIONS["with-wayland"] then
- defines {
- "ENTRY_CONFIG_USE_WAYLAND=1",
- }
- end
-
configuration { "android-*" }
includedirs {
path.join(BGFX_DIR, "3rdparty/native_app_glue")
diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua
index 645ed3a21be..d3f4047cd93 100644
--- a/3rdparty/bgfx/scripts/genie.lua
+++ b/3rdparty/bgfx/scripts/genie.lua
@@ -21,11 +21,6 @@ newoption {
}
newoption {
- trigger = "with-wayland",
- description = "Use Wayland backend.",
-}
-
-newoption {
trigger = "with-profiler",
description = "Enable build with intrusive profiler.",
}
@@ -204,10 +199,6 @@ end
function copyLib()
end
-if _OPTIONS["with-wayland"] then
- defines { "WL_EGL_PLATFORM=1" }
-end
-
if _OPTIONS["with-sdl"] then
if os.is("windows") then
if not os.getenv("SDL2_DIR") then
@@ -256,13 +247,6 @@ function exampleProjectDefaults()
defines { "ENTRY_CONFIG_USE_SDL=1" }
links { "SDL2" }
- configuration { "linux or freebsd" }
- if _OPTIONS["with-wayland"] then
- links {
- "wayland-egl",
- }
- end
-
configuration { "osx*" }
libdirs { "$(SDL2_DIR)/lib" }
@@ -273,21 +257,6 @@ function exampleProjectDefaults()
defines { "ENTRY_CONFIG_USE_GLFW=1" }
links { "glfw3" }
- configuration { "linux or freebsd" }
- if _OPTIONS["with-wayland"] then
- links {
- "wayland-egl",
- }
- else
- links {
- "Xrandr",
- "Xinerama",
- "Xi",
- "Xxf86vm",
- "Xcursor",
- }
- end
-
configuration { "osx*" }
linkoptions {
"-framework CoreVideo",
diff --git a/3rdparty/bgfx/scripts/geometryv.lua b/3rdparty/bgfx/scripts/geometryv.lua
index e403d582179..054daf7af0d 100644
--- a/3rdparty/bgfx/scripts/geometryv.lua
+++ b/3rdparty/bgfx/scripts/geometryv.lua
@@ -30,13 +30,6 @@ project ("geometryv")
defines { "ENTRY_CONFIG_USE_SDL=1" }
links { "SDL2" }
- configuration { "linux or freebsd" }
- if _OPTIONS["with-wayland"] then
- links {
- "wayland-egl",
- }
- end
-
configuration { "x32", "windows" }
libdirs { "$(SDL2_DIR)/lib/x86" }
@@ -50,15 +43,6 @@ project ("geometryv")
defines { "ENTRY_CONFIG_USE_GLFW=1" }
links { "glfw3" }
- configuration { "linux or freebsd" }
- links {
- "Xrandr",
- "Xinerama",
- "Xi",
- "Xxf86vm",
- "Xcursor",
- }
-
configuration { "osx*" }
linkoptions {
"-framework CoreVideo",
diff --git a/3rdparty/bgfx/scripts/texturev.lua b/3rdparty/bgfx/scripts/texturev.lua
index d5bb9e2f08a..80f7dc4e814 100644
--- a/3rdparty/bgfx/scripts/texturev.lua
+++ b/3rdparty/bgfx/scripts/texturev.lua
@@ -30,13 +30,6 @@ project ("texturev")
defines { "ENTRY_CONFIG_USE_SDL=1" }
links { "SDL2" }
- configuration { "linux or freebsd" }
- if _OPTIONS["with-wayland"] then
- links {
- "wayland-egl",
- }
- end
-
configuration { "x32", "windows" }
libdirs { "$(SDL2_DIR)/lib/x86" }
@@ -50,15 +43,6 @@ project ("texturev")
defines { "ENTRY_CONFIG_USE_GLFW=1" }
links { "glfw3" }
- configuration { "linux or freebsd" }
- links {
- "Xrandr",
- "Xinerama",
- "Xi",
- "Xxf86vm",
- "Xcursor",
- }
-
configuration { "osx*" }
linkoptions {
"-framework CoreVideo",
diff --git a/3rdparty/bgfx/src/glcontext_egl.cpp b/3rdparty/bgfx/src/glcontext_egl.cpp
index 54e0230b778..85de92e1df5 100644
--- a/3rdparty/bgfx/src/glcontext_egl.cpp
+++ b/3rdparty/bgfx/src/glcontext_egl.cpp
@@ -111,6 +111,43 @@ EGL_IMPORT
}
#endif // BGFX_USE_GL_DYNAMIC_LIB
+
+#if BX_PLATFORM_LINUX
+# define WL_EGL_IMPORT \
+ WL_EGL_FUNC(struct wl_egl_window *, wl_egl_window_create, (struct wl_surface *, int, int) ) \
+ WL_EGL_FUNC(void, wl_egl_window_destroy, (struct wl_egl_window *)) \
+ WL_EGL_FUNC(void, wl_egl_window_resize, (struct wl_egl_window *, int, int, int, int)) \
+ WL_EGL_FUNC(void, wl_egl_window_get_attached_size, (struct wl_egl_window *, int *, int *) ) \
+
+# define WL_EGL_FUNC(rt, fname, params) \
+ typedef rt(*PFNWLEGL_##fname) params; \
+ PFNWLEGL_##fname BGFX_WAYLAND_##fname;
+
+WL_EGL_IMPORT
+# undef WL_EGL_FUNC
+
+ void* waylandEglOpen()
+ {
+ void* handle = bx::dlopen("libwayland-egl.so.1");
+ BGFX_FATAL(handle != NULL, Fatal::UnableToInitialize, "Could not dlopen() libwayland-egl.so.1");
+
+# define WL_EGL_FUNC(rt, fname, params) BGFX_WAYLAND_##fname = (PFNWLEGL_##fname) bx::dlsym(handle, #fname);
+ WL_EGL_IMPORT
+# undef WL_EGL_FUNC
+
+ return handle;
+ }
+
+ void waylandEglClose(void* _handle)
+ {
+ bx::dlclose(_handle);
+
+# define WL_EGL_FUNC(rt, fname, params) BGFX_WAYLAND_##fname = NULL;
+ WL_EGL_IMPORT
+# undef WL_EGL_FUNC
+ }
+#endif // BX_PLATFORM_LINUX
+
# define GL_IMPORT(_optional, _proto, _func, _import) _proto _func = NULL
# include "glimports.h"
@@ -118,18 +155,32 @@ EGL_IMPORT
struct SwapChainGL
{
- SwapChainGL(EGLDisplay _display, EGLConfig _config, EGLContext _context, EGLNativeWindowType _nwh)
+ SwapChainGL(EGLDisplay _display, EGLConfig _config, EGLContext _context, EGLNativeWindowType _nwh, int _width, int _height)
: m_nwh(_nwh)
, m_display(_display)
+# if BX_PLATFORM_LINUX
+ , m_eglWindow(NULL)
+# endif
{
EGLSurface defaultSurface = eglGetCurrentSurface(EGL_DRAW);
+ BX_UNUSED(_width, _height);
+
if (EGLNativeWindowType(0) == _nwh)
{
m_surface = eglCreatePbufferSurface(m_display, _config, NULL);
}
else
{
+# if BX_PLATFORM_LINUX
+ if (g_platformData.type == NativeWindowHandleType::Wayland)
+ {
+ // A wl_surface needs to be first wrapped in a wl_egl_window
+ // before it can be used to create the EGLSurface.
+ m_eglWindow = BGFX_WAYLAND_wl_egl_window_create( (wl_surface*)_nwh, _width, _height);
+ _nwh = (EGLNativeWindowType) m_eglWindow;
+ }
+# endif
m_surface = eglCreateWindowSurface(m_display, _config, _nwh, NULL);
}
@@ -157,6 +208,12 @@ EGL_IMPORT
eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(m_display, m_context);
eglDestroySurface(m_display, m_surface);
+# if BX_PLATFORM_LINUX
+ if (m_eglWindow)
+ {
+ BGFX_WAYLAND_wl_egl_window_destroy(m_eglWindow);
+ }
+# endif
eglMakeCurrent(m_display, defaultSurface, defaultSurface, defaultContext);
}
@@ -174,6 +231,9 @@ EGL_IMPORT
EGLContext m_context;
EGLDisplay m_display;
EGLSurface m_surface;
+# if BX_PLATFORM_LINUX
+ wl_egl_window *m_eglWindow;
+# endif
};
# if BX_PLATFORM_RPI
@@ -188,7 +248,7 @@ EGL_IMPORT
bcm_host_init();
# endif // BX_PLATFORM_RPI
- m_eglLibrary = eglOpen();
+ m_eglDll = eglOpen();
if (NULL == g_platformData.context)
{
@@ -207,7 +267,7 @@ EGL_IMPORT
}
# endif // BX_PLATFORM_WINDOWS
- m_display = eglGetDisplay(NULL == ndt ? EGL_DEFAULT_DISPLAY : ndt);
+ m_display = eglGetDisplay(NULL == ndt ? EGL_DEFAULT_DISPLAY : ndt);
BGFX_FATAL(m_display != EGL_NO_DISPLAY, Fatal::UnableToInitialize, "Failed to create display %p", m_display);
EGLint major = 0;
@@ -316,6 +376,12 @@ EGL_IMPORT
vc_dispmanx_update_submit_sync(dispmanUpdate);
# endif // BX_PLATFORM_ANDROID
+# if BX_PLATFORM_LINUX
+ if (g_platformData.type == NativeWindowHandleType::Wayland)
+ {
+ m_waylandEglDll = waylandEglOpen();
+ }
+# endif
if (headless)
{
EGLint pbAttribs[] =
@@ -330,6 +396,15 @@ EGL_IMPORT
}
else
{
+# if BX_PLATFORM_LINUX
+ if (g_platformData.type == NativeWindowHandleType::Wayland)
+ {
+ // A wl_surface needs to be first wrapped in a wl_egl_window
+ // before it can be used to create the EGLSurface.
+ m_eglWindow = BGFX_WAYLAND_wl_egl_window_create( (wl_surface*)nwh, _width, _height);
+ nwh = (EGLNativeWindowType) m_eglWindow;
+ }
+# endif
m_surface = eglCreateWindowSurface(m_display, m_config, nwh, NULL);
}
@@ -412,16 +487,26 @@ EGL_IMPORT
void GlContext::destroy()
{
+ BX_TRACE("GLContext::destroy()");
if (NULL != m_display)
{
eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(m_display, m_context);
eglDestroySurface(m_display, m_surface);
+# if BX_PLATFORM_LINUX
+ if (m_eglWindow)
+ {
+ BGFX_WAYLAND_wl_egl_window_destroy(m_eglWindow);
+ waylandEglClose(m_waylandEglDll);
+ m_waylandEglDll = NULL;
+ }
+# endif
eglTerminate(m_display);
m_context = NULL;
}
- eglClose(m_eglLibrary);
+ eglClose(m_eglDll);
+ m_eglDll = NULL;
# if BX_PLATFORM_RPI
bcm_host_deinit();
@@ -447,6 +532,11 @@ EGL_IMPORT
}
# elif BX_PLATFORM_EMSCRIPTEN
EMSCRIPTEN_CHECK(emscripten_set_canvas_element_size(HTML5_TARGET_CANVAS_SELECTOR, _width, _height) );
+# elif BX_PLATFORM_LINUX
+ if (NULL != m_eglWindow)
+ {
+ BGFX_WAYLAND_wl_egl_window_resize(m_eglWindow, _width, _height, 0, 0);
+ }
# else
BX_UNUSED(_width, _height);
# endif // BX_PLATFORM_*
@@ -470,9 +560,9 @@ EGL_IMPORT
;
}
- SwapChainGL* GlContext::createSwapChain(void* _nwh)
+ SwapChainGL* GlContext::createSwapChain(void* _nwh, int _width, int _height)
{
- return BX_NEW(g_allocator, SwapChainGL)(m_display, m_config, m_context, (EGLNativeWindowType)_nwh);
+ return BX_NEW(g_allocator, SwapChainGL)(m_display, m_config, m_context, (EGLNativeWindowType)_nwh, _width, _height);
}
void GlContext::destroySwapChain(SwapChainGL* _swapChain)
diff --git a/3rdparty/bgfx/src/glcontext_egl.h b/3rdparty/bgfx/src/glcontext_egl.h
index 2f87a32e5eb..28e7a5d49fb 100644
--- a/3rdparty/bgfx/src/glcontext_egl.h
+++ b/3rdparty/bgfx/src/glcontext_egl.h
@@ -11,6 +11,8 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
+struct wl_egl_window;
+
// EGL pulls X11 crap...
#if defined(None)
# undef None
@@ -31,10 +33,15 @@ namespace bgfx { namespace gl
struct GlContext
{
GlContext()
- : m_current(NULL)
+ : m_eglDll(NULL)
+ , m_current(NULL)
, m_context(NULL)
, m_display(NULL)
, m_surface(NULL)
+#if BX_PLATFORM_LINUX
+ , m_waylandEglDll(NULL)
+ , m_eglWindow(NULL)
+#endif
, m_msaaContext(false)
{
}
@@ -44,7 +51,7 @@ namespace bgfx { namespace gl
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
uint64_t getCaps() const;
- SwapChainGL* createSwapChain(void* _nwh);
+ SwapChainGL* createSwapChain(void* _nwh, int _w, int _h);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
void makeCurrent(SwapChainGL* _swapChain = NULL);
@@ -56,12 +63,16 @@ namespace bgfx { namespace gl
return NULL != m_context;
}
- void* m_eglLibrary;
+ void* m_eglDll;
SwapChainGL* m_current;
EGLConfig m_config;
EGLContext m_context;
EGLDisplay m_display;
EGLSurface m_surface;
+#if BX_PLATFORM_LINUX
+ void* m_waylandEglDll;
+ struct wl_egl_window *m_eglWindow;
+#endif
// true when MSAA is handled by the context instead of using MSAA FBO
bool m_msaaContext;
};
diff --git a/3rdparty/bgfx/src/glcontext_html5.cpp b/3rdparty/bgfx/src/glcontext_html5.cpp
index 016b7c189b3..cce0f299da8 100644
--- a/3rdparty/bgfx/src/glcontext_html5.cpp
+++ b/3rdparty/bgfx/src/glcontext_html5.cpp
@@ -86,7 +86,7 @@ namespace bgfx { namespace gl
}
else
{
- m_primary = createSwapChain((void*)canvas);
+ m_primary = createSwapChain((void*)canvas, (int)_width, (int)_height);
}
if (0 != _width
@@ -122,9 +122,10 @@ namespace bgfx { namespace gl
EMSCRIPTEN_CHECK(emscripten_set_canvas_element_size(m_primary->m_canvas, (int) _width, (int) _height) );
}
- SwapChainGL* GlContext::createSwapChain(void* _nwh)
+ SwapChainGL* GlContext::createSwapChain(void* _nwh, int _width, int _height)
{
emscripten_webgl_init_context_attributes(&s_attrs);
+ BX_UNUSED(_width, _height);
// Work around bug https://bugs.chromium.org/p/chromium/issues/detail?id=1045643 in Chrome
// by having alpha always enabled.
diff --git a/3rdparty/bgfx/src/glcontext_html5.h b/3rdparty/bgfx/src/glcontext_html5.h
index 3c3f457d3c6..e1b93799a75 100644
--- a/3rdparty/bgfx/src/glcontext_html5.h
+++ b/3rdparty/bgfx/src/glcontext_html5.h
@@ -26,7 +26,7 @@ namespace bgfx { namespace gl
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
uint64_t getCaps() const;
- SwapChainGL* createSwapChain(void* _nwh);
+ SwapChainGL* createSwapChain(void* _nwh, int _width, int _height);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
void makeCurrent(SwapChainGL* _swapChain = NULL);
diff --git a/3rdparty/bgfx/src/glcontext_nsgl.h b/3rdparty/bgfx/src/glcontext_nsgl.h
index 560808b0fd5..ed331871e35 100644
--- a/3rdparty/bgfx/src/glcontext_nsgl.h
+++ b/3rdparty/bgfx/src/glcontext_nsgl.h
@@ -26,7 +26,7 @@ namespace bgfx { namespace gl
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
uint64_t getCaps() const;
- SwapChainGL* createSwapChain(void* _nwh);
+ SwapChainGL* createSwapChain(void* _nwh, int _width, int _height);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
void makeCurrent(SwapChainGL* _swapChain = NULL);
diff --git a/3rdparty/bgfx/src/glcontext_nsgl.mm b/3rdparty/bgfx/src/glcontext_nsgl.mm
index acb1900762c..93dd421205f 100644
--- a/3rdparty/bgfx/src/glcontext_nsgl.mm
+++ b/3rdparty/bgfx/src/glcontext_nsgl.mm
@@ -326,7 +326,7 @@ namespace bgfx { namespace gl
return caps;
}
- SwapChainGL* GlContext::createSwapChain(void* _nwh)
+ SwapChainGL* GlContext::createSwapChain(void* _nwh, int _width, int _height)
{
return BX_NEW(g_allocator, SwapChainGL)(_nwh,(NSOpenGLContext*)m_context);
}
diff --git a/3rdparty/bgfx/src/glcontext_wgl.cpp b/3rdparty/bgfx/src/glcontext_wgl.cpp
index f09a23d872e..efa0ec2080d 100644
--- a/3rdparty/bgfx/src/glcontext_wgl.cpp
+++ b/3rdparty/bgfx/src/glcontext_wgl.cpp
@@ -335,8 +335,9 @@ namespace bgfx { namespace gl
return BGFX_CAPS_SWAP_CHAIN;
}
- SwapChainGL* GlContext::createSwapChain(void* _nwh)
+ SwapChainGL* GlContext::createSwapChain(void* _nwh, int _width, int _height)
{
+ BX_UNUSED(_width, _height);
SwapChainGL* swapChain = BX_NEW(g_allocator, SwapChainGL)(_nwh);
int result = SetPixelFormat(swapChain->m_hdc, m_pixelFormat, &m_pfd);
diff --git a/3rdparty/bgfx/src/glcontext_wgl.h b/3rdparty/bgfx/src/glcontext_wgl.h
index 7289a123424..13b8d2ed880 100644
--- a/3rdparty/bgfx/src/glcontext_wgl.h
+++ b/3rdparty/bgfx/src/glcontext_wgl.h
@@ -74,7 +74,7 @@ typedef void (APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum z
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
uint64_t getCaps() const;
- SwapChainGL* createSwapChain(void* _nwh);
+ SwapChainGL* createSwapChain(void* _nwh, int _width, int _height);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
void makeCurrent(SwapChainGL* _swapChain = NULL);
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index b15f0a12886..16095248be9 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -3396,10 +3396,10 @@ namespace bgfx { namespace d3d11
{
case UniformType::Mat3:
case UniformType::Mat3|kUniformFragmentBit:
- {
+ {
float* value = (float*)data;
for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3*16, value += 9)
- {
+ {
Matrix4 mtx;
mtx.un.val[ 0] = value[0];
mtx.un.val[ 1] = value[1];
diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp
index 6fdf64225d7..ff860faec25 100644
--- a/3rdparty/bgfx/src/renderer_gl.cpp
+++ b/3rdparty/bgfx/src/renderer_gl.cpp
@@ -3046,7 +3046,8 @@ namespace bgfx { namespace gl
}
#if BGFX_CONFIG_RENDERER_OPENGLES && (BGFX_CONFIG_RENDERER_OPENGLES < 30)
- if (!m_maxMsaa && s_extension[Extension::IMG_multisampled_render_to_texture].m_supported) {
+ if (!m_maxMsaa && s_extension[Extension::IMG_multisampled_render_to_texture].m_supported)
+ {
GL_CHECK(glGetIntegerv(GL_MAX_SAMPLES_IMG, &m_maxMsaa) );
}
#endif // BGFX_CONFIG_RENDERER_OPENGLES < 30
@@ -7112,7 +7113,9 @@ namespace bgfx { namespace gl
{
attachment = GL_DEPTH_ATTACHMENT;
}
- } else {
+ }
+ else
+ {
attachment = GL_COLOR_ATTACHMENT0 + colorIdx;
++colorIdx;
}
@@ -7142,7 +7145,7 @@ namespace bgfx { namespace gl
void FrameBufferGL::create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _format, TextureFormat::Enum _depthFormat)
{
BX_UNUSED(_format, _depthFormat);
- m_swapChain = s_renderGL->m_glctx.createSwapChain(_nwh);
+ m_swapChain = s_renderGL->m_glctx.createSwapChain(_nwh, _width, _height);
m_width = _width;
m_height = _height;
m_numTh = 0;
diff --git a/3rdparty/bgfx/src/renderer_vk.cpp b/3rdparty/bgfx/src/renderer_vk.cpp
index aba25e78512..8b2c6cd001e 100644
--- a/3rdparty/bgfx/src/renderer_vk.cpp
+++ b/3rdparty/bgfx/src/renderer_vk.cpp
@@ -17,10 +17,6 @@
# import <Metal/Metal.h>
#endif // BX_PLATFORM_OSX
-#if defined(WL_EGL_PLATFORM)
-# include <wayland-egl-backend.h>
-#endif // defined(WL_EGL_PLATFORM)
-
namespace bgfx { namespace vk
{
static char s_viewName[BGFX_CONFIG_MAX_VIEWS][BGFX_CONFIG_MAX_VIEW_NAME];
@@ -346,6 +342,18 @@ VK_IMPORT_DEVICE
EXT_shader_viewport_index_layer,
EXT_custom_border_color,
KHR_draw_indirect_count,
+
+# if BX_PLATFORM_ANDROID
+ KHR_android_surface,
+# elif BX_PLATFORM_LINUX
+ KHR_wayland_surface,
+ KHR_xlib_surface,
+ KHR_xcb_surface,
+# elif BX_PLATFORM_WINDOWS
+ KHR_win32_surface,
+# elif BX_PLATFORM_OSX
+ MVK_macos_surface,
+# endif
Count
};
@@ -371,6 +379,17 @@ VK_IMPORT_DEVICE
{ "VK_EXT_shader_viewport_index_layer", 1, false, false, true , Layer::Count },
{ "VK_EXT_custom_border_color", 1, false, false, true , Layer::Count },
{ "VK_KHR_draw_indirect_count", 1, false, false, true , Layer::Count },
+# if BX_PLATFORM_ANDROID
+ { VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count },
+# elif BX_PLATFORM_LINUX
+ { VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count },
+ { VK_KHR_XLIB_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count },
+ { VK_KHR_XCB_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count },
+# elif BX_PLATFORM_WINDOWS
+ { VK_KHR_WIN32_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count },
+# elif BX_PLATFORM_OSX
+ { VK_MVK_MACOS_SURFACE_EXTENSION_NAME, 1, false, false, true, Layer::Count },
+# endif
};
BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) );
@@ -1159,7 +1178,7 @@ VK_IMPORT_DEVICE
#else
"libvulkan.so.1"
#endif // BX_PLATFORM_*
- );
+ );
if (NULL == m_vulkan1Dll)
{
@@ -1229,13 +1248,12 @@ VK_IMPORT
const char* enabledExtension[Extension::Count + 3] =
#else
- uint32_t numEnabledExtensions = headless ? 0 : 2;
+ uint32_t numEnabledExtensions = headless ? 0 : 1;
- const char* enabledExtension[Extension::Count + 2] =
+ const char* enabledExtension[Extension::Count + 1] =
#endif
{
VK_KHR_SURFACE_EXTENSION_NAME,
- KHR_SURFACE_EXTENSION_NAME,
#if BX_PLATFORM_OSX
VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME,
#endif
@@ -2664,6 +2682,7 @@ VK_IMPORT_DEVICE
m_indexBuffers[_blitter.m_ib->handle.idx].update(m_commandBuffer, 0, _numIndices*2, _blitter.m_ib->data);
m_vertexBuffers[_blitter.m_vb->handle.idx].update(m_commandBuffer, 0, numVertices*_blitter.m_layout.m_stride, _blitter.m_vb->data, true);
+
VkRenderPassBeginInfo rpbi;
rpbi.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
rpbi.pNext = NULL;
@@ -2757,6 +2776,13 @@ VK_IMPORT_DEVICE
{
return suspended;
}
+
+ //BX_TRACE("updateResolution(%d, %d) m_resolution=(%d, %d)"
+ // , _resolution.width
+ // , _resolution.height
+ // , m_resolution.width
+ // , m_resolution.height
+ // );
uint32_t flags = _resolution.reset & ~(0
| BGFX_RESET_SUSPEND
@@ -2764,19 +2790,13 @@ VK_IMPORT_DEVICE
| BGFX_RESET_DEPTH_CLAMP
);
- // Note: m_needToRefreshSwapchain is deliberately ignored when deciding whether to recreate the swapchain
- // because it can happen several frames before submit is called with the new resolution.
- // Instead, vkAcquireNextImageKHR and all draws to the backbuffer are skipped until the window size is updated.
- // That also fixes a related issue where VK_ERROR_OUT_OF_DATE_KHR is returned from
- // vkQueuePresentKHR when the window doesn't exist anymore, and vkGetPhysicalDeviceSurfaceCapabilitiesKHR
- // fails with VK_ERROR_SURFACE_LOST_KHR.
-
if (false
|| m_resolution.format != _resolution.format
|| m_resolution.width != _resolution.width
|| m_resolution.height != _resolution.height
|| m_resolution.reset != flags
- || m_backBuffer.m_swapChain.m_needToRecreateSurface)
+ || m_backBuffer.m_swapChain.m_needToRecreateSurface
+ || m_backBuffer.m_swapChain.m_needToRecreateSwapchain)
{
flags &= ~BGFX_RESET_INTERNAL_FORCE;
@@ -2794,6 +2814,10 @@ VK_IMPORT_DEVICE
preReset();
m_backBuffer.update(m_commandBuffer, m_resolution);
+ // Update the resolution again here, as the actual width and height
+ // is now final (as it was potentially clamped by the Vulkan driver).
+ m_resolution.width = m_backBuffer.m_width;
+ m_resolution.height = m_backBuffer.m_height;
postReset();
}
@@ -4131,10 +4155,10 @@ VK_IMPORT_DEVICE
{
case UniformType::Mat3:
case UniformType::Mat3|kUniformFragmentBit:
- {
+ {
float* value = (float*)data;
for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3*16, value += 9)
- {
+ {
Matrix4 mtx;
mtx.un.val[ 0] = value[0];
mtx.un.val[ 1] = value[1];
@@ -6658,6 +6682,7 @@ VK_DESTROY
;
const bool recreateSwapchain = false
+ || m_needToRecreateSwapchain
|| m_resolution.format != _resolution.format
|| m_resolution.width != _resolution.width
|| m_resolution.height != _resolution.height
@@ -6763,22 +6788,25 @@ VK_DESTROY
}
#elif BX_PLATFORM_LINUX
{
-#if defined(WL_EGL_PLATFORM)
if (g_platformData.type == bgfx::NativeWindowHandleType::Wayland)
{
+ BGFX_FATAL(s_extension[Extension::KHR_wayland_surface].m_supported, Fatal::UnableToInitialize, VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME " not supported");
+ BGFX_FATAL(NULL != vkCreateWaylandSurfaceKHR, Fatal::UnableToInitialize, "vkCreateWaylandSurfaceKHR == 0");
+ BX_TRACE("Attempting Wayland surface creation.");
VkWaylandSurfaceCreateInfoKHR sci;
sci.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR;
sci.pNext = NULL;
sci.flags = 0;
sci.display = (wl_display*)g_platformData.ndt;
- sci.surface = (wl_surface*)((wl_egl_window*)m_nwh)->surface;
+ sci.surface = (wl_surface*)m_nwh;
result = vkCreateWaylandSurfaceKHR(instance, &sci, allocatorCb, &m_surface);
}
else
-#endif // defined(WL_EGL_PLATFORM)
{
- if (NULL != vkCreateXlibSurfaceKHR)
+ if (s_extension[Extension::KHR_xlib_surface].m_supported)
{
+ BGFX_FATAL(NULL != vkCreateXlibSurfaceKHR, Fatal::UnableToInitialize, "vkCreateXlibSurfaceKHR == 0")
+ BX_TRACE("Attempting Xlib surface creation.");
VkXlibSurfaceCreateInfoKHR sci;
sci.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;
sci.pNext = NULL;
@@ -6788,7 +6816,7 @@ VK_DESTROY
result = vkCreateXlibSurfaceKHR(instance, &sci, allocatorCb, &m_surface);
}
- if (VK_SUCCESS != result)
+ if (VK_SUCCESS != result && s_extension[Extension::KHR_xcb_surface].m_supported)
{
void* xcbdll = bx::dlopen("libX11-xcb.so.1");
@@ -6800,6 +6828,8 @@ VK_DESTROY
union { void* ptr; xcb_window_t window; } cast = { m_nwh };
+ BGFX_FATAL(NULL != vkCreateXcbSurfaceKHR, Fatal::UnableToInitialize, "vkCreateXcbSurfaceKHR == 0")
+
VkXcbSurfaceCreateInfoKHR sci;
sci.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
sci.pNext = NULL;
@@ -6932,6 +6962,15 @@ VK_DESTROY
, surfaceCapabilities.minImageExtent.height
, surfaceCapabilities.maxImageExtent.height
);
+ if (width != m_resolution.width || height != m_resolution.height)
+ {
+ BX_TRACE("Clamped swapchain resolution from %dx%d to %dx%d"
+ , m_resolution.width
+ , m_resolution.height
+ , width
+ , height
+ );
+ }
VkCompositeAlphaFlagBitsKHR compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
@@ -7052,6 +7091,8 @@ VK_DESTROY
m_backBufferColorImageLayout[ii] = VK_IMAGE_LAYOUT_UNDEFINED;
}
+ BX_TRACE("Succesfully created swapchain (%dx%d) with %d images.", width, height, m_numSwapChainImages);
+
VkSemaphoreCreateInfo sci;
sci.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
sci.pNext = NULL;
@@ -7071,7 +7112,7 @@ VK_DESTROY
m_currentSemaphore = 0;
m_needPresent = false;
- m_needToRefreshSwapchain = false;
+ m_needToRecreateSwapchain = false;
return result;
}
@@ -7373,7 +7414,7 @@ VK_DESTROY
bool SwapChainVK::acquire(VkCommandBuffer _commandBuffer)
{
if (VK_NULL_HANDLE == m_swapchain
- || m_needToRefreshSwapchain)
+ || m_needToRecreateSwapchain)
{
return false;
}
@@ -7395,6 +7436,11 @@ VK_DESTROY
, &m_backBufferColorIdx
);
+ if (result != VK_SUCCESS)
+ {
+ BX_TRACE("vkAcquireNextImageKHR(...): result = %s", getName(result));
+ }
+
switch (result)
{
case VK_SUCCESS:
@@ -7402,11 +7448,12 @@ VK_DESTROY
case VK_ERROR_SURFACE_LOST_KHR:
m_needToRecreateSurface = true;
- BX_FALLTHROUGH;
+ m_needToRecreateSwapchain = true;
+ return false;
case VK_ERROR_OUT_OF_DATE_KHR:
case VK_SUBOPTIMAL_KHR:
- m_needToRefreshSwapchain = true;
+ m_needToRecreateSwapchain = true;
return false;
default:
@@ -7448,16 +7495,22 @@ VK_DESTROY
pi.pImageIndices = &m_backBufferColorIdx;
pi.pResults = NULL;
VkResult result = vkQueuePresentKHR(m_queue, &pi);
+
+ if (result != VK_SUCCESS)
+ {
+ BX_TRACE("vkQueuePresentKHR(...): result = %s", getName(result));
+ }
switch (result)
{
case VK_ERROR_SURFACE_LOST_KHR:
m_needToRecreateSurface = true;
- BX_FALLTHROUGH;
+ m_needToRecreateSwapchain = true;
+ break;
case VK_ERROR_OUT_OF_DATE_KHR:
case VK_SUBOPTIMAL_KHR:
- m_needToRefreshSwapchain = true;
+ m_needToRecreateSwapchain = true;
break;
default:
@@ -7615,8 +7668,10 @@ VK_DESTROY
{
m_swapChain.update(_commandBuffer, m_nwh, _resolution);
VK_CHECK(s_renderVK->getRenderPass(m_swapChain, &m_renderPass) );
- m_width = _resolution.width;
- m_height = _resolution.height;
+ // Don't believe the passed Resolution, as the Vulkan driver might have
+ // specified another resolution, which we had to obey.
+ m_width = m_swapChain.m_sci.imageExtent.width;
+ m_height = m_swapChain.m_sci.imageExtent.height;
m_sampler = m_swapChain.m_sampler;
}
@@ -8275,12 +8330,26 @@ VK_DESTROY
if (isFrameBufferValid)
{
viewState.m_rect = _render->m_view[view].m_rect;
- const Rect& rect = _render->m_view[view].m_rect;
- const Rect& scissorRect = _render->m_view[view].m_scissor;
+ Rect rect = _render->m_view[view].m_rect;
+ Rect scissorRect = _render->m_view[view].m_scissor;
viewHasScissor = !scissorRect.isZero();
viewScissorRect = viewHasScissor ? scissorRect : rect;
restoreScissor = false;
+ // Clamp the rect to what's valid according to Vulkan.
+ rect.m_width = bx::min(rect.m_width, fb.m_width - rect.m_x);
+ rect.m_height = bx::min(rect.m_height, fb.m_height - rect.m_y);
+ if (_render->m_view[view].m_rect.m_width != rect.m_width
+ || _render->m_view[view].m_rect.m_height != rect.m_height)
+ {
+ BX_TRACE("Clamp render pass from %dx%d to %dx%d"
+ , _render->m_view[view].m_rect.m_width
+ , _render->m_view[view].m_rect.m_height
+ , rect.m_width
+ , rect.m_height
+ );
+ }
+
rpbi.framebuffer = fb.m_currentFramebuffer;
rpbi.renderPass = fb.m_renderPass;
rpbi.renderArea.offset.x = rect.m_x;
diff --git a/3rdparty/bgfx/src/renderer_vk.h b/3rdparty/bgfx/src/renderer_vk.h
index fdd51301ea0..1852ed83123 100644
--- a/3rdparty/bgfx/src/renderer_vk.h
+++ b/3rdparty/bgfx/src/renderer_vk.h
@@ -8,31 +8,19 @@
#if BX_PLATFORM_ANDROID
# define VK_USE_PLATFORM_ANDROID_KHR
-# define KHR_SURFACE_EXTENSION_NAME VK_KHR_ANDROID_SURFACE_EXTENSION_NAME
# define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_ANDROID
#elif BX_PLATFORM_LINUX
-# if defined(WL_EGL_PLATFORM)
-# define VK_USE_PLATFORM_WAYLAND_KHR
-# endif // defined(WL_EGL_PLATFORM)
+# define VK_USE_PLATFORM_WAYLAND_KHR
# define VK_USE_PLATFORM_XLIB_KHR
# define VK_USE_PLATFORM_XCB_KHR
-# if defined(WL_EGL_PLATFORM)
-# define KHR_SURFACE_EXTENSION_NAME VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, \
- VK_KHR_XCB_SURFACE_EXTENSION_NAME
-# else
-# define KHR_SURFACE_EXTENSION_NAME VK_KHR_XCB_SURFACE_EXTENSION_NAME
-# endif // defined(WL_EGL_PLATFORM)
# define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_LINUX
#elif BX_PLATFORM_WINDOWS
# define VK_USE_PLATFORM_WIN32_KHR
-# define KHR_SURFACE_EXTENSION_NAME VK_KHR_WIN32_SURFACE_EXTENSION_NAME
# define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_WINDOWS
#elif BX_PLATFORM_OSX
# define VK_USE_PLATFORM_MACOS_MVK
-# define KHR_SURFACE_EXTENSION_NAME VK_MVK_MACOS_SURFACE_EXTENSION_NAME
# define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_MACOS
#else
-# define KHR_SURFACE_EXTENSION_NAME ""
# define VK_IMPORT_INSTANCE_PLATFORM
#endif // BX_PLATFORM_*
@@ -69,7 +57,6 @@
/* VK_KHR_android_surface */ \
VK_IMPORT_INSTANCE_FUNC(true, vkCreateAndroidSurfaceKHR); \
-#if defined(WL_EGL_PLATFORM)
#define VK_IMPORT_INSTANCE_LINUX \
/* VK_KHR_wayland_surface */ \
VK_IMPORT_INSTANCE_FUNC(true, vkCreateWaylandSurfaceKHR); \
@@ -81,17 +68,6 @@
VK_IMPORT_INSTANCE_FUNC(true, vkCreateXcbSurfaceKHR); \
VK_IMPORT_INSTANCE_FUNC(true, vkGetPhysicalDeviceXcbPresentationSupportKHR); \
-#else
-#define VK_IMPORT_INSTANCE_LINUX \
- /* VK_KHR_xlib_surface */ \
- VK_IMPORT_INSTANCE_FUNC(true, vkCreateXlibSurfaceKHR); \
- VK_IMPORT_INSTANCE_FUNC(true, vkGetPhysicalDeviceXlibPresentationSupportKHR); \
- /* VK_KHR_xcb_surface */ \
- VK_IMPORT_INSTANCE_FUNC(true, vkCreateXcbSurfaceKHR); \
- VK_IMPORT_INSTANCE_FUNC(true, vkGetPhysicalDeviceXcbPresentationSupportKHR); \
-
-#endif // defined(WL_EGL_PLATFORM)
-
#define VK_IMPORT_INSTANCE_WINDOWS \
/* VK_KHR_win32_surface */ \
VK_IMPORT_INSTANCE_FUNC(true, vkCreateWin32SurfaceKHR); \
@@ -762,7 +738,7 @@ VK_DESTROY_FUNC(DescriptorSet);
VkSemaphore m_lastImageAcquiredSemaphore;
bool m_needPresent;
- bool m_needToRefreshSwapchain;
+ bool m_needToRecreateSwapchain;
bool m_needToRecreateSurface;
TextureVK m_backBufferDepthStencil;
diff --git a/3rdparty/bgfx/src/shader_spirv.cpp b/3rdparty/bgfx/src/shader_spirv.cpp
index 739256546be..2143641a0c4 100644
--- a/3rdparty/bgfx/src/shader_spirv.cpp
+++ b/3rdparty/bgfx/src/shader_spirv.cpp
@@ -17,7 +17,7 @@ namespace bgfx
#define SPV_OPERAND_7(_a0, _a1, _a2, _a3, _a4, _a5, _a6) SPV_OPERAND_1(_a0), SPV_OPERAND_6(_a1, _a2, _a3, _a4, _a5, _a6)
#define SPV_OPERAND_8(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7) SPV_OPERAND_1(_a0), SPV_OPERAND_7(_a1, _a2, _a3, _a4, _a5, _a6, _a7)
#define SPV_OPERAND_9(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) SPV_OPERAND_1(_a0), SPV_OPERAND_8(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8)
-#if BX_COMPILER_MSVC
+#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
// Workaround MSVS bug...
# define SPV_OPERAND(...) { BX_MACRO_DISPATCHER(SPV_OPERAND_, __VA_ARGS__) BX_VA_ARGS_PASS(__VA_ARGS__) }
#else
diff --git a/3rdparty/bx/include/bx/macros.h b/3rdparty/bx/include/bx/macros.h
index dab1ba7013a..61401af8650 100644
--- a/3rdparty/bx/include/bx/macros.h
+++ b/3rdparty/bx/include/bx/macros.h
@@ -11,7 +11,7 @@
#define BX_MACROS_H_HEADER_GUARD
///
-#if BX_COMPILER_MSVC
+#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
// Workaround MSVS bug...
# define BX_VA_ARGS_PASS(...) BX_VA_ARGS_PASS_1_ __VA_ARGS__ BX_VA_ARGS_PASS_2_
# define BX_VA_ARGS_PASS_1_ (
@@ -145,7 +145,7 @@
#define BX_UNUSED_11(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11) BX_UNUSED_10(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10); BX_UNUSED_1(_a11)
#define BX_UNUSED_12(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11, _a12) BX_UNUSED_11(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11); BX_UNUSED_1(_a12)
-#if BX_COMPILER_MSVC
+#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
// Workaround MSVS bug...
# define BX_UNUSED(...) BX_MACRO_DISPATCHER(BX_UNUSED_, __VA_ARGS__) BX_VA_ARGS_PASS(__VA_ARGS__)
#else
@@ -226,7 +226,7 @@
#define BX_CLASS_3(_class, _a1, _a2, _a3) BX_CLASS_2(_class, _a1, _a2); BX_CLASS_1(_class, _a3)
#define BX_CLASS_4(_class, _a1, _a2, _a3, _a4) BX_CLASS_3(_class, _a1, _a2, _a3); BX_CLASS_1(_class, _a4)
-#if BX_COMPILER_MSVC
+#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
# define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__) BX_VA_ARGS_PASS(_class, __VA_ARGS__)
#else
# define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__)(_class, __VA_ARGS__)
diff --git a/3rdparty/bx/src/debug.cpp b/3rdparty/bx/src/debug.cpp
index 8bbf1e6d122..062df287d7a 100644
--- a/3rdparty/bx/src/debug.cpp
+++ b/3rdparty/bx/src/debug.cpp
@@ -43,7 +43,13 @@ namespace bx
// NativeClient: NaCl module load failed: Validation failure. File violates Native Client safety rules.
__asm__ ("int $3");
#elif BX_PLATFORM_EMSCRIPTEN
- emscripten_log(EM_LOG_CONSOLE | EM_LOG_ERROR | EM_LOG_C_STACK | EM_LOG_JS_STACK | EM_LOG_DEMANGLE, "debugBreak!");
+ emscripten_log(0
+ | EM_LOG_CONSOLE
+ | EM_LOG_ERROR
+ | EM_LOG_C_STACK
+ | EM_LOG_JS_STACK
+ , "debugBreak!"
+ );
// Doing emscripten_debugger() disables asm.js validation due to an emscripten bug
//emscripten_debugger();
EM_ASM({ debugger; });
diff --git a/3rdparty/expat/CMake.README b/3rdparty/expat/CMake.README
index aa098b4f942..ba202e7a446 100644
--- a/3rdparty/expat/CMake.README
+++ b/3rdparty/expat/CMake.README
@@ -3,25 +3,25 @@
The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual
Studio) and should work on all other platform cmake supports.
-Assuming ~/expat-2.2.10 is the source directory of expat, add a subdirectory
+Assuming ~/expat-2.7.1 is the source directory of expat, add a subdirectory
build and change into that directory:
-~/expat-2.2.10$ mkdir build && cd build
-~/expat-2.2.10/build$
+~/expat-2.7.1$ mkdir build && cd build
+~/expat-2.7.1/build$
From that directory, call cmake first, then call make, make test and
make install in the usual way:
-~/expat-2.2.10/build$ cmake ..
+~/expat-2.7.1/build$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
....
-- Configuring done
-- Generating done
--- Build files have been written to: /home/patrick/expat-2.2.10/build
+-- Build files have been written to: /home/patrick/expat-2.7.1/build
If you want to specify the install location for your files, append
-DCMAKE_INSTALL_PREFIX=/your/install/path to the cmake call.
-~/expat-2.2.10/build$ make && make test && make install
+~/expat-2.7.1/build$ make && make test && make install
Scanning dependencies of target expat
[ 5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o
[ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o
@@ -36,7 +36,7 @@ Visual Studio Command Prompt or when using mingw, you must open a cmd.exe and
make sure that gcc can be called. On Windows, you also might want to specify a
special Generator for CMake:
for Visual Studio builds do:
-cmake .. -G "Visual Studio 15 2017" && msbuild /m expat.sln
+cmake .. -G "Visual Studio 16 2019" && msbuild /m expat.sln
for mingw builds do:
cmake .. -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=D:\expat-install
&& gmake && gmake install
diff --git a/3rdparty/expat/CMakeLists.txt b/3rdparty/expat/CMakeLists.txt
index dfbd0c5943b..4a5ea2b5847 100644
--- a/3rdparty/expat/CMakeLists.txt
+++ b/3rdparty/expat/CMakeLists.txt
@@ -1,44 +1,53 @@
-# This file is copyrighted under the BSD-license for buildsystem files of KDE
-# copyright 2010, Patrick Spendrin <ps_ml@gmx.de>
-
-cmake_minimum_required(VERSION 3.1.3)
-
-# This allows controlling documented build time switches
-# when Expat is pulled in using the add_subdirectory function, e.g.
-#
-# set(EXPAT_BUILD_DOCS OFF)
-# set(EXPAT_BUILD_TOOLS OFF)
-# add_subdirectory(${expat_SOURCE_DIR}/expat ${expat_BINARY_DIR})
-#
-# would disable compilation of the xmlwf CLI and its man page.
-# Without activating behaviour NEW for policy CMP0077 here,
-# a user with -Wdev enabled would see warning
-#
-# Policy CMP0077 is not set: option() honors normal variables. Run "cmake
-# --help-policy CMP0077" for policy details. Use the cmake_policy command to
-# set the policy and suppress this warning.
-#
-# For compatibility with older versions of CMake, option is clearing the
-# normal variable 'EXPAT_BUILD_DOCS'.
+# __ __ _
+# ___\ \/ /_ __ __ _| |_
+# / _ \\ /| '_ \ / _` | __|
+# | __// \| |_) | (_| | |_
+# \___/_/\_\ .__/ \__,_|\__|
+# |_| XML parser
#
-# and effectively not be able to adjust option EXPAT_BUILD_DOCS.
-#
-# For more details please see:
-# - https://cmake.org/cmake/help/latest/policy/CMP0077.html
-# - https://github.com/libexpat/libexpat/pull/419
-#
-if(POLICY CMP0077)
- cmake_policy(SET CMP0077 NEW)
-endif()
+# Copyright (c) 2010 Patrick Spendrin <ps_ml@gmx.de>
+# Copyright (c) 2012 Karl Waclawek <karl@waclawek.net>
+# Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2016 Sergei Nikulov <sergey.nikulov@gmail.com>
+# Copyright (c) 2016 Björn Lindahl <bjorn.lindahl@foi.se>
+# Copyright (c) 2016 Tobias Taschner <github@tc84.de>
+# Copyright (c) 2016 Ben Boeckel <ben.boeckel@kitware.com>
+# Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+# Copyright (c) 2017 Rolf Eike Beer <eike@sf-mail.de>
+# Copyright (c) 2017 Stephen Groat <stephen@groat.us>
+# Copyright (c) 2017 Franek Korta <fkorta@gmail.com>
+# Copyright (c) 2018 pedro-vicente <pedro.vicente@space-research.org>
+# Copyright (c) 2018 Frank Rast <frank.rast@gefeg.com>
+# Copyright (c) 2018 userwithuid <userwithuid@gmail.com>
+# Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
+# Copyright (c) 2019 Kishore Kunche <kishore.kunche@intel.com>
+# Copyright (c) 2019 xantares <xantares09@hotmail.com>
+# Copyright (c) 2019 Mohammed Khajapasha <mohammed.khajapasha@intel.com>
+# Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+# Copyright (c) 2019 Bhargava Shastry <bhargava.shastry@ethereum.org>
+# Copyright (c) 2020 Maciej Sroczyński <macieksroczynski@poczta.fm>
+# Copyright (c) 2020 Gulliver <gulliver@traumkristalle.net>
+# Copyright (c) 2020 Thomas Beutlich <tc@tbeu.de>
+# Copyright (c) 2021 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
+# Copyright (c) 2022 Johnny Jazeix <jazeix@gmail.com>
+# Copyright (c) 2022 Mark Brand <markbrand@google.com>
+# Copyright (c) 2022 David Faure <david.faure@kdab.com>
+# Unlike most of Expat,
+# this file is copyrighted under the BSD-license for buildsystem files of KDE.
+
+cmake_minimum_required(VERSION 3.13.0)
project(expat
VERSION
- 2.2.10
+ 2.7.1
LANGUAGES
C
)
+set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_STANDARD_REQUIRED ON)
+set(CMAKE_C_EXTENSIONS OFF) # i.e. -std=c99 rather than default -std=gnu99
-set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org")
+set(PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues")
set(PACKAGE_NAME "expat")
set(PACKAGE_VERSION "${PROJECT_VERSION}")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
@@ -48,11 +57,6 @@ include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
#
-# Detect use by means of add_subdirectory
-#
-get_directory_property(_EXPAT_PARENT_DIRECTORY PARENT_DIRECTORY)
-
-#
# Configuration defaults
#
if(WINCE)
@@ -75,51 +79,118 @@ if(MSVC)
else()
set(_EXPAT_BUILD_PKGCONFIG_DEFAULT ON)
endif()
+if(DEFINED BUILD_SHARED_LIBS)
+ set(_EXPAT_SHARED_LIBS_DEFAULT ${BUILD_SHARED_LIBS})
+else()
+ set(_EXPAT_SHARED_LIBS_DEFAULT ON)
+endif()
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE NoConfig) # so that accessing EXPAT_*_POSTFIX will be waterproof
+endif()
+string(TOUPPER "${CMAKE_BUILD_TYPE}" _EXPAT_BUILD_TYPE_UPPER)
#
# Configuration
#
-option(EXPAT_BUILD_TOOLS "build the xmlwf tool for expat library" ${_EXPAT_BUILD_TOOLS_DEFAULT})
-option(EXPAT_BUILD_EXAMPLES "build the examples for expat library" ON)
-option(EXPAT_BUILD_TESTS "build the tests for expat library" ON)
-option(EXPAT_SHARED_LIBS "build a shared expat library" ON)
-option(EXPAT_BUILD_DOCS "build man page for xmlwf" ${_EXPAT_BUILD_DOCS_DEFAULT})
-option(EXPAT_BUILD_FUZZERS "build fuzzers for the expat library" OFF)
-option(EXPAT_BUILD_PKGCONFIG "build pkg-config file" ${_EXPAT_BUILD_PKGCONFIG_DEFAULT})
-option(EXPAT_OSSFUZZ_BUILD "build fuzzers via ossfuzz for the expat library" OFF)
+
+macro(expat_shy_set var default cache type desc)
+ # Macro expat_shy_set came into life because:
+ # - Expat was previously using an inconsistent mix of CMake's native set()
+ # and option() to define public build time options.
+ # - option() is more friendly than set() with regard to configuring an
+ # external project that is pulled in by means of add_subdirectory() --
+ # see comments in issue #597 -- so we wanted to get away from set().
+ # - option() auto-converts non-bool values to bool when writing to the CMake
+ # cache, so we needed something that supports non-bool better and hence
+ # wanted to get away from plain option(), too.
+ #
+ # As a result, this function serves as a hybrid between CMake's regular set()
+ # and option(): from set() it takes support for non-bool types and the function
+ # name and signature whereas from option() (with policy CMP0077 mode NEW) it
+ # takes being shy when a value has previously been defined for that variable.
+ #
+ # So that resolves all need for set(.. FORCE) when pulling in Expat by means of
+ # add_subdirectory().
+ #
+ if(NOT ${cache} STREQUAL "CACHE")
+ message(SEND_ERROR "Macro usage is: expat_shy_set(var default CACHE type desc)")
+ endif()
+
+ if(DEFINED ${var})
+ # NOTE: The idea is to (ideally) only add to the cache if
+ # there is no cache entry, yet. "if(DEFINED CACHE{var})"
+ # requires CMake >=3.14.
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.14" AND NOT DEFINED "CACHE{${var}}")
+ set("${var}" "${${var}}" CACHE "${type}" "${desc}")
+ endif()
+ else()
+ set("${var}" "${default}" CACHE "${type}" "${desc}")
+ endif()
+endmacro()
+
+expat_shy_set(EXPAT_BUILD_TOOLS ${_EXPAT_BUILD_TOOLS_DEFAULT} CACHE BOOL "Build the xmlwf tool for expat library")
+expat_shy_set(EXPAT_BUILD_EXAMPLES ON CACHE BOOL "Build the examples for expat library")
+expat_shy_set(EXPAT_BUILD_TESTS ON CACHE BOOL "Build the tests for expat library")
+expat_shy_set(EXPAT_SHARED_LIBS ${_EXPAT_SHARED_LIBS_DEFAULT} CACHE BOOL "Build a shared expat library")
+expat_shy_set(EXPAT_BUILD_DOCS ${_EXPAT_BUILD_DOCS_DEFAULT} CACHE BOOL "Build man page for xmlwf")
+expat_shy_set(EXPAT_BUILD_FUZZERS OFF CACHE BOOL "Build fuzzers for the expat library")
+expat_shy_set(EXPAT_BUILD_PKGCONFIG ${_EXPAT_BUILD_PKGCONFIG_DEFAULT} CACHE BOOL "Build pkg-config file")
+expat_shy_set(EXPAT_OSSFUZZ_BUILD OFF CACHE BOOL "Build fuzzers via OSS-Fuzz for the expat library")
if(UNIX OR _EXPAT_HELP)
- option(EXPAT_WITH_LIBBSD "utilize libbsd (for arc4random_buf)" OFF)
+ expat_shy_set(EXPAT_WITH_LIBBSD OFF CACHE BOOL "Utilize libbsd (for arc4random_buf)")
endif()
-option(EXPAT_ENABLE_INSTALL "install expat files in cmake install target" ON)
-set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")
+expat_shy_set(EXPAT_ENABLE_INSTALL ON CACHE BOOL "Install expat files in cmake install target")
+expat_shy_set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point, 0 to disable")
mark_as_advanced(EXPAT_CONTEXT_BYTES)
-option(EXPAT_DTD "Define to make parameter entity parsing functionality available" ON)
+expat_shy_set(EXPAT_DTD ON CACHE BOOL "Define to make parameter entity parsing functionality available")
mark_as_advanced(EXPAT_DTD)
-option(EXPAT_NS "Define to make XML Namespaces functionality available" ON)
+expat_shy_set(EXPAT_GE ON CACHE BOOL "Define to make general entity parsing functionality available")
+mark_as_advanced(EXPAT_GE)
+expat_shy_set(EXPAT_NS ON CACHE BOOL "Define to make XML Namespaces functionality available")
mark_as_advanced(EXPAT_NS)
-option(EXPAT_WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
+expat_shy_set(EXPAT_WARNINGS_AS_ERRORS OFF CACHE BOOL "Treat all compiler warnings as errors")
if(UNIX OR _EXPAT_HELP)
- option(EXPAT_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)
- set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING
- "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]")
- set(EXPAT_WITH_SYS_GETRANDOM "AUTO" CACHE STRING
- "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]")
+ expat_shy_set(EXPAT_DEV_URANDOM ON CACHE BOOL "Define to include code reading entropy from `/dev/urandom'.")
+ expat_shy_set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]")
+ expat_shy_set(EXPAT_WITH_SYS_GETRANDOM "AUTO" CACHE STRING "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]")
mark_as_advanced(EXPAT_DEV_URANDOM)
endif()
-set(EXPAT_CHAR_TYPE "char" CACHE STRING "Character type to use (char|ushort|wchar_t) [default=char]")
-option(EXPAT_ATTR_INFO "Define to allow retrieving the byte offsets for attribute names and values" OFF)
+expat_shy_set(EXPAT_CHAR_TYPE "char" CACHE STRING "Character type to use (char|ushort|wchar_t) [default=char]")
+expat_shy_set(EXPAT_ATTR_INFO OFF CACHE BOOL "Define to allow retrieving the byte offsets for attribute names and values")
mark_as_advanced(EXPAT_ATTR_INFO)
-option(EXPAT_LARGE_SIZE "Make XML_GetCurrent* functions return <(unsigned) long long> rather than <(unsigned) long>" OFF)
+expat_shy_set(EXPAT_LARGE_SIZE OFF CACHE BOOL "Make XML_GetCurrent* functions return <(unsigned) long long> rather than <(unsigned) long>")
mark_as_advanced(EXPAT_LARGE_SIZE)
-option(EXPAT_MIN_SIZE "Get a smaller (but slower) parser (in particular avoid multiple copies of the tokenizer)" OFF)
+expat_shy_set(EXPAT_MIN_SIZE OFF CACHE BOOL "Get a smaller (but slower) parser (in particular avoid multiple copies of the tokenizer)")
mark_as_advanced(EXPAT_MIN_SIZE)
if(MSVC OR _EXPAT_HELP)
- set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
+ expat_shy_set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
+endif()
+if(NOT _EXPAT_HELP)
+ expat_shy_set(_EXPAT_M32 OFF CACHE BOOL "(Unofficial!) Produce 32bit code with -m32")
+ mark_as_advanced(_EXPAT_M32)
+endif()
+
+if(EXPAT_BUILD_TESTS OR EXPAT_BUILD_FUZZERS)
+ # We have to call enable_language() before modifying any CMAKE_CXX_* variables
+ enable_language(CXX)
+
+ if (EXPAT_BUILD_FUZZERS)
+ set(CMAKE_CXX_STANDARD 17) # for std::string_view for Abseil for libprotobuf-mutator
+ else()
+ set(CMAKE_CXX_STANDARD 11)
+ endif()
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ set(CMAKE_CXX_EXTENSIONS OFF) # i.e. -std=c++11 rather than default -std=gnu++11
endif()
#
# Environment checks
#
+if(EXPAT_DTD AND NOT EXPAT_GE)
+ message(SEND_ERROR "Option EXPAT_DTD requires that EXPAT_GE is also enabled.")
+ message(SEND_ERROR "Please either enable option EXPAT_GE (recommended) or disable EXPAT_DTD also.")
+endif()
+
if(EXPAT_WITH_LIBBSD)
find_library(LIB_BSD NAMES bsd)
if(NOT LIB_BSD)
@@ -129,6 +200,26 @@ if(EXPAT_WITH_LIBBSD)
endif()
endif()
+if(MSVC)
+ # For the three types of MSVC version values, please see:
+ # - https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
+ # - https://sourceforge.net/p/predef/wiki/Compilers/
+ # - https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History
+ set(_EXPAT_MSVC_REQUIRED_INT 1800) # i.e. 12.0/2013/1800; see PR #426
+ set(_EXPAT_MSVC_SUPPORTED_INT 1920)
+ set(_EXPAT_MSVC_SUPPORTED_DISPLAY "Visual Studio 16.0/2019/${_EXPAT_MSVC_SUPPORTED_INT}")
+
+ if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_SUPPORTED_INT})
+ if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_REQUIRED_INT})
+ message(SEND_ERROR "MSVC_VERSION ${MSVC_VERSION} is TOO OLD to compile Expat without errors.")
+ message(SEND_ERROR "Please use officially supported ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later. Thank you!")
+ else()
+ message(WARNING "MSVC_VERSION ${MSVC_VERSION} is NOT OFFICIALLY SUPPORTED by Expat.")
+ message(WARNING "Please use ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later. Thank you!")
+ endif()
+ endif()
+endif()
+
macro(_expat_copy_bool_int source_ref dest_ref)
if(${source_ref})
set(${dest_ref} 1)
@@ -202,12 +293,16 @@ endif()
_expat_copy_bool_int(EXPAT_ATTR_INFO XML_ATTR_INFO)
_expat_copy_bool_int(EXPAT_DTD XML_DTD)
+_expat_copy_bool_int(EXPAT_GE XML_GE)
_expat_copy_bool_int(EXPAT_LARGE_SIZE XML_LARGE_SIZE)
_expat_copy_bool_int(EXPAT_MIN_SIZE XML_MIN_SIZE)
_expat_copy_bool_int(EXPAT_NS XML_NS)
if(NOT WIN32)
_expat_copy_bool_int(EXPAT_DEV_URANDOM XML_DEV_URANDOM)
endif()
+if(NOT EXPAT_CONTEXT_BYTES GREATER 0) # in particular with -DEXPAT_CONTEXT_BYTES=OFF
+ set(EXPAT_CONTEXT_BYTES 0)
+endif()
set(XML_CONTEXT_BYTES ${EXPAT_CONTEXT_BYTES})
macro(expat_install)
@@ -217,7 +312,6 @@ macro(expat_install)
endmacro()
configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")
-add_definitions(-DHAVE_EXPAT_CONFIG_H)
expat_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
@@ -226,14 +320,24 @@ if(FLAG_NO_STRICT_ALIASING)
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fno-strict-aliasing")
endif()
if(FLAG_VISIBILITY)
- add_definitions(-DXML_ENABLE_VISIBILITY=1)
+ if(EXPAT_SHARED_LIBS)
+ add_definitions(-DXML_ENABLE_VISIBILITY=1)
+ endif()
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden")
endif()
+if(MINGW AND ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU"))
+ # Without __USE_MINGW_ANSI_STDIO the compiler produces a false positive
+ set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-pedantic-ms-format")
+endif()
if (EXPAT_WARNINGS_AS_ERRORS)
if(MSVC)
add_definitions(/WX)
else()
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror")
+ if(MINGW)
+ # To avoid "error: unknown conversion type character ‘l’ in format [-Werror=format=]"
+ set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-format")
+ endif()
endif()
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")
@@ -243,10 +347,12 @@ if (MSVC)
if (EXPAT_MSVC_STATIC_CRT)
message("-- Using static CRT ${EXPAT_MSVC_STATIC_CRT}")
foreach(flag_var
+ CMAKE_CXX_FLAGS_${_EXPAT_BUILD_TYPE_UPPER}
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELWITHDEBINFO
+ CMAKE_C_FLAGS_${_EXPAT_BUILD_TYPE_UPPER}
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL
@@ -257,43 +363,32 @@ if (MSVC)
endif()
endif()
+if(_EXPAT_M32 AND NOT MSVC)
+ foreach(flag_var
+ CMAKE_CXX_FLAGS_${_EXPAT_BUILD_TYPE_UPPER}
+ CMAKE_CXX_FLAGS_DEBUG
+ CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL
+ CMAKE_CXX_FLAGS_RELWITHDEBINFO
+ CMAKE_C_FLAGS_${_EXPAT_BUILD_TYPE_UPPER}
+ CMAKE_C_FLAGS_DEBUG
+ CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL
+ CMAKE_C_FLAGS_RELWITHDEBINFO
+ )
+ set(${flag_var} "${${flag_var}} -m32")
+ endforeach()
+endif()
+
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996)
endif()
-if(WIN32)
- if(_EXPAT_UNICODE_WCHAR_T)
- set(_POSTFIX_WIDE "w")
- endif()
-
- if(MSVC AND NOT EXPAT_SHARED_LIBS)
- if(EXPAT_MSVC_STATIC_CRT)
- set(_POSTFIX_CRT "MT")
- else()
- set(_POSTFIX_CRT "MD")
- endif()
- endif()
-
- foreach(postfix_var
- CMAKE_DEBUG_POSTFIX
- CMAKE_RELEASE_POSTFIX
- CMAKE_MINSIZEREL_POSTFIX
- CMAKE_RELWITHDEBINFO_POSTFIX
- )
- if(postfix_var STREQUAL "CMAKE_DEBUG_POSTFIX")
- set(_POSTFIX_DEBUG "d")
- else()
- set(_POSTFIX_DEBUG "")
- endif()
-
- set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. libexpat<postfix=[w][d][MD|MT]>.lib")
- endforeach()
-endif()
#
# C library
#
-set(expat_SRCS
+set(_EXPAT_C_SOURCES
lib/xmlparse.c
lib/xmlrole.c
lib/xmltok.c
@@ -304,39 +399,116 @@ set(expat_SRCS
if(EXPAT_SHARED_LIBS)
set(_SHARED SHARED)
- if(MSVC)
- set(expat_SRCS ${expat_SRCS} lib/libexpat.def)
+ if(WIN32)
+ macro(_expat_def_file_toggle source_var target_var)
+ if(${source_var})
+ set(${target_var} " ") # i.e. not commented out, a single space
+ else()
+ set(${target_var} ";") # i.e. commented out
+ endif()
+ endmacro()
+
+ if(EXPAT_DTD OR EXPAT_GE)
+ set(_EXPAT_DTD_OR_GE TRUE)
+ else()
+ set(_EXPAT_DTD_OR_GE FALSE)
+ endif()
+
+ _expat_def_file_toggle(_EXPAT_DTD_OR_GE _EXPAT_COMMENT_DTD_OR_GE)
+ _expat_def_file_toggle(EXPAT_ATTR_INFO _EXPAT_COMMENT_ATTR_INFO)
+
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lib/libexpat.def.cmake" "${CMAKE_CURRENT_BINARY_DIR}/lib/libexpat.def")
+ set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/lib/libexpat.def")
+
+ # Add DLL version
+ string(REPLACE "." "," _EXPAT_DLL_VERSION ${PROJECT_VERSION}.0)
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/win32/version.rc.cmake" "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc")
+ set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc")
endif()
else()
set(_SHARED STATIC)
endif()
-# Avoid colliding with Expat.dll of Perl's XML::Parser::Expat
-if(WIN32 AND NOT MINGW)
- set(_EXPAT_OUTPUT_NAME libexpat) # CMAKE_*_POSTFIX applies, see above
-else()
- if(_EXPAT_UNICODE)
- set(_EXPAT_OUTPUT_NAME expatw)
- else()
- set(_EXPAT_OUTPUT_NAME expat)
- endif()
+add_library(expat ${_SHARED} ${_EXPAT_C_SOURCES} ${_EXPAT_EXTRA_SOURCES})
+add_library(expat::expat ALIAS expat)
+if(_EXPAT_LIBM_FOUND)
+ target_link_libraries(expat m)
endif()
-
-add_library(expat ${_SHARED} ${expat_SRCS})
if(EXPAT_WITH_LIBBSD)
target_link_libraries(expat ${LIB_BSD})
endif()
-set(LIBCURRENT 7) # sync
-set(LIBREVISION 12) # with
-set(LIBAGE 6) # configure.ac!
+#
+# Library filename postfix
+#
+if(_EXPAT_UNICODE)
+ set(_POSTFIX_WIDE "w")
+endif()
+
+if(MSVC AND NOT EXPAT_SHARED_LIBS)
+ if(EXPAT_MSVC_STATIC_CRT)
+ set(_POSTFIX_CRT "MT")
+ else()
+ set(_POSTFIX_CRT "MD")
+ endif()
+endif()
+
+foreach(build_type_upper
+ ${_EXPAT_BUILD_TYPE_UPPER}
+ DEBUG
+ RELEASE
+ MINSIZEREL
+ RELWITHDEBINFO
+ )
+ if(WIN32 AND build_type_upper STREQUAL "DEBUG")
+ set(_POSTFIX_DEBUG "d")
+ else()
+ set(_POSTFIX_DEBUG "") # needs a reset because of being looped
+ endif()
+
+ expat_shy_set(EXPAT_${build_type_upper}_POSTFIX "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Library filename postfix for build type ${build_type_upper}; yields filenames libexpat<postfix=[w][d][MD|MT]>.(dll|dylib|lib|so)")
+ mark_as_advanced(EXPAT_${build_type_upper}_POSTFIX)
+ set_property(TARGET expat PROPERTY ${build_type_upper}_POSTFIX ${EXPAT_${build_type_upper}_POSTFIX})
+endforeach()
+
+set(LIBCURRENT 11) # sync
+set(LIBREVISION 2) # with
+set(LIBAGE 10) # configure.ac!
math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}")
-set_property(TARGET expat PROPERTY OUTPUT_NAME "${_EXPAT_OUTPUT_NAME}")
if(NOT WIN32)
set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME})
+
+ if(APPLE)
+ if(NOT CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
+ message(FATAL_ERROR "Expat requires CMake >=3.17 on platform \"APPLE\".")
+ endif()
+
+ # NOTE: This intends to talk CMake into compatibility with GNU Libtool
+ math(EXPR _EXPAT_MACHO_COMPATIBILITY_VERSION "${LIBCURRENT} + 1")
+ set(_EXPAT_MACHO_CURRENT_VERSION "${_EXPAT_MACHO_COMPATIBILITY_VERSION}.${LIBREVISION}")
+ set_property(TARGET expat PROPERTY MACHO_COMPATIBILITY_VERSION ${_EXPAT_MACHO_COMPATIBILITY_VERSION})
+ set_property(TARGET expat PROPERTY MACHO_CURRENT_VERSION ${_EXPAT_MACHO_CURRENT_VERSION})
+ endif()
+endif()
+
+if(MINGW AND EXPAT_SHARED_LIBS)
+ set_target_properties(expat PROPERTIES SUFFIX "-${LIBCURRENT_MINUS_AGE}.dll")
+endif()
+
+if(WIN32 AND NOT MINGW)
+ # NOTE: This avoids a name collision with Expat.dll of Perl's XML::Parser::Expat
+ # on Windows by resorting to filename libexpat.dll since Expat 1.95.3.
+ # Everything but MSVC is already adding prefix "lib", automatically.
+ # NOTE: "set_property(TARGET expat PROPERTY PREFIX lib)" would only affect *.dll
+ # files but not *.lib files, so we have to rely on property OUTPUT_NAME, instead.
+ # Target property <CONFIG>_POSTFIX still applies.
+ set(_EXPAT_OUTPUT_NAME libexpat)
+ set_property(TARGET expat PROPERTY OUTPUT_NAME ${_EXPAT_OUTPUT_NAME})
+else()
+ set(_EXPAT_OUTPUT_NAME expat)
endif()
target_include_directories(expat
@@ -346,8 +518,8 @@ target_include_directories(expat
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
-if(NOT EXPAT_SHARED_LIBS AND WIN32)
- target_compile_definitions(expat PUBLIC -DXML_STATIC)
+if(WIN32 AND EXPAT_SHARED_LIBS)
+ target_compile_definitions(expat PRIVATE VER_FILEVERSION=${_EXPAT_DLL_VERSION})
endif()
expat_install(TARGETS expat EXPORT expat
@@ -361,12 +533,42 @@ expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL
# pkg-config file
#
if(EXPAT_BUILD_PKGCONFIG)
- set(prefix ${CMAKE_INSTALL_PREFIX})
- set(exec_prefix "\${prefix}")
- set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
- set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
- configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY)
- expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ if(CMAKE_INSTALL_LIBDIR MATCHES "^/")
+ set(_expat_pkgconfig_libdir "${CMAKE_INSTALL_LIBDIR}")
+ else()
+ set(_expat_pkgconfig_libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
+ endif()
+
+ if(CMAKE_INSTALL_INCLUDEDIR MATCHES "^/")
+ set(_expat_pkgconfig_includedir "${CMAKE_INSTALL_INCLUDEDIR}")
+ else()
+ set(_expat_pkgconfig_includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+ endif()
+
+ set_target_properties(expat PROPERTIES
+ pkgconfig_prefix "${CMAKE_INSTALL_PREFIX}"
+ pkgconfig_exec_prefix "\${prefix}"
+ pkgconfig_libdir "${_expat_pkgconfig_libdir}"
+ pkgconfig_includedir "${_expat_pkgconfig_includedir}"
+ pkgconfig_version "${PACKAGE_VERSION}")
+
+ foreach(_build_type ${CMAKE_BUILD_TYPE} Debug Release RelWithDebInfo MinSizeRel)
+ string(TOLOWER "${_build_type}" _build_type_lower)
+ string(TOUPPER "${_build_type}" _build_type_upper)
+ set_property(TARGET expat PROPERTY "pkgconfig_${_build_type_lower}_name" "expat${EXPAT_${_build_type_upper}_POSTFIX}")
+ set_property(TARGET expat PROPERTY "pkgconfig_${_build_type_lower}_output_name" "${_EXPAT_OUTPUT_NAME}${EXPAT_${_build_type_upper}_POSTFIX}")
+ if(_EXPAT_LIBM_FOUND)
+ set_property(TARGET expat PROPERTY "pkgconfig_libm" "-lm")
+ else()
+ set_property(TARGET expat PROPERTY "pkgconfig_libm" "")
+ endif()
+ endforeach()
+
+ file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/expat.pc
+ INPUT ${PROJECT_SOURCE_DIR}/expat.pc.cmake)
+
+ expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
#
@@ -374,20 +576,23 @@ endif()
#
if(EXPAT_BUILD_TOOLS)
set(xmlwf_SRCS
- xmlwf/xmlwf.c
- xmlwf/xmlfile.c
xmlwf/codepage.c
xmlwf/readfilemap.c
+ xmlwf/xmlfile.c
+ xmlwf/xmlwf.c
)
add_executable(xmlwf ${xmlwf_SRCS})
set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf)
target_link_libraries(xmlwf expat)
+ if(_EXPAT_LIBM_FOUND)
+ target_link_libraries(xmlwf m)
+ endif()
expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR})
if(MINGW AND _EXPAT_UNICODE_WCHAR_T)
# https://gcc.gnu.org/onlinedocs/gcc/x86-Windows-Options.html
- set_target_properties(xmlwf PROPERTIES LINK_FLAGS -municode)
+ target_link_options(xmlwf PRIVATE -municode)
endif()
if(EXPAT_BUILD_DOCS)
@@ -409,13 +614,11 @@ endif()
# C code examples
#
if(EXPAT_BUILD_EXAMPLES)
- add_executable(elements examples/elements.c)
- set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
- target_link_libraries(elements expat)
-
- add_executable(outline examples/outline.c)
- set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
- target_link_libraries(outline expat)
+ foreach(_target element_declarations elements outline)
+ add_executable(${_target} examples/${_target}.c)
+ set_property(TARGET ${_target} PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
+ target_link_libraries(${_target} expat)
+ endforeach()
endif()
#
@@ -423,16 +626,8 @@ endif()
#
if(EXPAT_BUILD_TESTS)
## these are unittests that can be run on any platform
- enable_language(CXX)
enable_testing()
- set(test_SRCS
- tests/chardata.c
- tests/memcheck.c
- tests/minicheck.c
- tests/structdata.c
- )
-
if(NOT MSVC)
if(MINGW)
set(host whatever-mingw32) # for nothing but run.sh
@@ -448,17 +643,67 @@ if(EXPAT_BUILD_TESTS)
endif()
endfunction()
- add_executable(runtests tests/runtests.c ${test_SRCS})
- set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
- target_link_libraries(runtests expat)
- expat_add_test(runtests $<TARGET_FILE:runtests>)
+ set(_EXPAT_TEST_TARGETS runtests runtests_cxx)
+
+ add_executable(runtests
+ tests/acc_tests.c
+ tests/alloc_tests.c
+ tests/basic_tests.c
+ tests/chardata.c
+ tests/common.c
+ tests/dummy.c
+ tests/handlers.c
+ tests/memcheck.c
+ tests/minicheck.c
+ tests/misc_tests.c
+ tests/ns_tests.c
+ tests/nsalloc_tests.c
+ tests/runtests.c
+ tests/structdata.c
+ ${_EXPAT_C_SOURCES}
+ )
+
+ add_executable(runtests_cxx
+ tests/acc_tests_cxx.cpp
+ tests/alloc_tests_cxx.cpp
+ tests/basic_tests_cxx.cpp
+ tests/chardata_cxx.cpp
+ tests/common_cxx.cpp
+ tests/dummy_cxx.cpp
+ tests/handlers_cxx.cpp
+ tests/memcheck_cxx.cpp
+ tests/minicheck_cxx.cpp
+ tests/misc_tests_cxx.cpp
+ tests/ns_tests_cxx.cpp
+ tests/nsalloc_tests_cxx.cpp
+ tests/runtests_cxx.cpp
+ tests/structdata_cxx.cpp
+ ${_EXPAT_C_SOURCES}
+ )
+
+ foreach(_target ${_EXPAT_TEST_TARGETS})
+ target_compile_definitions(${_target} PRIVATE -DXML_TESTING)
+
+ set_property(TARGET ${_target} PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
+ expat_add_test(${_target} $<TARGET_FILE:${_target}>)
- add_executable(runtestspp tests/runtestspp.cpp ${test_SRCS})
- set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
- target_link_libraries(runtestspp expat)
- expat_add_test(runtestspp $<TARGET_FILE:runtestspp>)
+ if(_EXPAT_LIBM_FOUND)
+ target_link_libraries(${_target} m)
+ endif()
+
+ if(EXPAT_WITH_LIBBSD)
+ target_link_libraries(${_target} ${LIB_BSD})
+ endif()
+ endforeach()
+
+ add_executable(benchmark tests/benchmark/benchmark.c)
+ set_property(TARGET benchmark PROPERTY RUNTIME_OUTPUT_DIRECTORY tests/benchmark)
+ target_link_libraries(benchmark expat)
endif()
+#
+# Fuzzers
+#
if(EXPAT_BUILD_FUZZERS)
if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
message(SEND_ERROR
@@ -484,14 +729,14 @@ if(EXPAT_BUILD_FUZZERS)
message(SEND_ERROR
"OSS-Fuzz builds require the environment variable "
"LIB_FUZZING_ENGINE to be set. If you are seeing this "
- "warning, it points to a deeper problem in the ossfuzz "
+ "warning, it points to a deeper problem in the OSS-Fuzz "
"build setup.")
endif()
set(encoding_types UTF-16 UTF-8 ISO-8859-1 US-ASCII UTF-16BE UTF-16LE)
set(fuzz_targets xml_parse_fuzzer xml_parsebuffer_fuzzer)
- add_library(fuzzpat STATIC ${expat_SRCS})
+ add_library(fuzzpat STATIC ${_EXPAT_C_SOURCES})
if(NOT EXPAT_OSSFUZZ_BUILD)
target_compile_options(fuzzpat PRIVATE -fsanitize=fuzzer-no-link)
endif()
@@ -503,30 +748,101 @@ if(EXPAT_BUILD_FUZZERS)
target_link_libraries(${target_name} fuzzpat)
target_compile_definitions(${target_name}
PRIVATE ENCODING_FOR_FUZZING=${encoding_type})
- if(NOT EXPAT_OSSFUZZ_BUILD)
- target_compile_options(${target_name} PRIVATE -fsanitize=fuzzer-no-link)
- endif()
- # NOTE: Avoiding target_link_options here only because it needs CMake >=3.13
if(EXPAT_OSSFUZZ_BUILD)
- set_target_properties(${target_name} PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})
+ target_link_options(${target_name} PRIVATE $ENV{LIB_FUZZING_ENGINE})
set_target_properties(${target_name} PROPERTIES LINKER_LANGUAGE "CXX")
else()
- set_target_properties(${target_name} PROPERTIES LINK_FLAGS -fsanitize=fuzzer)
+ target_compile_options(${target_name} PRIVATE -fsanitize=fuzzer)
+ target_link_options(${target_name} PRIVATE -fsanitize=fuzzer)
endif()
set_property(
TARGET ${target_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY fuzz)
endforeach()
endforeach()
+
+ find_package(Protobuf REQUIRED)
+
+ # Only include libprotobuf-mutator here so we don't build it in non-fuzz
+ # configurations.
+ include(ExternalProject)
+
+ set(ProtobufMutator_PREFIX libprotobuf-mutator)
+ set(ProtobufMutator_PATH ${CMAKE_CURRENT_BINARY_DIR}/${ProtobufMutator_PREFIX}/src/${ProtobufMutator_PREFIX})
+ set(ProtobufMutator_BUILD_PATH ${ProtobufMutator_PATH}-build)
+ set(ProtobufMutator_INCLUDE_DIR ${ProtobufMutator_PATH})
+ set(ProtobufMutator_LIBRARIES ${ProtobufMutator_BUILD_PATH}/src/libfuzzer/libprotobuf-mutator-libfuzzer.a ${ProtobufMutator_BUILD_PATH}/src/libprotobuf-mutator.a)
+
+ ExternalProject_Add(
+ ${ProtobufMutator_PREFIX}
+ PREFIX ${ProtobufMutator_PREFIX}
+ GIT_REPOSITORY https://github.com/google/libprotobuf-mutator.git
+ GIT_TAG 57928f41ae52bb27666aa15b310130d086dac245 # v1.4-16-g57928f4
+ CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+ CMAKE_CACHE_ARGS
+ -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
+ -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
+ -DLIB_PROTO_MUTATOR_EXAMPLES:BOOL=OFF
+ -DLIB_PROTO_MUTATOR_TESTING:BOOL=OFF
+ BUILD_BYPRODUCTS ${ProtobufMutator_LIBRARIES}
+ UPDATE_COMMAND true
+ INSTALL_COMMAND true)
+
+ # Check for availability of protobuf compiler to avoid hard-to-understand
+ # errors from make(1) down the line as seen with CMake 3.25.1 on Debian
+ if(NOT Protobuf_PROTOC_EXECUTABLE)
+ message(SEND_ERROR
+ "The protobuf compiler (protoc) could not be found. "
+ "Is it installed and working properly?")
+ endif()
+
+ protobuf_generate_cpp(XML_LPM_FUZZER_PROTO_SRCS
+ XML_LPM_FUZZER_PROTO_HDRS
+ fuzz/xml_lpm_fuzzer.proto)
+
+ add_executable(xml_lpm_fuzzer
+ fuzz/xml_lpm_fuzzer.cpp
+ ${XML_LPM_FUZZER_PROTO_SRCS})
+ target_include_directories(xml_lpm_fuzzer PUBLIC ${ProtobufMutator_INCLUDE_DIR})
+ target_link_libraries(xml_lpm_fuzzer
+ fuzzpat
+ ${ProtobufMutator_LIBRARIES}
+ ${Protobuf_LIBRARIES})
+ add_dependencies(xml_lpm_fuzzer ${ProtobufMutator_PREFIX})
+
+ if(EXPAT_OSSFUZZ_BUILD)
+ target_link_options(xml_lpm_fuzzer PRIVATE $ENV{LIB_FUZZING_ENGINE})
+ else()
+ target_compile_options(xml_lpm_fuzzer PRIVATE -fsanitize=fuzzer)
+ target_link_options(xml_lpm_fuzzer PRIVATE -fsanitize=fuzzer)
+ endif()
+ set_property(TARGET xml_lpm_fuzzer PROPERTY RUNTIME_OUTPUT_DIRECTORY fuzz)
else()
if(EXPAT_OSSFUZZ_BUILD)
message(SEND_ERROR
- "Attempting to perform an ossfuzz build without turning on the fuzzer build. "
+ "Attempting to perform an OSS-Fuzz build without turning on the fuzzer build. "
"This is likely in error - consider adding "
"-DEXPAT_BUILD_FUZZERS=ON to your cmake execution.")
endif()
endif()
#
+# C/C++ config affecting multiple targets
+#
+if(WIN32)
+ set(_EXPAT_STATIC_TARGETS ${_EXPAT_TEST_TARGETS})
+ if(NOT EXPAT_SHARED_LIBS)
+ list(APPEND _EXPAT_STATIC_TARGETS expat)
+ endif()
+ if(EXPAT_BUILD_FUZZERS)
+ list(APPEND _EXPAT_STATIC_TARGETS fuzzpat)
+ endif()
+
+ foreach(_target ${_EXPAT_STATIC_TARGETS})
+ target_compile_definitions(${_target} PUBLIC -DXML_STATIC)
+ endforeach()
+endif()
+
+#
# Custom target "run-xmltest"
#
if(EXPAT_BUILD_TOOLS AND NOT MSVC)
@@ -656,20 +972,25 @@ elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t")
else()
set(_EXPAT_CHAR_TYPE_SUMMARY "ERROR")
endif()
-string(TOUPPER "${CMAKE_BUILD_TYPE}" _EXPAT_BUILD_TYPE_UPPER)
+get_property(_EXPAT_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
message(STATUS "===========================================================================")
message(STATUS "")
message(STATUS "Configuration")
+message(STATUS " Generator .................. ${CMAKE_GENERATOR}")
+if(_EXPAT_GENERATOR_IS_MULTI_CONFIG)
+ message(STATUS " Build types ................ ${CMAKE_CONFIGURATION_TYPES}")
+else()
+ message(STATUS " Build type ................. ${CMAKE_BUILD_TYPE}")
+endif()
message(STATUS " Prefix ..................... ${CMAKE_INSTALL_PREFIX}")
-message(STATUS " Build type ................. ${CMAKE_BUILD_TYPE}")
message(STATUS " Shared libraries ........... ${EXPAT_SHARED_LIBS}")
if(MSVC)
message(STATUS " Static CRT ................. ${EXPAT_MSVC_STATIC_CRT}")
endif()
message(STATUS " Character type ............. ${_EXPAT_CHAR_TYPE_SUMMARY}")
-if(WIN32)
- message(STATUS " Binary postfix ............. ${CMAKE_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}")
+if(NOT _EXPAT_GENERATOR_IS_MULTI_CONFIG)
+ message(STATUS " Library name postfix ....... ${EXPAT_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}")
endif()
message(STATUS "")
message(STATUS " Build documentation ........ ${EXPAT_BUILD_DOCS}")
@@ -685,6 +1006,7 @@ message(STATUS " // Advanced options, changes not advised")
message(STATUS " Attributes info .......... ${EXPAT_ATTR_INFO}")
message(STATUS " Context bytes ............ ${EXPAT_CONTEXT_BYTES}")
message(STATUS " DTD support .............. ${EXPAT_DTD}")
+message(STATUS " General entities ......... ${EXPAT_GE}")
message(STATUS " Large size ............... ${EXPAT_LARGE_SIZE}")
message(STATUS " Minimum size ............. ${EXPAT_MIN_SIZE}")
message(STATUS " Namespace support ........ ${EXPAT_NS}")
diff --git a/3rdparty/expat/COPYING b/3rdparty/expat/COPYING
index 3c0142e71c8..c6d184a8aae 100644
--- a/3rdparty/expat/COPYING
+++ b/3rdparty/expat/COPYING
@@ -1,5 +1,5 @@
Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
-Copyright (c) 2001-2019 Expat maintainers
+Copyright (c) 2001-2025 Expat maintainers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/3rdparty/expat/Changes b/3rdparty/expat/Changes
index b74a7c56a96..9d6c64b6a46 100644
--- a/3rdparty/expat/Changes
+++ b/3rdparty/expat/Changes
@@ -1,6 +1,861 @@
-NOTE: We are looking for help with a few things:
- https://github.com/libexpat/libexpat/labels/help%20wanted
- If you can help, please get in touch. Thanks!
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!! <blink>Expat is UNDERSTAFFED and WITHOUT FUNDING.</blink> !!
+!! ~~~~~~~~~~~~ !!
+!! The following topics need *additional skilled C developers* to progress !!
+!! in a timely manner or at all (loosely ordered by descending priority): !!
+!! !!
+!! - teaming up on researching and fixing future security reports and !!
+!! ClusterFuzz findings with few-days-max response times in communication !!
+!! in order to (1) have a sound fix ready before the end of a 90 days !!
+!! grace period and (2) in a sustainable manner, !!
+!! - helping CPython Expat bindings with supporting Expat's billion laughs !!
+!! attack protection API (https://github.com/python/cpython/issues/90949): !!
+!! - XML_SetBillionLaughsAttackProtectionActivationThreshold !!
+!! - XML_SetBillionLaughsAttackProtectionMaximumAmplification !!
+!! - helping Perl's XML::Parser Expat bindings with supporting Expat's !!
+!! security API (https://github.com/cpan-authors/XML-Parser/issues/102): !!
+!! - XML_SetBillionLaughsAttackProtectionActivationThreshold !!
+!! - XML_SetBillionLaughsAttackProtectionMaximumAmplification !!
+!! - XML_SetReparseDeferralEnabled !!
+!! - implementing and auto-testing XML 1.0r5 support !!
+!! (needs discussion before pull requests), !!
+!! - smart ideas on fixing the Autotools CMake files generation issue !!
+!! without breaking CI (needs discussion before pull requests), !!
+!! - pushing migration from `int` to `size_t` further !!
+!! including edge-cases test coverage (needs discussion before anything). !!
+!! !!
+!! For details, please reach out via e-mail to sebastian@pipping.org so we !!
+!! can schedule a voice call on the topic, in English or German. !!
+!! !!
+!! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+Release 2.7.1 Thu March 27 2025
+ Bug fixes:
+ #980 #989 Restore event pointer behavior from Expat 2.6.4
+ (that the fix to CVE-2024-8176 changed in 2.7.0);
+ affected API functions are:
+ - XML_GetCurrentByteCount
+ - XML_GetCurrentByteIndex
+ - XML_GetCurrentColumnNumber
+ - XML_GetCurrentLineNumber
+ - XML_GetInputContext
+
+ Other changes:
+ #976 #977 Autotools: Integrate files "fuzz/xml_lpm_fuzzer.{cpp,proto}"
+ with Automake that were missing from 2.7.0 release tarballs
+ #983 #984 Fix printf format specifiers for 32bit Emscripten
+ #992 docs: Promote OpenSSF Best Practices self-certification
+ #978 tests/benchmark: Resolve mistaken double close
+ #986 Address compiler warnings
+ #990 #993 Version info bumped from 11:1:10 (libexpat*.so.1.10.1)
+ to 11:2:10 (libexpat*.so.1.10.2); see https://verbump.de/
+ for what these numbers do
+
+ Infrastructure:
+ #982 CI: Start running Perl XML::Parser integration tests
+ #987 CI: Enforce Clang Static Analyzer clean code
+ #991 CI: Re-enable warning clang-analyzer-valist.Uninitialized
+ for clang-tidy
+ #981 CI: Cover compilation with musl
+ #983 #984 CI: Cover compilation with 32bit Emscripten
+ #976 #977 CI: Protect against fuzzer files missing from future
+ release archives
+
+ Special thanks to:
+ Berkay Eren Ürün
+ Matthew Fernandez
+ and
+ Perl XML::Parser
+
+Release 2.7.0 Thu March 13 2025
+ Security fixes:
+ #893 #973 CVE-2024-8176 -- Fix crash from chaining a large number
+ of entities caused by stack overflow by resolving use of
+ recursion, for all three uses of entities:
+ - general entities in character data ("<e>&g1;</e>")
+ - general entities in attribute values ("<e k1='&g1;'/>")
+ - parameter entities ("%p1;")
+ Known impact is (reliable and easy) denial of service:
+ CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H/E:H/RL:O/RC:C
+ (Base Score: 7.5, Temporal Score: 7.2)
+ Please note that a layer of compression around XML can
+ significantly reduce the minimum attack payload size.
+
+ Other changes:
+ #935 #937 Autotools: Make generated CMake files look for
+ libexpat.@SO_MAJOR@.dylib on macOS
+ #925 Autotools: Sync CMake templates with CMake 3.29
+ #945 #962 #966 CMake: Drop support for CMake <3.13
+ #942 CMake: Small fuzzing related improvements
+ #921 docs: Add missing documentation of error code
+ XML_ERROR_NOT_STARTED that was introduced with 2.6.4
+ #941 docs: Document need for C++11 compiler for use from C++
+ #959 tests/benchmark: Fix a (harmless) TOCTTOU
+ #944 Windows: Fix installer target location of file xmlwf.xml
+ for CMake
+ #953 Windows: Address warning -Wunknown-warning-option
+ about -Wno-pedantic-ms-format from LLVM MinGW
+ #971 Address Cppcheck warnings
+ #969 #970 Mass-migrate links from http:// to https://
+ #947 #958 ..
+ #974 #975 Document changes since the previous release
+ #974 #975 Version info bumped from 11:0:10 (libexpat*.so.1.10.0)
+ to 11:1:10 (libexpat*.so.1.10.1); see https://verbump.de/
+ for what these numbers do
+
+ Infrastructure:
+ #926 tests: Increase robustness
+ #927 #932 ..
+ #930 #933 tests: Increase test coverage
+ #617 #950 ..
+ #951 #952 ..
+ #954 #955 .. Fuzzing: Add new fuzzer "xml_lpm_fuzzer" based on
+ #961 Google's libprotobuf-mutator ("LPM")
+ #957 Fuzzing|CI: Start producing fuzzing code coverage reports
+ #936 CI: Pass -q -q for LCOV >=2.1 in coverage.sh
+ #942 CI: Small fuzzing related improvements
+ #139 #203 ..
+ #791 #946 CI: Make GitHub Actions build using MSVC on Windows and
+ produce 32bit and 64bit Windows binaries
+ #956 CI: Get off of about-to-be-removed Ubuntu 20.04
+ #960 #964 CI: Start uploading to Coverity Scan for static analysis
+ #972 CI: Stop loading DTD from the internet to address flaky CI
+ #971 CI: Adapt to breaking changes in Cppcheck
+
+ Special thanks to:
+ Alexander Gieringer
+ Berkay Eren Ürün
+ Hanno Böck
+ Jann Horn
+ Mark Brand
+ Sebastian Andrzej Siewior
+ Snild Dolkow
+ Thomas Pröll
+ Tomas Korbar
+ valord577
+ and
+ Google Project Zero
+ Linutronix
+ Red Hat
+ Siemens
+
+Release 2.6.4 Wed November 6 2024
+ Security fixes:
+ #915 CVE-2024-50602 -- Fix crash within function XML_ResumeParser
+ from a NULL pointer dereference by disallowing function
+ XML_StopParser to (stop or) suspend an unstarted parser.
+ A new error code XML_ERROR_NOT_STARTED was introduced to
+ properly communicate this situation. // CWE-476 CWE-754
+
+ Other changes:
+ #903 CMake: Add alias target "expat::expat"
+ #905 docs: Document use via CMake >=3.18 with FetchContent
+ and SOURCE_SUBDIR and its consequences
+ #902 tests: Reduce use of global parser instance
+ #904 tests: Resolve duplicate handler
+ #317 #918 tests: Improve tests on doctype closing (ex CVE-2019-15903)
+ #914 Fix signedness of format strings
+ #915 For use from C++, expat.h started requiring C++11 due to
+ use of C99 features
+ #919 #920 Version info bumped from 10:3:9 (libexpat*.so.1.9.3)
+ to 11:0:10 (libexpat*.so.1.10.0); see https://verbump.de/
+ for what these numbers do
+
+ Infrastructure:
+ #907 CI: Upgrade Clang from 18 to 19
+ #913 CI: Drop macos-12 and add macos-15
+ #910 CI: Adapt to breaking changes in GitHub Actions
+ #898 Add missing entries to .gitignore
+
+ Special thanks to:
+ Hanno Böck
+ José Eduardo Gutiérrez Conejo
+ José Ricardo Cardona Quesada
+
+Release 2.6.3 Wed September 4 2024
+ Security fixes:
+ #887 #890 CVE-2024-45490 -- Calling function XML_ParseBuffer with
+ len < 0 without noticing and then calling XML_GetBuffer
+ will have XML_ParseBuffer fail to recognize the problem
+ and XML_GetBuffer corrupt memory.
+ With the fix, XML_ParseBuffer now complains with error
+ XML_ERROR_INVALID_ARGUMENT just like sibling XML_Parse
+ has been doing since Expat 2.2.1, and now documented.
+ Impact is denial of service to potentially artitrary code
+ execution.
+ #888 #891 CVE-2024-45491 -- Internal function dtdCopy can have an
+ integer overflow for nDefaultAtts on 32-bit platforms
+ (where UINT_MAX equals SIZE_MAX).
+ Impact is denial of service to potentially artitrary code
+ execution.
+ #889 #892 CVE-2024-45492 -- Internal function nextScaffoldPart can
+ have an integer overflow for m_groupSize on 32-bit
+ platforms (where UINT_MAX equals SIZE_MAX).
+ Impact is denial of service to potentially artitrary code
+ execution.
+
+ Other changes:
+ #851 #879 Autotools: Sync CMake templates with CMake 3.28
+ #853 Autotools: Always provide path to find(1) for portability
+ #861 Autotools: Ensure that the m4 directory always exists.
+ #870 Autotools: Simplify handling of SIZEOF_VOID_P
+ #869 Autotools: Support non-GNU sed
+ #856 Autotools|CMake: Fix main() to main(void)
+ #865 Autotools|CMake: Fix compile tests for HAVE_SYSCALL_GETRANDOM
+ #863 Autotools|CMake: Stop requiring dos2unix
+ #854 #855 CMake: Fix check for symbols size_t and off_t
+ #864 docs|tests: Convert README to Markdown and update
+ #741 Windows: Drop support for Visual Studio <=15.0/2017
+ #886 Drop needless XML_DTD guards around is_param access
+ #885 Fix typo in a code comment
+ #894 #896 Version info bumped from 10:2:9 (libexpat*.so.1.9.2)
+ to 10:3:9 (libexpat*.so.1.9.3); see https://verbump.de/
+ for what these numbers do
+
+ Infrastructure:
+ #880 Readme: Promote the call for help
+ #868 CI: Fix various issues
+ #849 CI: Allow triggering GitHub Actions workflows manually
+ #851 #872 ..
+ #873 #879 CI: Adapt to breaking changes in GitHub Actions
+
+ Special thanks to:
+ Alexander Bluhm
+ Berkay Eren Ürün
+ Dag-Erling Smørgrav
+ Ferenc Géczi
+ TaiYou
+
+Release 2.6.2 Wed March 13 2024
+ Security fixes:
+ #839 #842 CVE-2024-28757 -- Prevent billion laughs attacks with
+ isolated use of external parsers. Please see the commit
+ message of commit 1d50b80cf31de87750103656f6eb693746854aa8
+ for details.
+
+ Bug fixes:
+ #839 #841 Reject direct parameter entity recursion
+ and avoid the related undefined behavior
+
+ Other changes:
+ #847 Autotools: Fix build for DOCBOOK_TO_MAN containing spaces
+ #837 Add missing #821 and #824 to 2.6.1 change log
+ #838 #843 Version info bumped from 10:1:9 (libexpat*.so.1.9.1)
+ to 10:2:9 (libexpat*.so.1.9.2); see https://verbump.de/
+ for what these numbers do
+
+ Special thanks to:
+ Philippe Antoine
+ Tomas Korbar
+ and
+ Clang UndefinedBehaviorSanitizer
+ OSS-Fuzz / ClusterFuzz
+
+Release 2.6.1 Thu February 29 2024
+ Bug fixes:
+ #817 Make tests independent of CPU speed, and thus more robust
+ #828 #836 Expose billion laughs API with XML_DTD defined and
+ XML_GE undefined, regression from 2.6.0
+
+ Other changes:
+ #829 Hide test-only code behind new internal macro
+ #833 Autotools: Reject expat_config.h.in defining SIZEOF_VOID_P
+ #821 #824 Autotools: Fix "make clean" for case:
+ ./configure --without-docbook && make clean all
+ #819 Address compiler warnings
+ #832 #834 Version info bumped from 10:0:9 (libexpat*.so.1.9.0)
+ to 10:1:9 (libexpat*.so.1.9.1); see https://verbump.de/
+ for what these numbers do
+
+ Infrastructure:
+ #818 CI: Adapt to breaking changes in clang-format
+
+ Special thanks to:
+ David Hall
+ Snild Dolkow
+
+Release 2.6.0 Tue February 6 2024
+ Security fixes:
+ #789 #814 CVE-2023-52425 -- Fix quadratic runtime issues with big tokens
+ that can cause denial of service, in partial where
+ dealing with compressed XML input. Applications
+ that parsed a document in one go -- a single call to
+ functions XML_Parse or XML_ParseBuffer -- were not affected.
+ The smaller the chunks/buffers you use for parsing
+ previously, the bigger the problem prior to the fix.
+ Backporters should be careful to no omit parts of
+ pull request #789 and to include earlier pull request #771,
+ in order to not break the fix.
+ #777 CVE-2023-52426 -- Fix billion laughs attacks for users
+ compiling *without* XML_DTD defined (which is not common).
+ Users with XML_DTD defined have been protected since
+ Expat >=2.4.0 (and that was CVE-2013-0340 back then).
+
+ Bug fixes:
+ #753 Fix parse-size-dependent "invalid token" error for
+ external entities that start with a byte order mark
+ #780 Fix NULL pointer dereference in setContext via
+ XML_ExternalEntityParserCreate for compilation with
+ XML_DTD undefined
+ #812 #813 Protect against closing entities out of order
+
+ Other changes:
+ #723 Improve support for arc4random/arc4random_buf
+ #771 #788 Improve buffer growth in XML_GetBuffer and XML_Parse
+ #761 #770 xmlwf: Support --help and --version
+ #759 #770 xmlwf: Support custom buffer size for XML_GetBuffer and read
+ #744 xmlwf: Improve language and URL clickability in help output
+ #673 examples: Add new example "element_declarations.c"
+ #764 Be stricter about macro XML_CONTEXT_BYTES at build time
+ #765 Make inclusion to expat_config.h consistent
+ #726 #727 Autotools: configure.ac: Support --disable-maintainer-mode
+ #678 #705 ..
+ #706 #733 #792 Autotools: Sync CMake templates with CMake 3.26
+ #795 Autotools: Make installation of shipped man page doc/xmlwf.1
+ independent of docbook2man availability
+ #815 Autotools|CMake: Add missing -DXML_STATIC to pkg-config file
+ section "Cflags.private" in order to fix compilation
+ against static libexpat using pkg-config on Windows
+ #724 #751 Autotools|CMake: Require a C99 compiler
+ (a de-facto requirement already since Expat 2.2.2 of 2017)
+ #793 Autotools|CMake: Fix PACKAGE_BUGREPORT variable
+ #750 #786 Autotools|CMake: Make test suite require a C++11 compiler
+ #749 CMake: Require CMake >=3.5.0
+ #672 CMake: Lowercase off_t and size_t to help a bug in Meson
+ #746 CMake: Sort xmlwf sources alphabetically
+ #785 CMake|Windows: Fix generation of DLL file version info
+ #790 CMake: Build tests/benchmark/benchmark.c as well for
+ a build with -DEXPAT_BUILD_TESTS=ON
+ #745 #757 docs: Document the importance of isFinal + adjust tests
+ accordingly
+ #736 docs: Improve use of "NULL" and "null"
+ #713 docs: Be specific about version of XML (XML 1.0r4)
+ and version of C (C99); (XML 1.0r5 will need a sponsor.)
+ #762 docs: reference.html: Promote function XML_ParseBuffer more
+ #779 docs: reference.html: Add HTML anchors to XML_* macros
+ #760 docs: reference.html: Upgrade to OK.css 1.2.0
+ #763 #739 docs: Fix typos
+ #696 docs|CI: Use HTTPS URLs instead of HTTP at various places
+ #669 #670 ..
+ #692 #703 ..
+ #733 #772 Address compiler warnings
+ #798 #800 Address clang-tidy warnings
+ #775 #776 Version info bumped from 9:10:8 (libexpat*.so.1.8.10)
+ to 10:0:9 (libexpat*.so.1.9.0); see https://verbump.de/
+ for what these numbers do
+
+ Infrastructure:
+ #700 #701 docs: Document security policy in file SECURITY.md
+ #766 docs: Improve parse buffer variables in-code documentation
+ #674 #738 ..
+ #740 #747 ..
+ #748 #781 #782 Refactor coverage and conformance tests
+ #714 #716 Refactor debug level variables to unsigned long
+ #671 Improve handling of empty environment variable value
+ in function getDebugLevel (without visible user effect)
+ #755 #774 ..
+ #758 #783 ..
+ #784 #787 tests: Improve test coverage with regard to parse chunk size
+ #660 #797 #801 Fuzzing: Improve fuzzing coverage
+ #367 #799 Fuzzing|CI: Start running OSS-Fuzz fuzzing regression tests
+ #698 #721 CI: Resolve some Travis CI leftovers
+ #669 CI: Be robust towards absence of Git tags
+ #693 #694 CI: Set permissions to "contents: read" for security
+ #709 CI: Pin all GitHub Actions to specific commits for security
+ #739 CI: Reject spelling errors using codespell
+ #798 CI: Enforce clang-tidy clean code
+ #773 #808 ..
+ #809 #810 CI: Upgrade Clang from 15 to 18
+ #796 CI: Start using Clang's Control Flow Integrity sanitizer
+ #675 #720 #722 CI: Adapt to breaking changes in GitHub Actions Ubuntu images
+ #689 CI: Adapt to breaking changes in Clang/LLVM Debian packaging
+ #763 CI: Adapt to breaking changes in codespell
+ #803 CI: Adapt to breaking changes in Cppcheck
+
+ Special thanks to:
+ Ivan Galkin
+ Joyce Brum
+ Philippe Antoine
+ Rhodri James
+ Snild Dolkow
+ spookyahell
+ Steven Garske
+ and
+ Clang AddressSanitizer
+ Clang UndefinedBehaviorSanitizer
+ codespell
+ GCC Farm Project
+ OSS-Fuzz
+ Sony Mobile
+
+Release 2.5.0 Tue October 25 2022
+ Security fixes:
+ #616 #649 #650 CVE-2022-43680 -- Fix heap use-after-free after overeager
+ destruction of a shared DTD in function
+ XML_ExternalEntityParserCreate in out-of-memory situations.
+ Expected impact is denial of service or potentially
+ arbitrary code execution.
+
+ Bug fixes:
+ #612 #645 Fix corruption from undefined entities
+ #613 #654 Fix case when parsing was suspended while processing nested
+ entities
+ #616 #652 #653 Stop leaking opening tag bindings after a closing tag
+ mismatch error where a parser is reset through
+ XML_ParserReset and then reused to parse
+ #656 CMake: Fix generation of pkg-config file
+ #658 MinGW|CMake: Fix static library name
+
+ Other changes:
+ #663 Protect header expat_config.h from multiple inclusion
+ #666 examples: Make use of XML_GetBuffer and be more
+ consistent across examples
+ #648 Address compiler warnings
+ #667 #668 Version info bumped from 9:9:8 to 9:10:8;
+ see https://verbump.de/ for what these numbers do
+
+ Special thanks to:
+ Jann Horn
+ Mark Brand
+ Osyotr
+ Rhodri James
+ and
+ Google Project Zero
+
+Release 2.4.9 Tue September 20 2022
+ Security fixes:
+ #629 #640 CVE-2022-40674 -- Heap use-after-free vulnerability in
+ function doContent. Expected impact is denial of service
+ or potentially arbitrary code execution.
+
+ Bug fixes:
+ #634 MinGW: Fix mis-compilation for -D__USE_MINGW_ANSI_STDIO=0
+ #614 docs: Fix documentation on effect of switch XML_DTD on
+ symbol visibility in doc/reference.html
+
+ Other changes:
+ #638 MinGW: Make fix-xmltest-log.sh drop more Wine bug output
+ #596 #625 Autotools: Sync CMake templates with CMake 3.22
+ #608 CMake: Migrate from use of CMAKE_*_POSTFIX to
+ dedicated variables EXPAT_*_POSTFIX to stop affecting
+ other projects
+ #597 #599 Windows|CMake: Add missing -DXML_STATIC to test runners
+ and fuzzers
+ #512 #621 Windows|CMake: Render .def file from a template to fix
+ linking with -DEXPAT_DTD=OFF and/or -DEXPAT_ATTR_INFO=ON
+ #611 #621 MinGW|CMake: Apply MSVC .def file when linking
+ #622 #624 MinGW|CMake: Sync library name with GNU Autotools,
+ i.e. produce libexpat-1.dll rather than libexpat.dll
+ by default. Filename libexpat.dll.a is unaffected.
+ #632 MinGW|CMake: Set missing variable CMAKE_RC_COMPILER in
+ toolchain file "cmake/mingw-toolchain.cmake" to avoid
+ error "windres: Command not found" on e.g. Ubuntu 20.04
+ #597 #627 CMake: Unify inconsistent use of set() and option() in
+ context of public build time options to take need for
+ set(.. FORCE) in projects using Expat by means of
+ add_subdirectory(..) off Expat's users' shoulders
+ #626 #641 Stop exporting API symbols when building a static library
+ #644 Resolve use of deprecated "fgrep" by "grep -F"
+ #620 CMake: Make documentation on variables a bit more consistent
+ #636 CMake: Drop leading whitespace from a #cmakedefine line in
+ file expat_config.h.cmake
+ #594 xmlwf: Fix harmless variable mix-up in function nsattcmp
+ #592 #593 #610 Address Cppcheck warnings
+ #643 Address Clang 15 compiler warnings
+ #642 #644 Version info bumped from 9:8:8 to 9:9:8;
+ see https://verbump.de/ for what these numbers do
+
+ Infrastructure:
+ #597 #598 CI: Windows: Start covering MSVC 2022
+ #619 CI: macOS: Migrate off deprecated macOS 10.15
+ #632 CI: Linux: Make migration off deprecated Ubuntu 18.04 work
+ #643 CI: Upgrade Clang from 14 to 15
+ #637 apply-clang-format.sh: Add support for BSD find
+ #633 coverage.sh: Exclude MinGW headers
+ #635 coverage.sh: Fix name collision for -funsigned-char
+
+ Special thanks to:
+ David Faure
+ Felix Wilhelm
+ Frank Bergmann
+ Rhodri James
+ Rosen Penev
+ Thijs Schreijer
+ Vincent Torri
+ and
+ Google Project Zero
+
+Release 2.4.8 Mon March 28 2022
+ Other changes:
+ #587 pkg-config: Move "-lm" to section "Libs.private"
+ #587 CMake|MSVC: Fix pkg-config section "Libs"
+ #55 #582 CMake|macOS: Start using linker arguments
+ "-compatibility_version <version>" and
+ "-current_version <version>" in a way compatible with
+ GNU Libtool
+ #590 #591 Version info bumped from 9:7:8 to 9:8:8;
+ see https://verbump.de/ for what these numbers do
+
+ Infrastructure:
+ #589 CI: Upgrade Clang from 13 to 14
+
+ Special thanks to:
+ evpobr
+ Kai Pastor
+ Sam James
+
+Release 2.4.7 Fri March 4 2022
+ Bug fixes:
+ #572 #577 Relax fix to CVE-2022-25236 (introduced with release 2.4.5)
+ with regard to all valid URI characters (RFC 3986),
+ i.e. the following set (excluding whitespace):
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
+ 0123456789 % -._~ :/?#[]@ !$&'()*+,;=
+
+ Other changes:
+ #555 #570 #581 CMake|Windows: Store Expat version in the DLL
+ #577 Document consequences of namespace separator choices not just
+ in doc/reference.html but also in header <expat.h>
+ #577 Document Expat's lack of validation of namespace URIs against
+ RFC 3986, and that the XML 1.0r4 specification doesn't
+ require Expat to validate namespace URIs, and that Expat
+ may do more in that regard in future releases.
+ If you find need for strict RFC 3986 URI validation on
+ application level today, https://uriparser.github.io/ may
+ be of interest.
+ #579 Fix documentation of XML_EndDoctypeDeclHandler in <expat.h>
+ #575 Document that a call to XML_FreeContentModel can be done at
+ a later time from outside the element declaration handler
+ #574 Make hardcoded namespace URIs easier to find in code
+ #573 Update documentation on use of XML_POOR_ENTOPY on Solaris
+ #569 #571 tests: Resolve use of macros NAN and INFINITY for GNU G++
+ 4.8.2 on Solaris.
+ #578 #580 Version info bumped from 9:6:8 to 9:7:8;
+ see https://verbump.de/ for what these numbers do
+
+ Special thanks to:
+ Jeffrey Walton
+ Johnny Jazeix
+ Thijs Schreijer
+
+Release 2.4.6 Sun February 20 2022
+ Bug fixes:
+ #566 Fix a regression introduced by the fix for CVE-2022-25313
+ in release 2.4.5 that affects applications that (1)
+ call function XML_SetElementDeclHandler and (2) are
+ parsing XML that contains nested element declarations
+ (e.g. "<!ELEMENT junk ((bar|foo|xyz+), zebra*)>").
+
+ Other changes:
+ #567 #568 Version info bumped from 9:5:8 to 9:6:8;
+ see https://verbump.de/ for what these numbers do
+
+ Special thanks to:
+ Matt Sergeant
+ Samanta Navarro
+ Sergei Trofimovich
+ and
+ NixOS
+ Perl XML::Parser
+
+Release 2.4.5 Fri February 18 2022
+ Security fixes:
+ #562 CVE-2022-25235 -- Passing malformed 2- and 3-byte UTF-8
+ sequences (e.g. from start tag names) to the XML
+ processing application on top of Expat can cause
+ arbitrary damage (e.g. code execution) depending
+ on how invalid UTF-8 is handled inside the XML
+ processor; validation was not their job but Expat's.
+ Exploits with code execution are known to exist.
+ #561 CVE-2022-25236 -- Passing (one or more) namespace separator
+ characters in "xmlns[:prefix]" attribute values
+ made Expat send malformed tag names to the XML
+ processor on top of Expat which can cause
+ arbitrary damage (e.g. code execution) depending
+ on such unexpectable cases are handled inside the XML
+ processor; validation was not their job but Expat's.
+ Exploits with code execution are known to exist.
+ #558 CVE-2022-25313 -- Fix stack exhaustion in doctype parsing
+ that could be triggered by e.g. a 2 megabytes
+ file with a large number of opening braces.
+ Expected impact is denial of service or potentially
+ arbitrary code execution.
+ #560 CVE-2022-25314 -- Fix integer overflow in function copyString;
+ only affects the encoding name parameter at parser creation
+ time which is often hardcoded (rather than user input),
+ takes a value in the gigabytes to trigger, and a 64-bit
+ machine. Expected impact is denial of service.
+ #559 CVE-2022-25315 -- Fix integer overflow in function storeRawNames;
+ needs input in the gigabytes and a 64-bit machine.
+ Expected impact is denial of service or potentially
+ arbitrary code execution.
+
+ Other changes:
+ #557 #564 Version info bumped from 9:4:8 to 9:5:8;
+ see https://verbump.de/ for what these numbers do
+
+ Special thanks to:
+ Ivan Fratric
+ Samanta Navarro
+ and
+ Google Project Zero
+ JetBrains
+
+Release 2.4.4 Sun January 30 2022
+ Security fixes:
+ #550 CVE-2022-23852 -- Fix signed integer overflow
+ (undefined behavior) in function XML_GetBuffer
+ (that is also called by function XML_Parse internally)
+ for when XML_CONTEXT_BYTES is defined to >0 (which is both
+ common and default).
+ Impact is denial of service or more.
+ #551 CVE-2022-23990 -- Fix unsigned integer overflow in function
+ doProlog triggered by large content in element type
+ declarations when there is an element declaration handler
+ present (from a prior call to XML_SetElementDeclHandler).
+ Impact is denial of service or more.
+
+ Bug fixes:
+ #544 #545 xmlwf: Fix a memory leak on output file opening error
+
+ Other changes:
+ #546 Autotools: Fix broken CMake support under Cygwin
+ #554 Windows: Add missing files to the installer to fix
+ compilation with CMake from installed sources
+ #552 #554 Version info bumped from 9:3:8 to 9:4:8;
+ see https://verbump.de/ for what these numbers do
+
+ Special thanks to:
+ Carlo Bramini
+ hwt0415
+ Roland Illig
+ Samanta Navarro
+ and
+ Clang LeakSan and the Clang team
+
+Release 2.4.3 Sun January 16 2022
+ Security fixes:
+ #531 #534 CVE-2021-45960 -- Fix issues with left shifts by >=29 places
+ resulting in
+ a) realloc acting as free
+ b) realloc allocating too few bytes
+ c) undefined behavior
+ depending on architecture and precise value
+ for XML documents with >=2^27+1 prefixed attributes
+ on a single XML tag a la
+ "<r xmlns:a='[..]' a:a123='[..]' [..] />"
+ where XML_ParserCreateNS is used to create the parser
+ (which needs argument "-n" when running xmlwf).
+ Impact is denial of service, or more.
+ #532 #538 CVE-2021-46143 (ZDI-CAN-16157) -- Fix integer overflow
+ on variable m_groupSize in function doProlog leading
+ to realloc acting as free.
+ Impact is denial of service or more.
+ #539 CVE-2022-22822 to CVE-2022-22827 -- Prevent integer overflows
+ near memory allocation at multiple places. Mitre assigned
+ a dedicated CVE for each involved internal C function:
+ - CVE-2022-22822 for function addBinding
+ - CVE-2022-22823 for function build_model
+ - CVE-2022-22824 for function defineAttribute
+ - CVE-2022-22825 for function lookup
+ - CVE-2022-22826 for function nextScaffoldPart
+ - CVE-2022-22827 for function storeAtts
+ Impact is denial of service or more.
+
+ Other changes:
+ #535 CMake: Make call to file(GENERATE [..]) work for CMake <3.19
+ #541 Autotools|CMake: MinGW: Make run.sh(.in) work for Cygwin
+ and MSYS2 by not going through Wine on these platforms
+ #527 #528 Address compiler warnings
+ #533 #543 Version info bumped from 9:2:8 to 9:3:8;
+ see https://verbump.de/ for what these numbers do
+
+ Infrastructure:
+ #536 CI: Check for realistic minimum CMake version
+ #529 #539 CI: Cover compilation with -m32
+ #529 CI: Store coverage reports as artifacts for download
+ #528 CI: Upgrade Clang from 11 to 13
+
+ Special thanks to:
+ An anonymous whitehat
+ Christopher Degawa
+ J. Peter Mugaas
+ Tyson Smith
+ and
+ GCC Farm Project
+ Trend Micro Zero Day Initiative
+
+Release 2.4.2 Sun December 19 2021
+ Other changes:
+ #509 #510 Link againgst libm for function "isnan"
+ #513 #514 Include expat_config.h as early as possible
+ #498 Autotools: Include files with release archives:
+ - buildconf.sh
+ - fuzz/*.c
+ #507 #519 Autotools: Sync CMake templates with CMake 3.20
+ #495 #524 CMake: MinGW: Fix pkg-config section "Libs" for
+ - non-release build types (e.g. -DCMAKE_BUILD_TYPE=Debug)
+ - multi-config CMake generators (e.g. Ninja Multi-Config)
+ #502 #503 docs: Document that function XML_GetBuffer may return NULL
+ when asking for a buffer of 0 (zero) bytes size
+ #522 #523 docs: Fix return value docs for both
+ XML_SetBillionLaughsAttackProtection* functions
+ #525 #526 Version info bumped from 9:1:8 to 9:2:8;
+ see https://verbump.de/ for what these numbers do
+
+ Special thanks to:
+ Donghee Na
+ Joergen Ibsen
+ Kai Pastor
+
+Release 2.4.1 Sun May 23 2021
+ Bug fixes:
+ #488 #490 Autotools: Fix installed header expat_config.h for multilib
+ systems; regression introduced in 2.4.0 by pull request #486
+
+ Other changes:
+ #491 #492 Version info bumped from 9:0:8 to 9:1:8;
+ see https://verbump.de/ for what these numbers do
+
+ Special thanks to:
+ Gentoo's QA check "multilib_check_headers"
+
+Release 2.4.0 Sun May 23 2021
+ Security fixes:
+ #34 #466 #484 CVE-2013-0340/CWE-776 -- Protect against billion laughs attacks
+ (denial-of-service; flavors targeting CPU time or RAM or both,
+ leveraging general entities or parameter entities or both)
+ by tracking and limiting the input amplification factor
+ (<amplification> := (<direct> + <indirect>) / <direct>).
+ By conservative default, amplification up to a factor of 100.0
+ is tolerated and rejection only starts after 8 MiB of output bytes
+ (=<direct> + <indirect>) have been processed.
+ The fix adds the following to the API:
+ - A new error code XML_ERROR_AMPLIFICATION_LIMIT_BREACH to
+ signals this specific condition.
+ - Two new API functions ..
+ - XML_SetBillionLaughsAttackProtectionMaximumAmplification and
+ - XML_SetBillionLaughsAttackProtectionActivationThreshold
+ .. to further tighten billion laughs protection parameters
+ when desired. Please see file "doc/reference.html" for details.
+ If you ever need to increase the defaults for non-attack XML
+ payload, please file a bug report with libexpat.
+ - Two new XML_FEATURE_* constants ..
+ - that can be queried using the XML_GetFeatureList function, and
+ - that are shown in "xmlwf -v" output.
+ - Two new environment variable switches ..
+ - EXPAT_ACCOUNTING_DEBUG=(0|1|2|3) and
+ - EXPAT_ENTITY_DEBUG=(0|1)
+ .. for runtime debugging of accounting and entity processing.
+ Specific behavior of these values may change in the future.
+ - Two new command line arguments "-a FACTOR" and "-b BYTES"
+ for xmlwf to further tighten billion laughs protection
+ parameters when desired.
+ If you ever need to increase the defaults for non-attack XML
+ payload, please file a bug report with libexpat.
+
+ Bug fixes:
+ #332 #470 For (non-default) compilation with -DEXPAT_MIN_SIZE=ON (CMake)
+ or CPPFLAGS=-DXML_MIN_SIZE (GNU Autotools): Fix segfault
+ for UTF-16 payloads containing CDATA sections.
+ #485 #486 Autotools: Fix generated CMake files for non-64bit and
+ non-Linux platforms (e.g. macOS and MinGW in particular)
+ that were introduced with release 2.3.0
+
+ Other changes:
+ #468 #469 xmlwf: Improve help output and the xmlwf man page
+ #463 xmlwf: Improve maintainability through some refactoring
+ #477 xmlwf: Fix man page DocBook validity
+ #456 Autotools: Sync CMake templates with CMake 3.18
+ #458 #459 CMake: Support absolute paths for both CMAKE_INSTALL_LIBDIR
+ and CMAKE_INSTALL_INCLUDEDIR
+ #471 #481 CMake: Add support for standard variable BUILD_SHARED_LIBS
+ #457 Unexpose symbol _INTERNAL_trim_to_complete_utf8_characters
+ #467 Resolve macro HAVE_EXPAT_CONFIG_H
+ #472 Delete unused legacy helper file "conftools/PrintPath"
+ #473 #483 Improve attribution
+ #464 #465 #477 doc/reference.html: Fix XHTML validity
+ #475 #478 doc/reference.html: Replace the 90s look by OK.css
+ #479 Version info bumped from 8:0:7 to 9:0:8
+ due to addition of new symbols and error codes;
+ see https://verbump.de/ for what these numbers do
+
+ Infrastructure:
+ #456 CI: Enable periodic runs
+ #457 CI: Start covering the list of exported symbols
+ #474 CI: Isolate coverage task
+ #476 #482 CI: Adapt to breaking changes in image "ubuntu-18.04"
+ #477 CI: Cover well-formedness and DocBook/XHTML validity
+ of doc/reference.html and doc/xmlwf.xml
+
+ Special thanks to:
+ Dimitry Andric
+ Eero Helenius
+ Nick Wellnhofer
+ Rhodri James
+ Tomas Korbar
+ Yury Gribov
+ and
+ Clang LeakSan
+ JetBrains
+ OSS-Fuzz
+
+Release 2.3.0 Thu March 25 2021
+ Bug fixes:
+ #438 When calling XML_ParseBuffer without a prior successful call to
+ XML_GetBuffer as a user, no longer trigger undefined behavior
+ (by adding an integer to a NULL pointer) but rather return
+ XML_STATUS_ERROR and set the error code to (new) code
+ XML_ERROR_NO_BUFFER. Found by UBSan (UndefinedBehaviorSanitizer)
+ of Clang 11 (but not Clang 9).
+ #444 xmlwf: Exit status 2 was used for both:
+ - malformed input files (documented) and
+ - invalid command-line arguments (undocumented).
+ The case of invalid command-line arguments now
+ has its own exit status 4, resolving the ambiguity.
+
+ Other changes:
+ #439 xmlwf: Add argument -k to allow continuing after
+ non-fatal errors
+ #439 xmlwf: Add section about exit status to the -h help output
+ #422 #426 #447 Windows: Drop support for Visual Studio <=14.0/2015
+ #434 Windows: CMake: Detect unsupported Visual Studio at
+ configure time (rather than at compile time)
+ #382 #428 testrunner: Make verbose mode (argument "-v") report
+ about passed tests, and make default mode report about
+ failures, as well.
+ #442 CMake: Call "enable_language(CXX)" prior to tinkering
+ with CMAKE_CXX_* variables
+ #448 Document use of libexpat from a CMake-based project
+ #451 Autotools: Install CMake files as generated by CMake 3.19.6
+ so that users with "find_package(expat [..] CONFIG [..])"
+ are served on distributions that are *not* using the CMake
+ build system inside for libexpat packaging
+ #436 #437 Autotools: Drop obsolescent macro AC_HEADER_STDC
+ #450 #452 Autotools: Resolve use of obsolete macro AC_CONFIG_HEADER
+ #441 Address compiler warnings
+ #443 Version info bumped from 7:12:6 to 8:0:7
+ due to addition of error code XML_ERROR_NO_BUFFER
+ (see https://verbump.de/ for what these numbers do)
+
+ Infrastructure:
+ #435 #446 Replace Travis CI by GitHub Actions
+
+ Special thanks to:
+ Alexander Richardson
+ Oleksandr Popovych
+ Thomas Beutlich
+ Tim Bray
+ and
+ Clang LeakSan, Clang 11 UBSan and the Clang team
Release 2.2.10 Sat October 3 2020
Bug fixes:
@@ -46,7 +901,7 @@ Release 2.2.10 Sat October 3 2020
#354 #355 ..
#356 #412 Address compiler warnings
#368 #369 Address pngcheck warnings with doc/*.png images
- Version info bumped from 7:11:6 to 7:12:6
+ #425 Version info bumped from 7:11:6 to 7:12:6
Special thanks to:
asavah
diff --git a/3rdparty/expat/ConfigureChecks.cmake b/3rdparty/expat/ConfigureChecks.cmake
index d85e48c972d..c06b2f27857 100644
--- a/3rdparty/expat/ConfigureChecks.cmake
+++ b/3rdparty/expat/ConfigureChecks.cmake
@@ -2,6 +2,7 @@ include(CheckCCompilerFlag)
include(CheckCSourceCompiles)
include(CheckIncludeFile)
include(CheckIncludeFiles)
+include(CheckLibraryExists)
include(CheckSymbolExists)
include(TestBigEndian)
@@ -45,18 +46,25 @@ else(WORDS_BIGENDIAN)
endif(WORDS_BIGENDIAN)
if(HAVE_SYS_TYPES_H)
- check_symbol_exists("off_t" "sys/types.h" OFF_T)
- check_symbol_exists("size_t" "sys/types.h" SIZE_T)
-else(HAVE_SYS_TYPES_H)
- set(OFF_T "long")
- set(SIZE_T "unsigned")
-endif(HAVE_SYS_TYPES_H)
+ check_c_source_compiles("
+ #include <sys/types.h>
+ int main(void) {
+ const off_t offset = -123;
+ return 0;
+ }"
+ HAVE_OFF_T)
+endif()
+
+if(NOT HAVE_OFF_T)
+ set(off_t "long")
+endif()
check_c_source_compiles("
+ #define _GNU_SOURCE
#include <stdlib.h> /* for NULL */
#include <unistd.h> /* for syscall */
#include <sys/syscall.h> /* for SYS_getrandom */
- int main() {
+ int main(void) {
syscall(SYS_getrandom, NULL, 0, 0);
return 0;
}"
@@ -64,3 +72,5 @@ check_c_source_compiles("
check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING)
check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY)
+
+check_library_exists(m cos "" _EXPAT_LIBM_FOUND)
diff --git a/3rdparty/expat/Makefile.am b/3rdparty/expat/Makefile.am
index 5e1d37dd1a8..c20531a8d6c 100644
--- a/3rdparty/expat/Makefile.am
+++ b/3rdparty/expat/Makefile.am
@@ -6,7 +6,12 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2025 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2018 KangLin <kl222@126.com>
+# Copyright (c) 2022 Johnny Jazeix <jazeix@gmail.com>
+# Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+# Copyright (c) 2024 Alexander Bluhm <alexander.bluhm@gmx.net>
+# Copyright (c) 2024 Dag-Erling Smørgrav <des@des.dev>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -53,20 +58,36 @@ pkgconfig_DATA = expat.pc
pkgconfigdir = $(libdir)/pkgconfig
+dist_cmake_DATA = \
+ cmake/autotools/expat.cmake
+
+nodist_cmake_DATA = \
+ cmake/autotools/expat-config-version.cmake \
+ cmake/autotools/expat-noconfig.cmake \
+ cmake/expat-config.cmake
+
+cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@
+
+
_EXTRA_DIST_CMAKE = \
- cmake/expat-config.cmake.in \
+ cmake/autotools/expat-noconfig__linux.cmake.in \
+ cmake/autotools/expat-noconfig__macos.cmake.in \
+ cmake/autotools/expat-noconfig__windows.cmake.in \
+ cmake/autotools/expat-package-init.cmake \
cmake/mingw-toolchain.cmake \
\
CMakeLists.txt \
CMake.README \
ConfigureChecks.cmake \
+ expat.pc.cmake \
expat_config.h.cmake
_EXTRA_DIST_WINDOWS = \
win32/build_expat_iss.bat \
win32/expat.iss \
win32/MANIFEST.txt \
- win32/README.txt
+ win32/README.txt \
+ win32/version.rc.cmake
EXTRA_DIST = \
$(_EXTRA_DIST_CMAKE) \
@@ -74,11 +95,16 @@ EXTRA_DIST = \
\
conftools/expat.m4 \
conftools/get-version.sh \
- conftools/PrintPath \
+ \
+ fuzz/xml_lpm_fuzzer.cpp \
+ fuzz/xml_lpm_fuzzer.proto \
+ fuzz/xml_parsebuffer_fuzzer.c \
+ fuzz/xml_parse_fuzzer.c \
\
xmlwf/xmlwf_helpgen.py \
xmlwf/xmlwf_helpgen.sh \
\
+ buildconf.sh \
Changes \
README.md \
\
@@ -92,10 +118,10 @@ buildlib:
@echo 'ERROR: is no longer supported. INSTEAD please:' >&2
@echo 'ERROR:' >&2
@echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2
- @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2
+ @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2
@echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2
@echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2
- @echo 'ERROR: -i {} +' >&2
+ @echo 'ERROR: -i.bak {} +' >&2
@echo 'ERROR:' >&2
@echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2
@echo 'ERROR:' >&2
@@ -110,6 +136,11 @@ buildlib:
run-benchmark:
$(MAKE) -C tests/benchmark
./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3
.PHONY: download-xmlts-zip
download-xmlts-zip:
diff --git a/3rdparty/expat/Makefile.in b/3rdparty/expat/Makefile.in
index ab846398cb7..069ec4047ee 100644
--- a/3rdparty/expat/Makefile.in
+++ b/3rdparty/expat/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,12 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2025 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2018 KangLin <kl222@126.com>
+# Copyright (c) 2022 Johnny Jazeix <jazeix@gmail.com>
+# Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+# Copyright (c) 2024 Alexander Bluhm <alexander.bluhm@gmx.net>
+# Copyright (c) 2024 Dag-Erling Smørgrav <des@des.dev>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -134,16 +139,20 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
- $(am__configure_deps) $(am__DIST_COMMON)
+ $(am__configure_deps) $(dist_cmake_DATA) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = expat_config.h
-CONFIG_CLEAN_FILES = expat.pc run.sh
+CONFIG_CLEAN_FILES = expat.pc cmake/expat-config.cmake \
+ cmake/autotools/expat-config-version.cmake \
+ cmake/autotools/expat-noconfig.cmake run.sh
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -199,8 +208,9 @@ am__uninstall_files_from_dir = { \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
-am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
-DATA = $(pkgconfig_DATA)
+am__installdirs = "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" \
+ "$(DESTDIR)$(pkgconfigdir)"
+DATA = $(dist_cmake_DATA) $(nodist_cmake_DATA) $(pkgconfig_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
@@ -227,18 +237,17 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
DIST_SUBDIRS = lib examples tests xmlwf doc
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \
$(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \
+ $(top_srcdir)/cmake/autotools/expat-config-version.cmake.in \
+ $(top_srcdir)/cmake/expat-config.cmake.in \
$(top_srcdir)/conftools/ar-lib $(top_srcdir)/conftools/compile \
$(top_srcdir)/conftools/config.guess \
$(top_srcdir)/conftools/config.sub \
$(top_srcdir)/conftools/install-sh \
$(top_srcdir)/conftools/ltmain.sh \
- $(top_srcdir)/conftools/missing AUTHORS COPYING \
+ $(top_srcdir)/conftools/missing AUTHORS COPYING README.md \
conftools/ar-lib conftools/compile conftools/config.guess \
conftools/config.sub conftools/depcomp conftools/install-sh \
conftools/ltmain.sh conftools/missing
@@ -281,6 +290,8 @@ DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.lz \
$(distdir).tar.xz
GZIP_ENV = --best
DIST_TARGETS = dist-lzip dist-xz dist-bzip2 dist-gzip
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -301,8 +312,10 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CPP = @CPP@
+CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
@@ -318,10 +331,20 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
FGREP = @FGREP@
+FILECMD = @FILECMD@
FILEMAP = @FILEMAP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -331,6 +354,8 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LIBAGE = @LIBAGE@
LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
+LIBM = @LIBM@
LIBOBJS = @LIBOBJS@
LIBREVISION = @LIBREVISION@
LIBS = @LIBS@
@@ -339,6 +364,7 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -360,9 +386,12 @@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SIZEOF_VOID_P = @SIZEOF_VOID_P@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
STRIP = @STRIP@
VERSION = @VERSION@
-_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -429,20 +458,34 @@ LIBTOOLFLAGS = --verbose
SUBDIRS = lib $(am__append_1) $(am__append_2) $(am__append_3)
pkgconfig_DATA = expat.pc
pkgconfigdir = $(libdir)/pkgconfig
+dist_cmake_DATA = \
+ cmake/autotools/expat.cmake
+
+nodist_cmake_DATA = \
+ cmake/autotools/expat-config-version.cmake \
+ cmake/autotools/expat-noconfig.cmake \
+ cmake/expat-config.cmake
+
+cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@
_EXTRA_DIST_CMAKE = \
- cmake/expat-config.cmake.in \
+ cmake/autotools/expat-noconfig__linux.cmake.in \
+ cmake/autotools/expat-noconfig__macos.cmake.in \
+ cmake/autotools/expat-noconfig__windows.cmake.in \
+ cmake/autotools/expat-package-init.cmake \
cmake/mingw-toolchain.cmake \
\
CMakeLists.txt \
CMake.README \
ConfigureChecks.cmake \
+ expat.pc.cmake \
expat_config.h.cmake
_EXTRA_DIST_WINDOWS = \
win32/build_expat_iss.bat \
win32/expat.iss \
win32/MANIFEST.txt \
- win32/README.txt
+ win32/README.txt \
+ win32/version.rc.cmake
EXTRA_DIST = \
$(_EXTRA_DIST_CMAKE) \
@@ -450,11 +493,16 @@ EXTRA_DIST = \
\
conftools/expat.m4 \
conftools/get-version.sh \
- conftools/PrintPath \
+ \
+ fuzz/xml_lpm_fuzzer.cpp \
+ fuzz/xml_lpm_fuzzer.proto \
+ fuzz/xml_parsebuffer_fuzzer.c \
+ fuzz/xml_parse_fuzzer.c \
\
xmlwf/xmlwf_helpgen.py \
xmlwf/xmlwf_helpgen.sh \
\
+ buildconf.sh \
Changes \
README.md \
\
@@ -467,7 +515,7 @@ all: expat_config.h
.SUFFIXES:
am--refresh: Makefile
@:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -493,9 +541,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
@@ -506,7 +554,7 @@ expat_config.h: stamp-h1
stamp-h1: $(srcdir)/expat_config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status expat_config.h
-$(srcdir)/expat_config.h.in: $(am__configure_deps)
+$(srcdir)/expat_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
@@ -515,6 +563,12 @@ distclean-hdr:
-rm -f expat_config.h stamp-h1
expat.pc: $(top_builddir)/config.status $(srcdir)/expat.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
+cmake/expat-config.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/expat-config.cmake.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+cmake/autotools/expat-config-version.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/autotools/expat-config-version.cmake.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+cmake/autotools/expat-noconfig.cmake: $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $@
run.sh: $(top_builddir)/config.status $(srcdir)/run.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $@
@@ -526,6 +580,48 @@ clean-libtool:
distclean-libtool:
-rm -f libtool config.lt
+install-dist_cmakeDATA: $(dist_cmake_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \
+ done
+
+uninstall-dist_cmakeDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir)
+install-nodist_cmakeDATA: $(nodist_cmake_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \
+ done
+
+uninstall-nodist_cmakeDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir)
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
@@ -653,7 +749,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -797,7 +892,7 @@ distcheck: dist
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
@@ -853,7 +948,7 @@ check: check-recursive
all-am: Makefile $(DATA) expat_config.h
installdirs: installdirs-recursive
installdirs-am:
- for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
+ for dir in "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(pkgconfigdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
@@ -908,7 +1003,8 @@ info: info-recursive
info-am:
-install-data-am: install-pkgconfigDATA
+install-data-am: install-dist_cmakeDATA install-nodist_cmakeDATA \
+ install-pkgconfigDATA
install-dvi: install-dvi-recursive
@@ -954,7 +1050,8 @@ ps: ps-recursive
ps-am:
-uninstall-am: uninstall-pkgconfigDATA
+uninstall-am: uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \
+ uninstall-pkgconfigDATA
.MAKE: $(am__recursive_targets) all install-am install-strip
@@ -966,14 +1063,16 @@ uninstall-am: uninstall-pkgconfigDATA
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
+ install-data install-data-am install-dist_cmakeDATA \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-nodist_cmakeDATA install-pdf \
install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \
uninstall-pkgconfigDATA
.PRECIOUS: Makefile
@@ -985,10 +1084,10 @@ buildlib:
@echo 'ERROR: is no longer supported. INSTEAD please:' >&2
@echo 'ERROR:' >&2
@echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2
- @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2
+ @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2
@echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2
@echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2
- @echo 'ERROR: -i {} +' >&2
+ @echo 'ERROR: -i.bak {} +' >&2
@echo 'ERROR:' >&2
@echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2
@echo 'ERROR:' >&2
@@ -1002,6 +1101,11 @@ buildlib:
run-benchmark:
$(MAKE) -C tests/benchmark
./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3
+ ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3
.PHONY: download-xmlts-zip
download-xmlts-zip:
diff --git a/3rdparty/expat/README.md b/3rdparty/expat/README.md
index 428a11ab245..77c6bf27d30 100644
--- a/3rdparty/expat/README.md
+++ b/3rdparty/expat/README.md
@@ -1,26 +1,37 @@
-[![Travis CI Build Status](https://travis-ci.org/libexpat/libexpat.svg?branch=master)](https://travis-ci.org/libexpat/libexpat)
+[![Run Linux CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat)
[![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions)
+[![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/)
+[![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases)
+[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10205/badge)](https://www.bestpractices.dev/projects/10205)
+> [!CAUTION]
+>
+> Expat is **understaffed** and without funding.
+> There is a [call for help with details](https://github.com/libexpat/libexpat/blob/master/expat/Changes)
+> at the top of the `Changes` file.
-# Expat, Release 2.2.10
-This is Expat, a C library for parsing XML, started by
-[James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997.
+# Expat, Release 2.7.1
+
+This is Expat, a C99 library for parsing
+[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by
+[James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997.
Expat is a stream-oriented XML parser. This means that you register
handlers with the parser before starting the parse. These handlers
are called when the parser discovers the associated structures in the
document being parsed. A start tag is an example of the kind of
structures for which you may register handlers.
-Expat supports the following compilers:
-- GNU GCC >=4.5
+Expat supports the following C99 compilers:
+
+- GNU GCC >=4.5 (for use from C) or GNU GCC >=4.8.1 (for use from C++)
- LLVM Clang >=3.5
-- Microsoft Visual Studio >=9.0/2008
+- Microsoft Visual Studio >=16.0/2019 (rolling `${today} minus 5 years`)
Windows users can use the
-[`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/),
-which includes both precompiled libraries and executables, and source code for
+[`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases),
+which includes both pre-compiled libraries and executables, and source code for
developers.
Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html).
@@ -30,6 +41,101 @@ contained in the file
distributed with this package.
This license is the same as the MIT/X Consortium license.
+
+## Using libexpat in your CMake-Based Project
+
+There are three documented ways of using libexpat with CMake:
+
+### a) `find_package` with Module Mode
+
+This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html).
+
+Notice the *uppercase* `EXPAT` in the following example:
+
+```cmake
+cmake_minimum_required(VERSION 3.10)
+
+project(hello VERSION 1.0.0)
+
+find_package(EXPAT 2.2.8 MODULE REQUIRED)
+
+add_executable(hello
+ hello.c
+)
+
+target_link_libraries(hello PUBLIC EXPAT::EXPAT)
+```
+
+### b) `find_package` with Config Mode
+
+This approach requires files from…
+
+- libexpat >=2.2.8 where packaging uses the CMake build system
+or
+- libexpat >=2.3.0 where packaging uses the GNU Autotools build system
+ on Linux
+or
+- libexpat >=2.4.0 where packaging uses the GNU Autotools build system
+ on macOS or MinGW.
+
+Notice the *lowercase* `expat` in the following example:
+
+```cmake
+cmake_minimum_required(VERSION 3.10)
+
+project(hello VERSION 1.0.0)
+
+find_package(expat 2.2.8 CONFIG REQUIRED char dtd ns)
+
+add_executable(hello
+ hello.c
+)
+
+target_link_libraries(hello PUBLIC expat::expat)
+```
+
+### c) The `FetchContent` module
+
+This approach — as demonstrated below — requires CMake >=3.18 for both the
+[`FetchContent` module](https://cmake.org/cmake/help/latest/module/FetchContent.html)
+and its support for the `SOURCE_SUBDIR` option to be available.
+
+Please note that:
+- Use of the `FetchContent` module with *non-release* SHA1s or `master`
+ of libexpat is neither advised nor considered officially supported.
+- Pinning to a specific commit is great for robust CI.
+- Pinning to a specific commit needs updating every time there is a new
+ release of libexpat — either manually or through automation —,
+ to not miss out on libexpat security updates.
+
+For an example that pulls in libexpat via Git:
+
+```cmake
+cmake_minimum_required(VERSION 3.18)
+
+include(FetchContent)
+
+project(hello VERSION 1.0.0)
+
+FetchContent_Declare(
+ expat
+ GIT_REPOSITORY https://github.com/libexpat/libexpat/
+ GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_0_Y_Z
+ SOURCE_SUBDIR expat/
+)
+
+FetchContent_MakeAvailable(expat)
+
+add_executable(hello
+ hello.c
+)
+
+target_link_libraries(hello PUBLIC expat)
+```
+
+
+## Building from a Git Clone
+
If you are building Expat from a check-out from the
[Git repository](https://github.com/libexpat/libexpat/),
you need to run a script that generates the configure script using the
@@ -43,6 +149,11 @@ autoconf 2.58 or newer. Run the script like this:
Once this has been done, follow the same instructions as for building
from a source distribution.
+
+## Building from a Source Distribution
+
+### a) Building with the configure script (i.e. GNU Autotools)
+
To build Expat from a source distribution, you first run the
configuration shell script in the top level distribution directory:
@@ -88,10 +199,10 @@ support this mode of compilation (yet):
1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
<br/>
- `find -name Makefile.am -exec sed
+ `find . -name Makefile.am -exec sed
-e 's,libexpat\.la,libexpatw.la,'
-e 's,libexpat_la,libexpatw_la,'
- -i {} +`
+ -i.bak {} +`
1. Run `automake` to re-write `Makefile.in` files:<br/>
`automake`
@@ -132,8 +243,14 @@ A reference manual is available in the file `doc/reference.html` in this
distribution.
-The CMake build system is still *experimental* and will replace the primary
+### b) Building with CMake
+
+The CMake build system is still *experimental* and may replace the primary
build system based on GNU Autotools at some point when it is ready.
+
+
+#### Available Options
+
For an idea of the available (non-advanced) options for building with CMake:
```console
@@ -147,37 +264,37 @@ CMAKE_INSTALL_PREFIX:PATH=/usr/local
// Path to a program.
DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man
-// build man page for xmlwf
+// Build man page for xmlwf
EXPAT_BUILD_DOCS:BOOL=ON
-// build the examples for expat library
+// Build the examples for expat library
EXPAT_BUILD_EXAMPLES:BOOL=ON
-// build fuzzers for the expat library
+// Build fuzzers for the expat library
EXPAT_BUILD_FUZZERS:BOOL=OFF
-// build pkg-config file
+// Build pkg-config file
EXPAT_BUILD_PKGCONFIG:BOOL=ON
-// build the tests for expat library
+// Build the tests for expat library
EXPAT_BUILD_TESTS:BOOL=ON
-// build the xmlwf tool for expat library
+// Build the xmlwf tool for expat library
EXPAT_BUILD_TOOLS:BOOL=ON
// Character type to use (char|ushort|wchar_t) [default=char]
EXPAT_CHAR_TYPE:STRING=char
-// install expat files in cmake install target
+// Install expat files in cmake install target
EXPAT_ENABLE_INSTALL:BOOL=ON
// Use /MT flag (static CRT) when compiling in MSVC
EXPAT_MSVC_STATIC_CRT:BOOL=OFF
-// build fuzzers via ossfuzz for the expat library
+// Build fuzzers via OSS-Fuzz for the expat library
EXPAT_OSSFUZZ_BUILD:BOOL=OFF
-// build a shared expat library
+// Build a shared expat library
EXPAT_SHARED_LIBS:BOOL=ON
// Treat all compiler warnings as errors
@@ -186,7 +303,7 @@ EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF
// Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]
EXPAT_WITH_GETRANDOM:STRING=AUTO
-// utilize libbsd (for arc4random_buf)
+// Utilize libbsd (for arc4random_buf)
EXPAT_WITH_LIBBSD:BOOL=OFF
// Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]
diff --git a/3rdparty/expat/acinclude.m4 b/3rdparty/expat/acinclude.m4
index 7277ab29bbb..498f709bdf9 100644
--- a/3rdparty/expat/acinclude.m4
+++ b/3rdparty/expat/acinclude.m4
@@ -8,5 +8,7 @@ m4_include(conftools/ax-append-flag.m4)
m4_include(conftools/ax-append-compile-flags.m4)
m4_include(conftools/ax-append-link-flags.m4)
m4_include(conftools/expatcfg-compiler-supports-visibility.m4)
+m4_include(conftools/ax-cxx-compile-stdcxx.m4)
+m4_include(conftools/ax-cxx-compile-stdcxx-11.m4)
### end of file
diff --git a/3rdparty/expat/aclocal.m4 b/3rdparty/expat/aclocal.m4
index b8cb1fc8ca0..8a0016bd4e2 100644
--- a/3rdparty/expat/aclocal.m4
+++ b/3rdparty/expat/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,13 +14,13 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.16.2], [],
+m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.2])dnl
+[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-# Copyright (C) 2011-2020 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -118,7 +118,7 @@ AC_SUBST([AR])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -170,7 +170,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -201,7 +201,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -392,7 +392,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -460,7 +460,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -488,6 +488,10 @@ m4_defn([AC_PROG_CC])
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
+m4_ifdef([_$0_ALREADY_INIT],
+ [m4_fatal([$0 expanded multiple times
+]m4_defn([_$0_ALREADY_INIT]))],
+ [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -524,7 +528,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
@@ -576,6 +580,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+AC_SUBST([CTAGS])
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+AC_SUBST([ETAGS])
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+AC_SUBST([CSCOPE])
+
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
@@ -657,7 +675,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -678,7 +696,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2020 Free Software Foundation, Inc.
+# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -697,9 +715,45 @@ fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -742,7 +796,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -763,12 +817,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
@@ -781,7 +830,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -810,7 +859,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -857,7 +906,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -876,7 +925,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -957,7 +1006,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1017,7 +1066,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1045,7 +1094,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2020 Free Software Foundation, Inc.
+# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1064,7 +1113,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2020 Free Software Foundation, Inc.
+# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/3rdparty/expat/buildconf.sh b/3rdparty/expat/buildconf.sh
new file mode 100755
index 00000000000..4e506b30082
--- /dev/null
+++ b/3rdparty/expat/buildconf.sh
@@ -0,0 +1,35 @@
+#! /usr/bin/env bash
+# __ __ _
+# ___\ \/ /_ __ __ _| |_
+# / _ \\ /| '_ \ / _` | __|
+# | __// \| |_) | (_| | |_
+# \___/_/\_\ .__/ \__,_|\__|
+# |_| XML parser
+#
+# Copyright (c) 2017-2022 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+# Copyright (c) 2024 Dag-Erling Smørgrav <des@des.dev>
+# Licensed under the MIT license:
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# 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 AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+set -e
+
+exec autoreconf --warnings=all --install --verbose "$@"
diff --git a/3rdparty/expat/cmake/autotools/expat-config-version.cmake.in b/3rdparty/expat/cmake/autotools/expat-config-version.cmake.in
new file mode 100644
index 00000000000..17ab1924c35
--- /dev/null
+++ b/3rdparty/expat/cmake/autotools/expat-config-version.cmake.in
@@ -0,0 +1,65 @@
+# This is a basic version file for the Config-mode of find_package().
+# It is used by write_basic_package_version_file() as input file for configure_file()
+# to create a version-file which can be installed along a config.cmake file.
+#
+# The created file sets PACKAGE_VERSION_EXACT if the current version string and
+# the requested version string are exactly the same and it sets
+# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
+# but only if the requested major version is the same as the current one.
+# The variable CVF_VERSION must be set before calling configure_file().
+
+
+set(PACKAGE_VERSION "@PACKAGE_VERSION@")
+
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+
+ if("@PACKAGE_VERSION@" MATCHES "^([0-9]+)\\.")
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
+ if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
+ endif()
+ else()
+ set(CVF_VERSION_MAJOR "@PACKAGE_VERSION@")
+ endif()
+
+ if(PACKAGE_FIND_VERSION_RANGE)
+ # both endpoints of the range must have the expected major version
+ math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
+ if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+ AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ else()
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ endif()
+ else()
+ if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ else()
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ endif()
+
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+ set(PACKAGE_VERSION_EXACT TRUE)
+ endif()
+ endif()
+endif()
+
+
+# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@SIZEOF_VOID_P@" STREQUAL "")
+ return()
+endif()
+
+# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
+if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@SIZEOF_VOID_P@")
+ math(EXPR installedBits "@SIZEOF_VOID_P@ * 8")
+ set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
+ set(PACKAGE_VERSION_UNSUITABLE TRUE)
+endif()
diff --git a/3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in b/3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in
new file mode 100644
index 00000000000..d0ad645c03f
--- /dev/null
+++ b/3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in
@@ -0,0 +1,19 @@
+#----------------------------------------------------------------
+# Generated CMake target import file for configuration "NoConfig".
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Import target "expat::expat" for configuration "NoConfig"
+set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
+set_target_properties(expat::expat PROPERTIES
+ IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@"
+ IMPORTED_SONAME_NOCONFIG "libexpat.so.@SO_MAJOR@"
+ )
+
+list(APPEND _cmake_import_check_targets expat::expat )
+list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@" )
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)
diff --git a/3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in b/3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in
new file mode 100644
index 00000000000..484e5bc6338
--- /dev/null
+++ b/3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in
@@ -0,0 +1,19 @@
+#----------------------------------------------------------------
+# Generated CMake target import file for configuration "NoConfig".
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Import target "expat::expat" for configuration "NoConfig"
+set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
+set_target_properties(expat::expat PROPERTIES
+ IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.dylib"
+ IMPORTED_SONAME_NOCONFIG "@rpath/libexpat.@SO_MAJOR@.dylib"
+ )
+
+list(APPEND _cmake_import_check_targets expat::expat )
+list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.dylib" )
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)
diff --git a/3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in b/3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in
new file mode 100644
index 00000000000..2f7454e2ca2
--- /dev/null
+++ b/3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in
@@ -0,0 +1,19 @@
+#----------------------------------------------------------------
+# Generated CMake target import file for configuration "NoConfig".
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Import target "expat::expat" for configuration "NoConfig"
+set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
+set_target_properties(expat::expat PROPERTIES
+ IMPORTED_IMPLIB_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a"
+ IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/@CMAKE_SHARED_LIBRARY_PREFIX@expat-@SO_MAJOR@.dll"
+ )
+
+list(APPEND _cmake_import_check_targets expat::expat )
+list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a" "${_IMPORT_PREFIX}/bin/@CMAKE_SHARED_LIBRARY_PREFIX@expat-@SO_MAJOR@.dll" )
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)
diff --git a/3rdparty/expat/cmake/autotools/expat-package-init.cmake b/3rdparty/expat/cmake/autotools/expat-package-init.cmake
new file mode 100644
index 00000000000..5cf17705329
--- /dev/null
+++ b/3rdparty/expat/cmake/autotools/expat-package-init.cmake
@@ -0,0 +1,25 @@
+
+####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
+####### Any changes to this file will be overwritten by the next CMake run ####
+####### The input file was expat-config.cmake.in ########
+
+get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
+
+macro(set_and_check _var _file)
+ set(${_var} "${_file}")
+ if(NOT EXISTS "${_file}")
+ message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
+ endif()
+endmacro()
+
+macro(check_required_components _NAME)
+ foreach(comp ${${_NAME}_FIND_COMPONENTS})
+ if(NOT ${_NAME}_${comp}_FOUND)
+ if(${_NAME}_FIND_REQUIRED_${comp})
+ set(${_NAME}_FOUND FALSE)
+ endif()
+ endif()
+ endforeach()
+endmacro()
+
+####################################################################################
diff --git a/3rdparty/expat/cmake/autotools/expat.cmake b/3rdparty/expat/cmake/autotools/expat.cmake
new file mode 100644
index 00000000000..ecb2df12ada
--- /dev/null
+++ b/3rdparty/expat/cmake/autotools/expat.cmake
@@ -0,0 +1,107 @@
+# Generated by CMake
+
+if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
+ message(FATAL_ERROR "CMake >= 2.8.12 required")
+endif()
+if(CMAKE_VERSION VERSION_LESS "2.8.12")
+ message(FATAL_ERROR "CMake >= 2.8.12 required")
+endif()
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.8.12...3.29)
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Protect against multiple inclusion, which would fail when already imported targets are added once more.
+set(_cmake_targets_defined "")
+set(_cmake_targets_not_defined "")
+set(_cmake_expected_targets "")
+foreach(_cmake_expected_target IN ITEMS expat::expat)
+ list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
+ if(TARGET "${_cmake_expected_target}")
+ list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
+ else()
+ list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
+ endif()
+endforeach()
+unset(_cmake_expected_target)
+if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
+ unset(_cmake_targets_defined)
+ unset(_cmake_targets_not_defined)
+ unset(_cmake_expected_targets)
+ unset(CMAKE_IMPORT_FILE_VERSION)
+ cmake_policy(POP)
+ return()
+endif()
+if(NOT _cmake_targets_defined STREQUAL "")
+ string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
+ string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
+ message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
+endif()
+unset(_cmake_targets_defined)
+unset(_cmake_targets_not_defined)
+unset(_cmake_expected_targets)
+
+
+# Compute the installation prefix relative to this file.
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+if(_IMPORT_PREFIX STREQUAL "/")
+ set(_IMPORT_PREFIX "")
+endif()
+
+# Create imported target expat::expat
+add_library(expat::expat SHARED IMPORTED)
+
+set_target_properties(expat::expat PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
+ INTERFACE_LINK_LIBRARIES "m"
+)
+
+# Load information for each installed configuration.
+file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/expat-*.cmake")
+foreach(_cmake_config_file IN LISTS _cmake_config_files)
+ include("${_cmake_config_file}")
+endforeach()
+unset(_cmake_config_file)
+unset(_cmake_config_files)
+
+# Cleanup temporary variables.
+set(_IMPORT_PREFIX)
+
+# Loop over all imported files and verify that they actually exist
+foreach(_cmake_target IN LISTS _cmake_import_check_targets)
+ if(CMAKE_VERSION VERSION_LESS "3.28"
+ OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
+ OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
+ foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
+ if(NOT EXISTS "${_cmake_file}")
+ message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
+ \"${_cmake_file}\"
+but this file does not exist. Possible reasons include:
+* The file was deleted, renamed, or moved to another location.
+* An install or uninstall procedure did not complete successfully.
+* The installation package was faulty and contained
+ \"${CMAKE_CURRENT_LIST_FILE}\"
+but not all the files it references.
+")
+ endif()
+ endforeach()
+ endif()
+ unset(_cmake_file)
+ unset("_cmake_import_check_files_for_${_cmake_target}")
+endforeach()
+unset(_cmake_target)
+unset(_cmake_import_check_targets)
+
+# This file does not depend on other imported targets which have
+# been exported from the same project but in a separate export set.
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)
+cmake_policy(POP)
diff --git a/3rdparty/expat/cmake/mingw-toolchain.cmake b/3rdparty/expat/cmake/mingw-toolchain.cmake
index 31a238b05ca..9032d9e5522 100644
--- a/3rdparty/expat/cmake/mingw-toolchain.cmake
+++ b/3rdparty/expat/cmake/mingw-toolchain.cmake
@@ -31,6 +31,7 @@ set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
set(WIN32 ON)
set(MINGW ON)
diff --git a/3rdparty/expat/configure b/3rdparty/expat/configure
index 947bc0ebcde..54b6f929686 100755
--- a/3rdparty/expat/configure
+++ b/3rdparty/expat/configure
@@ -1,11 +1,12 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for expat 2.2.10.
+# Generated by GNU Autoconf 2.71 for expat 2.7.1.
#
-# Report bugs to <expat-bugs@libexpat.org>.
+# Report bugs to <https://github.com/libexpat/libexpat/issues>.
#
#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
+# Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -16,14 +17,16 @@
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
+else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
@@ -33,46 +36,46 @@ esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -96,8 +92,12 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
@@ -109,30 +109,10 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
@@ -154,20 +134,22 @@ esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ as_bourne_compatible="as_nop=:
+if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
-else
+else \$as_nop
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
@@ -187,12 +169,15 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+if ( set x; as_fn_ret_success y && test x = \"\$1\" )
+then :
-else
+else \$as_nop
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
+blah=\$(echo \$(echo blah))
+test x\"\$blah\" = xblah || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
@@ -207,30 +192,38 @@ test -x / || exit 1"
test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
|| test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
+ if (eval "$as_required") 2>/dev/null
+then :
as_have_required=yes
-else
+else $as_nop
as_have_required=no
fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
+then :
-else
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
+ as_shell=$as_dir$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
+then :
break 2
fi
fi
@@ -238,14 +231,21 @@ fi
esac
as_found=false
done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
IFS=$as_save_IFS
+if $as_found
+then :
+
+else $as_nop
+ if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi
+fi
- if test "x$CONFIG_SHELL" != x; then :
+ if test "x$CONFIG_SHELL" != x
+then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
@@ -263,22 +263,23 @@ esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ if test x$as_have_required = xno
+then :
+ printf "%s\n" "$0: This script requires a shell more modern than all"
+ printf "%s\n" "$0: the shells that I found on your system."
+ if test ${ZSH_VERSION+y} ; then
+ printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
else
- $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: expat-bugs@libexpat.org about your system, including
-$0: any error possibly output before this message. Then
-$0: install a modern shell, or manually run the script
-$0: under such a shell if you do have one."
+ printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and
+$0: https://github.com/libexpat/libexpat/issues about your
+$0: system, including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
fi
exit 1
fi
@@ -302,6 +303,7 @@ as_fn_unset ()
}
as_unset=as_fn_unset
+
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -319,6 +321,14 @@ as_fn_exit ()
as_fn_set_status $1
exit $1
} # as_fn_exit
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+ return $?
+}
+as_nop=as_fn_nop
# as_fn_mkdir_p
# -------------
@@ -333,7 +343,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -342,7 +352,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -381,12 +391,13 @@ as_fn_executable_p ()
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
+else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
@@ -398,18 +409,27 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
+else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+ return $?
+}
+as_nop=as_fn_nop
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
@@ -421,9 +441,9 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -450,7 +470,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -494,7 +514,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
@@ -508,6 +528,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
exit
}
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -521,6 +545,13 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -590,66 +621,86 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='expat'
PACKAGE_TARNAME='expat'
-PACKAGE_VERSION='2.2.10'
-PACKAGE_STRING='expat 2.2.10'
-PACKAGE_BUGREPORT='expat-bugs@libexpat.org'
+PACKAGE_VERSION='2.7.1'
+PACKAGE_STRING='expat 2.7.1'
+PACKAGE_BUGREPORT='https://github.com/libexpat/libexpat/issues'
PACKAGE_URL=''
ac_unique_file="Makefile.in"
# Factoring default headers for most tests.
ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
+#include <stddef.h>
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
#endif
-#ifdef STDC_HEADERS
+#ifdef HAVE_STDLIB_H
# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
#endif
#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
# include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
-ac_header_list=
+ac_header_c_list=
+ac_func_c_list=
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
-_EXPAT_OUTPUT_NAME
+CMAKE_SHARED_LIBRARY_PREFIX
AM_LDFLAGS
AM_CXXFLAGS
AM_CFLAGS
AM_CPPFLAGS
-WITH_DOCBOOK_FALSE
-WITH_DOCBOOK_TRUE
+SIZEOF_VOID_P
+SO_PATCH
+SO_MINOR
+SO_MAJOR
+LIBDIR_BASENAME
+EXPAT_CHAR_TYPE
+EXPAT_CONTEXT_BYTES
+EXPAT_NS
+EXPAT_MIN_SIZE
+EXPAT_LARGE_SIZE
+EXPAT_DTD
+EXPAT_ATTR_INFO
+WITH_DISTRIBUTABLE_MANPAGE_FALSE
+WITH_DISTRIBUTABLE_MANPAGE_TRUE
+WITH_PREBUILT_MANPAGE_FALSE
+WITH_PREBUILT_MANPAGE_TRUE
+WITH_MANPAGE_FALSE
+WITH_MANPAGE_TRUE
DOCBOOK_TO_MAN
FILEMAP
+LIBM
+_INTERNAL_LARGE_SIZE_FALSE
+_INTERNAL_LARGE_SIZE_TRUE
+_INTERNAL_MIN_SIZE_FALSE
+_INTERNAL_MIN_SIZE_TRUE
+_INTERNAL_UNICODE_WCHAR_T_FALSE
+_INTERNAL_UNICODE_WCHAR_T_TRUE
UNICODE_FALSE
UNICODE_TRUE
MINGW_FALSE
MINGW_TRUE
+HAVE_CXX11
WITH_TESTS_FALSE
WITH_TESTS_TRUE
WITH_EXAMPLES_FALSE
@@ -666,7 +717,6 @@ CXX
LIBAGE
LIBREVISION
LIBCURRENT
-CPP
LT_SYS_LIBRARY_PATH
OTOOL64
OTOOL
@@ -675,6 +725,7 @@ NMEDIT
DSYMUTIL
MANIFEST_TOOL
RANLIB
+FILECMD
NM
ac_ct_DUMPBIN
DUMPBIN
@@ -706,10 +757,16 @@ CFLAGS
CC
ac_ct_AR
AR
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
AM_V
+CSCOPE
+ETAGS
+CTAGS
am__untar
am__tar
AMTAR
@@ -781,15 +838,18 @@ PACKAGE_NAME
PATH_SEPARATOR
SHELL
am__quote'
-ac_subst_files=''
+ac_subst_files='PACKAGE_INIT'
ac_user_opts='
enable_option_checking
enable_silent_rules
+enable_maintainer_mode
enable_dependency_tracking
enable_shared
enable_static
+enable_pic
with_pic
enable_fast_install
+enable_aix_soname
with_aix_soname
with_gnu_ld
with_sysroot
@@ -813,7 +873,6 @@ LDFLAGS
LIBS
CPPFLAGS
LT_SYS_LIBRARY_PATH
-CPP
CXX
CXXFLAGS
CCC
@@ -887,8 +946,6 @@ do
*) ac_optarg=yes ;;
esac
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
@@ -929,9 +986,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -955,9 +1012,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -1168,9 +1225,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1184,9 +1241,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1230,9 +1287,9 @@ Try \`$0 --help' for more information"
*)
# FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
@@ -1248,7 +1305,7 @@ if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1312,7 +1369,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
+printf "%s\n" X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -1369,7 +1426,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures expat 2.2.10 to adapt to many kinds of systems.
+\`configure' configures expat 2.7.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1440,7 +1497,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of expat 2.2.10:";;
+ short | recursive ) echo "Configuration of expat 2.7.1:";;
esac
cat <<\_ACEOF
@@ -1450,14 +1507,22 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
+ --disable-maintainer-mode
+ disable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
--enable-dependency-tracking
do not reject slow dependency extractors
--disable-dependency-tracking
speeds up one-time build
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
+ --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
+ --enable-aix-soname=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX, [default=aix].
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-xml-attr-info Enable retrieving the byte offsets for attribute
names and values [default=no]
@@ -1469,11 +1534,6 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
- both]
- --with-aix-soname=aix|svr4|both
- shared library versioning (aka "SONAME") variant to
- provide on AIX, [default=aix].
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot[=DIR] Search for dependent libraries within DIR (or the
compiler's sysroot if not specified).
@@ -1501,7 +1561,6 @@ Some influential environment variables:
you have headers in a nonstandard directory <include dir>
LT_SYS_LIBRARY_PATH
User-defined run-time library search path.
- CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
CXXCPP C++ preprocessor
@@ -1511,7 +1570,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <expat-bugs@libexpat.org>.
+Report bugs to <https://github.com/libexpat/libexpat/issues>.
_ACEOF
ac_status=$?
fi
@@ -1527,9 +1586,9 @@ if test "$ac_init_help" = "recursive"; then
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1557,7 +1616,8 @@ esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
+ # Check for configure.gnu first; this name is used for a wrapper for
+ # Metaconfig's "Configure" on case-insensitive file systems.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
@@ -1565,7 +1625,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
@@ -1574,10 +1634,10 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-expat configure 2.2.10
-generated by GNU Autoconf 2.69
+expat configure 2.7.1
+generated by GNU Autoconf 2.71
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1594,14 +1654,14 @@ fi
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
+ rm -f conftest.$ac_objext conftest.beam
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1609,14 +1669,15 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
+ } && test -s conftest.$ac_objext
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1632,14 +1693,14 @@ fi
ac_fn_c_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
+ rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1647,17 +1708,18 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
- }; then :
+ }
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1679,120 +1741,44 @@ fi
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$3=yes"
-else
+else $as_nop
eval "$3=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
@@ -1800,16 +1786,9 @@ else
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+ which can conflict with char $2 (void); below. */
+#include <limits.h>
#undef $2
/* Override any GCC internal prototype to avoid an error.
@@ -1818,7 +1797,7 @@ else
#ifdef __cplusplus
extern "C"
#endif
-char $2 ();
+char $2 (void);
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
@@ -1827,24 +1806,25 @@ choke me
#endif
int
-main ()
+main (void)
{
return $2 ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
eval "$3=yes"
-else
+else $as_nop
eval "$3=no"
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
@@ -1855,14 +1835,14 @@ $as_echo "$ac_res" >&6; }
ac_fn_cxx_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
+ rm -f conftest.$ac_objext conftest.beam
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1870,14 +1850,15 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
+ } && test -s conftest.$ac_objext
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1899,7 +1880,7 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1907,14 +1888,15 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
test ! -s conftest.err
- }; then :
+ }
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1930,14 +1912,14 @@ fi
ac_fn_cxx_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
+ rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1945,17 +1927,18 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
- }; then :
+ }
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1970,6 +1953,49 @@ fi
} # ac_fn_cxx_try_link
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that
+# executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+then :
+ ac_retval=0
+else $as_nop
+ printf "%s\n" "$as_me: program exited with status $ac_status" >&5
+ printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
@@ -1977,17 +2003,18 @@ fi
ac_fn_c_check_type ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
if (sizeof ($2))
return 0;
@@ -1995,12 +2022,13 @@ if (sizeof ($2))
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
if (sizeof (($2)))
return 0;
@@ -2008,120 +2036,239 @@ if (sizeof (($2)))
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
-else
+else $as_nop
eval "$3=yes"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
-#include <$2>
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_hi=$ac_mid; break
+else $as_nop
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ done
+else $as_nop
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <$2>
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_lo=$ac_mid; break
+else $as_nop
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ done
+else $as_nop
+ ac_lo= ac_hi=
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## -------------------------------------- ##
-## Report this to expat-bugs@libexpat.org ##
-## -------------------------------------- ##"
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_hi=$ac_mid
+else $as_nop
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval (void) { return $2; }
+static unsigned long int ulongval (void) { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main (void)
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else $as_nop
+ ac_retval=1
fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+ac_configure_args_raw=
+for ac_arg
+do
+ case $ac_arg in
+ *\'*)
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_configure_args_raw " '$ac_arg'"
+done
+
+case $ac_configure_args_raw in
+ *$as_nl*)
+ ac_safe_unquote= ;;
+ *)
+ ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.
+ ac_unsafe_a="$ac_unsafe_z#~"
+ ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
+ ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
+esac
-} # ac_fn_c_check_header_mongrel
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by expat $as_me 2.2.10, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+It was created by expat $as_me 2.7.1, which was
+generated by GNU Autoconf 2.71. Invocation command line was
- $ $0 $@
+ $ $0$ac_configure_args_raw
_ACEOF
exec 5>>config.log
@@ -2154,8 +2301,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ printf "%s\n" "PATH: $as_dir"
done
IFS=$as_save_IFS
@@ -2190,7 +2341,7 @@ do
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
@@ -2225,11 +2376,13 @@ done
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
+ # Sanitize IFS.
+ IFS=" "" $as_nl"
# Save into config.log some information that might help in debugging.
{
echo
- $as_echo "## ---------------- ##
+ printf "%s\n" "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
@@ -2240,8 +2393,8 @@ trap 'exit_status=$?
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -2265,7 +2418,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
)
echo
- $as_echo "## ----------------- ##
+ printf "%s\n" "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
@@ -2273,14 +2426,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
+ printf "%s\n" "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
@@ -2288,15 +2441,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
- $as_echo "## ----------- ##
+ printf "%s\n" "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
@@ -2304,8 +2457,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
echo
fi
test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
+ printf "%s\n" "$as_me: caught signal $ac_signal"
+ printf "%s\n" "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -2319,63 +2472,48 @@ ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
-$as_echo "/* confdefs.h */" > confdefs.h
+printf "%s\n" "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
+printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
+printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
+printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
+printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
+ ac_site_files="$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
+ ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
+ ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+
+for ac_site_file in $ac_site_files
do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ case $ac_site_file in #(
+ */*) :
+ ;; #(
+ *) :
+ ac_site_file=./$ac_site_file ;;
+esac
+ if test -f "$ac_site_file" && test -r "$ac_site_file"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
@@ -2385,22 +2523,651 @@ if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
-as_fn_append ac_header_list " stdlib.h"
-as_fn_append ac_header_list " unistd.h"
-as_fn_append ac_header_list " sys/param.h"
+# Test code for whether the C compiler supports C89 (global declarations)
+ac_c_conftest_c89_globals='
+/* Does the compiler advertise C89 conformance?
+ Do not test the value of __STDC__, because some compilers set it to 0
+ while being otherwise adequately conformant. */
+#if !defined __STDC__
+# error "Compiler does not advertise C89 conformance"
+#endif
+
+#include <stddef.h>
+#include <stdarg.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
+struct buf { int x; };
+struct buf * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (char **p, int i)
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not \xHH hex character constants.
+ These do not provoke an error unfortunately, instead are silently treated
+ as an "x". The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously \x00 != x always comes out true, for an
+ array size at least. It is necessary to write \x00 == 0 to get something
+ that is true only with -std. */
+int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) '\''x'\''
+int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
+ int, int);'
+
+# Test code for whether the C compiler supports C89 (body of main).
+ac_c_conftest_c89_main='
+ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
+'
+
+# Test code for whether the C compiler supports C99 (global declarations)
+ac_c_conftest_c99_globals='
+// Does the compiler advertise C99 conformance?
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
+# error "Compiler does not advertise C99 conformance"
+#endif
+
+#include <stdbool.h>
+extern int puts (const char *);
+extern int printf (const char *, ...);
+extern int dprintf (int, const char *, ...);
+extern void *malloc (size_t);
+extern void free (void *);
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+// dprintf is used instead of fprintf to avoid needing to declare
+// FILE and stderr.
+#define debug(...) dprintf (2, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ #error "your preprocessor is broken"
+#endif
+#if BIG_OK
+#else
+ #error "your preprocessor is broken"
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case '\''s'\'': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case '\''d'\'': // int
+ number = va_arg (args_copy, int);
+ break;
+ case '\''f'\'': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}
+'
+
+# Test code for whether the C compiler supports C99 (body of main).
+ac_c_conftest_c99_main='
+ // Check bool.
+ _Bool success = false;
+ success |= (argc != 0);
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[0] = argv[0][0];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''
+ || dynamic_array[ni.number - 1] != 543);
+'
+
+# Test code for whether the C compiler supports C11 (global declarations)
+ac_c_conftest_c11_globals='
+// Does the compiler advertise C11 conformance?
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
+# error "Compiler does not advertise C11 conformance"
+#endif
+
+// Check _Alignas.
+char _Alignas (double) aligned_as_double;
+char _Alignas (0) no_special_alignment;
+extern char aligned_as_int;
+char _Alignas (0) _Alignas (int) aligned_as_int;
+
+// Check _Alignof.
+enum
+{
+ int_alignment = _Alignof (int),
+ int_array_alignment = _Alignof (int[100]),
+ char_alignment = _Alignof (char)
+};
+_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
+
+// Check _Noreturn.
+int _Noreturn does_not_return (void) { for (;;) continue; }
+
+// Check _Static_assert.
+struct test_static_assert
+{
+ int x;
+ _Static_assert (sizeof (int) <= sizeof (long int),
+ "_Static_assert does not work in struct");
+ long int y;
+};
+
+// Check UTF-8 literals.
+#define u8 syntax error!
+char const utf8_literal[] = u8"happens to be ASCII" "another string";
+
+// Check duplicate typedefs.
+typedef long *long_ptr;
+typedef long int *long_ptr;
+typedef long_ptr long_ptr;
+
+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
+struct anonymous
+{
+ union {
+ struct { int i; int j; };
+ struct { int k; long int l; } w;
+ };
+ int m;
+} v1;
+'
+
+# Test code for whether the C compiler supports C11 (body of main).
+ac_c_conftest_c11_main='
+ _Static_assert ((offsetof (struct anonymous, i)
+ == offsetof (struct anonymous, w.k)),
+ "Anonymous union alignment botch");
+ v1.i = 2;
+ v1.w.k = 5;
+ ok |= v1.i != 5;
+'
+
+# Test code for whether the C compiler supports C11 (complete).
+ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+${ac_c_conftest_c11_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ ${ac_c_conftest_c99_main}
+ ${ac_c_conftest_c11_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C99 (complete).
+ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ ${ac_c_conftest_c99_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C89 (complete).
+ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ return ok;
+}
+"
+
+as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H"
+as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H"
+as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H"
+as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
+as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H"
+as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"
+as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
+as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
+as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
+# Test code for whether the C++ compiler supports C++98 (global declarations)
+ac_cxx_conftest_cxx98_globals='
+// Does the compiler advertise C++98 conformance?
+#if !defined __cplusplus || __cplusplus < 199711L
+# error "Compiler does not advertise C++98 conformance"
+#endif
+
+// These inclusions are to reject old compilers that
+// lack the unsuffixed header files.
+#include <cstdlib>
+#include <exception>
+
+// <cassert> and <cstring> are *not* freestanding headers in C++98.
+extern void assert (int);
+namespace std {
+ extern int strcmp (const char *, const char *);
+}
+
+// Namespaces, exceptions, and templates were all added after "C++ 2.0".
+using std::exception;
+using std::strcmp;
+
+namespace {
+
+void test_exception_syntax()
+{
+ try {
+ throw "test";
+ } catch (const char *s) {
+ // Extra parentheses suppress a warning when building autoconf itself,
+ // due to lint rules shared with more typical C programs.
+ assert (!(strcmp) (s, "test"));
+ }
+}
+
+template <typename T> struct test_template
+{
+ T const val;
+ explicit test_template(T t) : val(t) {}
+ template <typename U> T add(U u) { return static_cast<T>(u) + val; }
+};
+
+} // anonymous namespace
+'
+
+# Test code for whether the C++ compiler supports C++98 (body of main)
+ac_cxx_conftest_cxx98_main='
+ assert (argc);
+ assert (! argv[0]);
+{
+ test_exception_syntax ();
+ test_template<double> tt (2.0);
+ assert (tt.add (4) == 6.0);
+ assert (true && !false);
+}
+'
+
+# Test code for whether the C++ compiler supports C++11 (global declarations)
+ac_cxx_conftest_cxx11_globals='
+// Does the compiler advertise C++ 2011 conformance?
+#if !defined __cplusplus || __cplusplus < 201103L
+# error "Compiler does not advertise C++11 conformance"
+#endif
+
+namespace cxx11test
+{
+ constexpr int get_val() { return 20; }
+
+ struct testinit
+ {
+ int i;
+ double d;
+ };
+
+ class delegate
+ {
+ public:
+ delegate(int n) : n(n) {}
+ delegate(): delegate(2354) {}
+
+ virtual int getval() { return this->n; };
+ protected:
+ int n;
+ };
+
+ class overridden : public delegate
+ {
+ public:
+ overridden(int n): delegate(n) {}
+ virtual int getval() override final { return this->n * 2; }
+ };
+
+ class nocopy
+ {
+ public:
+ nocopy(int i): i(i) {}
+ nocopy() = default;
+ nocopy(const nocopy&) = delete;
+ nocopy & operator=(const nocopy&) = delete;
+ private:
+ int i;
+ };
+
+ // for testing lambda expressions
+ template <typename Ret, typename Fn> Ret eval(Fn f, Ret v)
+ {
+ return f(v);
+ }
+
+ // for testing variadic templates and trailing return types
+ template <typename V> auto sum(V first) -> V
+ {
+ return first;
+ }
+ template <typename V, typename... Args> auto sum(V first, Args... rest) -> V
+ {
+ return first + sum(rest...);
+ }
+}
+'
+
+# Test code for whether the C++ compiler supports C++11 (body of main)
+ac_cxx_conftest_cxx11_main='
+{
+ // Test auto and decltype
+ auto a1 = 6538;
+ auto a2 = 48573953.4;
+ auto a3 = "String literal";
+
+ int total = 0;
+ for (auto i = a3; *i; ++i) { total += *i; }
+
+ decltype(a2) a4 = 34895.034;
+}
+{
+ // Test constexpr
+ short sa[cxx11test::get_val()] = { 0 };
+}
+{
+ // Test initializer lists
+ cxx11test::testinit il = { 4323, 435234.23544 };
+}
+{
+ // Test range-based for
+ int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3,
+ 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
+ for (auto &x : array) { x += 23; }
+}
+{
+ // Test lambda expressions
+ using cxx11test::eval;
+ assert (eval ([](int x) { return x*2; }, 21) == 42);
+ double d = 2.0;
+ assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0);
+ assert (d == 5.0);
+ assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0);
+ assert (d == 5.0);
+}
+{
+ // Test use of variadic templates
+ using cxx11test::sum;
+ auto a = sum(1);
+ auto b = sum(1, 2);
+ auto c = sum(1.0, 2.0, 3.0);
+}
+{
+ // Test constructor delegation
+ cxx11test::delegate d1;
+ cxx11test::delegate d2();
+ cxx11test::delegate d3(45);
+}
+{
+ // Test override and final
+ cxx11test::overridden o1(55464);
+}
+{
+ // Test nullptr
+ char *c = nullptr;
+}
+{
+ // Test template brackets
+ test_template<::test_template<int>> v(test_template<int>(12));
+}
+{
+ // Unicode literals
+ char const *utf8 = u8"UTF-8 string \u2500";
+ char16_t const *utf16 = u"UTF-8 string \u2500";
+ char32_t const *utf32 = U"UTF-32 string \u2500";
+}
+'
+
+# Test code for whether the C compiler supports C++11 (complete).
+ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals}
+${ac_cxx_conftest_cxx11_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_cxx_conftest_cxx98_main}
+ ${ac_cxx_conftest_cxx11_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C++98 (complete).
+ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals}
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_cxx_conftest_cxx98_main}
+ return ok;
+}
+"
+
+as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H"
+as_fn_append ac_func_c_list " getpagesize HAVE_GETPAGESIZE"
+
+# Auxiliary files required by this configure script.
+ac_aux_files="ltmain.sh compile ar-lib missing install-sh config.guess config.sub"
+
+# Locations in which to look for auxiliary files.
+ac_aux_dir_candidates="${srcdir}/conftools"
+
+# Search for a directory containing all of the required auxiliary files,
+# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
+# If we don't find one directory that contains all the files we need,
+# we report the set of missing files from the *first* directory in
+# $ac_aux_dir_candidates and give up.
+ac_missing_aux_files=""
+ac_first_candidate=:
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in $ac_aux_dir_candidates
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ as_found=:
+
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5
+ ac_aux_dir_found=yes
+ ac_install_sh=
+ for ac_aux in $ac_aux_files
+ do
+ # As a special case, if "install-sh" is required, that requirement
+ # can be satisfied by any of "install-sh", "install.sh", or "shtool",
+ # and $ac_install_sh is set appropriately for whichever one is found.
+ if test x"$ac_aux" = x"install-sh"
+ then
+ if test -f "${as_dir}install-sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5
+ ac_install_sh="${as_dir}install-sh -c"
+ elif test -f "${as_dir}install.sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5
+ ac_install_sh="${as_dir}install.sh -c"
+ elif test -f "${as_dir}shtool"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5
+ ac_install_sh="${as_dir}shtool install -c"
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} install-sh"
+ else
+ break
+ fi
+ fi
+ else
+ if test -f "${as_dir}${ac_aux}"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
+ else
+ break
+ fi
+ fi
+ fi
+ done
+ if test "$ac_aux_dir_found" = yes; then
+ ac_aux_dir="$as_dir"
+ break
+ fi
+ ac_first_candidate=false
+
+ as_found=false
+done
+IFS=$as_save_IFS
+if $as_found
+then :
+
+else $as_nop
+ as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5
+fi
+
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+if test -f "${ac_aux_dir}config.guess"; then
+ ac_config_guess="$SHELL ${ac_aux_dir}config.guess"
+fi
+if test -f "${ac_aux_dir}config.sub"; then
+ ac_config_sub="$SHELL ${ac_aux_dir}config.sub"
+fi
+if test -f "$ac_aux_dir/configure"; then
+ ac_configure="$SHELL ${ac_aux_dir}configure"
+fi
+
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
@@ -2411,12 +3178,12 @@ for ac_var in $ac_precious_vars; do
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
@@ -2425,24 +3192,24 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
@@ -2452,11 +3219,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi
done
if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
+ and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -2472,56 +3240,32 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-ac_aux_dir=
-for ac_dir in conftools "$srcdir"/conftools; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in conftools \"$srcdir\"/conftools" "$LINENO" 5
-fi
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ # Make sure we can run config.sub.
+$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+printf %s "checking build system type... " >&6; }
+if test ${ac_cv_build+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+ ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+printf "%s\n" "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
@@ -2540,21 +3284,22 @@ IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+printf %s "checking host system type... " >&6; }
+if test ${ac_cv_host+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+ ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+printf "%s\n" "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
@@ -2575,7 +3320,8 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
am__api_version='1.16'
-# Find a good install program. We prefer a C program (faster),
+
+ # Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
@@ -2589,20 +3335,25 @@ am__api_version='1.16'
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+printf %s "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+if test ${ac_cv_path_install+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ # Account for fact that we put trailing slashes in our PATH walk.
+case $as_dir in #((
+ ./ | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
@@ -2612,13 +3363,13 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
@@ -2626,12 +3377,12 @@ case $as_dir/ in #((
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c"
break 3
fi
fi
@@ -2647,7 +3398,7 @@ IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
- if test "${ac_cv_path_install+set}" = set; then
+ if test ${ac_cv_path_install+y}; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
@@ -2657,8 +3408,8 @@ fi
INSTALL=$ac_install_sh
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+printf "%s\n" "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -2668,8 +3419,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+printf %s "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -2723,8 +3474,8 @@ else
as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
@@ -2743,26 +3494,23 @@ test "$program_suffix" != NONE &&
# Double any \ or $.
# By default was `s,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"`
+
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+
+ if test x"${MISSING+set}" != xset; then
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh+set}" != xset; then
@@ -2782,11 +3530,12 @@ if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
@@ -2794,11 +3543,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2809,11 +3562,11 @@ fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+printf "%s\n" "$STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -2822,11 +3575,12 @@ if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
@@ -2834,11 +3588,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2849,11 +3607,11 @@ fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+printf "%s\n" "$ac_ct_STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
@@ -2861,8 +3619,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
@@ -2874,25 +3632,31 @@ fi
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5
+printf %s "checking for a race-free mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${ac_cv_path_mkdir+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
+ as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir ('*'coreutils) '* | \
+ 'BusyBox '* | \
'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext
break 3;;
esac
done
@@ -2903,7 +3667,7 @@ IFS=$as_save_IFS
fi
test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
+ if test ${ac_cv_path_mkdir+y}; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
# As a last resort, use the slow shell script. Don't cache a
@@ -2913,18 +3677,19 @@ fi
MKDIR_P="$ac_install_sh -d"
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+printf "%s\n" "$MKDIR_P" >&6; }
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AWK+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
@@ -2932,11 +3697,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2947,24 +3716,25 @@ fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+printf "%s\n" "$AWK" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
test -n "$AWK" && break
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@@ -2980,12 +3750,12 @@ esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -2999,7 +3769,8 @@ fi
rmdir .tst 2>/dev/null
# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
+if test ${enable_silent_rules+y}
+then :
enableval=$enable_silent_rules;
fi
@@ -3009,12 +3780,13 @@ case $enable_silent_rules in # (((
*) AM_DEFAULT_VERBOSITY=1;;
esac
am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+printf %s "checking whether $am_make supports nested variables... " >&6; }
+if test ${am_cv_make_support_nested_variables+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if printf "%s\n" 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
@@ -3026,8 +3798,8 @@ else
am_cv_make_support_nested_variables=no
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
if test $am_cv_make_support_nested_variables = yes; then
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
@@ -3059,17 +3831,13 @@ fi
# Define the identity of the package.
PACKAGE='expat'
- VERSION='2.2.10'
+ VERSION='2.7.1'
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
+printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
+printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h
# Some tools Automake needs.
@@ -3109,6 +3877,20 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+
+
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
@@ -3153,53 +3935,56 @@ END
fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test ${enable_maintainer_mode+y}
+then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else $as_nop
+ USE_MAINTAINER_MODE=yes
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+printf "%s\n" "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+ # to allow argument --disable-maintainer-mode
+
+
+
+LIBCURRENT=11 # sync
+LIBREVISION=2 # with
+LIBAGE=10 # CMakeLists.txt!
+
+ac_config_headers="$ac_config_headers expat_config.h"
+
-LIBCURRENT=7 # sync
-LIBREVISION=12 # with
-LIBAGE=6 # CMakeLists.txt!
-if ${AM_CPPFLAGS+:} false; then :
- case " $AM_CPPFLAGS " in #(
- *" -DHAVE_EXPAT_CONFIG_H "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DHAVE_EXPAT_CONFIG_H"; } >&5
- (: AM_CPPFLAGS already contains -DHAVE_EXPAT_CONFIG_H) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } ;; #(
- *) :
- as_fn_append AM_CPPFLAGS " -DHAVE_EXPAT_CONFIG_H"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5
- (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- ;;
-esac
-else
- AM_CPPFLAGS=-DHAVE_EXPAT_CONFIG_H
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5
- (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-fi
-ac_config_headers="$ac_config_headers expat_config.h"
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
-$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; }
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target >confinc.out
@@ -3235,11 +4020,12 @@ esac
fi
done
rm -f confinc.* confmf.*
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
-$as_echo "${_am_result}" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+printf "%s\n" "${_am_result}" >&6; }
# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
+if test ${enable_dependency_tracking+y}
+then :
enableval=$enable_dependency_tracking;
fi
@@ -3265,11 +4051,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3277,11 +4064,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3292,11 +4083,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3305,11 +4096,12 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
@@ -3317,11 +4109,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3332,11 +4128,11 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
@@ -3344,8 +4140,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -3358,11 +4154,12 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3370,11 +4167,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3385,11 +4186,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3398,11 +4199,12 @@ fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3411,15 +4213,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3435,18 +4241,18 @@ if test $ac_prog_rejected = yes; then
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3457,11 +4263,12 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3469,11 +4276,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3484,11 +4295,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3501,11 +4312,12 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
@@ -3513,11 +4325,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3528,11 +4344,11 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3544,8 +4360,8 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -3553,25 +4369,129 @@ esac
fi
fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
+set dummy ${ac_tool_prefix}clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "clang", so it can be a program name with args.
+set dummy clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+
+
+test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
+for ac_option in --version -v -V -qversion -version; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -3581,7 +4501,7 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
@@ -3589,7 +4509,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -3601,9 +4521,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+printf %s "checking whether the C compiler works... " >&6; }
+ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
@@ -3624,11 +4544,12 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
@@ -3645,7 +4566,7 @@ do
# certainly right.
break;;
*.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
@@ -3661,44 +4582,46 @@ do
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
-else
+else $as_nop
ac_file=''
fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+printf %s "checking for C compiler default output file name... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+printf "%s\n" "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+printf %s "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -3712,15 +4635,15 @@ for ac_file in conftest.exe conftest conftest.*; do
* ) break;;
esac
done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+else $as_nop
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+printf "%s\n" "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
@@ -3729,7 +4652,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
int
-main ()
+main (void)
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
@@ -3741,8 +4664,8 @@ _ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+printf %s "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
@@ -3750,10 +4673,10 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
@@ -3761,39 +4684,40 @@ $as_echo "$ac_try_echo"; } >&5
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+printf "%s\n" "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+printf %s "checking for suffix of object files... " >&6; }
+if test ${ac_cv_objext+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -3807,11 +4731,12 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
@@ -3820,31 +4745,32 @@ $as_echo "$ac_try_echo"; } >&5
break;;
esac
done
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+printf "%s\n" "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
+printf %s "checking whether the compiler supports GNU C... " >&6; }
+if test ${ac_cv_c_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -3854,29 +4780,33 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_compiler_gnu=yes
-else
+else $as_nop
ac_compiler_gnu=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
-ac_test_CFLAGS=${CFLAGS+set}
+ac_test_CFLAGS=${CFLAGS+y}
ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+printf %s "checking whether $CC accepts -g... " >&6; }
+if test ${ac_cv_prog_cc_g+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
@@ -3885,57 +4815,60 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
-else
+else $as_nop
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
-else
+else $as_nop
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
+if test $ac_test_CFLAGS; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
@@ -3950,94 +4883,144 @@ else
CFLAGS=
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
+ac_prog_cc_stdc=no
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
+printf %s "checking for $CC option to enable C11 features... " >&6; }
+if test ${ac_cv_prog_cc_c11+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cc_c11=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+$ac_c_conftest_c11_program
+_ACEOF
+for ac_arg in '' -std=gnu11
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+fi
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+if test "x$ac_cv_prog_cc_c11" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cc_c11" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
+ CC="$CC $ac_cv_prog_cc_c11"
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
+ ac_prog_cc_stdc=c11
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
+printf %s "checking for $CC option to enable C99 features... " >&6; }
+if test ${ac_cv_prog_cc_c99+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c99_program
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+fi
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
+if test "x$ac_cv_prog_cc_c99" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cc_c99" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
+ CC="$CC $ac_cv_prog_cc_c99"
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+ ac_prog_cc_stdc=c99
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
+printf %s "checking for $CC option to enable C89 features... " >&6; }
+if test ${ac_cv_prog_cc_c89+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c89_program
_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
+ if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_c89=$ac_arg
fi
-rm -f core conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
-
fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
+if test "x$ac_cv_prog_cc_c89" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cc_c89" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
+ CC="$CC $ac_cv_prog_cc_c89"
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+ ac_prog_cc_stdc=c89
+fi
fi
ac_ext=c
@@ -4046,21 +5029,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-ac_ext=c
+
+ ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+printf %s "checking whether $CC understands -c and -o together... " >&6; }
+if test ${am_cv_prog_cc_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -4088,8 +5073,8 @@ _ACEOF
rm -f core conftest*
unset am_i
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+printf "%s\n" "$am_cv_prog_cc_c_o" >&6; }
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
@@ -4107,11 +5092,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
depcc="$CC" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CC_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
@@ -4218,8 +5204,8 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
if
@@ -4234,16 +5220,18 @@ fi
-if test -n "$ac_tool_prefix"; then
+
+ if test -n "$ac_tool_prefix"; then
for ac_prog in ar lib "link -lib"
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AR"; then
ac_cv_prog_AR="$AR" # Let the user override the test.
else
@@ -4251,11 +5239,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -4266,11 +5258,11 @@ fi
fi
AR=$ac_cv_prog_AR
if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+printf "%s\n" "$AR" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -4283,11 +5275,12 @@ if test -z "$AR"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_AR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_AR"; then
ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
else
@@ -4295,11 +5288,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -4310,11 +5307,11 @@ fi
fi
ac_ct_AR=$ac_cv_prog_ac_ct_AR
if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+printf "%s\n" "$ac_ct_AR" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -4326,8 +5323,8 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
AR=$ac_ct_AR
@@ -4336,11 +5333,12 @@ fi
: ${AR=ar}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
-$as_echo_n "checking the archiver ($AR) interface... " >&6; }
-if ${am_cv_ar_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
+printf %s "checking the archiver ($AR) interface... " >&6; }
+if test ${am_cv_ar_interface+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4352,12 +5350,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
/* end confdefs.h. */
int some_variable = 0;
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
(eval $am_ar_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test "$ac_status" -eq 0; then
am_cv_ar_interface=ar
@@ -4366,7 +5365,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
(eval $am_ar_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test "$ac_status" -eq 0; then
am_cv_ar_interface=lib
@@ -4377,7 +5376,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
rm -f conftest.lib libconftest.a
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4385,8 +5384,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
-$as_echo "$am_cv_ar_interface" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
+printf "%s\n" "$am_cv_ar_interface" >&6; }
case $am_cv_ar_interface in
ar)
@@ -4406,24 +5405,25 @@ unknown)
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+printf %s "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+printf "%s\n" "no, using $LN_S" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@@ -4439,12 +5439,12 @@ esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -4452,14 +5452,15 @@ fi
case `pwd` in
*\ * | *\ *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
esac
-macro_version='2.4.6'
-macro_revision='2.4.6'
+macro_version='2.5.4'
+macro_revision='2.5.4'
+
@@ -4496,8 +5497,8 @@ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+printf %s "checking how to print strings... " >&6; }
# Test print first, because it will be a builtin if present.
if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
@@ -4523,12 +5524,12 @@ func_echo_all ()
}
case $ECHO in
- printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
- print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
+ printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+printf "%s\n" "printf" >&6; } ;;
+ print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+printf "%s\n" "print -r" >&6; } ;;
+ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+printf "%s\n" "cat" >&6; } ;;
esac
@@ -4544,11 +5545,12 @@ esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+printf %s "checking for a sed that does not truncate output... " >&6; }
+if test ${ac_cv_path_SED+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
for ac_i in 1 2 3 4 5 6 7; do
ac_script="$ac_script$as_nl$ac_script"
@@ -4562,10 +5564,15 @@ else
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in sed gsed; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in sed gsed
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_SED="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
@@ -4574,13 +5581,13 @@ case `"$ac_path_SED" --version 2>&1` in
ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo '' >> "conftest.nl"
+ printf "%s\n" '' >> "conftest.nl"
"$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -4608,8 +5615,8 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+printf "%s\n" "$ac_cv_path_SED" >&6; }
SED="$ac_cv_path_SED"
rm -f conftest.sed
@@ -4626,11 +5633,12 @@ Xsed="$SED -e 1s/^X//"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+printf %s "checking for grep that handles long lines and -e... " >&6; }
+if test ${ac_cv_path_GREP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
@@ -4638,10 +5646,15 @@ else
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in grep ggrep
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
@@ -4650,13 +5663,13 @@ case `"$ac_path_GREP" --version 2>&1` in
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
+ printf "%s\n" 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -4684,16 +5697,17 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+printf "%s\n" "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+printf %s "checking for egrep... " >&6; }
+if test ${ac_cv_path_EGREP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
@@ -4704,10 +5718,15 @@ else
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in egrep
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
@@ -4716,13 +5735,13 @@ case `"$ac_path_EGREP" --version 2>&1` in
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
+ printf "%s\n" 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -4751,16 +5770,17 @@ fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+printf "%s\n" "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+printf %s "checking for fgrep... " >&6; }
+if test ${ac_cv_path_FGREP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
then ac_cv_path_FGREP="$GREP -F"
else
@@ -4771,10 +5791,15 @@ else
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in fgrep; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in fgrep
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_FGREP" || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
@@ -4783,13 +5808,13 @@ case `"$ac_path_FGREP" --version 2>&1` in
ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo 'FGREP' >> "conftest.nl"
+ printf "%s\n" 'FGREP' >> "conftest.nl"
"$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -4818,8 +5843,8 @@ fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+printf "%s\n" "$ac_cv_path_FGREP" >&6; }
FGREP="$ac_cv_path_FGREP"
@@ -4844,19 +5869,20 @@ test -z "$GREP" && GREP=grep
# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
+if test ${with_gnu_ld+y}
+then :
withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
-else
+else $as_nop
with_gnu_ld=no
fi
ac_prog=ld
if test yes = "$GCC"; then
# Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+printf %s "checking for ld used by $CC... " >&6; }
case $host in
- *-*-mingw*)
+ *-*-mingw* | *-*-windows*)
# gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
@@ -4883,15 +5909,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
;;
esac
elif test yes = "$with_gnu_ld"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+printf %s "checking for GNU ld... " >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+printf %s "checking for non-GNU ld... " >&6; }
fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+if test ${lt_cv_path_LD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$LD"; then
lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
@@ -4920,18 +5947,19 @@ fi
LD=$lt_cv_path_LD
if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+printf "%s\n" "$LD" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+printf %s "checking if the linker ($LD) is GNU ld... " >&6; }
+if test ${lt_cv_prog_gnu_ld+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
@@ -4942,8 +5970,8 @@ case `$LD -v 2>&1 </dev/null` in
;;
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; }
with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -4954,11 +5982,12 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test ${lt_cv_path_NM+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$NM"; then
# Let the user override the test.
lt_cv_path_NM=$NM
@@ -4980,16 +6009,16 @@ else
# Tru64's nm complains that /dev/null is an invalid object file
# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
case $build_os in
- mingw*) lt_bad_file=conftest.nm/nofile ;;
+ mingw* | windows*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
- case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
*$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break 2
;;
*)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break 2
@@ -5008,8 +6037,8 @@ else
: ${lt_cv_path_NM=no}
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+printf "%s\n" "$lt_cv_path_NM" >&6; }
if test no != "$lt_cv_path_NM"; then
NM=$lt_cv_path_NM
else
@@ -5022,11 +6051,12 @@ else
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_DUMPBIN+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$DUMPBIN"; then
ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
else
@@ -5034,11 +6064,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5049,11 +6083,11 @@ fi
fi
DUMPBIN=$ac_cv_prog_DUMPBIN
if test -n "$DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+printf "%s\n" "$DUMPBIN" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5066,11 +6100,12 @@ if test -z "$DUMPBIN"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_DUMPBIN+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_DUMPBIN"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
else
@@ -5078,11 +6113,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5093,11 +6132,11 @@ fi
fi
ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
if test -n "$ac_ct_DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+printf "%s\n" "$ac_ct_DUMPBIN" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5109,15 +6148,15 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DUMPBIN=$ac_ct_DUMPBIN
fi
fi
- case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols -headers"
;;
@@ -5138,11 +6177,12 @@ test -z "$NM" && NM=nm
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+printf %s "checking the name lister ($NM) interface... " >&6; }
+if test ${lt_cv_nm_interface+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
@@ -5158,15 +6198,16 @@ else
fi
rm -f conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+printf "%s\n" "$lt_cv_nm_interface" >&6; }
# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+printf %s "checking the maximum length of command line arguments... " >&6; }
+if test ${lt_cv_sys_max_cmd_len+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
i=0
teststring=ABCD
@@ -5179,14 +6220,14 @@ else
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
+ gnu* | ironclad*)
+ # Under GNU Hurd and Ironclad, this test is not required because there
+ # is no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
@@ -5202,18 +6243,13 @@ else
lt_cv_sys_max_cmd_len=8192;
;;
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
lt_cv_sys_max_cmd_len=8192;
;;
- bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -5256,7 +6292,7 @@ else
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
@@ -5298,11 +6334,11 @@ else
fi
if test -n "$lt_cv_sys_max_cmd_len"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
+printf "%s\n" "none" >&6; }
fi
max_cmd_len=$lt_cv_sys_max_cmd_len
@@ -5346,15 +6382,16 @@ esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+printf %s "checking how to convert $build file names to $host format... " >&6; }
+if test ${lt_cv_to_host_file_cmd+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
case $host in
*-*-mingw* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
;;
*-*-cygwin* )
@@ -5367,7 +6404,7 @@ else
;;
*-*-cygwin* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
;;
*-*-cygwin* )
@@ -5386,24 +6423,25 @@ esac
fi
to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+printf %s "checking how to convert $build file names to toolchain format... " >&6; }
+if test ${lt_cv_to_tool_file_cmd+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
#assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
- *-*-mingw* )
+ *-*-mingw* | *-*-windows* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
;;
esac
@@ -5413,22 +6451,23 @@ esac
fi
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+printf %s "checking for $LD option to reload object files... " >&6; }
+if test ${lt_cv_ld_reload_flag+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_ld_reload_flag='-r'
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+printf "%s\n" "$lt_cv_ld_reload_flag" >&6; }
reload_flag=$lt_cv_ld_reload_flag
case $reload_flag in
"" | " "*) ;;
@@ -5436,7 +6475,7 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
if test yes != "$GCC"; then
reload_cmds=false
fi
@@ -5458,14 +6497,64 @@ esac
+# Extract the first word of "file", so it can be a program name with args.
+set dummy file; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_FILECMD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$FILECMD"; then
+ ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_FILECMD="file"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":"
+fi
+fi
+FILECMD=$ac_cv_prog_FILECMD
+if test -n "$FILECMD"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5
+printf "%s\n" "$FILECMD" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+
+
+
+
+
+
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_OBJDUMP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$OBJDUMP"; then
ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
else
@@ -5473,11 +6562,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5488,11 +6581,11 @@ fi
fi
OBJDUMP=$ac_cv_prog_OBJDUMP
if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+printf "%s\n" "$OBJDUMP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5501,11 +6594,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then
ac_ct_OBJDUMP=$OBJDUMP
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_OBJDUMP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_OBJDUMP"; then
ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
else
@@ -5513,11 +6607,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5528,11 +6626,11 @@ fi
fi
ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+printf "%s\n" "$ac_ct_OBJDUMP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_OBJDUMP" = x; then
@@ -5540,8 +6638,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OBJDUMP=$ac_ct_OBJDUMP
@@ -5557,11 +6655,12 @@ test -z "$OBJDUMP" && OBJDUMP=objdump
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+printf %s "checking how to recognize dependent libraries... " >&6; }
+if test ${lt_cv_deplibs_check_method+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_deplibs_check_method='unknown'
@@ -5570,7 +6669,6 @@ lt_cv_deplibs_check_method='unknown'
# 'none' -- dependencies not supported.
# 'unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# that responds to the $file_magic_cmd with a given extended regex.
# If you have 'file' or equivalent on your system and you're not sure
@@ -5587,7 +6685,7 @@ beos*)
bsdi[45]*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_cmd='$FILECMD -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -5597,7 +6695,7 @@ cygwin*)
lt_cv_file_magic_cmd='func_win32_libid'
;;
-mingw* | pw32*)
+mingw* | windows* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
@@ -5606,7 +6704,7 @@ mingw* | pw32*)
lt_cv_file_magic_cmd='func_win32_libid'
else
# Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
@@ -5621,14 +6719,14 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -5642,7 +6740,7 @@ haiku*)
;;
hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
@@ -5679,7 +6777,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd*)
+*-mlibc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
@@ -5689,7 +6791,7 @@ netbsd*)
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
@@ -5697,7 +6799,7 @@ newos6*)
lt_cv_deplibs_check_method=pass_all
;;
-openbsd* | bitrig*)
+openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
else
@@ -5713,6 +6815,10 @@ rdos*)
lt_cv_deplibs_check_method=pass_all
;;
+serenity*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -5757,14 +6863,14 @@ os2*)
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+printf "%s\n" "$lt_cv_deplibs_check_method" >&6; }
file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
case $host_os in
- mingw* | pw32*)
+ mingw* | windows* | pw32*)
if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
want_nocaseglob=yes
else
@@ -5802,11 +6908,12 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_DLLTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$DLLTOOL"; then
ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
else
@@ -5814,11 +6921,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5829,11 +6940,11 @@ fi
fi
DLLTOOL=$ac_cv_prog_DLLTOOL
if test -n "$DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+printf "%s\n" "$DLLTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5842,11 +6953,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then
ac_ct_DLLTOOL=$DLLTOOL
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_DLLTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_DLLTOOL"; then
ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
else
@@ -5854,11 +6966,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5869,11 +6985,11 @@ fi
fi
ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
if test -n "$ac_ct_DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+printf "%s\n" "$ac_ct_DLLTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_DLLTOOL" = x; then
@@ -5881,8 +6997,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DLLTOOL=$ac_ct_DLLTOOL
@@ -5899,15 +7015,16 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+printf %s "checking how to associate runtime and link libraries... " >&6; }
+if test ${lt_cv_sharedlib_from_linklib_cmd+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
# two different shell functions defined in ltmain.sh;
# decide which one to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
@@ -5926,8 +7043,8 @@ cygwin* | mingw* | pw32* | cegcc*)
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
@@ -5938,15 +7055,118 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+printf "%s\n" "$RANLIB" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+printf "%s\n" "$ac_ct_RANLIB" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
for ac_prog in ar
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AR"; then
ac_cv_prog_AR="$AR" # Let the user override the test.
else
@@ -5954,11 +7174,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5969,11 +7193,11 @@ fi
fi
AR=$ac_cv_prog_AR
if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+printf "%s\n" "$AR" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5986,11 +7210,12 @@ if test -z "$AR"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_AR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_AR"; then
ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
else
@@ -5998,11 +7223,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6013,11 +7242,11 @@ fi
fi
ac_ct_AR=$ac_cv_prog_ac_ct_AR
if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+printf "%s\n" "$ac_ct_AR" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -6029,8 +7258,8 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
AR=$ac_ct_AR
@@ -6038,42 +7267,60 @@ esac
fi
: ${AR=ar}
-: ${AR_FLAGS=cru}
+# Use ARFLAGS variable as AR's operation code to sync the variable naming with
+# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
+# higher priority because that's what people were doing historically (setting
+# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
+# variable obsoleted/removed.
+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
+lt_ar_flags=$AR_FLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+
+
+# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
+# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
+
+
+
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+printf %s "checking for archiver @FILE support... " >&6; }
+if test ${lt_cv_ar_at_file+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_ar_at_file=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
echo conftest.$ac_objext > conftest.lst
lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
(eval $lt_ar_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test 0 -eq "$ac_status"; then
# Ensure the archiver fails upon bogus file names.
@@ -6081,7 +7328,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
(eval $lt_ar_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test 0 -ne "$ac_status"; then
lt_cv_ar_at_file=@
@@ -6090,11 +7337,11 @@ if ac_fn_c_try_compile "$LINENO"; then :
rm -f conftest.* libconftest.a
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+printf "%s\n" "$lt_cv_ar_at_file" >&6; }
if test no = "$lt_cv_ar_at_file"; then
archiver_list_spec=
@@ -6111,11 +7358,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
@@ -6123,11 +7371,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6138,11 +7390,11 @@ fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+printf "%s\n" "$STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -6151,11 +7403,12 @@ if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
@@ -6163,11 +7416,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6178,11 +7435,11 @@ fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+printf "%s\n" "$ac_ct_STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
@@ -6190,8 +7447,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
@@ -6207,97 +7464,6 @@ test -z "$STRIP" && STRIP=:
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
test -z "$RANLIB" && RANLIB=:
@@ -6312,15 +7478,8 @@ old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
- case $host_os in
- bitrig* | openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -6379,11 +7538,12 @@ compiler=$CC
# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+printf %s "checking command to parse $NM output from $compiler object... " >&6; }
+if test ${lt_cv_sys_global_symbol_pipe+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix. What could be older than Ultrix?!! ;)]
@@ -6399,7 +7559,7 @@ case $host_os in
aix*)
symcode='[BCDT]'
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
symcode='[ABCDGISTW]'
;;
hpux*)
@@ -6414,7 +7574,7 @@ osf*)
symcode='[BCDEGQRST]'
;;
solaris*)
- symcode='[BDRT]'
+ symcode='[BCDRT]'
;;
sco3.2v5*)
symcode='[DT]'
@@ -6438,7 +7598,7 @@ esac
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Gets list of data symbols to import.
- lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
# Adjust the below global symbol transforms to fixup imported variables.
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
@@ -6456,20 +7616,20 @@ fi
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
$lt_cdecl_hook\
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
$lt_c_name_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
# Transform an extracted symbol line into symbol name with lib prefix and
# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
$lt_c_name_lib_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
@@ -6478,7 +7638,7 @@ $lt_c_name_lib_hook\
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
-mingw*)
+mingw* | windows*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
@@ -6493,7 +7653,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
- # Also find C++ and __fastcall symbols from MSVC++,
+ # Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
@@ -6511,9 +7671,9 @@ for ac_symprfx in "" "_"; do
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx"
else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -6529,21 +7689,18 @@ void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
+int main(void){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -6611,7 +7768,7 @@ _LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s conftest$ac_exeext; then
pipe_works=yes
fi
@@ -6646,11 +7803,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then
lt_cv_sys_global_symbol_to_cdecl=
fi
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+printf "%s\n" "failed" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+printf "%s\n" "ok" >&6; }
fi
# Response file support.
@@ -6696,13 +7853,14 @@ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+printf %s "checking for sysroot... " >&6; }
# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
+if test ${with_sysroot+y}
+then :
withval=$with_sysroot;
-else
+else $as_nop
with_sysroot=no
fi
@@ -6711,33 +7869,36 @@ lt_sysroot=
case $with_sysroot in #(
yes)
if test yes = "$GCC"; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ # Trim trailing / since we'll always append absolute paths and we want
+ # to avoid //, if only for less confusing output for the user.
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
fi
;; #(
/*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
-$as_echo "$with_sysroot" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+printf "%s\n" "$with_sysroot" >&6; }
as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+printf "%s\n" "${lt_sysroot:-no}" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
-$as_echo_n "checking for a working dd... " >&6; }
-if ${ac_cv_path_lt_DD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+printf %s "checking for a working dd... " >&6; }
+if test ${ac_cv_path_lt_DD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
printf 0123456789abcdef0123456789abcdef >conftest.i
cat conftest.i conftest.i >conftest2.i
: ${lt_DD:=$DD}
@@ -6748,10 +7909,15 @@ if test -z "$lt_DD"; then
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in dd; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in dd
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_lt_DD" || continue
if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
cmp -s conftest.i conftest.out \
@@ -6771,15 +7937,16 @@ fi
rm -f conftest.i conftest2.i conftest.out
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
-$as_echo "$ac_cv_path_lt_DD" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+printf "%s\n" "$ac_cv_path_lt_DD" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
-$as_echo_n "checking how to truncate binary pipes... " >&6; }
-if ${lt_cv_truncate_bin+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+printf %s "checking how to truncate binary pipes... " >&6; }
+if test ${lt_cv_truncate_bin+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
printf 0123456789abcdef0123456789abcdef >conftest.i
cat conftest.i conftest.i >conftest2.i
lt_cv_truncate_bin=
@@ -6790,8 +7957,8 @@ fi
rm -f conftest.i conftest2.i conftest.out
test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
-$as_echo "$lt_cv_truncate_bin" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+printf "%s\n" "$lt_cv_truncate_bin" >&6; }
@@ -6814,7 +7981,8 @@ func_cc_basename ()
}
# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
+if test ${enable_libtool_lock+y}
+then :
enableval=$enable_libtool_lock;
fi
@@ -6830,9 +7998,9 @@ ia64-*-hpux*)
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE=32
;;
@@ -6850,10 +8018,10 @@ ia64-*-hpux*)
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
if test yes = "$lt_cv_prog_gnu_ld"; then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
@@ -6865,7 +8033,7 @@ ia64-*-hpux*)
;;
esac
else
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -6888,10 +8056,10 @@ mips64*-*linux*)
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
emul=elf
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
emul="${emul}32"
;;
@@ -6899,7 +8067,7 @@ mips64*-*linux*)
emul="${emul}64"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*MSB*)
emul="${emul}btsmip"
;;
@@ -6907,7 +8075,7 @@ mips64*-*linux*)
emul="${emul}ltsmip"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*N32*)
emul="${emul}n32"
;;
@@ -6918,7 +8086,7 @@ mips64*-*linux*)
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*)
# Find out what ABI is being produced by ac_compile, and set linker
# options accordingly. Note that the listed cases only cover the
# situations where additional linker options are needed (such as when
@@ -6929,16 +8097,16 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
- x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
+ x86_64-*linux*|x86_64-gnu*)
+ case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
;;
@@ -6966,7 +8134,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
LD="${LD-ld} -m elf_x86_64"
;;
powerpcle-*linux*|powerpc64le-*linux*)
@@ -6992,11 +8160,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -belf"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+printf %s "checking whether the C compiler needs -belf... " >&6; }
+if test ${lt_cv_cc_needs_belf+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -7007,19 +8176,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_cv_cc_needs_belf=yes
-else
+else $as_nop
lt_cv_cc_needs_belf=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7028,8 +8198,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+printf "%s\n" "$lt_cv_cc_needs_belf" >&6; }
if test yes != "$lt_cv_cc_needs_belf"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS=$SAVE_CFLAGS
@@ -7042,9 +8212,9 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*)
@@ -7079,11 +8249,12 @@ need_locks=$enable_libtool_lock
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_MANIFEST_TOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$MANIFEST_TOOL"; then
ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
else
@@ -7091,11 +8262,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7106,11 +8281,11 @@ fi
fi
MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
if test -n "$MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+printf "%s\n" "$MANIFEST_TOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7119,11 +8294,12 @@ if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
# Extract the first word of "mt", so it can be a program name with args.
set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_MANIFEST_TOOL"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
else
@@ -7131,11 +8307,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7146,11 +8326,11 @@ fi
fi
ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
if test -n "$ac_ct_MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_MANIFEST_TOOL" = x; then
@@ -7158,8 +8338,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
@@ -7169,23 +8349,24 @@ else
fi
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_path_mainfest_tool=no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if test ${lt_cv_path_manifest_tool+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ lt_cv_path_manifest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
cat conftest.err >&5
if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
+ lt_cv_path_manifest_tool=yes
fi
rm -f conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test yes != "$lt_cv_path_mainfest_tool"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5
+printf "%s\n" "$lt_cv_path_manifest_tool" >&6; }
+if test yes != "$lt_cv_path_manifest_tool"; then
MANIFEST_TOOL=:
fi
@@ -7199,11 +8380,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_DSYMUTIL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$DSYMUTIL"; then
ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
else
@@ -7211,11 +8393,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7226,11 +8412,11 @@ fi
fi
DSYMUTIL=$ac_cv_prog_DSYMUTIL
if test -n "$DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+printf "%s\n" "$DSYMUTIL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7239,11 +8425,12 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then
ac_ct_DSYMUTIL=$DSYMUTIL
# Extract the first word of "dsymutil", so it can be a program name with args.
set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_DSYMUTIL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_DSYMUTIL"; then
ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
else
@@ -7251,11 +8438,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7266,11 +8457,11 @@ fi
fi
ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
if test -n "$ac_ct_DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+printf "%s\n" "$ac_ct_DSYMUTIL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_DSYMUTIL" = x; then
@@ -7278,8 +8469,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DSYMUTIL=$ac_ct_DSYMUTIL
@@ -7291,11 +8482,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_NMEDIT+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$NMEDIT"; then
ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
else
@@ -7303,11 +8495,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7318,11 +8514,11 @@ fi
fi
NMEDIT=$ac_cv_prog_NMEDIT
if test -n "$NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+printf "%s\n" "$NMEDIT" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7331,11 +8527,12 @@ if test -z "$ac_cv_prog_NMEDIT"; then
ac_ct_NMEDIT=$NMEDIT
# Extract the first word of "nmedit", so it can be a program name with args.
set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_NMEDIT+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_NMEDIT"; then
ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
else
@@ -7343,11 +8540,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7358,11 +8559,11 @@ fi
fi
ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
if test -n "$ac_ct_NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+printf "%s\n" "$ac_ct_NMEDIT" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_NMEDIT" = x; then
@@ -7370,8 +8571,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
NMEDIT=$ac_ct_NMEDIT
@@ -7383,11 +8584,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_LIPO+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$LIPO"; then
ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
else
@@ -7395,11 +8597,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7410,11 +8616,11 @@ fi
fi
LIPO=$ac_cv_prog_LIPO
if test -n "$LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+printf "%s\n" "$LIPO" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7423,11 +8629,12 @@ if test -z "$ac_cv_prog_LIPO"; then
ac_ct_LIPO=$LIPO
# Extract the first word of "lipo", so it can be a program name with args.
set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_LIPO+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_LIPO"; then
ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
else
@@ -7435,11 +8642,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_LIPO="lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7450,11 +8661,11 @@ fi
fi
ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
if test -n "$ac_ct_LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+printf "%s\n" "$ac_ct_LIPO" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_LIPO" = x; then
@@ -7462,8 +8673,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
LIPO=$ac_ct_LIPO
@@ -7475,11 +8686,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_OTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$OTOOL"; then
ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
else
@@ -7487,11 +8699,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7502,11 +8718,11 @@ fi
fi
OTOOL=$ac_cv_prog_OTOOL
if test -n "$OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+printf "%s\n" "$OTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7515,11 +8731,12 @@ if test -z "$ac_cv_prog_OTOOL"; then
ac_ct_OTOOL=$OTOOL
# Extract the first word of "otool", so it can be a program name with args.
set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_OTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_OTOOL"; then
ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
else
@@ -7527,11 +8744,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL="otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7542,11 +8763,11 @@ fi
fi
ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
if test -n "$ac_ct_OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+printf "%s\n" "$ac_ct_OTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_OTOOL" = x; then
@@ -7554,8 +8775,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OTOOL=$ac_ct_OTOOL
@@ -7567,11 +8788,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_OTOOL64+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$OTOOL64"; then
ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
else
@@ -7579,11 +8801,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7594,11 +8820,11 @@ fi
fi
OTOOL64=$ac_cv_prog_OTOOL64
if test -n "$OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+printf "%s\n" "$OTOOL64" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7607,11 +8833,12 @@ if test -z "$ac_cv_prog_OTOOL64"; then
ac_ct_OTOOL64=$OTOOL64
# Extract the first word of "otool64", so it can be a program name with args.
set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_OTOOL64+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_OTOOL64"; then
ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
else
@@ -7619,11 +8846,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7634,11 +8865,11 @@ fi
fi
ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
if test -n "$ac_ct_OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+printf "%s\n" "$ac_ct_OTOOL64" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_OTOOL64" = x; then
@@ -7646,8 +8877,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OTOOL64=$ac_ct_OTOOL64
@@ -7682,11 +8913,12 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+printf %s "checking for -single_module linker flag... " >&6; }
+if test ${lt_cv_apple_cc_single_mod+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_apple_cc_single_mod=no
if test -z "$LT_MULTI_MODULE"; then
# By default we will add the -single_module flag. You can override
@@ -7715,14 +8947,52 @@ else
rm -f conftest.*
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; }
+
+ # Feature test to disable chained fixups since it is not
+ # compatible with '-undefined dynamic_lookup'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5
+printf %s "checking for -no_fixup_chains linker flag... " >&6; }
+if test ${lt_cv_support_no_fixup_chains+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ lt_cv_support_no_fixup_chains=yes
+else $as_nop
+ lt_cv_support_no_fixup_chains=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5
+printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; }
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+printf %s "checking for -exported_symbols_list linker flag... " >&6; }
+if test ${lt_cv_ld_exported_symbols_list+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_ld_exported_symbols_list=no
save_LDFLAGS=$LDFLAGS
echo "_main" > conftest.sym
@@ -7731,43 +9001,45 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_cv_ld_exported_symbols_list=yes
-else
+else $as_nop
lt_cv_ld_exported_symbols_list=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+printf %s "checking for -force_load linker flag... " >&6; }
+if test ${lt_cv_ld_force_load+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_ld_force_load=no
cat > conftest.c << _LT_EOF
int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
- echo "$AR cru libconftest.a conftest.o" >&5
- $AR cru libconftest.a conftest.o 2>&5
+ echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5
+ $AR $AR_FLAGS libconftest.a conftest.o 2>&5
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
-int main() { return 0;}
+int main(void) { return 0;}
_LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
@@ -7783,30 +9055,44 @@ _LT_EOF
rm -rf conftest.dSYM
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+printf "%s\n" "$lt_cv_ld_force_load" >&6; }
case $host_os in
rhapsody* | darwin1.[012])
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[012][,.]*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ darwin*)
+ case $MACOSX_DEPLOYMENT_TARGET,$host in
+ 10.[012],*|,*powerpc*-darwin[5-8]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ *)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
+ if test yes = "$lt_cv_support_no_fixup_chains"; then
+ as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains'
+ fi
+ ;;
esac
;;
esac
if test yes = "$lt_cv_apple_cc_single_mod"; then
_lt_dar_single_mod='$single_module'
fi
+ _lt_dar_needs_single_mod=no
+ case $host_os in
+ rhapsody* | darwin1.*)
+ _lt_dar_needs_single_mod=yes ;;
+ darwin*)
+ # When targeting Mac OS X 10.4 (darwin 8) or later,
+ # -single_module is the default and -multi_module is unsupported.
+ # The toolchain on macOS 10.14 (darwin 18) and later cannot
+ # target any OS version that needs -single_module.
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*)
+ _lt_dar_needs_single_mod=yes ;;
+ esac
+ ;;
+ esac
if test yes = "$lt_cv_ld_exported_symbols_list"; then
_lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
else
@@ -7855,286 +9141,43 @@ func_munge_path_list ()
esac
}
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
+ac_header= ac_cache=
+for ac_item in $ac_header_c_list
do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
+ if test $ac_cache; then
+ ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
+ if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
+ printf "%s\n" "#define $ac_item 1" >> confdefs.h
+ fi
+ ac_header= ac_cache=
+ elif test $ac_header; then
+ ac_cache=$ac_item
+ else
+ ac_header=$ac_item
+ fi
done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-fi
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
+if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
+then :
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+if test "x$ac_cv_header_dlfcn_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h
fi
-done
-
-
-for ac_header in dlfcn.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
@@ -8143,15 +9186,16 @@ done
enable_win32_dll=yes
case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*)
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AS+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AS"; then
ac_cv_prog_AS="$AS" # Let the user override the test.
else
@@ -8159,11 +9203,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AS="${ac_tool_prefix}as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8174,11 +9222,11 @@ fi
fi
AS=$ac_cv_prog_AS
if test -n "$AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+printf "%s\n" "$AS" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8187,11 +9235,12 @@ if test -z "$ac_cv_prog_AS"; then
ac_ct_AS=$AS
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_AS+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_AS"; then
ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
else
@@ -8199,11 +9248,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AS="as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8214,11 +9267,11 @@ fi
fi
ac_ct_AS=$ac_cv_prog_ac_ct_AS
if test -n "$ac_ct_AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+printf "%s\n" "$ac_ct_AS" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_AS" = x; then
@@ -8226,8 +9279,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
AS=$ac_ct_AS
@@ -8239,11 +9292,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_DLLTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$DLLTOOL"; then
ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
else
@@ -8251,11 +9305,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8266,11 +9324,11 @@ fi
fi
DLLTOOL=$ac_cv_prog_DLLTOOL
if test -n "$DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+printf "%s\n" "$DLLTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8279,11 +9337,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then
ac_ct_DLLTOOL=$DLLTOOL
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_DLLTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_DLLTOOL"; then
ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
else
@@ -8291,11 +9350,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8306,11 +9369,11 @@ fi
fi
ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
if test -n "$ac_ct_DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+printf "%s\n" "$ac_ct_DLLTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_DLLTOOL" = x; then
@@ -8318,8 +9381,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DLLTOOL=$ac_ct_DLLTOOL
@@ -8331,11 +9394,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_OBJDUMP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$OBJDUMP"; then
ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
else
@@ -8343,11 +9407,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8358,11 +9426,11 @@ fi
fi
OBJDUMP=$ac_cv_prog_OBJDUMP
if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+printf "%s\n" "$OBJDUMP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8371,11 +9439,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then
ac_ct_OBJDUMP=$OBJDUMP
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_OBJDUMP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_OBJDUMP"; then
ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
else
@@ -8383,11 +9452,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8398,11 +9471,11 @@ fi
fi
ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+printf "%s\n" "$ac_ct_OBJDUMP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_OBJDUMP" = x; then
@@ -8410,8 +9483,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OBJDUMP=$ac_ct_OBJDUMP
@@ -8448,7 +9521,8 @@ test -z "$OBJDUMP" && OBJDUMP=objdump
# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
+if test ${enable_shared+y}
+then :
enableval=$enable_shared; p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
@@ -8466,7 +9540,7 @@ if test "${enable_shared+set}" = set; then :
IFS=$lt_save_ifs
;;
esac
-else
+else $as_nop
enable_shared=yes
fi
@@ -8479,7 +9553,8 @@ fi
# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
+if test ${enable_static+y}
+then :
enableval=$enable_static; p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
@@ -8497,7 +9572,7 @@ if test "${enable_static+set}" = set; then :
IFS=$lt_save_ifs
;;
esac
-else
+else $as_nop
enable_static=yes
fi
@@ -8509,30 +9584,53 @@ fi
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
+ # Check whether --enable-pic was given.
+if test ${enable_pic+y}
+then :
+ enableval=$enable_pic; lt_p=${PACKAGE-default}
+ case $enableval in
+ yes|no) pic_mode=$enableval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else $as_nop
+ # Check whether --with-pic was given.
+if test ${with_pic+y}
+then :
withval=$with_pic; lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for lt_pkg in $withval; do
- IFS=$lt_save_ifs
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else $as_nop
pic_mode=default
fi
+fi
+
+
@@ -8540,7 +9638,8 @@ fi
# Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
+if test ${enable_fast_install+y}
+then :
enableval=$enable_fast_install; p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
@@ -8558,7 +9657,7 @@ if test "${enable_fast_install+set}" = set; then :
IFS=$lt_save_ifs
;;
esac
-else
+else $as_nop
enable_fast_install=yes
fi
@@ -8572,31 +9671,47 @@ fi
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[5-9]*,yes)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
-$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
-
-# Check whether --with-aix-soname was given.
-if test "${with_aix_soname+set}" = set; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+printf %s "checking which variant of shared library versioning to provide... " >&6; }
+ # Check whether --enable-aix-soname was given.
+if test ${enable_aix_soname+y}
+then :
+ enableval=$enable_aix_soname; case $enableval in
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$enable_aix_soname
+else $as_nop
+ # Check whether --with-aix-soname was given.
+if test ${with_aix_soname+y}
+then :
withval=$with_aix_soname; case $withval in
- aix|svr4|both)
- ;;
- *)
- as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
- ;;
- esac
- lt_cv_with_aix_soname=$with_aix_soname
-else
- if ${lt_cv_with_aix_soname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname
+else $as_nop
+ if test ${lt_cv_with_aix_soname+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_with_aix_soname=aix
fi
- with_aix_soname=$lt_cv_with_aix_soname
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
-$as_echo "$with_aix_soname" >&6; }
+ enable_aix_soname=$lt_cv_with_aix_soname
+fi
+
+ with_aix_soname=$enable_aix_soname
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+printf "%s\n" "$with_aix_soname" >&6; }
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
@@ -8678,11 +9793,12 @@ if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+printf %s "checking for objdir... " >&6; }
+if test ${lt_cv_objdir+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
@@ -8693,17 +9809,15 @@ else
fi
rmdir .libs 2>/dev/null
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+printf "%s\n" "$lt_cv_objdir" >&6; }
objdir=$lt_cv_objdir
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
+printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h
@@ -8724,8 +9838,8 @@ esac
ofile=libtool
can_build_shared=yes
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
+# All known linkers require a '.a' archive for static linking (except MSVC and
+# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -8749,11 +9863,12 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+printf %s "checking for ${ac_tool_prefix}file... " >&6; }
+if test ${lt_cv_path_MAGIC_CMD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
@@ -8802,11 +9917,11 @@ fi
MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+printf "%s\n" "$MAGIC_CMD" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8815,11 +9930,12 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+printf %s "checking for file... " >&6; }
+if test ${lt_cv_path_MAGIC_CMD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
@@ -8868,11 +9984,11 @@ fi
MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+printf "%s\n" "$MAGIC_CMD" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8906,7 +10022,7 @@ objext=$objext
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
+lt_simple_link_test_code='int main(void){return(0);}'
@@ -8957,11 +10073,12 @@ if test yes = "$GCC"; then
lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test ${lt_cv_prog_compiler_rtti_exceptions+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
@@ -8992,8 +10109,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
@@ -9046,7 +10163,7 @@ lt_prog_compiler_static=
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -9149,7 +10266,7 @@ lt_prog_compiler_static=
esac
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -9190,6 +10307,12 @@ lt_prog_compiler_static=
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
+ *flang* | ftn | f18* | f95*)
+ # Flang compiler.
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
@@ -9234,7 +10357,7 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-qstaticlink'
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
lt_prog_compiler_pic='-KPIC'
@@ -9272,6 +10395,12 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-Bstatic'
;;
+ *-mlibc)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
@@ -9288,6 +10417,9 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-non_shared'
;;
+ serenity*)
+ ;;
+
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -9350,26 +10482,28 @@ case $host_os in
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+printf %s "checking for $compiler option to produce PIC... " >&6; }
+if test ${lt_cv_prog_compiler_pic+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; }
lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test ${lt_cv_prog_compiler_pic_works+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
@@ -9400,8 +10534,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; }
if test yes = "$lt_cv_prog_compiler_pic_works"; then
case $lt_prog_compiler_pic in
@@ -9429,11 +10563,12 @@ fi
# Check to make sure the static flag actually works.
#
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test ${lt_cv_prog_compiler_static_works+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_static_works=no
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
@@ -9457,8 +10592,8 @@ else
LDFLAGS=$save_LDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; }
if test yes = "$lt_cv_prog_compiler_static_works"; then
:
@@ -9472,11 +10607,12 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test ${lt_cv_prog_compiler_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
@@ -9519,19 +10655,20 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test ${lt_cv_prog_compiler_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
@@ -9574,8 +10711,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; }
@@ -9583,19 +10720,19 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
hard_links=nottested
if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
# do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+printf %s "checking if we can lock with hard links... " >&6; }
hard_links=yes
$RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+printf "%s\n" "$hard_links" >&6; }
if test no = "$hard_links"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
@@ -9607,8 +10744,8 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
runpath_var=
allow_undefined_flag=
@@ -9651,21 +10788,18 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
extract_expsyms_cmds=
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
+ # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
+ # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
- openbsd* | bitrig*)
- with_gnu_ld=no
- ;;
esac
ld_shlibs=yes
@@ -9712,7 +10846,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
whole_archive_flag_spec=
fi
supports_anon_versioning=no
- case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+ case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -9766,7 +10900,7 @@ _LT_EOF
fi
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
@@ -9776,6 +10910,7 @@ _LT_EOF
enable_shared_with_static_runtimes=yes
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ file_list_spec='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -9795,7 +10930,7 @@ _LT_EOF
haiku*)
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- link_all_deplibs=yes
+ link_all_deplibs=no
;;
os2*)
@@ -9822,8 +10957,9 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
+ file_list_spec='@'
;;
interix[3-9]*)
@@ -9838,7 +10974,7 @@ _LT_EOF
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
@@ -9881,7 +11017,7 @@ _LT_EOF
compiler_needs_object=yes
;;
esac
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C 5.9
whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
compiler_needs_object=yes
@@ -9893,13 +11029,14 @@ _LT_EOF
if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
tcc*)
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
export_dynamic_flag_spec='-rdynamic'
;;
xlf* | bgf* | bgxlf* | mpixlf*)
@@ -9909,7 +11046,7 @@ _LT_EOF
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
@@ -9920,7 +11057,12 @@ _LT_EOF
fi
;;
- netbsd*)
+ *-mlibc)
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -10041,7 +11183,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -10163,21 +11305,23 @@ _LT_EOF
if test set = "${lt_cv_aix_libpath+set}"; then
aix_libpath=$lt_cv_aix_libpath
else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${lt_cv_aix_libpath_+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -10192,7 +11336,7 @@ if ac_fn_c_try_link "$LINENO"; then :
lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=/usr/lib:/lib
@@ -10216,21 +11360,23 @@ fi
if test set = "${lt_cv_aix_libpath+set}"; then
aix_libpath=$lt_cv_aix_libpath
else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${lt_cv_aix_libpath_+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -10245,7 +11391,7 @@ if ac_fn_c_try_link "$LINENO"; then :
lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=/usr/lib:/lib
@@ -10306,14 +11452,14 @@ fi
export_dynamic_flag_spec=-rdynamic
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
- cl*)
- # Native MSVC
+ cl* | icl*)
+ # Native MSVC or ICC
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
always_export_symbols=yes
@@ -10323,14 +11469,14 @@ fi
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ archive_cmds='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
cp "$export_symbols" "$output_objdir/$soname.def";
echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
else
$SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
@@ -10354,7 +11500,7 @@ fi
fi'
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
# Tell ltmain to make .lib files, not .a files.
@@ -10395,8 +11541,8 @@ fi
output_verbose_link_cmd=func_echo_all
archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
else
ld_shlibs=no
@@ -10430,7 +11576,7 @@ fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -10496,11 +11642,12 @@ fi
# Older versions of the 11.00 compiler do not understand -b yet
# (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+printf %s "checking if $CC understands -b... " >&6; }
+if test ${lt_cv_prog_compiler__b+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler__b=no
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -b"
@@ -10524,8 +11671,8 @@ else
LDFLAGS=$save_LDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+printf "%s\n" "$lt_cv_prog_compiler__b" >&6; }
if test yes = "$lt_cv_prog_compiler__b"; then
archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
@@ -10565,28 +11712,30 @@ fi
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
# This should be the same for all languages, so no per-tag cache variable.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if test ${lt_cv_irix_exported_symbol+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int foo (void) { return 0; }
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_cv_irix_exported_symbol=yes
-else
+else $as_nop
lt_cv_irix_exported_symbol=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
if test yes = "$lt_cv_irix_exported_symbol"; then
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
@@ -10607,11 +11756,15 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
# Fabrice Bellard et al's Tiny C Compiler
ld_shlibs=yes
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
;;
esac
;;
- netbsd*)
+ *-mlibc)
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -10633,7 +11786,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
*nto* | *qnx*)
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
hardcode_shlibpath_var=no
@@ -10676,8 +11829,9 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
+ file_list_spec='@'
;;
osf3*)
@@ -10711,6 +11865,9 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
hardcode_libdir_separator=:
;;
+ serenity*)
+ ;;
+
solaris*)
no_undefined_flag=' -z defs'
if test yes = "$GCC"; then
@@ -10866,8 +12023,8 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+printf "%s\n" "$ld_shlibs" >&6; }
test no = "$ld_shlibs" && can_build_shared=no
with_gnu_ld=$with_gnu_ld
@@ -10903,18 +12060,19 @@ x|xyes)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+printf %s "checking whether -lc should be explicitly linked in... " >&6; }
+if test ${lt_cv_archive_cmds_need_lc+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } 2>conftest.err; then
soname=conftest
lib=conftest
@@ -10932,7 +12090,7 @@ else
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
(eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then
lt_cv_archive_cmds_need_lc=no
@@ -10946,8 +12104,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; }
archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
;;
esac
@@ -11106,8 +12264,8 @@ esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+printf %s "checking dynamic linker characteristics... " >&6; }
if test yes = "$GCC"; then
case $host_os in
@@ -11115,7 +12273,7 @@ if test yes = "$GCC"; then
*) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+ mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
*) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
@@ -11173,7 +12331,7 @@ BEGIN {RS = " "; FS = "/|\n";} {
# AWK program above erroneously prepends '/' to C:/dos/paths
# for these hosts.
case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
$SED 's|/\([A-Za-z]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
@@ -11247,7 +12405,7 @@ aix[4-9]*)
# Unfortunately, runtime linking may impact performance, so we do
# not want this to be the default eventually. Also, we use the
# versioned .so libs for executables only if there is the -brtl
- # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only.
# To allow for filename-based versioning support, we need to create
# libNAME.so.V as an archive file, containing:
# *) an Import File, referring to the versioned filename of the
@@ -11341,7 +12499,7 @@ bsdi[45]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
version_type=windows
shrext_cmds=.dll
need_version=no
@@ -11352,15 +12510,29 @@ cygwin* | mingw* | pw32* | cegcc*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
+ # If user builds GCC with multilib enabled,
+ # it should just install on $(libdir)
+ # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones.
+ if test xyes = x"$multilib"; then
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ $install_prog $dir/$dlname $destdir/$dlname~
+ chmod a+x $destdir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib $destdir/$dlname'\'' || exit \$?;
+ fi'
+ else
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ fi
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
@@ -11369,30 +12541,30 @@ cygwin* | mingw* | pw32* | cegcc*)
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
- mingw* | cegcc*)
+ mingw* | windows* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
- *,cl*)
- # Native MSVC
+ *,cl* | *,icl*)
+ # Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
case $build_os in
- mingw*)
+ mingw* | windows*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
@@ -11405,7 +12577,7 @@ cygwin* | mingw* | pw32* | cegcc*)
done
IFS=$lt_save_ifs
# Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
@@ -11442,7 +12614,7 @@ cygwin* | mingw* | pw32* | cegcc*)
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@@ -11475,7 +12647,7 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
@@ -11512,7 +12684,27 @@ freebsd* | dragonfly*)
need_version=no
;;
esac
+ case $host_cpu in
+ powerpc64)
+ # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+ # binaries. See <https://man.freebsd.org/cgi/man.cgi?query=ld.so>.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int test_pointer_size[sizeof (void *) - 5];
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
shlibpath_var=LD_LIBRARY_PATH
+else $as_nop
+ shlibpath_var=LD_32_LIBRARY_PATH
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+ *)
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+ esac
case $host_os in
freebsd2.*)
shlibpath_overrides_runpath=yes
@@ -11542,8 +12734,9 @@ haiku*)
soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
+ hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@@ -11653,7 +12846,7 @@ linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
- library_names_spec='$libname$release$shared_ext'
+ library_names_spec='$libname$release$shared_ext $libname$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
@@ -11665,8 +12858,9 @@ linux*android*)
hardcode_into_libs=yes
dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- hardcode_libdir_flag_spec='-L$libdir'
+ # -rpath works at least for libraries that are not overridden by
+ # libraries installed in system locations.
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
;;
# This must be glibc/ELF.
@@ -11681,9 +12875,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
shlibpath_overrides_runpath=no
# Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${lt_cv_shlibpath_overrides_runpath+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_shlibpath_overrides_runpath=no
save_LDFLAGS=$LDFLAGS
save_libdir=$libdir
@@ -11693,19 +12888,21 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+if ac_fn_c_try_link "$LINENO"
+then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null
+then :
lt_cv_shlibpath_overrides_runpath=yes
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
@@ -11719,7 +12916,7 @@ fi
# before this can be enabled.
hardcode_into_libs=yes
- # Ideally, we could use ldconfig to report *all* directores which are
+ # Ideally, we could use ldconfig to report *all* directories which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
@@ -11739,6 +12936,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -11757,6 +12966,18 @@ netbsd*)
hardcode_into_libs=yes
;;
+*-mlibc)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='mlibc ld.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -11776,7 +12997,7 @@ newsos6)
dynamic_linker='ldqnx.so'
;;
-openbsd* | bitrig*)
+openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
@@ -11836,6 +13057,17 @@ rdos*)
dynamic_linker=no
;;
+serenity*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='SerenityOS LibELF'
+ ;;
+
solaris*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
@@ -11933,12 +13165,499 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;
+emscripten*)
+ version_type=none
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ dynamic_linker="Emscripten linker"
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test yes = "$GCC"; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='$wl-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64, which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *flang* | ftn | f18* | f95*)
+ # Flang compiler.
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | $SED 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *-mlibc)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ serenity*)
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+printf %s "checking for $compiler option to produce PIC... " >&6; }
+if test ${lt_cv_prog_compiler_pic+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test ${lt_cv_prog_compiler_pic_works+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test ${lt_cv_prog_compiler_static_works+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works"; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+='-fPIC'
+ archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib'
+ archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym'
+ archive_cmds_need_lc=no
+ no_undefined_flag=
+ ;;
+
*)
dynamic_linker=no
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+printf "%s\n" "$dynamic_linker" >&6; }
test no = "$dynamic_linker" && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
@@ -12059,8 +13778,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+printf %s "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" ||
test -n "$runpath_var" ||
@@ -12084,8 +13803,8 @@ else
# directories.
hardcode_action=unsupported
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+printf "%s\n" "$hardcode_action" >&6; }
if test relink = "$hardcode_action" ||
test yes = "$inherit_rpath"; then
@@ -12117,7 +13836,7 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32* | cegcc*)
+ mingw* | windows* | pw32* | cegcc*)
lt_cv_dlopen=LoadLibrary
lt_cv_dlopen_libs=
;;
@@ -12129,11 +13848,12 @@ else
darwin*)
# if libdl is installed we need to link against it
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+printf %s "checking for dlopen in -ldl... " >&6; }
+if test ${ac_cv_lib_dl_dlopen+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12141,33 +13861,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char dlopen ();
+char dlopen (void);
int
-main ()
+main (void)
{
return dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_dl_dlopen=yes
-else
+else $as_nop
ac_cv_lib_dl_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes
+then :
lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
+else $as_nop
lt_cv_dlopen=dyld
lt_cv_dlopen_libs=
@@ -12187,14 +13912,16 @@ fi
*)
ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
+if test "x$ac_cv_func_shl_load" = xyes
+then :
lt_cv_dlopen=shl_load
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+printf %s "checking for shl_load in -ldld... " >&6; }
+if test ${ac_cv_lib_dld_shl_load+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12202,42 +13929,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char shl_load ();
+char shl_load (void);
int
-main ()
+main (void)
{
return shl_load ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_dld_shl_load=yes
-else
+else $as_nop
ac_cv_lib_dld_shl_load=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes
+then :
lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
-else
+else $as_nop
ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
+if test "x$ac_cv_func_dlopen" = xyes
+then :
lt_cv_dlopen=dlopen
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+printf %s "checking for dlopen in -ldl... " >&6; }
+if test ${ac_cv_lib_dl_dlopen+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12245,38 +13979,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char dlopen ();
+char dlopen (void);
int
-main ()
+main (void)
{
return dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_dl_dlopen=yes
-else
+else $as_nop
ac_cv_lib_dl_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes
+then :
lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+printf %s "checking for dlopen in -lsvld... " >&6; }
+if test ${ac_cv_lib_svld_dlopen+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12284,38 +14024,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char dlopen ();
+char dlopen (void);
int
-main ()
+main (void)
{
return dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_svld_dlopen=yes
-else
+else $as_nop
ac_cv_lib_svld_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes
+then :
lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+printf %s "checking for dld_link in -ldld... " >&6; }
+if test ${ac_cv_lib_dld_dld_link+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12323,31 +14069,36 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char dld_link ();
+char dld_link (void);
int
-main ()
+main (void)
{
return dld_link ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_dld_dld_link=yes
-else
+else $as_nop
ac_cv_lib_dld_dld_link=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes
+then :
lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
fi
@@ -12386,11 +14137,12 @@ fi
save_LIBS=$LIBS
LIBS="$lt_cv_dlopen_libs $LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+printf %s "checking whether a program can dlopen itself... " >&6; }
+if test ${lt_cv_dlopen_self+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self=cross
else
@@ -12441,11 +14193,11 @@ else
/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
#endif
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
@@ -12469,7 +14221,7 @@ _LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
@@ -12487,16 +14239,17 @@ rm -fr conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+printf "%s\n" "$lt_cv_dlopen_self" >&6; }
if test yes = "$lt_cv_dlopen_self"; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+printf %s "checking whether a statically linked program can dlopen itself... " >&6; }
+if test ${lt_cv_dlopen_self_static+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self_static=cross
else
@@ -12547,11 +14300,11 @@ else
/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
#endif
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
@@ -12575,7 +14328,7 @@ _LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
@@ -12593,8 +14346,8 @@ rm -fr conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+printf "%s\n" "$lt_cv_dlopen_self_static" >&6; }
fi
CPPFLAGS=$save_CPPFLAGS
@@ -12632,32 +14385,43 @@ fi
striplib=
old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+printf %s "checking whether stripping libraries is possible... " >&6; }
+if test -z "$STRIP"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+else
+ if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+ else
+ case $host_os in
+ darwin*)
+ # FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x"
old_striplib="$STRIP -S"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- esac
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+ ;;
+ freebsd*)
+ if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ fi
+ ;;
+ *)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ ;;
+ esac
+ fi
fi
@@ -12672,13 +14436,13 @@ fi
# Report what library types will actually be built
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+printf %s "checking if libtool supports shared libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+printf "%s\n" "$can_build_shared" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+printf %s "checking whether to build shared libraries... " >&6; }
test no = "$can_build_shared" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
@@ -12702,15 +14466,15 @@ $as_echo_n "checking whether to build shared libraries... " >&6; }
fi
;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+printf "%s\n" "$enable_shared" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+printf %s "checking whether to build static libraries... " >&6; }
# Make sure either enable_shared or enable_static is yes.
test yes = "$enable_shared" || enable_static=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+printf "%s\n" "$enable_static" >&6; }
@@ -12757,196 +14521,27 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
-$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
-if ${ac_cv_prog_cc_c99+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c99=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <stdio.h>
-
-// Check varargs macros. These examples are taken from C99 6.10.3.5.
-#define debug(...) fprintf (stderr, __VA_ARGS__)
-#define showlist(...) puts (#__VA_ARGS__)
-#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
-static void
-test_varargs_macros (void)
-{
- int x = 1234;
- int y = 5678;
- debug ("Flag");
- debug ("X = %d\n", x);
- showlist (The first, second, and third items.);
- report (x>y, "x is %d but y is %d", x, y);
-}
-
-// Check long long types.
-#define BIG64 18446744073709551615ull
-#define BIG32 4294967295ul
-#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
-#if !BIG_OK
- your preprocessor is broken;
-#endif
-#if BIG_OK
-#else
- your preprocessor is broken;
-#endif
-static long long int bignum = -9223372036854775807LL;
-static unsigned long long int ubignum = BIG64;
-
-struct incomplete_array
-{
- int datasize;
- double data[];
-};
-
-struct named_init {
- int number;
- const wchar_t *name;
- double average;
-};
-
-typedef const char *ccp;
-
-static inline int
-test_restrict (ccp restrict text)
-{
- // See if C++-style comments work.
- // Iterate through items via the restricted pointer.
- // Also check for declarations in for loops.
- for (unsigned int i = 0; *(text+i) != '\0'; ++i)
- continue;
- return 0;
-}
-
-// Check varargs and va_copy.
-static void
-test_varargs (const char *format, ...)
-{
- va_list args;
- va_start (args, format);
- va_list args_copy;
- va_copy (args_copy, args);
-
- const char *str;
- int number;
- float fnumber;
-
- while (*format)
- {
- switch (*format++)
- {
- case 's': // string
- str = va_arg (args_copy, const char *);
- break;
- case 'd': // int
- number = va_arg (args_copy, int);
- break;
- case 'f': // float
- fnumber = va_arg (args_copy, double);
- break;
- default:
- break;
- }
- }
- va_end (args_copy);
- va_end (args);
-}
-
-int
-main ()
-{
-
- // Check bool.
- _Bool success = false;
-
- // Check restrict.
- if (test_restrict ("String literal") == 0)
- success = true;
- char *restrict newvar = "Another string";
-
- // Check varargs.
- test_varargs ("s, d' f .", "string", 65, 34.234);
- test_varargs_macros ();
-
- // Check flexible array members.
- struct incomplete_array *ia =
- malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
- ia->datasize = 10;
- for (int i = 0; i < ia->datasize; ++i)
- ia->data[i] = i * 1.234;
-
- // Check named initializers.
- struct named_init ni = {
- .number = 34,
- .name = L"Test wide string",
- .average = 543.34343,
- };
-
- ni.number = 58;
-
- int dynamic_array[ni.number];
- dynamic_array[ni.number - 1] = 543;
- // work around unused variable warnings
- return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
- || dynamic_array[ni.number - 1] != 543);
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c99=$ac_arg
+if test "${ac_cv_prog_cc_c99}" = no
+then :
+ as_fn_error $? "Expat requires a C99 compiler." "$LINENO" 5
fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c99" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c99" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c99"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
-$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c99" != xno; then :
-
-fi
-
-
-if test "$GCC" = yes; then :
+if test "$GCC" = yes
+then :
for flag in -Wall -Wextra; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
+printf %s "checking whether C compiler accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror $flag"
@@ -12954,51 +14549,54 @@ else
/* end confdefs.h. */
int main(void) { return 0; }
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_CFLAGS+:} false; then :
+if test ${AM_CFLAGS+y}
+then :
case " $AM_CFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
(: AM_CFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -13009,12 +14607,13 @@ done
for flag in -fexceptions; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
+printf %s "checking whether C compiler accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror $flag"
@@ -13022,51 +14621,54 @@ else
/* end confdefs.h. */
int main(void) { return 0; }
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_CFLAGS+:} false; then :
+if test ${AM_CFLAGS+y}
+then :
case " $AM_CFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
(: AM_CFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -13077,12 +14679,13 @@ done
for flag in -fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
+printf %s "checking whether C compiler accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror $flag"
@@ -13090,51 +14693,54 @@ else
/* end confdefs.h. */
int main(void) { return 0; }
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_CFLAGS+:} false; then :
+if test ${AM_CFLAGS+y}
+then :
case " $AM_CFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
(: AM_CFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -13145,12 +14751,13 @@ done
for flag in -pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
+printf %s "checking whether C compiler accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror $flag"
@@ -13158,51 +14765,54 @@ else
/* end confdefs.h. */
int main(void) { return 0; }
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_CFLAGS+:} false; then :
+if test ${AM_CFLAGS+y}
+then :
case " $AM_CFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
(: AM_CFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -13213,12 +14823,13 @@ done
for flag in -Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
+printf %s "checking whether C compiler accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror $flag"
@@ -13226,51 +14837,54 @@ else
/* end confdefs.h. */
int main(void) { return 0; }
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_CFLAGS+:} false; then :
+if test ${AM_CFLAGS+y}
+then :
case " $AM_CFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
(: AM_CFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -13280,13 +14894,14 @@ done
-for flag in -Wshadow -Wformat=2 -Wmisleading-indentation; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+for flag in -Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation; do
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
+printf %s "checking whether C compiler accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror $flag"
@@ -13294,51 +14909,54 @@ else
/* end confdefs.h. */
int main(void) { return 0; }
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_CFLAGS+:} false; then :
+if test ${AM_CFLAGS+y}
+then :
case " $AM_CFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5
(: AM_CFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -13352,6 +14970,12 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+
+
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -13362,15 +14986,16 @@ if test -z "$CXX"; then
CXX=$CCC
else
if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CXX"; then
ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
@@ -13378,11 +15003,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -13393,11 +15022,11 @@ fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+printf "%s\n" "$CXX" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -13406,15 +15035,16 @@ fi
fi
if test -z "$CXX"; then
ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_CXX"; then
ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
@@ -13422,11 +15052,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -13437,11 +15071,11 @@ fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+printf "%s\n" "$ac_ct_CXX" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -13453,8 +15087,8 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CXX=$ac_ct_CXX
@@ -13464,7 +15098,7 @@ fi
fi
fi
# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
@@ -13474,7 +15108,7 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -13484,20 +15118,21 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5
+printf %s "checking whether the compiler supports GNU C++... " >&6; }
+if test ${ac_cv_cxx_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -13507,29 +15142,33 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_compiler_gnu=yes
-else
+else $as_nop
ac_compiler_gnu=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
if test $ac_compiler_gnu = yes; then
GXX=yes
else
GXX=
fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_test_CXXFLAGS=${CXXFLAGS+y}
ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+printf %s "checking whether $CXX accepts -g... " >&6; }
+if test ${ac_cv_prog_cxx_g+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_cv_prog_cxx_g=no
@@ -13538,57 +15177,60 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_prog_cxx_g=yes
-else
+else $as_nop
CXXFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
-else
+else $as_nop
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_prog_cxx_g=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+printf "%s\n" "$ac_cv_prog_cxx_g" >&6; }
+if test $ac_test_CXXFLAGS; then
CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
if test "$GXX" = yes; then
@@ -13603,6 +15245,100 @@ else
CXXFLAGS=
fi
fi
+ac_prog_cxx_stdcxx=no
+if test x$ac_prog_cxx_stdcxx = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
+printf %s "checking for $CXX option to enable C++11 features... " >&6; }
+if test ${ac_cv_prog_cxx_cxx11+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cxx_cxx11=no
+ac_save_CXX=$CXX
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_cxx_conftest_cxx11_program
+_ACEOF
+for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA
+do
+ CXX="$ac_save_CXX $ac_arg"
+ if ac_fn_cxx_try_compile "$LINENO"
+then :
+ ac_cv_prog_cxx_cxx11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cxx_cxx11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CXX=$ac_save_CXX
+fi
+
+if test "x$ac_cv_prog_cxx_cxx11" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cxx_cxx11" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5
+printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; }
+ CXX="$CXX $ac_cv_prog_cxx_cxx11"
+fi
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11
+ ac_prog_cxx_stdcxx=cxx11
+fi
+fi
+if test x$ac_prog_cxx_stdcxx = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
+printf %s "checking for $CXX option to enable C++98 features... " >&6; }
+if test ${ac_cv_prog_cxx_cxx98+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cxx_cxx98=no
+ac_save_CXX=$CXX
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_cxx_conftest_cxx98_program
+_ACEOF
+for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA
+do
+ CXX="$ac_save_CXX $ac_arg"
+ if ac_fn_cxx_try_compile "$LINENO"
+then :
+ ac_cv_prog_cxx_cxx98=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cxx_cxx98" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CXX=$ac_save_CXX
+fi
+
+if test "x$ac_cv_prog_cxx_cxx98" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cxx_cxx98" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5
+printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; }
+ CXX="$CXX $ac_cv_prog_cxx_cxx98"
+fi
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98
+ ac_prog_cxx_stdcxx=cxx98
+fi
+fi
+
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -13611,11 +15347,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
depcc="$CXX" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CXX_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
@@ -13722,8 +15459,8 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; }
CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
if
@@ -13755,36 +15492,32 @@ ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+printf %s "checking how to run the C++ preprocessor... " >&6; }
if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
+ if test ${ac_cv_prog_CXXCPP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ # Double quotes because $CXX needs to be expanded
+ for CXXCPP in "$CXX -E" cpp /lib/cpp
do
ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+#include <limits.h>
Syntax error
_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
+if ac_fn_cxx_try_cpp "$LINENO"
+then :
-else
+else $as_nop
# Broken: fails on valid input.
continue
fi
@@ -13796,10 +15529,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
+if ac_fn_cxx_try_cpp "$LINENO"
+then :
# Broken: success on invalid input.
continue
-else
+else $as_nop
# Passes both tests.
ac_preproc_ok=:
break
@@ -13809,7 +15543,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+if $ac_preproc_ok
+then :
break
fi
@@ -13821,29 +15556,24 @@ fi
else
ac_cv_prog_CXXCPP=$CXXCPP
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+printf "%s\n" "$CXXCPP" >&6; }
ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+#include <limits.h>
Syntax error
_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
+if ac_fn_cxx_try_cpp "$LINENO"
+then :
-else
+else $as_nop
# Broken: fails on valid input.
continue
fi
@@ -13855,10 +15585,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
+if ac_fn_cxx_try_cpp "$LINENO"
+then :
# Broken: success on invalid input.
continue
-else
+else $as_nop
# Passes both tests.
ac_preproc_ok=:
break
@@ -13868,11 +15599,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+if $ac_preproc_ok
+then :
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+else $as_nop
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
fi
@@ -14008,19 +15740,20 @@ cc_basename=$func_cc_basename_result
# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
+if test ${with_gnu_ld+y}
+then :
withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
-else
+else $as_nop
with_gnu_ld=no
fi
ac_prog=ld
if test yes = "$GCC"; then
# Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+printf %s "checking for ld used by $CC... " >&6; }
case $host in
- *-*-mingw*)
+ *-*-mingw* | *-*-windows*)
# gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
@@ -14047,15 +15780,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
;;
esac
elif test yes = "$with_gnu_ld"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+printf %s "checking for GNU ld... " >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+printf %s "checking for non-GNU ld... " >&6; }
fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+if test ${lt_cv_path_LD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$LD"; then
lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
@@ -14084,18 +15818,19 @@ fi
LD=$lt_cv_path_LD
if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+printf "%s\n" "$LD" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+printf %s "checking if the linker ($LD) is GNU ld... " >&6; }
+if test ${lt_cv_prog_gnu_ld+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
@@ -14106,8 +15841,8 @@ case `$LD -v 2>&1 </dev/null` in
;;
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; }
with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -14131,8 +15866,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
wlarc='$wl'
# ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
whole_archive_flag_spec_CXX=
@@ -14152,7 +15886,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"'
else
GXX=no
@@ -14161,8 +15895,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
fi
# PORTME: fill in a description of your system's C++ link characteristics
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
ld_shlibs_CXX=yes
case $host_os in
aix3*)
@@ -14300,21 +16034,23 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
if test set = "${lt_cv_aix_libpath+set}"; then
aix_libpath=$lt_cv_aix_libpath
else
- if ${lt_cv_aix_libpath__CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${lt_cv_aix_libpath__CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+if ac_fn_cxx_try_link "$LINENO"
+then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -14329,7 +16065,7 @@ if ac_fn_cxx_try_link "$LINENO"; then :
lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath__CXX"; then
lt_cv_aix_libpath__CXX=/usr/lib:/lib
@@ -14354,21 +16090,23 @@ fi
if test set = "${lt_cv_aix_libpath+set}"; then
aix_libpath=$lt_cv_aix_libpath
else
- if ${lt_cv_aix_libpath__CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${lt_cv_aix_libpath__CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+if ac_fn_cxx_try_link "$LINENO"
+then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -14383,7 +16121,7 @@ if ac_fn_cxx_try_link "$LINENO"; then :
lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath__CXX"; then
lt_cv_aix_libpath__CXX=/usr/lib:/lib
@@ -14446,10 +16184,10 @@ fi
esac
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
+ ,cl* | no,cl* | ,icl* | no,icl*)
+ # Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec_CXX=' '
@@ -14499,6 +16237,7 @@ fi
allow_undefined_flag_CXX=unsupported
always_export_symbols_CXX=no
enable_shared_with_static_runtimes_CXX=yes
+ file_list_spec_CXX='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -14540,11 +16279,11 @@ fi
output_verbose_link_cmd=func_echo_all
archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
- if test yes != "$lt_cv_apple_cc_single_mod"; then
+ archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then
archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
- archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+ archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
else
@@ -14577,8 +16316,9 @@ fi
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ old_archive_from_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes_CXX=yes
+ file_list_spec_CXX='@'
;;
dgux*)
@@ -14609,7 +16349,7 @@ fi
archive_cmds_need_lc_CXX=no
;;
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
ld_shlibs_CXX=yes
@@ -14617,7 +16357,7 @@ fi
haiku*)
archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- link_all_deplibs_CXX=yes
+ link_all_deplibs_CXX=no
;;
hpux9*)
@@ -14644,7 +16384,7 @@ fi
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -14709,7 +16449,7 @@ fi
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -14746,7 +16486,7 @@ fi
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
irix5* | irix6*)
case $cc_basename in
@@ -14886,13 +16626,13 @@ fi
archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
no_undefined_flag_CXX=' -zdefs'
@@ -14941,6 +16681,10 @@ fi
esac
;;
+ *-mlibc)
+ ld_shlibs_CXX=yes
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
@@ -14957,7 +16701,7 @@ fi
ld_shlibs_CXX=yes
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct_CXX=yes
hardcode_shlibpath_var_CXX=no
@@ -15048,7 +16792,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"'
else
# FIXME: insert proper C++ library support
@@ -15063,6 +16807,9 @@ fi
ld_shlibs_CXX=no
;;
+ serenity*)
+ ;;
+
sunos4*)
case $cc_basename in
CC*)
@@ -15132,7 +16879,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"'
else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
@@ -15143,7 +16890,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"'
fi
hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
@@ -15234,8 +16981,8 @@ fi
;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+printf "%s\n" "$ld_shlibs_CXX" >&6; }
test no = "$ld_shlibs_CXX" && can_build_shared=no
GCC_CXX=$GXX
@@ -15273,7 +17020,7 @@ esac
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
@@ -15286,10 +17033,11 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
case $prev$p in
-L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
+ # Some compilers place space between "-{L,R,l}" and the path.
# Remove the space.
- if test x-L = "$p" ||
- test x-R = "$p"; then
+ if test x-L = x"$p" ||
+ test x-R = x"$p" ||
+ test x-l = x"$p"; then
prev=$p
continue
fi
@@ -15456,7 +17204,7 @@ lt_prog_compiler_static_CXX=
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -15531,7 +17279,7 @@ lt_prog_compiler_static_CXX=
;;
esac
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
@@ -15549,7 +17297,7 @@ lt_prog_compiler_static_CXX=
;;
esac
;;
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -15632,7 +17380,7 @@ lt_prog_compiler_static_CXX=
lt_prog_compiler_static_CXX='-qstaticlink'
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
lt_prog_compiler_pic_CXX='-KPIC'
@@ -15656,7 +17404,9 @@ lt_prog_compiler_static_CXX=
;;
esac
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *-mlibc)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -15686,6 +17436,8 @@ lt_prog_compiler_static_CXX=
;;
psos*)
;;
+ serenity*)
+ ;;
solaris*)
case $cc_basename in
CC* | sunCC*)
@@ -15754,26 +17506,28 @@ case $host_os in
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+printf %s "checking for $compiler option to produce PIC... " >&6; }
+if test ${lt_cv_prog_compiler_pic_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; }
lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if test ${lt_cv_prog_compiler_pic_works_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_pic_works_CXX=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
@@ -15804,8 +17558,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then
case $lt_prog_compiler_pic_CXX in
@@ -15827,11 +17581,12 @@ fi
# Check to make sure the static flag actually works.
#
wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test ${lt_cv_prog_compiler_static_works_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_static_works_CXX=no
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
@@ -15855,8 +17610,8 @@ else
LDFLAGS=$save_LDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; }
if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then
:
@@ -15867,11 +17622,12 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test ${lt_cv_prog_compiler_c_o_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_c_o_CXX=no
$RM -r conftest 2>/dev/null
mkdir conftest
@@ -15914,16 +17670,17 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test ${lt_cv_prog_compiler_c_o_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_c_o_CXX=no
$RM -r conftest 2>/dev/null
mkdir conftest
@@ -15966,8 +17723,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; }
@@ -15975,19 +17732,19 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
hard_links=nottested
if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then
# do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+printf %s "checking if we can lock with hard links... " >&6; }
hard_links=yes
$RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+printf "%s\n" "$hard_links" >&6; }
if test no = "$hard_links"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
@@ -15996,8 +17753,8 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
@@ -16014,15 +17771,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
export_symbols_cmds_CXX=$ltdll_cmds
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
case $cc_basename in
- cl*)
+ cl* | icl*)
exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
@@ -16036,8 +17793,8 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+printf "%s\n" "$ld_shlibs_CXX" >&6; }
test no = "$ld_shlibs_CXX" && can_build_shared=no
with_gnu_ld_CXX=$with_gnu_ld
@@ -16064,18 +17821,19 @@ x|xyes)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+printf %s "checking whether -lc should be explicitly linked in... " >&6; }
+if test ${lt_cv_archive_cmds_need_lc_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } 2>conftest.err; then
soname=conftest
lib=conftest
@@ -16093,7 +17851,7 @@ else
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
(eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then
lt_cv_archive_cmds_need_lc_CXX=no
@@ -16107,8 +17865,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
;;
esac
@@ -16177,8 +17935,8 @@ esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+printf %s "checking dynamic linker characteristics... " >&6; }
library_names_spec=
libname_spec='lib$name'
@@ -16247,7 +18005,7 @@ aix[4-9]*)
# Unfortunately, runtime linking may impact performance, so we do
# not want this to be the default eventually. Also, we use the
# versioned .so libs for executables only if there is the -brtl
- # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only.
# To allow for filename-based versioning support, we need to create
# libNAME.so.V as an archive file, containing:
# *) an Import File, referring to the versioned filename of the
@@ -16341,7 +18099,7 @@ bsdi[45]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
version_type=windows
shrext_cmds=.dll
need_version=no
@@ -16352,15 +18110,29 @@ cygwin* | mingw* | pw32* | cegcc*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
+ # If user builds GCC with multilib enabled,
+ # it should just install on $(libdir)
+ # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones.
+ if test xyes = x"$multilib"; then
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ $install_prog $dir/$dlname $destdir/$dlname~
+ chmod a+x $destdir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib $destdir/$dlname'\'' || exit \$?;
+ fi'
+ else
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ fi
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
@@ -16369,29 +18141,29 @@ cygwin* | mingw* | pw32* | cegcc*)
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
- mingw* | cegcc*)
+ mingw* | windows* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
- *,cl*)
- # Native MSVC
+ *,cl* | *,icl*)
+ # Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
case $build_os in
- mingw*)
+ mingw* | windows*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
@@ -16404,7 +18176,7 @@ cygwin* | mingw* | pw32* | cegcc*)
done
IFS=$lt_save_ifs
# Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
@@ -16441,7 +18213,7 @@ cygwin* | mingw* | pw32* | cegcc*)
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@@ -16473,7 +18245,7 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
@@ -16510,7 +18282,27 @@ freebsd* | dragonfly*)
need_version=no
;;
esac
+ case $host_cpu in
+ powerpc64)
+ # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+ # binaries. See <https://man.freebsd.org/cgi/man.cgi?query=ld.so>.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int test_pointer_size[sizeof (void *) - 5];
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
shlibpath_var=LD_LIBRARY_PATH
+else $as_nop
+ shlibpath_var=LD_32_LIBRARY_PATH
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+ *)
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+ esac
case $host_os in
freebsd2.*)
shlibpath_overrides_runpath=yes
@@ -16540,8 +18332,9 @@ haiku*)
soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
+ hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@@ -16651,7 +18444,7 @@ linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
- library_names_spec='$libname$release$shared_ext'
+ library_names_spec='$libname$release$shared_ext $libname$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
@@ -16663,8 +18456,9 @@ linux*android*)
hardcode_into_libs=yes
dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
+ # -rpath works at least for libraries that are not overridden by
+ # libraries installed in system locations.
+ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
;;
# This must be glibc/ELF.
@@ -16679,9 +18473,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
shlibpath_overrides_runpath=no
# Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${lt_cv_shlibpath_overrides_runpath+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_shlibpath_overrides_runpath=no
save_LDFLAGS=$LDFLAGS
save_libdir=$libdir
@@ -16691,19 +18486,21 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+if ac_fn_cxx_try_link "$LINENO"
+then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null
+then :
lt_cv_shlibpath_overrides_runpath=yes
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
@@ -16717,7 +18514,7 @@ fi
# before this can be enabled.
hardcode_into_libs=yes
- # Ideally, we could use ldconfig to report *all* directores which are
+ # Ideally, we could use ldconfig to report *all* directories which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
@@ -16737,6 +18534,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -16755,6 +18564,18 @@ netbsd*)
hardcode_into_libs=yes
;;
+*-mlibc)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='mlibc ld.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -16774,7 +18595,7 @@ newsos6)
dynamic_linker='ldqnx.so'
;;
-openbsd* | bitrig*)
+openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
@@ -16834,6 +18655,17 @@ rdos*)
dynamic_linker=no
;;
+serenity*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='SerenityOS LibELF'
+ ;;
+
solaris*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
@@ -16931,12 +18763,482 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;
+emscripten*)
+ version_type=none
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ dynamic_linker="Emscripten linker"
+ lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test yes = "$GXX"; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static_CXX='$wl-static'
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static_CXX=
+ ;;
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[4-9]*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly* | midnightbsd*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+ if test ia64 != "$host_cpu"; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64, which still supported -KPIC.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-qpic'
+ lt_prog_compiler_static_CXX='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | $SED 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *-mlibc)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ serenity*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+printf %s "checking for $compiler option to produce PIC... " >&6; }
+if test ${lt_cv_prog_compiler_pic_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if test ${lt_cv_prog_compiler_pic_works_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test ${lt_cv_prog_compiler_static_works_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
+
+='-fPIC'
+ archive_cmds_CXX='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib'
+ archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym'
+ archive_cmds_need_lc_CXX=no
+ no_undefined_flag_CXX=
+ ;;
+
*)
dynamic_linker=no
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+printf "%s\n" "$dynamic_linker" >&6; }
test no = "$dynamic_linker" && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
@@ -17000,8 +19302,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+printf %s "checking how to hardcode library paths into programs... " >&6; }
hardcode_action_CXX=
if test -n "$hardcode_libdir_flag_spec_CXX" ||
test -n "$runpath_var_CXX" ||
@@ -17025,8 +19327,8 @@ else
# directories.
hardcode_action_CXX=unsupported
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+printf "%s\n" "$hardcode_action_CXX" >&6; }
if test relink = "$hardcode_action_CXX" ||
test yes = "$inherit_rpath_CXX"; then
@@ -17066,18 +19368,20 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test "$GCC" = yes; then :
+if test "$GCC" = yes
+then :
for flag in -Wall -Wextra; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5
-$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5
+printf %s "checking whether C++ compiler accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -Werror $flag"
@@ -17085,51 +19389,54 @@ else
/* end confdefs.h. */
int main(void) { return 0; }
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CXXFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_CXXFLAGS+:} false; then :
+if test ${AM_CXXFLAGS+y}
+then :
case " $AM_CXXFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5
(: AM_CXXFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CXXFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
(: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CXXFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
(: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -17140,12 +19447,13 @@ done
for flag in -fexceptions; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5
-$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5
+printf %s "checking whether C++ compiler accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -Werror $flag"
@@ -17153,51 +19461,54 @@ else
/* end confdefs.h. */
int main(void) { return 0; }
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CXXFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_CXXFLAGS+:} false; then :
+if test ${AM_CXXFLAGS+y}
+then :
case " $AM_CXXFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5
(: AM_CXXFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CXXFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
(: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CXXFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
(: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -17208,12 +19519,13 @@ done
for flag in -fno-strict-aliasing; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5
-$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5
+printf %s "checking whether C++ compiler accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -Werror $flag"
@@ -17221,51 +19533,54 @@ else
/* end confdefs.h. */
int main(void) { return 0; }
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CXXFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_CXXFLAGS+:} false; then :
+if test ${AM_CXXFLAGS+y}
+then :
case " $AM_CXXFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5
(: AM_CXXFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CXXFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
(: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CXXFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5
(: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -17279,18 +19594,20 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test "$GCC" = yes; then :
+if test "$GCC" = yes
+then :
for flag in -fno-strict-aliasing; do
- as_CACHEVAR=`$as_echo "ax_cv_check_ldflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5
-$as_echo_n "checking whether the linker accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ as_CACHEVAR=`printf "%s\n" "ax_cv_check_ldflags__$flag" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5
+printf %s "checking whether the linker accepts $flag... " >&6; }
+if eval test \${$as_CACHEVAR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ax_check_save_flags=$LDFLAGS
LDFLAGS="$LDFLAGS $flag"
@@ -17298,59 +19615,62 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
eval "$as_CACHEVAR=yes"
-else
+else $as_nop
eval "$as_CACHEVAR=no"
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"
+then :
-if ${AM_LDFLAGS+:} false; then :
+if test ${AM_LDFLAGS+y}
+then :
case " $AM_LDFLAGS " in #(
*" $flag "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5
(: AM_LDFLAGS already contains $flag) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_LDFLAGS " $flag"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
(: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_LDFLAGS=$flag
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
(: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
-else
+else $as_nop
:
fi
@@ -17370,11 +19690,12 @@ esac ;; #(
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports visibility" >&5
-$as_echo_n "checking whether compiler supports visibility... " >&6; }
-if ${expatcfg_cv_compiler_supports_visibility+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports visibility" >&5
+printf %s "checking whether compiler supports visibility... " >&6; }
+if test ${expatcfg_cv_compiler_supports_visibility+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
expatcfg_cv_compiler_supports_visibility=no
OLDFLAGS=$CFLAGS
as_fn_append CFLAGS " -fvisibility=hidden -Wall -Werror -Wno-unknown-warning-option"
@@ -17385,201 +19706,96 @@ else
void foo(void) {}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
expatcfg_cv_compiler_supports_visibility=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS=$OLDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $expatcfg_cv_compiler_supports_visibility" >&5
-$as_echo "$expatcfg_cv_compiler_supports_visibility" >&6; }
- if test "$expatcfg_cv_compiler_supports_visibility" = yes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $expatcfg_cv_compiler_supports_visibility" >&5
+printf "%s\n" "$expatcfg_cv_compiler_supports_visibility" >&6; }
+ if test "$expatcfg_cv_compiler_supports_visibility" = yes
+then :
-if ${AM_CFLAGS+:} false; then :
+if test ${AM_CFLAGS+y}
+then :
case " $AM_CFLAGS " in #(
*" -fvisibility=hidden "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains -fvisibility=hidden"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains -fvisibility=hidden"; } >&5
(: AM_CFLAGS already contains -fvisibility=hidden) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CFLAGS " -fvisibility=hidden"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CFLAGS=-fvisibility=hidden
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5
(: AM_CFLAGS="$AM_CFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
+ if test "${enable_shared}" = yes
+then :
-if ${AM_CPPFLAGS+:} false; then :
+if test ${AM_CPPFLAGS+y}
+then :
case " $AM_CPPFLAGS " in #(
*" -DXML_ENABLE_VISIBILITY=1 "*) :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1"; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1"; } >&5
(: AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } ;; #(
*) :
as_fn_append AM_CPPFLAGS " -DXML_ENABLE_VISIBILITY=1"
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5
(: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
esac
-else
+else $as_nop
AM_CPPFLAGS=-DXML_ENABLE_VISIBILITY=1
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5
(: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
fi
fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
fi
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+printf %s "checking whether byte ordering is bigendian... " >&6; }
+if test ${ac_cv_c_bigendian+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_cv_c_bigendian=unknown
# See if we're dealing with a universal compiler.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -17590,7 +19806,8 @@ else
typedef int dummy;
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
# Check for potential -arch flags. It is not universal unless
# there are at least two -arch flags with different values.
@@ -17614,7 +19831,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
fi
done
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
if test $ac_cv_c_bigendian = unknown; then
# See if sys/param.h defines the BYTE_ORDER macro.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -17623,7 +19840,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#include <sys/param.h>
int
-main ()
+main (void)
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
&& defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
@@ -17635,7 +19852,8 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
# It does; now see whether it defined to BIG_ENDIAN or not.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -17643,7 +19861,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
#include <sys/param.h>
int
-main ()
+main (void)
{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
@@ -17653,14 +19871,15 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_c_bigendian=yes
-else
+else $as_nop
ac_cv_c_bigendian=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
@@ -17669,7 +19888,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#include <limits.h>
int
-main ()
+main (void)
{
#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
bogus endian macros
@@ -17679,14 +19898,15 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
# It does; now see whether it defined to _BIG_ENDIAN or not.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <limits.h>
int
-main ()
+main (void)
{
#ifndef _BIG_ENDIAN
not big endian
@@ -17696,50 +19916,54 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_c_bigendian=yes
-else
+else $as_nop
ac_cv_c_bigendian=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# Compile a test program.
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes
+then :
# Try to guess by grepping values from an object file.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-short int ascii_mm[] =
+unsigned short int ascii_mm[] =
{ 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
+ unsigned short int ascii_ii[] =
{ 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
int use_ascii (int i) {
return ascii_mm[i] + ascii_ii[i];
}
- short int ebcdic_ii[] =
+ unsigned short int ebcdic_ii[] =
{ 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
+ unsigned short int ebcdic_mm[] =
{ 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
int use_ebcdic (int i) {
return ebcdic_mm[i] + ebcdic_ii[i];
}
- extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
-}
+ int
+ main (int argc, char **argv)
+ {
+ /* Intimidate the compiler so that it does not
+ optimize the arrays away. */
+ char *p = argv[0];
+ ascii_mm[1] = *p++; ebcdic_mm[1] = *p++;
+ ascii_ii[1] = *p++; ebcdic_ii[1] = *p++;
+ return use_ascii (argc) == use_ebcdic (*p);
+ }
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+if ac_fn_c_try_link "$LINENO"
+then :
+ if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then
ac_cv_c_bigendian=yes
fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then
if test "$ac_cv_c_bigendian" = unknown; then
ac_cv_c_bigendian=no
else
@@ -17748,13 +19972,14 @@ if ac_fn_c_try_compile "$LINENO"; then :
fi
fi
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
-main ()
+main (void)
{
/* Are we little or big endian? From Harbison&Steele. */
@@ -17770,9 +19995,10 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
ac_cv_c_bigendian=no
-else
+else $as_nop
ac_cv_c_bigendian=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
@@ -17781,18 +20007,18 @@ fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+printf "%s\n" "$ac_cv_c_bigendian" >&6; }
case $ac_cv_c_bigendian in #(
yes)
- $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+ printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h
BYTEORDER=4321;; #(
no)
BYTEORDER=1234 ;; #(
universal)
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
;; #(
*)
@@ -17801,21 +20027,20 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
esac
-cat >>confdefs.h <<_ACEOF
-#define BYTEORDER $BYTEORDER
-_ACEOF
+printf "%s\n" "#define BYTEORDER $BYTEORDER" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+printf %s "checking for an ANSI C-conforming const... " >&6; }
+if test ${ac_cv_c_const+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __cplusplus
@@ -17828,7 +20053,7 @@ main ()
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
+ /* IBM XL C 1.02.0.0 rejects this.
It does not let you subtract one const X* pointer from another in
an arm of an if-expression whose if-part is not a constant
expression */
@@ -17856,7 +20081,7 @@ main ()
iptr p = 0;
++p;
}
- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+ { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
struct s { int j; const int *ap[3]; } bx;
struct s *b = &bx; b->j = 5;
@@ -17872,38 +20097,29 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_c_const=yes
-else
+else $as_nop
ac_cv_c_const=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+printf "%s\n" "$ac_cv_c_const" >&6; }
if test $ac_cv_c_const = no; then
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
+printf "%s\n" "#define const /**/" >>confdefs.h
fi
# Check whether --with-xmlwf was given.
-if test "${with_xmlwf+set}" = set; then :
+if test ${with_xmlwf+y}
+then :
withval=$with_xmlwf;
-else
+else $as_nop
with_xmlwf=yes
fi
@@ -17918,9 +20134,10 @@ fi
# Check whether --with-examples was given.
-if test "${with_examples+set}" = set; then :
+if test ${with_examples+y}
+then :
withval=$with_examples;
-else
+else $as_nop
with_examples=yes
fi
@@ -17935,9 +20152,10 @@ fi
# Check whether --with-tests was given.
-if test "${with_tests+set}" = set; then :
+if test ${with_tests+y}
+then :
withval=$with_tests;
-else
+else $as_nop
with_tests=yes
fi
@@ -17950,13 +20168,389 @@ else
fi
+if test x${with_tests} = xyes
+then :
+ ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ ac_success=no
+
+
+
+
+
+ if test x$ac_success = xno; then
+ for alternative in ${ax_cxx_compile_alternatives}; do
+ for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do
+ if test x"$switch" = xMSVC; then
+ switch=-std:c++${alternative}
+ cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_${switch}_MSVC" | $as_tr_sh`
+ else
+ cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
+printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; }
+if eval test \${$cachevar+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_save_CXX="$CXX"
+ CXX="$CXX $switch"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+// If the compiler admits that it is not ready for C++11, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+// MSVC always sets __cplusplus to 199711L in older versions; newer versions
+// only set it correctly if /Zc:__cplusplus is specified as well as a
+// /std:c++NN switch:
+// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
+#elif __cplusplus < 201103L && !defined _MSC_VER
+
+#error "This is not a C++11 compiler"
+
+#else
+
+namespace cxx11
+{
+
+ namespace test_static_assert
+ {
+
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ }
+
+ namespace test_final_override
+ {
+
+ struct Base
+ {
+ virtual ~Base() {}
+ virtual void f() {}
+ };
+
+ struct Derived : public Base
+ {
+ virtual ~Derived() override {}
+ virtual void f() override {}
+ };
+
+ }
+
+ namespace test_double_right_angle_brackets
+ {
+
+ template < typename T >
+ struct check {};
+
+ typedef check<void> single_type;
+ typedef check<check<void>> double_type;
+ typedef check<check<check<void>>> triple_type;
+ typedef check<check<check<check<void>>>> quadruple_type;
+
+ }
+
+ namespace test_decltype
+ {
+
+ int
+ f()
+ {
+ int a = 1;
+ decltype(a) b = 2;
+ return a + b;
+ }
+
+ }
+
+ namespace test_type_deduction
+ {
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static const bool value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static const bool value = true;
+ };
+
+ template < typename T1, typename T2 >
+ auto
+ add(T1 a1, T2 a2) -> decltype(a1 + a2)
+ {
+ return a1 + a2;
+ }
+
+ int
+ test(const int c, volatile int v)
+ {
+ static_assert(is_same<int, decltype(0)>::value == true, "");
+ static_assert(is_same<int, decltype(c)>::value == false, "");
+ static_assert(is_same<int, decltype(v)>::value == false, "");
+ auto ac = c;
+ auto av = v;
+ auto sumi = ac + av + 'x';
+ auto sumf = ac + av + 1.0;
+ static_assert(is_same<int, decltype(ac)>::value == true, "");
+ static_assert(is_same<int, decltype(av)>::value == true, "");
+ static_assert(is_same<int, decltype(sumi)>::value == true, "");
+ static_assert(is_same<int, decltype(sumf)>::value == false, "");
+ static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
+ return (sumf > 0.0) ? sumi : add(c, v);
+ }
+
+ }
+
+ namespace test_noexcept
+ {
+
+ int f() { return 0; }
+ int g() noexcept { return 0; }
+
+ static_assert(noexcept(f()) == false, "");
+ static_assert(noexcept(g()) == true, "");
+
+ }
+
+ namespace test_constexpr
+ {
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
+ {
+ return *s ? strlen_c_r(s + 1, acc + 1) : acc;
+ }
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c(const CharT *const s) noexcept
+ {
+ return strlen_c_r(s, 0UL);
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("1") == 1UL, "");
+ static_assert(strlen_c("example") == 7UL, "");
+ static_assert(strlen_c("another\0example") == 7UL, "");
+
+ }
+
+ namespace test_rvalue_references
+ {
+
+ template < int N >
+ struct answer
+ {
+ static constexpr int value = N;
+ };
+
+ answer<1> f(int&) { return answer<1>(); }
+ answer<2> f(const int&) { return answer<2>(); }
+ answer<3> f(int&&) { return answer<3>(); }
+
+ void
+ test()
+ {
+ int i = 0;
+ const int c = 0;
+ static_assert(decltype(f(i))::value == 1, "");
+ static_assert(decltype(f(c))::value == 2, "");
+ static_assert(decltype(f(0))::value == 3, "");
+ }
+
+ }
+
+ namespace test_uniform_initialization
+ {
+
+ struct test
+ {
+ static const int zero {};
+ static const int one {1};
+ };
+
+ static_assert(test::zero == 0, "");
+ static_assert(test::one == 1, "");
+
+ }
+
+ namespace test_lambdas
+ {
+
+ void
+ test1()
+ {
+ auto lambda1 = [](){};
+ auto lambda2 = lambda1;
+ lambda1();
+ lambda2();
+ }
+
+ int
+ test2()
+ {
+ auto a = [](int i, int j){ return i + j; }(1, 2);
+ auto b = []() -> int { return '0'; }();
+ auto c = [=](){ return a + b; }();
+ auto d = [&](){ return c; }();
+ auto e = [a, &b](int x) mutable {
+ const auto identity = [](int y){ return y; };
+ for (auto i = 0; i < a; ++i)
+ a += b--;
+ return x + identity(a + b);
+ }(0);
+ return a + b + c + d + e;
+ }
+
+ int
+ test3()
+ {
+ const auto nullary = [](){ return 0; };
+ const auto unary = [](int x){ return x; };
+ using nullary_t = decltype(nullary);
+ using unary_t = decltype(unary);
+ const auto higher1st = [](nullary_t f){ return f(); };
+ const auto higher2nd = [unary](nullary_t f1){
+ return [unary, f1](unary_t f2){ return f2(unary(f1())); };
+ };
+ return higher1st(nullary) + higher2nd(nullary)(unary);
+ }
+
+ }
+
+ namespace test_variadic_templates
+ {
+
+ template <int...>
+ struct sum;
+
+ template <int N0, int... N1toN>
+ struct sum<N0, N1toN...>
+ {
+ static constexpr auto value = N0 + sum<N1toN...>::value;
+ };
+
+ template <>
+ struct sum<>
+ {
+ static constexpr auto value = 0;
+ };
+
+ static_assert(sum<>::value == 0, "");
+ static_assert(sum<1>::value == 1, "");
+ static_assert(sum<23>::value == 23, "");
+ static_assert(sum<1, 2>::value == 3, "");
+ static_assert(sum<5, 5, 11>::value == 21, "");
+ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
+
+ }
+
+ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
+ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
+ // because of this.
+ namespace test_template_alias_sfinae
+ {
+
+ struct foo {};
+
+ template<typename T>
+ using member = typename T::member_type;
+
+ template<typename T>
+ void func(...) {}
+
+ template<typename T>
+ void func(member<T>*) {}
+
+ void test();
+
+ void test() { func<foo>(0); }
+
+ }
+
+} // namespace cxx11
+
+#endif // __cplusplus >= 201103L
+
+
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+ eval $cachevar=yes
+else $as_nop
+ eval $cachevar=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ CXX="$ac_save_CXX"
+fi
+eval ac_res=\$$cachevar
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+ if eval test x\$$cachevar = xyes; then
+ CXX="$CXX $switch"
+ if test -n "$CXXCPP" ; then
+ CXXCPP="$CXXCPP $switch"
+ fi
+ ac_success=yes
+ break
+ fi
+ done
+ if test x$ac_success = xyes; then
+ break
+ fi
+ done
+ fi
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test x$ax_cxx_compile_cxx11_required = xtrue; then
+ if test x$ac_success = xno; then
+ as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
+ fi
+ fi
+ if test x$ac_success = xno; then
+ HAVE_CXX11=0
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
+printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;}
+ else
+ HAVE_CXX11=1
+
+printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h
+
+ fi
+
+
+fi
EXPATCFG_ON_MINGW=no
case "${host_os}" in #(
mingw*) :
EXPATCFG_ON_MINGW=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: detected OS: MinGW" >&5
-$as_echo "$as_me: detected OS: MinGW" >&6;} ;; #(
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detected OS: MinGW" >&5
+printf "%s\n" "$as_me: detected OS: MinGW" >&6;} ;; #(
*) :
;;
esac
@@ -17977,22 +20571,199 @@ else
UNICODE_FALSE=
fi
+ if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null; then
+ _INTERNAL_UNICODE_WCHAR_T_TRUE=
+ _INTERNAL_UNICODE_WCHAR_T_FALSE='#'
+else
+ _INTERNAL_UNICODE_WCHAR_T_TRUE='#'
+ _INTERNAL_UNICODE_WCHAR_T_FALSE=
+fi
+
+ if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null; then
+ _INTERNAL_MIN_SIZE_TRUE=
+ _INTERNAL_MIN_SIZE_FALSE='#'
+else
+ _INTERNAL_MIN_SIZE_TRUE='#'
+ _INTERNAL_MIN_SIZE_FALSE=
+fi
+
+ if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null; then
+ _INTERNAL_LARGE_SIZE_TRUE=
+ _INTERNAL_LARGE_SIZE_FALSE='#'
+else
+ _INTERNAL_LARGE_SIZE_TRUE='#'
+ _INTERNAL_LARGE_SIZE_FALSE=
+fi
+
+
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5
+printf %s "checking for _mwvalidcheckl in -lmw... " >&6; }
+if test ${ac_cv_lib_mw__mwvalidcheckl+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmw $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char _mwvalidcheckl (void);
+int
+main (void)
+{
+return _mwvalidcheckl ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_lib_mw__mwvalidcheckl=yes
+else $as_nop
+ ac_cv_lib_mw__mwvalidcheckl=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5
+printf "%s\n" "$ac_cv_lib_mw__mwvalidcheckl" >&6; }
+if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes
+then :
+ LIBM=-lmw
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
+printf %s "checking for cos in -lm... " >&6; }
+if test ${ac_cv_lib_m_cos+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos (void);
+int
+main (void)
+{
+return cos ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_lib_m_cos=yes
+else $as_nop
+ ac_cv_lib_m_cos=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
+printf "%s\n" "$ac_cv_lib_m_cos" >&6; }
+if test "x$ac_cv_lib_m_cos" = xyes
+then :
+ LIBM="$LIBM -lm"
+fi
+
+ ;;
+*)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
+printf %s "checking for cos in -lm... " >&6; }
+if test ${ac_cv_lib_m_cos+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos (void);
+int
+main (void)
+{
+return cos ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_lib_m_cos=yes
+else $as_nop
+ ac_cv_lib_m_cos=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
+printf "%s\n" "$ac_cv_lib_m_cos" >&6; }
+if test "x$ac_cv_lib_m_cos" = xyes
+then :
+ LIBM=-lm
+fi
+
+ ;;
+esac
+
# Check whether --with-libbsd was given.
-if test "${with_libbsd+set}" = set; then :
+if test ${with_libbsd+y}
+then :
withval=$with_libbsd;
-else
+else $as_nop
with_libbsd=no
fi
-if test "x${with_libbsd}" != xno; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5
-$as_echo_n "checking for arc4random_buf in -lbsd... " >&6; }
-if ${ac_cv_lib_bsd_arc4random_buf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+if test "x${with_libbsd}" != xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5
+printf %s "checking for arc4random_buf in -lbsd... " >&6; }
+if test ${ac_cv_lib_bsd_arc4random_buf+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -18000,71 +20771,78 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char arc4random_buf ();
+char arc4random_buf (void);
int
-main ()
+main (void)
{
return arc4random_buf ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_bsd_arc4random_buf=yes
-else
+else $as_nop
ac_cv_lib_bsd_arc4random_buf=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_arc4random_buf" >&5
-$as_echo "$ac_cv_lib_bsd_arc4random_buf" >&6; }
-if test "x$ac_cv_lib_bsd_arc4random_buf" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBBSD 1
-_ACEOF
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_arc4random_buf" >&5
+printf "%s\n" "$ac_cv_lib_bsd_arc4random_buf" >&6; }
+if test "x$ac_cv_lib_bsd_arc4random_buf" = xyes
+then :
+ printf "%s\n" "#define HAVE_LIBBSD 1" >>confdefs.h
LIBS="-lbsd $LIBS"
-else
- if test "x${with_libbsd}" = xyes; then :
+else $as_nop
+ if test "x${with_libbsd}" = xyes
+then :
as_fn_error $? "Enforced use of libbsd cannot be satisfied." "$LINENO" 5
fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf (BSD or libbsd)" >&5
-$as_echo_n "checking for arc4random_buf (BSD or libbsd)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf (BSD, libbsd or glibc 2.36+)" >&5
+printf %s "checking for arc4random_buf (BSD, libbsd or glibc 2.36+)... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
- #include <stdlib.h> /* for arc4random_buf on BSD, for NULL */
#if defined(HAVE_LIBBSD)
# include <bsd/stdlib.h>
+ #else
+ # include <stdlib.h> /* for arc4random_buf on BSD */
#endif
- int main() {
- arc4random_buf(NULL, 0U);
+ int main(void) {
+ char dummy[123]; // double brackets for m4
+ arc4random_buf(dummy, 0U);
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
-$as_echo "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h
+printf "%s\n" "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random (BSD, macOS or libbsd)" >&5
-$as_echo_n "checking for arc4random (BSD, macOS or libbsd)... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc4random (BSD, macOS, libbsd or glibc 2.36+)" >&5
+printf %s "checking for arc4random (BSD, macOS, libbsd or glibc 2.36+)... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -18073,175 +20851,172 @@ $as_echo_n "checking for arc4random (BSD, macOS or libbsd)... " >&6; }
#else
# include <stdlib.h>
#endif
- int main() {
+ int main(void) {
arc4random();
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
-$as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h
+printf "%s\n" "#define HAVE_ARC4RANDOM 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
# Check whether --with-getrandom was given.
-if test "${with_getrandom+set}" = set; then :
+if test ${with_getrandom+y}
+then :
withval=$with_getrandom;
-else
+else $as_nop
with_getrandom=check
fi
-if test "x$with_getrandom" != xno; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getrandom (Linux 3.17+, glibc 2.25+)" >&5
-$as_echo_n "checking for getrandom (Linux 3.17+, glibc 2.25+)... " >&6; }
+if test "x$with_getrandom" != xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getrandom (Linux 3.17+, glibc 2.25+)" >&5
+printf %s "checking for getrandom (Linux 3.17+, glibc 2.25+)... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h> /* for NULL */
#include <sys/random.h>
- int main() {
+ int main(void) {
return getrandom(NULL, 0U, 0U);
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-$as_echo "#define HAVE_GETRANDOM 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- if test "x$with_getrandom" = xyes; then :
+if ac_fn_c_try_link "$LINENO"
+then :
+
+printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ if test "x$with_getrandom" = xyes
+then :
as_fn_error $? "enforced the use of getrandom --with-getrandom, but not detected" "$LINENO" 5
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
fi
# Check whether --with-sys_getrandom was given.
-if test "${with_sys_getrandom+set}" = set; then :
+if test ${with_sys_getrandom+y}
+then :
withval=$with_sys_getrandom;
-else
+else $as_nop
with_sys_getrandom=check
fi
-if test "x$with_sys_getrandom" != xno; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for syscall SYS_getrandom (Linux 3.17+)" >&5
-$as_echo_n "checking for syscall SYS_getrandom (Linux 3.17+)... " >&6; }
+if test "x$with_sys_getrandom" != xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for syscall SYS_getrandom (Linux 3.17+)" >&5
+printf %s "checking for syscall SYS_getrandom (Linux 3.17+)... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+ #define _GNU_SOURCE
#include <stdlib.h> /* for NULL */
#include <unistd.h> /* for syscall */
#include <sys/syscall.h> /* for SYS_getrandom */
- int main() {
+ int main(void) {
syscall(SYS_getrandom, NULL, 0, 0);
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-$as_echo "#define HAVE_SYSCALL_GETRANDOM 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- if test "x$with_sys_getrandom" = xyes; then :
+if ac_fn_c_try_link "$LINENO"
+then :
+
+printf "%s\n" "#define HAVE_SYSCALL_GETRANDOM 1" >>confdefs.h
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ if test "x$with_sys_getrandom" = xyes
+then :
as_fn_error $? "enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected" "$LINENO" 5
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
fi
-for ac_header in fcntl.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default"
+if test "x$ac_cv_header_fcntl_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h
fi
+ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
+if test "x$ac_cv_header_unistd_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h
-done
+fi
ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = xyes; then :
+if test "x$ac_cv_type_off_t" = xyes
+then :
-else
+else $as_nop
-cat >>confdefs.h <<_ACEOF
-#define off_t long int
-_ACEOF
+printf "%s\n" "#define off_t long int" >>confdefs.h
fi
-
-
- for ac_header in $ac_header_list
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
+ac_func=
+for ac_item in $ac_func_c_list
+do
+ if test $ac_func; then
+ ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func
+ if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then
+ echo "#define $ac_item 1" >> confdefs.h
+ fi
+ ac_func=
+ else
+ ac_func=$ac_item
+ fi
done
-
-
-
-
-
-
-for ac_func in getpagesize
-do :
- ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
-
-fi
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
-$as_echo_n "checking for working mmap... " >&6; }
-if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_mmap_fixed_mapped=no
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
+printf %s "checking for working mmap... " >&6; }
+if test ${ac_cv_func_mmap_fixed_mapped+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test "$cross_compiling" = yes
+then :
+ case "$host_os" in # ((
+ # Guess yes on platforms where we know the result.
+ linux*) ac_cv_func_mmap_fixed_mapped=yes ;;
+ # If we don't know, assume the worst.
+ *) ac_cv_func_mmap_fixed_mapped=no ;;
+ esac
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
@@ -18273,10 +21048,6 @@ $ac_includes_default
#include <fcntl.h>
#include <sys/mman.h>
-#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
-char *malloc ();
-#endif
-
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
# ifdef _SC_PAGESIZE
@@ -18310,7 +21081,7 @@ char *malloc ();
#endif /* no HAVE_GETPAGESIZE */
int
-main ()
+main (void)
{
char *data, *data2, *data3;
const char *cdata2;
@@ -18378,12 +21149,15 @@ main ()
if (*(data + i) != *(data3 + i))
return 14;
close (fd);
+ free (data);
+ free (data3);
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
ac_cv_func_mmap_fixed_mapped=yes
-else
+else $as_nop
ac_cv_func_mmap_fixed_mapped=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
@@ -18391,84 +21165,96 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
-$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
+printf "%s\n" "$ac_cv_func_mmap_fixed_mapped" >&6; }
if test $ac_cv_func_mmap_fixed_mapped = yes; then
-$as_echo "#define HAVE_MMAP 1" >>confdefs.h
+printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h
fi
rm -f conftest.mmap conftest.txt
-if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then :
+if test "$ac_cv_func_mmap_fixed_mapped" = "yes"
+then :
FILEMAP=unixfilemap
-else
+else $as_nop
FILEMAP=readfilemap
fi
-$as_echo "#define XML_NS 1" >>confdefs.h
+printf "%s\n" "#define XML_NS 1" >>confdefs.h
+
+
+printf "%s\n" "#define XML_GE 1" >>confdefs.h
-$as_echo "#define XML_DTD 1" >>confdefs.h
+printf "%s\n" "#define XML_DTD 1" >>confdefs.h
-$as_echo "#define XML_DEV_URANDOM 1" >>confdefs.h
+printf "%s\n" "#define XML_DEV_URANDOM 1" >>confdefs.h
# Check whether --enable-xml-attr-info was given.
-if test "${enable_xml_attr_info+set}" = set; then :
+if test ${enable_xml_attr_info+y}
+then :
enableval=$enable_xml_attr_info;
-else
+else $as_nop
enable_xml_attr_info=no
fi
-if test "x${enable_xml_attr_info}" = "xyes"; then :
+if test "x${enable_xml_attr_info}" = "xyes"
+then :
-$as_echo "#define XML_ATTR_INFO 1" >>confdefs.h
+printf "%s\n" "#define XML_ATTR_INFO 1" >>confdefs.h
fi
# Check whether --enable-xml-context was given.
-if test "${enable_xml_context+set}" = set; then :
+if test ${enable_xml_context+y}
+then :
enableval=$enable_xml_context; enable_xml_context=${enableval}
fi
-if test "x${enable_xml_context}" != "xno"; then :
+if test "x${enable_xml_context}" != "xno"
+then :
if test "x${enable_xml_context}" = "xyes" \
- -o "x${enable_xml_context}" = "x"; then :
+ -o "x${enable_xml_context}" = "x"
+then :
enable_xml_context=1024
fi
+else $as_nop
+ enable_xml_context=0
+fi
-cat >>confdefs.h <<_ACEOF
-#define XML_CONTEXT_BYTES ${enable_xml_context}
-_ACEOF
+printf "%s\n" "#define XML_CONTEXT_BYTES ${enable_xml_context}" >>confdefs.h
-fi
# Check whether --with-docbook was given.
-if test "${with_docbook+set}" = set; then :
+if test ${with_docbook+y}
+then :
withval=$with_docbook;
-else
+else $as_nop
with_docbook=check
fi
-if test "x$with_docbook" != xno; then :
+if test "x$with_docbook" != xno
+then :
for ac_prog in docbook2x-man db2x_docbook2man docbook2man docbook-to-man
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DOCBOOK_TO_MAN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_DOCBOOK_TO_MAN+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$DOCBOOK_TO_MAN"; then
ac_cv_prog_DOCBOOK_TO_MAN="$DOCBOOK_TO_MAN" # Let the user override the test.
else
@@ -18476,11 +21262,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DOCBOOK_TO_MAN="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -18491,11 +21281,11 @@ fi
fi
DOCBOOK_TO_MAN=$ac_cv_prog_DOCBOOK_TO_MAN
if test -n "$DOCBOOK_TO_MAN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK_TO_MAN" >&5
-$as_echo "$DOCBOOK_TO_MAN" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK_TO_MAN" >&5
+printf "%s\n" "$DOCBOOK_TO_MAN" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -18503,11 +21293,14 @@ fi
done
fi
-if test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes; then :
+if test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes
+then :
as_fn_error $? "Required program 'docbook2x-man' not found." "$LINENO" 5
fi
-if test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno; then :
- if ${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase; then :
+if test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno
+then :
+ if ${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase
+then :
as_fn_error $? "Your local ${DOCBOOK_TO_MAN} was found to work with SGML rather
than XML. Please install docbook2X and use variable DOCBOOK_TO_MAN to point
configure to command docbook2x-man of docbook2X.
@@ -18517,24 +21310,188 @@ if test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno; then :
fi
fi
- if test "x${DOCBOOK_TO_MAN}" != x; then
- WITH_DOCBOOK_TRUE=
- WITH_DOCBOOK_FALSE='#'
+if test -f "${srcdir}"/doc/xmlwf.1
+then :
+ if true; then
+ WITH_MANPAGE_TRUE=
+ WITH_MANPAGE_FALSE='#'
+else
+ WITH_MANPAGE_TRUE='#'
+ WITH_MANPAGE_FALSE=
+fi
+
+ if test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x
+then :
+ if true; then
+ WITH_PREBUILT_MANPAGE_TRUE=
+ WITH_PREBUILT_MANPAGE_FALSE='#'
+else
+ WITH_PREBUILT_MANPAGE_TRUE='#'
+ WITH_PREBUILT_MANPAGE_FALSE=
+fi
+
+ if false; then
+ WITH_DISTRIBUTABLE_MANPAGE_TRUE=
+ WITH_DISTRIBUTABLE_MANPAGE_FALSE='#'
+else
+ WITH_DISTRIBUTABLE_MANPAGE_TRUE='#'
+ WITH_DISTRIBUTABLE_MANPAGE_FALSE=
+fi
+
+else $as_nop
+ if false; then
+ WITH_PREBUILT_MANPAGE_TRUE=
+ WITH_PREBUILT_MANPAGE_FALSE='#'
+else
+ WITH_PREBUILT_MANPAGE_TRUE='#'
+ WITH_PREBUILT_MANPAGE_FALSE=
+fi
+
+ if true; then
+ WITH_DISTRIBUTABLE_MANPAGE_TRUE=
+ WITH_DISTRIBUTABLE_MANPAGE_FALSE='#'
+else
+ WITH_DISTRIBUTABLE_MANPAGE_TRUE='#'
+ WITH_DISTRIBUTABLE_MANPAGE_FALSE=
+fi
+
+fi
+
+else $as_nop
+ if test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x
+then :
+ if true; then
+ WITH_MANPAGE_TRUE=
+ WITH_MANPAGE_FALSE='#'
+else
+ WITH_MANPAGE_TRUE='#'
+ WITH_MANPAGE_FALSE=
+fi
+
+ if true; then
+ WITH_DISTRIBUTABLE_MANPAGE_TRUE=
+ WITH_DISTRIBUTABLE_MANPAGE_FALSE='#'
+else
+ WITH_DISTRIBUTABLE_MANPAGE_TRUE='#'
+ WITH_DISTRIBUTABLE_MANPAGE_FALSE=
+fi
+
+else $as_nop
+ if false; then
+ WITH_MANPAGE_TRUE=
+ WITH_MANPAGE_FALSE='#'
else
- WITH_DOCBOOK_TRUE='#'
- WITH_DOCBOOK_FALSE=
+ WITH_MANPAGE_TRUE='#'
+ WITH_MANPAGE_FALSE=
fi
+ if false; then
+ WITH_DISTRIBUTABLE_MANPAGE_TRUE=
+ WITH_DISTRIBUTABLE_MANPAGE_FALSE='#'
+else
+ WITH_DISTRIBUTABLE_MANPAGE_TRUE='#'
+ WITH_DISTRIBUTABLE_MANPAGE_FALSE=
+fi
+
+fi
+ if false; then
+ WITH_PREBUILT_MANPAGE_TRUE=
+ WITH_PREBUILT_MANPAGE_FALSE='#'
+else
+ WITH_PREBUILT_MANPAGE_TRUE='#'
+ WITH_PREBUILT_MANPAGE_FALSE=
+fi
+
+fi
+
+if test "x${enable_xml_attr_info}" = xyes
+then :
+ EXPAT_ATTR_INFO=ON
+else $as_nop
+ EXPAT_ATTR_INFO=OFF
+fi
+EXPAT_DTD=ON
+if test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x
+then :
+ EXPAT_LARGE_SIZE=ON
+else $as_nop
+ EXPAT_LARGE_SIZE=OFF
+fi
+if test "x${_INTERNAL_MIN_SIZE_TRUE}" = x
+then :
+ EXPAT_MIN_SIZE=ON
+else $as_nop
+ EXPAT_MIN_SIZE=OFF
+fi
+EXPAT_NS=ON
+if test "x${enable_xml_context}" != xno
+then :
+ EXPAT_CONTEXT_BYTES=${enable_xml_context}
+else $as_nop
+ EXPAT_CONTEXT_BYTES=OFF
+fi
+if test "x${UNICODE_TRUE}" = x
+then :
+ if test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x
+then :
+ EXPAT_CHAR_TYPE=wchar_t
+else $as_nop
+ EXPAT_CHAR_TYPE=ushort
+fi
+else $as_nop
+ EXPAT_CHAR_TYPE=char
+fi
+PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake
+LIBDIR_BASENAME="$(basename "${libdir}")"
+SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")"
+SO_MINOR="${LIBAGE}"
+SO_PATCH="${LIBREVISION}"
+
+
-_EXPAT_OUTPUT_NAME="$PACKAGE_NAME"
-ac_config_files="$ac_config_files Makefile expat.pc doc/Makefile examples/Makefile lib/Makefile tests/Makefile tests/benchmark/Makefile xmlwf/Makefile"
+
+
+
+if ac_fn_c_compute_int "$LINENO" "sizeof(void *)" "SIZEOF_VOID_P" ""
+then :
+
+fi
+
+
+
+
+
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library name prefix" >&5
+printf %s "checking for shared library name prefix... " >&6; }
+case "${host_os}" in #(
+ cygwin*) :
+ CMAKE_SHARED_LIBRARY_PREFIX=cyg ;; #(
+ *) :
+ CMAKE_SHARED_LIBRARY_PREFIX=lib ;;
+esac
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${CMAKE_SHARED_LIBRARY_PREFIX}" >&5
+printf "%s\n" "${CMAKE_SHARED_LIBRARY_PREFIX}" >&6; }
+
+
+case "${host_os}" in #(
+ darwin*) :
+ CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in ;; #(
+ mingw*|cygwin*) :
+ CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in ;; #(
+ *) :
+ CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in ;;
+esac
+ac_config_files="$ac_config_files Makefile expat.pc cmake/expat-config.cmake cmake/autotools/expat-config-version.cmake cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE} doc/Makefile examples/Makefile lib/Makefile tests/Makefile tests/benchmark/Makefile xmlwf/Makefile"
ac_config_files="$ac_config_files run.sh"
@@ -18565,8 +21522,8 @@ _ACEOF
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -18596,15 +21553,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
/^ac_cv_env_/b end
t clear
:clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
@@ -18618,8 +21575,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;}
fi
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -18636,7 +21593,7 @@ U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -18647,14 +21604,14 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+printf %s "checking that generated files are newer than configure... " >&6; }
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
+printf "%s\n" "done" >&6; }
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
@@ -18663,6 +21620,10 @@ else
am__EXEEXT_FALSE=
fi
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -18696,8 +21657,56 @@ if test -z "${UNICODE_TRUE}" && test -z "${UNICODE_FALSE}"; then
as_fn_error $? "conditional \"UNICODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${WITH_DOCBOOK_TRUE}" && test -z "${WITH_DOCBOOK_FALSE}"; then
- as_fn_error $? "conditional \"WITH_DOCBOOK\" was never defined.
+if test -z "${_INTERNAL_UNICODE_WCHAR_T_TRUE}" && test -z "${_INTERNAL_UNICODE_WCHAR_T_FALSE}"; then
+ as_fn_error $? "conditional \"_INTERNAL_UNICODE_WCHAR_T\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${_INTERNAL_MIN_SIZE_TRUE}" && test -z "${_INTERNAL_MIN_SIZE_FALSE}"; then
+ as_fn_error $? "conditional \"_INTERNAL_MIN_SIZE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${_INTERNAL_LARGE_SIZE_TRUE}" && test -z "${_INTERNAL_LARGE_SIZE_FALSE}"; then
+ as_fn_error $? "conditional \"_INTERNAL_LARGE_SIZE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_MANPAGE_TRUE}" && test -z "${WITH_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_MANPAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_PREBUILT_MANPAGE_TRUE}" && test -z "${WITH_PREBUILT_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_PREBUILT_MANPAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_PREBUILT_MANPAGE_TRUE}" && test -z "${WITH_PREBUILT_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_PREBUILT_MANPAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_MANPAGE_TRUE}" && test -z "${WITH_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_MANPAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_MANPAGE_TRUE}" && test -z "${WITH_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_MANPAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_PREBUILT_MANPAGE_TRUE}" && test -z "${WITH_PREBUILT_MANPAGE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_PREBUILT_MANPAGE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
@@ -18705,8 +21714,8 @@ fi
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
@@ -18729,14 +21738,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
+else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
@@ -18746,46 +21757,46 @@ esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -18794,13 +21805,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -18809,8 +21813,12 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
@@ -18822,30 +21830,10 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
@@ -18858,13 +21846,14 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
+
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -18891,18 +21880,20 @@ as_fn_unset ()
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
+
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
+else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
@@ -18914,12 +21905,13 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
+else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
@@ -18950,7 +21942,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -18972,6 +21964,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -18985,6 +21981,12 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -19026,7 +22028,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -19035,7 +22037,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -19097,8 +22099,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by expat $as_me 2.2.10, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+This file was extended by expat $as_me 2.7.1, which was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -19157,17 +22159,19 @@ $config_headers
Configuration commands:
$config_commands
-Report bugs to <expat-bugs@libexpat.org>."
+Report bugs to <https://github.com/libexpat/libexpat/issues>."
_ACEOF
+ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
+ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-expat config.status 2.2.10
-configured by $0, generated by GNU Autoconf 2.69,
+expat config.status 2.7.1
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -19207,15 +22211,15 @@ do
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
+ printf "%s\n" "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
+ printf "%s\n" "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
@@ -19223,7 +22227,7 @@ do
--header | --heade | --head | --hea )
$ac_shift
case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
@@ -19232,7 +22236,7 @@ do
as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
+ printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
@@ -19260,7 +22264,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
@@ -19274,7 +22278,7 @@ exec 5>>config.log
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
- $as_echo "$ac_log"
+ printf "%s\n" "$ac_log"
} >&5
_ACEOF
@@ -19329,12 +22333,14 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q
lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`'
deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
@@ -19512,13 +22518,13 @@ LN_S \
lt_SP2NL \
lt_NL2SP \
reload_flag \
+FILECMD \
deplibs_check_method \
file_magic_cmd \
file_magic_glob \
want_nocaseglob \
sharedlib_from_linklib_cmd \
AR \
-AR_FLAGS \
archiver_list_spec \
STRIP \
RANLIB \
@@ -19680,6 +22686,9 @@ do
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"expat.pc") CONFIG_FILES="$CONFIG_FILES expat.pc" ;;
+ "cmake/expat-config.cmake") CONFIG_FILES="$CONFIG_FILES cmake/expat-config.cmake" ;;
+ "cmake/autotools/expat-config-version.cmake") CONFIG_FILES="$CONFIG_FILES cmake/autotools/expat-config-version.cmake" ;;
+ "cmake/autotools/expat-noconfig.cmake") CONFIG_FILES="$CONFIG_FILES cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}" ;;
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
"examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
"lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
@@ -19698,9 +22707,9 @@ done
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+ test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
+ test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers
+ test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands
fi
# Have a temporary directory for convenience. Make it in the build tree
@@ -19735,7 +22744,24 @@ ac_tmp=$tmp
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
-
+if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
+ ac_cs_awk_getline=:
+ ac_cs_awk_pipe_init=
+ ac_cs_awk_read_file='
+ while ((getline aline < (F[key])) > 0)
+ print(aline)
+ close(F[key])'
+ ac_cs_awk_pipe_fini=
+else
+ ac_cs_awk_getline=false
+ ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
+ ac_cs_awk_read_file='
+ print "|#_!!_#|"
+ print "cat " F[key] " &&"
+ '$ac_cs_awk_pipe_init
+ # The final `:' finishes the AND list.
+ ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
+fi
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
@@ -19753,6 +22779,17 @@ fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
+# Create commands to substitute file output variables.
+{
+ echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
+ echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' &&
+ echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' &&
+ echo "_ACAWK" &&
+ echo "_ACEOF"
+} >conf$$files.sh &&
+. ./conf$$files.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+rm -f conf$$files.sh
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
@@ -19829,7 +22866,7 @@ _ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
-
+ \$ac_cs_awk_pipe_init
}
{
line = $ 0
@@ -19847,10 +22884,16 @@ cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
} else
len += 1 + keylen
}
-
+ if (nfields == 3 && !substed) {
+ key = field[2]
+ if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) {
+ \$ac_cs_awk_read_file
+ next
+ }
+ }
print line
}
-
+\$ac_cs_awk_pipe_fini
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
@@ -20036,7 +23079,7 @@ do
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
@@ -20044,17 +23087,17 @@ do
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+printf "%s\n" "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
+ ac_sed_conf_input=`printf "%s\n" "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
@@ -20071,7 +23114,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
+printf "%s\n" X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -20095,9 +23138,9 @@ $as_echo X"$ac_file" |
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -20159,8 +23202,8 @@ ac_sed_dataroot='
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
@@ -20197,16 +23240,21 @@ s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
+if $ac_cs_awk_getline; then
+ $AWK -f "$ac_tmp/subs.awk"
+else
+ $AWK -f "$ac_tmp/subs.awk" | $SHELL
+fi \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
@@ -20222,20 +23270,20 @@ which seems to be undefined. Please make sure it is defined" >&2;}
#
if test x"$ac_file" != x-; then
{
- $as_echo "/* $configure_input */" \
+ printf "%s\n" "/* $configure_input */" >&1 \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
} >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+printf "%s\n" "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
- $as_echo "/* $configure_input */" \
+ printf "%s\n" "/* $configure_input */" >&1 \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
@@ -20255,7 +23303,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$_am_arg" : 'X\(//\)[^/]' \| \
X"$_am_arg" : 'X\(//\)$' \| \
X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
+printf "%s\n" X"$_am_arg" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -20275,8 +23323,8 @@ $as_echo X"$_am_arg" |
s/.*/./; q'`/stamp-h$_am_stamp_count
;;
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
+ :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+printf "%s\n" "$as_me: executing $ac_file commands" >&6;}
;;
esac
@@ -20302,7 +23350,7 @@ esac
for am_mf
do
# Strip MF so we end up with the name of the file.
- am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+ am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
@@ -20314,7 +23362,7 @@ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$am_mf" : 'X\(//\)[^/]' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$am_mf" |
+printf "%s\n" X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -20336,7 +23384,7 @@ $as_echo X"$am_mf" |
$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$am_mf" |
+printf "%s\n" X/"$am_mf" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -20361,8 +23409,8 @@ $as_echo X/"$am_mf" |
(exit $ac_status); } || am_rc=$?
done
if test $am_rc -ne 0; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE=\"gmake\" (or whatever is
@@ -20393,19 +23441,18 @@ See \`config.log' for more details" "$LINENO" 5; }
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit, 1996
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2024 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# GNU Libtool is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
+# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# As a special exception to the GNU General Public License, if you
@@ -20522,6 +23569,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd
# convert \$build files to toolchain format.
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+# A file(cmd) program that detects file types.
+FILECMD=$lt_FILECMD
+
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
@@ -20540,8 +23590,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
# The archiver.
AR=$lt_AR
+# Flags to create an archive (by configure).
+lt_ar_flags=$lt_ar_flags
+
# Flags to create an archive.
-AR_FLAGS=$lt_AR_FLAGS
+AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"}
# How to feed a file listing to the archiver.
archiver_list_spec=$lt_archiver_list_spec
@@ -20783,7 +23836,7 @@ hardcode_direct=$hardcode_direct
# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# "absolute",i.e. impossible to change by setting \$shlibpath_var if the
# library is relocated.
hardcode_direct_absolute=$hardcode_direct_absolute
@@ -20923,6 +23976,7 @@ _LT_EOF
esac
+
ltmain=$ac_aux_dir/ltmain.sh
@@ -20930,7 +23984,7 @@ ltmain=$ac_aux_dir/ltmain.sh
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
+ $SED '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" ||
@@ -21025,7 +24079,7 @@ hardcode_direct=$hardcode_direct_CXX
# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# "absolute",i.e. impossible to change by setting \$shlibpath_var if the
# library is relocated.
hardcode_direct_absolute=$hardcode_direct_absolute_CXX
@@ -21126,13 +24180,13 @@ if test "$no_create" != yes; then
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}:
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}:
Automake flags (can be overridden by user flags):
AM_CPPFLAGS: ${AM_CPPFLAGS}
@@ -21145,7 +24199,7 @@ User flags (override Automake flags on conflict):
CFLAGS: ${CFLAGS}
CXXFLAGS: ${CXXFLAGS}
LDFLAGS: ${LDFLAGS}" >&5
-$as_echo "$as_me:
+printf "%s\n" "$as_me:
Automake flags (can be overridden by user flags):
AM_CPPFLAGS: ${AM_CPPFLAGS}
@@ -21158,3 +24212,4 @@ User flags (override Automake flags on conflict):
CFLAGS: ${CFLAGS}
CXXFLAGS: ${CXXFLAGS}
LDFLAGS: ${LDFLAGS}" >&6;}
+
diff --git a/3rdparty/expat/configure.ac b/3rdparty/expat/configure.ac
index 82ec1fdd178..0c88b886701 100644
--- a/3rdparty/expat/configure.ac
+++ b/3rdparty/expat/configure.ac
@@ -1,21 +1,56 @@
dnl configuration script for expat
dnl Process this file with autoconf to produce a configure script.
+dnl __ __ _
+dnl ___\ \/ /_ __ __ _| |_
+dnl / _ \\ /| '_ \ / _` | __|
+dnl | __// \| |_) | (_| | |_
+dnl \___/_/\_\ .__/ \__,_|\__|
+dnl |_| XML parser
dnl
-dnl Copyright 2000 Clark Cooper
+dnl Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+dnl Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+dnl Copyright (c) 2001-2003 Greg Stein <gstein@users.sourceforge.net>
+dnl Copyright (c) 2006-2012 Karl Waclawek <karl@waclawek.net>
+dnl Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+dnl Copyright (c) 2017 S. P. Zeidler <spz@netbsd.org>
+dnl Copyright (c) 2017 Stephen Groat <stephen@groat.us>
+dnl Copyright (c) 2017-2020 Joe Orton <jorton@redhat.com>
+dnl Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
+dnl Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
+dnl Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+dnl Copyright (c) 2018 KangLin <kl222@126.com>
+dnl Copyright (c) 2019 Mohammed Khajapasha <mohammed.khajapasha@intel.com>
+dnl Copyright (c) 2019 Kishore Kunche <kishore.kunche@intel.com>
+dnl Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
+dnl Copyright (c) 2024 Ferenc Géczi <ferenc.gm@gmail.com>
+dnl Copyright (c) 2024 Dag-Erling Smørgrav <des@des.dev>
+dnl Licensed under the MIT license:
dnl
-dnl This file is part of EXPAT.
+dnl Permission is hereby granted, free of charge, to any person obtaining
+dnl a copy of this software and associated documentation files (the
+dnl "Software"), to deal in the Software without restriction, including
+dnl without limitation the rights to use, copy, modify, merge, publish,
+dnl distribute, sublicense, and/or sell copies of the Software, and to permit
+dnl persons to whom the Software is furnished to do so, subject to the
+dnl following conditions:
dnl
-dnl EXPAT is free software; you can redistribute it and/or modify it
-dnl under the terms of the License (based on the MIT/X license) contained
-dnl in the file COPYING that comes with this distribution.
+dnl The above copyright notice and this permission notice shall be included
+dnl in all copies or substantial portions of the Software.
dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+dnl NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+dnl USE OR OTHER DEALINGS IN THE SOFTWARE.
dnl Ensure that Expat is configured with autoconf 2.69 or newer.
-AC_PREREQ(2.69)
+AC_PREREQ([2.69])
dnl Get the version number of Expat, using m4's esyscmd() command to run
dnl the command at m4-generation time. This allows us to create an m4
-dnl symbol holding the correct version number. AC_INIT() requires the
+dnl symbol holding the correct version number. AC_INIT requires the
dnl version number at m4-time, rather than when ./configure is run, so
dnl all this must happen as part of m4, not as part of the shell code
dnl contained in ./configure.
@@ -27,7 +62,7 @@ m4_define([expat_version],
m4_ifdef([__gnu__],
[esyscmd(conftools/get-version.sh lib/expat.h)],
[2.2.x]))
-AC_INIT(expat, expat_version, expat-bugs@libexpat.org)
+AC_INIT([expat], expat_version, [https://github.com/libexpat/libexpat/issues])
m4_undefine([expat_version])
AC_CONFIG_SRCDIR([Makefile.in])
@@ -35,6 +70,7 @@ AC_CONFIG_AUX_DIR([conftools])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE([enable]) # to allow argument --disable-maintainer-mode
dnl
@@ -48,12 +84,14 @@ dnl
dnl If the API changes incompatibly set LIBAGE back to 0
dnl
-LIBCURRENT=7 # sync
-LIBREVISION=12 # with
-LIBAGE=6 # CMakeLists.txt!
+LIBCURRENT=11 # sync
+LIBREVISION=2 # with
+LIBAGE=10 # CMakeLists.txt!
-AX_APPEND_FLAG([-DHAVE_EXPAT_CONFIG_H], [AM_CPPFLAGS])
-AC_CONFIG_HEADER([expat_config.h])
+AC_CONFIG_HEADERS([expat_config.h])
+AH_TOP([#ifndef EXPAT_CONFIG_H
+#define EXPAT_CONFIG_H 1])
+AH_BOTTOM([#endif // ndef EXPAT_CONFIG_H])
AM_PROG_AR
AC_PROG_INSTALL
@@ -70,6 +108,9 @@ AC_SUBST(LIBAGE)
AC_LANG([C])
AC_PROG_CC_C99
+AS_IF([test "${ac_cv_prog_cc_c99}" = no],
+ [AC_MSG_ERROR([Expat requires a C99 compiler.])])
+
AS_IF([test "$GCC" = yes],
[AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS])
dnl Be careful about adding the -fexceptions option; some versions of
@@ -79,7 +120,7 @@ AS_IF([test "$GCC" = yes],
AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [AM_CFLAGS])
AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [AM_CFLAGS])
AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [AM_CFLAGS])
- AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wmisleading-indentation], [AM_CFLAGS])])
+ AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation], [AM_CFLAGS])])
AC_LANG_PUSH([C++])
AC_PROG_CXX
@@ -102,11 +143,9 @@ AS_CASE(["$LD"],[*clang*],
[*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([
- AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS])
- AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])
-
-dnl Checks for header files.
-AC_HEADER_STDC
+ AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS])
+ AS_IF([test "${enable_shared}" = yes],
+ [AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])])
dnl Checks for typedefs, structures, and compiler characteristics.
@@ -123,7 +162,6 @@ AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1)
AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN])
AC_C_CONST
-AC_TYPE_SIZE_T
AC_ARG_WITH([xmlwf],
[AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])],
@@ -143,6 +181,8 @@ AC_ARG_WITH([tests],
[with_tests=yes])
AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes])
+AS_IF([test x${with_tests} = xyes],
+ [AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])])
AS_VAR_SET([EXPATCFG_ON_MINGW],[no])
AS_CASE("${host_os}",
@@ -151,8 +191,13 @@ AS_CASE("${host_os}",
AC_MSG_NOTICE([detected OS: MinGW])])
AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes])
+dnl Note: Prefix "_INTERNAL_" here means exclusive use inside of file configure.ac
AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null])
+AM_CONDITIONAL([_INTERNAL_UNICODE_WCHAR_T], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null])
+AM_CONDITIONAL([_INTERNAL_MIN_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null])
+AM_CONDITIONAL([_INTERNAL_LARGE_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null])
+LT_LIB_M
AC_ARG_WITH([libbsd],
[AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])],
@@ -164,14 +209,16 @@ AS_IF([test "x${with_libbsd}" != xno],
[],
[AS_IF([test "x${with_libbsd}" = xyes],
[AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])])
-AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)])
+AC_MSG_CHECKING([for arc4random_buf (BSD, libbsd or glibc 2.36+)])
AC_LINK_IFELSE([AC_LANG_SOURCE([
- #include <stdlib.h> /* for arc4random_buf on BSD, for NULL */
#if defined(HAVE_LIBBSD)
# include <bsd/stdlib.h>
+ #else
+ # include <stdlib.h> /* for arc4random_buf on BSD */
#endif
- int main() {
- arc4random_buf(NULL, 0U);
+ int main(void) {
+ char dummy[[123]]; // double brackets for m4
+ arc4random_buf(dummy, 0U);
return 0;
}
])],
@@ -179,14 +226,14 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
- AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)])
+ AC_MSG_CHECKING([for arc4random (BSD, macOS, libbsd or glibc 2.36+)])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#if defined(HAVE_LIBBSD)
# include <bsd/stdlib.h>
#else
# include <stdlib.h>
#endif
- int main() {
+ int main(void) {
arc4random();
return 0;
}
@@ -208,7 +255,7 @@ AS_IF([test "x$with_getrandom" != xno],
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <stdlib.h> /* for NULL */
#include <sys/random.h>
- int main() {
+ int main(void) {
return getrandom(NULL, 0U, 0U);
}
])],
@@ -229,10 +276,11 @@ AS_HELP_STRING([--without-sys-getrandom],
AS_IF([test "x$with_sys_getrandom" != xno],
[AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)])
AC_LINK_IFELSE([AC_LANG_SOURCE([
+ #define _GNU_SOURCE
#include <stdlib.h> /* for NULL */
#include <unistd.h> /* for syscall */
#include <sys/syscall.h> /* for SYS_getrandom */
- int main() {
+ int main(void) {
syscall(SYS_getrandom, NULL, 0, 0);
return 0;
}
@@ -257,6 +305,8 @@ AC_SUBST(FILEMAP)
dnl Some basic configuration:
AC_DEFINE([XML_NS], 1,
[Define to make XML Namespaces functionality available.])
+AC_DEFINE([XML_GE], 1,
+ [Define as 1/0 to enable/disable support for general entities.])
AC_DEFINE([XML_DTD], 1,
[Define to make parameter entity parsing functionality available.])
AC_DEFINE([XML_DEV_URANDOM], 1,
@@ -281,9 +331,10 @@ AS_HELP_STRING([--disable-xml-context],
AS_IF([test "x${enable_xml_context}" != "xno"],
[AS_IF([test "x${enable_xml_context}" = "xyes" \
-o "x${enable_xml_context}" = "x"],
- [AS_VAR_SET(enable_xml_context,1024)])
- AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}],
- [Define to specify how much context to retain around the current parse point.])])
+ [AS_VAR_SET(enable_xml_context,1024)])],
+ [AS_VAR_SET(enable_xml_context,0)])
+AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}],
+ [Define to specify how much context to retain around the current parse point, 0 to disable.])
AC_ARG_WITH([docbook],
[AS_HELP_STRING([--with-docbook],
@@ -307,7 +358,72 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno],
You can also configure using --without-docbook if you can do without a man
page for xmlwf.])])])
-AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])
+dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will
+dnl get it installed, when no working flavor of docbook2man is available (or wanted).
+dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml.
+AS_IF([test -f "${srcdir}"/doc/xmlwf.1],
+ [AM_CONDITIONAL(WITH_MANPAGE, [true])
+ AS_IF([test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x],
+ [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [true])
+ AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])],
+ [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false])
+ AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])])
+ ],
+ [AS_IF([test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x],
+ [AM_CONDITIONAL(WITH_MANPAGE, [true])
+ AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])],
+ [AM_CONDITIONAL(WITH_MANPAGE, [false])
+ AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])])
+ AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false])])
+
+dnl Configure CMake file templates
+dnl NOTE: The *_TRUE variables read here are Automake conditionals
+dnl that are either set to "" when enabled or to "#" when disabled
+dnl (because they are used to dynamically comment out certain things)
+AS_IF([test "x${enable_xml_attr_info}" = xyes],
+ [EXPAT_ATTR_INFO=ON],
+ [EXPAT_ATTR_INFO=OFF])
+EXPAT_DTD=ON
+AS_IF([test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x],
+ [EXPAT_LARGE_SIZE=ON],
+ [EXPAT_LARGE_SIZE=OFF])
+AS_IF([test "x${_INTERNAL_MIN_SIZE_TRUE}" = x],
+ [EXPAT_MIN_SIZE=ON],
+ [EXPAT_MIN_SIZE=OFF])
+EXPAT_NS=ON
+AS_IF([test "x${enable_xml_context}" != xno],
+ [EXPAT_CONTEXT_BYTES=${enable_xml_context}],
+ [EXPAT_CONTEXT_BYTES=OFF])
+AS_IF([test "x${UNICODE_TRUE}" = x],
+ [AS_IF(
+ [test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x],
+ [EXPAT_CHAR_TYPE=wchar_t],
+ [EXPAT_CHAR_TYPE=ushort])],
+ [EXPAT_CHAR_TYPE=char])
+PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake
+LIBDIR_BASENAME="$(basename "${libdir}")"
+SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")"
+SO_MINOR="${LIBAGE}"
+SO_PATCH="${LIBREVISION}"
+AC_SUBST([EXPAT_ATTR_INFO])
+AC_SUBST([EXPAT_DTD])
+AC_SUBST([EXPAT_LARGE_SIZE])
+AC_SUBST([EXPAT_MIN_SIZE])
+AC_SUBST([EXPAT_NS])
+AC_SUBST([EXPAT_CONTEXT_BYTES])
+AC_SUBST([EXPAT_CHAR_TYPE])
+AC_SUBST_FILE([PACKAGE_INIT])
+AC_SUBST([LIBDIR_BASENAME])
+AC_SUBST([SO_MAJOR])
+AC_SUBST([SO_MINOR])
+AC_SUBST([SO_PATCH])
+
+dnl The canonical way of doing this is AC_CHECK_SIZEOF(void *), but
+dnl that adds SIZEOF_VOID_P to expat_config.h.in, making it difficult
+dnl to have 32-bit and 64-bit versions of libexpat installed on the
+dnl same system with a single, shared copy of the header.
+AC_COMPUTE_INT(SIZEOF_VOID_P, [sizeof(void *)])
+AC_SUBST([SIZEOF_VOID_P])
dnl write the Automake flags we set
AC_SUBST([AM_CPPFLAGS])
@@ -315,11 +431,23 @@ AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
-dnl updating _EXPAT_OUTPUT_NAME variable to effect the package name in expat.pc file (issue #361)
-AC_SUBST(_EXPAT_OUTPUT_NAME, ["$PACKAGE_NAME"])
+dnl Emulate the use of CMAKE_SHARED_LIBRARY_PREFIX under CMake
+AC_MSG_CHECKING([for shared library name prefix])
+AS_CASE("${host_os}",
+ [cygwin*], [CMAKE_SHARED_LIBRARY_PREFIX=cyg],
+ [CMAKE_SHARED_LIBRARY_PREFIX=lib])
+AC_MSG_RESULT([${CMAKE_SHARED_LIBRARY_PREFIX}])
+AC_SUBST([CMAKE_SHARED_LIBRARY_PREFIX])
+AS_CASE("${host_os}",
+ [darwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in],
+ [mingw*|cygwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in],
+ [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in])
AC_CONFIG_FILES([Makefile]
[expat.pc]
+ [cmake/expat-config.cmake]
+ [cmake/autotools/expat-config-version.cmake]
+ [cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}]
[doc/Makefile]
[examples/Makefile]
[lib/Makefile]
diff --git a/3rdparty/expat/conftools/PrintPath b/3rdparty/expat/conftools/PrintPath
deleted file mode 100755
index e8559a3d643..00000000000
--- a/3rdparty/expat/conftools/PrintPath
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/bin/sh
-# Look for program[s] somewhere in $PATH.
-#
-# Options:
-# -s
-# Do not print out full pathname. (silent)
-# -pPATHNAME
-# Look in PATHNAME instead of $PATH
-#
-# Usage:
-# PrintPath [-s] [-pPATHNAME] program [program ...]
-#
-# Initially written by Jim Jagielski for the Apache configuration mechanism
-# (with kudos to Kernighan/Pike)
-#
-# This script falls under the Apache License.
-# See http://www.apache.org/licenses/LICENSE
-
-##
-# Some "constants"
-##
-pathname=$PATH
-echo="yes"
-
-##
-# Find out what OS we are running for later on
-##
-os=`(uname) 2>/dev/null`
-
-##
-# Parse command line
-##
-for args in $*
-do
- case $args in
- -s ) echo="no" ;;
- -p* ) pathname="`echo $args | sed 's/^..//'`" ;;
- * ) programs="$programs $args" ;;
- esac
-done
-
-##
-# Now we make the adjustments required for OS/2 and everyone
-# else :)
-#
-# First of all, all OS/2 programs have the '.exe' extension.
-# Next, we adjust PATH (or what was given to us as PATH) to
-# be whitespace separated directories.
-# Finally, we try to determine the best flag to use for
-# test/[] to look for an executable file. OS/2 just has '-r'
-# but with other OSs, we do some funny stuff to check to see
-# if test/[] knows about -x, which is the preferred flag.
-##
-
-if [ "x$os" = "xOS/2" ]
-then
- ext=".exe"
- pathname=`echo -E $pathname |
- sed 's/^;/.;/
- s/;;/;.;/g
- s/;$/;./
- s/;/ /g
- s/\\\\/\\//g' `
- test_exec_flag="-r"
-else
- ext="" # No default extensions
- pathname=`echo $pathname |
- sed 's/^:/.:/
- s/::/:.:/g
- s/:$/:./
- s/:/ /g' `
- # Here is how we test to see if test/[] can handle -x
- testfile="pp.t.$$"
-
- cat > $testfile <<ENDTEST
-#!/bin/sh
-if [ -x / ] || [ -x /bin ] || [ -x /bin/ls ]; then
- exit 0
-fi
-exit 1
-ENDTEST
-
- if `/bin/sh $testfile 2>/dev/null`; then
- test_exec_flag="-x"
- else
- test_exec_flag="-r"
- fi
- rm -f $testfile
-fi
-
-for program in $programs
-do
- for path in $pathname
- do
- if [ $test_exec_flag $path/${program}${ext} ] && \
- [ ! -d $path/${program}${ext} ]; then
- if [ "x$echo" = "xyes" ]; then
- echo $path/${program}${ext}
- fi
- exit 0
- fi
-
-# Next try without extension (if one was used above)
- if [ "x$ext" != "x" ]; then
- if [ $test_exec_flag $path/${program} ] && \
- [ ! -d $path/${program} ]; then
- if [ "x$echo" = "xyes" ]; then
- echo $path/${program}
- fi
- exit 0
- fi
- fi
- done
-done
-exit 1
-
diff --git a/3rdparty/expat/conftools/ar-lib b/3rdparty/expat/conftools/ar-lib
index 1e9388e2ae3..c349042c3fa 100755
--- a/3rdparty/expat/conftools/ar-lib
+++ b/3rdparty/expat/conftools/ar-lib
@@ -4,7 +4,7 @@
me=ar-lib
scriptversion=2019-07-04.01; # UTC
-# Copyright (C) 2010-2020 Free Software Foundation, Inc.
+# Copyright (C) 2010-2021 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# This program is free software; you can redistribute it and/or modify
diff --git a/3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4 b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4
new file mode 100644
index 00000000000..1733fd85f95
--- /dev/null
+++ b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4
@@ -0,0 +1,39 @@
+# =============================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
+# =============================================================================
+#
+# SYNOPSIS
+#
+# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional])
+#
+# DESCRIPTION
+#
+# Check for baseline language coverage in the compiler for the C++11
+# standard; if necessary, add switches to CXX and CXXCPP to enable
+# support.
+#
+# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
+# macro with the version set to C++11. The two optional arguments are
+# forwarded literally as the second and third argument respectively.
+# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
+# more information. If you want to use this macro, you also need to
+# download the ax_cxx_compile_stdcxx.m4 file.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
+# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
+# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
+# Copyright (c) 2015 Paul Norman <penorman@mac.com>
+# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 18
+
+AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
+AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])
diff --git a/3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4 b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4
new file mode 100644
index 00000000000..8edf5152ec7
--- /dev/null
+++ b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4
@@ -0,0 +1,1018 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
+#
+# DESCRIPTION
+#
+# Check for baseline language coverage in the compiler for the specified
+# version of the C++ standard. If necessary, add switches to CXX and
+# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for
+# the respective C++ standard version.
+#
+# The second argument, if specified, indicates whether you insist on an
+# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
+# -std=c++11). If neither is specified, you get whatever works, with
+# preference for no added switch, and then for an extended mode.
+#
+# The third argument, if specified 'mandatory' or if left unspecified,
+# indicates that baseline support for the specified C++ standard is
+# required and that the macro should error out if no mode with that
+# support is found. If specified 'optional', then configuration proceeds
+# regardless, after defining HAVE_CXX${VERSION} if and only if a
+# supporting mode is found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
+# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
+# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
+# Copyright (c) 2015 Paul Norman <penorman@mac.com>
+# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
+# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
+# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
+# Copyright (c) 2020 Jason Merrill <jason@redhat.com>
+# Copyright (c) 2021 Jörn Heusipp <osmanx@problemloesungsmaschine.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 18
+
+dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
+dnl (serial version number 13).
+
+AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
+ m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
+ [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
+ [$1], [17], [ax_cxx_compile_alternatives="17 1z"],
+ [$1], [20], [ax_cxx_compile_alternatives="20"],
+ [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
+ m4_if([$2], [], [],
+ [$2], [ext], [],
+ [$2], [noext], [],
+ [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
+ m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
+ [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
+ [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
+ [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
+ AC_LANG_PUSH([C++])dnl
+ ac_success=no
+
+ m4_if([$2], [], [dnl
+ AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
+ ax_cv_cxx_compile_cxx$1,
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
+ [ax_cv_cxx_compile_cxx$1=yes],
+ [ax_cv_cxx_compile_cxx$1=no])])
+ if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
+ ac_success=yes
+ fi])
+
+ m4_if([$2], [noext], [], [dnl
+ if test x$ac_success = xno; then
+ for alternative in ${ax_cxx_compile_alternatives}; do
+ switch="-std=gnu++${alternative}"
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
+ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
+ $cachevar,
+ [ac_save_CXX="$CXX"
+ CXX="$CXX $switch"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
+ [eval $cachevar=yes],
+ [eval $cachevar=no])
+ CXX="$ac_save_CXX"])
+ if eval test x\$$cachevar = xyes; then
+ CXX="$CXX $switch"
+ if test -n "$CXXCPP" ; then
+ CXXCPP="$CXXCPP $switch"
+ fi
+ ac_success=yes
+ break
+ fi
+ done
+ fi])
+
+ m4_if([$2], [ext], [], [dnl
+ if test x$ac_success = xno; then
+ dnl HP's aCC needs +std=c++11 according to:
+ dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
+ dnl Cray's crayCC needs "-h std=c++11"
+ dnl MSVC needs -std:c++NN for C++17 and later (default is C++14)
+ for alternative in ${ax_cxx_compile_alternatives}; do
+ for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do
+ if test x"$switch" = xMSVC; then
+ dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide
+ dnl with -std=c++17. We suffix the cache variable name with _MSVC to
+ dnl avoid this.
+ switch=-std:c++${alternative}
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC])
+ else
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
+ fi
+ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
+ $cachevar,
+ [ac_save_CXX="$CXX"
+ CXX="$CXX $switch"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
+ [eval $cachevar=yes],
+ [eval $cachevar=no])
+ CXX="$ac_save_CXX"])
+ if eval test x\$$cachevar = xyes; then
+ CXX="$CXX $switch"
+ if test -n "$CXXCPP" ; then
+ CXXCPP="$CXXCPP $switch"
+ fi
+ ac_success=yes
+ break
+ fi
+ done
+ if test x$ac_success = xyes; then
+ break
+ fi
+ done
+ fi])
+ AC_LANG_POP([C++])
+ if test x$ax_cxx_compile_cxx$1_required = xtrue; then
+ if test x$ac_success = xno; then
+ AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
+ fi
+ fi
+ if test x$ac_success = xno; then
+ HAVE_CXX$1=0
+ AC_MSG_NOTICE([No compiler with C++$1 support was found])
+ else
+ HAVE_CXX$1=1
+ AC_DEFINE(HAVE_CXX$1,1,
+ [define if the compiler supports basic C++$1 syntax])
+ fi
+ AC_SUBST(HAVE_CXX$1)
+])
+
+
+dnl Test body for checking C++11 support
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
+)
+
+dnl Test body for checking C++14 support
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
+)
+
+dnl Test body for checking C++17 support
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
+)
+
+dnl Test body for checking C++20 support
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20],
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_20
+)
+
+
+dnl Tests for new features in C++11
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
+
+// If the compiler admits that it is not ready for C++11, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+// MSVC always sets __cplusplus to 199711L in older versions; newer versions
+// only set it correctly if /Zc:__cplusplus is specified as well as a
+// /std:c++NN switch:
+// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
+#elif __cplusplus < 201103L && !defined _MSC_VER
+
+#error "This is not a C++11 compiler"
+
+#else
+
+namespace cxx11
+{
+
+ namespace test_static_assert
+ {
+
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ }
+
+ namespace test_final_override
+ {
+
+ struct Base
+ {
+ virtual ~Base() {}
+ virtual void f() {}
+ };
+
+ struct Derived : public Base
+ {
+ virtual ~Derived() override {}
+ virtual void f() override {}
+ };
+
+ }
+
+ namespace test_double_right_angle_brackets
+ {
+
+ template < typename T >
+ struct check {};
+
+ typedef check<void> single_type;
+ typedef check<check<void>> double_type;
+ typedef check<check<check<void>>> triple_type;
+ typedef check<check<check<check<void>>>> quadruple_type;
+
+ }
+
+ namespace test_decltype
+ {
+
+ int
+ f()
+ {
+ int a = 1;
+ decltype(a) b = 2;
+ return a + b;
+ }
+
+ }
+
+ namespace test_type_deduction
+ {
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static const bool value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static const bool value = true;
+ };
+
+ template < typename T1, typename T2 >
+ auto
+ add(T1 a1, T2 a2) -> decltype(a1 + a2)
+ {
+ return a1 + a2;
+ }
+
+ int
+ test(const int c, volatile int v)
+ {
+ static_assert(is_same<int, decltype(0)>::value == true, "");
+ static_assert(is_same<int, decltype(c)>::value == false, "");
+ static_assert(is_same<int, decltype(v)>::value == false, "");
+ auto ac = c;
+ auto av = v;
+ auto sumi = ac + av + 'x';
+ auto sumf = ac + av + 1.0;
+ static_assert(is_same<int, decltype(ac)>::value == true, "");
+ static_assert(is_same<int, decltype(av)>::value == true, "");
+ static_assert(is_same<int, decltype(sumi)>::value == true, "");
+ static_assert(is_same<int, decltype(sumf)>::value == false, "");
+ static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
+ return (sumf > 0.0) ? sumi : add(c, v);
+ }
+
+ }
+
+ namespace test_noexcept
+ {
+
+ int f() { return 0; }
+ int g() noexcept { return 0; }
+
+ static_assert(noexcept(f()) == false, "");
+ static_assert(noexcept(g()) == true, "");
+
+ }
+
+ namespace test_constexpr
+ {
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
+ {
+ return *s ? strlen_c_r(s + 1, acc + 1) : acc;
+ }
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c(const CharT *const s) noexcept
+ {
+ return strlen_c_r(s, 0UL);
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("1") == 1UL, "");
+ static_assert(strlen_c("example") == 7UL, "");
+ static_assert(strlen_c("another\0example") == 7UL, "");
+
+ }
+
+ namespace test_rvalue_references
+ {
+
+ template < int N >
+ struct answer
+ {
+ static constexpr int value = N;
+ };
+
+ answer<1> f(int&) { return answer<1>(); }
+ answer<2> f(const int&) { return answer<2>(); }
+ answer<3> f(int&&) { return answer<3>(); }
+
+ void
+ test()
+ {
+ int i = 0;
+ const int c = 0;
+ static_assert(decltype(f(i))::value == 1, "");
+ static_assert(decltype(f(c))::value == 2, "");
+ static_assert(decltype(f(0))::value == 3, "");
+ }
+
+ }
+
+ namespace test_uniform_initialization
+ {
+
+ struct test
+ {
+ static const int zero {};
+ static const int one {1};
+ };
+
+ static_assert(test::zero == 0, "");
+ static_assert(test::one == 1, "");
+
+ }
+
+ namespace test_lambdas
+ {
+
+ void
+ test1()
+ {
+ auto lambda1 = [](){};
+ auto lambda2 = lambda1;
+ lambda1();
+ lambda2();
+ }
+
+ int
+ test2()
+ {
+ auto a = [](int i, int j){ return i + j; }(1, 2);
+ auto b = []() -> int { return '0'; }();
+ auto c = [=](){ return a + b; }();
+ auto d = [&](){ return c; }();
+ auto e = [a, &b](int x) mutable {
+ const auto identity = [](int y){ return y; };
+ for (auto i = 0; i < a; ++i)
+ a += b--;
+ return x + identity(a + b);
+ }(0);
+ return a + b + c + d + e;
+ }
+
+ int
+ test3()
+ {
+ const auto nullary = [](){ return 0; };
+ const auto unary = [](int x){ return x; };
+ using nullary_t = decltype(nullary);
+ using unary_t = decltype(unary);
+ const auto higher1st = [](nullary_t f){ return f(); };
+ const auto higher2nd = [unary](nullary_t f1){
+ return [unary, f1](unary_t f2){ return f2(unary(f1())); };
+ };
+ return higher1st(nullary) + higher2nd(nullary)(unary);
+ }
+
+ }
+
+ namespace test_variadic_templates
+ {
+
+ template <int...>
+ struct sum;
+
+ template <int N0, int... N1toN>
+ struct sum<N0, N1toN...>
+ {
+ static constexpr auto value = N0 + sum<N1toN...>::value;
+ };
+
+ template <>
+ struct sum<>
+ {
+ static constexpr auto value = 0;
+ };
+
+ static_assert(sum<>::value == 0, "");
+ static_assert(sum<1>::value == 1, "");
+ static_assert(sum<23>::value == 23, "");
+ static_assert(sum<1, 2>::value == 3, "");
+ static_assert(sum<5, 5, 11>::value == 21, "");
+ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
+
+ }
+
+ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
+ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
+ // because of this.
+ namespace test_template_alias_sfinae
+ {
+
+ struct foo {};
+
+ template<typename T>
+ using member = typename T::member_type;
+
+ template<typename T>
+ void func(...) {}
+
+ template<typename T>
+ void func(member<T>*) {}
+
+ void test();
+
+ void test() { func<foo>(0); }
+
+ }
+
+} // namespace cxx11
+
+#endif // __cplusplus >= 201103L
+
+]])
+
+
+dnl Tests for new features in C++14
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
+
+// If the compiler admits that it is not ready for C++14, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201402L && !defined _MSC_VER
+
+#error "This is not a C++14 compiler"
+
+#else
+
+namespace cxx14
+{
+
+ namespace test_polymorphic_lambdas
+ {
+
+ int
+ test()
+ {
+ const auto lambda = [](auto&&... args){
+ const auto istiny = [](auto x){
+ return (sizeof(x) == 1UL) ? 1 : 0;
+ };
+ const int aretiny[] = { istiny(args)... };
+ return aretiny[0];
+ };
+ return lambda(1, 1L, 1.0f, '1');
+ }
+
+ }
+
+ namespace test_binary_literals
+ {
+
+ constexpr auto ivii = 0b0000000000101010;
+ static_assert(ivii == 42, "wrong value");
+
+ }
+
+ namespace test_generalized_constexpr
+ {
+
+ template < typename CharT >
+ constexpr unsigned long
+ strlen_c(const CharT *const s) noexcept
+ {
+ auto length = 0UL;
+ for (auto p = s; *p; ++p)
+ ++length;
+ return length;
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("x") == 1UL, "");
+ static_assert(strlen_c("test") == 4UL, "");
+ static_assert(strlen_c("another\0test") == 7UL, "");
+
+ }
+
+ namespace test_lambda_init_capture
+ {
+
+ int
+ test()
+ {
+ auto x = 0;
+ const auto lambda1 = [a = x](int b){ return a + b; };
+ const auto lambda2 = [a = lambda1(x)](){ return a; };
+ return lambda2();
+ }
+
+ }
+
+ namespace test_digit_separators
+ {
+
+ constexpr auto ten_million = 100'000'000;
+ static_assert(ten_million == 100000000, "");
+
+ }
+
+ namespace test_return_type_deduction
+ {
+
+ auto f(int& x) { return x; }
+ decltype(auto) g(int& x) { return x; }
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static constexpr auto value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static constexpr auto value = true;
+ };
+
+ int
+ test()
+ {
+ auto x = 0;
+ static_assert(is_same<int, decltype(f(x))>::value, "");
+ static_assert(is_same<int&, decltype(g(x))>::value, "");
+ return x;
+ }
+
+ }
+
+} // namespace cxx14
+
+#endif // __cplusplus >= 201402L
+
+]])
+
+
+dnl Tests for new features in C++17
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
+
+// If the compiler admits that it is not ready for C++17, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201703L && !defined _MSC_VER
+
+#error "This is not a C++17 compiler"
+
+#else
+
+#include <initializer_list>
+#include <utility>
+#include <type_traits>
+
+namespace cxx17
+{
+
+ namespace test_constexpr_lambdas
+ {
+
+ constexpr int foo = [](){return 42;}();
+
+ }
+
+ namespace test::nested_namespace::definitions
+ {
+
+ }
+
+ namespace test_fold_expression
+ {
+
+ template<typename... Args>
+ int multiply(Args... args)
+ {
+ return (args * ... * 1);
+ }
+
+ template<typename... Args>
+ bool all(Args... args)
+ {
+ return (args && ...);
+ }
+
+ }
+
+ namespace test_extended_static_assert
+ {
+
+ static_assert (true);
+
+ }
+
+ namespace test_auto_brace_init_list
+ {
+
+ auto foo = {5};
+ auto bar {5};
+
+ static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
+ static_assert(std::is_same<int, decltype(bar)>::value);
+ }
+
+ namespace test_typename_in_template_template_parameter
+ {
+
+ template<template<typename> typename X> struct D;
+
+ }
+
+ namespace test_fallthrough_nodiscard_maybe_unused_attributes
+ {
+
+ int f1()
+ {
+ return 42;
+ }
+
+ [[nodiscard]] int f2()
+ {
+ [[maybe_unused]] auto unused = f1();
+
+ switch (f1())
+ {
+ case 17:
+ f1();
+ [[fallthrough]];
+ case 42:
+ f1();
+ }
+ return f1();
+ }
+
+ }
+
+ namespace test_extended_aggregate_initialization
+ {
+
+ struct base1
+ {
+ int b1, b2 = 42;
+ };
+
+ struct base2
+ {
+ base2() {
+ b3 = 42;
+ }
+ int b3;
+ };
+
+ struct derived : base1, base2
+ {
+ int d;
+ };
+
+ derived d1 {{1, 2}, {}, 4}; // full initialization
+ derived d2 {{}, {}, 4}; // value-initialized bases
+
+ }
+
+ namespace test_general_range_based_for_loop
+ {
+
+ struct iter
+ {
+ int i;
+
+ int& operator* ()
+ {
+ return i;
+ }
+
+ const int& operator* () const
+ {
+ return i;
+ }
+
+ iter& operator++()
+ {
+ ++i;
+ return *this;
+ }
+ };
+
+ struct sentinel
+ {
+ int i;
+ };
+
+ bool operator== (const iter& i, const sentinel& s)
+ {
+ return i.i == s.i;
+ }
+
+ bool operator!= (const iter& i, const sentinel& s)
+ {
+ return !(i == s);
+ }
+
+ struct range
+ {
+ iter begin() const
+ {
+ return {0};
+ }
+
+ sentinel end() const
+ {
+ return {5};
+ }
+ };
+
+ void f()
+ {
+ range r {};
+
+ for (auto i : r)
+ {
+ [[maybe_unused]] auto v = i;
+ }
+ }
+
+ }
+
+ namespace test_lambda_capture_asterisk_this_by_value
+ {
+
+ struct t
+ {
+ int i;
+ int foo()
+ {
+ return [*this]()
+ {
+ return i;
+ }();
+ }
+ };
+
+ }
+
+ namespace test_enum_class_construction
+ {
+
+ enum class byte : unsigned char
+ {};
+
+ byte foo {42};
+
+ }
+
+ namespace test_constexpr_if
+ {
+
+ template <bool cond>
+ int f ()
+ {
+ if constexpr(cond)
+ {
+ return 13;
+ }
+ else
+ {
+ return 42;
+ }
+ }
+
+ }
+
+ namespace test_selection_statement_with_initializer
+ {
+
+ int f()
+ {
+ return 13;
+ }
+
+ int f2()
+ {
+ if (auto i = f(); i > 0)
+ {
+ return 3;
+ }
+
+ switch (auto i = f(); i + 4)
+ {
+ case 17:
+ return 2;
+
+ default:
+ return 1;
+ }
+ }
+
+ }
+
+ namespace test_template_argument_deduction_for_class_templates
+ {
+
+ template <typename T1, typename T2>
+ struct pair
+ {
+ pair (T1 p1, T2 p2)
+ : m1 {p1},
+ m2 {p2}
+ {}
+
+ T1 m1;
+ T2 m2;
+ };
+
+ void f()
+ {
+ [[maybe_unused]] auto p = pair{13, 42u};
+ }
+
+ }
+
+ namespace test_non_type_auto_template_parameters
+ {
+
+ template <auto n>
+ struct B
+ {};
+
+ B<5> b1;
+ B<'a'> b2;
+
+ }
+
+ namespace test_structured_bindings
+ {
+
+ int arr[2] = { 1, 2 };
+ std::pair<int, int> pr = { 1, 2 };
+
+ auto f1() -> int(&)[2]
+ {
+ return arr;
+ }
+
+ auto f2() -> std::pair<int, int>&
+ {
+ return pr;
+ }
+
+ struct S
+ {
+ int x1 : 2;
+ volatile double y1;
+ };
+
+ S f3()
+ {
+ return {};
+ }
+
+ auto [ x1, y1 ] = f1();
+ auto& [ xr1, yr1 ] = f1();
+ auto [ x2, y2 ] = f2();
+ auto& [ xr2, yr2 ] = f2();
+ const auto [ x3, y3 ] = f3();
+
+ }
+
+ namespace test_exception_spec_type_system
+ {
+
+ struct Good {};
+ struct Bad {};
+
+ void g1() noexcept;
+ void g2();
+
+ template<typename T>
+ Bad
+ f(T*, T*);
+
+ template<typename T1, typename T2>
+ Good
+ f(T1*, T2*);
+
+ static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
+
+ }
+
+ namespace test_inline_variables
+ {
+
+ template<class T> void f(T)
+ {}
+
+ template<class T> inline T g(T)
+ {
+ return T{};
+ }
+
+ template<> inline void f<>(int)
+ {}
+
+ template<> int g<>(int)
+ {
+ return 5;
+ }
+
+ }
+
+} // namespace cxx17
+
+#endif // __cplusplus < 201703L && !defined _MSC_VER
+
+]])
+
+
+dnl Tests for new features in C++20
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 202002L && !defined _MSC_VER
+
+#error "This is not a C++20 compiler"
+
+#else
+
+#include <version>
+
+namespace cxx20
+{
+
+// As C++20 supports feature test macros in the standard, there is no
+// immediate need to actually test for feature availability on the
+// Autoconf side.
+
+} // namespace cxx20
+
+#endif // __cplusplus < 202002L && !defined _MSC_VER
+
+]])
diff --git a/3rdparty/expat/conftools/compile b/3rdparty/expat/conftools/compile
index 23fcba01132..df363c8fbfb 100755
--- a/3rdparty/expat/conftools/compile
+++ b/3rdparty/expat/conftools/compile
@@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
diff --git a/3rdparty/expat/conftools/config.guess b/3rdparty/expat/conftools/config.guess
index df895493ef7..160ecf0951b 100755
--- a/3rdparty/expat/conftools/config.guess
+++ b/3rdparty/expat/conftools/config.guess
@@ -1,12 +1,14 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2019 Free Software Foundation, Inc.
+# Copyright 1992-2022 Free Software Foundation, Inc.
-timestamp='2019-09-10'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2022-05-08'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -27,11 +29,19 @@ timestamp='2019-09-10'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
#
# Please send patches to <config-patches@gnu.org>.
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
+
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
@@ -50,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2019 Free Software Foundation, Inc.
+Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,6 +94,9 @@ if test $# != 0; then
exit 1
fi
+# Just in case it came from the environment.
+GUESS=
+
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
@@ -99,8 +112,10 @@ tmp=
trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
set_cc_for_build() {
+ # prevent multiple calls if $tmp is already set
+ test "$tmp" && return 0
: "${TMPDIR=/tmp}"
- # shellcheck disable=SC2039
+ # shellcheck disable=SC2039,SC3028
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
@@ -110,7 +125,7 @@ set_cc_for_build() {
,,) echo "int x;" > "$dummy.c"
for driver in cc gcc c89 c99 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$driver"
+ CC_FOR_BUILD=$driver
break
fi
done
@@ -131,14 +146,12 @@ fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "$UNAME_SYSTEM" in
+case $UNAME_SYSTEM in
Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
+ LIBC=unknown
set_cc_for_build
cat <<-EOF > "$dummy.c"
@@ -147,24 +160,37 @@ Linux|GNU|GNU/*)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
- #else
+ #elif defined(__GLIBC__)
LIBC=gnu
+ #else
+ #include <stdarg.h>
+ /* First heuristic to detect musl libc. */
+ #ifdef __DEFINED_va_list
+ LIBC=musl
+ #endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+ cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "$cc_set_libc"
- # If ldd exists, use it to detect musl libc.
- if command -v ldd >/dev/null && \
- ldd --version 2>&1 | grep -q ^musl
- then
- LIBC=musl
+ # Second heuristic to detect musl libc.
+ if [ "$LIBC" = unknown ] &&
+ command -v ldd >/dev/null &&
+ ldd --version 2>&1 | grep -q ^musl; then
+ LIBC=musl
+ fi
+
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ if [ "$LIBC" = unknown ]; then
+ LIBC=gnu
fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
-case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
+case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -176,12 +202,12 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
- "/sbin/$sysctl" 2>/dev/null || \
- "/usr/sbin/$sysctl" 2>/dev/null || \
+ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
echo unknown)`
- case "$UNAME_MACHINE_ARCH" in
+ case $UNAME_MACHINE_ARCH in
+ aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
@@ -190,13 +216,13 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
earmv*)
arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
- machine="${arch}${endian}"-unknown
+ machine=${arch}${endian}-unknown
;;
- *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
+ *) machine=$UNAME_MACHINE_ARCH-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently (or will in the future) and ABI.
- case "$UNAME_MACHINE_ARCH" in
+ case $UNAME_MACHINE_ARCH in
earm*)
os=netbsdelf
;;
@@ -217,7 +243,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
;;
esac
# Determine ABI tags.
- case "$UNAME_MACHINE_ARCH" in
+ case $UNAME_MACHINE_ARCH in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
@@ -228,7 +254,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "$UNAME_VERSION" in
+ case $UNAME_VERSION in
Debian*)
release='-gnu'
;;
@@ -239,51 +265,57 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "$machine-${os}${release}${abi-}"
- exit ;;
+ GUESS=$machine-${os}${release}${abi-}
+ ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
+ ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
+ ;;
+ *:SecBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
+ ;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
- echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
+ ;;
*:MidnightBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
+ ;;
*:ekkoBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
+ ;;
*:SolidBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
+ ;;
*:OS108:*:*)
- echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
+ ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
+ ;;
*:MirBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
+ ;;
*:Sortix:*:*)
- echo "$UNAME_MACHINE"-unknown-sortix
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-sortix
+ ;;
*:Twizzler:*:*)
- echo "$UNAME_MACHINE"-unknown-twizzler
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-twizzler
+ ;;
*:Redox:*:*)
- echo "$UNAME_MACHINE"-unknown-redox
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-redox
+ ;;
mips:OSF1:*.*)
- echo mips-dec-osf1
- exit ;;
+ GUESS=mips-dec-osf1
+ ;;
alpha:OSF1:*:*)
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ trap '' 0
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -297,7 +329,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
+ case $ALPHA_CPU_TYPE in
"EV4 (21064)")
UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
@@ -334,117 +366,121 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
+ OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
+ ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
+ GUESS=m68k-unknown-sysv4
+ ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo "$UNAME_MACHINE"-unknown-amigaos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-amigaos
+ ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo "$UNAME_MACHINE"-unknown-morphos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-morphos
+ ;;
*:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
+ GUESS=i370-ibm-openedition
+ ;;
*:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
+ GUESS=s390-ibm-zvmoe
+ ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
+ GUESS=powerpc-ibm-os400
+ ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix"$UNAME_RELEASE"
- exit ;;
+ GUESS=arm-acorn-riscix$UNAME_RELEASE
+ ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
+ GUESS=arm-unknown-riscos
+ ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
+ GUESS=hppa1.1-hitachi-hiuxmpp
+ ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
+ case `(/bin/universe) 2>/dev/null` in
+ att) GUESS=pyramid-pyramid-sysv3 ;;
+ *) GUESS=pyramid-pyramid-bsd ;;
+ esac
+ ;;
NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
+ GUESS=pyramid-pyramid-svr4
+ ;;
DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
+ GUESS=sparc-icl-nx6
+ ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
+ sparc) GUESS=sparc-icl-nx7 ;;
+ esac
+ ;;
s390x:SunOS:*:*)
- echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
+ ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-hal-solaris2$SUN_REL
+ ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris2$SUN_REL
+ ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux"$UNAME_RELEASE"
- exit ;;
+ GUESS=i386-pc-auroraux$UNAME_RELEASE
+ ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
set_cc_for_build
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH=x86_64
fi
fi
- echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
+ ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris3$SUN_REL
+ ;;
sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
+ case `/usr/bin/arch -k` in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
+ GUESS=sparc-sun-sunos$SUN_REL
+ ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
+ ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
- case "`/bin/arch`" in
+ case `/bin/arch` in
sun3)
- echo m68k-sun-sunos"$UNAME_RELEASE"
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun4)
- echo sparc-sun-sunos"$UNAME_RELEASE"
+ GUESS=sparc-sun-sunos$UNAME_RELEASE
;;
esac
- exit ;;
+ ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos"$UNAME_RELEASE"
- exit ;;
+ GUESS=sparc-auspex-sunos$UNAME_RELEASE
+ ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -454,41 +490,41 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-milan-mint$UNAME_RELEASE
+ ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-hades-mint$UNAME_RELEASE
+ ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-unknown-mint$UNAME_RELEASE
+ ;;
m68k:machten:*:*)
- echo m68k-apple-machten"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-apple-machten$UNAME_RELEASE
+ ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten"$UNAME_RELEASE"
- exit ;;
+ GUESS=powerpc-apple-machten$UNAME_RELEASE
+ ;;
RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
+ GUESS=mips-dec-mach_bsd4.3
+ ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix"$UNAME_RELEASE"
- exit ;;
+ GUESS=mips-dec-ultrix$UNAME_RELEASE
+ ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix"$UNAME_RELEASE"
- exit ;;
+ GUESS=vax-dec-ultrix$UNAME_RELEASE
+ ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix"$UNAME_RELEASE"
- exit ;;
+ GUESS=clipper-intergraph-clix$UNAME_RELEASE
+ ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
@@ -516,75 +552,76 @@ EOF
dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos"$UNAME_RELEASE"
- exit ;;
+ GUESS=mips-mips-riscos$UNAME_RELEASE
+ ;;
Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
+ GUESS=powerpc-motorola-powermax
+ ;;
Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
+ GUESS=powerpc-harris-powerunix
+ ;;
m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
+ GUESS=m88k-harris-cxux7
+ ;;
m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
+ GUESS=m88k-motorola-sysv4
+ ;;
m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
+ if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
- if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
- [ "$TARGET_BINARY_INTERFACE"x = x ]
+ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
+ test "$TARGET_BINARY_INTERFACE"x = x
then
- echo m88k-dg-dgux"$UNAME_RELEASE"
+ GUESS=m88k-dg-dgux$UNAME_RELEASE
else
- echo m88k-dg-dguxbcs"$UNAME_RELEASE"
+ GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
fi
else
- echo i586-dg-dgux"$UNAME_RELEASE"
+ GUESS=i586-dg-dgux$UNAME_RELEASE
fi
- exit ;;
+ ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
+ GUESS=m88k-dolphin-sysv3
+ ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
+ GUESS=m88k-tektronix-sysv3
+ ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
+ GUESS=m68k-tektronix-bsd
+ ;;
*:IRIX*:*:*)
- echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
- exit ;;
+ IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
+ GUESS=mips-sgi-irix$IRIX_REL
+ ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
+ GUESS=i386-ibm-aix
+ ;;
ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
+ if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
- echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
+ ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
set_cc_for_build
@@ -601,16 +638,16 @@ EOF
EOF
if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
- echo "$SYSTEM_NAME"
+ GUESS=$SYSTEM_NAME
else
- echo rs6000-ibm-aix3.2.5
+ GUESS=rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
+ GUESS=rs6000-ibm-aix3.2.4
else
- echo rs6000-ibm-aix3.2
+ GUESS=rs6000-ibm-aix3.2
fi
- exit ;;
+ ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
@@ -618,56 +655,56 @@ EOF
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/lslpp ] ; then
- IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ if test -x /usr/bin/lslpp ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
- IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
- echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
- exit ;;
+ GUESS=$IBM_ARCH-ibm-aix$IBM_REV
+ ;;
*:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
+ GUESS=rs6000-ibm-aix
+ ;;
ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
+ GUESS=romp-ibm-bsd4.4
+ ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
+ GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
+ ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
+ GUESS=rs6000-bull-bosx
+ ;;
DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
+ GUESS=m68k-bull-sysv3
+ ;;
9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
+ GUESS=m68k-hp-bsd
+ ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
+ GUESS=m68k-hp-bsd4.4
+ ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
- case "$UNAME_MACHINE" in
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+ case $UNAME_MACHINE in
9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
+ if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "$sc_cpu_version" in
+ case $sc_cpu_version in
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
- case "$sc_kernel_bits" in
+ case $sc_kernel_bits in
32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
- if [ "$HP_ARCH" = "" ]; then
+ if test "$HP_ARCH" = ""; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
@@ -706,7 +743,7 @@ EOF
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ "$HP_ARCH" = hppa2.0w ]
+ if test "$HP_ARCH" = hppa2.0w
then
set_cc_for_build
@@ -727,12 +764,12 @@ EOF
HP_ARCH=hppa64
fi
fi
- echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
- exit ;;
+ GUESS=$HP_ARCH-hp-hpux$HPUX_REV
+ ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux"$HPUX_REV"
- exit ;;
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+ GUESS=ia64-hp-hpux$HPUX_REV
+ ;;
3050*:HI-UX:*:*)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
@@ -762,36 +799,36 @@ EOF
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
+ GUESS=unknown-hitachi-hiuxwe2
+ ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
- echo hppa1.1-hp-bsd
- exit ;;
+ GUESS=hppa1.1-hp-bsd
+ ;;
9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
+ GUESS=hppa1.0-hp-bsd
+ ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
+ GUESS=hppa1.0-hp-mpeix
+ ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
- echo hppa1.1-hp-osf
- exit ;;
+ GUESS=hppa1.1-hp-osf
+ ;;
hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-osf
+ ;;
i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo "$UNAME_MACHINE"-unknown-osf1mk
+ if test -x /usr/sbin/sysversion ; then
+ GUESS=$UNAME_MACHINE-unknown-osf1mk
else
- echo "$UNAME_MACHINE"-unknown-osf1
+ GUESS=$UNAME_MACHINE-unknown-osf1
fi
- exit ;;
+ ;;
parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
+ GUESS=hppa1.1-hp-lites
+ ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
+ GUESS=c1-convex-bsd
+ ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
@@ -799,17 +836,18 @@ EOF
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
+ GUESS=c34-convex-bsd
+ ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
+ GUESS=c38-convex-bsd
+ ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
+ GUESS=c4-convex-bsd
+ ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=ymp-cray-unicos$CRAY_REL
+ ;;
CRAY*[A-Z]90:*:*:*)
echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
@@ -817,114 +855,129 @@ EOF
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=t90-cray-unicos$CRAY_REL
+ ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=alphaev5-cray-unicosmk$CRAY_REL
+ ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=sv1-cray-unicos$CRAY_REL
+ ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=craynv-cray-unicosmp$CRAY_REL
+ ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
+ ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi"$UNAME_RELEASE"
- exit ;;
+ GUESS=sparc-unknown-bsdi$UNAME_RELEASE
+ ;;
*:BSD/OS:*:*)
- echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
+ ;;
arm:FreeBSD:*:*)
UNAME_PROCESSOR=`uname -p`
set_cc_for_build
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
else
- echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
fi
- exit ;;
+ ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
- case "$UNAME_PROCESSOR" in
+ case $UNAME_PROCESSOR in
amd64)
UNAME_PROCESSOR=x86_64 ;;
i386)
UNAME_PROCESSOR=i586 ;;
esac
- echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
- exit ;;
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
+ ;;
i*:CYGWIN*:*)
- echo "$UNAME_MACHINE"-pc-cygwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-cygwin
+ ;;
*:MINGW64*:*)
- echo "$UNAME_MACHINE"-pc-mingw64
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw64
+ ;;
*:MINGW*:*)
- echo "$UNAME_MACHINE"-pc-mingw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw32
+ ;;
*:MSYS*:*)
- echo "$UNAME_MACHINE"-pc-msys
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-msys
+ ;;
i*:PW*:*)
- echo "$UNAME_MACHINE"-pc-pw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-pw32
+ ;;
+ *:SerenityOS:*:*)
+ GUESS=$UNAME_MACHINE-pc-serenity
+ ;;
*:Interix*:*)
- case "$UNAME_MACHINE" in
+ case $UNAME_MACHINE in
x86)
- echo i586-pc-interix"$UNAME_RELEASE"
- exit ;;
+ GUESS=i586-pc-interix$UNAME_RELEASE
+ ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix"$UNAME_RELEASE"
- exit ;;
+ GUESS=x86_64-unknown-interix$UNAME_RELEASE
+ ;;
IA64)
- echo ia64-unknown-interix"$UNAME_RELEASE"
- exit ;;
+ GUESS=ia64-unknown-interix$UNAME_RELEASE
+ ;;
esac ;;
i*:UWIN*:*)
- echo "$UNAME_MACHINE"-pc-uwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-uwin
+ ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-pc-cygwin
- exit ;;
+ GUESS=x86_64-pc-cygwin
+ ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=powerpcle-unknown-solaris2$SUN_REL
+ ;;
*:GNU:*:*)
# the GNU system
- echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
- exit ;;
+ GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
+ GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
+ ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
- exit ;;
+ GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
+ ;;
*:Minix:*:*)
- echo "$UNAME_MACHINE"-unknown-minix
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-minix
+ ;;
aarch64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -935,60 +988,63 @@ EOF
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
arm*:Linux:*:*)
set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
else
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
fi
fi
- exit ;;
+ ;;
avr32*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
cris:Linux:*:*)
- echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
crisv32:Linux:*:*)
- echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
e2k:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
frv:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
hexagon:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:Linux:*:*)
- echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBC
+ ;;
ia64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
k1om:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m32r*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m68*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
mips:Linux:*:* | mips64:Linux:*:*)
set_cc_for_build
IS_GLIBC=0
@@ -1033,124 +1089,135 @@ EOF
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
+ cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
+ eval "$cc_set_vars"
test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
mips64el:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
openrisc*:Linux:*:*)
- echo or1k-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=or1k-unknown-linux-$LIBC
+ ;;
or32:Linux:*:* | or1k*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=sparc-unknown-linux-$LIBC
+ ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=hppa64-unknown-linux-$LIBC
+ ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
- PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
- *) echo hppa-unknown-linux-"$LIBC" ;;
+ PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
+ PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
+ *) GUESS=hppa-unknown-linux-$LIBC ;;
esac
- exit ;;
+ ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=powerpc64-unknown-linux-$LIBC
+ ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=powerpc-unknown-linux-$LIBC
+ ;;
ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=powerpc64le-unknown-linux-$LIBC
+ ;;
ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-"$LIBC"
- exit ;;
- riscv32:Linux:*:* | riscv64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=powerpcle-unknown-linux-$LIBC
+ ;;
+ riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
+ ;;
sh64*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sh*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
tile*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
vax:Linux:*:*)
- echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-dec-linux-$LIBC
+ ;;
x86_64:Linux:*:*)
set_cc_for_build
- X86_64_ABI=
- # If there is a compiler, see if it is configured for 32-bit objects.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_X32 >/dev/null
- then
- X86_64_ABI=x32
- fi
+ CPU=$UNAME_MACHINE
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ ABI=64
+ sed 's/^ //' << EOF > "$dummy.c"
+ #ifdef __i386__
+ ABI=x86
+ #else
+ #ifdef __ILP32__
+ ABI=x32
+ #endif
+ #endif
+EOF
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
+ eval "$cc_set_abi"
+ case $ABI in
+ x86) CPU=i686 ;;
+ x32) LIBCABI=${LIBC}x32 ;;
+ esac
fi
- echo "$UNAME_MACHINE"-pc-linux-"$LIBC$X86_64_ABI"
- exit ;;
+ GUESS=$CPU-pc-linux-$LIBCABI
+ ;;
xtensa*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
+ GUESS=i386-sequent-sysv4
+ ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
- echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
+ ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo "$UNAME_MACHINE"-pc-os2-emx
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-os2-emx
+ ;;
i*86:XTS-300:*:STOP)
- echo "$UNAME_MACHINE"-unknown-stop
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-stop
+ ;;
i*86:atheos:*:*)
- echo "$UNAME_MACHINE"-unknown-atheos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-atheos
+ ;;
i*86:syllable:*:*)
- echo "$UNAME_MACHINE"-pc-syllable
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-syllable
+ ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=i386-unknown-lynxos$UNAME_RELEASE
+ ;;
i*86:*DOS:*:*)
- echo "$UNAME_MACHINE"-pc-msdosdjgpp
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-msdosdjgpp
+ ;;
i*86:*:4.*:*)
UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
+ GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
else
- echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
+ GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
fi
- exit ;;
+ ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
@@ -1158,12 +1225,12 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
+ GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1173,11 +1240,11 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
+ GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
else
- echo "$UNAME_MACHINE"-pc-sysv32
+ GUESS=$UNAME_MACHINE-pc-sysv32
fi
- exit ;;
+ ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
@@ -1185,31 +1252,31 @@ EOF
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
+ GUESS=i586-pc-msdosdjgpp
+ ;;
Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
+ GUESS=i386-pc-mach3
+ ;;
paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
+ GUESS=i860-intel-osf1
+ ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
+ GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
+ GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
fi
- exit ;;
+ ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
- echo m68010-convergent-sysv
- exit ;;
+ GUESS=m68010-convergent-sysv
+ ;;
mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
+ GUESS=m68k-convergent-sysv
+ ;;
M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
+ GUESS=m68k-diab-dnix
+ ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
@@ -1234,113 +1301,116 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-unknown-lynxos$UNAME_RELEASE
+ ;;
mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
+ GUESS=m68k-atari-sysv4
+ ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=sparc-unknown-lynxos$UNAME_RELEASE
+ ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
+ ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
+ GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
+ ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv"$UNAME_RELEASE"
- exit ;;
+ GUESS=mips-dde-sysv$UNAME_RELEASE
+ ;;
RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo "$UNAME_MACHINE"-sni-sysv4
+ GUESS=$UNAME_MACHINE-sni-sysv4
else
- echo ns32k-sni-sysv
+ GUESS=ns32k-sni-sysv
fi
- exit ;;
+ ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ GUESS=i586-unisys-sysv4
+ ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
+ GUESS=hppa1.1-stratus-sysv4
+ ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
+ GUESS=i860-stratus-sysv4
+ ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo "$UNAME_MACHINE"-stratus-vos
- exit ;;
+ GUESS=$UNAME_MACHINE-stratus-vos
+ ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
+ GUESS=hppa1.1-stratus-vos
+ ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux"$UNAME_RELEASE"
- exit ;;
+ GUESS=m68k-apple-aux$UNAME_RELEASE
+ ;;
news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
+ GUESS=mips-sony-newsos6
+ ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv"$UNAME_RELEASE"
+ if test -d /usr/nec; then
+ GUESS=mips-nec-sysv$UNAME_RELEASE
else
- echo mips-unknown-sysv"$UNAME_RELEASE"
+ GUESS=mips-unknown-sysv$UNAME_RELEASE
fi
- exit ;;
+ ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
+ GUESS=powerpc-be-beos
+ ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
+ GUESS=powerpc-apple-beos
+ ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
+ GUESS=i586-pc-beos
+ ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
+ GUESS=i586-pc-haiku
+ ;;
x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
+ GUESS=x86_64-unknown-haiku
+ ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx4-nec-superux$UNAME_RELEASE
+ ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx5-nec-superux$UNAME_RELEASE
+ ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx6-nec-superux$UNAME_RELEASE
+ ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx7-nec-superux$UNAME_RELEASE
+ ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx8-nec-superux$UNAME_RELEASE
+ ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sx8r-nec-superux$UNAME_RELEASE
+ ;;
SX-ACE:SUPER-UX:*:*)
- echo sxace-nec-superux"$UNAME_RELEASE"
- exit ;;
+ GUESS=sxace-nec-superux$UNAME_RELEASE
+ ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody"$UNAME_RELEASE"
- exit ;;
+ GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
+ ;;
*:Rhapsody:*:*)
- echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
+ ;;
+ arm64:Darwin:*:*)
+ GUESS=aarch64-apple-darwin$UNAME_RELEASE
+ ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
@@ -1355,7 +1425,7 @@ EOF
else
set_cc_for_build
fi
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
@@ -1376,109 +1446,119 @@ EOF
# uname -m returns i386 or x86_64
UNAME_PROCESSOR=$UNAME_MACHINE
fi
- echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
+ ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
+ ;;
*:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
+ GUESS=i386-pc-qnx
+ ;;
NEO-*:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=neo-tandem-nsk$UNAME_RELEASE
+ ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=nse-tandem-nsk$UNAME_RELEASE
+ ;;
NSR-*:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=nsr-tandem-nsk$UNAME_RELEASE
+ ;;
NSV-*:NONSTOP_KERNEL:*:*)
- echo nsv-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=nsv-tandem-nsk$UNAME_RELEASE
+ ;;
NSX-*:NONSTOP_KERNEL:*:*)
- echo nsx-tandem-nsk"$UNAME_RELEASE"
- exit ;;
+ GUESS=nsx-tandem-nsk$UNAME_RELEASE
+ ;;
*:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
+ GUESS=mips-compaq-nonstopux
+ ;;
BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
+ GUESS=bs2000-siemens-sysv
+ ;;
DS/*:UNIX_System_V:*:*)
- echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
+ ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- # shellcheck disable=SC2154
- if test "$cputype" = 386; then
+ if test "${cputype-}" = 386; then
UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
+ elif test "x${cputype-}" != x; then
+ UNAME_MACHINE=$cputype
fi
- echo "$UNAME_MACHINE"-unknown-plan9
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-plan9
+ ;;
*:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
+ GUESS=pdp10-unknown-tops10
+ ;;
*:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
+ GUESS=pdp10-unknown-tenex
+ ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
+ GUESS=pdp10-dec-tops20
+ ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
+ GUESS=pdp10-xkl-tops20
+ ;;
*:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
+ GUESS=pdp10-unknown-tops20
+ ;;
*:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
+ GUESS=pdp10-unknown-its
+ ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux"$UNAME_RELEASE"
- exit ;;
+ GUESS=mips-sei-seiux$UNAME_RELEASE
+ ;;
*:DragonFly:*:*)
- echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
- exit ;;
+ DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
+ ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "$UNAME_MACHINE" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
+ case $UNAME_MACHINE in
+ A*) GUESS=alpha-dec-vms ;;
+ I*) GUESS=ia64-dec-vms ;;
+ V*) GUESS=vax-dec-vms ;;
esac ;;
*:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
+ GUESS=i386-pc-xenix
+ ;;
i*86:skyos:*:*)
- echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
- exit ;;
+ SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
+ GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
+ ;;
i*86:rdos:*:*)
- echo "$UNAME_MACHINE"-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo "$UNAME_MACHINE"-pc-aros
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-rdos
+ ;;
+ i*86:Fiwix:*:*)
+ GUESS=$UNAME_MACHINE-pc-fiwix
+ ;;
+ *:AROS:*:*)
+ GUESS=$UNAME_MACHINE-unknown-aros
+ ;;
x86_64:VMkernel:*:*)
- echo "$UNAME_MACHINE"-unknown-esx
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-esx
+ ;;
amd64:Isilon\ OneFS:*:*)
- echo x86_64-unknown-onefs
- exit ;;
+ GUESS=x86_64-unknown-onefs
+ ;;
*:Unleashed:*:*)
- echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
+ ;;
esac
+# Do we have a guess based on uname results?
+if test "x$GUESS" != x; then
+ echo "$GUESS"
+ exit
+fi
+
# No uname command or uname output not recognized.
set_cc_for_build
cat > "$dummy.c" <<EOF
@@ -1610,7 +1690,7 @@ main ()
}
EOF
-$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
@@ -1618,7 +1698,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
echo "$0: unable to guess system type" >&2
-case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+case $UNAME_MACHINE:$UNAME_SYSTEM in
mips:Linux | mips64:Linux)
# If we got here on MIPS GNU/Linux, output extra information.
cat >&2 <<EOF
@@ -1635,9 +1715,17 @@ This script (version $timestamp), has failed to recognize the
operating system you are using. If your script is old, overwrite *all*
copies of config.guess and config.sub with the latest versions from:
- https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
and
- https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+EOF
+
+our_year=`echo $timestamp | sed 's,-.*,,'`
+thisyear=`date +%Y`
+# shellcheck disable=SC2003
+script_age=`expr "$thisyear" - "$our_year"`
+if test "$script_age" -lt 3 ; then
+ cat >&2 <<EOF
If $0 has already been updated, send the following data and any
information you think might be pertinent to config-patches@gnu.org to
@@ -1665,6 +1753,7 @@ UNAME_RELEASE = "$UNAME_RELEASE"
UNAME_SYSTEM = "$UNAME_SYSTEM"
UNAME_VERSION = "$UNAME_VERSION"
EOF
+fi
exit 1
diff --git a/3rdparty/expat/conftools/config.sub b/3rdparty/expat/conftools/config.sub
index 96fca060bde..a31fff318a1 100755
--- a/3rdparty/expat/conftools/config.sub
+++ b/3rdparty/expat/conftools/config.sub
@@ -1,12 +1,14 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2019 Free Software Foundation, Inc.
+# Copyright 1992-2022 Free Software Foundation, Inc.
-timestamp='2019-06-30'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2022-01-03'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -33,7 +35,7 @@ timestamp='2019-06-30'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -50,6 +52,13 @@ timestamp='2019-06-30'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
@@ -67,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2019 Free Software Foundation, Inc.
+Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -112,9 +121,11 @@ esac
# Split fields of configuration type
# shellcheck disable=SC2162
+saved_IFS=$IFS
IFS="-" read field1 field2 field3 field4 <<EOF
$1
EOF
+IFS=$saved_IFS
# Separate into logical components for further validation
case $1 in
@@ -124,28 +135,27 @@ case $1 in
;;
*-*-*-*)
basic_machine=$field1-$field2
- os=$field3-$field4
+ basic_os=$field3-$field4
;;
*-*-*)
# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
# parts
maybe_os=$field2-$field3
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
- | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+ nto-qnx* | linux-* | uclinux-uclibc* \
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
| storm-chaos* | os2-emx* | rtmk-nova*)
basic_machine=$field1
- os=$maybe_os
+ basic_os=$maybe_os
;;
android-linux)
basic_machine=$field1-unknown
- os=linux-android
+ basic_os=linux-android
;;
*)
basic_machine=$field1-$field2
- os=$field3
+ basic_os=$field3
;;
esac
;;
@@ -154,7 +164,7 @@ case $1 in
case $field1-$field2 in
decstation-3100)
basic_machine=mips-dec
- os=
+ basic_os=
;;
*-*)
# Second component is usually, but not always the OS
@@ -162,7 +172,11 @@ case $1 in
# Prevent following clause from handling this valid os
sun*os*)
basic_machine=$field1
- os=$field2
+ basic_os=$field2
+ ;;
+ zephyr*)
+ basic_machine=$field1-unknown
+ basic_os=$field2
;;
# Manufacturers
dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
@@ -175,11 +189,11 @@ case $1 in
| microblaze* | sim | cisco \
| oki | wec | wrs | winbond)
basic_machine=$field1-$field2
- os=
+ basic_os=
;;
*)
basic_machine=$field1
- os=$field2
+ basic_os=$field2
;;
esac
;;
@@ -191,447 +205,451 @@ case $1 in
case $field1 in
386bsd)
basic_machine=i386-pc
- os=bsd
+ basic_os=bsd
;;
a29khif)
basic_machine=a29k-amd
- os=udi
+ basic_os=udi
;;
adobe68k)
basic_machine=m68010-adobe
- os=scout
+ basic_os=scout
;;
alliant)
basic_machine=fx80-alliant
- os=
+ basic_os=
;;
altos | altos3068)
basic_machine=m68k-altos
- os=
+ basic_os=
;;
am29k)
basic_machine=a29k-none
- os=bsd
+ basic_os=bsd
;;
amdahl)
basic_machine=580-amdahl
- os=sysv
+ basic_os=sysv
;;
amiga)
basic_machine=m68k-unknown
- os=
+ basic_os=
;;
amigaos | amigados)
basic_machine=m68k-unknown
- os=amigaos
+ basic_os=amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
- os=sysv4
+ basic_os=sysv4
;;
apollo68)
basic_machine=m68k-apollo
- os=sysv
+ basic_os=sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
- os=bsd
+ basic_os=bsd
;;
aros)
basic_machine=i386-pc
- os=aros
+ basic_os=aros
;;
aux)
basic_machine=m68k-apple
- os=aux
+ basic_os=aux
;;
balance)
basic_machine=ns32k-sequent
- os=dynix
+ basic_os=dynix
;;
blackfin)
basic_machine=bfin-unknown
- os=linux
+ basic_os=linux
;;
cegcc)
basic_machine=arm-unknown
- os=cegcc
+ basic_os=cegcc
;;
convex-c1)
basic_machine=c1-convex
- os=bsd
+ basic_os=bsd
;;
convex-c2)
basic_machine=c2-convex
- os=bsd
+ basic_os=bsd
;;
convex-c32)
basic_machine=c32-convex
- os=bsd
+ basic_os=bsd
;;
convex-c34)
basic_machine=c34-convex
- os=bsd
+ basic_os=bsd
;;
convex-c38)
basic_machine=c38-convex
- os=bsd
+ basic_os=bsd
;;
cray)
basic_machine=j90-cray
- os=unicos
+ basic_os=unicos
;;
crds | unos)
basic_machine=m68k-crds
- os=
+ basic_os=
;;
da30)
basic_machine=m68k-da30
- os=
+ basic_os=
;;
decstation | pmax | pmin | dec3100 | decstatn)
basic_machine=mips-dec
- os=
+ basic_os=
;;
delta88)
basic_machine=m88k-motorola
- os=sysv3
+ basic_os=sysv3
;;
dicos)
basic_machine=i686-pc
- os=dicos
+ basic_os=dicos
;;
djgpp)
basic_machine=i586-pc
- os=msdosdjgpp
+ basic_os=msdosdjgpp
;;
ebmon29k)
basic_machine=a29k-amd
- os=ebmon
+ basic_os=ebmon
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
- os=ose
+ basic_os=ose
;;
gmicro)
basic_machine=tron-gmicro
- os=sysv
+ basic_os=sysv
;;
go32)
basic_machine=i386-pc
- os=go32
+ basic_os=go32
;;
h8300hms)
basic_machine=h8300-hitachi
- os=hms
+ basic_os=hms
;;
h8300xray)
basic_machine=h8300-hitachi
- os=xray
+ basic_os=xray
;;
h8500hms)
basic_machine=h8500-hitachi
- os=hms
+ basic_os=hms
;;
harris)
basic_machine=m88k-harris
- os=sysv3
+ basic_os=sysv3
;;
hp300 | hp300hpux)
basic_machine=m68k-hp
- os=hpux
+ basic_os=hpux
;;
hp300bsd)
basic_machine=m68k-hp
- os=bsd
+ basic_os=bsd
;;
hppaosf)
basic_machine=hppa1.1-hp
- os=osf
+ basic_os=osf
;;
hppro)
basic_machine=hppa1.1-hp
- os=proelf
+ basic_os=proelf
;;
i386mach)
basic_machine=i386-mach
- os=mach
+ basic_os=mach
;;
isi68 | isi)
basic_machine=m68k-isi
- os=sysv
+ basic_os=sysv
;;
m68knommu)
basic_machine=m68k-unknown
- os=linux
+ basic_os=linux
;;
magnum | m3230)
basic_machine=mips-mips
- os=sysv
+ basic_os=sysv
;;
merlin)
basic_machine=ns32k-utek
- os=sysv
+ basic_os=sysv
;;
mingw64)
basic_machine=x86_64-pc
- os=mingw64
+ basic_os=mingw64
;;
mingw32)
basic_machine=i686-pc
- os=mingw32
+ basic_os=mingw32
;;
mingw32ce)
basic_machine=arm-unknown
- os=mingw32ce
+ basic_os=mingw32ce
;;
monitor)
basic_machine=m68k-rom68k
- os=coff
+ basic_os=coff
;;
morphos)
basic_machine=powerpc-unknown
- os=morphos
+ basic_os=morphos
;;
moxiebox)
basic_machine=moxie-unknown
- os=moxiebox
+ basic_os=moxiebox
;;
msdos)
basic_machine=i386-pc
- os=msdos
+ basic_os=msdos
;;
msys)
basic_machine=i686-pc
- os=msys
+ basic_os=msys
;;
mvs)
basic_machine=i370-ibm
- os=mvs
+ basic_os=mvs
;;
nacl)
basic_machine=le32-unknown
- os=nacl
+ basic_os=nacl
;;
ncr3000)
basic_machine=i486-ncr
- os=sysv4
+ basic_os=sysv4
;;
netbsd386)
basic_machine=i386-pc
- os=netbsd
+ basic_os=netbsd
;;
netwinder)
basic_machine=armv4l-rebel
- os=linux
+ basic_os=linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
- os=newsos
+ basic_os=newsos
;;
news1000)
basic_machine=m68030-sony
- os=newsos
+ basic_os=newsos
;;
necv70)
basic_machine=v70-nec
- os=sysv
+ basic_os=sysv
;;
nh3000)
basic_machine=m68k-harris
- os=cxux
+ basic_os=cxux
;;
nh[45]000)
basic_machine=m88k-harris
- os=cxux
+ basic_os=cxux
;;
nindy960)
basic_machine=i960-intel
- os=nindy
+ basic_os=nindy
;;
mon960)
basic_machine=i960-intel
- os=mon960
+ basic_os=mon960
;;
nonstopux)
basic_machine=mips-compaq
- os=nonstopux
+ basic_os=nonstopux
;;
os400)
basic_machine=powerpc-ibm
- os=os400
+ basic_os=os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
- os=ose
+ basic_os=ose
;;
os68k)
basic_machine=m68k-none
- os=os68k
+ basic_os=os68k
;;
paragon)
basic_machine=i860-intel
- os=osf
+ basic_os=osf
;;
parisc)
basic_machine=hppa-unknown
- os=linux
+ basic_os=linux
+ ;;
+ psp)
+ basic_machine=mipsallegrexel-sony
+ basic_os=psp
;;
pw32)
basic_machine=i586-unknown
- os=pw32
+ basic_os=pw32
;;
rdos | rdos64)
basic_machine=x86_64-pc
- os=rdos
+ basic_os=rdos
;;
rdos32)
basic_machine=i386-pc
- os=rdos
+ basic_os=rdos
;;
rom68k)
basic_machine=m68k-rom68k
- os=coff
+ basic_os=coff
;;
sa29200)
basic_machine=a29k-amd
- os=udi
+ basic_os=udi
;;
sei)
basic_machine=mips-sei
- os=seiux
+ basic_os=seiux
;;
sequent)
basic_machine=i386-sequent
- os=
+ basic_os=
;;
sps7)
basic_machine=m68k-bull
- os=sysv2
+ basic_os=sysv2
;;
st2000)
basic_machine=m68k-tandem
- os=
+ basic_os=
;;
stratus)
basic_machine=i860-stratus
- os=sysv4
+ basic_os=sysv4
;;
sun2)
basic_machine=m68000-sun
- os=
+ basic_os=
;;
sun2os3)
basic_machine=m68000-sun
- os=sunos3
+ basic_os=sunos3
;;
sun2os4)
basic_machine=m68000-sun
- os=sunos4
+ basic_os=sunos4
;;
sun3)
basic_machine=m68k-sun
- os=
+ basic_os=
;;
sun3os3)
basic_machine=m68k-sun
- os=sunos3
+ basic_os=sunos3
;;
sun3os4)
basic_machine=m68k-sun
- os=sunos4
+ basic_os=sunos4
;;
sun4)
basic_machine=sparc-sun
- os=
+ basic_os=
;;
sun4os3)
basic_machine=sparc-sun
- os=sunos3
+ basic_os=sunos3
;;
sun4os4)
basic_machine=sparc-sun
- os=sunos4
+ basic_os=sunos4
;;
sun4sol2)
basic_machine=sparc-sun
- os=solaris2
+ basic_os=solaris2
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
- os=
+ basic_os=
;;
sv1)
basic_machine=sv1-cray
- os=unicos
+ basic_os=unicos
;;
symmetry)
basic_machine=i386-sequent
- os=dynix
+ basic_os=dynix
;;
t3e)
basic_machine=alphaev5-cray
- os=unicos
+ basic_os=unicos
;;
t90)
basic_machine=t90-cray
- os=unicos
+ basic_os=unicos
;;
toad1)
basic_machine=pdp10-xkl
- os=tops20
+ basic_os=tops20
;;
tpf)
basic_machine=s390x-ibm
- os=tpf
+ basic_os=tpf
;;
udi29k)
basic_machine=a29k-amd
- os=udi
+ basic_os=udi
;;
ultra3)
basic_machine=a29k-nyu
- os=sym1
+ basic_os=sym1
;;
v810 | necv810)
basic_machine=v810-nec
- os=none
+ basic_os=none
;;
vaxv)
basic_machine=vax-dec
- os=sysv
+ basic_os=sysv
;;
vms)
basic_machine=vax-dec
- os=vms
+ basic_os=vms
;;
vsta)
basic_machine=i386-pc
- os=vsta
+ basic_os=vsta
;;
vxworks960)
basic_machine=i960-wrs
- os=vxworks
+ basic_os=vxworks
;;
vxworks68)
basic_machine=m68k-wrs
- os=vxworks
+ basic_os=vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
- os=vxworks
+ basic_os=vxworks
;;
xbox)
basic_machine=i686-pc
- os=mingw32
+ basic_os=mingw32
;;
ymp)
basic_machine=ymp-cray
- os=unicos
+ basic_os=unicos
;;
*)
basic_machine=$1
- os=
+ basic_os=
;;
esac
;;
@@ -683,17 +701,17 @@ case $basic_machine in
bluegene*)
cpu=powerpc
vendor=ibm
- os=cnk
+ basic_os=cnk
;;
decsystem10* | dec10*)
cpu=pdp10
vendor=dec
- os=tops10
+ basic_os=tops10
;;
decsystem20* | dec20*)
cpu=pdp10
vendor=dec
- os=tops20
+ basic_os=tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
@@ -703,7 +721,7 @@ case $basic_machine in
dpx2*)
cpu=m68k
vendor=bull
- os=sysv3
+ basic_os=sysv3
;;
encore | umax | mmax)
cpu=ns32k
@@ -712,7 +730,7 @@ case $basic_machine in
elxsi)
cpu=elxsi
vendor=elxsi
- os=${os:-bsd}
+ basic_os=${basic_os:-bsd}
;;
fx2800)
cpu=i860
@@ -725,7 +743,7 @@ case $basic_machine in
h3050r* | hiux*)
cpu=hppa1.1
vendor=hitachi
- os=hiuxwe2
+ basic_os=hiuxwe2
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
cpu=hppa1.0
@@ -768,36 +786,36 @@ case $basic_machine in
i*86v32)
cpu=`echo "$1" | sed -e 's/86.*/86/'`
vendor=pc
- os=sysv32
+ basic_os=sysv32
;;
i*86v4*)
cpu=`echo "$1" | sed -e 's/86.*/86/'`
vendor=pc
- os=sysv4
+ basic_os=sysv4
;;
i*86v)
cpu=`echo "$1" | sed -e 's/86.*/86/'`
vendor=pc
- os=sysv
+ basic_os=sysv
;;
i*86sol2)
cpu=`echo "$1" | sed -e 's/86.*/86/'`
vendor=pc
- os=solaris2
+ basic_os=solaris2
;;
j90 | j90-cray)
cpu=j90
vendor=cray
- os=${os:-unicos}
+ basic_os=${basic_os:-unicos}
;;
iris | iris4d)
cpu=mips
vendor=sgi
- case $os in
+ case $basic_os in
irix*)
;;
*)
- os=irix4
+ basic_os=irix4
;;
esac
;;
@@ -808,7 +826,7 @@ case $basic_machine in
*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
cpu=m68k
vendor=atari
- os=mint
+ basic_os=mint
;;
mipsEE* | ee)
cpu=mips64r5900el
@@ -834,21 +852,21 @@ case $basic_machine in
news-3600 | risc-news)
cpu=mips
vendor=sony
- os=newsos
+ basic_os=newsos
;;
next | m*-next)
cpu=m68k
vendor=next
- case $os in
+ case $basic_os in
openstep*)
;;
nextstep*)
;;
ns2*)
- os=nextstep2
+ basic_os=nextstep2
;;
*)
- os=nextstep3
+ basic_os=nextstep3
;;
esac
;;
@@ -859,12 +877,12 @@ case $basic_machine in
op50n-* | op60c-*)
cpu=hppa1.1
vendor=oki
- os=proelf
+ basic_os=proelf
;;
pa-hitachi)
cpu=hppa1.1
vendor=hitachi
- os=hiuxwe2
+ basic_os=hiuxwe2
;;
pbd)
cpu=sparc
@@ -901,12 +919,12 @@ case $basic_machine in
sde)
cpu=mipsisa32
vendor=sde
- os=${os:-elf}
+ basic_os=${basic_os:-elf}
;;
simso-wrs)
cpu=sparclite
vendor=wrs
- os=vxworks
+ basic_os=vxworks
;;
tower | tower-32)
cpu=m68k
@@ -923,7 +941,7 @@ case $basic_machine in
w89k-*)
cpu=hppa1.1
vendor=winbond
- os=proelf
+ basic_os=proelf
;;
none)
cpu=none
@@ -940,9 +958,11 @@ case $basic_machine in
*-*)
# shellcheck disable=SC2162
+ saved_IFS=$IFS
IFS="-" read cpu vendor <<EOF
$basic_machine
EOF
+ IFS=$saved_IFS
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
@@ -976,11 +996,11 @@ case $cpu-$vendor in
# some cases the only manufacturer, in others, it is the most popular.
craynv-unknown)
vendor=cray
- os=${os:-unicosmp}
+ basic_os=${basic_os:-unicosmp}
;;
c90-unknown | c90-cray)
vendor=cray
- os=${os:-unicos}
+ basic_os=${Basic_os:-unicos}
;;
fx80-unknown)
vendor=alliant
@@ -1021,10 +1041,15 @@ case $cpu-$vendor in
;;
# Here we normalize CPU types with a missing or matching vendor
+ armh-unknown | armh-alt)
+ cpu=armv7l
+ vendor=alt
+ basic_os=${basic_os:-linux-gnueabihf}
+ ;;
dpx20-unknown | dpx20-bull)
cpu=rs6000
vendor=bull
- os=${os:-bosx}
+ basic_os=${basic_os:-bosx}
;;
# Here we normalize CPU types irrespective of the vendor
@@ -1033,7 +1058,7 @@ case $cpu-$vendor in
;;
blackfin-*)
cpu=bfin
- os=linux
+ basic_os=linux
;;
c54x-*)
cpu=tic54x
@@ -1046,7 +1071,7 @@ case $cpu-$vendor in
;;
e500v[12]-*)
cpu=powerpc
- os=$os"spe"
+ basic_os=${basic_os}"spe"
;;
mips3*-*)
cpu=mips64
@@ -1056,7 +1081,7 @@ case $cpu-$vendor in
;;
m68knommu-*)
cpu=m68k
- os=linux
+ basic_os=linux
;;
m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
cpu=s12z
@@ -1066,7 +1091,7 @@ case $cpu-$vendor in
;;
parisc-*)
cpu=hppa
- os=linux
+ basic_os=linux
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
cpu=i586
@@ -1122,11 +1147,14 @@ case $cpu-$vendor in
xscale-* | xscalee[bl]-*)
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
+ arm64-* | aarch64le-*)
+ cpu=aarch64
+ ;;
# Recognize the canonical CPU Types that limit and/or modify the
# company names they are paired with.
cr16-*)
- os=${os:-elf}
+ basic_os=${basic_os:-elf}
;;
crisv32-* | etraxfs*-*)
cpu=crisv32
@@ -1137,7 +1165,7 @@ case $cpu-$vendor in
vendor=axis
;;
crx-*)
- os=${os:-elf}
+ basic_os=${basic_os:-elf}
;;
neo-tandem)
cpu=neo
@@ -1159,16 +1187,12 @@ case $cpu-$vendor in
cpu=nsx
vendor=tandem
;;
- s390-*)
- cpu=s390
- vendor=ibm
- ;;
- s390x-*)
- cpu=s390x
- vendor=ibm
+ mipsallegrexel-sony)
+ cpu=mipsallegrexel
+ vendor=sony
;;
tile*-*)
- os=${os:-linux-gnu}
+ basic_os=${basic_os:-linux-gnu}
;;
*)
@@ -1184,8 +1208,8 @@ case $cpu-$vendor in
| alphapca5[67] | alpha64pca5[67] \
| am33_2.0 \
| amdgcn \
- | arc | arceb \
- | arm | arm[lb]e | arme[lb] | armv* \
+ | arc | arceb | arc32 | arc64 \
+ | arm | arm[lb]e | arme[lb] | armv* \
| avr | avr32 \
| asmjs \
| ba \
@@ -1204,6 +1228,7 @@ case $cpu-$vendor in
| k1om \
| le32 | le64 \
| lm32 \
+ | loongarch32 | loongarch64 | loongarchx32 \
| m32c | m32r | m32rle \
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
@@ -1222,9 +1247,13 @@ case $cpu-$vendor in
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r3 | mipsisa32r3el \
+ | mipsisa32r5 | mipsisa32r5el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r3 | mipsisa64r3el \
+ | mipsisa64r5 | mipsisa64r5el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
@@ -1248,8 +1277,9 @@ case $cpu-$vendor in
| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
| pru \
| pyramid \
- | riscv | riscv32 | riscv64 \
+ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
| rl78 | romp | rs6000 | rx \
+ | s390 | s390x \
| score \
| sh | shl \
| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
@@ -1259,6 +1289,7 @@ case $cpu-$vendor in
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
| spu \
| tahoe \
+ | thumbv7* \
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
| tron \
| ubicom32 \
@@ -1296,8 +1327,49 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x$os != x ]
+if test x$basic_os != x
then
+
+# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
+# set os.
+case $basic_os in
+ gnu/linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
+ ;;
+ os2-emx)
+ kernel=os2
+ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
+ ;;
+ nto-qnx*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
+ ;;
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read kernel os <<EOF
+$basic_os
+EOF
+ IFS=$saved_IFS
+ ;;
+ # Default OS when just kernel was specified
+ nto*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
+ ;;
+ linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
+ ;;
+ *)
+ kernel=
+ os=$basic_os
+ ;;
+esac
+
+# Now, normalize the OS (knowing we just have one component, it's not a kernel,
+# etc.)
case $os in
# First match some system type aliases that might get confused
# with valid system types.
@@ -1309,7 +1381,7 @@ case $os in
os=cnk
;;
solaris1 | solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
;;
solaris)
os=solaris2
@@ -1317,9 +1389,6 @@ case $os in
unixware*)
os=sysv4.2uw
;;
- gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
# es1800 is here to avoid being matched by es* (a different OS)
es1800*)
os=ose
@@ -1341,12 +1410,9 @@ case $os in
os=sco3.2v4
;;
sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
;;
- sco3.2v[4-9]* | sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- ;;
- scout)
+ sco*v* | scout)
# Don't match below
;;
sco*)
@@ -1355,78 +1421,25 @@ case $os in
psos*)
os=psos
;;
- # Now accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST end in a * to match a version number.
- # sysv* is not here because it comes later, after sysvr4.
- gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
- | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
- | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
- | sym* | kopensolaris* | plan9* \
- | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
- | aos* | aros* | cloudabi* | sortix* | twizzler* \
- | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
- | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
- | knetbsd* | mirbsd* | netbsd* \
- | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
- | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
- | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
- | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
- | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
- | chorusrdb* | cegcc* | glidix* \
- | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
- | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
- | linux-newlib* | linux-musl* | linux-uclibc* \
- | uxpv* | beos* | mpeix* | udk* | moxiebox* \
- | interix* | uwin* | mks* | rhapsody* | darwin* \
- | openstep* | oskit* | conix* | pw32* | nonstopux* \
- | storm-chaos* | tops10* | tenex* | tops20* | its* | irx* \
- | os2* | vos* | palmos* | uclinux* | nucleus* \
- | morphos* | superux* | rtmk* | windiss* \
- | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
- | skyos* | haiku* | rdos* | toppers* | drops* | es* \
- | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
- | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
- | nsk* | powerunix)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
qnx*)
- case $cpu in
- x86 | i*86)
- ;;
- *)
- os=nto-$os
- ;;
- esac
+ os=qnx
;;
hiux*)
os=hiuxwe2
;;
- nto-qnx*)
- ;;
- nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- sim | xray | os68k* | v88r* \
- | windows* | osx | abug | netware* | os9* \
- | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
- ;;
- linux-dietlibc)
- os=linux-dietlibc
- ;;
- linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
lynx*178)
os=lynxos178
;;
lynx*5)
os=lynxos5
;;
+ lynxos*)
+ # don't get caught up in next wildcard
+ ;;
lynx*)
os=lynxos
;;
- mac*)
+ mac[0-9]*)
os=`echo "$os" | sed -e 's|mac|macos|'`
;;
opened*)
@@ -1473,7 +1486,7 @@ case $os in
;;
# Preserve the version number of sinix5.
sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
+ os=`echo "$os" | sed -e 's|sinix|sysv|'`
;;
sinix*)
os=sysv4
@@ -1496,18 +1509,12 @@ case $os in
sysvr4)
os=sysv4
;;
- # This must come after sysvr4.
- sysv*)
- ;;
ose*)
os=ose
;;
*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
os=mint
;;
- zvmoe)
- os=zvmoe
- ;;
dicos*)
os=dicos
;;
@@ -1524,19 +1531,11 @@ case $os in
;;
esac
;;
- nacl*)
- ;;
- ios)
- ;;
- none)
- ;;
- *-eabi)
- ;;
*)
- echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
- exit 1
+ # No normalization, but not necessarily accepted, that comes below.
;;
esac
+
else
# Here we handle the default operating systems that come with various machines.
@@ -1549,6 +1548,7 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
+kernel=
case $cpu-$vendor in
score-*)
os=elf
@@ -1560,7 +1560,8 @@ case $cpu-$vendor in
os=riscix1.2
;;
arm*-rebel)
- os=linux
+ kernel=linux
+ os=gnu
;;
arm*-semi)
os=aout
@@ -1726,84 +1727,180 @@ case $cpu-$vendor in
os=none
;;
esac
+
fi
+# Now, validate our (potentially fixed-up) OS.
+case $os in
+ # Sometimes we do "kernel-libc", so those need to count as OSes.
+ musl* | newlib* | relibc* | uclibc*)
+ ;;
+ # Likewise for "kernel-abi"
+ eabi* | gnueabi*)
+ ;;
+ # VxWorks passes extra cpu info in the 4th filed.
+ simlinux | simwindows | spe)
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
+ | hiux* | abug | nacl* | netware* | windows* \
+ | os9* | macos* | osx* | ios* \
+ | mpw* | magic* | mmixware* | mon960* | lnews* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* | serenity* \
+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | mint* \
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
+ | storm-chaos* | tops10* | tenex* | tops20* | its* | irx* \
+ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
+ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
+ | fiwix* )
+ ;;
+ # This one is extra strict with allowed versions
+ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ none)
+ ;;
+ *)
+ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os in
+ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
+ | linux-musl* | linux-relibc* | linux-uclibc* )
+ ;;
+ uclinux-uclibc* )
+ ;;
+ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
+ # These are just libc implementations, not actual OSes, and thus
+ # require a kernel.
+ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ kfreebsd*-gnu* | kopensolaris*-gnu*)
+ ;;
+ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+ ;;
+ nto-qnx*)
+ ;;
+ os2-emx)
+ ;;
+ *-eabi* | *-gnueabi*)
+ ;;
+ -*)
+ # Blank kernel with real OS is always fine.
+ ;;
+ *-*)
+ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+ exit 1
+ ;;
+esac
+
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
case $vendor in
unknown)
- case $os in
- riscix*)
+ case $cpu-$os in
+ *-riscix*)
vendor=acorn
;;
- sunos*)
+ *-sunos*)
vendor=sun
;;
- cnk*|-aix*)
+ *-cnk* | *-aix*)
vendor=ibm
;;
- beos*)
+ *-beos*)
vendor=be
;;
- hpux*)
+ *-hpux*)
vendor=hp
;;
- mpeix*)
+ *-mpeix*)
vendor=hp
;;
- hiux*)
+ *-hiux*)
vendor=hitachi
;;
- unos*)
+ *-unos*)
vendor=crds
;;
- dgux*)
+ *-dgux*)
vendor=dg
;;
- luna*)
+ *-luna*)
vendor=omron
;;
- genix*)
+ *-genix*)
vendor=ns
;;
- clix*)
+ *-clix*)
vendor=intergraph
;;
- mvs* | opened*)
+ *-mvs* | *-opened*)
+ vendor=ibm
+ ;;
+ *-os400*)
vendor=ibm
;;
- os400*)
+ s390-* | s390x-*)
vendor=ibm
;;
- ptx*)
+ *-ptx*)
vendor=sequent
;;
- tpf*)
+ *-tpf*)
vendor=ibm
;;
- vxsim* | vxworks* | windiss*)
+ *-vxsim* | *-vxworks* | *-windiss*)
vendor=wrs
;;
- aux*)
+ *-aux*)
vendor=apple
;;
- hms*)
+ *-hms*)
vendor=hitachi
;;
- mpw* | macos*)
+ *-mpw* | *-macos*)
vendor=apple
;;
- *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
vendor=atari
;;
- vos*)
+ *-vos*)
vendor=stratus
;;
esac
;;
esac
-echo "$cpu-$vendor-$os"
+echo "$cpu-$vendor-${kernel:+$kernel-}$os"
exit
# Local variables:
diff --git a/3rdparty/expat/conftools/depcomp b/3rdparty/expat/conftools/depcomp
index 6b391623c4b..715e34311ed 100755
--- a/3rdparty/expat/conftools/depcomp
+++ b/3rdparty/expat/conftools/depcomp
@@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/3rdparty/expat/conftools/get-version.sh b/3rdparty/expat/conftools/get-version.sh
index 2592f103288..273ed3a3154 100755
--- a/3rdparty/expat/conftools/get-version.sh
+++ b/3rdparty/expat/conftools/get-version.sh
@@ -1,13 +1,39 @@
#!/bin/sh
-#
# USAGE: get-version.sh path/to/expat.h
#
# This script will print Expat's version number on stdout. For example:
#
# $ ./conftools/get-version.sh ./lib/expat.h
# 1.95.3
-# $
+# __ __ _
+# ___\ \/ /_ __ __ _| |_
+# / _ \\ /| '_ \ / _` | __|
+# | __// \| |_) | (_| | |_
+# \___/_/\_\ .__/ \__,_|\__|
+# |_| XML parser
+#
+# Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
+# Copyright (c) 2017 Kerin Millar <kfm@plushkava.net>
+# Licensed under the MIT license:
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
#
+# 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 AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
if test $# = 0; then
echo "ERROR: pathname for expat.h was not provided."
diff --git a/3rdparty/expat/conftools/install-sh b/3rdparty/expat/conftools/install-sh
index 20d8b2eaea9..ec298b53740 100755
--- a/3rdparty/expat/conftools/install-sh
+++ b/3rdparty/expat/conftools/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2018-03-11.20; # UTC
+scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -69,6 +69,11 @@ posix_mkdir=
# Desired mode of installed file.
mode=0755
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@@ -99,18 +104,28 @@ Options:
--version display version info and exit.
-c (ignored)
- -C install only if different (preserve the last data modification time)
+ -C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
+ -p pass -p to $cpprog.
-s $stripprog installed files.
+ -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to bug-automake@gnu.org.
+Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
@@ -137,8 +152,13 @@ while test $# -ne 0; do
-o) chowncmd="$chownprog $2"
shift;;
+ -p) cpprog="$cpprog -p";;
+
-s) stripcmd=$stripprog;;
+ -S) backupsuffix="$2"
+ shift;;
+
-t)
is_target_a_directory=always
dst_arg=$2
@@ -255,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
+ # Don't chown directories that already exist.
+ if test $dstdir_status = 0; then
+ chowncmd=""
+ fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -301,22 +325,6 @@ do
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
@@ -326,52 +334,49 @@ do
fi
posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- # Note that $RANDOM variable is not portable (e.g. dash); Use it
- # here however when possible just to lower collision chance.
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-
- trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- # Because "mkdir -p" follows existing symlinks and we likely work
- # directly in world-writeable /tmp, make sure that the '$tmpdir'
- # directory is successfully created first before we actually test
- # 'mkdir -p' feature.
- if (umask $mkdir_umask &&
- $mkdirprog $mkdir_mode "$tmpdir" &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- test_tmpdir="$tmpdir/a"
- ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
- fi
- trap '' 0;;
- esac;;
+ # The $RANDOM variable is not portable (e.g., dash). Use it
+ # here however when possible just to lower collision chance.
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+ trap '
+ ret=$?
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+ exit $ret
+ ' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p'.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+ fi
+ trap '' 0;;
esac
if
@@ -382,7 +387,7 @@ do
then :
else
- # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
@@ -411,7 +416,7 @@ do
prefixes=
else
if $posix_mkdir; then
- (umask=$mkdir_umask &&
+ (umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
@@ -488,6 +493,13 @@ do
then
rm -f "$dsttmp"
else
+ # If $backupsuffix is set, and the file being installed
+ # already exists, attempt a backup. Don't worry if it fails,
+ # e.g., if mv doesn't support -f.
+ if test -n "$backupsuffix" && test -f "$dst"; then
+ $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+ fi
+
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@@ -502,9 +514,9 @@ do
# file should still install successfully.
{
test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
+ $doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
diff --git a/3rdparty/expat/conftools/ltmain.sh b/3rdparty/expat/conftools/ltmain.sh
index e774ddfe649..d57f0982354 100644
--- a/3rdparty/expat/conftools/ltmain.sh
+++ b/3rdparty/expat/conftools/ltmain.sh
@@ -1,12 +1,12 @@
-#! /bin/sh
+#! /usr/bin/env sh
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
-## by inline-source v2014-01-03.01
+## by inline-source v2019-02-19.15
-# libtool (GNU libtool) 2.4.6
+# libtool (GNU libtool) 2.5.4
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-# Copyright (C) 1996-2015 Free Software Foundation, Inc.
+# Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -31,8 +31,8 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.4.6
-package_revision=2.4.6
+VERSION=2.5.4
+package_revision=2.5.4
## ------ ##
@@ -64,34 +64,25 @@ package_revision=2.4.6
# libraries, which are installed to $pkgauxdir.
# Set a version string for this script.
-scriptversion=2015-10-04.22; # UTC
+scriptversion=2019-02-19.15; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
-# Copyright (C) 2004-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# As a special exception to the GNU General Public License, if you distribute
-# this file as part of a program or library that is built using GNU Libtool,
-# you may include this file under the same distribution terms that you use
-# for the rest of that program.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# This is free software. There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
+# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it. See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
-# Please report bugs or propose patches to gary@gnu.org.
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
## ------ ##
@@ -139,9 +130,12 @@ do
_G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
fi"
done
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# These NLS vars are set unconditionally (bootstrap issue #24). Unset those
+# in case the environment reset is needed later and the $save_* variant is not
+# defined (see the code above).
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
# Make sure IFS has a sensible default
sp=' '
@@ -149,7 +143,7 @@ nl='
'
IFS="$sp $nl"
-# There are apparently some retarded systems that use ';' as a PATH separator!
+# There are apparently some systems that use ';' as a PATH separator!
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
@@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
+# func_unset VAR
+# --------------
+# Portably unset VAR.
+# In some shells, an 'unset VAR' statement leaves a non-zero return
+# status if VAR is already unset, which might be problematic if the
+# statement is used at the end of a function (thus poisoning its return
+# value) or when 'set -e' is active (causing even a spurious abort of
+# the script in this case).
+func_unset ()
+{
+ { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }
+}
+
+
+# Make sure CDPATH doesn't cause `cd` commands to output the target dir.
+func_unset CDPATH
+
+# Make sure ${,E,F}GREP behave sanely.
+func_unset GREP_OPTIONS
+
## ------------------------- ##
## Locate command utilities. ##
@@ -259,7 +273,7 @@ test -z "$SED" && {
rm -f conftest.in conftest.tmp conftest.nl conftest.out
}
- func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+ func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin"
rm -f conftest.sed
SED=$func_path_progs_result
}
@@ -295,7 +309,7 @@ test -z "$GREP" && {
rm -f conftest.in conftest.tmp conftest.nl conftest.out
}
- func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+ func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin"
GREP=$func_path_progs_result
}
@@ -360,6 +374,35 @@ sed_double_backslash="\
s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
s/\n//g"
+# require_check_ifs_backslash
+# ---------------------------
+# Check if we can use backslash as IFS='\' separator, and set
+# $check_ifs_backshlash_broken to ':' or 'false'.
+require_check_ifs_backslash=func_require_check_ifs_backslash
+func_require_check_ifs_backslash ()
+{
+ _G_save_IFS=$IFS
+ IFS='\'
+ _G_check_ifs_backshlash='a\\b'
+ for _G_i in $_G_check_ifs_backshlash
+ do
+ case $_G_i in
+ a)
+ check_ifs_backshlash_broken=false
+ ;;
+ '')
+ break
+ ;;
+ *)
+ check_ifs_backshlash_broken=:
+ break
+ ;;
+ esac
+ done
+ IFS=$_G_save_IFS
+ require_check_ifs_backslash=:
+}
+
## ----------------- ##
## Global variables. ##
@@ -546,7 +589,7 @@ func_require_term_colors ()
# _G_HAVE_PLUSEQ_OP
# Can be empty, in which case the shell is probed, "yes" if += is
- # useable or anything else if it does not work.
+ # usable or anything else if it does not work.
test -z "$_G_HAVE_PLUSEQ_OP" \
&& (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
&& _G_HAVE_PLUSEQ_OP=yes
@@ -580,16 +623,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then
{
$debug_cmd
- func_quote_for_eval "$2"
- eval "$1+=\\ \$func_quote_for_eval_result"
+ func_quote_arg pretty "$2"
+ eval "$1+=\\ \$func_quote_arg_result"
}'
else
func_append_quoted ()
{
$debug_cmd
- func_quote_for_eval "$2"
- eval "$1=\$$1\\ \$func_quote_for_eval_result"
+ func_quote_arg pretty "$2"
+ eval "$1=\$$1\\ \$func_quote_arg_result"
}
fi
@@ -696,7 +739,7 @@ eval 'func_dirname ()
# to NONDIR_REPLACEMENT.
# value returned in "$func_dirname_result"
# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
+# value returned in "$func_basename_result"
# For efficiency, we do not delegate to the functions above but instead
# duplicate the functionality here.
eval 'func_dirname_and_basename ()
@@ -854,7 +897,7 @@ func_mkdir_p ()
# While some portion of DIR does not yet exist...
while test ! -d "$_G_directory_path"; do
# ...make a list in topmost first order. Use a colon delimited
- # list incase some portion of path contains whitespace.
+ # list in case some portion of path contains whitespace.
_G_dir_list=$_G_directory_path:$_G_dir_list
# If the last portion added has no slash in it, the list is done
@@ -1091,132 +1134,203 @@ func_relative_path ()
}
-# func_quote ARG
-# --------------
-# Aesthetically quote one ARG, store the result into $func_quote_result. Note
-# that we keep attention to performance here (so far O(N) complexity as long as
-# func_append is O(1)).
-func_quote ()
+# func_quote_portable EVAL ARG
+# ----------------------------
+# Internal function to portably implement func_quote_arg. Note that we still
+# keep attention to performance here so we as much as possible try to avoid
+# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
+func_quote_portable ()
{
$debug_cmd
- func_quote_result=$1
+ $require_check_ifs_backslash
- case $func_quote_result in
- *[\\\`\"\$]*)
- case $func_quote_result in
- *[\[\*\?]*)
- func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"`
- return 0
- ;;
- esac
+ func_quote_portable_result=$2
- func_quote_old_IFS=$IFS
- for _G_char in '\' '`' '"' '$'
- do
- # STATE($1) PREV($2) SEPARATOR($3)
- set start "" ""
- func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy
- IFS=$_G_char
- for _G_part in $func_quote_result
- do
- case $1 in
- quote)
- func_append func_quote_result "$3$2"
- set quote "$_G_part" "\\$_G_char"
- ;;
- start)
- set first "" ""
- func_quote_result=
- ;;
- first)
- set quote "$_G_part" ""
+ # one-time-loop (easy break)
+ while true
+ do
+ if $1; then
+ func_quote_portable_result=`$ECHO "$2" | $SED \
+ -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
+ break
+ fi
+
+ # Quote for eval.
+ case $func_quote_portable_result in
+ *[\\\`\"\$]*)
+ # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string
+ # contains the shell wildcard characters.
+ case $check_ifs_backshlash_broken$func_quote_portable_result in
+ :*|*[\[\*\?]*)
+ func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
+ | $SED "$sed_quote_subst"`
+ break
;;
- esac
+ esac
+
+ func_quote_portable_old_IFS=$IFS
+ for _G_char in '\' '`' '"' '$'
+ do
+ # STATE($1) PREV($2) SEPARATOR($3)
+ set start "" ""
+ func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
+ IFS=$_G_char
+ for _G_part in $func_quote_portable_result
+ do
+ case $1 in
+ quote)
+ func_append func_quote_portable_result "$3$2"
+ set quote "$_G_part" "\\$_G_char"
+ ;;
+ start)
+ set first "" ""
+ func_quote_portable_result=
+ ;;
+ first)
+ set quote "$_G_part" ""
+ ;;
+ esac
+ done
done
- IFS=$func_quote_old_IFS
- done
+ IFS=$func_quote_portable_old_IFS
+ ;;
+ *) ;;
+ esac
+ break
+ done
+
+ func_quote_portable_unquoted_result=$func_quote_portable_result
+ case $func_quote_portable_result in
+ # double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and variable expansion
+ # for a subsequent eval.
+ # many bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_portable_result=\"$func_quote_portable_result\"
;;
- *) ;;
esac
}
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-# i) func_quote_for_eval_result
-# double-quoted, suitable for a subsequent eval
-# ii) func_quote_for_eval_unquoted_result
-# has all characters that are still active within double
-# quotes backslashified.
-func_quote_for_eval ()
-{
- $debug_cmd
-
- func_quote_for_eval_unquoted_result=
- func_quote_for_eval_result=
- while test 0 -lt $#; do
- func_quote "$1"
- _G_unquoted_arg=$func_quote_result
- if test -n "$func_quote_for_eval_unquoted_result"; then
- func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
- else
- func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
- fi
-
- case $_G_unquoted_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and variable expansion
- # for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- _G_quoted_arg=\"$_G_unquoted_arg\"
+# func_quotefast_eval ARG
+# -----------------------
+# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
+# but optimized for speed. Result is stored in $func_quotefast_eval.
+if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
+ printf -v _GL_test_printf_tilde %q '~'
+ if test '\~' = "$_GL_test_printf_tilde"; then
+ func_quotefast_eval ()
+ {
+ printf -v func_quotefast_eval_result %q "$1"
+ }
+ else
+ # Broken older Bash implementations. Make those faster too if possible.
+ func_quotefast_eval ()
+ {
+ case $1 in
+ '~'*)
+ func_quote_portable false "$1"
+ func_quotefast_eval_result=$func_quote_portable_result
;;
*)
- _G_quoted_arg=$_G_unquoted_arg
- ;;
+ printf -v func_quotefast_eval_result %q "$1"
+ ;;
esac
+ }
+ fi
+else
+ func_quotefast_eval ()
+ {
+ func_quote_portable false "$1"
+ func_quotefast_eval_result=$func_quote_portable_result
+ }
+fi
- if test -n "$func_quote_for_eval_result"; then
- func_append func_quote_for_eval_result " $_G_quoted_arg"
- else
- func_append func_quote_for_eval_result "$_G_quoted_arg"
- fi
- shift
- done
-}
-
-
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
- $debug_cmd
- case $1 in
- *[\\\`\"]*)
- _G_arg=`$ECHO "$1" | $SED \
- -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- _G_arg=$1 ;;
+# func_quote_arg MODEs ARG
+# ------------------------
+# Quote one ARG to be evaled later. MODEs argument may contain zero or more
+# specifiers listed below separated by ',' character. This function returns two
+# values:
+# i) func_quote_arg_result
+# double-quoted (when needed), suitable for a subsequent eval
+# ii) func_quote_arg_unquoted_result
+# has all characters that are still active within double
+# quotes backslashified. Available only if 'unquoted' is specified.
+#
+# Available modes:
+# ----------------
+# 'eval' (default)
+# - escape shell special characters
+# 'expand'
+# - the same as 'eval'; but do not quote variable references
+# 'pretty'
+# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
+# be used later in func_quote to get output like: 'echo "a b"' instead
+# of 'echo a\ b'. This is slower than default on some shells.
+# 'unquoted'
+# - produce also $func_quote_arg_unquoted_result which does not contain
+# wrapping double-quotes.
+#
+# Examples for 'func_quote_arg pretty,unquoted string':
+#
+# string | *_result | *_unquoted_result
+# ------------+-----------------------+-------------------
+# " | \" | \"
+# a b | "a b" | a b
+# "a b" | "\"a b\"" | \"a b\"
+# * | "*" | *
+# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
+#
+# Examples for 'func_quote_arg pretty,unquoted,expand string':
+#
+# string | *_result | *_unquoted_result
+# --------------+---------------------+--------------------
+# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
+func_quote_arg ()
+{
+ _G_quote_expand=false
+ case ,$1, in
+ *,expand,*)
+ _G_quote_expand=:
+ ;;
esac
- case $_G_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting and command substitution for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- _G_arg=\"$_G_arg\"
+ case ,$1, in
+ *,pretty,*|*,expand,*|*,unquoted,*)
+ func_quote_portable $_G_quote_expand "$2"
+ func_quote_arg_result=$func_quote_portable_result
+ func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
+ ;;
+ *)
+ # Faster quote-for-eval for some shells.
+ func_quotefast_eval "$2"
+ func_quote_arg_result=$func_quotefast_eval_result
;;
esac
+}
+
- func_quote_for_expand_result=$_G_arg
+# func_quote MODEs ARGs...
+# ------------------------
+# Quote all ARGs to be evaled later and join them into single command. See
+# func_quote_arg's description for more info.
+func_quote ()
+{
+ $debug_cmd
+ _G_func_quote_mode=$1 ; shift
+ func_quote_result=
+ while test 0 -lt $#; do
+ func_quote_arg "$_G_func_quote_mode" "$1"
+ if test -n "$func_quote_result"; then
+ func_append func_quote_result " $func_quote_arg_result"
+ else
+ func_append func_quote_result "$func_quote_arg_result"
+ fi
+ shift
+ done
}
@@ -1262,8 +1376,8 @@ func_show_eval ()
_G_cmd=$1
_G_fail_exp=${2-':'}
- func_quote_for_expand "$_G_cmd"
- eval "func_notquiet $func_quote_for_expand_result"
+ func_quote_arg pretty,expand "$_G_cmd"
+ eval "func_notquiet $func_quote_arg_result"
$opt_dry_run || {
eval "$_G_cmd"
@@ -1288,8 +1402,8 @@ func_show_eval_locale ()
_G_fail_exp=${2-':'}
$opt_quiet || {
- func_quote_for_expand "$_G_cmd"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$_G_cmd"
+ eval "func_echo $func_quote_arg_result"
}
$opt_dry_run || {
@@ -1416,30 +1530,26 @@ func_lt_ver ()
# End:
#! /bin/sh
-# Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
-
# A portable, pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010
-# Copyright (C) 2010-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This is free software. There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
+# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it. See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
-# Please report bugs or propose patches to gary@gnu.org.
+# Set a version string for this script.
+scriptversion=2019-02-19.15; # UTC
## ------ ##
@@ -1462,7 +1572,7 @@ scriptversion=2014-01-07.03; # UTC
#
# In order for the '--version' option to work, you will need to have a
# suitably formatted comment like the one at the top of this file
-# starting with '# Written by ' and ending with '# warranty; '.
+# starting with '# Written by ' and ending with '# Copyright'.
#
# For '-h' and '--help' to work, you will also need a one line
# description of your script's purpose in a comment directly above the
@@ -1474,7 +1584,7 @@ scriptversion=2014-01-07.03; # UTC
# to display verbose messages only when your user has specified
# '--verbose'.
#
-# After sourcing this file, you can plug processing for additional
+# After sourcing this file, you can plug in processing for additional
# options by amending the variables from the 'Configuration' section
# below, and following the instructions in the 'Option parsing'
# section further down.
@@ -1523,8 +1633,8 @@ fatal_help="Try '\$progname --help' for more information."
## ------------------------- ##
# This section contains functions for adding, removing, and running hooks
-# to the main code. A hook is just a named list of of function, that can
-# be run in order later on.
+# in the main code. A hook is just a list of function names that can be
+# run in order later on.
# func_hookable FUNC_NAME
# -----------------------
@@ -1557,7 +1667,8 @@ func_add_hook ()
# func_remove_hook FUNC_NAME HOOK_FUNC
# ------------------------------------
-# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+# Remove HOOK_FUNC from the list of hook functions to be called by
+# FUNC_NAME.
func_remove_hook ()
{
$debug_cmd
@@ -1566,10 +1677,28 @@ func_remove_hook ()
}
+# func_propagate_result FUNC_NAME_A FUNC_NAME_B
+# ---------------------------------------------
+# If the *_result variable of FUNC_NAME_A _is set_, assign its value to
+# *_result variable of FUNC_NAME_B.
+func_propagate_result ()
+{
+ $debug_cmd
+
+ func_propagate_result_result=:
+ if eval "test \"\${${1}_result+set}\" = set"
+ then
+ eval "${2}_result=\$${1}_result"
+ else
+ func_propagate_result_result=false
+ fi
+}
+
+
# func_run_hooks FUNC_NAME [ARG]...
# ---------------------------------
# Run all hook functions registered to FUNC_NAME.
-# It is assumed that the list of hook functions contains nothing more
+# It's assumed that the list of hook functions contains nothing more
# than a whitespace-delimited list of legal shell function names, and
# no effort is wasted trying to catch shell meta-characters or preserve
# whitespace.
@@ -1579,22 +1708,19 @@ func_run_hooks ()
case " $hookable_fns " in
*" $1 "*) ;;
- *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+ *) func_fatal_error "'$1' does not support hook functions." ;;
esac
eval _G_hook_fns=\$$1_hooks; shift
for _G_hook in $_G_hook_fns; do
- eval $_G_hook '"$@"'
-
- # store returned options list back into positional
- # parameters for next 'cmd' execution.
- eval _G_hook_result=\$${_G_hook}_result
- eval set dummy "$_G_hook_result"; shift
+ func_unset "${_G_hook}_result"
+ eval $_G_hook '${1+"$@"}'
+ func_propagate_result $_G_hook func_run_hooks
+ if $func_propagate_result_result; then
+ eval set dummy "$func_run_hooks_result"; shift
+ fi
done
-
- func_quote_for_eval ${1+"$@"}
- func_run_hooks_result=$func_quote_for_eval_result
}
@@ -1604,10 +1730,18 @@ func_run_hooks ()
## --------------- ##
# In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
-# options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'. Like this:
+# full positional parameter list from your hook function. You may remove
+# or edit any options that you action, and then pass back the remaining
+# unprocessed options in '<hooked_function_name>_result', escaped
+# suitably for 'eval'.
+#
+# The '<hooked_function_name>_result' variable is automatically unset
+# before your hook gets called; for best performance, only set the
+# *_result variable when necessary (i.e. don't call the 'func_quote'
+# function unnecessarily because it can be an expensive operation on some
+# machines).
+#
+# Like this:
#
# my_options_prep ()
# {
@@ -1617,9 +1751,8 @@ func_run_hooks ()
# usage_message=$usage_message'
# -s, --silent don'\''t print informational messages
# '
-#
-# func_quote_for_eval ${1+"$@"}
-# my_options_prep_result=$func_quote_for_eval_result
+# # No change in '$@' (ignored completely by this hook). Leave
+# # my_options_prep_result variable intact.
# }
# func_add_hook func_options_prep my_options_prep
#
@@ -1628,25 +1761,36 @@ func_run_hooks ()
# {
# $debug_cmd
#
-# # Note that for efficiency, we parse as many options as we can
+# args_changed=false
+#
+# # Note that, for efficiency, we parse as many options as we can
# # recognise in a loop before passing the remainder back to the
# # caller on the first unrecognised argument we encounter.
# while test $# -gt 0; do
# opt=$1; shift
# case $opt in
-# --silent|-s) opt_silent=: ;;
+# --silent|-s) opt_silent=:
+# args_changed=:
+# ;;
# # Separate non-argument short options:
# -s*) func_split_short_opt "$_G_opt"
# set dummy "$func_split_short_opt_name" \
# "-$func_split_short_opt_arg" ${1+"$@"}
# shift
+# args_changed=:
# ;;
-# *) set dummy "$_G_opt" "$*"; shift; break ;;
+# *) # Make sure the first unrecognised option "$_G_opt"
+# # is added back to "$@" in case we need it later,
+# # if $args_changed was set to 'true'.
+# set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
# esac
# done
#
-# func_quote_for_eval ${1+"$@"}
-# my_silent_option_result=$func_quote_for_eval_result
+# # Only call 'func_quote' here if we processed at least one argument.
+# if $args_changed; then
+# func_quote eval ${1+"$@"}
+# my_silent_option_result=$func_quote_result
+# fi
# }
# func_add_hook func_parse_options my_silent_option
#
@@ -1657,17 +1801,26 @@ func_run_hooks ()
#
# $opt_silent && $opt_verbose && func_fatal_help "\
# '--silent' and '--verbose' options are mutually exclusive."
-#
-# func_quote_for_eval ${1+"$@"}
-# my_option_validation_result=$func_quote_for_eval_result
# }
# func_add_hook func_validate_options my_option_validation
#
-# You'll alse need to manually amend $usage_message to reflect the extra
+# You'll also need to manually amend $usage_message to reflect the extra
# options you parse. It's preferable to append if you can, so that
# multiple option parsing hooks can be added safely.
+# func_options_finish [ARG]...
+# ----------------------------
+# Finishing the option parse loop (call 'func_options' hooks ATM).
+func_options_finish ()
+{
+ $debug_cmd
+
+ func_run_hooks func_options ${1+"$@"}
+ func_propagate_result func_run_hooks func_options_finish
+}
+
+
# func_options [ARG]...
# ---------------------
# All the functions called inside func_options are hookable. See the
@@ -1677,17 +1830,27 @@ func_options ()
{
$debug_cmd
- func_options_prep ${1+"$@"}
- eval func_parse_options \
- ${func_options_prep_result+"$func_options_prep_result"}
- eval func_validate_options \
- ${func_parse_options_result+"$func_parse_options_result"}
+ _G_options_quoted=false
- eval func_run_hooks func_options \
- ${func_validate_options_result+"$func_validate_options_result"}
+ for my_func in options_prep parse_options validate_options options_finish
+ do
+ func_unset func_${my_func}_result
+ func_unset func_run_hooks_result
+ eval func_$my_func '${1+"$@"}'
+ func_propagate_result func_$my_func func_options
+ if $func_propagate_result_result; then
+ eval set dummy "$func_options_result"; shift
+ _G_options_quoted=:
+ fi
+ done
- # save modified positional parameters for caller
- func_options_result=$func_run_hooks_result
+ $_G_options_quoted || {
+ # As we (func_options) are top-level options-parser function and
+ # nobody quoted "$@" for us yet, we need to do it explicitly for
+ # caller.
+ func_quote eval ${1+"$@"}
+ func_options_result=$func_quote_result
+ }
}
@@ -1696,9 +1859,8 @@ func_options ()
# All initialisations required before starting the option parse loop.
# Note that when calling hook functions, we pass through the list of
# positional parameters. If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
-# modified list must be put in 'func_run_hooks_result' before
-# returning.
+# needs to propagate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before returning.
func_hookable func_options_prep
func_options_prep ()
{
@@ -1709,9 +1871,7 @@ func_options_prep ()
opt_warning_types=
func_run_hooks func_options_prep ${1+"$@"}
-
- # save modified positional parameters for caller
- func_options_prep_result=$func_run_hooks_result
+ func_propagate_result func_run_hooks func_options_prep
}
@@ -1723,25 +1883,32 @@ func_parse_options ()
{
$debug_cmd
- func_parse_options_result=
-
+ _G_parse_options_requote=false
# this just eases exit handling
while test $# -gt 0; do
# Defer to hook functions for initial option parsing, so they
# get priority in the event of reusing an option name.
func_run_hooks func_parse_options ${1+"$@"}
-
- # Adjust func_parse_options positional parameters to match
- eval set dummy "$func_run_hooks_result"; shift
+ func_propagate_result func_run_hooks func_parse_options
+ if $func_propagate_result_result; then
+ eval set dummy "$func_parse_options_result"; shift
+ # Even though we may have changed "$@", we passed the "$@" array
+ # down into the hook and it quoted it for us (because we are in
+ # this if-branch). No need to quote it again.
+ _G_parse_options_requote=false
+ fi
# Break out of the loop if we already parsed every option.
test $# -gt 0 || break
+ # We expect that one of the options parsed in this function matches
+ # and thus we remove _G_opt from "$@" and need to re-quote.
+ _G_match_parse_options=:
_G_opt=$1
shift
case $_G_opt in
--debug|-x) debug_cmd='set -x'
- func_echo "enabling shell trace mode"
+ func_echo "enabling shell trace mode" >&2
$debug_cmd
;;
@@ -1751,7 +1918,10 @@ func_parse_options ()
;;
--warnings|--warning|-W)
- test $# = 0 && func_missing_arg $_G_opt && break
+ if test $# = 0 && func_missing_arg $_G_opt; then
+ _G_parse_options_requote=:
+ break
+ fi
case " $warning_categories $1" in
*" $1 "*)
# trailing space prevents matching last $1 above
@@ -1804,15 +1974,24 @@ func_parse_options ()
shift
;;
- --) break ;;
+ --) _G_parse_options_requote=: ; break ;;
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ *) set dummy "$_G_opt" ${1+"$@"}; shift
+ _G_match_parse_options=false
+ break
+ ;;
esac
+
+ if $_G_match_parse_options; then
+ _G_parse_options_requote=:
+ fi
done
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- func_parse_options_result=$func_quote_for_eval_result
+ if $_G_parse_options_requote; then
+ # save modified positional parameters for caller
+ func_quote eval ${1+"$@"}
+ func_parse_options_result=$func_quote_result
+ fi
}
@@ -1829,12 +2008,10 @@ func_validate_options ()
test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
func_run_hooks func_validate_options ${1+"$@"}
+ func_propagate_result func_run_hooks func_validate_options
# Bail if the options were screwed!
$exit_cmd $EXIT_FAILURE
-
- # save modified positional parameters for caller
- func_validate_options_result=$func_run_hooks_result
}
@@ -1890,8 +2067,8 @@ func_missing_arg ()
# func_split_equals STRING
# ------------------------
-# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-# splitting STRING at the '=' sign.
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables
+# after splitting STRING at the '=' sign.
test -z "$_G_HAVE_XSI_OPS" \
&& (eval 'x=a/b/c;
test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
@@ -1906,8 +2083,9 @@ then
func_split_equals_lhs=${1%%=*}
func_split_equals_rhs=${1#*=}
- test "x$func_split_equals_lhs" = "x$1" \
- && func_split_equals_rhs=
+ if test "x$func_split_equals_lhs" = "x$1"; then
+ func_split_equals_rhs=
+ fi
}'
else
# ...otherwise fall back to using expr, which is often a shell builtin.
@@ -1917,7 +2095,7 @@ else
func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
func_split_equals_rhs=
- test "x$func_split_equals_lhs" = "x$1" \
+ test "x$func_split_equals_lhs=" = "x$1" \
|| func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
}
fi #func_split_equals
@@ -1943,7 +2121,7 @@ else
{
$debug_cmd
- func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+ func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'`
func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
}
fi #func_split_short_opt
@@ -1985,31 +2163,44 @@ func_usage_message ()
# func_version
# ------------
# Echo version message to standard output and exit.
+# The version message is extracted from the calling file's header
+# comments, with leading '# ' stripped:
+# 1. First display the progname and version
+# 2. Followed by the header comment line matching /^# Written by /
+# 3. Then a blank line followed by the first following line matching
+# /^# Copyright /
+# 4. Immediately followed by any lines between the previous matches,
+# except lines preceding the intervening completely blank line.
+# For example, see the header comments of this file.
func_version ()
{
$debug_cmd
printf '%s\n' "$progname $scriptversion"
$SED -n '
- /(C)/!b go
- :more
- /\./!{
- N
- s|\n# | |
- b more
- }
- :go
- /^# Written by /,/# warranty; / {
- s|^# ||
- s|^# *$||
- s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
- p
+ /^# Written by /!b
+ s|^# ||; p; n
+
+ :fwd2blnk
+ /./ {
+ n
+ b fwd2blnk
}
- /^# Written by / {
- s|^# ||
- p
+ p; n
+
+ :holdwrnt
+ s|^# ||
+ s|^# *$||
+ /^Copyright /!{
+ /./H
+ n
+ b holdwrnt
}
- /^warranty; /q' < "$progpath"
+
+ s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+ G
+ s|\(\n\)\n*|\1|g
+ p; q' < "$progpath"
exit $?
}
@@ -2019,12 +2210,35 @@ func_version ()
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-time-zone: "UTC"
# End:
# Set a version string.
-scriptversion='(GNU libtool) 2.4.6'
+scriptversion='(GNU libtool) 2.5.4'
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $debug_cmd
+
+ year=`date +%Y`
+
+ cat <<EOF
+$progname $scriptversion
+Copyright (C) $year Free Software Foundation, Inc.
+License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Originally written by Gordon Matzigkeit, 1996
+(See AUTHORS for complete contributor listing)
+EOF
+
+ exit $?
+}
# func_echo ARG...
@@ -2047,18 +2261,6 @@ func_echo ()
}
-# func_warning ARG...
-# -------------------
-# Libtool warnings are not categorized, so override funclib.sh
-# func_warning with this simpler definition.
-func_warning ()
-{
- $debug_cmd
-
- $warning_func ${1+"$@"}
-}
-
-
## ---------------- ##
## Options parsing. ##
## ---------------- ##
@@ -2070,19 +2272,23 @@ usage='$progpath [OPTION]... [MODE-ARG]...'
# Short help message in response to '-h'.
usage_message="Options:
- --config show all configuration variables
- --debug enable verbose shell tracing
- -n, --dry-run display commands without modifying any files
- --features display basic configuration information and exit
- --mode=MODE use operation mode MODE
- --no-warnings equivalent to '-Wnone'
- --preserve-dup-deps don't remove duplicate dependency libraries
- --quiet, --silent don't print informational messages
- --tag=TAG use configuration variables from tag TAG
- -v, --verbose print more informational messages than default
- --version print version information
- -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
- -h, --help, --help-all print short, long, or detailed help message
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+ -n, --dry-run display commands without modifying any files
+ --features display basic configuration information
+ --finish use operation '--mode=finish'
+ --mode=MODE use operation mode MODE
+ --no-finish don't update shared library cache
+ --no-quiet, --no-silent print default informational messages
+ --no-warnings equivalent to '-Wnone'
+ --preserve-dup-deps don't remove duplicate dependency libraries
+ --quiet, --silent don't print informational messages
+ --reorder-cache=DIRS reorder shared library cache for preferred DIRS
+ --tag=TAG use configuration variables from tag TAG
+ -v, --verbose print more informational messages than default
+ --version print version information
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
+ -h, --help, --help-all print short, long, or detailed help message
"
# Additional text appended to 'usage_message' in response to '--help'.
@@ -2115,13 +2321,13 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
- version: $progname (GNU libtool) 2.4.6
+ version: $progname $scriptversion
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Report bugs to <bug-libtool@gnu.org>.
-GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-General help using GNU software: <http://www.gnu.org/gethelp/>."
+GNU libtool home page: <https://www.gnu.org/software/libtool/>.
+General help using GNU software: <https://www.gnu.org/gethelp/>."
exit 0
}
@@ -2171,7 +2377,7 @@ fi
# a configuration failure hint, and exit.
func_fatal_configuration ()
{
- func__fatal_error ${1+"$@"} \
+ func_fatal_error ${1+"$@"} \
"See the $PACKAGE documentation for more information." \
"Fatal configuration error."
}
@@ -2311,12 +2517,17 @@ libtool_options_prep ()
opt_dry_run=false
opt_help=false
opt_mode=
+ opt_reorder_cache=false
opt_preserve_dup_deps=false
opt_quiet=false
+ opt_finishing=true
+ opt_warning=
nonopt=
preserve_args=
+ _G_rc_lt_options_prep=:
+
# Shorthand for --mode=foo, only valid as the first argument
case $1 in
clean|clea|cle|cl)
@@ -2340,11 +2551,16 @@ libtool_options_prep ()
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
shift; set dummy --mode uninstall ${1+"$@"}; shift
;;
+ *)
+ _G_rc_lt_options_prep=false
+ ;;
esac
- # Pass back the list of options.
- func_quote_for_eval ${1+"$@"}
- libtool_options_prep_result=$func_quote_for_eval_result
+ if $_G_rc_lt_options_prep; then
+ # Pass back the list of options.
+ func_quote eval ${1+"$@"}
+ libtool_options_prep_result=$func_quote_result
+ fi
}
func_add_hook func_options_prep libtool_options_prep
@@ -2356,9 +2572,12 @@ libtool_parse_options ()
{
$debug_cmd
+ _G_rc_lt_parse_options=false
+
# Perform our own loop to consume as many options as possible in
# each iteration.
while test $# -gt 0; do
+ _G_match_lt_parse_options=:
_G_opt=$1
shift
case $_G_opt in
@@ -2392,14 +2611,18 @@ libtool_parse_options ()
clean|compile|execute|finish|install|link|relink|uninstall) ;;
# Catch anything else as an error
- *) func_error "invalid argument for $_G_opt"
+ *) func_error "invalid argument '$1' for $_G_opt"
exit_cmd=exit
- break
;;
esac
shift
;;
+ --no-finish)
+ opt_finishing=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
--no-silent|--no-quiet)
opt_quiet=false
func_append preserve_args " $_G_opt"
@@ -2415,6 +2638,24 @@ libtool_parse_options ()
func_append preserve_args " $_G_opt"
;;
+ --reorder-cache)
+ opt_reorder_cache=true
+ shared_lib_dirs=$1
+ if test -n "$shared_lib_dirs"; then
+ case $1 in
+ # Must begin with /:
+ /*) ;;
+
+ # Catch anything else as an error (relative paths)
+ *) func_error "invalid argument '$1' for $_G_opt"
+ func_error "absolute paths are required for $_G_opt"
+ exit_cmd=exit
+ ;;
+ esac
+ fi
+ shift
+ ;;
+
--silent|--quiet)
opt_quiet=:
opt_verbose=false
@@ -2433,19 +2674,36 @@ libtool_parse_options ()
func_append preserve_args " $_G_opt"
;;
- # An option not handled by this hook function:
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ # An option not handled by this hook function:
+ *) set dummy "$_G_opt" ${1+"$@"} ; shift
+ _G_match_lt_parse_options=false
+ break
+ ;;
esac
+ $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
done
-
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- libtool_parse_options_result=$func_quote_for_eval_result
+ if $_G_rc_lt_parse_options; then
+ # save modified positional parameters for caller
+ func_quote eval ${1+"$@"}
+ libtool_parse_options_result=$func_quote_result
+ fi
}
func_add_hook func_parse_options libtool_parse_options
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+ if $opt_warning; then
+ $debug_cmd
+ $warning_func ${1+"$@"}
+ fi
+}
+
# libtool_validate_options [ARG]...
# ---------------------------------
@@ -2462,10 +2720,10 @@ libtool_validate_options ()
# preserve --debug
test : = "$debug_cmd" || func_append preserve_args " --debug"
- case $host in
+ case $host_os in
# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
- *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+ cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*)
# don't eliminate duplications in $postdeps and $predeps
opt_duplicate_compiler_generated_deps=:
;;
@@ -2498,8 +2756,8 @@ libtool_validate_options ()
}
# Pass back the unparsed argument list
- func_quote_for_eval ${1+"$@"}
- libtool_validate_options_result=$func_quote_for_eval_result
+ func_quote eval ${1+"$@"}
+ libtool_validate_options_result=$func_quote_result
}
func_add_hook func_validate_options libtool_validate_options
@@ -2797,7 +3055,7 @@ EOF
# func_convert_core_file_wine_to_w32 ARG
# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# and $host is mingw, windows, cygwin, or some other w32 environment. Relies on a
# correctly configured wine environment available, with the winepath program
# in $build's $PATH.
#
@@ -2829,9 +3087,10 @@ func_convert_core_file_wine_to_w32 ()
# func_convert_core_path_wine_to_w32 ARG
# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
+# $host is mingw, windows, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH. Assumes ARG has no leading or trailing path separator
+# characters.
#
# ARG is path to be converted from $build format to win32.
# Result is available in $func_convert_core_path_wine_to_w32_result.
@@ -2974,6 +3233,15 @@ func_convert_path_front_back_pathsep ()
# end func_convert_path_front_back_pathsep
+# func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER
+# Replaces a delimiter for a given path.
+func_convert_delimited_path ()
+{
+ converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"`
+}
+# end func_convert_delimited_path
+
+
##################################################
# $build to $host FILE NAME CONVERSION FUNCTIONS #
##################################################
@@ -3308,6 +3576,65 @@ func_dll_def_p ()
}
+# func_reorder_shared_lib_cache DIRS
+# Reorder the shared library cache by unconfiguring previous shared library cache
+# and configuring preferred search directories before previous search directories.
+# Previous shared library cache: /usr/lib /usr/local/lib
+# Preferred search directories: /tmp/testing
+# Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib
+func_reorder_shared_lib_cache ()
+{
+ $debug_cmd
+
+ case $host_os in
+ openbsd*)
+ get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"`
+ func_convert_delimited_path "$get_search_directories" ':' '\ '
+ save_search_directories=$converted_path
+ func_convert_delimited_path "$1" ':' '\ '
+
+ # Ensure directories exist
+ for dir in $converted_path; do
+ # Ensure each directory is an absolute path
+ case $dir in
+ /*) ;;
+ *) func_error "Directory '$dir' is not an absolute path"
+ exit $EXIT_FAILURE ;;
+ esac
+ # Ensure no trailing slashes
+ func_stripname '' '/' "$dir"
+ dir=$func_stripname_result
+ if test -d "$dir"; then
+ if test -n "$preferred_search_directories"; then
+ preferred_search_directories="$preferred_search_directories $dir"
+ else
+ preferred_search_directories=$dir
+ fi
+ else
+ func_error "Directory '$dir' does not exist"
+ exit $EXIT_FAILURE
+ fi
+ done
+
+ PATH="$PATH:/sbin" ldconfig -U $save_search_directories
+ PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories
+ get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"`
+ func_convert_delimited_path "$get_search_directories" ':' '\ '
+ reordered_search_directories=$converted_path
+
+ $ECHO "Original: $save_search_directories"
+ $ECHO "Reordered: $reordered_search_directories"
+ exit $EXIT_SUCCESS
+ ;;
+ *)
+ func_error "--reorder-cache is not supported for host_os=$host_os."
+ exit $EXIT_FAILURE
+ ;;
+ esac
+}
+# end func_reorder_shared_lib_cache
+
+
# func_mode_compile arg...
func_mode_compile ()
{
@@ -3465,8 +3792,8 @@ func_mode_compile ()
esac
done
- func_quote_for_eval "$libobj"
- test "X$libobj" != "X$func_quote_for_eval_result" \
+ func_quote_arg pretty "$libobj"
+ test "X$libobj" != "X$func_quote_arg_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
&& func_warning "libobj name '$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" ""
@@ -3486,7 +3813,7 @@ func_mode_compile ()
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
- cygwin* | mingw* | pw32* | os2* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | os2* | cegcc*)
pic_mode=default
;;
esac
@@ -3539,8 +3866,8 @@ compiler."
func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
srcfile=$func_to_tool_file_result
- func_quote_for_eval "$srcfile"
- qsrcfile=$func_quote_for_eval_result
+ func_quote_arg pretty "$srcfile"
+ qsrcfile=$func_quote_arg_result
# Only build a PIC object if we are building libtool libraries.
if test yes = "$build_libtool_libs"; then
@@ -3695,7 +4022,8 @@ This mode accepts the following additional options:
-prefer-non-pic try to build non-PIC objects only
-shared do not build a '.o' file suitable for static linking
-static only build a '.o' file suitable for static linking
- -Wc,FLAG pass FLAG directly to the compiler
+ -Wc,FLAG
+ -Xcompiler FLAG pass FLAG directly to the compiler
COMPILE-COMMAND is a command to be used in creating a 'standard' object file
from the given SOURCEFILE.
@@ -3801,6 +4129,8 @@ The following components of LINK-COMMAND are treated specially:
-weak LIBNAME declare that the target provides the LIBNAME interface
-Wc,FLAG
-Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wa,FLAG
+ -Xassembler FLAG pass linker-specific FLAG directly to the assembler
-Wl,FLAG
-Xlinker FLAG pass linker-specific FLAG directly to the linker
-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
@@ -3877,6 +4207,12 @@ if $opt_help; then
fi
+# If option '--reorder-cache', reorder the shared library cache and exit.
+if $opt_reorder_cache; then
+ func_reorder_shared_lib_cache $shared_lib_dirs
+fi
+
+
# func_mode_execute arg...
func_mode_execute ()
{
@@ -4061,7 +4397,7 @@ func_mode_finish ()
fi
fi
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
@@ -4086,6 +4422,12 @@ func_mode_finish ()
for libdir in $libdirs; do
$ECHO " $libdir"
done
+ if test "false" = "$opt_finishing"; then
+ echo
+ echo "NOTE: finish_cmds were not executed during testing, so you must"
+ echo "manually run ldconfig to add a given test directory, LIBDIR, to"
+ echo "the search path for generated executables."
+ fi
echo
echo "If you ever happen to want to link against installed libraries"
echo "in a given directory, LIBDIR, you must either use libtool, and"
@@ -4143,8 +4485,8 @@ func_mode_install ()
case $nonopt in *shtool*) :;; *) false;; esac
then
# Aesthetically quote it.
- func_quote_for_eval "$nonopt"
- install_prog="$func_quote_for_eval_result "
+ func_quote_arg pretty "$nonopt"
+ install_prog="$func_quote_arg_result "
arg=$1
shift
else
@@ -4154,8 +4496,8 @@ func_mode_install ()
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
- func_quote_for_eval "$arg"
- func_append install_prog "$func_quote_for_eval_result"
+ func_quote_arg pretty "$arg"
+ func_append install_prog "$func_quote_arg_result"
install_shared_prog=$install_prog
case " $install_prog " in
*[\\\ /]cp\ *) install_cp=: ;;
@@ -4212,12 +4554,12 @@ func_mode_install ()
esac
# Aesthetically quote the argument.
- func_quote_for_eval "$arg"
- func_append install_prog " $func_quote_for_eval_result"
+ func_quote_arg pretty "$arg"
+ func_append install_prog " $func_quote_arg_result"
if test -n "$arg2"; then
- func_quote_for_eval "$arg2"
+ func_quote_arg pretty "$arg2"
fi
- func_append install_shared_prog " $func_quote_for_eval_result"
+ func_append install_shared_prog " $func_quote_arg_result"
done
test -z "$install_prog" && \
@@ -4228,8 +4570,8 @@ func_mode_install ()
if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else
- func_quote_for_eval "$install_override_mode"
- func_append install_shared_prog " -m $func_quote_for_eval_result"
+ func_quote_arg pretty "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_arg_result"
fi
fi
@@ -4322,8 +4664,15 @@ func_mode_install ()
func_append dir "$objdir"
if test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$libdir"
+ destlibdir=$func_stripname_result
+
+ func_stripname '' '/' "$destdir"
+ s_destdir=$func_stripname_result
+
# Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
@@ -4360,7 +4709,7 @@ func_mode_install ()
'exit $?'
tstripme=$stripme
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
case $realname in
*.dll.a)
tstripme=
@@ -4473,7 +4822,7 @@ func_mode_install ()
# Do a test to see if this is really a libtool program.
case $host in
- *cygwin* | *mingw*)
+ *cygwin* | *mingw* | *windows*)
if func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
wrapper=$func_ltwrapper_scriptname_result
@@ -4525,8 +4874,8 @@ func_mode_install ()
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
$opt_quiet || {
- func_quote_for_expand "$relink_command"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$relink_command"
+ eval "func_echo $func_quote_arg_result"
}
if eval "$relink_command"; then :
else
@@ -4701,7 +5050,7 @@ extern \"C\" {
$RM $export_symbols
eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
;;
@@ -4713,7 +5062,7 @@ extern \"C\" {
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
;;
@@ -4727,7 +5076,7 @@ extern \"C\" {
func_basename "$dlprefile"
name=$func_basename_result
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
# if an import library, we need to obtain dlname
if func_win32_import_lib_p "$dlprefile"; then
func_tr_sh "$dlprefile"
@@ -4753,8 +5102,16 @@ extern \"C\" {
eval '$ECHO ": $name " >> "$nlist"'
fi
func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
- $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ case $host in
+ i[3456]86-*-mingw32*)
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ ;;
+ *)
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'"
+ ;;
+ esac
}
else # not an import lib
$opt_dry_run || {
@@ -4902,7 +5259,7 @@ static const void *lt_preloaded_setup() {
# Transform the symbol file into the correct name.
symfileobj=$output_objdir/${my_outputname}S.$objext
case $host in
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
if test -f "$output_objdir/$my_outputname.def"; then
compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
@@ -4978,7 +5335,7 @@ func_win32_libid ()
*ar\ archive*) # could be an import, or static
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then
case $nm_interface in
"MS dumpbin")
if func_cygming_ms_implib_p "$1" ||
@@ -5245,7 +5602,7 @@ func_extract_archives ()
#
# Emit a libtool wrapper script on stdout.
# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
+# incorporate the script contents within a cygwin/mingw/windows
# wrapper executable. Must ONLY be called from within
# func_mode_link because it depends on a number of variables
# set therein.
@@ -5253,7 +5610,7 @@ func_extract_archives ()
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
# variable will take. If 'yes', then the emitted script
# will assume that the directory where it is stored is
-# the $objdir directory. This is a cygwin/mingw-specific
+# the $objdir directory. This is a cygwin/mingw/windows-specific
# behavior.
func_emit_wrapper ()
{
@@ -5305,8 +5662,8 @@ else
if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\""
- func_quote "$ECHO"
- qECHO=$func_quote_result
+ func_quote_arg pretty "$ECHO"
+ qECHO=$func_quote_arg_result
$ECHO "\
# A function that is used when there is no print builtin or printf.
@@ -5316,7 +5673,7 @@ func_fallback_echo ()
\$1
_LTECHO_EOF'
}
- ECHO=\"$qECHO\"
+ ECHO=$qECHO
fi
# Very basic option parsing. These options are (a) specific to
@@ -5378,7 +5735,7 @@ func_exec_program_core ()
"
case $host in
# Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2* | *-cegcc*)
+ *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*)
$ECHO "\
if test -n \"\$lt_option_debug\"; then
\$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
@@ -5446,7 +5803,7 @@ func_exec_program ()
file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
done
- # Usually 'no', except on cygwin/mingw when embedded into
+ # Usually 'no', except on cygwin/mingw/windows when embedded into
# the cwrapper.
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
@@ -5578,7 +5935,7 @@ EOF
#endif
#include <stdio.h>
#include <stdlib.h>
-#ifdef _MSC_VER
+#if defined _WIN32 && !defined __GNUC__
# include <direct.h>
# include <process.h>
# include <io.h>
@@ -5603,7 +5960,7 @@ EOF
/* declarations of non-ANSI functions */
#if defined __MINGW32__
# ifdef __STRICT_ANSI__
-int _putenv (const char *);
+_CRTIMP int __cdecl _putenv (const char *);
# endif
#elif defined __CYGWIN__
# ifdef __STRICT_ANSI__
@@ -5801,7 +6158,7 @@ main (int argc, char *argv[])
{
EOF
case $host in
- *mingw* | *cygwin* )
+ *mingw* | *windows* | *cygwin* )
# make stdout use "unix" line endings
echo " setmode(1,_O_BINARY);"
;;
@@ -5820,7 +6177,7 @@ EOF
{
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
+ have already dealt with, above (including dump-script), then
report an error. Otherwise, targets might begin to believe
they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
namespace. The first time any user complains about this, we'll
@@ -5904,7 +6261,7 @@ EOF
EOF
case $host_os in
- mingw*)
+ mingw* | windows*)
cat <<"EOF"
{
char* p;
@@ -5946,7 +6303,7 @@ EOF
EOF
case $host_os in
- mingw*)
+ mingw* | windows*)
cat <<"EOF"
/* execv doesn't actually work on mingw as expected on unix */
newargz = prepare_spawn (newargz);
@@ -6365,7 +6722,7 @@ lt_update_lib_path (const char *name, const char *value)
EOF
case $host_os in
- mingw*)
+ mingw* | windows*)
cat <<"EOF"
/* Prepares an argument vector before calling spawn().
@@ -6540,7 +6897,7 @@ func_mode_link ()
$debug_cmd
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# what system we are compiling for in order to pass an extra
@@ -6564,6 +6921,7 @@ func_mode_link ()
finalize_command=$nonopt
compile_rpath=
+ compile_rpath_tail=
finalize_rpath=
compile_shlibpath=
finalize_shlibpath=
@@ -6604,10 +6962,12 @@ func_mode_link ()
xrpath=
perm_rpath=
temp_rpath=
+ temp_rpath_tail=
thread_safe=no
vinfo=
vinfo_number=no
weak_libs=
+ rpath_arg=
single_module=$wl-single_module
func_infer_tag $base_compile
@@ -6659,9 +7019,9 @@ func_mode_link ()
while test "$#" -gt 0; do
arg=$1
shift
- func_quote_for_eval "$arg"
- qarg=$func_quote_for_eval_unquoted_result
- func_append libtool_args " $func_quote_for_eval_result"
+ func_quote_arg pretty,unquoted "$arg"
+ qarg=$func_quote_arg_unquoted_result
+ func_append libtool_args " $func_quote_arg_result"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
@@ -6870,7 +7230,7 @@ func_mode_link ()
case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
- func_fatal_error "only absolute run-paths are allowed"
+ func_fatal_error "argument to -rpath is not absolute: $arg"
;;
esac
if test rpath = "$prev"; then
@@ -6897,6 +7257,13 @@ func_mode_link ()
prev=
continue
;;
+ xassembler)
+ func_append compiler_flags " -Xassembler $qarg"
+ prev=
+ func_append compile_command " -Xassembler $qarg"
+ func_append finalize_command " -Xassembler $qarg"
+ continue
+ ;;
xcclinker)
func_append linker_flags " $qarg"
func_append compiler_flags " $qarg"
@@ -7039,7 +7406,7 @@ func_mode_link ()
;;
esac
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$dir:"*) ;;
@@ -7059,7 +7426,7 @@ func_mode_link ()
-l*)
if test X-lc = "X$arg" || test X-lm = "X$arg"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
# These systems don't actually have a C or math library (as such)
continue
;;
@@ -7067,7 +7434,7 @@ func_mode_link ()
# These systems don't actually have a C library (as such)
test X-lc = "X$arg" && continue
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
# Do not include libc due to us having libc/libc_r.
test X-lc = "X$arg" && continue
;;
@@ -7087,7 +7454,7 @@ func_mode_link ()
esac
elif test X-lc_r = "X$arg"; then
case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
@@ -7110,16 +7477,29 @@ func_mode_link ()
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot|--sysroot)
+ # -q <option> for IBM XL C/C++ compiler.
+ -model|-arch|-isysroot|--sysroot|-q)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
prev=xcompiler
continue
;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199.
+ -pthread)
+ case $host in
+ *solaris2*) ;;
+ *)
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+ -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -7152,7 +7532,7 @@ func_mode_link ()
-no-install)
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
# The PATH hackery in wrapper scripts is required on Windows
# and Darwin in order for the loader to find any dlls it needs.
func_warning "'-no-install' is ignored for $host"
@@ -7212,7 +7592,7 @@ func_mode_link ()
dir=$lt_sysroot$func_stripname_result
;;
*)
- func_fatal_error "only absolute run-paths are allowed"
+ func_fatal_error "argument ($arg) to '-R' is not an absolute path: $dir"
;;
esac
case "$xrpath " in
@@ -7269,9 +7649,9 @@ func_mode_link ()
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
- func_quote_for_eval "$flag"
- func_append arg " $func_quote_for_eval_result"
- func_append compiler_flags " $func_quote_for_eval_result"
+ func_quote_arg pretty "$flag"
+ func_append arg " $func_quote_arg_result"
+ func_append compiler_flags " $func_quote_arg_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
@@ -7285,16 +7665,21 @@ func_mode_link ()
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
- func_quote_for_eval "$flag"
- func_append arg " $wl$func_quote_for_eval_result"
- func_append compiler_flags " $wl$func_quote_for_eval_result"
- func_append linker_flags " $func_quote_for_eval_result"
+ func_quote_arg pretty "$flag"
+ func_append arg " $wl$func_quote_arg_result"
+ func_append compiler_flags " $wl$func_quote_arg_result"
+ func_append linker_flags " $func_quote_arg_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
+ -Xassembler)
+ prev=xassembler
+ continue
+ ;;
+
-Xcompiler)
prev=xcompiler
continue
@@ -7312,8 +7697,8 @@ func_mode_link ()
# -msg_* for osf cc
-msg_*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
;;
# Flags to be passed through unchanged, with rationale:
@@ -7332,14 +7717,31 @@ func_mode_link ()
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
+ # -fdiagnostics-color* simply affects output
+ # -frecord-gcc-switches used to verify flags were respected
# -fsanitize=* Clang/GCC memory and address sanitizer
+ # -fno-sanitize* Clang/GCC memory and address sanitizer
+ # -shared-libsan Link with shared sanitizer runtimes (Clang)
+ # -static-libsan Link with static sanitizer runtimes (Clang)
+ # -no-canonical-prefixes Do not expand any symbolic links
# -fuse-ld=* Linker select flags for GCC
+ # -static-* direct GCC to link specific libraries statically
+ # -fcilkplus Cilk Plus language extension features for C/C++
+ # -rtlib=* select c runtime lib with clang
+ # --unwindlib=* select unwinder library with clang
+ # -f{file|debug|macro|profile}-prefix-map=* needed for lto linking
+ # -Wa,* Pass flags directly to the assembler
+ # -Werror, -Werror=* Report (specified) warnings as errors
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
- -specs=*|-fsanitize=*|-fuse-ld=*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \
+ -stdlib=*|-rtlib=*|--unwindlib=*| \
+ -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
+ -ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \
+ -fdiagnostics-color*|-frecord-gcc-switches| \
+ -fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*)
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
func_append compile_command " $arg"
func_append finalize_command " $arg"
func_append compiler_flags " $arg"
@@ -7360,15 +7762,15 @@ func_mode_link ()
continue
else
# Otherwise treat like 'Some other compiler flag' below
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
fi
;;
# Some other compiler flag.
-* | +*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
;;
*.$objext)
@@ -7488,15 +7890,27 @@ func_mode_link ()
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
;;
esac # arg
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
+ if test -n "$rpath_arg"; then
+ func_append finalize_rpath " ${arg##*,}"
+ unset rpath_arg
+ else
+ case $arg in
+ -Wl,-rpath,*)
+ func_append finalize_rpath " ${arg##*,}";;
+ -Wl,-rpath)
+ rpath_arg=1;;
+ *)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ esac
+ fi
fi
done # argument parsing loop
@@ -7667,7 +8081,7 @@ func_mode_link ()
found=false
case $deplib in
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -7844,18 +8258,15 @@ func_mode_link ()
;;
esac
if $valid_a_lib; then
- echo
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
+ func_warning "Linking the shared library $output against the static library $deplib is not portable!"
deplibs="$deplib $deplibs"
else
- echo
- $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because the file extensions .$libext of this argument makes me believe"
- echo "*** that it is just a static archive that I should not use here."
+ func_warning "Trying to link with static lib archive $deplib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have"
+ func_warning "because the file extensions .$libext of this argument makes me believe"
+ func_warning "that it is just a static archive that I should not use here."
fi
;;
esac
@@ -8050,7 +8461,7 @@ func_mode_link ()
fi
case $host in
# special handling for platforms with PE-DLLs.
- *cygwin* | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *windows* | *cegcc* )
# Linker will automatically link against shared library if both
# static and shared are present. Therefore, ensure we extract
# symbols from the import library if a shared library is present
@@ -8150,7 +8561,10 @@ func_mode_link ()
# Make sure the rpath contains only unique directories.
case $temp_rpath: in
*"$absdir:"*) ;;
- *) func_append temp_rpath "$absdir:" ;;
+ *) case $absdir in
+ "$progdir/"*) func_append temp_rpath "$absdir:" ;;
+ *) func_append temp_rpath_tail "$absdir:" ;;
+ esac
esac
fi
@@ -8160,9 +8574,12 @@ func_mode_link ()
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
- case "$compile_rpath " in
+ case "$compile_rpath$compile_rpath_tail " in
*" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
+ *) case $absdir in
+ "$progdir/"*) func_append compile_rpath " $absdir" ;;
+ *) func_append compile_rpath_tail " $absdir" ;;
+ esac
esac
;;
esac
@@ -8193,8 +8610,8 @@ func_mode_link ()
fi
if test -n "$library_names" &&
{ test no = "$use_static_libs" || test -z "$old_library"; }; then
- case $host in
- *cygwin* | *mingw* | *cegcc* | *os2*)
+ case $host_os in
+ cygwin* | mingw* | windows* | cegcc* | os2*)
# No point in relinking DLLs because paths are not encoded
func_append notinst_deplibs " $lib"
need_relink=no
@@ -8220,11 +8637,11 @@ func_mode_link ()
if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
echo
if test prog = "$linkmode"; then
- $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ func_warning "Linking the executable $output against the loadable module"
else
- $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ func_warning "Linking the shared library $output against the loadable module"
fi
- $ECHO "*** $linklib is not portable!"
+ func_warning "$linklib is not portable!"
fi
if test lib = "$linkmode" &&
test yes = "$hardcode_into_libs"; then
@@ -8234,9 +8651,12 @@ func_mode_link ()
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
- case "$compile_rpath " in
+ case "$compile_rpath$compile_rpath_tail " in
*" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
+ *) case $absdir in
+ "$progdir/"*) func_append compile_rpath " $absdir" ;;
+ *) func_append compile_rpath_tail " $absdir" ;;
+ esac
esac
;;
esac
@@ -8263,8 +8683,8 @@ func_mode_link ()
soname=$dlname
elif test -n "$soname_spec"; then
# bleh windows
- case $host in
- *cygwin* | mingw* | *cegcc* | *os2*)
+ case $host_os in
+ cygwin* | mingw* | windows* | cegcc* | os2*)
func_arith $current - $age
major=$func_arith_result
versuffix=-$major
@@ -8311,6 +8731,7 @@ func_mode_link ()
case $host in
*-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
*-*-sysv4*uw2*) add_dir=-L$dir ;;
+ *-*-emscripten*) add_dir=-L$dir ;;
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
*-*-unixware7*) add_dir=-L$dir ;;
*-*-darwin* )
@@ -8319,11 +8740,10 @@ func_mode_link ()
if /usr/bin/file -L $add 2> /dev/null |
$GREP ": [^:]* bundle" >/dev/null; then
if test "X$dlopenmodule" != "X$lib"; then
- $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ func_warning "lib $linklib is a module, not a shared library"
if test -z "$old_library"; then
- echo
- echo "*** And there doesn't seem to be a static archive available"
- echo "*** The link will probably fail, sorry"
+ func_warning "And there doesn't seem to be a static archive available"
+ func_warning "The link will probably fail, sorry"
else
add=$dir/$old_library
fi
@@ -8406,7 +8826,7 @@ func_mode_link ()
test no = "$hardcode_direct_absolute"; then
add=$libdir/$linklib
elif test yes = "$hardcode_minus_L"; then
- add_dir=-L$libdir
+ add_dir=-L$lt_sysroot$libdir
add=-l$name
elif test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
@@ -8423,7 +8843,7 @@ func_mode_link ()
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
- add_dir=-L$libdir
+ add_dir=-L$lt_sysroot$libdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -8463,21 +8883,19 @@ func_mode_link ()
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
- echo
- $ECHO "*** Warning: This system cannot link to static lib archive $lib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ func_warning "This system cannot link to static lib archive $lib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have."
if test yes = "$module"; then
- echo "*** But as you try to build a module library, libtool will still create "
- echo "*** a static module, that should work as long as the dlopening application"
- echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ func_warning "But as you try to build a module library, libtool will still create "
+ func_warning "a static module, that should work as long as the dlopening application"
+ func_warning "is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** 'nm' from GNU binutils and a full rebuild may help."
+ func_warning "However, this would only work if libtool was able to extract symbol"
+ func_warning "lists from a program, using 'nm' or equivalent, but libtool could"
+ func_warning "not find such a program. So, this module is probably useless."
+ func_warning "'nm' from GNU binutils and a full rebuild may help."
fi
if test no = "$build_old_libs"; then
build_libtool_libs=module
@@ -8600,6 +9018,10 @@ func_mode_link ()
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
+
+ func_append temp_rpath "$temp_rpath_tail"
+ func_append compile_rpath "$compile_rpath_tail"
+
if test link = "$pass"; then
if test prog = "$linkmode"; then
compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
@@ -8637,42 +9059,46 @@ func_mode_link ()
# Add libraries to $var in reverse order
eval tmp_libs=\"\$$var\"
new_libs=
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken: new_libs="$deplib $new_libs"
for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ if $opt_preserve_dup_deps; then
+ new_libs="$deplib $new_libs"
+ else
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal. And if not possible for portability
+ # reasons, then --preserve-dup-deps should be used.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
esac
- ;;
- esac
+ fi
done
tmp_libs=
for deplib in $new_libs; do
@@ -8694,7 +9120,7 @@ func_mode_link ()
test CXX = "$tagname" && {
case $host_os in
linux*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C++ 5.9
func_suncc_cstd_abi
@@ -8804,9 +9230,7 @@ func_mode_link ()
if test pass_all != "$deplibs_check_method"; then
func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- $ECHO "*** objects $objs is not portable!"
+ func_warning "Linking the shared library $output against the non-libtool objects $objs is not portable!"
func_append libobjs " $objs"
fi
fi
@@ -8867,13 +9291,13 @@ func_mode_link ()
#
case $version_type in
# correct linux to gnu/linux during the next big refactor
- darwin|freebsd-elf|linux|osf|windows|none)
+ darwin|freebsd-elf|linux|midnightbsd-elf|osf|qnx|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
age=$number_minor
revision=$number_revision
;;
- freebsd-aout|qnx|sunos)
+ freebsd-aout|sco|sunos)
current=$number_major
revision=$number_minor
age=0
@@ -8885,6 +9309,9 @@ func_mode_link ()
revision=$number_minor
lt_irix_increment=no
;;
+ *)
+ func_fatal_configuration "$modename: unknown library version type '$version_type'"
+ ;;
esac
;;
no)
@@ -8958,7 +9385,7 @@ func_mode_link ()
versuffix=.$current.$revision
;;
- freebsd-elf)
+ freebsd-elf | midnightbsd-elf)
func_arith $current - $age
major=.$func_arith_result
versuffix=$major.$age.$revision
@@ -9020,8 +9447,9 @@ func_mode_link ()
;;
qnx)
- major=.$current
- versuffix=.$current
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
;;
sco)
@@ -9174,7 +9602,7 @@ func_mode_link ()
if test yes = "$build_libtool_libs"; then
if test -n "$rpath"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
@@ -9184,7 +9612,7 @@ func_mode_link ()
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
# Do not include libc due to us having libc/libc_r.
;;
*-*-sco3.2v5* | *-*-sco5v6*)
@@ -9225,108 +9653,6 @@ func_mode_link ()
# implementing what was already the behavior.
newdeplibs=$deplibs
;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $opt_dry_run || $RM conftest.c
- cat > conftest.c <<EOF
- int main() { return 0; }
-EOF
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=
- ;;
- esac
- fi
- if test -n "$i"; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which I believe you do not have"
- echo "*** because a test_compile did reveal that the linker did not use it for"
- echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
- ldd_output=`ldd conftest`
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=
- ;;
- esac
- fi
- if test -n "$i"; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because a test_compile did reveal that the linker did not use this one"
- echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- echo "*** make it link in! You will probably need to install it or some"
- echo "*** library that it depends on before this library will be fully"
- echo "*** functional. Installing it before continuing would be even better."
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- fi
- ;;
file_magic*)
set dummy $deplibs_check_method; shift
file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
@@ -9390,17 +9716,16 @@ EOF
fi
if test -n "$a_deplib"; then
droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
+ func_warning "Linker path does not have real file for library $a_deplib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have"
+ func_warning "because I did check the linker path looking for a file starting"
if test -z "$potlib"; then
- $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ func_warning "with $libname but no candidates were found. (...for file magic test)"
else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a file magic. Last file checked: $potlib"
+ func_warning "with $libname and none of the candidates passed a file format test"
+ func_warning "using a file magic. Last file checked: $potlib"
fi
fi
;;
@@ -9444,17 +9769,16 @@ EOF
fi
if test -n "$a_deplib"; then
droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
+ func_warning "Linker path does not have real file for library $a_deplib."
+ func_warning "I have the capability to make that library automatically link in when"
+ func_warning "you link to this library. But I can only do this if you have a"
+ func_warning "shared version of the library, which you do not appear to have"
+ func_warning "because I did check the linker path looking for a file starting"
if test -z "$potlib"; then
- $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ func_warning "with $libname but no candidates were found. (...for regex pattern test)"
else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ func_warning "with $libname and none of the candidates passed a file format test"
+ func_warning "using a regex pattern. Last file checked: $potlib"
fi
fi
;;
@@ -9478,11 +9802,11 @@ EOF
*[!\ \ ]*)
echo
if test none = "$deplibs_check_method"; then
- echo "*** Warning: inter-library dependencies are not supported in this platform."
+ func_warning "Inter-library dependencies are not supported in this platform."
else
- echo "*** Warning: inter-library dependencies are not known to be supported."
+ func_warning "Inter-library dependencies are not known to be supported."
fi
- echo "*** All declared inter-library dependencies are being dropped."
+ func_warning "All declared inter-library dependencies are being dropped."
droppeddeps=yes
;;
esac
@@ -9503,17 +9827,15 @@ EOF
if test yes = "$droppeddeps"; then
if test yes = "$module"; then
- echo
- echo "*** Warning: libtool could not satisfy all declared inter-library"
- $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- echo "*** a static module, that should work as long as the dlopening"
- echo "*** application is linked with the -dlopen flag."
+ func_warning "libtool could not satisfy all declared inter-library"
+ func_warning "dependencies of module $libname. Therefore, libtool will create"
+ func_warning "a static module, that should work as long as the dlopening"
+ func_warning "application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** 'nm' from GNU binutils and a full rebuild may help."
+ func_warning "However, this would only work if libtool was able to extract symbol"
+ func_warning "lists from a program, using 'nm' or equivalent, but libtool could"
+ func_warning "not find such a program. So, this module is probably useless."
+ func_warning "'nm' from GNU binutils and a full rebuild may help."
fi
if test no = "$build_old_libs"; then
oldlibs=$output_objdir/$libname.$libext
@@ -9688,7 +10010,7 @@ EOF
orig_export_symbols=
case $host_os in
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
# exporting using user supplied symfile
func_dll_def_p "$export_symbols" || {
@@ -9886,20 +10208,7 @@ EOF
last_robj=
k=1
- if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
- output=$output_objdir/$output_la.lnkscript
- func_verbose "creating GNU ld script: $output"
- echo 'INPUT (' > $output
- for obj in $save_libobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- echo ')' >> $output
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$func_to_tool_file_result
- elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+ if test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
output=$output_objdir/$output_la.lnk
func_verbose "creating linker input file list: $output"
: > $output
@@ -9918,6 +10227,19 @@ EOF
func_append delfiles " $output"
func_to_tool_file "$output"
output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ elif test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+ output=$output_objdir/$output_la.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
@@ -9995,8 +10317,8 @@ EOF
for cmd in $concat_cmds; do
IFS=$save_ifs
$opt_quiet || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$cmd"
+ eval "func_echo $func_quote_arg_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
@@ -10089,8 +10411,8 @@ EOF
eval cmd=\"$cmd\"
IFS=$save_ifs
$opt_quiet || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$cmd"
+ eval "func_echo $func_quote_arg_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
@@ -10358,7 +10680,7 @@ EOF
esac
fi
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$libdir:"*) ;;
@@ -10436,7 +10758,7 @@ EOF
# Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
wrappers_required=false
;;
- *cygwin* | *mingw* )
+ *cygwin* | *mingw* | *windows* )
test yes = "$build_libtool_libs" || wrappers_required=false
;;
*)
@@ -10564,12 +10886,13 @@ EOF
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ func_quote_arg pretty "$var_value"
+ relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
fi
done
- func_quote "(cd `pwd`; $relink_command)"
- relink_command=$func_quote_result
+ func_quote eval cd "`pwd`"
+ func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"
+ relink_command=$func_quote_arg_unquoted_result
fi
# Only actually do things if not in dry run mode.
@@ -10589,7 +10912,7 @@ EOF
*) exeext= ;;
esac
case $host in
- *cygwin* | *mingw* )
+ *cygwin* | *mingw* | windows* )
func_dirname_and_basename "$output" "" "."
output_name=$func_basename_result
output_path=$func_dirname_result
@@ -10809,14 +11132,15 @@ EOF
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ func_quote_arg pretty,unquoted "$var_value"
+ relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- func_quote "$relink_command"
- relink_command=$func_quote_result
+ func_quote eval cd "`pwd`"
+ relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ func_quote_arg pretty,unquoted "$relink_command"
+ relink_command=$func_quote_arg_unquoted_result
if test yes = "$hardcode_automatic"; then
relink_command=
fi
@@ -10922,7 +11246,7 @@ EOF
# tests/bindir.at for full details.
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *windows*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
# If a -bindir argument was supplied, place the dll there.
if test -n "$bindir"; then
func_relative_path "$install_libdir" "$bindir"
diff --git a/3rdparty/expat/conftools/missing b/3rdparty/expat/conftools/missing
index 8d0eaad250f..1fe1611f185 100755
--- a/3rdparty/expat/conftools/missing
+++ b/3rdparty/expat/conftools/missing
@@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
diff --git a/3rdparty/expat/conftools/test-driver b/3rdparty/expat/conftools/test-driver
index 89dba1e075c..be73b80adf9 100755
--- a/3rdparty/expat/conftools/test-driver
+++ b/3rdparty/expat/conftools/test-driver
@@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2020 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -42,11 +42,13 @@ print_usage ()
{
cat <<END
Usage:
- test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
- [--expect-failure={yes|no}] [--color-tests={yes|no}]
- [--enable-hard-errors={yes|no}] [--]
+ test-driver --test-name NAME --log-file PATH --trs-file PATH
+ [--expect-failure {yes|no}] [--color-tests {yes|no}]
+ [--enable-hard-errors {yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+See the GNU Automake documentation for information.
END
}
@@ -103,8 +105,11 @@ trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
-# Test script is run here.
-"$@" >$log_file 2>&1
+# Test script is run here. We create the file first, then append to it,
+# to ameliorate tests themselves also writing to the log file. Our tests
+# don't, but others can (automake bug#35762).
+: >"$log_file"
+"$@" >>"$log_file" 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
@@ -126,7 +131,7 @@ esac
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
-echo "$res $test_name (exit status: $estatus)" >>$log_file
+echo "$res $test_name (exit status: $estatus)" >>"$log_file"
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
diff --git a/3rdparty/expat/doc/Makefile.am b/3rdparty/expat/doc/Makefile.am
index e2f029837a4..3bea96e9aa6 100644
--- a/3rdparty/expat/doc/Makefile.am
+++ b/3rdparty/expat/doc/Makefile.am
@@ -6,7 +6,10 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2017 Stephen Groat <stephen@groat.us>
+# Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+# Copyright (c) 2024 Tomas Korbar <tkorbar@redhat.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -30,30 +33,27 @@
.PHONY: dist-hook # not inside conditional to avoid automake warning
-if WITH_DOCBOOK
+if WITH_MANPAGE
dist_man_MANS = xmlwf.1
xmlwf.1: xmlwf.xml
-rm -f $@
- $(DOCBOOK_TO_MAN) $<
+ test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $<
test -f $@ || mv XMLWF.1 $@
-else
+endif
+
+if !WITH_DISTRIBUTABLE_MANPAGE
dist-hook:
@echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2
@false
endif
-# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned
-.PHONY: clean-local
-clean-local: clean-local-check
-
-.PHONY: clean-local-check
-clean-local-check:
- $(RM) xmlwf.1
+if !WITH_PREBUILT_MANPAGE
+CLEANFILES = xmlwf.1
+endif
EXTRA_DIST = \
- expat.png \
+ ok.min.css \
reference.html \
style.css \
- valid-xhtml10.png \
xmlwf.xml
diff --git a/3rdparty/expat/doc/Makefile.in b/3rdparty/expat/doc/Makefile.in
index 94550becf39..72deb0565d9 100644
--- a/3rdparty/expat/doc/Makefile.in
+++ b/3rdparty/expat/doc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,10 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2017 Stephen Groat <stephen@groat.us>
+# Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+# Copyright (c) 2024 Tomas Korbar <tkorbar@redhat.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -130,6 +133,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -207,8 +212,10 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CPP = @CPP@
+CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
@@ -224,10 +231,20 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
FGREP = @FGREP@
+FILECMD = @FILECMD@
FILEMAP = @FILEMAP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -237,6 +254,8 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LIBAGE = @LIBAGE@
LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
+LIBM = @LIBM@
LIBOBJS = @LIBOBJS@
LIBREVISION = @LIBREVISION@
LIBS = @LIBS@
@@ -245,6 +264,7 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -266,9 +286,12 @@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SIZEOF_VOID_P = @SIZEOF_VOID_P@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
STRIP = @STRIP@
VERSION = @VERSION@
-_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -323,18 +346,18 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-@WITH_DOCBOOK_TRUE@dist_man_MANS = xmlwf.1
+@WITH_MANPAGE_TRUE@dist_man_MANS = xmlwf.1
+@WITH_PREBUILT_MANPAGE_FALSE@CLEANFILES = xmlwf.1
EXTRA_DIST = \
- expat.png \
+ ok.min.css \
reference.html \
style.css \
- valid-xhtml10.png \
xmlwf.xml
all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -358,9 +381,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
@@ -418,8 +441,7 @@ ctags CTAGS:
cscope cscopelist:
-@WITH_DOCBOOK_TRUE@dist-hook:
-
+@WITH_DISTRIBUTABLE_MANPAGE_TRUE@dist-hook:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -485,6 +507,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -495,7 +518,7 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
@@ -564,38 +587,31 @@ uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- clean-local cscopelist-am ctags-am dist-hook distclean \
- distclean-generic distclean-libtool distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-man1 install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
- uninstall-am uninstall-man uninstall-man1
+ cscopelist-am ctags-am dist-hook distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-man1 install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am tags-am uninstall uninstall-am uninstall-man \
+ uninstall-man1
.PRECIOUS: Makefile
.PHONY: dist-hook # not inside conditional to avoid automake warning
-@WITH_DOCBOOK_TRUE@xmlwf.1: xmlwf.xml
-@WITH_DOCBOOK_TRUE@ -rm -f $@
-@WITH_DOCBOOK_TRUE@ $(DOCBOOK_TO_MAN) $<
-@WITH_DOCBOOK_TRUE@ test -f $@ || mv XMLWF.1 $@
-@WITH_DOCBOOK_FALSE@dist-hook:
-@WITH_DOCBOOK_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2
-@WITH_DOCBOOK_FALSE@ @false
-
-# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned
-.PHONY: clean-local
-clean-local: clean-local-check
-
-.PHONY: clean-local-check
-clean-local-check:
- $(RM) xmlwf.1
+@WITH_MANPAGE_TRUE@xmlwf.1: xmlwf.xml
+@WITH_MANPAGE_TRUE@ -rm -f $@
+@WITH_MANPAGE_TRUE@ test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $<
+@WITH_MANPAGE_TRUE@ test -f $@ || mv XMLWF.1 $@
+
+@WITH_DISTRIBUTABLE_MANPAGE_FALSE@dist-hook:
+@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2
+@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @false
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/3rdparty/expat/doc/expat.png b/3rdparty/expat/doc/expat.png
deleted file mode 100644
index 7d7c3dbaebc..00000000000
--- a/3rdparty/expat/doc/expat.png
+++ /dev/null
Binary files differ
diff --git a/3rdparty/expat/doc/ok.min.css b/3rdparty/expat/doc/ok.min.css
new file mode 100644
index 00000000000..d324fabb287
--- /dev/null
+++ b/3rdparty/expat/doc/ok.min.css
@@ -0,0 +1,2 @@
+/*! OK.css v1.2.0 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css");
+/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--ok-mono:SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);background-color:var(--ok-bg-0);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility;scroll-behavior:smooth}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}[role=button],button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}article{padding-bottom:var(--ok-s-6)}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3);margin-top:var(--ok-s-6);margin-bottom:var(--ok-s-3)}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*,hr+*{margin-top:0}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,audio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,input[type=checkbox],input[type=radio],main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var(--ok-s-3);border:var(--ok-b-0);border-radius:var(--ok-br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}input,select{padding:var(--ok-s-2);background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}input[type=search]{-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=file]{max-width:300px}input[type=number]{-moz-appearance:textfield}input[type=checkbox],input[type=radio]{display:inline;min-width:auto}input[type=color]{height:2.5rem}input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=week]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}input[type=date]:before,input[type=datetime-local]:before,input[type=month]:before,input[type=time]:before,input[type=week]:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}input[type=date]:disabled:before,input[type=datetime-local]:disabled:before,input[type=month]:disabled:before,input[type=time]:disabled:before,input[type=week]:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{position:absolute;top:0;right:0;background-color:transparent;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}input[type=range]{overflow:visible;line-height:inherit;font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}input[type=range]::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}input[type=range]::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-track{cursor:pointer;-ms-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-fill-lower{background:transparent}input[type=range]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}input[type=range]::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}input[type=range]::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}input[type=range]:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-ms-thumb{background-color:var(--ok-accent-1)}input[type=range]:disabled{cursor:default}input[type=range]:disabled::-webkit-slider-runnable-track{cursor:default}input[type=range]:disabled::-moz-range-track{cursor:default}input[type=range]:disabled::-ms-track{cursor:default}input[type=range]:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not([multiple]){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not([multiple]):disabled{background-image:var(--ok-down-1);background-color:var(--ok-bg-1);cursor:default}select[multiple]{border-radius:var(--ok-br)}select[multiple]:disabled{background-color:var(--ok-bg-1)}select[multiple] option{color:var(--ok-t-)}select[multiple]:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-button{cursor:default;opacity:.5}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer}input:not(:disabled)::-webkit-file-upload-button{cursor:pointer}button:disabled,input[type=button]:disabled,input[type=reset]:disabled,input[type=submit]:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),input[type=button]:focus:not(:disabled),input[type=reset]:focus:not(:disabled),input[type=submit]:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;display:table;margin-left:auto;margin-right:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}thead{position:-webkit-sticky;position:sticky;top:0}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{font-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp{padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);font-size:87.5%;line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited,a code,a mark,a samp{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}li p{margin-bottom:0}li,li p+p{margin-top:.5em}audio,img,video{margin-left:auto;margin-right:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>figcaption{text-align:center}figcaption,time{font-size:var(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file
diff --git a/3rdparty/expat/doc/reference.html b/3rdparty/expat/doc/reference.html
index 1e4780ed70c..2b3bd39580a 100644
--- a/3rdparty/expat/doc/reference.html
+++ b/3rdparty/expat/doc/reference.html
@@ -3,26 +3,58 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
-<!-- Copyright 1999,2000 Clark Cooper <coopercc@netheaven.com>
- All rights reserved.
- This is free software. You may distribute or modify according to
- the terms of the MIT/X License -->
+<!--
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2002-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2017-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Jakub Wilk <jwilk@jwilk.net>
+ Copyright (c) 2021 Tomas Korbar <tkorbar@redhat.com>
+ Copyright (c) 2021 Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
+ Copyright (c) 2022 Thijs Schreijer <thijs@thijsschreijer.nl>
+ Copyright (c) 2023 Hanno Böck <hanno@gentoo.org>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+-->
<title>Expat XML Parser</title>
<meta name="author" content="Clark Cooper, coopercc@netheaven.com" />
<meta http-equiv="Content-Style-Type" content="text/css" />
+ <link href="ok.min.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
- <table cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td class="corner"><img src="expat.png" alt="(Expat logo)" /></td>
- <td class="banner"><h1>The Expat XML Parser</h1></td>
- </tr>
- <tr>
- <td class="releaseno">Release 2.0.1</td>
- <td></td>
- </tr>
- </table>
+ <div>
+ <h1>
+ The Expat XML Parser
+ <small>Release 2.7.1</small>
+ </h1>
+ </div>
<div class="content">
<p>Expat is a library, written in C, for parsing XML documents. It's
@@ -38,11 +70,11 @@ Working Group at W3C that produced the XML specification.</p>
<p>This is free software, licensed under the <a
href="../COPYING">MIT/X Consortium license</a>. You may download it
-from <a href="http://www.libexpat.org/">the Expat home page</a>.
+from <a href="https://libexpat.github.io/">the Expat home page</a>.
</p>
<p>The bulk of this document was originally commissioned as an article
-by <a href="http://www.xml.com/">XML.com</a>. They graciously allowed
+by <a href="https://www.xml.com/">XML.com</a>. They graciously allowed
Clark Cooper to retain copyright and to distribute it with Expat.
This version has been substantially extended to include documentation
on features which have been added since the original article was
@@ -120,6 +152,14 @@ interface.</p>
<li><a href="#XML_GetInputContext">XML_GetInputContext</a></li>
</ul>
</li>
+ <li>
+ <a href="#attack-protection">Attack Protection</a>
+ <ul>
+ <li><a href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification">XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></li>
+ <li><a href="#XML_SetBillionLaughsAttackProtectionActivationThreshold">XML_SetBillionLaughsAttackProtectionActivationThreshold</a></li>
+ <li><a href="#XML_SetReparseDeferralEnabled">XML_SetReparseDeferralEnabled</a></li>
+ </ul>
+ </li>
<li><a href="#miscellaneous">Miscellaneous Functions</a>
<ul>
<li><a href="#XML_SetUserData">XML_SetUserData</a></li>
@@ -268,7 +308,7 @@ shoveling the document to the parser so that it can do its work.</p>
<p>The Expat distribution comes as a compressed (with GNU gzip) tar
file. You may download the latest version from <a href=
-"http://sourceforge.net/projects/expat/" >Source Forge</a>. After
+"https://sourceforge.net/projects/expat/" >Source Forge</a>. After
unpacking this, cd into the directory. Then follow either the Win32
directions or Unix directions below.</p>
@@ -279,7 +319,7 @@ directions in the next section. Otherwise if you have Microsoft's
Developer Studio installed,
you can use CMake to generate a <code>.sln</code> file, e.g.
<code>
-cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=RelWithDebInfo .
+cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=RelWithDebInfo .
</code>, and build Expat using <code>msbuild /m expat.sln</code> after.</p>
<p>Alternatively, you may download the Win32 binary package that
@@ -316,39 +356,67 @@ library and header would get installed in
<h3>Configuring Expat Using the Pre-Processor</h3>
<p>Expat's feature set can be configured using a small number of
-pre-processor definitions. The definition of this symbols does not
-affect the set of entry points for Expat, only the behavior of the API
-and the definition of character types in the case of
-<code>XML_UNICODE_WCHAR_T</code>. The symbols are:</p>
+pre-processor definitions. The symbols are:</p>
<dl class="cpp-symbols">
-<dt>XML_DTD</dt>
+<dt><a name="XML_GE">XML_GE</a></dt>
+<dd>
+Added in Expat 2.6.0.
+Include support for
+<a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-physical-struct">general entities</a>
+(syntax <code>&amp;e1;</code> to reference and
+syntax <code>&lt;!ENTITY e1 'value1'&gt;</code> (an internal general entity) or
+<code>&lt;!ENTITY e2 SYSTEM 'file2'&gt;</code> (an external general entity) to declare).
+With <code>XML_GE</code> enabled, general entities will be replaced by their declared replacement text;
+for this to work for <em>external</em> general entities, in addition an
+<code><a href="#XML_SetExternalEntityRefHandler">XML_ExternalEntityRefHandler</a></code> must be set using
+<code><a href="#XML_SetExternalEntityRefHandler">XML_SetExternalEntityRefHandler</a></code>.
+Also, enabling <code>XML_GE</code> makes
+the functions <code><a href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification">
+XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></code> and <code>
+<a href="#XML_SetBillionLaughsAttackProtectionActivationThreshold">
+XML_SetBillionLaughsAttackProtectionActivationThreshold</a></code> available.
+<br/>
+With <code>XML_GE</code> disabled, Expat has a smaller memory footprint and can be faster, but will
+not load external general entities and will replace all general entities
+(except the <a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-predefined-ent">predefined five</a>:
+<code>amp</code>, <code>apos</code>, <code>gt</code>, <code>lt</code>, <code>quot</code>)
+with a self-reference:
+for example, referencing an entity <code>e1</code> via <code>&amp;e1;</code> will be replaced
+by text <code>&amp;e1;</code>.
+</dd>
+
+<dt><a name="XML_DTD">XML_DTD</a></dt>
<dd>Include support for using and reporting DTD-based content. If
this is defined, default attribute values from an external DTD subset
are reported and attribute value normalization occurs based on the
type of attributes defined in the external subset. Without
this, Expat has a smaller memory footprint and can be faster, but will
-not load external entities or process conditional sections. This does
-not affect the set of functions available in the API.</dd>
-
-<dt>XML_NS</dt>
+not load external parameter entities or process conditional sections. If defined, makes
+the functions <code><a
+href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification">
+XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></code> and <code>
+<a href="#XML_SetBillionLaughsAttackProtectionActivationThreshold">
+XML_SetBillionLaughsAttackProtectionActivationThreshold</a></code> available.</dd>
+
+<dt><a name="XML_NS">XML_NS</a></dt>
<dd>When defined, support for the <cite><a href=
-"http://www.w3.org/TR/REC-xml-names/" >Namespaces in XML</a></cite>
+"https://www.w3.org/TR/REC-xml-names/" >Namespaces in XML</a></cite>
specification is included.</dd>
-<dt>XML_UNICODE</dt>
+<dt><a name="XML_UNICODE">XML_UNICODE</a></dt>
<dd>When defined, character data reported to the application is
encoded in UTF-16 using wide characters of the type
<code>XML_Char</code>. This is implied if
<code>XML_UNICODE_WCHAR_T</code> is defined.</dd>
-<dt>XML_UNICODE_WCHAR_T</dt>
+<dt><a name="XML_UNICODE_WCHAR_T">XML_UNICODE_WCHAR_T</a></dt>
<dd>If defined, causes the <code>XML_Char</code> character type to be
defined using the <code>wchar_t</code> type; otherwise, <code>unsigned
short</code> is used. Defining this implies
<code>XML_UNICODE</code>.</dd>
-<dt>XML_LARGE_SIZE</dt>
+<dt><a name="XML_LARGE_SIZE">XML_LARGE_SIZE</a></dt>
<dd>If defined, causes the <code>XML_Size</code> and <code>XML_Index</code>
integer types to be at least 64 bits in size. This is intended to support
processing of very large input streams, where the return values of
@@ -358,23 +426,23 @@ processing of very large input streams, where the return values of
could overflow. It may not be supported by all compilers, and is turned
off by default.</dd>
-<dt>XML_CONTEXT_BYTES</dt>
+<dt><a name="XML_CONTEXT_BYTES">XML_CONTEXT_BYTES</a></dt>
<dd>The number of input bytes of markup context which the parser will
ensure are available for reporting via <code><a href=
"#XML_GetInputContext" >XML_GetInputContext</a></code>. This is
-normally set to 1024, and must be set to a positive integer. If this
-is not defined, the input context will not be available and <code><a
+normally set to 1024, and must be set to a positive integer to enable.
+If this is set to zero, the input context will not be available and <code><a
href= "#XML_GetInputContext" >XML_GetInputContext</a></code> will
-always report NULL. Without this, Expat has a smaller memory
+always report <code>NULL</code>. Without this, Expat has a smaller memory
footprint and can be faster.</dd>
-<dt>XML_STATIC</dt>
+<dt><a name="XML_STATIC">XML_STATIC</a></dt>
<dd>On Windows, this should be set if Expat is going to be linked
statically with the code that calls it; this is required to get all
the right MSVC magic annotations correct. This is ignored on other
platforms.</dd>
-<dt>XML_ATTR_INFO</dt>
+<dt><a name="XML_ATTR_INFO">XML_ATTR_INFO</a></dt>
<dd>If defined, makes the additional function <code><a href=
"#XML_GetAttributeInfo" >XML_GetAttributeInfo</a></code> available
for reporting attribute byte offsets.</dd>
@@ -628,8 +696,9 @@ function. The StartNamespaceDeclHandler is called prior to the start
tag handler and the EndNamespaceDeclHandler is called after the
corresponding end tag that ends the namespace's scope. The namespace
start handler gets passed the prefix and URI for the namespace. For a
-default namespace declaration (xmlns='...'), the prefix will be null.
-The URI will be null for the case where the default namespace is being
+default namespace declaration (xmlns='...'), the prefix will be
+<code>NULL</code>.
+The URI will be <code>NULL</code> for the case where the default namespace is being
unset. The namespace end handler just gets the prefix for the closing
scope.</p>
@@ -758,7 +827,7 @@ has already been passed into the parser. Applications for this
include</p>
<ul>
- <li>Supporting the <a href= "http://www.w3.org/TR/xinclude/"
+ <li>Supporting the <a href= "https://www.w3.org/TR/xinclude/"
>XInclude</a> specification.</li>
<li>Delaying further processing until additional information is
@@ -900,24 +969,30 @@ whether the parse can be resumed in the future.</p>
<h3><a name="creation">Parser Creation</a></h3>
-<pre class="fcndec" id="XML_ParserCreate">
+<h4 id="XML_ParserCreate">XML_ParserCreate</h4>
+<pre class="fcndec">
XML_Parser XMLCALL
XML_ParserCreate(const XML_Char *encoding);
</pre>
<div class="fcndef">
-Construct a new parser. If encoding is non-null, it specifies a
+<p>
+Construct a new parser. If encoding is non-<code>NULL</code>, it specifies a
character encoding to use for the document. This overrides the document
encoding declaration. There are four built-in encodings:
+</p>
<ul>
<li>US-ASCII</li>
<li>UTF-8</li>
<li>UTF-16</li>
<li>ISO-8859-1</li>
</ul>
+<p>
Any other value will invoke a call to the UnknownEncodingHandler.
+</p>
</div>
-<pre class="fcndec" id="XML_ParserCreateNS">
+<h4 id="XML_ParserCreateNS">XML_ParserCreateNS</h4>
+<pre class="fcndec">
XML_Parser XMLCALL
XML_ParserCreateNS(const XML_Char *encoding,
XML_Char sep);
@@ -936,7 +1011,16 @@ the local part will be concatenated without any separator - this is intended
to support RDF processors. It is a programming error to use the null separator
with <a href= "#XML_SetReturnNSTriplet">namespace triplets</a>.</div>
-<pre class="fcndec" id="XML_ParserCreate_MM">
+<p><strong>Note:</strong>
+Expat does not validate namespace URIs (beyond encoding)
+against RFC 3986 today (and is not required to do so with regard to
+the XML 1.0 namespaces specification) but it may start doing that
+in future releases. Before that, an application using Expat must
+be ready to receive namespace URIs containing non-URI characters.
+</p>
+
+<h4 id="XML_ParserCreate_MM">XML_ParserCreate_MM</h4>
+<pre class="fcndec">
XML_Parser XMLCALL
XML_ParserCreate_MM(const XML_Char *encoding,
const XML_Memory_Handling_Suite *ms,
@@ -951,14 +1035,15 @@ typedef struct {
</pre>
<div class="fcndef">
<p>Construct a new parser using the suite of memory handling functions
-specified in <code>ms</code>. If <code>ms</code> is NULL, then use the
+specified in <code>ms</code>. If <code>ms</code> is <code>NULL</code>, then use the
standard set of memory management functions. If <code>sep</code> is
-non NULL, then namespace processing is enabled in the created parser
+non-<code>NULL</code>, then namespace processing is enabled in the created parser
and the character pointed at by sep is used as the separator between
the namespace URI and the local part of the name.</p>
</div>
-<pre class="fcndec" id="XML_ExternalEntityParserCreate">
+<h4 id="XML_ExternalEntityParserCreate">XML_ExternalEntityParserCreate</h4>
+<pre class="fcndec">
XML_Parser XMLCALL
XML_ExternalEntityParserCreate(XML_Parser p,
const XML_Char *context,
@@ -974,7 +1059,8 @@ changing functions on this parser (unless you want it to act
differently than the parent parser).
</div>
-<pre class="fcndec" id="XML_ParserFree">
+<h4 id="XML_ParserFree">XML_ParserFree</h4>
+<pre class="fcndec">
void XMLCALL
XML_ParserFree(XML_Parser p);
</pre>
@@ -983,7 +1069,8 @@ Free memory used by the parser. Your application is responsible for
freeing any memory associated with <a href="#userdata">user data</a>.
</div>
-<pre class="fcndec" id="XML_ParserReset">
+<h4 id="XML_ParserReset">XML_ParserReset</h4>
+<pre class="fcndec">
XML_Bool XMLCALL
XML_ParserReset(XML_Parser p,
const XML_Char *encoding);
@@ -1014,7 +1101,7 @@ if they apply to the parser created by
<code><a href= "#XML_ExternalEntityParserCreate"
>XML_ExternalEntityParserCreate</a></code>.</p>
-<p>Note: the <code>len</code> argument passed to these functions
+<p>Note: The <code>len</code> argument passed to these functions
should be considerably less than the maximum value for an integer,
as it could create an integer overflow situation if the added
lengths of a buffer and the unprocessed portion of the previous buffer
@@ -1022,7 +1109,13 @@ exceed the maximum integer value. Input data at the end of a buffer
will remain unprocessed if it is part of an XML token for which the
end is not part of that buffer.</p>
-<pre class="fcndec" id="XML_Parse">
+<p><a name="isFinal"></a>The application <em>must</em> make a concluding
+<code><a href="#XML_Parse">XML_Parse</a></code> or
+<code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code> call
+with <code>isFinal</code> set to <code>XML_TRUE</code>.</p>
+
+<h4 id="XML_Parse">XML_Parse</h4>
+<pre class="fcndec">
enum XML_Status XMLCALL
XML_Parse(XML_Parser p,
const char *s,
@@ -1036,42 +1129,86 @@ enum XML_Status {
};
</pre>
<div class="fcndef">
+<p>
Parse some more of the document. The string <code>s</code> is a buffer
containing part (or perhaps all) of the document. The number of bytes of s
that are part of the document is indicated by <code>len</code>. This means
-that <code>s</code> doesn't have to be null terminated. It also means that
+that <code>s</code> doesn't have to be null-terminated. It also means that
if <code>len</code> is larger than the number of bytes in the block of
-memory that <code>s</code> points at, then a memory fault is likely. The
+memory that <code>s</code> points at, then a memory fault is likely.
+Negative values for <code>len</code> are rejected since Expat 2.2.1.
+The
<code>isFinal</code> parameter informs the parser that this is the last
piece of the document. Frequently, the last piece is empty (i.e.
<code>len</code> is zero.)
+</p>
+
+<p>
If a parse error occurred, it returns <code>XML_STATUS_ERROR</code>.
Otherwise it returns <code>XML_STATUS_OK</code> value.
+Note that regardless of the return value, there is no guarantee that all
+provided input has been parsed; only after <a href="#isFinal">the
+concluding call</a> will all handler callbacks and parsing errors have
+happened.
+</p>
+
+<p>
+Simplified, <code>XML_Parse</code> can be considered a convenience wrapper
+that is pairing calls
+to <code><a href="#XML_GetBuffer">XML_GetBuffer</a></code>
+and <code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code>
+(when Expat is built with macro <code>XML_CONTEXT_BYTES</code>
+defined to a positive value, which is both common and default).
+<code>XML_Parse</code> is then functionally equivalent to calling
+<code><a href="#XML_GetBuffer">XML_GetBuffer</a></code>,
+<code>memcpy</code>, and
+<code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code>.
+</p>
+
+<p>
+To avoid double copying of the input, direct use of functions
+<code><a href="#XML_GetBuffer">XML_GetBuffer</a></code> and
+<code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code> is advised
+for most production use, e.g.
+if you're using <code>read</code> or similar functionality to fill your
+buffers, fill directly into the buffer from
+<code><a href="#XML_GetBuffer">XML_GetBuffer</a></code>,
+then parse with <code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code>.
+</p>
</div>
-<pre class="fcndec" id="XML_ParseBuffer">
+<h4 id="XML_ParseBuffer">XML_ParseBuffer</h4>
+<pre class="fcndec">
enum XML_Status XMLCALL
XML_ParseBuffer(XML_Parser p,
int len,
int isFinal);
</pre>
<div class="fcndef">
+<p>
This is just like <code><a href= "#XML_Parse" >XML_Parse</a></code>,
except in this case Expat provides the buffer. By obtaining the
buffer from Expat with the <code><a href= "#XML_GetBuffer"
>XML_GetBuffer</a></code> function, the application can avoid double
copying of the input.
+</p>
+
+<p>
+Negative values for <code>len</code> are rejected since Expat 2.6.3.
+</p>
</div>
-<pre class="fcndec" id="XML_GetBuffer">
+<h4 id="XML_GetBuffer">XML_GetBuffer</h4>
+<pre class="fcndec">
void * XMLCALL
XML_GetBuffer(XML_Parser p,
int len);
</pre>
<div class="fcndef">
Obtain a buffer of size <code>len</code> to read a piece of the document
-into. A NULL value is returned if Expat can't allocate enough memory for
-this buffer. This has to be called prior to every call to
+into. A <code>NULL</code> value is returned if Expat can't allocate enough memory for
+this buffer. A <code>NULL</code> value may also be returned if <code>len</code> is zero.
+This has to be called prior to every call to
<code><a href= "#XML_ParseBuffer" >XML_ParseBuffer</a></code>. A
typical use would look like this:
@@ -1098,7 +1235,8 @@ for (;;) {
</pre>
</div>
-<pre class="fcndec" id="XML_StopParser">
+<h4 id="XML_StopParser">XML_StopParser</h4>
+<pre class="fcndec">
enum XML_Status XMLCALL
XML_StopParser(XML_Parser p,
XML_Bool resumable);
@@ -1111,7 +1249,7 @@ XML_StopParser(XML_Parser p,
call-back handler, except when aborting (when <code>resumable</code>
is <code>XML_FALSE</code>) an already suspended parser. Some
call-backs may still follow because they would otherwise get
-lost, including
+lost, including</p>
<ul>
<li> the end element handler for empty elements when stopped in the
start element handler,</li>
@@ -1120,7 +1258,7 @@ lost, including
<li> the character data handler when stopped in the character data handler
while making multiple call-backs on a contiguous chunk of characters,</li>
</ul>
-and possibly others.</p>
+<p>and possibly others.</p>
<p>This can be called from most handlers, including DTD related
call-backs, except when parsing an external parameter entity and
@@ -1129,6 +1267,11 @@ call-backs, except when parsing an external parameter entity and
<code>XML_STATUS_ERROR</code> otherwise. The possible error codes
are:</p>
<dl>
+ <dt><code>XML_ERROR_NOT_STARTED</code></dt>
+ <dd>
+ when stopping or suspending a parser before it has started,
+ added in Expat 2.6.4.
+ </dd>
<dt><code>XML_ERROR_SUSPENDED</code></dt>
<dd>when suspending an already suspended parser.</dd>
<dt><code>XML_ERROR_FINISHED</code></dt>
@@ -1166,7 +1309,8 @@ implementation of that handler to call <code><a href=
<p>New in Expat 1.95.8.</p>
</div>
-<pre class="fcndec" id="XML_ResumeParser">
+<h4 id="XML_ResumeParser">XML_ResumeParser</h4>
+<pre class="fcndec">
enum XML_Status XMLCALL
XML_ResumeParser(XML_Parser p);
</pre>
@@ -1191,7 +1335,8 @@ appropriate moment.</p>
<p>New in Expat 1.95.8.</p>
</div>
-<pre class="fcndec" id="XML_GetParsingStatus">
+<h4 id="XML_GetParsingStatus">XML_GetParsingStatus</h4>
+<pre class="fcndec">
void XMLCALL
XML_GetParsingStatus(XML_Parser p,
XML_ParsingStatus *status);
@@ -1213,7 +1358,7 @@ typedef struct {
<p>Returns status of parser with respect to being initialized,
parsing, finished, or suspended, and whether the final buffer is being
processed. The <code>status</code> parameter <em>must not</em> be
-NULL.</p>
+<code>NULL</code>.</p>
<p>New in Expat 1.95.8.</p>
</div>
@@ -1228,7 +1373,7 @@ to ignore all text not descended from a <code>para</code> element. One
way it could do this is to set the character handler when a para start tag
is seen, and unset it for the corresponding end tag.</p>
-<p>A handler may be <em>unset</em> by providing a NULL pointer to the
+<p>A handler may be <em>unset</em> by providing a <code>NULL</code> pointer to the
appropriate handler setter. None of the handler setting functions have
a return value.</p>
@@ -1240,7 +1385,8 @@ Note that you'll receive them in this form independent of the original
encoding of the document.</p>
<div class="handler">
-<pre class="setter" id="XML_SetStartElementHandler">
+<h4 id="XML_SetStartElementHandler">XML_SetStartElementHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetStartElementHandler(XML_Parser p,
XML_StartElementHandler start);
@@ -1255,13 +1401,14 @@ typedef void
handler as a pointer to a vector of char pointers. Each attribute seen in
a start (or empty) tag occupies 2 consecutive places in this vector: the
attribute name followed by the attribute value. These pairs are terminated
-by a null pointer.</p>
+by a <code>NULL</code> pointer.</p>
<p>Note that an empty tag generates a call to both start and end handlers
(in that order).</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetEndElementHandler">
+<h4 id="XML_SetEndElementHandler">XML_SetEndElementHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetEndElementHandler(XML_Parser p,
XML_EndElementHandler);
@@ -1276,7 +1423,8 @@ generates a call to both start and end handlers.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetElementHandler">
+<h4 id="XML_SetElementHandler">XML_SetElementHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetElementHandler(XML_Parser p,
XML_StartElementHandler start,
@@ -1286,7 +1434,8 @@ XML_SetElementHandler(XML_Parser p,
</div>
<div class="handler">
-<pre class="setter" id="XML_SetCharacterDataHandler">
+<h4 id="XML_SetCharacterDataHandler">XML_SetCharacterDataHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetCharacterDataHandler(XML_Parser p,
XML_CharacterDataHandler charhndl)
@@ -1302,14 +1451,15 @@ is <em>NOT null-terminated</em>. You have to use the length argument
to deal with the end of the string. A single block of contiguous text
free of markup may still result in a sequence of calls to this handler.
In other words, if you're searching for a pattern in the text, it may
-be split across calls to this handler. Note: Setting this handler to NULL
+be split across calls to this handler. Note: Setting this handler to <code>NULL</code>
may <em>NOT immediately</em> terminate call-backs if the parser is currently
processing such a single block of contiguous markup-free text, as the parser
will continue calling back until the end of the block is reached.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetProcessingInstructionHandler">
+<h4 id="XML_SetProcessingInstructionHandler">XML_SetProcessingInstructionHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetProcessingInstructionHandler(XML_Parser p,
XML_ProcessingInstructionHandler proc)
@@ -1327,7 +1477,8 @@ it after skipping all whitespace after the initial word.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetCommentHandler">
+<h4 id="XML_SetCommentHandler">XML_SetCommentHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetCommentHandler(XML_Parser p,
XML_CommentHandler cmnt)
@@ -1342,7 +1493,8 @@ delimiters.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetStartCdataSectionHandler">
+<h4 id="XML_SetStartCdataSectionHandler">XML_SetStartCdataSectionHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetStartCdataSectionHandler(XML_Parser p,
XML_StartCdataSectionHandler start);
@@ -1355,7 +1507,8 @@ typedef void
</div>
<div class="handler">
-<pre class="setter" id="XML_SetEndCdataSectionHandler">
+<h4 id="XML_SetEndCdataSectionHandler">XML_SetEndCdataSectionHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetEndCdataSectionHandler(XML_Parser p,
XML_EndCdataSectionHandler end);
@@ -1368,7 +1521,8 @@ typedef void
</div>
<div class="handler">
-<pre class="setter" id="XML_SetCdataSectionHandler">
+<h4 id="XML_SetCdataSectionHandler">XML_SetCdataSectionHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetCdataSectionHandler(XML_Parser p,
XML_StartCdataSectionHandler start,
@@ -1378,7 +1532,8 @@ XML_SetCdataSectionHandler(XML_Parser p,
</div>
<div class="handler">
-<pre class="setter" id="XML_SetDefaultHandler">
+<h4 id="XML_SetDefaultHandler">XML_SetDefaultHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetDefaultHandler(XML_Parser p,
XML_DefaultHandler hndl)
@@ -1409,7 +1564,8 @@ href="#XML_DefaultCurrent">XML_DefaultCurrent</a></code>.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetDefaultHandlerExpand">
+<h4 id="XML_SetDefaultHandlerExpand">XML_SetDefaultHandlerExpand</h4>
+<pre class="setter">
void XMLCALL
XML_SetDefaultHandlerExpand(XML_Parser p,
XML_DefaultHandler hndl)
@@ -1429,7 +1585,8 @@ href="#XML_DefaultCurrent">XML_DefaultCurrent</a></code>.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetExternalEntityRefHandler">
+<h4 id="XML_SetExternalEntityRefHandler">XML_SetExternalEntityRefHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetExternalEntityRefHandler(XML_Parser p,
XML_ExternalEntityRefHandler hndl)
@@ -1452,16 +1609,16 @@ the format expected by the <code>context</code> argument to <code><a
href="#XML_ExternalEntityParserCreate"
>XML_ExternalEntityParserCreate</a></code>. <code>code</code> is
valid only until the handler returns, so if the referenced entity is
-to be parsed later, it must be copied. <code>context</code> is NULL
+to be parsed later, it must be copied. <code>context</code> is <code>NULL</code>
only when the entity is a parameter entity, which is how one can
differentiate between general and parameter entities.</p>
<p>The <code>base</code> parameter is the base to use for relative
system identifiers. It is set by <code><a
-href="#XML_SetBase">XML_SetBase</a></code> and may be NULL. The
+href="#XML_SetBase">XML_SetBase</a></code> and may be <code>NULL</code>. The
<code>publicId</code> parameter is the public id given in the entity
-declaration and may be NULL. <code>systemId</code> is the system
-identifier specified in the entity declaration and is never NULL.</p>
+declaration and may be <code>NULL</code>. <code>systemId</code> is the system
+identifier specified in the entity declaration and is never <code>NULL</code>.</p>
<p>There are a couple of ways in which this handler differs from
others. First, this handler returns a status indicator (an
@@ -1482,17 +1639,18 @@ parser, the body of the external entity can be recursively parsed.</p>
information into global or static variables.</p>
</div>
-<pre class="fcndec" id="XML_SetExternalEntityRefHandlerArg">
+<h4 id="XML_SetExternalEntityRefHandlerArg">XML_SetExternalEntityRefHandlerArg</h4>
+<pre class="fcndec">
void XMLCALL
XML_SetExternalEntityRefHandlerArg(XML_Parser p,
void *arg)
</pre>
<div class="fcndef">
<p>Set the argument passed to the ExternalEntityRefHandler. If
-<code>arg</code> is not NULL, it is the new value passed to the
+<code>arg</code> is not <code>NULL</code>, it is the new value passed to the
handler set using <code><a href="#XML_SetExternalEntityRefHandler"
>XML_SetExternalEntityRefHandler</a></code>; if <code>arg</code> is
-NULL, the argument passed to the handler function will be the parser
+<code>NULL</code>, the argument passed to the handler function will be the parser
object itself.</p>
<p><strong>Note:</strong>
@@ -1508,7 +1666,8 @@ properly.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetSkippedEntityHandler">
+<h4 id="XML_SetSkippedEntityHandler">XML_SetSkippedEntityHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetSkippedEntityHandler(XML_Parser p,
XML_SkippedEntityHandler handler)
@@ -1528,14 +1687,15 @@ typedef void
has been called.</li>
</ol>
<p>The <code>is_parameter_entity</code> argument will be non-zero for
-a parameter entity and zero for a general entity.</p> <p>Note: skipped
+a parameter entity and zero for a general entity.</p> <p>Note: Skipped
parameter entities in declarations and skipped general entities in
attribute values cannot be reported, because the event would be out of
sync with the reporting of the declarations or attribute values</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetUnknownEncodingHandler">
+<h4 id="XML_SetUnknownEncodingHandler">XML_SetUnknownEncodingHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetUnknownEncodingHandler(XML_Parser p,
XML_UnknownEncodingHandler enchandler,
@@ -1573,18 +1733,19 @@ value is -1, then that byte is invalid as the initial byte in a sequence.
If the value is -n, where n is an integer &gt; 1, then n is the number of
bytes in the sequence and the actual conversion is accomplished by a
call to the function pointed at by convert. This function may return -1
-if the sequence itself is invalid. The convert pointer may be null if
+if the sequence itself is invalid. The convert pointer may be <code>NULL</code> if
there are only single byte codes. The data parameter passed to the convert
function is the data pointer from <code>XML_Encoding</code>. The
string s is <em>NOT</em> null-terminated and points at the sequence of
bytes to be converted.</p>
<p>The function pointed at by <code>release</code> is called by the
-parser when it is finished with the encoding. It may be NULL.</p>
+parser when it is finished with the encoding. It may be <code>NULL</code>.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetStartNamespaceDeclHandler">
+<h4 id="XML_SetStartNamespaceDeclHandler">XML_SetStartNamespaceDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetStartNamespaceDeclHandler(XML_Parser p,
XML_StartNamespaceDeclHandler start);
@@ -1602,7 +1763,8 @@ in that start tag.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetEndNamespaceDeclHandler">
+<h4 id="XML_SetEndNamespaceDeclHandler">XML_SetEndNamespaceDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetEndNamespaceDeclHandler(XML_Parser p,
XML_EndNamespaceDeclHandler end);
@@ -1619,7 +1781,8 @@ namespace was declared.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetNamespaceDeclHandler">
+<h4 id="XML_SetNamespaceDeclHandler">XML_SetNamespaceDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetNamespaceDeclHandler(XML_Parser p,
XML_StartNamespaceDeclHandler start,
@@ -1629,7 +1792,8 @@ XML_SetNamespaceDeclHandler(XML_Parser p,
</div>
<div class="handler">
-<pre class="setter" id="XML_SetXmlDeclHandler">
+<h4 id="XML_SetXmlDeclHandler">XML_SetXmlDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetXmlDeclHandler(XML_Parser p,
XML_XmlDeclHandler xmldecl);
@@ -1643,8 +1807,8 @@ typedef void
</pre>
<p>Sets a handler that is called for XML declarations and also for
text declarations discovered in external entities. The way to
-distinguish is that the <code>version</code> parameter will be NULL
-for text declarations. The <code>encoding</code> parameter may be NULL
+distinguish is that the <code>version</code> parameter will be <code>NULL</code>
+for text declarations. The <code>encoding</code> parameter may be <code>NULL</code>
for an XML declaration. The <code>standalone</code> argument will
contain -1, 0, or 1 indicating respectively that there was no
standalone parameter in the declaration, that it was given as no, or
@@ -1652,7 +1816,8 @@ that it was given as yes.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetStartDoctypeDeclHandler">
+<h4 id="XML_SetStartDoctypeDeclHandler">XML_SetStartDoctypeDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetStartDoctypeDeclHandler(XML_Parser p,
XML_StartDoctypeDeclHandler start);
@@ -1667,12 +1832,13 @@ typedef void
</pre>
<p>Set a handler that is called at the start of a DOCTYPE declaration,
before any external or internal subset is parsed. Both <code>sysid</code>
-and <code>pubid</code> may be NULL. The <code>has_internal_subset</code>
+and <code>pubid</code> may be <code>NULL</code>. The <code>has_internal_subset</code>
will be non-zero if the DOCTYPE declaration has an internal subset.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetEndDoctypeDeclHandler">
+<h4 id="XML_SetEndDoctypeDeclHandler">XML_SetEndDoctypeDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetEndDoctypeDeclHandler(XML_Parser p,
XML_EndDoctypeDeclHandler end);
@@ -1686,7 +1852,8 @@ after parsing any external subset.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetDoctypeDeclHandler">
+<h4 id="XML_SetDoctypeDeclHandler">XML_SetDoctypeDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetDoctypeDeclHandler(XML_Parser p,
XML_StartDoctypeDeclHandler start,
@@ -1696,7 +1863,8 @@ XML_SetDoctypeDeclHandler(XML_Parser p,
</div>
<div class="handler">
-<pre class="setter" id="XML_SetElementDeclHandler">
+<h4 id="XML_SetElementDeclHandler">XML_SetElementDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetElementDeclHandler(XML_Parser p,
XML_ElementDeclHandler eldecl);
@@ -1736,16 +1904,17 @@ struct XML_cp {
</pre>
<p>Sets a handler for element declarations in a DTD. The handler gets
called with the name of the element in the declaration and a pointer
-to a structure that contains the element model. It is the
-application's responsibility to free this data structure using
-<code><a href="#XML_FreeContentModel"
->XML_FreeContentModel</a></code>.</p>
+to a structure that contains the element model. It's the user code's
+responsibility to free model when finished with it. See <code>
+<a href="#XML_FreeContentModel">XML_FreeContentModel</a></code>.
+There is no need to free the model from the handler, it can be kept
+around and freed at a later stage.</p>
<p>The <code>model</code> argument is the root of a tree of
<code>XML_Content</code> nodes. If <code>type</code> equals
<code>XML_CTYPE_EMPTY</code> or <code>XML_CTYPE_ANY</code>, then
<code>quant</code> will be <code>XML_CQUANT_NONE</code>, and the other
-fields will be zero or NULL. If <code>type</code> is
+fields will be zero or <code>NULL</code>. If <code>type</code> is
<code>XML_CTYPE_MIXED</code>, then <code>quant</code> will be
<code>XML_CQUANT_NONE</code> or <code>XML_CQUANT_REP</code> and
<code>numchildren</code> will contain the number of elements that are
@@ -1757,7 +1926,7 @@ XML_CTYPE_NAME with no quantification. Only the root node can be type
<p>For type <code>XML_CTYPE_NAME</code>, the <code>name</code> field
points to the name and the <code>numchildren</code> and
-<code>children</code> fields will be zero and NULL. The
+<code>children</code> fields will be zero and <code>NULL</code>. The
<code>quant</code> field will indicate any quantifiers placed on the
name.</p>
@@ -1768,7 +1937,8 @@ or sequence and <code>children</code> points to the nodes.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetAttlistDeclHandler">
+<h4 id="XML_SetAttlistDeclHandler">XML_SetAttlistDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetAttlistDeclHandler(XML_Parser p,
XML_AttlistDeclHandler attdecl);
@@ -1792,16 +1962,17 @@ is in the <code>attname</code> parameter. The attribute type is in the
type in the declaration with whitespace removed.</p>
<p>The <code>dflt</code> parameter holds the default value. It will be
-NULL in the case of "#IMPLIED" or "#REQUIRED" attributes. You can
+<code>NULL</code> in the case of "#IMPLIED" or "#REQUIRED" attributes. You can
distinguish these two cases by checking the <code>isrequired</code>
parameter, which will be true in the case of "#REQUIRED" attributes.
Attributes which are "#FIXED" will have also have a true
-<code>isrequired</code>, but they will have the non-NULL fixed value
+<code>isrequired</code>, but they will have the non-<code>NULL</code> fixed value
in the <code>dflt</code> parameter.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetEntityDeclHandler">
+<h4 id="XML_SetEntityDeclHandler">XML_SetEntityDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetEntityDeclHandler(XML_Parser p,
XML_EntityDeclHandler handler);
@@ -1823,19 +1994,20 @@ The <code>is_parameter_entity</code> argument will be non-zero in the
case of parameter entities and zero otherwise.</p>
<p>For internal entities (<code>&lt;!ENTITY foo "bar"&gt;</code>),
-<code>value</code> will be non-NULL and <code>systemId</code>,
-<code>publicId</code>, and <code>notationName</code> will all be NULL.
-The value string is <em>not</em> NULL terminated; the length is
+<code>value</code> will be non-<code>NULL</code> and <code>systemId</code>,
+<code>publicId</code>, and <code>notationName</code> will all be <code>NULL</code>.
+The value string is <em>not</em> null-terminated; the length is
provided in the <code>value_length</code> parameter. Do not use
<code>value_length</code> to test for internal entities, since it is
legal to have zero-length values. Instead check for whether or not
-<code>value</code> is NULL.</p> <p>The <code>notationName</code>
-argument will have a non-NULL value only for unparsed entity
+<code>value</code> is <code>NULL</code>.</p> <p>The <code>notationName</code>
+argument will have a non-<code>NULL</code> value only for unparsed entity
declarations.</p>
</div>
<div class="handler">
-<pre class="setter" id="XML_SetUnparsedEntityDeclHandler">
+<h4 id="XML_SetUnparsedEntityDeclHandler">XML_SetUnparsedEntityDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetUnparsedEntityDeclHandler(XML_Parser p,
XML_UnparsedEntityDeclHandler h)
@@ -1861,7 +2033,8 @@ compatibility. Use instead <a href= "#XML_SetEntityDeclHandler"
</div>
<div class="handler">
-<pre class="setter" id="XML_SetNotationDeclHandler">
+<h4 id="XML_SetNotationDeclHandler">XML_SetNotationDeclHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetNotationDeclHandler(XML_Parser p,
XML_NotationDeclHandler h)
@@ -1878,7 +2051,8 @@ typedef void
</div>
<div class="handler">
-<pre class="setter" id="XML_SetNotStandaloneHandler">
+<h4 id="XML_SetNotStandaloneHandler">XML_SetNotStandaloneHandler</h4>
+<pre class="setter">
void XMLCALL
XML_SetNotStandaloneHandler(XML_Parser p,
XML_NotStandaloneHandler h)
@@ -1913,7 +2087,8 @@ events.</p>
DTD. In other words, they usually return bogus information when
called from within a DTD declaration handler.</p>
-<pre class="fcndec" id="XML_GetErrorCode">
+<h4 id="XML_GetErrorCode">XML_GetErrorCode</h4>
+<pre class="fcndec">
enum XML_Error XMLCALL
XML_GetErrorCode(XML_Parser p);
</pre>
@@ -1921,7 +2096,8 @@ XML_GetErrorCode(XML_Parser p);
Return what type of error has occurred.
</div>
-<pre class="fcndec" id="XML_ErrorString">
+<h4 id="XML_ErrorString">XML_ErrorString</h4>
+<pre class="fcndec">
const XML_LChar * XMLCALL
XML_ErrorString(enum XML_Error code);
</pre>
@@ -1931,7 +2107,8 @@ The code should be one of the enums that can be returned from
<code><a href= "#XML_GetErrorCode" >XML_GetErrorCode</a></code>.
</div>
-<pre class="fcndec" id="XML_GetCurrentByteIndex">
+<h4 id="XML_GetCurrentByteIndex">XML_GetCurrentByteIndex</h4>
+<pre class="fcndec">
XML_Index XMLCALL
XML_GetCurrentByteIndex(XML_Parser p);
</pre>
@@ -1942,7 +2119,8 @@ the values returned by <code><a href= "#XML_GetCurrentLineNumber"
"#XML_GetCurrentColumnNumber" >XML_GetCurrentColumnNumber</a></code>.
</div>
-<pre class="fcndec" id="XML_GetCurrentLineNumber">
+<h4 id="XML_GetCurrentLineNumber">XML_GetCurrentLineNumber</h4>
+<pre class="fcndec">
XML_Size XMLCALL
XML_GetCurrentLineNumber(XML_Parser p);
</pre>
@@ -1951,7 +2129,8 @@ Return the line number of the position. The first line is reported as
<code>1</code>.
</div>
-<pre class="fcndec" id="XML_GetCurrentColumnNumber">
+<h4 id="XML_GetCurrentColumnNumber">XML_GetCurrentColumnNumber</h4>
+<pre class="fcndec">
XML_Size XMLCALL
XML_GetCurrentColumnNumber(XML_Parser p);
</pre>
@@ -1960,7 +2139,8 @@ Return the offset, from the beginning of the current line, of
the position.
</div>
-<pre class="fcndec" id="XML_GetCurrentByteCount">
+<h4 id="XML_GetCurrentByteCount">XML_GetCurrentByteCount</h4>
+<pre class="fcndec">
int XMLCALL
XML_GetCurrentByteCount(XML_Parser p);
</pre>
@@ -1972,7 +2152,8 @@ be used to distinguish empty-element tags from empty elements using
separate start and end tags).
</div>
-<pre class="fcndec" id="XML_GetInputContext">
+<h4 id="XML_GetInputContext">XML_GetInputContext</h4>
+<pre class="fcndec">
const char * XMLCALL
XML_GetInputContext(XML_Parser p,
int *offset,
@@ -1994,8 +2175,117 @@ untranslated bytes of the input.</p>
triggering a call spans over a very large amount of input, the actual
parse position may be before the beginning of the buffer.</p>
-<p>If <code>XML_CONTEXT_BYTES</code> is not defined, this will always
-return NULL.</p>
+<p>If <code>XML_CONTEXT_BYTES</code> is zero, this will always
+return <code>NULL</code>.</p>
+</div>
+
+<h3><a name="attack-protection">Attack Protection</a><a name="billion-laughs"></a></h3>
+
+<h4 id="XML_SetBillionLaughsAttackProtectionMaximumAmplification">XML_SetBillionLaughsAttackProtectionMaximumAmplification</h4>
+<pre class="fcndec">
+/* Added in Expat 2.4.0. */
+XML_Bool XMLCALL
+XML_SetBillionLaughsAttackProtectionMaximumAmplification(XML_Parser p,
+ float maximumAmplificationFactor);
+</pre>
+<div class="fcndef">
+ <p>
+ Sets the maximum tolerated amplification factor
+ for protection against
+ <a href="https://en.wikipedia.org/wiki/Billion_laughs_attack">billion laughs attacks</a>
+ (default: <code>100.0</code>)
+ of parser <code>p</code> to <code>maximumAmplificationFactor</code>, and
+ returns <code>XML_TRUE</code> upon success and <code>XML_FALSE</code> upon error.
+ </p>
+
+ The amplification factor is calculated as ..
+ <pre>
+ amplification := (direct + indirect) / direct
+ </pre>
+ .. while parsing, whereas
+ <code>direct</code> is the number of bytes read from the primary document in parsing and
+ <code>indirect</code> is the number of bytes added by expanding entities and reading of external DTD files, combined.
+
+ <p>For a call to <code>XML_SetBillionLaughsAttackProtectionMaximumAmplification</code> to succeed:</p>
+ <ul>
+ <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers) and</li>
+ <li><code>maximumAmplificationFactor</code> must be non-<code>NaN</code> and greater than or equal to <code>1.0</code>.</li>
+ </ul>
+
+ <p>
+ <strong>Note:</strong>
+ If you ever need to increase this value for non-attack payload,
+ please <a href="https://github.com/libexpat/libexpat/issues">file a bug report</a>.
+ </p>
+
+ <p>
+ <strong>Note:</strong>
+ Peak amplifications
+ of factor 15,000 for the entire payload and
+ of factor 30,000 in the middle of parsing
+ have been observed with small benign files in practice.
+
+ So if you do reduce the maximum allowed amplification,
+ please make sure that the activation threshold is still big enough
+ to not end up with undesired false positives (i.e. benign files being rejected).
+ </p>
+</div>
+
+<h4 id="XML_SetBillionLaughsAttackProtectionActivationThreshold">XML_SetBillionLaughsAttackProtectionActivationThreshold</h4>
+<pre class="fcndec">
+/* Added in Expat 2.4.0. */
+XML_Bool XMLCALL
+XML_SetBillionLaughsAttackProtectionActivationThreshold(XML_Parser p,
+ unsigned long long activationThresholdBytes);
+</pre>
+<div class="fcndef">
+ <p>
+ Sets number of output bytes (including amplification from entity expansion and reading DTD files)
+ needed to activate protection against
+ <a href="https://en.wikipedia.org/wiki/Billion_laughs_attack">billion laughs attacks</a>
+ (default: <code>8 MiB</code>)
+ of parser <code>p</code> to <code>activationThresholdBytes</code>, and
+ returns <code>XML_TRUE</code> upon success and <code>XML_FALSE</code> upon error.
+ </p>
+
+ <p>For a call to <code>XML_SetBillionLaughsAttackProtectionActivationThreshold</code> to succeed:</p>
+ <ul>
+ <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers).</li>
+ </ul>
+
+ <p>
+ <strong>Note:</strong>
+ If you ever need to increase this value for non-attack payload,
+ please <a href="https://github.com/libexpat/libexpat/issues">file a bug report</a>.
+ </p>
+
+ <p>
+ <strong>Note:</strong>
+ Activation thresholds below 4 MiB are known to break support for
+ <a href="https://en.wikipedia.org/wiki/Darwin_Information_Typing_Architecture">DITA</a> 1.3 payload
+ and are hence not recommended.
+ </p>
+</div>
+
+<h4 id="XML_SetReparseDeferralEnabled">XML_SetReparseDeferralEnabled</h4>
+<pre class="fcndec">
+/* Added in Expat 2.6.0. */
+XML_Bool XMLCALL
+XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
+</pre>
+<div class="fcndef">
+ <p>
+ Large tokens may require many parse calls before enough data is available for Expat to parse it in full.
+ If Expat retried parsing the token on every parse call, parsing could take quadratic time.
+ To avoid this, Expat only retries once a significant amount of new data is available.
+ This function allows disabling this behavior.
+ </p>
+ <p>
+ The <code>enabled</code> argument should be <code>XML_TRUE</code> or <code>XML_FALSE</code>.
+ </p>
+ <p>
+ Returns <code>XML_TRUE</code> on success, and <code>XML_FALSE</code> on error.
+ </p>
</div>
<h3><a name="miscellaneous">Miscellaneous functions</a></h3>
@@ -2003,7 +2293,8 @@ return NULL.</p>
<p>The functions in this section either obtain state information from
the parser or can be used to dynamically set parser options.</p>
-<pre class="fcndec" id="XML_SetUserData">
+<h4 id="XML_SetUserData">XML_SetUserData</h4>
+<pre class="fcndec">
void XMLCALL
XML_SetUserData(XML_Parser p,
void *userData);
@@ -2018,7 +2309,8 @@ the memory associated with it, then you've probably just leaked
memory.
</div>
-<pre class="fcndec" id="XML_GetUserData">
+<h4 id="XML_GetUserData">XML_GetUserData</h4>
+<pre class="fcndec">
void * XMLCALL
XML_GetUserData(XML_Parser p);
</pre>
@@ -2027,7 +2319,8 @@ This returns the user data pointer that gets passed to handlers.
It is actually implemented as a macro.
</div>
-<pre class="fcndec" id="XML_UseParserAsHandlerArg">
+<h4 id="XML_UseParserAsHandlerArg">XML_UseParserAsHandlerArg</h4>
+<pre class="fcndec">
void XMLCALL
XML_UseParserAsHandlerArg(XML_Parser p);
</pre>
@@ -2038,7 +2331,8 @@ using the <code><a href= "#XML_GetUserData"
>XML_GetUserData</a></code> function.
</div>
-<pre class="fcndec" id="XML_SetBase">
+<h4 id="XML_SetBase">XML_SetBase</h4>
+<pre class="fcndec">
enum XML_Status XMLCALL
XML_SetBase(XML_Parser p,
const XML_Char *base);
@@ -2050,7 +2344,8 @@ there's no memory to store base, otherwise it's
<code>XML_STATUS_OK</code>.
</div>
-<pre class="fcndec" id="XML_GetBase">
+<h4 id="XML_GetBase">XML_GetBase</h4>
+<pre class="fcndec">
const XML_Char * XMLCALL
XML_GetBase(XML_Parser p);
</pre>
@@ -2058,7 +2353,8 @@ XML_GetBase(XML_Parser p);
Return the base for resolving relative URIs.
</div>
-<pre class="fcndec" id="XML_GetSpecifiedAttributeCount">
+<h4 id="XML_GetSpecifiedAttributeCount">XML_GetSpecifiedAttributeCount</h4>
+<pre class="fcndec">
int XMLCALL
XML_GetSpecifiedAttributeCount(XML_Parser p);
</pre>
@@ -2074,7 +2370,8 @@ call to a start handler. If called inside a start handler, then that
means the current call.
</div>
-<pre class="fcndec" id="XML_GetIdAttributeIndex">
+<h4 id="XML_GetIdAttributeIndex">XML_GetIdAttributeIndex</h4>
+<pre class="fcndec">
int XMLCALL
XML_GetIdAttributeIndex(XML_Parser p);
</pre>
@@ -2086,7 +2383,8 @@ attribute. If called inside a start handler, then that means the
current call.
</div>
-<pre class="fcndec" id="XML_GetAttributeInfo">
+<h4 id="XML_GetAttributeInfo">XML_GetAttributeInfo</h4>
+<pre class="fcndec">
const XML_AttrInfo * XMLCALL
XML_GetAttributeInfo(XML_Parser parser);
</pre>
@@ -2107,14 +2405,15 @@ as 1; thus the number of entries in the array is
<code>XML_GetSpecifiedAttributeCount(parser) / 2</code>.
</div>
-<pre class="fcndec" id="XML_SetEncoding">
+<h4 id="XML_SetEncoding">XML_SetEncoding</h4>
+<pre class="fcndec">
enum XML_Status XMLCALL
XML_SetEncoding(XML_Parser p,
const XML_Char *encoding);
</pre>
<div class="fcndef">
Set the encoding to be used by the parser. It is equivalent to
-passing a non-null encoding argument to the parser creation functions.
+passing a non-<code>NULL</code> encoding argument to the parser creation functions.
It must not be called after <code><a href= "#XML_Parse"
>XML_Parse</a></code> or <code><a href= "#XML_ParseBuffer"
>XML_ParseBuffer</a></code> have been called on the given parser.
@@ -2122,7 +2421,8 @@ Returns <code>XML_STATUS_OK</code> on success or
<code>XML_STATUS_ERROR</code> on error.
</div>
-<pre class="fcndec" id="XML_SetParamEntityParsing">
+<h4 id="XML_SetParamEntityParsing">XML_SetParamEntityParsing</h4>
+<pre class="fcndec">
int XMLCALL
XML_SetParamEntityParsing(XML_Parser p,
enum XML_ParamEntityParsing code);
@@ -2142,7 +2442,8 @@ The choices for <code>code</code> are:
no effect and will always return 0.
</div>
-<pre class="fcndec" id="XML_SetHashSalt">
+<h4 id="XML_SetHashSalt">XML_SetHashSalt</h4>
+<pre class="fcndec">
int XMLCALL
XML_SetHashSalt(XML_Parser p,
unsigned long hash_salt);
@@ -2153,15 +2454,16 @@ Helps in preventing DoS attacks based on predicting hash
function behavior. In order to have an effect this must be called
before parsing has started. Returns 1 if successful, 0 when called
after <code>XML_Parse</code> or <code>XML_ParseBuffer</code>.
-<p><b>Note:</b>This call is optional, as the parser will auto-generate
+<p><b>Note:</b> This call is optional, as the parser will auto-generate
a new random salt value if no value has been set at the start of parsing.</p>
-<p><b>Note:</b>One should not call <code>XML_SetHashSalt</code> with a
+<p><b>Note:</b> One should not call <code>XML_SetHashSalt</code> with a
hash salt value of 0, as this value is used as sentinel value to indicate
that <code>XML_SetHashSalt</code> has <b>not</b> been called. Consequently
such a call will have no effect, even if it returns 1.</p>
</div>
-<pre class="fcndec" id="XML_UseForeignDTD">
+<h4 id="XML_UseForeignDTD">XML_UseForeignDTD</h4>
+<pre class="fcndec">
enum XML_Error XMLCALL
XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
</pre>
@@ -2183,7 +2485,7 @@ called. The setting of parameter entity parsing, controlled using
external entity reference handler set via <code><a href=
"#XML_SetExternalEntityRefHandler"
>XML_SetExternalEntityRefHandler</a></code> with both
-<code>publicId</code> and <code>systemId</code> set to NULL.</p>
+<code>publicId</code> and <code>systemId</code> set to <code>NULL</code>.</p>
<p>If this function is called after parsing has begun, it returns
<code>XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING</code> and ignores
@@ -2198,7 +2500,8 @@ the document had a DTD with an external subset. This holds true even if
the external entity reference handler returns without action.</p>
</div>
-<pre class="fcndec" id="XML_SetReturnNSTriplet">
+<h4 id="XML_SetReturnNSTriplet">XML_SetReturnNSTriplet</h4>
+<pre class="fcndec">
void XMLCALL
XML_SetReturnNSTriplet(XML_Parser parser,
int do_nst);
@@ -2220,7 +2523,8 @@ default manner, URI then local_name separated by the namespace
separator.</p>
</div>
-<pre class="fcndec" id="XML_DefaultCurrent">
+<h4 id="XML_DefaultCurrent">XML_DefaultCurrent</h4>
+<pre class="fcndec">
void XMLCALL
XML_DefaultCurrent(XML_Parser parser);
</pre>
@@ -2234,7 +2538,8 @@ href="#XML_SetDefaultHandler" >XML_SetDefaultHandler</a></code> or
not a default handler.
</div>
-<pre class="fcndec" id="XML_ExpatVersion">
+<h4 id="XML_ExpatVersion">XML_ExpatVersion</h4>
+<pre class="fcndec">
XML_LChar * XMLCALL
XML_ExpatVersion();
</pre>
@@ -2242,7 +2547,8 @@ XML_ExpatVersion();
Return the library version as a string (e.g. <code>"expat_1.95.1"</code>).
</div>
-<pre class="fcndec" id="XML_ExpatVersionInfo">
+<h4 id="XML_ExpatVersionInfo">XML_ExpatVersionInfo</h4>
+<pre class="fcndec">
struct XML_Expat_Version XMLCALL
XML_ExpatVersionInfo();
</pre>
@@ -2266,7 +2572,8 @@ Testing these constants is currently the best way to determine if
particular parts of the Expat API are available.
</div>
-<pre class="fcndec" id="XML_GetFeatureList">
+<h4 id="XML_GetFeatureList">XML_GetFeatureList</h4>
+<pre class="fcndec">
const XML_Feature * XMLCALL
XML_GetFeatureList();
</pre>
@@ -2299,7 +2606,7 @@ check these features to do so at runtime.</p>
<p>The return value is an array of <code>XML_Feature</code>,
terminated by a record with a <code>feature</code> of
-<code>XML_FEATURE_END</code> and <code>name</code> of NULL,
+<code>XML_FEATURE_END</code> and <code>name</code> of <code>NULL</code>,
identifying the feature-test macros Expat was compiled with. Since an
application that requires this kind of information needs to determine
the type of character the <code>name</code> points to, records for the
@@ -2327,7 +2634,8 @@ time, the following features have been defined to have values:</p>
</dl>
</div>
-<pre class="fcndec" id="XML_FreeContentModel">
+<h4 id="XML_FreeContentModel">XML_FreeContentModel</h4>
+<pre class="fcndec">
void XMLCALL
XML_FreeContentModel(XML_Parser parser, XML_Content *model);
</pre>
@@ -2346,19 +2654,21 @@ applications. This can be essential when using dynamically loaded
libraries which use different C standard libraries (this can happen on
Windows, at least).</p>
-<pre class="fcndec" id="XML_MemMalloc">
+<h4 id="XML_MemMalloc">XML_MemMalloc</h4>
+<pre class="fcndec">
void * XMLCALL
XML_MemMalloc(XML_Parser parser, size_t size);
</pre>
<div class="fcndef">
Allocate <code>size</code> bytes of memory using the allocator the
<code>parser</code> object has been configured to use. Returns a
-pointer to the memory or NULL on failure. Memory allocated in this
+pointer to the memory or <code>NULL</code> on failure. Memory allocated in this
way must be freed using <code><a href="#XML_MemFree"
>XML_MemFree</a></code>.
</div>
-<pre class="fcndec" id="XML_MemRealloc">
+<h4 id="XML_MemRealloc">XML_MemRealloc</h4>
+<pre class="fcndec">
void * XMLCALL
XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
</pre>
@@ -2367,9 +2677,9 @@ Allocate <code>size</code> bytes of memory using the allocator the
<code>parser</code> object has been configured to use.
<code>ptr</code> must point to a block of memory allocated by <code><a
href="#XML_MemMalloc" >XML_MemMalloc</a></code> or
-<code>XML_MemRealloc</code>, or be NULL. This function tries to
+<code>XML_MemRealloc</code>, or be <code>NULL</code>. This function tries to
expand the block pointed to by <code>ptr</code> if possible. Returns
-a pointer to the memory or NULL on failure. On success, the original
+a pointer to the memory or <code>NULL</code> on failure. On success, the original
block has either been expanded or freed. On failure, the original
block has not been freed; the caller is responsible for freeing the
original block. Memory allocated in this way must be freed using
@@ -2377,20 +2687,24 @@ original block. Memory allocated in this way must be freed using
>XML_MemFree</a></code>.
</div>
-<pre class="fcndec" id="XML_MemFree">
+<h4 id="XML_MemFree">XML_MemFree</h4>
+<pre class="fcndec">
void XMLCALL
XML_MemFree(XML_Parser parser, void *ptr);
</pre>
<div class="fcndef">
Free a block of memory pointed to by <code>ptr</code>. The block must
have been allocated by <code><a href="#XML_MemMalloc"
->XML_MemMalloc</a></code> or <code>XML_MemRealloc</code>, or be NULL.
+>XML_MemMalloc</a></code> or <code>XML_MemRealloc</code>, or be <code>NULL</code>.
</div>
<hr />
-<p><a href="http://validator.w3.org/check/referer"><img
- src="valid-xhtml10.png" alt="Valid XHTML 1.0!"
- height="31" width="88" class="noborder" /></a></p>
+
+ <div class="footer">
+ Found a bug in the documentation?
+ <a href="https://github.com/libexpat/libexpat/issues">Please file a bug report.</a>
+ </div>
+
</div>
</body>
</html>
diff --git a/3rdparty/expat/doc/style.css b/3rdparty/expat/doc/style.css
index 69df30bcecb..1b8cd10dffa 100644
--- a/3rdparty/expat/doc/style.css
+++ b/3rdparty/expat/doc/style.css
@@ -1,101 +1,47 @@
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2021 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/* Stop not using half the screen */
body {
- background-color: white;
- border: 0px;
- margin: 0px;
- padding: 0px;
-}
-
-.corner {
- width: 200px;
- height: 80px;
- text-align: center;
-}
-
-.banner {
- background-color: rgb(110,139,61);
- color: rgb(255,236,176);
- padding-left: 2em;
-}
-
-.banner h1 {
- font-size: 200%;
-}
-
-.content {
- padding: 0em 2em 1em 2em;
-}
-
-.releaseno {
- background-color: rgb(110,139,61);
- color: rgb(255,236,176);
- padding-bottom: 0.3em;
- padding-top: 0.5em;
- text-align: center;
- font-weight: bold;
-}
-
-.noborder {
- border-width: 0px;
-}
-
-.eg {
- padding-left: 1em;
- padding-top: .5em;
- padding-bottom: .5em;
- border: solid thin;
- margin: 1em 0;
- background-color: tan;
- margin-left: 2em;
- margin-right: 10%;
-}
-
-.pseudocode {
- padding-left: 1em;
- padding-top: .5em;
- padding-bottom: .5em;
- border: solid thin;
- margin: 1em 0;
- background-color: rgb(250,220,180);
- margin-left: 2em;
- margin-right: 10%;
-}
-
-.handler {
- width: 100%;
- border-top-width: thin;
- margin-bottom: 1em;
-}
-
-.handler p {
- margin-left: 2em;
-}
-
-.setter {
- font-weight: bold;
-}
-
-.signature {
- color: navy;
-}
-
-.fcndec {
- width: 100%;
- border-top-width: thin;
- font-weight: bold;
-}
-
-.fcndef {
- margin-left: 2em;
- margin-bottom: 2em;
-}
-
-dd {
- margin-bottom: 2em;
+ max-width: none; /* was: 80ch */
}
.cpp-symbols dt {
font-family: monospace;
}
-.cpp-symbols dd {
- margin-bottom: 1em;
+
+/* Resemble style of <footer> which is not part of xhtml1-strict */
+.footer {
+ font-size: var(--ok-fs-5);
+ color: var(--ok-tc-1);
}
diff --git a/3rdparty/expat/doc/valid-xhtml10.png b/3rdparty/expat/doc/valid-xhtml10.png
deleted file mode 100644
index 8b5f1baeaa0..00000000000
--- a/3rdparty/expat/doc/valid-xhtml10.png
+++ /dev/null
Binary files differ
diff --git a/3rdparty/expat/doc/xmlwf.1 b/3rdparty/expat/doc/xmlwf.1
index ca56bf97650..76aa7e30d07 100644
--- a/3rdparty/expat/doc/xmlwf.1
+++ b/3rdparty/expat/doc/xmlwf.1
@@ -5,7 +5,7 @@
\\$2 \(la\\$1\(ra\\$3
..
.if \n(.g .mso www.tmac
-.TH XMLWF 1 "March 11, 2016" "" ""
+.TH XMLWF 1 "March 27, 2025" "" ""
.SH NAME
xmlwf \- Determines if an XML document is well-formed
.SH SYNOPSIS
@@ -15,7 +15,27 @@ xmlwf \- Determines if an XML document is well-formed
\fBxmlwf\fR \kx
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
'in \n(.iu+\nxu
-[\fB-s\fR] [\fB-n\fR] [\fB-p\fR] [\fB-x\fR] [\fB-e \fIencoding\fB\fR] [\fB-w\fR] [\fB-d \fIoutput-dir\fB\fR] [\fB-c\fR] [\fB-m\fR] [\fB-r\fR] [\fB-t\fR] [\fB-N\fR] [\fB-v\fR] [file ...]
+[\fIOPTIONS\fR] [\fIFILE\fR ...]
+'in \n(.iu-\nxu
+.ad b
+'hy
+'nh
+.fi
+.ad l
+\fBxmlwf\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+\fB-h\fR | \fB--help\fR
+'in \n(.iu-\nxu
+.ad b
+'hy
+'nh
+.fi
+.ad l
+\fBxmlwf\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+\fB-v\fR | \fB--version\fR
'in \n(.iu-\nxu
.ad b
'hy
@@ -34,7 +54,7 @@ following rules:
\(bu
The file begins with an XML declaration. For instance,
\*(T<<?xml version="1.0" standalone="yes"?>\*(T>.
-\fINOTE:\fR
+\fINOTE\fR:
\fBxmlwf\fR does not currently
check for a valid XML declaration.
.TP 0.2i
@@ -62,10 +82,42 @@ it does not check the DTD. However, it does support
external entities (see the \*(T<\fB\-x\fR\*(T> option).
.SH OPTIONS
When an option includes an argument, you may specify the argument either
-separately ("\*(T<\fB\-d\fR\*(T> output") or concatenated with the
-option ("\*(T<\fB\-d\fR\*(T>output"). \fBxmlwf\fR
+separately ("\*(T<\fB\-d\fR\*(T> \fIoutput\fR") or concatenated with the
+option ("\*(T<\fB\-d\fR\*(T>\fIoutput\fR"). \fBxmlwf\fR
supports both.
.TP
+\*(T<\fB\-a\fR\*(T> \fIfactor\fR
+Sets the maximum tolerated amplification factor
+for protection against billion laughs attacks (default: 100.0).
+The amplification factor is calculated as ..
+
+.nf
+
+ amplification := (direct + indirect) / direct
+
+.fi
+
+\&.. while parsing, whereas
+<direct> is the number of bytes read
+from the primary document in parsing and
+<indirect> is the number of bytes
+added by expanding entities and reading of external DTD files,
+combined.
+
+\fINOTE\fR:
+If you ever need to increase this value for non-attack payload,
+please file a bug report.
+.TP
+\*(T<\fB\-b\fR\*(T> \fIbytes\fR
+Sets the number of output bytes (including amplification)
+needed to activate protection against billion laughs attacks
+(default: 8 MiB).
+This can be thought of as an "activation threshold".
+
+\fINOTE\fR:
+If you ever need to increase this value for non-attack payload,
+please file a bug report.
+.TP
\*(T<\fB\-c\fR\*(T>
If the input file is well-formed and \fBxmlwf\fR
doesn't encounter any errors, the input file is simply copied to
@@ -73,7 +125,7 @@ the output directory unchanged.
This implies no namespaces (turns off \*(T<\fB\-n\fR\*(T>) and
requires \*(T<\fB\-d\fR\*(T> to specify an output directory.
.TP
-\*(T<\fB\-d output\-dir\fR\*(T>
+\*(T<\fB\-d\fR\*(T> \fIoutput-dir\fR
Specifies a directory to contain transformed
representations of the input files.
By default, \*(T<\fB\-d\fR\*(T> outputs a canonical representation
@@ -96,7 +148,7 @@ is treated equivalently to data.
More on canonical XML can be found at
http://www.jclark.com/xml/canonxml.html .
.TP
-\*(T<\fB\-e encoding\fR\*(T>
+\*(T<\fB\-e\fR\*(T> \fIencoding\fR
Specifies the character encoding for the document, overriding
any document encoding declaration. \fBxmlwf\fR
supports four built-in encodings:
@@ -106,6 +158,25 @@ supports four built-in encodings:
\*(T<ISO\-8859\-1\*(T>.
Also see the \*(T<\fB\-w\fR\*(T> option.
.TP
+\*(T<\fB\-g\fR\*(T> \fIbytes\fR
+Sets the buffer size to request per call pair to
+\*(T<\fBXML_GetBuffer\fR\*(T> and \*(T<\fBread\fR\*(T>
+(default: 8 KiB).
+.TP
+\*(T<\fB\-h\fR\*(T>, \*(T<\fB\-\-help\fR\*(T>
+Prints short usage information on command \fBxmlwf\fR,
+and then exits.
+Similar to this man page but more concise.
+.TP
+\*(T<\fB\-k\fR\*(T>
+When processing multiple files, \fBxmlwf\fR
+by default halts after the the first file with an error.
+This tells \fBxmlwf\fR to report the error
+but to keep processing.
+This can be useful, for example, when testing a filter that converts
+many files to XML and you want to quickly find out which conversions
+failed.
+.TP
\*(T<\fB\-m\fR\*(T>
Outputs some strange sort of XML file that completely
describes the input file, including character positions.
@@ -121,13 +192,17 @@ This matches the example output used by the formal XML test cases.
Requires \*(T<\fB\-d\fR\*(T> to specify an output file.
.TP
\*(T<\fB\-p\fR\*(T>
-Tells xmlwf to process external DTDs and parameter
+Tells \fBxmlwf\fR to process external DTDs and parameter
entities.
Normally \fBxmlwf\fR never parses parameter
entities. \*(T<\fB\-p\fR\*(T> tells it to always parse them.
\*(T<\fB\-p\fR\*(T> implies \*(T<\fB\-x\fR\*(T>.
.TP
+\*(T<\fB\-q\fR\*(T>
+Disable reparse deferral, and allow quadratic parse runtime
+on large tokens (default: reparse deferral enabled).
+.TP
\*(T<\fB\-r\fR\*(T>
Normally \fBxmlwf\fR memory-maps the XML file
before parsing; this can result in faster parsing on many
@@ -156,7 +231,7 @@ without client overhead.
\*(T<\fB\-t\fR\*(T> turns off most of the output options
(\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-m\fR\*(T>, \*(T<\fB\-c\fR\*(T>, ...).
.TP
-\*(T<\fB\-v\fR\*(T>
+\*(T<\fB\-v\fR\*(T>, \*(T<\fB\-\-version\fR\*(T>
Prints the version of the Expat library being used, including some
information on the compile-time configuration of the library, and
then exits.
@@ -165,7 +240,7 @@ then exits.
Enables support for Windows code pages.
Normally, \fBxmlwf\fR will throw an error if it
runs across an encoding that it is not equipped to handle itself. With
-\*(T<\fB\-w\fR\*(T>, xmlwf will try to use a Windows code
+\*(T<\fB\-w\fR\*(T>, \fBxmlwf\fR will try to use a Windows code
page. See also \*(T<\fB\-e\fR\*(T>.
.TP
\*(T<\fB\-x\fR\*(T>
@@ -210,24 +285,32 @@ will run \fBxmlwf\fR on the file
Older versions of \fBxmlwf\fR do not support
reading from standard input.
.SH OUTPUT
-If an input file is not well-formed,
-\fBxmlwf\fR prints a single line describing
-the problem to standard output. If a file is well formed,
-\fBxmlwf\fR outputs nothing.
+\fBxmlwf\fR outputs nothing for files which are problem-free.
+If any input file is not well-formed, or if the output for any
+input file cannot be opened, \fBxmlwf\fR prints a single
+line describing the problem to standard output.
+.PP
+If the \*(T<\fB\-k\fR\*(T> option is not provided, \fBxmlwf\fR
+halts upon encountering a well-formedness or output-file error.
+If \*(T<\fB\-k\fR\*(T> is provided, \fBxmlwf\fR continues
+processing the remaining input files, describing problems found with any of them.
.SH "EXIT STATUS"
-For option \*(T<\fB\-v\fR\*(T> or \*(T<\fB\-h\fR\*(T>, \fBxmlwf\fR always exits with status code 0. For other cases, the following exit status codes are returned:
+For options \*(T<\fB\-v\fR\*(T>|\*(T<\fB\-\-version\fR\*(T> or \*(T<\fB\-h\fR\*(T>|\*(T<\fB\-\-help\fR\*(T>, \fBxmlwf\fR always exits with status code 0. For other cases, the following exit status codes are returned:
.TP
\*(T<\fB0\fR\*(T>
-The input files are well-formed.
+The input files are well-formed and the output (if requested) was written successfully.
.TP
\*(T<\fB1\fR\*(T>
An internal error occurred.
.TP
\*(T<\fB2\fR\*(T>
-An input file was not well-formed or could not be parsed.
+One or more input files were not well-formed or could not be parsed.
.TP
\*(T<\fB3\fR\*(T>
If using the \*(T<\fB\-d\fR\*(T> option, an error occurred opening an output file.
+.TP
+\*(T<\fB4\fR\*(T>
+There was a command-line argument error in how \fBxmlwf\fR was invoked.
.SH BUGS
The errors should go to standard error, not standard output.
.PP
@@ -239,24 +322,16 @@ I have no idea why anyone would want to use the
\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-c\fR\*(T>, and
\*(T<\fB\-m\fR\*(T> options. If someone could explain it to
me, I'd like to add this information to this manpage.
-.SH ALTERNATIVES
-Here are some XML validators on the web:
-
-.nf
-
-http://www.hcrc.ed.ac.uk/~richard/xml\-check.html
-http://www.stg.brown.edu/service/xmlvalid/
-http://www.scripting.com/frontier5/xml/code/xmlValidator.html
-http://www.xml.com/pub/a/tools/ruwf/check.html
-.fi
.SH "SEE ALSO"
.nf
-The Expat home page: http://www.libexpat.org/
-The W3 XML specification: http://www.w3.org/TR/REC\-xml
+The Expat home page: https://libexpat.github.io/
+The W3 XML 1.0 specification (fourth edition): https://www.w3.org/TR/2006/REC\-xml\-20060816/
+Billion laughs attack: https://en.wikipedia.org/wiki/Billion_laughs_attack
.fi
.SH AUTHOR
-This manual page was written by Scott Bronson <\*(T<bronson@rinspin.com\*(T>> for
+This manual page was originally written by Scott Bronson <\*(T<bronson@rinspin.com\*(T>>
+in December 2001 for
the Debian GNU/Linux system (but may be used by others). Permission is
granted to copy, distribute and/or modify this document under
the terms of the GNU Free Documentation
diff --git a/3rdparty/expat/doc/xmlwf.xml b/3rdparty/expat/doc/xmlwf.xml
index 654466cef62..17e9cf51c19 100644
--- a/3rdparty/expat/doc/xmlwf.xml
+++ b/3rdparty/expat/doc/xmlwf.xml
@@ -1,11 +1,28 @@
-<!DOCTYPE refentry [
- <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+<!--
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001 Scott Bronson <bronson@rinspin.com>
+ Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2009 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2016 Ardo van Rangelrooij <ardo@debian.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2020 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2021 Tim Bray <tbray@textuality.com>
+ Unlike most of Expat,
+ this file is copyrighted under the GNU Free Documentation License 1.1.
+-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY dhfirstname "<firstname>Scott</firstname>">
<!ENTITY dhsurname "<surname>Bronson</surname>">
- <!-- Please adjust the date whenever revising the manpage. -->
- <!ENTITY dhdate "<date>March 11, 2016</date>">
- <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
- allowed: see man(7), man(1). -->
+ <!ENTITY dhdate "<date>March 27, 2025</date>">
+ <!-- Please adjust this^^ date whenever cutting a new release. -->
<!ENTITY dhsection "<manvolnum>1</manvolnum>">
<!ENTITY dhemail "<email>bronson@rinspin.com</email>">
<!ENTITY dhusername "Scott Bronson">
@@ -44,25 +61,22 @@
<refsynopsisdiv>
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-s</option></arg>
- <arg><option>-n</option></arg>
- <arg><option>-p</option></arg>
- <arg><option>-x</option></arg>
-
- <arg><option>-e <replaceable>encoding</replaceable></option></arg>
- <arg><option>-w</option></arg>
-
- <arg><option>-d <replaceable>output-dir</replaceable></option></arg>
- <arg><option>-c</option></arg>
- <arg><option>-m</option></arg>
-
- <arg><option>-r</option></arg>
- <arg><option>-t</option></arg>
- <arg><option>-N</option></arg>
-
- <arg><option>-v</option></arg>
-
- <arg>file ...</arg>
+ <arg><replaceable>OPTIONS</replaceable></arg>
+ <arg><replaceable>FILE</replaceable> ...</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>&dhpackage;</command>
+ <group choice="plain">
+ <arg><option>-h</option></arg>
+ <arg><option>--help</option></arg>
+ </group>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>&dhpackage;</command>
+ <group choice="plain">
+ <arg><option>-v</option></arg>
+ <arg><option>--version</option></arg>
+ </group>
</cmdsynopsis>
</refsynopsisdiv>
@@ -95,7 +109,7 @@
<listitem><para>
The file begins with an XML declaration. For instance,
<literal>&lt;?xml version="1.0" standalone="yes"?&gt;</literal>.
- <emphasis>NOTE:</emphasis>
+ <emphasis>NOTE</emphasis>:
<command>&dhpackage;</command> does not currently
check for a valid XML declaration.
</para></listitem>
@@ -132,14 +146,58 @@
<para>
When an option includes an argument, you may specify the argument either
-separately ("<option>-d</option> output") or concatenated with the
-option ("<option>-d</option>output"). <command>&dhpackage;</command>
+separately ("<option>-d</option> <replaceable>output</replaceable>") or concatenated with the
+option ("<option>-d</option><replaceable>output</replaceable>"). <command>&dhpackage;</command>
supports both.
</para>
<variablelist>
<varlistentry>
+ <term><option>-a</option> <replaceable>factor</replaceable></term>
+ <listitem>
+ <para>
+ Sets the maximum tolerated amplification factor
+ for protection against billion laughs attacks (default: 100.0).
+ The amplification factor is calculated as ..
+ </para>
+ <literallayout>
+ amplification := (direct + indirect) / direct
+ </literallayout>
+ <para>
+ .. while parsing, whereas
+ &lt;direct&gt; is the number of bytes read
+ from the primary document in parsing and
+ &lt;indirect&gt; is the number of bytes
+ added by expanding entities and reading of external DTD files,
+ combined.
+ </para>
+ <para>
+ <emphasis>NOTE</emphasis>:
+ If you ever need to increase this value for non-attack payload,
+ please file a bug report.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-b</option> <replaceable>bytes</replaceable></term>
+ <listitem>
+ <para>
+ Sets the number of output bytes (including amplification)
+ needed to activate protection against billion laughs attacks
+ (default: 8 MiB).
+ This can be thought of as an &quot;activation threshold&quot;.
+ </para>
+ <para>
+ <emphasis>NOTE</emphasis>:
+ If you ever need to increase this value for non-attack payload,
+ please file a bug report.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-c</option></term>
<listitem>
<para>
@@ -153,7 +211,7 @@ supports both.
</varlistentry>
<varlistentry>
- <term><option>-d output-dir</option></term>
+ <term><option>-d</option> <replaceable>output-dir</replaceable></term>
<listitem>
<para>
Specifies a directory to contain transformed
@@ -184,7 +242,7 @@ supports both.
</varlistentry>
<varlistentry>
- <term><option>-e encoding</option></term>
+ <term><option>-e</option> <replaceable>encoding</replaceable></term>
<listitem>
<para>
Specifies the character encoding for the document, overriding
@@ -200,6 +258,44 @@ supports both.
</varlistentry>
<varlistentry>
+ <term><option>-g</option> <replaceable>bytes</replaceable></term>
+ <listitem>
+ <para>
+ Sets the buffer size to request per call pair to
+ <function>XML_GetBuffer</function> and <function>read</function>
+ (default: 8 KiB).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-h</option></term>
+ <term><option>--help</option></term>
+ <listitem>
+ <para>
+ Prints short usage information on command <command>&dhpackage;</command>,
+ and then exits.
+ Similar to this man page but more concise.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-k</option></term>
+ <listitem>
+ <para>
+ When processing multiple files, <command>&dhpackage;</command>
+ by default halts after the the first file with an error.
+ This tells <command>&dhpackage;</command> to report the error
+ but to keep processing.
+ This can be useful, for example, when testing a filter that converts
+ many files to XML and you want to quickly find out which conversions
+ failed.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-m</option></term>
<listitem>
<para>
@@ -235,7 +331,7 @@ supports both.
<term><option>-p</option></term>
<listitem>
<para>
- Tells xmlwf to process external DTDs and parameter
+ Tells <command>&dhpackage;</command> to process external DTDs and parameter
entities.
</para>
<para>
@@ -247,6 +343,16 @@ supports both.
</varlistentry>
<varlistentry>
+ <term><option>-q</option></term>
+ <listitem>
+ <para>
+ Disable reparse deferral, and allow quadratic parse runtime
+ on large tokens (default: reparse deferral enabled).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-r</option></term>
<listitem>
<para>
@@ -292,9 +398,10 @@ supports both.
</para>
</listitem>
</varlistentry>
-
+
<varlistentry>
<term><option>-v</option></term>
+ <term><option>--version</option></term>
<listitem>
<para>
Prints the version of the Expat library being used, including some
@@ -311,7 +418,7 @@ supports both.
Enables support for Windows code pages.
Normally, <command>&dhpackage;</command> will throw an error if it
runs across an encoding that it is not equipped to handle itself. With
- <option>-w</option>, &dhpackage; will try to use a Windows code
+ <option>-w</option>, <command>&dhpackage;</command> will try to use a Windows code
page. See also <option>-e</option>.
</para>
</listitem>
@@ -379,20 +486,26 @@ supports both.
<refsect1>
<title>OUTPUT</title>
<para>
- If an input file is not well-formed,
- <command>&dhpackage;</command> prints a single line describing
- the problem to standard output. If a file is well formed,
- <command>&dhpackage;</command> outputs nothing.
- </para>
+ <command>&dhpackage;</command> outputs nothing for files which are problem-free.
+ If any input file is not well-formed, or if the output for any
+ input file cannot be opened, <command>&dhpackage;</command> prints a single
+ line describing the problem to standard output.
+ </para>
+ <para>
+ If the <option>-k</option> option is not provided, <command>&dhpackage;</command>
+ halts upon encountering a well-formedness or output-file error.
+ If <option>-k</option> is provided, <command>&dhpackage;</command> continues
+ processing the remaining input files, describing problems found with any of them.
+ </para>
</refsect1>
<refsect1>
<title>EXIT STATUS</title>
- <para>For option <option>-v</option> or <option>-h</option>, <command>&dhpackage;</command> always exits with status code 0. For other cases, the following exit status codes are returned:
+ <para>For options <option>-v</option>|<option>--version</option> or <option>-h</option>|<option>--help</option>, <command>&dhpackage;</command> always exits with status code 0. For other cases, the following exit status codes are returned:
<variablelist>
<varlistentry>
<term><option>0</option></term>
- <listitem><para>The input files are well-formed.</para>
+ <listitem><para>The input files are well-formed and the output (if requested) was written successfully.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -402,7 +515,7 @@ supports both.
</varlistentry>
<varlistentry>
<term><option>2</option></term>
- <listitem><para>An input file was not well-formed or could not be parsed.</para>
+ <listitem><para>One or more input files were not well-formed or could not be parsed.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -410,6 +523,11 @@ supports both.
<listitem><para>If using the <option>-d</option> option, an error occurred opening an output file.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>4</option></term>
+ <listitem><para>There was a command-line argument error in how <command>&dhpackage;</command> was invoked.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</para>
</refsect1>
@@ -434,27 +552,13 @@ supports both.
</refsect1>
<refsect1>
- <title>ALTERNATIVES</title>
- <para>
- Here are some XML validators on the web:
-
-<literallayout>
-http://www.hcrc.ed.ac.uk/~richard/xml-check.html
-http://www.stg.brown.edu/service/xmlvalid/
-http://www.scripting.com/frontier5/xml/code/xmlValidator.html
-http://www.xml.com/pub/a/tools/ruwf/check.html
-</literallayout>
-
- </para>
- </refsect1>
-
- <refsect1>
<title>SEE ALSO</title>
<para>
<literallayout>
-The Expat home page: http://www.libexpat.org/
-The W3 XML specification: http://www.w3.org/TR/REC-xml
+The Expat home page: https://libexpat.github.io/
+The W3 XML 1.0 specification (fourth edition): https://www.w3.org/TR/2006/REC-xml-20060816/
+Billion laughs attack: https://en.wikipedia.org/wiki/Billion_laughs_attack
</literallayout>
</para>
@@ -463,7 +567,8 @@ The W3 XML specification: http://www.w3.org/TR/REC-xml
<refsect1>
<title>AUTHOR</title>
<para>
- This manual page was written by &dhusername; &dhemail; for
+ This manual page was originally written by &dhusername; &dhemail;
+ in December 2001 for
the &debian; system (but may be used by others). Permission is
granted to copy, distribute and/or modify this document under
the terms of the <acronym>GNU</acronym> Free Documentation
diff --git a/3rdparty/expat/examples/Makefile.am b/3rdparty/expat/examples/Makefile.am
index c3b1f7bedbf..e2e22bce8f6 100644
--- a/3rdparty/expat/examples/Makefile.am
+++ b/3rdparty/expat/examples/Makefile.am
@@ -6,7 +6,8 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2022 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -30,7 +31,10 @@
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
-noinst_PROGRAMS = elements outline
+noinst_PROGRAMS = element_declarations elements outline
+
+element_declarations_SOURCES = element_declarations.c
+element_declarations_LDADD = ../lib/libexpat.la
elements_SOURCES = elements.c
elements_LDADD = ../lib/libexpat.la
diff --git a/3rdparty/expat/examples/Makefile.in b/3rdparty/expat/examples/Makefile.in
index 7c4a296ba2b..044c9089c56 100644
--- a/3rdparty/expat/examples/Makefile.in
+++ b/3rdparty/expat/examples/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,8 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2022 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -118,7 +119,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-noinst_PROGRAMS = elements$(EXEEXT) outline$(EXEEXT)
+noinst_PROGRAMS = element_declarations$(EXEEXT) elements$(EXEEXT) \
+ outline$(EXEEXT)
subdir = examples
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
@@ -132,6 +134,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -141,13 +145,16 @@ CONFIG_HEADER = $(top_builddir)/expat_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
-am_elements_OBJECTS = elements.$(OBJEXT)
-elements_OBJECTS = $(am_elements_OBJECTS)
-elements_DEPENDENCIES = ../lib/libexpat.la
+am_element_declarations_OBJECTS = element_declarations.$(OBJEXT)
+element_declarations_OBJECTS = $(am_element_declarations_OBJECTS)
+element_declarations_DEPENDENCIES = ../lib/libexpat.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
+am_elements_OBJECTS = elements.$(OBJEXT)
+elements_OBJECTS = $(am_elements_OBJECTS)
+elements_DEPENDENCIES = ../lib/libexpat.la
am_outline_OBJECTS = outline.$(OBJEXT)
outline_OBJECTS = $(am_outline_OBJECTS)
outline_DEPENDENCIES = ../lib/libexpat.la
@@ -166,7 +173,8 @@ am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp
am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = ./$(DEPDIR)/elements.Po ./$(DEPDIR)/outline.Po
+am__depfiles_remade = ./$(DEPDIR)/element_declarations.Po \
+ ./$(DEPDIR)/elements.Po ./$(DEPDIR)/outline.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -186,8 +194,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = $(elements_SOURCES) $(outline_SOURCES)
-DIST_SOURCES = $(elements_SOURCES) $(outline_SOURCES)
+SOURCES = $(element_declarations_SOURCES) $(elements_SOURCES) \
+ $(outline_SOURCES)
+DIST_SOURCES = $(element_declarations_SOURCES) $(elements_SOURCES) \
+ $(outline_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -210,8 +220,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/conftools/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -231,8 +239,10 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CPP = @CPP@
+CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
@@ -248,10 +258,20 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
FGREP = @FGREP@
+FILECMD = @FILECMD@
FILEMAP = @FILEMAP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -261,6 +281,8 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LIBAGE = @LIBAGE@
LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
+LIBM = @LIBM@
LIBOBJS = @LIBOBJS@
LIBREVISION = @LIBREVISION@
LIBS = @LIBS@
@@ -269,6 +291,7 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -290,9 +313,12 @@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SIZEOF_VOID_P = @SIZEOF_VOID_P@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
STRIP = @STRIP@
VERSION = @VERSION@
-_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -347,6 +373,8 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+element_declarations_SOURCES = element_declarations.c
+element_declarations_LDADD = ../lib/libexpat.la
elements_SOURCES = elements.c
elements_LDADD = ../lib/libexpat.la
outline_SOURCES = outline.c
@@ -355,7 +383,7 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -379,9 +407,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
@@ -394,6 +422,10 @@ clean-noinstPROGRAMS:
echo " rm -f" $$list; \
rm -f $$list
+element_declarations$(EXEEXT): $(element_declarations_OBJECTS) $(element_declarations_DEPENDENCIES) $(EXTRA_element_declarations_DEPENDENCIES)
+ @rm -f element_declarations$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(element_declarations_OBJECTS) $(element_declarations_LDADD) $(LIBS)
+
elements$(EXEEXT): $(elements_OBJECTS) $(elements_DEPENDENCIES) $(EXTRA_elements_DEPENDENCIES)
@rm -f elements$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(elements_OBJECTS) $(elements_LDADD) $(LIBS)
@@ -408,6 +440,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/element_declarations.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elements.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/outline.Po@am__quote@ # am--include-marker
@@ -495,7 +528,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -569,7 +601,8 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
- -rm -f ./$(DEPDIR)/elements.Po
+ -rm -f ./$(DEPDIR)/element_declarations.Po
+ -rm -f ./$(DEPDIR)/elements.Po
-rm -f ./$(DEPDIR)/outline.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
@@ -616,7 +649,8 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -f ./$(DEPDIR)/elements.Po
+ -rm -f ./$(DEPDIR)/element_declarations.Po
+ -rm -f ./$(DEPDIR)/elements.Po
-rm -f ./$(DEPDIR)/outline.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/3rdparty/expat/examples/element_declarations.c b/3rdparty/expat/examples/element_declarations.c
new file mode 100644
index 00000000000..d644b2ffa5e
--- /dev/null
+++ b/3rdparty/expat/examples/element_declarations.c
@@ -0,0 +1,235 @@
+/* Read an XML document from standard input and print
+ element declarations (if any) to standard output.
+ It must be used with Expat compiled for UTF-8 output.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2004-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2019 Zhongyuan Zhou <zhouzhongyuan@huawei.com>
+ Copyright (c) 2024 Hanno Böck <hanno@gentoo.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <expat.h>
+
+#ifdef XML_LARGE_SIZE
+# define XML_FMT_INT_MOD "ll"
+#else
+# define XML_FMT_INT_MOD "l"
+#endif
+
+#ifdef XML_UNICODE_WCHAR_T
+# define XML_FMT_STR "ls"
+#else
+# define XML_FMT_STR "s"
+#endif
+
+// While traversing the XML_Content tree, we avoid recursion
+// to not be vulnerable to a denial of service attack.
+typedef struct StackStruct {
+ const XML_Content *model;
+ unsigned level;
+ struct StackStruct *prev;
+} Stack;
+
+static Stack *
+stackPushMalloc(Stack *stackTop, const XML_Content *model, unsigned level) {
+ Stack *const newStackTop = malloc(sizeof(Stack));
+ if (! newStackTop) {
+ return NULL;
+ }
+ newStackTop->model = model;
+ newStackTop->level = level;
+ newStackTop->prev = stackTop;
+ return newStackTop;
+}
+
+static Stack *
+stackPopFree(Stack *stackTop) {
+ Stack *const newStackTop = stackTop->prev;
+ free(stackTop);
+ return newStackTop;
+}
+
+static char *
+contentTypeName(enum XML_Content_Type contentType) {
+ switch (contentType) {
+ case XML_CTYPE_EMPTY:
+ return "EMPTY";
+ case XML_CTYPE_ANY:
+ return "ANY";
+ case XML_CTYPE_MIXED:
+ return "MIXED";
+ case XML_CTYPE_NAME:
+ return "NAME";
+ case XML_CTYPE_CHOICE:
+ return "CHOICE";
+ case XML_CTYPE_SEQ:
+ return "SEQ";
+ default:
+ return "???";
+ }
+}
+
+static char *
+contentQuantName(enum XML_Content_Quant contentQuant) {
+ switch (contentQuant) {
+ case XML_CQUANT_NONE:
+ return "NONE";
+ case XML_CQUANT_OPT:
+ return "OPT";
+ case XML_CQUANT_REP:
+ return "REP";
+ case XML_CQUANT_PLUS:
+ return "PLUS";
+ default:
+ return "???";
+ }
+}
+
+static void
+dumpContentModelElement(const XML_Content *model, unsigned level,
+ const XML_Content *root) {
+ // Indent
+ unsigned u = 0;
+ for (; u < level; u++) {
+ printf(" ");
+ }
+
+ // Node
+ printf("[%u] type=%s(%u), quant=%s(%u)", (unsigned)(model - root),
+ contentTypeName(model->type), (unsigned int)model->type,
+ contentQuantName(model->quant), (unsigned int)model->quant);
+ if (model->name) {
+ printf(", name=\"%" XML_FMT_STR "\"", model->name);
+ } else {
+ printf(", name=NULL");
+ }
+ printf(", numchildren=%u", model->numchildren);
+ printf("\n");
+}
+
+static bool
+dumpContentModel(const XML_Char *name, const XML_Content *root) {
+ printf("Element \"%" XML_FMT_STR "\":\n", name);
+ Stack *stackTop = stackPushMalloc(NULL, root, 1);
+ if (! stackTop) {
+ return false;
+ }
+
+ while (stackTop) {
+ const XML_Content *const model = stackTop->model;
+ const unsigned level = stackTop->level;
+
+ dumpContentModelElement(model, level, root);
+
+ stackTop = stackPopFree(stackTop);
+
+ for (size_t u = model->numchildren; u >= 1; u--) {
+ Stack *const newStackTop
+ = stackPushMalloc(stackTop, model->children + (u - 1), level + 1);
+ if (! newStackTop) {
+ // We ran out of memory, so let's free all memory allocated
+ // earlier in this function, to be leak-clean:
+ while (stackTop != NULL) {
+ stackTop = stackPopFree(stackTop);
+ }
+ return false;
+ }
+ stackTop = newStackTop;
+ }
+ }
+
+ printf("\n");
+ return true;
+}
+
+static void XMLCALL
+handleElementDeclaration(void *userData, const XML_Char *name,
+ XML_Content *model) {
+ XML_Parser parser = (XML_Parser)userData;
+ const bool success = dumpContentModel(name, model);
+ XML_FreeContentModel(parser, model);
+ if (! success) {
+ XML_StopParser(parser, /* resumable= */ XML_FALSE);
+ }
+}
+
+int
+main(void) {
+ XML_Parser parser = XML_ParserCreate(NULL);
+ int done;
+
+ if (! parser) {
+ fprintf(stderr, "Couldn't allocate memory for parser\n");
+ return 1;
+ }
+
+ XML_SetUserData(parser, parser);
+ XML_SetElementDeclHandler(parser, handleElementDeclaration);
+
+ do {
+ void *const buf = XML_GetBuffer(parser, BUFSIZ);
+ if (! buf) {
+ fprintf(stderr, "Couldn't allocate memory for buffer\n");
+ XML_ParserFree(parser);
+ return 1;
+ }
+
+ const size_t len = fread(buf, 1, BUFSIZ, stdin);
+
+ if (ferror(stdin)) {
+ fprintf(stderr, "Read error\n");
+ XML_ParserFree(parser);
+ return 1;
+ }
+
+ done = feof(stdin);
+
+ if (XML_ParseBuffer(parser, (int)len, done) == XML_STATUS_ERROR) {
+ enum XML_Error errorCode = XML_GetErrorCode(parser);
+ if (errorCode == XML_ERROR_ABORTED) {
+ errorCode = XML_ERROR_NO_MEMORY;
+ }
+ fprintf(stderr,
+ "Parse error at line %" XML_FMT_INT_MOD "u:\n%" XML_FMT_STR "\n",
+ XML_GetCurrentLineNumber(parser), XML_ErrorString(errorCode));
+ XML_ParserFree(parser);
+ return 1;
+ }
+ } while (! done);
+
+ XML_ParserFree(parser);
+ return 0;
+}
diff --git a/3rdparty/expat/examples/elements.c b/3rdparty/expat/examples/elements.c
index eb0c729bff1..e5fb850d501 100644
--- a/3rdparty/expat/examples/elements.c
+++ b/3rdparty/expat/examples/elements.c
@@ -11,7 +11,12 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2004-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2019 Zhongyuan Zhou <zhouzhongyuan@huawei.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -44,7 +49,6 @@
#endif
#ifdef XML_UNICODE_WCHAR_T
-# include <wchar.h>
# define XML_FMT_STR "ls"
#else
# define XML_FMT_STR "s"
@@ -53,7 +57,7 @@
static void XMLCALL
startElement(void *userData, const XML_Char *name, const XML_Char **atts) {
int i;
- int *depthPtr = (int *)userData;
+ int *const depthPtr = (int *)userData;
(void)atts;
for (i = 0; i < *depthPtr; i++)
@@ -64,34 +68,54 @@ startElement(void *userData, const XML_Char *name, const XML_Char **atts) {
static void XMLCALL
endElement(void *userData, const XML_Char *name) {
- int *depthPtr = (int *)userData;
+ int *const depthPtr = (int *)userData;
(void)name;
*depthPtr -= 1;
}
int
-main(int argc, char *argv[]) {
- char buf[BUFSIZ];
+main(void) {
XML_Parser parser = XML_ParserCreate(NULL);
int done;
int depth = 0;
- (void)argc;
- (void)argv;
+
+ if (! parser) {
+ fprintf(stderr, "Couldn't allocate memory for parser\n");
+ return 1;
+ }
XML_SetUserData(parser, &depth);
XML_SetElementHandler(parser, startElement, endElement);
+
do {
- size_t len = fread(buf, 1, sizeof(buf), stdin);
- done = len < sizeof(buf);
- if (XML_Parse(parser, buf, (int)len, done) == XML_STATUS_ERROR) {
- fprintf(stderr, "%" XML_FMT_STR " at line %" XML_FMT_INT_MOD "u\n",
- XML_ErrorString(XML_GetErrorCode(parser)),
- XML_GetCurrentLineNumber(parser));
+ void *const buf = XML_GetBuffer(parser, BUFSIZ);
+ if (! buf) {
+ fprintf(stderr, "Couldn't allocate memory for buffer\n");
+ XML_ParserFree(parser);
+ return 1;
+ }
+
+ const size_t len = fread(buf, 1, BUFSIZ, stdin);
+
+ if (ferror(stdin)) {
+ fprintf(stderr, "Read error\n");
+ XML_ParserFree(parser);
+ return 1;
+ }
+
+ done = feof(stdin);
+
+ if (XML_ParseBuffer(parser, (int)len, done) == XML_STATUS_ERROR) {
+ fprintf(stderr,
+ "Parse error at line %" XML_FMT_INT_MOD "u:\n%" XML_FMT_STR "\n",
+ XML_GetCurrentLineNumber(parser),
+ XML_ErrorString(XML_GetErrorCode(parser)));
XML_ParserFree(parser);
return 1;
}
} while (! done);
+
XML_ParserFree(parser);
return 0;
}
diff --git a/3rdparty/expat/examples/outline.c b/3rdparty/expat/examples/outline.c
index d996b8e3a8d..d2df914fedb 100644
--- a/3rdparty/expat/examples/outline.c
+++ b/3rdparty/expat/examples/outline.c
@@ -8,8 +8,12 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -47,73 +51,74 @@
# define XML_FMT_STR "s"
#endif
-#define BUFFSIZE 8192
-
-char Buff[BUFFSIZE];
-
-int Depth;
-
static void XMLCALL
-start(void *data, const XML_Char *el, const XML_Char **attr) {
+startElement(void *userData, const XML_Char *name, const XML_Char **atts) {
int i;
- (void)data;
+ int *const depthPtr = (int *)userData;
- for (i = 0; i < Depth; i++)
+ for (i = 0; i < *depthPtr; i++)
printf(" ");
- printf("%" XML_FMT_STR, el);
+ printf("%" XML_FMT_STR, name);
- for (i = 0; attr[i]; i += 2) {
- printf(" %" XML_FMT_STR "='%" XML_FMT_STR "'", attr[i], attr[i + 1]);
+ for (i = 0; atts[i]; i += 2) {
+ printf(" %" XML_FMT_STR "='%" XML_FMT_STR "'", atts[i], atts[i + 1]);
}
printf("\n");
- Depth++;
+ *depthPtr += 1;
}
static void XMLCALL
-end(void *data, const XML_Char *el) {
- (void)data;
- (void)el;
+endElement(void *userData, const XML_Char *name) {
+ int *const depthPtr = (int *)userData;
+ (void)name;
- Depth--;
+ *depthPtr -= 1;
}
int
-main(int argc, char *argv[]) {
- XML_Parser p = XML_ParserCreate(NULL);
- (void)argc;
- (void)argv;
+main(void) {
+ XML_Parser parser = XML_ParserCreate(NULL);
+ int done;
+ int depth = 0;
- if (! p) {
+ if (! parser) {
fprintf(stderr, "Couldn't allocate memory for parser\n");
- exit(-1);
+ return 1;
}
- XML_SetElementHandler(p, start, end);
+ XML_SetUserData(parser, &depth);
+ XML_SetElementHandler(parser, startElement, endElement);
- for (;;) {
- int done;
- int len;
+ do {
+ void *const buf = XML_GetBuffer(parser, BUFSIZ);
+ if (! buf) {
+ fprintf(stderr, "Couldn't allocate memory for buffer\n");
+ XML_ParserFree(parser);
+ return 1;
+ }
+
+ const size_t len = fread(buf, 1, BUFSIZ, stdin);
- len = (int)fread(Buff, 1, BUFFSIZE, stdin);
if (ferror(stdin)) {
fprintf(stderr, "Read error\n");
- exit(-1);
+ XML_ParserFree(parser);
+ return 1;
}
+
done = feof(stdin);
- if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) {
+ if (XML_ParseBuffer(parser, (int)len, done) == XML_STATUS_ERROR) {
fprintf(stderr,
"Parse error at line %" XML_FMT_INT_MOD "u:\n%" XML_FMT_STR "\n",
- XML_GetCurrentLineNumber(p),
- XML_ErrorString(XML_GetErrorCode(p)));
- exit(-1);
+ XML_GetCurrentLineNumber(parser),
+ XML_ErrorString(XML_GetErrorCode(parser)));
+ XML_ParserFree(parser);
+ return 1;
}
+ } while (! done);
- if (done)
- break;
- }
- XML_ParserFree(p);
+ XML_ParserFree(parser);
return 0;
}
diff --git a/3rdparty/expat/expat.pc.cmake b/3rdparty/expat/expat.pc.cmake
new file mode 100644
index 00000000000..56da413791e
--- /dev/null
+++ b/3rdparty/expat/expat.pc.cmake
@@ -0,0 +1,13 @@
+prefix=$<TARGET_PROPERTY:expat,pkgconfig_prefix>
+exec_prefix=$<TARGET_PROPERTY:expat,pkgconfig_exec_prefix>
+libdir=$<TARGET_PROPERTY:expat,pkgconfig_libdir>
+includedir=$<TARGET_PROPERTY:expat,pkgconfig_includedir>
+
+Name: $<TARGET_PROPERTY:expat,pkgconfig_$<LOWER_CASE:$<CONFIG>>_name>
+Version: $<TARGET_PROPERTY:expat,pkgconfig_version>
+Description: expat XML parser
+URL: https://libexpat.github.io/
+Libs: -L${libdir} -l$<TARGET_PROPERTY:expat,pkgconfig_$<LOWER_CASE:$<CONFIG>>_output_name>
+Libs.private: $<TARGET_PROPERTY:expat,pkgconfig_libm>
+Cflags: -I${includedir}
+Cflags.private: -DXML_STATIC
diff --git a/3rdparty/expat/expat.pc.in b/3rdparty/expat/expat.pc.in
index bdfa47f8457..a53ab118729 100644
--- a/3rdparty/expat/expat.pc.in
+++ b/3rdparty/expat/expat.pc.in
@@ -3,9 +3,11 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-Name: @_EXPAT_OUTPUT_NAME@
+Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Description: expat XML parser
-URL: http://www.libexpat.org
-Libs: -L${libdir} -l@_EXPAT_OUTPUT_NAME@
+URL: https://libexpat.github.io/
+Libs: -L${libdir} -l@PACKAGE_NAME@
+Libs.private: @LIBM@
Cflags: -I${includedir}
+Cflags.private: -DXML_STATIC
diff --git a/3rdparty/expat/expat_config.h b/3rdparty/expat/expat_config.h
new file mode 100644
index 00000000000..9cb3b81a2aa
--- /dev/null
+++ b/3rdparty/expat/expat_config.h
@@ -0,0 +1,143 @@
+/* expat_config.h. Generated from expat_config.h.in by configure. */
+/* expat_config.h.in. Generated from configure.ac by autoheader. */
+
+#ifndef EXPAT_CONFIG_H
+#define EXPAT_CONFIG_H 1
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* 1234 = LILENDIAN, 4321 = BIGENDIAN */
+#define BYTEORDER 1234
+
+/* Define to 1 if you have the `arc4random' function. */
+/* #undef HAVE_ARC4RANDOM */
+
+/* Define to 1 if you have the `arc4random_buf' function. */
+#define HAVE_ARC4RANDOM_BUF 1
+
+/* define if the compiler supports basic C++11 syntax */
+#define HAVE_CXX11 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define to 1 if you have the `getrandom' function. */
+#define HAVE_GETRANDOM 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `bsd' library (-lbsd). */
+/* #undef HAVE_LIBBSD */
+
+/* Define to 1 if you have a working `mmap' system call. */
+#define HAVE_MMAP 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have `syscall' and `SYS_getrandom'. */
+#define HAVE_SYSCALL_GETRANDOM 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* Name of package */
+#define PACKAGE "expat"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "expat"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "expat 2.7.1"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "expat"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.7.1"
+
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "2.7.1"
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* Define to allow retrieving the byte offsets for attribute names and values.
+ */
+/* #undef XML_ATTR_INFO */
+
+/* Define to specify how much context to retain around the current parse
+ point, 0 to disable. */
+#define XML_CONTEXT_BYTES 1024
+
+/* Define to include code reading entropy from `/dev/urandom'. */
+#define XML_DEV_URANDOM 1
+
+/* Define to make parameter entity parsing functionality available. */
+#define XML_DTD 1
+
+/* Define as 1/0 to enable/disable support for general entities. */
+#define XML_GE 1
+
+/* Define to make XML Namespaces functionality available. */
+#define XML_NS 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `long int' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+#endif // ndef EXPAT_CONFIG_H
diff --git a/3rdparty/expat/expat_config.h.cmake b/3rdparty/expat/expat_config.h.cmake
index 173fed168c1..43df67aefde 100644
--- a/3rdparty/expat/expat_config.h.cmake
+++ b/3rdparty/expat/expat_config.h.cmake
@@ -1,5 +1,8 @@
/* expat_config.h.cmake. Based upon generated expat_config.h.in. */
+#ifndef EXPAT_CONFIG_H
+#define EXPAT_CONFIG_H 1
+
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
#cmakedefine BYTEORDER @BYTEORDER@
@@ -79,7 +82,9 @@
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
/* Define to 1 if you have the ANSI C header files. */
+#ifndef STDC_HEADERS
#cmakedefine STDC_HEADERS
+#endif
/* whether byteorder is bigendian */
#cmakedefine WORDS_BIGENDIAN
@@ -89,17 +94,20 @@
#cmakedefine XML_ATTR_INFO
/* Define to specify how much context to retain around the current parse
- point. */
-#cmakedefine XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@
+ point, 0 to disable. */
+#define XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@
#if ! defined(_WIN32)
/* Define to include code reading entropy from `/dev/urandom'. */
- #cmakedefine XML_DEV_URANDOM
+#cmakedefine XML_DEV_URANDOM
#endif
/* Define to make parameter entity parsing functionality available. */
#cmakedefine XML_DTD
+/* Define as 1/0 to enable/disable support for general entities. */
+#define XML_GE @XML_GE@
+
/* Define to make XML Namespaces functionality available. */
#cmakedefine XML_NS
@@ -109,7 +117,6 @@
#endif
/* Define to `long' if <sys/types.h> does not define. */
-#cmakedefine off_t @OFF_T@
+#cmakedefine off_t @off_t@
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#cmakedefine size_t @SIZE_T@
+#endif // ndef EXPAT_CONFIG_H
diff --git a/3rdparty/expat/expat_config.h.in b/3rdparty/expat/expat_config.h.in
index 59207b42e41..67ef89c7171 100644
--- a/3rdparty/expat/expat_config.h.in
+++ b/3rdparty/expat/expat_config.h.in
@@ -1,5 +1,8 @@
/* expat_config.h.in. Generated from configure.ac by autoheader. */
+#ifndef EXPAT_CONFIG_H
+#define EXPAT_CONFIG_H 1
+
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
@@ -12,6 +15,9 @@
/* Define to 1 if you have the `arc4random_buf' function. */
#undef HAVE_ARC4RANDOM_BUF
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -30,15 +36,15 @@
/* Define to 1 if you have the `bsd' library (-lbsd). */
#undef HAVE_LIBBSD
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@@ -87,7 +93,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Version number of package */
@@ -110,7 +118,7 @@
#undef XML_ATTR_INFO
/* Define to specify how much context to retain around the current parse
- point. */
+ point, 0 to disable. */
#undef XML_CONTEXT_BYTES
/* Define to include code reading entropy from `/dev/urandom'. */
@@ -119,6 +127,9 @@
/* Define to make parameter entity parsing functionality available. */
#undef XML_DTD
+/* Define as 1/0 to enable/disable support for general entities. */
+#undef XML_GE
+
/* Define to make XML Namespaces functionality available. */
#undef XML_NS
@@ -128,5 +139,4 @@
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
+#endif // ndef EXPAT_CONFIG_H
diff --git a/3rdparty/expat/fix-xmltest-log.sh b/3rdparty/expat/fix-xmltest-log.sh
index c143e93cf20..4739acab6b0 100755
--- a/3rdparty/expat/fix-xmltest-log.sh
+++ b/3rdparty/expat/fix-xmltest-log.sh
@@ -6,7 +6,8 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2019 Expat development team
+# Copyright (c) 2019-2022 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2024 Dag-Erling Smørgrav <des@des.dev>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -32,17 +33,18 @@ set -e
filename="${1:-tests/xmltest.log}"
-dos2unix "${filename}"
-
-tempfile="$(mktemp)"
-sed \
+sed -i.bak \
+ -e '# convert DOS line endings to Unix without resorting to dos2unix' \
+ -e $'s/\r//' \
+ \
-e 's/^wine: Call .* msvcrt\.dll\._wperror, aborting$/ibm49i02.dtd: No such file or directory/' \
\
-e '/^wine: /d' \
-e '/^Application tried to create a window, but no driver could be loaded.$/d' \
-e '/^Make sure that your X server is running and that $DISPLAY is set correctly.$/d' \
-e '/^err:systray:initialize_systray Could not create tray window$/d' \
+ -e '/^[0-9a-f]\+:err:/d' \
+ -e '/^wine client error:/d' \
-e '/^In ibm\/invalid\/P49\/: Unhandled exception: unimplemented .\+/d' \
\
- "${filename}" > "${tempfile}"
-mv "${tempfile}" "${filename}"
+ "${filename}"
diff --git a/3rdparty/expat/fuzz/xml_lpm_fuzzer.cpp b/3rdparty/expat/fuzz/xml_lpm_fuzzer.cpp
new file mode 100644
index 00000000000..f52ea7b21e4
--- /dev/null
+++ b/3rdparty/expat/fuzz/xml_lpm_fuzzer.cpp
@@ -0,0 +1,464 @@
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2022 Mark Brand <markbrand@google.com>
+ Copyright (c) 2025 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#if defined(NDEBUG)
+# undef NDEBUG // because checks below rely on assert(...)
+#endif
+
+#include <assert.h>
+#include <stdint.h>
+#include <vector>
+
+#include "expat.h"
+#include "xml_lpm_fuzzer.pb.h"
+#include "src/libfuzzer/libfuzzer_macro.h"
+
+static const char *g_encoding = nullptr;
+static const char *g_external_entity = nullptr;
+static size_t g_external_entity_size = 0;
+
+void
+SetEncoding(const xml_lpm_fuzzer::Encoding &e) {
+ switch (e) {
+ case xml_lpm_fuzzer::Encoding::UTF8:
+ g_encoding = "UTF-8";
+ break;
+
+ case xml_lpm_fuzzer::Encoding::UTF16:
+ g_encoding = "UTF-16";
+ break;
+
+ case xml_lpm_fuzzer::Encoding::ISO88591:
+ g_encoding = "ISO-8859-1";
+ break;
+
+ case xml_lpm_fuzzer::Encoding::ASCII:
+ g_encoding = "US-ASCII";
+ break;
+
+ case xml_lpm_fuzzer::Encoding::NONE:
+ g_encoding = NULL;
+ break;
+
+ default:
+ g_encoding = "UNKNOWN";
+ break;
+ }
+}
+
+static int g_allocation_count = 0;
+static std::vector<int> g_fail_allocations = {};
+
+void *
+MallocHook(size_t size) {
+ g_allocation_count += 1;
+ for (auto index : g_fail_allocations) {
+ if (index == g_allocation_count) {
+ return NULL;
+ }
+ }
+ return malloc(size);
+}
+
+void *
+ReallocHook(void *ptr, size_t size) {
+ g_allocation_count += 1;
+ for (auto index : g_fail_allocations) {
+ if (index == g_allocation_count) {
+ return NULL;
+ }
+ }
+ return realloc(ptr, size);
+}
+
+void
+FreeHook(void *ptr) {
+ free(ptr);
+}
+
+XML_Memory_Handling_Suite memory_handling_suite
+ = {MallocHook, ReallocHook, FreeHook};
+
+void InitializeParser(XML_Parser parser);
+
+// We want a parse function that supports resumption, so that we can cover the
+// suspend/resume code.
+enum XML_Status
+Parse(XML_Parser parser, const char *input, int input_len, int is_final) {
+ enum XML_Status status = XML_Parse(parser, input, input_len, is_final);
+ while (status == XML_STATUS_SUSPENDED) {
+ status = XML_ResumeParser(parser);
+ }
+ return status;
+}
+
+// When the fuzzer is compiled with instrumentation such as ASan, then the
+// accesses in TouchString will fault if they access invalid memory (ie. detect
+// either a use-after-free or buffer-overflow). By calling TouchString in each
+// of the callbacks, we can check that the arguments meet the API specifications
+// in terms of length/null-termination. no_optimize is used to ensure that the
+// compiler has to emit actual memory reads, instead of removing them.
+static volatile size_t no_optimize = 0;
+static void
+TouchString(const XML_Char *ptr, int len = -1) {
+ if (! ptr) {
+ return;
+ }
+
+ if (len == -1) {
+ for (XML_Char value = *ptr++; value; value = *ptr++) {
+ no_optimize += value;
+ }
+ } else {
+ for (int i = 0; i < len; ++i) {
+ no_optimize += ptr[i];
+ }
+ }
+}
+
+static void
+TouchNodeAndRecurse(XML_Content *content) {
+ switch (content->type) {
+ case XML_CTYPE_EMPTY:
+ case XML_CTYPE_ANY:
+ assert(content->quant == XML_CQUANT_NONE);
+ assert(content->name == NULL);
+ assert(content->numchildren == 0);
+ assert(content->children == NULL);
+ break;
+
+ case XML_CTYPE_MIXED:
+ assert(content->quant == XML_CQUANT_NONE
+ || content->quant == XML_CQUANT_REP);
+ assert(content->name == NULL);
+ for (unsigned int i = 0; i < content->numchildren; ++i) {
+ assert(content->children[i].type == XML_CTYPE_NAME);
+ assert(content->children[i].quant == XML_CQUANT_NONE);
+ assert(content->children[i].numchildren == 0);
+ assert(content->children[i].children == NULL);
+ TouchString(content->children[i].name);
+ }
+ break;
+
+ case XML_CTYPE_NAME:
+ assert((content->quant == XML_CQUANT_NONE)
+ || (content->quant == XML_CQUANT_OPT)
+ || (content->quant == XML_CQUANT_REP)
+ || (content->quant == XML_CQUANT_PLUS));
+ assert(content->numchildren == 0);
+ assert(content->children == NULL);
+ TouchString(content->name);
+ break;
+
+ case XML_CTYPE_CHOICE:
+ case XML_CTYPE_SEQ:
+ assert((content->quant == XML_CQUANT_NONE)
+ || (content->quant == XML_CQUANT_OPT)
+ || (content->quant == XML_CQUANT_REP)
+ || (content->quant == XML_CQUANT_PLUS));
+ assert(content->name == NULL);
+ for (unsigned int i = 0; i < content->numchildren; ++i) {
+ TouchNodeAndRecurse(&content->children[i]);
+ }
+ break;
+
+ default:
+ assert(false);
+ }
+}
+
+static void XMLCALL
+ElementDeclHandler(void *userData, const XML_Char *name, XML_Content *model) {
+ TouchString(name);
+ TouchNodeAndRecurse(model);
+ XML_FreeContentModel((XML_Parser)userData, model);
+}
+
+static void XMLCALL
+AttlistDeclHandler(void *userData, const XML_Char *elname,
+ const XML_Char *attname, const XML_Char *atttype,
+ const XML_Char *dflt, int isrequired) {
+ (void)userData;
+ TouchString(elname);
+ TouchString(attname);
+ TouchString(atttype);
+ TouchString(dflt);
+ (void)isrequired;
+}
+
+static void XMLCALL
+XmlDeclHandler(void *userData, const XML_Char *version,
+ const XML_Char *encoding, int standalone) {
+ (void)userData;
+ TouchString(version);
+ TouchString(encoding);
+ (void)standalone;
+}
+
+static void XMLCALL
+StartElementHandler(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ (void)userData;
+ TouchString(name);
+ for (size_t i = 0; atts[i] != NULL; ++i) {
+ TouchString(atts[i]);
+ }
+}
+
+static void XMLCALL
+EndElementHandler(void *userData, const XML_Char *name) {
+ (void)userData;
+ TouchString(name);
+}
+
+static void XMLCALL
+CharacterDataHandler(void *userData, const XML_Char *s, int len) {
+ (void)userData;
+ TouchString(s, len);
+}
+
+static void XMLCALL
+ProcessingInstructionHandler(void *userData, const XML_Char *target,
+ const XML_Char *data) {
+ (void)userData;
+ TouchString(target);
+ TouchString(data);
+}
+
+static void XMLCALL
+CommentHandler(void *userData, const XML_Char *data) {
+ TouchString(data);
+ // Use the comment handler to trigger parser suspend, so that we can get
+ // coverage of that code.
+ XML_StopParser((XML_Parser)userData, XML_TRUE);
+}
+
+static void XMLCALL
+StartCdataSectionHandler(void *userData) {
+ (void)userData;
+}
+
+static void XMLCALL
+EndCdataSectionHandler(void *userData) {
+ (void)userData;
+}
+
+static void XMLCALL
+DefaultHandler(void *userData, const XML_Char *s, int len) {
+ (void)userData;
+ TouchString(s, len);
+}
+
+static void XMLCALL
+StartDoctypeDeclHandler(void *userData, const XML_Char *doctypeName,
+ const XML_Char *sysid, const XML_Char *pubid,
+ int has_internal_subset) {
+ (void)userData;
+ TouchString(doctypeName);
+ TouchString(sysid);
+ TouchString(pubid);
+ (void)has_internal_subset;
+}
+
+static void XMLCALL
+EndDoctypeDeclHandler(void *userData) {
+ (void)userData;
+}
+
+static void XMLCALL
+EntityDeclHandler(void *userData, const XML_Char *entityName,
+ int is_parameter_entity, const XML_Char *value,
+ int value_length, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName) {
+ (void)userData;
+ TouchString(entityName);
+ (void)is_parameter_entity;
+ TouchString(value, value_length);
+ TouchString(base);
+ TouchString(systemId);
+ TouchString(publicId);
+ TouchString(notationName);
+}
+
+static void XMLCALL
+NotationDeclHandler(void *userData, const XML_Char *notationName,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ (void)userData;
+ TouchString(notationName);
+ TouchString(base);
+ TouchString(systemId);
+ TouchString(publicId);
+}
+
+static void XMLCALL
+StartNamespaceDeclHandler(void *userData, const XML_Char *prefix,
+ const XML_Char *uri) {
+ (void)userData;
+ TouchString(prefix);
+ TouchString(uri);
+}
+
+static void XMLCALL
+EndNamespaceDeclHandler(void *userData, const XML_Char *prefix) {
+ (void)userData;
+ TouchString(prefix);
+}
+
+static int XMLCALL
+NotStandaloneHandler(void *userData) {
+ (void)userData;
+ return XML_STATUS_OK;
+}
+
+static int XMLCALL
+ExternalEntityRefHandler(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ int rc = XML_STATUS_ERROR;
+ TouchString(context);
+ TouchString(base);
+ TouchString(systemId);
+ TouchString(publicId);
+
+ if (g_external_entity) {
+ XML_Parser ext_parser
+ = XML_ExternalEntityParserCreate(parser, context, g_encoding);
+ rc = Parse(ext_parser, g_external_entity, g_external_entity_size, 1);
+ XML_ParserFree(ext_parser);
+ }
+
+ return rc;
+}
+
+static void XMLCALL
+SkippedEntityHandler(void *userData, const XML_Char *entityName,
+ int is_parameter_entity) {
+ (void)userData;
+ TouchString(entityName);
+ (void)is_parameter_entity;
+}
+
+static int XMLCALL
+UnknownEncodingHandler(void *encodingHandlerData, const XML_Char *name,
+ XML_Encoding *info) {
+ (void)encodingHandlerData;
+ TouchString(name);
+ (void)info;
+ return XML_STATUS_ERROR;
+}
+
+void
+InitializeParser(XML_Parser parser) {
+ XML_SetUserData(parser, (void *)parser);
+ XML_SetHashSalt(parser, 0x41414141);
+ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+
+ XML_SetElementDeclHandler(parser, ElementDeclHandler);
+ XML_SetAttlistDeclHandler(parser, AttlistDeclHandler);
+ XML_SetXmlDeclHandler(parser, XmlDeclHandler);
+ XML_SetElementHandler(parser, StartElementHandler, EndElementHandler);
+ XML_SetCharacterDataHandler(parser, CharacterDataHandler);
+ XML_SetProcessingInstructionHandler(parser, ProcessingInstructionHandler);
+ XML_SetCommentHandler(parser, CommentHandler);
+ XML_SetCdataSectionHandler(parser, StartCdataSectionHandler,
+ EndCdataSectionHandler);
+ // XML_SetDefaultHandler disables entity expansion
+ XML_SetDefaultHandlerExpand(parser, DefaultHandler);
+ XML_SetDoctypeDeclHandler(parser, StartDoctypeDeclHandler,
+ EndDoctypeDeclHandler);
+ // Note: This is mutually exclusive with XML_SetUnparsedEntityDeclHandler,
+ // and there isn't any significant code change between the two.
+ XML_SetEntityDeclHandler(parser, EntityDeclHandler);
+ XML_SetNotationDeclHandler(parser, NotationDeclHandler);
+ XML_SetNamespaceDeclHandler(parser, StartNamespaceDeclHandler,
+ EndNamespaceDeclHandler);
+ XML_SetNotStandaloneHandler(parser, NotStandaloneHandler);
+ XML_SetExternalEntityRefHandler(parser, ExternalEntityRefHandler);
+ XML_SetSkippedEntityHandler(parser, SkippedEntityHandler);
+ XML_SetUnknownEncodingHandler(parser, UnknownEncodingHandler, (void *)parser);
+}
+
+DEFINE_TEXT_PROTO_FUZZER(const xml_lpm_fuzzer::Testcase &testcase) {
+ g_external_entity = nullptr;
+
+ if (! testcase.actions_size()) {
+ return;
+ }
+
+ g_allocation_count = 0;
+ g_fail_allocations.clear();
+ for (int i = 0; i < testcase.fail_allocations_size(); ++i) {
+ g_fail_allocations.push_back(testcase.fail_allocations(i));
+ }
+
+ SetEncoding(testcase.encoding());
+ XML_Parser parser
+ = XML_ParserCreate_MM(g_encoding, &memory_handling_suite, "|");
+ InitializeParser(parser);
+
+ for (int i = 0; i < testcase.actions_size(); ++i) {
+ const auto &action = testcase.actions(i);
+ switch (action.action_case()) {
+ case xml_lpm_fuzzer::Action::kChunk:
+ if (XML_STATUS_ERROR
+ == Parse(parser, action.chunk().data(), action.chunk().size(), 0)) {
+ // Force a reset after parse error.
+ XML_ParserReset(parser, g_encoding);
+ InitializeParser(parser);
+ }
+ break;
+
+ case xml_lpm_fuzzer::Action::kLastChunk:
+ Parse(parser, action.last_chunk().data(), action.last_chunk().size(), 1);
+ XML_ParserReset(parser, g_encoding);
+ InitializeParser(parser);
+ break;
+
+ case xml_lpm_fuzzer::Action::kReset:
+ XML_ParserReset(parser, g_encoding);
+ InitializeParser(parser);
+ break;
+
+ case xml_lpm_fuzzer::Action::kExternalEntity:
+ g_external_entity = action.external_entity().data();
+ g_external_entity_size = action.external_entity().size();
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ XML_ParserFree(parser);
+}
diff --git a/3rdparty/expat/fuzz/xml_lpm_fuzzer.proto b/3rdparty/expat/fuzz/xml_lpm_fuzzer.proto
new file mode 100644
index 00000000000..ddc4e958b91
--- /dev/null
+++ b/3rdparty/expat/fuzz/xml_lpm_fuzzer.proto
@@ -0,0 +1,58 @@
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2022 Mark Brand <markbrand@google.com>
+ Copyright (c) 2025 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+syntax = "proto2";
+package xml_lpm_fuzzer;
+
+enum Encoding {
+ UTF8 = 0;
+ UTF16 = 1;
+ ISO88591 = 2;
+ ASCII = 3;
+ UNKNOWN = 4;
+ NONE = 5;
+}
+
+message Action {
+ oneof action {
+ string chunk = 1;
+ string last_chunk = 2;
+ bool reset = 3;
+ string external_entity = 4;
+ }
+}
+
+message Testcase {
+ required Encoding encoding = 1;
+ repeated Action actions = 2;
+ repeated int32 fail_allocations = 3;
+}
diff --git a/3rdparty/expat/fuzz/xml_parse_fuzzer.c b/3rdparty/expat/fuzz/xml_parse_fuzzer.c
new file mode 100644
index 00000000000..6a1affe2b1f
--- /dev/null
+++ b/3rdparty/expat/fuzz/xml_parse_fuzzer.c
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <assert.h>
+#include <stdint.h>
+
+#include "expat.h"
+#include "siphash.h"
+
+// Macros to convert preprocessor macros to string literals. See
+// https://gcc.gnu.org/onlinedocs/gcc-3.4.3/cpp/Stringification.html
+#define xstr(s) str(s)
+#define str(s) #s
+
+// The encoder type that we wish to fuzz should come from the compile-time
+// definition `ENCODING_FOR_FUZZING`. This allows us to have a separate fuzzer
+// binary for
+#ifndef ENCODING_FOR_FUZZING
+# error "ENCODING_FOR_FUZZING was not provided to this fuzz target."
+#endif
+
+// 16-byte deterministic hash key.
+static unsigned char hash_key[16] = "FUZZING IS FUN!";
+
+static void XMLCALL
+start(void *userData, const XML_Char *name, const XML_Char **atts) {
+ (void)userData;
+ (void)name;
+ (void)atts;
+}
+static void XMLCALL
+end(void *userData, const XML_Char *name) {
+ (void)userData;
+ (void)name;
+}
+
+static void XMLCALL
+may_stop_character_handler(void *userData, const XML_Char *s, int len) {
+ XML_Parser parser = (XML_Parser)userData;
+ if (len > 1 && s[0] == 's') {
+ XML_StopParser(parser, s[1] == 'r' ? XML_FALSE : XML_TRUE);
+ }
+}
+
+static void
+ParseOneInput(XML_Parser p, const uint8_t *data, size_t size) {
+ // Set the hash salt using siphash to generate a deterministic hash.
+ struct sipkey *key = sip_keyof(hash_key);
+ XML_SetHashSalt(p, (unsigned long)siphash24(data, size, key));
+ (void)sip24_valid;
+
+ XML_SetUserData(p, p);
+ XML_SetElementHandler(p, start, end);
+ XML_SetCharacterDataHandler(p, may_stop_character_handler);
+ XML_Parse(p, (const XML_Char *)data, size, 0);
+ if (XML_Parse(p, (const XML_Char *)data, size, 1) == XML_STATUS_ERROR) {
+ XML_ErrorString(XML_GetErrorCode(p));
+ }
+ XML_GetCurrentLineNumber(p);
+ if (size % 2) {
+ XML_ParserReset(p, NULL);
+ }
+}
+
+int
+LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ XML_Parser parentParser = XML_ParserCreate(xstr(ENCODING_FOR_FUZZING));
+ assert(parentParser);
+ ParseOneInput(parentParser, data, size);
+ // not freed yet, but used later and freed then
+
+ XML_Parser namespaceParser = XML_ParserCreateNS(NULL, '!');
+ assert(namespaceParser);
+ ParseOneInput(namespaceParser, data, size);
+ XML_ParserFree(namespaceParser);
+
+ XML_Parser externalEntityParser
+ = XML_ExternalEntityParserCreate(parentParser, "e1", NULL);
+ assert(externalEntityParser);
+ ParseOneInput(externalEntityParser, data, size);
+ XML_ParserFree(externalEntityParser);
+
+ XML_Parser externalDtdParser
+ = XML_ExternalEntityParserCreate(parentParser, NULL, NULL);
+ assert(externalDtdParser);
+ ParseOneInput(externalDtdParser, data, size);
+ XML_ParserFree(externalDtdParser);
+
+ // finally frees this parser which served as parent
+ XML_ParserFree(parentParser);
+ return 0;
+}
diff --git a/3rdparty/expat/fuzz/xml_parsebuffer_fuzzer.c b/3rdparty/expat/fuzz/xml_parsebuffer_fuzzer.c
new file mode 100644
index 00000000000..cfc4af20285
--- /dev/null
+++ b/3rdparty/expat/fuzz/xml_parsebuffer_fuzzer.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <assert.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "expat.h"
+#include "siphash.h"
+
+// Macros to convert preprocessor macros to string literals. See
+// https://gcc.gnu.org/onlinedocs/gcc-3.4.3/cpp/Stringification.html
+#define xstr(s) str(s)
+#define str(s) #s
+
+// The encoder type that we wish to fuzz should come from the compile-time
+// definition `ENCODING_FOR_FUZZING`. This allows us to have a separate fuzzer
+// binary for
+#ifndef ENCODING_FOR_FUZZING
+# error "ENCODING_FOR_FUZZING was not provided to this fuzz target."
+#endif
+
+// 16-byte deterministic hash key.
+static unsigned char hash_key[16] = "FUZZING IS FUN!";
+
+static void XMLCALL
+start(void *userData, const XML_Char *name, const XML_Char **atts) {
+ (void)userData;
+ (void)name;
+ (void)atts;
+}
+static void XMLCALL
+end(void *userData, const XML_Char *name) {
+ (void)userData;
+ (void)name;
+}
+
+static void XMLCALL
+may_stop_character_handler(void *userData, const XML_Char *s, int len) {
+ XML_Parser parser = (XML_Parser)userData;
+ if (len > 1 && s[0] == 's') {
+ XML_StopParser(parser, s[1] == 'r' ? XML_FALSE : XML_TRUE);
+ }
+}
+
+static void
+ParseOneInput(XML_Parser p, const uint8_t *data, size_t size) {
+ // Set the hash salt using siphash to generate a deterministic hash.
+ struct sipkey *key = sip_keyof(hash_key);
+ XML_SetHashSalt(p, (unsigned long)siphash24(data, size, key));
+ (void)sip24_valid;
+
+ XML_SetUserData(p, p);
+ XML_SetElementHandler(p, start, end);
+ XML_SetCharacterDataHandler(p, may_stop_character_handler);
+ void *buf = XML_GetBuffer(p, size);
+ assert(buf);
+ memcpy(buf, data, size);
+ XML_ParseBuffer(p, size, 0);
+ buf = XML_GetBuffer(p, size);
+ if (buf == NULL) {
+ return;
+ }
+ memcpy(buf, data, size);
+ if (XML_ParseBuffer(p, size, 1) == XML_STATUS_ERROR) {
+ XML_ErrorString(XML_GetErrorCode(p));
+ }
+ XML_GetCurrentLineNumber(p);
+ if (size % 2) {
+ XML_ParserReset(p, NULL);
+ }
+}
+
+int
+LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ if (size == 0)
+ return 0;
+
+ XML_Parser parentParser = XML_ParserCreate(xstr(ENCODING_FOR_FUZZING));
+ assert(parentParser);
+ ParseOneInput(parentParser, data, size);
+ // not freed yet, but used later and freed then
+
+ XML_Parser namespaceParser = XML_ParserCreateNS(NULL, '!');
+ assert(namespaceParser);
+ ParseOneInput(namespaceParser, data, size);
+ XML_ParserFree(namespaceParser);
+
+ XML_Parser externalEntityParser
+ = XML_ExternalEntityParserCreate(parentParser, "e1", NULL);
+ assert(externalEntityParser);
+ ParseOneInput(externalEntityParser, data, size);
+ XML_ParserFree(externalEntityParser);
+
+ XML_Parser externalDtdParser
+ = XML_ExternalEntityParserCreate(parentParser, NULL, NULL);
+ assert(externalDtdParser);
+ ParseOneInput(externalDtdParser, data, size);
+ XML_ParserFree(externalDtdParser);
+
+ // finally frees this parser which served as parent
+ XML_ParserFree(parentParser);
+ return 0;
+}
diff --git a/3rdparty/expat/lib/Makefile.am b/3rdparty/expat/lib/Makefile.am
index 05343e235d8..1958f322f31 100644
--- a/3rdparty/expat/lib/Makefile.am
+++ b/3rdparty/expat/lib/Makefile.am
@@ -6,7 +6,9 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2017 Tomasz Kłoczko <kloczek@fedoraproject.org>
+# Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -34,9 +36,13 @@ include_HEADERS = \
expat_external.h
lib_LTLIBRARIES = libexpat.la
+if WITH_TESTS
+noinst_LTLIBRARIES = libtestpat.la
+endif
libexpat_la_LDFLAGS = \
@AM_LDFLAGS@ \
+ @LIBM@ \
-no-undefined \
-version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
@@ -45,6 +51,12 @@ libexpat_la_SOURCES = \
xmltok.c \
xmlrole.c
+if WITH_TESTS
+libtestpat_la_CPPFLAGS = -DXML_TESTING
+
+libtestpat_la_SOURCES = $(libexpat_la_SOURCES)
+endif
+
doc_DATA = \
../AUTHORS \
../Changes
@@ -63,8 +75,7 @@ EXTRA_DIST = \
iasciitab.h \
internal.h \
latin1tab.h \
- libexpat.def \
- libexpatw.def \
+ libexpat.def.cmake \
nametab.h \
siphash.h \
utf8tab.h \
diff --git a/3rdparty/expat/lib/Makefile.in b/3rdparty/expat/lib/Makefile.in
index 10f20d5533d..1a97e85fc41 100644
--- a/3rdparty/expat/lib/Makefile.in
+++ b/3rdparty/expat/lib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,9 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2017 Tomasz Kłoczko <kloczek@fedoraproject.org>
+# Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -133,6 +135,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -171,7 +175,7 @@ am__uninstall_files_from_dir = { \
}
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \
"$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
libexpat_la_LIBADD =
am_libexpat_la_OBJECTS = xmlparse.lo xmltok.lo xmlrole.lo
libexpat_la_OBJECTS = $(am_libexpat_la_OBJECTS)
@@ -182,6 +186,13 @@ am__v_lt_1 =
libexpat_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libexpat_la_LDFLAGS) $(LDFLAGS) -o $@
+libtestpat_la_LIBADD =
+am__libtestpat_la_SOURCES_DIST = xmlparse.c xmltok.c xmlrole.c
+am__objects_1 = libtestpat_la-xmlparse.lo libtestpat_la-xmltok.lo \
+ libtestpat_la-xmlrole.lo
+@WITH_TESTS_TRUE@am_libtestpat_la_OBJECTS = $(am__objects_1)
+libtestpat_la_OBJECTS = $(am_libtestpat_la_OBJECTS)
+@WITH_TESTS_TRUE@am_libtestpat_la_rpath =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -197,8 +208,10 @@ am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp
am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = ./$(DEPDIR)/xmlparse.Plo ./$(DEPDIR)/xmlrole.Plo \
- ./$(DEPDIR)/xmltok.Plo
+am__depfiles_remade = ./$(DEPDIR)/libtestpat_la-xmlparse.Plo \
+ ./$(DEPDIR)/libtestpat_la-xmlrole.Plo \
+ ./$(DEPDIR)/libtestpat_la-xmltok.Plo ./$(DEPDIR)/xmlparse.Plo \
+ ./$(DEPDIR)/xmlrole.Plo ./$(DEPDIR)/xmltok.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -218,8 +231,9 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = $(libexpat_la_SOURCES)
-DIST_SOURCES = $(libexpat_la_SOURCES)
+SOURCES = $(libexpat_la_SOURCES) $(libtestpat_la_SOURCES)
+DIST_SOURCES = $(libexpat_la_SOURCES) \
+ $(am__libtestpat_la_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -244,8 +258,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/conftools/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -265,8 +277,10 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CPP = @CPP@
+CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
@@ -282,10 +296,20 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
FGREP = @FGREP@
+FILECMD = @FILECMD@
FILEMAP = @FILEMAP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -295,6 +319,8 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LIBAGE = @LIBAGE@
LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
+LIBM = @LIBM@
LIBOBJS = @LIBOBJS@
LIBREVISION = @LIBREVISION@
LIBS = @LIBS@
@@ -303,6 +329,7 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -324,9 +351,12 @@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SIZEOF_VOID_P = @SIZEOF_VOID_P@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
STRIP = @STRIP@
VERSION = @VERSION@
-_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -387,8 +417,10 @@ include_HEADERS = \
expat_external.h
lib_LTLIBRARIES = libexpat.la
+@WITH_TESTS_TRUE@noinst_LTLIBRARIES = libtestpat.la
libexpat_la_LDFLAGS = \
@AM_LDFLAGS@ \
+ @LIBM@ \
-no-undefined \
-version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
@@ -397,6 +429,8 @@ libexpat_la_SOURCES = \
xmltok.c \
xmlrole.c
+@WITH_TESTS_TRUE@libtestpat_la_CPPFLAGS = -DXML_TESTING
+@WITH_TESTS_TRUE@libtestpat_la_SOURCES = $(libexpat_la_SOURCES)
doc_DATA = \
../AUTHORS \
../Changes
@@ -409,8 +443,7 @@ EXTRA_DIST = \
iasciitab.h \
internal.h \
latin1tab.h \
- libexpat.def \
- libexpatw.def \
+ libexpat.def.cmake \
nametab.h \
siphash.h \
utf8tab.h \
@@ -425,7 +458,7 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -449,9 +482,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
@@ -490,15 +523,32 @@ clean-libLTLIBRARIES:
rm -f $${locs}; \
}
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
libexpat.la: $(libexpat_la_OBJECTS) $(libexpat_la_DEPENDENCIES) $(EXTRA_libexpat_la_DEPENDENCIES)
$(AM_V_CCLD)$(libexpat_la_LINK) -rpath $(libdir) $(libexpat_la_OBJECTS) $(libexpat_la_LIBADD) $(LIBS)
+libtestpat.la: $(libtestpat_la_OBJECTS) $(libtestpat_la_DEPENDENCIES) $(EXTRA_libtestpat_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(am_libtestpat_la_rpath) $(libtestpat_la_OBJECTS) $(libtestpat_la_LIBADD) $(LIBS)
+
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestpat_la-xmlparse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestpat_la-xmlrole.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestpat_la-xmltok.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlparse.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlrole.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmltok.Plo@am__quote@ # am--include-marker
@@ -530,6 +580,27 @@ am--depfiles: $(am__depfiles_remade)
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+libtestpat_la-xmlparse.lo: xmlparse.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtestpat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtestpat_la-xmlparse.lo -MD -MP -MF $(DEPDIR)/libtestpat_la-xmlparse.Tpo -c -o libtestpat_la-xmlparse.lo `test -f 'xmlparse.c' || echo '$(srcdir)/'`xmlparse.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtestpat_la-xmlparse.Tpo $(DEPDIR)/libtestpat_la-xmlparse.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmlparse.c' object='libtestpat_la-xmlparse.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtestpat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtestpat_la-xmlparse.lo `test -f 'xmlparse.c' || echo '$(srcdir)/'`xmlparse.c
+
+libtestpat_la-xmltok.lo: xmltok.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtestpat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtestpat_la-xmltok.lo -MD -MP -MF $(DEPDIR)/libtestpat_la-xmltok.Tpo -c -o libtestpat_la-xmltok.lo `test -f 'xmltok.c' || echo '$(srcdir)/'`xmltok.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtestpat_la-xmltok.Tpo $(DEPDIR)/libtestpat_la-xmltok.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmltok.c' object='libtestpat_la-xmltok.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtestpat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtestpat_la-xmltok.lo `test -f 'xmltok.c' || echo '$(srcdir)/'`xmltok.c
+
+libtestpat_la-xmlrole.lo: xmlrole.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtestpat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtestpat_la-xmlrole.lo -MD -MP -MF $(DEPDIR)/libtestpat_la-xmlrole.Tpo -c -o libtestpat_la-xmlrole.lo `test -f 'xmlrole.c' || echo '$(srcdir)/'`xmlrole.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtestpat_la-xmlrole.Tpo $(DEPDIR)/libtestpat_la-xmlrole.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmlrole.c' object='libtestpat_la-xmlrole.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtestpat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtestpat_la-xmlrole.lo `test -f 'xmlrole.c' || echo '$(srcdir)/'`xmlrole.c
+
mostlyclean-libtool:
-rm -f *.lo
@@ -629,7 +700,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -703,10 +773,13 @@ maintainer-clean-generic:
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- mostlyclean-am
+ clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-am
- -rm -f ./$(DEPDIR)/xmlparse.Plo
+ -rm -f ./$(DEPDIR)/libtestpat_la-xmlparse.Plo
+ -rm -f ./$(DEPDIR)/libtestpat_la-xmlrole.Plo
+ -rm -f ./$(DEPDIR)/libtestpat_la-xmltok.Plo
+ -rm -f ./$(DEPDIR)/xmlparse.Plo
-rm -f ./$(DEPDIR)/xmlrole.Plo
-rm -f ./$(DEPDIR)/xmltok.Plo
-rm -f Makefile
@@ -755,7 +828,10 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -f ./$(DEPDIR)/xmlparse.Plo
+ -rm -f ./$(DEPDIR)/libtestpat_la-xmlparse.Plo
+ -rm -f ./$(DEPDIR)/libtestpat_la-xmlrole.Plo
+ -rm -f ./$(DEPDIR)/libtestpat_la-xmltok.Plo
+ -rm -f ./$(DEPDIR)/xmlparse.Plo
-rm -f ./$(DEPDIR)/xmlrole.Plo
-rm -f ./$(DEPDIR)/xmltok.Plo
-rm -f Makefile
@@ -780,16 +856,17 @@ uninstall-am: uninstall-docDATA uninstall-includeHEADERS \
.MAKE: install-am install-data-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
- clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \
- ctags ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-data-hook install-docDATA install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-includeHEADERS install-info \
- install-info-am install-libLTLIBRARIES install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
+ clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-data-hook install-docDATA install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-includeHEADERS install-info install-info-am \
+ install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-docDATA \
diff --git a/3rdparty/expat/lib/ascii.h b/3rdparty/expat/lib/ascii.h
index c3587e57332..1f594d2e54b 100644
--- a/3rdparty/expat/lib/ascii.h
+++ b/3rdparty/expat/lib/ascii.h
@@ -6,8 +6,11 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 1999-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2007 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/lib/asciitab.h b/3rdparty/expat/lib/asciitab.h
index 63b1d1b4482..af766fb2478 100644
--- a/3rdparty/expat/lib/asciitab.h
+++ b/3rdparty/expat/lib/asciitab.h
@@ -7,7 +7,9 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/lib/expat.h b/3rdparty/expat/lib/expat.h
index cb828db155f..610e1ddc0e9 100644
--- a/3rdparty/expat/lib/expat.h
+++ b/3rdparty/expat/lib/expat.h
@@ -7,7 +7,18 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
+ Copyright (c) 2016 Thomas Beutlich <tc@tbeu.de>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2022 Thijs Schreijer <thijs@thijsschreijer.nl>
+ Copyright (c) 2023 Hanno Böck <hanno@gentoo.org>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Copyright (c) 2024 Taichi Haradaguchi <20001722@ymail.ne.jp>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -115,7 +126,13 @@ enum XML_Error {
XML_ERROR_RESERVED_PREFIX_XMLNS,
XML_ERROR_RESERVED_NAMESPACE_URI,
/* Added in 2.2.1. */
- XML_ERROR_INVALID_ARGUMENT
+ XML_ERROR_INVALID_ARGUMENT,
+ /* Added in 2.3.0. */
+ XML_ERROR_NO_BUFFER,
+ /* Added in 2.4.0. */
+ XML_ERROR_AMPLIFICATION_LIMIT_BREACH,
+ /* Added in 2.6.4. */
+ XML_ERROR_NOT_STARTED,
};
enum XML_Content_Type {
@@ -163,8 +180,10 @@ struct XML_cp {
};
/* This is called for an element declaration. See above for
- description of the model argument. It's the caller's responsibility
- to free model when finished with it.
+ description of the model argument. It's the user code's responsibility
+ to free model when finished with it. See XML_FreeContentModel.
+ There is no need to free the model from the handler, it can be kept
+ around and freed at a later stage.
*/
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData,
const XML_Char *name,
@@ -226,6 +245,17 @@ XML_ParserCreate(const XML_Char *encoding);
and the local part will be concatenated without any separator.
It is a programming error to use the separator '\0' with namespace
triplets (see XML_SetReturnNSTriplet).
+ If a namespace separator is chosen that can be part of a URI or
+ part of an XML name, splitting an expanded name back into its
+ 1, 2 or 3 original parts on application level in the element handler
+ may end up vulnerable, so these are advised against; sane choices for
+ a namespace separator are e.g. '\n' (line feed) and '|' (pipe).
+
+ Note that Expat does not validate namespace URIs (beyond encoding)
+ against RFC 3986 today (and is not required to do so with regard to
+ the XML 1.0 namespaces specification) but it may start doing that
+ in future releases. Before that, an application using Expat must
+ be ready to receive namespace URIs containing non-URI characters.
*/
XMLPARSEAPI(XML_Parser)
XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
@@ -244,7 +274,7 @@ XML_ParserCreate_MM(const XML_Char *encoding,
const XML_Memory_Handling_Suite *memsuite,
const XML_Char *namespaceSeparator);
-/* Prepare a parser object to be re-used. This is particularly
+/* Prepare a parser object to be reused. This is particularly
valuable when memory allocation overhead is disproportionately high,
such as when a large number of small documnents need to be parsed.
All handlers are cleared from the parser, except for the
@@ -306,7 +336,7 @@ typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData,
const XML_Char *pubid,
int has_internal_subset);
-/* This is called for the start of the DOCTYPE declaration when the
+/* This is called for the end of the DOCTYPE declaration when the
closing > is encountered, but after processing any external
subset.
*/
@@ -513,7 +543,7 @@ typedef struct {
Otherwise it must return XML_STATUS_ERROR.
If info does not describe a suitable encoding, then the parser will
- return an XML_UNKNOWN_ENCODING error.
+ return an XML_ERROR_UNKNOWN_ENCODING error.
*/
typedef int(XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData,
const XML_Char *name,
@@ -926,7 +956,7 @@ XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser);
XMLPARSEAPI(int)
XML_GetCurrentByteCount(XML_Parser parser);
-/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
+/* If XML_CONTEXT_BYTES is >=1, returns the input buffer, sets
the integer pointed to by offset to the offset within this buffer
of the current parse position, and sets the integer pointed to by size
to the size of this buffer (the number of input bytes). Otherwise
@@ -997,7 +1027,12 @@ enum XML_FeatureEnum {
XML_FEATURE_SIZEOF_XML_LCHAR,
XML_FEATURE_NS,
XML_FEATURE_LARGE_SIZE,
- XML_FEATURE_ATTR_INFO
+ XML_FEATURE_ATTR_INFO,
+ /* Added in Expat 2.4.0. */
+ XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
+ XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT,
+ /* Added in Expat 2.6.0. */
+ XML_FEATURE_GE
/* Additional features must be added to the end of this enum. */
};
@@ -1010,12 +1045,30 @@ typedef struct {
XMLPARSEAPI(const XML_Feature *)
XML_GetFeatureList(void);
+#if defined(XML_DTD) || (defined(XML_GE) && XML_GE == 1)
+/* Added in Expat 2.4.0 for XML_DTD defined and
+ * added in Expat 2.6.0 for XML_GE == 1. */
+XMLPARSEAPI(XML_Bool)
+XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ XML_Parser parser, float maximumAmplificationFactor);
+
+/* Added in Expat 2.4.0 for XML_DTD defined and
+ * added in Expat 2.6.0 for XML_GE == 1. */
+XMLPARSEAPI(XML_Bool)
+XML_SetBillionLaughsAttackProtectionActivationThreshold(
+ XML_Parser parser, unsigned long long activationThresholdBytes);
+#endif
+
+/* Added in Expat 2.6.0. */
+XMLPARSEAPI(XML_Bool)
+XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
+
/* Expat follows the semantic versioning convention.
- See http://semver.org.
+ See https://semver.org
*/
#define XML_MAJOR_VERSION 2
-#define XML_MINOR_VERSION 2
-#define XML_MICRO_VERSION 10
+#define XML_MINOR_VERSION 7
+#define XML_MICRO_VERSION 1
#ifdef __cplusplus
}
diff --git a/3rdparty/expat/lib/expat_config.h b/3rdparty/expat/lib/expat_config.h
new file mode 100644
index 00000000000..2272814cf03
--- /dev/null
+++ b/3rdparty/expat/lib/expat_config.h
@@ -0,0 +1,6 @@
+/* expat_config.h. Dummy file to satisfy build process. */
+
+#ifndef EXPAT_CONFIG_H
+#define EXPAT_CONFIG_H 1
+
+#endif // ndef EXPAT_CONFIG_H
diff --git a/3rdparty/expat/lib/expat_external.h b/3rdparty/expat/lib/expat_external.h
index b3b6e74d9d2..8829f770910 100644
--- a/3rdparty/expat/lib/expat_external.h
+++ b/3rdparty/expat/lib/expat_external.h
@@ -7,7 +7,14 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
+ Copyright (c) 2016-2019 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/lib/iasciitab.h b/3rdparty/expat/lib/iasciitab.h
index ea97cfcf678..5d8646f2a31 100644
--- a/3rdparty/expat/lib/iasciitab.h
+++ b/3rdparty/expat/lib/iasciitab.h
@@ -7,7 +7,9 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/lib/internal.h b/3rdparty/expat/lib/internal.h
index 60913dab762..6bde6ae6b31 100644
--- a/3rdparty/expat/lib/internal.h
+++ b/3rdparty/expat/lib/internal.h
@@ -25,8 +25,14 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Copyright (c) 2024 Taichi Haradaguchi <20001722@ymail.ne.jp>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -101,22 +107,72 @@
# endif
#endif
+#include <limits.h> // ULONG_MAX
+
+#if defined(_WIN32) \
+ && (! defined(__USE_MINGW_ANSI_STDIO) \
+ || (1 - __USE_MINGW_ANSI_STDIO - 1 == 0))
+# define EXPAT_FMT_ULL(midpart) "%" midpart "I64u"
+# if defined(_WIN64) // Note: modifiers "td" and "zu" do not work for MinGW
+# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "I64d"
+# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "I64u"
+# else
+# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d"
+# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
+# endif
+#else
+# define EXPAT_FMT_ULL(midpart) "%" midpart "llu"
+# if ! defined(ULONG_MAX)
+# error Compiler did not define ULONG_MAX for us
+# elif ULONG_MAX == 18446744073709551615u // 2^64-1
+# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "ld"
+# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "lu"
+# elif defined(EMSCRIPTEN) // 32bit mode Emscripten
+# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "ld"
+# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "zu"
+# else
+# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d"
+# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
+# endif
+#endif
+
#ifndef UNUSED_P
# define UNUSED_P(p) (void)p
#endif
+/* NOTE BEGIN If you ever patch these defaults to greater values
+ for non-attack XML payload in your environment,
+ please file a bug report with libexpat. Thank you!
+*/
+#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT \
+ 100.0f
+#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT \
+ 8388608 // 8 MiB, 2^23
+/* NOTE END */
+
+#include "expat.h" // so we can use type XML_Parser below
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifdef XML_ENABLE_VISIBILITY
-# if XML_ENABLE_VISIBILITY
-__attribute__((visibility("default")))
-# endif
+void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
+ const char **fromLimRef);
+
+#if defined(XML_GE) && XML_GE == 1
+unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
+unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
+const char *unsignedCharToPrintable(unsigned char c);
+#endif
+
+extern
+#if ! defined(XML_TESTING)
+ const
+#endif
+ XML_Bool g_reparseDeferralEnabledDefault; // written ONLY in runtests.c
+#if defined(XML_TESTING)
+extern unsigned int g_bytesScanned; // used for testing only
#endif
-void
-_INTERNAL_trim_to_complete_utf8_characters(const char *from,
- const char **fromLimRef);
#ifdef __cplusplus
}
diff --git a/3rdparty/expat/lib/latin1tab.h b/3rdparty/expat/lib/latin1tab.h
index 6f916041355..b681d278af6 100644
--- a/3rdparty/expat/lib/latin1tab.h
+++ b/3rdparty/expat/lib/latin1tab.h
@@ -7,7 +7,9 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/lib/libexpat.def b/3rdparty/expat/lib/libexpat.def
deleted file mode 100644
index 16faf5955e7..00000000000
--- a/3rdparty/expat/lib/libexpat.def
+++ /dev/null
@@ -1,78 +0,0 @@
-; DEF file for MS VC++
-
-LIBRARY
-EXPORTS
- XML_DefaultCurrent @1
- XML_ErrorString @2
- XML_ExpatVersion @3
- XML_ExpatVersionInfo @4
- XML_ExternalEntityParserCreate @5
- XML_GetBase @6
- XML_GetBuffer @7
- XML_GetCurrentByteCount @8
- XML_GetCurrentByteIndex @9
- XML_GetCurrentColumnNumber @10
- XML_GetCurrentLineNumber @11
- XML_GetErrorCode @12
- XML_GetIdAttributeIndex @13
- XML_GetInputContext @14
- XML_GetSpecifiedAttributeCount @15
- XML_Parse @16
- XML_ParseBuffer @17
- XML_ParserCreate @18
- XML_ParserCreateNS @19
- XML_ParserCreate_MM @20
- XML_ParserFree @21
- XML_SetAttlistDeclHandler @22
- XML_SetBase @23
- XML_SetCdataSectionHandler @24
- XML_SetCharacterDataHandler @25
- XML_SetCommentHandler @26
- XML_SetDefaultHandler @27
- XML_SetDefaultHandlerExpand @28
- XML_SetDoctypeDeclHandler @29
- XML_SetElementDeclHandler @30
- XML_SetElementHandler @31
- XML_SetEncoding @32
- XML_SetEndCdataSectionHandler @33
- XML_SetEndDoctypeDeclHandler @34
- XML_SetEndElementHandler @35
- XML_SetEndNamespaceDeclHandler @36
- XML_SetEntityDeclHandler @37
- XML_SetExternalEntityRefHandler @38
- XML_SetExternalEntityRefHandlerArg @39
- XML_SetNamespaceDeclHandler @40
- XML_SetNotStandaloneHandler @41
- XML_SetNotationDeclHandler @42
- XML_SetParamEntityParsing @43
- XML_SetProcessingInstructionHandler @44
- XML_SetReturnNSTriplet @45
- XML_SetStartCdataSectionHandler @46
- XML_SetStartDoctypeDeclHandler @47
- XML_SetStartElementHandler @48
- XML_SetStartNamespaceDeclHandler @49
- XML_SetUnknownEncodingHandler @50
- XML_SetUnparsedEntityDeclHandler @51
- XML_SetUserData @52
- XML_SetXmlDeclHandler @53
- XML_UseParserAsHandlerArg @54
-; added with version 1.95.3
- XML_ParserReset @55
- XML_SetSkippedEntityHandler @56
-; added with version 1.95.5
- XML_GetFeatureList @57
- XML_UseForeignDTD @58
-; added with version 1.95.6
- XML_FreeContentModel @59
- XML_MemMalloc @60
- XML_MemRealloc @61
- XML_MemFree @62
-; added with version 1.95.8
- XML_StopParser @63
- XML_ResumeParser @64
- XML_GetParsingStatus @65
-; added with version 2.1.1
-; XML_GetAttributeInfo @66
- XML_SetHashSalt @67
-; added with version 2.2.5
- _INTERNAL_trim_to_complete_utf8_characters @68
diff --git a/3rdparty/expat/lib/libexpatw.def b/3rdparty/expat/lib/libexpat.def.cmake
index 16faf5955e7..10ee9cd6f99 100644
--- a/3rdparty/expat/lib/libexpatw.def
+++ b/3rdparty/expat/lib/libexpat.def.cmake
@@ -1,6 +1,5 @@
; DEF file for MS VC++
-LIBRARY
EXPORTS
XML_DefaultCurrent @1
XML_ErrorString @2
@@ -72,7 +71,11 @@ EXPORTS
XML_ResumeParser @64
XML_GetParsingStatus @65
; added with version 2.1.1
-; XML_GetAttributeInfo @66
+@_EXPAT_COMMENT_ATTR_INFO@ XML_GetAttributeInfo @66
XML_SetHashSalt @67
-; added with version 2.2.5
- _INTERNAL_trim_to_complete_utf8_characters @68
+; internal @68 removed with version 2.3.1
+; added with version 2.4.0
+@_EXPAT_COMMENT_DTD_OR_GE@ XML_SetBillionLaughsAttackProtectionActivationThreshold @69
+@_EXPAT_COMMENT_DTD_OR_GE@ XML_SetBillionLaughsAttackProtectionMaximumAmplification @70
+; added with version 2.6.0
+ XML_SetReparseDeferralEnabled @71
diff --git a/3rdparty/expat/lib/nametab.h b/3rdparty/expat/lib/nametab.h
index 3681df348ee..63485446b96 100644
--- a/3rdparty/expat/lib/nametab.h
+++ b/3rdparty/expat/lib/nametab.h
@@ -6,8 +6,8 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/lib/siphash.h b/3rdparty/expat/lib/siphash.h
index bfee65a332f..04f6f74585b 100644
--- a/3rdparty/expat/lib/siphash.h
+++ b/3rdparty/expat/lib/siphash.h
@@ -11,6 +11,9 @@
* --------------------------------------------------------------------------
* HISTORY:
*
+ * 2020-10-03 (Sebastian Pipping)
+ * - Drop support for Visual Studio 9.0/2008 and earlier
+ *
* 2019-08-03 (Sebastian Pipping)
* - Mark part of sip24_valid as to be excluded from clang-format
* - Re-format code using clang-format 9
@@ -96,22 +99,14 @@
#define SIPHASH_H
#include <stddef.h> /* size_t */
-
-#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
-/* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-#else
-# include <stdint.h> /* uint64_t uint32_t uint8_t */
-#endif
+#include <stdint.h> /* uint64_t uint32_t uint8_t */
/*
* Workaround to not require a C++11 compiler for using ULL suffix
* if this code is included and compiled as C++; related GCC warning is:
* warning: use of C++11 long long integer constant [-Wlong-long]
*/
-#define _SIP_ULL(high, low) (((uint64_t)high << 32) | low)
+#define SIP_ULL(high, low) ((((uint64_t)high) << 32) | (low))
#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
@@ -131,8 +126,7 @@ typedef unsigned __int64 uint64_t;
| ((uint64_t)((p)[4]) << 32) | ((uint64_t)((p)[5]) << 40) \
| ((uint64_t)((p)[6]) << 48) | ((uint64_t)((p)[7]) << 56))
-#define SIPHASH_INITIALIZER \
- { 0, 0, 0, 0, {0}, 0, 0 }
+#define SIPHASH_INITIALIZER {0, 0, 0, 0, {0}, 0, 0}
struct siphash {
uint64_t v0, v1, v2, v3;
@@ -195,10 +189,10 @@ sip_round(struct siphash *H, const int rounds) {
static struct siphash *
sip24_init(struct siphash *H, const struct sipkey *key) {
- H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
- H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
- H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
- H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
+ H->v0 = SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
+ H->v1 = SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
+ H->v2 = SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
+ H->v3 = SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
H->p = H->buf;
H->c = 0;
diff --git a/3rdparty/expat/lib/utf8tab.h b/3rdparty/expat/lib/utf8tab.h
index a22986acbb9..88efcf91cc1 100644
--- a/3rdparty/expat/lib/utf8tab.h
+++ b/3rdparty/expat/lib/utf8tab.h
@@ -7,7 +7,9 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/lib/winconfig.h b/3rdparty/expat/lib/winconfig.h
index 562a4a82dc1..05805514ec7 100644
--- a/3rdparty/expat/lib/winconfig.h
+++ b/3rdparty/expat/lib/winconfig.h
@@ -6,8 +6,11 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2023 Orgad Shaneh <orgad.shaneh@audiocodes.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -33,24 +36,13 @@
#ifndef WINCONFIG_H
#define WINCONFIG_H
-#define WIN32_LEAN_AND_MEAN
+#ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <memory.h>
#include <string.h>
-#if defined(HAVE_EXPAT_CONFIG_H) /* e.g. MinGW */
-# include <expat_config.h>
-#else /* !defined(HAVE_EXPAT_CONFIG_H) */
-
-# define XML_NS 1
-# define XML_DTD 1
-# define XML_CONTEXT_BYTES 1024
-
-/* we will assume all Windows platforms are little endian */
-# define BYTEORDER 1234
-
-#endif /* !defined(HAVE_EXPAT_CONFIG_H) */
-
#endif /* ndef WINCONFIG_H */
diff --git a/3rdparty/expat/lib/xmlparse.c b/3rdparty/expat/lib/xmlparse.c
index dfc316ca36c..38a2d9657b6 100644
--- a/3rdparty/expat/lib/xmlparse.c
+++ b/3rdparty/expat/lib/xmlparse.c
@@ -1,4 +1,4 @@
-/* 5cd169f2942b85c05e0b1b96f9990f91ac3d07e470ad7ce906ac8590c8ed4f35 (2.2.10+)
+/* d19ae032c224863c1527ba44d228cc34b99192c3a4c5a27af1f4e054d45ee031 (2.7.1+)
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
@@ -7,7 +7,40 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2000-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2005-2009 Steven Solie <steven@solie.ca>
+ Copyright (c) 2016 Eric Rahm <erahm@mozilla.com>
+ Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2016 Gaurav <g.gupta@samsung.com>
+ Copyright (c) 2016 Thomas Beutlich <tc@tbeu.de>
+ Copyright (c) 2016 Gustavo Grieco <gustavo.grieco@imag.fr>
+ Copyright (c) 2016 Pascal Cuoq <cuoq@trust-in-soft.com>
+ Copyright (c) 2016 Ed Schouten <ed@nuxi.nl>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Václav Slavík <vaclav@slavik.io>
+ Copyright (c) 2017 Viktor Szakats <commit@vsz.me>
+ Copyright (c) 2017 Chanho Park <chanho61.park@samsung.com>
+ Copyright (c) 2017 Rolf Eike Beer <eike@sf-mail.de>
+ Copyright (c) 2017 Hans Wennborg <hans@chromium.org>
+ Copyright (c) 2018 Anton Maklakov <antmak.pub@gmail.com>
+ Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2018 Mariusz Zaborski <oshogbo@vexillium.org>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2019-2020 Ben Wagner <bungeman@chromium.org>
+ Copyright (c) 2019 Vadim Zeitlin <vadim@zeitlins.org>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2022 Samanta Navarro <ferivoz@riseup.net>
+ Copyright (c) 2022 Jeffrey Walton <noloader@gmail.com>
+ Copyright (c) 2022 Jann Horn <jannh@google.com>
+ Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
+ Copyright (c) 2023 Owain Davies <owaind@bath.edu>
+ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Copyright (c) 2024-2025 Berkay Eren Ürün <berkay.ueruen@siemens.com>
+ Copyright (c) 2024 Hanno Böck <hanno@gentoo.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,8 +63,27 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if ! defined(_GNU_SOURCE)
-# define _GNU_SOURCE 1 /* syscall prototype */
+#define XML_BUILDING_EXPAT 1
+
+#include "expat_config.h"
+
+#if ! defined(XML_GE) || (1 - XML_GE - 1 == 2) || (XML_GE < 0) || (XML_GE > 1)
+# error XML_GE (for general entities) must be defined, non-empty, either 1 or 0 (0 to disable, 1 to enable; 1 is a common default)
+#endif
+
+#if defined(XML_DTD) && XML_GE == 0
+# error Either undefine XML_DTD or define XML_GE to 1.
+#endif
+
+#if ! defined(XML_CONTEXT_BYTES) || (1 - XML_CONTEXT_BYTES - 1 == 2) \
+ || (XML_CONTEXT_BYTES + 0 < 0)
+# error XML_CONTEXT_BYTES must be defined, non-empty and >=0 (0 to disable, >=1 to enable; 1024 is a common default)
+#endif
+
+#if defined(HAVE_SYSCALL_GETRANDOM)
+# if ! defined(_GNU_SOURCE)
+# define _GNU_SOURCE 1 /* syscall prototype */
+# endif
#endif
#ifdef _WIN32
@@ -41,23 +93,15 @@
# endif
#endif
+#include <stdbool.h>
#include <stddef.h>
#include <string.h> /* memset(), memcpy() */
#include <assert.h>
#include <limits.h> /* UINT_MAX */
#include <stdio.h> /* fprintf */
#include <stdlib.h> /* getenv, rand_s */
-
-#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
-/* vs2008/9.0 and earlier lack stdint.h; _MSC_VER 1600 is vs2010/10.0 */
-# if defined(_WIN64)
-typedef unsigned __int64 uintptr_t;
-# else
-typedef unsigned __int32 uintptr_t;
-# endif
-#else
-# include <stdint.h> /* uintptr_t */
-#endif
+#include <stdint.h> /* uintptr_t */
+#include <math.h> /* isnan */
#ifdef _WIN32
# define getpid GetCurrentProcessId
@@ -69,13 +113,9 @@ typedef unsigned __int32 uintptr_t;
# include <errno.h>
#endif
-#define XML_BUILDING_EXPAT 1
-
#ifdef _WIN32
# include "winconfig.h"
-#elif defined(HAVE_EXPAT_CONFIG_H)
-# include <expat_config.h>
-#endif /* ndef _WIN32 */
+#endif
#include "ascii.h"
#include "expat.h"
@@ -112,11 +152,11 @@ typedef unsigned __int32 uintptr_t;
Your options include: \
* Linux >=3.17 + glibc >=2.25 (getrandom): HAVE_GETRANDOM, \
* Linux >=3.17 + glibc (including <2.25) (syscall SYS_getrandom): HAVE_SYSCALL_GETRANDOM, \
- * BSD / macOS >=10.7 (arc4random_buf): HAVE_ARC4RANDOM_BUF, \
- * BSD / macOS (including <10.7) (arc4random): HAVE_ARC4RANDOM, \
+ * BSD / macOS >=10.7 / glibc >=2.36 (arc4random_buf): HAVE_ARC4RANDOM_BUF, \
+ * BSD / macOS (including <10.7) / glibc >=2.36 (arc4random): HAVE_ARC4RANDOM, \
* libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, \
* libbsd (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, \
- * Linux (including <3.17) / BSD / macOS (including <10.7) (/dev/urandom): XML_DEV_URANDOM, \
+ * Linux (including <3.17) / BSD / macOS (including <10.7) / Solaris >=8 (/dev/urandom): XML_DEV_URANDOM, \
* Windows >=Vista (rand_s): _WIN32. \
\
If insist on not using any of these, bypass this error by defining \
@@ -172,11 +212,13 @@ typedef char ICHAR;
#endif
/* Round up n to be a multiple of sz, where sz is a power of 2. */
-#define ROUND_UP(n, sz) (((n) + ((sz)-1)) & ~((sz)-1))
+#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))
/* Do safe (NULL-aware) pointer arithmetic */
#define EXPAT_SAFE_PTR_DIFF(p, q) (((p) && (q)) ? ((p) - (q)) : 0)
+#define EXPAT_MIN(a, b) (((a) < (b)) ? (a) : (b))
+
#include "internal.h"
#include "xmltok.h"
#include "xmlrole.h"
@@ -208,7 +250,7 @@ static void copy_salt_to_sipkey(XML_Parser parser, struct sipkey *key);
it odd, since odd numbers are always relative prime to a power of 2.
*/
#define SECOND_HASH(hash, mask, power) \
- ((((hash) & ~(mask)) >> ((power)-1)) & ((mask) >> 2))
+ ((((hash) & ~(mask)) >> ((power) - 1)) & ((mask) >> 2))
#define PROBE_STEP(hash, mask, power) \
((unsigned char)((SECOND_HASH(hash, mask, power)) | 1))
@@ -254,13 +296,13 @@ typedef struct {
The name of the element is stored in both the document and API
encodings. The memory buffer 'buf' is a separately-allocated
memory area which stores the name. During the XML_Parse()/
- XMLParseBuffer() when the element is open, the memory for the 'raw'
+ XML_ParseBuffer() when the element is open, the memory for the 'raw'
version of the name (in the document encoding) is shared with the
document buffer. If the element is open across calls to
XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to
contain the 'raw' name as well.
- A parser re-uses these structures, maintaining a list of allocated
+ A parser reuses these structures, maintaining a list of allocated
TAG objects in a free list.
*/
typedef struct tag {
@@ -283,6 +325,10 @@ typedef struct {
const XML_Char *publicId;
const XML_Char *notation;
XML_Bool open;
+ XML_Bool hasMore; /* true if entity has not been completely processed */
+ /* An entity can be open while being already completely processed (hasMore ==
+ XML_FALSE). The reason is the delayed closing of entities until their inner
+ entities are processed and closed */
XML_Bool is_param;
XML_Bool is_internal; /* true if declared in internal subset outside PE */
} ENTITY;
@@ -373,6 +419,12 @@ typedef struct {
int *scaffIndex;
} DTD;
+enum EntityType {
+ ENTITY_INTERNAL,
+ ENTITY_ATTRIBUTE,
+ ENTITY_VALUE,
+};
+
typedef struct open_internal_entity {
const char *internalEventPtr;
const char *internalEventEndPtr;
@@ -380,8 +432,34 @@ typedef struct open_internal_entity {
ENTITY *entity;
int startTagLevel;
XML_Bool betweenDecl; /* WFC: PE Between Declarations */
+ enum EntityType type;
} OPEN_INTERNAL_ENTITY;
+enum XML_Account {
+ XML_ACCOUNT_DIRECT, /* bytes directly passed to the Expat parser */
+ XML_ACCOUNT_ENTITY_EXPANSION, /* intermediate bytes produced during entity
+ expansion */
+ XML_ACCOUNT_NONE /* i.e. do not account, was accounted already */
+};
+
+#if XML_GE == 1
+typedef unsigned long long XmlBigCount;
+typedef struct accounting {
+ XmlBigCount countBytesDirect;
+ XmlBigCount countBytesIndirect;
+ unsigned long debugLevel;
+ float maximumAmplificationFactor; // >=1.0
+ unsigned long long activationThresholdBytes;
+} ACCOUNTING;
+
+typedef struct entity_stats {
+ unsigned int countEverOpened;
+ unsigned int currentDepth;
+ unsigned int maximumDepthSeen;
+ unsigned long debugLevel;
+} ENTITY_STATS;
+#endif /* XML_GE == 1 */
+
typedef enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start,
const char *end, const char **endPtr);
@@ -412,43 +490,59 @@ static enum XML_Error initializeEncoding(XML_Parser parser);
static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc,
const char *s, const char *end, int tok,
const char *next, const char **nextPtr,
- XML_Bool haveMore, XML_Bool allowClosingDoctype);
-static enum XML_Error processInternalEntity(XML_Parser parser, ENTITY *entity,
- XML_Bool betweenDecl);
+ XML_Bool haveMore, XML_Bool allowClosingDoctype,
+ enum XML_Account account);
+static enum XML_Error processEntity(XML_Parser parser, ENTITY *entity,
+ XML_Bool betweenDecl, enum EntityType type);
static enum XML_Error doContent(XML_Parser parser, int startTagLevel,
const ENCODING *enc, const char *start,
const char *end, const char **endPtr,
- XML_Bool haveMore);
-static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *,
+ XML_Bool haveMore, enum XML_Account account);
+static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *enc,
const char **startPtr, const char *end,
- const char **nextPtr, XML_Bool haveMore);
+ const char **nextPtr, XML_Bool haveMore,
+ enum XML_Account account);
#ifdef XML_DTD
-static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *,
+static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *enc,
const char **startPtr, const char *end,
const char **nextPtr, XML_Bool haveMore);
#endif /* XML_DTD */
static void freeBindings(XML_Parser parser, BINDING *bindings);
-static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *,
- const char *s, TAG_NAME *tagNamePtr,
- BINDING **bindingsPtr);
+static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc,
+ const char *attStr, TAG_NAME *tagNamePtr,
+ BINDING **bindingsPtr,
+ enum XML_Account account);
static enum XML_Error addBinding(XML_Parser parser, PREFIX *prefix,
const ATTRIBUTE_ID *attId, const XML_Char *uri,
BINDING **bindingsPtr);
-static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
- XML_Bool isId, const XML_Char *dfltValue,
- XML_Parser parser);
-static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *,
- XML_Bool isCdata, const char *,
- const char *, STRING_POOL *);
-static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *,
- XML_Bool isCdata, const char *,
- const char *, STRING_POOL *);
+static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId,
+ XML_Bool isCdata, XML_Bool isId,
+ const XML_Char *value, XML_Parser parser);
+static enum XML_Error storeAttributeValue(XML_Parser parser,
+ const ENCODING *enc, XML_Bool isCdata,
+ const char *ptr, const char *end,
+ STRING_POOL *pool,
+ enum XML_Account account);
+static enum XML_Error
+appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
+ const char *ptr, const char *end, STRING_POOL *pool,
+ enum XML_Account account, const char **nextPtr);
static ATTRIBUTE_ID *getAttributeId(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end);
-static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *);
+static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType);
+#if XML_GE == 1
static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc,
- const char *start, const char *end);
+ const char *start, const char *end,
+ enum XML_Account account,
+ const char **nextPtr);
+static enum XML_Error callStoreEntityValue(XML_Parser parser,
+ const ENCODING *enc,
+ const char *start, const char *end,
+ enum XML_Account account);
+#else
+static enum XML_Error storeSelfEntityValue(XML_Parser parser, ENTITY *entity);
+#endif
static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end);
static int reportComment(XML_Parser parser, const ENCODING *enc,
@@ -468,21 +562,22 @@ static void dtdDestroy(DTD *p, XML_Bool isDocEntity,
const XML_Memory_Handling_Suite *ms);
static int dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd,
const XML_Memory_Handling_Suite *ms);
-static int copyEntityTable(XML_Parser oldParser, HASH_TABLE *, STRING_POOL *,
- const HASH_TABLE *);
+static int copyEntityTable(XML_Parser oldParser, HASH_TABLE *newTable,
+ STRING_POOL *newPool, const HASH_TABLE *oldTable);
static NAMED *lookup(XML_Parser parser, HASH_TABLE *table, KEY name,
size_t createSize);
-static void FASTCALL hashTableInit(HASH_TABLE *,
+static void FASTCALL hashTableInit(HASH_TABLE *table,
const XML_Memory_Handling_Suite *ms);
-static void FASTCALL hashTableClear(HASH_TABLE *);
-static void FASTCALL hashTableDestroy(HASH_TABLE *);
-static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *);
-static NAMED *FASTCALL hashTableIterNext(HASH_TABLE_ITER *);
+static void FASTCALL hashTableClear(HASH_TABLE *table);
+static void FASTCALL hashTableDestroy(HASH_TABLE *table);
+static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *iter,
+ const HASH_TABLE *table);
+static NAMED *FASTCALL hashTableIterNext(HASH_TABLE_ITER *iter);
-static void FASTCALL poolInit(STRING_POOL *,
+static void FASTCALL poolInit(STRING_POOL *pool,
const XML_Memory_Handling_Suite *ms);
-static void FASTCALL poolClear(STRING_POOL *);
-static void FASTCALL poolDestroy(STRING_POOL *);
+static void FASTCALL poolClear(STRING_POOL *pool);
+static void FASTCALL poolDestroy(STRING_POOL *pool);
static XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc,
const char *ptr, const char *end);
static XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc,
@@ -512,8 +607,35 @@ static XML_Parser parserCreate(const XML_Char *encodingName,
static void parserInit(XML_Parser parser, const XML_Char *encodingName);
+#if XML_GE == 1
+static float accountingGetCurrentAmplification(XML_Parser rootParser);
+static void accountingReportStats(XML_Parser originParser, const char *epilog);
+static void accountingOnAbort(XML_Parser originParser);
+static void accountingReportDiff(XML_Parser rootParser,
+ unsigned int levelsAwayFromRootParser,
+ const char *before, const char *after,
+ ptrdiff_t bytesMore, int source_line,
+ enum XML_Account account);
+static XML_Bool accountingDiffTolerated(XML_Parser originParser, int tok,
+ const char *before, const char *after,
+ int source_line,
+ enum XML_Account account);
+
+static void entityTrackingReportStats(XML_Parser parser, ENTITY *entity,
+ const char *action, int sourceLine);
+static void entityTrackingOnOpen(XML_Parser parser, ENTITY *entity,
+ int sourceLine);
+static void entityTrackingOnClose(XML_Parser parser, ENTITY *entity,
+ int sourceLine);
+
+static XML_Parser getRootParserOf(XML_Parser parser,
+ unsigned int *outLevelDiff);
+#endif /* XML_GE == 1 */
+
+static unsigned long getDebugLevel(const char *variableName,
+ unsigned long defaultDebugLevel);
+
#define poolStart(pool) ((pool)->start)
-#define poolEnd(pool) ((pool)->ptr)
#define poolLength(pool) ((pool)->ptr - (pool)->start)
#define poolChop(pool) ((void)--(pool->ptr))
#define poolLastChar(pool) (((pool)->ptr)[-1])
@@ -524,21 +646,41 @@ static void parserInit(XML_Parser parser, const XML_Char *encodingName);
? 0 \
: ((*((pool)->ptr)++ = c), 1))
+#if ! defined(XML_TESTING)
+const
+#endif
+ XML_Bool g_reparseDeferralEnabledDefault
+ = XML_TRUE; // write ONLY in runtests.c
+#if defined(XML_TESTING)
+unsigned int g_bytesScanned = 0; // used for testing only
+#endif
+
struct XML_ParserStruct {
/* The first member must be m_userData so that the XML_GetUserData
macro works. */
void *m_userData;
void *m_handlerArg;
- char *m_buffer;
+
+ // How the four parse buffer pointers below relate in time and space:
+ //
+ // m_buffer <= m_bufferPtr <= m_bufferEnd <= m_bufferLim
+ // | | | |
+ // <--parsed-->| | |
+ // <---parsing--->| |
+ // <--unoccupied-->|
+ // <---------total-malloced/realloced-------->|
+
+ char *m_buffer; // malloc/realloc base pointer of parse buffer
const XML_Memory_Handling_Suite m_mem;
- /* first character to be parsed */
- const char *m_bufferPtr;
- /* past last character to be parsed */
- char *m_bufferEnd;
- /* allocated end of m_buffer */
- const char *m_bufferLim;
+ const char *m_bufferPtr; // first character to be parsed
+ char *m_bufferEnd; // past last character to be parsed
+ const char *m_bufferLim; // allocated end of m_buffer
+
XML_Index m_parseEndByteIndex;
const char *m_parseEndPtr;
+ size_t m_partialTokenBytesBefore; /* used in heuristic to avoid O(n^2) */
+ XML_Bool m_reparseDeferralEnabled;
+ int m_lastBufferRequestSize;
XML_Char *m_dataBuf;
XML_Char *m_dataBufEnd;
XML_StartElementHandler m_startElementHandler;
@@ -582,6 +724,10 @@ struct XML_ParserStruct {
const char *m_positionPtr;
OPEN_INTERNAL_ENTITY *m_openInternalEntities;
OPEN_INTERNAL_ENTITY *m_freeInternalEntities;
+ OPEN_INTERNAL_ENTITY *m_openAttributeEntities;
+ OPEN_INTERNAL_ENTITY *m_freeAttributeEntities;
+ OPEN_INTERNAL_ENTITY *m_openValueEntities;
+ OPEN_INTERNAL_ENTITY *m_freeValueEntities;
XML_Bool m_defaultExpandInternalEntities;
int m_tagLevel;
ENTITY *m_declEntity;
@@ -625,6 +771,11 @@ struct XML_ParserStruct {
enum XML_ParamEntityParsing m_paramEntityParsing;
#endif
unsigned long m_hash_secret_salt;
+#if XML_GE == 1
+ ACCOUNTING m_accounting;
+ ENTITY_STATS m_entity_stats;
+#endif
+ XML_Bool m_reenter;
};
#define MALLOC(parser, s) (parser->m_mem.malloc_fcn((s)))
@@ -638,11 +789,11 @@ XML_ParserCreate(const XML_Char *encodingName) {
XML_Parser XMLCALL
XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) {
- XML_Char tmp[2];
- *tmp = nsSep;
+ XML_Char tmp[2] = {nsSep, 0};
return XML_ParserCreate_MM(encodingName, NULL, tmp);
}
+// "xml=http://www.w3.org/XML/1998/namespace"
static const XML_Char implicitContext[]
= {ASCII_x, ASCII_m, ASCII_l, ASCII_EQUALS, ASCII_h,
ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH,
@@ -809,9 +960,8 @@ gather_time_entropy(void) {
static unsigned long
ENTROPY_DEBUG(const char *label, unsigned long entropy) {
- const char *const EXPAT_ENTROPY_DEBUG = getenv("EXPAT_ENTROPY_DEBUG");
- if (EXPAT_ENTROPY_DEBUG && ! strcmp(EXPAT_ENTROPY_DEBUG, "1")) {
- fprintf(stderr, "Entropy: %s --> 0x%0*lx (%lu bytes)\n", label,
+ if (getDebugLevel("EXPAT_ENTROPY_DEBUG", 0) >= 1u) {
+ fprintf(stderr, "expat: Entropy: %s --> 0x%0*lx (%lu bytes)\n", label,
(int)sizeof(entropy) * 2, entropy, (unsigned long)sizeof(entropy));
}
return entropy;
@@ -867,6 +1017,71 @@ get_hash_secret_salt(XML_Parser parser) {
return parser->m_hash_secret_salt;
}
+static enum XML_Error
+callProcessor(XML_Parser parser, const char *start, const char *end,
+ const char **endPtr) {
+ const size_t have_now = EXPAT_SAFE_PTR_DIFF(end, start);
+
+ if (parser->m_reparseDeferralEnabled
+ && ! parser->m_parsingStatus.finalBuffer) {
+ // Heuristic: don't try to parse a partial token again until the amount of
+ // available data has increased significantly.
+ const size_t had_before = parser->m_partialTokenBytesBefore;
+ // ...but *do* try anyway if we're close to causing a reallocation.
+ size_t available_buffer
+ = EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer);
+#if XML_CONTEXT_BYTES > 0
+ available_buffer -= EXPAT_MIN(available_buffer, XML_CONTEXT_BYTES);
+#endif
+ available_buffer
+ += EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferEnd);
+ // m_lastBufferRequestSize is never assigned a value < 0, so the cast is ok
+ const bool enough
+ = (have_now >= 2 * had_before)
+ || ((size_t)parser->m_lastBufferRequestSize > available_buffer);
+
+ if (! enough) {
+ *endPtr = start; // callers may expect this to be set
+ return XML_ERROR_NONE;
+ }
+ }
+#if defined(XML_TESTING)
+ g_bytesScanned += (unsigned)have_now;
+#endif
+ // Run in a loop to eliminate dangerous recursion depths
+ enum XML_Error ret;
+ *endPtr = start;
+ while (1) {
+ // Use endPtr as the new start in each iteration, since it will
+ // be set to the next start point by m_processor.
+ ret = parser->m_processor(parser, *endPtr, end, endPtr);
+
+ // Make parsing status (and in particular XML_SUSPENDED) take
+ // precedence over re-enter flag when they disagree
+ if (parser->m_parsingStatus.parsing != XML_PARSING) {
+ parser->m_reenter = XML_FALSE;
+ }
+
+ if (! parser->m_reenter) {
+ break;
+ }
+
+ parser->m_reenter = XML_FALSE;
+ if (ret != XML_ERROR_NONE)
+ return ret;
+ }
+
+ if (ret == XML_ERROR_NONE) {
+ // if we consumed nothing, remember what we had on this parse attempt.
+ if (*endPtr == start) {
+ parser->m_partialTokenBytesBefore = have_now;
+ } else {
+ parser->m_partialTokenBytesBefore = 0;
+ }
+ }
+ return ret;
+}
+
static XML_Bool /* only valid for root parser */
startParsing(XML_Parser parser) {
/* hash functions must be initialized before setContext() is called */
@@ -896,7 +1111,7 @@ parserCreate(const XML_Char *encodingName,
if (memsuite) {
XML_Memory_Handling_Suite *mtemp;
- parser = (XML_Parser)memsuite->malloc_fcn(sizeof(struct XML_ParserStruct));
+ parser = memsuite->malloc_fcn(sizeof(struct XML_ParserStruct));
if (parser != NULL) {
mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem);
mtemp->malloc_fcn = memsuite->malloc_fcn;
@@ -966,6 +1181,8 @@ parserCreate(const XML_Char *encodingName,
parser->m_freeBindingList = NULL;
parser->m_freeTagList = NULL;
parser->m_freeInternalEntities = NULL;
+ parser->m_freeAttributeEntities = NULL;
+ parser->m_freeValueEntities = NULL;
parser->m_groupSize = 0;
parser->m_groupConnector = NULL;
@@ -988,6 +1205,14 @@ parserCreate(const XML_Char *encodingName,
parserInit(parser, encodingName);
if (encodingName && ! parser->m_protocolEncodingName) {
+ if (dtd) {
+ // We need to stop the upcoming call to XML_ParserFree from happily
+ // destroying parser->m_dtd because the DTD is shared with the parent
+ // parser and the only guard that keeps XML_ParserFree from destroying
+ // parser->m_dtd is parser->m_isParamEntity but it will be set to
+ // XML_TRUE only later in XML_ExternalEntityParserCreate (or not at all).
+ parser->m_dtd = NULL;
+ }
XML_ParserFree(parser);
return NULL;
}
@@ -1040,6 +1265,9 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) {
parser->m_bufferEnd = parser->m_buffer;
parser->m_parseEndByteIndex = 0;
parser->m_parseEndPtr = NULL;
+ parser->m_partialTokenBytesBefore = 0;
+ parser->m_reparseDeferralEnabled = g_reparseDeferralEnabledDefault;
+ parser->m_lastBufferRequestSize = 0;
parser->m_declElementType = NULL;
parser->m_declAttributeId = NULL;
parser->m_declEntity = NULL;
@@ -1057,6 +1285,8 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) {
parser->m_eventEndPtr = NULL;
parser->m_positionPtr = NULL;
parser->m_openInternalEntities = NULL;
+ parser->m_openAttributeEntities = NULL;
+ parser->m_openValueEntities = NULL;
parser->m_defaultExpandInternalEntities = XML_TRUE;
parser->m_tagLevel = 0;
parser->m_tagStack = NULL;
@@ -1067,12 +1297,26 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) {
parser->m_unknownEncodingData = NULL;
parser->m_parentParser = NULL;
parser->m_parsingStatus.parsing = XML_INITIALIZED;
+ // Reentry can only be triggered inside m_processor calls
+ parser->m_reenter = XML_FALSE;
#ifdef XML_DTD
parser->m_isParamEntity = XML_FALSE;
parser->m_useForeignDTD = XML_FALSE;
parser->m_paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
#endif
parser->m_hash_secret_salt = 0;
+
+#if XML_GE == 1
+ memset(&parser->m_accounting, 0, sizeof(ACCOUNTING));
+ parser->m_accounting.debugLevel = getDebugLevel("EXPAT_ACCOUNTING_DEBUG", 0u);
+ parser->m_accounting.maximumAmplificationFactor
+ = EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT;
+ parser->m_accounting.activationThresholdBytes
+ = EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT;
+
+ memset(&parser->m_entity_stats, 0, sizeof(ENTITY_STATS));
+ parser->m_entity_stats.debugLevel = getDebugLevel("EXPAT_ENTITY_DEBUG", 0u);
+#endif
}
/* moves list of bindings to m_freeBindingList */
@@ -1114,6 +1358,24 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) {
openEntity->next = parser->m_freeInternalEntities;
parser->m_freeInternalEntities = openEntity;
}
+ /* move m_openAttributeEntities to m_freeAttributeEntities (i.e. same task but
+ * for attributes) */
+ openEntityList = parser->m_openAttributeEntities;
+ while (openEntityList) {
+ OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
+ openEntityList = openEntity->next;
+ openEntity->next = parser->m_freeAttributeEntities;
+ parser->m_freeAttributeEntities = openEntity;
+ }
+ /* move m_openValueEntities to m_freeValueEntities (i.e. same task but
+ * for value entities) */
+ openEntityList = parser->m_openValueEntities;
+ while (openEntityList) {
+ OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
+ openEntityList = openEntity->next;
+ openEntity->next = parser->m_freeValueEntities;
+ parser->m_freeValueEntities = openEntity;
+ }
moveToFreeBindingList(parser, parser->m_inheritedBindings);
FREE(parser, parser->m_unknownEncodingMem);
if (parser->m_unknownEncodingRelease)
@@ -1127,6 +1389,19 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) {
return XML_TRUE;
}
+static XML_Bool
+parserBusy(XML_Parser parser) {
+ switch (parser->m_parsingStatus.parsing) {
+ case XML_PARSING:
+ case XML_SUSPENDED:
+ return XML_TRUE;
+ case XML_INITIALIZED:
+ case XML_FINISHED:
+ default:
+ return XML_FALSE;
+ }
+}
+
enum XML_Status XMLCALL
XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) {
if (parser == NULL)
@@ -1135,8 +1410,7 @@ XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) {
XXX There's no way for the caller to determine which of the
XXX possible error cases caused the XML_STATUS_ERROR return.
*/
- if (parser->m_parsingStatus.parsing == XML_PARSING
- || parser->m_parsingStatus.parsing == XML_SUSPENDED)
+ if (parserBusy(parser))
return XML_STATUS_ERROR;
/* Get rid of any previous encoding name */
@@ -1197,6 +1471,7 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context,
to worry which hash secrets each table has.
*/
unsigned long oldhash_secret_salt;
+ XML_Bool oldReparseDeferralEnabled;
/* Validate the oldParser parameter before we pull everything out of it */
if (oldParser == NULL)
@@ -1241,6 +1516,7 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context,
to worry which hash secrets each table has.
*/
oldhash_secret_salt = parser->m_hash_secret_salt;
+ oldReparseDeferralEnabled = parser->m_reparseDeferralEnabled;
#ifdef XML_DTD
if (! context)
@@ -1253,8 +1529,7 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context,
would be otherwise.
*/
if (parser->m_ns) {
- XML_Char tmp[2];
- *tmp = parser->m_namespaceSeparator;
+ XML_Char tmp[2] = {parser->m_namespaceSeparator, 0};
parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
} else {
parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd);
@@ -1294,6 +1569,7 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context,
parser->m_defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
parser->m_ns_triplets = oldns_triplets;
parser->m_hash_secret_salt = oldhash_secret_salt;
+ parser->m_reparseDeferralEnabled = oldReparseDeferralEnabled;
parser->m_parentParser = oldParser;
#ifdef XML_DTD
parser->m_paramEntityParsing = oldParamEntityParsing;
@@ -1371,7 +1647,34 @@ XML_ParserFree(XML_Parser parser) {
entityList = entityList->next;
FREE(parser, openEntity);
}
-
+ /* free m_openAttributeEntities and m_freeAttributeEntities */
+ entityList = parser->m_openAttributeEntities;
+ for (;;) {
+ OPEN_INTERNAL_ENTITY *openEntity;
+ if (entityList == NULL) {
+ if (parser->m_freeAttributeEntities == NULL)
+ break;
+ entityList = parser->m_freeAttributeEntities;
+ parser->m_freeAttributeEntities = NULL;
+ }
+ openEntity = entityList;
+ entityList = entityList->next;
+ FREE(parser, openEntity);
+ }
+ /* free m_openValueEntities and m_freeValueEntities */
+ entityList = parser->m_openValueEntities;
+ for (;;) {
+ OPEN_INTERNAL_ENTITY *openEntity;
+ if (entityList == NULL) {
+ if (parser->m_freeValueEntities == NULL)
+ break;
+ entityList = parser->m_freeValueEntities;
+ parser->m_freeValueEntities = NULL;
+ }
+ openEntity = entityList;
+ entityList = entityList->next;
+ FREE(parser, openEntity);
+ }
destroyBindings(parser->m_freeBindingList, parser);
destroyBindings(parser->m_inheritedBindings, parser);
poolDestroy(&parser->m_tempPool);
@@ -1413,8 +1716,7 @@ XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD) {
return XML_ERROR_INVALID_ARGUMENT;
#ifdef XML_DTD
/* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (parser->m_parsingStatus.parsing == XML_PARSING
- || parser->m_parsingStatus.parsing == XML_SUSPENDED)
+ if (parserBusy(parser))
return XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING;
parser->m_useForeignDTD = useDTD;
return XML_ERROR_NONE;
@@ -1429,8 +1731,7 @@ XML_SetReturnNSTriplet(XML_Parser parser, int do_nst) {
if (parser == NULL)
return;
/* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (parser->m_parsingStatus.parsing == XML_PARSING
- || parser->m_parsingStatus.parsing == XML_SUSPENDED)
+ if (parserBusy(parser))
return;
parser->m_ns_triplets = do_nst ? XML_TRUE : XML_FALSE;
}
@@ -1699,8 +2000,7 @@ XML_SetParamEntityParsing(XML_Parser parser,
if (parser == NULL)
return 0;
/* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (parser->m_parsingStatus.parsing == XML_PARSING
- || parser->m_parsingStatus.parsing == XML_SUSPENDED)
+ if (parserBusy(parser))
return 0;
#ifdef XML_DTD
parser->m_paramEntityParsing = peParsing;
@@ -1717,8 +2017,7 @@ XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt) {
if (parser->m_parentParser)
return XML_SetHashSalt(parser->m_parentParser, hash_salt);
/* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (parser->m_parsingStatus.parsing == XML_PARSING
- || parser->m_parsingStatus.parsing == XML_SUSPENDED)
+ if (parserBusy(parser))
return 0;
parser->m_hash_secret_salt = hash_salt;
return 1;
@@ -1748,55 +2047,8 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) {
parser->m_parsingStatus.parsing = XML_PARSING;
}
- if (len == 0) {
- parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
- if (! isFinal)
- return XML_STATUS_OK;
- parser->m_positionPtr = parser->m_bufferPtr;
- parser->m_parseEndPtr = parser->m_bufferEnd;
-
- /* If data are left over from last buffer, and we now know that these
- data are the final chunk of input, then we have to check them again
- to detect errors based on that fact.
- */
- parser->m_errorCode
- = parser->m_processor(parser, parser->m_bufferPtr,
- parser->m_parseEndPtr, &parser->m_bufferPtr);
-
- if (parser->m_errorCode == XML_ERROR_NONE) {
- switch (parser->m_parsingStatus.parsing) {
- case XML_SUSPENDED:
- /* It is hard to be certain, but it seems that this case
- * cannot occur. This code is cleaning up a previous parse
- * with no new data (since len == 0). Changing the parsing
- * state requires getting to execute a handler function, and
- * there doesn't seem to be an opportunity for that while in
- * this circumstance.
- *
- * Given the uncertainty, we retain the code but exclude it
- * from coverage tests.
- *
- * LCOV_EXCL_START
- */
- XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr,
- parser->m_bufferPtr, &parser->m_position);
- parser->m_positionPtr = parser->m_bufferPtr;
- return XML_STATUS_SUSPENDED;
- /* LCOV_EXCL_STOP */
- case XML_INITIALIZED:
- case XML_PARSING:
- parser->m_parsingStatus.parsing = XML_FINISHED;
- /* fall through */
- default:
- return XML_STATUS_OK;
- }
- }
- parser->m_eventEndPtr = parser->m_eventPtr;
- parser->m_processor = errorProcessor;
- return XML_STATUS_ERROR;
- }
-#ifndef XML_CONTEXT_BYTES
- else if (parser->m_bufferPtr == parser->m_bufferEnd) {
+#if XML_CONTEXT_BYTES == 0
+ if (parser->m_bufferPtr == parser->m_bufferEnd) {
const char *end;
int nLeftOver;
enum XML_Status result;
@@ -1807,12 +2059,15 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) {
parser->m_processor = errorProcessor;
return XML_STATUS_ERROR;
}
+ // though this isn't a buffer request, we assume that `len` is the app's
+ // preferred buffer fill size, and therefore save it here.
+ parser->m_lastBufferRequestSize = len;
parser->m_parseEndByteIndex += len;
parser->m_positionPtr = s;
parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
parser->m_errorCode
- = parser->m_processor(parser, s, parser->m_parseEndPtr = s + len, &end);
+ = callProcessor(parser, s, parser->m_parseEndPtr = s + len, &end);
if (parser->m_errorCode != XML_ERROR_NONE) {
parser->m_eventEndPtr = parser->m_eventPtr;
@@ -1839,23 +2094,25 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) {
&parser->m_position);
nLeftOver = s + len - end;
if (nLeftOver) {
- if (parser->m_buffer == NULL
- || nLeftOver > parser->m_bufferLim - parser->m_buffer) {
- /* avoid _signed_ integer overflow */
- char *temp = NULL;
- const int bytesToAllocate = (int)((unsigned)len * 2U);
- if (bytesToAllocate > 0) {
- temp = (char *)REALLOC(parser, parser->m_buffer, bytesToAllocate);
- }
- if (temp == NULL) {
- parser->m_errorCode = XML_ERROR_NO_MEMORY;
- parser->m_eventPtr = parser->m_eventEndPtr = NULL;
- parser->m_processor = errorProcessor;
- return XML_STATUS_ERROR;
- }
- parser->m_buffer = temp;
- parser->m_bufferLim = parser->m_buffer + bytesToAllocate;
+ // Back up and restore the parsing status to avoid XML_ERROR_SUSPENDED
+ // (and XML_ERROR_FINISHED) from XML_GetBuffer.
+ const enum XML_Parsing originalStatus = parser->m_parsingStatus.parsing;
+ parser->m_parsingStatus.parsing = XML_PARSING;
+ void *const temp = XML_GetBuffer(parser, nLeftOver);
+ parser->m_parsingStatus.parsing = originalStatus;
+ // GetBuffer may have overwritten this, but we want to remember what the
+ // app requested, not how many bytes were left over after parsing.
+ parser->m_lastBufferRequestSize = len;
+ if (temp == NULL) {
+ // NOTE: parser->m_errorCode has already been set by XML_GetBuffer().
+ parser->m_eventPtr = parser->m_eventEndPtr = NULL;
+ parser->m_processor = errorProcessor;
+ return XML_STATUS_ERROR;
}
+ // Since we know that the buffer was empty and XML_CONTEXT_BYTES is 0, we
+ // don't have any data to preserve, and can copy straight into the start
+ // of the buffer rather than the GetBuffer return pointer (which may be
+ // pointing further into the allocated buffer).
memcpy(parser->m_buffer, end, nLeftOver);
}
parser->m_bufferPtr = parser->m_buffer;
@@ -1866,16 +2123,15 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) {
parser->m_eventEndPtr = parser->m_bufferPtr;
return result;
}
-#endif /* not defined XML_CONTEXT_BYTES */
- else {
- void *buff = XML_GetBuffer(parser, len);
- if (buff == NULL)
- return XML_STATUS_ERROR;
- else {
- memcpy(buff, s, len);
- return XML_ParseBuffer(parser, len, isFinal);
- }
+#endif /* XML_CONTEXT_BYTES == 0 */
+ void *buff = XML_GetBuffer(parser, len);
+ if (buff == NULL)
+ return XML_STATUS_ERROR;
+ if (len > 0) {
+ assert(s != NULL); // make sure s==NULL && len!=0 was rejected above
+ memcpy(buff, s, len);
}
+ return XML_ParseBuffer(parser, len, isFinal);
}
enum XML_Status XMLCALL
@@ -1885,6 +2141,12 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) {
if (parser == NULL)
return XML_STATUS_ERROR;
+
+ if (len < 0) {
+ parser->m_errorCode = XML_ERROR_INVALID_ARGUMENT;
+ return XML_STATUS_ERROR;
+ }
+
switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
parser->m_errorCode = XML_ERROR_SUSPENDED;
@@ -1893,6 +2155,12 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) {
parser->m_errorCode = XML_ERROR_FINISHED;
return XML_STATUS_ERROR;
case XML_INITIALIZED:
+ /* Has someone called XML_GetBuffer successfully before? */
+ if (! parser->m_bufferPtr) {
+ parser->m_errorCode = XML_ERROR_NO_BUFFER;
+ return XML_STATUS_ERROR;
+ }
+
if (parser->m_parentParser == NULL && ! startParsing(parser)) {
parser->m_errorCode = XML_ERROR_NO_MEMORY;
return XML_STATUS_ERROR;
@@ -1909,8 +2177,8 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) {
parser->m_parseEndByteIndex += len;
parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
- parser->m_errorCode = parser->m_processor(
- parser, start, parser->m_parseEndPtr, &parser->m_bufferPtr);
+ parser->m_errorCode = callProcessor(parser, start, parser->m_parseEndPtr,
+ &parser->m_bufferPtr);
if (parser->m_errorCode != XML_ERROR_NONE) {
parser->m_eventEndPtr = parser->m_eventPtr;
@@ -1955,10 +2223,14 @@ XML_GetBuffer(XML_Parser parser, int len) {
default:;
}
- if (len > EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferEnd)) {
-#ifdef XML_CONTEXT_BYTES
+ // whether or not the request succeeds, `len` seems to be the app's preferred
+ // buffer fill size; remember it.
+ parser->m_lastBufferRequestSize = len;
+ if (len > EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferEnd)
+ || parser->m_buffer == NULL) {
+#if XML_CONTEXT_BYTES > 0
int keep;
-#endif /* defined XML_CONTEXT_BYTES */
+#endif /* XML_CONTEXT_BYTES > 0 */
/* Do not invoke signed arithmetic overflow: */
int neededSize = (int)((unsigned)len
+ (unsigned)EXPAT_SAFE_PTR_DIFF(
@@ -1967,15 +2239,21 @@ XML_GetBuffer(XML_Parser parser, int len) {
parser->m_errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
-#ifdef XML_CONTEXT_BYTES
+#if XML_CONTEXT_BYTES > 0
keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer);
if (keep > XML_CONTEXT_BYTES)
keep = XML_CONTEXT_BYTES;
+ /* Detect and prevent integer overflow */
+ if (keep > INT_MAX - neededSize) {
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
+ return NULL;
+ }
neededSize += keep;
-#endif /* defined XML_CONTEXT_BYTES */
- if (neededSize
- <= EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_buffer)) {
-#ifdef XML_CONTEXT_BYTES
+#endif /* XML_CONTEXT_BYTES > 0 */
+ if (parser->m_buffer && parser->m_bufferPtr
+ && neededSize
+ <= EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_buffer)) {
+#if XML_CONTEXT_BYTES > 0
if (keep < EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer)) {
int offset
= (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer)
@@ -1988,19 +2266,17 @@ XML_GetBuffer(XML_Parser parser, int len) {
parser->m_bufferPtr -= offset;
}
#else
- if (parser->m_buffer && parser->m_bufferPtr) {
- memmove(parser->m_buffer, parser->m_bufferPtr,
- EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr));
- parser->m_bufferEnd
- = parser->m_buffer
- + EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr);
- parser->m_bufferPtr = parser->m_buffer;
- }
-#endif /* not defined XML_CONTEXT_BYTES */
+ memmove(parser->m_buffer, parser->m_bufferPtr,
+ EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr));
+ parser->m_bufferEnd
+ = parser->m_buffer
+ + EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr);
+ parser->m_bufferPtr = parser->m_buffer;
+#endif /* XML_CONTEXT_BYTES > 0 */
} else {
char *newBuf;
int bufferSize
- = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferPtr);
+ = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_buffer);
if (bufferSize == 0)
bufferSize = INIT_BUFFER_SIZE;
do {
@@ -2017,7 +2293,7 @@ XML_GetBuffer(XML_Parser parser, int len) {
return NULL;
}
parser->m_bufferLim = newBuf + bufferSize;
-#ifdef XML_CONTEXT_BYTES
+#if XML_CONTEXT_BYTES > 0
if (parser->m_bufferPtr) {
memcpy(newBuf, &parser->m_bufferPtr[-keep],
EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr)
@@ -2047,7 +2323,7 @@ XML_GetBuffer(XML_Parser parser, int len) {
parser->m_bufferEnd = newBuf;
}
parser->m_bufferPtr = parser->m_buffer = newBuf;
-#endif /* not defined XML_CONTEXT_BYTES */
+#endif /* XML_CONTEXT_BYTES > 0 */
}
parser->m_eventPtr = parser->m_eventEndPtr = NULL;
parser->m_positionPtr = NULL;
@@ -2055,11 +2331,19 @@ XML_GetBuffer(XML_Parser parser, int len) {
return parser->m_bufferEnd;
}
+static void
+triggerReenter(XML_Parser parser) {
+ parser->m_reenter = XML_TRUE;
+}
+
enum XML_Status XMLCALL
XML_StopParser(XML_Parser parser, XML_Bool resumable) {
if (parser == NULL)
return XML_STATUS_ERROR;
switch (parser->m_parsingStatus.parsing) {
+ case XML_INITIALIZED:
+ parser->m_errorCode = XML_ERROR_NOT_STARTED;
+ return XML_STATUS_ERROR;
case XML_SUSPENDED:
if (resumable) {
parser->m_errorCode = XML_ERROR_SUSPENDED;
@@ -2070,7 +2354,7 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable) {
case XML_FINISHED:
parser->m_errorCode = XML_ERROR_FINISHED;
return XML_STATUS_ERROR;
- default:
+ case XML_PARSING:
if (resumable) {
#ifdef XML_DTD
if (parser->m_isParamEntity) {
@@ -2081,6 +2365,9 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable) {
parser->m_parsingStatus.parsing = XML_SUSPENDED;
} else
parser->m_parsingStatus.parsing = XML_FINISHED;
+ break;
+ default:
+ assert(0);
}
return XML_STATUS_OK;
}
@@ -2097,7 +2384,7 @@ XML_ResumeParser(XML_Parser parser) {
}
parser->m_parsingStatus.parsing = XML_PARSING;
- parser->m_errorCode = parser->m_processor(
+ parser->m_errorCode = callProcessor(
parser, parser->m_bufferPtr, parser->m_parseEndPtr, &parser->m_bufferPtr);
if (parser->m_errorCode != XML_ERROR_NONE) {
@@ -2161,7 +2448,7 @@ XML_GetCurrentByteCount(XML_Parser parser) {
const char *XMLCALL
XML_GetInputContext(XML_Parser parser, int *offset, int *size) {
-#ifdef XML_CONTEXT_BYTES
+#if XML_CONTEXT_BYTES > 0
if (parser == NULL)
return NULL;
if (parser->m_eventPtr && parser->m_buffer) {
@@ -2175,7 +2462,7 @@ XML_GetInputContext(XML_Parser parser, int *offset, int *size) {
(void)parser;
(void)offset;
(void)size;
-#endif /* defined XML_CONTEXT_BYTES */
+#endif /* XML_CONTEXT_BYTES > 0 */
return (const char *)0;
}
@@ -2337,6 +2624,17 @@ XML_ErrorString(enum XML_Error code) {
/* Added in 2.2.5. */
case XML_ERROR_INVALID_ARGUMENT: /* Constant added in 2.2.1, already */
return XML_L("invalid argument");
+ /* Added in 2.3.0. */
+ case XML_ERROR_NO_BUFFER:
+ return XML_L(
+ "a successful prior call to function XML_GetBuffer is required");
+ /* Added in 2.4.0. */
+ case XML_ERROR_AMPLIFICATION_LIMIT_BREACH:
+ return XML_L(
+ "limit on input amplification factor (from DTD and entities) breached");
+ /* Added in 2.6.4. */
+ case XML_ERROR_NOT_STARTED:
+ return XML_L("parser not started");
}
return NULL;
}
@@ -2373,41 +2671,87 @@ XML_ExpatVersionInfo(void) {
const XML_Feature *XMLCALL
XML_GetFeatureList(void) {
- static const XML_Feature features[]
- = {{XML_FEATURE_SIZEOF_XML_CHAR, XML_L("sizeof(XML_Char)"),
- sizeof(XML_Char)},
- {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)"),
- sizeof(XML_LChar)},
+ static const XML_Feature features[] = {
+ {XML_FEATURE_SIZEOF_XML_CHAR, XML_L("sizeof(XML_Char)"),
+ sizeof(XML_Char)},
+ {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)"),
+ sizeof(XML_LChar)},
#ifdef XML_UNICODE
- {XML_FEATURE_UNICODE, XML_L("XML_UNICODE"), 0},
+ {XML_FEATURE_UNICODE, XML_L("XML_UNICODE"), 0},
#endif
#ifdef XML_UNICODE_WCHAR_T
- {XML_FEATURE_UNICODE_WCHAR_T, XML_L("XML_UNICODE_WCHAR_T"), 0},
+ {XML_FEATURE_UNICODE_WCHAR_T, XML_L("XML_UNICODE_WCHAR_T"), 0},
#endif
#ifdef XML_DTD
- {XML_FEATURE_DTD, XML_L("XML_DTD"), 0},
+ {XML_FEATURE_DTD, XML_L("XML_DTD"), 0},
#endif
-#ifdef XML_CONTEXT_BYTES
- {XML_FEATURE_CONTEXT_BYTES, XML_L("XML_CONTEXT_BYTES"),
- XML_CONTEXT_BYTES},
+#if XML_CONTEXT_BYTES > 0
+ {XML_FEATURE_CONTEXT_BYTES, XML_L("XML_CONTEXT_BYTES"),
+ XML_CONTEXT_BYTES},
#endif
#ifdef XML_MIN_SIZE
- {XML_FEATURE_MIN_SIZE, XML_L("XML_MIN_SIZE"), 0},
+ {XML_FEATURE_MIN_SIZE, XML_L("XML_MIN_SIZE"), 0},
#endif
#ifdef XML_NS
- {XML_FEATURE_NS, XML_L("XML_NS"), 0},
+ {XML_FEATURE_NS, XML_L("XML_NS"), 0},
#endif
#ifdef XML_LARGE_SIZE
- {XML_FEATURE_LARGE_SIZE, XML_L("XML_LARGE_SIZE"), 0},
+ {XML_FEATURE_LARGE_SIZE, XML_L("XML_LARGE_SIZE"), 0},
#endif
#ifdef XML_ATTR_INFO
- {XML_FEATURE_ATTR_INFO, XML_L("XML_ATTR_INFO"), 0},
+ {XML_FEATURE_ATTR_INFO, XML_L("XML_ATTR_INFO"), 0},
+#endif
+#if XML_GE == 1
+ /* Added in Expat 2.4.0 for XML_DTD defined and
+ * added in Expat 2.6.0 for XML_GE == 1. */
+ {XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
+ XML_L("XML_BLAP_MAX_AMP"),
+ (long int)
+ EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT},
+ {XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT,
+ XML_L("XML_BLAP_ACT_THRES"),
+ EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT},
+ /* Added in Expat 2.6.0. */
+ {XML_FEATURE_GE, XML_L("XML_GE"), 0},
#endif
- {XML_FEATURE_END, NULL, 0}};
+ {XML_FEATURE_END, NULL, 0}};
return features;
}
+#if XML_GE == 1
+XML_Bool XMLCALL
+XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ XML_Parser parser, float maximumAmplificationFactor) {
+ if ((parser == NULL) || (parser->m_parentParser != NULL)
+ || isnan(maximumAmplificationFactor)
+ || (maximumAmplificationFactor < 1.0f)) {
+ return XML_FALSE;
+ }
+ parser->m_accounting.maximumAmplificationFactor = maximumAmplificationFactor;
+ return XML_TRUE;
+}
+
+XML_Bool XMLCALL
+XML_SetBillionLaughsAttackProtectionActivationThreshold(
+ XML_Parser parser, unsigned long long activationThresholdBytes) {
+ if ((parser == NULL) || (parser->m_parentParser != NULL)) {
+ return XML_FALSE;
+ }
+ parser->m_accounting.activationThresholdBytes = activationThresholdBytes;
+ return XML_TRUE;
+}
+#endif /* XML_GE == 1 */
+
+XML_Bool XMLCALL
+XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled) {
+ if (parser != NULL && (enabled == XML_TRUE || enabled == XML_FALSE)) {
+ parser->m_reparseDeferralEnabled = enabled;
+ return XML_TRUE;
+ }
+ return XML_FALSE;
+}
+
/* Initially tag->rawName always points into the parse buffer;
for those TAG instances opened while the current parse buffer was
processed, and not yet closed, we need to store tag->rawName in a more
@@ -2419,6 +2763,7 @@ storeRawNames(XML_Parser parser) {
while (tag) {
int bufSize;
int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1);
+ size_t rawNameLen;
char *rawNameBuf = tag->buf + nameLen;
/* Stop if already stored. Since m_tagStack is a stack, we can stop
at the first entry that has already been copied; everything
@@ -2427,10 +2772,14 @@ storeRawNames(XML_Parser parser) {
*/
if (tag->rawName == rawNameBuf)
break;
- /* For re-use purposes we need to ensure that the
+ /* For reuse purposes we need to ensure that the
size of tag->buf is a multiple of sizeof(XML_Char).
*/
- bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char));
+ rawNameLen = ROUND_UP(tag->rawNameLength, sizeof(XML_Char));
+ /* Detect and prevent integer overflow. */
+ if (rawNameLen > (size_t)INT_MAX - nameLen)
+ return XML_FALSE;
+ bufSize = nameLen + (int)rawNameLen;
if (bufSize > tag->bufEnd - tag->buf) {
char *temp = (char *)REALLOC(parser, tag->buf, bufSize);
if (temp == NULL)
@@ -2460,9 +2809,10 @@ storeRawNames(XML_Parser parser) {
static enum XML_Error PTRCALL
contentProcessor(XML_Parser parser, const char *start, const char *end,
const char **endPtr) {
- enum XML_Error result
- = doContent(parser, 0, parser->m_encoding, start, end, endPtr,
- (XML_Bool)! parser->m_parsingStatus.finalBuffer);
+ enum XML_Error result = doContent(
+ parser, parser->m_parentParser ? 1 : 0, parser->m_encoding, start, end,
+ endPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer,
+ XML_ACCOUNT_DIRECT);
if (result == XML_ERROR_NONE) {
if (! storeRawNames(parser))
return XML_ERROR_NO_MEMORY;
@@ -2487,6 +2837,14 @@ externalEntityInitProcessor2(XML_Parser parser, const char *start,
int tok = XmlContentTok(parser->m_encoding, start, end, &next);
switch (tok) {
case XML_TOK_BOM:
+#if XML_GE == 1
+ if (! accountingDiffTolerated(parser, tok, start, next, __LINE__,
+ XML_ACCOUNT_DIRECT)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+#endif /* XML_GE == 1 */
+
/* If we are at the end of the buffer, this would cause the next stage,
i.e. externalEntityInitProcessor3, to pass control directly to
doContent (by detecting XML_TOK_NONE) without processing any xml text
@@ -2524,6 +2882,10 @@ externalEntityInitProcessor3(XML_Parser parser, const char *start,
const char *next = start; /* XmlContentTok doesn't always set the last arg */
parser->m_eventPtr = start;
tok = XmlContentTok(parser->m_encoding, start, end, &next);
+ /* Note: These bytes are accounted later in:
+ - processXmlDecl
+ - externalEntityContentProcessor
+ */
parser->m_eventEndPtr = next;
switch (tok) {
@@ -2538,6 +2900,11 @@ externalEntityInitProcessor3(XML_Parser parser, const char *start,
return XML_ERROR_NONE;
case XML_FINISHED:
return XML_ERROR_ABORTED;
+ case XML_PARSING:
+ if (parser->m_reenter) {
+ return XML_ERROR_UNEXPECTED_STATE; // LCOV_EXCL_LINE
+ }
+ /* Fall through */
default:
start = next;
}
@@ -2565,7 +2932,8 @@ externalEntityContentProcessor(XML_Parser parser, const char *start,
const char *end, const char **endPtr) {
enum XML_Error result
= doContent(parser, 1, parser->m_encoding, start, end, endPtr,
- (XML_Bool)! parser->m_parsingStatus.finalBuffer);
+ (XML_Bool)! parser->m_parsingStatus.finalBuffer,
+ XML_ACCOUNT_ENTITY_EXPANSION);
if (result == XML_ERROR_NONE) {
if (! storeRawNames(parser))
return XML_ERROR_NO_MEMORY;
@@ -2576,7 +2944,7 @@ externalEntityContentProcessor(XML_Parser parser, const char *start,
static enum XML_Error
doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
const char *s, const char *end, const char **nextPtr,
- XML_Bool haveMore) {
+ XML_Bool haveMore, enum XML_Account account) {
/* save one level of indirection */
DTD *const dtd = parser->m_dtd;
@@ -2594,6 +2962,17 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
for (;;) {
const char *next = s; /* XmlContentTok doesn't always set the last arg */
int tok = XmlContentTok(enc, s, end, &next);
+#if XML_GE == 1
+ const char *accountAfter
+ = ((tok == XML_TOK_TRAILING_RSQB) || (tok == XML_TOK_TRAILING_CR))
+ ? (haveMore ? s /* i.e. 0 bytes */ : end)
+ : next;
+ if (! accountingDiffTolerated(parser, tok, s, accountAfter, __LINE__,
+ account)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+#endif
*eventEndPP = next;
switch (tok) {
case XML_TOK_TRAILING_CR:
@@ -2649,6 +3028,14 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
XML_Char ch = (XML_Char)XmlPredefinedEntityName(
enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar);
if (ch) {
+#if XML_GE == 1
+ /* NOTE: We are replacing 4-6 characters original input for 1 character
+ * so there is no amplification and hence recording without
+ * protection. */
+ accountingDiffTolerated(parser, tok, (char *)&ch,
+ ((char *)&ch) + sizeof(XML_Char), __LINE__,
+ XML_ACCOUNT_ENTITY_EXPANSION);
+#endif /* XML_GE == 1 */
if (parser->m_characterDataHandler)
parser->m_characterDataHandler(parser->m_handlerArg, &ch, 1);
else if (parser->m_defaultHandler)
@@ -2691,7 +3078,7 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
reportDefault(parser, enc, s, next);
break;
}
- result = processInternalEntity(parser, entity, XML_FALSE);
+ result = processEntity(parser, entity, XML_FALSE, ENTITY_INTERNAL);
if (result != XML_ERROR_NONE)
return result;
} else if (parser->m_externalEntityRefHandler) {
@@ -2767,7 +3154,8 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
}
tag->name.str = (XML_Char *)tag->buf;
*toPtr = XML_T('\0');
- result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings));
+ result
+ = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings), account);
if (result)
return result;
if (parser->m_startElementHandler)
@@ -2791,7 +3179,8 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
if (! name.str)
return XML_ERROR_NO_MEMORY;
poolFinish(&parser->m_tempPool);
- result = storeAtts(parser, enc, s, &name, &bindings);
+ result = storeAtts(parser, enc, s, &name, &bindings,
+ XML_ACCOUNT_NONE /* token spans whole start tag */);
if (result != XML_ERROR_NONE) {
freeBindings(parser, bindings);
return result;
@@ -2815,7 +3204,9 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
}
if ((parser->m_tagLevel == 0)
&& (parser->m_parsingStatus.parsing != XML_FINISHED)) {
- if (parser->m_parsingStatus.parsing == XML_SUSPENDED)
+ if (parser->m_parsingStatus.parsing == XML_SUSPENDED
+ || (parser->m_parsingStatus.parsing == XML_PARSING
+ && parser->m_reenter))
parser->m_processor = epilogProcessor;
else
return epilogProcessor(parser, next, end, nextPtr);
@@ -2828,9 +3219,6 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
int len;
const char *rawName;
TAG *tag = parser->m_tagStack;
- parser->m_tagStack = tag->parent;
- tag->parent = parser->m_freeTagList;
- parser->m_freeTagList = tag;
rawName = s + enc->minBytesPerChar * 2;
len = XmlNameLength(enc, rawName);
if (len != tag->rawNameLength
@@ -2838,6 +3226,9 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
*eventPP = rawName;
return XML_ERROR_TAG_MISMATCH;
}
+ parser->m_tagStack = tag->parent;
+ tag->parent = parser->m_freeTagList;
+ parser->m_freeTagList = tag;
--parser->m_tagLevel;
if (parser->m_endElementHandler) {
const XML_Char *localPart;
@@ -2847,13 +3238,13 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
if (parser->m_ns && localPart) {
/* localPart and prefix may have been overwritten in
tag->name.str, since this points to the binding->uri
- buffer which gets re-used; so we have to add them again
+ buffer which gets reused; so we have to add them again
*/
uri = (XML_Char *)tag->name.str + tag->name.uriLen;
/* don't need to check for space - already done in storeAtts() */
while (*localPart)
*uri++ = *localPart++;
- prefix = (XML_Char *)tag->name.prefix;
+ prefix = tag->name.prefix;
if (parser->m_ns_triplets && prefix) {
*uri++ = parser->m_namespaceSeparator;
while (*prefix)
@@ -2876,7 +3267,9 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
}
if ((parser->m_tagLevel == 0)
&& (parser->m_parsingStatus.parsing != XML_FINISHED)) {
- if (parser->m_parsingStatus.parsing == XML_SUSPENDED)
+ if (parser->m_parsingStatus.parsing == XML_SUSPENDED
+ || (parser->m_parsingStatus.parsing == XML_PARSING
+ && parser->m_reenter))
parser->m_processor = epilogProcessor;
else
return epilogProcessor(parser, next, end, nextPtr);
@@ -2920,13 +3313,14 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
However, now we have a start/endCdataSectionHandler, so it seems
easier to let the user deal with this.
*/
- else if (0 && parser->m_characterDataHandler)
+ else if ((0) && parser->m_characterDataHandler)
parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
0);
/* END disabled code */
else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
- result = doCdataSection(parser, enc, &next, end, nextPtr, haveMore);
+ result
+ = doCdataSection(parser, enc, &next, end, nextPtr, haveMore, account);
if (result != XML_ERROR_NONE)
return result;
else if (! next) {
@@ -2948,8 +3342,8 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
(int)(dataPtr - (ICHAR *)parser->m_dataBuf));
} else
parser->m_characterDataHandler(
- parser->m_handlerArg, (XML_Char *)s,
- (int)((XML_Char *)end - (XML_Char *)s));
+ parser->m_handlerArg, (const XML_Char *)s,
+ (int)((const XML_Char *)end - (const XML_Char *)s));
} else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, end);
/* We are at the end of the final buffer, should we check for
@@ -2982,8 +3376,8 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
*eventPP = s;
}
} else
- charDataHandler(parser->m_handlerArg, (XML_Char *)s,
- (int)((XML_Char *)next - (XML_Char *)s));
+ charDataHandler(parser->m_handlerArg, (const XML_Char *)s,
+ (int)((const XML_Char *)next - (const XML_Char *)s));
} else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
} break;
@@ -3008,14 +3402,22 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
break;
/* LCOV_EXCL_STOP */
}
- *eventPP = s = next;
switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
+ *eventPP = next;
*nextPtr = next;
return XML_ERROR_NONE;
case XML_FINISHED:
+ *eventPP = next;
return XML_ERROR_ABORTED;
+ case XML_PARSING:
+ if (parser->m_reenter) {
+ *nextPtr = next;
+ return XML_ERROR_NONE;
+ }
+ /* Fall through */
default:;
+ *eventPP = s = next;
}
}
/* not reached */
@@ -3055,7 +3457,8 @@ freeBindings(XML_Parser parser, BINDING *bindings) {
*/
static enum XML_Error
storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
- TAG_NAME *tagNamePtr, BINDING **bindingsPtr) {
+ TAG_NAME *tagNamePtr, BINDING **bindingsPtr,
+ enum XML_Account account) {
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
ELEMENT_TYPE *elementType;
int nDefaultAtts;
@@ -3087,13 +3490,38 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
/* get the attributes from the tokenizer */
n = XmlGetAttributes(enc, attStr, parser->m_attsSize, parser->m_atts);
+
+ /* Detect and prevent integer overflow */
+ if (n > INT_MAX - nDefaultAtts) {
+ return XML_ERROR_NO_MEMORY;
+ }
+
if (n + nDefaultAtts > parser->m_attsSize) {
int oldAttsSize = parser->m_attsSize;
ATTRIBUTE *temp;
#ifdef XML_ATTR_INFO
XML_AttrInfo *temp2;
#endif
+
+ /* Detect and prevent integer overflow */
+ if ((nDefaultAtts > INT_MAX - INIT_ATTS_SIZE)
+ || (n > INT_MAX - (nDefaultAtts + INIT_ATTS_SIZE))) {
+ return XML_ERROR_NO_MEMORY;
+ }
+
parser->m_attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
+
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if ((unsigned)parser->m_attsSize > (size_t)(-1) / sizeof(ATTRIBUTE)) {
+ parser->m_attsSize = oldAttsSize;
+ return XML_ERROR_NO_MEMORY;
+ }
+#endif
+
temp = (ATTRIBUTE *)REALLOC(parser, (void *)parser->m_atts,
parser->m_attsSize * sizeof(ATTRIBUTE));
if (temp == NULL) {
@@ -3102,6 +3530,17 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
}
parser->m_atts = temp;
#ifdef XML_ATTR_INFO
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+# if UINT_MAX >= SIZE_MAX
+ if ((unsigned)parser->m_attsSize > (size_t)(-1) / sizeof(XML_AttrInfo)) {
+ parser->m_attsSize = oldAttsSize;
+ return XML_ERROR_NO_MEMORY;
+ }
+# endif
+
temp2 = (XML_AttrInfo *)REALLOC(parser, (void *)parser->m_attInfo,
parser->m_attsSize * sizeof(XML_AttrInfo));
if (temp2 == NULL) {
@@ -3165,7 +3604,7 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
/* normalize the attribute value */
result = storeAttributeValue(
parser, enc, isCdata, parser->m_atts[i].valuePtr,
- parser->m_atts[i].valueEnd, &parser->m_tempPool);
+ parser->m_atts[i].valueEnd, &parser->m_tempPool, account);
if (result)
return result;
appAtts[attIndex] = poolStart(&parser->m_tempPool);
@@ -3240,7 +3679,13 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
if (nPrefixes) {
int j; /* hash table index */
unsigned long version = parser->m_nsAttsVersion;
- int nsAttsSize = (int)1 << parser->m_nsAttsPower;
+
+ /* Detect and prevent invalid shift */
+ if (parser->m_nsAttsPower >= sizeof(unsigned int) * 8 /* bits per byte */) {
+ return XML_ERROR_NO_MEMORY;
+ }
+
+ unsigned int nsAttsSize = 1u << parser->m_nsAttsPower;
unsigned char oldNsAttsPower = parser->m_nsAttsPower;
/* size of hash table must be at least 2 * (# of prefixed attributes) */
if ((nPrefixes << 1)
@@ -3251,7 +3696,28 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
;
if (parser->m_nsAttsPower < 3)
parser->m_nsAttsPower = 3;
- nsAttsSize = (int)1 << parser->m_nsAttsPower;
+
+ /* Detect and prevent invalid shift */
+ if (parser->m_nsAttsPower >= sizeof(nsAttsSize) * 8 /* bits per byte */) {
+ /* Restore actual size of memory in m_nsAtts */
+ parser->m_nsAttsPower = oldNsAttsPower;
+ return XML_ERROR_NO_MEMORY;
+ }
+
+ nsAttsSize = 1u << parser->m_nsAttsPower;
+
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if (nsAttsSize > (size_t)(-1) / sizeof(NS_ATT)) {
+ /* Restore actual size of memory in m_nsAtts */
+ parser->m_nsAttsPower = oldNsAttsPower;
+ return XML_ERROR_NO_MEMORY;
+ }
+#endif
+
temp = (NS_ATT *)REALLOC(parser, parser->m_nsAtts,
nsAttsSize * sizeof(NS_ATT));
if (! temp) {
@@ -3409,9 +3875,31 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
tagNamePtr->prefixLen = prefixLen;
for (i = 0; localPart[i++];)
; /* i includes null terminator */
+
+ /* Detect and prevent integer overflow */
+ if (binding->uriLen > INT_MAX - prefixLen
+ || i > INT_MAX - (binding->uriLen + prefixLen)) {
+ return XML_ERROR_NO_MEMORY;
+ }
+
n = i + binding->uriLen + prefixLen;
if (n > binding->uriAlloc) {
TAG *p;
+
+ /* Detect and prevent integer overflow */
+ if (n > INT_MAX - EXPAND_SPARE) {
+ return XML_ERROR_NO_MEMORY;
+ }
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if ((unsigned)(n + EXPAND_SPARE) > (size_t)(-1) / sizeof(XML_Char)) {
+ return XML_ERROR_NO_MEMORY;
+ }
+#endif
+
uri = (XML_Char *)MALLOC(parser, (n + EXPAND_SPARE) * sizeof(XML_Char));
if (! uri)
return XML_ERROR_NO_MEMORY;
@@ -3436,12 +3924,124 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
return XML_ERROR_NONE;
}
+static XML_Bool
+is_rfc3986_uri_char(XML_Char candidate) {
+ // For the RFC 3986 ANBF grammar see
+ // https://datatracker.ietf.org/doc/html/rfc3986#appendix-A
+
+ switch (candidate) {
+ // From rule "ALPHA" (uppercase half)
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+
+ // From rule "ALPHA" (lowercase half)
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z':
+
+ // From rule "DIGIT"
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+
+ // From rule "pct-encoded"
+ case '%':
+
+ // From rule "unreserved"
+ case '-':
+ case '.':
+ case '_':
+ case '~':
+
+ // From rule "gen-delims"
+ case ':':
+ case '/':
+ case '?':
+ case '#':
+ case '[':
+ case ']':
+ case '@':
+
+ // From rule "sub-delims"
+ case '!':
+ case '$':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case ';':
+ case '=':
+ return XML_TRUE;
+
+ default:
+ return XML_FALSE;
+ }
+}
+
/* addBinding() overwrites the value of prefix->binding without checking.
Therefore one must keep track of the old value outside of addBinding().
*/
static enum XML_Error
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
const XML_Char *uri, BINDING **bindingsPtr) {
+ // "http://www.w3.org/XML/1998/namespace"
static const XML_Char xmlNamespace[]
= {ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON,
ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
@@ -3452,6 +4052,7 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
ASCII_e, ASCII_s, ASCII_p, ASCII_a, ASCII_c,
ASCII_e, '\0'};
static const int xmlLen = (int)sizeof(xmlNamespace) / sizeof(XML_Char) - 1;
+ // "http://www.w3.org/2000/xmlns/"
static const XML_Char xmlnsNamespace[]
= {ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH,
ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w,
@@ -3491,6 +4092,29 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
if (! mustBeXML && isXMLNS
&& (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
isXMLNS = XML_FALSE;
+
+ // NOTE: While Expat does not validate namespace URIs against RFC 3986
+ // today (and is not REQUIRED to do so with regard to the XML 1.0
+ // namespaces specification) we have to at least make sure, that
+ // the application on top of Expat (that is likely splitting expanded
+ // element names ("qualified names") of form
+ // "[uri sep] local [sep prefix] '\0'" back into 1, 2 or 3 pieces
+ // in its element handler code) cannot be confused by an attacker
+ // putting additional namespace separator characters into namespace
+ // declarations. That would be ambiguous and not to be expected.
+ //
+ // While the HTML API docs of function XML_ParserCreateNS have been
+ // advising against use of a namespace separator character that can
+ // appear in a URI for >20 years now, some widespread applications
+ // are using URI characters (':' (colon) in particular) for a
+ // namespace separator, in practice. To keep these applications
+ // functional, we only reject namespaces URIs containing the
+ // application-chosen namespace separator if the chosen separator
+ // is a non-URI character with regard to RFC 3986.
+ if (parser->m_ns && (uri[len] == parser->m_namespaceSeparator)
+ && ! is_rfc3986_uri_char(uri[len])) {
+ return XML_ERROR_SYNTAX;
+ }
}
isXML = isXML && len == xmlLen;
isXMLNS = isXMLNS && len == xmlnsLen;
@@ -3507,6 +4131,21 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
if (parser->m_freeBindingList) {
b = parser->m_freeBindingList;
if (len > b->uriAlloc) {
+ /* Detect and prevent integer overflow */
+ if (len > INT_MAX - EXPAND_SPARE) {
+ return XML_ERROR_NO_MEMORY;
+ }
+
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if ((unsigned)(len + EXPAND_SPARE) > (size_t)(-1) / sizeof(XML_Char)) {
+ return XML_ERROR_NO_MEMORY;
+ }
+#endif
+
XML_Char *temp = (XML_Char *)REALLOC(
parser, b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE));
if (temp == NULL)
@@ -3519,6 +4158,21 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
b = (BINDING *)MALLOC(parser, sizeof(BINDING));
if (! b)
return XML_ERROR_NO_MEMORY;
+
+ /* Detect and prevent integer overflow */
+ if (len > INT_MAX - EXPAND_SPARE) {
+ return XML_ERROR_NO_MEMORY;
+ }
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if ((unsigned)(len + EXPAND_SPARE) > (size_t)(-1) / sizeof(XML_Char)) {
+ return XML_ERROR_NO_MEMORY;
+ }
+#endif
+
b->uri
= (XML_Char *)MALLOC(parser, sizeof(XML_Char) * (len + EXPAND_SPARE));
if (! b->uri) {
@@ -3554,9 +4208,9 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
static enum XML_Error PTRCALL
cdataSectionProcessor(XML_Parser parser, const char *start, const char *end,
const char **endPtr) {
- enum XML_Error result
- = doCdataSection(parser, parser->m_encoding, &start, end, endPtr,
- (XML_Bool)! parser->m_parsingStatus.finalBuffer);
+ enum XML_Error result = doCdataSection(
+ parser, parser->m_encoding, &start, end, endPtr,
+ (XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_ACCOUNT_DIRECT);
if (result != XML_ERROR_NONE)
return result;
if (start) {
@@ -3576,7 +4230,8 @@ cdataSectionProcessor(XML_Parser parser, const char *start, const char *end,
*/
static enum XML_Error
doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
- const char *end, const char **nextPtr, XML_Bool haveMore) {
+ const char *end, const char **nextPtr, XML_Bool haveMore,
+ enum XML_Account account) {
const char *s = *startPtr;
const char **eventPP;
const char **eventEndPP;
@@ -3594,6 +4249,14 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
for (;;) {
const char *next = s; /* in case of XML_TOK_NONE or XML_TOK_PARTIAL */
int tok = XmlCdataSectionTok(enc, s, end, &next);
+#if XML_GE == 1
+ if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, account)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+#else
+ UNUSED_P(account);
+#endif
*eventEndPP = next;
switch (tok) {
case XML_TOK_CDATA_SECT_CLOSE:
@@ -3601,7 +4264,7 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
parser->m_endCdataSectionHandler(parser->m_handlerArg);
/* BEGIN disabled code */
/* see comment under XML_TOK_CDATA_SECT_OPEN */
- else if (0 && parser->m_characterDataHandler)
+ else if ((0) && parser->m_characterDataHandler)
parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
0);
/* END disabled code */
@@ -3637,8 +4300,8 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
*eventPP = s;
}
} else
- charDataHandler(parser->m_handlerArg, (XML_Char *)s,
- (int)((XML_Char *)next - (XML_Char *)s));
+ charDataHandler(parser->m_handlerArg, (const XML_Char *)s,
+ (int)((const XML_Char *)next - (const XML_Char *)s));
} else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
} break;
@@ -3671,14 +4334,21 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
/* LCOV_EXCL_STOP */
}
- *eventPP = s = next;
switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
+ *eventPP = next;
*nextPtr = next;
return XML_ERROR_NONE;
case XML_FINISHED:
+ *eventPP = next;
return XML_ERROR_ABORTED;
+ case XML_PARSING:
+ if (parser->m_reenter) {
+ return XML_ERROR_UNEXPECTED_STATE; // LCOV_EXCL_LINE
+ }
+ /* Fall through */
default:;
+ *eventPP = s = next;
}
}
/* not reached */
@@ -3738,6 +4408,13 @@ doIgnoreSection(XML_Parser parser, const ENCODING *enc, const char **startPtr,
*eventPP = s;
*startPtr = NULL;
tok = XmlIgnoreSectionTok(enc, s, end, &next);
+# if XML_GE == 1
+ if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
+ XML_ACCOUNT_DIRECT)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+# endif
*eventEndPP = next;
switch (tok) {
case XML_TOK_IGNORE_SECT:
@@ -3787,7 +4464,7 @@ initializeEncoding(XML_Parser parser) {
const char *s;
#ifdef XML_UNICODE
char encodingBuf[128];
- /* See comments abount `protoclEncodingName` in parserInit() */
+ /* See comments about `protocolEncodingName` in parserInit() */
if (! parser->m_protocolEncodingName)
s = NULL;
else {
@@ -3819,9 +4496,18 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s,
const XML_Char *storedEncName = NULL;
const ENCODING *newEncoding = NULL;
const char *version = NULL;
- const char *versionend;
+ const char *versionend = NULL;
const XML_Char *storedversion = NULL;
int standalone = -1;
+
+#if XML_GE == 1
+ if (! accountingDiffTolerated(parser, XML_TOK_XML_DECL, s, next, __LINE__,
+ XML_ACCOUNT_DIRECT)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+#endif
+
if (! (parser->m_ns ? XmlParseXmlDeclNS : XmlParseXmlDecl)(
isGeneralTextEntity, parser->m_encoding, s, next, &parser->m_eventPtr,
&version, &versionend, &encodingName, &newEncoding, &standalone)) {
@@ -3971,6 +4657,10 @@ entityValueInitProcessor(XML_Parser parser, const char *s, const char *end,
for (;;) {
tok = XmlPrologTok(parser->m_encoding, start, end, &next);
+ /* Note: Except for XML_TOK_BOM below, these bytes are accounted later in:
+ - storeEntityValue
+ - processXmlDecl
+ */
parser->m_eventEndPtr = next;
if (tok <= 0) {
if (! parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) {
@@ -3989,7 +4679,8 @@ entityValueInitProcessor(XML_Parser parser, const char *s, const char *end,
break;
}
/* found end of entity value - can store it now */
- return storeEntityValue(parser, parser->m_encoding, s, end);
+ return storeEntityValue(parser, parser->m_encoding, s, end,
+ XML_ACCOUNT_DIRECT, NULL);
} else if (tok == XML_TOK_XML_DECL) {
enum XML_Error result;
result = processXmlDecl(parser, 0, start, next);
@@ -4007,17 +4698,25 @@ entityValueInitProcessor(XML_Parser parser, const char *s, const char *end,
parser->m_processor = entityValueProcessor;
return entityValueProcessor(parser, next, end, nextPtr);
}
- /* If we are at the end of the buffer, this would cause XmlPrologTok to
- return XML_TOK_NONE on the next call, which would then cause the
- function to exit with *nextPtr set to s - that is what we want for other
- tokens, but not for the BOM - we would rather like to skip it;
- then, when this routine is entered the next time, XmlPrologTok will
- return XML_TOK_INVALID, since the BOM is still in the buffer
+ /* XmlPrologTok has now set the encoding based on the BOM it found, and we
+ must move s and nextPtr forward to consume the BOM.
+
+ If we didn't, and got XML_TOK_NONE from the next XmlPrologTok call, we
+ would leave the BOM in the buffer and return. On the next call to this
+ function, our XmlPrologTok call would return XML_TOK_INVALID, since it
+ is not valid to have multiple BOMs.
*/
- else if (tok == XML_TOK_BOM && next == end
- && ! parser->m_parsingStatus.finalBuffer) {
+ else if (tok == XML_TOK_BOM) {
+# if XML_GE == 1
+ if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
+ XML_ACCOUNT_DIRECT)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+# endif
+
*nextPtr = next;
- return XML_ERROR_NONE;
+ s = next;
}
/* If we get this token, we have the start of what might be a
normal tag, but not a declaration (i.e. it doesn't begin with
@@ -4058,16 +4757,24 @@ externalParEntProcessor(XML_Parser parser, const char *s, const char *end,
}
/* This would cause the next stage, i.e. doProlog to be passed XML_TOK_BOM.
However, when parsing an external subset, doProlog will not accept a BOM
- as valid, and report a syntax error, so we have to skip the BOM
+ as valid, and report a syntax error, so we have to skip the BOM, and
+ account for the BOM bytes.
*/
else if (tok == XML_TOK_BOM) {
+ if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
+ XML_ACCOUNT_DIRECT)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+
s = next;
tok = XmlPrologTok(parser->m_encoding, s, end, &next);
}
parser->m_processor = prologProcessor;
return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr,
- (XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_TRUE);
+ (XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_TRUE,
+ XML_ACCOUNT_DIRECT);
}
static enum XML_Error PTRCALL
@@ -4080,6 +4787,9 @@ entityValueProcessor(XML_Parser parser, const char *s, const char *end,
for (;;) {
tok = XmlPrologTok(enc, start, end, &next);
+ /* Note: These bytes are accounted later in:
+ - storeEntityValue
+ */
if (tok <= 0) {
if (! parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) {
*nextPtr = s;
@@ -4097,7 +4807,7 @@ entityValueProcessor(XML_Parser parser, const char *s, const char *end,
break;
}
/* found end of entity value - can store it now */
- return storeEntityValue(parser, enc, s, end);
+ return storeEntityValue(parser, enc, s, end, XML_ACCOUNT_DIRECT, NULL);
}
start = next;
}
@@ -4111,13 +4821,14 @@ prologProcessor(XML_Parser parser, const char *s, const char *end,
const char *next = s;
int tok = XmlPrologTok(parser->m_encoding, s, end, &next);
return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr,
- (XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_TRUE);
+ (XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_TRUE,
+ XML_ACCOUNT_DIRECT);
}
static enum XML_Error
doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
int tok, const char *next, const char **nextPtr, XML_Bool haveMore,
- XML_Bool allowClosingDoctype) {
+ XML_Bool allowClosingDoctype, enum XML_Account account) {
#ifdef XML_DTD
static const XML_Char externalSubsetName[] = {ASCII_HASH, '\0'};
#endif /* XML_DTD */
@@ -4144,6 +4855,10 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
static const XML_Char enumValueSep[] = {ASCII_PIPE, '\0'};
static const XML_Char enumValueStart[] = {ASCII_LPAREN, '\0'};
+#ifndef XML_DTD
+ UNUSED_P(account);
+#endif
+
/* save one level of indirection */
DTD *const dtd = parser->m_dtd;
@@ -4208,6 +4923,21 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
}
}
role = XmlTokenRole(&parser->m_prologState, tok, s, next, enc);
+#if XML_GE == 1
+ switch (role) {
+ case XML_ROLE_INSTANCE_START: // bytes accounted in contentProcessor
+ case XML_ROLE_XML_DECL: // bytes accounted in processXmlDecl
+# ifdef XML_DTD
+ case XML_ROLE_TEXT_DECL: // bytes accounted in processXmlDecl
+# endif
+ break;
+ default:
+ if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, account)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+ }
+#endif
switch (role) {
case XML_ROLE_XML_DECL: {
enum XML_Error result = processXmlDecl(parser, 0, s, next);
@@ -4472,10 +5202,10 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
parser->m_handlerArg, parser->m_declElementType->name,
parser->m_declAttributeId->name, parser->m_declAttributeType, 0,
role == XML_ROLE_REQUIRED_ATTRIBUTE_VALUE);
- poolClear(&parser->m_tempPool);
handleDefault = XML_FALSE;
}
}
+ poolClear(&parser->m_tempPool);
break;
case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE:
case XML_ROLE_FIXED_ATTRIBUTE_VALUE:
@@ -4483,7 +5213,8 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
const XML_Char *attVal;
enum XML_Error result = storeAttributeValue(
parser, enc, parser->m_declAttributeIsCdata,
- s + enc->minBytesPerChar, next - enc->minBytesPerChar, &dtd->pool);
+ s + enc->minBytesPerChar, next - enc->minBytesPerChar, &dtd->pool,
+ XML_ACCOUNT_NONE);
if (result)
return result;
attVal = poolStart(&dtd->pool);
@@ -4516,8 +5247,12 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
break;
case XML_ROLE_ENTITY_VALUE:
if (dtd->keepProcessing) {
- enum XML_Error result = storeEntityValue(
- parser, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar);
+#if XML_GE == 1
+ // This will store the given replacement text in
+ // parser->m_declEntity->textPtr.
+ enum XML_Error result = callStoreEntityValue(
+ parser, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar,
+ XML_ACCOUNT_NONE);
if (parser->m_declEntity) {
parser->m_declEntity->textPtr = poolStart(&dtd->entityValuePool);
parser->m_declEntity->textLen
@@ -4535,6 +5270,25 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
poolDiscard(&dtd->entityValuePool);
if (result != XML_ERROR_NONE)
return result;
+#else
+ // This will store "&amp;entity123;" in parser->m_declEntity->textPtr
+ // to end up as "&entity123;" in the handler.
+ if (parser->m_declEntity != NULL) {
+ const enum XML_Error result
+ = storeSelfEntityValue(parser, parser->m_declEntity);
+ if (result != XML_ERROR_NONE)
+ return result;
+
+ if (parser->m_entityDeclHandler) {
+ *eventEndPP = s;
+ parser->m_entityDeclHandler(
+ parser->m_handlerArg, parser->m_declEntity->name,
+ parser->m_declEntity->is_param, parser->m_declEntity->textPtr,
+ parser->m_declEntity->textLen, parser->m_curBase, 0, 0, 0);
+ handleDefault = XML_FALSE;
+ }
+ }
+#endif
}
break;
case XML_ROLE_DOCTYPE_SYSTEM_ID:
@@ -4593,6 +5347,16 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
}
break;
case XML_ROLE_ENTITY_COMPLETE:
+#if XML_GE == 0
+ // This will store "&amp;entity123;" in entity->textPtr
+ // to end up as "&entity123;" in the handler.
+ if (parser->m_declEntity != NULL) {
+ const enum XML_Error result
+ = storeSelfEntityValue(parser, parser->m_declEntity);
+ if (result != XML_ERROR_NONE)
+ return result;
+ }
+#endif
if (dtd->keepProcessing && parser->m_declEntity
&& parser->m_entityDeclHandler) {
*eventEndPP = s;
@@ -4776,6 +5540,11 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
if (parser->m_prologState.level >= parser->m_groupSize) {
if (parser->m_groupSize) {
{
+ /* Detect and prevent integer overflow */
+ if (parser->m_groupSize > (unsigned int)(-1) / 2u) {
+ return XML_ERROR_NO_MEMORY;
+ }
+
char *const new_connector = (char *)REALLOC(
parser, parser->m_groupConnector, parser->m_groupSize *= 2);
if (new_connector == NULL) {
@@ -4786,6 +5555,16 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
}
if (dtd->scaffIndex) {
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if (parser->m_groupSize > (size_t)(-1) / sizeof(int)) {
+ return XML_ERROR_NO_MEMORY;
+ }
+#endif
+
int *const new_scaff_index = (int *)REALLOC(
parser, dtd->scaffIndex, parser->m_groupSize * sizeof(int));
if (new_scaff_index == NULL)
@@ -4866,7 +5645,7 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
*
* If 'standalone' is false, the DTD must have no
* parameter entities or we wouldn't have passed the outer
- * 'if' statement. That measn the only entity in the hash
+ * 'if' statement. That means the only entity in the hash
* table is the external subset name "#" which cannot be
* given as a parameter entity name in XML syntax, so the
* lookup must have returned NULL and we don't even reach
@@ -4898,7 +5677,7 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
enum XML_Error result;
XML_Bool betweenDecl
= (role == XML_ROLE_PARAM_ENTITY_REF ? XML_TRUE : XML_FALSE);
- result = processInternalEntity(parser, entity, betweenDecl);
+ result = processEntity(parser, entity, betweenDecl, ENTITY_INTERNAL);
if (result != XML_ERROR_NONE)
return result;
handleDefault = XML_FALSE;
@@ -4907,12 +5686,15 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
if (parser->m_externalEntityRefHandler) {
dtd->paramEntityRead = XML_FALSE;
entity->open = XML_TRUE;
+ entityTrackingOnOpen(parser, entity, __LINE__);
if (! parser->m_externalEntityRefHandler(
parser->m_externalEntityRefHandlerArg, 0, entity->base,
entity->systemId, entity->publicId)) {
+ entityTrackingOnClose(parser, entity, __LINE__);
entity->open = XML_FALSE;
return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
}
+ entityTrackingOnClose(parser, entity, __LINE__);
entity->open = XML_FALSE;
handleDefault = XML_FALSE;
if (! dtd->paramEntityRead) {
@@ -4991,7 +5773,7 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
if (dtd->in_eldecl) {
ELEMENT_TYPE *el;
const XML_Char *name;
- int nameLen;
+ size_t nameLen;
const char *nxt
= (quant == XML_CQUANT_NONE ? next : next - enc->minBytesPerChar);
int myindex = nextScaffoldPart(parser);
@@ -5007,7 +5789,13 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
nameLen = 0;
for (; name[nameLen++];)
;
- dtd->contentStringLen += nameLen;
+
+ /* Detect and prevent integer overflow */
+ if (nameLen > UINT_MAX - dtd->contentStringLen) {
+ return XML_ERROR_NO_MEMORY;
+ }
+
+ dtd->contentStringLen += (unsigned)nameLen;
if (parser->m_elementDeclHandler)
handleDefault = XML_FALSE;
}
@@ -5094,6 +5882,12 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
return XML_ERROR_NONE;
case XML_FINISHED:
return XML_ERROR_ABORTED;
+ case XML_PARSING:
+ if (parser->m_reenter) {
+ *nextPtr = next;
+ return XML_ERROR_NONE;
+ }
+ /* Fall through */
default:
s = next;
tok = XmlPrologTok(enc, s, end, &next);
@@ -5110,6 +5904,13 @@ epilogProcessor(XML_Parser parser, const char *s, const char *end,
for (;;) {
const char *next = NULL;
int tok = XmlPrologTok(parser->m_encoding, s, end, &next);
+#if XML_GE == 1
+ if (! accountingDiffTolerated(parser, tok, s, next, __LINE__,
+ XML_ACCOUNT_DIRECT)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+#endif
parser->m_eventEndPtr = next;
switch (tok) {
/* report partial linebreak - it might be the last token */
@@ -5154,28 +5955,58 @@ epilogProcessor(XML_Parser parser, const char *s, const char *end,
default:
return XML_ERROR_JUNK_AFTER_DOC_ELEMENT;
}
- parser->m_eventPtr = s = next;
switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
+ parser->m_eventPtr = next;
*nextPtr = next;
return XML_ERROR_NONE;
case XML_FINISHED:
+ parser->m_eventPtr = next;
return XML_ERROR_ABORTED;
+ case XML_PARSING:
+ if (parser->m_reenter) {
+ return XML_ERROR_UNEXPECTED_STATE; // LCOV_EXCL_LINE
+ }
+ /* Fall through */
default:;
+ parser->m_eventPtr = s = next;
}
}
}
static enum XML_Error
-processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) {
- const char *textStart, *textEnd;
- const char *next;
- enum XML_Error result;
- OPEN_INTERNAL_ENTITY *openEntity;
+processEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl,
+ enum EntityType type) {
+ OPEN_INTERNAL_ENTITY *openEntity, **openEntityList, **freeEntityList;
+ switch (type) {
+ case ENTITY_INTERNAL:
+ parser->m_processor = internalEntityProcessor;
+ openEntityList = &parser->m_openInternalEntities;
+ freeEntityList = &parser->m_freeInternalEntities;
+ break;
+ case ENTITY_ATTRIBUTE:
+ openEntityList = &parser->m_openAttributeEntities;
+ freeEntityList = &parser->m_freeAttributeEntities;
+ break;
+ case ENTITY_VALUE:
+ openEntityList = &parser->m_openValueEntities;
+ freeEntityList = &parser->m_freeValueEntities;
+ break;
+ /* default case serves merely as a safety net in case of a
+ * wrong entityType. Therefore we exclude the following lines
+ * from the test coverage.
+ *
+ * LCOV_EXCL_START
+ */
+ default:
+ // Should not reach here
+ assert(0);
+ /* LCOV_EXCL_STOP */
+ }
- if (parser->m_freeInternalEntities) {
- openEntity = parser->m_freeInternalEntities;
- parser->m_freeInternalEntities = openEntity->next;
+ if (*freeEntityList) {
+ openEntity = *freeEntityList;
+ *freeEntityList = openEntity->next;
} else {
openEntity
= (OPEN_INTERNAL_ENTITY *)MALLOC(parser, sizeof(OPEN_INTERNAL_ENTITY));
@@ -5183,48 +6014,34 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) {
return XML_ERROR_NO_MEMORY;
}
entity->open = XML_TRUE;
+ entity->hasMore = XML_TRUE;
+#if XML_GE == 1
+ entityTrackingOnOpen(parser, entity, __LINE__);
+#endif
entity->processed = 0;
- openEntity->next = parser->m_openInternalEntities;
- parser->m_openInternalEntities = openEntity;
+ openEntity->next = *openEntityList;
+ *openEntityList = openEntity;
openEntity->entity = entity;
+ openEntity->type = type;
openEntity->startTagLevel = parser->m_tagLevel;
openEntity->betweenDecl = betweenDecl;
openEntity->internalEventPtr = NULL;
openEntity->internalEventEndPtr = NULL;
- textStart = (const char *)entity->textPtr;
- textEnd = (const char *)(entity->textPtr + entity->textLen);
- /* Set a safe default value in case 'next' does not get set */
- next = textStart;
-
-#ifdef XML_DTD
- if (entity->is_param) {
- int tok
- = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next);
- result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd,
- tok, next, &next, XML_FALSE, XML_FALSE);
- } else
-#endif /* XML_DTD */
- result = doContent(parser, parser->m_tagLevel, parser->m_internalEncoding,
- textStart, textEnd, &next, XML_FALSE);
- if (result == XML_ERROR_NONE) {
- if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) {
- entity->processed = (int)(next - textStart);
- parser->m_processor = internalEntityProcessor;
- } else {
- entity->open = XML_FALSE;
- parser->m_openInternalEntities = openEntity->next;
- /* put openEntity back in list of free instances */
- openEntity->next = parser->m_freeInternalEntities;
- parser->m_freeInternalEntities = openEntity;
- }
+ // Only internal entities make use of the reenter flag
+ // therefore no need to set it for other entity types
+ if (type == ENTITY_INTERNAL) {
+ triggerReenter(parser);
}
- return result;
+ return XML_ERROR_NONE;
}
static enum XML_Error PTRCALL
internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
const char **nextPtr) {
+ UNUSED_P(s);
+ UNUSED_P(end);
+ UNUSED_P(nextPtr);
ENTITY *entity;
const char *textStart, *textEnd;
const char *next;
@@ -5234,53 +6051,67 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
return XML_ERROR_UNEXPECTED_STATE;
entity = openEntity->entity;
- textStart = ((const char *)entity->textPtr) + entity->processed;
- textEnd = (const char *)(entity->textPtr + entity->textLen);
- /* Set a safe default value in case 'next' does not get set */
- next = textStart;
-#ifdef XML_DTD
- if (entity->is_param) {
- int tok
- = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next);
- result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd,
- tok, next, &next, XML_FALSE, XML_TRUE);
- } else
-#endif /* XML_DTD */
- result = doContent(parser, openEntity->startTagLevel,
- parser->m_internalEncoding, textStart, textEnd, &next,
- XML_FALSE);
+ // This will return early
+ if (entity->hasMore) {
+ textStart = ((const char *)entity->textPtr) + entity->processed;
+ textEnd = (const char *)(entity->textPtr + entity->textLen);
+ /* Set a safe default value in case 'next' does not get set */
+ next = textStart;
+
+ if (entity->is_param) {
+ int tok
+ = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next);
+ result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd,
+ tok, next, &next, XML_FALSE, XML_FALSE,
+ XML_ACCOUNT_ENTITY_EXPANSION);
+ } else {
+ result = doContent(parser, openEntity->startTagLevel,
+ parser->m_internalEncoding, textStart, textEnd, &next,
+ XML_FALSE, XML_ACCOUNT_ENTITY_EXPANSION);
+ }
- if (result != XML_ERROR_NONE)
- return result;
- else if (textEnd != next
- && parser->m_parsingStatus.parsing == XML_SUSPENDED) {
- entity->processed = (int)(next - (const char *)entity->textPtr);
+ if (result != XML_ERROR_NONE)
+ return result;
+ // Check if entity is complete, if not, mark down how much of it is
+ // processed
+ if (textEnd != next
+ && (parser->m_parsingStatus.parsing == XML_SUSPENDED
+ || (parser->m_parsingStatus.parsing == XML_PARSING
+ && parser->m_reenter))) {
+ entity->processed = (int)(next - (const char *)entity->textPtr);
+ return result;
+ }
+
+ // Entity is complete. We cannot close it here since we need to first
+ // process its possible inner entities (which are added to the
+ // m_openInternalEntities during doProlog or doContent calls above)
+ entity->hasMore = XML_FALSE;
+ triggerReenter(parser);
return result;
- } else {
- entity->open = XML_FALSE;
- parser->m_openInternalEntities = openEntity->next;
- /* put openEntity back in list of free instances */
- openEntity->next = parser->m_freeInternalEntities;
- parser->m_freeInternalEntities = openEntity;
- }
+ } // End of entity processing, "if" block will return here
-#ifdef XML_DTD
- if (entity->is_param) {
- int tok;
- parser->m_processor = prologProcessor;
- tok = XmlPrologTok(parser->m_encoding, s, end, &next);
- return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr,
- (XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_TRUE);
- } else
-#endif /* XML_DTD */
- {
- parser->m_processor = contentProcessor;
- /* see externalEntityContentProcessor vs contentProcessor */
- return doContent(parser, parser->m_parentParser ? 1 : 0, parser->m_encoding,
- s, end, nextPtr,
- (XML_Bool)! parser->m_parsingStatus.finalBuffer);
+ // Remove fully processed openEntity from open entity list.
+#if XML_GE == 1
+ entityTrackingOnClose(parser, entity, __LINE__);
+#endif
+ // openEntity is m_openInternalEntities' head, as we set it at the start of
+ // this function and we skipped doProlog and doContent calls with hasMore set
+ // to false. This means we can directly remove the head of
+ // m_openInternalEntities
+ assert(parser->m_openInternalEntities == openEntity);
+ entity->open = XML_FALSE;
+ parser->m_openInternalEntities = parser->m_openInternalEntities->next;
+
+ /* put openEntity back in list of free instances */
+ openEntity->next = parser->m_freeInternalEntities;
+ parser->m_freeInternalEntities = openEntity;
+
+ if (parser->m_openInternalEntities == NULL) {
+ parser->m_processor = entity->is_param ? prologProcessor : contentProcessor;
}
+ triggerReenter(parser);
+ return XML_ERROR_NONE;
}
static enum XML_Error PTRCALL
@@ -5294,9 +6125,72 @@ errorProcessor(XML_Parser parser, const char *s, const char *end,
static enum XML_Error
storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
- const char *ptr, const char *end, STRING_POOL *pool) {
- enum XML_Error result
- = appendAttributeValue(parser, enc, isCdata, ptr, end, pool);
+ const char *ptr, const char *end, STRING_POOL *pool,
+ enum XML_Account account) {
+ const char *next = ptr;
+ enum XML_Error result = XML_ERROR_NONE;
+
+ while (1) {
+ if (! parser->m_openAttributeEntities) {
+ result = appendAttributeValue(parser, enc, isCdata, next, end, pool,
+ account, &next);
+ } else {
+ OPEN_INTERNAL_ENTITY *const openEntity = parser->m_openAttributeEntities;
+ if (! openEntity)
+ return XML_ERROR_UNEXPECTED_STATE;
+
+ ENTITY *const entity = openEntity->entity;
+ const char *const textStart
+ = ((const char *)entity->textPtr) + entity->processed;
+ const char *const textEnd
+ = (const char *)(entity->textPtr + entity->textLen);
+ /* Set a safe default value in case 'next' does not get set */
+ const char *nextInEntity = textStart;
+ if (entity->hasMore) {
+ result = appendAttributeValue(
+ parser, parser->m_internalEncoding, isCdata, textStart, textEnd,
+ pool, XML_ACCOUNT_ENTITY_EXPANSION, &nextInEntity);
+ if (result != XML_ERROR_NONE)
+ break;
+ // Check if entity is complete, if not, mark down how much of it is
+ // processed. A XML_SUSPENDED check here is not required as
+ // appendAttributeValue will never suspend the parser.
+ if (textEnd != nextInEntity) {
+ entity->processed
+ = (int)(nextInEntity - (const char *)entity->textPtr);
+ continue;
+ }
+
+ // Entity is complete. We cannot close it here since we need to first
+ // process its possible inner entities (which are added to the
+ // m_openAttributeEntities during appendAttributeValue)
+ entity->hasMore = XML_FALSE;
+ continue;
+ } // End of entity processing, "if" block skips the rest
+
+ // Remove fully processed openEntity from open entity list.
+#if XML_GE == 1
+ entityTrackingOnClose(parser, entity, __LINE__);
+#endif
+ // openEntity is m_openAttributeEntities' head, since we set it at the
+ // start of this function and because we skipped appendAttributeValue call
+ // with hasMore set to false. This means we can directly remove the head
+ // of m_openAttributeEntities
+ assert(parser->m_openAttributeEntities == openEntity);
+ entity->open = XML_FALSE;
+ parser->m_openAttributeEntities = parser->m_openAttributeEntities->next;
+
+ /* put openEntity back in list of free instances */
+ openEntity->next = parser->m_freeAttributeEntities;
+ parser->m_freeAttributeEntities = openEntity;
+ }
+
+ // Break if an error occurred or there is nothing left to process
+ if (result || (parser->m_openAttributeEntities == NULL && end == next)) {
+ break;
+ }
+ }
+
if (result)
return result;
if (! isCdata && poolLength(pool) && poolLastChar(pool) == 0x20)
@@ -5308,13 +6202,28 @@ storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
static enum XML_Error
appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
- const char *ptr, const char *end, STRING_POOL *pool) {
+ const char *ptr, const char *end, STRING_POOL *pool,
+ enum XML_Account account, const char **nextPtr) {
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
+#ifndef XML_DTD
+ UNUSED_P(account);
+#endif
+
for (;;) {
- const char *next;
+ const char *next
+ = ptr; /* XmlAttributeValueTok doesn't always set the last arg */
int tok = XmlAttributeValueTok(enc, ptr, end, &next);
+#if XML_GE == 1
+ if (! accountingDiffTolerated(parser, tok, ptr, next, __LINE__, account)) {
+ accountingOnAbort(parser);
+ return XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ }
+#endif
switch (tok) {
case XML_TOK_NONE:
+ if (nextPtr) {
+ *nextPtr = next;
+ }
return XML_ERROR_NONE;
case XML_TOK_INVALID:
if (enc == parser->m_encoding)
@@ -5372,6 +6281,14 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
XML_Char ch = (XML_Char)XmlPredefinedEntityName(
enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar);
if (ch) {
+#if XML_GE == 1
+ /* NOTE: We are replacing 4-6 characters original input for 1 character
+ * so there is no amplification and hence recording without
+ * protection. */
+ accountingDiffTolerated(parser, tok, (char *)&ch,
+ ((char *)&ch) + sizeof(XML_Char), __LINE__,
+ XML_ACCOUNT_ENTITY_EXPANSION);
+#endif /* XML_GE == 1 */
if (! poolAppendChar(pool, ch))
return XML_ERROR_NO_MEMORY;
break;
@@ -5447,14 +6364,11 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF;
} else {
enum XML_Error result;
- const XML_Char *textEnd = entity->textPtr + entity->textLen;
- entity->open = XML_TRUE;
- result = appendAttributeValue(parser, parser->m_internalEncoding,
- isCdata, (const char *)entity->textPtr,
- (const char *)textEnd, pool);
- entity->open = XML_FALSE;
- if (result)
- return result;
+ result = processEntity(parser, entity, XML_FALSE, ENTITY_ATTRIBUTE);
+ if ((result == XML_ERROR_NONE) && (nextPtr != NULL)) {
+ *nextPtr = next;
+ }
+ return result;
}
} break;
default:
@@ -5479,16 +6393,20 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
/* not reached */
}
+#if XML_GE == 1
static enum XML_Error
storeEntityValue(XML_Parser parser, const ENCODING *enc,
- const char *entityTextPtr, const char *entityTextEnd) {
+ const char *entityTextPtr, const char *entityTextEnd,
+ enum XML_Account account, const char **nextPtr) {
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
STRING_POOL *pool = &(dtd->entityValuePool);
enum XML_Error result = XML_ERROR_NONE;
-#ifdef XML_DTD
+# ifdef XML_DTD
int oldInEntityValue = parser->m_prologState.inEntityValue;
parser->m_prologState.inEntityValue = 1;
-#endif /* XML_DTD */
+# else
+ UNUSED_P(account);
+# endif /* XML_DTD */
/* never return Null for the value argument in EntityDeclHandler,
since this would indicate an external entity; therefore we
have to make sure that entityValuePool.start is not null */
@@ -5497,12 +6415,22 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
return XML_ERROR_NO_MEMORY;
}
+ const char *next;
for (;;) {
- const char *next;
+ next
+ = entityTextPtr; /* XmlEntityValueTok doesn't always set the last arg */
int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next);
+
+ if (! accountingDiffTolerated(parser, tok, entityTextPtr, next, __LINE__,
+ account)) {
+ accountingOnAbort(parser);
+ result = XML_ERROR_AMPLIFICATION_LIMIT_BREACH;
+ goto endEntityValue;
+ }
+
switch (tok) {
case XML_TOK_PARAM_ENTITY_REF:
-#ifdef XML_DTD
+# ifdef XML_DTD
if (parser->m_isParamEntity || enc != parser->m_encoding) {
const XML_Char *name;
ENTITY *entity;
@@ -5525,7 +6453,7 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
dtd->keepProcessing = dtd->standalone;
goto endEntityValue;
}
- if (entity->open) {
+ if (entity->open || (entity == parser->m_declEntity)) {
if (enc == parser->m_encoding)
parser->m_eventPtr = entityTextPtr;
result = XML_ERROR_RECURSIVE_ENTITY_REF;
@@ -5535,30 +6463,28 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
if (parser->m_externalEntityRefHandler) {
dtd->paramEntityRead = XML_FALSE;
entity->open = XML_TRUE;
+ entityTrackingOnOpen(parser, entity, __LINE__);
if (! parser->m_externalEntityRefHandler(
parser->m_externalEntityRefHandlerArg, 0, entity->base,
entity->systemId, entity->publicId)) {
+ entityTrackingOnClose(parser, entity, __LINE__);
entity->open = XML_FALSE;
result = XML_ERROR_EXTERNAL_ENTITY_HANDLING;
goto endEntityValue;
}
+ entityTrackingOnClose(parser, entity, __LINE__);
entity->open = XML_FALSE;
if (! dtd->paramEntityRead)
dtd->keepProcessing = dtd->standalone;
} else
dtd->keepProcessing = dtd->standalone;
} else {
- entity->open = XML_TRUE;
- result = storeEntityValue(
- parser, parser->m_internalEncoding, (const char *)entity->textPtr,
- (const char *)(entity->textPtr + entity->textLen));
- entity->open = XML_FALSE;
- if (result)
- goto endEntityValue;
+ result = processEntity(parser, entity, XML_FALSE, ENTITY_VALUE);
+ goto endEntityValue;
}
break;
}
-#endif /* XML_DTD */
+# endif /* XML_DTD */
/* In the internal subset, PE references are not legal
within markup declarations, e.g entity values in this case. */
parser->m_eventPtr = entityTextPtr;
@@ -5639,12 +6565,113 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
entityTextPtr = next;
}
endEntityValue:
-#ifdef XML_DTD
+# ifdef XML_DTD
parser->m_prologState.inEntityValue = oldInEntityValue;
-#endif /* XML_DTD */
+# endif /* XML_DTD */
+ // If 'nextPtr' is given, it should be updated during the processing
+ if (nextPtr != NULL) {
+ *nextPtr = next;
+ }
return result;
}
+static enum XML_Error
+callStoreEntityValue(XML_Parser parser, const ENCODING *enc,
+ const char *entityTextPtr, const char *entityTextEnd,
+ enum XML_Account account) {
+ const char *next = entityTextPtr;
+ enum XML_Error result = XML_ERROR_NONE;
+ while (1) {
+ if (! parser->m_openValueEntities) {
+ result
+ = storeEntityValue(parser, enc, next, entityTextEnd, account, &next);
+ } else {
+ OPEN_INTERNAL_ENTITY *const openEntity = parser->m_openValueEntities;
+ if (! openEntity)
+ return XML_ERROR_UNEXPECTED_STATE;
+
+ ENTITY *const entity = openEntity->entity;
+ const char *const textStart
+ = ((const char *)entity->textPtr) + entity->processed;
+ const char *const textEnd
+ = (const char *)(entity->textPtr + entity->textLen);
+ /* Set a safe default value in case 'next' does not get set */
+ const char *nextInEntity = textStart;
+ if (entity->hasMore) {
+ result = storeEntityValue(parser, parser->m_internalEncoding, textStart,
+ textEnd, XML_ACCOUNT_ENTITY_EXPANSION,
+ &nextInEntity);
+ if (result != XML_ERROR_NONE)
+ break;
+ // Check if entity is complete, if not, mark down how much of it is
+ // processed. A XML_SUSPENDED check here is not required as
+ // appendAttributeValue will never suspend the parser.
+ if (textEnd != nextInEntity) {
+ entity->processed
+ = (int)(nextInEntity - (const char *)entity->textPtr);
+ continue;
+ }
+
+ // Entity is complete. We cannot close it here since we need to first
+ // process its possible inner entities (which are added to the
+ // m_openValueEntities during storeEntityValue)
+ entity->hasMore = XML_FALSE;
+ continue;
+ } // End of entity processing, "if" block skips the rest
+
+ // Remove fully processed openEntity from open entity list.
+# if XML_GE == 1
+ entityTrackingOnClose(parser, entity, __LINE__);
+# endif
+ // openEntity is m_openValueEntities' head, since we set it at the
+ // start of this function and because we skipped storeEntityValue call
+ // with hasMore set to false. This means we can directly remove the head
+ // of m_openValueEntities
+ assert(parser->m_openValueEntities == openEntity);
+ entity->open = XML_FALSE;
+ parser->m_openValueEntities = parser->m_openValueEntities->next;
+
+ /* put openEntity back in list of free instances */
+ openEntity->next = parser->m_freeValueEntities;
+ parser->m_freeValueEntities = openEntity;
+ }
+
+ // Break if an error occurred or there is nothing left to process
+ if (result
+ || (parser->m_openValueEntities == NULL && entityTextEnd == next)) {
+ break;
+ }
+ }
+
+ return result;
+}
+
+#else /* XML_GE == 0 */
+
+static enum XML_Error
+storeSelfEntityValue(XML_Parser parser, ENTITY *entity) {
+ // This will store "&amp;entity123;" in entity->textPtr
+ // to end up as "&entity123;" in the handler.
+ const char *const entity_start = "&amp;";
+ const char *const entity_end = ";";
+
+ STRING_POOL *const pool = &(parser->m_dtd->entityValuePool);
+ if (! poolAppendString(pool, entity_start)
+ || ! poolAppendString(pool, entity->name)
+ || ! poolAppendString(pool, entity_end)) {
+ poolDiscard(pool);
+ return XML_ERROR_NO_MEMORY;
+ }
+
+ entity->textPtr = poolStart(pool);
+ entity->textLen = (int)(poolLength(pool));
+ poolFinish(pool);
+
+ return XML_ERROR_NONE;
+}
+
+#endif /* XML_GE == 0 */
+
static void FASTCALL
normalizeLines(XML_Char *s) {
XML_Char *p;
@@ -5755,8 +6782,9 @@ reportDefault(XML_Parser parser, const ENCODING *enc, const char *s,
} while ((convert_res != XML_CONVERT_COMPLETED)
&& (convert_res != XML_CONVERT_INPUT_INCOMPLETE));
} else
- parser->m_defaultHandler(parser->m_handlerArg, (XML_Char *)s,
- (int)((XML_Char *)end - (XML_Char *)s));
+ parser->m_defaultHandler(
+ parser->m_handlerArg, (const XML_Char *)s,
+ (int)((const XML_Char *)end - (const XML_Char *)s));
}
static int
@@ -5784,7 +6812,24 @@ defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata,
}
} else {
DEFAULT_ATTRIBUTE *temp;
+
+ /* Detect and prevent integer overflow */
+ if (type->allocDefaultAtts > INT_MAX / 2) {
+ return 0;
+ }
+
int count = type->allocDefaultAtts * 2;
+
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if ((unsigned)count > (size_t)(-1) / sizeof(DEFAULT_ATTRIBUTE)) {
+ return 0;
+ }
+#endif
+
temp = (DEFAULT_ATTRIBUTE *)REALLOC(parser, type->defaultAtts,
(count * sizeof(DEFAULT_ATTRIBUTE)));
if (temp == NULL)
@@ -5843,7 +6888,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start,
name = poolStoreString(&dtd->pool, enc, start, end);
if (! name)
return NULL;
- /* skip quotation mark - its storage will be re-used (like in name[-1]) */
+ /* skip quotation mark - its storage will be reused (like in name[-1]) */
++name;
id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, name,
sizeof(ATTRIBUTE_ID));
@@ -5993,6 +7038,10 @@ getContext(XML_Parser parser) {
static XML_Bool
setContext(XML_Parser parser, const XML_Char *context) {
+ if (context == NULL) {
+ return XML_FALSE;
+ }
+
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
const XML_Char *s = context;
@@ -6074,7 +7123,7 @@ normalizePublicId(XML_Char *publicId) {
static DTD *
dtdCreate(const XML_Memory_Handling_Suite *ms) {
- DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD));
+ DTD *p = ms->malloc_fcn(sizeof(DTD));
if (p == NULL)
return p;
poolInit(&(p->pool), ms);
@@ -6247,8 +7296,18 @@ dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd,
if (! newE)
return 0;
if (oldE->nDefaultAtts) {
- newE->defaultAtts = (DEFAULT_ATTRIBUTE *)ms->malloc_fcn(
- oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if ((size_t)oldE->nDefaultAtts
+ > ((size_t)(-1) / sizeof(DEFAULT_ATTRIBUTE))) {
+ return 0;
+ }
+#endif
+ newE->defaultAtts
+ = ms->malloc_fcn(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
if (! newE->defaultAtts) {
return 0;
}
@@ -6410,7 +7469,7 @@ lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize) {
/* table->size is a power of 2 */
table->size = (size_t)1 << INIT_POWER;
tsize = table->size * sizeof(NAMED *);
- table->v = (NAMED **)table->mem->malloc_fcn(tsize);
+ table->v = table->mem->malloc_fcn(tsize);
if (! table->v) {
table->size = 0;
return NULL;
@@ -6435,10 +7494,22 @@ lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize) {
/* check for overflow (table is half full) */
if (table->used >> (table->power - 1)) {
unsigned char newPower = table->power + 1;
+
+ /* Detect and prevent invalid shift */
+ if (newPower >= sizeof(unsigned long) * 8 /* bits per byte */) {
+ return NULL;
+ }
+
size_t newSize = (size_t)1 << newPower;
unsigned long newMask = (unsigned long)newSize - 1;
+
+ /* Detect and prevent integer overflow */
+ if (newSize > (size_t)(-1) / sizeof(NAMED *)) {
+ return NULL;
+ }
+
size_t tsize = newSize * sizeof(NAMED *);
- NAMED **newV = (NAMED **)table->mem->malloc_fcn(tsize);
+ NAMED **newV = table->mem->malloc_fcn(tsize);
if (! newV)
return NULL;
memset(newV, 0, tsize);
@@ -6467,7 +7538,7 @@ lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize) {
}
}
}
- table->v[i] = (NAMED *)table->mem->malloc_fcn(createSize);
+ table->v[i] = table->mem->malloc_fcn(createSize);
if (! table->v[i])
return NULL;
memset(table->v[i], 0, createSize);
@@ -6571,7 +7642,7 @@ poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr,
return NULL;
for (;;) {
const enum XML_Convert_Result convert_res = XmlConvert(
- enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end);
+ enc, &ptr, end, (ICHAR **)&(pool->ptr), (const ICHAR *)pool->end);
if ((convert_res == XML_CONVERT_COMPLETED)
|| (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
break;
@@ -6755,7 +7826,7 @@ poolGrow(STRING_POOL *pool) {
if (bytesToAllocate == 0)
return XML_FALSE;
- tem = (BLOCK *)pool->mem->malloc_fcn(bytesToAllocate);
+ tem = pool->mem->malloc_fcn(bytesToAllocate);
if (! tem)
return XML_FALSE;
tem->size = blockSize;
@@ -6777,6 +7848,15 @@ nextScaffoldPart(XML_Parser parser) {
int next;
if (! dtd->scaffIndex) {
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if (parser->m_groupSize > ((size_t)(-1) / sizeof(int))) {
+ return -1;
+ }
+#endif
dtd->scaffIndex = (int *)MALLOC(parser, parser->m_groupSize * sizeof(int));
if (! dtd->scaffIndex)
return -1;
@@ -6786,6 +7866,20 @@ nextScaffoldPart(XML_Parser parser) {
if (dtd->scaffCount >= dtd->scaffSize) {
CONTENT_SCAFFOLD *temp;
if (dtd->scaffold) {
+ /* Detect and prevent integer overflow */
+ if (dtd->scaffSize > UINT_MAX / 2u) {
+ return -1;
+ }
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if (dtd->scaffSize > (size_t)(-1) / 2u / sizeof(CONTENT_SCAFFOLD)) {
+ return -1;
+ }
+#endif
+
temp = (CONTENT_SCAFFOLD *)REALLOC(
parser, dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
if (temp == NULL)
@@ -6817,55 +7911,130 @@ nextScaffoldPart(XML_Parser parser) {
return next;
}
-static void
-build_node(XML_Parser parser, int src_node, XML_Content *dest,
- XML_Content **contpos, XML_Char **strpos) {
- DTD *const dtd = parser->m_dtd; /* save one level of indirection */
- dest->type = dtd->scaffold[src_node].type;
- dest->quant = dtd->scaffold[src_node].quant;
- if (dest->type == XML_CTYPE_NAME) {
- const XML_Char *src;
- dest->name = *strpos;
- src = dtd->scaffold[src_node].name;
- for (;;) {
- *(*strpos)++ = *src;
- if (! *src)
- break;
- src++;
- }
- dest->numchildren = 0;
- dest->children = NULL;
- } else {
- unsigned int i;
- int cn;
- dest->numchildren = dtd->scaffold[src_node].childcnt;
- dest->children = *contpos;
- *contpos += dest->numchildren;
- for (i = 0, cn = dtd->scaffold[src_node].firstchild; i < dest->numchildren;
- i++, cn = dtd->scaffold[cn].nextsib) {
- build_node(parser, cn, &(dest->children[i]), contpos, strpos);
- }
- dest->name = NULL;
- }
-}
-
static XML_Content *
build_model(XML_Parser parser) {
+ /* Function build_model transforms the existing parser->m_dtd->scaffold
+ * array of CONTENT_SCAFFOLD tree nodes into a new array of
+ * XML_Content tree nodes followed by a gapless list of zero-terminated
+ * strings. */
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
XML_Content *ret;
- XML_Content *cpos;
- XML_Char *str;
- int allocsize = (dtd->scaffCount * sizeof(XML_Content)
- + (dtd->contentStringLen * sizeof(XML_Char)));
+ XML_Char *str; /* the current string writing location */
+
+ /* Detect and prevent integer overflow.
+ * The preprocessor guard addresses the "always false" warning
+ * from -Wtype-limits on platforms where
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
+#if UINT_MAX >= SIZE_MAX
+ if (dtd->scaffCount > (size_t)(-1) / sizeof(XML_Content)) {
+ return NULL;
+ }
+ if (dtd->contentStringLen > (size_t)(-1) / sizeof(XML_Char)) {
+ return NULL;
+ }
+#endif
+ if (dtd->scaffCount * sizeof(XML_Content)
+ > (size_t)(-1) - dtd->contentStringLen * sizeof(XML_Char)) {
+ return NULL;
+ }
+
+ const size_t allocsize = (dtd->scaffCount * sizeof(XML_Content)
+ + (dtd->contentStringLen * sizeof(XML_Char)));
ret = (XML_Content *)MALLOC(parser, allocsize);
if (! ret)
return NULL;
- str = (XML_Char *)(&ret[dtd->scaffCount]);
- cpos = &ret[1];
+ /* What follows is an iterative implementation (of what was previously done
+ * recursively in a dedicated function called "build_node". The old recursive
+ * build_node could be forced into stack exhaustion from input as small as a
+ * few megabyte, and so that was a security issue. Hence, a function call
+ * stack is avoided now by resolving recursion.)
+ *
+ * The iterative approach works as follows:
+ *
+ * - We have two writing pointers, both walking up the result array; one does
+ * the work, the other creates "jobs" for its colleague to do, and leads
+ * the way:
+ *
+ * - The faster one, pointer jobDest, always leads and writes "what job
+ * to do" by the other, once they reach that place in the
+ * array: leader "jobDest" stores the source node array index (relative
+ * to array dtd->scaffold) in field "numchildren".
+ *
+ * - The slower one, pointer dest, looks at the value stored in the
+ * "numchildren" field (which actually holds a source node array index
+ * at that time) and puts the real data from dtd->scaffold in.
+ *
+ * - Before the loop starts, jobDest writes source array index 0
+ * (where the root node is located) so that dest will have something to do
+ * when it starts operation.
+ *
+ * - Whenever nodes with children are encountered, jobDest appends
+ * them as new jobs, in order. As a result, tree node siblings are
+ * adjacent in the resulting array, for example:
+ *
+ * [0] root, has two children
+ * [1] first child of 0, has three children
+ * [3] first child of 1, does not have children
+ * [4] second child of 1, does not have children
+ * [5] third child of 1, does not have children
+ * [2] second child of 0, does not have children
+ *
+ * Or (the same data) presented in flat array view:
+ *
+ * [0] root, has two children
+ *
+ * [1] first child of 0, has three children
+ * [2] second child of 0, does not have children
+ *
+ * [3] first child of 1, does not have children
+ * [4] second child of 1, does not have children
+ * [5] third child of 1, does not have children
+ *
+ * - The algorithm repeats until all target array indices have been processed.
+ */
+ XML_Content *dest = ret; /* tree node writing location, moves upwards */
+ XML_Content *const destLimit = &ret[dtd->scaffCount];
+ XML_Content *jobDest = ret; /* next free writing location in target array */
+ str = (XML_Char *)&ret[dtd->scaffCount];
+
+ /* Add the starting job, the root node (index 0) of the source tree */
+ (jobDest++)->numchildren = 0;
+
+ for (; dest < destLimit; dest++) {
+ /* Retrieve source tree array index from job storage */
+ const int src_node = (int)dest->numchildren;
+
+ /* Convert item */
+ dest->type = dtd->scaffold[src_node].type;
+ dest->quant = dtd->scaffold[src_node].quant;
+ if (dest->type == XML_CTYPE_NAME) {
+ const XML_Char *src;
+ dest->name = str;
+ src = dtd->scaffold[src_node].name;
+ for (;;) {
+ *str++ = *src;
+ if (! *src)
+ break;
+ src++;
+ }
+ dest->numchildren = 0;
+ dest->children = NULL;
+ } else {
+ unsigned int i;
+ int cn;
+ dest->name = NULL;
+ dest->numchildren = dtd->scaffold[src_node].childcnt;
+ dest->children = jobDest;
+
+ /* Append scaffold indices of children to array */
+ for (i = 0, cn = dtd->scaffold[src_node].firstchild;
+ i < dest->numchildren; i++, cn = dtd->scaffold[cn].nextsib)
+ (jobDest++)->numchildren = (unsigned int)cn;
+ }
+ }
- build_node(parser, 0, ret, &cpos, &str);
return ret;
}
@@ -6894,7 +8063,7 @@ getElementType(XML_Parser parser, const ENCODING *enc, const char *ptr,
static XML_Char *
copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {
- int charsRequired = 0;
+ size_t charsRequired = 0;
XML_Char *result;
/* First determine how long the string is */
@@ -6912,3 +8081,761 @@ copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {
memcpy(result, s, charsRequired * sizeof(XML_Char));
return result;
}
+
+#if XML_GE == 1
+
+static float
+accountingGetCurrentAmplification(XML_Parser rootParser) {
+ // 1.........1.........12 => 22
+ const size_t lenOfShortestInclude = sizeof("<!ENTITY a SYSTEM 'b'>") - 1;
+ const XmlBigCount countBytesOutput
+ = rootParser->m_accounting.countBytesDirect
+ + rootParser->m_accounting.countBytesIndirect;
+ const float amplificationFactor
+ = rootParser->m_accounting.countBytesDirect
+ ? (countBytesOutput
+ / (float)(rootParser->m_accounting.countBytesDirect))
+ : ((lenOfShortestInclude
+ + rootParser->m_accounting.countBytesIndirect)
+ / (float)lenOfShortestInclude);
+ assert(! rootParser->m_parentParser);
+ return amplificationFactor;
+}
+
+static void
+accountingReportStats(XML_Parser originParser, const char *epilog) {
+ const XML_Parser rootParser = getRootParserOf(originParser, NULL);
+ assert(! rootParser->m_parentParser);
+
+ if (rootParser->m_accounting.debugLevel == 0u) {
+ return;
+ }
+
+ const float amplificationFactor
+ = accountingGetCurrentAmplification(rootParser);
+ fprintf(stderr,
+ "expat: Accounting(%p): Direct " EXPAT_FMT_ULL(
+ "10") ", indirect " EXPAT_FMT_ULL("10") ", amplification %8.2f%s",
+ (void *)rootParser, rootParser->m_accounting.countBytesDirect,
+ rootParser->m_accounting.countBytesIndirect,
+ (double)amplificationFactor, epilog);
+}
+
+static void
+accountingOnAbort(XML_Parser originParser) {
+ accountingReportStats(originParser, " ABORTING\n");
+}
+
+static void
+accountingReportDiff(XML_Parser rootParser,
+ unsigned int levelsAwayFromRootParser, const char *before,
+ const char *after, ptrdiff_t bytesMore, int source_line,
+ enum XML_Account account) {
+ assert(! rootParser->m_parentParser);
+
+ fprintf(stderr,
+ " (+" EXPAT_FMT_PTRDIFF_T("6") " bytes %s|%u, xmlparse.c:%d) %*s\"",
+ bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
+ levelsAwayFromRootParser, source_line, 10, "");
+
+ const char ellipis[] = "[..]";
+ const size_t ellipsisLength = sizeof(ellipis) /* because compile-time */ - 1;
+ const unsigned int contextLength = 10;
+
+ /* Note: Performance is of no concern here */
+ const char *walker = before;
+ if ((rootParser->m_accounting.debugLevel >= 3u)
+ || (after - before)
+ <= (ptrdiff_t)(contextLength + ellipsisLength + contextLength)) {
+ for (; walker < after; walker++) {
+ fprintf(stderr, "%s", unsignedCharToPrintable(walker[0]));
+ }
+ } else {
+ for (; walker < before + contextLength; walker++) {
+ fprintf(stderr, "%s", unsignedCharToPrintable(walker[0]));
+ }
+ fprintf(stderr, ellipis);
+ walker = after - contextLength;
+ for (; walker < after; walker++) {
+ fprintf(stderr, "%s", unsignedCharToPrintable(walker[0]));
+ }
+ }
+ fprintf(stderr, "\"\n");
+}
+
+static XML_Bool
+accountingDiffTolerated(XML_Parser originParser, int tok, const char *before,
+ const char *after, int source_line,
+ enum XML_Account account) {
+ /* Note: We need to check the token type *first* to be sure that
+ * we can even access variable <after>, safely.
+ * E.g. for XML_TOK_NONE <after> may hold an invalid pointer. */
+ switch (tok) {
+ case XML_TOK_INVALID:
+ case XML_TOK_PARTIAL:
+ case XML_TOK_PARTIAL_CHAR:
+ case XML_TOK_NONE:
+ return XML_TRUE;
+ }
+
+ if (account == XML_ACCOUNT_NONE)
+ return XML_TRUE; /* because these bytes have been accounted for, already */
+
+ unsigned int levelsAwayFromRootParser;
+ const XML_Parser rootParser
+ = getRootParserOf(originParser, &levelsAwayFromRootParser);
+ assert(! rootParser->m_parentParser);
+
+ const int isDirect
+ = (account == XML_ACCOUNT_DIRECT) && (originParser == rootParser);
+ const ptrdiff_t bytesMore = after - before;
+
+ XmlBigCount *const additionTarget
+ = isDirect ? &rootParser->m_accounting.countBytesDirect
+ : &rootParser->m_accounting.countBytesIndirect;
+
+ /* Detect and avoid integer overflow */
+ if (*additionTarget > (XmlBigCount)(-1) - (XmlBigCount)bytesMore)
+ return XML_FALSE;
+ *additionTarget += bytesMore;
+
+ const XmlBigCount countBytesOutput
+ = rootParser->m_accounting.countBytesDirect
+ + rootParser->m_accounting.countBytesIndirect;
+ const float amplificationFactor
+ = accountingGetCurrentAmplification(rootParser);
+ const XML_Bool tolerated
+ = (countBytesOutput < rootParser->m_accounting.activationThresholdBytes)
+ || (amplificationFactor
+ <= rootParser->m_accounting.maximumAmplificationFactor);
+
+ if (rootParser->m_accounting.debugLevel >= 2u) {
+ accountingReportStats(rootParser, "");
+ accountingReportDiff(rootParser, levelsAwayFromRootParser, before, after,
+ bytesMore, source_line, account);
+ }
+
+ return tolerated;
+}
+
+unsigned long long
+testingAccountingGetCountBytesDirect(XML_Parser parser) {
+ if (! parser)
+ return 0;
+ return parser->m_accounting.countBytesDirect;
+}
+
+unsigned long long
+testingAccountingGetCountBytesIndirect(XML_Parser parser) {
+ if (! parser)
+ return 0;
+ return parser->m_accounting.countBytesIndirect;
+}
+
+static void
+entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity,
+ const char *action, int sourceLine) {
+ assert(! rootParser->m_parentParser);
+ if (rootParser->m_entity_stats.debugLevel == 0u)
+ return;
+
+# if defined(XML_UNICODE)
+ const char *const entityName = "[..]";
+# else
+ const char *const entityName = entity->name;
+# endif
+
+ fprintf(
+ stderr,
+ "expat: Entities(%p): Count %9u, depth %2u/%2u %*s%s%s; %s length %d (xmlparse.c:%d)\n",
+ (void *)rootParser, rootParser->m_entity_stats.countEverOpened,
+ rootParser->m_entity_stats.currentDepth,
+ rootParser->m_entity_stats.maximumDepthSeen,
+ ((int)rootParser->m_entity_stats.currentDepth - 1) * 2, "",
+ entity->is_param ? "%" : "&", entityName, action, entity->textLen,
+ sourceLine);
+}
+
+static void
+entityTrackingOnOpen(XML_Parser originParser, ENTITY *entity, int sourceLine) {
+ const XML_Parser rootParser = getRootParserOf(originParser, NULL);
+ assert(! rootParser->m_parentParser);
+
+ rootParser->m_entity_stats.countEverOpened++;
+ rootParser->m_entity_stats.currentDepth++;
+ if (rootParser->m_entity_stats.currentDepth
+ > rootParser->m_entity_stats.maximumDepthSeen) {
+ rootParser->m_entity_stats.maximumDepthSeen++;
+ }
+
+ entityTrackingReportStats(rootParser, entity, "OPEN ", sourceLine);
+}
+
+static void
+entityTrackingOnClose(XML_Parser originParser, ENTITY *entity, int sourceLine) {
+ const XML_Parser rootParser = getRootParserOf(originParser, NULL);
+ assert(! rootParser->m_parentParser);
+
+ entityTrackingReportStats(rootParser, entity, "CLOSE", sourceLine);
+ rootParser->m_entity_stats.currentDepth--;
+}
+
+static XML_Parser
+getRootParserOf(XML_Parser parser, unsigned int *outLevelDiff) {
+ XML_Parser rootParser = parser;
+ unsigned int stepsTakenUpwards = 0;
+ while (rootParser->m_parentParser) {
+ rootParser = rootParser->m_parentParser;
+ stepsTakenUpwards++;
+ }
+ assert(! rootParser->m_parentParser);
+ if (outLevelDiff != NULL) {
+ *outLevelDiff = stepsTakenUpwards;
+ }
+ return rootParser;
+}
+
+const char *
+unsignedCharToPrintable(unsigned char c) {
+ switch (c) {
+ case 0:
+ return "\\0";
+ case 1:
+ return "\\x1";
+ case 2:
+ return "\\x2";
+ case 3:
+ return "\\x3";
+ case 4:
+ return "\\x4";
+ case 5:
+ return "\\x5";
+ case 6:
+ return "\\x6";
+ case 7:
+ return "\\x7";
+ case 8:
+ return "\\x8";
+ case 9:
+ return "\\t";
+ case 10:
+ return "\\n";
+ case 11:
+ return "\\xB";
+ case 12:
+ return "\\xC";
+ case 13:
+ return "\\r";
+ case 14:
+ return "\\xE";
+ case 15:
+ return "\\xF";
+ case 16:
+ return "\\x10";
+ case 17:
+ return "\\x11";
+ case 18:
+ return "\\x12";
+ case 19:
+ return "\\x13";
+ case 20:
+ return "\\x14";
+ case 21:
+ return "\\x15";
+ case 22:
+ return "\\x16";
+ case 23:
+ return "\\x17";
+ case 24:
+ return "\\x18";
+ case 25:
+ return "\\x19";
+ case 26:
+ return "\\x1A";
+ case 27:
+ return "\\x1B";
+ case 28:
+ return "\\x1C";
+ case 29:
+ return "\\x1D";
+ case 30:
+ return "\\x1E";
+ case 31:
+ return "\\x1F";
+ case 32:
+ return " ";
+ case 33:
+ return "!";
+ case 34:
+ return "\\\"";
+ case 35:
+ return "#";
+ case 36:
+ return "$";
+ case 37:
+ return "%";
+ case 38:
+ return "&";
+ case 39:
+ return "'";
+ case 40:
+ return "(";
+ case 41:
+ return ")";
+ case 42:
+ return "*";
+ case 43:
+ return "+";
+ case 44:
+ return ",";
+ case 45:
+ return "-";
+ case 46:
+ return ".";
+ case 47:
+ return "/";
+ case 48:
+ return "0";
+ case 49:
+ return "1";
+ case 50:
+ return "2";
+ case 51:
+ return "3";
+ case 52:
+ return "4";
+ case 53:
+ return "5";
+ case 54:
+ return "6";
+ case 55:
+ return "7";
+ case 56:
+ return "8";
+ case 57:
+ return "9";
+ case 58:
+ return ":";
+ case 59:
+ return ";";
+ case 60:
+ return "<";
+ case 61:
+ return "=";
+ case 62:
+ return ">";
+ case 63:
+ return "?";
+ case 64:
+ return "@";
+ case 65:
+ return "A";
+ case 66:
+ return "B";
+ case 67:
+ return "C";
+ case 68:
+ return "D";
+ case 69:
+ return "E";
+ case 70:
+ return "F";
+ case 71:
+ return "G";
+ case 72:
+ return "H";
+ case 73:
+ return "I";
+ case 74:
+ return "J";
+ case 75:
+ return "K";
+ case 76:
+ return "L";
+ case 77:
+ return "M";
+ case 78:
+ return "N";
+ case 79:
+ return "O";
+ case 80:
+ return "P";
+ case 81:
+ return "Q";
+ case 82:
+ return "R";
+ case 83:
+ return "S";
+ case 84:
+ return "T";
+ case 85:
+ return "U";
+ case 86:
+ return "V";
+ case 87:
+ return "W";
+ case 88:
+ return "X";
+ case 89:
+ return "Y";
+ case 90:
+ return "Z";
+ case 91:
+ return "[";
+ case 92:
+ return "\\\\";
+ case 93:
+ return "]";
+ case 94:
+ return "^";
+ case 95:
+ return "_";
+ case 96:
+ return "`";
+ case 97:
+ return "a";
+ case 98:
+ return "b";
+ case 99:
+ return "c";
+ case 100:
+ return "d";
+ case 101:
+ return "e";
+ case 102:
+ return "f";
+ case 103:
+ return "g";
+ case 104:
+ return "h";
+ case 105:
+ return "i";
+ case 106:
+ return "j";
+ case 107:
+ return "k";
+ case 108:
+ return "l";
+ case 109:
+ return "m";
+ case 110:
+ return "n";
+ case 111:
+ return "o";
+ case 112:
+ return "p";
+ case 113:
+ return "q";
+ case 114:
+ return "r";
+ case 115:
+ return "s";
+ case 116:
+ return "t";
+ case 117:
+ return "u";
+ case 118:
+ return "v";
+ case 119:
+ return "w";
+ case 120:
+ return "x";
+ case 121:
+ return "y";
+ case 122:
+ return "z";
+ case 123:
+ return "{";
+ case 124:
+ return "|";
+ case 125:
+ return "}";
+ case 126:
+ return "~";
+ case 127:
+ return "\\x7F";
+ case 128:
+ return "\\x80";
+ case 129:
+ return "\\x81";
+ case 130:
+ return "\\x82";
+ case 131:
+ return "\\x83";
+ case 132:
+ return "\\x84";
+ case 133:
+ return "\\x85";
+ case 134:
+ return "\\x86";
+ case 135:
+ return "\\x87";
+ case 136:
+ return "\\x88";
+ case 137:
+ return "\\x89";
+ case 138:
+ return "\\x8A";
+ case 139:
+ return "\\x8B";
+ case 140:
+ return "\\x8C";
+ case 141:
+ return "\\x8D";
+ case 142:
+ return "\\x8E";
+ case 143:
+ return "\\x8F";
+ case 144:
+ return "\\x90";
+ case 145:
+ return "\\x91";
+ case 146:
+ return "\\x92";
+ case 147:
+ return "\\x93";
+ case 148:
+ return "\\x94";
+ case 149:
+ return "\\x95";
+ case 150:
+ return "\\x96";
+ case 151:
+ return "\\x97";
+ case 152:
+ return "\\x98";
+ case 153:
+ return "\\x99";
+ case 154:
+ return "\\x9A";
+ case 155:
+ return "\\x9B";
+ case 156:
+ return "\\x9C";
+ case 157:
+ return "\\x9D";
+ case 158:
+ return "\\x9E";
+ case 159:
+ return "\\x9F";
+ case 160:
+ return "\\xA0";
+ case 161:
+ return "\\xA1";
+ case 162:
+ return "\\xA2";
+ case 163:
+ return "\\xA3";
+ case 164:
+ return "\\xA4";
+ case 165:
+ return "\\xA5";
+ case 166:
+ return "\\xA6";
+ case 167:
+ return "\\xA7";
+ case 168:
+ return "\\xA8";
+ case 169:
+ return "\\xA9";
+ case 170:
+ return "\\xAA";
+ case 171:
+ return "\\xAB";
+ case 172:
+ return "\\xAC";
+ case 173:
+ return "\\xAD";
+ case 174:
+ return "\\xAE";
+ case 175:
+ return "\\xAF";
+ case 176:
+ return "\\xB0";
+ case 177:
+ return "\\xB1";
+ case 178:
+ return "\\xB2";
+ case 179:
+ return "\\xB3";
+ case 180:
+ return "\\xB4";
+ case 181:
+ return "\\xB5";
+ case 182:
+ return "\\xB6";
+ case 183:
+ return "\\xB7";
+ case 184:
+ return "\\xB8";
+ case 185:
+ return "\\xB9";
+ case 186:
+ return "\\xBA";
+ case 187:
+ return "\\xBB";
+ case 188:
+ return "\\xBC";
+ case 189:
+ return "\\xBD";
+ case 190:
+ return "\\xBE";
+ case 191:
+ return "\\xBF";
+ case 192:
+ return "\\xC0";
+ case 193:
+ return "\\xC1";
+ case 194:
+ return "\\xC2";
+ case 195:
+ return "\\xC3";
+ case 196:
+ return "\\xC4";
+ case 197:
+ return "\\xC5";
+ case 198:
+ return "\\xC6";
+ case 199:
+ return "\\xC7";
+ case 200:
+ return "\\xC8";
+ case 201:
+ return "\\xC9";
+ case 202:
+ return "\\xCA";
+ case 203:
+ return "\\xCB";
+ case 204:
+ return "\\xCC";
+ case 205:
+ return "\\xCD";
+ case 206:
+ return "\\xCE";
+ case 207:
+ return "\\xCF";
+ case 208:
+ return "\\xD0";
+ case 209:
+ return "\\xD1";
+ case 210:
+ return "\\xD2";
+ case 211:
+ return "\\xD3";
+ case 212:
+ return "\\xD4";
+ case 213:
+ return "\\xD5";
+ case 214:
+ return "\\xD6";
+ case 215:
+ return "\\xD7";
+ case 216:
+ return "\\xD8";
+ case 217:
+ return "\\xD9";
+ case 218:
+ return "\\xDA";
+ case 219:
+ return "\\xDB";
+ case 220:
+ return "\\xDC";
+ case 221:
+ return "\\xDD";
+ case 222:
+ return "\\xDE";
+ case 223:
+ return "\\xDF";
+ case 224:
+ return "\\xE0";
+ case 225:
+ return "\\xE1";
+ case 226:
+ return "\\xE2";
+ case 227:
+ return "\\xE3";
+ case 228:
+ return "\\xE4";
+ case 229:
+ return "\\xE5";
+ case 230:
+ return "\\xE6";
+ case 231:
+ return "\\xE7";
+ case 232:
+ return "\\xE8";
+ case 233:
+ return "\\xE9";
+ case 234:
+ return "\\xEA";
+ case 235:
+ return "\\xEB";
+ case 236:
+ return "\\xEC";
+ case 237:
+ return "\\xED";
+ case 238:
+ return "\\xEE";
+ case 239:
+ return "\\xEF";
+ case 240:
+ return "\\xF0";
+ case 241:
+ return "\\xF1";
+ case 242:
+ return "\\xF2";
+ case 243:
+ return "\\xF3";
+ case 244:
+ return "\\xF4";
+ case 245:
+ return "\\xF5";
+ case 246:
+ return "\\xF6";
+ case 247:
+ return "\\xF7";
+ case 248:
+ return "\\xF8";
+ case 249:
+ return "\\xF9";
+ case 250:
+ return "\\xFA";
+ case 251:
+ return "\\xFB";
+ case 252:
+ return "\\xFC";
+ case 253:
+ return "\\xFD";
+ case 254:
+ return "\\xFE";
+ case 255:
+ return "\\xFF";
+ // LCOV_EXCL_START
+ default:
+ assert(0); /* never gets here */
+ return "dead code";
+ }
+ assert(0); /* never gets here */
+ // LCOV_EXCL_STOP
+}
+
+#endif /* XML_GE == 1 */
+
+static unsigned long
+getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
+ const char *const valueOrNull = getenv(variableName);
+ if (valueOrNull == NULL) {
+ return defaultDebugLevel;
+ }
+ const char *const value = valueOrNull;
+
+ errno = 0;
+ char *afterValue = NULL;
+ unsigned long debugLevel = strtoul(value, &afterValue, 10);
+ if ((errno != 0) || (afterValue == value) || (afterValue[0] != '\0')) {
+ errno = 0;
+ return defaultDebugLevel;
+ }
+
+ return debugLevel;
+}
diff --git a/3rdparty/expat/lib/xmlrole.c b/3rdparty/expat/lib/xmlrole.c
index 3b676a415d8..2c48bf40867 100644
--- a/3rdparty/expat/lib/xmlrole.c
+++ b/3rdparty/expat/lib/xmlrole.c
@@ -7,7 +7,15 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2005-2009 Steven Solie <steven@solie.ca>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,15 +38,13 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include "expat_config.h"
+
#include <stddef.h>
#ifdef _WIN32
# include "winconfig.h"
-#else
-# ifdef HAVE_EXPAT_CONFIG_H
-# include <expat_config.h>
-# endif
-#endif /* ndef _WIN32 */
+#endif
#include "expat_external.h"
#include "internal.h"
diff --git a/3rdparty/expat/lib/xmlrole.h b/3rdparty/expat/lib/xmlrole.h
index 036aba64fd2..a7904274c91 100644
--- a/3rdparty/expat/lib/xmlrole.h
+++ b/3rdparty/expat/lib/xmlrole.h
@@ -7,7 +7,10 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -124,9 +127,9 @@ typedef struct prolog_state {
#endif /* XML_DTD */
} PROLOG_STATE;
-void XmlPrologStateInit(PROLOG_STATE *);
+void XmlPrologStateInit(PROLOG_STATE *state);
#ifdef XML_DTD
-void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
+void XmlPrologStateInitExternalEntity(PROLOG_STATE *state);
#endif /* XML_DTD */
#define XmlTokenRole(state, tok, ptr, end, enc) \
diff --git a/3rdparty/expat/lib/xmltok.c b/3rdparty/expat/lib/xmltok.c
index c4f9897f7dc..29a66d72cee 100644
--- a/3rdparty/expat/lib/xmltok.c
+++ b/3rdparty/expat/lib/xmltok.c
@@ -7,7 +7,23 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2005-2009 Steven Solie <steven@solie.ca>
+ Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2016 Pascal Cuoq <cuoq@trust-in-soft.com>
+ Copyright (c) 2016 Don Lewis <truckman@apache.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Alexander Bluhm <alexander.bluhm@gmx.net>
+ Copyright (c) 2017 Benbuck Nason <bnason@netflix.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
+ Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
+ Copyright (c) 2023 Hanno Böck <hanno@gentoo.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,25 +46,15 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include "expat_config.h"
+
#include <stddef.h>
#include <string.h> /* memcpy */
-
-#if defined(_MSC_VER) && (_MSC_VER <= 1700)
-/* for vs2012/11.0/1700 and earlier Visual Studio compilers */
-# define bool int
-# define false 0
-# define true 1
-#else
-# include <stdbool.h>
-#endif
+#include <stdbool.h>
#ifdef _WIN32
# include "winconfig.h"
-#else
-# ifdef HAVE_EXPAT_CONFIG_H
-# include <expat_config.h>
-# endif
-#endif /* ndef _WIN32 */
+#endif
#include "expat_external.h"
#include "internal.h"
@@ -72,7 +78,7 @@
#define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16)
#define UCS2_GET_NAMING(pages, hi, lo) \
- (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1u << ((lo)&0x1F)))
+ (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1u << ((lo) & 0x1F)))
/* A 2 byte UTF-8 representation splits the characters 11 bits between
the bottom 5 and 6 bits of the bytes. We need 8 bits to index into
@@ -95,13 +101,8 @@
+ ((((byte)[1]) & 3) << 1) + ((((byte)[2]) >> 5) & 1)] \
& (1u << (((byte)[2]) & 0x1F)))
-#define UTF8_GET_NAMING(pages, p, n) \
- ((n) == 2 \
- ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \
- : ((n) == 3 ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) : 0))
-
/* Detection of invalid UTF-8 sequences is based on Table 3.1B
- of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/
+ of Unicode 3.2: https://www.unicode.org/unicode/reports/tr28/
with the additional restriction of not allowing the Unicode
code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE).
Implementation details:
@@ -226,7 +227,7 @@ struct normal_encoding {
/* isNmstrt2 */ NULL, /* isNmstrt3 */ NULL, /* isNmstrt4 */ NULL, \
/* isInvalid2 */ NULL, /* isInvalid3 */ NULL, /* isInvalid4 */ NULL
-static int FASTCALL checkCharRefNumber(int);
+static int FASTCALL checkCharRefNumber(int result);
#include "xmltok_impl.h"
#include "ascii.h"
@@ -244,7 +245,7 @@ static int FASTCALL checkCharRefNumber(int);
#endif
#define SB_BYTE_TYPE(enc, p) \
- (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
+ (((const struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
#ifdef XML_MIN_SIZE
static int PTRFASTCALL
@@ -269,8 +270,14 @@ sb_byteToAscii(const ENCODING *enc, const char *p) {
#define IS_NAME_CHAR(enc, p, n) (AS_NORMAL_ENCODING(enc)->isName##n(enc, p))
#define IS_NMSTRT_CHAR(enc, p, n) (AS_NORMAL_ENCODING(enc)->isNmstrt##n(enc, p))
-#define IS_INVALID_CHAR(enc, p, n) \
- (AS_NORMAL_ENCODING(enc)->isInvalid##n(enc, p))
+#ifdef XML_MIN_SIZE
+# define IS_INVALID_CHAR(enc, p, n) \
+ (AS_NORMAL_ENCODING(enc)->isInvalid##n \
+ && AS_NORMAL_ENCODING(enc)->isInvalid##n(enc, p))
+#else
+# define IS_INVALID_CHAR(enc, p, n) \
+ (AS_NORMAL_ENCODING(enc)->isInvalid##n(enc, p))
+#endif
#ifdef XML_MIN_SIZE
# define IS_NAME_CHAR_MINBPC(enc, p) \
@@ -292,7 +299,7 @@ sb_charMatches(const ENCODING *enc, const char *p, int c) {
}
#else
/* c is an ASCII character */
-# define CHAR_MATCHES(enc, p, c) (*(p) == c)
+# define CHAR_MATCHES(enc, p, c) (*(p) == (c))
#endif
#define PREFIX(ident) normal_##ident
@@ -402,7 +409,7 @@ utf8_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim,
unsigned short *to = *toP;
const char *from = *fromP;
while (from < fromLim && to < toLim) {
- switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) {
+ switch (SB_BYTE_TYPE(enc, from)) {
case BT_LEAD2:
if (fromLim - from < 2) {
res = XML_CONVERT_INPUT_INCOMPLETE;
@@ -710,33 +717,28 @@ unicode_byte_type(char hi, char lo) {
return res; \
}
-#define SET2(ptr, ch) (((ptr)[0] = ((ch)&0xff)), ((ptr)[1] = ((ch) >> 8)))
#define GET_LO(ptr) ((unsigned char)(ptr)[0])
#define GET_HI(ptr) ((unsigned char)(ptr)[1])
DEFINE_UTF16_TO_UTF8(little2_)
DEFINE_UTF16_TO_UTF16(little2_)
-#undef SET2
#undef GET_LO
#undef GET_HI
-#define SET2(ptr, ch) (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch)&0xFF)))
#define GET_LO(ptr) ((unsigned char)(ptr)[1])
#define GET_HI(ptr) ((unsigned char)(ptr)[0])
DEFINE_UTF16_TO_UTF8(big2_)
DEFINE_UTF16_TO_UTF16(big2_)
-#undef SET2
#undef GET_LO
#undef GET_HI
#define LITTLE2_BYTE_TYPE(enc, p) \
- ((p)[1] == 0 ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \
- : unicode_byte_type((p)[1], (p)[0]))
+ ((p)[1] == 0 ? SB_BYTE_TYPE(enc, p) : unicode_byte_type((p)[1], (p)[0]))
#define LITTLE2_BYTE_TO_ASCII(p) ((p)[1] == 0 ? (p)[0] : -1)
-#define LITTLE2_CHAR_MATCHES(p, c) ((p)[1] == 0 && (p)[0] == c)
+#define LITTLE2_CHAR_MATCHES(p, c) ((p)[1] == 0 && (p)[0] == (c))
#define LITTLE2_IS_NAME_CHAR_MINBPC(p) \
UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0])
#define LITTLE2_IS_NMSTRT_CHAR_MINBPC(p) \
@@ -867,11 +869,9 @@ static const struct normal_encoding internal_little2_encoding
#endif
#define BIG2_BYTE_TYPE(enc, p) \
- ((p)[0] == 0 \
- ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \
- : unicode_byte_type((p)[0], (p)[1]))
+ ((p)[0] == 0 ? SB_BYTE_TYPE(enc, p + 1) : unicode_byte_type((p)[0], (p)[1]))
#define BIG2_BYTE_TO_ASCII(p) ((p)[0] == 0 ? (p)[1] : -1)
-#define BIG2_CHAR_MATCHES(p, c) ((p)[0] == 0 && (p)[1] == c)
+#define BIG2_CHAR_MATCHES(p, c) ((p)[0] == 0 && (p)[1] == (c))
#define BIG2_IS_NAME_CHAR_MINBPC(p) \
UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1])
#define BIG2_IS_NMSTRT_CHAR_MINBPC(p) \
diff --git a/3rdparty/expat/lib/xmltok.h b/3rdparty/expat/lib/xmltok.h
index 2adbf5307be..c51fce1ec15 100644
--- a/3rdparty/expat/lib/xmltok.h
+++ b/3rdparty/expat/lib/xmltok.h
@@ -7,7 +7,11 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2002-2005 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -285,7 +289,8 @@ int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr, int *standalonePtr);
-int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
+int XmlInitEncoding(INIT_ENCODING *p, const ENCODING **encPtr,
+ const char *name);
const ENCODING *XmlGetUtf8InternalEncoding(void);
const ENCODING *XmlGetUtf16InternalEncoding(void);
int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
@@ -303,7 +308,8 @@ int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr, int *standalonePtr);
-int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
+int XmlInitEncodingNS(INIT_ENCODING *p, const ENCODING **encPtr,
+ const char *name);
const ENCODING *XmlGetUtf8InternalEncodingNS(void);
const ENCODING *XmlGetUtf16InternalEncodingNS(void);
ENCODING *XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert,
diff --git a/3rdparty/expat/lib/xmltok_impl.c b/3rdparty/expat/lib/xmltok_impl.c
index 06d5c90851f..239a2d06c45 100644
--- a/3rdparty/expat/lib/xmltok_impl.c
+++ b/3rdparty/expat/lib/xmltok_impl.c
@@ -1,4 +1,4 @@
-/* This file is included!
+/* This file is included (from xmltok.c, 1-3 times depending on XML_MIN_SIZE)!
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
@@ -7,7 +7,16 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
+ Copyright (c) 2018 Anton Maklakov <antmak.pub@gmail.com>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Boris Kolpackov <boris@codesynthesis.com>
+ Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -32,7 +41,7 @@
#ifdef XML_TOK_IMPL_C
-# ifndef IS_INVALID_CHAR
+# ifndef IS_INVALID_CHAR // i.e. for UTF-16 and XML_MIN_SIZE not defined
# define IS_INVALID_CHAR(enc, ptr, n) (0)
# endif
@@ -61,7 +70,7 @@
case BT_LEAD##n: \
if (end - ptr < n) \
return XML_TOK_PARTIAL_CHAR; \
- if (! IS_NAME_CHAR(enc, ptr, n)) { \
+ if (IS_INVALID_CHAR(enc, ptr, n) || ! IS_NAME_CHAR(enc, ptr, n)) { \
*nextTokPtr = ptr; \
return XML_TOK_INVALID; \
} \
@@ -88,9 +97,9 @@
# define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \
case BT_LEAD##n: \
- if (end - ptr < n) \
+ if ((end) - (ptr) < (n)) \
return XML_TOK_PARTIAL_CHAR; \
- if (! IS_NMSTRT_CHAR(enc, ptr, n)) { \
+ if (IS_INVALID_CHAR(enc, ptr, n) || ! IS_NMSTRT_CHAR(enc, ptr, n)) { \
*nextTokPtr = ptr; \
return XML_TOK_INVALID; \
} \
@@ -116,7 +125,8 @@
# define PREFIX(ident) ident
# endif
-# define HAS_CHARS(enc, ptr, end, count) (end - ptr >= count * MINBPC(enc))
+# define HAS_CHARS(enc, ptr, end, count) \
+ ((end) - (ptr) >= ((count) * MINBPC(enc)))
# define HAS_CHAR(enc, ptr, end) HAS_CHARS(enc, ptr, end, 1)
@@ -1134,6 +1144,10 @@ PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
case BT_LEAD##n: \
if (end - ptr < n) \
return XML_TOK_PARTIAL_CHAR; \
+ if (IS_INVALID_CHAR(enc, ptr, n)) { \
+ *nextTokPtr = ptr; \
+ return XML_TOK_INVALID; \
+ } \
if (IS_NMSTRT_CHAR(enc, ptr, n)) { \
ptr += n; \
tok = XML_TOK_NAME; \
@@ -1262,7 +1276,7 @@ PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end,
switch (BYTE_TYPE(enc, ptr)) {
# define LEAD_CASE(n) \
case BT_LEAD##n: \
- ptr += n; \
+ ptr += n; /* NOTE: The encoding has already been validated. */ \
break;
LEAD_CASE(2)
LEAD_CASE(3)
@@ -1331,7 +1345,7 @@ PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end,
switch (BYTE_TYPE(enc, ptr)) {
# define LEAD_CASE(n) \
case BT_LEAD##n: \
- ptr += n; \
+ ptr += n; /* NOTE: The encoding has already been validated. */ \
break;
LEAD_CASE(2)
LEAD_CASE(3)
@@ -1510,7 +1524,7 @@ PREFIX(getAtts)(const ENCODING *enc, const char *ptr, int attsMax,
state = inName; \
}
# define LEAD_CASE(n) \
- case BT_LEAD##n: \
+ case BT_LEAD##n: /* NOTE: The encoding has already been validated. */ \
START_NAME ptr += (n - MINBPC(enc)); \
break;
LEAD_CASE(2)
@@ -1722,7 +1736,7 @@ PREFIX(nameLength)(const ENCODING *enc, const char *ptr) {
switch (BYTE_TYPE(enc, ptr)) {
# define LEAD_CASE(n) \
case BT_LEAD##n: \
- ptr += n; \
+ ptr += n; /* NOTE: The encoding has already been validated. */ \
break;
LEAD_CASE(2)
LEAD_CASE(3)
@@ -1767,7 +1781,7 @@ PREFIX(updatePosition)(const ENCODING *enc, const char *ptr, const char *end,
switch (BYTE_TYPE(enc, ptr)) {
# define LEAD_CASE(n) \
case BT_LEAD##n: \
- ptr += n; \
+ ptr += n; /* NOTE: The encoding has already been validated. */ \
pos->columnNumber++; \
break;
LEAD_CASE(2)
diff --git a/3rdparty/expat/lib/xmltok_impl.h b/3rdparty/expat/lib/xmltok_impl.h
index e925dbc7e2c..3469c4ae138 100644
--- a/3rdparty/expat/lib/xmltok_impl.h
+++ b/3rdparty/expat/lib/xmltok_impl.h
@@ -7,7 +7,8 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2017-2019 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -44,7 +45,7 @@ enum {
BT_LF, /* line feed = "\n" */
BT_GT, /* greater than = ">" */
BT_QUOT, /* quotation character = "\"" */
- BT_APOS, /* aposthrophe = "'" */
+ BT_APOS, /* apostrophe = "'" */
BT_EQUALS, /* equal sign = "=" */
BT_QUEST, /* question mark = "?" */
BT_EXCL, /* exclamation mark = "!" */
diff --git a/3rdparty/expat/lib/xmltok_ns.c b/3rdparty/expat/lib/xmltok_ns.c
index 919c74e9f97..fbdd3e3c7b7 100644
--- a/3rdparty/expat/lib/xmltok_ns.c
+++ b/3rdparty/expat/lib/xmltok_ns.c
@@ -7,7 +7,11 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -89,7 +93,7 @@ NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
static const ENCODING *
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
# define ENCODING_MAX 128
- char buf[ENCODING_MAX];
+ char buf[ENCODING_MAX] = "";
char *p = buf;
int i;
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
diff --git a/3rdparty/expat/m4/libtool.m4 b/3rdparty/expat/m4/libtool.m4
index ae7c9061329..91a91f82904 100644
--- a/3rdparty/expat/m4/libtool.m4
+++ b/3rdparty/expat/m4/libtool.m4
@@ -1,6 +1,7 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
-# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2019, 2021-2024 Free Software
+# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@@ -8,13 +9,13 @@
# modifications, as long as this notice is preserved.
m4_define([_LT_COPYING], [dnl
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2024 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# GNU Libtool is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
+# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# As a special exception to the GNU General Public License, if you
@@ -31,7 +32,7 @@ m4_define([_LT_COPYING], [dnl
# along with this program. If not, see <http://www.gnu.org/licenses/>.
])
-# serial 58 LT_INIT
+# serial 63 LT_INIT
# LT_PREREQ(VERSION)
@@ -59,7 +60,7 @@ esac
# LT_INIT([OPTIONS])
# ------------------
AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
+[AC_PREREQ([2.64])dnl We use AC_PATH_PROGS_FEATURE_CHECK
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_BEFORE([$0], [LT_LANG])dnl
AC_BEFORE([$0], [LT_OUTPUT])dnl
@@ -181,6 +182,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_DECL_FILECMD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
@@ -219,8 +221,8 @@ esac
ofile=libtool
can_build_shared=yes
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
+# All known linkers require a '.a' archive for static linking (except MSVC and
+# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -614,7 +616,7 @@ m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
# LT_OUTPUT
# ---------
# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
+# AC_OUTPUT is called), in case it is used in configure for compilation
# tests.
AC_DEFUN([LT_OUTPUT],
[: ${CONFIG_LT=./config.lt}
@@ -649,9 +651,9 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.
-Copyright (C) 2011 Free Software Foundation, Inc.
+Copyright (C) 2024 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
+gives unlimited permission to copy, distribute and modify it."
while test 0 != $[#]
do
@@ -728,7 +730,6 @@ _LT_CONFIG_SAVE_COMMANDS([
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
@@ -778,7 +779,7 @@ _LT_EOF
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
+ $SED '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" ||
@@ -973,6 +974,7 @@ _lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*
])# _LT_LINKER_BOILERPLATE
+
# _LT_REQUIRED_DARWIN_CHECKS
# -------------------------
m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
@@ -1023,6 +1025,21 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
rm -f conftest.*
fi])
+ # Feature test to disable chained fixups since it is not
+ # compatible with '-undefined dynamic_lookup'
+ AC_CACHE_CHECK([for -no_fixup_chains linker flag],
+ [lt_cv_support_no_fixup_chains],
+ [ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([],[])],
+ lt_cv_support_no_fixup_chains=yes,
+ lt_cv_support_no_fixup_chains=no
+ )
+ LDFLAGS=$save_LDFLAGS
+ ]
+ )
+
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
[lt_cv_ld_exported_symbols_list],
[lt_cv_ld_exported_symbols_list=no
@@ -1042,12 +1059,12 @@ int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
-int main() { return 0;}
+int main(void) { return 0;}
_LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
@@ -1067,23 +1084,37 @@ _LT_EOF
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]][[,.]]*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ darwin*)
+ case $MACOSX_DEPLOYMENT_TARGET,$host in
+ 10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ *)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
+ if test yes = "$lt_cv_support_no_fixup_chains"; then
+ AS_VAR_APPEND([_lt_dar_allow_undefined], [' $wl-no_fixup_chains'])
+ fi
+ ;;
esac
;;
esac
if test yes = "$lt_cv_apple_cc_single_mod"; then
_lt_dar_single_mod='$single_module'
fi
+ _lt_dar_needs_single_mod=no
+ case $host_os in
+ rhapsody* | darwin1.*)
+ _lt_dar_needs_single_mod=yes ;;
+ darwin*)
+ # When targeting Mac OS X 10.4 (darwin 8) or later,
+ # -single_module is the default and -multi_module is unsupported.
+ # The toolchain on macOS 10.14 (darwin 18) and later cannot
+ # target any OS version that needs -single_module.
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*-darwin[[567]].*|10.[[0-3]],*-darwin[[5-9]].*|10.[[0-3]],*-darwin1[[0-7]].*)
+ _lt_dar_needs_single_mod=yes ;;
+ esac
+ ;;
+ esac
if test yes = "$lt_cv_ld_exported_symbols_list"; then
_lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
else
@@ -1126,12 +1157,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
output_verbose_link_cmd=func_echo_all
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
m4_if([$1], [CXX],
-[ if test yes != "$lt_cv_apple_cc_single_mod"; then
+[ if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
],[])
else
@@ -1245,7 +1276,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
# _LT_WITH_SYSROOT
# ----------------
AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
+[m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([for sysroot])
AC_ARG_WITH([sysroot],
[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
[Search for dependent libraries within DIR (or the compiler's sysroot
@@ -1258,11 +1290,13 @@ lt_sysroot=
case $with_sysroot in #(
yes)
if test yes = "$GCC"; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ # Trim trailing / since we'll always append absolute paths and we want
+ # to avoid //, if only for less confusing output for the user.
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'`
fi
;; #(
/*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
@@ -1292,7 +1326,7 @@ ia64-*-hpux*)
# options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE=32
;;
@@ -1309,7 +1343,7 @@ ia64-*-hpux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
if test yes = "$lt_cv_prog_gnu_ld"; then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
@@ -1321,7 +1355,7 @@ ia64-*-hpux*)
;;
esac
else
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -1343,7 +1377,7 @@ mips64*-*linux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
emul=elf
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
emul="${emul}32"
;;
@@ -1351,7 +1385,7 @@ mips64*-*linux*)
emul="${emul}64"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*MSB*)
emul="${emul}btsmip"
;;
@@ -1359,7 +1393,7 @@ mips64*-*linux*)
emul="${emul}ltsmip"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*N32*)
emul="${emul}n32"
;;
@@ -1370,7 +1404,7 @@ mips64*-*linux*)
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*)
# Find out what ABI is being produced by ac_compile, and set linker
# options accordingly. Note that the listed cases only cover the
# situations where additional linker options are needed (such as when
@@ -1379,14 +1413,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# not appear in the list.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
- x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
+ x86_64-*linux*|x86_64-gnu*)
+ case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
;;
@@ -1414,7 +1448,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
- x86_64-*linux*)
+ x86_64-*linux*|x86_64-gnu*)
LD="${LD-ld} -m elf_x86_64"
;;
powerpcle-*linux*|powerpc64le-*linux*)
@@ -1454,7 +1488,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*)
@@ -1493,9 +1527,22 @@ need_locks=$enable_libtool_lock
m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar}
-: ${AR_FLAGS=cru}
_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+# Use ARFLAGS variable as AR's operation code to sync the variable naming with
+# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
+# higher priority because that's what people were doing historically (setting
+# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
+# variable obsoleted/removed.
+
+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
+lt_ar_flags=$AR_FLAGS
+_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
+
+# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
+# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
+_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
+ [Flags to create an archive])
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
[lt_cv_ar_at_file=no
@@ -1534,7 +1581,7 @@ AC_CHECK_TOOL(STRIP, strip, :)
test -z "$STRIP" && STRIP=:
_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_REQUIRE([AC_PROG_RANLIB])
test -z "$RANLIB" && RANLIB=:
_LT_DECL([], [RANLIB], [1],
[Commands used to install an old-style archive])
@@ -1545,15 +1592,8 @@ old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
- case $host_os in
- bitrig* | openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -1685,14 +1725,14 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
+ gnu* | ironclad*)
+ # Under GNU Hurd and Ironclad, this test is not required because there
+ # is no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
@@ -1708,18 +1748,13 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=8192;
;;
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
lt_cv_sys_max_cmd_len=8192;
;;
- bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1762,7 +1797,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
@@ -1879,11 +1914,11 @@ else
/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
#endif
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
@@ -1940,7 +1975,7 @@ else
lt_cv_dlopen_self=yes
;;
- mingw* | pw32* | cegcc*)
+ mingw* | windows* | pw32* | cegcc*)
lt_cv_dlopen=LoadLibrary
lt_cv_dlopen_libs=
;;
@@ -2212,26 +2247,35 @@ m4_defun([_LT_CMD_STRIPLIB],
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
+if test -z "$STRIP"; then
+ AC_MSG_RESULT([no])
else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP"; then
+ if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+ else
+ case $host_os in
+ darwin*)
+ # FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x"
old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
- else
+ ;;
+ freebsd*)
+ if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
AC_MSG_RESULT([no])
- fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
+ ;;
+ esac
+ fi
fi
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
_LT_DECL([], [striplib], [1])
@@ -2299,7 +2343,7 @@ if test yes = "$GCC"; then
*) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+ mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
*) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
@@ -2357,7 +2401,7 @@ BEGIN {RS = " "; FS = "/|\n";} {
# AWK program above erroneously prepends '/' to C:/dos/paths
# for these hosts.
case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
$SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
@@ -2432,7 +2476,7 @@ aix[[4-9]]*)
# Unfortunately, runtime linking may impact performance, so we do
# not want this to be the default eventually. Also, we use the
# versioned .so libs for executables only if there is the -brtl
- # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only.
# To allow for filename-based versioning support, we need to create
# libNAME.so.V as an archive file, containing:
# *) an Import File, referring to the versioned filename of the
@@ -2526,7 +2570,7 @@ bsdi[[45]]*)
# libtool to hard-code these into programs
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
version_type=windows
shrext_cmds=.dll
need_version=no
@@ -2537,15 +2581,29 @@ cygwin* | mingw* | pw32* | cegcc*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
+ # If user builds GCC with multilib enabled,
+ # it should just install on $(libdir)
+ # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones.
+ if test xyes = x"$multilib"; then
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ $install_prog $dir/$dlname $destdir/$dlname~
+ chmod a+x $destdir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib $destdir/$dlname'\'' || exit \$?;
+ fi'
+ else
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ fi
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
@@ -2554,30 +2612,30 @@ cygwin* | mingw* | pw32* | cegcc*)
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
- mingw* | cegcc*)
+ mingw* | windows* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
- *,cl*)
- # Native MSVC
+ *,cl* | *,icl*)
+ # Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
case $build_os in
- mingw*)
+ mingw* | windows*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
@@ -2590,7 +2648,7 @@ m4_if([$1], [],[
done
IFS=$lt_save_ifs
# Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
@@ -2627,7 +2685,7 @@ m4_if([$1], [],[
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@@ -2660,7 +2718,7 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
@@ -2697,7 +2755,21 @@ freebsd* | dragonfly*)
need_version=no
;;
esac
- shlibpath_var=LD_LIBRARY_PATH
+ case $host_cpu in
+ powerpc64)
+ # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+ # binaries. See <https://man.freebsd.org/cgi/man.cgi?query=ld.so>.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[int test_pointer_size[sizeof (void *) - 5];
+ ]])],
+ [shlibpath_var=LD_LIBRARY_PATH],
+ [shlibpath_var=LD_32_LIBRARY_PATH])
+ ;;
+ *)
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+ esac
case $host_os in
freebsd2.*)
shlibpath_overrides_runpath=yes
@@ -2727,8 +2799,9 @@ haiku*)
soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib'
+ hardcode_into_libs=no
;;
hpux9* | hpux10* | hpux11*)
@@ -2838,7 +2911,7 @@ linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
- library_names_spec='$libname$release$shared_ext'
+ library_names_spec='$libname$release$shared_ext $libname$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
@@ -2850,8 +2923,9 @@ linux*android*)
hardcode_into_libs=yes
dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ # -rpath works at least for libraries that are not overridden by
+ # libraries installed in system locations.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
# This must be glibc/ELF.
@@ -2885,7 +2959,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
# before this can be enabled.
hardcode_into_libs=yes
- # Ideally, we could use ldconfig to report *all* directores which are
+ # Ideally, we could use ldconfig to report *all* directories which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
@@ -2905,6 +2979,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -2923,6 +3009,18 @@ netbsd*)
hardcode_into_libs=yes
;;
+*-mlibc)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='mlibc ld.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -2942,7 +3040,7 @@ newsos6)
dynamic_linker='ldqnx.so'
;;
-openbsd* | bitrig*)
+openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
@@ -3002,6 +3100,17 @@ rdos*)
dynamic_linker=no
;;
+serenity*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='SerenityOS LibELF'
+ ;;
+
solaris*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
@@ -3099,6 +3208,21 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;
+emscripten*)
+ version_type=none
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ dynamic_linker="Emscripten linker"
+ _LT_COMPILER_PIC($1)='-fPIC'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(no_undefined_flag, $1)=
+ ;;
+
*)
dynamic_linker=no
;;
@@ -3274,7 +3398,7 @@ if test yes = "$GCC"; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by $CC])
case $host in
- *-*-mingw*)
+ *-*-mingw* | *-*-windows*)
# gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
@@ -3383,7 +3507,7 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
if test yes != "$GCC"; then
reload_cmds=false
fi
@@ -3455,7 +3579,6 @@ lt_cv_deplibs_check_method='unknown'
# 'none' -- dependencies not supported.
# 'unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# that responds to the $file_magic_cmd with a given extended regex.
# If you have 'file' or equivalent on your system and you're not sure
@@ -3472,7 +3595,7 @@ beos*)
bsdi[[45]]*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_cmd='$FILECMD -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -3482,7 +3605,7 @@ cygwin*)
lt_cv_file_magic_cmd='func_win32_libid'
;;
-mingw* | pw32*)
+mingw* | windows* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
@@ -3491,7 +3614,7 @@ mingw* | pw32*)
lt_cv_file_magic_cmd='func_win32_libid'
else
# Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
@@ -3506,14 +3629,14 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -3527,7 +3650,7 @@ haiku*)
;;
hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
@@ -3564,7 +3687,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd*)
+*-mlibc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@@ -3574,7 +3701,7 @@ netbsd*)
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
@@ -3582,7 +3709,7 @@ newos6*)
lt_cv_deplibs_check_method=pass_all
;;
-openbsd* | bitrig*)
+openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
else
@@ -3598,6 +3725,10 @@ rdos*)
lt_cv_deplibs_check_method=pass_all
;;
+serenity*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3646,7 +3777,7 @@ file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
case $host_os in
- mingw* | pw32*)
+ mingw* | windows* | pw32*)
if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
want_nocaseglob=yes
else
@@ -3698,16 +3829,16 @@ else
# Tru64's nm complains that /dev/null is an invalid object file
# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
case $build_os in
- mingw*) lt_bad_file=conftest.nm/nofile ;;
+ mingw* | windows*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
- case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
*$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break 2
;;
*)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break 2
@@ -3733,7 +3864,7 @@ else
# Let the user override the test.
else
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols -headers"
;;
@@ -3789,7 +3920,7 @@ lt_cv_sharedlib_from_linklib_cmd,
[lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
# two different shell functions defined in ltmain.sh;
# decide which one to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
@@ -3821,16 +3952,16 @@ _LT_DECL([], [sharedlib_from_linklib_cmd], [1],
m4_defun([_LT_PATH_MANIFEST_TOOL],
[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
- [lt_cv_path_mainfest_tool=no
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_manifest_tool],
+ [lt_cv_path_manifest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
cat conftest.err >&AS_MESSAGE_LOG_FD
if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
+ lt_cv_path_manifest_tool=yes
fi
rm -f conftest*])
-if test yes != "$lt_cv_path_mainfest_tool"; then
+if test yes != "$lt_cv_path_manifest_tool"; then
MANIFEST_TOOL=:
fi
_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
@@ -3859,7 +3990,7 @@ AC_DEFUN([LT_LIB_M],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*)
# These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
@@ -3934,7 +4065,7 @@ case $host_os in
aix*)
symcode='[[BCDT]]'
;;
-cygwin* | mingw* | pw32* | cegcc*)
+cygwin* | mingw* | windows* | pw32* | cegcc*)
symcode='[[ABCDGISTW]]'
;;
hpux*)
@@ -3949,7 +4080,7 @@ osf*)
symcode='[[BCDEGQRST]]'
;;
solaris*)
- symcode='[[BDRT]]'
+ symcode='[[BCDRT]]'
;;
sco3.2v5*)
symcode='[[DT]]'
@@ -3973,7 +4104,7 @@ esac
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Gets list of data symbols to import.
- lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
# Adjust the below global symbol transforms to fixup imported variables.
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
@@ -3991,20 +4122,20 @@ fi
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
$lt_cdecl_hook\
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
$lt_c_name_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
# Transform an extracted symbol line into symbol name with lib prefix and
# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
$lt_c_name_lib_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
@@ -4013,7 +4144,7 @@ $lt_c_name_lib_hook\
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
-mingw*)
+mingw* | windows*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
@@ -4028,7 +4159,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
- # Also find C++ and __fastcall symbols from MSVC++,
+ # Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
@@ -4046,9 +4177,9 @@ for ac_symprfx in "" "_"; do
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx]"
else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -4064,13 +4195,14 @@ void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
+int main(void){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -4240,7 +4372,7 @@ m4_if([$1], [CXX], [
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -4316,7 +4448,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
+ mingw* | windows* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
@@ -4335,7 +4467,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -4418,7 +4550,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4442,7 +4574,9 @@ m4_if([$1], [CXX], [
;;
esac
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *-mlibc)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4472,6 +4606,8 @@ m4_if([$1], [CXX], [
;;
psos*)
;;
+ serenity*)
+ ;;
solaris*)
case $cc_basename in
CC* | sunCC*)
@@ -4564,7 +4700,7 @@ m4_if([$1], [CXX], [
# PIC is the default for these OSes.
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -4668,7 +4804,7 @@ m4_if([$1], [CXX], [
esac
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | windows* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
@@ -4710,6 +4846,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
+ *flang* | ftn | f18* | f95*)
+ # Flang compiler.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
@@ -4754,7 +4896,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4792,6 +4934,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
+ *-mlibc)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
@@ -4808,6 +4956,9 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ serenity*)
+ ;;
+
solaris*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -4937,15 +5088,15 @@ m4_if([$1], [CXX], [
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
_LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
;;
- cygwin* | mingw* | cegcc*)
+ cygwin* | mingw* | windows* | cegcc*)
case $cc_basename in
- cl*)
+ cl* | icl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
@@ -5001,21 +5152,18 @@ dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
+ # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
+ # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
- openbsd* | bitrig*)
- with_gnu_ld=no
- ;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5062,7 +5210,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
supports_anon_versioning=no
- case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
+ case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -5116,7 +5264,7 @@ _LT_EOF
fi
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
@@ -5126,6 +5274,7 @@ _LT_EOF
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ _LT_TAGVAR(file_list_spec, $1)='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -5145,7 +5294,7 @@ _LT_EOF
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=no
;;
os2*)
@@ -5172,8 +5321,9 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
;;
interix[[3-9]]*)
@@ -5188,7 +5338,7 @@ _LT_EOF
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
@@ -5231,7 +5381,7 @@ _LT_EOF
_LT_TAGVAR(compiler_needs_object, $1)=yes
;;
esac
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C 5.9
_LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
@@ -5243,13 +5393,14 @@ _LT_EOF
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
tcc*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
;;
xlf* | bgf* | bgxlf* | mpixlf*)
@@ -5259,7 +5410,7 @@ _LT_EOF
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
@@ -5270,7 +5421,12 @@ _LT_EOF
fi
;;
- netbsd*)
+ *-mlibc)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -5391,7 +5547,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -5572,14 +5728,14 @@ _LT_EOF
_LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
- cl*)
- # Native MSVC
+ cl* | icl*)
+ # Native MSVC or ICC
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
@@ -5589,14 +5745,14 @@ _LT_EOF
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_cmds, $1)='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
cp "$export_symbols" "$output_objdir/$soname.def";
echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
else
$SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
@@ -5620,7 +5776,7 @@ _LT_EOF
fi'
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files.
@@ -5668,7 +5824,7 @@ _LT_EOF
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
@@ -5808,11 +5964,15 @@ _LT_EOF
# Fabrice Bellard et al's Tiny C Compiler
_LT_TAGVAR(ld_shlibs, $1)=yes
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
esac
;;
- netbsd*)
+ *-mlibc)
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -5834,7 +5994,7 @@ _LT_EOF
*nto* | *qnx*)
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -5877,8 +6037,9 @@ _LT_EOF
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
;;
osf3*)
@@ -5912,6 +6073,9 @@ _LT_EOF
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
+ serenity*)
+ ;;
+
solaris*)
_LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
if test yes = "$GCC"; then
@@ -6170,7 +6334,7 @@ _LT_TAGDECL([], [hardcode_direct], [0],
_LT_TAGDECL([], [hardcode_direct_absolute], [0],
[Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting $shlibpath_var if the
+ "absolute", i.e. impossible to change by setting $shlibpath_var if the
library is relocated])
_LT_TAGDECL([], [hardcode_minus_L], [0],
[Set to "yes" if using the -LDIR flag during linking hardcodes DIR
@@ -6228,7 +6392,7 @@ _LT_TAGVAR(objext, $1)=$objext
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
+lt_simple_link_test_code='int main(void){return(0);}'
_LT_TAG_COMPILER
# Save the default compiler, since it gets overwritten when the other
@@ -6417,8 +6581,7 @@ if test yes != "$_lt_caught_CXX_error"; then
wlarc='$wl'
# ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
_LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
@@ -6438,7 +6601,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
else
GXX=no
@@ -6647,10 +6810,10 @@ if test yes != "$_lt_caught_CXX_error"; then
esac
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | mingw* | windows* | pw32* | cegcc*)
case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
+ ,cl* | no,cl* | ,icl* | no,icl*)
+ # Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
@@ -6700,6 +6863,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -6746,8 +6910,9 @@ if test yes != "$_lt_caught_CXX_error"; then
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
;;
dgux*)
@@ -6778,7 +6943,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
;;
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -6786,7 +6951,7 @@ if test yes != "$_lt_caught_CXX_error"; then
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=no
;;
hpux9*)
@@ -6813,7 +6978,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -6878,7 +7043,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -6915,7 +7080,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
irix5* | irix6*)
case $cc_basename in
@@ -7055,13 +7220,13 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
@@ -7110,6 +7275,10 @@ if test yes != "$_lt_caught_CXX_error"; then
esac
;;
+ *-mlibc)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
@@ -7126,7 +7295,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- openbsd* | bitrig*)
+ openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -7217,7 +7386,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
else
# FIXME: insert proper C++ library support
@@ -7232,6 +7401,9 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(ld_shlibs, $1)=no
;;
+ serenity*)
+ ;;
+
sunos4*)
case $cc_basename in
CC*)
@@ -7301,7 +7473,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
@@ -7312,7 +7484,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
@@ -7550,10 +7722,11 @@ if AC_TRY_EVAL(ac_compile); then
case $prev$p in
-L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
+ # Some compilers place space between "-{L,R,l}" and the path.
# Remove the space.
- if test x-L = "$p" ||
- test x-R = "$p"; then
+ if test x-L = x"$p" ||
+ test x-R = x"$p" ||
+ test x-l = x"$p"; then
prev=$p
continue
fi
@@ -8207,6 +8380,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
AC_SUBST([DLLTOOL])
])
+# _LT_DECL_FILECMD
+# ----------------
+# Check for a file(cmd) program that can be used to detect file type and magic
+m4_defun([_LT_DECL_FILECMD],
+[AC_CHECK_PROG([FILECMD], [file], [file], [:])
+_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
+])# _LD_DECL_FILECMD
+
# _LT_DECL_SED
# ------------
# Check for a fully-functional sed program, that truncates
@@ -8219,73 +8400,6 @@ _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
[Sed that helps us avoid accidentally triggering echo(1) options like -n])
])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f "$lt_ac_sed" && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test 10 -lt "$lt_ac_count" && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test "$lt_ac_count" -gt "$lt_ac_max"; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_SED], [])
@@ -8332,7 +8446,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd,
[case $host in
*-*-mingw* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
;;
*-*-cygwin* )
@@ -8345,7 +8459,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd,
;;
*-*-cygwin* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
;;
*-*-cygwin* )
@@ -8371,9 +8485,9 @@ AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
[#assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
- *-*-mingw* )
+ *-*-mingw* | *-*-windows* )
case $build in
- *-*-mingw* ) # actually msys
+ *-*-mingw* | *-*-windows* ) # actually msys
lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
;;
esac
diff --git a/3rdparty/expat/m4/ltoptions.m4 b/3rdparty/expat/m4/ltoptions.m4
index 94b08297666..25caa890298 100644
--- a/3rdparty/expat/m4/ltoptions.m4
+++ b/3rdparty/expat/m4/ltoptions.m4
@@ -1,14 +1,14 @@
# Helper functions for option handling. -*- Autoconf -*-
#
-# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
-# Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2024 Free
+# Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# serial 8 ltoptions.m4
+# serial 10 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -128,7 +128,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
@@ -323,29 +323,39 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_AIX_SONAME([DEFAULT])
# ----------------------------------
-# implement the --with-aix-soname flag, and support the `aix-soname=aix'
-# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
-# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
+# implement the --enable-aix-soname configure option, and support the
+# `aix-soname=aix' and `aix-soname=both' and `aix-soname=svr4' LT_INIT options.
+# DEFAULT is either `aix', `both', or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
- AC_ARG_WITH([aix-soname],
- [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+ AC_ARG_ENABLE([aix-soname],
+ [AS_HELP_STRING([--enable-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
- [case $withval in
- aix|svr4|both)
- ;;
- *)
- AC_MSG_ERROR([Unknown argument to --with-aix-soname])
- ;;
- esac
- lt_cv_with_aix_soname=$with_aix_soname],
- [AC_CACHE_VAL([lt_cv_with_aix_soname],
- [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
- with_aix_soname=$lt_cv_with_aix_soname])
+ [case $enableval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --enable-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$enable_aix_soname],
+ [_AC_ENABLE_IF([with], [aix-soname],
+ [case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname],
+ [AC_CACHE_VAL([lt_cv_with_aix_soname],
+ [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)])
+ enable_aix_soname=$lt_cv_with_aix_soname])
+ with_aix_soname=$enable_aix_soname
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
@@ -376,30 +386,50 @@ LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _LT_WITH_PIC([MODE])
# --------------------
-# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# implement the --enable-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options.
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+[AC_ARG_ENABLE([pic],
+ [AS_HELP_STRING([--enable-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for lt_pkg in $withval; do
- IFS=$lt_save_ifs
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac],
- [pic_mode=m4_default([$1], [default])])
+ case $enableval in
+ yes|no) pic_mode=$enableval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [dnl Continue to support --with-pic and --without-pic, for backward
+ dnl compatibility.
+ _AC_ENABLE_IF([with], [pic],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [pic_mode=m4_default([$1], [default])])]
+ )
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
diff --git a/3rdparty/expat/m4/ltsugar.m4 b/3rdparty/expat/m4/ltsugar.m4
index 48bc9344a4d..902508bd93a 100644
--- a/3rdparty/expat/m4/ltsugar.m4
+++ b/3rdparty/expat/m4/ltsugar.m4
@@ -1,6 +1,6 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
diff --git a/3rdparty/expat/m4/ltversion.m4 b/3rdparty/expat/m4/ltversion.m4
index fa04b52a3bf..228df3f39bf 100644
--- a/3rdparty/expat/m4/ltversion.m4
+++ b/3rdparty/expat/m4/ltversion.m4
@@ -1,6 +1,7 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
-# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011-2019, 2021-2024 Free Software Foundation,
+# Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
@@ -9,15 +10,15 @@
# @configure_input@
-# serial 4179 ltversion.m4
+# serial 4441 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.4.6])
-m4_define([LT_PACKAGE_REVISION], [2.4.6])
+m4_define([LT_PACKAGE_VERSION], [2.5.4])
+m4_define([LT_PACKAGE_REVISION], [2.5.4])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.6'
-macro_revision='2.4.6'
+[macro_version='2.5.4'
+macro_revision='2.5.4'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
diff --git a/3rdparty/expat/m4/lt~obsolete.m4 b/3rdparty/expat/m4/lt~obsolete.m4
index c6b26f88f6c..0f7a8759da8 100644
--- a/3rdparty/expat/m4/lt~obsolete.m4
+++ b/3rdparty/expat/m4/lt~obsolete.m4
@@ -1,7 +1,7 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
-# Foundation, Inc.
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
+# Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
diff --git a/3rdparty/expat/run.sh.in b/3rdparty/expat/run.sh.in
index ff3fb36447c..72f86b6dcc4 100644
--- a/3rdparty/expat/run.sh.in
+++ b/3rdparty/expat/run.sh.in
@@ -1,10 +1,45 @@
#! /usr/bin/env bash
-# Copyright (C) 2017 Expat development team
-# Licensed under the MIT license
+# __ __ _
+# ___\ \/ /_ __ __ _| |_
+# / _ \\ /| '_ \ / _` | __|
+# | __// \| |_) | (_| | |_
+# \___/_/\_\ .__/ \__,_|\__|
+# |_| XML parser
+#
+# Copyright (c) 2017-2022 Sebastian Pipping <sebastian@pipping.org>
+# Licensed under the MIT license:
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# 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 AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
case "@host@" in
*-mingw*)
- exec wine "$@"
+ case "$(uname -o)" in
+ Cygwin|Msys)
+ # Windows binary on Windows host
+ exec "$@"
+ ;;
+ *)
+ # Windows binary on non-Windows host
+ exec wine "$@"
+ ;;
+ esac
;;
*)
exec "$@"
diff --git a/3rdparty/expat/test-driver-wrapper.sh b/3rdparty/expat/test-driver-wrapper.sh
index 36a185266c6..305c6f5f606 100755
--- a/3rdparty/expat/test-driver-wrapper.sh
+++ b/3rdparty/expat/test-driver-wrapper.sh
@@ -6,7 +6,8 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2019 Jeffrey Walton <noloader@gmail.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/tests/Makefile.am b/3rdparty/expat/tests/Makefile.am
index e19fc1ae8ad..d25376be541 100644
--- a/3rdparty/expat/tests/Makefile.am
+++ b/3rdparty/expat/tests/Makefile.am
@@ -6,7 +6,10 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
+# Copyright (c) 2024 Dag-Erling Smørgrav <des@des.dev>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -30,37 +33,67 @@
SUBDIRS = . benchmark
-AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
+AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib -DXML_TESTING
-noinst_LIBRARIES = libruntests.a
-
-check_PROGRAMS = runtests runtestspp
-TESTS = runtests runtestspp
+check_PROGRAMS = runtests runtests_cxx
+TESTS = runtests runtests_cxx
# To support MinGW and Non-MinGW at the same time:
LOG_DRIVER = $(srcdir)/../test-driver-wrapper.sh
-libruntests_a_SOURCES = \
+runtests_SOURCES = \
+ acc_tests.c \
+ alloc_tests.c \
+ basic_tests.c \
chardata.c \
- structdata.c \
+ common.c \
+ dummy.c \
+ handlers.c \
memcheck.c \
- minicheck.c
+ minicheck.c \
+ misc_tests.c \
+ ns_tests.c \
+ nsalloc_tests.c \
+ runtests.c \
+ structdata.c
-runtests_SOURCES = \
- runtests.c
+runtests_cxx_SOURCES = \
+ acc_tests_cxx.cpp \
+ alloc_tests_cxx.cpp \
+ basic_tests_cxx.cpp \
+ chardata_cxx.cpp \
+ common_cxx.cpp \
+ dummy_cxx.cpp \
+ handlers_cxx.cpp \
+ memcheck_cxx.cpp \
+ minicheck_cxx.cpp \
+ misc_tests_cxx.cpp \
+ nsalloc_tests_cxx.cpp \
+ ns_tests_cxx.cpp \
+ runtests_cxx.cpp \
+ structdata_cxx.cpp
-runtestspp_SOURCES = \
- runtestspp.cpp
+runtests_LDADD = ../lib/libtestpat.la
+runtests_cxx_LDADD = ../lib/libtestpat.la
-runtests_LDADD = libruntests.a ../lib/libexpat.la
-runtestspp_LDADD = libruntests.a ../lib/libexpat.la
+runtests_LDFLAGS = @AM_LDFLAGS@ @LIBM@
+runtests_cxx_LDFLAGS = @AM_LDFLAGS@ @LIBM@
EXTRA_DIST = \
+ acc_tests.h \
+ alloc_tests.h \
+ basic_tests.h \
chardata.h \
+ common.h \
+ dummy.h \
+ handlers.h \
+ misc_tests.h \
+ ns_tests.h \
+ nsalloc_tests.h \
structdata.h \
minicheck.h \
memcheck.h \
- README.txt \
+ README.md \
udiffer.py \
xmltest.log.expected \
xmltest.sh
diff --git a/3rdparty/expat/tests/Makefile.in b/3rdparty/expat/tests/Makefile.in
index 8b9b38eadcd..eb00a068cbd 100644
--- a/3rdparty/expat/tests/Makefile.in
+++ b/3rdparty/expat/tests/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,10 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
+# Copyright (c) 2024 Dag-Erling Smørgrav <des@des.dev>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -43,7 +46,6 @@
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
-
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
@@ -118,8 +120,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-check_PROGRAMS = runtests$(EXEEXT) runtestspp$(EXEEXT)
-TESTS = runtests$(EXEEXT) runtestspp$(EXEEXT)
+check_PROGRAMS = runtests$(EXEEXT) runtests_cxx$(EXEEXT)
+TESTS = runtests$(EXEEXT) runtests_cxx$(EXEEXT)
subdir = tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
@@ -133,6 +135,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -141,27 +145,34 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/expat_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-AM_V_AR = $(am__v_AR_@AM_V@)
-am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
-am__v_AR_0 = @echo " AR " $@;
-am__v_AR_1 =
-libruntests_a_AR = $(AR) $(ARFLAGS)
-libruntests_a_LIBADD =
-am_libruntests_a_OBJECTS = chardata.$(OBJEXT) structdata.$(OBJEXT) \
- memcheck.$(OBJEXT) minicheck.$(OBJEXT)
-libruntests_a_OBJECTS = $(am_libruntests_a_OBJECTS)
-am_runtests_OBJECTS = runtests.$(OBJEXT)
+am_runtests_OBJECTS = acc_tests.$(OBJEXT) alloc_tests.$(OBJEXT) \
+ basic_tests.$(OBJEXT) chardata.$(OBJEXT) common.$(OBJEXT) \
+ dummy.$(OBJEXT) handlers.$(OBJEXT) memcheck.$(OBJEXT) \
+ minicheck.$(OBJEXT) misc_tests.$(OBJEXT) ns_tests.$(OBJEXT) \
+ nsalloc_tests.$(OBJEXT) runtests.$(OBJEXT) \
+ structdata.$(OBJEXT)
runtests_OBJECTS = $(am_runtests_OBJECTS)
-runtests_DEPENDENCIES = libruntests.a ../lib/libexpat.la
+runtests_DEPENDENCIES = ../lib/libtestpat.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
-am_runtestspp_OBJECTS = runtestspp.$(OBJEXT)
-runtestspp_OBJECTS = $(am_runtestspp_OBJECTS)
-runtestspp_DEPENDENCIES = libruntests.a ../lib/libexpat.la
+runtests_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(runtests_LDFLAGS) $(LDFLAGS) -o $@
+am_runtests_cxx_OBJECTS = acc_tests_cxx.$(OBJEXT) \
+ alloc_tests_cxx.$(OBJEXT) basic_tests_cxx.$(OBJEXT) \
+ chardata_cxx.$(OBJEXT) common_cxx.$(OBJEXT) \
+ dummy_cxx.$(OBJEXT) handlers_cxx.$(OBJEXT) \
+ memcheck_cxx.$(OBJEXT) minicheck_cxx.$(OBJEXT) \
+ misc_tests_cxx.$(OBJEXT) nsalloc_tests_cxx.$(OBJEXT) \
+ ns_tests_cxx.$(OBJEXT) runtests_cxx.$(OBJEXT) \
+ structdata_cxx.$(OBJEXT)
+runtests_cxx_OBJECTS = $(am_runtests_cxx_OBJECTS)
+runtests_cxx_DEPENDENCIES = ../lib/libtestpat.la
+runtests_cxx_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(runtests_cxx_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -177,9 +188,21 @@ am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp
am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = ./$(DEPDIR)/chardata.Po ./$(DEPDIR)/memcheck.Po \
- ./$(DEPDIR)/minicheck.Po ./$(DEPDIR)/runtests.Po \
- ./$(DEPDIR)/runtestspp.Po ./$(DEPDIR)/structdata.Po
+am__depfiles_remade = ./$(DEPDIR)/acc_tests.Po \
+ ./$(DEPDIR)/acc_tests_cxx.Po ./$(DEPDIR)/alloc_tests.Po \
+ ./$(DEPDIR)/alloc_tests_cxx.Po ./$(DEPDIR)/basic_tests.Po \
+ ./$(DEPDIR)/basic_tests_cxx.Po ./$(DEPDIR)/chardata.Po \
+ ./$(DEPDIR)/chardata_cxx.Po ./$(DEPDIR)/common.Po \
+ ./$(DEPDIR)/common_cxx.Po ./$(DEPDIR)/dummy.Po \
+ ./$(DEPDIR)/dummy_cxx.Po ./$(DEPDIR)/handlers.Po \
+ ./$(DEPDIR)/handlers_cxx.Po ./$(DEPDIR)/memcheck.Po \
+ ./$(DEPDIR)/memcheck_cxx.Po ./$(DEPDIR)/minicheck.Po \
+ ./$(DEPDIR)/minicheck_cxx.Po ./$(DEPDIR)/misc_tests.Po \
+ ./$(DEPDIR)/misc_tests_cxx.Po ./$(DEPDIR)/ns_tests.Po \
+ ./$(DEPDIR)/ns_tests_cxx.Po ./$(DEPDIR)/nsalloc_tests.Po \
+ ./$(DEPDIR)/nsalloc_tests_cxx.Po ./$(DEPDIR)/runtests.Po \
+ ./$(DEPDIR)/runtests_cxx.Po ./$(DEPDIR)/structdata.Po \
+ ./$(DEPDIR)/structdata_cxx.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -217,10 +240,8 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
-SOURCES = $(libruntests_a_SOURCES) $(runtests_SOURCES) \
- $(runtestspp_SOURCES)
-DIST_SOURCES = $(libruntests_a_SOURCES) $(runtests_SOURCES) \
- $(runtestspp_SOURCES)
+SOURCES = $(runtests_SOURCES) $(runtests_cxx_SOURCES)
+DIST_SOURCES = $(runtests_SOURCES) $(runtests_cxx_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
@@ -259,8 +280,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
@@ -443,6 +462,7 @@ am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
RECHECK_LOGS = $(TEST_LOGS)
TEST_SUITE_LOG = test-suite.log
TEST_EXTENSIONS = @EXEEXT@ .test
@@ -466,7 +486,7 @@ TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/conftools/depcomp \
- $(top_srcdir)/conftools/test-driver
+ $(top_srcdir)/conftools/test-driver README.md
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -496,7 +516,7 @@ am__relativize = \
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
-AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
+AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib -DXML_TESTING
AM_CXXFLAGS = @AM_CXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_LDFLAGS = @AM_LDFLAGS@
@@ -509,8 +529,10 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CPP = @CPP@
+CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
@@ -526,10 +548,20 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
FGREP = @FGREP@
+FILECMD = @FILECMD@
FILEMAP = @FILEMAP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -539,6 +571,8 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LIBAGE = @LIBAGE@
LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
+LIBM = @LIBM@
LIBOBJS = @LIBOBJS@
LIBREVISION = @LIBREVISION@
LIBS = @LIBS@
@@ -547,6 +581,7 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -568,9 +603,12 @@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SIZEOF_VOID_P = @SIZEOF_VOID_P@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
STRIP = @STRIP@
VERSION = @VERSION@
-_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -626,30 +664,60 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = . benchmark
-noinst_LIBRARIES = libruntests.a
# To support MinGW and Non-MinGW at the same time:
LOG_DRIVER = $(srcdir)/../test-driver-wrapper.sh
-libruntests_a_SOURCES = \
+runtests_SOURCES = \
+ acc_tests.c \
+ alloc_tests.c \
+ basic_tests.c \
chardata.c \
- structdata.c \
+ common.c \
+ dummy.c \
+ handlers.c \
memcheck.c \
- minicheck.c
-
-runtests_SOURCES = \
- runtests.c
-
-runtestspp_SOURCES = \
- runtestspp.cpp
-
-runtests_LDADD = libruntests.a ../lib/libexpat.la
-runtestspp_LDADD = libruntests.a ../lib/libexpat.la
+ minicheck.c \
+ misc_tests.c \
+ ns_tests.c \
+ nsalloc_tests.c \
+ runtests.c \
+ structdata.c
+
+runtests_cxx_SOURCES = \
+ acc_tests_cxx.cpp \
+ alloc_tests_cxx.cpp \
+ basic_tests_cxx.cpp \
+ chardata_cxx.cpp \
+ common_cxx.cpp \
+ dummy_cxx.cpp \
+ handlers_cxx.cpp \
+ memcheck_cxx.cpp \
+ minicheck_cxx.cpp \
+ misc_tests_cxx.cpp \
+ nsalloc_tests_cxx.cpp \
+ ns_tests_cxx.cpp \
+ runtests_cxx.cpp \
+ structdata_cxx.cpp
+
+runtests_LDADD = ../lib/libtestpat.la
+runtests_cxx_LDADD = ../lib/libtestpat.la
+runtests_LDFLAGS = @AM_LDFLAGS@ @LIBM@
+runtests_cxx_LDFLAGS = @AM_LDFLAGS@ @LIBM@
EXTRA_DIST = \
+ acc_tests.h \
+ alloc_tests.h \
+ basic_tests.h \
chardata.h \
+ common.h \
+ dummy.h \
+ handlers.h \
+ misc_tests.h \
+ ns_tests.h \
+ nsalloc_tests.h \
structdata.h \
minicheck.h \
memcheck.h \
- README.txt \
+ README.md \
udiffer.py \
xmltest.log.expected \
xmltest.sh
@@ -658,7 +726,7 @@ all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -682,9 +750,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
@@ -697,21 +765,13 @@ clean-checkPROGRAMS:
echo " rm -f" $$list; \
rm -f $$list
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-
-libruntests.a: $(libruntests_a_OBJECTS) $(libruntests_a_DEPENDENCIES) $(EXTRA_libruntests_a_DEPENDENCIES)
- $(AM_V_at)-rm -f libruntests.a
- $(AM_V_AR)$(libruntests_a_AR) libruntests.a $(libruntests_a_OBJECTS) $(libruntests_a_LIBADD)
- $(AM_V_at)$(RANLIB) libruntests.a
-
runtests$(EXEEXT): $(runtests_OBJECTS) $(runtests_DEPENDENCIES) $(EXTRA_runtests_DEPENDENCIES)
@rm -f runtests$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(runtests_OBJECTS) $(runtests_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(runtests_LINK) $(runtests_OBJECTS) $(runtests_LDADD) $(LIBS)
-runtestspp$(EXEEXT): $(runtestspp_OBJECTS) $(runtestspp_DEPENDENCIES) $(EXTRA_runtestspp_DEPENDENCIES)
- @rm -f runtestspp$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(runtestspp_OBJECTS) $(runtestspp_LDADD) $(LIBS)
+runtests_cxx$(EXEEXT): $(runtests_cxx_OBJECTS) $(runtests_cxx_DEPENDENCIES) $(EXTRA_runtests_cxx_DEPENDENCIES)
+ @rm -f runtests_cxx$(EXEEXT)
+ $(AM_V_CXXLD)$(runtests_cxx_LINK) $(runtests_cxx_OBJECTS) $(runtests_cxx_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -719,12 +779,34 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acc_tests.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acc_tests_cxx.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc_tests.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc_tests_cxx.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_tests.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_tests_cxx.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chardata.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chardata_cxx.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common_cxx.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy_cxx.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handlers.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handlers_cxx.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcheck.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcheck_cxx.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minicheck.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minicheck_cxx.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc_tests.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc_tests_cxx.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ns_tests.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ns_tests_cxx.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsalloc_tests.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsalloc_tests_cxx.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtests.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtestspp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtests_cxx.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/structdata.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/structdata_cxx.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@@ -986,7 +1068,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
echo "$${col}$$br$${std}"; \
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
@@ -1027,9 +1109,9 @@ runtests.log: runtests$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-runtestspp.log: runtestspp$(EXEEXT)
- @p='runtestspp$(EXEEXT)'; \
- b='runtestspp'; \
+runtests_cxx.log: runtests_cxx$(EXEEXT)
+ @p='runtests_cxx$(EXEEXT)'; \
+ b='runtests_cxx'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
@@ -1048,7 +1130,6 @@ runtestspp.log: runtestspp$(EXEEXT)
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -1111,7 +1192,7 @@ check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-recursive
-all-am: Makefile $(LIBRARIES)
+all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
@@ -1150,15 +1231,37 @@ maintainer-clean-generic:
clean: clean-recursive
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
- clean-noinstLIBRARIES mostlyclean-am
+ mostlyclean-am
distclean: distclean-recursive
- -rm -f ./$(DEPDIR)/chardata.Po
+ -rm -f ./$(DEPDIR)/acc_tests.Po
+ -rm -f ./$(DEPDIR)/acc_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/alloc_tests.Po
+ -rm -f ./$(DEPDIR)/alloc_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/basic_tests.Po
+ -rm -f ./$(DEPDIR)/basic_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/chardata.Po
+ -rm -f ./$(DEPDIR)/chardata_cxx.Po
+ -rm -f ./$(DEPDIR)/common.Po
+ -rm -f ./$(DEPDIR)/common_cxx.Po
+ -rm -f ./$(DEPDIR)/dummy.Po
+ -rm -f ./$(DEPDIR)/dummy_cxx.Po
+ -rm -f ./$(DEPDIR)/handlers.Po
+ -rm -f ./$(DEPDIR)/handlers_cxx.Po
-rm -f ./$(DEPDIR)/memcheck.Po
+ -rm -f ./$(DEPDIR)/memcheck_cxx.Po
-rm -f ./$(DEPDIR)/minicheck.Po
+ -rm -f ./$(DEPDIR)/minicheck_cxx.Po
+ -rm -f ./$(DEPDIR)/misc_tests.Po
+ -rm -f ./$(DEPDIR)/misc_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/ns_tests.Po
+ -rm -f ./$(DEPDIR)/ns_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/nsalloc_tests.Po
+ -rm -f ./$(DEPDIR)/nsalloc_tests_cxx.Po
-rm -f ./$(DEPDIR)/runtests.Po
- -rm -f ./$(DEPDIR)/runtestspp.Po
+ -rm -f ./$(DEPDIR)/runtests_cxx.Po
-rm -f ./$(DEPDIR)/structdata.Po
+ -rm -f ./$(DEPDIR)/structdata_cxx.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -1204,12 +1307,34 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
- -rm -f ./$(DEPDIR)/chardata.Po
+ -rm -f ./$(DEPDIR)/acc_tests.Po
+ -rm -f ./$(DEPDIR)/acc_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/alloc_tests.Po
+ -rm -f ./$(DEPDIR)/alloc_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/basic_tests.Po
+ -rm -f ./$(DEPDIR)/basic_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/chardata.Po
+ -rm -f ./$(DEPDIR)/chardata_cxx.Po
+ -rm -f ./$(DEPDIR)/common.Po
+ -rm -f ./$(DEPDIR)/common_cxx.Po
+ -rm -f ./$(DEPDIR)/dummy.Po
+ -rm -f ./$(DEPDIR)/dummy_cxx.Po
+ -rm -f ./$(DEPDIR)/handlers.Po
+ -rm -f ./$(DEPDIR)/handlers_cxx.Po
-rm -f ./$(DEPDIR)/memcheck.Po
+ -rm -f ./$(DEPDIR)/memcheck_cxx.Po
-rm -f ./$(DEPDIR)/minicheck.Po
+ -rm -f ./$(DEPDIR)/minicheck_cxx.Po
+ -rm -f ./$(DEPDIR)/misc_tests.Po
+ -rm -f ./$(DEPDIR)/misc_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/ns_tests.Po
+ -rm -f ./$(DEPDIR)/ns_tests_cxx.Po
+ -rm -f ./$(DEPDIR)/nsalloc_tests.Po
+ -rm -f ./$(DEPDIR)/nsalloc_tests_cxx.Po
-rm -f ./$(DEPDIR)/runtests.Po
- -rm -f ./$(DEPDIR)/runtestspp.Po
+ -rm -f ./$(DEPDIR)/runtests_cxx.Po
-rm -f ./$(DEPDIR)/structdata.Po
+ -rm -f ./$(DEPDIR)/structdata_cxx.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -1232,19 +1357,18 @@ uninstall-am:
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--depfiles check check-TESTS check-am clean \
- clean-checkPROGRAMS clean-generic clean-libtool \
- clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \
- uninstall uninstall-am
+ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ recheck tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
diff --git a/3rdparty/expat/tests/README.md b/3rdparty/expat/tests/README.md
new file mode 100644
index 00000000000..010ca95e9e2
--- /dev/null
+++ b/3rdparty/expat/tests/README.md
@@ -0,0 +1,11 @@
+This directory contains the test suite for Expat. The tests provide
+general unit testing and regression coverage. The tests are not
+expected to be useful examples of Expat usage; see the
+[examples](../examples) directory for that.
+
+The Expat tests use a partial internal implementation of the
+[Check](https://libcheck.github.io/check/) unit testing framework for
+C.
+
+Expat must be built and, on some platforms, installed, before the
+tests can be run.
diff --git a/3rdparty/expat/tests/README.txt b/3rdparty/expat/tests/README.txt
deleted file mode 100644
index 30e1d4dabe8..00000000000
--- a/3rdparty/expat/tests/README.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-This directory contains the (fledgling) test suite for Expat. The
-tests provide general unit testing and regression coverage. The tests
-are not expected to be useful examples of Expat usage; see the
-examples/ directory for that.
-
-The Expat tests use a partial internal implementation of the "Check"
-unit testing framework for C. More information on Check can be found at:
-
- http://check.sourceforge.net/
-
-Expat must be built and, depending on platform, must be installed, before "make check" can be executed.
-
-This test suite can all change in a later version.
diff --git a/3rdparty/expat/tests/acc_tests.c b/3rdparty/expat/tests/acc_tests.c
new file mode 100644
index 00000000000..b58647a2ab0
--- /dev/null
+++ b/3rdparty/expat/tests/acc_tests.c
@@ -0,0 +1,458 @@
+/* Tests in the "accounting" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include <math.h> /* NAN, INFINITY */
+#include <stdio.h>
+#include <string.h>
+
+#include "expat_config.h"
+
+#include "expat.h"
+#include "internal.h"
+#include "common.h"
+#include "minicheck.h"
+#include "chardata.h"
+#include "handlers.h"
+#include "acc_tests.h"
+
+#if XML_GE == 1
+START_TEST(test_accounting_precision) {
+ struct AccountingTestCase cases[] = {
+ {"<e/>", NULL, NULL, 0},
+ {"<e></e>", NULL, NULL, 0},
+
+ /* Attributes */
+ {"<e k1=\"v2\" k2=\"v2\"/>", NULL, NULL, 0},
+ {"<e k1=\"v2\" k2=\"v2\"></e>", NULL, NULL, 0},
+ {"<p:e xmlns:p=\"https://domain.invalid/\" />", NULL, NULL, 0},
+ {"<e k=\"&amp;&apos;&gt;&lt;&quot;\" />", NULL, NULL,
+ sizeof(XML_Char) * 5 /* number of predefined entities */},
+ {"<e1 xmlns='https://example.org/'>\n"
+ " <e2 xmlns=''/>\n"
+ "</e1>",
+ NULL, NULL, 0},
+
+ /* Text */
+ {"<e>text</e>", NULL, NULL, 0},
+ {"<e1><e2>text1<e3/>text2</e2></e1>", NULL, NULL, 0},
+ {"<e>&amp;&apos;&gt;&lt;&quot;</e>", NULL, NULL,
+ sizeof(XML_Char) * 5 /* number of predefined entities */},
+ {"<e>&#65;&#41;</e>", NULL, NULL, 0},
+
+ /* Prolog */
+ {"<?xml version=\"1.0\"?><root/>", NULL, NULL, 0},
+
+ /* Whitespace */
+ {" <e1> <e2> </e2> </e1> ", NULL, NULL, 0},
+ {"<e1 ><e2 /></e1 >", NULL, NULL, 0},
+ {"<e1><e2 k = \"v\"/><e3 k = 'v'/></e1>", NULL, NULL, 0},
+
+ /* Comments */
+ {"<!-- Comment --><e><!-- Comment --></e>", NULL, NULL, 0},
+
+ /* Processing instructions */
+ {"<?xml-stylesheet type=\"text/xsl\" href=\"https://domain.invalid/\" media=\"all\"?><e/>",
+ NULL, NULL, 0},
+ {"<?pi0?><?pi1 ?><?pi2 ?><r/><?pi4?>", NULL, NULL, 0},
+# ifdef XML_DTD
+ {"<?pi0?><?pi1 ?><?pi2 ?><!DOCTYPE r SYSTEM 'first.ent'><r/>",
+ "<?pi3?><!ENTITY % e1 SYSTEM 'second.ent'><?pi4?>%e1;<?pi5?>", "<?pi6?>",
+ 0},
+# endif /* XML_DTD */
+
+ /* CDATA */
+ {"<e><![CDATA[one two three]]></e>", NULL, NULL, 0},
+ /* The following is the essence of this OSS-Fuzz finding:
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34302
+ https://oss-fuzz.com/testcase-detail/4860575394955264
+ */
+ {"<!DOCTYPE r [\n"
+ "<!ENTITY e \"111<![CDATA[2 <= 2]]>333\">\n"
+ "]>\n"
+ "<r>&e;</r>\n",
+ NULL, NULL, sizeof(XML_Char) * strlen("111<![CDATA[2 <= 2]]>333")},
+
+# ifdef XML_DTD
+ /* Conditional sections */
+ {"<!DOCTYPE r [\n"
+ "<!ENTITY % draft 'INCLUDE'>\n"
+ "<!ENTITY % final 'IGNORE'>\n"
+ "<!ENTITY % import SYSTEM \"first.ent\">\n"
+ "%import;\n"
+ "]>\n"
+ "<r/>\n",
+ "<![%draft;[<!--1-->]]>\n"
+ "<![%final;[<!--22-->]]>",
+ NULL, sizeof(XML_Char) * (strlen("INCLUDE") + strlen("IGNORE"))},
+# endif /* XML_DTD */
+
+ /* General entities */
+ {"<!DOCTYPE root [\n"
+ "<!ENTITY nine \"123456789\">\n"
+ "]>\n"
+ "<root>&nine;</root>",
+ NULL, NULL, sizeof(XML_Char) * strlen("123456789")},
+ {"<!DOCTYPE root [\n"
+ "<!ENTITY nine \"123456789\">\n"
+ "]>\n"
+ "<root k1=\"&nine;\"/>",
+ NULL, NULL, sizeof(XML_Char) * strlen("123456789")},
+ {"<!DOCTYPE root [\n"
+ "<!ENTITY nine \"123456789\">\n"
+ "<!ENTITY nine2 \"&nine;&nine;\">\n"
+ "]>\n"
+ "<root>&nine2;&nine2;&nine2;</root>",
+ NULL, NULL,
+ sizeof(XML_Char) * 3 /* calls to &nine2; */ * 2 /* calls to &nine; */
+ * (strlen("&nine;") + strlen("123456789"))},
+ {"<!DOCTYPE r [\n"
+ " <!ENTITY five SYSTEM 'first.ent'>\n"
+ "]>\n"
+ "<r>&five;</r>",
+ "12345", NULL, 0},
+ {"<!DOCTYPE r [\n"
+ " <!ENTITY five SYSTEM 'first.ent'>\n"
+ "]>\n"
+ "<r>&five;</r>",
+ "\xEF\xBB\xBF" /* UTF-8 BOM */, NULL, 0},
+
+# ifdef XML_DTD
+ /* Parameter entities */
+ {"<!DOCTYPE r [\n"
+ "<!ENTITY % comment \"<!---->\">\n"
+ "%comment;\n"
+ "]>\n"
+ "<r/>",
+ NULL, NULL, sizeof(XML_Char) * strlen("<!---->")},
+ {"<!DOCTYPE r [\n"
+ "<!ENTITY % ninedef \"&#60;!ENTITY nine &#34;123456789&#34;&#62;\">\n"
+ "%ninedef;\n"
+ "]>\n"
+ "<r>&nine;</r>",
+ NULL, NULL,
+ sizeof(XML_Char)
+ * (strlen("<!ENTITY nine \"123456789\">") + strlen("123456789"))},
+ {"<!DOCTYPE r [\n"
+ "<!ENTITY % comment \"<!--1-->\">\n"
+ "<!ENTITY % comment2 \"&#37;comment;<!--22-->&#37;comment;\">\n"
+ "%comment2;\n"
+ "]>\n"
+ "<r/>\n",
+ NULL, NULL,
+ sizeof(XML_Char)
+ * (strlen("%comment;<!--22-->%comment;") + 2 * strlen("<!--1-->"))},
+ {"<!DOCTYPE r [\n"
+ " <!ENTITY % five \"12345\">\n"
+ " <!ENTITY % five2def \"&#60;!ENTITY five2 &#34;[&#37;five;][&#37;five;]]]]&#34;&#62;\">\n"
+ " %five2def;\n"
+ "]>\n"
+ "<r>&five2;</r>",
+ NULL, NULL, /* from "%five2def;": */
+ sizeof(XML_Char)
+ * (strlen("<!ENTITY five2 \"[%five;][%five;]]]]\">")
+ + 2 /* calls to "%five;" */ * strlen("12345")
+ + /* from "&five2;": */ strlen("[12345][12345]]]]"))},
+ {"<!DOCTYPE r SYSTEM \"first.ent\">\n"
+ "<r/>",
+ "<!ENTITY % comment '<!--1-->'>\n"
+ "<!ENTITY % comment2 '<!--22-->%comment;<!--22-->%comment;<!--22-->'>\n"
+ "%comment2;",
+ NULL,
+ sizeof(XML_Char)
+ * (strlen("<!--22-->%comment;<!--22-->%comment;<!--22-->")
+ + 2 /* calls to "%comment;" */ * strlen("<!---->"))},
+ {"<!DOCTYPE r SYSTEM 'first.ent'>\n"
+ "<r/>",
+ "<!ENTITY % e1 PUBLIC 'foo' 'second.ent'>\n"
+ "<!ENTITY % e2 '<!--22-->%e1;<!--22-->'>\n"
+ "%e2;\n",
+ "<!--1-->", sizeof(XML_Char) * strlen("<!--22--><!--1--><!--22-->")},
+ {
+ "<!DOCTYPE r SYSTEM 'first.ent'>\n"
+ "<r/>",
+ "<!ENTITY % e1 SYSTEM 'second.ent'>\n"
+ "<!ENTITY % e2 '%e1;'>",
+ "<?xml version='1.0' encoding='utf-8'?>\n"
+ "hello\n"
+ "xml" /* without trailing newline! */,
+ 0,
+ },
+ {
+ "<!DOCTYPE r SYSTEM 'first.ent'>\n"
+ "<r/>",
+ "<!ENTITY % e1 SYSTEM 'second.ent'>\n"
+ "<!ENTITY % e2 '%e1;'>",
+ "<?xml version='1.0' encoding='utf-8'?>\n"
+ "hello\n"
+ "xml\n" /* with trailing newline! */,
+ 0,
+ },
+ {"<!DOCTYPE doc SYSTEM 'first.ent'>\n"
+ "<doc></doc>\n",
+ "<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % e1 SYSTEM 'second.ent'>\n"
+ "<!ENTITY % e2 '%e1;'>\n"
+ "%e1;\n",
+ "\xEF\xBB\xBF<!ATTLIST doc a1 CDATA 'value'>" /* UTF-8 BOM */,
+ strlen("\xEF\xBB\xBF<!ATTLIST doc a1 CDATA 'value'>")},
+# endif /* XML_DTD */
+ };
+
+ const size_t countCases = sizeof(cases) / sizeof(cases[0]);
+ size_t u = 0;
+ for (; u < countCases; u++) {
+ const unsigned long long expectedCountBytesDirect
+ = strlen(cases[u].primaryText);
+ const unsigned long long expectedCountBytesIndirect
+ = (cases[u].firstExternalText ? strlen(cases[u].firstExternalText) : 0)
+ + (cases[u].secondExternalText ? strlen(cases[u].secondExternalText)
+ : 0)
+ + cases[u].expectedCountBytesIndirectExtra;
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ if (cases[u].firstExternalText) {
+ XML_SetExternalEntityRefHandler(parser,
+ accounting_external_entity_ref_handler);
+ XML_SetUserData(parser, (void *)&cases[u]);
+ }
+
+ enum XML_Status status
+ = _XML_Parse_SINGLE_BYTES(parser, cases[u].primaryText,
+ (int)strlen(cases[u].primaryText), XML_TRUE);
+ if (status != XML_STATUS_OK) {
+ _xml_failure(parser, __FILE__, __LINE__);
+ }
+
+ const unsigned long long actualCountBytesDirect
+ = testingAccountingGetCountBytesDirect(parser);
+ const unsigned long long actualCountBytesIndirect
+ = testingAccountingGetCountBytesIndirect(parser);
+
+ XML_ParserFree(parser);
+
+ if (actualCountBytesDirect != expectedCountBytesDirect) {
+ fprintf(
+ stderr,
+ "Document " EXPAT_FMT_SIZE_T("") " of " EXPAT_FMT_SIZE_T("") ": Expected " EXPAT_FMT_ULL(
+ "") " count direct bytes, got " EXPAT_FMT_ULL("") " instead.\n",
+ u + 1, countCases, expectedCountBytesDirect, actualCountBytesDirect);
+ fail("Count of direct bytes is off");
+ }
+
+ if (actualCountBytesIndirect != expectedCountBytesIndirect) {
+ fprintf(
+ stderr,
+ "Document " EXPAT_FMT_SIZE_T("") " of " EXPAT_FMT_SIZE_T("") ": Expected " EXPAT_FMT_ULL(
+ "") " count indirect bytes, got " EXPAT_FMT_ULL("") " instead.\n",
+ u + 1, countCases, expectedCountBytesIndirect,
+ actualCountBytesIndirect);
+ fail("Count of indirect bytes is off");
+ }
+ }
+}
+END_TEST
+
+START_TEST(test_billion_laughs_attack_protection_api) {
+ XML_Parser parserWithoutParent = XML_ParserCreate(NULL);
+ XML_Parser parserWithParent = XML_ExternalEntityParserCreate(
+ parserWithoutParent, XCS("entity123"), NULL);
+ if (parserWithoutParent == NULL)
+ fail("parserWithoutParent is NULL");
+ if (parserWithParent == NULL)
+ fail("parserWithParent is NULL");
+
+ // XML_SetBillionLaughsAttackProtectionMaximumAmplification, error cases
+ if (XML_SetBillionLaughsAttackProtectionMaximumAmplification(NULL, 123.0f)
+ == XML_TRUE)
+ fail("Call with NULL parser is NOT supposed to succeed");
+ if (XML_SetBillionLaughsAttackProtectionMaximumAmplification(parserWithParent,
+ 123.0f)
+ == XML_TRUE)
+ fail("Call with non-root parser is NOT supposed to succeed");
+ if (XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ parserWithoutParent, NAN)
+ == XML_TRUE)
+ fail("Call with NaN limit is NOT supposed to succeed");
+ if (XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ parserWithoutParent, -1.0f)
+ == XML_TRUE)
+ fail("Call with negative limit is NOT supposed to succeed");
+ if (XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ parserWithoutParent, 0.9f)
+ == XML_TRUE)
+ fail("Call with positive limit <1.0 is NOT supposed to succeed");
+
+ // XML_SetBillionLaughsAttackProtectionMaximumAmplification, success cases
+ if (XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ parserWithoutParent, 1.0f)
+ == XML_FALSE)
+ fail("Call with positive limit >=1.0 is supposed to succeed");
+ if (XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ parserWithoutParent, 123456.789f)
+ == XML_FALSE)
+ fail("Call with positive limit >=1.0 is supposed to succeed");
+ if (XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ parserWithoutParent, INFINITY)
+ == XML_FALSE)
+ fail("Call with positive limit >=1.0 is supposed to succeed");
+
+ // XML_SetBillionLaughsAttackProtectionActivationThreshold, error cases
+ if (XML_SetBillionLaughsAttackProtectionActivationThreshold(NULL, 123)
+ == XML_TRUE)
+ fail("Call with NULL parser is NOT supposed to succeed");
+ if (XML_SetBillionLaughsAttackProtectionActivationThreshold(parserWithParent,
+ 123)
+ == XML_TRUE)
+ fail("Call with non-root parser is NOT supposed to succeed");
+
+ // XML_SetBillionLaughsAttackProtectionActivationThreshold, success cases
+ if (XML_SetBillionLaughsAttackProtectionActivationThreshold(
+ parserWithoutParent, 123)
+ == XML_FALSE)
+ fail("Call with non-NULL parentless parser is supposed to succeed");
+
+ XML_ParserFree(parserWithParent);
+ XML_ParserFree(parserWithoutParent);
+}
+END_TEST
+
+START_TEST(test_helper_unsigned_char_to_printable) {
+ // Smoke test
+ unsigned char uc = 0;
+ for (;; uc++) {
+ set_subtest("char %u", (unsigned)uc);
+ const char *const printable = unsignedCharToPrintable(uc);
+ if (printable == NULL)
+ fail("unsignedCharToPrintable returned NULL");
+ else if (strlen(printable) < (size_t)1)
+ fail("unsignedCharToPrintable returned empty string");
+ if (uc == (unsigned char)-1) {
+ break;
+ }
+ }
+
+ // Two concrete samples
+ set_subtest("char 'A'");
+ if (strcmp(unsignedCharToPrintable('A'), "A") != 0)
+ fail("unsignedCharToPrintable result mistaken");
+ set_subtest("char '\\'");
+ if (strcmp(unsignedCharToPrintable('\\'), "\\\\") != 0)
+ fail("unsignedCharToPrintable result mistaken");
+}
+END_TEST
+
+START_TEST(test_amplification_isolated_external_parser) {
+ // NOTE: Length 44 is precisely twice the length of "<!ENTITY a SYSTEM 'b'>"
+ // (22) that is used in function accountingGetCurrentAmplification in
+ // xmlparse.c.
+ // 1.........1.........1.........1.........1..4 => 44
+ const char doc[] = "<!ENTITY % p1 '123456789_123456789_1234567'>";
+ const int docLen = (int)sizeof(doc) - 1;
+ const float maximumToleratedAmplification = 2.0f;
+
+ struct TestCase {
+ int offsetOfThreshold;
+ enum XML_Status expectedStatus;
+ };
+
+ struct TestCase cases[] = {
+ {-2, XML_STATUS_ERROR}, {-1, XML_STATUS_ERROR}, {0, XML_STATUS_ERROR},
+ {+1, XML_STATUS_OK}, {+2, XML_STATUS_OK},
+ };
+
+ for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
+ const int offsetOfThreshold = cases[i].offsetOfThreshold;
+ const enum XML_Status expectedStatus = cases[i].expectedStatus;
+ const unsigned long long activationThresholdBytes
+ = docLen + offsetOfThreshold;
+
+ set_subtest("offsetOfThreshold=%d, expectedStatus=%d", offsetOfThreshold,
+ expectedStatus);
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+
+ assert_true(XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ parser, maximumToleratedAmplification)
+ == XML_TRUE);
+ assert_true(XML_SetBillionLaughsAttackProtectionActivationThreshold(
+ parser, activationThresholdBytes)
+ == XML_TRUE);
+
+ XML_Parser ext_parser = XML_ExternalEntityParserCreate(parser, NULL, NULL);
+ assert_true(ext_parser != NULL);
+
+ const enum XML_Status actualStatus
+ = _XML_Parse_SINGLE_BYTES(ext_parser, doc, docLen, XML_TRUE);
+
+ assert_true(actualStatus == expectedStatus);
+ if (actualStatus != XML_STATUS_OK) {
+ assert_true(XML_GetErrorCode(ext_parser)
+ == XML_ERROR_AMPLIFICATION_LIMIT_BREACH);
+ }
+
+ XML_ParserFree(ext_parser);
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+#endif // XML_GE == 1
+
+void
+make_accounting_test_case(Suite *s) {
+#if XML_GE == 1
+ TCase *tc_accounting = tcase_create("accounting tests");
+
+ suite_add_tcase(s, tc_accounting);
+
+ tcase_add_test(tc_accounting, test_accounting_precision);
+ tcase_add_test(tc_accounting, test_billion_laughs_attack_protection_api);
+ tcase_add_test(tc_accounting, test_helper_unsigned_char_to_printable);
+ tcase_add_test__ifdef_xml_dtd(tc_accounting,
+ test_amplification_isolated_external_parser);
+#else
+ UNUSED_P(s);
+#endif /* XML_GE == 1 */
+}
diff --git a/3rdparty/expat/tests/acc_tests.h b/3rdparty/expat/tests/acc_tests.h
new file mode 100644
index 00000000000..bbb93f37ed2
--- /dev/null
+++ b/3rdparty/expat/tests/acc_tests.h
@@ -0,0 +1,56 @@
+/* Tests in the "accounting" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef XML_ACC_TESTS_H
+# define XML_ACC_TESTS_H
+
+extern void make_accounting_test_case(Suite *s);
+
+#endif /* XML_ACC_TESTS_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/expat/tests/acc_tests_cxx.cpp b/3rdparty/expat/tests/acc_tests_cxx.cpp
new file mode 100644
index 00000000000..01644991ae5
--- /dev/null
+++ b/3rdparty/expat/tests/acc_tests_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "acc_tests.c"
diff --git a/3rdparty/expat/tests/alloc_tests.c b/3rdparty/expat/tests/alloc_tests.c
new file mode 100644
index 00000000000..12ea3b2a81d
--- /dev/null
+++ b/3rdparty/expat/tests/alloc_tests.c
@@ -0,0 +1,2154 @@
+/* Tests in the "allocation" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Copyright (c) 2025 Berkay Eren Ürün <berkay.ueruen@siemens.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#if defined(NDEBUG)
+# undef NDEBUG /* because test suite relies on assert(...) at the moment */
+#endif
+
+#include <string.h>
+#include <assert.h>
+
+#include "expat.h"
+#include "common.h"
+#include "minicheck.h"
+#include "dummy.h"
+#include "handlers.h"
+#include "alloc_tests.h"
+
+static void
+alloc_setup(void) {
+ XML_Memory_Handling_Suite memsuite = {duff_allocator, duff_reallocator, free};
+
+ /* Ensure the parser creation will go through */
+ g_allocation_count = ALLOC_ALWAYS_SUCCEED;
+ g_reallocation_count = REALLOC_ALWAYS_SUCCEED;
+ g_parser = XML_ParserCreate_MM(NULL, &memsuite, NULL);
+ if (g_parser == NULL)
+ fail("Parser not created");
+}
+
+static void
+alloc_teardown(void) {
+ basic_teardown();
+}
+
+/* Test the effects of allocation failures on xml declaration processing */
+START_TEST(test_alloc_parse_xdecl) {
+ const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<doc>Hello, world</doc>";
+ int i;
+ const int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetXmlDeclHandler(g_parser, dummy_xdecl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* Resetting the parser is insufficient, because some memory
+ * allocations are cached within the parser. Instead we use
+ * the teardown and setup routines to ensure that we have the
+ * right sort of parser back in our hands.
+ */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed with max allocations");
+}
+END_TEST
+
+/* As above, but with an encoding big enough to cause storing the
+ * version information to expand the string pool being used.
+ */
+START_TEST(test_alloc_parse_xdecl_2) {
+ const char *text
+ = "<?xml version='1.0' encoding='"
+ /* Each line is 64 characters */
+ "ThisIsAStupidlyLongEncodingNameIntendedToTriggerPoolGrowth123456"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMN"
+ "'?>"
+ "<doc>Hello, world</doc>";
+ int i;
+ const int max_alloc_count = 20;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetXmlDeclHandler(g_parser, dummy_xdecl_handler);
+ XML_SetUnknownEncodingHandler(g_parser, long_encoding_handler, NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed with max allocations");
+}
+END_TEST
+
+/* Test the effects of allocation failures on a straightforward parse */
+START_TEST(test_alloc_parse_pi) {
+ const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<?pi unknown?>\n"
+ "<doc>"
+ "Hello, world"
+ "</doc>";
+ int i;
+ const int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed with max allocations");
+}
+END_TEST
+
+START_TEST(test_alloc_parse_pi_2) {
+ const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<doc>"
+ "Hello, world"
+ "<?pi unknown?>\n"
+ "</doc>";
+ int i;
+ const int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed with max allocations");
+}
+END_TEST
+
+START_TEST(test_alloc_parse_pi_3) {
+ const char *text
+ = "<?"
+ /* 64 characters per line */
+ "This processing instruction should be long enough to ensure that"
+ "it triggers the growth of an internal string pool when the "
+ "allocator fails at a cruicial moment FGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "Q?><doc/>";
+ int i;
+ const int max_alloc_count = 20;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed with max allocations");
+}
+END_TEST
+
+START_TEST(test_alloc_parse_comment) {
+ const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<!-- Test parsing this comment -->"
+ "<doc>Hi</doc>";
+ int i;
+ const int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetCommentHandler(g_parser, dummy_comment_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed with max allocations");
+}
+END_TEST
+
+START_TEST(test_alloc_parse_comment_2) {
+ const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<doc>"
+ "Hello, world"
+ "<!-- Parse this comment too -->"
+ "</doc>";
+ int i;
+ const int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetCommentHandler(g_parser, dummy_comment_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed with max allocations");
+}
+END_TEST
+
+/* Test that external parser creation running out of memory is
+ * correctly reported. Based on the external entity test cases.
+ */
+START_TEST(test_alloc_create_external_parser) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+ char foo_text[] = "<!ELEMENT doc (#PCDATA)*>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, foo_text);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_duff_loader);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR) {
+ fail("External parser allocator returned success incorrectly");
+ }
+}
+END_TEST
+
+/* More external parser memory allocation testing */
+START_TEST(test_alloc_run_external_parser) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+ char foo_text[] = "<!ELEMENT doc (#PCDATA)*>";
+ unsigned int i;
+ const unsigned int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, foo_text);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_null_loader);
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing ignored failing allocator");
+ else if (i == max_alloc_count)
+ fail("Parsing failed with allocation count 10");
+}
+END_TEST
+
+/* Test that running out of memory in dtdCopy is correctly reported.
+ * Based on test_default_ns_from_ext_subset_and_ext_ge()
+ */
+START_TEST(test_alloc_dtd_copy_default_atts) {
+ const char *text = "<?xml version='1.0'?>\n"
+ "<!DOCTYPE doc SYSTEM 'http://example.org/doc.dtd' [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/entity.ent'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/ns1'>\n"
+ "&en;\n"
+ "</doc>";
+ int callno = 0;
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_dbl_handler);
+ XML_SetUserData(g_parser, &callno);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test more external entity allocation failure paths */
+START_TEST(test_alloc_external_entity) {
+ const char *text = "<?xml version='1.0'?>\n"
+ "<!DOCTYPE doc SYSTEM 'http://example.org/doc.dtd' [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/entity.ent'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/ns1'>\n"
+ "&en;\n"
+ "</doc>";
+ int i;
+ const int alloc_test_max_repeats = 50;
+ int callno = 0;
+
+ for (i = 0; i < alloc_test_max_repeats; i++) {
+ g_allocation_count = -1;
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_dbl_handler_2);
+ callno = 0;
+ XML_SetUserData(g_parser, &callno);
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_OK)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ g_allocation_count = -1;
+ if (i == 0)
+ fail("External entity parsed despite duff allocator");
+ if (i == alloc_test_max_repeats)
+ fail("External entity not parsed at max allocation count");
+}
+END_TEST
+
+/* Test more allocation failure paths */
+START_TEST(test_alloc_ext_entity_set_encoding) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ int i;
+ const int max_allocation_count = 30;
+
+ for (i = 0; i < max_allocation_count; i++) {
+ XML_SetExternalEntityRefHandler(g_parser,
+ external_entity_alloc_set_encoding);
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_OK)
+ break;
+ g_allocation_count = -1;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Encoding check succeeded despite failing allocator");
+ if (i == max_allocation_count)
+ fail("Encoding failed at max allocation count");
+}
+END_TEST
+
+/* Test the effects of allocation failure in internal entities.
+ * Based on test_unknown_encoding_internal_entity
+ */
+START_TEST(test_alloc_internal_entity) {
+ const char *text = "<?xml version='1.0' encoding='unsupported-encoding'?>\n"
+ "<!DOCTYPE test [<!ENTITY foo 'bar'>]>\n"
+ "<test a='&foo;'/>";
+ unsigned int i;
+ const unsigned int max_alloc_count = 20;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetUnknownEncodingHandler(g_parser, unknown_released_encoding_handler,
+ NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Internal entity worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Internal entity failed at max allocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_parameter_entity) {
+ const char *text = "<!DOCTYPE foo ["
+ "<!ENTITY % param1 \"<!ENTITY internal 'some_text'>\">"
+ "%param1;"
+ "]> <foo>&internal;content</foo>";
+ int i;
+ const int alloc_test_max_repeats = 30;
+
+ for (i = 0; i < alloc_test_max_repeats; i++) {
+ g_allocation_count = i;
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ alloc_teardown();
+ alloc_setup();
+ }
+ g_allocation_count = -1;
+ if (i == 0)
+ fail("Parameter entity processed despite duff allocator");
+ if (i == alloc_test_max_repeats)
+ fail("Parameter entity not processed at max allocation count");
+}
+END_TEST
+
+/* Test the robustness against allocation failure of element handling
+ * Based on test_dtd_default_handling().
+ */
+START_TEST(test_alloc_dtd_default_handling) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ENTITY e SYSTEM 'http://example.org/e'>\n"
+ "<!NOTATION n SYSTEM 'http://example.org/n'>\n"
+ "<!ENTITY e1 SYSTEM 'http://example.org/e' NDATA n>\n"
+ "<!ELEMENT doc (#PCDATA)>\n"
+ "<!ATTLIST doc a CDATA #IMPLIED>\n"
+ "<?pi in dtd?>\n"
+ "<!--comment in dtd-->\n"
+ "]>\n"
+ "<doc><![CDATA[text in doc]]></doc>";
+ const XML_Char *expected = XCS("\n\n\n\n\n\n\n\n\n<doc>text in doc</doc>");
+ CharData storage;
+ int i;
+ const int max_alloc_count = 25;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ init_dummy_handlers();
+ XML_SetDefaultHandler(g_parser, accumulate_characters);
+ XML_SetDoctypeDeclHandler(g_parser, dummy_start_doctype_handler,
+ dummy_end_doctype_handler);
+ XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
+ XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
+ XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
+ XML_SetCommentHandler(g_parser, dummy_comment_handler);
+ XML_SetCdataSectionHandler(g_parser, dummy_start_cdata_handler,
+ dummy_end_cdata_handler);
+ XML_SetUnparsedEntityDeclHandler(g_parser,
+ dummy_unparsed_entity_decl_handler);
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Default DTD parsed despite allocation failures");
+ if (i == max_alloc_count)
+ fail("Default DTD not parsed with maximum alloc count");
+ CharData_CheckXMLChars(&storage, expected);
+ if (get_dummy_handler_flags()
+ != (DUMMY_START_DOCTYPE_HANDLER_FLAG | DUMMY_END_DOCTYPE_HANDLER_FLAG
+ | DUMMY_ENTITY_DECL_HANDLER_FLAG | DUMMY_NOTATION_DECL_HANDLER_FLAG
+ | DUMMY_ELEMENT_DECL_HANDLER_FLAG | DUMMY_ATTLIST_DECL_HANDLER_FLAG
+ | DUMMY_COMMENT_HANDLER_FLAG | DUMMY_PI_HANDLER_FLAG
+ | DUMMY_START_CDATA_HANDLER_FLAG | DUMMY_END_CDATA_HANDLER_FLAG
+ | DUMMY_UNPARSED_ENTITY_DECL_HANDLER_FLAG))
+ fail("Not all handlers were called");
+}
+END_TEST
+
+/* Test robustness of XML_SetEncoding() with a failing allocator */
+START_TEST(test_alloc_explicit_encoding) {
+ int i;
+ const int max_alloc_count = 5;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (XML_SetEncoding(g_parser, XCS("us-ascii")) == XML_STATUS_OK)
+ break;
+ }
+ if (i == 0)
+ fail("Encoding set despite failing allocator");
+ else if (i == max_alloc_count)
+ fail("Encoding not set at max allocation count");
+}
+END_TEST
+
+/* Test robustness of XML_SetBase against a failing allocator */
+START_TEST(test_alloc_set_base) {
+ const XML_Char *new_base = XCS("/local/file/name.xml");
+ int i;
+ const int max_alloc_count = 5;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (XML_SetBase(g_parser, new_base) == XML_STATUS_OK)
+ break;
+ }
+ if (i == 0)
+ fail("Base set despite failing allocator");
+ else if (i == max_alloc_count)
+ fail("Base not set with max allocation count");
+}
+END_TEST
+
+/* Test buffer extension in the face of a duff reallocator */
+START_TEST(test_alloc_realloc_buffer) {
+ const char *text = get_buffer_test_text;
+ void *buffer;
+ int i;
+ const int max_realloc_count = 10;
+
+ /* Get a smallish buffer */
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ buffer = XML_GetBuffer(g_parser, 1536);
+ if (buffer == NULL)
+ fail("1.5K buffer reallocation failed");
+ assert(buffer != NULL);
+ memcpy(buffer, text, strlen(text));
+ if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_FALSE)
+ == XML_STATUS_OK)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ g_reallocation_count = -1;
+ if (i == 0)
+ fail("Parse succeeded with no reallocation");
+ else if (i == max_realloc_count)
+ fail("Parse failed with max reallocation count");
+}
+END_TEST
+
+/* Same test for external entity parsers */
+START_TEST(test_alloc_ext_entity_realloc_buffer) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_reallocator);
+ XML_SetUserData(g_parser, &i);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_OK)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Succeeded with no reallocations");
+ if (i == max_realloc_count)
+ fail("Failed with max reallocations");
+}
+END_TEST
+
+/* Test elements with many attributes are handled correctly */
+START_TEST(test_alloc_realloc_many_attributes) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ATTLIST doc za CDATA 'default'>\n"
+ "<!ATTLIST doc zb CDATA 'def2'>\n"
+ "<!ATTLIST doc zc CDATA 'def3'>\n"
+ "]>\n"
+ "<doc a='1'"
+ " b='2'"
+ " c='3'"
+ " d='4'"
+ " e='5'"
+ " f='6'"
+ " g='7'"
+ " h='8'"
+ " i='9'"
+ " j='10'"
+ " k='11'"
+ " l='12'"
+ " m='13'"
+ " n='14'"
+ " p='15'"
+ " q='16'"
+ " r='17'"
+ " s='18'>"
+ "</doc>";
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite no reallocations");
+ if (i == max_realloc_count)
+ fail("Parse failed at max reallocations");
+}
+END_TEST
+
+/* Test handling of a public entity with failing allocator */
+START_TEST(test_alloc_public_entity_value) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
+ "<doc></doc>\n";
+ char dtd_text[]
+ = "<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % e1 PUBLIC 'foo' 'bar.ent'>\n"
+ "<!ENTITY % "
+ /* Each line is 64 characters */
+ "ThisIsAStupidlyLongParameterNameIntendedToTriggerPoolGrowth12345"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ " '%e1;'>\n"
+ "%e1;\n";
+ int i;
+ const int max_alloc_count = 50;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ init_dummy_handlers();
+ XML_SetUserData(g_parser, dtd_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_public);
+ /* Provoke a particular code path */
+ XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocation");
+ if (i == max_alloc_count)
+ fail("Parsing failed at max allocation count");
+ if (get_dummy_handler_flags() != DUMMY_ENTITY_DECL_HANDLER_FLAG)
+ fail("Entity declaration handler not called");
+}
+END_TEST
+
+START_TEST(test_alloc_realloc_subst_public_entity_value) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
+ "<doc></doc>\n";
+ char dtd_text[]
+ = "<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % "
+ /* Each line is 64 characters */
+ "ThisIsAStupidlyLongParameterNameIntendedToTriggerPoolGrowth12345"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ " PUBLIC 'foo' 'bar.ent'>\n"
+ "%ThisIsAStupidlyLongParameterNameIntendedToTriggerPoolGrowth12345"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP;";
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetUserData(g_parser, dtd_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_public);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocation");
+ if (i == max_realloc_count)
+ fail("Parsing failed at max reallocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_parse_public_doctype) {
+ const char *text
+ = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<!DOCTYPE doc PUBLIC '"
+ /* 64 characters per line */
+ "http://example.com/a/long/enough/name/to/trigger/pool/growth/zz/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "' 'test'>\n"
+ "<doc></doc>";
+ int i;
+ const int max_alloc_count = 25;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ init_dummy_handlers();
+ XML_SetDoctypeDeclHandler(g_parser, dummy_start_doctype_decl_handler,
+ dummy_end_doctype_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+ if (get_dummy_handler_flags()
+ != (DUMMY_START_DOCTYPE_DECL_HANDLER_FLAG
+ | DUMMY_END_DOCTYPE_DECL_HANDLER_FLAG))
+ fail("Doctype handler functions not called");
+}
+END_TEST
+
+START_TEST(test_alloc_parse_public_doctype_long_name) {
+ const char *text
+ = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<!DOCTYPE doc PUBLIC 'http://example.com/foo' '"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "'>\n"
+ "<doc></doc>";
+ int i;
+ const int max_alloc_count = 25;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetDoctypeDeclHandler(g_parser, dummy_start_doctype_decl_handler,
+ dummy_end_doctype_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+}
+END_TEST
+
+/* Test foreign DTD handling */
+START_TEST(test_alloc_set_foreign_dtd) {
+ const char *text1 = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<doc>&entity;</doc>";
+ char text2[] = "<!ELEMENT doc (#PCDATA)*>";
+ int i;
+ const int max_alloc_count = 25;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &text2);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
+ if (XML_UseForeignDTD(g_parser, XML_TRUE) != XML_ERROR_NONE)
+ fail("Could not set foreign DTD");
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+}
+END_TEST
+
+/* Test based on ibm/valid/P32/ibm32v04.xml */
+START_TEST(test_alloc_attribute_enum_value) {
+ const char *text = "<?xml version='1.0' standalone='no'?>\n"
+ "<!DOCTYPE animal SYSTEM 'test.dtd'>\n"
+ "<animal>This is a \n <a/> \n\nyellow tiger</animal>";
+ char dtd_text[] = "<!ELEMENT animal (#PCDATA|a)*>\n"
+ "<!ELEMENT a EMPTY>\n"
+ "<!ATTLIST animal xml:space (default|preserve) 'preserve'>";
+ int i;
+ const int max_alloc_count = 30;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
+ XML_SetUserData(g_parser, dtd_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ /* An attribute list handler provokes a different code path */
+ XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+}
+END_TEST
+
+/* Test attribute enums sufficient to overflow the string pool */
+START_TEST(test_alloc_realloc_attribute_enum_value) {
+ const char *text = "<?xml version='1.0' standalone='no'?>\n"
+ "<!DOCTYPE animal SYSTEM 'test.dtd'>\n"
+ "<animal>This is a yellow tiger</animal>";
+ /* We wish to define a collection of attribute enums that will
+ * cause the string pool storing them to have to expand. This
+ * means more than 1024 bytes, including the parentheses and
+ * separator bars.
+ */
+ char dtd_text[]
+ = "<!ELEMENT animal (#PCDATA)*>\n"
+ "<!ATTLIST animal thing "
+ "(default"
+ /* Each line is 64 characters */
+ "|ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|BBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|CBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|DBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|EBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|FBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|GBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|HBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|IBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|JBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|KBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|LBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|MBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|NBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|OBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|PBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO)"
+ " 'default'>";
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
+ XML_SetUserData(g_parser, dtd_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ /* An attribute list handler provokes a different code path */
+ XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_realloc_count)
+ fail("Parse failed at maximum reallocation count");
+}
+END_TEST
+
+/* Test attribute enums in a #IMPLIED attribute forcing pool growth */
+START_TEST(test_alloc_realloc_implied_attribute) {
+ /* Forcing this particular code path is a balancing act. The
+ * addition of the closing parenthesis and terminal NUL must be
+ * what pushes the string of enums over the 1024-byte limit,
+ * otherwise a different code path will pick up the realloc.
+ */
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc EMPTY>\n"
+ "<!ATTLIST doc a "
+ /* Each line is 64 characters */
+ "(ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|BBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|CBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|DBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|EBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|FBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|GBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|HBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|IBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|JBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|KBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|LBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|MBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|NBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|OBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|PBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMN)"
+ " #IMPLIED>\n"
+ "]><doc/>";
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_realloc_count)
+ fail("Parse failed at maximum reallocation count");
+}
+END_TEST
+
+/* Test attribute enums in a defaulted attribute forcing pool growth */
+START_TEST(test_alloc_realloc_default_attribute) {
+ /* Forcing this particular code path is a balancing act. The
+ * addition of the closing parenthesis and terminal NUL must be
+ * what pushes the string of enums over the 1024-byte limit,
+ * otherwise a different code path will pick up the realloc.
+ */
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc EMPTY>\n"
+ "<!ATTLIST doc a "
+ /* Each line is 64 characters */
+ "(ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|BBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|CBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|DBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|EBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|FBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|GBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|HBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|IBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|JBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|KBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|LBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|MBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|NBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|OBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ "|PBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMN)"
+ " 'ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO'"
+ ">\n]><doc/>";
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_realloc_count)
+ fail("Parse failed at maximum reallocation count");
+}
+END_TEST
+
+/* Test long notation name with dodgy allocator */
+START_TEST(test_alloc_notation) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ "<!NOTATION "
+ /* Each line is 64 characters */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ " SYSTEM 'http://example.org/n'>\n"
+ "<!ENTITY e SYSTEM 'http://example.org/e' NDATA "
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ ">\n"
+ "<!ELEMENT doc EMPTY>\n"
+ "]>\n<doc/>";
+ int i;
+ const int max_alloc_count = 20;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ init_dummy_handlers();
+ XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
+ XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite allocation failures");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+ if (get_dummy_handler_flags()
+ != (DUMMY_ENTITY_DECL_HANDLER_FLAG | DUMMY_NOTATION_DECL_HANDLER_FLAG))
+ fail("Entity declaration handler not called");
+}
+END_TEST
+
+/* Test public notation with dodgy allocator */
+START_TEST(test_alloc_public_notation) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ "<!NOTATION note PUBLIC '"
+ /* 64 characters per line */
+ "http://example.com/a/long/enough/name/to/trigger/pool/growth/zz/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "' 'foo'>\n"
+ "<!ENTITY e SYSTEM 'http://example.com/e' NDATA note>\n"
+ "<!ELEMENT doc EMPTY>\n"
+ "]>\n<doc/>";
+ int i;
+ const int max_alloc_count = 20;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ init_dummy_handlers();
+ XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite allocation failures");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+ if (get_dummy_handler_flags() != DUMMY_NOTATION_DECL_HANDLER_FLAG)
+ fail("Notation handler not called");
+}
+END_TEST
+
+/* Test public notation with dodgy allocator */
+START_TEST(test_alloc_system_notation) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ "<!NOTATION note SYSTEM '"
+ /* 64 characters per line */
+ "http://example.com/a/long/enough/name/to/trigger/pool/growth/zz/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "'>\n"
+ "<!ENTITY e SYSTEM 'http://example.com/e' NDATA note>\n"
+ "<!ELEMENT doc EMPTY>\n"
+ "]>\n<doc/>";
+ int i;
+ const int max_alloc_count = 20;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ init_dummy_handlers();
+ XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite allocation failures");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+ if (get_dummy_handler_flags() != DUMMY_NOTATION_DECL_HANDLER_FLAG)
+ fail("Notation handler not called");
+}
+END_TEST
+
+START_TEST(test_alloc_nested_groups) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc "
+ /* Sixteen elements per line */
+ "(e,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,"
+ "(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?"
+ "))))))))))))))))))))))))))))))))>\n"
+ "<!ELEMENT e EMPTY>"
+ "]>\n"
+ "<doc><e/></doc>";
+ CharData storage;
+ int i;
+ const int max_alloc_count = 20;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ CharData_Init(&storage);
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ XML_SetStartElementHandler(g_parser, record_element_start_handler);
+ XML_SetUserData(g_parser, &storage);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum reallocation count");
+ CharData_CheckXMLChars(&storage, XCS("doce"));
+ if (get_dummy_handler_flags() != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
+ fail("Element handler not fired");
+}
+END_TEST
+
+START_TEST(test_alloc_realloc_nested_groups) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc "
+ /* Sixteen elements per line */
+ "(e,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,"
+ "(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?"
+ "))))))))))))))))))))))))))))))))>\n"
+ "<!ELEMENT e EMPTY>"
+ "]>\n"
+ "<doc><e/></doc>";
+ CharData storage;
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ CharData_Init(&storage);
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ XML_SetStartElementHandler(g_parser, record_element_start_handler);
+ XML_SetUserData(g_parser, &storage);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_realloc_count)
+ fail("Parse failed at maximum reallocation count");
+ CharData_CheckXMLChars(&storage, XCS("doce"));
+ if (get_dummy_handler_flags() != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
+ fail("Element handler not fired");
+}
+END_TEST
+
+START_TEST(test_alloc_large_group) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc ("
+ "a1|a2|a3|a4|a5|a6|a7|a8|"
+ "b1|b2|b3|b4|b5|b6|b7|b8|"
+ "c1|c2|c3|c4|c5|c6|c7|c8|"
+ "d1|d2|d3|d4|d5|d6|d7|d8|"
+ "e1"
+ ")+>\n"
+ "]>\n"
+ "<doc>\n"
+ "<a1/>\n"
+ "</doc>\n";
+ int i;
+ const int max_alloc_count = 50;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+ if (get_dummy_handler_flags() != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
+ fail("Element handler flag not raised");
+}
+END_TEST
+
+START_TEST(test_alloc_realloc_group_choice) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc ("
+ "a1|a2|a3|a4|a5|a6|a7|a8|"
+ "b1|b2|b3|b4|b5|b6|b7|b8|"
+ "c1|c2|c3|c4|c5|c6|c7|c8|"
+ "d1|d2|d3|d4|d5|d6|d7|d8|"
+ "e1"
+ ")+>\n"
+ "]>\n"
+ "<doc>\n"
+ "<a1/>\n"
+ "<b2 attr='foo'>This is a foo</b2>\n"
+ "<c3></c3>\n"
+ "</doc>\n";
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_realloc_count)
+ fail("Parse failed at maximum reallocation count");
+ if (get_dummy_handler_flags() != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
+ fail("Element handler flag not raised");
+}
+END_TEST
+
+START_TEST(test_alloc_pi_in_epilog) {
+ const char *text = "<doc></doc>\n"
+ "<?pi in epilog?>";
+ int i;
+ const int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse completed despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+ if (get_dummy_handler_flags() != DUMMY_PI_HANDLER_FLAG)
+ fail("Processing instruction handler not invoked");
+}
+END_TEST
+
+START_TEST(test_alloc_comment_in_epilog) {
+ const char *text = "<doc></doc>\n"
+ "<!-- comment in epilog -->";
+ int i;
+ const int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetCommentHandler(g_parser, dummy_comment_handler);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse completed despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+ if (get_dummy_handler_flags() != DUMMY_COMMENT_HANDLER_FLAG)
+ fail("Processing instruction handler not invoked");
+}
+END_TEST
+
+START_TEST(test_alloc_realloc_long_attribute_value) {
+ const char *text
+ = "<!DOCTYPE doc [<!ENTITY foo '"
+ /* Each line is 64 characters */
+ "This entity will be substituted as an attribute value, and is "
+ "calculated to be exactly long enough that the terminating NUL "
+ "that the library adds internally will trigger the string pool to"
+ "grow. GHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "'>]>\n"
+ "<doc a='&foo;'></doc>";
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_realloc_count)
+ fail("Parse failed at maximum reallocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_attribute_whitespace) {
+ const char *text = "<doc a=' '></doc>";
+ int i;
+ const int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_attribute_predefined_entity) {
+ const char *text = "<doc a='&amp;'></doc>";
+ int i;
+ const int max_alloc_count = 15;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+}
+END_TEST
+
+/* Test that a character reference at the end of a suitably long
+ * default value for an attribute can trigger pool growth, and recovers
+ * if the allocator fails on it.
+ */
+START_TEST(test_alloc_long_attr_default_with_char_ref) {
+ const char *text
+ = "<!DOCTYPE doc [<!ATTLIST doc a CDATA '"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHI"
+ "&#x31;'>]>\n"
+ "<doc/>";
+ int i;
+ const int max_alloc_count = 20;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+}
+END_TEST
+
+/* Test that a long character reference substitution triggers a pool
+ * expansion correctly for an attribute value.
+ */
+START_TEST(test_alloc_long_attr_value) {
+ const char *text
+ = "<!DOCTYPE test [<!ENTITY foo '\n"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "'>]>\n"
+ "<test a='&foo;'/>";
+ int i;
+ const int max_alloc_count = 25;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing allocator");
+ if (i == max_alloc_count)
+ fail("Parse failed at maximum allocation count");
+}
+END_TEST
+
+/* Test that an error in a nested parameter entity substitution is
+ * handled correctly. It seems unlikely that the code path being
+ * exercised can be reached purely by carefully crafted XML, but an
+ * allocation error in the right place will definitely do it.
+ */
+START_TEST(test_alloc_nested_entities) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/one.ent'>\n"
+ "<doc />";
+ ExtFaults test_data
+ = {"<!ENTITY % pe1 '"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "'>\n"
+ "<!ENTITY % pe2 '%pe1;'>\n"
+ "<!ENTITY % pe3 '%pe2;'>",
+ "Memory Fail not faulted", NULL, XML_ERROR_NO_MEMORY};
+
+ /* Causes an allocation error in a nested storeEntityValue() */
+ g_allocation_count = 12;
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Entity allocation failure not noted");
+}
+END_TEST
+
+START_TEST(test_alloc_realloc_param_entity_newline) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
+ "<doc/>";
+ char dtd_text[]
+ = "<!ENTITY % pe '<!ATTLIST doc att CDATA \""
+ /* 64 characters per line */
+ "This default value is carefully crafted so that the carriage "
+ "return right at the end of the entity string causes an internal "
+ "string pool to have to grow. This allows us to test the alloc "
+ "failure path from that point. OPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDE"
+ "\">\n'>"
+ "%pe;\n";
+ int i;
+ const int max_realloc_count = 5;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetUserData(g_parser, dtd_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_realloc_count)
+ fail("Parse failed at maximum reallocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_realloc_ce_extends_pe) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
+ "<doc/>";
+ char dtd_text[]
+ = "<!ENTITY % pe '<!ATTLIST doc att CDATA \""
+ /* 64 characters per line */
+ "This default value is carefully crafted so that the character "
+ "entity at the end causes an internal string pool to have to "
+ "grow. This allows us to test the allocation failure path from "
+ "that point onwards. EFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFG&#x51;"
+ "\">\n'>"
+ "%pe;\n";
+ int i;
+ const int max_realloc_count = 5;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetUserData(g_parser, dtd_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_realloc_count)
+ fail("Parse failed at maximum reallocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_realloc_attributes) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ATTLIST doc\n"
+ " a1 (a|b|c) 'a'\n"
+ " a2 (foo|bar) #IMPLIED\n"
+ " a3 NMTOKEN #IMPLIED\n"
+ " a4 NMTOKENS #IMPLIED\n"
+ " a5 ID #IMPLIED\n"
+ " a6 IDREF #IMPLIED\n"
+ " a7 IDREFS #IMPLIED\n"
+ " a8 ENTITY #IMPLIED\n"
+ " a9 ENTITIES #IMPLIED\n"
+ " a10 CDATA #IMPLIED\n"
+ " >]>\n"
+ "<doc>wombat</doc>\n";
+ int i;
+ const int max_realloc_count = 5;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+
+ if (i == 0)
+ fail("Parse succeeded despite failing reallocator");
+ if (i == max_realloc_count)
+ fail("Parse failed at maximum reallocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_long_doc_name) {
+ const char *text =
+ /* 64 characters per line */
+ "<LongRootElementNameThatWillCauseTheNextAllocationToExpandTheStr"
+ "ingPoolForTheDTDQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ " a='1'/>";
+ int i;
+ const int max_alloc_count = 20;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max reallocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_long_base) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY e SYSTEM 'foo'>\n"
+ "]>\n"
+ "<doc>&e;</doc>";
+ char entity_text[] = "Hello world";
+ const XML_Char *base =
+ /* 64 characters per line */
+ /* clang-format off */
+ XCS("LongBaseURI/that/will/overflow/an/internal/buffer/and/cause/it/t")
+ XCS("o/have/to/grow/PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/");
+ /* clang-format on */
+ int i;
+ const int max_alloc_count = 25;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetUserData(g_parser, entity_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
+ if (XML_SetBase(g_parser, base) == XML_STATUS_ERROR) {
+ XML_ParserReset(g_parser, NULL);
+ continue;
+ }
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_long_public_id) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ " <!ENTITY e PUBLIC '"
+ /* 64 characters per line */
+ "LongPublicIDThatShouldResultInAnInternalStringPoolGrowingAtASpec"
+ "ificMomentKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "' 'bar'>\n"
+ "]>\n"
+ "<doc>&e;</doc>";
+ char entity_text[] = "Hello world";
+ int i;
+ const int max_alloc_count = 40;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetUserData(g_parser, entity_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_long_entity_value) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ " <!ENTITY e1 '"
+ /* 64 characters per line */
+ "Long entity value that should provoke a string pool to grow whil"
+ "e setting up to parse the external entity below. xyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "'>\n"
+ " <!ENTITY e2 SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc>&e2;</doc>";
+ char entity_text[] = "Hello world";
+ int i;
+ const int max_alloc_count = 40;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetUserData(g_parser, entity_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_long_notation) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ " <!NOTATION note SYSTEM '"
+ /* 64 characters per line */
+ "ALongNotationNameThatShouldProvokeStringPoolGrowthWhileCallingAn"
+ "ExternalEntityParserUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "'>\n"
+ " <!ENTITY e1 SYSTEM 'foo' NDATA "
+ /* 64 characters per line */
+ "ALongNotationNameThatShouldProvokeStringPoolGrowthWhileCallingAn"
+ "ExternalEntityParserUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
+ ">\n"
+ " <!ENTITY e2 SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc>&e2;</doc>";
+ ExtOption options[]
+ = {{XCS("foo"), "Entity Foo"}, {XCS("bar"), "Entity Bar"}, {NULL, NULL}};
+ int i;
+ const int max_alloc_count = 40;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetUserData(g_parser, options);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+
+ /* See comment in test_alloc_parse_xdecl() */
+ alloc_teardown();
+ alloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+START_TEST(test_alloc_reset_after_external_entity_parser_create_fail) {
+ const char *const text = "<!DOCTYPE doc SYSTEM 'foo'><doc/>";
+
+ XML_SetExternalEntityRefHandler(
+ g_parser, external_entity_parser_create_alloc_fail_handler);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Call to parse was expected to fail");
+
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_EXTERNAL_ENTITY_HANDLING)
+ fail("Call to parse was expected to fail from the external entity handler");
+
+ XML_ParserReset(g_parser, NULL);
+}
+END_TEST
+
+void
+make_alloc_test_case(Suite *s) {
+ TCase *tc_alloc = tcase_create("allocation tests");
+
+ suite_add_tcase(s, tc_alloc);
+ tcase_add_checked_fixture(tc_alloc, alloc_setup, alloc_teardown);
+
+ tcase_add_test(tc_alloc, test_alloc_parse_xdecl);
+ tcase_add_test(tc_alloc, test_alloc_parse_xdecl_2);
+ tcase_add_test(tc_alloc, test_alloc_parse_pi);
+ tcase_add_test(tc_alloc, test_alloc_parse_pi_2);
+ tcase_add_test(tc_alloc, test_alloc_parse_pi_3);
+ tcase_add_test(tc_alloc, test_alloc_parse_comment);
+ tcase_add_test(tc_alloc, test_alloc_parse_comment_2);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_create_external_parser);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_run_external_parser);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_dtd_copy_default_atts);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_external_entity);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_ext_entity_set_encoding);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_internal_entity);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_parameter_entity);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_dtd_default_handling);
+ tcase_add_test(tc_alloc, test_alloc_explicit_encoding);
+ tcase_add_test(tc_alloc, test_alloc_set_base);
+ tcase_add_test(tc_alloc, test_alloc_realloc_buffer);
+ tcase_add_test__if_xml_ge(tc_alloc, test_alloc_ext_entity_realloc_buffer);
+ tcase_add_test(tc_alloc, test_alloc_realloc_many_attributes);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_public_entity_value);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc,
+ test_alloc_realloc_subst_public_entity_value);
+ tcase_add_test(tc_alloc, test_alloc_parse_public_doctype);
+ tcase_add_test(tc_alloc, test_alloc_parse_public_doctype_long_name);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_set_foreign_dtd);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_attribute_enum_value);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc,
+ test_alloc_realloc_attribute_enum_value);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_implied_attribute);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_default_attribute);
+ tcase_add_test__if_xml_ge(tc_alloc, test_alloc_notation);
+ tcase_add_test(tc_alloc, test_alloc_public_notation);
+ tcase_add_test(tc_alloc, test_alloc_system_notation);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_nested_groups);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_nested_groups);
+ tcase_add_test(tc_alloc, test_alloc_large_group);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_group_choice);
+ tcase_add_test(tc_alloc, test_alloc_pi_in_epilog);
+ tcase_add_test(tc_alloc, test_alloc_comment_in_epilog);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc,
+ test_alloc_realloc_long_attribute_value);
+ tcase_add_test(tc_alloc, test_alloc_attribute_whitespace);
+ tcase_add_test(tc_alloc, test_alloc_attribute_predefined_entity);
+ tcase_add_test(tc_alloc, test_alloc_long_attr_default_with_char_ref);
+ tcase_add_test__if_xml_ge(tc_alloc, test_alloc_long_attr_value);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_nested_entities);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc,
+ test_alloc_realloc_param_entity_newline);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_ce_extends_pe);
+ tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_attributes);
+ tcase_add_test(tc_alloc, test_alloc_long_doc_name);
+ tcase_add_test__if_xml_ge(tc_alloc, test_alloc_long_base);
+ tcase_add_test__if_xml_ge(tc_alloc, test_alloc_long_public_id);
+ tcase_add_test__if_xml_ge(tc_alloc, test_alloc_long_entity_value);
+ tcase_add_test__if_xml_ge(tc_alloc, test_alloc_long_notation);
+
+ tcase_add_test__ifdef_xml_dtd(
+ tc_alloc, test_alloc_reset_after_external_entity_parser_create_fail);
+}
diff --git a/3rdparty/expat/tests/alloc_tests.h b/3rdparty/expat/tests/alloc_tests.h
new file mode 100644
index 00000000000..1eae130be78
--- /dev/null
+++ b/3rdparty/expat/tests/alloc_tests.h
@@ -0,0 +1,56 @@
+/* Tests in the "allocation" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef XML_ALLOC_TESTS_H
+# define XML_ALLOC_TESTS_H
+
+extern void make_alloc_test_case(Suite *s);
+
+#endif /* XML_ALLOC_TESTS_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/expat/tests/alloc_tests_cxx.cpp b/3rdparty/expat/tests/alloc_tests_cxx.cpp
new file mode 100644
index 00000000000..3270b1a6c98
--- /dev/null
+++ b/3rdparty/expat/tests/alloc_tests_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "alloc_tests.c"
diff --git a/3rdparty/expat/tests/basic_tests.c b/3rdparty/expat/tests/basic_tests.c
new file mode 100644
index 00000000000..e813df8b6fd
--- /dev/null
+++ b/3rdparty/expat/tests/basic_tests.c
@@ -0,0 +1,6472 @@
+/* Tests in the "basic" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Copyright (c) 2024-2025 Berkay Eren Ürün <berkay.ueruen@siemens.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#if defined(NDEBUG)
+# undef NDEBUG /* because test suite relies on assert(...) at the moment */
+#endif
+
+#include <assert.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#if ! defined(__cplusplus)
+# include <stdbool.h>
+#endif
+
+#include "expat_config.h"
+
+#include "expat.h"
+#include "internal.h"
+#include "minicheck.h"
+#include "structdata.h"
+#include "common.h"
+#include "dummy.h"
+#include "handlers.h"
+#include "siphash.h"
+#include "basic_tests.h"
+
+static void
+basic_setup(void) {
+ g_parser = XML_ParserCreate(NULL);
+ if (g_parser == NULL)
+ fail("Parser not created.");
+}
+
+/*
+ * Character & encoding tests.
+ */
+
+START_TEST(test_nul_byte) {
+ char text[] = "<doc>\0</doc>";
+
+ /* test that a NUL byte (in US-ASCII data) is an error */
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_OK)
+ fail("Parser did not report error on NUL-byte.");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_u0000_char) {
+ /* test that a NUL byte (in US-ASCII data) is an error */
+ expect_failure("<doc>&#0;</doc>", XML_ERROR_BAD_CHAR_REF,
+ "Parser did not report error on NUL-byte.");
+}
+END_TEST
+
+START_TEST(test_siphash_self) {
+ if (! sip24_valid())
+ fail("SipHash self-test failed");
+}
+END_TEST
+
+START_TEST(test_siphash_spec) {
+ /* https://131002.net/siphash/siphash.pdf (page 19, "Test values") */
+ const char message[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09"
+ "\x0a\x0b\x0c\x0d\x0e";
+ const size_t len = sizeof(message) - 1;
+ const uint64_t expected = SIP_ULL(0xa129ca61U, 0x49be45e5U);
+ struct siphash state;
+ struct sipkey key;
+
+ sip_tokey(&key, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09"
+ "\x0a\x0b\x0c\x0d\x0e\x0f");
+ sip24_init(&state, &key);
+
+ /* Cover spread across calls */
+ sip24_update(&state, message, 4);
+ sip24_update(&state, message + 4, len - 4);
+
+ /* Cover null length */
+ sip24_update(&state, message, 0);
+
+ if (sip24_final(&state) != expected)
+ fail("sip24_final failed spec test\n");
+
+ /* Cover wrapper */
+ if (siphash24(message, len, &key) != expected)
+ fail("siphash24 failed spec test\n");
+}
+END_TEST
+
+START_TEST(test_bom_utf8) {
+ /* This test is really just making sure we don't core on a UTF-8 BOM. */
+ const char *text = "\357\273\277<e/>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_bom_utf16_be) {
+ char text[] = "\376\377\0<\0e\0/\0>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_bom_utf16_le) {
+ char text[] = "\377\376<\0e\0/\0>\0";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_nobom_utf16_le) {
+ char text[] = " \0<\0e\0/\0>\0";
+
+ if (g_chunkSize == 1) {
+ // TODO: with just the first byte, we can't tell the difference between
+ // UTF-16-LE and UTF-8. Avoid the failure for now.
+ return;
+ }
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_hash_collision) {
+ /* For full coverage of the lookup routine, we need to ensure a
+ * hash collision even though we can only tell that we have one
+ * through breakpoint debugging or coverage statistics. The
+ * following will cause a hash collision on machines with a 64-bit
+ * long type; others will have to experiment. The full coverage
+ * tests invoked from qa.sh usually provide a hash collision, but
+ * not always. This is an attempt to provide insurance.
+ */
+#define COLLIDING_HASH_SALT (unsigned long)SIP_ULL(0xffffffffU, 0xff99fc90U)
+ const char *text
+ = "<doc>\n"
+ "<a1/><a2/><a3/><a4/><a5/><a6/><a7/><a8/>\n"
+ "<b1></b1><b2 attr='foo'>This is a foo</b2><b3></b3><b4></b4>\n"
+ "<b5></b5><b6></b6><b7></b7><b8></b8>\n"
+ "<c1/><c2/><c3/><c4/><c5/><c6/><c7/><c8/>\n"
+ "<d1/><d2/><d3/><d4/><d5/><d6/><d7/>\n"
+ "<d8>This triggers the table growth and collides with b2</d8>\n"
+ "</doc>\n";
+
+ XML_SetHashSalt(g_parser, COLLIDING_HASH_SALT);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+#undef COLLIDING_HASH_SALT
+
+/* Regression test for SF bug #491986. */
+START_TEST(test_danish_latin1) {
+ const char *text = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
+ "<e>J\xF8rgen \xE6\xF8\xE5\xC6\xD8\xC5</e>";
+#ifdef XML_UNICODE
+ const XML_Char *expected
+ = XCS("J\x00f8rgen \x00e6\x00f8\x00e5\x00c6\x00d8\x00c5");
+#else
+ const XML_Char *expected
+ = XCS("J\xC3\xB8rgen \xC3\xA6\xC3\xB8\xC3\xA5\xC3\x86\xC3\x98\xC3\x85");
+#endif
+ run_character_check(text, expected);
+}
+END_TEST
+
+/* Regression test for SF bug #514281. */
+START_TEST(test_french_charref_hexidecimal) {
+ const char *text = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
+ "<doc>&#xE9;&#xE8;&#xE0;&#xE7;&#xEA;&#xC8;</doc>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00e9\x00e8\x00e0\x00e7\x00ea\x00c8");
+#else
+ const XML_Char *expected
+ = XCS("\xC3\xA9\xC3\xA8\xC3\xA0\xC3\xA7\xC3\xAA\xC3\x88");
+#endif
+ run_character_check(text, expected);
+}
+END_TEST
+
+START_TEST(test_french_charref_decimal) {
+ const char *text = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
+ "<doc>&#233;&#232;&#224;&#231;&#234;&#200;</doc>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00e9\x00e8\x00e0\x00e7\x00ea\x00c8");
+#else
+ const XML_Char *expected
+ = XCS("\xC3\xA9\xC3\xA8\xC3\xA0\xC3\xA7\xC3\xAA\xC3\x88");
+#endif
+ run_character_check(text, expected);
+}
+END_TEST
+
+START_TEST(test_french_latin1) {
+ const char *text = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
+ "<doc>\xE9\xE8\xE0\xE7\xEa\xC8</doc>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00e9\x00e8\x00e0\x00e7\x00ea\x00c8");
+#else
+ const XML_Char *expected
+ = XCS("\xC3\xA9\xC3\xA8\xC3\xA0\xC3\xA7\xC3\xAA\xC3\x88");
+#endif
+ run_character_check(text, expected);
+}
+END_TEST
+
+START_TEST(test_french_utf8) {
+ const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<doc>\xC3\xA9</doc>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00e9");
+#else
+ const XML_Char *expected = XCS("\xC3\xA9");
+#endif
+ run_character_check(text, expected);
+}
+END_TEST
+
+/* Regression test for SF bug #600479.
+ XXX There should be a test that exercises all legal XML Unicode
+ characters as PCDATA and attribute value content, and XML Name
+ characters as part of element and attribute names.
+*/
+START_TEST(test_utf8_false_rejection) {
+ const char *text = "<doc>\xEF\xBA\xBF</doc>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\xfebf");
+#else
+ const XML_Char *expected = XCS("\xEF\xBA\xBF");
+#endif
+ run_character_check(text, expected);
+}
+END_TEST
+
+/* Regression test for SF bug #477667.
+ This test assures that any 8-bit character followed by a 7-bit
+ character will not be mistakenly interpreted as a valid UTF-8
+ sequence.
+*/
+START_TEST(test_illegal_utf8) {
+ char text[100];
+ int i;
+
+ for (i = 128; i <= 255; ++i) {
+ snprintf(text, sizeof(text), "<e>%ccd</e>", i);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_OK) {
+ snprintf(text, sizeof(text),
+ "expected token error for '%c' (ordinal %d) in UTF-8 text", i,
+ i);
+ fail(text);
+ } else if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
+ xml_failure(g_parser);
+ /* Reset the parser since we use the same parser repeatedly. */
+ XML_ParserReset(g_parser, NULL);
+ }
+}
+END_TEST
+
+/* Examples, not masks: */
+#define UTF8_LEAD_1 "\x7f" /* 0b01111111 */
+#define UTF8_LEAD_2 "\xdf" /* 0b11011111 */
+#define UTF8_LEAD_3 "\xef" /* 0b11101111 */
+#define UTF8_LEAD_4 "\xf7" /* 0b11110111 */
+#define UTF8_FOLLOW "\xbf" /* 0b10111111 */
+
+START_TEST(test_utf8_auto_align) {
+ struct TestCase {
+ ptrdiff_t expectedMovementInChars;
+ const char *input;
+ };
+
+ struct TestCase cases[] = {
+ {00, ""},
+
+ {00, UTF8_LEAD_1},
+
+ {-1, UTF8_LEAD_2},
+ {00, UTF8_LEAD_2 UTF8_FOLLOW},
+
+ {-1, UTF8_LEAD_3},
+ {-2, UTF8_LEAD_3 UTF8_FOLLOW},
+ {00, UTF8_LEAD_3 UTF8_FOLLOW UTF8_FOLLOW},
+
+ {-1, UTF8_LEAD_4},
+ {-2, UTF8_LEAD_4 UTF8_FOLLOW},
+ {-3, UTF8_LEAD_4 UTF8_FOLLOW UTF8_FOLLOW},
+ {00, UTF8_LEAD_4 UTF8_FOLLOW UTF8_FOLLOW UTF8_FOLLOW},
+ };
+
+ size_t i = 0;
+ bool success = true;
+ for (; i < sizeof(cases) / sizeof(*cases); i++) {
+ const char *fromLim = cases[i].input + strlen(cases[i].input);
+ const char *const fromLimInitially = fromLim;
+ ptrdiff_t actualMovementInChars;
+
+ _INTERNAL_trim_to_complete_utf8_characters(cases[i].input, &fromLim);
+
+ actualMovementInChars = (fromLim - fromLimInitially);
+ if (actualMovementInChars != cases[i].expectedMovementInChars) {
+ size_t j = 0;
+ success = false;
+ printf("[-] UTF-8 case %2u: Expected movement by %2d chars"
+ ", actually moved by %2d chars: \"",
+ (unsigned)(i + 1), (int)cases[i].expectedMovementInChars,
+ (int)actualMovementInChars);
+ for (; j < strlen(cases[i].input); j++) {
+ printf("\\x%02x", (unsigned char)cases[i].input[j]);
+ }
+ printf("\"\n");
+ }
+ }
+
+ if (! success) {
+ fail("UTF-8 auto-alignment is not bullet-proof\n");
+ }
+}
+END_TEST
+
+START_TEST(test_utf16) {
+ /* <?xml version="1.0" encoding="UTF-16"?>
+ * <doc a='123'>some {A} text</doc>
+ *
+ * where {A} is U+FF21, FULLWIDTH LATIN CAPITAL LETTER A
+ */
+ char text[]
+ = "\000<\000?\000x\000m\000\154\000 \000v\000e\000r\000s\000i\000o"
+ "\000n\000=\000'\0001\000.\000\060\000'\000 \000e\000n\000c\000o"
+ "\000d\000i\000n\000g\000=\000'\000U\000T\000F\000-\0001\000\066"
+ "\000'\000?\000>\000\n"
+ "\000<\000d\000o\000c\000 \000a\000=\000'\0001\0002\0003\000'\000>"
+ "\000s\000o\000m\000e\000 \xff\x21\000 \000t\000e\000x\000t\000"
+ "<\000/\000d\000o\000c\000>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("some \xff21 text");
+#else
+ const XML_Char *expected = XCS("some \357\274\241 text");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_utf16_le_epilog_newline) {
+ unsigned int first_chunk_bytes = 17;
+ char text[] = "\xFF\xFE" /* BOM */
+ "<\000e\000/\000>\000" /* document element */
+ "\r\000\n\000\r\000\n\000"; /* epilog */
+
+ if (first_chunk_bytes >= sizeof(text) - 1)
+ fail("bad value of first_chunk_bytes");
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, first_chunk_bytes, XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ else {
+ enum XML_Status rc;
+ rc = _XML_Parse_SINGLE_BYTES(g_parser, text + first_chunk_bytes,
+ sizeof(text) - first_chunk_bytes - 1,
+ XML_TRUE);
+ if (rc == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ }
+}
+END_TEST
+
+/* Test that an outright lie in the encoding is faulted */
+START_TEST(test_not_utf16) {
+ const char *text = "<?xml version='1.0' encoding='utf-16'?>"
+ "<doc>Hi</doc>";
+
+ /* Use a handler to provoke the appropriate code paths */
+ XML_SetXmlDeclHandler(g_parser, dummy_xdecl_handler);
+ expect_failure(text, XML_ERROR_INCORRECT_ENCODING,
+ "UTF-16 declared in UTF-8 not faulted");
+}
+END_TEST
+
+/* Test that an unknown encoding is rejected */
+START_TEST(test_bad_encoding) {
+ const char *text = "<doc>Hi</doc>";
+
+ if (! XML_SetEncoding(g_parser, XCS("unknown-encoding")))
+ fail("XML_SetEncoding failed");
+ expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
+ "Unknown encoding not faulted");
+}
+END_TEST
+
+/* Regression test for SF bug #481609, #774028. */
+START_TEST(test_latin1_umlauts) {
+ const char *text
+ = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
+ "<e a='\xE4 \xF6 \xFC &#228; &#246; &#252; &#x00E4; &#x0F6; &#xFC; >'\n"
+ " >\xE4 \xF6 \xFC &#228; &#246; &#252; &#x00E4; &#x0F6; &#xFC; ></e>";
+#ifdef XML_UNICODE
+ /* Expected results in UTF-16 */
+ const XML_Char *expected = XCS("\x00e4 \x00f6 \x00fc ")
+ XCS("\x00e4 \x00f6 \x00fc ") XCS("\x00e4 \x00f6 \x00fc >");
+#else
+ /* Expected results in UTF-8 */
+ const XML_Char *expected = XCS("\xC3\xA4 \xC3\xB6 \xC3\xBC ")
+ XCS("\xC3\xA4 \xC3\xB6 \xC3\xBC ") XCS("\xC3\xA4 \xC3\xB6 \xC3\xBC >");
+#endif
+
+ run_character_check(text, expected);
+ XML_ParserReset(g_parser, NULL);
+ run_attribute_check(text, expected);
+ /* Repeat with a default handler */
+ XML_ParserReset(g_parser, NULL);
+ XML_SetDefaultHandler(g_parser, dummy_default_handler);
+ run_character_check(text, expected);
+ XML_ParserReset(g_parser, NULL);
+ XML_SetDefaultHandler(g_parser, dummy_default_handler);
+ run_attribute_check(text, expected);
+}
+END_TEST
+
+/* Test that an element name with a 4-byte UTF-8 character is rejected */
+START_TEST(test_long_utf8_character) {
+ const char *text
+ = "<?xml version='1.0' encoding='utf-8'?>\n"
+ /* 0xf0 0x90 0x80 0x80 = U+10000, the first Linear B character */
+ "<do\xf0\x90\x80\x80/>";
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "4-byte UTF-8 character in element name not faulted");
+}
+END_TEST
+
+/* Test that a long latin-1 attribute (too long to convert in one go)
+ * is correctly converted
+ */
+START_TEST(test_long_latin1_attribute) {
+ const char *text
+ = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
+ "<doc att='"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
+ /* Last character splits across a buffer boundary */
+ "\xe4'>\n</doc>";
+
+ const XML_Char *expected =
+ /* 64 characters per line */
+ /* clang-format off */
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO")
+ /* clang-format on */
+#ifdef XML_UNICODE
+ XCS("\x00e4");
+#else
+ XCS("\xc3\xa4");
+#endif
+
+ run_attribute_check(text, expected);
+}
+END_TEST
+
+/* Test that a long ASCII attribute (too long to convert in one go)
+ * is correctly converted
+ */
+START_TEST(test_long_ascii_attribute) {
+ const char *text
+ = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<doc att='"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "01234'>\n</doc>";
+ const XML_Char *expected =
+ /* 64 characters per line */
+ /* clang-format off */
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("01234");
+ /* clang-format on */
+
+ run_attribute_check(text, expected);
+}
+END_TEST
+
+/* Regression test #1 for SF bug #653180. */
+START_TEST(test_line_number_after_parse) {
+ const char *text = "<tag>\n"
+ "\n"
+ "\n</tag>";
+ XML_Size lineno;
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ lineno = XML_GetCurrentLineNumber(g_parser);
+ if (lineno != 4) {
+ char buffer[100];
+ snprintf(buffer, sizeof(buffer),
+ "expected 4 lines, saw %" XML_FMT_INT_MOD "u", lineno);
+ fail(buffer);
+ }
+}
+END_TEST
+
+/* Regression test #2 for SF bug #653180. */
+START_TEST(test_column_number_after_parse) {
+ const char *text = "<tag></tag>";
+ XML_Size colno;
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ colno = XML_GetCurrentColumnNumber(g_parser);
+ if (colno != 11) {
+ char buffer[100];
+ snprintf(buffer, sizeof(buffer),
+ "expected 11 columns, saw %" XML_FMT_INT_MOD "u", colno);
+ fail(buffer);
+ }
+}
+END_TEST
+
+/* Regression test #3 for SF bug #653180. */
+START_TEST(test_line_and_column_numbers_inside_handlers) {
+ const char *text = "<a>\n" /* Unix end-of-line */
+ " <b>\r\n" /* Windows end-of-line */
+ " <c/>\r" /* Mac OS end-of-line */
+ " </b>\n"
+ " <d>\n"
+ " <f/>\n"
+ " </d>\n"
+ "</a>";
+ const StructDataEntry expected[]
+ = {{XCS("a"), 0, 1, STRUCT_START_TAG}, {XCS("b"), 2, 2, STRUCT_START_TAG},
+ {XCS("c"), 4, 3, STRUCT_START_TAG}, {XCS("c"), 8, 3, STRUCT_END_TAG},
+ {XCS("b"), 2, 4, STRUCT_END_TAG}, {XCS("d"), 2, 5, STRUCT_START_TAG},
+ {XCS("f"), 4, 6, STRUCT_START_TAG}, {XCS("f"), 8, 6, STRUCT_END_TAG},
+ {XCS("d"), 2, 7, STRUCT_END_TAG}, {XCS("a"), 0, 8, STRUCT_END_TAG}};
+ const int expected_count = sizeof(expected) / sizeof(StructDataEntry);
+ StructData storage;
+
+ StructData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetStartElementHandler(g_parser, start_element_event_handler2);
+ XML_SetEndElementHandler(g_parser, end_element_event_handler2);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+
+ StructData_CheckItems(&storage, expected, expected_count);
+ StructData_Dispose(&storage);
+}
+END_TEST
+
+/* Regression test #4 for SF bug #653180. */
+START_TEST(test_line_number_after_error) {
+ const char *text = "<a>\n"
+ " <b>\n"
+ " </a>"; /* missing </b> */
+ XML_Size lineno;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Expected a parse error");
+
+ lineno = XML_GetCurrentLineNumber(g_parser);
+ if (lineno != 3) {
+ char buffer[100];
+ snprintf(buffer, sizeof(buffer),
+ "expected 3 lines, saw %" XML_FMT_INT_MOD "u", lineno);
+ fail(buffer);
+ }
+}
+END_TEST
+
+/* Regression test #5 for SF bug #653180. */
+START_TEST(test_column_number_after_error) {
+ const char *text = "<a>\n"
+ " <b>\n"
+ " </a>"; /* missing </b> */
+ XML_Size colno;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Expected a parse error");
+
+ colno = XML_GetCurrentColumnNumber(g_parser);
+ if (colno != 4) {
+ char buffer[100];
+ snprintf(buffer, sizeof(buffer),
+ "expected 4 columns, saw %" XML_FMT_INT_MOD "u", colno);
+ fail(buffer);
+ }
+}
+END_TEST
+
+/* Regression test for SF bug #478332. */
+START_TEST(test_really_long_lines) {
+ /* This parses an input line longer than INIT_DATA_BUF_SIZE
+ characters long (defined to be 1024 in xmlparse.c). We take a
+ really cheesy approach to building the input buffer, because
+ this avoids writing bugs in buffer-filling code.
+ */
+ const char *text
+ = "<e>"
+ /* 64 chars */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ /* until we have at least 1024 characters on the line: */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "</e>";
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test cdata processing across a buffer boundary */
+START_TEST(test_really_long_encoded_lines) {
+ /* As above, except that we want to provoke an output buffer
+ * overflow with a non-trivial encoding. For this we need to pass
+ * the whole cdata in one go, not byte-by-byte.
+ */
+ void *buffer;
+ const char *text
+ = "<?xml version='1.0' encoding='iso-8859-1'?>"
+ "<e>"
+ /* 64 chars */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ /* until we have at least 1024 characters on the line: */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
+ "</e>";
+ int parse_len = (int)strlen(text);
+
+ /* Need a cdata handler to provoke the code path we want to test */
+ XML_SetCharacterDataHandler(g_parser, dummy_cdata_handler);
+ buffer = XML_GetBuffer(g_parser, parse_len);
+ if (buffer == NULL)
+ fail("Could not allocate parse buffer");
+ assert(buffer != NULL);
+ memcpy(buffer, text, parse_len);
+ if (XML_ParseBuffer(g_parser, parse_len, XML_TRUE) == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/*
+ * Element event tests.
+ */
+
+START_TEST(test_end_element_events) {
+ const char *text = "<a><b><c/></b><d><f/></d></a>";
+ const XML_Char *expected = XCS("/c/b/f/d/a");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetEndElementHandler(g_parser, end_element_event_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/*
+ * Attribute tests.
+ */
+
+/* Helper used by the following tests; this checks any "attr" and "refs"
+ attributes to make sure whitespace has been normalized.
+
+ Return true if whitespace has been normalized in a string, using
+ the rules for attribute value normalization. The 'is_cdata' flag
+ is needed since CDATA attributes don't need to have multiple
+ whitespace characters collapsed to a single space, while other
+ attribute data types do. (Section 3.3.3 of the recommendation.)
+*/
+static int
+is_whitespace_normalized(const XML_Char *s, int is_cdata) {
+ int blanks = 0;
+ int at_start = 1;
+ while (*s) {
+ if (*s == XCS(' '))
+ ++blanks;
+ else if (*s == XCS('\t') || *s == XCS('\n') || *s == XCS('\r'))
+ return 0;
+ else {
+ if (at_start) {
+ at_start = 0;
+ if (blanks && ! is_cdata)
+ /* illegal leading blanks */
+ return 0;
+ } else if (blanks > 1 && ! is_cdata)
+ return 0;
+ blanks = 0;
+ }
+ ++s;
+ }
+ if (blanks && ! is_cdata)
+ return 0;
+ return 1;
+}
+
+/* Check the attribute whitespace checker: */
+START_TEST(test_helper_is_whitespace_normalized) {
+ assert(is_whitespace_normalized(XCS("abc"), 0));
+ assert(is_whitespace_normalized(XCS("abc"), 1));
+ assert(is_whitespace_normalized(XCS("abc def ghi"), 0));
+ assert(is_whitespace_normalized(XCS("abc def ghi"), 1));
+ assert(! is_whitespace_normalized(XCS(" abc def ghi"), 0));
+ assert(is_whitespace_normalized(XCS(" abc def ghi"), 1));
+ assert(! is_whitespace_normalized(XCS("abc def ghi"), 0));
+ assert(is_whitespace_normalized(XCS("abc def ghi"), 1));
+ assert(! is_whitespace_normalized(XCS("abc def ghi "), 0));
+ assert(is_whitespace_normalized(XCS("abc def ghi "), 1));
+ assert(! is_whitespace_normalized(XCS(" "), 0));
+ assert(is_whitespace_normalized(XCS(" "), 1));
+ assert(! is_whitespace_normalized(XCS("\t"), 0));
+ assert(! is_whitespace_normalized(XCS("\t"), 1));
+ assert(! is_whitespace_normalized(XCS("\n"), 0));
+ assert(! is_whitespace_normalized(XCS("\n"), 1));
+ assert(! is_whitespace_normalized(XCS("\r"), 0));
+ assert(! is_whitespace_normalized(XCS("\r"), 1));
+ assert(! is_whitespace_normalized(XCS("abc\t def"), 1));
+}
+END_TEST
+
+static void XMLCALL
+check_attr_contains_normalized_whitespace(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ int i;
+ UNUSED_P(userData);
+ UNUSED_P(name);
+ for (i = 0; atts[i] != NULL; i += 2) {
+ const XML_Char *attrname = atts[i];
+ const XML_Char *value = atts[i + 1];
+ if (xcstrcmp(XCS("attr"), attrname) == 0
+ || xcstrcmp(XCS("ents"), attrname) == 0
+ || xcstrcmp(XCS("refs"), attrname) == 0) {
+ if (! is_whitespace_normalized(value, 0)) {
+ char buffer[256];
+ snprintf(buffer, sizeof(buffer),
+ "attribute value not normalized: %" XML_FMT_STR
+ "='%" XML_FMT_STR "'",
+ attrname, value);
+ fail(buffer);
+ }
+ }
+ }
+}
+
+START_TEST(test_attr_whitespace_normalization) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ " <!ATTLIST doc\n"
+ " attr NMTOKENS #REQUIRED\n"
+ " ents ENTITIES #REQUIRED\n"
+ " refs IDREFS #REQUIRED>\n"
+ "]>\n"
+ "<doc attr=' a b c\t\td\te\t' refs=' id-1 \t id-2\t\t' \n"
+ " ents=' ent-1 \t\r\n"
+ " ent-2 ' >\n"
+ " <e id='id-1'/>\n"
+ " <e id='id-2'/>\n"
+ "</doc>";
+
+ XML_SetStartElementHandler(g_parser,
+ check_attr_contains_normalized_whitespace);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/*
+ * XML declaration tests.
+ */
+
+START_TEST(test_xmldecl_misplaced) {
+ expect_failure("\n"
+ "<?xml version='1.0'?>\n"
+ "<a/>",
+ XML_ERROR_MISPLACED_XML_PI,
+ "failed to report misplaced XML declaration");
+}
+END_TEST
+
+START_TEST(test_xmldecl_invalid) {
+ expect_failure("<?xml version='1.0' \xc3\xa7?>\n<doc/>", XML_ERROR_XML_DECL,
+ "Failed to report invalid XML declaration");
+}
+END_TEST
+
+START_TEST(test_xmldecl_missing_attr) {
+ expect_failure("<?xml ='1.0'?>\n<doc/>\n", XML_ERROR_XML_DECL,
+ "Failed to report missing XML declaration attribute");
+}
+END_TEST
+
+START_TEST(test_xmldecl_missing_value) {
+ expect_failure("<?xml version='1.0' encoding='us-ascii' standalone?>\n"
+ "<doc/>",
+ XML_ERROR_XML_DECL,
+ "Failed to report missing attribute value");
+}
+END_TEST
+
+/* Regression test for SF bug #584832. */
+START_TEST(test_unknown_encoding_internal_entity) {
+ const char *text = "<?xml version='1.0' encoding='unsupported-encoding'?>\n"
+ "<!DOCTYPE test [<!ENTITY foo 'bar'>]>\n"
+ "<test a='&foo;'/>";
+
+ XML_SetUnknownEncodingHandler(g_parser, UnknownEncodingHandler, NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test unrecognised encoding handler */
+START_TEST(test_unrecognised_encoding_internal_entity) {
+ const char *text = "<?xml version='1.0' encoding='unsupported-encoding'?>\n"
+ "<!DOCTYPE test [<!ENTITY foo 'bar'>]>\n"
+ "<test a='&foo;'/>";
+
+ XML_SetUnknownEncodingHandler(g_parser, UnrecognisedEncodingHandler, NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Unrecognised encoding not rejected");
+}
+END_TEST
+
+/* Regression test for SF bug #620106. */
+START_TEST(test_ext_entity_set_encoding) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtTest test_data
+ = {/* This text says it's an unsupported encoding, but it's really
+ UTF-8, which we tell Expat using XML_SetEncoding().
+ */
+ "<?xml encoding='iso-8859-3'?>\xC3\xA9", XCS("utf-8"), NULL};
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00e9");
+#else
+ const XML_Char *expected = XCS("\xc3\xa9");
+#endif
+
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ run_ext_character_check(text, &test_data, expected);
+}
+END_TEST
+
+/* Test external entities with no handler */
+START_TEST(test_ext_entity_no_handler) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+
+ XML_SetDefaultHandler(g_parser, dummy_default_handler);
+ run_character_check(text, XCS(""));
+}
+END_TEST
+
+/* Test UTF-8 BOM is accepted */
+START_TEST(test_ext_entity_set_bom) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtTest test_data = {"\xEF\xBB\xBF" /* BOM */
+ "<?xml encoding='iso-8859-3'?>"
+ "\xC3\xA9",
+ XCS("utf-8"), NULL};
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00e9");
+#else
+ const XML_Char *expected = XCS("\xc3\xa9");
+#endif
+
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ run_ext_character_check(text, &test_data, expected);
+}
+END_TEST
+
+/* Test that bad encodings are faulted */
+START_TEST(test_ext_entity_bad_encoding) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtFaults fault
+ = {"<?xml encoding='iso-8859-3'?>u", "Unsupported encoding not faulted",
+ XCS("unknown"), XML_ERROR_UNKNOWN_ENCODING};
+
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
+ XML_SetUserData(g_parser, &fault);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Bad encoding should not have been accepted");
+}
+END_TEST
+
+/* Try handing an invalid encoding to an external entity parser */
+START_TEST(test_ext_entity_bad_encoding_2) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+ ExtFaults fault
+ = {"<!ELEMENT doc (#PCDATA)*>", "Unknown encoding not faulted",
+ XCS("unknown-encoding"), XML_ERROR_UNKNOWN_ENCODING};
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
+ XML_SetUserData(g_parser, &fault);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Bad encoding not faulted in external entity handler");
+}
+END_TEST
+
+/* Test that no error is reported for unknown entities if we don't
+ read an external subset. This was fixed in Expat 1.95.5.
+*/
+START_TEST(test_wfc_undeclared_entity_unread_external_subset) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test that an error is reported for unknown entities if we don't
+ have an external subset.
+*/
+START_TEST(test_wfc_undeclared_entity_no_external_subset) {
+ expect_failure("<doc>&entity;</doc>", XML_ERROR_UNDEFINED_ENTITY,
+ "Parser did not report undefined entity w/out a DTD.");
+}
+END_TEST
+
+/* Test that an error is reported for unknown entities if we don't
+ read an external subset, but have been declared standalone.
+*/
+START_TEST(test_wfc_undeclared_entity_standalone) {
+ const char *text
+ = "<?xml version='1.0' encoding='us-ascii' standalone='yes'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+
+ expect_failure(text, XML_ERROR_UNDEFINED_ENTITY,
+ "Parser did not report undefined entity (standalone).");
+}
+END_TEST
+
+/* Test that an error is reported for unknown entities if we have read
+ an external subset, and standalone is true.
+*/
+START_TEST(test_wfc_undeclared_entity_with_external_subset_standalone) {
+ const char *text
+ = "<?xml version='1.0' encoding='us-ascii' standalone='yes'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+ ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ expect_failure(text, XML_ERROR_UNDEFINED_ENTITY,
+ "Parser did not report undefined entity (external DTD).");
+}
+END_TEST
+
+/* Test that external entity handling is not done if the parsing flag
+ * is set to UNLESS_STANDALONE
+ */
+START_TEST(test_entity_with_external_subset_unless_standalone) {
+ const char *text
+ = "<?xml version='1.0' encoding='us-ascii' standalone='yes'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+ ExtTest test_data = {"<!ENTITY entity 'bar'>", NULL, NULL};
+
+ XML_SetParamEntityParsing(g_parser,
+ XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ expect_failure(text, XML_ERROR_UNDEFINED_ENTITY,
+ "Parser did not report undefined entity");
+}
+END_TEST
+
+/* Test that no error is reported for unknown entities if we have read
+ an external subset, and standalone is false.
+*/
+START_TEST(test_wfc_undeclared_entity_with_external_subset) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+ ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ run_ext_character_check(text, &test_data, XCS(""));
+}
+END_TEST
+
+/* Test that an error is reported if our NotStandalone handler fails */
+START_TEST(test_not_standalone_handler_reject) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+ ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ XML_SetNotStandaloneHandler(g_parser, reject_not_standalone_handler);
+ expect_failure(text, XML_ERROR_NOT_STANDALONE,
+ "NotStandalone handler failed to reject");
+
+ /* Try again but without external entity handling */
+ XML_ParserReset(g_parser, NULL);
+ XML_SetNotStandaloneHandler(g_parser, reject_not_standalone_handler);
+ expect_failure(text, XML_ERROR_NOT_STANDALONE,
+ "NotStandalone handler failed to reject");
+}
+END_TEST
+
+/* Test that no error is reported if our NotStandalone handler succeeds */
+START_TEST(test_not_standalone_handler_accept) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+ ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ XML_SetNotStandaloneHandler(g_parser, accept_not_standalone_handler);
+ run_ext_character_check(text, &test_data, XCS(""));
+
+ /* Repeat without the external entity handler */
+ XML_ParserReset(g_parser, NULL);
+ XML_SetNotStandaloneHandler(g_parser, accept_not_standalone_handler);
+ run_character_check(text, XCS(""));
+}
+END_TEST
+
+START_TEST(test_entity_start_tag_level_greater_than_one) {
+ const char *const text = "<!DOCTYPE t1 [\n"
+ " <!ENTITY e1 'hello'>\n"
+ "]>\n"
+ "<t1>\n"
+ " <t2>&e1;</t2>\n"
+ "</t1>\n";
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
+ /*isFinal*/ XML_TRUE)
+ == XML_STATUS_OK);
+ XML_ParserFree(parser);
+}
+END_TEST
+
+START_TEST(test_wfc_no_recursive_entity_refs) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY entity '&#38;entity;'>\n"
+ "]>\n"
+ "<doc>&entity;</doc>";
+
+ expect_failure(text, XML_ERROR_RECURSIVE_ENTITY_REF,
+ "Parser did not report recursive entity reference.");
+}
+END_TEST
+
+START_TEST(test_no_indirectly_recursive_entity_refs) {
+ struct TestCase {
+ const char *doc;
+ bool usesParameterEntities;
+ };
+
+ const struct TestCase cases[] = {
+ // general entity + character data
+ {"<!DOCTYPE a [\n"
+ " <!ENTITY e1 '&e2;'>\n"
+ " <!ENTITY e2 '&e1;'>\n"
+ "]><a>&e2;</a>\n",
+ false},
+
+ // general entity + attribute value
+ {"<!DOCTYPE a [\n"
+ " <!ENTITY e1 '&e2;'>\n"
+ " <!ENTITY e2 '&e1;'>\n"
+ "]><a k1='&e2;' />\n",
+ false},
+
+ // parameter entity
+ {"<!DOCTYPE doc [\n"
+ " <!ENTITY % p1 '&#37;p2;'>\n"
+ " <!ENTITY % p2 '&#37;p1;'>\n"
+ " <!ENTITY % define_g \"<!ENTITY g '&#37;p2;'>\">\n"
+ " %define_g;\n"
+ "]>\n"
+ "<doc/>\n",
+ true},
+ };
+ const XML_Bool reset_or_not[] = {XML_TRUE, XML_FALSE};
+
+ for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
+ for (size_t j = 0; j < sizeof(reset_or_not) / sizeof(reset_or_not[0]);
+ j++) {
+ const XML_Bool reset_wanted = reset_or_not[j];
+ const char *const doc = cases[i].doc;
+ const bool usesParameterEntities = cases[i].usesParameterEntities;
+
+ set_subtest("[%i,reset=%i] %s", (int)i, (int)j, doc);
+
+#ifdef XML_DTD // both GE and DTD
+ const bool rejection_expected = true;
+#elif XML_GE == 1 // GE but not DTD
+ const bool rejection_expected = ! usesParameterEntities;
+#else // neither DTD nor GE
+ const bool rejection_expected = false;
+#endif
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+
+#ifdef XML_DTD
+ if (usesParameterEntities) {
+ assert_true(
+ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS)
+ == 1);
+ }
+#else
+ UNUSED_P(usesParameterEntities);
+#endif // XML_DTD
+
+ const enum XML_Status status
+ = _XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc),
+ /*isFinal*/ XML_TRUE);
+
+ if (rejection_expected) {
+ assert_true(status == XML_STATUS_ERROR);
+ assert_true(XML_GetErrorCode(parser) == XML_ERROR_RECURSIVE_ENTITY_REF);
+ } else {
+ assert_true(status == XML_STATUS_OK);
+ }
+
+ if (reset_wanted) {
+ // This covers free'ing of (eventually) all three open entity lists by
+ // XML_ParserReset.
+ XML_ParserReset(parser, NULL);
+ }
+
+ // This covers free'ing of (eventually) all three open entity lists by
+ // XML_ParserFree (unless XML_ParserReset has already done that above).
+ XML_ParserFree(parser);
+ }
+ }
+}
+END_TEST
+
+START_TEST(test_recursive_external_parameter_entity_2) {
+ struct TestCase {
+ const char *doc;
+ enum XML_Status expectedStatus;
+ };
+
+ struct TestCase cases[] = {
+ {"<!ENTITY % p1 '%p1;'>", XML_STATUS_ERROR},
+ {"<!ENTITY % p1 '%p1;'>"
+ "<!ENTITY % p1 'first declaration wins'>",
+ XML_STATUS_ERROR},
+ {"<!ENTITY % p1 'first declaration wins'>"
+ "<!ENTITY % p1 '%p1;'>",
+ XML_STATUS_OK},
+ {"<!ENTITY % p1 '&#37;p1;'>", XML_STATUS_OK},
+ };
+
+ for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
+ const char *const doc = cases[i].doc;
+ const enum XML_Status expectedStatus = cases[i].expectedStatus;
+ set_subtest("%s", doc);
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+
+ XML_Parser ext_parser = XML_ExternalEntityParserCreate(parser, NULL, NULL);
+ assert_true(ext_parser != NULL);
+
+ const enum XML_Status actualStatus
+ = _XML_Parse_SINGLE_BYTES(ext_parser, doc, (int)strlen(doc), XML_TRUE);
+
+ assert_true(actualStatus == expectedStatus);
+ if (actualStatus != XML_STATUS_OK) {
+ assert_true(XML_GetErrorCode(ext_parser)
+ == XML_ERROR_RECURSIVE_ENTITY_REF);
+ }
+
+ XML_ParserFree(ext_parser);
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+/* Test incomplete external entities are faulted */
+START_TEST(test_ext_entity_invalid_parse) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ const ExtFaults faults[]
+ = {{"<", "Incomplete element declaration not faulted", NULL,
+ XML_ERROR_UNCLOSED_TOKEN},
+ {"<\xe2\x82", /* First two bytes of a three-byte char */
+ "Incomplete character not faulted", NULL, XML_ERROR_PARTIAL_CHAR},
+ {"<tag>\xe2\x82", "Incomplete character in CDATA not faulted", NULL,
+ XML_ERROR_PARTIAL_CHAR},
+ {NULL, NULL, NULL, XML_ERROR_NONE}};
+ const ExtFaults *fault = faults;
+
+ for (; fault->parse_text != NULL; fault++) {
+ set_subtest("\"%s\"", fault->parse_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
+ XML_SetUserData(g_parser, (void *)fault);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Parser did not report external entity error");
+ XML_ParserReset(g_parser, NULL);
+ }
+}
+END_TEST
+
+/* Regression test for SF bug #483514. */
+START_TEST(test_dtd_default_handling) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ENTITY e SYSTEM 'http://example.org/e'>\n"
+ "<!NOTATION n SYSTEM 'http://example.org/n'>\n"
+ "<!ELEMENT doc EMPTY>\n"
+ "<!ATTLIST doc a CDATA #IMPLIED>\n"
+ "<?pi in dtd?>\n"
+ "<!--comment in dtd-->\n"
+ "]><doc/>";
+
+ XML_SetDefaultHandler(g_parser, accumulate_characters);
+ XML_SetStartDoctypeDeclHandler(g_parser, dummy_start_doctype_handler);
+ XML_SetEndDoctypeDeclHandler(g_parser, dummy_end_doctype_handler);
+ XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
+ XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
+ XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
+ XML_SetCommentHandler(g_parser, dummy_comment_handler);
+ XML_SetStartCdataSectionHandler(g_parser, dummy_start_cdata_handler);
+ XML_SetEndCdataSectionHandler(g_parser, dummy_end_cdata_handler);
+ run_character_check(text, XCS("\n\n\n\n\n\n\n<doc/>"));
+}
+END_TEST
+
+/* Test handling of attribute declarations */
+START_TEST(test_dtd_attr_handling) {
+ const char *prolog = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc EMPTY>\n";
+ AttTest attr_data[]
+ = {{"<!ATTLIST doc a ( one | two | three ) #REQUIRED>\n"
+ "]>"
+ "<doc a='two'/>",
+ XCS("doc"), XCS("a"),
+ XCS("(one|two|three)"), /* Extraneous spaces will be removed */
+ NULL, XML_TRUE},
+ {"<!NOTATION foo SYSTEM 'http://example.org/foo'>\n"
+ "<!ATTLIST doc a NOTATION (foo) #IMPLIED>\n"
+ "]>"
+ "<doc/>",
+ XCS("doc"), XCS("a"), XCS("NOTATION(foo)"), NULL, XML_FALSE},
+ {"<!ATTLIST doc a NOTATION (foo) 'bar'>\n"
+ "]>"
+ "<doc/>",
+ XCS("doc"), XCS("a"), XCS("NOTATION(foo)"), XCS("bar"), XML_FALSE},
+ {"<!ATTLIST doc a CDATA '\xdb\xb2'>\n"
+ "]>"
+ "<doc/>",
+ XCS("doc"), XCS("a"), XCS("CDATA"),
+#ifdef XML_UNICODE
+ XCS("\x06f2"),
+#else
+ XCS("\xdb\xb2"),
+#endif
+ XML_FALSE},
+ {NULL, NULL, NULL, NULL, NULL, XML_FALSE}};
+ AttTest *test;
+
+ for (test = attr_data; test->definition != NULL; test++) {
+ set_subtest("%s", test->definition);
+ XML_SetAttlistDeclHandler(g_parser, verify_attlist_decl_handler);
+ XML_SetUserData(g_parser, test);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, prolog, (int)strlen(prolog),
+ XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, test->definition,
+ (int)strlen(test->definition), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ XML_ParserReset(g_parser, NULL);
+ }
+}
+END_TEST
+
+/* See related SF bug #673791.
+ When namespace processing is enabled, setting the namespace URI for
+ a prefix is not allowed; this test ensures that it *is* allowed
+ when namespace processing is not enabled.
+ (See Namespaces in XML, section 2.)
+*/
+START_TEST(test_empty_ns_without_namespaces) {
+ const char *text = "<doc xmlns:prefix='http://example.org/'>\n"
+ " <e xmlns:prefix=''/>\n"
+ "</doc>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Regression test for SF bug #824420.
+ Checks that an xmlns:prefix attribute set in an attribute's default
+ value isn't misinterpreted.
+*/
+START_TEST(test_ns_in_attribute_default_without_namespaces) {
+ const char *text = "<!DOCTYPE e:element [\n"
+ " <!ATTLIST e:element\n"
+ " xmlns:e CDATA 'http://example.org/'>\n"
+ " ]>\n"
+ "<e:element/>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Regression test for SF bug #1515266: missing check of stopped
+ parser in doContext() 'for' loop. */
+START_TEST(test_stop_parser_between_char_data_calls) {
+ /* The sample data must be big enough that there are two calls to
+ the character data handler from within the inner "for" loop of
+ the XML_TOK_DATA_CHARS case in doContent(), and the character
+ handler must stop the parser and clear the character data
+ handler.
+ */
+ const char *text = long_character_data_text;
+
+ XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
+ g_resumable = XML_FALSE;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_ABORTED)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Regression test for SF bug #1515266: missing check of stopped
+ parser in doContext() 'for' loop. */
+START_TEST(test_suspend_parser_between_char_data_calls) {
+ /* The sample data must be big enough that there are two calls to
+ the character data handler from within the inner "for" loop of
+ the XML_TOK_DATA_CHARS case in doContent(), and the character
+ handler must stop the parser and clear the character data
+ handler.
+ */
+ const char *text = long_character_data_text;
+
+ XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
+ g_resumable = XML_TRUE;
+ // can't use SINGLE_BYTES here, because it'll return early on suspension, and
+ // we won't know exactly how much input we actually managed to give Expat.
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_SUSPENDED)
+ xml_failure(g_parser);
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_NONE)
+ xml_failure(g_parser);
+ /* Try parsing directly */
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Attempt to continue parse while suspended not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_SUSPENDED)
+ fail("Suspended parse not faulted with correct error");
+}
+END_TEST
+
+/* Test repeated calls to XML_StopParser are handled correctly */
+START_TEST(test_repeated_stop_parser_between_char_data_calls) {
+ const char *text = long_character_data_text;
+
+ XML_SetCharacterDataHandler(g_parser, parser_stop_character_handler);
+ g_resumable = XML_FALSE;
+ g_abortable = XML_FALSE;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Failed to double-stop parser");
+
+ XML_ParserReset(g_parser, NULL);
+ XML_SetCharacterDataHandler(g_parser, parser_stop_character_handler);
+ g_resumable = XML_TRUE;
+ g_abortable = XML_FALSE;
+ // can't use SINGLE_BYTES here, because it'll return early on suspension, and
+ // we won't know exactly how much input we actually managed to give Expat.
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_SUSPENDED)
+ fail("Failed to double-suspend parser");
+
+ XML_ParserReset(g_parser, NULL);
+ XML_SetCharacterDataHandler(g_parser, parser_stop_character_handler);
+ g_resumable = XML_TRUE;
+ g_abortable = XML_TRUE;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Failed to suspend-abort parser");
+}
+END_TEST
+
+START_TEST(test_good_cdata_ascii) {
+ const char *text = "<a><![CDATA[<greeting>Hello, world!</greeting>]]></a>";
+ const XML_Char *expected = XCS("<greeting>Hello, world!</greeting>");
+
+ CharData storage;
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+ /* Add start and end handlers for coverage */
+ XML_SetStartCdataSectionHandler(g_parser, dummy_start_cdata_handler);
+ XML_SetEndCdataSectionHandler(g_parser, dummy_end_cdata_handler);
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+
+ /* Try again, this time with a default handler */
+ XML_ParserReset(g_parser, NULL);
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+ XML_SetDefaultHandler(g_parser, dummy_default_handler);
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_good_cdata_utf16) {
+ /* Test data is:
+ * <?xml version='1.0' encoding='utf-16'?>
+ * <a><![CDATA[hello]]></a>
+ */
+ const char text[]
+ = "\0<\0?\0x\0m\0l\0"
+ " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
+ " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
+ "1\0"
+ "6\0'"
+ "\0?\0>\0\n"
+ "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0[\0h\0e\0l\0l\0o\0]\0]\0>\0<\0/\0a\0>";
+ const XML_Char *expected = XCS("hello");
+
+ CharData storage;
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_good_cdata_utf16_le) {
+ /* Test data is:
+ * <?xml version='1.0' encoding='utf-16'?>
+ * <a><![CDATA[hello]]></a>
+ */
+ const char text[]
+ = "<\0?\0x\0m\0l\0"
+ " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
+ " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
+ "1\0"
+ "6\0'"
+ "\0?\0>\0\n"
+ "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0[\0h\0e\0l\0l\0o\0]\0]\0>\0<\0/\0a\0>\0";
+ const XML_Char *expected = XCS("hello");
+
+ CharData storage;
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test UTF16 conversion of a long cdata string */
+
+/* 16 characters: handy macro to reduce visual clutter */
+#define A_TO_P_IN_UTF16 "\0A\0B\0C\0D\0E\0F\0G\0H\0I\0J\0K\0L\0M\0N\0O\0P"
+
+START_TEST(test_long_cdata_utf16) {
+ /* Test data is:
+ * <?xlm version='1.0' encoding='utf-16'?>
+ * <a><![CDATA[
+ * ABCDEFGHIJKLMNOP
+ * ]]></a>
+ */
+ const char text[]
+ = "\0<\0?\0x\0m\0l\0 "
+ "\0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0 "
+ "\0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0\x31\0\x36\0'\0?\0>"
+ "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0["
+ /* 64 characters per line */
+ /* clang-format off */
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
+ A_TO_P_IN_UTF16
+ /* clang-format on */
+ "\0]\0]\0>\0<\0/\0a\0>";
+ const XML_Char *expected =
+ /* clang-format off */
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
+ XCS("ABCDEFGHIJKLMNOP");
+ /* clang-format on */
+ CharData storage;
+ void *buffer;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+ buffer = XML_GetBuffer(g_parser, sizeof(text) - 1);
+ if (buffer == NULL)
+ fail("Could not allocate parse buffer");
+ assert(buffer != NULL);
+ memcpy(buffer, text, sizeof(text) - 1);
+ if (XML_ParseBuffer(g_parser, sizeof(text) - 1, XML_TRUE) == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test handling of multiple unit UTF-16 characters */
+START_TEST(test_multichar_cdata_utf16) {
+ /* Test data is:
+ * <?xml version='1.0' encoding='utf-16'?>
+ * <a><![CDATA[{MINIM}{CROTCHET}]]></a>
+ *
+ * where {MINIM} is U+1d15e (a minim or half-note)
+ * UTF-16: 0xd834 0xdd5e
+ * UTF-8: 0xf0 0x9d 0x85 0x9e
+ * and {CROTCHET} is U+1d15f (a crotchet or quarter-note)
+ * UTF-16: 0xd834 0xdd5f
+ * UTF-8: 0xf0 0x9d 0x85 0x9f
+ */
+ const char text[] = "\0<\0?\0x\0m\0l\0"
+ " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
+ " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
+ "1\0"
+ "6\0'"
+ "\0?\0>\0\n"
+ "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0["
+ "\xd8\x34\xdd\x5e\xd8\x34\xdd\x5f"
+ "\0]\0]\0>\0<\0/\0a\0>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\xd834\xdd5e\xd834\xdd5f");
+#else
+ const XML_Char *expected = XCS("\xf0\x9d\x85\x9e\xf0\x9d\x85\x9f");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test that an element name with a UTF-16 surrogate pair is rejected */
+START_TEST(test_utf16_bad_surrogate_pair) {
+ /* Test data is:
+ * <?xml version='1.0' encoding='utf-16'?>
+ * <a><![CDATA[{BADLINB}]]></a>
+ *
+ * where {BADLINB} is U+10000 (the first Linear B character)
+ * with the UTF-16 surrogate pair in the wrong order, i.e.
+ * 0xdc00 0xd800
+ */
+ const char text[] = "\0<\0?\0x\0m\0l\0"
+ " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
+ " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
+ "1\0"
+ "6\0'"
+ "\0?\0>\0\n"
+ "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0["
+ "\xdc\x00\xd8\x00"
+ "\0]\0]\0>\0<\0/\0a\0>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Reversed UTF-16 surrogate pair not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_bad_cdata) {
+ struct CaseData {
+ const char *text;
+ enum XML_Error expectedError;
+ };
+
+ struct CaseData cases[]
+ = {{"<a><", XML_ERROR_UNCLOSED_TOKEN},
+ {"<a><!", XML_ERROR_UNCLOSED_TOKEN},
+ {"<a><![", XML_ERROR_UNCLOSED_TOKEN},
+ {"<a><![C", XML_ERROR_UNCLOSED_TOKEN},
+ {"<a><![CD", XML_ERROR_UNCLOSED_TOKEN},
+ {"<a><![CDA", XML_ERROR_UNCLOSED_TOKEN},
+ {"<a><![CDAT", XML_ERROR_UNCLOSED_TOKEN},
+ {"<a><![CDATA", XML_ERROR_UNCLOSED_TOKEN},
+
+ {"<a><![CDATA[", XML_ERROR_UNCLOSED_CDATA_SECTION},
+ {"<a><![CDATA[]", XML_ERROR_UNCLOSED_CDATA_SECTION},
+ {"<a><![CDATA[]]", XML_ERROR_UNCLOSED_CDATA_SECTION},
+
+ {"<a><!<a/>", XML_ERROR_INVALID_TOKEN},
+ {"<a><![<a/>", XML_ERROR_UNCLOSED_TOKEN}, /* ?! */
+ {"<a><![C<a/>", XML_ERROR_UNCLOSED_TOKEN}, /* ?! */
+ {"<a><![CD<a/>", XML_ERROR_INVALID_TOKEN},
+ {"<a><![CDA<a/>", XML_ERROR_INVALID_TOKEN},
+ {"<a><![CDAT<a/>", XML_ERROR_INVALID_TOKEN},
+ {"<a><![CDATA<a/>", XML_ERROR_INVALID_TOKEN},
+
+ {"<a><![CDATA[<a/>", XML_ERROR_UNCLOSED_CDATA_SECTION},
+ {"<a><![CDATA[]<a/>", XML_ERROR_UNCLOSED_CDATA_SECTION},
+ {"<a><![CDATA[]]<a/>", XML_ERROR_UNCLOSED_CDATA_SECTION}};
+
+ size_t i = 0;
+ for (; i < sizeof(cases) / sizeof(struct CaseData); i++) {
+ set_subtest("%s", cases[i].text);
+ const enum XML_Status actualStatus = _XML_Parse_SINGLE_BYTES(
+ g_parser, cases[i].text, (int)strlen(cases[i].text), XML_TRUE);
+ const enum XML_Error actualError = XML_GetErrorCode(g_parser);
+
+ assert(actualStatus == XML_STATUS_ERROR);
+
+ if (actualError != cases[i].expectedError) {
+ char message[100];
+ snprintf(message, sizeof(message),
+ "Expected error %d but got error %d for case %u: \"%s\"\n",
+ cases[i].expectedError, actualError, (unsigned int)i + 1,
+ cases[i].text);
+ fail(message);
+ }
+
+ XML_ParserReset(g_parser, NULL);
+ }
+}
+END_TEST
+
+/* Test failures in UTF-16 CDATA */
+START_TEST(test_bad_cdata_utf16) {
+ struct CaseData {
+ size_t text_bytes;
+ const char *text;
+ enum XML_Error expected_error;
+ };
+
+ const char prolog[] = "\0<\0?\0x\0m\0l\0"
+ " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
+ " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
+ "1\0"
+ "6\0'"
+ "\0?\0>\0\n"
+ "\0<\0a\0>";
+ struct CaseData cases[] = {
+ {1, "\0", XML_ERROR_UNCLOSED_TOKEN},
+ {2, "\0<", XML_ERROR_UNCLOSED_TOKEN},
+ {3, "\0<\0", XML_ERROR_UNCLOSED_TOKEN},
+ {4, "\0<\0!", XML_ERROR_UNCLOSED_TOKEN},
+ {5, "\0<\0!\0", XML_ERROR_UNCLOSED_TOKEN},
+ {6, "\0<\0!\0[", XML_ERROR_UNCLOSED_TOKEN},
+ {7, "\0<\0!\0[\0", XML_ERROR_UNCLOSED_TOKEN},
+ {8, "\0<\0!\0[\0C", XML_ERROR_UNCLOSED_TOKEN},
+ {9, "\0<\0!\0[\0C\0", XML_ERROR_UNCLOSED_TOKEN},
+ {10, "\0<\0!\0[\0C\0D", XML_ERROR_UNCLOSED_TOKEN},
+ {11, "\0<\0!\0[\0C\0D\0", XML_ERROR_UNCLOSED_TOKEN},
+ {12, "\0<\0!\0[\0C\0D\0A", XML_ERROR_UNCLOSED_TOKEN},
+ {13, "\0<\0!\0[\0C\0D\0A\0", XML_ERROR_UNCLOSED_TOKEN},
+ {14, "\0<\0!\0[\0C\0D\0A\0T", XML_ERROR_UNCLOSED_TOKEN},
+ {15, "\0<\0!\0[\0C\0D\0A\0T\0", XML_ERROR_UNCLOSED_TOKEN},
+ {16, "\0<\0!\0[\0C\0D\0A\0T\0A", XML_ERROR_UNCLOSED_TOKEN},
+ {17, "\0<\0!\0[\0C\0D\0A\0T\0A\0", XML_ERROR_UNCLOSED_TOKEN},
+ {18, "\0<\0!\0[\0C\0D\0A\0T\0A\0[", XML_ERROR_UNCLOSED_CDATA_SECTION},
+ {19, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0", XML_ERROR_UNCLOSED_CDATA_SECTION},
+ {20, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z", XML_ERROR_UNCLOSED_CDATA_SECTION},
+ /* Now add a four-byte UTF-16 character */
+ {21, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z\xd8",
+ XML_ERROR_UNCLOSED_CDATA_SECTION},
+ {22, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z\xd8\x34", XML_ERROR_PARTIAL_CHAR},
+ {23, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z\xd8\x34\xdd",
+ XML_ERROR_PARTIAL_CHAR},
+ {24, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z\xd8\x34\xdd\x5e",
+ XML_ERROR_UNCLOSED_CDATA_SECTION}};
+ size_t i;
+
+ for (i = 0; i < sizeof(cases) / sizeof(struct CaseData); i++) {
+ set_subtest("case %lu", (long unsigned)(i + 1));
+ enum XML_Status actual_status;
+ enum XML_Error actual_error;
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, prolog, (int)sizeof(prolog) - 1,
+ XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ actual_status = _XML_Parse_SINGLE_BYTES(g_parser, cases[i].text,
+ (int)cases[i].text_bytes, XML_TRUE);
+ assert(actual_status == XML_STATUS_ERROR);
+ actual_error = XML_GetErrorCode(g_parser);
+ if (actual_error != cases[i].expected_error) {
+ char message[1024];
+
+ snprintf(message, sizeof(message),
+ "Expected error %d (%" XML_FMT_STR "), got %d (%" XML_FMT_STR
+ ") for case %lu\n",
+ cases[i].expected_error,
+ XML_ErrorString(cases[i].expected_error), actual_error,
+ XML_ErrorString(actual_error), (long unsigned)(i + 1));
+ fail(message);
+ }
+ XML_ParserReset(g_parser, NULL);
+ }
+}
+END_TEST
+
+/* Test stopping the parser in cdata handler */
+START_TEST(test_stop_parser_between_cdata_calls) {
+ const char *text = long_cdata_text;
+
+ XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
+ g_resumable = XML_FALSE;
+ expect_failure(text, XML_ERROR_ABORTED, "Parse not aborted in CDATA handler");
+}
+END_TEST
+
+/* Test suspending the parser in cdata handler */
+START_TEST(test_suspend_parser_between_cdata_calls) {
+ if (g_chunkSize != 0) {
+ // this test does not use SINGLE_BYTES, because of suspension
+ return;
+ }
+
+ const char *text = long_cdata_text;
+ enum XML_Status result;
+
+ XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
+ g_resumable = XML_TRUE;
+ // can't use SINGLE_BYTES here, because it'll return early on suspension, and
+ // we won't know exactly how much input we actually managed to give Expat.
+ result = XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE);
+ if (result != XML_STATUS_SUSPENDED) {
+ if (result == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ fail("Parse not suspended in CDATA handler");
+ }
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_NONE)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test memory allocation functions */
+START_TEST(test_memory_allocation) {
+ char *buffer = (char *)XML_MemMalloc(g_parser, 256);
+ char *p;
+
+ if (buffer == NULL) {
+ fail("Allocation failed");
+ } else {
+ /* Try writing to memory; some OSes try to cheat! */
+ buffer[0] = 'T';
+ buffer[1] = 'E';
+ buffer[2] = 'S';
+ buffer[3] = 'T';
+ buffer[4] = '\0';
+ if (strcmp(buffer, "TEST") != 0) {
+ fail("Memory not writable");
+ } else {
+ p = (char *)XML_MemRealloc(g_parser, buffer, 512);
+ if (p == NULL) {
+ fail("Reallocation failed");
+ } else {
+ /* Write again, just to be sure */
+ buffer = p;
+ buffer[0] = 'V';
+ if (strcmp(buffer, "VEST") != 0) {
+ fail("Reallocated memory not writable");
+ }
+ }
+ }
+ XML_MemFree(g_parser, buffer);
+ }
+}
+END_TEST
+
+/* Test XML_DefaultCurrent() passes handling on correctly */
+START_TEST(test_default_current) {
+ const char *text = "<doc>hell]</doc>";
+ const char *entity_text = "<!DOCTYPE doc [\n"
+ "<!ENTITY entity '&#37;'>\n"
+ "]>\n"
+ "<doc>&entity;</doc>";
+
+ set_subtest("with defaulting");
+ {
+ struct handler_record_list storage;
+ storage.count = 0;
+ XML_SetDefaultHandler(g_parser, record_default_handler);
+ XML_SetCharacterDataHandler(g_parser, record_cdata_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ int i = 0;
+ assert_record_handler_called(&storage, i++, "record_default_handler", 5);
+ // we should have gotten one or more cdata callbacks, totaling 5 chars
+ int cdata_len_remaining = 5;
+ while (cdata_len_remaining > 0) {
+ const struct handler_record_entry *c_entry
+ = handler_record_get(&storage, i++);
+ assert_true(strcmp(c_entry->name, "record_cdata_handler") == 0);
+ assert_true(c_entry->arg > 0);
+ assert_true(c_entry->arg <= cdata_len_remaining);
+ cdata_len_remaining -= c_entry->arg;
+ // default handler must follow, with the exact same len argument.
+ assert_record_handler_called(&storage, i++, "record_default_handler",
+ c_entry->arg);
+ }
+ assert_record_handler_called(&storage, i++, "record_default_handler", 6);
+ assert_true(storage.count == i);
+ }
+
+ /* Again, without the defaulting */
+ set_subtest("no defaulting");
+ {
+ struct handler_record_list storage;
+ storage.count = 0;
+ XML_ParserReset(g_parser, NULL);
+ XML_SetDefaultHandler(g_parser, record_default_handler);
+ XML_SetCharacterDataHandler(g_parser, record_cdata_nodefault_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ int i = 0;
+ assert_record_handler_called(&storage, i++, "record_default_handler", 5);
+ // we should have gotten one or more cdata callbacks, totaling 5 chars
+ int cdata_len_remaining = 5;
+ while (cdata_len_remaining > 0) {
+ const struct handler_record_entry *c_entry
+ = handler_record_get(&storage, i++);
+ assert_true(strcmp(c_entry->name, "record_cdata_nodefault_handler") == 0);
+ assert_true(c_entry->arg > 0);
+ assert_true(c_entry->arg <= cdata_len_remaining);
+ cdata_len_remaining -= c_entry->arg;
+ }
+ assert_record_handler_called(&storage, i++, "record_default_handler", 6);
+ assert_true(storage.count == i);
+ }
+
+ /* Now with an internal entity to complicate matters */
+ set_subtest("with internal entity");
+ {
+ struct handler_record_list storage;
+ storage.count = 0;
+ XML_ParserReset(g_parser, NULL);
+ XML_SetDefaultHandler(g_parser, record_default_handler);
+ XML_SetCharacterDataHandler(g_parser, record_cdata_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, entity_text, (int)strlen(entity_text),
+ XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ /* The default handler suppresses the entity */
+ assert_record_handler_called(&storage, 0, "record_default_handler", 9);
+ assert_record_handler_called(&storage, 1, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 2, "record_default_handler", 3);
+ assert_record_handler_called(&storage, 3, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 4, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 5, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 6, "record_default_handler", 8);
+ assert_record_handler_called(&storage, 7, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 8, "record_default_handler", 6);
+ assert_record_handler_called(&storage, 9, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 10, "record_default_handler", 7);
+ assert_record_handler_called(&storage, 11, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 12, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 13, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 14, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 15, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 16, "record_default_handler", 5);
+ assert_record_handler_called(&storage, 17, "record_default_handler", 8);
+ assert_record_handler_called(&storage, 18, "record_default_handler", 6);
+ assert_true(storage.count == 19);
+ }
+
+ /* Again, with a skip handler */
+ set_subtest("with skip handler");
+ {
+ struct handler_record_list storage;
+ storage.count = 0;
+ XML_ParserReset(g_parser, NULL);
+ XML_SetDefaultHandler(g_parser, record_default_handler);
+ XML_SetCharacterDataHandler(g_parser, record_cdata_handler);
+ XML_SetSkippedEntityHandler(g_parser, record_skip_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, entity_text, (int)strlen(entity_text),
+ XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ /* The default handler suppresses the entity */
+ assert_record_handler_called(&storage, 0, "record_default_handler", 9);
+ assert_record_handler_called(&storage, 1, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 2, "record_default_handler", 3);
+ assert_record_handler_called(&storage, 3, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 4, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 5, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 6, "record_default_handler", 8);
+ assert_record_handler_called(&storage, 7, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 8, "record_default_handler", 6);
+ assert_record_handler_called(&storage, 9, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 10, "record_default_handler", 7);
+ assert_record_handler_called(&storage, 11, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 12, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 13, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 14, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 15, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 16, "record_default_handler", 5);
+ assert_record_handler_called(&storage, 17, "record_skip_handler", 0);
+ assert_record_handler_called(&storage, 18, "record_default_handler", 6);
+ assert_true(storage.count == 19);
+ }
+
+ /* This time, allow the entity through */
+ set_subtest("allow entity");
+ {
+ struct handler_record_list storage;
+ storage.count = 0;
+ XML_ParserReset(g_parser, NULL);
+ XML_SetDefaultHandlerExpand(g_parser, record_default_handler);
+ XML_SetCharacterDataHandler(g_parser, record_cdata_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, entity_text, (int)strlen(entity_text),
+ XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ assert_record_handler_called(&storage, 0, "record_default_handler", 9);
+ assert_record_handler_called(&storage, 1, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 2, "record_default_handler", 3);
+ assert_record_handler_called(&storage, 3, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 4, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 5, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 6, "record_default_handler", 8);
+ assert_record_handler_called(&storage, 7, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 8, "record_default_handler", 6);
+ assert_record_handler_called(&storage, 9, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 10, "record_default_handler", 7);
+ assert_record_handler_called(&storage, 11, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 12, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 13, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 14, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 15, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 16, "record_default_handler", 5);
+ assert_record_handler_called(&storage, 17, "record_cdata_handler", 1);
+ assert_record_handler_called(&storage, 18, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 19, "record_default_handler", 6);
+ assert_true(storage.count == 20);
+ }
+
+ /* Finally, without passing the cdata to the default handler */
+ set_subtest("not passing cdata");
+ {
+ struct handler_record_list storage;
+ storage.count = 0;
+ XML_ParserReset(g_parser, NULL);
+ XML_SetDefaultHandlerExpand(g_parser, record_default_handler);
+ XML_SetCharacterDataHandler(g_parser, record_cdata_nodefault_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, entity_text, (int)strlen(entity_text),
+ XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ assert_record_handler_called(&storage, 0, "record_default_handler", 9);
+ assert_record_handler_called(&storage, 1, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 2, "record_default_handler", 3);
+ assert_record_handler_called(&storage, 3, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 4, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 5, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 6, "record_default_handler", 8);
+ assert_record_handler_called(&storage, 7, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 8, "record_default_handler", 6);
+ assert_record_handler_called(&storage, 9, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 10, "record_default_handler", 7);
+ assert_record_handler_called(&storage, 11, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 12, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 13, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 14, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 15, "record_default_handler", 1);
+ assert_record_handler_called(&storage, 16, "record_default_handler", 5);
+ assert_record_handler_called(&storage, 17, "record_cdata_nodefault_handler",
+ 1);
+ assert_record_handler_called(&storage, 18, "record_default_handler", 6);
+ assert_true(storage.count == 19);
+ }
+}
+END_TEST
+
+/* Test DTD element parsing code paths */
+START_TEST(test_dtd_elements) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc (chapter)>\n"
+ "<!ELEMENT chapter (#PCDATA)>\n"
+ "]>\n"
+ "<doc><chapter>Wombats are go</chapter></doc>";
+
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+static void XMLCALL
+element_decl_check_model(void *userData, const XML_Char *name,
+ XML_Content *model) {
+ UNUSED_P(userData);
+ uint32_t errorFlags = 0;
+
+ /* Expected model array structure is this:
+ * [0] (type 6, quant 0)
+ * [1] (type 5, quant 0)
+ * [3] (type 4, quant 0, name "bar")
+ * [4] (type 4, quant 0, name "foo")
+ * [5] (type 4, quant 3, name "xyz")
+ * [2] (type 4, quant 2, name "zebra")
+ */
+ errorFlags |= ((xcstrcmp(name, XCS("junk")) == 0) ? 0 : (1u << 0));
+ errorFlags |= ((model != NULL) ? 0 : (1u << 1));
+
+ if (model != NULL) {
+ errorFlags |= ((model[0].type == XML_CTYPE_SEQ) ? 0 : (1u << 2));
+ errorFlags |= ((model[0].quant == XML_CQUANT_NONE) ? 0 : (1u << 3));
+ errorFlags |= ((model[0].numchildren == 2) ? 0 : (1u << 4));
+ errorFlags |= ((model[0].children == &model[1]) ? 0 : (1u << 5));
+ errorFlags |= ((model[0].name == NULL) ? 0 : (1u << 6));
+
+ errorFlags |= ((model[1].type == XML_CTYPE_CHOICE) ? 0 : (1u << 7));
+ errorFlags |= ((model[1].quant == XML_CQUANT_NONE) ? 0 : (1u << 8));
+ errorFlags |= ((model[1].numchildren == 3) ? 0 : (1u << 9));
+ errorFlags |= ((model[1].children == &model[3]) ? 0 : (1u << 10));
+ errorFlags |= ((model[1].name == NULL) ? 0 : (1u << 11));
+
+ errorFlags |= ((model[2].type == XML_CTYPE_NAME) ? 0 : (1u << 12));
+ errorFlags |= ((model[2].quant == XML_CQUANT_REP) ? 0 : (1u << 13));
+ errorFlags |= ((model[2].numchildren == 0) ? 0 : (1u << 14));
+ errorFlags |= ((model[2].children == NULL) ? 0 : (1u << 15));
+ errorFlags
+ |= ((xcstrcmp(model[2].name, XCS("zebra")) == 0) ? 0 : (1u << 16));
+
+ errorFlags |= ((model[3].type == XML_CTYPE_NAME) ? 0 : (1u << 17));
+ errorFlags |= ((model[3].quant == XML_CQUANT_NONE) ? 0 : (1u << 18));
+ errorFlags |= ((model[3].numchildren == 0) ? 0 : (1u << 19));
+ errorFlags |= ((model[3].children == NULL) ? 0 : (1u << 20));
+ errorFlags |= ((xcstrcmp(model[3].name, XCS("bar")) == 0) ? 0 : (1u << 21));
+
+ errorFlags |= ((model[4].type == XML_CTYPE_NAME) ? 0 : (1u << 22));
+ errorFlags |= ((model[4].quant == XML_CQUANT_NONE) ? 0 : (1u << 23));
+ errorFlags |= ((model[4].numchildren == 0) ? 0 : (1u << 24));
+ errorFlags |= ((model[4].children == NULL) ? 0 : (1u << 25));
+ errorFlags |= ((xcstrcmp(model[4].name, XCS("foo")) == 0) ? 0 : (1u << 26));
+
+ errorFlags |= ((model[5].type == XML_CTYPE_NAME) ? 0 : (1u << 27));
+ errorFlags |= ((model[5].quant == XML_CQUANT_PLUS) ? 0 : (1u << 28));
+ errorFlags |= ((model[5].numchildren == 0) ? 0 : (1u << 29));
+ errorFlags |= ((model[5].children == NULL) ? 0 : (1u << 30));
+ errorFlags |= ((xcstrcmp(model[5].name, XCS("xyz")) == 0) ? 0 : (1u << 31));
+ }
+
+ XML_SetUserData(g_parser, (void *)(uintptr_t)errorFlags);
+ XML_FreeContentModel(g_parser, model);
+}
+
+START_TEST(test_dtd_elements_nesting) {
+ // Payload inspired by a test in Perl's XML::Parser
+ const char *text = "<!DOCTYPE foo [\n"
+ "<!ELEMENT junk ((bar|foo|xyz+), zebra*)>\n"
+ "]>\n"
+ "<foo/>";
+
+ XML_SetUserData(g_parser, (void *)(uintptr_t)-1);
+
+ XML_SetElementDeclHandler(g_parser, element_decl_check_model);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+
+ if ((uint32_t)(uintptr_t)XML_GetUserData(g_parser) != 0)
+ fail("Element declaration model regression detected");
+}
+END_TEST
+
+/* Test foreign DTD handling */
+START_TEST(test_set_foreign_dtd) {
+ const char *text1 = "<?xml version='1.0' encoding='us-ascii'?>\n";
+ const char *text2 = "<doc>&entity;</doc>";
+ ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
+
+ /* Check hash salt is passed through too */
+ XML_SetHashSalt(g_parser, 0x12345678);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ /* Add a default handler to exercise more code paths */
+ XML_SetDefaultHandler(g_parser, dummy_default_handler);
+ if (XML_UseForeignDTD(g_parser, XML_TRUE) != XML_ERROR_NONE)
+ fail("Could not set foreign DTD");
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+
+ /* Ensure that trying to set the DTD after parsing has started
+ * is faulted, even if it's the same setting.
+ */
+ if (XML_UseForeignDTD(g_parser, XML_TRUE)
+ != XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING)
+ fail("Failed to reject late foreign DTD setting");
+ /* Ditto for the hash salt */
+ if (XML_SetHashSalt(g_parser, 0x23456789))
+ fail("Failed to reject late hash salt change");
+
+ /* Now finish the parse */
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test foreign DTD handling with a failing NotStandalone handler */
+START_TEST(test_foreign_dtd_not_standalone) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<doc>&entity;</doc>";
+ ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ XML_SetNotStandaloneHandler(g_parser, reject_not_standalone_handler);
+ if (XML_UseForeignDTD(g_parser, XML_TRUE) != XML_ERROR_NONE)
+ fail("Could not set foreign DTD");
+ expect_failure(text, XML_ERROR_NOT_STANDALONE,
+ "NotStandalonehandler failed to reject");
+}
+END_TEST
+
+/* Test invalid character in a foreign DTD is faulted */
+START_TEST(test_invalid_foreign_dtd) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<doc>&entity;</doc>";
+ ExtFaults test_data
+ = {"$", "Dollar not faulted", NULL, XML_ERROR_INVALID_TOKEN};
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
+ XML_UseForeignDTD(g_parser, XML_TRUE);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Bad DTD should not have been accepted");
+}
+END_TEST
+
+/* Test foreign DTD use with a doctype */
+START_TEST(test_foreign_dtd_with_doctype) {
+ const char *text1 = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc [<!ENTITY entity 'hello world'>]>\n";
+ const char *text2 = "<doc>&entity;</doc>";
+ ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
+
+ /* Check hash salt is passed through too */
+ XML_SetHashSalt(g_parser, 0x12345678);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ /* Add a default handler to exercise more code paths */
+ XML_SetDefaultHandler(g_parser, dummy_default_handler);
+ if (XML_UseForeignDTD(g_parser, XML_TRUE) != XML_ERROR_NONE)
+ fail("Could not set foreign DTD");
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+
+ /* Ensure that trying to set the DTD after parsing has started
+ * is faulted, even if it's the same setting.
+ */
+ if (XML_UseForeignDTD(g_parser, XML_TRUE)
+ != XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING)
+ fail("Failed to reject late foreign DTD setting");
+ /* Ditto for the hash salt */
+ if (XML_SetHashSalt(g_parser, 0x23456789))
+ fail("Failed to reject late hash salt change");
+
+ /* Now finish the parse */
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test XML_UseForeignDTD with no external subset present */
+START_TEST(test_foreign_dtd_without_external_subset) {
+ const char *text = "<!DOCTYPE doc [<!ENTITY foo 'bar'>]>\n"
+ "<doc>&foo;</doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, NULL);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_null_loader);
+ XML_UseForeignDTD(g_parser, XML_TRUE);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_empty_foreign_dtd) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<doc>&entity;</doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_null_loader);
+ XML_UseForeignDTD(g_parser, XML_TRUE);
+ expect_failure(text, XML_ERROR_UNDEFINED_ENTITY,
+ "Undefined entity not faulted");
+}
+END_TEST
+
+/* Test XML Base is set and unset appropriately */
+START_TEST(test_set_base) {
+ const XML_Char *old_base;
+ const XML_Char *new_base = XCS("/local/file/name.xml");
+
+ old_base = XML_GetBase(g_parser);
+ if (XML_SetBase(g_parser, new_base) != XML_STATUS_OK)
+ fail("Unable to set base");
+ if (xcstrcmp(XML_GetBase(g_parser), new_base) != 0)
+ fail("Base setting not correct");
+ if (XML_SetBase(g_parser, NULL) != XML_STATUS_OK)
+ fail("Unable to NULL base");
+ if (XML_GetBase(g_parser) != NULL)
+ fail("Base setting not nulled");
+ XML_SetBase(g_parser, old_base);
+}
+END_TEST
+
+/* Test attribute counts, indexing, etc */
+START_TEST(test_attributes) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc (tag)>\n"
+ "<!ATTLIST doc id ID #REQUIRED>\n"
+ "]>"
+ "<doc a='1' id='one' b='2'>"
+ "<tag c='3'/>"
+ "</doc>";
+ AttrInfo doc_info[] = {{XCS("a"), XCS("1")},
+ {XCS("b"), XCS("2")},
+ {XCS("id"), XCS("one")},
+ {NULL, NULL}};
+ AttrInfo tag_info[] = {{XCS("c"), XCS("3")}, {NULL, NULL}};
+ ElementInfo info[] = {{XCS("doc"), 3, XCS("id"), NULL},
+ {XCS("tag"), 1, NULL, NULL},
+ {NULL, 0, NULL, NULL}};
+ info[0].attributes = doc_info;
+ info[1].attributes = tag_info;
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+ ParserAndElementInfo parserAndElementInfos = {
+ parser,
+ info,
+ };
+
+ XML_SetStartElementHandler(parser, counting_start_element_handler);
+ XML_SetUserData(parser, &parserAndElementInfos);
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+
+ XML_ParserFree(parser);
+}
+END_TEST
+
+/* Test reset works correctly in the middle of processing an internal
+ * entity. Exercises some obscure code in XML_ParserReset().
+ */
+START_TEST(test_reset_in_entity) {
+ if (g_chunkSize != 0) {
+ // this test does not use SINGLE_BYTES, because of suspension
+ return;
+ }
+
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ENTITY wombat 'wom'>\n"
+ "<!ENTITY entity 'hi &wom; there'>\n"
+ "]>\n"
+ "<doc>&entity;</doc>";
+ XML_ParsingStatus status;
+
+ g_resumable = XML_TRUE;
+ XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
+ // can't use SINGLE_BYTES here, because it'll return early on suspension, and
+ // we won't know exactly how much input we actually managed to give Expat.
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ XML_GetParsingStatus(g_parser, &status);
+ if (status.parsing != XML_SUSPENDED)
+ fail("Parsing status not SUSPENDED");
+ XML_ParserReset(g_parser, NULL);
+ XML_GetParsingStatus(g_parser, &status);
+ if (status.parsing != XML_INITIALIZED)
+ fail("Parsing status doesn't reset to INITIALIZED");
+}
+END_TEST
+
+/* Test that resume correctly passes through parse errors */
+START_TEST(test_resume_invalid_parse) {
+ const char *text = "<doc>Hello</doc"; /* Missing closing wedge */
+
+ g_resumable = XML_TRUE;
+ XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (XML_ResumeParser(g_parser) == XML_STATUS_OK)
+ fail("Resumed invalid parse not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_UNCLOSED_TOKEN)
+ fail("Invalid parse not correctly faulted");
+}
+END_TEST
+
+/* Test that re-suspended parses are correctly passed through */
+START_TEST(test_resume_resuspended) {
+ const char *text = "<doc>Hello<meep/>world</doc>";
+
+ g_resumable = XML_TRUE;
+ XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ g_resumable = XML_TRUE;
+ XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
+ if (XML_ResumeParser(g_parser) != XML_STATUS_SUSPENDED)
+ fail("Resumption not suspended");
+ /* This one should succeed and finish up */
+ if (XML_ResumeParser(g_parser) != XML_STATUS_OK)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test that CDATA shows up correctly through a default handler */
+START_TEST(test_cdata_default) {
+ const char *text = "<doc><![CDATA[Hello\nworld]]></doc>";
+ const XML_Char *expected = XCS("<doc><![CDATA[Hello\nworld]]></doc>");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetDefaultHandler(g_parser, accumulate_characters);
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test resetting a subordinate parser does exactly nothing */
+START_TEST(test_subordinate_reset) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_resetter);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test suspending a subordinate parser */
+START_TEST(test_subordinate_suspend) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_suspender);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test suspending a subordinate parser from an XML declaration */
+/* Increases code coverage of the tests */
+
+START_TEST(test_subordinate_xdecl_suspend) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ " <!ENTITY entity SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&entity;</doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_suspend_xmldecl);
+ g_resumable = XML_TRUE;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_subordinate_xdecl_abort) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ " <!ENTITY entity SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&entity;</doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_suspend_xmldecl);
+ g_resumable = XML_FALSE;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test external entity fault handling with suspension */
+START_TEST(test_ext_entity_invalid_suspended_parse) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtFaults faults[]
+ = {{"<?xml version='1.0' encoding='us-ascii'?><",
+ "Incomplete element declaration not faulted", NULL,
+ XML_ERROR_UNCLOSED_TOKEN},
+ {/* First two bytes of a three-byte char */
+ "<?xml version='1.0' encoding='utf-8'?>\xe2\x82",
+ "Incomplete character not faulted", NULL, XML_ERROR_PARTIAL_CHAR},
+ {NULL, NULL, NULL, XML_ERROR_NONE}};
+ ExtFaults *fault;
+
+ for (fault = &faults[0]; fault->parse_text != NULL; fault++) {
+ set_subtest("%s", fault->parse_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser,
+ external_entity_suspending_faulter);
+ XML_SetUserData(g_parser, fault);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Parser did not report external entity error");
+ XML_ParserReset(g_parser, NULL);
+ }
+}
+END_TEST
+
+/* Test setting an explicit encoding */
+START_TEST(test_explicit_encoding) {
+ const char *text1 = "<doc>Hello ";
+ const char *text2 = " World</doc>";
+
+ /* Just check that we can set the encoding to NULL before starting */
+ if (XML_SetEncoding(g_parser, NULL) != XML_STATUS_OK)
+ fail("Failed to initialise encoding to NULL");
+ /* Say we are UTF-8 */
+ if (XML_SetEncoding(g_parser, XCS("utf-8")) != XML_STATUS_OK)
+ fail("Failed to set explicit encoding");
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ /* Try to switch encodings mid-parse */
+ if (XML_SetEncoding(g_parser, XCS("us-ascii")) != XML_STATUS_ERROR)
+ fail("Allowed encoding change");
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ /* Try now the parse is over */
+ if (XML_SetEncoding(g_parser, NULL) != XML_STATUS_OK)
+ fail("Failed to unset encoding");
+}
+END_TEST
+
+/* Test handling of trailing CR (rather than newline) */
+START_TEST(test_trailing_cr) {
+ const char *text = "<doc>\r";
+ int found_cr;
+
+ /* Try with a character handler, for code coverage */
+ XML_SetCharacterDataHandler(g_parser, cr_cdata_handler);
+ XML_SetUserData(g_parser, &found_cr);
+ found_cr = 0;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_OK)
+ fail("Failed to fault unclosed doc");
+ if (found_cr == 0)
+ fail("Did not catch the carriage return");
+ XML_ParserReset(g_parser, NULL);
+
+ /* Now with a default handler instead */
+ XML_SetDefaultHandler(g_parser, cr_cdata_handler);
+ XML_SetUserData(g_parser, &found_cr);
+ found_cr = 0;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_OK)
+ fail("Failed to fault unclosed doc");
+ if (found_cr == 0)
+ fail("Did not catch default carriage return");
+}
+END_TEST
+
+/* Test trailing CR in an external entity parse */
+START_TEST(test_ext_entity_trailing_cr) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ int found_cr;
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_cr_catcher);
+ XML_SetUserData(g_parser, &found_cr);
+ found_cr = 0;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_OK)
+ xml_failure(g_parser);
+ if (found_cr == 0)
+ fail("No carriage return found");
+ XML_ParserReset(g_parser, NULL);
+
+ /* Try again with a different trailing CR */
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_bad_cr_catcher);
+ XML_SetUserData(g_parser, &found_cr);
+ found_cr = 0;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_OK)
+ xml_failure(g_parser);
+ if (found_cr == 0)
+ fail("No carriage return found");
+}
+END_TEST
+
+/* Test handling of trailing square bracket */
+START_TEST(test_trailing_rsqb) {
+ const char *text8 = "<doc>]";
+ const char text16[] = "\xFF\xFE<\000d\000o\000c\000>\000]\000";
+ int found_rsqb;
+ int text8_len = (int)strlen(text8);
+
+ XML_SetCharacterDataHandler(g_parser, rsqb_handler);
+ XML_SetUserData(g_parser, &found_rsqb);
+ found_rsqb = 0;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text8, text8_len, XML_TRUE)
+ == XML_STATUS_OK)
+ fail("Failed to fault unclosed doc");
+ if (found_rsqb == 0)
+ fail("Did not catch the right square bracket");
+
+ /* Try again with a different encoding */
+ XML_ParserReset(g_parser, NULL);
+ XML_SetCharacterDataHandler(g_parser, rsqb_handler);
+ XML_SetUserData(g_parser, &found_rsqb);
+ found_rsqb = 0;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text16, (int)sizeof(text16) - 1,
+ XML_TRUE)
+ == XML_STATUS_OK)
+ fail("Failed to fault unclosed doc");
+ if (found_rsqb == 0)
+ fail("Did not catch the right square bracket");
+
+ /* And finally with a default handler */
+ XML_ParserReset(g_parser, NULL);
+ XML_SetDefaultHandler(g_parser, rsqb_handler);
+ XML_SetUserData(g_parser, &found_rsqb);
+ found_rsqb = 0;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text16, (int)sizeof(text16) - 1,
+ XML_TRUE)
+ == XML_STATUS_OK)
+ fail("Failed to fault unclosed doc");
+ if (found_rsqb == 0)
+ fail("Did not catch the right square bracket");
+}
+END_TEST
+
+/* Test trailing right square bracket in an external entity parse */
+START_TEST(test_ext_entity_trailing_rsqb) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ int found_rsqb;
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_rsqb_catcher);
+ XML_SetUserData(g_parser, &found_rsqb);
+ found_rsqb = 0;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_OK)
+ xml_failure(g_parser);
+ if (found_rsqb == 0)
+ fail("No right square bracket found");
+}
+END_TEST
+
+/* Test CDATA handling in an external entity */
+START_TEST(test_ext_entity_good_cdata) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_good_cdata_ascii);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_OK)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test user parameter settings */
+START_TEST(test_user_parameters) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!-- Primary parse -->\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;";
+ const char *epilog = "<!-- Back to primary parser -->\n"
+ "</doc>";
+
+ g_comment_count = 0;
+ g_skip_count = 0;
+ g_xdecl_count = 0;
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetXmlDeclHandler(g_parser, xml_decl_handler);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_param_checker);
+ XML_SetCommentHandler(g_parser, data_check_comment_handler);
+ XML_SetSkippedEntityHandler(g_parser, param_check_skip_handler);
+ XML_UseParserAsHandlerArg(g_parser);
+ XML_SetUserData(g_parser, (void *)1);
+ g_handler_data = g_parser;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ /* Ensure we can't change policy mid-parse */
+ if (XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_NEVER))
+ fail("Changed param entity parsing policy while parsing");
+ if (_XML_Parse_SINGLE_BYTES(g_parser, epilog, (int)strlen(epilog), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (g_comment_count != 3)
+ fail("Comment handler not invoked enough times");
+ if (g_skip_count != 1)
+ fail("Skip handler not invoked enough times");
+ if (g_xdecl_count != 1)
+ fail("XML declaration handler not invoked");
+}
+END_TEST
+
+/* Test that an explicit external entity handler argument replaces
+ * the parser as the first argument.
+ *
+ * We do not call the first parameter to the external entity handler
+ * 'parser' for once, since the first time the handler is called it
+ * will actually be a text string. We need to be able to access the
+ * global 'parser' variable to create our external entity parser from,
+ * since there are code paths we need to ensure get executed.
+ */
+START_TEST(test_ext_entity_ref_parameter) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
+ "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc>&entity;</doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_ref_param_checker);
+ /* Set a handler arg that is not NULL and not parser (which is
+ * what NULL would cause to be passed.
+ */
+ XML_SetExternalEntityRefHandlerArg(g_parser, (void *)text);
+ g_handler_data = text;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+
+ /* Now try again with unset args */
+ XML_ParserReset(g_parser, NULL);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_ref_param_checker);
+ XML_SetExternalEntityRefHandlerArg(g_parser, NULL);
+ g_handler_data = g_parser;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test the parsing of an empty string */
+START_TEST(test_empty_parse) {
+ const char *text = "<doc></doc>";
+ const char *partial = "<doc>";
+
+ if (XML_Parse(g_parser, NULL, 0, XML_FALSE) == XML_STATUS_ERROR)
+ fail("Parsing empty string faulted");
+ if (XML_Parse(g_parser, NULL, 0, XML_TRUE) != XML_STATUS_ERROR)
+ fail("Parsing final empty string not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_NO_ELEMENTS)
+ fail("Parsing final empty string faulted for wrong reason");
+
+ /* Now try with valid text before the empty end */
+ XML_ParserReset(g_parser, NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (XML_Parse(g_parser, NULL, 0, XML_TRUE) == XML_STATUS_ERROR)
+ fail("Parsing final empty string faulted");
+
+ /* Now try with invalid text before the empty end */
+ XML_ParserReset(g_parser, NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, partial, (int)strlen(partial),
+ XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (XML_Parse(g_parser, NULL, 0, XML_TRUE) != XML_STATUS_ERROR)
+ fail("Parsing final incomplete empty string not faulted");
+}
+END_TEST
+
+/* Test XML_Parse for len < 0 */
+START_TEST(test_negative_len_parse) {
+ const char *const doc = "<root/>";
+ for (int isFinal = 0; isFinal < 2; isFinal++) {
+ set_subtest("isFinal=%d", isFinal);
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+
+ if (XML_GetErrorCode(parser) != XML_ERROR_NONE)
+ fail("There was not supposed to be any initial parse error.");
+
+ const enum XML_Status status = XML_Parse(parser, doc, -1, isFinal);
+
+ if (status != XML_STATUS_ERROR)
+ fail("Negative len was expected to fail the parse but did not.");
+
+ if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_ARGUMENT)
+ fail("Parse error does not match XML_ERROR_INVALID_ARGUMENT.");
+
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+/* Test XML_ParseBuffer for len < 0 */
+START_TEST(test_negative_len_parse_buffer) {
+ const char *const doc = "<root/>";
+ for (int isFinal = 0; isFinal < 2; isFinal++) {
+ set_subtest("isFinal=%d", isFinal);
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+
+ if (XML_GetErrorCode(parser) != XML_ERROR_NONE)
+ fail("There was not supposed to be any initial parse error.");
+
+ void *const buffer = XML_GetBuffer(parser, (int)strlen(doc));
+
+ if (buffer == NULL)
+ fail("XML_GetBuffer failed.");
+
+ memcpy(buffer, doc, strlen(doc));
+
+ const enum XML_Status status = XML_ParseBuffer(parser, -1, isFinal);
+
+ if (status != XML_STATUS_ERROR)
+ fail("Negative len was expected to fail the parse but did not.");
+
+ if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_ARGUMENT)
+ fail("Parse error does not match XML_ERROR_INVALID_ARGUMENT.");
+
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+/* Test odd corners of the XML_GetBuffer interface */
+static enum XML_Status
+get_feature(enum XML_FeatureEnum feature_id, long *presult) {
+ const XML_Feature *feature = XML_GetFeatureList();
+
+ if (feature == NULL)
+ return XML_STATUS_ERROR;
+ for (; feature->feature != XML_FEATURE_END; feature++) {
+ if (feature->feature == feature_id) {
+ *presult = feature->value;
+ return XML_STATUS_OK;
+ }
+ }
+ return XML_STATUS_ERROR;
+}
+
+/* Test odd corners of the XML_GetBuffer interface */
+START_TEST(test_get_buffer_1) {
+ const char *text = get_buffer_test_text;
+ void *buffer;
+ long context_bytes;
+
+ /* Attempt to allocate a negative length buffer */
+ if (XML_GetBuffer(g_parser, -12) != NULL)
+ fail("Negative length buffer not failed");
+
+ /* Now get a small buffer and extend it past valid length */
+ buffer = XML_GetBuffer(g_parser, 1536);
+ if (buffer == NULL)
+ fail("1.5K buffer failed");
+ assert(buffer != NULL);
+ memcpy(buffer, text, strlen(text));
+ if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (XML_GetBuffer(g_parser, INT_MAX) != NULL)
+ fail("INT_MAX buffer not failed");
+
+ /* Now try extending it a more reasonable but still too large
+ * amount. The allocator in XML_GetBuffer() doubles the buffer
+ * size until it exceeds the requested amount or INT_MAX. If it
+ * exceeds INT_MAX, it rejects the request, so we want a request
+ * between INT_MAX and INT_MAX/2. A gap of 1K seems comfortable,
+ * with an extra byte just to ensure that the request is off any
+ * boundary. The request will be inflated internally by
+ * XML_CONTEXT_BYTES (if >=1), so we subtract that from our
+ * request.
+ */
+ if (get_feature(XML_FEATURE_CONTEXT_BYTES, &context_bytes) != XML_STATUS_OK)
+ context_bytes = 0;
+ if (XML_GetBuffer(g_parser, INT_MAX - (context_bytes + 1025)) != NULL)
+ fail("INT_MAX- buffer not failed");
+
+ /* Now try extending it a carefully crafted amount */
+ if (XML_GetBuffer(g_parser, 1000) == NULL)
+ fail("1000 buffer failed");
+}
+END_TEST
+
+/* Test more corners of the XML_GetBuffer interface */
+START_TEST(test_get_buffer_2) {
+ const char *text = get_buffer_test_text;
+ void *buffer;
+
+ /* Now get a decent buffer */
+ buffer = XML_GetBuffer(g_parser, 1536);
+ if (buffer == NULL)
+ fail("1.5K buffer failed");
+ assert(buffer != NULL);
+ memcpy(buffer, text, strlen(text));
+ if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+
+ /* Extend it, to catch a different code path */
+ if (XML_GetBuffer(g_parser, 1024) == NULL)
+ fail("1024 buffer failed");
+}
+END_TEST
+
+/* Test for signed integer overflow CVE-2022-23852 */
+#if XML_CONTEXT_BYTES > 0
+START_TEST(test_get_buffer_3_overflow) {
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert(parser != NULL);
+
+ const char *const text = "\n";
+ const int expectedKeepValue = (int)strlen(text);
+
+ // After this call, variable "keep" in XML_GetBuffer will
+ // have value expectedKeepValue
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text),
+ XML_FALSE /* isFinal */)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+
+ assert(expectedKeepValue > 0);
+ if (XML_GetBuffer(parser, INT_MAX - expectedKeepValue + 1) != NULL)
+ fail("enlarging buffer not failed");
+
+ XML_ParserFree(parser);
+}
+END_TEST
+#endif // XML_CONTEXT_BYTES > 0
+
+START_TEST(test_buffer_can_grow_to_max) {
+ const char *const prefixes[] = {
+ "",
+ "<",
+ "<x a='",
+ "<doc><x a='",
+ "<document><x a='",
+ "<averylongelementnamesuchthatitwillhopefullystretchacrossmultiplelinesand"
+ "lookprettyridiculousitsalsoveryhardtoreadandifyouredoingitihavetowonderif"
+ "youreallydonthaveanythingbettertodoofcourseiguessicouldveputsomethingbadin"
+ "herebutipromisethatididntheybtwhowgreatarespacesandpunctuationforhelping"
+ "withreadabilityprettygreatithinkanywaysthisisprobablylongenoughbye><x a='"};
+ const int num_prefixes = sizeof(prefixes) / sizeof(prefixes[0]);
+ int maxbuf = INT_MAX / 2 + (INT_MAX & 1); // round up without overflow
+#if defined(__MINGW32__) && ! defined(__MINGW64__)
+ // workaround for mingw/wine32 on GitHub CI not being able to reach 1GiB
+ // Can we make a big allocation?
+ void *big = malloc(maxbuf);
+ if (! big) {
+ // The big allocation failed. Let's be a little lenient.
+ maxbuf = maxbuf / 2;
+ }
+ free(big);
+#endif
+
+ for (int i = 0; i < num_prefixes; ++i) {
+ set_subtest("\"%s\"", prefixes[i]);
+ XML_Parser parser = XML_ParserCreate(NULL);
+ const int prefix_len = (int)strlen(prefixes[i]);
+ const enum XML_Status s
+ = _XML_Parse_SINGLE_BYTES(parser, prefixes[i], prefix_len, XML_FALSE);
+ if (s != XML_STATUS_OK)
+ xml_failure(parser);
+
+ // XML_CONTEXT_BYTES of the prefix may remain in the buffer;
+ // subtracting the whole prefix is easiest, and close enough.
+ assert_true(XML_GetBuffer(parser, maxbuf - prefix_len) != NULL);
+ // The limit should be consistent; no prefix should allow us to
+ // reach above the max buffer size.
+ assert_true(XML_GetBuffer(parser, maxbuf + 1) == NULL);
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+START_TEST(test_getbuffer_allocates_on_zero_len) {
+ for (int first_len = 1; first_len >= 0; first_len--) {
+ set_subtest("with len=%d first", first_len);
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+ assert_true(XML_GetBuffer(parser, first_len) != NULL);
+ assert_true(XML_GetBuffer(parser, 0) != NULL);
+ if (XML_ParseBuffer(parser, 0, XML_FALSE) != XML_STATUS_OK)
+ xml_failure(parser);
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+/* Test position information macros */
+START_TEST(test_byte_info_at_end) {
+ const char *text = "<doc></doc>";
+
+ if (XML_GetCurrentByteIndex(g_parser) != -1
+ || XML_GetCurrentByteCount(g_parser) != 0)
+ fail("Byte index/count incorrect at start of parse");
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ /* At end, the count will be zero and the index the end of string */
+ if (XML_GetCurrentByteCount(g_parser) != 0)
+ fail("Terminal byte count incorrect");
+ if (XML_GetCurrentByteIndex(g_parser) != (XML_Index)strlen(text))
+ fail("Terminal byte index incorrect");
+}
+END_TEST
+
+/* Test position information from errors */
+#define PRE_ERROR_STR "<doc></"
+#define POST_ERROR_STR "wombat></doc>"
+START_TEST(test_byte_info_at_error) {
+ const char *text = PRE_ERROR_STR POST_ERROR_STR;
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_OK)
+ fail("Syntax error not faulted");
+ if (XML_GetCurrentByteCount(g_parser) != 0)
+ fail("Error byte count incorrect");
+ if (XML_GetCurrentByteIndex(g_parser) != strlen(PRE_ERROR_STR))
+ fail("Error byte index incorrect");
+}
+END_TEST
+#undef PRE_ERROR_STR
+#undef POST_ERROR_STR
+
+/* Test position information in handler */
+#define START_ELEMENT "<e>"
+#define CDATA_TEXT "Hello"
+#define END_ELEMENT "</e>"
+START_TEST(test_byte_info_at_cdata) {
+ const char *text = START_ELEMENT CDATA_TEXT END_ELEMENT;
+ int offset, size;
+ ByteTestData data;
+
+ /* Check initial context is empty */
+ if (XML_GetInputContext(g_parser, &offset, &size) != NULL)
+ fail("Unexpected context at start of parse");
+
+ data.start_element_len = (int)strlen(START_ELEMENT);
+ data.cdata_len = (int)strlen(CDATA_TEXT);
+ data.total_string_len = (int)strlen(text);
+ XML_SetCharacterDataHandler(g_parser, byte_character_handler);
+ XML_SetUserData(g_parser, &data);
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_OK)
+ xml_failure(g_parser);
+}
+END_TEST
+#undef START_ELEMENT
+#undef CDATA_TEXT
+#undef END_ELEMENT
+
+/* Test predefined entities are correctly recognised */
+START_TEST(test_predefined_entities) {
+ const char *text = "<doc>&lt;&gt;&amp;&quot;&apos;</doc>";
+ const XML_Char *expected = XCS("<doc>&lt;&gt;&amp;&quot;&apos;</doc>");
+ const XML_Char *result = XCS("<>&\"'");
+ CharData storage;
+
+ XML_SetDefaultHandler(g_parser, accumulate_characters);
+ /* run_character_check uses XML_SetCharacterDataHandler(), which
+ * unfortunately heads off a code path that we need to exercise.
+ */
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ /* The default handler doesn't translate the entities */
+ CharData_CheckXMLChars(&storage, expected);
+
+ /* Now try again and check the translation */
+ XML_ParserReset(g_parser, NULL);
+ run_character_check(text, result);
+}
+END_TEST
+
+/* Regression test that an invalid tag in an external parameter
+ * reference in an external DTD is correctly faulted.
+ *
+ * Only a few specific tags are legal in DTDs ignoring comments and
+ * processing instructions, all of which begin with an exclamation
+ * mark. "<el/>" is not one of them, so the parser should raise an
+ * error on encountering it.
+ */
+START_TEST(test_invalid_tag_in_dtd) {
+ const char *text = "<!DOCTYPE doc SYSTEM '004-1.ent'>\n"
+ "<doc></doc>\n";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_param);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Invalid tag IN DTD external param not rejected");
+}
+END_TEST
+
+/* Test entities not quite the predefined ones are not mis-recognised */
+START_TEST(test_not_predefined_entities) {
+ const char *text[] = {"<doc>&pt;</doc>", "<doc>&amo;</doc>",
+ "<doc>&quid;</doc>", "<doc>&apod;</doc>", NULL};
+ int i = 0;
+
+ while (text[i] != NULL) {
+ expect_failure(text[i], XML_ERROR_UNDEFINED_ENTITY,
+ "Undefined entity not rejected");
+ XML_ParserReset(g_parser, NULL);
+ i++;
+ }
+}
+END_TEST
+
+/* Test conditional inclusion (IGNORE) */
+START_TEST(test_ignore_section) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc><e>&entity;</e></doc>";
+ const XML_Char *expected
+ = XCS("<![IGNORE[<!ELEMENT e (#PCDATA)*>]]>\n&entity;");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_load_ignore);
+ XML_SetDefaultHandler(g_parser, accumulate_characters);
+ XML_SetStartDoctypeDeclHandler(g_parser, dummy_start_doctype_handler);
+ XML_SetEndDoctypeDeclHandler(g_parser, dummy_end_doctype_handler);
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ XML_SetStartElementHandler(g_parser, dummy_start_element);
+ XML_SetEndElementHandler(g_parser, dummy_end_element);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_ignore_section_utf16) {
+ const char text[] =
+ /* <!DOCTYPE d SYSTEM 's'> */
+ "<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 "
+ "\0S\0Y\0S\0T\0E\0M\0 \0'\0s\0'\0>\0\n\0"
+ /* <d><e>&en;</e></d> */
+ "<\0d\0>\0<\0e\0>\0&\0e\0n\0;\0<\0/\0e\0>\0<\0/\0d\0>\0";
+ const XML_Char *expected = XCS("<![IGNORE[<!ELEMENT e (#PCDATA)*>]]>\n&en;");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_load_ignore_utf16);
+ XML_SetDefaultHandler(g_parser, accumulate_characters);
+ XML_SetStartDoctypeDeclHandler(g_parser, dummy_start_doctype_handler);
+ XML_SetEndDoctypeDeclHandler(g_parser, dummy_end_doctype_handler);
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ XML_SetStartElementHandler(g_parser, dummy_start_element);
+ XML_SetEndElementHandler(g_parser, dummy_end_element);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_ignore_section_utf16_be) {
+ const char text[] =
+ /* <!DOCTYPE d SYSTEM 's'> */
+ "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 "
+ "\0S\0Y\0S\0T\0E\0M\0 \0'\0s\0'\0>\0\n"
+ /* <d><e>&en;</e></d> */
+ "\0<\0d\0>\0<\0e\0>\0&\0e\0n\0;\0<\0/\0e\0>\0<\0/\0d\0>";
+ const XML_Char *expected = XCS("<![IGNORE[<!ELEMENT e (#PCDATA)*>]]>\n&en;");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetExternalEntityRefHandler(g_parser,
+ external_entity_load_ignore_utf16_be);
+ XML_SetDefaultHandler(g_parser, accumulate_characters);
+ XML_SetStartDoctypeDeclHandler(g_parser, dummy_start_doctype_handler);
+ XML_SetEndDoctypeDeclHandler(g_parser, dummy_end_doctype_handler);
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ XML_SetStartElementHandler(g_parser, dummy_start_element);
+ XML_SetEndElementHandler(g_parser, dummy_end_element);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test mis-formatted conditional exclusion */
+START_TEST(test_bad_ignore_section) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc><e>&entity;</e></doc>";
+ ExtFaults faults[]
+ = {{"<![IGNORE[<!ELEM", "Broken-off declaration not faulted", NULL,
+ XML_ERROR_SYNTAX},
+ {"<![IGNORE[\x01]]>", "Invalid XML character not faulted", NULL,
+ XML_ERROR_INVALID_TOKEN},
+ {/* FIrst two bytes of a three-byte char */
+ "<![IGNORE[\xe2\x82", "Partial XML character not faulted", NULL,
+ XML_ERROR_PARTIAL_CHAR},
+ {NULL, NULL, NULL, XML_ERROR_NONE}};
+ ExtFaults *fault;
+
+ for (fault = &faults[0]; fault->parse_text != NULL; fault++) {
+ set_subtest("%s", fault->parse_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
+ XML_SetUserData(g_parser, fault);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Incomplete IGNORE section not failed");
+ XML_ParserReset(g_parser, NULL);
+ }
+}
+END_TEST
+
+struct bom_testdata {
+ const char *external;
+ int split;
+ XML_Bool nested_callback_happened;
+};
+
+static int XMLCALL
+external_bom_checker(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text;
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+
+ XML_Parser ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+
+ if (! xcstrcmp(systemId, XCS("004-2.ent"))) {
+ struct bom_testdata *const testdata
+ = (struct bom_testdata *)XML_GetUserData(parser);
+ const char *const external = testdata->external;
+ const int split = testdata->split;
+ testdata->nested_callback_happened = XML_TRUE;
+
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, external, split, XML_FALSE)
+ != XML_STATUS_OK) {
+ xml_failure(ext_parser);
+ }
+ text = external + split; // the parse below will continue where we left off.
+ } else if (! xcstrcmp(systemId, XCS("004-1.ent"))) {
+ text = "<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % e1 SYSTEM '004-2.ent'>\n"
+ "<!ENTITY % e2 '%e1;'>\n";
+ } else {
+ fail("unknown systemId");
+ }
+
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_OK)
+ xml_failure(ext_parser);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+/* regression test: BOM should be consumed when followed by a partial token. */
+START_TEST(test_external_bom_consumed) {
+ const char *const text = "<!DOCTYPE doc SYSTEM '004-1.ent'>\n"
+ "<doc></doc>\n";
+ const char *const external = "\xEF\xBB\xBF<!ATTLIST doc a1 CDATA 'value'>";
+ const int len = (int)strlen(external);
+ for (int split = 0; split <= len; ++split) {
+ set_subtest("split at byte %d", split);
+
+ struct bom_testdata testdata;
+ testdata.external = external;
+ testdata.split = split;
+ testdata.nested_callback_happened = XML_FALSE;
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ if (parser == NULL) {
+ fail("Couldn't create parser");
+ }
+ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(parser, external_bom_checker);
+ XML_SetUserData(parser, &testdata);
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+ if (! testdata.nested_callback_happened) {
+ fail("ref handler not called");
+ }
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+/* Test recursive parsing */
+START_TEST(test_external_entity_values) {
+ const char *text = "<!DOCTYPE doc SYSTEM '004-1.ent'>\n"
+ "<doc></doc>\n";
+ ExtFaults data_004_2[] = {
+ {"<!ATTLIST doc a1 CDATA 'value'>", NULL, NULL, XML_ERROR_NONE},
+ {"<!ATTLIST $doc a1 CDATA 'value'>", "Invalid token not faulted", NULL,
+ XML_ERROR_INVALID_TOKEN},
+ {"'wombat", "Unterminated string not faulted", NULL,
+ XML_ERROR_UNCLOSED_TOKEN},
+ {"\xe2\x82", "Partial UTF-8 character not faulted", NULL,
+ XML_ERROR_PARTIAL_CHAR},
+ {"<?xml version='1.0' encoding='utf-8'?>\n", NULL, NULL, XML_ERROR_NONE},
+ {"<?xml?>", "Malformed XML declaration not faulted", NULL,
+ XML_ERROR_XML_DECL},
+ {/* UTF-8 BOM */
+ "\xEF\xBB\xBF<!ATTLIST doc a1 CDATA 'value'>", NULL, NULL,
+ XML_ERROR_NONE},
+ {"<?xml version='1.0' encoding='utf-8'?>\n$",
+ "Invalid token after text declaration not faulted", NULL,
+ XML_ERROR_INVALID_TOKEN},
+ {"<?xml version='1.0' encoding='utf-8'?>\n'wombat",
+ "Unterminated string after text decl not faulted", NULL,
+ XML_ERROR_UNCLOSED_TOKEN},
+ {"<?xml version='1.0' encoding='utf-8'?>\n\xe2\x82",
+ "Partial UTF-8 character after text decl not faulted", NULL,
+ XML_ERROR_PARTIAL_CHAR},
+ {"%e1;", "Recursive parameter entity not faulted", NULL,
+ XML_ERROR_RECURSIVE_ENTITY_REF},
+ {NULL, NULL, NULL, XML_ERROR_NONE}};
+ int i;
+
+ for (i = 0; data_004_2[i].parse_text != NULL; i++) {
+ set_subtest("%s", data_004_2[i].parse_text);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_valuer);
+ XML_SetUserData(g_parser, &data_004_2[i]);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ XML_ParserReset(g_parser, NULL);
+ }
+}
+END_TEST
+
+/* Test the recursive parse interacts with a not standalone handler */
+START_TEST(test_ext_entity_not_standalone) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc></doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_not_standalone);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Standalone rejection not caught");
+}
+END_TEST
+
+START_TEST(test_ext_entity_value_abort) {
+ const char *text = "<!DOCTYPE doc SYSTEM '004-1.ent'>\n"
+ "<doc></doc>\n";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_value_aborter);
+ g_resumable = XML_FALSE;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_bad_public_doctype) {
+ const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<!DOCTYPE doc PUBLIC '{BadName}' 'test'>\n"
+ "<doc></doc>";
+
+ /* Setting a handler provokes a particular code path */
+ XML_SetDoctypeDeclHandler(g_parser, dummy_start_doctype_handler,
+ dummy_end_doctype_handler);
+ expect_failure(text, XML_ERROR_PUBLICID, "Bad Public ID not failed");
+}
+END_TEST
+
+/* Test based on ibm/valid/P32/ibm32v04.xml */
+START_TEST(test_attribute_enum_value) {
+ const char *text = "<?xml version='1.0' standalone='no'?>\n"
+ "<!DOCTYPE animal SYSTEM 'test.dtd'>\n"
+ "<animal>This is a \n <a/> \n\nyellow tiger</animal>";
+ ExtTest dtd_data
+ = {"<!ELEMENT animal (#PCDATA|a)*>\n"
+ "<!ELEMENT a EMPTY>\n"
+ "<!ATTLIST animal xml:space (default|preserve) 'preserve'>",
+ NULL, NULL};
+ const XML_Char *expected = XCS("This is a \n \n\nyellow tiger");
+
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ XML_SetUserData(g_parser, &dtd_data);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ /* An attribute list handler provokes a different code path */
+ XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
+ run_ext_character_check(text, &dtd_data, expected);
+}
+END_TEST
+
+/* Slightly bizarrely, the library seems to silently ignore entity
+ * definitions for predefined entities, even when they are wrong. The
+ * language of the XML 1.0 spec is somewhat unhelpful as to what ought
+ * to happen, so this is currently treated as acceptable.
+ */
+START_TEST(test_predefined_entity_redefinition) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ENTITY apos 'foo'>\n"
+ "]>\n"
+ "<doc>&apos;</doc>";
+ run_character_check(text, XCS("'"));
+}
+END_TEST
+
+/* Test that the parser stops processing the DTD after an unresolved
+ * parameter entity is encountered.
+ */
+START_TEST(test_dtd_stop_processing) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "%foo;\n"
+ "<!ENTITY bar 'bas'>\n"
+ "]><doc/>";
+
+ XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (get_dummy_handler_flags() != 0)
+ fail("DTD processing still going after undefined PE");
+}
+END_TEST
+
+/* Test public notations with no system ID */
+START_TEST(test_public_notation_no_sysid) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!NOTATION note PUBLIC 'foo'>\n"
+ "<!ELEMENT doc EMPTY>\n"
+ "]>\n<doc/>";
+
+ init_dummy_handlers();
+ XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (get_dummy_handler_flags() != DUMMY_NOTATION_DECL_HANDLER_FLAG)
+ fail("Notation declaration handler not called");
+}
+END_TEST
+
+START_TEST(test_nested_groups) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc "
+ /* Sixteen elements per line */
+ "(e,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,"
+ "(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?"
+ "))))))))))))))))))))))))))))))))>\n"
+ "<!ELEMENT e EMPTY>"
+ "]>\n"
+ "<doc><e/></doc>";
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ XML_SetStartElementHandler(g_parser, record_element_start_handler);
+ XML_SetUserData(g_parser, &storage);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, XCS("doce"));
+ if (get_dummy_handler_flags() != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
+ fail("Element handler not fired");
+}
+END_TEST
+
+START_TEST(test_group_choice) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ELEMENT doc (a|b|c)+>\n"
+ "<!ELEMENT a EMPTY>\n"
+ "<!ELEMENT b (#PCDATA)>\n"
+ "<!ELEMENT c ANY>\n"
+ "]>\n"
+ "<doc>\n"
+ "<a/>\n"
+ "<b attr='foo'>This is a foo</b>\n"
+ "<c></c>\n"
+ "</doc>\n";
+
+ XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (get_dummy_handler_flags() != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
+ fail("Element handler flag not raised");
+}
+END_TEST
+
+START_TEST(test_standalone_parameter_entity) {
+ const char *text = "<?xml version='1.0' standalone='yes'?>\n"
+ "<!DOCTYPE doc SYSTEM 'http://example.org/' [\n"
+ "<!ENTITY % entity '<!ELEMENT doc (#PCDATA)>'>\n"
+ "%entity;\n"
+ "]>\n"
+ "<doc></doc>";
+ char dtd_data[] = "<!ENTITY % e1 'foo'>\n";
+
+ XML_SetUserData(g_parser, dtd_data);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_public);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test skipping of parameter entity in an external DTD */
+/* Derived from ibm/invalid/P69/ibm69i01.xml */
+START_TEST(test_skipped_parameter_entity) {
+ const char *text = "<?xml version='1.0'?>\n"
+ "<!DOCTYPE root SYSTEM 'http://example.org/dtd.ent' [\n"
+ "<!ELEMENT root (#PCDATA|a)* >\n"
+ "]>\n"
+ "<root></root>";
+ ExtTest dtd_data = {"%pe2;", NULL, NULL};
+
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ XML_SetUserData(g_parser, &dtd_data);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetSkippedEntityHandler(g_parser, dummy_skip_handler);
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (get_dummy_handler_flags() != DUMMY_SKIP_HANDLER_FLAG)
+ fail("Skip handler not executed");
+}
+END_TEST
+
+/* Test recursive parameter entity definition rejected in external DTD */
+START_TEST(test_recursive_external_parameter_entity) {
+ const char *text = "<?xml version='1.0'?>\n"
+ "<!DOCTYPE root SYSTEM 'http://example.org/dtd.ent' [\n"
+ "<!ELEMENT root (#PCDATA|a)* >\n"
+ "]>\n"
+ "<root></root>";
+ ExtFaults dtd_data = {"<!ENTITY % pe2 '&#37;pe2;'>\n%pe2;",
+ "Recursive external parameter entity not faulted", NULL,
+ XML_ERROR_RECURSIVE_ENTITY_REF};
+
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
+ XML_SetUserData(g_parser, &dtd_data);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Recursive external parameter not spotted");
+}
+END_TEST
+
+/* Test undefined parameter entity in external entity handler */
+START_TEST(test_undefined_ext_entity_in_external_dtd) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
+ "<doc></doc>\n";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_devaluer);
+ XML_SetUserData(g_parser, NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+
+ /* Now repeat without the external entity ref handler invoking
+ * another copy of itself.
+ */
+ XML_ParserReset(g_parser, NULL);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_devaluer);
+ XML_SetUserData(g_parser, g_parser); /* Any non-NULL value will do */
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test suspending the parse on receiving an XML declaration works */
+START_TEST(test_suspend_xdecl) {
+ const char *text = long_character_data_text;
+
+ XML_SetXmlDeclHandler(g_parser, entity_suspending_xdecl_handler);
+ XML_SetUserData(g_parser, g_parser);
+ g_resumable = XML_TRUE;
+ // can't use SINGLE_BYTES here, because it'll return early on suspension, and
+ // we won't know exactly how much input we actually managed to give Expat.
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_SUSPENDED)
+ xml_failure(g_parser);
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_NONE)
+ xml_failure(g_parser);
+ /* Attempt to start a new parse while suspended */
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Attempt to parse while suspended not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_SUSPENDED)
+ fail("Suspended parse not faulted with correct error");
+}
+END_TEST
+
+/* Test aborting the parse in an epilog works */
+START_TEST(test_abort_epilog) {
+ const char *text = "<doc></doc>\n\r\n";
+ XML_Char trigger_char = XCS('\r');
+
+ XML_SetDefaultHandler(g_parser, selective_aborting_default_handler);
+ XML_SetUserData(g_parser, &trigger_char);
+ g_resumable = XML_FALSE;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Abort not triggered");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_ABORTED)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test a different code path for abort in the epilog */
+START_TEST(test_abort_epilog_2) {
+ const char *text = "<doc></doc>\n";
+ XML_Char trigger_char = XCS('\n');
+
+ XML_SetDefaultHandler(g_parser, selective_aborting_default_handler);
+ XML_SetUserData(g_parser, &trigger_char);
+ g_resumable = XML_FALSE;
+ expect_failure(text, XML_ERROR_ABORTED, "Abort not triggered");
+}
+END_TEST
+
+/* Test suspension from the epilog */
+START_TEST(test_suspend_epilog) {
+ const char *text = "<doc></doc>\n";
+ XML_Char trigger_char = XCS('\n');
+
+ XML_SetDefaultHandler(g_parser, selective_aborting_default_handler);
+ XML_SetUserData(g_parser, &trigger_char);
+ g_resumable = XML_TRUE;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_SUSPENDED)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_suspend_in_sole_empty_tag) {
+ const char *text = "<doc/>";
+ enum XML_Status rc;
+
+ XML_SetEndElementHandler(g_parser, suspending_end_handler);
+ XML_SetUserData(g_parser, g_parser);
+ rc = _XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE);
+ if (rc == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ else if (rc != XML_STATUS_SUSPENDED)
+ fail("Suspend not triggered");
+ rc = XML_ResumeParser(g_parser);
+ if (rc == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ else if (rc != XML_STATUS_OK)
+ fail("Resume failed");
+}
+END_TEST
+
+START_TEST(test_unfinished_epilog) {
+ const char *text = "<doc></doc><";
+
+ expect_failure(text, XML_ERROR_UNCLOSED_TOKEN,
+ "Incomplete epilog entry not faulted");
+}
+END_TEST
+
+START_TEST(test_partial_char_in_epilog) {
+ const char *text = "<doc></doc>\xe2\x82";
+
+ /* First check that no fault is raised if the parse is not finished */
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ /* Now check that it is faulted once we finish */
+ if (XML_ParseBuffer(g_parser, 0, XML_TRUE) != XML_STATUS_ERROR)
+ fail("Partial character in epilog not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_PARTIAL_CHAR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test resuming a parse suspended in entity substitution */
+START_TEST(test_suspend_resume_internal_entity) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ "<!ENTITY foo '<suspend>Hi<suspend>Ho</suspend></suspend>'>\n"
+ "]>\n"
+ "<doc>&foo;</doc>\n";
+ const XML_Char *expected1 = XCS("Hi");
+ const XML_Char *expected2 = XCS("HiHo");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetStartElementHandler(g_parser, start_element_suspender);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+ XML_SetUserData(g_parser, &storage);
+ // can't use SINGLE_BYTES here, because it'll return early on suspension, and
+ // we won't know exactly how much input we actually managed to give Expat.
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_SUSPENDED)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, XCS(""));
+ if (XML_ResumeParser(g_parser) != XML_STATUS_SUSPENDED)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected1);
+ if (XML_ResumeParser(g_parser) != XML_STATUS_OK)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected2);
+}
+END_TEST
+
+START_TEST(test_suspend_resume_internal_entity_issue_629) {
+ const char *const text
+ = "<!DOCTYPE a [<!ENTITY e '<!--COMMENT-->a'>]><a>&e;<b>\n"
+ "<"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ "/>"
+ "</b></a>";
+ const size_t firstChunkSizeBytes = 54;
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ XML_SetUserData(parser, parser);
+ XML_SetCommentHandler(parser, suspending_comment_handler);
+
+ if (XML_Parse(parser, text, (int)firstChunkSizeBytes, XML_FALSE)
+ != XML_STATUS_SUSPENDED)
+ xml_failure(parser);
+ if (XML_ResumeParser(parser) != XML_STATUS_OK)
+ xml_failure(parser);
+ if (_XML_Parse_SINGLE_BYTES(parser, text + firstChunkSizeBytes,
+ (int)(strlen(text) - firstChunkSizeBytes),
+ XML_TRUE)
+ != XML_STATUS_OK)
+ xml_failure(parser);
+ XML_ParserFree(parser);
+}
+END_TEST
+
+/* Test syntax error is caught at parse resumption */
+START_TEST(test_resume_entity_with_syntax_error) {
+ if (g_chunkSize != 0) {
+ // this test does not use SINGLE_BYTES, because of suspension
+ return;
+ }
+
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ENTITY foo '<suspend>Hi</wombat>'>\n"
+ "]>\n"
+ "<doc>&foo;</doc>\n";
+
+ XML_SetStartElementHandler(g_parser, start_element_suspender);
+ // can't use SINGLE_BYTES here, because it'll return early on suspension, and
+ // we won't know exactly how much input we actually managed to give Expat.
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_SUSPENDED)
+ xml_failure(g_parser);
+ if (XML_ResumeParser(g_parser) != XML_STATUS_ERROR)
+ fail("Syntax error in entity not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_TAG_MISMATCH)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test suspending and resuming in a parameter entity substitution */
+START_TEST(test_suspend_resume_parameter_entity) {
+ const char *text = "<!DOCTYPE doc [\n"
+ "<!ENTITY % foo '<!ELEMENT doc (#PCDATA)*>'>\n"
+ "%foo;\n"
+ "]>\n"
+ "<doc>Hello, world</doc>";
+ const XML_Char *expected = XCS("Hello, world");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetElementDeclHandler(g_parser, element_decl_suspender);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+ XML_SetUserData(g_parser, &storage);
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_SUSPENDED)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, XCS(""));
+ if (XML_ResumeParser(g_parser) != XML_STATUS_OK)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test attempting to use parser after an error is faulted */
+START_TEST(test_restart_on_error) {
+ const char *text = "<$doc><doc></doc>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Invalid tag name not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
+ xml_failure(g_parser);
+ if (XML_Parse(g_parser, NULL, 0, XML_TRUE) != XML_STATUS_ERROR)
+ fail("Restarting invalid parse not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test that angle brackets in an attribute default value are faulted */
+START_TEST(test_reject_lt_in_attribute_value) {
+ const char *text = "<!DOCTYPE doc [<!ATTLIST doc a CDATA '<bar>'>]>\n"
+ "<doc></doc>";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Bad attribute default not faulted");
+}
+END_TEST
+
+START_TEST(test_reject_unfinished_param_in_att_value) {
+ const char *text = "<!DOCTYPE doc [<!ATTLIST doc a CDATA '&foo'>]>\n"
+ "<doc></doc>";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Bad attribute default not faulted");
+}
+END_TEST
+
+START_TEST(test_trailing_cr_in_att_value) {
+ const char *text = "<doc a='value\r'/>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Try parsing a general entity within a parameter entity in a
+ * standalone internal DTD. Covers a corner case in the parser.
+ */
+START_TEST(test_standalone_internal_entity) {
+ const char *text = "<?xml version='1.0' standalone='yes' ?>\n"
+ "<!DOCTYPE doc [\n"
+ " <!ELEMENT doc (#PCDATA)>\n"
+ " <!ENTITY % pe '<!ATTLIST doc att2 CDATA \"&ge;\">'>\n"
+ " <!ENTITY ge 'AttDefaultValue'>\n"
+ " %pe;\n"
+ "]>\n"
+ "<doc att2='any'/>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test that a reference to an unknown external entity is skipped */
+START_TEST(test_skipped_external_entity) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
+ "<doc></doc>\n";
+ ExtTest test_data = {"<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % e2 '%e1;'>\n",
+ NULL, NULL};
+
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test a different form of unknown external entity */
+START_TEST(test_skipped_null_loaded_ext_entity) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/one.ent'>\n"
+ "<doc />";
+ ExtHdlrData test_data
+ = {"<!ENTITY % pe1 SYSTEM 'http://example.org/two.ent'>\n"
+ "<!ENTITY % pe2 '%pe1;'>\n"
+ "%pe2;\n",
+ external_entity_null_loader, NULL};
+
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_oneshot_loader);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_skipped_unloaded_ext_entity) {
+ const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/one.ent'>\n"
+ "<doc />";
+ ExtHdlrData test_data
+ = {"<!ENTITY % pe1 SYSTEM 'http://example.org/two.ent'>\n"
+ "<!ENTITY % pe2 '%pe1;'>\n"
+ "%pe2;\n",
+ NULL, NULL};
+
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_oneshot_loader);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test that a parameter entity value ending with a carriage return
+ * has it translated internally into a newline.
+ */
+START_TEST(test_param_entity_with_trailing_cr) {
+#define PARAM_ENTITY_NAME "pe"
+#define PARAM_ENTITY_CORE_VALUE "<!ATTLIST doc att CDATA \"default\">"
+ const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
+ "<doc/>";
+ ExtTest test_data
+ = {"<!ENTITY % " PARAM_ENTITY_NAME " '" PARAM_ENTITY_CORE_VALUE "\r'>\n"
+ "%" PARAM_ENTITY_NAME ";\n",
+ NULL, NULL};
+
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
+ XML_SetEntityDeclHandler(g_parser, param_entity_match_handler);
+ param_entity_match_init(XCS(PARAM_ENTITY_NAME),
+ XCS(PARAM_ENTITY_CORE_VALUE) XCS("\n"));
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ int entity_match_flag = get_param_entity_match_flag();
+ if (entity_match_flag == ENTITY_MATCH_FAIL)
+ fail("Parameter entity CR->NEWLINE conversion failed");
+ else if (entity_match_flag == ENTITY_MATCH_NOT_FOUND)
+ fail("Parameter entity not parsed");
+}
+#undef PARAM_ENTITY_NAME
+#undef PARAM_ENTITY_CORE_VALUE
+END_TEST
+
+START_TEST(test_invalid_character_entity) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY entity '&#x110000;'>\n"
+ "]>\n"
+ "<doc>&entity;</doc>";
+
+ expect_failure(text, XML_ERROR_BAD_CHAR_REF,
+ "Out of range character reference not faulted");
+}
+END_TEST
+
+START_TEST(test_invalid_character_entity_2) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY entity '&#xg0;'>\n"
+ "]>\n"
+ "<doc>&entity;</doc>";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Out of range character reference not faulted");
+}
+END_TEST
+
+START_TEST(test_invalid_character_entity_3) {
+ const char text[] =
+ /* <!DOCTYPE doc [\n */
+ "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0o\0c\0 \0[\0\n"
+ /* U+0E04 = KHO KHWAI
+ * U+0E08 = CHO CHAN */
+ /* <!ENTITY entity '&\u0e04\u0e08;'>\n */
+ "\0<\0!\0E\0N\0T\0I\0T\0Y\0 \0e\0n\0t\0i\0t\0y\0 "
+ "\0'\0&\x0e\x04\x0e\x08\0;\0'\0>\0\n"
+ /* ]>\n */
+ "\0]\0>\0\n"
+ /* <doc>&entity;</doc> */
+ "\0<\0d\0o\0c\0>\0&\0e\0n\0t\0i\0t\0y\0;\0<\0/\0d\0o\0c\0>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Invalid start of entity name not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_UNDEFINED_ENTITY)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_invalid_character_entity_4) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY entity '&#1114112;'>\n" /* = &#x110000 */
+ "]>\n"
+ "<doc>&entity;</doc>";
+
+ expect_failure(text, XML_ERROR_BAD_CHAR_REF,
+ "Out of range character reference not faulted");
+}
+END_TEST
+
+/* Test that processing instructions are picked up by a default handler */
+START_TEST(test_pi_handled_in_default) {
+ const char *text = "<?test processing instruction?>\n<doc/>";
+ const XML_Char *expected = XCS("<?test processing instruction?>\n<doc/>");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetDefaultHandler(g_parser, accumulate_characters);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test that comments are picked up by a default handler */
+START_TEST(test_comment_handled_in_default) {
+ const char *text = "<!-- This is a comment -->\n<doc/>";
+ const XML_Char *expected = XCS("<!-- This is a comment -->\n<doc/>");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetDefaultHandler(g_parser, accumulate_characters);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test PIs that look almost but not quite like XML declarations */
+START_TEST(test_pi_yml) {
+ const char *text = "<?yml something like data?><doc/>";
+ const XML_Char *expected = XCS("yml: something like data\n");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_pi_xnl) {
+ const char *text = "<?xnl nothing like data?><doc/>";
+ const XML_Char *expected = XCS("xnl: nothing like data\n");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_pi_xmm) {
+ const char *text = "<?xmm everything like data?><doc/>";
+ const XML_Char *expected = XCS("xmm: everything like data\n");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_utf16_pi) {
+ const char text[] =
+ /* <?{KHO KHWAI}{CHO CHAN}?>
+ * where {KHO KHWAI} = U+0E04
+ * and {CHO CHAN} = U+0E08
+ */
+ "<\0?\0\x04\x0e\x08\x0e?\0>\0"
+ /* <q/> */
+ "<\0q\0/\0>\0";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x0e04\x0e08: \n");
+#else
+ const XML_Char *expected = XCS("\xe0\xb8\x84\xe0\xb8\x88: \n");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_utf16_be_pi) {
+ const char text[] =
+ /* <?{KHO KHWAI}{CHO CHAN}?>
+ * where {KHO KHWAI} = U+0E04
+ * and {CHO CHAN} = U+0E08
+ */
+ "\0<\0?\x0e\x04\x0e\x08\0?\0>"
+ /* <q/> */
+ "\0<\0q\0/\0>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x0e04\x0e08: \n");
+#else
+ const XML_Char *expected = XCS("\xe0\xb8\x84\xe0\xb8\x88: \n");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test that comments can be picked up and translated */
+START_TEST(test_utf16_be_comment) {
+ const char text[] =
+ /* <!-- Comment A --> */
+ "\0<\0!\0-\0-\0 \0C\0o\0m\0m\0e\0n\0t\0 \0A\0 \0-\0-\0>\0\n"
+ /* <doc/> */
+ "\0<\0d\0o\0c\0/\0>";
+ const XML_Char *expected = XCS(" Comment A ");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetCommentHandler(g_parser, accumulate_comment);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_utf16_le_comment) {
+ const char text[] =
+ /* <!-- Comment B --> */
+ "<\0!\0-\0-\0 \0C\0o\0m\0m\0e\0n\0t\0 \0B\0 \0-\0-\0>\0\n\0"
+ /* <doc/> */
+ "<\0d\0o\0c\0/\0>\0";
+ const XML_Char *expected = XCS(" Comment B ");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetCommentHandler(g_parser, accumulate_comment);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test that the unknown encoding handler with map entries that expect
+ * conversion but no conversion function is faulted
+ */
+START_TEST(test_missing_encoding_conversion_fn) {
+ const char *text = "<?xml version='1.0' encoding='no-conv'?>\n"
+ "<doc>\x81</doc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ /* MiscEncodingHandler sets up an encoding with every top-bit-set
+ * character introducing a two-byte sequence. For this, it
+ * requires a convert function. The above function call doesn't
+ * pass one through, so when BadEncodingHandler actually gets
+ * called it should supply an invalid encoding.
+ */
+ expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
+ "Encoding with missing convert() not faulted");
+}
+END_TEST
+
+START_TEST(test_failing_encoding_conversion_fn) {
+ const char *text = "<?xml version='1.0' encoding='failing-conv'?>\n"
+ "<doc>\x81</doc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ /* BadEncodingHandler sets up an encoding with every top-bit-set
+ * character introducing a two-byte sequence. For this, it
+ * requires a convert function. The above function call passes
+ * one that insists all possible sequences are invalid anyway.
+ */
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Encoding with failing convert() not faulted");
+}
+END_TEST
+
+/* Test unknown encoding conversions */
+START_TEST(test_unknown_encoding_success) {
+ const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
+ /* Equivalent to <eoc>Hello, world</eoc> */
+ "<\x81\x64\x80oc>Hello, world</\x81\x64\x80oc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ run_character_check(text, XCS("Hello, world"));
+}
+END_TEST
+
+/* Test bad name character in unknown encoding */
+START_TEST(test_unknown_encoding_bad_name) {
+ const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
+ "<\xff\x64oc>Hello, world</\xff\x64oc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Bad name start in unknown encoding not faulted");
+}
+END_TEST
+
+/* Test bad mid-name character in unknown encoding */
+START_TEST(test_unknown_encoding_bad_name_2) {
+ const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
+ "<d\xffoc>Hello, world</d\xffoc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Bad name in unknown encoding not faulted");
+}
+END_TEST
+
+/* Test element name that is long enough to fill the conversion buffer
+ * in an unknown encoding, finishing with an encoded character.
+ */
+START_TEST(test_unknown_encoding_long_name_1) {
+ const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
+ "<abcdefghabcdefghabcdefghijkl\x80m\x80n\x80o\x80p>"
+ "Hi"
+ "</abcdefghabcdefghabcdefghijkl\x80m\x80n\x80o\x80p>";
+ const XML_Char *expected = XCS("abcdefghabcdefghabcdefghijklmnop");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ XML_SetStartElementHandler(g_parser, record_element_start_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test element name that is long enough to fill the conversion buffer
+ * in an unknown encoding, finishing with an simple character.
+ */
+START_TEST(test_unknown_encoding_long_name_2) {
+ const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
+ "<abcdefghabcdefghabcdefghijklmnop>"
+ "Hi"
+ "</abcdefghabcdefghabcdefghijklmnop>";
+ const XML_Char *expected = XCS("abcdefghabcdefghabcdefghijklmnop");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ XML_SetStartElementHandler(g_parser, record_element_start_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_invalid_unknown_encoding) {
+ const char *text = "<?xml version='1.0' encoding='invalid-9'?>\n"
+ "<doc>Hello world</doc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
+ "Invalid unknown encoding not faulted");
+}
+END_TEST
+
+START_TEST(test_unknown_ascii_encoding_ok) {
+ const char *text = "<?xml version='1.0' encoding='ascii-like'?>\n"
+ "<doc>Hello, world</doc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ run_character_check(text, XCS("Hello, world"));
+}
+END_TEST
+
+START_TEST(test_unknown_ascii_encoding_fail) {
+ const char *text = "<?xml version='1.0' encoding='ascii-like'?>\n"
+ "<doc>Hello, \x80 world</doc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Invalid character not faulted");
+}
+END_TEST
+
+START_TEST(test_unknown_encoding_invalid_length) {
+ const char *text = "<?xml version='1.0' encoding='invalid-len'?>\n"
+ "<doc>Hello, world</doc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
+ "Invalid unknown encoding not faulted");
+}
+END_TEST
+
+START_TEST(test_unknown_encoding_invalid_topbit) {
+ const char *text = "<?xml version='1.0' encoding='invalid-a'?>\n"
+ "<doc>Hello, world</doc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
+ "Invalid unknown encoding not faulted");
+}
+END_TEST
+
+START_TEST(test_unknown_encoding_invalid_surrogate) {
+ const char *text = "<?xml version='1.0' encoding='invalid-surrogate'?>\n"
+ "<doc>Hello, \x82 world</doc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Invalid unknown encoding not faulted");
+}
+END_TEST
+
+START_TEST(test_unknown_encoding_invalid_high) {
+ const char *text = "<?xml version='1.0' encoding='invalid-high'?>\n"
+ "<doc>Hello, world</doc>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
+ "Invalid unknown encoding not faulted");
+}
+END_TEST
+
+START_TEST(test_unknown_encoding_invalid_attr_value) {
+ const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
+ "<doc attr='\xff\x30'/>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Invalid attribute valid not faulted");
+}
+END_TEST
+
+/* Test an external entity parser set to use latin-1 detects UTF-16
+ * BOMs correctly.
+ */
+/* Test that UTF-16 BOM does not select UTF-16 given explicit encoding */
+START_TEST(test_ext_entity_latin1_utf16le_bom) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtTest2 test_data
+ = {/* If UTF-16, 0xfeff is the BOM and 0x204c is black left bullet */
+ /* If Latin-1, 0xff = Y-diaeresis, 0xfe = lowercase thorn,
+ * 0x4c = L and 0x20 is a space
+ */
+ "\xff\xfe\x4c\x20", 4, XCS("iso-8859-1"), NULL};
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00ff\x00feL ");
+#else
+ /* In UTF-8, y-diaeresis is 0xc3 0xbf, lowercase thorn is 0xc3 0xbe */
+ const XML_Char *expected = XCS("\xc3\xbf\xc3\xbeL ");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ test_data.storage = &storage;
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_ext_entity_latin1_utf16be_bom) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtTest2 test_data
+ = {/* If UTF-16, 0xfeff is the BOM and 0x204c is black left bullet */
+ /* If Latin-1, 0xff = Y-diaeresis, 0xfe = lowercase thorn,
+ * 0x4c = L and 0x20 is a space
+ */
+ "\xfe\xff\x20\x4c", 4, XCS("iso-8859-1"), NULL};
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00fe\x00ff L");
+#else
+ /* In UTF-8, y-diaeresis is 0xc3 0xbf, lowercase thorn is 0xc3 0xbe */
+ const XML_Char *expected = XCS("\xc3\xbe\xc3\xbf L");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ test_data.storage = &storage;
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Parsing the full buffer rather than a byte at a time makes a
+ * difference to the encoding scanning code, so repeat the above tests
+ * without breaking them down by byte.
+ */
+START_TEST(test_ext_entity_latin1_utf16le_bom2) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtTest2 test_data
+ = {/* If UTF-16, 0xfeff is the BOM and 0x204c is black left bullet */
+ /* If Latin-1, 0xff = Y-diaeresis, 0xfe = lowercase thorn,
+ * 0x4c = L and 0x20 is a space
+ */
+ "\xff\xfe\x4c\x20", 4, XCS("iso-8859-1"), NULL};
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00ff\x00feL ");
+#else
+ /* In UTF-8, y-diaeresis is 0xc3 0xbf, lowercase thorn is 0xc3 0xbe */
+ const XML_Char *expected = XCS("\xc3\xbf\xc3\xbeL ");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ test_data.storage = &storage;
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_ext_entity_latin1_utf16be_bom2) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtTest2 test_data
+ = {/* If UTF-16, 0xfeff is the BOM and 0x204c is black left bullet */
+ /* If Latin-1, 0xff = Y-diaeresis, 0xfe = lowercase thorn,
+ * 0x4c = L and 0x20 is a space
+ */
+ "\xfe\xff\x20\x4c", 4, XCS("iso-8859-1"), NULL};
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00fe\x00ff L");
+#else
+ /* In UTF-8, y-diaeresis is 0xc3 0xbf, lowercase thorn is 0xc3 0xbe */
+ const XML_Char *expected = "\xc3\xbe\xc3\xbf L";
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ test_data.storage = &storage;
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test little-endian UTF-16 given an explicit big-endian encoding */
+START_TEST(test_ext_entity_utf16_be) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtTest2 test_data = {"<\0e\0/\0>\0", 8, XCS("utf-16be"), NULL};
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x3c00\x6500\x2f00\x3e00");
+#else
+ const XML_Char *expected = XCS("\xe3\xb0\x80" /* U+3C00 */
+ "\xe6\x94\x80" /* U+6500 */
+ "\xe2\xbc\x80" /* U+2F00 */
+ "\xe3\xb8\x80"); /* U+3E00 */
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ test_data.storage = &storage;
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test big-endian UTF-16 given an explicit little-endian encoding */
+START_TEST(test_ext_entity_utf16_le) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtTest2 test_data = {"\0<\0e\0/\0>", 8, XCS("utf-16le"), NULL};
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x3c00\x6500\x2f00\x3e00");
+#else
+ const XML_Char *expected = XCS("\xe3\xb0\x80" /* U+3C00 */
+ "\xe6\x94\x80" /* U+6500 */
+ "\xe2\xbc\x80" /* U+2F00 */
+ "\xe3\xb8\x80"); /* U+3E00 */
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ test_data.storage = &storage;
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test little-endian UTF-16 given no explicit encoding.
+ * The existing default encoding (UTF-8) is assumed to hold without a
+ * BOM to contradict it, so the entity value will in fact provoke an
+ * error because 0x00 is not a valid XML character. We parse the
+ * whole buffer in one go rather than feeding it in byte by byte to
+ * exercise different code paths in the initial scanning routines.
+ */
+START_TEST(test_ext_entity_utf16_unknown) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtFaults2 test_data
+ = {"a\0b\0c\0", 6, "Invalid character in entity not faulted", NULL,
+ XML_ERROR_INVALID_TOKEN};
+
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter2);
+ XML_SetUserData(g_parser, &test_data);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Invalid character should not have been accepted");
+}
+END_TEST
+
+/* Test not-quite-UTF-8 BOM (0xEF 0xBB 0xBF) */
+START_TEST(test_ext_entity_utf8_non_bom) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtTest2 test_data
+ = {"\xef\xbb\x80", /* Arabic letter DAD medial form, U+FEC0 */
+ 3, NULL, NULL};
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\xfec0");
+#else
+ const XML_Char *expected = XCS("\xef\xbb\x80");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ test_data.storage = &storage;
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test that UTF-8 in a CDATA section is correctly passed through */
+START_TEST(test_utf8_in_cdata_section) {
+ const char *text = "<doc><![CDATA[one \xc3\xa9 two]]></doc>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("one \x00e9 two");
+#else
+ const XML_Char *expected = XCS("one \xc3\xa9 two");
+#endif
+
+ run_character_check(text, expected);
+}
+END_TEST
+
+/* Test that little-endian UTF-16 in a CDATA section is handled */
+START_TEST(test_utf8_in_cdata_section_2) {
+ const char *text = "<doc><![CDATA[\xc3\xa9]\xc3\xa9two]]></doc>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00e9]\x00e9two");
+#else
+ const XML_Char *expected = XCS("\xc3\xa9]\xc3\xa9two");
+#endif
+
+ run_character_check(text, expected);
+}
+END_TEST
+
+START_TEST(test_utf8_in_start_tags) {
+ struct test_case {
+ bool goodName;
+ bool goodNameStart;
+ const char *tagName;
+ };
+
+ // The idea with the tests below is this:
+ // We want to cover 1-, 2- and 3-byte sequences, 4-byte sequences
+ // go to isNever and are hence not a concern.
+ //
+ // We start with a character that is a valid name character
+ // (or even name-start character, see XML 1.0r4 spec) and then we flip
+ // single bits at places where (1) the result leaves the UTF-8 encoding space
+ // and (2) we stay in the same n-byte sequence family.
+ //
+ // The flipped bits are highlighted in angle brackets in comments,
+ // e.g. "[<1>011 1001]" means we had [0011 1001] but we now flipped
+ // the most significant bit to 1 to leave UTF-8 encoding space.
+ struct test_case cases[] = {
+ // 1-byte UTF-8: [0xxx xxxx]
+ {true, true, "\x3A"}, // [0011 1010] = ASCII colon ':'
+ {false, false, "\xBA"}, // [<1>011 1010]
+ {true, false, "\x39"}, // [0011 1001] = ASCII nine '9'
+ {false, false, "\xB9"}, // [<1>011 1001]
+
+ // 2-byte UTF-8: [110x xxxx] [10xx xxxx]
+ {true, true, "\xDB\xA5"}, // [1101 1011] [1010 0101] =
+ // Arabic small waw U+06E5
+ {false, false, "\x9B\xA5"}, // [1<0>01 1011] [1010 0101]
+ {false, false, "\xDB\x25"}, // [1101 1011] [<0>010 0101]
+ {false, false, "\xDB\xE5"}, // [1101 1011] [1<1>10 0101]
+ {true, false, "\xCC\x81"}, // [1100 1100] [1000 0001] =
+ // combining char U+0301
+ {false, false, "\x8C\x81"}, // [1<0>00 1100] [1000 0001]
+ {false, false, "\xCC\x01"}, // [1100 1100] [<0>000 0001]
+ {false, false, "\xCC\xC1"}, // [1100 1100] [1<1>00 0001]
+
+ // 3-byte UTF-8: [1110 xxxx] [10xx xxxx] [10xxxxxx]
+ {true, true, "\xE0\xA4\x85"}, // [1110 0000] [1010 0100] [1000 0101] =
+ // Devanagari Letter A U+0905
+ {false, false, "\xA0\xA4\x85"}, // [1<0>10 0000] [1010 0100] [1000 0101]
+ {false, false, "\xE0\x24\x85"}, // [1110 0000] [<0>010 0100] [1000 0101]
+ {false, false, "\xE0\xE4\x85"}, // [1110 0000] [1<1>10 0100] [1000 0101]
+ {false, false, "\xE0\xA4\x05"}, // [1110 0000] [1010 0100] [<0>000 0101]
+ {false, false, "\xE0\xA4\xC5"}, // [1110 0000] [1010 0100] [1<1>00 0101]
+ {true, false, "\xE0\xA4\x81"}, // [1110 0000] [1010 0100] [1000 0001] =
+ // combining char U+0901
+ {false, false, "\xA0\xA4\x81"}, // [1<0>10 0000] [1010 0100] [1000 0001]
+ {false, false, "\xE0\x24\x81"}, // [1110 0000] [<0>010 0100] [1000 0001]
+ {false, false, "\xE0\xE4\x81"}, // [1110 0000] [1<1>10 0100] [1000 0001]
+ {false, false, "\xE0\xA4\x01"}, // [1110 0000] [1010 0100] [<0>000 0001]
+ {false, false, "\xE0\xA4\xC1"}, // [1110 0000] [1010 0100] [1<1>00 0001]
+ };
+ const bool atNameStart[] = {true, false};
+
+ size_t i = 0;
+ char doc[1024];
+ size_t failCount = 0;
+
+ // we need all the bytes to be parsed, but we don't want the errors that can
+ // trigger on isFinal=XML_TRUE, so we skip the test if the heuristic is on.
+ if (g_reparseDeferralEnabledDefault) {
+ return;
+ }
+
+ for (; i < sizeof(cases) / sizeof(cases[0]); i++) {
+ size_t j = 0;
+ for (; j < sizeof(atNameStart) / sizeof(atNameStart[0]); j++) {
+ const bool expectedSuccess
+ = atNameStart[j] ? cases[i].goodNameStart : cases[i].goodName;
+ snprintf(doc, sizeof(doc), "<%s%s><!--", atNameStart[j] ? "" : "a",
+ cases[i].tagName);
+ XML_Parser parser = XML_ParserCreate(NULL);
+
+ const enum XML_Status status = _XML_Parse_SINGLE_BYTES(
+ parser, doc, (int)strlen(doc), /*isFinal=*/XML_FALSE);
+
+ bool success = true;
+ if ((status == XML_STATUS_OK) != expectedSuccess) {
+ success = false;
+ }
+ if ((status == XML_STATUS_ERROR)
+ && (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)) {
+ success = false;
+ }
+
+ if (! success) {
+ fprintf(
+ stderr,
+ "FAIL case %2u (%sat name start, %u-byte sequence, error code %d)\n",
+ (unsigned)i + 1u, atNameStart[j] ? " " : "not ",
+ (unsigned)strlen(cases[i].tagName), XML_GetErrorCode(parser));
+ failCount++;
+ }
+
+ XML_ParserFree(parser);
+ }
+ }
+
+ if (failCount > 0) {
+ fail("UTF-8 regression detected");
+ }
+}
+END_TEST
+
+/* Test trailing spaces in elements are accepted */
+START_TEST(test_trailing_spaces_in_elements) {
+ const char *text = "<doc >Hi</doc >";
+ const XML_Char *expected = XCS("doc/doc");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetElementHandler(g_parser, record_element_start_handler,
+ record_element_end_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_utf16_attribute) {
+ const char text[] =
+ /* <d {KHO KHWAI}{CHO CHAN}='a'/>
+ * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
+ * and {CHO CHAN} = U+0E08 = 0xe0 0xb8 0x88 in UTF-8
+ */
+ "<\0d\0 \0\x04\x0e\x08\x0e=\0'\0a\0'\0/\0>\0";
+ const XML_Char *expected = XCS("a");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetStartElementHandler(g_parser, accumulate_attribute);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_utf16_second_attr) {
+ /* <d a='1' {KHO KHWAI}{CHO CHAN}='2'/>
+ * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
+ * and {CHO CHAN} = U+0E08 = 0xe0 0xb8 0x88 in UTF-8
+ */
+ const char text[] = "<\0d\0 \0a\0=\0'\0\x31\0'\0 \0"
+ "\x04\x0e\x08\x0e=\0'\0\x32\0'\0/\0>\0";
+ const XML_Char *expected = XCS("1");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetStartElementHandler(g_parser, accumulate_attribute);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_attr_after_solidus) {
+ const char *text = "<doc attr1='a' / attr2='b'>";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN, "Misplaced / not faulted");
+}
+END_TEST
+
+START_TEST(test_utf16_pe) {
+ /* <!DOCTYPE doc [
+ * <!ENTITY % {KHO KHWAI}{CHO CHAN} '<!ELEMENT doc (#PCDATA)>'>
+ * %{KHO KHWAI}{CHO CHAN};
+ * ]>
+ * <doc></doc>
+ *
+ * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
+ * and {CHO CHAN} = U+0E08 = 0xe0 0xb8 0x88 in UTF-8
+ */
+ const char text[] = "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0o\0c\0 \0[\0\n"
+ "\0<\0!\0E\0N\0T\0I\0T\0Y\0 \0%\0 \x0e\x04\x0e\x08\0 "
+ "\0'\0<\0!\0E\0L\0E\0M\0E\0N\0T\0 "
+ "\0d\0o\0c\0 \0(\0#\0P\0C\0D\0A\0T\0A\0)\0>\0'\0>\0\n"
+ "\0%\x0e\x04\x0e\x08\0;\0\n"
+ "\0]\0>\0\n"
+ "\0<\0d\0o\0c\0>\0<\0/\0d\0o\0c\0>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x0e04\x0e08=<!ELEMENT doc (#PCDATA)>\n");
+#else
+ const XML_Char *expected
+ = XCS("\xe0\xb8\x84\xe0\xb8\x88=<!ELEMENT doc (#PCDATA)>\n");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetEntityDeclHandler(g_parser, accumulate_entity_decl);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test that duff attribute description keywords are rejected */
+START_TEST(test_bad_attr_desc_keyword) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ATTLIST doc attr CDATA #!IMPLIED>\n"
+ "]>\n"
+ "<doc />";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Bad keyword !IMPLIED not faulted");
+}
+END_TEST
+
+/* Test that an invalid attribute description keyword consisting of
+ * UTF-16 characters with their top bytes non-zero are correctly
+ * faulted
+ */
+START_TEST(test_bad_attr_desc_keyword_utf16) {
+ /* <!DOCTYPE d [
+ * <!ATTLIST d a CDATA #{KHO KHWAI}{CHO CHAN}>
+ * ]><d/>
+ *
+ * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
+ * and {CHO CHAN} = U+0E08 = 0xe0 0xb8 0x88 in UTF-8
+ */
+ const char text[]
+ = "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 \0[\0\n"
+ "\0<\0!\0A\0T\0T\0L\0I\0S\0T\0 \0d\0 \0a\0 \0C\0D\0A\0T\0A\0 "
+ "\0#\x0e\x04\x0e\x08\0>\0\n"
+ "\0]\0>\0<\0d\0/\0>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Invalid UTF16 attribute keyword not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_SYNTAX)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test that invalid syntax in a <!DOCTYPE> is rejected. Do this
+ * using prefix-encoding (see above) to trigger specific code paths
+ */
+START_TEST(test_bad_doctype) {
+ const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
+ "<!DOCTYPE doc [ \x80\x44 ]><doc/>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ expect_failure(text, XML_ERROR_SYNTAX,
+ "Invalid bytes in DOCTYPE not faulted");
+}
+END_TEST
+
+START_TEST(test_bad_doctype_utf8) {
+ const char *text = "<!DOCTYPE \xDB\x25"
+ "doc><doc/>"; // [1101 1011] [<0>010 0101]
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Invalid UTF-8 in DOCTYPE not faulted");
+}
+END_TEST
+
+START_TEST(test_bad_doctype_utf16) {
+ const char text[] =
+ /* <!DOCTYPE doc [ \x06f2 ]><doc/>
+ *
+ * U+06F2 = EXTENDED ARABIC-INDIC DIGIT TWO, a valid number
+ * (name character) but not a valid letter (name start character)
+ */
+ "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0o\0c\0 \0[\0 "
+ "\x06\xf2"
+ "\0 \0]\0>\0<\0d\0o\0c\0/\0>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Invalid bytes in DOCTYPE not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_SYNTAX)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_bad_doctype_plus) {
+ const char *text = "<!DOCTYPE 1+ [ <!ENTITY foo 'bar'> ]>\n"
+ "<1+>&foo;</1+>";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "'+' in document name not faulted");
+}
+END_TEST
+
+START_TEST(test_bad_doctype_star) {
+ const char *text = "<!DOCTYPE 1* [ <!ENTITY foo 'bar'> ]>\n"
+ "<1*>&foo;</1*>";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "'*' in document name not faulted");
+}
+END_TEST
+
+START_TEST(test_bad_doctype_query) {
+ const char *text = "<!DOCTYPE 1? [ <!ENTITY foo 'bar'> ]>\n"
+ "<1?>&foo;</1?>";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "'?' in document name not faulted");
+}
+END_TEST
+
+START_TEST(test_unknown_encoding_bad_ignore) {
+ const char *text = "<?xml version='1.0' encoding='prefix-conv'?>"
+ "<!DOCTYPE doc SYSTEM 'foo'>"
+ "<doc><e>&entity;</e></doc>";
+ ExtFaults fault = {"<![IGNORE[<!ELEMENT \xffG (#PCDATA)*>]]>",
+ "Invalid character not faulted", XCS("prefix-conv"),
+ XML_ERROR_INVALID_TOKEN};
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
+ XML_SetUserData(g_parser, &fault);
+ expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ "Bad IGNORE section with unknown encoding not failed");
+}
+END_TEST
+
+START_TEST(test_entity_in_utf16_be_attr) {
+ const char text[] =
+ /* <e a='&#228; &#x00E4;'></e> */
+ "\0<\0e\0 \0a\0=\0'\0&\0#\0\x32\0\x32\0\x38\0;\0 "
+ "\0&\0#\0x\0\x30\0\x30\0E\0\x34\0;\0'\0>\0<\0/\0e\0>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00e4 \x00e4");
+#else
+ const XML_Char *expected = XCS("\xc3\xa4 \xc3\xa4");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetStartElementHandler(g_parser, accumulate_attribute);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_entity_in_utf16_le_attr) {
+ const char text[] =
+ /* <e a='&#228; &#x00E4;'></e> */
+ "<\0e\0 \0a\0=\0'\0&\0#\0\x32\0\x32\0\x38\0;\0 \0"
+ "&\0#\0x\0\x30\0\x30\0E\0\x34\0;\0'\0>\0<\0/\0e\0>\0";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("\x00e4 \x00e4");
+#else
+ const XML_Char *expected = XCS("\xc3\xa4 \xc3\xa4");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetStartElementHandler(g_parser, accumulate_attribute);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_entity_public_utf16_be) {
+ const char text[] =
+ /* <!DOCTYPE d [ */
+ "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 \0[\0\n"
+ /* <!ENTITY % e PUBLIC 'foo' 'bar.ent'> */
+ "\0<\0!\0E\0N\0T\0I\0T\0Y\0 \0%\0 \0e\0 \0P\0U\0B\0L\0I\0C\0 "
+ "\0'\0f\0o\0o\0'\0 \0'\0b\0a\0r\0.\0e\0n\0t\0'\0>\0\n"
+ /* %e; */
+ "\0%\0e\0;\0\n"
+ /* ]> */
+ "\0]\0>\0\n"
+ /* <d>&j;</d> */
+ "\0<\0d\0>\0&\0j\0;\0<\0/\0d\0>";
+ ExtTest2 test_data
+ = {/* <!ENTITY j 'baz'> */
+ "\0<\0!\0E\0N\0T\0I\0T\0Y\0 \0j\0 \0'\0b\0a\0z\0'\0>", 34, NULL, NULL};
+ const XML_Char *expected = XCS("baz");
+ CharData storage;
+
+ CharData_Init(&storage);
+ test_data.storage = &storage;
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_entity_public_utf16_le) {
+ const char text[] =
+ /* <!DOCTYPE d [ */
+ "<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 \0[\0\n\0"
+ /* <!ENTITY % e PUBLIC 'foo' 'bar.ent'> */
+ "<\0!\0E\0N\0T\0I\0T\0Y\0 \0%\0 \0e\0 \0P\0U\0B\0L\0I\0C\0 \0"
+ "'\0f\0o\0o\0'\0 \0'\0b\0a\0r\0.\0e\0n\0t\0'\0>\0\n\0"
+ /* %e; */
+ "%\0e\0;\0\n\0"
+ /* ]> */
+ "]\0>\0\n\0"
+ /* <d>&j;</d> */
+ "<\0d\0>\0&\0j\0;\0<\0/\0d\0>\0";
+ ExtTest2 test_data
+ = {/* <!ENTITY j 'baz'> */
+ "<\0!\0E\0N\0T\0I\0T\0Y\0 \0j\0 \0'\0b\0a\0z\0'\0>\0", 34, NULL, NULL};
+ const XML_Char *expected = XCS("baz");
+ CharData storage;
+
+ CharData_Init(&storage);
+ test_data.storage = &storage;
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test that a doctype with neither an internal nor external subset is
+ * faulted
+ */
+START_TEST(test_short_doctype) {
+ const char *text = "<!DOCTYPE doc></doc>";
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "DOCTYPE without subset not rejected");
+}
+END_TEST
+
+START_TEST(test_short_doctype_2) {
+ const char *text = "<!DOCTYPE doc PUBLIC></doc>";
+ expect_failure(text, XML_ERROR_SYNTAX,
+ "DOCTYPE without Public ID not rejected");
+}
+END_TEST
+
+START_TEST(test_short_doctype_3) {
+ const char *text = "<!DOCTYPE doc SYSTEM></doc>";
+ expect_failure(text, XML_ERROR_SYNTAX,
+ "DOCTYPE without System ID not rejected");
+}
+END_TEST
+
+START_TEST(test_long_doctype) {
+ const char *text = "<!DOCTYPE doc PUBLIC 'foo' 'bar' 'baz'></doc>";
+ expect_failure(text, XML_ERROR_SYNTAX, "DOCTYPE with extra ID not rejected");
+}
+END_TEST
+
+START_TEST(test_bad_entity) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY foo PUBLIC>\n"
+ "]>\n"
+ "<doc/>";
+ expect_failure(text, XML_ERROR_SYNTAX,
+ "ENTITY without Public ID is not rejected");
+}
+END_TEST
+
+/* Test unquoted value is faulted */
+START_TEST(test_bad_entity_2) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY % foo bar>\n"
+ "]>\n"
+ "<doc/>";
+ expect_failure(text, XML_ERROR_SYNTAX,
+ "ENTITY without Public ID is not rejected");
+}
+END_TEST
+
+START_TEST(test_bad_entity_3) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY % foo PUBLIC>\n"
+ "]>\n"
+ "<doc/>";
+ expect_failure(text, XML_ERROR_SYNTAX,
+ "Parameter ENTITY without Public ID is not rejected");
+}
+END_TEST
+
+START_TEST(test_bad_entity_4) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ENTITY % foo SYSTEM>\n"
+ "]>\n"
+ "<doc/>";
+ expect_failure(text, XML_ERROR_SYNTAX,
+ "Parameter ENTITY without Public ID is not rejected");
+}
+END_TEST
+
+START_TEST(test_bad_notation) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!NOTATION n SYSTEM>\n"
+ "]>\n"
+ "<doc/>";
+ expect_failure(text, XML_ERROR_SYNTAX,
+ "Notation without System ID is not rejected");
+}
+END_TEST
+
+/* Test for issue #11, wrongly suppressed default handler */
+START_TEST(test_default_doctype_handler) {
+ const char *text = "<!DOCTYPE doc PUBLIC 'pubname' 'test.dtd' [\n"
+ " <!ENTITY foo 'bar'>\n"
+ "]>\n"
+ "<doc>&foo;</doc>";
+ DefaultCheck test_data[] = {{XCS("'pubname'"), 9, XML_FALSE},
+ {XCS("'test.dtd'"), 10, XML_FALSE},
+ {NULL, 0, XML_FALSE}};
+ int i;
+
+ XML_SetUserData(g_parser, &test_data);
+ XML_SetDefaultHandler(g_parser, checking_default_handler);
+ XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ for (i = 0; test_data[i].expected != NULL; i++)
+ if (! test_data[i].seen)
+ fail("Default handler not run for public !DOCTYPE");
+}
+END_TEST
+
+START_TEST(test_empty_element_abort) {
+ const char *text = "<abort/>";
+
+ XML_SetStartElementHandler(g_parser, start_element_suspender);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Expected to error on abort");
+}
+END_TEST
+
+/* Regression test for GH issue #612: unfinished m_declAttributeType
+ * allocation in ->m_tempPool can corrupt following allocation.
+ */
+START_TEST(test_pool_integrity_with_unfinished_attr) {
+ const char *text = "<?xml version='1.0' encoding='UTF-8'?>\n"
+ "<!DOCTYPE foo [\n"
+ "<!ELEMENT foo ANY>\n"
+ "<!ENTITY % entp SYSTEM \"external.dtd\">\n"
+ "%entp;\n"
+ "]>\n"
+ "<a></a>\n";
+ const XML_Char *expected = XCS("COMMENT");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_unfinished_attlist);
+ XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
+ XML_SetCommentHandler(g_parser, accumulate_comment);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+/* Test a possible early return location in internalEntityProcessor */
+START_TEST(test_entity_ref_no_elements) {
+ const char *const text = "<!DOCTYPE foo [\n"
+ "<!ENTITY e1 \"test\">\n"
+ "]> <foo>&e1;"; // intentionally missing newline
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR);
+ assert_true(XML_GetErrorCode(parser) == XML_ERROR_NO_ELEMENTS);
+ XML_ParserFree(parser);
+}
+END_TEST
+
+/* Tests if chained entity references lead to unbounded recursion */
+START_TEST(test_deep_nested_entity) {
+ const size_t N_LINES = 60000;
+ const size_t SIZE_PER_LINE = 50;
+
+ char *const text = (char *)malloc((N_LINES + 4) * SIZE_PER_LINE);
+ if (text == NULL) {
+ fail("malloc failed");
+ }
+
+ char *textPtr = text;
+
+ // Create the XML
+ textPtr += snprintf(textPtr, SIZE_PER_LINE,
+ "<!DOCTYPE foo [\n"
+ " <!ENTITY s0 'deepText'>\n");
+
+ for (size_t i = 1; i < N_LINES; ++i) {
+ textPtr += snprintf(textPtr, SIZE_PER_LINE, " <!ENTITY s%lu '&s%lu;'>\n",
+ (long unsigned)i, (long unsigned)(i - 1));
+ }
+
+ snprintf(textPtr, SIZE_PER_LINE, "]> <foo>&s%lu;</foo>\n",
+ (long unsigned)(N_LINES - 1));
+
+ const XML_Char *const expected = XCS("deepText");
+
+ CharData storage;
+ CharData_Init(&storage);
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+
+ XML_SetCharacterDataHandler(parser, accumulate_characters);
+ XML_SetUserData(parser, &storage);
+
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+
+ CharData_CheckXMLChars(&storage, expected);
+ XML_ParserFree(parser);
+ free(text);
+}
+END_TEST
+
+/* Tests if chained entity references in attributes
+lead to unbounded recursion */
+START_TEST(test_deep_nested_attribute_entity) {
+ const size_t N_LINES = 60000;
+ const size_t SIZE_PER_LINE = 100;
+
+ char *const text = (char *)malloc((N_LINES + 4) * SIZE_PER_LINE);
+ if (text == NULL) {
+ fail("malloc failed");
+ }
+
+ char *textPtr = text;
+
+ // Create the XML
+ textPtr += snprintf(textPtr, SIZE_PER_LINE,
+ "<!DOCTYPE foo [\n"
+ " <!ENTITY s0 'deepText'>\n");
+
+ for (size_t i = 1; i < N_LINES; ++i) {
+ textPtr += snprintf(textPtr, SIZE_PER_LINE, " <!ENTITY s%lu '&s%lu;'>\n",
+ (long unsigned)i, (long unsigned)(i - 1));
+ }
+
+ snprintf(textPtr, SIZE_PER_LINE, "]> <foo name='&s%lu;'>mainText</foo>\n",
+ (long unsigned)(N_LINES - 1));
+
+ AttrInfo doc_info[] = {{XCS("name"), XCS("deepText")}, {NULL, NULL}};
+ ElementInfo info[] = {{XCS("foo"), 1, NULL, NULL}, {NULL, 0, NULL, NULL}};
+ info[0].attributes = doc_info;
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ ParserAndElementInfo parserPlusElemenInfo = {parser, info};
+
+ XML_SetStartElementHandler(parser, counting_start_element_handler);
+ XML_SetUserData(parser, &parserPlusElemenInfo);
+
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+
+ XML_ParserFree(parser);
+ free(text);
+}
+END_TEST
+
+START_TEST(test_deep_nested_entity_delayed_interpretation) {
+ const size_t N_LINES = 70000;
+ const size_t SIZE_PER_LINE = 100;
+
+ char *const text = (char *)malloc((N_LINES + 4) * SIZE_PER_LINE);
+ if (text == NULL) {
+ fail("malloc failed");
+ }
+
+ char *textPtr = text;
+
+ // Create the XML
+ textPtr += snprintf(textPtr, SIZE_PER_LINE,
+ "<!DOCTYPE foo [\n"
+ " <!ENTITY %% s0 'deepText'>\n");
+
+ for (size_t i = 1; i < N_LINES; ++i) {
+ textPtr += snprintf(textPtr, SIZE_PER_LINE,
+ " <!ENTITY %% s%lu '&#37;s%lu;'>\n", (long unsigned)i,
+ (long unsigned)(i - 1));
+ }
+
+ snprintf(textPtr, SIZE_PER_LINE,
+ " <!ENTITY %% define_g \"<!ENTITY g '&#37;s%lu;'>\">\n"
+ " %%define_g;\n"
+ "]>\n"
+ "<foo/>\n",
+ (long unsigned)(N_LINES - 1));
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+
+ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+
+ XML_ParserFree(parser);
+ free(text);
+}
+END_TEST
+
+START_TEST(test_nested_entity_suspend) {
+ const char *const text = "<!DOCTYPE a [\n"
+ " <!ENTITY e1 '<!--e1-->'>\n"
+ " <!ENTITY e2 '<!--e2 head-->&e1;<!--e2 tail-->'>\n"
+ " <!ENTITY e3 '<!--e3 head-->&e2;<!--e3 tail-->'>\n"
+ "]>\n"
+ "<a><!--start-->&e3;<!--end--></a>";
+ const XML_Char *const expected = XCS("start") XCS("e3 head") XCS("e2 head")
+ XCS("e1") XCS("e2 tail") XCS("e3 tail") XCS("end");
+ CharData storage;
+ CharData_Init(&storage);
+ XML_Parser parser = XML_ParserCreate(NULL);
+ ParserPlusStorage parserPlusStorage = {parser, &storage};
+
+ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetCommentHandler(parser, accumulate_and_suspend_comment_handler);
+ XML_SetUserData(parser, &parserPlusStorage);
+
+ enum XML_Status status = XML_Parse(parser, text, (int)strlen(text), XML_TRUE);
+ while (status == XML_STATUS_SUSPENDED) {
+ status = XML_ResumeParser(parser);
+ }
+ if (status != XML_STATUS_OK)
+ xml_failure(parser);
+
+ CharData_CheckXMLChars(&storage, expected);
+ XML_ParserFree(parser);
+}
+END_TEST
+
+START_TEST(test_nested_entity_suspend_2) {
+ const char *const text = "<!DOCTYPE doc [\n"
+ " <!ENTITY ge1 'head1Ztail1'>\n"
+ " <!ENTITY ge2 'head2&ge1;tail2'>\n"
+ " <!ENTITY ge3 'head3&ge2;tail3'>\n"
+ "]>\n"
+ "<doc>&ge3;</doc>";
+ const XML_Char *const expected = XCS("head3") XCS("head2") XCS("head1")
+ XCS("Z") XCS("tail1") XCS("tail2") XCS("tail3");
+ CharData storage;
+ CharData_Init(&storage);
+ XML_Parser parser = XML_ParserCreate(NULL);
+ ParserPlusStorage parserPlusStorage = {parser, &storage};
+
+ XML_SetCharacterDataHandler(parser, accumulate_char_data_and_suspend);
+ XML_SetUserData(parser, &parserPlusStorage);
+
+ enum XML_Status status = XML_Parse(parser, text, (int)strlen(text), XML_TRUE);
+ while (status == XML_STATUS_SUSPENDED) {
+ status = XML_ResumeParser(parser);
+ }
+ if (status != XML_STATUS_OK)
+ xml_failure(parser);
+
+ CharData_CheckXMLChars(&storage, expected);
+ XML_ParserFree(parser);
+}
+END_TEST
+
+/* Regression test for quadratic parsing on large tokens */
+START_TEST(test_big_tokens_scale_linearly) {
+ const struct {
+ const char *pre;
+ const char *post;
+ } text[] = {
+ {"<a>", "</a>"}, // assumed good, used as baseline
+ {"<b><![CDATA[ value: ", " ]]></b>"}, // CDATA, performed OK before patch
+ {"<c attr='", "'></c>"}, // big attribute, used to be O(N²)
+ {"<d><!-- ", " --></d>"}, // long comment, used to be O(N²)
+ {"<e><", "/></e>"}, // big elem name, used to be O(N²)
+ };
+ const int num_cases = sizeof(text) / sizeof(text[0]);
+ char aaaaaa[4096];
+ const int fillsize = (int)sizeof(aaaaaa);
+ const int fillcount = 100;
+ const unsigned approx_bytes = fillsize * fillcount; // ignore pre/post.
+ const unsigned max_factor = 4;
+ const unsigned max_scanned = max_factor * approx_bytes;
+
+ memset(aaaaaa, 'a', fillsize);
+
+ if (! g_reparseDeferralEnabledDefault) {
+ return; // heuristic is disabled; we would get O(n^2) and fail.
+ }
+
+ for (int i = 0; i < num_cases; ++i) {
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+ enum XML_Status status;
+ set_subtest("text=\"%saaaaaa%s\"", text[i].pre, text[i].post);
+
+ // parse the start text
+ g_bytesScanned = 0;
+ status = _XML_Parse_SINGLE_BYTES(parser, text[i].pre,
+ (int)strlen(text[i].pre), XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+
+ // parse lots of 'a', failing the test early if it takes too long
+ unsigned past_max_count = 0;
+ for (int f = 0; f < fillcount; ++f) {
+ status = _XML_Parse_SINGLE_BYTES(parser, aaaaaa, fillsize, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ if (g_bytesScanned > max_scanned) {
+ // We're not done, and have already passed the limit -- the test will
+ // definitely fail. This block allows us to save time by failing early.
+ const unsigned pushed
+ = (unsigned)strlen(text[i].pre) + (f + 1) * fillsize;
+ fprintf(
+ stderr,
+ "after %d/%d loops: pushed=%u scanned=%u (factor ~%.2f) max_scanned: %u (factor ~%u)\n",
+ f + 1, fillcount, pushed, g_bytesScanned,
+ g_bytesScanned / (double)pushed, max_scanned, max_factor);
+ past_max_count++;
+ // We are failing, but allow a few log prints first. If we don't reach
+ // a count of five, the test will fail after the loop instead.
+ assert_true(past_max_count < 5);
+ }
+ }
+
+ // parse the end text
+ status = _XML_Parse_SINGLE_BYTES(parser, text[i].post,
+ (int)strlen(text[i].post), XML_TRUE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+
+ assert_true(g_bytesScanned > approx_bytes); // or the counter isn't working
+ if (g_bytesScanned > max_scanned) {
+ fprintf(
+ stderr,
+ "after all input: scanned=%u (factor ~%.2f) max_scanned: %u (factor ~%u)\n",
+ g_bytesScanned, g_bytesScanned / (double)approx_bytes, max_scanned,
+ max_factor);
+ fail("scanned too many bytes");
+ }
+
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+START_TEST(test_set_reparse_deferral) {
+ const char *const pre = "<d>";
+ const char *const start = "<x attr='";
+ const char *const end = "'></x>";
+ char eeeeee[100];
+ const int fillsize = (int)sizeof(eeeeee);
+ memset(eeeeee, 'e', fillsize);
+
+ for (int enabled = 0; enabled <= 1; enabled += 1) {
+ set_subtest("deferral=%d", enabled);
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+ assert_true(XML_SetReparseDeferralEnabled(parser, enabled));
+ // pre-grow the buffer to avoid reparsing due to almost-fullness
+ assert_true(XML_GetBuffer(parser, fillsize * 10103) != NULL);
+
+ CharData storage;
+ CharData_Init(&storage);
+ XML_SetUserData(parser, &storage);
+ XML_SetStartElementHandler(parser, start_element_event_handler);
+
+ enum XML_Status status;
+ // parse the start text
+ status = XML_Parse(parser, pre, (int)strlen(pre), XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ CharData_CheckXMLChars(&storage, XCS("d")); // first element should be done
+
+ // ..and the start of the token
+ status = XML_Parse(parser, start, (int)strlen(start), XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ CharData_CheckXMLChars(&storage, XCS("d")); // still just the first one
+
+ // try to parse lots of 'e', but the token isn't finished
+ for (int c = 0; c < 100; ++c) {
+ status = XML_Parse(parser, eeeeee, fillsize, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ }
+ CharData_CheckXMLChars(&storage, XCS("d")); // *still* just the first one
+
+ // end the <x> token.
+ status = XML_Parse(parser, end, (int)strlen(end), XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+
+ if (enabled) {
+ // In general, we may need to push more data to trigger a reparse attempt,
+ // but in this test, the data is constructed to always require it.
+ CharData_CheckXMLChars(&storage, XCS("d")); // or the test is incorrect
+ // 2x the token length should suffice; the +1 covers the start and end.
+ for (int c = 0; c < 101; ++c) {
+ status = XML_Parse(parser, eeeeee, fillsize, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ }
+ }
+ CharData_CheckXMLChars(&storage, XCS("dx")); // the <x> should be done
+
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+struct element_decl_data {
+ XML_Parser parser;
+ int count;
+};
+
+static void
+element_decl_counter(void *userData, const XML_Char *name, XML_Content *model) {
+ UNUSED_P(name);
+ struct element_decl_data *testdata = (struct element_decl_data *)userData;
+ testdata->count += 1;
+ XML_FreeContentModel(testdata->parser, model);
+}
+
+static int
+external_inherited_parser(XML_Parser p, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ const char *const pre = "<!ELEMENT document ANY>\n";
+ const char *const start = "<!ELEMENT ";
+ const char *const end = " ANY>\n";
+ const char *const post = "<!ELEMENT xyz ANY>\n";
+ const int enabled = *(int *)XML_GetUserData(p);
+ char eeeeee[100];
+ char spaces[100];
+ const int fillsize = (int)sizeof(eeeeee);
+ assert_true(fillsize == (int)sizeof(spaces));
+ memset(eeeeee, 'e', fillsize);
+ memset(spaces, ' ', fillsize);
+
+ XML_Parser parser = XML_ExternalEntityParserCreate(p, context, NULL);
+ assert_true(parser != NULL);
+ // pre-grow the buffer to avoid reparsing due to almost-fullness
+ assert_true(XML_GetBuffer(parser, fillsize * 10103) != NULL);
+
+ struct element_decl_data testdata;
+ testdata.parser = parser;
+ testdata.count = 0;
+ XML_SetUserData(parser, &testdata);
+ XML_SetElementDeclHandler(parser, element_decl_counter);
+
+ enum XML_Status status;
+ // parse the initial text
+ status = XML_Parse(parser, pre, (int)strlen(pre), XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ assert_true(testdata.count == 1); // first element should be done
+
+ // ..and the start of the big token
+ status = XML_Parse(parser, start, (int)strlen(start), XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ assert_true(testdata.count == 1); // still just the first one
+
+ // try to parse lots of 'e', but the token isn't finished
+ for (int c = 0; c < 100; ++c) {
+ status = XML_Parse(parser, eeeeee, fillsize, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ }
+ assert_true(testdata.count == 1); // *still* just the first one
+
+ // end the big token.
+ status = XML_Parse(parser, end, (int)strlen(end), XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+
+ if (enabled) {
+ // In general, we may need to push more data to trigger a reparse attempt,
+ // but in this test, the data is constructed to always require it.
+ assert_true(testdata.count == 1); // or the test is incorrect
+ // 2x the token length should suffice; the +1 covers the start and end.
+ for (int c = 0; c < 101; ++c) {
+ status = XML_Parse(parser, spaces, fillsize, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ }
+ }
+ assert_true(testdata.count == 2); // the big token should be done
+
+ // parse the final text
+ status = XML_Parse(parser, post, (int)strlen(post), XML_TRUE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ assert_true(testdata.count == 3); // after isFinal=XML_TRUE, all must be done
+
+ XML_ParserFree(parser);
+ return XML_STATUS_OK;
+}
+
+START_TEST(test_reparse_deferral_is_inherited) {
+ const char *const text
+ = "<!DOCTYPE document SYSTEM 'something.ext'><document/>";
+ for (int enabled = 0; enabled <= 1; ++enabled) {
+ set_subtest("deferral=%d", enabled);
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+ XML_SetUserData(parser, (void *)&enabled);
+ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ // this handler creates a sub-parser and checks that its deferral behavior
+ // is what we expected, based on the value of `enabled` (in userdata).
+ XML_SetExternalEntityRefHandler(parser, external_inherited_parser);
+ assert_true(XML_SetReparseDeferralEnabled(parser, enabled));
+ if (XML_Parse(parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_OK)
+ xml_failure(parser);
+
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+START_TEST(test_set_reparse_deferral_on_null_parser) {
+ assert_true(XML_SetReparseDeferralEnabled(NULL, 0) == XML_FALSE);
+ assert_true(XML_SetReparseDeferralEnabled(NULL, 1) == XML_FALSE);
+ assert_true(XML_SetReparseDeferralEnabled(NULL, 10) == XML_FALSE);
+ assert_true(XML_SetReparseDeferralEnabled(NULL, 100) == XML_FALSE);
+ assert_true(XML_SetReparseDeferralEnabled(NULL, (XML_Bool)INT_MIN)
+ == XML_FALSE);
+ assert_true(XML_SetReparseDeferralEnabled(NULL, (XML_Bool)INT_MAX)
+ == XML_FALSE);
+}
+END_TEST
+
+START_TEST(test_set_reparse_deferral_on_the_fly) {
+ const char *const pre = "<d><x attr='";
+ const char *const end = "'></x>";
+ char iiiiii[100];
+ const int fillsize = (int)sizeof(iiiiii);
+ memset(iiiiii, 'i', fillsize);
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+ assert_true(XML_SetReparseDeferralEnabled(parser, XML_TRUE));
+
+ CharData storage;
+ CharData_Init(&storage);
+ XML_SetUserData(parser, &storage);
+ XML_SetStartElementHandler(parser, start_element_event_handler);
+
+ enum XML_Status status;
+ // parse the start text
+ status = XML_Parse(parser, pre, (int)strlen(pre), XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ CharData_CheckXMLChars(&storage, XCS("d")); // first element should be done
+
+ // try to parse some 'i', but the token isn't finished
+ status = XML_Parse(parser, iiiiii, fillsize, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ CharData_CheckXMLChars(&storage, XCS("d")); // *still* just the first one
+
+ // end the <x> token.
+ status = XML_Parse(parser, end, (int)strlen(end), XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ CharData_CheckXMLChars(&storage, XCS("d")); // not yet.
+
+ // now change the heuristic setting and add *no* data
+ assert_true(XML_SetReparseDeferralEnabled(parser, XML_FALSE));
+ // we avoid isFinal=XML_TRUE, because that would force-bypass the heuristic.
+ status = XML_Parse(parser, "", 0, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ CharData_CheckXMLChars(&storage, XCS("dx"));
+
+ XML_ParserFree(parser);
+}
+END_TEST
+
+START_TEST(test_set_bad_reparse_option) {
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(XML_FALSE == XML_SetReparseDeferralEnabled(parser, 2));
+ assert_true(XML_FALSE == XML_SetReparseDeferralEnabled(parser, 3));
+ assert_true(XML_FALSE == XML_SetReparseDeferralEnabled(parser, 99));
+ assert_true(XML_FALSE == XML_SetReparseDeferralEnabled(parser, 127));
+ assert_true(XML_FALSE == XML_SetReparseDeferralEnabled(parser, 128));
+ assert_true(XML_FALSE == XML_SetReparseDeferralEnabled(parser, 129));
+ assert_true(XML_FALSE == XML_SetReparseDeferralEnabled(parser, 255));
+ assert_true(XML_TRUE == XML_SetReparseDeferralEnabled(parser, 0));
+ assert_true(XML_TRUE == XML_SetReparseDeferralEnabled(parser, 1));
+ XML_ParserFree(parser);
+}
+END_TEST
+
+static size_t g_totalAlloc = 0;
+static size_t g_biggestAlloc = 0;
+
+static void *
+counting_realloc(void *ptr, size_t size) {
+ g_totalAlloc += size;
+ if (size > g_biggestAlloc) {
+ g_biggestAlloc = size;
+ }
+ return realloc(ptr, size);
+}
+
+static void *
+counting_malloc(size_t size) {
+ return counting_realloc(NULL, size);
+}
+
+START_TEST(test_bypass_heuristic_when_close_to_bufsize) {
+ if (g_chunkSize != 0) {
+ // this test does not use SINGLE_BYTES, because it depends on very precise
+ // buffer fills.
+ return;
+ }
+ if (! g_reparseDeferralEnabledDefault) {
+ return; // this test is irrelevant when the deferral heuristic is disabled.
+ }
+
+ const int document_length = 65536;
+ char *const document = (char *)malloc(document_length);
+
+ const XML_Memory_Handling_Suite memfuncs = {
+ counting_malloc,
+ counting_realloc,
+ free,
+ };
+
+ const int leading_list[] = {0, 3, 61, 96, 400, 401, 4000, 4010, 4099, -1};
+ const int bigtoken_list[] = {3000, 4000, 4001, 4096, 4099, 5000, 20000, -1};
+ const int fillsize_list[] = {131, 256, 399, 400, 401, 1025, 4099, 4321, -1};
+
+ for (const int *leading = leading_list; *leading >= 0; leading++) {
+ for (const int *bigtoken = bigtoken_list; *bigtoken >= 0; bigtoken++) {
+ for (const int *fillsize = fillsize_list; *fillsize >= 0; fillsize++) {
+ set_subtest("leading=%d bigtoken=%d fillsize=%d", *leading, *bigtoken,
+ *fillsize);
+ // start by checking that the test looks reasonably valid
+ assert_true(*leading + *bigtoken <= document_length);
+
+ // put 'x' everywhere; some will be overwritten by elements.
+ memset(document, 'x', document_length);
+ // maybe add an initial tag
+ if (*leading) {
+ assert_true(*leading >= 3); // or the test case is invalid
+ memcpy(document, "<a>", 3);
+ }
+ // add the large token
+ document[*leading + 0] = '<';
+ document[*leading + 1] = 'b';
+ memset(&document[*leading + 2], ' ', *bigtoken - 2); // a spacy token
+ document[*leading + *bigtoken - 1] = '>';
+
+ // 1 for 'b', plus 1 or 0 depending on the presence of 'a'
+ const int expected_elem_total = 1 + (*leading ? 1 : 0);
+
+ XML_Parser parser = XML_ParserCreate_MM(NULL, &memfuncs, NULL);
+ assert_true(parser != NULL);
+
+ CharData storage;
+ CharData_Init(&storage);
+ XML_SetUserData(parser, &storage);
+ XML_SetStartElementHandler(parser, start_element_event_handler);
+
+ g_biggestAlloc = 0;
+ g_totalAlloc = 0;
+ int offset = 0;
+ // fill data until the big token is covered (but not necessarily parsed)
+ while (offset < *leading + *bigtoken) {
+ assert_true(offset + *fillsize <= document_length);
+ const enum XML_Status status
+ = XML_Parse(parser, &document[offset], *fillsize, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ offset += *fillsize;
+ }
+ // Now, check that we've had a buffer allocation that could fit the
+ // context bytes and our big token. In order to detect a special case,
+ // we need to know how many bytes of our big token were included in the
+ // first push that contained _any_ bytes of the big token:
+ const int bigtok_first_chunk_bytes = *fillsize - (*leading % *fillsize);
+ if (bigtok_first_chunk_bytes >= *bigtoken && XML_CONTEXT_BYTES == 0) {
+ // Special case: we aren't saving any context, and the whole big token
+ // was covered by a single fill, so Expat may have parsed directly
+ // from our input pointer, without allocating an internal buffer.
+ } else if (*leading < XML_CONTEXT_BYTES) {
+ assert_true(g_biggestAlloc >= *leading + (size_t)*bigtoken);
+ } else {
+ assert_true(g_biggestAlloc >= XML_CONTEXT_BYTES + (size_t)*bigtoken);
+ }
+ // fill data until the big token is actually parsed
+ while (storage.count < expected_elem_total) {
+ const size_t alloc_before = g_totalAlloc;
+ assert_true(offset + *fillsize <= document_length);
+ const enum XML_Status status
+ = XML_Parse(parser, &document[offset], *fillsize, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ offset += *fillsize;
+ // since all the bytes of the big token are already in the buffer,
+ // the bufsize ceiling should make us finish its parsing without any
+ // further buffer allocations. We assume that there will be no other
+ // large allocations in this test.
+ assert_true(g_totalAlloc - alloc_before < 4096);
+ }
+ // test-the-test: was our alloc even called?
+ assert_true(g_totalAlloc > 0);
+ // test-the-test: there shouldn't be any extra start elements
+ assert_true(storage.count == expected_elem_total);
+
+ XML_ParserFree(parser);
+ }
+ }
+ }
+ free(document);
+}
+END_TEST
+
+START_TEST(test_varying_buffer_fills) {
+ const int KiB = 1024;
+ const int MiB = 1024 * KiB;
+ const int document_length = 16 * MiB;
+ const int big = 7654321; // arbitrarily chosen between 4 and 8 MiB
+
+ if (g_chunkSize != 0) {
+ return; // this test is slow, and doesn't use _XML_Parse_SINGLE_BYTES().
+ }
+
+ char *const document = (char *)malloc(document_length);
+ assert_true(document != NULL);
+ memset(document, 'x', document_length);
+ document[0] = '<';
+ document[1] = 't';
+ memset(&document[2], ' ', big - 2); // a very spacy token
+ document[big - 1] = '>';
+
+ // Each testcase is a list of buffer fill sizes, terminated by a value < 0.
+ // When reparse deferral is enabled, the final (negated) value is the expected
+ // maximum number of bytes scanned in parse attempts.
+ const int testcases[][30] = {
+ {8 * MiB, -8 * MiB},
+ {4 * MiB, 4 * MiB, -12 * MiB}, // try at 4MB, then 8MB = 12 MB total
+ // zero-size fills shouldn't trigger the bypass
+ {4 * MiB, 0, 4 * MiB, -12 * MiB},
+ {4 * MiB, 0, 0, 4 * MiB, -12 * MiB},
+ {4 * MiB, 0, 1 * MiB, 0, 3 * MiB, -12 * MiB},
+ // try to hit the buffer ceiling only once (at the end)
+ {4 * MiB, 2 * MiB, 1 * MiB, 512 * KiB, 256 * KiB, 256 * KiB, -12 * MiB},
+ // try to hit the same buffer ceiling multiple times
+ {4 * MiB + 1, 2 * MiB, 1 * MiB, 512 * KiB, -25 * MiB},
+
+ // try to hit every ceiling, by always landing 1K shy of the buffer size
+ {1 * KiB, 2 * KiB, 4 * KiB, 8 * KiB, 16 * KiB, 32 * KiB, 64 * KiB,
+ 128 * KiB, 256 * KiB, 512 * KiB, 1 * MiB, 2 * MiB, 4 * MiB, -16 * MiB},
+
+ // try to avoid every ceiling, by always landing 1B past the buffer size
+ // the normal 2x heuristic threshold still forces parse attempts.
+ {2 * KiB + 1, // will attempt 2KiB + 1 ==> total 2KiB + 1
+ 2 * KiB, 4 * KiB, // will attempt 8KiB + 1 ==> total 10KiB + 2
+ 8 * KiB, 16 * KiB, // will attempt 32KiB + 1 ==> total 42KiB + 3
+ 32 * KiB, 64 * KiB, // will attempt 128KiB + 1 ==> total 170KiB + 4
+ 128 * KiB, 256 * KiB, // will attempt 512KiB + 1 ==> total 682KiB + 5
+ 512 * KiB, 1 * MiB, // will attempt 2MiB + 1 ==> total 2M + 682K + 6
+ 2 * MiB, 4 * MiB, // will attempt 8MiB + 1 ==> total 10M + 682K + 7
+ -(10 * MiB + 682 * KiB + 7)},
+ // try to avoid every ceiling again, except on our last fill.
+ {2 * KiB + 1, // will attempt 2KiB + 1 ==> total 2KiB + 1
+ 2 * KiB, 4 * KiB, // will attempt 8KiB + 1 ==> total 10KiB + 2
+ 8 * KiB, 16 * KiB, // will attempt 32KiB + 1 ==> total 42KiB + 3
+ 32 * KiB, 64 * KiB, // will attempt 128KiB + 1 ==> total 170KiB + 4
+ 128 * KiB, 256 * KiB, // will attempt 512KiB + 1 ==> total 682KiB + 5
+ 512 * KiB, 1 * MiB, // will attempt 2MiB + 1 ==> total 2M + 682K + 6
+ 2 * MiB, 4 * MiB - 1, // will attempt 8MiB ==> total 10M + 682K + 6
+ -(10 * MiB + 682 * KiB + 6)},
+
+ // try to hit ceilings on the way multiple times
+ {512 * KiB + 1, 256 * KiB, 128 * KiB, 128 * KiB - 1, // 1 MiB buffer
+ 512 * KiB + 1, 256 * KiB, 128 * KiB, 128 * KiB - 1, // 2 MiB buffer
+ 1 * MiB + 1, 512 * KiB, 256 * KiB, 256 * KiB - 1, // 4 MiB buffer
+ 2 * MiB + 1, 1 * MiB, 512 * KiB, // 8 MiB buffer
+ // we'll make a parse attempt at every parse call
+ -(45 * MiB + 12)},
+ };
+ const int testcount = sizeof(testcases) / sizeof(testcases[0]);
+ for (int test_i = 0; test_i < testcount; test_i++) {
+ const int *fillsize = testcases[test_i];
+ set_subtest("#%d {%d %d %d %d ...}", test_i, fillsize[0], fillsize[1],
+ fillsize[2], fillsize[3]);
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+
+ CharData storage;
+ CharData_Init(&storage);
+ XML_SetUserData(parser, &storage);
+ XML_SetStartElementHandler(parser, start_element_event_handler);
+
+ g_bytesScanned = 0;
+ int worstcase_bytes = 0; // sum of (buffered bytes at each XML_Parse call)
+ int offset = 0;
+ while (*fillsize >= 0) {
+ assert_true(offset + *fillsize <= document_length); // or test is invalid
+ const enum XML_Status status
+ = XML_Parse(parser, &document[offset], *fillsize, XML_FALSE);
+ if (status != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+ offset += *fillsize;
+ fillsize++;
+ assert_true(offset <= INT_MAX - worstcase_bytes); // avoid overflow
+ worstcase_bytes += offset; // we might've tried to parse all pending bytes
+ }
+ assert_true(storage.count == 1); // the big token should've been parsed
+ assert_true(g_bytesScanned > 0); // test-the-test: does our counter work?
+ if (g_reparseDeferralEnabledDefault) {
+ // heuristic is enabled; some XML_Parse calls may have deferred reparsing
+ const unsigned max_bytes_scanned = -*fillsize;
+ if (g_bytesScanned > max_bytes_scanned) {
+ fprintf(stderr,
+ "bytes scanned in parse attempts: actual=%u limit=%u \n",
+ g_bytesScanned, max_bytes_scanned);
+ fail("too many bytes scanned in parse attempts");
+ }
+ }
+ assert_true(g_bytesScanned <= (unsigned)worstcase_bytes);
+
+ XML_ParserFree(parser);
+ }
+ free(document);
+}
+END_TEST
+
+void
+make_basic_test_case(Suite *s) {
+ TCase *tc_basic = tcase_create("basic tests");
+
+ suite_add_tcase(s, tc_basic);
+ tcase_add_checked_fixture(tc_basic, basic_setup, basic_teardown);
+
+ tcase_add_test(tc_basic, test_nul_byte);
+ tcase_add_test(tc_basic, test_u0000_char);
+ tcase_add_test(tc_basic, test_siphash_self);
+ tcase_add_test(tc_basic, test_siphash_spec);
+ tcase_add_test(tc_basic, test_bom_utf8);
+ tcase_add_test(tc_basic, test_bom_utf16_be);
+ tcase_add_test(tc_basic, test_bom_utf16_le);
+ tcase_add_test(tc_basic, test_nobom_utf16_le);
+ tcase_add_test(tc_basic, test_hash_collision);
+ tcase_add_test(tc_basic, test_illegal_utf8);
+ tcase_add_test(tc_basic, test_utf8_auto_align);
+ tcase_add_test(tc_basic, test_utf16);
+ tcase_add_test(tc_basic, test_utf16_le_epilog_newline);
+ tcase_add_test(tc_basic, test_not_utf16);
+ tcase_add_test(tc_basic, test_bad_encoding);
+ tcase_add_test(tc_basic, test_latin1_umlauts);
+ tcase_add_test(tc_basic, test_long_utf8_character);
+ tcase_add_test(tc_basic, test_long_latin1_attribute);
+ tcase_add_test(tc_basic, test_long_ascii_attribute);
+ /* Regression test for SF bug #491986. */
+ tcase_add_test(tc_basic, test_danish_latin1);
+ /* Regression test for SF bug #514281. */
+ tcase_add_test(tc_basic, test_french_charref_hexidecimal);
+ tcase_add_test(tc_basic, test_french_charref_decimal);
+ tcase_add_test(tc_basic, test_french_latin1);
+ tcase_add_test(tc_basic, test_french_utf8);
+ tcase_add_test(tc_basic, test_utf8_false_rejection);
+ tcase_add_test(tc_basic, test_line_number_after_parse);
+ tcase_add_test(tc_basic, test_column_number_after_parse);
+ tcase_add_test(tc_basic, test_line_and_column_numbers_inside_handlers);
+ tcase_add_test(tc_basic, test_line_number_after_error);
+ tcase_add_test(tc_basic, test_column_number_after_error);
+ tcase_add_test(tc_basic, test_really_long_lines);
+ tcase_add_test(tc_basic, test_really_long_encoded_lines);
+ tcase_add_test(tc_basic, test_end_element_events);
+ tcase_add_test(tc_basic, test_helper_is_whitespace_normalized);
+ tcase_add_test(tc_basic, test_attr_whitespace_normalization);
+ tcase_add_test(tc_basic, test_xmldecl_misplaced);
+ tcase_add_test(tc_basic, test_xmldecl_invalid);
+ tcase_add_test(tc_basic, test_xmldecl_missing_attr);
+ tcase_add_test(tc_basic, test_xmldecl_missing_value);
+ tcase_add_test__if_xml_ge(tc_basic, test_unknown_encoding_internal_entity);
+ tcase_add_test(tc_basic, test_unrecognised_encoding_internal_entity);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_set_encoding);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_no_handler);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_set_bom);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_bad_encoding);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_bad_encoding_2);
+ tcase_add_test(tc_basic, test_wfc_undeclared_entity_unread_external_subset);
+ tcase_add_test(tc_basic, test_wfc_undeclared_entity_no_external_subset);
+ tcase_add_test(tc_basic, test_wfc_undeclared_entity_standalone);
+ tcase_add_test(tc_basic,
+ test_wfc_undeclared_entity_with_external_subset_standalone);
+ tcase_add_test(tc_basic, test_entity_with_external_subset_unless_standalone);
+ tcase_add_test(tc_basic, test_wfc_undeclared_entity_with_external_subset);
+ tcase_add_test(tc_basic, test_not_standalone_handler_reject);
+ tcase_add_test(tc_basic, test_not_standalone_handler_accept);
+ tcase_add_test(tc_basic, test_entity_start_tag_level_greater_than_one);
+ tcase_add_test__if_xml_ge(tc_basic, test_wfc_no_recursive_entity_refs);
+ tcase_add_test(tc_basic, test_no_indirectly_recursive_entity_refs);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_invalid_parse);
+ tcase_add_test__if_xml_ge(tc_basic, test_dtd_default_handling);
+ tcase_add_test(tc_basic, test_dtd_attr_handling);
+ tcase_add_test(tc_basic, test_empty_ns_without_namespaces);
+ tcase_add_test(tc_basic, test_ns_in_attribute_default_without_namespaces);
+ tcase_add_test(tc_basic, test_stop_parser_between_char_data_calls);
+ tcase_add_test(tc_basic, test_suspend_parser_between_char_data_calls);
+ tcase_add_test(tc_basic, test_repeated_stop_parser_between_char_data_calls);
+ tcase_add_test(tc_basic, test_good_cdata_ascii);
+ tcase_add_test(tc_basic, test_good_cdata_utf16);
+ tcase_add_test(tc_basic, test_good_cdata_utf16_le);
+ tcase_add_test(tc_basic, test_long_cdata_utf16);
+ tcase_add_test(tc_basic, test_multichar_cdata_utf16);
+ tcase_add_test(tc_basic, test_utf16_bad_surrogate_pair);
+ tcase_add_test(tc_basic, test_bad_cdata);
+ tcase_add_test(tc_basic, test_bad_cdata_utf16);
+ tcase_add_test(tc_basic, test_stop_parser_between_cdata_calls);
+ tcase_add_test(tc_basic, test_suspend_parser_between_cdata_calls);
+ tcase_add_test(tc_basic, test_memory_allocation);
+ tcase_add_test__if_xml_ge(tc_basic, test_default_current);
+ tcase_add_test(tc_basic, test_dtd_elements);
+ tcase_add_test(tc_basic, test_dtd_elements_nesting);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_set_foreign_dtd);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_foreign_dtd_not_standalone);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_invalid_foreign_dtd);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_foreign_dtd_with_doctype);
+ tcase_add_test__ifdef_xml_dtd(tc_basic,
+ test_foreign_dtd_without_external_subset);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_empty_foreign_dtd);
+ tcase_add_test(tc_basic, test_set_base);
+ tcase_add_test(tc_basic, test_attributes);
+ tcase_add_test__if_xml_ge(tc_basic, test_reset_in_entity);
+ tcase_add_test(tc_basic, test_resume_invalid_parse);
+ tcase_add_test(tc_basic, test_resume_resuspended);
+ tcase_add_test(tc_basic, test_cdata_default);
+ tcase_add_test(tc_basic, test_subordinate_reset);
+ tcase_add_test(tc_basic, test_subordinate_suspend);
+ tcase_add_test__if_xml_ge(tc_basic, test_subordinate_xdecl_suspend);
+ tcase_add_test__if_xml_ge(tc_basic, test_subordinate_xdecl_abort);
+ tcase_add_test__ifdef_xml_dtd(tc_basic,
+ test_ext_entity_invalid_suspended_parse);
+ tcase_add_test(tc_basic, test_explicit_encoding);
+ tcase_add_test(tc_basic, test_trailing_cr);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_trailing_cr);
+ tcase_add_test(tc_basic, test_trailing_rsqb);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_trailing_rsqb);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_good_cdata);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_user_parameters);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_ref_parameter);
+ tcase_add_test(tc_basic, test_empty_parse);
+ tcase_add_test(tc_basic, test_negative_len_parse);
+ tcase_add_test(tc_basic, test_negative_len_parse_buffer);
+ tcase_add_test(tc_basic, test_get_buffer_1);
+ tcase_add_test(tc_basic, test_get_buffer_2);
+#if XML_CONTEXT_BYTES > 0
+ tcase_add_test(tc_basic, test_get_buffer_3_overflow);
+#endif
+ tcase_add_test(tc_basic, test_buffer_can_grow_to_max);
+ tcase_add_test(tc_basic, test_getbuffer_allocates_on_zero_len);
+ tcase_add_test(tc_basic, test_byte_info_at_end);
+ tcase_add_test(tc_basic, test_byte_info_at_error);
+ tcase_add_test(tc_basic, test_byte_info_at_cdata);
+ tcase_add_test(tc_basic, test_predefined_entities);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_invalid_tag_in_dtd);
+ tcase_add_test(tc_basic, test_not_predefined_entities);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ignore_section);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ignore_section_utf16);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ignore_section_utf16_be);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_bad_ignore_section);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_external_bom_consumed);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_external_entity_values);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_not_standalone);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_value_abort);
+ tcase_add_test(tc_basic, test_bad_public_doctype);
+ tcase_add_test(tc_basic, test_attribute_enum_value);
+ tcase_add_test(tc_basic, test_predefined_entity_redefinition);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_dtd_stop_processing);
+ tcase_add_test(tc_basic, test_public_notation_no_sysid);
+ tcase_add_test(tc_basic, test_nested_groups);
+ tcase_add_test(tc_basic, test_group_choice);
+ tcase_add_test(tc_basic, test_standalone_parameter_entity);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_skipped_parameter_entity);
+ tcase_add_test__ifdef_xml_dtd(tc_basic,
+ test_recursive_external_parameter_entity);
+ tcase_add_test__ifdef_xml_dtd(tc_basic,
+ test_recursive_external_parameter_entity_2);
+ tcase_add_test(tc_basic, test_undefined_ext_entity_in_external_dtd);
+ tcase_add_test(tc_basic, test_suspend_xdecl);
+ tcase_add_test(tc_basic, test_abort_epilog);
+ tcase_add_test(tc_basic, test_abort_epilog_2);
+ tcase_add_test(tc_basic, test_suspend_epilog);
+ tcase_add_test(tc_basic, test_suspend_in_sole_empty_tag);
+ tcase_add_test(tc_basic, test_unfinished_epilog);
+ tcase_add_test(tc_basic, test_partial_char_in_epilog);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_suspend_resume_internal_entity);
+ tcase_add_test__ifdef_xml_dtd(tc_basic,
+ test_suspend_resume_internal_entity_issue_629);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_resume_entity_with_syntax_error);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_suspend_resume_parameter_entity);
+ tcase_add_test(tc_basic, test_restart_on_error);
+ tcase_add_test(tc_basic, test_reject_lt_in_attribute_value);
+ tcase_add_test(tc_basic, test_reject_unfinished_param_in_att_value);
+ tcase_add_test(tc_basic, test_trailing_cr_in_att_value);
+ tcase_add_test(tc_basic, test_standalone_internal_entity);
+ tcase_add_test(tc_basic, test_skipped_external_entity);
+ tcase_add_test(tc_basic, test_skipped_null_loaded_ext_entity);
+ tcase_add_test(tc_basic, test_skipped_unloaded_ext_entity);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_param_entity_with_trailing_cr);
+ tcase_add_test__if_xml_ge(tc_basic, test_invalid_character_entity);
+ tcase_add_test__if_xml_ge(tc_basic, test_invalid_character_entity_2);
+ tcase_add_test__if_xml_ge(tc_basic, test_invalid_character_entity_3);
+ tcase_add_test__if_xml_ge(tc_basic, test_invalid_character_entity_4);
+ tcase_add_test(tc_basic, test_pi_handled_in_default);
+ tcase_add_test(tc_basic, test_comment_handled_in_default);
+ tcase_add_test(tc_basic, test_pi_yml);
+ tcase_add_test(tc_basic, test_pi_xnl);
+ tcase_add_test(tc_basic, test_pi_xmm);
+ tcase_add_test(tc_basic, test_utf16_pi);
+ tcase_add_test(tc_basic, test_utf16_be_pi);
+ tcase_add_test(tc_basic, test_utf16_be_comment);
+ tcase_add_test(tc_basic, test_utf16_le_comment);
+ tcase_add_test(tc_basic, test_missing_encoding_conversion_fn);
+ tcase_add_test(tc_basic, test_failing_encoding_conversion_fn);
+ tcase_add_test(tc_basic, test_unknown_encoding_success);
+ tcase_add_test(tc_basic, test_unknown_encoding_bad_name);
+ tcase_add_test(tc_basic, test_unknown_encoding_bad_name_2);
+ tcase_add_test(tc_basic, test_unknown_encoding_long_name_1);
+ tcase_add_test(tc_basic, test_unknown_encoding_long_name_2);
+ tcase_add_test(tc_basic, test_invalid_unknown_encoding);
+ tcase_add_test(tc_basic, test_unknown_ascii_encoding_ok);
+ tcase_add_test(tc_basic, test_unknown_ascii_encoding_fail);
+ tcase_add_test(tc_basic, test_unknown_encoding_invalid_length);
+ tcase_add_test(tc_basic, test_unknown_encoding_invalid_topbit);
+ tcase_add_test(tc_basic, test_unknown_encoding_invalid_surrogate);
+ tcase_add_test(tc_basic, test_unknown_encoding_invalid_high);
+ tcase_add_test(tc_basic, test_unknown_encoding_invalid_attr_value);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_latin1_utf16le_bom);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_latin1_utf16be_bom);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_latin1_utf16le_bom2);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_latin1_utf16be_bom2);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_utf16_be);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_utf16_le);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_utf16_unknown);
+ tcase_add_test__if_xml_ge(tc_basic, test_ext_entity_utf8_non_bom);
+ tcase_add_test(tc_basic, test_utf8_in_cdata_section);
+ tcase_add_test(tc_basic, test_utf8_in_cdata_section_2);
+ tcase_add_test(tc_basic, test_utf8_in_start_tags);
+ tcase_add_test(tc_basic, test_trailing_spaces_in_elements);
+ tcase_add_test(tc_basic, test_utf16_attribute);
+ tcase_add_test(tc_basic, test_utf16_second_attr);
+ tcase_add_test(tc_basic, test_attr_after_solidus);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_utf16_pe);
+ tcase_add_test(tc_basic, test_bad_attr_desc_keyword);
+ tcase_add_test(tc_basic, test_bad_attr_desc_keyword_utf16);
+ tcase_add_test(tc_basic, test_bad_doctype);
+ tcase_add_test(tc_basic, test_bad_doctype_utf8);
+ tcase_add_test(tc_basic, test_bad_doctype_utf16);
+ tcase_add_test(tc_basic, test_bad_doctype_plus);
+ tcase_add_test(tc_basic, test_bad_doctype_star);
+ tcase_add_test(tc_basic, test_bad_doctype_query);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_unknown_encoding_bad_ignore);
+ tcase_add_test(tc_basic, test_entity_in_utf16_be_attr);
+ tcase_add_test(tc_basic, test_entity_in_utf16_le_attr);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_entity_public_utf16_be);
+ tcase_add_test__ifdef_xml_dtd(tc_basic, test_entity_public_utf16_le);
+ tcase_add_test(tc_basic, test_short_doctype);
+ tcase_add_test(tc_basic, test_short_doctype_2);
+ tcase_add_test(tc_basic, test_short_doctype_3);
+ tcase_add_test(tc_basic, test_long_doctype);
+ tcase_add_test(tc_basic, test_bad_entity);
+ tcase_add_test(tc_basic, test_bad_entity_2);
+ tcase_add_test(tc_basic, test_bad_entity_3);
+ tcase_add_test(tc_basic, test_bad_entity_4);
+ tcase_add_test(tc_basic, test_bad_notation);
+ tcase_add_test(tc_basic, test_default_doctype_handler);
+ tcase_add_test(tc_basic, test_empty_element_abort);
+ tcase_add_test__ifdef_xml_dtd(tc_basic,
+ test_pool_integrity_with_unfinished_attr);
+ tcase_add_test__if_xml_ge(tc_basic, test_entity_ref_no_elements);
+ tcase_add_test__if_xml_ge(tc_basic, test_deep_nested_entity);
+ tcase_add_test__if_xml_ge(tc_basic, test_deep_nested_attribute_entity);
+ tcase_add_test__if_xml_ge(tc_basic,
+ test_deep_nested_entity_delayed_interpretation);
+ tcase_add_test__if_xml_ge(tc_basic, test_nested_entity_suspend);
+ tcase_add_test__if_xml_ge(tc_basic, test_nested_entity_suspend_2);
+ tcase_add_test(tc_basic, test_big_tokens_scale_linearly);
+ tcase_add_test(tc_basic, test_set_reparse_deferral);
+ tcase_add_test(tc_basic, test_reparse_deferral_is_inherited);
+ tcase_add_test(tc_basic, test_set_reparse_deferral_on_null_parser);
+ tcase_add_test(tc_basic, test_set_reparse_deferral_on_the_fly);
+ tcase_add_test(tc_basic, test_set_bad_reparse_option);
+ tcase_add_test(tc_basic, test_bypass_heuristic_when_close_to_bufsize);
+ tcase_add_test(tc_basic, test_varying_buffer_fills);
+}
diff --git a/3rdparty/expat/tests/basic_tests.h b/3rdparty/expat/tests/basic_tests.h
new file mode 100644
index 00000000000..4c16562ca0f
--- /dev/null
+++ b/3rdparty/expat/tests/basic_tests.h
@@ -0,0 +1,56 @@
+/* Tests in the "basic" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef XML_BASIC_TESTS_H
+# define XML_BASIC_TESTS_H
+
+extern void make_basic_test_case(Suite *s);
+
+#endif /* XML_BASIC_TESTS_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/expat/tests/basic_tests_cxx.cpp b/3rdparty/expat/tests/basic_tests_cxx.cpp
new file mode 100644
index 00000000000..d7e75a9061c
--- /dev/null
+++ b/3rdparty/expat/tests/basic_tests_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "basic_tests.c"
diff --git a/3rdparty/expat/tests/benchmark/Makefile.am b/3rdparty/expat/tests/benchmark/Makefile.am
index 5ea8dc10c5b..f1bf3365f63 100644
--- a/3rdparty/expat/tests/benchmark/Makefile.am
+++ b/3rdparty/expat/tests/benchmark/Makefile.am
@@ -6,7 +6,8 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/tests/benchmark/Makefile.in b/3rdparty/expat/tests/benchmark/Makefile.in
index 665bca31e35..d0e6d0769db 100644
--- a/3rdparty/expat/tests/benchmark/Makefile.in
+++ b/3rdparty/expat/tests/benchmark/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,8 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -132,6 +133,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -207,8 +210,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/conftools/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -228,8 +229,10 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CPP = @CPP@
+CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
@@ -245,10 +248,20 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
FGREP = @FGREP@
+FILECMD = @FILECMD@
FILEMAP = @FILEMAP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -258,6 +271,8 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LIBAGE = @LIBAGE@
LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
+LIBM = @LIBM@
LIBOBJS = @LIBOBJS@
LIBREVISION = @LIBREVISION@
LIBS = @LIBS@
@@ -266,6 +281,7 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -287,9 +303,12 @@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SIZEOF_VOID_P = @SIZEOF_VOID_P@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
STRIP = @STRIP@
VERSION = @VERSION@
-_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -353,7 +372,7 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -377,9 +396,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
@@ -488,7 +507,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/3rdparty/expat/tests/benchmark/benchmark.c b/3rdparty/expat/tests/benchmark/benchmark.c
index fda8268f189..a02b84a0131 100644
--- a/3rdparty/expat/tests/benchmark/benchmark.c
+++ b/3rdparty/expat/tests/benchmark/benchmark.c
@@ -6,8 +6,10 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2003-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2017-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,8 +32,18 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#define _POSIX_C_SOURCE 1 // fdopen
+
+#if defined(_MSC_VER)
+# include <io.h> // _open, _close
+#else
+# include <unistd.h> // close
+#endif
+
+#include <fcntl.h> // open
#include <sys/stat.h>
-#include <stdlib.h>
+#include <assert.h>
+#include <stddef.h> // ptrdiff_t
#include <stdio.h>
#include <time.h>
#include "expat.h"
@@ -48,19 +60,21 @@
# define XML_FMT_STR "s"
#endif
-static void
+static int
usage(const char *prog, int rc) {
fprintf(stderr, "usage: %s [-n] filename bufferSize nr_of_loops\n", prog);
- exit(rc);
+ return rc;
}
int
main(int argc, char *argv[]) {
XML_Parser parser;
char *XMLBuf, *XMLBufEnd, *XMLBufPtr;
- FILE *fd;
+ int fd;
+ FILE *file;
struct stat fileAttr;
- int nrOfLoops, bufferSize, fileSize, i, isFinal;
+ int nrOfLoops, bufferSize, i, isFinal;
+ size_t fileSize;
int j = 0, ns = 0;
clock_t tstart, tend;
double cpuTime = 0.0;
@@ -71,34 +85,48 @@ main(int argc, char *argv[]) {
ns = 1;
j = 1;
} else
- usage(argv[0], 1);
+ return usage(argv[0], 1);
}
}
if (argc != j + 4)
- usage(argv[0], 1);
+ return usage(argv[0], 1);
- if (stat(argv[j + 1], &fileAttr) != 0) {
- fprintf(stderr, "could not access file '%s'\n", argv[j + 1]);
+ fd = open(argv[j + 1], O_RDONLY);
+ if (fd == -1) {
+ fprintf(stderr, "could not open file '%s'\n", argv[j + 1]);
return 2;
}
- fd = fopen(argv[j + 1], "r");
- if (! fd) {
- fprintf(stderr, "could not open file '%s'\n", argv[j + 1]);
- exit(2);
+ if (fstat(fd, &fileAttr) != 0) {
+ close(fd);
+ fprintf(stderr, "could not fstat file '%s'\n", argv[j + 1]);
+ return 2;
+ }
+
+ file = fdopen(fd, "r");
+ if (! file) {
+ close(fd);
+ fprintf(stderr, "could not fdopen file '%s'\n", argv[j + 1]);
+ return 2;
}
bufferSize = atoi(argv[j + 2]);
nrOfLoops = atoi(argv[j + 3]);
if (bufferSize <= 0 || nrOfLoops <= 0) {
+ fclose(file); // NOTE: this closes fd as well
fprintf(stderr, "buffer size and nr of loops must be greater than zero.\n");
- exit(3);
+ return 3;
}
XMLBuf = malloc(fileAttr.st_size);
- fileSize = fread(XMLBuf, sizeof(char), fileAttr.st_size, fd);
- fclose(fd);
+ if (XMLBuf == NULL) {
+ fclose(file); // NOTE: this closes fd as well
+ fprintf(stderr, "ouf of memory.\n");
+ return 5;
+ }
+ fileSize = fread(XMLBuf, sizeof(char), fileAttr.st_size, file);
+ fclose(file); // NOTE: this closes fd as well
if (ns)
parser = XML_ParserCreateNS(NULL, '!');
@@ -112,12 +140,13 @@ main(int argc, char *argv[]) {
isFinal = 0;
tstart = clock();
do {
- int parseBufferSize = XMLBufEnd - XMLBufPtr;
- if (parseBufferSize <= bufferSize)
+ ptrdiff_t parseBufferSize = XMLBufEnd - XMLBufPtr;
+ if (parseBufferSize <= (ptrdiff_t)bufferSize)
isFinal = 1;
else
parseBufferSize = bufferSize;
- if (! XML_Parse(parser, XMLBufPtr, parseBufferSize, isFinal)) {
+ assert(parseBufferSize <= (ptrdiff_t)bufferSize);
+ if (! XML_Parse(parser, XMLBufPtr, (int)parseBufferSize, isFinal)) {
fprintf(stderr,
"error '%" XML_FMT_STR "' at line %" XML_FMT_INT_MOD
"u character %" XML_FMT_INT_MOD "u\n",
@@ -126,7 +155,7 @@ main(int argc, char *argv[]) {
XML_GetCurrentColumnNumber(parser));
free(XMLBuf);
XML_ParserFree(parser);
- exit(4);
+ return 4;
}
XMLBufPtr += bufferSize;
} while (! isFinal);
diff --git a/3rdparty/expat/tests/chardata.c b/3rdparty/expat/tests/chardata.c
index 75a50166ec5..2adb2c5462b 100644
--- a/3rdparty/expat/tests/chardata.c
+++ b/3rdparty/expat/tests/chardata.c
@@ -6,8 +6,13 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2002-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2016 Gilles Espinasse <g.esp@free.fr>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,9 +35,11 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifdef HAVE_EXPAT_CONFIG_H
-# include <expat_config.h>
+#if defined(NDEBUG)
+# undef NDEBUG /* because test suite relies on assert(...) at the moment */
#endif
+
+#include "expat_config.h"
#include "minicheck.h"
#include <assert.h>
@@ -78,15 +85,16 @@ CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len) {
int
CharData_CheckXMLChars(CharData *storage, const XML_Char *expected) {
- char buffer[1024];
int len = xmlstrlen(expected);
int count;
assert(storage != NULL);
count = (storage->count < 0) ? 0 : storage->count;
if (len != count) {
- sprintf(buffer, "wrong number of data characters: got %d, expected %d",
- count, len);
+ char buffer[1024];
+ snprintf(buffer, sizeof(buffer),
+ "wrong number of data characters: got %d, expected %d", count,
+ len);
fail(buffer);
return 0;
}
diff --git a/3rdparty/expat/tests/chardata.h b/3rdparty/expat/tests/chardata.h
index 4001b9b9d15..ccb631f64b2 100644
--- a/3rdparty/expat/tests/chardata.h
+++ b/3rdparty/expat/tests/chardata.h
@@ -7,8 +7,9 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2002-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/tests/chardata_cxx.cpp b/3rdparty/expat/tests/chardata_cxx.cpp
new file mode 100644
index 00000000000..81820c72dca
--- /dev/null
+++ b/3rdparty/expat/tests/chardata_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "chardata.c"
diff --git a/3rdparty/expat/tests/common.c b/3rdparty/expat/tests/common.c
new file mode 100644
index 00000000000..b158385f56a
--- /dev/null
+++ b/3rdparty/expat/tests/common.c
@@ -0,0 +1,327 @@
+/* Commonly used functions for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include <assert.h>
+#include <errno.h>
+#include <stdint.h> // for SIZE_MAX
+#include <stdio.h>
+#include <string.h>
+
+#include "expat_config.h"
+#include "expat.h"
+#include "internal.h"
+#include "chardata.h"
+#include "minicheck.h"
+#include "common.h"
+#include "handlers.h"
+
+/* Common test data */
+
+const char *long_character_data_text
+ = "<?xml version='1.0' encoding='iso-8859-1'?><s>"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "</s>";
+
+const char *long_cdata_text
+ = "<s><![CDATA["
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "]]></s>";
+
+/* Having an element name longer than 1024 characters exercises some
+ * of the pool allocation code in the parser that otherwise does not
+ * get executed. The count at the end of the line is the number of
+ * characters (bytes) in the element name by that point.x
+ */
+const char *get_buffer_test_text
+ = "<documentwitharidiculouslylongelementnametotease" /* 0x030 */
+ "aparticularcorneroftheallocationinXML_GetBuffers" /* 0x060 */
+ "othatwecanimprovethecoverageyetagain012345678901" /* 0x090 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x0c0 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x0f0 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x120 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x150 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x180 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x1b0 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x1e0 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x210 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x240 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x270 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x2a0 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x2d0 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x300 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x330 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x360 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x390 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x3c0 */
+ "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x3f0 */
+ "123456789abcdef0123456789abcdef0123456789>\n<ef0"; /* 0x420 */
+
+/* Test control globals */
+
+/* Used as the "resumable" parameter to XML_StopParser by some tests */
+XML_Bool g_resumable = XML_FALSE;
+
+/* Used to control abort checks in some tests */
+XML_Bool g_abortable = XML_FALSE;
+
+/* Used to control _XML_Parse_SINGLE_BYTES() chunk size */
+int g_chunkSize = 1;
+
+/* Common test functions */
+
+void
+tcase_add_test__ifdef_xml_dtd(TCase *tc, tcase_test_function test) {
+#ifdef XML_DTD
+ tcase_add_test(tc, test);
+#else
+ UNUSED_P(tc);
+ UNUSED_P(test);
+#endif
+}
+
+void
+tcase_add_test__if_xml_ge(TCase *tc, tcase_test_function test) {
+#if XML_GE == 1
+ tcase_add_test(tc, test);
+#else
+ UNUSED_P(tc);
+ UNUSED_P(test);
+#endif
+}
+
+void
+basic_teardown(void) {
+ if (g_parser != NULL) {
+ XML_ParserFree(g_parser);
+ g_parser = NULL;
+ }
+}
+
+/* Generate a failure using the parser state to create an error message;
+ this should be used when the parser reports an error we weren't
+ expecting.
+*/
+void
+_xml_failure(XML_Parser parser, const char *file, int line) {
+ char buffer[1024];
+ enum XML_Error err = XML_GetErrorCode(parser);
+ snprintf(buffer, sizeof(buffer),
+ " %d: %" XML_FMT_STR " (line %" XML_FMT_INT_MOD
+ "u, offset %" XML_FMT_INT_MOD "u)\n reported from %s, line %d\n",
+ err, XML_ErrorString(err), XML_GetCurrentLineNumber(parser),
+ XML_GetCurrentColumnNumber(parser), file, line);
+ _fail(file, line, buffer);
+}
+
+enum XML_Status
+_XML_Parse_SINGLE_BYTES(XML_Parser parser, const char *s, int len,
+ int isFinal) {
+ // This ensures that tests have to run pathological parse cases
+ // (e.g. when `s` is NULL) against plain XML_Parse rather than
+ // chunking _XML_Parse_SINGLE_BYTES.
+ assert((parser != NULL) && (s != NULL) && (len >= 0));
+ const int chunksize = g_chunkSize;
+ if (chunksize > 0) {
+ // parse in chunks of `chunksize` bytes as long as not exhausting
+ for (; len > chunksize; len -= chunksize, s += chunksize) {
+ enum XML_Status res = XML_Parse(parser, s, chunksize, XML_FALSE);
+ if (res != XML_STATUS_OK) {
+ if ((res == XML_STATUS_SUSPENDED) && (len > chunksize)) {
+ fail("Use of function _XML_Parse_SINGLE_BYTES with a chunk size "
+ "greater than 0 (from g_chunkSize) does not work well with "
+ "suspension. Please consider use of plain XML_Parse at this "
+ "place in your test, instead.");
+ }
+ return res;
+ }
+ }
+ }
+ // parse the final chunk, the size of which will be <= chunksize
+ return XML_Parse(parser, s, len, isFinal);
+}
+
+void
+_expect_failure(const char *text, enum XML_Error errorCode,
+ const char *errorMessage, const char *file, int lineno) {
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_OK)
+ /* Hackish use of _fail() macro, but lets us report
+ the right filename and line number. */
+ _fail(file, lineno, errorMessage);
+ if (XML_GetErrorCode(g_parser) != errorCode)
+ _xml_failure(g_parser, file, lineno);
+}
+
+void
+_run_character_check(const char *text, const XML_Char *expected,
+ const char *file, int line) {
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ _xml_failure(g_parser, file, line);
+ CharData_CheckXMLChars(&storage, expected);
+}
+
+void
+_run_attribute_check(const char *text, const XML_Char *expected,
+ const char *file, int line) {
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetStartElementHandler(g_parser, accumulate_attribute);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ _xml_failure(g_parser, file, line);
+ CharData_CheckXMLChars(&storage, expected);
+}
+
+void
+_run_ext_character_check(const char *text, ExtTest *test_data,
+ const XML_Char *expected, const char *file, int line) {
+ CharData *const storage = (CharData *)malloc(sizeof(CharData));
+
+ CharData_Init(storage);
+ test_data->storage = storage;
+ XML_SetUserData(g_parser, test_data);
+ XML_SetCharacterDataHandler(g_parser, ext_accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ _xml_failure(g_parser, file, line);
+ CharData_CheckXMLChars(storage, expected);
+
+ free(storage);
+}
+
+/* Control variable; the number of times duff_allocator() will successfully
+ * allocate */
+#define ALLOC_ALWAYS_SUCCEED (-1)
+#define REALLOC_ALWAYS_SUCCEED (-1)
+
+int g_allocation_count = ALLOC_ALWAYS_SUCCEED;
+int g_reallocation_count = REALLOC_ALWAYS_SUCCEED;
+
+/* Crocked allocator for allocation failure tests */
+void *
+duff_allocator(size_t size) {
+ if (g_allocation_count == 0)
+ return NULL;
+ if (g_allocation_count != ALLOC_ALWAYS_SUCCEED)
+ g_allocation_count--;
+ return malloc(size);
+}
+
+/* Crocked reallocator for allocation failure tests */
+void *
+duff_reallocator(void *ptr, size_t size) {
+ if (g_reallocation_count == 0)
+ return NULL;
+ if (g_reallocation_count != REALLOC_ALWAYS_SUCCEED)
+ g_reallocation_count--;
+ return realloc(ptr, size);
+}
+
+// Portable remake of strndup(3) for C99; does not care about space efficiency
+char *
+portable_strndup(const char *s, size_t n) {
+ if ((s == NULL) || (n == SIZE_MAX)) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ char *const buffer = (char *)malloc(n + 1);
+ if (buffer == NULL) {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ errno = 0;
+
+ memcpy(buffer, s, n);
+
+ buffer[n] = '\0';
+
+ return buffer;
+}
diff --git a/3rdparty/expat/tests/common.h b/3rdparty/expat/tests/common.h
new file mode 100644
index 00000000000..2d1a5f207a0
--- /dev/null
+++ b/3rdparty/expat/tests/common.h
@@ -0,0 +1,155 @@
+/* Commonly used functions for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef XML_COMMON_H
+# define XML_COMMON_H
+
+# include "expat_config.h"
+# include "minicheck.h"
+# include "chardata.h"
+
+# ifdef XML_LARGE_SIZE
+# define XML_FMT_INT_MOD "ll"
+# else
+# define XML_FMT_INT_MOD "l"
+# endif
+
+# ifdef XML_UNICODE_WCHAR_T
+# define XML_FMT_STR "ls"
+# include <wchar.h>
+# define xcstrlen(s) wcslen(s)
+# define xcstrcmp(s, t) wcscmp((s), (t))
+# define xcstrncmp(s, t, n) wcsncmp((s), (t), (n))
+# define XCS(s) _XCS(s)
+# define _XCS(s) L##s
+# else
+# ifdef XML_UNICODE
+# error "No support for UTF-16 character without wchar_t in tests"
+# else
+# define XML_FMT_STR "s"
+# define xcstrlen(s) strlen(s)
+# define xcstrcmp(s, t) strcmp((s), (t))
+# define xcstrncmp(s, t, n) strncmp((s), (t), (n))
+# define XCS(s) s
+# endif /* XML_UNICODE */
+# endif /* XML_UNICODE_WCHAR_T */
+
+extern XML_Parser g_parser;
+
+extern XML_Bool g_resumable;
+extern XML_Bool g_abortable;
+
+extern int g_chunkSize;
+
+extern const char *long_character_data_text;
+extern const char *long_cdata_text;
+extern const char *get_buffer_test_text;
+
+extern void tcase_add_test__ifdef_xml_dtd(TCase *tc, tcase_test_function test);
+extern void tcase_add_test__if_xml_ge(TCase *tc, tcase_test_function test);
+
+extern void basic_teardown(void);
+
+extern void _xml_failure(XML_Parser parser, const char *file, int line);
+
+# define xml_failure(parser) _xml_failure((parser), __FILE__, __LINE__)
+
+extern enum XML_Status _XML_Parse_SINGLE_BYTES(XML_Parser parser, const char *s,
+ int len, int isFinal);
+
+extern void _expect_failure(const char *text, enum XML_Error errorCode,
+ const char *errorMessage, const char *file,
+ int lineno);
+
+# define expect_failure(text, errorCode, errorMessage) \
+ _expect_failure((text), (errorCode), (errorMessage), __FILE__, __LINE__)
+
+/* Support functions for handlers to collect up character and attribute data.
+ */
+
+extern void _run_character_check(const char *text, const XML_Char *expected,
+ const char *file, int line);
+
+# define run_character_check(text, expected) \
+ _run_character_check(text, expected, __FILE__, __LINE__)
+
+extern void _run_attribute_check(const char *text, const XML_Char *expected,
+ const char *file, int line);
+
+# define run_attribute_check(text, expected) \
+ _run_attribute_check(text, expected, __FILE__, __LINE__)
+
+typedef struct ExtTest {
+ const char *parse_text;
+ const XML_Char *encoding;
+ CharData *storage;
+} ExtTest;
+
+extern void _run_ext_character_check(const char *text, ExtTest *test_data,
+ const XML_Char *expected, const char *file,
+ int line);
+
+# define run_ext_character_check(text, test_data, expected) \
+ _run_ext_character_check(text, test_data, expected, __FILE__, __LINE__)
+
+# define ALLOC_ALWAYS_SUCCEED (-1)
+# define REALLOC_ALWAYS_SUCCEED (-1)
+
+extern int g_allocation_count;
+extern int g_reallocation_count;
+
+extern void *duff_allocator(size_t size);
+
+extern void *duff_reallocator(void *ptr, size_t size);
+
+extern char *portable_strndup(const char *s, size_t n);
+
+#endif /* XML_COMMON_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/expat/tests/common_cxx.cpp b/3rdparty/expat/tests/common_cxx.cpp
new file mode 100644
index 00000000000..698a0ccfa9d
--- /dev/null
+++ b/3rdparty/expat/tests/common_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "common.c"
diff --git a/3rdparty/expat/tests/dummy.c b/3rdparty/expat/tests/dummy.c
new file mode 100644
index 00000000000..4ab57edd2cf
--- /dev/null
+++ b/3rdparty/expat/tests/dummy.c
@@ -0,0 +1,261 @@
+/* Dummy handler functions for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "expat.h"
+#include "internal.h"
+#include "common.h"
+#include "dummy.h"
+
+/* Dummy handlers for when we need to set a handler to tickle a bug,
+ but it doesn't need to do anything.
+*/
+static unsigned long dummy_handler_flags = 0;
+
+void
+init_dummy_handlers(void) {
+ dummy_handler_flags = 0;
+}
+
+unsigned long
+get_dummy_handler_flags(void) {
+ return dummy_handler_flags;
+}
+
+void XMLCALL
+dummy_xdecl_handler(void *userData, const XML_Char *version,
+ const XML_Char *encoding, int standalone) {
+ UNUSED_P(userData);
+ UNUSED_P(version);
+ UNUSED_P(encoding);
+ UNUSED_P(standalone);
+}
+
+void XMLCALL
+dummy_start_doctype_handler(void *userData, const XML_Char *doctypeName,
+ const XML_Char *sysid, const XML_Char *pubid,
+ int has_internal_subset) {
+ UNUSED_P(userData);
+ UNUSED_P(doctypeName);
+ UNUSED_P(sysid);
+ UNUSED_P(pubid);
+ UNUSED_P(has_internal_subset);
+ dummy_handler_flags |= DUMMY_START_DOCTYPE_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_end_doctype_handler(void *userData) {
+ UNUSED_P(userData);
+ dummy_handler_flags |= DUMMY_END_DOCTYPE_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_entity_decl_handler(void *userData, const XML_Char *entityName,
+ int is_parameter_entity, const XML_Char *value,
+ int value_length, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName) {
+ UNUSED_P(userData);
+ UNUSED_P(entityName);
+ UNUSED_P(is_parameter_entity);
+ UNUSED_P(value);
+ UNUSED_P(value_length);
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ UNUSED_P(notationName);
+ dummy_handler_flags |= DUMMY_ENTITY_DECL_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_notation_decl_handler(void *userData, const XML_Char *notationName,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ UNUSED_P(userData);
+ UNUSED_P(notationName);
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ dummy_handler_flags |= DUMMY_NOTATION_DECL_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_element_decl_handler(void *userData, const XML_Char *name,
+ XML_Content *model) {
+ UNUSED_P(userData);
+ UNUSED_P(name);
+ /* The content model must be freed by the handler. Unfortunately
+ * we cannot pass the parser as the userData because this is used
+ * with other handlers that require other userData.
+ */
+ XML_FreeContentModel(g_parser, model);
+ dummy_handler_flags |= DUMMY_ELEMENT_DECL_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_attlist_decl_handler(void *userData, const XML_Char *elname,
+ const XML_Char *attname, const XML_Char *att_type,
+ const XML_Char *dflt, int isrequired) {
+ UNUSED_P(userData);
+ UNUSED_P(elname);
+ UNUSED_P(attname);
+ UNUSED_P(att_type);
+ UNUSED_P(dflt);
+ UNUSED_P(isrequired);
+ dummy_handler_flags |= DUMMY_ATTLIST_DECL_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_comment_handler(void *userData, const XML_Char *data) {
+ UNUSED_P(userData);
+ UNUSED_P(data);
+ dummy_handler_flags |= DUMMY_COMMENT_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_pi_handler(void *userData, const XML_Char *target, const XML_Char *data) {
+ UNUSED_P(userData);
+ UNUSED_P(target);
+ UNUSED_P(data);
+ dummy_handler_flags |= DUMMY_PI_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_start_element(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ UNUSED_P(userData);
+ UNUSED_P(name);
+ UNUSED_P(atts);
+ dummy_handler_flags |= DUMMY_START_ELEMENT_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_end_element(void *userData, const XML_Char *name) {
+ UNUSED_P(userData);
+ UNUSED_P(name);
+}
+
+void XMLCALL
+dummy_start_cdata_handler(void *userData) {
+ UNUSED_P(userData);
+ dummy_handler_flags |= DUMMY_START_CDATA_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_end_cdata_handler(void *userData) {
+ UNUSED_P(userData);
+ dummy_handler_flags |= DUMMY_END_CDATA_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_cdata_handler(void *userData, const XML_Char *s, int len) {
+ UNUSED_P(userData);
+ UNUSED_P(s);
+ UNUSED_P(len);
+}
+
+void XMLCALL
+dummy_start_namespace_decl_handler(void *userData, const XML_Char *prefix,
+ const XML_Char *uri) {
+ UNUSED_P(userData);
+ UNUSED_P(prefix);
+ UNUSED_P(uri);
+ dummy_handler_flags |= DUMMY_START_NS_DECL_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_end_namespace_decl_handler(void *userData, const XML_Char *prefix) {
+ UNUSED_P(userData);
+ UNUSED_P(prefix);
+ dummy_handler_flags |= DUMMY_END_NS_DECL_HANDLER_FLAG;
+}
+
+/* This handler is obsolete, but while the code exists we should
+ * ensure that dealing with the handler is covered by tests.
+ */
+void XMLCALL
+dummy_unparsed_entity_decl_handler(void *userData, const XML_Char *entityName,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId,
+ const XML_Char *notationName) {
+ UNUSED_P(userData);
+ UNUSED_P(entityName);
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ UNUSED_P(notationName);
+ dummy_handler_flags |= DUMMY_UNPARSED_ENTITY_DECL_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_default_handler(void *userData, const XML_Char *s, int len) {
+ UNUSED_P(userData);
+ UNUSED_P(s);
+ UNUSED_P(len);
+}
+
+void XMLCALL
+dummy_start_doctype_decl_handler(void *userData, const XML_Char *doctypeName,
+ const XML_Char *sysid, const XML_Char *pubid,
+ int has_internal_subset) {
+ UNUSED_P(userData);
+ UNUSED_P(doctypeName);
+ UNUSED_P(sysid);
+ UNUSED_P(pubid);
+ UNUSED_P(has_internal_subset);
+ dummy_handler_flags |= DUMMY_START_DOCTYPE_DECL_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_end_doctype_decl_handler(void *userData) {
+ UNUSED_P(userData);
+ dummy_handler_flags |= DUMMY_END_DOCTYPE_DECL_HANDLER_FLAG;
+}
+
+void XMLCALL
+dummy_skip_handler(void *userData, const XML_Char *entityName,
+ int is_parameter_entity) {
+ UNUSED_P(userData);
+ UNUSED_P(entityName);
+ UNUSED_P(is_parameter_entity);
+ dummy_handler_flags |= DUMMY_SKIP_HANDLER_FLAG;
+}
diff --git a/3rdparty/expat/tests/dummy.h b/3rdparty/expat/tests/dummy.h
new file mode 100644
index 00000000000..3d7ec63ed33
--- /dev/null
+++ b/3rdparty/expat/tests/dummy.h
@@ -0,0 +1,150 @@
+/* Dummy handler functions for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef XML_DUMMY_H
+# define XML_DUMMY_H
+
+# define DUMMY_START_DOCTYPE_HANDLER_FLAG (1UL << 0)
+# define DUMMY_END_DOCTYPE_HANDLER_FLAG (1UL << 1)
+# define DUMMY_ENTITY_DECL_HANDLER_FLAG (1UL << 2)
+# define DUMMY_NOTATION_DECL_HANDLER_FLAG (1UL << 3)
+# define DUMMY_ELEMENT_DECL_HANDLER_FLAG (1UL << 4)
+# define DUMMY_ATTLIST_DECL_HANDLER_FLAG (1UL << 5)
+# define DUMMY_COMMENT_HANDLER_FLAG (1UL << 6)
+# define DUMMY_PI_HANDLER_FLAG (1UL << 7)
+# define DUMMY_START_ELEMENT_HANDLER_FLAG (1UL << 8)
+# define DUMMY_START_CDATA_HANDLER_FLAG (1UL << 9)
+# define DUMMY_END_CDATA_HANDLER_FLAG (1UL << 10)
+# define DUMMY_UNPARSED_ENTITY_DECL_HANDLER_FLAG (1UL << 11)
+# define DUMMY_START_NS_DECL_HANDLER_FLAG (1UL << 12)
+# define DUMMY_END_NS_DECL_HANDLER_FLAG (1UL << 13)
+# define DUMMY_START_DOCTYPE_DECL_HANDLER_FLAG (1UL << 14)
+# define DUMMY_END_DOCTYPE_DECL_HANDLER_FLAG (1UL << 15)
+# define DUMMY_SKIP_HANDLER_FLAG (1UL << 16)
+# define DUMMY_DEFAULT_HANDLER_FLAG (1UL << 17)
+
+extern void init_dummy_handlers(void);
+extern unsigned long get_dummy_handler_flags(void);
+
+extern void XMLCALL dummy_xdecl_handler(void *userData, const XML_Char *version,
+ const XML_Char *encoding,
+ int standalone);
+
+extern void XMLCALL dummy_start_doctype_handler(void *userData,
+ const XML_Char *doctypeName,
+ const XML_Char *sysid,
+ const XML_Char *pubid,
+ int has_internal_subset);
+
+extern void XMLCALL dummy_end_doctype_handler(void *userData);
+
+extern void XMLCALL dummy_entity_decl_handler(
+ void *userData, const XML_Char *entityName, int is_parameter_entity,
+ const XML_Char *value, int value_length, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName);
+
+extern void XMLCALL dummy_notation_decl_handler(void *userData,
+ const XML_Char *notationName,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern void XMLCALL dummy_element_decl_handler(void *userData,
+ const XML_Char *name,
+ XML_Content *model);
+
+extern void XMLCALL dummy_attlist_decl_handler(
+ void *userData, const XML_Char *elname, const XML_Char *attname,
+ const XML_Char *att_type, const XML_Char *dflt, int isrequired);
+
+extern void XMLCALL dummy_comment_handler(void *userData, const XML_Char *data);
+
+extern void XMLCALL dummy_pi_handler(void *userData, const XML_Char *target,
+ const XML_Char *data);
+
+extern void XMLCALL dummy_start_element(void *userData, const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL dummy_end_element(void *userData, const XML_Char *name);
+
+extern void XMLCALL dummy_start_cdata_handler(void *userData);
+
+extern void XMLCALL dummy_end_cdata_handler(void *userData);
+
+extern void XMLCALL dummy_cdata_handler(void *userData, const XML_Char *s,
+ int len);
+
+extern void XMLCALL dummy_start_namespace_decl_handler(void *userData,
+ const XML_Char *prefix,
+ const XML_Char *uri);
+
+extern void XMLCALL dummy_end_namespace_decl_handler(void *userData,
+ const XML_Char *prefix);
+
+extern void XMLCALL dummy_unparsed_entity_decl_handler(
+ void *userData, const XML_Char *entityName, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName);
+
+extern void XMLCALL dummy_default_handler(void *userData, const XML_Char *s,
+ int len);
+
+extern void XMLCALL dummy_start_doctype_decl_handler(
+ void *userData, const XML_Char *doctypeName, const XML_Char *sysid,
+ const XML_Char *pubid, int has_internal_subset);
+
+extern void XMLCALL dummy_end_doctype_decl_handler(void *userData);
+
+extern void XMLCALL dummy_skip_handler(void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity);
+
+#endif /* XML_DUMMY_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/expat/tests/dummy_cxx.cpp b/3rdparty/expat/tests/dummy_cxx.cpp
new file mode 100644
index 00000000000..27c9f431ecd
--- /dev/null
+++ b/3rdparty/expat/tests/dummy_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "dummy.c"
diff --git a/3rdparty/expat/tests/handlers.c b/3rdparty/expat/tests/handlers.c
new file mode 100644
index 00000000000..ac459507580
--- /dev/null
+++ b/3rdparty/expat/tests/handlers.c
@@ -0,0 +1,1979 @@
+/* XML handler functions for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#if defined(NDEBUG)
+# undef NDEBUG /* because test suite relies on assert(...) at the moment */
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include "expat_config.h"
+
+#include "expat.h"
+#include "internal.h"
+#include "chardata.h"
+#include "structdata.h"
+#include "common.h"
+#include "handlers.h"
+
+/* Global variables for user parameter settings tests */
+/* Variable holding the expected handler userData */
+const void *g_handler_data = NULL;
+/* Count of the number of times the comment handler has been invoked */
+int g_comment_count = 0;
+/* Count of the number of skipped entities */
+int g_skip_count = 0;
+/* Count of the number of times the XML declaration handler is invoked */
+int g_xdecl_count = 0;
+
+/* Start/End Element Handlers */
+
+void XMLCALL
+start_element_event_handler(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ UNUSED_P(atts);
+ CharData_AppendXMLChars((CharData *)userData, name, -1);
+}
+
+void XMLCALL
+end_element_event_handler(void *userData, const XML_Char *name) {
+ CharData *storage = (CharData *)userData;
+ CharData_AppendXMLChars(storage, XCS("/"), 1);
+ CharData_AppendXMLChars(storage, name, -1);
+}
+
+void XMLCALL
+start_element_event_handler2(void *userData, const XML_Char *name,
+ const XML_Char **attr) {
+ StructData *storage = (StructData *)userData;
+ UNUSED_P(attr);
+ StructData_AddItem(storage, name, XML_GetCurrentColumnNumber(g_parser),
+ XML_GetCurrentLineNumber(g_parser), STRUCT_START_TAG);
+}
+
+void XMLCALL
+end_element_event_handler2(void *userData, const XML_Char *name) {
+ StructData *storage = (StructData *)userData;
+ StructData_AddItem(storage, name, XML_GetCurrentColumnNumber(g_parser),
+ XML_GetCurrentLineNumber(g_parser), STRUCT_END_TAG);
+}
+
+void XMLCALL
+counting_start_element_handler(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ ParserAndElementInfo *const parserAndElementInfos
+ = (ParserAndElementInfo *)userData;
+ ElementInfo *info = parserAndElementInfos->info;
+ AttrInfo *attr;
+ int count, id, i;
+
+ while (info->name != NULL) {
+ if (! xcstrcmp(name, info->name))
+ break;
+ info++;
+ }
+ if (info->name == NULL)
+ fail("Element not recognised");
+ /* The attribute count is twice what you might expect. It is a
+ * count of items in atts, an array which contains alternating
+ * attribute names and attribute values. For the naive user this
+ * is possibly a little unexpected, but it is what the
+ * documentation in expat.h tells us to expect.
+ */
+ count = XML_GetSpecifiedAttributeCount(parserAndElementInfos->parser);
+ if (info->attr_count * 2 != count) {
+ fail("Not got expected attribute count");
+ return;
+ }
+ id = XML_GetIdAttributeIndex(parserAndElementInfos->parser);
+ if (id == -1 && info->id_name != NULL) {
+ fail("ID not present");
+ return;
+ }
+ if (id != -1 && xcstrcmp(atts[id], info->id_name)) {
+ fail("ID does not have the correct name");
+ return;
+ }
+ for (i = 0; i < info->attr_count; i++) {
+ attr = info->attributes;
+ while (attr->name != NULL) {
+ if (! xcstrcmp(atts[0], attr->name))
+ break;
+ attr++;
+ }
+ if (attr->name == NULL) {
+ fail("Attribute not recognised");
+ return;
+ }
+ if (xcstrcmp(atts[1], attr->value)) {
+ fail("Attribute has wrong value");
+ return;
+ }
+ /* Remember, two entries in atts per attribute (see above) */
+ atts += 2;
+ }
+}
+
+void XMLCALL
+suspending_end_handler(void *userData, const XML_Char *s) {
+ UNUSED_P(s);
+ XML_StopParser((XML_Parser)userData, 1);
+}
+
+void XMLCALL
+start_element_suspender(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ UNUSED_P(userData);
+ UNUSED_P(atts);
+ if (! xcstrcmp(name, XCS("suspend")))
+ XML_StopParser(g_parser, XML_TRUE);
+ if (! xcstrcmp(name, XCS("abort")))
+ XML_StopParser(g_parser, XML_FALSE);
+}
+
+/* Check that an element name and attribute name match the expected values.
+ The expected values are passed as an array reference of string pointers
+ provided as the userData argument; the first is the expected
+ element name, and the second is the expected attribute name.
+*/
+int g_triplet_start_flag = XML_FALSE;
+int g_triplet_end_flag = XML_FALSE;
+
+void XMLCALL
+triplet_start_checker(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ XML_Char **elemstr = (XML_Char **)userData;
+ char buffer[1024];
+ if (xcstrcmp(elemstr[0], name) != 0) {
+ snprintf(buffer, sizeof(buffer),
+ "unexpected start string: '%" XML_FMT_STR "'", name);
+ fail(buffer);
+ }
+ if (xcstrcmp(elemstr[1], atts[0]) != 0) {
+ snprintf(buffer, sizeof(buffer),
+ "unexpected attribute string: '%" XML_FMT_STR "'", atts[0]);
+ fail(buffer);
+ }
+ g_triplet_start_flag = XML_TRUE;
+}
+
+/* Check that the element name passed to the end-element handler matches
+ the expected value. The expected value is passed as the first element
+ in an array of strings passed as the userData argument.
+*/
+void XMLCALL
+triplet_end_checker(void *userData, const XML_Char *name) {
+ XML_Char **elemstr = (XML_Char **)userData;
+ if (xcstrcmp(elemstr[0], name) != 0) {
+ char buffer[1024];
+ snprintf(buffer, sizeof(buffer),
+ "unexpected end string: '%" XML_FMT_STR "'", name);
+ fail(buffer);
+ }
+ g_triplet_end_flag = XML_TRUE;
+}
+
+void XMLCALL
+overwrite_start_checker(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ CharData *storage = (CharData *)userData;
+ CharData_AppendXMLChars(storage, XCS("start "), 6);
+ CharData_AppendXMLChars(storage, name, -1);
+ while (*atts != NULL) {
+ CharData_AppendXMLChars(storage, XCS("\nattribute "), 11);
+ CharData_AppendXMLChars(storage, *atts, -1);
+ atts += 2;
+ }
+ CharData_AppendXMLChars(storage, XCS("\n"), 1);
+}
+
+void XMLCALL
+overwrite_end_checker(void *userData, const XML_Char *name) {
+ CharData *storage = (CharData *)userData;
+ CharData_AppendXMLChars(storage, XCS("end "), 4);
+ CharData_AppendXMLChars(storage, name, -1);
+ CharData_AppendXMLChars(storage, XCS("\n"), 1);
+}
+
+void XMLCALL
+start_element_fail(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ UNUSED_P(userData);
+ UNUSED_P(name);
+ UNUSED_P(atts);
+
+ /* We should never get here. */
+ fail("should never reach start_element_fail()");
+}
+
+void XMLCALL
+start_ns_clearing_start_element(void *userData, const XML_Char *prefix,
+ const XML_Char *uri) {
+ UNUSED_P(prefix);
+ UNUSED_P(uri);
+ XML_SetStartElementHandler((XML_Parser)userData, NULL);
+}
+
+void XMLCALL
+start_element_issue_240(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ DataIssue240 *mydata = (DataIssue240 *)userData;
+ UNUSED_P(name);
+ UNUSED_P(atts);
+ mydata->deep++;
+}
+
+void XMLCALL
+end_element_issue_240(void *userData, const XML_Char *name) {
+ DataIssue240 *mydata = (DataIssue240 *)userData;
+
+ UNUSED_P(name);
+ mydata->deep--;
+ if (mydata->deep == 0) {
+ XML_StopParser(mydata->parser, 0);
+ }
+}
+
+/* Text encoding handlers */
+
+int XMLCALL
+UnknownEncodingHandler(void *data, const XML_Char *encoding,
+ XML_Encoding *info) {
+ UNUSED_P(data);
+ if (xcstrcmp(encoding, XCS("unsupported-encoding")) == 0) {
+ int i;
+ for (i = 0; i < 256; ++i)
+ info->map[i] = i;
+ info->data = NULL;
+ info->convert = NULL;
+ info->release = NULL;
+ return XML_STATUS_OK;
+ }
+ return XML_STATUS_ERROR;
+}
+
+static void
+dummy_release(void *data) {
+ UNUSED_P(data);
+}
+
+int XMLCALL
+UnrecognisedEncodingHandler(void *data, const XML_Char *encoding,
+ XML_Encoding *info) {
+ UNUSED_P(data);
+ UNUSED_P(encoding);
+ info->data = NULL;
+ info->convert = NULL;
+ info->release = dummy_release;
+ return XML_STATUS_ERROR;
+}
+
+int XMLCALL
+unknown_released_encoding_handler(void *data, const XML_Char *encoding,
+ XML_Encoding *info) {
+ UNUSED_P(data);
+ if (! xcstrcmp(encoding, XCS("unsupported-encoding"))) {
+ int i;
+
+ for (i = 0; i < 256; i++)
+ info->map[i] = i;
+ info->data = NULL;
+ info->convert = NULL;
+ info->release = dummy_release;
+ return XML_STATUS_OK;
+ }
+ return XML_STATUS_ERROR;
+}
+
+static int XMLCALL
+failing_converter(void *data, const char *s) {
+ UNUSED_P(data);
+ UNUSED_P(s);
+ /* Always claim to have failed */
+ return -1;
+}
+
+static int XMLCALL
+prefix_converter(void *data, const char *s) {
+ UNUSED_P(data);
+ /* If the first byte is 0xff, raise an error */
+ if (s[0] == (char)-1)
+ return -1;
+ /* Just add the low bits of the first byte to the second */
+ return (s[1] + (s[0] & 0x7f)) & 0x01ff;
+}
+
+int XMLCALL
+MiscEncodingHandler(void *data, const XML_Char *encoding, XML_Encoding *info) {
+ int i;
+ int high_map = -2; /* Assume a 2-byte sequence */
+
+ if (! xcstrcmp(encoding, XCS("invalid-9"))
+ || ! xcstrcmp(encoding, XCS("ascii-like"))
+ || ! xcstrcmp(encoding, XCS("invalid-len"))
+ || ! xcstrcmp(encoding, XCS("invalid-a"))
+ || ! xcstrcmp(encoding, XCS("invalid-surrogate"))
+ || ! xcstrcmp(encoding, XCS("invalid-high")))
+ high_map = -1;
+
+ for (i = 0; i < 128; ++i)
+ info->map[i] = i;
+ for (; i < 256; ++i)
+ info->map[i] = high_map;
+
+ /* If required, put an invalid value in the ASCII entries */
+ if (! xcstrcmp(encoding, XCS("invalid-9")))
+ info->map[9] = 5;
+ /* If required, have a top-bit set character starts a 5-byte sequence */
+ if (! xcstrcmp(encoding, XCS("invalid-len")))
+ info->map[0x81] = -5;
+ /* If required, make a top-bit set character a valid ASCII character */
+ if (! xcstrcmp(encoding, XCS("invalid-a")))
+ info->map[0x82] = 'a';
+ /* If required, give a top-bit set character a forbidden value,
+ * what would otherwise be the first of a surrogate pair.
+ */
+ if (! xcstrcmp(encoding, XCS("invalid-surrogate")))
+ info->map[0x83] = 0xd801;
+ /* If required, give a top-bit set character too high a value */
+ if (! xcstrcmp(encoding, XCS("invalid-high")))
+ info->map[0x84] = 0x010101;
+
+ info->data = data;
+ info->release = NULL;
+ if (! xcstrcmp(encoding, XCS("failing-conv")))
+ info->convert = failing_converter;
+ else if (! xcstrcmp(encoding, XCS("prefix-conv")))
+ info->convert = prefix_converter;
+ else
+ info->convert = NULL;
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+long_encoding_handler(void *userData, const XML_Char *encoding,
+ XML_Encoding *info) {
+ int i;
+
+ UNUSED_P(userData);
+ UNUSED_P(encoding);
+ for (i = 0; i < 256; i++)
+ info->map[i] = i;
+ info->data = NULL;
+ info->convert = NULL;
+ info->release = NULL;
+ return XML_STATUS_OK;
+}
+
+/* External Entity Handlers */
+
+int XMLCALL
+external_entity_optioner(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ ExtOption *options = (ExtOption *)XML_GetUserData(parser);
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(publicId);
+ while (options->parse_text != NULL) {
+ if (! xcstrcmp(systemId, options->system_id)) {
+ enum XML_Status rc;
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ return XML_STATUS_ERROR;
+ rc = _XML_Parse_SINGLE_BYTES(ext_parser, options->parse_text,
+ (int)strlen(options->parse_text), XML_TRUE);
+ XML_ParserFree(ext_parser);
+ return rc;
+ }
+ options++;
+ }
+ fail("No suitable option found");
+ return XML_STATUS_ERROR;
+}
+
+int XMLCALL
+external_entity_loader(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ ExtTest *test_data = (ExtTest *)XML_GetUserData(parser);
+ XML_Parser extparser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ extparser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (extparser == NULL)
+ fail("Could not create external entity parser.");
+ if (test_data->encoding != NULL) {
+ if (! XML_SetEncoding(extparser, test_data->encoding))
+ fail("XML_SetEncoding() ignored for external entity");
+ }
+ if (_XML_Parse_SINGLE_BYTES(extparser, test_data->parse_text,
+ (int)strlen(test_data->parse_text), XML_TRUE)
+ == XML_STATUS_ERROR) {
+ xml_failure(extparser);
+ return XML_STATUS_ERROR;
+ }
+ XML_ParserFree(extparser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_faulter(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ XML_Parser ext_parser;
+ ExtFaults *fault = (ExtFaults *)XML_GetUserData(parser);
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ if (fault->encoding != NULL) {
+ if (! XML_SetEncoding(ext_parser, fault->encoding))
+ fail("XML_SetEncoding failed");
+ }
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, fault->parse_text,
+ (int)strlen(fault->parse_text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail(fault->fail_text);
+ if (XML_GetErrorCode(ext_parser) != fault->error)
+ xml_failure(ext_parser);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_ERROR;
+}
+
+int XMLCALL
+external_entity_null_loader(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ UNUSED_P(parser);
+ UNUSED_P(context);
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_resetter(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<!ELEMENT doc (#PCDATA)*>";
+ XML_Parser ext_parser;
+ XML_ParsingStatus status;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ XML_GetParsingStatus(ext_parser, &status);
+ if (status.parsing != XML_INITIALIZED) {
+ fail("Parsing status is not INITIALIZED");
+ return XML_STATUS_ERROR;
+ }
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR) {
+ xml_failure(parser);
+ return XML_STATUS_ERROR;
+ }
+ XML_GetParsingStatus(ext_parser, &status);
+ if (status.parsing != XML_FINISHED) {
+ fail("Parsing status is not FINISHED");
+ return XML_STATUS_ERROR;
+ }
+ /* Check we can't parse here */
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Parsing when finished not faulted");
+ if (XML_GetErrorCode(ext_parser) != XML_ERROR_FINISHED)
+ fail("Parsing when finished faulted with wrong code");
+ XML_ParserReset(ext_parser, NULL);
+ XML_GetParsingStatus(ext_parser, &status);
+ if (status.parsing != XML_FINISHED) {
+ fail("Parsing status not still FINISHED");
+ return XML_STATUS_ERROR;
+ }
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+void XMLCALL
+entity_suspending_decl_handler(void *userData, const XML_Char *name,
+ XML_Content *model) {
+ XML_Parser ext_parser = (XML_Parser)userData;
+
+ UNUSED_P(name);
+ if (XML_StopParser(ext_parser, XML_TRUE) != XML_STATUS_ERROR)
+ fail("Attempting to suspend a subordinate parser not faulted");
+ if (XML_GetErrorCode(ext_parser) != XML_ERROR_SUSPEND_PE)
+ fail("Suspending subordinate parser get wrong code");
+ XML_SetElementDeclHandler(ext_parser, NULL);
+ XML_FreeContentModel(g_parser, model);
+}
+
+int XMLCALL
+external_entity_suspender(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<!ELEMENT doc (#PCDATA)*>";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ XML_SetElementDeclHandler(ext_parser, entity_suspending_decl_handler);
+ XML_SetUserData(ext_parser, ext_parser);
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR) {
+ xml_failure(ext_parser);
+ return XML_STATUS_ERROR;
+ }
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+void XMLCALL
+entity_suspending_xdecl_handler(void *userData, const XML_Char *version,
+ const XML_Char *encoding, int standalone) {
+ XML_Parser ext_parser = (XML_Parser)userData;
+
+ UNUSED_P(version);
+ UNUSED_P(encoding);
+ UNUSED_P(standalone);
+ XML_StopParser(ext_parser, g_resumable);
+ XML_SetXmlDeclHandler(ext_parser, NULL);
+}
+
+int XMLCALL
+external_entity_suspend_xmldecl(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<?xml version='1.0' encoding='us-ascii'?>";
+ XML_Parser ext_parser;
+ XML_ParsingStatus status;
+ enum XML_Status rc;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ XML_SetXmlDeclHandler(ext_parser, entity_suspending_xdecl_handler);
+ XML_SetUserData(ext_parser, ext_parser);
+ rc = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE);
+ XML_GetParsingStatus(ext_parser, &status);
+ if (g_resumable) {
+ if (rc == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+ if (status.parsing != XML_SUSPENDED)
+ fail("Ext Parsing status not SUSPENDED");
+ } else {
+ if (rc != XML_STATUS_ERROR)
+ fail("Ext parsing not aborted");
+ if (XML_GetErrorCode(ext_parser) != XML_ERROR_ABORTED)
+ xml_failure(ext_parser);
+ if (status.parsing != XML_FINISHED)
+ fail("Ext Parsing status not FINISHED");
+ }
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_suspending_faulter(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId) {
+ XML_Parser ext_parser;
+ ExtFaults *fault = (ExtFaults *)XML_GetUserData(parser);
+ void *buffer;
+ int parse_len = (int)strlen(fault->parse_text);
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ XML_SetXmlDeclHandler(ext_parser, entity_suspending_xdecl_handler);
+ XML_SetUserData(ext_parser, ext_parser);
+ g_resumable = XML_TRUE;
+ buffer = XML_GetBuffer(ext_parser, parse_len);
+ if (buffer == NULL)
+ fail("Could not allocate parse buffer");
+ assert(buffer != NULL);
+ memcpy(buffer, fault->parse_text, parse_len);
+ if (XML_ParseBuffer(ext_parser, parse_len, XML_FALSE) != XML_STATUS_SUSPENDED)
+ fail("XML declaration did not suspend");
+ if (XML_ResumeParser(ext_parser) != XML_STATUS_OK)
+ xml_failure(ext_parser);
+ if (XML_ParseBuffer(ext_parser, 0, XML_TRUE) != XML_STATUS_ERROR)
+ fail(fault->fail_text);
+ if (XML_GetErrorCode(ext_parser) != fault->error)
+ xml_failure(ext_parser);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_ERROR;
+}
+
+int XMLCALL
+external_entity_failer__if_not_xml_ge(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId) {
+ UNUSED_P(parser);
+ UNUSED_P(context);
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+#if XML_GE == 0
+ fail(
+ "Function external_entity_suspending_failer was called despite XML_GE==0.");
+#endif
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_cr_catcher(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "\r";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ XML_SetCharacterDataHandler(ext_parser, cr_cdata_handler);
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_bad_cr_catcher(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<tag>\r";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ XML_SetCharacterDataHandler(ext_parser, cr_cdata_handler);
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_OK)
+ fail("Async entity error not caught");
+ if (XML_GetErrorCode(ext_parser) != XML_ERROR_ASYNC_ENTITY)
+ xml_failure(ext_parser);
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_rsqb_catcher(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<tag>]";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ XML_SetCharacterDataHandler(ext_parser, rsqb_handler);
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Async entity error not caught");
+ if (XML_GetErrorCode(ext_parser) != XML_ERROR_ASYNC_ENTITY)
+ xml_failure(ext_parser);
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_good_cdata_ascii(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<a><![CDATA[<greeting>Hello, world!</greeting>]]></a>";
+ const XML_Char *expected = XCS("<greeting>Hello, world!</greeting>");
+ CharData storage;
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ CharData_Init(&storage);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ XML_SetUserData(ext_parser, &storage);
+ XML_SetCharacterDataHandler(ext_parser, accumulate_characters);
+
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+ CharData_CheckXMLChars(&storage, expected);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_param_checker(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<!-- Subordinate parser -->\n"
+ "<!ELEMENT doc (#PCDATA)*>";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ g_handler_data = ext_parser;
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR) {
+ xml_failure(parser);
+ return XML_STATUS_ERROR;
+ }
+ g_handler_data = parser;
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_ref_param_checker(XML_Parser parameter, const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<!ELEMENT doc (#PCDATA)*>";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ if ((void *)parameter != g_handler_data)
+ fail("External entity ref handler parameter not correct");
+
+ /* Here we use the global 'parser' variable */
+ ext_parser = XML_ExternalEntityParserCreate(g_parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_param(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text1 = "<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % e1 SYSTEM '004-2.ent'>\n"
+ "<!ENTITY % e2 '%e1;'>\n"
+ "%e1;\n";
+ const char *text2 = "<!ELEMENT el EMPTY>\n"
+ "<el/>\n";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(publicId);
+ if (systemId == NULL)
+ return XML_STATUS_OK;
+
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+
+ if (! xcstrcmp(systemId, XCS("004-1.ent"))) {
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Inner DTD with invalid tag not rejected");
+ if (XML_GetErrorCode(ext_parser) != XML_ERROR_EXTERNAL_ENTITY_HANDLING)
+ xml_failure(ext_parser);
+ } else if (! xcstrcmp(systemId, XCS("004-2.ent"))) {
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, (int)strlen(text2), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Invalid tag in external param not rejected");
+ if (XML_GetErrorCode(ext_parser) != XML_ERROR_SYNTAX)
+ xml_failure(ext_parser);
+ } else {
+ fail("Unknown system ID");
+ }
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_ERROR;
+}
+
+int XMLCALL
+external_entity_load_ignore(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<![IGNORE[<!ELEMENT e (#PCDATA)*>]]>";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_load_ignore_utf16(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char text[] =
+ /* <![IGNORE[<!ELEMENT e (#PCDATA)*>]]> */
+ "<\0!\0[\0I\0G\0N\0O\0R\0E\0[\0"
+ "<\0!\0E\0L\0E\0M\0E\0N\0T\0 \0e\0 \0"
+ "(\0#\0P\0C\0D\0A\0T\0A\0)\0*\0>\0]\0]\0>\0";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_load_ignore_utf16_be(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char text[] =
+ /* <![IGNORE[<!ELEMENT e (#PCDATA)*>]]> */
+ "\0<\0!\0[\0I\0G\0N\0O\0R\0E\0["
+ "\0<\0!\0E\0L\0E\0M\0E\0N\0T\0 \0e\0 "
+ "\0(\0#\0P\0C\0D\0A\0T\0A\0)\0*\0>\0]\0]\0>";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_valuer(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text1 = "<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % e1 SYSTEM '004-2.ent'>\n"
+ "<!ENTITY % e2 '%e1;'>\n"
+ "%e1;\n";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(publicId);
+ if (systemId == NULL)
+ return XML_STATUS_OK;
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ if (! xcstrcmp(systemId, XCS("004-1.ent"))) {
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+ } else if (! xcstrcmp(systemId, XCS("004-2.ent"))) {
+ ExtFaults *fault = (ExtFaults *)XML_GetUserData(parser);
+ enum XML_Status status;
+ enum XML_Error error;
+
+ status = _XML_Parse_SINGLE_BYTES(ext_parser, fault->parse_text,
+ (int)strlen(fault->parse_text), XML_TRUE);
+ if (fault->error == XML_ERROR_NONE) {
+ if (status == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+ } else {
+ if (status != XML_STATUS_ERROR)
+ fail(fault->fail_text);
+ error = XML_GetErrorCode(ext_parser);
+ if (error != fault->error
+ && (fault->error != XML_ERROR_XML_DECL
+ || error != XML_ERROR_TEXT_DECL))
+ xml_failure(ext_parser);
+ }
+ }
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_not_standalone(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text1 = "<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % e1 SYSTEM 'bar'>\n"
+ "%e1;\n";
+ const char *text2 = "<!ATTLIST doc a1 CDATA 'value'>";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(publicId);
+ if (systemId == NULL)
+ return XML_STATUS_OK;
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ if (! xcstrcmp(systemId, XCS("foo"))) {
+ XML_SetNotStandaloneHandler(ext_parser, reject_not_standalone_handler);
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Expected not standalone rejection");
+ if (XML_GetErrorCode(ext_parser) != XML_ERROR_NOT_STANDALONE)
+ xml_failure(ext_parser);
+ XML_SetNotStandaloneHandler(ext_parser, NULL);
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_ERROR;
+ } else if (! xcstrcmp(systemId, XCS("bar"))) {
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, (int)strlen(text2), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+ }
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_value_aborter(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text1 = "<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % e1 SYSTEM '004-2.ent'>\n"
+ "<!ENTITY % e2 '%e1;'>\n"
+ "%e1;\n";
+ const char *text2 = "<?xml version='1.0' encoding='utf-8'?>";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(publicId);
+ if (systemId == NULL)
+ return XML_STATUS_OK;
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+ if (! xcstrcmp(systemId, XCS("004-1.ent"))) {
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+ }
+ if (! xcstrcmp(systemId, XCS("004-2.ent"))) {
+ XML_SetXmlDeclHandler(ext_parser, entity_suspending_xdecl_handler);
+ XML_SetUserData(ext_parser, ext_parser);
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, (int)strlen(text2), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Aborted parse not faulted");
+ if (XML_GetErrorCode(ext_parser) != XML_ERROR_ABORTED)
+ xml_failure(ext_parser);
+ }
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_public(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text1 = (const char *)XML_GetUserData(parser);
+ const char *text2 = "<!ATTLIST doc a CDATA 'value'>";
+ const char *text = NULL;
+ XML_Parser ext_parser;
+ int parse_res;
+
+ UNUSED_P(base);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ return XML_STATUS_ERROR;
+ if (systemId != NULL && ! xcstrcmp(systemId, XCS("http://example.org/"))) {
+ text = text1;
+ } else if (publicId != NULL && ! xcstrcmp(publicId, XCS("foo"))) {
+ text = text2;
+ } else
+ fail("Unexpected parameters to external entity parser");
+ assert(text != NULL);
+ parse_res
+ = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE);
+ XML_ParserFree(ext_parser);
+ return parse_res;
+}
+
+int XMLCALL
+external_entity_devaluer(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<!ELEMENT doc EMPTY>\n"
+ "<!ENTITY % e1 SYSTEM 'bar'>\n"
+ "%e1;\n";
+ XML_Parser ext_parser;
+ int clear_handler_flag = (XML_GetUserData(parser) != NULL);
+
+ UNUSED_P(base);
+ UNUSED_P(publicId);
+ if (systemId == NULL || ! xcstrcmp(systemId, XCS("bar")))
+ return XML_STATUS_OK;
+ if (xcstrcmp(systemId, XCS("foo")))
+ fail("Unexpected system ID");
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could note create external entity parser");
+ if (clear_handler_flag)
+ XML_SetExternalEntityRefHandler(ext_parser, NULL);
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_oneshot_loader(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ ExtHdlrData *test_data = (ExtHdlrData *)XML_GetUserData(parser);
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser.");
+ /* Use the requested entity parser for further externals */
+ XML_SetExternalEntityRefHandler(ext_parser, test_data->handler);
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, test_data->parse_text,
+ (int)strlen(test_data->parse_text), XML_TRUE)
+ == XML_STATUS_ERROR) {
+ xml_failure(ext_parser);
+ }
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_loader2(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ ExtTest2 *test_data = (ExtTest2 *)XML_GetUserData(parser);
+ XML_Parser extparser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ extparser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (extparser == NULL)
+ fail("Coulr not create external entity parser");
+ if (test_data->encoding != NULL) {
+ if (! XML_SetEncoding(extparser, test_data->encoding))
+ fail("XML_SetEncoding() ignored for external entity");
+ }
+ if (_XML_Parse_SINGLE_BYTES(extparser, test_data->parse_text,
+ test_data->parse_len, XML_TRUE)
+ == XML_STATUS_ERROR) {
+ xml_failure(extparser);
+ }
+
+ XML_ParserFree(extparser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_faulter2(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ ExtFaults2 *test_data = (ExtFaults2 *)XML_GetUserData(parser);
+ XML_Parser extparser;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ extparser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (extparser == NULL)
+ fail("Could not create external entity parser");
+ if (test_data->encoding != NULL) {
+ if (! XML_SetEncoding(extparser, test_data->encoding))
+ fail("XML_SetEncoding() ignored for external entity");
+ }
+ if (_XML_Parse_SINGLE_BYTES(extparser, test_data->parse_text,
+ test_data->parse_len, XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail(test_data->fail_text);
+ if (XML_GetErrorCode(extparser) != test_data->error)
+ xml_failure(extparser);
+
+ XML_ParserFree(extparser);
+ return XML_STATUS_ERROR;
+}
+
+int XMLCALL
+external_entity_unfinished_attlist(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = "<!ELEMENT barf ANY>\n"
+ "<!ATTLIST barf my_attr (blah|%blah;a|foo) #REQUIRED>\n"
+ "<!--COMMENT-->\n";
+ XML_Parser ext_parser;
+
+ UNUSED_P(base);
+ UNUSED_P(publicId);
+ if (systemId == NULL)
+ return XML_STATUS_OK;
+
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+
+ if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(ext_parser);
+
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_handler(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ void *user_data = XML_GetUserData(parser);
+ const char *text;
+ XML_Parser p2;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ if (user_data == NULL)
+ text = ("<!ELEMENT doc (e+)>\n"
+ "<!ATTLIST doc xmlns CDATA #IMPLIED>\n"
+ "<!ELEMENT e EMPTY>\n");
+ else
+ text = ("<?xml version='1.0' encoding='us-ascii'?>"
+ "<e/>");
+
+ /* Set user data to any non-NULL value */
+ XML_SetUserData(parser, parser);
+ p2 = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (_XML_Parse_SINGLE_BYTES(p2, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR) {
+ xml_failure(p2);
+ return XML_STATUS_ERROR;
+ }
+ XML_ParserFree(p2);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_duff_loader(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ XML_Parser new_parser;
+ unsigned int i;
+ const unsigned int max_alloc_count = 10;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ /* Try a few different allocation levels */
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (new_parser != NULL) {
+ XML_ParserFree(new_parser);
+ break;
+ }
+ }
+ if (i == 0)
+ fail("External parser creation ignored failing allocator");
+ else if (i == max_alloc_count)
+ fail("Extern parser not created with max allocation count");
+
+ /* Make sure other random allocation doesn't now fail */
+ g_allocation_count = ALLOC_ALWAYS_SUCCEED;
+
+ /* Make sure the failure code path is executed too */
+ return XML_STATUS_ERROR;
+}
+
+int XMLCALL
+external_entity_dbl_handler(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ int *pcallno = (int *)XML_GetUserData(parser);
+ int callno = *pcallno;
+ const char *text;
+ XML_Parser new_parser = NULL;
+ int i;
+ const int max_alloc_count = 20;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ if (callno == 0) {
+ /* First time through, check how many calls to malloc occur */
+ text = ("<!ELEMENT doc (e+)>\n"
+ "<!ATTLIST doc xmlns CDATA #IMPLIED>\n"
+ "<!ELEMENT e EMPTY>\n");
+ g_allocation_count = 10000;
+ new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (new_parser == NULL) {
+ fail("Unable to allocate first external parser");
+ return XML_STATUS_ERROR;
+ }
+ /* Stash the number of calls in the user data */
+ *pcallno = 10000 - g_allocation_count;
+ } else {
+ text = ("<?xml version='1.0' encoding='us-ascii'?>"
+ "<e/>");
+ /* Try at varying levels to exercise more code paths */
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = callno + i;
+ new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (new_parser != NULL)
+ break;
+ }
+ if (i == 0) {
+ fail("Second external parser unexpectedly created");
+ XML_ParserFree(new_parser);
+ return XML_STATUS_ERROR;
+ } else if (i == max_alloc_count) {
+ fail("Second external parser not created");
+ return XML_STATUS_ERROR;
+ }
+ }
+
+ g_allocation_count = ALLOC_ALWAYS_SUCCEED;
+ if (_XML_Parse_SINGLE_BYTES(new_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR) {
+ xml_failure(new_parser);
+ return XML_STATUS_ERROR;
+ }
+ XML_ParserFree(new_parser);
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_dbl_handler_2(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ int *pcallno = (int *)XML_GetUserData(parser);
+ int callno = *pcallno;
+ const char *text;
+ XML_Parser new_parser;
+ enum XML_Status rv;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ if (callno == 0) {
+ /* Try different allocation levels for whole exercise */
+ text = ("<!ELEMENT doc (e+)>\n"
+ "<!ATTLIST doc xmlns CDATA #IMPLIED>\n"
+ "<!ELEMENT e EMPTY>\n");
+ *pcallno = 1;
+ new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (new_parser == NULL)
+ return XML_STATUS_ERROR;
+ rv = _XML_Parse_SINGLE_BYTES(new_parser, text, (int)strlen(text), XML_TRUE);
+ } else {
+ /* Just run through once */
+ text = ("<?xml version='1.0' encoding='us-ascii'?>"
+ "<e/>");
+ new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (new_parser == NULL)
+ return XML_STATUS_ERROR;
+ rv = _XML_Parse_SINGLE_BYTES(new_parser, text, (int)strlen(text), XML_TRUE);
+ }
+ XML_ParserFree(new_parser);
+ if (rv == XML_STATUS_ERROR)
+ return XML_STATUS_ERROR;
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_alloc_set_encoding(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId) {
+ /* As for external_entity_loader() */
+ const char *text = "<?xml encoding='iso-8859-3'?>"
+ "\xC3\xA9";
+ XML_Parser ext_parser;
+ enum XML_Status status;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ return XML_STATUS_ERROR;
+ if (! XML_SetEncoding(ext_parser, XCS("utf-8"))) {
+ XML_ParserFree(ext_parser);
+ return XML_STATUS_ERROR;
+ }
+ status
+ = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE);
+ XML_ParserFree(ext_parser);
+ if (status == XML_STATUS_ERROR)
+ return XML_STATUS_ERROR;
+ return XML_STATUS_OK;
+}
+
+int XMLCALL
+external_entity_reallocator(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = get_buffer_test_text;
+ XML_Parser ext_parser;
+ void *buffer;
+ enum XML_Status status;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ fail("Could not create external entity parser");
+
+ g_reallocation_count = *(int *)XML_GetUserData(parser);
+ buffer = XML_GetBuffer(ext_parser, 1536);
+ if (buffer == NULL)
+ fail("Buffer allocation failed");
+ assert(buffer != NULL);
+ memcpy(buffer, text, strlen(text));
+ status = XML_ParseBuffer(ext_parser, (int)strlen(text), XML_FALSE);
+ g_reallocation_count = -1;
+ XML_ParserFree(ext_parser);
+ return (status == XML_STATUS_OK) ? XML_STATUS_OK : XML_STATUS_ERROR;
+}
+
+int XMLCALL
+external_entity_alloc(XML_Parser parser, const XML_Char *context,
+ const XML_Char *base, const XML_Char *systemId,
+ const XML_Char *publicId) {
+ const char *text = (const char *)XML_GetUserData(parser);
+ XML_Parser ext_parser;
+ int parse_res;
+
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+ if (ext_parser == NULL)
+ return XML_STATUS_ERROR;
+ parse_res
+ = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE);
+ XML_ParserFree(ext_parser);
+ return parse_res;
+}
+
+int XMLCALL
+external_entity_parser_create_alloc_fail_handler(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId) {
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+
+ if (context != NULL)
+ fail("Unexpected non-NULL context");
+
+ // The following number intends to fail the upcoming allocation in line
+ // "parser->m_protocolEncodingName = copyString(encodingName,
+ // &(parser->m_mem));" in function parserInit.
+ g_allocation_count = 3;
+
+ const XML_Char *const encodingName = XCS("UTF-8"); // needs something non-NULL
+ const XML_Parser ext_parser
+ = XML_ExternalEntityParserCreate(parser, context, encodingName);
+ if (ext_parser != NULL)
+ fail(
+ "Call to XML_ExternalEntityParserCreate was expected to fail out-of-memory");
+
+ g_allocation_count = ALLOC_ALWAYS_SUCCEED;
+ return XML_STATUS_ERROR;
+}
+
+#if XML_GE == 1
+int
+accounting_external_entity_ref_handler(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId) {
+ UNUSED_P(base);
+ UNUSED_P(publicId);
+
+ const struct AccountingTestCase *const testCase
+ = (const struct AccountingTestCase *)XML_GetUserData(parser);
+
+ const char *externalText = NULL;
+ if (xcstrcmp(systemId, XCS("first.ent")) == 0) {
+ externalText = testCase->firstExternalText;
+ } else if (xcstrcmp(systemId, XCS("second.ent")) == 0) {
+ externalText = testCase->secondExternalText;
+ } else {
+ assert(! "systemId is neither \"first.ent\" nor \"second.ent\"");
+ }
+ assert(externalText);
+
+ XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0);
+ assert(entParser);
+
+ const enum XML_Status status = _XML_Parse_SINGLE_BYTES(
+ entParser, externalText, (int)strlen(externalText), XML_TRUE);
+
+ XML_ParserFree(entParser);
+ return status;
+}
+#endif /* XML_GE == 1 */
+
+/* NotStandalone handlers */
+
+int XMLCALL
+reject_not_standalone_handler(void *userData) {
+ UNUSED_P(userData);
+ return XML_STATUS_ERROR;
+}
+
+int XMLCALL
+accept_not_standalone_handler(void *userData) {
+ UNUSED_P(userData);
+ return XML_STATUS_OK;
+}
+
+/* Attribute List handlers */
+void XMLCALL
+verify_attlist_decl_handler(void *userData, const XML_Char *element_name,
+ const XML_Char *attr_name,
+ const XML_Char *attr_type,
+ const XML_Char *default_value, int is_required) {
+ AttTest *at = (AttTest *)userData;
+
+ if (xcstrcmp(element_name, at->element_name))
+ fail("Unexpected element name in attribute declaration");
+ if (xcstrcmp(attr_name, at->attr_name))
+ fail("Unexpected attribute name in attribute declaration");
+ if (xcstrcmp(attr_type, at->attr_type))
+ fail("Unexpected attribute type in attribute declaration");
+ if ((default_value == NULL && at->default_value != NULL)
+ || (default_value != NULL && at->default_value == NULL)
+ || (default_value != NULL && xcstrcmp(default_value, at->default_value)))
+ fail("Unexpected default value in attribute declaration");
+ if (is_required != at->is_required)
+ fail("Requirement mismatch in attribute declaration");
+}
+
+/* Character Data handlers */
+
+void XMLCALL
+clearing_aborting_character_handler(void *userData, const XML_Char *s,
+ int len) {
+ UNUSED_P(userData);
+ UNUSED_P(s);
+ UNUSED_P(len);
+ XML_StopParser(g_parser, g_resumable);
+ XML_SetCharacterDataHandler(g_parser, NULL);
+}
+
+void XMLCALL
+parser_stop_character_handler(void *userData, const XML_Char *s, int len) {
+ UNUSED_P(userData);
+ UNUSED_P(s);
+ UNUSED_P(len);
+ XML_ParsingStatus status;
+ XML_GetParsingStatus(g_parser, &status);
+ if (status.parsing == XML_FINISHED) {
+ return; // the parser was stopped by a previous call to this handler.
+ }
+ XML_StopParser(g_parser, g_resumable);
+ XML_SetCharacterDataHandler(g_parser, NULL);
+ if (! g_resumable) {
+ /* Check that aborting an aborted parser is faulted */
+ if (XML_StopParser(g_parser, XML_FALSE) != XML_STATUS_ERROR)
+ fail("Aborting aborted parser not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_FINISHED)
+ xml_failure(g_parser);
+ } else if (g_abortable) {
+ /* Check that aborting a suspended parser works */
+ if (XML_StopParser(g_parser, XML_FALSE) == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ } else {
+ /* Check that suspending a suspended parser works */
+ if (XML_StopParser(g_parser, XML_TRUE) != XML_STATUS_ERROR)
+ fail("Suspending suspended parser not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_SUSPENDED)
+ xml_failure(g_parser);
+ }
+}
+
+void XMLCALL
+cr_cdata_handler(void *userData, const XML_Char *s, int len) {
+ int *pfound = (int *)userData;
+
+ /* Internal processing turns the CR into a newline for the
+ * character data handler, but not for the default handler
+ */
+ if (len == 1 && (*s == XCS('\n') || *s == XCS('\r')))
+ *pfound = 1;
+}
+
+void XMLCALL
+rsqb_handler(void *userData, const XML_Char *s, int len) {
+ int *pfound = (int *)userData;
+
+ if (len == 1 && *s == XCS(']'))
+ *pfound = 1;
+}
+
+void XMLCALL
+byte_character_handler(void *userData, const XML_Char *s, int len) {
+#if XML_CONTEXT_BYTES > 0
+ int offset, size;
+ const char *buffer;
+ ByteTestData *data = (ByteTestData *)userData;
+
+ UNUSED_P(s);
+ buffer = XML_GetInputContext(g_parser, &offset, &size);
+ if (buffer == NULL)
+ fail("Failed to get context buffer");
+ if (offset != data->start_element_len)
+ fail("Context offset in unexpected position");
+ if (len != data->cdata_len)
+ fail("CDATA length reported incorrectly");
+ if (size != data->total_string_len)
+ fail("Context size is not full buffer");
+ if (XML_GetCurrentByteIndex(g_parser) != offset)
+ fail("Character byte index incorrect");
+ if (XML_GetCurrentByteCount(g_parser) != len)
+ fail("Character byte count incorrect");
+#else
+ UNUSED_P(s);
+ UNUSED_P(userData);
+ UNUSED_P(len);
+#endif
+}
+
+void XMLCALL
+ext2_accumulate_characters(void *userData, const XML_Char *s, int len) {
+ ExtTest2 *test_data = (ExtTest2 *)userData;
+ accumulate_characters(test_data->storage, s, len);
+}
+
+/* Handlers that record their function name and int arg. */
+
+static void
+record_call(struct handler_record_list *const rec, const char *funcname,
+ const int arg) {
+ const int max_entries = sizeof(rec->entries) / sizeof(rec->entries[0]);
+ assert_true(rec->count < max_entries);
+ struct handler_record_entry *const e = &rec->entries[rec->count++];
+ e->name = funcname;
+ e->arg = arg;
+}
+
+void XMLCALL
+record_default_handler(void *userData, const XML_Char *s, int len) {
+ UNUSED_P(s);
+ record_call((struct handler_record_list *)userData, __func__, len);
+}
+
+void XMLCALL
+record_cdata_handler(void *userData, const XML_Char *s, int len) {
+ UNUSED_P(s);
+ record_call((struct handler_record_list *)userData, __func__, len);
+ XML_DefaultCurrent(g_parser);
+}
+
+void XMLCALL
+record_cdata_nodefault_handler(void *userData, const XML_Char *s, int len) {
+ UNUSED_P(s);
+ record_call((struct handler_record_list *)userData, __func__, len);
+}
+
+void XMLCALL
+record_skip_handler(void *userData, const XML_Char *entityName,
+ int is_parameter_entity) {
+ UNUSED_P(entityName);
+ record_call((struct handler_record_list *)userData, __func__,
+ is_parameter_entity);
+}
+
+void XMLCALL
+record_element_start_handler(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ UNUSED_P(atts);
+ CharData_AppendXMLChars((CharData *)userData, name, (int)xcstrlen(name));
+}
+
+void XMLCALL
+record_element_end_handler(void *userData, const XML_Char *name) {
+ CharData *storage = (CharData *)userData;
+
+ CharData_AppendXMLChars(storage, XCS("/"), 1);
+ CharData_AppendXMLChars(storage, name, -1);
+}
+
+const struct handler_record_entry *
+_handler_record_get(const struct handler_record_list *storage, int index,
+ const char *file, int line) {
+ if (storage->count <= index) {
+ _fail(file, line, "too few handler calls");
+ }
+ return &storage->entries[index];
+}
+
+/* Entity Declaration Handlers */
+static const XML_Char *entity_name_to_match = NULL;
+static const XML_Char *entity_value_to_match = NULL;
+static int entity_match_flag = ENTITY_MATCH_NOT_FOUND;
+
+void XMLCALL
+param_entity_match_handler(void *userData, const XML_Char *entityName,
+ int is_parameter_entity, const XML_Char *value,
+ int value_length, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName) {
+ UNUSED_P(userData);
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ UNUSED_P(notationName);
+ if (! is_parameter_entity || entity_name_to_match == NULL
+ || entity_value_to_match == NULL) {
+ return;
+ }
+ if (! xcstrcmp(entityName, entity_name_to_match)) {
+ /* The cast here is safe because we control the horizontal and
+ * the vertical, and we therefore know our strings are never
+ * going to overflow an int.
+ */
+ if (value_length != (int)xcstrlen(entity_value_to_match)
+ || xcstrncmp(value, entity_value_to_match, value_length)) {
+ entity_match_flag = ENTITY_MATCH_FAIL;
+ } else {
+ entity_match_flag = ENTITY_MATCH_SUCCESS;
+ }
+ }
+ /* Else leave the match flag alone */
+}
+
+void
+param_entity_match_init(const XML_Char *name, const XML_Char *value) {
+ entity_name_to_match = name;
+ entity_value_to_match = value;
+ entity_match_flag = ENTITY_MATCH_NOT_FOUND;
+}
+
+int
+get_param_entity_match_flag(void) {
+ return entity_match_flag;
+}
+
+/* Misc handlers */
+
+void XMLCALL
+xml_decl_handler(void *userData, const XML_Char *version,
+ const XML_Char *encoding, int standalone) {
+ UNUSED_P(version);
+ UNUSED_P(encoding);
+ if (userData != g_handler_data)
+ fail("User data (xml decl) not correctly set");
+ if (standalone != -1)
+ fail("Standalone not flagged as not present in XML decl");
+ g_xdecl_count++;
+}
+
+void XMLCALL
+param_check_skip_handler(void *userData, const XML_Char *entityName,
+ int is_parameter_entity) {
+ UNUSED_P(entityName);
+ UNUSED_P(is_parameter_entity);
+ if (userData != g_handler_data)
+ fail("User data (skip) not correctly set");
+ g_skip_count++;
+}
+
+void XMLCALL
+data_check_comment_handler(void *userData, const XML_Char *data) {
+ UNUSED_P(data);
+ /* Check that the userData passed through is what we expect */
+ if (userData != g_handler_data)
+ fail("User data (parser) not correctly set");
+ /* Check that the user data in the parser is appropriate */
+ if (XML_GetUserData(userData) != (void *)1)
+ fail("User data in parser not correctly set");
+ g_comment_count++;
+}
+
+void XMLCALL
+selective_aborting_default_handler(void *userData, const XML_Char *s, int len) {
+ const XML_Char trigger_char = *(const XML_Char *)userData;
+
+ int found = 0;
+ for (int i = 0; i < len; ++i) {
+ if (s[i] == trigger_char) {
+ found = 1;
+ break;
+ }
+ }
+
+ if (found) {
+ XML_StopParser(g_parser, g_resumable);
+ XML_SetDefaultHandler(g_parser, NULL);
+ }
+}
+
+void XMLCALL
+suspending_comment_handler(void *userData, const XML_Char *data) {
+ UNUSED_P(data);
+ XML_Parser parser = (XML_Parser)userData;
+ XML_StopParser(parser, XML_TRUE);
+}
+
+void XMLCALL
+element_decl_suspender(void *userData, const XML_Char *name,
+ XML_Content *model) {
+ UNUSED_P(userData);
+ UNUSED_P(name);
+ XML_StopParser(g_parser, XML_TRUE);
+ XML_FreeContentModel(g_parser, model);
+}
+
+void XMLCALL
+suspend_after_element_declaration(void *userData, const XML_Char *name,
+ XML_Content *model) {
+ UNUSED_P(name);
+ XML_Parser parser = (XML_Parser)userData;
+ assert_true(XML_StopParser(parser, /*resumable*/ XML_TRUE) == XML_STATUS_OK);
+ XML_FreeContentModel(parser, model);
+}
+
+void XMLCALL
+accumulate_pi_characters(void *userData, const XML_Char *target,
+ const XML_Char *data) {
+ CharData *storage = (CharData *)userData;
+
+ CharData_AppendXMLChars(storage, target, -1);
+ CharData_AppendXMLChars(storage, XCS(": "), 2);
+ CharData_AppendXMLChars(storage, data, -1);
+ CharData_AppendXMLChars(storage, XCS("\n"), 1);
+}
+
+void XMLCALL
+accumulate_comment(void *userData, const XML_Char *data) {
+ CharData *storage = (CharData *)userData;
+
+ CharData_AppendXMLChars(storage, data, -1);
+}
+
+void XMLCALL
+accumulate_entity_decl(void *userData, const XML_Char *entityName,
+ int is_parameter_entity, const XML_Char *value,
+ int value_length, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName) {
+ CharData *storage = (CharData *)userData;
+
+ UNUSED_P(is_parameter_entity);
+ UNUSED_P(base);
+ UNUSED_P(systemId);
+ UNUSED_P(publicId);
+ UNUSED_P(notationName);
+ CharData_AppendXMLChars(storage, entityName, -1);
+ CharData_AppendXMLChars(storage, XCS("="), 1);
+ if (value == NULL)
+ CharData_AppendXMLChars(storage, XCS("(null)"), -1);
+ else
+ CharData_AppendXMLChars(storage, value, value_length);
+ CharData_AppendXMLChars(storage, XCS("\n"), 1);
+}
+
+void XMLCALL
+accumulate_char_data_and_suspend(void *userData, const XML_Char *s, int len) {
+ ParserPlusStorage *const parserPlusStorage = (ParserPlusStorage *)userData;
+
+ CharData_AppendXMLChars(parserPlusStorage->storage, s, len);
+
+ for (int i = 0; i < len; i++) {
+ if (s[i] == 'Z') {
+ XML_StopParser(parserPlusStorage->parser, /*resumable=*/XML_TRUE);
+ break;
+ }
+ }
+}
+
+void XMLCALL
+accumulate_start_element(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ CharData *const storage = (CharData *)userData;
+ CharData_AppendXMLChars(storage, XCS("("), 1);
+ CharData_AppendXMLChars(storage, name, -1);
+
+ if ((atts != NULL) && (atts[0] != NULL)) {
+ CharData_AppendXMLChars(storage, XCS("("), 1);
+ while (atts[0] != NULL) {
+ CharData_AppendXMLChars(storage, atts[0], -1);
+ CharData_AppendXMLChars(storage, XCS("="), 1);
+ CharData_AppendXMLChars(storage, atts[1], -1);
+ atts += 2;
+ if (atts[0] != NULL) {
+ CharData_AppendXMLChars(storage, XCS(","), 1);
+ }
+ }
+ CharData_AppendXMLChars(storage, XCS(")"), 1);
+ }
+
+ CharData_AppendXMLChars(storage, XCS(")\n"), 2);
+}
+
+void XMLCALL
+accumulate_characters(void *userData, const XML_Char *s, int len) {
+ CharData *const storage = (CharData *)userData;
+ CharData_AppendXMLChars(storage, s, len);
+}
+
+void XMLCALL
+accumulate_attribute(void *userData, const XML_Char *name,
+ const XML_Char **atts) {
+ CharData *const storage = (CharData *)userData;
+ UNUSED_P(name);
+ /* Check there are attributes to deal with */
+ if (atts == NULL)
+ return;
+
+ while (storage->count < 0 && atts[0] != NULL) {
+ /* "accumulate" the value of the first attribute we see */
+ CharData_AppendXMLChars(storage, atts[1], -1);
+ atts += 2;
+ }
+}
+
+void XMLCALL
+ext_accumulate_characters(void *userData, const XML_Char *s, int len) {
+ ExtTest *const test_data = (ExtTest *)userData;
+ accumulate_characters(test_data->storage, s, len);
+}
+
+void XMLCALL
+checking_default_handler(void *userData, const XML_Char *s, int len) {
+ DefaultCheck *data = (DefaultCheck *)userData;
+ int i;
+
+ for (i = 0; data[i].expected != NULL; i++) {
+ if (data[i].expectedLen == len
+ && ! memcmp(data[i].expected, s, len * sizeof(XML_Char))) {
+ data[i].seen = XML_TRUE;
+ break;
+ }
+ }
+}
+
+void XMLCALL
+accumulate_and_suspend_comment_handler(void *userData, const XML_Char *data) {
+ ParserPlusStorage *const parserPlusStorage = (ParserPlusStorage *)userData;
+ accumulate_comment(parserPlusStorage->storage, data);
+ XML_StopParser(parserPlusStorage->parser, XML_TRUE);
+}
diff --git a/3rdparty/expat/tests/handlers.h b/3rdparty/expat/tests/handlers.h
new file mode 100644
index 00000000000..fa6267fbbd0
--- /dev/null
+++ b/3rdparty/expat/tests/handlers.h
@@ -0,0 +1,615 @@
+/* XML handler functions for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef XML_HANDLERS_H
+# define XML_HANDLERS_H
+
+# include "expat_config.h"
+
+# include "expat.h"
+
+/* Variable holding the expected handler userData */
+extern const void *g_handler_data;
+/* Count of the number of times the comment handler has been invoked */
+extern int g_comment_count;
+/* Count of the number of skipped entities */
+extern int g_skip_count;
+/* Count of the number of times the XML declaration handler is invoked */
+extern int g_xdecl_count;
+
+/* Start/End Element Handlers */
+
+extern void XMLCALL start_element_event_handler(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL end_element_event_handler(void *userData,
+ const XML_Char *name);
+
+# define STRUCT_START_TAG 0
+# define STRUCT_END_TAG 1
+
+extern void XMLCALL start_element_event_handler2(void *userData,
+ const XML_Char *name,
+ const XML_Char **attr);
+
+extern void XMLCALL end_element_event_handler2(void *userData,
+ const XML_Char *name);
+
+typedef struct attrInfo {
+ const XML_Char *name;
+ const XML_Char *value;
+} AttrInfo;
+
+typedef struct elementInfo {
+ const XML_Char *name;
+ int attr_count;
+ const XML_Char *id_name;
+ AttrInfo *attributes;
+} ElementInfo;
+
+typedef struct StructParserAndElementInfo {
+ XML_Parser parser;
+ ElementInfo *info;
+} ParserAndElementInfo;
+
+extern void XMLCALL counting_start_element_handler(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL suspending_end_handler(void *userData, const XML_Char *s);
+
+extern void XMLCALL start_element_suspender(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
+
+extern int g_triplet_start_flag;
+extern int g_triplet_end_flag;
+
+extern void XMLCALL triplet_start_checker(void *userData, const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL triplet_end_checker(void *userData, const XML_Char *name);
+
+extern void XMLCALL overwrite_start_checker(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL overwrite_end_checker(void *userData, const XML_Char *name);
+
+extern void XMLCALL start_element_fail(void *userData, const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL start_ns_clearing_start_element(void *userData,
+ const XML_Char *prefix,
+ const XML_Char *uri);
+
+typedef struct {
+ XML_Parser parser;
+ int deep;
+} DataIssue240;
+
+extern void XMLCALL start_element_issue_240(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL end_element_issue_240(void *userData, const XML_Char *name);
+
+/* Text encoding handlers */
+
+extern int XMLCALL UnknownEncodingHandler(void *data, const XML_Char *encoding,
+ XML_Encoding *info);
+
+extern int XMLCALL UnrecognisedEncodingHandler(void *data,
+ const XML_Char *encoding,
+ XML_Encoding *info);
+
+extern int XMLCALL unknown_released_encoding_handler(void *data,
+ const XML_Char *encoding,
+ XML_Encoding *info);
+
+extern int XMLCALL MiscEncodingHandler(void *data, const XML_Char *encoding,
+ XML_Encoding *info);
+
+extern int XMLCALL long_encoding_handler(void *userData,
+ const XML_Char *encoding,
+ XML_Encoding *info);
+
+/* External Entity Handlers */
+
+typedef struct ExtOption {
+ const XML_Char *system_id;
+ const char *parse_text;
+} ExtOption;
+
+extern int XMLCALL external_entity_optioner(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_loader(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+typedef struct ext_faults {
+ const char *parse_text;
+ const char *fail_text;
+ const XML_Char *encoding;
+ enum XML_Error error;
+} ExtFaults;
+
+extern int XMLCALL external_entity_faulter(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+extern int XMLCALL external_entity_failer__if_not_xml_ge(
+ XML_Parser parser, const XML_Char *context, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId);
+extern int XMLCALL external_entity_null_loader(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_resetter(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_suspender(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_suspend_xmldecl(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_suspending_faulter(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_cr_catcher(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_bad_cr_catcher(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_rsqb_catcher(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_good_cdata_ascii(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+/* Entity declaration handlers */
+
+extern void XMLCALL entity_suspending_decl_handler(void *userData,
+ const XML_Char *name,
+ XML_Content *model);
+
+extern void XMLCALL entity_suspending_xdecl_handler(void *userData,
+ const XML_Char *version,
+ const XML_Char *encoding,
+ int standalone);
+
+extern int XMLCALL external_entity_param_checker(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_ref_param_checker(XML_Parser parameter,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_param(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_load_ignore(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_load_ignore_utf16(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_load_ignore_utf16_be(
+ XML_Parser parser, const XML_Char *context, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId);
+
+extern int XMLCALL external_entity_valuer(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_not_standalone(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_value_aborter(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_public(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_devaluer(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+typedef struct ext_hdlr_data {
+ const char *parse_text;
+ XML_ExternalEntityRefHandler handler;
+ CharData *storage;
+} ExtHdlrData;
+
+extern int XMLCALL external_entity_oneshot_loader(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+typedef struct ExtTest2 {
+ const char *parse_text;
+ int parse_len;
+ const XML_Char *encoding;
+ CharData *storage;
+} ExtTest2;
+
+extern int XMLCALL external_entity_loader2(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+typedef struct ExtFaults2 {
+ const char *parse_text;
+ int parse_len;
+ const char *fail_text;
+ const XML_Char *encoding;
+ enum XML_Error error;
+} ExtFaults2;
+
+extern int XMLCALL external_entity_faulter2(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_unfinished_attlist(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_handler(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_duff_loader(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_dbl_handler(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_dbl_handler_2(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_alloc_set_encoding(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_reallocator(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_alloc(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+extern int XMLCALL external_entity_parser_create_alloc_fail_handler(
+ XML_Parser parser, const XML_Char *context, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId);
+
+struct AccountingTestCase {
+ const char *primaryText;
+ const char *firstExternalText; /* often NULL */
+ const char *secondExternalText; /* often NULL */
+ const unsigned long long expectedCountBytesIndirectExtra;
+};
+
+extern int accounting_external_entity_ref_handler(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+/* NotStandalone handlers */
+
+extern int XMLCALL reject_not_standalone_handler(void *userData);
+
+extern int XMLCALL accept_not_standalone_handler(void *userData);
+
+/* Attribute List handlers */
+
+typedef struct AttTest {
+ const char *definition;
+ const XML_Char *element_name;
+ const XML_Char *attr_name;
+ const XML_Char *attr_type;
+ const XML_Char *default_value;
+ int is_required;
+} AttTest;
+
+extern void XMLCALL verify_attlist_decl_handler(
+ void *userData, const XML_Char *element_name, const XML_Char *attr_name,
+ const XML_Char *attr_type, const XML_Char *default_value, int is_required);
+
+/* Character data handlers */
+
+extern void XMLCALL clearing_aborting_character_handler(void *userData,
+ const XML_Char *s,
+ int len);
+
+extern void XMLCALL parser_stop_character_handler(void *userData,
+ const XML_Char *s, int len);
+
+extern void XMLCALL cr_cdata_handler(void *userData, const XML_Char *s,
+ int len);
+
+extern void XMLCALL rsqb_handler(void *userData, const XML_Char *s, int len);
+
+typedef struct ByteTestData {
+ int start_element_len;
+ int cdata_len;
+ int total_string_len;
+} ByteTestData;
+
+extern void XMLCALL byte_character_handler(void *userData, const XML_Char *s,
+ int len);
+
+extern void XMLCALL ext2_accumulate_characters(void *userData,
+ const XML_Char *s, int len);
+
+/* Handlers that record their `len` arg and a single identifying character */
+
+struct handler_record_entry {
+ const char *name;
+ int arg;
+};
+struct handler_record_list {
+ int count;
+ struct handler_record_entry entries[50]; // arbitrary big-enough max count
+};
+
+extern void XMLCALL record_default_handler(void *userData, const XML_Char *s,
+ int len);
+
+extern void XMLCALL record_cdata_handler(void *userData, const XML_Char *s,
+ int len);
+
+extern void XMLCALL record_cdata_nodefault_handler(void *userData,
+ const XML_Char *s, int len);
+
+extern void XMLCALL record_skip_handler(void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity);
+
+extern void XMLCALL record_element_start_handler(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL record_element_end_handler(void *userData,
+ const XML_Char *name);
+
+extern const struct handler_record_entry *
+_handler_record_get(const struct handler_record_list *storage, int index,
+ const char *file, int line);
+
+# define handler_record_get(storage, index) \
+ _handler_record_get((storage), (index), __FILE__, __LINE__)
+
+# define assert_record_handler_called(storage, index, expected_name, \
+ expected_arg) \
+ do { \
+ const struct handler_record_entry *e \
+ = handler_record_get(storage, index); \
+ assert_true(strcmp(e->name, expected_name) == 0); \
+ assert_true(e->arg == (expected_arg)); \
+ } while (0)
+
+/* Entity Declaration Handlers */
+# define ENTITY_MATCH_FAIL (-1)
+# define ENTITY_MATCH_NOT_FOUND (0)
+# define ENTITY_MATCH_SUCCESS (1)
+
+extern void XMLCALL param_entity_match_handler(
+ void *userData, const XML_Char *entityName, int is_parameter_entity,
+ const XML_Char *value, int value_length, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName);
+
+extern void param_entity_match_init(const XML_Char *name,
+ const XML_Char *value);
+
+extern int get_param_entity_match_flag(void);
+
+/* Misc handlers */
+
+extern void XMLCALL xml_decl_handler(void *userData, const XML_Char *version,
+ const XML_Char *encoding, int standalone);
+
+extern void XMLCALL param_check_skip_handler(void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity);
+
+extern void XMLCALL data_check_comment_handler(void *userData,
+ const XML_Char *data);
+
+extern void XMLCALL selective_aborting_default_handler(void *userData,
+ const XML_Char *s,
+ int len);
+
+extern void XMLCALL suspending_comment_handler(void *userData,
+ const XML_Char *data);
+
+extern void XMLCALL element_decl_suspender(void *userData, const XML_Char *name,
+ XML_Content *model);
+
+extern void XMLCALL suspend_after_element_declaration(void *userData,
+ const XML_Char *name,
+ XML_Content *model);
+
+extern void XMLCALL accumulate_pi_characters(void *userData,
+ const XML_Char *target,
+ const XML_Char *data);
+
+extern void XMLCALL accumulate_comment(void *userData, const XML_Char *data);
+
+extern void XMLCALL accumulate_entity_decl(
+ void *userData, const XML_Char *entityName, int is_parameter_entity,
+ const XML_Char *value, int value_length, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName);
+
+extern void XMLCALL accumulate_char_data_and_suspend(void *userData,
+ const XML_Char *s,
+ int len);
+
+extern void XMLCALL accumulate_start_element(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL accumulate_characters(void *userData, const XML_Char *s,
+ int len);
+
+extern void XMLCALL accumulate_attribute(void *userData, const XML_Char *name,
+ const XML_Char **atts);
+
+extern void XMLCALL ext_accumulate_characters(void *userData, const XML_Char *s,
+ int len);
+
+typedef struct default_check {
+ const XML_Char *expected;
+ const int expectedLen;
+ XML_Bool seen;
+} DefaultCheck;
+
+void XMLCALL checking_default_handler(void *userData, const XML_Char *s,
+ int len);
+
+typedef struct {
+ XML_Parser parser;
+ CharData *storage;
+} ParserPlusStorage;
+
+extern void XMLCALL
+accumulate_and_suspend_comment_handler(void *userData, const XML_Char *data);
+
+#endif /* XML_HANDLERS_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/expat/tests/handlers_cxx.cpp b/3rdparty/expat/tests/handlers_cxx.cpp
new file mode 100644
index 00000000000..86c62b159cc
--- /dev/null
+++ b/3rdparty/expat/tests/handlers_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "handlers.c"
diff --git a/3rdparty/expat/tests/memcheck.c b/3rdparty/expat/tests/memcheck.c
index 41355f6c8d9..de925499721 100644
--- a/3rdparty/expat/tests/memcheck.c
+++ b/3rdparty/expat/tests/memcheck.c
@@ -6,8 +6,9 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -49,12 +50,13 @@ typedef struct allocation_entry {
static AllocationEntry *alloc_head = NULL;
static AllocationEntry *alloc_tail = NULL;
-static AllocationEntry *find_allocation(void *ptr);
+static AllocationEntry *find_allocation(const void *ptr);
/* Allocate some memory and keep track of it. */
void *
tracking_malloc(size_t size) {
- AllocationEntry *entry = malloc(sizeof(AllocationEntry));
+ AllocationEntry *const entry
+ = (AllocationEntry *)malloc(sizeof(AllocationEntry));
if (entry == NULL) {
printf("Allocator failure\n");
@@ -82,7 +84,7 @@ tracking_malloc(size_t size) {
}
static AllocationEntry *
-find_allocation(void *ptr) {
+find_allocation(const void *ptr) {
AllocationEntry *entry;
for (entry = alloc_head; entry != NULL; entry = entry->next) {
@@ -140,7 +142,7 @@ tracking_realloc(void *ptr, size_t size) {
entry = find_allocation(ptr);
if (entry == NULL) {
printf("Attempting to realloc unallocated memory at %p\n", ptr);
- entry = malloc(sizeof(AllocationEntry));
+ entry = (AllocationEntry *)malloc(sizeof(AllocationEntry));
if (entry == NULL) {
printf("Reallocator failure\n");
return NULL;
@@ -162,12 +164,11 @@ tracking_realloc(void *ptr, size_t size) {
alloc_tail = entry;
}
} else {
- entry->allocation = realloc(ptr, size);
- if (entry->allocation == NULL) {
- /* Realloc semantics say the original is still allocated */
- entry->allocation = ptr;
+ void *const reallocated = realloc(ptr, size);
+ if (reallocated == NULL) {
return NULL;
}
+ entry->allocation = reallocated;
}
entry->num_bytes = size;
diff --git a/3rdparty/expat/tests/memcheck.h b/3rdparty/expat/tests/memcheck.h
index 4d20f4bb972..4c0cb7281b9 100644
--- a/3rdparty/expat/tests/memcheck.h
+++ b/3rdparty/expat/tests/memcheck.h
@@ -7,8 +7,8 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/tests/memcheck_cxx.cpp b/3rdparty/expat/tests/memcheck_cxx.cpp
new file mode 100644
index 00000000000..e62ac98999c
--- /dev/null
+++ b/3rdparty/expat/tests/memcheck_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "memcheck.c"
diff --git a/3rdparty/expat/tests/minicheck.c b/3rdparty/expat/tests/minicheck.c
index a5a1efb159f..baccd76b441 100644
--- a/3rdparty/expat/tests/minicheck.c
+++ b/3rdparty/expat/tests/minicheck.c
@@ -10,8 +10,12 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2004-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -34,6 +38,11 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#if defined(NDEBUG)
+# undef NDEBUG /* because test suite relies on assert(...) at the moment */
+#endif
+
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
@@ -85,7 +94,8 @@ tcase_add_test(TCase *tc, tcase_test_function test) {
if (tc->allocated == tc->ntests) {
int nalloc = tc->allocated + 100;
size_t new_size = sizeof(tcase_test_function) * nalloc;
- tcase_test_function *new_tests = realloc(tc->tests, new_size);
+ tcase_test_function *const new_tests
+ = (tcase_test_function *)realloc(tc->tests, new_size);
assert(new_tests != NULL);
tc->tests = new_tests;
tc->allocated = nalloc;
@@ -120,7 +130,7 @@ suite_free(Suite *suite) {
SRunner *
srunner_create(Suite *suite) {
- SRunner *runner = calloc(1, sizeof(SRunner));
+ SRunner *const runner = (SRunner *)calloc(1, sizeof(SRunner));
if (runner != NULL) {
runner->suite = suite;
}
@@ -129,28 +139,57 @@ srunner_create(Suite *suite) {
static jmp_buf env;
+#define SUBTEST_LEN (50) // informative, but not too long
static char const *_check_current_function = NULL;
+static char _check_current_subtest[SUBTEST_LEN];
static int _check_current_lineno = -1;
static char const *_check_current_filename = NULL;
void
_check_set_test_info(char const *function, char const *filename, int lineno) {
_check_current_function = function;
+ set_subtest("%s", "");
_check_current_lineno = lineno;
_check_current_filename = filename;
}
+void
+set_subtest(char const *fmt, ...) {
+ va_list ap;
+ va_start(ap, fmt);
+ vsnprintf(_check_current_subtest, SUBTEST_LEN, fmt, ap);
+ va_end(ap);
+ // replace line feeds with spaces, for nicer error logs
+ for (size_t i = 0; i < SUBTEST_LEN; ++i) {
+ if (_check_current_subtest[i] == '\n') {
+ _check_current_subtest[i] = ' ';
+ }
+ }
+ _check_current_subtest[SUBTEST_LEN - 1] = '\0'; // ensure termination
+}
+
static void
-add_failure(SRunner *runner, int verbosity) {
- runner->nfailures++;
+handle_success(int verbosity) {
if (verbosity >= CK_VERBOSE) {
- printf("%s:%d: %s\n", _check_current_filename, _check_current_lineno,
- _check_current_function);
+ printf("PASS: %s\n", _check_current_function);
+ }
+}
+
+static void
+handle_failure(SRunner *runner, int verbosity, const char *context,
+ const char *phase_info) {
+ runner->nfailures++;
+ if (verbosity != CK_SILENT) {
+ if (strlen(_check_current_subtest) != 0) {
+ phase_info = _check_current_subtest;
+ }
+ printf("FAIL [%s]: %s (%s at %s:%d)\n", context, _check_current_function,
+ phase_info, _check_current_filename, _check_current_lineno);
}
}
void
-srunner_run_all(SRunner *runner, int verbosity) {
+srunner_run_all(SRunner *runner, const char *context, int verbosity) {
Suite *suite;
TCase *volatile tc;
assert(runner != NULL);
@@ -160,34 +199,42 @@ srunner_run_all(SRunner *runner, int verbosity) {
volatile int i;
for (i = 0; i < tc->ntests; ++i) {
runner->nchecks++;
+ set_subtest("%s", "");
if (tc->setup != NULL) {
/* setup */
if (setjmp(env)) {
- add_failure(runner, verbosity);
+ handle_failure(runner, verbosity, context, "during setup");
continue;
}
tc->setup();
}
/* test */
if (setjmp(env)) {
- add_failure(runner, verbosity);
+ handle_failure(runner, verbosity, context, "during actual test");
continue;
}
(tc->tests[i])();
+ set_subtest("%s", "");
/* teardown */
if (tc->teardown != NULL) {
if (setjmp(env)) {
- add_failure(runner, verbosity);
+ handle_failure(runner, verbosity, context, "during teardown");
continue;
}
tc->teardown();
}
+
+ handle_success(verbosity);
}
tc = tc->next_tcase;
}
- if (verbosity) {
+}
+
+void
+srunner_summarize(SRunner *runner, int verbosity) {
+ if (verbosity != CK_SILENT) {
int passed = runner->nchecks - runner->nfailures;
double percentage = ((double)passed) / runner->nchecks;
int display = (int)(percentage * 100);
@@ -197,14 +244,13 @@ srunner_run_all(SRunner *runner, int verbosity) {
}
void
-_fail_unless(int condition, const char *file, int line, const char *msg) {
+_fail(const char *file, int line, const char *msg) {
/* Always print the error message so it isn't lost. In this case,
we have a failure, so there's no reason to be quiet about what
it is.
*/
- UNUSED_P(condition);
- UNUSED_P(file);
- UNUSED_P(line);
+ _check_current_filename = file;
+ _check_current_lineno = line;
if (msg != NULL) {
const int has_newline = (msg[strlen(msg) - 1] == '\n');
fprintf(stderr, "ERROR: %s%s", msg, has_newline ? "" : "\n");
diff --git a/3rdparty/expat/tests/minicheck.h b/3rdparty/expat/tests/minicheck.h
index 88a16584fb5..29ae4cb2420 100644
--- a/3rdparty/expat/tests/minicheck.h
+++ b/3rdparty/expat/tests/minicheck.h
@@ -12,8 +12,11 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2004-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2006-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -40,30 +43,54 @@
extern "C" {
#endif
-#define CK_NOFORK 0
-#define CK_FORK 1
+#ifndef XML_MINICHECK_H
+# define XML_MINICHECK_H
-#define CK_SILENT 0
-#define CK_NORMAL 1
-#define CK_VERBOSE 2
+# define CK_NOFORK 0
+# define CK_FORK 1
+
+# define CK_SILENT 0
+# define CK_NORMAL 1
+# define CK_VERBOSE 2
/* Workaround for Microsoft's compiler and Tru64 Unix systems where the
C compiler has a working __func__, but the C++ compiler only has a
working __FUNCTION__. This could be fixed in configure.in, but it's
not worth it right now. */
-#if defined(_MSC_VER) || (defined(__osf__) && defined(__cplusplus))
-# define __func__ __FUNCTION__
-#endif
-
-#define START_TEST(testname) \
- static void testname(void) { \
- _check_set_test_info(__func__, __FILE__, __LINE__); \
- {
-#define END_TEST \
- } \
- }
-
-#define fail(msg) _fail_unless(0, __FILE__, __LINE__, msg)
+# if defined(_MSC_VER) || (defined(__osf__) && defined(__cplusplus))
+# define __func__ __FUNCTION__
+# endif
+
+/* PRINTF_LIKE has two effects:
+ 1. Make clang's -Wformat-nonliteral stop warning about non-literal format
+ strings in annotated functions' code.
+ 2. Make both clang and gcc's -Wformat-nonliteral warn about *callers* of
+ the annotated function that use a non-literal format string.
+*/
+# if defined(__GNUC__)
+# define PRINTF_LIKE(fmtpos, argspos) \
+ __attribute__((format(printf, fmtpos, argspos)))
+# else
+# define PRINTF_LIKE(fmtpos, argspos)
+# endif
+
+# define START_TEST(testname) \
+ static void testname(void) { \
+ _check_set_test_info(__func__, __FILE__, __LINE__); \
+ {
+# define END_TEST \
+ } \
+ }
+
+void PRINTF_LIKE(1, 2) set_subtest(char const *fmt, ...);
+
+# define fail(msg) _fail(__FILE__, __LINE__, msg)
+# define assert_true(cond) \
+ do { \
+ if (! (cond)) { \
+ _fail(__FILE__, __LINE__, "check failed: " #cond); \
+ } \
+ } while (0)
typedef void (*tcase_setup_function)(void);
typedef void (*tcase_teardown_function)(void);
@@ -102,18 +129,27 @@ void _check_set_test_info(char const *function, char const *filename,
* Prototypes for the actual implementation.
*/
-void _fail_unless(int condition, const char *file, int line, const char *msg);
+# if defined(__has_attribute)
+# if __has_attribute(noreturn)
+__attribute__((noreturn))
+# endif
+# endif
+void
+_fail(const char *file, int line, const char *msg);
Suite *suite_create(const char *name);
TCase *tcase_create(const char *name);
void suite_add_tcase(Suite *suite, TCase *tc);
-void tcase_add_checked_fixture(TCase *, tcase_setup_function,
- tcase_teardown_function);
+void tcase_add_checked_fixture(TCase *tc, tcase_setup_function setup,
+ tcase_teardown_function teardown);
void tcase_add_test(TCase *tc, tcase_test_function test);
SRunner *srunner_create(Suite *suite);
-void srunner_run_all(SRunner *runner, int verbosity);
+void srunner_run_all(SRunner *runner, const char *context, int verbosity);
+void srunner_summarize(SRunner *runner, int verbosity);
int srunner_ntests_failed(SRunner *runner);
void srunner_free(SRunner *runner);
+#endif /* XML_MINICHECK_H */
+
#ifdef __cplusplus
}
#endif
diff --git a/3rdparty/expat/tests/minicheck_cxx.cpp b/3rdparty/expat/tests/minicheck_cxx.cpp
new file mode 100644
index 00000000000..58881c60ba0
--- /dev/null
+++ b/3rdparty/expat/tests/minicheck_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "minicheck.c"
diff --git a/3rdparty/expat/tests/misc_tests.c b/3rdparty/expat/tests/misc_tests.c
new file mode 100644
index 00000000000..fb95014b142
--- /dev/null
+++ b/3rdparty/expat/tests/misc_tests.c
@@ -0,0 +1,709 @@
+/* Tests in the "miscellaneous" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#if defined(NDEBUG)
+# undef NDEBUG /* because test suite relies on assert(...) at the moment */
+#endif
+
+#include <assert.h>
+#include <string.h>
+
+#include "expat_config.h"
+
+#include "expat.h"
+#include "internal.h"
+#include "minicheck.h"
+#include "memcheck.h"
+#include "common.h"
+#include "ascii.h" /* for ASCII_xxx */
+#include "handlers.h"
+#include "misc_tests.h"
+
+void XMLCALL accumulate_characters_ext_handler(void *userData,
+ const XML_Char *s, int len);
+
+/* Test that a failure to allocate the parser structure fails gracefully */
+START_TEST(test_misc_alloc_create_parser) {
+ XML_Memory_Handling_Suite memsuite = {duff_allocator, realloc, free};
+ unsigned int i;
+ const unsigned int max_alloc_count = 10;
+
+ /* Something this simple shouldn't need more than 10 allocations */
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ g_parser = XML_ParserCreate_MM(NULL, &memsuite, NULL);
+ if (g_parser != NULL)
+ break;
+ }
+ if (i == 0)
+ fail("Parser unexpectedly ignored failing allocator");
+ else if (i == max_alloc_count)
+ fail("Parser not created with max allocation count");
+}
+END_TEST
+
+/* Test memory allocation failures for a parser with an encoding */
+START_TEST(test_misc_alloc_create_parser_with_encoding) {
+ XML_Memory_Handling_Suite memsuite = {duff_allocator, realloc, free};
+ unsigned int i;
+ const unsigned int max_alloc_count = 10;
+
+ /* Try several levels of allocation */
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ g_parser = XML_ParserCreate_MM(XCS("us-ascii"), &memsuite, NULL);
+ if (g_parser != NULL)
+ break;
+ }
+ if (i == 0)
+ fail("Parser ignored failing allocator");
+ else if (i == max_alloc_count)
+ fail("Parser not created with max allocation count");
+}
+END_TEST
+
+/* Test that freeing a NULL parser doesn't cause an explosion.
+ * (Not actually tested anywhere else)
+ */
+START_TEST(test_misc_null_parser) {
+ XML_ParserFree(NULL);
+}
+END_TEST
+
+#if defined(__has_feature)
+# if __has_feature(undefined_behavior_sanitizer)
+# define EXPAT_TESTS_UBSAN 1
+# else
+# define EXPAT_TESTS_UBSAN 0
+# endif
+#else
+# define EXPAT_TESTS_UBSAN 0
+#endif
+
+/* Test that XML_ErrorString rejects out-of-range codes */
+START_TEST(test_misc_error_string) {
+#if ! EXPAT_TESTS_UBSAN // because this would trigger UBSan
+ union {
+ enum XML_Error xml_error;
+ int integer;
+ } trickery;
+
+ assert_true(sizeof(enum XML_Error) == sizeof(int)); // self-test
+
+ trickery.integer = -1;
+ if (XML_ErrorString(trickery.xml_error) != NULL)
+ fail("Negative error code not rejected");
+
+ trickery.integer = 100;
+ if (XML_ErrorString(trickery.xml_error) != NULL)
+ fail("Large error code not rejected");
+#endif
+}
+END_TEST
+
+/* Test the version information is consistent */
+
+/* Since we are working in XML_LChars (potentially 16-bits), we
+ * can't use the standard C library functions for character
+ * manipulation and have to roll our own.
+ */
+static int
+parse_version(const XML_LChar *version_text,
+ XML_Expat_Version *version_struct) {
+ if (! version_text)
+ return XML_FALSE;
+
+ while (*version_text != 0x00) {
+ if (*version_text >= ASCII_0 && *version_text <= ASCII_9)
+ break;
+ version_text++;
+ }
+ if (*version_text == 0x00)
+ return XML_FALSE;
+
+ /* version_struct->major = strtoul(version_text, 10, &version_text) */
+ version_struct->major = 0;
+ while (*version_text >= ASCII_0 && *version_text <= ASCII_9) {
+ version_struct->major
+ = 10 * version_struct->major + (*version_text++ - ASCII_0);
+ }
+ if (*version_text++ != ASCII_PERIOD)
+ return XML_FALSE;
+
+ /* Now for the minor version number */
+ version_struct->minor = 0;
+ while (*version_text >= ASCII_0 && *version_text <= ASCII_9) {
+ version_struct->minor
+ = 10 * version_struct->minor + (*version_text++ - ASCII_0);
+ }
+ if (*version_text++ != ASCII_PERIOD)
+ return XML_FALSE;
+
+ /* Finally the micro version number */
+ version_struct->micro = 0;
+ while (*version_text >= ASCII_0 && *version_text <= ASCII_9) {
+ version_struct->micro
+ = 10 * version_struct->micro + (*version_text++ - ASCII_0);
+ }
+ if (*version_text != 0x00)
+ return XML_FALSE;
+ return XML_TRUE;
+}
+
+static int
+versions_equal(const XML_Expat_Version *first,
+ const XML_Expat_Version *second) {
+ return (first->major == second->major && first->minor == second->minor
+ && first->micro == second->micro);
+}
+
+START_TEST(test_misc_version) {
+ XML_Expat_Version read_version = XML_ExpatVersionInfo();
+ /* Silence compiler warning with the following assignment */
+ XML_Expat_Version parsed_version = {0, 0, 0};
+ const XML_LChar *version_text = XML_ExpatVersion();
+
+ if (version_text == NULL)
+ fail("Could not obtain version text");
+ assert(version_text != NULL);
+ if (! parse_version(version_text, &parsed_version))
+ fail("Unable to parse version text");
+ if (! versions_equal(&read_version, &parsed_version))
+ fail("Version mismatch");
+
+ if (xcstrcmp(version_text, XCS("expat_2.7.1"))) /* needs bump on releases */
+ fail("XML_*_VERSION in expat.h out of sync?\n");
+}
+END_TEST
+
+/* Test feature information */
+START_TEST(test_misc_features) {
+ const XML_Feature *features = XML_GetFeatureList();
+
+ /* Prevent problems with double-freeing parsers */
+ g_parser = NULL;
+ if (features == NULL) {
+ fail("Failed to get feature information");
+ } else {
+ /* Loop through the features checking what we can */
+ while (features->feature != XML_FEATURE_END) {
+ switch (features->feature) {
+ case XML_FEATURE_SIZEOF_XML_CHAR:
+ if (features->value != sizeof(XML_Char))
+ fail("Incorrect size of XML_Char");
+ break;
+ case XML_FEATURE_SIZEOF_XML_LCHAR:
+ if (features->value != sizeof(XML_LChar))
+ fail("Incorrect size of XML_LChar");
+ break;
+ default:
+ break;
+ }
+ features++;
+ }
+ }
+}
+END_TEST
+
+/* Regression test for GitHub Issue #17: memory leak parsing attribute
+ * values with mixed bound and unbound namespaces.
+ */
+START_TEST(test_misc_attribute_leak) {
+ const char *text = "<D xmlns:L=\"D\" l:a='' L:a=''/>";
+ XML_Memory_Handling_Suite memsuite
+ = {tracking_malloc, tracking_realloc, tracking_free};
+
+ g_parser = XML_ParserCreate_MM(XCS("UTF-8"), &memsuite, XCS("\n"));
+ expect_failure(text, XML_ERROR_UNBOUND_PREFIX, "Unbound prefixes not found");
+ XML_ParserFree(g_parser);
+ /* Prevent the teardown trying to double free */
+ g_parser = NULL;
+
+ if (! tracking_report())
+ fail("Memory leak found");
+}
+END_TEST
+
+/* Test parser created for UTF-16LE is successful */
+START_TEST(test_misc_utf16le) {
+ const char text[] =
+ /* <?xml version='1.0'?><q>Hi</q> */
+ "<\0?\0x\0m\0l\0 \0"
+ "v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0?\0>\0"
+ "<\0q\0>\0H\0i\0<\0/\0q\0>\0";
+ const XML_Char *expected = XCS("Hi");
+ CharData storage;
+
+ g_parser = XML_ParserCreate(XCS("UTF-16LE"));
+ if (g_parser == NULL)
+ fail("Parser not created");
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetCharacterDataHandler(g_parser, accumulate_characters);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_misc_stop_during_end_handler_issue_240_1) {
+ XML_Parser parser;
+ DataIssue240 *mydata;
+ enum XML_Status result;
+ const char *const doc1 = "<doc><e1/><e><foo/></e></doc>";
+
+ parser = XML_ParserCreate(NULL);
+ XML_SetElementHandler(parser, start_element_issue_240, end_element_issue_240);
+ mydata = (DataIssue240 *)malloc(sizeof(DataIssue240));
+ assert_true(mydata != NULL);
+ mydata->parser = parser;
+ mydata->deep = 0;
+ XML_SetUserData(parser, mydata);
+
+ result = _XML_Parse_SINGLE_BYTES(parser, doc1, (int)strlen(doc1), 1);
+ XML_ParserFree(parser);
+ free(mydata);
+ if (result != XML_STATUS_ERROR)
+ fail("Stopping the parser did not work as expected");
+}
+END_TEST
+
+START_TEST(test_misc_stop_during_end_handler_issue_240_2) {
+ XML_Parser parser;
+ DataIssue240 *mydata;
+ enum XML_Status result;
+ const char *const doc2 = "<doc><elem/></doc>";
+
+ parser = XML_ParserCreate(NULL);
+ XML_SetElementHandler(parser, start_element_issue_240, end_element_issue_240);
+ mydata = (DataIssue240 *)malloc(sizeof(DataIssue240));
+ assert_true(mydata != NULL);
+ mydata->parser = parser;
+ mydata->deep = 0;
+ XML_SetUserData(parser, mydata);
+
+ result = _XML_Parse_SINGLE_BYTES(parser, doc2, (int)strlen(doc2), 1);
+ XML_ParserFree(parser);
+ free(mydata);
+ if (result != XML_STATUS_ERROR)
+ fail("Stopping the parser did not work as expected");
+}
+END_TEST
+
+START_TEST(test_misc_deny_internal_entity_closing_doctype_issue_317) {
+ const char *const inputOne
+ = "<!DOCTYPE d [\n"
+ "<!ENTITY % element_d '<!ELEMENT d (#PCDATA)*>'>\n"
+ "%element_d;\n"
+ "<!ENTITY % e ']><d/>'>\n"
+ "\n"
+ "%e;";
+ const char *const inputTwo
+ = "<!DOCTYPE d [\n"
+ "<!ENTITY % element_d '<!ELEMENT d (#PCDATA)*>'>\n"
+ "%element_d;\n"
+ "<!ENTITY % e1 ']><d/>'><!ENTITY % e2 '&#37;e1;'>\n"
+ "\n"
+ "%e2;";
+ const char *const inputThree
+ = "<!DOCTYPE d [\n"
+ "<!ENTITY % element_d '<!ELEMENT d (#PCDATA)*>'>\n"
+ "%element_d;\n"
+ "<!ENTITY % e ']><d'>\n"
+ "\n"
+ "%e;/>";
+ const char *const inputIssue317
+ = "<!DOCTYPE doc [\n"
+ "<!ENTITY % element_doc '<!ELEMENT doc (#PCDATA)*>'>\n"
+ "%element_doc;\n"
+ "<!ENTITY % foo ']>\n"
+ "<doc>Hell<oc (#PCDATA)*>'>\n"
+ "%foo;\n"
+ "]>\n"
+ "<doc>Hello, world</dVc>";
+
+ const char *const inputs[] = {inputOne, inputTwo, inputThree, inputIssue317};
+ const XML_Bool suspendOrNot[] = {XML_FALSE, XML_TRUE};
+ size_t inputIndex = 0;
+
+ for (; inputIndex < sizeof(inputs) / sizeof(inputs[0]); inputIndex++) {
+ for (size_t suspendOrNotIndex = 0;
+ suspendOrNotIndex < sizeof(suspendOrNot) / sizeof(suspendOrNot[0]);
+ suspendOrNotIndex++) {
+ const char *const input = inputs[inputIndex];
+ const XML_Bool suspend = suspendOrNot[suspendOrNotIndex];
+ if (suspend && (g_chunkSize > 0)) {
+ // We cannot use _XML_Parse_SINGLE_BYTES below due to suspension, and
+ // so chunk sizes >0 would only repeat the very same test
+ // due to use of plain XML_Parse; we are saving upon that runtime:
+ return;
+ }
+
+ set_subtest("[input=%d suspend=%s] %s", (int)inputIndex,
+ suspend ? "true" : "false", input);
+ XML_Parser parser;
+ enum XML_Status parseResult;
+ int setParamEntityResult;
+ XML_Size lineNumber;
+ XML_Size columnNumber;
+
+ parser = XML_ParserCreate(NULL);
+ setParamEntityResult
+ = XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ if (setParamEntityResult != 1)
+ fail("Failed to set XML_PARAM_ENTITY_PARSING_ALWAYS.");
+
+ if (suspend) {
+ XML_SetUserData(parser, parser);
+ XML_SetElementDeclHandler(parser, suspend_after_element_declaration);
+ }
+
+ if (suspend) {
+ // can't use SINGLE_BYTES here, because it'll return early on
+ // suspension, and we won't know exactly how much input we actually
+ // managed to give Expat.
+ parseResult = XML_Parse(parser, input, (int)strlen(input), 0);
+
+ while (parseResult == XML_STATUS_SUSPENDED) {
+ parseResult = XML_ResumeParser(parser);
+ }
+
+ if (parseResult != XML_STATUS_ERROR) {
+ // can't use SINGLE_BYTES here, because it'll return early on
+ // suspension, and we won't know exactly how much input we actually
+ // managed to give Expat.
+ parseResult = XML_Parse(parser, "", 0, 1);
+ }
+
+ while (parseResult == XML_STATUS_SUSPENDED) {
+ parseResult = XML_ResumeParser(parser);
+ }
+ } else {
+ parseResult
+ = _XML_Parse_SINGLE_BYTES(parser, input, (int)strlen(input), 0);
+
+ if (parseResult != XML_STATUS_ERROR) {
+ parseResult = _XML_Parse_SINGLE_BYTES(parser, "", 0, 1);
+ }
+ }
+
+ if (parseResult != XML_STATUS_ERROR) {
+ fail("Parsing was expected to fail but succeeded.");
+ }
+
+ if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)
+ fail("Error code does not match XML_ERROR_INVALID_TOKEN");
+
+ lineNumber = XML_GetCurrentLineNumber(parser);
+ if (lineNumber != 6)
+ fail("XML_GetCurrentLineNumber does not work as expected.");
+
+ columnNumber = XML_GetCurrentColumnNumber(parser);
+ if (columnNumber != 0)
+ fail("XML_GetCurrentColumnNumber does not work as expected.");
+
+ XML_ParserFree(parser);
+ }
+ }
+}
+END_TEST
+
+START_TEST(test_misc_tag_mismatch_reset_leak) {
+#ifdef XML_NS
+ const char *const text = "<open xmlns='https://namespace1.test'></close>";
+ XML_Parser parser = XML_ParserCreateNS(NULL, XCS('\n'));
+
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Call to parse was expected to fail");
+ if (XML_GetErrorCode(parser) != XML_ERROR_TAG_MISMATCH)
+ fail("Call to parse was expected to fail from a closing tag mismatch");
+
+ XML_ParserReset(parser, NULL);
+
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Call to parse was expected to fail");
+ if (XML_GetErrorCode(parser) != XML_ERROR_TAG_MISMATCH)
+ fail("Call to parse was expected to fail from a closing tag mismatch");
+
+ XML_ParserFree(parser);
+#endif
+}
+END_TEST
+
+START_TEST(test_misc_create_external_entity_parser_with_null_context) {
+ // With XML_DTD undefined, the only supported case of external entities
+ // is pattern "<!ENTITY entity123 SYSTEM 'filename123'>". A NULL context
+ // was causing a segfault through a null pointer dereference in function
+ // setContext, previously.
+ XML_Parser parser = XML_ParserCreate(NULL);
+ XML_Parser ext_parser = XML_ExternalEntityParserCreate(parser, NULL, NULL);
+#ifdef XML_DTD
+ assert_true(ext_parser != NULL);
+ XML_ParserFree(ext_parser);
+#else
+ assert_true(ext_parser == NULL);
+#endif /* XML_DTD */
+ XML_ParserFree(parser);
+}
+END_TEST
+
+START_TEST(test_misc_general_entities_support) {
+ const char *const doc
+ = "<!DOCTYPE r [\n"
+ "<!ENTITY e1 'v1'>\n"
+ "<!ENTITY e2 SYSTEM 'v2'>\n"
+ "]>\n"
+ "<r a1='[&e1;]'>[&e1;][&e2;][&amp;&apos;&gt;&lt;&quot;]</r>";
+
+ CharData storage;
+ CharData_Init(&storage);
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ XML_SetUserData(parser, &storage);
+ XML_SetStartElementHandler(parser, accumulate_start_element);
+ XML_SetExternalEntityRefHandler(parser,
+ external_entity_failer__if_not_xml_ge);
+ XML_SetEntityDeclHandler(parser, accumulate_entity_decl);
+ XML_SetCharacterDataHandler(parser, accumulate_characters);
+
+ if (_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), XML_TRUE)
+ != XML_STATUS_OK) {
+ xml_failure(parser);
+ }
+
+ XML_ParserFree(parser);
+
+ CharData_CheckXMLChars(&storage,
+ /* clang-format off */
+#if XML_GE == 1
+ XCS("e1=v1\n")
+ XCS("e2=(null)\n")
+ XCS("(r(a1=[v1]))\n")
+ XCS("[v1][][&'><\"]")
+#else
+ XCS("e1=&amp;e1;\n")
+ XCS("e2=(null)\n")
+ XCS("(r(a1=[&e1;]))\n")
+ XCS("[&e1;][&e2;][&'><\"]")
+#endif
+ );
+ /* clang-format on */
+}
+END_TEST
+
+static void XMLCALL
+resumable_stopping_character_handler(void *userData, const XML_Char *s,
+ int len) {
+ UNUSED_P(s);
+ UNUSED_P(len);
+ XML_Parser parser = (XML_Parser)userData;
+ XML_StopParser(parser, XML_TRUE);
+}
+
+// NOTE: This test needs active LeakSanitizer to be of actual use
+START_TEST(test_misc_char_handler_stop_without_leak) {
+ const char *const data
+ = "<!DOCTYPE t1[<!ENTITY e1 'angle<'><!ENTITY e2 '&e1;'>]><t1>&e2;";
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+ XML_SetUserData(parser, parser);
+ XML_SetCharacterDataHandler(parser, resumable_stopping_character_handler);
+ _XML_Parse_SINGLE_BYTES(parser, data, (int)strlen(data), XML_FALSE);
+ XML_ParserFree(parser);
+}
+END_TEST
+
+START_TEST(test_misc_resumeparser_not_crashing) {
+ XML_Parser parser = XML_ParserCreate(NULL);
+ XML_GetBuffer(parser, 1);
+ XML_StopParser(parser, /*resumable=*/XML_TRUE);
+ XML_ResumeParser(parser); // could crash here, previously
+ XML_ParserFree(parser);
+}
+END_TEST
+
+START_TEST(test_misc_stopparser_rejects_unstarted_parser) {
+ const XML_Bool cases[] = {XML_TRUE, XML_FALSE};
+ for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
+ const XML_Bool resumable = cases[i];
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(XML_GetErrorCode(parser) == XML_ERROR_NONE);
+ assert_true(XML_StopParser(parser, resumable) == XML_STATUS_ERROR);
+ assert_true(XML_GetErrorCode(parser) == XML_ERROR_NOT_STARTED);
+ XML_ParserFree(parser);
+ }
+}
+END_TEST
+
+/* Adaptation of accumulate_characters that takes ExtHdlrData input to work with
+ * test_renter_loop_finite_content below */
+void XMLCALL
+accumulate_characters_ext_handler(void *userData, const XML_Char *s, int len) {
+ ExtHdlrData *const test_data = (ExtHdlrData *)userData;
+ CharData_AppendXMLChars(test_data->storage, s, len);
+}
+
+/* Test that internalEntityProcessor does not re-enter forever;
+ * based on files tests/xmlconf/xmltest/valid/ext-sa/012.{xml,ent} */
+START_TEST(test_renter_loop_finite_content) {
+ CharData storage;
+ CharData_Init(&storage);
+ const char *const text = "<!DOCTYPE doc [\n"
+ "<!ENTITY e1 '&e2;'>\n"
+ "<!ENTITY e2 '&e3;'>\n"
+ "<!ENTITY e3 SYSTEM '012.ent'>\n"
+ "<!ENTITY e4 '&e5;'>\n"
+ "<!ENTITY e5 '(e5)'>\n"
+ "<!ELEMENT doc (#PCDATA)>\n"
+ "]>\n"
+ "<doc>&e1;</doc>\n";
+ ExtHdlrData test_data = {"&e4;\n", external_entity_null_loader, &storage};
+ const XML_Char *const expected = XCS("(e5)\n");
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ assert_true(parser != NULL);
+ XML_SetUserData(parser, &test_data);
+ XML_SetExternalEntityRefHandler(parser, external_entity_oneshot_loader);
+ XML_SetCharacterDataHandler(parser, accumulate_characters_ext_handler);
+ if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(parser);
+
+ CharData_CheckXMLChars(&storage, expected);
+ XML_ParserFree(parser);
+}
+END_TEST
+
+// Inspired by function XML_OriginalString of Perl's XML::Parser
+static char *
+dup_original_string(XML_Parser parser) {
+ const int byte_count = XML_GetCurrentByteCount(parser);
+
+ assert_true(byte_count >= 0);
+
+ int offset = -1;
+ int size = -1;
+
+ const char *const context = XML_GetInputContext(parser, &offset, &size);
+
+#if XML_CONTEXT_BYTES > 0
+ assert_true(context != NULL);
+ assert_true(offset >= 0);
+ assert_true(size >= 0);
+ return portable_strndup(context + offset, byte_count);
+#else
+ assert_true(context == NULL);
+ return NULL;
+#endif
+}
+
+static void
+on_characters_issue_980(void *userData, const XML_Char *s, int len) {
+ (void)s;
+ (void)len;
+ XML_Parser parser = (XML_Parser)userData;
+
+ char *const original_string = dup_original_string(parser);
+
+#if XML_CONTEXT_BYTES > 0
+ assert_true(original_string != NULL);
+ assert_true(strcmp(original_string, "&draft.day;") == 0);
+ free(original_string);
+#else
+ assert_true(original_string == NULL);
+#endif
+}
+
+START_TEST(test_misc_expected_event_ptr_issue_980) {
+ // NOTE: This is a tiny subset of sample "REC-xml-19980210.xml"
+ // from Perl's XML::Parser
+ const char *const doc = "<!DOCTYPE day [\n"
+ " <!ENTITY draft.day '10'>\n"
+ "]>\n"
+ "<day>&draft.day;</day>\n";
+
+ XML_Parser parser = XML_ParserCreate(NULL);
+ XML_SetUserData(parser, parser);
+ XML_SetCharacterDataHandler(parser, on_characters_issue_980);
+
+ assert_true(_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc),
+ /*isFinal=*/XML_TRUE)
+ == XML_STATUS_OK);
+
+ XML_ParserFree(parser);
+}
+END_TEST
+
+void
+make_miscellaneous_test_case(Suite *s) {
+ TCase *tc_misc = tcase_create("miscellaneous tests");
+
+ suite_add_tcase(s, tc_misc);
+ tcase_add_checked_fixture(tc_misc, NULL, basic_teardown);
+
+ tcase_add_test(tc_misc, test_misc_alloc_create_parser);
+ tcase_add_test(tc_misc, test_misc_alloc_create_parser_with_encoding);
+ tcase_add_test(tc_misc, test_misc_null_parser);
+ tcase_add_test(tc_misc, test_misc_error_string);
+ tcase_add_test(tc_misc, test_misc_version);
+ tcase_add_test(tc_misc, test_misc_features);
+ tcase_add_test(tc_misc, test_misc_attribute_leak);
+ tcase_add_test(tc_misc, test_misc_utf16le);
+ tcase_add_test(tc_misc, test_misc_stop_during_end_handler_issue_240_1);
+ tcase_add_test(tc_misc, test_misc_stop_during_end_handler_issue_240_2);
+ tcase_add_test__ifdef_xml_dtd(
+ tc_misc, test_misc_deny_internal_entity_closing_doctype_issue_317);
+ tcase_add_test(tc_misc, test_misc_tag_mismatch_reset_leak);
+ tcase_add_test(tc_misc,
+ test_misc_create_external_entity_parser_with_null_context);
+ tcase_add_test(tc_misc, test_misc_general_entities_support);
+ tcase_add_test(tc_misc, test_misc_char_handler_stop_without_leak);
+ tcase_add_test(tc_misc, test_misc_resumeparser_not_crashing);
+ tcase_add_test(tc_misc, test_misc_stopparser_rejects_unstarted_parser);
+ tcase_add_test__if_xml_ge(tc_misc, test_renter_loop_finite_content);
+ tcase_add_test(tc_misc, test_misc_expected_event_ptr_issue_980);
+}
diff --git a/3rdparty/expat/tests/misc_tests.h b/3rdparty/expat/tests/misc_tests.h
new file mode 100644
index 00000000000..3d9c4b8a406
--- /dev/null
+++ b/3rdparty/expat/tests/misc_tests.h
@@ -0,0 +1,56 @@
+/* Tests in the "miscellaneous" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef XML_MISC_TESTS_H
+# define XML_MISC_TESTS_H
+
+extern void make_miscellaneous_test_case(Suite *s);
+
+#endif /* XML_MISC_TESTS_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/expat/tests/misc_tests_cxx.cpp b/3rdparty/expat/tests/misc_tests_cxx.cpp
new file mode 100644
index 00000000000..0b84c1b1f4d
--- /dev/null
+++ b/3rdparty/expat/tests/misc_tests_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "misc_tests.c"
diff --git a/3rdparty/expat/tests/ns_tests.c b/3rdparty/expat/tests/ns_tests.c
new file mode 100644
index 00000000000..411e1d3c974
--- /dev/null
+++ b/3rdparty/expat/tests/ns_tests.c
@@ -0,0 +1,754 @@
+/* Tests in the "namespace" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "expat_config.h"
+
+#include <string.h>
+
+#include "expat.h"
+#include "internal.h"
+#include "minicheck.h"
+#include "common.h"
+#include "dummy.h"
+#include "handlers.h"
+#include "ns_tests.h"
+
+static void
+namespace_setup(void) {
+ g_parser = XML_ParserCreateNS(NULL, XCS(' '));
+ if (g_parser == NULL)
+ fail("Parser not created.");
+}
+
+static void
+namespace_teardown(void) {
+ basic_teardown();
+}
+
+START_TEST(test_return_ns_triplet) {
+ const char *text = "<foo:e xmlns:foo='http://example.org/' bar:a='12'\n"
+ " xmlns:bar='http://example.org/'>";
+ const char *epilog = "</foo:e>";
+ const XML_Char *elemstr[]
+ = {XCS("http://example.org/ e foo"), XCS("http://example.org/ a bar")};
+ XML_SetReturnNSTriplet(g_parser, XML_TRUE);
+ XML_SetUserData(g_parser, (void *)elemstr);
+ XML_SetElementHandler(g_parser, triplet_start_checker, triplet_end_checker);
+ XML_SetNamespaceDeclHandler(g_parser, dummy_start_namespace_decl_handler,
+ dummy_end_namespace_decl_handler);
+ g_triplet_start_flag = XML_FALSE;
+ g_triplet_end_flag = XML_FALSE;
+ init_dummy_handlers();
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ /* Check that unsetting "return triplets" fails while still parsing */
+ XML_SetReturnNSTriplet(g_parser, XML_FALSE);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, epilog, (int)strlen(epilog), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (! g_triplet_start_flag)
+ fail("triplet_start_checker not invoked");
+ if (! g_triplet_end_flag)
+ fail("triplet_end_checker not invoked");
+ if (get_dummy_handler_flags()
+ != (DUMMY_START_NS_DECL_HANDLER_FLAG | DUMMY_END_NS_DECL_HANDLER_FLAG))
+ fail("Namespace handlers not called");
+}
+END_TEST
+
+/* Test that the parsing status is correctly reset by XML_ParserReset().
+ * We use test_return_ns_triplet() for our example parse to improve
+ * coverage of tidying up code executed.
+ */
+START_TEST(test_ns_parser_reset) {
+ XML_ParsingStatus status;
+
+ XML_GetParsingStatus(g_parser, &status);
+ if (status.parsing != XML_INITIALIZED)
+ fail("parsing status doesn't start INITIALIZED");
+ test_return_ns_triplet();
+ XML_GetParsingStatus(g_parser, &status);
+ if (status.parsing != XML_FINISHED)
+ fail("parsing status doesn't end FINISHED");
+ XML_ParserReset(g_parser, NULL);
+ XML_GetParsingStatus(g_parser, &status);
+ if (status.parsing != XML_INITIALIZED)
+ fail("parsing status doesn't reset to INITIALIZED");
+}
+END_TEST
+
+static void
+run_ns_tagname_overwrite_test(const char *text, const XML_Char *result) {
+ CharData storage;
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetElementHandler(g_parser, overwrite_start_checker,
+ overwrite_end_checker);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, result);
+}
+
+/* Regression test for SF bug #566334. */
+START_TEST(test_ns_tagname_overwrite) {
+ const char *text = "<n:e xmlns:n='http://example.org/'>\n"
+ " <n:f n:attr='foo'/>\n"
+ " <n:g n:attr2='bar'/>\n"
+ "</n:e>";
+ const XML_Char *result = XCS("start http://example.org/ e\n")
+ XCS("start http://example.org/ f\n")
+ XCS("attribute http://example.org/ attr\n")
+ XCS("end http://example.org/ f\n")
+ XCS("start http://example.org/ g\n")
+ XCS("attribute http://example.org/ attr2\n")
+ XCS("end http://example.org/ g\n")
+ XCS("end http://example.org/ e\n");
+ run_ns_tagname_overwrite_test(text, result);
+}
+END_TEST
+
+/* Regression test for SF bug #566334. */
+START_TEST(test_ns_tagname_overwrite_triplet) {
+ const char *text = "<n:e xmlns:n='http://example.org/'>\n"
+ " <n:f n:attr='foo'/>\n"
+ " <n:g n:attr2='bar'/>\n"
+ "</n:e>";
+ const XML_Char *result = XCS("start http://example.org/ e n\n")
+ XCS("start http://example.org/ f n\n")
+ XCS("attribute http://example.org/ attr n\n")
+ XCS("end http://example.org/ f n\n")
+ XCS("start http://example.org/ g n\n")
+ XCS("attribute http://example.org/ attr2 n\n")
+ XCS("end http://example.org/ g n\n")
+ XCS("end http://example.org/ e n\n");
+ XML_SetReturnNSTriplet(g_parser, XML_TRUE);
+ run_ns_tagname_overwrite_test(text, result);
+}
+END_TEST
+
+/* Regression test for SF bug #620343. */
+START_TEST(test_start_ns_clears_start_element) {
+ /* This needs to use separate start/end tags; using the empty tag
+ syntax doesn't cause the problematic path through Expat to be
+ taken.
+ */
+ const char *text = "<e xmlns='http://example.org/'></e>";
+
+ XML_SetStartElementHandler(g_parser, start_element_fail);
+ XML_SetStartNamespaceDeclHandler(g_parser, start_ns_clearing_start_element);
+ XML_SetEndNamespaceDeclHandler(g_parser, dummy_end_namespace_decl_handler);
+ XML_UseParserAsHandlerArg(g_parser);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Regression test for SF bug #616863. */
+START_TEST(test_default_ns_from_ext_subset_and_ext_ge) {
+ const char *text = "<?xml version='1.0'?>\n"
+ "<!DOCTYPE doc SYSTEM 'http://example.org/doc.dtd' [\n"
+ " <!ENTITY en SYSTEM 'http://example.org/entity.ent'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/ns1'>\n"
+ "&en;\n"
+ "</doc>";
+
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_handler);
+ /* We actually need to set this handler to tickle this bug. */
+ XML_SetStartElementHandler(g_parser, dummy_start_element);
+ XML_SetUserData(g_parser, NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Regression test #1 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_1) {
+ const char *text = "<doc xmlns:prefix='http://example.org/'>\n"
+ " <e xmlns:prefix=''/>\n"
+ "</doc>";
+
+ expect_failure(text, XML_ERROR_UNDECLARING_PREFIX,
+ "Did not report re-setting namespace"
+ " URI with prefix to ''.");
+}
+END_TEST
+
+/* Regression test #2 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_2) {
+ const char *text = "<?xml version='1.0'?>\n"
+ "<docelem xmlns:pre=''/>";
+
+ expect_failure(text, XML_ERROR_UNDECLARING_PREFIX,
+ "Did not report setting namespace URI with prefix to ''.");
+}
+END_TEST
+
+/* Regression test #3 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_3) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ELEMENT doc EMPTY>\n"
+ " <!ATTLIST doc\n"
+ " xmlns:prefix CDATA ''>\n"
+ "]>\n"
+ "<doc/>";
+
+ expect_failure(text, XML_ERROR_UNDECLARING_PREFIX,
+ "Didn't report attr default setting NS w/ prefix to ''.");
+}
+END_TEST
+
+/* Regression test #4 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_4) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ELEMENT prefix:doc EMPTY>\n"
+ " <!ATTLIST prefix:doc\n"
+ " xmlns:prefix CDATA 'http://example.org/'>\n"
+ "]>\n"
+ "<prefix:doc/>";
+ /* Packaged info expected by the end element handler;
+ the weird structuring lets us reuse the triplet_end_checker()
+ function also used for another test. */
+ const XML_Char *elemstr[] = {XCS("http://example.org/ doc prefix")};
+ XML_SetReturnNSTriplet(g_parser, XML_TRUE);
+ XML_SetUserData(g_parser, (void *)elemstr);
+ XML_SetEndElementHandler(g_parser, triplet_end_checker);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test with non-xmlns prefix */
+START_TEST(test_ns_unbound_prefix) {
+ const char *text = "<!DOCTYPE doc [\n"
+ " <!ELEMENT prefix:doc EMPTY>\n"
+ " <!ATTLIST prefix:doc\n"
+ " notxmlns:prefix CDATA 'http://example.org/'>\n"
+ "]>\n"
+ "<prefix:doc/>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Unbound prefix incorrectly passed");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_UNBOUND_PREFIX)
+ xml_failure(g_parser);
+}
+END_TEST
+
+START_TEST(test_ns_default_with_empty_uri) {
+ const char *text = "<doc xmlns='http://example.org/'>\n"
+ " <e xmlns=''/>\n"
+ "</doc>";
+ /* Add some handlers to exercise extra code paths */
+ XML_SetStartNamespaceDeclHandler(g_parser,
+ dummy_start_namespace_decl_handler);
+ XML_SetEndNamespaceDeclHandler(g_parser, dummy_end_namespace_decl_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Regression test for SF bug #692964: two prefixes for one namespace. */
+START_TEST(test_ns_duplicate_attrs_diff_prefixes) {
+ const char *text = "<doc xmlns:a='http://example.org/a'\n"
+ " xmlns:b='http://example.org/a'\n"
+ " a:a='v' b:a='v' />";
+ expect_failure(text, XML_ERROR_DUPLICATE_ATTRIBUTE,
+ "did not report multiple attributes with same URI+name");
+}
+END_TEST
+
+START_TEST(test_ns_duplicate_hashes) {
+ /* The hash of an attribute is calculated as the hash of its URI
+ * concatenated with a space followed by its name (after the
+ * colon). We wish to generate attributes with the same hash
+ * value modulo the attribute table size so that we can check that
+ * the attribute hash table works correctly. The attribute hash
+ * table size will be the smallest power of two greater than the
+ * number of attributes, but at least eight. There is
+ * unfortunately no programmatic way of getting the hash or the
+ * table size at user level, but the test code coverage percentage
+ * will drop if the hashes cease to point to the same row.
+ *
+ * The cunning plan is to have few enough attributes to have a
+ * reliable table size of 8, and have the single letter attribute
+ * names be 8 characters apart, producing a hash which will be the
+ * same modulo 8.
+ */
+ const char *text = "<doc xmlns:a='http://example.org/a'\n"
+ " a:a='v' a:i='w' />";
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Regression test for SF bug #695401: unbound prefix. */
+START_TEST(test_ns_unbound_prefix_on_attribute) {
+ const char *text = "<doc a:attr=''/>";
+ expect_failure(text, XML_ERROR_UNBOUND_PREFIX,
+ "did not report unbound prefix on attribute");
+}
+END_TEST
+
+/* Regression test for SF bug #695401: unbound prefix. */
+START_TEST(test_ns_unbound_prefix_on_element) {
+ const char *text = "<a:doc/>";
+ expect_failure(text, XML_ERROR_UNBOUND_PREFIX,
+ "did not report unbound prefix on element");
+}
+END_TEST
+
+/* Test that long element names with namespaces are handled correctly */
+START_TEST(test_ns_long_element) {
+ const char *text
+ = "<foo:thisisalongenoughelementnametotriggerareallocation\n"
+ " xmlns:foo='http://example.org/' bar:a='12'\n"
+ " xmlns:bar='http://example.org/'>"
+ "</foo:thisisalongenoughelementnametotriggerareallocation>";
+ const XML_Char *elemstr[]
+ = {XCS("http://example.org/")
+ XCS(" thisisalongenoughelementnametotriggerareallocation foo"),
+ XCS("http://example.org/ a bar")};
+
+ XML_SetReturnNSTriplet(g_parser, XML_TRUE);
+ XML_SetUserData(g_parser, (void *)elemstr);
+ XML_SetElementHandler(g_parser, triplet_start_checker, triplet_end_checker);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test mixed population of prefixed and unprefixed attributes */
+START_TEST(test_ns_mixed_prefix_atts) {
+ const char *text = "<e a='12' bar:b='13'\n"
+ " xmlns:bar='http://example.org/'>"
+ "</e>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test having a long namespaced element name inside a short one.
+ * This exercises some internal buffer reallocation that is shared
+ * across elements with the same namespace URI.
+ */
+START_TEST(test_ns_extend_uri_buffer) {
+ const char *text = "<foo:e xmlns:foo='http://example.org/'>"
+ " <foo:thisisalongenoughnametotriggerallocationaction"
+ " foo:a='12' />"
+ "</foo:e>";
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test that xmlns is correctly rejected as an attribute in the xmlns
+ * namespace, but not in other namespaces
+ */
+START_TEST(test_ns_reserved_attributes) {
+ const char *text1
+ = "<foo:e xmlns:foo='http://example.org/' xmlns:xmlns='12' />";
+ const char *text2
+ = "<foo:e xmlns:foo='http://example.org/' foo:xmlns='12' />";
+ expect_failure(text1, XML_ERROR_RESERVED_PREFIX_XMLNS,
+ "xmlns not rejected as an attribute");
+ XML_ParserReset(g_parser, NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test more reserved attributes */
+START_TEST(test_ns_reserved_attributes_2) {
+ const char *text1 = "<foo:e xmlns:foo='http://example.org/'"
+ " xmlns:xml='http://example.org/' />";
+ const char *text2
+ = "<foo:e xmlns:foo='http://www.w3.org/XML/1998/namespace' />";
+ const char *text3 = "<foo:e xmlns:foo='http://www.w3.org/2000/xmlns/' />";
+
+ expect_failure(text1, XML_ERROR_RESERVED_PREFIX_XML,
+ "xml not rejected as an attribute");
+ XML_ParserReset(g_parser, NULL);
+ expect_failure(text2, XML_ERROR_RESERVED_NAMESPACE_URI,
+ "Use of w3.org URL not faulted");
+ XML_ParserReset(g_parser, NULL);
+ expect_failure(text3, XML_ERROR_RESERVED_NAMESPACE_URI,
+ "Use of w3.org xmlns URL not faulted");
+}
+END_TEST
+
+/* Test string pool handling of namespace names of 2048 characters */
+/* Exercises a particular string pool growth path */
+START_TEST(test_ns_extremely_long_prefix) {
+ /* C99 compilers are only required to support 4095-character
+ * strings, so the following needs to be split in two to be safe
+ * for all compilers.
+ */
+ const char *text1
+ = "<doc "
+ /* 64 character on each line */
+ /* ...gives a total length of 2048 */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ ":a='12'";
+ const char *text2
+ = " xmlns:"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "='foo'\n>"
+ "</doc>";
+
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+}
+END_TEST
+
+/* Test unknown encoding handlers in namespace setup */
+START_TEST(test_ns_unknown_encoding_success) {
+ const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
+ "<foo:e xmlns:foo='http://example.org/'>Hi</foo:e>";
+
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ run_character_check(text, XCS("Hi"));
+}
+END_TEST
+
+/* Test that too many colons are rejected */
+START_TEST(test_ns_double_colon) {
+ const char *text = "<foo:e xmlns:foo='http://example.org/' foo:a:b='bar' />";
+ const enum XML_Status status
+ = _XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE);
+#ifdef XML_NS
+ if ((status == XML_STATUS_OK)
+ || (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)) {
+ fail("Double colon in attribute name not faulted"
+ " (despite active namespace support)");
+ }
+#else
+ if (status != XML_STATUS_OK) {
+ fail("Double colon in attribute name faulted"
+ " (despite inactive namespace support");
+ }
+#endif
+}
+END_TEST
+
+START_TEST(test_ns_double_colon_element) {
+ const char *text = "<foo:bar:e xmlns:foo='http://example.org/' />";
+ const enum XML_Status status
+ = _XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE);
+#ifdef XML_NS
+ if ((status == XML_STATUS_OK)
+ || (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)) {
+ fail("Double colon in element name not faulted"
+ " (despite active namespace support)");
+ }
+#else
+ if (status != XML_STATUS_OK) {
+ fail("Double colon in element name faulted"
+ " (despite inactive namespace support");
+ }
+#endif
+}
+END_TEST
+
+/* Test that non-name characters after a colon are rejected */
+START_TEST(test_ns_bad_attr_leafname) {
+ const char *text = "<foo:e xmlns:foo='http://example.org/' foo:?ar='baz' />";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Invalid character in leafname not faulted");
+}
+END_TEST
+
+START_TEST(test_ns_bad_element_leafname) {
+ const char *text = "<foo:?oc xmlns:foo='http://example.org/' />";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Invalid character in element leafname not faulted");
+}
+END_TEST
+
+/* Test high-byte-set UTF-16 characters are valid in a leafname */
+START_TEST(test_ns_utf16_leafname) {
+ const char text[] =
+ /* <n:e xmlns:n='URI' n:{KHO KHWAI}='a' />
+ * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
+ */
+ "<\0n\0:\0e\0 \0x\0m\0l\0n\0s\0:\0n\0=\0'\0U\0R\0I\0'\0 \0"
+ "n\0:\0\x04\x0e=\0'\0a\0'\0 \0/\0>\0";
+ const XML_Char *expected = XCS("a");
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetStartElementHandler(g_parser, accumulate_attribute);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_ns_utf16_element_leafname) {
+ const char text[] =
+ /* <n:{KHO KHWAI} xmlns:n='URI'/>
+ * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
+ */
+ "\0<\0n\0:\x0e\x04\0 \0x\0m\0l\0n\0s\0:\0n\0=\0'\0U\0R\0I\0'\0/\0>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("URI \x0e04");
+#else
+ const XML_Char *expected = XCS("URI \xe0\xb8\x84");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetStartElementHandler(g_parser, start_element_event_handler);
+ XML_SetUserData(g_parser, &storage);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_ns_utf16_doctype) {
+ const char text[] =
+ /* <!DOCTYPE foo:{KHO KHWAI} [ <!ENTITY bar 'baz'> ]>\n
+ * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
+ */
+ "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0f\0o\0o\0:\x0e\x04\0 "
+ "\0[\0 \0<\0!\0E\0N\0T\0I\0T\0Y\0 \0b\0a\0r\0 \0'\0b\0a\0z\0'\0>\0 "
+ "\0]\0>\0\n"
+ /* <foo:{KHO KHWAI} xmlns:foo='URI'>&bar;</foo:{KHO KHWAI}> */
+ "\0<\0f\0o\0o\0:\x0e\x04\0 "
+ "\0x\0m\0l\0n\0s\0:\0f\0o\0o\0=\0'\0U\0R\0I\0'\0>"
+ "\0&\0b\0a\0r\0;"
+ "\0<\0/\0f\0o\0o\0:\x0e\x04\0>";
+#ifdef XML_UNICODE
+ const XML_Char *expected = XCS("URI \x0e04");
+#else
+ const XML_Char *expected = XCS("URI \xe0\xb8\x84");
+#endif
+ CharData storage;
+
+ CharData_Init(&storage);
+ XML_SetUserData(g_parser, &storage);
+ XML_SetStartElementHandler(g_parser, start_element_event_handler);
+ XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+ CharData_CheckXMLChars(&storage, expected);
+}
+END_TEST
+
+START_TEST(test_ns_invalid_doctype) {
+ const char *text = "<!DOCTYPE foo:!bad [ <!ENTITY bar 'baz' ]>\n"
+ "<foo:!bad>&bar;</foo:!bad>";
+
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
+ "Invalid character in document local name not faulted");
+}
+END_TEST
+
+START_TEST(test_ns_double_colon_doctype) {
+ const char *text = "<!DOCTYPE foo:a:doc [ <!ENTITY bar 'baz' ]>\n"
+ "<foo:a:doc>&bar;</foo:a:doc>";
+
+ expect_failure(text, XML_ERROR_SYNTAX,
+ "Double colon in document name not faulted");
+}
+END_TEST
+
+START_TEST(test_ns_separator_in_uri) {
+ struct test_case {
+ enum XML_Status expectedStatus;
+ const char *doc;
+ XML_Char namesep;
+ };
+ struct test_case cases[] = {
+ {XML_STATUS_OK, "<doc xmlns='one_two' />", XCS('\n')},
+ {XML_STATUS_ERROR, "<doc xmlns='one&#x0A;two' />", XCS('\n')},
+ {XML_STATUS_OK, "<doc xmlns='one:two' />", XCS(':')},
+ };
+
+ size_t i = 0;
+ size_t failCount = 0;
+ for (; i < sizeof(cases) / sizeof(cases[0]); i++) {
+ set_subtest("%s", cases[i].doc);
+ XML_Parser parser = XML_ParserCreateNS(NULL, cases[i].namesep);
+ XML_SetElementHandler(parser, dummy_start_element, dummy_end_element);
+ if (_XML_Parse_SINGLE_BYTES(parser, cases[i].doc, (int)strlen(cases[i].doc),
+ /*isFinal*/ XML_TRUE)
+ != cases[i].expectedStatus) {
+ failCount++;
+ }
+ XML_ParserFree(parser);
+ }
+
+ if (failCount) {
+ fail("Namespace separator handling is broken");
+ }
+}
+END_TEST
+
+void
+make_namespace_test_case(Suite *s) {
+ TCase *tc_namespace = tcase_create("XML namespaces");
+
+ suite_add_tcase(s, tc_namespace);
+ tcase_add_checked_fixture(tc_namespace, namespace_setup, namespace_teardown);
+ tcase_add_test(tc_namespace, test_return_ns_triplet);
+ tcase_add_test(tc_namespace, test_ns_parser_reset);
+ tcase_add_test(tc_namespace, test_ns_tagname_overwrite);
+ tcase_add_test(tc_namespace, test_ns_tagname_overwrite_triplet);
+ tcase_add_test(tc_namespace, test_start_ns_clears_start_element);
+ tcase_add_test__ifdef_xml_dtd(tc_namespace,
+ test_default_ns_from_ext_subset_and_ext_ge);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_1);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_2);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_3);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_4);
+ tcase_add_test(tc_namespace, test_ns_unbound_prefix);
+ tcase_add_test(tc_namespace, test_ns_default_with_empty_uri);
+ tcase_add_test(tc_namespace, test_ns_duplicate_attrs_diff_prefixes);
+ tcase_add_test(tc_namespace, test_ns_duplicate_hashes);
+ tcase_add_test(tc_namespace, test_ns_unbound_prefix_on_attribute);
+ tcase_add_test(tc_namespace, test_ns_unbound_prefix_on_element);
+ tcase_add_test(tc_namespace, test_ns_long_element);
+ tcase_add_test(tc_namespace, test_ns_mixed_prefix_atts);
+ tcase_add_test(tc_namespace, test_ns_extend_uri_buffer);
+ tcase_add_test(tc_namespace, test_ns_reserved_attributes);
+ tcase_add_test(tc_namespace, test_ns_reserved_attributes_2);
+ tcase_add_test(tc_namespace, test_ns_extremely_long_prefix);
+ tcase_add_test(tc_namespace, test_ns_unknown_encoding_success);
+ tcase_add_test(tc_namespace, test_ns_double_colon);
+ tcase_add_test(tc_namespace, test_ns_double_colon_element);
+ tcase_add_test(tc_namespace, test_ns_bad_attr_leafname);
+ tcase_add_test(tc_namespace, test_ns_bad_element_leafname);
+ tcase_add_test(tc_namespace, test_ns_utf16_leafname);
+ tcase_add_test(tc_namespace, test_ns_utf16_element_leafname);
+ tcase_add_test__if_xml_ge(tc_namespace, test_ns_utf16_doctype);
+ tcase_add_test(tc_namespace, test_ns_invalid_doctype);
+ tcase_add_test(tc_namespace, test_ns_double_colon_doctype);
+ tcase_add_test(tc_namespace, test_ns_separator_in_uri);
+}
diff --git a/3rdparty/expat/tests/ns_tests.h b/3rdparty/expat/tests/ns_tests.h
new file mode 100644
index 00000000000..acb0db786a4
--- /dev/null
+++ b/3rdparty/expat/tests/ns_tests.h
@@ -0,0 +1,56 @@
+/* Tests in the "namespace" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef XML_NS_TESTS_H
+# define XML_NS_TESTS_H
+
+extern void make_namespace_test_case(Suite *s);
+
+#endif /* XML_NS_TESTS_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/expat/tests/ns_tests_cxx.cpp b/3rdparty/expat/tests/ns_tests_cxx.cpp
new file mode 100644
index 00000000000..b2fe187bb8b
--- /dev/null
+++ b/3rdparty/expat/tests/ns_tests_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "ns_tests.c"
diff --git a/3rdparty/expat/tests/nsalloc_tests.c b/3rdparty/expat/tests/nsalloc_tests.c
new file mode 100644
index 00000000000..ec88586af1d
--- /dev/null
+++ b/3rdparty/expat/tests/nsalloc_tests.c
@@ -0,0 +1,1537 @@
+/* Tests in the "namespace allocation" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#if defined(NDEBUG)
+# undef NDEBUG /* because test suite relies on assert(...) at the moment */
+#endif
+
+#include <string.h>
+#include <assert.h>
+
+#include "expat.h"
+#include "common.h"
+#include "minicheck.h"
+#include "dummy.h"
+#include "handlers.h"
+#include "nsalloc_tests.h"
+
+static void
+nsalloc_setup(void) {
+ XML_Memory_Handling_Suite memsuite = {duff_allocator, duff_reallocator, free};
+ XML_Char ns_sep[2] = {' ', '\0'};
+
+ /* Ensure the parser creation will go through */
+ g_allocation_count = ALLOC_ALWAYS_SUCCEED;
+ g_reallocation_count = REALLOC_ALWAYS_SUCCEED;
+ g_parser = XML_ParserCreate_MM(NULL, &memsuite, ns_sep);
+ if (g_parser == NULL)
+ fail("Parser not created");
+}
+
+static void
+nsalloc_teardown(void) {
+ basic_teardown();
+}
+
+/* Test the effects of allocation failure in simple namespace parsing.
+ * Based on test_ns_default_with_empty_uri()
+ */
+START_TEST(test_nsalloc_xmlns) {
+ const char *text = "<doc xmlns='http://example.org/'>\n"
+ " <e xmlns=''/>\n"
+ "</doc>";
+ unsigned int i;
+ const unsigned int max_alloc_count = 30;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ /* Exercise more code paths with a default handler */
+ XML_SetDefaultHandler(g_parser, dummy_default_handler);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* Resetting the parser is insufficient, because some memory
+ * allocations are cached within the parser. Instead we use
+ * the teardown and setup routines to ensure that we have the
+ * right sort of parser back in our hands.
+ */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at maximum allocation count");
+}
+END_TEST
+
+/* Test XML_ParseBuffer interface with namespace and a dicky allocator */
+START_TEST(test_nsalloc_parse_buffer) {
+ const char *text = "<doc>Hello</doc>";
+ void *buffer;
+
+ /* Try a parse before the start of the world */
+ /* (Exercises new code path) */
+ if (XML_ParseBuffer(g_parser, 0, XML_FALSE) != XML_STATUS_ERROR)
+ fail("Pre-init XML_ParseBuffer not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_NO_BUFFER)
+ fail("Pre-init XML_ParseBuffer faulted for wrong reason");
+
+ buffer = XML_GetBuffer(g_parser, 1 /* any small number greater than 0 */);
+ if (buffer == NULL)
+ fail("Could not acquire parse buffer");
+
+ g_allocation_count = 0;
+ if (XML_ParseBuffer(g_parser, 0, XML_FALSE) != XML_STATUS_ERROR)
+ fail("Pre-init XML_ParseBuffer not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_NO_MEMORY)
+ fail("Pre-init XML_ParseBuffer faulted for wrong reason");
+
+ /* Now with actual memory allocation */
+ g_allocation_count = ALLOC_ALWAYS_SUCCEED;
+ if (XML_ParseBuffer(g_parser, 0, XML_FALSE) != XML_STATUS_OK)
+ xml_failure(g_parser);
+
+ /* Check that resuming an unsuspended parser is faulted */
+ if (XML_ResumeParser(g_parser) != XML_STATUS_ERROR)
+ fail("Resuming unsuspended parser not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_NOT_SUSPENDED)
+ xml_failure(g_parser);
+
+ /* Get the parser into suspended state */
+ XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
+ g_resumable = XML_TRUE;
+ buffer = XML_GetBuffer(g_parser, (int)strlen(text));
+ if (buffer == NULL)
+ fail("Could not acquire parse buffer");
+ assert(buffer != NULL);
+ memcpy(buffer, text, strlen(text));
+ if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_SUSPENDED)
+ xml_failure(g_parser);
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_NONE)
+ xml_failure(g_parser);
+ if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Suspended XML_ParseBuffer not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_SUSPENDED)
+ xml_failure(g_parser);
+ if (XML_GetBuffer(g_parser, (int)strlen(text)) != NULL)
+ fail("Suspended XML_GetBuffer not faulted");
+
+ /* Get it going again and complete the world */
+ XML_SetCharacterDataHandler(g_parser, NULL);
+ if (XML_ResumeParser(g_parser) != XML_STATUS_OK)
+ xml_failure(g_parser);
+ if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ fail("Post-finishing XML_ParseBuffer not faulted");
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_FINISHED)
+ xml_failure(g_parser);
+ if (XML_GetBuffer(g_parser, (int)strlen(text)) != NULL)
+ fail("Post-finishing XML_GetBuffer not faulted");
+}
+END_TEST
+
+/* Check handling of long prefix names (pool growth) */
+START_TEST(test_nsalloc_long_prefix) {
+ const char *text
+ = "<"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ ":foo xmlns:"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "='http://example.org/'>"
+ "</"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ ":foo>";
+ int i;
+ const int max_alloc_count = 40;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+/* Check handling of long uri names (pool growth) */
+START_TEST(test_nsalloc_long_uri) {
+ const char *text
+ = "<foo:e xmlns:foo='http://example.org/"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "' bar:a='12'\n"
+ "xmlns:bar='http://example.org/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
+ "'>"
+ "</foo:e>";
+ int i;
+ const int max_alloc_count = 40;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+/* Test handling of long attribute names with prefixes */
+START_TEST(test_nsalloc_long_attr) {
+ const char *text
+ = "<foo:e xmlns:foo='http://example.org/' bar:"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "='12'\n"
+ "xmlns:bar='http://example.org/'>"
+ "</foo:e>";
+ int i;
+ const int max_alloc_count = 40;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+/* Test handling of an attribute name with a long namespace prefix */
+START_TEST(test_nsalloc_long_attr_prefix) {
+ const char *text
+ = "<foo:e xmlns:foo='http://example.org/' "
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ ":a='12'\n"
+ "xmlns:"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "='http://example.org/'>"
+ "</foo:e>";
+ const XML_Char *elemstr[] = {
+ /* clang-format off */
+ XCS("http://example.org/ e foo"),
+ XCS("http://example.org/ a ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
+ /* clang-format on */
+ };
+ int i;
+ const int max_alloc_count = 40;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetReturnNSTriplet(g_parser, XML_TRUE);
+ XML_SetUserData(g_parser, (void *)elemstr);
+ XML_SetElementHandler(g_parser, triplet_start_checker, triplet_end_checker);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+/* Test attribute handling in the face of a dodgy reallocator */
+START_TEST(test_nsalloc_realloc_attributes) {
+ const char *text = "<foo:e xmlns:foo='http://example.org/' bar:a='12'\n"
+ " xmlns:bar='http://example.org/'>"
+ "</foo:e>";
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocations");
+ else if (i == max_realloc_count)
+ fail("Parsing failed at max reallocation count");
+}
+END_TEST
+
+/* Test long element names with namespaces under a failing allocator */
+START_TEST(test_nsalloc_long_element) {
+ const char *text
+ = "<foo:thisisalongenoughelementnametotriggerareallocation\n"
+ " xmlns:foo='http://example.org/' bar:a='12'\n"
+ " xmlns:bar='http://example.org/'>"
+ "</foo:thisisalongenoughelementnametotriggerareallocation>";
+ const XML_Char *elemstr[]
+ = {XCS("http://example.org/")
+ XCS(" thisisalongenoughelementnametotriggerareallocation foo"),
+ XCS("http://example.org/ a bar")};
+ int i;
+ const int max_alloc_count = 30;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetReturnNSTriplet(g_parser, XML_TRUE);
+ XML_SetUserData(g_parser, (void *)elemstr);
+ XML_SetElementHandler(g_parser, triplet_start_checker, triplet_end_checker);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed at max reallocation count");
+}
+END_TEST
+
+/* Test the effects of reallocation failure when reassigning a
+ * binding.
+ *
+ * XML_ParserReset does not free the BINDING structures used by a
+ * parser, but instead adds them to an internal free list to be reused
+ * as necessary. Likewise the URI buffers allocated for the binding
+ * aren't freed, but kept attached to their existing binding. If the
+ * new binding has a longer URI, it will need reallocation. This test
+ * provokes that reallocation, and tests the control path if it fails.
+ */
+START_TEST(test_nsalloc_realloc_binding_uri) {
+ const char *first = "<doc xmlns='http://example.org/'>\n"
+ " <e xmlns='' />\n"
+ "</doc>";
+ const char *second
+ = "<doc xmlns='http://example.org/long/enough/URI/to/reallocate/'>\n"
+ " <e xmlns='' />\n"
+ "</doc>";
+ unsigned i;
+ const unsigned max_realloc_count = 10;
+
+ /* First, do a full parse that will leave bindings around */
+ if (_XML_Parse_SINGLE_BYTES(g_parser, first, (int)strlen(first), XML_TRUE)
+ == XML_STATUS_ERROR)
+ xml_failure(g_parser);
+
+ /* Now repeat with a longer URI and a duff reallocator */
+ for (i = 0; i < max_realloc_count; i++) {
+ XML_ParserReset(g_parser, NULL);
+ g_reallocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, second, (int)strlen(second), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocation");
+ else if (i == max_realloc_count)
+ fail("Parsing failed at max reallocation count");
+}
+END_TEST
+
+/* Check handling of long prefix names (pool growth) */
+START_TEST(test_nsalloc_realloc_long_prefix) {
+ const char *text
+ = "<"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ ":foo xmlns:"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "='http://example.org/'>"
+ "</"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ ":foo>";
+ int i;
+ const int max_realloc_count = 12;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocations");
+ else if (i == max_realloc_count)
+ fail("Parsing failed even at max reallocation count");
+}
+END_TEST
+
+/* Check handling of even long prefix names (different code path) */
+START_TEST(test_nsalloc_realloc_longer_prefix) {
+ const char *text
+ = "<"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "Q:foo xmlns:"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "Q='http://example.org/'>"
+ "</"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "Q:foo>";
+ int i;
+ const int max_realloc_count = 12;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocations");
+ else if (i == max_realloc_count)
+ fail("Parsing failed even at max reallocation count");
+}
+END_TEST
+
+START_TEST(test_nsalloc_long_namespace) {
+ const char *text1
+ = "<"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ ":e xmlns:"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "='http://example.org/'>\n";
+ const char *text2
+ = "<"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ ":f "
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ ":attr='foo'/>\n"
+ "</"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ ":e>";
+ int i;
+ const int max_alloc_count = 40;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
+ != XML_STATUS_ERROR
+ && _XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2),
+ XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+/* Using a slightly shorter namespace name provokes allocations in
+ * slightly different places in the code.
+ */
+START_TEST(test_nsalloc_less_long_namespace) {
+ const char *text
+ = "<"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
+ ":e xmlns:"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
+ "='http://example.org/'>\n"
+ "<"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
+ ":f "
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
+ ":att='foo'/>\n"
+ "</"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
+ ":e>";
+ int i;
+ const int max_alloc_count = 40;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+START_TEST(test_nsalloc_long_context) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ATTLIST doc baz ID #REQUIRED>\n"
+ " <!ENTITY en SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKL"
+ "' baz='2'>\n"
+ "&en;"
+ "</doc>";
+ ExtOption options[] = {
+ {XCS("foo"), "<!ELEMENT e EMPTY>"}, {XCS("bar"), "<e/>"}, {NULL, NULL}};
+ int i;
+ const int max_alloc_count = 70;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetUserData(g_parser, options);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+/* This function is void; it will throw a fail() on error, so if it
+ * returns normally it must have succeeded.
+ */
+static void
+context_realloc_test(const char *text) {
+ ExtOption options[] = {
+ {XCS("foo"), "<!ELEMENT e EMPTY>"}, {XCS("bar"), "<e/>"}, {NULL, NULL}};
+ int i;
+ const int max_realloc_count = 6;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetUserData(g_parser, options);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocations");
+ else if (i == max_realloc_count)
+ fail("Parsing failed even at max reallocation count");
+}
+
+START_TEST(test_nsalloc_realloc_long_context) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ENTITY en SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKL"
+ "'>\n"
+ "&en;"
+ "</doc>";
+
+ context_realloc_test(text);
+}
+END_TEST
+
+START_TEST(test_nsalloc_realloc_long_context_2) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ENTITY en SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJK"
+ "'>\n"
+ "&en;"
+ "</doc>";
+
+ context_realloc_test(text);
+}
+END_TEST
+
+START_TEST(test_nsalloc_realloc_long_context_3) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ENTITY en SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGH"
+ "'>\n"
+ "&en;"
+ "</doc>";
+
+ context_realloc_test(text);
+}
+END_TEST
+
+START_TEST(test_nsalloc_realloc_long_context_4) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ENTITY en SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO"
+ "'>\n"
+ "&en;"
+ "</doc>";
+
+ context_realloc_test(text);
+}
+END_TEST
+
+START_TEST(test_nsalloc_realloc_long_context_5) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ENTITY en SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABC"
+ "'>\n"
+ "&en;"
+ "</doc>";
+
+ context_realloc_test(text);
+}
+END_TEST
+
+START_TEST(test_nsalloc_realloc_long_context_6) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ENTITY en SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
+ "'>\n"
+ "&en;"
+ "</doc>";
+
+ context_realloc_test(text);
+}
+END_TEST
+
+START_TEST(test_nsalloc_realloc_long_context_7) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ENTITY en SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLM"
+ "'>\n"
+ "&en;"
+ "</doc>";
+
+ context_realloc_test(text);
+}
+END_TEST
+
+START_TEST(test_nsalloc_realloc_long_ge_name) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ENTITY "
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ " SYSTEM 'bar'>\n"
+ "]>\n"
+ "<doc xmlns='http://example.org/baz'>\n"
+ "&"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ ";"
+ "</doc>";
+ ExtOption options[] = {
+ {XCS("foo"), "<!ELEMENT el EMPTY>"}, {XCS("bar"), "<el/>"}, {NULL, NULL}};
+ int i;
+ const int max_realloc_count = 10;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetUserData(g_parser, options);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocations");
+ else if (i == max_realloc_count)
+ fail("Parsing failed even at max reallocation count");
+}
+END_TEST
+
+/* Test that when a namespace is passed through the context mechanism
+ * to an external entity parser, the parsers handle reallocation
+ * failures correctly. The prefix is exactly the right length to
+ * provoke particular uncommon code paths.
+ */
+START_TEST(test_nsalloc_realloc_long_context_in_dtd) {
+ const char *text1
+ = "<!DOCTYPE "
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ ":doc [\n"
+ " <!ENTITY First SYSTEM 'foo/First'>\n"
+ "]>\n"
+ "<"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ ":doc xmlns:"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "='foo/Second'>&First;";
+ const char *text2
+ = "</"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ ":doc>";
+ ExtOption options[] = {{XCS("foo/First"), "Hello world"}, {NULL, NULL}};
+ int i;
+ const int max_realloc_count = 20;
+
+ for (i = 0; i < max_realloc_count; i++) {
+ g_reallocation_count = i;
+ XML_SetUserData(g_parser, options);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
+ != XML_STATUS_ERROR
+ && _XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2),
+ XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing reallocations");
+ else if (i == max_realloc_count)
+ fail("Parsing failed even at max reallocation count");
+}
+END_TEST
+
+START_TEST(test_nsalloc_long_default_in_ext) {
+ const char *text
+ = "<!DOCTYPE doc [\n"
+ " <!ATTLIST e a1 CDATA '"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+ "'>\n"
+ " <!ENTITY x SYSTEM 'foo'>\n"
+ "]>\n"
+ "<doc>&x;</doc>";
+ ExtOption options[] = {{XCS("foo"), "<e/>"}, {NULL, NULL}};
+ int i;
+ const int max_alloc_count = 50;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetUserData(g_parser, options);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+START_TEST(test_nsalloc_long_systemid_in_ext) {
+ const char *text
+ = "<!DOCTYPE doc SYSTEM 'foo' [\n"
+ " <!ENTITY en SYSTEM '"
+ /* 64 characters per line */
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
+ "'>\n"
+ "]>\n"
+ "<doc>&en;</doc>";
+ ExtOption options[] = {
+ {XCS("foo"), "<!ELEMENT e EMPTY>"},
+ {/* clang-format off */
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
+ XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"),
+ /* clang-format on */
+ "<e/>"},
+ {NULL, NULL}};
+ int i;
+ const int max_alloc_count = 55;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetUserData(g_parser, options);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Parsing worked despite failing allocations");
+ else if (i == max_alloc_count)
+ fail("Parsing failed even at max allocation count");
+}
+END_TEST
+
+/* Test the effects of allocation failure on parsing an element in a
+ * namespace. Based on test_nsalloc_long_context.
+ */
+START_TEST(test_nsalloc_prefixed_element) {
+ const char *text = "<!DOCTYPE pfx:element SYSTEM 'foo' [\n"
+ " <!ATTLIST pfx:element baz ID #REQUIRED>\n"
+ " <!ENTITY en SYSTEM 'bar'>\n"
+ "]>\n"
+ "<pfx:element xmlns:pfx='http://example.org/' baz='2'>\n"
+ "&en;"
+ "</pfx:element>";
+ ExtOption options[] = {
+ {XCS("foo"), "<!ELEMENT e EMPTY>"}, {XCS("bar"), "<e/>"}, {NULL, NULL}};
+ int i;
+ const int max_alloc_count = 70;
+
+ for (i = 0; i < max_alloc_count; i++) {
+ g_allocation_count = i;
+ XML_SetUserData(g_parser, options);
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
+ if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
+ != XML_STATUS_ERROR)
+ break;
+
+ /* See comment in test_nsalloc_xmlns() */
+ nsalloc_teardown();
+ nsalloc_setup();
+ }
+ if (i == 0)
+ fail("Success despite failing allocator");
+ else if (i == max_alloc_count)
+ fail("Failed even at full allocation count");
+}
+END_TEST
+
+void
+make_nsalloc_test_case(Suite *s) {
+ TCase *tc_nsalloc = tcase_create("namespace allocation tests");
+
+ suite_add_tcase(s, tc_nsalloc);
+ tcase_add_checked_fixture(tc_nsalloc, nsalloc_setup, nsalloc_teardown);
+
+ tcase_add_test(tc_nsalloc, test_nsalloc_xmlns);
+ tcase_add_test(tc_nsalloc, test_nsalloc_parse_buffer);
+ tcase_add_test(tc_nsalloc, test_nsalloc_long_prefix);
+ tcase_add_test(tc_nsalloc, test_nsalloc_long_uri);
+ tcase_add_test(tc_nsalloc, test_nsalloc_long_attr);
+ tcase_add_test(tc_nsalloc, test_nsalloc_long_attr_prefix);
+ tcase_add_test(tc_nsalloc, test_nsalloc_realloc_attributes);
+ tcase_add_test(tc_nsalloc, test_nsalloc_long_element);
+ tcase_add_test(tc_nsalloc, test_nsalloc_realloc_binding_uri);
+ tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_prefix);
+ tcase_add_test(tc_nsalloc, test_nsalloc_realloc_longer_prefix);
+ tcase_add_test(tc_nsalloc, test_nsalloc_long_namespace);
+ tcase_add_test(tc_nsalloc, test_nsalloc_less_long_namespace);
+ tcase_add_test(tc_nsalloc, test_nsalloc_long_context);
+ tcase_add_test__if_xml_ge(tc_nsalloc, test_nsalloc_realloc_long_context);
+ tcase_add_test__if_xml_ge(tc_nsalloc, test_nsalloc_realloc_long_context_2);
+ tcase_add_test__if_xml_ge(tc_nsalloc, test_nsalloc_realloc_long_context_3);
+ tcase_add_test__if_xml_ge(tc_nsalloc, test_nsalloc_realloc_long_context_4);
+ tcase_add_test__if_xml_ge(tc_nsalloc, test_nsalloc_realloc_long_context_5);
+ tcase_add_test__if_xml_ge(tc_nsalloc, test_nsalloc_realloc_long_context_6);
+ tcase_add_test__if_xml_ge(tc_nsalloc, test_nsalloc_realloc_long_context_7);
+ tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_ge_name);
+ tcase_add_test__if_xml_ge(tc_nsalloc,
+ test_nsalloc_realloc_long_context_in_dtd);
+ tcase_add_test__if_xml_ge(tc_nsalloc, test_nsalloc_long_default_in_ext);
+ tcase_add_test(tc_nsalloc, test_nsalloc_long_systemid_in_ext);
+ tcase_add_test(tc_nsalloc, test_nsalloc_prefixed_element);
+}
diff --git a/3rdparty/expat/tests/nsalloc_tests.h b/3rdparty/expat/tests/nsalloc_tests.h
new file mode 100644
index 00000000000..026a2a21a95
--- /dev/null
+++ b/3rdparty/expat/tests/nsalloc_tests.h
@@ -0,0 +1,56 @@
+/* Tests in the "namespace allocation" test case for the Expat test suite
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef XML_NSALLOC_TESTS_H
+# define XML_NSALLOC_TESTS_H
+
+extern void make_nsalloc_test_case(Suite *s);
+
+#endif /* XML_NSALLOC_TESTS_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/expat/tests/nsalloc_tests_cxx.cpp b/3rdparty/expat/tests/nsalloc_tests_cxx.cpp
new file mode 100644
index 00000000000..9ba75d1c536
--- /dev/null
+++ b/3rdparty/expat/tests/nsalloc_tests_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "nsalloc_tests.c"
diff --git a/3rdparty/expat/tests/runtests.c b/3rdparty/expat/tests/runtests.c
index 2490d86b9ab..ecb1c36be58 100644
--- a/3rdparty/expat/tests/runtests.c
+++ b/3rdparty/expat/tests/runtests.c
@@ -6,8 +6,20 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Tim Gates <tim.gates@iress.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
+ Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,11578 +42,37 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if defined(NDEBUG)
-# undef NDEBUG /* because test suite relies on assert(...) at the moment */
-#endif
-
-#ifdef HAVE_EXPAT_CONFIG_H
-# include <expat_config.h>
-#endif
+#include "expat_config.h"
-#include <assert.h>
-#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <stddef.h> /* ptrdiff_t */
-#include <ctype.h>
-#include <limits.h>
-
-#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
-/* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */
-# if defined(_WIN64)
-typedef __int64 intptr_t;
-# else
-typedef __int32 intptr_t;
-# endif
-typedef unsigned __int64 uint64_t;
-#else
-# include <stdint.h> /* intptr_t uint64_t */
-#endif
-
-#if ! defined(__cplusplus)
-# if defined(_MSC_VER) && (_MSC_VER <= 1700)
-/* for vs2012/11.0/1700 and earlier Visual Studio compilers */
-# define bool int
-# define false 0
-# define true 1
-# else
-# include <stdbool.h>
-# endif
-#endif
#include "expat.h"
-#include "chardata.h"
-#include "structdata.h"
-#include "internal.h" /* for UNUSED_P only */
+#include "internal.h"
#include "minicheck.h"
-#include "memcheck.h"
-#include "siphash.h"
-#include "ascii.h" /* for ASCII_xxx */
-
-#ifdef XML_LARGE_SIZE
-# define XML_FMT_INT_MOD "ll"
-#else
-# define XML_FMT_INT_MOD "l"
-#endif
-
-#ifdef XML_UNICODE_WCHAR_T
-# define XML_FMT_CHAR "lc"
-# define XML_FMT_STR "ls"
-# include <wchar.h>
-# define xcstrlen(s) wcslen(s)
-# define xcstrcmp(s, t) wcscmp((s), (t))
-# define xcstrncmp(s, t, n) wcsncmp((s), (t), (n))
-# define XCS(s) _XCS(s)
-# define _XCS(s) L##s
-#else
-# ifdef XML_UNICODE
-# error "No support for UTF-16 character without wchar_t in tests"
-# else
-# define XML_FMT_CHAR "c"
-# define XML_FMT_STR "s"
-# define xcstrlen(s) strlen(s)
-# define xcstrcmp(s, t) strcmp((s), (t))
-# define xcstrncmp(s, t, n) strncmp((s), (t), (n))
-# define XCS(s) s
-# endif /* XML_UNICODE */
-#endif /* XML_UNICODE_WCHAR_T */
-
-static XML_Parser g_parser = NULL;
-
-static void
-tcase_add_test__ifdef_xml_dtd(TCase *tc, tcase_test_function test) {
-#ifdef XML_DTD
- tcase_add_test(tc, test);
-#else
- UNUSED_P(tc);
- UNUSED_P(test);
-#endif
-}
-
-static void
-basic_setup(void) {
- g_parser = XML_ParserCreate(NULL);
- if (g_parser == NULL)
- fail("Parser not created.");
-}
-
-static void
-basic_teardown(void) {
- if (g_parser != NULL) {
- XML_ParserFree(g_parser);
- g_parser = NULL;
- }
-}
-
-/* Generate a failure using the parser state to create an error message;
- this should be used when the parser reports an error we weren't
- expecting.
-*/
-static void
-_xml_failure(XML_Parser parser, const char *file, int line) {
- char buffer[1024];
- enum XML_Error err = XML_GetErrorCode(parser);
- sprintf(buffer,
- " %d: %" XML_FMT_STR " (line %" XML_FMT_INT_MOD
- "u, offset %" XML_FMT_INT_MOD "u)\n reported from %s, line %d\n",
- err, XML_ErrorString(err), XML_GetCurrentLineNumber(parser),
- XML_GetCurrentColumnNumber(parser), file, line);
- _fail_unless(0, file, line, buffer);
-}
-
-static enum XML_Status
-_XML_Parse_SINGLE_BYTES(XML_Parser parser, const char *s, int len,
- int isFinal) {
- enum XML_Status res = XML_STATUS_ERROR;
- int offset = 0;
-
- if (len == 0) {
- return XML_Parse(parser, s, len, isFinal);
- }
-
- for (; offset < len; offset++) {
- const int innerIsFinal = (offset == len - 1) && isFinal;
- const char c = s[offset]; /* to help out-of-bounds detection */
- res = XML_Parse(parser, &c, sizeof(char), innerIsFinal);
- if (res != XML_STATUS_OK) {
- return res;
- }
- }
- return res;
-}
-
-#define xml_failure(parser) _xml_failure((parser), __FILE__, __LINE__)
-
-static void
-_expect_failure(const char *text, enum XML_Error errorCode,
- const char *errorMessage, const char *file, int lineno) {
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_OK)
- /* Hackish use of _fail_unless() macro, but let's us report
- the right filename and line number. */
- _fail_unless(0, file, lineno, errorMessage);
- if (XML_GetErrorCode(g_parser) != errorCode)
- _xml_failure(g_parser, file, lineno);
-}
-
-#define expect_failure(text, errorCode, errorMessage) \
- _expect_failure((text), (errorCode), (errorMessage), __FILE__, __LINE__)
-
-/* Dummy handlers for when we need to set a handler to tickle a bug,
- but it doesn't need to do anything.
-*/
-static unsigned long dummy_handler_flags = 0;
-
-#define DUMMY_START_DOCTYPE_HANDLER_FLAG (1UL << 0)
-#define DUMMY_END_DOCTYPE_HANDLER_FLAG (1UL << 1)
-#define DUMMY_ENTITY_DECL_HANDLER_FLAG (1UL << 2)
-#define DUMMY_NOTATION_DECL_HANDLER_FLAG (1UL << 3)
-#define DUMMY_ELEMENT_DECL_HANDLER_FLAG (1UL << 4)
-#define DUMMY_ATTLIST_DECL_HANDLER_FLAG (1UL << 5)
-#define DUMMY_COMMENT_HANDLER_FLAG (1UL << 6)
-#define DUMMY_PI_HANDLER_FLAG (1UL << 7)
-#define DUMMY_START_ELEMENT_HANDLER_FLAG (1UL << 8)
-#define DUMMY_START_CDATA_HANDLER_FLAG (1UL << 9)
-#define DUMMY_END_CDATA_HANDLER_FLAG (1UL << 10)
-#define DUMMY_UNPARSED_ENTITY_DECL_HANDLER_FLAG (1UL << 11)
-#define DUMMY_START_NS_DECL_HANDLER_FLAG (1UL << 12)
-#define DUMMY_END_NS_DECL_HANDLER_FLAG (1UL << 13)
-#define DUMMY_START_DOCTYPE_DECL_HANDLER_FLAG (1UL << 14)
-#define DUMMY_END_DOCTYPE_DECL_HANDLER_FLAG (1UL << 15)
-#define DUMMY_SKIP_HANDLER_FLAG (1UL << 16)
-#define DUMMY_DEFAULT_HANDLER_FLAG (1UL << 17)
-
-static void XMLCALL
-dummy_xdecl_handler(void *userData, const XML_Char *version,
- const XML_Char *encoding, int standalone) {
- UNUSED_P(userData);
- UNUSED_P(version);
- UNUSED_P(encoding);
- UNUSED_P(standalone);
-}
-
-static void XMLCALL
-dummy_start_doctype_handler(void *userData, const XML_Char *doctypeName,
- const XML_Char *sysid, const XML_Char *pubid,
- int has_internal_subset) {
- UNUSED_P(userData);
- UNUSED_P(doctypeName);
- UNUSED_P(sysid);
- UNUSED_P(pubid);
- UNUSED_P(has_internal_subset);
- dummy_handler_flags |= DUMMY_START_DOCTYPE_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_end_doctype_handler(void *userData) {
- UNUSED_P(userData);
- dummy_handler_flags |= DUMMY_END_DOCTYPE_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_entity_decl_handler(void *userData, const XML_Char *entityName,
- int is_parameter_entity, const XML_Char *value,
- int value_length, const XML_Char *base,
- const XML_Char *systemId, const XML_Char *publicId,
- const XML_Char *notationName) {
- UNUSED_P(userData);
- UNUSED_P(entityName);
- UNUSED_P(is_parameter_entity);
- UNUSED_P(value);
- UNUSED_P(value_length);
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- UNUSED_P(notationName);
- dummy_handler_flags |= DUMMY_ENTITY_DECL_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_notation_decl_handler(void *userData, const XML_Char *notationName,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- UNUSED_P(userData);
- UNUSED_P(notationName);
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- dummy_handler_flags |= DUMMY_NOTATION_DECL_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_element_decl_handler(void *userData, const XML_Char *name,
- XML_Content *model) {
- UNUSED_P(userData);
- UNUSED_P(name);
- /* The content model must be freed by the handler. Unfortunately
- * we cannot pass the parser as the userData because this is used
- * with other handlers that require other userData.
- */
- XML_FreeContentModel(g_parser, model);
- dummy_handler_flags |= DUMMY_ELEMENT_DECL_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_attlist_decl_handler(void *userData, const XML_Char *elname,
- const XML_Char *attname, const XML_Char *att_type,
- const XML_Char *dflt, int isrequired) {
- UNUSED_P(userData);
- UNUSED_P(elname);
- UNUSED_P(attname);
- UNUSED_P(att_type);
- UNUSED_P(dflt);
- UNUSED_P(isrequired);
- dummy_handler_flags |= DUMMY_ATTLIST_DECL_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_comment_handler(void *userData, const XML_Char *data) {
- UNUSED_P(userData);
- UNUSED_P(data);
- dummy_handler_flags |= DUMMY_COMMENT_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_pi_handler(void *userData, const XML_Char *target, const XML_Char *data) {
- UNUSED_P(userData);
- UNUSED_P(target);
- UNUSED_P(data);
- dummy_handler_flags |= DUMMY_PI_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_start_element(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- UNUSED_P(userData);
- UNUSED_P(name);
- UNUSED_P(atts);
- dummy_handler_flags |= DUMMY_START_ELEMENT_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_end_element(void *userData, const XML_Char *name) {
- UNUSED_P(userData);
- UNUSED_P(name);
-}
-
-static void XMLCALL
-dummy_start_cdata_handler(void *userData) {
- UNUSED_P(userData);
- dummy_handler_flags |= DUMMY_START_CDATA_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_end_cdata_handler(void *userData) {
- UNUSED_P(userData);
- dummy_handler_flags |= DUMMY_END_CDATA_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_cdata_handler(void *userData, const XML_Char *s, int len) {
- UNUSED_P(userData);
- UNUSED_P(s);
- UNUSED_P(len);
-}
-
-static void XMLCALL
-dummy_start_namespace_decl_handler(void *userData, const XML_Char *prefix,
- const XML_Char *uri) {
- UNUSED_P(userData);
- UNUSED_P(prefix);
- UNUSED_P(uri);
- dummy_handler_flags |= DUMMY_START_NS_DECL_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_end_namespace_decl_handler(void *userData, const XML_Char *prefix) {
- UNUSED_P(userData);
- UNUSED_P(prefix);
- dummy_handler_flags |= DUMMY_END_NS_DECL_HANDLER_FLAG;
-}
-
-/* This handler is obsolete, but while the code exists we should
- * ensure that dealing with the handler is covered by tests.
- */
-static void XMLCALL
-dummy_unparsed_entity_decl_handler(void *userData, const XML_Char *entityName,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId,
- const XML_Char *notationName) {
- UNUSED_P(userData);
- UNUSED_P(entityName);
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- UNUSED_P(notationName);
- dummy_handler_flags |= DUMMY_UNPARSED_ENTITY_DECL_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_default_handler(void *userData, const XML_Char *s, int len) {
- UNUSED_P(userData);
- UNUSED_P(s);
- UNUSED_P(len);
-}
-
-static void XMLCALL
-dummy_start_doctype_decl_handler(void *userData, const XML_Char *doctypeName,
- const XML_Char *sysid, const XML_Char *pubid,
- int has_internal_subset) {
- UNUSED_P(userData);
- UNUSED_P(doctypeName);
- UNUSED_P(sysid);
- UNUSED_P(pubid);
- UNUSED_P(has_internal_subset);
- dummy_handler_flags |= DUMMY_START_DOCTYPE_DECL_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_end_doctype_decl_handler(void *userData) {
- UNUSED_P(userData);
- dummy_handler_flags |= DUMMY_END_DOCTYPE_DECL_HANDLER_FLAG;
-}
-
-static void XMLCALL
-dummy_skip_handler(void *userData, const XML_Char *entityName,
- int is_parameter_entity) {
- UNUSED_P(userData);
- UNUSED_P(entityName);
- UNUSED_P(is_parameter_entity);
- dummy_handler_flags |= DUMMY_SKIP_HANDLER_FLAG;
-}
-
-/* Useful external entity handler */
-typedef struct ExtOption {
- const XML_Char *system_id;
- const char *parse_text;
-} ExtOption;
-
-static int XMLCALL
-external_entity_optioner(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- ExtOption *options = (ExtOption *)XML_GetUserData(parser);
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(publicId);
- while (options->parse_text != NULL) {
- if (! xcstrcmp(systemId, options->system_id)) {
- enum XML_Status rc;
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- return XML_STATUS_ERROR;
- rc = _XML_Parse_SINGLE_BYTES(ext_parser, options->parse_text,
- (int)strlen(options->parse_text), XML_TRUE);
- XML_ParserFree(ext_parser);
- return rc;
- }
- options++;
- }
- fail("No suitable option found");
- return XML_STATUS_ERROR;
-}
-
-/*
- * Parameter entity evaluation support.
- */
-#define ENTITY_MATCH_FAIL (-1)
-#define ENTITY_MATCH_NOT_FOUND (0)
-#define ENTITY_MATCH_SUCCESS (1)
-static const XML_Char *entity_name_to_match = NULL;
-static const XML_Char *entity_value_to_match = NULL;
-static int entity_match_flag = ENTITY_MATCH_NOT_FOUND;
-
-static void XMLCALL
-param_entity_match_handler(void *userData, const XML_Char *entityName,
- int is_parameter_entity, const XML_Char *value,
- int value_length, const XML_Char *base,
- const XML_Char *systemId, const XML_Char *publicId,
- const XML_Char *notationName) {
- UNUSED_P(userData);
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- UNUSED_P(notationName);
- if (! is_parameter_entity || entity_name_to_match == NULL
- || entity_value_to_match == NULL) {
- return;
- }
- if (! xcstrcmp(entityName, entity_name_to_match)) {
- /* The cast here is safe because we control the horizontal and
- * the vertical, and we therefore know our strings are never
- * going to overflow an int.
- */
- if (value_length != (int)xcstrlen(entity_value_to_match)
- || xcstrncmp(value, entity_value_to_match, value_length)) {
- entity_match_flag = ENTITY_MATCH_FAIL;
- } else {
- entity_match_flag = ENTITY_MATCH_SUCCESS;
- }
- }
- /* Else leave the match flag alone */
-}
-
-/*
- * Character & encoding tests.
- */
-
-START_TEST(test_nul_byte) {
- char text[] = "<doc>\0</doc>";
-
- /* test that a NUL byte (in US-ASCII data) is an error */
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_OK)
- fail("Parser did not report error on NUL-byte.");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_u0000_char) {
- /* test that a NUL byte (in US-ASCII data) is an error */
- expect_failure("<doc>&#0;</doc>", XML_ERROR_BAD_CHAR_REF,
- "Parser did not report error on NUL-byte.");
-}
-END_TEST
-
-START_TEST(test_siphash_self) {
- if (! sip24_valid())
- fail("SipHash self-test failed");
-}
-END_TEST
-
-START_TEST(test_siphash_spec) {
- /* https://131002.net/siphash/siphash.pdf (page 19, "Test values") */
- const char message[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09"
- "\x0a\x0b\x0c\x0d\x0e";
- const size_t len = sizeof(message) - 1;
- const uint64_t expected = _SIP_ULL(0xa129ca61U, 0x49be45e5U);
- struct siphash state;
- struct sipkey key;
-
- sip_tokey(&key, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09"
- "\x0a\x0b\x0c\x0d\x0e\x0f");
- sip24_init(&state, &key);
-
- /* Cover spread across calls */
- sip24_update(&state, message, 4);
- sip24_update(&state, message + 4, len - 4);
-
- /* Cover null length */
- sip24_update(&state, message, 0);
-
- if (sip24_final(&state) != expected)
- fail("sip24_final failed spec test\n");
-
- /* Cover wrapper */
- if (siphash24(message, len, &key) != expected)
- fail("siphash24 failed spec test\n");
-}
-END_TEST
-
-START_TEST(test_bom_utf8) {
- /* This test is really just making sure we don't core on a UTF-8 BOM. */
- const char *text = "\357\273\277<e/>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_bom_utf16_be) {
- char text[] = "\376\377\0<\0e\0/\0>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_bom_utf16_le) {
- char text[] = "\377\376<\0e\0/\0>\0";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Parse whole buffer at once to exercise a different code path */
-START_TEST(test_nobom_utf16_le) {
- char text[] = " \0<\0e\0/\0>\0";
-
- if (XML_Parse(g_parser, text, sizeof(text) - 1, XML_TRUE) == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-static void XMLCALL
-accumulate_characters(void *userData, const XML_Char *s, int len) {
- CharData_AppendXMLChars((CharData *)userData, s, len);
-}
-
-static void XMLCALL
-accumulate_attribute(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- CharData *storage = (CharData *)userData;
- UNUSED_P(name);
- /* Check there are attributes to deal with */
- if (atts == NULL)
- return;
-
- while (storage->count < 0 && atts[0] != NULL) {
- /* "accumulate" the value of the first attribute we see */
- CharData_AppendXMLChars(storage, atts[1], -1);
- atts += 2;
- }
-}
-
-static void
-_run_character_check(const char *text, const XML_Char *expected,
- const char *file, int line) {
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- _xml_failure(g_parser, file, line);
- CharData_CheckXMLChars(&storage, expected);
-}
-
-#define run_character_check(text, expected) \
- _run_character_check(text, expected, __FILE__, __LINE__)
-
-static void
-_run_attribute_check(const char *text, const XML_Char *expected,
- const char *file, int line) {
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetStartElementHandler(g_parser, accumulate_attribute);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- _xml_failure(g_parser, file, line);
- CharData_CheckXMLChars(&storage, expected);
-}
-
-#define run_attribute_check(text, expected) \
- _run_attribute_check(text, expected, __FILE__, __LINE__)
-
-typedef struct ExtTest {
- const char *parse_text;
- const XML_Char *encoding;
- CharData *storage;
-} ExtTest;
-
-static void XMLCALL
-ext_accumulate_characters(void *userData, const XML_Char *s, int len) {
- ExtTest *test_data = (ExtTest *)userData;
- accumulate_characters(test_data->storage, s, len);
-}
-
-static void
-_run_ext_character_check(const char *text, ExtTest *test_data,
- const XML_Char *expected, const char *file, int line) {
- CharData *const storage = (CharData *)malloc(sizeof(CharData));
-
- CharData_Init(storage);
- test_data->storage = storage;
- XML_SetUserData(g_parser, test_data);
- XML_SetCharacterDataHandler(g_parser, ext_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- _xml_failure(g_parser, file, line);
- CharData_CheckXMLChars(storage, expected);
-
- free(storage);
-}
-
-#define run_ext_character_check(text, test_data, expected) \
- _run_ext_character_check(text, test_data, expected, __FILE__, __LINE__)
-
-/* Regression test for SF bug #491986. */
-START_TEST(test_danish_latin1) {
- const char *text = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
- "<e>J\xF8rgen \xE6\xF8\xE5\xC6\xD8\xC5</e>";
-#ifdef XML_UNICODE
- const XML_Char *expected
- = XCS("J\x00f8rgen \x00e6\x00f8\x00e5\x00c6\x00d8\x00c5");
-#else
- const XML_Char *expected
- = XCS("J\xC3\xB8rgen \xC3\xA6\xC3\xB8\xC3\xA5\xC3\x86\xC3\x98\xC3\x85");
-#endif
- run_character_check(text, expected);
-}
-END_TEST
-
-/* Regression test for SF bug #514281. */
-START_TEST(test_french_charref_hexidecimal) {
- const char *text = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
- "<doc>&#xE9;&#xE8;&#xE0;&#xE7;&#xEA;&#xC8;</doc>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00e9\x00e8\x00e0\x00e7\x00ea\x00c8");
-#else
- const XML_Char *expected
- = XCS("\xC3\xA9\xC3\xA8\xC3\xA0\xC3\xA7\xC3\xAA\xC3\x88");
-#endif
- run_character_check(text, expected);
-}
-END_TEST
-
-START_TEST(test_french_charref_decimal) {
- const char *text = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
- "<doc>&#233;&#232;&#224;&#231;&#234;&#200;</doc>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00e9\x00e8\x00e0\x00e7\x00ea\x00c8");
-#else
- const XML_Char *expected
- = XCS("\xC3\xA9\xC3\xA8\xC3\xA0\xC3\xA7\xC3\xAA\xC3\x88");
-#endif
- run_character_check(text, expected);
-}
-END_TEST
-
-START_TEST(test_french_latin1) {
- const char *text = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
- "<doc>\xE9\xE8\xE0\xE7\xEa\xC8</doc>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00e9\x00e8\x00e0\x00e7\x00ea\x00c8");
-#else
- const XML_Char *expected
- = XCS("\xC3\xA9\xC3\xA8\xC3\xA0\xC3\xA7\xC3\xAA\xC3\x88");
-#endif
- run_character_check(text, expected);
-}
-END_TEST
-
-START_TEST(test_french_utf8) {
- const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
- "<doc>\xC3\xA9</doc>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00e9");
-#else
- const XML_Char *expected = XCS("\xC3\xA9");
-#endif
- run_character_check(text, expected);
-}
-END_TEST
-
-/* Regression test for SF bug #600479.
- XXX There should be a test that exercises all legal XML Unicode
- characters as PCDATA and attribute value content, and XML Name
- characters as part of element and attribute names.
-*/
-START_TEST(test_utf8_false_rejection) {
- const char *text = "<doc>\xEF\xBA\xBF</doc>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\xfebf");
-#else
- const XML_Char *expected = XCS("\xEF\xBA\xBF");
-#endif
- run_character_check(text, expected);
-}
-END_TEST
-
-/* Regression test for SF bug #477667.
- This test assures that any 8-bit character followed by a 7-bit
- character will not be mistakenly interpreted as a valid UTF-8
- sequence.
-*/
-START_TEST(test_illegal_utf8) {
- char text[100];
- int i;
-
- for (i = 128; i <= 255; ++i) {
- sprintf(text, "<e>%ccd</e>", i);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_OK) {
- sprintf(text, "expected token error for '%c' (ordinal %d) in UTF-8 text",
- i, i);
- fail(text);
- } else if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
- xml_failure(g_parser);
- /* Reset the parser since we use the same parser repeatedly. */
- XML_ParserReset(g_parser, NULL);
- }
-}
-END_TEST
-
-/* Examples, not masks: */
-#define UTF8_LEAD_1 "\x7f" /* 0b01111111 */
-#define UTF8_LEAD_2 "\xdf" /* 0b11011111 */
-#define UTF8_LEAD_3 "\xef" /* 0b11101111 */
-#define UTF8_LEAD_4 "\xf7" /* 0b11110111 */
-#define UTF8_FOLLOW "\xbf" /* 0b10111111 */
-
-START_TEST(test_utf8_auto_align) {
- struct TestCase {
- ptrdiff_t expectedMovementInChars;
- const char *input;
- };
-
- struct TestCase cases[] = {
- {00, ""},
-
- {00, UTF8_LEAD_1},
-
- {-1, UTF8_LEAD_2},
- {00, UTF8_LEAD_2 UTF8_FOLLOW},
-
- {-1, UTF8_LEAD_3},
- {-2, UTF8_LEAD_3 UTF8_FOLLOW},
- {00, UTF8_LEAD_3 UTF8_FOLLOW UTF8_FOLLOW},
-
- {-1, UTF8_LEAD_4},
- {-2, UTF8_LEAD_4 UTF8_FOLLOW},
- {-3, UTF8_LEAD_4 UTF8_FOLLOW UTF8_FOLLOW},
- {00, UTF8_LEAD_4 UTF8_FOLLOW UTF8_FOLLOW UTF8_FOLLOW},
- };
-
- size_t i = 0;
- bool success = true;
- for (; i < sizeof(cases) / sizeof(*cases); i++) {
- const char *fromLim = cases[i].input + strlen(cases[i].input);
- const char *const fromLimInitially = fromLim;
- ptrdiff_t actualMovementInChars;
-
- _INTERNAL_trim_to_complete_utf8_characters(cases[i].input, &fromLim);
-
- actualMovementInChars = (fromLim - fromLimInitially);
- if (actualMovementInChars != cases[i].expectedMovementInChars) {
- size_t j = 0;
- success = false;
- printf("[-] UTF-8 case %2u: Expected movement by %2d chars"
- ", actually moved by %2d chars: \"",
- (unsigned)(i + 1), (int)cases[i].expectedMovementInChars,
- (int)actualMovementInChars);
- for (; j < strlen(cases[i].input); j++) {
- printf("\\x%02x", (unsigned char)cases[i].input[j]);
- }
- printf("\"\n");
- }
- }
-
- if (! success) {
- fail("UTF-8 auto-alignment is not bullet-proof\n");
- }
-}
-END_TEST
-
-START_TEST(test_utf16) {
- /* <?xml version="1.0" encoding="UTF-16"?>
- * <doc a='123'>some {A} text</doc>
- *
- * where {A} is U+FF21, FULLWIDTH LATIN CAPITAL LETTER A
- */
- char text[]
- = "\000<\000?\000x\000m\000\154\000 \000v\000e\000r\000s\000i\000o"
- "\000n\000=\000'\0001\000.\000\060\000'\000 \000e\000n\000c\000o"
- "\000d\000i\000n\000g\000=\000'\000U\000T\000F\000-\0001\000\066"
- "\000'\000?\000>\000\n"
- "\000<\000d\000o\000c\000 \000a\000=\000'\0001\0002\0003\000'\000>"
- "\000s\000o\000m\000e\000 \xff\x21\000 \000t\000e\000x\000t\000"
- "<\000/\000d\000o\000c\000>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("some \xff21 text");
-#else
- const XML_Char *expected = XCS("some \357\274\241 text");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_utf16_le_epilog_newline) {
- unsigned int first_chunk_bytes = 17;
- char text[] = "\xFF\xFE" /* BOM */
- "<\000e\000/\000>\000" /* document element */
- "\r\000\n\000\r\000\n\000"; /* epilog */
-
- if (first_chunk_bytes >= sizeof(text) - 1)
- fail("bad value of first_chunk_bytes");
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, first_chunk_bytes, XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- else {
- enum XML_Status rc;
- rc = _XML_Parse_SINGLE_BYTES(g_parser, text + first_chunk_bytes,
- sizeof(text) - first_chunk_bytes - 1,
- XML_TRUE);
- if (rc == XML_STATUS_ERROR)
- xml_failure(g_parser);
- }
-}
-END_TEST
-
-/* Test that an outright lie in the encoding is faulted */
-START_TEST(test_not_utf16) {
- const char *text = "<?xml version='1.0' encoding='utf-16'?>"
- "<doc>Hi</doc>";
-
- /* Use a handler to provoke the appropriate code paths */
- XML_SetXmlDeclHandler(g_parser, dummy_xdecl_handler);
- expect_failure(text, XML_ERROR_INCORRECT_ENCODING,
- "UTF-16 declared in UTF-8 not faulted");
-}
-END_TEST
-
-/* Test that an unknown encoding is rejected */
-START_TEST(test_bad_encoding) {
- const char *text = "<doc>Hi</doc>";
-
- if (! XML_SetEncoding(g_parser, XCS("unknown-encoding")))
- fail("XML_SetEncoding failed");
- expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
- "Unknown encoding not faulted");
-}
-END_TEST
-
-/* Regression test for SF bug #481609, #774028. */
-START_TEST(test_latin1_umlauts) {
- const char *text
- = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
- "<e a='\xE4 \xF6 \xFC &#228; &#246; &#252; &#x00E4; &#x0F6; &#xFC; >'\n"
- " >\xE4 \xF6 \xFC &#228; &#246; &#252; &#x00E4; &#x0F6; &#xFC; ></e>";
-#ifdef XML_UNICODE
- /* Expected results in UTF-16 */
- const XML_Char *expected = XCS("\x00e4 \x00f6 \x00fc ")
- XCS("\x00e4 \x00f6 \x00fc ") XCS("\x00e4 \x00f6 \x00fc >");
-#else
- /* Expected results in UTF-8 */
- const XML_Char *expected = XCS("\xC3\xA4 \xC3\xB6 \xC3\xBC ")
- XCS("\xC3\xA4 \xC3\xB6 \xC3\xBC ") XCS("\xC3\xA4 \xC3\xB6 \xC3\xBC >");
-#endif
-
- run_character_check(text, expected);
- XML_ParserReset(g_parser, NULL);
- run_attribute_check(text, expected);
- /* Repeat with a default handler */
- XML_ParserReset(g_parser, NULL);
- XML_SetDefaultHandler(g_parser, dummy_default_handler);
- run_character_check(text, expected);
- XML_ParserReset(g_parser, NULL);
- XML_SetDefaultHandler(g_parser, dummy_default_handler);
- run_attribute_check(text, expected);
-}
-END_TEST
-
-/* Test that an element name with a 4-byte UTF-8 character is rejected */
-START_TEST(test_long_utf8_character) {
- const char *text
- = "<?xml version='1.0' encoding='utf-8'?>\n"
- /* 0xf0 0x90 0x80 0x80 = U+10000, the first Linear B character */
- "<do\xf0\x90\x80\x80/>";
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "4-byte UTF-8 character in element name not faulted");
-}
-END_TEST
-
-/* Test that a long latin-1 attribute (too long to convert in one go)
- * is correctly converted
- */
-START_TEST(test_long_latin1_attribute) {
- const char *text
- = "<?xml version='1.0' encoding='iso-8859-1'?>\n"
- "<doc att='"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- /* Last character splits across a buffer boundary */
- "\xe4'>\n</doc>";
-
- const XML_Char *expected =
- /* 64 characters per line */
- /* clang-format off */
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO")
- /* clang-format on */
-#ifdef XML_UNICODE
- XCS("\x00e4");
-#else
- XCS("\xc3\xa4");
-#endif
-
- run_attribute_check(text, expected);
-}
-END_TEST
-
-/* Test that a long ASCII attribute (too long to convert in one go)
- * is correctly converted
- */
-START_TEST(test_long_ascii_attribute) {
- const char *text
- = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<doc att='"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "01234'>\n</doc>";
- const XML_Char *expected =
- /* 64 characters per line */
- /* clang-format off */
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("01234");
- /* clang-format on */
-
- run_attribute_check(text, expected);
-}
-END_TEST
-
-/* Regression test #1 for SF bug #653180. */
-START_TEST(test_line_number_after_parse) {
- const char *text = "<tag>\n"
- "\n"
- "\n</tag>";
- XML_Size lineno;
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- lineno = XML_GetCurrentLineNumber(g_parser);
- if (lineno != 4) {
- char buffer[100];
- sprintf(buffer, "expected 4 lines, saw %" XML_FMT_INT_MOD "u", lineno);
- fail(buffer);
- }
-}
-END_TEST
-
-/* Regression test #2 for SF bug #653180. */
-START_TEST(test_column_number_after_parse) {
- const char *text = "<tag></tag>";
- XML_Size colno;
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- colno = XML_GetCurrentColumnNumber(g_parser);
- if (colno != 11) {
- char buffer[100];
- sprintf(buffer, "expected 11 columns, saw %" XML_FMT_INT_MOD "u", colno);
- fail(buffer);
- }
-}
-END_TEST
-
-#define STRUCT_START_TAG 0
-#define STRUCT_END_TAG 1
-static void XMLCALL
-start_element_event_handler2(void *userData, const XML_Char *name,
- const XML_Char **attr) {
- StructData *storage = (StructData *)userData;
- UNUSED_P(attr);
- StructData_AddItem(storage, name, XML_GetCurrentColumnNumber(g_parser),
- XML_GetCurrentLineNumber(g_parser), STRUCT_START_TAG);
-}
-
-static void XMLCALL
-end_element_event_handler2(void *userData, const XML_Char *name) {
- StructData *storage = (StructData *)userData;
- StructData_AddItem(storage, name, XML_GetCurrentColumnNumber(g_parser),
- XML_GetCurrentLineNumber(g_parser), STRUCT_END_TAG);
-}
-
-/* Regression test #3 for SF bug #653180. */
-START_TEST(test_line_and_column_numbers_inside_handlers) {
- const char *text = "<a>\n" /* Unix end-of-line */
- " <b>\r\n" /* Windows end-of-line */
- " <c/>\r" /* Mac OS end-of-line */
- " </b>\n"
- " <d>\n"
- " <f/>\n"
- " </d>\n"
- "</a>";
- const StructDataEntry expected[]
- = {{XCS("a"), 0, 1, STRUCT_START_TAG}, {XCS("b"), 2, 2, STRUCT_START_TAG},
- {XCS("c"), 4, 3, STRUCT_START_TAG}, {XCS("c"), 8, 3, STRUCT_END_TAG},
- {XCS("b"), 2, 4, STRUCT_END_TAG}, {XCS("d"), 2, 5, STRUCT_START_TAG},
- {XCS("f"), 4, 6, STRUCT_START_TAG}, {XCS("f"), 8, 6, STRUCT_END_TAG},
- {XCS("d"), 2, 7, STRUCT_END_TAG}, {XCS("a"), 0, 8, STRUCT_END_TAG}};
- const int expected_count = sizeof(expected) / sizeof(StructDataEntry);
- StructData storage;
-
- StructData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetStartElementHandler(g_parser, start_element_event_handler2);
- XML_SetEndElementHandler(g_parser, end_element_event_handler2);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-
- StructData_CheckItems(&storage, expected, expected_count);
- StructData_Dispose(&storage);
-}
-END_TEST
-
-/* Regression test #4 for SF bug #653180. */
-START_TEST(test_line_number_after_error) {
- const char *text = "<a>\n"
- " <b>\n"
- " </a>"; /* missing </b> */
- XML_Size lineno;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
- != XML_STATUS_ERROR)
- fail("Expected a parse error");
-
- lineno = XML_GetCurrentLineNumber(g_parser);
- if (lineno != 3) {
- char buffer[100];
- sprintf(buffer, "expected 3 lines, saw %" XML_FMT_INT_MOD "u", lineno);
- fail(buffer);
- }
-}
-END_TEST
-
-/* Regression test #5 for SF bug #653180. */
-START_TEST(test_column_number_after_error) {
- const char *text = "<a>\n"
- " <b>\n"
- " </a>"; /* missing </b> */
- XML_Size colno;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
- != XML_STATUS_ERROR)
- fail("Expected a parse error");
-
- colno = XML_GetCurrentColumnNumber(g_parser);
- if (colno != 4) {
- char buffer[100];
- sprintf(buffer, "expected 4 columns, saw %" XML_FMT_INT_MOD "u", colno);
- fail(buffer);
- }
-}
-END_TEST
-
-/* Regression test for SF bug #478332. */
-START_TEST(test_really_long_lines) {
- /* This parses an input line longer than INIT_DATA_BUF_SIZE
- characters long (defined to be 1024 in xmlparse.c). We take a
- really cheesy approach to building the input buffer, because
- this avoids writing bugs in buffer-filling code.
- */
- const char *text
- = "<e>"
- /* 64 chars */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- /* until we have at least 1024 characters on the line: */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "</e>";
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test cdata processing across a buffer boundary */
-START_TEST(test_really_long_encoded_lines) {
- /* As above, except that we want to provoke an output buffer
- * overflow with a non-trivial encoding. For this we need to pass
- * the whole cdata in one go, not byte-by-byte.
- */
- void *buffer;
- const char *text
- = "<?xml version='1.0' encoding='iso-8859-1'?>"
- "<e>"
- /* 64 chars */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- /* until we have at least 1024 characters on the line: */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
- "</e>";
- int parse_len = (int)strlen(text);
-
- /* Need a cdata handler to provoke the code path we want to test */
- XML_SetCharacterDataHandler(g_parser, dummy_cdata_handler);
- buffer = XML_GetBuffer(g_parser, parse_len);
- if (buffer == NULL)
- fail("Could not allocate parse buffer");
- assert(buffer != NULL);
- memcpy(buffer, text, parse_len);
- if (XML_ParseBuffer(g_parser, parse_len, XML_TRUE) == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/*
- * Element event tests.
- */
-
-static void XMLCALL
-start_element_event_handler(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- UNUSED_P(atts);
- CharData_AppendXMLChars((CharData *)userData, name, -1);
-}
-
-static void XMLCALL
-end_element_event_handler(void *userData, const XML_Char *name) {
- CharData *storage = (CharData *)userData;
- CharData_AppendXMLChars(storage, XCS("/"), 1);
- CharData_AppendXMLChars(storage, name, -1);
-}
-
-START_TEST(test_end_element_events) {
- const char *text = "<a><b><c/></b><d><f/></d></a>";
- const XML_Char *expected = XCS("/c/b/f/d/a");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetEndElementHandler(g_parser, end_element_event_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/*
- * Attribute tests.
- */
-
-/* Helpers used by the following test; this checks any "attr" and "refs"
- attributes to make sure whitespace has been normalized.
-
- Return true if whitespace has been normalized in a string, using
- the rules for attribute value normalization. The 'is_cdata' flag
- is needed since CDATA attributes don't need to have multiple
- whitespace characters collapsed to a single space, while other
- attribute data types do. (Section 3.3.3 of the recommendation.)
-*/
-static int
-is_whitespace_normalized(const XML_Char *s, int is_cdata) {
- int blanks = 0;
- int at_start = 1;
- while (*s) {
- if (*s == XCS(' '))
- ++blanks;
- else if (*s == XCS('\t') || *s == XCS('\n') || *s == XCS('\r'))
- return 0;
- else {
- if (at_start) {
- at_start = 0;
- if (blanks && ! is_cdata)
- /* illegal leading blanks */
- return 0;
- } else if (blanks > 1 && ! is_cdata)
- return 0;
- blanks = 0;
- }
- ++s;
- }
- if (blanks && ! is_cdata)
- return 0;
- return 1;
-}
-
-/* Check the attribute whitespace checker: */
-static void
-testhelper_is_whitespace_normalized(void) {
- assert(is_whitespace_normalized(XCS("abc"), 0));
- assert(is_whitespace_normalized(XCS("abc"), 1));
- assert(is_whitespace_normalized(XCS("abc def ghi"), 0));
- assert(is_whitespace_normalized(XCS("abc def ghi"), 1));
- assert(! is_whitespace_normalized(XCS(" abc def ghi"), 0));
- assert(is_whitespace_normalized(XCS(" abc def ghi"), 1));
- assert(! is_whitespace_normalized(XCS("abc def ghi"), 0));
- assert(is_whitespace_normalized(XCS("abc def ghi"), 1));
- assert(! is_whitespace_normalized(XCS("abc def ghi "), 0));
- assert(is_whitespace_normalized(XCS("abc def ghi "), 1));
- assert(! is_whitespace_normalized(XCS(" "), 0));
- assert(is_whitespace_normalized(XCS(" "), 1));
- assert(! is_whitespace_normalized(XCS("\t"), 0));
- assert(! is_whitespace_normalized(XCS("\t"), 1));
- assert(! is_whitespace_normalized(XCS("\n"), 0));
- assert(! is_whitespace_normalized(XCS("\n"), 1));
- assert(! is_whitespace_normalized(XCS("\r"), 0));
- assert(! is_whitespace_normalized(XCS("\r"), 1));
- assert(! is_whitespace_normalized(XCS("abc\t def"), 1));
-}
-
-static void XMLCALL
-check_attr_contains_normalized_whitespace(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- int i;
- UNUSED_P(userData);
- UNUSED_P(name);
- for (i = 0; atts[i] != NULL; i += 2) {
- const XML_Char *attrname = atts[i];
- const XML_Char *value = atts[i + 1];
- if (xcstrcmp(XCS("attr"), attrname) == 0
- || xcstrcmp(XCS("ents"), attrname) == 0
- || xcstrcmp(XCS("refs"), attrname) == 0) {
- if (! is_whitespace_normalized(value, 0)) {
- char buffer[256];
- sprintf(buffer,
- "attribute value not normalized: %" XML_FMT_STR
- "='%" XML_FMT_STR "'",
- attrname, value);
- fail(buffer);
- }
- }
- }
-}
-
-START_TEST(test_attr_whitespace_normalization) {
- const char *text
- = "<!DOCTYPE doc [\n"
- " <!ATTLIST doc\n"
- " attr NMTOKENS #REQUIRED\n"
- " ents ENTITIES #REQUIRED\n"
- " refs IDREFS #REQUIRED>\n"
- "]>\n"
- "<doc attr=' a b c\t\td\te\t' refs=' id-1 \t id-2\t\t' \n"
- " ents=' ent-1 \t\r\n"
- " ent-2 ' >\n"
- " <e id='id-1'/>\n"
- " <e id='id-2'/>\n"
- "</doc>";
-
- XML_SetStartElementHandler(g_parser,
- check_attr_contains_normalized_whitespace);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/*
- * XML declaration tests.
- */
-
-START_TEST(test_xmldecl_misplaced) {
- expect_failure("\n"
- "<?xml version='1.0'?>\n"
- "<a/>",
- XML_ERROR_MISPLACED_XML_PI,
- "failed to report misplaced XML declaration");
-}
-END_TEST
-
-START_TEST(test_xmldecl_invalid) {
- expect_failure("<?xml version='1.0' \xc3\xa7?>\n<doc/>", XML_ERROR_XML_DECL,
- "Failed to report invalid XML declaration");
-}
-END_TEST
-
-START_TEST(test_xmldecl_missing_attr) {
- expect_failure("<?xml ='1.0'?>\n<doc/>\n", XML_ERROR_XML_DECL,
- "Failed to report missing XML declaration attribute");
-}
-END_TEST
-
-START_TEST(test_xmldecl_missing_value) {
- expect_failure("<?xml version='1.0' encoding='us-ascii' standalone?>\n"
- "<doc/>",
- XML_ERROR_XML_DECL,
- "Failed to report missing attribute value");
-}
-END_TEST
-
-/* Regression test for SF bug #584832. */
-static int XMLCALL
-UnknownEncodingHandler(void *data, const XML_Char *encoding,
- XML_Encoding *info) {
- UNUSED_P(data);
- if (xcstrcmp(encoding, XCS("unsupported-encoding")) == 0) {
- int i;
- for (i = 0; i < 256; ++i)
- info->map[i] = i;
- info->data = NULL;
- info->convert = NULL;
- info->release = NULL;
- return XML_STATUS_OK;
- }
- return XML_STATUS_ERROR;
-}
-
-START_TEST(test_unknown_encoding_internal_entity) {
- const char *text = "<?xml version='1.0' encoding='unsupported-encoding'?>\n"
- "<!DOCTYPE test [<!ENTITY foo 'bar'>]>\n"
- "<test a='&foo;'/>";
-
- XML_SetUnknownEncodingHandler(g_parser, UnknownEncodingHandler, NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test unrecognised encoding handler */
-static void
-dummy_release(void *data) {
- UNUSED_P(data);
-}
-
-static int XMLCALL
-UnrecognisedEncodingHandler(void *data, const XML_Char *encoding,
- XML_Encoding *info) {
- UNUSED_P(data);
- UNUSED_P(encoding);
- info->data = NULL;
- info->convert = NULL;
- info->release = dummy_release;
- return XML_STATUS_ERROR;
-}
-
-START_TEST(test_unrecognised_encoding_internal_entity) {
- const char *text = "<?xml version='1.0' encoding='unsupported-encoding'?>\n"
- "<!DOCTYPE test [<!ENTITY foo 'bar'>]>\n"
- "<test a='&foo;'/>";
-
- XML_SetUnknownEncodingHandler(g_parser, UnrecognisedEncodingHandler, NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Unrecognised encoding not rejected");
-}
-END_TEST
-
-/* Regression test for SF bug #620106. */
-static int XMLCALL
-external_entity_loader(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- ExtTest *test_data = (ExtTest *)XML_GetUserData(parser);
- XML_Parser extparser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- extparser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (extparser == NULL)
- fail("Could not create external entity parser.");
- if (test_data->encoding != NULL) {
- if (! XML_SetEncoding(extparser, test_data->encoding))
- fail("XML_SetEncoding() ignored for external entity");
- }
- if (_XML_Parse_SINGLE_BYTES(extparser, test_data->parse_text,
- (int)strlen(test_data->parse_text), XML_TRUE)
- == XML_STATUS_ERROR) {
- xml_failure(extparser);
- return XML_STATUS_ERROR;
- }
- XML_ParserFree(extparser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ext_entity_set_encoding) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtTest test_data
- = {/* This text says it's an unsupported encoding, but it's really
- UTF-8, which we tell Expat using XML_SetEncoding().
- */
- "<?xml encoding='iso-8859-3'?>\xC3\xA9", XCS("utf-8"), NULL};
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00e9");
-#else
- const XML_Char *expected = XCS("\xc3\xa9");
-#endif
-
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- run_ext_character_check(text, &test_data, expected);
-}
-END_TEST
-
-/* Test external entities with no handler */
-START_TEST(test_ext_entity_no_handler) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
-
- XML_SetDefaultHandler(g_parser, dummy_default_handler);
- run_character_check(text, XCS(""));
-}
-END_TEST
-
-/* Test UTF-8 BOM is accepted */
-START_TEST(test_ext_entity_set_bom) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtTest test_data = {"\xEF\xBB\xBF" /* BOM */
- "<?xml encoding='iso-8859-3'?>"
- "\xC3\xA9",
- XCS("utf-8"), NULL};
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00e9");
-#else
- const XML_Char *expected = XCS("\xc3\xa9");
-#endif
-
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- run_ext_character_check(text, &test_data, expected);
-}
-END_TEST
-
-/* Test that bad encodings are faulted */
-typedef struct ext_faults {
- const char *parse_text;
- const char *fail_text;
- const XML_Char *encoding;
- enum XML_Error error;
-} ExtFaults;
-
-static int XMLCALL
-external_entity_faulter(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- XML_Parser ext_parser;
- ExtFaults *fault = (ExtFaults *)XML_GetUserData(parser);
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- if (fault->encoding != NULL) {
- if (! XML_SetEncoding(ext_parser, fault->encoding))
- fail("XML_SetEncoding failed");
- }
- if (_XML_Parse_SINGLE_BYTES(ext_parser, fault->parse_text,
- (int)strlen(fault->parse_text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail(fault->fail_text);
- if (XML_GetErrorCode(ext_parser) != fault->error)
- xml_failure(ext_parser);
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_ERROR;
-}
-
-START_TEST(test_ext_entity_bad_encoding) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtFaults fault
- = {"<?xml encoding='iso-8859-3'?>u", "Unsupported encoding not faulted",
- XCS("unknown"), XML_ERROR_UNKNOWN_ENCODING};
-
- XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
- XML_SetUserData(g_parser, &fault);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Bad encoding should not have been accepted");
-}
-END_TEST
-
-/* Try handing an invalid encoding to an external entity parser */
-START_TEST(test_ext_entity_bad_encoding_2) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
- ExtFaults fault
- = {"<!ELEMENT doc (#PCDATA)*>", "Unknown encoding not faulted",
- XCS("unknown-encoding"), XML_ERROR_UNKNOWN_ENCODING};
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
- XML_SetUserData(g_parser, &fault);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Bad encoding not faulted in external entity handler");
-}
-END_TEST
-
-/* Test that no error is reported for unknown entities if we don't
- read an external subset. This was fixed in Expat 1.95.5.
-*/
-START_TEST(test_wfc_undeclared_entity_unread_external_subset) {
- const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test that an error is reported for unknown entities if we don't
- have an external subset.
-*/
-START_TEST(test_wfc_undeclared_entity_no_external_subset) {
- expect_failure("<doc>&entity;</doc>", XML_ERROR_UNDEFINED_ENTITY,
- "Parser did not report undefined entity w/out a DTD.");
-}
-END_TEST
-
-/* Test that an error is reported for unknown entities if we don't
- read an external subset, but have been declared standalone.
-*/
-START_TEST(test_wfc_undeclared_entity_standalone) {
- const char *text
- = "<?xml version='1.0' encoding='us-ascii' standalone='yes'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
-
- expect_failure(text, XML_ERROR_UNDEFINED_ENTITY,
- "Parser did not report undefined entity (standalone).");
-}
-END_TEST
-
-/* Test that an error is reported for unknown entities if we have read
- an external subset, and standalone is true.
-*/
-START_TEST(test_wfc_undeclared_entity_with_external_subset_standalone) {
- const char *text
- = "<?xml version='1.0' encoding='us-ascii' standalone='yes'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
- ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &test_data);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- expect_failure(text, XML_ERROR_UNDEFINED_ENTITY,
- "Parser did not report undefined entity (external DTD).");
-}
-END_TEST
-
-/* Test that external entity handling is not done if the parsing flag
- * is set to UNLESS_STANDALONE
- */
-START_TEST(test_entity_with_external_subset_unless_standalone) {
- const char *text
- = "<?xml version='1.0' encoding='us-ascii' standalone='yes'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
- ExtTest test_data = {"<!ENTITY entity 'bar'>", NULL, NULL};
-
- XML_SetParamEntityParsing(g_parser,
- XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE);
- XML_SetUserData(g_parser, &test_data);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- expect_failure(text, XML_ERROR_UNDEFINED_ENTITY,
- "Parser did not report undefined entity");
-}
-END_TEST
-
-/* Test that no error is reported for unknown entities if we have read
- an external subset, and standalone is false.
-*/
-START_TEST(test_wfc_undeclared_entity_with_external_subset) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
- ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- run_ext_character_check(text, &test_data, XCS(""));
-}
-END_TEST
-
-/* Test that an error is reported if our NotStandalone handler fails */
-static int XMLCALL
-reject_not_standalone_handler(void *userData) {
- UNUSED_P(userData);
- return XML_STATUS_ERROR;
-}
-
-START_TEST(test_not_standalone_handler_reject) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
- ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &test_data);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- XML_SetNotStandaloneHandler(g_parser, reject_not_standalone_handler);
- expect_failure(text, XML_ERROR_NOT_STANDALONE,
- "NotStandalone handler failed to reject");
-
- /* Try again but without external entity handling */
- XML_ParserReset(g_parser, NULL);
- XML_SetNotStandaloneHandler(g_parser, reject_not_standalone_handler);
- expect_failure(text, XML_ERROR_NOT_STANDALONE,
- "NotStandalone handler failed to reject");
-}
-END_TEST
-
-/* Test that no error is reported if our NotStandalone handler succeeds */
-static int XMLCALL
-accept_not_standalone_handler(void *userData) {
- UNUSED_P(userData);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_not_standalone_handler_accept) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
- ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- XML_SetNotStandaloneHandler(g_parser, accept_not_standalone_handler);
- run_ext_character_check(text, &test_data, XCS(""));
-
- /* Repeat wtihout the external entity handler */
- XML_ParserReset(g_parser, NULL);
- XML_SetNotStandaloneHandler(g_parser, accept_not_standalone_handler);
- run_character_check(text, XCS(""));
-}
-END_TEST
-
-START_TEST(test_wfc_no_recursive_entity_refs) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY entity '&#38;entity;'>\n"
- "]>\n"
- "<doc>&entity;</doc>";
-
- expect_failure(text, XML_ERROR_RECURSIVE_ENTITY_REF,
- "Parser did not report recursive entity reference.");
-}
-END_TEST
-
-/* Test incomplete external entities are faulted */
-START_TEST(test_ext_entity_invalid_parse) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- const ExtFaults faults[]
- = {{"<", "Incomplete element declaration not faulted", NULL,
- XML_ERROR_UNCLOSED_TOKEN},
- {"<\xe2\x82", /* First two bytes of a three-byte char */
- "Incomplete character not faulted", NULL, XML_ERROR_PARTIAL_CHAR},
- {"<tag>\xe2\x82", "Incomplete character in CDATA not faulted", NULL,
- XML_ERROR_PARTIAL_CHAR},
- {NULL, NULL, NULL, XML_ERROR_NONE}};
- const ExtFaults *fault = faults;
-
- for (; fault->parse_text != NULL; fault++) {
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
- XML_SetUserData(g_parser, (void *)fault);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Parser did not report external entity error");
- XML_ParserReset(g_parser, NULL);
- }
-}
-END_TEST
-
-/* Regression test for SF bug #483514. */
-START_TEST(test_dtd_default_handling) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ENTITY e SYSTEM 'http://example.org/e'>\n"
- "<!NOTATION n SYSTEM 'http://example.org/n'>\n"
- "<!ELEMENT doc EMPTY>\n"
- "<!ATTLIST doc a CDATA #IMPLIED>\n"
- "<?pi in dtd?>\n"
- "<!--comment in dtd-->\n"
- "]><doc/>";
-
- XML_SetDefaultHandler(g_parser, accumulate_characters);
- XML_SetStartDoctypeDeclHandler(g_parser, dummy_start_doctype_handler);
- XML_SetEndDoctypeDeclHandler(g_parser, dummy_end_doctype_handler);
- XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
- XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
- XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
- XML_SetCommentHandler(g_parser, dummy_comment_handler);
- XML_SetStartCdataSectionHandler(g_parser, dummy_start_cdata_handler);
- XML_SetEndCdataSectionHandler(g_parser, dummy_end_cdata_handler);
- run_character_check(text, XCS("\n\n\n\n\n\n\n<doc/>"));
-}
-END_TEST
-
-/* Test handling of attribute declarations */
-typedef struct AttTest {
- const char *definition;
- const XML_Char *element_name;
- const XML_Char *attr_name;
- const XML_Char *attr_type;
- const XML_Char *default_value;
- int is_required;
-} AttTest;
-
-static void XMLCALL
-verify_attlist_decl_handler(void *userData, const XML_Char *element_name,
- const XML_Char *attr_name,
- const XML_Char *attr_type,
- const XML_Char *default_value, int is_required) {
- AttTest *at = (AttTest *)userData;
-
- if (xcstrcmp(element_name, at->element_name))
- fail("Unexpected element name in attribute declaration");
- if (xcstrcmp(attr_name, at->attr_name))
- fail("Unexpected attribute name in attribute declaration");
- if (xcstrcmp(attr_type, at->attr_type))
- fail("Unexpected attribute type in attribute declaration");
- if ((default_value == NULL && at->default_value != NULL)
- || (default_value != NULL && at->default_value == NULL)
- || (default_value != NULL && xcstrcmp(default_value, at->default_value)))
- fail("Unexpected default value in attribute declaration");
- if (is_required != at->is_required)
- fail("Requirement mismatch in attribute declaration");
-}
-
-START_TEST(test_dtd_attr_handling) {
- const char *prolog = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc EMPTY>\n";
- AttTest attr_data[]
- = {{"<!ATTLIST doc a ( one | two | three ) #REQUIRED>\n"
- "]>"
- "<doc a='two'/>",
- XCS("doc"), XCS("a"),
- XCS("(one|two|three)"), /* Extraneous spaces will be removed */
- NULL, XML_TRUE},
- {"<!NOTATION foo SYSTEM 'http://example.org/foo'>\n"
- "<!ATTLIST doc a NOTATION (foo) #IMPLIED>\n"
- "]>"
- "<doc/>",
- XCS("doc"), XCS("a"), XCS("NOTATION(foo)"), NULL, XML_FALSE},
- {"<!ATTLIST doc a NOTATION (foo) 'bar'>\n"
- "]>"
- "<doc/>",
- XCS("doc"), XCS("a"), XCS("NOTATION(foo)"), XCS("bar"), XML_FALSE},
- {"<!ATTLIST doc a CDATA '\xdb\xb2'>\n"
- "]>"
- "<doc/>",
- XCS("doc"), XCS("a"), XCS("CDATA"),
-#ifdef XML_UNICODE
- XCS("\x06f2"),
-#else
- XCS("\xdb\xb2"),
-#endif
- XML_FALSE},
- {NULL, NULL, NULL, NULL, NULL, XML_FALSE}};
- AttTest *test;
-
- for (test = attr_data; test->definition != NULL; test++) {
- XML_SetAttlistDeclHandler(g_parser, verify_attlist_decl_handler);
- XML_SetUserData(g_parser, test);
- if (_XML_Parse_SINGLE_BYTES(g_parser, prolog, (int)strlen(prolog),
- XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (_XML_Parse_SINGLE_BYTES(g_parser, test->definition,
- (int)strlen(test->definition), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- XML_ParserReset(g_parser, NULL);
- }
-}
-END_TEST
-
-/* See related SF bug #673791.
- When namespace processing is enabled, setting the namespace URI for
- a prefix is not allowed; this test ensures that it *is* allowed
- when namespace processing is not enabled.
- (See Namespaces in XML, section 2.)
-*/
-START_TEST(test_empty_ns_without_namespaces) {
- const char *text = "<doc xmlns:prefix='http://example.org/'>\n"
- " <e xmlns:prefix=''/>\n"
- "</doc>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Regression test for SF bug #824420.
- Checks that an xmlns:prefix attribute set in an attribute's default
- value isn't misinterpreted.
-*/
-START_TEST(test_ns_in_attribute_default_without_namespaces) {
- const char *text = "<!DOCTYPE e:element [\n"
- " <!ATTLIST e:element\n"
- " xmlns:e CDATA 'http://example.org/'>\n"
- " ]>\n"
- "<e:element/>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-static const char *long_character_data_text
- = "<?xml version='1.0' encoding='iso-8859-1'?><s>"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "</s>";
-
-static XML_Bool resumable = XML_FALSE;
-
-static void
-clearing_aborting_character_handler(void *userData, const XML_Char *s,
- int len) {
- UNUSED_P(userData);
- UNUSED_P(s);
- UNUSED_P(len);
- XML_StopParser(g_parser, resumable);
- XML_SetCharacterDataHandler(g_parser, NULL);
-}
-
-/* Regression test for SF bug #1515266: missing check of stopped
- parser in doContext() 'for' loop. */
-START_TEST(test_stop_parser_between_char_data_calls) {
- /* The sample data must be big enough that there are two calls to
- the character data handler from within the inner "for" loop of
- the XML_TOK_DATA_CHARS case in doContent(), and the character
- handler must stop the parser and clear the character data
- handler.
- */
- const char *text = long_character_data_text;
-
- XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
- resumable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (XML_GetErrorCode(g_parser) != XML_ERROR_ABORTED)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Regression test for SF bug #1515266: missing check of stopped
- parser in doContext() 'for' loop. */
-START_TEST(test_suspend_parser_between_char_data_calls) {
- /* The sample data must be big enough that there are two calls to
- the character data handler from within the inner "for" loop of
- the XML_TOK_DATA_CHARS case in doContent(), and the character
- handler must stop the parser and clear the character data
- handler.
- */
- const char *text = long_character_data_text;
-
- XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
- resumable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_SUSPENDED)
- xml_failure(g_parser);
- if (XML_GetErrorCode(g_parser) != XML_ERROR_NONE)
- xml_failure(g_parser);
- /* Try parsing directly */
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Attempt to continue parse while suspended not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_SUSPENDED)
- fail("Suspended parse not faulted with correct error");
-}
-END_TEST
-
-static XML_Bool abortable = XML_FALSE;
-
-static void
-parser_stop_character_handler(void *userData, const XML_Char *s, int len) {
- UNUSED_P(userData);
- UNUSED_P(s);
- UNUSED_P(len);
- XML_StopParser(g_parser, resumable);
- XML_SetCharacterDataHandler(g_parser, NULL);
- if (! resumable) {
- /* Check that aborting an aborted parser is faulted */
- if (XML_StopParser(g_parser, XML_FALSE) != XML_STATUS_ERROR)
- fail("Aborting aborted parser not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_FINISHED)
- xml_failure(g_parser);
- } else if (abortable) {
- /* Check that aborting a suspended parser works */
- if (XML_StopParser(g_parser, XML_FALSE) == XML_STATUS_ERROR)
- xml_failure(g_parser);
- } else {
- /* Check that suspending a suspended parser works */
- if (XML_StopParser(g_parser, XML_TRUE) != XML_STATUS_ERROR)
- fail("Suspending suspended parser not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_SUSPENDED)
- xml_failure(g_parser);
- }
-}
-
-/* Test repeated calls to XML_StopParser are handled correctly */
-START_TEST(test_repeated_stop_parser_between_char_data_calls) {
- const char *text = long_character_data_text;
-
- XML_SetCharacterDataHandler(g_parser, parser_stop_character_handler);
- resumable = XML_FALSE;
- abortable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Failed to double-stop parser");
-
- XML_ParserReset(g_parser, NULL);
- XML_SetCharacterDataHandler(g_parser, parser_stop_character_handler);
- resumable = XML_TRUE;
- abortable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_SUSPENDED)
- fail("Failed to double-suspend parser");
-
- XML_ParserReset(g_parser, NULL);
- XML_SetCharacterDataHandler(g_parser, parser_stop_character_handler);
- resumable = XML_TRUE;
- abortable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Failed to suspend-abort parser");
-}
-END_TEST
-
-START_TEST(test_good_cdata_ascii) {
- const char *text = "<a><![CDATA[<greeting>Hello, world!</greeting>]]></a>";
- const XML_Char *expected = XCS("<greeting>Hello, world!</greeting>");
-
- CharData storage;
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
- /* Add start and end handlers for coverage */
- XML_SetStartCdataSectionHandler(g_parser, dummy_start_cdata_handler);
- XML_SetEndCdataSectionHandler(g_parser, dummy_end_cdata_handler);
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-
- /* Try again, this time with a default handler */
- XML_ParserReset(g_parser, NULL);
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
- XML_SetDefaultHandler(g_parser, dummy_default_handler);
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_good_cdata_utf16) {
- /* Test data is:
- * <?xml version='1.0' encoding='utf-16'?>
- * <a><![CDATA[hello]]></a>
- */
- const char text[]
- = "\0<\0?\0x\0m\0l\0"
- " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
- " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
- "1\0"
- "6\0'"
- "\0?\0>\0\n"
- "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0[\0h\0e\0l\0l\0o\0]\0]\0>\0<\0/\0a\0>";
- const XML_Char *expected = XCS("hello");
-
- CharData storage;
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_good_cdata_utf16_le) {
- /* Test data is:
- * <?xml version='1.0' encoding='utf-16'?>
- * <a><![CDATA[hello]]></a>
- */
- const char text[]
- = "<\0?\0x\0m\0l\0"
- " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
- " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
- "1\0"
- "6\0'"
- "\0?\0>\0\n"
- "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0[\0h\0e\0l\0l\0o\0]\0]\0>\0<\0/\0a\0>\0";
- const XML_Char *expected = XCS("hello");
-
- CharData storage;
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test UTF16 conversion of a long cdata string */
-
-/* 16 characters: handy macro to reduce visual clutter */
-#define A_TO_P_IN_UTF16 "\0A\0B\0C\0D\0E\0F\0G\0H\0I\0J\0K\0L\0M\0N\0O\0P"
-
-START_TEST(test_long_cdata_utf16) {
- /* Test data is:
- * <?xlm version='1.0' encoding='utf-16'?>
- * <a><![CDATA[
- * ABCDEFGHIJKLMNOP
- * ]]></a>
- */
- const char text[]
- = "\0<\0?\0x\0m\0l\0 "
- "\0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0 "
- "\0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0\x31\0\x36\0'\0?\0>"
- "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0["
- /* 64 characters per line */
- /* clang-format off */
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16 A_TO_P_IN_UTF16
- A_TO_P_IN_UTF16
- /* clang-format on */
- "\0]\0]\0>\0<\0/\0a\0>";
- const XML_Char *expected =
- /* clang-format off */
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP")
- XCS("ABCDEFGHIJKLMNOP");
- /* clang-format on */
- CharData storage;
- void *buffer;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
- buffer = XML_GetBuffer(g_parser, sizeof(text) - 1);
- if (buffer == NULL)
- fail("Could not allocate parse buffer");
- assert(buffer != NULL);
- memcpy(buffer, text, sizeof(text) - 1);
- if (XML_ParseBuffer(g_parser, sizeof(text) - 1, XML_TRUE) == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test handling of multiple unit UTF-16 characters */
-#ifndef XML_MIN_SIZE /* FIXME workaround -DXML_MIN_SIZE + ASan (issue #332) */
-START_TEST(test_multichar_cdata_utf16) {
- /* Test data is:
- * <?xml version='1.0' encoding='utf-16'?>
- * <a><![CDATA[{MINIM}{CROTCHET}]]></a>
- *
- * where {MINIM} is U+1d15e (a minim or half-note)
- * UTF-16: 0xd834 0xdd5e
- * UTF-8: 0xf0 0x9d 0x85 0x9e
- * and {CROTCHET} is U+1d15f (a crotchet or quarter-note)
- * UTF-16: 0xd834 0xdd5f
- * UTF-8: 0xf0 0x9d 0x85 0x9f
- */
- const char text[] = "\0<\0?\0x\0m\0l\0"
- " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
- " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
- "1\0"
- "6\0'"
- "\0?\0>\0\n"
- "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0["
- "\xd8\x34\xdd\x5e\xd8\x34\xdd\x5f"
- "\0]\0]\0>\0<\0/\0a\0>";
-# ifdef XML_UNICODE
- const XML_Char *expected = XCS("\xd834\xdd5e\xd834\xdd5f");
-# else
- const XML_Char *expected = XCS("\xf0\x9d\x85\x9e\xf0\x9d\x85\x9f");
-# endif
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-#endif /* ifndef XML_MIN_SIZE */
-
-/* Test that an element name with a UTF-16 surrogate pair is rejected */
-START_TEST(test_utf16_bad_surrogate_pair) {
- /* Test data is:
- * <?xml version='1.0' encoding='utf-16'?>
- * <a><![CDATA[{BADLINB}]]></a>
- *
- * where {BADLINB} is U+10000 (the first Linear B character)
- * with the UTF-16 surrogate pair in the wrong order, i.e.
- * 0xdc00 0xd800
- */
- const char text[] = "\0<\0?\0x\0m\0l\0"
- " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
- " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
- "1\0"
- "6\0'"
- "\0?\0>\0\n"
- "\0<\0a\0>\0<\0!\0[\0C\0D\0A\0T\0A\0["
- "\xdc\x00\xd8\x00"
- "\0]\0]\0>\0<\0/\0a\0>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Reversed UTF-16 surrogate pair not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_bad_cdata) {
- struct CaseData {
- const char *text;
- enum XML_Error expectedError;
- };
-
- struct CaseData cases[]
- = {{"<a><", XML_ERROR_UNCLOSED_TOKEN},
- {"<a><!", XML_ERROR_UNCLOSED_TOKEN},
- {"<a><![", XML_ERROR_UNCLOSED_TOKEN},
- {"<a><![C", XML_ERROR_UNCLOSED_TOKEN},
- {"<a><![CD", XML_ERROR_UNCLOSED_TOKEN},
- {"<a><![CDA", XML_ERROR_UNCLOSED_TOKEN},
- {"<a><![CDAT", XML_ERROR_UNCLOSED_TOKEN},
- {"<a><![CDATA", XML_ERROR_UNCLOSED_TOKEN},
-
- {"<a><![CDATA[", XML_ERROR_UNCLOSED_CDATA_SECTION},
- {"<a><![CDATA[]", XML_ERROR_UNCLOSED_CDATA_SECTION},
- {"<a><![CDATA[]]", XML_ERROR_UNCLOSED_CDATA_SECTION},
-
- {"<a><!<a/>", XML_ERROR_INVALID_TOKEN},
- {"<a><![<a/>", XML_ERROR_UNCLOSED_TOKEN}, /* ?! */
- {"<a><![C<a/>", XML_ERROR_UNCLOSED_TOKEN}, /* ?! */
- {"<a><![CD<a/>", XML_ERROR_INVALID_TOKEN},
- {"<a><![CDA<a/>", XML_ERROR_INVALID_TOKEN},
- {"<a><![CDAT<a/>", XML_ERROR_INVALID_TOKEN},
- {"<a><![CDATA<a/>", XML_ERROR_INVALID_TOKEN},
-
- {"<a><![CDATA[<a/>", XML_ERROR_UNCLOSED_CDATA_SECTION},
- {"<a><![CDATA[]<a/>", XML_ERROR_UNCLOSED_CDATA_SECTION},
- {"<a><![CDATA[]]<a/>", XML_ERROR_UNCLOSED_CDATA_SECTION}};
-
- size_t i = 0;
- for (; i < sizeof(cases) / sizeof(struct CaseData); i++) {
- const enum XML_Status actualStatus = _XML_Parse_SINGLE_BYTES(
- g_parser, cases[i].text, (int)strlen(cases[i].text), XML_TRUE);
- const enum XML_Error actualError = XML_GetErrorCode(g_parser);
-
- assert(actualStatus == XML_STATUS_ERROR);
-
- if (actualError != cases[i].expectedError) {
- char message[100];
- sprintf(message,
- "Expected error %d but got error %d for case %u: \"%s\"\n",
- cases[i].expectedError, actualError, (unsigned int)i + 1,
- cases[i].text);
- fail(message);
- }
-
- XML_ParserReset(g_parser, NULL);
- }
-}
-END_TEST
-
-/* Test failures in UTF-16 CDATA */
-#ifndef XML_MIN_SIZE /* FIXME workaround -DXML_MIN_SIZE + ASan (issue #332) */
-START_TEST(test_bad_cdata_utf16) {
- struct CaseData {
- size_t text_bytes;
- const char *text;
- enum XML_Error expected_error;
- };
-
- const char prolog[] = "\0<\0?\0x\0m\0l\0"
- " \0v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0"
- " \0e\0n\0c\0o\0d\0i\0n\0g\0=\0'\0u\0t\0f\0-\0"
- "1\0"
- "6\0'"
- "\0?\0>\0\n"
- "\0<\0a\0>";
- struct CaseData cases[] = {
- {1, "\0", XML_ERROR_UNCLOSED_TOKEN},
- {2, "\0<", XML_ERROR_UNCLOSED_TOKEN},
- {3, "\0<\0", XML_ERROR_UNCLOSED_TOKEN},
- {4, "\0<\0!", XML_ERROR_UNCLOSED_TOKEN},
- {5, "\0<\0!\0", XML_ERROR_UNCLOSED_TOKEN},
- {6, "\0<\0!\0[", XML_ERROR_UNCLOSED_TOKEN},
- {7, "\0<\0!\0[\0", XML_ERROR_UNCLOSED_TOKEN},
- {8, "\0<\0!\0[\0C", XML_ERROR_UNCLOSED_TOKEN},
- {9, "\0<\0!\0[\0C\0", XML_ERROR_UNCLOSED_TOKEN},
- {10, "\0<\0!\0[\0C\0D", XML_ERROR_UNCLOSED_TOKEN},
- {11, "\0<\0!\0[\0C\0D\0", XML_ERROR_UNCLOSED_TOKEN},
- {12, "\0<\0!\0[\0C\0D\0A", XML_ERROR_UNCLOSED_TOKEN},
- {13, "\0<\0!\0[\0C\0D\0A\0", XML_ERROR_UNCLOSED_TOKEN},
- {14, "\0<\0!\0[\0C\0D\0A\0T", XML_ERROR_UNCLOSED_TOKEN},
- {15, "\0<\0!\0[\0C\0D\0A\0T\0", XML_ERROR_UNCLOSED_TOKEN},
- {16, "\0<\0!\0[\0C\0D\0A\0T\0A", XML_ERROR_UNCLOSED_TOKEN},
- {17, "\0<\0!\0[\0C\0D\0A\0T\0A\0", XML_ERROR_UNCLOSED_TOKEN},
- {18, "\0<\0!\0[\0C\0D\0A\0T\0A\0[", XML_ERROR_UNCLOSED_CDATA_SECTION},
- {19, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0", XML_ERROR_UNCLOSED_CDATA_SECTION},
- {20, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z", XML_ERROR_UNCLOSED_CDATA_SECTION},
- /* Now add a four-byte UTF-16 character */
- {21, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z\xd8",
- XML_ERROR_UNCLOSED_CDATA_SECTION},
- {22, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z\xd8\x34", XML_ERROR_PARTIAL_CHAR},
- {23, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z\xd8\x34\xdd",
- XML_ERROR_PARTIAL_CHAR},
- {24, "\0<\0!\0[\0C\0D\0A\0T\0A\0[\0Z\xd8\x34\xdd\x5e",
- XML_ERROR_UNCLOSED_CDATA_SECTION}};
- size_t i;
-
- for (i = 0; i < sizeof(cases) / sizeof(struct CaseData); i++) {
- enum XML_Status actual_status;
- enum XML_Error actual_error;
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, prolog, (int)sizeof(prolog) - 1,
- XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- actual_status = _XML_Parse_SINGLE_BYTES(g_parser, cases[i].text,
- (int)cases[i].text_bytes, XML_TRUE);
- assert(actual_status == XML_STATUS_ERROR);
- actual_error = XML_GetErrorCode(g_parser);
- if (actual_error != cases[i].expected_error) {
- char message[1024];
-
- sprintf(message,
- "Expected error %d (%" XML_FMT_STR "), got %d (%" XML_FMT_STR
- ") for case %lu\n",
- cases[i].expected_error, XML_ErrorString(cases[i].expected_error),
- actual_error, XML_ErrorString(actual_error),
- (long unsigned)(i + 1));
- fail(message);
- }
- XML_ParserReset(g_parser, NULL);
- }
-}
-END_TEST
-#endif /* ifndef XML_MIN_SIZE */
-
-static const char *long_cdata_text
- = "<s><![CDATA["
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "]]></s>";
-
-/* Test stopping the parser in cdata handler */
-START_TEST(test_stop_parser_between_cdata_calls) {
- const char *text = long_cdata_text;
-
- XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
- resumable = XML_FALSE;
- expect_failure(text, XML_ERROR_ABORTED, "Parse not aborted in CDATA handler");
-}
-END_TEST
-
-/* Test suspending the parser in cdata handler */
-START_TEST(test_suspend_parser_between_cdata_calls) {
- const char *text = long_cdata_text;
- enum XML_Status result;
-
- XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
- resumable = XML_TRUE;
- result = _XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE);
- if (result != XML_STATUS_SUSPENDED) {
- if (result == XML_STATUS_ERROR)
- xml_failure(g_parser);
- fail("Parse not suspended in CDATA handler");
- }
- if (XML_GetErrorCode(g_parser) != XML_ERROR_NONE)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test memory allocation functions */
-START_TEST(test_memory_allocation) {
- char *buffer = (char *)XML_MemMalloc(g_parser, 256);
- char *p;
-
- if (buffer == NULL) {
- fail("Allocation failed");
- } else {
- /* Try writing to memory; some OSes try to cheat! */
- buffer[0] = 'T';
- buffer[1] = 'E';
- buffer[2] = 'S';
- buffer[3] = 'T';
- buffer[4] = '\0';
- if (strcmp(buffer, "TEST") != 0) {
- fail("Memory not writable");
- } else {
- p = (char *)XML_MemRealloc(g_parser, buffer, 512);
- if (p == NULL) {
- fail("Reallocation failed");
- } else {
- /* Write again, just to be sure */
- buffer = p;
- buffer[0] = 'V';
- if (strcmp(buffer, "VEST") != 0) {
- fail("Reallocated memory not writable");
- }
- }
- }
- XML_MemFree(g_parser, buffer);
- }
-}
-END_TEST
-
-static void XMLCALL
-record_default_handler(void *userData, const XML_Char *s, int len) {
- UNUSED_P(s);
- UNUSED_P(len);
- CharData_AppendXMLChars((CharData *)userData, XCS("D"), 1);
-}
-
-static void XMLCALL
-record_cdata_handler(void *userData, const XML_Char *s, int len) {
- UNUSED_P(s);
- UNUSED_P(len);
- CharData_AppendXMLChars((CharData *)userData, XCS("C"), 1);
- XML_DefaultCurrent(g_parser);
-}
-
-static void XMLCALL
-record_cdata_nodefault_handler(void *userData, const XML_Char *s, int len) {
- UNUSED_P(s);
- UNUSED_P(len);
- CharData_AppendXMLChars((CharData *)userData, XCS("c"), 1);
-}
-
-static void XMLCALL
-record_skip_handler(void *userData, const XML_Char *entityName,
- int is_parameter_entity) {
- UNUSED_P(entityName);
- CharData_AppendXMLChars((CharData *)userData,
- is_parameter_entity ? XCS("E") : XCS("e"), 1);
-}
-
-/* Test XML_DefaultCurrent() passes handling on correctly */
-START_TEST(test_default_current) {
- const char *text = "<doc>hell]</doc>";
- const char *entity_text = "<!DOCTYPE doc [\n"
- "<!ENTITY entity '&#37;'>\n"
- "]>\n"
- "<doc>&entity;</doc>";
- CharData storage;
-
- XML_SetDefaultHandler(g_parser, record_default_handler);
- XML_SetCharacterDataHandler(g_parser, record_cdata_handler);
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, XCS("DCDCDCDCDCDD"));
-
- /* Again, without the defaulting */
- XML_ParserReset(g_parser, NULL);
- XML_SetDefaultHandler(g_parser, record_default_handler);
- XML_SetCharacterDataHandler(g_parser, record_cdata_nodefault_handler);
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, XCS("DcccccD"));
-
- /* Now with an internal entity to complicate matters */
- XML_ParserReset(g_parser, NULL);
- XML_SetDefaultHandler(g_parser, record_default_handler);
- XML_SetCharacterDataHandler(g_parser, record_cdata_handler);
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, entity_text, (int)strlen(entity_text),
- XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- /* The default handler suppresses the entity */
- CharData_CheckXMLChars(&storage, XCS("DDDDDDDDDDDDDDDDDDD"));
-
- /* Again, with a skip handler */
- XML_ParserReset(g_parser, NULL);
- XML_SetDefaultHandler(g_parser, record_default_handler);
- XML_SetCharacterDataHandler(g_parser, record_cdata_handler);
- XML_SetSkippedEntityHandler(g_parser, record_skip_handler);
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, entity_text, (int)strlen(entity_text),
- XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- /* The default handler suppresses the entity */
- CharData_CheckXMLChars(&storage, XCS("DDDDDDDDDDDDDDDDDeD"));
-
- /* This time, allow the entity through */
- XML_ParserReset(g_parser, NULL);
- XML_SetDefaultHandlerExpand(g_parser, record_default_handler);
- XML_SetCharacterDataHandler(g_parser, record_cdata_handler);
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, entity_text, (int)strlen(entity_text),
- XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, XCS("DDDDDDDDDDDDDDDDDCDD"));
-
- /* Finally, without passing the cdata to the default handler */
- XML_ParserReset(g_parser, NULL);
- XML_SetDefaultHandlerExpand(g_parser, record_default_handler);
- XML_SetCharacterDataHandler(g_parser, record_cdata_nodefault_handler);
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, entity_text, (int)strlen(entity_text),
- XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, XCS("DDDDDDDDDDDDDDDDDcD"));
-}
-END_TEST
-
-/* Test DTD element parsing code paths */
-START_TEST(test_dtd_elements) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc (chapter)>\n"
- "<!ELEMENT chapter (#PCDATA)>\n"
- "]>\n"
- "<doc><chapter>Wombats are go</chapter></doc>";
-
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test foreign DTD handling */
-START_TEST(test_set_foreign_dtd) {
- const char *text1 = "<?xml version='1.0' encoding='us-ascii'?>\n";
- const char *text2 = "<doc>&entity;</doc>";
- ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
-
- /* Check hash salt is passed through too */
- XML_SetHashSalt(g_parser, 0x12345678);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &test_data);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- /* Add a default handler to exercise more code paths */
- XML_SetDefaultHandler(g_parser, dummy_default_handler);
- if (XML_UseForeignDTD(g_parser, XML_TRUE) != XML_ERROR_NONE)
- fail("Could not set foreign DTD");
- if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-
- /* Ensure that trying to set the DTD after parsing has started
- * is faulted, even if it's the same setting.
- */
- if (XML_UseForeignDTD(g_parser, XML_TRUE)
- != XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING)
- fail("Failed to reject late foreign DTD setting");
- /* Ditto for the hash salt */
- if (XML_SetHashSalt(g_parser, 0x23456789))
- fail("Failed to reject late hash salt change");
-
- /* Now finish the parse */
- if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test foreign DTD handling with a failing NotStandalone handler */
-START_TEST(test_foreign_dtd_not_standalone) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<doc>&entity;</doc>";
- ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &test_data);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- XML_SetNotStandaloneHandler(g_parser, reject_not_standalone_handler);
- if (XML_UseForeignDTD(g_parser, XML_TRUE) != XML_ERROR_NONE)
- fail("Could not set foreign DTD");
- expect_failure(text, XML_ERROR_NOT_STANDALONE,
- "NotStandalonehandler failed to reject");
-}
-END_TEST
-
-/* Test invalid character in a foreign DTD is faulted */
-START_TEST(test_invalid_foreign_dtd) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<doc>&entity;</doc>";
- ExtFaults test_data
- = {"$", "Dollar not faulted", NULL, XML_ERROR_INVALID_TOKEN};
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &test_data);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
- XML_UseForeignDTD(g_parser, XML_TRUE);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Bad DTD should not have been accepted");
-}
-END_TEST
-
-/* Test foreign DTD use with a doctype */
-START_TEST(test_foreign_dtd_with_doctype) {
- const char *text1 = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc [<!ENTITY entity 'hello world'>]>\n";
- const char *text2 = "<doc>&entity;</doc>";
- ExtTest test_data = {"<!ELEMENT doc (#PCDATA)*>", NULL, NULL};
-
- /* Check hash salt is passed through too */
- XML_SetHashSalt(g_parser, 0x12345678);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &test_data);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- /* Add a default handler to exercise more code paths */
- XML_SetDefaultHandler(g_parser, dummy_default_handler);
- if (XML_UseForeignDTD(g_parser, XML_TRUE) != XML_ERROR_NONE)
- fail("Could not set foreign DTD");
- if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-
- /* Ensure that trying to set the DTD after parsing has started
- * is faulted, even if it's the same setting.
- */
- if (XML_UseForeignDTD(g_parser, XML_TRUE)
- != XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING)
- fail("Failed to reject late foreign DTD setting");
- /* Ditto for the hash salt */
- if (XML_SetHashSalt(g_parser, 0x23456789))
- fail("Failed to reject late hash salt change");
-
- /* Now finish the parse */
- if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test XML_UseForeignDTD with no external subset present */
-static int XMLCALL
-external_entity_null_loader(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- UNUSED_P(parser);
- UNUSED_P(context);
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_foreign_dtd_without_external_subset) {
- const char *text = "<!DOCTYPE doc [<!ENTITY foo 'bar'>]>\n"
- "<doc>&foo;</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, NULL);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_null_loader);
- XML_UseForeignDTD(g_parser, XML_TRUE);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_empty_foreign_dtd) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<doc>&entity;</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_null_loader);
- XML_UseForeignDTD(g_parser, XML_TRUE);
- expect_failure(text, XML_ERROR_UNDEFINED_ENTITY,
- "Undefined entity not faulted");
-}
-END_TEST
-
-/* Test XML Base is set and unset appropriately */
-START_TEST(test_set_base) {
- const XML_Char *old_base;
- const XML_Char *new_base = XCS("/local/file/name.xml");
-
- old_base = XML_GetBase(g_parser);
- if (XML_SetBase(g_parser, new_base) != XML_STATUS_OK)
- fail("Unable to set base");
- if (xcstrcmp(XML_GetBase(g_parser), new_base) != 0)
- fail("Base setting not correct");
- if (XML_SetBase(g_parser, NULL) != XML_STATUS_OK)
- fail("Unable to NULL base");
- if (XML_GetBase(g_parser) != NULL)
- fail("Base setting not nulled");
- XML_SetBase(g_parser, old_base);
-}
-END_TEST
-
-/* Test attribute counts, indexing, etc */
-typedef struct attrInfo {
- const XML_Char *name;
- const XML_Char *value;
-} AttrInfo;
-
-typedef struct elementInfo {
- const XML_Char *name;
- int attr_count;
- const XML_Char *id_name;
- AttrInfo *attributes;
-} ElementInfo;
-
-static void XMLCALL
-counting_start_element_handler(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- ElementInfo *info = (ElementInfo *)userData;
- AttrInfo *attr;
- int count, id, i;
-
- while (info->name != NULL) {
- if (! xcstrcmp(name, info->name))
- break;
- info++;
- }
- if (info->name == NULL)
- fail("Element not recognised");
- /* The attribute count is twice what you might expect. It is a
- * count of items in atts, an array which contains alternating
- * attribute names and attribute values. For the naive user this
- * is possibly a little unexpected, but it is what the
- * documentation in expat.h tells us to expect.
- */
- count = XML_GetSpecifiedAttributeCount(g_parser);
- if (info->attr_count * 2 != count) {
- fail("Not got expected attribute count");
- return;
- }
- id = XML_GetIdAttributeIndex(g_parser);
- if (id == -1 && info->id_name != NULL) {
- fail("ID not present");
- return;
- }
- if (id != -1 && xcstrcmp(atts[id], info->id_name)) {
- fail("ID does not have the correct name");
- return;
- }
- for (i = 0; i < info->attr_count; i++) {
- attr = info->attributes;
- while (attr->name != NULL) {
- if (! xcstrcmp(atts[0], attr->name))
- break;
- attr++;
- }
- if (attr->name == NULL) {
- fail("Attribute not recognised");
- return;
- }
- if (xcstrcmp(atts[1], attr->value)) {
- fail("Attribute has wrong value");
- return;
- }
- /* Remember, two entries in atts per attribute (see above) */
- atts += 2;
- }
-}
-
-START_TEST(test_attributes) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc (tag)>\n"
- "<!ATTLIST doc id ID #REQUIRED>\n"
- "]>"
- "<doc a='1' id='one' b='2'>"
- "<tag c='3'/>"
- "</doc>";
- AttrInfo doc_info[] = {{XCS("a"), XCS("1")},
- {XCS("b"), XCS("2")},
- {XCS("id"), XCS("one")},
- {NULL, NULL}};
- AttrInfo tag_info[] = {{XCS("c"), XCS("3")}, {NULL, NULL}};
- ElementInfo info[] = {{XCS("doc"), 3, XCS("id"), NULL},
- {XCS("tag"), 1, NULL, NULL},
- {NULL, 0, NULL, NULL}};
- info[0].attributes = doc_info;
- info[1].attributes = tag_info;
-
- XML_SetStartElementHandler(g_parser, counting_start_element_handler);
- XML_SetUserData(g_parser, info);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test reset works correctly in the middle of processing an internal
- * entity. Exercises some obscure code in XML_ParserReset().
- */
-START_TEST(test_reset_in_entity) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ENTITY wombat 'wom'>\n"
- "<!ENTITY entity 'hi &wom; there'>\n"
- "]>\n"
- "<doc>&entity;</doc>";
- XML_ParsingStatus status;
-
- resumable = XML_TRUE;
- XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- XML_GetParsingStatus(g_parser, &status);
- if (status.parsing != XML_SUSPENDED)
- fail("Parsing status not SUSPENDED");
- XML_ParserReset(g_parser, NULL);
- XML_GetParsingStatus(g_parser, &status);
- if (status.parsing != XML_INITIALIZED)
- fail("Parsing status doesn't reset to INITIALIZED");
-}
-END_TEST
-
-/* Test that resume correctly passes through parse errors */
-START_TEST(test_resume_invalid_parse) {
- const char *text = "<doc>Hello</doc"; /* Missing closing wedge */
-
- resumable = XML_TRUE;
- XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (XML_ResumeParser(g_parser) == XML_STATUS_OK)
- fail("Resumed invalid parse not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_UNCLOSED_TOKEN)
- fail("Invalid parse not correctly faulted");
-}
-END_TEST
-
-/* Test that re-suspended parses are correctly passed through */
-START_TEST(test_resume_resuspended) {
- const char *text = "<doc>Hello<meep/>world</doc>";
-
- resumable = XML_TRUE;
- XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- resumable = XML_TRUE;
- XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
- if (XML_ResumeParser(g_parser) != XML_STATUS_SUSPENDED)
- fail("Resumption not suspended");
- /* This one should succeed and finish up */
- if (XML_ResumeParser(g_parser) != XML_STATUS_OK)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test that CDATA shows up correctly through a default handler */
-START_TEST(test_cdata_default) {
- const char *text = "<doc><![CDATA[Hello\nworld]]></doc>";
- const XML_Char *expected = XCS("<doc><![CDATA[Hello\nworld]]></doc>");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetDefaultHandler(g_parser, accumulate_characters);
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test resetting a subordinate parser does exactly nothing */
-static int XMLCALL
-external_entity_resetter(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<!ELEMENT doc (#PCDATA)*>";
- XML_Parser ext_parser;
- XML_ParsingStatus status;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- XML_GetParsingStatus(ext_parser, &status);
- if (status.parsing != XML_INITIALIZED) {
- fail("Parsing status is not INITIALIZED");
- return XML_STATUS_ERROR;
- }
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR) {
- xml_failure(parser);
- return XML_STATUS_ERROR;
- }
- XML_GetParsingStatus(ext_parser, &status);
- if (status.parsing != XML_FINISHED) {
- fail("Parsing status is not FINISHED");
- return XML_STATUS_ERROR;
- }
- /* Check we can't parse here */
- if (XML_Parse(ext_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Parsing when finished not faulted");
- if (XML_GetErrorCode(ext_parser) != XML_ERROR_FINISHED)
- fail("Parsing when finished faulted with wrong code");
- XML_ParserReset(ext_parser, NULL);
- XML_GetParsingStatus(ext_parser, &status);
- if (status.parsing != XML_FINISHED) {
- fail("Parsing status not still FINISHED");
- return XML_STATUS_ERROR;
- }
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_subordinate_reset) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_resetter);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test suspending a subordinate parser */
-
-static void XMLCALL
-entity_suspending_decl_handler(void *userData, const XML_Char *name,
- XML_Content *model) {
- XML_Parser ext_parser = (XML_Parser)userData;
-
- UNUSED_P(name);
- if (XML_StopParser(ext_parser, XML_TRUE) != XML_STATUS_ERROR)
- fail("Attempting to suspend a subordinate parser not faulted");
- if (XML_GetErrorCode(ext_parser) != XML_ERROR_SUSPEND_PE)
- fail("Suspending subordinate parser get wrong code");
- XML_SetElementDeclHandler(ext_parser, NULL);
- XML_FreeContentModel(g_parser, model);
-}
-
-static int XMLCALL
-external_entity_suspender(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<!ELEMENT doc (#PCDATA)*>";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- XML_SetElementDeclHandler(ext_parser, entity_suspending_decl_handler);
- XML_SetUserData(ext_parser, ext_parser);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR) {
- xml_failure(ext_parser);
- return XML_STATUS_ERROR;
- }
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_subordinate_suspend) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_suspender);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test suspending a subordinate parser from an XML declaration */
-/* Increases code coverage of the tests */
-static void XMLCALL
-entity_suspending_xdecl_handler(void *userData, const XML_Char *version,
- const XML_Char *encoding, int standalone) {
- XML_Parser ext_parser = (XML_Parser)userData;
-
- UNUSED_P(version);
- UNUSED_P(encoding);
- UNUSED_P(standalone);
- XML_StopParser(ext_parser, resumable);
- XML_SetXmlDeclHandler(ext_parser, NULL);
-}
-
-static int XMLCALL
-external_entity_suspend_xmldecl(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>";
- XML_Parser ext_parser;
- XML_ParsingStatus status;
- enum XML_Status rc;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- XML_SetXmlDeclHandler(ext_parser, entity_suspending_xdecl_handler);
- XML_SetUserData(ext_parser, ext_parser);
- rc = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE);
- XML_GetParsingStatus(ext_parser, &status);
- if (resumable) {
- if (rc == XML_STATUS_ERROR)
- xml_failure(ext_parser);
- if (status.parsing != XML_SUSPENDED)
- fail("Ext Parsing status not SUSPENDED");
- } else {
- if (rc != XML_STATUS_ERROR)
- fail("Ext parsing not aborted");
- if (XML_GetErrorCode(ext_parser) != XML_ERROR_ABORTED)
- xml_failure(ext_parser);
- if (status.parsing != XML_FINISHED)
- fail("Ext Parsing status not FINISHED");
- }
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_subordinate_xdecl_suspend) {
- const char *text
- = "<!DOCTYPE doc [\n"
- " <!ENTITY entity SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&entity;</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_suspend_xmldecl);
- resumable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_subordinate_xdecl_abort) {
- const char *text
- = "<!DOCTYPE doc [\n"
- " <!ENTITY entity SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&entity;</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_suspend_xmldecl);
- resumable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test external entity fault handling with suspension */
-static int XMLCALL
-external_entity_suspending_faulter(XML_Parser parser, const XML_Char *context,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId) {
- XML_Parser ext_parser;
- ExtFaults *fault = (ExtFaults *)XML_GetUserData(parser);
- void *buffer;
- int parse_len = (int)strlen(fault->parse_text);
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- XML_SetXmlDeclHandler(ext_parser, entity_suspending_xdecl_handler);
- XML_SetUserData(ext_parser, ext_parser);
- resumable = XML_TRUE;
- buffer = XML_GetBuffer(ext_parser, parse_len);
- if (buffer == NULL)
- fail("Could not allocate parse buffer");
- assert(buffer != NULL);
- memcpy(buffer, fault->parse_text, parse_len);
- if (XML_ParseBuffer(ext_parser, parse_len, XML_FALSE) != XML_STATUS_SUSPENDED)
- fail("XML declaration did not suspend");
- if (XML_ResumeParser(ext_parser) != XML_STATUS_OK)
- xml_failure(ext_parser);
- if (XML_ParseBuffer(ext_parser, 0, XML_TRUE) != XML_STATUS_ERROR)
- fail(fault->fail_text);
- if (XML_GetErrorCode(ext_parser) != fault->error)
- xml_failure(ext_parser);
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_ERROR;
-}
-
-START_TEST(test_ext_entity_invalid_suspended_parse) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtFaults faults[]
- = {{"<?xml version='1.0' encoding='us-ascii'?><",
- "Incomplete element declaration not faulted", NULL,
- XML_ERROR_UNCLOSED_TOKEN},
- {/* First two bytes of a three-byte char */
- "<?xml version='1.0' encoding='utf-8'?>\xe2\x82",
- "Incomplete character not faulted", NULL, XML_ERROR_PARTIAL_CHAR},
- {NULL, NULL, NULL, XML_ERROR_NONE}};
- ExtFaults *fault;
-
- for (fault = &faults[0]; fault->parse_text != NULL; fault++) {
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser,
- external_entity_suspending_faulter);
- XML_SetUserData(g_parser, fault);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Parser did not report external entity error");
- XML_ParserReset(g_parser, NULL);
- }
-}
-END_TEST
-
-/* Test setting an explicit encoding */
-START_TEST(test_explicit_encoding) {
- const char *text1 = "<doc>Hello ";
- const char *text2 = " World</doc>";
-
- /* Just check that we can set the encoding to NULL before starting */
- if (XML_SetEncoding(g_parser, NULL) != XML_STATUS_OK)
- fail("Failed to initialise encoding to NULL");
- /* Say we are UTF-8 */
- if (XML_SetEncoding(g_parser, XCS("utf-8")) != XML_STATUS_OK)
- fail("Failed to set explicit encoding");
- if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- /* Try to switch encodings mid-parse */
- if (XML_SetEncoding(g_parser, XCS("us-ascii")) != XML_STATUS_ERROR)
- fail("Allowed encoding change");
- if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- /* Try now the parse is over */
- if (XML_SetEncoding(g_parser, NULL) != XML_STATUS_OK)
- fail("Failed to unset encoding");
-}
-END_TEST
-
-/* Test handling of trailing CR (rather than newline) */
-static void XMLCALL
-cr_cdata_handler(void *userData, const XML_Char *s, int len) {
- int *pfound = (int *)userData;
-
- /* Internal processing turns the CR into a newline for the
- * character data handler, but not for the default handler
- */
- if (len == 1 && (*s == XCS('\n') || *s == XCS('\r')))
- *pfound = 1;
-}
-
-START_TEST(test_trailing_cr) {
- const char *text = "<doc>\r";
- int found_cr;
-
- /* Try with a character handler, for code coverage */
- XML_SetCharacterDataHandler(g_parser, cr_cdata_handler);
- XML_SetUserData(g_parser, &found_cr);
- found_cr = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_OK)
- fail("Failed to fault unclosed doc");
- if (found_cr == 0)
- fail("Did not catch the carriage return");
- XML_ParserReset(g_parser, NULL);
-
- /* Now with a default handler instead */
- XML_SetDefaultHandler(g_parser, cr_cdata_handler);
- XML_SetUserData(g_parser, &found_cr);
- found_cr = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_OK)
- fail("Failed to fault unclosed doc");
- if (found_cr == 0)
- fail("Did not catch default carriage return");
-}
-END_TEST
-
-/* Test trailing CR in an external entity parse */
-static int XMLCALL
-external_entity_cr_catcher(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "\r";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- XML_SetCharacterDataHandler(ext_parser, cr_cdata_handler);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(ext_parser);
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-static int XMLCALL
-external_entity_bad_cr_catcher(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<tag>\r";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- XML_SetCharacterDataHandler(ext_parser, cr_cdata_handler);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_OK)
- fail("Async entity error not caught");
- if (XML_GetErrorCode(ext_parser) != XML_ERROR_ASYNC_ENTITY)
- xml_failure(ext_parser);
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ext_entity_trailing_cr) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- int found_cr;
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_cr_catcher);
- XML_SetUserData(g_parser, &found_cr);
- found_cr = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_OK)
- xml_failure(g_parser);
- if (found_cr == 0)
- fail("No carriage return found");
- XML_ParserReset(g_parser, NULL);
-
- /* Try again with a different trailing CR */
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_bad_cr_catcher);
- XML_SetUserData(g_parser, &found_cr);
- found_cr = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_OK)
- xml_failure(g_parser);
- if (found_cr == 0)
- fail("No carriage return found");
-}
-END_TEST
-
-/* Test handling of trailing square bracket */
-static void XMLCALL
-rsqb_handler(void *userData, const XML_Char *s, int len) {
- int *pfound = (int *)userData;
-
- if (len == 1 && *s == XCS(']'))
- *pfound = 1;
-}
-
-START_TEST(test_trailing_rsqb) {
- const char *text8 = "<doc>]";
- const char text16[] = "\xFF\xFE<\000d\000o\000c\000>\000]\000";
- int found_rsqb;
- int text8_len = (int)strlen(text8);
-
- XML_SetCharacterDataHandler(g_parser, rsqb_handler);
- XML_SetUserData(g_parser, &found_rsqb);
- found_rsqb = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text8, text8_len, XML_TRUE)
- == XML_STATUS_OK)
- fail("Failed to fault unclosed doc");
- if (found_rsqb == 0)
- fail("Did not catch the right square bracket");
-
- /* Try again with a different encoding */
- XML_ParserReset(g_parser, NULL);
- XML_SetCharacterDataHandler(g_parser, rsqb_handler);
- XML_SetUserData(g_parser, &found_rsqb);
- found_rsqb = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text16, (int)sizeof(text16) - 1,
- XML_TRUE)
- == XML_STATUS_OK)
- fail("Failed to fault unclosed doc");
- if (found_rsqb == 0)
- fail("Did not catch the right square bracket");
-
- /* And finally with a default handler */
- XML_ParserReset(g_parser, NULL);
- XML_SetDefaultHandler(g_parser, rsqb_handler);
- XML_SetUserData(g_parser, &found_rsqb);
- found_rsqb = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text16, (int)sizeof(text16) - 1,
- XML_TRUE)
- == XML_STATUS_OK)
- fail("Failed to fault unclosed doc");
- if (found_rsqb == 0)
- fail("Did not catch the right square bracket");
-}
-END_TEST
-
-/* Test trailing right square bracket in an external entity parse */
-static int XMLCALL
-external_entity_rsqb_catcher(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<tag>]";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- XML_SetCharacterDataHandler(ext_parser, rsqb_handler);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Async entity error not caught");
- if (XML_GetErrorCode(ext_parser) != XML_ERROR_ASYNC_ENTITY)
- xml_failure(ext_parser);
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ext_entity_trailing_rsqb) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- int found_rsqb;
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_rsqb_catcher);
- XML_SetUserData(g_parser, &found_rsqb);
- found_rsqb = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_OK)
- xml_failure(g_parser);
- if (found_rsqb == 0)
- fail("No right square bracket found");
-}
-END_TEST
-
-/* Test CDATA handling in an external entity */
-static int XMLCALL
-external_entity_good_cdata_ascii(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<a><![CDATA[<greeting>Hello, world!</greeting>]]></a>";
- const XML_Char *expected = XCS("<greeting>Hello, world!</greeting>");
- CharData storage;
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- CharData_Init(&storage);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- XML_SetUserData(ext_parser, &storage);
- XML_SetCharacterDataHandler(ext_parser, accumulate_characters);
-
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(ext_parser);
- CharData_CheckXMLChars(&storage, expected);
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ext_entity_good_cdata) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_good_cdata_ascii);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_OK)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test user parameter settings */
-/* Variable holding the expected handler userData */
-static void *handler_data = NULL;
-/* Count of the number of times the comment handler has been invoked */
-static int comment_count = 0;
-/* Count of the number of skipped entities */
-static int skip_count = 0;
-/* Count of the number of times the XML declaration handler is invoked */
-static int xdecl_count = 0;
-
-static void XMLCALL
-xml_decl_handler(void *userData, const XML_Char *version,
- const XML_Char *encoding, int standalone) {
- UNUSED_P(version);
- UNUSED_P(encoding);
- if (userData != handler_data)
- fail("User data (xml decl) not correctly set");
- if (standalone != -1)
- fail("Standalone not flagged as not present in XML decl");
- xdecl_count++;
-}
-
-static void XMLCALL
-param_check_skip_handler(void *userData, const XML_Char *entityName,
- int is_parameter_entity) {
- UNUSED_P(entityName);
- UNUSED_P(is_parameter_entity);
- if (userData != handler_data)
- fail("User data (skip) not correctly set");
- skip_count++;
-}
-
-static void XMLCALL
-data_check_comment_handler(void *userData, const XML_Char *data) {
- UNUSED_P(data);
- /* Check that the userData passed through is what we expect */
- if (userData != handler_data)
- fail("User data (parser) not correctly set");
- /* Check that the user data in the parser is appropriate */
- if (XML_GetUserData(userData) != (void *)1)
- fail("User data in parser not correctly set");
- comment_count++;
-}
-
-static int XMLCALL
-external_entity_param_checker(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<!-- Subordinate parser -->\n"
- "<!ELEMENT doc (#PCDATA)*>";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- handler_data = ext_parser;
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR) {
- xml_failure(parser);
- return XML_STATUS_ERROR;
- }
- handler_data = parser;
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_user_parameters) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!-- Primary parse -->\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;";
- const char *epilog = "<!-- Back to primary parser -->\n"
- "</doc>";
-
- comment_count = 0;
- skip_count = 0;
- xdecl_count = 0;
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetXmlDeclHandler(g_parser, xml_decl_handler);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_param_checker);
- XML_SetCommentHandler(g_parser, data_check_comment_handler);
- XML_SetSkippedEntityHandler(g_parser, param_check_skip_handler);
- XML_UseParserAsHandlerArg(g_parser);
- XML_SetUserData(g_parser, (void *)1);
- handler_data = g_parser;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (comment_count != 2)
- fail("Comment handler not invoked enough times");
- /* Ensure we can't change policy mid-parse */
- if (XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_NEVER))
- fail("Changed param entity parsing policy while parsing");
- if (_XML_Parse_SINGLE_BYTES(g_parser, epilog, (int)strlen(epilog), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (comment_count != 3)
- fail("Comment handler not invoked enough times");
- if (skip_count != 1)
- fail("Skip handler not invoked enough times");
- if (xdecl_count != 1)
- fail("XML declaration handler not invoked");
-}
-END_TEST
-
-/* Test that an explicit external entity handler argument replaces
- * the parser as the first argument.
- *
- * We do not call the first parameter to the external entity handler
- * 'parser' for once, since the first time the handler is called it
- * will actually be a text string. We need to be able to access the
- * global 'parser' variable to create our external entity parser from,
- * since there are code paths we need to ensure get executed.
- */
-static int XMLCALL
-external_entity_ref_param_checker(XML_Parser parameter, const XML_Char *context,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<!ELEMENT doc (#PCDATA)*>";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- if ((void *)parameter != handler_data)
- fail("External entity ref handler parameter not correct");
-
- /* Here we use the global 'parser' variable */
- ext_parser = XML_ExternalEntityParserCreate(g_parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(ext_parser);
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ext_entity_ref_parameter) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_ref_param_checker);
- /* Set a handler arg that is not NULL and not parser (which is
- * what NULL would cause to be passed.
- */
- XML_SetExternalEntityRefHandlerArg(g_parser, (void *)text);
- handler_data = (void *)text;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-
- /* Now try again with unset args */
- XML_ParserReset(g_parser, NULL);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_ref_param_checker);
- XML_SetExternalEntityRefHandlerArg(g_parser, NULL);
- handler_data = (void *)g_parser;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test the parsing of an empty string */
-START_TEST(test_empty_parse) {
- const char *text = "<doc></doc>";
- const char *partial = "<doc>";
-
- if (XML_Parse(g_parser, NULL, 0, XML_FALSE) == XML_STATUS_ERROR)
- fail("Parsing empty string faulted");
- if (XML_Parse(g_parser, NULL, 0, XML_TRUE) != XML_STATUS_ERROR)
- fail("Parsing final empty string not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_NO_ELEMENTS)
- fail("Parsing final empty string faulted for wrong reason");
-
- /* Now try with valid text before the empty end */
- XML_ParserReset(g_parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (XML_Parse(g_parser, NULL, 0, XML_TRUE) == XML_STATUS_ERROR)
- fail("Parsing final empty string faulted");
-
- /* Now try with invalid text before the empty end */
- XML_ParserReset(g_parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, partial, (int)strlen(partial),
- XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (XML_Parse(g_parser, NULL, 0, XML_TRUE) != XML_STATUS_ERROR)
- fail("Parsing final incomplete empty string not faulted");
-}
-END_TEST
-
-/* Test odd corners of the XML_GetBuffer interface */
-static enum XML_Status
-get_feature(enum XML_FeatureEnum feature_id, long *presult) {
- const XML_Feature *feature = XML_GetFeatureList();
-
- if (feature == NULL)
- return XML_STATUS_ERROR;
- for (; feature->feature != XML_FEATURE_END; feature++) {
- if (feature->feature == feature_id) {
- *presult = feature->value;
- return XML_STATUS_OK;
- }
- }
- return XML_STATUS_ERROR;
-}
-
-/* Having an element name longer than 1024 characters exercises some
- * of the pool allocation code in the parser that otherwise does not
- * get executed. The count at the end of the line is the number of
- * characters (bytes) in the element name by that point.x
- */
-static const char *get_buffer_test_text
- = "<documentwitharidiculouslylongelementnametotease" /* 0x030 */
- "aparticularcorneroftheallocationinXML_GetBuffers" /* 0x060 */
- "othatwecanimprovethecoverageyetagain012345678901" /* 0x090 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x0c0 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x0f0 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x120 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x150 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x180 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x1b0 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x1e0 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x210 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x240 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x270 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x2a0 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x2d0 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x300 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x330 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x360 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x390 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x3c0 */
- "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x3f0 */
- "123456789abcdef0123456789abcdef0123456789>\n<ef0"; /* 0x420 */
-
-/* Test odd corners of the XML_GetBuffer interface */
-START_TEST(test_get_buffer_1) {
- const char *text = get_buffer_test_text;
- void *buffer;
- long context_bytes;
-
- /* Attempt to allocate a negative length buffer */
- if (XML_GetBuffer(g_parser, -12) != NULL)
- fail("Negative length buffer not failed");
-
- /* Now get a small buffer and extend it past valid length */
- buffer = XML_GetBuffer(g_parser, 1536);
- if (buffer == NULL)
- fail("1.5K buffer failed");
- assert(buffer != NULL);
- memcpy(buffer, text, strlen(text));
- if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (XML_GetBuffer(g_parser, INT_MAX) != NULL)
- fail("INT_MAX buffer not failed");
-
- /* Now try extending it a more reasonable but still too large
- * amount. The allocator in XML_GetBuffer() doubles the buffer
- * size until it exceeds the requested amount or INT_MAX. If it
- * exceeds INT_MAX, it rejects the request, so we want a request
- * between INT_MAX and INT_MAX/2. A gap of 1K seems comfortable,
- * with an extra byte just to ensure that the request is off any
- * boundary. The request will be inflated internally by
- * XML_CONTEXT_BYTES (if defined), so we subtract that from our
- * request.
- */
- if (get_feature(XML_FEATURE_CONTEXT_BYTES, &context_bytes) != XML_STATUS_OK)
- context_bytes = 0;
- if (XML_GetBuffer(g_parser, INT_MAX - (context_bytes + 1025)) != NULL)
- fail("INT_MAX- buffer not failed");
-
- /* Now try extending it a carefully crafted amount */
- if (XML_GetBuffer(g_parser, 1000) == NULL)
- fail("1000 buffer failed");
-}
-END_TEST
-
-/* Test more corners of the XML_GetBuffer interface */
-START_TEST(test_get_buffer_2) {
- const char *text = get_buffer_test_text;
- void *buffer;
-
- /* Now get a decent buffer */
- buffer = XML_GetBuffer(g_parser, 1536);
- if (buffer == NULL)
- fail("1.5K buffer failed");
- assert(buffer != NULL);
- memcpy(buffer, text, strlen(text));
- if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-
- /* Extend it, to catch a different code path */
- if (XML_GetBuffer(g_parser, 1024) == NULL)
- fail("1024 buffer failed");
-}
-END_TEST
-
-/* Test position information macros */
-START_TEST(test_byte_info_at_end) {
- const char *text = "<doc></doc>";
-
- if (XML_GetCurrentByteIndex(g_parser) != -1
- || XML_GetCurrentByteCount(g_parser) != 0)
- fail("Byte index/count incorrect at start of parse");
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- /* At end, the count will be zero and the index the end of string */
- if (XML_GetCurrentByteCount(g_parser) != 0)
- fail("Terminal byte count incorrect");
- if (XML_GetCurrentByteIndex(g_parser) != (XML_Index)strlen(text))
- fail("Terminal byte index incorrect");
-}
-END_TEST
-
-/* Test position information from errors */
-#define PRE_ERROR_STR "<doc></"
-#define POST_ERROR_STR "wombat></doc>"
-START_TEST(test_byte_info_at_error) {
- const char *text = PRE_ERROR_STR POST_ERROR_STR;
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_OK)
- fail("Syntax error not faulted");
- if (XML_GetCurrentByteCount(g_parser) != 0)
- fail("Error byte count incorrect");
- if (XML_GetCurrentByteIndex(g_parser) != strlen(PRE_ERROR_STR))
- fail("Error byte index incorrect");
-}
-END_TEST
-#undef PRE_ERROR_STR
-#undef POST_ERROR_STR
-
-/* Test position information in handler */
-typedef struct ByteTestData {
- int start_element_len;
- int cdata_len;
- int total_string_len;
-} ByteTestData;
-
-static void
-byte_character_handler(void *userData, const XML_Char *s, int len) {
-#ifdef XML_CONTEXT_BYTES
- int offset, size;
- const char *buffer;
- ByteTestData *data = (ByteTestData *)userData;
-
- UNUSED_P(s);
- buffer = XML_GetInputContext(g_parser, &offset, &size);
- if (buffer == NULL)
- fail("Failed to get context buffer");
- if (offset != data->start_element_len)
- fail("Context offset in unexpected position");
- if (len != data->cdata_len)
- fail("CDATA length reported incorrectly");
- if (size != data->total_string_len)
- fail("Context size is not full buffer");
- if (XML_GetCurrentByteIndex(g_parser) != offset)
- fail("Character byte index incorrect");
- if (XML_GetCurrentByteCount(g_parser) != len)
- fail("Character byte count incorrect");
-#else
- UNUSED_P(s);
- UNUSED_P(userData);
- UNUSED_P(len);
-#endif
-}
-
-#define START_ELEMENT "<e>"
-#define CDATA_TEXT "Hello"
-#define END_ELEMENT "</e>"
-START_TEST(test_byte_info_at_cdata) {
- const char *text = START_ELEMENT CDATA_TEXT END_ELEMENT;
- int offset, size;
- ByteTestData data;
-
- /* Check initial context is empty */
- if (XML_GetInputContext(g_parser, &offset, &size) != NULL)
- fail("Unexpected context at start of parse");
-
- data.start_element_len = (int)strlen(START_ELEMENT);
- data.cdata_len = (int)strlen(CDATA_TEXT);
- data.total_string_len = (int)strlen(text);
- XML_SetCharacterDataHandler(g_parser, byte_character_handler);
- XML_SetUserData(g_parser, &data);
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE) != XML_STATUS_OK)
- xml_failure(g_parser);
-}
-END_TEST
-#undef START_ELEMENT
-#undef CDATA_TEXT
-#undef END_ELEMENT
-
-/* Test predefined entities are correctly recognised */
-START_TEST(test_predefined_entities) {
- const char *text = "<doc>&lt;&gt;&amp;&quot;&apos;</doc>";
- const XML_Char *expected = XCS("<doc>&lt;&gt;&amp;&quot;&apos;</doc>");
- const XML_Char *result = XCS("<>&\"'");
- CharData storage;
-
- XML_SetDefaultHandler(g_parser, accumulate_characters);
- /* run_character_check uses XML_SetCharacterDataHandler(), which
- * unfortunately heads off a code path that we need to exercise.
- */
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- /* The default handler doesn't translate the entities */
- CharData_CheckXMLChars(&storage, expected);
-
- /* Now try again and check the translation */
- XML_ParserReset(g_parser, NULL);
- run_character_check(text, result);
-}
-END_TEST
-
-/* Regression test that an invalid tag in an external parameter
- * reference in an external DTD is correctly faulted.
- *
- * Only a few specific tags are legal in DTDs ignoring comments and
- * processing instructions, all of which begin with an exclamation
- * mark. "<el/>" is not one of them, so the parser should raise an
- * error on encountering it.
- */
-static int XMLCALL
-external_entity_param(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text1 = "<!ELEMENT doc EMPTY>\n"
- "<!ENTITY % e1 SYSTEM '004-2.ent'>\n"
- "<!ENTITY % e2 '%e1;'>\n"
- "%e1;\n";
- const char *text2 = "<!ELEMENT el EMPTY>\n"
- "<el/>\n";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(publicId);
- if (systemId == NULL)
- return XML_STATUS_OK;
-
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
-
- if (! xcstrcmp(systemId, XCS("004-1.ent"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Inner DTD with invalid tag not rejected");
- if (XML_GetErrorCode(ext_parser) != XML_ERROR_EXTERNAL_ENTITY_HANDLING)
- xml_failure(ext_parser);
- } else if (! xcstrcmp(systemId, XCS("004-2.ent"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, (int)strlen(text2), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Invalid tag in external param not rejected");
- if (XML_GetErrorCode(ext_parser) != XML_ERROR_SYNTAX)
- xml_failure(ext_parser);
- } else {
- fail("Unknown system ID");
- }
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_ERROR;
-}
-
-START_TEST(test_invalid_tag_in_dtd) {
- const char *text = "<!DOCTYPE doc SYSTEM '004-1.ent'>\n"
- "<doc></doc>\n";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_param);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Invalid tag IN DTD external param not rejected");
-}
-END_TEST
-
-/* Test entities not quite the predefined ones are not mis-recognised */
-START_TEST(test_not_predefined_entities) {
- const char *text[] = {"<doc>&pt;</doc>", "<doc>&amo;</doc>",
- "<doc>&quid;</doc>", "<doc>&apod;</doc>", NULL};
- int i = 0;
-
- while (text[i] != NULL) {
- expect_failure(text[i], XML_ERROR_UNDEFINED_ENTITY,
- "Undefined entity not rejected");
- XML_ParserReset(g_parser, NULL);
- i++;
- }
-}
-END_TEST
-
-/* Test conditional inclusion (IGNORE) */
-static int XMLCALL
-external_entity_load_ignore(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<![IGNORE[<!ELEMENT e (#PCDATA)*>]]>";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(parser);
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ignore_section) {
- const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc><e>&entity;</e></doc>";
- const XML_Char *expected
- = XCS("<![IGNORE[<!ELEMENT e (#PCDATA)*>]]>\n&entity;");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &storage);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_load_ignore);
- XML_SetDefaultHandler(g_parser, accumulate_characters);
- XML_SetStartDoctypeDeclHandler(g_parser, dummy_start_doctype_handler);
- XML_SetEndDoctypeDeclHandler(g_parser, dummy_end_doctype_handler);
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- XML_SetStartElementHandler(g_parser, dummy_start_element);
- XML_SetEndElementHandler(g_parser, dummy_end_element);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-static int XMLCALL
-external_entity_load_ignore_utf16(XML_Parser parser, const XML_Char *context,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId) {
- const char text[] =
- /* <![IGNORE[<!ELEMENT e (#PCDATA)*>]]> */
- "<\0!\0[\0I\0G\0N\0O\0R\0E\0[\0"
- "<\0!\0E\0L\0E\0M\0E\0N\0T\0 \0e\0 \0"
- "(\0#\0P\0C\0D\0A\0T\0A\0)\0*\0>\0]\0]\0>\0";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(parser);
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ignore_section_utf16) {
- const char text[] =
- /* <!DOCTYPE d SYSTEM 's'> */
- "<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 "
- "\0S\0Y\0S\0T\0E\0M\0 \0'\0s\0'\0>\0\n\0"
- /* <d><e>&en;</e></d> */
- "<\0d\0>\0<\0e\0>\0&\0e\0n\0;\0<\0/\0e\0>\0<\0/\0d\0>\0";
- const XML_Char *expected = XCS("<![IGNORE[<!ELEMENT e (#PCDATA)*>]]>\n&en;");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &storage);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_load_ignore_utf16);
- XML_SetDefaultHandler(g_parser, accumulate_characters);
- XML_SetStartDoctypeDeclHandler(g_parser, dummy_start_doctype_handler);
- XML_SetEndDoctypeDeclHandler(g_parser, dummy_end_doctype_handler);
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- XML_SetStartElementHandler(g_parser, dummy_start_element);
- XML_SetEndElementHandler(g_parser, dummy_end_element);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-static int XMLCALL
-external_entity_load_ignore_utf16_be(XML_Parser parser, const XML_Char *context,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId) {
- const char text[] =
- /* <![IGNORE[<!ELEMENT e (#PCDATA)*>]]> */
- "\0<\0!\0[\0I\0G\0N\0O\0R\0E\0["
- "\0<\0!\0E\0L\0E\0M\0E\0N\0T\0 \0e\0 "
- "\0(\0#\0P\0C\0D\0A\0T\0A\0)\0*\0>\0]\0]\0>";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(parser);
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ignore_section_utf16_be) {
- const char text[] =
- /* <!DOCTYPE d SYSTEM 's'> */
- "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 "
- "\0S\0Y\0S\0T\0E\0M\0 \0'\0s\0'\0>\0\n"
- /* <d><e>&en;</e></d> */
- "\0<\0d\0>\0<\0e\0>\0&\0e\0n\0;\0<\0/\0e\0>\0<\0/\0d\0>";
- const XML_Char *expected = XCS("<![IGNORE[<!ELEMENT e (#PCDATA)*>]]>\n&en;");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &storage);
- XML_SetExternalEntityRefHandler(g_parser,
- external_entity_load_ignore_utf16_be);
- XML_SetDefaultHandler(g_parser, accumulate_characters);
- XML_SetStartDoctypeDeclHandler(g_parser, dummy_start_doctype_handler);
- XML_SetEndDoctypeDeclHandler(g_parser, dummy_end_doctype_handler);
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- XML_SetStartElementHandler(g_parser, dummy_start_element);
- XML_SetEndElementHandler(g_parser, dummy_end_element);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test mis-formatted conditional exclusion */
-START_TEST(test_bad_ignore_section) {
- const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc><e>&entity;</e></doc>";
- ExtFaults faults[]
- = {{"<![IGNORE[<!ELEM", "Broken-off declaration not faulted", NULL,
- XML_ERROR_SYNTAX},
- {"<![IGNORE[\x01]]>", "Invalid XML character not faulted", NULL,
- XML_ERROR_INVALID_TOKEN},
- {/* FIrst two bytes of a three-byte char */
- "<![IGNORE[\xe2\x82", "Partial XML character not faulted", NULL,
- XML_ERROR_PARTIAL_CHAR},
- {NULL, NULL, NULL, XML_ERROR_NONE}};
- ExtFaults *fault;
-
- for (fault = &faults[0]; fault->parse_text != NULL; fault++) {
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
- XML_SetUserData(g_parser, fault);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Incomplete IGNORE section not failed");
- XML_ParserReset(g_parser, NULL);
- }
-}
-END_TEST
-
-/* Test recursive parsing */
-static int XMLCALL
-external_entity_valuer(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text1 = "<!ELEMENT doc EMPTY>\n"
- "<!ENTITY % e1 SYSTEM '004-2.ent'>\n"
- "<!ENTITY % e2 '%e1;'>\n"
- "%e1;\n";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(publicId);
- if (systemId == NULL)
- return XML_STATUS_OK;
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- if (! xcstrcmp(systemId, XCS("004-1.ent"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(ext_parser);
- } else if (! xcstrcmp(systemId, XCS("004-2.ent"))) {
- ExtFaults *fault = (ExtFaults *)XML_GetUserData(parser);
- enum XML_Status status;
- enum XML_Error error;
-
- status = _XML_Parse_SINGLE_BYTES(ext_parser, fault->parse_text,
- (int)strlen(fault->parse_text), XML_TRUE);
- if (fault->error == XML_ERROR_NONE) {
- if (status == XML_STATUS_ERROR)
- xml_failure(ext_parser);
- } else {
- if (status != XML_STATUS_ERROR)
- fail(fault->fail_text);
- error = XML_GetErrorCode(ext_parser);
- if (error != fault->error
- && (fault->error != XML_ERROR_XML_DECL
- || error != XML_ERROR_TEXT_DECL))
- xml_failure(ext_parser);
- }
- }
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_external_entity_values) {
- const char *text = "<!DOCTYPE doc SYSTEM '004-1.ent'>\n"
- "<doc></doc>\n";
- ExtFaults data_004_2[] = {
- {"<!ATTLIST doc a1 CDATA 'value'>", NULL, NULL, XML_ERROR_NONE},
- {"<!ATTLIST $doc a1 CDATA 'value'>", "Invalid token not faulted", NULL,
- XML_ERROR_INVALID_TOKEN},
- {"'wombat", "Unterminated string not faulted", NULL,
- XML_ERROR_UNCLOSED_TOKEN},
- {"\xe2\x82", "Partial UTF-8 character not faulted", NULL,
- XML_ERROR_PARTIAL_CHAR},
- {"<?xml version='1.0' encoding='utf-8'?>\n", NULL, NULL, XML_ERROR_NONE},
- {"<?xml?>", "Malformed XML declaration not faulted", NULL,
- XML_ERROR_XML_DECL},
- {/* UTF-8 BOM */
- "\xEF\xBB\xBF<!ATTLIST doc a1 CDATA 'value'>", NULL, NULL,
- XML_ERROR_NONE},
- {"<?xml version='1.0' encoding='utf-8'?>\n$",
- "Invalid token after text declaration not faulted", NULL,
- XML_ERROR_INVALID_TOKEN},
- {"<?xml version='1.0' encoding='utf-8'?>\n'wombat",
- "Unterminated string after text decl not faulted", NULL,
- XML_ERROR_UNCLOSED_TOKEN},
- {"<?xml version='1.0' encoding='utf-8'?>\n\xe2\x82",
- "Partial UTF-8 character after text decl not faulted", NULL,
- XML_ERROR_PARTIAL_CHAR},
- {"%e1;", "Recursive parameter entity not faulted", NULL,
- XML_ERROR_RECURSIVE_ENTITY_REF},
- {NULL, NULL, NULL, XML_ERROR_NONE}};
- int i;
-
- for (i = 0; data_004_2[i].parse_text != NULL; i++) {
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_valuer);
- XML_SetUserData(g_parser, &data_004_2[i]);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- XML_ParserReset(g_parser, NULL);
- }
-}
-END_TEST
-
-/* Test the recursive parse interacts with a not standalone handler */
-static int XMLCALL
-external_entity_not_standalone(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text1 = "<!ELEMENT doc EMPTY>\n"
- "<!ENTITY % e1 SYSTEM 'bar'>\n"
- "%e1;\n";
- const char *text2 = "<!ATTLIST doc a1 CDATA 'value'>";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(publicId);
- if (systemId == NULL)
- return XML_STATUS_OK;
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- if (! xcstrcmp(systemId, XCS("foo"))) {
- XML_SetNotStandaloneHandler(ext_parser, reject_not_standalone_handler);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Expected not standalone rejection");
- if (XML_GetErrorCode(ext_parser) != XML_ERROR_NOT_STANDALONE)
- xml_failure(ext_parser);
- XML_SetNotStandaloneHandler(ext_parser, NULL);
- XML_ParserFree(ext_parser);
- return XML_STATUS_ERROR;
- } else if (! xcstrcmp(systemId, XCS("bar"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, (int)strlen(text2), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(ext_parser);
- }
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ext_entity_not_standalone) {
- const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc></doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_not_standalone);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Standalone rejection not caught");
-}
-END_TEST
-
-static int XMLCALL
-external_entity_value_aborter(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text1 = "<!ELEMENT doc EMPTY>\n"
- "<!ENTITY % e1 SYSTEM '004-2.ent'>\n"
- "<!ENTITY % e2 '%e1;'>\n"
- "%e1;\n";
- const char *text2 = "<?xml version='1.0' encoding='utf-8'?>";
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(publicId);
- if (systemId == NULL)
- return XML_STATUS_OK;
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
- if (! xcstrcmp(systemId, XCS("004-1.ent"))) {
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text1, (int)strlen(text1), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(ext_parser);
- }
- if (! xcstrcmp(systemId, XCS("004-2.ent"))) {
- XML_SetXmlDeclHandler(ext_parser, entity_suspending_xdecl_handler);
- XML_SetUserData(ext_parser, ext_parser);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text2, (int)strlen(text2), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Aborted parse not faulted");
- if (XML_GetErrorCode(ext_parser) != XML_ERROR_ABORTED)
- xml_failure(ext_parser);
- }
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_ext_entity_value_abort) {
- const char *text = "<!DOCTYPE doc SYSTEM '004-1.ent'>\n"
- "<doc></doc>\n";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_value_aborter);
- resumable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_bad_public_doctype) {
- const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
- "<!DOCTYPE doc PUBLIC '{BadName}' 'test'>\n"
- "<doc></doc>";
-
- /* Setting a handler provokes a particular code path */
- XML_SetDoctypeDeclHandler(g_parser, dummy_start_doctype_handler,
- dummy_end_doctype_handler);
- expect_failure(text, XML_ERROR_PUBLICID, "Bad Public ID not failed");
-}
-END_TEST
-
-/* Test based on ibm/valid/P32/ibm32v04.xml */
-START_TEST(test_attribute_enum_value) {
- const char *text = "<?xml version='1.0' standalone='no'?>\n"
- "<!DOCTYPE animal SYSTEM 'test.dtd'>\n"
- "<animal>This is a \n <a/> \n\nyellow tiger</animal>";
- ExtTest dtd_data
- = {"<!ELEMENT animal (#PCDATA|a)*>\n"
- "<!ELEMENT a EMPTY>\n"
- "<!ATTLIST animal xml:space (default|preserve) 'preserve'>",
- NULL, NULL};
- const XML_Char *expected = XCS("This is a \n \n\nyellow tiger");
-
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- XML_SetUserData(g_parser, &dtd_data);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- /* An attribute list handler provokes a different code path */
- XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
- run_ext_character_check(text, &dtd_data, expected);
-}
-END_TEST
-
-/* Slightly bizarrely, the library seems to silently ignore entity
- * definitions for predefined entities, even when they are wrong. The
- * language of the XML 1.0 spec is somewhat unhelpful as to what ought
- * to happen, so this is currently treated as acceptable.
- */
-START_TEST(test_predefined_entity_redefinition) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ENTITY apos 'foo'>\n"
- "]>\n"
- "<doc>&apos;</doc>";
- run_character_check(text, XCS("'"));
-}
-END_TEST
-
-/* Test that the parser stops processing the DTD after an unresolved
- * parameter entity is encountered.
- */
-START_TEST(test_dtd_stop_processing) {
- const char *text = "<!DOCTYPE doc [\n"
- "%foo;\n"
- "<!ENTITY bar 'bas'>\n"
- "]><doc/>";
-
- XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (dummy_handler_flags != 0)
- fail("DTD processing still going after undefined PE");
-}
-END_TEST
-
-/* Test public notations with no system ID */
-START_TEST(test_public_notation_no_sysid) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!NOTATION note PUBLIC 'foo'>\n"
- "<!ELEMENT doc EMPTY>\n"
- "]>\n<doc/>";
-
- dummy_handler_flags = 0;
- XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (dummy_handler_flags != DUMMY_NOTATION_DECL_HANDLER_FLAG)
- fail("Notation declaration handler not called");
-}
-END_TEST
-
-static void XMLCALL
-record_element_start_handler(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- UNUSED_P(atts);
- CharData_AppendXMLChars((CharData *)userData, name, (int)xcstrlen(name));
-}
-
-START_TEST(test_nested_groups) {
- const char *text
- = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc "
- /* Sixteen elements per line */
- "(e,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,"
- "(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?"
- "))))))))))))))))))))))))))))))))>\n"
- "<!ELEMENT e EMPTY>"
- "]>\n"
- "<doc><e/></doc>";
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- XML_SetStartElementHandler(g_parser, record_element_start_handler);
- XML_SetUserData(g_parser, &storage);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, XCS("doce"));
- if (dummy_handler_flags != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
- fail("Element handler not fired");
-}
-END_TEST
-
-START_TEST(test_group_choice) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc (a|b|c)+>\n"
- "<!ELEMENT a EMPTY>\n"
- "<!ELEMENT b (#PCDATA)>\n"
- "<!ELEMENT c ANY>\n"
- "]>\n"
- "<doc>\n"
- "<a/>\n"
- "<b attr='foo'>This is a foo</b>\n"
- "<c></c>\n"
- "</doc>\n";
-
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (dummy_handler_flags != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
- fail("Element handler flag not raised");
-}
-END_TEST
-
-static int XMLCALL
-external_entity_public(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text1 = (const char *)XML_GetUserData(parser);
- const char *text2 = "<!ATTLIST doc a CDATA 'value'>";
- const char *text = NULL;
- XML_Parser ext_parser;
- int parse_res;
-
- UNUSED_P(base);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- return XML_STATUS_ERROR;
- if (systemId != NULL && ! xcstrcmp(systemId, XCS("http://example.org/"))) {
- text = text1;
- } else if (publicId != NULL && ! xcstrcmp(publicId, XCS("foo"))) {
- text = text2;
- } else
- fail("Unexpected parameters to external entity parser");
- assert(text != NULL);
- parse_res
- = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE);
- XML_ParserFree(ext_parser);
- return parse_res;
-}
-
-START_TEST(test_standalone_parameter_entity) {
- const char *text = "<?xml version='1.0' standalone='yes'?>\n"
- "<!DOCTYPE doc SYSTEM 'http://example.org/' [\n"
- "<!ENTITY % entity '<!ELEMENT doc (#PCDATA)>'>\n"
- "%entity;\n"
- "]>\n"
- "<doc></doc>";
- char dtd_data[] = "<!ENTITY % e1 'foo'>\n";
-
- XML_SetUserData(g_parser, dtd_data);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_public);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test skipping of parameter entity in an external DTD */
-/* Derived from ibm/invalid/P69/ibm69i01.xml */
-START_TEST(test_skipped_parameter_entity) {
- const char *text = "<?xml version='1.0'?>\n"
- "<!DOCTYPE root SYSTEM 'http://example.org/dtd.ent' [\n"
- "<!ELEMENT root (#PCDATA|a)* >\n"
- "]>\n"
- "<root></root>";
- ExtTest dtd_data = {"%pe2;", NULL, NULL};
-
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- XML_SetUserData(g_parser, &dtd_data);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetSkippedEntityHandler(g_parser, dummy_skip_handler);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (dummy_handler_flags != DUMMY_SKIP_HANDLER_FLAG)
- fail("Skip handler not executed");
-}
-END_TEST
-
-/* Test recursive parameter entity definition rejected in external DTD */
-START_TEST(test_recursive_external_parameter_entity) {
- const char *text = "<?xml version='1.0'?>\n"
- "<!DOCTYPE root SYSTEM 'http://example.org/dtd.ent' [\n"
- "<!ELEMENT root (#PCDATA|a)* >\n"
- "]>\n"
- "<root></root>";
- ExtFaults dtd_data = {"<!ENTITY % pe2 '&#37;pe2;'>\n%pe2;",
- "Recursive external parameter entity not faulted", NULL,
- XML_ERROR_RECURSIVE_ENTITY_REF};
-
- XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
- XML_SetUserData(g_parser, &dtd_data);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Recursive external parameter not spotted");
-}
-END_TEST
-
-/* Test undefined parameter entity in external entity handler */
-static int XMLCALL
-external_entity_devaluer(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = "<!ELEMENT doc EMPTY>\n"
- "<!ENTITY % e1 SYSTEM 'bar'>\n"
- "%e1;\n";
- XML_Parser ext_parser;
- intptr_t clear_handler = (intptr_t)XML_GetUserData(parser);
-
- UNUSED_P(base);
- UNUSED_P(publicId);
- if (systemId == NULL || ! xcstrcmp(systemId, XCS("bar")))
- return XML_STATUS_OK;
- if (xcstrcmp(systemId, XCS("foo")))
- fail("Unexpected system ID");
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could note create external entity parser");
- if (clear_handler)
- XML_SetExternalEntityRefHandler(ext_parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(ext_parser);
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_undefined_ext_entity_in_external_dtd) {
- const char *text = "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc></doc>\n";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_devaluer);
- XML_SetUserData(g_parser, (void *)(intptr_t)XML_FALSE);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-
- /* Now repeat without the external entity ref handler invoking
- * another copy of itself.
- */
- XML_ParserReset(g_parser, NULL);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_devaluer);
- XML_SetUserData(g_parser, (void *)(intptr_t)XML_TRUE);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-static void XMLCALL
-aborting_xdecl_handler(void *userData, const XML_Char *version,
- const XML_Char *encoding, int standalone) {
- UNUSED_P(userData);
- UNUSED_P(version);
- UNUSED_P(encoding);
- UNUSED_P(standalone);
- XML_StopParser(g_parser, resumable);
- XML_SetXmlDeclHandler(g_parser, NULL);
-}
-
-/* Test suspending the parse on receiving an XML declaration works */
-START_TEST(test_suspend_xdecl) {
- const char *text = long_character_data_text;
-
- XML_SetXmlDeclHandler(g_parser, aborting_xdecl_handler);
- resumable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_SUSPENDED)
- xml_failure(g_parser);
- if (XML_GetErrorCode(g_parser) != XML_ERROR_NONE)
- xml_failure(g_parser);
- /* Attempt to start a new parse while suspended */
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Attempt to parse while suspended not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_SUSPENDED)
- fail("Suspended parse not faulted with correct error");
-}
-END_TEST
-
-/* Test aborting the parse in an epilog works */
-static void XMLCALL
-selective_aborting_default_handler(void *userData, const XML_Char *s, int len) {
- const XML_Char *match = (const XML_Char *)userData;
-
- if (match == NULL
- || (xcstrlen(match) == (unsigned)len && ! xcstrncmp(match, s, len))) {
- XML_StopParser(g_parser, resumable);
- XML_SetDefaultHandler(g_parser, NULL);
- }
-}
-
-START_TEST(test_abort_epilog) {
- const char *text = "<doc></doc>\n\r\n";
- XML_Char match[] = XCS("\r");
-
- XML_SetDefaultHandler(g_parser, selective_aborting_default_handler);
- XML_SetUserData(g_parser, match);
- resumable = XML_FALSE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Abort not triggered");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_ABORTED)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test a different code path for abort in the epilog */
-START_TEST(test_abort_epilog_2) {
- const char *text = "<doc></doc>\n";
- XML_Char match[] = XCS("\n");
-
- XML_SetDefaultHandler(g_parser, selective_aborting_default_handler);
- XML_SetUserData(g_parser, match);
- resumable = XML_FALSE;
- expect_failure(text, XML_ERROR_ABORTED, "Abort not triggered");
-}
-END_TEST
-
-/* Test suspension from the epilog */
-START_TEST(test_suspend_epilog) {
- const char *text = "<doc></doc>\n";
- XML_Char match[] = XCS("\n");
-
- XML_SetDefaultHandler(g_parser, selective_aborting_default_handler);
- XML_SetUserData(g_parser, match);
- resumable = XML_TRUE;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_SUSPENDED)
- xml_failure(g_parser);
-}
-END_TEST
-
-static void XMLCALL
-suspending_end_handler(void *userData, const XML_Char *s) {
- UNUSED_P(s);
- XML_StopParser((XML_Parser)userData, 1);
-}
-
-START_TEST(test_suspend_in_sole_empty_tag) {
- const char *text = "<doc/>";
- enum XML_Status rc;
-
- XML_SetEndElementHandler(g_parser, suspending_end_handler);
- XML_SetUserData(g_parser, g_parser);
- rc = _XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE);
- if (rc == XML_STATUS_ERROR)
- xml_failure(g_parser);
- else if (rc != XML_STATUS_SUSPENDED)
- fail("Suspend not triggered");
- rc = XML_ResumeParser(g_parser);
- if (rc == XML_STATUS_ERROR)
- xml_failure(g_parser);
- else if (rc != XML_STATUS_OK)
- fail("Resume failed");
-}
-END_TEST
-
-START_TEST(test_unfinished_epilog) {
- const char *text = "<doc></doc><";
-
- expect_failure(text, XML_ERROR_UNCLOSED_TOKEN,
- "Incomplete epilog entry not faulted");
-}
-END_TEST
-
-START_TEST(test_partial_char_in_epilog) {
- const char *text = "<doc></doc>\xe2\x82";
-
- /* First check that no fault is raised if the parse is not finished */
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- /* Now check that it is faulted once we finish */
- if (XML_ParseBuffer(g_parser, 0, XML_TRUE) != XML_STATUS_ERROR)
- fail("Partial character in epilog not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_PARTIAL_CHAR)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_hash_collision) {
- /* For full coverage of the lookup routine, we need to ensure a
- * hash collision even though we can only tell that we have one
- * through breakpoint debugging or coverage statistics. The
- * following will cause a hash collision on machines with a 64-bit
- * long type; others will have to experiment. The full coverage
- * tests invoked from qa.sh usually provide a hash collision, but
- * not always. This is an attempt to provide insurance.
- */
-#define COLLIDING_HASH_SALT (unsigned long)_SIP_ULL(0xffffffffU, 0xff99fc90U)
- const char *text
- = "<doc>\n"
- "<a1/><a2/><a3/><a4/><a5/><a6/><a7/><a8/>\n"
- "<b1></b1><b2 attr='foo'>This is a foo</b2><b3></b3><b4></b4>\n"
- "<b5></b5><b6></b6><b7></b7><b8></b8>\n"
- "<c1/><c2/><c3/><c4/><c5/><c6/><c7/><c8/>\n"
- "<d1/><d2/><d3/><d4/><d5/><d6/><d7/>\n"
- "<d8>This triggers the table growth and collides with b2</d8>\n"
- "</doc>\n";
-
- XML_SetHashSalt(g_parser, COLLIDING_HASH_SALT);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-#undef COLLIDING_HASH_SALT
-
-/* Test resuming a parse suspended in entity substitution */
-static void XMLCALL
-start_element_suspender(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- UNUSED_P(userData);
- UNUSED_P(atts);
- if (! xcstrcmp(name, XCS("suspend")))
- XML_StopParser(g_parser, XML_TRUE);
- if (! xcstrcmp(name, XCS("abort")))
- XML_StopParser(g_parser, XML_FALSE);
-}
-
-START_TEST(test_suspend_resume_internal_entity) {
- const char *text
- = "<!DOCTYPE doc [\n"
- "<!ENTITY foo '<suspend>Hi<suspend>Ho</suspend></suspend>'>\n"
- "]>\n"
- "<doc>&foo;</doc>\n";
- const XML_Char *expected1 = XCS("Hi");
- const XML_Char *expected2 = XCS("HiHo");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetStartElementHandler(g_parser, start_element_suspender);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
- XML_SetUserData(g_parser, &storage);
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_SUSPENDED)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, XCS(""));
- if (XML_ResumeParser(g_parser) != XML_STATUS_SUSPENDED)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected1);
- if (XML_ResumeParser(g_parser) != XML_STATUS_OK)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected2);
-}
-END_TEST
-
-/* Test syntax error is caught at parse resumption */
-START_TEST(test_resume_entity_with_syntax_error) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ENTITY foo '<suspend>Hi</wombat>'>\n"
- "]>\n"
- "<doc>&foo;</doc>\n";
-
- XML_SetStartElementHandler(g_parser, start_element_suspender);
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_SUSPENDED)
- xml_failure(g_parser);
- if (XML_ResumeParser(g_parser) != XML_STATUS_ERROR)
- fail("Syntax error in entity not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_TAG_MISMATCH)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test suspending and resuming in a parameter entity substitution */
-static void XMLCALL
-element_decl_suspender(void *userData, const XML_Char *name,
- XML_Content *model) {
- UNUSED_P(userData);
- UNUSED_P(name);
- XML_StopParser(g_parser, XML_TRUE);
- XML_FreeContentModel(g_parser, model);
-}
-
-START_TEST(test_suspend_resume_parameter_entity) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ENTITY % foo '<!ELEMENT doc (#PCDATA)*>'>\n"
- "%foo;\n"
- "]>\n"
- "<doc>Hello, world</doc>";
- const XML_Char *expected = XCS("Hello, world");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetElementDeclHandler(g_parser, element_decl_suspender);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
- XML_SetUserData(g_parser, &storage);
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_SUSPENDED)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, XCS(""));
- if (XML_ResumeParser(g_parser) != XML_STATUS_OK)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test attempting to use parser after an error is faulted */
-START_TEST(test_restart_on_error) {
- const char *text = "<$doc><doc></doc>";
-
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Invalid tag name not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
- xml_failure(g_parser);
- if (XML_Parse(g_parser, NULL, 0, XML_TRUE) != XML_STATUS_ERROR)
- fail("Restarting invalid parse not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test that angle brackets in an attribute default value are faulted */
-START_TEST(test_reject_lt_in_attribute_value) {
- const char *text = "<!DOCTYPE doc [<!ATTLIST doc a CDATA '<bar>'>]>\n"
- "<doc></doc>";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Bad attribute default not faulted");
-}
-END_TEST
-
-START_TEST(test_reject_unfinished_param_in_att_value) {
- const char *text = "<!DOCTYPE doc [<!ATTLIST doc a CDATA '&foo'>]>\n"
- "<doc></doc>";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Bad attribute default not faulted");
-}
-END_TEST
-
-START_TEST(test_trailing_cr_in_att_value) {
- const char *text = "<doc a='value\r'/>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
+#include "common.h"
-/* Try parsing a general entity within a parameter entity in a
- * standalone internal DTD. Covers a corner case in the parser.
- */
-START_TEST(test_standalone_internal_entity) {
- const char *text = "<?xml version='1.0' standalone='yes' ?>\n"
- "<!DOCTYPE doc [\n"
- " <!ELEMENT doc (#PCDATA)>\n"
- " <!ENTITY % pe '<!ATTLIST doc att2 CDATA \"&ge;\">'>\n"
- " <!ENTITY ge 'AttDefaultValue'>\n"
- " %pe;\n"
- "]>\n"
- "<doc att2='any'/>";
+#include "basic_tests.h"
+#include "ns_tests.h"
+#include "misc_tests.h"
+#include "alloc_tests.h"
+#include "nsalloc_tests.h"
+#include "acc_tests.h"
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test that a reference to an unknown external entity is skipped */
-START_TEST(test_skipped_external_entity) {
- const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
- "<doc></doc>\n";
- ExtTest test_data = {"<!ELEMENT doc EMPTY>\n"
- "<!ENTITY % e2 '%e1;'>\n",
- NULL, NULL};
-
- XML_SetUserData(g_parser, &test_data);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test a different form of unknown external entity */
-typedef struct ext_hdlr_data {
- const char *parse_text;
- XML_ExternalEntityRefHandler handler;
-} ExtHdlrData;
-
-static int XMLCALL
-external_entity_oneshot_loader(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- ExtHdlrData *test_data = (ExtHdlrData *)XML_GetUserData(parser);
- XML_Parser ext_parser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser.");
- /* Use the requested entity parser for further externals */
- XML_SetExternalEntityRefHandler(ext_parser, test_data->handler);
- if (_XML_Parse_SINGLE_BYTES(ext_parser, test_data->parse_text,
- (int)strlen(test_data->parse_text), XML_TRUE)
- == XML_STATUS_ERROR) {
- xml_failure(ext_parser);
- }
-
- XML_ParserFree(ext_parser);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_skipped_null_loaded_ext_entity) {
- const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/one.ent'>\n"
- "<doc />";
- ExtHdlrData test_data
- = {"<!ENTITY % pe1 SYSTEM 'http://example.org/two.ent'>\n"
- "<!ENTITY % pe2 '%pe1;'>\n"
- "%pe2;\n",
- external_entity_null_loader};
-
- XML_SetUserData(g_parser, &test_data);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_oneshot_loader);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_skipped_unloaded_ext_entity) {
- const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/one.ent'>\n"
- "<doc />";
- ExtHdlrData test_data
- = {"<!ENTITY % pe1 SYSTEM 'http://example.org/two.ent'>\n"
- "<!ENTITY % pe2 '%pe1;'>\n"
- "%pe2;\n",
- NULL};
-
- XML_SetUserData(g_parser, &test_data);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_oneshot_loader);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test that a parameter entity value ending with a carriage return
- * has it translated internally into a newline.
- */
-START_TEST(test_param_entity_with_trailing_cr) {
-#define PARAM_ENTITY_NAME "pe"
-#define PARAM_ENTITY_CORE_VALUE "<!ATTLIST doc att CDATA \"default\">"
- const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
- "<doc/>";
- ExtTest test_data
- = {"<!ENTITY % " PARAM_ENTITY_NAME " '" PARAM_ENTITY_CORE_VALUE "\r'>\n"
- "%" PARAM_ENTITY_NAME ";\n",
- NULL, NULL};
-
- XML_SetUserData(g_parser, &test_data);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader);
- XML_SetEntityDeclHandler(g_parser, param_entity_match_handler);
- entity_name_to_match = XCS(PARAM_ENTITY_NAME);
- entity_value_to_match = XCS(PARAM_ENTITY_CORE_VALUE) XCS("\n");
- entity_match_flag = ENTITY_MATCH_NOT_FOUND;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (entity_match_flag == ENTITY_MATCH_FAIL)
- fail("Parameter entity CR->NEWLINE conversion failed");
- else if (entity_match_flag == ENTITY_MATCH_NOT_FOUND)
- fail("Parameter entity not parsed");
-}
-#undef PARAM_ENTITY_NAME
-#undef PARAM_ENTITY_CORE_VALUE
-END_TEST
-
-START_TEST(test_invalid_character_entity) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY entity '&#x110000;'>\n"
- "]>\n"
- "<doc>&entity;</doc>";
-
- expect_failure(text, XML_ERROR_BAD_CHAR_REF,
- "Out of range character reference not faulted");
-}
-END_TEST
-
-START_TEST(test_invalid_character_entity_2) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY entity '&#xg0;'>\n"
- "]>\n"
- "<doc>&entity;</doc>";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Out of range character reference not faulted");
-}
-END_TEST
-
-START_TEST(test_invalid_character_entity_3) {
- const char text[] =
- /* <!DOCTYPE doc [\n */
- "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0o\0c\0 \0[\0\n"
- /* U+0E04 = KHO KHWAI
- * U+0E08 = CHO CHAN */
- /* <!ENTITY entity '&\u0e04\u0e08;'>\n */
- "\0<\0!\0E\0N\0T\0I\0T\0Y\0 \0e\0n\0t\0i\0t\0y\0 "
- "\0'\0&\x0e\x04\x0e\x08\0;\0'\0>\0\n"
- /* ]>\n */
- "\0]\0>\0\n"
- /* <doc>&entity;</doc> */
- "\0<\0d\0o\0c\0>\0&\0e\0n\0t\0i\0t\0y\0;\0<\0/\0d\0o\0c\0>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Invalid start of entity name not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_UNDEFINED_ENTITY)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_invalid_character_entity_4) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY entity '&#1114112;'>\n" /* = &#x110000 */
- "]>\n"
- "<doc>&entity;</doc>";
-
- expect_failure(text, XML_ERROR_BAD_CHAR_REF,
- "Out of range character reference not faulted");
-}
-END_TEST
-
-/* Test that processing instructions are picked up by a default handler */
-START_TEST(test_pi_handled_in_default) {
- const char *text = "<?test processing instruction?>\n<doc/>";
- const XML_Char *expected = XCS("<?test processing instruction?>\n<doc/>");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetDefaultHandler(g_parser, accumulate_characters);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test that comments are picked up by a default handler */
-START_TEST(test_comment_handled_in_default) {
- const char *text = "<!-- This is a comment -->\n<doc/>";
- const XML_Char *expected = XCS("<!-- This is a comment -->\n<doc/>");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetDefaultHandler(g_parser, accumulate_characters);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test PIs that look almost but not quite like XML declarations */
-static void XMLCALL
-accumulate_pi_characters(void *userData, const XML_Char *target,
- const XML_Char *data) {
- CharData *storage = (CharData *)userData;
-
- CharData_AppendXMLChars(storage, target, -1);
- CharData_AppendXMLChars(storage, XCS(": "), 2);
- CharData_AppendXMLChars(storage, data, -1);
- CharData_AppendXMLChars(storage, XCS("\n"), 1);
-}
-
-START_TEST(test_pi_yml) {
- const char *text = "<?yml something like data?><doc/>";
- const XML_Char *expected = XCS("yml: something like data\n");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_pi_xnl) {
- const char *text = "<?xnl nothing like data?><doc/>";
- const XML_Char *expected = XCS("xnl: nothing like data\n");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_pi_xmm) {
- const char *text = "<?xmm everything like data?><doc/>";
- const XML_Char *expected = XCS("xmm: everything like data\n");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_utf16_pi) {
- const char text[] =
- /* <?{KHO KHWAI}{CHO CHAN}?>
- * where {KHO KHWAI} = U+0E04
- * and {CHO CHAN} = U+0E08
- */
- "<\0?\0\x04\x0e\x08\x0e?\0>\0"
- /* <q/> */
- "<\0q\0/\0>\0";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x0e04\x0e08: \n");
-#else
- const XML_Char *expected = XCS("\xe0\xb8\x84\xe0\xb8\x88: \n");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_utf16_be_pi) {
- const char text[] =
- /* <?{KHO KHWAI}{CHO CHAN}?>
- * where {KHO KHWAI} = U+0E04
- * and {CHO CHAN} = U+0E08
- */
- "\0<\0?\x0e\x04\x0e\x08\0?\0>"
- /* <q/> */
- "\0<\0q\0/\0>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x0e04\x0e08: \n");
-#else
- const XML_Char *expected = XCS("\xe0\xb8\x84\xe0\xb8\x88: \n");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetProcessingInstructionHandler(g_parser, accumulate_pi_characters);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test that comments can be picked up and translated */
-static void XMLCALL
-accumulate_comment(void *userData, const XML_Char *data) {
- CharData *storage = (CharData *)userData;
-
- CharData_AppendXMLChars(storage, data, -1);
-}
-
-START_TEST(test_utf16_be_comment) {
- const char text[] =
- /* <!-- Comment A --> */
- "\0<\0!\0-\0-\0 \0C\0o\0m\0m\0e\0n\0t\0 \0A\0 \0-\0-\0>\0\n"
- /* <doc/> */
- "\0<\0d\0o\0c\0/\0>";
- const XML_Char *expected = XCS(" Comment A ");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetCommentHandler(g_parser, accumulate_comment);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_utf16_le_comment) {
- const char text[] =
- /* <!-- Comment B --> */
- "<\0!\0-\0-\0 \0C\0o\0m\0m\0e\0n\0t\0 \0B\0 \0-\0-\0>\0\n\0"
- /* <doc/> */
- "<\0d\0o\0c\0/\0>\0";
- const XML_Char *expected = XCS(" Comment B ");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetCommentHandler(g_parser, accumulate_comment);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test that the unknown encoding handler with map entries that expect
- * conversion but no conversion function is faulted
- */
-static int XMLCALL
-failing_converter(void *data, const char *s) {
- UNUSED_P(data);
- UNUSED_P(s);
- /* Always claim to have failed */
- return -1;
-}
-
-static int XMLCALL
-prefix_converter(void *data, const char *s) {
- UNUSED_P(data);
- /* If the first byte is 0xff, raise an error */
- if (s[0] == (char)-1)
- return -1;
- /* Just add the low bits of the first byte to the second */
- return (s[1] + (s[0] & 0x7f)) & 0x01ff;
-}
-
-static int XMLCALL
-MiscEncodingHandler(void *data, const XML_Char *encoding, XML_Encoding *info) {
- int i;
- int high_map = -2; /* Assume a 2-byte sequence */
-
- if (! xcstrcmp(encoding, XCS("invalid-9"))
- || ! xcstrcmp(encoding, XCS("ascii-like"))
- || ! xcstrcmp(encoding, XCS("invalid-len"))
- || ! xcstrcmp(encoding, XCS("invalid-a"))
- || ! xcstrcmp(encoding, XCS("invalid-surrogate"))
- || ! xcstrcmp(encoding, XCS("invalid-high")))
- high_map = -1;
-
- for (i = 0; i < 128; ++i)
- info->map[i] = i;
- for (; i < 256; ++i)
- info->map[i] = high_map;
-
- /* If required, put an invalid value in the ASCII entries */
- if (! xcstrcmp(encoding, XCS("invalid-9")))
- info->map[9] = 5;
- /* If required, have a top-bit set character starts a 5-byte sequence */
- if (! xcstrcmp(encoding, XCS("invalid-len")))
- info->map[0x81] = -5;
- /* If required, make a top-bit set character a valid ASCII character */
- if (! xcstrcmp(encoding, XCS("invalid-a")))
- info->map[0x82] = 'a';
- /* If required, give a top-bit set character a forbidden value,
- * what would otherwise be the first of a surrogate pair.
- */
- if (! xcstrcmp(encoding, XCS("invalid-surrogate")))
- info->map[0x83] = 0xd801;
- /* If required, give a top-bit set character too high a value */
- if (! xcstrcmp(encoding, XCS("invalid-high")))
- info->map[0x84] = 0x010101;
-
- info->data = data;
- info->release = NULL;
- if (! xcstrcmp(encoding, XCS("failing-conv")))
- info->convert = failing_converter;
- else if (! xcstrcmp(encoding, XCS("prefix-conv")))
- info->convert = prefix_converter;
- else
- info->convert = NULL;
- return XML_STATUS_OK;
-}
-
-START_TEST(test_missing_encoding_conversion_fn) {
- const char *text = "<?xml version='1.0' encoding='no-conv'?>\n"
- "<doc>\x81</doc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- /* MiscEncodingHandler sets up an encoding with every top-bit-set
- * character introducing a two-byte sequence. For this, it
- * requires a convert function. The above function call doesn't
- * pass one through, so when BadEncodingHandler actually gets
- * called it should supply an invalid encoding.
- */
- expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
- "Encoding with missing convert() not faulted");
-}
-END_TEST
-
-START_TEST(test_failing_encoding_conversion_fn) {
- const char *text = "<?xml version='1.0' encoding='failing-conv'?>\n"
- "<doc>\x81</doc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- /* BadEncodingHandler sets up an encoding with every top-bit-set
- * character introducing a two-byte sequence. For this, it
- * requires a convert function. The above function call passes
- * one that insists all possible sequences are invalid anyway.
- */
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Encoding with failing convert() not faulted");
-}
-END_TEST
-
-/* Test unknown encoding conversions */
-START_TEST(test_unknown_encoding_success) {
- const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
- /* Equivalent to <eoc>Hello, world</eoc> */
- "<\x81\x64\x80oc>Hello, world</\x81\x64\x80oc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- run_character_check(text, XCS("Hello, world"));
-}
-END_TEST
-
-/* Test bad name character in unknown encoding */
-START_TEST(test_unknown_encoding_bad_name) {
- const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
- "<\xff\x64oc>Hello, world</\xff\x64oc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Bad name start in unknown encoding not faulted");
-}
-END_TEST
-
-/* Test bad mid-name character in unknown encoding */
-START_TEST(test_unknown_encoding_bad_name_2) {
- const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
- "<d\xffoc>Hello, world</d\xffoc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Bad name in unknown encoding not faulted");
-}
-END_TEST
-
-/* Test element name that is long enough to fill the conversion buffer
- * in an unknown encoding, finishing with an encoded character.
- */
-START_TEST(test_unknown_encoding_long_name_1) {
- const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
- "<abcdefghabcdefghabcdefghijkl\x80m\x80n\x80o\x80p>"
- "Hi"
- "</abcdefghabcdefghabcdefghijkl\x80m\x80n\x80o\x80p>";
- const XML_Char *expected = XCS("abcdefghabcdefghabcdefghijklmnop");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- XML_SetStartElementHandler(g_parser, record_element_start_handler);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test element name that is long enough to fill the conversion buffer
- * in an unknown encoding, finishing with an simple character.
- */
-START_TEST(test_unknown_encoding_long_name_2) {
- const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
- "<abcdefghabcdefghabcdefghijklmnop>"
- "Hi"
- "</abcdefghabcdefghabcdefghijklmnop>";
- const XML_Char *expected = XCS("abcdefghabcdefghabcdefghijklmnop");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- XML_SetStartElementHandler(g_parser, record_element_start_handler);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_invalid_unknown_encoding) {
- const char *text = "<?xml version='1.0' encoding='invalid-9'?>\n"
- "<doc>Hello world</doc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
- "Invalid unknown encoding not faulted");
-}
-END_TEST
-
-START_TEST(test_unknown_ascii_encoding_ok) {
- const char *text = "<?xml version='1.0' encoding='ascii-like'?>\n"
- "<doc>Hello, world</doc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- run_character_check(text, XCS("Hello, world"));
-}
-END_TEST
-
-START_TEST(test_unknown_ascii_encoding_fail) {
- const char *text = "<?xml version='1.0' encoding='ascii-like'?>\n"
- "<doc>Hello, \x80 world</doc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Invalid character not faulted");
-}
-END_TEST
-
-START_TEST(test_unknown_encoding_invalid_length) {
- const char *text = "<?xml version='1.0' encoding='invalid-len'?>\n"
- "<doc>Hello, world</doc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
- "Invalid unknown encoding not faulted");
-}
-END_TEST
-
-START_TEST(test_unknown_encoding_invalid_topbit) {
- const char *text = "<?xml version='1.0' encoding='invalid-a'?>\n"
- "<doc>Hello, world</doc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
- "Invalid unknown encoding not faulted");
-}
-END_TEST
-
-START_TEST(test_unknown_encoding_invalid_surrogate) {
- const char *text = "<?xml version='1.0' encoding='invalid-surrogate'?>\n"
- "<doc>Hello, \x82 world</doc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Invalid unknown encoding not faulted");
-}
-END_TEST
-
-START_TEST(test_unknown_encoding_invalid_high) {
- const char *text = "<?xml version='1.0' encoding='invalid-high'?>\n"
- "<doc>Hello, world</doc>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_UNKNOWN_ENCODING,
- "Invalid unknown encoding not faulted");
-}
-END_TEST
-
-START_TEST(test_unknown_encoding_invalid_attr_value) {
- const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
- "<doc attr='\xff\x30'/>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Invalid attribute valid not faulted");
-}
-END_TEST
-
-/* Test an external entity parser set to use latin-1 detects UTF-16
- * BOMs correctly.
- */
-enum ee_parse_flags { EE_PARSE_NONE = 0x00, EE_PARSE_FULL_BUFFER = 0x01 };
-
-typedef struct ExtTest2 {
- const char *parse_text;
- int parse_len;
- const XML_Char *encoding;
- CharData *storage;
- enum ee_parse_flags flags;
-} ExtTest2;
-
-static int XMLCALL
-external_entity_loader2(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- ExtTest2 *test_data = (ExtTest2 *)XML_GetUserData(parser);
- XML_Parser extparser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- extparser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (extparser == NULL)
- fail("Coulr not create external entity parser");
- if (test_data->encoding != NULL) {
- if (! XML_SetEncoding(extparser, test_data->encoding))
- fail("XML_SetEncoding() ignored for external entity");
- }
- if (test_data->flags & EE_PARSE_FULL_BUFFER) {
- if (XML_Parse(extparser, test_data->parse_text, test_data->parse_len,
- XML_TRUE)
- == XML_STATUS_ERROR) {
- xml_failure(extparser);
- }
- } else if (_XML_Parse_SINGLE_BYTES(extparser, test_data->parse_text,
- test_data->parse_len, XML_TRUE)
- == XML_STATUS_ERROR) {
- xml_failure(extparser);
- }
-
- XML_ParserFree(extparser);
- return XML_STATUS_OK;
-}
-
-/* Test that UTF-16 BOM does not select UTF-16 given explicit encoding */
-static void XMLCALL
-ext2_accumulate_characters(void *userData, const XML_Char *s, int len) {
- ExtTest2 *test_data = (ExtTest2 *)userData;
- accumulate_characters(test_data->storage, s, len);
-}
-
-START_TEST(test_ext_entity_latin1_utf16le_bom) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtTest2 test_data
- = {/* If UTF-16, 0xfeff is the BOM and 0x204c is black left bullet */
- /* If Latin-1, 0xff = Y-diaeresis, 0xfe = lowercase thorn,
- * 0x4c = L and 0x20 is a space
- */
- "\xff\xfe\x4c\x20", 4, XCS("iso-8859-1"), NULL, EE_PARSE_NONE};
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00ff\x00feL ");
-#else
- /* In UTF-8, y-diaeresis is 0xc3 0xbf, lowercase thorn is 0xc3 0xbe */
- const XML_Char *expected = XCS("\xc3\xbf\xc3\xbeL ");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- test_data.storage = &storage;
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
- XML_SetUserData(g_parser, &test_data);
- XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_ext_entity_latin1_utf16be_bom) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtTest2 test_data
- = {/* If UTF-16, 0xfeff is the BOM and 0x204c is black left bullet */
- /* If Latin-1, 0xff = Y-diaeresis, 0xfe = lowercase thorn,
- * 0x4c = L and 0x20 is a space
- */
- "\xfe\xff\x20\x4c", 4, XCS("iso-8859-1"), NULL, EE_PARSE_NONE};
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00fe\x00ff L");
-#else
- /* In UTF-8, y-diaeresis is 0xc3 0xbf, lowercase thorn is 0xc3 0xbe */
- const XML_Char *expected = XCS("\xc3\xbe\xc3\xbf L");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- test_data.storage = &storage;
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
- XML_SetUserData(g_parser, &test_data);
- XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Parsing the full buffer rather than a byte at a time makes a
- * difference to the encoding scanning code, so repeat the above tests
- * without breaking them down by byte.
- */
-START_TEST(test_ext_entity_latin1_utf16le_bom2) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtTest2 test_data
- = {/* If UTF-16, 0xfeff is the BOM and 0x204c is black left bullet */
- /* If Latin-1, 0xff = Y-diaeresis, 0xfe = lowercase thorn,
- * 0x4c = L and 0x20 is a space
- */
- "\xff\xfe\x4c\x20", 4, XCS("iso-8859-1"), NULL, EE_PARSE_FULL_BUFFER};
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00ff\x00feL ");
-#else
- /* In UTF-8, y-diaeresis is 0xc3 0xbf, lowercase thorn is 0xc3 0xbe */
- const XML_Char *expected = XCS("\xc3\xbf\xc3\xbeL ");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- test_data.storage = &storage;
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
- XML_SetUserData(g_parser, &test_data);
- XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_ext_entity_latin1_utf16be_bom2) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtTest2 test_data
- = {/* If UTF-16, 0xfeff is the BOM and 0x204c is black left bullet */
- /* If Latin-1, 0xff = Y-diaeresis, 0xfe = lowercase thorn,
- * 0x4c = L and 0x20 is a space
- */
- "\xfe\xff\x20\x4c", 4, XCS("iso-8859-1"), NULL, EE_PARSE_FULL_BUFFER};
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00fe\x00ff L");
-#else
- /* In UTF-8, y-diaeresis is 0xc3 0xbf, lowercase thorn is 0xc3 0xbe */
- const XML_Char *expected = "\xc3\xbe\xc3\xbf L";
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- test_data.storage = &storage;
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
- XML_SetUserData(g_parser, &test_data);
- XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
- if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test little-endian UTF-16 given an explicit big-endian encoding */
-START_TEST(test_ext_entity_utf16_be) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtTest2 test_data
- = {"<\0e\0/\0>\0", 8, XCS("utf-16be"), NULL, EE_PARSE_NONE};
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x3c00\x6500\x2f00\x3e00");
-#else
- const XML_Char *expected = XCS("\xe3\xb0\x80" /* U+3C00 */
- "\xe6\x94\x80" /* U+6500 */
- "\xe2\xbc\x80" /* U+2F00 */
- "\xe3\xb8\x80"); /* U+3E00 */
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- test_data.storage = &storage;
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
- XML_SetUserData(g_parser, &test_data);
- XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test big-endian UTF-16 given an explicit little-endian encoding */
-START_TEST(test_ext_entity_utf16_le) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtTest2 test_data
- = {"\0<\0e\0/\0>", 8, XCS("utf-16le"), NULL, EE_PARSE_NONE};
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x3c00\x6500\x2f00\x3e00");
-#else
- const XML_Char *expected = XCS("\xe3\xb0\x80" /* U+3C00 */
- "\xe6\x94\x80" /* U+6500 */
- "\xe2\xbc\x80" /* U+2F00 */
- "\xe3\xb8\x80"); /* U+3E00 */
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- test_data.storage = &storage;
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
- XML_SetUserData(g_parser, &test_data);
- XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test little-endian UTF-16 given no explicit encoding.
- * The existing default encoding (UTF-8) is assumed to hold without a
- * BOM to contradict it, so the entity value will in fact provoke an
- * error because 0x00 is not a valid XML character. We parse the
- * whole buffer in one go rather than feeding it in byte by byte to
- * exercise different code paths in the initial scanning routines.
- */
-typedef struct ExtFaults2 {
- const char *parse_text;
- int parse_len;
- const char *fail_text;
- const XML_Char *encoding;
- enum XML_Error error;
-} ExtFaults2;
-
-static int XMLCALL
-external_entity_faulter2(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- ExtFaults2 *test_data = (ExtFaults2 *)XML_GetUserData(parser);
- XML_Parser extparser;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- extparser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (extparser == NULL)
- fail("Could not create external entity parser");
- if (test_data->encoding != NULL) {
- if (! XML_SetEncoding(extparser, test_data->encoding))
- fail("XML_SetEncoding() ignored for external entity");
- }
- if (XML_Parse(extparser, test_data->parse_text, test_data->parse_len,
- XML_TRUE)
- != XML_STATUS_ERROR)
- fail(test_data->fail_text);
- if (XML_GetErrorCode(extparser) != test_data->error)
- xml_failure(extparser);
-
- XML_ParserFree(extparser);
- return XML_STATUS_ERROR;
-}
-
-START_TEST(test_ext_entity_utf16_unknown) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtFaults2 test_data
- = {"a\0b\0c\0", 6, "Invalid character in entity not faulted", NULL,
- XML_ERROR_INVALID_TOKEN};
-
- XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter2);
- XML_SetUserData(g_parser, &test_data);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Invalid character should not have been accepted");
-}
-END_TEST
-
-/* Test not-quite-UTF-8 BOM (0xEF 0xBB 0xBF) */
-START_TEST(test_ext_entity_utf8_non_bom) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtTest2 test_data
- = {"\xef\xbb\x80", /* Arabic letter DAD medial form, U+FEC0 */
- 3, NULL, NULL, EE_PARSE_NONE};
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\xfec0");
-#else
- const XML_Char *expected = XCS("\xef\xbb\x80");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- test_data.storage = &storage;
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
- XML_SetUserData(g_parser, &test_data);
- XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test that UTF-8 in a CDATA section is correctly passed through */
-START_TEST(test_utf8_in_cdata_section) {
- const char *text = "<doc><![CDATA[one \xc3\xa9 two]]></doc>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("one \x00e9 two");
-#else
- const XML_Char *expected = XCS("one \xc3\xa9 two");
-#endif
-
- run_character_check(text, expected);
-}
-END_TEST
-
-/* Test that little-endian UTF-16 in a CDATA section is handled */
-START_TEST(test_utf8_in_cdata_section_2) {
- const char *text = "<doc><![CDATA[\xc3\xa9]\xc3\xa9two]]></doc>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00e9]\x00e9two");
-#else
- const XML_Char *expected = XCS("\xc3\xa9]\xc3\xa9two");
-#endif
-
- run_character_check(text, expected);
-}
-END_TEST
-
-/* Test trailing spaces in elements are accepted */
-static void XMLCALL
-record_element_end_handler(void *userData, const XML_Char *name) {
- CharData *storage = (CharData *)userData;
-
- CharData_AppendXMLChars(storage, XCS("/"), 1);
- CharData_AppendXMLChars(storage, name, -1);
-}
-
-START_TEST(test_trailing_spaces_in_elements) {
- const char *text = "<doc >Hi</doc >";
- const XML_Char *expected = XCS("doc/doc");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetElementHandler(g_parser, record_element_start_handler,
- record_element_end_handler);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_utf16_attribute) {
- const char text[] =
- /* <d {KHO KHWAI}{CHO CHAN}='a'/>
- * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
- * and {CHO CHAN} = U+0E08 = 0xe0 0xb8 0x88 in UTF-8
- */
- "<\0d\0 \0\x04\x0e\x08\x0e=\0'\0a\0'\0/\0>\0";
- const XML_Char *expected = XCS("a");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetStartElementHandler(g_parser, accumulate_attribute);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_utf16_second_attr) {
- /* <d a='1' {KHO KHWAI}{CHO CHAN}='2'/>
- * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
- * and {CHO CHAN} = U+0E08 = 0xe0 0xb8 0x88 in UTF-8
- */
- const char text[] = "<\0d\0 \0a\0=\0'\0\x31\0'\0 \0"
- "\x04\x0e\x08\x0e=\0'\0\x32\0'\0/\0>\0";
- const XML_Char *expected = XCS("1");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetStartElementHandler(g_parser, accumulate_attribute);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_attr_after_solidus) {
- const char *text = "<doc attr1='a' / attr2='b'>";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN, "Misplaced / not faulted");
-}
-END_TEST
-
-static void XMLCALL
-accumulate_entity_decl(void *userData, const XML_Char *entityName,
- int is_parameter_entity, const XML_Char *value,
- int value_length, const XML_Char *base,
- const XML_Char *systemId, const XML_Char *publicId,
- const XML_Char *notationName) {
- CharData *storage = (CharData *)userData;
-
- UNUSED_P(is_parameter_entity);
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- UNUSED_P(notationName);
- CharData_AppendXMLChars(storage, entityName, -1);
- CharData_AppendXMLChars(storage, XCS("="), 1);
- CharData_AppendXMLChars(storage, value, value_length);
- CharData_AppendXMLChars(storage, XCS("\n"), 1);
-}
-
-START_TEST(test_utf16_pe) {
- /* <!DOCTYPE doc [
- * <!ENTITY % {KHO KHWAI}{CHO CHAN} '<!ELEMENT doc (#PCDATA)>'>
- * %{KHO KHWAI}{CHO CHAN};
- * ]>
- * <doc></doc>
- *
- * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
- * and {CHO CHAN} = U+0E08 = 0xe0 0xb8 0x88 in UTF-8
- */
- const char text[] = "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0o\0c\0 \0[\0\n"
- "\0<\0!\0E\0N\0T\0I\0T\0Y\0 \0%\0 \x0e\x04\x0e\x08\0 "
- "\0'\0<\0!\0E\0L\0E\0M\0E\0N\0T\0 "
- "\0d\0o\0c\0 \0(\0#\0P\0C\0D\0A\0T\0A\0)\0>\0'\0>\0\n"
- "\0%\x0e\x04\x0e\x08\0;\0\n"
- "\0]\0>\0\n"
- "\0<\0d\0o\0c\0>\0<\0/\0d\0o\0c\0>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x0e04\x0e08=<!ELEMENT doc (#PCDATA)>\n");
-#else
- const XML_Char *expected
- = XCS("\xe0\xb8\x84\xe0\xb8\x88=<!ELEMENT doc (#PCDATA)>\n");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetEntityDeclHandler(g_parser, accumulate_entity_decl);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test that duff attribute description keywords are rejected */
-START_TEST(test_bad_attr_desc_keyword) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ATTLIST doc attr CDATA #!IMPLIED>\n"
- "]>\n"
- "<doc />";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Bad keyword !IMPLIED not faulted");
-}
-END_TEST
-
-/* Test that an invalid attribute description keyword consisting of
- * UTF-16 characters with their top bytes non-zero are correctly
- * faulted
- */
-START_TEST(test_bad_attr_desc_keyword_utf16) {
- /* <!DOCTYPE d [
- * <!ATTLIST d a CDATA #{KHO KHWAI}{CHO CHAN}>
- * ]><d/>
- *
- * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
- * and {CHO CHAN} = U+0E08 = 0xe0 0xb8 0x88 in UTF-8
- */
- const char text[]
- = "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 \0[\0\n"
- "\0<\0!\0A\0T\0T\0L\0I\0S\0T\0 \0d\0 \0a\0 \0C\0D\0A\0T\0A\0 "
- "\0#\x0e\x04\x0e\x08\0>\0\n"
- "\0]\0>\0<\0d\0/\0>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Invalid UTF16 attribute keyword not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_SYNTAX)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test that invalid syntax in a <!DOCTYPE> is rejected. Do this
- * using prefix-encoding (see above) to trigger specific code paths
- */
-START_TEST(test_bad_doctype) {
- const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
- "<!DOCTYPE doc [ \x80\x44 ]><doc/>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- expect_failure(text, XML_ERROR_SYNTAX,
- "Invalid bytes in DOCTYPE not faulted");
-}
-END_TEST
-
-START_TEST(test_bad_doctype_utf16) {
- const char text[] =
- /* <!DOCTYPE doc [ \x06f2 ]><doc/>
- *
- * U+06F2 = EXTENDED ARABIC-INDIC DIGIT TWO, a valid number
- * (name character) but not a valid letter (name start character)
- */
- "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0o\0c\0 \0[\0 "
- "\x06\xf2"
- "\0 \0]\0>\0<\0d\0o\0c\0/\0>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Invalid bytes in DOCTYPE not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_SYNTAX)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_bad_doctype_plus) {
- const char *text = "<!DOCTYPE 1+ [ <!ENTITY foo 'bar'> ]>\n"
- "<1+>&foo;</1+>";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "'+' in document name not faulted");
-}
-END_TEST
-
-START_TEST(test_bad_doctype_star) {
- const char *text = "<!DOCTYPE 1* [ <!ENTITY foo 'bar'> ]>\n"
- "<1*>&foo;</1*>";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "'*' in document name not faulted");
-}
-END_TEST
-
-START_TEST(test_bad_doctype_query) {
- const char *text = "<!DOCTYPE 1? [ <!ENTITY foo 'bar'> ]>\n"
- "<1?>&foo;</1?>";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "'?' in document name not faulted");
-}
-END_TEST
-
-START_TEST(test_unknown_encoding_bad_ignore) {
- const char *text = "<?xml version='1.0' encoding='prefix-conv'?>"
- "<!DOCTYPE doc SYSTEM 'foo'>"
- "<doc><e>&entity;</e></doc>";
- ExtFaults fault = {"<![IGNORE[<!ELEMENT \xffG (#PCDATA)*>]]>",
- "Invalid character not faulted", XCS("prefix-conv"),
- XML_ERROR_INVALID_TOKEN};
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
- XML_SetUserData(g_parser, &fault);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Bad IGNORE section with unknown encoding not failed");
-}
-END_TEST
-
-START_TEST(test_entity_in_utf16_be_attr) {
- const char text[] =
- /* <e a='&#228; &#x00E4;'></e> */
- "\0<\0e\0 \0a\0=\0'\0&\0#\0\x32\0\x32\0\x38\0;\0 "
- "\0&\0#\0x\0\x30\0\x30\0E\0\x34\0;\0'\0>\0<\0/\0e\0>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00e4 \x00e4");
-#else
- const XML_Char *expected = XCS("\xc3\xa4 \xc3\xa4");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetStartElementHandler(g_parser, accumulate_attribute);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_entity_in_utf16_le_attr) {
- const char text[] =
- /* <e a='&#228; &#x00E4;'></e> */
- "<\0e\0 \0a\0=\0'\0&\0#\0\x32\0\x32\0\x38\0;\0 \0"
- "&\0#\0x\0\x30\0\x30\0E\0\x34\0;\0'\0>\0<\0/\0e\0>\0";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("\x00e4 \x00e4");
-#else
- const XML_Char *expected = XCS("\xc3\xa4 \xc3\xa4");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetStartElementHandler(g_parser, accumulate_attribute);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_entity_public_utf16_be) {
- const char text[] =
- /* <!DOCTYPE d [ */
- "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 \0[\0\n"
- /* <!ENTITY % e PUBLIC 'foo' 'bar.ent'> */
- "\0<\0!\0E\0N\0T\0I\0T\0Y\0 \0%\0 \0e\0 \0P\0U\0B\0L\0I\0C\0 "
- "\0'\0f\0o\0o\0'\0 \0'\0b\0a\0r\0.\0e\0n\0t\0'\0>\0\n"
- /* %e; */
- "\0%\0e\0;\0\n"
- /* ]> */
- "\0]\0>\0\n"
- /* <d>&j;</d> */
- "\0<\0d\0>\0&\0j\0;\0<\0/\0d\0>";
- ExtTest2 test_data = {/* <!ENTITY j 'baz'> */
- "\0<\0!\0E\0N\0T\0I\0T\0Y\0 \0j\0 \0'\0b\0a\0z\0'\0>",
- 34, NULL, NULL, EE_PARSE_NONE};
- const XML_Char *expected = XCS("baz");
- CharData storage;
-
- CharData_Init(&storage);
- test_data.storage = &storage;
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
- XML_SetUserData(g_parser, &test_data);
- XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_entity_public_utf16_le) {
- const char text[] =
- /* <!DOCTYPE d [ */
- "<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 \0[\0\n\0"
- /* <!ENTITY % e PUBLIC 'foo' 'bar.ent'> */
- "<\0!\0E\0N\0T\0I\0T\0Y\0 \0%\0 \0e\0 \0P\0U\0B\0L\0I\0C\0 \0"
- "'\0f\0o\0o\0'\0 \0'\0b\0a\0r\0.\0e\0n\0t\0'\0>\0\n\0"
- /* %e; */
- "%\0e\0;\0\n\0"
- /* ]> */
- "]\0>\0\n\0"
- /* <d>&j;</d> */
- "<\0d\0>\0&\0j\0;\0<\0/\0d\0>\0";
- ExtTest2 test_data = {/* <!ENTITY j 'baz'> */
- "<\0!\0E\0N\0T\0I\0T\0Y\0 \0j\0 \0'\0b\0a\0z\0'\0>\0",
- 34, NULL, NULL, EE_PARSE_NONE};
- const XML_Char *expected = XCS("baz");
- CharData storage;
-
- CharData_Init(&storage);
- test_data.storage = &storage;
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_loader2);
- XML_SetUserData(g_parser, &test_data);
- XML_SetCharacterDataHandler(g_parser, ext2_accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-/* Test that a doctype with neither an internal nor external subset is
- * faulted
- */
-START_TEST(test_short_doctype) {
- const char *text = "<!DOCTYPE doc></doc>";
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "DOCTYPE without subset not rejected");
-}
-END_TEST
-
-START_TEST(test_short_doctype_2) {
- const char *text = "<!DOCTYPE doc PUBLIC></doc>";
- expect_failure(text, XML_ERROR_SYNTAX,
- "DOCTYPE without Public ID not rejected");
-}
-END_TEST
-
-START_TEST(test_short_doctype_3) {
- const char *text = "<!DOCTYPE doc SYSTEM></doc>";
- expect_failure(text, XML_ERROR_SYNTAX,
- "DOCTYPE without System ID not rejected");
-}
-END_TEST
-
-START_TEST(test_long_doctype) {
- const char *text = "<!DOCTYPE doc PUBLIC 'foo' 'bar' 'baz'></doc>";
- expect_failure(text, XML_ERROR_SYNTAX, "DOCTYPE with extra ID not rejected");
-}
-END_TEST
-
-START_TEST(test_bad_entity) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY foo PUBLIC>\n"
- "]>\n"
- "<doc/>";
- expect_failure(text, XML_ERROR_SYNTAX,
- "ENTITY without Public ID is not rejected");
-}
-END_TEST
-
-/* Test unquoted value is faulted */
-START_TEST(test_bad_entity_2) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY % foo bar>\n"
- "]>\n"
- "<doc/>";
- expect_failure(text, XML_ERROR_SYNTAX,
- "ENTITY without Public ID is not rejected");
-}
-END_TEST
-
-START_TEST(test_bad_entity_3) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY % foo PUBLIC>\n"
- "]>\n"
- "<doc/>";
- expect_failure(text, XML_ERROR_SYNTAX,
- "Parameter ENTITY without Public ID is not rejected");
-}
-END_TEST
-
-START_TEST(test_bad_entity_4) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY % foo SYSTEM>\n"
- "]>\n"
- "<doc/>";
- expect_failure(text, XML_ERROR_SYNTAX,
- "Parameter ENTITY without Public ID is not rejected");
-}
-END_TEST
-
-START_TEST(test_bad_notation) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!NOTATION n SYSTEM>\n"
- "]>\n"
- "<doc/>";
- expect_failure(text, XML_ERROR_SYNTAX,
- "Notation without System ID is not rejected");
-}
-END_TEST
-
-/* Test for issue #11, wrongly suppressed default handler */
-typedef struct default_check {
- const XML_Char *expected;
- const int expectedLen;
- XML_Bool seen;
-} DefaultCheck;
-
-static void XMLCALL
-checking_default_handler(void *userData, const XML_Char *s, int len) {
- DefaultCheck *data = (DefaultCheck *)userData;
- int i;
-
- for (i = 0; data[i].expected != NULL; i++) {
- if (data[i].expectedLen == len
- && ! memcmp(data[i].expected, s, len * sizeof(XML_Char))) {
- data[i].seen = XML_TRUE;
- break;
- }
- }
-}
-
-START_TEST(test_default_doctype_handler) {
- const char *text = "<!DOCTYPE doc PUBLIC 'pubname' 'test.dtd' [\n"
- " <!ENTITY foo 'bar'>\n"
- "]>\n"
- "<doc>&foo;</doc>";
- DefaultCheck test_data[] = {{XCS("'pubname'"), 9, XML_FALSE},
- {XCS("'test.dtd'"), 10, XML_FALSE},
- {NULL, 0, XML_FALSE}};
- int i;
-
- XML_SetUserData(g_parser, &test_data);
- XML_SetDefaultHandler(g_parser, checking_default_handler);
- XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- for (i = 0; test_data[i].expected != NULL; i++)
- if (! test_data[i].seen)
- fail("Default handler not run for public !DOCTYPE");
-}
-END_TEST
-
-START_TEST(test_empty_element_abort) {
- const char *text = "<abort/>";
-
- XML_SetStartElementHandler(g_parser, start_element_suspender);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Expected to error on abort");
-}
-END_TEST
-
-/*
- * Namespaces tests.
- */
-
-static void
-namespace_setup(void) {
- g_parser = XML_ParserCreateNS(NULL, XCS(' '));
- if (g_parser == NULL)
- fail("Parser not created.");
-}
-
-static void
-namespace_teardown(void) {
- basic_teardown();
-}
-
-/* Check that an element name and attribute name match the expected values.
- The expected values are passed as an array reference of string pointers
- provided as the userData argument; the first is the expected
- element name, and the second is the expected attribute name.
-*/
-static int triplet_start_flag = XML_FALSE;
-static int triplet_end_flag = XML_FALSE;
-
-static void XMLCALL
-triplet_start_checker(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- XML_Char **elemstr = (XML_Char **)userData;
- char buffer[1024];
- if (xcstrcmp(elemstr[0], name) != 0) {
- sprintf(buffer, "unexpected start string: '%" XML_FMT_STR "'", name);
- fail(buffer);
- }
- if (xcstrcmp(elemstr[1], atts[0]) != 0) {
- sprintf(buffer, "unexpected attribute string: '%" XML_FMT_STR "'", atts[0]);
- fail(buffer);
- }
- triplet_start_flag = XML_TRUE;
-}
-
-/* Check that the element name passed to the end-element handler matches
- the expected value. The expected value is passed as the first element
- in an array of strings passed as the userData argument.
-*/
-static void XMLCALL
-triplet_end_checker(void *userData, const XML_Char *name) {
- XML_Char **elemstr = (XML_Char **)userData;
- if (xcstrcmp(elemstr[0], name) != 0) {
- char buffer[1024];
- sprintf(buffer, "unexpected end string: '%" XML_FMT_STR "'", name);
- fail(buffer);
- }
- triplet_end_flag = XML_TRUE;
-}
-
-START_TEST(test_return_ns_triplet) {
- const char *text = "<foo:e xmlns:foo='http://example.org/' bar:a='12'\n"
- " xmlns:bar='http://example.org/'>";
- const char *epilog = "</foo:e>";
- const XML_Char *elemstr[]
- = {XCS("http://example.org/ e foo"), XCS("http://example.org/ a bar")};
- XML_SetReturnNSTriplet(g_parser, XML_TRUE);
- XML_SetUserData(g_parser, (void *)elemstr);
- XML_SetElementHandler(g_parser, triplet_start_checker, triplet_end_checker);
- XML_SetNamespaceDeclHandler(g_parser, dummy_start_namespace_decl_handler,
- dummy_end_namespace_decl_handler);
- triplet_start_flag = XML_FALSE;
- triplet_end_flag = XML_FALSE;
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (! triplet_start_flag)
- fail("triplet_start_checker not invoked");
- /* Check that unsetting "return triplets" fails while still parsing */
- XML_SetReturnNSTriplet(g_parser, XML_FALSE);
- if (_XML_Parse_SINGLE_BYTES(g_parser, epilog, (int)strlen(epilog), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (! triplet_end_flag)
- fail("triplet_end_checker not invoked");
- if (dummy_handler_flags
- != (DUMMY_START_NS_DECL_HANDLER_FLAG | DUMMY_END_NS_DECL_HANDLER_FLAG))
- fail("Namespace handlers not called");
-}
-END_TEST
-
-static void XMLCALL
-overwrite_start_checker(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- CharData *storage = (CharData *)userData;
- CharData_AppendXMLChars(storage, XCS("start "), 6);
- CharData_AppendXMLChars(storage, name, -1);
- while (*atts != NULL) {
- CharData_AppendXMLChars(storage, XCS("\nattribute "), 11);
- CharData_AppendXMLChars(storage, *atts, -1);
- atts += 2;
- }
- CharData_AppendXMLChars(storage, XCS("\n"), 1);
-}
-
-static void XMLCALL
-overwrite_end_checker(void *userData, const XML_Char *name) {
- CharData *storage = (CharData *)userData;
- CharData_AppendXMLChars(storage, XCS("end "), 4);
- CharData_AppendXMLChars(storage, name, -1);
- CharData_AppendXMLChars(storage, XCS("\n"), 1);
-}
-
-static void
-run_ns_tagname_overwrite_test(const char *text, const XML_Char *result) {
- CharData storage;
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetElementHandler(g_parser, overwrite_start_checker,
- overwrite_end_checker);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, result);
-}
-
-/* Regression test for SF bug #566334. */
-START_TEST(test_ns_tagname_overwrite) {
- const char *text = "<n:e xmlns:n='http://example.org/'>\n"
- " <n:f n:attr='foo'/>\n"
- " <n:g n:attr2='bar'/>\n"
- "</n:e>";
- const XML_Char *result = XCS("start http://example.org/ e\n")
- XCS("start http://example.org/ f\n")
- XCS("attribute http://example.org/ attr\n")
- XCS("end http://example.org/ f\n")
- XCS("start http://example.org/ g\n")
- XCS("attribute http://example.org/ attr2\n")
- XCS("end http://example.org/ g\n")
- XCS("end http://example.org/ e\n");
- run_ns_tagname_overwrite_test(text, result);
-}
-END_TEST
-
-/* Regression test for SF bug #566334. */
-START_TEST(test_ns_tagname_overwrite_triplet) {
- const char *text = "<n:e xmlns:n='http://example.org/'>\n"
- " <n:f n:attr='foo'/>\n"
- " <n:g n:attr2='bar'/>\n"
- "</n:e>";
- const XML_Char *result = XCS("start http://example.org/ e n\n")
- XCS("start http://example.org/ f n\n")
- XCS("attribute http://example.org/ attr n\n")
- XCS("end http://example.org/ f n\n")
- XCS("start http://example.org/ g n\n")
- XCS("attribute http://example.org/ attr2 n\n")
- XCS("end http://example.org/ g n\n")
- XCS("end http://example.org/ e n\n");
- XML_SetReturnNSTriplet(g_parser, XML_TRUE);
- run_ns_tagname_overwrite_test(text, result);
-}
-END_TEST
-
-/* Regression test for SF bug #620343. */
-static void XMLCALL
-start_element_fail(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- UNUSED_P(userData);
- UNUSED_P(name);
- UNUSED_P(atts);
-
- /* We should never get here. */
- fail("should never reach start_element_fail()");
-}
-
-static void XMLCALL
-start_ns_clearing_start_element(void *userData, const XML_Char *prefix,
- const XML_Char *uri) {
- UNUSED_P(prefix);
- UNUSED_P(uri);
- XML_SetStartElementHandler((XML_Parser)userData, NULL);
-}
-
-START_TEST(test_start_ns_clears_start_element) {
- /* This needs to use separate start/end tags; using the empty tag
- syntax doesn't cause the problematic path through Expat to be
- taken.
- */
- const char *text = "<e xmlns='http://example.org/'></e>";
-
- XML_SetStartElementHandler(g_parser, start_element_fail);
- XML_SetStartNamespaceDeclHandler(g_parser, start_ns_clearing_start_element);
- XML_SetEndNamespaceDeclHandler(g_parser, dummy_end_namespace_decl_handler);
- XML_UseParserAsHandlerArg(g_parser);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Regression test for SF bug #616863. */
-static int XMLCALL
-external_entity_handler(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- intptr_t callno = 1 + (intptr_t)XML_GetUserData(parser);
- const char *text;
- XML_Parser p2;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- if (callno == 1)
- text = ("<!ELEMENT doc (e+)>\n"
- "<!ATTLIST doc xmlns CDATA #IMPLIED>\n"
- "<!ELEMENT e EMPTY>\n");
- else
- text = ("<?xml version='1.0' encoding='us-ascii'?>"
- "<e/>");
-
- XML_SetUserData(parser, (void *)callno);
- p2 = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (_XML_Parse_SINGLE_BYTES(p2, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR) {
- xml_failure(p2);
- return XML_STATUS_ERROR;
- }
- XML_ParserFree(p2);
- return XML_STATUS_OK;
-}
-
-START_TEST(test_default_ns_from_ext_subset_and_ext_ge) {
- const char *text = "<?xml version='1.0'?>\n"
- "<!DOCTYPE doc SYSTEM 'http://example.org/doc.dtd' [\n"
- " <!ENTITY en SYSTEM 'http://example.org/entity.ent'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/ns1'>\n"
- "&en;\n"
- "</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_handler);
- /* We actually need to set this handler to tickle this bug. */
- XML_SetStartElementHandler(g_parser, dummy_start_element);
- XML_SetUserData(g_parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Regression test #1 for SF bug #673791. */
-START_TEST(test_ns_prefix_with_empty_uri_1) {
- const char *text = "<doc xmlns:prefix='http://example.org/'>\n"
- " <e xmlns:prefix=''/>\n"
- "</doc>";
-
- expect_failure(text, XML_ERROR_UNDECLARING_PREFIX,
- "Did not report re-setting namespace"
- " URI with prefix to ''.");
-}
-END_TEST
-
-/* Regression test #2 for SF bug #673791. */
-START_TEST(test_ns_prefix_with_empty_uri_2) {
- const char *text = "<?xml version='1.0'?>\n"
- "<docelem xmlns:pre=''/>";
-
- expect_failure(text, XML_ERROR_UNDECLARING_PREFIX,
- "Did not report setting namespace URI with prefix to ''.");
-}
-END_TEST
-
-/* Regression test #3 for SF bug #673791. */
-START_TEST(test_ns_prefix_with_empty_uri_3) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ELEMENT doc EMPTY>\n"
- " <!ATTLIST doc\n"
- " xmlns:prefix CDATA ''>\n"
- "]>\n"
- "<doc/>";
-
- expect_failure(text, XML_ERROR_UNDECLARING_PREFIX,
- "Didn't report attr default setting NS w/ prefix to ''.");
-}
-END_TEST
-
-/* Regression test #4 for SF bug #673791. */
-START_TEST(test_ns_prefix_with_empty_uri_4) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ELEMENT prefix:doc EMPTY>\n"
- " <!ATTLIST prefix:doc\n"
- " xmlns:prefix CDATA 'http://example.org/'>\n"
- "]>\n"
- "<prefix:doc/>";
- /* Packaged info expected by the end element handler;
- the weird structuring lets us re-use the triplet_end_checker()
- function also used for another test. */
- const XML_Char *elemstr[] = {XCS("http://example.org/ doc prefix")};
- XML_SetReturnNSTriplet(g_parser, XML_TRUE);
- XML_SetUserData(g_parser, (void *)elemstr);
- XML_SetEndElementHandler(g_parser, triplet_end_checker);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test with non-xmlns prefix */
-START_TEST(test_ns_unbound_prefix) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ELEMENT prefix:doc EMPTY>\n"
- " <!ATTLIST prefix:doc\n"
- " notxmlns:prefix CDATA 'http://example.org/'>\n"
- "]>\n"
- "<prefix:doc/>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Unbound prefix incorrectly passed");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_UNBOUND_PREFIX)
- xml_failure(g_parser);
-}
-END_TEST
-
-START_TEST(test_ns_default_with_empty_uri) {
- const char *text = "<doc xmlns='http://example.org/'>\n"
- " <e xmlns=''/>\n"
- "</doc>";
- /* Add some handlers to exercise extra code paths */
- XML_SetStartNamespaceDeclHandler(g_parser,
- dummy_start_namespace_decl_handler);
- XML_SetEndNamespaceDeclHandler(g_parser, dummy_end_namespace_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Regression test for SF bug #692964: two prefixes for one namespace. */
-START_TEST(test_ns_duplicate_attrs_diff_prefixes) {
- const char *text = "<doc xmlns:a='http://example.org/a'\n"
- " xmlns:b='http://example.org/a'\n"
- " a:a='v' b:a='v' />";
- expect_failure(text, XML_ERROR_DUPLICATE_ATTRIBUTE,
- "did not report multiple attributes with same URI+name");
-}
-END_TEST
-
-START_TEST(test_ns_duplicate_hashes) {
- /* The hash of an attribute is calculated as the hash of its URI
- * concatenated with a space followed by its name (after the
- * colon). We wish to generate attributes with the same hash
- * value modulo the attribute table size so that we can check that
- * the attribute hash table works correctly. The attribute hash
- * table size will be the smallest power of two greater than the
- * number of attributes, but at least eight. There is
- * unfortunately no programmatic way of getting the hash or the
- * table size at user level, but the test code coverage percentage
- * will drop if the hashes cease to point to the same row.
- *
- * The cunning plan is to have few enough attributes to have a
- * reliable table size of 8, and have the single letter attribute
- * names be 8 characters apart, producing a hash which will be the
- * same modulo 8.
- */
- const char *text = "<doc xmlns:a='http://example.org/a'\n"
- " a:a='v' a:i='w' />";
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Regression test for SF bug #695401: unbound prefix. */
-START_TEST(test_ns_unbound_prefix_on_attribute) {
- const char *text = "<doc a:attr=''/>";
- expect_failure(text, XML_ERROR_UNBOUND_PREFIX,
- "did not report unbound prefix on attribute");
-}
-END_TEST
-
-/* Regression test for SF bug #695401: unbound prefix. */
-START_TEST(test_ns_unbound_prefix_on_element) {
- const char *text = "<a:doc/>";
- expect_failure(text, XML_ERROR_UNBOUND_PREFIX,
- "did not report unbound prefix on element");
-}
-END_TEST
-
-/* Test that the parsing status is correctly reset by XML_ParserReset().
- * We usE test_return_ns_triplet() for our example parse to improve
- * coverage of tidying up code executed.
- */
-START_TEST(test_ns_parser_reset) {
- XML_ParsingStatus status;
-
- XML_GetParsingStatus(g_parser, &status);
- if (status.parsing != XML_INITIALIZED)
- fail("parsing status doesn't start INITIALIZED");
- test_return_ns_triplet();
- XML_GetParsingStatus(g_parser, &status);
- if (status.parsing != XML_FINISHED)
- fail("parsing status doesn't end FINISHED");
- XML_ParserReset(g_parser, NULL);
- XML_GetParsingStatus(g_parser, &status);
- if (status.parsing != XML_INITIALIZED)
- fail("parsing status doesn't reset to INITIALIZED");
-}
-END_TEST
-
-/* Test that long element names with namespaces are handled correctly */
-START_TEST(test_ns_long_element) {
- const char *text
- = "<foo:thisisalongenoughelementnametotriggerareallocation\n"
- " xmlns:foo='http://example.org/' bar:a='12'\n"
- " xmlns:bar='http://example.org/'>"
- "</foo:thisisalongenoughelementnametotriggerareallocation>";
- const XML_Char *elemstr[]
- = {XCS("http://example.org/")
- XCS(" thisisalongenoughelementnametotriggerareallocation foo"),
- XCS("http://example.org/ a bar")};
-
- XML_SetReturnNSTriplet(g_parser, XML_TRUE);
- XML_SetUserData(g_parser, (void *)elemstr);
- XML_SetElementHandler(g_parser, triplet_start_checker, triplet_end_checker);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test mixed population of prefixed and unprefixed attributes */
-START_TEST(test_ns_mixed_prefix_atts) {
- const char *text = "<e a='12' bar:b='13'\n"
- " xmlns:bar='http://example.org/'>"
- "</e>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test having a long namespaced element name inside a short one.
- * This exercises some internal buffer reallocation that is shared
- * across elements with the same namespace URI.
- */
-START_TEST(test_ns_extend_uri_buffer) {
- const char *text = "<foo:e xmlns:foo='http://example.org/'>"
- " <foo:thisisalongenoughnametotriggerallocationaction"
- " foo:a='12' />"
- "</foo:e>";
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test that xmlns is correctly rejected as an attribute in the xmlns
- * namespace, but not in other namespaces
- */
-START_TEST(test_ns_reserved_attributes) {
- const char *text1
- = "<foo:e xmlns:foo='http://example.org/' xmlns:xmlns='12' />";
- const char *text2
- = "<foo:e xmlns:foo='http://example.org/' foo:xmlns='12' />";
- expect_failure(text1, XML_ERROR_RESERVED_PREFIX_XMLNS,
- "xmlns not rejected as an attribute");
- XML_ParserReset(g_parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test more reserved attributes */
-START_TEST(test_ns_reserved_attributes_2) {
- const char *text1 = "<foo:e xmlns:foo='http://example.org/'"
- " xmlns:xml='http://example.org/' />";
- const char *text2
- = "<foo:e xmlns:foo='http://www.w3.org/XML/1998/namespace' />";
- const char *text3 = "<foo:e xmlns:foo='http://www.w3.org/2000/xmlns/' />";
-
- expect_failure(text1, XML_ERROR_RESERVED_PREFIX_XML,
- "xml not rejected as an attribute");
- XML_ParserReset(g_parser, NULL);
- expect_failure(text2, XML_ERROR_RESERVED_NAMESPACE_URI,
- "Use of w3.org URL not faulted");
- XML_ParserReset(g_parser, NULL);
- expect_failure(text3, XML_ERROR_RESERVED_NAMESPACE_URI,
- "Use of w3.org xmlns URL not faulted");
-}
-END_TEST
-
-/* Test string pool handling of namespace names of 2048 characters */
-/* Exercises a particular string pool growth path */
-START_TEST(test_ns_extremely_long_prefix) {
- /* C99 compilers are only required to support 4095-character
- * strings, so the following needs to be split in two to be safe
- * for all compilers.
- */
- const char *text1
- = "<doc "
- /* 64 character on each line */
- /* ...gives a total length of 2048 */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- ":a='12'";
- const char *text2
- = " xmlns:"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "='foo'\n>"
- "</doc>";
-
- if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-/* Test unknown encoding handlers in namespace setup */
-START_TEST(test_ns_unknown_encoding_success) {
- const char *text = "<?xml version='1.0' encoding='prefix-conv'?>\n"
- "<foo:e xmlns:foo='http://example.org/'>Hi</foo:e>";
-
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- run_character_check(text, XCS("Hi"));
-}
-END_TEST
-
-/* Test that too many colons are rejected */
-START_TEST(test_ns_double_colon) {
- const char *text = "<foo:e xmlns:foo='http://example.org/' foo:a:b='bar' />";
- const enum XML_Status status
- = _XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE);
-#ifdef XML_NS
- if ((status == XML_STATUS_OK)
- || (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)) {
- fail("Double colon in attribute name not faulted"
- " (despite active namespace support)");
- }
-#else
- if (status != XML_STATUS_OK) {
- fail("Double colon in attribute name faulted"
- " (despite inactive namespace support");
- }
-#endif
-}
-END_TEST
-
-START_TEST(test_ns_double_colon_element) {
- const char *text = "<foo:bar:e xmlns:foo='http://example.org/' />";
- const enum XML_Status status
- = _XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE);
-#ifdef XML_NS
- if ((status == XML_STATUS_OK)
- || (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN)) {
- fail("Double colon in element name not faulted"
- " (despite active namespace support)");
- }
-#else
- if (status != XML_STATUS_OK) {
- fail("Double colon in element name faulted"
- " (despite inactive namespace support");
- }
-#endif
-}
-END_TEST
-
-/* Test that non-name characters after a colon are rejected */
-START_TEST(test_ns_bad_attr_leafname) {
- const char *text = "<foo:e xmlns:foo='http://example.org/' foo:?ar='baz' />";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Invalid character in leafname not faulted");
-}
-END_TEST
-
-START_TEST(test_ns_bad_element_leafname) {
- const char *text = "<foo:?oc xmlns:foo='http://example.org/' />";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Invalid character in element leafname not faulted");
-}
-END_TEST
-
-/* Test high-byte-set UTF-16 characters are valid in a leafname */
-START_TEST(test_ns_utf16_leafname) {
- const char text[] =
- /* <n:e xmlns:n='URI' n:{KHO KHWAI}='a' />
- * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
- */
- "<\0n\0:\0e\0 \0x\0m\0l\0n\0s\0:\0n\0=\0'\0U\0R\0I\0'\0 \0"
- "n\0:\0\x04\x0e=\0'\0a\0'\0 \0/\0>\0";
- const XML_Char *expected = XCS("a");
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetStartElementHandler(g_parser, accumulate_attribute);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_ns_utf16_element_leafname) {
- const char text[] =
- /* <n:{KHO KHWAI} xmlns:n='URI'/>
- * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
- */
- "\0<\0n\0:\x0e\x04\0 \0x\0m\0l\0n\0s\0:\0n\0=\0'\0U\0R\0I\0'\0/\0>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("URI \x0e04");
-#else
- const XML_Char *expected = XCS("URI \xe0\xb8\x84");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetStartElementHandler(g_parser, start_element_event_handler);
- XML_SetUserData(g_parser, &storage);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_ns_utf16_doctype) {
- const char text[] =
- /* <!DOCTYPE foo:{KHO KHWAI} [ <!ENTITY bar 'baz'> ]>\n
- * where {KHO KHWAI} = U+0E04 = 0xe0 0xb8 0x84 in UTF-8
- */
- "\0<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0f\0o\0o\0:\x0e\x04\0 "
- "\0[\0 \0<\0!\0E\0N\0T\0I\0T\0Y\0 \0b\0a\0r\0 \0'\0b\0a\0z\0'\0>\0 "
- "\0]\0>\0\n"
- /* <foo:{KHO KHWAI} xmlns:foo='URI'>&bar;</foo:{KHO KHWAI}> */
- "\0<\0f\0o\0o\0:\x0e\x04\0 "
- "\0x\0m\0l\0n\0s\0:\0f\0o\0o\0=\0'\0U\0R\0I\0'\0>"
- "\0&\0b\0a\0r\0;"
- "\0<\0/\0f\0o\0o\0:\x0e\x04\0>";
-#ifdef XML_UNICODE
- const XML_Char *expected = XCS("URI \x0e04");
-#else
- const XML_Char *expected = XCS("URI \xe0\xb8\x84");
-#endif
- CharData storage;
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetStartElementHandler(g_parser, start_element_event_handler);
- XML_SetUnknownEncodingHandler(g_parser, MiscEncodingHandler, NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-START_TEST(test_ns_invalid_doctype) {
- const char *text = "<!DOCTYPE foo:!bad [ <!ENTITY bar 'baz' ]>\n"
- "<foo:!bad>&bar;</foo:!bad>";
-
- expect_failure(text, XML_ERROR_INVALID_TOKEN,
- "Invalid character in document local name not faulted");
-}
-END_TEST
-
-START_TEST(test_ns_double_colon_doctype) {
- const char *text = "<!DOCTYPE foo:a:doc [ <!ENTITY bar 'baz' ]>\n"
- "<foo:a:doc>&bar;</foo:a:doc>";
-
- expect_failure(text, XML_ERROR_SYNTAX,
- "Double colon in document name not faulted");
-}
-END_TEST
-
-/* Control variable; the number of times duff_allocator() will successfully
- * allocate */
-#define ALLOC_ALWAYS_SUCCEED (-1)
-#define REALLOC_ALWAYS_SUCCEED (-1)
-
-static intptr_t allocation_count = ALLOC_ALWAYS_SUCCEED;
-static intptr_t reallocation_count = REALLOC_ALWAYS_SUCCEED;
-
-/* Crocked allocator for allocation failure tests */
-static void *
-duff_allocator(size_t size) {
- if (allocation_count == 0)
- return NULL;
- if (allocation_count != ALLOC_ALWAYS_SUCCEED)
- allocation_count--;
- return malloc(size);
-}
-
-/* Crocked reallocator for allocation failure tests */
-static void *
-duff_reallocator(void *ptr, size_t size) {
- if (reallocation_count == 0)
- return NULL;
- if (reallocation_count != REALLOC_ALWAYS_SUCCEED)
- reallocation_count--;
- return realloc(ptr, size);
-}
-
-/* Test that a failure to allocate the parser structure fails gracefully */
-START_TEST(test_misc_alloc_create_parser) {
- XML_Memory_Handling_Suite memsuite = {duff_allocator, realloc, free};
- unsigned int i;
- const unsigned int max_alloc_count = 10;
-
- /* Something this simple shouldn't need more than 10 allocations */
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- g_parser = XML_ParserCreate_MM(NULL, &memsuite, NULL);
- if (g_parser != NULL)
- break;
- }
- if (i == 0)
- fail("Parser unexpectedly ignored failing allocator");
- else if (i == max_alloc_count)
- fail("Parser not created with max allocation count");
-}
-END_TEST
-
-/* Test memory allocation failures for a parser with an encoding */
-START_TEST(test_misc_alloc_create_parser_with_encoding) {
- XML_Memory_Handling_Suite memsuite = {duff_allocator, realloc, free};
- unsigned int i;
- const unsigned int max_alloc_count = 10;
-
- /* Try several levels of allocation */
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- g_parser = XML_ParserCreate_MM(XCS("us-ascii"), &memsuite, NULL);
- if (g_parser != NULL)
- break;
- }
- if (i == 0)
- fail("Parser ignored failing allocator");
- else if (i == max_alloc_count)
- fail("Parser not created with max allocation count");
-}
-END_TEST
-
-/* Test that freeing a NULL parser doesn't cause an explosion.
- * (Not actually tested anywhere else)
- */
-START_TEST(test_misc_null_parser) {
- XML_ParserFree(NULL);
-}
-END_TEST
-
-/* Test that XML_ErrorString rejects out-of-range codes */
-START_TEST(test_misc_error_string) {
- if (XML_ErrorString((enum XML_Error) - 1) != NULL)
- fail("Negative error code not rejected");
- if (XML_ErrorString((enum XML_Error)100) != NULL)
- fail("Large error code not rejected");
-}
-END_TEST
-
-/* Test the version information is consistent */
-
-/* Since we are working in XML_LChars (potentially 16-bits), we
- * can't use the standard C library functions for character
- * manipulation and have to roll our own.
- */
-static int
-parse_version(const XML_LChar *version_text,
- XML_Expat_Version *version_struct) {
- if (! version_text)
- return XML_FALSE;
-
- while (*version_text != 0x00) {
- if (*version_text >= ASCII_0 && *version_text <= ASCII_9)
- break;
- version_text++;
- }
- if (*version_text == 0x00)
- return XML_FALSE;
-
- /* version_struct->major = strtoul(version_text, 10, &version_text) */
- version_struct->major = 0;
- while (*version_text >= ASCII_0 && *version_text <= ASCII_9) {
- version_struct->major
- = 10 * version_struct->major + (*version_text++ - ASCII_0);
- }
- if (*version_text++ != ASCII_PERIOD)
- return XML_FALSE;
-
- /* Now for the minor version number */
- version_struct->minor = 0;
- while (*version_text >= ASCII_0 && *version_text <= ASCII_9) {
- version_struct->minor
- = 10 * version_struct->minor + (*version_text++ - ASCII_0);
- }
- if (*version_text++ != ASCII_PERIOD)
- return XML_FALSE;
-
- /* Finally the micro version number */
- version_struct->micro = 0;
- while (*version_text >= ASCII_0 && *version_text <= ASCII_9) {
- version_struct->micro
- = 10 * version_struct->micro + (*version_text++ - ASCII_0);
- }
- if (*version_text != 0x00)
- return XML_FALSE;
- return XML_TRUE;
-}
-
-static int
-versions_equal(const XML_Expat_Version *first,
- const XML_Expat_Version *second) {
- return (first->major == second->major && first->minor == second->minor
- && first->micro == second->micro);
-}
-
-START_TEST(test_misc_version) {
- XML_Expat_Version read_version = XML_ExpatVersionInfo();
- /* Silence compiler warning with the following assignment */
- XML_Expat_Version parsed_version = {0, 0, 0};
- const XML_LChar *version_text = XML_ExpatVersion();
-
- if (version_text == NULL)
- fail("Could not obtain version text");
- assert(version_text != NULL);
- if (! parse_version(version_text, &parsed_version))
- fail("Unable to parse version text");
- if (! versions_equal(&read_version, &parsed_version))
- fail("Version mismatch");
-
-#if ! defined(XML_UNICODE) || defined(XML_UNICODE_WCHAR_T)
- if (xcstrcmp(version_text, XCS("expat_2.2.10"))) /* needs bump on releases */
- fail("XML_*_VERSION in expat.h out of sync?\n");
-#else
- /* If we have XML_UNICODE defined but not XML_UNICODE_WCHAR_T
- * then XML_LChar is defined as char, for some reason.
- */
- if (strcmp(version_text, "expat_2.2.5")) /* needs bump on releases */
- fail("XML_*_VERSION in expat.h out of sync?\n");
-#endif /* ! defined(XML_UNICODE) || defined(XML_UNICODE_WCHAR_T) */
-}
-END_TEST
-
-/* Test feature information */
-START_TEST(test_misc_features) {
- const XML_Feature *features = XML_GetFeatureList();
-
- /* Prevent problems with double-freeing parsers */
- g_parser = NULL;
- if (features == NULL) {
- fail("Failed to get feature information");
- } else {
- /* Loop through the features checking what we can */
- while (features->feature != XML_FEATURE_END) {
- switch (features->feature) {
- case XML_FEATURE_SIZEOF_XML_CHAR:
- if (features->value != sizeof(XML_Char))
- fail("Incorrect size of XML_Char");
- break;
- case XML_FEATURE_SIZEOF_XML_LCHAR:
- if (features->value != sizeof(XML_LChar))
- fail("Incorrect size of XML_LChar");
- break;
- default:
- break;
- }
- features++;
- }
- }
-}
-END_TEST
-
-/* Regression test for GitHub Issue #17: memory leak parsing attribute
- * values with mixed bound and unbound namespaces.
- */
-START_TEST(test_misc_attribute_leak) {
- const char *text = "<D xmlns:L=\"D\" l:a='' L:a=''/>";
- XML_Memory_Handling_Suite memsuite
- = {tracking_malloc, tracking_realloc, tracking_free};
-
- g_parser = XML_ParserCreate_MM(XCS("UTF-8"), &memsuite, XCS("\n"));
- expect_failure(text, XML_ERROR_UNBOUND_PREFIX, "Unbound prefixes not found");
- XML_ParserFree(g_parser);
- /* Prevent the teardown trying to double free */
- g_parser = NULL;
-
- if (! tracking_report())
- fail("Memory leak found");
-}
-END_TEST
-
-/* Test parser created for UTF-16LE is successful */
-START_TEST(test_misc_utf16le) {
- const char text[] =
- /* <?xml version='1.0'?><q>Hi</q> */
- "<\0?\0x\0m\0l\0 \0"
- "v\0e\0r\0s\0i\0o\0n\0=\0'\0\x31\0.\0\x30\0'\0?\0>\0"
- "<\0q\0>\0H\0i\0<\0/\0q\0>\0";
- const XML_Char *expected = XCS("Hi");
- CharData storage;
-
- g_parser = XML_ParserCreate(XCS("UTF-16LE"));
- if (g_parser == NULL)
- fail("Parser not created");
-
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)sizeof(text) - 1, XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
- CharData_CheckXMLChars(&storage, expected);
-}
-END_TEST
-
-typedef struct {
- XML_Parser parser;
- int deep;
-} DataIssue240;
-
-static void
-start_element_issue_240(void *userData, const XML_Char *name,
- const XML_Char **atts) {
- DataIssue240 *mydata = (DataIssue240 *)userData;
- UNUSED_P(name);
- UNUSED_P(atts);
- mydata->deep++;
-}
-
-static void
-end_element_issue_240(void *userData, const XML_Char *name) {
- DataIssue240 *mydata = (DataIssue240 *)userData;
-
- UNUSED_P(name);
- mydata->deep--;
- if (mydata->deep == 0) {
- XML_StopParser(mydata->parser, 0);
- }
-}
-
-START_TEST(test_misc_stop_during_end_handler_issue_240_1) {
- XML_Parser parser;
- DataIssue240 *mydata;
- enum XML_Status result;
- const char *const doc1 = "<doc><e1/><e><foo/></e></doc>";
-
- parser = XML_ParserCreate(NULL);
- XML_SetElementHandler(parser, start_element_issue_240, end_element_issue_240);
- mydata = (DataIssue240 *)malloc(sizeof(DataIssue240));
- mydata->parser = parser;
- mydata->deep = 0;
- XML_SetUserData(parser, mydata);
-
- result = XML_Parse(parser, doc1, (int)strlen(doc1), 1);
- XML_ParserFree(parser);
- free(mydata);
- if (result != XML_STATUS_ERROR)
- fail("Stopping the parser did not work as expected");
-}
-END_TEST
-
-START_TEST(test_misc_stop_during_end_handler_issue_240_2) {
- XML_Parser parser;
- DataIssue240 *mydata;
- enum XML_Status result;
- const char *const doc2 = "<doc><elem/></doc>";
-
- parser = XML_ParserCreate(NULL);
- XML_SetElementHandler(parser, start_element_issue_240, end_element_issue_240);
- mydata = (DataIssue240 *)malloc(sizeof(DataIssue240));
- mydata->parser = parser;
- mydata->deep = 0;
- XML_SetUserData(parser, mydata);
-
- result = XML_Parse(parser, doc2, (int)strlen(doc2), 1);
- XML_ParserFree(parser);
- free(mydata);
- if (result != XML_STATUS_ERROR)
- fail("Stopping the parser did not work as expected");
-}
-END_TEST
-
-START_TEST(test_misc_deny_internal_entity_closing_doctype_issue_317) {
- const char *const inputOne = "<!DOCTYPE d [\n"
- "<!ENTITY % e ']><d/>'>\n"
- "\n"
- "%e;";
- const char *const inputTwo = "<!DOCTYPE d [\n"
- "<!ENTITY % e1 ']><d/>'><!ENTITY % e2 '&e1;'>\n"
- "\n"
- "%e2;";
- const char *const inputThree = "<!DOCTYPE d [\n"
- "<!ENTITY % e ']><d'>\n"
- "\n"
- "%e;";
- const char *const inputIssue317 = "<!DOCTYPE doc [\n"
- "<!ENTITY % foo ']>\n"
- "<doc>Hell<oc (#PCDATA)*>'>\n"
- "%foo;\n"
- "]>\n"
- "<doc>Hello, world</dVc>";
-
- const char *const inputs[] = {inputOne, inputTwo, inputThree, inputIssue317};
- size_t inputIndex = 0;
-
- for (; inputIndex < sizeof(inputs) / sizeof(inputs[0]); inputIndex++) {
- XML_Parser parser;
- enum XML_Status parseResult;
- int setParamEntityResult;
- XML_Size lineNumber;
- XML_Size columnNumber;
- const char *const input = inputs[inputIndex];
-
- parser = XML_ParserCreate(NULL);
- setParamEntityResult
- = XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- if (setParamEntityResult != 1)
- fail("Failed to set XML_PARAM_ENTITY_PARSING_ALWAYS.");
-
- parseResult = XML_Parse(parser, input, (int)strlen(input), 0);
- if (parseResult != XML_STATUS_ERROR) {
- parseResult = XML_Parse(parser, "", 0, 1);
- if (parseResult != XML_STATUS_ERROR) {
- fail("Parsing was expected to fail but succeeded.");
- }
- }
-
- if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)
- fail("Error code does not match XML_ERROR_INVALID_TOKEN");
-
- lineNumber = XML_GetCurrentLineNumber(parser);
- if (lineNumber != 4)
- fail("XML_GetCurrentLineNumber does not work as expected.");
-
- columnNumber = XML_GetCurrentColumnNumber(parser);
- if (columnNumber != 0)
- fail("XML_GetCurrentColumnNumber does not work as expected.");
-
- XML_ParserFree(parser);
- }
-}
-END_TEST
-
-static void
-alloc_setup(void) {
- XML_Memory_Handling_Suite memsuite = {duff_allocator, duff_reallocator, free};
-
- /* Ensure the parser creation will go through */
- allocation_count = ALLOC_ALWAYS_SUCCEED;
- reallocation_count = REALLOC_ALWAYS_SUCCEED;
- g_parser = XML_ParserCreate_MM(NULL, &memsuite, NULL);
- if (g_parser == NULL)
- fail("Parser not created");
-}
-
-static void
-alloc_teardown(void) {
- basic_teardown();
-}
-
-/* Test the effects of allocation failures on xml declaration processing */
-START_TEST(test_alloc_parse_xdecl) {
- const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
- "<doc>Hello, world</doc>";
- int i;
- const int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetXmlDeclHandler(g_parser, dummy_xdecl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* Resetting the parser is insufficient, because some memory
- * allocations are cached within the parser. Instead we use
- * the teardown and setup routines to ensure that we have the
- * right sort of parser back in our hands.
- */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed with max allocations");
-}
-END_TEST
-
-/* As above, but with an encoding big enough to cause storing the
- * version information to expand the string pool being used.
- */
-static int XMLCALL
-long_encoding_handler(void *userData, const XML_Char *encoding,
- XML_Encoding *info) {
- int i;
-
- UNUSED_P(userData);
- UNUSED_P(encoding);
- for (i = 0; i < 256; i++)
- info->map[i] = i;
- info->data = NULL;
- info->convert = NULL;
- info->release = NULL;
- return XML_STATUS_OK;
-}
-
-START_TEST(test_alloc_parse_xdecl_2) {
- const char *text
- = "<?xml version='1.0' encoding='"
- /* Each line is 64 characters */
- "ThisIsAStupidlyLongEncodingNameIntendedToTriggerPoolGrowth123456"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMN"
- "'?>"
- "<doc>Hello, world</doc>";
- int i;
- const int max_alloc_count = 20;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetXmlDeclHandler(g_parser, dummy_xdecl_handler);
- XML_SetUnknownEncodingHandler(g_parser, long_encoding_handler, NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed with max allocations");
-}
-END_TEST
-
-/* Test the effects of allocation failures on a straightforward parse */
-START_TEST(test_alloc_parse_pi) {
- const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
- "<?pi unknown?>\n"
- "<doc>"
- "Hello, world"
- "</doc>";
- int i;
- const int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed with max allocations");
-}
-END_TEST
-
-START_TEST(test_alloc_parse_pi_2) {
- const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
- "<doc>"
- "Hello, world"
- "<?pi unknown?>\n"
- "</doc>";
- int i;
- const int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed with max allocations");
-}
-END_TEST
-
-START_TEST(test_alloc_parse_pi_3) {
- const char *text
- = "<?"
- /* 64 characters per line */
- "This processing instruction should be long enough to ensure that"
- "it triggers the growth of an internal string pool when the "
- "allocator fails at a cruicial moment FGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "Q?><doc/>";
- int i;
- const int max_alloc_count = 20;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed with max allocations");
-}
-END_TEST
-
-START_TEST(test_alloc_parse_comment) {
- const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
- "<!-- Test parsing this comment -->"
- "<doc>Hi</doc>";
- int i;
- const int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetCommentHandler(g_parser, dummy_comment_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed with max allocations");
-}
-END_TEST
-
-START_TEST(test_alloc_parse_comment_2) {
- const char *text = "<?xml version='1.0' encoding='utf-8'?>\n"
- "<doc>"
- "Hello, world"
- "<!-- Parse this comment too -->"
- "</doc>";
- int i;
- const int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetCommentHandler(g_parser, dummy_comment_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed with max allocations");
-}
-END_TEST
-
-static int XMLCALL
-external_entity_duff_loader(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- XML_Parser new_parser;
- unsigned int i;
- const unsigned int max_alloc_count = 10;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- /* Try a few different allocation levels */
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (new_parser != NULL) {
- XML_ParserFree(new_parser);
- break;
- }
- }
- if (i == 0)
- fail("External parser creation ignored failing allocator");
- else if (i == max_alloc_count)
- fail("Extern parser not created with max allocation count");
-
- /* Make sure other random allocation doesn't now fail */
- allocation_count = ALLOC_ALWAYS_SUCCEED;
-
- /* Make sure the failure code path is executed too */
- return XML_STATUS_ERROR;
-}
-
-/* Test that external parser creation running out of memory is
- * correctly reported. Based on the external entity test cases.
- */
-START_TEST(test_alloc_create_external_parser) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
- char foo_text[] = "<!ELEMENT doc (#PCDATA)*>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, foo_text);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_duff_loader);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR) {
- fail("External parser allocator returned success incorrectly");
- }
-}
-END_TEST
-
-/* More external parser memory allocation testing */
-START_TEST(test_alloc_run_external_parser) {
- const char *text = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<!DOCTYPE doc SYSTEM 'foo'>\n"
- "<doc>&entity;</doc>";
- char foo_text[] = "<!ELEMENT doc (#PCDATA)*>";
- unsigned int i;
- const unsigned int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, foo_text);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_null_loader);
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parsing ignored failing allocator");
- else if (i == max_alloc_count)
- fail("Parsing failed with allocation count 10");
-}
-END_TEST
-
-static int XMLCALL
-external_entity_dbl_handler(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- intptr_t callno = (intptr_t)XML_GetUserData(parser);
- const char *text;
- XML_Parser new_parser;
- int i;
- const int max_alloc_count = 20;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- if (callno == 0) {
- /* First time through, check how many calls to malloc occur */
- text = ("<!ELEMENT doc (e+)>\n"
- "<!ATTLIST doc xmlns CDATA #IMPLIED>\n"
- "<!ELEMENT e EMPTY>\n");
- allocation_count = 10000;
- new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (new_parser == NULL) {
- fail("Unable to allocate first external parser");
- return XML_STATUS_ERROR;
- }
- /* Stash the number of calls in the user data */
- XML_SetUserData(parser, (void *)(intptr_t)(10000 - allocation_count));
- } else {
- text = ("<?xml version='1.0' encoding='us-ascii'?>"
- "<e/>");
- /* Try at varying levels to exercise more code paths */
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = callno + i;
- new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (new_parser != NULL)
- break;
- }
- if (i == 0) {
- fail("Second external parser unexpectedly created");
- XML_ParserFree(new_parser);
- return XML_STATUS_ERROR;
- } else if (i == max_alloc_count) {
- fail("Second external parser not created");
- return XML_STATUS_ERROR;
- }
- }
-
- allocation_count = ALLOC_ALWAYS_SUCCEED;
- if (_XML_Parse_SINGLE_BYTES(new_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR) {
- xml_failure(new_parser);
- return XML_STATUS_ERROR;
- }
- XML_ParserFree(new_parser);
- return XML_STATUS_OK;
-}
-
-/* Test that running out of memory in dtdCopy is correctly reported.
- * Based on test_default_ns_from_ext_subset_and_ext_ge()
- */
-START_TEST(test_alloc_dtd_copy_default_atts) {
- const char *text = "<?xml version='1.0'?>\n"
- "<!DOCTYPE doc SYSTEM 'http://example.org/doc.dtd' [\n"
- " <!ENTITY en SYSTEM 'http://example.org/entity.ent'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/ns1'>\n"
- "&en;\n"
- "</doc>";
-
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_dbl_handler);
- XML_SetUserData(g_parser, NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-}
-END_TEST
-
-static int XMLCALL
-external_entity_dbl_handler_2(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- intptr_t callno = (intptr_t)XML_GetUserData(parser);
- const char *text;
- XML_Parser new_parser;
- enum XML_Status rv;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- if (callno == 0) {
- /* Try different allocation levels for whole exercise */
- text = ("<!ELEMENT doc (e+)>\n"
- "<!ATTLIST doc xmlns CDATA #IMPLIED>\n"
- "<!ELEMENT e EMPTY>\n");
- XML_SetUserData(parser, (void *)(intptr_t)1);
- new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (new_parser == NULL)
- return XML_STATUS_ERROR;
- rv = _XML_Parse_SINGLE_BYTES(new_parser, text, (int)strlen(text), XML_TRUE);
- } else {
- /* Just run through once */
- text = ("<?xml version='1.0' encoding='us-ascii'?>"
- "<e/>");
- new_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (new_parser == NULL)
- return XML_STATUS_ERROR;
- rv = _XML_Parse_SINGLE_BYTES(new_parser, text, (int)strlen(text), XML_TRUE);
- }
- XML_ParserFree(new_parser);
- if (rv == XML_STATUS_ERROR)
- return XML_STATUS_ERROR;
- return XML_STATUS_OK;
-}
-
-/* Test more external entity allocation failure paths */
-START_TEST(test_alloc_external_entity) {
- const char *text = "<?xml version='1.0'?>\n"
- "<!DOCTYPE doc SYSTEM 'http://example.org/doc.dtd' [\n"
- " <!ENTITY en SYSTEM 'http://example.org/entity.ent'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/ns1'>\n"
- "&en;\n"
- "</doc>";
- int i;
- const int alloc_test_max_repeats = 50;
-
- for (i = 0; i < alloc_test_max_repeats; i++) {
- allocation_count = -1;
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_dbl_handler_2);
- XML_SetUserData(g_parser, NULL);
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_OK)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- allocation_count = -1;
- if (i == 0)
- fail("External entity parsed despite duff allocator");
- if (i == alloc_test_max_repeats)
- fail("External entity not parsed at max allocation count");
-}
-END_TEST
-
-/* Test more allocation failure paths */
-static int XMLCALL
-external_entity_alloc_set_encoding(XML_Parser parser, const XML_Char *context,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId) {
- /* As for external_entity_loader() */
- const char *text = "<?xml encoding='iso-8859-3'?>"
- "\xC3\xA9";
- XML_Parser ext_parser;
- enum XML_Status status;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- return XML_STATUS_ERROR;
- if (! XML_SetEncoding(ext_parser, XCS("utf-8"))) {
- XML_ParserFree(ext_parser);
- return XML_STATUS_ERROR;
- }
- status
- = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE);
- XML_ParserFree(ext_parser);
- if (status == XML_STATUS_ERROR)
- return XML_STATUS_ERROR;
- return XML_STATUS_OK;
-}
-
-START_TEST(test_alloc_ext_entity_set_encoding) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- int i;
- const int max_allocation_count = 30;
-
- for (i = 0; i < max_allocation_count; i++) {
- XML_SetExternalEntityRefHandler(g_parser,
- external_entity_alloc_set_encoding);
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_OK)
- break;
- allocation_count = -1;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Encoding check succeeded despite failing allocator");
- if (i == max_allocation_count)
- fail("Encoding failed at max allocation count");
-}
-END_TEST
-
-static int XMLCALL
-unknown_released_encoding_handler(void *data, const XML_Char *encoding,
- XML_Encoding *info) {
- UNUSED_P(data);
- if (! xcstrcmp(encoding, XCS("unsupported-encoding"))) {
- int i;
-
- for (i = 0; i < 256; i++)
- info->map[i] = i;
- info->data = NULL;
- info->convert = NULL;
- info->release = dummy_release;
- return XML_STATUS_OK;
- }
- return XML_STATUS_ERROR;
-}
-
-/* Test the effects of allocation failure in internal entities.
- * Based on test_unknown_encoding_internal_entity
- */
-START_TEST(test_alloc_internal_entity) {
- const char *text = "<?xml version='1.0' encoding='unsupported-encoding'?>\n"
- "<!DOCTYPE test [<!ENTITY foo 'bar'>]>\n"
- "<test a='&foo;'/>";
- unsigned int i;
- const unsigned int max_alloc_count = 20;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetUnknownEncodingHandler(g_parser, unknown_released_encoding_handler,
- NULL);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Internal entity worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Internal entity failed at max allocation count");
-}
-END_TEST
-
-/* Test the robustness against allocation failure of element handling
- * Based on test_dtd_default_handling().
- */
-START_TEST(test_alloc_dtd_default_handling) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ENTITY e SYSTEM 'http://example.org/e'>\n"
- "<!NOTATION n SYSTEM 'http://example.org/n'>\n"
- "<!ENTITY e1 SYSTEM 'http://example.org/e' NDATA n>\n"
- "<!ELEMENT doc (#PCDATA)>\n"
- "<!ATTLIST doc a CDATA #IMPLIED>\n"
- "<?pi in dtd?>\n"
- "<!--comment in dtd-->\n"
- "]>\n"
- "<doc><![CDATA[text in doc]]></doc>";
- const XML_Char *expected = XCS("\n\n\n\n\n\n\n\n\n<doc>text in doc</doc>");
- CharData storage;
- int i;
- const int max_alloc_count = 25;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- dummy_handler_flags = 0;
- XML_SetDefaultHandler(g_parser, accumulate_characters);
- XML_SetDoctypeDeclHandler(g_parser, dummy_start_doctype_handler,
- dummy_end_doctype_handler);
- XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
- XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
- XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
- XML_SetCommentHandler(g_parser, dummy_comment_handler);
- XML_SetCdataSectionHandler(g_parser, dummy_start_cdata_handler,
- dummy_end_cdata_handler);
- XML_SetUnparsedEntityDeclHandler(g_parser,
- dummy_unparsed_entity_decl_handler);
- CharData_Init(&storage);
- XML_SetUserData(g_parser, &storage);
- XML_SetCharacterDataHandler(g_parser, accumulate_characters);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Default DTD parsed despite allocation failures");
- if (i == max_alloc_count)
- fail("Default DTD not parsed with maximum alloc count");
- CharData_CheckXMLChars(&storage, expected);
- if (dummy_handler_flags
- != (DUMMY_START_DOCTYPE_HANDLER_FLAG | DUMMY_END_DOCTYPE_HANDLER_FLAG
- | DUMMY_ENTITY_DECL_HANDLER_FLAG | DUMMY_NOTATION_DECL_HANDLER_FLAG
- | DUMMY_ELEMENT_DECL_HANDLER_FLAG | DUMMY_ATTLIST_DECL_HANDLER_FLAG
- | DUMMY_COMMENT_HANDLER_FLAG | DUMMY_PI_HANDLER_FLAG
- | DUMMY_START_CDATA_HANDLER_FLAG | DUMMY_END_CDATA_HANDLER_FLAG
- | DUMMY_UNPARSED_ENTITY_DECL_HANDLER_FLAG))
- fail("Not all handlers were called");
-}
-END_TEST
-
-/* Test robustness of XML_SetEncoding() with a failing allocator */
-START_TEST(test_alloc_explicit_encoding) {
- int i;
- const int max_alloc_count = 5;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (XML_SetEncoding(g_parser, XCS("us-ascii")) == XML_STATUS_OK)
- break;
- }
- if (i == 0)
- fail("Encoding set despite failing allocator");
- else if (i == max_alloc_count)
- fail("Encoding not set at max allocation count");
-}
-END_TEST
-
-/* Test robustness of XML_SetBase against a failing allocator */
-START_TEST(test_alloc_set_base) {
- const XML_Char *new_base = XCS("/local/file/name.xml");
- int i;
- const int max_alloc_count = 5;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (XML_SetBase(g_parser, new_base) == XML_STATUS_OK)
- break;
- }
- if (i == 0)
- fail("Base set despite failing allocator");
- else if (i == max_alloc_count)
- fail("Base not set with max allocation count");
-}
-END_TEST
-
-/* Test buffer extension in the face of a duff reallocator */
-START_TEST(test_alloc_realloc_buffer) {
- const char *text = get_buffer_test_text;
- void *buffer;
- int i;
- const int max_realloc_count = 10;
-
- /* Get a smallish buffer */
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- buffer = XML_GetBuffer(g_parser, 1536);
- if (buffer == NULL)
- fail("1.5K buffer reallocation failed");
- assert(buffer != NULL);
- memcpy(buffer, text, strlen(text));
- if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_FALSE)
- == XML_STATUS_OK)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- reallocation_count = -1;
- if (i == 0)
- fail("Parse succeeded with no reallocation");
- else if (i == max_realloc_count)
- fail("Parse failed with max reallocation count");
-}
-END_TEST
-
-/* Same test for external entity parsers */
-static int XMLCALL
-external_entity_reallocator(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = get_buffer_test_text;
- XML_Parser ext_parser;
- void *buffer;
- enum XML_Status status;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- fail("Could not create external entity parser");
-
- reallocation_count = (intptr_t)XML_GetUserData(parser);
- buffer = XML_GetBuffer(ext_parser, 1536);
- if (buffer == NULL)
- fail("Buffer allocation failed");
- assert(buffer != NULL);
- memcpy(buffer, text, strlen(text));
- status = XML_ParseBuffer(ext_parser, (int)strlen(text), XML_FALSE);
- reallocation_count = -1;
- XML_ParserFree(ext_parser);
- return (status == XML_STATUS_OK) ? XML_STATUS_OK : XML_STATUS_ERROR;
-}
-
-START_TEST(test_alloc_ext_entity_realloc_buffer) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY en SYSTEM 'http://example.org/dummy.ent'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- XML_SetExternalEntityRefHandler(g_parser, external_entity_reallocator);
- XML_SetUserData(g_parser, (void *)(intptr_t)i);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- == XML_STATUS_OK)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Succeeded with no reallocations");
- if (i == max_realloc_count)
- fail("Failed with max reallocations");
-}
-END_TEST
-
-/* Test elements with many attributes are handled correctly */
-START_TEST(test_alloc_realloc_many_attributes) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ATTLIST doc za CDATA 'default'>\n"
- "<!ATTLIST doc zb CDATA 'def2'>\n"
- "<!ATTLIST doc zc CDATA 'def3'>\n"
- "]>\n"
- "<doc a='1'"
- " b='2'"
- " c='3'"
- " d='4'"
- " e='5'"
- " f='6'"
- " g='7'"
- " h='8'"
- " i='9'"
- " j='10'"
- " k='11'"
- " l='12'"
- " m='13'"
- " n='14'"
- " p='15'"
- " q='16'"
- " r='17'"
- " s='18'>"
- "</doc>";
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite no reallocations");
- if (i == max_realloc_count)
- fail("Parse failed at max reallocations");
-}
-END_TEST
-
-/* Test handling of a public entity with failing allocator */
-START_TEST(test_alloc_public_entity_value) {
- const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
- "<doc></doc>\n";
- char dtd_text[]
- = "<!ELEMENT doc EMPTY>\n"
- "<!ENTITY % e1 PUBLIC 'foo' 'bar.ent'>\n"
- "<!ENTITY % "
- /* Each line is 64 characters */
- "ThisIsAStupidlyLongParameterNameIntendedToTriggerPoolGrowth12345"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- " '%e1;'>\n"
- "%e1;\n";
- int i;
- const int max_alloc_count = 50;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- dummy_handler_flags = 0;
- XML_SetUserData(g_parser, dtd_text);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_public);
- /* Provoke a particular code path */
- XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocation");
- if (i == max_alloc_count)
- fail("Parsing failed at max allocation count");
- if (dummy_handler_flags != DUMMY_ENTITY_DECL_HANDLER_FLAG)
- fail("Entity declaration handler not called");
-}
-END_TEST
-
-START_TEST(test_alloc_realloc_subst_public_entity_value) {
- const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
- "<doc></doc>\n";
- char dtd_text[]
- = "<!ELEMENT doc EMPTY>\n"
- "<!ENTITY % "
- /* Each line is 64 characters */
- "ThisIsAStupidlyLongParameterNameIntendedToTriggerPoolGrowth12345"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- " PUBLIC 'foo' 'bar.ent'>\n"
- "%ThisIsAStupidlyLongParameterNameIntendedToTriggerPoolGrowth12345"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP;";
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetUserData(g_parser, dtd_text);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_public);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocation");
- if (i == max_realloc_count)
- fail("Parsing failed at max reallocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_parse_public_doctype) {
- const char *text
- = "<?xml version='1.0' encoding='utf-8'?>\n"
- "<!DOCTYPE doc PUBLIC '"
- /* 64 characters per line */
- "http://example.com/a/long/enough/name/to/trigger/pool/growth/zz/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "' 'test'>\n"
- "<doc></doc>";
- int i;
- const int max_alloc_count = 25;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- dummy_handler_flags = 0;
- XML_SetDoctypeDeclHandler(g_parser, dummy_start_doctype_decl_handler,
- dummy_end_doctype_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
- if (dummy_handler_flags
- != (DUMMY_START_DOCTYPE_DECL_HANDLER_FLAG
- | DUMMY_END_DOCTYPE_DECL_HANDLER_FLAG))
- fail("Doctype handler functions not called");
-}
-END_TEST
-
-START_TEST(test_alloc_parse_public_doctype_long_name) {
- const char *text
- = "<?xml version='1.0' encoding='utf-8'?>\n"
- "<!DOCTYPE doc PUBLIC 'http://example.com/foo' '"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "'>\n"
- "<doc></doc>";
- int i;
- const int max_alloc_count = 25;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetDoctypeDeclHandler(g_parser, dummy_start_doctype_decl_handler,
- dummy_end_doctype_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
-}
-END_TEST
-
-static int XMLCALL
-external_entity_alloc(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId,
- const XML_Char *publicId) {
- const char *text = (const char *)XML_GetUserData(parser);
- XML_Parser ext_parser;
- int parse_res;
-
- UNUSED_P(base);
- UNUSED_P(systemId);
- UNUSED_P(publicId);
- ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (ext_parser == NULL)
- return XML_STATUS_ERROR;
- parse_res
- = _XML_Parse_SINGLE_BYTES(ext_parser, text, (int)strlen(text), XML_TRUE);
- XML_ParserFree(ext_parser);
- return parse_res;
-}
-
-/* Test foreign DTD handling */
-START_TEST(test_alloc_set_foreign_dtd) {
- const char *text1 = "<?xml version='1.0' encoding='us-ascii'?>\n"
- "<doc>&entity;</doc>";
- char text2[] = "<!ELEMENT doc (#PCDATA)*>";
- int i;
- const int max_alloc_count = 25;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetUserData(g_parser, &text2);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
- if (XML_UseForeignDTD(g_parser, XML_TRUE) != XML_ERROR_NONE)
- fail("Could not set foreign DTD");
- if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
-}
-END_TEST
-
-/* Test based on ibm/valid/P32/ibm32v04.xml */
-START_TEST(test_alloc_attribute_enum_value) {
- const char *text = "<?xml version='1.0' standalone='no'?>\n"
- "<!DOCTYPE animal SYSTEM 'test.dtd'>\n"
- "<animal>This is a \n <a/> \n\nyellow tiger</animal>";
- char dtd_text[] = "<!ELEMENT animal (#PCDATA|a)*>\n"
- "<!ELEMENT a EMPTY>\n"
- "<!ATTLIST animal xml:space (default|preserve) 'preserve'>";
- int i;
- const int max_alloc_count = 30;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
- XML_SetUserData(g_parser, dtd_text);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- /* An attribute list handler provokes a different code path */
- XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
-}
-END_TEST
-
-/* Test attribute enums sufficient to overflow the string pool */
-START_TEST(test_alloc_realloc_attribute_enum_value) {
- const char *text = "<?xml version='1.0' standalone='no'?>\n"
- "<!DOCTYPE animal SYSTEM 'test.dtd'>\n"
- "<animal>This is a yellow tiger</animal>";
- /* We wish to define a collection of attribute enums that will
- * cause the string pool storing them to have to expand. This
- * means more than 1024 bytes, including the parentheses and
- * separator bars.
- */
- char dtd_text[]
- = "<!ELEMENT animal (#PCDATA)*>\n"
- "<!ATTLIST animal thing "
- "(default"
- /* Each line is 64 characters */
- "|ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|BBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|CBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|DBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|EBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|FBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|GBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|HBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|IBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|JBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|KBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|LBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|MBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|NBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|OBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|PBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO)"
- " 'default'>";
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
- XML_SetUserData(g_parser, dtd_text);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- /* An attribute list handler provokes a different code path */
- XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_realloc_count)
- fail("Parse failed at maximum reallocation count");
-}
-END_TEST
-
-/* Test attribute enums in a #IMPLIED attribute forcing pool growth */
-START_TEST(test_alloc_realloc_implied_attribute) {
- /* Forcing this particular code path is a balancing act. The
- * addition of the closing parenthesis and terminal NUL must be
- * what pushes the string of enums over the 1024-byte limit,
- * otherwise a different code path will pick up the realloc.
- */
- const char *text
- = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc EMPTY>\n"
- "<!ATTLIST doc a "
- /* Each line is 64 characters */
- "(ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|BBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|CBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|DBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|EBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|FBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|GBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|HBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|IBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|JBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|KBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|LBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|MBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|NBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|OBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|PBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMN)"
- " #IMPLIED>\n"
- "]><doc/>";
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_realloc_count)
- fail("Parse failed at maximum reallocation count");
-}
-END_TEST
-
-/* Test attribute enums in a defaulted attribute forcing pool growth */
-START_TEST(test_alloc_realloc_default_attribute) {
- /* Forcing this particular code path is a balancing act. The
- * addition of the closing parenthesis and terminal NUL must be
- * what pushes the string of enums over the 1024-byte limit,
- * otherwise a different code path will pick up the realloc.
- */
- const char *text
- = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc EMPTY>\n"
- "<!ATTLIST doc a "
- /* Each line is 64 characters */
- "(ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|BBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|CBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|DBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|EBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|FBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|GBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|HBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|IBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|JBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|KBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|LBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|MBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|NBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|OBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO"
- "|PBCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMN)"
- " 'ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNO'"
- ">\n]><doc/>";
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetAttlistDeclHandler(g_parser, dummy_attlist_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_realloc_count)
- fail("Parse failed at maximum reallocation count");
-}
-END_TEST
-
-/* Test long notation name with dodgy allocator */
-START_TEST(test_alloc_notation) {
- const char *text
- = "<!DOCTYPE doc [\n"
- "<!NOTATION "
- /* Each line is 64 characters */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- " SYSTEM 'http://example.org/n'>\n"
- "<!ENTITY e SYSTEM 'http://example.org/e' NDATA "
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- ">\n"
- "<!ELEMENT doc EMPTY>\n"
- "]>\n<doc/>";
- int i;
- const int max_alloc_count = 20;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- dummy_handler_flags = 0;
- XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
- XML_SetEntityDeclHandler(g_parser, dummy_entity_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite allocation failures");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
- if (dummy_handler_flags
- != (DUMMY_ENTITY_DECL_HANDLER_FLAG | DUMMY_NOTATION_DECL_HANDLER_FLAG))
- fail("Entity declaration handler not called");
-}
-END_TEST
-
-/* Test public notation with dodgy allocator */
-START_TEST(test_alloc_public_notation) {
- const char *text
- = "<!DOCTYPE doc [\n"
- "<!NOTATION note PUBLIC '"
- /* 64 characters per line */
- "http://example.com/a/long/enough/name/to/trigger/pool/growth/zz/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "' 'foo'>\n"
- "<!ENTITY e SYSTEM 'http://example.com/e' NDATA note>\n"
- "<!ELEMENT doc EMPTY>\n"
- "]>\n<doc/>";
- int i;
- const int max_alloc_count = 20;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- dummy_handler_flags = 0;
- XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite allocation failures");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
- if (dummy_handler_flags != DUMMY_NOTATION_DECL_HANDLER_FLAG)
- fail("Notation handler not called");
-}
-END_TEST
-
-/* Test public notation with dodgy allocator */
-START_TEST(test_alloc_system_notation) {
- const char *text
- = "<!DOCTYPE doc [\n"
- "<!NOTATION note SYSTEM '"
- /* 64 characters per line */
- "http://example.com/a/long/enough/name/to/trigger/pool/growth/zz/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "'>\n"
- "<!ENTITY e SYSTEM 'http://example.com/e' NDATA note>\n"
- "<!ELEMENT doc EMPTY>\n"
- "]>\n<doc/>";
- int i;
- const int max_alloc_count = 20;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- dummy_handler_flags = 0;
- XML_SetNotationDeclHandler(g_parser, dummy_notation_decl_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite allocation failures");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
- if (dummy_handler_flags != DUMMY_NOTATION_DECL_HANDLER_FLAG)
- fail("Notation handler not called");
-}
-END_TEST
-
-START_TEST(test_alloc_nested_groups) {
- const char *text
- = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc "
- /* Sixteen elements per line */
- "(e,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,"
- "(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?"
- "))))))))))))))))))))))))))))))))>\n"
- "<!ELEMENT e EMPTY>"
- "]>\n"
- "<doc><e/></doc>";
- CharData storage;
- int i;
- const int max_alloc_count = 20;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- CharData_Init(&storage);
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- XML_SetStartElementHandler(g_parser, record_element_start_handler);
- XML_SetUserData(g_parser, &storage);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
-
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum reallocation count");
- CharData_CheckXMLChars(&storage, XCS("doce"));
- if (dummy_handler_flags != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
- fail("Element handler not fired");
-}
-END_TEST
-
-START_TEST(test_alloc_realloc_nested_groups) {
- const char *text
- = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc "
- /* Sixteen elements per line */
- "(e,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,"
- "(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?,(e?"
- "))))))))))))))))))))))))))))))))>\n"
- "<!ELEMENT e EMPTY>"
- "]>\n"
- "<doc><e/></doc>";
- CharData storage;
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- CharData_Init(&storage);
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- XML_SetStartElementHandler(g_parser, record_element_start_handler);
- XML_SetUserData(g_parser, &storage);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
-
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_realloc_count)
- fail("Parse failed at maximum reallocation count");
- CharData_CheckXMLChars(&storage, XCS("doce"));
- if (dummy_handler_flags != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
- fail("Element handler not fired");
-}
-END_TEST
-
-START_TEST(test_alloc_large_group) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc ("
- "a1|a2|a3|a4|a5|a6|a7|a8|"
- "b1|b2|b3|b4|b5|b6|b7|b8|"
- "c1|c2|c3|c4|c5|c6|c7|c8|"
- "d1|d2|d3|d4|d5|d6|d7|d8|"
- "e1"
- ")+>\n"
- "]>\n"
- "<doc>\n"
- "<a1/>\n"
- "</doc>\n";
- int i;
- const int max_alloc_count = 50;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
- if (dummy_handler_flags != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
- fail("Element handler flag not raised");
-}
-END_TEST
-
-START_TEST(test_alloc_realloc_group_choice) {
- const char *text = "<!DOCTYPE doc [\n"
- "<!ELEMENT doc ("
- "a1|a2|a3|a4|a5|a6|a7|a8|"
- "b1|b2|b3|b4|b5|b6|b7|b8|"
- "c1|c2|c3|c4|c5|c6|c7|c8|"
- "d1|d2|d3|d4|d5|d6|d7|d8|"
- "e1"
- ")+>\n"
- "]>\n"
- "<doc>\n"
- "<a1/>\n"
- "<b2 attr='foo'>This is a foo</b2>\n"
- "<c3></c3>\n"
- "</doc>\n";
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetElementDeclHandler(g_parser, dummy_element_decl_handler);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_realloc_count)
- fail("Parse failed at maximum reallocation count");
- if (dummy_handler_flags != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
- fail("Element handler flag not raised");
-}
-END_TEST
-
-START_TEST(test_alloc_pi_in_epilog) {
- const char *text = "<doc></doc>\n"
- "<?pi in epilog?>";
- int i;
- const int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse completed despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
- if (dummy_handler_flags != DUMMY_PI_HANDLER_FLAG)
- fail("Processing instruction handler not invoked");
-}
-END_TEST
-
-START_TEST(test_alloc_comment_in_epilog) {
- const char *text = "<doc></doc>\n"
- "<!-- comment in epilog -->";
- int i;
- const int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetCommentHandler(g_parser, dummy_comment_handler);
- dummy_handler_flags = 0;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse completed despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
- if (dummy_handler_flags != DUMMY_COMMENT_HANDLER_FLAG)
- fail("Processing instruction handler not invoked");
-}
-END_TEST
-
-START_TEST(test_alloc_realloc_long_attribute_value) {
- const char *text
- = "<!DOCTYPE doc [<!ENTITY foo '"
- /* Each line is 64 characters */
- "This entity will be substituted as an attribute value, and is "
- "calculated to be exactly long enough that the terminating NUL "
- "that the library adds internally will trigger the string pool to"
- "grow. GHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "'>]>\n"
- "<doc a='&foo;'></doc>";
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_realloc_count)
- fail("Parse failed at maximum reallocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_attribute_whitespace) {
- const char *text = "<doc a=' '></doc>";
- int i;
- const int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_attribute_predefined_entity) {
- const char *text = "<doc a='&amp;'></doc>";
- int i;
- const int max_alloc_count = 15;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
-}
-END_TEST
-
-/* Test that a character reference at the end of a suitably long
- * default value for an attribute can trigger pool growth, and recovers
- * if the allocator fails on it.
- */
-START_TEST(test_alloc_long_attr_default_with_char_ref) {
- const char *text
- = "<!DOCTYPE doc [<!ATTLIST doc a CDATA '"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHI"
- "&#x31;'>]>\n"
- "<doc/>";
- int i;
- const int max_alloc_count = 20;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
-}
-END_TEST
-
-/* Test that a long character reference substitution triggers a pool
- * expansion correctly for an attribute value.
- */
-START_TEST(test_alloc_long_attr_value) {
- const char *text
- = "<!DOCTYPE test [<!ENTITY foo '\n"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "'>]>\n"
- "<test a='&foo;'/>";
- int i;
- const int max_alloc_count = 25;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing allocator");
- if (i == max_alloc_count)
- fail("Parse failed at maximum allocation count");
-}
-END_TEST
-
-/* Test that an error in a nested parameter entity substitution is
- * handled correctly. It seems unlikely that the code path being
- * exercised can be reached purely by carefully crafted XML, but an
- * allocation error in the right place will definitely do it.
- */
-START_TEST(test_alloc_nested_entities) {
- const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/one.ent'>\n"
- "<doc />";
- ExtFaults test_data
- = {"<!ENTITY % pe1 '"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "'>\n"
- "<!ENTITY % pe2 '%pe1;'>\n"
- "%pe2;",
- "Memory Fail not faulted", NULL, XML_ERROR_NO_MEMORY};
-
- /* Causes an allocation error in a nested storeEntityValue() */
- allocation_count = 12;
- XML_SetUserData(g_parser, &test_data);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_faulter);
- expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- "Entity allocation failure not noted");
-}
-END_TEST
-
-START_TEST(test_alloc_realloc_param_entity_newline) {
- const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
- "<doc/>";
- char dtd_text[]
- = "<!ENTITY % pe '<!ATTLIST doc att CDATA \""
- /* 64 characters per line */
- "This default value is carefully crafted so that the carriage "
- "return right at the end of the entity string causes an internal "
- "string pool to have to grow. This allows us to test the alloc "
- "failure path from that point. OPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDE"
- "\">\n'>"
- "%pe;\n";
- int i;
- const int max_realloc_count = 5;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetUserData(g_parser, dtd_text);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_realloc_count)
- fail("Parse failed at maximum reallocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_realloc_ce_extends_pe) {
- const char *text = "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
- "<doc/>";
- char dtd_text[]
- = "<!ENTITY % pe '<!ATTLIST doc att CDATA \""
- /* 64 characters per line */
- "This default value is carefully crafted so that the character "
- "entity at the end causes an internal string pool to have to "
- "grow. This allows us to test the allocation failure path from "
- "that point onwards. EFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFG&#x51;"
- "\">\n'>"
- "%pe;\n";
- int i;
- const int max_realloc_count = 5;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetUserData(g_parser, dtd_text);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_realloc_count)
- fail("Parse failed at maximum reallocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_realloc_attributes) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ATTLIST doc\n"
- " a1 (a|b|c) 'a'\n"
- " a2 (foo|bar) #IMPLIED\n"
- " a3 NMTOKEN #IMPLIED\n"
- " a4 NMTOKENS #IMPLIED\n"
- " a5 ID #IMPLIED\n"
- " a6 IDREF #IMPLIED\n"
- " a7 IDREFS #IMPLIED\n"
- " a8 ENTITY #IMPLIED\n"
- " a9 ENTITIES #IMPLIED\n"
- " a10 CDATA #IMPLIED\n"
- " >]>\n"
- "<doc>wombat</doc>\n";
- int i;
- const int max_realloc_count = 5;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
-
- if (i == 0)
- fail("Parse succeeded despite failing reallocator");
- if (i == max_realloc_count)
- fail("Parse failed at maximum reallocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_long_doc_name) {
- const char *text =
- /* 64 characters per line */
- "<LongRootElementNameThatWillCauseTheNextAllocationToExpandTheStr"
- "ingPoolForTheDTDQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- " a='1'/>";
- int i;
- const int max_alloc_count = 20;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max reallocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_long_base) {
- const char *text = "<!DOCTYPE doc [\n"
- " <!ENTITY e SYSTEM 'foo'>\n"
- "]>\n"
- "<doc>&e;</doc>";
- char entity_text[] = "Hello world";
- const XML_Char *base =
- /* 64 characters per line */
- /* clang-format off */
- XCS("LongBaseURI/that/will/overflow/an/internal/buffer/and/cause/it/t")
- XCS("o/have/to/grow/PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/");
- /* clang-format on */
- int i;
- const int max_alloc_count = 25;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetUserData(g_parser, entity_text);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
- if (XML_SetBase(g_parser, base) == XML_STATUS_ERROR) {
- XML_ParserReset(g_parser, NULL);
- continue;
- }
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_long_public_id) {
- const char *text
- = "<!DOCTYPE doc [\n"
- " <!ENTITY e PUBLIC '"
- /* 64 characters per line */
- "LongPublicIDThatShouldResultInAnInternalStringPoolGrowingAtASpec"
- "ificMomentKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "' 'bar'>\n"
- "]>\n"
- "<doc>&e;</doc>";
- char entity_text[] = "Hello world";
- int i;
- const int max_alloc_count = 40;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetUserData(g_parser, entity_text);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_long_entity_value) {
- const char *text
- = "<!DOCTYPE doc [\n"
- " <!ENTITY e1 '"
- /* 64 characters per line */
- "Long entity value that should provoke a string pool to grow whil"
- "e setting up to parse the external entity below. xyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "'>\n"
- " <!ENTITY e2 SYSTEM 'bar'>\n"
- "]>\n"
- "<doc>&e2;</doc>";
- char entity_text[] = "Hello world";
- int i;
- const int max_alloc_count = 40;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetUserData(g_parser, entity_text);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_alloc);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-START_TEST(test_alloc_long_notation) {
- const char *text
- = "<!DOCTYPE doc [\n"
- " <!NOTATION note SYSTEM '"
- /* 64 characters per line */
- "ALongNotationNameThatShouldProvokeStringPoolGrowthWhileCallingAn"
- "ExternalEntityParserUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "'>\n"
- " <!ENTITY e1 SYSTEM 'foo' NDATA "
- /* 64 characters per line */
- "ALongNotationNameThatShouldProvokeStringPoolGrowthWhileCallingAn"
- "ExternalEntityParserUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AB"
- ">\n"
- " <!ENTITY e2 SYSTEM 'bar'>\n"
- "]>\n"
- "<doc>&e2;</doc>";
- ExtOption options[]
- = {{XCS("foo"), "Entity Foo"}, {XCS("bar"), "Entity Bar"}, {NULL, NULL}};
- int i;
- const int max_alloc_count = 40;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetUserData(g_parser, options);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
-
- /* See comment in test_alloc_parse_xdecl() */
- alloc_teardown();
- alloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-static void
-nsalloc_setup(void) {
- XML_Memory_Handling_Suite memsuite = {duff_allocator, duff_reallocator, free};
- XML_Char ns_sep[2] = {' ', '\0'};
-
- /* Ensure the parser creation will go through */
- allocation_count = ALLOC_ALWAYS_SUCCEED;
- reallocation_count = REALLOC_ALWAYS_SUCCEED;
- g_parser = XML_ParserCreate_MM(NULL, &memsuite, ns_sep);
- if (g_parser == NULL)
- fail("Parser not created");
-}
-
-static void
-nsalloc_teardown(void) {
- basic_teardown();
-}
-
-/* Test the effects of allocation failure in simple namespace parsing.
- * Based on test_ns_default_with_empty_uri()
- */
-START_TEST(test_nsalloc_xmlns) {
- const char *text = "<doc xmlns='http://example.org/'>\n"
- " <e xmlns=''/>\n"
- "</doc>";
- unsigned int i;
- const unsigned int max_alloc_count = 30;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- /* Exercise more code paths with a default handler */
- XML_SetDefaultHandler(g_parser, dummy_default_handler);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* Resetting the parser is insufficient, because some memory
- * allocations are cached within the parser. Instead we use
- * the teardown and setup routines to ensure that we have the
- * right sort of parser back in our hands.
- */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at maximum allocation count");
-}
-END_TEST
-
-/* Test XML_ParseBuffer interface with namespace and a dicky allocator */
-START_TEST(test_nsalloc_parse_buffer) {
- const char *text = "<doc>Hello</doc>";
- void *buffer;
-
- /* Try a parse before the start of the world */
- /* (Exercises new code path) */
- allocation_count = 0;
- if (XML_ParseBuffer(g_parser, 0, XML_FALSE) != XML_STATUS_ERROR)
- fail("Pre-init XML_ParseBuffer not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_NO_MEMORY)
- fail("Pre-init XML_ParseBuffer faulted for wrong reason");
-
- /* Now with actual memory allocation */
- allocation_count = ALLOC_ALWAYS_SUCCEED;
- if (XML_ParseBuffer(g_parser, 0, XML_FALSE) != XML_STATUS_OK)
- xml_failure(g_parser);
-
- /* Check that resuming an unsuspended parser is faulted */
- if (XML_ResumeParser(g_parser) != XML_STATUS_ERROR)
- fail("Resuming unsuspended parser not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_NOT_SUSPENDED)
- xml_failure(g_parser);
-
- /* Get the parser into suspended state */
- XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler);
- resumable = XML_TRUE;
- buffer = XML_GetBuffer(g_parser, (int)strlen(text));
- if (buffer == NULL)
- fail("Could not acquire parse buffer");
- assert(buffer != NULL);
- memcpy(buffer, text, strlen(text));
- if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_TRUE)
- != XML_STATUS_SUSPENDED)
- xml_failure(g_parser);
- if (XML_GetErrorCode(g_parser) != XML_ERROR_NONE)
- xml_failure(g_parser);
- if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Suspended XML_ParseBuffer not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_SUSPENDED)
- xml_failure(g_parser);
- if (XML_GetBuffer(g_parser, (int)strlen(text)) != NULL)
- fail("Suspended XML_GetBuffer not faulted");
-
- /* Get it going again and complete the world */
- XML_SetCharacterDataHandler(g_parser, NULL);
- if (XML_ResumeParser(g_parser) != XML_STATUS_OK)
- xml_failure(g_parser);
- if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- fail("Post-finishing XML_ParseBuffer not faulted");
- if (XML_GetErrorCode(g_parser) != XML_ERROR_FINISHED)
- xml_failure(g_parser);
- if (XML_GetBuffer(g_parser, (int)strlen(text)) != NULL)
- fail("Post-finishing XML_GetBuffer not faulted");
-}
-END_TEST
-
-/* Check handling of long prefix names (pool growth) */
-START_TEST(test_nsalloc_long_prefix) {
- const char *text
- = "<"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- ":foo xmlns:"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "='http://example.org/'>"
- "</"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- ":foo>";
- int i;
- const int max_alloc_count = 40;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-/* Check handling of long uri names (pool growth) */
-START_TEST(test_nsalloc_long_uri) {
- const char *text
- = "<foo:e xmlns:foo='http://example.org/"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "' bar:a='12'\n"
- "xmlns:bar='http://example.org/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789A/"
- "'>"
- "</foo:e>";
- int i;
- const int max_alloc_count = 40;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-/* Test handling of long attribute names with prefixes */
-START_TEST(test_nsalloc_long_attr) {
- const char *text
- = "<foo:e xmlns:foo='http://example.org/' bar:"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "='12'\n"
- "xmlns:bar='http://example.org/'>"
- "</foo:e>";
- int i;
- const int max_alloc_count = 40;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-/* Test handling of an attribute name with a long namespace prefix */
-START_TEST(test_nsalloc_long_attr_prefix) {
- const char *text
- = "<foo:e xmlns:foo='http://example.org/' "
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- ":a='12'\n"
- "xmlns:"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "='http://example.org/'>"
- "</foo:e>";
- const XML_Char *elemstr[] = {
- /* clang-format off */
- XCS("http://example.org/ e foo"),
- XCS("http://example.org/ a ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- XCS("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ")
- /* clang-format on */
- };
- int i;
- const int max_alloc_count = 40;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetReturnNSTriplet(g_parser, XML_TRUE);
- XML_SetUserData(g_parser, (void *)elemstr);
- XML_SetElementHandler(g_parser, triplet_start_checker, triplet_end_checker);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-/* Test attribute handling in the face of a dodgy reallocator */
-START_TEST(test_nsalloc_realloc_attributes) {
- const char *text = "<foo:e xmlns:foo='http://example.org/' bar:a='12'\n"
- " xmlns:bar='http://example.org/'>"
- "</foo:e>";
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocations");
- else if (i == max_realloc_count)
- fail("Parsing failed at max reallocation count");
-}
-END_TEST
-
-/* Test long element names with namespaces under a failing allocator */
-START_TEST(test_nsalloc_long_element) {
- const char *text
- = "<foo:thisisalongenoughelementnametotriggerareallocation\n"
- " xmlns:foo='http://example.org/' bar:a='12'\n"
- " xmlns:bar='http://example.org/'>"
- "</foo:thisisalongenoughelementnametotriggerareallocation>";
- const XML_Char *elemstr[]
- = {XCS("http://example.org/")
- XCS(" thisisalongenoughelementnametotriggerareallocation foo"),
- XCS("http://example.org/ a bar")};
- int i;
- const int max_alloc_count = 30;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetReturnNSTriplet(g_parser, XML_TRUE);
- XML_SetUserData(g_parser, (void *)elemstr);
- XML_SetElementHandler(g_parser, triplet_start_checker, triplet_end_checker);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocations");
- else if (i == max_alloc_count)
- fail("Parsing failed at max reallocation count");
-}
-END_TEST
-
-/* Test the effects of reallocation failure when reassigning a
- * binding.
- *
- * XML_ParserReset does not free the BINDING structures used by a
- * parser, but instead adds them to an internal free list to be reused
- * as necessary. Likewise the URI buffers allocated for the binding
- * aren't freed, but kept attached to their existing binding. If the
- * new binding has a longer URI, it will need reallocation. This test
- * provokes that reallocation, and tests the control path if it fails.
- */
-START_TEST(test_nsalloc_realloc_binding_uri) {
- const char *first = "<doc xmlns='http://example.org/'>\n"
- " <e xmlns='' />\n"
- "</doc>";
- const char *second
- = "<doc xmlns='http://example.org/long/enough/URI/to/reallocate/'>\n"
- " <e xmlns='' />\n"
- "</doc>";
- unsigned i;
- const unsigned max_realloc_count = 10;
-
- /* First, do a full parse that will leave bindings around */
- if (_XML_Parse_SINGLE_BYTES(g_parser, first, (int)strlen(first), XML_TRUE)
- == XML_STATUS_ERROR)
- xml_failure(g_parser);
-
- /* Now repeat with a longer URI and a duff reallocator */
- for (i = 0; i < max_realloc_count; i++) {
- XML_ParserReset(g_parser, NULL);
- reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, second, (int)strlen(second), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocation");
- else if (i == max_realloc_count)
- fail("Parsing failed at max reallocation count");
-}
-END_TEST
-
-/* Check handling of long prefix names (pool growth) */
-START_TEST(test_nsalloc_realloc_long_prefix) {
- const char *text
- = "<"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- ":foo xmlns:"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "='http://example.org/'>"
- "</"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- ":foo>";
- int i;
- const int max_realloc_count = 12;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocations");
- else if (i == max_realloc_count)
- fail("Parsing failed even at max reallocation count");
-}
-END_TEST
-
-/* Check handling of even long prefix names (different code path) */
-START_TEST(test_nsalloc_realloc_longer_prefix) {
- const char *text
- = "<"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "Q:foo xmlns:"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "Q='http://example.org/'>"
- "</"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "Q:foo>";
- int i;
- const int max_realloc_count = 12;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocations");
- else if (i == max_realloc_count)
- fail("Parsing failed even at max reallocation count");
-}
-END_TEST
-
-START_TEST(test_nsalloc_long_namespace) {
- const char *text1
- = "<"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- ":e xmlns:"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "='http://example.org/'>\n";
- const char *text2
- = "<"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- ":f "
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- ":attr='foo'/>\n"
- "</"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- ":e>";
- int i;
- const int max_alloc_count = 40;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
- != XML_STATUS_ERROR
- && _XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2),
- XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-/* Using a slightly shorter namespace name provokes allocations in
- * slightly different places in the code.
- */
-START_TEST(test_nsalloc_less_long_namespace) {
- const char *text
- = "<"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
- ":e xmlns:"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
- "='http://example.org/'>\n"
- "<"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
- ":f "
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
- ":att='foo'/>\n"
- "</"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678"
- ":e>";
- int i;
- const int max_alloc_count = 40;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-START_TEST(test_nsalloc_long_context) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ATTLIST doc baz ID #REQUIRED>\n"
- " <!ENTITY en SYSTEM 'bar'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKL"
- "' baz='2'>\n"
- "&en;"
- "</doc>";
- ExtOption options[] = {
- {XCS("foo"), "<!ELEMENT e EMPTY>"}, {XCS("bar"), "<e/>"}, {NULL, NULL}};
- int i;
- const int max_alloc_count = 70;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetUserData(g_parser, options);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
-
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-/* This function is void; it will throw a fail() on error, so if it
- * returns normally it must have succeeded.
- */
-static void
-context_realloc_test(const char *text) {
- ExtOption options[] = {
- {XCS("foo"), "<!ELEMENT e EMPTY>"}, {XCS("bar"), "<e/>"}, {NULL, NULL}};
- int i;
- const int max_realloc_count = 6;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetUserData(g_parser, options);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocations");
- else if (i == max_realloc_count)
- fail("Parsing failed even at max reallocation count");
-}
-
-START_TEST(test_nsalloc_realloc_long_context) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ENTITY en SYSTEM 'bar'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKL"
- "'>\n"
- "&en;"
- "</doc>";
-
- context_realloc_test(text);
-}
-END_TEST
-
-START_TEST(test_nsalloc_realloc_long_context_2) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ENTITY en SYSTEM 'bar'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJK"
- "'>\n"
- "&en;"
- "</doc>";
-
- context_realloc_test(text);
-}
-END_TEST
-
-START_TEST(test_nsalloc_realloc_long_context_3) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ENTITY en SYSTEM 'bar'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGH"
- "'>\n"
- "&en;"
- "</doc>";
-
- context_realloc_test(text);
-}
-END_TEST
-
-START_TEST(test_nsalloc_realloc_long_context_4) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ENTITY en SYSTEM 'bar'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO"
- "'>\n"
- "&en;"
- "</doc>";
-
- context_realloc_test(text);
-}
-END_TEST
-
-START_TEST(test_nsalloc_realloc_long_context_5) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ENTITY en SYSTEM 'bar'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABC"
- "'>\n"
- "&en;"
- "</doc>";
-
- context_realloc_test(text);
-}
-END_TEST
-
-START_TEST(test_nsalloc_realloc_long_context_6) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ENTITY en SYSTEM 'bar'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNOP"
- "'>\n"
- "&en;"
- "</doc>";
-
- context_realloc_test(text);
-}
-END_TEST
-
-START_TEST(test_nsalloc_realloc_long_context_7) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ENTITY en SYSTEM 'bar'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLM"
- "'>\n"
- "&en;"
- "</doc>";
-
- context_realloc_test(text);
-}
-END_TEST
-
-START_TEST(test_nsalloc_realloc_long_ge_name) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ENTITY "
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- " SYSTEM 'bar'>\n"
- "]>\n"
- "<doc xmlns='http://example.org/baz'>\n"
- "&"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- ";"
- "</doc>";
- ExtOption options[] = {
- {XCS("foo"), "<!ELEMENT el EMPTY>"}, {XCS("bar"), "<el/>"}, {NULL, NULL}};
- int i;
- const int max_realloc_count = 10;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetUserData(g_parser, options);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocations");
- else if (i == max_realloc_count)
- fail("Parsing failed even at max reallocation count");
-}
-END_TEST
-
-/* Test that when a namespace is passed through the context mechanism
- * to an external entity parser, the parsers handle reallocation
- * failures correctly. The prefix is exactly the right length to
- * provoke particular uncommon code paths.
- */
-START_TEST(test_nsalloc_realloc_long_context_in_dtd) {
- const char *text1
- = "<!DOCTYPE "
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- ":doc [\n"
- " <!ENTITY First SYSTEM 'foo/First'>\n"
- "]>\n"
- "<"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- ":doc xmlns:"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "='foo/Second'>&First;";
- const char *text2
- = "</"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- ":doc>";
- ExtOption options[] = {{XCS("foo/First"), "Hello world"}, {NULL, NULL}};
- int i;
- const int max_realloc_count = 20;
-
- for (i = 0; i < max_realloc_count; i++) {
- reallocation_count = i;
- XML_SetUserData(g_parser, options);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text1, (int)strlen(text1), XML_FALSE)
- != XML_STATUS_ERROR
- && _XML_Parse_SINGLE_BYTES(g_parser, text2, (int)strlen(text2),
- XML_TRUE)
- != XML_STATUS_ERROR)
- break;
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing reallocations");
- else if (i == max_realloc_count)
- fail("Parsing failed even at max reallocation count");
-}
-END_TEST
-
-START_TEST(test_nsalloc_long_default_in_ext) {
- const char *text
- = "<!DOCTYPE doc [\n"
- " <!ATTLIST e a1 CDATA '"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
- "'>\n"
- " <!ENTITY x SYSTEM 'foo'>\n"
- "]>\n"
- "<doc>&x;</doc>";
- ExtOption options[] = {{XCS("foo"), "<e/>"}, {NULL, NULL}};
- int i;
- const int max_alloc_count = 50;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetUserData(g_parser, options);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
-
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-START_TEST(test_nsalloc_long_systemid_in_ext) {
- const char *text
- = "<!DOCTYPE doc SYSTEM 'foo' [\n"
- " <!ENTITY en SYSTEM '"
- /* 64 characters per line */
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"
- "'>\n"
- "]>\n"
- "<doc>&en;</doc>";
- ExtOption options[] = {
- {XCS("foo"), "<!ELEMENT e EMPTY>"},
- {/* clang-format off */
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/")
- XCS("ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/ABCDEFGHIJKLMNO/"),
- /* clang-format on */
- "<e/>"},
- {NULL, NULL}};
- int i;
- const int max_alloc_count = 55;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetUserData(g_parser, options);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
-
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Parsing worked despite failing allocations");
- else if (i == max_alloc_count)
- fail("Parsing failed even at max allocation count");
-}
-END_TEST
-
-/* Test the effects of allocation failure on parsing an element in a
- * namespace. Based on test_nsalloc_long_context.
- */
-START_TEST(test_nsalloc_prefixed_element) {
- const char *text = "<!DOCTYPE pfx:element SYSTEM 'foo' [\n"
- " <!ATTLIST pfx:element baz ID #REQUIRED>\n"
- " <!ENTITY en SYSTEM 'bar'>\n"
- "]>\n"
- "<pfx:element xmlns:pfx='http://example.org/' baz='2'>\n"
- "&en;"
- "</pfx:element>";
- ExtOption options[] = {
- {XCS("foo"), "<!ELEMENT e EMPTY>"}, {XCS("bar"), "<e/>"}, {NULL, NULL}};
- int i;
- const int max_alloc_count = 70;
-
- for (i = 0; i < max_alloc_count; i++) {
- allocation_count = i;
- XML_SetUserData(g_parser, options);
- XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
- XML_SetExternalEntityRefHandler(g_parser, external_entity_optioner);
- if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
- != XML_STATUS_ERROR)
- break;
-
- /* See comment in test_nsalloc_xmlns() */
- nsalloc_teardown();
- nsalloc_setup();
- }
- if (i == 0)
- fail("Success despite failing allocator");
- else if (i == max_alloc_count)
- fail("Failed even at full allocation count");
-}
-END_TEST
+XML_Parser g_parser = NULL;
static Suite *
make_suite(void) {
Suite *s = suite_create("basic");
- TCase *tc_basic = tcase_create("basic tests");
- TCase *tc_namespace = tcase_create("XML namespaces");
- TCase *tc_misc = tcase_create("miscellaneous tests");
- TCase *tc_alloc = tcase_create("allocation tests");
- TCase *tc_nsalloc = tcase_create("namespace allocation tests");
- suite_add_tcase(s, tc_basic);
- tcase_add_checked_fixture(tc_basic, basic_setup, basic_teardown);
- tcase_add_test(tc_basic, test_nul_byte);
- tcase_add_test(tc_basic, test_u0000_char);
- tcase_add_test(tc_basic, test_siphash_self);
- tcase_add_test(tc_basic, test_siphash_spec);
- tcase_add_test(tc_basic, test_bom_utf8);
- tcase_add_test(tc_basic, test_bom_utf16_be);
- tcase_add_test(tc_basic, test_bom_utf16_le);
- tcase_add_test(tc_basic, test_nobom_utf16_le);
- tcase_add_test(tc_basic, test_illegal_utf8);
- tcase_add_test(tc_basic, test_utf8_auto_align);
- tcase_add_test(tc_basic, test_utf16);
- tcase_add_test(tc_basic, test_utf16_le_epilog_newline);
- tcase_add_test(tc_basic, test_not_utf16);
- tcase_add_test(tc_basic, test_bad_encoding);
- tcase_add_test(tc_basic, test_latin1_umlauts);
- tcase_add_test(tc_basic, test_long_utf8_character);
- tcase_add_test(tc_basic, test_long_latin1_attribute);
- tcase_add_test(tc_basic, test_long_ascii_attribute);
- /* Regression test for SF bug #491986. */
- tcase_add_test(tc_basic, test_danish_latin1);
- /* Regression test for SF bug #514281. */
- tcase_add_test(tc_basic, test_french_charref_hexidecimal);
- tcase_add_test(tc_basic, test_french_charref_decimal);
- tcase_add_test(tc_basic, test_french_latin1);
- tcase_add_test(tc_basic, test_french_utf8);
- tcase_add_test(tc_basic, test_utf8_false_rejection);
- tcase_add_test(tc_basic, test_line_number_after_parse);
- tcase_add_test(tc_basic, test_column_number_after_parse);
- tcase_add_test(tc_basic, test_line_and_column_numbers_inside_handlers);
- tcase_add_test(tc_basic, test_line_number_after_error);
- tcase_add_test(tc_basic, test_column_number_after_error);
- tcase_add_test(tc_basic, test_really_long_lines);
- tcase_add_test(tc_basic, test_really_long_encoded_lines);
- tcase_add_test(tc_basic, test_end_element_events);
- tcase_add_test(tc_basic, test_attr_whitespace_normalization);
- tcase_add_test(tc_basic, test_xmldecl_misplaced);
- tcase_add_test(tc_basic, test_xmldecl_invalid);
- tcase_add_test(tc_basic, test_xmldecl_missing_attr);
- tcase_add_test(tc_basic, test_xmldecl_missing_value);
- tcase_add_test(tc_basic, test_unknown_encoding_internal_entity);
- tcase_add_test(tc_basic, test_unrecognised_encoding_internal_entity);
- tcase_add_test(tc_basic, test_wfc_undeclared_entity_unread_external_subset);
- tcase_add_test(tc_basic, test_wfc_undeclared_entity_no_external_subset);
- tcase_add_test(tc_basic, test_wfc_undeclared_entity_standalone);
- tcase_add_test(tc_basic, test_wfc_undeclared_entity_with_external_subset);
- tcase_add_test(tc_basic, test_not_standalone_handler_reject);
- tcase_add_test(tc_basic, test_not_standalone_handler_accept);
- tcase_add_test(tc_basic,
- test_wfc_undeclared_entity_with_external_subset_standalone);
- tcase_add_test(tc_basic, test_entity_with_external_subset_unless_standalone);
- tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_set_encoding);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_no_handler);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_set_bom);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_bad_encoding);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_bad_encoding_2);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_invalid_parse);
- tcase_add_test__ifdef_xml_dtd(tc_basic,
- test_ext_entity_invalid_suspended_parse);
- tcase_add_test(tc_basic, test_dtd_default_handling);
- tcase_add_test(tc_basic, test_dtd_attr_handling);
- tcase_add_test(tc_basic, test_empty_ns_without_namespaces);
- tcase_add_test(tc_basic, test_ns_in_attribute_default_without_namespaces);
- tcase_add_test(tc_basic, test_stop_parser_between_char_data_calls);
- tcase_add_test(tc_basic, test_suspend_parser_between_char_data_calls);
- tcase_add_test(tc_basic, test_repeated_stop_parser_between_char_data_calls);
- tcase_add_test(tc_basic, test_good_cdata_ascii);
- tcase_add_test(tc_basic, test_good_cdata_utf16);
- tcase_add_test(tc_basic, test_good_cdata_utf16_le);
- tcase_add_test(tc_basic, test_long_cdata_utf16);
-#ifndef XML_MIN_SIZE /* FIXME workaround -DXML_MIN_SIZE + ASan (issue #332) */
- tcase_add_test(tc_basic, test_multichar_cdata_utf16);
+ make_basic_test_case(s);
+ make_namespace_test_case(s);
+ make_miscellaneous_test_case(s);
+ make_alloc_test_case(s);
+ make_nsalloc_test_case(s);
+#if XML_GE == 1
+ make_accounting_test_case(s);
#endif
- tcase_add_test(tc_basic, test_utf16_bad_surrogate_pair);
- tcase_add_test(tc_basic, test_bad_cdata);
-#ifndef XML_MIN_SIZE /* FIXME workaround -DXML_MIN_SIZE + ASan (issue #332) */
- tcase_add_test(tc_basic, test_bad_cdata_utf16);
-#endif
- tcase_add_test(tc_basic, test_stop_parser_between_cdata_calls);
- tcase_add_test(tc_basic, test_suspend_parser_between_cdata_calls);
- tcase_add_test(tc_basic, test_memory_allocation);
- tcase_add_test(tc_basic, test_default_current);
- tcase_add_test(tc_basic, test_dtd_elements);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_set_foreign_dtd);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_foreign_dtd_not_standalone);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_invalid_foreign_dtd);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_foreign_dtd_with_doctype);
- tcase_add_test__ifdef_xml_dtd(tc_basic,
- test_foreign_dtd_without_external_subset);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_empty_foreign_dtd);
- tcase_add_test(tc_basic, test_set_base);
- tcase_add_test(tc_basic, test_attributes);
- tcase_add_test(tc_basic, test_reset_in_entity);
- tcase_add_test(tc_basic, test_resume_invalid_parse);
- tcase_add_test(tc_basic, test_resume_resuspended);
- tcase_add_test(tc_basic, test_cdata_default);
- tcase_add_test(tc_basic, test_subordinate_reset);
- tcase_add_test(tc_basic, test_subordinate_suspend);
- tcase_add_test(tc_basic, test_subordinate_xdecl_suspend);
- tcase_add_test(tc_basic, test_subordinate_xdecl_abort);
- tcase_add_test(tc_basic, test_explicit_encoding);
- tcase_add_test(tc_basic, test_trailing_cr);
- tcase_add_test(tc_basic, test_ext_entity_trailing_cr);
- tcase_add_test(tc_basic, test_trailing_rsqb);
- tcase_add_test(tc_basic, test_ext_entity_trailing_rsqb);
- tcase_add_test(tc_basic, test_ext_entity_good_cdata);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_user_parameters);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_ref_parameter);
- tcase_add_test(tc_basic, test_empty_parse);
- tcase_add_test(tc_basic, test_get_buffer_1);
- tcase_add_test(tc_basic, test_get_buffer_2);
- tcase_add_test(tc_basic, test_byte_info_at_end);
- tcase_add_test(tc_basic, test_byte_info_at_error);
- tcase_add_test(tc_basic, test_byte_info_at_cdata);
- tcase_add_test(tc_basic, test_predefined_entities);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_invalid_tag_in_dtd);
- tcase_add_test(tc_basic, test_not_predefined_entities);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ignore_section);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ignore_section_utf16);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ignore_section_utf16_be);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_bad_ignore_section);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_external_entity_values);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_not_standalone);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_value_abort);
- tcase_add_test(tc_basic, test_bad_public_doctype);
- tcase_add_test(tc_basic, test_attribute_enum_value);
- tcase_add_test(tc_basic, test_predefined_entity_redefinition);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_dtd_stop_processing);
- tcase_add_test(tc_basic, test_public_notation_no_sysid);
- tcase_add_test(tc_basic, test_nested_groups);
- tcase_add_test(tc_basic, test_group_choice);
- tcase_add_test(tc_basic, test_standalone_parameter_entity);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_skipped_parameter_entity);
- tcase_add_test__ifdef_xml_dtd(tc_basic,
- test_recursive_external_parameter_entity);
- tcase_add_test(tc_basic, test_undefined_ext_entity_in_external_dtd);
- tcase_add_test(tc_basic, test_suspend_xdecl);
- tcase_add_test(tc_basic, test_abort_epilog);
- tcase_add_test(tc_basic, test_abort_epilog_2);
- tcase_add_test(tc_basic, test_suspend_epilog);
- tcase_add_test(tc_basic, test_suspend_in_sole_empty_tag);
- tcase_add_test(tc_basic, test_unfinished_epilog);
- tcase_add_test(tc_basic, test_partial_char_in_epilog);
- tcase_add_test(tc_basic, test_hash_collision);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_suspend_resume_internal_entity);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_resume_entity_with_syntax_error);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_suspend_resume_parameter_entity);
- tcase_add_test(tc_basic, test_restart_on_error);
- tcase_add_test(tc_basic, test_reject_lt_in_attribute_value);
- tcase_add_test(tc_basic, test_reject_unfinished_param_in_att_value);
- tcase_add_test(tc_basic, test_trailing_cr_in_att_value);
- tcase_add_test(tc_basic, test_standalone_internal_entity);
- tcase_add_test(tc_basic, test_skipped_external_entity);
- tcase_add_test(tc_basic, test_skipped_null_loaded_ext_entity);
- tcase_add_test(tc_basic, test_skipped_unloaded_ext_entity);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_param_entity_with_trailing_cr);
- tcase_add_test(tc_basic, test_invalid_character_entity);
- tcase_add_test(tc_basic, test_invalid_character_entity_2);
- tcase_add_test(tc_basic, test_invalid_character_entity_3);
- tcase_add_test(tc_basic, test_invalid_character_entity_4);
- tcase_add_test(tc_basic, test_pi_handled_in_default);
- tcase_add_test(tc_basic, test_comment_handled_in_default);
- tcase_add_test(tc_basic, test_pi_yml);
- tcase_add_test(tc_basic, test_pi_xnl);
- tcase_add_test(tc_basic, test_pi_xmm);
- tcase_add_test(tc_basic, test_utf16_pi);
- tcase_add_test(tc_basic, test_utf16_be_pi);
- tcase_add_test(tc_basic, test_utf16_be_comment);
- tcase_add_test(tc_basic, test_utf16_le_comment);
- tcase_add_test(tc_basic, test_missing_encoding_conversion_fn);
- tcase_add_test(tc_basic, test_failing_encoding_conversion_fn);
- tcase_add_test(tc_basic, test_unknown_encoding_success);
- tcase_add_test(tc_basic, test_unknown_encoding_bad_name);
- tcase_add_test(tc_basic, test_unknown_encoding_bad_name_2);
- tcase_add_test(tc_basic, test_unknown_encoding_long_name_1);
- tcase_add_test(tc_basic, test_unknown_encoding_long_name_2);
- tcase_add_test(tc_basic, test_invalid_unknown_encoding);
- tcase_add_test(tc_basic, test_unknown_ascii_encoding_ok);
- tcase_add_test(tc_basic, test_unknown_ascii_encoding_fail);
- tcase_add_test(tc_basic, test_unknown_encoding_invalid_length);
- tcase_add_test(tc_basic, test_unknown_encoding_invalid_topbit);
- tcase_add_test(tc_basic, test_unknown_encoding_invalid_surrogate);
- tcase_add_test(tc_basic, test_unknown_encoding_invalid_high);
- tcase_add_test(tc_basic, test_unknown_encoding_invalid_attr_value);
- tcase_add_test(tc_basic, test_ext_entity_latin1_utf16le_bom);
- tcase_add_test(tc_basic, test_ext_entity_latin1_utf16be_bom);
- tcase_add_test(tc_basic, test_ext_entity_latin1_utf16le_bom2);
- tcase_add_test(tc_basic, test_ext_entity_latin1_utf16be_bom2);
- tcase_add_test(tc_basic, test_ext_entity_utf16_be);
- tcase_add_test(tc_basic, test_ext_entity_utf16_le);
- tcase_add_test(tc_basic, test_ext_entity_utf16_unknown);
- tcase_add_test(tc_basic, test_ext_entity_utf8_non_bom);
- tcase_add_test(tc_basic, test_utf8_in_cdata_section);
- tcase_add_test(tc_basic, test_utf8_in_cdata_section_2);
- tcase_add_test(tc_basic, test_trailing_spaces_in_elements);
- tcase_add_test(tc_basic, test_utf16_attribute);
- tcase_add_test(tc_basic, test_utf16_second_attr);
- tcase_add_test(tc_basic, test_attr_after_solidus);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_utf16_pe);
- tcase_add_test(tc_basic, test_bad_attr_desc_keyword);
- tcase_add_test(tc_basic, test_bad_attr_desc_keyword_utf16);
- tcase_add_test(tc_basic, test_bad_doctype);
- tcase_add_test(tc_basic, test_bad_doctype_utf16);
- tcase_add_test(tc_basic, test_bad_doctype_plus);
- tcase_add_test(tc_basic, test_bad_doctype_star);
- tcase_add_test(tc_basic, test_bad_doctype_query);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_unknown_encoding_bad_ignore);
- tcase_add_test(tc_basic, test_entity_in_utf16_be_attr);
- tcase_add_test(tc_basic, test_entity_in_utf16_le_attr);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_entity_public_utf16_be);
- tcase_add_test__ifdef_xml_dtd(tc_basic, test_entity_public_utf16_le);
- tcase_add_test(tc_basic, test_short_doctype);
- tcase_add_test(tc_basic, test_short_doctype_2);
- tcase_add_test(tc_basic, test_short_doctype_3);
- tcase_add_test(tc_basic, test_long_doctype);
- tcase_add_test(tc_basic, test_bad_entity);
- tcase_add_test(tc_basic, test_bad_entity_2);
- tcase_add_test(tc_basic, test_bad_entity_3);
- tcase_add_test(tc_basic, test_bad_entity_4);
- tcase_add_test(tc_basic, test_bad_notation);
- tcase_add_test(tc_basic, test_default_doctype_handler);
- tcase_add_test(tc_basic, test_empty_element_abort);
-
- suite_add_tcase(s, tc_namespace);
- tcase_add_checked_fixture(tc_namespace, namespace_setup, namespace_teardown);
- tcase_add_test(tc_namespace, test_return_ns_triplet);
- tcase_add_test(tc_namespace, test_ns_tagname_overwrite);
- tcase_add_test(tc_namespace, test_ns_tagname_overwrite_triplet);
- tcase_add_test(tc_namespace, test_start_ns_clears_start_element);
- tcase_add_test__ifdef_xml_dtd(tc_namespace,
- test_default_ns_from_ext_subset_and_ext_ge);
- tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_1);
- tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_2);
- tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_3);
- tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_4);
- tcase_add_test(tc_namespace, test_ns_unbound_prefix);
- tcase_add_test(tc_namespace, test_ns_default_with_empty_uri);
- tcase_add_test(tc_namespace, test_ns_duplicate_attrs_diff_prefixes);
- tcase_add_test(tc_namespace, test_ns_duplicate_hashes);
- tcase_add_test(tc_namespace, test_ns_unbound_prefix_on_attribute);
- tcase_add_test(tc_namespace, test_ns_unbound_prefix_on_element);
- tcase_add_test(tc_namespace, test_ns_parser_reset);
- tcase_add_test(tc_namespace, test_ns_long_element);
- tcase_add_test(tc_namespace, test_ns_mixed_prefix_atts);
- tcase_add_test(tc_namespace, test_ns_extend_uri_buffer);
- tcase_add_test(tc_namespace, test_ns_reserved_attributes);
- tcase_add_test(tc_namespace, test_ns_reserved_attributes_2);
- tcase_add_test(tc_namespace, test_ns_extremely_long_prefix);
- tcase_add_test(tc_namespace, test_ns_unknown_encoding_success);
- tcase_add_test(tc_namespace, test_ns_double_colon);
- tcase_add_test(tc_namespace, test_ns_double_colon_element);
- tcase_add_test(tc_namespace, test_ns_bad_attr_leafname);
- tcase_add_test(tc_namespace, test_ns_bad_element_leafname);
- tcase_add_test(tc_namespace, test_ns_utf16_leafname);
- tcase_add_test(tc_namespace, test_ns_utf16_element_leafname);
- tcase_add_test(tc_namespace, test_ns_utf16_doctype);
- tcase_add_test(tc_namespace, test_ns_invalid_doctype);
- tcase_add_test(tc_namespace, test_ns_double_colon_doctype);
-
- suite_add_tcase(s, tc_misc);
- tcase_add_checked_fixture(tc_misc, NULL, basic_teardown);
- tcase_add_test(tc_misc, test_misc_alloc_create_parser);
- tcase_add_test(tc_misc, test_misc_alloc_create_parser_with_encoding);
- tcase_add_test(tc_misc, test_misc_null_parser);
- tcase_add_test(tc_misc, test_misc_error_string);
- tcase_add_test(tc_misc, test_misc_version);
- tcase_add_test(tc_misc, test_misc_features);
- tcase_add_test(tc_misc, test_misc_attribute_leak);
- tcase_add_test(tc_misc, test_misc_utf16le);
- tcase_add_test(tc_misc, test_misc_stop_during_end_handler_issue_240_1);
- tcase_add_test(tc_misc, test_misc_stop_during_end_handler_issue_240_2);
- tcase_add_test__ifdef_xml_dtd(
- tc_misc, test_misc_deny_internal_entity_closing_doctype_issue_317);
-
- suite_add_tcase(s, tc_alloc);
- tcase_add_checked_fixture(tc_alloc, alloc_setup, alloc_teardown);
- tcase_add_test(tc_alloc, test_alloc_parse_xdecl);
- tcase_add_test(tc_alloc, test_alloc_parse_xdecl_2);
- tcase_add_test(tc_alloc, test_alloc_parse_pi);
- tcase_add_test(tc_alloc, test_alloc_parse_pi_2);
- tcase_add_test(tc_alloc, test_alloc_parse_pi_3);
- tcase_add_test(tc_alloc, test_alloc_parse_comment);
- tcase_add_test(tc_alloc, test_alloc_parse_comment_2);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_create_external_parser);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_run_external_parser);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_dtd_copy_default_atts);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_external_entity);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_ext_entity_set_encoding);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_internal_entity);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_dtd_default_handling);
- tcase_add_test(tc_alloc, test_alloc_explicit_encoding);
- tcase_add_test(tc_alloc, test_alloc_set_base);
- tcase_add_test(tc_alloc, test_alloc_realloc_buffer);
- tcase_add_test(tc_alloc, test_alloc_ext_entity_realloc_buffer);
- tcase_add_test(tc_alloc, test_alloc_realloc_many_attributes);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_public_entity_value);
- tcase_add_test__ifdef_xml_dtd(tc_alloc,
- test_alloc_realloc_subst_public_entity_value);
- tcase_add_test(tc_alloc, test_alloc_parse_public_doctype);
- tcase_add_test(tc_alloc, test_alloc_parse_public_doctype_long_name);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_set_foreign_dtd);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_attribute_enum_value);
- tcase_add_test__ifdef_xml_dtd(tc_alloc,
- test_alloc_realloc_attribute_enum_value);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_implied_attribute);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_default_attribute);
- tcase_add_test(tc_alloc, test_alloc_notation);
- tcase_add_test(tc_alloc, test_alloc_public_notation);
- tcase_add_test(tc_alloc, test_alloc_system_notation);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_nested_groups);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_nested_groups);
- tcase_add_test(tc_alloc, test_alloc_large_group);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_group_choice);
- tcase_add_test(tc_alloc, test_alloc_pi_in_epilog);
- tcase_add_test(tc_alloc, test_alloc_comment_in_epilog);
- tcase_add_test__ifdef_xml_dtd(tc_alloc,
- test_alloc_realloc_long_attribute_value);
- tcase_add_test(tc_alloc, test_alloc_attribute_whitespace);
- tcase_add_test(tc_alloc, test_alloc_attribute_predefined_entity);
- tcase_add_test(tc_alloc, test_alloc_long_attr_default_with_char_ref);
- tcase_add_test(tc_alloc, test_alloc_long_attr_value);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_nested_entities);
- tcase_add_test__ifdef_xml_dtd(tc_alloc,
- test_alloc_realloc_param_entity_newline);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_ce_extends_pe);
- tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_realloc_attributes);
- tcase_add_test(tc_alloc, test_alloc_long_doc_name);
- tcase_add_test(tc_alloc, test_alloc_long_base);
- tcase_add_test(tc_alloc, test_alloc_long_public_id);
- tcase_add_test(tc_alloc, test_alloc_long_entity_value);
- tcase_add_test(tc_alloc, test_alloc_long_notation);
-
- suite_add_tcase(s, tc_nsalloc);
- tcase_add_checked_fixture(tc_nsalloc, nsalloc_setup, nsalloc_teardown);
- tcase_add_test(tc_nsalloc, test_nsalloc_xmlns);
- tcase_add_test(tc_nsalloc, test_nsalloc_parse_buffer);
- tcase_add_test(tc_nsalloc, test_nsalloc_long_prefix);
- tcase_add_test(tc_nsalloc, test_nsalloc_long_uri);
- tcase_add_test(tc_nsalloc, test_nsalloc_long_attr);
- tcase_add_test(tc_nsalloc, test_nsalloc_long_attr_prefix);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_attributes);
- tcase_add_test(tc_nsalloc, test_nsalloc_long_element);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_binding_uri);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_prefix);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_longer_prefix);
- tcase_add_test(tc_nsalloc, test_nsalloc_long_namespace);
- tcase_add_test(tc_nsalloc, test_nsalloc_less_long_namespace);
- tcase_add_test(tc_nsalloc, test_nsalloc_long_context);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_context);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_context_2);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_context_3);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_context_4);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_context_5);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_context_6);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_context_7);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_ge_name);
- tcase_add_test(tc_nsalloc, test_nsalloc_realloc_long_context_in_dtd);
- tcase_add_test(tc_nsalloc, test_nsalloc_long_default_in_ext);
- tcase_add_test(tc_nsalloc, test_nsalloc_long_systemid_in_ext);
- tcase_add_test(tc_nsalloc, test_nsalloc_prefixed_element);
return s;
}
@@ -11613,9 +84,6 @@ main(int argc, char *argv[]) {
Suite *s = make_suite();
SRunner *sr = srunner_create(s);
- /* run the tests for internal helper functions */
- testhelper_is_whitespace_normalized();
-
for (i = 1; i < argc; ++i) {
char *opt = argv[i];
if (strcmp(opt, "-v") == 0 || strcmp(opt, "--verbose") == 0)
@@ -11629,7 +97,18 @@ main(int argc, char *argv[]) {
}
if (verbosity != CK_SILENT)
printf("Expat version: %" XML_FMT_STR "\n", XML_ExpatVersion());
- srunner_run_all(sr, verbosity);
+
+ for (g_chunkSize = 0; g_chunkSize <= 5; g_chunkSize++) {
+ for (int enabled = 0; enabled <= 1; ++enabled) {
+ char context[100];
+ g_reparseDeferralEnabledDefault = enabled;
+ snprintf(context, sizeof(context), "chunksize=%d deferral=%d",
+ g_chunkSize, enabled);
+ context[sizeof(context) - 1] = '\0';
+ srunner_run_all(sr, context, verbosity);
+ }
+ }
+ srunner_summarize(sr, verbosity);
nf = srunner_ntests_failed(sr);
srunner_free(sr);
diff --git a/3rdparty/expat/tests/runtestspp.cpp b/3rdparty/expat/tests/runtests_cxx.cpp
index fd3ceaa97a3..396714560a0 100644
--- a/3rdparty/expat/tests/runtestspp.cpp
+++ b/3rdparty/expat/tests/runtests_cxx.cpp
@@ -9,8 +9,8 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/tests/structdata.c b/3rdparty/expat/tests/structdata.c
index e81b7b18460..e311f1fae3a 100644
--- a/3rdparty/expat/tests/structdata.c
+++ b/3rdparty/expat/tests/structdata.c
@@ -6,8 +6,9 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,10 +31,12 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifdef HAVE_EXPAT_CONFIG_H
-# include "expat_config.h"
+#if defined(NDEBUG)
+# undef NDEBUG /* because test suite relies on assert(...) at the moment */
#endif
+#include "expat_config.h"
+
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
@@ -58,7 +61,7 @@
static XML_Char *
xmlstrdup(const XML_Char *s) {
size_t byte_count = (xcstrlen(s) + 1) * sizeof(XML_Char);
- XML_Char *dup = malloc(byte_count);
+ XML_Char *const dup = (XML_Char *)malloc(byte_count);
assert(dup != NULL);
memcpy(dup, s, byte_count);
@@ -81,13 +84,13 @@ StructData_AddItem(StructData *storage, const XML_Char *s, int data0, int data1,
assert(storage != NULL);
assert(s != NULL);
if (storage->count == storage->max_count) {
- StructDataEntry *new;
+ StructDataEntry *new_entries;
storage->max_count += STRUCT_EXTENSION_COUNT;
- new = realloc(storage->entries,
- storage->max_count * sizeof(StructDataEntry));
- assert(new != NULL);
- storage->entries = new;
+ new_entries = (StructDataEntry *)realloc(
+ storage->entries, storage->max_count * sizeof(StructDataEntry));
+ assert(new_entries != NULL);
+ storage->entries = new_entries;
}
entry = &storage->entries[storage->count];
@@ -105,17 +108,17 @@ void
StructData_CheckItems(StructData *storage, const StructDataEntry *expected,
int count) {
char buffer[1024];
- int i;
assert(storage != NULL);
assert(expected != NULL);
if (count != storage->count) {
- sprintf(buffer, "wrong number of entries: got %d, expected %d",
- storage->count, count);
+ snprintf(buffer, sizeof(buffer),
+ "wrong number of entries: got %d, expected %d", storage->count,
+ count);
StructData_Dispose(storage);
fail(buffer);
} else {
- for (i = 0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
const StructDataEntry *got = &storage->entries[i];
const StructDataEntry *want = &expected[i];
@@ -128,11 +131,11 @@ StructData_CheckItems(StructData *storage, const StructDataEntry *expected,
} else {
if (got->data0 != want->data0 || got->data1 != want->data1
|| got->data2 != want->data2) {
- sprintf(buffer,
- "struct '%" XML_FMT_STR
- "' expected (%d,%d,%d), got (%d,%d,%d)",
- got->str, want->data0, want->data1, want->data2, got->data0,
- got->data1, got->data2);
+ snprintf(buffer, sizeof(buffer),
+ "struct '%" XML_FMT_STR
+ "' expected (%d,%d,%d), got (%d,%d,%d)",
+ got->str, want->data0, want->data1, want->data2, got->data0,
+ got->data1, got->data2);
StructData_Dispose(storage);
fail(buffer);
}
diff --git a/3rdparty/expat/tests/structdata.h b/3rdparty/expat/tests/structdata.h
index 870ffaf2af0..09881b175f7 100644
--- a/3rdparty/expat/tests/structdata.h
+++ b/3rdparty/expat/tests/structdata.h
@@ -7,8 +7,7 @@
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/tests/structdata_cxx.cpp b/3rdparty/expat/tests/structdata_cxx.cpp
new file mode 100644
index 00000000000..43448f63405
--- /dev/null
+++ b/3rdparty/expat/tests/structdata_cxx.cpp
@@ -0,0 +1,32 @@
+/* C++ compilation harness for the test suite.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ 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 AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "structdata.c"
diff --git a/3rdparty/expat/tests/udiffer.py b/3rdparty/expat/tests/udiffer.py
index 6fb91be7e3d..2b58a4c3486 100755
--- a/3rdparty/expat/tests/udiffer.py
+++ b/3rdparty/expat/tests/udiffer.py
@@ -6,7 +6,8 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/tests/xmltest.sh b/3rdparty/expat/tests/xmltest.sh
index 9b500351143..56e66c56f6e 100755
--- a/3rdparty/expat/tests/xmltest.sh
+++ b/3rdparty/expat/tests/xmltest.sh
@@ -1,24 +1,56 @@
#! /usr/bin/env bash
-
-# EXPAT TEST SCRIPT FOR W3C XML TEST SUITE
-
+# EXPAT TEST SCRIPT FOR W3C XML TEST SUITE
+#
# This script can be used to exercise Expat against the
-# w3c.org xml test suite, available from
-# http://www.w3.org/XML/Test/xmlts20020606.zip.
-
+# w3c.org xml test suite, available from:
+# https://www.w3.org/XML/Test/xmlts20020606.zip
+#
# To run this script, first set XMLWF below so that xmlwf can be
# found, then set the output directory with OUTPUT.
-
+#
# The script lists all test cases where Expat shows a discrepancy
# from the expected result. Test cases where only the canonical
# output differs are prefixed with "Output differs:", and a diff file
# is generated in the appropriate subdirectory under $OUTPUT.
-
+#
# If there are output files provided, the script will use
# output from xmlwf and compare the desired output against it.
# However, one has to take into account that the canonical output
# produced by xmlwf conforms to an older definition of canonical XML
# and does not generate notation declarations.
+#
+# __ __ _
+# ___\ \/ /_ __ __ _| |_
+# / _ \\ /| '_ \ / _` | __|
+# | __// \| |_) | (_| | |_
+# \___/_/\_\ .__/ \__,_|\__|
+# |_| XML parser
+#
+# Copyright (c) 2002-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+# Copyright (c) 2002 Karl Waclawek <karl@waclawek.net>
+# Copyright (c) 2008-2019 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+# Copyright (c) 2025 Hanno Böck <hanno@gentoo.org>
+# Licensed under the MIT license:
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# 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 AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
shopt -s nullglob
diff --git a/3rdparty/expat/win32/README.txt b/3rdparty/expat/win32/README.txt
index d1069cdd2f0..7a8a0df6a2a 100644
--- a/3rdparty/expat/win32/README.txt
+++ b/3rdparty/expat/win32/README.txt
@@ -5,13 +5,13 @@ Expat can be built on Windows in two ways:
* Cygwin:
This follows the Unix build procedures.
-* MS Visual Studio 2008, 2010, 2013, 2015 and 2017:
+* MS Visual Studio 2019 and 2022:
Use CMake to generate a solution file for Visual Studio, then use msbuild
to compile. For example:
md build
cd build
- cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
+ cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
msbuild /m expat.sln
* All MS C/C++ compilers:
diff --git a/3rdparty/expat/win32/build_expat_iss.bat b/3rdparty/expat/win32/build_expat_iss.bat
index 4e31c17dfc3..aea73489bca 100644
--- a/3rdparty/expat/win32/build_expat_iss.bat
+++ b/3rdparty/expat/win32/build_expat_iss.bat
@@ -7,7 +7,7 @@ REM | __// \| |_) | (_| | |_
REM \___/_/\_\ .__/ \__,_|\__|
REM |_| XML parser
REM
-REM Copyright (C) 2019 Expat development team
+REM Copyright (c) 2019-2024 Sebastian Pipping <sebastian@pipping.org>
REM Licensed under the MIT license:
REM
REM Permission is hereby granted, free of charge, to any person obtaining
@@ -29,7 +29,7 @@ REM DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
REM OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
REM USE OR OTHER DEALINGS IN THE SOFTWARE.
-SET GENERATOR=Visual Studio 15 2017
+SET GENERATOR=Visual Studio 16 2019
REM Read by msbuild!
SET CONFIGURATION=RelWithDebInfo
@@ -43,7 +43,7 @@ MD %BINDIR% || EXIT /b 1
MD build_shared_char || EXIT /b 1
CD build_shared_char || EXIT /b 1
- cmake -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF .. || EXIT /b 1
+ cmake -A Win32 -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_WARNINGS_AS_ERRORS=ON -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF .. || EXIT /b 1
msbuild /m expat.sln || EXIT /b 1
DIR %CONFIGURATION% || EXIT /b 1
CD .. || EXIT /b 1
@@ -53,7 +53,7 @@ COPY build_shared_char\%CONFIGURATION%\libexpat.lib %BINDIR%\ || EXIT /b 1
MD build_static_char || EXIT /b 1
CD build_static_char || EXIT /b 1
- cmake -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_SHARED_LIBS=OFF .. || EXIT /b 1
+ cmake -A Win32 -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_WARNINGS_AS_ERRORS=ON -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_SHARED_LIBS=OFF .. || EXIT /b 1
msbuild /m expat.sln || EXIT /b 1
DIR %CONFIGURATION% || EXIT /b 1
CD .. || EXIT /b 1
@@ -63,7 +63,7 @@ COPY build_static_char\xmlwf\%CONFIGURATION%\xmlwf.exe %BINDIR%\ || EXIT /b 1
MD build_shared_wchar_t || EXIT /b 1
CD build_shared_wchar_t || EXIT /b 1
- cmake -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF -DEXPAT_CHAR_TYPE=wchar_t .. || EXIT /b 1
+ cmake -A Win32 -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_WARNINGS_AS_ERRORS=ON -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF -DEXPAT_CHAR_TYPE=wchar_t .. || EXIT /b 1
msbuild /m expat.sln || EXIT /b 1
DIR %CONFIGURATION% || EXIT /b 1
CD .. || EXIT /b 1
@@ -73,7 +73,7 @@ COPY build_shared_wchar_t\%CONFIGURATION%\libexpatw.lib %BINDIR%\ || EXIT /b 1
MD build_static_wchar_t || EXIT /b 1
CD build_static_wchar_t || EXIT /b 1
- cmake -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF -DEXPAT_SHARED_LIBS=OFF -DEXPAT_CHAR_TYPE=wchar_t .. || EXIT /b 1
+ cmake -A Win32 -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_WARNINGS_AS_ERRORS=ON -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF -DEXPAT_SHARED_LIBS=OFF -DEXPAT_CHAR_TYPE=wchar_t .. || EXIT /b 1
msbuild /m expat.sln || EXIT /b 1
DIR %CONFIGURATION% || EXIT /b 1
CD .. || EXIT /b 1
diff --git a/3rdparty/expat/win32/expat.iss b/3rdparty/expat/win32/expat.iss
index ef95f175857..60159d8c926 100644
--- a/3rdparty/expat/win32/expat.iss
+++ b/3rdparty/expat/win32/expat.iss
@@ -1,21 +1,55 @@
; Basic setup script for the Inno Setup installer builder. For more
; information on the free installer builder, see www.jrsoftware.org.
;
-; This script was contributed by Tim Peters.
+; This script was originally contributed by Tim Peters.
; It was designed for Inno Setup 2.0.19 but works with later versions as well.
+;
+; __ __ _
+; ___\ \/ /_ __ __ _| |_
+; / _ \\ /| '_ \ / _` | __|
+; | __// \| |_) | (_| | |_
+; \___/_/\_\ .__/ \__,_|\__|
+; |_| XML parser
+;
+; Copyright (c) 2001 Tim Peters <tim.peters@gmail.com>
+; Copyright (c) 2001-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+; Copyright (c) 2006-2017 Karl Waclawek <karl@waclawek.net>
+; Copyright (c) 2007-2025 Sebastian Pipping <sebastian@pipping.org>
+; Copyright (c) 2022 Johnny Jazeix <jazeix@gmail.com>
+; Copyright (c) 2024 Dag-Erling Smørgrav <des@des.dev>
+; Licensed under the MIT license:
+;
+; Permission is hereby granted, free of charge, to any person obtaining
+; a copy of this software and associated documentation files (the
+; "Software"), to deal in the Software without restriction, including
+; without limitation the rights to use, copy, modify, merge, publish,
+; distribute, sublicense, and/or sell copies of the Software, and to permit
+; persons to whom the Software is furnished to do so, subject to the
+; following conditions:
+;
+; The above copyright notice and this permission notice shall be included
+; in all copies or substantial portions of the Software.
+;
+; 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 AND NONINFRINGEMENT. IN
+; NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+; DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+; USE OR OTHER DEALINGS IN THE SOFTWARE.
-#define expatVer "2.2.10"
+#define expatVer "2.7.1"
[Setup]
AppName=Expat
AppId=expat
AppVersion={#expatVer}
AppVerName=Expat {#expatVer}
-AppCopyright=Copyright © 1998-2017 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers
+AppCopyright=Copyright © 1997-2025 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers
AppPublisher=The Expat Developers
-AppPublisherURL=http://www.libexpat.org/
-AppSupportURL=http://www.libexpat.org/
-AppUpdatesURL=http://www.libexpat.org/
+AppPublisherURL=https://libexpat.github.io/
+AppSupportURL=https://libexpat.github.io/
+AppUpdatesURL=https://libexpat.github.io/
UninstallDisplayName=Expat XML Parser {#expatVer}
VersionInfoVersion={#expatVer}
OutputBaseFilename=expat-win32bin-{#expatVer}
@@ -41,24 +75,29 @@ Flags: ignoreversion; Source: COPYING; DestDir: "{app}"; De
Flags: ignoreversion; Source: README.md; DestDir: "{app}"; DestName: README.txt
Flags: ignoreversion; Source: doc\*.html; DestDir: "{app}\Doc"
Flags: ignoreversion; Source: doc\*.css; DestDir: "{app}\Doc"
-Flags: ignoreversion; Source: doc\*.png; DestDir: "{app}\Doc"
+Flags: ignoreversion; Source: doc\*.xml; DestDir: "{app}\Source\doc"
Flags: ignoreversion; Source: win32\bin\Release\*.dll; DestDir: "{app}\Bin"
Flags: ignoreversion; Source: win32\bin\Release\*.lib; DestDir: "{app}\Bin"
+Flags: ignoreversion; Source: win32\version.rc.cmake; DestDir: "{app}\Source\win32"
Flags: ignoreversion; Source: win32\README.txt; DestDir: "{app}\Source"
+Flags: ignoreversion; Source: AUTHORS; DestDir: "{app}\Source"
Flags: ignoreversion; Source: Changes; DestDir: "{app}\Source"
Flags: ignoreversion; Source: CMake.README; DestDir: "{app}\Source"
Flags: ignoreversion; Source: CMakeLists.txt; DestDir: "{app}\Source"
Flags: ignoreversion; Source: ConfigureChecks.cmake; DestDir: "{app}\Source"
+Flags: ignoreversion; Source: expat.pc.cmake; DestDir: "{app}\Source"
Flags: ignoreversion; Source: expat_config.h.cmake; DestDir: "{app}\Source"
+Flags: ignoreversion; Source: run.sh.in; DestDir: "{app}\Source"
Flags: ignoreversion; Source: cmake\expat-config.cmake.in; DestDir: "{app}\Source\cmake"
+Flags: ignoreversion; Source: fuzz\*.c; DestDir: "{app}\Source\fuzz"
Flags: ignoreversion; Source: lib\*.c; DestDir: "{app}\Source\lib"
Flags: ignoreversion; Source: lib\*.h; DestDir: "{app}\Source\lib"
-Flags: ignoreversion; Source: lib\*.def; DestDir: "{app}\Source\lib"
+Flags: ignoreversion; Source: lib\*.def.cmake; DestDir: "{app}\Source\lib"
Flags: ignoreversion; Source: examples\*.c; DestDir: "{app}\Source\examples"
Flags: ignoreversion; Source: tests\*.c; DestDir: "{app}\Source\tests"
Flags: ignoreversion; Source: tests\*.cpp; DestDir: "{app}\Source\tests"
Flags: ignoreversion; Source: tests\*.h; DestDir: "{app}\Source\tests"
-Flags: ignoreversion; Source: tests\README.txt; DestDir: "{app}\Source\tests"
+Flags: ignoreversion; Source: tests\README.md; DestDir: "{app}\Source\tests"
Flags: ignoreversion; Source: tests\benchmark\*.c; DestDir: "{app}\Source\tests\benchmark"
Flags: ignoreversion; Source: tests\benchmark\README.txt; DestDir: "{app}\Source\tests\benchmark"
Flags: ignoreversion; Source: xmlwf\*.c*; DestDir: "{app}\Source\xmlwf"
diff --git a/3rdparty/expat/win32/version.rc.cmake b/3rdparty/expat/win32/version.rc.cmake
new file mode 100644
index 00000000000..4b883f37aaf
--- /dev/null
+++ b/3rdparty/expat/win32/version.rc.cmake
@@ -0,0 +1,17 @@
+1 VERSIONINFO
+FILEVERSION VER_FILEVERSION
+PRODUCTVERSION VER_FILEVERSION
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "FileVersion", "${PROJECT_VERSION}.0"
+ VALUE "ProductVersion", "${PROJECT_VERSION}.0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1252
+ END
+END
diff --git a/3rdparty/expat/xmlwf/Makefile.am b/3rdparty/expat/xmlwf/Makefile.am
index f35ade7a77a..c7eebd1eeec 100644
--- a/3rdparty/expat/xmlwf/Makefile.am
+++ b/3rdparty/expat/xmlwf/Makefile.am
@@ -6,7 +6,7 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -38,7 +38,7 @@ xmlwf_SOURCES = \
@FILEMAP@.c
xmlwf_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
-xmlwf_LDFLAGS = @AM_LDFLAGS@
+xmlwf_LDFLAGS = @AM_LDFLAGS@ @LIBM@
if MINGW
if UNICODE
diff --git a/3rdparty/expat/xmlwf/Makefile.in b/3rdparty/expat/xmlwf/Makefile.in
index 531475ab243..480fd3e0410 100644
--- a/3rdparty/expat/xmlwf/Makefile.in
+++ b/3rdparty/expat/xmlwf/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -134,6 +134,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \
+ $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -216,8 +218,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/conftools/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -237,8 +237,10 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CPP = @CPP@
+CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
@@ -254,10 +256,20 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
FGREP = @FGREP@
+FILECMD = @FILECMD@
FILEMAP = @FILEMAP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -267,6 +279,8 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LIBAGE = @LIBAGE@
LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
+LIBM = @LIBM@
LIBOBJS = @LIBOBJS@
LIBREVISION = @LIBREVISION@
LIBS = @LIBS@
@@ -275,6 +289,7 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -296,9 +311,12 @@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SIZEOF_VOID_P = @SIZEOF_VOID_P@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
STRIP = @STRIP@
VERSION = @VERSION@
-_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -361,7 +379,7 @@ xmlwf_SOURCES = \
@FILEMAP@.c
xmlwf_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib $(am__append_1)
-xmlwf_LDFLAGS = @AM_LDFLAGS@ $(am__append_2)
+xmlwf_LDFLAGS = @AM_LDFLAGS@ @LIBM@ $(am__append_2)
EXTRA_DIST = \
codepage.h \
ct.c \
@@ -378,7 +396,7 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -402,9 +420,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@@ -612,7 +630,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/3rdparty/expat/xmlwf/codepage.c b/3rdparty/expat/xmlwf/codepage.c
index 44d2035811d..8e0b5d199cd 100644
--- a/3rdparty/expat/xmlwf/codepage.c
+++ b/3rdparty/expat/xmlwf/codepage.c
@@ -7,7 +7,11 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2005-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2019 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/xmlwf/codepage.h b/3rdparty/expat/xmlwf/codepage.h
index 1b75d58365f..75ddbce4a45 100644
--- a/3rdparty/expat/xmlwf/codepage.h
+++ b/3rdparty/expat/xmlwf/codepage.h
@@ -7,7 +7,9 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/xmlwf/ct.c b/3rdparty/expat/xmlwf/ct.c
index dcf92bab568..d4c0e7a0a95 100644
--- a/3rdparty/expat/xmlwf/ct.c
+++ b/3rdparty/expat/xmlwf/ct.c
@@ -7,7 +7,8 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/xmlwf/filemap.h b/3rdparty/expat/xmlwf/filemap.h
index ef66114422f..5e0c70fa99b 100644
--- a/3rdparty/expat/xmlwf/filemap.h
+++ b/3rdparty/expat/xmlwf/filemap.h
@@ -7,7 +7,9 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/xmlwf/readfilemap.c b/3rdparty/expat/xmlwf/readfilemap.c
index d5b84f995ad..d8e7fce42ea 100644
--- a/3rdparty/expat/xmlwf/readfilemap.c
+++ b/3rdparty/expat/xmlwf/readfilemap.c
@@ -7,7 +7,14 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2001-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2002-2009 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2017 Franek Korta <fkorta@gmail.com>
+ Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
+ Copyright (c) 2025 Hanno Böck <hanno@gentoo.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -45,14 +52,14 @@
#if defined(_MSC_VER)
# include <io.h>
/* https://msdn.microsoft.com/en-us/library/wyssk1bs(v=vs.100).aspx */
-# define _EXPAT_read _read
-# define _EXPAT_read_count_t int
-# define _EXPAT_read_req_t unsigned int
+# define EXPAT_read _read
+# define EXPAT_read_count_t int
+# define EXPAT_read_req_t unsigned int
#else /* POSIX */
-/* http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html */
-# define _EXPAT_read read
-# define _EXPAT_read_count_t ssize_t
-# define _EXPAT_read_req_t size_t
+/* https://pubs.opengroup.org/onlinepubs/009695399/functions/read.html */
+# define EXPAT_read read
+# define EXPAT_read_count_t ssize_t
+# define EXPAT_read_req_t size_t
#endif
#ifndef S_ISREG
@@ -62,7 +69,7 @@
# ifndef S_IFMT
# define S_IFMT _S_IFMT
# endif
-# define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif /* not S_ISREG */
#ifndef O_BINARY
@@ -82,7 +89,7 @@ filemap(const tchar *name,
void *arg) {
size_t nbytes;
int fd;
- _EXPAT_read_count_t n;
+ EXPAT_read_count_t n;
struct stat sb;
void *p;
@@ -120,14 +127,14 @@ filemap(const tchar *name,
close(fd);
return 0;
}
- n = _EXPAT_read(fd, p, (_EXPAT_read_req_t)nbytes);
+ n = EXPAT_read(fd, p, (EXPAT_read_req_t)nbytes);
if (n < 0) {
tperror(name);
free(p);
close(fd);
return 0;
}
- if (n != (_EXPAT_read_count_t)nbytes) {
+ if (n != (EXPAT_read_count_t)nbytes) {
ftprintf(stderr, T("%s: read unexpected number of bytes\n"), name);
free(p);
close(fd);
diff --git a/3rdparty/expat/xmlwf/unixfilemap.c b/3rdparty/expat/xmlwf/unixfilemap.c
index 0d0dc0424dc..d0ce9cc60a8 100644
--- a/3rdparty/expat/xmlwf/unixfilemap.c
+++ b/3rdparty/expat/xmlwf/unixfilemap.c
@@ -7,7 +7,11 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2001-2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/xmlwf/win32filemap.c b/3rdparty/expat/xmlwf/win32filemap.c
index 0c9b7ecc5ff..a2db8eafc43 100644
--- a/3rdparty/expat/xmlwf/win32filemap.c
+++ b/3rdparty/expat/xmlwf/win32filemap.c
@@ -7,7 +7,10 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -105,7 +108,7 @@ filemap(const TCHAR *name,
static void
win32perror(const TCHAR *s) {
- LPVOID buf;
+ LPVOID buf = NULL;
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, 0,
diff --git a/3rdparty/expat/xmlwf/xmlfile.c b/3rdparty/expat/xmlwf/xmlfile.c
index e3d22c574c5..9c4f7f8dbad 100644
--- a/3rdparty/expat/xmlwf/xmlfile.c
+++ b/3rdparty/expat/xmlwf/xmlfile.c
@@ -7,7 +7,15 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2004-2006 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2021 Donghee Na <donghee.na@python.org>
+ Copyright (c) 2024 Hanno Böck <hanno@gentoo.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,6 +38,8 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include "expat_config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
@@ -38,9 +48,7 @@
#ifdef _WIN32
# include "winconfig.h"
-#elif defined(HAVE_EXPAT_CONFIG_H)
-# include <expat_config.h>
-#endif /* ndef _WIN32 */
+#endif
#include "expat.h"
#include "internal.h" /* for UNUSED_P only */
@@ -64,11 +72,7 @@
# endif
#endif
-#ifdef _DEBUG
-# define READ_SIZE 16
-#else
-# define READ_SIZE (1024 * 8)
-#endif
+int g_read_size_bytes = 1024 * 8;
typedef struct {
XML_Parser parser;
@@ -88,7 +92,8 @@ reportError(XML_Parser parser, const XML_Char *filename) {
filename, XML_GetErrorLineNumber(parser),
XML_GetErrorColumnNumber(parser), message);
else
- ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code);
+ ftprintf(stderr, T("%s: (unknown message %u)\n"), filename,
+ (unsigned int)code);
}
/* This implementation will give problems on files larger than INT_MAX. */
@@ -188,7 +193,7 @@ processStream(const XML_Char *filename, XML_Parser parser) {
}
for (;;) {
int nread;
- char *buf = (char *)XML_GetBuffer(parser, READ_SIZE);
+ char *buf = (char *)XML_GetBuffer(parser, g_read_size_bytes);
if (! buf) {
if (filename != NULL)
close(fd);
@@ -196,7 +201,7 @@ processStream(const XML_Char *filename, XML_Parser parser) {
filename != NULL ? filename : T("xmlwf"));
return 0;
}
- nread = read(fd, buf, READ_SIZE);
+ nread = read(fd, buf, g_read_size_bytes);
if (nread < 0) {
tperror(filename != NULL ? filename : T("STDIN"));
if (filename != NULL)
diff --git a/3rdparty/expat/xmlwf/xmlfile.h b/3rdparty/expat/xmlwf/xmlfile.h
index 6e5d5b49eb7..579201ccf49 100644
--- a/3rdparty/expat/xmlwf/xmlfile.h
+++ b/3rdparty/expat/xmlwf/xmlfile.h
@@ -7,7 +7,10 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2005 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -39,5 +42,7 @@
# define XML_FMT_INT_MOD "l"
#endif
+extern int g_read_size_bytes;
+
extern int XML_ProcessFile(XML_Parser parser, const XML_Char *filename,
unsigned flags);
diff --git a/3rdparty/expat/xmlwf/xmlmime.c b/3rdparty/expat/xmlwf/xmlmime.c
index 39160d7198c..883e293dac4 100644
--- a/3rdparty/expat/xmlwf/xmlmime.c
+++ b/3rdparty/expat/xmlwf/xmlmime.c
@@ -7,7 +7,9 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2016-2018 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/xmlwf/xmlmime.h b/3rdparty/expat/xmlwf/xmlmime.h
index 0471286234a..591a8847760 100644
--- a/3rdparty/expat/xmlwf/xmlmime.h
+++ b/3rdparty/expat/xmlwf/xmlmime.h
@@ -7,7 +7,8 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/3rdparty/expat/xmlwf/xmltchar.h b/3rdparty/expat/xmlwf/xmltchar.h
index d7e7b411b44..30283d086dd 100644
--- a/3rdparty/expat/xmlwf/xmltchar.h
+++ b/3rdparty/expat/xmlwf/xmltchar.h
@@ -7,7 +7,8 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -54,6 +55,8 @@
# define tmain wmain
# define tremove _wremove
# define tchar wchar_t
+# define tcstof wcstof
+# define tcstoull wcstoull
#else /* not XML_UNICODE */
# define T(x) x
# define ftprintf fprintf
@@ -71,4 +74,6 @@
# define tmain main
# define tremove remove
# define tchar char
+# define tcstof strtof
+# define tcstoull strtoull
#endif /* not XML_UNICODE */
diff --git a/3rdparty/expat/xmlwf/xmlwf.c b/3rdparty/expat/xmlwf/xmlwf.c
index 5121fa1028e..7c0a8cd4d6a 100644
--- a/3rdparty/expat/xmlwf/xmlwf.c
+++ b/3rdparty/expat/xmlwf/xmlwf.c
@@ -7,7 +7,18 @@
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000-2017 Expat development team
+ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
+ Copyright (c) 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
+ Copyright (c) 2004-2009 Karl Waclawek <karl@waclawek.net>
+ Copyright (c) 2005-2007 Steven Solie <steven@solie.ca>
+ Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
+ Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
+ Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
+ Copyright (c) 2020 Joe Orton <jorton@redhat.com>
+ Copyright (c) 2020 Kleber Tarcísio <klebertarcisio@yahoo.com.br>
+ Copyright (c) 2021 Tim Bray <tbray@textuality.com>
+ Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
+ Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -30,11 +41,15 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include "expat_config.h"
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
+#include <math.h> /* for isnan */
+#include <errno.h>
#include "expat.h"
#include "codepage.h"
@@ -50,6 +65,14 @@
# include <wchar.h>
#endif
+enum ExitCode {
+ XMLWF_EXIT_SUCCESS = 0,
+ XMLWF_EXIT_INTERNAL_ERROR = 1,
+ XMLWF_EXIT_NOT_WELLFORMED = 2,
+ XMLWF_EXIT_OUTPUT_ERROR = 3,
+ XMLWF_EXIT_USAGE_ERROR = 4,
+};
+
/* Structures for handler user data */
typedef struct NotationList {
struct NotationList *next;
@@ -156,7 +179,7 @@ is equivalent to lexicographically comparing based on the character number. */
static int
attcmp(const void *att1, const void *att2) {
- return tcscmp(*(const XML_Char **)att1, *(const XML_Char **)att2);
+ return tcscmp(*(const XML_Char *const *)att1, *(const XML_Char *const *)att2);
}
static void XMLCALL
@@ -193,10 +216,10 @@ endElement(void *userData, const XML_Char *name) {
static int
nsattcmp(const void *p1, const void *p2) {
- const XML_Char *att1 = *(const XML_Char **)p1;
- const XML_Char *att2 = *(const XML_Char **)p2;
+ const XML_Char *att1 = *(const XML_Char *const *)p1;
+ const XML_Char *att2 = *(const XML_Char *const *)p2;
int sep1 = (tcsrchr(att1, NSSEP) != 0);
- int sep2 = (tcsrchr(att1, NSSEP) != 0);
+ int sep2 = (tcsrchr(att2, NSSEP) != 0);
if (sep1 != sep2)
return sep1 - sep2;
return tcscmp(att1, att2);
@@ -322,6 +345,13 @@ freeNotations(XmlwfUserData *data) {
data->notationListHead = NULL;
}
+static void
+cleanupUserData(XmlwfUserData *userData) {
+ free((void *)userData->currentDoctypeName);
+ userData->currentDoctypeName = NULL;
+ freeNotations(userData);
+}
+
static int
xcscmp(const XML_Char *xs, const XML_Char *xt) {
while (*xs != 0 && *xt != 0) {
@@ -341,8 +371,8 @@ xcscmp(const XML_Char *xs, const XML_Char *xt) {
static int
notationCmp(const void *a, const void *b) {
- const NotationList *const n1 = *(NotationList **)a;
- const NotationList *const n2 = *(NotationList **)b;
+ const NotationList *const n1 = *(const NotationList *const *)a;
+ const NotationList *const n2 = *(const NotationList *const *)b;
return xcscmp(n1->notationName, n2->notationName);
}
@@ -842,47 +872,71 @@ showVersion(XML_Char *prog) {
}
}
+#if defined(__GNUC__)
+__attribute__((noreturn))
+#endif
static void
usage(const XML_Char *prog, int rc) {
ftprintf(
stderr,
/* Generated with:
* $ xmlwf/xmlwf_helpgen.sh
+ * To update, change xmlwf/xmlwf_helpgen.py, then paste the output of
+ * xmlwf/xmlwf_helpgen.sh in here.
*/
/* clang-format off */
- T("usage: %s [-s] [-n] [-p] [-x] [-e ENCODING] [-w] [-r] [-d DIRECTORY]\n")
- T(" [-c | -m | -t] [-N]\n")
- T(" [FILE [FILE ...]]\n")
+ T("usage:\n")
+ T(" %s [OPTIONS] [FILE ...]\n")
+ T(" %s -h|--help\n")
+ T(" %s -v|--version\n")
T("\n")
T("xmlwf - Determines if an XML document is well-formed\n")
T("\n")
T("positional arguments:\n")
- T(" FILE file to process (default: STDIN)\n")
+ T(" FILE file to process (default: STDIN)\n")
T("\n")
T("input control arguments:\n")
- T(" -s print an error if the document is not [s]tandalone\n")
- T(" -n enable [n]amespace processing\n")
- T(" -p enable processing external DTDs and [p]arameter entities\n")
- T(" -x enable processing of e[x]ternal entities\n")
- T(" -e ENCODING override any in-document [e]ncoding declaration\n")
- T(" -w enable support for [W]indows code pages\n")
- T(" -r disable memory-mapping and use normal file [r]ead IO calls instead\n")
+ T(" -s print an error if the document is not [s]tandalone\n")
+ T(" -n enable [n]amespace processing\n")
+ T(" -p enable processing of external DTDs and [p]arameter entities\n")
+ T(" -x enable processing of e[x]ternal entities\n")
+ T(" -e ENCODING override any in-document [e]ncoding declaration\n")
+ T(" -w enable support for [W]indows code pages\n")
+ T(" -r disable memory-mapping and use [r]ead calls instead\n")
+ T(" -g BYTES buffer size to request per call pair to XML_[G]etBuffer and read (default: 8 KiB)\n")
+ T(" -k when processing multiple files, [k]eep processing after first file with error\n")
T("\n")
T("output control arguments:\n")
- T(" -d DIRECTORY output [d]estination directory\n")
- T(" -c write a [c]opy of input XML, not canonical XML\n")
- T(" -m write [m]eta XML, not canonical XML\n")
- T(" -t write no XML output for [t]iming of plain parsing\n")
- T(" -N enable adding doctype and [n]otation declarations\n")
+ T(" -d DIRECTORY output [d]estination directory\n")
+ T(" -c write a [c]opy of input XML, not canonical XML\n")
+ T(" -m write [m]eta XML, not canonical XML\n")
+ T(" -t write no XML output for [t]iming of plain parsing\n")
+ T(" -N enable adding doctype and [n]otation declarations\n")
+ T("\n")
+ T("billion laughs attack protection:\n")
+ T(" NOTE: If you ever need to increase these values for non-attack payload, please file a bug report.\n")
+ T("\n")
+ T(" -a FACTOR set maximum tolerated [a]mplification factor (default: 100.0)\n")
+ T(" -b BYTES set number of output [b]ytes needed to activate (default: 8 MiB)\n")
+ T("\n")
+ T("reparse deferral:\n")
+ T(" -q disable reparse deferral, and allow [q]uadratic parse runtime with large tokens\n")
T("\n")
T("info arguments:\n")
- T(" -h show this [h]elp message and exit\n")
- T(" -v show program's [v]ersion number and exit\n")
+ T(" -h, --help show this [h]elp message and exit\n")
+ T(" -v, --version show program's [v]ersion number and exit\n")
+ T("\n")
+ T("exit status:\n")
+ T(" 0 the input files are well-formed and the output (if requested) was written successfully\n")
+ T(" 1 could not allocate data structures, signals a serious problem with execution environment\n")
+ T(" 2 one or more input files were not well-formed\n")
+ T(" 3 could not create an output file\n")
+ T(" 4 command-line argument error\n")
T("\n")
T("xmlwf of libexpat is software libre, licensed under the MIT license.\n")
- T("Please report bugs at https://github.com/libexpat/libexpat/issues. Thank you!\n")
+ T("Please report bugs at https://github.com/libexpat/libexpat/issues -- thank you!\n")
, /* clang-format on */
- prog);
+ prog, prog, prog);
exit(rc);
}
@@ -891,6 +945,21 @@ usage(const XML_Char *prog, int rc) {
int wmain(int argc, XML_Char **argv);
#endif
+#define XMLWF_SHIFT_ARG_INTO(constCharStarTarget, argc, argv, i, j) \
+ { \
+ if (argv[i][j + 1] == T('\0')) { \
+ if (++i == argc) { \
+ usage(argv[0], XMLWF_EXIT_USAGE_ERROR); \
+ /* usage called exit(..), never gets here */ \
+ } \
+ constCharStarTarget = argv[i]; \
+ } else { \
+ constCharStarTarget = argv[i] + j + 1; \
+ } \
+ i++; \
+ j = 0; \
+ }
+
int
tmain(int argc, XML_Char **argv) {
int i, j;
@@ -902,6 +971,15 @@ tmain(int argc, XML_Char **argv) {
int useNamespaces = 0;
int requireStandalone = 0;
int requiresNotations = 0;
+ int continueOnError = 0;
+
+ float attackMaximumAmplification = -1.0f; /* signaling "not set" */
+ unsigned long long attackThresholdBytes = 0;
+ XML_Bool attackThresholdGiven = XML_FALSE;
+
+ XML_Bool disableDeferral = XML_FALSE;
+
+ int exitCode = XMLWF_EXIT_SUCCESS;
enum XML_ParamEntityParsing paramEntityParsing
= XML_PARAM_ENTITY_PARSING_NEVER;
int useStdin = 0;
@@ -917,9 +995,17 @@ tmain(int argc, XML_Char **argv) {
if (j == 0) {
if (argv[i][0] != T('-'))
break;
- if (argv[i][1] == T('-') && argv[i][2] == T('\0')) {
- i++;
- break;
+ if (argv[i][1] == T('-')) {
+ if (argv[i][2] == T('\0')) {
+ i++;
+ break;
+ } else if (tcscmp(argv[i] + 2, T("help")) == 0) {
+ usage(argv[0], XMLWF_EXIT_SUCCESS);
+ // usage called exit(..), never gets here
+ } else if (tcscmp(argv[i] + 2, T("version")) == 0) {
+ showVersion(argv[0]);
+ return XMLWF_EXIT_SUCCESS;
+ }
}
j++;
}
@@ -965,31 +1051,91 @@ tmain(int argc, XML_Char **argv) {
j++;
break;
case T('d'):
- if (argv[i][j + 1] == T('\0')) {
- if (++i == argc)
- usage(argv[0], 2);
- outputDir = argv[i];
- } else
- outputDir = argv[i] + j + 1;
- i++;
- j = 0;
+ XMLWF_SHIFT_ARG_INTO(outputDir, argc, argv, i, j);
break;
case T('e'):
- if (argv[i][j + 1] == T('\0')) {
- if (++i == argc)
- usage(argv[0], 2);
- encoding = argv[i];
- } else
- encoding = argv[i] + j + 1;
- i++;
- j = 0;
+ XMLWF_SHIFT_ARG_INTO(encoding, argc, argv, i, j);
break;
case T('h'):
- usage(argv[0], 0);
- return 0;
+ usage(argv[0], XMLWF_EXIT_SUCCESS);
+ // usage called exit(..), never gets here
case T('v'):
showVersion(argv[0]);
- return 0;
+ return XMLWF_EXIT_SUCCESS;
+ case T('g'): {
+ const XML_Char *valueText = NULL;
+ XMLWF_SHIFT_ARG_INTO(valueText, argc, argv, i, j);
+
+ errno = 0;
+ XML_Char *afterValueText = (XML_Char *)valueText;
+ const long long read_size_bytes_candidate
+ = tcstoull(valueText, &afterValueText, 10);
+ if ((errno != 0) || (afterValueText[0] != T('\0'))
+ || (read_size_bytes_candidate < 1)
+ || (read_size_bytes_candidate > (INT_MAX / 2 + 1))) {
+ // This prevents tperror(..) from reporting misleading "[..]: Success"
+ errno = ERANGE;
+ tperror(T("invalid buffer size") T(
+ " (needs an integer from 1 to INT_MAX/2+1 i.e. 1,073,741,824 on most platforms)"));
+ exit(XMLWF_EXIT_USAGE_ERROR);
+ }
+ g_read_size_bytes = (int)read_size_bytes_candidate;
+ break;
+ }
+ case T('k'):
+ continueOnError = 1;
+ j++;
+ break;
+ case T('a'): {
+ const XML_Char *valueText = NULL;
+ XMLWF_SHIFT_ARG_INTO(valueText, argc, argv, i, j);
+
+ errno = 0;
+ XML_Char *afterValueText = NULL;
+ attackMaximumAmplification = tcstof(valueText, &afterValueText);
+ if ((errno != 0) || (afterValueText[0] != T('\0'))
+ || isnan(attackMaximumAmplification)
+ || (attackMaximumAmplification < 1.0f)) {
+ // This prevents tperror(..) from reporting misleading "[..]: Success"
+ errno = ERANGE;
+ tperror(T("invalid amplification limit") T(
+ " (needs a floating point number greater or equal than 1.0)"));
+ exit(XMLWF_EXIT_USAGE_ERROR);
+ }
+#if XML_GE == 0
+ ftprintf(stderr,
+ T("Warning: Given amplification limit ignored")
+ T(", xmlwf has been compiled without DTD/GE support.\n"));
+#endif
+ break;
+ }
+ case T('b'): {
+ const XML_Char *valueText = NULL;
+ XMLWF_SHIFT_ARG_INTO(valueText, argc, argv, i, j);
+
+ errno = 0;
+ XML_Char *afterValueText = (XML_Char *)valueText;
+ attackThresholdBytes = tcstoull(valueText, &afterValueText, 10);
+ if ((errno != 0) || (afterValueText[0] != T('\0'))) {
+ // This prevents tperror(..) from reporting misleading "[..]: Success"
+ errno = ERANGE;
+ tperror(T("invalid ignore threshold")
+ T(" (needs an integer from 0 to 2^64-1)"));
+ exit(XMLWF_EXIT_USAGE_ERROR);
+ }
+ attackThresholdGiven = XML_TRUE;
+#if XML_GE == 0
+ ftprintf(stderr,
+ T("Warning: Given attack threshold ignored")
+ T(", xmlwf has been compiled without DTD/GE support.\n"));
+#endif
+ break;
+ }
+ case T('q'): {
+ disableDeferral = XML_TRUE;
+ j++;
+ break;
+ }
case T('\0'):
if (j > 1) {
i++;
@@ -998,7 +1144,8 @@ tmain(int argc, XML_Char **argv) {
}
/* fall through */
default:
- usage(argv[0], 2);
+ usage(argv[0], XMLWF_EXIT_USAGE_ERROR);
+ // usage called exit(..), never gets here
}
}
if (i == argc) {
@@ -1017,7 +1164,32 @@ tmain(int argc, XML_Char **argv) {
if (! parser) {
tperror(T("Could not instantiate parser"));
- exit(1);
+ exit(XMLWF_EXIT_INTERNAL_ERROR);
+ }
+
+ if (attackMaximumAmplification != -1.0f) {
+#if XML_GE == 1
+ XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+ parser, attackMaximumAmplification);
+#endif
+ }
+ if (attackThresholdGiven) {
+#if XML_GE == 1
+ XML_SetBillionLaughsAttackProtectionActivationThreshold(
+ parser, attackThresholdBytes);
+#else
+ (void)attackThresholdBytes; // silence -Wunused-but-set-variable
+#endif
+ }
+
+ if (disableDeferral) {
+ const XML_Bool success = XML_SetReparseDeferralEnabled(parser, XML_FALSE);
+ if (! success) {
+ // This prevents tperror(..) from reporting misleading "[..]: Success"
+ errno = EINVAL;
+ tperror(T("Failed to disable reparse deferral"));
+ exit(XMLWF_EXIT_INTERNAL_ERROR);
+ }
}
if (requireStandalone)
@@ -1053,7 +1225,7 @@ tmain(int argc, XML_Char **argv) {
* sizeof(XML_Char));
if (! outName) {
tperror(T("Could not allocate memory"));
- exit(1);
+ exit(XMLWF_EXIT_INTERNAL_ERROR);
}
tcscpy(outName, outputDir);
tcscat(outName, delim);
@@ -1061,7 +1233,14 @@ tmain(int argc, XML_Char **argv) {
userData.fp = tfopen(outName, T("wb"));
if (! userData.fp) {
tperror(outName);
- exit(3);
+ exitCode = XMLWF_EXIT_OUTPUT_ERROR;
+ free(outName);
+ XML_ParserFree(parser);
+ if (continueOnError) {
+ continue;
+ } else {
+ break;
+ }
}
setvbuf(userData.fp, NULL, _IOFBF, 16384);
#ifdef XML_UNICODE
@@ -1123,8 +1302,12 @@ tmain(int argc, XML_Char **argv) {
}
XML_ParserFree(parser);
if (! result) {
- exit(2);
+ exitCode = XMLWF_EXIT_NOT_WELLFORMED;
+ cleanupUserData(&userData);
+ if (! continueOnError) {
+ break;
+ }
}
}
- return 0;
+ return exitCode;
}
diff --git a/3rdparty/expat/xmlwf/xmlwf_helpgen.py b/3rdparty/expat/xmlwf/xmlwf_helpgen.py
index 939286e5c2c..3d32f5d148b 100755
--- a/3rdparty/expat/xmlwf/xmlwf_helpgen.py
+++ b/3rdparty/expat/xmlwf/xmlwf_helpgen.py
@@ -6,7 +6,8 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2019 Expat development team
+# Copyright (c) 2019-2023 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2021 Tim Bray <tbray@textuality.com>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -31,11 +32,25 @@
import argparse
epilog = """
+exit status:
+ 0 the input files are well-formed and the output (if requested) was written successfully
+ 1 could not allocate data structures, signals a serious problem with execution environment
+ 2 one or more input files were not well-formed
+ 3 could not create an output file
+ 4 command-line argument error
+
xmlwf of libexpat is software libre, licensed under the MIT license.
-Please report bugs at https://github.com/libexpat/libexpat/issues. Thank you!
+Please report bugs at https://github.com/libexpat/libexpat/issues -- thank you!
+"""
+
+usage = """
+ %(prog)s [OPTIONS] [FILE ...]
+ %(prog)s -h|--help
+ %(prog)s -v|--version
"""
parser = argparse.ArgumentParser(prog='xmlwf', add_help=False,
+ usage=usage,
description='xmlwf - Determines if an XML document is well-formed',
formatter_class=argparse.RawTextHelpFormatter,
epilog=epilog)
@@ -43,11 +58,13 @@ parser = argparse.ArgumentParser(prog='xmlwf', add_help=False,
input_related = parser.add_argument_group('input control arguments')
input_related.add_argument('-s', action='store_true', help='print an error if the document is not [s]tandalone')
input_related.add_argument('-n', action='store_true', help='enable [n]amespace processing')
-input_related.add_argument('-p', action='store_true', help='enable processing external DTDs and [p]arameter entities')
+input_related.add_argument('-p', action='store_true', help='enable processing of external DTDs and [p]arameter entities')
input_related.add_argument('-x', action='store_true', help='enable processing of e[x]ternal entities')
input_related.add_argument('-e', action='store', metavar='ENCODING', help='override any in-document [e]ncoding declaration')
input_related.add_argument('-w', action='store_true', help='enable support for [W]indows code pages')
-input_related.add_argument('-r', action='store_true', help='disable memory-mapping and use normal file [r]ead IO calls instead')
+input_related.add_argument('-r', action='store_true', help='disable memory-mapping and use [r]ead calls instead')
+input_related.add_argument('-g', metavar='BYTES', help='buffer size to request per call pair to XML_[G]etBuffer and read (default: 8 KiB)')
+input_related.add_argument('-k', action='store_true', help='when processing multiple files, [k]eep processing after first file with error')
output_related = parser.add_argument_group('output control arguments')
output_related.add_argument('-d', action='store', metavar='DIRECTORY', help='output [d]estination directory')
@@ -57,12 +74,24 @@ output_mode.add_argument('-m', action='store_true', help='write [m]eta XML, not
output_mode.add_argument('-t', action='store_true', help='write no XML output for [t]iming of plain parsing')
output_related.add_argument('-N', action='store_true', help='enable adding doctype and [n]otation declarations')
+billion_laughs = parser.add_argument_group('billion laughs attack protection',
+ description='NOTE: '
+ 'If you ever need to increase these values '
+ 'for non-attack payload, please file a bug report.')
+billion_laughs.add_argument('-a', metavar='FACTOR',
+ help='set maximum tolerated [a]mplification factor (default: 100.0)')
+billion_laughs.add_argument('-b', metavar='BYTES', help='set number of output [b]ytes needed to activate (default: 8 MiB)')
+
+reparse_deferral = parser.add_argument_group('reparse deferral')
+reparse_deferral.add_argument('-q', metavar='FACTOR',
+ help='disable reparse deferral, and allow [q]uadratic parse runtime with large tokens')
+
parser.add_argument('files', metavar='FILE', nargs='*', help='file to process (default: STDIN)')
info = parser.add_argument_group('info arguments')
info = info.add_mutually_exclusive_group()
-info.add_argument('-h', action='store_true', help='show this [h]elp message and exit')
-info.add_argument('-v', action='store_true', help='show program\'s [v]ersion number and exit')
+info.add_argument('-h', '--help', action='store_true', help='show this [h]elp message and exit')
+info.add_argument('-v', '--version', action='store_true', help='show program\'s [v]ersion number and exit')
if __name__ == '__main__':
diff --git a/3rdparty/expat/xmlwf/xmlwf_helpgen.sh b/3rdparty/expat/xmlwf/xmlwf_helpgen.sh
index 6b0fbf929a0..864e47086d1 100755
--- a/3rdparty/expat/xmlwf/xmlwf_helpgen.sh
+++ b/3rdparty/expat/xmlwf/xmlwf_helpgen.sh
@@ -6,7 +6,7 @@
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
-# Copyright (c) 2019 Expat development team
+# Copyright (c) 2019-2021 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -29,7 +29,8 @@
# USE OR OTHER DEALINGS IN THE SOFTWARE.
./xmlwf/xmlwf_helpgen.py | sed \
- -e 's,usage: xmlwf,usage: %s,' \
+ -e 's,usage: ,usage:,' \
+ -e 's, xmlwf, %s,' \
-e 's, \[-h | -v\],,' \
-e 's,^, T(",' \
-e 's,$,\\n"),'
diff --git a/3rdparty/genie/.travis.yml b/3rdparty/genie/.travis.yml
deleted file mode 100644
index 077f5882e3e..00000000000
--- a/3rdparty/genie/.travis.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-language: cpp
-matrix:
- include:
- - compiler: gcc
- os: linux
- - compiler: clang
- os: osx
-
-script:
- make
-
-branches:
- only:
- - master
-
-notifications:
- email: false
-
-osx_image:
- xcode61
diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md
index 526705e68d3..159ef98c931 100644
--- a/3rdparty/genie/README.md
+++ b/3rdparty/genie/README.md
@@ -1,6 +1,12 @@
+<p align="center">
+<img src="https://repository-images.githubusercontent.com/23779242/961ad700-8d21-11ea-85d3-1d64eccc4531" width="1280">
+</p>
+
[GENie](https://github.com/bkaradzic/genie#what-is-it) - Project generator tool
===============================================================================
+[![Build and Upload Artifact](https://github.com/bkaradzic/GENie/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/bkaradzic/GENie/actions/workflows/build.yml)
+
What is it?
-----------
@@ -9,19 +15,16 @@ generates project from Lua script, making applying the same settings for
multiple projects easy.
Supported project generators:
- * FASTBuild (experimental)
* GNU Makefile
+ * [JSON Compilation Database][jcdb]
* Ninja (experimental)
- * Qbs / QtCreator (experimental)
- * Visual Studio 2010, 2012, 2013, 2015, 2017, 2019
+ * Visual Studio 2010, 2012, 2013, 2015, 2017, 2019, 2022
* XCode
Download (stable)
-----------------
-[![Build Status](https://travis-ci.org/bkaradzic/GENie.svg?branch=master)](https://travis-ci.org/bkaradzic/GENie)
-
- version 1115 (commit cd9b1a624810b166d11788d01c2aa4daf2ea42e6)
+ version 1181 (commit 29e6832fdf3b106c0906d288c8ced6c0761b8985)
Linux:
https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie
@@ -43,7 +46,11 @@ Documentation
-------------
[Scripting Reference](https://github.com/bkaradzic/genie/blob/master/docs/scripting-reference.md#scripting-reference)
-[Introduction to GENie - CppCon 2016](https://onedrive.live.com/view.aspx?cid=171ee76e679935c8&page=view&resid=171EE76E679935C8!139573&parId=171EE76E679935C8!18835&authkey=!AKv_SGrgJwxDGDg&app=PowerPoint)
+
+Introduction to GENie - CppCon 2016
+<a href="http://www.youtube.com/watch?feature=player_embedded&v=_vArtdDTrTM"
+target="_blank"><img src="http://img.youtube.com/vi/_vArtdDTrTM/0.jpg"
+alt="Introduction to GENie - CppCon 2016" width="640" height="480" border="0" /></a>
History
-------
@@ -90,7 +97,7 @@ of Premake 4.4 beta 5, and there is no intention to keep it compatible with it.
- Added support for generating PS4/Orbis projects.
- Fixed PCH race when using concurrent Makefile build.
- Added Green Hills Software compiler support.
- - Added edit & continue support for 64-bit builds in VS2013 upwards.
+ - Added edit & continue support for 64-bit builds in vs2013 upwards.
- Added `windowstargetplatformversion` to specify VS Windows target version.
- Added `NoWinRT` flag to disable WinRT CX builds.
- Added `NoBufferSecurityCheck` flag to disable security checks in VS.
@@ -120,17 +127,23 @@ of Premake 4.4 beta 5, and there is no intention to keep it compatible with it.
- Added `iostargetplatformversion`, `macostargetplatformversion`, and
`tvostargetplatformversion` to specify XCode OS target version.
- Removed the `xcode3`, and `xcode4` actions.
- - Added the `xcode8`, `xcode9`, and `xcode10` actions.
+ - Added the `xcode8`, `xcode9`, `xcode10`, `xcode11` and `xcode14` actions.
- Added `systemincludedirs` that are always searched after directories added
using `includedirs`.
- Added `NoRuntimeChecks` flag to disable Basic Runtime Checks in non-optimized
Visual Studio builds.
- Added support for Nintendo Switch projects.
- - Added flags for selecting C++ standard: `Cpp11`, `Cpp14`, `Cpp17`,
+ - Added flags for selecting C++ standard: `Cpp11`, `Cpp14`, `Cpp17`, `Cpp20`
and `CppLatest`.
- Added `xcodeprojectopts` and `xcodetargetopts`.
- Added vs2019 support.
- - Added UnitySupport flag to enable Unity (Jumbo) builds in Visual Studio 2019
+ - Added `UnitySupport` flag to enable Unity (Jumbo) builds in vs2019
+ - Added the `jcdb` action for generating a [JSON compilation database][jcdb].
+ - Added support for generating Switch/NX32 Switch/NX64 projects.
+ - Removed FASTBuild.
+ - Removed Qbs support.
+ - Added vs2022 support.
+ - Added xcode15 action with visionOS support.
build - GENie build system scripts
----------------------------------
@@ -240,4 +253,5 @@ Developer Crackshell used GENie for development of games
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ [jcdb]: https://clang.llvm.org/docs/JSONCompilationDatabase.html
[zbs]: https://studio.zerobrane.com
diff --git a/3rdparty/genie/build/gmake.darwin/genie.make b/3rdparty/genie/build/gmake.darwin/genie.make
index 81e820505cb..80630e0ec26 100644
--- a/3rdparty/genie/build/gmake.darwin/genie.make
+++ b/3rdparty/genie/build/gmake.darwin/genie.make
@@ -1,4 +1,7 @@
# GNU Make project makefile autogenerated by GENie
+
+.SUFFIXES:
+
ifndef config
config=release
endif
diff --git a/3rdparty/genie/build/gmake.freebsd/genie.make b/3rdparty/genie/build/gmake.freebsd/genie.make
index 3ee72460742..ca03504cc93 100644
--- a/3rdparty/genie/build/gmake.freebsd/genie.make
+++ b/3rdparty/genie/build/gmake.freebsd/genie.make
@@ -1,4 +1,7 @@
# GNU Make project makefile autogenerated by GENie
+
+.SUFFIXES:
+
ifndef config
config=release
endif
@@ -49,17 +52,21 @@ ifeq ($(config),release)
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I"../../src/host/lua-5.3.0/src"
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM)
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic
+ ALL_LDFLAGS += $(LDFLAGS) -L"." -s -rdynamic
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -lm
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -132,17 +139,21 @@ ifeq ($(config),debug)
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I"../../src/host/lua-5.3.0/src"
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic
+ ALL_LDFLAGS += $(LDFLAGS) -L"." -rdynamic
+ LIBDEPS +=
LDDEPS +=
+ LDRESP =
LIBS += $(LDDEPS) -lm
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKOBJS = $(OBJECTS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -220,7 +231,7 @@ RESOURCES := \
all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)
@:
-$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(EXTERNAL_LIBS) $(RESOURCES) | $(TARGETDIR) $(OBJDIRS)
+$(TARGET): $(GCH) $(OBJECTS) $(LIBDEPS) $(EXTERNAL_LIBS) $(RESOURCES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)
@echo Linking genie
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)
@@ -259,223 +270,235 @@ $(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)
$(SILENT) $(CC) $(ALL_OBJCFLAGS) -x objective-c-header $(DEFINES) $(INCLUDES) -o "$@" -c "$<"
endif
-$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE)
+ifneq (,$(OBJRESP))
+$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)
+ $(SILENT) echo $^
+ $(SILENT) echo $^ > $@
+endif
+
+ifneq (,$(LDRESP))
+$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)
+ $(SILENT) echo $^
+ $(SILENT) echo $^ > $@
+endif
+
+$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
-$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE)
+$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"
diff --git a/3rdparty/genie/build/gmake.linux/genie.make b/3rdparty/genie/build/gmake.linux/genie.make
index af00e6f90f7..e41a020ce9f 100644
--- a/3rdparty/genie/build/gmake.linux/genie.make
+++ b/3rdparty/genie/build/gmake.linux/genie.make
@@ -1,4 +1,7 @@
# GNU Make project makefile autogenerated by GENie
+
+.SUFFIXES:
+
ifndef config
config=release
endif
diff --git a/3rdparty/genie/build/gmake.solaris/Makefile b/3rdparty/genie/build/gmake.solaris/Makefile
deleted file mode 100644
index be9880cf2a3..00000000000
--- a/3rdparty/genie/build/gmake.solaris/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-# GNU Make solution makefile autogenerated by GENie
-# Type "make help" for usage help
-
-ifndef config
- config=release
-endif
-export config
-
-PROJECTS := genie
-
-.PHONY: all clean help $(PROJECTS)
-
-all: $(PROJECTS)
-
-genie:
- @echo "==== Building genie ($(config)) ===="
- @${MAKE} --no-print-directory -C . -f genie.make
-
-clean:
- @${MAKE} --no-print-directory -C . -f genie.make clean
-
-help:
- @echo "Usage: make [config=name] [target]"
- @echo ""
- @echo "CONFIGURATIONS:"
- @echo " release"
- @echo " debug"
- @echo ""
- @echo "TARGETS:"
- @echo " all (default)"
- @echo " clean"
- @echo " genie"
- @echo ""
- @echo "For more information, see https://github.com/bkaradzic/genie"
diff --git a/3rdparty/genie/build/gmake.solaris/genie.make b/3rdparty/genie/build/gmake.solaris/genie.make
deleted file mode 100644
index 56ce127f9d9..00000000000
--- a/3rdparty/genie/build/gmake.solaris/genie.make
+++ /dev/null
@@ -1,470 +0,0 @@
-# GNU Make project makefile autogenerated by GENie
-ifndef config
- config=release
-endif
-
-ifndef verbose
- SILENT = @
-endif
-
-SHELLTYPE := msdos
-ifeq (,$(ComSpec)$(COMSPEC))
- SHELLTYPE := posix
-endif
-ifeq (/bin,$(findstring /bin,$(SHELL)))
- SHELLTYPE := posix
-endif
-
-ifeq (posix,$(SHELLTYPE))
- MKDIR = $(SILENT) mkdir -p "$(1)"
- COPY = $(SILENT) cp -fR "$(1)" "$(2)"
- RM= $(SILENT) rm -f "$(1)"
-else
- MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0
- COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))"
- RM = $(SILENT) del /F "$(subst /,\\,$(1))" 2> nul || exit 0
-endif
-
-CC = gcc
-CXX = g++
-AR = ar
-
-ifndef RESCOMP
- ifdef WINDRES
- RESCOMP = $(WINDRES)
- else
- RESCOMP = windres
- endif
-endif
-
-ifeq ($(config),release)
- OBJDIR = obj/Release
- TARGETDIR = ../../bin/solaris
- override TARGET = $(TARGETDIR)/genie
- DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -D_REENTRANT -DLUA_USE_POSIX -DLUA_USE_DLOPEN
- INCLUDES += -I../../src/host/lua-5.3.0/src
- ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -std=gnu99
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -std=gnu99
- ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -std=gnu99
- ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic
- LDDEPS +=
- LIBS += $(LDDEPS) -ldl -lm
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
- OBJECTS := \
- $(OBJDIR)/src/host/os_chdir.o \
- $(OBJDIR)/src/host/os_copyfile.o \
- $(OBJDIR)/src/host/os_getcwd.o \
- $(OBJDIR)/src/host/os_is64bit.o \
- $(OBJDIR)/src/host/os_isdir.o \
- $(OBJDIR)/src/host/os_isfile.o \
- $(OBJDIR)/src/host/os_match.o \
- $(OBJDIR)/src/host/os_mkdir.o \
- $(OBJDIR)/src/host/os_pathsearch.o \
- $(OBJDIR)/src/host/os_rmdir.o \
- $(OBJDIR)/src/host/os_stat.o \
- $(OBJDIR)/src/host/os_ticks.o \
- $(OBJDIR)/src/host/os_uuid.o \
- $(OBJDIR)/src/host/path_getabsolute.o \
- $(OBJDIR)/src/host/path_getrelative.o \
- $(OBJDIR)/src/host/path_helpers.o \
- $(OBJDIR)/src/host/path_isabsolute.o \
- $(OBJDIR)/src/host/premake.o \
- $(OBJDIR)/src/host/premake_main.o \
- $(OBJDIR)/src/host/scripts.o \
- $(OBJDIR)/src/host/string_endswith.o \
- $(OBJDIR)/src/host/string_hash.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \
-
- define PREBUILDCMDS
- endef
- define PRELINKCMDS
- endef
- define POSTBUILDCMDS
- endef
-endif
-
-ifeq ($(config),debug)
- OBJDIR = obj/Debug
- TARGETDIR = ../../bin/solaris
- override TARGET = $(TARGETDIR)/genie
- DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -D_REENTRANT -DLUA_USE_POSIX -DLUA_USE_DLOPEN
- INCLUDES += -I../../src/host/lua-5.3.0/src
- ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -std=gnu99
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -std=gnu99
- ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -std=gnu99
- ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
- ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic
- LDDEPS +=
- LIBS += $(LDDEPS) -ldl -lm
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
- OBJECTS := \
- $(OBJDIR)/src/host/os_chdir.o \
- $(OBJDIR)/src/host/os_copyfile.o \
- $(OBJDIR)/src/host/os_getcwd.o \
- $(OBJDIR)/src/host/os_is64bit.o \
- $(OBJDIR)/src/host/os_isdir.o \
- $(OBJDIR)/src/host/os_isfile.o \
- $(OBJDIR)/src/host/os_match.o \
- $(OBJDIR)/src/host/os_mkdir.o \
- $(OBJDIR)/src/host/os_pathsearch.o \
- $(OBJDIR)/src/host/os_rmdir.o \
- $(OBJDIR)/src/host/os_stat.o \
- $(OBJDIR)/src/host/os_ticks.o \
- $(OBJDIR)/src/host/os_uuid.o \
- $(OBJDIR)/src/host/path_getabsolute.o \
- $(OBJDIR)/src/host/path_getrelative.o \
- $(OBJDIR)/src/host/path_helpers.o \
- $(OBJDIR)/src/host/path_isabsolute.o \
- $(OBJDIR)/src/host/premake.o \
- $(OBJDIR)/src/host/premake_main.o \
- $(OBJDIR)/src/host/scripts.o \
- $(OBJDIR)/src/host/string_endswith.o \
- $(OBJDIR)/src/host/string_hash.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \
- $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \
-
- define PREBUILDCMDS
- endef
- define PRELINKCMDS
- endef
- define POSTBUILDCMDS
- endef
-endif
-
-OBJDIRS := \
- $(OBJDIR) \
- $(OBJDIR)/src/host \
- $(OBJDIR)/src/host/lua-5.3.0/src \
-
-RESOURCES := \
-
-.PHONY: clean prebuild prelink
-
-all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET)
- @:
-
-$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)
- @echo Linking genie
- $(SILENT) $(LINKCMD)
- $(POSTBUILDCMDS)
-
-$(TARGETDIR):
- @echo Creating $(TARGETDIR)
- -$(call MKDIR,$(TARGETDIR))
-
-$(OBJDIRS):
- @echo Creating $(@)
- -$(call MKDIR,$@)
-
-clean:
- @echo Cleaning genie
-ifeq (posix,$(SHELLTYPE))
- $(SILENT) rm -f $(TARGET)
- $(SILENT) rm -rf $(OBJDIR)
-else
- $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
- $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
-endif
-
-prebuild:
- $(PREBUILDCMDS)
-
-prelink:
- $(PRELINKCMDS)
-
-ifneq (,$(PCH))
-$(GCH): $(PCH)
- @echo $(notdir $<)
- $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
-endif
-
-$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
-$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c
- @echo $(notdir $<)
- $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
-
--include $(OBJECTS:%.o=%.d)
-ifneq (,$(PCH))
- -include $(OBJDIR)/$(notdir $(PCH)).d
-endif
diff --git a/3rdparty/genie/build/gmake.windows/genie.make b/3rdparty/genie/build/gmake.windows/genie.make
index f3808bfd730..531b94d8567 100644
--- a/3rdparty/genie/build/gmake.windows/genie.make
+++ b/3rdparty/genie/build/gmake.windows/genie.make
@@ -1,4 +1,7 @@
# GNU Make project makefile autogenerated by GENie
+
+.SUFFIXES:
+
ifndef config
config=release
endif
diff --git a/3rdparty/genie/docs/scripting-reference.md b/3rdparty/genie/docs/scripting-reference.md
index 35b1217e879..7f1b91e512f 100644
--- a/3rdparty/genie/docs/scripting-reference.md
+++ b/3rdparty/genie/docs/scripting-reference.md
@@ -341,6 +341,19 @@ configuration "not windows"
defines { "NOT_WINDOWS" }
```
+Define a symbol based on custom command line option
+
+```lua
+newoption {
+ trigger = "gfxapi",
+ description = "Choose a particular 3D API for rendering",
+ allowed = { { "opengl", "OpenGL Renderer" } }
+}
+
+configuration "opengl"
+ defines { "OPENGL" }
+```
+
Reset the configuration filter
```lua
@@ -349,7 +362,7 @@ configuration {}
#### Caveats
-- Argument chaining:
+- Argument chaining:
`configuration` can take multiple arguments, e.g.,
```lua
configuration {"StaticLib", "xcode*", "osx or ios*"}
@@ -357,29 +370,29 @@ configuration {}
These arguments will be combined as an `AND` clause,
i.e. if one of the keywords does _not_ match the actual configuration terms,
the following settings will not be applied.
-
-- Condition evaluation:
+
+- Condition evaluation:
The arguments are **not** evaluated as Lua. They are merely regex-matched against the configuration terms.
The implications of this are that parentheses have no effect outside of regular expression groups.
A condition like `"not (osx or ios*)"` will not be equivalent to `{"not osx", "not ios*}"`.
Furthermore, a condition like `"not osx or ios*"` will be evaluated as the negation of `"osx or ios*"`.
-
-- `and` is **not** a valid keyword for configuration combinations.
+
+- `and` is **not** a valid keyword for configuration combinations.
However, several keywords will be combined as an `AND` clause.
-
-- Limits of Lua's regular expressions:
+
+- Limits of Lua's regular expressions:
Each passed keyword is matched against each configuration terms from the project/solution type being built
using [Lua's regular expression mechanism](https://www.lua.org/manual/5.3/manual.html#6.4).
This means that keyword matching is subject to the same limits as regular Lua regex matching.
This implies that regexes like `"(osx|ios)"` do not work.
-
-- Wildcard expansion:
+
+- Wildcard expansion:
Wildcards will get expanded following the same rules as paths.
Similarly, special characters such as `()` will get escaped (i.e. converted to `%(%)`) before being matched.
This means that `"not (osx or ios*)"` will in fact get expanded to `"not %(osx or ios[^/]*)"` and then checked as
`not` _result of_ `"%(osx or ios[^/]*)"`, which in turn gets broken down to `"%(osx"` and `"ios[^/]*)"`.
-
-- `"win*"` matchings:
+
+- `"win*"` matchings:
Intuitively, the configuration keyword to match "Windows" ("Win32", "Win64" or "WinCE") configuration would be
`"win*"`. However **`"win*"` also matches "WindowedApp"**. Prefer using the term `"vs*"` to check for configurations
targeting Windows.
@@ -428,10 +441,10 @@ for rule listed commands are executed.
**Scope:** solutions, projects, configurations
#### Arguments
-*input_file* - source file that should be "compiled" with custom task
-*output_file* - generated file name
-*dependency* - additional dependencies, that can be used as parameters to commands
-*command* - command list, special functions in commands are :
+*input_file* - source file that should be "compiled" with custom task
+*output_file* - generated file name
+*dependency* - additional dependencies, that can be used as parameters to commands
+*command* - command list, special functions in commands are :
$(<) - input file
$(@) - output file
$(1) - $(9) - additional dependencies
@@ -537,7 +550,7 @@ GMAKE specific. Adds dependency between source file and any other file.
**Scope:** solutions, projects, configurations
#### Arguments
-*main_file* - name of source file that depends of other file
+*main_file* - name of source file that depends of other file
*depending_of* - name of dependency file
#### Examples
@@ -630,7 +643,16 @@ Specifies build flags to modify the compiling or linking process. Multiple calls
#### Arguments
_flags_ - List of flag names from list below. Names are case-insensitive and ignored if not supported on a platform.
+* _AntBuildDebuggable_ - Enables Visual Studio projects targetting Android to be debugged using the NVIDIA Nsight Tegra tools. ([#321](https://github.com/bkaradzic/GENie/pull/321))
* _C7DebugInfo_ - Enables C7 compatible debug info for MSVC builds.
+* _Cpp11_ - Enable usage of C++11 features.
+* _Cpp14_ - Enable usage of C++14 features.
+* _Cpp17_ - Enable usage of C++17 features.
+* _Cpp20_ - Enable usage of C++20 features.
+* _CppLatest_ - Enable usage of latest C++ features.
+* _DebugEnvsDontMerge_ - Cause Visual Studio projects to not merge debug environment with the one inherited from the parent process. (i.e. sets `Project Properties > Debugging > Merge Environment` to `false`)
+* _DebugEnvsInherit_ - Cause Visual Studio projects to inherit debug environment. (i.e. sets in `Project Properties > Debugging > Environment > Edit > Inherit from parent of project defaults` to `true`)
+* _DeploymentContent_ - Mark files with `DeploymentContent` flag in the project file. (For C++ Win Store apps) ([#139](https://github.com/bkaradzic/GENie/pull/139))
* _EnableMinimalRebuild_ - Enable Visual Studio's minimal rebuild feature.
* _EnableSSE, EnableSSE2, EnableAVX, EnableAVX2_ - Enable SSE/AVX instruction sets
* _ExtraWarnings_ - Sets compiler's max warning level.
@@ -641,7 +663,6 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign
* _GenerateMapFiles_ - Enable .map file outputs from the Visual Studio linker.
* _LinkSupportCircularDependencies_ - Enables the linker to iterate over provided libs in order to resolve circular dependencies (make and ninja only).
* _Managed_ - Enable Managed C++ (.NET).
-* _MFC_ - Enable support for Microsoft Foundation Classes.
* _MinimumWarnings_ - - Sets compiler's minimum warning level (Visual Studio only).
* _NativeWChar, NoNativeWChar_ - Toggle support for the wchar data type.
* _No64BitChecks_ - Disable 64-bit portability warnings.
@@ -651,6 +672,7 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign
* _NoFramePointer_ - Disable the generation of stack frame pointers.
* _NoImportLib_ - Prevent the generation of an import library for a Windows DLL.
* _NoIncrementalLink_ - Disable support for Visual Studio's incremental linking feature.
+* _NoJMC_ - Disable Visual Studio's 'Just my Code' feature.
* _NoManifest_ - Prevent the generation of a manifest for Windows executables and shared libraries.
* _NoMultiProcessorCompilation_ - Disables Visual Studio's and FastBuild's multiprocessor compilation.
* _NoPCH_ - Disable precompiled headers.
@@ -671,8 +693,8 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign
* _Unsafe_ - Enable the use of unsafe code in .NET applications.
* _UnsignedChar_ - Force `char`s to be `unsigned` by default.
* _UseFullPaths_ - Enable absolute paths for `__FILE__`.
-* _UseLDResponseFile_ - Enable use of response file (aka @file) for linking lib dependencies (make only).
-* _UseObjectResponseFile_ - Enable use of response file (aka @file) for linking objects (make only).
+* _UseLDResponseFile_ - Enable use of response file (aka @file) for linking lib dependencies (make and ninja).
+* _UseObjectResponseFile_ - Enable use of response file (aka @file) for linking objects (make and ninja).
* _WinMain_ - Use WinMain() as the entry point for Windows applications, rather than main().
**Note:** When not set, options will default to the tool default.
@@ -903,7 +925,7 @@ Sets the kind of binary object being created by the project, such as a console o
_kind_ - project kind identifier. One of:
* _ConsoleApp_ - console executable
-* _WindowedApp_ - application that runs in a desktop window. Does not apply on Linux.
+* _WindowedApp_ - application that runs in a window (Windows, Android, MacOS and iOS). Does not apply on Linux.
* _StaticLib_ - static library
* _SharedLib_ - shared library or DLL
* _Bundle_ - Xcode: Cocoa Bundle, everywhere else: alias to _SharedLib_
@@ -1287,8 +1309,11 @@ _identifiers_ - list of hardware platform specifiers from this list:
* _Xbox360_ - Xbox 360 compiler and linker under Visual Studio
* _PowerPC_ - PowerPC processors
* _ARM_ - ARM-based processors
+* _ARM64_ - ARM64-based processors
* _Orbis_ - Playstation 4
* _Durango_ - Xbox One
+* _NX32_ - Nintendo Switch 32-bit
+* _NX64_ - Nintendo Switch 64-bit
#### Return Value
Current list of target platforms for the active solution
@@ -1899,11 +1924,11 @@ xcodetargetopts {
---
### xcodescriptphases({{_cmd_, {_inputpaths_, ...}}})
#### XCode only
-Adds a script phase to the generated XCode project file.
+Adds a script phase to the generated XCode project file.
One tag can contain several commands with different inputpaths.
#### Arguments
-_cmd_ - The actual command to run. (This can be a shell script file or direct shell code).
+_cmd_ - The actual command to run. (This can be a shell script file or direct shell code).
_inputpaths_ - The paths passed to the command
#### Examples
@@ -1948,11 +1973,11 @@ done
---
### xcodecopyresources({{_targetpath_, {_inputfiles_, ...}}})
#### XCode only
-Adds a 'Copy Files' phase to the generated XCode project file.
+Adds a 'Copy Files' phase to the generated XCode project file.
One tag can contain several target paths with different input files.
#### Arguments
-_targetpath_ - The target path relative to the _Resource_ folder in the resulting `.app` structure.
+_targetpath_ - The target path relative to the _Resource_ folder in the resulting `.app` structure.
_inputfiles_ - The input files to be copied.
#### Examples
diff --git a/3rdparty/genie/makefile b/3rdparty/genie/makefile
index 48f6fb84122..9df2558f272 100644
--- a/3rdparty/genie/makefile
+++ b/3rdparty/genie/makefile
@@ -54,7 +54,7 @@ release-windows release-darwin: $(GENIE)
release-linux: $(GENIE)
$(SILENT) $(GENIE) release
- $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).darwin clean all CC=x86_64-apple-darwin15-clang
+ $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).darwin clean all CC=x86_64-apple-darwin20.2-clang
$(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).linux clean all
$(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).windows clean all CC=x86_64-w64-mingw32-gcc
$(SILENT) git checkout src/host/version.h
diff --git a/3rdparty/genie/scripts/genie.lua b/3rdparty/genie/scripts/genie.lua
index de537253079..291dd526bac 100644
--- a/3rdparty/genie/scripts/genie.lua
+++ b/3rdparty/genie/scripts/genie.lua
@@ -78,7 +78,7 @@
linkoptions { "-rdynamic" }
configuration "linux"
- define { "_FILE_OFFSET_BITS=64" }
+ defines { "_FILE_OFFSET_BITS=64" }
configuration "macosx"
targetdir "../bin/darwin"
diff --git a/3rdparty/genie/src/_manifest.lua b/3rdparty/genie/src/_manifest.lua
index 5d4a1ba5f41..b247364452c 100644
--- a/3rdparty/genie/src/_manifest.lua
+++ b/3rdparty/genie/src/_manifest.lua
@@ -65,7 +65,7 @@
"actions/vstudio/vs2015.lua",
"actions/vstudio/vs2017.lua",
"actions/vstudio/vs2019.lua",
- "actions/vstudio/vsllvm.lua",
+ "actions/vstudio/vs2022.lua",
-- Xcode action
"actions/xcode/_xcode.lua",
@@ -76,11 +76,9 @@
"actions/xcode/xcode8.lua",
"actions/xcode/xcode9.lua",
"actions/xcode/xcode10.lua",
-
- --FASTBuild action
- "actions/fastbuild/_fastbuild.lua",
- "actions/fastbuild/fastbuild_project.lua",
- "actions/fastbuild/fastbuild_solution.lua",
+ "actions/xcode/xcode11.lua",
+ "actions/xcode/xcode14.lua",
+ "actions/xcode/xcode15.lua",
-- ninja action
"actions/ninja/_ninja.lua",
@@ -90,9 +88,7 @@
"actions/ninja/ninja_swift.lua",
"actions/ninja/ninja_swift_incremental.lua",
- -- qbs action
- "actions/qbs/_qbs.lua",
- "actions/qbs/qbs_base.lua",
- "actions/qbs/qbs_solution.lua",
- "actions/qbs/qbs_cpp.lua",
+ -- jcdb action
+ "actions/jcdb/_jcdb.lua",
+ "actions/jcdb/jcdb_solution.lua",
}
diff --git a/3rdparty/genie/src/actions/cmake/cmake_project.lua b/3rdparty/genie/src/actions/cmake/cmake_project.lua
index e40486bfea9..33aa3ba916f 100644
--- a/3rdparty/genie/src/actions/cmake/cmake_project.lua
+++ b/3rdparty/genie/src/actions/cmake/cmake_project.lua
@@ -41,6 +41,14 @@ function cmake.list(value)
end
end
+function cmake.listWrapped(value, prefix, postfix)
+ if #value > 0 then
+ return prefix .. table.concat(value, postfix .. prefix) .. postfix
+ else
+ return ""
+ end
+end
+
function cmake.files(prj)
local ret = {}
local tr = premake.project.buildsourcetree(prj)
@@ -63,9 +71,15 @@ end
function cmake.header(prj)
_p('# %s project autogenerated by GENie', premake.action.current().shortname)
- _p('cmake_minimum_required(VERSION 2.8.4)')
+ _p('cmake_minimum_required(VERSION 3.15)')
+ if os.is("windows") then
+ -- Add support for CMP0091, see https://cmake.org/cmake/help/latest/policy/CMP0091.html
+ _p('cmake_policy(SET CMP0091 NEW)')
+ end
_p('')
_p('project(%s)', premake.esc(prj.name))
+ _p('')
+ _p('include(GNUInstallDirs)')
end
function cmake.customtasks(prj)
@@ -218,6 +232,7 @@ function cmake.project(prj)
local commonIncludes = cmake.commonRules(configurations, includestr)
local commonDefines = cmake.commonRules(configurations, definestr)
+
_p('')
for _, cfg in ipairs(configurations) do
@@ -258,14 +273,24 @@ function cmake.project(prj)
if (prj.kind == 'StaticLib') then
_p(1, 'add_library(%s STATIC ${source_list})', premake.esc(cfg.buildtarget.basename))
+ -- Install
+ _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})', premake.esc(cfg.buildtarget.basename))
end
if (prj.kind == 'SharedLib') then
_p(1, 'add_library(%s SHARED ${source_list})', premake.esc(cfg.buildtarget.basename))
+ -- Install
+ _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})', premake.esc(cfg.buildtarget.basename))
end
if (prj.kind == 'ConsoleApp' or prj.kind == 'WindowedApp') then
_p(1, 'add_executable(%s ${source_list})', premake.esc(cfg.buildtarget.basename))
- _p(1, 'target_link_libraries(%s%s%s)', premake.esc(cfg.buildtarget.basename), cmake.list(premake.esc(premake.getlinks(cfg, "siblings", "basename"))), cmake.list(cc.getlinkflags(cfg)))
+
+ local libdirs = cmake.listWrapped(premake.esc(premake.getlinks(cfg, "all", "directory")), " -L\"../", "\"")
+
+ _p(1, 'target_link_libraries(%s%s%s%s%s%s)', premake.esc(cfg.buildtarget.basename), libdirs, cmake.list(cfg.linkoptions), cmake.list(cc.getldflags(cfg)), cmake.list(premake.esc(premake.getlinks(cfg, "siblings", "basename"))), cmake.list(cc.getlinkflags(cfg)))
+
+ -- Install
+ _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})', premake.esc(cfg.buildtarget.basename))
end
_p('endif()')
_p('')
diff --git a/3rdparty/genie/src/actions/cmake/cmake_workspace.lua b/3rdparty/genie/src/actions/cmake/cmake_workspace.lua
index b948f9194e5..ed3c882746f 100644
--- a/3rdparty/genie/src/actions/cmake/cmake_workspace.lua
+++ b/3rdparty/genie/src/actions/cmake/cmake_workspace.lua
@@ -11,15 +11,43 @@ function premake.cmake.workspace(sln)
if (not f) then
error(err, 0)
end
- f:write('# CMakeLists autogenerated by GENie\n')
- f:write('cmake_minimum_required(VERSION 2.8.4)\n')
- f:write('\n')
+ f:write([[
+ # CMakeLists autogenerated by GENie
+ project(GENie)
+ cmake_minimum_required(VERSION 3.15)
+
+ #########################################################################
+
+ # Set a default build type if none was specified
+ # Source: https://blog.kitware.com/cmake-and-the-default-build-type/
+ set(default_build_type "Release")
+ if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
+ set(default_build_type "Debug")
+ endif()
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
+ set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
+ # Set the possible values of build type for cmake-gui
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+ endif()
+
+ #########################################################################
+ ]])
+ if os.is("windows") then
+ -- Add support for CMP0091, see https://cmake.org/cmake/help/latest/policy/CMP0091.html
+ f:write('cmake_policy(SET CMP0091 NEW)\n')
+ end
f:write('add_subdirectory('.. path.getrelative(_WORKING_DIR, sln.location) ..')\n')
f:close()
end
- _p('# CMakeLists autogenerated by GENie')
- _p('cmake_minimum_required(VERSION 2.8.4)')
- _p('')
+ _p([[
+ # CMakeLists autogenerated by GENie
+ cmake_minimum_required(VERSION 3.15)
+ ]])
+ if os.is("windows") then
+ -- Add support for CMP0091, see https://cmake.org/cmake/help/latest/policy/CMP0091.html
+ _p('cmake_policy(SET CMP0091 NEW)')
+ end
for i,prj in ipairs(sln.projects) do
local name = premake.esc(prj.name)
_p('add_subdirectory(%s)', name)
diff --git a/3rdparty/genie/src/actions/fastbuild/_fastbuild.lua b/3rdparty/genie/src/actions/fastbuild/_fastbuild.lua
deleted file mode 100644
index 5a422ac9db4..00000000000
--- a/3rdparty/genie/src/actions/fastbuild/_fastbuild.lua
+++ /dev/null
@@ -1,44 +0,0 @@
- premake.fastbuild = { }
- local fastbuild = premake.fastbuild
-
- newaction
- {
- trigger = "vs2015-fastbuild",
- shortname = "FASTBuild VS2015",
- description = "Generate FASTBuild configuration files for Visual Studio 2015.",
-
- valid_kinds = {
- "ConsoleApp",
- "WindowedApp",
- "StaticLib",
- "SharedLib",
- "Bundle",
- },
-
- valid_languages = {
- "C",
- "C++"
- },
-
- valid_tools = {
- cc = {
- "msc"
- },
- },
-
- onsolution = function(sln)
- premake.generate(sln, "fbuild.bff", premake.fastbuild.solution)
- end,
-
- onproject = function(prj)
- premake.generate(prj, "%%.bff", premake.fastbuild.project)
- end,
-
- oncleansolution = function(sln)
- premake.clean.file(sln, "fbuild.bff")
- end,
-
- oncleanproject = function(prj)
- premake.clean.file(prj, "%%.bff")
- end,
- }
diff --git a/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua b/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua
deleted file mode 100644
index 1043b6f0bbc..00000000000
--- a/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua
+++ /dev/null
@@ -1,468 +0,0 @@
--- Generates a FASTBuild config file for a project.
-
--- Note that table order iteration should be deterministic, so the .bff file content is not
--- arbitrarily changed each time it's generated. There are several places in this file
--- where sorts are done for that reason.
-
--- Remaining flags to handle:
--- NoImportLib = 1,
--- NoIncrementalLink = 1,
--- NoManifest = 1,
--- NoPCH = 1,
--- SingleOutputDir = 1,
--- StaticATL = 1,
--- Symbols = 1,
--- Unicode = 1,
--- Unsafe = 1,
--- WinMain = 1,
--- API todo:
--- custombuildtask
--- dependency
-
-local function add_trailing_backslash(dir)
- if dir:len() > 0 and dir:sub(-1) ~= "\\" then
- return dir.."\\"
- end
- return dir
-end
-
-local function compile(indentlevel, prj, cfg, commonbasepath)
-
- local firstflag = true
- for _, cfgexclude in ipairs(cfg.excludes) do
- if path.issourcefile(cfgexclude) then
- if firstflag then
- _p(indentlevel, '// Excluded files:')
- firstflag = false
- end
- _p(indentlevel, ".CompilerInputFiles - '%s'", cfgexclude)
- end
- end
- if not firstflag then
- _p('')
- end
-
- _p(indentlevel, ".CompilerOutputPath = '%s'", add_trailing_backslash(cfg.objectsdir))
-
- _p(indentlevel, ".Defines = ''")
- for _, define in ipairs(cfg.defines) do
- _p(indentlevel+1, "+ ' /D%s'", define)
- end
-
- if cfg.kind == 'SharedLib' then
- _p(indentlevel+1, "+ ' /D_WINDLL'")
- end
-
- _p(indentlevel, ".IncludeDirs = ''")
- local sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)
-
- -- Setup for special include dir sort to ensure that 'nearby' dirs get precedence over others.
- -- Gets the relative path from commonbasepath and counts the steps in that path.
- local function getpathnodecount(p)
- local nodefinder = string.gmatch(p, "[^\\/]+")
- local result = 0
- local node = nodefinder()
- while node do
- result = result + ((node ~= '.' and 1) or 0)
- node = nodefinder()
- end
- return result
- end
-
- local stepsfrombase = {}
-
- for _, includedir in ipairs(sortedincdirs) do
- stepsfrombase[includedir] = getpathnodecount(path.getrelative(commonbasepath, includedir))
- end
-
- local function includesort(a, b)
- if stepsfrombase[a] == stepsfrombase[b] then
- return a < b
- else
- return stepsfrombase[a] < stepsfrombase[b]
- end
- end
-
- table.sort(sortedincdirs, includesort)
- for _, includedir in ipairs(sortedincdirs) do
- _p(indentlevel+1, "+ ' /I\"%s\"'", includedir)
- end
-
- _p(indentlevel+1, "+ .MSVCIncludes")
-
- local compileroptions = {
- '"%1"',
- '/nologo',
- '/c',
- '/Gm-',
- '/Zc:inline',
- '/errorReport:prompt',
- '/FS',
- }
-
- if cfg.options.ForceCPP then
- table.insert(compileroptions, '/TP')
- end
-
- if cfg.flags.PedanticWarnings
- or cfg.flags.ExtraWarnings
- then
- table.insert(compileroptions, '/W4')
- end
-
- if (cfg.flags.NativeWChar == false or
- cfg.flags.NoNativeWChar) then
- table.insert(compileroptions, '/Zc:wchar_t-')
- end
-
- if (cfg.flags.EnableMinimalRebuild or
- cfg.flags.NoMultiProcessorCompilation) then
- -- Not compatible with FastBuild
- end
-
- if cfg.flags.FloatFast then
- table.insert(compileroptions, '/fp:fast')
- elseif cfg.flags.FloatStrict then
- table.insert(compileroptions, '/fp:strict')
- else
- table.insert(compileroptions, '/fp:precise')
- end
-
- if cfg.flags.FastCall then
- table.insert(compileroptions, '/Gr')
- elseif cfg.flags.StdCall then
- table.insert(compileroptions, '/Gd')
- end
-
- if cfg.flags.UnsignedChar then
- table.insert(compileroptions, '/J')
- end
-
- if premake.config.isdebugbuild(cfg) then
- if cfg.flags.StaticRuntime then
- table.insert(compileroptions, '/MTd')
- else
- table.insert(compileroptions, '/MDd')
- end
- else
- if cfg.flags.StaticRuntime then
- table.insert(compileroptions, '/MT')
- else
- table.insert(compileroptions, '/MD')
- end
- end
-
- if cfg.flags.Symbols then
- if (cfg.flags.C7DebugInfo) then
- table.insert(compileroptions, '/Z7')
- else
- if premake.config.iseditandcontinue(cfg) then
- table.insert(compileroptions, '/ZI')
- else
- table.insert(compileroptions, '/Zi')
- end
- local targetdir = add_trailing_backslash(cfg.buildtarget.directory)
- table.insert(compileroptions, string.format("/Fd\"%s%s.pdb\"", targetdir, cfg.buildtarget.basename))
- end
- end
-
- local isoptimised = true
- if (cfg.flags.Optimize) then
- table.insert(compileroptions, '/Ox')
- elseif (cfg.flags.OptimizeSize) then
- table.insert(compileroptions, '/O1')
- elseif (cfg.flags.OptimizeSpeed) then
- table.insert(compileroptions, '/O2')
- else
- isoptimised = false
- end
-
- if isoptimised then
- -- Refer to vstudio.vcxproj.lua about FunctionLevelLinking
- if cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then
- table.insert(compileroptions, '/GF-')
- table.insert(compileroptions, '/Gy-')
- else
- table.insert(compileroptions, '/GF')
- table.insert(compileroptions, '/Gy')
- end
- else
- table.insert(compileroptions, '/Gy')
- table.insert(compileroptions, '/Od')
- table.insert(compileroptions, '/RTC1')
- end
-
- if cfg.flags.FatalWarnings then
- table.insert(compileroptions, '/WX')
- else
- table.insert(compileroptions, '/WX-')
- end
-
- if cfg.platform == 'x32' then
- if cfg.flags.EnableSSE2 then
- table.insert(compileroptions, '/arch:SSE2')
- elseif cfg.flags.EnableSSE then
- table.insert(compileroptions, '/arch:SSE')
- end
- end
-
- if cfg.flags.NoExceptions then
- else
- if cfg.flags.SEH then
- table.insert(compileroptions, '/EHa')
- else
- table.insert(compileroptions, '/EHsc')
- end
- end
-
- if cfg.flags.NoRTTI then
- table.insert(compileroptions, '/GR-')
- else
- table.insert(compileroptions, '/GR')
- end
-
- if cfg.flags.NoFramePointer then
- table.insert(compileroptions, '/Oy-')
- else
- table.insert(compileroptions, '/Oy')
- end
-
- for _, addloption in ipairs(cfg.buildoptions) do
- table.insert(compileroptions, addloption)
- end
-
- _p(indentlevel, ".CompilerOptions = ''")
- for _, option in ipairs(compileroptions) do
- _p(indentlevel+1, "+ ' %s'", option)
- end
-
- _p(indentlevel+1, "+ .IncludeDirs")
- _p(indentlevel+1, "+ .Defines")
-
- if not cfg.flags.NoPCH and cfg.pchheader then
- _p(indentlevel, ".CompilerInputFiles - '%s'", cfg.pchsource)
- _p(indentlevel, ".PCHInputFile = '%s'", cfg.pchsource)
- _p(indentlevel, ".PCHOutputFile = .CompilerOutputPath + '%s.pch'", prj.name)
- _p(indentlevel, ".CompilerOptions + ' /Fp\"' + .CompilerOutputPath + '%s.pch\"'", prj.name)
- _p(indentlevel, ".PCHOptions = .CompilerOptions")
- _p(indentlevel+1, "+ ' /Yc\"%s\"'", cfg.pchheader)
- _p(indentlevel+1, "+ ' /Fo\"%%3\"'")
- _p(indentlevel, ".CompilerOptions + ' /Yu\"%s\"'", cfg.pchheader)
- end
- _p(indentlevel+1, "+ ' /Fo\"%%2\"'") -- make sure the previous property is .CompilerOptions
-end
-
-local function library(prj, cfg, useconfig, commonbasepath)
- _p(1, "Library('%s-%s-%s')", prj.name, cfg.name, cfg.platform)
- _p(1, '{')
-
- useconfig(2)
- compile(2, prj, cfg, commonbasepath)
-
- local librarianoptions = {
- '"%1"',
- '/OUT:"%2"',
- '/NOLOGO',
- }
-
- if cfg.platform == 'x64' then
- table.insert(librarianoptions, '/MACHINE:X64')
- else
- table.insert(librarianoptions, '/MACHINE:X86')
- end
-
- _p(2, ".LibrarianOptions = ''")
- for _, option in ipairs(librarianoptions) do
- _p(3, "+ ' %s'", option)
- end
-
- _p(2, ".LibrarianOutput = '%s'", cfg.buildtarget.fullpath)
-
- _p(1, '}')
- _p('')
-end
-
-local function binary(prj, cfg, useconfig, bintype, commonbasepath)
- _p(1, "ObjectList('%s_obj-%s-%s')", prj.name, cfg.name, cfg.platform)
- _p(1, '{')
-
- useconfig(2)
- compile(2, prj, cfg, commonbasepath)
-
- _p(1, '}')
- _p('')
-
- _p(1, "%s('%s-%s-%s')", bintype, prj.name, cfg.name, cfg.platform)
- _p(1, '{')
-
- useconfig(2)
- _p(2, '.Libraries = {')
- _p(3, "'%s_obj-%s-%s',", prj.name, cfg.name, cfg.platform) -- Refer to the ObjectList
-
- local sorteddeplibs = {}
- for _, deplib in ipairs(premake.getlinks(cfg, "dependencies", "basename")) do
- table.insert(sorteddeplibs, string.format("'%s-%s-%s',", deplib, cfg.name, cfg.platform))
- end
- table.sort(sorteddeplibs)
- for _, deplib in ipairs(sorteddeplibs) do
- _p(3, deplib)
- end
- _p(3, '}')
-
- _p(2, '.LinkerLinkObjects = false')
-
- local linkeroptions = {
- '"%1"',
- '/OUT:"%2"',
- '/NOLOGO',
- '/errorReport:prompt',
- }
-
- local subsystemversion = '",5.02"'
- if cfg.platform == 'x32' then
- subsystemversion = '",5.01"'
- end
-
- if cfg.kind == 'ConsoleApp' then
- table.insert(linkeroptions, '/SUBSYSTEM:CONSOLE'..subsystemversion)
- else
- table.insert(linkeroptions, '/SUBSYSTEM:WINDOWS'..subsystemversion)
- end
-
- if cfg.kind == 'SharedLib' then
- table.insert(linkeroptions, '/DLL')
- end
-
- if cfg.platform == 'x64' then
- table.insert(linkeroptions, '/MACHINE:X64')
- else
- table.insert(linkeroptions, '/MACHINE:X86')
- end
-
- for _, libdir in ipairs(cfg.libdirs) do
- table.insert(linkeroptions, string.format('/LIBPATH:%s', path.translate(libdir, '\\')))
- end
-
- if not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then
- if cfg.flags.Unicode then
- table.insert(linkeroptions, '/ENTRY:wmainCRTStartup')
- else
- table.insert(linkeroptions, '/ENTRY:mainCRTStartup')
- end
- end
-
- local deffile = premake.findfile(cfg, ".def")
- if deffile then
- table.insert(linkeroptions, '/DEF:%s', deffile)
- end
-
- if (cfg.flags.Symbols ~= nil) then
- table.insert(linkeroptions, '/DEBUG')
- end
-
- if premake.config.islinkeroptimizedbuild(cfg.flags) then
- table.insert(linkeroptions, '/OPT:REF')
- table.insert(linkeroptions, '/OPT:ICF')
- end
-
- table.insert(linkeroptions, '/INCREMENTAL'..((premake.config.isincrementallink(cfg) and '') or ':NO'))
-
- for _, addloption in ipairs(cfg.linkoptions) do
- table.insert(linkeroptions, addloption)
- end
-
- local linklibs = premake.getlinks(cfg, "all", "fullpath")
-
- for _, linklib in ipairs(linklibs) do
- table.insert(linkeroptions, path.getname(linklib))
- end
-
- table.sort(linkeroptions)
-
- _p(2, ".LinkerOptions = ''")
- for _, option in ipairs(linkeroptions) do
- _p(3, "+ ' %s'", option)
- end
- _p(3, "+ .MSVCLibPaths")
-
- _p(2, ".LinkerOutput = '%s'", cfg.buildtarget.fullpath)
-
- _p(1, '}')
- _p('')
-end
-
-local function executable(prj, cfg, useconfig, commonbasepath)
- binary(prj, cfg, useconfig, 'Executable', commonbasepath)
-end
-
-local function dll(prj, cfg, useconfig, commonbasepath)
- binary(prj, cfg, useconfig, 'DLL', commonbasepath)
-end
-
-local function alias(prj, cfg, target)
- _p(1, "Alias('%s-%s-%s')", prj.name, cfg.name, cfg.platform)
- _p(1, '{')
- _p(2, ".Targets = '%s'", target)
- _p(1, '}')
- _p('')
-end
-
-function premake.fastbuild.project(prj)
- io.indent = ' '
- _p('// FASTBuild project configuration file autogenerated by GENie.')
- _p('')
-
- _p('{')
-
- local cppfiles = {}
- for file in premake.project.eachfile(prj) do
- if path.issourcefile(file.name) then
- table.insert(cppfiles, file.name)
- end
- end
-
- local commonbasepath = cppfiles[1]
- for _, file in ipairs(cppfiles) do
- commonbasepath = path.getcommonbasedir(commonbasepath..'/', file)
- end
-
- _p(1, ".CompilerInputFilesRoot = '%s/'", commonbasepath)
- _p(1, '.CompilerInputFiles = {')
- for _, file in ipairs(cppfiles) do
- _p(2, "'%s',", file)
- end
- _p(1, '}')
- _p('')
-
- local targetkindmap = {
- ConsoleApp = executable,
- WindowedApp = executable,
- SharedLib = dll,
- StaticLib = library,
- }
-
- local useconfigmap = {
- x32 = function(indentlevel)
- _p(indentlevel, 'Using(.MSVCx86Config)')
- _p('')
- end,
- x64 = function(indentlevel)
- _p(indentlevel, 'Using(.MSVCx64Config)')
- _p('')
- end,
- }
-
- local nativeplatform = (os.is64bit() and 'x64') or 'x32'
-
- for _, platform in ipairs(prj.solution.platforms) do
- for cfg in premake.eachconfig(prj, platform) do
- if cfg.platform == 'Native' then
- alias(prj, cfg, string.format('%s-%s-%s', prj.name, cfg.name, nativeplatform))
- else
- targetkindmap[prj.kind](prj, cfg, useconfigmap[cfg.platform], commonbasepath)
- end
- end
- end
- _p('}')
-
-end
diff --git a/3rdparty/genie/src/actions/fastbuild/fastbuild_solution.lua b/3rdparty/genie/src/actions/fastbuild/fastbuild_solution.lua
deleted file mode 100644
index b75b3d0dc8e..00000000000
--- a/3rdparty/genie/src/actions/fastbuild/fastbuild_solution.lua
+++ /dev/null
@@ -1,195 +0,0 @@
--- Generates a FASTBuild config file for a solution.
-
--- Note that table order iteration should be deterministic, so the .bff file content is not
--- arbitrarily changed each time it's generated. There are several places in this file
--- where sorts are done for that reason.
-
- function premake.fastbuild.solution(sln)
- -- Presuppose we are building a fastbuild config for vs2015 only.
-
- io.indent = ' '
- _p('// FastBuild solution configuration file. Generated by GENie.')
- _p('//------------------------------------------------------------------------------------')
- _p('// %s', sln.name)
- _p('//------------------------------------------------------------------------------------')
-
- _p('#import VS140COMNTOOLS')
-
- -- Create a batch file to run vcvarsall, and capture the variables it sets:
- local is64bit = os.is64bit()
- local target64 = (is64bit and ' amd64') or ' x86_amd64'
- local target32 = (is64bit and ' amd64_x86') or ''
-
- local getvcvarscontent = [[
-@set INCLUDE=
-@set LIB=
-@set CommandPromptType=
-@set PreferredToolArchitecture=
-@set Platform=
-@set Path=%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\wbem
-
-@call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %1
-
-@echo %INCLUDE%
-@echo %LIB%
-@echo %CommandPromptType%
-@echo %PreferredToolArchitecture%
-@echo %Platform%
-@echo %Path%
-]]
-
- -- Save the temp file.
-
- local getvcvarsfilepath = os.getenv('TEMP')..'\\getvcvars.bat'
-
- local getvcvarsfile = assert(io.open(getvcvarsfilepath, 'w'))
- getvcvarsfile:write(getvcvarscontent)
- getvcvarsfile:close()
-
- local vcvarsrawx86 = os.outputof(string.format('call "%s"%s', getvcvarsfilepath, target32))
- local vcvarsrawx64 = os.outputof(string.format('call "%s"%s', getvcvarsfilepath, target64))
-
- os.remove(getvcvarsfilepath)
-
- local msvcvars = {}
- msvcvars.x32 = {}
- msvcvars.x64 = {}
-
- local includeslibssplitter = string.gmatch(vcvarsrawx64, "[^\n]+")
- msvcvars.x64.includesraw = includeslibssplitter()
- msvcvars.x64.libpathsraw = includeslibssplitter()
- msvcvars.x64.commandprompttype = includeslibssplitter()
- msvcvars.x64.preferredtoolarchitecture = includeslibssplitter()
- msvcvars.x64.platform = includeslibssplitter()
- msvcvars.x64.pathraw = includeslibssplitter()
-
- includeslibssplitter = string.gmatch(vcvarsrawx86, "[^\n]+")
- msvcvars.x32.includesraw = includeslibssplitter()
- msvcvars.x32.libpathsraw = includeslibssplitter()
- msvcvars.x32.commandprompttype = includeslibssplitter()
- msvcvars.x32.preferredtoolarchitecture = includeslibssplitter()
- msvcvars.x32.platform = includeslibssplitter()
- msvcvars.x32.pathraw = includeslibssplitter()
-
- local function printincludes(includesraw)
- _p(1, ".MSVCIncludes = ''")
- for i in string.gmatch(includesraw, "[^;]+") do
- _p(2, "+ ' /I\"%s\"'", i)
- end
- end
-
- local function printlibpaths(libpathsraw)
- _p(1, ".MSVCLibPaths = ''")
- for i in string.gmatch(libpathsraw, "[^;]+") do
- _p(2, "+ ' /LIBPATH:\"%s\"'", i)
- end
- end
-
- if is64bit then
- _p('.MSVCx64Config =')
- _p('[')
- _p(1, ".Compiler = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64\\cl.exe'")
- _p(1, ".Librarian = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64\\lib.exe'")
- _p(1, ".Linker = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64\\link.exe'")
- printincludes(msvcvars.x64.includesraw)
- printlibpaths(msvcvars.x64.libpathsraw)
- _p(']')
- _p('')
-
- _p('.MSVCx86Config =')
- _p('[')
- _p(1, ".Compiler = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64_x86\\cl.exe'")
- _p(1, ".Librarian = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64_x86\\lib.exe'")
- _p(1, ".Linker = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64_x86\\link.exe'")
- printincludes(msvcvars.x32.includesraw)
- printlibpaths(msvcvars.x32.libpathsraw)
- _p(']')
- _p('')
- else
- _p('.MSVCx64Config =')
- _p('[')
- _p(1, ".Compiler = '$VS140COMNTOOLS$..\\..\\VC\\bin\\x86_amd64\\cl.exe'")
- _p(1, ".Librarian = '$VS140COMNTOOLS$..\\..\\VC\\bin\\x86_amd64\\lib.exe'")
- _p(1, ".Linker = '$VS140COMNTOOLS$..\\..\\VC\\bin\\x86_amd64\\link.exe'")
- printincludes(msvcvars.x64.includesraw)
- printlibpaths(msvcvars.x64.libpathsraw)
- _p(']')
- _p('')
-
- _p('.MSVCx86Config =')
- _p('[')
- _p(1, ".Compiler = '$VS140COMNTOOLS$..\\..\\VC\\bin\\cl.exe'")
- _p(1, ".Librarian = '$VS140COMNTOOLS$..\\..\\VC\\bin\\lib.exe'")
- _p(1, ".Linker = '$VS140COMNTOOLS$..\\..\\VC\\bin\\link.exe'")
- printincludes(msvcvars.x32.includesraw)
- printlibpaths(msvcvars.x32.libpathsraw)
- _p(']')
- _p('')
- end
-
- local msvcbin = '$VS140COMNTOOLS$..\\..\\VC\\bin' .. ((is64bit and '\\amd64') or '')
- _p('#import Path')
- _p('#import TMP')
- _p('#import SystemRoot')
- _p('')
- _p('Settings')
- _p('{')
- _p(1, '.Environment = {')
- _p(2, "'Path=%s;$Path$',", msvcbin)
- _p(2, "'TMP=$TMP$',")
- _p(2, "'SystemRoot=$SystemRoot$',")
- _p(2, '}')
- _p('}')
- _p('')
-
- local function projkindsort(a, b)
- local projvaluemap = {
- ConsoleApp = 3,
- WindowedApp = 3,
- SharedLib = 2,
- StaticLib = 1,
- }
-
- if projvaluemap[a.kind] == projvaluemap[b.kind] then
- return a.name < b.name
- else
- return projvaluemap[a.kind] < projvaluemap[b.kind]
- end
- end
-
- local sortedprojs = {}
- for prj in premake.solution.eachproject(sln) do
- table.insert(sortedprojs, prj)
- end
-
- table.sort(sortedprojs, projkindsort)
-
- for _, prj in ipairs(sortedprojs) do
- local fname = premake.project.getbasename(prj.name, '%%.bff')
- fname = path.join(prj.location, fname)
- fname = path.getrelative(sln.location, fname)
- _p('#include "%s"', fname)
- end
- _p('')
-
- _p('.ProjectVariants = {')
- for _, plat in ipairs(sln.platforms) do
- for _, cfg in ipairs(sln.configurations) do
- _p(1, "'%s-%s',", cfg, plat)
- end
- end
- _p('}')
- _p('')
-
- _p('ForEach(.Variant in .ProjectVariants)')
- _p('{')
- _p(1, "Alias('all-$Variant$')")
- _p(1, '{')
- _p(2, '.Targets = {')
- for _, prj in ipairs(sortedprojs) do
- _p(3, "'%s-$Variant$',", prj.name)
- end
- _p(2, '}')
- _p(1, '}')
- _p('}')
- end
diff --git a/3rdparty/genie/src/actions/jcdb/_jcdb.lua b/3rdparty/genie/src/actions/jcdb/_jcdb.lua
new file mode 100644
index 00000000000..14a9eadbbc8
--- /dev/null
+++ b/3rdparty/genie/src/actions/jcdb/_jcdb.lua
@@ -0,0 +1,21 @@
+--
+-- _jcdb.lua
+-- Define the compile_commands.json action(s).
+-- Copyright (c) 2020 Johan Skoeld
+--
+
+newaction {
+ trigger = "jcdb",
+ shortname = "compile_commands.json",
+ description = "Generate a compile_commands.json file.",
+
+ valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
+ valid_languages = { "C", "C++" },
+ valid_tools = { cc = { "gcc" } },
+
+ onsolution = function(sln)
+ local jsonpath = path.join(sln.location, "compile_commands.json")
+ premake.generate(sln, jsonpath, premake.jcdb.generate)
+ end,
+}
+
diff --git a/3rdparty/genie/src/actions/jcdb/jcdb_solution.lua b/3rdparty/genie/src/actions/jcdb/jcdb_solution.lua
new file mode 100644
index 00000000000..581dbd77f04
--- /dev/null
+++ b/3rdparty/genie/src/actions/jcdb/jcdb_solution.lua
@@ -0,0 +1,153 @@
+--
+-- jcdb_solution.lua
+-- compile_commands.json functions.
+-- Copyright (c) 2020 Johan Skoeld
+--
+
+premake.jcdb = {}
+
+local premake = premake
+local jcdb = premake.jcdb
+
+local encode_chars = {
+ [0x22] = '\\"',
+ [0x5c] = "\\\\",
+ [0x08] = "\\b",
+ [0x0c] = "\\f",
+ [0x0a] = "\\n",
+ [0x0d] = "\\r",
+ [0x09] = "\\t",
+}
+
+local function encode_string(s)
+ local res = '"'
+
+ for _, cp in utf8.codes(s) do
+ if encode_chars[cp] then
+ res = res..encode_chars[cp]
+ elseif cp < 32 then
+ res = res..string.format("\\u%04x", cp)
+ else
+ res = res..utf8.char(cp)
+ end
+ end
+
+ return res..'"'
+end
+
+local function escape_cmdline_arg(s)
+ if s:find("%s") then
+ s = s:gsub("\\", "\\\\")
+ s = s:gsub('"', '\\"')
+ s = '"'..s..'"'
+ end
+
+ return s
+end
+
+local function list(tbl)
+ return iif(#tbl > 0, " "..table.concat(tbl, " "), "")
+end
+
+local function build_command(cfg, cc, file)
+ local cmdline = ""
+ local function app(s) cmdline = cmdline..s end
+
+ -- Compiler
+ if path.iscfile(file) or path.isasmfile(file) then
+ app(cc.cc)
+ else
+ app(cc.cxx)
+ end
+
+ -- Flags / Defines / Includes
+ app(list(cc.getcppflags(cfg)))
+ app(list(cc.getdefines(cfg.defines)))
+ app(list(cc.getincludedirs(cfg.includedirs)))
+ app(list(cc.getquoteincludedirs(cfg.userincludedirs)))
+ app(list(cc.getsystemincludedirs(cfg.systemincludedirs)))
+
+ -- Custom build options
+ app(list(cc.getcflags(cfg)))
+
+ if path.iscppfile(file) then
+ app(list(cc.getcxxflags(cfg)))
+ end
+
+ if path.isasmfile(file) then
+ app(list(cfg.buildoptions))
+ app(list(cfg.buildoptions_asm))
+ elseif path.isobjcfile(file) then
+ local opts = iif(path.iscfile(file), cfg.buildoptions_objc, cfg.buildoptions_objcpp)
+ app(list(cc.getobjcflags(cfg)))
+ app(list(cfg.buildoptions))
+ app(list(opts))
+ elseif path.iscfile(file) then
+ app(list(cfg.buildoptions))
+ app(list(cfg.buildoptions_c))
+ else
+ app(list(cfg.buildoptions))
+ app(list(cfg.buildoptions_cpp))
+ end
+
+ -- Forced includes
+ if cfg.pchheader and not cfg.flags.NoPCH then
+ -- No need to worry about gch files or anything. Using the pch directly
+ -- should have the same behavior for our purposes.
+ app(" -include ")
+ app(escape_cmdline_arg(cfg.pchheader))
+ end
+
+ for _, i in ipairs(cfg.forcedincludes) do
+ app(" -include ")
+ app(escape_cmdline_arg(i))
+ end
+
+ -- Input / Output
+ local base = path.trimdots(path.removeext(file))..".o"
+ local output = path.join(cfg.objectsdir, base)
+ app(" -o ")
+ app(escape_cmdline_arg(output))
+ app(" -c ")
+ app(escape_cmdline_arg(file))
+
+ return cmdline
+end
+
+function jcdb.generate_config(prj, cfg, cc)
+ table.sort(cfg.files)
+
+ local directory = path.getabsolute(prj.location)
+
+ for _, file in ipairs(cfg.files) do
+ if path.iscppfile(file) or path.isasmfile(file) then
+ _p(' { "directory": %s,', encode_string(directory))
+ _p(' "command": %s,', encode_string(build_command(cfg, cc, file)))
+ _p(' "file": %s },', encode_string(file))
+ end
+ end
+end
+
+function jcdb.generate_project(prj)
+ local cc = premake.gettool(prj)
+ local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native")
+
+ for _, platform in ipairs(platforms) do
+ for cfg in premake.eachconfig(prj, platform) do
+ jcdb.generate_config(prj, cfg, cc)
+ end
+ end
+end
+
+function jcdb.generate(sln)
+ for _, prj in ipairs(sln.projects) do
+ jcdb.generate_project(prj)
+ end
+
+ -- Remove the last comma as JSON doesn't permit trailing commas
+ io.captured = io.captured:gsub(",%s$", "")
+
+ -- Wrap in brackets
+ io.captured = "["..io.eol..io.captured..io.eol.."]"
+end
+
diff --git a/3rdparty/genie/src/actions/make/_make.lua b/3rdparty/genie/src/actions/make/_make.lua
index 63741e982cb..598c31bab9c 100644
--- a/3rdparty/genie/src/actions/make/_make.lua
+++ b/3rdparty/genie/src/actions/make/_make.lua
@@ -36,22 +36,11 @@
--
-- Escape quoted string so it can be passed as define via command line.
--
-
+-- FIXME: this simplistic function doesn't work properly with embedded escapes
+-- and quoted strings, nor with Windows Command Prompt quoting and escaping
+-- rules. It causes build problems on both Windows and Linux and has been disabled.
function _MAKE.escquote(value)
- local result
- if (type(value) == "table") then
- result = { }
- for _,v in ipairs(value) do
- table.insert(result, _MAKE.escquote(v))
- end
- return result
- else
- -- handle simple replacements
- --result = value:gsub(" ", "\\ ")
- --result = result:gsub("\"", "\\\"")
- --return result
- return value
- end
+ return value
end
diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua
index 880d9d35bf2..760ac9ad7ec 100644
--- a/3rdparty/genie/src/actions/make/make_cpp.lua
+++ b/3rdparty/genie/src/actions/make/make_cpp.lua
@@ -214,6 +214,10 @@
function premake.gmake_cpp_header(prj, cc, platforms)
_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)
+ _p('')
+
+ _p('.SUFFIXES:') -- Delete the default suffix rules.
+ _p('')
-- set up the environment
_p('ifndef config')
diff --git a/3rdparty/genie/src/actions/make/make_csharp.lua b/3rdparty/genie/src/actions/make/make_csharp.lua
index ea6a0fcf410..fcfac790d25 100644
--- a/3rdparty/genie/src/actions/make/make_csharp.lua
+++ b/3rdparty/genie/src/actions/make/make_csharp.lua
@@ -86,6 +86,9 @@
_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)
_p('')
+ _p('.SUFFIXES:') -- Delete the default suffix rules.
+ _p('')
+
_p('ifndef config')
_p(' config=%s', _MAKE.esc(prj.configurations[1]:lower()))
_p('endif')
diff --git a/3rdparty/genie/src/actions/make/make_swift.lua b/3rdparty/genie/src/actions/make/make_swift.lua
index 3302c623b1c..4bfb00756f2 100644
--- a/3rdparty/genie/src/actions/make/make_swift.lua
+++ b/3rdparty/genie/src/actions/make/make_swift.lua
@@ -13,8 +13,12 @@ function premake.make_swift(prj)
local platforms = premake.filterplatforms(prj.solution, tool.platforms, "Native")
_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)
+ _p('')
+
+ _p('.SUFFIXES:') -- Delete the default suffix rules.
+ _p('')
--- set up the environment
+ -- set up the environment
_p('ifndef config')
_p(1, 'config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))
_p('endif')
@@ -61,7 +65,7 @@ function premake.make_swift(prj)
swift.generate_config(prj, cfg, tool)
end
end
-
+
_p('.PHONY: ')
_p('')
_p('all: $(WORK_DIRS) $(TARGET)')
@@ -78,7 +82,7 @@ function premake.make_swift(prj)
end
end
_p('')
-
+
local objfiles = {}
_p('OBJECTS_WITNESS := $(OBJDIR)/build.stamp')
_p('OBJECTS := \\')
@@ -90,7 +94,7 @@ function premake.make_swift(prj)
end
end
_p('')
-
+
swift.file_rules(prj, objfiles)
swift.linker(prj, tool)
swift.generate_clean(prj)
@@ -109,7 +113,7 @@ function swift.file_rules(prj, objfiles)
_p(1, "$(SILENT) $(SWIFTC) -frontend -c $(SOURCES) -enable-objc-interop $(SDK) -I $(OUT_DIR) $(SWIFTC_FLAGS) -module-cache-path $(MODULECACHE_DIR) -D SWIFT_PACKAGE $(MODULE_MAPS) -emit-module-doc-path $(OUT_DIR)/$(MODULE_NAME).swiftdoc -module-name $(MODULE_NAME) -emit-module-path $(OUT_DIR)/$(MODULE_NAME).swiftmodule -num-threads 8 %s", table.arglist("-o", objfiles))
_p(1, "@mv -f $(OBJDIR)/data.tmp $(OBJECTS_WITNESS)")
_p('')
-
+
-- posix only for now
_p('$(OBJECTS): $(OBJECTS_WITNESS)')
_p(1, '@if test -f $@; then :; else \\')
@@ -120,7 +124,7 @@ function swift.file_rules(prj, objfiles)
end
function swift.linker(prj, tool)
- local lddeps = make.list(premake.getlinks(prj, "siblings", "fullpath"))
+ local lddeps = make.list(premake.getlinks(prj, "siblings", "fullpath"))
if prj.kind == "StaticLib" then
_p("$(TARGET): $(OBJECTS) %s ", lddeps)
@@ -188,4 +192,4 @@ function swift.generate_config(prj, cfg, tool)
_p('endif')
_p('')
-end \ No newline at end of file
+end
diff --git a/3rdparty/genie/src/actions/make/make_vala.lua b/3rdparty/genie/src/actions/make/make_vala.lua
index a7a88c6ddac..308605802ef 100644
--- a/3rdparty/genie/src/actions/make/make_vala.lua
+++ b/3rdparty/genie/src/actions/make/make_vala.lua
@@ -3,6 +3,10 @@
-- Generate a Vala project makefile.
--
+ premake.make.vala = { }
+ premake.make.makefile_ignore = false
+
+ local vala = premake.make.vala
local make = premake.make
function premake.make_vala(prj)
@@ -13,46 +17,8 @@
-- build a list of supported target platforms that also includes a generic build
local platforms = premake.filterplatforms(prj.solution, valac.platforms, "Native")
- _p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)
-
- -- set up the environment
- _p('ifndef config')
- _p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))
- _p('endif')
- _p('')
-
- _p('ifndef verbose')
- _p(' SILENT = @')
- _p('endif')
- _p('')
-
- -- identify the shell type
- _p('SHELLTYPE := msdos')
- _p('ifeq (,$(ComSpec)$(COMSPEC))')
- _p(' SHELLTYPE := posix')
- _p('endif')
- _p('ifeq (/bin,$(findstring /bin,$(SHELL)))')
- _p(' SHELLTYPE := posix')
- _p('endif')
- _p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')
- _p(' SHELLTYPE := posix')
- _p('endif')
- _p('')
-
- _p('ifeq (posix,$(SHELLTYPE))')
- _p(' MKDIR = $(SILENT) mkdir -p "$(1)"')
- _p(' COPY = $(SILENT) cp -fR "$(1)" "$(2)"')
- _p(' RM = $(SILENT) rm -f "$(1)"')
- _p('else')
- _p(' MKDIR = $(SILENT) mkdir "$(subst /,\\\\,$(1))" 2> nul || exit 0')
- _p(' COPY = $(SILENT) copy /Y "$(subst /,\\\\,$(1))" "$(subst /,\\\\,$(2))"')
- _p(' RM = $(SILENT) del /F "$(subst /,\\\\,$(1))" 2> nul || exit 0')
- _p('endif')
- _p('')
-
- _p('VALAC = %s', valac.valac)
- _p('CC = %s', valac.cc)
- _p('')
+ -- output build configurations
+ premake.gmake_vala_header(prj, valac, platforms)
-- write configuration blocks
for _, platform in ipairs(platforms) do
@@ -61,30 +27,38 @@
end
end
- -- list sources
- _p('SOURCES := \\')
- for _, file in ipairs(prj.files) do
- if path.issourcefile(file) then
- -- check if file is excluded.
- if not table.icontains(prj.excludes, file) then
- -- if not excluded, add it.
- _p('\t%s \\', _MAKE.esc(file))
- end
+ -- list object directories
+ local objdirs = {}
+ local additionalobjdirs = {}
+ for _, file in ipairs(prj.allfiles) do
+ if path.issourcefile(file) or path.isgresource(file) then
+ objdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1
end
end
+
+ _p('OBJDIRS := \\')
+ _p('\t$(OBJDIR) \\')
+ for dir, _ in iter.sortByKeys(objdirs) do
+ _p('\t$(OBJDIR)/%s \\', dir)
+ end
+ for dir, _ in iter.sortByKeys(additionalobjdirs) do
+ _p('\t%s \\', dir)
+ end
_p('')
-- main build rule(s)
_p('.PHONY: clean prebuild prelink')
_p('')
- _p('all: prebuild prelink $(TARGET) | $(TARGETDIR)')
+ _p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)')
_p('\t@:')
_p('')
-- target build rule
- _p('$(TARGET): $(SOURCES) | $(TARGETDIR)')
- _p('\t$(SILENT) $(VALAC) -o $(TARGET) --cc=$(CC) $(FLAGS) $(SOURCES)')
+ _p('$(TARGET): $(OBJECTS) | $(TARGETDIR)')
+ _p('\t@echo Linking %s', prj.name)
+ _p('\t$(SILENT) $(LINKCMD)')
+
_p('\t$(POSTBUILDCMDS)')
_p('')
@@ -93,6 +67,13 @@
_p('$(TARGETDIR):')
premake.make_mkdirrule("$(TARGETDIR)")
+ _p('$(OBJDIRS):')
+ if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCreatingMessage")) then
+ _p('\t@echo Creating $(@)')
+ end
+ _p('\t-$(call MKDIR,$@)')
+ _p('')
+
-- clean target
_p('clean:')
if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCleaningMessage")) then
@@ -113,6 +94,67 @@
_p('prelink:')
_p('\t$(PRELINKCMDS)')
_p('')
+
+ vala.fileRules(prj, valac)
+ end
+
+
+
+--
+-- Write the makefile header
+--
+
+ function premake.gmake_vala_header(prj, valac, platforms)
+ _p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)
+ _p('')
+
+ _p('.SUFFIXES:') -- Delete the default suffix rules.
+ _p('')
+
+ -- set up the environment
+ _p('ifndef config')
+ _p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))
+ _p('endif')
+ _p('')
+
+ _p('ifndef verbose')
+ _p(' SILENT = @')
+ _p('endif')
+ _p('')
+
+ -- identify the shell type
+ _p('SHELLTYPE := msdos')
+ _p('ifeq (,$(ComSpec)$(COMSPEC))')
+ _p(' SHELLTYPE := posix')
+ _p('endif')
+ _p('ifeq (/bin,$(findstring /bin,$(SHELL)))')
+ _p(' SHELLTYPE := posix')
+ _p('endif')
+ _p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')
+ _p(' SHELLTYPE := posix')
+ _p('endif')
+ _p('')
+
+ _p('ifeq (posix,$(SHELLTYPE))')
+ _p(' MKDIR = $(SILENT) mkdir -p "$(1)"')
+ _p(' COPY = $(SILENT) cp -fR "$(1)" "$(2)"')
+ _p(' RM = $(SILENT) rm -f "$(1)"')
+ _p('else')
+ _p(' MKDIR = $(SILENT) mkdir "$(subst /,\\\\,$(1))" 2> nul || exit 0')
+ _p(' COPY = $(SILENT) copy /Y "$(subst /,\\\\,$(1))" "$(subst /,\\\\,$(2))"')
+ _p(' RM = $(SILENT) del /F "$(subst /,\\\\,$(1))" 2> nul || exit 0')
+ _p('endif')
+ _p('')
+
+ _p('VALAC = %s', valac.valac)
+ _p('CC = %s', valac.cc)
+ _p('GLIBRC = %s', valac.glibrc)
+ _p('')
+
+ if (not premake.make.makefile_ignore) then
+ _p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))
+ _p('')
+ end
end
@@ -121,16 +163,71 @@
-- Write a block of configuration settings.
--
+ local function is_excluded(prj, cfg, file)
+ if table.icontains(prj.excludes, file) then
+ return true
+ end
+
+ if table.icontains(cfg.excludes, file) then
+ return true
+ end
+
+ return false
+ end
+
function premake.gmake_valac_config(prj, cfg, valac)
_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))
- _p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))
- _p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))
+ _p(' BASEDIR = %s', _MAKE.esc(path.getrelative(cfg.location, _WORKING_DIR)))
+ _p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))
+ _p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))
+ _p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))
_p(' DEFINES +=%s', make.list(valac.getdefines(cfg.defines)))
_p(' VAPIDIRS +=%s', make.list(valac.getvapidirs(cfg.vapidirs)))
_p(' PKGS +=%s', make.list(valac.getlinks(cfg.links)))
- _p(' FLAGS += $(DEFINES) $(VAPIDIRS) $(PKGS)%s', make.list(table.join(valac.getvalaflags(cfg), valac.getbuildoptions(cfg.buildoptions), valac.getbuildoptions(cfg.buildoptions_c), cfg.buildoptions_vala)))
+ _p(' FLAGS += $(DEFINES) $(VAPIDIRS) $(PKGS)%s', make.list(table.join(valac.getvalaflags(cfg), cfg.buildoptions_vala)))
+ _p(' VALA_LDFLAGS= $(shell pkg-config --libs%s)', make.list(cfg.links))
+ _p(' ALL_LDFLAGS+= $(LDFLAGS)%s $(VALA_LDFLAGS)', make.list(table.join(cfg.linkoptions)))
+ _p(' LINKOBJS = %s', "$(OBJECTS)")
+ _p(' VALA_CFLAGS = $(shell pkg-config --cflags%s)%s', make.list(cfg.links), make.list(valac.getvalaccflags(cfg)))
+ _p(' ALL_CFLAGS += $(CFLAGS) $(ARCH)%s $(VALA_CFLAGS)', make.list(table.join(cfg.buildoptions, cfg.buildoptions_c)))
+ _p(' LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(ARCH) $(ALL_LDFLAGS)');
+
+ table.sort(cfg.files)
+
+ -- add objects for compilation, and remove any that are excluded per config.
+ _p(' OBJECTS := \\')
+ for _, file in ipairs(cfg.files) do
+ if path.issourcefile(file) or path.isgresource(file) then
+ if not is_excluded(prj, cfg, file) then
+ _p('\t$(OBJDIR)/%s.o \\'
+ , _MAKE.esc(path.trimdots(path.removeext(file)))
+ )
+ end
+ end
+ end
+ _p('')
+
+ _p(' SOURCES := \\')
+ for _, file in ipairs(cfg.files) do
+ if path.issourcefile(file) and path.isvalafile(file) then
+ if not is_excluded(prj, cfg, file) then
+ _p('\t%s \\', _MAKE.esc(file))
+ end
+ end
+ end
+ _p('')
+
+ _p(' GRESOURCES := \\')
+ for _, file in ipairs(cfg.files) do
+ if path.isgresource(file) then
+ if not is_excluded(prj, cfg, file) then
+ _p('\t%s \\', _MAKE.esc(file))
+ end
+ end
+ end
+ _p('')
_p(' define PREBUILDCMDS')
if #cfg.prebuildcommands > 0 then
@@ -156,3 +253,109 @@
_p('endif')
_p('')
end
+
+
+
+--
+-- Build command for a single file.
+--
+
+ function vala.fileRules(prj, cc)
+ local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native")
+
+ _p('ifneq (,$(OBJRESP))')
+ _p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')
+ _p('\t$(SILENT) echo $^')
+ _p('\t$(SILENT) echo $^ > $@')
+ _p('endif')
+ _p('')
+
+ _p('ifneq (,$(LDRESP))')
+ _p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')
+ _p('\t$(SILENT) echo $^')
+ _p('\t$(SILENT) echo $^ > $@')
+ _p('endif')
+ _p('')
+
+ local pattern_targets = ""
+ table.sort(prj.allfiles)
+ for _, file in ipairs(prj.allfiles or {}) do
+ if path.issourcefile(file) or path.isgresource(file) then
+ if path.isvalafile(file) or path.iscfile(file) or path.isgresource(file) then
+ if path.isvalafile(file) or path.isgresource(file) then
+ _p('$(OBJDIR)/%s.o: $(OBJDIR)/%s.c $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'
+ , _MAKE.esc(path.trimdots(path.removeext(file)))
+ , _MAKE.esc(path.trimdots(path.removeext(file)))
+ , _MAKE.esc(path.getdirectory(path.trimdots(file)))
+ )
+ if not path.isgresource(file) then
+ pattern_targets = pattern_targets
+ .. "$(OBJDIR)/"
+ .. _MAKE.esc(path.trimdots(path.removeext(file)))
+ .. ".% \\\n" -- Pattern rule: https://stackoverflow.com/a/3077254
+ end
+ else
+ _p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'
+ , _MAKE.esc(path.trimdots(path.removeext(file)))
+ , file
+ , _MAKE.esc(path.getdirectory(path.trimdots(file)))
+ )
+ end
+ if prj.msgcompile then
+ _p('\t@echo ' .. prj.msgcompile)
+ else
+ _p('\t@echo $(notdir $<)')
+ end
+ _p('\t$(SILENT) %s $(FORCE_INCLUDE) -o "$@" -c "$<"'
+ , "$(CC) $(ALL_CFLAGS)"
+ , _MAKE.esc(path.getbasename(file))
+ )
+ for _, task in ipairs(prj.postcompiletasks or {}) do
+ _p('\t$(SILENT) %s', task)
+ _p('')
+ end
+ _p('')
+
+ if path.isgresource(file) then
+ _p('$(OBJDIR)/%s.c: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'
+ , _MAKE.esc(path.trimdots(path.removeext(file)))
+ , _MAKE.esc(file)
+ , _MAKE.esc(path.getdirectory(path.trimdots(file)))
+ )
+ if prj.msgcompile then
+ _p('\t@echo ' .. prj.msgcompile)
+ else
+ _p('\t@echo $(notdir $<)')
+ end
+ _p('\t$(SILENT) %s "$<" --target="$@" --sourcedir="%s" --generate'
+ , "$(GLIBRC)"
+ , _MAKE.esc(path.getdirectory(file))
+ )
+ for _, task in ipairs(prj.postcompiletasks or {}) do
+ _p('\t$(SILENT) %s', task)
+ _p('')
+ end
+ end
+
+ _p('')
+ end
+ end
+ end
+
+ if pattern_targets ~= "" then
+ -- Generate .c from corresponding .vala
+ _p('%s: $(SOURCES) $(GRESOURCES) $(GCH) $(MAKEFILE)', pattern_targets)
+ if prj.msgcompile then
+ _p('\t@echo ' .. prj.msgcompile)
+ else
+ _p('\t@echo [GEN] valac')
+ end
+ _p('\t$(SILENT) %s $(SOURCES) --directory $(OBJDIR) --basedir $(BASEDIR) --gresources=$(GRESOURCES) -C'
+ , "$(VALAC) $(FLAGS)"
+ )
+ for _, task in ipairs(prj.postcompiletasks or {}) do
+ _p('\t$(SILENT) %s', task)
+ _p('')
+ end
+ end
+ end
diff --git a/3rdparty/genie/src/actions/ninja/ninja_cpp.lua b/3rdparty/genie/src/actions/ninja/ninja_cpp.lua
index 5db216fb453..a0134f34e54 100644
--- a/3rdparty/genie/src/actions/ninja/ninja_cpp.lua
+++ b/3rdparty/genie/src/actions/ninja/ninja_cpp.lua
@@ -53,7 +53,6 @@ end
}
_p("")
-
_p("# core rules for " .. cfg.name)
_p("rule cc")
_p(" command = " .. wrap_ninja_cmd(tool.cc .. " $defines $includes $flags -MMD -MF $out.d -c -o $out $in"))
@@ -67,12 +66,20 @@ end
_p(" depfile = $out.d")
_p(" deps = gcc")
_p("")
- _p("rule ar")
- _p(" command = " .. wrap_ninja_cmd(tool.ar .. " $flags $out @$out.rsp " .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or "")))
- _p(" description = ar $out")
- _p(" rspfile = $out.rsp")
- _p(" rspfile_content = $in $libs")
- _p("")
+
+ if cfg.flags.UseObjectResponseFile then
+ _p("rule ar")
+ _p(" command = " .. wrap_ninja_cmd(tool.ar .. " $flags $out @$out.rsp " .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or "")))
+ _p(" description = ar $out")
+ _p(" rspfile = $out.rsp")
+ _p(" rspfile_content = $in $libs")
+ _p("")
+ else
+ _p("rule ar")
+ _p(" command = " .. wrap_ninja_cmd(tool.ar .. " $flags $out $in $libs" .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or "")))
+ _p(" description = ar $out")
+ _p("")
+ end
local link = iif(cfg.language == "C", tool.cc, tool.cxx)
_p("rule link")
@@ -82,11 +89,19 @@ end
startgroup = '-Wl,--start-group'
endgroup = '-Wl,--end-group'
end
- _p(" command = " .. wrap_ninja_cmd("$pre_link " .. link .. " -o $out @$out.rsp $all_ldflags $post_build"))
- _p(" description = link $out")
- _p(" rspfile = $out.rsp")
- _p(" rspfile_content = $all_outputfiles $walibs" .. string.format("%s $libs %s", startgroup, endgroup))
- _p("")
+
+ local rspfile_content = "$all_outputfiles $walibs " .. string.format("%s $libs %s", startgroup, endgroup)
+ if cfg.flags.UseLDResponseFile then
+ _p(" command = " .. wrap_ninja_cmd("$pre_link " .. link .. " -o $out @$out.rsp $all_ldflags $post_build"))
+ _p(" description = link $out")
+ _p(" rspfile = $out.rsp")
+ _p(" rspfile_content = %s", rspfile_content)
+ _p("")
+ else
+ _p(" command = " .. wrap_ninja_cmd("$pre_link " .. link .. " -o $out " .. rspfile_content .. " $all_ldflags $post_build"))
+ _p(" description = link $out")
+ _p("")
+ end
_p("rule exec")
_p(" command = " .. wrap_ninja_cmd("$command"))
@@ -134,14 +149,16 @@ end
function cpp.custombuildtask(prj, cfg)
local cmd_index = 1
- local seen_commands = {}
- local command_by_name = {}
- local command_files = {}
+
+ local ninja_rules = {}
+ local ninja_builds = {}
local prebuildsuffix = #cfg.prebuildcommands > 0 and "||__prebuildcommands_" .. premake.esc(prj.name) or ""
for _, custombuildtask in ipairs(prj.custombuildtask or {}) do
for _, buildtask in ipairs(custombuildtask or {}) do
+
+ local commands = {}
for _, cmd in ipairs(buildtask[4] or {}) do
local num = 1
@@ -155,63 +172,40 @@ end
cmd = string.gsub(cmd, '%$%(<%)', '$in')
cmd = string.gsub(cmd, '%$%(@%)', '$out')
- local cmd_name -- shortened command name
-
- -- generate shortened rule names for the command, may be nonsensical
- -- in some cases but it will at least be unique.
- if seen_commands[cmd] == nil then
- local _, _, name = string.find(cmd, '([.%w]+)%s')
- name = 'cmd' .. cmd_index .. '_' .. string.gsub(name, '[^%w]', '_')
-
- seen_commands[cmd] = {
- name = name,
- index = cmd_index,
- }
-
- cmd_index = cmd_index + 1
- cmd_name = name
- else
- cmd_name = seen_commands[cmd].name
- end
-
- local index = seen_commands[cmd].index
-
- if command_files[index] == nil then
- command_files[index] = {}
- end
+ table.insert(commands, cmd)
+ end
- local cmd_set = command_files[index]
+ ninja_rules["cmd_" .. cmd_index] = commands
- table.insert(cmd_set, {
- buildtask[1],
- buildtask[2],
- buildtask[3],
- seen_commands[cmd].name,
- })
+ table.insert(ninja_builds, {
+ file_in = buildtask[1],
+ file_out = buildtask[2],
+ rule = "cmd_" .. cmd_index,
+ deps = buildtask[3]
+ })
- command_files[index] = cmd_set
- command_by_name[cmd_name] = cmd
- end
+ cmd_index = cmd_index + 1
end
end
_p("# custom build rules")
- for command, details in pairs(seen_commands) do
- _p("rule " .. details.name)
- _p(1, "command = " .. wrap_ninja_cmd(command))
+
+ for rule, commands in pairs(ninja_rules) do
+ _p("rule " .. rule)
+ _p(1, "command = " .. wrap_ninja_cmd(table.concat(commands, " && ")))
end
- for cmd_index, cmdsets in ipairs(command_files) do
- for _, cmdset in ipairs(cmdsets) do
- local file_in = path.getrelative(cfg.location, cmdset[1])
- local file_out = path.getrelative(cfg.location, cmdset[2])
- local deps = ''
- for i, dep in ipairs(cmdset[3]) do
- deps = deps .. path.getrelative(cfg.location, dep) .. ' '
- end
- _p("build " .. file_out .. ': ' .. cmdset[4] .. ' ' .. file_in .. ' | ' .. deps .. prebuildsuffix)
- _p("")
+
+ for i = 1,#ninja_builds do
+ local build = ninja_builds[i]
+
+ local deps = ''
+ for i, dep in ipairs(build.deps) do
+ deps = deps .. path.getrelative(cfg.location, dep) .. ' '
end
+
+ _p("build " .. path.getrelative(cfg.location, build.file_out) .. ': ' .. build.rule .. ' ' .. path.getrelative(cfg.location, build.file_in) .. ' | ' .. deps .. prebuildsuffix)
+ _p("")
end
end
@@ -303,7 +297,7 @@ end
local extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[objfilename] or {}, ' ') or ''
local order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[objfilename] or {}, ' ') or ''
local extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[objfilename] or {}, ' ') or ''
-
+
local cflags = "cflags"
if path.isobjcfile(file) then
_p("build " .. objfilename .. ": cxx " .. file .. extra_deps .. order_deps)
@@ -317,7 +311,7 @@ end
_p("build " .. objfilename .. ": cxx " .. file .. extra_deps .. order_deps)
cflags = "cxxflags"
end
-
+
_p(1, "flags = " .. flags[cflags] .. extra_flags)
_p(1, "includes = " .. flags.includes)
_p(1, "defines = " .. flags.defines)
@@ -331,7 +325,7 @@ end
function cpp.linker(prj, cfg, objfiles, tool)
local all_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions))
- local prebuildsuffix = #cfg.prebuildcommands > 0 and "||__prebuildcommands" or ""
+ local prebuildsuffix = #cfg.prebuildcommands > 0 and ("||__prebuildcommands_" .. premake.esc(prj.name)) or ""
local libs = {}
local walibs = {}
local lddeps = {}
diff --git a/3rdparty/genie/src/actions/qbs/_qbs.lua b/3rdparty/genie/src/actions/qbs/_qbs.lua
deleted file mode 100644
index 8f1ba4b5e0b..00000000000
--- a/3rdparty/genie/src/actions/qbs/_qbs.lua
+++ /dev/null
@@ -1,41 +0,0 @@
---
--- GENie - Project generator tool
--- https://github.com/bkaradzic/GENie#license
---
-
-premake.qbs = { }
-
-local qbs = premake.qbs
-
-newaction
-{
- -- Metadata for the command line and help system
- trigger = "qbs",
- shortname = "qbs",
- description = "Generate QBS build files",
- module = "qbs",
-
- -- The capabilities of this action
- valid_kinds = {"ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle"},
- valid_languages = {"C", "C++"},
- valid_tools = {
- cc = { "gcc", "msc" },
- },
-
- -- Solution and project generation logic
- onsolution = function(sln)
- io.eol = "\n"
- io.indent = "\t"
- io.escaper(qbs.esc)
- premake.generate(sln, sln.name .. ".creator.qbs", qbs.generate_solution)
- io.indent = " "
- premake.generate(sln, sln.name .. ".creator.qbs.user", qbs.generate_user)
- end,
-
- onproject = function(prj)
- io.eol = "\n"
- io.indent = "\t"
- io.escaper(qbs.esc)
- premake.generate(prj, prj.name .. ".qbs", qbs.generate_project)
- end,
-}
diff --git a/3rdparty/genie/src/actions/qbs/qbs_base.lua b/3rdparty/genie/src/actions/qbs/qbs_base.lua
deleted file mode 100644
index ca24748ecea..00000000000
--- a/3rdparty/genie/src/actions/qbs/qbs_base.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-function premake.qbs.list(indent, name, table)
- if #table > 0 then
- _p(indent, '%s: [', name)
- for _, item in ipairs(table) do
- _p(indent+1, '"%s",', item:gsub('"', '\\"'))
- end
- _p(indent+1, ']')
- end
-end \ No newline at end of file
diff --git a/3rdparty/genie/src/actions/qbs/qbs_cpp.lua b/3rdparty/genie/src/actions/qbs/qbs_cpp.lua
deleted file mode 100644
index 4d76e178728..00000000000
--- a/3rdparty/genie/src/actions/qbs/qbs_cpp.lua
+++ /dev/null
@@ -1,285 +0,0 @@
---
--- GENie - Project generator tool
--- https://github.com/bkaradzic/GENie#license
---
-
-local qbs = premake.qbs
-
-local function is_excluded(prj, cfg, file)
- if table.icontains(prj.excludes, file) then
- return true
- end
-
- if table.icontains(cfg.excludes, file) then
- return true
- end
-
- return false
-end
-
-function qbs.generate_project(prj)
-
- local indent = 0
-
- _p(indent, '/*')
- _p(indent, ' * QBS project file autogenerated by GENie')
- _p(indent, ' * https://github.com/bkaradzic/GENie')
- _p(indent, ' */')
- _p(indent, '')
- _p(indent, 'import qbs 1.0')
- _p(indent, '')
-
- if prj.kind == "ConsoleApp" then
- _p(indent, 'CppApplication {')
- _p(indent + 1, 'consoleApplication: true')
- elseif prj.kind == "WindowedApp" then
- _p(indent, 'CppApplication {')
- _p(indent + 1, 'consoleApplication: false')
- elseif prj.kind == "StaticLib" then
- _p(indent, 'StaticLibrary {')
- elseif prj.kind == "SharedLib" then
- _p(indent, 'DynamicLibrary {')
- end
-
- indent = indent + 1
- _p(indent, 'name: "' .. prj.name .. '"')
-
--- _p(indent, 'cpp.enableReproducibleBuilds: true')
-
- _p(indent, 'Depends { name: "cpp" }')
-
- -- List dependencies, if there are any
- local deps = premake.getdependencies(prj)
- if #deps > 0 then
- for _, depprj in ipairs(deps) do
- _p(indent, 'Depends { name: "%s" }', depprj.name)
- end
- end
-
- local cc = premake.gettool(prj)
- local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native")
-
- for _, platform in ipairs(platforms) do
- for cfg in premake.eachconfig(prj, platform) do
-
- if cfg.platform ~= "Native" then
-
- _p('');
- _p(indent, 'Properties { /* %s */', premake.getconfigname(cfg.name, cfg.platform, true))
-
- indent = indent + 1
-
- local arch = ""
- local linkerFlags = cfg.linkoptions
-
- if cfg.platform == "x32" then
- arch = '&& qbs.architecture == "x86"'
--- table.insert(linkerFlags, "-m32")
- elseif cfg.platform == "x64" then
- arch = '&& qbs.architecture == "x86_64"'
--- table.insert(linkerFlags, "-m64")
- end
-
- if cfg.name == "Debug" then
- _p(indent, 'condition: qbs.buildVariant == "debug" %s', arch)
- else
- _p(indent, 'condition: qbs.buildVariant == "release" %s', arch)
- end
-
- _p(indent, 'targetName: "%s"', cfg.buildtarget.basename)
- _p(indent, 'destinationDirectory: "%s"', path.getabsolute('projects/qbs/' .. cfg.buildtarget.directory) .. '/')
--- _p(indent, 'fileTagsFilter: "application"')
--- _p(indent, 'qbs.install: true')
--- _p(indent, 'qbs.installDir: "%s"', cfg.buildtarget.directory)
--- _p(indent, 'buildDirectory: "%s"', cfg.objectsdir)
-
--- qbs.list(
--- indent
--- , "cpp.cppFlags"
--- , cc.getcppflags(cfg)
--- )
-
- if cfg.flags.Cpp11 then
- _p(indent, 'cpp.cxxLanguageVersion: "c++11"')
- elseif cfg.flags.Cpp14 then
- _p(indent, 'cpp.cxxLanguageVersion: "c++14"')
- elseif cfg.flags.Cpp17 then
- _p(indent, 'cpp.cxxLanguageVersion: "c++17"')
- else
- _p(indent, 'cpp.cxxLanguageVersion: "c++98"')
- end
-
- if os.is("windows") then
- if not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then
- if cfg.flags.Unicode then
- _p(indent, 'cpp.entryPoint: "wmainCRTStartup"')
- else
- _p(indent, 'cpp.entryPoint: "mainCRTStartup"')
- end
- end
- end
-
- qbs.list(
- indent
- , "cpp.commonCompilerFlags"
- , cfg.buildoptions
- )
-
- qbs.list(
- indent
- , "cpp.cFlags"
- , cfg.buildoptions_c
- )
-
- qbs.list(
- indent
- , "cpp.cxxFlags"
- , cfg.buildoptions_cpp
- )
-
- qbs.list(
- indent
- , "cpp.objcFlags"
- , cfg.buildoptions_objc
- )
-
- qbs.list(
- indent
- , "cpp.objcxxFlags"
- , cfg.buildoptions_objc
- )
-
- if cfg.flags.StaticRuntime then
- _p(indent, 'cpp.runtimeLibrary: "static"')
- else
- _p(indent, 'cpp.runtimeLibrary: "dynamic"')
- end
-
- if cfg.flags.PedanticWarnings
- or cfg.flags.ExtraWarnings
- then
- _p(indent, 'cpp.warningLevel: "all"')
- else
- _p(indent, 'cpp.warningLevel: "default"')
- end
-
- if cfg.flags.FatalWarnings then
- _p(indent, 'cpp.treatWarningsAsErrors: true')
- else
- _p(indent, 'cpp.treatWarningsAsErrors: false')
- end
-
- if cfg.flags.NoRTTI then
- _p(indent, 'cpp.enableRtti: false')
- else
- _p(indent, 'cpp.enableRtti: true')
- end
-
- if cfg.flags.NoExceptions then
- _p(indent, 'cpp.enableExceptions: false')
- else
- _p(indent, 'cpp.enableExceptions: true')
- end
-
- if cfg.flags.Symbols then
- _p(indent, 'cpp.debugInformation: true')
- else
- _p(indent, 'cpp.debugInformation: false')
- end
-
- if cfg.flags.Unicode then
- _p(indent, 'cpp.windowsApiCharacterSet: "unicode"')
- else
- _p(indent, 'cpp.windowsApiCharacterSet: ""')
- end
-
- if not cfg.pchheader or cfg.flags.NoPCH then
- _p(indent, 'cpp.usePrecompiledHeader: false')
- else
- _p(indent, 'cpp.usePrecompiledHeader: true')
- _p(indent, 'Group {')
- _p(indent+1, 'name: "PCH"')
- _p(indent+1, 'files: ["' .. cfg.pchheader .. '"]')
- _p(indent+1, 'fileTags: ["cpp_pch_src"]')
- _p(indent, '}')
- end
-
- for _, value in ipairs(cfg.flags) do
- if (value == "Optimize") then
- elseif (value == "OptimizeSize") then
- _p(indent, 'cpp.optimization: "small"')
- elseif (value == "OptimizeSpeed") then
- _p(indent, 'cpp.optimization: "fast"')
- end
- end
-
- qbs.list(
- indent
- , "cpp.defines"
- , cfg.defines
- )
-
- local sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)
- table.sort(sortedincdirs, includesort)
- qbs.list(
- indent
- , "cpp.includePaths"
- , sortedincdirs
- )
-
- qbs.list(
- indent
- , "cpp.staticLibraries"
- , premake.getlinks(cfg, "system", "fullpath")
- )
-
- qbs.list(
- indent
- , "cpp.libraryPaths"
- , cfg.libdirs
- )
-
- qbs.list(
- indent
- , "cpp.linkerFlags"
- , linkerFlags
- )
-
- table.sort(prj.files)
- if #prj.files > 0 then
- _p(indent, 'files: [')
- for _, file in ipairs(prj.files) do
- if path.iscfile(file)
- or path.iscppfile(file)
- or path.isobjcfile(file)
- or path.isresourcefile(file)
- or path.iscppheader(file) then
- if not is_excluded(prj, cfg, file) then
- _p(indent+1, '"%s",', file)
- end
- end
- end
- _p(indent+1, ']')
- end
-
- if #prj.excludes > 0 then
- _p(indent, 'excludeFiles: [')
- table.sort(prj.excludes)
- for _, file in ipairs(prj.excludes) do
- if path.issourcefile(file) then
- _p(indent+1, '"%s",', file)
- end
- end
- _p(indent+1, ']')
- end
-
- indent = indent - 1
- _p(indent, '}');
- end
- end
- end
-
- indent = indent - 1
-
- _p(indent, '}')
-end
diff --git a/3rdparty/genie/src/actions/qbs/qbs_solution.lua b/3rdparty/genie/src/actions/qbs/qbs_solution.lua
deleted file mode 100644
index d912617dae1..00000000000
--- a/3rdparty/genie/src/actions/qbs/qbs_solution.lua
+++ /dev/null
@@ -1,251 +0,0 @@
---
--- GENie - Project generator tool
--- https://github.com/bkaradzic/GENie#license
---
-
-local qbs = premake.qbs
-
-function qbs.generate_solution(sln)
-
- _p('/*')
- _p(' * QBS project file autogenerated by GENie')
- _p(' * https://github.com/bkaradzic/GENie')
- _p(' */')
- _p('')
- _p('import qbs')
- _p('')
-
- _p(0, 'Project {')
-
- _p(1, 'references: [')
- for prj in premake.solution.eachproject(sln) do
- _p(2, '"' .. prj.name .. '.qbs",')
- end
- _p(1, ']')
-
- _p(0, '}')
-end
-
-local function is_app(kind)
- if kind == "ConsoleApp" or kind == "WindowedApp" then
- return true
- end
-
- return false
-end
-
-function qbs.generate_user(sln)
-
- _p(0, '<?xml version="1.0" encoding="UTF-8"?>')
- _p(0, '<!DOCTYPE QtCreatorProject>')
- _p(0, '<!-- QBS project file autogenerated by GENie https://github.com/bkaradzic/GENie -->')
- _p(0, '<qtcreator>')
-
- local startProject = 0
- local idx = 0
-
- for prj in premake.solution.eachproject(sln) do
- if is_app(prj.kind) then
- if sln.startproject == prj.name then
- startProject = idx
- end
- idx = idx + 1
- end
- end
-
- _p(1, '<data>')
- _p(2, '<variable>ProjectExplorer.Project.Target.0</variable>')
-
- _p(2, '<valuemap type="QVariantMap">')
-
- _p(3, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>')
- _p(3, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>')
-
- local qbsguid = ""
- local qbsprofile = ""
-
- local qtcreatordir = ""
-
- if _OS == "windows" then
- qtcreatordir = path.join(os.getenv("APPDATA"), "QtProject/qtcreator")
- else
- qtcreatordir = path.join(os.getenv("HOME"), ".config/QtProject/qtcreator")
- end
-
- local file = io.open(path.join(qtcreatordir, "qbs.conf"))
- if file == nil then
- file = io.open(path.join(qtcreatordir, "qbs/1.6.0/qbs.conf"))
- end
-
- if file ~= nil then
- for line in file:lines() do
- if line == "[org]" then
- -- BK - Need to figure out how to extract kit associated profile name/guid...
- -- ~.config/QtProject/qtcreator/qbs.conf
- --
- -- [org]
- -- qt-project\qbs\preferences\qtcreator\kit\%7B9926e565-8fc0-448d-9d5d-4b0293efd443%7D=qtc_Desktop_1bffddf2
- --
- local str = 'qt-project\\qbs\\preferences\\qtcreator\\kit\\%'
- local index = string.len(str)+1
- for line in file:lines() do
- if index == string.find(line, '7B', index) then
- line = string.sub(line, index+2)
- qbsguid = string.sub(line, 1, 36)
- qbsprofile = string.sub(line, 41)
- --print(qbsguid, qbsprofile)
- break
- end
- end
- else
- -- ~/.config/QtProject/qtcreator/qbs/1.6.0/qbs.conf
- --
- -- <key>org.qt-project.qbs.preferences.qtcreator.kit.{d67ae030-7a33-43e0-850a-afe9e47fe5e1}</key>
- -- <string>qtc_Desktop_ee88281c</string>
-
- local str = '\t<key>org.qt-project.qbs.preferences.qtcreator.kit.'
- local index = string.len(str)+1
- for line in file:lines() do
- if qbsguid == "" and index == string.find(line, '{', index) then
- line = string.sub(line, index+1)
- qbsguid = string.sub(line, 1, 36)
- elseif qbsguid ~= "" then
- qbsprofile = string.sub(line, 10, 29)
- --print(qbsguid, qbsprofile)
- break
- end
- end
- end
-
- break
- end
- io.close(file)
- end
-
- _p(3, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{%s}</value>', qbsguid)
-
- _p(3, '<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>')
- _p(3, '<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>')
- _p(3, '<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">%d</value>', startProject)
-
- -- BuildConfiguration
- idx = 0
- for _, cfgname in ipairs(sln.configurations) do
- -- cfg.objectsdir
- _p(3, '<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.%d">', idx)
- _p(4, '<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">build</value>')
- _p(4, '<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">')
- _p(5, '<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">')
- _p(6, '<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>')
- _p(6, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>')
- _p(6, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qbs Build</value>')
- _p(6, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qbs.BuildStep</value>')
- _p(6, '<value type="bool" key="Qbs.CleanInstallRoot">false</value>')
- _p(6, '<valuemap type="QVariantMap" key="Qbs.Configuration">')
- _p(7, '<value type="QString" key="qbs.buildVariant">%s</value>', cfgname:lower())
- _p(7, '<value type="QString" key="qbs.profile">%s</value>', qbsprofile)
- _p(6, '</valuemap>')
- _p(5, '</valuemap>')
- _p(5, '<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>')
- _p(5, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>')
- _p(5, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>')
- _p(5, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>')
- _p(4, '</valuemap>')
- _p(4, '<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">')
- _p(5, '<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">')
- _p(6, '<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>')
- _p(6, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>')
- _p(6, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qbs Clean</value>')
- _p(6, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qbs.CleanStep</value>')
- _p(6, '<value type="bool" key="Qbs.CleanAll">true</value>')
- _p(6, '<value type="bool" key="Qbs.DryKeepGoing">false</value>')
- _p(6, '<value type="bool" key="Qbs.DryRun">false</value>')
- _p(5, '</valuemap>')
- _p(5, '<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>')
- _p(5, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>')
- _p(5, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>')
- _p(5, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>')
- _p(4, '</valuemap>')
- _p(4, '<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>')
- _p(4, '<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>')
- _p(4, '<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>')
- _p(4, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">%s</value>', cfgname)
- _p(4, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>')
- _p(4, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qbs.QbsBuildConfiguration</value>')
- _p(3, '</valuemap>')
-
- idx = idx + 1
- end
-
- _p(3, '<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">%d</value>', idx)
-
- -- DeployConfiguration
- _p(3, '<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">')
- _p(4, '<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">')
- _p(5, '<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>')
- _p(5, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>')
- _p(5, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>')
- _p(5, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>')
- _p(4, '</valuemap>')
- _p(4, '<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>')
- _p(4, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>')
- _p(4, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qbs Install</value>')
- _p(4, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qbs.Deploy</value>')
- _p(3, '</valuemap>')
- _p(3, '<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>')
-
- -- PluginSettings
--- _p(3, '<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>')
-
- -- RunConfiguration
- idx = 0
- for prj in premake.solution.eachproject(sln) do
-
- if is_app(prj.kind) then
--- _p(3, '<variable>ProjectExplorer.Project.Target.%d</variable>', idx)
-
- _p(3, '<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.%d">', idx)
-
- if idx == startProject then
- _p(4, '<value type="int" key="PE.EnvironmentAspect.Base">2</value>')
- else
- _p(4, '<value type="int" key="PE.EnvironmentAspect.Base">-1</value>')
- end
- _p(4, '<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>')
- _p(4, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">%s</value>', prj.name)
- _p(4, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>')
- _p(4, '<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qbs.RunConfiguration:%s.%s---Qbs.RC.NameSeparator---%s</value>', prj.name, qbsprofile, prj.name)
-
- _p(4, '<value type="QString" key="Qbs.RunConfiguration.CommandLineArguments"></value>')
-
- local cfg = premake.getconfig(prj, nil, nil)
- if cfg.debugdir ~= nil then
- _p(4, '<value type="QString" key="Qbs.RunConfiguration.WorkingDirectory">%s</value>', cfg.debugdir)
- else
- _p(4, '<value type="QString" key="Qbs.RunConfiguration.WorkingDirectory"></value>')
- end
-
- _p(3, '</valuemap>')
-
- idx = idx + 1
- end
- end
-
- _p(3, '<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">%d</value>', idx)
-
- _p(2, '</valuemap>')
- _p(1, '</data>')
-
- _p(1, '<data>')
- _p(2, '<variable>ProjectExplorer.Project.TargetCount</variable>')
- _p(2, '<value type="int">1</value>')
- _p(1, '</data>')
-
- _p(1, '<data>')
- _p(2, '<variable>Version</variable>')
- _p(2, '<value type="int">18</value>')
- _p(1, '</data>')
-
- _p(0, '</qtcreator>')
-
-end
diff --git a/3rdparty/genie/src/actions/vstudio/_vstudio.lua b/3rdparty/genie/src/actions/vstudio/_vstudio.lua
index 94bf748dc57..337fda88731 100644
--- a/3rdparty/genie/src/actions/vstudio/_vstudio.lua
+++ b/3rdparty/genie/src/actions/vstudio/_vstudio.lua
@@ -17,7 +17,7 @@
vs2015 = "v140",
vs2017 = "v141",
vs2019 = "v142",
- vsllvm = "llvm",
+ vs2022 = "v143",
}
premake.vstudio.toolset = toolsets[_ACTION] or "unknown?"
premake.vstudio.splashpath = ''
@@ -32,21 +32,25 @@
--
vstudio.platforms = {
- any = "Any CPU",
- mixed = "Mixed Platforms",
- Native = "Win32",
- x86 = "x86",
- x32 = "Win32",
- x64 = "x64",
- PS3 = "PS3",
- Xbox360 = "Xbox 360",
- ARM = "ARM",
- Orbis = "ORBIS",
- Durango = "Durango",
- TegraAndroid = "Tegra-Android",
- NX32 = "NX32",
- NX64 = "NX64",
- Emscripten = "Emscripten",
+ any = "Any CPU",
+ mixed = "Mixed Platforms",
+ Native = "Win32",
+ x86 = "x86",
+ x32 = "Win32",
+ x64 = "x64",
+ PS3 = "PS3",
+ Xbox360 = "Xbox 360",
+ ARM = "ARM",
+ ARM64 = "ARM64",
+ Orbis = "ORBIS",
+ Durango = "Durango",
+ TegraAndroid = "Tegra-Android",
+ NX32 = "NX32",
+ NX64 = "NX64",
+ Emscripten = "Emscripten",
+ ["gdk-desktop"] = "Gaming.Desktop.x64",
+ ["gdk-xboxone"] = "Gaming.Xbox.XboxOne.x64",
+ ["gdk-scarlett"] = "Gaming.Xbox.Scarlett.x64",
}
@@ -72,6 +76,27 @@
+ function vstudio.isgdkconsole(cfg)
+ for _,p in pairs({"gdk-xboxone", "gdk-scarlett"}) do
+ if cfg.platform == p then
+ return true
+ end
+ end
+ return false
+ end
+
+
+
+ function vstudio.isgdkdesktop(cfg)
+ return cfg.platform == "gdk-desktop"
+ end
+
+
+
+ function vstudio.isgdk(cfg)
+ return vstudio.isgdkconsole(cfg) or vstudio.isgdkdesktop(cfg)
+ end
+
--
-- Process the solution's list of configurations and platforms, creates a list
-- of build configuration/platform pairs in a Visual Studio compatible format.
diff --git a/3rdparty/genie/src/actions/vstudio/vsllvm.lua b/3rdparty/genie/src/actions/vstudio/vs2022.lua
index d6c6d1ddb53..2e0d3e940fd 100644
--- a/3rdparty/genie/src/actions/vstudio/vsllvm.lua
+++ b/3rdparty/genie/src/actions/vstudio/vs2022.lua
@@ -1,22 +1,22 @@
--
--- vsllvm.lua
--- Baseline support for Visual Studio LLVM.
+-- vs2022.lua
+-- Baseline support for Visual Studio 2022.
--
- premake.vstudio.vcllvm = {}
- local vcllvm = premake.vstudio.vcllvm
+ premake.vstudio.vc2022 = {}
+ local vc2022 = premake.vstudio.vc2022
local vstudio = premake.vstudio
---
--- Register a command-line action for Visual Studio llvm.
+-- Register a command-line action for Visual Studio 2022.
---
newaction
{
- trigger = "vsllvm",
- shortname = "Visual Studio LLVM",
- description = "Generate Microsoft Visual Studio LLVM project files",
+ trigger = "vs2022",
+ shortname = "Visual Studio 2022",
+ description = "Generate Microsoft Visual Studio 2022 project files",
os = "windows",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
@@ -55,10 +55,10 @@
vstudio = {
solutionVersion = "12",
- targetFramework = "4.5.2",
- toolsVersion = "15.0",
- windowsTargetPlatformVersion = "8.1",
+ targetFramework = "4.7.2",
+ toolsVersion = "16.0",
+ windowsTargetPlatformVersion = "10.0",
supports64bitEditContinue = true,
- intDirAbsolute = true,
+ intDirAbsolute = false,
}
}
diff --git a/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua b/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua
index 8115798c8a2..a7162cc8ede 100644
--- a/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua
+++ b/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua
@@ -85,8 +85,10 @@
function sln2005.header(sln)
local action = premake.action.current()
_p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion)
- if(_ACTION:sub(3) == "2015" or _ACTION:sub(3) == "2017" or _ACTION:sub(3) == "llvm") then
+ if(_ACTION:sub(3) == "2015" or _ACTION:sub(3) == "2017") then
_p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2))
+ elseif(_ACTION:sub(3) == "2019") then
+ _p('# Visual Studio Version %s', action.vstudio.toolsVersion:sub(1,2))
else
_p('# Visual Studio %s', _ACTION:sub(3))
end
@@ -199,6 +201,10 @@
if premake.vstudio.iswinrt() and prj.kind == "WindowedApp" then
_p('\t\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)
end
+
+ if premake.vstudio.isgdk(cfg) and prj.kind == "WindowedApp" then
+ _p('\t\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)
+ end
end
end
end
@@ -258,4 +264,4 @@
end
_p('\tEndGlobalSection')
- end \ No newline at end of file
+ end
diff --git a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua
index 678d54f364a..dd9c1c63097 100644
--- a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua
+++ b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua
@@ -66,13 +66,6 @@
else
_p(2, '<Keyword>Win32Proj</Keyword>')
end
- if _ACTION:sub(3) == "2015" or _ACTION:sub(3) == "2017" or _ACTION:sub(3) == "2019" or _ACTION:sub(3) == "llvm" then
- _p(2,'<PreferredToolArchitecture>x64</PreferredToolArchitecture>')
- end
- if (_ACTION:sub(3) == "2017" or _ACTION:sub(3) == "llvm")
- and os.isdir(path.join(os.getenv("VSINSTALLDIR"), "VC/Tools/MSVC/14.14.26428")) then
- _p(2,'<VCToolsVersion>14.14.26428</VCToolsVersion>')
- end
if not vstudio.xpwarning then
_p(2, '<XPDeprecationWarning>false</XPDeprecationWarning>')
@@ -123,7 +116,8 @@
, premake.esc(cfginfo.name))
local is2019 = premake.action.current() == premake.action.get("vs2019")
- if is2019 then
+ local is2022 = premake.action.current() == premake.action.get("vs2022")
+ if is2019 or is2022 then
_p(2, '<VCProjectVersion>%s</VCProjectVersion>', action.vstudio.toolsVersion)
if cfg.flags.UnitySupport then
_p(2, '<EnableUnitySupport>true</EnableUnitySupport>')
@@ -137,14 +131,6 @@
_p(2, '<PreferredToolArchitecture>x64</PreferredToolArchitecture>')
end
- if cfg.flags.MFC then
- _p(2,'<UseOfMfc>%s</UseOfMfc>', iif(cfg.flags.StaticRuntime, "Static", "Dynamic"))
- end
-
- if cfg.flags.ATL or cfg.flags.StaticATL then
- _p(2,'<UseOfAtl>%s</UseOfAtl>', iif(cfg.flags.StaticATL, "Static", "Dynamic"))
- end
-
if cfg.flags.Unicode then
_p(2,'<CharacterSet>Unicode</CharacterSet>')
end
@@ -201,7 +187,8 @@
if #cfg.propertysheets > 0 then
local dirs = cfg.propertysheets
for _, dir in ipairs(dirs) do
- _p(2,'<Import Project="%s" />', path.translate(dir))
+ local translated = path.translate(dir)
+ _p(2,'<Import Project="%s" Condition="exists(\'%s\')" />', translated, translated)
end
end
@@ -245,6 +232,14 @@
_p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>', tostring(ignore))
end
+ if cfg.platform == "NX32" or cfg.platform == "NX64" then
+ if cfg.flags.Cpp17 then
+ _p(2,'<CppLanguageStandard>Gnu++17</CppLanguageStandard>')
+ elseif cfg.flags.Cpp20 then
+ _p(2,'<CppLanguageStandard>Gnu++20</CppLanguageStandard>')
+ end
+ end
+
if cfg.platform == "Durango" then
_p(2, '<ReferencePath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</ReferencePath>')
_p(2, '<LibraryPath>$(Console_SdkLibPath)</LibraryPath>')
@@ -266,6 +261,19 @@
_p(2, '<IsolateConfigurationsOnDeploy>true</IsolateConfigurationsOnDeploy>')
end
+ if vstudio.isgdkconsole(cfg) then
+ _p(2, '<ExecutablePath>$(Console_SdkRoot)bin;$(Console_SdkToolPath);$(ExecutablePath)</ExecutablePath>')
+ _p(2, '<IncludePath>$(Console_SdkIncludeRoot)</IncludePath>')
+ _p(2, '<ReferencePath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</ReferencePath>')
+ _p(2, '<LibraryPath>$(Console_SdkLibPath)</LibraryPath>')
+ _p(2, '<LibraryWPath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</LibraryWPath>')
+ end
+
+ if vstudio.isgdkdesktop(cfg) then
+ _p(2, '<IncludePath>$(Console_SdkIncludeRoot);$(IncludePath)</IncludePath>')
+ _p(2, '<LibraryPath>$(Console_SdkLibPath);$(LibraryPath)</LibraryPath>')
+ end
+
if cfg.kind ~= "StaticLib" then
_p(2,'<LinkIncremental>%s</LinkIncremental>', tostring(premake.config.isincrementallink(cfg)))
end
@@ -333,6 +341,13 @@
end
end
+ local function include_resdirs(indent,cfg)
+ if #cfg.resincludedirs> 0 then
+ _p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'
+ ,premake.esc(path.translate(table.concat(cfg.resincludedirs, ";"), '\\')))
+ end
+ end
+
local function using_dirs(indent,cfg)
if #cfg.usingdirs > 0 then
_p(indent,'<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>'
@@ -343,15 +358,17 @@
local function resource_compile(cfg)
_p(2,'<ResourceCompile>')
preprocessor(3,cfg,true)
- include_dirs(3,cfg)
+ include_resdirs(3,cfg)
_p(2,'</ResourceCompile>')
end
- local function cppstandard_vs2017_or_2019(cfg)
+ local function cppstandard(cfg)
if cfg.flags.CppLatest then
_p(3, '<LanguageStandard>stdcpplatest</LanguageStandard>')
_p(3, '<EnableModules>true</EnableModules>')
+ elseif cfg.flags.Cpp20 then
+ _p(3, '<LanguageStandard>stdcpp20</LanguageStandard>')
elseif cfg.flags.Cpp17 then
_p(3, '<LanguageStandard>stdcpp17</LanguageStandard>')
elseif cfg.flags.Cpp14 then
@@ -368,6 +385,12 @@
if cfg.flags.NoExceptions then
_p(3, '<GccExceptionHandling>false</GccExceptionHandling>')
end
+ elseif cfg.platform == "NX32" or cfg.platform == "NX64" then
+ if cfg.flags.NoExceptions then
+ _p(3, '<CppExceptions>false</CppExceptions>')
+ else
+ _p(3, '<CppExceptions>true</CppExceptions>')
+ end
else
if cfg.flags.NoExceptions then
_p(3, '<ExceptionHandling>false</ExceptionHandling>')
@@ -419,6 +442,10 @@
end
elseif cfg.platform == "TegraAndroid" then
-- TODO: tegra setting
+ elseif cfg.platform == "NX32" or cfg.platform == "NX64" then
+ if cfg.flags.FloatFast then
+ _p(3, '<FastMath>true</FastMath>')
+ end
else
if cfg.flags.FloatFast then
_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')
@@ -487,6 +514,11 @@
_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))
end
+ if cfg.platform == "NX32" or cfg.platform == "NX64" then
+ unsignedChar = "-funsigned-char ";
+ _p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))
+ end
+
if cfg.language == "C" and not cfg.options.ForceCPP then
buildoptions = table.join(buildoptions, cfg.buildoptions_c)
else
@@ -528,6 +560,17 @@
else
_p(3,'<OptimizationLevel>O2</OptimizationLevel>')
end
+ elseif cfg.platform == "NX32" or cfg.platform == "NX64" then
+ local opt = optimisation(cfg)
+ if opt == "Disabled" then
+ _p(3,'<OptimizationLevel>O0</OptimizationLevel>')
+ elseif opt == "MinSpace" then
+ _p(3,'<OptimizationLevel>Os</OptimizationLevel>')
+ elseif opt == "MaxSpeed" then
+ _p(3,'<OptimizationLevel>O3</OptimizationLevel>')
+ else
+ _p(3,'<OptimizationLevel>O2</OptimizationLevel>')
+ end
else
_p(3,'<Optimization>%s</Optimization>', optimisation(cfg))
end
@@ -613,6 +656,23 @@
if cfg.flags.FatalWarnings then
_p(3, '<WarningsAsErrors>true</WarningsAsErrors>')
end
+ elseif cfg.platform == "NX32" or cfg.platform == "NX64" then
+ if cfg.flags.PedanticWarnings then
+ _p(3, '<Warnings>MoreWarnings</Warnings>')
+ _p(3, '<ExtraWarnings>true</ExtraWarnings>')
+ elseif cfg.flags.ExtraWarnings then
+ _p(3, '<Warnings>NormalWarnings</Warnings>')
+ _p(3, '<ExtraWarnings>true</ExtraWarnings>')
+ elseif cfg.flags.MinimumWarnings then
+ _p(3, '<Warnings>WarningsOff</Warnings>')
+ _p(3, '<ExtraWarnings>false</ExtraWarnings>')
+ else
+ _p(3, '<Warnings>NormalWarnings</Warnings>')
+ _p(3, '<ExtraWarnings>false</ExtraWarnings>')
+ end
+ if cfg.flags.FatalWarnings then
+ _p(3, '<WarningsAsErrors>true</WarningsAsErrors>')
+ end
else
if cfg.flags.PedanticWarnings then
_p(3, '<WarningLevel>EnableAllWarnings</WarningLevel>')
@@ -630,8 +690,9 @@
end
if premake.action.current() == premake.action.get("vs2017") or
- premake.action.current() == premake.action.get("vs2019") then
- cppstandard_vs2017_or_2019(cfg)
+ premake.action.current() == premake.action.get("vs2019") or
+ premake.action.current() == premake.action.get("vs2022") then
+ cppstandard(cfg)
end
exceptions(cfg)
@@ -642,10 +703,6 @@
floating_point(cfg)
debug_info(cfg)
- if _ACTION:sub(3) == "llvm" then
- _p(3,'<SupportJustMyCode>false</SupportJustMyCode>')
- end
-
if cfg.flags.Symbols then
-- The compiler pdb should be different than the linker pdb, and
-- the linker pdb is what should be distributed and used for
@@ -727,16 +784,13 @@
end
end
- local function item_def_lib(prj, cfg)
+ local function item_def_lib(cfg)
-- The Xbox360 project files are stored in another place in the project file.
if cfg.kind == 'StaticLib' and cfg.platform ~= "Xbox360" then
_p(1,'<Lib>')
_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)
additional_options(2,cfg)
link_target_machine(2,cfg)
- if _ACTION:sub(3) == "llvm" and prj.name == "portaudio" then -- MSVC-LLVM needs special help
- _p(2,'<AdditionalDependencies>ksuser.lib;%%(AdditionalDependencies)</AdditionalDependencies>')
- end
_p(1,'</Lib>')
end
end
@@ -833,7 +887,7 @@
-- _WIN64: For 64-bit platforms
-- _EXPORT: `EXPORT` for shared libraries, empty for other project kinds
table.insertflat(defines, iif(premake.config.isdebugbuild(cfg), "_DEBUG", {}))
- table.insert(defines, iif(cfg.platform == "x64", "_WIN64", "_WIN32"))
+ table.insert(defines, iif(cfg.platform == "x64" or cfg.platform == "ARM64", "_WIN64", "_WIN32"))
table.insert(defines, iif(prj.kind == "SharedLib", "_EXPORT=EXPORT", "_EXPORT="))
_p(3, '<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'
@@ -878,12 +932,12 @@
function vc2010.link(cfg)
local vs2017OrLater = premake.action.current() == premake.action.get("vs2017") or
premake.action.current() == premake.action.get("vs2019")
- local vsllvm = premake.action.current() == premake.action.get("vsllvm")
local links = getcfglinks(cfg)
_p(2,'<Link>')
_p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == "ConsoleApp", "Console", "Windows"))
- if (vs2017OrLater or vsllvm) and cfg.flags.FullSymbols then
+
+ if vs2017OrLater and cfg.flags.FullSymbols then
_p(3,'<GenerateDebugInformation>DebugFull</GenerateDebugInformation>')
else
_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))
@@ -1019,15 +1073,18 @@
deps = "-Wl,--start-group;" .. deps .. ";-Wl,--end-group"
end
- _p(tab, '<AdditionalDependencies>%s;%s</AdditionalDependencies>'
- , deps
- , iif(cfg.platform == "Durango"
- , '%(XboxExtensionsDependencies)'
- , '%(AdditionalDependencies)'
- )
- )
+ local adddeps =
+ iif(cfg.platform == "Durango", '%(XboxExtensionsDependencies)'
+ , iif(vstudio.isgdkconsole(cfg), '$(Console_Libs);%(XboxExtensionsDependencies);%(AdditionalDependencies)'
+ , iif(vstudio.isgdkdesktop(cfg), '$(Console_Libs);%(AdditionalDependencies)'
+ , '%(AdditionalDependencies)')))
+ _p(tab, '<AdditionalDependencies>%s;%s</AdditionalDependencies>', deps, adddeps)
elseif cfg.platform == "Durango" then
_p(tab, '<AdditionalDependencies>%%(XboxExtensionsDependencies)</AdditionalDependencies>')
+ elseif vstudio.isgdkconsole(cfg) then
+ _p(tab, '<AdditionalDependencies>$(Console_Libs);%%(XboxExtensionsDependencies);%%(AdditionalDependencies)</AdditionalDependencies>')
+ elseif vstudio.isgdkdesktop(cfg) then
+ _p(tab, '<AdditionalDependencies>$(Console_Libs);%%(AdditionalDependencies)</AdditionalDependencies>')
end
end
@@ -1082,7 +1139,7 @@
,premake.esc(cfginfo.name))
vs10_clcompile(cfg)
resource_compile(cfg)
- item_def_lib(prj, cfg)
+ item_def_lib(cfg)
vc2010.link(cfg)
ant_build(prj, cfg)
event_hooks(cfg)
@@ -1092,7 +1149,6 @@
end
end
-
--
-- Retrieve a list of files for a particular build group, like
-- "ClInclude", "ClCompile", "ResourceCompile", "MASM", "None", etc.
diff --git a/3rdparty/genie/src/actions/xcode/xcode10.lua b/3rdparty/genie/src/actions/xcode/xcode10.lua
index f8ae0b42cac..a412e24f048 100644
--- a/3rdparty/genie/src/actions/xcode/xcode10.lua
+++ b/3rdparty/genie/src/actions/xcode/xcode10.lua
@@ -70,7 +70,7 @@
{
trigger = "xcode10",
shortname = "Xcode 10",
- description = "Generate Apple Xcode 10 project files (experimental)",
+ description = "Generate Apple Xcode 10 project files",
os = "macosx",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
diff --git a/3rdparty/genie/src/actions/xcode/xcode11.lua b/3rdparty/genie/src/actions/xcode/xcode11.lua
new file mode 100644
index 00000000000..ff19bfd3793
--- /dev/null
+++ b/3rdparty/genie/src/actions/xcode/xcode11.lua
@@ -0,0 +1,91 @@
+--
+-- xcode11.lua
+-- Define the Apple XCode 11.0 action and support functions.
+--
+
+ local premake = premake
+ premake.xcode11 = { }
+
+ local xcode = premake.xcode
+ local xcode10 = premake.xcode10
+ local xcode11 = premake.xcode11
+
+ function xcode11.XCBuildConfiguration_Target(tr, target, cfg)
+ local options = xcode10.XCBuildConfiguration_Target(tr, target, cfg)
+ options.CODE_SIGN_IDENTITY = "-"
+ return options
+ end
+
+ function xcode11.project(prj)
+ local tr = xcode.buildprjtree(prj)
+ xcode.Header(tr, 48)
+ xcode.PBXBuildFile(tr)
+ xcode.PBXContainerItemProxy(tr)
+ xcode.PBXFileReference(tr,prj)
+ xcode.PBXFrameworksBuildPhase(tr)
+ xcode.PBXGroup(tr)
+ xcode.PBXNativeTarget(tr)
+ xcode.PBXProject(tr, "8.0")
+ xcode.PBXReferenceProxy(tr)
+ xcode.PBXResourcesBuildPhase(tr)
+ xcode.PBXShellScriptBuildPhase(tr)
+ xcode.PBXCopyFilesBuildPhase(tr)
+ xcode.PBXSourcesBuildPhase(tr,prj)
+ xcode.PBXVariantGroup(tr)
+ xcode.PBXTargetDependency(tr)
+ xcode.XCBuildConfiguration(tr, prj, {
+ ontarget = xcode11.XCBuildConfiguration_Target,
+ onproject = xcode10.XCBuildConfiguration_Project,
+ })
+ xcode.XCBuildConfigurationList(tr)
+ xcode.Footer(tr)
+ end
+ --]]
+
+
+--
+-- xcode11 action
+--
+
+ newaction
+ {
+ trigger = "xcode11",
+ shortname = "Xcode 11",
+ description = "Generate Apple Xcode 11 project files",
+ os = "macosx",
+
+ valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
+
+ valid_languages = { "C", "C++" },
+
+ valid_tools = {
+ cc = { "gcc" },
+ },
+
+ valid_platforms = { Native = "Native" },
+ default_platform = "Native",
+
+ onsolution = function(sln)
+ premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", xcode.workspace_generate)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", xcode.workspace_settings)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme", xcode.workspace_scheme)
+ end,
+
+ onproject = function(prj)
+ premake.generate(prj, "%%.xcodeproj/project.pbxproj", xcode11.project)
+ xcode.generate_schemes(prj, "%%.xcodeproj/xcshareddata/xcschemes")
+ end,
+
+ oncleanproject = function(prj)
+ premake.clean.directory(prj, "%%.xcodeproj")
+ premake.clean.directory(prj, "%%.xcworkspace")
+ end,
+
+ oncheckproject = xcode.checkproject,
+
+ xcode = {
+ iOSTargetPlatformVersion = nil,
+ macOSTargetPlatformVersion = nil,
+ tvOSTargetPlatformVersion = nil,
+ },
+ }
diff --git a/3rdparty/genie/src/actions/xcode/xcode14.lua b/3rdparty/genie/src/actions/xcode/xcode14.lua
new file mode 100644
index 00000000000..2b17166ad0c
--- /dev/null
+++ b/3rdparty/genie/src/actions/xcode/xcode14.lua
@@ -0,0 +1,121 @@
+--
+-- xcode14.lua
+-- Define the Apple XCode 14.0 action and support functions.
+--
+
+ local premake = premake
+ premake.xcode14 = { }
+
+ local xcode = premake.xcode
+ local xcode10 = premake.xcode10
+ local xcode11 = premake.xcode11
+ local xcode14 = premake.xcode14
+
+ function xcode14.XCBuildConfiguration_Target(tr, target, cfg)
+ local options = xcode11.XCBuildConfiguration_Target(tr, target, cfg)
+ options.CODE_SIGN_IDENTITY = "-"
+
+ local action = premake.action.current()
+ xcode.setdeploymenttarget(cfg, action.xcode, options)
+
+ local iosversion = options.IPHONEOS_DEPLOYMENT_TARGET
+ local macosversion = options.MACOSX_DEPLOYMENT_TARGET
+ local tvosversion = options.TVOS_DEPLOYMENT_TARGET
+
+ if iosversion and not xcode.versionge(iosversion, "11") then
+ error("XCode14 does not support deployment for iOS older than 11")
+ elseif macosversion and not xcode.versionge(macosversion, "10.13") then
+ error("XCode14 does not support deployment for macOS older than 10.13")
+ elseif tvosversion and not xcode.versionge(tvosversion, "11") then
+ error("XCode14 does not support deployment for tvOS older than 11")
+ end
+
+ return options
+ end
+
+ function xcode14.XCBuildConfiguration_Project(tr, prj, cfg)
+ local options = xcode10.XCBuildConfiguration_Project(tr, prj, cfg)
+
+ options.ENABLE_BITCODE = "NO" -- Bitcode is now deprecated.
+
+ -- We need to set the deployment target for both target
+ -- and project. XCode will complain, otherwise.
+ local action = premake.action.current()
+ xcode.setdeploymenttarget(cfg, action.xcode, options)
+
+ return options
+ end
+
+ function xcode14.project(prj)
+ local tr = xcode.buildprjtree(prj)
+ xcode.Header(tr, 48)
+ xcode.PBXBuildFile(tr)
+ xcode.PBXContainerItemProxy(tr)
+ xcode.PBXFileReference(tr,prj)
+ xcode.PBXFrameworksBuildPhase(tr)
+ xcode.PBXGroup(tr)
+ xcode.PBXNativeTarget(tr)
+ xcode.PBXProject(tr, "8.0")
+ xcode.PBXReferenceProxy(tr)
+ xcode.PBXResourcesBuildPhase(tr)
+ xcode.PBXShellScriptBuildPhase(tr)
+ xcode.PBXCopyFilesBuildPhase(tr)
+ xcode.PBXSourcesBuildPhase(tr,prj)
+ xcode.PBXVariantGroup(tr)
+ xcode.PBXTargetDependency(tr)
+ xcode.XCBuildConfiguration(tr, prj, {
+ ontarget = xcode14.XCBuildConfiguration_Target,
+ onproject = xcode14.XCBuildConfiguration_Project,
+ })
+ xcode.XCBuildConfigurationList(tr)
+ xcode.Footer(tr)
+ end
+ --]]
+
+
+--
+-- xcode14 action
+--
+
+ newaction
+ {
+ trigger = "xcode14",
+ shortname = "Xcode 14",
+ description = "Generate Apple Xcode 14 project files",
+ os = "macosx",
+
+ valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
+
+ valid_languages = { "C", "C++" },
+
+ valid_tools = {
+ cc = { "gcc" },
+ },
+
+ valid_platforms = { Native = "Native" },
+ default_platform = "Native",
+
+ onsolution = function(sln)
+ premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", xcode.workspace_generate)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", xcode.workspace_settings)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme", xcode.workspace_scheme)
+ end,
+
+ onproject = function(prj)
+ premake.generate(prj, "%%.xcodeproj/project.pbxproj", xcode14.project)
+ xcode.generate_schemes(prj, "%%.xcodeproj/xcshareddata/xcschemes")
+ end,
+
+ oncleanproject = function(prj)
+ premake.clean.directory(prj, "%%.xcodeproj")
+ premake.clean.directory(prj, "%%.xcworkspace")
+ end,
+
+ oncheckproject = xcode.checkproject,
+
+ xcode = {
+ iOSTargetPlatformVersion = nil,
+ macOSTargetPlatformVersion = nil,
+ tvOSTargetPlatformVersion = nil,
+ },
+ }
diff --git a/3rdparty/genie/src/actions/xcode/xcode15.lua b/3rdparty/genie/src/actions/xcode/xcode15.lua
new file mode 100644
index 00000000000..c698823acae
--- /dev/null
+++ b/3rdparty/genie/src/actions/xcode/xcode15.lua
@@ -0,0 +1,124 @@
+--
+-- xcode15.lua
+-- Define the Apple XCode 15.0 action and support functions.
+--
+
+ local premake = premake
+ premake.xcode15 = { }
+
+ local xcode = premake.xcode
+ local xcode10 = premake.xcode10
+ local xcode11 = premake.xcode11
+ local xcode14 = premake.xcode14
+ local xcode15 = premake.xcode15
+
+ function xcode15.XCBuildConfiguration_Target(tr, target, cfg)
+ local options = xcode11.XCBuildConfiguration_Target(tr, target, cfg)
+ options.CODE_SIGN_IDENTITY = "-"
+
+ local action = premake.action.current()
+ xcode.setdeploymenttarget(cfg, action.xcode, options)
+
+ local iosversion = options.IPHONEOS_DEPLOYMENT_TARGET
+ local macosversion = options.MACOSX_DEPLOYMENT_TARGET
+ local tvosversion = options.TVOS_DEPLOYMENT_TARGET
+ local xrosversion = options.XROS_DEPLOYMENT_TARGET
+
+ if iosversion and not xcode.versionge(iosversion, "12") then
+ error("XCode15 does not support deployment for iOS older than 12")
+ elseif macosversion and not xcode.versionge(macosversion, "13.5") then
+ error("XCode15 does not support deployment for macOS older than 13.5")
+ elseif tvosversion and not xcode.versionge(tvosversion, "12") then
+ error("XCode15 does not support deployment for tvOS older than 12")
+ elseif xrosversion and not xcode.versionge(xrosversion, "1.0") then
+ error("XCode15 does not support deployment for visionOS older than 1.0")
+ end
+
+ return options
+ end
+
+ function xcode15.XCBuildConfiguration_Project(tr, prj, cfg)
+ local options = xcode10.XCBuildConfiguration_Project(tr, prj, cfg)
+
+ -- We need to set the deployment target for both target
+ -- and project. XCode will complain, otherwise.
+ local action = premake.action.current()
+ xcode.setdeploymenttarget(cfg, action.xcode, options)
+
+ return options
+ end
+
+ function xcode15.project(prj)
+ local tr = xcode.buildprjtree(prj)
+ xcode.Header(tr, 48)
+ xcode.PBXBuildFile(tr)
+ xcode.PBXContainerItemProxy(tr)
+ xcode.PBXFileReference(tr,prj)
+ xcode.PBXFrameworksBuildPhase(tr)
+ xcode.PBXGroup(tr)
+ xcode.PBXNativeTarget(tr)
+ xcode.PBXProject(tr, "8.0")
+ xcode.PBXReferenceProxy(tr)
+ xcode.PBXResourcesBuildPhase(tr)
+ xcode.PBXShellScriptBuildPhase(tr)
+ xcode.PBXCopyFilesBuildPhase(tr)
+ xcode.PBXSourcesBuildPhase(tr,prj)
+ xcode.PBXVariantGroup(tr)
+ xcode.PBXTargetDependency(tr)
+ xcode.XCBuildConfiguration(tr, prj, {
+ ontarget = xcode15.XCBuildConfiguration_Target,
+ onproject = xcode15.XCBuildConfiguration_Project,
+ })
+ xcode.XCBuildConfigurationList(tr)
+ xcode.Footer(tr)
+ end
+ --]]
+
+
+--
+-- xcode15 action
+--
+
+ newaction
+ {
+ trigger = "xcode15",
+ shortname = "Xcode 15",
+ description = "Generate Apple Xcode 15 project files",
+ os = "macosx",
+
+ valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" },
+
+ valid_languages = { "C", "C++" },
+
+ valid_tools = {
+ cc = { "gcc" },
+ },
+
+ valid_platforms = { Native = "Native" },
+ default_platform = "Native",
+
+ onsolution = function(sln)
+ premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", xcode.workspace_generate)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", xcode.workspace_settings)
+ premake.generate(sln, "%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme", xcode.workspace_scheme)
+ end,
+
+ onproject = function(prj)
+ premake.generate(prj, "%%.xcodeproj/project.pbxproj", xcode14.project)
+ xcode.generate_schemes(prj, "%%.xcodeproj/xcshareddata/xcschemes")
+ end,
+
+ oncleanproject = function(prj)
+ premake.clean.directory(prj, "%%.xcodeproj")
+ premake.clean.directory(prj, "%%.xcworkspace")
+ end,
+
+ oncheckproject = xcode.checkproject,
+
+ xcode = {
+ iOSTargetPlatformVersion = nil,
+ macOSTargetPlatformVersion = nil,
+ tvOSTargetPlatformVersion = nil,
+ visionOSTargetPlatformVersion = nil,
+ },
+ }
diff --git a/3rdparty/genie/src/actions/xcode/xcode8.lua b/3rdparty/genie/src/actions/xcode/xcode8.lua
index 5a658c992fd..c03c499f230 100644
--- a/3rdparty/genie/src/actions/xcode/xcode8.lua
+++ b/3rdparty/genie/src/actions/xcode/xcode8.lua
@@ -68,21 +68,7 @@
end
local action = premake.action.current()
- local get_opt = function(opt, def)
- return (opt and #opt > 0) and opt or def
- end
-
- local iosversion = get_opt(cfg.iostargetplatformversion, action.xcode.iOSTargetPlatformVersion)
- local macosversion = get_opt(cfg.macostargetplatformversion, action.xcode.macOSTargetPlatformVersion)
- local tvosversion = get_opt(cfg.tvostargetplatformversion, action.xcode.tvOSTargetPlatformVersion)
-
- if iosversion then
- options.IPHONEOS_DEPLOYMENT_TARGET = iosversion
- elseif macosversion then
- options.MACOSX_DEPLOYMENT_TARGET = macosversion
- elseif tvosversion then
- options.TVOS_DEPLOYMENT_TARGET = tvosversion
- end
+ xcode.setdeploymenttarget(cfg, action.xcode, options)
if cfg.kind == "Bundle" and not cfg.options.SkipBundling then
options.PRODUCT_BUNDLE_IDENTIFIER = "genie." .. cfg.buildtarget.basename:gsub("%s+", ".") --replace spaces with .
diff --git a/3rdparty/genie/src/actions/xcode/xcode9.lua b/3rdparty/genie/src/actions/xcode/xcode9.lua
index aa70275bdda..0578e8af4d3 100644
--- a/3rdparty/genie/src/actions/xcode/xcode9.lua
+++ b/3rdparty/genie/src/actions/xcode/xcode9.lua
@@ -13,8 +13,10 @@
function xcode9.XCBuildConfiguration_Project(tr, prj, cfg)
local options = xcode8.XCBuildConfiguration_Project(tr, prj, cfg)
- if cfg.flags.Cpp17 or cfg.flags.CppLatest then
+ if cfg.flags.Cpp17 then
options.CLANG_CXX_LANGUAGE_STANDARD = "c++17"
+ elseif cfg.flags.Cpp20 or cfg.flags.CppLatest then
+ options.CLANG_CXX_LANGUAGE_STANDARD = "c++20"
end
return table.merge(options, {
diff --git a/3rdparty/genie/src/actions/xcode/xcode_common.lua b/3rdparty/genie/src/actions/xcode/xcode_common.lua
index 762c27aada1..0eefdb18e21 100644
--- a/3rdparty/genie/src/actions/xcode/xcode_common.lua
+++ b/3rdparty/genie/src/actions/xcode/xcode_common.lua
@@ -396,6 +396,37 @@
return "\"" .. str:gsub("[\"\\\"]", "\\%0") .. "\""
end
+--
+-- Set the deployment target in the project or target options.
+--
+-- @param cfg
+-- The configuration in use.
+-- @param def
+-- The default version overrides.
+-- @param opts
+-- The options to set deployment target in.
+--
+
+ function xcode.setdeploymenttarget(cfg, def, opts)
+ local get_opt = function(opt, def)
+ return (opt and #opt > 0) and opt or def
+ end
+
+ local iosversion = get_opt(cfg.iostargetplatformversion, def.iOSTargetPlatformVersion)
+ local macosversion = get_opt(cfg.macostargetplatformversion, def.macOSTargetPlatformVersion)
+ local tvosversion = get_opt(cfg.tvostargetplatformversion, def.tvOSTargetPlatformVersion)
+ local visionosversion = get_opt(cfg.visionostargetplatformversion, def.visionOSTargetPlatformVersion)
+
+ if iosversion then
+ opts.IPHONEOS_DEPLOYMENT_TARGET = iosversion
+ elseif macosversion then
+ opts.MACOSX_DEPLOYMENT_TARGET = macosversion
+ elseif tvosversion then
+ opts.TVOS_DEPLOYMENT_TARGET = tvosversion
+ elseif visionosversion then
+ opts.XROS_DEPLOYMENT_TARGET = tvosversion
+ end
+ end
---------------------------------------------------------------------------
@@ -1269,6 +1300,21 @@ end
_p('')
end
+ function xcode.versionge(version, reference)
+ local vparts = string.explode(version, ".", true)
+ local rparts = string.explode(reference, ".", true)
+
+ for i=1,#rparts do
+ local rnum = tonumber(rparts[i]) or 0
+ local vnum = tonumber(vparts[i]) or 0
+
+ if vnum < rnum then
+ return false
+ end
+ end
+
+ return true
+ end
function xcode.Footer()
_p(1,'};')
diff --git a/3rdparty/genie/src/actions/xcode/xcode_scheme.lua b/3rdparty/genie/src/actions/xcode/xcode_scheme.lua
index 662582e2afb..c261aa35fbc 100644
--- a/3rdparty/genie/src/actions/xcode/xcode_scheme.lua
+++ b/3rdparty/genie/src/actions/xcode/xcode_scheme.lua
@@ -237,3 +237,4 @@ local xcode = premake.xcode
end
end
end
+
diff --git a/3rdparty/genie/src/base/api.lua b/3rdparty/genie/src/base/api.lua
index a5aa0472f7c..4a3e8bd5ec6 100644
--- a/3rdparty/genie/src/base/api.lua
+++ b/3rdparty/genie/src/base/api.lua
@@ -818,11 +818,11 @@ end
allowed = function(value)
local allowed_flags = {
AntBuildDebuggable = 1,
- ATL = 1,
C7DebugInfo = 1,
Cpp11 = 1,
Cpp14 = 1,
Cpp17 = 1,
+ Cpp20 = 1,
CppLatest = 1,
DebugEnvsDontMerge = 1,
DebugEnvsInherit = 1,
@@ -843,7 +843,6 @@ end
LinkSupportCircularDependencies = 1,
Managed = 1,
MinimumWarnings = 1,
- MFC = 1,
NativeWChar = 1,
No64BitChecks = 1,
NoBufferSecurityCheck = 1,
@@ -872,7 +871,6 @@ end
DebugRuntime = 1,
ReleaseRuntime = 1,
SEH = 1,
- StaticATL = 1,
StaticRuntime = 1,
Symbols = 1,
Unicode = 1,
@@ -943,6 +941,12 @@ end
}
newapifield {
+ name = "visionostargetplatformversion",
+ kind = "string",
+ scope = "project",
+ }
+
+ newapifield {
name = "windowstargetplatformversion",
kind = "string",
scope = "project",
diff --git a/3rdparty/genie/src/base/bake.lua b/3rdparty/genie/src/base/bake.lua
index 9d69487e6d7..221cb623fcf 100644
--- a/3rdparty/genie/src/base/bake.lua
+++ b/3rdparty/genie/src/base/bake.lua
@@ -162,15 +162,20 @@
end
end
- local function removevalues(tbl, removes)
+ local function removevalues(tbl, removes)
+ for i = #tbl, 1, -1 do
+ for _, pattern in ipairs(removes) do
+ if pattern == tbl[i] then
+ table.remove(tbl, i)
+ break
+ end
+ end
+ end
+
for k, v in pairs(tbl) do
for _, pattern in ipairs(removes) do
if pattern == tbl[k] then
- if type(k) == "number" then
- table.remove(tbl, k)
- else
- tbl[k] = nil
- end
+ tbl[k] = nil
break
end
end
diff --git a/3rdparty/genie/src/base/cmdline.lua b/3rdparty/genie/src/base/cmdline.lua
index c3357b702ae..0127ceff327 100644
--- a/3rdparty/genie/src/base/cmdline.lua
+++ b/3rdparty/genie/src/base/cmdline.lua
@@ -76,7 +76,13 @@
{ "xbox360", "Xbox 360" },
{ "durango", "Xbox One" },
{ "ARM", "ARM" },
+ { "ARM64", "ARM64" },
{ "PowerPC", "PowerPC" },
+ { "nx32", "Nintendo Switch, 32-bit only" },
+ { "nx64", "Nintendo Switch, 64-bit only" },
+ { "gdk-desktop", "GDK Windows Desktop" },
+ { "gdk-xboxone", "GDK Xbox One" },
+ { "gdk-scarlett","GDK Xbox Scarlett" },
}
}
diff --git a/3rdparty/genie/src/base/config.lua b/3rdparty/genie/src/base/config.lua
index eec1ad67499..a255c7cca67 100644
--- a/3rdparty/genie/src/base/config.lua
+++ b/3rdparty/genie/src/base/config.lua
@@ -104,3 +104,4 @@
end
return true
end
+
diff --git a/3rdparty/genie/src/base/globals.lua b/3rdparty/genie/src/base/globals.lua
index d24b66f163d..cb6c0f089b0 100644
--- a/3rdparty/genie/src/base/globals.lua
+++ b/3rdparty/genie/src/base/globals.lua
@@ -67,6 +67,11 @@
cfgsuffix = "ARM",
iscrosscompiler = true,
},
+ ARM64 =
+ {
+ cfgsuffix = "ARM64",
+ iscrosscompiler = true,
+ },
Orbis =
{
cfgsuffix = "orbis",
@@ -105,6 +110,21 @@
nosharedlibs = true,
namestyle = "Emscripten",
},
+ ["gdk-desktop"] =
+ {
+ cfgsuffix = "gdk-desktop",
+ namestyle = "windows",
+ },
+ ["gdk-xboxone"] =
+ {
+ cfgsuffix = "gdk-xboxone",
+ namestyle = "windows",
+ },
+ ["gdk-scarlett"] =
+ {
+ cfgsuffix = "gdk-scarlett",
+ namestyle = "windows",
+ },
}
diff --git a/3rdparty/genie/src/base/os.lua b/3rdparty/genie/src/base/os.lua
index ae88c0ad949..3cddcbb45c3 100644
--- a/3rdparty/genie/src/base/os.lua
+++ b/3rdparty/genie/src/base/os.lua
@@ -122,7 +122,8 @@
"amd64",
"ppc64",
"powerpc64",
- "sparc64"
+ "sparc64",
+ "arm64"
}
function os.is64bit()
diff --git a/3rdparty/genie/src/base/path.lua b/3rdparty/genie/src/base/path.lua
index ae2561ac07e..d9eb936c414 100644
--- a/3rdparty/genie/src/base/path.lua
+++ b/3rdparty/genie/src/base/path.lua
@@ -172,6 +172,10 @@
return path.hasextension(fname, { ".h", ".hh", ".hpp", ".hxx" })
end
+ function path.iscppmodule(fname)
+ return path.hasextension(fname, { ".ixx", ".cppm" })
+ end
+
function path.isappxmanifest(fname)
return path.hasextension(fname, ".appxmanifest")
end
@@ -192,6 +196,11 @@
return path.hasextension(fname, ".vala")
end
+ function path.isgresource(fname)
+ local ending = ".gresource.xml"
+ return ending == "" or fname:sub(-#ending) == ending
+ end
+
function path.isswiftfile(fname)
return path.hasextension(fname, ".swift")
end
@@ -208,6 +217,7 @@
function path.issourcefilevs(fname)
return path.hasextension(fname, { ".cc", ".cpp", ".cxx", ".c++", ".c" })
or path.iscxfile(fname)
+ or path.iscppmodule(fname)
end
--
diff --git a/3rdparty/genie/src/base/project.lua b/3rdparty/genie/src/base/project.lua
index 1c817c4168c..ad12830ed7b 100644
--- a/3rdparty/genie/src/base/project.lua
+++ b/3rdparty/genie/src/base/project.lua
@@ -463,7 +463,7 @@
-- Fix things up based on the current system
local kind = cfg.kind
- if premake.iscppproject(cfg) then
+ if premake.iscppproject(cfg) or premake.isvalaproject(cfg) then
-- On Windows, shared libraries link against a static import library
if (namestyle == "windows" or system == "windows")
and kind == "SharedLib" and direction == "link"
@@ -559,7 +559,7 @@
if kind == "ConsoleApp" or kind == "WindowedApp" then
ext = ".html"
elseif kind == "StaticLib" then
- ext = ".bc"
+ ext = ".a"
elseif kind == "SharedLib" then
ext = ".js"
end
@@ -595,8 +595,8 @@
-- any relevant command-line options.
--
- function premake.gettool(cfg)
- if premake.iscppproject(cfg) then
+ function premake.gettool(prj)
+ if premake.iscppproject(prj) then
if _OPTIONS.cc then
return premake[_OPTIONS.cc]
end
@@ -605,9 +605,9 @@
return premake[action.valid_tools.cc[1]]
end
return premake.gcc
- elseif premake.isdotnetproject(cfg) then
+ elseif premake.isdotnetproject(prj) then
return premake.dotnet
- elseif premake.isswiftproject(cfg) then
+ elseif premake.isswiftproject(prj) then
return premake.swift
else
return premake.valac
@@ -631,7 +631,7 @@
local fname = path.getname(abspath)
local max = abspath:len() - fname:len()
-
+
-- First check for an exact match from the inverse vpaths
if prj.inversevpaths and prj.inversevpaths[abspath] then
return path.join(prj.inversevpaths[abspath], fname)
@@ -687,7 +687,7 @@
end
end
end
-
+
if #matches > 0 then
-- for the sake of determinism, return the first alphabetically
table.sort(matches)
@@ -731,7 +731,8 @@
--
function premake.project.iscproject(prj)
- return prj.language == "C"
+ local language = prj.language or prj.solution.language
+ return language == "C"
end
@@ -740,7 +741,8 @@
--
function premake.iscppproject(prj)
- return (prj.language == "C" or prj.language == "C++")
+ local language = prj.language or prj.solution.language
+ return (language == "C" or language == "C++")
end
@@ -750,7 +752,8 @@
--
function premake.isdotnetproject(prj)
- return (prj.language == "C#")
+ local language = prj.language or prj.solution.language
+ return (language == "C#")
end
--
@@ -758,7 +761,8 @@
--
function premake.isvalaproject(prj)
- return (prj.language == "Vala")
+ local language = prj.language or prj.solution.language
+ return (language == "Vala")
end
--
@@ -766,5 +770,6 @@
--
function premake.isswiftproject(prj)
- return (prj.language == "Swift")
+ local language = prj.language or prj.solution.language
+ return (language == "Swift")
end
diff --git a/3rdparty/genie/src/host/premake.c b/3rdparty/genie/src/host/premake.c
index a8ad1140912..52d365a5848 100644
--- a/3rdparty/genie/src/host/premake.c
+++ b/3rdparty/genie/src/host/premake.c
@@ -130,6 +130,8 @@ int premake_locate(lua_State* L, const char* argv0)
char buffer[PATH_MAX];
const char* path = NULL;
+ memset(buffer, 0, PATH_MAX);
+
#if PLATFORM_WINDOWS
DWORD len = GetModuleFileName(NULL, buffer, PATH_MAX);
if (len > 0)
diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c
index f93d3547332..2ea0429904f 100644
--- a/3rdparty/genie/src/host/scripts.c
+++ b/3rdparty/genie/src/host/scripts.c
@@ -5,17 +5,18 @@
const char* builtin_scripts[] = {
/* base/os.lua */
"function os.executef(cmd, ...)\nlocal arg={...}\ncmd = string.format(cmd, table.unpack(arg))\nreturn os.execute(cmd)\nend\nlocal function parse_ld_so_conf(conf_file)\nlocal first, last\nlocal dirs = { }\nlocal file = io.open(conf_file)\nif file == nil then\nreturn dirs\nend\nfor line in file:lines() do\nfirst = line:find(\"#\", 1, true)\nif first ~= nil then\nline = line:sub(1, first - 1)\nend\nif line ~= \"\" then\nfirst, last = line:find(\"include%s+\")\nif first ~= nil then\nlocal include_glob = line:sub(last + 1)\nlocal includes = os.matchfiles(include_glob)\nfor _, v in ipairs(includes) do\ndirs = table.join(dirs, parse_ld_so_conf(v))\nend\nelse\ntable.insert(dirs, line)\nend\nend\nend\nreturn dirs\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\np"
- "ath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nfor _, v in ipairs(parse_ld_so_conf(\"/etc/ld.so.conf\")) do\npath = path .. \":\" .. v\nend\nend\ntable.insert(formats, \"%s\")\npath = path or \"\"\nif os.is64bit() then\npath = path .. \":/lib64:/usr/lib64/:usr/local/lib64\"\nend\npath = path .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal _64BitHostTypes = {\n\"x86_64\",\n\"ia64\",\n\"amd64\",\n\"ppc64\",\n\"powerpc64\",\n\"sparc64\"\n}\nfunction os.is64bit()\nif (os._is64bit()) then\nreturn true\nend\nlocal arch = \"\"\nif _OS == \"windows\" then\narch = os.getenv(\"PROCESSOR_ARCHITECTURE\")\nelseif _OS == \"macosx\" then\narch = os.outputof(\"echo $HOSTTYPE\")\nelse\narch = os.outputof(\"uname -m\")\nend\nif nil ~= arch then\narch = a"
- "rch:lower()\nfor _, hosttype in ipairs(_64BitHostTypes) do\nif arch:find(hosttype) then\nreturn true\nend\nend\nend\nreturn false\nend\nlocal function domatch(result, mask, wantfiles)\nif mask:startswith(\"./\") then\nmask = mask:sub(3)\nend\nlocal basedir = mask\nlocal starpos = mask:find(\"%*\")\nif starpos then\nbasedir = basedir:sub(1, starpos - 1)\nend\nbasedir = path.getdirectory(basedir)\nif (basedir == \".\") then basedir = \"\" end\nlocal recurse = mask:find(\"**\", nil, true)\nmask = path.wildcards(mask)\nlocal function matchwalker(basedir)\nlocal wildcard = path.join(basedir, \"*\")\nlocal m = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nlocal isfile = os.matchisfile(m)\nif ((wantfiles and isfile) or (not wantfiles and not isfile)) then\nlocal fname = path.join(basedir, os.matchname(m))\nif fname:match(mask) == fname then\ntable.insert(result, fname)\nend\nend\nend\nos.matchdone(m)\nif recurse then\nm = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nif not os.matchisfile(m) then\nlocal"
- " dirname = os.matchname(m)\nmatchwalker(path.join(basedir, dirname))\nend\nend\nos.matchdone(m)\nend\nend\nmatchwalker(basedir)\nend\nfunction os.matchdirs(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, false)\nend\nreturn result\nend\nfunction os.matchfiles(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, true)\nend\nreturn result\nend\nlocal builtin_mkdir = os.mkdir\nfunction os.mkdir(p)\nlocal dir = iif(p:startswith(\"/\"), \"/\", \"\")\nfor part in p:gmatch(\"[^/]+\") do\ndir = dir .. part\nif (part ~= \"\" and not path.isabsolute(part) and not os.isdir(dir)) then\nlocal ok, err = builtin_mkdir(dir)\nif (not ok) then\nreturn nil, err\nend\nend\ndir = dir .. \"/\"\nend\nreturn true\nend\nfunction os.outputof(cmd)\nlocal pipe = io.popen(cmd)\nlocal result = pipe:read('*a')\npipe:close()\nreturn result\nend\nlocal builtin_rmdir = os.rmdir\nfunction os.rmdir(p)\nlocal dirs = os.matchdirs(p .. \"/*\")\nfor _, dname i"
- "n ipairs(dirs) do\nos.rmdir(dname)\nend\nlocal files = os.matchfiles(p .. \"/*\")\nfor _, fname in ipairs(files) do\nos.remove(fname)\nend\nbuiltin_rmdir(p)\nend\n",
+ "ath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nfor _, v in ipairs(parse_ld_so_conf(\"/etc/ld.so.conf\")) do\npath = path .. \":\" .. v\nend\nend\ntable.insert(formats, \"%s\")\npath = path or \"\"\nif os.is64bit() then\npath = path .. \":/lib64:/usr/lib64/:usr/local/lib64\"\nend\npath = path .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal _64BitHostTypes = {\n\"x86_64\",\n\"ia64\",\n\"amd64\",\n\"ppc64\",\n\"powerpc64\",\n\"sparc64\",\n\"arm64\"\n}\nfunction os.is64bit()\nif (os._is64bit()) then\nreturn true\nend\nlocal arch = \"\"\nif _OS == \"windows\" then\narch = os.getenv(\"PROCESSOR_ARCHITECTURE\")\nelseif _OS == \"macosx\" then\narch = os.outputof(\"echo $HOSTTYPE\")\nelse\narch = os.outputof(\"uname -m\")\nend\nif nil ~= arch th"
+ "en\narch = arch:lower()\nfor _, hosttype in ipairs(_64BitHostTypes) do\nif arch:find(hosttype) then\nreturn true\nend\nend\nend\nreturn false\nend\nlocal function domatch(result, mask, wantfiles)\nif mask:startswith(\"./\") then\nmask = mask:sub(3)\nend\nlocal basedir = mask\nlocal starpos = mask:find(\"%*\")\nif starpos then\nbasedir = basedir:sub(1, starpos - 1)\nend\nbasedir = path.getdirectory(basedir)\nif (basedir == \".\") then basedir = \"\" end\nlocal recurse = mask:find(\"**\", nil, true)\nmask = path.wildcards(mask)\nlocal function matchwalker(basedir)\nlocal wildcard = path.join(basedir, \"*\")\nlocal m = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nlocal isfile = os.matchisfile(m)\nif ((wantfiles and isfile) or (not wantfiles and not isfile)) then\nlocal fname = path.join(basedir, os.matchname(m))\nif fname:match(mask) == fname then\ntable.insert(result, fname)\nend\nend\nend\nos.matchdone(m)\nif recurse then\nm = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nif not os.matchisfile(m)"
+ " then\nlocal dirname = os.matchname(m)\nmatchwalker(path.join(basedir, dirname))\nend\nend\nos.matchdone(m)\nend\nend\nmatchwalker(basedir)\nend\nfunction os.matchdirs(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, false)\nend\nreturn result\nend\nfunction os.matchfiles(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, true)\nend\nreturn result\nend\nlocal builtin_mkdir = os.mkdir\nfunction os.mkdir(p)\nlocal dir = iif(p:startswith(\"/\"), \"/\", \"\")\nfor part in p:gmatch(\"[^/]+\") do\ndir = dir .. part\nif (part ~= \"\" and not path.isabsolute(part) and not os.isdir(dir)) then\nlocal ok, err = builtin_mkdir(dir)\nif (not ok) then\nreturn nil, err\nend\nend\ndir = dir .. \"/\"\nend\nreturn true\nend\nfunction os.outputof(cmd)\nlocal pipe = io.popen(cmd)\nlocal result = pipe:read('*a')\npipe:close()\nreturn result\nend\nlocal builtin_rmdir = os.rmdir\nfunction os.rmdir(p)\nlocal dirs = os.matchdirs(p .. \"/*\")\nfo"
+ "r _, dname in ipairs(dirs) do\nos.rmdir(dname)\nend\nlocal files = os.matchfiles(p .. \"/*\")\nfor _, fname in ipairs(files) do\nos.remove(fname)\nend\nbuiltin_rmdir(p)\nend\n",
/* base/path.lua */
"function path.getbasename(p)\nlocal name = path.getname(p)\nlocal i = name:findlast(\".\", true)\nif (i) then\nreturn name:sub(1, i - 1)\nelse\nreturn name\nend\nend\nfunction path.removeext(name)\nlocal i = name:findlast(\".\", true)\nif (i) then\nreturn name:sub(1, i - 1)\nelse\nreturn name\nend\nend\nfunction path.getdirectory(p)\nlocal i = p:findlast(\"/\", true)\nif (i) then\nif i > 1 then i = i - 1 end\nreturn p:sub(1, i)\nelse\nreturn \".\"\nend\nend\nfunction path.getdrive(p)\nlocal ch1 = p:sub(1,1)\nlocal ch2 = p:sub(2,2)\nif ch2 == \":\" then\nreturn ch1\nend\nend\nfunction path.getextension(p)\nlocal i = p:findlast(\".\", true)\nif (i) then\nreturn p:sub(i)\nelse\nreturn \"\"\nend\nend\nfunction path.getname(p)\nlocal i = p:findlast(\"[/\\\\]\")\nif (i) then\nreturn p:sub(i + 1)\nelse\nreturn p\nend\nend\nfunction path.getcommonbasedir(a, b)\na = path.getdirectory(a)..'/'\nb = path.getdirectory(b)..'/'\nlocal idx = 0\nwhile (true) do\nlocal tst = a:find('/', idx + 1, true)\nif tst then\nif a:sub(1,t"
"st) == b:sub(1,tst) then\nidx = tst\nelse\nbreak\nend\nelse\nbreak\nend\nend\nlocal result = ''\nif idx > 1 then\nresult = a:sub(1, idx - 1)-- Remove the trailing slash to be consistent with other functions.\nend\nreturn result\nend\nfunction path.hasextension(fname, extensions)\nlocal fext = path.getextension(fname):lower()\nif type(extensions) == \"table\" then\nfor _, extension in pairs(extensions) do\nif fext == extension then\nreturn true\nend\nend\nreturn false\nelse\nreturn (fext == extensions)\nend\nend\nfunction path.iscfile(fname)\nreturn path.hasextension(fname, { \".c\", \".m\" })\nend\nfunction path.iscppfile(fname)\nreturn path.hasextension(fname, { \".cc\", \".cpp\", \".cxx\", \".c++\", \".c\", \".m\", \".mm\" })\nend\nfunction path.iscxfile(fname)\nreturn path.hasextension(fname, \".cx\")\nend\nfunction path.isobjcfile(fname)\nreturn path.hasextension(fname, { \".m\", \".mm\" })\nend\nfunction path.iscppheader(fname)\nreturn path.hasextension(fname, { \".h\", \".hh\", \".hpp\", \".hxx\" })\nend"
- "\nfunction path.isappxmanifest(fname)\nreturn path.hasextension(fname, \".appxmanifest\")\nend\nfunction path.isandroidbuildfile(fname)\nreturn path.getname(fname) == \"AndroidManifest.xml\"\nend\nfunction path.isnatvis(fname)\nreturn path.hasextension(fname, \".natvis\")\nend\nfunction path.isasmfile(fname)\nreturn path.hasextension(fname, { \".asm\", \".s\", \".S\" })\nend\nfunction path.isvalafile(fname)\nreturn path.hasextension(fname, \".vala\")\nend\nfunction path.isswiftfile(fname)\nreturn path.hasextension(fname, \".swift\")\nend\nfunction path.issourcefile(fname)\nreturn path.iscfile(fname)\nor path.iscppfile(fname)\nor path.iscxfile(fname)\nor path.isasmfile(fname)\nor path.isvalafile(fname)\nor path.isswiftfile(fname)\nend\nfunction path.issourcefilevs(fname)\nreturn path.hasextension(fname, { \".cc\", \".cpp\", \".cxx\", \".c++\", \".c\" })\nor path.iscxfile(fname)\nend\nfunction path.isobjectfile(fname)\nreturn path.hasextension(fname, { \".o\", \".obj\" })\nend\nfunction path.isresourcefile(fname"
- ")\nreturn path.hasextension(fname, \".rc\")\nend\nfunction path.isimagefile(fname)\nlocal extensions = { \".png\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.join(...)\nlocal arg={...}\nlocal numargs = select(\"#\", ...)\nif numargs == 0 then\nreturn \"\";\nend\nlocal allparts = {}\nfor i = numargs, 1, -1 do\nlocal part = select(i, ...)\nif part and #part > 0 and part ~= \".\" then\nwhile part:endswith(\"/\") do\npart = part:sub(1, -2)\nend\ntable.insert(allparts, 1, part)\nif path.isabsolute(part) then\nbreak\nend\nend\nend\nreturn table.concat(allparts, \"/\")\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.translate(p, sep)\nif (type(p) == \"table\") then\nlocal result = { }\nfor _, value in ipairs(p) do\ntable.insert(result, path.translate(value))\nend\nreturn result\nelse\nif (not sep) then\nif (os.is(\"windows\")) then\nsep = \"\\\\\""
- "\nelse\nsep = \"/\"\nend\nend\nlocal result = p:gsub(\"[/\\\\]\", sep)\nreturn result\nend\nend\nfunction path.wildcards(pattern)\npattern = pattern:gsub(\"([%+%.%-%^%$%(%)%%])\", \"%%%1\")\npattern = pattern:gsub(\"%*%*\", \"\\001\")\npattern = pattern:gsub(\"%*\", \"\\002\")\npattern = pattern:gsub(\"\\001\", \".*\")\npattern = pattern:gsub(\"\\002\", \"[^/]*\")\nreturn pattern\nend\nfunction path.trimdots(p)\nlocal changed\nrepeat\nchanged = true\nif p:startswith(\"./\") then\np = p:sub(3)\nelseif p:startswith(\"../\") then\np = p:sub(4)\nelse\nchanged = false\nend\nuntil not changed\nreturn p\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.replaceextension(p, newext)\nlocal ext = path.getextension(p)\nif not ext then\nreturn p\nend\nif #newext > 0 and not newext:findlast(\".\", true) then\nnewext = \".\"..newext\nend\nreturn p:match(\"^(.*)\"..ext..\"$\")..newext\nend\n",
+ "\nfunction path.iscppmodule(fname)\nreturn path.hasextension(fname, { \".ixx\", \".cppm\" })\nend\nfunction path.isappxmanifest(fname)\nreturn path.hasextension(fname, \".appxmanifest\")\nend\nfunction path.isandroidbuildfile(fname)\nreturn path.getname(fname) == \"AndroidManifest.xml\"\nend\nfunction path.isnatvis(fname)\nreturn path.hasextension(fname, \".natvis\")\nend\nfunction path.isasmfile(fname)\nreturn path.hasextension(fname, { \".asm\", \".s\", \".S\" })\nend\nfunction path.isvalafile(fname)\nreturn path.hasextension(fname, \".vala\")\nend\nfunction path.isgresource(fname)\nlocal ending = \".gresource.xml\"\nreturn ending == \"\" or fname:sub(-#ending) == ending\nend\nfunction path.isswiftfile(fname)\nreturn path.hasextension(fname, \".swift\")\nend\nfunction path.issourcefile(fname)\nreturn path.iscfile(fname)\nor path.iscppfile(fname)\nor path.iscxfile(fname)\nor path.isasmfile(fname)\nor path.isvalafile(fname)\nor path.isswiftfile(fname)\nend\nfunction path.issourcefilevs(fname)\nreturn path.hase"
+ "xtension(fname, { \".cc\", \".cpp\", \".cxx\", \".c++\", \".c\" })\nor path.iscxfile(fname)\nor path.iscppmodule(fname)\nend\nfunction path.isobjectfile(fname)\nreturn path.hasextension(fname, { \".o\", \".obj\" })\nend\nfunction path.isresourcefile(fname)\nreturn path.hasextension(fname, \".rc\")\nend\nfunction path.isimagefile(fname)\nlocal extensions = { \".png\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.join(...)\nlocal arg={...}\nlocal numargs = select(\"#\", ...)\nif numargs == 0 then\nreturn \"\";\nend\nlocal allparts = {}\nfor i = numargs, 1, -1 do\nlocal part = select(i, ...)\nif part and #part > 0 and part ~= \".\" then\nwhile part:endswith(\"/\") do\npart = part:sub(1, -2)\nend\ntable.insert(allparts, 1, part)\nif path.isabsolute(part) then\nbreak\nend\nend\nend\nreturn table.concat(allparts, \"/\")\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p"
+ "\nend\nfunction path.translate(p, sep)\nif (type(p) == \"table\") then\nlocal result = { }\nfor _, value in ipairs(p) do\ntable.insert(result, path.translate(value))\nend\nreturn result\nelse\nif (not sep) then\nif (os.is(\"windows\")) then\nsep = \"\\\\\"\nelse\nsep = \"/\"\nend\nend\nlocal result = p:gsub(\"[/\\\\]\", sep)\nreturn result\nend\nend\nfunction path.wildcards(pattern)\npattern = pattern:gsub(\"([%+%.%-%^%$%(%)%%])\", \"%%%1\")\npattern = pattern:gsub(\"%*%*\", \"\\001\")\npattern = pattern:gsub(\"%*\", \"\\002\")\npattern = pattern:gsub(\"\\001\", \".*\")\npattern = pattern:gsub(\"\\002\", \"[^/]*\")\nreturn pattern\nend\nfunction path.trimdots(p)\nlocal changed\nrepeat\nchanged = true\nif p:startswith(\"./\") then\np = p:sub(3)\nelseif p:startswith(\"../\") then\np = p:sub(4)\nelse\nchanged = false\nend\nuntil not changed\nreturn p\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.replacee"
+ "xtension(p, newext)\nlocal ext = path.getextension(p)\nif not ext then\nreturn p\nend\nif #newext > 0 and not newext:findlast(\".\", true) then\nnewext = \".\"..newext\nend\nreturn p:match(\"^(.*)\"..ext..\"$\")..newext\nend\n",
/* base/string.lua */
"function string.explode(s, pattern, plain)\nif (pattern == '') then return false end\nlocal pos = 0\nlocal arr = { }\nfor st,sp in function() return s:find(pattern, pos, plain) end do\ntable.insert(arr, s:sub(pos, st-1))\npos = sp + 1\nend\ntable.insert(arr, s:sub(pos))\nreturn arr\nend\nfunction string.findlast(s, pattern, plain)\nlocal curr = 0\nlocal term = nil\nrepeat\nlocal next, nextterm = s:find(pattern, curr + 1, plain)\nif (next) then\ncurr = next\nterm = nextterm\nend\nuntil (not next)\nif (curr > 0) then\nreturn curr, term\nend\nend\nfunction string.startswith(haystack, needle)\nreturn (haystack:find(needle, 1, true) == 1)\nend\nfunction string.trim(s)\nreturn (s:gsub(\"^%s*(.-)%s*$\", \"%1\"))\nend\n",
@@ -30,9 +31,9 @@ const char* builtin_scripts[] = {
"{...}\nfor i = 1, #arg do\narg[i] = io.esc(arg[i])\nend\nio.printf(msg, unpack(arg))\nend\nfunction io.esc(value)\nif type(value) == \"table\" then\nlocal result = {}\nlocal n = #value\nfor i = 1, n do\ntable.insert(result, io.esc(value[i]))\nend\nreturn result\nend\nreturn _esc(value or \"\")\nend\nfunction io.escaper(func)\n_esc = func or _escaper\nend\n_p = io.printf\n_x = io.xprintf\n",
/* base/globals.lua */
- "premake = { }\npremake.platforms =\n{\nNative =\n{\ncfgsuffix = \"\",\n},\nx32 =\n{\ncfgsuffix = \"32\",\n},\nx64 =\n{\ncfgsuffix = \"64\",\n},\nUniversal =\n{\ncfgsuffix = \"univ\",\n},\nUniversal32 =\n{\ncfgsuffix = \"univ32\",\n},\nUniversal64 =\n{\ncfgsuffix = \"univ64\",\n},\nPS3 =\n{\ncfgsuffix = \"ps3\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"PS3\",\n},\nWiiDev =\n{\ncfgsuffix = \"wii\",\niscrosscompiler = true,\nnamestyle = \"PS3\",\n},\nXbox360 =\n{\ncfgsuffix = \"xbox360\",\niscrosscompiler = true,\nnamestyle = \"windows\",\n},\nPowerPC =\n{\ncfgsuffix = \"ppc\",\niscrosscompiler = true,\n},\nARM =\n{\ncfgsuffix = \"ARM\",\niscrosscompiler = true,\n},\nOrbis =\n{\ncfgsuffix = \"orbis\",\niscrosscompiler = true,\nnamestyle = \"Orbis\",\n},\nDurango =\n{\ncfgsuffix = \"durango\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"windows\",\n},\nTegraAndroi"
- "d =\n{\ncfgsuffix = \"tegraandroid\",\niscrosscompiler = true,\nnamestyle = \"TegraAndroid\",\n},\nNX32 =\n{\ncfgsuffix = \"nx32\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nNX64 =\n{\ncfgsuffix = \"nx64\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nEmscripten =\n{\ncfgsuffix = \"emscripten\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"Emscripten\",\n},\n}\nlocal builtin_dofile = dofile\nfunction dofile(fname)\nlocal oldcwd = os.getcwd()\nlocal oldfile = _SCRIPT\nif (not os.isfile(fname)) then\nlocal path = os.pathsearch(fname, _OPTIONS[\"scripts\"], os.getenv(\"PREMAKE_PATH\"))\nif (path) then\nfname = path..\"/\"..fname\nend\nend\n_SCRIPT = path.getabsolute(fname)\nlocal newcwd = path.getdirectory(_SCRIPT)\nos.chdir(newcwd)\nlocal a, b, c, d, e, f = builtin_dofile(_SCRIPT)\n_SCRIPT = oldfile\nos.chdir(oldcwd)\nreturn a, b, c, d, e, f\nend\nfunction iif(expr, trueval, falseval)\nif (expr) then\nreturn trueval\nelse\nreturn "
- "falseval\nend\nend\nfunction include(fname)\nlocal dir, name = premake.findDefaultScript(fname, false)\nif dir ~= nil then\nreturn dofile(dir .. \"/\" .. name)\nend\nreturn nil\nend\nfunction printf(msg, ...)\nlocal arg={...}\nprint(string.format(msg, table.unpack(arg)))\nend\nfunction typex(t)\nlocal mt = getmetatable(t)\nif (mt) then\nif (mt.__type) then\nreturn mt.__type\nend\nend\nreturn type(t)\nend\n",
+ "premake = { }\npremake.platforms =\n{\nNative =\n{\ncfgsuffix = \"\",\n},\nx32 =\n{\ncfgsuffix = \"32\",\n},\nx64 =\n{\ncfgsuffix = \"64\",\n},\nUniversal =\n{\ncfgsuffix = \"univ\",\n},\nUniversal32 =\n{\ncfgsuffix = \"univ32\",\n},\nUniversal64 =\n{\ncfgsuffix = \"univ64\",\n},\nPS3 =\n{\ncfgsuffix = \"ps3\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"PS3\",\n},\nWiiDev =\n{\ncfgsuffix = \"wii\",\niscrosscompiler = true,\nnamestyle = \"PS3\",\n},\nXbox360 =\n{\ncfgsuffix = \"xbox360\",\niscrosscompiler = true,\nnamestyle = \"windows\",\n},\nPowerPC =\n{\ncfgsuffix = \"ppc\",\niscrosscompiler = true,\n},\nARM =\n{\ncfgsuffix = \"ARM\",\niscrosscompiler = true,\n},\nARM64 =\n{\ncfgsuffix = \"ARM64\",\niscrosscompiler = true,\n},\nOrbis =\n{\ncfgsuffix = \"orbis\",\niscrosscompiler = true,\nnamestyle = \"Orbis\",\n},\nDurango =\n{\ncfgsuffix = \"durango\",\niscrosscompiler = true,\nn"
+ "osharedlibs = true,\nnamestyle = \"windows\",\n},\nTegraAndroid =\n{\ncfgsuffix = \"tegraandroid\",\niscrosscompiler = true,\nnamestyle = \"TegraAndroid\",\n},\nNX32 =\n{\ncfgsuffix = \"nx32\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nNX64 =\n{\ncfgsuffix = \"nx64\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nEmscripten =\n{\ncfgsuffix = \"emscripten\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"Emscripten\",\n},\n[\"gdk-desktop\"] =\n{\ncfgsuffix = \"gdk-desktop\",\nnamestyle = \"windows\",\n},\n[\"gdk-xboxone\"] =\n{\ncfgsuffix = \"gdk-xboxone\",\nnamestyle = \"windows\",\n},\n[\"gdk-scarlett\"] =\n{\ncfgsuffix = \"gdk-scarlett\",\nnamestyle = \"windows\",\n},\n}\nlocal builtin_dofile = dofile\nfunction dofile(fname)\nlocal oldcwd = os.getcwd()\nlocal oldfile = _SCRIPT\nif (not os.isfile(fname)) then\nlocal path = os.pathsearch(fname, _OPTIONS[\"scripts\"], os.getenv(\"PREMAKE_"
+ "PATH\"))\nif (path) then\nfname = path..\"/\"..fname\nend\nend\n_SCRIPT = path.getabsolute(fname)\nlocal newcwd = path.getdirectory(_SCRIPT)\nos.chdir(newcwd)\nlocal a, b, c, d, e, f = builtin_dofile(_SCRIPT)\n_SCRIPT = oldfile\nos.chdir(oldcwd)\nreturn a, b, c, d, e, f\nend\nfunction iif(expr, trueval, falseval)\nif (expr) then\nreturn trueval\nelse\nreturn falseval\nend\nend\nfunction include(fname)\nlocal dir, name = premake.findDefaultScript(fname, false)\nif dir ~= nil then\nreturn dofile(dir .. \"/\" .. name)\nend\nreturn nil\nend\nfunction printf(msg, ...)\nlocal arg={...}\nprint(string.format(msg, table.unpack(arg)))\nend\nfunction typex(t)\nlocal mt = getmetatable(t)\nif (mt) then\nif (mt.__type) then\nreturn mt.__type\nend\nend\nreturn type(t)\nend\n",
/* base/action.lua */
"premake.action = { }\npremake.action.list = { }\nfunction premake.action.add(a)\nlocal missing\nfor _, field in ipairs({\"description\", \"trigger\"}) do\nif (not a[field]) then\nmissing = field\nend\nend\nif (missing) then\nerror(\"action needs a \" .. missing, 3)\nend\npremake.action.list[a.trigger] = a\nend\nfunction premake.action.call(name)\nlocal a = premake.action.list[name]\nfor sln in premake.solution.each() do\nif a.onsolution then\na.onsolution(sln)\nend\nif sln.postsolutioncallbacks then\nfor _,cb in ipairs(sln.postsolutioncallbacks) do\ncb(sln)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif a.onproject then\na.onproject(prj)\nend\nif prj.postprojectcallbacks then\nfor _,cb in ipairs(prj.postprojectcallbacks) do\ncb(prj)\nend\nend\nend\nend\nif a.execute then\na.execute()\nend\nend\nfunction premake.action.current()\nreturn premake.action.get(_ACTION)\nend\nfunction premake.action.get(name)\nreturn premake.action.list[name]\nend\nfunction premake.action.each()\nlocal keys = { }\nfor"
@@ -57,13 +58,13 @@ const char* builtin_scripts[] = {
"return prj\nend\nend\nend\nend\nfunction premake.findfile(prj, extension)\nfor _, fname in ipairs(prj.files) do\nif fname:endswith(extension) then return fname end\nend\nend\nfunction premake.getconfig(prj, cfgname, pltname)\nprj = prj.project or prj\nif pltname == \"Native\" or not table.contains(prj.solution.platforms or {}, pltname) then\npltname = nil\nend\nlocal key = (cfgname or \"\")\nif pltname then key = key .. pltname end\nreturn prj.__configs[key]\nend\nfunction premake.getconfigname(cfgname, platform, useshortname)\nif cfgname then\nlocal name = cfgname\nif platform and platform ~= \"Native\" then\nif useshortname then\nname = name .. premake.platforms[platform].cfgsuffix\nelse\nname = name .. \"|\" .. platform\nend\nend\nreturn iif(useshortname, name:lower(), name)\nend\nend\nfunction premake.getdependencies(prj)\nprj = prj.project or prj\nlocal results = { }\nfor _, cfg in pairs(prj.__configs) do\nfor _, link in ipairs(cfg.links) do\nlocal dep = premake.findproject(link)\nif dep and not table.co"
"ntains(results, dep) then\ntable.insert(results, dep)\nend\nend\nend\nreturn results\nend\nfunction premake.project.getbasename(prjname, pattern)\nreturn pattern:gsub(\"%%%%\", prjname)\nend\nfunction premake.project.getfilename(prj, pattern)\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn path.getrelative(os.getcwd(), fname)\nend\n function premake.getlinks(cfg, kind, part)\nlocal result = iif (part == \"directory\" and kind == \"all\", cfg.libdirs, {})\nlocal cfgname = iif(cfg.name == cfg.project.name, \"\", cfg.name)\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\nlocal function canlink(source, target)\nif (target.kind ~= \"SharedLib\" and target.kind ~= \"StaticLib\") then\nreturn false\nend\nif premake.iscppproject(source) then\nreturn premake.iscppproject(target)\nelseif premake.isdotnetproject(source) then\nreturn premake.isdotnetproject(target)\nelseif premake.isswiftproject(source) then\nreturn pre"
"make.isswiftproject(source) or premake.iscppproject(source)\nend\nend\nfor _, link in ipairs(cfg.links) do\nlocal item\nlocal prj = premake.findproject(link)\nif prj and kind ~= \"system\" then\nlocal prjcfg = premake.getconfig(prj, cfgname, cfg.platform)\nif kind == \"dependencies\" or canlink(cfg, prjcfg) then\nif (part == \"directory\") then\nitem = path.rebase(prjcfg.linktarget.directory, prjcfg.location, cfg.location)\nelseif (part == \"basename\") then\nitem = prjcfg.linktarget.basename\nelseif (part == \"fullpath\") then\nitem = path.rebase(prjcfg.linktarget.fullpath, prjcfg.location, cfg.location)\nelseif (part == \"object\") then\nitem = prjcfg\nend\nend\nelseif not prj and (kind == \"system\" or kind == \"all\") then\nif (part == \"directory\") then\nitem = path.getdirectory(link)\nelseif (part == \"fullpath\") then\nitem = link\nif namestyle == \"windows\" then\nif premake.iscppproject(cfg) then\nitem = item .. \".lib\"\nelseif premake.isdotnetproject(cfg) then\nitem = item .. \".dll\"\nend\nend\nel"
- "seif part == \"name\" then\nitem = path.getname(link)\nelseif part == \"basename\" then\nitem = path.getbasename(link)\nelse\nitem = link\nend\nif item:find(\"/\", nil, true) then\nitem = path.getrelative(cfg.project.location, item)\nend\nend\nif item then\nif pathstyle == \"windows\" and part ~= \"object\" then\nitem = path.translate(item, \"\\\\\")\nend\nif not table.contains(result, item) then\ntable.insert(result, item)\nend\nend\nend\nreturn result\nend\nfunction premake.getnamestyle(cfg)\nreturn premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or \"posix\"\nend\nfunction premake.getpathstyle(cfg)\nif premake.action.current().os == \"windows\" then\nreturn \"windows\"\nelse\nreturn \"posix\"\nend\nend\nfunction premake.gettarget(cfg, direction, pathstyle, namestyle, system)\nif system == \"bsd\" then\nsystem = \"linux\"\nend\nlocal kind = cfg.kind\nif premake.iscppproject(cfg) then\nif (namestyle == \"windows\" or system == \"windows\")\nand kind == \"SharedLib\" and direction ="
- "= \"link\"\nand not cfg.flags.NoImportLib\nthen\nkind = \"StaticLib\"\nend\nif namestyle == \"posix\" and system == \"windows\" and kind ~= \"StaticLib\" then\nnamestyle = \"windows\"\nend\nend\nlocal field = \"build\"\nif direction == \"link\" and cfg.kind == \"SharedLib\" then\nfield = \"implib\"\nend\nlocal name = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal subdir = cfg[field..\"subdir\"] or cfg.targetsubdir or \".\"\nlocal prefix = \"\"\nlocal suffix = \"\"\nlocal ext = \"\"\nlocal bundlepath, bundlename\ndir = path.join(dir, subdir)\nif namestyle == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\next = \".dll\"\nelseif kind == \"StaticLib\" then\next = \".lib\"\nend\nelseif namestyle == \"posix\" then\nif kind == \"WindowedApp\" and system == \"macosx\" and not cfg.options.SkipBundling then\nbu"
- "ndlename = name .. \".app\"\nbundlepath = path.join(dir, bundlename)\ndir = path.join(bundlepath, \"Contents/MacOS\")\nelseif (kind == \"ConsoleApp\" or kind == \"WindowedApp\") and system == \"os2\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\next = iif(system == \"macosx\", \".dylib\", \".so\")\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"PS3\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"Orbis\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".prx\"\nend\nelseif namestyle == \"TegraAndroid\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" or kind == \"SharedLib\" then\nprefix = \"lib\"\next = \".so\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib"
- "\"\next = \".a\"\nend\nelseif namestyle == \"NX\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".nspd_root\"\nelseif kind == \"StaticLib\" then\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".nro\"\nend\nelseif namestyle == \"Emscripten\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".html\"\nelseif kind == \"StaticLib\" then\next = \".bc\"\nelseif kind == \"SharedLib\" then\next = \".js\"\nend\nend\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"suffix\"] or cfg.targetsuffix or suffix\next = cfg[field..\"extension\"] or cfg.targetextension or ext\nlocal result = { }\nresult.basename = name .. suffix\nresult.name = prefix .. name .. suffix .. ext\nresult.directory = dir\nresult.subdirectory = subdir\nresult.prefix = prefix\nresult.suffix = suffix\nresult.fullpath = path.join(result.directory, result.name)\nresult.bundlepath = bundlepath or result.fullpath\nif pathstyle == "
- "\"windows\" then\nresult.directory = path.translate(result.directory, \"\\\\\")\nresult.subdirectory = path.translate(result.subdirectory, \"\\\\\")\nresult.fullpath = path.translate(result.fullpath, \"\\\\\")\nend\nreturn result\nend\nfunction premake.gettool(cfg)\nif premake.iscppproject(cfg) then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]\nend\nlocal action = premake.action.current()\nif action.valid_tools then\nreturn premake[action.valid_tools.cc[1]]\nend\nreturn premake.gcc\nelseif premake.isdotnetproject(cfg) then\nreturn premake.dotnet\nelseif premake.isswiftproject(cfg) then\nreturn premake.swift\nelse\nreturn premake.valac\nend\nend\nfunction premake.project.getvpath(prj, abspath)\nlocal vpath = abspath\nlocal fname = path.getname(abspath)\nlocal max = abspath:len() - fname:len()\n \n -- First check for an exact match from the inverse vpaths\n if prj.inversevpaths and prj.inversevpaths[abspath] then\n return path.join(prj.inversevpaths[abspath], fname)\n"
- " end\n local matches = {}\nfor replacement, patterns in pairs(prj.vpaths or {}) do\nfor _, pattern in ipairs(patterns) do\nlocal i = abspath:find(path.wildcards(pattern))\nif i == 1 then\ni = pattern:find(\"*\", 1, true) or (pattern:len() + 1)\nlocal leaf\nif i < max then\nleaf = abspath:sub(i)\nelse\nleaf = fname\nend\nif leaf:startswith(\"/\") then\nleaf = leaf:sub(2)\nend\nlocal stem = \"\"\nif replacement:len() > 0 then\nstem, stars = replacement:gsub(\"%*\", \"\")\nif stars == 0 then\nleaf = path.getname(leaf)\nend\nelse\nleaf = path.getname(leaf)\nend\ntable.insert(matches, path.join(stem, leaf))\nend\nend\nend\n \n if #matches > 0 then\n -- for the sake of determinism, return the first alphabetically\n table.sort(matches)\n vpath = matches[1]\n end\nreturn path.trimdots(vpath)\nend\nfunction premake.hascppproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.iscppproject(prj) then\nreturn true\nend\nend\nend\nfunctio"
- "n premake.hasdotnetproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.isdotnetproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.project.iscproject(prj)\nreturn prj.language == \"C\"\nend\nfunction premake.iscppproject(prj)\nreturn (prj.language == \"C\" or prj.language == \"C++\")\nend\nfunction premake.isdotnetproject(prj)\nreturn (prj.language == \"C#\")\nend\nfunction premake.isvalaproject(prj)\nreturn (prj.language == \"Vala\")\nend\nfunction premake.isswiftproject(prj)\nreturn (prj.language == \"Swift\")\nend\n",
+ "seif part == \"name\" then\nitem = path.getname(link)\nelseif part == \"basename\" then\nitem = path.getbasename(link)\nelse\nitem = link\nend\nif item:find(\"/\", nil, true) then\nitem = path.getrelative(cfg.project.location, item)\nend\nend\nif item then\nif pathstyle == \"windows\" and part ~= \"object\" then\nitem = path.translate(item, \"\\\\\")\nend\nif not table.contains(result, item) then\ntable.insert(result, item)\nend\nend\nend\nreturn result\nend\nfunction premake.getnamestyle(cfg)\nreturn premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or \"posix\"\nend\nfunction premake.getpathstyle(cfg)\nif premake.action.current().os == \"windows\" then\nreturn \"windows\"\nelse\nreturn \"posix\"\nend\nend\nfunction premake.gettarget(cfg, direction, pathstyle, namestyle, system)\nif system == \"bsd\" then\nsystem = \"linux\"\nend\nlocal kind = cfg.kind\nif premake.iscppproject(cfg) or premake.isvalaproject(cfg) then\nif (namestyle == \"windows\" or system == \"windows\")\nand kind =="
+ " \"SharedLib\" and direction == \"link\"\nand not cfg.flags.NoImportLib\nthen\nkind = \"StaticLib\"\nend\nif namestyle == \"posix\" and system == \"windows\" and kind ~= \"StaticLib\" then\nnamestyle = \"windows\"\nend\nend\nlocal field = \"build\"\nif direction == \"link\" and cfg.kind == \"SharedLib\" then\nfield = \"implib\"\nend\nlocal name = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal subdir = cfg[field..\"subdir\"] or cfg.targetsubdir or \".\"\nlocal prefix = \"\"\nlocal suffix = \"\"\nlocal ext = \"\"\nlocal bundlepath, bundlename\ndir = path.join(dir, subdir)\nif namestyle == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\next = \".dll\"\nelseif kind == \"StaticLib\" then\next = \".lib\"\nend\nelseif namestyle == \"posix\" then\nif kind == \"WindowedApp\" and system == \"macosx\" and not cfg"
+ ".options.SkipBundling then\nbundlename = name .. \".app\"\nbundlepath = path.join(dir, bundlename)\ndir = path.join(bundlepath, \"Contents/MacOS\")\nelseif (kind == \"ConsoleApp\" or kind == \"WindowedApp\") and system == \"os2\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\next = iif(system == \"macosx\", \".dylib\", \".so\")\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"PS3\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"Orbis\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".prx\"\nend\nelseif namestyle == \"TegraAndroid\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" or kind == \"SharedLib\" then\nprefix = \"lib\"\next = \".so\"\nelseif kind == \"St"
+ "aticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"NX\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".nspd_root\"\nelseif kind == \"StaticLib\" then\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".nro\"\nend\nelseif namestyle == \"Emscripten\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".html\"\nelseif kind == \"StaticLib\" then\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".js\"\nend\nend\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"suffix\"] or cfg.targetsuffix or suffix\next = cfg[field..\"extension\"] or cfg.targetextension or ext\nlocal result = { }\nresult.basename = name .. suffix\nresult.name = prefix .. name .. suffix .. ext\nresult.directory = dir\nresult.subdirectory = subdir\nresult.prefix = prefix\nresult.suffix = suffix\nresult.fullpath = path.join(result.directory, result.name)\nresult.bundlepath = bundlepath or resul"
+ "t.fullpath\nif pathstyle == \"windows\" then\nresult.directory = path.translate(result.directory, \"\\\\\")\nresult.subdirectory = path.translate(result.subdirectory, \"\\\\\")\nresult.fullpath = path.translate(result.fullpath, \"\\\\\")\nend\nreturn result\nend\nfunction premake.gettool(prj)\nif premake.iscppproject(prj) then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]\nend\nlocal action = premake.action.current()\nif action.valid_tools then\nreturn premake[action.valid_tools.cc[1]]\nend\nreturn premake.gcc\nelseif premake.isdotnetproject(prj) then\nreturn premake.dotnet\nelseif premake.isswiftproject(prj) then\nreturn premake.swift\nelse\nreturn premake.valac\nend\nend\nfunction premake.project.getvpath(prj, abspath)\nlocal vpath = abspath\nlocal fname = path.getname(abspath)\nlocal max = abspath:len() - fname:len()\n -- First check for an exact match from the inverse vpaths\n if prj.inversevpaths and prj.inversevpaths[abspath] then\n return path.join(prj.inversevpaths["
+ "abspath], fname)\n end\n local matches = {}\nfor replacement, patterns in pairs(prj.vpaths or {}) do\nfor _, pattern in ipairs(patterns) do\nlocal i = abspath:find(path.wildcards(pattern))\nif i == 1 then\ni = pattern:find(\"*\", 1, true) or (pattern:len() + 1)\nlocal leaf\nif i < max then\nleaf = abspath:sub(i)\nelse\nleaf = fname\nend\nif leaf:startswith(\"/\") then\nleaf = leaf:sub(2)\nend\nlocal stem = \"\"\nif replacement:len() > 0 then\nstem, stars = replacement:gsub(\"%*\", \"\")\nif stars == 0 then\nleaf = path.getname(leaf)\nend\nelse\nleaf = path.getname(leaf)\nend\ntable.insert(matches, path.join(stem, leaf))\nend\nend\nend\n if #matches > 0 then\n -- for the sake of determinism, return the first alphabetically\n table.sort(matches)\n vpath = matches[1]\n end\nreturn path.trimdots(vpath)\nend\nfunction premake.hascppproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.iscppproject(prj) then\nreturn true\nend\nend\nend"
+ "\nfunction premake.hasdotnetproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.isdotnetproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.project.iscproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn language == \"C\"\nend\nfunction premake.iscppproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn (language == \"C\" or language == \"C++\")\nend\nfunction premake.isdotnetproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn (language == \"C#\")\nend\nfunction premake.isvalaproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn (language == \"Vala\")\nend\nfunction premake.isswiftproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn (language == \"Swift\")\nend\n",
/* base/config.lua */
"premake.config = { }\nlocal config = premake.config\nfunction premake.config.isdebugbuild(cfg)\nif cfg.flags.DebugRuntime then\nreturn true\nend\nif cfg.flags.ReleaseRuntime then\nreturn false\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then\nreturn false\nend\nif not cfg.flags.Symbols then\nreturn false\nend\nreturn true\nend\nfunction premake.config.eachfile(cfg)\nlocal i = 0\nlocal t = cfg.files\nreturn function ()\ni = i + 1\nif (i <= #t) then\nlocal fcfg = cfg.__fileconfigs[t[i]]\nfcfg.vpath = premake.project.getvpath(cfg.project, fcfg.name)\nreturn fcfg\nend\nend\nend\nfunction premake.config.isincrementallink(cfg)\nif cfg.kind == \"StaticLib\" then\nreturn false\nend\nreturn not config.islinkeroptimizedbuild(cfg.flags) and not cfg.flags.NoIncrementalLink\nend\nfunction premake.config.isoptimizedbuild(flags)\nreturn flags.Optimize or flags.OptimizeSize or flags.OptimizeSpeed\nend\nfunction premake.config.islinkeroptimizedbuild(flags)\nreturn config.isoptimizedbuild(fl"
@@ -71,22 +72,22 @@ const char* builtin_scripts[] = {
/* base/bake.lua */
"premake.bake = { }\nlocal bake = premake.bake\nlocal nocopy =\n{\nblocks = true,\nkeywords = true,\nprojects = true,\n__configs = true,\n}\nlocal nocascade =\n{\nmakesettings = true,\n}\nlocal keeprelative =\n{\nbasedir = true,\nlocation = true,\n}\nfunction premake.getactiveterms(obj)\nlocal terms = { _action = _ACTION:lower(), os = os.get() }\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\nreturn terms\nend\nfunction premake.iskeywordmatch(keyword, terms)\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\nfor _, pattern in ipairs(keyword:explode(\" or \")) do\nfor termkey, term in pairs(terms) do\nif term:match(pattern) == term then\nreturn termkey\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched "
- "then\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfunction adjustpathlist(list)\nfor i, p in ipairs(list) do\nlist[i] = path.getrelative(location, p)\nend\nend\nif obj.allfiles ~= nil then\nadjustpathlist(obj.allfiles)\nend\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not keeprelative[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value)\nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nadjustpathlist(value)\nelseif field.kind == \"keypath\" then\nfor k,v in pairs(value) do\nadjustpathlist(v)\nend\nend\nend\nend\nend\nlocal function removevalue(tbl, remove)\nfor index, item in ipairs(tbl) do\nif item == remove then\ntable.remove(tbl, index)\nbreak\nend\nend\nend\nlocal function removevalues(tbl, removes)\nfor k, v in pairs(tbl) do\nfor _, pat"
- "tern in ipairs(removes) do\nif pattern == tbl[k] then\nif type(k) == \"number\" then\ntable.remove(tbl, k)\nelse\ntbl[k] = nil\nend\nbreak\nend\nend\nend\nend\nlocal function mergefield(kind, dest, src, mergecopiestotail)\nlocal tbl = dest or { }\nif kind == \"keyvalue\" or kind == \"keypath\" then\nfor key, value in pairs(src) do\ntbl[key] = mergefield(\"list\", tbl[key], value, mergecopiestotail)\nend\nelse\nfor _, item in ipairs(src) do\nif tbl[item] then\nif mergecopiestotail then\nremovevalue(tbl, item)\ntable.insert(tbl, item)\ntbl[item] = item\nend\nelse\ntable.insert(tbl, item)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function mergeobject(dest, src)\nif not src then\nreturn\nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value, field.mergecopiestotail)\nif src.removes then\nremoves = src.removes[fieldname]\nif rem"
- "oves then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then\nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then\ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = ob"
- "j.solution or obj\nlocal terms = premake.getactiveterms(obj)\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nfor _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.nam"
- "e)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, iif(cfg.flags.SingleOutputDir==true,num_variations-1,num_variations) do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objec"
- "tsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n return nil\n end\n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n proj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n"
- " };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind(usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n -- The recursion will only look at the \"uses\" field on *usage* proje"
- "cts.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local function getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname,\n \"links\", true);\n end\n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n return dstArray;\n end\n local function isnameofproj(cfg, "
- "strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n return false;\n end\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n printf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.nam"
- "e);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusagedata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local"
- " bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n for name, field in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\n local function inverseliteralvpaths()\n for sln in premake.solution.each() do\n for _,prj in ipairs(sln.projects) do\n prj.inversevpaths = "
- "{}\n for replacement, patterns in pairs(prj.vpaths or {}) do\n for _, pattern in ipairs(patterns) do\n if string.find(pattern, \"*\") == nil then\n prj.inversevpaths[pattern] = replacement\n end\n end\n end\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\n -- convert paths for imported projects to be relative to solution location\nfor sln in premake.solution.each() do\nfor _, iprj in ipairs(sln.importedprojects) do\niprj.location = path.getabsolute(iprj.location)\nend\nend\n inverseliteralvpaths()\nfor sln in premake.solution.each() do\n"
- "local basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nfor cfgName, cfg in pairs(prj.__configs) do\ncfg.build = true\nlocal removes = nil\nif cfg.removes ~= nil then\nremoves = cfg.removes[\"platforms\"];\nend\nif removes ~= nil then\nfor _,p in ipairs(removes) do\nif p == cfg.platform then\ncfg.build = false\nend\nend\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor "
- "_, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"Bundle\"\nand _ACTION ~= \"gmake\"\nand (_ACTION ~= \"ninja\" and (not prj.options or not prj.options.SkipBundling))\nand not _ACTION:match(\"xcode[0-9]\") then\ncfg.kind = \"SharedLib\"\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal removefiles = cfg.removefiles\nif _ACTION == 'gmake' or _ACTION == 'ninja' then\nremovefiles = table.join(removefiles, cfg.excludes)\nend\nlocal removefilesDict = {}\nfor _, fname in ipairs(removefiles) do"
- "\nremovefilesDict[fname] = true\nend\nlocal files = {}\nfor _, fname in ipairs(cfg.files) do\nif removefilesDict[fname] == nil then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nlocal allfiles = {}\nlocal allfilesDict = {}\nif cfg.allfiles ~= nil then\nfor _, fname in ipairs(cfg.allfiles) do\nif allfilesDict[fname] == nil then\nif removefilesDict[fname] == nil then\nallfilesDict[fname] = true\ntable.insert(allfiles, fname)\nend\nend\nend\nend\ncfg.allfiles = allfiles\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\nlocal cfgfields = {\n{\"__fileconfigs\", cfg.files},\n{\"__allfileconfigs\", cfg.allfiles},\n}\nfor _, cfgfield in ipairs(cfgfields) do\nlocal fieldname = cfgfield[1]\nlocal field = cfgfield[2]\ncfg[fieldname] = { }\nfor _, fname in ipairs(field) do\nlocal fcfg = {}\nif premake._filelevelconfig then\ncfg.terms.required = fname:lower()\nfor _, blk in ipairs(cfg.project."
- "blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nend\nfcfg.name = fname\ncfg[fieldname][fname] = fcfg\ntable.insert(cfg[fieldname], fcfg)\nend\nend\nend\n",
+ "then\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfunction adjustpathlist(list)\nfor i, p in ipairs(list) do\nlist[i] = path.getrelative(location, p)\nend\nend\nif obj.allfiles ~= nil then\nadjustpathlist(obj.allfiles)\nend\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not keeprelative[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value)\nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nadjustpathlist(value)\nelseif field.kind == \"keypath\" then\nfor k,v in pairs(value) do\nadjustpathlist(v)\nend\nend\nend\nend\nend\nlocal function removevalue(tbl, remove)\nfor index, item in ipairs(tbl) do\nif item == remove then\ntable.remove(tbl, index)\nbreak\nend\nend\nend\n local function removevalues(tbl, removes)\nfor i = #tbl, 1, -1 do\nfor _, patte"
+ "rn in ipairs(removes) do\nif pattern == tbl[i] then\ntable.remove(tbl, i)\nbreak\nend\nend\nend\nfor k, v in pairs(tbl) do\nfor _, pattern in ipairs(removes) do\nif pattern == tbl[k] then\ntbl[k] = nil\nbreak\nend\nend\nend\nend\nlocal function mergefield(kind, dest, src, mergecopiestotail)\nlocal tbl = dest or { }\nif kind == \"keyvalue\" or kind == \"keypath\" then\nfor key, value in pairs(src) do\ntbl[key] = mergefield(\"list\", tbl[key], value, mergecopiestotail)\nend\nelse\nfor _, item in ipairs(src) do\nif tbl[item] then\nif mergecopiestotail then\nremovevalue(tbl, item)\ntable.insert(tbl, item)\ntbl[item] = item\nend\nelse\ntable.insert(tbl, item)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function mergeobject(dest, src)\nif not src then\nreturn\nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value, field.mergecopies"
+ "totail)\nif src.removes then\nremoves = src.removes[fieldname]\nif removes then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then\nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then\ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collap"
+ "se(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = obj.solution or obj\nlocal terms = premake.getactiveterms(obj)\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nfor _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path"
+ ".join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.name)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, iif(cfg.flags.SingleOutputDir==true,num_variations-1,num_variations) do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyl"
+ "e, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n return nil\n end\n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n pr"
+ "oj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind(usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n "
+ "-- The recursion will only look at the \"uses\" field on *usage* projects.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local function getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname,\n \"links\", true);\n end\n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;"
+ "\n end\n return dstArray;\n end\n local function isnameofproj(cfg, strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n return false;\n end\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n p"
+ "rintf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.name);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusag"
+ "edata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n for name, field in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\n local function inverseliteralvpaths()\n for sln in premake.solution.each() do\n for"
+ " _,prj in ipairs(sln.projects) do\n prj.inversevpaths = {}\n for replacement, patterns in pairs(prj.vpaths or {}) do\n for _, pattern in ipairs(patterns) do\n if string.find(pattern, \"*\") == nil then\n prj.inversevpaths[pattern] = replacement\n end\n end\n end\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\n -- convert paths for imported projects to be relative to solution location\nfor sln in premake.solution.each() do\nfor _, iprj in ipairs(sln.importedprojects) do\niprj.location = path.getabsolute(iprj.location)\nend\nend\n"
+ " inverseliteralvpaths()\nfor sln in premake.solution.each() do\nlocal basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nfor cfgName, cfg in pairs(prj.__configs) do\ncfg.build = true\nlocal removes = nil\nif cfg.removes ~= nil then\nremoves = cfg.removes[\"platforms\"];\nend\nif removes ~= nil then\nfor _,p in ipairs(removes) do\nif p == cfg.platform then\ncfg.build = false\nend\nend\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntabl"
+ "e.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"Bundle\"\nand _ACTION ~= \"gmake\"\nand (_ACTION ~= \"ninja\" and (not prj.options or not prj.options.SkipBundling))\nand not _ACTION:match(\"xcode[0-9]\") then\ncfg.kind = \"SharedLib\"\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal removefiles = cfg.removefiles\nif _ACTION == 'gmake' or _ACTION == 'ninja' then\nremovefiles = table.join(removefiles, cfg.excludes)\ne"
+ "nd\nlocal removefilesDict = {}\nfor _, fname in ipairs(removefiles) do\nremovefilesDict[fname] = true\nend\nlocal files = {}\nfor _, fname in ipairs(cfg.files) do\nif removefilesDict[fname] == nil then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nlocal allfiles = {}\nlocal allfilesDict = {}\nif cfg.allfiles ~= nil then\nfor _, fname in ipairs(cfg.allfiles) do\nif allfilesDict[fname] == nil then\nif removefilesDict[fname] == nil then\nallfilesDict[fname] = true\ntable.insert(allfiles, fname)\nend\nend\nend\nend\ncfg.allfiles = allfiles\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\nlocal cfgfields = {\n{\"__fileconfigs\", cfg.files},\n{\"__allfileconfigs\", cfg.allfiles},\n}\nfor _, cfgfield in ipairs(cfgfields) do\nlocal fieldname = cfgfield[1]\nlocal field = cfgfield[2]\ncfg[fieldname] = { }\nfor _, fname in ipairs(field) do\nlocal fcfg = {}\nif premake._filelevelconfig then"
+ "\ncfg.terms.required = fname:lower()\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nend\nfcfg.name = fname\ncfg[fieldname][fname] = fcfg\ntable.insert(cfg[fieldname], fcfg)\nend\nend\nend\n",
/* base/api.lua */
"premake.fields = {}\npremake.check_paths = false\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif typex(container) == \"project\" then\ncontainer = container.solution\nend\nif typex(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, "
@@ -101,22 +102,23 @@ const char* builtin_scripts[] = {
"nd(_ACTION, \"vs\") ~= 1 then\nerror(\"Only available for visual studio actions\")\nend\nsln, err = premake.getobject(\"solution\")\nif not sln then\nerror(err)\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nlocal project = {}\nproject.location = location\nproject.group = group\nproject.flags = {}\ntable.insert(sln.importedprojects, project)\n end\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\nfunction enablefilelevelconfig()\npremake._filelevelconfig = true\nend\nfunction newapifield(field)\npremake.fields[field.name] = field\n_G[field.name] = function(value)\nreturn accessor(field.name, value)\nend\nif field.kind == \"list\"\nor field.kind == \"dirlist\"\nor field.kind == \"filelist\"\nor field.kind == \"absolutefilelist\"\nthen\nif field.name ~= \"removefiles\"\nand field.name ~= \"files\" then\n_G[\"remove\"..field.name] = function(value)\npremake.remove(field.name, value)\nend\nend\nend\nend\nnewapifield {\nname = \"arc"
"hivesplit_size\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"basedir\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"buildaction\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n}\nnewapifield {\nname = \"buildoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_asm\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_c\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_cpp\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_objc\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_objcpp\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_vala\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"clrreferences\",\nkind = \"list\",\nscope = \"container\",\n}\nnewapifield {\nname"
" = \"configurations\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"custombuildtask\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugcmd\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugargs\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugenvs\" ,\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"defines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"deploymentoptions\",\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"dependency\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"deploymode\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"excludes\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"forcenative\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield "
- "{\nname = \"nopch\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"files\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"removefiles\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"flags\",\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nAntBuildDebuggable = 1,\nATL = 1,\nC7DebugInfo = 1,\nCpp11 = 1,\nCpp14 = 1,\nCpp17 = 1,\nCppLatest = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nDeploymentContent = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nEnableAVX = 1,\nEnableAVX2 = 1,\nPedanticWarnings = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nFullSymbols = 1,\nGenerateMapFiles = 1,\nHotpatchable = 1,\nLinkSupportCircularDependencies = 1,\nManaged = 1,\nMinimumWarnings = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoBufferSecurityCheck = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNo"
- "FramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoJMC = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoOptimizeLink = 1,\nNoPCH = 1,\nNoRTTI = 1,\nNoRuntimeChecks = 1,\nNoWinMD = 1, -- explicitly disables Windows Metadata\nNoWinRT = 1, -- explicitly disables Windows Runtime Extension\nFastCall = 1,\nStdCall = 1,\nSingleOutputDir = 1,\nObjcARC = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nDebugRuntime = 1,\nReleaseRuntime = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnitySupport = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nUseFullPaths = 1,\nUseLDResponseFile = 1,\nUseObjectResponseFile = 1,\nWinMain = 1\n}\nlocal englishToAmericanSpelling =\n{\nnooptimiselink = 'nooptimizelink',\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() =="
- " lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n}\nnewapifield {\nname = \"framework\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n\"4.5.1\",\n\"4.5.2\",\n\"4.6\",\n\"4.6.1\",\n\"4.6.2\",\n}\n}\nnewapifield {\nname = \"iostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"macostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"tvostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformminversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"forcedincludes\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imagepath\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imageoptions"
- "\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"includedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"systemincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"userincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"usingdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"kind\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"Window"
- "edApp\",\n\"StaticLib\",\n\"SharedLib\",\n\"Bundle\",\n}\n}\nnewapifield {\nname = \"language\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\",\n\"Vala\",\n\"Swift\",\n}\n}\nnewapifield {\nname = \"libdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n}\nnewapifield {\nname = \"linkoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"links\",\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\nmergecopiestotail = true,\n}\nnewapifield {\nname = \"location\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"makesettings\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"messageskip\",\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuild"
- "ingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n}\nnewapifield {\nname = \"msgarchiving\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgprecompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile_objc\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgresource\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msglinking\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"objdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"options\",\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1,"
- "\nSkipBundling = 1,\nXcodeLibrarySchemes = 1,\nXcodeSchemeNoConfigs = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n}\nnewapifield {\nname = \"pchheader\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pchsource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"platforms\",\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n}\nnewapifield {\nname = \"postbuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prebuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postcompiletasks\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prelinkcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"propertysheets\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pullmappingfile\","
- "\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"applicationdatadir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"finalizemetasource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resdefines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"sdkreferences\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"startproject\",\nkind = \"string\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"targetdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsubdir\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = "
- "\"targetprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"trimpaths\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"uuid\",\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n}\nnewapifield {\nname = \"uses\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vapidirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vpaths\",\nkind = \"keypath\",\nsco"
- "pe = \"container\",\n}\nnewapifield {\nname = \"vsimportreferences\",\nkind = \"filelist\",\nscope = \"container\",\n}\nnewapifield {\nname = \"dpiawareness\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"None\",\n\"High\",\n\"HighPerMonitor\",\n}\n}\nnewapifield {\nname = \"xcodeprojectopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodetargetopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodescriptphases\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodecopyresources\",\nkind = \"table\",\nscope = \"project\",\n}\nnewapifield {\nname = \"xcodecopyframeworks\",\nkind = \"filelist\",\nscope = \"project\",\n}\nnewapifield {\nname = \"wholearchive\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"swiftmodulemaps\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"linkopti"
- "ons_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidtargetapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidminapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidarch\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"armv7-a\",\n\"armv7-a-hard\",\n\"arm64-v8a\",\n\"x86\",\n\"x86_64\",\n}\n}\nnewapifield {\nname = \"androidndktoolchainversion\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidstltype\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidcppstandard\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"c++98\",\n\"c++11\",\n\"c++1y\",\n\"gnu++98\",\n\"gnu++11\",\n\"gnu++1y\",\n}\n}\nnewapifield {\nname = \"androidlinker\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"bfd\",\n\"gold\",\n}\n}\nnewapifield {\nname = \"androiddebugintentparams\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = "
- "\"antbuildjavasourcedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildassetsdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postsolutioncallbacks\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"postprojectcallbacks\",\nkind = \"list\",\nscope = \"project\",\n}\n",
+ "{\nname = \"nopch\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"files\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"removefiles\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"flags\",\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nAntBuildDebuggable = 1,\nC7DebugInfo = 1,\nCpp11 = 1,\nCpp14 = 1,\nCpp17 = 1,\nCpp20 = 1,\nCppLatest = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nDeploymentContent = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nEnableAVX = 1,\nEnableAVX2 = 1,\nPedanticWarnings = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nFullSymbols = 1,\nGenerateMapFiles = 1,\nHotpatchable = 1,\nLinkSupportCircularDependencies = 1,\nManaged = 1,\nMinimumWarnings = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoBufferSecurityCheck = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePoi"
+ "nter = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoJMC = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoOptimizeLink = 1,\nNoPCH = 1,\nNoRTTI = 1,\nNoRuntimeChecks = 1,\nNoWinMD = 1, -- explicitly disables Windows Metadata\nNoWinRT = 1, -- explicitly disables Windows Runtime Extension\nFastCall = 1,\nStdCall = 1,\nSingleOutputDir = 1,\nObjcARC = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nDebugRuntime = 1,\nReleaseRuntime = 1,\nSEH = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnitySupport = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nUseFullPaths = 1,\nUseLDResponseFile = 1,\nUseObjectResponseFile = 1,\nWinMain = 1\n}\nlocal englishToAmericanSpelling =\n{\nnooptimiselink = 'nooptimizelink',\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn"
+ " v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n}\nnewapifield {\nname = \"framework\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n\"4.5.1\",\n\"4.5.2\",\n\"4.6\",\n\"4.6.1\",\n\"4.6.2\",\n}\n}\nnewapifield {\nname = \"iostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"macostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"tvostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"visionostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformminversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"forcedincludes\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imagepath\","
+ "\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imageoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"includedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"systemincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"userincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"usingdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"kind\","
+ "\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\",\n\"Bundle\",\n}\n}\nnewapifield {\nname = \"language\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\",\n\"Vala\",\n\"Swift\",\n}\n}\nnewapifield {\nname = \"libdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n}\nnewapifield {\nname = \"linkoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"links\",\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\nmergecopiestotail = true,\n}\nnewapifield {\nname = \"location\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"makesettings\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"messageskip\",\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed "
+ "= function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n}\nnewapifield {\nname = \"msgarchiving\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgprecompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile_objc\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgresource\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msglinking\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"objdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"options\",\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallo"
+ "wed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1,\nSkipBundling = 1,\nXcodeLibrarySchemes = 1,\nXcodeSchemeNoConfigs = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n}\nnewapifield {\nname = \"pchheader\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pchsource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"platforms\",\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n}\nnewapifield {\nname = \"postbuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prebuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postcompiletasks\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prelinkcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"propertysheets\",\nkind ="
+ " \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pullmappingfile\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"applicationdatadir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"finalizemetasource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resdefines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"sdkreferences\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"startproject\",\nkind = \"string\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"targetdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsubdir\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"t"
+ "argetname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"trimpaths\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"uuid\",\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n}\nnewapifield {\nname = \"uses\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vapidirs\",\nkind = \"dirlist\",\nsc"
+ "ope = \"config\",\n}\nnewapifield {\nname = \"vpaths\",\nkind = \"keypath\",\nscope = \"container\",\n}\nnewapifield {\nname = \"vsimportreferences\",\nkind = \"filelist\",\nscope = \"container\",\n}\nnewapifield {\nname = \"dpiawareness\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"None\",\n\"High\",\n\"HighPerMonitor\",\n}\n}\nnewapifield {\nname = \"xcodeprojectopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodetargetopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodescriptphases\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodecopyresources\",\nkind = \"table\",\nscope = \"project\",\n}\nnewapifield {\nname = \"xcodecopyframeworks\",\nkind = \"filelist\",\nscope = \"project\",\n}\nnewapifield {\nname = \"wholearchive\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"swiftmodulemaps\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_swif"
+ "t\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"linkoptions_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidtargetapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidminapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidarch\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"armv7-a\",\n\"armv7-a-hard\",\n\"arm64-v8a\",\n\"x86\",\n\"x86_64\",\n}\n}\nnewapifield {\nname = \"androidndktoolchainversion\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidstltype\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidcppstandard\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"c++98\",\n\"c++11\",\n\"c++1y\",\n\"gnu++98\",\n\"gnu++11\",\n\"gnu++1y\",\n}\n}\nnewapifield {\nname = \"androidlinker\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"bfd\",\n\"gold\",\n}\n}\nnewapifield {\nname = \"androiddebugi"
+ "ntentparams\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjavasourcedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildassetsdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postsolutioncallbacks\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"postprojectcallbacks\",\nkind = \"list\",\nscope = \"project\",\n}\n",
/* base/cmdline.lua */
"newoption\n{\ntrigger = \"cc\",\nvalue = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\", \"OpenWatcom\" },\n{ \"ghs\", \"Green Hills Software\" },\n}\n}\nnewoption\n{\ntrigger = \"dotnet\",\nvalue = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\", \"Microsoft .NET (csc)\" },\n{ \"mono\", \"Novell Mono (mcs)\" },\n{ \"pnet\", \"Portable.NET (cscc)\" },\n}\n}\nnewoption\n{\ntrigger = \"file\",\nvalue = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger = \"os\",\nvalue = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\", \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\", \"Linux\" },\n{ \"macosx\", \"Apple Mac OS X\" },\n{ \"solaris\", \"Sola"
- "ris\" },\n{ \"windows\", \"Microsoft Windows\" },\n}\n}\nnewoption\n{\ntrigger = \"platform\",\nvalue = \"VALUE\",\ndescription = \"Add target architecture (if supported by action)\",\nallowed = {\n{ \"x32\", \"32-bit\" },\n{ \"x64\", \"64-bit\" },\n{ \"universal\", \"Mac OS X Universal, 32- and 64-bit\" },\n{ \"universal32\", \"Mac OS X Universal, 32-bit only\" },\n{ \"universal64\", \"Mac OS X Universal, 64-bit only\" },\n{ \"ps3\", \"Playstation 3\" },\n{ \"orbis\", \"Playstation 4\" },\n{ \"xbox360\", \"Xbox 360\" },\n{ \"durango\", \"Xbox One\" },\n{ \"ARM\", \"ARM\" },\n{ \"PowerPC\", \"PowerPC\" },\n}\n}\nnewoption\n{\ntrigger = \"scripts\",\nvalue = \"path\",\ndescription = \"Search for additional scripts on the given path\"\n}\nnewoption\n{\ntrigger = \"debug-profiler\",\ndescription = \"GENie script generation profiler.\"\n}\nnewoption\n{\ntrigger = \"version\",\ndescription = \"Display version information\"\n}\n",
+ "ris\" },\n{ \"windows\", \"Microsoft Windows\" },\n}\n}\nnewoption\n{\ntrigger = \"platform\",\nvalue = \"VALUE\",\ndescription = \"Add target architecture (if supported by action)\",\nallowed = {\n{ \"x32\", \"32-bit\" },\n{ \"x64\", \"64-bit\" },\n{ \"universal\", \"Mac OS X Universal, 32- and 64-bit\" },\n{ \"universal32\", \"Mac OS X Universal, 32-bit only\" },\n{ \"universal64\", \"Mac OS X Universal, 64-bit only\" },\n{ \"ps3\", \"Playstation 3\" },\n{ \"orbis\", \"Playstation 4\" },\n{ \"xbox360\", \"Xbox 360\" },\n{ \"durango\", \"Xbox One\" },\n{ \"ARM\", \"ARM\" },\n{ \"ARM64\", \"ARM64\" },\n{ \"PowerPC\", \"PowerPC\" },\n{ \"nx32\", \"Nintendo Switch, 32-bit only\" },\n{ \"nx64\", \"Nintendo Switch, 64-bit only\" },\n{ \"gdk-desktop\", \"GDK Windows Desktop\" },\n{ \"gdk-xboxone\", \"GDK Xbox One\" },\n{ \"gdk-scarlett\",\"GDK Xbox Scarlett\" },\n}\n}\nnewoption\n{\ntrigger = \"scripts\",\nvalue = \"path"
+ "\",\ndescription = \"Search for additional scripts on the given path\"\n}\nnewoption\n{\ntrigger = \"debug-profiler\",\ndescription = \"GENie script generation profiler.\"\n}\nnewoption\n{\ntrigger = \"version\",\ndescription = \"Display version information\"\n}\n",
/* base/inspect.lua */
"-- Copyright (c) 2013 Enrique García Cota\nlocal function smartQuote(str)\n if str:match('\"') and not str:match(\"'\") then\n return \"'\" .. str .. \"'\"\n end\n return '\"' .. str:gsub('\"', '\\\\\"') .. '\"'\nend\nlocal controlCharsTranslation = {\n [\"\\a\"] = \"\\\\a\", [\"\\b\"] = \"\\\\b\", [\"\\f\"] = \"\\\\f\", [\"\\n\"] = \"\\\\n\",\n [\"\\r\"] = \"\\\\r\", [\"\\t\"] = \"\\\\t\", [\"\\v\"] = \"\\\\v\"\n}\nlocal function escapeChar(c) return controlCharsTranslation[c] end\nlocal function escape(str)\n local result = str:gsub(\"\\\\\", \"\\\\\\\\\"):gsub(\"(%c)\", escapeChar)\n return result\nend\nlocal function isIdentifier(str)\n return type(str) == 'string' and str:match( \"^[_%a][_%a%d]*$\" )\nend\nlocal function isArrayKey(k, length)\n return type(k) == 'number' and 1 <= k and k <= length\nend\nlocal function isDictionaryKey(k, length)\n return not isArrayKey(k, length)\nend\nlocal defaultTypeOrders = {\n ['number'] = 1, ['boolean'] = 2, ['string'] = 3, ['table'] = 4,\n ['fu"
@@ -146,13 +148,13 @@ const char* builtin_scripts[] = {
"fg.kind == \"ConsoleApp\") then\nreturn \"Exe\"\nelseif (cfg.kind == \"WindowedApp\") then\nreturn \"WinExe\"\nelseif (cfg.kind == \"SharedLib\") then\nreturn \"Library\"\nend\nend\n",
/* tools/gcc.lua */
- "premake.gcc = { }\npremake.gcc.cc = \"gcc\"\npremake.gcc.cxx = \"g++\"\npremake.gcc.ar = \"ar\"\npremake.gcc.rc = \"windres\"\npremake.gcc.llvm = false\nlocal cflags =\n{\nEnableSSE = \"-msse\",\nEnableSSE2 = \"-msse2\",\nEnableAVX = \"-mavx\",\nEnableAVX2 = \"-mavx2\",\nPedanticWarnings = \"-Wall -Wextra -pedantic\",\nExtraWarnings = \"-Wall -Wextra\",\nFatalWarnings = \"-Werror\",\nFloatFast = \"-ffast-math\",\nFloatStrict = \"-ffloat-store\",\nNoFramePointer = \"-fomit-frame-pointer\",\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nCpp11 = \"-std=c++11\",\nCpp14 = \"-std=c++14\",\nCpp17 = \"-std=c++17\",\nCppLatest = \"-std=c++2a\",\nNoExceptions = \"-fno-exceptions\",\nNoRTTI = \"-fno-rtti\",\nUnsignedChar = \"-funsigned-char\",\n}\nlocal objcflags =\n{\nObjcARC = \"-fobjc-arc\",\n}\npremake.gcc.platforms =\n{\nNative = {\n"
- "cppflags = \"-MMD -MP\",\n},\nx32 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m32\",\n},\nx64 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m64\",\n},\nUniversal = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch ppc\",\n},\nUniversal64 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD -MP\",\n},\nWiiDev = {\ncppflags = \"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",\nldflags= \"-L$(LIBOGC_LIB) $(MACHDEP)\",\ncfgsettings = [[\n ifeq ($(strip $(DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],\n},\nOrbis = {\ncc = \"orbis-clang\",\ncxx = \"orbis-clang++\",\nar = \"orbis-ar\",\ncppflag"
- "s = \"-MMD -MP\",\n},\nEmscripten = {\ncc = \"$(EMSCRIPTEN)/emcc\",\ncxx = \"$(EMSCRIPTEN)/em++\",\nar = \"$(EMSCRIPTEN)/emar\",\ncppflags = \"-MMD -MP\",\n}\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nif flags[1]:startswith(\"-MMD\") then\ntable.insert(flags, \"-MP\")\nend\nreturn flags\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\ntable.insert(result, \"-fPIC\")\nend\nreturn result\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getobjcflags(cfg)\nreturn table.translate(cfg.flags, objcflags)\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then"
- "\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"Bundle\" then\ntable.insert(result, \"-bundle\")\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-dynamiclib\")\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(result, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platform.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.insert(result, '-L\\\"' .. value .. '\\\"')\nend\nreturn result\nend\nfunction premake.gcc.islibfile(p)\nif path.getextension(p) == \".a\" then\nreturn true\nend\nreturn false\nend\nfunction premake.gcc.ge"
- "tlibfiles(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\ntable.insert(result, _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\nvalue = path.rebase(value, cfg.project.location, cfg.location)\ntable.insert(result, _MAKE.esc(value))\nelseif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.insert(result, '-l' .. _MAKE.esc(path.getname(value)))\nend\nend\nreturn result\nend\nfunction premake.gcc.wholearchive(lib)\nif premake.gcc.llvm then\nreturn {\"-force_load\", lib}\nelseif os.get() == \"macosx\" then\nreturn {\"-Wl,-force_load\", lib}\nelse\nreturn {\"-Wl,--whole-archive\", lib, \"-Wl,--no-whole-archive\"}\nend\nend\nfunction premake.gcc.getarchiveflags(prj, cfg, nd"
- "x)\nlocal result = {}\nif cfg.platform:startswith(\"Universal\") then\nif prj.options.ArchiveSplit then\nerror(\"gcc tool 'Universal*' platforms do not support split archives\")\nend\ntable.insert(result, '-o')\nelse\nif (not prj.options.ArchiveSplit) then\nif premake.gcc.llvm then\ntable.insert(result, 'rcs')\nelse\ntable.insert(result, '-rcs')\nend\nelse\nif premake.gcc.llvm then\nif (not ndx) then\ntable.insert(result, 'qc')\nelse\ntable.insert(result, 'cs')\nend\nelse\nif (not ndx) then\ntable.insert(result, '-qc')\nelse\ntable.insert(result, '-cs')\nend\nend\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, \"-D\" .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getquoteincludedirs(includedirs)\nlocal result = { }\nfor _,d"
- "ir in ipairs(includedirs) do\ntable.insert(result, \"-iquote \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getsystemincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-isystem \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n",
+ "premake.gcc = { }\npremake.gcc.cc = \"gcc\"\npremake.gcc.cxx = \"g++\"\npremake.gcc.ar = \"ar\"\npremake.gcc.rc = \"windres\"\npremake.gcc.llvm = false\nlocal cflags =\n{\nEnableSSE = \"-msse\",\nEnableSSE2 = \"-msse2\",\nEnableAVX = \"-mavx\",\nEnableAVX2 = \"-mavx2\",\nPedanticWarnings = \"-Wall -Wextra -pedantic\",\nExtraWarnings = \"-Wall -Wextra\",\nFatalWarnings = \"-Werror\",\nFloatFast = \"-ffast-math\",\nFloatStrict = \"-ffloat-store\",\nNoFramePointer = \"-fomit-frame-pointer\",\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nCpp11 = \"-std=c++11\",\nCpp14 = \"-std=c++14\",\nCpp17 = \"-std=c++17\",\nCpp20 = \"-std=c++20\",\nCppLatest = \"-std=c++2b\",\nNoExceptions = \"-fno-exceptions\",\nNoRTTI = \"-fno-rtti\",\nUnsignedChar = \"-funsigned-char\",\n}\nlocal objcflags =\n{\nObjcARC = \"-fobjc-arc\",\n}\npremake."
+ "gcc.platforms =\n{\nNative = {\ncppflags = \"-MMD -MP\",\n},\nx32 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m32\",\n},\nx64 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m64\",\n},\nUniversal = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch ppc\",\n},\nUniversal64 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD -MP\",\n},\nWiiDev = {\ncppflags = \"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",\nldflags= \"-L$(LIBOGC_LIB) $(MACHDEP)\",\ncfgsettings = [[\n ifeq ($(strip $(DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],\n},\nOrbis = {\ncc = \"orbis-clang\",\ncxx = \"orbis-clang++\",\nar "
+ " = \"orbis-ar\",\ncppflags = \"-MMD -MP\",\n},\nEmscripten = {\ncc = \"$(EMSCRIPTEN)/emcc\",\ncxx = \"$(EMSCRIPTEN)/em++\",\nar = \"$(EMSCRIPTEN)/emar\",\ncppflags = \"-MMD -MP\",\n},\nNX32 = {\ncc = \"clang\",\ncxx = \"clang++\",\nar = \"armv7l-nintendo-nx-eabihf-ar\",\ncppflags = \"-MMD -MP\",\nflags = \"-march=armv7l\",\n},\nNX64 = {\ncc = \"clang\",\ncxx = \"clang++\",\nar = \"aarch64-nintendo-nx-elf-ar\",\ncppflags = \"-MMD -MP\",\nflags = \"-march=aarch64\",\n},\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nif flags[1]:startswith(\"-MMD\") then\ntable.insert(flags, \"-MP\")\nend\nreturn flags\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\nt"
+ "able.insert(result, \"-fPIC\")\nend\nreturn result\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getobjcflags(cfg)\nreturn table.translate(cfg.flags, objcflags)\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"Bundle\" then\ntable.insert(result, \"-bundle\")\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-dynamiclib\")\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(result, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platf"
+ "orm.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.insert(result, '-L\\\"' .. value .. '\\\"')\nend\nreturn result\nend\nfunction premake.gcc.islibfile(p)\nif path.getextension(p) == \".a\" then\nreturn true\nend\nreturn false\nend\nfunction premake.gcc.getlibfiles(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\ntable.insert(result, _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\nvalue = path.rebase(value, cfg.project.location, cfg.location)\ntable.insert(result, _MAKE.esc(value))\nelseif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.inser"
+ "t(result, '-l' .. _MAKE.esc(path.getname(value)))\nend\nend\nreturn result\nend\nfunction premake.gcc.wholearchive(lib)\nif premake.gcc.llvm then\nreturn {\"-force_load\", lib}\nelseif os.get() == \"macosx\" then\nreturn {\"-Wl,-force_load\", lib}\nelse\nreturn {\"-Wl,--whole-archive\", lib, \"-Wl,--no-whole-archive\"}\nend\nend\nfunction premake.gcc.getarchiveflags(prj, cfg, ndx)\nlocal result = {}\nif cfg.platform:startswith(\"Universal\") then\nif prj.options.ArchiveSplit then\nerror(\"gcc tool 'Universal*' platforms do not support split archives\")\nend\ntable.insert(result, '-o')\nelse\nif (not prj.options.ArchiveSplit) then\nif premake.gcc.llvm then\ntable.insert(result, 'rcs')\nelse\ntable.insert(result, '-rcs')\nend\nelse\nif premake.gcc.llvm then\nif (not ndx) then\ntable.insert(result, 'qc')\nelse\ntable.insert(result, 'cs')\nend\nelse\nif (not ndx) then\ntable.insert(result, '-qc')\nelse\ntable.insert(result, '-cs')\nend\nend\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nl"
+ "ocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, \"-D\" .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getquoteincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-iquote \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getsystemincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-isystem \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n",
/* tools/ghs.lua */
"premake.ghs = { }\npremake.ghs.namestyle = \"PS3\"\npremake.ghs.cc = \"ccppc\"\npremake.ghs.cxx = \"cxppc\"\npremake.ghs.ar = \"cxppc\"\nlocal cflags =\n{\nFatalWarnings = \"--quit_after_warnings\",\nOptimize = \"-Ogeneral\",\nOptimizeSize = \"-Osize\",\nOptimizeSpeed = \"-Ospeed\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nNoExceptions = \"--no_exceptions\",\nNoRTTI = \"--no_rtti\",\nUnsignedChar = \"--unsigned_chars\",\n}\npremake.ghs.platforms =\n{\nNative = {\ncppflags = \"-MMD\",\n},\nPowerPC = {\ncc = \"ccppc\",\ncxx = \"cxppc\",\nar = \"cxppc\",\ncppflags = \"-MMD\",\narflags = \"-archive -o\",\n},\nARM = {\ncc = \"ccarm\",\ncxx = \"cxarm\",\nar = \"cxarm\",\ncppflags = \"-MMD\",\narflags = \"-archive -o\",\n}\n}\nlocal platforms = premake.ghs.platforms\nfunction premake.ghs.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nreturn flags\nend\nfunction premake.ghs.getcf"
@@ -172,9 +174,9 @@ const char* builtin_scripts[] = {
"esult = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, '-D' .. def)\nend\nreturn result\nend\nfunction premake.snc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\" .. _MAKE.esc(dir))\nend\nreturn result\nend\n",
/* tools/valac.lua */
- "premake.valac = { }\npremake.valac.valac = \"valac\"\npremake.valac.cc = \"gcc\"\nlocal valaflags =\n{\nDisableAssert = \"--disable-assert\", -- Disable assertions\nDisableSinceCheck = \"--disable-since-check\", -- Do not check whether used symbols exist in local packages\nDisableWarnings = \"--disable-warnings\", -- Disable warnings\nEnableChecking = \"--enable-checking\", -- Enable additional run-time checks\nEnableDeprecated = \"--enable-deprecated\", -- Enable deprecated features\nEnableExperimental = \"--enable-experimental\", -- Enable experimental features\nEnableExperimentalNonNull = \"--enable-experimental-non-null\", -- Enable experimental enhancements for non-null types\nEnableGObjectTracing = \"--enable-gobject-tracing\", -- Enable GObject creation tracing\nEnableMemProfiler = \"--enable-mem-profiler\", -- Enable GLib memory profiler\nEnableTh"
- "reading = \"--thread\", -- Enable multithreading support\nFatalWarnings = \"--fatal-warnings\", -- Treat warnings as fatal\nHideInternal = \"--hide-internal\", -- Hide symbols marked as internal\nNoStdPkg = \"--nostdpkg\", -- Do not include standard packages\nOptimize = \"-X -O2\",\nOptimizeSize = \"-X -Os\",\nOptimizeSpeed = \"-X -O3\",\nSymbols = \"-g\", -- Produce debug information\n}\npremake.valac.platforms = {}\nfunction premake.valac.getvalaflags(cfg)\nreturn table.translate(cfg.flags, valaflags)\nend\nfunction premake.valac.getlinks(links)\nlocal result = { }\nfor _, pkg in ipairs(links) do\ntable.insert(result, '--pkg ' .. pkg)\nend\nreturn result\nend\nfunction premake.valac.getdefines(defines)\nlocal result = { }\nfor _, def in ipairs(defines) do\ntable.insert(result, '-D ' .. def)\nend\nretu"
- "rn result\nend\nfunction premake.valac.getbuildoptions(buildoptions)\nlocal result = { }\nfor _, def in ipairs(buildoptions) do\ntable.insert(result, '-X ' .. def)\nend\nreturn result\nend\nfunction premake.valac.getvapidirs(vapidirs)\nlocal result = { }\nfor _, def in ipairs(vapidirs) do\ntable.insert(result, '--vapidir=' .. def)\nend\nreturn result\nend\n",
+ "premake.valac = { }\npremake.valac.valac = \"valac\"\npremake.valac.cc = premake.gcc.cc\npremake.valac.glibrc = \"glib-compile-resources\"\nlocal valaflags =\n{\nDisableAssert = \"--disable-assert\", -- Disable assertions\nDisableSinceCheck = \"--disable-since-check\", -- Do not check whether used symbols exist in local packages\nDisableWarnings = \"--disable-warnings\", -- Disable warnings\nEnableChecking = \"--enable-checking\", -- Enable additional run-time checks\nEnableDeprecated = \"--enable-deprecated\", -- Enable deprecated features\nEnableExperimental = \"--enable-experimental\", -- Enable experimental features\nEnableExperimentalNonNull = \"--enable-experimental-non-null\", -- Enable experimental enhancements for non-null types\nEnableGObjectTracing = \"--enable-gobject-tracing\", -- Enable GObject creation tracing\nEnableMemProfiler = \"--enable-mem-pro"
+ "filer\", -- Enable GLib memory profiler\nFatalWarnings = \"--fatal-warnings\", -- Treat warnings as fatal\nHideInternal = \"--hide-internal\", -- Hide symbols marked as internal\nNoStdPkg = \"--nostdpkg\", -- Do not include standard packages\nSymbols = \"-g\", -- Produce debug information\n}\nlocal valaccflags =\n{\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\", -- Produce debug information\n}\npremake.valac.platforms =\n{\nNative = {\n},\nx64 = {\nflags = \"-m64\"\n},\n}\nfunction premake.valac.getvalaflags(cfg)\nreturn table.translate(cfg.flags, valaflags)\nend\nfunction premake.valac.getvalaccflags(cfg)\nreturn table.translate(cfg.flags, valaccflags)\nend\nfunction premake.valac.getlinks(links)\nlocal result = { }\nfor _, pkg in ipairs"
+ "(links) do\ntable.insert(result, '--pkg ' .. pkg)\nend\nreturn result\nend\nfunction premake.valac.getdefines(defines)\nlocal result = { }\nfor _, def in ipairs(defines) do\ntable.insert(result, '-D ' .. def)\nend\nreturn result\nend\nfunction premake.valac.getvapidirs(vapidirs)\nlocal result = { }\nfor _, def in ipairs(vapidirs) do\ntable.insert(result, '--vapidir=' .. def)\nend\nreturn result\nend\n",
/* tools/swift.lua */
"premake.swift = { }\npremake.swift.swiftc = \"swiftc\"\npremake.swift.swift = \"swift\"\npremake.swift.cc = \"gcc\"\npremake.swift.ar = \"ar\"\npremake.swift.ld = \"ld\"\npremake.swift.dsymutil = \"dsymutil\"\nlocal swiftcflags =\n{\nSymbols = \"-g\", -- Produce debug information\nDisableWarnings = \"--suppress-warnings\", -- Disable warnings\nFatalWarnings = \"--warnings-as-errors\", -- Treat warnings as fatal\nOptimize = \"-O -whole-module-optimization\",\nOptimizeSize = \"-O -whole-module-optimization\",\nOptimizeSpeed = \"-Ounchecked -whole-module-optimization\",\nMinimumWarnings = \"-minimum-warnings\",\n}\nlocal swiftlinkflags = {\nStaticRuntime = \"-static-stdlib\",\n}\npremake.swift.platforms = {\nNative = {\nswiftcflags = \"\",\nswiftlinkflags = \"\",\n},\nx64 = {\nswiftcflags = \"\",\nswiftlinkflags = \"\",\n}\n}\nlocal p"
@@ -204,24 +206,25 @@ const char* builtin_scripts[] = {
"premake.cmake = { }\nnewaction {\ntrigger = \"cmake\",\nshortname = \"CMake\",\ndescription = \"Generate CMake project files\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"CMakeLists.txt\", premake.cmake.workspace)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%/CMakeLists.txt\", premake.cmake.project)\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, \"CMakeLists.txt\")\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, \"%%/CMakeLists.txt\")\nend\n}",
/* actions/cmake/cmake_workspace.lua */
- "function premake.cmake.workspace(sln)\nif (sln.location ~= _WORKING_DIR) then\nlocal name = string.format(\"%s/CMakeLists.txt\", _WORKING_DIR)\nlocal f, err = io.open(name, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write('# CMakeLists autogenerated by GENie\\n')\nf:write('cmake_minimum_required(VERSION 2.8.4)\\n')\nf:write('\\n')\nf:write('add_subdirectory('.. path.getrelative(_WORKING_DIR, sln.location) ..')\\n')\nf:close()\nend\n_p('# CMakeLists autogenerated by GENie')\n_p('cmake_minimum_required(VERSION 2.8.4)')\n_p('')\nfor i,prj in ipairs(sln.projects) do\nlocal name = premake.esc(prj.name)\n_p('add_subdirectory(%s)', name)\nend\nend\n",
+ "function premake.cmake.workspace(sln)\nif (sln.location ~= _WORKING_DIR) then\nlocal name = string.format(\"%s/CMakeLists.txt\", _WORKING_DIR)\nlocal f, err = io.open(name, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write([[\n# CMakeLists autogenerated by GENie\nproject(GENie)\ncmake_minimum_required(VERSION 3.15)\n#########################################################################\n# Set a default build type if none was specified\n# Source: https://blog.kitware.com/cmake-and-the-default-build-type/\nset(default_build_type \"Release\")\nif(EXISTS \"${CMAKE_SOURCE_DIR}/.git\")\n set(default_build_type \"Debug\")\nendif()\nif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)\n message(STATUS \"Setting build type to '${default_build_type}' as none was specified.\")\n set(CMAKE_BUILD_TYPE \"${default_build_type}\" CACHE STRING \"Choose the type of build.\" FORCE)\n # Set the possible values of build type for cmake-gui\n set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS \"Debug\" \"Release"
+ "\" \"MinSizeRel\" \"RelWithDebInfo\")\nendif()\n#########################################################################\n]])\nif os.is(\"windows\") then\nf:write('cmake_policy(SET CMP0091 NEW)\\n')\nend\nf:write('add_subdirectory('.. path.getrelative(_WORKING_DIR, sln.location) ..')\\n')\nf:close()\nend\n_p([[\n# CMakeLists autogenerated by GENie\ncmake_minimum_required(VERSION 3.15)\n]])\nif os.is(\"windows\") then\n_p('cmake_policy(SET CMP0091 NEW)')\nend\nfor i,prj in ipairs(sln.projects) do\nlocal name = premake.esc(prj.name)\n_p('add_subdirectory(%s)', name)\nend\nend\n",
/* actions/cmake/cmake_project.lua */
- "local cmake = premake.cmake\nlocal tree = premake.tree\nlocal includestr = 'include_directories(../%s)'\nlocal definestr = 'add_definitions(-D%s)'\nlocal function is_excluded(prj, cfg, file)\n if table.icontains(prj.excludes, file) then\n return true\n end\n if table.icontains(cfg.excludes, file) then\n return true\n end\n return false\nend\nfunction cmake.excludedFiles(prj, cfg, src)\n for _, v in ipairs(src) do\n if (is_excluded(prj, cfg, v)) then\n _p(1, 'list(REMOVE_ITEM source_list ../%s)', v)\n end\n end\nend\nfunction cmake.list(value)\n if #value > 0 then\n return \" \" .. table.concat(value, \" \")\n else\n return \"\"\n end\nend\nfunction cmake.files(prj)\n local ret = {}\n local tr = premake.project.buildsourcetree(prj)\n tree.traverse(tr, {\n onbranchenter = function(node, depth)\n end,\n onbranchexit = function(node, depth)\n end,\n onleaf = function(node, depth)\n "
- " assert(node, \"unexpected empty node\")\n if node.cfg then\n table.insert(ret, node.cfg.name)\n _p(1, '../%s', node.cfg.name)\n end\n end,\n }, true, 1)\n return ret\nend\nfunction cmake.header(prj)\n _p('# %s project autogenerated by GENie', premake.action.current().shortname)\n _p('cmake_minimum_required(VERSION 2.8.4)')\n _p('')\n _p('project(%s)', premake.esc(prj.name))\nend\nfunction cmake.customtasks(prj)\n local dirs = {}\n local tasks = {}\n for _, custombuildtask in ipairs(prj.custombuildtask or {}) do\n for _, buildtask in ipairs(custombuildtask or {}) do\n table.insert(tasks, buildtask)\n local d = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\", path.getdirectory(path.getrelative(prj.location, buildtask[2])))\n if not table.contains(dirs, d) then\n table.insert(dirs, d)\n _p('file(MAKE_DIRECTORY \\\"%s\\\")', d)\n end\n "
- " end\n end\n _p('')\n for _, buildtask in ipairs(tasks) do\n local deps = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1]))\n local outputs = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[2]))\n local msg = \"\"\n for _, depdata in ipairs(buildtask[3] or {}) do\n deps = deps .. string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, depdata))\n end\n _p('add_custom_command(')\n _p(1, 'OUTPUT %s', outputs)\n _p(1, 'DEPENDS %s', deps)\n for _, cmdline in ipairs(buildtask[4] or {}) do\n if (cmdline:sub(1, 1) ~= \"@\") then\n local cmd = cmdline\n local num = 1\n for _, depdata in ipairs(buildtask[3] or {}) do\n cmd = string.gsub(cmd, \"%$%(\" .. num .. \"%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(pr"
- "j.location, depdata)))\n num = num + 1\n end\n cmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1])))\n cmd = string.gsub(cmd, \"%$%(@%)\", outputs)\n _p(1, 'COMMAND %s', cmd)\n else\n msg = cmdline\n end\n end\n _p(1, 'COMMENT \\\"%s\\\"', msg)\n _p(')')\n _p('')\n end\nend\nfunction cmake.depRules(prj)\n local maintable = {}\n for _, dependency in ipairs(prj.dependency) do\n for _, dep in ipairs(dependency) do\n if path.issourcefile(dep[1]) then\n local dep1 = premake.esc(path.getrelative(prj.location, dep[1]))\n local dep2 = premake.esc(path.getrelative(prj.location, dep[2]))\n if not maintable[dep1] then maintable[dep1] = {} end\n table.insert(maintable[dep1], dep2)\n end\n end\n "
- " end\n for key, _ in pairs(maintable) do\n local deplist = {}\n local depsname = string.format('%s_deps', path.getname(key))\n for _, d2 in pairs(maintable[key]) do\n table.insert(deplist, d2)\n end\n _p('set(')\n _p(1, depsname)\n for _, v in pairs(deplist) do\n _p(1, '${CMAKE_CURRENT_SOURCE_DIR}/../%s', v)\n end\n _p(')')\n _p('')\n _p('set_source_files_properties(')\n _p(1, '\\\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\\\"', key)\n _p(1, 'PROPERTIES OBJECT_DEPENDS \\\"${%s}\\\"', depsname)\n _p(')')\n _p('')\n end\nend\nfunction cmake.commonRules(conf, str)\n local Dupes = {}\n local t2 = {}\n for _, cfg in ipairs(conf) do\n local cfgd = iif(str == includestr, cfg.includedirs, cfg.defines)\n for _, v in ipairs(cfgd) do\n if(t2[v] == #conf - 1) then\n _p(str, v)\n table.insert(Dupes, v)\n end\n if n"
- "ot t2[v] then\n t2[v] = 1\n else\n t2[v] = t2[v] + 1\n end\n end\n end\n return Dupes\nend\nfunction cmake.cfgRules(cfg, dupes, str)\n for _, v in ipairs(cfg) do\n if (not table.icontains(dupes, v)) then\n _p(1, str, v)\n end\n end\nend\nfunction cmake.removeCrosscompiler(platforms)\n for i = #platforms, 1, -1 do\n if premake.platforms[platforms[i]].iscrosscompiler then\n table.remove(platforms, i)\n end\n end\nend\nfunction cmake.project(prj)\n io.indent = \" \"\n cmake.header(prj)\n _p('set(')\n _p('source_list')\n local source_files = cmake.files(prj)\n _p(')')\n _p('')\n local nativeplatform = iif(os.is64bit(), \"x64\", \"x32\")\n local cc = premake.gettool(prj)\n local platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n cmake.removeCrosscompiler(platforms)\n local configurations = {}\n for _, platform in ipairs(plat"
- "forms) do\n for cfg in premake.eachconfig(prj, platform) do\n -- TODO: Extend support for 32-bit targets on 64-bit hosts\n if cfg.platform == nativeplatform then\n table.insert(configurations, cfg)\n end\n end\n end\n local commonIncludes = cmake.commonRules(configurations, includestr)\n local commonDefines = cmake.commonRules(configurations, definestr)\n _p('')\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n -- list excluded files\n cmake.excludedFiles(prj, cfg, source_files)\n -- add includes directories\n cmake.cfgRules(cfg.includedirs, commonIncludes, includestr)\n -- add build defines\n cmake.cfgRules(cfg.defines, commonDefines, definestr)\n -- set CXX flags\n _p(1, 'set(CMAKE_CXX_FLAGS \\\"${CMAKE_CXX_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptio"
- "ns, cfg.buildoptions_cpp)))\n -- set C flags\n _p(1, 'set(CMAKE_C_FLAGS \\\"${CMAKE_C_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n _p('endif()')\n _p('')\n end\n -- force CPP if needed\n if (prj.options.ForceCPP) then\n _p('set_source_files_properties(${source_list} PROPERTIES LANGUAGE CXX)')\n end\n -- add custom tasks\n cmake.customtasks(prj)\n -- per-dependency build rules\n cmake.depRules(prj)\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n if (prj.kind == 'StaticLib') then\n _p(1, 'add_library(%s STATIC ${source_list})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'SharedLib') then\n _p(1, 'add_library(%s SHARED ${source_list})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'ConsoleApp' or prj.kind == 'WindowedApp') t"
- "hen\n _p(1, 'add_executable(%s ${source_list})', premake.esc(cfg.buildtarget.basename))\n _p(1, 'target_link_libraries(%s%s%s)', premake.esc(cfg.buildtarget.basename), cmake.list(premake.esc(premake.getlinks(cfg, \"siblings\", \"basename\"))), cmake.list(cc.getlinkflags(cfg)))\n end\n _p('endif()')\n _p('')\n end\nend",
+ "local cmake = premake.cmake\nlocal tree = premake.tree\nlocal includestr = 'include_directories(../%s)'\nlocal definestr = 'add_definitions(-D%s)'\nlocal function is_excluded(prj, cfg, file)\n if table.icontains(prj.excludes, file) then\n return true\n end\n if table.icontains(cfg.excludes, file) then\n return true\n end\n return false\nend\nfunction cmake.excludedFiles(prj, cfg, src)\n for _, v in ipairs(src) do\n if (is_excluded(prj, cfg, v)) then\n _p(1, 'list(REMOVE_ITEM source_list ../%s)', v)\n end\n end\nend\nfunction cmake.list(value)\n if #value > 0 then\n return \" \" .. table.concat(value, \" \")\n else\n return \"\"\n end\nend\nfunction cmake.listWrapped(value, prefix, postfix)\n if #value > 0 then\n return prefix .. table.concat(value, postfix .. prefix) .. postfix\n else\n return \"\"\n end\nend\nfunction cmake.files(prj)\n local ret = {}\n local tr = premake.project.buildsourcetree(prj"
+ ")\n tree.traverse(tr, {\n onbranchenter = function(node, depth)\n end,\n onbranchexit = function(node, depth)\n end,\n onleaf = function(node, depth)\n assert(node, \"unexpected empty node\")\n if node.cfg then\n table.insert(ret, node.cfg.name)\n _p(1, '../%s', node.cfg.name)\n end\n end,\n }, true, 1)\n return ret\nend\nfunction cmake.header(prj)\n _p('# %s project autogenerated by GENie', premake.action.current().shortname)\n _p('cmake_minimum_required(VERSION 3.15)')\n if os.is(\"windows\") then\n -- Add support for CMP0091, see https://cmake.org/cmake/help/latest/policy/CMP0091.html\n _p('cmake_policy(SET CMP0091 NEW)')\n end\n _p('')\n _p('project(%s)', premake.esc(prj.name))\n _p('')\n _p('include(GNUInstallDirs)')\nend\nfunction cmake.customtasks(prj)\n local dirs = {}\n local tasks = {}\n for _, custombuildtask in ipairs(prj.custombuildtask or"
+ " {}) do\n for _, buildtask in ipairs(custombuildtask or {}) do\n table.insert(tasks, buildtask)\n local d = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\", path.getdirectory(path.getrelative(prj.location, buildtask[2])))\n if not table.contains(dirs, d) then\n table.insert(dirs, d)\n _p('file(MAKE_DIRECTORY \\\"%s\\\")', d)\n end\n end\n end\n _p('')\n for _, buildtask in ipairs(tasks) do\n local deps = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1]))\n local outputs = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[2]))\n local msg = \"\"\n for _, depdata in ipairs(buildtask[3] or {}) do\n deps = deps .. string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, depdata))\n end\n _p('add_custom_command(')\n _p(1, 'OUTPUT %s', ou"
+ "tputs)\n _p(1, 'DEPENDS %s', deps)\n for _, cmdline in ipairs(buildtask[4] or {}) do\n if (cmdline:sub(1, 1) ~= \"@\") then\n local cmd = cmdline\n local num = 1\n for _, depdata in ipairs(buildtask[3] or {}) do\n cmd = string.gsub(cmd, \"%$%(\" .. num .. \"%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, depdata)))\n num = num + 1\n end\n cmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1])))\n cmd = string.gsub(cmd, \"%$%(@%)\", outputs)\n _p(1, 'COMMAND %s', cmd)\n else\n msg = cmdline\n end\n end\n _p(1, 'COMMENT \\\"%s\\\"', msg)\n _p(')')\n _p('')\n end\nend\nfunction cmake.depRules(prj)\n local maintable = {}\n for _, dependency in ipairs(prj.d"
+ "ependency) do\n for _, dep in ipairs(dependency) do\n if path.issourcefile(dep[1]) then\n local dep1 = premake.esc(path.getrelative(prj.location, dep[1]))\n local dep2 = premake.esc(path.getrelative(prj.location, dep[2]))\n if not maintable[dep1] then maintable[dep1] = {} end\n table.insert(maintable[dep1], dep2)\n end\n end\n end\n for key, _ in pairs(maintable) do\n local deplist = {}\n local depsname = string.format('%s_deps', path.getname(key))\n for _, d2 in pairs(maintable[key]) do\n table.insert(deplist, d2)\n end\n _p('set(')\n _p(1, depsname)\n for _, v in pairs(deplist) do\n _p(1, '${CMAKE_CURRENT_SOURCE_DIR}/../%s', v)\n end\n _p(')')\n _p('')\n _p('set_source_files_properties(')\n _p(1, '\\\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\\\"', key)\n _p(1, 'PROPERTIES OBJECT_DEPENDS \\\"${%s}\\\"', d"
+ "epsname)\n _p(')')\n _p('')\n end\nend\nfunction cmake.commonRules(conf, str)\n local Dupes = {}\n local t2 = {}\n for _, cfg in ipairs(conf) do\n local cfgd = iif(str == includestr, cfg.includedirs, cfg.defines)\n for _, v in ipairs(cfgd) do\n if(t2[v] == #conf - 1) then\n _p(str, v)\n table.insert(Dupes, v)\n end\n if not t2[v] then\n t2[v] = 1\n else\n t2[v] = t2[v] + 1\n end\n end\n end\n return Dupes\nend\nfunction cmake.cfgRules(cfg, dupes, str)\n for _, v in ipairs(cfg) do\n if (not table.icontains(dupes, v)) then\n _p(1, str, v)\n end\n end\nend\nfunction cmake.removeCrosscompiler(platforms)\n for i = #platforms, 1, -1 do\n if premake.platforms[platforms[i]].iscrosscompiler then\n table.remove(platforms, i)\n end\n end\nend\nfunction cmake.project(prj)\n io.indent = \" \""
+ "\n cmake.header(prj)\n _p('set(')\n _p('source_list')\n local source_files = cmake.files(prj)\n _p(')')\n _p('')\n local nativeplatform = iif(os.is64bit(), \"x64\", \"x32\")\n local cc = premake.gettool(prj)\n local platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n cmake.removeCrosscompiler(platforms)\n local configurations = {}\n for _, platform in ipairs(platforms) do\n for cfg in premake.eachconfig(prj, platform) do\n -- TODO: Extend support for 32-bit targets on 64-bit hosts\n if cfg.platform == nativeplatform then\n table.insert(configurations, cfg)\n end\n end\n end\n local commonIncludes = cmake.commonRules(configurations, includestr)\n local commonDefines = cmake.commonRules(configurations, definestr)\n _p('')\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n -- list excluded files\n cmake.ex"
+ "cludedFiles(prj, cfg, source_files)\n -- add includes directories\n cmake.cfgRules(cfg.includedirs, commonIncludes, includestr)\n -- add build defines\n cmake.cfgRules(cfg.defines, commonDefines, definestr)\n -- set CXX flags\n _p(1, 'set(CMAKE_CXX_FLAGS \\\"${CMAKE_CXX_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n -- set C flags\n _p(1, 'set(CMAKE_C_FLAGS \\\"${CMAKE_C_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n _p('endif()')\n _p('')\n end\n -- force CPP if needed\n if (prj.options.ForceCPP) then\n _p('set_source_files_properties(${source_list} PROPERTIES LANGUAGE CXX)')\n end\n -- add custom tasks\n cmake.customtasks(prj)\n -- per-dependency build rules\n cmake.depRules(prj)\n for _, cfg in ipairs(configurations) do\n _p('if(C"
+ "MAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n if (prj.kind == 'StaticLib') then\n _p(1, 'add_library(%s STATIC ${source_list})', premake.esc(cfg.buildtarget.basename))\n -- Install\n _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'SharedLib') then\n _p(1, 'add_library(%s SHARED ${source_list})', premake.esc(cfg.buildtarget.basename))\n -- Install\n _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'ConsoleApp' or prj.kind == 'WindowedApp') then\n _p(1, 'add_executable(%s ${source_list})', premake.esc(cfg.buildtarget.basename))\n local libdirs = cmake.listWrapped(premake.esc(premake.getlinks(cfg, \"all\", \"directory\")), \" -L\\\"../\", \"\\\"\")\n _p(1, 'target_link_libraries(%s%s%s%s%s%s)', premake.es"
+ "c(cfg.buildtarget.basename), libdirs, cmake.list(cfg.linkoptions), cmake.list(cc.getldflags(cfg)), cmake.list(premake.esc(premake.getlinks(cfg, \"siblings\", \"basename\"))), cmake.list(cc.getlinkflags(cfg)))\n -- Install\n _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})', premake.esc(cfg.buildtarget.basename))\n end\n _p('endif()')\n _p('')\n end\nend",
/* actions/make/_make.lua */
- "_MAKE = { }\npremake.make = { }\nlocal make = premake.make\nfunction _MAKE.esc(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.esc(v))\nend\nreturn result\nelse\nresult = value:gsub(\"\\\\\", \"\\\\\\\\\")\nresult = result:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"%%(\", \"\\\\%(\")\nresult = result:gsub(\"%%)\", \"\\\\%)\")\nresult = result:gsub(\"$\\\\%((.-)\\\\%)\", \"$%(%1%)\")\nreturn result\nend\nend\nfunction _MAKE.escquote(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.escquote(v))\nend\nreturn result\nelse\nreturn value\nend\nend\nfunction premake.make_copyrule(source, target)\n_p('%s: %s', target, source)\n_p('\\t@echo Copying $(notdir %s)', target)\n_p('\\t-$(call COPY,%s,%s)', source, target)\nend\nfunction premake.make_mkdirrule(var)\n_p('\\t@echo Creating %s', var)\n_p('\\t-$(call MKDIR,%s)', var)\n_p('')\nend\nfunction make.list(val"
- "ue)\nif #value > 0 then\nreturn \" \" .. table.concat(value, \" \")\nelse\nreturn \"\"\nend\nend\nfunction _MAKE.getmakefilename(this, searchprjs)\nlocal count = 0\nfor sln in premake.solution.each() do\nif (sln.location == this.location) then count = count + 1 end\nif (searchprjs) then\nfor _,prj in ipairs(sln.projects) do\nif (prj.location == this.location) then count = count + 1 end\nend\nend\nend\nif (count == 1) then\nreturn \"Makefile\"\nelse\nreturn this.name .. \".make\"\nend\nend\nfunction _MAKE.getnames(tbl)\nlocal result = table.extract(tbl, \"name\")\nfor k,v in pairs(result) do\nresult[k] = _MAKE.esc(v)\nend\nreturn result\nend\nfunction make.settings(cfg, cc)\nif #cfg.makesettings > 0 then\nfor _, value in ipairs(cfg.makesettings) do\n_p(value)\nend\nend\nlocal toolsettings = cc.platforms[cfg.platform].cfgsettings\nif toolsettings then\n_p(toolsettings)\nend\nend\nnewaction {\ntrigger = \"gmake\",\nshortname = \"GNU Make\",\ndescription = \"Generate GNU makefiles for POSIX, MinG"
- "W, and Cygwin\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\", \"Vala\", \"Swift\" },\nvalid_tools = {\ncc = { \"gcc\", \"ghs\" },\ndotnet = { \"mono\", \"msnet\", \"pnet\" },\nvalac = { \"valac\" },\nswift = { \"swift\" },\n},\nonsolution = function(sln)\npremake.generate(sln, _MAKE.getmakefilename(sln, false), premake.make_solution)\nend,\nonproject = function(prj)\nlocal makefile = _MAKE.getmakefilename(prj, true)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, makefile, premake.make_csharp)\nelseif premake.iscppproject(prj) then\npremake.generate(prj, makefile, premake.make_cpp)\nelseif premake.isswiftproject(prj) then\npremake.generate(prj, makefile, premake.make_swift)\nelse\npremake.generate(prj, makefile, premake.make_vala)\nend\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, _MAKE.getmakefilename(sln, false))\nend,\noncleanproject = function(prj)\npremake.clean.file(p"
- "rj, _MAKE.getmakefilename(prj, true))\nend,\ngmake = {}\n}\n",
+ "_MAKE = { }\npremake.make = { }\nlocal make = premake.make\nfunction _MAKE.esc(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.esc(v))\nend\nreturn result\nelse\nresult = value:gsub(\"\\\\\", \"\\\\\\\\\")\nresult = result:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"%%(\", \"\\\\%(\")\nresult = result:gsub(\"%%)\", \"\\\\%)\")\nresult = result:gsub(\"$\\\\%((.-)\\\\%)\", \"$%(%1%)\")\nreturn result\nend\nend\nfunction _MAKE.escquote(value)\nreturn value\nend\nfunction premake.make_copyrule(source, target)\n_p('%s: %s', target, source)\n_p('\\t@echo Copying $(notdir %s)', target)\n_p('\\t-$(call COPY,%s,%s)', source, target)\nend\nfunction premake.make_mkdirrule(var)\n_p('\\t@echo Creating %s', var)\n_p('\\t-$(call MKDIR,%s)', var)\n_p('')\nend\nfunction make.list(value)\nif #value > 0 then\nreturn \" \" .. table.concat(value, \" \")\nelse\nreturn \"\"\nend\nend\nfunction _MAKE.getmakefilename(this, searchprjs)\nlocal count = 0\n"
+ "for sln in premake.solution.each() do\nif (sln.location == this.location) then count = count + 1 end\nif (searchprjs) then\nfor _,prj in ipairs(sln.projects) do\nif (prj.location == this.location) then count = count + 1 end\nend\nend\nend\nif (count == 1) then\nreturn \"Makefile\"\nelse\nreturn this.name .. \".make\"\nend\nend\nfunction _MAKE.getnames(tbl)\nlocal result = table.extract(tbl, \"name\")\nfor k,v in pairs(result) do\nresult[k] = _MAKE.esc(v)\nend\nreturn result\nend\nfunction make.settings(cfg, cc)\nif #cfg.makesettings > 0 then\nfor _, value in ipairs(cfg.makesettings) do\n_p(value)\nend\nend\nlocal toolsettings = cc.platforms[cfg.platform].cfgsettings\nif toolsettings then\n_p(toolsettings)\nend\nend\nnewaction {\ntrigger = \"gmake\",\nshortname = \"GNU Make\",\ndescription = \"Generate GNU makefiles for POSIX, MinGW, and Cygwin\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\", \"Val"
+ "a\", \"Swift\" },\nvalid_tools = {\ncc = { \"gcc\", \"ghs\" },\ndotnet = { \"mono\", \"msnet\", \"pnet\" },\nvalac = { \"valac\" },\nswift = { \"swift\" },\n},\nonsolution = function(sln)\npremake.generate(sln, _MAKE.getmakefilename(sln, false), premake.make_solution)\nend,\nonproject = function(prj)\nlocal makefile = _MAKE.getmakefilename(prj, true)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, makefile, premake.make_csharp)\nelseif premake.iscppproject(prj) then\npremake.generate(prj, makefile, premake.make_cpp)\nelseif premake.isswiftproject(prj) then\npremake.generate(prj, makefile, premake.make_swift)\nelse\npremake.generate(prj, makefile, premake.make_vala)\nend\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, _MAKE.getmakefilename(sln, false))\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, _MAKE.getmakefilename(prj, true))\nend,\ngmake = {}\n}\n",
/* actions/make/make_solution.lua */
"function premake.make_solution(sln)\nlocal cc = premake[_OPTIONS.cc]\nlocal platforms = premake.filterplatforms(sln, cc.platforms, \"Native\")\n_p('# %s solution makefile autogenerated by GENie', premake.action.current().shortname)\n_p('# Type \"make help\" for usage help')\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(sln.configurations[1], platforms[1], true)))\n_p('endif')\n_p('export config')\n_p('')\nlocal projects = table.extract(sln.projects, \"name\")\ntable.sort(projects)\n_p('PROJECTS := %s', table.concat(_MAKE.esc(projects), \" \"))\n_p('')\n_p('.PHONY: all clean help $(PROJECTS)')\n_p('')\n_p('all: $(PROJECTS)')\n_p('')\nfor _, prj in ipairs(sln.projects) do\n_p('%s: %s', _MAKE.esc(prj.name), table.concat(_MAKE.esc(table.extract(premake.getdependencies(prj), \"name\")), \" \"))\nif (not sln.messageskip) or (not table.contains(sln.messageskip, \"SkipBuildingMessage\")) then\n_p('\\t@echo \"==== Building %s ($(config)) ====\"', prj.name)\nend\n_p('\\t@${MAKE} --no-pr"
@@ -233,110 +236,120 @@ const char* builtin_scripts[] = {
"URCES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then\nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('\\t$(SILENT) $(LINKCMD) $(LINKOBJS)' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(LINKOBJS))' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\n_p('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCM"
"D)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" and not prj.options.SkipBundling then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(P"
"REBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj, cc)\ncpp.dependencyRules(prj)\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal deps = string.format(\"%s \",path.getrelative(prj.location,buildtask[1]))\nfor _, depdata in ipairs(buildtask[3] or {}) do\ndeps = deps .. string.format(\"%s \",path.getrelative(prj.location,depdata))\nend\n_p('%s: %s | $(TARGETDIR) $(OBJDIRS)'\n,path.getrelative(prj.location,buildtask[2])\n, deps\n)\nfor _, cmdline in ipairs(buildtask[4] or {}) do\nlocal cmd = cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", \"$<\")\ncmd = string.gsub(cmd, \"%$%(@%)\", \"$@\")\n_p('\\t$(SILENT) %s',cmd)\nend\n_p('')\nend\nend\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,"
- "$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p(' -include $(OBJDIR)/$(notdir $(PCH))_objc.d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || "
- "exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = %s', cc.rc or 'windres')\n_p(' endif')\n_p('endif')\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_cpp_configs(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(conf"
- "ig),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(_MAKE.escquote(cc.getdefines(cfg.defines))))\nlocal id = make.list(cc.getincludedirs(cfg.includedirs));\nlocal uid = make.list(cc.getquoteincludedirs(cfg.userincludedirs))\nlocal sid = make.list(cc.getsystemincludedirs(cfg.systemincludedirs))\nif id ~= \"\" then\n_p(' INCLUDES +=%s', id)\nend\nif uid ~= \"\" then\n_p(' INCLUDES +=%s', uid)\nend\nif sid "
- "~= \"\" then\n_p(' INCLUDES +=%s', sid)\nend\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\ntable.sort(cfg.files)\nif cfg.flags.UseObjectResponseFile then\n_p(' OBJRESP = $(OBJDIR)/%s_objects', prj.name)\nelse\n_p(' OBJRESP =')\nend\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-bui"
- "ld commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\n_p(' FORCE_INCLUDE_OBJC += -include $(OBJDIR)/$(notdir $(PCH))_objc')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,_MAKE.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), c"
- "fg.buildoptions, cfg.buildoptions_asm)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\nlocal libdeps\nl"
- "ocal lddeps\nif #cfg.wholearchive > 0 then\nlibdeps = {}\nlddeps = {}\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\nlddeps = table.join(lddeps, cc.wholearchive(linkpath))\nelse\ntable.insert(lddeps, linkpath)\nend\ntable.insert(libdeps, linkpath)\nend\nlibdeps = make.list(_MAKE.esc(libdeps))\nlddeps = make.list(_MAKE.esc(lddeps))\nelse\nlibdeps = make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nlddeps = libdeps\nend\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LIBDEPS +=%s', libdeps)\n_p(' LDDEPS +=%s', lddeps)\nif cfg.flags.UseLDResponseFile then\n_p(' LDRESP = $(OBJDIR)/%s_libs', prj.name)\n_p(' LIBS += @$(LDRESP)%s', make.list(cc.getlinkflags(cfg)))\nelse"
- "\n_p(' LDRESP =')\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nend\n_p(' EXTERNAL_LIBS +=%s', make.list(cc.getlibfiles(cfg)))\n_p(' LINKOBJS = %s', (cfg.flags.UseObjectResponseFile and \"@$(OBJRESP)\" or \"$(OBJECTS)\"))\nif cfg.kind == \"StaticLib\" then\nif (not prj.options.ArchiveSplit) then\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\nelse\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\n_p(' LINKCMD_NDX = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, true)))\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group '\nendgroup = ' -Wl,--end-group'\nend\n_p(' LINKCMD = $(%s) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup,"
- " endgroup)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\n_p(' GCH_OBJC = $(OBJDIR)/$(notdir $(PCH))_objc.gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_CFLAGS) -x c-header\", \"$(CXX) $(ALL_CXXFLAGS) -x c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('')\n_p('$(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)'"
- ")\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_OBJCFLAGS) -x objective-c-header\", \"$(CXX) $(ALL_OBJCPPFLAGS) -x objective-c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj, cc)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n_p('ifneq (,$(OBJRESP))')\n_p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\n_p('ifneq (,$(LDRESP))')\n_p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) then\nif (path.isobjcfile(file)) then\n_p('$(OBJDIR)/%s.o: %s $(GCH_OBJC) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path"
- ".removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nend\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\nif (path.iscfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCPPFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nend\nelseif (path.isasmfile(file)) then\n_p('\\t$(SILENT) $(CC) $(ALL_ASMFLAGS) -o \"$@\" -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\n"
- "elseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -c \"$<\"', flags, objext)\nend\n",
+ "$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p(' -include $(OBJDIR)/$(notdir $(PCH))_objc.d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('.SUFFIXES:') -- Delete the default suffix rules.\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')"
+ "\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = %s', cc.rc or 'windres')\n_p(' endif')\n_p('endif')\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_cpp_configs(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend"
+ "\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(_MAKE.escquote(cc.getdefines(cfg.defines))))\nlocal id = make.list(cc.getincludedirs(cfg.includedirs));\nlocal uid = make.list(cc.getquoteincludedirs(cfg.userincludedirs))\nlocal sid = make.list(cc.getsystemincludedirs(cfg.systemincludedirs))\nif id ~= \"\" then\n_p(' INCLUDES +=%s', id)\nend"
+ "\nif uid ~= \"\" then\n_p(' INCLUDES +=%s', uid)\nend\nif sid ~= \"\" then\n_p(' INCLUDES +=%s', sid)\nend\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\ntable.sort(cfg.files)\nif cfg.flags.UseObjectResponseFile then\n_p(' OBJRESP = $(OBJDIR)/%s_objects', prj.name)\nelse\n_p(' OBJRESP =')\nend\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILD"
+ "CMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\n_p(' FORCE_INCLUDE_OBJC += -include $(OBJDIR)/$(notdir $(PCH))_objc')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,_MAKE.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLA"
+ "GS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_asm)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cf"
+ "g.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\nlocal libdeps\nlocal lddeps\nif #cfg.wholearchive > 0 then\nlibdeps = {}\nlddeps = {}\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\nlddeps = table.join(lddeps, cc.wholearchive(linkpath))\nelse\ntable.insert(lddeps, linkpath)\nend\ntable.insert(libdeps, linkpath)\nend\nlibdeps = make.list(_MAKE.esc(libdeps))\nlddeps = make.list(_MAKE.esc(lddeps))\nelse\nlibdeps = make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nlddeps = libdeps\nend\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LIBDEPS +=%s', libdeps)\n_p(' LDDEPS +=%s', lddeps)\nif cfg.flags.UseLDResponseFile then\n_p(' LDRESP = $(OBJDIR)/%s_libs', prj.name)\n_p(' LI"
+ "BS += @$(LDRESP)%s', make.list(cc.getlinkflags(cfg)))\nelse\n_p(' LDRESP =')\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nend\n_p(' EXTERNAL_LIBS +=%s', make.list(cc.getlibfiles(cfg)))\n_p(' LINKOBJS = %s', (cfg.flags.UseObjectResponseFile and \"@$(OBJRESP)\" or \"$(OBJECTS)\"))\nif cfg.kind == \"StaticLib\" then\nif (not prj.options.ArchiveSplit) then\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\nelse\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\n_p(' LINKCMD_NDX = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, true)))\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group '\nendgroup = ' -Wl,--end-group'\nend\n_p(' LINKCMD = $(%s) -o $(TARGET) $(LINK"
+ "OBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup, endgroup)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\n_p(' GCH_OBJC = $(OBJDIR)/$(notdir $(PCH))_objc.gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_CFLAGS) -x c-header\", \"$(CXX) $(ALL_CXXFLAGS) -x c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -"
+ "c \"$<\"', cmd)\n_p('')\n_p('$(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_OBJCFLAGS) -x objective-c-header\", \"$(CXX) $(ALL_OBJCPPFLAGS) -x objective-c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj, cc)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n_p('ifneq (,$(OBJRESP))')\n_p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\n_p('ifneq (,$(LDRESP))')\n_p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) then\nif (path.isobjcfile(file)) then\n_p('$(OBJDIR)/%s.o: %"
+ "s $(GCH_OBJC) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nend\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\nif (path.iscfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCPPFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nend\nelseif (path.isasmfile(file)) then\n_p('\\t$(SILENT) $(CC) $(ALL_ASMFLAGS) -o \"$@\" -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postc"
+ "ompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -"
+ "c \"$<\"', flags, objext)\nend\n",
/* actions/make/make_csharp.lua */
"local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\nlocal name = cfg.buildtarget.basename .. \".\"\nlocal dir = path.getdirectory(fname)\nif dir ~= \".\" then\nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Compile\" then"
- "\ntable.insert(sources, fcfg.name)\nelseif action == \"EmbeddedResource\" then\ntable.insert(embedded, fcfg.name)\nelseif action == \"Content\" then\ncopypairs[\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name)\nelseif path.getname(fcfg.name):lower() == \"app.config\" then\ncopypairs[\"$(TARGET).config\"] = _MAKE.esc(fcfg.name)\nend\nend\nlocal paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end)\npaths = table.join({prj.basedir}, paths)\nfor _, libname in ipairs(premake.getlinks(prj, \"system\", \"fullpath\")) do\nlocal libdir = os.pathsearch(libname..\".dll\", unpack(paths))\nif (libdir) then\nlocal target = \"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(libname))\nlocal source = path.getrelative(prj.basedir, path.join(libdir, libname))..\".dll\"\ncopypairs[target] = _MAKE.esc(source)\nend\nend\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(prj.configu"
- "rations[1]:lower()))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('ifndef CSC')\n_p(' CSC=%s', csc.getcompilervar(prj))\n_p('endif')\n_p('')\n_p('ifndef RESGEN')\n_p(' RESGEN=resgen')\n_p('endif')\n_p('')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)\ntable.insert(platforms, 1, \"\")\nfor cfg in premake.eachconfig(prj) "
- "do\npremake.gmake_cs_config(cfg, csc, cfglibs)\nend\n_p('# To maintain compatibility with VS.NET, these values must be set at the project level')\n_p('TARGET := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))\n_p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), \"/lib:\", \"\", \" \"))\n_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, \"system\", \"basename\")), \"/r:\", \".dll\", \" \"))\n_p('')\n_p('SOURCES := \\\\')\nfor _, fname in ipairs(sources) do\n_p('\\t%s \\\\', _MAKE.esc(path.translate(fname)))\nend\n_p('')\n_p('EMBEDFILES := \\\\')\nfor _, fname in ipairs(embedded) do\n_p('\\t%s \\\\', getresourcefilename(prj, fname))\nend\n_p('')\n_p('COPYFILES += \\\\')\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t%s \\\\', target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t%s \\\\', target)\nend\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin"
- ",$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')\n_p('')\n_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')\n_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET) $(COPYFILES)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.basename)\nfor target, source in pairs(cfgpairs"
- "[anycfg]) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_p('# Per-configuration copied file rules')\nfor cfg in premake.eachconfig(prj) do\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\nfor target, source in pairs(cfgpairs[cfg]) do\npremake.make_copyrule(source, target)\nend\n_p('endif')\n_p('')\nend\n_p('# Copied file rules')\nfor target, source in pairs(copypairs) do\npremake.make_copyrule(source, target)\nend\n_p('# Embedded file rules')\nfor _, fname in ipairs(embedded) do\nif path.getextension(fname) == \".resx\" then\n_p('%s: %s', getresourcefilename(prj, fname), "
- "_MAKE.esc(fname))\n_p('\\t$(SILENT) $(RESGEN) $^ $@')\nend\n_p('')\nend\nend\nfunction premake.gmake_cs_config(cfg, csc, cfglibs)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\n_p(' TARGETDIR := %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir))\n_p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"dependencies\", \"fullpath\")), \" \"))\n_p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), \"/r:\", \"\", \" \"))\n_p(' FLAGS += %s %s', table.implode(cfg.defines, \"/d:\", \"\", \" \"), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), \" \"))\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link co"
- "mmands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n",
+ "\ntable.insert(sources, fcfg.name)\nelseif action == \"EmbeddedResource\" then\ntable.insert(embedded, fcfg.name)\nelseif action == \"Content\" then\ncopypairs[\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name)\nelseif path.getname(fcfg.name):lower() == \"app.config\" then\ncopypairs[\"$(TARGET).config\"] = _MAKE.esc(fcfg.name)\nend\nend\nlocal paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end)\npaths = table.join({prj.basedir}, paths)\nfor _, libname in ipairs(premake.getlinks(prj, \"system\", \"fullpath\")) do\nlocal libdir = os.pathsearch(libname..\".dll\", unpack(paths))\nif (libdir) then\nlocal target = \"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(libname))\nlocal source = path.getrelative(prj.basedir, path.join(libdir, libname))..\".dll\"\ncopypairs[target] = _MAKE.esc(source)\nend\nend\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('.SUFFIXES:') -- Delete the default suffix rules.\n_p('')"
+ "\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(prj.configurations[1]:lower()))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('ifndef CSC')\n_p(' CSC=%s', csc.getcompilervar(prj))\n_p('endif')\n_p('')\n_p('ifndef RESGEN')\n_p(' RESGEN=resgen')\n_p('endif')\n_p('')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)\ntable.i"
+ "nsert(platforms, 1, \"\")\nfor cfg in premake.eachconfig(prj) do\npremake.gmake_cs_config(cfg, csc, cfglibs)\nend\n_p('# To maintain compatibility with VS.NET, these values must be set at the project level')\n_p('TARGET := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))\n_p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), \"/lib:\", \"\", \" \"))\n_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, \"system\", \"basename\")), \"/r:\", \".dll\", \" \"))\n_p('')\n_p('SOURCES := \\\\')\nfor _, fname in ipairs(sources) do\n_p('\\t%s \\\\', _MAKE.esc(path.translate(fname)))\nend\n_p('')\n_p('EMBEDFILES := \\\\')\nfor _, fname in ipairs(embedded) do\n_p('\\t%s \\\\', getresourcefilename(prj, fname))\nend\n_p('')\n_p('COPYFILES += \\\\')\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t%s \\\\', target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t%s \\\\', target)\nend\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPE"
+ "C))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')\n_p('')\n_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')\n_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET) $(COPYFILES)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, p"
+ "rj.buildtarget.basename)\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_p('# Per-configuration copied file rules')\nfor cfg in premake.eachconfig(prj) do\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\nfor target, source in pairs(cfgpairs[cfg]) do\npremake.make_copyrule(source, target)\nend\n_p('endif')\n_p('')\nend\n_p('# Copied file rules')\nfor target, source in pairs(copypairs) do\npremake.make_copyrule(source, target)\nend\n_p('# Embedded file rules')\nfor _, fname in ipairs(embedded) do\nif path.getextension(fname) == "
+ "\".resx\" then\n_p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname))\n_p('\\t$(SILENT) $(RESGEN) $^ $@')\nend\n_p('')\nend\nend\nfunction premake.gmake_cs_config(cfg, csc, cfglibs)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\n_p(' TARGETDIR := %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir))\n_p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"dependencies\", \"fullpath\")), \" \"))\n_p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), \"/r:\", \"\", \" \"))\n_p(' FLAGS += %s %s', table.implode(cfg.defines, \"/d:\", \"\", \" \"), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), \" \"))\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #"
+ "cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n",
/* actions/make/make_vala.lua */
- "local make = premake.make\nfunction premake.make_vala(prj)\nlocal valac = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, valac.platforms, \"Native\")\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || e"
- "xit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('VALAC = %s', valac.valac)\n_p('CC = %s', valac.cc)\n_p('')\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_valac_config(prj, cfg, valac)\nend\nend\n_p('SOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.issourcefile(file) then\nif not table.icontains(prj.excludes, file) then\n_p('\\t%s \\\\', _MAKE.esc(file))\nend\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: prebuild prelink $(TARGET) | $(TARGETDIR)')\n_p('\\t@:')\n_p('')\n_p('$(TARGET): $(SOURCES) | $(TARGETDIR)')\n_p('\\t$(SILENT) $(VALAC) -o $(TARGET) --cc=$(CC) $(FLAGS) $(SOURCES)')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj"
- ".solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\nend\nfunction premake.gmake_valac_config(prj, cfg, valac)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(valac.getdefines(cfg.defines)))\n_p(' VAPIDIRS +=%s', make.list(valac.getvapidirs(cfg.vapidirs)))\n_p(' PKGS +=%s', make.list(valac.getlinks(cfg.links)))\n_p(' FLAGS += $(DEFINES) $(VAPIDIRS) $(PKGS)%s', make.list(table.join(valac.getvalaflags(cfg), valac.getbuildoptions(cfg.buildoptions), valac.getbuildoptions(cfg.buildoptions_c), c"
- "fg.buildoptions_vala)))\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n",
+ "premake.make.vala = { }\npremake.make.makefile_ignore = false\nlocal vala = premake.make.vala\nlocal make = premake.make\nfunction premake.make_vala(prj)\nlocal valac = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, valac.platforms, \"Native\")\npremake.gmake_vala_header(prj, valac, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_valac_config(prj, cfg, valac)\nend\nend\nlocal objdirs = {}\nlocal additionalobjdirs = {}\nfor _, file in ipairs(prj.allfiles) do\nif path.issourcefile(file) or path.isgresource(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in iter.sortByKeys(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\nfor dir, _ in iter.sortByKeys(additionalobjdirs) do\n_p('\\t%s \\\\', dir)\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)')\n_p("
+ "'\\t@:')\n_p('')\n_p('$(TARGET): $(OBJECTS) | $(TARGETDIR)')\n_p('\\t@echo Linking %s', prj.name)\n_p('\\t$(SILENT) $(LINKCMD)')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\nvala.fileRules(prj, valac)\nend\nfunction premake.gmake_vala_header(prj, valac, platforms)\n_p('# %s project makefile autoge"
+ "nerated by GENie', premake.action.current().shortname)\n_p('')\n_p('.SUFFIXES:') -- Delete the default suffix rules.\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /"
+ ",\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('VALAC = %s', valac.valac)\n_p('CC = %s', valac.cc)\n_p('GLIBRC = %s', valac.glibrc)\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_valac_config(prj, cfg, valac)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\n_p(' BASEDIR = %s', _MAKE.esc(path.getrelative(cfg.location, _WORKING_DIR)))\n_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(valac.getdefines(cfg.defines)))\n_p(' VAPIDIRS +=%s', make.list(valac.getvapidirs(cfg.vapidirs)))\n_p(' PKGS +=%s', make.list(valac.get"
+ "links(cfg.links)))\n_p(' FLAGS += $(DEFINES) $(VAPIDIRS) $(PKGS)%s', make.list(table.join(valac.getvalaflags(cfg), cfg.buildoptions_vala)))\n_p(' VALA_LDFLAGS= $(shell pkg-config --libs%s)', make.list(cfg.links))\n_p(' ALL_LDFLAGS+= $(LDFLAGS)%s $(VALA_LDFLAGS)', make.list(table.join(cfg.linkoptions)))\n_p(' LINKOBJS = %s', \"$(OBJECTS)\")\n_p(' VALA_CFLAGS = $(shell pkg-config --cflags%s)%s', make.list(cfg.links), make.list(valac.getvalaccflags(cfg)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ARCH)%s $(VALA_CFLAGS)', make.list(table.join(cfg.buildoptions, cfg.buildoptions_c)))\n_p(' LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(ARCH) $(ALL_LDFLAGS)');\ntable.sort(cfg.files)\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) or path.isgresource(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' SOURCES := \\\\')\nfor _, file in ipairs(cfg.files) do\nif pa"
+ "th.issourcefile(file) and path.isvalafile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t%s \\\\', _MAKE.esc(file))\nend\nend\nend\n_p('')\n_p(' GRESOURCES := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.isgresource(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t%s \\\\', _MAKE.esc(file))\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\nfunction vala.fileRules(prj, cc)\nlocal platfor"
+ "ms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n_p('ifneq (,$(OBJRESP))')\n_p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\n_p('ifneq (,$(LDRESP))')\n_p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\nlocal pattern_targets = \"\"\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) or path.isgresource(file) then\nif path.isvalafile(file) or path.iscfile(file) or path.isgresource(file) then\nif path.isvalafile(file) or path.isgresource(file) then\n_p('$(OBJDIR)/%s.o: $(OBJDIR)/%s.c $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nif not path.isgresource(file) then\npattern_targets = pattern_targets\n.. \"$(OBJDIR)/\"\n.. _MAKE.esc(p"
+ "ath.trimdots(path.removeext(file)))\n.. \".% \\\\\\n\" -- Pattern rule: https://stackoverflow.com/a/3077254\nend\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, file\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nend\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -c \"$<\"'\n, \"$(CC) $(ALL_CFLAGS)\"\n, _MAKE.esc(path.getbasename(file))\n)\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\nif path.isgresource(file) then\n_p('$(OBJDIR)/%s.c: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) %s \"$<\" --target=\"$@\" --sourcedir=\"%s\" --generate'\n, \"$(GL"
+ "IBRC)\"\n, _MAKE.esc(path.getdirectory(file))\n)\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\nend\n_p('')\nend\nend\nend\nif pattern_targets ~= \"\" then\n_p('%s: $(SOURCES) $(GRESOURCES) $(GCH) $(MAKEFILE)', pattern_targets)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo [GEN] valac')\nend\n_p('\\t$(SILENT) %s $(SOURCES) --directory $(OBJDIR) --basedir $(BASEDIR) --gresources=$(GRESOURCES) -C'\n, \"$(VALAC) $(FLAGS)\"\n)\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\nend\nend\n",
/* actions/make/make_swift.lua */
- "local make = premake.make\nlocal swift = { }\nfunction premake.make_swift(prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(1, 'config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(1, 'SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(1, 'MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(1, 'COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(1, 'RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(1, 'MKDIR = $(SILENT) mkdir \"$(subst /,"
- "\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(1, 'COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(1, 'RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('SWIFTC = %s', tool.swift)\n_p('SWIFTLINK = %s', tool.swiftc)\n_p('DSYMUTIL = %s', tool.dsymutil)\n_p('AR = %s', tool.ar)\n_p('')\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nswift.generate_config(prj, cfg, tool)\nend\nend\n_p('.PHONY: ')\n_p('')\n_p('all: $(WORK_DIRS) $(TARGET)')\n_p('')\n_p('$(WORK_DIRS):')\n_p(1, '$(SILENT) $(call MKDIR,$@)')\n_p('')\n_p('SOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isswiftfile(file) then\n_p(1, '%s \\\\', _MAKE.esc(file))\nend\nend\n_p('')\nlocal objfiles = {}\n_p('OBJECTS_WITNESS := $(OBJDIR)/build.stamp')\n_p('OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isswiftfile(file) then\nlocal objname = _MAKE.esc(swift.objectname(file))\ntable.insert(objfiles, objnam"
- "e)\n_p(1, '%s \\\\', objname)\nend\nend\n_p('')\nswift.file_rules(prj, objfiles)\nswift.linker(prj, tool)\nswift.generate_clean(prj)\nend\nfunction swift.objectname(file)\nreturn path.join(\"$(OBJDIR)\", path.getname(file)..\".o\")\nend\nfunction swift.file_rules(prj, objfiles)\n_p('$(OBJECTS_WITNESS): $(SOURCES)')\n_p(1, \"@rm -f $(OBJDIR)/data.tmp\")\n_p(1, \"@touch $(OBJDIR)/data.tmp\")\n_p(1, \"$(SILENT) $(SWIFTC) -frontend -c $(SOURCES) -enable-objc-interop $(SDK) -I $(OUT_DIR) $(SWIFTC_FLAGS) -module-cache-path $(MODULECACHE_DIR) -D SWIFT_PACKAGE $(MODULE_MAPS) -emit-module-doc-path $(OUT_DIR)/$(MODULE_NAME).swiftdoc -module-name $(MODULE_NAME) -emit-module-path $(OUT_DIR)/$(MODULE_NAME).swiftmodule -num-threads 8 %s\", table.arglist(\"-o\", objfiles))\n_p(1, \"@mv -f $(OBJDIR)/data.tmp $(OBJECTS_WITNESS)\")\n_p('')\n_p('$(OBJECTS): $(OBJECTS_WITNESS)')\n_p(1, '@if test -f $@; then :; else \\\\')\n_p(2, 'rm -f $(OBJECTS_WITNESS); \\\\')\n_p(2, '$(MAKE) $(AM_MAKEFLAGS) $(OBJECTS_WITNESS); \\\\')\n_p(1, 'f"
- "i')\n_p('')\nend\nfunction swift.linker(prj, tool)\nlocal lddeps = make.list(premake.getlinks(prj, \"siblings\", \"fullpath\")) \nif prj.kind == \"StaticLib\" then\n_p(\"$(TARGET): $(OBJECTS) %s \", lddeps)\n_p(1, \"$(SILENT) $(AR) cr $(AR_FLAGS) $@ $(OBJECTS) %s\", (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p(\"$(TARGET): $(OBJECTS) $(LDDEPS)\", lddeps)\n_p(1, \"$(SILENT) $(SWIFTLINK) $(SDK) -L $(OUT_DIR) -o $@ $(SWIFTLINK_FLAGS) $(LD_FLAGS) $(OBJECTS)\")\n_p(\"ifdef SYMBOLS\")\n_p(1, \"$(SILENT) $(DSYMUTIL) $(TARGET) -o $(SYMBOLS)\")\n_p(\"endif\")\nend\n_p('')\nend\nfunction swift.generate_clean(prj)\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('\\t$(SILENT) rm -rf $(SYMBOLS)')\n_p('\\t$(SILENT) rm -rf $(MODULECACHE_DIR"
- ")')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(SYMBOLS)) rmdir /s /q $(subst /,\\\\\\\\,$(SYMBOLS))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(MODULECACHE_DIR)) rmdir /s /q $(subst /,\\\\\\\\,$(MODULECACHE_DIR))')\n_p('endif')\n_p('')\nend\nfunction swift.generate_config(prj, cfg, tool)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\n_p(1, \"OUT_DIR = %s\", cfg.buildtarget.directory)\n _p(1, \"MODULECACHE_DIR = $(OUT_DIR)/ModuleCache\")\n_p(1, \"TARGET = $(OUT_DIR)/%s\", _MAKE.esc(cfg.buildtarget.name))\nlocal objdir = path.join(cfg.objectsdir, prj.name .. \".build\")\n_p(1, \"OBJDIR = %s\", objdir)\n_p(1, \"MODULE_NAME = %s\", prj.name)\n_p(1, \"MODULE_MAPS = %s\", make.list(tool.getmodulemaps(cfg)))\n_p(1, \"SWIFTC_FLAGS = %s\", make.list(tool.getswiftcflags(cfg)))\n_p(1, \"SWIFTLINK_FLA"
- "GS = %s\", make.list(tool.getswiftlinkflags(cfg)))\n_p(1, \"AR_FLAGS = %s\", make.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"LD_FLAGS = %s\", make.list(tool.getldflags(cfg)))\n_p(1, \"LDDEPS = %s\", make.list(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nif cfg.flags.Symbols then\n_p(1, \"SYMBOLS = $(TARGET).dSYM\")\nend\nlocal sdk = tool.get_sdk_path(cfg)\nif sdk then\n_p(1, \"TOOLCHAIN_PATH = %s\", tool.get_toolchain_path(cfg))\n_p(1, \"SDK_PATH = %s\", sdk)\n_p(1, \"PLATFORM_PATH = %s\", tool.get_sdk_platform_path(cfg))\n_p(1, \"SDK = -sdk $(SDK_PATH)\")\nelse\n_p(1, \"SDK_PATH =\")\n_p(1, \"SDK =\")\nend\n_p(1,'WORK_DIRS = $(OUT_DIR) $(OBJDIR)')\n_p('endif')\n_p('')\nend",
+ "local make = premake.make\nlocal swift = { }\nfunction premake.make_swift(prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('.SUFFIXES:') -- Delete the default suffix rules.\n_p('')\n_p('ifndef config')\n_p(1, 'config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(1, 'SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(1, 'MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(1, 'COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(1, 'RM = $(SILENT) rm -"
+ "f \"$(1)\"')\n_p('else')\n_p(1, 'MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(1, 'COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(1, 'RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('SWIFTC = %s', tool.swift)\n_p('SWIFTLINK = %s', tool.swiftc)\n_p('DSYMUTIL = %s', tool.dsymutil)\n_p('AR = %s', tool.ar)\n_p('')\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nswift.generate_config(prj, cfg, tool)\nend\nend\n_p('.PHONY: ')\n_p('')\n_p('all: $(WORK_DIRS) $(TARGET)')\n_p('')\n_p('$(WORK_DIRS):')\n_p(1, '$(SILENT) $(call MKDIR,$@)')\n_p('')\n_p('SOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isswiftfile(file) then\n_p(1, '%s \\\\', _MAKE.esc(file))\nend\nend\n_p('')\nlocal objfiles = {}\n_p('OBJECTS_WITNESS := $(OBJDIR)/build.stamp')\n_p('OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isswiftfile(file) then\nlocal objna"
+ "me = _MAKE.esc(swift.objectname(file))\ntable.insert(objfiles, objname)\n_p(1, '%s \\\\', objname)\nend\nend\n_p('')\nswift.file_rules(prj, objfiles)\nswift.linker(prj, tool)\nswift.generate_clean(prj)\nend\nfunction swift.objectname(file)\nreturn path.join(\"$(OBJDIR)\", path.getname(file)..\".o\")\nend\nfunction swift.file_rules(prj, objfiles)\n_p('$(OBJECTS_WITNESS): $(SOURCES)')\n_p(1, \"@rm -f $(OBJDIR)/data.tmp\")\n_p(1, \"@touch $(OBJDIR)/data.tmp\")\n_p(1, \"$(SILENT) $(SWIFTC) -frontend -c $(SOURCES) -enable-objc-interop $(SDK) -I $(OUT_DIR) $(SWIFTC_FLAGS) -module-cache-path $(MODULECACHE_DIR) -D SWIFT_PACKAGE $(MODULE_MAPS) -emit-module-doc-path $(OUT_DIR)/$(MODULE_NAME).swiftdoc -module-name $(MODULE_NAME) -emit-module-path $(OUT_DIR)/$(MODULE_NAME).swiftmodule -num-threads 8 %s\", table.arglist(\"-o\", objfiles))\n_p(1, \"@mv -f $(OBJDIR)/data.tmp $(OBJECTS_WITNESS)\")\n_p('')\n_p('$(OBJECTS): $(OBJECTS_WITNESS)')\n_p(1, '@if test -f $@; then :; else \\\\')\n_p(2, 'rm -f $(OBJECTS_WITNESS); \\\\')"
+ "\n_p(2, '$(MAKE) $(AM_MAKEFLAGS) $(OBJECTS_WITNESS); \\\\')\n_p(1, 'fi')\n_p('')\nend\nfunction swift.linker(prj, tool)\nlocal lddeps = make.list(premake.getlinks(prj, \"siblings\", \"fullpath\"))\nif prj.kind == \"StaticLib\" then\n_p(\"$(TARGET): $(OBJECTS) %s \", lddeps)\n_p(1, \"$(SILENT) $(AR) cr $(AR_FLAGS) $@ $(OBJECTS) %s\", (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p(\"$(TARGET): $(OBJECTS) $(LDDEPS)\", lddeps)\n_p(1, \"$(SILENT) $(SWIFTLINK) $(SDK) -L $(OUT_DIR) -o $@ $(SWIFTLINK_FLAGS) $(LD_FLAGS) $(OBJECTS)\")\n_p(\"ifdef SYMBOLS\")\n_p(1, \"$(SILENT) $(DSYMUTIL) $(TARGET) -o $(SYMBOLS)\")\n_p(\"endif\")\nend\n_p('')\nend\nfunction swift.generate_clean(prj)\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('\\t$(SI"
+ "LENT) rm -rf $(SYMBOLS)')\n_p('\\t$(SILENT) rm -rf $(MODULECACHE_DIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(SYMBOLS)) rmdir /s /q $(subst /,\\\\\\\\,$(SYMBOLS))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(MODULECACHE_DIR)) rmdir /s /q $(subst /,\\\\\\\\,$(MODULECACHE_DIR))')\n_p('endif')\n_p('')\nend\nfunction swift.generate_config(prj, cfg, tool)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\n_p(1, \"OUT_DIR = %s\", cfg.buildtarget.directory)\n _p(1, \"MODULECACHE_DIR = $(OUT_DIR)/ModuleCache\")\n_p(1, \"TARGET = $(OUT_DIR)/%s\", _MAKE.esc(cfg.buildtarget.name))\nlocal objdir = path.join(cfg.objectsdir, prj.name .. \".build\")\n_p(1, \"OBJDIR = %s\", objdir)\n_p(1, \"MODULE_NAME = %s\", prj.name)\n_p(1, \"MODULE_MAPS = %s\", make.list(tool.getmodulemaps(cfg)))\n_p(1, \"SWIFTC_FLAGS"
+ " = %s\", make.list(tool.getswiftcflags(cfg)))\n_p(1, \"SWIFTLINK_FLAGS = %s\", make.list(tool.getswiftlinkflags(cfg)))\n_p(1, \"AR_FLAGS = %s\", make.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"LD_FLAGS = %s\", make.list(tool.getldflags(cfg)))\n_p(1, \"LDDEPS = %s\", make.list(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nif cfg.flags.Symbols then\n_p(1, \"SYMBOLS = $(TARGET).dSYM\")\nend\nlocal sdk = tool.get_sdk_path(cfg)\nif sdk then\n_p(1, \"TOOLCHAIN_PATH = %s\", tool.get_toolchain_path(cfg))\n_p(1, \"SDK_PATH = %s\", sdk)\n_p(1, \"PLATFORM_PATH = %s\", tool.get_sdk_platform_path(cfg))\n_p(1, \"SDK = -sdk $(SDK_PATH)\")\nelse\n_p(1, \"SDK_PATH =\")\n_p(1, \"SDK =\")\nend\n_p(1,'WORK_DIRS = $(OUT_DIR) $(OBJDIR)')\n_p('endif')\n_p('')\nend\n",
/* actions/vstudio/_vstudio.lua */
- "premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v100\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\",\nvs2017 = \"v141\",\nvs2019 = \"v142\",\nvsllvm = \"llvm\",\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\npremake.vstudio.splashpath = ''\npremake.vstudio.xpwarning = true\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\",\nOrbis = \"ORBIS\",\nDurango = \"Durango\",\nTegraAndroid = \"Tegra-Android\",\nNX32 = \"NX32\",\nNX64 = \"NX64\",\nEmscripten = \"Emscripten\",\n}\nfunction vstudio.arch(prj)\nif (prj.language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.iswinrt()\nreturn vstudio.storeapp ~= nil and vstudio.storeapp ~= ''\nend\nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filter"
- "platforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\nlocal platforms2010 = { }\nfor _, platform in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = pla"
- "tform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction premake.vstudio.bakeimports(sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif string.find(iprj.location, \".csproj\") ~= nil then\niprj.language = \"C#\"\nelse\niprj.language = \"C++\"\nend\nlocal f, err = io.open(iprj.location, \"r\")\nif (not f) then\nerror(err, 1)\nend\nlocal projcontents = f:read(\"*all\")\nf:close()\nlocal found, _, uuid = string.find(projcontents, \"<ProjectGuid>{([%w%-]+)}</ProjectGuid>\")\nif not found then\nerror(\"Could not find ProjectGuid element in project \" .. iprj.location, 1)\nend\niprj.uuid = uuid\nif iprj.language == \"C++\" and string.find(projcontents, \"<CLRSupport>true</CLRSupport>\") then\niprj.flags.Managed = true\nend\niprj.relpath = path.getrelative(sln.location, iprj.location)\nend\nend\nfunction premake.vstudio.getimpo"
- "rtprj(prjpath, sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif prjpath == iprj.relpath then\nreturn iprj\nend\nend\nerror(\"Could not find reference import project \" .. prjpath, 1)\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name ."
- ". \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\nfunction vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\n",
+ "premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v100\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\",\nvs2017 = \"v141\",\nvs2019 = \"v142\",\nvs2022 = \"v143\",\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\npremake.vstudio.splashpath = ''\npremake.vstudio.xpwarning = true\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\",\nARM64 = \"ARM64\",\nOrbis = \"ORBIS\",\nDurango = \"Durango\",\nTegraAndroid = \"Tegra-Android\",\nNX32 = \"NX32\",\nNX64 = \"NX64\",\nEmscripten = \"Emscripten\",\n[\"gdk-desktop\"] = \"Gaming.Desktop.x64\",\n[\"gdk-xboxone\"] = \"Gaming.Xbox.XboxOne.x64\",\n[\"gdk-scarlett\"] = \"Gaming.Xbox.Scarlett.x64\",\n}\nfunction vstudio.arch(prj)\nif (prj"
+ ".language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.iswinrt()\nreturn vstudio.storeapp ~= nil and vstudio.storeapp ~= ''\nend\nfunction vstudio.isgdkconsole(cfg)\nfor _,p in pairs({\"gdk-xboxone\", \"gdk-scarlett\"}) do\nif cfg.platform == p then\nreturn true\nend\nend\nreturn false\nend\nfunction vstudio.isgdkdesktop(cfg)\nreturn cfg.platform == \"gdk-desktop\"\nend\nfunction vstudio.isgdk(cfg)\nreturn vstudio.isgdkconsole(cfg) or vstudio.isgdkdesktop(cfg)\nend\n \nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filterplatforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\nlocal platforms2010 = { }\nfor _, platfor"
+ "m in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction premake.vstudio.bakeimports(sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif string.find(iprj.location, \".csproj\") ~= nil then\niprj.language = \"C#\"\nelse\nipr"
+ "j.language = \"C++\"\nend\nlocal f, err = io.open(iprj.location, \"r\")\nif (not f) then\nerror(err, 1)\nend\nlocal projcontents = f:read(\"*all\")\nf:close()\nlocal found, _, uuid = string.find(projcontents, \"<ProjectGuid>{([%w%-]+)}</ProjectGuid>\")\nif not found then\nerror(\"Could not find ProjectGuid element in project \" .. iprj.location, 1)\nend\niprj.uuid = uuid\nif iprj.language == \"C++\" and string.find(projcontents, \"<CLRSupport>true</CLRSupport>\") then\niprj.flags.Managed = true\nend\niprj.relpath = path.getrelative(sln.location, iprj.location)\nend\nend\nfunction premake.vstudio.getimportprj(prjpath, sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif prjpath == iprj.relpath then\nreturn iprj\nend\nend\nerror(\"Could not find reference import project \" .. prjpath, 1)\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%"
+ ".usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\nfunction vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-3"
+ "01F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\n",
/* actions/vstudio/vstudio_solution.lua */
"premake.vstudio.sln2005 = { }\nlocal vstudio = premake.vstudio\nlocal sln2005 = premake.vstudio.sln2005\nfunction sln2005.generate(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio.buildconfigs(sln)\npremake.vstudio.bakeimports(sln)\n_p('\\239\\187\\191')\nsln2005.reorderProjects(sln)\nsln2005.header(sln)\nfor grp in premake.solution.eachgroup(sln) do\nsln2005.group(grp)\nend\nfor prj in premake.solution.eachproject(sln) do\nsln2005.project(prj)\nend\n \nfor _,iprj in ipairs(sln.importedprojects) do\nsln2005.importproject(iprj)\nend\n_p('Global')\nsln2005.platforms(sln)\nsln2005.project_platforms(sln)\nsln2005.properties(sln)\nsln2005.project_groups(sln)\n_p('EndGlobal')\nend\nfunction sln2005.reorderProjects(sln)\nif sln.startproject then\nfor i, prj in ipairs(sln.projects) do\nif sln.startproject == prj.name then\nlocal cur = prj.group\nwhile cur ~= nil do\nfor j, group in ipairs(sln.groups) do\nif group == cur then\ntable.remove(sln.groups, j)\nbreak\nend\nend\ntable.insert(sln.groups, 1"
- ", cur)\ncur = cur.parent\nend\ntable.remove(sln.projects, i)\ntable.insert(sln.projects, 1, prj)\nbreak\nend\nend\nend\nend\nfunction sln2005.header(sln)\nlocal action = premake.action.current()\n_p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion)\nif(_ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\") then\n_p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2))\nelse\n_p('# Visual Studio %s', _ACTION:sub(3))\nend\nend\nfunction sln2005.project(prj)\nlocal projpath = path.translate(path.getrelative(prj.solution.location, vstudio.projectfile(prj)), \"\\\\\")\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(prj), prj.name, projpath, prj.uuid)\nsln2005.projectdependencies(prj)\n_p('EndProject')\nend\nfunction sln2005.group(grp)\n_p('Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"%s\", \"%s\", \"{%s}\"', grp.name, grp.name, grp.uuid)\n_p('EndProject')\nend\n \nfunction sln2005.importproject(iprj)"
- "\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(iprj), path.getbasename(iprj.location), iprj.relpath, iprj.uuid)\n_p('EndProject')\nend\nfunction sln2005.projectdependencies(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\nend\nfunction sln2005.platforms(sln)\n_p('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution')\nfor _, cfg in ipairs(sln.vstudio_configs) do\n_p('\\t\\t%s = %s', cfg.name, cfg.name)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_platform(prj, sln)\nfor _, cfg in ipairs(sln.vstudio_configs) do\nlocal mapped\nlocal buildfor\nif premake.isdotnetproject(prj) then\nbuildfor = \"x64\"\nmapped = \"Any CPU\"\nelseif prj.flags and prj.flags.Managed then\nmapped = \"x64\"\nels"
- "e\nif cfg.platform == \"Any CPU\" or cfg.platform == \"Mixed Platforms\" then\nmapped = sln.vstudio_configs[3].platform\nelse\nmapped = cfg.platform\nend\nend\nlocal build_project = true\nif prj.solution ~= nil then\n build_project = premake.getconfig(prj, cfg.src_buildcfg, cfg.src_platform).build\nend\n_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\nif build_project then\n if mapped == cfg.platform or cfg.platform == \"Mixed Platforms\" or buildfor == cfg.platform then\n _p('\\t\\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\n if premake.vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n _p('\\t\\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\nend\nend\nend\nfunction sln2005.project_platforms(sln)\n_p('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nsln2005.project_platform(prj, sln)\nend\nfor _,iprj in ipairs(sln.imported"
- "projects) do\nsln2005.project_platform(iprj, sln)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.properties(sln)\n_p('\\tGlobalSection(SolutionProperties) = preSolution')\n_p('\\t\\tHideSolutionNode = FALSE')\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_groups(sln)\n_p('\\tGlobalSection(NestedProjects) = preSolution')\nfor grp in premake.solution.eachgroup(sln) do\nif grp.parent ~= nil then\n_p('\\t\\t{%s} = {%s}', grp.uuid, grp.parent.uuid)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif prj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', prj.uuid, prj.group.uuid)\nend\nend\nfor _,iprj in ipairs(sln.importedprojects) do\nif iprj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', iprj.uuid, iprj.group.uuid)\nend\nend\n \n_p('\\tEndGlobalSection')\nend",
+ ", cur)\ncur = cur.parent\nend\ntable.remove(sln.projects, i)\ntable.insert(sln.projects, 1, prj)\nbreak\nend\nend\nend\nend\nfunction sln2005.header(sln)\nlocal action = premake.action.current()\n_p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion)\nif(_ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\") then\n_p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2))\nelseif(_ACTION:sub(3) == \"2019\") then\n_p('# Visual Studio Version %s', action.vstudio.toolsVersion:sub(1,2))\nelse\n_p('# Visual Studio %s', _ACTION:sub(3))\nend\nend\nfunction sln2005.project(prj)\nlocal projpath = path.translate(path.getrelative(prj.solution.location, vstudio.projectfile(prj)), \"\\\\\")\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(prj), prj.name, projpath, prj.uuid)\nsln2005.projectdependencies(prj)\n_p('EndProject')\nend\nfunction sln2005.group(grp)\n_p('Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"%s\", \"%s\", \"{%s}\"', grp.name, grp."
+ "name, grp.uuid)\n_p('EndProject')\nend\n \nfunction sln2005.importproject(iprj)\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(iprj), path.getbasename(iprj.location), iprj.relpath, iprj.uuid)\n_p('EndProject')\nend\nfunction sln2005.projectdependencies(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\nend\nfunction sln2005.platforms(sln)\n_p('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution')\nfor _, cfg in ipairs(sln.vstudio_configs) do\n_p('\\t\\t%s = %s', cfg.name, cfg.name)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_platform(prj, sln)\nfor _, cfg in ipairs(sln.vstudio_configs) do\nlocal mapped\nlocal buildfor\nif premake.isdotnetproject(prj) then\nbuildfor = \"x64\"\nmapped"
+ " = \"Any CPU\"\nelseif prj.flags and prj.flags.Managed then\nmapped = \"x64\"\nelse\nif cfg.platform == \"Any CPU\" or cfg.platform == \"Mixed Platforms\" then\nmapped = sln.vstudio_configs[3].platform\nelse\nmapped = cfg.platform\nend\nend\nlocal build_project = true\nif prj.solution ~= nil then\n build_project = premake.getconfig(prj, cfg.src_buildcfg, cfg.src_platform).build\nend\n_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\nif build_project then\n if mapped == cfg.platform or cfg.platform == \"Mixed Platforms\" or buildfor == cfg.platform then\n _p('\\t\\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\n if premake.vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n _p('\\t\\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\n if premake.vstudio.isgdk(cfg) and prj.kind == \"WindowedApp\" then\n _p('\\t\\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\ne"
+ "nd\nend\nend\nfunction sln2005.project_platforms(sln)\n_p('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nsln2005.project_platform(prj, sln)\nend\nfor _,iprj in ipairs(sln.importedprojects) do\nsln2005.project_platform(iprj, sln)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.properties(sln)\n_p('\\tGlobalSection(SolutionProperties) = preSolution')\n_p('\\t\\tHideSolutionNode = FALSE')\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_groups(sln)\n_p('\\tGlobalSection(NestedProjects) = preSolution')\nfor grp in premake.solution.eachgroup(sln) do\nif grp.parent ~= nil then\n_p('\\t\\t{%s} = {%s}', grp.uuid, grp.parent.uuid)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif prj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', prj.uuid, prj.group.uuid)\nend\nend\nfor _,iprj in ipairs(sln.importedprojects) do\nif iprj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', iprj.uuid, iprj.group.uuid)\nend\nend\n \n_p('\\tEndGlobal"
+ "Section')\nend\n",
/* actions/vstudio/vstudio_vcxproj.lua */
"premake.vstudio.vc2010 = { }\nlocal vc2010 = premake.vstudio.vc2010\nlocal vstudio = premake.vstudio\nlocal function vs2010_config(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nif cfginfo.src_platform == \"TegraAndroid\" then\n_p(1,'<PropertyGroup Label=\"NsightTegraProject\">')\n_p(2,'<NsightTegraProjectRevisionNumber>11</NsightTegraProjectRevisionNumber>')\n_p(1,'</PropertyGroup>')\nbreak\nend\nend\n_p(1,'<ItemGroup Label=\"ProjectConfigurations\">')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'<ProjectConfiguration Include=\"%s\">', premake.esc(cfginfo.name))\n_p(3,'<Configuration>%s</Configuration>',cfginfo.buildcfg)\n_p(3,'<Platform>%s</Platform>',cfginfo.platform)\n_p(2,'</ProjectConfiguration>')\nend\n_p(1,'</ItemGroup>')\nend\nlocal function vs2010_globals(prj)\nlocal action = premake.action.current()\n_p(1,'<PropertyGroup Label=\"Globals\">')\n_p(2, '<ProjectGuid>{%s}</ProjectGuid>',prj.uuid)\n_p(2, '<RootNamespace>%s</RootNamespace>',prj.name)\nif vstudio.store"
"app ~= \"durango\" then\nlocal windowsTargetPlatformVersion = prj.windowstargetplatformversion or action.vstudio.windowsTargetPlatformVersion\nif windowsTargetPlatformVersion ~= nil then\n_p(2,'<WindowsTargetPlatformVersion>%s</WindowsTargetPlatformVersion>',windowsTargetPlatformVersion)\nif windowsTargetPlatformVersion and string.startswith(windowsTargetPlatformVersion, \"10.\") then\n_p(2,'<WindowsTargetPlatformMinVersion>%s</WindowsTargetPlatformMinVersion>', prj.windowstargetplatformminversion or \"10.0.10240.0\")\nend\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal frameworkVersion = prj.framework or \"4.0\"\n_p(2, '<TargetFrameworkVersion>v%s</TargetFrameworkVersion>', frameworkVersion)\n_p(2, '<Keyword>ManagedCProj</Keyword>')\nelseif vstudio.iswinrt() then\n_p(2, '<DefaultLanguage>en-US</DefaultLanguage>')\nif vstudio.storeapp == \"durango\" then\n_p(2, '<Keyword>Win32Proj</Keyword>')\n_p(2, '<ApplicationEnvironment>title</ApplicationEnvironment>')\n_p(2, '<MinimumVisualStudioVersion>14.0</Mi"
- "nimumVisualStudioVersion>')\n_p(2, '<TargetRuntime>Native</TargetRuntime>')\nelse\n_p(2, '<AppContainerApplication>true</AppContainerApplication>')\n_p(2, '<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>')\n_p(2, '<ApplicationType>Windows Store</ApplicationType>')\n_p(2, '<ApplicationTypeRevision>%s</ApplicationTypeRevision>', vstudio.storeapp)\nend\nelse\n_p(2, '<Keyword>Win32Proj</Keyword>')\nend\nif _ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"2019\" or _ACTION:sub(3) == \"llvm\" then\n_p(2,'<PreferredToolArchitecture>x64</PreferredToolArchitecture>')\nend\nif (_ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\")\nand os.isdir(path.join(os.getenv(\"VSINSTALLDIR\"), \"VC/Tools/MSVC/14.14.26428\")) then\n_p(2,'<VCToolsVersion>14.14.26428</VCToolsVersion>')\nend\nif not vstudio.xpwarning then\n_p(2, '<XPDeprecationWarning>false</XPDeprecationWarning>')\nend\n_p(1,'</PropertyGroup>')\nend\nfunction vc2010.config_type(config)\nlocal t =\n{\nSharedLib = \"Dyna"
- "micLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nfunction vc2010.configurationPropertyGroup(cfg, cfginfo)\n_p(1, '<PropertyGroup '..if_config_and_platform() ..' Label=\"Configuration\">'\n, premake.esc(cfginfo.name))\nlocal is2019 = premake.action.current() == premake.action.get(\"vs2019\")\nif is2019 then\n _p(2, '<VCProjectVersion>%s</VCProjectVersion>', action.vstudio.toolsVersion)\nif cfg.flags.UnitySupport then\n _p(2, '<EnableUnitySupport>true</EnableUnitySupport>')\nend\nend\n_p(2, '<Confi"
- "gurationType>%s</ConfigurationType>', vc2010.config_type(cfg))\n_p(2, '<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\n_p(2, '<PlatformToolset>%s</PlatformToolset>', premake.vstudio.toolset)\nif os.is64bit() then\n_p(2, '<PreferredToolArchitecture>x64</PreferredToolArchitecture>')\nend\nif cfg.flags.MFC then\n_p(2,'<UseOfMfc>%s</UseOfMfc>', iif(cfg.flags.StaticRuntime, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.ATL or cfg.flags.StaticATL then\n_p(2,'<UseOfAtl>%s</UseOfAtl>', iif(cfg.flags.StaticATL, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.Unicode then\n_p(2,'<CharacterSet>Unicode</CharacterSet>')\nend\nif cfg.flags.Managed then\n_p(2,'<CLRSupport>true</CLRSupport>')\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidtargetapi then\n_p(2,'<AndroidTargetAPI>android-%s</AndroidTargetAPI>', cfg.androidtargetapi)\nend\nif cfg.androidminapi then\n_p(2,'<AndroidMinAPI>android-%s</AndroidMinAPI>', cfg.androidminapi)\nend\nif cfg.androidarch "
- "then\n_p(2,'<AndroidArch>%s</AndroidArch>', cfg.androidarch)\nend\nif cfg.androidndktoolchainversion then\n_p(2,'<NdkToolchainVersion>%s</NdkToolchainVersion>', cfg.androidndktoolchainversion)\nend\nif cfg.androidstltype then\n_p(2,'<AndroidStlType>%s</AndroidStlType>', cfg.androidstltype)\nend\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\n_p(2,'<NintendoSdkRoot>$(NINTENDO_SDK_ROOT)\\\\</NintendoSdkRoot>')\n_p(2,'<NintendoSdkSpec>NX</NintendoSdkSpec>')\nif premake.config.isdebugbuild(cfg) then\n_p(2,'<NintendoSdkBuildType>Debug</NintendoSdkBuildType>')\nelse\n_p(2,'<NintendoSdkBuildType>Release</NintendoSdkBuildType>')\nend\nend\nif cfg.flags.Symbols and (premake.action.current() == premake.action.get(\"vs2017\") or is2019) then\n_p(2, '<DebugSymbols>true</DebugSymbols>')\nend\n_p(1,'</PropertyGroup>')\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<Imp"
- "ortGroup '..if_config_and_platform() ..' Label=\"PropertySheets\">'\n,premake.esc(cfginfo.name))\n_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')\nif #cfg.propertysheets > 0 then\nlocal dirs = cfg.propertysheets\nfor _, dir in ipairs(dirs) do\n_p(2,'<Import Project=\"%s\" />', path.translate(dir))\nend\nend\n_p(1,'</ImportGroup>')\nend\nend\nlocal function add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nfunction vc2010.outputProperties(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nlocal target = cfg.buildtarget\nlocal outdir = add_trailing_backslash(target.directory)\nlocal intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute\n, path.translate(\n path.join(prj.solution.locati"
- "on, cfg.objectsdir)\n, '\\\\')\n, cfg.objectsdir\n))\n_p(1,'<PropertyGroup '..if_config_and_platform() ..'>', premake.esc(cfginfo.name))\n_p(2,'<OutDir>%s</OutDir>', iif(outdir:len() > 0, premake.esc(outdir), \".\\\\\"))\nif cfg.platform == \"Xbox360\" then\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>', premake.esc(target.name))\nend\n_p(2,'<IntDir>%s</IntDir>', premake.esc(intdir))\n_p(2,'<TargetName>%s</TargetName>', premake.esc(path.getbasename(target.name)))\n_p(2,'<TargetExt>%s</TargetExt>', premake.esc(path.getextension(target.name)))\nif cfg.kind == \"SharedLib\" then\nlocal ignore = (cfg.flags.NoImportLib ~= nil)\n_p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>', tostring(ignore))\nend\nif cfg.platform == \"Durango\" then\n_p(2, '<ReferencePath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</ReferencePath>')\n_p(2, '<LibraryPath>$(Console_SdkLibPath)</LibraryPath>')\n_p(2, '<LibraryWPath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</LibraryWPath>')\n_p(2, '<IncludePath>$(Console_"
- "SdkIncludeRoot)</IncludePath>')\n_p(2, '<ExecutablePath>$(Console_SdkRoot)bin;$(VCInstallDir)bin\\\\x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7\\\\Tools\\\\bin;$(VSInstallDir)Common7\\\\tools;$(VSInstallDir)Common7\\\\ide;$(ProgramFiles)\\\\HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);</ExecutablePath>')\nif cfg.imagepath then\n_p(2, '<LayoutDir>%s</LayoutDir>', cfg.imagepath)\nelse\n_p(2, '<LayoutDir>%s</LayoutDir>', prj.name)\nend\nif cfg.pullmappingfile ~= nil then\n_p(2,'<PullMappingFile>%s</PullMappingFile>', premake.esc(cfg.pullmappingfile))\nend\n_p(2, '<LayoutExtensionFilter>*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb</LayoutExtensionFilter>')\n_p(2, '<IsolateConfigurationsOnDeploy>true</IsolateConfigurationsOnDeploy>')\nend\nif cfg.kind ~= \"StaticLib\" then\n_p(2,'<LinkIncremental>%s</LinkIncremental>', tostring(premake.config.isincrementallink(cfg)))\nend\nif cfg.applicationdatadir ~= nil then\n_p(2,'<ApplicationDataDir>%s</Applic"
- "ationDataDir>', premake.esc(cfg.applicationdatadir))\nend\nif cfg.flags.NoManifest then\n_p(2,'<GenerateManifest>false</GenerateManifest>')\nend\n_p(1,'</PropertyGroup>')\nend\nend\nlocal function runtime(cfg)\nlocal runtime\nlocal flags = cfg.flags\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'<PrecompiledHeader>Use</PrecompiledHeader>')\n_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', cfg.pchheader)\nelse\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')\nend\nend\nlocal function preprocessor(indent,cfg,escape)\nif #cfg.defines > 0 then\nlocal defines = table.concat(cfg.defines, \";\")\nif escape then\ndefines = defines:gsub('\"', '\\\\\"')\nend\nlocal isPreprocessorDef"
- "initionPresent = string.find(defines, \"%%%(PreprocessorDefinitions%)\")\nif isPreprocessorDefinitionPresent then\n_p(indent,'<PreprocessorDefinitions>%s</PreprocessorDefinitions>'\n,premake.esc(defines))\nelse\n_p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n,premake.esc(defines))\nend\nelse\n_p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>')\nend\nend\nlocal function include_dirs(indent,cfg)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs> 0 then\n_p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'\n,premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\')))\nend\nend\nlocal function using_dirs(indent,cfg)\nif #cfg.usingdirs > 0 then\n_p(indent,'<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>'\n,premake.esc(path.translate(table.concat(cfg.usingdirs, \";\"), '\\\\')))\nend\nend"
- "\nlocal function resource_compile(cfg)\n_p(2,'<ResourceCompile>')\npreprocessor(3,cfg,true)\ninclude_dirs(3,cfg)\n_p(2,'</ResourceCompile>')\nend\nlocal function cppstandard_vs2017_or_2019(cfg)\nif cfg.flags.CppLatest then\n_p(3, '<LanguageStandard>stdcpplatest</LanguageStandard>')\n_p(3, '<EnableModules>true</EnableModules>')\nelseif cfg.flags.Cpp17 then\n_p(3, '<LanguageStandard>stdcpp17</LanguageStandard>')\nelseif cfg.flags.Cpp14 then\n_p(3, '<LanguageStandard>stdcpp14</LanguageStandard>')\nend\nend\nlocal function exceptions(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.NoExceptions then\n_p(3, '<CppExceptions>false</CppExceptions>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.NoExceptions then\n_p(3, '<GccExceptionHandling>false</GccExceptionHandling>')\nend\nelse\nif cfg.flags.NoExceptions then\n_p(3, '<ExceptionHandling>false</ExceptionHandling>')\nelseif cfg.flags.SEH then\n_p(3, '<ExceptionHandling>Async</ExceptionHandling>')\nend\nend\nend\nlocal function rtti(cfg)\nif c"
- "fg.flags.NoRTTI and not cfg.flags.Managed then\n_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')\nend\nend\nlocal function calling_convention(cfg)\nif cfg.flags.FastCall then\n_p(3,'<CallingConvention>FastCall</CallingConvention>')\nelseif cfg.flags.StdCall then\n_p(3,'<CallingConvention>StdCall</CallingConvention>')\nend\nend\nlocal function wchar_t_builtin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableSSE2 then\n_p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableAVX then\n_p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableAVX2 then"
- "\n_p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>')\nend\nend\nlocal function floating_point(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.FloatFast then\n_p(3,'<FastMath>true</FastMath>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nelse\nif cfg.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')\nelseif cfg.flags.FloatStrict and not cfg.flags.Managed then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')\nend\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif cfg.flags.C7DebugInfo then\ndebug_info = \"OldStyle\"\nelseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \"x64\")\nor not premake.config.iseditandcontinue(cfg)\nthen\ndebug_info = \"ProgramDatabase\"\nelse\ndebug_info = \"EditAndContinue\"\nend\nend\n_p(3,'<DebugInformationFormat>%s</DebugInformationFormat>',debug_info)\nend\nlocal function minimal_build(cfg)\nif premake.config.isdebugbuild("
- "cfg) and cfg.flags.EnableMinimalRebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')\nelse\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')\nend\nend\nlocal function compile_language(cfg)\nif cfg.options.ForceCPP then\n_p(3,'<CompileAs>CompileAsCpp</CompileAs>')\nelse\nif cfg.language == \"C\" then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')\nend\nend\nend\nlocal function forcedinclude_files(indent,cfg)\nif #cfg.forcedincludes > 0 then\n_p(indent,'<ForcedIncludeFiles>%s</ForcedIncludeFiles>'\n,premake.esc(path.translate(table.concat(cfg.forcedincludes, \";\"), '\\\\')))\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'<ClCompile>')\nlocal unsignedChar = \"/J \"\nlocal buildoptions = cfg.buildoptions\nif cfg.platform == \"Orbis\" then\nunsignedChar = \"-funsigned-char \";\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.language == \"C\" and not cfg.options.ForceCPP then\nbuildoptions = table.join(buildoptions, cfg.buildoptions_c)\nelse\n"
- "buildoptions = table.join(buildoptions, cfg.buildoptions_cpp)\nend\n_p(3,'<AdditionalOptions>%s %s%%(AdditionalOptions)</AdditionalOptions>'\n, table.concat(premake.esc(buildoptions), \" \")\n, iif(cfg.flags.UnsignedChar and cfg.platform ~= \"TegraAndroid\", unsignedChar, \" \")\n)\nif cfg.platform == \"TegraAndroid\" then\n_p(3,'<SignedChar>%s</SignedChar>', tostring(cfg.flags.UnsignedChar == nil))\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nif cfg.androidcppstandard then\n_p(3,'<CppLanguageStandard>%s</CppLanguageStandard>', cfg.androidcppstandard)\nend\nend\nif cfg.platform == \"Orbis\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'<OptimizationLevel>Level0</OptimizationLevel>')\nelseif opt == \"MinSpace\" then\n_p(3,'<OptimizationLevel>Levelz</OptimizationLevel>') -- Oz is more aggressive than Os\nelseif opt == \"MaxSpeed\" then\n_p(3,'<OptimizationLevel>Level3</OptimizationLevel>')\nelse\n_p(3,'<OptimizationLevel>Level2</O"
- "ptimizationLevel>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'<OptimizationLevel>O0</OptimizationLevel>')\nelseif opt == \"MinSpace\" then\n_p(3,'<OptimizationLevel>Os</OptimizationLevel>')\nelseif opt == \"MaxSpeed\" then\n_p(3,'<OptimizationLevel>O3</OptimizationLevel>')\nelse\n_p(3,'<OptimizationLevel>O2</OptimizationLevel>')\nend\nelse\n_p(3,'<Optimization>%s</Optimization>', optimisation(cfg))\nend\ninclude_dirs(3, cfg)\nusing_dirs(3, cfg)\npreprocessor(3, cfg)\nminimal_build(cfg)\nif premake.config.isoptimizedbuild(cfg.flags) then\nif cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then\n_p(3, '<StringPooling>false</StringPooling>')\n_p(3, '<FunctionLevelLinking>false</FunctionLevelLinking>')\nelse\n_p(3, '<StringPooling>true</StringPooling>')\n_p(3, '<FunctionLevelLinking>true</FunctionLevelLinking>')\nend\nelse\n_p(3, '<FunctionLevelLinking>true</FunctionLevelLinking>')\nif cfg.flags.NoRuntimeChecks then\n_p(3, '<Basic"
- "RuntimeChecks>Default</BasicRuntimeChecks>')\nelseif not cfg.flags.Managed then\n_p(3, '<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')\nend\nif cfg.flags.ExtraWarnings then\nend\nend\nif cfg.platform == \"Durango\" or cfg.flags.NoWinRT then\n_p(3, '<CompileAsWinRT>false</CompileAsWinRT>')\nend\n_p(3, '<RuntimeLibrary>%s</RuntimeLibrary>', runtime(cfg))\nif cfg.flags.NoBufferSecurityCheck then\n_p(3, '<BufferSecurityCheck>false</BufferSecurityCheck>')\nend\nif not cfg.flags.NoMultiProcessorCompilation and not cfg.flags.EnableMinimalRebuild then\n_p(3, '<MultiProcessorCompilation>true</MultiProcessorCompilation>')\nelse\n_p(3, '<MultiProcessorCompilation>false</MultiProcessorCompilation>')\nend\nprecompiled_header(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.PedanticWarnings then\n_p(3, '<Warnings>MoreWarnings</Warnings>')\n_p(3, '<ExtraWarnings>true</ExtraWarnings>')\nelseif cfg.flags.ExtraWarnings then\n_p(3, '<Warnings>NormalWarnings</Warnings>')\n_p(3, '<ExtraWarnings>true</ExtraWarning"
- "s>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<Warnings>WarningsOff</Warnings>')\n_p(3, '<ExtraWarnings>false</ExtraWarnings>')\nelse\n_p(3, '<Warnings>NormalWarnings</Warnings>')\n_p(3, '<ExtraWarnings>false</ExtraWarnings>')\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<WarningsAsErrors>true</WarningsAsErrors>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\n_p(3, '<Warnings>AllWarnings</Warnings>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<Warnings>DisableAllWarnings</Warnings>')\nelse\n_p(3, '<Warnings>NormalWarnings</Warnings>')\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<WarningsAsErrors>true</WarningsAsErrors>')\nend\nelse\nif cfg.flags.PedanticWarnings then\n_p(3, '<WarningLevel>EnableAllWarnings</WarningLevel>')\nelseif cfg.flags.ExtraWarnings then\n_p(3, '<WarningLevel>Level4</WarningLevel>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<WarningLevel>Level1</WarningLevel>')\nelse\n_p(3 ,'<WarningLevel>Level3</Warnin"
- "gLevel>')\nend\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<TreatWarningAsError>true</TreatWarningAsError>')\nend\nif premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\") then\ncppstandard_vs2017_or_2019(cfg)\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif _ACTION:sub(3) == \"llvm\" then\n_p(3,'<SupportJustMyCode>false</SupportJustMyCode>')\nend\nif cfg.flags.Symbols then\nif cfg.kind == \"StaticLib\" then\n_p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'\n, path.getbasename(cfg.buildtarget.name)\n)\nelse\n_p(3, '<ProgramDataBaseFileName>$(IntDir)%s.compile.pdb</ProgramDataBaseFileName>'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, '<CreateHotpatchableImage>true</CreateHotpatchableImage>')\nend\nif cfg.flags.NoFramePointer then\n_p(3, '<OmitFramePointers>true</OmitFramePointers>')"
- "\nend\nif cfg.flags.UseFullPaths then\n_p(3, '<UseFullPaths>true</UseFullPaths>')\nend\nif cfg.flags.NoJMC then\n_p(3,'<SupportJustMyCode>false</SupportJustMyCode>' )\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\nif vstudio.diagformat then\n_p(3, '<DiagnosticsFormat>%s</DiagnosticsFormat>', vstudio.diagformat)\nelse\n_p(3, '<DiagnosticsFormat>Caret</DiagnosticsFormat>')\nend\n_p(2,'</ClCompile>')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'<PostBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PostBuildEvent>')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'<PreBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreBuildEvent>')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'<PreLinkEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</Pr"
- "eLinkEvent>')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'<TargetMachine>%s</TargetMachine>', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(prj, cfg)\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'<Lib>')\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\nif _ACTION:sub(3) == \"llvm\" and prj.name == \"portaudio\" then -- MSVC-LLVM needs special help\n_p(2,'<AdditionalDependencies>ksuser.lib;%%(AdditionalDependencies)</AdditionalDependencies>')\nend\n_p(1,'</Lib>')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linkt"
- "arget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function hasmasmfiles(prj)\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nreturn #files > 0\nend\nlocal function ismanagedprj(prj, cfgname, pltname)\nlocal cfg = premake.getconfig(prj, cfgname, pltname)\nreturn cfg.flags.Managed == true\nend\nlocal function getcfglinks(cfg)\nlocal haswholearchive = #cfg.wholearchive > 0\nlocal msvcnaming = premake.getnamestyle(cfg) == \"windows\"\nlocal iscppprj = premake.iscppproject(cfg)\nlocal isnetprj = premake.isdotnetproject(cfg)\nlocal linkobjs = {}\nlocal links = iif(haswholearchive\n, premake.getlinks(cfg, \"all\", \"object\")\n, premake.getlinks(cfg, \"system\", \"fullpath\")\n)\nfor _, link in ipairs(links) do\nlocal name = nil\nlocal directory = nil\nlocal whole = nil\nif type(link) == \"table\" then\nif not ismanagedprj(link.project, cfg.name, cfg.platform) then\n"
- "name = link.linktarget.basename\ndirectory = path.rebase(link.linktarget.directory, link.location, cfg.location)\nwhole = table.icontains(cfg.wholearchive, link.project.name)\nend\nelse\nname = link\nwhole = table.icontains(cfg.wholearchive, link)\nend\nif name then\nif haswholearchive and msvcnaming then\nif iscppprj then\nname = name .. \".lib\"\nelseif isnetprj then\nname = name .. \".dll\"\nend\nend\ntable.insert(linkobjs, {name=name, directory=directory, wholearchive=whole})\nend\nend\nreturn linkobjs\nend\nlocal function vs10_masm(prj, cfg)\nif hasmasmfiles(prj) then\n_p(2, '<MASM>')\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>'\n, table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \")\n)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs > 0 then\n_p(3, '<IncludePaths>%s;%%(IncludePaths)</IncludePaths>'\n, premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\'"
- "))\n)\nend\nlocal defines = table.join(cfg.defines)\ntable.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \"_DEBUG\", {}))\ntable.insert(defines, iif(cfg.platform == \"x64\", \"_WIN64\", \"_WIN32\"))\ntable.insert(defines, iif(prj.kind == \"SharedLib\", \"_EXPORT=EXPORT\", \"_EXPORT=\"))\n_p(3, '<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n, premake.esc(table.concat(defines, \";\"))\n)\nif cfg.flags.FatalWarnings then\n_p(3,'<TreatWarningsAsErrors>true</TreatWarningsAsErrors>')\nend\nif cfg.flags.MinimumWarnings then\n_p(3,'<WarningLevel>0</WarningLevel>')\nelse\n_p(3,'<WarningLevel>3</WarningLevel>')\nend\n_p(2, '</MASM>')\nend\nend\nlocal function additional_manifest(cfg)\nif(cfg.dpiawareness ~= nil) then\n_p(2,'<Manifest>')\nif(cfg.dpiawareness == \"None\") then\n_p(3, '<EnableDpiAwareness>false</EnableDpiAwareness>')\nend\nif(cfg.dpiawareness == \"High\") then\n_p(3, '<EnableDpiAwareness>true</EnableDpiAwareness>')\nend\nif(cfg.dpiawareness == \"HighPerMoni"
- "tor\") then\n_p(3, '<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>')\nend\n_p(2,'</Manifest>')\nend\nend\nfunction vc2010.link(cfg)\nlocal vs2017OrLater = premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\")\nlocal vsllvm = premake.action.current() == premake.action.get(\"vsllvm\")\nlocal links = getcfglinks(cfg)\n_p(2,'<Link>')\n_p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\nif (vs2017OrLater or vsllvm) and cfg.flags.FullSymbols then\n_p(3,'<GenerateDebugInformation>DebugFull</GenerateDebugInformation>')\nelse\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.flags.Symbols then\n_p(3, '<ProgramDatabaseFile>$(OutDir)%s.pdb</ProgramDatabaseFile>'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nif premake.config.islinkeroptimizedbuild(cfg.flags) then\nif cfg.platform == \"Orbis\" then\n_p(3,'<DataStripping>Stri"
- "pFuncsAndData</DataStripping>')\n_p(3,'<DuplicateStripping>true</DuplicateStripping>')\nelse\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')\n_p(3,'<OptimizeReferences>true</OptimizeReferences>')\nend\nelseif cfg.platform == \"Orbis\" and premake.config.iseditandcontinue(cfg) then\n_p(3,'<EditAndContinue>true</EditAndContinue>')\nend\nif cfg.finalizemetasource ~= nil then\n_p(3,'<FinalizeMetaSource>%s</FinalizeMetaSource>', premake.esc(cfg.finalizemetasource))\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(3, cfg, links)\nvc2010.additionalLibraryDirectories(3, cfg, links)\n_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>')\nelse\n_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile t"
- "hen\n_p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>', deffile)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nif cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n_p(3,'<GenerateWindowsMetadata>false</GenerateWindowsMetadata>' )\nend\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidlinker then\n_p(3,'<UseLinker>%s</UseLinker>',cfg.androidlinker)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, '<CreateHotPatchableImage>Enabled</CreateHotPatchableImage>')\nend\nif cfg.flags.GenerateMapFiles then\n_p(3, '<GenerateMapFile>true</GenerateMapFile>')\nend\n_p(2,'</Link>')\nif #cfg.wholearchive > 0 then\n_p(2, '<ProjectReference>')\n_p(3, '<LinkLibraryDependencies>false</LinkLibraryDependencies>')\n_p(2, '</ProjectReference>')\nend\nend\nfunction vc2010.additionalLibraryDirectories(tab, cfg, links)\nlocal dirs = cfg.libdirs\nfor _, link in ipairs(links) do\nif link.directory and not table.icontains(dirs, link.directory) then\ntable.insert(dirs, link.directo"
- "ry)\nend\nend\n_p(tab, '<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>'\n, premake.esc(path.translate(table.concat(dirs, ';'), '\\\\'))\n)\nend\nfunction vc2010.additionalDependencies(tab, cfg, links)\nif #links > 0 then\nlocal deps = \"\"\nif cfg.platform == \"Orbis\" then\nlocal iswhole = false\nfor _, link in ipairs(links) do\nif link.wholearchive and not iswhole then\ndeps = deps .. \"--whole-archive;\"\niswhole = true\nelseif not link.wholearchive and iswhole then\ndeps = deps .. \"--no-whole-archive;\"\niswhole = false\nend\ndeps = deps .. \"-l\" .. link.name .. \";\"\nend\nelse\nfor _, link in ipairs(links) do\nif link.wholearchive then\ndeps = deps .. \"/WHOLEARCHIVE:\" .. link.name .. \";\"\nelse\ndeps = deps .. link.name .. \";\"\nend\nend\nend\nif cfg.platform == \"TegraAndroid\" then\ndeps = \"-Wl,--start-group;\" .. deps .. \";-Wl,--end-group\"\nend\n_p(tab, '<AdditionalDependencies>%s;%s</AdditionalDependencies>'\n, deps\n, iif(cfg.platform == \"D"
- "urango\"\n, '%(XboxExtensionsDependencies)'\n, '%(AdditionalDependencies)'\n)\n)\nelseif cfg.platform == \"Durango\" then\n_p(tab, '<AdditionalDependencies>%%(XboxExtensionsDependencies)</AdditionalDependencies>')\nend\nend\nfunction ant_build(prj, cfg)\nif cfg.platform == \"TegraAndroid\" then\nlocal files = vc2010.getfilegroup(prj, \"AndroidBuild\")\n_p(2,'<AntBuild>')\nif #files > 0 then\n_p(3,'<AndroidManifestLocation>%s</AndroidManifestLocation>',path.translate(files[1].name))\nend\nlocal isdebugbuild = premake.config.isdebugbuild(cfg)\n_p(3,'<AntBuildType>%s</AntBuildType>',iif(isdebugbuild, 'Debug','Release'))\n_p(3,'<Debuggable>%s</Debuggable>',tostring(cfg.flags.AntBuildDebuggable ~= nil))\nif #cfg.antbuildjavasourcedirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjavasourcedirs,\";\")\n_p(3,'<JavaSourceDir>%s</JavaSourceDir>',dirs)\nend\nif #cfg.antbuildjardirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjardirs,\";\")\n_p(3,'<JarDirectories>%s</JarDirectories>',dirs)\nend\nif #cfg.antbuildja"
- "rdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildjardependencies,\";\")\n_p(3,'<JarDependencies>%s</JarDependencies>',dirs)\nend\nif #cfg.antbuildnativelibdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdirs,\";\")\n_p(3,'<NativeLibDirectories>%s</NativeLibDirectories>',dirs)\nend\nif #cfg.antbuildnativelibdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdependencies,\";\")\n_p(3,'<NativeLibDependencies>%s</NativeLibDependencies>',dirs)\nend\nif #cfg.antbuildassetsdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildassetsdirs,\";\")\n_p(3,'<AssetsDirectories>%s</AssetsDirectories>',dirs)\nend\n_p(2,'</AntBuild>')\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(prj, cfg)\nvc2010."
- "link(cfg)\nant_build(prj, cfg)\nevent_hooks(cfg)\nvs10_masm(prj, cfg)\nadditional_manifest(cfg)\n_p(1,'</ItemDefinitionGroup>')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nMASM = {},\nObject = {},\nNone = {},\nResourceCompile = {},\nAppxManifest = {},\nAndroidBuild = {},\nNatvis = {},\nImage = {},\nDeploymentContent = {}\n}\nlocal foundAppxManifest = false\nfor file in premake.project.eachfile(prj, true) do\nif path.issourcefilevs(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not table.icontains(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isobjectfile(file.name) then\ntable.insert(sortedfiles.Object, file)\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelseif path.isimagefile(file.name) then\ntable.insert(sortedfiles.Image, file)\nelseif"
- " path.isappxmanifest(file.name) then\nfoundAppxManifest = true\ntable.insert(sortedfiles.AppxManifest, file)\nelseif path.isandroidbuildfile(file.name) then\ntable.insert(sortedfiles.AndroidBuild, file)\nelseif path.isnatvis(file.name) then\ntable.insert(sortedfiles.Natvis, file)\nelseif path.isasmfile(file.name) then\ntable.insert(sortedfiles.MASM, file)\nelseif file.flags and table.icontains(file.flags, \"DeploymentContent\") then\ntable.insert(sortedfiles.DeploymentContent, file)\nelse\ntable.insert(sortedfiles.None, file)\nend\nend\nif vstudio.iswinrt() and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \"/Package.appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nlocal logo = {}\nlogo.name = prj.name .. \"/Logo.png\"\nlogo.vpath = logo.name\ntable.insert(sortedfiles.Image, logo)\nlocal smallLogo = {}\nsmallLogo.name = prj.name .. \"/SmallLogo.png\"\nsma"
- "llLogo.vpath = smallLogo.name\ntable.insert(sortedfiles.Image, smallLogo)\nlocal storeLogo = {}\nstoreLogo.name = prj.name .. \"/StoreLogo.png\"\nstoreLogo.vpath = storeLogo.name\ntable.insert(sortedfiles.Image, storeLogo)\nlocal splashScreen = {}\nsplashScreen.name = prj.name .. \"/SplashScreen.png\"\nsplashScreen.vpath = splashScreen.name\ntable.insert(sortedfiles.Image, splashScreen)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"Object\")\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.customtaskgroup(prj)\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\nvc2010.simplefilesgroup(prj, \"AppxManifest\")\nvc2010.simplefilesgroup(prj, \"AndroidBuild\")\nvc2010.simplefilesgroup(prj, \"Natvis\")\nvc2010.deploymentcontentgroup(prj, \"Image\")\nvc2010.deploymentcontentgroup(prj, \"DeploymentContent\", \"None\")\nend\nfunction vc2010.customtaskg"
- "roup(prj)\nlocal files = { }\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal fcfg = { }\nfcfg.name = path.getrelative(prj.location,buildtask[1])\nfcfg.vpath = path.trimdots(fcfg.name)\ntable.insert(files, fcfg)\nend\nend\nif #files > 0 then\n_p(1,'<ItemGroup>')\nlocal groupedBuildTasks = {}\nlocal buildTaskNames = {}\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nif (groupedBuildTasks[buildtask[1]] == nil) then\ngroupedBuildTasks[buildtask[1]] = {}\ntable.insert(buildTaskNames, buildtask[1])\nend\ntable.insert(groupedBuildTasks[buildtask[1]], buildtask)\nend\nend\nfor _, name in ipairs(buildTaskNames) do\ncustombuildtask = groupedBuildTasks[name]\n_p(2,'<CustomBuild Include=\\\"%s\\\">', path.translate(path.getrelative(prj.location,name), \"\\\\\"))\n_p(3,'<FileType>Text</FileType>')\nlocal cmd = \"\"\nlocal outputs = \"\"\nfor _, buildtask in ipairs(custombuildt"
- "ask or {}) do\nfor _, cmdline in ipairs(buildtask[4] or {}) do\ncmd = cmd .. cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[1])))\ncmd = string.gsub(cmd, \"%$%(@%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[2])))\ncmd = cmd .. \"\\r\\n\"\nend\noutputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \";\"\nend\n_p(3,'<Command>%s</Command>',cmd)\n_p(3,'<Outputs>%s%%(Outputs)</Outputs>',outputs)\n_p(3,'<SubType>Designer</SubType>')\n_p(3,'<Message></Message>')\n_p(2,'</CustomBuild>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfg"
- "info in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal prjexcluded = table.icontains(prj.excludes, file.name)\nlocal excludedcfgs = {}\nif not prjexcluded then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif not fileincfg or cfgexcluded then\ntable.insert(excludedcfgs, vsconfig.name)\nend\nend\nend\nif subtype or prjexcluded or #excludedcfgs > 0 then\n_p(2, '<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\nif prjexcluded then\n_p(3, '<ExcludedFromBuild>true</ExcludedFromBuild>')\nelse\nfor _, cfgname in ipairs(excludedcfgs) do\n_p(3, '<Exclude"
- "dFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(cfgname)\n)\nend\nend\nif subtype then\n_p(3, '<SubType>%s</SubType>', subtype)\nend\n_p(2,'</%s>', section)\nelse\n_p(2, '<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.deploymentcontentgroup(prj, section, filetype)\nif filetype == nil then\nfiletype = section\nend\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\">', filetype, path.translate(file.name, \"\\\\\"))\n_p(3,'<DeploymentContent>true</DeploymentContent>')\n_p(3,'<Link>%s</Link>', path.translate(file.vpath, \"\\\\\"))\n_p(2,'</%s>', filetype)\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cf"
- "ginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nlocal existingBasenames = {};\nfor _, file in ipairs(files) do\nlocal filename = string.lower(path.getbasename(file.name))\nlocal disambiguation = existingBasenames[filename] or 0;\nexistingBasenames[filename] = disambiguation + 1\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<ClCompile Include=\\\"%s\\\">', translatedpath)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal namestyle = premake.getnamestyle(cfg)\nif namestyle == \"TegraAndroid\" or namestyle == \"NX\" then\n_p(3, '<ObjectFileName '.. if_config_and_platform() .. '>$(IntDir)%s.o</ObjectFileName>', premake.esc(vsconfig.name), premake.esc(path.translate(path.trimdots(path.removeext(f"
- "ile.name)))) )\nelse\nif disambiguation > 0 then\n_p(3, '<ObjectFileName '.. if_config_and_platform() .. '>$(IntDir)%s\\\\</ObjectFileName>', premake.esc(vsconfig.name), tostring(disambiguation))\nend\nend\nend\nif path.iscxfile(file.name) then\n_p(3, '<CompileAsWinRT>true</CompileAsWinRT>')\n_p(3, '<RuntimeTypeInfo>true</RuntimeTypeInfo>')\n_p(3, '<PrecompiledHeader>NotUsing</PrecompiledHeader>')\nend\nif vstudio.iswinrt() and string.len(file.name) > 2 and string.sub(file.name, -2) == \".c\" then\n_p(3,'<CompileAsWinRT>FALSE</CompileAsWinRT>')\nend\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nlocal nopch = table.icontains(prj.nopch, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig."
- "src_platform)\nif nopch or table.icontains(cfg.nopch, file.name) then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>NotUsing</PrecompiledHeader>', premake.esc(vsconfig.name))\nend\nend\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal prjforcenative = table.icontains(prj.forcenative, file.name)\nfor _,vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif prjforcenative or table.icontains(cfg.forcenative, file.name) then\n_p(3, '<CompileAsManaged ' .. if_config_and"
- "_platform() .. '>false</CompileAsManaged>', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.masmfiles(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nif #files > 0 then\n_p(1, '<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<MASM Include=\"%s\">', translatedpath)\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\n_p(2, '</MASM>')\nend\n_p(1, '</ItemGroup>')\nend\nend\nfunction vc2010.header(target"
- "s)\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('<Project%s ToolsVersion=\"%s\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">', t, action.vstudio.toolsVersion)\nend\nfunction premake.vs2010_vcxproj(prj)\nlocal usemasm = hasmasmfiles(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettings\">')\nif usemasm then\n_p(2, '<Import Project=\"$(VCTargetsPath)\\\\BuildCustomizations\\\\masm.props\" />')\nend\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup "
- "Label=\"UserMacros\" />')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.clrReferences(prj)\nvc2010.projectReferences(prj)\nvc2010.sdkReferences(prj)\nvc2010.masmfiles(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\nif usemasm then\n_p(2, '<Import Project=\"$(VCTargetsPath)\\\\BuildCustomizations\\\\masm.targets\" />')\nend\n_p(1,'</ImportGroup>')\n_p('</Project>')\nend\nfunction vc2010.clrReferences(prj)\nif #prj.clrreferences == 0 then\nreturn\nend\n_p(1,'<ItemGroup>')\nfor _, ref in ipairs(prj.clrreferences) do\nif os.isfile(ref) then\nlocal assembly = path.getbasename(ref)\n_p(2,'<Reference Include=\"%s\">', assembly)\n_p(3,'<HintPath>%s</HintPath>', path.getrelative(prj.location, ref))\n_p(2,'</Reference>')\nelse\n_p(2,'<Reference Include=\"%s\" />', ref)\nend\nend\n_p(1,'</ItemGroup>')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps == 0 and "
- "#prj.vsimportreferences == 0 then\nreturn\nend\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\ntable.sort(table.join(prj.vsimportreferences), compareuuid)\n_p(1,'<ItemGroup>')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'<ProjectReference Include=\\\"%s\\\">', path.translate(deppath, \"\\\\\"))\n_p(3,'<Project>{%s}</Project>', dep.uuid)\nif vstudio.iswinrt() then\n_p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>')\nend\n_p(2,'</ProjectReference>')\nend\nfor _, ref in ipairs(prj.vsimportreferences) do\nlocal slnrelpath = path.rebase(ref, prj.location, sln.location)\nlocal iprj = premake.vstudio.getimportprj(slnrelpath, prj.solution)\n_p(2,'<ProjectReference Include=\\\"%s\\\">', ref)\n_p(3,'<Project>{%s}</Project>', iprj.uuid)\n_p(2,'</ProjectReference>')\nend\n_p(1,'</ItemGroup>')\nend\nfunction vc2010.sdkReferences(prj)\nlocal refs = prj.sdkreferences\nif #refs > 0 then\n_p(1,'<ItemGro"
- "up>')\nfor _, ref in ipairs(refs) do\n_p(2,'<SDKReference Include=\\\"%s\\\" />', ref)\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.debugdir(cfg)\nlocal isnx = (cfg.platform == \"NX32\" or cfg.platform == \"NX64\")\nlocal debuggerFlavor =\n iif(isnx, 'OasisNXDebugger'\n, iif(cfg.platform == \"Orbis\", 'ORBISDebugger'\n, iif(cfg.platform == \"Durango\", 'XboxOneVCppDebugger'\n, iif(cfg.platform == \"TegraAndroid\", 'AndroidDebugger'\n, iif(vstudio.iswinrt(), 'AppHostLocalDebugger'\n, 'WindowsLocalDebugger'\n)))))\n_p(2, '<DebuggerFlavor>%s</DebuggerFlavor>', debuggerFlavor)\nif cfg.debugdir and not vstudio.iswinrt() then\n_p(2, '<LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>'\n, path.translate(cfg.debugdir, '\\\\')\n)\nend\nif cfg.debugcmd then\n_p(2, '<LocalDebuggerCommand>%s</LocalDebuggerCommand>', cfg.debugcmd)\nend\nif cfg.debugargs then\n_p(2, '<LocalDebuggerCommandArguments>%s</LocalDebugge"
- "rCommandArguments>'\n, table.concat(cfg.debugargs, \" \")\n)\nend\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2, '<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>'\n, table.concat(cfg.debugenvs, \"\\n\")\n, iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)', '')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2, '<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')\nend\nend\nif cfg.deploymode then\n_p(2, '<DeployMode>%s</DeployMode>', cfg.deploymode)\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androiddebugintentparams then\n_p(2, '<IntentParams>%s</IntentParams>'\n, table.concat(cfg.androiddebugintentparams, \" \")\n)\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' <PropertyGroup '.. if_config_and_platform() ..'>', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\n_p"
- "(' </PropertyGroup>')\nend\n_p('</Project>')\nend\nlocal png1x1data = {\n0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR\n0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V\n0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- .....PLTE....z=.\n0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f...\n0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`.......\n0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`.\n}\nfunction png1x1(obj, filename)\nfilename = premake.project.getfilename(obj, filename)\nlocal f, err = io.open(filename, \"wb\")\nif f then\nfor _, byte in ipairs(png1x1data) do\nf:write(string.char(byte))\nend\nf:close()\nend\nend\nfunction premak"
- "e.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nif vstudio.storeapp == \"10.0\" then\n_p('<Package')\n_p(1, 'xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"')\n_p(1, 'xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\"')\n_p(1, 'xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"')\n_p(1, 'IgnorableNamespaces=\"uap mp\">')\nelseif vstudio.storeapp == \"durango\" then\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:mx=\"http://schemas.microsoft.com/appx/2013/xbox/manifest\" IgnorableNamespaces=\"mx\">')\nend\n_p(1, '<Identity')\n_p(2, 'Name=\"' .. prj.uuid .. '\"')\n_p(2, 'Publisher=\"CN=Publisher\"')\n_p(2, 'Version=\"1.0.0.0\" />')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '<mp:PhoneIdentity')\n_p(2, 'PhoneProductId=\"' .. prj.uuid .. '\"')\n_p(2, 'PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>')\nend\n_p(1, '<Properties>')\n_p(2, '<Di"
- "splayName>' .. prj.name .. '</DisplayName>')\n_p(2, '<PublisherDisplayName>PublisherDisplayName</PublisherDisplayName>')\n_p(2, '<Logo>' .. prj.name .. '\\\\StoreLogo.png</Logo>')\npng1x1(prj, \"%%/StoreLogo.png\")\n_p(2, '<Description>' .. prj.name .. '</Description>')\n_p(1,'</Properties>')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '<Dependencies>')\n_p(2, '<TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.10069.0\" MaxVersionTested=\"10.0.10069.0\" />')\n_p(1, '</Dependencies>')\nelseif vstudio.storeapp == \"durango\" then\n_p(1, '<Prerequisites>')\n_p(2, '<OSMinVersion>6.2</OSMinVersion>')\n_p(2, '<OSMaxVersionTested>6.2</OSMaxVersionTested>')\n_p(1, '</Prerequisites>')\nend\n_p(1, '<Resources>')\n_p(2, '<Resource Language=\"en-us\"/>')\n_p(1, '</Resources>')\n_p(1, '<Applications>')\n_p(2, '<Application Id=\"App\"')\n_p(3, 'Executable=\"$targetnametoken$.exe\"')\n_p(3, 'EntryPoint=\"' .. prj.name .. '.App\">')\nif vstudio.storeapp == \"10.0\" then\n_p(3, '<uap:VisualElements')\n_p(4, 'Di"
- "splayName=\"' .. prj.name .. '\"')\n_p(4, 'Square150x150Logo=\"' .. prj.name .. '\\\\Logo.png\"')\npng1x1(prj, \"%%/Logo.png\")\nif vstudio.storeapp == \"10.0\" then\n_p(4, 'Square44x44Logo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\nelse\n_p(4, 'Square30x30Logo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\nend\n_p(4, 'Description=\"' .. prj.name .. '\"')\n_p(4, 'BackgroundColor=\"transparent\">')\n_p(4, '<uap:SplashScreen Image=\"' .. prj.name .. '\\\\SplashScreen.png\" />')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '</uap:VisualElements>')\nelseif vstudio.storeapp == \"durango\" then\n_p(3, '<VisualElements')\n_p(4, 'DisplayName=\"' .. prj.name .. '\"')\n_p(4, 'Logo=\"' .. prj.name .. '\\\\Logo.png\"')\npng1x1(prj, \"%%/Logo.png\")\n_p(4, 'SmallLogo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\n_p(4, 'Description=\"' .. prj.name .. '\"')\n_p(4, 'ForegroundText=\"light\"')\n_p(4, 'BackgroundColor=\"transparent"
- "\">')\n_p(5, '<SplashScreen Image=\"' .. prj.name .. '\\\\SplashScreen.png\" />')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '</VisualElements>')\n_p(3, '<Extensions>')\n_p(4, '<mx:Extension Category=\"xbox.system.resources\">')\n_p(4, '<mx:XboxSystemResources />')\n_p(4, '</mx:Extension>')\n_p(3, '</Extensions>')\nend\n_p(2, '</Application>')\n_p(1, '</Applications>')\n_p('</Package>')\nend\n",
+ "nimumVisualStudioVersion>')\n_p(2, '<TargetRuntime>Native</TargetRuntime>')\nelse\n_p(2, '<AppContainerApplication>true</AppContainerApplication>')\n_p(2, '<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>')\n_p(2, '<ApplicationType>Windows Store</ApplicationType>')\n_p(2, '<ApplicationTypeRevision>%s</ApplicationTypeRevision>', vstudio.storeapp)\nend\nelse\n_p(2, '<Keyword>Win32Proj</Keyword>')\nend\nif not vstudio.xpwarning then\n_p(2, '<XPDeprecationWarning>false</XPDeprecationWarning>')\nend\n_p(1,'</PropertyGroup>')\nend\nfunction vc2010.config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nels"
+ "eif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nfunction vc2010.configurationPropertyGroup(cfg, cfginfo)\n_p(1, '<PropertyGroup '..if_config_and_platform() ..' Label=\"Configuration\">'\n, premake.esc(cfginfo.name))\nlocal is2019 = premake.action.current() == premake.action.get(\"vs2019\")\nlocal is2022 = premake.action.current() == premake.action.get(\"vs2022\")\nif is2019 or is2022 then\n _p(2, '<VCProjectVersion>%s</VCProjectVersion>', action.vstudio.toolsVersion)\nif cfg.flags.UnitySupport then\n _p(2, '<EnableUnitySupport>true</EnableUnitySupport>')\nend\nend\n_p(2, '<ConfigurationType>%s</ConfigurationType>', vc2010.config_type(cfg))\n_p(2, '<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\n_p(2, '<PlatformToolset>%s</PlatformToolset>', premake.vstudio.toolset)\nif os.is64bit() then\n_p(2, '<PreferredToolArchitecture>x64</PreferredTool"
+ "Architecture>')\nend\nif cfg.flags.Unicode then\n_p(2,'<CharacterSet>Unicode</CharacterSet>')\nend\nif cfg.flags.Managed then\n_p(2,'<CLRSupport>true</CLRSupport>')\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidtargetapi then\n_p(2,'<AndroidTargetAPI>android-%s</AndroidTargetAPI>', cfg.androidtargetapi)\nend\nif cfg.androidminapi then\n_p(2,'<AndroidMinAPI>android-%s</AndroidMinAPI>', cfg.androidminapi)\nend\nif cfg.androidarch then\n_p(2,'<AndroidArch>%s</AndroidArch>', cfg.androidarch)\nend\nif cfg.androidndktoolchainversion then\n_p(2,'<NdkToolchainVersion>%s</NdkToolchainVersion>', cfg.androidndktoolchainversion)\nend\nif cfg.androidstltype then\n_p(2,'<AndroidStlType>%s</AndroidStlType>', cfg.androidstltype)\nend\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\n_p(2,'<NintendoSdkRoot>$(NINTENDO_SDK_ROOT)\\\\</NintendoSdkRoot>')\n_p(2,'<NintendoSdkSpec>NX</NintendoSdkSpec>')\nif premake.config.isdebugbuild(cfg) then\n_p(2,'<NintendoSdkBuildType>Debug</NintendoSdkBuildType"
+ ">')\nelse\n_p(2,'<NintendoSdkBuildType>Release</NintendoSdkBuildType>')\nend\nend\nif cfg.flags.Symbols and (premake.action.current() == premake.action.get(\"vs2017\") or is2019) then\n_p(2, '<DebugSymbols>true</DebugSymbols>')\nend\n_p(1,'</PropertyGroup>')\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ImportGroup '..if_config_and_platform() ..' Label=\"PropertySheets\">'\n,premake.esc(cfginfo.name))\n_p(2,'<Import Project=\"$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists(\\'$(UserRootDir)\\\\Microsoft.Cpp.$(Platform).user.props\\')\" Label=\"LocalAppDataPlatform\" />')\nif #cfg.propertysheets > 0 then\nlocal dirs = cfg.propertysheets\nfor _, dir in ipairs(dirs) do\nlocal translated = path.translate(dir)\n_p(2,'<Import Project=\"%s\" Condition=\"exists(\\'%s\\')\" />', translated, translated)\nend\nend\n_p(1,'</ImportGroup>')\nend\nend\nlocal f"
+ "unction add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nfunction vc2010.outputProperties(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nlocal target = cfg.buildtarget\nlocal outdir = add_trailing_backslash(target.directory)\nlocal intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute\n, path.translate(\n path.join(prj.solution.location, cfg.objectsdir)\n, '\\\\')\n, cfg.objectsdir\n))\n_p(1,'<PropertyGroup '..if_config_and_platform() ..'>', premake.esc(cfginfo.name))\n_p(2,'<OutDir>%s</OutDir>', iif(outdir:len() > 0, premake.esc(outdir), \".\\\\\"))\nif cfg.platform == \"Xbox360\" then\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>', premake.esc(target.name))\nend\n_p(2,'<IntDir>%s</IntDir>', premake.esc(intdir))\n_p(2,'<TargetName>%s</TargetName>', premake.esc(path.getbasename(target.name)))\n_p(2,'<TargetExt>%s</TargetExt>', pr"
+ "emake.esc(path.getextension(target.name)))\nif cfg.kind == \"SharedLib\" then\nlocal ignore = (cfg.flags.NoImportLib ~= nil)\n_p(2,'<IgnoreImportLibrary>%s</IgnoreImportLibrary>', tostring(ignore))\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.Cpp17 then\n_p(2,'<CppLanguageStandard>Gnu++17</CppLanguageStandard>')\nelseif cfg.flags.Cpp20 then\n_p(2,'<CppLanguageStandard>Gnu++20</CppLanguageStandard>')\nend\nend\nif cfg.platform == \"Durango\" then\n_p(2, '<ReferencePath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</ReferencePath>')\n_p(2, '<LibraryPath>$(Console_SdkLibPath)</LibraryPath>')\n_p(2, '<LibraryWPath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</LibraryWPath>')\n_p(2, '<IncludePath>$(Console_SdkIncludeRoot)</IncludePath>')\n_p(2, '<ExecutablePath>$(Console_SdkRoot)bin;$(VCInstallDir)bin\\\\x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7\\\\Tools\\\\bin;$(VSInstallDir)Common7\\\\tools;$(VSInstallDir)Common7"
+ "\\\\ide;$(ProgramFiles)\\\\HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);</ExecutablePath>')\nif cfg.imagepath then\n_p(2, '<LayoutDir>%s</LayoutDir>', cfg.imagepath)\nelse\n_p(2, '<LayoutDir>%s</LayoutDir>', prj.name)\nend\nif cfg.pullmappingfile ~= nil then\n_p(2,'<PullMappingFile>%s</PullMappingFile>', premake.esc(cfg.pullmappingfile))\nend\n_p(2, '<LayoutExtensionFilter>*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb</LayoutExtensionFilter>')\n_p(2, '<IsolateConfigurationsOnDeploy>true</IsolateConfigurationsOnDeploy>')\nend\nif vstudio.isgdkconsole(cfg) then\n_p(2, '<ExecutablePath>$(Console_SdkRoot)bin;$(Console_SdkToolPath);$(ExecutablePath)</ExecutablePath>')\n_p(2, '<IncludePath>$(Console_SdkIncludeRoot)</IncludePath>')\n_p(2, '<ReferencePath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</ReferencePath>')\n_p(2, '<LibraryPath>$(Console_SdkLibPath)</LibraryPath>')\n_p(2, '<LibraryWPath>$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)</LibraryWPath>')\nend\nif vst"
+ "udio.isgdkdesktop(cfg) then\n_p(2, '<IncludePath>$(Console_SdkIncludeRoot);$(IncludePath)</IncludePath>')\n_p(2, '<LibraryPath>$(Console_SdkLibPath);$(LibraryPath)</LibraryPath>')\nend\nif cfg.kind ~= \"StaticLib\" then\n_p(2,'<LinkIncremental>%s</LinkIncremental>', tostring(premake.config.isincrementallink(cfg)))\nend\nif cfg.applicationdatadir ~= nil then\n_p(2,'<ApplicationDataDir>%s</ApplicationDataDir>', premake.esc(cfg.applicationdatadir))\nend\nif cfg.flags.NoManifest then\n_p(2,'<GenerateManifest>false</GenerateManifest>')\nend\n_p(1,'</PropertyGroup>')\nend\nend\nlocal function runtime(cfg)\nlocal runtime\nlocal flags = cfg.flags\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p"
+ "(3,'<PrecompiledHeader>Use</PrecompiledHeader>')\n_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', cfg.pchheader)\nelse\n_p(3,'<PrecompiledHeader></PrecompiledHeader>')\nend\nend\nlocal function preprocessor(indent,cfg,escape)\nif #cfg.defines > 0 then\nlocal defines = table.concat(cfg.defines, \";\")\nif escape then\ndefines = defines:gsub('\"', '\\\\\"')\nend\nlocal isPreprocessorDefinitionPresent = string.find(defines, \"%%%(PreprocessorDefinitions%)\")\nif isPreprocessorDefinitionPresent then\n_p(indent,'<PreprocessorDefinitions>%s</PreprocessorDefinitions>'\n,premake.esc(defines))\nelse\n_p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n,premake.esc(defines))\nend\nelse\n_p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>')\nend\nend\nlocal function include_dirs(indent,cfg)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs> 0 then\n_p(indent,'<AdditionalIncludeDirectories>%s;%%(Addi"
+ "tionalIncludeDirectories)</AdditionalIncludeDirectories>'\n,premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\')))\nend\nend\nlocal function include_resdirs(indent,cfg)\nif #cfg.resincludedirs> 0 then\n_p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'\n,premake.esc(path.translate(table.concat(cfg.resincludedirs, \";\"), '\\\\')))\nend\nend\nlocal function using_dirs(indent,cfg)\nif #cfg.usingdirs > 0 then\n_p(indent,'<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>'\n,premake.esc(path.translate(table.concat(cfg.usingdirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compile(cfg)\n_p(2,'<ResourceCompile>')\npreprocessor(3,cfg,true)\ninclude_resdirs(3,cfg)\n_p(2,'</ResourceCompile>')\nend\nlocal function cppstandard(cfg)\nif cfg.flags.CppLatest then\n_p(3, '<LanguageStandard>stdcpplatest</LanguageStandard>')\n_p(3, '<EnableModules>true</EnableModules>')\nelseif cfg.flags.Cpp20 then\n_p(3, "
+ "'<LanguageStandard>stdcpp20</LanguageStandard>')\nelseif cfg.flags.Cpp17 then\n_p(3, '<LanguageStandard>stdcpp17</LanguageStandard>')\nelseif cfg.flags.Cpp14 then\n_p(3, '<LanguageStandard>stdcpp14</LanguageStandard>')\nend\nend\nlocal function exceptions(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.NoExceptions then\n_p(3, '<CppExceptions>false</CppExceptions>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.NoExceptions then\n_p(3, '<GccExceptionHandling>false</GccExceptionHandling>')\nend\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.NoExceptions then\n_p(3, '<CppExceptions>false</CppExceptions>')\nelse\n_p(3, '<CppExceptions>true</CppExceptions>')\nend\nelse\nif cfg.flags.NoExceptions then\n_p(3, '<ExceptionHandling>false</ExceptionHandling>')\nelseif cfg.flags.SEH then\n_p(3, '<ExceptionHandling>Async</ExceptionHandling>')\nend\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI and not cfg.flags.Managed then\n_p(3,'<RuntimeTypeInfo>false</"
+ "RuntimeTypeInfo>')\nend\nend\nlocal function calling_convention(cfg)\nif cfg.flags.FastCall then\n_p(3,'<CallingConvention>FastCall</CallingConvention>')\nelseif cfg.flags.StdCall then\n_p(3,'<CallingConvention>StdCall</CallingConvention>')\nend\nend\nlocal function wchar_t_builtin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableSSE2 then\n_p(3, '<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableAVX then\n_p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>')\nelseif cfg.flags.EnableAVX2 then\n_p(3, '<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhance"
+ "dInstructionSet>')\nend\nend\nlocal function floating_point(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.FloatFast then\n_p(3,'<FastMath>true</FastMath>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.FloatFast then\n_p(3, '<FastMath>true</FastMath>')\nend\nelse\nif cfg.flags.FloatFast then\n_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')\nelseif cfg.flags.FloatStrict and not cfg.flags.Managed then\n_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')\nend\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif cfg.flags.C7DebugInfo then\ndebug_info = \"OldStyle\"\nelseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \"x64\")\nor not premake.config.iseditandcontinue(cfg)\nthen\ndebug_info = \"ProgramDatabase\"\nelse\ndebug_info = \"EditAndContinue\"\nend\nend\n_p(3,'<DebugInformationFormat>%s</DebugInformationFormat>',debug_info)\nend\nlocal fun"
+ "ction minimal_build(cfg)\nif premake.config.isdebugbuild(cfg) and cfg.flags.EnableMinimalRebuild then\n_p(3,'<MinimalRebuild>true</MinimalRebuild>')\nelse\n_p(3,'<MinimalRebuild>false</MinimalRebuild>')\nend\nend\nlocal function compile_language(cfg)\nif cfg.options.ForceCPP then\n_p(3,'<CompileAs>CompileAsCpp</CompileAs>')\nelse\nif cfg.language == \"C\" then\n_p(3,'<CompileAs>CompileAsC</CompileAs>')\nend\nend\nend\nlocal function forcedinclude_files(indent,cfg)\nif #cfg.forcedincludes > 0 then\n_p(indent,'<ForcedIncludeFiles>%s</ForcedIncludeFiles>'\n,premake.esc(path.translate(table.concat(cfg.forcedincludes, \";\"), '\\\\')))\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'<ClCompile>')\nlocal unsignedChar = \"/J \"\nlocal buildoptions = cfg.buildoptions\nif cfg.platform == \"Orbis\" then\nunsignedChar = \"-funsigned-char \";\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nunsigned"
+ "Char = \"-funsigned-char \";\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.language == \"C\" and not cfg.options.ForceCPP then\nbuildoptions = table.join(buildoptions, cfg.buildoptions_c)\nelse\nbuildoptions = table.join(buildoptions, cfg.buildoptions_cpp)\nend\n_p(3,'<AdditionalOptions>%s %s%%(AdditionalOptions)</AdditionalOptions>'\n, table.concat(premake.esc(buildoptions), \" \")\n, iif(cfg.flags.UnsignedChar and cfg.platform ~= \"TegraAndroid\", unsignedChar, \" \")\n)\nif cfg.platform == \"TegraAndroid\" then\n_p(3,'<SignedChar>%s</SignedChar>', tostring(cfg.flags.UnsignedChar == nil))\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nif cfg.androidcppstandard then\n_p(3,'<CppLanguageStandard>%s</CppLanguageStandard>', cfg.androidcppstandard)\nend\nend\nif cfg.platform == \"Orbis\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'<OptimizationLevel>Level0</Optimiza"
+ "tionLevel>')\nelseif opt == \"MinSpace\" then\n_p(3,'<OptimizationLevel>Levelz</OptimizationLevel>') -- Oz is more aggressive than Os\nelseif opt == \"MaxSpeed\" then\n_p(3,'<OptimizationLevel>Level3</OptimizationLevel>')\nelse\n_p(3,'<OptimizationLevel>Level2</OptimizationLevel>')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'<OptimizationLevel>O0</OptimizationLevel>')\nelseif opt == \"MinSpace\" then\n_p(3,'<OptimizationLevel>Os</OptimizationLevel>')\nelseif opt == \"MaxSpeed\" then\n_p(3,'<OptimizationLevel>O3</OptimizationLevel>')\nelse\n_p(3,'<OptimizationLevel>O2</OptimizationLevel>')\nend\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'<OptimizationLevel>O0</OptimizationLevel>')\nelseif opt == \"MinSpace\" then\n_p(3,'<OptimizationLevel>Os</OptimizationLevel>')\nelseif opt == \"MaxSpeed\" then\n_p(3,'<OptimizationLevel>O3</OptimizationLevel>')\nelse"
+ "\n_p(3,'<OptimizationLevel>O2</OptimizationLevel>')\nend\nelse\n_p(3,'<Optimization>%s</Optimization>', optimisation(cfg))\nend\ninclude_dirs(3, cfg)\nusing_dirs(3, cfg)\npreprocessor(3, cfg)\nminimal_build(cfg)\nif premake.config.isoptimizedbuild(cfg.flags) then\nif cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then\n_p(3, '<StringPooling>false</StringPooling>')\n_p(3, '<FunctionLevelLinking>false</FunctionLevelLinking>')\nelse\n_p(3, '<StringPooling>true</StringPooling>')\n_p(3, '<FunctionLevelLinking>true</FunctionLevelLinking>')\nend\nelse\n_p(3, '<FunctionLevelLinking>true</FunctionLevelLinking>')\nif cfg.flags.NoRuntimeChecks then\n_p(3, '<BasicRuntimeChecks>Default</BasicRuntimeChecks>')\nelseif not cfg.flags.Managed then\n_p(3, '<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')\nend\nif cfg.flags.ExtraWarnings then\nend\nend\nif cfg.platform == \"Durango\" or cfg.flags.NoWinRT then\n_p(3, '<CompileAsWinRT>false</CompileAsWinRT>')\nend\n_p(3, '<RuntimeLibrary>%s</RuntimeLibrary>', r"
+ "untime(cfg))\nif cfg.flags.NoBufferSecurityCheck then\n_p(3, '<BufferSecurityCheck>false</BufferSecurityCheck>')\nend\nif not cfg.flags.NoMultiProcessorCompilation and not cfg.flags.EnableMinimalRebuild then\n_p(3, '<MultiProcessorCompilation>true</MultiProcessorCompilation>')\nelse\n_p(3, '<MultiProcessorCompilation>false</MultiProcessorCompilation>')\nend\nprecompiled_header(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.PedanticWarnings then\n_p(3, '<Warnings>MoreWarnings</Warnings>')\n_p(3, '<ExtraWarnings>true</ExtraWarnings>')\nelseif cfg.flags.ExtraWarnings then\n_p(3, '<Warnings>NormalWarnings</Warnings>')\n_p(3, '<ExtraWarnings>true</ExtraWarnings>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<Warnings>WarningsOff</Warnings>')\n_p(3, '<ExtraWarnings>false</ExtraWarnings>')\nelse\n_p(3, '<Warnings>NormalWarnings</Warnings>')\n_p(3, '<ExtraWarnings>false</ExtraWarnings>')\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<WarningsAsErrors>true</WarningsAsErrors>')\nend\nelseif cfg.platform == \"T"
+ "egraAndroid\" then\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\n_p(3, '<Warnings>AllWarnings</Warnings>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<Warnings>DisableAllWarnings</Warnings>')\nelse\n_p(3, '<Warnings>NormalWarnings</Warnings>')\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<WarningsAsErrors>true</WarningsAsErrors>')\nend\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.PedanticWarnings then\n_p(3, '<Warnings>MoreWarnings</Warnings>')\n_p(3, '<ExtraWarnings>true</ExtraWarnings>')\nelseif cfg.flags.ExtraWarnings then\n_p(3, '<Warnings>NormalWarnings</Warnings>')\n_p(3, '<ExtraWarnings>true</ExtraWarnings>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<Warnings>WarningsOff</Warnings>')\n_p(3, '<ExtraWarnings>false</ExtraWarnings>')\nelse\n_p(3, '<Warnings>NormalWarnings</Warnings>')\n_p(3, '<ExtraWarnings>false</ExtraWarnings>')\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<WarningsAsErrors>true</WarningsAsErrors>')\nend\nelse\nif cfg.flags."
+ "PedanticWarnings then\n_p(3, '<WarningLevel>EnableAllWarnings</WarningLevel>')\nelseif cfg.flags.ExtraWarnings then\n_p(3, '<WarningLevel>Level4</WarningLevel>')\nelseif cfg.flags.MinimumWarnings then\n_p(3, '<WarningLevel>Level1</WarningLevel>')\nelse\n_p(3 ,'<WarningLevel>Level3</WarningLevel>')\nend\nend\nif cfg.flags.FatalWarnings then\n_p(3, '<TreatWarningAsError>true</TreatWarningAsError>')\nend\nif premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\") or\n premake.action.current() == premake.action.get(\"vs2022\") then\ncppstandard(cfg)\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif cfg.flags.Symbols then\nif cfg.kind == \"StaticLib\" then\n_p(3, '<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'\n, path.getbasename(cfg.buildtarget.name)\n)\nelse\n_p(3, '<ProgramDataBaseFileName>$(IntDir)%s.compile.pdb</ProgramDataBaseFileName>'\n"
+ ", path.getbasename(cfg.buildtarget.name)\n)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, '<CreateHotpatchableImage>true</CreateHotpatchableImage>')\nend\nif cfg.flags.NoFramePointer then\n_p(3, '<OmitFramePointers>true</OmitFramePointers>')\nend\nif cfg.flags.UseFullPaths then\n_p(3, '<UseFullPaths>true</UseFullPaths>')\nend\nif cfg.flags.NoJMC then\n_p(3,'<SupportJustMyCode>false</SupportJustMyCode>' )\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\nif vstudio.diagformat then\n_p(3, '<DiagnosticsFormat>%s</DiagnosticsFormat>', vstudio.diagformat)\nelse\n_p(3, '<DiagnosticsFormat>Caret</DiagnosticsFormat>')\nend\n_p(2,'</ClCompile>')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'<PostBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PostBuildEvent>')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'<PreBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebui"
+ "ldcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreBuildEvent>')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'<PreLinkEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreLinkEvent>')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'<TargetMachine>%s</TargetMachine>', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(cfg)\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'<Lib>')\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\n_p(1,'</Lib>')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"Shared"
+ "Lib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function hasmasmfiles(prj)\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nreturn #files > 0\nend\nlocal function ismanagedprj(prj, cfgname, pltname)\nlocal cfg = premake.getconfig(prj, cfgname, pltname)\nreturn cfg.flags.Managed == true\nend\nlocal function getcfglinks(cfg)\nlocal haswholearchive = #cfg.wholearchive > 0\nlocal msvcnaming = premake.getnamestyle(cfg) == \"windows\"\nlocal iscppprj = premake.iscppproject(cfg)\nlocal isnetprj = premake.isdotnetproject(cfg)\nlocal linkobjs = {}\nlocal links = iif(haswholearchive\n, premake.getlinks(cfg, \"all\", \"object\")\n, premake.getlinks(cfg, \"system\", \"fullpath\")\n)\nfor _, link in ipairs(links) do\nlocal name = nil\nlocal directory = nil\nlocal whole = nil\nif type(link) == \"table\" then\nif not ismanagedprj(link"
+ ".project, cfg.name, cfg.platform) then\nname = link.linktarget.basename\ndirectory = path.rebase(link.linktarget.directory, link.location, cfg.location)\nwhole = table.icontains(cfg.wholearchive, link.project.name)\nend\nelse\nname = link\nwhole = table.icontains(cfg.wholearchive, link)\nend\nif name then\nif haswholearchive and msvcnaming then\nif iscppprj then\nname = name .. \".lib\"\nelseif isnetprj then\nname = name .. \".dll\"\nend\nend\ntable.insert(linkobjs, {name=name, directory=directory, wholearchive=whole})\nend\nend\nreturn linkobjs\nend\nlocal function vs10_masm(prj, cfg)\nif hasmasmfiles(prj) then\n_p(2, '<MASM>')\n_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>'\n, table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \")\n)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs > 0 then\n_p(3, '<IncludePaths>%s;%%(IncludePaths)</IncludePaths>'\n, premake.esc(path.translate("
+ "table.concat(includedirs, \";\"), '\\\\'))\n)\nend\nlocal defines = table.join(cfg.defines)\ntable.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \"_DEBUG\", {}))\ntable.insert(defines, iif(cfg.platform == \"x64\" or cfg.platform == \"ARM64\", \"_WIN64\", \"_WIN32\"))\ntable.insert(defines, iif(prj.kind == \"SharedLib\", \"_EXPORT=EXPORT\", \"_EXPORT=\"))\n_p(3, '<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'\n, premake.esc(table.concat(defines, \";\"))\n)\nif cfg.flags.FatalWarnings then\n_p(3,'<TreatWarningsAsErrors>true</TreatWarningsAsErrors>')\nend\nif cfg.flags.MinimumWarnings then\n_p(3,'<WarningLevel>0</WarningLevel>')\nelse\n_p(3,'<WarningLevel>3</WarningLevel>')\nend\n_p(2, '</MASM>')\nend\nend\nlocal function additional_manifest(cfg)\nif(cfg.dpiawareness ~= nil) then\n_p(2,'<Manifest>')\nif(cfg.dpiawareness == \"None\") then\n_p(3, '<EnableDpiAwareness>false</EnableDpiAwareness>')\nend\nif(cfg.dpiawareness == \"High\") then\n_p(3, '<EnableDpiAwareness>t"
+ "rue</EnableDpiAwareness>')\nend\nif(cfg.dpiawareness == \"HighPerMonitor\") then\n_p(3, '<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>')\nend\n_p(2,'</Manifest>')\nend\nend\nfunction vc2010.link(cfg)\nlocal vs2017OrLater = premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\")\nlocal links = getcfglinks(cfg)\n_p(2,'<Link>')\n_p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\nif vs2017OrLater and cfg.flags.FullSymbols then\n_p(3,'<GenerateDebugInformation>DebugFull</GenerateDebugInformation>')\nelse\n_p(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.flags.Symbols then\n_p(3, '<ProgramDatabaseFile>$(OutDir)%s.pdb</ProgramDatabaseFile>'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nif premake.config.islinkeroptimizedbuild(cfg.flags) then\nif cfg.platform == \"Orbis\" then\n_p(3,'<DataStripping>StripFuncsAndData</Dat"
+ "aStripping>')\n_p(3,'<DuplicateStripping>true</DuplicateStripping>')\nelse\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')\n_p(3,'<OptimizeReferences>true</OptimizeReferences>')\nend\nelseif cfg.platform == \"Orbis\" and premake.config.iseditandcontinue(cfg) then\n_p(3,'<EditAndContinue>true</EditAndContinue>')\nend\nif cfg.finalizemetasource ~= nil then\n_p(3,'<FinalizeMetaSource>%s</FinalizeMetaSource>', premake.esc(cfg.finalizemetasource))\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(3, cfg, links)\nvc2010.additionalLibraryDirectories(3, cfg, links)\n_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>')\nelse\n_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\n_p(3,'<Module"
+ "DefinitionFile>%s</ModuleDefinitionFile>', deffile)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nif cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n_p(3,'<GenerateWindowsMetadata>false</GenerateWindowsMetadata>' )\nend\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidlinker then\n_p(3,'<UseLinker>%s</UseLinker>',cfg.androidlinker)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, '<CreateHotPatchableImage>Enabled</CreateHotPatchableImage>')\nend\nif cfg.flags.GenerateMapFiles then\n_p(3, '<GenerateMapFile>true</GenerateMapFile>')\nend\n_p(2,'</Link>')\nif #cfg.wholearchive > 0 then\n_p(2, '<ProjectReference>')\n_p(3, '<LinkLibraryDependencies>false</LinkLibraryDependencies>')\n_p(2, '</ProjectReference>')\nend\nend\nfunction vc2010.additionalLibraryDirectories(tab, cfg, links)\nlocal dirs = cfg.libdirs\nfor _, link in ipairs(links) do\nif link.directory and not table.icontains(dirs, link.directory) then\ntable.insert(dirs, link.directory)\nend\nend\n_p("
+ "tab, '<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>'\n, premake.esc(path.translate(table.concat(dirs, ';'), '\\\\'))\n)\nend\nfunction vc2010.additionalDependencies(tab, cfg, links)\nif #links > 0 then\nlocal deps = \"\"\nif cfg.platform == \"Orbis\" then\nlocal iswhole = false\nfor _, link in ipairs(links) do\nif link.wholearchive and not iswhole then\ndeps = deps .. \"--whole-archive;\"\niswhole = true\nelseif not link.wholearchive and iswhole then\ndeps = deps .. \"--no-whole-archive;\"\niswhole = false\nend\ndeps = deps .. \"-l\" .. link.name .. \";\"\nend\nelse\nfor _, link in ipairs(links) do\nif link.wholearchive then\ndeps = deps .. \"/WHOLEARCHIVE:\" .. link.name .. \";\"\nelse\ndeps = deps .. link.name .. \";\"\nend\nend\nend\nif cfg.platform == \"TegraAndroid\" then\ndeps = \"-Wl,--start-group;\" .. deps .. \";-Wl,--end-group\"\nend\nlocal adddeps =\n iif(cfg.platform == \"Durango\", '%(XboxExtensionsDependencies)'\n, iif(vstudio.isgdkconsole"
+ "(cfg), '$(Console_Libs);%(XboxExtensionsDependencies);%(AdditionalDependencies)'\n, iif(vstudio.isgdkdesktop(cfg), '$(Console_Libs);%(AdditionalDependencies)'\n, '%(AdditionalDependencies)')))\n_p(tab, '<AdditionalDependencies>%s;%s</AdditionalDependencies>', deps, adddeps)\nelseif cfg.platform == \"Durango\" then\n_p(tab, '<AdditionalDependencies>%%(XboxExtensionsDependencies)</AdditionalDependencies>')\nelseif vstudio.isgdkconsole(cfg) then\n_p(tab, '<AdditionalDependencies>$(Console_Libs);%%(XboxExtensionsDependencies);%%(AdditionalDependencies)</AdditionalDependencies>')\nelseif vstudio.isgdkdesktop(cfg) then\n_p(tab, '<AdditionalDependencies>$(Console_Libs);%%(AdditionalDependencies)</AdditionalDependencies>')\nend\nend\nfunction ant_build(prj, cfg)\nif cfg.platform == \"TegraAndroid\" then\nlocal files = vc2010.getfilegroup(prj, \"AndroidBuild\")\n_p(2,'<AntBuild>')\nif #files > 0 then\n_p(3,'<AndroidManifestLocation>%s</AndroidManifestLocation>',path.tran"
+ "slate(files[1].name))\nend\nlocal isdebugbuild = premake.config.isdebugbuild(cfg)\n_p(3,'<AntBuildType>%s</AntBuildType>',iif(isdebugbuild, 'Debug','Release'))\n_p(3,'<Debuggable>%s</Debuggable>',tostring(cfg.flags.AntBuildDebuggable ~= nil))\nif #cfg.antbuildjavasourcedirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjavasourcedirs,\";\")\n_p(3,'<JavaSourceDir>%s</JavaSourceDir>',dirs)\nend\nif #cfg.antbuildjardirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjardirs,\";\")\n_p(3,'<JarDirectories>%s</JarDirectories>',dirs)\nend\nif #cfg.antbuildjardependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildjardependencies,\";\")\n_p(3,'<JarDependencies>%s</JarDependencies>',dirs)\nend\nif #cfg.antbuildnativelibdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdirs,\";\")\n_p(3,'<NativeLibDirectories>%s</NativeLibDirectories>',dirs)\nend\nif #cfg.antbuildnativelibdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdependencies,\";\")\n_p(3,'<NativeLibDependencies>%s</Native"
+ "LibDependencies>',dirs)\nend\nif #cfg.antbuildassetsdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildassetsdirs,\";\")\n_p(3,'<AssetsDirectories>%s</AssetsDirectories>',dirs)\nend\n_p(2,'</AntBuild>')\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nvc2010.link(cfg)\nant_build(prj, cfg)\nevent_hooks(cfg)\nvs10_masm(prj, cfg)\nadditional_manifest(cfg)\n_p(1,'</ItemDefinitionGroup>')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nMASM = {},\nObject = {},\nNone = {},\nResourceCompile = {},\nAppxManifest = {},\nAndroidBuild = {},\nNatvis = {},\nImage = {},\nDeploymentContent = {}\n}\nlocal foundAppx"
+ "Manifest = false\nfor file in premake.project.eachfile(prj, true) do\nif path.issourcefilevs(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not table.icontains(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isobjectfile(file.name) then\ntable.insert(sortedfiles.Object, file)\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelseif path.isimagefile(file.name) then\ntable.insert(sortedfiles.Image, file)\nelseif path.isappxmanifest(file.name) then\nfoundAppxManifest = true\ntable.insert(sortedfiles.AppxManifest, file)\nelseif path.isandroidbuildfile(file.name) then\ntable.insert(sortedfiles.AndroidBuild, file)\nelseif path.isnatvis(file.name) then\ntable.insert(sortedfiles.Natvis, file)\nelseif path.isasmfile(file.name) then\ntable.insert(sortedfiles.MASM, file)\nelseif file.flags and table.icontains(file.flags, \"DeploymentContent\") then\ntable.insert(sortedfiles.Deploym"
+ "entContent, file)\nelse\ntable.insert(sortedfiles.None, file)\nend\nend\nif vstudio.iswinrt() and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \"/Package.appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nlocal logo = {}\nlogo.name = prj.name .. \"/Logo.png\"\nlogo.vpath = logo.name\ntable.insert(sortedfiles.Image, logo)\nlocal smallLogo = {}\nsmallLogo.name = prj.name .. \"/SmallLogo.png\"\nsmallLogo.vpath = smallLogo.name\ntable.insert(sortedfiles.Image, smallLogo)\nlocal storeLogo = {}\nstoreLogo.name = prj.name .. \"/StoreLogo.png\"\nstoreLogo.vpath = storeLogo.name\ntable.insert(sortedfiles.Image, storeLogo)\nlocal splashScreen = {}\nsplashScreen.name = prj.name .. \"/SplashScreen.png\"\nsplashScreen.vpath = splashScreen.name\ntable.insert(sortedfiles.Image, splashScreen)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend"
+ "\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"Object\")\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.customtaskgroup(prj)\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\nvc2010.simplefilesgroup(prj, \"AppxManifest\")\nvc2010.simplefilesgroup(prj, \"AndroidBuild\")\nvc2010.simplefilesgroup(prj, \"Natvis\")\nvc2010.deploymentcontentgroup(prj, \"Image\")\nvc2010.deploymentcontentgroup(prj, \"DeploymentContent\", \"None\")\nend\nfunction vc2010.customtaskgroup(prj)\nlocal files = { }\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal fcfg = { }\nfcfg.name = path.getrelative(prj.location,buildtask[1])\nfcfg.vpath = path.trimdots(fcfg.name)\ntable.insert(files, fcfg)\nend\nend\nif #files > 0 then\n_p(1,'<ItemGroup>')\nlocal groupedBuildTasks = {}\nlocal buildTaskNames = {}\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, b"
+ "uildtask in ipairs(custombuildtask or {}) do\nif (groupedBuildTasks[buildtask[1]] == nil) then\ngroupedBuildTasks[buildtask[1]] = {}\ntable.insert(buildTaskNames, buildtask[1])\nend\ntable.insert(groupedBuildTasks[buildtask[1]], buildtask)\nend\nend\nfor _, name in ipairs(buildTaskNames) do\ncustombuildtask = groupedBuildTasks[name]\n_p(2,'<CustomBuild Include=\\\"%s\\\">', path.translate(path.getrelative(prj.location,name), \"\\\\\"))\n_p(3,'<FileType>Text</FileType>')\nlocal cmd = \"\"\nlocal outputs = \"\"\nfor _, buildtask in ipairs(custombuildtask or {}) do\nfor _, cmdline in ipairs(buildtask[4] or {}) do\ncmd = cmd .. cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[1])))\ncmd = string.gsub(cmd, \"%$%(@%)\", string.format(\"%s \",path.getrelative(prj.loca"
+ "tion,buildtask[2])))\ncmd = cmd .. \"\\r\\n\"\nend\noutputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \";\"\nend\n_p(3,'<Command>%s</Command>',cmd)\n_p(3,'<Outputs>%s%%(Outputs)</Outputs>',outputs)\n_p(3,'<SubType>Designer</SubType>')\n_p(3,'<Message></Message>')\n_p(2,'</CustomBuild>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal prjexcluded = table.icontains(prj.excludes, file.name)\nlocal excludedcfgs = {}\nif not prjexcluded then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = pr"
+ "emake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif not fileincfg or cfgexcluded then\ntable.insert(excludedcfgs, vsconfig.name)\nend\nend\nend\nif subtype or prjexcluded or #excludedcfgs > 0 then\n_p(2, '<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\nif prjexcluded then\n_p(3, '<ExcludedFromBuild>true</ExcludedFromBuild>')\nelse\nfor _, cfgname in ipairs(excludedcfgs) do\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(cfgname)\n)\nend\nend\nif subtype then\n_p(3, '<SubType>%s</SubType>', subtype)\nend\n_p(2,'</%s>', section)\nelse\n_p(2, '<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.deploymentcontentgroup(prj, section, filetype)\nif filetype == nil then\nfiletype = section\nend\nlocal files = vc2010.getfil"
+ "egroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\">', filetype, path.translate(file.name, \"\\\\\"))\n_p(3,'<DeploymentContent>true</DeploymentContent>')\n_p(3,'<Link>%s</Link>', path.translate(file.vpath, \"\\\\\"))\n_p(2,'</%s>', filetype)\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nlocal existingBasenames = {};\nfor _, file in ipairs(files) do\nlocal filename = string.lower(path.getbasename(file.name))\nlocal disambiguation = existingBasenames[filename] or 0;\nexistingBasenam"
+ "es[filename] = disambiguation + 1\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<ClCompile Include=\\\"%s\\\">', translatedpath)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal namestyle = premake.getnamestyle(cfg)\nif namestyle == \"TegraAndroid\" or namestyle == \"NX\" then\n_p(3, '<ObjectFileName '.. if_config_and_platform() .. '>$(IntDir)%s.o</ObjectFileName>', premake.esc(vsconfig.name), premake.esc(path.translate(path.trimdots(path.removeext(file.name)))) )\nelse\nif disambiguation > 0 then\n_p(3, '<ObjectFileName '.. if_config_and_platform() .. '>$(IntDir)%s\\\\</ObjectFileName>', premake.esc(vsconfig.name), tostring(disambiguation))\nend\nend\nend\nif path.iscxfile(file.name) then\n_p(3, '<CompileAsWinRT>true</CompileAsWinRT>')\n_p(3, '<RuntimeTypeInfo>true</RuntimeTypeInfo>')\n_p(3, '<PrecompiledHeader>NotUsing</PrecompiledHeader>')\nend\nif vstudio.iswinrt() and string.len(file.name) > 2 and string.s"
+ "ub(file.name, -2) == \".c\" then\n_p(3,'<CompileAsWinRT>FALSE</CompileAsWinRT>')\nend\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nlocal nopch = table.icontains(prj.nopch, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif nopch or table.icontains(cfg.nopch, file.name) then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>NotUsing</PrecompiledHeader>', premake.esc(vsconfig.name))\nend\nend\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontai"
+ "ns(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal prjforcenative = table.icontains(prj.forcenative, file.name)\nfor _,vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif prjforcenative or table.icontains(cfg.forcenative, file.name) then\n_p(3, '<CompileAsManaged ' .. if_config_and_platform() .. '>false</CompileAsManaged>', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.masmfiles(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nif #files > 0 then\n_p(1, '<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<MASM Include=\"%s\">', translatedpath)\nlocal exclud"
+ "ed = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\n_p(2, '</MASM>')\nend\n_p(1, '</ItemGroup>')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('<Project%s ToolsVersion=\"%s\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">', t, action.vstudio.toolsVersion)\nend\nfunction premake.vs2010_vcxproj(prj)\nlocal usemasm = hasmasmfiles(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import "
+ "Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettings\">')\nif usemasm then\n_p(2, '<Import Project=\"$(VCTargetsPath)\\\\BuildCustomizations\\\\masm.props\" />')\nend\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup Label=\"UserMacros\" />')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.clrReferences(prj)\nvc2010.projectReferences(prj)\nvc2010.sdkReferences(prj)\nvc2010.masmfiles(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\nif usemasm then\n_p(2, '<Import Project=\"$(VCTargetsPath)\\\\BuildCustomizations\\\\masm.targets\" />')\nend\n_p(1,'</ImportGroup>')\n_p('"
+ "</Project>')\nend\nfunction vc2010.clrReferences(prj)\nif #prj.clrreferences == 0 then\nreturn\nend\n_p(1,'<ItemGroup>')\nfor _, ref in ipairs(prj.clrreferences) do\nif os.isfile(ref) then\nlocal assembly = path.getbasename(ref)\n_p(2,'<Reference Include=\"%s\">', assembly)\n_p(3,'<HintPath>%s</HintPath>', path.getrelative(prj.location, ref))\n_p(2,'</Reference>')\nelse\n_p(2,'<Reference Include=\"%s\" />', ref)\nend\nend\n_p(1,'</ItemGroup>')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps == 0 and #prj.vsimportreferences == 0 then\nreturn\nend\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\ntable.sort(table.join(prj.vsimportreferences), compareuuid)\n_p(1,'<ItemGroup>')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'<ProjectReference Include=\\\"%s\\\">', path.translate(deppath, \"\\\\\"))\n_p(3,'<Project>{%s}</Project>', dep.uuid)\nif vstudio.iswinrt"
+ "() then\n_p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>')\nend\n_p(2,'</ProjectReference>')\nend\nfor _, ref in ipairs(prj.vsimportreferences) do\nlocal slnrelpath = path.rebase(ref, prj.location, sln.location)\nlocal iprj = premake.vstudio.getimportprj(slnrelpath, prj.solution)\n_p(2,'<ProjectReference Include=\\\"%s\\\">', ref)\n_p(3,'<Project>{%s}</Project>', iprj.uuid)\n_p(2,'</ProjectReference>')\nend\n_p(1,'</ItemGroup>')\nend\nfunction vc2010.sdkReferences(prj)\nlocal refs = prj.sdkreferences\nif #refs > 0 then\n_p(1,'<ItemGroup>')\nfor _, ref in ipairs(refs) do\n_p(2,'<SDKReference Include=\\\"%s\\\" />', ref)\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.debugdir(cfg)\nlocal isnx = (cfg.platform == \"NX32\" or cfg.platform == \"NX64\")\nlocal debuggerFlavor =\n iif(isnx, 'OasisNXDebugger'\n, iif(cfg.platform == \"Orbis\", 'ORBISDebugger'\n, iif(cfg.platform == \"Durango\", 'XboxOneVCppDebugger'\n, iif(cfg.platform == \"TegraAndroid\", 'And"
+ "roidDebugger'\n, iif(vstudio.iswinrt(), 'AppHostLocalDebugger'\n, 'WindowsLocalDebugger'\n)))))\n_p(2, '<DebuggerFlavor>%s</DebuggerFlavor>', debuggerFlavor)\nif cfg.debugdir and not vstudio.iswinrt() then\n_p(2, '<LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>'\n, path.translate(cfg.debugdir, '\\\\')\n)\nend\nif cfg.debugcmd then\n_p(2, '<LocalDebuggerCommand>%s</LocalDebuggerCommand>', cfg.debugcmd)\nend\nif cfg.debugargs then\n_p(2, '<LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>'\n, table.concat(cfg.debugargs, \" \")\n)\nend\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2, '<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>'\n, table.concat(cfg.debugenvs, \"\\n\")\n, iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)', '')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2, '<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')\nend\nend\nif cfg.deploymode then\n_p(2, '<DeployMode>%s</D"
+ "eployMode>', cfg.deploymode)\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androiddebugintentparams then\n_p(2, '<IntentParams>%s</IntentParams>'\n, table.concat(cfg.androiddebugintentparams, \" \")\n)\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' <PropertyGroup '.. if_config_and_platform() ..'>', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\n_p(' </PropertyGroup>')\nend\n_p('</Project>')\nend\nlocal png1x1data = {\n0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR\n0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V\n0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- .....PLTE....z=.\n0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x5"
+ "3, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f...\n0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`.......\n0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`.\n}\nfunction png1x1(obj, filename)\nfilename = premake.project.getfilename(obj, filename)\nlocal f, err = io.open(filename, \"wb\")\nif f then\nfor _, byte in ipairs(png1x1data) do\nf:write(string.char(byte))\nend\nf:close()\nend\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nif vstudio.storeapp == \"10.0\" then\n_p('<Package')\n_p(1, 'xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"')\n_p(1, 'xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\"')\n_p(1, 'xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"')\n_p(1, 'IgnorableNamespaces=\"uap mp\">')\nelseif vstudi"
+ "o.storeapp == \"durango\" then\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:mx=\"http://schemas.microsoft.com/appx/2013/xbox/manifest\" IgnorableNamespaces=\"mx\">')\nend\n_p(1, '<Identity')\n_p(2, 'Name=\"' .. prj.uuid .. '\"')\n_p(2, 'Publisher=\"CN=Publisher\"')\n_p(2, 'Version=\"1.0.0.0\" />')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '<mp:PhoneIdentity')\n_p(2, 'PhoneProductId=\"' .. prj.uuid .. '\"')\n_p(2, 'PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>')\nend\n_p(1, '<Properties>')\n_p(2, '<DisplayName>' .. prj.name .. '</DisplayName>')\n_p(2, '<PublisherDisplayName>PublisherDisplayName</PublisherDisplayName>')\n_p(2, '<Logo>' .. prj.name .. '\\\\StoreLogo.png</Logo>')\npng1x1(prj, \"%%/StoreLogo.png\")\n_p(2, '<Description>' .. prj.name .. '</Description>')\n_p(1,'</Properties>')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '<Dependencies>')\n_p(2, '<TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.10069.0\" MaxVersionTested=\"10.0.10069."
+ "0\" />')\n_p(1, '</Dependencies>')\nelseif vstudio.storeapp == \"durango\" then\n_p(1, '<Prerequisites>')\n_p(2, '<OSMinVersion>6.2</OSMinVersion>')\n_p(2, '<OSMaxVersionTested>6.2</OSMaxVersionTested>')\n_p(1, '</Prerequisites>')\nend\n_p(1, '<Resources>')\n_p(2, '<Resource Language=\"en-us\"/>')\n_p(1, '</Resources>')\n_p(1, '<Applications>')\n_p(2, '<Application Id=\"App\"')\n_p(3, 'Executable=\"$targetnametoken$.exe\"')\n_p(3, 'EntryPoint=\"' .. prj.name .. '.App\">')\nif vstudio.storeapp == \"10.0\" then\n_p(3, '<uap:VisualElements')\n_p(4, 'DisplayName=\"' .. prj.name .. '\"')\n_p(4, 'Square150x150Logo=\"' .. prj.name .. '\\\\Logo.png\"')\npng1x1(prj, \"%%/Logo.png\")\nif vstudio.storeapp == \"10.0\" then\n_p(4, 'Square44x44Logo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\nelse\n_p(4, 'Square30x30Logo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\nend\n_p(4, 'Description=\"' .. prj.name .. '\"')\n_p(4, 'BackgroundColor=\"transparent\">')\n_p"
+ "(4, '<uap:SplashScreen Image=\"' .. prj.name .. '\\\\SplashScreen.png\" />')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '</uap:VisualElements>')\nelseif vstudio.storeapp == \"durango\" then\n_p(3, '<VisualElements')\n_p(4, 'DisplayName=\"' .. prj.name .. '\"')\n_p(4, 'Logo=\"' .. prj.name .. '\\\\Logo.png\"')\npng1x1(prj, \"%%/Logo.png\")\n_p(4, 'SmallLogo=\"' .. prj.name .. '\\\\SmallLogo.png\"')\npng1x1(prj, \"%%/SmallLogo.png\")\n_p(4, 'Description=\"' .. prj.name .. '\"')\n_p(4, 'ForegroundText=\"light\"')\n_p(4, 'BackgroundColor=\"transparent\">')\n_p(5, '<SplashScreen Image=\"' .. prj.name .. '\\\\SplashScreen.png\" />')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '</VisualElements>')\n_p(3, '<Extensions>')\n_p(4, '<mx:Extension Category=\"xbox.system.resources\">')\n_p(4, '<mx:XboxSystemResources />')\n_p(4, '</mx:Extension>')\n_p(3, '</Extensions>')\nend\n_p(2, '</Application>')\n_p(1, '</Applications>')\n_p('</Package>')\nend\n",
/* actions/vstudio/vstudio_vcxproj_filters.lua */
"local vc2010 = premake.vstudio.vc2010\nlocal project = premake.project\nfunction vc2010.filteridgroup(prj)\nlocal filters = { }\nlocal filterfound = false\nfor file in premake.project.eachfile(prj, true) do\nlocal folders = string.explode(file.vpath, \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'<ItemGroup>')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilters[path] = true\n_p(2, '<Filter Include=\"%s\">', path)\n_p(3, '<UniqueIdentifier>{%s}</UniqueIdentifier>', os.uuid(path))\n_p(2, '</Filter>')\nend\npath = path .. \"\\\\\"\nend\nend\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal folders = string.explode(path.trimdots(path.getrelative(prj.location,buildtask[1])), \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'<ItemGroup>')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilt"
@@ -367,9 +380,9 @@ const char* builtin_scripts[] = {
"premake.vstudio.vc2019 = {}\nlocal vc2019 = premake.vstudio.vc2019\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vs2019\",\nshortname = \"Visual Studio 2019\",\ndescription = \"Generate Microsoft Visual Studio 2019 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.vstudio.needAppxManifest = false\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.v"
"cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.7.2\",\ntoolsVersion = \"16.0\",\nwindowsTargetPlatformVersion = \"10.0\",\nsupports64bitEditContinue = true,\nintDirAbsolute = false,\n}\n}\n",
- /* actions/vstudio/vsllvm.lua */
- "premake.vstudio.vcllvm = {}\nlocal vcllvm = premake.vstudio.vcllvm\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vsllvm\",\nshortname = \"Visual Studio LLVM\",\ndescription = \"Generate Microsoft Visual Studio LLVM project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.vstudio.needAppxManifest = false\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.v"
- "cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.5.2\",\ntoolsVersion = \"15.0\",\nwindowsTargetPlatformVersion = \"8.1\",\nsupports64bitEditContinue = true,\nintDirAbsolute = true,\n}\n}\n",
+ /* actions/vstudio/vs2022.lua */
+ "premake.vstudio.vc2022 = {}\nlocal vc2022 = premake.vstudio.vc2022\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vs2022\",\nshortname = \"Visual Studio 2022\",\ndescription = \"Generate Microsoft Visual Studio 2022 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.vstudio.needAppxManifest = false\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.v"
+ "cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.7.2\",\ntoolsVersion = \"16.0\",\nwindowsTargetPlatformVersion = \"10.0\",\nsupports64bitEditContinue = true,\nintDirAbsolute = false,\n}\n}\n",
/* actions/xcode/_xcode.lua */
"premake.xcode = { }\nfunction premake.xcode.checkproject(prj)\nlocal last\nfor cfg in premake.eachconfig(prj) do\nif last and last ~= cfg.kind then\nerror(\"Project '\" .. prj.name .. \"' uses more than one target kind; not supported by Xcode\", 0)\nend\nlast = cfg.kind\nend\nend\npremake.xcode.toolset = \"macosx\"\n",
@@ -382,28 +395,29 @@ const char* builtin_scripts[] = {
"textension(node.path)] or\n(types[string.lower(path.getextension(node.path))] or \"text\")\nend\nfunction xcode.getproducttype(node)\nlocal types = {\nConsoleApp = \"com.apple.product-type.tool\",\nWindowedApp = node.cfg.options.SkipBundling and \"com.apple.product-type.tool\" or \"com.apple.product-type.application\",\nStaticLib = \"com.apple.product-type.library.static\",\nSharedLib = \"com.apple.product-type.library.dynamic\",\nBundle = node.cfg.options.SkipBundling and \"com.apple.product-type.tool\" or \"com.apple.product-type.bundle\",\n}\nreturn types[node.cfg.kind]\nend\nfunction xcode.gettargettype(node)\nlocal types = {\nConsoleApp = \"\\\"compiled.mach-o.executable\\\"\",\nWindowedApp = node.cfg.options.SkipBundling and \"\\\"compiled.mach-o.executable\\\"\" or \"wrapper.application\",\nStaticLib = \"archive.ar\",\nSharedLib = \"\\\"compiled.mach-o.dylib\\\"\",\nBundle = node.cfg.options.SkipBundling and \"\\\"compiled.mach-o.bundle\\\"\" or \"wrapper.cfbundle\",\n}\nreturn types"
"[node.cfg.kind]\nend\nfunction xcode.getxcodeprojname(prj)\nlocal fname = premake.project.getfilename(prj, \"%%.xcodeproj\")\nreturn fname\nend\nfunction xcode.isframework(fname)\nreturn (path.getextension(fname) == \".framework\" or path.getextension(fname) == \".tbd\")\nend\nfunction xcode.uuid(param)\nreturn os.uuid(param):upper():gsub('-',''):sub(0,24)\nend\nfunction xcode.newid(node, usage)\nlocal base = ''\nlocal prj = node.project\nif prj == nil then\nlocal parent = node.parent\nwhile parent ~= nil do\nif parent.project ~= nil then\nprj = parent.project\nbreak\nend\nparent = parent.parent\nend\nend\nif prj ~= nil then\nprj.uuidcounter = (prj.uuidcounter or 0) + 1\nbase = base .. prj.name .. \"$\" .. prj.uuidcounter .. \"$\"\nend\nbase = base .. \"$\" .. (node.path or node.name or \"\")\nbase = base .. \"$\" .. (usage or \"\")\nreturn xcode.uuid(base)\nend\nfunction xcode.getscriptphaselabel(cmd, count, cfg)\nreturn string.format(\"\\\"Script Phase %s [%s] (%s)\\\"\", count, cmd:match(\"(%w+)(.+)\"), iif"
"(cfg, xcode.getconfigname(cfg), \"all\"))\nend\nfunction xcode.getcopyphaselabel(type, count, target)\nreturn string.format(\"\\\"Copy %s %s [%s]\\\"\", type, count, target)\nend\nfunction xcode.preparesolution(sln)\nsln.xcode = { }\nsln.xcode.platforms = premake.filterplatforms(sln, premake.action.current().valid_platforms, \"Universal\")\nfor prj in premake.solution.eachproject(sln) do\nlocal cfg = premake.getconfig(prj, prj.configurations[1], sln.xcode.platforms[1])\nlocal node = premake.tree.new(path.getname(cfg.buildtarget.bundlepath))\nnode.cfg = cfg\nnode.id = premake.xcode.newid(node, \"product\")\nnode.targetid = premake.xcode.newid(node, \"target\")\nprj.xcode = {}\nprj.xcode.projectnode = node\nend\nend\nfunction xcode.printlist(list, tag, sort)\nif #list > 0 then\nif sort ~= nil and sort == true then\ntable.sort(list)\nend\n_p(4,'%s = (', tag)\nfor _, item in ipairs(list) do\nlocal escaped_item = item:gsub(\"\\\"\", \"\\\\\\\\\\\\\\\"\"):gsub(\"'\", \"\\\\\\\\'\")\n_p(5, '\"%s\",', escaped_item)\ne"
- "nd\n_p(4,');')\nend\nend\nfunction xcode.quotestr(str)\nif str:match(\"[^a-zA-Z0-9$._/]\") == nil then\nreturn str\nend\nreturn \"\\\"\" .. str:gsub(\"[\\\"\\\\\\\"]\", \"\\\\%0\") .. \"\\\"\"\nend\nfunction xcode.Header(tr, objversion)\n_p('// !$*UTF8*$!')\n_p('{')\n_p(1,'archiveVersion = 1;')\n_p(1,'classes = {')\n_p(1,'};')\n_p(1,'objectVersion = %d;', objversion)\n_p(1,'objects = {')\n_p('')\nend\nfunction xcode.PBXBuildFile(tr)\nlocal function gatherCopyFiles(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\ntable.insertflat(copyfiles, tt[2])\nend\nend\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal function gatherCopyFrameworks(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\ntable.insertflat(copyfiles, targets)\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal copyfiles = table.flatten({\ngatherCopyFiles('xcodecopyresources'),\ngatherCop"
- "yFrameworks('xcodecopyframeworks')\n})\n_p('/* Begin PBXBuildFile section */')\ntree.traverse(tr, {\nonnode = function(node)\nif node.buildid then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',\nnode.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)\nend\nif table.icontains(copyfiles, node.name) then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; %s };',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFiles', node.id, node.name,\niif(xcode.isframework(node.name), \"settings = {ATTRIBUTES = (CodeSignOnCopy, ); };\", \"\")\n)\nend\nend\n})\n_p('/* End PBXBuildFile section */')\n_p('')\nend\nfunction xcode.PBXContainerItemProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXContainerItemProxy section */')\nfor _, node in ipairs(tr.projects.children) do\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.productproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.pat"
- "h))\n_p(3,'proxyType = 2;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.targetproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 1;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\nend\n_p('/* End PBXContainerItemProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXFileReference(tr,prj)\n_p('/* Begin PBXFileReference section */')\ntree.traverse(tr, {\nonleaf = function(node)\nif not node.path then\nreturn\nend\nif node.kind == \"product\" then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = \"%s\"; path = \"%s\"; sourceTree = BUILT_PRODUCTS_DIR; };',\nnode.id, node.name, xcode.gettargettype(node), node.name, path"
- ".getname(node.cfg.buildtarget.bundlepath))\nelseif node.parent.parent == tr.projects then\nlocal relpath = path.getrelative(tr.project.location, node.parent.project.location)\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = \"%s\"; path = \"%s\"; sourceTree = SOURCE_ROOT; };',\nnode.parent.id, node.parent.name, node.parent.name, path.join(relpath, node.parent.name))\nelse\nlocal pth, src\nif xcode.isframework(node.path) then\nlocal nodePath = node.path\nlocal _, matchEnd, variable = string.find(nodePath, \"^%$%((.+)%)/\")\nif variable then\nnodePath = string.sub(nodePath, matchEnd + 1)\nend\nif string.find(nodePath,'/') then\nif string.find(nodePath,'^%.')then\nnodePath = path.getabsolute(path.join(tr.project.location, nodePath))\nend\npth = nodePath\nelseif path.getextension(nodePath)=='.tbd' then\npth = \"/usr/lib/\" .. nodePath\nelse\npth = \"/System/Library/Frameworks/\" .. nodePath\nend\nif variable then\nsrc = variable\nif string.find(pth, '^/') then\npth "
- "= string.sub(pth, 2)\nend\nelse\nsrc = \"<absolute>\"\nend\nelse\nsrc = \"<group>\"\nif node.location then\npth = node.location\nelseif node.parent.isvpath then\npth = node.cfg.name\nelse\npth = tree.getlocalpath(node)\nend\nend\nif (not prj.options.ForceCPP) then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletype(node), node.name, pth, src)\nelse\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletypeForced(node), node.name, pth, src)\nend\nend\nend\n})\n_p('/* End PBXFileReference section */')\n_p('')\nend\nfunction xcode.PBXFrameworksBuildPhase(tr)\n_p('/* Begin PBXFrameworksBuildPhase section */')\n_p(2,'%s /* Frameworks */ = {', tr.products.children[1].fxstageid)\n_p(3,'isa = PBXFrameworksBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr.frameworks"
- ", {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\n_p('/* End PBXFrameworksBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXGroup(tr)\n_p('/* Begin PBXGroup section */')\ntree.traverse(tr, {\nonnode = function(node)\nif (node.path and #node.children == 0) or node.kind == \"vgroup\" then\nreturn\nend\nif node.parent == tr.projects then\n_p(2,'%s /* Products */ = {', node.productgroupid)\nelse\n_p(2,'%s /* %s */ = {', node.id, node.name)\nend\n_p(3,'isa = PBXGroup;')\n_p(3,'children = (')\nfor _, childnode in ipairs(node.children) do\n_p(4,'%s /* %s */,', childnode.id, childnode.name)\nend\n_p(3,');')\nif node.parent == tr.projects then\n_p(3,'name = Products;')\nelse\n_p(3,'name = \"%s\";', node.name)\nif node.location then\n_p(3,'path = \"%s\";', node.location)"
- "\nelseif node.path and not node.isvpath then\nlocal p = node.path\nif node.parent.path then\np = path.getrelative(node.parent.path, node.path)\nend\n_p(3,'path = \"%s\";', p)\nend\nend\n_p(3,'sourceTree = \"<group>\";')\n_p(2,'};')\nend\n}, true)\n_p('/* End PBXGroup section */')\n_p('')\nend\nfunction xcode.PBXNativeTarget(tr)\n_p('/* Begin PBXNativeTarget section */')\nfor _, node in ipairs(tr.products.children) do\nlocal name = tr.project.name\nlocal function hasBuildCommands(which)\nif #tr.project[which] > 0 then\nreturn true\nend\nfor _, cfg in ipairs(tr.configs) do\nif #cfg[which] > 0 then\nreturn true\nend\nend\nend\nlocal function dobuildblock(id, label, which, action)\nif hasBuildCommands(which) then\nlocal commandcount = 0\nfor _, cfg in ipairs(tr.configs) do\ncommandcount = commandcount + #cfg[which]\nend\nif commandcount > 0 then\naction(id, label)\nend\nend\nend\nlocal function doscriptphases(which, action)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = cfg[which]\nif cfgcmds ~"
- "= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal label = xcode.getscriptphaselabel(cmd, i, cfg)\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1\nend\nend\nend\nend\nend\nlocal function docopyresources(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1\nend\nend\nend\nend\nend\nlocal function docopyframeworks(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\naction(id, label)\nend\nend\nend\nlocal function _p_label(id, label)\n_p(4, '%s /* %s */,', id, label)\nend\n_p(2,'%s /* %s */ = {', node.targetid, name)\n_p(3,'isa = PBXNativeTarget;')\n_p(3,'buildConfigurationLi"
- "st = %s /* Build configuration list for PBXNativeTarget \"%s\" */;', node.cfgsection, name)\n_p(3,'buildPhases = (')\ndobuildblock('9607AE1010C857E500CD1376', 'Prebuild', 'prebuildcommands', _p_label)\n_p(4,'%s /* Resources */,', node.resstageid)\n_p(4,'%s /* Sources */,', node.sourcesid)\ndobuildblock('9607AE3510C85E7E00CD1376', 'Prelink', 'prelinkcommands', _p_label)\n_p(4,'%s /* Frameworks */,', node.fxstageid)\ndobuildblock('9607AE3710C85E8F00CD1376', 'Postbuild', 'postbuildcommands', _p_label)\ndoscriptphases(\"xcodescriptphases\", _p_label)\ndocopyresources(\"xcodecopyresources\", _p_label)\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\", _p_label)\nend\n_p(3,');')\n_p(3,'buildRules = (')\n_p(3,');')\n_p(3,'dependencies = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'%s /* PBXTargetDependency */,', node.targetdependid)\nend\n_p(3,');')\n_p(3,'name = \"%s\";', name)\nlocal p\nif node.cfg.kind == \"ConsoleApp\" then\np = \"$(HOME)/bin\"\nelseif node.cfg.ki"
- "nd == \"WindowedApp\" then\np = \"$(HOME)/Applications\"\nend\nif p then\n_p(3,'productInstallPath = \"%s\";', p)\nend\n_p(3,'productName = \"%s\";', name)\n_p(3,'productReference = %s /* %s */;', node.id, node.name)\n_p(3,'productType = \"%s\";', xcode.getproducttype(node))\n_p(2,'};')\nend\n_p('/* End PBXNativeTarget section */')\n_p('')\nend\nfunction xcode.PBXProject(tr, compatVersion)\n_p('/* Begin PBXProject section */')\n_p(2,'__RootObject_ /* Project object */ = {')\n_p(3,'isa = PBXProject;')\n_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */;', tr.name)\n_p(3,'compatibilityVersion = \"Xcode %s\";', compatVersion)\n_p(3,'hasScannedForEncodings = 1;')\n_p(3,'mainGroup = %s /* %s */;', tr.id, tr.name)\n_p(3,'projectDirPath = \"\";')\nif #tr.projects.children > 0 then\n_p(3,'projectReferences = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'{')\n_p(5,'ProductGroup = %s /* Products */;', node.productgroupid)\n_p(5,'ProjectRef = %s /* %s"
- " */;', node.id, path.getname(node.path))\n_p(4,'},')\nend\n_p(3,');')\nend\n_p(3,'projectRoot = \"\";')\n_p(3,'targets = (')\nfor _, node in ipairs(tr.products.children) do\n_p(4,'%s /* %s */,', node.targetid, node.name)\nend\n_p(3,');')\n_p(2,'};')\n_p('/* End PBXProject section */')\n_p('')\nend\nfunction xcode.PBXReferenceProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXReferenceProxy section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXReferenceProxy;')\n_p(3,'fileType = %s;', xcode.gettargettype(node))\n_p(3,'path = \"%s\";', node.path)\n_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)\n_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')\n_p(2,'};')\nend\n})\n_p('/* End PBXReferenceProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXResourcesBuildPhase(tr)\n_p('/* Begin PBXResourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Resources */ = {', target.r"
- "esstageid)\n_p(3,'isa = PBXResourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonnode = function(node)\nif xcode.getbuildcategory(node) == \"Resources\" then\n_p(4,'%s /* %s in Resources */,', node.buildid, node.name)\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXResourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXShellScriptBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, commands, files)\nif commands ~= nil then\ncommands = table.flatten(commands)\nend\nif #commands > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXShellScriptBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXShellScriptBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\n_p(3,');')\n_p(3,'inputPaths = (');\nif files ~= nil then\nfiles = table.flatten(files)\nif #files > 0 then\nfor _, file in ipairs(files) do\n_p("
- "4, '\"%s\",', file)\nend\nend\nend\n_p(3,');');\n_p(3,'name = %s;', name);\n_p(3,'outputPaths = (');\n_p(3,');');\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(3,'shellPath = /bin/sh;');\n_p(3,'shellScript = \"%s\";', table.concat(commands, \"\\\\n\"):gsub('\"', '\\\\\"'))\n_p(2,'};')\nend\nend\nlocal function wrapcommands(cmds, cfg)\nlocal commands = {}\nif #cmds > 0 then\ntable.insert(commands, 'if [ \"${CONFIGURATION}\" = \"' .. xcode.getconfigname(cfg) .. '\" ]; then')\nfor i = 1, #cmds do\nlocal cmd = cmds[i]\ncmd = cmd:gsub('\\\\','\\\\\\\\')\ntable.insert(commands, cmd)\nend\ntable.insert(commands, 'fi')\nend\nreturn commands\nend\nlocal function dobuildblock(id, name, which)\nlocal commands = {}\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = wrapcommands(cfg[which], cfg)\nif #cfgcmds > 0 then\nfor i, cmd in ipairs(cfgcmds) do\ntable.insert(commands, cmd)\nend\nend\nend\ndoblock(id, name, commands)\nend\nlocal function doscriptphases(which)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) d"
- "o\nlocal cfgcmds = cfg[which]\nif cfgcmds ~= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal files = script[2]\nlocal label = xcode.getscriptphaselabel(cmd, i, cfg)\nlocal id = xcode.uuid(label)\ndoblock(id, label, wrapcommands({cmd}, cfg), files)\ni = i + 1\nend\nend\nend\nend\nend\ndobuildblock(\"9607AE1010C857E500CD1376\", \"Prebuild\", \"prebuildcommands\")\ndobuildblock(\"9607AE3510C85E7E00CD1376\", \"Prelink\", \"prelinkcommands\")\ndobuildblock(\"9607AE3710C85E8F00CD1376\", \"Postbuild\", \"postbuildcommands\")\ndoscriptphases(\"xcodescriptphases\")\nif wrapperWritten then\n_p('/* End PBXShellScriptBuildPhase section */')\nend\nend\nfunction xcode.PBXSourcesBuildPhase(tr,prj)\n_p('/* Begin PBXSourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Sources */ = {', target.sourcesid)\n_p(3,'isa = PBXSourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\no"
- "nleaf = function(node)\nif xcode.getbuildcategory(node) == \"Sources\" then\nif not table.icontains(prj.excludes, node.cfg.name) then -- if not excluded\n_p(4,'%s /* %s in Sources */,', node.buildid, node.name)\nend\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXSourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXCopyFilesBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, folderSpec, path, files)\nif #files > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXCopyFilesBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXCopyFilesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'dstPath = \\\"%s\\\";', path)\n_p(3,'dstSubfolderSpec = \\\"%s\\\";', folderSpec)\n_p(3,'files = (')\ntree.traverse(tr, {\nonleaf = function(node)\nif table.icontains(files, node.name) then\n_p(4,'%s /* %s in %s */,',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFile"
- "s')\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(2,'};')\nend\nend\nlocal function docopyresources(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(tt[2]), path.getname)\ndoblock(id, label, 7, tt[1], files)\ni = i + 1\nend\nend\nend\nend\nlocal function docopyframeworks(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(targets), path.getname)\ndoblock(id, label, 10, \"\", files)\nend\nend\ndocopyresources(\"xcodecopyresources\")\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\")\nend\nif wrapperWritten then\n_p('/* End PBXCopyFilesBuildPhase section */')\nend\nend\nfunction xcode.PBXVariantGroup(tr"
- ")\n_p('/* Begin PBXVariantGroup section */')\ntree.traverse(tr, {\nonbranch = function(node)\nif node.kind == \"vgroup\" then\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXVariantGroup;')\n_p(3,'children = (')\nfor _, lang in ipairs(node.children) do\n_p(4,'%s /* %s */,', lang.id, lang.name)\nend\n_p(3,');')\n_p(3,'name = %s;', node.name)\n_p(3,'sourceTree = \"<group>\";')\n_p(2,'};')\nend\nend\n})\n_p('/* End PBXVariantGroup section */')\n_p('')\nend\nfunction xcode.PBXTargetDependency(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXTargetDependency section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)\n_p(3,'isa = PBXTargetDependency;')\n_p(3,'name = \"%s\";', node.name)\n_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)\n_p(2,'};')\nend\n})\n_p('/* End PBXTargetDependency section */')\n_p('')\nend\nend\nfunction xcode.cfg_excluded_files(prj, cfg)\nlocal excluded = {}\nloc"
- "al function exclude_pattern(file)\nif path.isabsolute(file) then\nreturn file\nend\nlocal start, term = file:findlast(\"/%.%./\")\nif term then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nstart, term = file:find(\"%.%./\")\nif start == 1 then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nreturn path.join(\"*\", file)\nend\nlocal function add_file(file)\nlocal name = exclude_pattern(file)\nif not table.icontains(excluded, name) then\ntable.insert(excluded, name)\nend\nend\nlocal function verify_file(file)\nlocal name = exclude_pattern(file)\nif table.icontains(excluded, name) then\nerror(\"'\" .. file .. \"' would be excluded by the rule to exclude '\" .. name .. \"'\")\nend\nend\nfor _, file in ipairs(cfg.excludes) do\nadd_file(file)\nend\nfor _, file in ipairs(prj.allfiles) do\nif not table.icontains(prj.excludes, file) and not table.icontains(cfg.excludes, file) then\nif not table.icontains(cfg.files, file) then\nadd_file(file)\nelse\nverify_file(file)\nend\nend\nend\ntable.sort(excluded)\nreturn"
- " excluded\nend\nfunction xcode.XCBuildConfiguration_Impl(tr, id, opts, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s */ = {', id, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n_p(3,'buildSettings = {')\nfor k, v in table.sortedpairs(opts) do\nif type(v) == \"table\" then\nif #v > 0 then\n_p(4,'%s = (', k)\nfor i, v2 in ipairs(v) do\n_p(5,'%s,', xcode.quotestr(tostring(v2)))\nend\n_p(4,');')\nend\nelse\n_p(4,'%s = %s;', k, xcode.quotestr(tostring(v)))\nend\nend\n_p(3,'};')\n_p(3,'name = %s;', xcode.quotestr(cfgname))\n_p(2,'};')\nend\nlocal function add_options(options, extras)\nfor _, tbl in ipairs(extras) do\nfor tkey, tval in pairs(tbl) do\noptions[tkey] = tval\nend\nend\nend\nlocal function add_wholearchive_links(opts, cfg)\nif #cfg.wholearchive > 0 then\nlocal linkopts = {}\nfor _, depcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nif table.icontains(cfg.wholearchive, depcfg.project.name) then\nlocal linkpath = path.rebase(depcfg.linktarget.fullpath, depcfg.location, cf"
- "g.location)\ntable.insert(linkopts, \"-force_load\")\ntable.insert(linkopts, linkpath)\nend\nend\nif opts.OTHER_LDFLAGS then\nlinkopts = table.join(linkopts, opts.OTHER_LDFLAGS)\nend\nopts.OTHER_LDFLAGS = linkopts\nend\nend\nfunction xcode.XCBuildConfiguration(tr, prj, opts)\n_p('/* Begin XCBuildConfiguration section */')\nfor _, target in ipairs(tr.products.children) do\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.ontarget(tr, target, cfg)\nadd_options(values, cfg.xcodetargetopts)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.targetid, values, cfg)\nend\nend\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.onproject(tr, prj, cfg)\nadd_options(values, cfg.xcodeprojectopts)\nadd_wholearchive_links(values, cfg)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.projectid, values, cfg)\nend\n_p('/* End XCBuildConfiguration section */')\n_p('')\nend\nfunction xcode.XCBuildConfigurationList(tr)\nlocal sln = tr.project.solution\n_p('/* Begin XCConfigurationList section */')\nfor _, target in ipair"
- "s(tr.products.children) do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {', target.cfgsection, target.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\nend\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {', tr.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\n_p('/* End XCConfigurationList section */')\n_p('')\nend\nfunction xcode.Footer()\n_p(1,'};')\n_p('\\trootObject = __RootObject_ /*"
- " Project object */;')\n_p('}')\nend\n",
+ "nd\n_p(4,');')\nend\nend\nfunction xcode.quotestr(str)\nif str:match(\"[^a-zA-Z0-9$._/]\") == nil then\nreturn str\nend\nreturn \"\\\"\" .. str:gsub(\"[\\\"\\\\\\\"]\", \"\\\\%0\") .. \"\\\"\"\nend\nfunction xcode.setdeploymenttarget(cfg, def, opts)\nlocal get_opt = function(opt, def)\nreturn (opt and #opt > 0) and opt or def\nend\nlocal iosversion = get_opt(cfg.iostargetplatformversion, def.iOSTargetPlatformVersion)\nlocal macosversion = get_opt(cfg.macostargetplatformversion, def.macOSTargetPlatformVersion)\nlocal tvosversion = get_opt(cfg.tvostargetplatformversion, def.tvOSTargetPlatformVersion)\nlocal visionosversion = get_opt(cfg.visionostargetplatformversion, def.visionOSTargetPlatformVersion)\nif iosversion then\nopts.IPHONEOS_DEPLOYMENT_TARGET = iosversion\nelseif macosversion then\nopts.MACOSX_DEPLOYMENT_TARGET = macosversion\nelseif tvosversion then\nopts.TVOS_DEPLOYMENT_TARGET = tvosversion\nelseif visionosversion then\nopts.XROS_DEPLOYMENT_TARGET = tvosversion\nend\nend\nfunction xcode.Header(tr, o"
+ "bjversion)\n_p('// !$*UTF8*$!')\n_p('{')\n_p(1,'archiveVersion = 1;')\n_p(1,'classes = {')\n_p(1,'};')\n_p(1,'objectVersion = %d;', objversion)\n_p(1,'objects = {')\n_p('')\nend\nfunction xcode.PBXBuildFile(tr)\nlocal function gatherCopyFiles(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\ntable.insertflat(copyfiles, tt[2])\nend\nend\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal function gatherCopyFrameworks(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\ntable.insertflat(copyfiles, targets)\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal copyfiles = table.flatten({\ngatherCopyFiles('xcodecopyresources'),\ngatherCopyFrameworks('xcodecopyframeworks')\n})\n_p('/* Begin PBXBuildFile section */')\ntree.traverse(tr, {\nonnode = function(node)\nif node.buildid then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',\nno"
+ "de.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)\nend\nif table.icontains(copyfiles, node.name) then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; %s };',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFiles', node.id, node.name,\niif(xcode.isframework(node.name), \"settings = {ATTRIBUTES = (CodeSignOnCopy, ); };\", \"\")\n)\nend\nend\n})\n_p('/* End PBXBuildFile section */')\n_p('')\nend\nfunction xcode.PBXContainerItemProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXContainerItemProxy section */')\nfor _, node in ipairs(tr.projects.children) do\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.productproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 2;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\n_p(2,'%s /* PBXContainerItemProxy */ = {', node"
+ ".targetproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 1;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\nend\n_p('/* End PBXContainerItemProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXFileReference(tr,prj)\n_p('/* Begin PBXFileReference section */')\ntree.traverse(tr, {\nonleaf = function(node)\nif not node.path then\nreturn\nend\nif node.kind == \"product\" then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = \"%s\"; path = \"%s\"; sourceTree = BUILT_PRODUCTS_DIR; };',\nnode.id, node.name, xcode.gettargettype(node), node.name, path.getname(node.cfg.buildtarget.bundlepath))\nelseif node.parent.parent == tr.projects then\nlocal relpath = path.getrelative(tr.project.location, node.parent.project.location)\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastK"
+ "nownFileType = \"wrapper.pb-project\"; name = \"%s\"; path = \"%s\"; sourceTree = SOURCE_ROOT; };',\nnode.parent.id, node.parent.name, node.parent.name, path.join(relpath, node.parent.name))\nelse\nlocal pth, src\nif xcode.isframework(node.path) then\nlocal nodePath = node.path\nlocal _, matchEnd, variable = string.find(nodePath, \"^%$%((.+)%)/\")\nif variable then\nnodePath = string.sub(nodePath, matchEnd + 1)\nend\nif string.find(nodePath,'/') then\nif string.find(nodePath,'^%.')then\nnodePath = path.getabsolute(path.join(tr.project.location, nodePath))\nend\npth = nodePath\nelseif path.getextension(nodePath)=='.tbd' then\npth = \"/usr/lib/\" .. nodePath\nelse\npth = \"/System/Library/Frameworks/\" .. nodePath\nend\nif variable then\nsrc = variable\nif string.find(pth, '^/') then\npth = string.sub(pth, 2)\nend\nelse\nsrc = \"<absolute>\"\nend\nelse\nsrc = \"<group>\"\nif node.location then\npth = node.location\nelseif node.parent.isvpath then\npth = node.cfg.name\nelse\npth = tree.getlocalpath(node)\nend\ne"
+ "nd\nif (not prj.options.ForceCPP) then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletype(node), node.name, pth, src)\nelse\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletypeForced(node), node.name, pth, src)\nend\nend\nend\n})\n_p('/* End PBXFileReference section */')\n_p('')\nend\nfunction xcode.PBXFrameworksBuildPhase(tr)\n_p('/* Begin PBXFrameworksBuildPhase section */')\n_p(2,'%s /* Frameworks */ = {', tr.products.children[1].fxstageid)\n_p(3,'isa = PBXFrameworksBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr.frameworks, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\n_"
+ "p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\n_p('/* End PBXFrameworksBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXGroup(tr)\n_p('/* Begin PBXGroup section */')\ntree.traverse(tr, {\nonnode = function(node)\nif (node.path and #node.children == 0) or node.kind == \"vgroup\" then\nreturn\nend\nif node.parent == tr.projects then\n_p(2,'%s /* Products */ = {', node.productgroupid)\nelse\n_p(2,'%s /* %s */ = {', node.id, node.name)\nend\n_p(3,'isa = PBXGroup;')\n_p(3,'children = (')\nfor _, childnode in ipairs(node.children) do\n_p(4,'%s /* %s */,', childnode.id, childnode.name)\nend\n_p(3,');')\nif node.parent == tr.projects then\n_p(3,'name = Products;')\nelse\n_p(3,'name = \"%s\";', node.name)\nif node.location then\n_p(3,'path = \"%s\";', node.location)\nelseif node.path and not node.isvpath then\nlocal p = node.path\nif node.parent.path then\np = path.getrelative(node.parent.path, node.path)\nend\n_p(3,'path = \"%s\";', p)\nend\nend\n_p(3,'sourceTree = \"<group>\";')\n_p(2,"
+ "'};')\nend\n}, true)\n_p('/* End PBXGroup section */')\n_p('')\nend\nfunction xcode.PBXNativeTarget(tr)\n_p('/* Begin PBXNativeTarget section */')\nfor _, node in ipairs(tr.products.children) do\nlocal name = tr.project.name\nlocal function hasBuildCommands(which)\nif #tr.project[which] > 0 then\nreturn true\nend\nfor _, cfg in ipairs(tr.configs) do\nif #cfg[which] > 0 then\nreturn true\nend\nend\nend\nlocal function dobuildblock(id, label, which, action)\nif hasBuildCommands(which) then\nlocal commandcount = 0\nfor _, cfg in ipairs(tr.configs) do\ncommandcount = commandcount + #cfg[which]\nend\nif commandcount > 0 then\naction(id, label)\nend\nend\nend\nlocal function doscriptphases(which, action)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = cfg[which]\nif cfgcmds ~= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal label = xcode.getscriptphaselabel(cmd, i, cfg)\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1"
+ "\nend\nend\nend\nend\nend\nlocal function docopyresources(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1\nend\nend\nend\nend\nend\nlocal function docopyframeworks(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\naction(id, label)\nend\nend\nend\nlocal function _p_label(id, label)\n_p(4, '%s /* %s */,', id, label)\nend\n_p(2,'%s /* %s */ = {', node.targetid, name)\n_p(3,'isa = PBXNativeTarget;')\n_p(3,'buildConfigurationList = %s /* Build configuration list for PBXNativeTarget \"%s\" */;', node.cfgsection, name)\n_p(3,'buildPhases = (')\ndobuildblock('9607AE1010C857E500CD1376', 'Prebuild', 'prebuildcommands', _p_label)\n_p(4,'%s /* Resources *"
+ "/,', node.resstageid)\n_p(4,'%s /* Sources */,', node.sourcesid)\ndobuildblock('9607AE3510C85E7E00CD1376', 'Prelink', 'prelinkcommands', _p_label)\n_p(4,'%s /* Frameworks */,', node.fxstageid)\ndobuildblock('9607AE3710C85E8F00CD1376', 'Postbuild', 'postbuildcommands', _p_label)\ndoscriptphases(\"xcodescriptphases\", _p_label)\ndocopyresources(\"xcodecopyresources\", _p_label)\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\", _p_label)\nend\n_p(3,');')\n_p(3,'buildRules = (')\n_p(3,');')\n_p(3,'dependencies = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'%s /* PBXTargetDependency */,', node.targetdependid)\nend\n_p(3,');')\n_p(3,'name = \"%s\";', name)\nlocal p\nif node.cfg.kind == \"ConsoleApp\" then\np = \"$(HOME)/bin\"\nelseif node.cfg.kind == \"WindowedApp\" then\np = \"$(HOME)/Applications\"\nend\nif p then\n_p(3,'productInstallPath = \"%s\";', p)\nend\n_p(3,'productName = \"%s\";', name)\n_p(3,'productReference = %s /* %s */;', node.id, node.name)\n_p(3,'p"
+ "roductType = \"%s\";', xcode.getproducttype(node))\n_p(2,'};')\nend\n_p('/* End PBXNativeTarget section */')\n_p('')\nend\nfunction xcode.PBXProject(tr, compatVersion)\n_p('/* Begin PBXProject section */')\n_p(2,'__RootObject_ /* Project object */ = {')\n_p(3,'isa = PBXProject;')\n_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */;', tr.name)\n_p(3,'compatibilityVersion = \"Xcode %s\";', compatVersion)\n_p(3,'hasScannedForEncodings = 1;')\n_p(3,'mainGroup = %s /* %s */;', tr.id, tr.name)\n_p(3,'projectDirPath = \"\";')\nif #tr.projects.children > 0 then\n_p(3,'projectReferences = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'{')\n_p(5,'ProductGroup = %s /* Products */;', node.productgroupid)\n_p(5,'ProjectRef = %s /* %s */;', node.id, path.getname(node.path))\n_p(4,'},')\nend\n_p(3,');')\nend\n_p(3,'projectRoot = \"\";')\n_p(3,'targets = (')\nfor _, node in ipairs(tr.products.children) do\n_p(4,'%s /* %s */,', node.targetid, node.name)\nend"
+ "\n_p(3,');')\n_p(2,'};')\n_p('/* End PBXProject section */')\n_p('')\nend\nfunction xcode.PBXReferenceProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXReferenceProxy section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXReferenceProxy;')\n_p(3,'fileType = %s;', xcode.gettargettype(node))\n_p(3,'path = \"%s\";', node.path)\n_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)\n_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')\n_p(2,'};')\nend\n})\n_p('/* End PBXReferenceProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXResourcesBuildPhase(tr)\n_p('/* Begin PBXResourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Resources */ = {', target.resstageid)\n_p(3,'isa = PBXResourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonnode = function(node)\nif xcode.getbuildcategory(node) == \"Resources\" then\n_p(4,'%s /* %s "
+ "in Resources */,', node.buildid, node.name)\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXResourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXShellScriptBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, commands, files)\nif commands ~= nil then\ncommands = table.flatten(commands)\nend\nif #commands > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXShellScriptBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXShellScriptBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\n_p(3,');')\n_p(3,'inputPaths = (');\nif files ~= nil then\nfiles = table.flatten(files)\nif #files > 0 then\nfor _, file in ipairs(files) do\n_p(4, '\"%s\",', file)\nend\nend\nend\n_p(3,');');\n_p(3,'name = %s;', name);\n_p(3,'outputPaths = (');\n_p(3,');');\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(3,'shellPath = /bin/sh;');\n_p(3,'shellScript = \"%s\";',"
+ " table.concat(commands, \"\\\\n\"):gsub('\"', '\\\\\"'))\n_p(2,'};')\nend\nend\nlocal function wrapcommands(cmds, cfg)\nlocal commands = {}\nif #cmds > 0 then\ntable.insert(commands, 'if [ \"${CONFIGURATION}\" = \"' .. xcode.getconfigname(cfg) .. '\" ]; then')\nfor i = 1, #cmds do\nlocal cmd = cmds[i]\ncmd = cmd:gsub('\\\\','\\\\\\\\')\ntable.insert(commands, cmd)\nend\ntable.insert(commands, 'fi')\nend\nreturn commands\nend\nlocal function dobuildblock(id, name, which)\nlocal commands = {}\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = wrapcommands(cfg[which], cfg)\nif #cfgcmds > 0 then\nfor i, cmd in ipairs(cfgcmds) do\ntable.insert(commands, cmd)\nend\nend\nend\ndoblock(id, name, commands)\nend\nlocal function doscriptphases(which)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = cfg[which]\nif cfgcmds ~= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal files = script[2]\nlocal label = xcode.getscriptphaselabel(cmd,"
+ " i, cfg)\nlocal id = xcode.uuid(label)\ndoblock(id, label, wrapcommands({cmd}, cfg), files)\ni = i + 1\nend\nend\nend\nend\nend\ndobuildblock(\"9607AE1010C857E500CD1376\", \"Prebuild\", \"prebuildcommands\")\ndobuildblock(\"9607AE3510C85E7E00CD1376\", \"Prelink\", \"prelinkcommands\")\ndobuildblock(\"9607AE3710C85E8F00CD1376\", \"Postbuild\", \"postbuildcommands\")\ndoscriptphases(\"xcodescriptphases\")\nif wrapperWritten then\n_p('/* End PBXShellScriptBuildPhase section */')\nend\nend\nfunction xcode.PBXSourcesBuildPhase(tr,prj)\n_p('/* Begin PBXSourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Sources */ = {', target.sourcesid)\n_p(3,'isa = PBXSourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonleaf = function(node)\nif xcode.getbuildcategory(node) == \"Sources\" then\nif not table.icontains(prj.excludes, node.cfg.name) then -- if not excluded\n_p(4,'%s /* %s in Sources */,', node.buildid, node.name)\nend\nend\nend"
+ "\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXSourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXCopyFilesBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, folderSpec, path, files)\nif #files > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXCopyFilesBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXCopyFilesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'dstPath = \\\"%s\\\";', path)\n_p(3,'dstSubfolderSpec = \\\"%s\\\";', folderSpec)\n_p(3,'files = (')\ntree.traverse(tr, {\nonleaf = function(node)\nif table.icontains(files, node.name) then\n_p(4,'%s /* %s in %s */,',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFiles')\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(2,'};')\nend\nend\nlocal function docopyresources(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in i"
+ "pairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(tt[2]), path.getname)\ndoblock(id, label, 7, tt[1], files)\ni = i + 1\nend\nend\nend\nend\nlocal function docopyframeworks(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(targets), path.getname)\ndoblock(id, label, 10, \"\", files)\nend\nend\ndocopyresources(\"xcodecopyresources\")\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\")\nend\nif wrapperWritten then\n_p('/* End PBXCopyFilesBuildPhase section */')\nend\nend\nfunction xcode.PBXVariantGroup(tr)\n_p('/* Begin PBXVariantGroup section */')\ntree.traverse(tr, {\nonbranch = function(node)\nif node.kind == \"vgroup\" then\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXVariantGroup;')\n_p(3,'children = (')"
+ "\nfor _, lang in ipairs(node.children) do\n_p(4,'%s /* %s */,', lang.id, lang.name)\nend\n_p(3,');')\n_p(3,'name = %s;', node.name)\n_p(3,'sourceTree = \"<group>\";')\n_p(2,'};')\nend\nend\n})\n_p('/* End PBXVariantGroup section */')\n_p('')\nend\nfunction xcode.PBXTargetDependency(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXTargetDependency section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)\n_p(3,'isa = PBXTargetDependency;')\n_p(3,'name = \"%s\";', node.name)\n_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)\n_p(2,'};')\nend\n})\n_p('/* End PBXTargetDependency section */')\n_p('')\nend\nend\nfunction xcode.cfg_excluded_files(prj, cfg)\nlocal excluded = {}\nlocal function exclude_pattern(file)\nif path.isabsolute(file) then\nreturn file\nend\nlocal start, term = file:findlast(\"/%.%./\")\nif term then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nstart, term = file:find(\"%.%"
+ "./\")\nif start == 1 then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nreturn path.join(\"*\", file)\nend\nlocal function add_file(file)\nlocal name = exclude_pattern(file)\nif not table.icontains(excluded, name) then\ntable.insert(excluded, name)\nend\nend\nlocal function verify_file(file)\nlocal name = exclude_pattern(file)\nif table.icontains(excluded, name) then\nerror(\"'\" .. file .. \"' would be excluded by the rule to exclude '\" .. name .. \"'\")\nend\nend\nfor _, file in ipairs(cfg.excludes) do\nadd_file(file)\nend\nfor _, file in ipairs(prj.allfiles) do\nif not table.icontains(prj.excludes, file) and not table.icontains(cfg.excludes, file) then\nif not table.icontains(cfg.files, file) then\nadd_file(file)\nelse\nverify_file(file)\nend\nend\nend\ntable.sort(excluded)\nreturn excluded\nend\nfunction xcode.XCBuildConfiguration_Impl(tr, id, opts, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s */ = {', id, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n_p(3,'buildSettings = {')\nfor"
+ " k, v in table.sortedpairs(opts) do\nif type(v) == \"table\" then\nif #v > 0 then\n_p(4,'%s = (', k)\nfor i, v2 in ipairs(v) do\n_p(5,'%s,', xcode.quotestr(tostring(v2)))\nend\n_p(4,');')\nend\nelse\n_p(4,'%s = %s;', k, xcode.quotestr(tostring(v)))\nend\nend\n_p(3,'};')\n_p(3,'name = %s;', xcode.quotestr(cfgname))\n_p(2,'};')\nend\nlocal function add_options(options, extras)\nfor _, tbl in ipairs(extras) do\nfor tkey, tval in pairs(tbl) do\noptions[tkey] = tval\nend\nend\nend\nlocal function add_wholearchive_links(opts, cfg)\nif #cfg.wholearchive > 0 then\nlocal linkopts = {}\nfor _, depcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nif table.icontains(cfg.wholearchive, depcfg.project.name) then\nlocal linkpath = path.rebase(depcfg.linktarget.fullpath, depcfg.location, cfg.location)\ntable.insert(linkopts, \"-force_load\")\ntable.insert(linkopts, linkpath)\nend\nend\nif opts.OTHER_LDFLAGS then\nlinkopts = table.join(linkopts, opts.OTHER_LDFLAGS)\nend\nopts.OTHER_LDFLAGS = linkopts\nend\nend"
+ "\nfunction xcode.XCBuildConfiguration(tr, prj, opts)\n_p('/* Begin XCBuildConfiguration section */')\nfor _, target in ipairs(tr.products.children) do\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.ontarget(tr, target, cfg)\nadd_options(values, cfg.xcodetargetopts)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.targetid, values, cfg)\nend\nend\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.onproject(tr, prj, cfg)\nadd_options(values, cfg.xcodeprojectopts)\nadd_wholearchive_links(values, cfg)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.projectid, values, cfg)\nend\n_p('/* End XCBuildConfiguration section */')\n_p('')\nend\nfunction xcode.XCBuildConfigurationList(tr)\nlocal sln = tr.project.solution\n_p('/* Begin XCConfigurationList section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {', target.cfgsection, target.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs"
+ "(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\nend\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {', tr.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\n_p('/* End XCConfigurationList section */')\n_p('')\nend\nfunction xcode.versionge(version, reference)\nlocal vparts = string.explode(version, \".\", true)\nlocal rparts = string.explode(reference, \".\", true)\nfor i=1,#rparts do\nlocal rnum = tonumber(rparts[i]) or 0\nlocal vnum = tonumber(vparts[i]) or 0\nif vnum < rnum then\nreturn false\nend\nend"
+ "\nreturn true\nend\nfunction xcode.Footer()\n_p(1,'};')\n_p('\\trootObject = __RootObject_ /* Project object */;')\n_p('}')\nend\n",
/* actions/xcode/xcode_project.lua */
"local xcode = premake.xcode\nlocal tree = premake.tree\nfunction xcode.buildprjtree(prj)\nlocal tr = premake.project.buildsourcetree(prj, true)\ntr.configs = {}\nfor _, cfgname in ipairs(prj.solution.configurations) do\nfor _, platform in ipairs(prj.solution.xcode.platforms) do\nlocal cfg = premake.getconfig(prj, cfgname, platform)\ncfg.xcode = {}\ncfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, \"tgt:\"..platform..cfgname)\ncfg.xcode.projectid = xcode.newid(tr, \"prj:\"..platform..cfgname)\ntable.insert(tr.configs, cfg)\nend\nend\ntree.traverse(tr, {\nonbranch = function(node)\nif path.getextension(node.name) == \".lproj\" then\nlocal lang = path.getbasename(node.name) -- \"English\", \"French\", etc.\nfor _, filenode in ipairs(node.children) do\nlocal grpnode = node.parent.children[filenode.name]\nif not grpnode then\ngrpnode = tree.insert(node.parent, tree.new(filenode.name))\ngrpnode.kind = \"vgroup\"\nend\nfilenode.name = path.getbasename(lang)\ntree.insert(grpnode, filenode)\nend\ntree.remove(no"
@@ -426,49 +440,41 @@ const char* builtin_scripts[] = {
/* actions/xcode/xcode8.lua */
"local premake = premake\npremake.xcode8 = { }\nlocal xcode = premake.xcode\nlocal xcode8 = premake.xcode8\nfunction xcode8.XCBuildConfiguration_Target(tr, target, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\nlocal installpaths = {\nConsoleApp = \"/usr/local/bin\",\nWindowedApp = \"$(HOME)/Applications\",\nSharedLib = \"/usr/local/lib\",\nStaticLib = \"/usr/local/lib\",\nBundle = \"$(LOCAL_LIBRARY_DIR)/Bundles\",\n}\nlocal options = {\nALWAYS_SEARCH_USER_PATHS = \"NO\",\nGCC_DYNAMIC_NO_PIC = \"NO\",\nGCC_MODEL_TUNING = \"G5\",\nINSTALL_PATH = installpaths[cfg.kind],\nPRODUCT_NAME = cfg.buildtarget.basename,\n}\nif not cfg.flags.Symbols then\noptions.DEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\"\nend\nif cfg.kind ~= \"StaticLib\" and cfg.buildtarget.prefix ~= \"\" then\noptions.EXECUTABLE_PREFIX = cfg.buildtarget.prefix\nend\nif cfg.targetextension then\nlocal ext = cfg.targetextension\noptions.EXECUTABLE_EXTENSION = iif(ext:startswith(\".\"), ext:sub(2), ext)\nend\nif cfg.flags.ObjcARC then\noptions.CLA"
- "NG_ENABLE_OBJC_ARC = \"YES\"\nend\nlocal outdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif outdir ~= \".\" then\noptions.CONFIGURATION_BUILD_DIR = outdir\nend\nif tr.infoplist then\noptions.INFOPLIST_FILE = tr.infoplist.cfg.name\nend\nlocal infoplist_file = nil\nfor _, v in ipairs(cfg.files) do\nif (string.find (string.lower (v), 'info.plist') ~= nil) then\ninfoplist_file = string.format('$(SRCROOT)/%s', v)\nend\nend\nif infoplist_file ~= nil then\noptions.INFOPLIST_FILE = infoplist_file\nend\nlocal action = premake.action.current()\nlocal get_opt = function(opt, def)\nreturn (opt and #opt > 0) and opt or def\nend\nlocal iosversion = get_opt(cfg.iostargetplatformversion, action.xcode.iOSTargetPlatformVersion)\nlocal macosversion = get_opt(cfg.macostargetplatformversion, action.xcode.macOSTargetPlatformVersion)\nlocal tvosversion = get_opt(cfg.tvostargetplatformversion, action.xcode.tvOSTargetPlatformVersion)\nif iosversion then\noptions.IPHONEOS_DEPLOYMENT_TARGET = iosversion\nelseif macosversion then"
- "\noptions.MACOSX_DEPLOYMENT_TARGET = macosversion\nelseif tvosversion then\noptions.TVOS_DEPLOYMENT_TARGET = tvosversion\nend\nif cfg.kind == \"Bundle\" and not cfg.options.SkipBundling then\noptions.PRODUCT_BUNDLE_IDENTIFIER = \"genie.\" .. cfg.buildtarget.basename:gsub(\"%s+\", \".\") --replace spaces with .\nlocal ext = cfg.targetextension\nif ext then\noptions.WRAPPER_EXTENSION = iif(ext:startswith(\".\"), ext:sub(2), ext)\nelse\noptions.WRAPPER_EXTENSION = \"bundle\"\nend\nend\nreturn options\nend\nfunction xcode8.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\nlocal archs = {\nNative = nil,\nx32 = \"i386\",\nx64 = \"x86_64\",\nUniversal32 = \"$(ARCHS_STANDARD_32_BIT)\",\nUniversal64 = \"$(ARCHS_STANDARD_64_BIT)\",\nUniversal = \"$(ARCHS_STANDARD_32_64_BIT)\",\n}\nlocal checks = {\n[\"-ffast-math\"] = cfg.flags.FloatFast,\n[\"-ffloat-store\"] = cfg.flags.FloatStrict,\n[\"-fomit-frame-pointer\"] = cfg.flags.NoFramePointer,\n}\nloc"
- "al cflags = { }\nfor flag, check in pairs(checks) do\nif check then\ntable.insert(cflags, flag)\nend\nend\nlocal ldflags = { }\nfor _, lib in ipairs(premake.getlinks(cfg, \"system\")) do\nif not xcode.isframework(lib) then\ntable.insert(ldflags, \"-l\" .. lib)\nend\nend\nlocal options = {\nARCHS = archs[cfg.platform],\nCLANG_WARN__DUPLICATE_METHOD_MATCH = \"YES\",\nCLANG_WARN_BOOL_CONVERSION = \"YES\",\nCLANG_WARN_CONSTANT_CONVERSION = \"YES\",\nCLANG_WARN_EMPTY_BODY = \"YES\",\nCLANG_WARN_ENUM_CONVERSION = \"YES\",\nCLANG_WARN_INFINITE_RECURSION = \"YES\",\nCLANG_WARN_INT_CONVERSION = \"YES\",\nCLANG_WARN_SUSPICIOUS_MOVE = \"YES\",\nCLANG_WARN_UNREACHABLE_CODE = \"YES\",\nCONFIGURATION_TEMP_DIR = \"$(OBJROOT)\",\nENABLE_STRICT_OBJC_MSGSEND = \"YES\",\nENABLE_TESTABILITY = \"YES\",\nGCC_C_LANGUAGE_STANDARD = \"gnu99\",\nGCC_NO_COMMON_BLOCKS = \"YES\",\nGCC_PREP"
- "ROCESSOR_DEFINITIONS = cfg.defines,\nGCC_SYMBOLS_PRIVATE_EXTERN = \"NO\",\nGCC_WARN_64_TO_32_BIT_CONVERSION = \"YES\",\nGCC_WARN_ABOUT_RETURN_TYPE = \"YES\",\nGCC_WARN_UNDECLARED_SELECTOR = \"YES\",\nGCC_WARN_UNINITIALIZED_AUTOS = \"YES\",\nGCC_WARN_UNUSED_FUNCTION = \"YES\",\nGCC_WARN_UNUSED_VARIABLE = \"YES\",\nHEADER_SEARCH_PATHS = table.join(cfg.includedirs, cfg.systemincludedirs),\nLIBRARY_SEARCH_PATHS = cfg.libdirs,\nOBJROOT = cfg.objectsdir,\nONLY_ACTIVE_ARCH = \"YES\",\nOTHER_CFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_c),\nOTHER_CPLUSPLUSFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_cpp),\nOTHER_LDFLAGS = table.join(ldflags, cfg.linkoptions),\nSDKROOT = xcode.toolset,\nUSER_HEADER_SEARCH_PATHS = cfg.userincludedirs,\n}\nif tr.entitlements then\nop"
- "tions.CODE_SIGN_ENTITLEMENTS = tr.entitlements.cfg.name\nend\nlocal targetdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif targetdir ~= \".\" then\noptions.CONFIGURATION_BUILD_DIR = \"$(SYMROOT)\"\noptions.SYMROOT = targetdir\nend\nif cfg.flags.Symbols then\noptions.COPY_PHASE_STRIP = \"NO\"\nend\nlocal excluded = xcode.cfg_excluded_files(prj, cfg)\nif #excluded > 0 then\noptions.EXCLUDED_SOURCE_FILE_NAMES = excluded\nend\nif cfg.flags.NoExceptions then\noptions.GCC_ENABLE_CPP_EXCEPTIONS = \"NO\"\nend\nif cfg.flags.NoRTTI then\noptions.GCC_ENABLE_CPP_RTTI = \"NO\"\nend\nif cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\noptions.GCC_ENABLE_FIX_AND_CONTINUE = \"YES\"\nend\nif cfg.flags.NoExceptions then\noptions.GCC_ENABLE_OBJC_EXCEPTIONS = \"NO\"\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize then\noptions.GCC_OPTIMIZATION_LEVEL = \"s\"\nelseif cfg.flags.OptimizeSpeed then\noptions.GCC_OPTIMIZATION_LEVEL = 3\nelse\noptions.GCC_OPTIMIZATION_LEVEL = 0\nend\nif cfg.pchheader and not cfg.f"
- "lags.NoPCH then\noptions.GCC_PRECOMPILE_PREFIX_HEADER = \"YES\"\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\noptions.GCC_PREFIX_HEADER = pch\nend\nif cfg.flags.FatalWarnings then\noptions.GCC_TREAT_WARNINGS_AS_ERRORS = \"YES\"\nend\nif cfg.kind == \"Bundle\" then\noptions.MACH_O_TYPE = \"mh_bundle\"\nend\nif cfg.flags.StaticRuntime then\noptions.STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = \"static\"\nend\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\noptions.WARNING_CFLAGS = \"-Wall\"\nend\nif cfg.flags.Cpp11 then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++11\"\nelseif cfg.flags.Cpp14 or cfg.flags.CppLatest then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++14\"\nelseif cfg.flags.Cpp17 then\nif premake.action.current() == premake.action.get(\"xcode8\") then\nerror(\"X"
- "Code8 does not support C++17.\")\nend\nend\nfor _, val in ipairs(premake.xcode.parameters) do\nlocal eqpos = string.find(val, \"=\")\nif eqpos ~= nil then\nlocal key = string.trim(string.sub(val, 1, eqpos - 1))\nlocal value = string.trim(string.sub(val, eqpos + 1))\noptions[key] = value\nend\nend\nreturn options\nend\nfunction xcode8.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode8.XCBuildConfiguration_Target,\nonproject = xcode8.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Foote"
- "r(tr)\nend\nnewaction\n{\ntrigger = \"xcode8\",\nshortname = \"Xcode 8\",\ndescription = \"Generate Apple Xcode 8 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode8.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/"
- "xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n",
+ "NG_ENABLE_OBJC_ARC = \"YES\"\nend\nlocal outdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif outdir ~= \".\" then\noptions.CONFIGURATION_BUILD_DIR = outdir\nend\nif tr.infoplist then\noptions.INFOPLIST_FILE = tr.infoplist.cfg.name\nend\nlocal infoplist_file = nil\nfor _, v in ipairs(cfg.files) do\nif (string.find (string.lower (v), 'info.plist') ~= nil) then\ninfoplist_file = string.format('$(SRCROOT)/%s', v)\nend\nend\nif infoplist_file ~= nil then\noptions.INFOPLIST_FILE = infoplist_file\nend\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nif cfg.kind == \"Bundle\" and not cfg.options.SkipBundling then\noptions.PRODUCT_BUNDLE_IDENTIFIER = \"genie.\" .. cfg.buildtarget.basename:gsub(\"%s+\", \".\") --replace spaces with .\nlocal ext = cfg.targetextension\nif ext then\noptions.WRAPPER_EXTENSION = iif(ext:startswith(\".\"), ext:sub(2), ext)\nelse\noptions.WRAPPER_EXTENSION = \"bundle\"\nend\nend\nreturn options\nend\nfunction xcode8.XCBuildConfiguration_Pr"
+ "oject(tr, prj, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\nlocal archs = {\nNative = nil,\nx32 = \"i386\",\nx64 = \"x86_64\",\nUniversal32 = \"$(ARCHS_STANDARD_32_BIT)\",\nUniversal64 = \"$(ARCHS_STANDARD_64_BIT)\",\nUniversal = \"$(ARCHS_STANDARD_32_64_BIT)\",\n}\nlocal checks = {\n[\"-ffast-math\"] = cfg.flags.FloatFast,\n[\"-ffloat-store\"] = cfg.flags.FloatStrict,\n[\"-fomit-frame-pointer\"] = cfg.flags.NoFramePointer,\n}\nlocal cflags = { }\nfor flag, check in pairs(checks) do\nif check then\ntable.insert(cflags, flag)\nend\nend\nlocal ldflags = { }\nfor _, lib in ipairs(premake.getlinks(cfg, \"system\")) do\nif not xcode.isframework(lib) then\ntable.insert(ldflags, \"-l\" .. lib)\nend\nend\nlocal options = {\nARCHS = archs[cfg.platform],\nCLANG_WARN__DUPLICATE_METHOD_MATCH = \"YES\",\nCLANG_WARN_BOOL_CONVERSION = \"YES\",\nCLANG_WARN_CONSTANT_CONVERSION = \"YES\",\nCLANG_WARN_EMPTY_BODY = \"YES\",\nCLANG_WARN"
+ "_ENUM_CONVERSION = \"YES\",\nCLANG_WARN_INFINITE_RECURSION = \"YES\",\nCLANG_WARN_INT_CONVERSION = \"YES\",\nCLANG_WARN_SUSPICIOUS_MOVE = \"YES\",\nCLANG_WARN_UNREACHABLE_CODE = \"YES\",\nCONFIGURATION_TEMP_DIR = \"$(OBJROOT)\",\nENABLE_STRICT_OBJC_MSGSEND = \"YES\",\nENABLE_TESTABILITY = \"YES\",\nGCC_C_LANGUAGE_STANDARD = \"gnu99\",\nGCC_NO_COMMON_BLOCKS = \"YES\",\nGCC_PREPROCESSOR_DEFINITIONS = cfg.defines,\nGCC_SYMBOLS_PRIVATE_EXTERN = \"NO\",\nGCC_WARN_64_TO_32_BIT_CONVERSION = \"YES\",\nGCC_WARN_ABOUT_RETURN_TYPE = \"YES\",\nGCC_WARN_UNDECLARED_SELECTOR = \"YES\",\nGCC_WARN_UNINITIALIZED_AUTOS = \"YES\",\nGCC_WARN_UNUSED_FUNCTION = \"YES\",\nGCC_WARN_UNUSED_VARIABLE = \"YES\",\nHEADER_SEARCH_PATHS = table.join(cfg.includedirs, cfg.systemincludedirs),\nLIBRARY_SEARCH_PATHS = cfg.libdirs,\nOBJROOT ="
+ " cfg.objectsdir,\nONLY_ACTIVE_ARCH = \"YES\",\nOTHER_CFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_c),\nOTHER_CPLUSPLUSFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_cpp),\nOTHER_LDFLAGS = table.join(ldflags, cfg.linkoptions),\nSDKROOT = xcode.toolset,\nUSER_HEADER_SEARCH_PATHS = cfg.userincludedirs,\n}\nif tr.entitlements then\noptions.CODE_SIGN_ENTITLEMENTS = tr.entitlements.cfg.name\nend\nlocal targetdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif targetdir ~= \".\" then\noptions.CONFIGURATION_BUILD_DIR = \"$(SYMROOT)\"\noptions.SYMROOT = targetdir\nend\nif cfg.flags.Symbols then\noptions.COPY_PHASE_STRIP = \"NO\"\nend\nlocal excluded = xcode.cfg_excluded_files(prj, cfg)\nif #excluded > 0 then\noptions.EXCLUDED_SOURCE_FILE_NAMES = excluded\nend\nif cfg.flags.NoExceptions then\noptions.GCC_ENABLE_CPP_EXCEPTIONS = \"NO\"\nend\nif cfg.flags.NoRTTI then\noptions"
+ ".GCC_ENABLE_CPP_RTTI = \"NO\"\nend\nif cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\noptions.GCC_ENABLE_FIX_AND_CONTINUE = \"YES\"\nend\nif cfg.flags.NoExceptions then\noptions.GCC_ENABLE_OBJC_EXCEPTIONS = \"NO\"\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize then\noptions.GCC_OPTIMIZATION_LEVEL = \"s\"\nelseif cfg.flags.OptimizeSpeed then\noptions.GCC_OPTIMIZATION_LEVEL = 3\nelse\noptions.GCC_OPTIMIZATION_LEVEL = 0\nend\nif cfg.pchheader and not cfg.flags.NoPCH then\noptions.GCC_PRECOMPILE_PREFIX_HEADER = \"YES\"\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\noptions.GCC_PREFIX_HEADER = pch\nend\nif cfg.flags.FatalWarnings then\noptions.GCC_TREAT_WARNINGS_AS_ERRORS = \"YES\"\nend\nif cfg.kind == \"Bundle\" then\noptions.MACH_O_TYPE = \"mh_bundle\"\nend\nif"
+ " cfg.flags.StaticRuntime then\noptions.STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = \"static\"\nend\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\noptions.WARNING_CFLAGS = \"-Wall\"\nend\nif cfg.flags.Cpp11 then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++11\"\nelseif cfg.flags.Cpp14 or cfg.flags.CppLatest then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++14\"\nelseif cfg.flags.Cpp17 then\nif premake.action.current() == premake.action.get(\"xcode8\") then\nerror(\"XCode8 does not support C++17.\")\nend\nend\nfor _, val in ipairs(premake.xcode.parameters) do\nlocal eqpos = string.find(val, \"=\")\nif eqpos ~= nil then\nlocal key = string.trim(string.sub(val, 1, eqpos - 1))\nlocal value = string.trim(string.sub(val, eqpos + 1))\noptions[key] = value\nend\nend\nreturn options\nend\nfunction xcode8.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(t"
+ "r)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode8.XCBuildConfiguration_Target,\nonproject = xcode8.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode8\",\nshortname = \"Xcode 8\",\ndescription = \"Generate Apple Xcode 8 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(s"
+ "ln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode8.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n",
/* actions/xcode/xcode9.lua */
- "local premake = premake\npremake.xcode9 = { }\nlocal xcode = premake.xcode\nlocal xcode8 = premake.xcode8\nlocal xcode9 = premake.xcode9\nfunction xcode9.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode8.XCBuildConfiguration_Project(tr, prj, cfg)\nif cfg.flags.Cpp17 or cfg.flags.CppLatest then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++17\"\nend\nreturn table.merge(options, {\nCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = \"YES\",\nCLANG_WARN_COMMA = \"YES\",\nCLANG_WARN_NON_LITERAL_NULL_CONVERSION = \"YES\",\nCLANG_WARN_OBJC_LITERAL_CONVERSION = \"YES\",\nCLANG_WARN_RANGE_LOOP_ANALYSIS = \"YES\",\nCLANG_WARN_STRICT_PROTOTYPES = \"YES\",\n})\nend\nfunction xcode9.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxc"
- "ode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode8.XCBuildConfiguration_Target,\nonproject = xcode9.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode9\",\nshortname = \"Xcode 9\",\ndescription = \"Generate Apple Xcode 9 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.x"
- "cworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode9.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n",
+ "local premake = premake\npremake.xcode9 = { }\nlocal xcode = premake.xcode\nlocal xcode8 = premake.xcode8\nlocal xcode9 = premake.xcode9\nfunction xcode9.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode8.XCBuildConfiguration_Project(tr, prj, cfg)\nif cfg.flags.Cpp17 then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++17\"\nelseif cfg.flags.Cpp20 or cfg.flags.CppLatest then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++20\"\nend\nreturn table.merge(options, {\nCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = \"YES\",\nCLANG_WARN_COMMA = \"YES\",\nCLANG_WARN_NON_LITERAL_NULL_CONVERSION = \"YES\",\nCLANG_WARN_OBJC_LITERAL_CONVERSION = \"YES\",\nCLANG_WARN_RANGE_LOOP_ANALYSIS = \"YES\",\nCLANG_WARN_STRICT_PROTOTYPES = \"YES\",\n})\nend\nfunction xcode9.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(t"
+ "r, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode8.XCBuildConfiguration_Target,\nonproject = xcode9.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode9\",\nshortname = \"Xcode 9\",\ndescription = \"Generate Apple Xcode 9 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/conte"
+ "nts.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode9.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n",
/* actions/xcode/xcode10.lua */
"local premake = premake\npremake.xcode10 = { }\nlocal xcode = premake.xcode\nlocal xcode8 = premake.xcode8\nlocal xcode9 = premake.xcode9\nlocal xcode10 = premake.xcode10\nfunction xcode10.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode9.XCBuildConfiguration_Project(tr, prj, cfg)\nreturn table.merge(options, {\nCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = \"YES\",\nCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = \"YES\",\nCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = \"YES\",\nCLANG_WARN_COMMA = \"YES\",\nCLANG_WARN_NON_LITERAL_NULL_CONVERSION = \"YES\",\nCLANG_WARN_OBJC_LITERAL_CONVERSION = \"YES\",\nCLANG_WARN_RANGE_LOOP_ANALYSIS = \"YES\",\nCLANG_WARN_STRICT_PROTOTYPES = \"YES\",\n})\nend\nfunction xcode10.XCBuildConfiguration_Target(tr, target, cfg)\nlocal options = xcode8.XCBuildConfiguration_Target(tr, target, cfg)\nif not cfg.flags.ObjcARC then\noptions.CLANG_ENABLE_OBJC_WEAK = \"YES\"\nend\nreturn options\nend\nfunction xcode10.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)"
- "\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode10.XCBuildConfiguration_Target,\nonproject = xcode10.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode10\",\nshortname = \"Xcode 10\",\ndescription = \"Generate Apple Xcode 10 project files (experimental)\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {"
- "\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode10.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n",
-
- /* actions/fastbuild/_fastbuild.lua */
- "premake.fastbuild = { }\nlocal fastbuild = premake.fastbuild\nnewaction\n{\ntrigger = \"vs2015-fastbuild\",\nshortname = \"FASTBuild VS2015\",\ndescription = \"Generate FASTBuild configuration files for Visual Studio 2015.\",\nvalid_kinds = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\",\n\"Bundle\",\n},\nvalid_languages = {\n\"C\",\n\"C++\"\n},\nvalid_tools = {\ncc = {\n\"msc\"\n},\n},\nonsolution = function(sln)\npremake.generate(sln, \"fbuild.bff\", premake.fastbuild.solution)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.bff\", premake.fastbuild.project)\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, \"fbuild.bff\")\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, \"%%.bff\")\nend,\n}\n",
-
- /* actions/fastbuild/fastbuild_project.lua */
- "-- Generates a FASTBuild config file for a project.\nlocal function add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nlocal function compile(indentlevel, prj, cfg, commonbasepath)\nlocal firstflag = true\nfor _, cfgexclude in ipairs(cfg.excludes) do\nif path.issourcefile(cfgexclude) then\nif firstflag then\n_p(indentlevel, '// Excluded files:')\nfirstflag = false\nend\n_p(indentlevel, \".CompilerInputFiles - '%s'\", cfgexclude)\nend\nend\nif not firstflag then\n_p('')\nend\n_p(indentlevel, \".CompilerOutputPath = '%s'\", add_trailing_backslash(cfg.objectsdir))\n_p(indentlevel, \".Defines = ''\")\nfor _, define in ipairs(cfg.defines) do\n_p(indentlevel+1, \"+ ' /D%s'\", define)\nend\nif cfg.kind == 'SharedLib' then\n_p(indentlevel+1, \"+ ' /D_WINDLL'\")\nend\n_p(indentlevel, \".IncludeDirs = ''\")\nlocal sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nlocal function getpathnodecount(p)\nlocal nodef"
- "inder = string.gmatch(p, \"[^\\\\/]+\")\nlocal result = 0\nlocal node = nodefinder()\nwhile node do\nresult = result + ((node ~= '.' and 1) or 0)\nnode = nodefinder()\nend\nreturn result\nend\nlocal stepsfrombase = {}\nfor _, includedir in ipairs(sortedincdirs) do\nstepsfrombase[includedir] = getpathnodecount(path.getrelative(commonbasepath, includedir))\nend\nlocal function includesort(a, b)\nif stepsfrombase[a] == stepsfrombase[b] then\nreturn a < b\nelse\nreturn stepsfrombase[a] < stepsfrombase[b]\nend\nend\ntable.sort(sortedincdirs, includesort)\nfor _, includedir in ipairs(sortedincdirs) do\n_p(indentlevel+1, \"+ ' /I\\\"%s\\\"'\", includedir)\nend\n_p(indentlevel+1, \"+ .MSVCIncludes\")\nlocal compileroptions = {\n'\"%1\"',\n'/nologo',\n'/c',\n'/Gm-',\n'/Zc:inline',\n'/errorReport:prompt',\n'/FS',\n}\nif cfg.options.ForceCPP then\ntable.insert(compileroptions, '/TP')\nend\nif cfg.flags.PedanticWarnings\nor cfg.flags.ExtraWarnings\nthen\ntable.insert(compileroptions, '/W4')\nend\nif (cfg.flags.NativeWChar"
- " == false or\ncfg.flags.NoNativeWChar) then\ntable.insert(compileroptions, '/Zc:wchar_t-')\nend\nif (cfg.flags.EnableMinimalRebuild or\ncfg.flags.NoMultiProcessorCompilation) then\nend\nif cfg.flags.FloatFast then\ntable.insert(compileroptions, '/fp:fast')\nelseif cfg.flags.FloatStrict then\ntable.insert(compileroptions, '/fp:strict')\nelse\ntable.insert(compileroptions, '/fp:precise')\nend\nif cfg.flags.FastCall then\ntable.insert(compileroptions, '/Gr')\nelseif cfg.flags.StdCall then\ntable.insert(compileroptions, '/Gd')\nend\nif cfg.flags.UnsignedChar then\ntable.insert(compileroptions, '/J')\nend\nif premake.config.isdebugbuild(cfg) then\nif cfg.flags.StaticRuntime then\ntable.insert(compileroptions, '/MTd')\nelse\ntable.insert(compileroptions, '/MDd')\nend\nelse\nif cfg.flags.StaticRuntime then\ntable.insert(compileroptions, '/MT')\nelse\ntable.insert(compileroptions, '/MD')\nend\nend\nif cfg.flags.Symbols then\nif (cfg.flags.C7DebugInfo) then\ntable.insert(compileroptions, '/Z7')\nelse\nif premake.config"
- ".iseditandcontinue(cfg) then\ntable.insert(compileroptions, '/ZI')\nelse\ntable.insert(compileroptions, '/Zi')\nend\nlocal targetdir = add_trailing_backslash(cfg.buildtarget.directory)\ntable.insert(compileroptions, string.format(\"/Fd\\\"%s%s.pdb\\\"\", targetdir, cfg.buildtarget.basename))\nend\nend\nlocal isoptimised = true\nif (cfg.flags.Optimize) then\ntable.insert(compileroptions, '/Ox')\nelseif (cfg.flags.OptimizeSize) then\ntable.insert(compileroptions, '/O1')\nelseif (cfg.flags.OptimizeSpeed) then\ntable.insert(compileroptions, '/O2')\nelse\nisoptimised = false\nend\nif isoptimised then\nif cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then\ntable.insert(compileroptions, '/GF-')\ntable.insert(compileroptions, '/Gy-')\nelse\ntable.insert(compileroptions, '/GF')\ntable.insert(compileroptions, '/Gy')\nend\nelse\ntable.insert(compileroptions, '/Gy')\ntable.insert(compileroptions, '/Od')\ntable.insert(compileroptions, '/RTC1')\nend\nif cfg.flags.FatalWarnings then\ntable.insert(compileroptions, "
- "'/WX')\nelse\ntable.insert(compileroptions, '/WX-')\nend\nif cfg.platform == 'x32' then\nif cfg.flags.EnableSSE2 then\ntable.insert(compileroptions, '/arch:SSE2')\nelseif cfg.flags.EnableSSE then\ntable.insert(compileroptions, '/arch:SSE')\nend\nend\nif cfg.flags.NoExceptions then\nelse\nif cfg.flags.SEH then\ntable.insert(compileroptions, '/EHa')\nelse\ntable.insert(compileroptions, '/EHsc')\nend\nend\nif cfg.flags.NoRTTI then\ntable.insert(compileroptions, '/GR-')\nelse\ntable.insert(compileroptions, '/GR')\nend\nif cfg.flags.NoFramePointer then\ntable.insert(compileroptions, '/Oy-')\nelse\ntable.insert(compileroptions, '/Oy')\nend\nfor _, addloption in ipairs(cfg.buildoptions) do\ntable.insert(compileroptions, addloption)\nend\n_p(indentlevel, \".CompilerOptions = ''\")\nfor _, option in ipairs(compileroptions) do\n_p(indentlevel+1, \"+ ' %s'\", option)\nend\n_p(indentlevel+1, \"+ .IncludeDirs\")\n_p(indentlevel+1, \"+ .Defines\")\nif not cfg.flags.NoPCH and cfg.pchheader then\n_p(indentlevel, \".CompilerIn"
- "putFiles - '%s'\", cfg.pchsource)\n_p(indentlevel, \".PCHInputFile = '%s'\", cfg.pchsource)\n_p(indentlevel, \".PCHOutputFile = .CompilerOutputPath + '%s.pch'\", prj.name)\n_p(indentlevel, \".CompilerOptions + ' /Fp\\\"' + .CompilerOutputPath + '%s.pch\\\"'\", prj.name)\n_p(indentlevel, \".PCHOptions = .CompilerOptions\")\n_p(indentlevel+1, \"+ ' /Yc\\\"%s\\\"'\", cfg.pchheader)\n_p(indentlevel+1, \"+ ' /Fo\\\"%%3\\\"'\")\n_p(indentlevel, \".CompilerOptions + ' /Yu\\\"%s\\\"'\", cfg.pchheader)\nend\n_p(indentlevel+1, \"+ ' /Fo\\\"%%2\\\"'\") -- make sure the previous property is .CompilerOptions\nend\nlocal function library(prj, cfg, useconfig, commonbasepath)\n_p(1, \"Library('%s-%s-%s')\", prj.name, cfg.name, cfg.platform)\n_p(1, '{')\nuseconfig(2)\ncompile(2, prj, cfg, commonbasepath)\nlocal librarianoptions = {\n'\"%1\"',\n'/OUT:\"%2\"',\n'/NOLOGO',\n}\nif cfg.platform == 'x64' then\ntable.insert(librarianoptions, '/MACHINE:X64')\nelse\ntable.insert(librarianoptions, '/MACHINE:X86')\nend\n_p(2, \".Libraria"
- "nOptions = ''\")\nfor _, option in ipairs(librarianoptions) do\n_p(3, \"+ ' %s'\", option)\nend\n_p(2, \".LibrarianOutput = '%s'\", cfg.buildtarget.fullpath)\n_p(1, '}')\n_p('')\nend\nlocal function binary(prj, cfg, useconfig, bintype, commonbasepath)\n_p(1, \"ObjectList('%s_obj-%s-%s')\", prj.name, cfg.name, cfg.platform)\n_p(1, '{')\nuseconfig(2)\ncompile(2, prj, cfg, commonbasepath)\n_p(1, '}')\n_p('')\n_p(1, \"%s('%s-%s-%s')\", bintype, prj.name, cfg.name, cfg.platform)\n_p(1, '{')\nuseconfig(2)\n_p(2, '.Libraries = {')\n_p(3, \"'%s_obj-%s-%s',\", prj.name, cfg.name, cfg.platform) -- Refer to the ObjectList\nlocal sorteddeplibs = {}\nfor _, deplib in ipairs(premake.getlinks(cfg, \"dependencies\", \"basename\")) do\ntable.insert(sorteddeplibs, string.format(\"'%s-%s-%s',\", deplib, cfg.name, cfg.platform))\nend\ntable.sort(sorteddeplibs)\nfor _, deplib in ipairs(sorteddeplibs) do\n_p(3, deplib)\nend\n_p(3, '}')\n_p(2, '.LinkerLinkObjects = false')\nlocal linkeroptions = {\n'\"%1\"',\n'/OUT:\"%2\"',\n'/NOLOG"
- "O',\n'/errorReport:prompt',\n}\nlocal subsystemversion = '\",5.02\"'\nif cfg.platform == 'x32' then\nsubsystemversion = '\",5.01\"'\nend\nif cfg.kind == 'ConsoleApp' then\ntable.insert(linkeroptions, '/SUBSYSTEM:CONSOLE'..subsystemversion)\nelse\ntable.insert(linkeroptions, '/SUBSYSTEM:WINDOWS'..subsystemversion)\nend\nif cfg.kind == 'SharedLib' then\ntable.insert(linkeroptions, '/DLL')\nend\nif cfg.platform == 'x64' then\ntable.insert(linkeroptions, '/MACHINE:X64')\nelse\ntable.insert(linkeroptions, '/MACHINE:X86')\nend\nfor _, libdir in ipairs(cfg.libdirs) do\ntable.insert(linkeroptions, string.format('/LIBPATH:%s', path.translate(libdir, '\\\\')))\nend\nif not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then\nif cfg.flags.Unicode then\ntable.insert(linkeroptions, '/ENTRY:wmainCRTStartup')\nelse\ntable.insert(linkeroptions, '/ENTRY:mainCRTStartup')\nend\nend\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\ntable.insert(linkeroptions, '/DEF:%s', deffile)\nen"
- "d\nif (cfg.flags.Symbols ~= nil) then\ntable.insert(linkeroptions, '/DEBUG')\nend\nif premake.config.islinkeroptimizedbuild(cfg.flags) then\ntable.insert(linkeroptions, '/OPT:REF')\ntable.insert(linkeroptions, '/OPT:ICF')\nend\ntable.insert(linkeroptions, '/INCREMENTAL'..((premake.config.isincrementallink(cfg) and '') or ':NO'))\nfor _, addloption in ipairs(cfg.linkoptions) do\ntable.insert(linkeroptions, addloption)\nend\nlocal linklibs = premake.getlinks(cfg, \"all\", \"fullpath\")\nfor _, linklib in ipairs(linklibs) do\ntable.insert(linkeroptions, path.getname(linklib))\nend\ntable.sort(linkeroptions)\n_p(2, \".LinkerOptions = ''\")\nfor _, option in ipairs(linkeroptions) do\n_p(3, \"+ ' %s'\", option)\nend\n_p(3, \"+ .MSVCLibPaths\")\n_p(2, \".LinkerOutput = '%s'\", cfg.buildtarget.fullpath)\n_p(1, '}')\n_p('')\nend\nlocal function executable(prj, cfg, useconfig, commonbasepath)\nbinary(prj, cfg, useconfig, 'Executable', commonbasepath)\nend\nlocal function dll(prj, cfg, useconfig, commonbasepath)\nbinary("
- "prj, cfg, useconfig, 'DLL', commonbasepath)\nend\nlocal function alias(prj, cfg, target)\n_p(1, \"Alias('%s-%s-%s')\", prj.name, cfg.name, cfg.platform)\n_p(1, '{')\n_p(2, \".Targets = '%s'\", target)\n_p(1, '}')\n_p('')\nend\nfunction premake.fastbuild.project(prj)\nio.indent = ' '\n_p('// FASTBuild project configuration file autogenerated by GENie.')\n_p('')\n_p('{')\nlocal cppfiles = {}\nfor file in premake.project.eachfile(prj) do\nif path.issourcefile(file.name) then\ntable.insert(cppfiles, file.name)\nend\nend\nlocal commonbasepath = cppfiles[1]\nfor _, file in ipairs(cppfiles) do\ncommonbasepath = path.getcommonbasedir(commonbasepath..'/', file)\nend\n_p(1, \".CompilerInputFilesRoot = '%s/'\", commonbasepath)\n_p(1, '.CompilerInputFiles = {')\nfor _, file in ipairs(cppfiles) do\n_p(2, \"'%s',\", file)\nend\n_p(1, '}')\n_p('')\nlocal targetkindmap = {\nConsoleApp = executable,\nWindowedApp = executable,\nSharedLib = dll,\nStaticLib = library,\n}\nlocal useconfigmap = {\nx32 = function(indentlevel)\n_p"
- "(indentlevel, 'Using(.MSVCx86Config)')\n_p('')\nend,\nx64 = function(indentlevel)\n_p(indentlevel, 'Using(.MSVCx64Config)')\n_p('')\nend,\n}\nlocal nativeplatform = (os.is64bit() and 'x64') or 'x32'\nfor _, platform in ipairs(prj.solution.platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nif cfg.platform == 'Native' then\nalias(prj, cfg, string.format('%s-%s-%s', prj.name, cfg.name, nativeplatform))\nelse\ntargetkindmap[prj.kind](prj, cfg, useconfigmap[cfg.platform], commonbasepath)\nend\nend\nend\n_p('}')\nend\n",
-
- /* actions/fastbuild/fastbuild_solution.lua */
- "-- Generates a FASTBuild config file for a solution.\nfunction premake.fastbuild.solution(sln)\nio.indent = ' '\n_p('// FastBuild solution configuration file. Generated by GENie.')\n_p('//------------------------------------------------------------------------------------')\n_p('// %s', sln.name)\n_p('//------------------------------------------------------------------------------------')\n_p('#import VS140COMNTOOLS')\nlocal is64bit = os.is64bit()\nlocal target64 = (is64bit and ' amd64') or ' x86_amd64'\nlocal target32 = (is64bit and ' amd64_x86') or ''\nlocal getvcvarscontent = [[\n@set INCLUDE=\n@set LIB=\n@set CommandPromptType=\n@set PreferredToolArchitecture=\n@set Platform=\n@set Path=%SystemRoot%\\System32;%SystemRoot%;%SystemRoot%\\System32\\wbem\n@call \"%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat\" %1\n@echo %INCLUDE%\n@echo %LIB%\n@echo %CommandPromptType%\n@echo %PreferredToolArchitecture%\n@echo %Platform%\n@echo %Path%\n]]\nlocal getvcvarsfilepath = os.getenv('TEMP')..'\\\\getvcvars.bat'\nlocal"
- " getvcvarsfile = assert(io.open(getvcvarsfilepath, 'w'))\ngetvcvarsfile:write(getvcvarscontent)\ngetvcvarsfile:close()\nlocal vcvarsrawx86 = os.outputof(string.format('call \"%s\"%s', getvcvarsfilepath, target32))\nlocal vcvarsrawx64 = os.outputof(string.format('call \"%s\"%s', getvcvarsfilepath, target64))\nos.remove(getvcvarsfilepath)\nlocal msvcvars = {}\nmsvcvars.x32 = {}\nmsvcvars.x64 = {}\nlocal includeslibssplitter = string.gmatch(vcvarsrawx64, \"[^\\n]+\")\nmsvcvars.x64.includesraw = includeslibssplitter()\nmsvcvars.x64.libpathsraw = includeslibssplitter()\nmsvcvars.x64.commandprompttype = includeslibssplitter()\nmsvcvars.x64.preferredtoolarchitecture = includeslibssplitter()\nmsvcvars.x64.platform = includeslibssplitter()\nmsvcvars.x64.pathraw = includeslibssplitter()\nincludeslibssplitter = string.gmatch(vcvarsrawx86, \"[^\\n]+\")\nmsvcvars.x32.includesraw = includeslibssplitter()\nmsvcvars.x32.libpathsraw = includeslibssplitter()\nmsvcvars.x32.commandprompttype = includeslibssplitter()\nmsvcvars.x32"
- ".preferredtoolarchitecture = includeslibssplitter()\nmsvcvars.x32.platform = includeslibssplitter()\nmsvcvars.x32.pathraw = includeslibssplitter()\nlocal function printincludes(includesraw)\n_p(1, \".MSVCIncludes = ''\")\nfor i in string.gmatch(includesraw, \"[^;]+\") do\n_p(2, \"+ ' /I\\\"%s\\\"'\", i)\nend\nend\nlocal function printlibpaths(libpathsraw)\n_p(1, \".MSVCLibPaths = ''\")\nfor i in string.gmatch(libpathsraw, \"[^;]+\") do\n_p(2, \"+ ' /LIBPATH:\\\"%s\\\"'\", i)\nend\nend\nif is64bit then\n_p('.MSVCx64Config =')\n_p('[')\n_p(1, \".Compiler = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64\\\\cl.exe'\")\n_p(1, \".Librarian = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64\\\\lib.exe'\")\n_p(1, \".Linker = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64\\\\link.exe'\")\nprintincludes(msvcvars.x64.includesraw)\nprintlibpaths(msvcvars.x64.libpathsraw)\n_p(']')\n_p('')\n_p('.MSVCx86Config =')\n_p('[')\n_p(1, \".Compiler = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64_x86\\\\cl.exe'\")\n_p(1, \"."
- "Librarian = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64_x86\\\\lib.exe'\")\n_p(1, \".Linker = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64_x86\\\\link.exe'\")\nprintincludes(msvcvars.x32.includesraw)\nprintlibpaths(msvcvars.x32.libpathsraw)\n_p(']')\n_p('')\nelse\n_p('.MSVCx64Config =')\n_p('[')\n_p(1, \".Compiler = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\x86_amd64\\\\cl.exe'\")\n_p(1, \".Librarian = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\x86_amd64\\\\lib.exe'\")\n_p(1, \".Linker = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\x86_amd64\\\\link.exe'\")\nprintincludes(msvcvars.x64.includesraw)\nprintlibpaths(msvcvars.x64.libpathsraw)\n_p(']')\n_p('')\n_p('.MSVCx86Config =')\n_p('[')\n_p(1, \".Compiler = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\cl.exe'\")\n_p(1, \".Librarian = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\lib.exe'\")\n_p(1, \".Linker = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\link.exe'\")\nprintincludes(msvcvars.x32.includesraw)\nprintlibpaths(msvcvars.x32.libpathsraw)\n_p(']')"
- "\n_p('')\nend\nlocal msvcbin = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin' .. ((is64bit and '\\\\amd64') or '')\n_p('#import Path')\n_p('#import TMP')\n_p('#import SystemRoot')\n_p('')\n_p('Settings')\n_p('{')\n_p(1, '.Environment = {')\n_p(2, \"'Path=%s;$Path$',\", msvcbin)\n_p(2, \"'TMP=$TMP$',\")\n_p(2, \"'SystemRoot=$SystemRoot$',\")\n_p(2, '}')\n_p('}')\n_p('')\nlocal function projkindsort(a, b)\nlocal projvaluemap = {\nConsoleApp = 3,\nWindowedApp = 3,\nSharedLib = 2,\nStaticLib = 1,\n}\nif projvaluemap[a.kind] == projvaluemap[b.kind] then\nreturn a.name < b.name\nelse\nreturn projvaluemap[a.kind] < projvaluemap[b.kind]\nend\nend\nlocal sortedprojs = {}\nfor prj in premake.solution.eachproject(sln) do\ntable.insert(sortedprojs, prj)\nend\ntable.sort(sortedprojs, projkindsort)\nfor _, prj in ipairs(sortedprojs) do\nlocal fname = premake.project.getbasename(prj.name, '%%.bff')\nfname = path.join(prj.location, fname)\nfname = path.getrelative(sln.location, fname)\n_p('#include \"%s\"', fname)\nend\n_p('')"
- "\n_p('.ProjectVariants = {')\nfor _, plat in ipairs(sln.platforms) do\nfor _, cfg in ipairs(sln.configurations) do\n_p(1, \"'%s-%s',\", cfg, plat)\nend\nend\n_p('}')\n_p('')\n_p('ForEach(.Variant in .ProjectVariants)')\n_p('{')\n_p(1, \"Alias('all-$Variant$')\")\n_p(1, '{')\n_p(2, '.Targets = {')\nfor _, prj in ipairs(sortedprojs) do\n_p(3, \"'%s-$Variant$',\", prj.name)\nend\n_p(2, '}')\n_p(1, '}')\n_p('}')\nend\n",
+ "\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode10.XCBuildConfiguration_Target,\nonproject = xcode10.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode10\",\nshortname = \"Xcode 10\",\ndescription = \"Generate Apple Xcode 10 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Nat"
+ "ive\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode10.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n",
+
+ /* actions/xcode/xcode11.lua */
+ "local premake = premake\npremake.xcode11 = { }\nlocal xcode = premake.xcode\nlocal xcode10 = premake.xcode10\nlocal xcode11 = premake.xcode11\nfunction xcode11.XCBuildConfiguration_Target(tr, target, cfg)\nlocal options = xcode10.XCBuildConfiguration_Target(tr, target, cfg)\noptions.CODE_SIGN_IDENTITY = \"-\"\nreturn options\nend\nfunction xcode11.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode11.XCBuildConfiguration_Target,\nonproject = xcode10.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList"
+ "(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode11\",\nshortname = \"Xcode 11\",\ndescription = \"Generate Apple Xcode 11 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = { Native = \"Native\" },\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode11.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.cl"
+ "ean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n",
+
+ /* actions/xcode/xcode14.lua */
+ "local premake = premake\npremake.xcode14 = { }\nlocal xcode = premake.xcode\nlocal xcode10 = premake.xcode10\nlocal xcode11 = premake.xcode11\nlocal xcode14 = premake.xcode14\nfunction xcode14.XCBuildConfiguration_Target(tr, target, cfg)\nlocal options = xcode11.XCBuildConfiguration_Target(tr, target, cfg)\noptions.CODE_SIGN_IDENTITY = \"-\"\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nlocal iosversion = options.IPHONEOS_DEPLOYMENT_TARGET\nlocal macosversion = options.MACOSX_DEPLOYMENT_TARGET\nlocal tvosversion = options.TVOS_DEPLOYMENT_TARGET\nif iosversion and not xcode.versionge(iosversion, \"11\") then\n error(\"XCode14 does not support deployment for iOS older than 11\")\nelseif macosversion and not xcode.versionge(macosversion, \"10.13\") then\n error(\"XCode14 does not support deployment for macOS older than 10.13\")\nelseif tvosversion and not xcode.versionge(tvosversion, \"11\") then\n error(\"XCode14 does not support deployment for tvOS older"
+ " than 11\")\nend\nreturn options\nend\nfunction xcode14.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode10.XCBuildConfiguration_Project(tr, prj, cfg)\noptions.ENABLE_BITCODE = \"NO\" -- Bitcode is now deprecated.\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nreturn options\nend\nfunction xcode14.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode14.XCBuildConfiguration_Target,\nonproject = xcode14.XCBuildConfiguration_Project,\n})\nxcode.XCBuildCon"
+ "figurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode14\",\nshortname = \"Xcode 14\",\ndescription = \"Generate Apple Xcode 14 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = { Native = \"Native\" },\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode14.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(pr"
+ "j)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n",
+
+ /* actions/xcode/xcode15.lua */
+ "local premake = premake\npremake.xcode15 = { }\nlocal xcode = premake.xcode\nlocal xcode10 = premake.xcode10\nlocal xcode11 = premake.xcode11\nlocal xcode14 = premake.xcode14\nlocal xcode15 = premake.xcode15\nfunction xcode15.XCBuildConfiguration_Target(tr, target, cfg)\nlocal options = xcode11.XCBuildConfiguration_Target(tr, target, cfg)\noptions.CODE_SIGN_IDENTITY = \"-\"\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nlocal iosversion = options.IPHONEOS_DEPLOYMENT_TARGET\nlocal macosversion = options.MACOSX_DEPLOYMENT_TARGET\nlocal tvosversion = options.TVOS_DEPLOYMENT_TARGET\nlocal xrosversion = options.XROS_DEPLOYMENT_TARGET\nif iosversion and not xcode.versionge(iosversion, \"12\") then\n error(\"XCode15 does not support deployment for iOS older than 12\")\nelseif macosversion and not xcode.versionge(macosversion, \"13.5\") then\n error(\"XCode15 does not support deployment for macOS older than 13.5\")\nelseif tvosversion and not xcode.versionge(tvosv"
+ "ersion, \"12\") then\n error(\"XCode15 does not support deployment for tvOS older than 12\")\nelseif xrosversion and not xcode.versionge(xrosversion, \"1.0\") then\n error(\"XCode15 does not support deployment for visionOS older than 1.0\")\nend\nreturn options\nend\nfunction xcode15.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode10.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nreturn options\nend\nfunction xcode15.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDepen"
+ "dency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode15.XCBuildConfiguration_Target,\nonproject = xcode15.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode15\",\nshortname = \"Xcode 15\",\ndescription = \"Generate Apple Xcode 15 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = { Native = \"Native\" },\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake."
+ "generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode14.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\nvisionOSTargetPlatformVersion = nil,\n},\n}\n",
/* actions/ninja/_ninja.lua */
"premake.ninja = { }\nlocal p = premake\nnewaction\n{\ntrigger = \"ninja\",\nshortname = \"ninja\",\ndescription = \"Generate Ninja build files\",\nmodule = \"ninja\",\nvalid_kinds = {\"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\"},\nvalid_languages = {\"C\", \"C++\", \"Swift\"},\nvalid_tools = {\ncc = { \"gcc\" },\nswift = { \"swift\" },\n},\nonsolution = function(sln)\nio.eol = \"\\r\\n\"\nio.indent = \"\\t\"\nio.escaper(p.ninja.esc)\np.generate(sln, \"Makefile\", p.ninja.generate_solution)\nio.indent = \" \"\np.ninja.generate_ninja_builds(sln)\nend,\nonproject = function(prj)\nio.eol = \"\\r\\n\"\nio.indent = \" \"\nio.escaper(p.ninja.esc)\np.ninja.generate_project(prj)\nend,\noncleansolution = function(sln)\nfor _,name in ipairs(sln.configurations) do\npremake.clean.file(sln, p.ninja.get_solution_name(sln, name))\nend\nend,\noncleanproject = function(prj)\nend,\noncleantarget = function(prj)\nend,\n}\n",
@@ -488,17 +494,17 @@ const char* builtin_scripts[] = {
/* actions/ninja/ninja_cpp.lua */
"premake.ninja.cpp = { }\nlocal ninja = premake.ninja\nlocal cpp = premake.ninja.cpp\nlocal p = premake\nlocal function wrap_ninja_cmd(c)\nif os.is(\"windows\") then\nreturn 'cmd /c \"' .. c .. '\"'\nelse\nreturn c\nend\nend\nfunction ninja.generate_cpp(prj)\nlocal pxy = ninja.get_proxy(\"prj\", prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in p.eachconfig(pxy, platform) do\np.generate(cfg, cfg:getprojectfilename(), function() cpp.generate_config(prj, cfg) end)\nend\nend\nend\nfunction cpp.generate_config(prj, cfg)\nlocal tool = premake.gettool(prj)\n_p('# Ninja build project file autogenerated by GENie')\n_p('# https://github.com/bkaradzic/GENie')\n_p(\"\")\n_p(\"ninja_required_version = 1.7\")\n_p(\"\")\nlocal flags = {\ndefines = ninja.list(tool.getdefines(cfg.defines)),\nincludes = ninja.list(table.join(tool.getincludedirs(cfg.includedirs), tool.getquoteincludedirs(cfg.us"
"erincludedirs), tool.getsystemincludedirs(cfg.systemincludedirs))),\ncppflags = ninja.list(tool.getcppflags(cfg)),\nasmflags = ninja.list(table.join(tool.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_asm)),\ncflags = ninja.list(table.join(tool.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)),\ncxxflags = ninja.list(table.join(tool.getcflags(cfg), tool.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)),\nobjcflags = ninja.list(table.join(tool.getcflags(cfg), tool.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)),\n}\n_p(\"\")\n_p(\"# core rules for \" .. cfg.name)\n_p(\"rule cc\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.cc .. \" $defines $includes $flags -MMD -MF $out.d -c -o $out $in\"))\n_p(\" description = cc $out\")\n_p(\" depfile = $out.d\")\n_p(\" deps = gcc\")\n_p(\"\")\n_p(\"rule cxx\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.cxx .. \" $defines $includes $flags -MMD -MF $out.d -c -o $out $in\"))\n_p(\" description = cxx $out\")\n_p(\" de"
- "pfile = $out.d\")\n_p(\" deps = gcc\")\n_p(\"\")\n_p(\"rule ar\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.ar .. \" $flags $out @$out.rsp \" .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\")))\n_p(\" description = ar $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = $in $libs\")\n_p(\"\")\nlocal link = iif(cfg.language == \"C\", tool.cc, tool.cxx)\n_p(\"rule link\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group'\nendgroup = '-Wl,--end-group'\nend\n_p(\" command = \" .. wrap_ninja_cmd(\"$pre_link \" .. link .. \" -o $out @$out.rsp $all_ldflags $post_build\"))\n_p(\" description = link $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = $all_outputfiles $walibs\" .. string.format(\"%s $libs %s\", startgroup, endgroup))\n_p(\"\")\n_p(\"rule exec\")\n_p(\" command = \" .. wrap_ninja_cmd(\"$command\"))\n"
- "_p(\" description = Run $type commands\")\n_p(\"\")\nif #cfg.prebuildcommands > 0 then\n_p(\"build __prebuildcommands_\" .. premake.esc(prj.name) .. \": exec\")\n_p(1, \"command = \" .. wrap_ninja_cmd(\"echo Running pre-build commands && \" .. table.implode(cfg.prebuildcommands, \"\", \"\", \" && \")))\n_p(1, \"type = pre-build\")\n_p(\"\")\nend\ncfg.pchheader_full = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, cfg.shortname, incdir))\nlocal testname = path.join(abspath, cfg.pchheader_full)\nif os.isfile(testname) then\ncfg.pchheader_full = path.getrelative(cfg.location, testname)\nbreak\nend\nend\ncpp.custombuildtask(prj, cfg)\ncpp.dependencyRules(prj, cfg)\ncpp.file_rules(prj, cfg, flags)\nlocal objfiles = {}\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\ntable.insert(objfiles, cpp.objectname(cfg, file))\nend\nend\n_p('')\ncpp.linker(prj, cfg, objfiles, tool, flags)\n_p(\"\")\nend\nfunction cpp.customb"
- "uildtask(prj, cfg)\nlocal cmd_index = 1\nlocal seen_commands = {}\nlocal command_by_name = {}\nlocal command_files = {}\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands_\" .. premake.esc(prj.name) or \"\"\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nfor _, cmd in ipairs(buildtask[4] or {}) do\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \", path.getrelative(cfg.location, depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, '%$%(<%)', '$in')\ncmd = string.gsub(cmd, '%$%(@%)', '$out')\nlocal cmd_name -- shortened command name\nif seen_commands[cmd] == nil then\nlocal _, _, name = string.find(cmd, '([.%w]+)%s')\nname = 'cmd' .. cmd_index .. '_' .. string.gsub(name, '[^%w]', '_')\nseen_commands[cmd] = {\nname = name,\nindex = cmd_index,\n}\ncmd_index = cmd_index + 1\ncmd_name = name\nelse\ncmd_name = seen_commands[cmd].name\ne"
- "nd\nlocal index = seen_commands[cmd].index\nif command_files[index] == nil then\ncommand_files[index] = {}\nend\nlocal cmd_set = command_files[index]\ntable.insert(cmd_set, {\nbuildtask[1],\nbuildtask[2],\nbuildtask[3],\nseen_commands[cmd].name,\n})\ncommand_files[index] = cmd_set\ncommand_by_name[cmd_name] = cmd\nend\nend\nend\n_p(\"# custom build rules\")\nfor command, details in pairs(seen_commands) do\n_p(\"rule \" .. details.name)\n_p(1, \"command = \" .. wrap_ninja_cmd(command))\nend\nfor cmd_index, cmdsets in ipairs(command_files) do\nfor _, cmdset in ipairs(cmdsets) do\nlocal file_in = path.getrelative(cfg.location, cmdset[1])\nlocal file_out = path.getrelative(cfg.location, cmdset[2])\nlocal deps = ''\nfor i, dep in ipairs(cmdset[3]) do\ndeps = deps .. path.getrelative(cfg.location, dep) .. ' '\nend\n_p(\"build \" .. file_out .. ': ' .. cmdset[4] .. ' ' .. file_in .. ' | ' .. deps .. prebuildsuffix)\n_p(\"\")\nend\nend\nend\nfunction cpp.dependencyRules(prj, cfg)\nlocal extra_deps = {}\nlocal order_de"
- "ps = {}\nlocal extra_flags = {}\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nlocal objfilename = cpp.objectname(cfg, path.getrelative(prj.location, dep[1]))\nlocal dependency = path.getrelative(cfg.location, dep[2])\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], dependency)\nend\nend\nlocal pchfilename = cfg.pchheader_full and cpp.pchname(cfg, cfg.pchheader_full) or ''\nfor _, file in ipairs(cfg.files) do\nlocal objfilename = file == cfg.pchheader and cpp.pchname(cfg, file) or cpp.objectname(cfg, file)\nif path.issourcefile(file) or file == cfg.pchheader then\nif #cfg.prebuildcommands > 0 then\nif order_deps[objfilename] == nil then\norder_deps[objfilename] = {}\nend\ntable.insert(order_deps[objfilename], '__prebuildcommands_' .. premake.esc(prj.name))\nend\nend\nif path.issourcefile(file) then\nif cfg.pchheader_full and not cfg.flags.NoPCH then\nlocal nopch = table.icontains(prj.nopch, file)"
- "\nif not nopch then\nlocal suffix = path.isobjcfile(file) and '_objc' or ''\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], pchfilename .. suffix .. \".gch\")\nif extra_flags[objfilename] == nil then\nextra_flags[objfilename] = {}\nend\ntable.insert(extra_flags[objfilename], '-include ' .. pchfilename .. suffix)\nend\nend\nend\nend\ncfg.extra_deps = extra_deps\ncfg.order_deps = order_deps\ncfg.extra_flags = extra_flags\nend\nfunction cpp.objectname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(path.removeext(file)) .. \".o\")\nend\nfunction cpp.pchname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(file))\nend\nfunction cpp.file_rules(prj,cfg, flags)\n_p(\"# build files\")\nfor _, file in ipairs(cfg.files) do\n_p(\"# FILE: \" .. file)\nif cfg.pchheader_full == file then\nlocal pchfilename = cpp.pchname(cfg, file)\nlocal extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[pchfilename] or {}, ' ') or ''\nl"
- "ocal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[pchfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[pchfilename] or {}, ' ') or ''\n_p(\"build \" .. pchfilename .. \".gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['cxxflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x c-header\", \"-x c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\n_p(\"build \" .. pchfilename .. \"_objc.gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['objcflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x objective-c-header\", \"-x objective-c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.issourcefile(file) then\nlocal objfilename = cpp.objectname(cfg, file)\nlocal extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[objfilename] or {}, ' ') or ''\nlo"
- "cal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[objfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[objfilename] or {}, ' ') or ''\nlocal cflags = \"cflags\"\nif path.isobjcfile(file) then\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"objcflags\"\nelseif path.isasmfile(file) then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\ncflags = \"asmflags\"\nelseif path.iscfile(file) and not cfg.options.ForceCPP then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\nelse\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"cxxflags\"\nend\n_p(1, \"flags = \" .. flags[cflags] .. extra_flags)\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.isresourcefile(file) then\nend\nend\n_p(\"\")\nend\nfunction cpp.linker(prj, cfg, objfiles, tool)\nloca"
- "l all_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions))\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands\" or \"\"\nlocal libs = {}\nlocal walibs = {}\nlocal lddeps = {}\nif #cfg.wholearchive > 0 then\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\ntable.insert(lddeps, linkpath)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\ntable.insert(walibs, table.concat(tool.wholearchive(linkpath), ' '))\nelse\ntable.insert(libs, linkpath)\nend\nend\nelse\nlddeps = premake.getlinks(cfg, \"siblings\", \"fullpath\")\nlibs = lddeps\nend\nlddeps = ninja.list(lddeps)\nlibs = ninja.list(libs) .. \" \" .. ninja.list(tool.getlinkflags(cfg))\nwalibs = ninja.list(walibs)\nlocal function writevars()\n_p(1, \"all_ldflags = \" .. all_ldflags)\n"
- "_p(1, \"libs = \" .. libs)\n_p(1, \"walibs = \" .. walibs)\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nif #cfg.prelinkcommands > 0 then\n_p(1, 'pre_link = echo Running pre-link commands && ' .. table.implode(cfg.prelinkcommands, \"\", \"\", \" && \") .. \" && \")\nend\nif #cfg.postbuildcommands > 0 then\n_p(1, 'post_build = && echo Running post-build commands && ' .. table.implode(cfg.postbuildcommands, \"\", \"\", \" && \"))\nend\nend\nif cfg.kind == \"StaticLib\" then\nlocal ar_flags = ninja.list(tool.getarchiveflags(cfg, cfg, false))\n_p(\"# link static lib\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": ar \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\n_p(1, \"flags = \" .. ninja.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nelseif cfg.kind == \"SharedLib\" or cfg.kind == \"Bundle\" then\nlocal output = cfg:getoutputfilename()\n_p(\"# link shared lib\")\n_p("
- "\"build \" .. output .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelseif (cfg.kind == \"ConsoleApp\") or (cfg.kind == \"WindowedApp\") then\n_p(\"# link executable\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelse\np.error(\"ninja action doesn't support this kind of target \" .. cfg.kind)\nend\nend\n",
+ "pfile = $out.d\")\n_p(\" deps = gcc\")\n_p(\"\")\nif cfg.flags.UseObjectResponseFile then\n_p(\"rule ar\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.ar .. \" $flags $out @$out.rsp \" .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\")))\n_p(\" description = ar $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = $in $libs\")\n_p(\"\")\nelse\n_p(\"rule ar\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.ar .. \" $flags $out $in $libs\" .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\")))\n_p(\" description = ar $out\")\n_p(\"\")\nend\nlocal link = iif(cfg.language == \"C\", tool.cc, tool.cxx)\n_p(\"rule link\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group'\nendgroup = '-Wl,--end-group'\nend\nlocal rspfile_content = \"$all_outputfiles $walibs \" .. string.format(\"%s $libs %s\", startgroup, en"
+ "dgroup)\nif cfg.flags.UseLDResponseFile then\n_p(\" command = \" .. wrap_ninja_cmd(\"$pre_link \" .. link .. \" -o $out @$out.rsp $all_ldflags $post_build\"))\n_p(\" description = link $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = %s\", rspfile_content)\n_p(\"\")\nelse\n_p(\" command = \" .. wrap_ninja_cmd(\"$pre_link \" .. link .. \" -o $out \" .. rspfile_content .. \" $all_ldflags $post_build\"))\n_p(\" description = link $out\")\n_p(\"\")\nend\n_p(\"rule exec\")\n_p(\" command = \" .. wrap_ninja_cmd(\"$command\"))\n_p(\" description = Run $type commands\")\n_p(\"\")\nif #cfg.prebuildcommands > 0 then\n_p(\"build __prebuildcommands_\" .. premake.esc(prj.name) .. \": exec\")\n_p(1, \"command = \" .. wrap_ninja_cmd(\"echo Running pre-build commands && \" .. table.implode(cfg.prebuildcommands, \"\", \"\", \" && \")))\n_p(1, \"type = pre-build\")\n_p(\"\")\nend\ncfg.pchheader_full = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal ab"
+ "spath = path.getabsolute(path.join(cfg.project.location, cfg.shortname, incdir))\nlocal testname = path.join(abspath, cfg.pchheader_full)\nif os.isfile(testname) then\ncfg.pchheader_full = path.getrelative(cfg.location, testname)\nbreak\nend\nend\ncpp.custombuildtask(prj, cfg)\ncpp.dependencyRules(prj, cfg)\ncpp.file_rules(prj, cfg, flags)\nlocal objfiles = {}\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\ntable.insert(objfiles, cpp.objectname(cfg, file))\nend\nend\n_p('')\ncpp.linker(prj, cfg, objfiles, tool, flags)\n_p(\"\")\nend\nfunction cpp.custombuildtask(prj, cfg)\nlocal cmd_index = 1\nlocal ninja_rules = {}\nlocal ninja_builds = {}\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands_\" .. premake.esc(prj.name) or \"\"\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal commands = {}\nfor _, cmd in ipairs(buildtask[4] or {}) do\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or"
+ " {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \", path.getrelative(cfg.location, depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, '%$%(<%)', '$in')\ncmd = string.gsub(cmd, '%$%(@%)', '$out')\ntable.insert(commands, cmd)\nend\nninja_rules[\"cmd_\" .. cmd_index] = commands\ntable.insert(ninja_builds, {\nfile_in = buildtask[1],\nfile_out = buildtask[2],\nrule = \"cmd_\" .. cmd_index,\ndeps = buildtask[3]\n})\ncmd_index = cmd_index + 1\nend\nend\n_p(\"# custom build rules\")\nfor rule, commands in pairs(ninja_rules) do\n_p(\"rule \" .. rule)\n_p(1, \"command = \" .. wrap_ninja_cmd(table.concat(commands, \" && \")))\nend\nfor i = 1,#ninja_builds do\nlocal build = ninja_builds[i]\nlocal deps = ''\nfor i, dep in ipairs(build.deps) do\ndeps = deps .. path.getrelative(cfg.location, dep) .. ' '\nend\n_p(\"build \" .. path.getrelative(cfg.location, build.file_out) .. ': ' .. build.rule .. ' ' .. path.getrelative(cfg.location, build.file_in) .. ' | ' .. deps .. prebuildsuffix)\n_p(\"\")"
+ "\nend\nend\nfunction cpp.dependencyRules(prj, cfg)\nlocal extra_deps = {}\nlocal order_deps = {}\nlocal extra_flags = {}\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nlocal objfilename = cpp.objectname(cfg, path.getrelative(prj.location, dep[1]))\nlocal dependency = path.getrelative(cfg.location, dep[2])\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], dependency)\nend\nend\nlocal pchfilename = cfg.pchheader_full and cpp.pchname(cfg, cfg.pchheader_full) or ''\nfor _, file in ipairs(cfg.files) do\nlocal objfilename = file == cfg.pchheader and cpp.pchname(cfg, file) or cpp.objectname(cfg, file)\nif path.issourcefile(file) or file == cfg.pchheader then\nif #cfg.prebuildcommands > 0 then\nif order_deps[objfilename] == nil then\norder_deps[objfilename] = {}\nend\ntable.insert(order_deps[objfilename], '__prebuildcommands_' .. premake.esc(prj.name))\nend\nend\nif path.issourcefile(file) then\nif cfg.pc"
+ "hheader_full and not cfg.flags.NoPCH then\nlocal nopch = table.icontains(prj.nopch, file)\nif not nopch then\nlocal suffix = path.isobjcfile(file) and '_objc' or ''\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], pchfilename .. suffix .. \".gch\")\nif extra_flags[objfilename] == nil then\nextra_flags[objfilename] = {}\nend\ntable.insert(extra_flags[objfilename], '-include ' .. pchfilename .. suffix)\nend\nend\nend\nend\ncfg.extra_deps = extra_deps\ncfg.order_deps = order_deps\ncfg.extra_flags = extra_flags\nend\nfunction cpp.objectname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(path.removeext(file)) .. \".o\")\nend\nfunction cpp.pchname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(file))\nend\nfunction cpp.file_rules(prj,cfg, flags)\n_p(\"# build files\")\nfor _, file in ipairs(cfg.files) do\n_p(\"# FILE: \" .. file)\nif cfg.pchheader_full == file then\nlocal pchfilename = cpp.pchname(cfg, file)\nlocal extra_deps = "
+ "#cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[pchfilename] or {}, ' ') or ''\nlocal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[pchfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[pchfilename] or {}, ' ') or ''\n_p(\"build \" .. pchfilename .. \".gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['cxxflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x c-header\", \"-x c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\n_p(\"build \" .. pchfilename .. \"_objc.gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['objcflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x objective-c-header\", \"-x objective-c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.issourcefile(file) then\nlocal objfilename = cpp.objectname(cfg, file)\nlocal extra_deps = #"
+ "cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[objfilename] or {}, ' ') or ''\nlocal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[objfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[objfilename] or {}, ' ') or ''\nlocal cflags = \"cflags\"\nif path.isobjcfile(file) then\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"objcflags\"\nelseif path.isasmfile(file) then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\ncflags = \"asmflags\"\nelseif path.iscfile(file) and not cfg.options.ForceCPP then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\nelse\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"cxxflags\"\nend\n_p(1, \"flags = \" .. flags[cflags] .. extra_flags)\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.isresourcefile"
+ "(file) then\nend\nend\n_p(\"\")\nend\nfunction cpp.linker(prj, cfg, objfiles, tool)\nlocal all_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions))\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and (\"||__prebuildcommands_\" .. premake.esc(prj.name)) or \"\"\nlocal libs = {}\nlocal walibs = {}\nlocal lddeps = {}\nif #cfg.wholearchive > 0 then\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\ntable.insert(lddeps, linkpath)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\ntable.insert(walibs, table.concat(tool.wholearchive(linkpath), ' '))\nelse\ntable.insert(libs, linkpath)\nend\nend\nelse\nlddeps = premake.getlinks(cfg, \"siblings\", \"fullpath\")\nlibs = lddeps\nend\nlddeps = ninja.list(lddeps)\nlibs = ninja.list(libs) .. \" \" .. ninja.list(tool.getlinkflags(cfg))\n"
+ "walibs = ninja.list(walibs)\nlocal function writevars()\n_p(1, \"all_ldflags = \" .. all_ldflags)\n_p(1, \"libs = \" .. libs)\n_p(1, \"walibs = \" .. walibs)\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nif #cfg.prelinkcommands > 0 then\n_p(1, 'pre_link = echo Running pre-link commands && ' .. table.implode(cfg.prelinkcommands, \"\", \"\", \" && \") .. \" && \")\nend\nif #cfg.postbuildcommands > 0 then\n_p(1, 'post_build = && echo Running post-build commands && ' .. table.implode(cfg.postbuildcommands, \"\", \"\", \" && \"))\nend\nend\nif cfg.kind == \"StaticLib\" then\nlocal ar_flags = ninja.list(tool.getarchiveflags(cfg, cfg, false))\n_p(\"# link static lib\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": ar \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\n_p(1, \"flags = \" .. ninja.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nelseif cfg.kind =="
+ " \"SharedLib\" or cfg.kind == \"Bundle\" then\nlocal output = cfg:getoutputfilename()\n_p(\"# link shared lib\")\n_p(\"build \" .. output .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelseif (cfg.kind == \"ConsoleApp\") or (cfg.kind == \"WindowedApp\") then\n_p(\"# link executable\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelse\np.error(\"ninja action doesn't support this kind of target \" .. cfg.kind)\nend\nend\n",
/* actions/ninja/ninja_swift.lua */
"local ninja = premake.ninja\nlocal swift = {}\nlocal p = premake\nfunction ninja.generate_swift(prj)\nlocal pxy = ninja.get_proxy(\"prj\", prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in p.eachconfig(pxy, platform) do\np.generate(cfg, cfg:getprojectfilename(), function() swift.generate_config(prj, cfg) end)\nend\nend\nend\nfunction swift.generate_config(prj, cfg)\nlocal tool = premake.gettool(prj)\nlocal flags = {\nswiftcflags = ninja.list(tool.getswiftcflags(cfg)),\nswiftlinkflags = ninja.list(tool.getswiftlinkflags(cfg)),\n}\n_p(\"# Swift project build file\")\n_p(\"# generated with GENie ninja\")\n_p(\"\")\n_p(\"ninja_required_version = 1.7\")\n_p(\"\")\n_p(\"out_dir = %s\", cfg.buildtarget.directory)\n_p(\"obj_dir = %s\", path.join(cfg.objectsdir, prj.name .. \".build\"))\n_p(\"target = $out_dir/%s\", cfg.buildtarget.name)\n_p(\"module_name = %s\", prj.name)\n_p(\"module_"
@@ -515,31 +521,14 @@ const char* builtin_scripts[] = {
"ags = \" .. all_ldflags)\n_p(1, \"libs = \" .. libs)\nend\nlocal objfiles, modfiles, docfiles = table.unpack(depfiles)\n_p(\"build $out_dir/$module_name.swiftmodule | $out_dir/$module_name.swiftdoc: swiftm %s | %s\", table.concat(modfiles, \" \"), table.concat(docfiles, \" \"))\n_p(\"\")\nlocal output = cfg:getoutputfilename()\nif cfg.kind == \"StaticLib\" then\nlocal ar_flags = ninja.list(tool.getarchiveflags(cfg, cfg, false))\n_p(\"build %s: ar %s | %s $out_dir/$module_name.swiftmodule $out_dir/$module_name.swiftdoc\", output, table.concat(objfiles, \" \"), lddeps)\n_p(1, \"flags = %s\", ninja.list(tool.getarchiveflags(cfg, cfg, false)))\nelseif cfg.kind == \"SharedLib\" then\n_p(\"build %s : swiftlink %s | %s $out_dir/$module_name.swiftmodule $out_dir/$module_name.swiftdoc\", output, table.concat(objfiles, \" \"), libs)\nwritevars()\nelseif (cfg.kind == \"ConsoleApp\") or (cfg.kind == \"WindowedApp\") then\n_p(\"build %s: swiftlink %s | %s $out_dir/$module_name.swiftmodule $out_dir/$module_name.swift"
"doc\", output, table.concat(objfiles, \" \"), lddeps)\nelse\np.error(\"ninja action doesn't support this kind of target \" .. cfg.kind)\nend\nend\n",
- /* actions/qbs/_qbs.lua */
- "premake.qbs = { }\nlocal qbs = premake.qbs\nnewaction\n{\ntrigger = \"qbs\",\nshortname = \"qbs\",\ndescription = \"Generate QBS build files\",\nmodule = \"qbs\",\nvalid_kinds = {\"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\"},\nvalid_languages = {\"C\", \"C++\"},\nvalid_tools = {\ncc = { \"gcc\", \"msc\" },\n},\nonsolution = function(sln)\nio.eol = \"\\n\"\nio.indent = \"\\t\"\nio.escaper(qbs.esc)\npremake.generate(sln, sln.name .. \".creator.qbs\", qbs.generate_solution)\nio.indent = \" \"\npremake.generate(sln, sln.name .. \".creator.qbs.user\", qbs.generate_user)\nend,\nonproject = function(prj)\nio.eol = \"\\n\"\nio.indent = \"\\t\"\nio.escaper(qbs.esc)\npremake.generate(prj, prj.name .. \".qbs\", qbs.generate_project)\nend,\n}\n",
-
- /* actions/qbs/qbs_base.lua */
- "function premake.qbs.list(indent, name, table)\nif #table > 0 then\n_p(indent, '%s: [', name)\nfor _, item in ipairs(table) do\n_p(indent+1, '\"%s\",', item:gsub('\"', '\\\\\"'))\nend\n_p(indent+1, ']')\nend\nend",
-
- /* actions/qbs/qbs_solution.lua */
- "local qbs = premake.qbs\nfunction qbs.generate_solution(sln)\n_p('/*')\n_p(' * QBS project file autogenerated by GENie')\n_p(' * https://github.com/bkaradzic/GENie')\n_p(' */')\n_p('')\n_p('import qbs')\n_p('')\n_p(0, 'Project {')\n_p(1, 'references: [')\nfor prj in premake.solution.eachproject(sln) do\n_p(2, '\"' .. prj.name .. '.qbs\",')\nend\n_p(1, ']')\n_p(0, '}')\nend\nlocal function is_app(kind)\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\nreturn true\nend\nreturn false\nend\nfunction qbs.generate_user(sln)\n_p(0, '<?xml version=\"1.0\" encoding=\"UTF-8\"?>')\n_p(0, '<!DOCTYPE QtCreatorProject>')\n_p(0, '<!-- QBS project file autogenerated by GENie https://github.com/bkaradzic/GENie -->')\n_p(0, '<qtcreator>')\nlocal startProject = 0\nlocal idx = 0\nfor prj in premake.solution.eachproject(sln) do\nif is_app(prj.kind) then\nif sln.startproject == prj.name then\nstartProject = idx\nend\nidx = idx + 1\nend\nend\n_p(1, '<data>')\n_p(2, '<variable>ProjectExplorer.Project.Target.0</variable>')\n"
- "_p(2, '<valuemap type=\"QVariantMap\">')\n_p(3, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DefaultDisplayName\">Desktop</value>')\n_p(3, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DisplayName\">Desktop</value>')\nlocal qbsguid = \"\"\nlocal qbsprofile = \"\"\nlocal qtcreatordir = \"\"\nif _OS == \"windows\" then\nqtcreatordir = path.join(os.getenv(\"APPDATA\"), \"QtProject/qtcreator\")\nelse\nqtcreatordir = path.join(os.getenv(\"HOME\"), \".config/QtProject/qtcreator\")\nend\nlocal file = io.open(path.join(qtcreatordir, \"qbs.conf\"))\nif file == nil then\nfile = io.open(path.join(qtcreatordir, \"qbs/1.6.0/qbs.conf\"))\nend\nif file ~= nil then\nfor line in file:lines() do\nif line == \"[org]\" then\nlocal str = 'qt-project\\\\qbs\\\\preferences\\\\qtcreator\\\\kit\\\\%'\nlocal index = string.len(str)+1\nfor line in file:lines() do\nif index == string.find(line, '7B', index) then\nline = string.sub(line, index+2)\nqbsguid = string.sub(line, 1, 36)\nqbspro"
- "file = string.sub(line, 41)\nbreak\nend\nend\nelse\nlocal str = '\\t<key>org.qt-project.qbs.preferences.qtcreator.kit.'\nlocal index = string.len(str)+1\nfor line in file:lines() do\nif qbsguid == \"\" and index == string.find(line, '{', index) then\nline = string.sub(line, index+1)\nqbsguid = string.sub(line, 1, 36)\nelseif qbsguid ~= \"\" then\nqbsprofile = string.sub(line, 10, 29)\nbreak\nend\nend\nend\nbreak\nend\nio.close(file)\nend\n_p(3, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.Id\">{%s}</value>', qbsguid)\n_p(3, '<value type=\"int\" key=\"ProjectExplorer.Target.ActiveBuildConfiguration\">0</value>')\n_p(3, '<value type=\"int\" key=\"ProjectExplorer.Target.ActiveDeployConfiguration\">0</value>')\n_p(3, '<value type=\"int\" key=\"ProjectExplorer.Target.ActiveRunConfiguration\">%d</value>', startProject)\nidx = 0\nfor _, cfgname in ipairs(sln.configurations) do\n_p(3, '<valuemap type=\"QVariantMap\" key=\"ProjectExplorer.Target.BuildConfiguration.%d\">', idx)\n_p(4, '<value type"
- "=\"QString\" key=\"ProjectExplorer.BuildConfiguration.BuildDirectory\">build</value>')\n_p(4, '<valuemap type=\"QVariantMap\" key=\"ProjectExplorer.BuildConfiguration.BuildStepList.0\">')\n_p(5, '<valuemap type=\"QVariantMap\" key=\"ProjectExplorer.BuildStepList.Step.0\">')\n_p(6, '<value type=\"bool\" key=\"ProjectExplorer.BuildStep.Enabled\">true</value>')\n_p(6, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DefaultDisplayName\"></value>')\n_p(6, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DisplayName\">Qbs Build</value>')\n_p(6, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.Id\">Qbs.BuildStep</value>')\n_p(6, '<value type=\"bool\" key=\"Qbs.CleanInstallRoot\">false</value>')\n_p(6, '<valuemap type=\"QVariantMap\" key=\"Qbs.Configuration\">')\n_p(7, '<value type=\"QString\" key=\"qbs.buildVariant\">%s</value>', cfgname:lower())\n_p(7, '<value type=\"QString\" key=\"qbs.profile\">%s</value>', qbsprofile)\n_p(6, '</valuemap>')\n_p(5, '</valuem"
- "ap>')\n_p(5, '<value type=\"int\" key=\"ProjectExplorer.BuildStepList.StepsCount\">1</value>')\n_p(5, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DefaultDisplayName\">Build</value>')\n_p(5, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DisplayName\"></value>')\n_p(5, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.Id\">ProjectExplorer.BuildSteps.Build</value>')\n_p(4, '</valuemap>')\n_p(4, '<valuemap type=\"QVariantMap\" key=\"ProjectExplorer.BuildConfiguration.BuildStepList.1\">')\n_p(5, '<valuemap type=\"QVariantMap\" key=\"ProjectExplorer.BuildStepList.Step.0\">')\n_p(6, '<value type=\"bool\" key=\"ProjectExplorer.BuildStep.Enabled\">true</value>')\n_p(6, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DefaultDisplayName\"></value>')\n_p(6, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DisplayName\">Qbs Clean</value>')\n_p(6, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.Id\">Qbs"
- ".CleanStep</value>')\n_p(6, '<value type=\"bool\" key=\"Qbs.CleanAll\">true</value>')\n_p(6, '<value type=\"bool\" key=\"Qbs.DryKeepGoing\">false</value>')\n_p(6, '<value type=\"bool\" key=\"Qbs.DryRun\">false</value>')\n_p(5, '</valuemap>')\n_p(5, '<value type=\"int\" key=\"ProjectExplorer.BuildStepList.StepsCount\">1</value>')\n_p(5, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DefaultDisplayName\">Clean</value>')\n_p(5, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DisplayName\"></value>')\n_p(5, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.Id\">ProjectExplorer.BuildSteps.Clean</value>')\n_p(4, '</valuemap>')\n_p(4, '<value type=\"int\" key=\"ProjectExplorer.BuildConfiguration.BuildStepListCount\">2</value>')\n_p(4, '<value type=\"bool\" key=\"ProjectExplorer.BuildConfiguration.ClearSystemEnvironment\">false</value>')\n_p(4, '<valuelist type=\"QVariantList\" key=\"ProjectExplorer.BuildConfiguration.UserEnvironmentChanges\"/>')\n_p(4, '<valu"
- "e type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DefaultDisplayName\">%s</value>', cfgname)\n_p(4, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DisplayName\"></value>')\n_p(4, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.Id\">Qbs.QbsBuildConfiguration</value>')\n_p(3, '</valuemap>')\nidx = idx + 1\nend\n_p(3, '<value type=\"int\" key=\"ProjectExplorer.Target.BuildConfigurationCount\">%d</value>', idx)\n_p(3, '<valuemap type=\"QVariantMap\" key=\"ProjectExplorer.Target.DeployConfiguration.0\">')\n_p(4, '<valuemap type=\"QVariantMap\" key=\"ProjectExplorer.BuildConfiguration.BuildStepList.0\">')\n_p(5, '<value type=\"int\" key=\"ProjectExplorer.BuildStepList.StepsCount\">0</value>')\n_p(5, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DefaultDisplayName\">Deploy</value>')\n_p(5, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DisplayName\"></value>')\n_p(5, '<value type=\"QString\" key=\"ProjectExplorer.ProjectCo"
- "nfiguration.Id\">ProjectExplorer.BuildSteps.Deploy</value>')\n_p(4, '</valuemap>')\n_p(4, '<value type=\"int\" key=\"ProjectExplorer.BuildConfiguration.BuildStepListCount\">1</value>')\n_p(4, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DefaultDisplayName\">Deploy locally</value>')\n_p(4, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DisplayName\">Qbs Install</value>')\n_p(4, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.Id\">Qbs.Deploy</value>')\n_p(3, '</valuemap>')\n_p(3, '<value type=\"int\" key=\"ProjectExplorer.Target.DeployConfigurationCount\">1</value>')\nidx = 0\nfor prj in premake.solution.eachproject(sln) do\nif is_app(prj.kind) then\n_p(3, '<valuemap type=\"QVariantMap\" key=\"ProjectExplorer.Target.RunConfiguration.%d\">', idx)\nif idx == startProject then\n_p(4, '<value type=\"int\" key=\"PE.EnvironmentAspect.Base\">2</value>')\nelse\n_p(4, '<value type=\"int\" key=\"PE.EnvironmentAspect.Base\">-1</value>')\nend\n_p(4, '<valuelist"
- " type=\"QVariantList\" key=\"PE.EnvironmentAspect.Changes\"/>')\n_p(4, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DefaultDisplayName\">%s</value>', prj.name)\n_p(4, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.DisplayName\"></value>')\n_p(4, '<value type=\"QString\" key=\"ProjectExplorer.ProjectConfiguration.Id\">Qbs.RunConfiguration:%s.%s---Qbs.RC.NameSeparator---%s</value>', prj.name, qbsprofile, prj.name)\n_p(4, '<value type=\"QString\" key=\"Qbs.RunConfiguration.CommandLineArguments\"></value>')\nlocal cfg = premake.getconfig(prj, nil, nil)\nif cfg.debugdir ~= nil then\n_p(4, '<value type=\"QString\" key=\"Qbs.RunConfiguration.WorkingDirectory\">%s</value>', cfg.debugdir)\nelse\n_p(4, '<value type=\"QString\" key=\"Qbs.RunConfiguration.WorkingDirectory\"></value>')\nend\n_p(3, '</valuemap>')\nidx = idx + 1\nend\nend\n_p(3, '<value type=\"int\" key=\"ProjectExplorer.Target.RunConfigurationCount\">%d</value>', idx)\n_p(2, '</valuemap>')\n_p(1, '</data>')\n_p(1,"
- " '<data>')\n_p(2, '<variable>ProjectExplorer.Project.TargetCount</variable>')\n_p(2, '<value type=\"int\">1</value>')\n_p(1, '</data>')\n_p(1, '<data>')\n_p(2, '<variable>Version</variable>')\n_p(2, '<value type=\"int\">18</value>')\n_p(1, '</data>')\n_p(0, '</qtcreator>')\nend\n",
-
- /* actions/qbs/qbs_cpp.lua */
- "local qbs = premake.qbs\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction qbs.generate_project(prj)\nlocal indent = 0\n_p(indent, '/*')\n_p(indent, ' * QBS project file autogenerated by GENie')\n_p(indent, ' * https://github.com/bkaradzic/GENie')\n_p(indent, ' */')\n_p(indent, '')\n_p(indent, 'import qbs 1.0')\n_p(indent, '')\nif prj.kind == \"ConsoleApp\" then\n_p(indent, 'CppApplication {')\n_p(indent + 1, 'consoleApplication: true')\nelseif prj.kind == \"WindowedApp\" then\n_p(indent, 'CppApplication {')\n_p(indent + 1, 'consoleApplication: false')\nelseif prj.kind == \"StaticLib\" then\n_p(indent, 'StaticLibrary {')\nelseif prj.kind == \"SharedLib\" then\n_p(indent, 'DynamicLibrary {')\nend\nindent = indent + 1\n_p(indent, 'name: \"' .. prj.name .. '\"')\n_p(indent, 'Depends { name: \"cpp\" }')\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\nfor"
- " _, depprj in ipairs(deps) do\n_p(indent, 'Depends { name: \"%s\" }', depprj.name)\nend\nend\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nif cfg.platform ~= \"Native\" then\n_p('');\n_p(indent, 'Properties { /* %s */', premake.getconfigname(cfg.name, cfg.platform, true))\nindent = indent + 1\nlocal arch = \"\"\nlocal linkerFlags = cfg.linkoptions\nif cfg.platform == \"x32\" then\narch = '&& qbs.architecture == \"x86\"'\nelseif cfg.platform == \"x64\" then\narch = '&& qbs.architecture == \"x86_64\"'\nend\nif cfg.name == \"Debug\" then\n_p(indent, 'condition: qbs.buildVariant == \"debug\" %s', arch)\nelse\n_p(indent, 'condition: qbs.buildVariant == \"release\" %s', arch)\nend\n_p(indent, 'targetName: \"%s\"', cfg.buildtarget.basename)\n_p(indent, 'destinationDirectory: \"%s\"', path.getabsolute('projects/qbs/' .. cfg.buildtarget.directory) .. '/')\nif c"
- "fg.flags.Cpp11 then\n_p(indent, 'cpp.cxxLanguageVersion: \"c++11\"')\nelseif cfg.flags.Cpp14 then\n_p(indent, 'cpp.cxxLanguageVersion: \"c++14\"')\nelseif cfg.flags.Cpp17 then\n_p(indent, 'cpp.cxxLanguageVersion: \"c++17\"')\nelse\n_p(indent, 'cpp.cxxLanguageVersion: \"c++98\"')\nend\nif os.is(\"windows\") then\nif not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then\nif cfg.flags.Unicode then\n_p(indent, 'cpp.entryPoint: \"wmainCRTStartup\"')\nelse\n_p(indent, 'cpp.entryPoint: \"mainCRTStartup\"')\nend\nend\nend\nqbs.list(\n indent\n, \"cpp.commonCompilerFlags\"\n, cfg.buildoptions\n)\nqbs.list(\n indent\n, \"cpp.cFlags\"\n, cfg.buildoptions_c\n)\nqbs.list(\n indent\n, \"cpp.cxxFlags\"\n, cfg.buildoptions_cpp\n)\nqbs.list(\n indent\n, \"cpp.objcFlags\"\n, cfg.buildoptions_objc\n)\nqbs.list(\n indent\n, \"cpp.objcxxFlags\"\n, cfg.buildoptions_objc\n)\nif cfg.flags.StaticRuntime then\n_p(indent, 'cpp.runtimeLibrary: \"static\"')\nelse\n_p(indent, 'cpp.runtimeLibrary: \"dyn"
- "amic\"')\nend\nif cfg.flags.PedanticWarnings\nor cfg.flags.ExtraWarnings\nthen\n_p(indent, 'cpp.warningLevel: \"all\"')\nelse\n_p(indent, 'cpp.warningLevel: \"default\"')\nend\nif cfg.flags.FatalWarnings then\n_p(indent, 'cpp.treatWarningsAsErrors: true')\nelse\n_p(indent, 'cpp.treatWarningsAsErrors: false')\nend\nif cfg.flags.NoRTTI then\n_p(indent, 'cpp.enableRtti: false')\nelse\n_p(indent, 'cpp.enableRtti: true')\nend\nif cfg.flags.NoExceptions then\n_p(indent, 'cpp.enableExceptions: false')\nelse\n_p(indent, 'cpp.enableExceptions: true')\nend\nif cfg.flags.Symbols then\n_p(indent, 'cpp.debugInformation: true')\nelse\n_p(indent, 'cpp.debugInformation: false')\nend\nif cfg.flags.Unicode then\n_p(indent, 'cpp.windowsApiCharacterSet: \"unicode\"')\nelse\n_p(indent, 'cpp.windowsApiCharacterSet: \"\"')\nend\nif not cfg.pchheader or cfg.flags.NoPCH then\n_p(indent, 'cpp.usePrecompiledHeader: false')\nelse\n_p(indent, 'cpp.usePrecompiledHeader: true')\n_p(indent, 'Group {')\n_p(indent+1, 'name: \"PCH\"')\n_p(inden"
- "t+1, 'files: [\"' .. cfg.pchheader .. '\"]')\n_p(indent+1, 'fileTags: [\"cpp_pch_src\"]')\n_p(indent, '}')\nend\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nelseif (value == \"OptimizeSize\") then\n_p(indent, 'cpp.optimization: \"small\"')\nelseif (value == \"OptimizeSpeed\") then\n_p(indent, 'cpp.optimization: \"fast\"')\nend\nend\nqbs.list(\n indent\n, \"cpp.defines\"\n, cfg.defines\n)\nlocal sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\ntable.sort(sortedincdirs, includesort)\nqbs.list(\n indent\n, \"cpp.includePaths\"\n, sortedincdirs\n)\nqbs.list(\n indent\n, \"cpp.staticLibraries\"\n, premake.getlinks(cfg, \"system\", \"fullpath\")\n)\nqbs.list(\n indent\n, \"cpp.libraryPaths\"\n, cfg.libdirs\n)\nqbs.list(\n indent\n, \"cpp.linkerFlags\"\n, linkerFlags\n)\ntable.sort(prj.files)\nif #prj.files > 0 then\n_p(indent, 'files: [')\nfor _, file in ipairs(prj.files) do\nif path.iscfile(file)\nor path.iscppfile(file)\nor path.isobjcfile(fil"
- "e)\nor path.isresourcefile(file)\nor path.iscppheader(file) then\nif not is_excluded(prj, cfg, file) then\n_p(indent+1, '\"%s\",', file)\nend\nend\nend\n_p(indent+1, ']')\nend\nif #prj.excludes > 0 then\n_p(indent, 'excludeFiles: [')\ntable.sort(prj.excludes)\nfor _, file in ipairs(prj.excludes) do\nif path.issourcefile(file) then\n_p(indent+1, '\"%s\",', file)\nend\nend\n_p(indent+1, ']')\nend\nindent = indent - 1\n_p(indent, '}');\nend\nend\nend\nindent = indent - 1\n_p(indent, '}')\nend\n",
+ /* actions/jcdb/_jcdb.lua */
+ "newaction {\ntrigger = \"jcdb\",\nshortname = \"compile_commands.json\",\ndescription = \"Generate a compile_commands.json file.\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = { cc = { \"gcc\" } },\nonsolution = function(sln)\nlocal jsonpath = path.join(sln.location, \"compile_commands.json\")\npremake.generate(sln, jsonpath, premake.jcdb.generate)\nend,\n}\n",
+
+ /* actions/jcdb/jcdb_solution.lua */
+ "premake.jcdb = {}\nlocal premake = premake\nlocal jcdb = premake.jcdb\nlocal encode_chars = {\n[0x22] = '\\\\\"',\n[0x5c] = \"\\\\\\\\\",\n[0x08] = \"\\\\b\",\n[0x0c] = \"\\\\f\",\n[0x0a] = \"\\\\n\",\n[0x0d] = \"\\\\r\",\n[0x09] = \"\\\\t\",\n}\nlocal function encode_string(s)\nlocal res = '\"'\nfor _, cp in utf8.codes(s) do\nif encode_chars[cp] then\nres = res..encode_chars[cp]\nelseif cp < 32 then\nres = res..string.format(\"\\\\u%04x\", cp)\nelse\nres = res..utf8.char(cp)\nend\nend\nreturn res..'\"'\nend\nlocal function escape_cmdline_arg(s)\nif s:find(\"%s\") then\ns = s:gsub(\"\\\\\", \"\\\\\\\\\")\ns = s:gsub('\"', '\\\\\"')\ns = '\"'..s..'\"'\nend\nreturn s\nend\nlocal function list(tbl)\nreturn iif(#tbl > 0, \" \"..table.concat(tbl, \" \"), \"\")\nend\nlocal function build_command(cfg, cc, file)\nlocal cmdline = \"\"\nlocal function app(s) cmdline = cmdline..s end\nif path.iscfile(file) or path.isasmfile(file) then\napp(cc.cc)\nelse\napp(cc.cxx)\nend\napp(list(cc.getcppflags(cfg)))\napp(list(cc.getdef"
+ "ines(cfg.defines)))\napp(list(cc.getincludedirs(cfg.includedirs)))\napp(list(cc.getquoteincludedirs(cfg.userincludedirs)))\napp(list(cc.getsystemincludedirs(cfg.systemincludedirs)))\napp(list(cc.getcflags(cfg)))\nif path.iscppfile(file) then\napp(list(cc.getcxxflags(cfg)))\nend\nif path.isasmfile(file) then\napp(list(cfg.buildoptions))\napp(list(cfg.buildoptions_asm))\nelseif path.isobjcfile(file) then\nlocal opts = iif(path.iscfile(file), cfg.buildoptions_objc, cfg.buildoptions_objcpp)\napp(list(cc.getobjcflags(cfg)))\napp(list(cfg.buildoptions))\napp(list(opts))\nelseif path.iscfile(file) then\napp(list(cfg.buildoptions))\napp(list(cfg.buildoptions_c))\nelse\napp(list(cfg.buildoptions))\napp(list(cfg.buildoptions_cpp))\nend\nif cfg.pchheader and not cfg.flags.NoPCH then\napp(\" -include \")\napp(escape_cmdline_arg(cfg.pchheader))\nend\nfor _, i in ipairs(cfg.forcedincludes) do\napp(\" -include \")\napp(escape_cmdline_arg(i))\nend\nlocal base = path.trimdots(path.removeext(file))..\".o\"\nlocal output = path."
+ "join(cfg.objectsdir, base)\napp(\" -o \")\napp(escape_cmdline_arg(output))\napp(\" -c \")\napp(escape_cmdline_arg(file))\nreturn cmdline\nend\nfunction jcdb.generate_config(prj, cfg, cc)\ntable.sort(cfg.files)\nlocal directory = path.getabsolute(prj.location)\nfor _, file in ipairs(cfg.files) do\nif path.iscppfile(file) or path.isasmfile(file) then\n_p(' { \"directory\": %s,', encode_string(directory))\n_p(' \"command\": %s,', encode_string(build_command(cfg, cc, file)))\n_p(' \"file\": %s },', encode_string(file))\nend\nend\nend\nfunction jcdb.generate_project(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\njcdb.generate_config(prj, cfg, cc)\nend\nend\nend\nfunction jcdb.generate(sln)\nfor _, prj in ipairs(sln.projects) do\njcdb.generate_project(prj)\nend\nio.captured = io.captured:gsub(\",%s$\", \"\")\nio.captured = \"[\"..io.eol..io.captur"
+ "ed..io.eol..\"]\"\nend\n",
/* _premake_main.lua */
"_WORKING_DIR = os.getcwd()\nlocal function injectplatform(platform)\nif not platform then return true end\nplatform = premake.checkvalue(platform, premake.fields.platforms.allowed)\nfor sln in premake.solution.each() do\nlocal platforms = sln.platforms or { }\nif #platforms == 0 then\ntable.insert(platforms, \"Native\")\nend\nif not table.contains(platforms, \"Native\") then\nreturn false, sln.name .. \" does not target native platform\\nNative platform settings are required for the --platform feature.\"\nend\nif not table.contains(platforms, platform) then\ntable.insert(platforms, platform)\nend\nsln.platforms = platforms\nend\nreturn true\nend\nfunction _premake_main(scriptpath)\nif (scriptpath) then\nlocal scripts = dofile(scriptpath .. \"/_manifest.lua\")\nfor _,v in ipairs(scripts) do\ndofile(scriptpath .. \"/\" .. v)\nend\nend\nlocal profiler = newProfiler()\nif (nil ~= _OPTIONS[\"debug-profiler\"]) then\nprofiler:start()\nend\n_PREMAKE_COMMAND = path.getabsolute(_PREMAKE_COMMAND)\npremake.action"
diff --git a/3rdparty/genie/src/host/version.h b/3rdparty/genie/src/host/version.h
index 91f561ceb56..423a1604bba 100644
--- a/3rdparty/genie/src/host/version.h
+++ b/3rdparty/genie/src/host/version.h
@@ -1,3 +1,2 @@
-// This file is autogenerated, do not change it.
-#define VERSION 0
-#define VERSION_STR "<auto generated do not change>"
+#define VERSION 1181
+#define VERSION_STR "version 1181 (commit 29e6832fdf3b106c0906d288c8ced6c0761b8985)"
diff --git a/3rdparty/genie/src/tools/gcc.lua b/3rdparty/genie/src/tools/gcc.lua
index 3c87aa2074a..30a9fa91d91 100644
--- a/3rdparty/genie/src/tools/gcc.lua
+++ b/3rdparty/genie/src/tools/gcc.lua
@@ -46,7 +46,8 @@
Cpp11 = "-std=c++11",
Cpp14 = "-std=c++14",
Cpp17 = "-std=c++17",
- CppLatest = "-std=c++2a",
+ Cpp20 = "-std=c++20",
+ CppLatest = "-std=c++2b",
NoExceptions = "-fno-exceptions",
NoRTTI = "-fno-rtti",
UnsignedChar = "-funsigned-char",
@@ -115,7 +116,21 @@
cxx = "$(EMSCRIPTEN)/em++",
ar = "$(EMSCRIPTEN)/emar",
cppflags = "-MMD -MP",
- }
+ },
+ NX32 = {
+ cc = "clang",
+ cxx = "clang++",
+ ar = "armv7l-nintendo-nx-eabihf-ar",
+ cppflags = "-MMD -MP",
+ flags = "-march=armv7l",
+ },
+ NX64 = {
+ cc = "clang",
+ cxx = "clang++",
+ ar = "aarch64-nintendo-nx-elf-ar",
+ cppflags = "-MMD -MP",
+ flags = "-march=aarch64",
+ },
}
local platforms = premake.gcc.platforms
diff --git a/3rdparty/genie/src/tools/valac.lua b/3rdparty/genie/src/tools/valac.lua
index 4101c2e04fd..43f65818cf4 100644
--- a/3rdparty/genie/src/tools/valac.lua
+++ b/3rdparty/genie/src/tools/valac.lua
@@ -12,7 +12,8 @@
--
premake.valac.valac = "valac"
- premake.valac.cc = "gcc"
+ premake.valac.cc = premake.gcc.cc
+ premake.valac.glibrc = "glib-compile-resources"
--
@@ -30,20 +31,37 @@
EnableExperimentalNonNull = "--enable-experimental-non-null", -- Enable experimental enhancements for non-null types
EnableGObjectTracing = "--enable-gobject-tracing", -- Enable GObject creation tracing
EnableMemProfiler = "--enable-mem-profiler", -- Enable GLib memory profiler
- EnableThreading = "--thread", -- Enable multithreading support
FatalWarnings = "--fatal-warnings", -- Treat warnings as fatal
HideInternal = "--hide-internal", -- Hide symbols marked as internal
NoStdPkg = "--nostdpkg", -- Do not include standard packages
- Optimize = "-X -O2",
- OptimizeSize = "-X -Os",
- OptimizeSpeed = "-X -O3",
Symbols = "-g", -- Produce debug information
}
- premake.valac.platforms = {}
+ local valaccflags =
+ {
+ Optimize = "-O2",
+ OptimizeSize = "-Os",
+ OptimizeSpeed = "-O3",
+ Symbols = "-g", -- Produce debug information
+ }
--
--- Returns a list of compiler flags, based on the supplied configuration.
+-- Map platforms to flags
+--
+
+ premake.valac.platforms =
+ {
+ Native = {
+ },
+ x64 = {
+ flags = "-m64"
+ },
+ }
+
+
+
+--
+-- Returns a list of compiler flags for `valac`, based on the supplied configuration.
--
function premake.valac.getvalaflags(cfg)
@@ -53,6 +71,16 @@
--
+-- Returns a list of compiler flags for `cc`, based on the supplied configuration.
+--
+
+ function premake.valac.getvalaccflags(cfg)
+ return table.translate(cfg.flags, valaccflags)
+ end
+
+
+
+--
-- Decorate pkgs for the Vala command line.
--
@@ -81,18 +109,6 @@
--
--- Decorate C flags for the Vala command line.
---
-
- function premake.valac.getbuildoptions(buildoptions)
- local result = { }
- for _, def in ipairs(buildoptions) do
- table.insert(result, '-X ' .. def)
- end
- return result
- end
-
---
-- Decorate vapidirs for the Vala command line.
--
diff --git a/3rdparty/genie/tests/actions/vstudio/test_vs2010_flags.lua b/3rdparty/genie/tests/actions/vstudio/test_vs2010_flags.lua
index 65b824ea725..be1784c223b 100644
--- a/3rdparty/genie/tests/actions/vstudio/test_vs2010_flags.lua
+++ b/3rdparty/genie/tests/actions/vstudio/test_vs2010_flags.lua
@@ -205,13 +205,6 @@ function vs10_flags.release_minimalRebuild_setToFalse()
test.string_contains(buffer,'<MinimalRebuild>false</MinimalRebuild>')
end
-function vs10_flags.mfc_useOfMfc_setToStatic()
- flags{"MFC"}
-
- local buffer = get_buffer()
- test.string_contains(buffer,'<UseOfMfc>Dynamic</UseOfMfc>')
-end
-
--there is not an option for /Z7 OldStyle
--/ZI is not compatible with /clr or x64_64
--minimal Rebuild requires /Zi in x86_64
diff --git a/3rdparty/genie/tests/actions/vstudio/vc200x/test_mfc.lua b/3rdparty/genie/tests/actions/vstudio/vc200x/test_mfc.lua
deleted file mode 100644
index cf0a54a6e54..00000000000
--- a/3rdparty/genie/tests/actions/vstudio/vc200x/test_mfc.lua
+++ /dev/null
@@ -1,98 +0,0 @@
---
--- tests/actions/vstudio/vc200x/test_mfc.lua
--- Validate ATL/MFC support in Visual Studio 200x C/C++ projects.
--- Copyright (c) 2011 Jason Perkins and the Premake project
---
-
- T.vstudio_vs200x_mfc = { }
- local suite = T.vstudio_vs200x_mfc
- local vc200x = premake.vstudio.vc200x
-
-
---
--- Setup
---
-
- local sln, prj, cfg
-
- function suite.setup()
- _ACTION = "vs2008"
- sln, prj = test.createsolution()
- end
-
- local function prepare(platform)
- premake.bake.buildconfigs()
- sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
- cfg = premake.getconfig(prj, "Debug", platform)
- vc200x.Configuration("Debug|Win32", cfg)
- end
-
-
---
--- When MFC is enabled, it should match the runtime library linking
--- method (static or dynamic).
---
-
- function suite.useOfMfc_isDynamic_onSharedRuntime()
- flags { "MFC" }
- prepare()
- test.capture [[
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="."
- IntermediateDirectory="obj\Debug"
- ConfigurationType="1"
- UseOfMFC="2"
- CharacterSet="2"
- >
- ]]
- end
-
- function suite.useOfMfc_isStatic_onStaticRuntime()
- flags { "MFC", "StaticRuntime" }
- prepare()
- test.capture [[
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="."
- IntermediateDirectory="obj\Debug"
- ConfigurationType="1"
- UseOfMFC="1"
- CharacterSet="2"
- >
- ]]
- end
-
---
--- Same as above for ATL.
---
-
- function suite.useOfAtl_isDynamic_onSharedRuntime()
- flags { "ATL" }
- prepare()
- test.capture [[
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="."
- IntermediateDirectory="obj\Debug"
- ConfigurationType="1"
- UseOfATL="2"
- CharacterSet="2"
- >
- ]]
- end
-
- function suite.useOfAtl_isStatic_onStaticRuntime()
- flags { "StaticATL" }
- prepare()
- test.capture [[
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="."
- IntermediateDirectory="obj\Debug"
- ConfigurationType="1"
- UseOfATL="1"
- CharacterSet="2"
- >
- ]]
- end
diff --git a/3rdparty/genie/tests/actions/vstudio/vc2010/test_mfc.lua b/3rdparty/genie/tests/actions/vstudio/vc2010/test_mfc.lua
deleted file mode 100644
index 1ada1585673..00000000000
--- a/3rdparty/genie/tests/actions/vstudio/vc2010/test_mfc.lua
+++ /dev/null
@@ -1,60 +0,0 @@
---
--- tests/actions/vstudio/vc2010/test_mfc.lua
--- Validate MFC support in Visual Studio 2010 C/C++ projects.
--- Copyright (c) 2011 Jason Perkins and the Premake project
---
-
- T.vstudio_vs2010_mfc = { }
- local suite = T.vstudio_vs2010_mfc
- local vc2010 = premake.vstudio.vc2010
-
-
---
--- Setup
---
-
- local sln, prj, cfg
-
- function suite.setup()
- _ACTION = "vs2010"
- sln, prj = test.createsolution()
- end
-
- local function prepare(platform)
- premake.bake.buildconfigs()
- sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
- cfg = premake.getconfig(prj, "Debug", platform)
- vc2010.configurationPropertyGroup(cfg, sln.vstudio_configs[1])
- end
-
-
---
--- When MFC is enabled, it should match the runtime library linking
--- method (static or dynamic).
---
-
- function suite.useOfMfc_isDynamic_onSharedRuntime()
- flags { "MFC" }
- prepare()
- test.capture [[
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>MultiByte</CharacterSet>
- <UseOfMfc>Dynamic</UseOfMfc>
- </PropertyGroup>
- ]]
- end
-
- function suite.useOfMfc_isStatic_onStaticRuntime()
- flags { "MFC", "StaticRuntime" }
- prepare()
- test.capture [[
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>MultiByte</CharacterSet>
- <UseOfMfc>Static</UseOfMfc>
- </PropertyGroup>
- ]]
- end
diff --git a/3rdparty/genie/tests/premake4.lua b/3rdparty/genie/tests/premake4.lua
index 30166e734a3..626eb3e06e1 100644
--- a/3rdparty/genie/tests/premake4.lua
+++ b/3rdparty/genie/tests/premake4.lua
@@ -98,7 +98,6 @@
dofile("actions/vstudio/vc200x/header.lua")
dofile("actions/vstudio/vc200x/test_files.lua")
dofile("actions/vstudio/vc200x/test_filters.lua")
- dofile("actions/vstudio/vc200x/test_mfc.lua")
-- Visual Studio 2010 C/C++ projects
dofile("actions/vstudio/vc2010/test_config_props.lua")
@@ -108,7 +107,6 @@
dofile("actions/vstudio/vc2010/test_filters.lua")
dofile("actions/vstudio/vc2010/test_link_settings.lua")
dofile("actions/vstudio/vc2010/test_links.lua")
- dofile("actions/vstudio/vc2010/test_mfc.lua")
dofile("actions/vstudio/vc2010/test_output_props.lua")
dofile("actions/vstudio/vc2010/test_pch.lua")
dofile("actions/vstudio/vc2010/test_project_refs.lua")
diff --git a/3rdparty/lua/Makefile b/3rdparty/lua/Makefile
index fef1af4821e..72ca8ff3cc1 100644
--- a/3rdparty/lua/Makefile
+++ b/3rdparty/lua/Makefile
@@ -36,7 +36,7 @@ RM= rm -f
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
# Convenience platforms targets.
-PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
+PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
@@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1
# Lua version and release.
V= 5.4
-R= $V.4
+R= $V.7
# Targets start here.
all: $(PLAT)
diff --git a/3rdparty/lua/README b/3rdparty/lua/README
index c394c69828b..fe99b874f61 100644
--- a/3rdparty/lua/README
+++ b/3rdparty/lua/README
@@ -1,5 +1,5 @@
-This is Lua 5.4.4, released on 13 Jan 2022.
+This is Lua 5.4.7, released on 13 Jun 2024.
For installation instructions, license details, and
further information about Lua, see doc/readme.html.
diff --git a/3rdparty/lua/doc/OSIApproved_100X125.png b/3rdparty/lua/doc/OSIApproved_100X125.png
new file mode 100644
index 00000000000..795f7a06ed5
--- /dev/null
+++ b/3rdparty/lua/doc/OSIApproved_100X125.png
Binary files differ
diff --git a/3rdparty/lua/doc/contents.html b/3rdparty/lua/doc/contents.html
index ab82eb4a927..e17104845a2 100644
--- a/3rdparty/lua/doc/contents.html
+++ b/3rdparty/lua/doc/contents.html
@@ -10,7 +10,7 @@
<BODY>
<H1>
-<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
+<A HREF="https://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
Lua 5.4 Reference Manual
</H1>
@@ -18,7 +18,7 @@ Lua 5.4 Reference Manual
The reference manual is the official definition of the Lua language.
<BR>
For a complete introduction to Lua programming, see the book
-<A HREF="http://www.lua.org/pil/">Programming in Lua</A>.
+<A HREF="https://www.lua.org/pil/">Programming in Lua</A>.
<DIV CLASS="menubar">
<A HREF="manual.html">start</A>
@@ -27,14 +27,14 @@ For a complete introduction to Lua programming, see the book
&middot;
<A HREF="#index">index</A>
&middot;
-<A HREF="http://www.lua.org/manual/">other versions</A>
+<A HREF="https://www.lua.org/manual/">other versions</A>
</DIV>
<P>
<SMALL>
-Copyright &copy; 2020&ndash;2022 Lua.org, PUC-Rio.
+Copyright &copy; 2020&ndash;2024 Lua.org, PUC-Rio.
Freely available under the terms of the
-<A HREF="http://www.lua.org/license.html">Lua license</A>.
+<A HREF="https://www.lua.org/license.html">Lua license</A>.
</SMALL>
<H2><A NAME="contents">Contents</A></H2>
@@ -85,6 +85,8 @@ Freely available under the terms of the
<LI><A HREF="manual.html#3.4.9">3.4.9 &ndash; Table Constructors</A>
<LI><A HREF="manual.html#3.4.10">3.4.10 &ndash; Function Calls</A>
<LI><A HREF="manual.html#3.4.11">3.4.11 &ndash; Function Definitions</A>
+<LI><A HREF="manual.html#3.4.12">3.4.12 &ndash; Lists of expressions, multiple results, and adjustment<A>
+
</UL>
<LI><A HREF="manual.html#3.5">3.5 &ndash; Visibility Rules</A>
</UL>
@@ -613,7 +615,7 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-LUA_HOOKLINE">LUA_HOOKLINE</A><BR>
<A HREF="manual.html#pdf-LUA_HOOKRET">LUA_HOOKRET</A><BR>
<A HREF="manual.html#pdf-LUA_HOOKTAILCALL">LUA_HOOKTAILCALL</A><BR>
-<A HREF="manual.html#pdf-LUAL_BUFFERSIZE">LUAL_BUFFERSIZE</A><BR>
+<A HREF="manual.html#pdf-LUA_LOADED_TABLE">LUA_LOADED_TABLE</A><BR>
<A HREF="manual.html#pdf-LUA_MASKCALL">LUA_MASKCALL</A><BR>
<A HREF="manual.html#pdf-LUA_MASKCOUNT">LUA_MASKCOUNT</A><BR>
<A HREF="manual.html#pdf-LUA_MASKLINE">LUA_MASKLINE</A><BR>
@@ -641,6 +643,7 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-LUA_OPSHR">LUA_OPSHR</A><BR>
<A HREF="manual.html#pdf-LUA_OPSUB">LUA_OPSUB</A><BR>
<A HREF="manual.html#pdf-LUA_OPUNM">LUA_OPUNM</A><BR>
+<A HREF="manual.html#pdf-LUA_PRELOAD_TABLE">LUA_PRELOAD_TABLE</A><BR>
<A HREF="manual.html#pdf-LUA_REFNIL">LUA_REFNIL</A><BR>
<A HREF="manual.html#pdf-LUA_REGISTRYINDEX">LUA_REGISTRYINDEX</A><BR>
<A HREF="manual.html#pdf-LUA_RIDX_GLOBALS">LUA_RIDX_GLOBALS</A><BR>
@@ -657,6 +660,7 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-LUA_TUSERDATA">LUA_TUSERDATA</A><BR>
<A HREF="manual.html#pdf-LUA_USE_APICHECK">LUA_USE_APICHECK</A><BR>
<A HREF="manual.html#pdf-LUA_YIELD">LUA_YIELD</A><BR>
+<A HREF="manual.html#pdf-LUAL_BUFFERSIZE">LUAL_BUFFERSIZE</A><BR>
</TD>
</TR>
@@ -664,10 +668,10 @@ Freely available under the terms of the
<P CLASS="footer">
Last update:
-Thu Jan 13 11:32:22 UTC 2022
+Thu May 9 14:47:09 UTC 2024
</P>
<!--
-Last change: revised for Lua 5.4.4
+Last change: revised for Lua 5.4.7
-->
</BODY>
diff --git a/3rdparty/lua/doc/lua.1 b/3rdparty/lua/doc/lua.1
index a46a1a67dd0..3c9e000234e 100644
--- a/3rdparty/lua/doc/lua.1
+++ b/3rdparty/lua/doc/lua.1
@@ -1,5 +1,5 @@
-.\" $Id: lua.man,v 1.14 2020/05/21 19:31:21 lhf Exp $
-.TH LUA 1 "$Date: 2020/05/21 19:31:21 $"
+.\" $Id: lua.man,v 1.14 2024/05/08 18:48:27 lhf Exp $
+.TH LUA 1 "$Date: 2024/05/08 18:48:27 $"
.SH NAME
lua \- Lua interpreter
.SH SYNOPSIS
@@ -86,11 +86,17 @@ execute statement
enter interactive mode after executing
.IR script .
.TP
-.BI \-l " name"
+.BI \-l " mod"
require library
-.I name
+.I mod
into global
-.IR name .
+.IR mod .
+.TP
+.BI \-l " g=mod"
+require library
+.I mod
+into global
+.IR g .
.TP
.B \-v
show version information.
@@ -117,7 +123,7 @@ and the version-neutral variants are ignored.
Code to be executed before command line options and scripts.
.TP
.B LUA_PATH, LUA_PATH_5_4
-Initial value of package.cpath,
+Initial value of package.path,
the path used by require to search for Lua loaders.
.TP
.B LUA_CPATH, LUA_CPATH_5_4
diff --git a/3rdparty/lua/doc/lua.css b/3rdparty/lua/doc/lua.css
index cbd0799d152..9013b445c65 100644
--- a/3rdparty/lua/doc/lua.css
+++ b/3rdparty/lua/doc/lua.css
@@ -143,6 +143,7 @@ table.book td.cover {
table.book img {
border: solid #000080 1px ;
+ border-radius: 2px ;
}
table.book span {
diff --git a/3rdparty/lua/doc/manual.html b/3rdparty/lua/doc/manual.html
index 61a8220d7fd..574c7432c0f 100644
--- a/3rdparty/lua/doc/manual.html
+++ b/3rdparty/lua/doc/manual.html
@@ -10,7 +10,7 @@
<BODY>
<H1>
-<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
+<A HREF="https://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
Lua 5.4 Reference Manual
</H1>
@@ -19,9 +19,9 @@ by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes
<P>
<SMALL>
-Copyright &copy; 2020&ndash;2022 Lua.org, PUC-Rio.
+Copyright &copy; 2020&ndash;2024 Lua.org, PUC-Rio.
Freely available under the terms of the
-<a href="http://www.lua.org/license.html">Lua license</a>.
+<a href="https://www.lua.org/license.html">Lua license</a>.
</SMALL>
<DIV CLASS="menubar">
@@ -29,7 +29,7 @@ Freely available under the terms of the
&middot;
<A HREF="contents.html#index">index</A>
&middot;
-<A HREF="http://www.lua.org/manual/">other versions</A>
+<A HREF="https://www.lua.org/manual/">other versions</A>
</DIV>
<!-- ====================================================================== -->
@@ -63,7 +63,7 @@ and rapid prototyping.
<p>
Lua is implemented as a library, written in <em>clean C</em>,
-the common subset of Standard&nbsp;C and C++.
+the common subset of standard&nbsp;C and C++.
The Lua distribution includes a host program called <code>lua</code>,
which uses the Lua library to offer a complete,
standalone Lua interpreter,
@@ -391,7 +391,7 @@ Whenever there is an error,
an <em>error object</em>
is propagated with information about the error.
Lua itself only generates errors whose error object is a string,
-but programs may generate errors with
+but programs can generate errors with
any value as the error object.
It is up to the Lua program or its host to handle such error objects.
For historical reasons,
@@ -401,7 +401,7 @@ even though it does not have to be a string.
<p>
When you use <a href="#pdf-xpcall"><code>xpcall</code></a> (or <a href="#lua_pcall"><code>lua_pcall</code></a>, in C)
-you may give a <em>message handler</em>
+you can give a <em>message handler</em>
to be called in case of errors.
This function is called with the original error object
and returns a new error object.
@@ -453,7 +453,7 @@ which is then called a <em>metamethod</em>.
In the previous example, the key is the string "<code>__add</code>"
and the metamethod is the function that performs the addition.
Unless stated otherwise,
-a metamethod may in fact be any callable value,
+a metamethod can in fact be any callable value,
which is either a function or a value with a <code>__call</code> metamethod.
@@ -1379,7 +1379,9 @@ Lua also accepts hexadecimal constants,
which start with <code>0x</code> or <code>0X</code>.
Hexadecimal constants also accept an optional fractional part
plus an optional binary exponent,
-marked by a letter '<code>p</code>' or '<code>P</code>'.
+marked by a letter '<code>p</code>' or '<code>P</code>' and written in decimal.
+(For instance, <code>0x1.fp10</code> denotes 1984,
+which is <em>0x1f / 16</em> multiplied by <em>2<sup>10</sup></em>.)
<p>
@@ -1621,21 +1623,13 @@ Expressions are discussed in <a href="#3.4">&sect;3.4</a>.
<p>
Before the assignment,
the list of values is <em>adjusted</em> to the length of
-the list of variables.
-If there are more values than needed,
-the excess values are thrown away.
-If there are fewer values than needed,
-the list is extended with <b>nil</b>'s.
-If the list of expressions ends with a function call,
-then all values returned by that call enter the list of values,
-before the adjustment
-(except when the call is enclosed in parentheses; see <a href="#3.4">&sect;3.4</a>).
+the list of variables (see <a href="#3.4.12">&sect;3.4.12</a>).
<p>
If a variable is both assigned and read
inside a multiple assignment,
-Lua ensures all reads get the value of the variable
+Lua ensures that all reads get the value of the variable
before the assignment.
Thus the code
@@ -1731,7 +1725,7 @@ labels in Lua are considered statements too:
<p>
A label is visible in the entire block where it is defined,
except inside nested functions.
-A goto may jump to any visible label as long as it does not
+A goto can jump to any visible label as long as it does not
enter into the scope of a local variable.
A label should not be declared
where a label with the same name is visible,
@@ -1739,11 +1733,6 @@ even if this other label has been declared in an enclosing block.
<p>
-Labels and empty statements are called <em>void statements</em>,
-as they perform no actions.
-
-
-<p>
The <b>break</b> statement terminates the execution of a
<b>while</b>, <b>repeat</b>, or <b>for</b> loop,
skipping to the next statement after the loop:
@@ -2059,7 +2048,7 @@ function calls are explained in <a href="#3.4.10">&sect;3.4.10</a>;
table constructors are explained in <a href="#3.4.9">&sect;3.4.9</a>.
Vararg expressions,
denoted by three dots ('<code>...</code>'), can only be used when
-directly inside a vararg function;
+directly inside a variadic function;
they are explained in <a href="#3.4.11">&sect;3.4.11</a>.
@@ -2074,52 +2063,6 @@ the unary logical <b>not</b> (see <a href="#3.4.5">&sect;3.4.5</a>),
and the unary <em>length operator</em> (see <a href="#3.4.7">&sect;3.4.7</a>).
-<p>
-Both function calls and vararg expressions can result in multiple values.
-If a function call is used as a statement (see <a href="#3.3.6">&sect;3.3.6</a>),
-then its return list is adjusted to zero elements,
-thus discarding all returned values.
-If an expression is used as the last (or the only) element
-of a list of expressions,
-then no adjustment is made
-(unless the expression is enclosed in parentheses).
-In all other contexts,
-Lua adjusts the result list to one element,
-either discarding all values except the first one
-or adding a single <b>nil</b> if there are no values.
-
-
-<p>
-Here are some examples:
-
-<pre>
- f() -- adjusted to 0 results
- g(f(), x) -- f() is adjusted to 1 result
- g(x, f()) -- g gets x plus all results from f()
- a,b,c = f(), x -- f() is adjusted to 1 result (c gets nil)
- a,b = ... -- a gets the first vararg argument, b gets
- -- the second (both a and b can get nil if there
- -- is no corresponding vararg argument)
-
- a,b,c = x, f() -- f() is adjusted to 2 results
- a,b,c = f() -- f() is adjusted to 3 results
- return f() -- returns all results from f()
- return ... -- returns all received vararg arguments
- return x,y,f() -- returns x, y, and all results from f()
- {f()} -- creates a list with all results from f()
- {...} -- creates a list with all vararg arguments
- {f(), nil} -- f() is adjusted to 1 result
-</pre>
-
-<p>
-Any expression enclosed in parentheses always results in only one value.
-Thus,
-<code>(f(x,y,z))</code> is always a single value,
-even if <code>f</code> returns several values.
-(The value of <code>(f(x,y,z))</code> is the first value returned by <code>f</code>
-or <b>nil</b> if <code>f</code> does not return any values.)
-
-
@@ -2252,8 +2195,9 @@ Note that bitwise operators do not do this coercion.
<p>
-Nonetheless, it is always a good practice not to rely on these
-implicit coercions, as they are not always applied;
+It is always a good practice not to rely on the
+implicit coercions from strings to numbers,
+as they are not always applied;
in particular, <code>"1"==1</code> is false and <code>"1"&lt;1</code> raises an error
(see <a href="#3.4.4">&sect;3.4.4</a>).
These coercions exist mainly for compatibility and may be removed
@@ -2558,9 +2502,9 @@ The order of the assignments in a constructor is undefined.
<p>
If the last field in the list has the form <code>exp</code>
-and the expression is a function call or a vararg expression,
+and the expression is a multires expression,
then all values returned by this expression enter the list consecutively
-(see <a href="#3.4.10">&sect;3.4.10</a>).
+(see <a href="#3.4.12">&sect;3.4.12</a>).
<p>
@@ -2624,7 +2568,7 @@ A call of the form <code>return <em>functioncall</em></code> not in the
scope of a to-be-closed variable is called a <em>tail call</em>.
Lua implements <em>proper tail calls</em>
(or <em>proper tail recursion</em>):
-in a tail call,
+In a tail call,
the called function reuses the stack entry of the calling function.
Therefore, there is no limit on the number of nested tail calls that
a program can execute.
@@ -2727,22 +2671,16 @@ initialized with the argument values:
</pre><p>
When a Lua function is called,
it adjusts its list of arguments to
-the length of its list of parameters,
-unless the function is a <em>vararg function</em>,
+the length of its list of parameters (see <a href="#3.4.12">&sect;3.4.12</a>),
+unless the function is a <em>variadic function</em>,
which is indicated by three dots ('<code>...</code>')
at the end of its parameter list.
-A vararg function does not adjust its argument list;
+A variadic function does not adjust its argument list;
instead, it collects all extra arguments and supplies them
to the function through a <em>vararg expression</em>,
which is also written as three dots.
The value of this expression is a list of all actual extra arguments,
-similar to a function with multiple results.
-If a vararg expression is used inside another expression
-or in the middle of a list of expressions,
-then its return list is adjusted to one element.
-If the expression is used as the last element of a list of expressions,
-then no adjustment is made
-(unless that last expression is enclosed in parentheses).
+similar to a function with multiple results (see <a href="#3.4.12">&sect;3.4.12</a>).
<p>
@@ -2803,6 +2741,122 @@ is syntactic sugar for
+<h3>3.4.12 &ndash; <a name="3.4.12">Lists of expressions, multiple results,
+and adjustment</a></h3>
+
+<p>
+Both function calls and vararg expressions can result in multiple values.
+These expressions are called <em>multires expressions</em>.
+
+
+<p>
+When a multires expression is used as the last element
+of a list of expressions,
+all results from the expression are added to the
+list of values produced by the list of expressions.
+Note that a single expression
+in a place that expects a list of expressions
+is the last expression in that (singleton) list.
+
+
+<p>
+These are the places where Lua expects a list of expressions:
+
+<ul>
+
+<li>A <b>return</b> statement,
+for instance <code>return e1, e2, e3</code> (see <a href="#3.3.4">&sect;3.3.4</a>).</li>
+
+<li>A table constructor,
+for instance <code>{e1, e2, e3}</code> (see <a href="#3.4.9">&sect;3.4.9</a>).</li>
+
+<li>The arguments of a function call,
+for instance <code>foo(e1, e2, e3)</code> (see <a href="#3.4.10">&sect;3.4.10</a>).</li>
+
+<li>A multiple assignment,
+for instance <code>a , b, c = e1, e2, e3</code> (see <a href="#3.3.3">&sect;3.3.3</a>).</li>
+
+<li>A local declaration,
+for instance <code>local a , b, c = e1, e2, e3</code> (see <a href="#3.3.7">&sect;3.3.7</a>).</li>
+
+<li>The initial values in a generic <b>for</b> loop,
+for instance <code>for k in e1, e2, e3 do ... end</code> (see <a href="#3.3.5">&sect;3.3.5</a>).</li>
+
+</ul><p>
+In the last four cases,
+the list of values from the list of expressions
+must be <em>adjusted</em> to a specific length:
+the number of parameters in a call to a non-variadic function
+(see <a href="#3.4.11">&sect;3.4.11</a>),
+the number of variables in a multiple assignment or
+a local declaration,
+and exactly four values for a generic <b>for</b> loop.
+The <em>adjustment</em> follows these rules:
+If there are more values than needed,
+the extra values are thrown away;
+if there are fewer values than needed,
+the list is extended with <b>nil</b>'s.
+When the list of expressions ends with a multires expression,
+all results from that expression enter the list of values
+before the adjustment.
+
+
+<p>
+When a multires expression is used
+in a list of expressions without being the last element,
+or in a place where the syntax expects a single expression,
+Lua adjusts the result list of that expression to one element.
+As a particular case,
+the syntax expects a single expression inside a parenthesized expression;
+therefore, adding parentheses around a multires expression
+forces it to produce exactly one result.
+
+
+<p>
+We seldom need to use a vararg expression in a place
+where the syntax expects a single expression.
+(Usually it is simpler to add a regular parameter before
+the variadic part and use that parameter.)
+When there is such a need,
+we recommend assigning the vararg expression
+to a single variable and using that variable
+in its place.
+
+
+<p>
+Here are some examples of uses of mutlres expressions.
+In all cases, when the construction needs
+"the n-th result" and there is no such result,
+it uses a <b>nil</b>.
+
+<pre>
+ print(x, f()) -- prints x and all results from f().
+ print(x, (f())) -- prints x and the first result from f().
+ print(f(), x) -- prints the first result from f() and x.
+ print(1 + f()) -- prints 1 added to the first result from f().
+ local x = ... -- x gets the first vararg argument.
+ x,y = ... -- x gets the first vararg argument,
+ -- y gets the second vararg argument.
+ x,y,z = w, f() -- x gets w, y gets the first result from f(),
+ -- z gets the second result from f().
+ x,y,z = f() -- x gets the first result from f(),
+ -- y gets the second result from f(),
+ -- z gets the third result from f().
+ x,y,z = f(), g() -- x gets the first result from f(),
+ -- y gets the first result from g(),
+ -- z gets the second result from g().
+ x,y,z = (f()) -- x gets the first result from f(), y and z get nil.
+ return f() -- returns all results from f().
+ return x, ... -- returns x and all received vararg arguments.
+ return x,y,f() -- returns x, y, and all results from f().
+ {f()} -- creates a list with all results from f().
+ {...} -- creates a list with all vararg arguments.
+ {f(), 5} -- creates a list with the first result from f() and 5.
+</pre>
+
+
+
+
<h2>3.5 &ndash; <a name="3.5">Visibility Rules</a></h2>
@@ -2813,6 +2867,7 @@ Lua is a lexically scoped language.
The scope of a local variable begins at the first statement after
its declaration and lasts until the last non-void statement
of the innermost block that includes the declaration.
+(<em>Void statements</em> are labels and empty statements.)
Consider the following example:
<pre>
@@ -3071,7 +3126,7 @@ In general,
Lua's garbage collection can free or move internal memory
and then invalidate pointers to internal strings.
To allow a safe use of these pointers,
-The API guarantees that any pointer to a string in a stack index
+the API guarantees that any pointer to a string in a stack index
is valid while the string value at that index is not removed from the stack.
(It can be moved to another index, though.)
When the index is a pseudo-index (referring to an upvalue),
@@ -3537,7 +3592,7 @@ It is used in the auxiliary library by <a href="#luaL_newstate"><code>luaL_newst
return realloc(ptr, nsize);
}
</pre><p>
-Note that Standard&nbsp;C ensures
+Note that ISO&nbsp;C ensures
that <code>free(NULL)</code> has no effect and that
<code>realloc(NULL,size)</code> is equivalent to <code>malloc(size)</code>.
@@ -3785,8 +3840,36 @@ when called through this function.
<p>
-(Exceptionally, this function was introduced in release 5.4.3.
-It is not present in previous 5.4 releases.)
+(This function was introduced in release&nbsp;5.4.3.)
+
+
+
+
+
+<hr><h3><a name="lua_closethread"><code>lua_closethread</code></a></h3><p>
+<span class="apii">[-0, +?, &ndash;]</span>
+<pre>int lua_closethread (lua_State *L, lua_State *from);</pre>
+
+<p>
+Resets a thread, cleaning its call stack and closing all pending
+to-be-closed variables.
+Returns a status code:
+<a href="#pdf-LUA_OK"><code>LUA_OK</code></a> for no errors in the thread
+(either the original error that stopped the thread or
+errors in closing methods),
+or an error status otherwise.
+In case of error,
+leaves the error object on the top of the stack.
+
+
+<p>
+The parameter <code>from</code> represents the coroutine that is resetting <code>L</code>.
+If there is no such coroutine,
+this parameter can be <code>NULL</code>.
+
+
+<p>
+(This function was introduced in release&nbsp;5.4.6.)
@@ -4542,7 +4625,7 @@ Pops a key from the stack,
and pushes a key&ndash;value pair from the table at the given index,
the "next" pair after the given key.
If there are no more elements in the table,
-then <a href="#lua_next"><code>lua_next</code></a> returns 0 and pushes nothing.
+then <a href="#lua_next"><code>lua_next</code></a> returns&nbsp;0 and pushes nothing.
<p>
@@ -4985,6 +5068,7 @@ Also returns&nbsp;0 if any of the indices are not valid.
<p>
Similar to <a href="#lua_gettable"><code>lua_gettable</code></a>, but does a raw access
(i.e., without metamethods).
+The value at <code>index</code> must be a table.
@@ -5051,6 +5135,7 @@ For other values, this call returns&nbsp;0.
<p>
Similar to <a href="#lua_settable"><code>lua_settable</code></a>, but does a raw assignment
(i.e., without metamethods).
+The value at <code>index</code> must be a table.
@@ -5166,15 +5251,9 @@ and then pops the top element.
<pre>int lua_resetthread (lua_State *L);</pre>
<p>
-Resets a thread, cleaning its call stack and closing all pending
-to-be-closed variables.
-Returns a status code:
-<a href="#pdf-LUA_OK"><code>LUA_OK</code></a> for no errors in the thread
-(either the original error that stopped the thread or
-errors in closing methods),
-or an error status otherwise.
-In case of error,
-leaves the error object on the top of the stack.
+This function is deprecated;
+it is equivalent to <a href="#lua_closethread"><code>lua_closethread</code></a> with
+<code>from</code> being <code>NULL</code>.
@@ -5492,7 +5571,7 @@ otherwise, returns <code>NULL</code>.
<hr><h3><a name="lua_toclose"><code>lua_toclose</code></a></h3><p>
-<span class="apii">[-0, +0, <em>m</em>]</span>
+<span class="apii">[-0, +0, <em>v</em>]</span>
<pre>void lua_toclose (lua_State *L, int index);</pre>
<p>
@@ -5513,6 +5592,11 @@ unless previously deactivated by <a href="#lua_closeslot"><code>lua_closeslot</c
<p>
+This function raises an error if the value at the given slot
+neither has a <code>__close</code> metamethod nor is a false value.
+
+
+<p>
This function should not be called for an index
that is equal to or below an active to-be-closed slot.
@@ -5585,6 +5669,12 @@ after its last character (as in&nbsp;C),
but can contain other zeros in its body.
+<p>
+This function can raise memory errors only
+when converting a number to a string
+(as then it may create a new string).
+
+
@@ -6033,7 +6123,7 @@ the number of parameters of the function
</li>
<li><b><code>isvararg</code>: </b>
-true if the function is a vararg function
+true if the function is a variadic function
(always true for C&nbsp;functions).
</li>
@@ -6773,7 +6863,7 @@ Equivalent to the sequence
<pre>void luaL_buffsub (luaL_Buffer *B, int n);</pre>
<p>
-Removes <code>n</code> bytes from the the buffer <code>B</code>
+Removes <code>n</code> bytes from the buffer <code>B</code>
(see <a href="#luaL_Buffer"><code>luaL_Buffer</code></a>).
The buffer must have at least that many bytes.
@@ -6968,8 +7058,8 @@ It is defined as the following macro:
<pre>
(luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0))
</pre><p>
-It returns <a href="#pdf-LUA_OK"><code>LUA_OK</code></a> if there are no errors,
-or an error code in case of errors (see <a href="#4.4.1">&sect;4.4.1</a>).
+It returns&nbsp;0 (<a href="#pdf-LUA_OK"><code>LUA_OK</code></a>) if there are no errors,
+or 1 in case of errors.
@@ -6986,8 +7076,8 @@ It is defined as the following macro:
<pre>
(luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0))
</pre><p>
-It returns <a href="#pdf-LUA_OK"><code>LUA_OK</code></a> if there are no errors,
-or an error code in case of errors (see <a href="#4.4.1">&sect;4.4.1</a>).
+It returns&nbsp;0 (<a href="#pdf-LUA_OK"><code>LUA_OK</code></a>) if there are no errors,
+or 1 in case of errors.
@@ -7294,7 +7384,7 @@ with <code>tname</code> in the registry.
<p>
Creates a new Lua state.
It calls <a href="#lua_newstate"><code>lua_newstate</code></a> with an
-allocator based on the standard&nbsp;C allocation functions
+allocator based on the ISO&nbsp;C allocation functions
and then sets a warning function and a panic function (see <a href="#4.4">&sect;4.4</a>)
that print messages to the standard error output.
@@ -7685,9 +7775,7 @@ to start the traceback.
<hr><h3><a name="luaL_typeerror"><code>luaL_typeerror</code></a></h3><p>
<span class="apii">[-0, +0, <em>v</em>]</span>
-<pre>const char *luaL_typeerror (lua_State *L,
- int arg,
- const char *tname);</pre>
+<pre>int luaL_typeerror (lua_State *L, int arg, const char *tname);</pre>
<p>
Raises a type error for the argument <code>arg</code>
@@ -8708,6 +8796,8 @@ When you require a module <code>modname</code> and
This variable is only a reference to the real table;
assignments to this variable do not change the
table used by <a href="#pdf-require"><code>require</code></a>.
+The real table is stored in the C registry (see <a href="#4.3">&sect;4.3</a>),
+indexed by the key <a name="pdf-LUA_LOADED_TABLE"><code>LUA_LOADED_TABLE</code></a>, a string.
@@ -8745,7 +8835,7 @@ including if necessary a path and an extension.
<p>
-This function is not supported by Standard&nbsp;C.
+This functionality is not supported by ISO&nbsp;C.
As such, it is only available on some platforms
(Windows, Linux, Mac OS X, Solaris, BSD,
plus other Unix systems that support the <code>dlfcn</code> standard).
@@ -8799,6 +8889,8 @@ A table to store loaders for specific modules
This variable is only a reference to the real table;
assignments to this variable do not change the
table used by <a href="#pdf-require"><code>require</code></a>.
+The real table is stored in the C registry (see <a href="#4.3">&sect;4.3</a>),
+indexed by the key <a name="pdf-LUA_PRELOAD_TABLE"><code>LUA_PRELOAD_TABLE</code></a>, a string.
@@ -9311,7 +9403,7 @@ according to the format string <code>fmt</code> (see <a href="#6.4.2">&sect;6.4.
<p>
-Returns the size of a string resulting from <a href="#pdf-string.pack"><code>string.pack</code></a>
+Returns the length of a string resulting from <a href="#pdf-string.pack"><code>string.pack</code></a>
with the given format.
The format string cannot have the variable-length options
'<code>s</code>' or '<code>z</code>' (see <a href="#6.4.2">&sect;6.4.2</a>).
@@ -10091,9 +10183,9 @@ Returns the arc sine of <code>x</code> (in radians).
<p>
-
+
Returns the arc tangent of <code>y/x</code> (in radians),
-but uses the signs of both arguments to find the
+using the signs of both arguments to find the
quadrant of the result.
It also handles correctly the case of <code>x</code> being zero.
@@ -10953,7 +11045,7 @@ The default value for <code>code</code> is <b>true</b>.
<p>
If the optional second argument <code>close</code> is true,
-closes the Lua state before exiting.
+the function closes the Lua state before exiting (see <a href="#lua_close"><code>lua_close</code></a>).
@@ -11195,13 +11287,13 @@ The returned table can contain all the fields returned by <a href="#lua_getinfo"
with the string <code>what</code> describing which fields to fill in.
The default for <code>what</code> is to get all information available,
except the table of valid lines.
-If present,
-the option '<code>f</code>'
+The option '<code>f</code>'
adds a field named <code>func</code> with the function itself.
-If present,
-the option '<code>L</code>'
-adds a field named <code>activelines</code> with the table of
-valid lines.
+The option '<code>L</code>' adds a field named <code>activelines</code>
+with the table of valid lines,
+provided the function is a Lua function.
+If the function has no debug information,
+the table is empty.
<p>
@@ -11503,12 +11595,18 @@ The options are:
<li><b><code>-i</code>: </b> enter interactive mode after running <em>script</em>;</li>
<li><b><code>-l <em>mod</em></code>: </b> "require" <em>mod</em> and assign the
result to global <em>mod</em>;</li>
+<li><b><code>-l <em>g=mod</em></code>: </b> "require" <em>mod</em> and assign the
+ result to global <em>g</em>;</li>
<li><b><code>-v</code>: </b> print version information;</li>
<li><b><code>-E</code>: </b> ignore environment variables;</li>
<li><b><code>-W</code>: </b> turn warnings on;</li>
<li><b><code>--</code>: </b> stop handling options;</li>
<li><b><code>-</code>: </b> execute <code>stdin</code> as a file and stop handling options.</li>
</ul><p>
+(The form <code>-l <em>g=mod</em></code> was introduced in release&nbsp;5.4.4.)
+
+
+<p>
After handling its options, <code>lua</code> runs the given <em>script</em>.
When called without arguments,
<code>lua</code> behaves as <code>lua -v -i</code>
@@ -11532,6 +11630,10 @@ Lua does not consult any environment variables.
In particular,
the values of <a href="#pdf-package.path"><code>package.path</code></a> and <a href="#pdf-package.cpath"><code>package.cpath</code></a>
are set with the default paths defined in <code>luaconf.h</code>.
+To signal to the libraries that this option is on,
+the stand-alone interpreter sets the field
+<code>"LUA_NOENV"</code> in the registry to a true value.
+Other libraries may consult this field for the same purpose.
<p>
@@ -11582,7 +11684,7 @@ If there is a script,
the script is called with arguments
<code>arg[1]</code>, &middot;&middot;&middot;, <code>arg[#arg]</code>.
Like all chunks in Lua,
-the script is compiled as a vararg function.
+the script is compiled as a variadic function.
<p>
@@ -11946,13 +12048,12 @@ and LiteralString, see <a href="#3.1">&sect;3.1</a>.)
-
<P CLASS="footer">
Last update:
-Thu Jan 13 11:33:16 UTC 2022
+Thu Jun 13 22:15:52 UTC 2024
</P>
<!--
-Last change: revised for Lua 5.4.4
+Last change: revised for Lua 5.4.7
-->
</body></html>
diff --git a/3rdparty/lua/doc/osi-certified-72x60.png b/3rdparty/lua/doc/osi-certified-72x60.png
deleted file mode 100644
index 07df5f6ee7a..00000000000
--- a/3rdparty/lua/doc/osi-certified-72x60.png
+++ /dev/null
Binary files differ
diff --git a/3rdparty/lua/doc/readme.html b/3rdparty/lua/doc/readme.html
index 8afe38de923..3bcefadfe9a 100644
--- a/3rdparty/lua/doc/readme.html
+++ b/3rdparty/lua/doc/readme.html
@@ -29,7 +29,7 @@ tt, kbd, code {
<BODY>
<H1>
-<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
+<A HREF="https://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A>
Welcome to Lua 5.4
</H1>
@@ -49,29 +49,31 @@ Welcome to Lua 5.4
<P>
Lua is a powerful, efficient, lightweight, embeddable scripting language
developed by a
-<A HREF="http://www.lua.org/authors.html">team</A>
+<A HREF="https://www.lua.org/authors.html">team</A>
at
-<A HREF="http://www.puc-rio.br/">PUC-Rio</A>,
+<A HREF="https://www.puc-rio.br/">PUC-Rio</A>,
the Pontifical Catholic University of Rio de Janeiro in Brazil.
Lua is
<A HREF="#license">free software</A>
used in
-<A HREF="http://www.lua.org/uses.html">many products and projects</A>
+<A HREF="https://www.lua.org/uses.html">many products and projects</A>
around the world.
<P>
Lua's
-<A HREF="http://www.lua.org/">official web site</A>
+<A HREF="https://www.lua.org/">official website</A>
provides complete information
about Lua,
including
an
-<A HREF="http://www.lua.org/about.html">executive summary</A>
+<A HREF="https://www.lua.org/about.html">executive summary</A>,
+tips on
+<A HREF="https://www.lua.org/start.html">getting started</A>,
and
updated
-<A HREF="http://www.lua.org/docs.html">documentation</A>,
+<A HREF="https://www.lua.org/docs.html">documentation</A>,
especially the
-<A HREF="http://www.lua.org/manual/5.4/">reference manual</A>,
+<A HREF="https://www.lua.org/manual/5.4/">reference manual</A>,
which may differ slightly from the
<A HREF="contents.html">local copy</A>
distributed in this package.
@@ -79,7 +81,7 @@ distributed in this package.
<H2><A NAME="install">Installing Lua</A></H2>
<P>
Lua is distributed in
-<A HREF="http://www.lua.org/ftp/">source</A>
+<A HREF="https://www.lua.org/ftp/">source</A>
form.
You need to build it before using it.
Building Lua should be straightforward
@@ -88,7 +90,7 @@ Lua is implemented in pure ANSI C and compiles unmodified in all known
platforms that have an ANSI C compiler.
Lua also compiles unmodified as C++.
The instructions given below for building Lua are for Unix-like platforms,
-such as Linux and Mac OS X.
+such as Linux and macOS.
See also
<A HREF="#other">instructions for other systems</A>
and
@@ -97,10 +99,7 @@ and
<P>
If you don't have the time or the inclination to compile Lua yourself,
get a binary from
-<A HREF="http://lua-users.org/wiki/LuaBinaries">LuaBinaries</A>.
-Try also
-<A HREF="http://luadist.org/">LuaDist</A>,
-a multi-platform distribution of Lua that includes batteries.
+<A HREF="https://luabinaries.sourceforge.net">LuaBinaries</A>.
<H3>Building Lua</H3>
<P>
@@ -110,7 +109,7 @@ Here are the details.
<OL>
<LI>
Open a terminal window and move to
-the top-level directory, which is named <TT>lua-5.4.4</TT>.
+the top-level directory, which is named <TT>lua-5.4.7</TT>.
The <TT>Makefile</TT> there controls both the build process and the installation process.
<P>
<LI>
@@ -121,7 +120,7 @@ The <TT>Makefile</TT> there controls both the build process and the installation
The platforms currently supported are:
<P>
<P CLASS="display">
- guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
+ guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
</P>
<P>
If your platform is listed, just do "<KBD>make xxx</KBD>", where xxx
@@ -214,8 +213,8 @@ then try "<KBD>make linux-readline MYLIBS=-ltermcap</KBD>".
record the changes you've made.
<P>
- On the other hand, if you need to customize some Lua features, you'll need
- to edit <TT>src/luaconf.h</TT> before building and installing Lua.
+ On the other hand, if you need to customize some Lua features,
+ edit <TT>src/luaconf.h</TT> before building and installing Lua.
The edited file will be the one installed, and
it will be used by any Lua clients that you build, to ensure consistency.
Further customization is available to experts by editing the Lua sources.
@@ -244,7 +243,7 @@ compiler:
</DL>
<P>
- To use Lua as a library in your own programs, you'll need to know how to
+ To use Lua as a library in your own programs, you need to know how to
create and use libraries with your compiler. Moreover, to dynamically load
C libraries for Lua, you'll need to know how to create dynamic libraries
and you'll need to make sure that the Lua API functions are accessible to
@@ -287,11 +286,11 @@ lists the
<H2><A NAME="license">License</A></H2>
<P>
-<A HREF="http://www.opensource.org/docs/definition.php">
-<IMG SRC="osi-certified-72x60.png" ALIGN="right" ALT="[osi certified]" STYLE="padding-left: 30px ;">
+<A HREF="https://opensource.org/osd">
+<IMG SRC="OSIApproved_100X125.png" ALIGN="right" ALT="[Open Source Initiative Approved License]" STYLE="padding-left: 1em" WIDTH=50>
</A>
Lua is free software distributed under the terms of the
-<A HREF="http://www.opensource.org/licenses/mit-license.html">MIT license</A>
+<A HREF="https://opensource.org/license/mit">MIT license</A>
reproduced below;
it may be used for any purpose, including commercial purposes,
at absolutely no cost without having to ask us.
@@ -299,11 +298,11 @@ at absolutely no cost without having to ask us.
The only requirement is that if you do use Lua,
then you should give us credit by including the appropriate copyright notice somewhere in your product or its documentation.
-For details, see
-<A HREF="http://www.lua.org/license.html">this</A>.
+For details, see the
+<A HREF="https://www.lua.org/license.html">license page</A>.
<BLOCKQUOTE STYLE="padding-bottom: 0em">
-Copyright &copy; 1994&ndash;2022 Lua.org, PUC-Rio.
+Copyright &copy; 1994&ndash;2024 Lua.org, PUC-Rio.
<P>
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -330,10 +329,10 @@ THE SOFTWARE.
<P CLASS="footer">
Last update:
-Mon Jan 3 09:54:18 UTC 2022
+Wed May 8 21:56:16 UTC 2024
</P>
<!--
-Last change: revised for Lua 5.4.4
+Last change: revised for Lua 5.4.7
-->
</BODY>
diff --git a/3rdparty/lua/src/Makefile b/3rdparty/lua/src/Makefile
index 1907381fef0..b7711963bcc 100644
--- a/3rdparty/lua/src/Makefile
+++ b/3rdparty/lua/src/Makefile
@@ -30,7 +30,7 @@ CMCFLAGS=
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
-PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
+PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
LUA_A= liblua.a
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
@@ -117,6 +117,9 @@ FreeBSD NetBSD OpenBSD freebsd:
generic: $(ALL)
+ios:
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_IOS"
+
Linux linux: linux-noreadline
linux-noreadline:
diff --git a/3rdparty/lua/src/lapi.c b/3rdparty/lua/src/lapi.c
index 5ee65792d27..332e97d1695 100644
--- a/3rdparty/lua/src/lapi.c
+++ b/3rdparty/lua/src/lapi.c
@@ -60,27 +60,28 @@ const char lua_ident[] =
static TValue *index2value (lua_State *L, int idx) {
CallInfo *ci = L->ci;
if (idx > 0) {
- StkId o = ci->func + idx;
- api_check(L, idx <= L->ci->top - (ci->func + 1), "unacceptable index");
- if (o >= L->top) return &G(L)->nilvalue;
+ StkId o = ci->func.p + idx;
+ api_check(L, idx <= ci->top.p - (ci->func.p + 1), "unacceptable index");
+ if (o >= L->top.p) return &G(L)->nilvalue;
else return s2v(o);
}
else if (!ispseudo(idx)) { /* negative index */
- api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index");
- return s2v(L->top + idx);
+ api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1),
+ "invalid index");
+ return s2v(L->top.p + idx);
}
else if (idx == LUA_REGISTRYINDEX)
return &G(L)->l_registry;
else { /* upvalues */
idx = LUA_REGISTRYINDEX - idx;
api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large");
- if (ttisCclosure(s2v(ci->func))) { /* C closure? */
- CClosure *func = clCvalue(s2v(ci->func));
+ if (ttisCclosure(s2v(ci->func.p))) { /* C closure? */
+ CClosure *func = clCvalue(s2v(ci->func.p));
return (idx <= func->nupvalues) ? &func->upvalue[idx-1]
: &G(L)->nilvalue;
}
else { /* light C function or Lua function (through a hook)?) */
- api_check(L, ttislcf(s2v(ci->func)), "caller not a C function");
+ api_check(L, ttislcf(s2v(ci->func.p)), "caller not a C function");
return &G(L)->nilvalue; /* no upvalues */
}
}
@@ -94,14 +95,15 @@ static TValue *index2value (lua_State *L, int idx) {
l_sinline StkId index2stack (lua_State *L, int idx) {
CallInfo *ci = L->ci;
if (idx > 0) {
- StkId o = ci->func + idx;
- api_check(L, o < L->top, "invalid index");
+ StkId o = ci->func.p + idx;
+ api_check(L, o < L->top.p, "invalid index");
return o;
}
else { /* non-positive index */
- api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index");
+ api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1),
+ "invalid index");
api_check(L, !ispseudo(idx), "invalid index");
- return L->top + idx;
+ return L->top.p + idx;
}
}
@@ -112,17 +114,12 @@ LUA_API int lua_checkstack (lua_State *L, int n) {
lua_lock(L);
ci = L->ci;
api_check(L, n >= 0, "negative 'n'");
- if (L->stack_last - L->top > n) /* stack large enough? */
+ if (L->stack_last.p - L->top.p > n) /* stack large enough? */
res = 1; /* yes; check is OK */
- else { /* no; need to grow stack */
- int inuse = cast_int(L->top - L->stack) + EXTRA_STACK;
- if (inuse > LUAI_MAXSTACK - n) /* can grow without overflow? */
- res = 0; /* no */
- else /* try to grow stack */
- res = luaD_growstack(L, n, 0);
- }
- if (res && ci->top < L->top + n)
- ci->top = L->top + n; /* adjust frame top */
+ else /* need to grow stack */
+ res = luaD_growstack(L, n, 0);
+ if (res && ci->top.p < L->top.p + n)
+ ci->top.p = L->top.p + n; /* adjust frame top */
lua_unlock(L);
return res;
}
@@ -134,11 +131,11 @@ LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) {
lua_lock(to);
api_checknelems(from, n);
api_check(from, G(from) == G(to), "moving among independent states");
- api_check(from, to->ci->top - to->top >= n, "stack overflow");
- from->top -= n;
+ api_check(from, to->ci->top.p - to->top.p >= n, "stack overflow");
+ from->top.p -= n;
for (i = 0; i < n; i++) {
- setobjs2s(to, to->top, from->top + i);
- to->top++; /* stack already checked by previous 'api_check' */
+ setobjs2s(to, to->top.p, from->top.p + i);
+ to->top.p++; /* stack already checked by previous 'api_check' */
}
lua_unlock(to);
}
@@ -172,12 +169,12 @@ LUA_API lua_Number lua_version (lua_State *L) {
LUA_API int lua_absindex (lua_State *L, int idx) {
return (idx > 0 || ispseudo(idx))
? idx
- : cast_int(L->top - L->ci->func) + idx;
+ : cast_int(L->top.p - L->ci->func.p) + idx;
}
LUA_API int lua_gettop (lua_State *L) {
- return cast_int(L->top - (L->ci->func + 1));
+ return cast_int(L->top.p - (L->ci->func.p + 1));
}
@@ -187,24 +184,24 @@ LUA_API void lua_settop (lua_State *L, int idx) {
ptrdiff_t diff; /* difference for new top */
lua_lock(L);
ci = L->ci;
- func = ci->func;
+ func = ci->func.p;
if (idx >= 0) {
- api_check(L, idx <= ci->top - (func + 1), "new top too large");
- diff = ((func + 1) + idx) - L->top;
+ api_check(L, idx <= ci->top.p - (func + 1), "new top too large");
+ diff = ((func + 1) + idx) - L->top.p;
for (; diff > 0; diff--)
- setnilvalue(s2v(L->top++)); /* clear new slots */
+ setnilvalue(s2v(L->top.p++)); /* clear new slots */
}
else {
- api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top");
+ api_check(L, -(idx+1) <= (L->top.p - (func + 1)), "invalid new top");
diff = idx + 1; /* will "subtract" index (as it is negative) */
}
- api_check(L, L->tbclist < L->top, "previous pop of an unclosed slot");
- newtop = L->top + diff;
- if (diff < 0 && L->tbclist >= newtop) {
+ api_check(L, L->tbclist.p < L->top.p, "previous pop of an unclosed slot");
+ newtop = L->top.p + diff;
+ if (diff < 0 && L->tbclist.p >= newtop) {
lua_assert(hastocloseCfunc(ci->nresults));
- luaF_close(L, newtop, CLOSEKTOP, 0);
+ newtop = luaF_close(L, newtop, CLOSEKTOP, 0);
}
- L->top = newtop; /* correct top only after closing any upvalue */
+ L->top.p = newtop; /* correct top only after closing any upvalue */
lua_unlock(L);
}
@@ -213,10 +210,9 @@ LUA_API void lua_closeslot (lua_State *L, int idx) {
StkId level;
lua_lock(L);
level = index2stack(L, idx);
- api_check(L, hastocloseCfunc(L->ci->nresults) && L->tbclist == level,
+ api_check(L, hastocloseCfunc(L->ci->nresults) && L->tbclist.p == level,
"no variable to close at given level");
- luaF_close(L, level, CLOSEKTOP, 0);
- level = index2stack(L, idx); /* stack may be moved */
+ level = luaF_close(L, level, CLOSEKTOP, 0);
setnilvalue(s2v(level));
lua_unlock(L);
}
@@ -245,7 +241,7 @@ l_sinline void reverse (lua_State *L, StkId from, StkId to) {
LUA_API void lua_rotate (lua_State *L, int idx, int n) {
StkId p, t, m;
lua_lock(L);
- t = L->top - 1; /* end of stack segment being rotated */
+ t = L->top.p - 1; /* end of stack segment being rotated */
p = index2stack(L, idx); /* start of segment */
api_check(L, (n >= 0 ? n : -n) <= (t - p + 1), "invalid 'n'");
m = (n >= 0 ? t - n : p - n - 1); /* end of prefix */
@@ -264,7 +260,7 @@ LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) {
api_check(L, isvalid(L, to), "invalid index");
setobj(L, to, fr);
if (isupvalue(toidx)) /* function upvalue? */
- luaC_barrier(L, clCvalue(s2v(L->ci->func)), fr);
+ luaC_barrier(L, clCvalue(s2v(L->ci->func.p)), fr);
/* LUA_REGISTRYINDEX does not need gc barrier
(collector revisits it before finishing collection) */
lua_unlock(L);
@@ -273,7 +269,7 @@ LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) {
LUA_API void lua_pushvalue (lua_State *L, int idx) {
lua_lock(L);
- setobj2s(L, L->top, index2value(L, idx));
+ setobj2s(L, L->top.p, index2value(L, idx));
api_incr_top(L);
lua_unlock(L);
}
@@ -342,12 +338,12 @@ LUA_API void lua_arith (lua_State *L, int op) {
api_checknelems(L, 2); /* all other operations expect two operands */
else { /* for unary operations, add fake 2nd operand */
api_checknelems(L, 1);
- setobjs2s(L, L->top, L->top - 1);
+ setobjs2s(L, L->top.p, L->top.p - 1);
api_incr_top(L);
}
/* first operand at top - 2, second at top - 1; result go to top - 2 */
- luaO_arith(L, op, s2v(L->top - 2), s2v(L->top - 1), L->top - 2);
- L->top--; /* remove second operand */
+ luaO_arith(L, op, s2v(L->top.p - 2), s2v(L->top.p - 1), L->top.p - 2);
+ L->top.p--; /* remove second operand */
lua_unlock(L);
}
@@ -373,7 +369,7 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {
LUA_API size_t lua_stringtonumber (lua_State *L, const char *s) {
- size_t sz = luaO_str2num(s, s2v(L->top));
+ size_t sz = luaO_str2num(s, s2v(L->top.p));
if (sz != 0)
api_incr_top(L);
return sz;
@@ -421,9 +417,9 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
o = index2value(L, idx); /* previous call may reallocate the stack */
}
if (len != NULL)
- *len = vslen(o);
+ *len = tsslen(tsvalue(o));
lua_unlock(L);
- return svalue(o);
+ return getstr(tsvalue(o));
}
@@ -500,7 +496,7 @@ LUA_API const void *lua_topointer (lua_State *L, int idx) {
LUA_API void lua_pushnil (lua_State *L) {
lua_lock(L);
- setnilvalue(s2v(L->top));
+ setnilvalue(s2v(L->top.p));
api_incr_top(L);
lua_unlock(L);
}
@@ -508,7 +504,7 @@ LUA_API void lua_pushnil (lua_State *L) {
LUA_API void lua_pushnumber (lua_State *L, lua_Number n) {
lua_lock(L);
- setfltvalue(s2v(L->top), n);
+ setfltvalue(s2v(L->top.p), n);
api_incr_top(L);
lua_unlock(L);
}
@@ -516,7 +512,7 @@ LUA_API void lua_pushnumber (lua_State *L, lua_Number n) {
LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) {
lua_lock(L);
- setivalue(s2v(L->top), n);
+ setivalue(s2v(L->top.p), n);
api_incr_top(L);
lua_unlock(L);
}
@@ -531,7 +527,7 @@ LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
TString *ts;
lua_lock(L);
ts = (len == 0) ? luaS_new(L, "") : luaS_newlstr(L, s, len);
- setsvalue2s(L, L->top, ts);
+ setsvalue2s(L, L->top.p, ts);
api_incr_top(L);
luaC_checkGC(L);
lua_unlock(L);
@@ -542,11 +538,11 @@ LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
LUA_API const char *lua_pushstring (lua_State *L, const char *s) {
lua_lock(L);
if (s == NULL)
- setnilvalue(s2v(L->top));
+ setnilvalue(s2v(L->top.p));
else {
TString *ts;
ts = luaS_new(L, s);
- setsvalue2s(L, L->top, ts);
+ setsvalue2s(L, L->top.p, ts);
s = getstr(ts); /* internal copy's address */
}
api_incr_top(L);
@@ -583,7 +579,7 @@ LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) {
LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
lua_lock(L);
if (n == 0) {
- setfvalue(s2v(L->top), fn);
+ setfvalue(s2v(L->top.p), fn);
api_incr_top(L);
}
else {
@@ -592,13 +588,13 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
api_check(L, n <= MAXUPVAL, "upvalue index too large");
cl = luaF_newCclosure(L, n);
cl->f = fn;
- L->top -= n;
+ L->top.p -= n;
while (n--) {
- setobj2n(L, &cl->upvalue[n], s2v(L->top + n));
+ setobj2n(L, &cl->upvalue[n], s2v(L->top.p + n));
/* does not need barrier because closure is white */
lua_assert(iswhite(cl));
}
- setclCvalue(L, s2v(L->top), cl);
+ setclCvalue(L, s2v(L->top.p), cl);
api_incr_top(L);
luaC_checkGC(L);
}
@@ -609,9 +605,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
LUA_API void lua_pushboolean (lua_State *L, int b) {
lua_lock(L);
if (b)
- setbtvalue(s2v(L->top));
+ setbtvalue(s2v(L->top.p));
else
- setbfvalue(s2v(L->top));
+ setbfvalue(s2v(L->top.p));
api_incr_top(L);
lua_unlock(L);
}
@@ -619,7 +615,7 @@ LUA_API void lua_pushboolean (lua_State *L, int b) {
LUA_API void lua_pushlightuserdata (lua_State *L, void *p) {
lua_lock(L);
- setpvalue(s2v(L->top), p);
+ setpvalue(s2v(L->top.p), p);
api_incr_top(L);
lua_unlock(L);
}
@@ -627,7 +623,7 @@ LUA_API void lua_pushlightuserdata (lua_State *L, void *p) {
LUA_API int lua_pushthread (lua_State *L) {
lua_lock(L);
- setthvalue(L, s2v(L->top), L);
+ setthvalue(L, s2v(L->top.p), L);
api_incr_top(L);
lua_unlock(L);
return (G(L)->mainthread == L);
@@ -644,16 +640,16 @@ l_sinline int auxgetstr (lua_State *L, const TValue *t, const char *k) {
const TValue *slot;
TString *str = luaS_new(L, k);
if (luaV_fastget(L, t, str, slot, luaH_getstr)) {
- setobj2s(L, L->top, slot);
+ setobj2s(L, L->top.p, slot);
api_incr_top(L);
}
else {
- setsvalue2s(L, L->top, str);
+ setsvalue2s(L, L->top.p, str);
api_incr_top(L);
- luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot);
+ luaV_finishget(L, t, s2v(L->top.p - 1), L->top.p - 1, slot);
}
lua_unlock(L);
- return ttype(s2v(L->top - 1));
+ return ttype(s2v(L->top.p - 1));
}
@@ -680,13 +676,13 @@ LUA_API int lua_gettable (lua_State *L, int idx) {
TValue *t;
lua_lock(L);
t = index2value(L, idx);
- if (luaV_fastget(L, t, s2v(L->top - 1), slot, luaH_get)) {
- setobj2s(L, L->top - 1, slot);
+ if (luaV_fastget(L, t, s2v(L->top.p - 1), slot, luaH_get)) {
+ setobj2s(L, L->top.p - 1, slot);
}
else
- luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot);
+ luaV_finishget(L, t, s2v(L->top.p - 1), L->top.p - 1, slot);
lua_unlock(L);
- return ttype(s2v(L->top - 1));
+ return ttype(s2v(L->top.p - 1));
}
@@ -702,27 +698,27 @@ LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) {
lua_lock(L);
t = index2value(L, idx);
if (luaV_fastgeti(L, t, n, slot)) {
- setobj2s(L, L->top, slot);
+ setobj2s(L, L->top.p, slot);
}
else {
TValue aux;
setivalue(&aux, n);
- luaV_finishget(L, t, &aux, L->top, slot);
+ luaV_finishget(L, t, &aux, L->top.p, slot);
}
api_incr_top(L);
lua_unlock(L);
- return ttype(s2v(L->top - 1));
+ return ttype(s2v(L->top.p - 1));
}
l_sinline int finishrawget (lua_State *L, const TValue *val) {
if (isempty(val)) /* avoid copying empty items to the stack */
- setnilvalue(s2v(L->top));
+ setnilvalue(s2v(L->top.p));
else
- setobj2s(L, L->top, val);
+ setobj2s(L, L->top.p, val);
api_incr_top(L);
lua_unlock(L);
- return ttype(s2v(L->top - 1));
+ return ttype(s2v(L->top.p - 1));
}
@@ -739,8 +735,8 @@ LUA_API int lua_rawget (lua_State *L, int idx) {
lua_lock(L);
api_checknelems(L, 1);
t = gettable(L, idx);
- val = luaH_get(t, s2v(L->top - 1));
- L->top--; /* remove key */
+ val = luaH_get(t, s2v(L->top.p - 1));
+ L->top.p--; /* remove key */
return finishrawget(L, val);
}
@@ -767,7 +763,7 @@ LUA_API void lua_createtable (lua_State *L, int narray, int nrec) {
Table *t;
lua_lock(L);
t = luaH_new(L);
- sethvalue2s(L, L->top, t);
+ sethvalue2s(L, L->top.p, t);
api_incr_top(L);
if (narray > 0 || nrec > 0)
luaH_resize(L, t, narray, nrec);
@@ -794,7 +790,7 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) {
break;
}
if (mt != NULL) {
- sethvalue2s(L, L->top, mt);
+ sethvalue2s(L, L->top.p, mt);
api_incr_top(L);
res = 1;
}
@@ -810,12 +806,12 @@ LUA_API int lua_getiuservalue (lua_State *L, int idx, int n) {
o = index2value(L, idx);
api_check(L, ttisfulluserdata(o), "full userdata expected");
if (n <= 0 || n > uvalue(o)->nuvalue) {
- setnilvalue(s2v(L->top));
+ setnilvalue(s2v(L->top.p));
t = LUA_TNONE;
}
else {
- setobj2s(L, L->top, &uvalue(o)->uv[n - 1].uv);
- t = ttype(s2v(L->top));
+ setobj2s(L, L->top.p, &uvalue(o)->uv[n - 1].uv);
+ t = ttype(s2v(L->top.p));
}
api_incr_top(L);
lua_unlock(L);
@@ -835,14 +831,14 @@ static void auxsetstr (lua_State *L, const TValue *t, const char *k) {
TString *str = luaS_new(L, k);
api_checknelems(L, 1);
if (luaV_fastget(L, t, str, slot, luaH_getstr)) {
- luaV_finishfastset(L, t, slot, s2v(L->top - 1));
- L->top--; /* pop value */
+ luaV_finishfastset(L, t, slot, s2v(L->top.p - 1));
+ L->top.p--; /* pop value */
}
else {
- setsvalue2s(L, L->top, str); /* push 'str' (to make it a TValue) */
+ setsvalue2s(L, L->top.p, str); /* push 'str' (to make it a TValue) */
api_incr_top(L);
- luaV_finishset(L, t, s2v(L->top - 1), s2v(L->top - 2), slot);
- L->top -= 2; /* pop value and key */
+ luaV_finishset(L, t, s2v(L->top.p - 1), s2v(L->top.p - 2), slot);
+ L->top.p -= 2; /* pop value and key */
}
lua_unlock(L); /* lock done by caller */
}
@@ -862,12 +858,12 @@ LUA_API void lua_settable (lua_State *L, int idx) {
lua_lock(L);
api_checknelems(L, 2);
t = index2value(L, idx);
- if (luaV_fastget(L, t, s2v(L->top - 2), slot, luaH_get)) {
- luaV_finishfastset(L, t, slot, s2v(L->top - 1));
+ if (luaV_fastget(L, t, s2v(L->top.p - 2), slot, luaH_get)) {
+ luaV_finishfastset(L, t, slot, s2v(L->top.p - 1));
}
else
- luaV_finishset(L, t, s2v(L->top - 2), s2v(L->top - 1), slot);
- L->top -= 2; /* pop index and value */
+ luaV_finishset(L, t, s2v(L->top.p - 2), s2v(L->top.p - 1), slot);
+ L->top.p -= 2; /* pop index and value */
lua_unlock(L);
}
@@ -885,14 +881,14 @@ LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) {
api_checknelems(L, 1);
t = index2value(L, idx);
if (luaV_fastgeti(L, t, n, slot)) {
- luaV_finishfastset(L, t, slot, s2v(L->top - 1));
+ luaV_finishfastset(L, t, slot, s2v(L->top.p - 1));
}
else {
TValue aux;
setivalue(&aux, n);
- luaV_finishset(L, t, &aux, s2v(L->top - 1), slot);
+ luaV_finishset(L, t, &aux, s2v(L->top.p - 1), slot);
}
- L->top--; /* pop value */
+ L->top.p--; /* pop value */
lua_unlock(L);
}
@@ -902,16 +898,16 @@ static void aux_rawset (lua_State *L, int idx, TValue *key, int n) {
lua_lock(L);
api_checknelems(L, n);
t = gettable(L, idx);
- luaH_set(L, t, key, s2v(L->top - 1));
+ luaH_set(L, t, key, s2v(L->top.p - 1));
invalidateTMcache(t);
- luaC_barrierback(L, obj2gco(t), s2v(L->top - 1));
- L->top -= n;
+ luaC_barrierback(L, obj2gco(t), s2v(L->top.p - 1));
+ L->top.p -= n;
lua_unlock(L);
}
LUA_API void lua_rawset (lua_State *L, int idx) {
- aux_rawset(L, idx, s2v(L->top - 2), 2);
+ aux_rawset(L, idx, s2v(L->top.p - 2), 2);
}
@@ -927,9 +923,9 @@ LUA_API void lua_rawseti (lua_State *L, int idx, lua_Integer n) {
lua_lock(L);
api_checknelems(L, 1);
t = gettable(L, idx);
- luaH_setint(L, t, n, s2v(L->top - 1));
- luaC_barrierback(L, obj2gco(t), s2v(L->top - 1));
- L->top--;
+ luaH_setint(L, t, n, s2v(L->top.p - 1));
+ luaC_barrierback(L, obj2gco(t), s2v(L->top.p - 1));
+ L->top.p--;
lua_unlock(L);
}
@@ -940,11 +936,11 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) {
lua_lock(L);
api_checknelems(L, 1);
obj = index2value(L, objindex);
- if (ttisnil(s2v(L->top - 1)))
+ if (ttisnil(s2v(L->top.p - 1)))
mt = NULL;
else {
- api_check(L, ttistable(s2v(L->top - 1)), "table expected");
- mt = hvalue(s2v(L->top - 1));
+ api_check(L, ttistable(s2v(L->top.p - 1)), "table expected");
+ mt = hvalue(s2v(L->top.p - 1));
}
switch (ttype(obj)) {
case LUA_TTABLE: {
@@ -968,7 +964,7 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) {
break;
}
}
- L->top--;
+ L->top.p--;
lua_unlock(L);
return 1;
}
@@ -984,11 +980,11 @@ LUA_API int lua_setiuservalue (lua_State *L, int idx, int n) {
if (!(cast_uint(n) - 1u < cast_uint(uvalue(o)->nuvalue)))
res = 0; /* 'n' not in [1, uvalue(o)->nuvalue] */
else {
- setobj(L, &uvalue(o)->uv[n - 1].uv, s2v(L->top - 1));
- luaC_barrierback(L, gcvalue(o), s2v(L->top - 1));
+ setobj(L, &uvalue(o)->uv[n - 1].uv, s2v(L->top.p - 1));
+ luaC_barrierback(L, gcvalue(o), s2v(L->top.p - 1));
res = 1;
}
- L->top--;
+ L->top.p--;
lua_unlock(L);
return res;
}
@@ -1000,7 +996,8 @@ LUA_API int lua_setiuservalue (lua_State *L, int idx, int n) {
#define checkresults(L,na,nr) \
- api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \
+ api_check(L, (nr) == LUA_MULTRET \
+ || (L->ci->top.p - L->top.p >= (nr) - (na)), \
"results from function overflow current stack size")
@@ -1013,7 +1010,7 @@ LUA_API void lua_callk (lua_State *L, int nargs, int nresults,
api_checknelems(L, nargs+1);
api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
checkresults(L, nargs, nresults);
- func = L->top - (nargs+1);
+ func = L->top.p - (nargs+1);
if (k != NULL && yieldable(L)) { /* need to prepare continuation? */
L->ci->u.c.k = k; /* save continuation */
L->ci->u.c.ctx = ctx; /* save context */
@@ -1061,7 +1058,7 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
api_check(L, ttisfunction(s2v(o)), "error handler must be a function");
func = savestack(L, o);
}
- c.func = L->top - (nargs+1); /* function to be called */
+ c.func = L->top.p - (nargs+1); /* function to be called */
if (k == NULL || !yieldable(L)) { /* no continuation or no yieldable? */
c.nresults = nresults; /* do a 'conventional' protected call */
status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func);
@@ -1096,12 +1093,12 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
luaZ_init(L, &z, reader, data);
status = luaD_protectedparser(L, &z, chunkname, mode);
if (status == LUA_OK) { /* no errors? */
- LClosure *f = clLvalue(s2v(L->top - 1)); /* get newly created function */
+ LClosure *f = clLvalue(s2v(L->top.p - 1)); /* get new function */
if (f->nupvalues >= 1) { /* does it have an upvalue? */
/* get global table from registry */
const TValue *gt = getGtable(L);
/* set global table as 1st upvalue of 'f' (may be LUA_ENV) */
- setobj(L, f->upvals[0]->v, gt);
+ setobj(L, f->upvals[0]->v.p, gt);
luaC_barrier(L, f->upvals[0], gt);
}
}
@@ -1115,7 +1112,7 @@ LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data, int strip) {
TValue *o;
lua_lock(L);
api_checknelems(L, 1);
- o = s2v(L->top - 1);
+ o = s2v(L->top.p - 1);
if (isLfunction(o))
status = luaU_dump(L, getproto(o), writer, data, strip);
else
@@ -1241,7 +1238,7 @@ LUA_API int lua_gc (lua_State *L, int what, ...) {
LUA_API int lua_error (lua_State *L) {
TValue *errobj;
lua_lock(L);
- errobj = s2v(L->top - 1);
+ errobj = s2v(L->top.p - 1);
api_checknelems(L, 1);
/* error object is the memory error message? */
if (ttisshrstring(errobj) && eqshrstr(tsvalue(errobj), G(L)->memerrmsg))
@@ -1259,12 +1256,12 @@ LUA_API int lua_next (lua_State *L, int idx) {
lua_lock(L);
api_checknelems(L, 1);
t = gettable(L, idx);
- more = luaH_next(L, t, L->top - 1);
+ more = luaH_next(L, t, L->top.p - 1);
if (more) {
api_incr_top(L);
}
else /* no more elements */
- L->top -= 1; /* remove key */
+ L->top.p -= 1; /* remove key */
lua_unlock(L);
return more;
}
@@ -1276,7 +1273,7 @@ LUA_API void lua_toclose (lua_State *L, int idx) {
lua_lock(L);
o = index2stack(L, idx);
nresults = L->ci->nresults;
- api_check(L, L->tbclist < o, "given index below or equal a marked one");
+ api_check(L, L->tbclist.p < o, "given index below or equal a marked one");
luaF_newtbcupval(L, o); /* create new to-be-closed upvalue */
if (!hastocloseCfunc(nresults)) /* function not marked yet? */
L->ci->nresults = codeNresults(nresults); /* mark it */
@@ -1291,7 +1288,7 @@ LUA_API void lua_concat (lua_State *L, int n) {
if (n > 0)
luaV_concat(L, n);
else { /* nothing to concatenate */
- setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); /* push empty string */
+ setsvalue2s(L, L->top.p, luaS_newlstr(L, "", 0)); /* push empty string */
api_incr_top(L);
}
luaC_checkGC(L);
@@ -1303,7 +1300,7 @@ LUA_API void lua_len (lua_State *L, int idx) {
TValue *t;
lua_lock(L);
t = index2value(L, idx);
- luaV_objlen(L, L->top, t);
+ luaV_objlen(L, L->top.p, t);
api_incr_top(L);
lua_unlock(L);
}
@@ -1348,7 +1345,7 @@ LUA_API void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue) {
lua_lock(L);
api_check(L, 0 <= nuvalue && nuvalue < USHRT_MAX, "invalid value");
u = luaS_newudata(L, size, nuvalue);
- setuvalue(L, s2v(L->top), u);
+ setuvalue(L, s2v(L->top.p), u);
api_incr_top(L);
luaC_checkGC(L);
lua_unlock(L);
@@ -1374,7 +1371,7 @@ static const char *aux_upvalue (TValue *fi, int n, TValue **val,
Proto *p = f->p;
if (!(cast_uint(n) - 1u < cast_uint(p->sizeupvalues)))
return NULL; /* 'n' not in [1, p->sizeupvalues] */
- *val = f->upvals[n-1]->v;
+ *val = f->upvals[n-1]->v.p;
if (owner) *owner = obj2gco(f->upvals[n - 1]);
name = p->upvalues[n-1].name;
return (name == NULL) ? "(no name)" : getstr(name);
@@ -1390,7 +1387,7 @@ LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) {
lua_lock(L);
name = aux_upvalue(index2value(L, funcindex), n, &val, NULL);
if (name) {
- setobj2s(L, L->top, val);
+ setobj2s(L, L->top.p, val);
api_incr_top(L);
}
lua_unlock(L);
@@ -1408,8 +1405,8 @@ LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
api_checknelems(L, 1);
name = aux_upvalue(fi, n, &val, &owner);
if (name) {
- L->top--;
- setobj(L, val, s2v(L->top));
+ L->top.p--;
+ setobj(L, val, s2v(L->top.p));
luaC_barrier(L, owner, val);
}
lua_unlock(L);
diff --git a/3rdparty/lua/src/lapi.h b/3rdparty/lua/src/lapi.h
index 9e99cc44824..a742427cdc7 100644
--- a/3rdparty/lua/src/lapi.h
+++ b/3rdparty/lua/src/lapi.h
@@ -12,23 +12,26 @@
#include "lstate.h"
-/* Increments 'L->top', checking for stack overflows */
-#define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \
- "stack overflow");}
+/* Increments 'L->top.p', checking for stack overflows */
+#define api_incr_top(L) {L->top.p++; \
+ api_check(L, L->top.p <= L->ci->top.p, \
+ "stack overflow");}
/*
** If a call returns too many multiple returns, the callee may not have
** stack space to accommodate all results. In this case, this macro
-** increases its stack space ('L->ci->top').
+** increases its stack space ('L->ci->top.p').
*/
#define adjustresults(L,nres) \
- { if ((nres) <= LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; }
+ { if ((nres) <= LUA_MULTRET && L->ci->top.p < L->top.p) \
+ L->ci->top.p = L->top.p; }
/* Ensure the stack has at least 'n' elements */
-#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \
- "not enough elements in the stack")
+#define api_checknelems(L,n) \
+ api_check(L, (n) < (L->top.p - L->ci->func.p), \
+ "not enough elements in the stack")
/*
diff --git a/3rdparty/lua/src/lauxlib.c b/3rdparty/lua/src/lauxlib.c
index 8ed1da1122f..923105ed317 100644
--- a/3rdparty/lua/src/lauxlib.c
+++ b/3rdparty/lua/src/lauxlib.c
@@ -80,6 +80,7 @@ static int pushglobalfuncname (lua_State *L, lua_Debug *ar) {
int top = lua_gettop(L);
lua_getinfo(L, "f", ar); /* push function */
lua_getfield(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE);
+ luaL_checkstack(L, 6, "not enough stack"); /* slots for 'findfield' */
if (findfield(L, top + 1, 2)) {
const char *name = lua_tostring(L, -1);
if (strncmp(name, LUA_GNAME ".", 3) == 0) { /* name start with '_G.'? */
@@ -249,11 +250,13 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) {
return 1;
}
else {
+ const char *msg;
luaL_pushfail(L);
+ msg = (en != 0) ? strerror(en) : "(no extra info)";
if (fname)
- lua_pushfstring(L, "%s: %s", fname, strerror(en));
+ lua_pushfstring(L, "%s: %s", fname, msg);
else
- lua_pushstring(L, strerror(en));
+ lua_pushstring(L, msg);
lua_pushinteger(L, en);
return 3;
}
@@ -526,13 +529,14 @@ static void newbox (lua_State *L) {
/*
** Compute new size for buffer 'B', enough to accommodate extra 'sz'
-** bytes.
+** bytes. (The test for "not big enough" also gets the case when the
+** computation of 'newsize' overflows.)
*/
static size_t newbuffsize (luaL_Buffer *B, size_t sz) {
- size_t newsize = B->size * 2; /* double buffer size */
+ size_t newsize = (B->size / 2) * 3; /* buffer size * 1.5 */
if (l_unlikely(MAX_SIZET - sz < B->n)) /* overflow in (B->n + sz)? */
return luaL_error(B->L, "buffer too large");
- if (newsize < B->n + sz) /* double is not big enough? */
+ if (newsize < B->n + sz) /* not big enough? */
newsize = B->n + sz;
return newsize;
}
@@ -611,7 +615,7 @@ LUALIB_API void luaL_pushresultsize (luaL_Buffer *B, size_t sz) {
** box (if existent) is not on the top of the stack. So, instead of
** calling 'luaL_addlstring', it replicates the code using -2 as the
** last argument to 'prepbuffsize', signaling that the box is (or will
-** be) bellow the string being added to the buffer. (Box creation can
+** be) below the string being added to the buffer. (Box creation can
** trigger an emergency GC, so we should not remove the string from the
** stack before we have the space guaranteed.)
*/
@@ -731,25 +735,29 @@ static const char *getF (lua_State *L, void *ud, size_t *size) {
static int errfile (lua_State *L, const char *what, int fnameindex) {
- const char *serr = strerror(errno);
+ int err = errno;
const char *filename = lua_tostring(L, fnameindex) + 1;
- lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr);
+ if (err != 0)
+ lua_pushfstring(L, "cannot %s %s: %s", what, filename, strerror(err));
+ else
+ lua_pushfstring(L, "cannot %s %s", what, filename);
lua_remove(L, fnameindex);
return LUA_ERRFILE;
}
-static int skipBOM (LoadF *lf) {
- const char *p = "\xEF\xBB\xBF"; /* UTF-8 BOM mark */
- int c;
- lf->n = 0;
- do {
- c = getc(lf->f);
- if (c == EOF || c != *(const unsigned char *)p++) return c;
- lf->buff[lf->n++] = c; /* to be read by the parser */
- } while (*p != '\0');
- lf->n = 0; /* prefix matched; discard it */
- return getc(lf->f); /* return next character */
+/*
+** Skip an optional BOM at the start of a stream. If there is an
+** incomplete BOM (the first character is correct but the rest is
+** not), returns the first character anyway to force an error
+** (as no chunk can start with 0xEF).
+*/
+static int skipBOM (FILE *f) {
+ int c = getc(f); /* read first character */
+ if (c == 0xEF && getc(f) == 0xBB && getc(f) == 0xBF) /* correct BOM? */
+ return getc(f); /* ignore BOM and return next char */
+ else /* no (valid) BOM */
+ return c; /* return first character */
}
@@ -760,13 +768,13 @@ static int skipBOM (LoadF *lf) {
** first "valid" character of the file (after the optional BOM and
** a first-line comment).
*/
-static int skipcomment (LoadF *lf, int *cp) {
- int c = *cp = skipBOM(lf);
+static int skipcomment (FILE *f, int *cp) {
+ int c = *cp = skipBOM(f);
if (c == '#') { /* first line is a comment (Unix exec. file)? */
do { /* skip first line */
- c = getc(lf->f);
+ c = getc(f);
} while (c != EOF && c != '\n');
- *cp = getc(lf->f); /* skip end-of-line, if present */
+ *cp = getc(f); /* next character after comment, if present */
return 1; /* there was a comment */
}
else return 0; /* no comment */
@@ -785,18 +793,25 @@ LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename,
}
else {
lua_pushfstring(L, "@%s", filename);
+ errno = 0;
lf.f = fopen(filename, "r");
if (lf.f == NULL) return errfile(L, "open", fnameindex);
}
- if (skipcomment(&lf, &c)) /* read initial portion */
- lf.buff[lf.n++] = '\n'; /* add line to correct line numbers */
- if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */
- lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */
- if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
- skipcomment(&lf, &c); /* re-read initial portion */
+ lf.n = 0;
+ if (skipcomment(lf.f, &c)) /* read initial portion */
+ lf.buff[lf.n++] = '\n'; /* add newline to correct line numbers */
+ if (c == LUA_SIGNATURE[0]) { /* binary file? */
+ lf.n = 0; /* remove possible newline */
+ if (filename) { /* "real" file? */
+ errno = 0;
+ lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */
+ if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
+ skipcomment(lf.f, &c); /* re-read initial portion */
+ }
}
if (c != EOF)
lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */
+ errno = 0;
status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode);
readstatus = ferror(lf.f);
if (filename) fclose(lf.f); /* close file (even in case of errors) */
@@ -927,7 +942,7 @@ LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) {
LUALIB_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) {
luaL_checkstack(L, nup, "too many upvalues");
for (; l->name != NULL; l++) { /* fill the table with given functions */
- if (l->func == NULL) /* place holder? */
+ if (l->func == NULL) /* placeholder? */
lua_pushboolean(L, 0);
else {
int i;
@@ -1019,9 +1034,14 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
}
+/*
+** Standard panic funcion just prints an error message. The test
+** with 'lua_type' avoids possible memory errors in 'lua_tostring'.
+*/
static int panic (lua_State *L) {
- const char *msg = lua_tostring(L, -1);
- if (msg == NULL) msg = "error object is not a string";
+ const char *msg = (lua_type(L, -1) == LUA_TSTRING)
+ ? lua_tostring(L, -1)
+ : "error object is not a string";
lua_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n",
msg);
return 0; /* return to Lua to abort */
diff --git a/3rdparty/lua/src/lcode.c b/3rdparty/lua/src/lcode.c
index 06425a1db80..87616140ebe 100644
--- a/3rdparty/lua/src/lcode.c
+++ b/3rdparty/lua/src/lcode.c
@@ -415,7 +415,7 @@ int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) {
/*
** Format and emit an 'iAsBx' instruction.
*/
-int luaK_codeAsBx (FuncState *fs, OpCode o, int a, int bc) {
+static int codeAsBx (FuncState *fs, OpCode o, int a, int bc) {
unsigned int b = bc + OFFSET_sBx;
lua_assert(getOpMode(o) == iAsBx);
lua_assert(a <= MAXARG_A && b <= MAXARG_Bx);
@@ -671,7 +671,7 @@ static int fitsBx (lua_Integer i) {
void luaK_int (FuncState *fs, int reg, lua_Integer i) {
if (fitsBx(i))
- luaK_codeAsBx(fs, OP_LOADI, reg, cast_int(i));
+ codeAsBx(fs, OP_LOADI, reg, cast_int(i));
else
luaK_codek(fs, reg, luaK_intK(fs, i));
}
@@ -680,7 +680,7 @@ void luaK_int (FuncState *fs, int reg, lua_Integer i) {
static void luaK_float (FuncState *fs, int reg, lua_Number f) {
lua_Integer fi;
if (luaV_flttointeger(f, &fi, F2Ieq) && fitsBx(fi))
- luaK_codeAsBx(fs, OP_LOADF, reg, cast_int(fi));
+ codeAsBx(fs, OP_LOADF, reg, cast_int(fi));
else
luaK_codek(fs, reg, luaK_numberK(fs, f));
}
@@ -776,7 +776,8 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) {
break;
}
case VLOCAL: { /* already in a register */
- e->u.info = e->u.var.ridx;
+ int temp = e->u.var.ridx;
+ e->u.info = temp; /* (can't do a direct assignment; values overlap) */
e->k = VNONRELOC; /* becomes a non-relocatable value */
break;
}
@@ -1025,7 +1026,7 @@ static int luaK_exp2K (FuncState *fs, expdesc *e) {
** in the range of R/K indices).
** Returns 1 iff expression is K.
*/
-int luaK_exp2RK (FuncState *fs, expdesc *e) {
+static int exp2RK (FuncState *fs, expdesc *e) {
if (luaK_exp2K(fs, e))
return 1;
else { /* not a constant in the right range: put it in a register */
@@ -1037,7 +1038,7 @@ int luaK_exp2RK (FuncState *fs, expdesc *e) {
static void codeABRK (FuncState *fs, OpCode o, int a, int b,
expdesc *ec) {
- int k = luaK_exp2RK(fs, ec);
+ int k = exp2RK(fs, ec);
luaK_codeABCk(fs, o, a, b, ec->u.info, k);
}
@@ -1215,7 +1216,7 @@ static void codenot (FuncState *fs, expdesc *e) {
/*
-** Check whether expression 'e' is a small literal string
+** Check whether expression 'e' is a short literal string
*/
static int isKstr (FuncState *fs, expdesc *e) {
return (e->k == VK && !hasjumps(e) && e->u.info <= MAXARG_B &&
@@ -1225,7 +1226,7 @@ static int isKstr (FuncState *fs, expdesc *e) {
/*
** Check whether expression 'e' is a literal integer.
*/
-int luaK_isKint (expdesc *e) {
+static int isKint (expdesc *e) {
return (e->k == VKINT && !hasjumps(e));
}
@@ -1235,7 +1236,7 @@ int luaK_isKint (expdesc *e) {
** proper range to fit in register C
*/
static int isCint (expdesc *e) {
- return luaK_isKint(e) && (l_castS2U(e->u.ival) <= l_castS2U(MAXARG_C));
+ return isKint(e) && (l_castS2U(e->u.ival) <= l_castS2U(MAXARG_C));
}
@@ -1244,7 +1245,7 @@ static int isCint (expdesc *e) {
** proper range to fit in register sC
*/
static int isSCint (expdesc *e) {
- return luaK_isKint(e) && fitsC(e->u.ival);
+ return isKint(e) && fitsC(e->u.ival);
}
@@ -1283,15 +1284,17 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */
luaK_exp2anyreg(fs, t); /* put it in a register */
if (t->k == VUPVAL) {
- t->u.ind.t = t->u.info; /* upvalue index */
- t->u.ind.idx = k->u.info; /* literal string */
+ int temp = t->u.info; /* upvalue index */
+ lua_assert(isKstr(fs, k));
+ t->u.ind.t = temp; /* (can't do a direct assignment; values overlap) */
+ t->u.ind.idx = k->u.info; /* literal short string */
t->k = VINDEXUP;
}
else {
/* register index of the table */
t->u.ind.t = (t->k == VLOCAL) ? t->u.var.ridx: t->u.info;
if (isKstr(fs, k)) {
- t->u.ind.idx = k->u.info; /* literal string */
+ t->u.ind.idx = k->u.info; /* literal short string */
t->k = VINDEXSTR;
}
else if (isCint(k)) {
@@ -1352,6 +1355,35 @@ static int constfolding (FuncState *fs, int op, expdesc *e1,
/*
+** Convert a BinOpr to an OpCode (ORDER OPR - ORDER OP)
+*/
+l_sinline OpCode binopr2op (BinOpr opr, BinOpr baser, OpCode base) {
+ lua_assert(baser <= opr &&
+ ((baser == OPR_ADD && opr <= OPR_SHR) ||
+ (baser == OPR_LT && opr <= OPR_LE)));
+ return cast(OpCode, (cast_int(opr) - cast_int(baser)) + cast_int(base));
+}
+
+
+/*
+** Convert a UnOpr to an OpCode (ORDER OPR - ORDER OP)
+*/
+l_sinline OpCode unopr2op (UnOpr opr) {
+ return cast(OpCode, (cast_int(opr) - cast_int(OPR_MINUS)) +
+ cast_int(OP_UNM));
+}
+
+
+/*
+** Convert a BinOpr to a tag method (ORDER OPR - ORDER TM)
+*/
+l_sinline TMS binopr2TM (BinOpr opr) {
+ lua_assert(OPR_ADD <= opr && opr <= OPR_SHR);
+ return cast(TMS, (cast_int(opr) - cast_int(OPR_ADD)) + cast_int(TM_ADD));
+}
+
+
+/*
** Emit code for unary expressions that "produce values"
** (everything but 'not').
** Expression to produce final result will be encoded in 'e'.
@@ -1389,12 +1421,15 @@ static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2,
** Emit code for binary expressions that "produce values" over
** two registers.
*/
-static void codebinexpval (FuncState *fs, OpCode op,
+static void codebinexpval (FuncState *fs, BinOpr opr,
expdesc *e1, expdesc *e2, int line) {
- int v2 = luaK_exp2anyreg(fs, e2); /* both operands are in registers */
+ OpCode op = binopr2op(opr, OPR_ADD, OP_ADD);
+ int v2 = luaK_exp2anyreg(fs, e2); /* make sure 'e2' is in a register */
+ /* 'e1' must be already in a register or it is a constant */
+ lua_assert((VNIL <= e1->k && e1->k <= VKSTR) ||
+ e1->k == VNONRELOC || e1->k == VRELOC);
lua_assert(OP_ADD <= op && op <= OP_SHR);
- finishbinexpval(fs, e1, e2, op, v2, 0, line, OP_MMBIN,
- cast(TMS, (op - OP_ADD) + TM_ADD));
+ finishbinexpval(fs, e1, e2, op, v2, 0, line, OP_MMBIN, binopr2TM(opr));
}
@@ -1410,12 +1445,24 @@ static void codebini (FuncState *fs, OpCode op,
}
+/*
+** Code binary operators with K operand.
+*/
+static void codebinK (FuncState *fs, BinOpr opr,
+ expdesc *e1, expdesc *e2, int flip, int line) {
+ TMS event = binopr2TM(opr);
+ int v2 = e2->u.info; /* K index */
+ OpCode op = binopr2op(opr, OPR_ADD, OP_ADDK);
+ finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK, event);
+}
+
+
/* Try to code a binary operator negating its second operand.
** For the metamethod, 2nd operand must keep its original value.
*/
static int finishbinexpneg (FuncState *fs, expdesc *e1, expdesc *e2,
OpCode op, int line, TMS event) {
- if (!luaK_isKint(e2))
+ if (!isKint(e2))
return 0; /* not an integer constant */
else {
lua_Integer i2 = e2->u.ival;
@@ -1438,23 +1485,26 @@ static void swapexps (expdesc *e1, expdesc *e2) {
/*
+** Code binary operators with no constant operand.
+*/
+static void codebinNoK (FuncState *fs, BinOpr opr,
+ expdesc *e1, expdesc *e2, int flip, int line) {
+ if (flip)
+ swapexps(e1, e2); /* back to original order */
+ codebinexpval(fs, opr, e1, e2, line); /* use standard operators */
+}
+
+
+/*
** Code arithmetic operators ('+', '-', ...). If second operand is a
** constant in the proper range, use variant opcodes with K operands.
*/
static void codearith (FuncState *fs, BinOpr opr,
expdesc *e1, expdesc *e2, int flip, int line) {
- TMS event = cast(TMS, opr + TM_ADD);
- if (tonumeral(e2, NULL) && luaK_exp2K(fs, e2)) { /* K operand? */
- int v2 = e2->u.info; /* K index */
- OpCode op = cast(OpCode, opr + OP_ADDK);
- finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK, event);
- }
- else { /* 'e2' is neither an immediate nor a K operand */
- OpCode op = cast(OpCode, opr + OP_ADD);
- if (flip)
- swapexps(e1, e2); /* back to original order */
- codebinexpval(fs, op, e1, e2, line); /* use standard operators */
- }
+ if (tonumeral(e2, NULL) && luaK_exp2K(fs, e2)) /* K operand? */
+ codebinK(fs, opr, e1, e2, flip, line);
+ else /* 'e2' is neither an immediate nor a K operand */
+ codebinNoK(fs, opr, e1, e2, flip, line);
}
@@ -1471,35 +1521,27 @@ static void codecommutative (FuncState *fs, BinOpr op,
flip = 1;
}
if (op == OPR_ADD && isSCint(e2)) /* immediate operand? */
- codebini(fs, cast(OpCode, OP_ADDI), e1, e2, flip, line, TM_ADD);
+ codebini(fs, OP_ADDI, e1, e2, flip, line, TM_ADD);
else
codearith(fs, op, e1, e2, flip, line);
}
/*
-** Code bitwise operations; they are all associative, so the function
+** Code bitwise operations; they are all commutative, so the function
** tries to put an integer constant as the 2nd operand (a K operand).
*/
static void codebitwise (FuncState *fs, BinOpr opr,
expdesc *e1, expdesc *e2, int line) {
int flip = 0;
- int v2;
- OpCode op;
- if (e1->k == VKINT && luaK_exp2RK(fs, e1)) {
+ if (e1->k == VKINT) {
swapexps(e1, e2); /* 'e2' will be the constant operand */
flip = 1;
}
- else if (!(e2->k == VKINT && luaK_exp2RK(fs, e2))) { /* no constants? */
- op = cast(OpCode, opr + OP_ADD);
- codebinexpval(fs, op, e1, e2, line); /* all-register opcodes */
- return;
- }
- v2 = e2->u.info; /* index in K array */
- op = cast(OpCode, opr + OP_ADDK);
- lua_assert(ttisinteger(&fs->f->k[v2]));
- finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK,
- cast(TMS, opr + TM_ADD));
+ if (e2->k == VKINT && luaK_exp2K(fs, e2)) /* K operand? */
+ codebinK(fs, opr, e1, e2, flip, line);
+ else /* no constants */
+ codebinNoK(fs, opr, e1, e2, flip, line);
}
@@ -1507,25 +1549,27 @@ static void codebitwise (FuncState *fs, BinOpr opr,
** Emit code for order comparisons. When using an immediate operand,
** 'isfloat' tells whether the original value was a float.
*/
-static void codeorder (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) {
+static void codeorder (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) {
int r1, r2;
int im;
int isfloat = 0;
+ OpCode op;
if (isSCnumber(e2, &im, &isfloat)) {
/* use immediate operand */
r1 = luaK_exp2anyreg(fs, e1);
r2 = im;
- op = cast(OpCode, (op - OP_LT) + OP_LTI);
+ op = binopr2op(opr, OPR_LT, OP_LTI);
}
else if (isSCnumber(e1, &im, &isfloat)) {
/* transform (A < B) to (B > A) and (A <= B) to (B >= A) */
r1 = luaK_exp2anyreg(fs, e2);
r2 = im;
- op = (op == OP_LT) ? OP_GTI : OP_GEI;
+ op = binopr2op(opr, OPR_LT, OP_GTI);
}
else { /* regular case, compare two registers */
r1 = luaK_exp2anyreg(fs, e1);
r2 = luaK_exp2anyreg(fs, e2);
+ op = binopr2op(opr, OPR_LT, OP_LT);
}
freeexps(fs, e1, e2);
e1->u.info = condjump(fs, op, r1, r2, isfloat, 1);
@@ -1551,7 +1595,7 @@ static void codeeq (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) {
op = OP_EQI;
r2 = im; /* immediate operand */
}
- else if (luaK_exp2RK(fs, e2)) { /* 1st expression is constant? */
+ else if (exp2RK(fs, e2)) { /* 2nd expression is constant? */
op = OP_EQK;
r2 = e2->u.info; /* constant index */
}
@@ -1568,16 +1612,16 @@ static void codeeq (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) {
/*
** Apply prefix operation 'op' to expression 'e'.
*/
-void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) {
+void luaK_prefix (FuncState *fs, UnOpr opr, expdesc *e, int line) {
static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP};
luaK_dischargevars(fs, e);
- switch (op) {
+ switch (opr) {
case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */
- if (constfolding(fs, op + LUA_OPUNM, e, &ef))
+ if (constfolding(fs, opr + LUA_OPUNM, e, &ef))
break;
/* else */ /* FALLTHROUGH */
case OPR_LEN:
- codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line);
+ codeunexpval(fs, unopr2op(opr), e, line);
break;
case OPR_NOT: codenot(fs, e); break;
default: lua_assert(0);
@@ -1611,12 +1655,13 @@ void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) {
case OPR_SHL: case OPR_SHR: {
if (!tonumeral(v, NULL))
luaK_exp2anyreg(fs, v);
- /* else keep numeral, which may be folded with 2nd operand */
+ /* else keep numeral, which may be folded or used as an immediate
+ operand */
break;
}
case OPR_EQ: case OPR_NE: {
if (!tonumeral(v, NULL))
- luaK_exp2RK(fs, v);
+ exp2RK(fs, v);
/* else keep numeral, which may be an immediate operand */
break;
}
@@ -1706,30 +1751,27 @@ void luaK_posfix (FuncState *fs, BinOpr opr,
/* coded as (r1 >> -I) */;
}
else /* regular case (two registers) */
- codebinexpval(fs, OP_SHL, e1, e2, line);
+ codebinexpval(fs, opr, e1, e2, line);
break;
}
case OPR_SHR: {
if (isSCint(e2))
codebini(fs, OP_SHRI, e1, e2, 0, line, TM_SHR); /* r1 >> I */
else /* regular case (two registers) */
- codebinexpval(fs, OP_SHR, e1, e2, line);
+ codebinexpval(fs, opr, e1, e2, line);
break;
}
case OPR_EQ: case OPR_NE: {
codeeq(fs, opr, e1, e2);
break;
}
- case OPR_LT: case OPR_LE: {
- OpCode op = cast(OpCode, (opr - OPR_EQ) + OP_EQ);
- codeorder(fs, op, e1, e2);
- break;
- }
case OPR_GT: case OPR_GE: {
/* '(a > b)' <=> '(b < a)'; '(a >= b)' <=> '(b <= a)' */
- OpCode op = cast(OpCode, (opr - OPR_NE) + OP_EQ);
swapexps(e1, e2);
- codeorder(fs, op, e1, e2);
+ opr = cast(BinOpr, (opr - OPR_GT) + OPR_LT);
+ } /* FALLTHROUGH */
+ case OPR_LT: case OPR_LE: {
+ codeorder(fs, opr, e1, e2);
break;
}
default: lua_assert(0);
diff --git a/3rdparty/lua/src/lcode.h b/3rdparty/lua/src/lcode.h
index 32658244526..0b971fc4359 100644
--- a/3rdparty/lua/src/lcode.h
+++ b/3rdparty/lua/src/lcode.h
@@ -61,10 +61,8 @@ typedef enum UnOpr { OPR_MINUS, OPR_BNOT, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr;
LUAI_FUNC int luaK_code (FuncState *fs, Instruction i);
LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
-LUAI_FUNC int luaK_codeAsBx (FuncState *fs, OpCode o, int A, int Bx);
LUAI_FUNC int luaK_codeABCk (FuncState *fs, OpCode o, int A,
int B, int C, int k);
-LUAI_FUNC int luaK_isKint (expdesc *e);
LUAI_FUNC int luaK_exp2const (FuncState *fs, const expdesc *e, TValue *v);
LUAI_FUNC void luaK_fixline (FuncState *fs, int line);
LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);
@@ -76,7 +74,6 @@ LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_exp2anyregup (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);
-LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);
diff --git a/3rdparty/lua/src/lcorolib.c b/3rdparty/lua/src/lcorolib.c
index 785a1e81aa0..c64adf08a8e 100644
--- a/3rdparty/lua/src/lcorolib.c
+++ b/3rdparty/lua/src/lcorolib.c
@@ -76,7 +76,7 @@ static int luaB_auxwrap (lua_State *L) {
if (l_unlikely(r < 0)) { /* error? */
int stat = lua_status(co);
if (stat != LUA_OK && stat != LUA_YIELD) { /* error in the coroutine? */
- stat = lua_resetthread(co); /* close its tbc variables */
+ stat = lua_closethread(co, L); /* close its tbc variables */
lua_assert(stat != LUA_OK);
lua_xmove(co, L, 1); /* move error message to the caller */
}
@@ -172,7 +172,7 @@ static int luaB_close (lua_State *L) {
int status = auxstatus(L, co);
switch (status) {
case COS_DEAD: case COS_YIELD: {
- status = lua_resetthread(co);
+ status = lua_closethread(co, L);
if (status == LUA_OK) {
lua_pushboolean(L, 1);
return 1;
diff --git a/3rdparty/lua/src/ldebug.c b/3rdparty/lua/src/ldebug.c
index a716d95e22f..591b3528a77 100644
--- a/3rdparty/lua/src/ldebug.c
+++ b/3rdparty/lua/src/ldebug.c
@@ -31,7 +31,7 @@
-#define noLuaClosure(f) ((f) == NULL || (f)->c.tt == LUA_VCCL)
+#define LuaClosure(f) ((f) != NULL && (f)->c.tt == LUA_VLCL)
static const char *funcnamefromcall (lua_State *L, CallInfo *ci,
@@ -182,10 +182,10 @@ static const char *upvalname (const Proto *p, int uv) {
static const char *findvararg (CallInfo *ci, int n, StkId *pos) {
- if (clLvalue(s2v(ci->func))->p->is_vararg) {
+ if (clLvalue(s2v(ci->func.p))->p->is_vararg) {
int nextra = ci->u.l.nextraargs;
if (n >= -nextra) { /* 'n' is negative */
- *pos = ci->func - nextra - (n + 1);
+ *pos = ci->func.p - nextra - (n + 1);
return "(vararg)"; /* generic name for any vararg */
}
}
@@ -194,7 +194,7 @@ static const char *findvararg (CallInfo *ci, int n, StkId *pos) {
const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos) {
- StkId base = ci->func + 1;
+ StkId base = ci->func.p + 1;
const char *name = NULL;
if (isLua(ci)) {
if (n < 0) /* access to vararg values? */
@@ -203,7 +203,7 @@ const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos) {
name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci));
}
if (name == NULL) { /* no 'standard' name? */
- StkId limit = (ci == L->ci) ? L->top : ci->next->func;
+ StkId limit = (ci == L->ci) ? L->top.p : ci->next->func.p;
if (limit - base >= n && n > 0) { /* is 'n' inside 'ci' stack? */
/* generic name for any valid slot */
name = isLua(ci) ? "(temporary)" : "(C temporary)";
@@ -221,16 +221,16 @@ LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
const char *name;
lua_lock(L);
if (ar == NULL) { /* information about non-active function? */
- if (!isLfunction(s2v(L->top - 1))) /* not a Lua function? */
+ if (!isLfunction(s2v(L->top.p - 1))) /* not a Lua function? */
name = NULL;
else /* consider live variables at function start (parameters) */
- name = luaF_getlocalname(clLvalue(s2v(L->top - 1))->p, n, 0);
+ name = luaF_getlocalname(clLvalue(s2v(L->top.p - 1))->p, n, 0);
}
else { /* active function; get information through 'ar' */
StkId pos = NULL; /* to avoid warnings */
name = luaG_findlocal(L, ar->i_ci, n, &pos);
if (name) {
- setobjs2s(L, L->top, pos);
+ setobjs2s(L, L->top.p, pos);
api_incr_top(L);
}
}
@@ -245,8 +245,8 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {
lua_lock(L);
name = luaG_findlocal(L, ar->i_ci, n, &pos);
if (name) {
- setobjs2s(L, pos, L->top - 1);
- L->top--; /* pop value */
+ setobjs2s(L, pos, L->top.p - 1);
+ L->top.p--; /* pop value */
}
lua_unlock(L);
return name;
@@ -254,7 +254,7 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {
static void funcinfo (lua_Debug *ar, Closure *cl) {
- if (noLuaClosure(cl)) {
+ if (!LuaClosure(cl)) {
ar->source = "=[C]";
ar->srclen = LL("=[C]");
ar->linedefined = -1;
@@ -288,29 +288,31 @@ static int nextline (const Proto *p, int currentline, int pc) {
static void collectvalidlines (lua_State *L, Closure *f) {
- if (noLuaClosure(f)) {
- setnilvalue(s2v(L->top));
+ if (!LuaClosure(f)) {
+ setnilvalue(s2v(L->top.p));
api_incr_top(L);
}
else {
- int i;
- TValue v;
const Proto *p = f->l.p;
int currentline = p->linedefined;
Table *t = luaH_new(L); /* new table to store active lines */
- sethvalue2s(L, L->top, t); /* push it on stack */
+ sethvalue2s(L, L->top.p, t); /* push it on stack */
api_incr_top(L);
- setbtvalue(&v); /* boolean 'true' to be the value of all indices */
- if (!p->is_vararg) /* regular function? */
- i = 0; /* consider all instructions */
- else { /* vararg function */
- lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP);
- currentline = nextline(p, currentline, 0);
- i = 1; /* skip first instruction (OP_VARARGPREP) */
- }
- for (; i < p->sizelineinfo; i++) { /* for each instruction */
- currentline = nextline(p, currentline, i); /* get its line */
- luaH_setint(L, t, currentline, &v); /* table[line] = true */
+ if (p->lineinfo != NULL) { /* proto with debug information? */
+ int i;
+ TValue v;
+ setbtvalue(&v); /* boolean 'true' to be the value of all indices */
+ if (!p->is_vararg) /* regular function? */
+ i = 0; /* consider all instructions */
+ else { /* vararg function */
+ lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP);
+ currentline = nextline(p, currentline, 0);
+ i = 1; /* skip first instruction (OP_VARARGPREP) */
+ }
+ for (; i < p->sizelineinfo; i++) { /* for each instruction */
+ currentline = nextline(p, currentline, i); /* get its line */
+ luaH_setint(L, t, currentline, &v); /* table[line] = true */
+ }
}
}
}
@@ -339,7 +341,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,
}
case 'u': {
ar->nups = (f == NULL) ? 0 : f->c.nupvalues;
- if (noLuaClosure(f)) {
+ if (!LuaClosure(f)) {
ar->isvararg = 1;
ar->nparams = 0;
}
@@ -388,20 +390,20 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
lua_lock(L);
if (*what == '>') {
ci = NULL;
- func = s2v(L->top - 1);
+ func = s2v(L->top.p - 1);
api_check(L, ttisfunction(func), "function expected");
what++; /* skip the '>' */
- L->top--; /* pop function */
+ L->top.p--; /* pop function */
}
else {
ci = ar->i_ci;
- func = s2v(ci->func);
+ func = s2v(ci->func.p);
lua_assert(ttisfunction(func));
}
cl = ttisclosure(func) ? clvalue(func) : NULL;
status = auxgetinfo(L, what, ar, cl, ci);
if (strchr(what, 'f')) {
- setobj2s(L, L->top, func);
+ setobj2s(L, L->top.p, func);
api_incr_top(L);
}
if (strchr(what, 'L'))
@@ -417,40 +419,6 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
** =======================================================
*/
-static const char *getobjname (const Proto *p, int lastpc, int reg,
- const char **name);
-
-
-/*
-** Find a "name" for the constant 'c'.
-*/
-static void kname (const Proto *p, int c, const char **name) {
- TValue *kvalue = &p->k[c];
- *name = (ttisstring(kvalue)) ? svalue(kvalue) : "?";
-}
-
-
-/*
-** Find a "name" for the register 'c'.
-*/
-static void rname (const Proto *p, int pc, int c, const char **name) {
- const char *what = getobjname(p, pc, c, name); /* search for 'c' */
- if (!(what && *what == 'c')) /* did not find a constant name? */
- *name = "?";
-}
-
-
-/*
-** Find a "name" for a 'C' value in an RK instruction.
-*/
-static void rkname (const Proto *p, int pc, Instruction i, const char **name) {
- int c = GETARG_C(i); /* key index */
- if (GETARG_k(i)) /* is 'c' a constant? */
- kname(p, c, name);
- else /* 'c' is a register */
- rname(p, pc, c, name);
-}
-
static int filterpc (int pc, int jmptarget) {
if (pc < jmptarget) /* is code conditional (inside a jump)? */
@@ -509,28 +477,29 @@ static int findsetreg (const Proto *p, int lastpc, int reg) {
/*
-** Check whether table being indexed by instruction 'i' is the
-** environment '_ENV'
+** Find a "name" for the constant 'c'.
*/
-static const char *gxf (const Proto *p, int pc, Instruction i, int isup) {
- int t = GETARG_B(i); /* table index */
- const char *name; /* name of indexed variable */
- if (isup) /* is an upvalue? */
- name = upvalname(p, t);
- else
- getobjname(p, pc, t, &name);
- return (name && strcmp(name, LUA_ENV) == 0) ? "global" : "field";
+static const char *kname (const Proto *p, int index, const char **name) {
+ TValue *kvalue = &p->k[index];
+ if (ttisstring(kvalue)) {
+ *name = getstr(tsvalue(kvalue));
+ return "constant";
+ }
+ else {
+ *name = "?";
+ return NULL;
+ }
}
-static const char *getobjname (const Proto *p, int lastpc, int reg,
- const char **name) {
- int pc;
- *name = luaF_getlocalname(p, reg + 1, lastpc);
+static const char *basicgetobjname (const Proto *p, int *ppc, int reg,
+ const char **name) {
+ int pc = *ppc;
+ *name = luaF_getlocalname(p, reg + 1, pc);
if (*name) /* is a local? */
return "local";
/* else try symbolic execution */
- pc = findsetreg(p, lastpc, reg);
+ *ppc = pc = findsetreg(p, pc, reg);
if (pc != -1) { /* could find instruction? */
Instruction i = p->code[pc];
OpCode op = GET_OPCODE(i);
@@ -538,18 +507,80 @@ static const char *getobjname (const Proto *p, int lastpc, int reg,
case OP_MOVE: {
int b = GETARG_B(i); /* move from 'b' to 'a' */
if (b < GETARG_A(i))
- return getobjname(p, pc, b, name); /* get name for 'b' */
+ return basicgetobjname(p, ppc, b, name); /* get name for 'b' */
break;
}
+ case OP_GETUPVAL: {
+ *name = upvalname(p, GETARG_B(i));
+ return "upvalue";
+ }
+ case OP_LOADK: return kname(p, GETARG_Bx(i), name);
+ case OP_LOADKX: return kname(p, GETARG_Ax(p->code[pc + 1]), name);
+ default: break;
+ }
+ }
+ return NULL; /* could not find reasonable name */
+}
+
+
+/*
+** Find a "name" for the register 'c'.
+*/
+static void rname (const Proto *p, int pc, int c, const char **name) {
+ const char *what = basicgetobjname(p, &pc, c, name); /* search for 'c' */
+ if (!(what && *what == 'c')) /* did not find a constant name? */
+ *name = "?";
+}
+
+
+/*
+** Find a "name" for a 'C' value in an RK instruction.
+*/
+static void rkname (const Proto *p, int pc, Instruction i, const char **name) {
+ int c = GETARG_C(i); /* key index */
+ if (GETARG_k(i)) /* is 'c' a constant? */
+ kname(p, c, name);
+ else /* 'c' is a register */
+ rname(p, pc, c, name);
+}
+
+
+/*
+** Check whether table being indexed by instruction 'i' is the
+** environment '_ENV'
+*/
+static const char *isEnv (const Proto *p, int pc, Instruction i, int isup) {
+ int t = GETARG_B(i); /* table index */
+ const char *name; /* name of indexed variable */
+ if (isup) /* is 't' an upvalue? */
+ name = upvalname(p, t);
+ else /* 't' is a register */
+ basicgetobjname(p, &pc, t, &name);
+ return (name && strcmp(name, LUA_ENV) == 0) ? "global" : "field";
+}
+
+
+/*
+** Extend 'basicgetobjname' to handle table accesses
+*/
+static const char *getobjname (const Proto *p, int lastpc, int reg,
+ const char **name) {
+ const char *kind = basicgetobjname(p, &lastpc, reg, name);
+ if (kind != NULL)
+ return kind;
+ else if (lastpc != -1) { /* could find instruction? */
+ Instruction i = p->code[lastpc];
+ OpCode op = GET_OPCODE(i);
+ switch (op) {
case OP_GETTABUP: {
int k = GETARG_C(i); /* key index */
kname(p, k, name);
- return gxf(p, pc, i, 1);
+ return isEnv(p, lastpc, i, 1);
}
case OP_GETTABLE: {
int k = GETARG_C(i); /* key index */
- rname(p, pc, k, name);
- return gxf(p, pc, i, 0);
+ rname(p, lastpc, k, name);
+ return isEnv(p, lastpc, i, 0);
}
case OP_GETI: {
*name = "integer index";
@@ -558,24 +589,10 @@ static const char *getobjname (const Proto *p, int lastpc, int reg,
case OP_GETFIELD: {
int k = GETARG_C(i); /* key index */
kname(p, k, name);
- return gxf(p, pc, i, 0);
- }
- case OP_GETUPVAL: {
- *name = upvalname(p, GETARG_B(i));
- return "upvalue";
- }
- case OP_LOADK:
- case OP_LOADKX: {
- int b = (op == OP_LOADK) ? GETARG_Bx(i)
- : GETARG_Ax(p->code[pc + 1]);
- if (ttisstring(&p->k[b])) {
- *name = svalue(&p->k[b]);
- return "constant";
- }
- break;
+ return isEnv(p, lastpc, i, 0);
}
case OP_SELF: {
- rkname(p, pc, i, name);
+ rkname(p, lastpc, i, name);
return "method";
}
default: break; /* go through to return NULL */
@@ -627,7 +644,7 @@ static const char *funcnamefromcode (lua_State *L, const Proto *p,
default:
return NULL; /* cannot find a reasonable name */
}
- *name = getstr(G(L)->tmname[tm]) + 2;
+ *name = getshrstr(G(L)->tmname[tm]) + 2;
return "metamethod";
}
@@ -656,18 +673,19 @@ static const char *funcnamefromcall (lua_State *L, CallInfo *ci,
/*
-** Check whether pointer 'o' points to some value in the stack
-** frame of the current function. Because 'o' may not point to a
-** value in this stack, we cannot compare it with the region
-** boundaries (undefined behaviour in ISO C).
+** Check whether pointer 'o' points to some value in the stack frame of
+** the current function and, if so, returns its index. Because 'o' may
+** not point to a value in this stack, we cannot compare it with the
+** region boundaries (undefined behavior in ISO C).
*/
-static int isinstack (CallInfo *ci, const TValue *o) {
- StkId pos;
- for (pos = ci->func + 1; pos < ci->top; pos++) {
- if (o == s2v(pos))
- return 1;
+static int instack (CallInfo *ci, const TValue *o) {
+ int pos;
+ StkId base = ci->func.p + 1;
+ for (pos = 0; base + pos < ci->top.p; pos++) {
+ if (o == s2v(base + pos))
+ return pos;
}
- return 0; /* not found */
+ return -1; /* not found */
}
@@ -681,7 +699,7 @@ static const char *getupvalname (CallInfo *ci, const TValue *o,
LClosure *c = ci_func(ci);
int i;
for (i = 0; i < c->nupvalues; i++) {
- if (c->upvals[i]->v == o) {
+ if (c->upvals[i]->v.p == o) {
*name = upvalname(c->p, i);
return "upvalue";
}
@@ -708,9 +726,11 @@ static const char *varinfo (lua_State *L, const TValue *o) {
const char *kind = NULL;
if (isLua(ci)) {
kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */
- if (!kind && isinstack(ci, o)) /* no? try a register */
- kind = getobjname(ci_func(ci)->p, currentpc(ci),
- cast_int(cast(StkId, o) - (ci->func + 1)), &name);
+ if (!kind) { /* not an upvalue? */
+ int reg = instack(ci, o); /* try a register */
+ if (reg >= 0) /* is 'o' a register? */
+ kind = getobjname(ci_func(ci)->p, currentpc(ci), reg, &name);
+ }
}
return formatvarinfo(L, kind, name);
}
@@ -807,10 +827,10 @@ l_noret luaG_errormsg (lua_State *L) {
if (L->errfunc != 0) { /* is there an error handling function? */
StkId errfunc = restorestack(L, L->errfunc);
lua_assert(ttisfunction(s2v(errfunc)));
- setobjs2s(L, L->top, L->top - 1); /* move argument */
- setobjs2s(L, L->top - 1, errfunc); /* push function */
- L->top++; /* assume EXTRA_STACK */
- luaD_callnoyield(L, L->top - 2, 1); /* call it */
+ setobjs2s(L, L->top.p, L->top.p - 1); /* move argument */
+ setobjs2s(L, L->top.p - 1, errfunc); /* push function */
+ L->top.p++; /* assume EXTRA_STACK */
+ luaD_callnoyield(L, L->top.p - 2, 1); /* call it */
}
luaD_throw(L, LUA_ERRRUN);
}
@@ -824,8 +844,11 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
va_start(argp, fmt);
msg = luaO_pushvfstring(L, fmt, argp); /* format message */
va_end(argp);
- if (isLua(ci)) /* if Lua function, add source:line information */
+ if (isLua(ci)) { /* if Lua function, add source:line information */
luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci));
+ setobjs2s(L, L->top.p - 2, L->top.p - 1); /* remove 'msg' */
+ L->top.p--;
+ }
luaG_errormsg(L);
}
@@ -842,7 +865,7 @@ static int changedline (const Proto *p, int oldpc, int newpc) {
if (p->lineinfo == NULL) /* no debug information? */
return 0;
if (newpc - oldpc < MAXIWTHABS / 2) { /* not too far apart? */
- int delta = 0; /* line diference */
+ int delta = 0; /* line difference */
int pc = oldpc;
for (;;) {
int lineinfo = p->lineinfo[++pc];
@@ -860,6 +883,28 @@ static int changedline (const Proto *p, int oldpc, int newpc) {
/*
+** Traces Lua calls. If code is running the first instruction of a function,
+** and function is not vararg, and it is not coming from an yield,
+** calls 'luaD_hookcall'. (Vararg functions will call 'luaD_hookcall'
+** after adjusting its variable arguments; otherwise, they could call
+** a line/count hook before the call hook. Functions coming from
+** an yield already called 'luaD_hookcall' before yielding.)
+*/
+int luaG_tracecall (lua_State *L) {
+ CallInfo *ci = L->ci;
+ Proto *p = ci_func(ci)->p;
+ ci->u.l.trap = 1; /* ensure hooks will be checked */
+ if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */
+ if (p->is_vararg)
+ return 0; /* hooks will start at VARARGPREP instruction */
+ else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yieded? */
+ luaD_hookcall(L, ci); /* check 'call' hook */
+ }
+ return 1; /* keep 'trap' on */
+}
+
+
+/*
** Traces the execution of a Lua function. Called before the execution
** of each opcode, when debug is on. 'L->oldpc' stores the last
** instruction traced, to detect line changes. When entering a new
@@ -869,7 +914,7 @@ static int changedline (const Proto *p, int oldpc, int newpc) {
** invalid; if so, use zero as a valid value. (A wrong but valid 'oldpc'
** at most causes an extra call to a line hook.)
** This function is not "Protected" when called, so it should correct
-** 'L->top' before calling anything that can run the GC.
+** 'L->top.p' before calling anything that can run the GC.
*/
int luaG_traceexec (lua_State *L, const Instruction *pc) {
CallInfo *ci = L->ci;
@@ -882,17 +927,17 @@ int luaG_traceexec (lua_State *L, const Instruction *pc) {
}
pc++; /* reference is always next instruction */
ci->u.l.savedpc = pc; /* save 'pc' */
- counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT));
+ counthook = (mask & LUA_MASKCOUNT) && (--L->hookcount == 0);
if (counthook)
resethookcount(L); /* reset count */
else if (!(mask & LUA_MASKLINE))
return 1; /* no line hook and count != 0; nothing to be done now */
- if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */
+ if (ci->callstatus & CIST_HOOKYIELD) { /* hook yielded last time? */
ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */
return 1; /* do not call hook again (VM yielded, so it did not move) */
}
if (!isIT(*(ci->u.l.savedpc - 1))) /* top not being used? */
- L->top = ci->top; /* correct top */
+ L->top.p = ci->top.p; /* correct top */
if (counthook)
luaD_hook(L, LUA_HOOKCOUNT, -1, 0, 0); /* call count hook */
if (mask & LUA_MASKLINE) {
@@ -909,7 +954,6 @@ int luaG_traceexec (lua_State *L, const Instruction *pc) {
if (L->status == LUA_YIELD) { /* did hook yield? */
if (counthook)
L->hookcount = 1; /* undo decrement to zero */
- ci->u.l.savedpc--; /* undo increment (resume will increment it again) */
ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */
luaD_throw(L, LUA_YIELD);
}
diff --git a/3rdparty/lua/src/ldebug.h b/3rdparty/lua/src/ldebug.h
index 974960e99da..2bfce3cb5e7 100644
--- a/3rdparty/lua/src/ldebug.h
+++ b/3rdparty/lua/src/ldebug.h
@@ -15,7 +15,7 @@
/* Active Lua function (given call info) */
-#define ci_func(ci) (clLvalue(s2v((ci)->func)))
+#define ci_func(ci) (clLvalue(s2v((ci)->func.p)))
#define resethookcount(L) (L->hookcount = L->basehookcount)
@@ -58,6 +58,7 @@ LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg,
TString *src, int line);
LUAI_FUNC l_noret luaG_errormsg (lua_State *L);
LUAI_FUNC int luaG_traceexec (lua_State *L, const Instruction *pc);
+LUAI_FUNC int luaG_tracecall (lua_State *L);
#endif
diff --git a/3rdparty/lua/src/ldo.c b/3rdparty/lua/src/ldo.c
index a48e35f9dba..ea0529507e0 100644
--- a/3rdparty/lua/src/ldo.c
+++ b/3rdparty/lua/src/ldo.c
@@ -104,11 +104,11 @@ void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) {
}
default: {
lua_assert(errorstatus(errcode)); /* real error */
- setobjs2s(L, oldtop, L->top - 1); /* error message on current top */
+ setobjs2s(L, oldtop, L->top.p - 1); /* error message on current top */
break;
}
}
- L->top = oldtop + 1;
+ L->top.p = oldtop + 1;
}
@@ -121,7 +121,7 @@ l_noret luaD_throw (lua_State *L, int errcode) {
global_State *g = G(L);
errcode = luaE_resetthread(L, errcode); /* close all upvalues */
if (g->mainthread->errorJmp) { /* main thread has a handler? */
- setobjs2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */
+ setobjs2s(L, g->mainthread->top.p++, L->top.p - 1); /* copy error obj. */
luaD_throw(g->mainthread, errcode); /* re-throw in main thread */
}
else { /* no handler at all; abort */
@@ -157,16 +157,38 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
** Stack reallocation
** ===================================================================
*/
-static void correctstack (lua_State *L, StkId oldstack, StkId newstack) {
+
+
+/*
+** Change all pointers to the stack into offsets.
+*/
+static void relstack (lua_State *L) {
+ CallInfo *ci;
+ UpVal *up;
+ L->top.offset = savestack(L, L->top.p);
+ L->tbclist.offset = savestack(L, L->tbclist.p);
+ for (up = L->openupval; up != NULL; up = up->u.open.next)
+ up->v.offset = savestack(L, uplevel(up));
+ for (ci = L->ci; ci != NULL; ci = ci->previous) {
+ ci->top.offset = savestack(L, ci->top.p);
+ ci->func.offset = savestack(L, ci->func.p);
+ }
+}
+
+
+/*
+** Change back all offsets into pointers.
+*/
+static void correctstack (lua_State *L) {
CallInfo *ci;
UpVal *up;
- L->top = (L->top - oldstack) + newstack;
- L->tbclist = (L->tbclist - oldstack) + newstack;
+ L->top.p = restorestack(L, L->top.offset);
+ L->tbclist.p = restorestack(L, L->tbclist.offset);
for (up = L->openupval; up != NULL; up = up->u.open.next)
- up->v = s2v((uplevel(up) - oldstack) + newstack);
+ up->v.p = s2v(restorestack(L, up->v.offset));
for (ci = L->ci; ci != NULL; ci = ci->previous) {
- ci->top = (ci->top - oldstack) + newstack;
- ci->func = (ci->func - oldstack) + newstack;
+ ci->top.p = restorestack(L, ci->top.offset);
+ ci->func.p = restorestack(L, ci->func.offset);
if (isLua(ci))
ci->u.l.trap = 1; /* signal to update 'trap' in 'luaV_execute' */
}
@@ -176,44 +198,45 @@ static void correctstack (lua_State *L, StkId oldstack, StkId newstack) {
/* some space for error handling */
#define ERRORSTACKSIZE (LUAI_MAXSTACK + 200)
-
/*
-** Reallocate the stack to a new size, correcting all pointers into
-** it. (There are pointers to a stack from its upvalues, from its list
-** of call infos, plus a few individual pointers.) The reallocation is
-** done in two steps (allocation + free) because the correction must be
-** done while both addresses (the old stack and the new one) are valid.
-** (In ISO C, any pointer use after the pointer has been deallocated is
-** undefined behavior.)
+** Reallocate the stack to a new size, correcting all pointers into it.
+** In ISO C, any pointer use after the pointer has been deallocated is
+** undefined behavior. So, before the reallocation, all pointers are
+** changed to offsets, and after the reallocation they are changed back
+** to pointers. As during the reallocation the pointers are invalid, the
+** reallocation cannot run emergency collections.
+**
** In case of allocation error, raise an error or return false according
** to 'raiseerror'.
*/
int luaD_reallocstack (lua_State *L, int newsize, int raiseerror) {
int oldsize = stacksize(L);
int i;
- StkId newstack = luaM_reallocvector(L, NULL, 0,
- newsize + EXTRA_STACK, StackValue);
+ StkId newstack;
+ int oldgcstop = G(L)->gcstopem;
lua_assert(newsize <= LUAI_MAXSTACK || newsize == ERRORSTACKSIZE);
+ relstack(L); /* change pointers to offsets */
+ G(L)->gcstopem = 1; /* stop emergency collection */
+ newstack = luaM_reallocvector(L, L->stack.p, oldsize + EXTRA_STACK,
+ newsize + EXTRA_STACK, StackValue);
+ G(L)->gcstopem = oldgcstop; /* restore emergency collection */
if (l_unlikely(newstack == NULL)) { /* reallocation failed? */
+ correctstack(L); /* change offsets back to pointers */
if (raiseerror)
luaM_error(L);
else return 0; /* do not raise an error */
}
- /* number of elements to be copied to the new stack */
- i = ((oldsize <= newsize) ? oldsize : newsize) + EXTRA_STACK;
- memcpy(newstack, L->stack, i * sizeof(StackValue));
- for (; i < newsize + EXTRA_STACK; i++)
+ L->stack.p = newstack;
+ correctstack(L); /* change offsets back to pointers */
+ L->stack_last.p = L->stack.p + newsize;
+ for (i = oldsize + EXTRA_STACK; i < newsize + EXTRA_STACK; i++)
setnilvalue(s2v(newstack + i)); /* erase new segment */
- correctstack(L, L->stack, newstack);
- luaM_freearray(L, L->stack, oldsize + EXTRA_STACK);
- L->stack = newstack;
- L->stack_last = L->stack + newsize;
return 1;
}
/*
-** Try to grow the stack by at least 'n' elements. when 'raiseerror'
+** Try to grow the stack by at least 'n' elements. When 'raiseerror'
** is true, raises any error; otherwise, return 0 in case of errors.
*/
int luaD_growstack (lua_State *L, int n, int raiseerror) {
@@ -227,35 +250,38 @@ int luaD_growstack (lua_State *L, int n, int raiseerror) {
luaD_throw(L, LUA_ERRERR); /* error inside message handler */
return 0; /* if not 'raiseerror', just signal it */
}
- else {
+ else if (n < LUAI_MAXSTACK) { /* avoids arithmetic overflows */
int newsize = 2 * size; /* tentative new size */
- int needed = cast_int(L->top - L->stack) + n;
+ int needed = cast_int(L->top.p - L->stack.p) + n;
if (newsize > LUAI_MAXSTACK) /* cannot cross the limit */
newsize = LUAI_MAXSTACK;
if (newsize < needed) /* but must respect what was asked for */
newsize = needed;
if (l_likely(newsize <= LUAI_MAXSTACK))
return luaD_reallocstack(L, newsize, raiseerror);
- else { /* stack overflow */
- /* add extra size to be able to handle the error message */
- luaD_reallocstack(L, ERRORSTACKSIZE, raiseerror);
- if (raiseerror)
- luaG_runerror(L, "stack overflow");
- return 0;
- }
}
+ /* else stack overflow */
+ /* add extra size to be able to handle the error message */
+ luaD_reallocstack(L, ERRORSTACKSIZE, raiseerror);
+ if (raiseerror)
+ luaG_runerror(L, "stack overflow");
+ return 0;
}
+/*
+** Compute how much of the stack is being used, by computing the
+** maximum top of all call frames in the stack and the current top.
+*/
static int stackinuse (lua_State *L) {
CallInfo *ci;
int res;
- StkId lim = L->top;
+ StkId lim = L->top.p;
for (ci = L->ci; ci != NULL; ci = ci->previous) {
- if (lim < ci->top) lim = ci->top;
+ if (lim < ci->top.p) lim = ci->top.p;
}
- lua_assert(lim <= L->stack_last);
- res = cast_int(lim - L->stack) + 1; /* part of stack in use */
+ lua_assert(lim <= L->stack_last.p + EXTRA_STACK);
+ res = cast_int(lim - L->stack.p) + 1; /* part of stack in use */
if (res < LUA_MINSTACK)
res = LUA_MINSTACK; /* ensure a minimum size */
return res;
@@ -273,17 +299,13 @@ static int stackinuse (lua_State *L) {
*/
void luaD_shrinkstack (lua_State *L) {
int inuse = stackinuse(L);
- int nsize = inuse * 2; /* proposed new size */
- int max = inuse * 3; /* maximum "reasonable" size */
- if (max > LUAI_MAXSTACK) {
- max = LUAI_MAXSTACK; /* respect stack limit */
- if (nsize > LUAI_MAXSTACK)
- nsize = LUAI_MAXSTACK;
- }
+ int max = (inuse > LUAI_MAXSTACK / 3) ? LUAI_MAXSTACK : inuse * 3;
/* if thread is currently not handling a stack overflow and its
size is larger than maximum "reasonable" size, shrink it */
- if (inuse <= LUAI_MAXSTACK && stacksize(L) > max)
+ if (inuse <= LUAI_MAXSTACK && stacksize(L) > max) {
+ int nsize = (inuse > LUAI_MAXSTACK / 2) ? LUAI_MAXSTACK : inuse * 2;
luaD_reallocstack(L, nsize, 0); /* ok if that fails */
+ }
else /* don't change stack */
condmovestack(L,{},{}); /* (change only for debugging) */
luaE_shrinkCI(L); /* shrink CI list */
@@ -292,7 +314,7 @@ void luaD_shrinkstack (lua_State *L) {
void luaD_inctop (lua_State *L) {
luaD_checkstack(L, 1);
- L->top++;
+ L->top.p++;
}
/* }================================================================== */
@@ -309,8 +331,8 @@ void luaD_hook (lua_State *L, int event, int line,
if (hook && L->allowhook) { /* make sure there is a hook */
int mask = CIST_HOOKED;
CallInfo *ci = L->ci;
- ptrdiff_t top = savestack(L, L->top); /* preserve original 'top' */
- ptrdiff_t ci_top = savestack(L, ci->top); /* idem for 'ci->top' */
+ ptrdiff_t top = savestack(L, L->top.p); /* preserve original 'top' */
+ ptrdiff_t ci_top = savestack(L, ci->top.p); /* idem for 'ci->top' */
lua_Debug ar;
ar.event = event;
ar.currentline = line;
@@ -320,11 +342,11 @@ void luaD_hook (lua_State *L, int event, int line,
ci->u2.transferinfo.ftransfer = ftransfer;
ci->u2.transferinfo.ntransfer = ntransfer;
}
- if (isLua(ci) && L->top < ci->top)
- L->top = ci->top; /* protect entire activation register */
+ if (isLua(ci) && L->top.p < ci->top.p)
+ L->top.p = ci->top.p; /* protect entire activation register */
luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */
- if (ci->top < L->top + LUA_MINSTACK)
- ci->top = L->top + LUA_MINSTACK;
+ if (ci->top.p < L->top.p + LUA_MINSTACK)
+ ci->top.p = L->top.p + LUA_MINSTACK;
L->allowhook = 0; /* cannot call hooks inside a hook */
ci->callstatus |= mask;
lua_unlock(L);
@@ -332,8 +354,8 @@ void luaD_hook (lua_State *L, int event, int line,
lua_lock(L);
lua_assert(!L->allowhook);
L->allowhook = 1;
- ci->top = restorestack(L, ci_top);
- L->top = restorestack(L, top);
+ ci->top.p = restorestack(L, ci_top);
+ L->top.p = restorestack(L, top);
ci->callstatus &= ~mask;
}
}
@@ -364,7 +386,7 @@ void luaD_hookcall (lua_State *L, CallInfo *ci) {
*/
static void rethook (lua_State *L, CallInfo *ci, int nres) {
if (L->hookmask & LUA_MASKRET) { /* is return hook on? */
- StkId firstres = L->top - nres; /* index of first result */
+ StkId firstres = L->top.p - nres; /* index of first result */
int delta = 0; /* correction for vararg functions */
int ftransfer;
if (isLua(ci)) {
@@ -372,10 +394,10 @@ static void rethook (lua_State *L, CallInfo *ci, int nres) {
if (p->is_vararg)
delta = ci->u.l.nextraargs + p->numparams + 1;
}
- ci->func += delta; /* if vararg, back to virtual 'func' */
- ftransfer = cast(unsigned short, firstres - ci->func);
+ ci->func.p += delta; /* if vararg, back to virtual 'func' */
+ ftransfer = cast(unsigned short, firstres - ci->func.p);
luaD_hook(L, LUA_HOOKRET, -1, ftransfer, nres); /* call it */
- ci->func -= delta;
+ ci->func.p -= delta;
}
if (isLua(ci = ci->previous))
L->oldpc = pcRel(ci->u.l.savedpc, ci_func(ci)->p); /* set 'oldpc' */
@@ -387,16 +409,16 @@ static void rethook (lua_State *L, CallInfo *ci, int nres) {
** stack, below original 'func', so that 'luaD_precall' can call it. Raise
** an error if there is no '__call' metafield.
*/
-StkId luaD_tryfuncTM (lua_State *L, StkId func) {
+static StkId tryfuncTM (lua_State *L, StkId func) {
const TValue *tm;
StkId p;
checkstackGCp(L, 1, func); /* space for metamethod */
tm = luaT_gettmbyobj(L, s2v(func), TM_CALL); /* (after previous GC) */
if (l_unlikely(ttisnil(tm)))
luaG_callerror(L, s2v(func)); /* nothing to call */
- for (p = L->top; p > func; p--) /* open space for metamethod */
+ for (p = L->top.p; p > func; p--) /* open space for metamethod */
setobjs2s(L, p, p-1);
- L->top++; /* stack space pre-allocated by the caller */
+ L->top.p++; /* stack space pre-allocated by the caller */
setobj2s(L, func, tm); /* metamethod is the new function to be called */
return func;
}
@@ -413,28 +435,29 @@ l_sinline void moveresults (lua_State *L, StkId res, int nres, int wanted) {
int i;
switch (wanted) { /* handle typical cases separately */
case 0: /* no values needed */
- L->top = res;
+ L->top.p = res;
return;
case 1: /* one value needed */
if (nres == 0) /* no results? */
setnilvalue(s2v(res)); /* adjust with nil */
else /* at least one result */
- setobjs2s(L, res, L->top - nres); /* move it to proper place */
- L->top = res + 1;
+ setobjs2s(L, res, L->top.p - nres); /* move it to proper place */
+ L->top.p = res + 1;
return;
case LUA_MULTRET:
wanted = nres; /* we want all results */
break;
default: /* two/more results and/or to-be-closed variables */
if (hastocloseCfunc(wanted)) { /* to-be-closed variables? */
- ptrdiff_t savedres = savestack(L, res);
L->ci->callstatus |= CIST_CLSRET; /* in case of yields */
L->ci->u2.nres = nres;
- luaF_close(L, res, CLOSEKTOP, 1);
+ res = luaF_close(L, res, CLOSEKTOP, 1);
L->ci->callstatus &= ~CIST_CLSRET;
- if (L->hookmask) /* if needed, call hook after '__close's */
+ if (L->hookmask) { /* if needed, call hook after '__close's */
+ ptrdiff_t savedres = savestack(L, res);
rethook(L, L->ci, nres);
- res = restorestack(L, savedres); /* close and hook can move stack */
+ res = restorestack(L, savedres); /* hook can move stack */
+ }
wanted = decodeNresults(wanted);
if (wanted == LUA_MULTRET)
wanted = nres; /* we want all results */
@@ -442,14 +465,14 @@ l_sinline void moveresults (lua_State *L, StkId res, int nres, int wanted) {
break;
}
/* generic case */
- firstresult = L->top - nres; /* index of first result */
+ firstresult = L->top.p - nres; /* index of first result */
if (nres > wanted) /* extra results? */
nres = wanted; /* don't need them */
for (i = 0; i < nres; i++) /* move all results to correct place */
setobjs2s(L, res + i, firstresult + i);
for (; i < wanted; i++) /* complete wanted number of results */
setnilvalue(s2v(res + i));
- L->top = res + wanted; /* top points after the last result */
+ L->top.p = res + wanted; /* top points after the last result */
}
@@ -464,7 +487,7 @@ void luaD_poscall (lua_State *L, CallInfo *ci, int nres) {
if (l_unlikely(L->hookmask && !hastocloseCfunc(wanted)))
rethook(L, ci, nres);
/* move results to proper place */
- moveresults(L, ci->func, nres, wanted);
+ moveresults(L, ci->func.p, nres, wanted);
/* function cannot be in any of these cases when returning */
lua_assert(!(ci->callstatus &
(CIST_HOOKED | CIST_YPCALL | CIST_FIN | CIST_TRAN | CIST_CLSRET)));
@@ -479,10 +502,10 @@ void luaD_poscall (lua_State *L, CallInfo *ci, int nres) {
l_sinline CallInfo *prepCallInfo (lua_State *L, StkId func, int nret,
int mask, StkId top) {
CallInfo *ci = L->ci = next_ci(L); /* new frame */
- ci->func = func;
+ ci->func.p = func;
ci->nresults = nret;
ci->callstatus = mask;
- ci->top = top;
+ ci->top.p = top;
return ci;
}
@@ -496,10 +519,10 @@ l_sinline int precallC (lua_State *L, StkId func, int nresults,
CallInfo *ci;
checkstackGCp(L, LUA_MINSTACK, func); /* ensure minimum stack size */
L->ci = ci = prepCallInfo(L, func, nresults, CIST_C,
- L->top + LUA_MINSTACK);
- lua_assert(ci->top <= L->stack_last);
+ L->top.p + LUA_MINSTACK);
+ lua_assert(ci->top.p <= L->stack_last.p);
if (l_unlikely(L->hookmask & LUA_MASKCALL)) {
- int narg = cast_int(L->top - func) - 1;
+ int narg = cast_int(L->top.p - func) - 1;
luaD_hook(L, LUA_HOOKCALL, -1, 1, narg);
}
lua_unlock(L);
@@ -531,21 +554,21 @@ int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func,
int nfixparams = p->numparams;
int i;
checkstackGCp(L, fsize - delta, func);
- ci->func -= delta; /* restore 'func' (if vararg) */
+ ci->func.p -= delta; /* restore 'func' (if vararg) */
for (i = 0; i < narg1; i++) /* move down function and arguments */
- setobjs2s(L, ci->func + i, func + i);
- func = ci->func; /* moved-down function */
+ setobjs2s(L, ci->func.p + i, func + i);
+ func = ci->func.p; /* moved-down function */
for (; narg1 <= nfixparams; narg1++)
setnilvalue(s2v(func + narg1)); /* complete missing arguments */
- ci->top = func + 1 + fsize; /* top for new function */
- lua_assert(ci->top <= L->stack_last);
+ ci->top.p = func + 1 + fsize; /* top for new function */
+ lua_assert(ci->top.p <= L->stack_last.p);
ci->u.l.savedpc = p->code; /* starting point */
ci->callstatus |= CIST_TAIL;
- L->top = func + narg1; /* set top */
+ L->top.p = func + narg1; /* set top */
return -1;
}
default: { /* not a function */
- func = luaD_tryfuncTM(L, func); /* try to get '__call' metamethod */
+ func = tryfuncTM(L, func); /* try to get '__call' metamethod */
/* return luaD_pretailcall(L, ci, func, narg1 + 1, delta); */
narg1++;
goto retry; /* try again */
@@ -574,19 +597,19 @@ CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) {
case LUA_VLCL: { /* Lua function */
CallInfo *ci;
Proto *p = clLvalue(s2v(func))->p;
- int narg = cast_int(L->top - func) - 1; /* number of real arguments */
+ int narg = cast_int(L->top.p - func) - 1; /* number of real arguments */
int nfixparams = p->numparams;
int fsize = p->maxstacksize; /* frame size */
checkstackGCp(L, fsize, func);
L->ci = ci = prepCallInfo(L, func, nresults, 0, func + 1 + fsize);
ci->u.l.savedpc = p->code; /* starting point */
for (; narg < nfixparams; narg++)
- setnilvalue(s2v(L->top++)); /* complete missing arguments */
- lua_assert(ci->top <= L->stack_last);
+ setnilvalue(s2v(L->top.p++)); /* complete missing arguments */
+ lua_assert(ci->top.p <= L->stack_last.p);
return ci;
}
default: { /* not a function */
- func = luaD_tryfuncTM(L, func); /* try to get '__call' metamethod */
+ func = tryfuncTM(L, func); /* try to get '__call' metamethod */
/* return luaD_precall(L, func, nresults); */
goto retry; /* try again with metamethod */
}
@@ -598,12 +621,17 @@ CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) {
** Call a function (C or Lua) through C. 'inc' can be 1 (increment
** number of recursive invocations in the C stack) or nyci (the same
** plus increment number of non-yieldable calls).
+** This function can be called with some use of EXTRA_STACK, so it should
+** check the stack before doing anything else. 'luaD_precall' already
+** does that.
*/
-l_sinline void ccall (lua_State *L, StkId func, int nResults, int inc) {
+l_sinline void ccall (lua_State *L, StkId func, int nResults, l_uint32 inc) {
CallInfo *ci;
L->nCcalls += inc;
- if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS))
+ if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) {
+ checkstackp(L, 0, func); /* free any use of EXTRA_STACK */
luaE_checkcstack(L);
+ }
if ((ci = luaD_precall(L, func, nResults)) != NULL) { /* Lua function? */
ci->callstatus = CIST_FRESH; /* mark that it is a "fresh" execute */
luaV_execute(L, ci); /* call it */
@@ -651,8 +679,7 @@ static int finishpcallk (lua_State *L, CallInfo *ci) {
else { /* error */
StkId func = restorestack(L, ci->u2.funcidx);
L->allowhook = getoah(ci->callstatus); /* restore 'allowhook' */
- luaF_close(L, func, status, 1); /* can yield or raise an error */
- func = restorestack(L, ci->u2.funcidx); /* stack may be moved */
+ func = luaF_close(L, func, status, 1); /* can yield or raise an error */
luaD_seterrorobj(L, status, func);
luaD_shrinkstack(L); /* restore stack size in case of overflow */
setcistrecst(ci, LUA_OK); /* clear original status */
@@ -740,8 +767,8 @@ static CallInfo *findpcall (lua_State *L) {
** coroutine error handler and should not kill the coroutine.)
*/
static int resume_error (lua_State *L, const char *msg, int narg) {
- L->top -= narg; /* remove args from the stack */
- setsvalue2s(L, L->top, luaS_new(L, msg)); /* push error message */
+ L->top.p -= narg; /* remove args from the stack */
+ setsvalue2s(L, L->top.p, luaS_new(L, msg)); /* push error message */
api_incr_top(L);
lua_unlock(L);
return LUA_ERRRUN;
@@ -757,7 +784,7 @@ static int resume_error (lua_State *L, const char *msg, int narg) {
*/
static void resume (lua_State *L, void *ud) {
int n = *(cast(int*, ud)); /* number of arguments */
- StkId firstArg = L->top - n; /* first argument */
+ StkId firstArg = L->top.p - n; /* first argument */
CallInfo *ci = L->ci;
if (L->status == LUA_OK) /* starting a coroutine? */
ccall(L, firstArg - 1, LUA_MULTRET, 0); /* just call its body */
@@ -765,7 +792,11 @@ static void resume (lua_State *L, void *ud) {
lua_assert(L->status == LUA_YIELD);
L->status = LUA_OK; /* mark that it is running (again) */
if (isLua(ci)) { /* yielded inside a hook? */
- L->top = firstArg; /* discard arguments */
+ /* undo increment made by 'luaG_traceexec': instruction was not
+ executed yet */
+ lua_assert(ci->callstatus & CIST_HOOKYIELD);
+ ci->u.l.savedpc--;
+ L->top.p = firstArg; /* discard arguments */
luaV_execute(L, ci); /* just continue running Lua code */
}
else { /* 'common' yield */
@@ -808,7 +839,7 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs,
if (L->status == LUA_OK) { /* may be starting a coroutine */
if (L->ci != &L->base_ci) /* not in base level? */
return resume_error(L, "cannot resume non-suspended coroutine", nargs);
- else if (L->top - (L->ci->func + 1) == nargs) /* no function? */
+ else if (L->top.p - (L->ci->func.p + 1) == nargs) /* no function? */
return resume_error(L, "cannot resume dead coroutine", nargs);
}
else if (L->status != LUA_YIELD) /* ended with errors? */
@@ -826,11 +857,11 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs,
lua_assert(status == L->status); /* normal end or yield */
else { /* unrecoverable error */
L->status = cast_byte(status); /* mark thread as 'dead' */
- luaD_seterrorobj(L, status, L->top); /* push error message */
- L->ci->top = L->top;
+ luaD_seterrorobj(L, status, L->top.p); /* push error message */
+ L->ci->top.p = L->top.p;
}
*nresults = (status == LUA_YIELD) ? L->ci->u2.nyield
- : cast_int(L->top - (L->ci->func + 1));
+ : cast_int(L->top.p - (L->ci->func.p + 1));
lua_unlock(L);
return status;
}
@@ -985,7 +1016,7 @@ int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,
p.dyd.gt.arr = NULL; p.dyd.gt.size = 0;
p.dyd.label.arr = NULL; p.dyd.label.size = 0;
luaZ_initbuffer(L, &p.buff);
- status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc);
+ status = luaD_pcall(L, f_parser, &p, savestack(L, L->top.p), L->errfunc);
luaZ_freebuffer(L, &p.buff);
luaM_freearray(L, p.dyd.actvar.arr, p.dyd.actvar.size);
luaM_freearray(L, p.dyd.gt.arr, p.dyd.gt.size);
diff --git a/3rdparty/lua/src/ldo.h b/3rdparty/lua/src/ldo.h
index 911e67f660a..56008ab30f0 100644
--- a/3rdparty/lua/src/ldo.h
+++ b/3rdparty/lua/src/ldo.h
@@ -8,6 +8,7 @@
#define ldo_h
+#include "llimits.h"
#include "lobject.h"
#include "lstate.h"
#include "lzio.h"
@@ -23,7 +24,7 @@
** at every check.
*/
#define luaD_checkstackaux(L,n,pre,pos) \
- if (l_unlikely(L->stack_last - L->top <= (n))) \
+ if (l_unlikely(L->stack_last.p - L->top.p <= (n))) \
{ pre; luaD_growstack(L, n, 1); pos; } \
else { condmovestack(L,pre,pos); }
@@ -32,11 +33,18 @@
-#define savestack(L,p) ((char *)(p) - (char *)L->stack)
-#define restorestack(L,n) ((StkId)((char *)L->stack + (n)))
+#define savestack(L,pt) (cast_charp(pt) - cast_charp(L->stack.p))
+#define restorestack(L,n) cast(StkId, cast_charp(L->stack.p) + (n))
/* macro to check stack size, preserving 'p' */
+#define checkstackp(L,n,p) \
+ luaD_checkstackaux(L, n, \
+ ptrdiff_t t__ = savestack(L, p), /* save 'p' */ \
+ p = restorestack(L, t__)) /* 'pos' part: restore 'p' */
+
+
+/* macro to check stack size and GC, preserving 'p' */
#define checkstackGCp(L,n,p) \
luaD_checkstackaux(L, n, \
ptrdiff_t t__ = savestack(L, p); /* save 'p' */ \
@@ -58,11 +66,11 @@ LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,
LUAI_FUNC void luaD_hook (lua_State *L, int event, int line,
int fTransfer, int nTransfer);
LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci);
-LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int narg1, int delta);
+LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func,
+ int narg1, int delta);
LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults);
LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults);
-LUAI_FUNC StkId luaD_tryfuncTM (lua_State *L, StkId func);
LUAI_FUNC int luaD_closeprotected (lua_State *L, ptrdiff_t level, int status);
LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
ptrdiff_t oldtop, ptrdiff_t ef);
diff --git a/3rdparty/lua/src/ldump.c b/3rdparty/lua/src/ldump.c
index f848b669cbd..f231691b779 100644
--- a/3rdparty/lua/src/ldump.c
+++ b/3rdparty/lua/src/ldump.c
@@ -10,6 +10,7 @@
#include "lprefix.h"
+#include <limits.h>
#include <stddef.h>
#include "lua.h"
@@ -55,8 +56,11 @@ static void dumpByte (DumpState *D, int y) {
}
-/* dumpInt Buff Size */
-#define DIBS ((sizeof(size_t) * 8 / 7) + 1)
+/*
+** 'dumpSize' buffer size: each byte can store up to 7 bits. (The "+6"
+** rounds up the division.)
+*/
+#define DIBS ((sizeof(size_t) * CHAR_BIT + 6) / 7)
static void dumpSize (DumpState *D, size_t x) {
lu_byte buff[DIBS];
diff --git a/3rdparty/lua/src/lfunc.c b/3rdparty/lua/src/lfunc.c
index f5889a21d12..0945f241de2 100644
--- a/3rdparty/lua/src/lfunc.c
+++ b/3rdparty/lua/src/lfunc.c
@@ -50,8 +50,8 @@ void luaF_initupvals (lua_State *L, LClosure *cl) {
for (i = 0; i < cl->nupvalues; i++) {
GCObject *o = luaC_newobj(L, LUA_VUPVAL, sizeof(UpVal));
UpVal *uv = gco2upv(o);
- uv->v = &uv->u.value; /* make it closed */
- setnilvalue(uv->v);
+ uv->v.p = &uv->u.value; /* make it closed */
+ setnilvalue(uv->v.p);
cl->upvals[i] = uv;
luaC_objbarrier(L, cl, uv);
}
@@ -62,12 +62,11 @@ void luaF_initupvals (lua_State *L, LClosure *cl) {
** Create a new upvalue at the given level, and link it to the list of
** open upvalues of 'L' after entry 'prev'.
**/
-static UpVal *newupval (lua_State *L, int tbc, StkId level, UpVal **prev) {
+static UpVal *newupval (lua_State *L, StkId level, UpVal **prev) {
GCObject *o = luaC_newobj(L, LUA_VUPVAL, sizeof(UpVal));
UpVal *uv = gco2upv(o);
UpVal *next = *prev;
- uv->v = s2v(level); /* current value lives in the stack */
- uv->tbc = tbc;
+ uv->v.p = s2v(level); /* current value lives in the stack */
uv->u.open.next = next; /* link it to list of open upvalues */
uv->u.open.previous = prev;
if (next)
@@ -96,7 +95,7 @@ UpVal *luaF_findupval (lua_State *L, StkId level) {
pp = &p->u.open.next;
}
/* not found: create a new upvalue after 'pp' */
- return newupval(L, 0, level, pp);
+ return newupval(L, level, pp);
}
@@ -106,12 +105,12 @@ UpVal *luaF_findupval (lua_State *L, StkId level) {
** (This function assumes EXTRA_STACK.)
*/
static void callclosemethod (lua_State *L, TValue *obj, TValue *err, int yy) {
- StkId top = L->top;
+ StkId top = L->top.p;
const TValue *tm = luaT_gettmbyobj(L, obj, TM_CLOSE);
setobj2s(L, top, tm); /* will call metamethod... */
setobj2s(L, top + 1, obj); /* with 'self' as the 1st argument */
setobj2s(L, top + 2, err); /* and error msg. as 2nd argument */
- L->top = top + 3; /* add function and arguments */
+ L->top.p = top + 3; /* add function and arguments */
if (yy)
luaD_call(L, top, 0);
else
@@ -126,7 +125,7 @@ static void callclosemethod (lua_State *L, TValue *obj, TValue *err, int yy) {
static void checkclosemth (lua_State *L, StkId level) {
const TValue *tm = luaT_gettmbyobj(L, s2v(level), TM_CLOSE);
if (ttisnil(tm)) { /* no metamethod? */
- int idx = cast_int(level - L->ci->func); /* variable index */
+ int idx = cast_int(level - L->ci->func.p); /* variable index */
const char *vname = luaG_findlocal(L, L->ci, idx, NULL);
if (vname == NULL) vname = "?";
luaG_runerror(L, "variable '%s' got a non-closable value", vname);
@@ -160,23 +159,23 @@ static void prepcallclosemth (lua_State *L, StkId level, int status, int yy) {
** is used.)
*/
#define MAXDELTA \
- ((256ul << ((sizeof(L->stack->tbclist.delta) - 1) * 8)) - 1)
+ ((256ul << ((sizeof(L->stack.p->tbclist.delta) - 1) * 8)) - 1)
/*
** Insert a variable in the list of to-be-closed variables.
*/
void luaF_newtbcupval (lua_State *L, StkId level) {
- lua_assert(level > L->tbclist);
+ lua_assert(level > L->tbclist.p);
if (l_isfalse(s2v(level)))
return; /* false doesn't need to be closed */
checkclosemth(L, level); /* value must have a close method */
- while (cast_uint(level - L->tbclist) > MAXDELTA) {
- L->tbclist += MAXDELTA; /* create a dummy node at maximum delta */
- L->tbclist->tbclist.delta = 0;
+ while (cast_uint(level - L->tbclist.p) > MAXDELTA) {
+ L->tbclist.p += MAXDELTA; /* create a dummy node at maximum delta */
+ L->tbclist.p->tbclist.delta = 0;
}
- level->tbclist.delta = cast(unsigned short, level - L->tbclist);
- L->tbclist = level;
+ level->tbclist.delta = cast(unsigned short, level - L->tbclist.p);
+ L->tbclist.p = level;
}
@@ -196,10 +195,10 @@ void luaF_closeupval (lua_State *L, StkId level) {
StkId upl; /* stack index pointed by 'uv' */
while ((uv = L->openupval) != NULL && (upl = uplevel(uv)) >= level) {
TValue *slot = &uv->u.value; /* new position for value */
- lua_assert(uplevel(uv) < L->top);
+ lua_assert(uplevel(uv) < L->top.p);
luaF_unlinkupval(uv); /* remove upvalue from 'openupval' list */
- setobj(L, slot, uv->v); /* move value to upvalue slot */
- uv->v = slot; /* now current value lives here */
+ setobj(L, slot, uv->v.p); /* move value to upvalue slot */
+ uv->v.p = slot; /* now current value lives here */
if (!iswhite(uv)) { /* neither white nor dead? */
nw2black(uv); /* closed upvalues cannot be gray */
luaC_barrier(L, uv, slot);
@@ -209,31 +208,32 @@ void luaF_closeupval (lua_State *L, StkId level) {
/*
-** Remove firt element from the tbclist plus its dummy nodes.
+** Remove first element from the tbclist plus its dummy nodes.
*/
static void poptbclist (lua_State *L) {
- StkId tbc = L->tbclist;
+ StkId tbc = L->tbclist.p;
lua_assert(tbc->tbclist.delta > 0); /* first element cannot be dummy */
tbc -= tbc->tbclist.delta;
- while (tbc > L->stack && tbc->tbclist.delta == 0)
+ while (tbc > L->stack.p && tbc->tbclist.delta == 0)
tbc -= MAXDELTA; /* remove dummy nodes */
- L->tbclist = tbc;
+ L->tbclist.p = tbc;
}
/*
** Close all upvalues and to-be-closed variables up to the given stack
-** level.
+** level. Return restored 'level'.
*/
-void luaF_close (lua_State *L, StkId level, int status, int yy) {
+StkId luaF_close (lua_State *L, StkId level, int status, int yy) {
ptrdiff_t levelrel = savestack(L, level);
luaF_closeupval(L, level); /* first, close the upvalues */
- while (L->tbclist >= level) { /* traverse tbc's down to that level */
- StkId tbc = L->tbclist; /* get variable index */
+ while (L->tbclist.p >= level) { /* traverse tbc's down to that level */
+ StkId tbc = L->tbclist.p; /* get variable index */
poptbclist(L); /* remove it from list */
prepcallclosemth(L, tbc, status, yy); /* close variable */
level = restorestack(L, levelrel);
}
+ return level;
}
diff --git a/3rdparty/lua/src/lfunc.h b/3rdparty/lua/src/lfunc.h
index dc1cebccd1b..3be265efb58 100644
--- a/3rdparty/lua/src/lfunc.h
+++ b/3rdparty/lua/src/lfunc.h
@@ -29,10 +29,10 @@
#define MAXUPVAL 255
-#define upisopen(up) ((up)->v != &(up)->u.value)
+#define upisopen(up) ((up)->v.p != &(up)->u.value)
-#define uplevel(up) check_exp(upisopen(up), cast(StkId, (up)->v))
+#define uplevel(up) check_exp(upisopen(up), cast(StkId, (up)->v.p))
/*
@@ -54,7 +54,7 @@ LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl);
LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level);
LUAI_FUNC void luaF_closeupval (lua_State *L, StkId level);
-LUAI_FUNC void luaF_close (lua_State *L, StkId level, int status, int yy);
+LUAI_FUNC StkId luaF_close (lua_State *L, StkId level, int status, int yy);
LUAI_FUNC void luaF_unlinkupval (UpVal *uv);
LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
diff --git a/3rdparty/lua/src/lgc.c b/3rdparty/lua/src/lgc.c
index 42a73d813ac..5817f9eec35 100644
--- a/3rdparty/lua/src/lgc.c
+++ b/3rdparty/lua/src/lgc.c
@@ -252,12 +252,13 @@ void luaC_fix (lua_State *L, GCObject *o) {
/*
-** create a new collectable object (with given type and size) and link
-** it to 'allgc' list.
+** create a new collectable object (with given type, size, and offset)
+** and link it to 'allgc' list.
*/
-GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) {
+GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz, size_t offset) {
global_State *g = G(L);
- GCObject *o = cast(GCObject *, luaM_newobject(L, novariant(tt), sz));
+ char *p = cast_charp(luaM_newobject(L, novariant(tt), sz));
+ GCObject *o = cast(GCObject *, p + offset);
o->marked = luaC_white(g);
o->tt = tt;
o->next = g->allgc;
@@ -265,6 +266,11 @@ GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) {
return o;
}
+
+GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) {
+ return luaC_newobjdt(L, tt, sz, 0);
+}
+
/* }====================================================== */
@@ -301,7 +307,7 @@ static void reallymarkobject (global_State *g, GCObject *o) {
set2gray(uv); /* open upvalues are kept gray */
else
set2black(uv); /* closed upvalues are visited here */
- markvalue(g, uv->v); /* mark its content */
+ markvalue(g, uv->v.p); /* mark its content */
break;
}
case LUA_VUSERDATA: {
@@ -376,7 +382,7 @@ static int remarkupvals (global_State *g) {
work++;
if (!iswhite(uv)) { /* upvalue already visited? */
lua_assert(upisopen(uv) && isgray(uv));
- markvalue(g, uv->v); /* mark its value */
+ markvalue(g, uv->v.p); /* mark its value */
}
}
}
@@ -536,10 +542,12 @@ static void traversestrongtable (global_State *g, Table *h) {
static lu_mem traversetable (global_State *g, Table *h) {
const char *weakkey, *weakvalue;
const TValue *mode = gfasttm(g, h->metatable, TM_MODE);
+ TString *smode;
markobjectN(g, h->metatable);
- if (mode && ttisstring(mode) && /* is there a weak mode? */
- (cast_void(weakkey = strchr(svalue(mode), 'k')),
- cast_void(weakvalue = strchr(svalue(mode), 'v')),
+ if (mode && ttisshrstring(mode) && /* is there a weak mode? */
+ (cast_void(smode = tsvalue(mode)),
+ cast_void(weakkey = strchr(getshrstr(smode), 'k')),
+ cast_void(weakvalue = strchr(getshrstr(smode), 'v')),
(weakkey || weakvalue))) { /* is really weak? */
if (!weakkey) /* strong keys? */
traverseweakvalue(g, h);
@@ -620,19 +628,21 @@ static int traverseLclosure (global_State *g, LClosure *cl) {
*/
static int traversethread (global_State *g, lua_State *th) {
UpVal *uv;
- StkId o = th->stack;
+ StkId o = th->stack.p;
if (isold(th) || g->gcstate == GCSpropagate)
linkgclist(th, g->grayagain); /* insert into 'grayagain' list */
if (o == NULL)
return 1; /* stack not completely built yet */
lua_assert(g->gcstate == GCSatomic ||
th->openupval == NULL || isintwups(th));
- for (; o < th->top; o++) /* mark live elements in the stack */
+ for (; o < th->top.p; o++) /* mark live elements in the stack */
markvalue(g, s2v(o));
for (uv = th->openupval; uv != NULL; uv = uv->u.open.next)
markobject(g, uv); /* open upvalues cannot be collected */
if (g->gcstate == GCSatomic) { /* final traversal? */
- for (; o < th->stack_last + EXTRA_STACK; o++)
+ if (!g->gcemergency)
+ luaD_shrinkstack(th); /* do not change stack in emergency cycle */
+ for (o = th->top.p; o < th->stack_last.p + EXTRA_STACK; o++)
setnilvalue(s2v(o)); /* clear dead stack slice */
/* 'remarkupvals' may have removed thread from 'twups' list */
if (!isintwups(th) && th->openupval != NULL) {
@@ -640,8 +650,6 @@ static int traversethread (global_State *g, lua_State *th) {
g->twups = th;
}
}
- else if (!g->gcemergency)
- luaD_shrinkstack(th); /* do not change stack in emergency cycle */
return 1 + stacksize(th);
}
@@ -892,7 +900,7 @@ static GCObject *udata2finalize (global_State *g) {
static void dothecall (lua_State *L, void *ud) {
UNUSED(ud);
- luaD_callnoyield(L, L->top - 2, 0);
+ luaD_callnoyield(L, L->top.p - 2, 0);
}
@@ -909,16 +917,16 @@ static void GCTM (lua_State *L) {
int oldgcstp = g->gcstp;
g->gcstp |= GCSTPGC; /* avoid GC steps */
L->allowhook = 0; /* stop debug hooks during GC metamethod */
- setobj2s(L, L->top++, tm); /* push finalizer... */
- setobj2s(L, L->top++, &v); /* ... and its argument */
+ setobj2s(L, L->top.p++, tm); /* push finalizer... */
+ setobj2s(L, L->top.p++, &v); /* ... and its argument */
L->ci->callstatus |= CIST_FIN; /* will run a finalizer */
- status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top - 2), 0);
+ status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top.p - 2), 0);
L->ci->callstatus &= ~CIST_FIN; /* not running a finalizer anymore */
L->allowhook = oldah; /* restore hooks */
g->gcstp = oldgcstp; /* restore state */
if (l_unlikely(status != LUA_OK)) { /* error while running __gc? */
luaE_warnerror(L, "__gc");
- L->top--; /* pops error object */
+ L->top.p--; /* pops error object */
}
}
}
@@ -1041,7 +1049,25 @@ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) {
** =======================================================
*/
-static void setpause (global_State *g);
+
+/*
+** Set the "time" to wait before starting a new GC cycle; cycle will
+** start when memory use hits the threshold of ('estimate' * pause /
+** PAUSEADJ). (Division by 'estimate' should be OK: it cannot be zero,
+** because Lua cannot even start with less than PAUSEADJ bytes).
+*/
+static void setpause (global_State *g) {
+ l_mem threshold, debt;
+ int pause = getgcparam(g->gcpause);
+ l_mem estimate = g->GCestimate / PAUSEADJ; /* adjust 'estimate' */
+ lua_assert(estimate > 0);
+ threshold = (pause < MAX_LMEM / estimate) /* overflow? */
+ ? estimate * pause /* no overflow */
+ : MAX_LMEM; /* overflow; truncate to maximum */
+ debt = gettotalbytes(g) - threshold;
+ if (debt > 0) debt = 0;
+ luaE_setdebt(g, debt);
+}
/*
@@ -1286,6 +1312,15 @@ static void atomic2gen (lua_State *L, global_State *g) {
/*
+** Set debt for the next minor collection, which will happen when
+** memory grows 'genminormul'%.
+*/
+static void setminordebt (global_State *g) {
+ luaE_setdebt(g, -(cast(l_mem, (gettotalbytes(g) / 100)) * g->genminormul));
+}
+
+
+/*
** Enter generational mode. Must go until the end of an atomic cycle
** to ensure that all objects are correctly marked and weak tables
** are cleared. Then, turn all objects into old and finishes the
@@ -1297,6 +1332,7 @@ static lu_mem entergen (lua_State *L, global_State *g) {
luaC_runtilstate(L, bitmask(GCSpropagate)); /* start new cycle */
numobjs = atomic(L); /* propagates all and then do the atomic stuff */
atomic2gen(L, g);
+ setminordebt(g); /* set debt assuming next cycle will be minor */
return numobjs;
}
@@ -1343,15 +1379,6 @@ static lu_mem fullgen (lua_State *L, global_State *g) {
/*
-** Set debt for the next minor collection, which will happen when
-** memory grows 'genminormul'%.
-*/
-static void setminordebt (global_State *g) {
- luaE_setdebt(g, -(cast(l_mem, (gettotalbytes(g) / 100)) * g->genminormul));
-}
-
-
-/*
** Does a major collection after last collection was a "bad collection".
**
** When the program is building a big structure, it allocates lots of
@@ -1384,7 +1411,7 @@ static void stepgenfull (lua_State *L, global_State *g) {
setminordebt(g);
}
else { /* another bad collection; stay in incremental mode */
- g->GCestimate = gettotalbytes(g); /* first estimate */;
+ g->GCestimate = gettotalbytes(g); /* first estimate */
entersweep(L);
luaC_runtilstate(L, bitmask(GCSpause)); /* finish collection */
setpause(g);
@@ -1422,8 +1449,8 @@ static void genstep (lua_State *L, global_State *g) {
lu_mem numobjs = fullgen(L, g); /* do a major collection */
if (gettotalbytes(g) < majorbase + (majorinc / 2)) {
/* collected at least half of memory growth since last major
- collection; keep doing minor collections */
- setminordebt(g);
+ collection; keep doing minor collections. */
+ lua_assert(g->lastatomic == 0);
}
else { /* bad collection */
g->lastatomic = numobjs; /* signal that last collection was bad */
@@ -1450,26 +1477,6 @@ static void genstep (lua_State *L, global_State *g) {
/*
-** Set the "time" to wait before starting a new GC cycle; cycle will
-** start when memory use hits the threshold of ('estimate' * pause /
-** PAUSEADJ). (Division by 'estimate' should be OK: it cannot be zero,
-** because Lua cannot even start with less than PAUSEADJ bytes).
-*/
-static void setpause (global_State *g) {
- l_mem threshold, debt;
- int pause = getgcparam(g->gcpause);
- l_mem estimate = g->GCestimate / PAUSEADJ; /* adjust 'estimate' */
- lua_assert(estimate > 0);
- threshold = (pause < MAX_LMEM / estimate) /* overflow? */
- ? estimate * pause /* no overflow */
- : MAX_LMEM; /* overflow; truncate to maximum */
- debt = gettotalbytes(g) - threshold;
- if (debt > 0) debt = 0;
- luaE_setdebt(g, debt);
-}
-
-
-/*
** Enter first sweep phase.
** The call to 'sweeptolive' makes the pointer point to an object
** inside the list (instead of to the header), so that the real sweep do
@@ -1599,7 +1606,7 @@ static lu_mem singlestep (lua_State *L) {
case GCSenteratomic: {
work = atomic(L); /* work is what was traversed by 'atomic' */
entersweep(L);
- g->GCestimate = gettotalbytes(g); /* first estimate */;
+ g->GCestimate = gettotalbytes(g); /* first estimate */
break;
}
case GCSswpallgc: { /* sweep "regular" objects */
@@ -1676,12 +1683,15 @@ static void incstep (lua_State *L, global_State *g) {
}
/*
-** performs a basic GC step if collector is running
+** Performs a basic GC step if collector is running. (If collector is
+** not running, set a reasonable debt to avoid it being called at
+** every single check.)
*/
void luaC_step (lua_State *L) {
global_State *g = G(L);
- lua_assert(!g->gcemergency);
- if (gcrunning(g)) { /* running? */
+ if (!gcrunning(g)) /* not running? */
+ luaE_setdebt(g, -2000);
+ else {
if(isdecGCmodegen(g))
genstep(L, g);
else
@@ -1702,6 +1712,8 @@ static void fullinc (lua_State *L, global_State *g) {
entersweep(L); /* sweep everything to turn them back to white */
/* finish any pending sweep phase to start a new cycle */
luaC_runtilstate(L, bitmask(GCSpause));
+ luaC_runtilstate(L, bitmask(GCSpropagate)); /* start new cycle */
+ g->gcstate = GCSenteratomic; /* go straight to atomic phase */
luaC_runtilstate(L, bitmask(GCScallfin)); /* run up to finalizers */
/* estimate must be correct after a full GC cycle */
lua_assert(g->GCestimate == gettotalbytes(g));
diff --git a/3rdparty/lua/src/lgc.h b/3rdparty/lua/src/lgc.h
index 4a125634b9e..538f6edcccf 100644
--- a/3rdparty/lua/src/lgc.h
+++ b/3rdparty/lua/src/lgc.h
@@ -172,24 +172,27 @@
#define luaC_checkGC(L) luaC_condGC(L,(void)0,(void)0)
-#define luaC_barrier(L,p,v) ( \
- (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \
- luaC_barrier_(L,obj2gco(p),gcvalue(v)) : cast_void(0))
-
-#define luaC_barrierback(L,p,v) ( \
- (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \
- luaC_barrierback_(L,p) : cast_void(0))
-
#define luaC_objbarrier(L,p,o) ( \
(isblack(p) && iswhite(o)) ? \
luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))
+#define luaC_barrier(L,p,v) ( \
+ iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0))
+
+#define luaC_objbarrierback(L,p,o) ( \
+ (isblack(p) && iswhite(o)) ? luaC_barrierback_(L,p) : cast_void(0))
+
+#define luaC_barrierback(L,p,v) ( \
+ iscollectable(v) ? luaC_objbarrierback(L, p, gcvalue(v)) : cast_void(0))
+
LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o);
LUAI_FUNC void luaC_freeallobjects (lua_State *L);
LUAI_FUNC void luaC_step (lua_State *L);
LUAI_FUNC void luaC_runtilstate (lua_State *L, int statesmask);
LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency);
LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz);
+LUAI_FUNC GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz,
+ size_t offset);
LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v);
LUAI_FUNC void luaC_barrierback_ (lua_State *L, GCObject *o);
LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt);
diff --git a/3rdparty/lua/src/liolib.c b/3rdparty/lua/src/liolib.c
index b08397da45d..c5075f3e78a 100644
--- a/3rdparty/lua/src/liolib.c
+++ b/3rdparty/lua/src/liolib.c
@@ -245,8 +245,8 @@ static int f_gc (lua_State *L) {
*/
static int io_fclose (lua_State *L) {
LStream *p = tolstream(L);
- int res = fclose(p->f);
- return luaL_fileresult(L, (res == 0), NULL);
+ errno = 0;
+ return luaL_fileresult(L, (fclose(p->f) == 0), NULL);
}
@@ -272,6 +272,7 @@ static int io_open (lua_State *L) {
LStream *p = newfile(L);
const char *md = mode; /* to traverse/check mode */
luaL_argcheck(L, l_checkmode(md), 2, "invalid mode");
+ errno = 0;
p->f = fopen(filename, mode);
return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1;
}
@@ -292,6 +293,7 @@ static int io_popen (lua_State *L) {
const char *mode = luaL_optstring(L, 2, "r");
LStream *p = newprefile(L);
luaL_argcheck(L, l_checkmodep(mode), 2, "invalid mode");
+ errno = 0;
p->f = l_popen(L, filename, mode);
p->closef = &io_pclose;
return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1;
@@ -300,6 +302,7 @@ static int io_popen (lua_State *L) {
static int io_tmpfile (lua_State *L) {
LStream *p = newfile(L);
+ errno = 0;
p->f = tmpfile();
return (p->f == NULL) ? luaL_fileresult(L, 0, NULL) : 1;
}
@@ -567,6 +570,7 @@ static int g_read (lua_State *L, FILE *f, int first) {
int nargs = lua_gettop(L) - 1;
int n, success;
clearerr(f);
+ errno = 0;
if (nargs == 0) { /* no arguments? */
success = read_line(L, f, 1);
n = first + 1; /* to return 1 result */
@@ -660,6 +664,7 @@ static int io_readline (lua_State *L) {
static int g_write (lua_State *L, FILE *f, int arg) {
int nargs = lua_gettop(L) - arg;
int status = 1;
+ errno = 0;
for (; nargs--; arg++) {
if (lua_type(L, arg) == LUA_TNUMBER) {
/* optimization: could be done exactly as for strings */
@@ -678,7 +683,8 @@ static int g_write (lua_State *L, FILE *f, int arg) {
}
if (l_likely(status))
return 1; /* file handle already on stack top */
- else return luaL_fileresult(L, status, NULL);
+ else
+ return luaL_fileresult(L, status, NULL);
}
@@ -703,6 +709,7 @@ static int f_seek (lua_State *L) {
l_seeknum offset = (l_seeknum)p3;
luaL_argcheck(L, (lua_Integer)offset == p3, 3,
"not an integer in proper range");
+ errno = 0;
op = l_fseek(f, offset, mode[op]);
if (l_unlikely(op))
return luaL_fileresult(L, 0, NULL); /* error */
@@ -719,19 +726,25 @@ static int f_setvbuf (lua_State *L) {
FILE *f = tofile(L);
int op = luaL_checkoption(L, 2, NULL, modenames);
lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE);
- int res = setvbuf(f, NULL, mode[op], (size_t)sz);
+ int res;
+ errno = 0;
+ res = setvbuf(f, NULL, mode[op], (size_t)sz);
return luaL_fileresult(L, res == 0, NULL);
}
static int io_flush (lua_State *L) {
- return luaL_fileresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL);
+ FILE *f = getiofile(L, IO_OUTPUT);
+ errno = 0;
+ return luaL_fileresult(L, fflush(f) == 0, NULL);
}
static int f_flush (lua_State *L) {
- return luaL_fileresult(L, fflush(tofile(L)) == 0, NULL);
+ FILE *f = tofile(L);
+ errno = 0;
+ return luaL_fileresult(L, fflush(f) == 0, NULL);
}
@@ -773,7 +786,7 @@ static const luaL_Reg meth[] = {
** metamethods for file handles
*/
static const luaL_Reg metameth[] = {
- {"__index", NULL}, /* place holder */
+ {"__index", NULL}, /* placeholder */
{"__gc", f_gc},
{"__close", f_gc},
{"__tostring", f_tostring},
diff --git a/3rdparty/lua/src/llex.c b/3rdparty/lua/src/llex.c
index e99151787a6..5fc39a5cdec 100644
--- a/3rdparty/lua/src/llex.c
+++ b/3rdparty/lua/src/llex.c
@@ -128,7 +128,7 @@ l_noret luaX_syntaxerror (LexState *ls, const char *msg) {
** ensuring there is only one copy of each unique string. The table
** here is used as a set: the string enters as the key, while its value
** is irrelevant. We use the string itself as the value only because it
-** is a TValue readly available. Later, the code generation can change
+** is a TValue readily available. Later, the code generation can change
** this value.
*/
TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
@@ -138,12 +138,12 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
if (!ttisnil(o)) /* string already present? */
ts = keystrval(nodefromval(o)); /* get saved copy */
else { /* not in use yet */
- TValue *stv = s2v(L->top++); /* reserve stack space for string */
+ TValue *stv = s2v(L->top.p++); /* reserve stack space for string */
setsvalue(L, stv, ts); /* temporarily anchor the string */
luaH_finishset(L, ls->h, stv, o, stv); /* t[string] = string */
/* table is not a metatable, so it does not need to invalidate cache */
luaC_checkGC(L);
- L->top--; /* remove string from stack */
+ L->top.p--; /* remove string from stack */
}
return ts;
}
diff --git a/3rdparty/lua/src/llimits.h b/3rdparty/lua/src/llimits.h
index 52a32f92e30..1c826f7be20 100644
--- a/3rdparty/lua/src/llimits.h
+++ b/3rdparty/lua/src/llimits.h
@@ -71,11 +71,24 @@ typedef signed char ls_byte;
/*
-** conversion of pointer to unsigned integer:
-** this is for hashing only; there is no problem if the integer
-** cannot hold the whole pointer value
+** conversion of pointer to unsigned integer: this is for hashing only;
+** there is no problem if the integer cannot hold the whole pointer
+** value. (In strict ISO C this may cause undefined behavior, but no
+** actual machine seems to bother.)
*/
-#define point2uint(p) ((unsigned int)((size_t)(p) & UINT_MAX))
+#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \
+ __STDC_VERSION__ >= 199901L
+#include <stdint.h>
+#if defined(UINTPTR_MAX) /* even in C99 this type is optional */
+#define L_P2I uintptr_t
+#else /* no 'intptr'? */
+#define L_P2I uintmax_t /* use the largest available integer */
+#endif
+#else /* C89 option */
+#define L_P2I size_t
+#endif
+
+#define point2uint(p) ((unsigned int)((L_P2I)(p) & UINT_MAX))
diff --git a/3rdparty/lua/src/lmathlib.c b/3rdparty/lua/src/lmathlib.c
index e0c61a168d9..43810634808 100644
--- a/3rdparty/lua/src/lmathlib.c
+++ b/3rdparty/lua/src/lmathlib.c
@@ -249,6 +249,15 @@ static int math_type (lua_State *L) {
** ===================================================================
*/
+/*
+** This code uses lots of shifts. ANSI C does not allow shifts greater
+** than or equal to the width of the type being shifted, so some shifts
+** are written in convoluted ways to match that restriction. For
+** preprocessor tests, it assumes a width of 32 bits, so the maximum
+** shift there is 31 bits.
+*/
+
+
/* number of binary digits in the mantissa of a float */
#define FIGS l_floatatt(MANT_DIG)
@@ -267,20 +276,23 @@ static int math_type (lua_State *L) {
/* try to find an integer type with at least 64 bits */
-#if (ULONG_MAX >> 31 >> 31) >= 3
+#if ((ULONG_MAX >> 31) >> 31) >= 3
/* 'long' has at least 64 bits */
#define Rand64 unsigned long
+#define SRand64 long
#elif !defined(LUA_USE_C89) && defined(LLONG_MAX)
/* there is a 'long long' type (which must have at least 64 bits) */
#define Rand64 unsigned long long
+#define SRand64 long long
-#elif (LUA_MAXUNSIGNED >> 31 >> 31) >= 3
+#elif ((LUA_MAXUNSIGNED >> 31) >> 31) >= 3
-/* 'lua_Integer' has at least 64 bits */
+/* 'lua_Unsigned' has at least 64 bits */
#define Rand64 lua_Unsigned
+#define SRand64 lua_Integer
#endif
@@ -319,23 +331,30 @@ static Rand64 nextrand (Rand64 *state) {
}
-/* must take care to not shift stuff by more than 63 slots */
-
-
/*
** Convert bits from a random integer into a float in the
** interval [0,1), getting the higher FIG bits from the
** random unsigned integer and converting that to a float.
+** Some old Microsoft compilers cannot cast an unsigned long
+** to a floating-point number, so we use a signed long as an
+** intermediary. When lua_Number is float or double, the shift ensures
+** that 'sx' is non negative; in that case, a good compiler will remove
+** the correction.
*/
/* must throw out the extra (64 - FIGS) bits */
#define shift64_FIG (64 - FIGS)
-/* to scale to [0, 1), multiply by scaleFIG = 2^(-FIGS) */
+/* 2^(-FIGS) == 2^-1 / 2^(FIGS-1) */
#define scaleFIG (l_mathop(0.5) / ((Rand64)1 << (FIGS - 1)))
static lua_Number I2d (Rand64 x) {
- return (lua_Number)(trim64(x) >> shift64_FIG) * scaleFIG;
+ SRand64 sx = (SRand64)(trim64(x) >> shift64_FIG);
+ lua_Number res = (lua_Number)(sx) * scaleFIG;
+ if (sx < 0)
+ res += l_mathop(1.0); /* correct the two's complement if negative */
+ lua_assert(0 <= res && res < 1);
+ return res;
}
/* convert a 'Rand64' to a 'lua_Unsigned' */
@@ -471,8 +490,6 @@ static lua_Number I2d (Rand64 x) {
#else /* 32 < FIGS <= 64 */
-/* must take care to not shift stuff by more than 31 slots */
-
/* 2^(-FIGS) = 1.0 / 2^30 / 2^3 / 2^(FIGS-33) */
#define scaleFIG \
(l_mathop(1.0) / (UONE << 30) / l_mathop(8.0) / (UONE << (FIGS - 33)))
@@ -500,12 +517,12 @@ static lua_Number I2d (Rand64 x) {
/* convert a 'Rand64' to a 'lua_Unsigned' */
static lua_Unsigned I2UInt (Rand64 x) {
- return ((lua_Unsigned)trim32(x.h) << 31 << 1) | (lua_Unsigned)trim32(x.l);
+ return (((lua_Unsigned)trim32(x.h) << 31) << 1) | (lua_Unsigned)trim32(x.l);
}
/* convert a 'lua_Unsigned' to a 'Rand64' */
static Rand64 Int2I (lua_Unsigned n) {
- return packI((lu_int32)(n >> 31 >> 1), (lu_int32)n);
+ return packI((lu_int32)((n >> 31) >> 1), (lu_int32)n);
}
#endif /* } */
diff --git a/3rdparty/lua/src/lmem.c b/3rdparty/lua/src/lmem.c
index 9029d588c12..9800a86fc02 100644
--- a/3rdparty/lua/src/lmem.c
+++ b/3rdparty/lua/src/lmem.c
@@ -22,25 +22,6 @@
#include "lstate.h"
-#if defined(EMERGENCYGCTESTS)
-/*
-** First allocation will fail whenever not building initial state.
-** (This fail will trigger 'tryagain' and a full GC cycle at every
-** allocation.)
-*/
-static void *firsttry (global_State *g, void *block, size_t os, size_t ns) {
- if (completestate(g) && ns > 0) /* frees never fail */
- return NULL; /* fail */
- else /* normal allocation */
- return (*g->frealloc)(g->ud, block, os, ns);
-}
-#else
-#define firsttry(g,block,os,ns) ((*g->frealloc)(g->ud, block, os, ns))
-#endif
-
-
-
-
/*
** About the realloc function:
@@ -60,6 +41,43 @@ static void *firsttry (global_State *g, void *block, size_t os, size_t ns) {
*/
+/*
+** Macro to call the allocation function.
+*/
+#define callfrealloc(g,block,os,ns) ((*g->frealloc)(g->ud, block, os, ns))
+
+
+/*
+** When an allocation fails, it will try again after an emergency
+** collection, except when it cannot run a collection. The GC should
+** not be called while the state is not fully built, as the collector
+** is not yet fully initialized. Also, it should not be called when
+** 'gcstopem' is true, because then the interpreter is in the middle of
+** a collection step.
+*/
+#define cantryagain(g) (completestate(g) && !g->gcstopem)
+
+
+
+
+#if defined(EMERGENCYGCTESTS)
+/*
+** First allocation will fail except when freeing a block (frees never
+** fail) and when it cannot try again; this fail will trigger 'tryagain'
+** and a full GC cycle at every allocation.
+*/
+static void *firsttry (global_State *g, void *block, size_t os, size_t ns) {
+ if (ns > 0 && cantryagain(g))
+ return NULL; /* fail */
+ else /* normal allocation */
+ return callfrealloc(g, block, os, ns);
+}
+#else
+#define firsttry(g,block,os,ns) callfrealloc(g, block, os, ns)
+#endif
+
+
+
/*
@@ -132,7 +150,7 @@ l_noret luaM_toobig (lua_State *L) {
void luaM_free_ (lua_State *L, void *block, size_t osize) {
global_State *g = G(L);
lua_assert((osize == 0) == (block == NULL));
- (*g->frealloc)(g->ud, block, osize, 0);
+ callfrealloc(g, block, osize, 0);
g->GCdebt -= osize;
}
@@ -140,19 +158,15 @@ void luaM_free_ (lua_State *L, void *block, size_t osize) {
/*
** In case of allocation fail, this function will do an emergency
** collection to free some memory and then try the allocation again.
-** The GC should not be called while state is not fully built, as the
-** collector is not yet fully initialized. Also, it should not be called
-** when 'gcstopem' is true, because then the interpreter is in the
-** middle of a collection step.
*/
static void *tryagain (lua_State *L, void *block,
size_t osize, size_t nsize) {
global_State *g = G(L);
- if (completestate(g) && !g->gcstopem) {
+ if (cantryagain(g)) {
luaC_fullgc(L, 1); /* try to free some memory... */
- return (*g->frealloc)(g->ud, block, osize, nsize); /* try again */
+ return callfrealloc(g, block, osize, nsize); /* try again */
}
- else return NULL; /* cannot free any memory without a full state */
+ else return NULL; /* cannot run an emergency collection */
}
diff --git a/3rdparty/lua/src/loadlib.c b/3rdparty/lua/src/loadlib.c
index 6f9fa37366e..6d289fcebb8 100644
--- a/3rdparty/lua/src/loadlib.c
+++ b/3rdparty/lua/src/loadlib.c
@@ -25,15 +25,6 @@
/*
-** LUA_IGMARK is a mark to ignore all before it when building the
-** luaopen_ function name.
-*/
-#if !defined (LUA_IGMARK)
-#define LUA_IGMARK "-"
-#endif
-
-
-/*
** LUA_CSUBSEP is the character that replaces dots in submodule names
** when searching for a C loader.
** LUA_LSUBSEP is the character that replaces dots in submodule names
@@ -708,8 +699,13 @@ static const luaL_Reg ll_funcs[] = {
static void createsearcherstable (lua_State *L) {
- static const lua_CFunction searchers[] =
- {searcher_preload, searcher_Lua, searcher_C, searcher_Croot, NULL};
+ static const lua_CFunction searchers[] = {
+ searcher_preload,
+ searcher_Lua,
+ searcher_C,
+ searcher_Croot,
+ NULL
+ };
int i;
/* create 'searchers' table */
lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0);
diff --git a/3rdparty/lua/src/lobject.c b/3rdparty/lua/src/lobject.c
index 301aa900be0..9cfa5227eb4 100644
--- a/3rdparty/lua/src/lobject.c
+++ b/3rdparty/lua/src/lobject.c
@@ -62,7 +62,7 @@ static lua_Integer intarith (lua_State *L, int op, lua_Integer v1,
case LUA_OPBOR: return intop(|, v1, v2);
case LUA_OPBXOR: return intop(^, v1, v2);
case LUA_OPSHL: return luaV_shiftl(v1, v2);
- case LUA_OPSHR: return luaV_shiftl(v1, -v2);
+ case LUA_OPSHR: return luaV_shiftr(v1, v2);
case LUA_OPUNM: return intop(-, 0, v1);
case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1);
default: lua_assert(0); return 0;
@@ -386,29 +386,39 @@ void luaO_tostring (lua_State *L, TValue *obj) {
** ===================================================================
*/
-/* size for buffer space used by 'luaO_pushvfstring' */
-#define BUFVFS 200
+/*
+** Size for buffer space used by 'luaO_pushvfstring'. It should be
+** (LUA_IDSIZE + MAXNUMBER2STR) + a minimal space for basic messages,
+** so that 'luaG_addinfo' can work directly on the buffer.
+*/
+#define BUFVFS (LUA_IDSIZE + MAXNUMBER2STR + 95)
/* buffer used by 'luaO_pushvfstring' */
typedef struct BuffFS {
lua_State *L;
- int pushed; /* number of string pieces already on the stack */
+ int pushed; /* true if there is a part of the result on the stack */
int blen; /* length of partial string in 'space' */
char space[BUFVFS]; /* holds last part of the result */
} BuffFS;
/*
-** Push given string to the stack, as part of the buffer, and
-** join the partial strings in the stack into one.
+** Push given string to the stack, as part of the result, and
+** join it to previous partial result if there is one.
+** It may call 'luaV_concat' while using one slot from EXTRA_STACK.
+** This call cannot invoke metamethods, as both operands must be
+** strings. It can, however, raise an error if the result is too
+** long. In that case, 'luaV_concat' frees the extra slot before
+** raising the error.
*/
-static void pushstr (BuffFS *buff, const char *str, size_t l) {
+static void pushstr (BuffFS *buff, const char *str, size_t lstr) {
lua_State *L = buff->L;
- setsvalue2s(L, L->top, luaS_newlstr(L, str, l));
- L->top++; /* may use one extra slot */
- buff->pushed++;
- luaV_concat(L, buff->pushed); /* join partial results into one */
- buff->pushed = 1;
+ setsvalue2s(L, L->top.p, luaS_newlstr(L, str, lstr));
+ L->top.p++; /* may use one slot from EXTRA_STACK */
+ if (!buff->pushed) /* no previous string on the stack? */
+ buff->pushed = 1; /* now there is one */
+ else /* join previous string with new one */
+ luaV_concat(L, 2);
}
@@ -454,7 +464,7 @@ static void addstr2buff (BuffFS *buff, const char *str, size_t slen) {
/*
-** Add a number to the buffer.
+** Add a numeral to the buffer.
*/
static void addnum2buff (BuffFS *buff, TValue *num) {
char *numbuff = getbuff(buff, MAXNUMBER2STR);
@@ -532,7 +542,7 @@ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) {
addstr2buff(&buff, fmt, strlen(fmt)); /* rest of 'fmt' */
clearbuff(&buff); /* empty buffer into the stack */
lua_assert(buff.pushed == 1);
- return svalue(s2v(L->top - 1));
+ return getstr(tsvalue(s2v(L->top.p - 1)));
}
diff --git a/3rdparty/lua/src/lobject.h b/3rdparty/lua/src/lobject.h
index 0e05b3e42ea..980e42f8c27 100644
--- a/3rdparty/lua/src/lobject.h
+++ b/3rdparty/lua/src/lobject.h
@@ -52,6 +52,8 @@ typedef union Value {
lua_CFunction f; /* light C functions */
lua_Integer i; /* integer numbers */
lua_Number n; /* float numbers */
+ /* not used, but may avoid warnings for uninitialized value */
+ lu_byte ub;
} Value;
@@ -155,6 +157,17 @@ typedef union StackValue {
/* index to stack elements */
typedef StackValue *StkId;
+
+/*
+** When reallocating the stack, change all pointers to the stack into
+** proper offsets.
+*/
+typedef union {
+ StkId p; /* actual pointer */
+ ptrdiff_t offset; /* used while the stack is being reallocated */
+} StkIdRel;
+
+
/* convert a 'StackValue' to a 'TValue' */
#define s2v(o) (&(o)->val)
@@ -373,7 +386,7 @@ typedef struct GCObject {
typedef struct TString {
CommonHeader;
lu_byte extra; /* reserved words for short strings; "has hash" for longs */
- lu_byte shrlen; /* length for short strings */
+ lu_byte shrlen; /* length for short strings, 0xFF for long strings */
unsigned int hash;
union {
size_t lnglen; /* length for long strings */
@@ -385,19 +398,17 @@ typedef struct TString {
/*
-** Get the actual string (array of bytes) from a 'TString'.
+** Get the actual string (array of bytes) from a 'TString'. (Generic
+** version and specialized versions for long and short strings.)
*/
-#define getstr(ts) ((ts)->contents)
-
+#define getstr(ts) ((ts)->contents)
+#define getlngstr(ts) check_exp((ts)->shrlen == 0xFF, (ts)->contents)
+#define getshrstr(ts) check_exp((ts)->shrlen != 0xFF, (ts)->contents)
-/* get the actual string (array of bytes) from a Lua value */
-#define svalue(o) getstr(tsvalue(o))
/* get string length from 'TString *s' */
-#define tsslen(s) ((s)->tt == LUA_VSHRSTR ? (s)->shrlen : (s)->u.lnglen)
-
-/* get string length from 'TValue *o' */
-#define vslen(o) tsslen(tsvalue(o))
+#define tsslen(s) \
+ ((s)->shrlen != 0xFF ? (s)->shrlen : (s)->u.lnglen)
/* }================================================================== */
@@ -615,8 +626,10 @@ typedef struct Proto {
*/
typedef struct UpVal {
CommonHeader;
- lu_byte tbc; /* true if it represents a to-be-closed variable */
- TValue *v; /* points to stack or to its own value */
+ union {
+ TValue *p; /* points to stack or to its own value */
+ ptrdiff_t offset; /* used while the stack is being reallocated */
+ } v;
union {
struct { /* (when open) */
struct UpVal *next; /* linked list */
diff --git a/3rdparty/lua/src/lopcodes.h b/3rdparty/lua/src/lopcodes.h
index 7c274515960..46911cac14e 100644
--- a/3rdparty/lua/src/lopcodes.h
+++ b/3rdparty/lua/src/lopcodes.h
@@ -21,7 +21,7 @@ iABC C(8) | B(8) |k| A(8) | Op(7) |
iABx Bx(17) | A(8) | Op(7) |
iAsBx sBx (signed)(17) | A(8) | Op(7) |
iAx Ax(25) | Op(7) |
-isJ sJ(25) | Op(7) |
+isJ sJ (signed)(25) | Op(7) |
A signed argument is represented in excess K: the represented value is
the written unsigned value minus K, where K is half the maximum for the
@@ -210,15 +210,15 @@ OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */
OP_GETUPVAL,/* A B R[A] := UpValue[B] */
OP_SETUPVAL,/* A B UpValue[B] := R[A] */
-OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:string] */
+OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:shortstring] */
OP_GETTABLE,/* A B C R[A] := R[B][R[C]] */
OP_GETI,/* A B C R[A] := R[B][C] */
-OP_GETFIELD,/* A B C R[A] := R[B][K[C]:string] */
+OP_GETFIELD,/* A B C R[A] := R[B][K[C]:shortstring] */
-OP_SETTABUP,/* A B C UpValue[A][K[B]:string] := RK(C) */
+OP_SETTABUP,/* A B C UpValue[A][K[B]:shortstring] := RK(C) */
OP_SETTABLE,/* A B C R[A][R[B]] := RK(C) */
OP_SETI,/* A B C R[A][B] := RK(C) */
-OP_SETFIELD,/* A B C R[A][K[B]:string] := RK(C) */
+OP_SETFIELD,/* A B C R[A][K[B]:shortstring] := RK(C) */
OP_NEWTABLE,/* A B C k R[A] := {} */
diff --git a/3rdparty/lua/src/loslib.c b/3rdparty/lua/src/loslib.c
index 3e20d622bac..ba80d72c457 100644
--- a/3rdparty/lua/src/loslib.c
+++ b/3rdparty/lua/src/loslib.c
@@ -30,23 +30,14 @@
*/
#if !defined(LUA_STRFTIMEOPTIONS) /* { */
-/* options for ANSI C 89 (only 1-char options) */
-#define L_STRFTIMEC89 "aAbBcdHIjmMpSUwWxXyYZ%"
-
-/* options for ISO C 99 and POSIX */
-#define L_STRFTIMEC99 "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%" \
- "||" "EcECExEXEyEY" "OdOeOHOIOmOMOSOuOUOVOwOWOy" /* two-char options */
-
-/* options for Windows */
-#define L_STRFTIMEWIN "aAbBcdHIjmMpSUwWxXyYzZ%" \
- "||" "#c#x#d#H#I#j#m#M#S#U#w#W#y#Y" /* two-char options */
-
#if defined(LUA_USE_WINDOWS)
-#define LUA_STRFTIMEOPTIONS L_STRFTIMEWIN
-#elif defined(LUA_USE_C89)
-#define LUA_STRFTIMEOPTIONS L_STRFTIMEC89
+#define LUA_STRFTIMEOPTIONS "aAbBcdHIjmMpSUwWxXyYzZ%" \
+ "||" "#c#x#d#H#I#j#m#M#S#U#w#W#y#Y" /* two-char options */
+#elif defined(LUA_USE_C89) /* ANSI C 89 (only 1-char options) */
+#define LUA_STRFTIMEOPTIONS "aAbBcdHIjmMpSUwWxXyYZ%"
#else /* C99 specification */
-#define LUA_STRFTIMEOPTIONS L_STRFTIMEC99
+#define LUA_STRFTIMEOPTIONS "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%" \
+ "||" "EcECExEXEyEY" "OdOeOHOIOmOMOSOuOUOVOwOWOy" /* two-char options */
#endif
#endif /* } */
@@ -138,12 +129,21 @@
/* }================================================================== */
+#if !defined(l_system)
+#if defined(LUA_USE_IOS)
+/* Despite claiming to be ISO C, iOS does not implement 'system'. */
+#define l_system(cmd) ((cmd) == NULL ? 0 : -1)
+#else
+#define l_system(cmd) system(cmd) /* default definition */
+#endif
+#endif
+
static int os_execute (lua_State *L) {
const char *cmd = luaL_optstring(L, 1, NULL);
int stat;
errno = 0;
- stat = system(cmd);
+ stat = l_system(cmd);
if (cmd != NULL)
return luaL_execresult(L, stat);
else {
@@ -155,6 +155,7 @@ static int os_execute (lua_State *L) {
static int os_remove (lua_State *L) {
const char *filename = luaL_checkstring(L, 1);
+ errno = 0;
return luaL_fileresult(L, remove(filename) == 0, filename);
}
@@ -162,6 +163,7 @@ static int os_remove (lua_State *L) {
static int os_rename (lua_State *L) {
const char *fromname = luaL_checkstring(L, 1);
const char *toname = luaL_checkstring(L, 2);
+ errno = 0;
return luaL_fileresult(L, rename(fromname, toname) == 0, NULL);
}
@@ -260,9 +262,7 @@ static int getfield (lua_State *L, const char *key, int d, int delta) {
res = d;
}
else {
- /* unsigned avoids overflow when lua_Integer has 32 bits */
- if (!(res >= 0 ? (lua_Unsigned)res <= (lua_Unsigned)INT_MAX + delta
- : (lua_Integer)INT_MIN + delta <= res))
+ if (!(res >= 0 ? res - delta <= INT_MAX : INT_MIN + delta <= res))
return luaL_error(L, "field '%s' is out-of-bound", key);
res -= delta;
}
diff --git a/3rdparty/lua/src/lparser.c b/3rdparty/lua/src/lparser.c
index 3abe3d75187..2b888c7cff1 100644
--- a/3rdparty/lua/src/lparser.c
+++ b/3rdparty/lua/src/lparser.c
@@ -468,6 +468,7 @@ static void singlevar (LexState *ls, expdesc *var) {
expdesc key;
singlevaraux(fs, ls->envn, var, 1); /* get environment variable */
lua_assert(var->k != VVOID); /* this one must exist */
+ luaK_exp2anyregup(fs, var); /* but could be a constant */
codestring(&key, varname); /* key is variable name */
luaK_indexed(fs, var, &key); /* env[varname] */
}
@@ -520,12 +521,12 @@ static l_noret jumpscopeerror (LexState *ls, Labeldesc *gt) {
/*
** Solves the goto at index 'g' to given 'label' and removes it
-** from the list of pending goto's.
+** from the list of pending gotos.
** If it jumps into the scope of some variable, raises an error.
*/
static void solvegoto (LexState *ls, int g, Labeldesc *label) {
int i;
- Labellist *gl = &ls->dyd->gt; /* list of goto's */
+ Labellist *gl = &ls->dyd->gt; /* list of gotos */
Labeldesc *gt = &gl->arr[g]; /* goto to be resolved */
lua_assert(eqstr(gt->name, label->name));
if (l_unlikely(gt->nactvar < label->nactvar)) /* enter some scope? */
@@ -579,7 +580,7 @@ static int newgotoentry (LexState *ls, TString *name, int line, int pc) {
/*
** Solves forward jumps. Check whether new label 'lb' matches any
** pending gotos in current block and solves them. Return true
-** if any of the goto's need to close upvalues.
+** if any of the gotos need to close upvalues.
*/
static int solvegotos (LexState *ls, Labeldesc *lb) {
Labellist *gl = &ls->dyd->gt;
@@ -600,7 +601,7 @@ static int solvegotos (LexState *ls, Labeldesc *lb) {
/*
** Create a new label with the given 'name' at the given 'line'.
** 'last' tells whether label is the last non-op statement in its
-** block. Solves all pending goto's to this new label and adds
+** block. Solves all pending gotos to this new label and adds
** a close instruction if necessary.
** Returns true iff it added a close instruction.
*/
@@ -673,19 +674,19 @@ static void leaveblock (FuncState *fs) {
LexState *ls = fs->ls;
int hasclose = 0;
int stklevel = reglevel(fs, bl->nactvar); /* level outside the block */
- if (bl->isloop) /* fix pending breaks? */
+ removevars(fs, bl->nactvar); /* remove block locals */
+ lua_assert(bl->nactvar == fs->nactvar); /* back to level on entry */
+ if (bl->isloop) /* has to fix pending breaks? */
hasclose = createlabel(ls, luaS_newliteral(ls->L, "break"), 0, 0);
- if (!hasclose && bl->previous && bl->upval)
+ if (!hasclose && bl->previous && bl->upval) /* still need a 'close'? */
luaK_codeABC(fs, OP_CLOSE, stklevel, 0, 0);
- fs->bl = bl->previous;
- removevars(fs, bl->nactvar);
- lua_assert(bl->nactvar == fs->nactvar);
fs->freereg = stklevel; /* free registers */
ls->dyd->label.n = bl->firstlabel; /* remove local labels */
- if (bl->previous) /* inner block? */
- movegotosout(fs, bl); /* update pending gotos to outer block */
+ fs->bl = bl->previous; /* current block now is previous one */
+ if (bl->previous) /* was it a nested block? */
+ movegotosout(fs, bl); /* update pending gotos to enclosing block */
else {
- if (bl->firstgoto < ls->dyd->gt.n) /* pending gotos in outer block? */
+ if (bl->firstgoto < ls->dyd->gt.n) /* still pending gotos? */
undefgoto(ls, &ls->dyd->gt.arr[bl->firstgoto]); /* error */
}
}
@@ -1021,10 +1022,11 @@ static int explist (LexState *ls, expdesc *v) {
}
-static void funcargs (LexState *ls, expdesc *f, int line) {
+static void funcargs (LexState *ls, expdesc *f) {
FuncState *fs = ls->fs;
expdesc args;
int base, nparams;
+ int line = ls->linenumber;
switch (ls->t.token) {
case '(': { /* funcargs -> '(' [ explist ] ')' */
luaX_next(ls);
@@ -1062,8 +1064,8 @@ static void funcargs (LexState *ls, expdesc *f, int line) {
}
init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2));
luaK_fixline(fs, line);
- fs->freereg = base+1; /* call remove function and arguments and leaves
- (unless changed) one result */
+ fs->freereg = base+1; /* call removes function and arguments and leaves
+ one result (unless changed later) */
}
@@ -1102,7 +1104,6 @@ static void suffixedexp (LexState *ls, expdesc *v) {
/* suffixedexp ->
primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */
FuncState *fs = ls->fs;
- int line = ls->linenumber;
primaryexp(ls, v);
for (;;) {
switch (ls->t.token) {
@@ -1122,12 +1123,12 @@ static void suffixedexp (LexState *ls, expdesc *v) {
luaX_next(ls);
codename(ls, &key);
luaK_self(fs, v, &key);
- funcargs(ls, v, line);
+ funcargs(ls, v);
break;
}
case '(': case TK_STRING: case '{': { /* funcargs */
luaK_exp2nextreg(fs, v);
- funcargs(ls, v, line);
+ funcargs(ls, v);
break;
}
default: return;
@@ -1943,10 +1944,10 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
LexState lexstate;
FuncState funcstate;
LClosure *cl = luaF_newLclosure(L, 1); /* create main closure */
- setclLvalue2s(L, L->top, cl); /* anchor it (to avoid being collected) */
+ setclLvalue2s(L, L->top.p, cl); /* anchor it (to avoid being collected) */
luaD_inctop(L);
lexstate.h = luaH_new(L); /* create table for scanner */
- sethvalue2s(L, L->top, lexstate.h); /* anchor it */
+ sethvalue2s(L, L->top.p, lexstate.h); /* anchor it */
luaD_inctop(L);
funcstate.f = cl->p = luaF_newproto(L);
luaC_objbarrier(L, cl, cl->p);
@@ -1960,7 +1961,7 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs);
/* all scopes should be correctly finished */
lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0);
- L->top--; /* remove scanner's table */
+ L->top.p--; /* remove scanner's table */
return cl; /* closure is on the stack, too */
}
diff --git a/3rdparty/lua/src/lstate.c b/3rdparty/lua/src/lstate.c
index 1ffe1a0f71c..7fefacba2c1 100644
--- a/3rdparty/lua/src/lstate.c
+++ b/3rdparty/lua/src/lstate.c
@@ -119,7 +119,7 @@ CallInfo *luaE_extendCI (lua_State *L) {
/*
** free all CallInfo structures not in use by a thread
*/
-void luaE_freeCI (lua_State *L) {
+static void freeCI (lua_State *L) {
CallInfo *ci = L->ci;
CallInfo *next = ci->next;
ci->next = NULL;
@@ -180,33 +180,33 @@ LUAI_FUNC void luaE_incCstack (lua_State *L) {
static void stack_init (lua_State *L1, lua_State *L) {
int i; CallInfo *ci;
/* initialize stack array */
- L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue);
- L1->tbclist = L1->stack;
+ L1->stack.p = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue);
+ L1->tbclist.p = L1->stack.p;
for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++)
- setnilvalue(s2v(L1->stack + i)); /* erase new stack */
- L1->top = L1->stack;
- L1->stack_last = L1->stack + BASIC_STACK_SIZE;
+ setnilvalue(s2v(L1->stack.p + i)); /* erase new stack */
+ L1->top.p = L1->stack.p;
+ L1->stack_last.p = L1->stack.p + BASIC_STACK_SIZE;
/* initialize first ci */
ci = &L1->base_ci;
ci->next = ci->previous = NULL;
ci->callstatus = CIST_C;
- ci->func = L1->top;
+ ci->func.p = L1->top.p;
ci->u.c.k = NULL;
ci->nresults = 0;
- setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */
- L1->top++;
- ci->top = L1->top + LUA_MINSTACK;
+ setnilvalue(s2v(L1->top.p)); /* 'function' entry for this 'ci' */
+ L1->top.p++;
+ ci->top.p = L1->top.p + LUA_MINSTACK;
L1->ci = ci;
}
static void freestack (lua_State *L) {
- if (L->stack == NULL)
+ if (L->stack.p == NULL)
return; /* stack not completely built yet */
L->ci = &L->base_ci; /* free the entire 'ci' list */
- luaE_freeCI(L);
+ freeCI(L);
lua_assert(L->nci == 0);
- luaM_freearray(L, L->stack, stacksize(L) + EXTRA_STACK); /* free stack */
+ luaM_freearray(L, L->stack.p, stacksize(L) + EXTRA_STACK); /* free stack */
}
@@ -248,7 +248,7 @@ static void f_luaopen (lua_State *L, void *ud) {
*/
static void preinit_thread (lua_State *L, global_State *g) {
G(L) = g;
- L->stack = NULL;
+ L->stack.p = NULL;
L->ci = NULL;
L->nci = 0;
L->twups = L; /* thread has no upvalues */
@@ -284,20 +284,16 @@ static void close_state (lua_State *L) {
LUA_API lua_State *lua_newthread (lua_State *L) {
- global_State *g;
+ global_State *g = G(L);
+ GCObject *o;
lua_State *L1;
lua_lock(L);
- g = G(L);
luaC_checkGC(L);
/* create new thread */
- L1 = &cast(LX *, luaM_newobject(L, LUA_TTHREAD, sizeof(LX)))->l;
- L1->marked = luaC_white(g);
- L1->tt = LUA_VTHREAD;
- /* link it on list 'allgc' */
- L1->next = g->allgc;
- g->allgc = obj2gco(L1);
+ o = luaC_newobjdt(L, LUA_TTHREAD, sizeof(LX), offsetof(LX, l));
+ L1 = gco2th(o);
/* anchor it on L stack */
- setthvalue2s(L, L->top, L1);
+ setthvalue2s(L, L->top.p, L1);
api_incr_top(L);
preinit_thread(L1, g);
L1->hookmask = L->hookmask;
@@ -316,7 +312,7 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
void luaE_freethread (lua_State *L, lua_State *L1) {
LX *l = fromstate(L1);
- luaF_closeupval(L1, L1->stack); /* close all upvalues */
+ luaF_closeupval(L1, L1->stack.p); /* close all upvalues */
lua_assert(L1->openupval == NULL);
luai_userstatefree(L, L1);
freestack(L1);
@@ -326,32 +322,41 @@ void luaE_freethread (lua_State *L, lua_State *L1) {
int luaE_resetthread (lua_State *L, int status) {
CallInfo *ci = L->ci = &L->base_ci; /* unwind CallInfo list */
- setnilvalue(s2v(L->stack)); /* 'function' entry for basic 'ci' */
- ci->func = L->stack;
+ setnilvalue(s2v(L->stack.p)); /* 'function' entry for basic 'ci' */
+ ci->func.p = L->stack.p;
ci->callstatus = CIST_C;
if (status == LUA_YIELD)
status = LUA_OK;
L->status = LUA_OK; /* so it can run __close metamethods */
status = luaD_closeprotected(L, 1, status);
if (status != LUA_OK) /* errors? */
- luaD_seterrorobj(L, status, L->stack + 1);
+ luaD_seterrorobj(L, status, L->stack.p + 1);
else
- L->top = L->stack + 1;
- ci->top = L->top + LUA_MINSTACK;
- luaD_reallocstack(L, cast_int(ci->top - L->stack), 0);
+ L->top.p = L->stack.p + 1;
+ ci->top.p = L->top.p + LUA_MINSTACK;
+ luaD_reallocstack(L, cast_int(ci->top.p - L->stack.p), 0);
return status;
}
-LUA_API int lua_resetthread (lua_State *L) {
+LUA_API int lua_closethread (lua_State *L, lua_State *from) {
int status;
lua_lock(L);
+ L->nCcalls = (from) ? getCcalls(from) : 0;
status = luaE_resetthread(L, L->status);
lua_unlock(L);
return status;
}
+/*
+** Deprecated! Use 'lua_closethread' instead.
+*/
+LUA_API int lua_resetthread (lua_State *L) {
+ return lua_closethread(L, NULL);
+}
+
+
LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
int i;
lua_State *L;
@@ -426,9 +431,9 @@ void luaE_warning (lua_State *L, const char *msg, int tocont) {
** Generate a warning from an error message
*/
void luaE_warnerror (lua_State *L, const char *where) {
- TValue *errobj = s2v(L->top - 1); /* error object */
+ TValue *errobj = s2v(L->top.p - 1); /* error object */
const char *msg = (ttisstring(errobj))
- ? svalue(errobj)
+ ? getstr(tsvalue(errobj))
: "error object is not a string";
/* produce warning "error in %s (%s)" (where, msg) */
luaE_warning(L, "error in ", 1);
diff --git a/3rdparty/lua/src/lstate.h b/3rdparty/lua/src/lstate.h
index 61e82cde725..007704c826b 100644
--- a/3rdparty/lua/src/lstate.h
+++ b/3rdparty/lua/src/lstate.h
@@ -9,6 +9,11 @@
#include "lua.h"
+
+/* Some header files included here need this definition */
+typedef struct CallInfo CallInfo;
+
+
#include "lobject.h"
#include "ltm.h"
#include "lzio.h"
@@ -139,7 +144,7 @@ struct lua_longjmp; /* defined in ldo.c */
#define BASIC_STACK_SIZE (2*LUA_MINSTACK)
-#define stacksize(th) cast_int((th)->stack_last - (th)->stack)
+#define stacksize(th) cast_int((th)->stack_last.p - (th)->stack.p)
/* kinds of Garbage Collection */
@@ -169,14 +174,14 @@ typedef struct stringtable {
** - field 'transferinfo' is used only during call/returnhooks,
** before the function starts or after it ends.
*/
-typedef struct CallInfo {
- StkId func; /* function index in the stack */
- StkId top; /* top for this function */
+struct CallInfo {
+ StkIdRel func; /* function index in the stack */
+ StkIdRel top; /* top for this function */
struct CallInfo *previous, *next; /* dynamic call link */
union {
struct { /* only for Lua functions */
const Instruction *savedpc;
- volatile l_signalT trap;
+ volatile l_signalT trap; /* function is tracing lines/counts */
int nextraargs; /* # of extra arguments in vararg functions */
} l;
struct { /* only for C functions */
@@ -196,7 +201,7 @@ typedef struct CallInfo {
} u2;
short nresults; /* expected number of results from this function */
unsigned short callstatus;
-} CallInfo;
+};
/*
@@ -291,7 +296,7 @@ typedef struct global_State {
struct lua_State *mainthread;
TString *memerrmsg; /* message for memory-allocation errors */
TString *tmname[TM_N]; /* array with tag-method names */
- struct Table *mt[LUA_NUMTAGS]; /* metatables for basic types */
+ struct Table *mt[LUA_NUMTYPES]; /* metatables for basic types */
TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */
lua_WarnFunction warnf; /* warning function */
void *ud_warn; /* auxiliary data to 'warnf' */
@@ -306,13 +311,13 @@ struct lua_State {
lu_byte status;
lu_byte allowhook;
unsigned short nci; /* number of items in 'ci' list */
- StkId top; /* first free slot in the stack */
+ StkIdRel top; /* first free slot in the stack */
global_State *l_G;
CallInfo *ci; /* call info for current function */
- StkId stack_last; /* end of stack (last element + 1) */
- StkId stack; /* stack base */
+ StkIdRel stack_last; /* end of stack (last element + 1) */
+ StkIdRel stack; /* stack base */
UpVal *openupval; /* list of open upvalues in this stack */
- StkId tbclist; /* list of to-be-closed variables */
+ StkIdRel tbclist; /* list of to-be-closed variables */
GCObject *gclist;
struct lua_State *twups; /* list of threads with open upvalues */
struct lua_longjmp *errorJmp; /* current error recover point */
@@ -391,7 +396,6 @@ union GCUnion {
LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt);
LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L);
-LUAI_FUNC void luaE_freeCI (lua_State *L);
LUAI_FUNC void luaE_shrinkCI (lua_State *L);
LUAI_FUNC void luaE_checkcstack (lua_State *L);
LUAI_FUNC void luaE_incCstack (lua_State *L);
diff --git a/3rdparty/lua/src/lstring.c b/3rdparty/lua/src/lstring.c
index 13dcaf4259b..97757355c0b 100644
--- a/3rdparty/lua/src/lstring.c
+++ b/3rdparty/lua/src/lstring.c
@@ -36,7 +36,7 @@ int luaS_eqlngstr (TString *a, TString *b) {
lua_assert(a->tt == LUA_VLNGSTR && b->tt == LUA_VLNGSTR);
return (a == b) || /* same instance or... */
((len == b->u.lnglen) && /* equal length and ... */
- (memcmp(getstr(a), getstr(b), len) == 0)); /* equal contents */
+ (memcmp(getlngstr(a), getlngstr(b), len) == 0)); /* equal contents */
}
@@ -52,7 +52,7 @@ unsigned int luaS_hashlongstr (TString *ts) {
lua_assert(ts->tt == LUA_VLNGSTR);
if (ts->extra == 0) { /* no hash? */
size_t len = ts->u.lnglen;
- ts->hash = luaS_hash(getstr(ts), len, ts->hash);
+ ts->hash = luaS_hash(getlngstr(ts), len, ts->hash);
ts->extra = 1; /* now it has its hash */
}
return ts->hash;
@@ -157,6 +157,7 @@ static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) {
TString *luaS_createlngstrobj (lua_State *L, size_t l) {
TString *ts = createstrobj(L, l, LUA_VLNGSTR, G(L)->seed);
ts->u.lnglen = l;
+ ts->shrlen = 0xFF; /* signals that it is a long string */
return ts;
}
@@ -193,7 +194,7 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) {
TString **list = &tb->hash[lmod(h, tb->size)];
lua_assert(str != NULL); /* otherwise 'memcmp'/'memcpy' are undefined */
for (ts = *list; ts != NULL; ts = ts->u.hnext) {
- if (l == ts->shrlen && (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) {
+ if (l == ts->shrlen && (memcmp(str, getshrstr(ts), l * sizeof(char)) == 0)) {
/* found! */
if (isdead(g, ts)) /* dead (but not collected yet)? */
changewhite(ts); /* resurrect it */
@@ -206,8 +207,8 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) {
list = &tb->hash[lmod(h, tb->size)]; /* rehash with new size */
}
ts = createstrobj(L, l, LUA_VSHRSTR, h);
- memcpy(getstr(ts), str, l * sizeof(char));
ts->shrlen = cast_byte(l);
+ memcpy(getshrstr(ts), str, l * sizeof(char));
ts->u.hnext = *list;
*list = ts;
tb->nuse++;
@@ -223,10 +224,10 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
return internshrstr(L, str, l);
else {
TString *ts;
- if (l_unlikely(l >= (MAX_SIZE - sizeof(TString))/sizeof(char)))
+ if (l_unlikely(l * sizeof(char) >= (MAX_SIZE - sizeof(TString))))
luaM_toobig(L);
ts = luaS_createlngstrobj(L, l);
- memcpy(getstr(ts), str, l * sizeof(char));
+ memcpy(getlngstr(ts), str, l * sizeof(char));
return ts;
}
}
diff --git a/3rdparty/lua/src/lstrlib.c b/3rdparty/lua/src/lstrlib.c
index 0b4fdbb7b5b..03167161df1 100644
--- a/3rdparty/lua/src/lstrlib.c
+++ b/3rdparty/lua/src/lstrlib.c
@@ -570,7 +570,7 @@ static const char *match_capture (MatchState *ms, const char *s, int l) {
static const char *match (MatchState *ms, const char *s, const char *p) {
if (l_unlikely(ms->matchdepth-- == 0))
luaL_error(ms->L, "pattern too complex");
- init: /* using goto's to optimize tail recursion */
+ init: /* using goto to optimize tail recursion */
if (p != ms->p_end) { /* end of pattern? */
switch (*p) {
case '(': { /* start capture */
diff --git a/3rdparty/lua/src/ltable.c b/3rdparty/lua/src/ltable.c
index 1b1cd2415b6..3353c047939 100644
--- a/3rdparty/lua/src/ltable.c
+++ b/3rdparty/lua/src/ltable.c
@@ -107,7 +107,7 @@ static const TValue absentkey = {ABSTKEYCONSTANT};
*/
static Node *hashint (const Table *t, lua_Integer i) {
lua_Unsigned ui = l_castS2U(i);
- if (ui <= (unsigned int)INT_MAX)
+ if (ui <= cast_uint(INT_MAX))
return hashmod(t, cast_int(ui));
else
return hashmod(t, ui);
@@ -252,15 +252,17 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t) {
return t->alimit; /* this is the size */
else {
unsigned int size = t->alimit;
- /* compute the smallest power of 2 not smaller than 'n' */
+ /* compute the smallest power of 2 not smaller than 'size' */
size |= (size >> 1);
size |= (size >> 2);
size |= (size >> 4);
size |= (size >> 8);
+#if (UINT_MAX >> 14) > 3 /* unsigned int has more than 16 bits */
size |= (size >> 16);
#if (UINT_MAX >> 30) > 3
size |= (size >> 32); /* unsigned int has more than 32 bits */
#endif
+#endif
size++;
lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size);
return size;
@@ -488,7 +490,7 @@ static void setnodevector (lua_State *L, Table *t, unsigned int size) {
luaG_runerror(L, "table overflow");
size = twoto(lsize);
t->node = luaM_newvector(L, size, Node);
- for (i = 0; i < (int)size; i++) {
+ for (i = 0; i < cast_int(size); i++) {
Node *n = gnode(t, i);
gnext(n) = 0;
setnilkey(n);
@@ -660,7 +662,8 @@ static Node *getfreepos (Table *t) {
** put new key in its main position; otherwise (colliding node is in its main
** position), new key goes to an empty position.
*/
-void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) {
+static void luaH_newkey (lua_State *L, Table *t, const TValue *key,
+ TValue *value) {
Node *mp;
TValue aux;
if (l_unlikely(ttisnil(key)))
@@ -719,22 +722,36 @@ void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) {
/*
** Search function for integers. If integer is inside 'alimit', get it
-** directly from the array part. Otherwise, if 'alimit' is not equal to
-** the real size of the array, key still can be in the array part. In
-** this case, try to avoid a call to 'luaH_realasize' when key is just
-** one more than the limit (so that it can be incremented without
-** changing the real size of the array).
+** directly from the array part. Otherwise, if 'alimit' is not
+** the real size of the array, the key still can be in the array part.
+** In this case, do the "Xmilia trick" to check whether 'key-1' is
+** smaller than the real size.
+** The trick works as follow: let 'p' be an integer such that
+** '2^(p+1) >= alimit > 2^p', or '2^(p+1) > alimit-1 >= 2^p'.
+** That is, 2^(p+1) is the real size of the array, and 'p' is the highest
+** bit on in 'alimit-1'. What we have to check becomes 'key-1 < 2^(p+1)'.
+** We compute '(key-1) & ~(alimit-1)', which we call 'res'; it will
+** have the 'p' bit cleared. If the key is outside the array, that is,
+** 'key-1 >= 2^(p+1)', then 'res' will have some bit on higher than 'p',
+** therefore it will be larger or equal to 'alimit', and the check
+** will fail. If 'key-1 < 2^(p+1)', then 'res' has no bit on higher than
+** 'p', and as the bit 'p' itself was cleared, 'res' will be smaller
+** than 2^p, therefore smaller than 'alimit', and the check succeeds.
+** As special cases, when 'alimit' is 0 the condition is trivially false,
+** and when 'alimit' is 1 the condition simplifies to 'key-1 < alimit'.
+** If key is 0 or negative, 'res' will have its higher bit on, so that
+** if cannot be smaller than alimit.
*/
const TValue *luaH_getint (Table *t, lua_Integer key) {
- if (l_castS2U(key) - 1u < t->alimit) /* 'key' in [1, t->alimit]? */
+ lua_Unsigned alimit = t->alimit;
+ if (l_castS2U(key) - 1u < alimit) /* 'key' in [1, t->alimit]? */
return &t->array[key - 1];
- else if (!limitequalsasize(t) && /* key still may be in the array part? */
- (l_castS2U(key) == t->alimit + 1 ||
- l_castS2U(key) - 1u < luaH_realasize(t))) {
+ else if (!isrealasize(t) && /* key still may be in the array part? */
+ (((l_castS2U(key) - 1u) & ~(alimit - 1u)) < alimit)) {
t->alimit = cast_uint(key); /* probably '#t' is here now */
return &t->array[key - 1];
}
- else {
+ else { /* key is not in the array part; check the hash */
Node *n = hashint(t, key);
for (;;) { /* check whether 'key' is somewhere in the chain */
if (keyisinteger(n) && keyival(n) == key)
@@ -975,6 +992,4 @@ Node *luaH_mainposition (const Table *t, const TValue *key) {
return mainpositionTV(t, key);
}
-int luaH_isdummy (const Table *t) { return isdummy(t); }
-
#endif
diff --git a/3rdparty/lua/src/ltable.h b/3rdparty/lua/src/ltable.h
index 7bbbcb213f8..8e689034234 100644
--- a/3rdparty/lua/src/ltable.h
+++ b/3rdparty/lua/src/ltable.h
@@ -41,8 +41,6 @@ LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key,
LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key);
LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
-LUAI_FUNC void luaH_newkey (lua_State *L, Table *t, const TValue *key,
- TValue *value);
LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key,
TValue *value);
LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key,
@@ -59,7 +57,6 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t);
#if defined(LUA_DEBUG)
LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
-LUAI_FUNC int luaH_isdummy (const Table *t);
#endif
diff --git a/3rdparty/lua/src/ltablib.c b/3rdparty/lua/src/ltablib.c
index 868d78fd83e..e6bc4d04af4 100644
--- a/3rdparty/lua/src/ltablib.c
+++ b/3rdparty/lua/src/ltablib.c
@@ -93,7 +93,7 @@ static int tremove (lua_State *L) {
lua_Integer pos = luaL_optinteger(L, 2, size);
if (pos != size) /* validate 'pos' if given */
/* check whether 'pos' is in [1, size + 1] */
- luaL_argcheck(L, (lua_Unsigned)pos - 1u <= (lua_Unsigned)size, 1,
+ luaL_argcheck(L, (lua_Unsigned)pos - 1u <= (lua_Unsigned)size, 2,
"position out of bounds");
lua_geti(L, 1, pos); /* result = t[pos] */
for ( ; pos < size; pos++) {
diff --git a/3rdparty/lua/src/ltm.c b/3rdparty/lua/src/ltm.c
index b657b783a80..07a060811d5 100644
--- a/3rdparty/lua/src/ltm.c
+++ b/3rdparty/lua/src/ltm.c
@@ -102,12 +102,12 @@ const char *luaT_objtypename (lua_State *L, const TValue *o) {
void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1,
const TValue *p2, const TValue *p3) {
- StkId func = L->top;
+ StkId func = L->top.p;
setobj2s(L, func, f); /* push function (assume EXTRA_STACK) */
setobj2s(L, func + 1, p1); /* 1st argument */
setobj2s(L, func + 2, p2); /* 2nd argument */
setobj2s(L, func + 3, p3); /* 3rd argument */
- L->top = func + 4;
+ L->top.p = func + 4;
/* metamethod may yield only when called from Lua code */
if (isLuacode(L->ci))
luaD_call(L, func, 0);
@@ -119,18 +119,18 @@ void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1,
void luaT_callTMres (lua_State *L, const TValue *f, const TValue *p1,
const TValue *p2, StkId res) {
ptrdiff_t result = savestack(L, res);
- StkId func = L->top;
+ StkId func = L->top.p;
setobj2s(L, func, f); /* push function (assume EXTRA_STACK) */
setobj2s(L, func + 1, p1); /* 1st argument */
setobj2s(L, func + 2, p2); /* 2nd argument */
- L->top += 3;
+ L->top.p += 3;
/* metamethod may yield only when called from Lua code */
if (isLuacode(L->ci))
luaD_call(L, func, 1);
else
luaD_callnoyield(L, func, 1);
res = restorestack(L, result);
- setobjs2s(L, res, --L->top); /* move result to its place */
+ setobjs2s(L, res, --L->top.p); /* move result to its place */
}
@@ -165,7 +165,7 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
void luaT_tryconcatTM (lua_State *L) {
- StkId top = L->top;
+ StkId top = L->top.p;
if (l_unlikely(!callbinTM(L, s2v(top - 2), s2v(top - 1), top - 2,
TM_CONCAT)))
luaG_concaterror(L, s2v(top - 2), s2v(top - 1));
@@ -200,15 +200,15 @@ void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2,
*/
int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2,
TMS event) {
- if (callbinTM(L, p1, p2, L->top, event)) /* try original event */
- return !l_isfalse(s2v(L->top));
+ if (callbinTM(L, p1, p2, L->top.p, event)) /* try original event */
+ return !l_isfalse(s2v(L->top.p));
#if defined(LUA_COMPAT_LT_LE)
else if (event == TM_LE) {
/* try '!(p2 < p1)' for '(p1 <= p2)' */
L->ci->callstatus |= CIST_LEQ; /* mark it is doing 'lt' for 'le' */
- if (callbinTM(L, p2, p1, L->top, TM_LT)) {
+ if (callbinTM(L, p2, p1, L->top.p, TM_LT)) {
L->ci->callstatus ^= CIST_LEQ; /* clear mark */
- return l_isfalse(s2v(L->top));
+ return l_isfalse(s2v(L->top.p));
}
/* else error will remove this 'ci'; no need to clear mark */
}
@@ -238,20 +238,20 @@ int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2,
void luaT_adjustvarargs (lua_State *L, int nfixparams, CallInfo *ci,
const Proto *p) {
int i;
- int actual = cast_int(L->top - ci->func) - 1; /* number of arguments */
+ int actual = cast_int(L->top.p - ci->func.p) - 1; /* number of arguments */
int nextra = actual - nfixparams; /* number of extra arguments */
ci->u.l.nextraargs = nextra;
luaD_checkstack(L, p->maxstacksize + 1);
/* copy function to the top of the stack */
- setobjs2s(L, L->top++, ci->func);
+ setobjs2s(L, L->top.p++, ci->func.p);
/* move fixed parameters to the top of the stack */
for (i = 1; i <= nfixparams; i++) {
- setobjs2s(L, L->top++, ci->func + i);
- setnilvalue(s2v(ci->func + i)); /* erase original parameter (for GC) */
+ setobjs2s(L, L->top.p++, ci->func.p + i);
+ setnilvalue(s2v(ci->func.p + i)); /* erase original parameter (for GC) */
}
- ci->func += actual + 1;
- ci->top += actual + 1;
- lua_assert(L->top <= ci->top && ci->top <= L->stack_last);
+ ci->func.p += actual + 1;
+ ci->top.p += actual + 1;
+ lua_assert(L->top.p <= ci->top.p && ci->top.p <= L->stack_last.p);
}
@@ -261,10 +261,10 @@ void luaT_getvarargs (lua_State *L, CallInfo *ci, StkId where, int wanted) {
if (wanted < 0) {
wanted = nextra; /* get all extra arguments available */
checkstackGCp(L, nextra, where); /* ensure stack space */
- L->top = where + nextra; /* next instruction will need top */
+ L->top.p = where + nextra; /* next instruction will need top */
}
for (i = 0; i < wanted && i < nextra; i++)
- setobjs2s(L, where + i, ci->func - nextra + i);
+ setobjs2s(L, where + i, ci->func.p - nextra + i);
for (; i < wanted; i++) /* complete required results with nil */
setnilvalue(s2v(where + i));
}
diff --git a/3rdparty/lua/src/lua.c b/3rdparty/lua/src/lua.c
index 0f190044449..6da331f1186 100644
--- a/3rdparty/lua/src/lua.c
+++ b/3rdparty/lua/src/lua.c
@@ -115,12 +115,13 @@ static void l_message (const char *pname, const char *msg) {
/*
** Check whether 'status' is not OK and, if so, prints the error
-** message on the top of the stack. It assumes that the error object
-** is a string, as it was either generated by Lua or by 'msghandler'.
+** message on the top of the stack.
*/
static int report (lua_State *L, int status) {
if (status != LUA_OK) {
const char *msg = lua_tostring(L, -1);
+ if (msg == NULL)
+ msg = "(error message not a string)";
l_message(progname, msg);
lua_pop(L, 1); /* remove message */
}
@@ -177,10 +178,11 @@ static void print_version (void) {
** to the script (everything after 'script') go to positive indices;
** other arguments (before the script name) go to negative indices.
** If there is no script name, assume interpreter's name as base.
+** (If there is no interpreter's name either, 'script' is -1, so
+** table sizes are zero.)
*/
static void createargtable (lua_State *L, char **argv, int argc, int script) {
int i, narg;
- if (script == argc) script = 0; /* no script name? */
narg = argc - (script + 1); /* number of positive indices */
lua_createtable(L, narg, script + 1);
for (i = 0; i < argc; i++) {
@@ -209,12 +211,17 @@ static int dostring (lua_State *L, const char *s, const char *name) {
/*
** Receives 'globname[=modname]' and runs 'globname = require(modname)'.
+** If there is no explicit modname and globname contains a '-', cut
+** the suffix after '-' (the "version") to make the global name.
*/
static int dolibrary (lua_State *L, char *globname) {
int status;
+ char *suffix = NULL;
char *modname = strchr(globname, '=');
- if (modname == NULL) /* no explicit name? */
+ if (modname == NULL) { /* no explicit name? */
modname = globname; /* module name is equal to global name */
+ suffix = strchr(modname, *LUA_IGMARK); /* look for a suffix mark */
+ }
else {
*modname = '\0'; /* global name ends here */
modname++; /* module name starts after the '=' */
@@ -222,8 +229,11 @@ static int dolibrary (lua_State *L, char *globname) {
lua_getglobal(L, "require");
lua_pushstring(L, modname);
status = docall(L, 1, 1); /* call 'require(modname)' */
- if (status == LUA_OK)
+ if (status == LUA_OK) {
+ if (suffix != NULL) /* is there a suffix mark? */
+ *suffix = '\0'; /* remove suffix from global name */
lua_setglobal(L, globname); /* globname = require(modname) */
+ }
return report(L, status);
}
@@ -268,14 +278,23 @@ static int handle_script (lua_State *L, char **argv) {
/*
** Traverses all arguments from 'argv', returning a mask with those
-** needed before running any Lua code (or an error code if it finds
-** any invalid argument). 'first' returns the first not-handled argument
-** (either the script name or a bad argument in case of error).
+** needed before running any Lua code or an error code if it finds any
+** invalid argument. In case of error, 'first' is the index of the bad
+** argument. Otherwise, 'first' is -1 if there is no program name,
+** 0 if there is no script name, or the index of the script name.
*/
static int collectargs (char **argv, int *first) {
int args = 0;
int i;
- for (i = 1; argv[i] != NULL; i++) {
+ if (argv[0] != NULL) { /* is there a program name? */
+ if (argv[0][0]) /* not empty? */
+ progname = argv[0]; /* save it */
+ }
+ else { /* no program name */
+ *first = -1;
+ return 0;
+ }
+ for (i = 1; argv[i] != NULL; i++) { /* handle arguments */
*first = i;
if (argv[i][0] != '-') /* not an option? */
return args; /* stop handling options */
@@ -316,7 +335,7 @@ static int collectargs (char **argv, int *first) {
return has_error;
}
}
- *first = i; /* no script name */
+ *first = 0; /* no script name */
return args;
}
@@ -609,8 +628,8 @@ static int pmain (lua_State *L) {
char **argv = (char **)lua_touserdata(L, 2);
int script;
int args = collectargs(argv, &script);
+ int optlim = (script > 0) ? script : argc; /* first argv not an option */
luaL_checkversion(L); /* check that interpreter has correct version */
- if (argv[0] && argv[0][0]) progname = argv[0];
if (args == has_error) { /* bad arg? */
print_usage(argv[script]); /* 'script' has index of bad arg. */
return 0;
@@ -623,19 +642,21 @@ static int pmain (lua_State *L) {
}
luaL_openlibs(L); /* open standard libraries */
createargtable(L, argv, argc, script); /* create table 'arg' */
- lua_gc(L, LUA_GCGEN, 0, 0); /* GC in generational mode */
+ lua_gc(L, LUA_GCRESTART); /* start GC... */
+ lua_gc(L, LUA_GCGEN, 0, 0); /* ...in generational mode */
if (!(args & has_E)) { /* no option '-E'? */
if (handle_luainit(L) != LUA_OK) /* run LUA_INIT */
return 0; /* error running LUA_INIT */
}
- if (!runargs(L, argv, script)) /* execute arguments -e and -l */
+ if (!runargs(L, argv, optlim)) /* execute arguments -e and -l */
return 0; /* something failed */
- if (script < argc && /* execute main script (if there is one) */
- handle_script(L, argv + script) != LUA_OK)
- return 0;
+ if (script > 0) { /* execute main script (if there is one) */
+ if (handle_script(L, argv + script) != LUA_OK)
+ return 0; /* interrupt in case of error */
+ }
if (args & has_i) /* -i option? */
doREPL(L); /* do read-eval-print loop */
- else if (script == argc && !(args & (has_e | has_v))) { /* no arguments? */
+ else if (script < 1 && !(args & (has_e | has_v))) { /* no active option? */
if (lua_stdin_is_tty()) { /* running in interactive mode? */
print_version();
doREPL(L); /* do read-eval-print loop */
@@ -654,6 +675,7 @@ int main (int argc, char **argv) {
l_message(argv[0], "cannot create state: not enough memory");
return EXIT_FAILURE;
}
+ lua_gc(L, LUA_GCSTOP); /* stop GC while building state */
lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */
lua_pushinteger(L, argc); /* 1st argument */
lua_pushlightuserdata(L, argv); /* 2nd argument */
diff --git a/3rdparty/lua/src/lua.h b/3rdparty/lua/src/lua.h
index e6618392cc7..f050dac0913 100644
--- a/3rdparty/lua/src/lua.h
+++ b/3rdparty/lua/src/lua.h
@@ -18,14 +18,14 @@
#define LUA_VERSION_MAJOR "5"
#define LUA_VERSION_MINOR "4"
-#define LUA_VERSION_RELEASE "4"
+#define LUA_VERSION_RELEASE "7"
#define LUA_VERSION_NUM 504
-#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 4)
+#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 7)
#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE
-#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2022 Lua.org, PUC-Rio"
+#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2024 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
@@ -131,6 +131,16 @@ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont);
+/*
+** Type used by the debug API to collect debug information
+*/
+typedef struct lua_Debug lua_Debug;
+
+
+/*
+** Functions to be called by the debugger in specific events
+*/
+typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
/*
@@ -153,7 +163,8 @@ extern const char lua_ident[];
LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
LUA_API void (lua_close) (lua_State *L);
LUA_API lua_State *(lua_newthread) (lua_State *L);
-LUA_API int (lua_resetthread) (lua_State *L);
+LUA_API int (lua_closethread) (lua_State *L, lua_State *from);
+LUA_API int (lua_resetthread) (lua_State *L); /* Deprecated! */
LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
@@ -442,12 +453,6 @@ LUA_API void (lua_closeslot) (lua_State *L, int idx);
#define LUA_MASKLINE (1 << LUA_HOOKLINE)
#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT)
-typedef struct lua_Debug lua_Debug; /* activation record */
-
-
-/* Functions to be called by the debugger in specific events */
-typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
-
LUA_API int (lua_getstack) (lua_State *L, int level, lua_Debug *ar);
LUA_API int (lua_getinfo) (lua_State *L, const char *what, lua_Debug *ar);
@@ -492,7 +497,7 @@ struct lua_Debug {
/******************************************************************************
-* Copyright (C) 1994-2022 Lua.org, PUC-Rio.
+* Copyright (C) 1994-2024 Lua.org, PUC-Rio.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
diff --git a/3rdparty/lua/src/luac.c b/3rdparty/lua/src/luac.c
index f6db9cf656b..5f4a141bddd 100644
--- a/3rdparty/lua/src/luac.c
+++ b/3rdparty/lua/src/luac.c
@@ -121,7 +121,7 @@ static int doargs(int argc, char* argv[])
return i;
}
-#define FUNCTION "(function()end)();"
+#define FUNCTION "(function()end)();\n"
static const char* reader(lua_State* L, void* ud, size_t* size)
{
@@ -138,7 +138,7 @@ static const char* reader(lua_State* L, void* ud, size_t* size)
}
}
-#define toproto(L,i) getproto(s2v(L->top+(i)))
+#define toproto(L,i) getproto(s2v(L->top.p+(i)))
static const Proto* combine(lua_State* L, int n)
{
@@ -155,8 +155,6 @@ static const Proto* combine(lua_State* L, int n)
f->p[i]=toproto(L,i-n-1);
if (f->p[i]->sizeupvalues>0) f->p[i]->upvalues[0].instack=0;
}
- luaM_freearray(L,f->lineinfo,f->sizelineinfo);
- f->sizelineinfo=0;
return f;
}
}
diff --git a/3rdparty/lua/src/luaconf.h b/3rdparty/lua/src/luaconf.h
index d42d14b7d5f..33bb580d17c 100644
--- a/3rdparty/lua/src/luaconf.h
+++ b/3rdparty/lua/src/luaconf.h
@@ -70,6 +70,12 @@
#endif
+#if defined(LUA_USE_IOS)
+#define LUA_USE_POSIX
+#define LUA_USE_DLOPEN
+#endif
+
+
/*
@@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits.
*/
@@ -251,6 +257,15 @@
#endif
+
+/*
+** LUA_IGMARK is a mark to ignore all after it when building the
+** module name (e.g., used to build the luaopen_ function name).
+** Typically, the suffix after the mark is the module version,
+** as in "mod-v1.2.so".
+*/
+#define LUA_IGMARK "-"
+
/* }================================================================== */
@@ -728,7 +743,7 @@
** CHANGE it if you need a different limit. This limit is arbitrary;
** its only purpose is to stop Lua from consuming unlimited stack
** space (and to reserve some numbers for pseudo-indices).
-** (It must fit into max(size_t)/32.)
+** (It must fit into max(size_t)/32 and max(int)/2.)
*/
#if LUAI_IS32INT
#define LUAI_MAXSTACK 1000000
@@ -747,14 +762,15 @@
/*
@@ LUA_IDSIZE gives the maximum size for the description of the source
-@@ of a function in debug information.
+** of a function in debug information.
** CHANGE it if you want a different size.
*/
#define LUA_IDSIZE 60
/*
-@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
+@@ LUAL_BUFFERSIZE is the initial buffer size used by the lauxlib
+** buffer system.
*/
#define LUAL_BUFFERSIZE ((int)(16 * sizeof(void*) * sizeof(lua_Number)))
diff --git a/3rdparty/lua/src/lundump.c b/3rdparty/lua/src/lundump.c
index 5aa55c44578..e8d92a8534f 100644
--- a/3rdparty/lua/src/lundump.c
+++ b/3rdparty/lua/src/lundump.c
@@ -81,7 +81,7 @@ static size_t loadUnsigned (LoadState *S, size_t limit) {
static size_t loadSize (LoadState *S) {
- return loadUnsigned(S, ~(size_t)0);
+ return loadUnsigned(S, MAX_SIZET);
}
@@ -120,10 +120,10 @@ static TString *loadStringN (LoadState *S, Proto *p) {
}
else { /* long string */
ts = luaS_createlngstrobj(L, size); /* create string */
- setsvalue2s(L, L->top, ts); /* anchor it ('loadVector' can GC) */
+ setsvalue2s(L, L->top.p, ts); /* anchor it ('loadVector' can GC) */
luaD_inctop(L);
- loadVector(S, getstr(ts), size); /* load directly in final place */
- L->top--; /* pop string */
+ loadVector(S, getlngstr(ts), size); /* load directly in final place */
+ L->top.p--; /* pop string */
}
luaC_objbarrier(L, p, ts);
return ts;
@@ -248,6 +248,8 @@ static void loadDebug (LoadState *S, Proto *f) {
f->locvars[i].endpc = loadInt(S);
}
n = loadInt(S);
+ if (n != 0) /* does it have debug information? */
+ n = f->sizeupvalues; /* must be this many */
for (i = 0; i < n; i++)
f->upvalues[i].name = loadStringN(S, f);
}
@@ -321,7 +323,7 @@ LClosure *luaU_undump(lua_State *L, ZIO *Z, const char *name) {
S.Z = Z;
checkHeader(&S);
cl = luaF_newLclosure(L, loadByte(&S));
- setclLvalue2s(L, L->top, cl);
+ setclLvalue2s(L, L->top.p, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
luaC_objbarrier(L, cl, cl->p);
diff --git a/3rdparty/lua/src/lundump.h b/3rdparty/lua/src/lundump.h
index f3748a99807..a97676ca185 100644
--- a/3rdparty/lua/src/lundump.h
+++ b/3rdparty/lua/src/lundump.h
@@ -21,8 +21,7 @@
/*
** Encode major-minor version in one byte, one nibble for each
*/
-#define MYINT(s) (s[0]-'0') /* assume one-digit numerals */
-#define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR))
+#define LUAC_VERSION (((LUA_VERSION_NUM / 100) * 16) + LUA_VERSION_NUM % 100)
#define LUAC_FORMAT 0 /* this is the official format */
diff --git a/3rdparty/lua/src/lutf8lib.c b/3rdparty/lua/src/lutf8lib.c
index e7bf098f6d0..3a5b9bc38a5 100644
--- a/3rdparty/lua/src/lutf8lib.c
+++ b/3rdparty/lua/src/lutf8lib.c
@@ -25,6 +25,9 @@
#define MAXUTF 0x7FFFFFFFu
+
+#define MSGInvalid "invalid UTF-8 code"
+
/*
** Integer type for decoded UTF-8 values; MAXUTF needs 31 bits.
*/
@@ -35,7 +38,8 @@ typedef unsigned long utfint;
#endif
-#define iscont(p) ((*(p) & 0xC0) == 0x80)
+#define iscont(c) (((c) & 0xC0) == 0x80)
+#define iscontp(p) iscont(*(p))
/* from strlib */
@@ -65,7 +69,7 @@ static const char *utf8_decode (const char *s, utfint *val, int strict) {
int count = 0; /* to count number of continuation bytes */
for (; c & 0x40; c <<= 1) { /* while it needs continuation bytes... */
unsigned int cc = (unsigned char)s[++count]; /* read next byte */
- if ((cc & 0xC0) != 0x80) /* not a continuation byte? */
+ if (!iscont(cc)) /* not a continuation byte? */
return NULL; /* invalid byte sequence */
res = (res << 6) | (cc & 0x3F); /* add lower 6 bits from cont. byte */
}
@@ -140,7 +144,7 @@ static int codepoint (lua_State *L) {
utfint code;
s = utf8_decode(s, &code, !lax);
if (s == NULL)
- return luaL_error(L, "invalid UTF-8 code");
+ return luaL_error(L, MSGInvalid);
lua_pushinteger(L, code);
n++;
}
@@ -190,16 +194,16 @@ static int byteoffset (lua_State *L) {
"position out of bounds");
if (n == 0) {
/* find beginning of current byte sequence */
- while (posi > 0 && iscont(s + posi)) posi--;
+ while (posi > 0 && iscontp(s + posi)) posi--;
}
else {
- if (iscont(s + posi))
+ if (iscontp(s + posi))
return luaL_error(L, "initial position is a continuation byte");
if (n < 0) {
while (n < 0 && posi > 0) { /* move back */
do { /* find beginning of previous character */
posi--;
- } while (posi > 0 && iscont(s + posi));
+ } while (posi > 0 && iscontp(s + posi));
n++;
}
}
@@ -208,7 +212,7 @@ static int byteoffset (lua_State *L) {
while (n > 0 && posi < (lua_Integer)len) {
do { /* find beginning of next character */
posi++;
- } while (iscont(s + posi)); /* (cannot pass final '\0') */
+ } while (iscontp(s + posi)); /* (cannot pass final '\0') */
n--;
}
}
@@ -226,15 +230,15 @@ static int iter_aux (lua_State *L, int strict) {
const char *s = luaL_checklstring(L, 1, &len);
lua_Unsigned n = (lua_Unsigned)lua_tointeger(L, 2);
if (n < len) {
- while (iscont(s + n)) n++; /* skip continuation bytes */
+ while (iscontp(s + n)) n++; /* go to next character */
}
if (n >= len) /* (also handles original 'n' being negative) */
return 0; /* no more codepoints */
else {
utfint code;
const char *next = utf8_decode(s + n, &code, strict);
- if (next == NULL)
- return luaL_error(L, "invalid UTF-8 code");
+ if (next == NULL || iscontp(next))
+ return luaL_error(L, MSGInvalid);
lua_pushinteger(L, n + 1);
lua_pushinteger(L, code);
return 2;
@@ -253,7 +257,8 @@ static int iter_auxlax (lua_State *L) {
static int iter_codes (lua_State *L) {
int lax = lua_toboolean(L, 2);
- luaL_checkstring(L, 1);
+ const char *s = luaL_checkstring(L, 1);
+ luaL_argcheck(L, !iscontp(s), 1, MSGInvalid);
lua_pushcfunction(L, lax ? iter_auxlax : iter_auxstrict);
lua_pushvalue(L, 1);
lua_pushinteger(L, 0);
diff --git a/3rdparty/lua/src/lvm.c b/3rdparty/lua/src/lvm.c
index 2ec34400319..fcd24e11dc8 100644
--- a/3rdparty/lua/src/lvm.c
+++ b/3rdparty/lua/src/lvm.c
@@ -91,8 +91,10 @@ static int l_strton (const TValue *obj, TValue *result) {
lua_assert(obj != result);
if (!cvt2num(obj)) /* is object not a string? */
return 0;
- else
- return (luaO_str2num(svalue(obj), result) == vslen(obj) + 1);
+ else {
+ TString *st = tsvalue(obj);
+ return (luaO_str2num(getstr(st), result) == tsslen(st) + 1);
+ }
}
@@ -366,30 +368,32 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
/*
-** Compare two strings 'ls' x 'rs', returning an integer less-equal-
-** -greater than zero if 'ls' is less-equal-greater than 'rs'.
+** Compare two strings 'ts1' x 'ts2', returning an integer less-equal-
+** -greater than zero if 'ts1' is less-equal-greater than 'ts2'.
** The code is a little tricky because it allows '\0' in the strings
-** and it uses 'strcoll' (to respect locales) for each segments
-** of the strings.
+** and it uses 'strcoll' (to respect locales) for each segment
+** of the strings. Note that segments can compare equal but still
+** have different lengths.
*/
-static int l_strcmp (const TString *ls, const TString *rs) {
- const char *l = getstr(ls);
- size_t ll = tsslen(ls);
- const char *r = getstr(rs);
- size_t lr = tsslen(rs);
+static int l_strcmp (const TString *ts1, const TString *ts2) {
+ const char *s1 = getstr(ts1);
+ size_t rl1 = tsslen(ts1); /* real length */
+ const char *s2 = getstr(ts2);
+ size_t rl2 = tsslen(ts2);
for (;;) { /* for each segment */
- int temp = strcoll(l, r);
+ int temp = strcoll(s1, s2);
if (temp != 0) /* not equal? */
return temp; /* done */
else { /* strings are equal up to a '\0' */
- size_t len = strlen(l); /* index of first '\0' in both strings */
- if (len == lr) /* 'rs' is finished? */
- return (len == ll) ? 0 : 1; /* check 'ls' */
- else if (len == ll) /* 'ls' is finished? */
- return -1; /* 'ls' is less than 'rs' ('rs' is not finished) */
- /* both strings longer than 'len'; go on comparing after the '\0' */
- len++;
- l += len; ll -= len; r += len; lr -= len;
+ size_t zl1 = strlen(s1); /* index of first '\0' in 's1' */
+ size_t zl2 = strlen(s2); /* index of first '\0' in 's2' */
+ if (zl2 == rl2) /* 's2' is finished? */
+ return (zl1 == rl1) ? 0 : 1; /* check 's1' */
+ else if (zl1 == rl1) /* 's1' is finished? */
+ return -1; /* 's1' is less than 's2' ('s2' is not finished) */
+ /* both strings longer than 'zl'; go on comparing after the '\0' */
+ zl1++; zl2++;
+ s1 += zl1; rl1 -= zl1; s2 += zl2; rl2 -= zl2;
}
}
}
@@ -608,8 +612,8 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) {
if (tm == NULL) /* no TM? */
return 0; /* objects are different */
else {
- luaT_callTMres(L, tm, t1, t2, L->top); /* call TM */
- return !l_isfalse(s2v(L->top));
+ luaT_callTMres(L, tm, t1, t2, L->top.p); /* call TM */
+ return !l_isfalse(s2v(L->top.p));
}
}
@@ -624,8 +628,9 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) {
static void copy2buff (StkId top, int n, char *buff) {
size_t tl = 0; /* size already copied */
do {
- size_t l = vslen(s2v(top - n)); /* length of string being copied */
- memcpy(buff + tl, svalue(s2v(top - n)), l * sizeof(char));
+ TString *st = tsvalue(s2v(top - n));
+ size_t l = tsslen(st); /* length of string being copied */
+ memcpy(buff + tl, getstr(st), l * sizeof(char));
tl += l;
} while (--n > 0);
}
@@ -633,17 +638,17 @@ static void copy2buff (StkId top, int n, char *buff) {
/*
** Main operation for concatenation: concat 'total' values in the stack,
-** from 'L->top - total' up to 'L->top - 1'.
+** from 'L->top.p - total' up to 'L->top.p - 1'.
*/
void luaV_concat (lua_State *L, int total) {
if (total == 1)
return; /* "all" values already concatenated */
do {
- StkId top = L->top;
+ StkId top = L->top.p;
int n = 2; /* number of elements handled in this pass (at least 2) */
if (!(ttisstring(s2v(top - 2)) || cvt2str(s2v(top - 2))) ||
!tostring(L, s2v(top - 1)))
- luaT_tryconcatTM(L);
+ luaT_tryconcatTM(L); /* may invalidate 'top' */
else if (isemptystr(s2v(top - 1))) /* second operand is empty? */
cast_void(tostring(L, s2v(top - 2))); /* result is first operand */
else if (isemptystr(s2v(top - 2))) { /* first operand is empty string? */
@@ -651,13 +656,15 @@ void luaV_concat (lua_State *L, int total) {
}
else {
/* at least two non-empty string values; get as many as possible */
- size_t tl = vslen(s2v(top - 1));
+ size_t tl = tsslen(tsvalue(s2v(top - 1)));
TString *ts;
/* collect total length and number of strings */
for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) {
- size_t l = vslen(s2v(top - n - 1));
- if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl))
+ size_t l = tsslen(tsvalue(s2v(top - n - 1)));
+ if (l_unlikely(l >= MAX_SIZE - sizeof(TString) - tl)) {
+ L->top.p = top - total; /* pop strings to avoid wasting stack */
luaG_runerror(L, "string length overflow");
+ }
tl += l;
}
if (tl <= LUAI_MAXSHORTLEN) { /* is result a short string? */
@@ -667,12 +674,12 @@ void luaV_concat (lua_State *L, int total) {
}
else { /* long string; copy strings directly to final result */
ts = luaS_createlngstrobj(L, tl);
- copy2buff(top, n, getstr(ts));
+ copy2buff(top, n, getlngstr(ts));
}
setsvalue2s(L, top - n, ts); /* create result */
}
- total -= n-1; /* got 'n' strings to create 1 new */
- L->top -= n-1; /* popped 'n' strings and pushed one */
+ total -= n - 1; /* got 'n' strings to create one new */
+ L->top.p -= n - 1; /* popped 'n' strings and pushed one */
} while (total > 1); /* repeat until only 1 result left */
}
@@ -763,12 +770,10 @@ lua_Number luaV_modf (lua_State *L, lua_Number m, lua_Number n) {
/* number of bits in an integer */
#define NBITS cast_int(sizeof(lua_Integer) * CHAR_BIT)
+
/*
** Shift left operation. (Shift right just negates 'y'.)
*/
-#define luaV_shiftr(x,y) luaV_shiftl(x,intop(-, 0, y))
-
-
lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y) {
if (y < 0) { /* shift right? */
if (y <= -NBITS) return 0;
@@ -808,26 +813,26 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base,
*/
void luaV_finishOp (lua_State *L) {
CallInfo *ci = L->ci;
- StkId base = ci->func + 1;
+ StkId base = ci->func.p + 1;
Instruction inst = *(ci->u.l.savedpc - 1); /* interrupted instruction */
OpCode op = GET_OPCODE(inst);
switch (op) { /* finish its execution */
case OP_MMBIN: case OP_MMBINI: case OP_MMBINK: {
- setobjs2s(L, base + GETARG_A(*(ci->u.l.savedpc - 2)), --L->top);
+ setobjs2s(L, base + GETARG_A(*(ci->u.l.savedpc - 2)), --L->top.p);
break;
}
case OP_UNM: case OP_BNOT: case OP_LEN:
case OP_GETTABUP: case OP_GETTABLE: case OP_GETI:
case OP_GETFIELD: case OP_SELF: {
- setobjs2s(L, base + GETARG_A(inst), --L->top);
+ setobjs2s(L, base + GETARG_A(inst), --L->top.p);
break;
}
case OP_LT: case OP_LE:
case OP_LTI: case OP_LEI:
case OP_GTI: case OP_GEI:
case OP_EQ: { /* note that 'OP_EQI'/'OP_EQK' cannot yield */
- int res = !l_isfalse(s2v(L->top - 1));
- L->top--;
+ int res = !l_isfalse(s2v(L->top.p - 1));
+ L->top.p--;
#if defined(LUA_COMPAT_LT_LE)
if (ci->callstatus & CIST_LEQ) { /* "<=" using "<" instead? */
ci->callstatus ^= CIST_LEQ; /* clear mark */
@@ -840,11 +845,11 @@ void luaV_finishOp (lua_State *L) {
break;
}
case OP_CONCAT: {
- StkId top = L->top - 1; /* top when 'luaT_tryconcatTM' was called */
+ StkId top = L->top.p - 1; /* top when 'luaT_tryconcatTM' was called */
int a = GETARG_A(inst); /* first element to concatenate */
int total = cast_int(top - 1 - (base + a)); /* yet to concatenate */
setobjs2s(L, top - 2, top); /* put TM result in proper position */
- L->top = top - 1; /* top is one after last element (at top-2) */
+ L->top.p = top - 1; /* top is one after last element (at top-2) */
luaV_concat(L, total); /* concat them (may yield again) */
break;
}
@@ -856,7 +861,7 @@ void luaV_finishOp (lua_State *L) {
StkId ra = base + GETARG_A(inst);
/* adjust top to signal correct number of returns, in case the
return is "up to top" ('isIT') */
- L->top = ra + ci->u2.nres;
+ L->top.p = ra + ci->u2.nres;
/* repeat instruction to close other vars. and complete the return */
ci->u.l.savedpc--;
break;
@@ -898,6 +903,7 @@ void luaV_finishOp (lua_State *L) {
** operation, 'fop' is the float operation.
*/
#define op_arithI(L,iop,fop) { \
+ StkId ra = RA(i); \
TValue *v1 = vRB(i); \
int imm = GETARG_sC(i); \
if (ttisinteger(v1)) { \
@@ -926,6 +932,7 @@ void luaV_finishOp (lua_State *L) {
** Arithmetic operations over floats and others with register operands.
*/
#define op_arithf(L,fop) { \
+ StkId ra = RA(i); \
TValue *v1 = vRB(i); \
TValue *v2 = vRC(i); \
op_arithf_aux(L, v1, v2, fop); }
@@ -935,6 +942,7 @@ void luaV_finishOp (lua_State *L) {
** Arithmetic operations with K operands for floats.
*/
#define op_arithfK(L,fop) { \
+ StkId ra = RA(i); \
TValue *v1 = vRB(i); \
TValue *v2 = KC(i); lua_assert(ttisnumber(v2)); \
op_arithf_aux(L, v1, v2, fop); }
@@ -944,6 +952,7 @@ void luaV_finishOp (lua_State *L) {
** Arithmetic operations over integers and floats.
*/
#define op_arith_aux(L,v1,v2,iop,fop) { \
+ StkId ra = RA(i); \
if (ttisinteger(v1) && ttisinteger(v2)) { \
lua_Integer i1 = ivalue(v1); lua_Integer i2 = ivalue(v2); \
pc++; setivalue(s2v(ra), iop(L, i1, i2)); \
@@ -973,6 +982,7 @@ void luaV_finishOp (lua_State *L) {
** Bitwise operations with constant operand.
*/
#define op_bitwiseK(L,op) { \
+ StkId ra = RA(i); \
TValue *v1 = vRB(i); \
TValue *v2 = KC(i); \
lua_Integer i1; \
@@ -986,6 +996,7 @@ void luaV_finishOp (lua_State *L) {
** Bitwise operations with register operands.
*/
#define op_bitwise(L,op) { \
+ StkId ra = RA(i); \
TValue *v1 = vRB(i); \
TValue *v2 = vRC(i); \
lua_Integer i1; lua_Integer i2; \
@@ -1000,18 +1011,19 @@ void luaV_finishOp (lua_State *L) {
** integers.
*/
#define op_order(L,opi,opn,other) { \
- int cond; \
- TValue *rb = vRB(i); \
- if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \
- lua_Integer ia = ivalue(s2v(ra)); \
- lua_Integer ib = ivalue(rb); \
- cond = opi(ia, ib); \
- } \
- else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \
- cond = opn(s2v(ra), rb); \
- else \
- Protect(cond = other(L, s2v(ra), rb)); \
- docondjump(); }
+ StkId ra = RA(i); \
+ int cond; \
+ TValue *rb = vRB(i); \
+ if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \
+ lua_Integer ia = ivalue(s2v(ra)); \
+ lua_Integer ib = ivalue(rb); \
+ cond = opi(ia, ib); \
+ } \
+ else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \
+ cond = opn(s2v(ra), rb); \
+ else \
+ Protect(cond = other(L, s2v(ra), rb)); \
+ docondjump(); }
/*
@@ -1019,20 +1031,21 @@ void luaV_finishOp (lua_State *L) {
** always small enough to have an exact representation as a float.)
*/
#define op_orderI(L,opi,opf,inv,tm) { \
- int cond; \
- int im = GETARG_sB(i); \
- if (ttisinteger(s2v(ra))) \
- cond = opi(ivalue(s2v(ra)), im); \
- else if (ttisfloat(s2v(ra))) { \
- lua_Number fa = fltvalue(s2v(ra)); \
- lua_Number fim = cast_num(im); \
- cond = opf(fa, fim); \
- } \
- else { \
- int isf = GETARG_C(i); \
- Protect(cond = luaT_callorderiTM(L, s2v(ra), im, inv, isf, tm)); \
- } \
- docondjump(); }
+ StkId ra = RA(i); \
+ int cond; \
+ int im = GETARG_sB(i); \
+ if (ttisinteger(s2v(ra))) \
+ cond = opi(ivalue(s2v(ra)), im); \
+ else if (ttisfloat(s2v(ra))) { \
+ lua_Number fa = fltvalue(s2v(ra)); \
+ lua_Number fim = cast_num(im); \
+ cond = opf(fa, fim); \
+ } \
+ else { \
+ int isf = GETARG_C(i); \
+ Protect(cond = luaT_callorderiTM(L, s2v(ra), im, inv, isf, tm)); \
+ } \
+ docondjump(); }
/* }================================================================== */
@@ -1061,7 +1074,7 @@ void luaV_finishOp (lua_State *L) {
#define updatetrap(ci) (trap = ci->u.l.trap)
-#define updatebase(ci) (base = ci->func + 1)
+#define updatebase(ci) (base = ci->func.p + 1)
#define updatestack(ci) \
@@ -1096,7 +1109,7 @@ void luaV_finishOp (lua_State *L) {
** Whenever code can raise errors, the global 'pc' and the global
** 'top' must be correct to report occasional errors.
*/
-#define savestate(L,ci) (savepc(L), L->top = ci->top)
+#define savestate(L,ci) (savepc(L), L->top.p = ci->top.p)
/*
@@ -1116,7 +1129,7 @@ void luaV_finishOp (lua_State *L) {
/* 'c' is the limit of live values in the stack */
#define checkGC(L,c) \
- { luaC_condGC(L, (savepc(L), L->top = (c)), \
+ { luaC_condGC(L, (savepc(L), L->top.p = (c)), \
updatetrap(ci)); \
luai_threadyield(L); }
@@ -1128,7 +1141,6 @@ void luaV_finishOp (lua_State *L) {
updatebase(ci); /* correct stack */ \
} \
i = *(pc++); \
- ra = RA(i); /* WARNING: any stack reallocation invalidates 'ra' */ \
}
#define vmdispatch(o) switch(o)
@@ -1148,72 +1160,73 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
startfunc:
trap = L->hookmask;
returning: /* trap already set */
- cl = clLvalue(s2v(ci->func));
+ cl = ci_func(ci);
k = cl->p->k;
pc = ci->u.l.savedpc;
- if (l_unlikely(trap)) {
- if (pc == cl->p->code) { /* first instruction (not resuming)? */
- if (cl->p->is_vararg)
- trap = 0; /* hooks will start after VARARGPREP instruction */
- else /* check 'call' hook */
- luaD_hookcall(L, ci);
- }
- ci->u.l.trap = 1; /* assume trap is on, for now */
- }
- base = ci->func + 1;
+ if (l_unlikely(trap))
+ trap = luaG_tracecall(L);
+ base = ci->func.p + 1;
/* main loop of interpreter */
for (;;) {
Instruction i; /* instruction being executed */
- StkId ra; /* instruction's A register */
vmfetch();
#if 0
/* low-level line tracing for debugging Lua */
printf("line: %d\n", luaG_getfuncline(cl->p, pcRel(pc, cl->p)));
#endif
- lua_assert(base == ci->func + 1);
- lua_assert(base <= L->top && L->top < L->stack_last);
+ lua_assert(base == ci->func.p + 1);
+ lua_assert(base <= L->top.p && L->top.p <= L->stack_last.p);
/* invalidate top for instructions not expecting it */
- lua_assert(isIT(i) || (cast_void(L->top = base), 1));
+ lua_assert(isIT(i) || (cast_void(L->top.p = base), 1));
vmdispatch (GET_OPCODE(i)) {
vmcase(OP_MOVE) {
+ StkId ra = RA(i);
setobjs2s(L, ra, RB(i));
vmbreak;
}
vmcase(OP_LOADI) {
+ StkId ra = RA(i);
lua_Integer b = GETARG_sBx(i);
setivalue(s2v(ra), b);
vmbreak;
}
vmcase(OP_LOADF) {
+ StkId ra = RA(i);
int b = GETARG_sBx(i);
setfltvalue(s2v(ra), cast_num(b));
vmbreak;
}
vmcase(OP_LOADK) {
+ StkId ra = RA(i);
TValue *rb = k + GETARG_Bx(i);
setobj2s(L, ra, rb);
vmbreak;
}
vmcase(OP_LOADKX) {
+ StkId ra = RA(i);
TValue *rb;
rb = k + GETARG_Ax(*pc); pc++;
setobj2s(L, ra, rb);
vmbreak;
}
vmcase(OP_LOADFALSE) {
+ StkId ra = RA(i);
setbfvalue(s2v(ra));
vmbreak;
}
vmcase(OP_LFALSESKIP) {
+ StkId ra = RA(i);
setbfvalue(s2v(ra));
pc++; /* skip next instruction */
vmbreak;
}
vmcase(OP_LOADTRUE) {
+ StkId ra = RA(i);
setbtvalue(s2v(ra));
vmbreak;
}
vmcase(OP_LOADNIL) {
+ StkId ra = RA(i);
int b = GETARG_B(i);
do {
setnilvalue(s2v(ra++));
@@ -1221,21 +1234,24 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_GETUPVAL) {
+ StkId ra = RA(i);
int b = GETARG_B(i);
- setobj2s(L, ra, cl->upvals[b]->v);
+ setobj2s(L, ra, cl->upvals[b]->v.p);
vmbreak;
}
vmcase(OP_SETUPVAL) {
+ StkId ra = RA(i);
UpVal *uv = cl->upvals[GETARG_B(i)];
- setobj(L, uv->v, s2v(ra));
+ setobj(L, uv->v.p, s2v(ra));
luaC_barrier(L, uv, s2v(ra));
vmbreak;
}
vmcase(OP_GETTABUP) {
+ StkId ra = RA(i);
const TValue *slot;
- TValue *upval = cl->upvals[GETARG_B(i)]->v;
+ TValue *upval = cl->upvals[GETARG_B(i)]->v.p;
TValue *rc = KC(i);
- TString *key = tsvalue(rc); /* key must be a string */
+ TString *key = tsvalue(rc); /* key must be a short string */
if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) {
setobj2s(L, ra, slot);
}
@@ -1244,6 +1260,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_GETTABLE) {
+ StkId ra = RA(i);
const TValue *slot;
TValue *rb = vRB(i);
TValue *rc = vRC(i);
@@ -1258,6 +1275,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_GETI) {
+ StkId ra = RA(i);
const TValue *slot;
TValue *rb = vRB(i);
int c = GETARG_C(i);
@@ -1272,10 +1290,11 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_GETFIELD) {
+ StkId ra = RA(i);
const TValue *slot;
TValue *rb = vRB(i);
TValue *rc = KC(i);
- TString *key = tsvalue(rc); /* key must be a string */
+ TString *key = tsvalue(rc); /* key must be a short string */
if (luaV_fastget(L, rb, key, slot, luaH_getshortstr)) {
setobj2s(L, ra, slot);
}
@@ -1285,10 +1304,10 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
}
vmcase(OP_SETTABUP) {
const TValue *slot;
- TValue *upval = cl->upvals[GETARG_A(i)]->v;
+ TValue *upval = cl->upvals[GETARG_A(i)]->v.p;
TValue *rb = KB(i);
TValue *rc = RKC(i);
- TString *key = tsvalue(rb); /* key must be a string */
+ TString *key = tsvalue(rb); /* key must be a short string */
if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) {
luaV_finishfastset(L, upval, slot, rc);
}
@@ -1297,6 +1316,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_SETTABLE) {
+ StkId ra = RA(i);
const TValue *slot;
TValue *rb = vRB(i); /* key (table is in 'ra') */
TValue *rc = RKC(i); /* value */
@@ -1311,6 +1331,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_SETI) {
+ StkId ra = RA(i);
const TValue *slot;
int c = GETARG_B(i);
TValue *rc = RKC(i);
@@ -1325,10 +1346,11 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_SETFIELD) {
+ StkId ra = RA(i);
const TValue *slot;
TValue *rb = KB(i);
TValue *rc = RKC(i);
- TString *key = tsvalue(rb); /* key must be a string */
+ TString *key = tsvalue(rb); /* key must be a short string */
if (luaV_fastget(L, s2v(ra), key, slot, luaH_getshortstr)) {
luaV_finishfastset(L, s2v(ra), slot, rc);
}
@@ -1337,6 +1359,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_NEWTABLE) {
+ StkId ra = RA(i);
int b = GETARG_B(i); /* log2(hash size) + 1 */
int c = GETARG_C(i); /* array size */
Table *t;
@@ -1346,7 +1369,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
if (TESTARG_k(i)) /* non-zero extra argument? */
c += GETARG_Ax(*pc) * (MAXARG_C + 1); /* add it to size */
pc++; /* skip extra argument */
- L->top = ra + 1; /* correct top in case of emergency GC */
+ L->top.p = ra + 1; /* correct top in case of emergency GC */
t = luaH_new(L); /* memory allocation */
sethvalue2s(L, ra, t);
if (b != 0 || c != 0)
@@ -1355,6 +1378,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_SELF) {
+ StkId ra = RA(i);
const TValue *slot;
TValue *rb = vRB(i);
TValue *rc = RKC(i);
@@ -1384,6 +1408,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_MODK) {
+ savestate(L, ci); /* in case of division by 0 */
op_arithK(L, luaV_mod, luaV_modf);
vmbreak;
}
@@ -1396,6 +1421,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_IDIVK) {
+ savestate(L, ci); /* in case of division by 0 */
op_arithK(L, luaV_idiv, luai_numidiv);
vmbreak;
}
@@ -1412,6 +1438,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_SHRI) {
+ StkId ra = RA(i);
TValue *rb = vRB(i);
int ic = GETARG_sC(i);
lua_Integer ib;
@@ -1421,6 +1448,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_SHLI) {
+ StkId ra = RA(i);
TValue *rb = vRB(i);
int ic = GETARG_sC(i);
lua_Integer ib;
@@ -1442,6 +1470,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_MOD) {
+ savestate(L, ci); /* in case of division by 0 */
op_arith(L, luaV_mod, luaV_modf);
vmbreak;
}
@@ -1454,6 +1483,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_IDIV) { /* floor division */
+ savestate(L, ci); /* in case of division by 0 */
op_arith(L, luaV_idiv, luai_numidiv);
vmbreak;
}
@@ -1478,6 +1508,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_MMBIN) {
+ StkId ra = RA(i);
Instruction pi = *(pc - 2); /* original arith. expression */
TValue *rb = vRB(i);
TMS tm = (TMS)GETARG_C(i);
@@ -1487,6 +1518,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_MMBINI) {
+ StkId ra = RA(i);
Instruction pi = *(pc - 2); /* original arith. expression */
int imm = GETARG_sB(i);
TMS tm = (TMS)GETARG_C(i);
@@ -1496,6 +1528,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_MMBINK) {
+ StkId ra = RA(i);
Instruction pi = *(pc - 2); /* original arith. expression */
TValue *imm = KB(i);
TMS tm = (TMS)GETARG_C(i);
@@ -1505,6 +1538,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_UNM) {
+ StkId ra = RA(i);
TValue *rb = vRB(i);
lua_Number nb;
if (ttisinteger(rb)) {
@@ -1519,6 +1553,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_BNOT) {
+ StkId ra = RA(i);
TValue *rb = vRB(i);
lua_Integer ib;
if (tointegerns(rb, &ib)) {
@@ -1529,6 +1564,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_NOT) {
+ StkId ra = RA(i);
TValue *rb = vRB(i);
if (l_isfalse(rb))
setbtvalue(s2v(ra));
@@ -1537,21 +1573,25 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_LEN) {
+ StkId ra = RA(i);
Protect(luaV_objlen(L, ra, vRB(i)));
vmbreak;
}
vmcase(OP_CONCAT) {
+ StkId ra = RA(i);
int n = GETARG_B(i); /* number of elements to concatenate */
- L->top = ra + n; /* mark the end of concat operands */
+ L->top.p = ra + n; /* mark the end of concat operands */
ProtectNT(luaV_concat(L, n));
- checkGC(L, L->top); /* 'luaV_concat' ensures correct top */
+ checkGC(L, L->top.p); /* 'luaV_concat' ensures correct top */
vmbreak;
}
vmcase(OP_CLOSE) {
+ StkId ra = RA(i);
Protect(luaF_close(L, ra, LUA_OK, 1));
vmbreak;
}
vmcase(OP_TBC) {
+ StkId ra = RA(i);
/* create new to-be-closed upvalue */
halfProtect(luaF_newtbcupval(L, ra));
vmbreak;
@@ -1561,6 +1601,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_EQ) {
+ StkId ra = RA(i);
int cond;
TValue *rb = vRB(i);
Protect(cond = luaV_equalobj(L, s2v(ra), rb));
@@ -1576,6 +1617,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_EQK) {
+ StkId ra = RA(i);
TValue *rb = KB(i);
/* basic types do not use '__eq'; we can use raw equality */
int cond = luaV_rawequalobj(s2v(ra), rb);
@@ -1583,6 +1625,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_EQI) {
+ StkId ra = RA(i);
int cond;
int im = GETARG_sB(i);
if (ttisinteger(s2v(ra)))
@@ -1611,11 +1654,13 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_TEST) {
+ StkId ra = RA(i);
int cond = !l_isfalse(s2v(ra));
docondjump();
vmbreak;
}
vmcase(OP_TESTSET) {
+ StkId ra = RA(i);
TValue *rb = vRB(i);
if (l_isfalse(rb) == GETARG_k(i))
pc++;
@@ -1626,11 +1671,12 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_CALL) {
+ StkId ra = RA(i);
CallInfo *newci;
int b = GETARG_B(i);
int nresults = GETARG_C(i) - 1;
if (b != 0) /* fixed number of arguments? */
- L->top = ra + b; /* top signals number of arguments */
+ L->top.p = ra + b; /* top signals number of arguments */
/* else previous instruction set top */
savepc(L); /* in case of errors */
if ((newci = luaD_precall(L, ra, nresults)) == NULL)
@@ -1642,54 +1688,57 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_TAILCALL) {
+ StkId ra = RA(i);
int b = GETARG_B(i); /* number of arguments + 1 (function) */
int n; /* number of results when calling a C function */
int nparams1 = GETARG_C(i);
/* delta is virtual 'func' - real 'func' (vararg functions) */
int delta = (nparams1) ? ci->u.l.nextraargs + nparams1 : 0;
if (b != 0)
- L->top = ra + b;
+ L->top.p = ra + b;
else /* previous instruction set top */
- b = cast_int(L->top - ra);
+ b = cast_int(L->top.p - ra);
savepc(ci); /* several calls here can raise errors */
if (TESTARG_k(i)) {
luaF_closeupval(L, base); /* close upvalues from current call */
- lua_assert(L->tbclist < base); /* no pending tbc variables */
- lua_assert(base == ci->func + 1);
+ lua_assert(L->tbclist.p < base); /* no pending tbc variables */
+ lua_assert(base == ci->func.p + 1);
}
if ((n = luaD_pretailcall(L, ci, ra, b, delta)) < 0) /* Lua function? */
goto startfunc; /* execute the callee */
else { /* C function? */
- ci->func -= delta; /* restore 'func' (if vararg) */
+ ci->func.p -= delta; /* restore 'func' (if vararg) */
luaD_poscall(L, ci, n); /* finish caller */
updatetrap(ci); /* 'luaD_poscall' can change hooks */
goto ret; /* caller returns after the tail call */
}
}
vmcase(OP_RETURN) {
+ StkId ra = RA(i);
int n = GETARG_B(i) - 1; /* number of results */
int nparams1 = GETARG_C(i);
if (n < 0) /* not fixed? */
- n = cast_int(L->top - ra); /* get what is available */
+ n = cast_int(L->top.p - ra); /* get what is available */
savepc(ci);
if (TESTARG_k(i)) { /* may there be open upvalues? */
ci->u2.nres = n; /* save number of returns */
- if (L->top < ci->top)
- L->top = ci->top;
+ if (L->top.p < ci->top.p)
+ L->top.p = ci->top.p;
luaF_close(L, base, CLOSEKTOP, 1);
updatetrap(ci);
updatestack(ci);
}
if (nparams1) /* vararg function? */
- ci->func -= ci->u.l.nextraargs + nparams1;
- L->top = ra + n; /* set call for 'luaD_poscall' */
+ ci->func.p -= ci->u.l.nextraargs + nparams1;
+ L->top.p = ra + n; /* set call for 'luaD_poscall' */
luaD_poscall(L, ci, n);
updatetrap(ci); /* 'luaD_poscall' can change hooks */
goto ret;
}
vmcase(OP_RETURN0) {
if (l_unlikely(L->hookmask)) {
- L->top = ra;
+ StkId ra = RA(i);
+ L->top.p = ra;
savepc(ci);
luaD_poscall(L, ci, 0); /* no hurry... */
trap = 1;
@@ -1697,15 +1746,16 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
else { /* do the 'poscall' here */
int nres;
L->ci = ci->previous; /* back to caller */
- L->top = base - 1;
+ L->top.p = base - 1;
for (nres = ci->nresults; l_unlikely(nres > 0); nres--)
- setnilvalue(s2v(L->top++)); /* all results are nil */
+ setnilvalue(s2v(L->top.p++)); /* all results are nil */
}
goto ret;
}
vmcase(OP_RETURN1) {
if (l_unlikely(L->hookmask)) {
- L->top = ra + 1;
+ StkId ra = RA(i);
+ L->top.p = ra + 1;
savepc(ci);
luaD_poscall(L, ci, 1); /* no hurry... */
trap = 1;
@@ -1714,12 +1764,13 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
int nres = ci->nresults;
L->ci = ci->previous; /* back to caller */
if (nres == 0)
- L->top = base - 1; /* asked for no results */
+ L->top.p = base - 1; /* asked for no results */
else {
+ StkId ra = RA(i);
setobjs2s(L, base - 1, ra); /* at least this result */
- L->top = base;
+ L->top.p = base;
for (; l_unlikely(nres > 1); nres--)
- setnilvalue(s2v(L->top++)); /* complete missing results */
+ setnilvalue(s2v(L->top.p++)); /* complete missing results */
}
}
ret: /* return from a Lua function */
@@ -1731,6 +1782,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
}
}
vmcase(OP_FORLOOP) {
+ StkId ra = RA(i);
if (ttisinteger(s2v(ra + 2))) { /* integer loop? */
lua_Unsigned count = l_castS2U(ivalue(s2v(ra + 1)));
if (count > 0) { /* still more iterations? */
@@ -1749,12 +1801,14 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_FORPREP) {
+ StkId ra = RA(i);
savestate(L, ci); /* in case of errors */
if (forprep(L, ra))
pc += GETARG_Bx(i) + 1; /* skip the loop */
vmbreak;
}
vmcase(OP_TFORPREP) {
+ StkId ra = RA(i);
/* create to-be-closed upvalue (if needed) */
halfProtect(luaF_newtbcupval(L, ra + 3));
pc += GETARG_Bx(i);
@@ -1763,7 +1817,8 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
goto l_tforcall;
}
vmcase(OP_TFORCALL) {
- l_tforcall:
+ l_tforcall: {
+ StkId ra = RA(i);
/* 'ra' has the iterator function, 'ra + 1' has the state,
'ra + 2' has the control variable, and 'ra + 3' has the
to-be-closed variable. The call will use the stack after
@@ -1771,29 +1826,31 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
*/
/* push function, state, and control variable */
memcpy(ra + 4, ra, 3 * sizeof(*ra));
- L->top = ra + 4 + 3;
+ L->top.p = ra + 4 + 3;
ProtectNT(luaD_call(L, ra + 4, GETARG_C(i))); /* do the call */
updatestack(ci); /* stack may have changed */
i = *(pc++); /* go to next instruction */
lua_assert(GET_OPCODE(i) == OP_TFORLOOP && ra == RA(i));
goto l_tforloop;
- }
+ }}
vmcase(OP_TFORLOOP) {
- l_tforloop:
+ l_tforloop: {
+ StkId ra = RA(i);
if (!ttisnil(s2v(ra + 4))) { /* continue loop? */
setobjs2s(L, ra + 2, ra + 4); /* save control variable */
pc -= GETARG_Bx(i); /* jump back */
}
vmbreak;
- }
+ }}
vmcase(OP_SETLIST) {
+ StkId ra = RA(i);
int n = GETARG_B(i);
unsigned int last = GETARG_C(i);
Table *h = hvalue(s2v(ra));
if (n == 0)
- n = cast_int(L->top - ra) - 1; /* get up to the top */
+ n = cast_int(L->top.p - ra) - 1; /* get up to the top */
else
- L->top = ci->top; /* correct top in case of emergency GC */
+ L->top.p = ci->top.p; /* correct top in case of emergency GC */
last += n;
if (TESTARG_k(i)) {
last += GETARG_Ax(*pc) * (MAXARG_C + 1);
@@ -1810,12 +1867,14 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmbreak;
}
vmcase(OP_CLOSURE) {
+ StkId ra = RA(i);
Proto *p = cl->p->p[GETARG_Bx(i)];
halfProtect(pushclosure(L, p, cl->upvals, base, ra));
checkGC(L, ra + 1);
vmbreak;
}
vmcase(OP_VARARG) {
+ StkId ra = RA(i);
int n = GETARG_C(i) - 1; /* required results */
Protect(luaT_getvarargs(L, ci, ra, n));
vmbreak;
diff --git a/3rdparty/lua/src/lvm.h b/3rdparty/lua/src/lvm.h
index 1bc16f3a50b..dba1ad27702 100644
--- a/3rdparty/lua/src/lvm.h
+++ b/3rdparty/lua/src/lvm.h
@@ -110,6 +110,11 @@ typedef enum {
luaC_barrierback(L, gcvalue(t), v); }
+/*
+** Shift right is the same as shift left with a negative 'y'
+*/
+#define luaV_shiftr(x,y) luaV_shiftl(x,intop(-, 0, y))
+
LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2);
diff --git a/3rdparty/portmidi/.github/workflows/build.yml b/3rdparty/portmidi/.github/workflows/build.yml
new file mode 100644
index 00000000000..351b5cbf00c
--- /dev/null
+++ b/3rdparty/portmidi/.github/workflows/build.yml
@@ -0,0 +1,47 @@
+name: build
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ build:
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - name: Ubuntu
+ os: ubuntu-latest
+ install_dir: ~/portmidi
+ cmake_extras: -DCMAKE_BUILD_TYPE=RelWithDebInfo
+ - name: macOS
+ os: macos-latest
+ install_dir: ~/portmidi
+ cmake_extras: -DCMAKE_BUILD_TYPE=RelWithDebInfo
+ - name: Windows
+ os: windows-latest
+ install_dir: C:\portmidi
+ cmake_config: --config RelWithDebInfo
+
+ name: ${{ matrix.name }}
+ runs-on: ${{ matrix.os }}
+ steps:
+ - name: Check out Git repository
+ uses: actions/checkout@v2
+ - name: "[Ubuntu] Install dependencies"
+ run: sudo apt install -y libasound2-dev
+ if: runner.os == 'Linux'
+ - name: Configure
+ run: cmake -D CMAKE_INSTALL_PREFIX=${{ matrix.install_dir }} ${{ matrix.cmake_extras }} -S . -B build
+ - name: Build
+ run: cmake --build build ${{ matrix.cmake_config }}
+ env:
+ CMAKE_BUILD_PARALLEL_LEVEL: 2
+ - name: Install
+ run: cmake --install . ${{ matrix.cmake_config }}
+ working-directory: build
+ - name: Upload Build Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ matrix.name }} portmidi build
+ path: ${{ matrix.install_dir }}
diff --git a/3rdparty/portmidi/.github/workflows/docs.yml b/3rdparty/portmidi/.github/workflows/docs.yml
new file mode 100644
index 00000000000..d0e251b77da
--- /dev/null
+++ b/3rdparty/portmidi/.github/workflows/docs.yml
@@ -0,0 +1,28 @@
+name: Generate Docs
+
+on:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ doxygen:
+ name: Doxygen
+ runs-on: ubuntu-latest
+ steps:
+ - name: "Check out repository"
+ uses: actions/checkout@v2
+
+ - name: Install Doxygen
+ run: sudo apt-get update && sudo apt-get install -y --no-install-recommends doxygen
+
+ - name: Generate Documentation
+ run: doxygen
+ working-directory: .
+
+ - name: Deploy to GitHub Pages
+ uses: peaceiris/actions-gh-pages@v3
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: docs/html
diff --git a/3rdparty/portmidi/.gitignore b/3rdparty/portmidi/.gitignore
new file mode 100644
index 00000000000..19d66501fee
--- /dev/null
+++ b/3rdparty/portmidi/.gitignore
@@ -0,0 +1,62 @@
+.DS_Store
+build*/
+*~
+CMakeCache.txt
+CMakeFiles/
+CMakeScripts/
+/portmidi.pc
+/x64/
+/Debug/
+/Release/
+/pm_java/pmdefaults/pmdefaults.jar
+/pm_java/pmdefaults.sln
+/pm_java/pmjni.dir/
+/pm_java/x64/
+portmidi.build/
+cmake_install.cmake
+*.xcodeproj/
+/.vs/
+/portmidi.sln
+*.vcxproj
+*.vcxproj.filters
+*.vcxproj.user
+/Makefile
+/libportmidi.so*
+/libportmidi.a
+/libportmidi_static.a
+/libpmjni.so*
+/packaging/PortMidiConfig.cmake
+/packaging/PortMidiConfigVersion.cmake
+/packaging/portmidi.pc
+/pm_common/Makefile
+/pm_common/portmidi.dir/
+/pm_java/Makefile
+/pm_test/Debug/
+/pm_test/Release/
+/pm_test/Makefile
+/pm_test/fastrcv
+/pm_test/fastrcv.dir/
+/pm_test/latency
+/pm_test/latency.dir/
+/pm_test/midiclock
+/pm_test/midiclock.dir/
+/pm_test/midithread
+/pm_test/midithread.dir/
+/pm_test/midithru
+/pm_test/midithru.dir/
+/pm_test/mm
+/pm_test/mm.dir/
+/pm_test/multivirtual
+/pm_test/qtest
+/pm_test/qtest.dir/
+/pm_test/recvvirtual
+/pm_test/sendvirtual
+/pm_test/sysex
+/pm_test/sysex.dir/
+/pm_test/testio
+/pm_test/testio.dir/
+/pm_test/virttest
+/pm_test/fast
+/pm_test/fast.dir/
+/pm_test/pmlist
+/pm_test/pmlist.dir/
diff --git a/3rdparty/portmidi/ALL_BUILD.vcproj b/3rdparty/portmidi/ALL_BUILD.vcproj
deleted file mode 100644
index b99ce00bb18..00000000000
--- a/3rdparty/portmidi/ALL_BUILD.vcproj
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="ALL_BUILD"
- ProjectGUID="{E1C2664B-91BB-4D4F-868C-433164F81101}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="ALL_BUILD.dir\Debug"
- ConfigurationType="10"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".\pm_common;.\porttime;"
- ExceptionHandling="0"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=".\pm_common;.\porttime;"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="ALL_BUILD.dir\Release"
- ConfigurationType="10"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".\pm_common;.\porttime;"
- ExceptionHandling="0"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=".\pm_common;.\porttime;"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <File
- RelativePath=".\CMakeFiles\ALL_BUILD">
- </File>
- <Filter
- Name="CMake Rules"
- Filter="">
- <File
- RelativePath=".\CMakeFiles\ALL_BUILD.rule">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description="Build all projects"
- CommandLine=""
- AdditionalDependencies=".\CMakeFiles\ALL_BUILD.rule"
- Outputs=".\CMakeFiles\ALL_BUILD"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description="Build all projects"
- CommandLine=""
- AdditionalDependencies=".\CMakeFiles\ALL_BUILD.rule"
- Outputs=".\CMakeFiles\ALL_BUILD"/>
- </FileConfiguration>
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/CHANGELOG.txt b/3rdparty/portmidi/CHANGELOG.txt
index c2a083a5685..fee43309cd0 100644
--- a/3rdparty/portmidi/CHANGELOG.txt
+++ b/3rdparty/portmidi/CHANGELOG.txt
@@ -1,5 +1,26 @@
/* CHANGELOG FOR PORTMIDI
*
+ * 21Feb22 v2.0.3 Roger Dannenberg
+ * - this version allows multiple hardware devices to have the same name.
+ *
+ * 03Jan22 v2.0.2 Roger Dannenberg
+ * - many changes for CMake including install support
+ * - bare-bones Java and PmDefaults support. It runs, but no
+ * installation.
+ *
+ * 16Sep21 Roger Dannenberg
+ * - Added CreateVirtualInput and CreateVirtualOutput functions (macOS
+ * & Linux) only.
+ * - Fix for unicode endpoints on macOS CoreMIDI.
+ * - Parsing in macOS of realtime message embedded in short messages
+ * (can this actually happen?)
+ * - renamed pm_test/test.c to pm_test/testio.c
+ * - with this release, pm_java, pm_csharp, pm_cl, pm_python, pm_qt
+ * are marked as "legacy code" and README.txt's refer to other
+ * projects. I had hoped for "one-stop shopping" for language
+ * bindings, but developers decided to move work to independent
+ * repositories. Maybe that's better.
+ *
* 19Oct09 Roger Dannenberg
* - Changes dynamic library names from portmidi_d to portmidi to
* be backward-compatible with programs expecting a library by
diff --git a/3rdparty/portmidi/CMakeLists.txt b/3rdparty/portmidi/CMakeLists.txt
index 4919b78df62..650fd943510 100644
--- a/3rdparty/portmidi/CMakeLists.txt
+++ b/3rdparty/portmidi/CMakeLists.txt
@@ -1,77 +1,183 @@
# portmidi
-# Roger B. Dannenberg
-# 20 Sep 2009
-
-cmake_minimum_required(VERSION 2.6)
-
-if(UNIX)
- # allow user to set Release or Debug
- set(CMAKE_BUILD_TYPE Release CACHE STRING
- "Semicolon-separate list of supported configuration types")
- # set default directories but don't override cached values...
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
- CACHE STRING "libraries go here")
- set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
- CACHE STRING "libraries go here")
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
- ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
- CACHE STRING "executables go here")
-
-else(UNIX)
- # this does not seem to work for xcode:
- set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
- "Semicolon-separate list of supported configuration types")
-endif(UNIX)
-
-#set(CMAKE_RELATIVE_PATHS ON CACHE STRING "avoid absolute paths" FORCE)
-
-# Clear out the built-in C++ compiler and link flags for each of the
-# unused configurations.
-set(CMAKE_CXX_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
-set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
-set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
-set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
-set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
-set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
-set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
-
-set(CMAKE_OSX_ARCHITECTURES i386 ppc x86_64 CACHE STRING "change to needed architecture for a smaller library" FORCE)
-
-PROJECT(portmidi)
-
-if(UNIX)
- # Problem: if there was an old Debug build and you change
- # CMAKE_BUILD_TYPE to Release, then the OUTPUT_DIRECTORY's will
- # still be Debug. Try to fix this by checking if the DIRECTORY's
- # look wrong, and if so, force them to the defaults:
- if(CMAKE_BUILD_TYPE MATCHES "Debug")
- set(BAD_DIR "Release")
- else(CMAKE_BUILD_TYPE MATCHES "Debug")
- set(BAD_DIR "Debug")
- endif(CMAKE_BUILD_TYPE MATCHES "Debug")
- # use library as reference -- if you give it a non-BAD_DIR location
- # then every other path is left alone
- if(CMAKE_LIBRARY_OUTPUT_DIRECTORY MATCHES ${BAD_DIR})
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
- ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
- CACHE STRING "executables go here" FORCE)
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
- ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
- CACHE STRING "libraries go here" FORCE)
- set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
- ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
- CACHE STRING "libraries go here" FORCE)
- endif(CMAKE_LIBRARY_OUTPUT_DIRECTORY MATCHES ${BAD_DIR})
-endif(UNIX)
+# Roger B. Dannenberg (and others)
+# Sep 2009 - 2021
+
+cmake_minimum_required(VERSION 3.21)
+# (ALSA::ALSA new in 3.12 and used in pm_common/CMakeLists.txt)
+# Some Java stuff failed on 3.17 but works with 3.20+
+
+cmake_policy(SET CMP0091 NEW) # enables MSVC_RUNTIME_LIBRARY target property
+
+# Previously, PortMidi versions were simply SVN commit version numbers.
+# Versions are now in the form x.y.z
+# Changed 1.0 to 2.0 because API is extended with virtual ports:
+set(SOVERSION "2")
+set(VERSION "2.0.3")
+
+project(portmidi VERSION "${VERSION}"
+ DESCRIPTION "Cross-Platform MIDI IO")
+
+set(LIBRARY_SOVERSION "${SOVERSION}")
+set(LIBRARY_VERSION "${VERSION}")
+
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+
+option(PM_USE_STATIC_RUNTIME
+ "Use MSVC static runtime. Only applies when BUILD_SHARED_LIBS is OFF"
+ ON)
+
+# MSVCRT_DLL is used to construct the MSVC_RUNTIME_LIBRARY property
+# (see pm_common/CMakeLists.txt and pm_test/CMakeLists.txt)
+if(PM_USE_STATIC_RUNTIME AND NOT BUILD_SHARED_LIBS)
+ set(MSVCRT_DLL "")
+else()
+ set(MSVCRT_DLL "DLL")
+endif()
+
+# Always build with position-independent code (-fPIC)
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+
+set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9 CACHE STRING
+ "make for this OS version or higher")
+
+# PM_ACTUAL_LIB_NAME is in this scope -- see pm_common/CMakeLists.txt
+# PM_NEEDED_LIBS is in this scope -- see pm_common/CMakeLists.txt
+
+include(GNUInstallDirs)
+
+# Build Types
+# credit: http://cliutils.gitlab.io/modern-cmake/chapters/features.html
+set(DEFAULT_BUILD_TYPE "Release")
+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ message(STATUS
+ "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
+ set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
+ STRING "Choose the type of build." FORCE)
+ # Set the possible values of build type for cmake-gui
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
+ "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+endif()
+
+# where to put libraries? Everything goes here in this directory
+# (or Debug or Release, depending on the OS)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+
+option(BUILD_PMDEFAULTS
+ "build the legacy Java application PmDefaults" OFF)
+option(BUILD_JAVA_NATIVE_INTERFACE
+ "build the Java PortMidi interface library" OFF)
+
+# Defines are used in both portmidi (in pm_common/) and pmjni (in pm_java),
+# so define them here to be inherited by both libraries.
+#
+# PortMidi software architecture supports multiple system API's to lower-
+# level MIDI drivers, e.g. PMNULL (no drivers), Jack (but not supported yet),
+# and sndio (BSD, not supported yet). Interfaces are selected by defining,
+# e.g., PMALSA. (In principle, we should require PMCOREMIDI (for macOS)
+# and PMWINMM (for windows), but these are assumed.
+#
+if(APPLE OR WIN32)
+else(APPLE_OR_WIN32)
+ set(LINUX_DEFINES "PMALSA" CACHE STRING "must define either PMALSA or PMNULL")
+ add_compile_definitions(${LINUX_DEFINES})
+endif(APPLE OR WIN32)
+
+if(BUILD_JAVA_NATIVE_INTERFACE)
+ message(WARNING
+ "Java API and PmDefaults program updated 2021, but support has "
+ "been discontinued. If you need/use this, let developers know.")
+ set(PMJNI_IF_EXISTS "pmjni") # used by INSTALL below
+else(BUILD_JAVA_NATIVE_INTERFACE)
+ set(PMJNI_IF_EXISTS "") # used by INSTALL below
+ if(BUILD_PMDEFAULTS)
+ message(FATAL_ERROR
+ "Cannot build PM_Defaults program (BUILD_PM_DEFAULTS) without option "
+ "BUILD_JAVA_NATIVE_INTERFACE")
+ endif(BUILD_PMDEFAULTS)
+endif(BUILD_JAVA_NATIVE_INTERFACE)
+
+
+# Something like this might help if you need to build for a specific cpu type:
+# set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
+# "change to support other architectures" FORCE)
include_directories(pm_common porttime)
add_subdirectory(pm_common)
-add_subdirectory(pm_test)
+option(BUILD_PORTMIDI_TESTS
+ "Build test programs, including midi monitor (mm)" OFF)
+if(BUILD_PORTMIDI_TESTS)
+ add_subdirectory(pm_test)
+endif(BUILD_PORTMIDI_TESTS)
+
+# See note above about Java support (probably) discontinued
+if(BUILD_JAVA_NATIVE_INTERFACE)
+ add_subdirectory(pm_java)
+endif(BUILD_JAVA_NATIVE_INTERFACE)
+
+# Install the libraries and headers (Linux and Mac OS X command line)
+INSTALL(TARGETS portmidi ${PMJNI_IF_EXISTS}
+ EXPORT PortMidiTargets
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+
+INSTALL(FILES
+ pm_common/portmidi.h
+ pm_common/pmutil.h
+ porttime/porttime.h
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+# pkgconfig - generate pc file
+# See https://cmake.org/cmake/help/latest/command/configure_file.html
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/portmidi.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/packaging/portmidi.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/packaging/portmidi.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+
+# CMake config
+set(PORTMIDI_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/PortMidi")
+install(
+ EXPORT PortMidiTargets
+ FILE PortMidiTargets.cmake
+ NAMESPACE PortMidi::
+ DESTINATION "${PORTMIDI_INSTALL_CMAKEDIR}"
+)
+include(CMakePackageConfigHelpers)
+configure_package_config_file(packaging/PortMidiConfig.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/packaging/PortMidiConfig.cmake"
+ INSTALL_DESTINATION "${PORTMIDI_INSTALL_CMAKEDIR}"
+)
+write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/packaging/PortMidiConfigVersion.cmake"
+ VERSION "${CMAKE_PROJECT_VERSION}"
+ COMPATIBILITY SameMajorVersion
+)
+install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/packaging/PortMidiConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/packaging/PortMidiConfigVersion.cmake"
+ DESTINATION "${PORTMIDI_INSTALL_CMAKEDIR}"
+)
+
+
-add_subdirectory(pm_dylib)
-# Cannot figure out how to make an xcode Java application with CMake
-add_subdirectory(pm_java)
+# Finding out what CMake is doing is really hard, e.g. COMPILE_FLAGS
+# does not include COMPILE_OPTIONS or COMPILE_DEFINTIONS. Thus, the
+# following report is probably not complete...
+MESSAGE(STATUS "PortMidi Library name: " ${PM_ACTUAL_LIB_NAME})
+MESSAGE(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
+MESSAGE(STATUS "Library Type: " ${LIB_TYPE})
+MESSAGE(STATUS "Compiler flags: " ${CMAKE_CXX_COMPILE_FLAGS})
+get_directory_property(prop COMPILE_DEFINITIONS)
+MESSAGE(STATUS "Compile definitions: " ${prop})
+get_directory_property(prop COMPILE_OPTIONS)
+MESSAGE(STATUS "Compile options: " ${prop})
+MESSAGE(STATUS "Compiler cxx debug flags: " ${CMAKE_CXX_FLAGS_DEBUG})
+MESSAGE(STATUS "Compiler cxx release flags: " ${CMAKE_CXX_FLAGS_RELEASE})
+MESSAGE(STATUS "Compiler cxx min size flags: " ${CMAKE_CXX_FLAGS_MINSIZEREL})
+MESSAGE(STATUS "Compiler cxx flags: " ${CMAKE_CXX_FLAGS})
diff --git a/3rdparty/portmidi/Doxyfile b/3rdparty/portmidi/Doxyfile
index 0adb6829325..95e37080b97 100644
--- a/3rdparty/portmidi/Doxyfile
+++ b/3rdparty/portmidi/Doxyfile
@@ -1,1472 +1,2682 @@
-# Doxyfile 1.5.5
+# Doxyfile 1.9.2
# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
+# doxygen (www.doxygen.org) for a project.
#
-# All text after a hash (#) is considered a comment and will be ignored
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
+# This tag specifies the encoding used for all characters in the configuration
+# file that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
+# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
PROJECT_NAME = PortMidi
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
-PROJECT_NUMBER = 2.2.x
+PROJECT_BRIEF = "Cross-platform MIDI IO library"
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
-OUTPUT_DIRECTORY = .
+PROJECT_LOGO = portmusic_logo.png
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ../github-portmidi-portmidi_docs
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
CREATE_SUBDIRS = NO
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
-# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
-# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
-# Spanish, Swedish, and Ukrainian.
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
OUTPUT_LANGUAGE = English
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
+# The default value is: YES.
REPEAT_BRIEF = YES
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
# description.
+# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
+# The default value is: NO.
INLINE_INHERITED_MEMB = NO
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
-FULL_PATH_NAMES = NO
+FULL_PATH_NAMES = YES
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-STRIP_FROM_PATH =
+STRIP_FROM_PATH =
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
-STRIP_FROM_INC_PATH =
+STRIP_FROM_INC_PATH =
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
SHORT_NAMES = NO
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
JAVADOC_AUTOBRIEF = YES
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
+# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
+# such as
+# /***************
+# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
+# Javadoc-style will behave just like regular comments and it will not be
+# interpreted by doxygen.
+# The default value is: NO.
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
+JAVADOC_BANNER = NO
-MULTILINE_CPP_IS_BRIEF = NO
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
+QT_AUTOBRIEF = NO
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
-SEPARATE_MEMBER_PAGES = NO
+MULTILINE_CPP_IS_BRIEF = NO
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
+# By default Python docstrings are displayed as preformatted text and doxygen's
+# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
+# doxygen's special commands can be used and the contents of the docstring
+# documentation blocks is shown as doxygen documentation.
+# The default value is: YES.
-TAB_SIZE = 8
+PYTHON_DOCSTRING = YES
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
-ALIASES =
+INHERIT_DOCS = YES
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
-OPTIMIZE_OUTPUT_FOR_C = YES
+SEPARATE_MEMBER_PAGES = NO
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:^^"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". Note that you cannot put \n's in the value part of an alias
+# to insert newlines (in the resulting output). You can put ^^ in the value part
+# of an alias to insert a newline as if a physical newline was in the original
+# file. When you need a literal { or } or , in the value part of an alias you
+# have to escape them by means of a backslash (\), this can lead to conflicts
+# with the commands \{ and \} for these it is advised to use the version @{ and
+# @} or use a double escape (\\{ and \\})
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
+# sources only. Doxygen will then generate output that is more tailored for that
+# language. For instance, namespaces will be presented as modules, types will be
+# separated into more groups, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_SLICE = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
+# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
+# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
+# tries to guess whether the code is fixed or free formatted code, this is the
+# default for Fortran type files). For instance to make doxygen treat .inc files
+# as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen. When specifying no_extension you should add
+# * to the FILE_PATTERNS.
+#
+# Note see also the list of default file extension mappings.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 5.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 5
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
+# The default value is: NO.
CPP_CLI_SUPPORT = NO
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
SIP_SUPPORT = NO
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-# 1.5.7
-#IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
+# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
SUBGROUPING = YES
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-# 1.5.7
-# SYMBOL_CACHE_SIZE = 0
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = YES
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
+# during processing. When set to 0 doxygen will based this on the number of
+# cores available in the system. You can set it explicitly to a value larger
+# than 0 to get more control over the balance between CPU load and processing
+# speed. At this moment only the input processing can be done using multiple
+# threads. Since this is still an experimental feature the default is set to 1,
+# which effectively disables parallel processing. Please report any issues you
+# encounter. Generating dot graphs in parallel is controlled by the
+# DOT_NUM_THREADS setting.
+# Minimum value: 0, maximum value: 32, default value: 1.
+
+NUM_PROC_THREADS = 1
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
EXTRACT_ALL = NO
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
EXTRACT_PRIVATE = NO
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
+# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
+# methods of a class will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIV_VIRTUAL = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
EXTRACT_STATIC = NO
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
-EXTRACT_LOCAL_CLASSES = NO
+EXTRACT_LOCAL_CLASSES = YES
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
+# If this flag is set to YES, the name of an unnamed parameter in a declaration
+# will be determined by the corresponding definition. By default unnamed
+# parameters remain unnamed in the output.
+# The default value is: YES.
+
+RESOLVE_UNNAMED_PARAMS = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# declarations. If set to NO, these declarations will be included in the
# documentation.
+# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
INTERNAL_DOCS = NO
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
+# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
+# able to match the capabilities of the underlying filesystem. In case the
+# filesystem is case sensitive (i.e. it supports files in the same directory
+# whose names only differ in casing), the option must be set to YES to properly
+# deal with such files in case they appear in the input. For filesystems that
+# are not case sensitive the option should be be set to NO to properly deal with
+# output files written for symbols that only differ in casing, such as for two
+# classes, one named CLASS and the other named Class, and to also support
+# references to files without having to specify the exact matching casing. On
+# Windows (including Cygwin) and MacOS, users should typically set this option
+# to NO, whereas on Linux or other Unix flavors it should typically be set to
+# YES.
+# The default value is: system dependent.
-CASE_SENSE_NAMES = YES
+CASE_SENSE_NAMES = NO
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
-HIDE_SCOPE_NAMES = NO
+HIDE_SCOPE_NAMES = YES
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class
+# will show which file needs to be included to use the class.
+# The default value is: YES.
+
+SHOW_HEADERFILE = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
SHOW_INCLUDE_FILES = YES
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
INLINE_INFO = YES
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
SORT_MEMBER_DOCS = YES
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
SORT_BRIEF_DOCS = NO
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
SORT_GROUP_NAMES = NO
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
-ENABLED_SECTIONS =
+ENABLED_SECTIONS =
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
SHOW_USED_FILES = YES
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-# 1.5.7
-# SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page. This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-# 1.5.7
-# SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
-# 1.5.7
-# LAYOUT_FILE =
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file. See also section "Changing the
+# layout of pages" for information.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES =
#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
+# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
-QUIET = YES
+QUIET = NO
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
WARNINGS = YES
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
-WARN_IF_UNDOCUMENTED = NO
+WARN_IF_UNDOCUMENTED = YES
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as documenting some parameters in
+# a documented function twice, or documenting parameters that don't exist or
+# using markup commands wrongly.
+# The default value is: YES.
WARN_IF_DOC_ERROR = YES
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
+# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete
+# function parameter documentation. If set to NO, doxygen will accept that some
+# parameters have no documentation without warning.
+# The default value is: YES.
+
+WARN_IF_INCOMPLETE_DOC = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong parameter
+# documentation, but not about the absence of documentation. If EXTRACT_ALL is
+# set to YES then this flag will automatically be disabled. See also
+# WARN_IF_INCOMPLETE_DOC
+# The default value is: NO.
WARN_NO_PARAMDOC = NO
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
+# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
+# at the end of the doxygen process doxygen will return with a non-zero status.
+# Possible values are: NO, YES and FAIL_ON_WARNINGS.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
-WARN_LOGFILE =
+WARN_LOGFILE =
#---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
-INPUT = \
- pm_common/portmidi.h \
- pm_common/portmidi.c \
+INPUT =pm_common porttime/porttime.h pm_common/pmutil.h
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see:
+# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
+# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS = *.h \
- *.c
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# Note the list of default checked file patterns might differ from the list of
+# default file extension mappings.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
+# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
+# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
+# *.vhdl, *.ucf, *.qsf and *.ice.
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.idl \
+ *.ddl \
+ *.odl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.l \
+ *.cs \
+ *.d \
+ *.php \
+ *.php4 \
+ *.php5 \
+ *.phtml \
+ *.inc \
+ *.m \
+ *.markdown \
+ *.md \
+ *.mm \
+ *.dox \
+ *.py \
+ *.pyw \
+ *.f90 \
+ *.f95 \
+ *.f03 \
+ *.f08 \
+ *.f18 \
+ *.f \
+ *.for \
+ *.vhd \
+ *.vhdl \
+ *.ucf \
+ *.qsf \
+ *.ice
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
EXCLUDE =
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
+# The default value is: NO.
EXCLUDE_SYMLINKS = NO
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
-EXCLUDE_PATTERNS =
+EXCLUDE_PATTERNS =
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
-EXCLUDE_SYMBOLS =
+EXCLUDE_SYMBOLS = TRUE, FALSE, PMEXPORT
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
-EXAMPLE_PATH = ./pm_test
+EXAMPLE_PATH =
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
-EXAMPLE_PATTERNS = *.cxx \
- *.h \
- *.H \
- *.fl
+EXAMPLE_PATTERNS = *
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
EXAMPLE_RECURSIVE = NO
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
-IMAGE_PATH =
+IMAGE_PATH =
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output. If FILTER_PATTERNS is specified, this tag will be
-# ignored.
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+FILTER_PATTERNS =
-INPUT_FILTER =
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
+FILTER_SOURCE_FILES = NO
-FILTER_PATTERNS =
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+FILTER_SOURCE_PATTERNS =
-FILTER_SOURCE_FILES = NO
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
-SOURCE_BROWSER = YES
+SOURCE_BROWSER = NO
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
INLINE_SOURCES = NO
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
STRIP_CODE_COMMENTS = YES
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# entity all documented functions referencing it will be listed.
+# The default value is: NO.
-REFERENCED_BY_RELATION = YES
+REFERENCED_BY_RELATION = NO
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
-REFERENCES_RELATION = YES
+REFERENCES_RELATION = NO
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code. Otherwise they will link to the documentstion.
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see https://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
VERBATIM_HEADERS = YES
+# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
+# clang parser (see:
+# http://clang.llvm.org/) for more accurate parsing at the cost of reduced
+# performance. This can be particularly helpful with template rich C++ code for
+# which doxygen's built-in parser lacks the necessary type information.
+# Note: The availability of this option depends on whether or not doxygen was
+# generated with the -Duse_libclang=ON option for CMake.
+# The default value is: NO.
+
+CLANG_ASSISTED_PARSING = NO
+
+# If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS
+# tag is set to YES then doxygen will add the directory of each input to the
+# include path.
+# The default value is: YES.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_ADD_INC_PATHS = YES
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_OPTIONS =
+
+# If clang assisted parsing is enabled you can provide the clang parser with the
+# path to the directory containing a file called compile_commands.json. This
+# file is the compilation database (see:
+# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the
+# options used when the source files were built. This is equivalent to
+# specifying the -p option to a clang tool, such as clang-check. These options
+# will then be passed to the parser. Any options specified with CLANG_OPTIONS
+# will be added as well.
+# Note: The availability of this option depends on whether or not doxygen was
+# generated with the -Duse_libclang=ON option for CMake.
+
+CLANG_DATABASE_PATH =
+
#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
-COLS_IN_ALPHA_INDEX = 5
+ALPHABETICAL_INDEX = YES
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-IGNORE_PREFIX = Pm_
+IGNORE_PREFIX =
#---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
GENERATE_HTML = YES
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_OUTPUT = html
+HTML_OUTPUT = docs
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a color-wheel, see
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use gray-scales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = NO
+
+# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
+# documentation will contain a main index with vertical navigation menus that
+# are dynamically created via JavaScript. If disabled, the navigation index will
+# consists of multiple levels of tabs that are statically embedded in every HTML
+# page. Disable this option to support browsers that do not have JavaScript,
+# like the Qt help browser.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_MENUS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET = YES
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see:
+# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
+# create a documentation set, doxygen will generate a Makefile in the HTML
+# output directory. Running make will produce the docset in that directory and
+# running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
+# genXcode/_index.html for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# on Windows. In the beginning of 2021 Microsoft took the original page, with
+# a.o. the download links, offline the HTML help workshop was already many years
+# in maintenance mode). You can download the HTML help workshop from the web
+# archives at Installation executable (see:
+# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo
+# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe).
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-CHM_FILE =
+CHM_FILE =
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-HHC_LOCATION =
+HHC_LOCATION =
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the main .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-# 1.5.7
-# CHM_INDEX_ENCODING =
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
-# 1.5.7
-# GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-# 1.5.7
-# QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
-# 1.5.7
-# QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
-# 1.5.7
-# QHP_VIRTUAL_FOLDER = doc
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file .
-# 1.5.7
-# QHG_LOCATION =
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location (absolute path
+# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
+# run qhelpgenerator on the generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine tune the look of the index (see "Fine-tuning the output"). As an
+# example, the default style sheet generated by doxygen has an example that
+# shows how to put an image at the root of the tree instead of the PROJECT_NAME.
+# Since the tree basically has the same information as the tab index, you could
+# consider setting DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = YES
+
+# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
+# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
+# area (value NO) or if it should extend to the full height of the window (value
+# YES). Setting this to YES gives a layout similar to
+# https://docs.readthedocs.io with more room for contents, but less room for the
+# project logo, title, and description. If either GENERATOR_TREEVIEW or
+# DISABLE_INDEX is set to NO, this option has no effect.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FULL_SIDEBAR = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to FRAME, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature. Other possible values
-# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list;
-# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
-# disables this behavior completely. For backwards compatibility with previous
-# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
-# respectively.
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
+# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
+# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
+# the HTML output. These images will generally look nicer at scaled resolutions.
+# Possible values are: png (the default) and svg (looks nicer but requires the
+# pdf2svg or inkscape tool).
+# The default value is: png.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FORMULA_FORMAT = png
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
+# to create new LaTeX commands to be used in formulas as building blocks. See
+# the section "Including formulas" for details.
+
+FORMULA_MACROFILE =
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# https://www.mathjax.org) which uses client side JavaScript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# With MATHJAX_VERSION it is possible to specify the MathJax version to be used.
+# Note that the different versions of MathJax have different requirements with
+# regards to the different settings, so it is possible that also other MathJax
+# settings have to be changed when switching between the different MathJax
+# versions.
+# Possible values are: MathJax_2 and MathJax_3.
+# The default value is: MathJax_2.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_VERSION = MathJax_2
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. For more details about the output format see MathJax
+# version 2 (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3
+# (see:
+# http://docs.mathjax.org/en/latest/web/components/output.html).
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility. This is the name for Mathjax version 2, for MathJax version 3
+# this will be translated into chtml), NativeMML (i.e. MathML. Only supported
+# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This
+# is the name for Mathjax version 3, for MathJax version 2 this will be
+# translated into HTML-CSS) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from https://www.mathjax.org before deployment. The default value is:
+# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2
+# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH =
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# for MathJax version 2 (see https://docs.mathjax.org/en/v2.7-latest/tex.html
+# #tex-and-latex-extensions):
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# For example for MathJax version 3 (see
+# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):
+# MATHJAX_EXTENSIONS = ams
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using JavaScript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
+EXTERNAL_SEARCH = NO
-TREEVIEW_WIDTH = 200
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/). See the section "External Indexing and Searching" for
+# details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-# 1.5.7
-# FORMULA_FONTSIZE = 10
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
-GENERATE_LATEX = YES
+GENERATE_LATEX = NO
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
+# chosen this is overwritten by pdflatex. For specific output languages the
+# default can have been set differently, this depends on the implementation of
+# the output language.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME =
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# Note: This tag is used in the Makefile / make.bat.
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
+# (.tex).
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+# generate index for LaTeX. In case there is no backslash (\) as first character
+# it will be automatically added in the LaTeX code.
+# Note: This tag is used in the generated output file (.tex).
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
+# The default value is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-MAKEINDEX_CMD_NAME = makeindex
+LATEX_MAKEINDEX_CMD = makeindex
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for
+# the generated LaTeX document. The header should contain everything until the
+# first chapter. If it is left blank doxygen will generate a standard header. It
+# is highly recommended to start with a default header using
+# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty
+# and then modify the file new_header.tex. See also section "Doxygen usage" for
+# information on how to generate the default header that doxygen normally uses.
+#
+# Note: Only use a user-defined header if you know what you are doing!
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. The following
+# commands have a special meaning inside the header (and footer): For a
+# description of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for
+# the generated LaTeX document. The footer should contain everything after the
+# last chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer. See also section "Doxygen
+# usage" for information on how to generate the default footer that doxygen
+# normally uses. Note: Only use a user-defined footer if you know what you are
+# doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-PAPER_TYPE = a4wide
+PDF_HYPERLINKS = YES
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
+# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
+# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
+# files. Set this option to YES, to get a higher quality PDF documentation.
+#
+# See also section LATEX_CMD_NAME for selecting the engine.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-EXTRA_PACKAGES =
+USE_PDFLATEX = YES
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_HEADER =
+LATEX_BATCHMODE = NO
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-PDF_HYPERLINKS = YES
+LATEX_HIDE_INDICES = NO
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-USE_PDFLATEX = YES
+LATEX_BIB_STYLE = plain
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_BATCHMODE = YES
+LATEX_TIMESTAMP = NO
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+# path from which the emoji images will be read. If a relative path is entered,
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
+# LATEX_OUTPUT directory will be used.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_HIDE_INDICES = NO
+LATEX_EMOJI_DIRECTORY =
#---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
GENERATE_RTF = NO
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# configuration file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
-RTF_STYLESHEET_FILE =
+RTF_STYLESHEET_FILE =
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's configuration file. A template extensions file can be
+# generated using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
-RTF_EXTENSIONS_FILE =
+RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
GENERATE_MAN = NO
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
GENERATE_XML = NO
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
+# namespace members in file scope as well, matching the HTML output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_NS_MEMB_FILE_SCOPE = NO
-XML_SCHEMA =
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
-XML_DTD =
+GENERATE_DOCBOOK = NO
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-XML_PROGRAMLISTING = YES
+DOCBOOK_OUTPUT = docbook
#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
+# the structure of the code including all documentation. Note that this feature
+# is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
+# Configuration options related to Sqlite3 output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader. This is useful
-# if you want to understand what is going on. On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-PERLMOD_MAKEVAR_PREFIX =
+PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
+# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = NO
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-INCLUDE_PATH =
+INCLUDE_PATH =
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-INCLUDE_FILE_PATTERNS =
+INCLUDE_FILE_PATTERNS =
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED = FL_DOXYGEN \
- HAVE_CAIRO \
- HAVE_GL \
- HAVE_GL_OVERLAY \
- FL_EXPORT:=
+PREDEFINED =
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-EXPAND_AS_DEFINED =
+EXPAND_AS_DEFINED =
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
-# Configuration::additions related to external references
+# Configuration options related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
-TAGFILES =
+TAGFILES =
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
-GENERATE_TAGFILE =
+GENERATE_TAGFILE =
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
ALLEXTERNALS = NO
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
EXTERNAL_GROUPS = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
-PERL_PATH = /usr/bin/perl
+EXTERNAL_PAGES = YES
#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
+# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
+# The default value is: YES.
-CLASS_DIAGRAMS = YES
+CLASS_DIAGRAMS = NO
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
-MSCGEN_PATH =
+DIA_PATH =
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
HAVE_DOT = NO
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-# 1.5.7
-# DOT_FONTNAME = FreeSans
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-# 1.5.7
-# DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag UML_LOOK is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and
+# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS
+# tag is set to YES, doxygen will add type and arguments for attributes and
+# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen
+# will not generate fields with class member information in the UML graphs. The
+# class diagrams will look similar to the default class diagrams but using UML
+# notation for the relationships.
+# Possible values are: NO, YES and NONE.
+# The default value is: NO.
+# This tag requires that the tag UML_LOOK is set to YES.
+
+DOT_UML_DETAILS = NO
+
+# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters
+# to display on a single line. If the actual line length exceeds this threshold
+# significantly it will wrapped across multiple lines. Some heuristics are apply
+# to avoid ugly line breaks.
+# Minimum value: 0, maximum value: 1000, default value: 17.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_WRAP_THRESHOLD = 17
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = NO
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
-DOT_PATH =
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
+PLANTUML_JAR_PATH =
-DOTFILE_DIRS =
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+PLANTUML_CFG_FILE =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
+# files that are used to generate the various graphs.
+#
+# Note: This setting is not only used for dot files but also for msc temporary
+# files.
+# The default value is: YES.
DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE = NO
diff --git a/3rdparty/portmidi/README.md b/3rdparty/portmidi/README.md
new file mode 100644
index 00000000000..f8cb9106a81
--- /dev/null
+++ b/3rdparty/portmidi/README.md
@@ -0,0 +1,104 @@
+# PortMidi - Cross-Platform MIDI IO
+
+This is the canonical release of PortMidi.
+
+See other repositories within [PortMidi](https://github.com/PortMidi)
+for related code and bindings (although currently, not much is here).
+
+## [Full C API documentation is here.](https://portmidi.github.io/portmidi_docs/)
+
+## Compiling and Using PortMidi
+
+Use CMake (or ccmake) to create a Makefile for Linux/BSD or a
+project file for Xcode or MS Visual Studio. Use make or an IDE to compile:
+```
+cd portmidi # start in the top-level portmidi directory
+ccmake . # set any options interactively, type c to configure
+ # type g to generate a Makefile or IDE project
+ # type q to quit
+ # (alternatively, run the CMake GUI and use
+ # Configure and Generate buttons to build IDE project)
+make # compile sources and build PortMidi library
+ # (alternatively, open project file with your IDE)
+sudo make install # if you want to install to your system
+```
+
+**PmDefaults** is a Java-based program for setting default MIDI
+devices. It is necessary if you use `Pm_DefaultInputDeviceID()` or
+`Pm_DefaultOutputDeviceID()` to avoid implementing your own device
+browsing, selection and preferences in your applications. Enable
+`BUILD_PMDEFAULTS` and `BUILD_JAVA_NATIVE_INTERFACE` in ccmake, and
+see `pm_java/README.txt` for more information.
+
+See also notes in `pm_mac/README_MAC.txt`, `pm_win/README_WIN.txt` and
+`pm_linux/README_LINUX.txt`.
+
+## What's New?
+
+PortMidi has some fixes for Apple M1 cpus as of May 23, 2022. This has not yet
+been formally released to allow for further testing, but please use the latest
+code if you want to run on an M1.
+
+PortMidi has some changes in 2021:
+
+ - added Pm_CreateVirtualInput() and Pm_CreateVirtualOutput() functions that allow
+ applications to create named ports analogous to devices.
+
+ - improvements for macOS CoreMIDI include higher data rates for devices, better
+ handling of Unicode interface names in addition to virtual device creation.
+
+ - the notion of default devices, Pm_GetDefaultInputDeviceID(),
+ Pm_GetDefaultOutputDeviceID and the PmDefaults program have fallen into disuse
+ and are now deprecated.
+
+ - Native Interfaces for Python, Java, Go, Rust, Lua and more seem best left
+ to individual repos, so support within this repo has been dropped. A Java
+ interface is still here and probably usable -- let me know if you need it
+ and/or would like to help bring it up to date. I am happy to help with,
+ link to, or collaborate in supporting PortMidi for other languages.
+
+For up-to-date PortMidi for languages other than C/C++, check with
+developers. As of 27 Sep 2021, this (and SourceForge) is the only repo with
+the features described above.
+
+# Other Repositories
+
+PortMidi used to be part of the PortMedia suite, but this repo has been reduced to
+mostly just C/C++ code for PortMidi. You will find some other repositories in this PortMidi project
+set up for language bindings (volunteers and contributors are invited!). Other code removed from
+previous releases of PortMedia include:
+
+## PortSMF
+
+A Standard MIDI File (SMF) (and more) library is in the [portsmf repository](https://github.com/PortMidi/portsmf).
+
+PortSMF is a library for reading/writing/editing Standard MIDI Files. It is
+actually much more, with a general representation of events and updates with
+properties consisting of attributes and typed values. Familiar properties of
+pitch, time, duration, and channel are built into events and updates to make
+them faster to access and more compact.
+
+To my knowledge, PortSMF has the most complete and useful handling of MIDI
+tempo tracks. E.g., you can edit notes according to either beat or time, and
+you can edit tempo tracks, for example, flattening the tempo while preserving
+the beat alignment, preserving the real time while changing the tempo or
+stretching the tempo over some interval.
+
+In addition to Standard MIDI Files, PortSMF supports an ASCII representation
+called Allegro. PortSMF and Allegro are used for Audacity Note Tracks.
+
+## scorealign
+
+Scorealign used to be part of the PortMedia suite. It is now at the [scorealign repository](https://github.com/rbdannenberg/scorealign).
+
+Scorealign aligns
+audio-to-audio, audio-to-MIDI or MIDI-to-MIDI using dynamic time warping (DTW)
+of a computed chromagram representation. There are some added smoothing tricks
+to improve performance. This library is written in C and runs substantially
+faster than most other implementations, especially those written in MATLAB,
+due to the core DTW algorithm. Users should be warned that while chromagrams
+are robust features for alignment, they achieve robustness by operating at
+fairly high granularity, e.g., durations of around 100ms, which limits
+time precision. Other more recent algorithms can doubtless do better, but
+be cautious of claims, since it all depends on what assumptions you can
+make about the music.
diff --git a/3rdparty/portmidi/README.txt b/3rdparty/portmidi/README.txt
index 18d951e5f19..aa18b19f8d5 100644
--- a/3rdparty/portmidi/README.txt
+++ b/3rdparty/portmidi/README.txt
@@ -2,19 +2,16 @@ README for PortMidi
Roger B. Dannenberg
-VERSION: please use "svn info" to get info.
-
Documentation for PortMidi is found in pm_common/portmidi.h.
+Documentation in HTML is available at portmidi.github.io/portmidi_docs/
Additional documentation:
+ - README.md (overview, how to build, what's new)
- Windows: see pm_win/README_WIN.txt and pm_win/debugging_dlls.txt
- Linux: see pm_linux/README_LINUX.txt
- Mac OSX: see pm_mac/README_MAC.txt
- - Common Lisp: see pm_cl/README_CL.txt
- - Eclipse: see portmidi_cdt.zip (this was contributed as is; the dlls here
- are now -- Sep 09 -- out of date. What is really needed is a script
- to generate this release automatically so we can maintain it.)
- - C-Sharp: see pm_csharp.zip (also contributed as is)
+ - Other Languages: look for other repos at github.com/PortMidi,
+ and search README.md for pointers to other projects.
---------- some notes on the design of PortMidi ----------
@@ -82,3 +79,10 @@ abruptly terminate the program.
The Windows version (and perhaps others) also offers a DEBUG
compile-time option. See README_WIN.txt.
+
+RELEASE
+
+To make a new release, update VERSION variable in CMakeLists.txt.
+
+Update CHANGELOG.txt. What's new?
+
diff --git a/3rdparty/portmidi/ZERO_CHECK.vcproj b/3rdparty/portmidi/ZERO_CHECK.vcproj
deleted file mode 100644
index fb17304e882..00000000000
--- a/3rdparty/portmidi/ZERO_CHECK.vcproj
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="ZERO_CHECK"
- ProjectGUID="{28779535-7541-4FF5-AC12-FAFD66E894EC}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="ZERO_CHECK.dir\Debug"
- ConfigurationType="10"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".\pm_common;.\porttime;"
- ExceptionHandling="0"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=".\pm_common;.\porttime;"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="ZERO_CHECK.dir\Release"
- ConfigurationType="10"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".\pm_common;.\porttime;"
- ExceptionHandling="0"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=".\pm_common;.\porttime;"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <File
- RelativePath=".\CMakeFiles\ZERO_CHECK">
- </File>
- <Filter
- Name="CMake Rules"
- Filter="">
- <File
- RelativePath=".\CMakeFiles\ZERO_CHECK.rule">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description=""
- CommandLine=""
- AdditionalDependencies=".\CMakeFiles\ZERO_CHECK.rule"
- Outputs=".\CMakeFiles\ZERO_CHECK"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description=""
- CommandLine=""
- AdditionalDependencies=".\CMakeFiles\ZERO_CHECK.rule"
- Outputs=".\CMakeFiles\ZERO_CHECK"/>
- </FileConfiguration>
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/packaging/PortMidiConfig.cmake.in b/3rdparty/portmidi/packaging/PortMidiConfig.cmake.in
new file mode 100644
index 00000000000..a04928a835d
--- /dev/null
+++ b/3rdparty/portmidi/packaging/PortMidiConfig.cmake.in
@@ -0,0 +1,10 @@
+@PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+if(UNIX AND NOT APPLE AND NOT HAIKU AND (@LINUX_DEFINES@ MATCHES ".*PMALSA.*"))
+ find_dependency(ALSA)
+endif()
+
+include("${CMAKE_CURRENT_LIST_DIR}/PortMidiTargets.cmake")
+
+check_required_components(PortMidi)
diff --git a/3rdparty/portmidi/packaging/portmidi.pc.in b/3rdparty/portmidi/packaging/portmidi.pc.in
new file mode 100644
index 00000000000..bc608284b76
--- /dev/null
+++ b/3rdparty/portmidi/packaging/portmidi.pc.in
@@ -0,0 +1,11 @@
+prefix="@CMAKE_INSTALL_PREFIX@"
+exec_prefix="${prefix}"
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+
+Name: @CMAKE_PROJECT_NAME@
+Description: @CMAKE_PROJECT_DESCRIPTION@
+Version: @CMAKE_PROJECT_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -l@CMAKE_PROJECT_NAME@
+Requires.private: @PKGCONFIG_REQUIRES_PRIVATE@
diff --git a/3rdparty/portmidi/pm_cl/README_CL.txt b/3rdparty/portmidi/pm_cl/README_CL.txt
deleted file mode 100644
index be4c63591f6..00000000000
--- a/3rdparty/portmidi/pm_cl/README_CL.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-README_CL.txt for PortMidi
-Roger B. Dannenberg
-17 Jan 2007
-
-This is a Common Lisp interface to PortMidi.
-
-On Mac OSX, you need to build PortMidi as a dynamic link library
-before you can use PortMidi from Common Lisp.
-
-You can build PortMidi as a dynamic link library by running this:
-
-cd portmidi
-make -F pm_mac/Makefile.osx install-with-xcode
-
-This is just a shortcut for:
-
-cd portmidi/pm_mac
-sudo xcodebuild -project pm_mac.xcodeproj -configuration Deployment install DSTROOT=/
-
-You can check the file and the architecture for which it is built using:
- file /usr/local/lib/libportmidi.dylib
-
-If you've done this install of portmidi, then you should also have
- /usr/local/include/portmidi.h
-This will be necessary to successfully build the cffi interface below.
-
-To test PortMidi with Common Lisp, I (RBD) am using SBCL, which I
-downloaded from http://prdownloads.sourceforge.net/sbcl. Currently, I use
- sbcl-0.9.17-x86-darwin-binary.tar.bz2
-To install this, I unpacked it by just double-clicking in the finder. Then,
-from a command window, I became root using "sudo sh", and then typed:
-# INSTALL_ROOT=/usr/local
-# sh install.sh
-# exit
-
-I also downloaded cffi-061012.tar.gz from
- http://common-lisp.net/project/cffi/tarballs/?M=D
-
-To compile cffi, use the following, where "/Lisp/cffi/" is replaced by
-the actual directory of cffi, e.g.
- "/Users/rbd/sbcl-0.9.17-x86-darwin/cffi-061012":
-
-% sbcl
-* (require 'asdf)
-* (push "/Lisp/cffi/" asdf:*central-registry*)
-* (asdf:oos 'asdf:load-op :cffi)
-* (quit)
-
-Download Common Music's portmidi module from cvs and build the c side:
-(Replace "/Lisp" with your lisp directory, e.g.
-"/Users/rbd/sbcl-0.9.17-x86-darwin". These cvs commands will create
-a new directory, portmidi.)
-
-% cd /Lisp
-% export CVSROOT=:pserver:anonymous@commonmusic.cvs.sourceforge.net:/cvsroot/commonmusic
-% cvs login # press Return at password prompt
-% cvs checkout portmidi
-% cd portmidi
-% ./configure
-% make
-% cd ..
-
-Now compile/load the portmidi module just like cffi. Again, change
-"/Lisp/cffi/" and "/Lisp/portmidi" to correspond to your local file system.
-(Note that /Lisp becomes your lisp directory, and "cffi" becomes your
-cffi folder name, e.g. "cffi-061012".
-
-% sbcl
-* (require 'asdf)
-* (push "/Lisp/cffi/" asdf:*central-registry*)
-* (asdf:oos 'asdf:load-op :cffi)
-* (push "/Lisp/portmidi/" asdf:*central-registry*)
-* (asdf:oos 'asdf:load-op :portmidi)
-
-Look in the file /Lisp/portmidi/test.lisp for a test of the lisp interface to
-portmidi. For example, while still running sbcl:
-
-* (pm:portmidi) ; initialize portmidi
-* (pt:start) ; start time
-* (pt:time) ; get time
-* (pprint (pm:GetDeviceInfo)) ; get list of devices
-((:ID 0 :NAME "IAC Driver Bus 1" :TYPE :INPUT :OPEN NIL)
- (:ID 1 :NAME "IAC Driver Bus 1" :TYPE :OUTPUT :OPEN NIL))
-
-Notice that test.lisp assumes MIDI input devices are connected
-and uses some hard-wired device numbers, so it may not run
-as is without error.
-
-Since test.lisp uses some Common Music calls, I (RBD) wrote a
-simpler test, test-no-cm.lisp, which is in the same folder as
-this (README_CL.txt) file. To use it, first check that the
-values for outid (4) and inid (1) actually match PortMidi device
-id's for output and input devices, and make sure the input
-device is a keyboard that can generate a middle-C -- otherwise
-the program will hang waiting for input. Run sbcl from this
-pm_cl folder, and type:
-
-(load "test-no-cm.lisp")
-
-The program pauses frequently by calling (READ), so you
-should type t or something, then <RETURN> to continue.
-
-
-(Thanks to Leigh Smith and Rick Taube)
diff --git a/3rdparty/portmidi/pm_cl/cffi-portmidi.lisp b/3rdparty/portmidi/pm_cl/cffi-portmidi.lisp
deleted file mode 100644
index 4b3ad9c3e00..00000000000
--- a/3rdparty/portmidi/pm_cl/cffi-portmidi.lisp
+++ /dev/null
@@ -1,384 +0,0 @@
-;;; **********************************************************************
-;;; Copyright (C) 2005 Heinrich Taube, <taube (at) uiuc (dot) edu>
-;;;
-;;; This program is free software; you can redistribute it and/or
-;;; modify it under the terms of the Lisp Lesser Gnu Public License.
-;;; See http://www.cliki.net/LLGPL for the text of this agreement.
-;;; **********************************************************************
-
-
-;;; A CFFI interface to Portmidi. Should run in most Common Lisp
-;;; implementations on Linux, OS X and Windows. For information about
-;;; CFFI see http://common-lisp.net/project/cffi/
-
-(in-package :cl-user)
-
-(defvar *libportmidi*
- (let ((type #+(or darwin macos macosx) "dylib"
- #+(or linux linux-target (and unix pc386) freebsd) "so"
- #+(or win32 microsoft-32 cygwin) "dll")
- (paths (list "/usr/lib/" "/usr/local/lib/" *load-pathname*)))
- (loop for d in paths
- for p = (make-pathname :name "libportmidi" :type type
- :defaults d)
- when (probe-file p) do (return p)
- finally
- (error "Library \"portmidi.~A\" not found. Fix *libportmidi*."
- type))))
-
-;;; linux: guess i need to load porttime.so first (?) osx doesnt seem
-;;; to need this lib at all...
-
-#+(or linux (and clisp unix (not macos)))
-(let ((lpt (merge-pathnames "libporttime" *libportmidi*)))
- (if (probe-file lpt)
- (cffi:load-foreign-library lpt)
- (error "Porttime: ~a not found. Fix *libportmidi* path." lpt)))
-
-;;; load portmidi lib
-
-(cffi:load-foreign-library *libportmidi*)
-
-(defpackage :portmidi
- (:use :common-lisp)
- (:nicknames :pm :pt)
- (:shadow :initialize :terminate :time :start :stop :abort
- :close :read :write :poll)
- (:export :Initialize :Terminate
- :HasHostError :GetErrorText :GetHostErrorText
- :CountDevices :GetDefaultInputDeviceID
- :GetDefaultOutputDeviceID :GetDeviceInfo
- :Message :Message.status :Message.data1 :Message.data2
- :Event.message :Event.timestamp
- ;; event buffers added to api
- :EventBufferNew :EventBufferFree :EventBufferElt
- :EventBufferMap
- :OpenInput :OpenOutput :SetFilter :SetChannelMask
- :Abort :Close :Read :Write :Poll :WriteShort :WriteSysex
- ;; filtering constants
- :filt-active :filt-sysex :filt-clock :filt-play :filt-f9
- :filt-fd :filt-reset :filt-note :filt-channel-aftertouch
- :filt-poly-aftertouch :filt-program :filt-control
- :filt-pitchbend :filt-mtc :filt-song-position
- :filt-song-select :filt-tune :filt-tick :filt-undefined
- :filt-realtime :filt-aftertouch :filt-systemcommon
- ;; porttime.
- :Start :Stop :Started :Time
- ;; initialization insurers added to api
- :portmidi :*portmidi* ))
-
-(in-package :portmidi)
-
-(cffi:defcstruct pm-device-info
- (struct-version :int)
- (interf :pointer)
- (name :pointer)
- (input :int)
- (output :int)
- (opened :int))
-
-(cffi:define-foreign-type pm-message () ':long)
-(cffi:define-foreign-type pm-timestamp () ':long)
-(cffi:defcstruct pm-event
- (message pm-message)
- (timestamp pm-timestamp))
-(cffi:define-foreign-type pm-error () ':int)
-
-(cffi:define-foreign-type port-midi-stream () ':void)
-(cffi:define-foreign-type pm-device-id () ':int)
-(cffi:define-foreign-type pm-time-proc-ptr () ':pointer)
-(cffi:defcfun ("Pm_WriteSysEx" pm-write-sys-ex) pm-error (stream :pointer) (when pm-timestamp) (msg :pointer))
-(cffi:defcfun ("Pm_WriteShort" pm-write-short) pm-error (stream :pointer) (when pm-timestamp) (msg :long))
-(cffi:defcfun ("Pm_Write" pm-write) pm-error (stream :pointer) (buffer :pointer) (length :long))
-(cffi:defcfun ("Pm_Poll" pm-poll) pm-error (stream :pointer))
-(cffi:defcfun ("Pm_Read" pm-read) pm-error (stream :pointer) (buffer :pointer) (length :long))
-(cffi:defcfun ("Pm_Close" pm-close) pm-error (stream :pointer))
-(cffi:defcfun ("Pm_Abort" pm-abort) pm-error (stream :pointer))
-;(cffi:defcfun ("Pm_SetChannelMask" pm-set-channel-mask) pm-error (stream :pointer) (mask :int))
-(cffi:defcfun ("Pm_SetFilter" pm-set-filter) pm-error (stream :pointer) (filters :long))
-(cffi:defcfun ("Pm_OpenOutput" pm-open-output) pm-error (stream :pointer) (output-device pm-device-id) (output-driver-info :pointer) (buffer-size :long) (time-proc pm-time-proc-ptr) (time-info :pointer) (latency :long))
-(cffi:defcfun ("Pm_OpenInput" pm-open-input) pm-error (stream :pointer) (input-device pm-device-id) (input-driver-info :pointer) (buffer-size :long) (time-proc pm-time-proc-ptr) (time-info :pointer))
-(cffi:defcfun ("Pm_GetDeviceInfo" pm-get-device-info) :pointer (id pm-device-id))
-(cffi:defcfun ("Pm_GetDefaultOutputDeviceID" pm-get-default-output-device-id) pm-device-id)
-(cffi:defcfun ("Pm_GetDefaultInputDeviceID" pm-get-default-input-device-id) pm-device-id)
-(cffi:defcfun ("Pm_CountDevices" pm-count-devices) :int)
-(cffi:defcfun ("Pm_GetHostErrorText" pm-get-host-error-text) :void (msg :pointer) (len :unsigned-int))
-(cffi:defcfun ("Pm_GetErrorText" pm-get-error-text) :pointer (errnum pm-error))
-(cffi:defcfun ("Pm_HasHostError" pm-has-host-error) :int (stream :pointer))
-(cffi:defcfun ("Pm_Terminate" pm-terminate) pm-error)
-(cffi:defcfun ("Pm_Initialize" pm-initialize) pm-error)
-
-;;; porttime.h
-
-(cffi:define-foreign-type pt-error () ':int)
-(cffi:define-foreign-type pt-timestamp () ':long)
-(cffi:defcfun ("Pt_Start" pt-start) pt-error (a :int) (b :pointer) (c :pointer))
-(cffi:defcfun ("Pt_Stop" pt-stop) pt-error )
-(cffi:defcfun ("Pt_Started" pt-started) :int)
-(cffi:defcfun ("Pt_Time" pt-time) pt-timestamp)
-
-(defconstant true 1)
-(defconstant false 0)
-(defconstant pmNoError 0)
-(defconstant pmHostError -10000)
-(defconstant pm-no-device -1)
-(defconstant pm-default-sysex-buffer-size 1024)
-(defconstant filt-active 1)
-(defconstant filt-sysex 2)
-(defconstant filt-clock 4)
-(defconstant filt-play 8)
-(defconstant filt-f9 16)
-(defconstant filt-fd 32)
-(defconstant filt-reset 64)
-(defconstant filt-note 128)
-(defconstant filt-channel-aftertouch 256)
-(defconstant filt-poly-aftertouch 512)
-(defconstant filt-program 1024)
-(defconstant filt-control 2048)
-(defconstant filt-pitchbend 4096)
-(defconstant filt-mtc 8192)
-(defconstant filt-song-position 16384)
-(defconstant filt-song-select 32768)
-(defconstant filt-tune 65536)
-(defconstant filt-tick filt-f9)
-(defconstant filt-undefined (logior filt-f9 filt-fd))
-(defconstant filt-realtime (logior filt-active filt-sysex
- filt-clock filt-play
- filt-undefined filt-reset))
-(defconstant filt-aftertouch (logior filt-channel-aftertouch
- filt-poly-aftertouch ))
-(defconstant filt-systemcommon (logior filt-mtc filt-song-position
- filt-song-select filt-tune))
-(defvar *portmidi* nil) ; t if loaded
-
-;;;
-;;; utils
-;;;
-
-(defvar host-error-text (make-string 256 :initial-element #\*))
-
-(defmacro with-pm-error (form)
- (let ((v (gensym)))
- `(let ((,v ,form))
- (if (not (= ,v pmNoError))
- (if (= ,v pmHostError)
- (cffi:with-foreign-string (host-error host-error-text)
- (pm-get-host-error-text host-error
- (length host-error-text))
- (error "Host error is: ~a"
- (cffi:foreign-string-to-lisp host-error)))
- (error (cffi:foreign-string-to-lisp
- (pm-get-error-text ,v))))
- ,v))))
-
-(defun portmidi ()
- ;; initializer, call before using lib
- (or *portmidi*
- (progn (pm-initialize)
- (setq *portmidi* t))))
-
-(defun Message (status data1 data2)
- ;; portmidi messages are just unsigneds
- (logior (logand (ash data2 16) #xFF0000)
- (logand (ash data1 08) #xFF00)
- (logand status #xFF)))
-
-(defun Message.status (m)
- (logand m #xFF))
-
-(defun Message.data1 (m)
- (logand (ash m -08) #xFF))
-
-(defun Message.data2 (m)
- (logand (ash m -16) #xFF))
-
-;;; accessors
-
-(defun DeviceInfo.interf (ptr)
- (cffi:foreign-string-to-lisp
- (cffi:foreign-slot-value ptr 'pm-device-info 'interf)))
-
-(defun DeviceInfo.name (ptr)
- (cffi:foreign-string-to-lisp
- (cffi:foreign-slot-value ptr 'pm-device-info 'name)))
-
-(defun DeviceInfo.input (ptr)
- (if (= (cffi:foreign-slot-value ptr 'pm-device-info 'input) 0)
- nil
- t))
-
-(defun DeviceInfo.output (ptr)
- (if (= (cffi:foreign-slot-value ptr 'pm-device-info 'output) 0)
- nil
- t))
-
-(defun DeviceInfo.opened (ptr)
- (if (= (cffi:foreign-slot-value ptr 'pm-device-info 'opened) 0)
- nil
- t))
-
-(defun Event.message (e &optional (v nil vp))
- (if vp
- (progn
- (setf (cffi:foreign-slot-value e 'pm-event 'message) v)
- v)
- (cffi:foreign-slot-value e 'pm-event 'message)))
-
-(defun Event.timestamp (e &optional (v nil vp))
- (if vp
- (progn
- (setf (cffi:foreign-slot-value e 'pm-event 'timestamp) v)
- v)
- (cffi:foreign-slot-value e 'pm-event 'timestamp)))
-
-;;; functions
-
-(defun Initialize ()
- (with-pm-error (pm-initialize)))
-
-(defun terminate ()
- (with-pm-error (pm-terminate)))
-
-
-(defun HasHostError (pms)
- (pm-has-host-error pms))
-
-(defun GetErrorText (err)
- (pm-get-error-text err))
-
-; how do i do this?
-;(progn
-; (defalien "pm-GetHostErrorText" void (a c-string) (b unsigned-int))
-; (defun GetHostErrorText ()
-; (pm-GetHostErrorText 256)))
-
-(defun CountDevices ()
- (portmidi)
- (pm-count-devices ))
-
-(defun GetDefaultInputDeviceID ()
- (let ((id (pm-get-default-input-device-id )))
- (if (= id pm-no-device) nil id)))
-
-(defun GetDefaultOutputDeviceID ()
- (let ((id (pm-get-default-output-device-id )))
- (if (= id pm-no-device) nil id)))
-
-;replaced by lispy version end of file.
-;(defun GetDeviceInfo (id) (pm-get-device-info id))
-
-(defun OpenInput (device bufsiz)
- ;; portmidi: timer must be running before opening
- (unless (Started) (Start))
- (cffi:with-foreign-object (p1 :pointer)
- (let ((err (pm-open-input p1 device (cffi:null-pointer)
- bufsiz (cffi:null-pointer) (cffi:null-pointer))))
- (if (= err pmNoError)
- (cffi:mem-ref p1 :pointer)
- (error (pm-get-error-text err))))))
-
-(defun OpenOutput (device bufsiz latency)
- (unless (Started) (Start))
- (cffi:with-foreign-object (p1 :pointer) ;(p (* PortMidi))
- (let ((err (pm-open-output p1 device (cffi:null-pointer)
- bufsiz (cffi:null-pointer) (cffi:null-pointer)
- latency)))
- (if (= err pmNoError)
- (cffi:mem-ref p1 :pointer)
- (error (pm-get-error-text err))))))
-
-(defun SetFilter (a filts)
- (with-pm-error
- (pm-set-filter a filts)))
-
-;(defun SetChannelMask (pms mask)
-; (with-pm-error (pm-set-channel-mask pms mask)))
-
-(defun Abort (pms)
- (with-pm-error (pm-abort pms)))
-
-(defun Close (pms)
- (with-pm-error (pm-close pms)))
-
-(defun EventBufferFree (buf)
- (cffi:foreign-free buf))
-
-(defun EventBufferNew (len)
- (cffi:foreign-alloc 'pm-event :count len))
-
-(defun EventBufferElt (buf i)
- ;; buf is POINTER to buf
- (cffi:mem-aref buf 'pm-event i))
-
-(defun EventBufferSet (buffer index timestamp message)
- (setf (cffi:foreign-slot-value
- (cffi:mem-aref buffer 'pm-event index) 'pm-event 'timestamp)
- timestamp)
- (setf (cffi:foreign-slot-value
- (cffi:mem-aref buffer 'pm-event index) 'pm-event 'message)
- message)
- (values))
-
-(defun EventBufferMap (fn buf end)
- (loop for i below end
- for e = (EventBufferElt buf i)
- do (funcall fn (Event.message e) (Event.timestamp e)))
- (values))
-
-(defun Read (pms *evbuf len)
- (let ((res (pm-read pms *evbuf len)))
- (if (< res 0)
- (error (pm-get-error-text res))
- res)))
-
-(defun Poll (pms)
- (let ((res (pm-poll pms)))
- (cond ((= res 0) nil)
- ((= res 1) t)
- (t (error (pm-get-error-text res))))))
-
-(defun Write (pms *evbuf len)
- (with-pm-error (pm-write pms *evbuf len)))
-
-(defun WriteShort (pms when msg)
- (with-pm-error (pm-write-short pms when msg)))
-
-(defun WriteSysex (pms when string)
- (cffi:with-foreign-string (ptr string)
- (with-pm-error (pm-write-sys-ex pms when ptr))))
-
-;;; porttime.h
-
-(defun Started ()
- (let ((res (pt-started)))
- (if (= res false) nil t)))
-
-(defun Start ()
- ;; NB: This has to be called before opening output or input.
- ;; it seems that if its called 2x we get an error.
- (unless (Started)
- (with-pm-error (pt-start 1 (cffi:null-pointer) (cffi:null-pointer))))
- (values))
-
-(defun Stop ()
- (when (Started)
- (with-pm-error (pt-stop)))
- (values))
-
-(defun Time ()
- (pt-time))
-
-(defun GetDeviceInfo (&optional id)
- (flet ((getone (id)
- (let ((d (pm-get-device-info id)))
- (list :id id
- :name (DeviceInfo.name d)
- :type (if (DeviceInfo.input d) ':input ':output)
- :open (DeviceInfo.opened d)))))
- ;; make sure lib is initialized before checking devices
- (portmidi)
- (if id (getone id)
- (loop for i below (CountDevices)
- collect (getone i)))))
-
-(pushnew ':portmidi *features*)
diff --git a/3rdparty/portmidi/pm_cl/test-no-cm.lisp b/3rdparty/portmidi/pm_cl/test-no-cm.lisp
deleted file mode 100644
index fd8527e6298..00000000000
--- a/3rdparty/portmidi/pm_cl/test-no-cm.lisp
+++ /dev/null
@@ -1,112 +0,0 @@
-;; this is a half-baked sequence of PortMidi calls to test the interface
-;; No calls to Common Music are made, hence test-no-cm.lisp
-
-; setup cffi if it has not been done already
-(if (not (boundp '*clpath*))
- (load "setup-pm.lisp"))
-
-(defun println (s) (print s) (terpri))
-
-;; initialize portmidi lib
-(pm:portmidi)
-;; timer testing
-(pt:Start )
-(pt:Started)
-(format t "time is ~A, type something~%" (pt:Time))
-(read)
-(format t "time is ~A, type something~%" (pt:Time))
-(read)
-(pt:Time)
-(format t "time is ~A, type something~%" (pt:Time))
-
-;; device testing
-(pm:CountDevices)
-(pprint (pm:GetDeviceInfo ))
-(defparameter inid (pm:GetDefaultInputDeviceID ))
-(pm:GetDeviceInfo inid)
-(defparameter outid (pm:GetDefaultOutputDeviceID ))
-(pm:GetDeviceInfo outid)
-;; output testing
-(defparameter outid 4) ; 4 = my SimpleSynth
-(defparameter outdev (pm:OpenOutput outid 100 1000))
-(pm:getDeviceInfo outid) ; :OPEN should be T
-;; message tests
-(defun pm (m &optional (s t))
- (format s "#<message :op ~2,'0x :ch ~2,'0d :data1 ~3,'0d :data2 ~3,'0d>"
- (ash (logand (pm:Message.status m) #xf0) -4)
- (logand (pm:Message.status m) #x0f)
- (pm:Message.data1 m)
- (pm:Message.data2 m)))
-(defparameter on (pm:message #b10010000 60 64))
-(terpri)
-(pm on)
-(pm:Message.status on)
-(logand (ash (pm:Message.status on) -4) #x0f)
-(pm:Message.data1 on)
-(pm:Message.data2 on)
-(pm:WriteShort outdev (+ (pm:time) 100) on)
-(defparameter off (pm:message #b10000000 60 64))
-(terpri)
-(pm off)
-(terpri)
-(println "type something for note off")
-(read)
-(pm:WriteShort outdev (+ (pm:time) 100) off)
-(println "type something to close output device")
-(read)
-(pm:Close outdev)
-;; event buffer testing
-(defparameter buff (pm:EventBufferNew 8))
-(loop for i below 8 for x = (pm:EventBufferElt buff i)
- ;; set buffer events
- do
- (pm:Event.message x (pm:message #b1001000 (+ 60 i) (+ 100 i)))
- (pm:Event.timestamp x (* 1000 i)))
-(loop for i below 8 for x = (pm:EventBufferElt buff i)
- ;; check buffer contents
- collect (list (pm:Event.timestamp x)
- (pm:Message.data1 (pm:Event.message x))
- (pm:Message.data2 (pm:Event.message x))))
-(pm:EventBufferFree buff)
-;; input testing -- requires external midi keyboard
-(println (pm:GetDeviceInfo ))
-(defparameter inid 1) ; 1 = my external keyboard
-(defparameter indev (pm:OpenInput inid 256))
-(pm:GetDeviceInfo inid) ; :OPEN should be T
-(pm:SetFilter indev pm:filt-realtime) ; ignore active sensing etc.
-(println "poll says:")
-(println (pm:Poll indev))
-(println "play midi keyboard and type something")
-(read)
-;;
-;; ...play midi keyboard, then ...
-;;
-(println "poll says")
-(println (pm:Poll indev))
-(defparameter buff (pm:EventBufferNew 32))
-(defparameter num (pm:Read indev buff 32))
-(println "pm:Read gets")
-(println num)
-(println "input messages:")
-(pm:EventBufferMap (lambda (a b) b (terpri) (pm a))
- buff num)
-(pm:Poll indev)
-
-(println "play keyboard, to stop, play middle-C")
-
-;;; recv testing
-
-(defparameter pitch 0)
-(loop while (/= pitch 60) do
- (let ((n (pm:Read indev buff 1)))
- (cond ((= n 1)
- (pm:EventBufferMap
- (lambda (a b)
- b (pm a) (terpri)
- (setf pitch (pm:Message.data1 a)))
- buff n)))))
-
-(pm:EventBufferFree buff)
-(pm:Close indev)
-
-
diff --git a/3rdparty/portmidi/pm_common/CMakeLists.txt b/3rdparty/portmidi/pm_common/CMakeLists.txt
index e1710474ae3..062887bc111 100644
--- a/3rdparty/portmidi/pm_common/CMakeLists.txt
+++ b/3rdparty/portmidi/pm_common/CMakeLists.txt
@@ -1,32 +1,69 @@
-# pm_common
+# pm_common/CMakeLists.txt -- how to build portmidi library
+
+# creates the portmidi library
+# exports PM_NEEDED_LIBS to parent. It seems that PM_NEEDED_LIBS for
+# Linux should include Thread::Thread and ALSA::ALSA, but these
+# are not visible in other CMake files, even though the portmidi
+# target is. Therefore, Thread::Thread is replaced by
+# CMAKE_THREAD_LIBS_INIT and ALSA::ALSA is replaced by ALSA_LIBRARIES.
+# Is there a better way to do this? Maybe this whole file should be
+# at the parent level.
+
+# Support alternative name for static libraries to avoid confusion.
+# (In particular, Xcode has automatically converted portmidi.a to
+# portmidi.dylib without warning, so using portmidi-static.a eliminates
+# this possibility, but default for all libs is "portmidi"):
+set(PM_STATIC_LIB_NAME "portmidi" CACHE STRING
+ "For static builds, the PortMidi library name, e.g. portmidi-static.
+ Default is portmidi")
+set(PM_ACTUAL_LIB_NAME "portmidi")
+if(NOT BUILD_SHARED_LIBS)
+ set(PM_ACTUAL_LIB_NAME ${PM_STATIC_LIB_NAME})
+endif()
# set the build directory for libportmidi.a to be in portmidi, not in
-# portmidi/pm_common
+# portmidi/pm_common. Must be done here BEFORE add_library below.
if(APPLE OR WIN32)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
# set the build directory for .dylib libraries
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
-
- # the first time CMake configures, save off CMake's built-in flags
- if(NOT DEFAULT_DEBUG_FLAGS)
- set(DEFAULT_DEBUG_FLAGS ${CMAKE_C_FLAGS_DEBUG} CACHE
- STRING "CMake's default debug flags" FORCE)
- set(DEFAULT_RELEASE_FLAGS ${CMAKE_C_FLAGS_RELEASE} CACHE
- STRING "CMake's default release flags" FORCE)
- else(NOT DEFAULT_DEBUG_FLAGS)
- message(STATUS "DEFAULT_DEBUG_FLAGS not nil: " ${DEFAULT_DEBUG_FLAGS})
- endif(NOT DEFAULT_DEBUG_FLAGS)
-else(APPLE OR WIN32)
- set(LINUX_FLAGS "-DPMALSA")
endif(APPLE OR WIN32)
-if(APPLE)
- set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk CACHE
- PATH "-isysroot parameter for compiler" FORCE)
- set(CMAKE_C_FLAGS "-mmacosx-version-min=10.5" CACHE
- STRING "needed in conjunction with CMAKE_OSX_SYSROOT" FORCE)
-endif(APPLE)
+# we need full paths to sources because they are shared with other targets
+# (in particular pmjni). Set PMDIR to the top-level portmidi directory:
+get_filename_component(PMDIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
+set(PM_LIB_PUBLIC_SRC ${PMDIR}/pm_common/portmidi.c
+ ${PMDIR}/pm_common/pmutil.c
+ ${PMDIR}/porttime/porttime.c)
+add_library(portmidi ${PM_LIB_PUBLIC_SRC})
+
+# MSVCRT_DLL is "DLL" for shared runtime library, and "" for static:
+set_target_properties(portmidi PROPERTIES
+ VERSION ${LIBRARY_VERSION}
+ SOVERSION ${LIBRARY_SOVERSION}
+ OUTPUT_NAME "${PM_ACTUAL_LIB_NAME}"
+ MSVC_RUNTIME_LIBRARY
+ "MultiThreaded$<$<CONFIG:Debug>:Debug>${MSVCRT_DLL}"
+ WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+target_include_directories(portmidi PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+
+
+option(PM_CHECK_ERRORS
+"Insert a check for error return values at the end of each PortMidi function.
+If an error is encountered, a text message is printed using printf(), the user
+is asked to type ENTER, and then exit(-1) is called to clean up and terminate
+the program.
+
+You should not use PM_CHECK_ERRORS if printf() does not work (e.g. this is not
+a console application under Windows, or there is no visible console on some
+other OS), and you should not use PM_CHECK_ERRORS if you intend to recover
+from errors rather than abruptly terminate the program." OFF)
+if(PM_CHECK_ERRORS)
+ target_compile_definitions(portmidi PRIVATE PM_CHECK_ERRORS)
+endif(PM_CHECK_ERRORS)
macro(prepend_path RESULT PATH)
set(${RESULT})
@@ -35,94 +72,79 @@ macro(prepend_path RESULT PATH)
endforeach(FILE)
endmacro(prepend_path)
-set(CMAKE_C_FLAGS_DEBUG
- "${DEFAULT_DEBUG_FLAGS} -DPM_CHECK_ERRORS=1 -DDEBUG ${LINUX_FLAGS}"
- CACHE STRING "enable extra checks for debugging" FORCE)
-
-set(CMAKE_C_FLAGS_RELEASE "${DEFAULT_RELEASE_FLAGS} ${LINUX_FLAGS}"
- CACHE STRING "flags for release version" FORCE)
+# UNIX needs pthread library
+if(NOT WIN32)
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads REQUIRED)
+endif()
# first include the appropriate system-dependent file:
-if(UNIX)
- # add the -g switch for Linux and Mac OS X (not used in Win32)
- set (CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_C_FLAGS_DEBUG}"
- CACHE STRING "enable extra checks for debugging" FORCE)
- if(APPLE)
- set(MACSRC pmmacosxcm pmmac readbinaryplist finddefault)
- prepend_path(LIBSRC ../pm_mac/ ${MACSRC})
- list(APPEND LIBSRC ../porttime/ptmacosx_mach)
-
- include_directories(${CMAKE_OSX_SYSROOT}/Developer/Headers/FlatCarbon)
- set(FRAMEWORK_PATH ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks)
- set(COREAUDIO_LIB "${FRAMEWORK_PATH}/CoreAudio.framework")
- set(COREFOUNDATION_LIB "${FRAMEWORK_PATH}/CoreFoundation.framework")
- set(COREMIDI_LIB "${FRAMEWORK_PATH}/CoreMIDI.framework")
- set(CORESERVICES_LIB "${FRAMEWORK_PATH}/CoreServices.framework")
- set(PM_NEEDED_LIBS ${COREAUDIO_LIB} ${COREFOUNDATION_LIB}
- ${COREMIDI_LIB} ${CORESERVICES_LIB}
- CACHE INTERNAL "")
-
- set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
- set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
- message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
- else(APPLE)
- # LINUX settings...
- include(FindJNI)
- message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
- message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
- message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2})
- message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY})
- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
- # libjvm.so is found relative to JAVA_INCLUDE_PATH:
- set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so)
-
- set(LINUXSRC pmlinuxalsa pmlinux finddefault)
- prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
- list(APPEND LIBSRC ../porttime/ptlinux)
-
- set(PM_NEEDED_LIBS pthread asound)
- endif(APPLE)
-else(UNIX)
- if(WIN32)
+if(UNIX AND APPLE)
+ set(Threads::Threads "" PARENT_SCOPE)
+ find_library(COREAUDIO_LIBRARY CoreAudio REQUIRED)
+ find_library(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
+ find_library(COREMIDI_LIBRARY CoreMIDI REQUIRED)
+ find_library(CORESERVICES_LIBRARY CoreServices REQUIRED)
+ set(PM_LIB_PRIVATE_SRC
+ ${PMDIR}/porttime/ptmacosx_mach.c
+ ${PMDIR}/pm_mac/pmmac.c
+ ${PMDIR}/pm_mac/pmmacosxcm.c
+ ${PMDIR}/pm_mac/finddefault.c
+ ${PMDIR}/pm_mac/readbinaryplist.c)
+ set(PM_NEEDED_LIBS ${CMAKE_THREAD_LIBS_INIT} ${COREAUDIO_LIBRARY}
+ ${COREFOUNDATION_LIBRARY} ${COREMIDI_LIBRARY} ${CORESERVICES_LIBRARY}
+ PARENT_SCOPE)
+ target_link_libraries(portmidi PRIVATE Threads::Threads ${COREAUDIO_LIBRARY}
+ ${COREFOUNDATION_LIBRARY} ${COREMIDI_LIBRARY} ${CORESERVICES_LIBRARY})
+ # set to CMake default; is this right?:
+ set_target_properties(portmidi PROPERTIES MACOSX_RPATH ON)
+elseif(HAIKU)
+ set(PM_LIB_PRIVATE_SRC
+ ${PMDIR}/porttime/pthaiku.cpp
+ ${PMDIR}/pm_haiku/pmhaiku.cpp
+ ${PMDIR}/pm_linux/finddefault.c)
+ set(PM_NEEDED_LIBS be midi midi2 PARENT_SCOPE)
+ target_link_libraries(portmidi PRIVATE be midi midi2)
+elseif(UNIX)
+ target_compile_definitions(portmidi PRIVATE ${LINUX_FLAGS})
+ set(PM_LIB_PRIVATE_SRC
+ ${PMDIR}/porttime/ptlinux.c
+ ${PMDIR}/pm_linux/pmlinux.c
+ ${PMDIR}/pm_linux/pmlinuxnull.c
+ ${PMDIR}/pm_linux/finddefault.c)
+ if(${LINUX_DEFINES} MATCHES ".*PMALSA.*")
+ # Note that ALSA is not required if PMNULL is defined -- PortMidi will then
+ # compile without ALSA and report no MIDI devices. Later, PMSNDIO or PMJACK
+ # might be additional options.
+ find_package(ALSA REQUIRED)
+ list(APPEND PM_LIB_PRIVATE_SRC ${PMDIR}/pm_linux/pmlinuxalsa.c)
+ set(PM_NEEDED_LIBS ${CMAKE_THREAD_LIBS_INIT} ${ALSA_LIBRARIES} PARENT_SCOPE)
+ target_link_libraries(portmidi PRIVATE Threads::Threads ALSA::ALSA)
+ set(PKGCONFIG_REQUIRES_PRIVATE "alsa" PARENT_SCOPE)
+ else()
+ message(WARNING "No PMALSA, so PortMidi will not use ALSA, "
+ "and will not find or open MIDI devices.")
+ set(PM_NEEDED_LIBS ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
+ target_link_libraries(portmidi PRIVATE Threads::Threads)
+ endif()
+elseif(WIN32)
+ set(PM_LIB_PRIVATE_SRC
+ ${PMDIR}/porttime/ptwinmm.c
+ ${PMDIR}/pm_win/pmwin.c
+ ${PMDIR}/pm_win/pmwinmm.c)
+ set(PM_NEEDED_LIBS winmm PARENT_SCOPE)
+ target_link_libraries(portmidi PRIVATE winmm)
+# if(NOT BUILD_SHARED_LIBS AND PM_USE_STATIC_RUNTIME)
# /MDd is multithread debug DLL, /MTd is multithread debug
# /MD is multithread DLL, /MT is multithread. Change to static:
- include(../pm_win/static.cmake)
-
- include(FindJNI)
-
- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
- # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
-
- set(WINSRC pmwin pmwinmm)
- prepend_path(LIBSRC ../pm_win/ ${WINSRC})
- list(APPEND LIBSRC ../porttime/ptwinmm)
- set(PM_NEEDED_LIBS winmm.lib)
- endif(WIN32)
-endif(UNIX)
-set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY})
-
-# this completes the list of library sources by adding shared code
-list(APPEND LIBSRC pmutil portmidi)
-
-# now add the shared files to make the complete list of library sources
-add_library(portmidi-static ${LIBSRC})
-set_target_properties(portmidi-static PROPERTIES OUTPUT_NAME "portmidi_s")
-target_link_libraries(portmidi-static ${PM_NEEDED_LIBS})
+# include(../pm_win/static.cmake)
+# endif()
+else()
+ message(FATAL_ERROR "Operating system not supported.")
+endif()
-# define the jni library
-include_directories(${JAVA_INCLUDE_PATHS})
+set(PM_LIB_PUBLIC_SRC ${PM_LIB_PUBLIC_SRC} PARENT_SCOPE) # export to parent
+set(PM_LIB_PRIVATE_SRC ${PM_LIB_PRIVATE_SRC} PARENT_SCOPE) # export to parent
-set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c)
-add_library(pmjni SHARED ${JNISRC})
-target_link_libraries(pmjni ${JNI_EXTRA_LIBS})
-set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib")
+target_sources(portmidi PRIVATE ${PM_LIB_PRIVATE_SRC})
-# install the libraries (Linux and Mac OS X command line)
-if(UNIX)
- INSTALL(TARGETS portmidi-static pmjni
- LIBRARY DESTINATION /usr/local/lib
- ARCHIVE DESTINATION /usr/local/lib)
-# .h files installed by pm_dylib/CMakeLists.txt, so don't need them here
-# INSTALL(FILES portmidi.h ../porttime/porttime.h
-# DESTINATION /usr/local/include)
-endif(UNIX)
diff --git a/3rdparty/portmidi/pm_common/pminternal.h b/3rdparty/portmidi/pm_common/pminternal.h
index 6b6242026dd..80efbb07f64 100644
--- a/3rdparty/portmidi/pm_common/pminternal.h
+++ b/3rdparty/portmidi/pm_common/pminternal.h
@@ -1,4 +1,4 @@
-/* pminternal.h -- header for interface implementations */
+/** @file pminternal.h header for PortMidi implementations */
/* this file is included by files that implement library internals */
/* Here is a guide to implementers:
@@ -17,6 +17,8 @@
assumptions about pm_fns_type functions are given below.
*/
+/** @cond INTERNAL - add INTERNAL to Doxygen ENABLED_SECTIONS to include */
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -27,8 +29,10 @@ extern int pm_initialized; /* see note in portmidi.c */
void *pm_alloc(size_t s);
void pm_free(void *ptr);
-/* if an error occurs while opening or closing a midi stream, set these: */
-extern int pm_hosterror;
+/* if a host error (an error reported by the host MIDI API that is not
+ * mapped to a PortMidi error code) occurs in a synchronous operation
+ * (i.e., not in a callback from another thread) set these: */
+extern int pm_hosterror; /* boolean */
extern char pm_hosterror_text[PM_HOST_ERROR_MSG_LEN];
struct pm_internal_struct;
@@ -51,31 +55,30 @@ typedef PmTimestamp (*pm_synchronize_fn)(struct pm_internal_struct *midi);
of the open fails */
typedef PmError (*pm_open_fn)(struct pm_internal_struct *midi,
void *driverInfo);
+typedef PmError (*pm_create_fn)(int is_input, const char *name,
+ void *driverInfo);
+typedef PmError (*pm_delete_fn)(PmDeviceID id);
typedef PmError (*pm_abort_fn)(struct pm_internal_struct *midi);
/* pm_close_fn should clean up all memory and close the device if any
part of the close fails. */
typedef PmError (*pm_close_fn)(struct pm_internal_struct *midi);
typedef PmError (*pm_poll_fn)(struct pm_internal_struct *midi);
-typedef void (*pm_host_error_fn)(struct pm_internal_struct *midi, char * msg,
- unsigned int len);
-typedef unsigned int (*pm_has_host_error_fn)(struct pm_internal_struct *midi);
+typedef unsigned int (*pm_check_host_error_fn)(struct pm_internal_struct *midi);
typedef struct {
pm_write_short_fn write_short; /* output short MIDI msg */
pm_begin_sysex_fn begin_sysex; /* prepare to send a sysex message */
pm_end_sysex_fn end_sysex; /* marks end of sysex message */
pm_write_byte_fn write_byte; /* accumulate one more sysex byte */
- pm_write_realtime_fn write_realtime; /* send real-time message within sysex */
+ pm_write_realtime_fn write_realtime; /* send real-time msg within sysex */
pm_write_flush_fn write_flush; /* send any accumulated but unsent data */
- pm_synchronize_fn synchronize; /* synchronize portmidi time to stream time */
+ pm_synchronize_fn synchronize; /* synchronize PM time to stream time */
pm_open_fn open; /* open MIDI device */
pm_abort_fn abort; /* abort */
pm_close_fn close; /* close device */
pm_poll_fn poll; /* read pending midi events into portmidi buffer */
- pm_has_host_error_fn has_host_error; /* true when device has had host
- error message */
- pm_host_error_fn host_error; /* provide text readable host error message
- for device (clears and resets) */
+ pm_check_host_error_fn check_host_error; /* true when device has had host */
+ /* error; sets pm_hosterror and writes message to pm_hosterror_text */
} pm_fns_node, *pm_fns_type;
@@ -83,23 +86,25 @@ typedef struct {
extern pm_fns_node pm_none_dictionary;
typedef struct {
- PmDeviceInfo pub; /* some portmidi state also saved in here (for autmatic
- device closing (see PmDeviceInfo struct) */
- void *descriptor; /* ID number passed to win32 multimedia API open */
- void *internalDescriptor; /* points to PmInternal device, allows automatic
- device closing */
+ PmDeviceInfo pub; /* some portmidi state also saved in here (for automatic
+ device closing -- see PmDeviceInfo struct) */
+ int deleted; /* is this is a deleted virtual device? */
+ void *descriptor; /* ID number passed to win32 multimedia API open,
+ * coreMIDI endpoint, etc., representing the device */
+ struct pm_internal_struct *pm_internal; /* points to PmInternal device */
+ /* when the device is open, allows automatic device closing */
pm_fns_type dictionary;
} descriptor_node, *descriptor_type;
extern int pm_descriptor_max;
-extern descriptor_type descriptors;
-extern int pm_descriptor_index;
+extern descriptor_type pm_descriptors;
+extern int pm_descriptor_len;
typedef uint32_t (*time_get_proc_type)(void *time_info);
typedef struct pm_internal_struct {
- int device_id; /* which device is open (index to descriptors) */
- short write_flag; /* MIDI_IN, or MIDI_OUT */
+ int device_id; /* which device is open (index to pm_descriptors) */
+ short is_input; /* MIDI IN (true) or MIDI OUT (false) */
PmTimeProcPtr time_proc; /* where to get the time */
void *time_info; /* pass this to get_time() */
@@ -129,7 +134,7 @@ typedef struct pm_internal_struct {
PmTimestamp now; /* set by PmWrite to current time */
int first_message; /* initially true, used to run first synchronization */
pm_fns_type dictionary; /* implementation functions */
- void *descriptor; /* system-dependent state */
+ void *api_info; /* system-dependent state */
/* the following are used to expedite sysex data */
/* on windows, in debug mode, based on some profiling, these optimizations
* cut the time to process sysex bytes from about 7.5 to 0.26 usec/byte,
@@ -138,7 +143,7 @@ typedef struct pm_internal_struct {
*/
unsigned char *fill_base; /* addr of ptr to sysex data */
uint32_t *fill_offset_ptr; /* offset of next sysex byte */
- int32_t fill_length; /* how many sysex bytes to write */
+ uint32_t fill_length; /* how many sysex bytes to write */
} PmInternal;
@@ -155,8 +160,11 @@ PmTimestamp none_synchronize(PmInternal *midi);
PmError pm_fail_fn(PmInternal *midi);
PmError pm_fail_timestamp_fn(PmInternal *midi, PmTimestamp timestamp);
PmError pm_success_fn(PmInternal *midi);
-PmError pm_add_device(char *interf, char *name, int input, void *descriptor,
- pm_fns_type dictionary);
+PmError pm_add_interf(const char *interf, pm_create_fn create_fn,
+ pm_delete_fn delete_fn);
+PmError pm_add_device(const char *interf, const char *name, int is_input,
+ int is_virtual, void *descriptor, pm_fns_type dictionary);
+void pm_undo_add_device(int id);
uint32_t pm_read_bytes(PmInternal *midi, const unsigned char *data, int len,
PmTimestamp timestamp);
void pm_read_short(PmInternal *midi, PmEvent *event);
@@ -176,3 +184,4 @@ int pm_find_default_device(char *pattern, int is_input);
}
#endif
+/** @endcond */
diff --git a/3rdparty/portmidi/pm_common/pmjni.vcproj b/3rdparty/portmidi/pm_common/pmjni.vcproj
deleted file mode 100644
index b783f3e0c54..00000000000
--- a/3rdparty/portmidi/pm_common/pmjni.vcproj
+++ /dev/null
@@ -1,161 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="pmjni"
- ProjectGUID="{87B548BD-F5CE-4D1F-9181-390966AC5855}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="pmjni.dir\Debug"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,pmjni_EXPORTS"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../Debug/pmjni.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,pmjni_EXPORTS"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,pmjni_EXPORTS"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib &quot;C:\Program Files\Java\jdk1.6.0_16\include\..\lib\jvm.lib&quot; "
- OutputFile="..\Debug\pmjni.dll"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="..\Debug\pmjni.pdb"
- GenerateDebugInformation="TRUE"
- ImportLibrary="..\Debug\pmjni.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="pmjni.dir\Release"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,pmjni_EXPORTS"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../Release/pmjni.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,pmjni_EXPORTS"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,pmjni_EXPORTS"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib &quot;C:\Program Files\Java\jdk1.6.0_16\include\..\lib\jvm.lib&quot; "
- OutputFile="..\Release\pmjni.dll"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="..\Release\pmjni.pdb"
- ImportLibrary="..\Release\pmjni.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_win\pmwin.c">
- </File>
- <File
- RelativePath="..\pm_win\pmwinmm.c">
- </File>
- <File
- RelativePath="..\porttime\ptwinmm.c">
- </File>
- <File
- RelativePath="..\pm_common\pmutil.c">
- </File>
- <File
- RelativePath="..\pm_common\portmidi.c">
- </File>
- <File
- RelativePath="..\pm_java\pmjni\pmjni.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_common/pmutil.c b/3rdparty/portmidi/pm_common/pmutil.c
index 7d0abe35337..a70fe2fa1f8 100644
--- a/3rdparty/portmidi/pm_common/pmutil.c
+++ b/3rdparty/portmidi/pm_common/pmutil.c
@@ -8,7 +8,7 @@
#include "pmutil.h"
#include "pminternal.h"
-#if defined(WIN32) || defined(_MSC_VER)
+#ifdef WIN32
#define bzero(addr, siz) memset(addr, 0, siz)
#endif
diff --git a/3rdparty/portmidi/pm_common/pmutil.h b/3rdparty/portmidi/pm_common/pmutil.h
index ef5ee4bf84a..17f6984a0d7 100644
--- a/3rdparty/portmidi/pm_common/pmutil.h
+++ b/3rdparty/portmidi/pm_common/pmutil.h
@@ -1,31 +1,48 @@
-/* pmutil.h -- some helpful utilities for building midi
- applications that use PortMidi
+/** @file pmutil.h lock-free queue for building MIDI
+ applications with PortMidi.
+
+ PortMidi is not reentrant, and locks can suffer from priority
+ inversion. To support coordination between system callbacks, a
+ high-priority thread created with PortTime, and the main
+ application thread, PortMidi uses a lock-free, non-blocking
+ queue. The queue implementation is not particular to MIDI and is
+ available for other uses.
*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
+/** @defgroup grp_pmutil Lock-free Queue
+ @{
+*/
+
+/** The queue representation is opaque. Declare a queue as PmQueue * */
typedef void PmQueue;
-/*
- A single-reader, single-writer queue is created by
- Pm_QueueCreate(), which takes the number of messages and
- the message size as parameters. The queue only accepts
- fixed sized messages. Returns NULL if memory cannot be allocated.
+/** create a single-reader, single-writer queue.
+
+ @param num_msgs the number of messages the queue can hold
+
+ @param the fixed message size
+
+ @return the allocated and initialized queue, or NULL if memory
+ cannot be allocated. Allocation uses #pm_malloc().
+
+ The queue only accepts fixed sized messages.
This queue implementation uses the "light pipe" algorithm which
operates correctly even with multi-processors and out-of-order
memory writes. (see Alexander Dokumentov, "Lock-free Interprocess
- Communication," Dr. Dobbs Portal, http://www.ddj.com/,
- articleID=189401457, June 15, 2006. This algorithm requires
- that messages be translated to a form where no words contain
- zeros. Each word becomes its own "data valid" tag. Because of
- this translation, we cannot return a pointer to data still in
- the queue when the "peek" method is called. Instead, a buffer
- is preallocated so that data can be copied there. Pm_QueuePeek()
- dequeues a message into this buffer and returns a pointer to
- it. A subsequent Pm_Dequeue() will copy from this buffer.
+ Communication," Dr. Dobbs Portal, http://www.ddj.com/,
+ articleID=189401457, June 15, 2006. This algorithm requires that
+ messages be translated to a form where no words contain
+ zeros. Each word becomes its own "data valid" tag. Because of this
+ translation, we cannot return a pointer to data still in the queue
+ when the "peek" method is called. Instead, a buffer is
+ preallocated so that data can be copied there. Pm_QueuePeek()
+ dequeues a message into this buffer and returns a pointer to it. A
+ subsequent Pm_Dequeue() will copy from this buffer.
This implementation does not try to keep reader/writer data in
separate cache lines or prevent thrashing on cache lines.
@@ -36,92 +53,127 @@ typedef void PmQueue;
of the cache line, especially if messages are smaller than
cache lines. See the Dokumentov article for explanation.
- The algorithm is extended to handle "overflow" reporting. To report
- an overflow, the sender writes the current tail position to a field.
- The receiver must acknowlege receipt by zeroing the field. The sender
- will not send more until the field is zeroed.
-
- Pm_QueueDestroy() destroys the queue and frees its storage.
+ The algorithm is extended to handle "overflow" reporting. To
+ report an overflow, the sender writes the current tail position to
+ a field. The receiver must acknowlege receipt by zeroing the
+ field. The sender will not send more until the field is zeroed.
*/
-
PMEXPORT PmQueue *Pm_QueueCreate(long num_msgs, int32_t bytes_per_msg);
+
+/** destroy a queue and free its storage.
+
+ @param queue a queue created by #Pm_QueueCreate().
+
+ @return pmNoError or an error code.
+
+ Uses #pm_free().
+
+ */
PMEXPORT PmError Pm_QueueDestroy(PmQueue *queue);
-/*
- Pm_Dequeue() removes one item from the queue, copying it into msg.
- Returns 1 if successful, and 0 if the queue is empty.
- Returns pmBufferOverflow if what would have been the next thing
- in the queue was dropped due to overflow. (So when overflow occurs,
- the receiver can receive a queue full of messages before getting the
- overflow report. This protocol ensures that the reader will be
+/** remove one message from the queue, copying it into \p msg.
+
+ @param queue a queue created by #Pm_QueueCreate().
+
+ @param msg address to which the message, if any, is copied.
+
+ @return 1 if successful, and 0 if the queue is empty. Returns
+ #pmBufferOverflow if what would have been the next thing in the
+ queue was dropped due to overflow. (So when overflow occurs, the
+ receiver can receive a queue full of messages before getting the
+ overflow report. This protocol ensures that the reader will be
notified when data is lost due to overflow.
*/
PMEXPORT PmError Pm_Dequeue(PmQueue *queue, void *msg);
+/** insert one message into the queue, copying it from \p msg.
-/*
- Pm_Enqueue() inserts one item into the queue, copying it from msg.
- Returns pmNoError if successful and pmBufferOverflow if the queue was
- already full. If pmBufferOverflow is returned, the overflow flag is set.
+ @param queue a queue created by #Pm_QueueCreate().
+
+ @param msg address of the message to be enqueued.
+
+ @return #pmNoError if successful and #pmBufferOverflow if the
+ queue was already full. If #pmBufferOverflow is returned, the
+ overflow flag is set.
*/
PMEXPORT PmError Pm_Enqueue(PmQueue *queue, void *msg);
+/** test if the queue is full.
-/*
- Pm_QueueFull() returns non-zero if the queue is full
- Pm_QueueEmpty() returns non-zero if the queue is empty
+ @param queue a queue created by #Pm_QueueCreate().
- Either condition may change immediately because a parallel
- enqueue or dequeue operation could be in progress. Furthermore,
- Pm_QueueEmpty() is optimistic: it may say false, when due to
- out-of-order writes, the full message has not arrived. Therefore,
- Pm_Dequeue() could still return 0 after Pm_QueueEmpty() returns
- false. On the other hand, Pm_QueueFull() is pessimistic: if it
- returns false, then Pm_Enqueue() is guaranteed to succeed.
+ @return non-zero iff the queue is empty, and @pmBadPtr if \p queue
+ is NULL.
- Error conditions: Pm_QueueFull() returns pmBadPtr if queue is NULL.
- Pm_QueueEmpty() returns FALSE if queue is NULL.
+ The full condition may change immediately because a parallel
+ dequeue operation could be in progress. The result is
+ pessimistic: if it returns false (zero) to the single writer, then
+ #Pm_Enqueue() is guaranteed to succeed.
*/
PMEXPORT int Pm_QueueFull(PmQueue *queue);
+
+/** test if the queue is empty.
+
+ @param queue a queue created by #Pm_QueueCreate().
+
+ @return zero iff the queue is either empty or NULL.
+
+ The empty condition may change immediately because a parallel
+ enqueue operation could be in progress. Furthermore, the
+ result is optimistic: it may say false, when due to
+ out-of-order writes, the full message has not arrived. Therefore,
+ #Pm_Dequeue() could still return 0 after #Pm_QueueEmpty() returns
+ false.
+*/
PMEXPORT int Pm_QueueEmpty(PmQueue *queue);
+/** get a pointer to the item at the head of the queue.
-/*
- Pm_QueuePeek() returns a pointer to the item at the head of the queue,
- or NULL if the queue is empty. The item is not removed from the queue.
- Pm_QueuePeek() will not indicate when an overflow occurs. If you want
- to get and check pmBufferOverflow messages, use the return value of
- Pm_QueuePeek() *only* as an indication that you should call
- Pm_Dequeue(). At the point where a direct call to Pm_Dequeue() would
- return pmBufferOverflow, Pm_QueuePeek() will return NULL but internally
- clear the pmBufferOverflow flag, enabling Pm_Enqueue() to resume
- enqueuing messages. A subsequent call to Pm_QueuePeek()
- will return a pointer to the first message *after* the overflow.
- Using this as an indication to call Pm_Dequeue(), the first call
- to Pm_Dequeue() will return pmBufferOverflow. The second call will
- return success, copying the same message pointed to by the previous
- Pm_QueuePeek().
-
- When to use Pm_QueuePeek(): (1) when you need to look at the message
+ @param queue a queue created by #Pm_QueueCreate().
+
+ @result a pointer to the head message or NULL if the queue is empty.
+
+ The message is not removed from the queue. #Pm_QueuePeek() will
+ not indicate when an overflow occurs. If you want to get and check
+ #pmBufferOverflow messages, use the return value of
+ #Pm_QueuePeek() *only* as an indication that you should call
+ #Pm_Dequeue(). At the point where a direct call to #Pm_Dequeue()
+ would return #pmBufferOverflow, #Pm_QueuePeek() will return NULL,
+ but internally clear the #pmBufferOverflow flag, enabling
+ #Pm_Enqueue() to resume enqueuing messages. A subsequent call to
+ #Pm_QueuePeek() will return a pointer to the first message *after*
+ the overflow. Using this as an indication to call #Pm_Dequeue(),
+ the first call to #Pm_Dequeue() will return #pmBufferOverflow. The
+ second call will return success, copying the same message pointed
+ to by the previous #Pm_QueuePeek().
+
+ When to use #Pm_QueuePeek(): (1) when you need to look at the message
data to decide who should be called to receive it. (2) when you need
to know a message is ready but cannot accept the message.
- Note that Pm_QueuePeek() is not a fast check, so if possible, you
- might as well just call Pm_Dequeue() and accept the data if it is there.
+ Note that #Pm_QueuePeek() is not a fast check, so if possible, you
+ might as well just call #Pm_Dequeue() and accept the data if it is there.
*/
PMEXPORT void *Pm_QueuePeek(PmQueue *queue);
-/*
- Pm_SetOverflow() allows the writer (enqueuer) to signal an overflow
- condition to the reader (dequeuer). E.g. when transfering data from
- the OS to an application, if the OS indicates a buffer overrun,
- Pm_SetOverflow() can be used to insure that the reader receives a
- pmBufferOverflow result from Pm_Dequeue(). Returns pmBadPtr if queue
- is NULL, returns pmBufferOverflow if buffer is already in an overflow
- state, returns pmNoError if successfully set overflow state.
+/** allows the writer (enqueuer) to signal an overflow
+ condition to the reader (dequeuer).
+
+ @param queue a queue created by #Pm_QueueCreate().
+
+ @return #pmNoError if overflow is set, or #pmBadPtr if queue is
+ NULL, or #pmBufferOverflow if buffer is already in an overflow
+ state.
+
+ E.g., when transfering data from the OS to an application, if the
+ OS indicates a buffer overrun, #Pm_SetOverflow() can be used to
+ insure that the reader receives a #pmBufferOverflow result from
+ #Pm_Dequeue().
*/
PMEXPORT PmError Pm_SetOverflow(PmQueue *queue);
+/** @} */
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/3rdparty/portmidi/pm_common/portmidi-dynamic.vcproj b/3rdparty/portmidi/pm_common/portmidi-dynamic.vcproj
deleted file mode 100644
index 42b4a271a20..00000000000
--- a/3rdparty/portmidi/pm_common/portmidi-dynamic.vcproj
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="portmidi-dynamic"
- ProjectGUID="{7283FAD1-7415-4061-A19A-FF5C7BCE9306}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="portmidi-dynamic.dir\Debug"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="C:\Users\rbd\portmedia\portmidi\pm_common;C:\Users\rbd\portmedia\portmidi\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="3"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="C:/Users/rbd/portmedia/portmidi/Debug/portmidi.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="C:\Users\rbd\portmedia\portmidi\pm_common;C:\Users\rbd\portmedia\portmidi\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib "
- OutputFile="C:\Users\rbd\portmedia\portmidi\Debug\portmidi.dll"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="C:\Users\rbd\portmedia\portmidi\Debug\portmidi.pdb"
- GenerateDebugInformation="TRUE"
- ImportLibrary="C:\Users\rbd\portmedia\portmidi\Debug\portmidi.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="portmidi-dynamic.dir\Release"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="C:\Users\rbd\portmedia\portmidi\pm_common;C:\Users\rbd\portmedia\portmidi\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="2"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="C:/Users/rbd/portmedia/portmidi/Release/portmidi.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="C:\Users\rbd\portmedia\portmidi\pm_common;C:\Users\rbd\portmedia\portmidi\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib "
- OutputFile="C:\Users\rbd\portmedia\portmidi\Release\portmidi.dll"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="C:\Users\rbd\portmedia\portmidi\Release\portmidi.pdb"
- ImportLibrary="C:\Users\rbd\portmedia\portmidi\Release\portmidi.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <File
- RelativePath="C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description="Building Custom Rule C:/Users/rbd/portmedia/portmidi/pm_common/CMakeLists.txt"
- CommandLine="&quot;C:\Program Files\CMake 2.6\bin\cmake.exe&quot; -HC:/Users/rbd/portmedia/portmidi -BC:/Users/rbd/portmedia/portmidi --check-stamp-file CMakeFiles/generate.stamp"
- AdditionalDependencies="C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt;&quot;C:\Program Files\CMake 2.6\share\cmake-2.6\Modules\FindJNI.cmake&quot;;C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt;"
- Outputs="CMakeFiles\generate.stamp"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description="Building Custom Rule C:/Users/rbd/portmedia/portmidi/pm_common/CMakeLists.txt"
- CommandLine="&quot;C:\Program Files\CMake 2.6\bin\cmake.exe&quot; -HC:/Users/rbd/portmedia/portmidi -BC:/Users/rbd/portmedia/portmidi --check-stamp-file CMakeFiles/generate.stamp"
- AdditionalDependencies="C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt;&quot;C:\Program Files\CMake 2.6\share\cmake-2.6\Modules\FindJNI.cmake&quot;;C:\Users\rbd\portmedia\portmidi\pm_common\CMakeLists.txt;"
- Outputs="CMakeFiles\generate.stamp"/>
- </FileConfiguration>
- </File>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="C:\Users\rbd\portmedia\portmidi\pm_win\pmwin.c">
- </File>
- <File
- RelativePath="C:\Users\rbd\portmedia\portmidi\pm_win\pmwinmm.c">
- </File>
- <File
- RelativePath="C:\Users\rbd\portmedia\portmidi\porttime\ptwinmm.c">
- </File>
- <File
- RelativePath="C:\Users\rbd\portmedia\portmidi\pm_common\pmutil.c">
- </File>
- <File
- RelativePath="C:\Users\rbd\portmedia\portmidi\pm_common\portmidi.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_common/portmidi-static.vcproj b/3rdparty/portmidi/pm_common/portmidi-static.vcproj
deleted file mode 100644
index 4702b2d1e31..00000000000
--- a/3rdparty/portmidi/pm_common/portmidi-static.vcproj
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="portmidi-static"
- ProjectGUID="{2985D5DA-D91E-44E0-924B-E612B6AA33F6}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="portmidi-static.dir\Debug"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../Debug/portmidi_s.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\Debug\portmidi_s.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="portmidi-static.dir\Release"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../Release/portmidi_s.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;&quot;C:\Program Files\Java\jdk1.6.0_16\include&quot;;&quot;C:\Program Files\Java\jdk1.6.0_16\include\win32&quot;;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\Release\portmidi_s.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_win\pmwin.c">
- </File>
- <File
- RelativePath="..\pm_win\pmwinmm.c">
- </File>
- <File
- RelativePath="..\porttime\ptwinmm.c">
- </File>
- <File
- RelativePath="..\pm_common\pmutil.c">
- </File>
- <File
- RelativePath="..\pm_common\portmidi.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_common/portmidi.c b/3rdparty/portmidi/pm_common/portmidi.c
index 2ed9171e781..7c906dcae42 100644
--- a/3rdparty/portmidi/pm_common/portmidi.c
+++ b/3rdparty/portmidi/pm_common/portmidi.c
@@ -1,7 +1,5 @@
-#ifdef _MSC_VER
- #pragma warning(disable: 4244) // stop warnings about downsize typecasts
- #pragma warning(disable: 4018) // stop warnings about signed/unsigned
-#endif
+/* portmidi.c -- cross-platform MIDI I/O library */
+/* see license.txt for license */
#include "stdlib.h"
#include "string.h"
@@ -36,12 +34,21 @@
#define is_empty(midi) ((midi)->tail == (midi)->head)
-/* this is not static so that pm_init can set it directly if
+/* this is not static so that pm_init can set it directly
* (see pmmac.c:pm_init())
*/
int pm_initialized = FALSE;
-int pm_hosterror;
+int pm_hosterror; /* boolean */
+
+/* if PM_CHECK_ERRORS is enabled, but the caller wants to
+ * handle an error condition, declare this as extern and
+ * set to FALSE (this override is provided specifically
+ * for the test program virttest.c, where pmNameConflict
+ * is expected in a call to Pm_CreateVirtualInput()):
+ */
+int pm_check_errors = TRUE;
+
char pm_hosterror_text[PM_HOST_ERROR_MSG_LEN];
#ifdef PM_CHECK_ERRORS
@@ -54,15 +61,16 @@ static void prompt_and_exit(void)
{
char line[STRING_MAX];
printf("type ENTER...");
- fgets(line, STRING_MAX, stdin);
+ char *rslt = fgets(line, STRING_MAX, stdin);
/* this will clean up open ports: */
exit(-1);
}
-
static PmError pm_errmsg(PmError err)
{
- if (err == pmHostError) {
+ if (!pm_check_errors) { /* see pm_check_errors declaration above */
+ ;
+ } else if (err == pmHostError) {
/* it seems pointless to allocate memory and copy the string,
* so I will do the work of Pm_GetHostErrorText directly
*/
@@ -87,52 +95,193 @@ system implementation of portmidi interface
*/
int pm_descriptor_max = 0;
-int pm_descriptor_index = 0;
-descriptor_type descriptors = NULL;
+int pm_descriptor_len = 0;
+descriptor_type pm_descriptors = NULL;
+
+/* interface pm_descriptors are simple: an array of string/fnptr pairs: */
+#define MAX_INTERF 4
+static struct {
+ const char *interf;
+ pm_create_fn create_fn;
+ pm_delete_fn delete_fn;
+} pm_interf_list[MAX_INTERF];
+
+static int pm_interf_list_len = 0;
+
+
+/* pm_add_interf -- describe an interface to library
+ *
+ * This is called at initialization time, once for each
+ * supported interface (e.g., CoreMIDI). The strings
+ * are retained but NOT COPIED, so do not destroy them!
+ *
+ * The purpose is to register functions that create/delete
+ * a virtual input or output device.
+ *
+ * returns pmInsufficientMemor if interface memory is
+ * exceeded, otherwise returns pmNoError.
+ */
+PmError pm_add_interf(const char *interf, pm_create_fn create_fn,
+ pm_delete_fn delete_fn)
+{
+ if (pm_interf_list_len >= MAX_INTERF) {
+ return pmInsufficientMemory;
+ }
+ pm_interf_list[pm_interf_list_len].interf = interf;
+ pm_interf_list[pm_interf_list_len].create_fn = create_fn;
+ pm_interf_list[pm_interf_list_len].delete_fn = delete_fn;
+ pm_interf_list_len++;
+ return pmNoError;
+}
+
+
+PmError pm_create_virtual(PmInternal *midi, int is_input, const char *interf,
+ const char *name, void *device_info)
+{
+ int i;
+ if (pm_interf_list_len == 0) {
+ return pmNotImplemented;
+ }
+ if (!interf) {
+ /* default interface is the first one */
+ interf = pm_interf_list[0].interf;
+ }
+ for (i = 0; i < pm_interf_list_len; i++) {
+ if (strcmp(pm_interf_list[i].interf,
+ interf) == 0) {
+ int id = (*pm_interf_list[i].create_fn)(is_input, name,
+ device_info);
+ pm_descriptors[id].pub.is_virtual = TRUE;
+ return id;
+ }
+ }
+ return pmInterfaceNotSupported;
+}
+
/* pm_add_device -- describe interface/device pair to library
*
* This is called at intialization time, once for each
- * interface (e.g. DirectSound) and device (e.g. SoundBlaster 1)
- * The strings are retained but NOT COPIED, so do not destroy them!
+ * interface (e.g. DirectSound) and device (e.g. SoundBlaster 1).
+ * This is also called when user creates a virtual device.
+ *
+ * Normally, increasing integer indices are returned. If the device
+ * is virtual, a linear search is performed to ensure that the name
+ * is unique. If the name is already taken, the call will fail and
+ * no device is added.
+ *
+ * interf is assumed to be static memory, so it is NOT COPIED and
+ * NOT FREED.
+ * name is owned by caller, COPIED if needed, and FREED by PortMidi.
+ * Caller is resposible for freeing name when pm_add_device returns.
*
- * returns pmInvalidDeviceId if device memory is exceeded
- * otherwise returns pmNoError
+ * returns pmInvalidDeviceId if device memory is exceeded or a virtual
+ * device would take the name of an existing device.
+ * otherwise returns index (portmidi device_id) of the added device
*/
-PmError pm_add_device(char *interf, char *name, int input,
- void *descriptor, pm_fns_type dictionary) {
- if (pm_descriptor_index >= pm_descriptor_max) {
- // expand descriptors
+PmError pm_add_device(const char *interf, const char *name, int is_input,
+ int is_virtual, void *descriptor, pm_fns_type dictionary) {
+ /* printf("pm_add_device: %s %s %d %p %p\n",
+ interf, name, is_input, descriptor, dictionary); */
+ int device_id;
+ PmDeviceInfo *d;
+ /* if virtual, search for duplicate name or unused ID; otherwise,
+ * just add a new device at the next integer available:
+ */
+ for (device_id = (is_virtual ? 0 : pm_descriptor_len);
+ device_id < pm_descriptor_len; device_id++) {
+ d = &pm_descriptors[device_id].pub;
+ d->structVersion = 200;
+ if (strcmp(d->interf, interf) == 0 && strcmp(d->name, name) == 0) {
+ /* only reuse a name if it is a deleted virtual device with
+ * a matching direction (input or output) */
+ if (pm_descriptors[device_id].deleted && is_input == d->input) {
+ /* here, we know d->is_virtual because only virtual devices
+ * can be deleted, and we know is_virtual because we are
+ * in this loop.
+ */
+ pm_free((void *) d->name); /* reuse this device entry */
+ d->name = NULL;
+ break;
+ /* name conflict exists if the new device appears to others as
+ * the same direction (input or output) as the existing device.
+ * Note that virtual inputs appear to others as outputs and
+ * vice versa.
+ * The direction of the new virtual device to others is "output"
+ * if is_input, i.e., virtual inputs appear to others as outputs.
+ * The existing device appears to others as "output" if
+ * (d->is_virtual == d->input) by the same logic.
+ * The compare will detect if device directions are the same:
+ */
+ } else if (is_input == (d->is_virtual == d->input)) {
+ return pmNameConflict;
+ }
+ }
+ }
+ if (device_id >= pm_descriptor_max) {
+ // expand pm_descriptors
descriptor_type new_descriptors = (descriptor_type)
pm_alloc(sizeof(descriptor_node) * (pm_descriptor_max + 32));
if (!new_descriptors) return pmInsufficientMemory;
- if (descriptors) {
- memcpy(new_descriptors, descriptors,
+ if (pm_descriptors) {
+ memcpy(new_descriptors, pm_descriptors,
sizeof(descriptor_node) * pm_descriptor_max);
- free(descriptors);
+ pm_free(pm_descriptors);
}
pm_descriptor_max += 32;
- descriptors = new_descriptors;
+ pm_descriptors = new_descriptors;
+ }
+ if (device_id == pm_descriptor_len) {
+ pm_descriptor_len++; /* extending array of pm_descriptors */
}
- descriptors[pm_descriptor_index].pub.interf = interf;
- descriptors[pm_descriptor_index].pub.name = name;
- descriptors[pm_descriptor_index].pub.input = input;
- descriptors[pm_descriptor_index].pub.output = !input;
+ d = &pm_descriptors[device_id].pub;
+ d->interf = interf;
+ d->name = pm_alloc(strlen(name) + 1);
+ if (!d->name) {
+ return pmInsufficientMemory;
+ }
+#pragma warning(suppress: 4996) // don't use suggested strncpy_s
+ strcpy(d->name, name);
+ d->input = is_input;
+ d->output = !is_input;
+ d->is_virtual = FALSE; /* caller should set to TRUE if this is virtual */
/* default state: nothing to close (for automatic device closing) */
- descriptors[pm_descriptor_index].pub.opened = FALSE;
+ d->opened = FALSE;
+
+ pm_descriptors[device_id].deleted = FALSE;
/* ID number passed to win32 multimedia API open */
- descriptors[pm_descriptor_index].descriptor = descriptor;
+ pm_descriptors[device_id].descriptor = descriptor;
/* points to PmInternal, allows automatic device closing */
- descriptors[pm_descriptor_index].internalDescriptor = NULL;
+ pm_descriptors[device_id].pm_internal = NULL;
- descriptors[pm_descriptor_index].dictionary = dictionary;
-
- pm_descriptor_index++;
+ pm_descriptors[device_id].dictionary = dictionary;
- return pmNoError;
+ return device_id;
+}
+
+
+/* Undo a successful call to pm_add_device(). If a new device was
+ * allocated, it must be the last device in pm_descriptors, so it is
+ * easy to delete by decrementing the length of pm_descriptors, but
+ * first free the name (which was copied to the heap). Otherwise,
+ * the device must be a virtual device that was created previously
+ * and is in the interior of the array of pm_descriptors. Leave it,
+ * but mark it as deleted.
+ */
+void pm_undo_add_device(int id)
+{
+ /* Clear some fields (not all are strictly necessary) */
+ pm_descriptors[id].deleted = TRUE;
+ pm_descriptors[id].descriptor = NULL;
+ pm_descriptors[id].pm_internal = NULL;
+
+ if (id == pm_descriptor_len - 1) {
+ pm_free(pm_descriptors[id].pub.name);
+ pm_descriptor_len--;
+ }
}
@@ -144,7 +293,7 @@ int pm_find_default_device(char *pattern, int is_input)
int id = pmNoDevice;
int i;
/* first parse pattern into name, interf parts */
- char *interf_pref = (char *)""; /* initially assume it is not there */
+ char const *interf_pref = ""; /* initially assume it is not there */
char *name_pref = strstr(pattern, ", ");
if (name_pref) { /* found separator, adjust the pointer */
@@ -154,7 +303,7 @@ int pm_find_default_device(char *pattern, int is_input)
} else {
name_pref = pattern; /* whole string is the name pattern */
}
- for (i = 0; i < pm_descriptor_index; i++) {
+ for (i = 0; i < pm_descriptor_len; i++) {
const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
if (info->input == is_input &&
strstr(info->name, name_pref) &&
@@ -173,56 +322,71 @@ portmidi implementation
====================================================================
*/
-PMEXPORT int Pm_CountDevices( void ) {
+PMEXPORT int Pm_CountDevices(void)
+{
Pm_Initialize();
/* no error checking -- Pm_Initialize() does not fail */
- return pm_descriptor_index;
+ return pm_descriptor_len;
}
-PMEXPORT const PmDeviceInfo* Pm_GetDeviceInfo( PmDeviceID id ) {
+PMEXPORT const PmDeviceInfo* Pm_GetDeviceInfo(PmDeviceID id)
+{
Pm_Initialize(); /* no error check needed */
- if (id >= 0 && id < pm_descriptor_index) {
- return &descriptors[id].pub;
+ if (id >= 0 && id < pm_descriptor_len && !pm_descriptors[id].deleted) {
+ return &pm_descriptors[id].pub;
}
return NULL;
}
/* pm_success_fn -- "noop" function pointer */
-PmError pm_success_fn(PmInternal *midi) {
+PmError pm_success_fn(PmInternal *midi)
+{
return pmNoError;
}
/* none_write -- returns an error if called */
-PmError none_write_short(PmInternal *midi, PmEvent *buffer) {
+PmError none_write_short(PmInternal *midi, PmEvent *buffer)
+{
return pmBadPtr;
}
/* pm_fail_timestamp_fn -- placeholder for begin_sysex and flush */
-PmError pm_fail_timestamp_fn(PmInternal *midi, PmTimestamp timestamp) {
+PmError pm_fail_timestamp_fn(PmInternal *midi, PmTimestamp timestamp)
+{
return pmBadPtr;
}
PmError none_write_byte(PmInternal *midi, unsigned char byte,
- PmTimestamp timestamp) {
+ PmTimestamp timestamp)
+{
return pmBadPtr;
}
/* pm_fail_fn -- generic function, returns error if called */
-PmError pm_fail_fn(PmInternal *midi) {
+PmError pm_fail_fn(PmInternal *midi)
+{
return pmBadPtr;
}
-static PmError none_open(PmInternal *midi, void *driverInfo) {
+static PmError none_open(PmInternal *midi, void *driverInfo)
+{
return pmBadPtr;
}
-static void none_get_host_error(PmInternal * midi, char * msg, unsigned int len) {
+
+static void none_get_host_error(PmInternal * midi, char * msg,
+ unsigned int len)
+{
*msg = 0; // empty string
}
-static unsigned int none_has_host_error(PmInternal * midi) {
+
+static unsigned int none_check_host_error(PmInternal * midi)
+{
return FALSE;
}
-PmTimestamp none_synchronize(PmInternal *midi) {
+
+PmTimestamp none_synchronize(PmInternal *midi)
+{
return 0;
}
@@ -238,15 +402,15 @@ pm_fns_node pm_none_dictionary = {
none_write_flush,
none_synchronize,
none_open,
- none_abort,
+ none_abort,
none_close,
none_poll,
- none_has_host_error,
- none_get_host_error
+ none_check_host_error,
};
-PMEXPORT const char *Pm_GetErrorText( PmError errnum ) {
+PMEXPORT const char *Pm_GetErrorText(PmError errnum)
+{
const char *msg;
switch(errnum)
@@ -255,47 +419,59 @@ PMEXPORT const char *Pm_GetErrorText( PmError errnum ) {
msg = "";
break;
case pmHostError:
- msg = "PortMidi: `Host error'";
+ msg = "PortMidi: Host error";
break;
case pmInvalidDeviceId:
- msg = "PortMidi: `Invalid device ID'";
+ msg = "PortMidi: Invalid device ID";
break;
case pmInsufficientMemory:
- msg = "PortMidi: `Insufficient memory'";
+ msg = "PortMidi: Insufficient memory";
break;
case pmBufferTooSmall:
- msg = "PortMidi: `Buffer too small'";
+ msg = "PortMidi: Buffer too small";
break;
case pmBadPtr:
- msg = "PortMidi: `Bad pointer'";
+ msg = "PortMidi: Bad pointer";
break;
case pmInternalError:
- msg = "PortMidi: `Internal PortMidi Error'";
+ msg = "PortMidi: Internal PortMidi Error";
break;
case pmBufferOverflow:
- msg = "PortMidi: `Buffer overflow'";
+ msg = "PortMidi: Buffer overflow";
break;
case pmBadData:
- msg = "PortMidi: `Invalid MIDI message Data'";
+ msg = "PortMidi: Invalid MIDI message Data";
break;
case pmBufferMaxSize:
- msg = "PortMidi: `Buffer cannot be made larger'";
+ msg = "PortMidi: Buffer cannot be made larger";
+ break;
+ case pmNotImplemented:
+ msg = "PortMidi: Function is not implemented";
+ break;
+ case pmInterfaceNotSupported:
+ msg = "PortMidi: Interface not supported";
break;
- default:
- msg = "PortMidi: `Illegal error number'";
+ case pmNameConflict:
+ msg = "PortMidi: Cannot create virtual device: name is taken";
+ break;
+ default:
+ msg = "PortMidi: Illegal error number";
break;
}
return msg;
}
-/* This can be called whenever you get a pmHostError return value.
+/* This can be called whenever you get a pmHostError return value
+ * or TRUE from Pm_HasHostError().
* The error will always be in the global pm_hosterror_text.
*/
-PMEXPORT void Pm_GetHostErrorText(char * msg, unsigned int len) {
+PMEXPORT void Pm_GetHostErrorText(char * msg, unsigned int len)
+{
assert(msg);
assert(len > 0);
if (pm_hosterror) {
+#pragma warning(suppress: 4996) // don't use suggested strncpy_s
strncpy(msg, (char *) pm_hosterror_text, len);
pm_hosterror = FALSE;
pm_hosterror_text[0] = 0; /* clear the message; not necessary, but it
@@ -307,24 +483,22 @@ PMEXPORT void Pm_GetHostErrorText(char * msg, unsigned int len) {
}
-PMEXPORT int Pm_HasHostError(PortMidiStream * stream) {
+PMEXPORT int Pm_HasHostError(PortMidiStream * stream)
+{
if (pm_hosterror) return TRUE;
if (stream) {
PmInternal * midi = (PmInternal *) stream;
- pm_hosterror = (*midi->dictionary->has_host_error)(midi);
- if (pm_hosterror) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
- PM_HOST_ERROR_MSG_LEN);
- /* now error message is global */
- return TRUE;
- }
+ return (*midi->dictionary->check_host_error)(midi);
}
return FALSE;
}
-PMEXPORT PmError Pm_Initialize( void ) {
+PMEXPORT PmError Pm_Initialize(void)
+{
if (!pm_initialized) {
+ pm_descriptor_len = 0;
+ pm_interf_list_len = 0;
pm_hosterror = FALSE;
pm_hosterror_text[0] = 0; /* the null string */
pm_init();
@@ -334,16 +508,24 @@ PMEXPORT PmError Pm_Initialize( void ) {
}
-PMEXPORT PmError Pm_Terminate( void ) {
+PMEXPORT PmError Pm_Terminate(void)
+{
if (pm_initialized) {
pm_term();
- // if there are no devices, descriptors might still be NULL
- if (descriptors != NULL) {
- free(descriptors);
- descriptors = NULL;
+ /* if there are no devices, pm_descriptors might still be NULL */
+ if (pm_descriptors != NULL) {
+ int i; /* free names copied into pm_descriptors */
+ for (i = 0; i < pm_descriptor_len; i++) {
+ if (pm_descriptors[i].pub.name) {
+ pm_free(pm_descriptors[i].pub.name);
+ }
+ }
+ pm_free(pm_descriptors);
+ pm_descriptors = NULL;
}
- pm_descriptor_index = 0;
+ pm_descriptor_len = 0;
pm_descriptor_max = 0;
+ pm_interf_list_len = 0;
pm_initialized = FALSE;
}
return pmNoError;
@@ -354,7 +536,8 @@ PMEXPORT PmError Pm_Terminate( void ) {
/*
* returns number of messages actually read, or error code
*/
-PMEXPORT int Pm_Read(PortMidiStream *stream, PmEvent *buffer, int32_t length) {
+PMEXPORT int Pm_Read(PortMidiStream *stream, PmEvent *buffer, int32_t length)
+{
PmInternal *midi = (PmInternal *) stream;
int n = 0;
PmError err = pmNoError;
@@ -362,9 +545,9 @@ PMEXPORT int Pm_Read(PortMidiStream *stream, PmEvent *buffer, int32_t length) {
/* arg checking */
if(midi == NULL)
err = pmBadPtr;
- else if(!descriptors[midi->device_id].pub.opened)
+ else if(!pm_descriptors[midi->device_id].pub.opened)
err = pmBadPtr;
- else if(!descriptors[midi->device_id].pub.input)
+ else if(!pm_descriptors[midi->device_id].pub.input)
err = pmBadPtr;
/* First poll for data in the buffer...
* This either simply checks for data, or attempts first to fill the buffer
@@ -375,9 +558,7 @@ PMEXPORT int Pm_Read(PortMidiStream *stream, PmEvent *buffer, int32_t length) {
if (err != pmNoError) {
if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
- PM_HOST_ERROR_MSG_LEN);
- pm_hosterror = TRUE;
+ midi->dictionary->check_host_error(midi);
}
return pm_errmsg(err);
}
@@ -395,7 +576,7 @@ PMEXPORT int Pm_Read(PortMidiStream *stream, PmEvent *buffer, int32_t length) {
return n;
}
-PMEXPORT PmError Pm_Poll( PortMidiStream *stream )
+PMEXPORT PmError Pm_Poll(PortMidiStream *stream)
{
PmInternal *midi = (PmInternal *) stream;
PmError err;
@@ -404,23 +585,18 @@ PMEXPORT PmError Pm_Poll( PortMidiStream *stream )
/* arg checking */
if(midi == NULL)
err = pmBadPtr;
- else if (!descriptors[midi->device_id].pub.opened)
+ else if (!pm_descriptors[midi->device_id].pub.opened)
err = pmBadPtr;
- else if (!descriptors[midi->device_id].pub.input)
+ else if (!pm_descriptors[midi->device_id].pub.input)
err = pmBadPtr;
else
err = (*(midi->dictionary->poll))(midi);
if (err != pmNoError) {
- if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
- PM_HOST_ERROR_MSG_LEN);
- pm_hosterror = TRUE;
- }
return pm_errmsg(err);
}
- return !Pm_QueueEmpty(midi->queue);
+ return (PmError) !Pm_QueueEmpty(midi->queue);
}
@@ -432,11 +608,6 @@ static PmError pm_end_sysex(PmInternal *midi)
{
PmError err = (*midi->dictionary->end_sysex)(midi, 0);
midi->sysex_in_progress = FALSE;
- if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
- PM_HOST_ERROR_MSG_LEN);
- pm_hosterror = TRUE;
- }
return err;
}
@@ -445,7 +616,8 @@ static PmError pm_end_sysex(PmInternal *midi)
Pm_WriteSysEx all operate a state machine that "outputs" calls to
write_short, begin_sysex, write_byte, end_sysex, and write_realtime */
-PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t length)
+PMEXPORT PmError Pm_Write(PortMidiStream *stream, PmEvent *buffer,
+ int32_t length)
{
PmInternal *midi = (PmInternal *) stream;
PmError err = pmNoError;
@@ -456,9 +628,9 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
/* arg checking */
if(midi == NULL)
err = pmBadPtr;
- else if(!descriptors[midi->device_id].pub.opened)
+ else if(!pm_descriptors[midi->device_id].pub.opened)
err = pmBadPtr;
- else if(!descriptors[midi->device_id].pub.output)
+ else if(!pm_descriptors[midi->device_id].pub.output)
err = pmBadPtr;
else
err = pmNoError;
@@ -569,16 +741,15 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
err = (*midi->dictionary->write_flush)(midi, 0);
pm_write_error:
if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
- PM_HOST_ERROR_MSG_LEN);
- pm_hosterror = TRUE;
+ midi->dictionary->check_host_error(midi);
}
error_exit:
return pm_errmsg(err);
}
-PMEXPORT PmError Pm_WriteShort(PortMidiStream *stream, PmTimestamp when, PmMessage msg)
+PMEXPORT PmError Pm_WriteShort(PortMidiStream *stream, PmTimestamp when,
+ PmMessage msg)
{
PmEvent event;
@@ -666,79 +837,110 @@ end_of_sysex:
-PMEXPORT PmError Pm_OpenInput(PortMidiStream** stream,
- PmDeviceID inputDevice,
- void *inputDriverInfo,
- int32_t bufferSize,
- PmTimeProcPtr time_proc,
- void *time_info)
+PmError pm_create_internal(PmInternal **stream, PmDeviceID device_id,
+ int is_input, int latency, PmTimeProcPtr time_proc,
+ void *time_info, int buffer_size)
{
PmInternal *midi;
- PmError err = pmNoError;
- pm_hosterror = FALSE;
- *stream = NULL;
-
- /* arg checking */
- if (inputDevice < 0 || inputDevice >= pm_descriptor_index)
- err = pmInvalidDeviceId;
- else if (!descriptors[inputDevice].pub.input)
- err = pmInvalidDeviceId;
- else if(descriptors[inputDevice].pub.opened)
- err = pmInvalidDeviceId;
-
- if (err != pmNoError)
- goto error_return;
-
+ if (device_id < 0 || device_id >= pm_descriptor_len) {
+ return pmInvalidDeviceId;
+ }
+ if (latency < 0) { /* force a legal value */
+ latency = 0;
+ }
/* create portMidi internal data */
midi = (PmInternal *) pm_alloc(sizeof(PmInternal));
*stream = midi;
if (!midi) {
- err = pmInsufficientMemory;
- goto error_return;
+ return pmInsufficientMemory;
}
- midi->device_id = inputDevice;
- midi->write_flag = FALSE;
+ midi->device_id = device_id;
+ midi->is_input = is_input;
midi->time_proc = time_proc;
+ /* if latency != 0, we need a time reference for output.
+ we always need a time reference for input.
+ If none is provided, use PortTime library */
+ if (time_proc == NULL && (latency != 0 || is_input)) {
+ if (!Pt_Started())
+ Pt_Start(1, 0, 0);
+ /* time_get does not take a parameter, so coerce */
+ midi->time_proc = (PmTimeProcPtr) Pt_Time;
+ }
midi->time_info = time_info;
- /* windows adds timestamps in the driver and these are more accurate than
- using a time_proc, so do not automatically provide a time proc. Non-win
- implementations may want to provide a default time_proc in their
- system-specific midi_out_open() method.
- */
- if (bufferSize <= 0) bufferSize = 256; /* default buffer size */
- midi->queue = Pm_QueueCreate(bufferSize, (int32_t) sizeof(PmEvent));
- if (!midi->queue) {
- /* free portMidi data */
- *stream = NULL;
- pm_free(midi);
- err = pmInsufficientMemory;
- goto error_return;
+ if (is_input) {
+ midi->latency = 0; /* unused by input */
+ if (buffer_size <= 0) buffer_size = 256; /* default buffer size */
+ midi->queue = Pm_QueueCreate(buffer_size, (int32_t) sizeof(PmEvent));
+ if (!midi->queue) {
+ /* free portMidi data */
+ *stream = NULL;
+ pm_free(midi);
+ return pmInsufficientMemory;
+ }
+ } else {
+ /* if latency zero, output immediate (timestamps ignored) */
+ /* if latency < 0, use 0 but don't return an error */
+ if (latency < 0) latency = 0;
+ midi->latency = latency;
+ midi->queue = NULL; /* unused by output; input needs to allocate: */
}
- midi->buffer_len = bufferSize; /* portMidi input storage */
- midi->latency = 0; /* not used */
+ midi->buffer_len = buffer_size; /* portMidi input storage */
midi->sysex_in_progress = FALSE;
midi->sysex_message = 0;
midi->sysex_message_count = 0;
- midi->filters = PM_FILT_ACTIVE;
+ midi->filters = (is_input ? PM_FILT_ACTIVE : 0);
midi->channel_mask = 0xFFFF;
midi->sync_time = 0;
midi->first_message = TRUE;
- midi->dictionary = descriptors[inputDevice].dictionary;
+ midi->api_info = NULL;
midi->fill_base = NULL;
midi->fill_offset_ptr = NULL;
midi->fill_length = 0;
- descriptors[inputDevice].internalDescriptor = midi;
+ midi->dictionary = pm_descriptors[device_id].dictionary;
+ pm_descriptors[device_id].pm_internal = midi;
+ return pmNoError;
+}
+
+
+PMEXPORT PmError Pm_OpenInput(PortMidiStream** stream,
+ PmDeviceID inputDevice,
+ void *inputDriverInfo,
+ int32_t bufferSize,
+ PmTimeProcPtr time_proc,
+ void *time_info)
+{
+ PmInternal *midi = NULL;
+ PmError err = pmNoError;
+ pm_hosterror = FALSE;
+ *stream = NULL; /* invariant: *stream == midi */
+
+ /* arg checking */
+ if (!pm_descriptors[inputDevice].pub.input)
+ err = pmInvalidDeviceId;
+ else if (pm_descriptors[inputDevice].pub.opened)
+ err = pmInvalidDeviceId;
+ if (err != pmNoError)
+ goto error_return;
+
+ /* common initialization of PmInternal structure (midi): */
+ err = pm_create_internal(&midi, inputDevice, TRUE, 0, time_proc,
+ time_info, bufferSize);
+ *stream = midi;
+ if (err) {
+ goto error_return;
+ }
+
/* open system dependent input device */
err = (*midi->dictionary->open)(midi, inputDriverInfo);
if (err) {
*stream = NULL;
- descriptors[inputDevice].internalDescriptor = NULL;
+ pm_descriptors[inputDevice].pm_internal = NULL;
/* free portMidi data */
Pm_QueueDestroy(midi->queue);
pm_free(midi);
} else {
/* portMidi input open successful */
- descriptors[inputDevice].pub.opened = TRUE;
+ pm_descriptors[inputDevice].pub.opened = TRUE;
}
error_return:
/* note: if there is a pmHostError, it is the responsibility
@@ -750,12 +952,12 @@ error_return:
PMEXPORT PmError Pm_OpenOutput(PortMidiStream** stream,
- PmDeviceID outputDevice,
- void *outputDriverInfo,
- int32_t bufferSize,
- PmTimeProcPtr time_proc,
- void *time_info,
- int32_t latency )
+ PmDeviceID outputDevice,
+ void *outputDriverInfo,
+ int32_t bufferSize,
+ PmTimeProcPtr time_proc,
+ void *time_info,
+ int32_t latency)
{
PmInternal *midi;
PmError err = pmNoError;
@@ -763,62 +965,33 @@ PMEXPORT PmError Pm_OpenOutput(PortMidiStream** stream,
*stream = NULL;
/* arg checking */
- if (outputDevice < 0 || outputDevice >= pm_descriptor_index)
+ if (outputDevice < 0 || outputDevice >= pm_descriptor_len)
err = pmInvalidDeviceId;
- else if (!descriptors[outputDevice].pub.output)
+ else if (!pm_descriptors[outputDevice].pub.output)
err = pmInvalidDeviceId;
- else if (descriptors[outputDevice].pub.opened)
+ else if (pm_descriptors[outputDevice].pub.opened)
err = pmInvalidDeviceId;
if (err != pmNoError)
goto error_return;
- /* create portMidi internal data */
- midi = (PmInternal *) pm_alloc(sizeof(PmInternal));
- *stream = midi;
- if (!midi) {
- err = pmInsufficientMemory;
+ /* common initialization of PmInternal structure (midi): */
+ err = pm_create_internal(&midi, outputDevice, FALSE, latency, time_proc,
+ time_info, bufferSize);
+ *stream = midi;
+ if (err) {
goto error_return;
}
- midi->device_id = outputDevice;
- midi->write_flag = TRUE;
- midi->time_proc = time_proc;
- /* if latency > 0, we need a time reference. If none is provided,
- use PortTime library */
- if (time_proc == NULL && latency != 0) {
- if (!Pt_Started())
- Pt_Start(1, 0, 0);
- /* time_get does not take a parameter, so coerce */
- midi->time_proc = (PmTimeProcPtr) Pt_Time;
- }
- midi->time_info = time_info;
- midi->buffer_len = bufferSize;
- midi->queue = NULL; /* unused by output */
- /* if latency zero, output immediate (timestamps ignored) */
- /* if latency < 0, use 0 but don't return an error */
- if (latency < 0) latency = 0;
- midi->latency = latency;
- midi->sysex_in_progress = FALSE;
- midi->sysex_message = 0; /* unused by output */
- midi->sysex_message_count = 0; /* unused by output */
- midi->filters = 0; /* not used for output */
- midi->channel_mask = 0xFFFF;
- midi->sync_time = 0;
- midi->first_message = TRUE;
- midi->dictionary = descriptors[outputDevice].dictionary;
- midi->fill_base = NULL;
- midi->fill_offset_ptr = NULL;
- midi->fill_length = 0;
- descriptors[outputDevice].internalDescriptor = midi;
+
/* open system dependent output device */
err = (*midi->dictionary->open)(midi, outputDriverInfo);
if (err) {
*stream = NULL;
- descriptors[outputDevice].internalDescriptor = NULL;
+ pm_descriptors[outputDevice].pm_internal = NULL;
/* free portMidi data */
pm_free(midi);
} else {
/* portMidi input open successful */
- descriptors[outputDevice].pub.opened = TRUE;
+ pm_descriptors[outputDevice].pub.opened = TRUE;
}
error_return:
/* note: system-dependent code must set pm_hosterror and
@@ -828,6 +1001,91 @@ error_return:
}
+static PmError create_virtual_device(const char *name, const char *interf,
+ void *device_info, int is_input)
+{
+ PmError err = pmNoError;
+ int i;
+ pm_hosterror = FALSE;
+
+ /* arg checking */
+ if (!name) {
+ err = pmInvalidDeviceId;
+ goto error_return;
+ }
+
+ Pm_Initialize(); /* just in case */
+
+ /* create the virtual device */
+ if (pm_interf_list_len == 0) {
+ return pmNotImplemented;
+ }
+ if (!interf) {
+ /* default interface is the first one */
+ interf = pm_interf_list[0].interf;
+ }
+ /* look up and call the create_fn for interf(ace), e.g. "CoreMIDI" */
+ for (i = 0; i < pm_interf_list_len; i++) {
+ if (strcmp(pm_interf_list[i].interf, interf) == 0) {
+ int id = (*pm_interf_list[i].create_fn)(is_input,
+ name, device_info);
+ /* id could be pmNameConflict or an actual descriptor index */
+ if (id >= 0) {
+ pm_descriptors[id].pub.is_virtual = TRUE;
+ }
+ err = id;
+ goto error_return;
+ }
+ }
+ err = pmInterfaceNotSupported;
+
+error_return:
+ /* note: if there is a pmHostError, it is the responsibility
+ * of the system-dependent code (*midi->dictionary->open)()
+ * to set pm_hosterror and pm_hosterror_text
+ */
+ return pm_errmsg(err);
+}
+
+
+PMEXPORT PmError Pm_CreateVirtualInput(const char *name,
+ const char *interf,
+ void *deviceInfo)
+{
+ return create_virtual_device(name, interf, deviceInfo, TRUE);
+}
+
+PMEXPORT PmError Pm_CreateVirtualOutput(const char *name, const char *interf,
+ void *deviceInfo)
+{
+ return create_virtual_device(name, interf, deviceInfo, FALSE);
+}
+
+PmError Pm_DeleteVirtualDevice(PmDeviceID id)
+{
+ int i;
+ const char *interf = pm_descriptors[id].pub.interf;
+ PmError err = pmBadData; /* returned if we cannot find the interface-
+ * specific delete function */
+ /* arg checking */
+ if (id < 0 || id >= pm_descriptor_len ||
+ pm_descriptors[id].pub.opened || pm_descriptors[id].deleted) {
+ return pmInvalidDeviceId;
+ }
+ /* delete function pointer is in interfaces list */
+ for (i = 0; i < pm_interf_list_len; i++) {
+ if (strcmp(pm_interf_list[i].interf, interf) == 0) {
+ err = (*pm_interf_list[i].delete_fn)(id);
+ break;
+ }
+ }
+ pm_descriptors[id].deleted = TRUE;
+ /* (pm_internal should already be NULL because !pub.opened) */
+ pm_descriptors[id].pm_internal = NULL;
+ pm_descriptors[id].descriptor = NULL;
+ return err;
+}
+
PMEXPORT PmError Pm_SetChannelMask(PortMidiStream *stream, int mask)
{
PmInternal *midi = (PmInternal *) stream;
@@ -842,14 +1100,15 @@ PMEXPORT PmError Pm_SetChannelMask(PortMidiStream *stream, int mask)
}
-PMEXPORT PmError Pm_SetFilter(PortMidiStream *stream, int32_t filters) {
+PMEXPORT PmError Pm_SetFilter(PortMidiStream *stream, int32_t filters)
+{
PmInternal *midi = (PmInternal *) stream;
PmError err = pmNoError;
/* arg checking */
if (midi == NULL)
err = pmBadPtr;
- else if (!descriptors[midi->device_id].pub.opened)
+ else if (!pm_descriptors[midi->device_id].pub.opened)
err = pmBadPtr;
else
midi->filters = filters;
@@ -857,7 +1116,8 @@ PMEXPORT PmError Pm_SetFilter(PortMidiStream *stream, int32_t filters) {
}
-PMEXPORT PmError Pm_Close( PortMidiStream *stream ) {
+PMEXPORT PmError Pm_Close(PortMidiStream *stream)
+{
PmInternal *midi = (PmInternal *) stream;
PmError err = pmNoError;
@@ -866,10 +1126,10 @@ PMEXPORT PmError Pm_Close( PortMidiStream *stream ) {
if (midi == NULL) /* midi must point to something */
err = pmBadPtr;
/* if it is an open device, the device_id will be valid */
- else if (midi->device_id < 0 || midi->device_id >= pm_descriptor_index)
+ else if (midi->device_id < 0 || midi->device_id >= pm_descriptor_len)
err = pmBadPtr;
/* and the device should be in the opened state */
- else if (!descriptors[midi->device_id].pub.opened)
+ else if (!pm_descriptors[midi->device_id].pub.opened)
err = pmBadPtr;
if (err != pmNoError)
@@ -878,8 +1138,8 @@ PMEXPORT PmError Pm_Close( PortMidiStream *stream ) {
/* close the device */
err = (*midi->dictionary->close)(midi);
/* even if an error occurred, continue with cleanup */
- descriptors[midi->device_id].internalDescriptor = NULL;
- descriptors[midi->device_id].pub.opened = FALSE;
+ pm_descriptors[midi->device_id].pm_internal = NULL;
+ pm_descriptors[midi->device_id].pub.opened = FALSE;
if (midi->queue) Pm_QueueDestroy(midi->queue);
pm_free(midi);
error_return:
@@ -889,56 +1149,57 @@ error_return:
return pm_errmsg(err);
}
-PmError Pm_Synchronize( PortMidiStream* stream ) {
+PmError Pm_Synchronize(PortMidiStream* stream)
+{
PmInternal *midi = (PmInternal *) stream;
PmError err = pmNoError;
if (midi == NULL)
err = pmBadPtr;
- else if (!descriptors[midi->device_id].pub.output)
+ else if (!pm_descriptors[midi->device_id].pub.output)
err = pmBadPtr;
- else if (!descriptors[midi->device_id].pub.opened)
+ else if (!pm_descriptors[midi->device_id].pub.opened)
err = pmBadPtr;
else
midi->first_message = TRUE;
return err;
}
-PMEXPORT PmError Pm_Abort( PortMidiStream* stream ) {
+PMEXPORT PmError Pm_Abort(PortMidiStream* stream)
+{
PmInternal *midi = (PmInternal *) stream;
PmError err;
/* arg checking */
if (midi == NULL)
err = pmBadPtr;
- else if (!descriptors[midi->device_id].pub.output)
+ else if (!pm_descriptors[midi->device_id].pub.output)
err = pmBadPtr;
- else if (!descriptors[midi->device_id].pub.opened)
+ else if (!pm_descriptors[midi->device_id].pub.opened)
err = pmBadPtr;
else
err = (*midi->dictionary->abort)(midi);
if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
- PM_HOST_ERROR_MSG_LEN);
- pm_hosterror = TRUE;
+ midi->dictionary->check_host_error(midi);
}
return pm_errmsg(err);
}
-/* pm_channel_filtered returns non-zero if the channel mask is blocking the current channel */
+/* pm_channel_filtered returns non-zero if the channel mask is
+ blocking the current channel */
#define pm_channel_filtered(status, mask) \
((((status) & 0xF0) != 0xF0) && (!(Pm_Channel((status) & 0x0F) & (mask))))
-/* The following two functions will checks to see if a MIDI message matches
- the filtering criteria. Since the sysex routines only want to filter realtime messages,
- we need to have separate routines.
+/* The following two functions will checks to see if a MIDI message
+ matches the filtering criteria. Since the sysex routines only want
+ to filter realtime messages, we need to have separate routines.
*/
-/* pm_realtime_filtered returns non-zero if the filter will kill the current message.
- Note that only realtime messages are checked here.
+/* pm_realtime_filtered returns non-zero if the filter will kill the
+ current message. Note that only realtime messages are checked here.
*/
#define pm_realtime_filtered(status, filters) \
((((status) & 0xF0) == 0xF0) && ((1 << ((status) & 0xF)) & (filters)))
@@ -959,18 +1220,21 @@ PMEXPORT PmError Pm_Abort( PortMidiStream* stream ) {
}*/
-/* pm_status_filtered returns non-zero if a filter will kill the current message, based on status.
- Note that sysex and real time are not checked. It is up to the subsystem (winmm, core midi, alsa)
- to filter sysex, as it is handled more easily and efficiently at that level.
- Realtime message are filtered in pm_realtime_filtered.
+/* pm_status_filtered returns non-zero if a filter will kill the
+ current message, based on status. Note that sysex and real time are
+ not checked. It is up to the subsystem (winmm, core midi, alsa) to
+ filter sysex, as it is handled more easily and efficiently at that
+ level. Realtime message are filtered in pm_realtime_filtered.
*/
-#define pm_status_filtered(status, filters) ((1 << (16 + ((status) >> 4))) & (filters))
+#define pm_status_filtered(status, filters) \
+ ((1 << (16 + ((status) >> 4))) & (filters))
/*
return ((status == MIDI_NOTE_ON) && (filters & PM_FILT_NOTE))
|| ((status == MIDI_NOTE_OFF) && (filters & PM_FILT_NOTE))
- || ((status == MIDI_CHANNEL_AT) && (filters & PM_FILT_CHANNEL_AFTERTOUCH))
+ || ((status == MIDI_CHANNEL_AT) &&
+ (filters & PM_FILT_CHANNEL_AFTERTOUCH))
|| ((status == MIDI_POLY_AT) && (filters & PM_FILT_POLY_AFTERTOUCH))
|| ((status == MIDI_PROGRAM) && (filters & PM_FILT_PROGRAM))
|| ((status == MIDI_CONTROL) && (filters & PM_FILT_CONTROL))
diff --git a/3rdparty/portmidi/pm_common/portmidi.h b/3rdparty/portmidi/pm_common/portmidi.h
index c57432fae12..1a4c7e7d0ab 100644
--- a/3rdparty/portmidi/pm_common/portmidi.h
+++ b/3rdparty/portmidi/pm_common/portmidi.h
@@ -48,69 +48,43 @@ extern "C" {
*
* NOTES ON HOST ERROR REPORTING:
*
- * PortMidi errors (of type PmError) are generic, system-independent errors.
- * When an error does not map to one of the more specific PmErrors, the
- * catch-all code pmHostError is returned. This means that PortMidi has
- * retained a more specific system-dependent error code. The caller can
- * get more information by calling Pm_HasHostError() to test if there is
- * a pending host error, and Pm_GetHostErrorText() to get a text string
- * describing the error. Host errors are reported on a per-device basis
- * because only after you open a device does PortMidi have a place to
- * record the host error code. I.e. only
- * those routines that receive a (PortMidiStream *) argument check and
- * report errors. One exception to this is that Pm_OpenInput() and
- * Pm_OpenOutput() can report errors even though when an error occurs,
- * there is no PortMidiStream* to hold the error. Fortunately, both
- * of these functions return any error immediately, so we do not really
- * need per-device error memory. Instead, any host error code is stored
- * in a global, pmHostError is returned, and the user can call
- * Pm_GetHostErrorText() to get the error message (and the invalid stream
- * parameter will be ignored.) The functions
- * pm_init and pm_term do not fail or raise
- * errors. The job of pm_init is to locate all available devices so that
- * the caller can get information via PmDeviceInfo(). If an error occurs,
- * the device is simply not listed as available.
- *
- * Host errors come in two flavors:
- * a) host error
- * b) host error during callback
- * These can occur w/midi input or output devices. (b) can only happen
- * asynchronously (during callback routines), whereas (a) only occurs while
- * synchronously running PortMidi and any resulting system dependent calls.
- * Both (a) and (b) are reported by the next read or write call. You can
- * also query for asynchronous errors (b) at any time by calling
- * Pm_HasHostError().
+ * PortMidi errors (of type PmError) are generic,
+ * system-independent errors. When an error does not map to one of
+ * the more specific PmErrors, the catch-all code pmHostError is
+ * returned. This means that PortMidi has retained a more specific
+ * system-dependent error code. The caller can get more information
+ * by calling Pm_GetHostErrorText() to get a text string describing
+ * the error. Host errors can arise asynchronously from callbacks,
+ * * so there is no specific return code. Asynchronous errors are
+ * checked and reported by Pm_Poll. You can also check by calling
+ * Pm_HasHostError(). If this returns TRUE, Pm_GetHostErrorText()
+ * will return a text description of the error.
*
* NOTES ON COMPILE-TIME SWITCHES
*
- * DEBUG assumes stdio and a console. Use this if you want automatic, simple
- * error reporting, e.g. for prototyping. If you are using MFC or some
- * other graphical interface with no console, DEBUG probably should be
- * undefined.
- * PM_CHECK_ERRORS more-or-less takes over error checking for return values,
- * stopping your program and printing error messages when an error
- * occurs. This also uses stdio for console text I/O.
+ * DEBUG assumes stdio and a console. Use this if you want
+ * automatic, simple error reporting, e.g. for prototyping. If
+ * you are using MFC or some other graphical interface with no
+ * console, DEBUG probably should be undefined.
+ * PM_CHECK_ERRORS more-or-less takes over error checking for
+ * return values, stopping your program and printing error
+ * messages when an error occurs. This also uses stdio for
+ * console text I/O. You can selectively disable this error
+ * checking by declaring extern int pm_check_errors; and
+ * setting pm_check_errors = FALSE; You can also reenable.
*/
+/**
+ \defgroup grp_basics Basic Definitions
+ @{
+*/
-#ifndef WIN32
-// Linux and OS X have stdint.h
#include <stdint.h>
-#else
-#ifndef INT32_DEFINED
-// rather than having users install a special .h file for windows,
-// just put the required definitions inline here. porttime.h uses
-// these too, so the definitions are (unfortunately) duplicated there
-typedef int int32_t;
-typedef unsigned int uint32_t;
-#define INT32_DEFINED
-#endif
-#endif
-//#ifdef _WINDLL
-//#define PMEXPORT __declspec(dllexport)
-//#else
+#ifdef _WINDLL
+#define PMEXPORT __declspec(dllexport)
+#else
#define PMEXPORT
-//#endif
+#endif
#ifndef FALSE
#define FALSE 0
@@ -122,113 +96,206 @@ typedef unsigned int uint32_t;
/* default size of buffers for sysex transmission: */
#define PM_DEFAULT_SYSEX_BUFFER_SIZE 1024
-/** List of portmidi errors.*/
+
typedef enum {
- pmNoError = 0,
- pmNoData = 0, /**< A "no error" return that also indicates no data avail. */
- pmGotData = 1, /**< A "no error" return that also indicates data available */
+ pmNoError = 0, /**< Normal return value indicating no error. */
+ pmNoData = 0, /**< @brief No error, also indicates no data available.
+ * Use this constant where a value greater than zero would
+ * indicate data is available.
+ */
+ pmGotData = 1, /**< A "no error" return also indicating data available. */
pmHostError = -10000,
- pmInvalidDeviceId, /** out of range or
+ pmInvalidDeviceId, /**< Out of range or
* output device when input is requested or
* input device when output is requested or
- * device is already opened
+ * device is already opened.
*/
pmInsufficientMemory,
pmBufferTooSmall,
pmBufferOverflow,
- pmBadPtr, /* PortMidiStream parameter is NULL or
+ pmBadPtr, /**< #PortMidiStream parameter is NULL or
* stream is not opened or
* stream is output when input is required or
- * stream is input when output is required */
- pmBadData, /** illegal midi data, e.g. missing EOX */
+ * stream is input when output is required. */
+ pmBadData, /**< Illegal midi data, e.g., missing EOX. */
pmInternalError,
- pmBufferMaxSize /** buffer is already as large as it can be */
- /* NOTE: If you add a new error type, be sure to update Pm_GetErrorText() */
-} PmError;
+ pmBufferMaxSize, /**< Buffer is already as large as it can be. */
+ pmNotImplemented, /**< The function is not implemented, nothing was done. */
+ pmInterfaceNotSupported, /**< The requested interface is not supported. */
+ pmNameConflict /**< Cannot create virtual device because name is taken. */
+ /* NOTE: If you add a new error type, you must update Pm_GetErrorText(). */
+} PmError; /**< @brief @enum PmError PortMidi error code; a common return type.
+ * No error is indicated by zero; errors are indicated by < 0.
+ */
/**
- Pm_Initialize() is the library initialisation function - call this before
+ Pm_Initialize() is the library initialization function - call this before
using the library.
+
+ *NOTE:* PortMidi scans for available devices when #Pm_Initialize
+ is called. To observe subsequent changes in the available
+ devices, you must shut down PortMidi by calling #Pm_Terminate and
+ then restart by calling #Pm_Initialize again. *IMPORTANT*: On
+ MacOS, #Pm_Initialize *must* always be called on the same
+ thread. Otherwise, changes in the available MIDI devices will
+ *not* be seen by PortMidi. As an example, if you start PortMidi in
+ a thread for processing MIDI, do not try to rescan devices by
+ calling #Pm_Initialize in a GUI thread. Instead, start PortMidi
+ the first time and every time in the GUI thread. Alternatively,
+ let the GUI request a restart in the MIDI thread. (These
+ restrictions only apply to macOS.) Speaking of threads, on all
+ platforms, you are allowed to call #Pm_Initialize in one thread,
+ yet send MIDI or poll for incoming MIDI in another
+ thread. However, PortMidi is not "thread safe," which means you
+ cannot allow threads to call PortMidi functions concurrently.
+
+ @return pmNoError.
+
+ PortMidi is designed to support multiple interfaces (such as ALSA,
+ CoreMIDI and WinMM). It is possible to return pmNoError because there
+ are no supported interfaces. In that case, zero devices will be
+ available.
*/
-PMEXPORT PmError Pm_Initialize( void );
+PMEXPORT PmError Pm_Initialize(void);
/**
Pm_Terminate() is the library termination function - call this after
using the library.
*/
-PMEXPORT PmError Pm_Terminate( void );
+PMEXPORT PmError Pm_Terminate(void);
-/** A single PortMidiStream is a descriptor for an open MIDI device.
-*/
+/** Represents an open MIDI device. */
typedef void PortMidiStream;
+
+/** A shorter form of #PortMidiStream. */
#define PmStream PortMidiStream
-/**
- Test whether stream has a pending host error. Normally, the client finds
- out about errors through returned error codes, but some errors can occur
- asynchronously where the client does not
- explicitly call a function, and therefore cannot receive an error code.
- The client can test for a pending error using Pm_HasHostError(). If true,
- the error can be accessed and cleared by calling Pm_GetErrorText().
- Errors are also cleared by calling other functions that can return
- errors, e.g. Pm_OpenInput(), Pm_OpenOutput(), Pm_Read(), Pm_Write(). The
- client does not need to call Pm_HasHostError(). Any pending error will be
- reported the next time the client performs an explicit function call on
- the stream, e.g. an input or output operation. Until the error is cleared,
- no new error codes will be obtained, even for a different stream.
+/** Test whether stream has a pending host error. Normally, the client
+ finds out about errors through returned error codes, but some
+ errors can occur asynchronously where the client does not
+ explicitly call a function, and therefore cannot receive an error
+ code. The client can test for a pending error using
+ Pm_HasHostError(). If true, the error can be accessed by calling
+ Pm_GetHostErrorText(). Pm_Poll() is similar to Pm_HasHostError(),
+ but if there is no error, it will return TRUE (1) if there is a
+ pending input message.
*/
-PMEXPORT int Pm_HasHostError( PortMidiStream * stream );
+PMEXPORT int Pm_HasHostError(PortMidiStream * stream);
-/** Translate portmidi error number into human readable message.
+/** Translate portmidi error number into human readable message.
These strings are constants (set at compile time) so client has
- no need to allocate storage
+ no need to allocate storage.
*/
-PMEXPORT const char *Pm_GetErrorText( PmError errnum );
+PMEXPORT const char *Pm_GetErrorText(PmError errnum);
-/** Translate portmidi host error into human readable message.
+/** Translate portmidi host error into human readable message.
These strings are computed at run time, so client has to allocate storage.
After this routine executes, the host error is cleared.
*/
PMEXPORT void Pm_GetHostErrorText(char * msg, unsigned int len);
-#define HDRLENGTH 50
-#define PM_HOST_ERROR_MSG_LEN 256u /* any host error msg will occupy less
- than this number of characters */
-
-/**
- Device enumeration mechanism.
-
- Device ids range from 0 to Pm_CountDevices()-1.
+/** Any host error msg has at most this many characters, including EOS. */
+#define PM_HOST_ERROR_MSG_LEN 256u
+/** Devices are represented as small integers. Device ids range from 0
+ to Pm_CountDevices()-1. Pm_GetDeviceInfo() is used to get information
+ about the device, and Pm_OpenInput() and PmOpenOutput() are used to
+ open the device.
*/
typedef int PmDeviceID;
+
+/** This PmDeviceID (constant) value represents no device and may be
+ returned by Pm_GetDefaultInputDeviceID() or
+ Pm_GetDefaultOutputDeviceID() if no default exists.
+*/
#define pmNoDevice -1
-typedef struct {
- int structVersion; /**< this internal structure version */
- const char *interf; /**< underlying MIDI API, e.g. MMSystem or DirectX */
- const char *name; /**< device name, e.g. USB MidiSport 1x1 */
- int input; /**< true iff input is available */
- int output; /**< true iff output is available */
- int opened; /**< used by generic PortMidi code to do error checking on arguments */
+/** MIDI device information is returned in this structure, which is
+ owned by PortMidi and read-only to applications. See Pm_GetDeviceInfo().
+*/
+#define PM_DEVICEINFO_VERS 200
+typedef struct {
+ int structVersion; /**< @brief this internal structure version */
+ const char *interf; /**< @brief underlying MIDI API, e.g.
+ "MMSystem" or "DirectX" */
+ char *name; /**< @brief device name, e.g. "USB MidiSport 1x1" */
+ int input; /**< @brief true iff input is available */
+ int output; /**< @brief true iff output is available */
+ int opened; /**< @brief used by generic PortMidi for error checking */
+ int is_virtual; /**< @brief true iff this is/was a virtual device */
} PmDeviceInfo;
-/** Get devices count, ids range from 0 to Pm_CountDevices()-1. */
-PMEXPORT int Pm_CountDevices( void );
-/**
- Pm_GetDefaultInputDeviceID(), Pm_GetDefaultOutputDeviceID()
+/** Get devices count, ids range from 0 to Pm_CountDevices()-1. */
+PMEXPORT int Pm_CountDevices(void);
+/**
Return the default device ID or pmNoDevice if there are no devices.
The result (but not pmNoDevice) can be passed to Pm_OpenMidi().
- The default device can be specified using a small application
- named pmdefaults that is part of the PortMidi distribution. This
- program in turn uses the Java Preferences object created by
+ The use of these functions is not recommended. There is no natural
+ "default device" on any system, so defaults must be set by users.
+ (Currently, PortMidi just returns the first device it finds as
+ "default".) The (unsolved) problem is how to implement simple
+ preferences for a cross-platform library. (More notes follow, but
+ you can stop reading here.)
+
+ To implement preferences, you need (1) a standard place to put
+ them, (2) a representation for the preferences, (3) a graphical
+ interface to test and set preferences, (4) a "natural" way to
+ invoke the preference-setting program. To solve (3), PortMidi
+ originally chose to use Java and Swing to implement a
+ cross-platform GUI program called "pmdefaults." Java's Preferences
+ class already provide a location (problem 1) and representation
+ (problem 2). However, this solution was complex, requiring
+ PortMidi to parse binary Java preference files and requiring users
+ to install and invoke Java programs. It did not seem possible to
+ integrate pmdefaults into the system preference subsystems on
+ macOS, Windows, and Linux, so the user had to install and run
+ pmdefaults as an application. Moreover, Java is falling out of
+ favor.
+
+ A simpler solution is pass the burden to applications. It is easy
+ to scan devices with PortMidi and build a device menu, and to save
+ menu selections in application preferences for next time. This is
+ my recommendation for any GUI program. For simple command-line
+ applications and utilities, see pm_test where all the test
+ programs now accept device numbers on the command line and/or
+ prompt for their entry.
+
+ Some advice for preferences: MIDI devices used to be built-in or
+ plug-in cards, so the numbers rarely changed. Now MIDI devices are
+ often plug-in USB devices, so device numbers change, and you
+ probably need to design to reinitialize PortMidi to rescan
+ devices. MIDI is pretty stateless, so this isn't a big problem,
+ although it means you cannot find a new device while playing or
+ recording MIDI.
+
+ Since device numbering can change whenever a USB device is plugged
+ in, preferences should record *names* of devices rather than
+ device numbers. It is simple enough to use string matching to find
+ a prefered device, so PortMidi does not provide any built-in
+ lookup function. See below for details of the Java preferences API.
+
+ In the future, I would like to remove the legacy code that parses
+ Java preference data (macOS plist, linux prefs.xml, Windows
+ registry entries) and replace it with something more useful. Maybe
+ something really simple: $HOME/.portmidi? Or maybe a new
+ pmdefaults written with PyGame? Or use QT? If applications write
+ their own preferences, maybe a minimal command line preference
+ setter is all that's needed? Or maybe command line application
+ users are happy without a preference system? Comments and
+ proposals are welcome.
+
+ For completeness, here is a description of the original use of
+ Java for preference setting: The default device can be specified
+ using a small application named pmdefaults that is part of the
+ PortMidi distribution. This program in turn uses the Java
+ Preferences object created by
java.util.prefs.Preferences.userRoot().node("/PortMidi"); the
- preference is set by calling
- prefs.put("PM_RECOMMENDED_OUTPUT_DEVICE", prefName);
- or prefs.put("PM_RECOMMENDED_INPUT_DEVICE", prefName);
+ preference is set by calling
+ prefs.put("PM_RECOMMENDED_OUTPUT_DEVICE", prefName); or
+ prefs.put("PM_RECOMMENDED_INPUT_DEVICE", prefName);
In the statements above, prefName is a string describing the
MIDI device in the form "interf, name" where interf identifies
@@ -248,143 +315,274 @@ PMEXPORT int Pm_CountDevices( void );
the entire preference string is interpreted as a name, and the
interface part is the empty string, which matches anything.
- On the MAC, preferences are stored in
- /Users/$NAME/Library/Preferences/com.apple.java.util.prefs.plist
+ On the MAC, preferences are stored in
+ /Users/$NAME/Library/Preferences/com.apple.java.util.prefs.plist
which is a binary file. In addition to the pmdefaults program,
there are utilities that can read and edit this preference file.
-
- On the PC,
-
- On Linux,
-
+ On Windows, the Registry is used. On Linux, preferences are in an
+ XML file.
*/
-PMEXPORT PmDeviceID Pm_GetDefaultInputDeviceID( void );
-/** see PmDeviceID Pm_GetDefaultInputDeviceID() */
-PMEXPORT PmDeviceID Pm_GetDefaultOutputDeviceID( void );
+PMEXPORT PmDeviceID Pm_GetDefaultInputDeviceID(void);
-/**
- PmTimestamp is used to represent a millisecond clock with arbitrary
- start time. The type is used for all MIDI timestampes and clocks.
+/** @brief see PmDeviceID Pm_GetDefaultInputDeviceID() */
+PMEXPORT PmDeviceID Pm_GetDefaultOutputDeviceID(void);
+
+/** Represents a millisecond clock with arbitrary start time.
+ This type is used for all MIDI timestamps and clocks.
*/
typedef int32_t PmTimestamp;
typedef PmTimestamp (*PmTimeProcPtr)(void *time_info);
/** TRUE if t1 before t2 */
#define PmBefore(t1,t2) ((t1-t2) < 0)
+/** @} */
/**
\defgroup grp_device Input/Output Devices Handling
@{
*/
-/**
- Pm_GetDeviceInfo() returns a pointer to a PmDeviceInfo structure
- referring to the device specified by id.
- If id is out of range the function returns NULL.
+/** Get a PmDeviceInfo structure describing a MIDI device.
+
+ @param id the device to be queried.
- The returned structure is owned by the PortMidi implementation and must
- not be manipulated or freed. The pointer is guaranteed to be valid
- between calls to Pm_Initialize() and Pm_Terminate().
-*/
-PMEXPORT const PmDeviceInfo* Pm_GetDeviceInfo( PmDeviceID id );
+ If \p id is out of range or if the device designates a deleted
+ virtual device, the function returns NULL.
-/**
- Pm_OpenInput() and Pm_OpenOutput() open devices.
+ The returned structure is owned by the PortMidi implementation and
+ must not be manipulated or freed. The pointer is guaranteed to be
+ valid between calls to Pm_Initialize() and Pm_Terminate().
+*/
+PMEXPORT const PmDeviceInfo *Pm_GetDeviceInfo(PmDeviceID id);
- stream is the address of a PortMidiStream pointer which will receive
- a pointer to the newly opened stream.
+/** Open a MIDI device for input.
- inputDevice is the id of the device used for input (see PmDeviceID above).
+ @param stream the address of a #PortMidiStream pointer which will
+ receive a pointer to the newly opened stream.
- inputDriverInfo is a pointer to an optional driver specific data structure
- containing additional information for device setup or handle processing.
- inputDriverInfo is never required for correct operation. If not used
- inputDriverInfo should be NULL.
+ @param inputDevice the ID of the device to be opened (see #PmDeviceID).
- outputDevice is the id of the device used for output (see PmDeviceID above.)
+ @param inputDriverInfo a pointer to an optional driver-specific
+ data structure containing additional information for device setup
+ or handle processing. This parameter is never required for correct
+ operation. If not used, specify NULL.
- outputDriverInfo is a pointer to an optional driver specific data structure
- containing additional information for device setup or handle processing.
- outputDriverInfo is never required for correct operation. If not used
- outputDriverInfo should be NULL.
+ @param bufferSize the number of input events to be buffered
+ waiting to be read using Pm_Read(). Messages will be lost if the
+ number of unread messages exceeds this value.
- For input, the buffersize specifies the number of input events to be
- buffered waiting to be read using Pm_Read(). For output, buffersize
- specifies the number of output events to be buffered waiting for output.
- (In some cases -- see below -- PortMidi does not buffer output at all
- and merely passes data to a lower-level API, in which case buffersize
- is ignored.)
-
- latency is the delay in milliseconds applied to timestamps to determine
- when the output should actually occur. (If latency is < 0, 0 is assumed.)
- If latency is zero, timestamps are ignored and all output is delivered
- immediately. If latency is greater than zero, output is delayed until the
- message timestamp plus the latency. (NOTE: the time is measured relative
- to the time source indicated by time_proc. Timestamps are absolute,
- not relative delays or offsets.) In some cases, PortMidi can obtain
- better timing than your application by passing timestamps along to the
- device driver or hardware. Latency may also help you to synchronize midi
- data to audio data by matching midi latency to the audio buffer latency.
-
- time_proc is a pointer to a procedure that returns time in milliseconds. It
- may be NULL, in which case a default millisecond timebase (PortTime) is
- used. If the application wants to use PortTime, it should start the timer
- (call Pt_Start) before calling Pm_OpenInput or Pm_OpenOutput. If the
- application tries to start the timer *after* Pm_OpenInput or Pm_OpenOutput,
- it may get a ptAlreadyStarted error from Pt_Start, and the application's
+ @param time_proc (address of) a procedure that returns time in
+ milliseconds. It may be NULL, in which case a default millisecond
+ timebase (PortTime) is used. If the application wants to use
+ PortTime, it should start the timer (call Pt_Start) before calling
+ Pm_OpenInput or Pm_OpenOutput. If the application tries to start
+ the timer *after* Pm_OpenInput or Pm_OpenOutput, it may get a
+ ptAlreadyStarted error from Pt_Start, and the application's
preferred time resolution and callback function will be ignored.
- time_proc result values are appended to incoming MIDI data, and time_proc
- times are used to schedule outgoing MIDI data (when latency is non-zero).
+ \p time_proc result values are appended to incoming MIDI data,
+ normally by mapping system-provided timestamps to the \p time_proc
+ timestamps to maintain the precision of system-provided
+ timestamps.
- time_info is a pointer passed to time_proc.
+ @param time_info is a pointer passed to time_proc.
- Example: If I provide a timestamp of 5000, latency is 1, and time_proc
- returns 4990, then the desired output time will be when time_proc returns
- timestamp+latency = 5001. This will be 5001-4990 = 11ms from now.
-
- return value:
- Upon success Pm_Open() returns PmNoError and places a pointer to a
- valid PortMidiStream in the stream argument.
- If a call to Pm_Open() fails a nonzero error code is returned (see
- PMError above) and the value of port is invalid.
+ @return #pmNoError and places a pointer to a valid
+ #PortMidiStream in the stream argument. If the open operation
+ fails, a nonzero error code is returned (see #PMError) and
+ the value of stream is invalid.
Any stream that is successfully opened should eventually be closed
by calling Pm_Close().
-
*/
-PMEXPORT PmError Pm_OpenInput( PortMidiStream** stream,
+PMEXPORT PmError Pm_OpenInput(PortMidiStream** stream,
PmDeviceID inputDevice,
void *inputDriverInfo,
int32_t bufferSize,
PmTimeProcPtr time_proc,
- void *time_info );
+ void *time_info);
+
+/** Open a MIDI device for output.
+
+ @param stream the address of a #PortMidiStream pointer which will
+ receive a pointer to the newly opened stream.
+
+ @param outputDevice the ID of the device to be opened (see #PmDeviceID).
+
+ @param outputDriverInfo a pointer to an optional driver-specific
+ data structure containing additional information for device setup
+ or handle processing. This parameter is never required for correct
+ operation. If not used, specify NULL.
+
+ @param bufferSize the number of output events to be buffered
+ waiting for output. In some cases -- see below -- PortMidi does
+ not buffer output at all and merely passes data to a lower-level
+ API, in which case \p bufferSize is ignored. Since MIDI speeds now
+ vary from 1 to 50 or more messages per ms (over USB), put some
+ thought into this number. E.g. if latency is 20ms and you want to
+ burst 100 messages in that time (5000 messages per second), you
+ should set \p bufferSize to at least 100. The default on Windows
+ assumes an average rate of 500 messages per second and in this
+ example, output would be slowed waiting for free buffers.
+
+ @param latency the delay in milliseconds applied to timestamps
+ to determine when the output should actually occur. (If latency is
+ < 0, 0 is assumed.) If latency is zero, timestamps are ignored
+ and all output is delivered immediately. If latency is greater
+ than zero, output is delayed until the message timestamp plus the
+ latency. (NOTE: the time is measured relative to the time source
+ indicated by time_proc. Timestamps are absolute, not relative
+ delays or offsets.) In some cases, PortMidi can obtain better
+ timing than your application by passing timestamps along to the
+ device driver or hardware, so the best strategy to minimize jitter
+ is: wait until the real time to send the message, compute the
+ message, attach the *ideal* output time (not the current real
+ time, because some time may have elapsed), and send the
+ message. The \p latency will be added to the timestamp, and
+ provided the elapsed computation time has not exceeded \p latency,
+ the message will be delivered according to the timestamp. If the
+ real time is already past the timestamp, the message will be
+ delivered as soon as possible. Latency may also help you to
+ synchronize MIDI data to audio data by matching \p latency to the
+ audio buffer latency.
+
+ @param time_proc (address of) a pointer to a procedure that
+ returns time in milliseconds. It may be NULL, in which case a
+ default millisecond timebase (PortTime) is used. If the
+ application wants to use PortTime, it should start the timer (call
+ Pt_Start) before calling #Pm_OpenInput or #Pm_OpenOutput. If the
+ application tries to start the timer *after* #Pm_OpenInput or
+ #Pm_OpenOutput, it may get a #ptAlreadyStarted error from #Pt_Start,
+ and the application's preferred time resolution and callback
+ function will be ignored. \p time_proc times are used to schedule
+ outgoing MIDI data (when latency is non-zero), usually by mapping
+ from time_proc timestamps to internal system timestamps to
+ maintain the precision of system-supported timing.
+
+ @param time_info a pointer passed to time_proc.
+
+ @return #pmNoError and places a pointer to a valid #PortMidiStream
+ in the stream argument. If the operation fails, a nonzero error
+ code is returned (see PMError) and the value of \p stream is
+ invalid.
+
+ Note: ALSA appears to have a fixed-size priority queue for timed
+ output messages. Testing indicates the queue can hold a little
+ over 400 3-byte MIDI messages. Thus, you can send 10,000
+ messages/second if the latency is 30ms (30ms * 10000 msgs/sec *
+ 0.001 sec/ms = 300 msgs), but not if the latency is 50ms
+ (resulting in about 500 pending messages, which is greater than
+ the 400 message limit). Since timestamps in ALSA are relative,
+ they are of less value than absolute timestamps in macOS and
+ Windows. This is a limitation of ALSA and apparently a design
+ flaw.
+
+ Example 1: If I provide a timestamp of 5000, latency is 1, and
+ time_proc returns 4990, then the desired output time will be when
+ time_proc returns timestamp+latency = 5001. This will be 5001-4990
+ = 11ms from now.
+
+ Example 2: If I want to send at exactly 5010, and latency is 10, I
+ should wait until 5000, compute the messages and provide a
+ timestamp of 5000. As long as computation takes less than 10ms,
+ the message will be delivered at time 5010.
+
+ Example 3 (recommended): It is often convenient to ignore latency.
+ E.g. if a sequence says to output at time 5010, just wait until
+ 5010, compute the message and use 5010 for the timestamp. Delivery
+ will then be at 5010+latency, but unless you are synchronizing to
+ something else, the absolute delay by latency will not matter.
-PMEXPORT PmError Pm_OpenOutput( PortMidiStream** stream,
+ Any stream that is successfully opened should eventually be closed
+ by calling Pm_Close().
+*/
+PMEXPORT PmError Pm_OpenOutput(PortMidiStream** stream,
PmDeviceID outputDevice,
void *outputDriverInfo,
int32_t bufferSize,
PmTimeProcPtr time_proc,
void *time_info,
- int32_t latency );
+ int32_t latency);
+
+/** Create a virtual input device.
+
+ @param name gives the virtual device name, which is visible to
+ other applications.
+
+ @param interf is the interface (System API) used to create the
+ device Default interfaces are "MMSystem", "CoreMIDI" and
+ "ALSA". Currently, these are the only ones implemented, but future
+ implementations could support DirectMusic, Jack, sndio, or others.
+
+ @param deviceInfo contains interface-dependent additional
+ information, e.g., hints or options. There are none at present, and
+ NULL is the recommended value.
+
+ @return a device ID or #pmNameConflict (\p name is invalid or
+ already exists) or #pmInterfaceNotSupported (\p interf is does not
+ match a supported interface).
+
+ The created virtual device appears to other applications as if it
+ is an output device. The device must be opened to obtain a stream
+ and read from it.
+
+ Virtual devices are not supported by Windows (Multimedia API). Calls
+ on Windows do nothing except return #pmNotImplemented.
+*/
+PMEXPORT PmError Pm_CreateVirtualInput(const char *name,
+ const char *interf,
+ void *deviceInfo);
+
+/** Create a virtual output device.
+
+ @param name gives the virtual device name, which is visible to
+ other applications.
+
+ @param interf is the interface (System API) used to create the
+ device Default interfaces are "MMSystem", "CoreMIDI" and
+ "ALSA". Currently, these are the only ones implemented, but future
+ implementations could support DirectMusic, Jack, sndio, or others.
+
+ @param deviceInfo contains interface-dependent additional
+ information, e.g., hints or options. There are none at present, and
+ NULL is the recommended value.
+
+ @return a device ID or #pmInvalidDeviceId (\p name is invalid or
+ already exists) or #pmInterfaceNotSupported (\p interf is does not
+ match a supported interface).
+
+ The created virtual device appears to other applications as if it
+ is an input device. The device must be opened to obtain a stream
+ and write to it.
+
+ Virtual devices are not supported by Windows (Multimedia API). Calls
+ on Windows do nothing except return #pmNotImplemented.
+*/
+PMEXPORT PmError Pm_CreateVirtualOutput(const char *name,
+ const char *interf,
+ void *deviceInfo);
+
+/** Remove a virtual device.
+
+ @param device a device ID (small integer) designating the device.
+
+ The device is removed; other applications can no longer see or open
+ this virtual device, which may be either for input or output. The
+ device must not be open. The device ID may be reused, but existing
+ devices are not renumbered. This means that the device ID could be
+ in the range from 0 to #Pm_CountDevices(), yet the device ID does
+ not designate a device. In that case, passing the ID to
+ #Pm_GetDeviceInfo() will return NULL.
+
+ @return #pmNoError if the device was deleted or #pmInvalidDeviceId
+ if the device is open, already deleted, or \p device is out of
+ range.
+*/
+PMEXPORT PmError Pm_DeleteVirtualDevice(PmDeviceID device);
/** @} */
/**
- \defgroup grp_events_filters Events and Filters Handling
+ @defgroup grp_events_filters Events and Filters Handling
@{
*/
-/* \function PmError Pm_SetFilter( PortMidiStream* stream, int32_t filters )
- Pm_SetFilter() sets filters on an open input stream to drop selected
- input types. By default, only active sensing messages are filtered.
- To prohibit, say, active sensing and sysex messages, call
- Pm_SetFilter(stream, PM_FILT_ACTIVE | PM_FILT_SYSEX);
-
- Filtering is useful when midi routing or midi thru functionality is being
- provided by the user application.
- For example, you may want to exclude timing messages (clock, MTC, start/stop/continue),
- while allowing note-related messages to pass.
- Or you may be using a sequencer or drum-machine for MIDI clock information but want to
- exclude any notes it may play.
- */
-
/* Filter bit-mask definitions */
/** filter active sensing messages (0xFE): */
#define PM_FILT_ACTIVE (1 << 0x0E)
@@ -412,7 +610,8 @@ PMEXPORT PmError Pm_OpenOutput( PortMidiStream** stream,
/** per-note aftertouch (0xA0-0xAF) */
#define PM_FILT_POLY_AFTERTOUCH (1 << 0x1A)
/** filter both channel and poly aftertouch */
-#define PM_FILT_AFTERTOUCH (PM_FILT_CHANNEL_AFTERTOUCH | PM_FILT_POLY_AFTERTOUCH)
+#define PM_FILT_AFTERTOUCH (PM_FILT_CHANNEL_AFTERTOUCH | \
+ PM_FILT_POLY_AFTERTOUCH)
/** Program changes (0xC0-0xCF) */
#define PM_FILT_PROGRAM (1 << 0x1C)
/** Control Changes (CC's) (0xB0-0xBF)*/
@@ -425,20 +624,48 @@ PMEXPORT PmError Pm_OpenOutput( PortMidiStream** stream,
#define PM_FILT_SONG_POSITION (1 << 0x02)
/** Song Select (0xF3)*/
#define PM_FILT_SONG_SELECT (1 << 0x03)
-/** Tuning request (0xF6)*/
+/** Tuning request (0xF6) */
#define PM_FILT_TUNE (1 << 0x06)
/** All System Common messages (mtc, song position, song select, tune request) */
-#define PM_FILT_SYSTEMCOMMON (PM_FILT_MTC | PM_FILT_SONG_POSITION | PM_FILT_SONG_SELECT | PM_FILT_TUNE)
+#define PM_FILT_SYSTEMCOMMON (PM_FILT_MTC | PM_FILT_SONG_POSITION | \
+ PM_FILT_SONG_SELECT | PM_FILT_TUNE)
+
+
+/* Set filters on an open input stream to drop selected input types.
+
+ @param stream an open MIDI input stream.
+ @param filters indicate message types to filter (block).
-PMEXPORT PmError Pm_SetFilter( PortMidiStream* stream, int32_t filters );
+ @return #pmNoError or an error code.
+ By default, only active sensing messages are filtered.
+ To prohibit, say, active sensing and sysex messages, call
+ Pm_SetFilter(stream, PM_FILT_ACTIVE | PM_FILT_SYSEX);
+
+ Filtering is useful when midi routing or midi thru functionality
+ is being provided by the user application.
+ For example, you may want to exclude timing messages (clock, MTC,
+ start/stop/continue), while allowing note-related messages to pass.
+ Or you may be using a sequencer or drum-machine for MIDI clock
+ information but want to exclude any notes it may play.
+ */
+PMEXPORT PmError Pm_SetFilter(PortMidiStream* stream, int32_t filters);
+
+/** Create a mask that filters one channel. */
#define Pm_Channel(channel) (1<<(channel))
-/**
- Pm_SetChannelMask() filters incoming messages based on channel.
- The mask is a 16-bit bitfield corresponding to appropriate channels.
- The Pm_Channel macro can assist in calling this function.
- i.e. to set receive only input on channel 1, call with
+
+/** Filter incoming messages based on channel.
+
+ @param stream an open MIDI input stream.
+
+ @param mask indicates channels to be received.
+
+ @return #pmNoError or an error code.
+
+ The \p mask is a 16-bit bitfield corresponding to appropriate channels.
+ The #Pm_Channel macro can assist in calling this function.
+ I.e. to receive only input on channel 1, call with
Pm_SetChannelMask(Pm_Channel(1));
Multiple channels should be OR'd together, like
Pm_SetChannelMask(Pm_Channel(10) | Pm_Channel(11))
@@ -451,71 +678,94 @@ PMEXPORT PmError Pm_SetFilter( PortMidiStream* stream, int32_t filters );
*/
PMEXPORT PmError Pm_SetChannelMask(PortMidiStream *stream, int mask);
-/**
- Pm_Abort() terminates outgoing messages immediately
- The caller should immediately close the output port;
- this call may result in transmission of a partial midi message.
- There is no abort for Midi input because the user can simply
- ignore messages in the buffer and close an input device at
- any time.
+/** Terminate outgoing messages immediately.
+
+ @param stream an open MIDI output stream.
+
+ @result #pmNoError or an error code.
+
+ The caller should immediately close the output port; this call may
+ result in transmission of a partial MIDI message. There is no
+ abort for Midi input because the user can simply ignore messages
+ in the buffer and close an input device at any time. If the
+ specified behavior cannot be achieved through the system-level
+ interface (ALSA, CoreMIDI, etc.), the behavior may be that of
+ Pm_Close().
*/
-PMEXPORT PmError Pm_Abort( PortMidiStream* stream );
+PMEXPORT PmError Pm_Abort(PortMidiStream* stream);
-/**
- Pm_Close() closes a midi stream, flushing any pending buffers.
- (PortMidi attempts to close open streams when the application
- exits -- this is particularly difficult under Windows.)
-*/
-PMEXPORT PmError Pm_Close( PortMidiStream* stream );
+/** Close a midi stream, flush any pending buffers if possible.
-/**
- Pm_Synchronize() instructs PortMidi to (re)synchronize to the
- time_proc passed when the stream was opened. Typically, this
- is used when the stream must be opened before the time_proc
- reference is actually advancing. In this case, message timing
- may be erratic, but since timestamps of zero mean
- "send immediately," initialization messages with zero timestamps
- can be written without a functioning time reference and without
- problems. Before the first MIDI message with a non-zero
- timestamp is written to the stream, the time reference must
- begin to advance (for example, if the time_proc computes time
- based on audio samples, time might begin to advance when an
- audio stream becomes active). After time_proc return values
- become valid, and BEFORE writing the first non-zero timestamped
- MIDI message, call Pm_Synchronize() so that PortMidi can observe
- the difference between the current time_proc value and its
- MIDI stream time.
+ @param stream an open MIDI input or output stream.
+
+ @result #pmNoError or an error code.
+
+ If the system-level interface (ALSA, CoreMIDI, etc.) does not
+ support flushing remaining messages, the behavior may be one of
+ the following (most preferred first): block until all pending
+ timestamped messages are delivered; deliver messages to a server
+ or kernel process for later delivery but return immediately; drop
+ messages (as in Pm_Abort()). Therefore, to be safe, applications
+ should wait until the output queue is empty before calling
+ Pm_Close(). E.g. calling Pt_Sleep(100 + latency); will give a
+ 100ms "cushion" beyond latency (if any) before closing.
+*/
+PMEXPORT PmError Pm_Close(PortMidiStream* stream);
+
+/** (re)synchronize to the time_proc passed when the stream was opened.
+
+ @param stream an open MIDI input or output stream.
+
+ @result #pmNoError or an error code.
+
+ Typically, this is used when the stream must be opened before the
+ time_proc reference is actually advancing. In this case, message
+ timing may be erratic, but since timestamps of zero mean "send
+ immediately," initialization messages with zero timestamps can be
+ written without a functioning time reference and without
+ problems. Before the first MIDI message with a non-zero timestamp
+ is written to the stream, the time reference must begin to advance
+ (for example, if the time_proc computes time based on audio
+ samples, time might begin to advance when an audio stream becomes
+ active). After time_proc return values become valid, and BEFORE
+ writing the first non-zero timestamped MIDI message, call
+ Pm_Synchronize() so that PortMidi can observe the difference
+ between the current time_proc value and its MIDI stream time.
- In the more normal case where time_proc
- values advance continuously, there is no need to call
- Pm_Synchronize. PortMidi will always synchronize at the
- first output message and periodically thereafter.
+ In the more normal case where time_proc values advance
+ continuously, there is no need to call #Pm_Synchronize. PortMidi
+ will always synchronize at the first output message and
+ periodically thereafter.
*/
-PmError Pm_Synchronize( PortMidiStream* stream );
+PMEXPORT PmError Pm_Synchronize(PortMidiStream* stream);
-/**
- Pm_Message() encodes a short Midi message into a 32-bit word. If data1
+/** Encode a short Midi message into a 32-bit word. If data1
and/or data2 are not present, use zero.
-
- Pm_MessageStatus(), Pm_MessageData1(), and
- Pm_MessageData2() extract fields from a 32-bit midi message.
*/
#define Pm_Message(status, data1, data2) \
((((data2) << 16) & 0xFF0000) | \
(((data1) << 8) & 0xFF00) | \
((status) & 0xFF))
+/** Extract the status field from a 32-bit midi message. */
#define Pm_MessageStatus(msg) ((msg) & 0xFF)
+/** Extract the 1st data field (e.g., pitch) from a 32-bit midi message. */
#define Pm_MessageData1(msg) (((msg) >> 8) & 0xFF)
+/** Extract the 2nd data field (e.g., velocity) from a 32-bit midi message. */
#define Pm_MessageData2(msg) (((msg) >> 16) & 0xFF)
-typedef int32_t PmMessage; /**< see PmEvent */
+typedef uint32_t PmMessage; /**< @brief see #PmEvent */
/**
- All midi data comes in the form of PmEvent structures. A sysex
+ All MIDI data comes in the form of PmEvent structures. A sysex
message is encoded as a sequence of PmEvent structures, with each
structure carrying 4 bytes of the message, i.e. only the first
PmEvent carries the status byte.
+ All other MIDI messages take 1 to 3 bytes and are encoded in a whole
+ PmMessage with status in the low-order byte and remaining bytes
+ unused, i.e., a 3-byte note-on message will occupy 3 low-order bytes
+ of PmMessage, leaving the high-order byte unused.
+
Note that MIDI allows nested messages: the so-called "real-time" MIDI
messages can be inserted into the MIDI byte stream at any location,
including within a sysex message. MIDI real-time messages are one-byte
@@ -555,8 +805,8 @@ typedef int32_t PmMessage; /**< see PmEvent */
messages should be sent in the correct order, and timestamps MUST
be non-decreasing. See also "Example" for Pm_OpenOutput() above.
- A sysex message will generally fill many PmEvent structures. On
- output to a PortMidiStream with non-zero latency, the first timestamp
+ A sysex message will generally fill many #PmEvent structures. On
+ output to a #PortMidiStream with non-zero latency, the first timestamp
on sysex message data will determine the time to begin sending the
message. PortMidi implementations may ignore timestamps for the
remainder of the sysex message.
@@ -580,71 +830,127 @@ typedef struct {
PmTimestamp timestamp;
} PmEvent;
-/**
- @}
-*/
+/** @} */
+
/** \defgroup grp_io Reading and Writing Midi Messages
@{
*/
-/**
- Pm_Read() retrieves midi data into a buffer, and returns the number
- of events read. Result is a non-negative number unless an error occurs,
- in which case a PmError value will be returned.
+/** Retrieve midi data into a buffer.
- Buffer Overflow
+ @param stream the open input stream.
- The problem: if an input overflow occurs, data will be lost, ultimately
- because there is no flow control all the way back to the data source.
- When data is lost, the receiver should be notified and some sort of
- graceful recovery should take place, e.g. you shouldn't resume receiving
- in the middle of a long sysex message.
+ @return the number of events read, or, if the result is negative,
+ a #PmError value will be returned.
- With a lock-free fifo, which is pretty much what we're stuck with to
- enable portability to the Mac, it's tricky for the producer and consumer
- to synchronously reset the buffer and resume normal operation.
+ The Buffer Overflow Problem
- Solution: the buffer managed by PortMidi will be flushed when an overflow
- occurs. The consumer (Pm_Read()) gets an error message (pmBufferOverflow)
- and ordinary processing resumes as soon as a new message arrives. The
- remainder of a partial sysex message is not considered to be a "new
- message" and will be flushed as well.
+ The problem: if an input overflow occurs, data will be lost,
+ ultimately because there is no flow control all the way back to
+ the data source. When data is lost, the receiver should be
+ notified and some sort of graceful recovery should take place,
+ e.g. you shouldn't resume receiving in the middle of a long sysex
+ message.
+ With a lock-free fifo, which is pretty much what we're stuck with
+ to enable portability to the Mac, it's tricky for the producer and
+ consumer to synchronously reset the buffer and resume normal
+ operation.
+
+ Solution: the entire buffer managed by PortMidi will be flushed
+ when an overflow occurs. The consumer (Pm_Read()) gets an error
+ message (#pmBufferOverflow) and ordinary processing resumes as
+ soon as a new message arrives. The remainder of a partial sysex
+ message is not considered to be a "new message" and will be
+ flushed as well.
*/
-PMEXPORT int Pm_Read( PortMidiStream *stream, PmEvent *buffer, int32_t length );
+PMEXPORT int Pm_Read(PortMidiStream *stream, PmEvent *buffer, int32_t length);
-/**
- Pm_Poll() tests whether input is available,
- returning TRUE, FALSE, or an error value.
+/** Test whether input is available.
+
+ @param stream an open input stream.
+
+ @return TRUE, FALSE, or an error value.
+
+ If there was an asynchronous error, pmHostError is returned and you must
+ call again to determine if input is (also) available.
+
+ You should probably *not* use this function. Call Pm_Read()
+ instead. If it returns 0, then there is no data available. It is
+ possible for Pm_Poll() to return TRUE before the complete message
+ is available, so Pm_Read() could return 0 even after Pm_Poll()
+ returns TRUE. Only call Pm_Poll() if you want to know that data is
+ probably available even though you are not ready to receive data.
*/
-PMEXPORT PmError Pm_Poll( PortMidiStream *stream);
+PMEXPORT PmError Pm_Poll(PortMidiStream *stream);
-/**
- Pm_Write() writes midi data from a buffer. This may contain:
+/** Write MIDI data from a buffer.
+
+ @param stream an open output stream.
+
+ @param buffer (address of) an array of MIDI event data.
+
+ @param length the length of the \p buffer.
+
+ @return TRUE, FALSE, or an error value.
+
+ \b buffer may contain:
- short messages
- or
- sysex messages that are converted into a sequence of PmEvent
structures, e.g. sending data from a file or forwarding them
- from midi input.
+ from midi input, with 4 SysEx bytes per PmEvent message,
+ low-order byte first, until the last message, which may
+ contain from 1 to 4 bytes ending in MIDI EOX (0xF7).
+ - PortMidi allows 1-byte real-time messages to be embedded
+ within SysEx messages, but only on 4-byte boundaries so
+ that SysEx data always uses a full 4 bytes (except possibly
+ at the end). Each real-time message always occupies a full
+ PmEvent (3 of the 4 bytes in the PmEvent's message are
+ ignored) even when embedded in a SysEx message.
Use Pm_WriteSysEx() to write a sysex message stored as a contiguous
array of bytes.
Sysex data may contain embedded real-time messages.
+
+ \p buffer is managed by the caller. The buffer may be destroyed
+ as soon as this call returns.
*/
-PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t length );
+PMEXPORT PmError Pm_Write(PortMidiStream *stream, PmEvent *buffer,
+ int32_t length);
-/**
- Pm_WriteShort() writes a timestamped non-system-exclusive midi message.
- Messages are delivered in order as received, and timestamps must be
- non-decreasing. (But timestamps are ignored if the stream was opened
- with latency = 0.)
+/** Write a timestamped non-system-exclusive midi message.
+
+ @param stream an open output stream.
+
+ @param when timestamp for the event.
+
+ @param msg the data for the event.
+
+ @result #pmNoError or an error code.
+
+ Messages are delivered in order, and timestamps must be
+ non-decreasing. (But timestamps are ignored if the stream was
+ opened with latency = 0, and otherwise, non-decreasing timestamps
+ are "corrected" to the lowest valid value.)
*/
-PMEXPORT PmError Pm_WriteShort( PortMidiStream *stream, PmTimestamp when, int32_t msg);
+PMEXPORT PmError Pm_WriteShort(PortMidiStream *stream, PmTimestamp when,
+ PmMessage msg);
-/**
- Pm_WriteSysEx() writes a timestamped system-exclusive midi message.
+/** Write a timestamped system-exclusive midi message.
+
+ @param stream an open output stream.
+
+ @param when timestamp for the event.
+
+ @param msg the sysex message, terminated with an EOX status byte.
+
+ @result #pmNoError or an error code.
+
+ \p msg is managed by the caller and may be destroyed when this
+ call returns.
*/
-PMEXPORT PmError Pm_WriteSysEx( PortMidiStream *stream, PmTimestamp when, unsigned char *msg);
+PMEXPORT PmError Pm_WriteSysEx(PortMidiStream *stream, PmTimestamp when,
+ unsigned char *msg);
/** @} */
diff --git a/3rdparty/portmidi/pm_csharp/README.txt b/3rdparty/portmidi/pm_csharp/README.txt
deleted file mode 100644
index 06a1ad4e390..00000000000
--- a/3rdparty/portmidi/pm_csharp/README.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-This code was offered by Aaron Oxford as is. The pm_managed directory contains the code. If you develop a more complete C# wrapper for PortMidi, please consider contributing your code to the project. -RBD
-
----- from Aaron Oxford ----
-
-I've attached the managed C++ project which I've inserted into my 2005 version of PortMIDI's VS solution. I wouldn't think the functions I've implemented would have changed so it all should still work with the latest version of PM. Obviously you won't want to permanently embed this since it means the whole solution can only be built under VS2005, but it's easy for a VS2005 user to insert the project after the solution is converted or even just build it separately.
-
-Making the managed wrapper turned out to be dead easy in the end (it was more of a battle finding the correct build settings & SDK's and learning to configure VS than anything else). Anyone wanting to use something I've not implemented yet simply needs to add more stubs like this
-
- int Pm_Initialize()
- {
- ::Pm_Initialize();
- return 0;
- }
-
-to the code. To call from C# it's just a matter of
-
- ManagedPortMIDI mpm = new ManagedPortMIDI();
- int err = mpm.Pm_Initialize();
-
-Anyway as the little code example above indicates, the support really is basic and more likely than not to break at the first hint of something unexpected. As I said, I'd be happy to contribute but I don't think there's much to contribute yet. :-)
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/AssemblyInfo.cpp b/3rdparty/portmidi/pm_csharp/pm_managed/AssemblyInfo.cpp
deleted file mode 100644
index 84033ec021d..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/AssemblyInfo.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "stdafx.h"
-
-using namespace System;
-using namespace System::Reflection;
-using namespace System::Runtime::CompilerServices;
-using namespace System::Runtime::InteropServices;
-using namespace System::Security::Permissions;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly:AssemblyTitleAttribute("pm_managed")];
-[assembly:AssemblyDescriptionAttribute("")];
-[assembly:AssemblyConfigurationAttribute("")];
-[assembly:AssemblyCompanyAttribute("Innovative Computer Solutions")];
-[assembly:AssemblyProductAttribute("pm_managed")];
-[assembly:AssemblyCopyrightAttribute("Copyright (c) Innovative Computer Solutions 2006")];
-[assembly:AssemblyTrademarkAttribute("")];
-[assembly:AssemblyCultureAttribute("")];
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the value or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly:AssemblyVersionAttribute("1.0.*")];
-
-[assembly:ComVisible(false)];
-
-[assembly:CLSCompliantAttribute(true)];
-
-[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/ReadMe.txt b/3rdparty/portmidi/pm_csharp/pm_managed/ReadMe.txt
deleted file mode 100644
index b01b06306cc..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/ReadMe.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-========================================================================
- DYNAMIC LINK LIBRARY : pm_managed Project Overview
-========================================================================
-
-AppWizard has created this pm_managed DLL for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your pm_managed application.
-
-pm_managed.vcproj
- This is the main project file for VC++ projects generated using an Application Wizard.
- It contains information about the version of Visual C++ that generated the file, and
- information about the platforms, configurations, and project features selected with the
- Application Wizard.
-
-pm_managed.cpp
- This is the main DLL source file.
-
-pm_managed.h
- This file contains a class declaration.
-
-AssemblyInfo.cpp
- Contains custom attributes for modifying assembly metadata.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/Stdafx.cpp b/3rdparty/portmidi/pm_csharp/pm_managed/Stdafx.cpp
deleted file mode 100644
index de4058cb399..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/Stdafx.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// pm_managed.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/Stdafx.h b/3rdparty/portmidi/pm_csharp/pm_managed/Stdafx.h
deleted file mode 100644
index 3cc4c24ef9f..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/Stdafx.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
-#pragma once
-
-
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/app.ico b/3rdparty/portmidi/pm_csharp/pm_managed/app.ico
deleted file mode 100644
index 3a5525fd794..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/app.ico
+++ /dev/null
Binary files differ
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/app.rc b/3rdparty/portmidi/pm_csharp/pm_managed/app.rc
deleted file mode 100644
index 41481bfc263..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/app.rc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon placed first or with lowest ID value becomes application icon
-
-LANGUAGE 9, 3
-#pragma code_page(1252)
-1 ICON "app.ico"
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
- "\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.cpp b/3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.cpp
deleted file mode 100644
index 5389314e613..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-// This is the main DLL file.
-
-#include "stdafx.h"
-
-#include "pm_managed.h"
-
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.h b/3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.h
deleted file mode 100644
index 21898368ec8..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// pm_managed.h
-
-#pragma once
-
-#include "portmidi.h"
-
-using namespace System;
-
-namespace pm_managed {
-
-
- public ref class MpmDeviceInfo
- {
- public:
- int structVersion;
- System::String^ interf; /* underlying MIDI API, e.g. MMSystem or DirectX */
- System::String^ name; /* device name, e.g. USB MidiSport 1x1 */
- bool input; /* true iff input is available */
- bool output; /* true iff output is available */
- int opened; /* used by generic PortMidi code to do error checking on arguments */
-
- MpmDeviceInfo(const PmDeviceInfo* info)
- {
- structVersion = info->structVersion;
- input = (info->input != 0);
- output = (info->output != 0);
- opened = info->opened;
-
- interf = gcnew System::String(info->interf);
- name = gcnew System::String(info->name);
- }
- };
-
- public ref class ManagedPortMIDI
- {
- public:
- int Pm_Initialize()
- {
- ::Pm_Initialize();
- return 0;
- }
-
- int Pm_CountDevices()
- {
- return ::Pm_CountDevices();
- }
-
- MpmDeviceInfo^ Pm_GetDeviceInfo(int id)
- {
- return gcnew MpmDeviceInfo(::Pm_GetDeviceInfo(id));
- }
- };
-}
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.vcproj b/3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.vcproj
deleted file mode 100644
index 4ce2052fe35..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/pm_managed.vcproj
+++ /dev/null
@@ -1,260 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="pm_managed"
- ProjectGUID="{65AABD9A-F5E3-4A30-8BC3-9C732B5447CF}"
- RootNamespace="pm_managed"
- Keyword="ManagedCProj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)pm_managed\$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="1"
- ManagedExtensions="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../pm_common"
- PreprocessorDefinitions="WIN32;_DEBUG"
- RuntimeLibrary="3"
- UsePrecompiledHeader="2"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(NoInherit) winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib ..\pm_win\Debug\pm_dll.lib"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- AssemblyDebug="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)pm_managed\$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="1"
- ManagedExtensions="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- FavorSizeOrSpeed="1"
- AdditionalIncludeDirectories="../pm_common"
- PreprocessorDefinitions="WIN32;NDEBUG"
- RuntimeLibrary="2"
- UsePrecompiledHeader="2"
- WarningLevel="3"
- DebugInformationFormat="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="$(NoInherit) winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib ..\pm_win\Release\pm_dll.lib"
- LinkIncremental="1"
- ManifestFile="$(OutDir)\pm_managed.dll.manifest"
- GenerateDebugInformation="false"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- OutputManifestFile="$(OutDir)\pm_managed.dll.manifest"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="rem mt.exe –manifest Release\pm_managed.dll.manifest -outputresource:Release\pm_managed.dll;2"
- />
- </Configuration>
- </Configurations>
- <References>
- <AssemblyReference
- RelativePath="System.dll"
- AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
- />
- <AssemblyReference
- RelativePath="System.Data.dll"
- AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
- />
- <AssemblyReference
- RelativePath="System.XML.dll"
- AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
- />
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\AssemblyInfo.cpp"
- >
- </File>
- <File
- RelativePath=".\pm_managed.cpp"
- >
- </File>
- <File
- RelativePath=".\Stdafx.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\pm_managed.h"
- >
- </File>
- <File
- RelativePath=".\resource.h"
- >
- </File>
- <File
- RelativePath=".\Stdafx.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- <File
- RelativePath=".\app.ico"
- >
- </File>
- <File
- RelativePath=".\app.rc"
- >
- </File>
- </Filter>
- <File
- RelativePath=".\ReadMe.txt"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_csharp/pm_managed/resource.h b/3rdparty/portmidi/pm_csharp/pm_managed/resource.h
deleted file mode 100644
index d5ac7c42aa0..00000000000
--- a/3rdparty/portmidi/pm_csharp/pm_managed/resource.h
+++ /dev/null
@@ -1,3 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by app.rc
diff --git a/3rdparty/portmidi/pm_dylib/CMakeLists.txt b/3rdparty/portmidi/pm_dylib/CMakeLists.txt
deleted file mode 100644
index f693dd6511a..00000000000
--- a/3rdparty/portmidi/pm_dylib/CMakeLists.txt
+++ /dev/null
@@ -1,127 +0,0 @@
-# pm_dylib
-
-# set the build directory for libraries to be in portmidi, not in
-# portmidi/pm_dylib
-if(APPLE OR WIN32)
- # set the build directory for .dylib libraries
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
- # the "archive" output directory says where to put portmidi.lib, the
- # static part of the lib/dll pair:
- set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
-
- # the first time CMake configures, save off CMake's built-in flags
- if(NOT DEFAULT_DEBUG_FLAGS)
- set(DEFAULT_DEBUG_FLAGS ${CMAKE_C_FLAGS_DEBUG} CACHE
- STRING "CMake's default debug flags" FORCE)
- set(DEFAULT_RELEASE_FLAGS ${CMAKE_C_FLAGS_RELEASE} CACHE
- STRING "CMake's default release flags" FORCE)
- else(NOT DEFAULT_DEBUG_FLAGS)
- message(STATUS "DEFAULT_DEBUG_FLAGS not nil: " ${DEFAULT_DEBUG_FLAGS})
- endif(NOT DEFAULT_DEBUG_FLAGS)
-else(APPLE OR WIN32)
- set(LINUX_FLAGS "-DPMALSA")
-endif(APPLE OR WIN32)
-
-macro(prepend_path RESULT PATH)
- set(${RESULT})
- foreach(FILE ${ARGN})
- list(APPEND ${RESULT} "${PATH}${FILE}")
- endforeach(FILE)
-endmacro(prepend_path)
-
-set(CMAKE_C_FLAGS_DEBUG
- "${DEFAULT_DEBUG_FLAGS} -DPM_CHECK_ERRORS=1 -DDEBUG ${LINUX_FLAGS}"
- CACHE STRING "enable extra checks for debugging" FORCE)
-
-set(CMAKE_C_FLAGS_RELEASE "${DEFAULT_RELEASE_FLAGS} ${LINUX_FLAGS}"
- CACHE STRING "flags for release version" FORCE)
-
-# first include the appropriate system-dependent file:
-if(UNIX)
- # add the -g switch for Linux and Mac OS X (not used in Win32)
- set (CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_C_FLAGS_DEBUG}"
- CACHE STRING "enable extra checks for debugging" FORCE)
- if(APPLE)
- set(MACSRC pmmacosxcm pmmac readbinaryplist finddefault)
- prepend_path(LIBSRC ../pm_mac/ ${MACSRC})
- list(APPEND LIBSRC ../porttime/ptmacosx_mach)
-
- include_directories(${CMAKE_OSX_SYSROOT}/Developer/Headers/FlatCarbon)
- set(FRAMEWORK_PATH ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks)
- set(COREAUDIO_LIB "${FRAMEWORK_PATH}/CoreAudio.framework")
- set(COREFOUNDATION_LIB "${FRAMEWORK_PATH}/CoreFoundation.framework")
- set(COREMIDI_LIB "${FRAMEWORK_PATH}/CoreMIDI.framework")
- set(CORESERVICES_LIB "${FRAMEWORK_PATH}/CoreServices.framework")
- set(PM_NEEDED_LIBS ${COREAUDIO_LIB} ${COREFOUNDATION_LIB}
- ${COREMIDI_LIB} ${CORESERVICES_LIB}
- CACHE INTERNAL "")
-
- set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
- set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
- set(INSTALL_NAME_DIR "/usr/local/lib")
- message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
- else(APPLE)
- # LINUX settings...
- include(FindJNI)
- # message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
- # message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
- # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
- # note: user might need to set JAVA_INCLUDE_PATH manually
- #
- # this will probably break on BSD and other Unix systems; the fix
- # depends on whether FindJNI can find Java or not. If yes, then
- # we should try to rely on automatically set JAVA_INCLUDE_PATH and
- # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH
- # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation
- # because JAVA_INCLUDE_PATH2 is pretty obscure)
- set(JAVA_INCLUDE_PATH ${JAVA_INCLUDE_PATH-UNKNOWN}
- CACHE STRING "where to find Java SDK include directory")
- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux)
- # libjvm.so is found relative to JAVA_INCLUDE_PATH:
- set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so)
-
- set(LINUXSRC pmlinuxalsa pmlinux finddefault)
- prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
- list(APPEND LIBSRC ../porttime/ptlinux)
-
- set(PM_NEEDED_LIBS pthread asound)
- endif(APPLE)
-else(UNIX)
- if(WIN32)
- # /MDd is multithread debug DLL, /MTd is multithread debug
- # /MD is multithread DLL, /MT is multithread
-
- include(FindJNI)
- # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
- set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../lib/jvm.lib)
-
- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
- # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
-
- set(WINSRC pmwin pmwinmm)
- prepend_path(LIBSRC ../pm_win/ ${WINSRC})
- list(APPEND LIBSRC ../porttime/ptwinmm)
- set(PM_NEEDED_LIBS winmm.lib)
- # message(STATUS "JAVAVM_LIB: " ${JAVAVM_LIB})
- endif(WIN32)
-endif(UNIX)
-set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVAVM_LIB})
-
-# this completes the list of library sources by adding shared code
-set(SHARED_FILES pmutil portmidi)
-prepend_path(SHARED_PATHS ../pm_common/ ${SHARED_FILES})
-list(APPEND LIBSRC ${SHARED_PATHS})
-
-add_library(portmidi-dynamic SHARED ${LIBSRC})
-set_target_properties(portmidi-dynamic PROPERTIES OUTPUT_NAME "portmidi")
-target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS})
-
-# install the libraries (Linux and Mac OS X command line)
-if(UNIX)
- INSTALL(TARGETS portmidi-dynamic
- LIBRARY DESTINATION /usr/local/lib
- ARCHIVE DESTINATION /usr/local/lib)
- INSTALL(FILES ../pm_common/portmidi.h ../porttime/porttime.h
- DESTINATION /usr/local/include)
-endif(UNIX)
diff --git a/3rdparty/portmidi/pm_dylib/README.txt b/3rdparty/portmidi/pm_dylib/README.txt
deleted file mode 100644
index 133a01e94ab..00000000000
--- a/3rdparty/portmidi/pm_dylib/README.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-pm_dylib
-
-The purpose of this directory is to provide a separate CMakeLists.txt
-file for building a dynamic link library version of portmidi. This
-version (in Windows) is linked using the Multithreaded C Runtime DLL
-whereas the static library version in ../pm_common uses the (static)
-Multithreaded C Runtime. There's no good reason not to build both
-versions of portmidi in ../pm_common, but (the current) Cmake
-has the restriction that you must either share compiler flags across
-configurations (debug and release) or across targets (static and
-dynamic). Here, we need individual settings for all combinations.
diff --git a/3rdparty/portmidi/pm_dylib/portmidi-dynamic.vcproj b/3rdparty/portmidi/pm_dylib/portmidi-dynamic.vcproj
deleted file mode 100644
index eeb83b3aecd..00000000000
--- a/3rdparty/portmidi/pm_dylib/portmidi-dynamic.vcproj
+++ /dev/null
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="portmidi-dynamic"
- ProjectGUID="{7283FAD1-7415-4061-A19A-FF5C7BCE9306}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="portmidi-dynamic.dir\Debug"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="3"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../Debug/portmidi.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;,portmidi_dynamic_EXPORTS"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib "
- OutputFile="..\Debug\portmidi.dll"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="..\Debug\portmidi.pdb"
- GenerateDebugInformation="TRUE"
- ImportLibrary="..\Debug\portmidi.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="portmidi-dynamic.dir\Release"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="2"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../Release/portmidi.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;,portmidi_dynamic_EXPORTS"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib "
- OutputFile="..\Release\portmidi.dll"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="..\Release\portmidi.pdb"
- ImportLibrary="..\Release\portmidi.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_win\pmwin.c">
- </File>
- <File
- RelativePath="..\pm_win\pmwinmm.c">
- </File>
- <File
- RelativePath="..\porttime\ptwinmm.c">
- </File>
- <File
- RelativePath="..\pm_common\pmutil.c">
- </File>
- <File
- RelativePath="..\pm_common\portmidi.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_haiku/pmhaiku.cpp b/3rdparty/portmidi/pm_haiku/pmhaiku.cpp
new file mode 100644
index 00000000000..6d21d8c5a67
--- /dev/null
+++ b/3rdparty/portmidi/pm_haiku/pmhaiku.cpp
@@ -0,0 +1,514 @@
+/* pmhaiku.cpp -- PortMidi os-dependent code */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <vector>
+#include <MidiConsumer.h>
+#include <MidiEndpoint.h>
+#include <MidiProducer.h>
+#include <MidiRoster.h>
+#include <MidiSynth.h>
+#include "portmidi.h"
+#include "pmutil.h"
+#include "pminternal.h"
+
+// as long as Java on Haiku uses ~/.java/... to store user preferences, we can directly reuse the Linux version
+// (it shouldn't, see https://github.com/haikuports/haikuports/issues/7119)
+extern "C" {
+#include "../pm_linux/finddefault.h"
+}
+
+namespace {
+ struct PmInputConsumer : BMidiLocalConsumer {
+ PmInputConsumer(PmInternal *midi) :
+ BMidiLocalConsumer("PortMidi input consumer"),
+ midi(midi)
+ {
+ }
+
+
+ void Data(uchar *data, size_t length, bool atomic, bigtime_t time)
+ {
+ if (!atomic)
+ return; // should these be also supported?
+
+ if (data[0] == B_SYS_EX_START) {
+ pm_read_bytes(midi, data, length, time / 1000);
+ } else {
+ PmEvent event;
+ switch (length) {
+ case 1:
+ event.message = Pm_Message(data[0], 0, 0);
+ break;
+ case 2:
+ event.message = Pm_Message(data[0], data[1], 0);
+ break;
+ case 3:
+ event.message = Pm_Message(data[0], data[1], data[2]);
+ break;
+ default:
+ printf("Unexpected message length for short message, got %" B_PRIuSIZE "\n", length);
+ break;
+ }
+ event.timestamp = time / 1000;
+ pm_read_short(midi, &event);
+ }
+ }
+
+ private:
+ PmInternal *midi;
+ };
+
+ struct PmOutputInfo {
+ BMidiLocalProducer *producer;
+ std::vector<unsigned char> sysexBuffer;
+ };
+
+ struct PmSynthOutputInfo {
+ BMidiSynth midiSynth;
+ std::vector<unsigned char> sysexBuffer;
+ };
+
+
+ PmTimestamp synchronize(PmInternal *midi)
+ {
+ return 0;
+ }
+
+
+ PmError in_open(PmInternal *midi, void *driverInfo)
+ {
+ int32 endpointID = (int32)(intptr_t)pm_descriptors[midi->device_id].descriptor;
+ BMidiProducer *producer = BMidiRoster::FindProducer(endpointID);
+ if (!producer)
+ return pmInvalidDeviceId;
+ PmInputConsumer *consumer = new PmInputConsumer(midi);
+ status_t status = producer->Connect(consumer);
+ if (status != B_OK) {
+ consumer->Release();
+ producer->Release();
+ strcpy(pm_hosterror_text, strerror(status));
+ pm_hosterror = TRUE;
+ return pmHostError;
+ }
+ midi->api_info = consumer;
+ producer->Release();
+ return pmNoError;
+ }
+
+
+ PmError in_abort(PmInternal *midi)
+ {
+ return pmNoError;
+ }
+
+
+ PmError in_close(PmInternal *midi)
+ {
+ int32 endpointID = (int32)(intptr_t)pm_descriptors[midi->device_id].descriptor;
+ BMidiProducer *producer = BMidiRoster::FindProducer(endpointID);
+ if (!producer)
+ return pmInvalidDeviceId;
+ PmInputConsumer *consumer = (PmInputConsumer*)midi->api_info;
+ status_t status = producer->Disconnect(consumer);
+ if (status != B_OK) {
+ consumer->Release();
+ producer->Release();
+ strcpy(pm_hosterror_text, strerror(status));
+ pm_hosterror = TRUE;
+ return pmHostError;
+ }
+ consumer->Release();
+ midi->api_info = NULL;
+ producer->Release();
+ return pmNoError;
+ }
+
+
+ PmError out_open(PmInternal *midi, void *driverInfo)
+ {
+ int32 endpointID = (int32)(intptr_t)pm_descriptors[midi->device_id].descriptor;
+ BMidiConsumer *consumer = BMidiRoster::FindConsumer(endpointID);
+ if (!consumer)
+ return pmInvalidDeviceId;
+ BMidiLocalProducer *producer = new BMidiLocalProducer("PortMidi output producer");
+ status_t status = producer->Connect(consumer);
+ if (status != B_OK) {
+ consumer->Release();
+ producer->Release();
+ strcpy(pm_hosterror_text, strerror(status));
+ pm_hosterror = TRUE;
+ return pmHostError;
+ }
+ PmOutputInfo *info = new PmOutputInfo;
+ info->producer = producer;
+ midi->api_info = info;
+ consumer->Release();
+ return pmNoError;
+ }
+
+
+ PmError out_abort(PmInternal *midi)
+ {
+ return pmNoError;
+ }
+
+
+ PmError out_close(PmInternal *midi)
+ {
+ int32 endpointID = (int32)(intptr_t)pm_descriptors[midi->device_id].descriptor;
+ BMidiConsumer *consumer = BMidiRoster::FindConsumer(endpointID);
+ if (!consumer)
+ return pmInvalidDeviceId;
+ PmOutputInfo *info = (PmOutputInfo*)midi->api_info;
+ status_t status = info->producer->Disconnect(consumer);
+ if (status != B_OK) {
+ consumer->Release();
+ midi->api_info = NULL;
+ info->producer->Release();
+ delete info;
+ strcpy(pm_hosterror_text, strerror(status));
+ pm_hosterror = TRUE;
+ return pmHostError;
+ }
+ consumer->Release();
+ midi->api_info = NULL;
+ info->producer->Release();
+ delete info;
+ return pmNoError;
+ }
+
+
+ // copied from the macOS implementation
+ size_t midi_length(uchar status)
+ {
+ int high, low;
+ static size_t high_lengths[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1, /* 0x00 through 0x70 */
+ 3, 3, 3, 3, 2, 2, 3, 1 /* 0x80 through 0xf0 */
+ };
+ static size_t low_lengths[] = {
+ 1, 2, 3, 2, 1, 1, 1, 1, /* 0xf0 through 0xf8 */
+ 1, 1, 1, 1, 1, 1, 1, 1 /* 0xf9 through 0xff */
+ };
+
+ high = status >> 4;
+ low = status & 15;
+
+ return (high != 0xF) ? high_lengths[high] : low_lengths[low];
+ }
+
+
+ PmError write_short(PmInternal *midi, PmEvent *buffer)
+ {
+ PmOutputInfo *info = (PmOutputInfo*)midi->api_info;
+ uchar data[3];
+ data[0] = Pm_MessageStatus(buffer->message);
+ data[1] = Pm_MessageData1(buffer->message);
+ data[2] = Pm_MessageData2(buffer->message);
+ size_t length = midi_length(data[0]);
+
+ info->producer->SprayData(data, length, true, buffer->timestamp * 1000);
+
+ // TODO: handle latency != 0
+ return pmNoError;
+ }
+
+
+ PmError begin_sysex(PmInternal *midi, PmTimestamp timestamp)
+ {
+ PmOutputInfo *info = (PmOutputInfo*)midi->api_info;
+ info->sysexBuffer.clear();
+ return pmNoError;
+ }
+
+
+ PmError end_sysex(PmInternal *midi, PmTimestamp timestamp)
+ {
+ PmOutputInfo *info = (PmOutputInfo*)midi->api_info;
+ info->producer->SpraySystemExclusive(&info->sysexBuffer[0], info->sysexBuffer.size(), timestamp * 1000);
+ info->sysexBuffer.clear();
+ return pmNoError;
+ }
+
+
+ PmError write_byte(PmInternal *midi, unsigned char byte, PmTimestamp timestamp)
+ {
+ PmOutputInfo *info = (PmOutputInfo*)midi->api_info;
+ info->sysexBuffer.push_back(byte);
+ return pmNoError;
+ }
+
+
+ PmError write_realtime(PmInternal *midi, PmEvent *buffer)
+ {
+ PmOutputInfo *info = (PmOutputInfo*)midi->api_info;
+ info->producer->SpraySystemRealTime(Pm_MessageStatus(buffer->message), buffer->timestamp * 1000);
+ return pmNoError;
+ }
+
+
+ PmError synth_open(PmInternal *midi, void *driverInfo)
+ {
+ PmSynthOutputInfo *info = new PmSynthOutputInfo;
+ info->midiSynth.EnableInput(true, true);
+ midi->api_info = info;
+ return pmNoError;
+ }
+
+
+ PmError synth_abort(PmInternal *midi)
+ {
+ return pmNoError;
+ }
+
+
+ PmError synth_close(PmInternal *midi)
+ {
+ PmSynthOutputInfo *info = (PmSynthOutputInfo*)midi->api_info;
+ delete info;
+ midi->api_info = NULL;
+ return pmNoError;
+ }
+
+
+ PmError write_short_synth(PmInternal *midi, PmEvent *buffer)
+ {
+ PmSynthOutputInfo *info = (PmSynthOutputInfo*)midi->api_info;
+ uchar data[3];
+ data[0] = Pm_MessageStatus(buffer->message);
+ data[1] = Pm_MessageData1(buffer->message);
+ data[2] = Pm_MessageData2(buffer->message);
+
+ switch(data[0] & 0xf0) {
+ case B_NOTE_OFF:
+ info->midiSynth.NoteOff((data[0] & 0x0f) + 1, data[1], data[2], buffer->timestamp);
+ break;
+ case B_NOTE_ON:
+ info->midiSynth.NoteOn((data[0] & 0x0f) + 1, data[1], data[2], buffer->timestamp);
+ break;
+ case B_KEY_PRESSURE:
+ info->midiSynth.KeyPressure((data[0] & 0x0f + 1), data[1], data[2], buffer->timestamp);
+ break;
+ case B_CONTROL_CHANGE:
+ info->midiSynth.ControlChange((data[0] & 0x0f) + 1, data[1], data[2], buffer->timestamp);
+ break;
+ case B_PROGRAM_CHANGE:
+ info->midiSynth.ProgramChange((data[0] & 0x0f) + 1, data[1], buffer->timestamp);
+ break;
+ case B_CHANNEL_PRESSURE:
+ info->midiSynth.ChannelPressure((data[0] & 0x0f) + 1, data[1], buffer->timestamp);
+ break;
+ case B_PITCH_BEND:
+ info->midiSynth.PitchBend((data[0] & 0x0f) + 1, data[1], data[2], buffer->timestamp);
+ break;
+ }
+
+ // TODO: handle latency != 0
+ return pmNoError;
+ }
+
+
+ PmError begin_sysex_synth(PmInternal *midi, PmTimestamp timestamp)
+ {
+ PmSynthOutputInfo *info = (PmSynthOutputInfo*)midi->api_info;
+ info->sysexBuffer.clear();
+ return pmNoError;
+ }
+
+
+ PmError end_sysex_synth(PmInternal *midi, PmTimestamp timestamp)
+ {
+ PmSynthOutputInfo *info = (PmSynthOutputInfo*)midi->api_info;
+ info->midiSynth.SystemExclusive(&info->sysexBuffer[0], info->sysexBuffer.size(), timestamp);
+ info->sysexBuffer.clear();
+ return pmNoError;
+ }
+
+
+ PmError write_byte_synth(PmInternal *midi, unsigned char byte, PmTimestamp timestamp)
+ {
+ PmSynthOutputInfo *info = (PmSynthOutputInfo*)midi->api_info;
+ info->sysexBuffer.push_back(byte);
+ return pmNoError;
+ }
+
+
+ PmError write_realtime_synth(PmInternal *midi, PmEvent *buffer)
+ {
+ PmSynthOutputInfo *info = (PmSynthOutputInfo*)midi->api_info;
+ info->midiSynth.SystemRealTime(Pm_MessageStatus(buffer->message), buffer->timestamp);
+ return pmNoError;
+ }
+
+
+ PmError write_flush(PmInternal *midi, PmTimestamp timestamp)
+ {
+ return pmNoError;
+ }
+
+
+ unsigned int check_host_error(PmInternal *midi)
+ {
+ return 0;
+ }
+
+
+ pm_fns_node pm_in_dictionary = {
+ none_write_short,
+ none_sysex,
+ none_sysex,
+ none_write_byte,
+ none_write_short,
+ none_write_flush,
+ synchronize,
+ in_open,
+ in_abort,
+ in_close,
+ success_poll,
+ check_host_error
+ };
+
+ pm_fns_node pm_out_dictionary = {
+ write_short,
+ begin_sysex,
+ end_sysex,
+ write_byte,
+ write_realtime,
+ write_flush,
+ synchronize,
+ out_open,
+ out_abort,
+ out_close,
+ none_poll,
+ check_host_error
+ };
+
+
+ pm_fns_node pm_synth_dictionary = {
+ write_short_synth,
+ begin_sysex_synth,
+ end_sysex_synth,
+ write_byte_synth,
+ write_realtime_synth,
+ write_flush,
+ synchronize,
+ synth_open,
+ synth_abort,
+ synth_close,
+ none_poll,
+ check_host_error
+ };
+
+
+ PmError create_virtual(int is_input, const char *name, void *driverInfo)
+ {
+ BMidiEndpoint *endpoint = is_input ? (BMidiEndpoint*)new BMidiLocalProducer(name) : new BMidiLocalConsumer(name);
+ if (!endpoint->IsValid()) {
+ endpoint->Release();
+ strcpy(pm_hosterror_text, "Endpoint could not be created");
+ pm_hosterror = TRUE;
+ return pmHostError;
+ }
+ status_t status = endpoint->Register();
+ if (status != B_OK) {
+ endpoint->Release();
+ strcpy(pm_hosterror_text, strerror(status));
+ pm_hosterror = TRUE;
+ return pmHostError;
+ }
+ return pm_add_device(const_cast<char*>("Haiku MIDI kit"), name, is_input, TRUE, (void*)(intptr_t)endpoint->ID(), is_input ? &pm_in_dictionary : &pm_out_dictionary);
+ }
+
+ PmError delete_virtual(PmDeviceID id)
+ {
+ int32 endpointID = (int32)(intptr_t)pm_descriptors[id].descriptor;
+ BMidiEndpoint *endpoint = BMidiRoster::FindEndpoint(endpointID);
+ //TODO: handle connected producers and consumers
+ status_t status = endpoint->Unregister();
+ // release twice to actually free the endpoint (FindEndpoint increases the ref-count)
+ endpoint->Release();
+ endpoint->Release();
+ if (status != B_OK) {
+ strcpy(pm_hosterror_text, strerror(status));
+ pm_hosterror = TRUE;
+ return pmHostError;
+ }
+ return pmNoError;
+ }
+
+ PmDeviceID pm_default_input_device_id = -1;
+ PmDeviceID pm_default_output_device_id = -1;
+}
+
+extern "C" {
+ void pm_init()
+ {
+ pm_add_interf(const_cast<char*>("Haiku MIDI kit"), create_virtual, delete_virtual);
+
+ pm_add_device(const_cast<char*>("Haiku MIDI kit"), "Soft Synth", FALSE, FALSE, NULL, &pm_synth_dictionary);
+
+ int32 id = 0;
+ BMidiEndpoint *endpoint;
+
+ while ((endpoint = BMidiRoster::NextEndpoint(&id)) != NULL) {
+ bool isInput = endpoint->IsProducer();
+ pm_add_device(const_cast<char*>("Haiku MIDI kit"), endpoint->Name(), isInput, FALSE, (void*)(intptr_t)id, isInput ? &pm_in_dictionary : &pm_out_dictionary);
+ endpoint->Release();
+ }
+
+ // the following (default device handling) is copied from the Linux implementation
+
+ // this is set when we return to Pm_Initialize, but we need it
+ // now in order to (successfully) call Pm_CountDevices()
+ pm_initialized = TRUE;
+ pm_default_input_device_id = find_default_device(
+ const_cast<char*>("/PortMidi/PM_RECOMMENDED_INPUT_DEVICE"), TRUE,
+ pm_default_input_device_id);
+ pm_default_output_device_id = find_default_device(
+ const_cast<char*>("/PortMidi/PM_RECOMMENDED_OUTPUT_DEVICE"), FALSE,
+ pm_default_output_device_id);
+ }
+
+
+ void pm_term()
+ {
+ int i;
+ for (i = 0; i < pm_descriptor_len; i++) {
+ PmInternal *midi = pm_descriptors[i].pm_internal;
+ if (midi && midi->api_info) {
+ // device is still open, close it
+ (*midi->dictionary->close)(midi);
+ }
+ if (pm_descriptors[i].pub.is_virtual && !pm_descriptors[i].deleted) {
+ delete_virtual(i);
+ }
+ }
+ }
+
+
+ PmDeviceID Pm_GetDefaultInputDeviceID()
+ {
+ Pm_Initialize();
+ return pm_default_input_device_id;
+ }
+
+
+ PmDeviceID Pm_GetDefaultOutputDeviceID()
+ {
+ Pm_Initialize();
+ return pm_default_output_device_id;
+ }
+
+
+ void *pm_alloc(size_t s)
+ {
+ return malloc(s);
+ }
+
+
+ void pm_free(void *ptr)
+ {
+ free(ptr);
+ }
+}
diff --git a/3rdparty/portmidi/pm_java/CMakeLists.txt b/3rdparty/portmidi/pm_java/CMakeLists.txt
index a3506202792..0bec03f04ae 100644
--- a/3rdparty/portmidi/pm_java/CMakeLists.txt
+++ b/3rdparty/portmidi/pm_java/CMakeLists.txt
@@ -1,47 +1,86 @@
-# pm_java
+# pm_java/CMakeLists.txt -- builds pmjni and pmdefaults program
+find_package(Java)
+message(STATUS "Java_JAVA_EXECUTABLE is " ${Java_JAVA_EXECUTABLE})
+
+if(BUILD_PMDEFAULTS)
+ # Since pmdefaults and pmdefaults.bat are in the source tree and look
+ # for libpmjni in the same tree, out-of-source build will not create
+ # a working pmdefaults (without more work):
+ if(NOT (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}))
+ message(WARNING "PmDefaults only works when run in the pm_java/pmdefaults directory after an in-source build. This is an out-of-source build, so [probably] libpmjni will be built out-of-source, pmdefaults.jar will be built in-source, and the pmdefaults[.bat] script remains in-source. Rebuild in-source to use PmDefaults or adjust the file locations and scripts to suit yourself.")
+ endif()
+
+ set(JPORTMIDICLASS JPortMidi.class JPortMidiException.class
+ JPortMidiApi.class)
+ set(PMDEFAULTSCLASS PmDefaultsFrame.class PmDefaults.class)
+ prepend_path(JPORTMIDIPATH jportmidi/ ${JPORTMIDICLASS})
+ prepend_path(PMDEFAULTSPATH pmdefaults/ ${PMDEFAULTSCLASS})
+ set(PMDEFAULTS_ALL ${JPORTMIDIPATH} ${PMDEFAULTSPATH})
+
+ project(pmdefaults NONE)
+ include(UseJava)
+ add_jar(pmdefaults
+ SOURCES pmdefaults/PmDefaults.java pmdefaults/PmDefaultsFrame.java
+ jportmidi/JPortMidi.java jportmidi/JPortMidiApi.java
+ jportmidi/JPortMidiException.java
+ RESOURCES NAMESPACE "." pmdefaults/portmusic_logo.png
+ MANIFEST pmdefaults/manifest.txt
+ OUTPUT_DIR pmdefaults)
+ if(WIN32)
+ set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so)
+ endif()
+ add_dependencies(pmdefaults pmjni)
+endif(BUILD_PMDEFAULTS)
+
+# Build pmjni
+# this CMakeLists.txt is only loaded if BUILD_JAVA_NATIVE_INTERFACE
+# This jni library includes portmidi sources to give just
+# one library for JPortMidi users to manage rather than two.
if(UNIX)
- if(APPLE)
- # java not dealt with in CMake -- see pm_mac/pm_mac.xcodeproj
- else(APPLE)
- # linux
- set(JPORTMIDICLASS JPortMidi.class JPortMidiException.class
- JPortMidiApi.class)
- set(PMDEFAULTSCLASS PmDefaultsFrame.class PmDefaults.class)
- prepend_path(JPORTMIDICLASS2 jportmidi/ ${JPORTMIDICLASS})
- prepend_path(PMDEFAULTSCLASS2 pmdefaults/ ${PMDEFAULTSCLASS})
- set(PMDEFAULTS_ALL_CLASSES ${JPORTMIDICLASS2} ${PMDEFAULTSCLASS2})
- # message(STATUS "PMDEFAULTS_ALL_CLASSES is " ${PMDEFAULTS_ALL_CLASSES})
- add_custom_command(OUTPUT pmdefaults/PmDefaultsFrame.class
- COMMAND javac -classpath . pmdefaults/PmDefaultsFrame.java
- MAIN_DEPENDENCY pmdefaults/PmDefaultsFrame.java
- DEPENDS pmdefaults/PmDefaults.java
- WORKING_DIRECTORY pm_java)
- add_custom_command(OUTPUT pmdefaults/PmDefaults.class
- COMMAND javac -classpath . pmdefaults/PmDefaults.java
- MAIN_DEPENDENCY pmdefaults/PmDefaults.java
- DEPENDS pmdefaults/PmDefaultsFrame.java
- WORKING_DIRECTORY pm_java)
- add_custom_command(OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
- COMMAND cp pmdefaults/portmusic_logo.png .
- COMMAND jar cmf pmdefaults/manifest.txt pmdefaults.jar
- pmdefaults/*.class portmusic_logo.png jportmidi/*.class
- COMMAND chmod +x pmdefaults/pmdefaults
- COMMAND cp pmdefaults/pmdefaults ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- COMMAND mv pmdefaults.jar ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- COMMAND rm portmusic_logo.png
- MAIN_DEPENDENCY pmdefaults/PmDefaults.class
- DEPENDS ${PMDEFAULTS_ALL_CLASSES}
- WORKING_DIRECTORY pm_java)
- add_custom_target(pmdefaults_target ALL
- DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar)
- # message(STATUS "add_custom_target: pmdefaults.jar")
-
- # install the libraries (Linux only)
- INSTALL(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
- DESTINATION /usr/share/java)
- INSTALL(PROGRAMS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults
- DESTINATION /usr/local/bin)
- endif(APPLE)
-endif(UNIX)
-# In windows, use pm_java/make.bat
+ include(FindJNI)
+ # message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
+ # message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
+ # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
+ # note: user might need to set JAVA_INCLUDE_PATH manually
+ #
+ # this will probably break on BSD and other Unix systems; the fix
+ # depends on whether FindJNI can find Java or not. If yes, then
+ # we should try to rely on automatically set JAVA_INCLUDE_PATH and
+ # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH
+ # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation
+ # because JAVA_INCLUDE_PATH2 is pretty obscure)
+ set(JAVA_INCLUDE_PATH ${JAVA_INCLUDE_PATH-UNKNOWN}
+ CACHE STRING "where to find Java SDK include directory")
+ # libjvm.so is found relative to JAVA_INCLUDE_PATH:
+ if (HAIKU)
+ set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/haiku)
+ else()
+ set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux)
+ endif()
+elseif(WIN32)
+ include(FindJNI)
+ # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
+ set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../lib/jvm.lib)
+
+ set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
+ # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
+ # message(STATUS "JAVAVM_LIB: " ${JAVAVM_LIB})
+endif()
+
+add_library(pmjni SHARED pmjni/pmjni.c)
+target_sources(pmjni PRIVATE ${PM_LIB_PUBLIC_SRC} ${PM_LIB_PRIVATE_SRC})
+message(STATUS "Java paths ${JAVA_INCLUDE_PATHS}")
+# message(STATUS "Java pmjni src: pmjni/pmjni.c ${PM_LIB_SHARED_SRC} "
+# "${PM_LIB_PRIVATE_SRC}")
+target_include_directories(pmjni PUBLIC ${JAVA_INCLUDE_PATHS})
+target_link_libraries(pmjni ${PM_NEEDED_LIBS})
+set_target_properties(pmjni PROPERTIES
+ VERSION ${LIBRARY_VERSION}
+ SOVERSION ${LIBRARY_SOVERSION}
+ LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
+ ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
+ EXECUTABLE_EXTENSION "jnilib"
+ MACOSX_RPATH ON)
+
diff --git a/3rdparty/portmidi/pm_java/JavaExe.exe b/3rdparty/portmidi/pm_java/JavaExe.exe
deleted file mode 100644
index 8886d2e8672..00000000000
--- a/3rdparty/portmidi/pm_java/JavaExe.exe
+++ /dev/null
Binary files differ
diff --git a/3rdparty/portmidi/pm_java/README.txt b/3rdparty/portmidi/pm_java/README.txt
index 44c6fab4508..bf0d73768b2 100644
--- a/3rdparty/portmidi/pm_java/README.txt
+++ b/3rdparty/portmidi/pm_java/README.txt
@@ -1,33 +1,70 @@
README.txt
Roger B. Dannenberg
16 Jun 2009
+updated 2021
-This directory was created to implement PmDefaults, a program to
-set default input and output devices for PortMidi applications.
+This directory implements a JNI library so that Java programs can use
+the PortMidi API. This was mainly created to implement PmDefaults, a
+program to set default input and output devices for PortMidi
+applications.
-There are three main sub-projects here:
- 1) pmjni -- a JNI (Java Native Interface) to access PortMidi
- 2) jportmidi -- a Java class to access PortMidi (uses pmjni)
- 3) pmdefaults -- the PmDefaults application (uses jportmidi)
+PmDefaults never found much use. I recommend you implement
+per-application preferences and store default PortMidi device
+numbers for input and output there. (Or better yet, store
+device *names* since numbers can change if you plug in or
+remove USB devices.)
-For Mac OS X, you should build the PmDefaults application in Xcode.
+Even without PmDefaults, a PortMidi API for Java is probably an
+improvement over other Java libraries, but there is very little MIDI
+development in Java, so I have not maintained this API. The only thing
+probably seriously wrong now is an interface to the
+Pm_CreateVirtualInput and Pm_CreateVirtualOutput functions, which are
+new additions.
-For Win32, an installer for PmDefaults is included in setup/.
-To build from sources, you should first build everything including
-the portmidi dll (that will be used by the Java application) using
-Visual C++ and a provided .sln file in the portmidi home directory.
-Then, run make.bat in this directory. The subdirectory win32 will be
-created with the application pmdefaults.exe. You can run this application
-in the normal way. To move the application, you need to copy *everything*
-in win32. To build setup/pmdefaults-setup.exe, I have used both
-Setup Generator from Gentee software and Inno Setup from jrsoftware.org.
-A script for Inno Setup is included in this directory, but since paths
-seem to be absolute, you will have to adjust the paths in the script
-before you use it.
+I will leave the code here, and if there is a demand, please either
+update it or let your needs be known. Perhaps I or someone can help.
+
+==================================================================
----- implementation notes ----
+BUILDING PmDefaults PROGRAM
-For windows, we use the free software JavaExe.exe. The copy here was
+You must have a JDK installed (Java development kit including javac
+(the Java compiler), jni.h, etc.
+
+Test java on the command line, e.g., type: javac -version
+
+Enable these options in the main CMakeLists.txt file (run CMake
+from your top-level repository directory):
+ BUILD_JAVA_NATIVE_INTERFACE
+ BUILD_PMDEFAULTS
+In my Ubuntu linux with jdk-15, ccmake was unable to find my JDK, so
+I have to manually set CMake variables as follows (type 't' to see
+these in ccmake):
+ JAVA_AWT_INCLUDE_PATH /usr/lib/jvm/jdk-15/include
+ JAVA_AWT_LIBRARY /usr/lib/jvm/jdk-15/lib
+ JAVA_INCLUDE_PATH /usr/lib/jvm/jdk-15/include
+ JAVA_INCLUDE_PATH2 /usr/lib/jvm/jdk-15/include
+ JAVA_JVM_LIBRARY /usr/lib/jvm/jdk-15/lib
+Of course, your paths may differ.
+
+
+RUNNING PmDefaults PROGRAM
+
+After building the pmdefaults target with make, Visual Studio, or Xcode:
+In Windows:
+ [from the command line:]
+ cd portmidi\pm_java\pmdefaults -- change to this directory
+ pmdefaults -- runs pmdefaults.bat
+ [or from the finder:]
+ double-click on pmdefaults.bat
+In macOS and Linux:
+ cd portmidi\pm_java\pmdefaults -- change to this directory
+ ./pmdefaults -- shell script to invoke java
+
+
+---- old implementation notes ----
+
+For Windows, we use the free software JavaExe.exe. The copy here was
downloaded from
http://software.techrepublic.com.com/abstract.aspx?kw=javaexe&docid=767485
@@ -40,9 +77,3 @@ Java application jar file and then *renaming* JavaExe.exe to the name
of the jar file, but keeping the .exe extension. (See make.bat for this
step.) Documentation for JavaExe can be obtained by downloading the
whole program from the URL(s) above.
-
-
-
-
-
-
diff --git a/3rdparty/portmidi/pm_java/UpdateRsrcJavaExe.exe b/3rdparty/portmidi/pm_java/UpdateRsrcJavaExe.exe
deleted file mode 100644
index 492ec1679ea..00000000000
--- a/3rdparty/portmidi/pm_java/UpdateRsrcJavaExe.exe
+++ /dev/null
Binary files differ
diff --git a/3rdparty/portmidi/pm_java/jportmidi/JPortMidi.java b/3rdparty/portmidi/pm_java/jportmidi/JPortMidi.java
index dd3cc2a1c3a..7116e19640a 100644
--- a/3rdparty/portmidi/pm_java/jportmidi/JPortMidi.java
+++ b/3rdparty/portmidi/pm_java/jportmidi/JPortMidi.java
@@ -77,7 +77,9 @@ public class JPortMidi {
throw new JPortMidiException(pmStreamOpen,
"RefreshDeviceLists called while stream is open");
}
+ if (trace) System.out.println("Pm_Terminate");
checkError(pm.Pm_Terminate());
+ if (trace) System.out.println("Pm_Initialize");
checkError(pm.Pm_Initialize());
}
diff --git a/3rdparty/portmidi/pm_java/mac-make.sh b/3rdparty/portmidi/pm_java/mac-make.sh
deleted file mode 100644
index e5e9592b0a0..00000000000
--- a/3rdparty/portmidi/pm_java/mac-make.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-# script to build a jar file to run PmDefaults from the command line on OS X
-# (This is for debugging. Normally, you would use XCode to build PmDefaults.app.)
-
-# Compile the java Portidi interface classes.
-javac jportmidi/*.java
-
-# Compile the pmdefaults application.
-javac -classpath . pmdefaults/*.java
-
-# Temporarily copy the portmusic_logo.png file here to add to the jar file.
-cp pmdefaults/portmusic_logo.png .
-
-# Create a directory to hold the distribution.
-mkdir mac-osx
-
-# Copy the interface DLL to the distribution directory.
-cp ../Release/libpmjni.dylib mac-osx
-
-# Create a java archive (jar) file of the distribution.
-jar cmf pmdefaults/manifest.txt mac-osx/pmdefaults.jar pmdefaults/*.class portmusic_logo.png jportmidi/*.class
-
-# Clean up the temporary image file now that it is in the jar file.
-rm portmusic_logo.png
-
-echo "You now have a jar file in mac-osx"
-
diff --git a/3rdparty/portmidi/pm_java/pmdefaults-setup-script.iss b/3rdparty/portmidi/pm_java/pmdefaults-setup-script.iss
deleted file mode 100644
index c7fe5f57e34..00000000000
--- a/3rdparty/portmidi/pm_java/pmdefaults-setup-script.iss
+++ /dev/null
@@ -1,44 +0,0 @@
-; Script generated by the Inno Setup Script Wizard.
-; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
-
-[Setup]
-; NOTE: The value of AppId uniquely identifies this application.
-; Do not use the same AppId value in installers for other applications.
-; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
-AppId={{5094958B-3CD7-4780-A883-69C9E5B95AEF}
-AppName=PmDefaults
-AppVerName=PmDefaults
-AppPublisher=Roger Dannenberg - Carnegie Mellon University
-AppPublisherURL=http://portmedia.sourceforge.net/
-AppSupportURL=http://portmedia.sourceforge.net/
-AppUpdatesURL=http://portmedia.sourceforge.net/
-DefaultDirName={pf}\PmDefaults
-DefaultGroupName=PmDefaults
-LicenseFile=C:\Users\rbd\portmedia\portmidi\pm_java\win32\license.txt
-OutputBaseFilename=setup
-SetupIconFile=C:\Users\rbd\portmedia\portmidi\pm_java\pmdefaults\pmdefaults.ico
-Compression=lzma
-SolidCompression=yes
-
-[Languages]
-Name: "english"; MessagesFile: "compiler:Default.isl"
-
-[Tasks]
-Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
-Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
-
-[Files]
-Source: "C:\Users\rbd\portmedia\portmidi\pm_java\win32\pmdefaults.exe"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\rbd\portmedia\portmidi\pm_java\win32\pmdefaults.jar"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\rbd\portmedia\portmidi\pm_java\win32\pmjni.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\rbd\portmedia\portmidi\pm_java\win32\license.txt"; DestDir: "{app}"; Flags: ignoreversion
-; NOTE: Don't use "Flags: ignoreversion" on any shared system files
-
-[Icons]
-Name: "{group}\PmDefaults"; Filename: "{app}\pmdefaults.exe"
-Name: "{commondesktop}\PmDefaults"; Filename: "{app}\pmdefaults.exe"; Tasks: desktopicon
-Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\PmDefaults"; Filename: "{app}\pmdefaults.exe"; Tasks: quicklaunchicon
-
-[Run]
-Filename: "{app}\pmdefaults.exe"; Description: "{cm:LaunchProgram,PmDefaults}"; Flags: nowait postinstall skipifsilent
-
diff --git a/3rdparty/portmidi/pm_java/pmdefaults/PmDefaults.java b/3rdparty/portmidi/pm_java/pmdefaults/PmDefaults.java
index 20708fc9b66..4cfdb9da96a 100644
--- a/3rdparty/portmidi/pm_java/pmdefaults/PmDefaults.java
+++ b/3rdparty/portmidi/pm_java/pmdefaults/PmDefaults.java
@@ -1,11 +1,15 @@
// PmDefaults -- a small application to set PortMIDI default input/output
package pmdefaults;
+import javax.swing.SwingUtilities;
public class PmDefaults {
public static void main(String[] args) {
System.out.println("starting main");
- new PmDefaultsFrame("PortMIDI Setup");
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ new PmDefaultsFrame("PortMIDI Setup");
+ }
+ });
}
}
-
diff --git a/3rdparty/portmidi/pm_java/pmdefaults/README.txt b/3rdparty/portmidi/pm_java/pmdefaults/README.txt
index e0a4d4b40e8..39fa1fd2c2f 100644
--- a/3rdparty/portmidi/pm_java/pmdefaults/README.txt
+++ b/3rdparty/portmidi/pm_java/pmdefaults/README.txt
@@ -2,20 +2,19 @@ README.txt
Roger B. Dannenberg
2 Jan 2009
-PmDefaults is a program to set default input and output devices for PortMidi
-applications. After running the PmDefaults program and choosing devices,
-identifiers for these devices will be returned by
-Pm_GetDefaultInputDeviceID() and Pm_GetDefaultOutputDeviceID().
+PmDefaults is a program to set default input and output devices for
+PortMidi applications. After running the PmDefaults program and
+choosing devices, identifiers for these devices will be returned by
+calls (within any program) to Pm_GetDefaultInputDeviceID() and
+Pm_GetDefaultOutputDeviceID().
Included in this directory are:
manifest.txt -- used in pmdefaults.jar
-pmdefaults-icon.* -- various icons for applications
-pmdefaults-license.txt -- a version of portmidi/license.txt formatted for
- the windows installer
+pmdefaults-license.txt -- license text
+pmdefaults-icon.{bmp,xcf,png,gif} -- icons
+pmdefaults.{ico,icns} - icons
portmusic_logo.png -- a logo displayed by the pmdefaults application
-readme-win32.txt -- this becomes the readme file for the pmdefaults
- application. It is copied to win32/README.txt by make.bat
-TO BUILD THE APPLICATION: see ../README.txt
+TO BUILD AND RUN THE APPLICATION: see ../README.txt
diff --git a/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults b/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults
index 80162469ae0..fb01fbf0f67 100644
--- a/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults
+++ b/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults
@@ -1 +1,8 @@
-java -jar /usr/share/java/pmdefaults.jar > /dev/null
+#!/bin/sh
+# Run PmDefaults, the GUI to select default MIDI input and output for PortMidi
+# Due to the locations of the .jar file and libpmjni, this script only runs
+# from <portmidi-repo-path>/pm_java/pmdefaults. PmDefaults is minimally
+# supported -- if you would like it to appear as an app on your desktop,
+# contact the developer(s) and let us know it's actually being used.
+# library path here includes directory locations for macOS and Linux.
+java -Djava.library.path=../../Release:../../Debug:../.. -jar pmdefaults.jar > /dev/null
diff --git a/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults-license.txt b/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults-license.txt
index 317f70e0eb6..703923c25b9 100644
--- a/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults-license.txt
+++ b/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults-license.txt
@@ -3,8 +3,6 @@ LICENSE INFORMATION
PmDefaults is a small program to set default MIDI input and output
devices for other programs using the PortMidi library.
-Latest version available at: http://sourceforge.net/projects/portmedia
-
Copyright (c) 1999-2000 Ross Bencina and Phil Burk
Copyright (c) 2001-2009 Roger B. Dannenberg
diff --git a/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults.bat b/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults.bat
new file mode 100644
index 00000000000..7ebfdf75e08
--- /dev/null
+++ b/3rdparty/portmidi/pm_java/pmdefaults/pmdefaults.bat
@@ -0,0 +1 @@
+java -Djava.library.path="../../Release;../../Debug" -jar pmdefaults.jar
diff --git a/3rdparty/portmidi/pm_java/pmdefaults/readme-win32.txt b/3rdparty/portmidi/pm_java/pmdefaults/readme-win32.txt
deleted file mode 100644
index 5ff168bd715..00000000000
--- a/3rdparty/portmidi/pm_java/pmdefaults/readme-win32.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-README.txt
-Roger B. Dannenberg
-1 Jan 2009
-
-This directory contains files that implement:
-
-pmdefaults -- a program to set PortMidi default input/output devices
-
-You can copy and rename this *whole directory* to move the application
-to a convenient place. The application to run is pmdefaults.exe.
-
diff --git a/3rdparty/portmidi/pm_java/pmjni/pmjni-VC8.vcproj b/3rdparty/portmidi/pm_java/pmjni/pmjni-VC8.vcproj
deleted file mode 100644
index 1b42bfac9bd..00000000000
--- a/3rdparty/portmidi/pm_java/pmjni/pmjni-VC8.vcproj
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="pmjni"
- ProjectGUID="{7AA255C8-48BF-40AC-97BA-F7E7BA4DDAA8}"
- RootNamespace="pmjni"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;$(SolutionDir)\pm_common&quot;;&quot;$(SolutionDir)\porttime&quot;;&quot;$(ProjectDir)&quot;;&quot;E:\Program Files\Java\jdk1.5.0_14\include&quot;;&quot;E:\Program Files\Java\jdk1.5.0_14\include\win32&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PMJNI_EXPORTS"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winmm.lib"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="2"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(SolutionDir)\pm_common&quot;;&quot;$(SolutionDir)\porttime&quot;;&quot;$(ProjectDir)&quot;;&quot;E:\Program Files\Java\jdk1.5.0_14\include&quot;;&quot;E:\Program Files\Java\jdk1.5.0_14\include\win32&quot;"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PMJNI_EXPORTS"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winmm.lib"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\pmjni.c"
- >
- </File>
- <File
- RelativePath="..\..\pm_common\pmutil.c"
- >
- </File>
- <File
- RelativePath="..\..\pm_win\pmwin.c"
- >
- </File>
- <File
- RelativePath="..\..\pm_win\pmwinmm.c"
- >
- </File>
- <File
- RelativePath="..\..\pm_common\portmidi.c"
- >
- </File>
- <File
- RelativePath="..\..\porttime\porttime.c"
- >
- </File>
- <File
- RelativePath="..\..\porttime\ptwinmm.c"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_java/pmjni/pmjni.c b/3rdparty/portmidi/pm_java/pmjni/pmjni.c
index 95e51dda4c5..c60cffb45eb 100644
--- a/3rdparty/portmidi/pm_java/pmjni/pmjni.c
+++ b/3rdparty/portmidi/pm_java/pmjni/pmjni.c
@@ -13,11 +13,11 @@
// the size of a pointer. Finally cast int to pointer. All this
// is supposed to avoid C compiler warnings and (worse) losing
// address bits.
-#define PMSTREAM(obj, fid) ((PmStream *) (long) (*env)->GetLongField(env, obj, fid))
+#define PMSTREAM(obj, fid) ((PmStream *) (intptr_t) (*env)->GetLongField(env, obj, fid))
// Cast stream to long to convert integer to pointer, then expand
// integer to 64-bit jlong. This avoids compiler warnings.
#define SET_PMSTREAM(obj, fid, stream) \
- (*env)->SetLongField(env, obj, fid, (jlong) (long) stream)
+ (*env)->SetLongField(env, obj, fid, (jlong) (intptr_t) stream)
/*
diff --git a/3rdparty/portmidi/pm_java/setup/pmdefaults-setup.exe b/3rdparty/portmidi/pm_java/setup/pmdefaults-setup.exe
deleted file mode 100644
index 78ef52c3e44..00000000000
--- a/3rdparty/portmidi/pm_java/setup/pmdefaults-setup.exe
+++ /dev/null
Binary files differ
diff --git a/3rdparty/portmidi/pm_linux/README_LINUX.txt b/3rdparty/portmidi/pm_linux/README_LINUX.txt
index 818793e570f..cfbc43f571a 100644
--- a/3rdparty/portmidi/pm_linux/README_LINUX.txt
+++ b/3rdparty/portmidi/pm_linux/README_LINUX.txt
@@ -1,45 +1,25 @@
README_LINUX.txt for PortMidi
Roger Dannenberg
-14 Oct 2009
+6 Dec 2012, revised May 2022
-To make PortMidi, you need cmake and the Java SDK.
-Go back up to the portmidi directory and type:
+Contents:
+ To make PortMidi
+ The pmdefaults program
+ Setting LD_LIBRARY_PATH
+ A note about amd64
+ Using autoconf
+ Using configure
+ Changelog
-ccmake .
-Type 'c' (configure) and then 'g' (generate). You may have
-to manually set JAVA_INCLUDE_PATH and JAVA_JVM_LIBRARY
-by typing 't' (toggle to advanced mode) and using the
-editor to change the fields. You can find possible values
-for JAVA_INCLUDE_PATH by typing "locate jni.h", and for
-JAVA_JVM_LIBRARY by typing locate libjvm".
-
-You also need JAVA_INCLUDE_PATH2, but this will normally
-be set automatically after you set JAVA_INCLUDE_PATH and
-run "configure" (type "c" to ccmake). Normally,
-JAVA_INCLUDE_PATH2 is the linux subdirectory within
-JAVA_INCLUDE_PATH.
-
-Notice that the CMAKE_BUILD_TYPE can be Debug or Release.
-Stick with Release if you are not debugging.
-
-After successfully generating make files with ccmake, you
-can run make:
-
-make
-
-The Makefile will build all test programs and the portmidi
-library. For experimental software,
-especially programs running from the command line, we
-recommend using the Debug version -- it will terminate your
-program and print a helpful message if any PortMidi
-function returns an error code. (Released software should
-check for error codes and handle them, but for quick,
-non-critical projects, the automatic "print and die"
-handling can save some work.)
+See ../README.md for general instructions.
THE pmdefaults PROGRAM
+(This may be obsolete. It is older than `../README.md` which
+also discusses pmdefaults, and Java support may be removed
+unless someone claims they use it... -RBD)
+
You should install pmdefaults. It provides a graphical interface
for selecting default MIDI IN and OUT devices so that you don't
have to build device selection interfaces into all your programs
@@ -72,7 +52,7 @@ export LD_LIBRARY_PATH
A NOTE ABOUT AMD64:
-When compiling portmidi under linux on an AMD64, I had to add the -fPIC
+When compiling portmidi under linux on an AMD64, I had to add the -fPIC
flag to the gcc flags.
Reason: when trying to build John Harrison's pyPortMidi gcc bailed out
@@ -90,6 +70,12 @@ be "PIC-enabled".
CHANGELOG
+27-may-2022 Roger B. Dannenberg
+ Some updates to this file.
+
+6-dec-2012 Roger B. Dannenberg
+ Copied notes on Autoconf from Audacity sources
+
22-jan-2010 Roger B. Dannenberg
Updated instructions about Java paths
diff --git a/3rdparty/portmidi/pm_linux/finddefault.c b/3rdparty/portmidi/pm_linux/finddefault.c
index c3077701a60..6189a8b7148 100644
--- a/3rdparty/portmidi/pm_linux/finddefault.c
+++ b/3rdparty/portmidi/pm_linux/finddefault.c
@@ -7,8 +7,9 @@
#include <string.h>
#include <ctype.h>
#include "portmidi.h"
-
-extern int pm_find_default_device(char *pattern, int is_input);
+#include "pmutil.h"
+#include "pminternal.h"
+#include "finddefault.h"
#define STRING_MAX 256
@@ -21,7 +22,7 @@ void skip_spaces(FILE *inf)
}
/* trim leading spaces and match a string */
-int match_string(FILE *inf, char *s)
+int match_string(FILE *inf, const char *s)
{
skip_spaces(inf);
while (*s && *s == getc(inf)) s++;
@@ -29,19 +30,21 @@ int match_string(FILE *inf, char *s)
}
-/* Parse preference files, find default device, search devices --
+/*
+ Parse preference files, find default device, search devices --
*/
-PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
+PmDeviceID find_default_device(const char *path, int input, PmDeviceID id)
/* path -- the name of the preference we are searching for
input -- true iff this is an input device
id -- current default device id
returns matching device id if found, otherwise id
*/
{
- static char *pref_2 = (char *)"/.java/.userPrefs/";
- static char *pref_3 = (char *)"prefs.xml";
- char *pref_1 = getenv("HOME");
- char *full_name, *path_ptr;
+ static char const *const pref_2 = "/.java/.userPrefs/";
+ static char const *const pref_3 = "prefs.xml";
+ const char *pref_1 = getenv("HOME");
+ const char *path_ptr;
+ char *full_name;
FILE *inf;
int c, i;
if (!pref_1) goto nopref; // cannot find preference file
@@ -54,8 +57,8 @@ PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
if (*path == '/') path++; // skip initial slash in path
path_ptr = strrchr(path, '/');
if (path_ptr) { // copy up to slash after full_name
- path_ptr++;
int offset = strlen(full_name);
+ path_ptr++;
memcpy(full_name + offset, path, path_ptr - path);
full_name[offset + path_ptr - path] = 0; // end of string
} else {
@@ -63,7 +66,6 @@ PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
}
strcat(full_name, pref_3);
inf = fopen(full_name, "r");
- free(full_name);
if (!inf) goto nopref; // cannot open preference file
// We're not going to build or link in a full XML parser.
// Instead, find the path string and quoute. Then, look for
@@ -74,9 +76,9 @@ PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
// look for quote string quote
if (!match_string(inf, path_ptr)) continue; // path not found
if (getc(inf) != '"') continue; // path not found, keep scanning
- if (!match_string(inf, (char *)"value")) goto nopref; // value not found
- if (!match_string(inf, (char *)"=")) goto nopref; // = not found
- if (!match_string(inf, (char *)"\"")) goto nopref; // quote not found
+ if (!match_string(inf, "value")) goto nopref; // value not found
+ if (!match_string(inf, "=")) goto nopref; // = not found
+ if (!match_string(inf, "\"")) goto nopref; // quote not found
// now read the value up to the close quote
for (i = 0; i < STRING_MAX; i++) {
if ((c = getc(inf)) == '"') break;
diff --git a/3rdparty/portmidi/pm_linux/finddefault.h b/3rdparty/portmidi/pm_linux/finddefault.h
new file mode 100644
index 00000000000..4599fff8697
--- /dev/null
+++ b/3rdparty/portmidi/pm_linux/finddefault.h
@@ -0,0 +1,5 @@
+/* finddefault.h -- find_default_device() declaration
+ Roger Dannenberg, Jan 2021
+*/
+
+PmDeviceID find_default_device(const char *path, int input, PmDeviceID id);
diff --git a/3rdparty/portmidi/pm_linux/pmlinux.c b/3rdparty/portmidi/pm_linux/pmlinux.c
index b05c54fccb9..05ac332c368 100644
--- a/3rdparty/portmidi/pm_linux/pmlinux.c
+++ b/3rdparty/portmidi/pm_linux/pmlinux.c
@@ -14,6 +14,7 @@
#include "portmidi.h"
#include "pmutil.h"
#include "pminternal.h"
+#include "finddefault.h"
#ifdef PMALSA
#include "pmlinuxalsa.h"
@@ -23,32 +24,34 @@
#include "pmlinuxnull.h"
#endif
+#if !(defined(PMALSA) || defined(PMNULL))
+#error One of PMALSA or PMNULL must be defined
+#endif
+
PmDeviceID pm_default_input_device_id = -1;
PmDeviceID pm_default_output_device_id = -1;
-extern PmDeviceID find_default_device(char *path, int input, PmDeviceID id);
-
-void pm_init()
+void pm_init(void)
{
/* Note: it is not an error for PMALSA to fail to initialize.
* It may be a design error that the client cannot query what subsystems
* are working properly other than by looking at the list of available
* devices.
*/
- #ifdef PMALSA
- pm_linuxalsa_init();
- #endif
- #ifdef PMNULL
+#ifdef PMALSA
+ pm_linuxalsa_init();
+#endif
+#ifdef PMNULL
pm_linuxnull_init();
- #endif
+#endif
// this is set when we return to Pm_Initialize, but we need it
// now in order to (successfully) call Pm_CountDevices()
pm_initialized = TRUE;
pm_default_input_device_id = find_default_device(
- (char *)"/PortMidi/PM_RECOMMENDED_INPUT_DEVICE", TRUE,
+ "/PortMidi/PM_RECOMMENDED_INPUT_DEVICE", TRUE,
pm_default_input_device_id);
pm_default_output_device_id = find_default_device(
- (char *)"/PortMidi/PM_RECOMMENDED_OUTPUT_DEVICE", FALSE,
+ "/PortMidi/PM_RECOMMENDED_OUTPUT_DEVICE", FALSE,
pm_default_output_device_id);
}
@@ -57,14 +60,17 @@ void pm_term(void)
#ifdef PMALSA
pm_linuxalsa_term();
#endif
+ #ifdef PMNULL
+ pm_linuxnull_term();
+ #endif
}
-PmDeviceID Pm_GetDefaultInputDeviceID() {
+PmDeviceID Pm_GetDefaultInputDeviceID(void) {
Pm_Initialize();
return pm_default_input_device_id;
}
-PmDeviceID Pm_GetDefaultOutputDeviceID() {
+PmDeviceID Pm_GetDefaultOutputDeviceID(void) {
Pm_Initialize();
return pm_default_output_device_id;
}
diff --git a/3rdparty/portmidi/pm_linux/pmlinuxalsa.c b/3rdparty/portmidi/pm_linux/pmlinuxalsa.c
index 9ca2cf72adf..62b82d73b25 100644
--- a/3rdparty/portmidi/pm_linux/pmlinuxalsa.c
+++ b/3rdparty/portmidi/pm_linux/pmlinuxalsa.c
@@ -7,6 +7,11 @@
* Jason Cohen, Rico Colon, Matt Filippone (Alsa 0.5.x implementation)
*/
+/* omit this code if PMALSA is not defined -- this mechanism allows
+ * selection of different MIDI interfaces (at compile time).
+ */
+#ifdef PMALSA
+
#include "stdlib.h"
#include "portmidi.h"
#include "pmutil.h"
@@ -15,16 +20,8 @@
#include "string.h"
#include "porttime.h"
#include "pmlinux.h"
-#include <alsa/asoundlib.h>
-
-typedef unsigned int UINT32;
-__extension__ typedef unsigned long long UINT64;
-#ifdef PTR64
-typedef UINT64 FPTR;
-#else
-typedef UINT32 FPTR;
-#endif
+#include <alsa/asoundlib.h>
/* I used many print statements to debug this code. I left them in the
* source, and you can turn them on by changing false to true below:
@@ -40,10 +37,9 @@ typedef UINT32 FPTR;
#endif
/* to store client/port in the device descriptor */
-
-#define MAKE_DESCRIPTOR(client, port) ((void*)(FPTR)(((client) << 8) | (port)))
-#define GET_DESCRIPTOR_CLIENT(info) ((((int)(FPTR)(info)) >> 8) & 0xff)
-#define GET_DESCRIPTOR_PORT(info) (((int)(FPTR)(info)) & 0xff)
+#define MAKE_DESCRIPTOR(client, port) ((void*)(long)(((client) << 8) | (port)))
+#define GET_DESCRIPTOR_CLIENT(info) ((((long)(info)) >> 8) & 0xff)
+#define GET_DESCRIPTOR_PORT(info) (((long)(info)) & 0xff)
#define BYTE unsigned char
@@ -54,14 +50,16 @@ static snd_seq_t *seq = NULL; // all input comes here,
// output queue allocated on seq
static int queue, queue_used; /* one for all ports, reference counted */
-typedef struct alsa_descriptor_struct {
+#define PORT_IS_CLOSED -999999
+
+typedef struct alsa_info_struct {
+ int is_virtual;
int client;
int port;
int this_port;
int in_sysex;
snd_midi_event_t *parser;
- int error; /* host error code */
-} alsa_descriptor_node, *alsa_descriptor_type;
+} alsa_info_node, *alsa_info_type;
/* get_alsa_error_text -- copy error text to potentially short string */
@@ -69,36 +67,45 @@ typedef struct alsa_descriptor_struct {
static void get_alsa_error_text(char *msg, int len, int err)
{
int errlen = strlen(snd_strerror(err));
- if (errlen < len) {
+ if (errlen > 0 && errlen < len) {
strcpy(msg, snd_strerror(err));
} else if (len > 20) {
sprintf(msg, "Alsa error %d", err);
- } else if (len > 4) {
- strcpy(msg, "Alsa");
} else {
msg[0] = 0;
}
}
+static PmError check_hosterror(int err)
+{
+ if (err < 0) {
+ get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN, err);
+ pm_hosterror = TRUE;
+ return pmHostError;
+ }
+ return pmNoError;
+}
+
+
/* queue is shared by both input and output, reference counted */
static PmError alsa_use_queue(void)
{
+ int err = 0;
if (queue_used == 0) {
snd_seq_queue_tempo_t *tempo;
queue = snd_seq_alloc_queue(seq);
if (queue < 0) {
- pm_hosterror = queue;
- return pmHostError;
+ return check_hosterror(queue);
}
snd_seq_queue_tempo_alloca(&tempo);
snd_seq_queue_tempo_set_tempo(tempo, 480000);
snd_seq_queue_tempo_set_ppq(tempo, 480);
- pm_hosterror = snd_seq_set_queue_tempo(seq, queue, tempo);
- if (pm_hosterror < 0)
- return pmHostError;
-
+ err = snd_seq_set_queue_tempo(seq, queue, tempo);
+ if (err < 0) {
+ return check_hosterror(err);
+ }
snd_seq_start_queue(seq, queue, NULL);
snd_seq_drain_output(seq);
}
@@ -135,77 +142,87 @@ static int midi_message_length(PmMessage message)
}
-static PmError alsa_out_open(PmInternal *midi, void *driverInfo)
+static alsa_info_type alsa_info_create(int client_port, long id, int is_virtual)
{
- void *client_port = descriptors[midi->device_id].descriptor;
- alsa_descriptor_type desc = (alsa_descriptor_type)
- pm_alloc(sizeof(alsa_descriptor_node));
- snd_seq_port_info_t *info;
- int err;
+ alsa_info_type info = (alsa_info_type) pm_alloc(sizeof(alsa_info_node));
+ info->is_virtual = is_virtual;
+ info->this_port = id;
+ info->client = GET_DESCRIPTOR_CLIENT(client_port);
+ info->port = GET_DESCRIPTOR_PORT(client_port);
+ info->in_sysex = 0;
+ return info;
+}
- if (!desc) return pmInsufficientMemory;
-
- snd_seq_port_info_alloca(&info);
- snd_seq_port_info_set_port(info, midi->device_id);
- snd_seq_port_info_set_capability(info, SND_SEQ_PORT_CAP_WRITE |
- SND_SEQ_PORT_CAP_READ);
- snd_seq_port_info_set_type(info, SND_SEQ_PORT_TYPE_MIDI_GENERIC |
- SND_SEQ_PORT_TYPE_APPLICATION);
- snd_seq_port_info_set_port_specified(info, 1);
- err = snd_seq_create_port(seq, info);
- if (err < 0) goto free_desc;
- /* fill in fields of desc, which is passed to pm_write routines */
- midi->descriptor = desc;
- desc->client = GET_DESCRIPTOR_CLIENT(client_port);
- desc->port = GET_DESCRIPTOR_PORT(client_port);
- desc->this_port = midi->device_id;
- desc->in_sysex = 0;
-
- desc->error = 0;
+static PmError alsa_out_open(PmInternal *midi, void *driverInfo)
+{
+ int id = midi->device_id;
+ void *client_port = pm_descriptors[id].descriptor;
+ alsa_info_type ainfo = alsa_info_create((long) client_port, id,
+ pm_descriptors[id].pub.is_virtual);
+ snd_seq_port_info_t *pinfo;
+ int err = 0;
+ int queue_used = 0;
- err = snd_midi_event_new(PM_DEFAULT_SYSEX_BUFFER_SIZE, &desc->parser);
+ if (!ainfo) return pmInsufficientMemory;
+ midi->api_info = ainfo;
+
+ if (!ainfo->is_virtual) {
+ snd_seq_port_info_alloca(&pinfo);
+ snd_seq_port_info_set_port(pinfo, id);
+ snd_seq_port_info_set_capability(pinfo, SND_SEQ_PORT_CAP_WRITE |
+ SND_SEQ_PORT_CAP_READ);
+ snd_seq_port_info_set_type(pinfo, SND_SEQ_PORT_TYPE_MIDI_GENERIC |
+ SND_SEQ_PORT_TYPE_APPLICATION);
+ snd_seq_port_info_set_port_specified(pinfo, 1);
+ err = snd_seq_create_port(seq, pinfo);
+ if (err < 0) goto free_ainfo;
+ }
+
+ err = snd_midi_event_new(PM_DEFAULT_SYSEX_BUFFER_SIZE, &ainfo->parser);
if (err < 0) goto free_this_port;
if (midi->latency > 0) { /* must delay output using a queue */
err = alsa_use_queue();
if (err < 0) goto free_parser;
+ queue_used++;
+ }
- err = snd_seq_connect_to(seq, desc->this_port, desc->client, desc->port);
+ if (!ainfo->is_virtual) {
+ err = snd_seq_connect_to(seq, ainfo->this_port, ainfo->client,
+ ainfo->port);
if (err < 0) goto unuse_queue; /* clean up and return on error */
- } else {
- err = snd_seq_connect_to(seq, desc->this_port, desc->client, desc->port);
- if (err < 0) goto free_parser; /* clean up and return on error */
- }
+ }
return pmNoError;
unuse_queue:
- alsa_unuse_queue();
+ if (queue_used > 0) /* only for latency>0 case */
+ alsa_unuse_queue();
free_parser:
- snd_midi_event_free(desc->parser);
+ snd_midi_event_free(ainfo->parser);
free_this_port:
- snd_seq_delete_port(seq, desc->this_port);
- free_desc:
- pm_free(desc);
- pm_hosterror = err;
- if (err < 0) {
- get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN, err);
- }
- return pmHostError;
+ snd_seq_delete_port(seq, ainfo->this_port);
+ free_ainfo:
+ pm_free(ainfo);
+ return check_hosterror(err);
}
static PmError alsa_write_byte(PmInternal *midi, unsigned char byte,
- PmTimestamp timestamp)
+ PmTimestamp timestamp)
{
- alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+ alsa_info_type info = (alsa_info_type) midi->api_info;
snd_seq_event_t ev;
- int err;
+ int err = 0;
snd_seq_ev_clear(&ev);
- if (snd_midi_event_encode_byte(desc->parser, byte, &ev) == 1) {
- snd_seq_ev_set_dest(&ev, desc->client, desc->port);
- snd_seq_ev_set_source(&ev, desc->this_port);
+ if (snd_midi_event_encode_byte(info->parser, byte, &ev) == 1) {
+ if (info->is_virtual) {
+ snd_seq_ev_set_subs(&ev);
+ } else {
+ snd_seq_ev_set_dest(&ev, info->client, info->port);
+ }
+ snd_seq_ev_set_source(&ev, info->this_port);
if (midi->latency > 0) {
/* compute relative time of event = timestamp - now + latency */
PmTimestamp now = (midi->time_proc ?
@@ -235,126 +252,165 @@ static PmError alsa_write_byte(PmInternal *midi, unsigned char byte,
ev.dest.client = SND_SEQ_ADDRESS_SUBSCRIBERS; */
snd_seq_ev_set_direct(&ev);
}
- VERBOSE printf("sending event\n");
+ VERBOSE printf("sending event, timestamp %d (%d+%dns) (%s, %s)\n",
+ ev.time.tick, ev.time.time.tv_sec, ev.time.time.tv_nsec,
+ (ev.flags & SND_SEQ_TIME_STAMP_MASK ? "real" : "tick"),
+ (ev.flags & SND_SEQ_TIME_MODE_MASK ? "rel" : "abs"));
err = snd_seq_event_output(seq, &ev);
- if (err < 0) {
- desc->error = err;
- return pmHostError;
- }
}
- return pmNoError;
+ return check_hosterror(err);
}
static PmError alsa_out_close(PmInternal *midi)
{
- alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
- if (!desc) return pmBadPtr;
-
- if ((pm_hosterror = snd_seq_disconnect_to(seq, desc->this_port,
- desc->client, desc->port))) {
- // if there's an error, try to delete the port anyway, but don't
- // change the pm_hosterror value so we retain the first error
- snd_seq_delete_port(seq, desc->this_port);
- } else { // if there's no error, delete the port and retain any error
- pm_hosterror = snd_seq_delete_port(seq, desc->this_port);
+ alsa_info_type info = (alsa_info_type) midi->api_info;
+ int err = 0;
+ int error2 = 0;
+ if (!info) return pmBadPtr;
+
+ if (info->this_port != PORT_IS_CLOSED) {
+ if (!info->is_virtual) {
+ err = snd_seq_disconnect_to(seq, info->this_port,
+ info->client, info->port);
+ /* even if there was an error, we still try to delete the port */
+ error2 = snd_seq_delete_port(seq, info->this_port);
+
+ if (!err) { /* retain original error if there was one */
+ err = error2; /* otherwise, use port delete status */
+ }
+ }
}
if (midi->latency > 0) alsa_unuse_queue();
- snd_midi_event_free(desc->parser);
- midi->descriptor = NULL; /* destroy the pointer to signify "closed" */
- pm_free(desc);
- if (pm_hosterror) {
- get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN,
- pm_hosterror);
- return pmHostError;
+ snd_midi_event_free(info->parser);
+ midi->api_info = NULL; /* destroy the pointer to signify "closed" */
+ pm_free(info);
+ return check_hosterror(err);
+}
+
+
+static PmError alsa_create_virtual(int is_input, const char *name,
+ void *device_info)
+{
+ snd_seq_port_info_t *pinfo;
+ int err;
+ int client, port;
+
+ /* we need the id to set the port. */
+ PmDeviceID id = pm_add_device("ALSA", name, is_input, TRUE, NULL,
+ (is_input ? &pm_linuxalsa_in_dictionary :
+ &pm_linuxalsa_out_dictionary));
+ if (id < 0) { /* error -- out of memory? */
+ return id;
}
- return pmNoError;
+ snd_seq_port_info_alloca(&pinfo);
+ snd_seq_port_info_set_capability(pinfo,
+ (is_input ? SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE :
+ SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ));
+ snd_seq_port_info_set_type(pinfo, SND_SEQ_PORT_TYPE_MIDI_GENERIC |
+ SND_SEQ_PORT_TYPE_APPLICATION);
+ snd_seq_port_info_set_name(pinfo, name);
+ snd_seq_port_info_set_port(pinfo, id);
+ snd_seq_port_info_set_port_specified(pinfo, 1);
+ /* next 3 lines needed to generate timestamp - PaulLiu */
+ snd_seq_port_info_set_timestamping(pinfo, 1);
+ snd_seq_port_info_set_timestamp_real(pinfo, 0);
+ snd_seq_port_info_set_timestamp_queue(pinfo, queue);
+ err = snd_seq_create_port(seq, pinfo);
+ if (err < 0) {
+ pm_undo_add_device(id);
+ return check_hosterror(err);
+ }
+ client = snd_seq_port_info_get_client(pinfo);
+ port = snd_seq_port_info_get_port(pinfo);
+ pm_descriptors[id].descriptor = MAKE_DESCRIPTOR(client, port);
+ return id;
}
+ static PmError alsa_delete_virtual(PmDeviceID id)
+ {
+ int err = snd_seq_delete_port(seq, id);
+ return check_hosterror(err);
+ }
+
+
static PmError alsa_in_open(PmInternal *midi, void *driverInfo)
{
- void *client_port = descriptors[midi->device_id].descriptor;
- alsa_descriptor_type desc = (alsa_descriptor_type)
- pm_alloc(sizeof(alsa_descriptor_node));
- snd_seq_port_info_t *info;
+ int id = midi->device_id;
+ void *client_port = pm_descriptors[id].descriptor;
+ alsa_info_type ainfo = alsa_info_create((long) client_port, id,
+ pm_descriptors[id].pub.is_virtual);
+ snd_seq_port_info_t *pinfo;
snd_seq_port_subscribe_t *sub;
snd_seq_addr_t addr;
- int err;
-
- if (!desc) return pmInsufficientMemory;
+ int err = 0;
+ int is_virtual = pm_descriptors[id].pub.is_virtual;
+ if (!ainfo) return pmInsufficientMemory;
+ midi->api_info = ainfo;
+
err = alsa_use_queue();
- if (err < 0) goto free_desc;
+ if (err < 0) goto free_ainfo;
- snd_seq_port_info_alloca(&info);
- snd_seq_port_info_set_port(info, midi->device_id);
- snd_seq_port_info_set_capability(info, SND_SEQ_PORT_CAP_WRITE |
- SND_SEQ_PORT_CAP_READ);
- snd_seq_port_info_set_type(info, SND_SEQ_PORT_TYPE_MIDI_GENERIC |
- SND_SEQ_PORT_TYPE_APPLICATION);
- snd_seq_port_info_set_port_specified(info, 1);
- err = snd_seq_create_port(seq, info);
- if (err < 0) goto free_queue;
-
- /* fill in fields of desc, which is passed to pm_write routines */
- midi->descriptor = desc;
- desc->client = GET_DESCRIPTOR_CLIENT(client_port);
- desc->port = GET_DESCRIPTOR_PORT(client_port);
- desc->this_port = midi->device_id;
- desc->in_sysex = 0;
-
- desc->error = 0;
-
- VERBOSE printf("snd_seq_connect_from: %d %d %d\n",
- desc->this_port, desc->client, desc->port);
- snd_seq_port_subscribe_alloca(&sub);
- addr.client = snd_seq_client_id(seq);
- addr.port = desc->this_port;
- snd_seq_port_subscribe_set_dest(sub, &addr);
- addr.client = desc->client;
- addr.port = desc->port;
- snd_seq_port_subscribe_set_sender(sub, &addr);
- snd_seq_port_subscribe_set_time_update(sub, 1);
- /* this doesn't seem to work: messages come in with real timestamps */
- snd_seq_port_subscribe_set_time_real(sub, 0);
- err = snd_seq_subscribe_port(seq, sub);
- /* err =
- snd_seq_connect_from(seq, desc->this_port, desc->client, desc->port); */
- if (err < 0) goto free_this_port; /* clean up and return on error */
+ if (is_virtual) {
+ ainfo->is_virtual = TRUE;
+ } else {
+ /* create a port for this alsa client (seq) where the port
+ number matches the portmidi device ID of the input device */
+ snd_seq_port_info_alloca(&pinfo);
+ snd_seq_port_info_set_port(pinfo, id);
+ snd_seq_port_info_set_capability(pinfo, SND_SEQ_PORT_CAP_WRITE |
+ SND_SEQ_PORT_CAP_READ);
+ snd_seq_port_info_set_type(pinfo, SND_SEQ_PORT_TYPE_MIDI_GENERIC |
+ SND_SEQ_PORT_TYPE_APPLICATION);
+ snd_seq_port_info_set_port_specified(pinfo, 1);
+ err = snd_seq_create_port(seq, pinfo);
+ if (err < 0) goto free_queue;
+
+ /* forward messages from input to this alsa client, so this
+ * alsa client is the destination, and the destination port is the
+ * port we just created using the device ID as port number
+ */
+ snd_seq_port_subscribe_alloca(&sub);
+ addr.client = snd_seq_client_id(seq);
+ addr.port = ainfo->this_port;
+ snd_seq_port_subscribe_set_dest(sub, &addr);
+
+ /* forward from the sender which is the device named by
+ client and port */
+ addr.client = ainfo->client;
+ addr.port = ainfo->port;
+ snd_seq_port_subscribe_set_sender(sub, &addr);
+ snd_seq_port_subscribe_set_time_update(sub, 1);
+ /* this doesn't seem to work: messages come in with real timestamps */
+ snd_seq_port_subscribe_set_time_real(sub, 0);
+ err = snd_seq_subscribe_port(seq, sub);
+ if (err < 0) goto free_this_port; /* clean up and return on error */
+ }
return pmNoError;
-
free_this_port:
- snd_seq_delete_port(seq, desc->this_port);
+ snd_seq_delete_port(seq, ainfo->this_port);
free_queue:
alsa_unuse_queue();
- free_desc:
- pm_free(desc);
- pm_hosterror = err;
- if (err < 0) {
- get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN, err);
- }
- return pmHostError;
+ free_ainfo:
+ pm_free(ainfo);
+ return check_hosterror(err);
}
static PmError alsa_in_close(PmInternal *midi)
{
- alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
- if (!desc) return pmBadPtr;
- if ((pm_hosterror = snd_seq_disconnect_from(seq, desc->this_port,
- desc->client, desc->port))) {
- snd_seq_delete_port(seq, desc->this_port); /* try to close port */
- } else {
- pm_hosterror = snd_seq_delete_port(seq, desc->this_port);
+ int err = 0;
+ alsa_info_type info = (alsa_info_type) midi->api_info;
+ if (!info) return pmBadPtr;
+ /* virtual ports stay open because the represent devices */
+ if (!info->is_virtual && info->this_port != PORT_IS_CLOSED) {
+ err = snd_seq_delete_port(seq, info->this_port);
}
alsa_unuse_queue();
- pm_free(desc);
- if (pm_hosterror) {
- get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN,
- pm_hosterror);
- return pmHostError;
- }
- return pmNoError;
+ midi->api_info = NULL;
+ pm_free(info);
+ return check_hosterror(err);
}
@@ -370,11 +426,11 @@ static PmError alsa_abort(PmInternal *midi)
* upgrade my entire Linux OS -RBD
*/
/*
- alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+ info_type info = (info_type) midi->api_info;
snd_seq_remove_events_t info;
snd_seq_addr_t addr;
- addr.client = desc->client;
- addr.port = desc->port;
+ addr.client = info->client;
+ addr.port = info->port;
snd_seq_remove_events_set_dest(&info, &addr);
snd_seq_remove_events_set_condition(&info, SND_SEQ_REMOVE_DEST);
pm_hosterror = snd_seq_remove_events(seq, &info);
@@ -389,65 +445,14 @@ static PmError alsa_abort(PmInternal *midi)
}
-#ifdef GARBAGE
-This is old code here temporarily for reference
-static PmError alsa_write(PmInternal *midi, PmEvent *buffer, int32_t length)
-{
- alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
- int i, bytes;
- unsigned char byte;
- PmMessage msg;
-
- desc->error = 0;
- for (; length > 0; length--, buffer++) {
- VERBOSE printf("message 0x%x\n", buffer->message);
- if (Pm_MessageStatus(buffer->message) == MIDI_SYSEX)
- desc->in_sysex = TRUE;
- if (desc->in_sysex) {
- msg = buffer->message;
- for (i = 0; i < 4; i++) {
- byte = msg; /* extract next byte to send */
- alsa_write_byte(midi, byte, buffer->timestamp);
- if (byte == MIDI_EOX) {
- desc->in_sysex = FALSE;
- break;
- }
- if (desc->error < 0) break;
- msg >>= 8; /* shift next byte into position */
- }
- } else {
- bytes = midi_message_length(buffer->message);
- msg = buffer->message;
- for (i = 0; i < bytes; i++) {
- byte = msg; /* extract next byte to send */
- VERBOSE printf("sending 0x%x\n", byte);
- alsa_write_byte(midi, byte, buffer->timestamp);
- if (desc->error < 0) break;
- msg >>= 8; /* shift next byte into position */
- }
- }
- }
- if (desc->error < 0) return pmHostError;
-
- VERBOSE printf("snd_seq_drain_output: 0x%x\n", (unsigned int) seq);
- desc->error = snd_seq_drain_output(seq);
- if (desc->error < 0) return pmHostError;
-
- desc->error = pmNoError;
- return pmNoError;
-}
-#endif
-
-
static PmError alsa_write_flush(PmInternal *midi, PmTimestamp timestamp)
{
- alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
- VERBOSE printf("snd_seq_drain_output: 0x%x\n", (unsigned int)(FPTR) seq);
- desc->error = snd_seq_drain_output(seq);
- if (desc->error < 0) return pmHostError;
-
- desc->error = pmNoError;
- return pmNoError;
+ int err;
+ alsa_info_type info = (alsa_info_type) midi->api_info;
+ if (!info) return pmBadPtr;
+ VERBOSE printf("snd_seq_drain_output: %p\n", seq);
+ err = snd_seq_drain_output(seq);
+ return check_hosterror(err);
}
@@ -456,16 +461,16 @@ static PmError alsa_write_short(PmInternal *midi, PmEvent *event)
int bytes = midi_message_length(event->message);
PmMessage msg = event->message;
int i;
- alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+ alsa_info_type info = (alsa_info_type) midi->api_info;
+ if (!info) return pmBadPtr;
for (i = 0; i < bytes; i++) {
unsigned char byte = msg;
VERBOSE printf("sending 0x%x\n", byte);
alsa_write_byte(midi, byte, event->timestamp);
- if (desc->error < 0) break;
+ if (pm_hosterror) break;
msg >>= 8; /* shift next byte into position */
}
- if (desc->error < 0) return pmHostError;
- desc->error = pmNoError;
+ if (pm_hosterror) return pmHostError;
return pmNoError;
}
@@ -489,25 +494,50 @@ static PmTimestamp alsa_synchronize(PmInternal *midi)
static void handle_event(snd_seq_event_t *ev)
{
int device_id = ev->dest.port;
- PmInternal *midi = descriptors[device_id].internalDescriptor;
+ PmInternal *midi = pm_descriptors[device_id].pm_internal;
+ // There is a race condition when closing a device and
+ // continuing to poll other open devices. The closed device may
+ // have outstanding events from before the close operation.
+ if (!midi) {
+ return;
+ }
PmEvent pm_ev;
- PmTimeProcPtr time_proc = midi->time_proc;
- PmTimestamp timestamp;
+ PmTimestamp timestamp = midi->time_proc(midi->time_info);
/* time stamp should be in ticks, using our queue where 1 tick = 1ms */
- assert((ev->flags & SND_SEQ_TIME_STAMP_MASK) == SND_SEQ_TIME_STAMP_TICK);
+ /* assert((ev->flags & SND_SEQ_TIME_STAMP_MASK) == SND_SEQ_TIME_STAMP_TICK);
+ * Currently, event timestamp is ignored. See long note below. */
- /* if no time_proc, just return "native" ticks (ms) */
- if (time_proc == NULL) {
- timestamp = ev->time.tick;
- } else { /* translate time to time_proc basis */
+ VERBOSE {
+ /* translate time to time_proc basis */
snd_seq_queue_status_t *queue_status;
snd_seq_queue_status_alloca(&queue_status);
snd_seq_get_queue_status(seq, queue, queue_status);
- /* return (now - alsa_now) + alsa_timestamp */
- timestamp = (*time_proc)(midi->time_info) + ev->time.tick -
- snd_seq_queue_status_get_tick_time(queue_status);
+ printf("handle_event: alsa_now %d, "
+ "event timestamp %d (%d+%dns) (%s, %s)\n",
+ snd_seq_queue_status_get_tick_time(queue_status),
+ ev->time.tick, ev->time.time.tv_sec, ev->time.time.tv_nsec,
+ (ev->flags & SND_SEQ_TIME_STAMP_MASK ? "real" : "tick"),
+ (ev->flags & SND_SEQ_TIME_MODE_MASK ? "rel" : "abs"));
+ /* OLD: portmidi timestamp is (now - alsa_now) + alsa_timestamp */
+ /* timestamp = (*time_proc)(midi->time_info) + ev->time.tick -
+ snd_seq_queue_status_get_tick_time(queue_status); */
}
+ /* CURRENT: portmidi timestamp is "now". In a test, timestamps from
+ * hardware (MIDI over USB) were timestamped with the current ALSA
+ * time (snd_seq_queue_status_get_tick_time) and flags indicating
+ * absolute ticks, but timestamps from another application's virtual
+ * port, sent direct with 0 absolute ticks, were received with a
+ * large value that is apparently the time since the start time of
+ * the other application. Without any reference to our local time,
+ * this seems useless. PortMidi is supposed to return the local
+ * PortMidi time of the arrival of the message, so the best we can
+ * do is set the timestamp to our local clock. This seems to be a
+ * design flaw in ALSA -- I pointed this out a decade ago, but if
+ * there is a workaround, I'd still like to know. Maybe there is a
+ * way to use absolute real time and maybe that's sharable across
+ * applications by referencing the system time?
+ */
pm_ev.timestamp = timestamp;
switch (ev->type) {
case SND_SEQ_EVENT_NOTEON:
@@ -618,12 +648,31 @@ static void handle_event(snd_seq_event_t *ev)
pm_read_bytes(midi, ptr, ev->data.ext.len, timestamp);
break;
}
+ case SND_SEQ_EVENT_PORT_UNSUBSCRIBED: {
+ /* this happens if you have an input port open and the
+ * device or application with virtual ports closes. We
+ * mark the port as closed to avoid closing a 2nd time
+ * when Pm_Close() is called.
+ */
+ alsa_info_type info = (alsa_info_type) midi->api_info;
+ /* printf("SND_SEQ_EVENT_UNSUBSCRIBE message\n"); */
+ info->this_port = PORT_IS_CLOSED;
+ break;
+ }
+ case SND_SEQ_EVENT_PORT_SUBSCRIBED:
+ break; /* someone connected to a virtual output port, not reported */
+ default:
+ printf("portmidi handle_event: not handled type %x\n", ev->type);
+ break;
}
}
static PmError alsa_poll(PmInternal *midi)
{
+ if (!midi) {
+ return pmBadPtr;
+ }
snd_seq_event_t *ev;
/* expensive check for input data, gets data from device: */
while (snd_seq_event_input_pending(seq, TRUE) > 0) {
@@ -641,10 +690,9 @@ static PmError alsa_poll(PmInternal *midi)
handle_event(ev);
} else if (rslt == -ENOSPC) {
int i;
- for (i = 0; i < pm_descriptor_index; i++) {
- if (descriptors[i].pub.input) {
- PmInternal *midi = (PmInternal *)
- descriptors[i].internalDescriptor;
+ for (i = 0; i < pm_descriptor_len; i++) {
+ if (pm_descriptors[i].pub.input) {
+ PmInternal *midi = pm_descriptors[i].pm_internal;
/* careful, device may not be open! */
if (midi) Pm_SetOverflow(midi->queue);
}
@@ -656,18 +704,9 @@ static PmError alsa_poll(PmInternal *midi)
}
-static unsigned int alsa_has_host_error(PmInternal *midi)
-{
- alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
- return desc->error;
-}
-
-
-static void alsa_get_host_error(PmInternal *midi, char *msg, unsigned int len)
+static unsigned int alsa_check_host_error(PmInternal *midi)
{
- alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
- int err = (pm_hosterror || desc->error);
- get_alsa_error_text(msg, len, err);
+ return FALSE;
}
@@ -683,8 +722,7 @@ pm_fns_node pm_linuxalsa_in_dictionary = {
alsa_abort,
alsa_in_close,
alsa_poll,
- alsa_has_host_error,
- alsa_get_host_error
+ alsa_check_host_error
};
pm_fns_node pm_linuxalsa_out_dictionary = {
@@ -699,8 +737,7 @@ pm_fns_node pm_linuxalsa_out_dictionary = {
alsa_abort,
alsa_out_close,
none_poll,
- alsa_has_host_error,
- alsa_get_host_error
+ alsa_check_host_error
};
@@ -718,13 +755,16 @@ char *pm_strdup(const char *s)
}
-PmError pm_linuxalsa_init( void )
+PmError pm_linuxalsa_init(void)
{
int err;
snd_seq_client_info_t *cinfo;
snd_seq_port_info_t *pinfo;
unsigned int caps;
+ /* Register interface ALSA with create_virtual fn */
+ pm_add_interf("ALSA", &alsa_create_virtual, &alsa_delete_virtual);
+
/* Previously, the last parameter was SND_SEQ_NONBLOCK, but this
* would cause messages to be dropped if the ALSA buffer fills up.
* The correct behavior is for writes to block until there is
@@ -735,56 +775,61 @@ PmError pm_linuxalsa_init( void )
* call seq_event_input_pending() to avoid blocking.
*/
err = snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0);
- if (err < 0) return err;
+ if (err < 0) goto error_return;
snd_seq_client_info_alloca(&cinfo);
snd_seq_port_info_alloca(&pinfo);
snd_seq_client_info_set_client(cinfo, -1);
while (snd_seq_query_next_client(seq, cinfo) == 0) {
- snd_seq_port_info_set_client(pinfo, snd_seq_client_info_get_client(cinfo));
+ snd_seq_port_info_set_client(pinfo,
+ snd_seq_client_info_get_client(cinfo));
snd_seq_port_info_set_port(pinfo, -1);
while (snd_seq_query_next_port(seq, pinfo) == 0) {
if (snd_seq_port_info_get_client(pinfo) == SND_SEQ_CLIENT_SYSTEM)
continue; /* ignore Timer and Announce ports on client 0 */
caps = snd_seq_port_info_get_capability(pinfo);
- if (!(caps & (SND_SEQ_PORT_CAP_SUBS_READ | SND_SEQ_PORT_CAP_SUBS_WRITE)))
+ if (!(caps & (SND_SEQ_PORT_CAP_SUBS_READ |
+ SND_SEQ_PORT_CAP_SUBS_WRITE)))
continue; /* ignore if you cannot read or write port */
if (caps & SND_SEQ_PORT_CAP_SUBS_WRITE) {
if (pm_default_output_device_id == -1)
- pm_default_output_device_id = pm_descriptor_index;
- // FIXME: pm_strdup() result is leaked
- pm_add_device((char *)"ALSA",
- pm_strdup(snd_seq_port_info_get_name(pinfo)),
- FALSE,
- MAKE_DESCRIPTOR(snd_seq_port_info_get_client(pinfo),
- snd_seq_port_info_get_port(pinfo)),
- &pm_linuxalsa_out_dictionary);
+ pm_default_output_device_id = pm_descriptor_len;
+ pm_add_device("ALSA",
+ pm_strdup(snd_seq_port_info_get_name(pinfo)),
+ FALSE, FALSE,
+ MAKE_DESCRIPTOR(snd_seq_port_info_get_client(pinfo),
+ snd_seq_port_info_get_port(pinfo)),
+ &pm_linuxalsa_out_dictionary);
}
if (caps & SND_SEQ_PORT_CAP_SUBS_READ) {
if (pm_default_input_device_id == -1)
- pm_default_input_device_id = pm_descriptor_index;
- // FIXME: pm_strdup() result is leaked
- pm_add_device((char *)"ALSA",
- pm_strdup(snd_seq_port_info_get_name(pinfo)),
- TRUE,
- MAKE_DESCRIPTOR(snd_seq_port_info_get_client(pinfo),
- snd_seq_port_info_get_port(pinfo)),
- &pm_linuxalsa_in_dictionary);
+ pm_default_input_device_id = pm_descriptor_len;
+ pm_add_device("ALSA",
+ pm_strdup(snd_seq_port_info_get_name(pinfo)),
+ TRUE, FALSE,
+ MAKE_DESCRIPTOR(snd_seq_port_info_get_client(pinfo),
+ snd_seq_port_info_get_port(pinfo)),
+ &pm_linuxalsa_in_dictionary);
}
}
}
return pmNoError;
+ error_return:
+ pm_linuxalsa_term(); /* clean up */
+ return check_hosterror(err);
}
-
+
void pm_linuxalsa_term(void)
{
if (seq) {
snd_seq_close(seq);
- pm_free(descriptors);
- descriptors = NULL;
- pm_descriptor_index = 0;
+ pm_free(pm_descriptors);
+ pm_descriptors = NULL;
+ pm_descriptor_len = 0;
pm_descriptor_max = 0;
}
}
+
+#endif
diff --git a/3rdparty/portmidi/pm_linux/pmlinuxnull.c b/3rdparty/portmidi/pm_linux/pmlinuxnull.c
new file mode 100644
index 00000000000..841440917ad
--- /dev/null
+++ b/3rdparty/portmidi/pm_linux/pmlinuxnull.c
@@ -0,0 +1,31 @@
+/*
+ * pmlinuxnull.c -- system specific definitions
+ *
+ * written by:
+ * Roger Dannenberg
+ *
+ * If there is no ALSA, you can define PMNULL and build PortMidi. It will
+ * not report any devices, so you will not be able to open any, but if
+ * you wanted to disable MIDI from some application, this could be used.
+ * Mainly, this code shows the possibility of supporting multiple
+ * interfaces, e.g., ALSA and Sndio on BSD, or ALSA and Jack on Linux.
+ * But as of Dec, 2021, the only supported MIDI API for Linux is ALSA.
+ */
+
+#ifdef PMNULL
+
+#include "portmidi.h"
+#include "pmlinuxnull.h"
+
+
+PmError pm_linuxnull_init(void)
+{
+ return pmNoError;
+}
+
+
+void pm_linuxnull_term(void)
+{
+}
+
+#endif
diff --git a/3rdparty/portmidi/pm_linux/pmlinuxnull.h b/3rdparty/portmidi/pm_linux/pmlinuxnull.h
new file mode 100644
index 00000000000..52607eb01bf
--- /dev/null
+++ b/3rdparty/portmidi/pm_linux/pmlinuxnull.h
@@ -0,0 +1,6 @@
+/* pmlinuxnull.h -- system-specific definitions */
+
+PmError pm_linuxnull_init(void);
+void pm_linuxnull_term(void);
+
+
diff --git a/3rdparty/portmidi/pm_mac/Makefile.osx b/3rdparty/portmidi/pm_mac/Makefile.osx
index 8c6862e28f0..e34e33a92ff 100644
--- a/3rdparty/portmidi/pm_mac/Makefile.osx
+++ b/3rdparty/portmidi/pm_mac/Makefile.osx
@@ -4,7 +4,7 @@
# Sep 2009
# NOTE: you can use
-# make -f pm_osx/Makefile.osx configuration=Release
+# make -f pm_mac/Makefile.osx configuration=Release
# to override the default Debug configuration
configuration=Release
@@ -23,12 +23,12 @@ all: $(CONFIG)/CMakeCache.txt
cd $(CONFIG); make
$(CONFIG)/CMakeCache.txt:
- rm -f CMakeCache.txt
+ rm -f $(CONFIG)/CMakeCache.txt
mkdir -p $(CONFIG)
cd $(CONFIG); cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$(CONFIG)
-**** For instructions: make -f pm_mac\Makefile.osx help ****\n'
+**** For instructions: make -f pm_mac/Makefile.osx help ****\n'
help:
echo $$'\n\n\
@@ -63,6 +63,8 @@ cleaner: clean
rm -f pm_java/pmjni/Release/*.jnilib
cleanest: cleaner
+ rm -f Debug/CMakeCache.txt Release/CMakeCache.txt
+ rm -f CMakeCache.txt
rm -f Debug/libportmidi_s.a Release/libportmidi_s.a
rm -f pm_test/Debug/test pm_test/Debug/sysex pm_test/Debug/midithread
rm -f pm_test/Debug/latency pm_test/Debug/midithru
diff --git a/3rdparty/portmidi/pm_mac/README_MAC.txt b/3rdparty/portmidi/pm_mac/README_MAC.txt
index 1650dccecce..12cc40bbc17 100644
--- a/3rdparty/portmidi/pm_mac/README_MAC.txt
+++ b/3rdparty/portmidi/pm_mac/README_MAC.txt
@@ -1,163 +1,76 @@
README_MAC.txt for PortMidi
Roger Dannenberg
20 nov 2009
-revised 20 Sep 2010 for Xcode 3.2.4 and CMake 8.2-2
+revised 20 Sep 2010 for Xcode 4.3.2 and CMake 2.8.8
+revised Jan 2022 for the PortMidi/portmidi repo on github.com
+
+This documents how I build PortMidi for macOS. It's not the only way,
+and command-line/scripting enthusiasts will say it's not even a good
+way. Feel free to contribute your approach if you are willing to
+describe it carefully and test it.
+
+Install Xcode and the CMake application, CMake.app. I use the GUI
+version of CMake which makes it easy to see/edit variables and
+options.
+
+==== USING CMAKE ====
+
+Run CMake.app and select your portmidi repo working directory as the
+location for source and build. (Yes, I use so called "in-tree"
+builds -- it doesn't hurt, but I don't think it is necessary.)
+
+Default settings should all be fine, but select options under BUILD if
+you wish:
+
+BUILD_NATIVE_JAVA_INTERFACE and BUILD_PMDEFAULTS to build a Java-based
+GUI for setting default MIDI devices. (Otherwise, calls to
+Pm_DefaultInputDevice() and Pm_DefaultOutputDevice() will not be
+useful, but maybe you are not going to use these anyway -- up to you.)
+
+BUILD_PORTMIDI_TESTS to create some test programs. Of particular
+interest are test/mm, a handy command-line MIDI Input Monitor, and
+test/testio, a simple command-line program to send or receive some
+MIDI notes in case you need a quick test: What devices do I have? Does
+this input work? Does this output work?
+
+I disable BUILD_SHARED_LIBS and always link statically: Static linking only
+adds about 40KB to any application and then you don't have to worry
+about versions, instally, copying or finding the dynamic link library,
+etc.
+
+To make sure you link statically, I rename the library to
+libportmidi_static.a. To do this, set PM_STATIC_LIB_NAME (in CMake,
+under the "PM" group) to "portmidi_static", and of course your
+application will have to specify portmidi_static as the library to
+link to.
+
+If you are building simple command-line applications, you might want
+to enable PM_CHECK_ERRORS. If you do, then calls into the PortMidi
+library will print error messages and exit in the event of an error
+(such as trying to open a device that does not exist). This saves you
+from having to check for errors everytime you call a library function
+or getting confused when errors are detected but not reported. For
+high-quality applications, do NOT enable PM_CHECK_ERRORS -- any
+failure could immediately abort your whole application, which is not
+very friendly to users.
+
+Click on Configure (maybe a couple of times).
+
+Click on Generate and make an Xcode project.
+
+Open portmidi/portmidi.xcodeproj with Xcode and build what you
+need. The simplest thing is to build the ALL_BUILD target. Be careful
+to specify a Debug or Release depending on what you want. "ALL_BUILD"
+is a misnomer -- it only builds the version you select.
+
+PmDefaults is minimally supported and may be removed in 2023 unless we
+hear from users. To run it,
+(1) make sure java runs from the command line.
+(2) run the following command in an open Terminal:
+ cd portmidi/pm_java/pmdefaults
+ ./pmdefaults
+
+Feel free to write a short script that cd's to your pmdefaults
+directory and runs pmdefaults, and put that script somewhere on your
+path so you can type it anywhere.
-To build PortMidi for Mac OS X, you must install Xcode and
-CMake.
-
-CMake can build either command-line Makefiles or Xcode projects.
-These approaches are described in separate sections below.
-
-==== CLEANING UP ====
-(Skip this for now, but later you might want start from a clean
-slate.)
-
-Start in the portmedia/portmidi directory.
-
-make -f pm_mac/Makefile.osx clean
-
-will remove .o, CMakeFiles, and other intermediate files.
-
-Using "cleaner" instead of "clean" will also remove jni-related
-intermediate files.
-
-Using "cleanest" instead of "clean" or "cleaner" will also remove
-application binaries and the portmidi libraries. (It will not
-uninstall anything, however.)
-
-==== USING CMAKE (AND COMMAND LINE TOOLS) ====
-
-Start in the portmedia/portmidi directory.
-
-make -f pm_mac/Makefile.osx
-
-(Begin note: make will invoke cmake to build a Makefile and then make to
-build portmidi. This extra level allows you to correctly build
-both Release and Debug versions. Release is the default, so to get
-the Debug version, use:
-
-make -f pm_mac/Makefile.osx configuration=Debug
-)
-
-Release version executables and libraries are now in
- portmedia/portmidi/Release
-
-Debug version executables and libraries are created in
- portmedia/portmidi/Debug
-The Debug versions are compiled with PM_CHECK_ERRORS which
-prints an error message and aborts when an error code is returned
-by PortMidi functions. This is useful for small command line
-applications. Otherwise, you should check and handle error returns
-in your program.
-
-You can install portmidi as follows:
-
-cd Release; sudo make install
-
-This will install /usr/local/include/{portmidi.h, porttime.h}
-and /usr/local/lib/{libportmidi.dylib, libportmidi_s.a, libpmjni.dylib}
-
-You should now make the pmdefaults.app:
-
-make -f pm_mac/Makefile.osx pmdefaults
-
-NOTE: pmdefaults.app will be in pm_mac/Release/.
-
-Please copy pmdefaults.app to your Applications folder or wherever
-you would normally expect to find it.
-
-==== USING CMAKE TO BUILD Xcode PROJECT ====
-
-Before you can use Xcode, you need a portmidi.xcodeproj file.
-CMake builds a location-dependent Xcode project, so unfortunately
-it is not easy to provide an Xcode project that is ready to use.
-Therefore, you should make your own. Once you have it, you can
-use it almost like any other Xcode project, and you will not have
-to go back to CMake.
-
-(1) Install CMake if you do not have it already.
-
-(2) Open portmedia/portmidi/CMakeLists.txt with CMake
-
-(3) Use Configure and Generate buttons
-
-(4) This creates portmedia/portmidi/portmidi.xcodeproj.
-
-Note: You will also use pm_mac/pm_mac.xcodeproj, which
-is not generated by CMake.
-
-(5) Open portmidi/portmidi.xcodeproj with Xcode and
-build what you need. The simplest thing is to build the
-ALL_BUILD target. The default will be to build the Debug
-version, but you may want to change this to Release.
-
-NOTE: ALL_BUILD may report errors. Try simply building again
-or rebuilding specific targets that fail until they build
-without errors. There appears to be a race condition or
-missing dependencies in the build system.
-
-The Debug version is compiled with PM_CHECK_ERRORS, and the
-Release version is not. PM_CHECK_ERRORS will print an error
-message and exit your program if any error is returned from
-a call into PortMidi.
-
-CMake (currently) also creates MinSizRel and RelWithDebInfo
-versions, but only because I cannot figure out how to disable
-them.
-
-You will probably want the application PmDefaults, which sets
-default MIDI In and Out devices for PortMidi. You may also
-want to build a Java application using PortMidi. Since I have
-not figured out how to use CMake to make an OS X Java application,
-use pm_mac/pm_mac.xcodeproj as follows:
-
-(6) open pm_mac/pm_mac.xcodeproj
-
-(7) pm_java/pmjni/portmidi_JportmidiApi.h is needed
-by libpmjni.jnilib, the Java native interface library. Since
-portmidi_JportmidiApi.h is included with PortMidi, you can skip
-to step 8, but if you really want to rebuild everything from
-scratch, build the JPortMidiHeaders project first, and continue
-with step 8:
-
-(8) If you did not build libpmjni.dylib using portmidi.xcodeproj,
-do it now. (It depends on portmidi_JportmidiApi.h, and the
-PmDefaults project depends on libpmjni.dylib.)
-
-(9) Returning to pm_mac.xcodeproj, build the PmDefaults program.
-
-(10) If you wish, copy pm_mac/build/Deployment/PmDefaults.app to
-your applications folder.
-
-(11) If you want to install libportmidi.dylib, first make it with
-Xcode, then
- sudo make -f pm_mac/Makefile.osx install
-This command will install /usr/local/include/{porttime.h, portmidi.h}
-and /usr/local/lib/libportmidi.dylib
-Note that the "install" function of xcode creates portmidi/Release
-and does not install the library to /usr/local/lib, so please use
-the command line installer.
-
-
-CHANGELOG
-
-20-Sep-2010 Roger B. Dannenberg
- Adapted to Xcode 3.2.4
-20-Nov-2009 Roger B. Dannenberg
- Added some install instructions
-26-Sep-2009 Roger B. Dannenberg
- More changes for using CMake, Makefiles, XCode
-20-Sep-2009 Roger B. Dannenberg
- Modifications for using CMake
-14-Sep-2009 Roger B. Dannenberg
- Modifications for using CMake
-17-Jan-2007 Roger B. Dannenberg
- Explicit instructions for Xcode
-15-Jan-2007 Roger B. Dannenberg
- Changed instructions because of changes to Makefile.osx
-07-Oct-2006 Roger B. Dannenberg
- Added directions for xcodebuild
-29-aug-2006 Roger B. Dannenberg
- Updated this documentation.
-
diff --git a/3rdparty/portmidi/pm_mac/finddefault.c b/3rdparty/portmidi/pm_mac/finddefault.c
index bc95a4001a6..b4556e98d91 100644
--- a/3rdparty/portmidi/pm_mac/finddefault.c
+++ b/3rdparty/portmidi/pm_mac/finddefault.c
@@ -17,14 +17,14 @@
plist files (user and system) open at once (due to a simple
memory management scheme).
*/
-PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
+PmDeviceID find_default_device(const char *path, int input, PmDeviceID id)
/* path -- the name of the preference we are searching for
input -- true iff this is an input device
id -- current default device id
returns matching device id if found, otherwise id
*/
{
- static char *pref_file = (char *)"com.apple.java.util.prefs.plist";
+ static char const *const pref_file = "com.apple.java.util.prefs.plist";
char *pref_str = NULL;
// read device preferences
value_ptr prefs = bplist_read_user_pref(pref_file);
diff --git a/3rdparty/portmidi/pm_mac/osxsupport.h b/3rdparty/portmidi/pm_mac/osxsupport.h
deleted file mode 100644
index 7771868d12a..00000000000
--- a/3rdparty/portmidi/pm_mac/osxsupport.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- osxsupport.h - Cocoa glue to emulated deprecated old Carbon path finder functions
-*/
-
-#ifndef _OSXSUPPORT_H_
-#define _OSXSUPPORT_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-char *FindPrefsDir(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/3rdparty/portmidi/pm_mac/osxsupport.m b/3rdparty/portmidi/pm_mac/osxsupport.m
deleted file mode 100644
index 1cf457f6bdb..00000000000
--- a/3rdparty/portmidi/pm_mac/osxsupport.m
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- osxsupport.m - Cocoa glue to emulated deprecated old Carbon path finder functions
-*/
-
-#import <Cocoa/Cocoa.h>
-#import <AvailabilityMacros.h>
-#include "osxsupport.h"
-
-// convert an NSString to a C string
-#ifndef OSX_PPC
-static char *StringToChar(NSString *str)
-{
- const char *charstr = [str UTF8String];
- char *resstr = (char *)malloc(strlen(charstr)+1);
-
- strcpy(resstr, charstr);
- return resstr;
-}
-
-char *FindPrefsDir(void)
-{
- char *resstr = NULL;
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSPreferencePanesDirectory, NSUserDomainMask, YES);
-
- if ([paths count] > 0)
- {
- resstr = StringToChar([paths objectAtIndex:0]) ;
- }
-
- [pool release];
-
- return resstr;
-}
-#endif
-
diff --git a/3rdparty/portmidi/pm_mac/pm_mac.xcodeproj/project.pbxproj b/3rdparty/portmidi/pm_mac/pm_mac.xcodeproj/project.pbxproj
deleted file mode 100644
index 0d06e565eae..00000000000
--- a/3rdparty/portmidi/pm_mac/pm_mac.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,594 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 44;
- objects = {
-
-/* Begin PBXAggregateTarget section */
- 3D634CAB1247805C0020F829 /* JPortMidiHeaders */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = 3D634CAE1247807A0020F829 /* Build configuration list for PBXAggregateTarget "JPortMidiHeaders" */;
- buildPhases = (
- 3D634CAA1247805C0020F829 /* ShellScript */,
- );
- dependencies = (
- 3D634CB0124781580020F829 /* PBXTargetDependency */,
- );
- name = JPortMidiHeaders;
- productName = JPortMidiHeaders;
- };
- 3DE2142D124662AA0033C839 /* CopyJavaSources */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = 3DE21434124662FF0033C839 /* Build configuration list for PBXAggregateTarget "CopyJavaSources" */;
- buildPhases = (
- 3DE2142C124662AA0033C839 /* CopyFiles */,
- );
- comments = "The reason for copying files here is that the Compile Java target looks in a particular place for sources. It would be much better to simply have Compile Java look in the original location for all sources, but I don't know how to do that. -RBD\n";
- dependencies = (
- );
- name = CopyJavaSources;
- productName = CopyJavaSources;
- };
- 89D0F1C90F3B704E007831A7 /* PmDefaults */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = 89D0F1D20F3B7080007831A7 /* Build configuration list for PBXAggregateTarget "PmDefaults" */;
- buildPhases = (
- );
- dependencies = (
- 89D0F1D10F3B7062007831A7 /* PBXTargetDependency */,
- 89D0F1CD0F3B7062007831A7 /* PBXTargetDependency */,
- 3DE21431124662C50033C839 /* PBXTargetDependency */,
- );
- name = PmDefaults;
- productName = pmdefaults;
- };
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
- 3DE2137F124653FB0033C839 /* portmusic_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 3DE2137E124653FB0033C839 /* portmusic_logo.png */; };
- 3DE21435124663860033C839 /* PmDefaultsFrame.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE2137D124653CB0033C839 /* PmDefaultsFrame.java */; };
- 3DE214361246638A0033C839 /* PmDefaults.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE2137B1246538B0033C839 /* PmDefaults.java */; };
- 3DE214371246638F0033C839 /* JPortMidiException.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE21382124654DE0033C839 /* JPortMidiException.java */; };
- 3DE214381246638F0033C839 /* JPortMidiApi.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE21381124654CF0033C839 /* JPortMidiApi.java */; };
- 3DE214391246638F0033C839 /* JPortMidi.java in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DE21380124654BC0033C839 /* JPortMidi.java */; };
- 3DE216131246AC0E0033C839 /* libpmjni.dylib in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 3DE216101246ABE30033C839 /* libpmjni.dylib */; };
- 3DE216951246D57A0033C839 /* pmdefaults.icns in Resources */ = {isa = PBXBuildFile; fileRef = 3DE216901246C6410033C839 /* pmdefaults.icns */; };
- 89C3F2920F5250A300B0048E /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 89C3F2900F5250A300B0048E /* Credits.rtf */; };
- 89D0F0240F392F20007831A7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 89D0F0210F392F20007831A7 /* InfoPlist.strings */; };
- 89D0F0410F39306C007831A7 /* JavaApplicationStub in Copy Executable */ = {isa = PBXBuildFile; fileRef = 89D0F03E0F39304A007831A7 /* JavaApplicationStub */; };
- 89D0F16A0F3A124E007831A7 /* pmdefaults.jar in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 89D0F15D0F3A0FF7007831A7 /* pmdefaults.jar */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 3D634CAF124781580020F829 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 89D0F1C90F3B704E007831A7;
- remoteInfo = PmDefaults;
- };
- 3DE21430124662C50033C839 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 3DE2142D124662AA0033C839;
- remoteInfo = CopyJavaSources;
- };
- 3DE2145D124666900033C839 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 3DE2142D124662AA0033C839;
- remoteInfo = CopyJavaSources;
- };
- 89D0F1CC0F3B7062007831A7 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 8D1107260486CEB800E47090;
- remoteInfo = "Assemble Application";
- };
- 89D0F1D00F3B7062007831A7 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 89D0F0480F393A6F007831A7;
- remoteInfo = "Compile Java";
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 3DE2142C124662AA0033C839 /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "${PROJECT_DIR}/pmdefaults/src/java";
- dstSubfolderSpec = 0;
- files = (
- 3DE21435124663860033C839 /* PmDefaultsFrame.java in CopyFiles */,
- 3DE214361246638A0033C839 /* PmDefaults.java in CopyFiles */,
- 3DE214371246638F0033C839 /* JPortMidiException.java in CopyFiles */,
- 3DE214381246638F0033C839 /* JPortMidiApi.java in CopyFiles */,
- 3DE214391246638F0033C839 /* JPortMidi.java in CopyFiles */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 89D0F0440F393070007831A7 /* Copy Executable */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "";
- dstSubfolderSpec = 6;
- files = (
- 89D0F0410F39306C007831A7 /* JavaApplicationStub in Copy Executable */,
- );
- name = "Copy Executable";
- runOnlyForDeploymentPostprocessing = 0;
- };
- 89D0F11F0F394189007831A7 /* Copy Java Resources */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "";
- dstSubfolderSpec = 15;
- files = (
- 89D0F16A0F3A124E007831A7 /* pmdefaults.jar in Copy Java Resources */,
- 3DE216131246AC0E0033C839 /* libpmjni.dylib in Copy Java Resources */,
- );
- name = "Copy Java Resources";
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 3DE2137B1246538B0033C839 /* PmDefaults.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = PmDefaults.java; path = ../pm_java/pmdefaults/PmDefaults.java; sourceTree = SOURCE_ROOT; };
- 3DE2137D124653CB0033C839 /* PmDefaultsFrame.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = PmDefaultsFrame.java; path = ../pm_java/pmdefaults/PmDefaultsFrame.java; sourceTree = SOURCE_ROOT; };
- 3DE2137E124653FB0033C839 /* portmusic_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = portmusic_logo.png; path = ../pm_java/pmdefaults/portmusic_logo.png; sourceTree = SOURCE_ROOT; };
- 3DE21380124654BC0033C839 /* JPortMidi.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = JPortMidi.java; path = ../pm_java/jportmidi/JPortMidi.java; sourceTree = SOURCE_ROOT; };
- 3DE21381124654CF0033C839 /* JPortMidiApi.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = JPortMidiApi.java; path = ../pm_java/jportmidi/JPortMidiApi.java; sourceTree = SOURCE_ROOT; };
- 3DE21382124654DE0033C839 /* JPortMidiException.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = JPortMidiException.java; path = ../pm_java/jportmidi/JPortMidiException.java; sourceTree = SOURCE_ROOT; };
- 3DE213841246555A0033C839 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = /System/Library/Frameworks/CoreMIDI.framework; sourceTree = "<absolute>"; };
- 3DE21390124655760033C839 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
- 3DE213BE1246557F0033C839 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
- 3DE216101246ABE30033C839 /* libpmjni.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpmjni.dylib; path = ../Release/libpmjni.dylib; sourceTree = SOURCE_ROOT; };
- 3DE216901246C6410033C839 /* pmdefaults.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = pmdefaults.icns; path = ../pm_java/pmdefaults/pmdefaults.icns; sourceTree = SOURCE_ROOT; };
- 89C3F2910F5250A300B0048E /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; };
- 89D0F0220F392F20007831A7 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- 89D0F0230F392F20007831A7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
- 89D0F03E0F39304A007831A7 /* JavaApplicationStub */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = JavaApplicationStub; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub; sourceTree = "<absolute>"; };
- 89D0F0840F394066007831A7 /* JavaNativeFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaNativeFoundation.framework; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework; sourceTree = "<absolute>"; };
- 89D0F1390F3948A9007831A7 /* pmdefaults/make */ = {isa = PBXFileReference; lastKnownFileType = folder; path = pmdefaults/make; sourceTree = "<group>"; };
- 89D0F15D0F3A0FF7007831A7 /* pmdefaults.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; name = pmdefaults.jar; path = build/Release/pmdefaults.jar; sourceTree = SOURCE_ROOT; };
- 89D0F1860F3A2442007831A7 /* JavaVM.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaVM.framework; path = /System/Library/Frameworks/JavaVM.framework; sourceTree = "<absolute>"; };
- 8D1107320486CEB800E47090 /* PmDefaults.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PmDefaults.app; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXGroup section */
- 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
- isa = PBXGroup;
- children = (
- 3DE213841246555A0033C839 /* CoreMIDI.framework */,
- 3DE21390124655760033C839 /* CoreFoundation.framework */,
- 3DE213BE1246557F0033C839 /* CoreAudio.framework */,
- 89D0F1860F3A2442007831A7 /* JavaVM.framework */,
- 89D0F0840F394066007831A7 /* JavaNativeFoundation.framework */,
- );
- name = "Linked Frameworks";
- sourceTree = "<group>";
- };
- 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
- isa = PBXGroup;
- children = (
- );
- name = "Other Frameworks";
- sourceTree = "<group>";
- };
- 19C28FACFE9D520D11CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- 89D0F15D0F3A0FF7007831A7 /* pmdefaults.jar */,
- 8D1107320486CEB800E47090 /* PmDefaults.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 29B97314FDCFA39411CA2CEA /* pmdefaults */ = {
- isa = PBXGroup;
- children = (
- 3DE216101246ABE30033C839 /* libpmjni.dylib */,
- 89D0F0260F392F48007831A7 /* Source */,
- 89D0F0200F392F20007831A7 /* Resources */,
- 89D0F1390F3948A9007831A7 /* pmdefaults/make */,
- 29B97323FDCFA39411CA2CEA /* Frameworks */,
- 19C28FACFE9D520D11CA2CBB /* Products */,
- );
- name = pmdefaults;
- sourceTree = "<group>";
- };
- 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
- 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
- 3DE2136A124652E20033C839 /* pm_java */ = {
- isa = PBXGroup;
- children = (
- 3DE21379124653150033C839 /* pmdefaults */,
- 3DE2137A1246531D0033C839 /* jportmidi */,
- );
- name = pm_java;
- path = ..;
- sourceTree = "<group>";
- };
- 3DE21379124653150033C839 /* pmdefaults */ = {
- isa = PBXGroup;
- children = (
- 3DE2137D124653CB0033C839 /* PmDefaultsFrame.java */,
- 3DE2137B1246538B0033C839 /* PmDefaults.java */,
- );
- name = pmdefaults;
- sourceTree = "<group>";
- };
- 3DE2137A1246531D0033C839 /* jportmidi */ = {
- isa = PBXGroup;
- children = (
- 3DE21382124654DE0033C839 /* JPortMidiException.java */,
- 3DE21381124654CF0033C839 /* JPortMidiApi.java */,
- 3DE21380124654BC0033C839 /* JPortMidi.java */,
- );
- name = jportmidi;
- sourceTree = "<group>";
- };
- 89D0F0200F392F20007831A7 /* Resources */ = {
- isa = PBXGroup;
- children = (
- 3DE216901246C6410033C839 /* pmdefaults.icns */,
- 3DE2137E124653FB0033C839 /* portmusic_logo.png */,
- 89C3F2900F5250A300B0048E /* Credits.rtf */,
- 89D0F0230F392F20007831A7 /* Info.plist */,
- 89D0F0210F392F20007831A7 /* InfoPlist.strings */,
- 89D0F03E0F39304A007831A7 /* JavaApplicationStub */,
- );
- name = Resources;
- path = pmdefaults/resources;
- sourceTree = "<group>";
- };
- 89D0F0260F392F48007831A7 /* Source */ = {
- isa = PBXGroup;
- children = (
- 3DE2136A124652E20033C839 /* pm_java */,
- );
- name = Source;
- path = pmdefaults/src;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXLegacyTarget section */
- 89D0F0480F393A6F007831A7 /* Compile Java */ = {
- isa = PBXLegacyTarget;
- buildArgumentsString = "-e -f \"${SRCROOT}/make/build.xml\" -debug \"$ACTION\"";
- buildConfigurationList = 89D0F04B0F393AB7007831A7 /* Build configuration list for PBXLegacyTarget "Compile Java" */;
- buildPhases = (
- );
- buildToolPath = /usr/bin/ant;
- buildWorkingDirectory = "";
- dependencies = (
- 3DE2145E124666900033C839 /* PBXTargetDependency */,
- );
- name = "Compile Java";
- passBuildSettingsInEnvironment = 1;
- productName = "Compile Java";
- };
-/* End PBXLegacyTarget section */
-
-/* Begin PBXNativeTarget section */
- 8D1107260486CEB800E47090 /* Assemble Application */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Assemble Application" */;
- buildPhases = (
- 89D0F0440F393070007831A7 /* Copy Executable */,
- 89D0F11F0F394189007831A7 /* Copy Java Resources */,
- 8D1107290486CEB800E47090 /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "Assemble Application";
- productInstallPath = "$(HOME)/Applications";
- productName = pmdefaults;
- productReference = 8D1107320486CEB800E47090 /* PmDefaults.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 29B97313FDCFA39411CA2CEA /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "pm_mac" */;
- compatibilityVersion = "Xcode 3.0";
- developmentRegion = English;
- hasScannedForEncodings = 1;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- );
- mainGroup = 29B97314FDCFA39411CA2CEA /* pmdefaults */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 3D634CAB1247805C0020F829 /* JPortMidiHeaders */,
- 89D0F1C90F3B704E007831A7 /* PmDefaults */,
- 3DE2142D124662AA0033C839 /* CopyJavaSources */,
- 89D0F0480F393A6F007831A7 /* Compile Java */,
- 8D1107260486CEB800E47090 /* Assemble Application */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 8D1107290486CEB800E47090 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3DE216951246D57A0033C839 /* pmdefaults.icns in Resources */,
- 89D0F0240F392F20007831A7 /* InfoPlist.strings in Resources */,
- 89C3F2920F5250A300B0048E /* Credits.rtf in Resources */,
- 3DE2137F124653FB0033C839 /* portmusic_logo.png in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 3D634CAA1247805C0020F829 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "echo BUILT_PRODUCTS_DIR is ${BUILT_PRODUCTS_DIR}\njavah -classpath \"${BUILT_PRODUCTS_DIR}/pmdefaults.jar\" -force -o \"${BUILT_PRODUCTS_DIR}/jportmidi_JportMidiApi.h\" \"jportmidi.JPortMidiApi\"\nmv \"${BUILT_PRODUCTS_DIR}/jportmidi_JportMidiApi.h\" ../pm_java/pmjni/\necho \"Created ../pm_java/pmjni/jportmidi_JportMidiApi.h\"\n";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 3D634CB0124781580020F829 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 89D0F1C90F3B704E007831A7 /* PmDefaults */;
- targetProxy = 3D634CAF124781580020F829 /* PBXContainerItemProxy */;
- };
- 3DE21431124662C50033C839 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 3DE2142D124662AA0033C839 /* CopyJavaSources */;
- targetProxy = 3DE21430124662C50033C839 /* PBXContainerItemProxy */;
- };
- 3DE2145E124666900033C839 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 3DE2142D124662AA0033C839 /* CopyJavaSources */;
- targetProxy = 3DE2145D124666900033C839 /* PBXContainerItemProxy */;
- };
- 89D0F1CD0F3B7062007831A7 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 8D1107260486CEB800E47090 /* Assemble Application */;
- targetProxy = 89D0F1CC0F3B7062007831A7 /* PBXContainerItemProxy */;
- };
- 89D0F1D10F3B7062007831A7 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 89D0F0480F393A6F007831A7 /* Compile Java */;
- targetProxy = 89D0F1D00F3B7062007831A7 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin PBXVariantGroup section */
- 89C3F2900F5250A300B0048E /* Credits.rtf */ = {
- isa = PBXVariantGroup;
- children = (
- 89C3F2910F5250A300B0048E /* English */,
- );
- name = Credits.rtf;
- sourceTree = "<group>";
- };
- 89D0F0210F392F20007831A7 /* InfoPlist.strings */ = {
- isa = PBXVariantGroup;
- children = (
- 89D0F0220F392F20007831A7 /* English */,
- );
- name = InfoPlist.strings;
- sourceTree = "<group>";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- 3D634CAC1247805C0020F829 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- PRODUCT_NAME = JPortMidiHeaders;
- };
- name = Debug;
- };
- 3D634CAD1247805C0020F829 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PRODUCT_NAME = JPortMidiHeaders;
- ZERO_LINK = NO;
- };
- name = Release;
- };
- 3DE2142E124662AB0033C839 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- PRODUCT_NAME = CopyJavaSources;
- };
- name = Debug;
- };
- 3DE2142F124662AB0033C839 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PRODUCT_NAME = CopyJavaSources;
- ZERO_LINK = NO;
- };
- name = Release;
- };
- 89D0F0490F393A6F007831A7 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = pmdefaults;
- SRCROOT = ./pmdefaults;
- };
- name = Debug;
- };
- 89D0F04A0F393A6F007831A7 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = pmdefaults;
- SRCROOT = ./pmdefaults;
- };
- name = Release;
- };
- 89D0F1CA0F3B704F007831A7 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = pmdefaults;
- };
- name = Debug;
- };
- 89D0F1CB0F3B704F007831A7 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = pmdefaults;
- };
- name = Release;
- };
- C01FCF4B08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CONFIGURATION_BUILD_DIR = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
- COPY_PHASE_STRIP = NO;
- INFOPLIST_FILE = pmdefaults/resources/Info.plist;
- INSTALL_PATH = "$(HOME)/Applications";
- PRODUCT_NAME = pmdefaults;
- WRAPPER_EXTENSION = app;
- };
- name = Debug;
- };
- C01FCF4C08A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CONFIGURATION_BUILD_DIR = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- INFOPLIST_FILE = pmdefaults/resources/Info.plist;
- INSTALL_PATH = "$(HOME)/Applications";
- PRODUCT_NAME = PmDefaults;
- WRAPPER_EXTENSION = app;
- };
- name = Release;
- };
- C01FCF4F08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
- ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- };
- name = Debug;
- };
- C01FCF5008A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
- ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 3D634CAE1247807A0020F829 /* Build configuration list for PBXAggregateTarget "JPortMidiHeaders" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3D634CAC1247805C0020F829 /* Debug */,
- 3D634CAD1247805C0020F829 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 3DE21434124662FF0033C839 /* Build configuration list for PBXAggregateTarget "CopyJavaSources" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3DE2142E124662AB0033C839 /* Debug */,
- 3DE2142F124662AB0033C839 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 89D0F04B0F393AB7007831A7 /* Build configuration list for PBXLegacyTarget "Compile Java" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 89D0F0490F393A6F007831A7 /* Debug */,
- 89D0F04A0F393A6F007831A7 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 89D0F1D20F3B7080007831A7 /* Build configuration list for PBXAggregateTarget "PmDefaults" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 89D0F1CA0F3B704F007831A7 /* Debug */,
- 89D0F1CB0F3B704F007831A7 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Assemble Application" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4B08A954540054247B /* Debug */,
- C01FCF4C08A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C01FCF4E08A954540054247B /* Build configuration list for PBXProject "pm_mac" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4F08A954540054247B /* Debug */,
- C01FCF5008A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
diff --git a/3rdparty/portmidi/pm_mac/pmdefaults/make/build.xml b/3rdparty/portmidi/pm_mac/pmdefaults/make/build.xml
deleted file mode 100644
index bd08c682082..00000000000
--- a/3rdparty/portmidi/pm_mac/pmdefaults/make/build.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="pmdefaults" default="jar" basedir="..">
-
- <!-- Global Properties -->
- <property environment="env"/>
-
-
- <!-- building in Xcode -->
- <condition property="product" value="${env.PRODUCT_NAME}">
- <isset property="env.PRODUCT_NAME"/>
- </condition>
-
- <condition property="src" value="${env.SRCROOT}/src">
- <isset property="env.SRCROOT"/>
- </condition>
-
- <condition property="obj" value="${env.OBJECT_FILE_DIR}">
- <isset property="env.OBJECT_FILE_DIR"/>
- </condition>
-
- <condition property="dst" value="${env.BUILT_PRODUCTS_DIR}">
- <isset property="env.BUILT_PRODUCTS_DIR"/>
- </condition>
-
-
- <!-- building from the command line -->
- <condition property="src" value="src">
- <not>
- <isset property="src"/>
- </not>
- </condition>
-
- <condition property="obj" value="build/obj">
- <not>
- <isset property="obj"/>
- </not>
- </condition>
-
- <condition property="dst" value="build">
- <not>
- <isset property="dst"/>
- </not>
- </condition>
-
- <condition property="product" value="pmdefaults">
- <not>
- <isset property="product"/>
- </not>
- </condition>
-
-
- <!-- Targets -->
- <target name="init" description="Create build directories">
- <mkdir dir="${obj}/${product}"/>
- <mkdir dir="${dst}"/>
- </target>
-
- <target name="compile" depends="init" description="Compile">
- <javac destdir="${obj}/${product}" deprecation="on" source="1.5" target="1.5" fork="true" debug="true" debuglevel="lines,source">
- <src path="${src}/java"/>
- <classpath path="${src}/../lib/eawt-stubs.jar"/>
- </javac>
- </target>
-
- <target name="copy" depends="init" description="Copy resources">
-
- </target>
-
- <target name="jar" depends="compile, copy" description="Assemble Jar file">
- <jar jarfile="${dst}/${product}.jar" basedir="${obj}/${product}" manifest="resources/Manifest" index="true"/>
- </target>
-
- <target name="install" depends="jar" description="Alias for 'jar'">
- <!-- sent by Xcode -->
- </target>
-
- <target name="clean" description="Removes build directories">
- <!-- sent by Xcode -->
- <delete dir="${obj}/${product}"/>
- <delete file="${dst}/${product}.jar"/>
- </target>
-
- <target name="installhdrs" description="">
- <!-- sent by Xcode -->
- <echo>"Nothing to do for install-headers phase"</echo>
- </target>
-</project>
diff --git a/3rdparty/portmidi/pm_mac/pmdefaults/make/find-classrefs.sh b/3rdparty/portmidi/pm_mac/pmdefaults/make/find-classrefs.sh
deleted file mode 100644
index 2217580d0d3..00000000000
--- a/3rdparty/portmidi/pm_mac/pmdefaults/make/find-classrefs.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-# Prints all class references made by all classes in a Jar file
-# Depends on the output formatting of javap
-
-# create a temporary working directory
-dir=`mktemp -d $TMPDIR/classrefs.XXXXXX`
-
-asm_dump="$dir/asm_dump"
-all_classes="$dir/all_classes"
-
-# for each class in a Jar file, dump the full assembly
-javap -c -classpath "$1" `/usr/bin/jar tf "$1" | grep "\.class" | sort | xargs | sed -e 's/\.class//g'` > $asm_dump
-
-# dump the initial list of all classes in the Jar file
-/usr/bin/jar tf $1 | grep "\.class" | sed -e 's/\.class//g' >> $all_classes
-
-# dump all static class references
-cat $asm_dump | grep //class | awk -F"//class " '{print $2}' | sort | uniq >> $all_classes
-
-# dump all references to classes made in methods
-cat $asm_dump | grep //Method | awk -F"//Method " '{print $2}' | sort | uniq | grep "\." | awk -F"." '{print $1}' | sort | uniq >> $all_classes
-
-# dump all references to classes by direct field access
-cat $asm_dump | grep //Field | awk -F"//Field " '{print $2}' | sort | uniq | grep "\:L" | awk -F"\:L" '{print $2}' | sort | uniq | awk -F"\;" '{print $1}' >> $all_classes
-
-# sort and reformat
-sort $all_classes | uniq | grep -v "\"" | sed -e 's/\//\./g'
-
-# cleanup
-rm -rf $dir
diff --git a/3rdparty/portmidi/pm_mac/pmdefaults/resources/English.lproj/Credits.rtf b/3rdparty/portmidi/pm_mac/pmdefaults/resources/English.lproj/Credits.rtf
deleted file mode 100644
index 18f83781e7b..00000000000
--- a/3rdparty/portmidi/pm_mac/pmdefaults/resources/English.lproj/Credits.rtf
+++ /dev/null
@@ -1,14 +0,0 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf320
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\b\fs24 \cf0 Author:
-\b0 \
- Roger B. Dannenberg\
-\
-
-\b With special thanks to:
-\b0 \
- National Science Foundation\
-} \ No newline at end of file
diff --git a/3rdparty/portmidi/pm_mac/pmdefaults/resources/English.lproj/InfoPlist.strings b/3rdparty/portmidi/pm_mac/pmdefaults/resources/English.lproj/InfoPlist.strings
deleted file mode 100644
index c7e5600f98a..00000000000
--- a/3rdparty/portmidi/pm_mac/pmdefaults/resources/English.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/3rdparty/portmidi/pm_mac/pmdefaults/resources/Info.plist b/3rdparty/portmidi/pm_mac/pmdefaults/resources/Info.plist
deleted file mode 100644
index 58bedb45013..00000000000
--- a/3rdparty/portmidi/pm_mac/pmdefaults/resources/Info.plist
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>JavaApplicationStub</string>
- <key>CFBundleIconFile</key>
- <string>pmdefaults.icns</string>
- <key>CFBundleIdentifier</key>
- <string></string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>PmDefaults</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>Java</key>
- <dict>
- <key>ClassPath</key>
- <string>$JAVAROOT/pmdefaults.jar</string>
- <key>JVMVersion</key>
- <string>1.5+</string>
- <key>MainClass</key>
- <string>pmdefaults.PmDefaults</string>
- <key>Properties</key>
- <dict>
- <key>apple.laf.useScreenMenuBar</key>
- <string>true</string>
- </dict>
- </dict>
-</dict>
-</plist>
diff --git a/3rdparty/portmidi/pm_mac/pmdefaults/resources/Manifest b/3rdparty/portmidi/pm_mac/pmdefaults/resources/Manifest
deleted file mode 100644
index 5dee9b0dc13..00000000000
--- a/3rdparty/portmidi/pm_mac/pmdefaults/resources/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-Main-Class: pmdefaults/PmDefaults
diff --git a/3rdparty/portmidi/pm_mac/pmmac.c b/3rdparty/portmidi/pm_mac/pmmac.c
index d3c08cceb9d..6c310022465 100644
--- a/3rdparty/portmidi/pm_mac/pmmac.c
+++ b/3rdparty/portmidi/pm_mac/pmmac.c
@@ -26,10 +26,10 @@ void pm_init(void)
pm_initialized = TRUE;
if (!err) {
pm_default_input_device_id = find_default_device(
- (char *)"/PortMidi/PM_RECOMMENDED_INPUT_DEVICE", TRUE,
+ "/PortMidi/PM_RECOMMENDED_INPUT_DEVICE", TRUE,
pm_default_input_device_id);
pm_default_output_device_id = find_default_device(
- (char *)"/PortMidi/PM_RECOMMENDED_OUTPUT_DEVICE", FALSE,
+ "/PortMidi/PM_RECOMMENDED_OUTPUT_DEVICE", FALSE,
pm_default_output_device_id);
}
}
@@ -47,7 +47,8 @@ PmDeviceID Pm_GetDefaultInputDeviceID(void)
return pm_default_input_device_id;
}
-PmDeviceID Pm_GetDefaultOutputDeviceID(void) {
+PmDeviceID Pm_GetDefaultOutputDeviceID(void)
+{
Pm_Initialize();
return pm_default_output_device_id;
}
diff --git a/3rdparty/portmidi/pm_mac/pmmac.h b/3rdparty/portmidi/pm_mac/pmmac.h
index 6cc0392c3f4..6b64fff2a95 100644
--- a/3rdparty/portmidi/pm_mac/pmmac.h
+++ b/3rdparty/portmidi/pm_mac/pmmac.h
@@ -1,4 +1,4 @@
/* pmmac.h */
extern PmDeviceID pm_default_input_device_id;
-extern PmDeviceID pm_default_output_device_id; \ No newline at end of file
+extern PmDeviceID pm_default_output_device_id;
diff --git a/3rdparty/portmidi/pm_mac/pmmacosxcm.c b/3rdparty/portmidi/pm_mac/pmmacosxcm.c
index 71177dded11..81c531e033b 100644
--- a/3rdparty/portmidi/pm_mac/pmmacosxcm.c
+++ b/3rdparty/portmidi/pm_mac/pmmacosxcm.c
@@ -9,21 +9,67 @@
*/
/* Notes:
- since the input and output streams are represented by MIDIEndpointRef
- values and almost no other state, we store the MIDIEndpointRef on
- descriptors[midi->device_id].descriptor. The only other state we need
- is for errors: we need to know if there is an error and if so, what is
- the error text. We use a structure with two kinds of
- host error: "error" and "callback_error". That way, asynchronous callbacks
- do not interfere with other error information.
+
+ Since the input and output streams are represented by
+ MIDIEndpointRef values and almost no other state, we store the
+ MIDIEndpointRef on pm_descriptors[midi->device_id].descriptor.
- OS X does not seem to have an error-code-to-text function, so we will
- just use text messages instead of error codes.
+ OS X does not seem to have an error-code-to-text function, so we
+ will just use text messages instead of error codes.
+
+ Virtual device input synchronization: Once we create a virtual
+ device, it is always "on" and receiving messages, but it must drop
+ messages unless the device has been opened with Pm_OpenInput. To
+ open, the main thread should create all the data structures, then
+ call OSMemoryBarrier so that writes are observed, then set
+ is_opened = TRUE. To close without locks, we need to get the
+ callback to set is_opened to FALSE before we free data structures;
+ otherwise, there's a race condition where closing could delete
+ structures in use by the virtual_read_callback function. We send
+ 8 MIDI resets (FF) in a single packet to our own port to signal
+ the virtual_read_callback to close it. Then, we wait for the
+ callback to recognize the "close" packet and reset is_opened.
+
+ Device scanning is done when you first open an application.
+ PortMIDI does not actively update the devices. Instead, you must
+ Pm_Terminate() and Pm_Initialize(), basically starting over. But
+ CoreMIDI does not have a way to shut down(!), and even
+ MIDIClientDispose() somehow retains state (and docs say do not
+ call it even if it worked). The solution, apparently, is to
+ call CFRunLoopRunInMode(), which somehow updates CoreMIDI
+ state.
+
+ But when do we call CFRunLoopRunInMode()? I tried calling it
+ in midi_in_poll() which is called when you call Pm_Read() since
+ that is called often. I observed that this caused the program
+ to block for as long as 50ms and fairly often for 2 or 3ms.
+ What was Apple thinking? Is it really OK to design systems that
+ can only function with a tricky multi-threaded, non-blocking
+ priority-based solution, and then not provide a proof of concept
+ or documentation? Or is Apple's design really flawed? If anyone
+ at Apple reads this, please let me know -- I'm curious.
+
+ But I digress... Here's the PortMidi approach: Since
+ CFRunLoopRunInMode() is potentially a non-realtime operation,
+ we only call it in Pm_Initialize(), where other calls to look
+ up devices and device names are quite slow to begin with. Again,
+ PortMidi does not actively scan for new or deleted devices, so
+ if devices change, you won't see it until the next Pm_Terminate
+ and Pm_Initialize.
+
+ Calling CFRunLoopRunInMode() once is probably not enough. There
+ might be better way, but it seems to work to just call it 100
+ times and insert 20 1ms delays (in case some inter-process
+ communication or synchronization is going on).
+ This adds 20ms to the wall time of Pm_Initialize(), but it
+ typically runs 30ms to much more (~4s), so this has little impact.
*/
#include <stdlib.h>
-//#define CM_DEBUG 1
+/* turn on lots of debugging print statements */
+#define CM_DEBUG if (0)
+/* #define CM_DEBUG if (1) */
#include "portmidi.h"
#include "pmutil.h"
@@ -39,39 +85,101 @@
#include <CoreMIDI/MIDIServices.h>
#include <CoreAudio/HostTime.h>
#include <unistd.h>
+#include <libkern/OSAtomic.h>
#define PACKET_BUFFER_SIZE 1024
-/* maximum overall data rate (OS X limit is 15000 bytes/second) */
-#define MAX_BYTES_PER_S 14000
-
-/* Apple reports that packets are dropped when the MIDI bytes/sec
- exceeds 15000. This is computed by "tracking the number of MIDI
- bytes scheduled into 1-second buckets over the last six seconds
- and averaging these counts."
-
- This is apparently based on timestamps, not on real time, so
- we have to avoid constructing packets that schedule high speed
- output even if the actual writes are delayed (which was my first
- solution).
-
- The LIMIT_RATE symbol, if defined, enables code to modify
- timestamps as follows:
- After each packet is formed, the next allowable timestamp is
- computed as this_packet_time + this_packet_len * delay_per_byte
+/* maximum overall data rate (OS X limits MIDI rate in case there
+ * is a cycle among IAC ports.
+ */
- This is the minimum timestamp allowed in the next packet.
+#define MAX_BYTES_PER_S 5400
- Note that this distorts accurate timestamps somewhat.
+/* Apple reports that packets are dropped when the MIDI bytes/sec
+ exceeds 15000. This is computed by "tracking the number of MIDI
+ bytes scheduled into 1-second buckets over the last six seconds and
+ averaging these counts." This was confirmed in measurements
+ (2021) with pm_test/fast.c and pm_test/fastrcv.c Now, in 2022, with
+ macOS 12, pm_test/fast{rcv}.c show problems begin at 6000 bytes/sec.
+ Previously, we set MAX_BYTES_PER_S to 14000. This is reduced to
+ 5400 based on testing (which shows 5700 is too high) to fix the
+ packet loss problem that showed up with macOS 12.
+
+ Experiments show this restriction applies to IAC bus MIDI, but not
+ to hardware interfaces. (I measured 0.5 Mbps each way over USB to a
+ Teensy 3.2 microcontroller implementing a USB MIDI loopback. Maybe
+ it would get 1 Mbps one-way, which would make the CoreMIDI
+ restriction 18x slower than USB. Maybe other USB MIDI
+ implementations are faster -- USB top speed for other protocols is
+ certainly higher than 1 Mbps!)
+
+ This is apparently based on timestamps, not on real time, so we
+ have to avoid constructing packets that schedule high speed output
+ regardless of when writes occur. The solution is to alter
+ timestamps to limit data rates. This adds a slight time
+ distortion, e.g. an 11 note chord with all notes on the same
+ timestamp will be altered so that the last message is delayed by
+ 11 messages x 3 bytes/message / 5400 bytes/second = 6.1 ms.
+ Note that this is about 2x MIDI speed, but at least 18x slower
+ than USB MIDI.
+
+ Altering timestamps creates another problem, which is that a sender
+ that exceeds the maximum rate can queue up an unbounded number of
+ messages. With non-USB MIDI devices, you could be writing 5x faster
+ to CoreMIDI than the hardware interface can send, causing an
+ unbounded backlog, not to mention that the output stream will be a
+ steady byte stream (e.g., one 3-byte MIDI message every 0.55 ms),
+ losing any original timing or rhythm. PortMidi does not guarantee
+ delivery if, over the long run, you write faster than the hardware
+ can send.
+
+ The LIMIT_RATE symbol, if defined (which is the default), enables
+ code to modify timestamps for output to an IAC device as follows:
+
+ Before a packet is formed, the message timestamp is set to the
+ maximum of the PortMidi timestamp (converted to CoreMIDI time)
+ and min_next_time. After each send, min_next_time is updated to
+ the packet time + packet length * delay_per_byte, which limits
+ the scheduled bytes-per-second. Also, after each packet list
+ flush, min_next_time is updated to the maximum of min_next_time
+ and the real time, which prevents many bytes to be scheduled in
+ the past. (We could more directly just say packets are never
+ scheduled in the past, but we prefer to get the current time -- a
+ system call -- only when we perform the more expensive operation
+ of flushing packets, so that's when we update min_next_time to
+ the current real time. If we are sending a lot, we have to flush
+ a lot, so the time will be updated frequently when it matters.)
+
+ This possible adjustment to timestamps can distort accurate
+ timestamps by up to 0.556 us per 3-byte MIDI message.
+
+ Nothing blocks the sender from queueing up an arbitrary number of
+ messages. Timestamps should be used for accurate timing by sending
+ timestamped messages a little ahead of real time, not for
+ scheduling an entire MIDI sequence at once!
*/
#define LIMIT_RATE 1
#define SYSEX_BUFFER_SIZE 128
+/* What is the maximum PortMidi device number for an IAC device? A
+ * cleaner design would be to not use the endpoint as our device
+ * representation. Instead, we could have a private extensible struct
+ * to keep all device information, including whether the device is
+ * implemented with the AppleMIDIIACDriver, which we need because we
+ * have to limit the data rate to this particular driver to avoid
+ * dropping messages. Rather than rewrite a lot of code, I am just
+ * allocating 64 bytes to flag which devices are IAC ones. If an IAC
+ * device number is greater than 63, PortMidi will fail to limit
+ * writes to it, but will not complain and will not access memory
+ * outside the 64-element array of char.
+ */
+#define MAX_IAC_NUM 63
#define VERBOSE_ON 1
#define VERBOSE if (VERBOSE_ON)
-#define MIDI_SYSEX 0xf0
-#define MIDI_EOX 0xf7
+#define MIDI_SYSEX 0xf0
+#define MIDI_EOX 0xf7
+#define MIDI_CLOCK 0xf8
#define MIDI_STATUS_MASK 0x80
// "Ref"s are pointers on 32-bit machines and ints on 64 bit machines
@@ -82,18 +190,17 @@
#define NULL_REF NULL
#endif
-static MIDIClientRef client = NULL_REF; /* Client handle to the MIDI server */
-static MIDIPortRef portIn = NULL_REF; /* Input port handle */
-static MIDIPortRef portOut = NULL_REF; /* Output port handle */
+static MIDIClientRef client = NULL_REF; /* Client handle to the MIDI server */
+static MIDIPortRef portIn = NULL_REF; /* Input port handle */
+static MIDIPortRef portOut = NULL_REF; /* Output port handle */
+static char isIAC[MAX_IAC_NUM + 1]; /* is device an IAC device */
extern pm_fns_node pm_macosx_in_dictionary;
extern pm_fns_node pm_macosx_out_dictionary;
-typedef struct midi_macosxcm_struct {
- PmTimestamp sync_time; /* when did we last determine delta? */
+typedef struct coremidi_info_struct {
+ int is_virtual; /* virtual device (TRUE) or actual device (FALSE)? */
UInt64 delta; /* difference between stream time and real time in ns */
- UInt64 last_time; /* last output time in host units*/
- int first_message; /* tells midi_write to sychronize timestamps */
int sysex_mode; /* middle of sending sysex */
uint32_t sysex_word; /* accumulate data when receiving sysex */
uint32_t sysex_byte_count; /* count how many received */
@@ -103,26 +210,34 @@ typedef struct midi_macosxcm_struct {
MIDIPacketList *packetList; /* a pointer to packetBuffer */
MIDIPacket *packet;
Byte sysex_buffer[SYSEX_BUFFER_SIZE]; /* temp storage for sysex data */
- MIDITimeStamp sysex_timestamp; /* timestamp to use with sysex data */
+ MIDITimeStamp sysex_timestamp; /* host timestamp to use with sysex data */
/* allow for running status (is running status possible here? -rbd): -cpr */
unsigned char last_command;
int32_t last_msg_length;
- /* limit midi data rate (a CoreMidi requirement): */
- UInt64 min_next_time; /* when can the next send take place? */
- int byte_count; /* how many bytes in the next packet list? */
+ UInt64 min_next_time; /* when can the next send take place? (host time) */
+ int isIACdevice;
Float64 us_per_host_tick; /* host clock frequency, units of min_next_time */
UInt64 host_ticks_per_byte; /* host clock units per byte at maximum rate */
-} midi_macosxcm_node, *midi_macosxcm_type;
+} coremidi_info_node, *coremidi_info_type;
/* private function declarations */
-MIDITimeStamp timestamp_pm_to_cm(PmTimestamp timestamp);
-PmTimestamp timestamp_cm_to_pm(MIDITimeStamp timestamp);
+MIDITimeStamp timestamp_pm_to_cm(PmTimestamp timestamp); // returns host time
+PmTimestamp timestamp_cm_to_pm(MIDITimeStamp timestamp); // returns ms
-char* cm_get_full_endpoint_name(MIDIEndpointRef endpoint);
+char* cm_get_full_endpoint_name(MIDIEndpointRef endpoint, int *isIAC);
+
+static PmError check_hosterror(OSStatus err, const char *msg)
+{
+ if (err != noErr) {
+ sprintf(pm_hosterror_text, "Host error %ld: %s", (long) err, msg);
+ pm_hosterror = TRUE;
+ return pmHostError;
+ }
+ return pmNoError;
+}
-static int
-midi_length(int32_t msg)
+static int midi_length(int32_t msg)
{
int status, high, low;
static int high_lengths[] = {
@@ -143,31 +258,31 @@ midi_length(int32_t msg)
static PmTimestamp midi_synchronize(PmInternal *midi)
{
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- UInt64 pm_stream_time_2 =
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
+ UInt64 pm_stream_time_2 = // current time in ns
AudioConvertHostTimeToNanos(AudioGetCurrentHostTime());
- PmTimestamp real_time;
- UInt64 pm_stream_time;
+ PmTimestamp real_time; // in ms
+ UInt64 pm_stream_time; // in ns
/* if latency is zero and this is an output, there is no
time reference and midi_synchronize should never be called */
assert(midi->time_proc);
- assert(!(midi->write_flag && midi->latency == 0));
+ assert(midi->is_input || midi->latency != 0);
do {
/* read real_time between two reads of stream time */
pm_stream_time = pm_stream_time_2;
real_time = (*midi->time_proc)(midi->time_info);
- pm_stream_time_2 = AudioConvertHostTimeToNanos(AudioGetCurrentHostTime());
+ pm_stream_time_2 = AudioConvertHostTimeToNanos(
+ AudioGetCurrentHostTime());
/* repeat if more than 0.5 ms has elapsed */
} while (pm_stream_time_2 > pm_stream_time + 500000);
- m->delta = pm_stream_time - ((UInt64) real_time * (UInt64) 1000000);
- m->sync_time = real_time;
+ info->delta = pm_stream_time - ((UInt64) real_time * (UInt64) 1000000);
+ midi->sync_time = real_time;
return real_time;
}
-static void
-process_packet(MIDIPacket *packet, PmEvent *event,
- PmInternal *midi, midi_macosxcm_type m)
+static void process_packet(MIDIPacket *packet, PmEvent *event,
+ PmInternal *midi, coremidi_info_type info)
{
/* handle a packet of MIDI messages from CoreMIDI */
/* there may be multiple short messages in one packet (!) */
@@ -176,9 +291,9 @@ process_packet(MIDIPacket *packet, PmEvent *event,
while (remaining_length > 0) {
if (cur_packet_data[0] == MIDI_SYSEX ||
/* are we in the middle of a sysex message? */
- (m->last_command == 0 &&
+ (info->last_command == 0 &&
!(cur_packet_data[0] & MIDI_STATUS_MASK))) {
- m->last_command = 0; /* no running status */
+ info->last_command = 0; /* no running status */
unsigned int amt = pm_read_bytes(midi, cur_packet_data,
remaining_length,
event->timestamp);
@@ -188,7 +303,7 @@ process_packet(MIDIPacket *packet, PmEvent *event,
/* this should never happen, because pm_read_bytes should
* get and read all EOX bytes*/
midi->sysex_in_progress = FALSE;
- m->last_command = 0;
+ info->last_command = 0;
} else if (cur_packet_data[0] & MIDI_STATUS_MASK) {
/* compute the length of the next (short) msg in packet */
unsigned int cur_message_length = midi_length(cur_packet_data[0]);
@@ -199,8 +314,15 @@ process_packet(MIDIPacket *packet, PmEvent *event,
/* since there's no more data, we're done */
return;
}
- m->last_msg_length = cur_message_length;
- m->last_command = cur_packet_data[0];
+ if (cur_packet_data[0] < MIDI_SYSEX) {
+ /* channel messages set running status */
+ info->last_command = cur_packet_data[0];
+ info->last_msg_length = cur_message_length;
+ } else if (cur_packet_data[0] < MIDI_CLOCK) {
+ /* system messages clear running status */
+ info->last_command = 0;
+ info->last_msg_length = 0;
+ }
switch (cur_message_length) {
case 1:
event->message = Pm_Message(cur_packet_data[0], 0, 0);
@@ -220,9 +342,9 @@ process_packet(MIDIPacket *packet, PmEvent *event,
return; /* give up on packet if continued after assert */
}
pm_read_short(midi, event);
- remaining_length -= m->last_msg_length;
- cur_packet_data += m->last_msg_length;
- } else if (m->last_msg_length > remaining_length + 1) {
+ remaining_length -= cur_message_length;
+ cur_packet_data += cur_message_length;
+ } else if (info->last_msg_length > remaining_length + 1) {
/* we have running status, but not enough data */
#ifdef DEBUG
printf("PortMidi debug msg: not enough data in CoreMIDI packet");
@@ -230,427 +352,588 @@ process_packet(MIDIPacket *packet, PmEvent *event,
/* since there's no more data, we're done */
return;
} else { /* output message using running status */
- switch (m->last_msg_length) {
+ switch (info->last_msg_length) {
case 1:
- event->message = Pm_Message(m->last_command, 0, 0);
+ event->message = Pm_Message(info->last_command, 0, 0);
break;
case 2:
- event->message = Pm_Message(m->last_command,
+ event->message = Pm_Message(info->last_command,
cur_packet_data[0], 0);
break;
case 3:
- event->message = Pm_Message(m->last_command,
+ event->message = Pm_Message(info->last_command,
cur_packet_data[0],
cur_packet_data[1]);
break;
default:
/* last_msg_length is invalid -- internal PortMIDI error */
- assert(m->last_msg_length == 1);
+ assert(info->last_msg_length == 1);
}
pm_read_short(midi, event);
- remaining_length -= (m->last_msg_length - 1);
- cur_packet_data += (m->last_msg_length - 1);
+ remaining_length -= (info->last_msg_length - 1);
+ cur_packet_data += (info->last_msg_length - 1);
}
}
}
-
/* called when MIDI packets are received */
-static void
-readProc(const MIDIPacketList *newPackets, void *refCon, void *connRefCon)
+static void read_callback(const MIDIPacketList *newPackets, PmInternal *midi)
{
- PmInternal *midi;
- midi_macosxcm_type m;
PmEvent event;
MIDIPacket *packet;
unsigned int packetIndex;
uint32_t now;
unsigned int status;
-
-#ifdef CM_DEBUG
- printf("readProc: numPackets %d: ", newPackets->numPackets);
-#endif
-
/* Retrieve the context for this connection */
- midi = (PmInternal *) connRefCon;
- m = (midi_macosxcm_type) midi->descriptor;
- assert(m);
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
+ assert(info);
+
+ CM_DEBUG printf("read_callback: numPackets %d: ", newPackets->numPackets);
/* synchronize time references every 100ms */
now = (*midi->time_proc)(midi->time_info);
- if (m->first_message || m->sync_time + 100 /*ms*/ < now) {
+ if (midi->first_message || midi->sync_time + 100 /*ms*/ < now) {
/* time to resync */
now = midi_synchronize(midi);
- m->first_message = FALSE;
+ midi->first_message = FALSE;
}
packet = (MIDIPacket *) &newPackets->packet[0];
- /* printf("readproc packet status %x length %d\n", packet->data[0],
- packet->length); */
+ /* hardware devices get untimed messages and apply timestamps. We
+ * want to preserve them because they should be more accurate than
+ * applying the current time here. virtual devices just pass on the
+ * packet->timeStamp, which could be anything. PortMidi says the
+ * PortMidi timestamp is the time the message is received. We do not
+ * know if we are receiving from a device driver or a virtual device.
+ * PortMidi sends to virtual devices get a current timestamp, so we
+ * can treat them as the receive time. If the timestamp is zero,
+ * suggested by CoreMIDI as the value to use for immediate delivery,
+ * then we plug in `now` which is obtained above. If another
+ * application sends bogus non-zero timestamps, we will convert them
+ * to this port's reference time and pass them as event.timestamp.
+ * Receiver beware.
+ */
+ CM_DEBUG printf("read_callback packet @ %lld ns (host %lld) "
+ "status %x length %d\n",
+ AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()),
+ AudioGetCurrentHostTime(),
+ packet->data[0], packet->length);
for (packetIndex = 0; packetIndex < newPackets->numPackets; packetIndex++) {
/* Set the timestamp and dispatch this message */
- event.timestamp = (PmTimestamp) /* explicit conversion */ (
- (AudioConvertHostTimeToNanos(packet->timeStamp) - m->delta) /
+ CM_DEBUG printf(" packet->timeStamp %lld ns %lld host\n",
+ packet->timeStamp,
+ AudioConvertHostTimeToNanos(packet->timeStamp));
+ if (packet->timeStamp == 0) {
+ event.timestamp = now;
+ } else {
+ event.timestamp = (PmTimestamp) /* explicit conversion */ (
+ (AudioConvertHostTimeToNanos(packet->timeStamp) - info->delta) /
(UInt64) 1000000);
+ }
status = packet->data[0];
/* process packet as sysex data if it begins with MIDI_SYSEX, or
MIDI_EOX or non-status byte with no running status */
-#ifdef CM_DEBUG
- printf(" %d", packet->length);
-#endif
+ CM_DEBUG printf(" len %d stat %x\n", packet->length, status);
if (status == MIDI_SYSEX || status == MIDI_EOX ||
- ((!(status & MIDI_STATUS_MASK)) && !m->last_command)) {
- /* previously was: !(status & MIDI_STATUS_MASK)) {
+ ((!(status & MIDI_STATUS_MASK)) && !info->last_command)) {
+ /* previously was: !(status & MIDI_STATUS_MASK)) {
* but this could mistake running status for sysex data
*/
/* reset running status data -cpr */
- m->last_command = 0;
- m->last_msg_length = 0;
+ info->last_command = 0;
+ info->last_msg_length = 0;
/* printf("sysex packet length: %d\n", packet->length); */
pm_read_bytes(midi, packet->data, packet->length, event.timestamp);
} else {
- process_packet(packet, &event, midi, m);
+ process_packet(packet, &event, midi, info);
}
packet = MIDIPacketNext(packet);
}
-#ifdef CM_DEBUG
- printf("\n");
-#endif
}
-static PmError
-midi_in_open(PmInternal *midi, void *driverInfo)
+/* callback for real devices - redirects to read_callback */
+static void device_read_callback(const MIDIPacketList *newPackets,
+ void *refCon, void *connRefCon)
+{
+ read_callback(newPackets, (PmInternal *) connRefCon);
+}
+
+
+/* callback for virtual devices - redirects to read_callback */
+static void virtual_read_callback(const MIDIPacketList *newPackets,
+ void *refCon, void *connRefCon)
+{
+ /* this refCon is the device ID -- if there is a valid ID and
+ the pm_descriptors table has a non-null pointer to a PmInternal,
+ then then device is open and should receive this data */
+ PmDeviceID id = (PmDeviceID) (size_t) refCon;
+ if (id >= 0 && id < pm_descriptor_len) {
+ if (pm_descriptors[id].pub.opened) {
+ /* check for close request (7 reset status bytes): */
+ if (newPackets->numPackets == 1 &&
+ newPackets->packet[0].length == 8 &&
+ /* CoreMIDI declares packets with 4-byte alignment, so we
+ * should be safe to test for 8 0xFF's as 2 32-bit values: */
+ *(SInt32 *) &newPackets->packet[0].data[0] == -1 &&
+ *(SInt32 *) &newPackets->packet[0].data[4] == -1) {
+ CM_DEBUG printf("got close request packet\n");
+ pm_descriptors[id].pub.opened = FALSE;
+ return;
+ } else {
+ read_callback(newPackets, pm_descriptors[id].pm_internal);
+ }
+ }
+ }
+}
+
+
+/* allocate and initialize our internal coremidi connection info */
+static coremidi_info_type create_macosxcm_info(int is_virtual, int is_input)
+{
+ coremidi_info_type info = (coremidi_info_type)
+ pm_alloc(sizeof(coremidi_info_node));
+ if (!info) {
+ return NULL;
+ }
+ info->is_virtual = is_virtual;
+ info->delta = 0;
+ info->sysex_mode = FALSE;
+ info->sysex_word = 0;
+ info->sysex_byte_count = 0;
+ info->packet = NULL;
+ info->last_command = 0;
+ info->last_msg_length = 0;
+ info->min_next_time = 0;
+ info->isIACdevice = FALSE;
+ info->us_per_host_tick = 1000000.0 / AudioGetHostClockFrequency();
+ info->host_ticks_per_byte =
+ (UInt64) (1000000.0 / (info->us_per_host_tick * MAX_BYTES_PER_S));
+ info->packetList = (is_input ? NULL :
+ (MIDIPacketList *) info->packetBuffer);
+ return info;
+}
+
+
+static PmError midi_in_open(PmInternal *midi, void *driverInfo)
{
MIDIEndpointRef endpoint;
- midi_macosxcm_type m;
+ coremidi_info_type info;
OSStatus macHostError;
+ int is_virtual = pm_descriptors[midi->device_id].pub.is_virtual;
- /* insure that we have a time_proc for timing */
- if (midi->time_proc == NULL) {
- if (!Pt_Started())
- Pt_Start(1, 0, 0);
- /* time_get does not take a parameter, so coerce */
- midi->time_proc = (PmTimeProcPtr) Pt_Time;
- }
- endpoint = (MIDIEndpointRef) (long) descriptors[midi->device_id].descriptor;
- if (endpoint == NULL_REF) {
- return pmInvalidDeviceId;
+ /* if this is an external device, descriptor is a MIDIEndpointRef.
+ * if this is a virtual device for this application, descriptor is NULL.
+ */
+ if (!is_virtual) {
+ endpoint = (MIDIEndpointRef) (intptr_t)
+ pm_descriptors[midi->device_id].descriptor;
+ if (endpoint == NULL_REF) {
+ return pmInvalidDeviceId;
+ }
}
- m = (midi_macosxcm_type) pm_alloc(sizeof(midi_macosxcm_node)); /* create */
- midi->descriptor = m;
- if (!m) {
+ info = create_macosxcm_info(is_virtual, TRUE);
+ midi->api_info = info;
+ if (!info) {
return pmInsufficientMemory;
}
- m->error[0] = 0;
- m->callback_error[0] = 0;
- m->sync_time = 0;
- m->delta = 0;
- m->last_time = 0;
- m->first_message = TRUE;
- m->sysex_mode = FALSE;
- m->sysex_word = 0;
- m->sysex_byte_count = 0;
- m->packetList = NULL;
- m->packet = NULL;
- m->last_command = 0;
- m->last_msg_length = 0;
-
- macHostError = MIDIPortConnectSource(portIn, endpoint, midi);
- if (macHostError != noErr) {
- pm_hosterror = macHostError;
- sprintf(pm_hosterror_text,
- "Host error %ld: MIDIPortConnectSource() in midi_in_open()",
- (long) macHostError);
- midi->descriptor = NULL;
- pm_free(m);
- return pmHostError;
+ if (!is_virtual) {
+ macHostError = MIDIPortConnectSource(portIn, endpoint, midi);
+ if (macHostError != noErr) {
+ midi->api_info = NULL;
+ pm_free(info);
+ return check_hosterror(macHostError,
+ "MIDIPortConnectSource() in midi_in_open()");
+ }
}
-
return pmNoError;
}
-static PmError
-midi_in_close(PmInternal *midi)
+static PmError midi_in_close(PmInternal *midi)
{
MIDIEndpointRef endpoint;
OSStatus macHostError;
PmError err = pmNoError;
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
- if (!m) return pmBadPtr;
+ if (!info) return pmBadPtr;
- endpoint = (MIDIEndpointRef) (long) descriptors[midi->device_id].descriptor;
+ endpoint = (MIDIEndpointRef) (intptr_t)
+ pm_descriptors[midi->device_id].descriptor;
if (endpoint == NULL_REF) {
- pm_hosterror = pmBadPtr;
+ return pmBadPtr;
}
- /* shut off the incoming messages before freeing data structures */
- macHostError = MIDIPortDisconnectSource(portIn, endpoint);
- if (macHostError != noErr) {
- pm_hosterror = macHostError;
- sprintf(pm_hosterror_text,
- "Host error %ld: MIDIPortDisconnectSource() in midi_in_close()",
- (long) macHostError);
- err = pmHostError;
+ if (!info->is_virtual) {
+ /* shut off the incoming messages before freeing data structures */
+ macHostError = MIDIPortDisconnectSource(portIn, endpoint);
+ /* If the source closes, you get paramErr == -50 here. It seems
+ * possible to monitor changes like sources closing by getting
+ * notifications ALL changes, but the CoreMIDI documentation is
+ * really terrible overall, and it seems easier to just ignore
+ * this host error.
+ */
+ if (macHostError != noErr && macHostError != -50) {
+ pm_hosterror = TRUE;
+ err = check_hosterror(macHostError,
+ "MIDIPortDisconnectSource() in midi_in_close()");
+ }
+ } else {
+ /* make "close virtual port" message */
+ SInt64 close_port_bytes = 0xFFFFFFFFFFFFFFFF;
+ /* memory requirements: packet count (4), timestamp (8), length (2),
+ * data (8). Total: 22, but we allocate plenty more:
+ */
+ Byte packetBuffer[64];
+ MIDIPacketList *plist = (MIDIPacketList *) packetBuffer;
+ MIDIPacket *packet = MIDIPacketListInit(plist);
+ MIDIPacketListAdd(plist, 64, packet, 0, 8,
+ (const Byte *) &close_port_bytes);
+ macHostError = MIDISend(portOut, endpoint, plist);
+ if (macHostError != noErr) {
+ err = check_hosterror(macHostError, "MIDISend() (PortMidi close "
+ "port packet) in midi_in_close()");
+ }
+ /* when packet is delivered, callback thread will clear opened;
+ * we must wait for that before removing the input queues etc.
+ * Maybe this could use signals of some kind, but if signals use
+ * locks, locks can cause priority inversion problems, so we will
+ * just sleep as needed. On the MIDI timescale, inserting a 0.5ms
+ * latency should be OK, as the application has no business
+ * opening/closing devices during time-critical moments.
+ *
+ * We expect the MIDI thread to close the device quickly (<0.5ms),
+ * but we wait up to 50ms in case something terrible happens like
+ * getting paged out in the middle of deliving packets to this
+ * virtual device. If there is still no response, we time out and
+ * force the close without the MIDI thread (even this will probably
+ * succeed - the problem would be: this thread proceeds to delete
+ * the input queues, and the freed memory is reallocated and
+ * overwritten so that queues are no longer usable. Meanwhile,
+ * the MIDI thread has already begun to deliver packets, so the
+ * check for opened == TRUE passed, but MIDI thread does not insert
+ * into queue until queue is freed, reallocated and overwritten.
+ */
+ for (int i = 0; i < 100; i++) { /* up to 50ms delay */
+ if (!pm_descriptors[midi->device_id].pub.opened) {
+ break;
+ }
+ usleep(500); /* 0.5ms */
+ }
+ pm_descriptors[midi->device_id].pub.opened = FALSE; /* force it */
}
-
- midi->descriptor = NULL;
- pm_free(midi->descriptor);
-
+ midi->api_info = NULL;
+ pm_free(info);
return err;
}
-static PmError
-midi_out_open(PmInternal *midi, void *driverInfo)
+static PmError midi_out_open(PmInternal *midi, void *driverInfo)
{
- midi_macosxcm_type m;
+ coremidi_info_type info;
+ int is_virtual = pm_descriptors[midi->device_id].pub.is_virtual;
- m = (midi_macosxcm_type) pm_alloc(sizeof(midi_macosxcm_node)); /* create */
- midi->descriptor = m;
- if (!m) {
+ info = create_macosxcm_info(is_virtual, FALSE);
+ if (midi->device_id <= MAX_IAC_NUM) {
+ info->isIACdevice = isIAC[midi->device_id];
+ CM_DEBUG printf("midi_out_open isIACdevice %d\n", info->isIACdevice);
+ }
+ midi->api_info = info;
+ if (!info) {
return pmInsufficientMemory;
}
- m->error[0] = 0;
- m->callback_error[0] = 0;
- m->sync_time = 0;
- m->delta = 0;
- m->last_time = 0;
- m->first_message = TRUE;
- m->sysex_mode = FALSE;
- m->sysex_word = 0;
- m->sysex_byte_count = 0;
- m->packetList = (MIDIPacketList *) m->packetBuffer;
- m->packet = NULL;
- m->last_command = 0;
- m->last_msg_length = 0;
- m->min_next_time = 0;
- m->byte_count = 0;
- m->us_per_host_tick = 1000000.0 / AudioGetHostClockFrequency();
- m->host_ticks_per_byte = (UInt64) (1000000.0 /
- (m->us_per_host_tick * MAX_BYTES_PER_S));
return pmNoError;
}
-static PmError
-midi_out_close(PmInternal *midi)
+static PmError midi_out_close(PmInternal *midi)
{
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- if (!m) return pmBadPtr;
-
- midi->descriptor = NULL;
- pm_free(midi->descriptor);
-
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
+ if (!info) return pmBadPtr;
+ midi->api_info = NULL;
+ pm_free(info);
return pmNoError;
}
-static PmError
-midi_abort(PmInternal *midi)
+
+/* MIDIDestinationCreate apparently cannot create a virtual device
+ * without a callback and a "refCon" parameter, but when we create
+ * a virtual device, we do not want a PortMidi stream yet -- that
+ * should wait for the user to open the stream. So, for the refCon,
+ * use the PortMidi device ID. The callback will check if the
+ * device is opened within PortMidi, and if so, use the pm_descriptors
+ * table to locate the corresponding PmStream.
+ */
+static PmError midi_create_virtual(int is_input, const char *name,
+ void *device_info)
{
- PmError err = pmNoError;
OSStatus macHostError;
- MIDIEndpointRef endpoint =
- (MIDIEndpointRef) (long) descriptors[midi->device_id].descriptor;
- macHostError = MIDIFlushOutput(endpoint);
+ MIDIEndpointRef endpoint;
+ CFStringRef nameRef;
+ PmDeviceID id = pm_add_device("CoreMIDI", name, is_input, TRUE, NULL,
+ (is_input ? &pm_macosx_in_dictionary :
+ &pm_macosx_out_dictionary));
+ if (id < 0) { /* error -- out of memory or name conflict? */
+ return id;
+ }
+
+ nameRef = CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII);
+ if (is_input) {
+ macHostError = MIDIDestinationCreate(client, nameRef,
+ virtual_read_callback, (void *) (intptr_t) id,
+ &endpoint);
+ } else {
+ macHostError = MIDISourceCreate(client, nameRef, &endpoint);
+ }
+ CFRelease(nameRef);
+
if (macHostError != noErr) {
- pm_hosterror = macHostError;
- sprintf(pm_hosterror_text,
- "Host error %ld: MIDIFlushOutput()", (long) macHostError);
- err = pmHostError;
+ /* undo the device we just allocated */
+ pm_undo_add_device(id);
+ return check_hosterror(macHostError, (is_input ?
+ "MIDIDestinationCreate() in midi_create_virtual()" :
+ "MIDISourceCreate() in midi_create_virtual()"));
}
- return err;
+ pm_descriptors[id].descriptor = (void *) (intptr_t) endpoint;
+ return id;
}
-static PmError
-midi_write_flush(PmInternal *midi, PmTimestamp timestamp)
+static PmError midi_delete_virtual(PmDeviceID id)
{
+ MIDIEndpointRef endpoint;
OSStatus macHostError;
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- MIDIEndpointRef endpoint =
- (MIDIEndpointRef) (long) descriptors[midi->device_id].descriptor;
- assert(m);
+ PmError err = pmNoError;
+
+ endpoint = (MIDIEndpointRef) (long) pm_descriptors[id].descriptor;
+ if (endpoint == NULL_REF) {
+ return pmBadPtr;
+ }
+ macHostError = MIDIEndpointDispose(endpoint);
+ return check_hosterror(macHostError,
+ "MIDIEndpointDispose() in midi_in_close()");
+}
+
+
+static PmError midi_abort(PmInternal *midi)
+{
+ PmError err = pmNoError;
+ OSStatus macHostError;
+ MIDIEndpointRef endpoint = (MIDIEndpointRef) (intptr_t)
+ pm_descriptors[midi->device_id].descriptor;
+ macHostError = MIDIFlushOutput(endpoint);
+ return check_hosterror(macHostError,
+ "MIDIFlushOutput() in midi_abort()");
+}
+
+
+static PmError midi_write_flush(PmInternal *midi, PmTimestamp timestamp)
+{
+ OSStatus macHostError = noErr;
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
+ MIDIEndpointRef endpoint = (MIDIEndpointRef) (intptr_t)
+ pm_descriptors[midi->device_id].descriptor;
+ assert(info);
assert(endpoint);
- if (m->packet != NULL) {
+ if (info->packet != NULL) {
/* out of space, send the buffer and start refilling it */
- /* before we can send, maybe delay to limit data rate. OS X allows
- * 15KB/s. */
- UInt64 now = AudioGetCurrentHostTime();
- if (now < m->min_next_time) {
- usleep((useconds_t)
- ((m->min_next_time - now) * m->us_per_host_tick));
+ /* update min_next_time each flush to support rate limit */
+ UInt64 host_now = AudioGetCurrentHostTime();
+ if (host_now > info->min_next_time)
+ info->min_next_time = host_now;
+ if (info->is_virtual) {
+ macHostError = MIDIReceived(endpoint, info->packetList);
+ } else {
+ macHostError = MIDISend(portOut, endpoint, info->packetList);
}
- macHostError = MIDISend(portOut, endpoint, m->packetList);
- m->packet = NULL; /* indicate no data in packetList now */
- m->min_next_time = now + m->byte_count * m->host_ticks_per_byte;
- m->byte_count = 0;
- if (macHostError != noErr) goto send_packet_error;
+ info->packet = NULL; /* indicate no data in packetList now */
}
- return pmNoError;
-
-send_packet_error:
- pm_hosterror = macHostError;
- sprintf(pm_hosterror_text,
- "Host error %ld: MIDISend() in midi_write()",
- (long) macHostError);
- return pmHostError;
-
+ return check_hosterror(macHostError, (info->is_virtual ?
+ "MIDIReceived() in midi_write()" :
+ "MIDISend() in midi_write()"));
}
-static PmError
-send_packet(PmInternal *midi, Byte *message, unsigned int messageLength,
- MIDITimeStamp timestamp)
+static PmError send_packet(PmInternal *midi, Byte *message,
+ unsigned int messageLength, MIDITimeStamp timestamp)
{
PmError err;
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- assert(m);
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
+ assert(info);
- /* printf("add %d to packet %p len %d\n", message[0], m->packet, messageLength); */
- m->packet = MIDIPacketListAdd(m->packetList, sizeof(m->packetBuffer),
- m->packet, timestamp, messageLength,
- message);
- m->byte_count += messageLength;
- if (m->packet == NULL) {
+ CM_DEBUG printf("add %d to packet %p len %d timestamp %lld @ %lld ns "
+ "(host %lld)\n",
+ message[0], info->packet, messageLength, timestamp,
+ AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()),
+ AudioGetCurrentHostTime());
+ info->packet = MIDIPacketListAdd(info->packetList,
+ sizeof(info->packetBuffer), info->packet,
+ timestamp, messageLength, message);
+#if defined(LIMIT_SEND_RATE) && (LIMIT_SEND_RATE != 0)
+ info->byte_count += messageLength;
+#endif
+ if (info->packet == NULL) {
/* out of space, send the buffer and start refilling it */
/* make midi->packet non-null to fool midi_write_flush into sending */
- m->packet = (MIDIPacket *) 4;
+ info->packet = (MIDIPacket *) 4;
/* timestamp is 0 because midi_write_flush ignores timestamp since
* timestamps are already in packets. The timestamp parameter is here
* because other API's need it. midi_write_flush can be called
* from system-independent code that must be cross-API.
*/
if ((err = midi_write_flush(midi, 0)) != pmNoError) return err;
- m->packet = MIDIPacketListInit(m->packetList);
- assert(m->packet); /* if this fails, it's a programming error */
- m->packet = MIDIPacketListAdd(m->packetList, sizeof(m->packetBuffer),
- m->packet, timestamp, messageLength,
- message);
- assert(m->packet); /* can't run out of space on first message */
+ info->packet = MIDIPacketListInit(info->packetList);
+ assert(info->packet); /* if this fails, it's a programming error */
+ info->packet = MIDIPacketListAdd(info->packetList,
+ sizeof(info->packetBuffer), info->packet,
+ timestamp, messageLength, message);
+ assert(info->packet); /* can't run out of space on first message */
}
return pmNoError;
}
-static PmError
-midi_write_short(PmInternal *midi, PmEvent *event)
+static PmError midi_write_short(PmInternal *midi, PmEvent *event)
{
PmTimestamp when = event->timestamp;
PmMessage what = event->message;
MIDITimeStamp timestamp;
- UInt64 when_ns;
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
Byte message[4];
unsigned int messageLength;
- if (m->packet == NULL) {
- m->packet = MIDIPacketListInit(m->packetList);
+ if (info->packet == NULL) {
+ info->packet = MIDIPacketListInit(info->packetList);
/* this can never fail, right? failure would indicate something
unrecoverable */
- assert(m->packet);
+ assert(info->packet);
}
- /* compute timestamp */
- if (when == 0) when = midi->now;
- /* if latency == 0, midi->now is not valid. We will just set it to zero */
- if (midi->latency == 0) when = 0;
- when_ns = ((UInt64) (when + midi->latency) * (UInt64) 1000000) + m->delta;
- timestamp = (MIDITimeStamp) AudioConvertNanosToHostTime(when_ns);
+ /* PortMidi specifies that incoming timestamps are the receive
+ * time. Devices attach their receive times, but virtual devices
+ * do not. Instead, they pass along whatever timestamp was sent to
+ * them. We do not know if we are connected to real or virtual
+ * device. To avoid wild timestamps on the receiving end, we
+ * consider 2 cases: PortMidi timestamp is zero or latency is
+ * zero. Both mean send immediately, so we attach the current time
+ * which will go out immediately and arrive with a sensible
+ * timestamp (not zero and not zero mapped to the client's local
+ * time). Otherwise, we assume the timestamp is reasonable. It
+ * might be slighly in the past, but we pass it along after
+ * translation to MIDITimeStamp units.
+ *
+ * Compute timestamp: use current time if timestamp is zero or
+ * latency is zero. Both mean no timing and send immediately.
+ */
+ if (when == 0 || midi->latency == 0) {
+ timestamp = AudioGetCurrentHostTime();
+ } else { /* translate PortMidi time + latency to CoreMIDI time */
+ timestamp = ((UInt64) (when + midi->latency) * (UInt64) 1000000) +
+ info->delta;
+ timestamp = AudioConvertNanosToHostTime(timestamp);
+ }
message[0] = Pm_MessageStatus(what);
message[1] = Pm_MessageData1(what);
message[2] = Pm_MessageData2(what);
messageLength = midi_length(what);
-
- /* make sure we go foreward in time */
- if (timestamp < m->min_next_time) timestamp = m->min_next_time;
-
- #ifdef LIMIT_RATE
- if (timestamp < m->last_time)
- timestamp = m->last_time;
- m->last_time = timestamp + messageLength * m->host_ticks_per_byte;
- #endif
+#ifdef LIMIT_RATE
+ /* Make sure we go forward in time. */
+ if (timestamp < info->min_next_time) {
+ timestamp = info->min_next_time;
+ }
+ /* Note that if application is way behind and slowly catching up, then
+ * timestamps could be increasing faster than real time, and since
+ * timestamps are used to estimate data rate, our estimate could be
+ * low, causing CoreMIDI to drop packets. This seems very unlikely.
+ */
+ if (info->isIACdevice || info->is_virtual) {
+ info->min_next_time = timestamp + messageLength *
+ info->host_ticks_per_byte;
+ }
+#endif
/* Add this message to the packet list */
return send_packet(midi, message, messageLength, timestamp);
}
-static PmError
-midi_begin_sysex(PmInternal *midi, PmTimestamp when)
+static PmError midi_begin_sysex(PmInternal *midi, PmTimestamp when)
{
UInt64 when_ns;
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- assert(m);
- m->sysex_byte_count = 0;
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
+ assert(info);
+ info->sysex_byte_count = 0;
/* compute timestamp */
if (when == 0) when = midi->now;
/* if latency == 0, midi->now is not valid. We will just set it to zero */
if (midi->latency == 0) when = 0;
- when_ns = ((UInt64) (when + midi->latency) * (UInt64) 1000000) + m->delta;
- m->sysex_timestamp = (MIDITimeStamp) AudioConvertNanosToHostTime(when_ns);
+ when_ns = ((UInt64) (when + midi->latency) * (UInt64) 1000000) +
+ info->delta;
+ info->sysex_timestamp =
+ (MIDITimeStamp) AudioConvertNanosToHostTime(when_ns);
+ UInt64 now; /* only make system time call when writing a virtual port */
+ if (info->is_virtual && info->sysex_timestamp <
+ (now = AudioGetCurrentHostTime())) {
+ info->sysex_timestamp = now;
+ }
- if (m->packet == NULL) {
- m->packet = MIDIPacketListInit(m->packetList);
+ if (info->packet == NULL) {
+ info->packet = MIDIPacketListInit(info->packetList);
/* this can never fail, right? failure would indicate something
unrecoverable */
- assert(m->packet);
+ assert(info->packet);
}
return pmNoError;
}
-static PmError
-midi_end_sysex(PmInternal *midi, PmTimestamp when)
+static PmError midi_end_sysex(PmInternal *midi, PmTimestamp when)
{
PmError err;
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- assert(m);
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
+ assert(info);
+#ifdef LIMIT_RATE
/* make sure we go foreward in time */
- if (m->sysex_timestamp < m->min_next_time)
- m->sysex_timestamp = m->min_next_time;
-
- #ifdef LIMIT_RATE
- if (m->sysex_timestamp < m->last_time)
- m->sysex_timestamp = m->last_time;
- m->last_time = m->sysex_timestamp + m->sysex_byte_count *
- m->host_ticks_per_byte;
- #endif
+ if (info->sysex_timestamp < info->min_next_time)
+ info->sysex_timestamp = info->min_next_time;
+
+ if (info->isIACdevice) {
+ info->min_next_time = info->sysex_timestamp + info->sysex_byte_count *
+ info->host_ticks_per_byte;
+ }
+#endif
/* now send what's in the buffer */
- err = send_packet(midi, m->sysex_buffer, m->sysex_byte_count,
- m->sysex_timestamp);
- m->sysex_byte_count = 0;
+ err = send_packet(midi, info->sysex_buffer, info->sysex_byte_count,
+ info->sysex_timestamp);
+ info->sysex_byte_count = 0;
if (err != pmNoError) {
- m->packet = NULL; /* flush everything in the packet list */
- return err;
+ info->packet = NULL; /* flush everything in the packet list */
}
- return pmNoError;
+ return err;
}
-static PmError
-midi_write_byte(PmInternal *midi, unsigned char byte, PmTimestamp timestamp)
+static PmError midi_write_byte(PmInternal *midi, unsigned char byte,
+ PmTimestamp timestamp)
{
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- assert(m);
- if (m->sysex_byte_count >= SYSEX_BUFFER_SIZE) {
+ coremidi_info_type info = (coremidi_info_type) midi->api_info;
+ assert(info);
+ if (info->sysex_byte_count >= SYSEX_BUFFER_SIZE) {
PmError err = midi_end_sysex(midi, timestamp);
if (err != pmNoError) return err;
}
- m->sysex_buffer[m->sysex_byte_count++] = byte;
+ info->sysex_buffer[info->sysex_byte_count++] = byte;
return pmNoError;
}
-static PmError
-midi_write_realtime(PmInternal *midi, PmEvent *event)
+static PmError midi_write_realtime(PmInternal *midi, PmEvent *event)
{
/* to send a realtime message during a sysex message, first
flush all pending sysex bytes into packet list */
@@ -660,27 +943,10 @@ midi_write_realtime(PmInternal *midi, PmEvent *event)
return midi_write_short(midi, event);
}
-static unsigned int midi_has_host_error(PmInternal *midi)
-{
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- return (m->callback_error[0] != 0) || (m->error[0] != 0);
-}
-
-static void midi_get_host_error(PmInternal *midi, char *msg, unsigned int len)
+static unsigned int midi_check_host_error(PmInternal *midi)
{
- midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- msg[0] = 0; /* initialize to empty string */
- if (m) { /* make sure there is an open device to examine */
- if (m->error[0]) {
- strncpy(msg, m->error, len);
- m->error[0] = 0; /* clear the error */
- } else if (m->callback_error[0]) {
- strncpy(msg, m->callback_error, len);
- m->callback_error[0] = 0; /* clear the error */
- }
- msg[len - 1] = 0; /* make sure string is terminated */
- }
+ return FALSE;
}
@@ -695,6 +961,7 @@ MIDITimeStamp timestamp_pm_to_cm(PmTimestamp timestamp)
}
}
+
PmTimestamp timestamp_cm_to_pm(MIDITimeStamp timestamp)
{
UInt64 nanos;
@@ -708,179 +975,170 @@ PmTimestamp timestamp_cm_to_pm(MIDITimeStamp timestamp)
//////////////////////////////////////
// Obtain the name of an endpoint without regard for whether it has connections.
// The result should be released by the caller.
-CFStringRef EndpointName(MIDIEndpointRef endpoint, bool isExternal)
+CFStringRef EndpointName(MIDIEndpointRef endpoint, bool isExternal, int *isIAC)
{
- CFMutableStringRef result = CFStringCreateMutable(NULL, 0);
- CFStringRef str;
-
- // begin with the endpoint's name
- str = NULL;
- MIDIObjectGetStringProperty(endpoint, kMIDIPropertyName, &str);
- if (str != NULL) {
- CFStringAppend(result, str);
- CFRelease(str);
- }
+ CFMutableStringRef result = CFStringCreateMutable(NULL, 0);
+ CFStringRef str;
+ *isIAC = FALSE;
- MIDIEntityRef entity = NULL_REF;
- MIDIEndpointGetEntity(endpoint, &entity);
- if (entity == NULL_REF)
- // probably virtual
- return result;
-
- if (CFStringGetLength(result) == 0) {
- // endpoint name has zero length -- try the entity
+ // begin with the endpoint's name
str = NULL;
- MIDIObjectGetStringProperty(entity, kMIDIPropertyName, &str);
+ MIDIObjectGetStringProperty(endpoint, kMIDIPropertyName, &str);
if (str != NULL) {
- CFStringAppend(result, str);
- CFRelease(str);
- }
- }
- // now consider the device's name
- MIDIDeviceRef device = NULL_REF;
- MIDIEntityGetDevice(entity, &device);
- if (device == NULL_REF)
- return result;
-
- str = NULL;
- MIDIObjectGetStringProperty(device, kMIDIPropertyName, &str);
- if (CFStringGetLength(result) == 0) {
- CFRelease(result);
- return str;
- }
- if (str != NULL) {
- // if an external device has only one entity, throw away
- // the endpoint name and just use the device name
- if (isExternal && MIDIDeviceGetNumberOfEntities(device) < 2) {
- CFRelease(result);
- return str;
- } else {
- if (CFStringGetLength(str) == 0) {
+ CFStringAppend(result, str);
CFRelease(str);
+ }
+ MIDIEntityRef entity = NULL_REF;
+ MIDIEndpointGetEntity(endpoint, &entity);
+ if (entity == NULL_REF) {
+ // probably virtual
return result;
- }
- // does the entity name already start with the device name?
- // (some drivers do this though they shouldn't)
- // if so, do not prepend
- if (CFStringCompareWithOptions( result, /* endpoint name */
- str /* device name */,
- CFRangeMake(0, CFStringGetLength(str)), 0) != kCFCompareEqualTo) {
- // prepend the device name to the entity name
- if (CFStringGetLength(result) > 0)
- CFStringInsert(result, 0, CFSTR(" "));
- CFStringInsert(result, 0, str);
- }
- CFRelease(str);
- }
- }
- return result;
-}
-
+ }
+ if (!isExternal) { /* detect IAC devices */
+ //extern const CFStringRef kMIDIPropertyDriverOwner;
+ MIDIObjectGetStringProperty(entity, kMIDIPropertyDriverOwner, &str);
+ if (str != NULL) {
+ char s[32]; /* driver name may truncate, but that's OK */
+ CFStringGetCString(str, s, 31, kCFStringEncodingUTF8);
+ s[31] = 0; /* make sure it is terminated just to be safe */
+ CM_DEBUG printf("driver %s\n", s);
+ *isIAC = (strcmp(s, "com.apple.AppleMIDIIACDriver") == 0);
+ }
+ }
-// Obtain the name of an endpoint, following connections.
-// The result should be released by the caller.
-static CFStringRef ConnectedEndpointName(MIDIEndpointRef endpoint)
-{
- CFMutableStringRef result = CFStringCreateMutable(NULL, 0);
- CFStringRef str;
- OSStatus err;
- long i;
-
- // Does the endpoint have connections?
- CFDataRef connections = NULL;
- long nConnected = 0;
- bool anyStrings = false;
- err = MIDIObjectGetDataProperty(endpoint, kMIDIPropertyConnectionUniqueID, &connections);
- if (connections != NULL) {
- // It has connections, follow them
- // Concatenate the names of all connected devices
- nConnected = CFDataGetLength(connections) / (int32_t) sizeof(MIDIUniqueID);
- if (nConnected) {
- const SInt32 *pid = (const SInt32 *)(CFDataGetBytePtr(connections));
- for (i = 0; i < nConnected; ++i, ++pid) {
- MIDIUniqueID id = EndianS32_BtoN(*pid);
- MIDIObjectRef connObject;
- MIDIObjectType connObjectType;
- err = MIDIObjectFindByUniqueID(id, &connObject, &connObjectType);
- if (err == noErr) {
- if (connObjectType == kMIDIObjectType_ExternalSource ||
- connObjectType == kMIDIObjectType_ExternalDestination) {
- // Connected to an external device's endpoint (10.3 and later).
- str = EndpointName((MIDIEndpointRef)(connObject), true);
- } else {
- // Connected to an external device (10.2) (or something else, catch-all)
- str = NULL;
- MIDIObjectGetStringProperty(connObject, kMIDIPropertyName, &str);
- }
- if (str != NULL) {
- if (anyStrings)
- CFStringAppend(result, CFSTR(", "));
- else anyStrings = true;
+ if (CFStringGetLength(result) == 0) {
+ // endpoint name has zero length -- try the entity
+ str = NULL;
+ MIDIObjectGetStringProperty(entity, kMIDIPropertyName, &str);
+ if (str != NULL) {
CFStringAppend(result, str);
CFRelease(str);
- }
}
- }
}
- CFRelease(connections);
- }
- if (anyStrings)
- return result;
+ // now consider the device's name
+ MIDIDeviceRef device = NULL_REF;
+ MIDIEntityGetDevice(entity, &device);
+ if (device == NULL_REF)
+ return result;
- // Here, either the endpoint had no connections, or we failed to obtain names for any of them.
- return EndpointName(endpoint, false);
+ str = NULL;
+ MIDIObjectGetStringProperty(device, kMIDIPropertyName, &str);
+ if (CFStringGetLength(result) == 0) {
+ CFRelease(result);
+ return str;
+ }
+ if (str != NULL) {
+ // if an external device has only one entity, throw away
+ // the endpoint name and just use the device name
+ if (isExternal && MIDIDeviceGetNumberOfEntities(device) < 2) {
+ CFRelease(result);
+ return str;
+ } else {
+ if (CFStringGetLength(str) == 0) {
+ CFRelease(str);
+ return result;
+ }
+ // does the entity name already start with the device name?
+ // (some drivers do this though they shouldn't)
+ // if so, do not prepend
+ if (CFStringCompareWithOptions(result, /* endpoint name */
+ str, /* device name */
+ CFRangeMake(0, CFStringGetLength(str)), 0) !=
+ kCFCompareEqualTo) {
+ // prepend the device name to the entity name
+ if (CFStringGetLength(result) > 0)
+ CFStringInsert(result, 0, CFSTR(" "));
+ CFStringInsert(result, 0, str);
+ }
+ CFRelease(str);
+ }
+ }
+ return result;
}
-char* cm_get_full_endpoint_name(MIDIEndpointRef endpoint)
+// Obtain the name of an endpoint, following connections.
+// The result should be released by the caller.
+static CFStringRef ConnectedEndpointName(MIDIEndpointRef endpoint, int *isIAC)
{
-#ifdef OLDCODE
- MIDIEntityRef entity;
- MIDIDeviceRef device;
+ CFMutableStringRef result = CFStringCreateMutable(NULL, 0);
+ CFStringRef str;
+ OSStatus err;
+ long i;
+
+ // Does the endpoint have connections?
+ CFDataRef connections = NULL;
+ long nConnected = 0;
+ bool anyStrings = false;
+ err = MIDIObjectGetDataProperty(endpoint, kMIDIPropertyConnectionUniqueID,
+ &connections);
+ if (connections != NULL) {
+ // It has connections, follow them
+ // Concatenate the names of all connected devices
+ nConnected = CFDataGetLength(connections) /
+ (int32_t) sizeof(MIDIUniqueID);
+ if (nConnected) {
+ const SInt32 *pid = (const SInt32 *)(CFDataGetBytePtr(connections));
+ for (i = 0; i < nConnected; ++i, ++pid) {
+ MIDIUniqueID id = EndianS32_BtoN(*pid);
+ MIDIObjectRef connObject;
+ MIDIObjectType connObjectType;
+ err = MIDIObjectFindByUniqueID(id, &connObject,
+ &connObjectType);
+ if (err == noErr) {
+ if (connObjectType == kMIDIObjectType_ExternalSource ||
+ connObjectType == kMIDIObjectType_ExternalDestination) {
+ // Connected to an external device's endpoint (>=10.3)
+ str = EndpointName((MIDIEndpointRef)(connObject), true,
+ isIAC);
+ } else {
+ // Connected to an external device (10.2)
+ // (or something else, catch-all)
+ str = NULL;
+ MIDIObjectGetStringProperty(connObject,
+ kMIDIPropertyName, &str);
+ }
+ if (str != NULL) {
+ if (anyStrings)
+ CFStringAppend(result, CFSTR(", "));
+ else anyStrings = true;
+ CFStringAppend(result, str);
+ CFRelease(str);
+ }
+ }
+ }
+ }
+ CFRelease(connections);
+ }
+ if (anyStrings)
+ return result; // caller should release result
- CFStringRef endpointName = NULL;
- CFStringRef deviceName = NULL;
-#endif
- CFStringRef fullName = NULL;
- CFStringEncoding defaultEncoding;
- char* newName;
+ CFRelease(result);
- /* get the default string encoding */
- defaultEncoding = CFStringGetSystemEncoding();
+ // Here, either the endpoint had no connections, or we failed to
+ // obtain names for any of them.
+ return EndpointName(endpoint, false, isIAC);
+}
- fullName = ConnectedEndpointName(endpoint);
-
-#ifdef OLDCODE
- /* get the entity and device info */
- MIDIEndpointGetEntity(endpoint, &entity);
- MIDIEntityGetDevice(entity, &device);
- /* create the nicely formated name */
- MIDIObjectGetStringProperty(endpoint, kMIDIPropertyName, &endpointName);
- MIDIObjectGetStringProperty(device, kMIDIPropertyName, &deviceName);
- if (deviceName != NULL) {
- fullName = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@: %@"),
- deviceName, endpointName);
- } else {
- fullName = endpointName;
- }
-#endif
- /* copy the string into our buffer */
- newName = (char *) malloc(CFStringGetLength(fullName) + 1);
- CFStringGetCString(fullName, newName, CFStringGetLength(fullName) + 1,
- defaultEncoding);
+char *cm_get_full_endpoint_name(MIDIEndpointRef endpoint, int *isIAC)
+{
+ /* Thanks to Dan Wilcox for fixes for Unicode handling */
+ CFStringRef fullName = ConnectedEndpointName(endpoint, isIAC);
+ CFIndex utf16_len = CFStringGetLength(fullName) + 1;
+ CFIndex max_byte_len = CFStringGetMaximumSizeForEncoding(
+ utf16_len, kCFStringEncodingUTF8) + 1;
+ char* pmname = (char *) pm_alloc(CFStringGetLength(fullName) + 1);
+
+ /* copy the string into our buffer; note that there may be some wasted
+ space, but the total waste is not large */
+ CFStringGetCString(fullName, pmname, max_byte_len, kCFStringEncodingUTF8);
/* clean up */
-#ifdef OLDCODE
- if (endpointName) CFRelease(endpointName);
- if (deviceName) CFRelease(deviceName);
-#endif
if (fullName) CFRelease(fullName);
-
- return newName;
+ return pmname;
}
-
pm_fns_node pm_macosx_in_dictionary = {
none_write_short,
@@ -894,8 +1152,7 @@ pm_fns_node pm_macosx_in_dictionary = {
midi_abort,
midi_in_close,
success_poll,
- midi_has_host_error,
- midi_get_host_error,
+ midi_check_host_error
};
pm_fns_node pm_macosx_out_dictionary = {
@@ -910,23 +1167,50 @@ pm_fns_node pm_macosx_out_dictionary = {
midi_abort,
midi_out_close,
success_poll,
- midi_has_host_error,
- midi_get_host_error,
+ midi_check_host_error
};
+/* We do nothing with callbacks, but generating the callbacks also
+ * updates CoreMIDI state. Callback may not be essential, but calling
+ * the CFRunLoopRunInMode is necessary.
+ */
+void cm_notify(const MIDINotification *msg, void *refCon)
+{
+ /* for debugging, trace change notifications:
+ const char *descr[] = {
+ "undefined (0)",
+ "kMIDIMsgSetupChanged",
+ "kMIDIMsgObjectAdded",
+ "kMIDIMsgObjectRemoved",
+ "kMIDIMsgPropertyChanged",
+ "kMIDIMsgThruConnectionsChanged",
+ "kMIDIMsgSerialPortOwnerChanged",
+ "kMIDIMsgIOError"};
+
+ printf("MIDI Notify, messageID %d (%s)\n", (int) msg->messageID,
+ descr[(int) msg->messageID]);
+ */
+ return;
+}
+
+
PmError pm_macosxcm_init(void)
{
ItemCount numInputs, numOutputs, numDevices;
MIDIEndpointRef endpoint;
int i;
- OSStatus macHostError;
- char *error_text;
+ OSStatus macHostError = noErr;
+ const char *error_text;
+
+ memset(isIAC, 0, sizeof(isIAC)); /* initialize all FALSE */
+
+ /* Register interface CoreMIDI with create_virtual fn */
+ pm_add_interf("CoreMIDI", &midi_create_virtual, &midi_delete_virtual);
+ /* no check for error return because this always succeeds */
/* Determine the number of MIDI devices on the system */
numDevices = MIDIGetNumberOfDevices();
- numInputs = MIDIGetNumberOfSources();
- numOutputs = MIDIGetNumberOfDestinations();
/* Return prematurely if no devices exist on the system
Note that this is not an error. There may be no devices.
@@ -937,74 +1221,88 @@ PmError pm_macosxcm_init(void)
return pmNoError;
}
-
/* Initialize the client handle */
- macHostError = MIDIClientCreate(CFSTR("PortMidi"), NULL, NULL, &client);
+ if (client == NULL_REF) {
+ macHostError = MIDIClientCreate(CFSTR("PortMidi"), &cm_notify, NULL,
+ &client);
+ } else { /* see notes above on device scanning */
+ for (int i = 0; i < 100; i++) {
+ // look for any changes before scanning for devices
+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
+ if (i % 5 == 0) Pt_Sleep(1); /* insert 20 delays */
+ }
+ }
if (macHostError != noErr) {
- error_text = (char *)"MIDIClientCreate() in pm_macosxcm_init()";
+ error_text = "MIDIClientCreate() in pm_macosxcm_init()";
goto error_return;
}
+ numInputs = MIDIGetNumberOfSources();
+ numOutputs = MIDIGetNumberOfDestinations();
/* Create the input port */
- macHostError = MIDIInputPortCreate(client, CFSTR("Input port"), readProc,
- NULL, &portIn);
+ macHostError = MIDIInputPortCreate(client, CFSTR("Input port"),
+ device_read_callback, NULL, &portIn);
if (macHostError != noErr) {
- error_text = (char *)"MIDIInputPortCreate() in pm_macosxcm_init()";
+ error_text = "MIDIInputPortCreate() in pm_macosxcm_init()";
goto error_return;
}
-
+
/* Create the output port */
macHostError = MIDIOutputPortCreate(client, CFSTR("Output port"), &portOut);
if (macHostError != noErr) {
- error_text = (char *)"MIDIOutputPortCreate() in pm_macosxcm_init()";
+ error_text = "MIDIOutputPortCreate() in pm_macosxcm_init()";
goto error_return;
}
/* Iterate over the MIDI input devices */
for (i = 0; i < numInputs; i++) {
+ int isIACflag;
endpoint = MIDIGetSource(i);
if (endpoint == NULL_REF) {
continue;
}
-
/* set the first input we see to the default */
if (pm_default_input_device_id == -1)
- pm_default_input_device_id = pm_descriptor_index;
+ pm_default_input_device_id = pm_descriptor_len;
/* Register this device with PortMidi */
- pm_add_device((char *)"CoreMIDI", cm_get_full_endpoint_name(endpoint),
- TRUE, (void *) (long) endpoint, &pm_macosx_in_dictionary);
+ pm_add_device("CoreMIDI",
+ cm_get_full_endpoint_name(endpoint, &isIACflag), TRUE, FALSE,
+ (void *) (intptr_t) endpoint, &pm_macosx_in_dictionary);
}
/* Iterate over the MIDI output devices */
for (i = 0; i < numOutputs; i++) {
+ int isIACflag;
+ PmDeviceID id;
endpoint = MIDIGetDestination(i);
if (endpoint == NULL_REF) {
continue;
}
-
/* set the first output we see to the default */
if (pm_default_output_device_id == -1)
- pm_default_output_device_id = pm_descriptor_index;
+ pm_default_output_device_id = pm_descriptor_len;
/* Register this device with PortMidi */
- pm_add_device((char *)"CoreMIDI", cm_get_full_endpoint_name(endpoint),
- FALSE, (void *) (long) endpoint,
- &pm_macosx_out_dictionary);
+ id = pm_add_device("CoreMIDI",
+ cm_get_full_endpoint_name(endpoint, &isIACflag), FALSE, FALSE,
+ (void *) (intptr_t) endpoint, &pm_macosx_out_dictionary);
+ /* if this is an IAC device, tuck that info away for write functions */
+ if (isIACflag && id <= MAX_IAC_NUM) {
+ isIAC[id] = TRUE;
+ }
}
return pmNoError;
error_return:
- pm_hosterror = macHostError;
- sprintf(pm_hosterror_text, "Host error %ld: %s\n", (long) macHostError,
- error_text);
pm_macosxcm_term(); /* clear out any opened ports */
- return pmHostError;
+ return check_hosterror(macHostError, error_text);
}
void pm_macosxcm_term(void)
{
- if (client != NULL_REF) MIDIClientDispose(client);
+ /* docs say do not explicitly dispose of client
+ if (client != NULL_REF) MIDIClientDispose(client); */
if (portIn != NULL_REF) MIDIPortDispose(portIn);
if (portOut != NULL_REF) MIDIPortDispose(portOut);
}
diff --git a/3rdparty/portmidi/pm_mac/pmmacosxcm.h b/3rdparty/portmidi/pm_mac/pmmacosxcm.h
index ea79902d40b..ab8b5edbcb7 100644
--- a/3rdparty/portmidi/pm_mac/pmmacosxcm.h
+++ b/3rdparty/portmidi/pm_mac/pmmacosxcm.h
@@ -3,4 +3,4 @@
PmError pm_macosxcm_init(void);
void pm_macosxcm_term(void);
-PmDeviceID find_default_device(char *path, int input, PmDeviceID id);
+PmDeviceID find_default_device(const char *path, int input, PmDeviceID id);
diff --git a/3rdparty/portmidi/pm_mac/readbinaryplist.c b/3rdparty/portmidi/pm_mac/readbinaryplist.c
index c24a40a809e..9564e700d0b 100644
--- a/3rdparty/portmidi/pm_mac/readbinaryplist.c
+++ b/3rdparty/portmidi/pm_mac/readbinaryplist.c
@@ -3,26 +3,28 @@
readbinaryplist.c -- Roger B. Dannenberg, Jun 2008
Based on ReadBinaryPList.m by Jens Ayton, 2007
-Note that this code is intended to read preference files and has an upper
-bound on file size (currently 100MB) and assumes in some places that 32 bit
-offsets are sufficient.
+Note that this code is intended to read preference files and has an
+upper bound on file size (currently 100MB) and assumes in some places
+that 32 bit offsets are sufficient.
Here are his comments:
Reader for binary property list files (version 00).
-This has been found to work on all 566 binary plists in my ~/Library/Preferences/
-and /Library/Preferences/ directories. This probably does not provide full
-test coverage. It has also been found to provide different data to Apple's
-implementation when presented with a key-value archive. This is because Apple's
-implementation produces undocumented CFKeyArchiverUID objects. My implementation
-produces dictionaries instead, matching the in-file representation used in XML
-and OpenStep plists. See extract_uid().
-
-Full disclosure: in implementing this software, I read one comment and one
-struct defintion in CFLite, Apple's implementation, which is under the APSL
-license. I also deduced the information about CFKeyArchiverUID from that code.
-However, none of the implementation was copied.
+This has been found to work on all 566 binary plists in my
+~/Library/Preferences/ and /Library/Preferences/ directories. This
+probably does not provide full test coverage. It has also been found
+to provide different data to Apple's implementation when presented
+with a key-value archive. This is because Apple's implementation
+produces undocumented CFKeyArchiverUID objects. My implementation
+produces dictionaries instead, matching the in-file representation
+used in XML and OpenStep plists. See extract_uid().
+
+Full disclosure: in implementing this software, I read one comment and
+one struct defintion in CFLite, Apple's implementation, which is under
+the APSL license. I also deduced the information about
+CFKeyArchiverUID from that code. However, none of the implementation
+was copied.
Copyright (C) 2007 Jens Ayton
@@ -33,16 +35,16 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
-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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+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 AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
@@ -72,21 +74,19 @@ memory requested or calls longjmp, so callers don't have to check.
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <sys/stat.h>
#include "readbinaryplist.h"
-#include "osxsupport.h"
#include <Carbon/Carbon.h>
#define NO 0
#define YES 1
#define BOOL int
-//#define MAXPATHLEN 256
+#define MAX_PATH_LEN 256
/* there are 2 levels of error logging/printing:
* BPLIST_LOG and BPLIST_LOG_VERBOSE
@@ -99,22 +99,21 @@ memory requested or calls longjmp, so callers don't have to check.
* parameters like printf but might be a no-op.
*/
-#define BPLIST_LOG_VERBOSE 0
-#define BPLIST_LOG 0
+/* #define BPLIST_LOG_VERBOSE 1 */
-#if BPLIST_LOG_VERBOSE
+#if defined(BPLIST_LOG_VERBOSE) && (BPLIST_LOG_VERBOSE != 0)
#ifndef BPLIST_LOG
#define BPLIST_LOG 1
#endif
#endif
-#if BPLIST_LOG
+#if defined(BPLIST_LOG) && (BPLIST_LOG != 0)
#define bplist_log printf
#else
#define bplist_log(...)
#endif
-#if BPLIST_LOG_VERBOSE
+#if defined(BPLIST_LOG_VERBOSE) && (BPLIST_LOG_VERBOSE != 0)
#define bplist_log_verbose bplist_log
#else
#define bplist_log_verbose(...)
@@ -207,10 +206,12 @@ typedef struct bplist_info
static value_ptr bplist_read_pldata(pldata_ptr data);
-static value_ptr bplist_read_pref(char *filename, OSType folder_type);
-static uint64_t read_sized_int(bplist_info_ptr bplist, uint64_t offset, uint8_t size);
+static value_ptr bplist_read_pref(const char *filename, OSType folder_type);
+static uint64_t read_sized_int(bplist_info_ptr bplist, uint64_t offset,
+ uint8_t size);
static uint64_t read_offset(bplist_info_ptr bplist, uint64_t index);
-static BOOL read_self_sized_int(bplist_info_ptr bplist, uint64_t offset, uint64_t *outValue, size_t *outSize);
+static BOOL read_self_sized_int(bplist_info_ptr bplist, uint64_t offset,
+ uint64_t *outValue, size_t *outSize);
static value_ptr extract_object(bplist_info_ptr bplist, uint64_t objectRef);
static value_ptr extract_simple(bplist_info_ptr bplist, uint64_t offset);
@@ -219,7 +220,8 @@ static value_ptr extract_real(bplist_info_ptr bplist, uint64_t offset);
static value_ptr extract_date(bplist_info_ptr bplist, uint64_t offset);
static value_ptr extract_data(bplist_info_ptr bplist, uint64_t offset);
static value_ptr extract_ascii_string(bplist_info_ptr bplist, uint64_t offset);
-static value_ptr extract_unicode_string(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_unicode_string(bplist_info_ptr bplist,
+ uint64_t offset);
static value_ptr extract_uid(bplist_info_ptr bplist, uint64_t offset);
static value_ptr extract_array(bplist_info_ptr bplist, uint64_t offset);
static value_ptr extract_dictionary(bplist_info_ptr bplist, uint64_t offset);
@@ -236,15 +238,18 @@ void value_set_integer(value_ptr v, int64_t i) {
v->tag = kTAG_INT; v->integer = i;
}
+
void value_set_real(value_ptr v, double d) {
v->tag = kTAG_REAL; v->real = d;
}
+
// d is seconds since 1 January 2001
void value_set_date(value_ptr v, double d) {
v->tag = kTAG_DATE; v->real = d;
}
+
void value_set_ascii_string(value_ptr v, const uint8_t *s, size_t len) {
v->tag = kTAG_ASCIISTRING;
v->string = (char *) allocate(len + 1);
@@ -252,6 +257,7 @@ void value_set_ascii_string(value_ptr v, const uint8_t *s, size_t len) {
v->string[len] = 0;
}
+
void value_set_unicode_string(value_ptr v, const uint8_t *s, size_t len) {
v->tag = kTAG_UNICODESTRING;
v->string = (char *) allocate(len + 1);
@@ -276,8 +282,10 @@ void value_set_data(value_ptr v, const uint8_t *data, size_t len) {
printf("value at %p gets data at %p\n", v, pldata);
}
+
// caller releases ownership of array to value_ptr v
-void value_set_array(value_ptr v, value_ptr *array, size_t length) {
+void value_set_array(value_ptr v, value_ptr *array, size_t length)
+{
array_ptr a = (array_ptr) allocate(sizeof(array_node));
a->array = array;
a->length = length;
@@ -285,8 +293,10 @@ void value_set_array(value_ptr v, value_ptr *array, size_t length) {
v->array = a;
}
+
// caller releases ownership of dict to value_ptr v
-void value_set_dict(value_ptr v, dict_ptr dict) {
+void value_set_dict(value_ptr v, dict_ptr dict)
+{
v->tag = kTAG_DICTIONARY;
v->dict = dict;
}
@@ -334,7 +344,7 @@ BOOL is_binary_plist(pldata_ptr data)
}
-value_ptr bplist_read_file(char *filename)
+value_ptr bplist_read_file(const char *filename)
{
struct stat stbuf;
pldata_node pldata;
@@ -343,7 +353,7 @@ value_ptr bplist_read_file(char *filename)
value_ptr value;
int rslt = stat(filename, &stbuf);
if (rslt) {
- #if BPLIST_LOG
+ #if defined(BPLIST_LOG) && (BPLIST_LOG != 0)
perror("in stat");
#endif
bplist_log("Could not stat %s, error %d\n", filename, rslt);
@@ -380,12 +390,11 @@ value_ptr bplist_read_file(char *filename)
return value;
}
-// use old Carbon method on PPC
-#ifdef OSX_PPC
-value_ptr bplist_read_pref(char *filename, OSType folder_type)
+
+value_ptr bplist_read_pref(const char *filename, OSType folder_type)
{
FSRef prefdir;
- char cstr[MAXPATHLEN];
+ char cstr[MAX_PATH_LEN];
OSErr err = FSFindFolder(kOnAppropriateDisk, folder_type,
FALSE, &prefdir);
@@ -393,57 +402,23 @@ value_ptr bplist_read_pref(char *filename, OSType folder_type)
bplist_log("Error finding preferences folder: %d\n", err);
return NULL;
}
- err = FSRefMakePath(&prefdir, (UInt8 *) cstr, (UInt32) (MAXPATHLEN - 1));
+ err = FSRefMakePath(&prefdir, (UInt8 *) cstr, (UInt32) (MAX_PATH_LEN - 1));
if (err) {
bplist_log("Error making path name for preferences folder: %d\n", err);
return NULL;
}
- strlcat(cstr, "/", MAXPATHLEN);
- strlcat(cstr, filename, MAXPATHLEN);
+ strlcat(cstr, "/", MAX_PATH_LEN);
+ strlcat(cstr, filename, MAX_PATH_LEN);
return bplist_read_file(cstr);
}
-#else
-value_ptr bplist_read_pref(char *filename, OSType folder_type)
-{
- char cstr[MAXPATHLEN];
- char *foundstr;
-
- memset(cstr, 0, MAXPATHLEN);
-
- // for later OS X, the user preferences folder (~/Library/Preferences) is not available directly from Cocoa,
- // Apple documentation suggests just using POSIX APIs like so.
- if (folder_type == kPreferencesFolderType)
- {
- strlcpy(cstr, getenv("HOME"), MAXPATHLEN);
- strlcat(cstr, "/Library/Preferences", MAXPATHLEN);
- }
- else // the system preferences folder (~/Library/PreferencePanes) is accessible from Cocoa however
- {
- foundstr = FindPrefsDir();
-
- if (!foundstr) {
- bplist_log("Error finding preferences folder\n");
- return NULL;
- }
-
- strlcat(cstr, foundstr, MAXPATHLEN);
- free(foundstr);
- foundstr = NULL;
- }
-
- strlcat(cstr, "/", MAXPATHLEN);
- strlcat(cstr, filename, MAXPATHLEN);
-
- return bplist_read_file(cstr);
-}
-#endif
-value_ptr bplist_read_system_pref(char *filename) {
+
+value_ptr bplist_read_system_pref(const char *filename) {
return bplist_read_pref(filename, kSystemPreferencesFolderType);
}
-value_ptr bplist_read_user_pref(char *filename) {
+value_ptr bplist_read_user_pref(const char *filename) {
return bplist_read_pref(filename, kPreferencesFolderType);
}
@@ -774,7 +749,7 @@ static value_ptr extract_date(bplist_info_ptr bplist, uint64_t offset)
uint64_t bplist_get_a_size(bplist_info_ptr bplist,
- uint64_t *offset_ptr, char *msg)
+ uint64_t *offset_ptr, const char *msg)
{
uint64_t size = bplist->data_bytes[*offset_ptr] & 0x0F;
(*offset_ptr)++;
@@ -814,7 +789,7 @@ static value_ptr extract_data(bplist_info_ptr bplist, uint64_t offset)
assert(bplist->data_bytes != NULL && offset < bplist->length);
- if ((size = bplist_get_a_size(bplist, &offset, (char *)"data")) == UINT64_MAX)
+ if ((size = bplist_get_a_size(bplist, &offset, "data")) == UINT64_MAX)
return NULL;
value = value_create();
@@ -831,7 +806,7 @@ static value_ptr extract_ascii_string(bplist_info_ptr bplist, uint64_t offset)
assert(bplist->data_bytes != NULL && offset < bplist->length);
- if ((size = bplist_get_a_size(bplist, &offset, (char *)"ascii string")) ==
+ if ((size = bplist_get_a_size(bplist, &offset, "ascii string")) ==
UINT64_MAX)
return NULL;
@@ -850,7 +825,7 @@ static value_ptr extract_unicode_string(bplist_info_ptr bplist, uint64_t offset)
assert(bplist->data_bytes != NULL && offset < bplist->length);
- if ((size = bplist_get_a_size(bplist, &offset, (char *)"unicode string")) ==
+ if ((size = bplist_get_a_size(bplist, &offset, "unicode string")) ==
UINT64_MAX)
return NULL;
@@ -911,7 +886,7 @@ static value_ptr extract_array(bplist_info_ptr bplist, uint64_t offset)
assert(bplist->data_bytes != NULL && offset < bplist->length);
- if ((count = bplist_get_a_size(bplist, &offset, (char *)"array")) == UINT64_MAX)
+ if ((count = bplist_get_a_size(bplist, &offset, "array")) == UINT64_MAX)
return NULL;
if (count > UINT64_MAX / bplist->object_ref_size - offset) {
@@ -973,7 +948,7 @@ static value_ptr extract_dictionary(bplist_info_ptr bplist, uint64_t offset)
assert(bplist->data_bytes != NULL && offset < bplist->length);
- if ((count = bplist_get_a_size(bplist, &offset, (char *)"array")) == UINT64_MAX)
+ if ((count = bplist_get_a_size(bplist, &offset, "array")) == UINT64_MAX)
return NULL;
if (count > UINT64_MAX / (bplist->object_ref_size * 2) - offset) {
@@ -1037,7 +1012,7 @@ char *value_get_asciistring(value_ptr v)
}
-value_ptr value_dict_lookup_using_string(value_ptr v, char *key)
+value_ptr value_dict_lookup_using_string(value_ptr v, const char *key)
{
dict_ptr dict;
if (v->tag != kTAG_DICTIONARY) return NULL; // not a dictionary
@@ -1053,7 +1028,7 @@ value_ptr value_dict_lookup_using_string(value_ptr v, char *key)
return NULL; /* not found */
}
-value_ptr value_dict_lookup_using_path(value_ptr v, char *path)
+value_ptr value_dict_lookup_using_path(value_ptr v, const char *path)
{
char key[MAX_KEY_SIZE];
while (*path) { /* more to the path */
diff --git a/3rdparty/portmidi/pm_mac/readbinaryplist.h b/3rdparty/portmidi/pm_mac/readbinaryplist.h
index e82056a0b79..8b096d08e2e 100644
--- a/3rdparty/portmidi/pm_mac/readbinaryplist.h
+++ b/3rdparty/portmidi/pm_mac/readbinaryplist.h
@@ -71,16 +71,16 @@ typedef struct value_struct {
} value_node, *value_ptr;
-value_ptr bplist_read_file(char *filename);
-value_ptr bplist_read_user_pref(char *filename);
-value_ptr bplist_read_system_pref(char *filename);
+value_ptr bplist_read_file(const char *filename);
+value_ptr bplist_read_user_pref(const char *filename);
+value_ptr bplist_read_system_pref(const char *filename);
void bplist_free_data(void);
/*************** functions for accessing values ****************/
char *value_get_asciistring(value_ptr v);
-value_ptr value_dict_lookup_using_string(value_ptr v, char *key);
-value_ptr value_dict_lookup_using_path(value_ptr v, char *path);
+value_ptr value_dict_lookup_using_string(value_ptr v, const char *key);
+value_ptr value_dict_lookup_using_path(value_ptr v, const char *path);
/*************** functions for debugging ***************/
diff --git a/3rdparty/portmidi/pm_mingw/README-MINGW.txt b/3rdparty/portmidi/pm_mingw/README-MINGW.txt
deleted file mode 100644
index e01a7fed441..00000000000
--- a/3rdparty/portmidi/pm_mingw/README-MINGW.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-README-MINGW.txt -- note on MinGW and PortMidi
-
-Roger Dannenberg
-20 Sep 2010
-
-Fabian Rutte writes that CMake can build files for Code::Blocks
-under MinGW.
-
-I would guess that a simple Unix Makefile output from CMake would
-also work, but I haven't tested it.
-
diff --git a/3rdparty/portmidi/pm_mingw/eclipse/README.txt b/3rdparty/portmidi/pm_mingw/eclipse/README.txt
deleted file mode 100644
index 2b58e13ab17..00000000000
--- a/3rdparty/portmidi/pm_mingw/eclipse/README.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-These files, dot-cproject and dot-project, come from Philip Martin
-(posted on Media_api mailing list on September 3, 2008).
-He writes: "I do not have a makefile. I used Eclipse + CDT to build
-PortMidi using MinGw. ... The two files .project and .cproject I
-believe must be in the root of the portmidi tree to work with Eclipse.
-... I have only compiled the relevant sources into one .dll here."
-
-The .project and .cproject files have been renamed to dot-project and
-dot-cproject here to make them more visible. To use them, you will
-need to rename them to .project and .cproject, and probably move them
-to the portmidi tree root.
-
-At this time, no one is actively maintaining Eclipse or MinGw versions
-of PortMidi, so these files may be out-of-date or have other problems.
-Feel free to submit updates or discuss the possibility of maintaining
-these or some equivalent files for MinGw.
-
-Update, 20 Sep 2010: CMake supports Code::Blocks in conjunction with
-MinGW.
-
-Roger Dannenberg
-18-Oct-2008
-
diff --git a/3rdparty/portmidi/pm_mingw/eclipse/dot-cproject b/3rdparty/portmidi/pm_mingw/eclipse/dot-cproject
deleted file mode 100644
index 06b47e3f567..00000000000
--- a/3rdparty/portmidi/pm_mingw/eclipse/dot-cproject
+++ /dev/null
@@ -1,710 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?>
-
-<cproject>
-<storageModule moduleId="org.eclipse.cdt.core.settings">
-<cconfiguration id="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004">
-<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004" moduleId="org.eclipse.cdt.core.settings" name="Debug">
-<externalSettings>
-<externalSetting>
-<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/PortMidi"/>
-<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/PortMidi/Debug"/>
-</externalSetting>
-</externalSettings>
-<extensions>
-<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
-<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-</extensions>
-</storageModule>
-<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-<configuration artifactExtension="dll" artifactName="PortMidi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.so.debug">
-<folderInfo id="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004." name="/" resourcePath="">
-<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.so.debug.1545417885" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.so.debug">
-<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.so.debug.415542300" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.so.debug"/>
-<builder buildPath="${workspace_loc:/PortMidi/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.592172807" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
-<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug.1889129808" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug">
-<option id="gnu.both.asm.option.flags.1498736889" name="Assembler flags" superClass="gnu.both.asm.option.flags"/>
-<option id="gnu.both.asm.option.include.paths.1734867019" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_common}&quot;"/>
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_win}&quot;"/>
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/porttime}&quot;"/>
-</option>
-<option id="gnu.both.asm.option.warnings.nowarn.1657300607" name="Suppress warnings (-W)" superClass="gnu.both.asm.option.warnings.nowarn"/>
-<option id="gnu.both.asm.option.version.1995252368" name="Announce version (-v)" superClass="gnu.both.asm.option.version"/>
-<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1250436110" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1211487028" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
-<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.81091790" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug">
-<option id="gnu.cpp.compiler.mingw.so.debug.option.optimization.level.1750954034" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.so.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
-<option id="gnu.cpp.compiler.mingw.so.debug.option.debugging.level.1357163228" name="Debug Level" superClass="gnu.cpp.compiler.mingw.so.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.428547337" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug">
-<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.so.debug.option.optimization.level.1361318269" name="Optimization Level" superClass="gnu.c.compiler.mingw.so.debug.option.optimization.level" valueType="enumerated"/>
-<option id="gnu.c.compiler.mingw.so.debug.option.debugging.level.798971050" name="Debug Level" superClass="gnu.c.compiler.mingw.so.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
-<option id="gnu.c.compiler.option.preprocessor.nostdinc.635731758" name="Do not search system directories (-nostdinc)" superClass="gnu.c.compiler.option.preprocessor.nostdinc"/>
-<option id="gnu.c.compiler.option.preprocessor.preprocess.1129104455" name="Preprocess only (-E)" superClass="gnu.c.compiler.option.preprocessor.preprocess"/>
-<option id="gnu.c.compiler.option.preprocessor.def.symbols.924940285" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"/>
-<option id="gnu.c.compiler.option.preprocessor.undef.symbol.1996330931" name="Undefined symbols (-U)" superClass="gnu.c.compiler.option.preprocessor.undef.symbol" valueType="undefDefinedSymbols">
-<listOptionValue builtIn="false" value="_STDCALL_SUPPORTED"/>
-</option>
-<option id="gnu.c.compiler.option.include.paths.276080219" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_common}&quot;"/>
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_win}&quot;"/>
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/porttime}&quot;"/>
-</option>
-<option id="gnu.c.compiler.option.optimization.flags.1032442929" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags"/>
-<option id="gnu.c.compiler.option.debugging.other.509079500" name="Other debugging flags" superClass="gnu.c.compiler.option.debugging.other"/>
-<option id="gnu.c.compiler.option.debugging.gprof.708510440" name="Generate gprof information (-pg)" superClass="gnu.c.compiler.option.debugging.gprof"/>
-<option id="gnu.c.compiler.option.debugging.prof.1379528770" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof"/>
-<option id="gnu.c.compiler.option.warnings.syntax.76950723" name="Check syntax only (-fsyntax-only)" superClass="gnu.c.compiler.option.warnings.syntax"/>
-<option id="gnu.c.compiler.option.warnings.pedantic.503180272" name="Pedantic (-pedantic)" superClass="gnu.c.compiler.option.warnings.pedantic"/>
-<option id="gnu.c.compiler.option.warnings.pedantic.error.332437973" name="Pedantic warnings as errors (-pedantic-errors)" superClass="gnu.c.compiler.option.warnings.pedantic.error"/>
-<option id="gnu.c.compiler.option.warnings.nowarn.1830350073" name="Inhibit all warnings (-w)" superClass="gnu.c.compiler.option.warnings.nowarn"/>
-<option id="gnu.c.compiler.option.warnings.allwarn.77655170" name="All warnings (-Wall)" superClass="gnu.c.compiler.option.warnings.allwarn"/>
-<option id="gnu.c.compiler.option.warnings.toerrors.1707691615" name="Warnings as errors (-Werror)" superClass="gnu.c.compiler.option.warnings.toerrors"/>
-<option id="gnu.c.compiler.option.misc.other.1929071594" name="Other flags" superClass="gnu.c.compiler.option.misc.other"/>
-<option id="gnu.c.compiler.option.misc.verbose.1368165423" name="Verbose (-v)" superClass="gnu.c.compiler.option.misc.verbose"/>
-<option id="gnu.c.compiler.option.misc.ansi.1130235771" name="Support ANSI programs (-ansi)" superClass="gnu.c.compiler.option.misc.ansi"/>
-<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.532732416" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug.2093989251" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug">
-<option defaultValue="true" id="gnu.c.link.mingw.so.debug.option.shared.210833175" name="Shared (-shared)" superClass="gnu.c.link.mingw.so.debug.option.shared" valueType="boolean"/>
-<option id="gnu.c.link.option.nostart.1109377759" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart"/>
-<option id="gnu.c.link.option.nodeflibs.1969639513" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.c.link.option.nodeflibs"/>
-<option id="gnu.c.link.option.nostdlibs.1939458836" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs"/>
-<option id="gnu.c.link.option.strip.1926939147" name="Omit all symbol information (-s)" superClass="gnu.c.link.option.strip"/>
-<option id="gnu.c.link.option.noshared.1390204753" name="No shared libraries (-static)" superClass="gnu.c.link.option.noshared"/>
-<option id="gnu.c.link.option.libs.2043660134" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">
-<listOptionValue builtIn="false" value="winmm"/>
-</option>
-<option id="gnu.c.link.option.paths.1702926265" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
-<option id="gnu.c.link.option.ldflags.1184725311" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-mwindows" valueType="string"/>
-<option id="gnu.c.link.option.other.2085141015" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other"/>
-<option id="gnu.c.link.option.userobjs.1490648701" name="Other objects" superClass="gnu.c.link.option.userobjs"/>
-<option id="gnu.c.link.option.soname.437120219" name="Shared object name (-Wl,-soname=)" superClass="gnu.c.link.option.soname" value="PortMidi.dll" valueType="string"/>
-<option id="gnu.c.link.option.implname.205634723" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.c.link.option.implname" value="libPortMidi_dll.a" valueType="string"/>
-<option id="gnu.c.link.option.defname.571020719" name="DEF file name (-Wl,--output-def=)" superClass="gnu.c.link.option.defname" value="PortMidi_dll.def" valueType="string"/>
-<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.916986463" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
-<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
-<additionalInput kind="additionalinput" paths="$(LIBS)"/>
-</inputType>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.debug.1822206806" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.debug">
-<option defaultValue="true" id="gnu.cpp.link.mingw.so.debug.option.shared.408251443" name="Shared (-shared)" superClass="gnu.cpp.link.mingw.so.debug.option.shared" valueType="boolean"/>
-</tool>
-</toolChain>
-</folderInfo>
-<sourceEntries>
-<entry excluding="pm_cl/|pm_linux/|pm_mac/|pm_test/|porttime/ptlinux.c|porttime/ptmacosx_cf.c|porttime/ptmacosx_mach.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
-</sourceEntries>
-</configuration>
-</storageModule>
-<storageModule moduleId="scannerConfiguration">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.413200248;cdt.managedbuild.config.gnu.mingw.so.release.413200248.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release.343495978;cdt.managedbuild.tool.gnu.c.compiler.input.611335297">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-</scannerConfigBuildInfo>
-<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004;cdt.managedbuild.config.gnu.mingw.so.debug.1580321004.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.428547337;cdt.managedbuild.tool.gnu.c.compiler.input.532732416">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-</scannerConfigBuildInfo>
-</storageModule>
-<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-</cconfiguration>
-<cconfiguration id="cdt.managedbuild.config.gnu.mingw.so.release.413200248">
-<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.so.release.413200248" moduleId="org.eclipse.cdt.core.settings" name="Release">
-<externalSettings>
-<externalSetting>
-<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/PortMidi"/>
-<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/PortMidi/Release"/>
-</externalSetting>
-</externalSettings>
-<extensions>
-<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
-<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-</extensions>
-</storageModule>
-<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-<configuration artifactExtension="dll" artifactName="PortMidi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.release.413200248" name="Release" parent="cdt.managedbuild.config.gnu.mingw.so.release">
-<folderInfo id="cdt.managedbuild.config.gnu.mingw.so.release.413200248." name="/" resourcePath="">
-<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.so.release.965704931" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.so.release">
-<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.so.release.1343771960" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.so.release"/>
-<builder buildPath="${workspace_loc:/PortMidi/Release}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.1650720234" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
-<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.so.release.1392864745" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.so.release">
-<option id="gnu.both.asm.option.include.paths.591264871" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_common}&quot;"/>
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_win}&quot;"/>
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/porttime}&quot;"/>
-</option>
-<option id="gnu.both.asm.option.flags.1143807089" superClass="gnu.both.asm.option.flags"/>
-<option id="gnu.both.asm.option.warnings.nowarn.1142377463" superClass="gnu.both.asm.option.warnings.nowarn"/>
-<option id="gnu.both.asm.option.version.1007025248" superClass="gnu.both.asm.option.version"/>
-<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1754592443" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.503109969" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
-<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release.1693369280" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release">
-<option id="gnu.cpp.compiler.mingw.so.release.option.optimization.level.1169326010" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.so.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
-<option id="gnu.cpp.compiler.mingw.so.release.option.debugging.level.1197288488" name="Debug Level" superClass="gnu.cpp.compiler.mingw.so.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release.343495978" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release">
-<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.so.release.option.optimization.level.79718900" name="Optimization Level" superClass="gnu.c.compiler.mingw.so.release.option.optimization.level" valueType="enumerated"/>
-<option id="gnu.c.compiler.mingw.so.release.option.debugging.level.778378875" name="Debug Level" superClass="gnu.c.compiler.mingw.so.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
-<option id="gnu.c.compiler.option.include.paths.140256948" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_common}&quot;"/>
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_win}&quot;"/>
-<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/porttime}&quot;"/>
-</option>
-<option id="gnu.c.compiler.option.preprocessor.def.symbols.960115196" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"/>
-<option id="gnu.c.compiler.option.preprocessor.undef.symbol.1891593123" name="Undefined symbols (-U)" superClass="gnu.c.compiler.option.preprocessor.undef.symbol" valueType="undefDefinedSymbols">
-<listOptionValue builtIn="false" value="_STDCALL_SUPPORTED"/>
-</option>
-<option id="gnu.c.compiler.option.preprocessor.nostdinc.824573539" name="Do not search system directories (-nostdinc)" superClass="gnu.c.compiler.option.preprocessor.nostdinc"/>
-<option id="gnu.c.compiler.option.preprocessor.preprocess.2045908914" name="Preprocess only (-E)" superClass="gnu.c.compiler.option.preprocessor.preprocess"/>
-<option id="gnu.c.compiler.option.optimization.flags.1668114371" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags"/>
-<option id="gnu.c.compiler.option.debugging.other.26702882" name="Other debugging flags" superClass="gnu.c.compiler.option.debugging.other"/>
-<option id="gnu.c.compiler.option.debugging.gprof.1849481872" name="Generate gprof information (-pg)" superClass="gnu.c.compiler.option.debugging.gprof"/>
-<option id="gnu.c.compiler.option.debugging.prof.370891777" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof"/>
-<option id="gnu.c.compiler.option.warnings.syntax.814238128" name="Check syntax only (-fsyntax-only)" superClass="gnu.c.compiler.option.warnings.syntax"/>
-<option id="gnu.c.compiler.option.warnings.pedantic.1130364543" name="Pedantic (-pedantic)" superClass="gnu.c.compiler.option.warnings.pedantic"/>
-<option id="gnu.c.compiler.option.warnings.pedantic.error.1833423377" name="Pedantic warnings as errors (-pedantic-errors)" superClass="gnu.c.compiler.option.warnings.pedantic.error"/>
-<option id="gnu.c.compiler.option.warnings.nowarn.842847161" name="Inhibit all warnings (-w)" superClass="gnu.c.compiler.option.warnings.nowarn"/>
-<option id="gnu.c.compiler.option.warnings.allwarn.1245259653" name="All warnings (-Wall)" superClass="gnu.c.compiler.option.warnings.allwarn"/>
-<option id="gnu.c.compiler.option.warnings.toerrors.329299856" name="Warnings as errors (-Werror)" superClass="gnu.c.compiler.option.warnings.toerrors"/>
-<option id="gnu.c.compiler.option.misc.other.1436833008" name="Other flags" superClass="gnu.c.compiler.option.misc.other"/>
-<option id="gnu.c.compiler.option.misc.verbose.1418051288" name="Verbose (-v)" superClass="gnu.c.compiler.option.misc.verbose"/>
-<option id="gnu.c.compiler.option.misc.ansi.592723919" name="Support ANSI programs (-ansi)" superClass="gnu.c.compiler.option.misc.ansi"/>
-<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.611335297" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.so.release.556134685" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.so.release">
-<option defaultValue="true" id="gnu.c.link.mingw.so.release.option.shared.1619560956" name="Shared (-shared)" superClass="gnu.c.link.mingw.so.release.option.shared" valueType="boolean"/>
-<option id="gnu.c.link.option.ldflags.1804407715" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-mwindows" valueType="string"/>
-<option id="gnu.c.link.option.soname.621315524" name="Shared object name (-Wl,-soname=)" superClass="gnu.c.link.option.soname" value="PortMidi.dll" valueType="string"/>
-<option id="gnu.c.link.option.implname.236027258" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.c.link.option.implname" value="libPortMidi_dll.a" valueType="string"/>
-<option id="gnu.c.link.option.defname.1144978768" name="DEF file name (-Wl,--output-def=)" superClass="gnu.c.link.option.defname" value="PortMidi_dll.def" valueType="string"/>
-<option id="gnu.c.link.option.nostart.623404099" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart"/>
-<option id="gnu.c.link.option.nodeflibs.51119036" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.c.link.option.nodeflibs"/>
-<option id="gnu.c.link.option.nostdlibs.2099774502" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs"/>
-<option id="gnu.c.link.option.strip.1270839234" name="Omit all symbol information (-s)" superClass="gnu.c.link.option.strip"/>
-<option id="gnu.c.link.option.noshared.715377715" name="No shared libraries (-static)" superClass="gnu.c.link.option.noshared"/>
-<option id="gnu.c.link.option.libs.246748928" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">
-<listOptionValue builtIn="false" value="winmm"/>
-</option>
-<option id="gnu.c.link.option.paths.1166408208" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
-<option id="gnu.c.link.option.other.1932058041" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other"/>
-<option id="gnu.c.link.option.userobjs.1397357824" name="Other objects" superClass="gnu.c.link.option.userobjs"/>
-<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.363448189" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
-<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
-<additionalInput kind="additionalinput" paths="$(LIBS)"/>
-</inputType>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.release.1088983873" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.release">
-<option defaultValue="true" id="gnu.cpp.link.mingw.so.release.option.shared.2023092585" name="Shared (-shared)" superClass="gnu.cpp.link.mingw.so.release.option.shared" valueType="boolean"/>
-</tool>
-</toolChain>
-</folderInfo>
-<sourceEntries>
-<entry excluding="pm_cl/|pm_linux/|pm_mac/|pm_test/|porttime/ptlinux.c|porttime/ptmacosx_cf.c|porttime/ptmacosx_mach.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
-</sourceEntries>
-</configuration>
-</storageModule>
-<storageModule moduleId="scannerConfiguration">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.413200248;cdt.managedbuild.config.gnu.mingw.so.release.413200248.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release.343495978;cdt.managedbuild.tool.gnu.c.compiler.input.611335297">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-</scannerConfigBuildInfo>
-<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004;cdt.managedbuild.config.gnu.mingw.so.debug.1580321004.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.428547337;cdt.managedbuild.tool.gnu.c.compiler.input.532732416">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-</scannerConfigBuildInfo>
-</storageModule>
-<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-</cconfiguration>
-</storageModule>
-<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-<project id="PortMidi.cdt.managedbuild.target.gnu.mingw.so.812075522" name="Shared Library" projectType="cdt.managedbuild.target.gnu.mingw.so"/>
-</storageModule>
-</cproject>
diff --git a/3rdparty/portmidi/pm_mingw/eclipse/dot-project b/3rdparty/portmidi/pm_mingw/eclipse/dot-project
deleted file mode 100644
index 57b1a6ab1e0..00000000000
--- a/3rdparty/portmidi/pm_mingw/eclipse/dot-project
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>PortMidi</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
- <triggers>clean,full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>org.eclipse.cdt.make.core.contents</key>
- <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.buildLocation</key>
- <value>${workspace_loc:/PortMidi/Debug}</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableFullBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
- <value>false</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.append_environment</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>?name?</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.stopOnError</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.buildArguments</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.buildCommand</key>
- <value>make</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
- <nature>org.eclipse.cdt.core.cnature</nature>
- </natures>
-</projectDescription>
diff --git a/3rdparty/portmidi/pm_mingw/msys/README-MSYS.txt b/3rdparty/portmidi/pm_mingw/msys/README-MSYS.txt
deleted file mode 100644
index 6f3cd69daa7..00000000000
--- a/3rdparty/portmidi/pm_mingw/msys/README-MSYS.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Old code was removed from this directory because CMake provides an
-up-to-date way to use MinGW. See portmidi/pm_mingw/README-MINGW.txt.
-
-Roger Dannenberg
-20-Sep-2010
-
-
-
diff --git a/3rdparty/portmidi/pm_python/README_PYTHON.txt b/3rdparty/portmidi/pm_python/README_PYTHON.txt
deleted file mode 100644
index b592869f3b9..00000000000
--- a/3rdparty/portmidi/pm_python/README_PYTHON.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-PyPortMidi v0.03 03/15/05
-Python wrappings for PortMidi
-John Harrison
-harrison@media.mit.edu
-
-Modified by Roger B. Dannenberg, Nov 2009
-
-PyPortMidi
-----------
-
-PyPortMidi is a Python wrapper for PortMidi. PortMidi is a cross-platform
-C library for realtime MIDI control. Using PyPortMidi, you can send and
-receive MIDI data in realtime from Python.
-
-Besides using PyPortMidi to communicate to synthesizers and the
-like, it is possible to use PyPortMidi as a way to send MIDI messages
-between software packages on the same computer. For example, Using
-PyPortMidi and MIDI-YOKE on a Windows machine, it is possible to send
-realtime MIDI messages between programs on the same computer using
-loopback virtual MIDI ports. (At this time, MIDI-YOKE does not appear
-to run on Windows Vista.)
-
-PyPortMidi is cross-platform, but it will require some small
-changes in the setup.py file for it to install correctly on Linux
-machines. The changes should be pretty straightforward, and I am
-anxious to work with a Linux user on the port.
-
-PyPortMidi works with Python 2.6 and Python 3.1, although the ports
-are mostly separate because of various language incompatibilities.
-
-Please see README26.txt for information about the Python 2.6 version.
-
-See README31.txt for information about the Python 3.1 version.
-
diff --git a/3rdparty/portmidi/pm_python/pyportmidi/__init__.py b/3rdparty/portmidi/pm_python/pyportmidi/__init__.py
deleted file mode 100644
index 0f3fc4b44cd..00000000000
--- a/3rdparty/portmidi/pm_python/pyportmidi/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-
-from .midi import *
-
diff --git a/3rdparty/portmidi/pm_python/pyportmidi/_pyportmidi.c b/3rdparty/portmidi/pm_python/pyportmidi/_pyportmidi.c
deleted file mode 100644
index 7d700349e18..00000000000
--- a/3rdparty/portmidi/pm_python/pyportmidi/_pyportmidi.c
+++ /dev/null
@@ -1,5663 +0,0 @@
-/* Generated by Cython 0.12.1 on Sun Sep 26 13:30:09 2010 */
-
-#define PY_SSIZE_T_CLEAN
-#include "Python.h"
-#include "structmember.h"
-#ifndef Py_PYTHON_H
- #error Python headers needed to compile C extensions, please install development version of Python.
-#else
-
-#ifndef PY_LONG_LONG
- #define PY_LONG_LONG LONG_LONG
-#endif
-#ifndef DL_EXPORT
- #define DL_EXPORT(t) t
-#endif
-#if PY_VERSION_HEX < 0x02040000
- #define METH_COEXIST 0
- #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
- #define PyDict_Contains(d,o) PySequence_Contains(d,o)
-#endif
-
-#if PY_VERSION_HEX < 0x02050000
- typedef int Py_ssize_t;
- #define PY_SSIZE_T_MAX INT_MAX
- #define PY_SSIZE_T_MIN INT_MIN
- #define PY_FORMAT_SIZE_T ""
- #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
- #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
- #define PyNumber_Index(o) PyNumber_Int(o)
- #define PyIndex_Check(o) PyNumber_Check(o)
- #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-#endif
-
-#if PY_VERSION_HEX < 0x02060000
- #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
- #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
- #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
- #define PyVarObject_HEAD_INIT(type, size) \
- PyObject_HEAD_INIT(type) size,
- #define PyType_Modified(t)
-
- typedef struct {
- void *buf;
- PyObject *obj;
- Py_ssize_t len;
- Py_ssize_t itemsize;
- int readonly;
- int ndim;
- char *format;
- Py_ssize_t *shape;
- Py_ssize_t *strides;
- Py_ssize_t *suboffsets;
- void *internal;
- } Py_buffer;
-
- #define PyBUF_SIMPLE 0
- #define PyBUF_WRITABLE 0x0001
- #define PyBUF_FORMAT 0x0004
- #define PyBUF_ND 0x0008
- #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
- #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
- #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
- #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
- #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-
-#endif
-
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
-#else
- #define __Pyx_BUILTIN_MODULE_NAME "builtins"
-#endif
-
-#if PY_MAJOR_VERSION >= 3
- #define Py_TPFLAGS_CHECKTYPES 0
- #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
- #define Py_TPFLAGS_HAVE_NEWBUFFER 0
-#endif
-
-#if PY_MAJOR_VERSION >= 3
- #define PyBaseString_Type PyUnicode_Type
- #define PyString_Type PyUnicode_Type
- #define PyString_CheckExact PyUnicode_CheckExact
-#else
- #define PyBytes_Type PyString_Type
- #define PyBytes_CheckExact PyString_CheckExact
-#endif
-
-#if PY_MAJOR_VERSION >= 3
- #define PyInt_Type PyLong_Type
- #define PyInt_Check(op) PyLong_Check(op)
- #define PyInt_CheckExact(op) PyLong_CheckExact(op)
- #define PyInt_FromString PyLong_FromString
- #define PyInt_FromUnicode PyLong_FromUnicode
- #define PyInt_FromLong PyLong_FromLong
- #define PyInt_FromSize_t PyLong_FromSize_t
- #define PyInt_FromSsize_t PyLong_FromSsize_t
- #define PyInt_AsLong PyLong_AsLong
- #define PyInt_AS_LONG PyLong_AS_LONG
- #define PyInt_AsSsize_t PyLong_AsSsize_t
- #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
- #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
-#else
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
-
-#endif
-
-#if PY_MAJOR_VERSION >= 3
- #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
-#endif
-
-#if !defined(WIN32) && !defined(MS_WINDOWS)
- #ifndef __stdcall
- #define __stdcall
- #endif
- #ifndef __cdecl
- #define __cdecl
- #endif
- #ifndef __fastcall
- #define __fastcall
- #endif
-#else
- #define _USE_MATH_DEFINES
-#endif
-
-#if PY_VERSION_HEX < 0x02050000
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
-#else
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
-#endif
-
-#if PY_VERSION_HEX < 0x02050000
- #define __Pyx_NAMESTR(n) ((char *)(n))
- #define __Pyx_DOCSTR(n) ((char *)(n))
-#else
- #define __Pyx_NAMESTR(n) (n)
- #define __Pyx_DOCSTR(n) (n)
-#endif
-#ifdef __cplusplus
-#define __PYX_EXTERN_C extern "C"
-#else
-#define __PYX_EXTERN_C extern
-#endif
-#include <math.h>
-#define __PYX_HAVE_API___pyportmidi
-#include "portmidi.h"
-#include "porttime.h"
-
-#ifndef CYTHON_INLINE
- #if defined(__GNUC__)
- #define CYTHON_INLINE __inline__
- #elif defined(_MSC_VER)
- #define CYTHON_INLINE __inline
- #else
- #define CYTHON_INLINE
- #endif
-#endif
-
-typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-
-/* Type Conversion Predeclarations */
-
-#if PY_MAJOR_VERSION < 3
-#define __Pyx_PyBytes_FromString PyString_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize
-#define __Pyx_PyBytes_AsString PyString_AsString
-#else
-#define __Pyx_PyBytes_FromString PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-#define __Pyx_PyBytes_AsString PyBytes_AsString
-#endif
-
-#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s))
-
-#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
-
-#if !defined(T_PYSSIZET)
-#if PY_VERSION_HEX < 0x02050000
-#define T_PYSSIZET T_INT
-#elif !defined(T_LONGLONG)
-#define T_PYSSIZET \
- ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \
- ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
-#else
-#define T_PYSSIZET \
- ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \
- ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \
- ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
-#endif
-#endif
-
-
-#if !defined(T_ULONGLONG)
-#define __Pyx_T_UNSIGNED_INT(x) \
- ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \
- ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
- ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \
- ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1))))
-#else
-#define __Pyx_T_UNSIGNED_INT(x) \
- ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \
- ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
- ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \
- ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \
- ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
-#endif
-#if !defined(T_LONGLONG)
-#define __Pyx_T_SIGNED_INT(x) \
- ((sizeof(x) == sizeof(char)) ? T_BYTE : \
- ((sizeof(x) == sizeof(short)) ? T_SHORT : \
- ((sizeof(x) == sizeof(int)) ? T_INT : \
- ((sizeof(x) == sizeof(long)) ? T_LONG : -1))))
-#else
-#define __Pyx_T_SIGNED_INT(x) \
- ((sizeof(x) == sizeof(char)) ? T_BYTE : \
- ((sizeof(x) == sizeof(short)) ? T_SHORT : \
- ((sizeof(x) == sizeof(int)) ? T_INT : \
- ((sizeof(x) == sizeof(long)) ? T_LONG : \
- ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))))
-#endif
-
-#define __Pyx_T_FLOATING(x) \
- ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
- ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
-
-#if !defined(T_SIZET)
-#if !defined(T_ULONGLONG)
-#define T_SIZET \
- ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \
- ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
-#else
-#define T_SIZET \
- ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \
- ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \
- ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
-#endif
-#endif
-
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
-
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-
-
-#ifdef __GNUC__
-/* Test for GCC > 2.95 */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-#define likely(x) __builtin_expect(!!(x), 1)
-#define unlikely(x) __builtin_expect(!!(x), 0)
-#else /* __GNUC__ > 2 ... */
-#define likely(x) (x)
-#define unlikely(x) (x)
-#endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
-#define likely(x) (x)
-#define unlikely(x) (x)
-#endif /* __GNUC__ */
-
-static PyObject *__pyx_m;
-static PyObject *__pyx_b;
-static PyObject *__pyx_empty_tuple;
-static PyObject *__pyx_empty_bytes;
-static int __pyx_lineno;
-static int __pyx_clineno = 0;
-static const char * __pyx_cfilenm= __FILE__;
-static const char *__pyx_filename;
-static const char **__pyx_f;
-
-
-/* Type declarations */
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":394
- *
- *
- * cdef class Input: # <<<<<<<<<<<<<<
- * """
- * class Input:
- */
-
-struct __pyx_obj_11_pyportmidi_Input {
- PyObject_HEAD
- PmStream *midi;
- int debug;
- int i;
-};
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":201
- * return Pm_Channel(chan-1)
- *
- * cdef class Output: # <<<<<<<<<<<<<<
- * """
- * class Output:
- */
-
-struct __pyx_obj_11_pyportmidi_Output {
- PyObject_HEAD
- int i;
- PmStream *midi;
- int debug;
- int _aborted;
-};
-
-#ifndef CYTHON_REFNANNY
- #define CYTHON_REFNANNY 0
-#endif
-
-#if CYTHON_REFNANNY
- typedef struct {
- void (*INCREF)(void*, PyObject*, int);
- void (*DECREF)(void*, PyObject*, int);
- void (*GOTREF)(void*, PyObject*, int);
- void (*GIVEREF)(void*, PyObject*, int);
- void* (*SetupContext)(const char*, int, const char*);
- void (*FinishContext)(void**);
- } __Pyx_RefNannyAPIStruct;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
- static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
- PyObject *m = NULL, *p = NULL;
- void *r = NULL;
- m = PyImport_ImportModule((char *)modname);
- if (!m) goto end;
- p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
- if (!p) goto end;
- r = PyLong_AsVoidPtr(p);
- end:
- Py_XDECREF(p);
- Py_XDECREF(m);
- return (__Pyx_RefNannyAPIStruct *)r;
- }
- #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
- #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
- #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
-#else
- #define __Pyx_RefNannySetupContext(name)
- #define __Pyx_RefNannyFinishContext()
- #define __Pyx_INCREF(r) Py_INCREF(r)
- #define __Pyx_DECREF(r) Py_DECREF(r)
- #define __Pyx_GOTREF(r)
- #define __Pyx_GIVEREF(r)
- #define __Pyx_XDECREF(r) Py_XDECREF(r)
-#endif /* CYTHON_REFNANNY */
-#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
-#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
-
-static void __Pyx_RaiseDoubleKeywordsError(
- const char* func_name, PyObject* kw_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
- Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
-
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
- PyObject *r;
- if (!j) return NULL;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
- return r;
-}
-
-
-#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
- if (likely(o != Py_None)) {
- if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- PyObject *r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
- PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
- Py_INCREF(r);
- return r;
- }
- }
- return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
-}
-
-#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
- if (likely(o != Py_None)) {
- if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
- PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
- Py_INCREF(r);
- return r;
- }
- }
- return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
-}
-
-
-#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
- PyObject *r;
- if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- }
- else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- }
- else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
- r = PySequence_GetItem(o, i);
- }
- else {
- r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
- }
- return r;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
- if (likely(PyList_CheckExact(L))) {
- if (PyList_Append(L, x) < 0) return NULL;
- Py_INCREF(Py_None);
- return Py_None; /* this is just to have an accurate signature */
- }
- else {
- PyObject *r, *m;
- m = __Pyx_GetAttrString(L, "append");
- if (!m) return NULL;
- r = PyObject_CallFunctionObjArgs(m, x, NULL);
- Py_DECREF(m);
- return r;
- }
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_PmDeviceID(PmDeviceID);
-
-static CYTHON_INLINE PmDeviceID __Pyx_PyInt_from_py_PmDeviceID(PyObject *);
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_PtTimestamp(PtTimestamp);
-
-static int __Pyx_Print(PyObject *, int); /*proto*/
-#if PY_MAJOR_VERSION >= 3
-static PyObject* __pyx_print = 0;
-static PyObject* __pyx_print_kwargs = 0;
-#endif
-
-static int __Pyx_PrintOne(PyObject *o); /*proto*/
-
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_PmMessage(PmMessage);
-
-static CYTHON_INLINE PmMessage __Pyx_PyInt_from_py_PmMessage(PyObject *);
-
-static CYTHON_INLINE PmTimestamp __Pyx_PyInt_from_py_PmTimestamp(PyObject *);
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_PmTimestamp(PmTimestamp);
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-
-static void __Pyx_AddTraceback(const char *funcname); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-/* Module declarations from _pyportmidi */
-
-static PyTypeObject *__pyx_ptype_11_pyportmidi_Output = 0;
-static PyTypeObject *__pyx_ptype_11_pyportmidi_Input = 0;
-#define __Pyx_MODULE_NAME "_pyportmidi"
-int __pyx_module_is_main__pyportmidi = 0;
-
-/* Implementation of _pyportmidi */
-static PyObject *__pyx_builtin_Exception;
-static PyObject *__pyx_builtin_IndexError;
-static PyObject *__pyx_builtin_range;
-static char __pyx_k_1[] = "Opening Midi Output";
-static char __pyx_k_2[] = "Unable to open Midi OutputDevice=";
-static char __pyx_k_3[] = " err=";
-static char __pyx_k_4[] = "Closing MIDI output stream and destroying instance";
-static char __pyx_k_5[] = "midi Output not open.";
-static char __pyx_k_6[] = "midi Output aborted. Need to call Close after Abort.";
-static char __pyx_k_7[] = "maximum list length is 1024";
-static char __pyx_k_8[] = " arguments in event list";
-static char __pyx_k_9[] = " : ";
-static char __pyx_k_10[] = "writing to midi buffer";
-static char __pyx_k_11[] = "Writing to MIDI buffer";
-static char __pyx_k_12[] = "MIDI input opened.";
-static char __pyx_k_13[] = "Closing MIDI input stream and destroying instance";
-static char __pyx_k_14[] = "midi Input not open.";
-static char __pyx_k_15[] = "maximum buffer length is 1024";
-static char __pyx_k_16[] = "minimum buffer length is 1";
-static char __pyx_k_17[] = "0.07";
-static char __pyx_k_18[] = "FILT_CHANNEL_AFTERTOUCH";
-static char __pyx_k_19[] = "FILT_POLY_AFTERTOUCH";
-static char __pyx_k_20[] = "Initialize (line 132)";
-static char __pyx_k_21[] = "Terminate (line 139)";
-static char __pyx_k_22[] = "GetDeviceInfo (line 156)";
-static char __pyx_k_23[] = "Time (line 173)";
-static char __pyx_k_24[] = "GetErrorText (line 180)";
-static char __pyx_k_25[] = "Channel (line 187)";
-static char __pyx_k_26[] = "Output._check_open (line 248)";
-static char __pyx_k_27[] = "Output.Close (line 258)";
-static char __pyx_k_28[] = "Output.Abort (line 274)";
-static char __pyx_k_29[] = "Output.Write (line 293)";
-static char __pyx_k_30[] = "Output.WriteShort (line 333)";
-static char __pyx_k_31[] = "Output.WriteSysEx (line 356)";
-static char __pyx_k_32[] = "Input._check_open (line 422)";
-static char __pyx_k_33[] = "Input.Close (line 430)";
-static char __pyx_k_34[] = "Input.SetFilter (line 447)";
-static char __pyx_k_35[] = "Input.SetChannelMask (line 481)";
-static char __pyx_k_36[] = "Input.Poll (line 502)";
-static char __pyx_k_37[] = "Input.Read (line 514)";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__msg[] = "msg";
-static char __pyx_k__Poll[] = "Poll";
-static char __pyx_k__Read[] = "Read";
-static char __pyx_k__TRUE[] = "TRUE";
-static char __pyx_k__Time[] = "Time";
-static char __pyx_k__midi[] = "midi";
-static char __pyx_k__name[] = "name";
-static char __pyx_k__when[] = "when";
-static char __pyx_k__Abort[] = "Abort";
-static char __pyx_k__Close[] = "Close";
-static char __pyx_k__FALSE[] = "FALSE";
-static char __pyx_k__Input[] = "Input";
-static char __pyx_k__Write[] = "Write";
-static char __pyx_k__array[] = "array";
-static char __pyx_k__data1[] = "data1";
-static char __pyx_k__data2[] = "data2";
-static char __pyx_k__debug[] = "debug";
-static char __pyx_k__input[] = "input";
-static char __pyx_k__range[] = "range";
-static char __pyx_k__Output[] = "Output";
-static char __pyx_k__interf[] = "interf";
-static char __pyx_k__opened[] = "opened";
-static char __pyx_k__output[] = "output";
-static char __pyx_k__status[] = "status";
-static char __pyx_k__Channel[] = "Channel";
-static char __pyx_k__FILT_F9[] = "FILT_F9";
-static char __pyx_k__FILT_FD[] = "FILT_FD";
-static char __pyx_k__latency[] = "latency";
-static char __pyx_k__message[] = "message";
-static char __pyx_k__FILT_MTC[] = "FILT_MTC";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k___aborted[] = "_aborted";
-static char __pyx_k__tostring[] = "tostring";
-static char __pyx_k__Exception[] = "Exception";
-static char __pyx_k__FILT_NOTE[] = "FILT_NOTE";
-static char __pyx_k__FILT_PLAY[] = "FILT_PLAY";
-static char __pyx_k__FILT_TICK[] = "FILT_TICK";
-static char __pyx_k__FILT_TUNE[] = "FILT_TUNE";
-static char __pyx_k__SetFilter[] = "SetFilter";
-static char __pyx_k__Terminate[] = "Terminate";
-static char __pyx_k__timestamp[] = "timestamp";
-static char __pyx_k__FILT_CLOCK[] = "FILT_CLOCK";
-static char __pyx_k__FILT_RESET[] = "FILT_RESET";
-static char __pyx_k__FILT_SYSEX[] = "FILT_SYSEX";
-static char __pyx_k__IndexError[] = "IndexError";
-static char __pyx_k__Initialize[] = "Initialize";
-static char __pyx_k__WriteShort[] = "WriteShort";
-static char __pyx_k__WriteSysEx[] = "WriteSysEx";
-static char __pyx_k__buffersize[] = "buffersize";
-static char __pyx_k__FILT_ACTIVE[] = "FILT_ACTIVE";
-static char __pyx_k__InputDevice[] = "InputDevice";
-static char __pyx_k____version__[] = "__version__";
-static char __pyx_k___check_open[] = "_check_open";
-static char __pyx_k__FILT_CONTROL[] = "FILT_CONTROL";
-static char __pyx_k__FILT_PROGRAM[] = "FILT_PROGRAM";
-static char __pyx_k__GetErrorText[] = "GetErrorText";
-static char __pyx_k__OutputDevice[] = "OutputDevice";
-static char __pyx_k__FILT_REALTIME[] = "FILT_REALTIME";
-static char __pyx_k__GetDeviceInfo[] = "GetDeviceInfo";
-static char __pyx_k__FILT_PITCHBEND[] = "FILT_PITCHBEND";
-static char __pyx_k__FILT_UNDEFINED[] = "FILT_UNDEFINED";
-static char __pyx_k__SetChannelMask[] = "SetChannelMask";
-static char __pyx_k__FILT_AFTERTOUCH[] = "FILT_AFTERTOUCH";
-static char __pyx_k__FILT_SONG_SELECT[] = "FILT_SONG_SELECT";
-static char __pyx_k__FILT_SONG_POSITION[] = "FILT_SONG_POSITION";
-static PyObject *__pyx_kp_s_1;
-static PyObject *__pyx_kp_s_10;
-static PyObject *__pyx_kp_s_11;
-static PyObject *__pyx_kp_s_12;
-static PyObject *__pyx_kp_s_13;
-static PyObject *__pyx_kp_s_14;
-static PyObject *__pyx_kp_s_15;
-static PyObject *__pyx_kp_s_16;
-static PyObject *__pyx_kp_s_17;
-static PyObject *__pyx_n_s_18;
-static PyObject *__pyx_n_s_19;
-static PyObject *__pyx_kp_s_2;
-static PyObject *__pyx_kp_u_20;
-static PyObject *__pyx_kp_u_21;
-static PyObject *__pyx_kp_u_22;
-static PyObject *__pyx_kp_u_23;
-static PyObject *__pyx_kp_u_24;
-static PyObject *__pyx_kp_u_25;
-static PyObject *__pyx_kp_u_26;
-static PyObject *__pyx_kp_u_27;
-static PyObject *__pyx_kp_u_28;
-static PyObject *__pyx_kp_u_29;
-static PyObject *__pyx_kp_s_3;
-static PyObject *__pyx_kp_u_30;
-static PyObject *__pyx_kp_u_31;
-static PyObject *__pyx_kp_u_32;
-static PyObject *__pyx_kp_u_33;
-static PyObject *__pyx_kp_u_34;
-static PyObject *__pyx_kp_u_35;
-static PyObject *__pyx_kp_u_36;
-static PyObject *__pyx_kp_u_37;
-static PyObject *__pyx_kp_s_4;
-static PyObject *__pyx_kp_s_5;
-static PyObject *__pyx_kp_s_6;
-static PyObject *__pyx_kp_s_7;
-static PyObject *__pyx_kp_s_8;
-static PyObject *__pyx_kp_s_9;
-static PyObject *__pyx_n_s__Abort;
-static PyObject *__pyx_n_s__B;
-static PyObject *__pyx_n_s__Channel;
-static PyObject *__pyx_n_s__Close;
-static PyObject *__pyx_n_s__Exception;
-static PyObject *__pyx_n_s__FALSE;
-static PyObject *__pyx_n_s__FILT_ACTIVE;
-static PyObject *__pyx_n_s__FILT_AFTERTOUCH;
-static PyObject *__pyx_n_s__FILT_CLOCK;
-static PyObject *__pyx_n_s__FILT_CONTROL;
-static PyObject *__pyx_n_s__FILT_F9;
-static PyObject *__pyx_n_s__FILT_FD;
-static PyObject *__pyx_n_s__FILT_MTC;
-static PyObject *__pyx_n_s__FILT_NOTE;
-static PyObject *__pyx_n_s__FILT_PITCHBEND;
-static PyObject *__pyx_n_s__FILT_PLAY;
-static PyObject *__pyx_n_s__FILT_PROGRAM;
-static PyObject *__pyx_n_s__FILT_REALTIME;
-static PyObject *__pyx_n_s__FILT_RESET;
-static PyObject *__pyx_n_s__FILT_SONG_POSITION;
-static PyObject *__pyx_n_s__FILT_SONG_SELECT;
-static PyObject *__pyx_n_s__FILT_SYSEX;
-static PyObject *__pyx_n_s__FILT_TICK;
-static PyObject *__pyx_n_s__FILT_TUNE;
-static PyObject *__pyx_n_s__FILT_UNDEFINED;
-static PyObject *__pyx_n_s__GetDeviceInfo;
-static PyObject *__pyx_n_s__GetErrorText;
-static PyObject *__pyx_n_s__IndexError;
-static PyObject *__pyx_n_s__Initialize;
-static PyObject *__pyx_n_s__Input;
-static PyObject *__pyx_n_s__InputDevice;
-static PyObject *__pyx_n_s__Output;
-static PyObject *__pyx_n_s__OutputDevice;
-static PyObject *__pyx_n_s__Poll;
-static PyObject *__pyx_n_s__Read;
-static PyObject *__pyx_n_s__SetChannelMask;
-static PyObject *__pyx_n_s__SetFilter;
-static PyObject *__pyx_n_s__TRUE;
-static PyObject *__pyx_n_s__Terminate;
-static PyObject *__pyx_n_s__Time;
-static PyObject *__pyx_n_s__Write;
-static PyObject *__pyx_n_s__WriteShort;
-static PyObject *__pyx_n_s__WriteSysEx;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s____version__;
-static PyObject *__pyx_n_s___aborted;
-static PyObject *__pyx_n_s___check_open;
-static PyObject *__pyx_n_s__array;
-static PyObject *__pyx_n_s__buffersize;
-static PyObject *__pyx_n_s__data1;
-static PyObject *__pyx_n_s__data2;
-static PyObject *__pyx_n_s__debug;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__input;
-static PyObject *__pyx_n_s__interf;
-static PyObject *__pyx_n_s__latency;
-static PyObject *__pyx_n_s__message;
-static PyObject *__pyx_n_s__midi;
-static PyObject *__pyx_n_s__msg;
-static PyObject *__pyx_n_s__name;
-static PyObject *__pyx_n_s__opened;
-static PyObject *__pyx_n_s__output;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__status;
-static PyObject *__pyx_n_s__timestamp;
-static PyObject *__pyx_n_s__tostring;
-static PyObject *__pyx_n_s__when;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_8;
-static PyObject *__pyx_int_16;
-static PyObject *__pyx_int_0x1;
-static PyObject *__pyx_int_0x2;
-static PyObject *__pyx_int_0x4;
-static PyObject *__pyx_int_0x8;
-static PyObject *__pyx_int_0x10;
-static PyObject *__pyx_int_0x20;
-static PyObject *__pyx_int_0x30;
-static PyObject *__pyx_int_0x40;
-static PyObject *__pyx_int_0x7F;
-static PyObject *__pyx_int_0x80;
-static PyObject *__pyx_int_0xFF;
-static PyObject *__pyx_int_1024;
-static PyObject *__pyx_int_4096;
-static PyObject *__pyx_int_0x100;
-static PyObject *__pyx_int_0x200;
-static PyObject *__pyx_int_0x300;
-static PyObject *__pyx_int_0x400;
-static PyObject *__pyx_int_0x800;
-static PyObject *__pyx_int_0x1000;
-static PyObject *__pyx_int_0x2000;
-static PyObject *__pyx_int_0x4000;
-static PyObject *__pyx_int_0x8000;
-static PyObject *__pyx_int_0xFF00;
-static PyObject *__pyx_int_0x10000;
-static PyObject *__pyx_int_0xFF0000;
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":132
- * TRUE=1
- *
- * def Initialize(): # <<<<<<<<<<<<<<
- * """
- * Initialize: call this first
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_Initialize(PyObject *__pyx_self, PyObject *unused); /*proto*/
-static char __pyx_doc_11_pyportmidi_Initialize[] = "\nInitialize: call this first\n ";
-static PyObject *__pyx_pf_11_pyportmidi_Initialize(PyObject *__pyx_self, PyObject *unused) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannySetupContext("Initialize");
- __pyx_self = __pyx_self;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":136
- * Initialize: call this first
- * """
- * Pm_Initialize() # <<<<<<<<<<<<<<
- * Pt_Start(1, NULL, NULL) # /[inserted by cython to avoid comment start]* equiv to TIME_START: start timer w/ ms accuracy *[inserted by cython to avoid comment closer]/
- *
- */
- Pm_Initialize();
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":137
- * """
- * Pm_Initialize()
- * Pt_Start(1, NULL, NULL) # /[inserted by cython to avoid comment start]* equiv to TIME_START: start timer w/ ms accuracy *[inserted by cython to avoid comment closer]/ # <<<<<<<<<<<<<<
- *
- * def Terminate():
- */
- Pt_Start(1, NULL, NULL);
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":139
- * Pt_Start(1, NULL, NULL) # /[inserted by cython to avoid comment start]* equiv to TIME_START: start timer w/ ms accuracy *[inserted by cython to avoid comment closer]/
- *
- * def Terminate(): # <<<<<<<<<<<<<<
- * """
- * Terminate: call this to clean up Midi streams when done.
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_Terminate(PyObject *__pyx_self, PyObject *unused); /*proto*/
-static char __pyx_doc_11_pyportmidi_Terminate[] = "\nTerminate: call this to clean up Midi streams when done.\nIf you do not call this on Windows machines when you are\ndone with MIDI, your system may crash.\n ";
-static PyObject *__pyx_pf_11_pyportmidi_Terminate(PyObject *__pyx_self, PyObject *unused) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannySetupContext("Terminate");
- __pyx_self = __pyx_self;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":145
- * done with MIDI, your system may crash.
- * """
- * Pm_Terminate() # <<<<<<<<<<<<<<
- *
- * def GetDefaultInputDeviceID():
- */
- Pm_Terminate();
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":147
- * Pm_Terminate()
- *
- * def GetDefaultInputDeviceID(): # <<<<<<<<<<<<<<
- * return Pm_GetDefaultInputDeviceID()
- *
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_GetDefaultInputDeviceID(PyObject *__pyx_self, PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_11_pyportmidi_GetDefaultInputDeviceID(PyObject *__pyx_self, PyObject *unused) {
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("GetDefaultInputDeviceID");
- __pyx_self = __pyx_self;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":148
- *
- * def GetDefaultInputDeviceID():
- * return Pm_GetDefaultInputDeviceID() # <<<<<<<<<<<<<<
- *
- * def GetDefaultOutputDeviceID():
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_to_py_PmDeviceID(Pm_GetDefaultInputDeviceID()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("_pyportmidi.GetDefaultInputDeviceID");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":150
- * return Pm_GetDefaultInputDeviceID()
- *
- * def GetDefaultOutputDeviceID(): # <<<<<<<<<<<<<<
- * return Pm_GetDefaultOutputDeviceID()
- *
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_GetDefaultOutputDeviceID(PyObject *__pyx_self, PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_11_pyportmidi_GetDefaultOutputDeviceID(PyObject *__pyx_self, PyObject *unused) {
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("GetDefaultOutputDeviceID");
- __pyx_self = __pyx_self;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":151
- *
- * def GetDefaultOutputDeviceID():
- * return Pm_GetDefaultOutputDeviceID() # <<<<<<<<<<<<<<
- *
- * def CountDevices():
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_to_py_PmDeviceID(Pm_GetDefaultOutputDeviceID()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("_pyportmidi.GetDefaultOutputDeviceID");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":153
- * return Pm_GetDefaultOutputDeviceID()
- *
- * def CountDevices(): # <<<<<<<<<<<<<<
- * return Pm_CountDevices()
- *
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_CountDevices(PyObject *__pyx_self, PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_11_pyportmidi_CountDevices(PyObject *__pyx_self, PyObject *unused) {
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("CountDevices");
- __pyx_self = __pyx_self;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":154
- *
- * def CountDevices():
- * return Pm_CountDevices() # <<<<<<<<<<<<<<
- *
- * def GetDeviceInfo(i):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(Pm_CountDevices()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("_pyportmidi.CountDevices");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":156
- * return Pm_CountDevices()
- *
- * def GetDeviceInfo(i): # <<<<<<<<<<<<<<
- * """
- * GetDeviceInfo(<device number>): returns 5 parameters
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_GetDeviceInfo(PyObject *__pyx_self, PyObject *__pyx_v_i); /*proto*/
-static char __pyx_doc_11_pyportmidi_GetDeviceInfo[] = "\nGetDeviceInfo(<device number>): returns 5 parameters\n - underlying MIDI API\n - device name\n - TRUE iff input is available\n - TRUE iff output is available\n - TRUE iff device stream is already open\n ";
-static PyObject *__pyx_pf_11_pyportmidi_GetDeviceInfo(PyObject *__pyx_self, PyObject *__pyx_v_i) {
- PmDeviceInfo *__pyx_v_info;
- PyObject *__pyx_r = NULL;
- PmDeviceID __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- __Pyx_RefNannySetupContext("GetDeviceInfo");
- __pyx_self = __pyx_self;
- __Pyx_INCREF(__pyx_v_i);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":168
- *
- * # disregarding the constness from Pm_GetDeviceInfo, since pyrex doesn't do const.
- * info = <PmDeviceInfo *>Pm_GetDeviceInfo(i) # <<<<<<<<<<<<<<
- *
- * if info <> NULL: return info.interf, info.name, info.input, info.output, info.opened
- */
- __pyx_t_1 = __Pyx_PyInt_from_py_PmDeviceID(__pyx_v_i); if (unlikely((__pyx_t_1 == (PmDeviceID)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_info = ((PmDeviceInfo *)Pm_GetDeviceInfo(__pyx_t_1));
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":170
- * info = <PmDeviceInfo *>Pm_GetDeviceInfo(i)
- *
- * if info <> NULL: return info.interf, info.name, info.input, info.output, info.opened # <<<<<<<<<<<<<<
- * else: return
- *
- */
- __pyx_t_2 = (__pyx_v_info != NULL);
- if (__pyx_t_2) {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_info->interf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_info->name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_5 = PyInt_FromLong(__pyx_v_info->input); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyInt_FromLong(__pyx_v_info->output); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyInt_FromLong(__pyx_v_info->opened); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_t_4));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_r = __pyx_t_8;
- __pyx_t_8 = 0;
- goto __pyx_L0;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":171
- *
- * if info <> NULL: return info.interf, info.name, info.input, info.output, info.opened
- * else: return # <<<<<<<<<<<<<<
- *
- * def Time():
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- }
- __pyx_L5:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("_pyportmidi.GetDeviceInfo");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF(__pyx_v_i);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":173
- * else: return
- *
- * def Time(): # <<<<<<<<<<<<<<
- * """
- * Time() returns the current time in ms
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_Time(PyObject *__pyx_self, PyObject *unused); /*proto*/
-static char __pyx_doc_11_pyportmidi_Time[] = "\nTime() returns the current time in ms\nof the PortMidi timer\n ";
-static PyObject *__pyx_pf_11_pyportmidi_Time(PyObject *__pyx_self, PyObject *unused) {
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("Time");
- __pyx_self = __pyx_self;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":178
- * of the PortMidi timer
- * """
- * return Pt_Time() # <<<<<<<<<<<<<<
- *
- * def GetErrorText(err):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_to_py_PtTimestamp(Pt_Time()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("_pyportmidi.Time");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":180
- * return Pt_Time()
- *
- * def GetErrorText(err): # <<<<<<<<<<<<<<
- * """
- * GetErrorText(<err num>) returns human-readable error
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_GetErrorText(PyObject *__pyx_self, PyObject *__pyx_v_err); /*proto*/
-static char __pyx_doc_11_pyportmidi_GetErrorText[] = "\nGetErrorText(<err num>) returns human-readable error\nmessages translated from error numbers\n ";
-static PyObject *__pyx_pf_11_pyportmidi_GetErrorText(PyObject *__pyx_self, PyObject *__pyx_v_err) {
- PyObject *__pyx_r = NULL;
- PmError __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- __Pyx_RefNannySetupContext("GetErrorText");
- __pyx_self = __pyx_self;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":185
- * messages translated from error numbers
- * """
- * return Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- *
- * def Channel(chan):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((PmError)PyInt_AsLong(__pyx_v_err)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_r = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("_pyportmidi.GetErrorText");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":187
- * return Pm_GetErrorText(err)
- *
- * def Channel(chan): # <<<<<<<<<<<<<<
- * """
- * Channel(<chan>) is used with ChannelMask on input MIDI streams.
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_Channel(PyObject *__pyx_self, PyObject *__pyx_v_chan); /*proto*/
-static char __pyx_doc_11_pyportmidi_Channel[] = "\nChannel(<chan>) is used with ChannelMask on input MIDI streams.\nExample: to receive input on channels 1 and 10 on a MIDI\n stream called MidiIn:\nMidiIn.SetChannelMask(pypm.Channel(1) | pypm.Channel(10))\n\nnote: PyPortMidi Channel function has been altered from\n the original PortMidi c call to correct for what\n seems to be a bug --- i.e. channel filters were\n all numbered from 0 to 15 instead of 1 to 16.\n ";
-static PyObject *__pyx_pf_11_pyportmidi_Channel(PyObject *__pyx_self, PyObject *__pyx_v_chan) {
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- __Pyx_RefNannySetupContext("Channel");
- __pyx_self = __pyx_self;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":199
- * all numbered from 0 to 15 instead of 1 to 16.
- * """
- * return Pm_Channel(chan-1) # <<<<<<<<<<<<<<
- *
- * cdef class Output:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyNumber_Subtract(__pyx_v_chan, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(Pm_Channel(__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("_pyportmidi.Channel");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":214
- * cdef int _aborted
- *
- * def __init__(self, OutputDevice, latency=0): # <<<<<<<<<<<<<<
- *
- * cdef PmError err
- */
-
-static int __pyx_pf_11_pyportmidi_6Output___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pf_11_pyportmidi_6Output___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_OutputDevice = 0;
- PyObject *__pyx_v_latency = 0;
- PmError __pyx_v_err;
- PmTimeProcPtr __pyx_v_PmPtr;
- PyObject *__pyx_v_s;
- int __pyx_r;
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- long __pyx_t_4;
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__OutputDevice,&__pyx_n_s__latency,0};
- __Pyx_RefNannySetupContext("__init__");
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
- PyObject* values[2] = {0,0};
- values[1] = ((PyObject *)__pyx_int_0);
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 0:
- values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__OutputDevice);
- if (likely(values[0])) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 1) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__latency);
- if (unlikely(value)) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- __pyx_v_OutputDevice = values[0];
- __pyx_v_latency = values[1];
- } else {
- __pyx_v_latency = ((PyObject *)__pyx_int_0);
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: __pyx_v_latency = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: __pyx_v_OutputDevice = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("_pyportmidi.Output.__init__");
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_INCREF(__pyx_v_OutputDevice);
- __Pyx_INCREF(__pyx_v_latency);
- __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":220
- * cdef PmTimeProcPtr PmPtr
- *
- * self.i = OutputDevice # <<<<<<<<<<<<<<
- * self.debug = 0
- * self._aborted = 0
- */
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_OutputDevice); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->i = __pyx_t_1;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":221
- *
- * self.i = OutputDevice
- * self.debug = 0 # <<<<<<<<<<<<<<
- * self._aborted = 0
- *
- */
- ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->debug = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":222
- * self.i = OutputDevice
- * self.debug = 0
- * self._aborted = 0 # <<<<<<<<<<<<<<
- *
- * if latency == 0:
- */
- ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->_aborted = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":224
- * self._aborted = 0
- *
- * if latency == 0: # <<<<<<<<<<<<<<
- * PmPtr = NULL
- * else:
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_latency, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_3) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":225
- *
- * if latency == 0:
- * PmPtr = NULL # <<<<<<<<<<<<<<
- * else:
- * PmPtr = <PmTimeProcPtr>&Pt_Time
- */
- __pyx_v_PmPtr = NULL;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":227
- * PmPtr = NULL
- * else:
- * PmPtr = <PmTimeProcPtr>&Pt_Time # <<<<<<<<<<<<<<
- * if self.debug: print "Opening Midi Output"
- * # Why is bufferSize 0 here?
- */
- __pyx_v_PmPtr = ((PmTimestamp (*)(void *))(&Pt_Time));
- }
- __pyx_L6:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":228
- * else:
- * PmPtr = <PmTimeProcPtr>&Pt_Time
- * if self.debug: print "Opening Midi Output" # <<<<<<<<<<<<<<
- * # Why is bufferSize 0 here?
- * err = Pm_OpenOutput(&(self.midi), self.i, NULL, 0, PmPtr, NULL, latency)
- */
- __pyx_t_1 = ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->debug;
- if (__pyx_t_1) {
- if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":230
- * if self.debug: print "Opening Midi Output"
- * # Why is bufferSize 0 here?
- * err = Pm_OpenOutput(&(self.midi), self.i, NULL, 0, PmPtr, NULL, latency) # <<<<<<<<<<<<<<
- * if err < 0:
- * s = Pm_GetErrorText(err)
- */
- __pyx_t_4 = __Pyx_PyInt_AsLong(__pyx_v_latency); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_err = Pm_OpenOutput((&((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->midi), ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->i, NULL, 0, __pyx_v_PmPtr, NULL, __pyx_t_4);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":231
- * # Why is bufferSize 0 here?
- * err = Pm_OpenOutput(&(self.midi), self.i, NULL, 0, PmPtr, NULL, latency)
- * if err < 0: # <<<<<<<<<<<<<<
- * s = Pm_GetErrorText(err)
- * # Something's amiss here - if we try to throw an Exception
- */
- __pyx_t_3 = (__pyx_v_err < 0);
- if (__pyx_t_3) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":232
- * err = Pm_OpenOutput(&(self.midi), self.i, NULL, 0, PmPtr, NULL, latency)
- * if err < 0:
- * s = Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- * # Something's amiss here - if we try to throw an Exception
- * # here, we crash.
- */
- __pyx_t_2 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_DECREF(__pyx_v_s);
- __pyx_v_s = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":235
- * # Something's amiss here - if we try to throw an Exception
- * # here, we crash.
- * if not err == -10000: # <<<<<<<<<<<<<<
- * raise Exception,s
- * else:
- */
- __pyx_t_3 = (!(__pyx_v_err == -10000));
- if (__pyx_t_3) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":236
- * # here, we crash.
- * if not err == -10000:
- * raise Exception,s # <<<<<<<<<<<<<<
- * else:
- * print "Unable to open Midi OutputDevice=",OutputDevice," err=",s
- */
- __Pyx_Raise(__pyx_builtin_Exception, __pyx_v_s, 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L9;
- }
- /*else*/ {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":238
- * raise Exception,s
- * else:
- * print "Unable to open Midi OutputDevice=",OutputDevice," err=",s # <<<<<<<<<<<<<<
- *
- * def __dealloc__(self):
- */
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
- __Pyx_INCREF(__pyx_v_OutputDevice);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_OutputDevice);
- __Pyx_GIVEREF(__pyx_v_OutputDevice);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
- PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_kp_s_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
- __Pyx_INCREF(__pyx_v_s);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_s);
- __Pyx_GIVEREF(__pyx_v_s);
- if (__Pyx_Print(__pyx_t_2, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- __pyx_L9:;
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("_pyportmidi.Output.__init__");
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_DECREF(__pyx_v_s);
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_DECREF(__pyx_v_OutputDevice);
- __Pyx_DECREF(__pyx_v_latency);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":240
- * print "Unable to open Midi OutputDevice=",OutputDevice," err=",s
- *
- * def __dealloc__(self): # <<<<<<<<<<<<<<
- * if self.debug: print "Closing MIDI output stream and destroying instance"
- * #err = Pm_Abort(self.midi)
- */
-
-static void __pyx_pf_11_pyportmidi_6Output___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pf_11_pyportmidi_6Output___dealloc__(PyObject *__pyx_v_self) {
- PyObject *__pyx_v_err;
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- PmError __pyx_t_4;
- __Pyx_RefNannySetupContext("__dealloc__");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __pyx_v_err = Py_None; __Pyx_INCREF(Py_None);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":241
- *
- * def __dealloc__(self):
- * if self.debug: print "Closing MIDI output stream and destroying instance" # <<<<<<<<<<<<<<
- * #err = Pm_Abort(self.midi)
- * #if err < 0: raise Exception, Pm_GetErrorText(err)
- */
- __pyx_t_1 = ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->debug;
- if (__pyx_t_1) {
- if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":244
- * #err = Pm_Abort(self.midi)
- * #if err < 0: raise Exception, Pm_GetErrorText(err)
- * err = Pm_Close(self.midi) # <<<<<<<<<<<<<<
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- *
- */
- __pyx_t_2 = PyInt_FromLong(Pm_Close(((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->midi)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_v_err);
- __pyx_v_err = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":245
- * #if err < 0: raise Exception, Pm_GetErrorText(err)
- * err = Pm_Close(self.midi)
- * if err < 0: raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_err, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_3) {
- __pyx_t_4 = ((PmError)PyInt_AsLong(__pyx_v_err)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("_pyportmidi.Output.__dealloc__");
- __pyx_L0:;
- __Pyx_DECREF(__pyx_v_err);
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_RefNannyFinishContext();
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":248
- *
- *
- * def _check_open(self): # <<<<<<<<<<<<<<
- * """ checks to see if the midi is open, and if not, raises an error.
- * """
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_6Output__check_open(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static char __pyx_doc_11_pyportmidi_6Output__check_open[] = " checks to see if the midi is open, and if not, raises an error.\n ";
-static PyObject *__pyx_pf_11_pyportmidi_6Output__check_open(PyObject *__pyx_v_self, PyObject *unused) {
- PyObject *__pyx_r = NULL;
- int __pyx_t_1;
- int __pyx_t_2;
- __Pyx_RefNannySetupContext("_check_open");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":252
- * """
- *
- * if self.midi == NULL: # <<<<<<<<<<<<<<
- * raise Exception, "midi Output not open."
- *
- */
- __pyx_t_1 = (((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->midi == NULL);
- if (__pyx_t_1) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":253
- *
- * if self.midi == NULL:
- * raise Exception, "midi Output not open." # <<<<<<<<<<<<<<
- *
- * if self._aborted:
- */
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_kp_s_5), 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":255
- * raise Exception, "midi Output not open."
- *
- * if self._aborted: # <<<<<<<<<<<<<<
- * raise Exception, "midi Output aborted. Need to call Close after Abort."
- *
- */
- __pyx_t_2 = ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->_aborted;
- if (__pyx_t_2) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":256
- *
- * if self._aborted:
- * raise Exception, "midi Output aborted. Need to call Close after Abort." # <<<<<<<<<<<<<<
- *
- * def Close(self):
- */
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_kp_s_6), 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_AddTraceback("_pyportmidi.Output._check_open");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":258
- * raise Exception, "midi Output aborted. Need to call Close after Abort."
- *
- * def Close(self): # <<<<<<<<<<<<<<
- * """
- * Close()
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_6Output_Close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static char __pyx_doc_11_pyportmidi_6Output_Close[] = "\nClose()\n closes a midi stream, flushing any pending buffers.\n (PortMidi attempts to close open streams when the application\n exits -- this is particularly difficult under Windows.)\n ";
-static PyObject *__pyx_pf_11_pyportmidi_6Output_Close(PyObject *__pyx_v_self, PyObject *unused) {
- PyObject *__pyx_v_err;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PmError __pyx_t_3;
- __Pyx_RefNannySetupContext("Close");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __pyx_v_err = Py_None; __Pyx_INCREF(Py_None);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":268
- * # return
- *
- * err = Pm_Close(self.midi) # <<<<<<<<<<<<<<
- * if err < 0:
- * raise Exception, Pm_GetErrorText(err)
- */
- __pyx_t_1 = PyInt_FromLong(Pm_Close(((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->midi)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_v_err);
- __pyx_v_err = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":269
- *
- * err = Pm_Close(self.midi)
- * if err < 0: # <<<<<<<<<<<<<<
- * raise Exception, Pm_GetErrorText(err)
- * #self.midi = NULL
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_err, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":270
- * err = Pm_Close(self.midi)
- * if err < 0:
- * raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- * #self.midi = NULL
- *
- */
- __pyx_t_3 = ((PmError)PyInt_AsLong(__pyx_v_err)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_1), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("_pyportmidi.Output.Close");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF(__pyx_v_err);
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":274
- *
- *
- * def Abort(self): # <<<<<<<<<<<<<<
- * """
- * Abort() terminates outgoing messages immediately
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_6Output_Abort(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static char __pyx_doc_11_pyportmidi_6Output_Abort[] = "\nAbort() terminates outgoing messages immediately\n The caller should immediately close the output port;\n this call may result in transmission of a partial midi message.\n There is no abort for Midi input because the user can simply\n ignore messages in the buffer and close an input device at\n any time.\n ";
-static PyObject *__pyx_pf_11_pyportmidi_6Output_Abort(PyObject *__pyx_v_self, PyObject *unused) {
- PyObject *__pyx_v_err;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PmError __pyx_t_3;
- __Pyx_RefNannySetupContext("Abort");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __pyx_v_err = Py_None; __Pyx_INCREF(Py_None);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":286
- * # return
- *
- * err = Pm_Abort(self.midi) # <<<<<<<<<<<<<<
- * if err < 0:
- * raise Exception, Pm_GetErrorText(err)
- */
- __pyx_t_1 = PyInt_FromLong(Pm_Abort(((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->midi)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_v_err);
- __pyx_v_err = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":287
- *
- * err = Pm_Abort(self.midi)
- * if err < 0: # <<<<<<<<<<<<<<
- * raise Exception, Pm_GetErrorText(err)
- *
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_err, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":288
- * err = Pm_Abort(self.midi)
- * if err < 0:
- * raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- *
- * self._aborted = 1
- */
- __pyx_t_3 = ((PmError)PyInt_AsLong(__pyx_v_err)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_1), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":290
- * raise Exception, Pm_GetErrorText(err)
- *
- * self._aborted = 1 # <<<<<<<<<<<<<<
- *
- *
- */
- ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->_aborted = 1;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("_pyportmidi.Output.Abort");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF(__pyx_v_err);
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":293
- *
- *
- * def Write(self, data): # <<<<<<<<<<<<<<
- * """
- * Write(data)
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_6Output_Write(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
-static char __pyx_doc_11_pyportmidi_6Output_Write[] = "\nWrite(data)\n output a series of MIDI information in the form of a list:\n Write([[[status <,data1><,data2><,data3>],timestamp],\n [[status <,data1><,data2><,data3>],timestamp],...])\n <data> fields are optional\n example: choose program change 1 at time 20000 and\n send note 65 with velocity 100 500 ms later.\n Write([[[0xc0,0,0],20000],[[0x90,60,100],20500]])\n notes:\n 1. timestamps will be ignored if latency = 0.\n 2. To get a note to play immediately, send MIDI info with\n timestamp read from function Time.\n 3. understanding optional data fields:\n Write([[[0xc0,0,0],20000]]) is equivalent to\n Write([[[0xc0],20000]])\n ";
-static PyObject *__pyx_pf_11_pyportmidi_6Output_Write(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
- PmEvent __pyx_v_buffer[1024];
- PmError __pyx_v_err;
- int __pyx_v_i;
- PyObject *__pyx_v_loop1;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- int __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
- int __pyx_t_8;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PmMessage __pyx_t_11;
- PmTimestamp __pyx_t_12;
- __Pyx_RefNannySetupContext("Write");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_INCREF(__pyx_v_data);
- __pyx_v_loop1 = Py_None; __Pyx_INCREF(Py_None);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":315
- * cdef int i
- *
- * self._check_open() # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":318
- *
- *
- * if len(data) > 1024: raise IndexError, 'maximum list length is 1024' # <<<<<<<<<<<<<<
- * else:
- * for loop1 in range(len(data)):
- */
- __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = (__pyx_t_3 > 1024);
- if (__pyx_t_4) {
- __Pyx_Raise(__pyx_builtin_IndexError, ((PyObject *)__pyx_kp_s_7), 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":320
- * if len(data) > 1024: raise IndexError, 'maximum list length is 1024'
- * else:
- * for loop1 in range(len(data)): # <<<<<<<<<<<<<<
- * if ((len(data[loop1][0]) > 4) |
- * (len(data[loop1][0]) < 1)):
- */
- __pyx_t_5 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
- __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
- } else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- for (;;) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
- } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
- } else {
- __pyx_t_2 = PyIter_Next(__pyx_t_1);
- if (!__pyx_t_2) {
- if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- break;
- }
- __Pyx_GOTREF(__pyx_t_2);
- }
- __Pyx_DECREF(__pyx_v_loop1);
- __pyx_v_loop1 = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":321
- * else:
- * for loop1 in range(len(data)):
- * if ((len(data[loop1][0]) > 4) | # <<<<<<<<<<<<<<
- * (len(data[loop1][0]) < 1)):
- * raise IndexError, str(len(data[loop1][0]))+' arguments in event list'
- */
- __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_v_loop1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":322
- * for loop1 in range(len(data)):
- * if ((len(data[loop1][0]) > 4) |
- * (len(data[loop1][0]) < 1)): # <<<<<<<<<<<<<<
- * raise IndexError, str(len(data[loop1][0]))+' arguments in event list'
- * buffer[loop1].message = 0
- */
- __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_v_loop1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = ((__pyx_t_5 > 4) | (__pyx_t_7 < 1));
- if (__pyx_t_4) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":323
- * if ((len(data[loop1][0]) > 4) |
- * (len(data[loop1][0]) < 1)):
- * raise IndexError, str(len(data[loop1][0]))+' arguments in event list' # <<<<<<<<<<<<<<
- * buffer[loop1].message = 0
- * for i in range(len(data[loop1][0])):
- */
- __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_v_loop1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_6, ((PyObject *)__pyx_kp_s_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_2, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":324
- * (len(data[loop1][0]) < 1)):
- * raise IndexError, str(len(data[loop1][0]))+' arguments in event list'
- * buffer[loop1].message = 0 # <<<<<<<<<<<<<<
- * for i in range(len(data[loop1][0])):
- * buffer[loop1].message = buffer[loop1].message + ((data[loop1][0][i]&0xFF) << (8*i))
- */
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop1); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- (__pyx_v_buffer[__pyx_t_7]).message = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":325
- * raise IndexError, str(len(data[loop1][0]))+' arguments in event list'
- * buffer[loop1].message = 0
- * for i in range(len(data[loop1][0])): # <<<<<<<<<<<<<<
- * buffer[loop1].message = buffer[loop1].message + ((data[loop1][0][i]&0xFF) << (8*i))
- * buffer[loop1].timestamp = data[loop1][1]
- */
- __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_v_loop1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":326
- * buffer[loop1].message = 0
- * for i in range(len(data[loop1][0])):
- * buffer[loop1].message = buffer[loop1].message + ((data[loop1][0][i]&0xFF) << (8*i)) # <<<<<<<<<<<<<<
- * buffer[loop1].timestamp = data[loop1][1]
- * if self.debug: print loop1," : ",buffer[loop1].message," : ",buffer[loop1].timestamp
- */
- __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyInt_to_py_PmMessage((__pyx_v_buffer[__pyx_t_5]).message); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_v_loop1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_And(__pyx_t_2, __pyx_int_0xFF); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong((8 * __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = PyNumber_Lshift(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_11 = __Pyx_PyInt_from_py_PmMessage(__pyx_t_2); if (unlikely((__pyx_t_11 == (PmMessage)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- (__pyx_v_buffer[__pyx_t_5]).message = __pyx_t_11;
- }
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":327
- * for i in range(len(data[loop1][0])):
- * buffer[loop1].message = buffer[loop1].message + ((data[loop1][0][i]&0xFF) << (8*i))
- * buffer[loop1].timestamp = data[loop1][1] # <<<<<<<<<<<<<<
- * if self.debug: print loop1," : ",buffer[loop1].message," : ",buffer[loop1].timestamp
- * if self.debug: print "writing to midi buffer"
- */
- __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_v_loop1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_12 = __Pyx_PyInt_from_py_PmTimestamp(__pyx_t_10); if (unlikely((__pyx_t_12 == (PmTimestamp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- (__pyx_v_buffer[__pyx_t_5]).timestamp = __pyx_t_12;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":328
- * buffer[loop1].message = buffer[loop1].message + ((data[loop1][0][i]&0xFF) << (8*i))
- * buffer[loop1].timestamp = data[loop1][1]
- * if self.debug: print loop1," : ",buffer[loop1].message," : ",buffer[loop1].timestamp # <<<<<<<<<<<<<<
- * if self.debug: print "writing to midi buffer"
- * err= Pm_Write(self.midi, buffer, len(data))
- */
- __pyx_t_8 = ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->debug;
- if (__pyx_t_8) {
- __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_to_py_PmMessage((__pyx_v_buffer[__pyx_t_5]).message); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyInt_to_py_PmTimestamp((__pyx_v_buffer[__pyx_t_5]).timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_v_loop1);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_loop1);
- __Pyx_GIVEREF(__pyx_v_loop1);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
- PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_kp_s_9));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
- PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
- PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_kp_s_9));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
- PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_10 = 0;
- __pyx_t_2 = 0;
- if (__Pyx_Print(__pyx_t_6, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L11;
- }
- __pyx_L11:;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __pyx_L5:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":329
- * buffer[loop1].timestamp = data[loop1][1]
- * if self.debug: print loop1," : ",buffer[loop1].message," : ",buffer[loop1].timestamp
- * if self.debug: print "writing to midi buffer" # <<<<<<<<<<<<<<
- * err= Pm_Write(self.midi, buffer, len(data))
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- */
- __pyx_t_8 = ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->debug;
- if (__pyx_t_8) {
- if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_10)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L12;
- }
- __pyx_L12:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":330
- * if self.debug: print loop1," : ",buffer[loop1].message," : ",buffer[loop1].timestamp
- * if self.debug: print "writing to midi buffer"
- * err= Pm_Write(self.midi, buffer, len(data)) # <<<<<<<<<<<<<<
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- *
- */
- __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_err = Pm_Write(((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->midi, __pyx_v_buffer, __pyx_t_3);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":331
- * if self.debug: print "writing to midi buffer"
- * err= Pm_Write(self.midi, buffer, len(data))
- * if err < 0: raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- *
- * def WriteShort(self, status, data1 = 0, data2 = 0):
- */
- __pyx_t_4 = (__pyx_v_err < 0);
- if (__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_1), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L13;
- }
- __pyx_L13:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("_pyportmidi.Output.Write");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF(__pyx_v_loop1);
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_DECREF(__pyx_v_data);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":333
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- *
- * def WriteShort(self, status, data1 = 0, data2 = 0): # <<<<<<<<<<<<<<
- * """
- * WriteShort(status <, data1><, data2>)
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_6Output_WriteShort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_11_pyportmidi_6Output_WriteShort[] = "\nWriteShort(status <, data1><, data2>)\n output MIDI information of 3 bytes or less.\n data fields are optional\n status byte could be:\n 0xc0 = program change\n 0x90 = note on\n etc.\n data bytes are optional and assumed 0 if omitted\n example: note 65 on with velocity 100\n WriteShort(0x90,65,100)\n ";
-static PyObject *__pyx_pf_11_pyportmidi_6Output_WriteShort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_status = 0;
- PyObject *__pyx_v_data1 = 0;
- PyObject *__pyx_v_data2 = 0;
- PmEvent __pyx_v_buffer[1];
- PmError __pyx_v_err;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PmMessage __pyx_t_4;
- int __pyx_t_5;
- int __pyx_t_6;
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__status,&__pyx_n_s__data1,&__pyx_n_s__data2,0};
- __Pyx_RefNannySetupContext("WriteShort");
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
- PyObject* values[3] = {0,0,0};
- values[1] = ((PyObject *)__pyx_int_0);
- values[2] = ((PyObject *)__pyx_int_0);
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 0:
- values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__status);
- if (likely(values[0])) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 1) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data1);
- if (unlikely(value)) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 1) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data2);
- if (unlikely(value)) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "WriteShort") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- __pyx_v_status = values[0];
- __pyx_v_data1 = values[1];
- __pyx_v_data2 = values[2];
- } else {
- __pyx_v_data1 = ((PyObject *)__pyx_int_0);
- __pyx_v_data2 = ((PyObject *)__pyx_int_0);
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: __pyx_v_data2 = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: __pyx_v_data1 = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: __pyx_v_status = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("WriteShort", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("_pyportmidi.Output.WriteShort");
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_INCREF(__pyx_v_status);
- __Pyx_INCREF(__pyx_v_data1);
- __Pyx_INCREF(__pyx_v_data2);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":348
- * cdef PmEvent buffer[1]
- * cdef PmError err
- * self._check_open() # <<<<<<<<<<<<<<
- *
- * buffer[0].timestamp = Pt_Time()
- */
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":350
- * self._check_open()
- *
- * buffer[0].timestamp = Pt_Time() # <<<<<<<<<<<<<<
- * buffer[0].message = ((((data2) << 16) & 0xFF0000) | (((data1) << 8) & 0xFF00) | ((status) & 0xFF))
- * if self.debug: print "Writing to MIDI buffer"
- */
- (__pyx_v_buffer[0]).timestamp = Pt_Time();
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":351
- *
- * buffer[0].timestamp = Pt_Time()
- * buffer[0].message = ((((data2) << 16) & 0xFF0000) | (((data1) << 8) & 0xFF00) | ((status) & 0xFF)) # <<<<<<<<<<<<<<
- * if self.debug: print "Writing to MIDI buffer"
- * err = Pm_Write(self.midi, buffer, 1) # stream, buffer, length
- */
- __pyx_t_2 = PyNumber_Lshift(__pyx_v_data2, __pyx_int_16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_int_0xFF0000); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Lshift(__pyx_v_data1, __pyx_int_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_And(__pyx_t_2, __pyx_int_0xFF00); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Or(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_And(__pyx_v_status, __pyx_int_0xFF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_4 = __Pyx_PyInt_from_py_PmMessage(__pyx_t_1); if (unlikely((__pyx_t_4 == (PmMessage)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- (__pyx_v_buffer[0]).message = __pyx_t_4;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":352
- * buffer[0].timestamp = Pt_Time()
- * buffer[0].message = ((((data2) << 16) & 0xFF0000) | (((data1) << 8) & 0xFF00) | ((status) & 0xFF))
- * if self.debug: print "Writing to MIDI buffer" # <<<<<<<<<<<<<<
- * err = Pm_Write(self.midi, buffer, 1) # stream, buffer, length
- * if err < 0 : raise Exception, Pm_GetErrorText(err)
- */
- __pyx_t_5 = ((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->debug;
- if (__pyx_t_5) {
- if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_11)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":353
- * buffer[0].message = ((((data2) << 16) & 0xFF0000) | (((data1) << 8) & 0xFF00) | ((status) & 0xFF))
- * if self.debug: print "Writing to MIDI buffer"
- * err = Pm_Write(self.midi, buffer, 1) # stream, buffer, length # <<<<<<<<<<<<<<
- * if err < 0 : raise Exception, Pm_GetErrorText(err)
- *
- */
- __pyx_v_err = Pm_Write(((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->midi, __pyx_v_buffer, 1);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":354
- * if self.debug: print "Writing to MIDI buffer"
- * err = Pm_Write(self.midi, buffer, 1) # stream, buffer, length
- * if err < 0 : raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- *
- * def WriteSysEx(self, when, msg):
- */
- __pyx_t_6 = (__pyx_v_err < 0);
- if (__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_1), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("_pyportmidi.Output.WriteShort");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_DECREF(__pyx_v_status);
- __Pyx_DECREF(__pyx_v_data1);
- __Pyx_DECREF(__pyx_v_data2);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":356
- * if err < 0 : raise Exception, Pm_GetErrorText(err)
- *
- * def WriteSysEx(self, when, msg): # <<<<<<<<<<<<<<
- * """
- * WriteSysEx(<timestamp>,<msg>)
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_6Output_WriteSysEx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_11_pyportmidi_6Output_WriteSysEx[] = "\n WriteSysEx(<timestamp>,<msg>)\n writes a timestamped system-exclusive midi message.\n <msg> can be a *list* or a *string*\n example:\n (assuming y is an input MIDI stream)\n y.WriteSysEx(0,'\\xF0\\x7D\\x10\\x11\\x12\\x13\\xF7')\n is equivalent to\n y.WriteSysEx(pypm.Time,\n [0xF0, 0x7D, 0x10, 0x11, 0x12, 0x13, 0xF7])\n ";
-static PyObject *__pyx_pf_11_pyportmidi_6Output_WriteSysEx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_when = 0;
- PyObject *__pyx_v_msg = 0;
- PmError __pyx_v_err;
- char *__pyx_v_cmsg;
- PtTimestamp __pyx_v_CurTime;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- char *__pyx_t_5;
- PmTimestamp __pyx_t_6;
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__when,&__pyx_n_s__msg,0};
- __Pyx_RefNannySetupContext("WriteSysEx");
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
- PyObject* values[2] = {0,0};
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 0:
- values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__when);
- if (likely(values[0])) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg);
- if (likely(values[1])) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("WriteSysEx", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "WriteSysEx") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- __pyx_v_when = values[0];
- __pyx_v_msg = values[1];
- } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
- goto __pyx_L5_argtuple_error;
- } else {
- __pyx_v_when = PyTuple_GET_ITEM(__pyx_args, 0);
- __pyx_v_msg = PyTuple_GET_ITEM(__pyx_args, 1);
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("WriteSysEx", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("_pyportmidi.Output.WriteSysEx");
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_INCREF(__pyx_v_when);
- __Pyx_INCREF(__pyx_v_msg);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":372
- * cdef PtTimestamp CurTime
- *
- * self._check_open() # <<<<<<<<<<<<<<
- *
- * if type(msg) is list:
- */
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":374
- * self._check_open()
- *
- * if type(msg) is list: # <<<<<<<<<<<<<<
- * msg = array.array('B',msg).tostring() # Markus Pfaff contribution
- * cmsg = msg
- */
- __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_msg)) == ((PyObject *)((PyObject*)&PyList_Type)));
- if (__pyx_t_3) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":375
- *
- * if type(msg) is list:
- * msg = array.array('B',msg).tostring() # Markus Pfaff contribution # <<<<<<<<<<<<<<
- * cmsg = msg
- *
- */
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_n_s__B));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__B));
- __Pyx_GIVEREF(((PyObject *)__pyx_n_s__B));
- __Pyx_INCREF(__pyx_v_msg);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_msg);
- __Pyx_GIVEREF(__pyx_v_msg);
- __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__tostring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_v_msg);
- __pyx_v_msg = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":376
- * if type(msg) is list:
- * msg = array.array('B',msg).tostring() # Markus Pfaff contribution
- * cmsg = msg # <<<<<<<<<<<<<<
- *
- * CurTime = Pt_Time()
- */
- __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_msg); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_cmsg = __pyx_t_5;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":378
- * cmsg = msg
- *
- * CurTime = Pt_Time() # <<<<<<<<<<<<<<
- * err = Pm_WriteSysEx(self.midi, when, <unsigned char *> cmsg)
- * if err < 0 : raise Exception, Pm_GetErrorText(err)
- */
- __pyx_v_CurTime = Pt_Time();
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":379
- *
- * CurTime = Pt_Time()
- * err = Pm_WriteSysEx(self.midi, when, <unsigned char *> cmsg) # <<<<<<<<<<<<<<
- * if err < 0 : raise Exception, Pm_GetErrorText(err)
- * while Pt_Time() == CurTime: # wait for SysEx to go thru or...my
- */
- __pyx_t_6 = __Pyx_PyInt_from_py_PmTimestamp(__pyx_v_when); if (unlikely((__pyx_t_6 == (PmTimestamp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_err = Pm_WriteSysEx(((struct __pyx_obj_11_pyportmidi_Output *)__pyx_v_self)->midi, __pyx_t_6, ((unsigned char *)__pyx_v_cmsg));
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":380
- * CurTime = Pt_Time()
- * err = Pm_WriteSysEx(self.midi, when, <unsigned char *> cmsg)
- * if err < 0 : raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- * while Pt_Time() == CurTime: # wait for SysEx to go thru or...my
- * pass # win32 machine crashes w/ multiple SysEx
- */
- __pyx_t_3 = (__pyx_v_err < 0);
- if (__pyx_t_3) {
- __pyx_t_4 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":381
- * err = Pm_WriteSysEx(self.midi, when, <unsigned char *> cmsg)
- * if err < 0 : raise Exception, Pm_GetErrorText(err)
- * while Pt_Time() == CurTime: # wait for SysEx to go thru or...my # <<<<<<<<<<<<<<
- * pass # win32 machine crashes w/ multiple SysEx
- *
- */
- while (1) {
- __pyx_t_3 = (Pt_Time() == __pyx_v_CurTime);
- if (!__pyx_t_3) break;
- }
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("_pyportmidi.Output.WriteSysEx");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_DECREF(__pyx_v_when);
- __Pyx_DECREF(__pyx_v_msg);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":404
- * cdef int i
- *
- * def __init__(self, InputDevice, buffersize=4096): # <<<<<<<<<<<<<<
- * cdef PmError err
- * self.i = InputDevice
- */
-
-static int __pyx_pf_11_pyportmidi_5Input___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pf_11_pyportmidi_5Input___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_InputDevice = 0;
- PyObject *__pyx_v_buffersize = 0;
- PmError __pyx_v_err;
- int __pyx_r;
- int __pyx_t_1;
- long __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__InputDevice,&__pyx_n_s__buffersize,0};
- __Pyx_RefNannySetupContext("__init__");
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
- PyObject* values[2] = {0,0};
- values[1] = ((PyObject *)__pyx_int_4096);
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 0:
- values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__InputDevice);
- if (likely(values[0])) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 1) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buffersize);
- if (unlikely(value)) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- __pyx_v_InputDevice = values[0];
- __pyx_v_buffersize = values[1];
- } else {
- __pyx_v_buffersize = ((PyObject *)__pyx_int_4096);
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: __pyx_v_buffersize = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: __pyx_v_InputDevice = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("_pyportmidi.Input.__init__");
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_INCREF(__pyx_v_InputDevice);
- __Pyx_INCREF(__pyx_v_buffersize);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":406
- * def __init__(self, InputDevice, buffersize=4096):
- * cdef PmError err
- * self.i = InputDevice # <<<<<<<<<<<<<<
- * self.debug = 0
- * err= Pm_OpenInput(&(self.midi),self.i,NULL,buffersize,&Pt_Time,NULL)
- */
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_InputDevice); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- ((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->i = __pyx_t_1;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":407
- * cdef PmError err
- * self.i = InputDevice
- * self.debug = 0 # <<<<<<<<<<<<<<
- * err= Pm_OpenInput(&(self.midi),self.i,NULL,buffersize,&Pt_Time,NULL)
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- */
- ((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->debug = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":408
- * self.i = InputDevice
- * self.debug = 0
- * err= Pm_OpenInput(&(self.midi),self.i,NULL,buffersize,&Pt_Time,NULL) # <<<<<<<<<<<<<<
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- * if self.debug: print "MIDI input opened."
- */
- __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_v_buffersize); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_err = Pm_OpenInput((&((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi), ((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->i, NULL, __pyx_t_2, (&Pt_Time), NULL);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":409
- * self.debug = 0
- * err= Pm_OpenInput(&(self.midi),self.i,NULL,buffersize,&Pt_Time,NULL)
- * if err < 0: raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- * if self.debug: print "MIDI input opened."
- *
- */
- __pyx_t_3 = (__pyx_v_err < 0);
- if (__pyx_t_3) {
- __pyx_t_4 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":410
- * err= Pm_OpenInput(&(self.midi),self.i,NULL,buffersize,&Pt_Time,NULL)
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- * if self.debug: print "MIDI input opened." # <<<<<<<<<<<<<<
- *
- * def __dealloc__(self):
- */
- __pyx_t_1 = ((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->debug;
- if (__pyx_t_1) {
- if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("_pyportmidi.Input.__init__");
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_DECREF(__pyx_v_InputDevice);
- __Pyx_DECREF(__pyx_v_buffersize);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":412
- * if self.debug: print "MIDI input opened."
- *
- * def __dealloc__(self): # <<<<<<<<<<<<<<
- * cdef PmError err
- * if self.debug: print "Closing MIDI input stream and destroying instance"
- */
-
-static void __pyx_pf_11_pyportmidi_5Input___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pf_11_pyportmidi_5Input___dealloc__(PyObject *__pyx_v_self) {
- PmError __pyx_v_err;
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_RefNannySetupContext("__dealloc__");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":414
- * def __dealloc__(self):
- * cdef PmError err
- * if self.debug: print "Closing MIDI input stream and destroying instance" # <<<<<<<<<<<<<<
- *
- * err = Pm_Close(self.midi)
- */
- __pyx_t_1 = ((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->debug;
- if (__pyx_t_1) {
- if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_13)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":416
- * if self.debug: print "Closing MIDI input stream and destroying instance"
- *
- * err = Pm_Close(self.midi) # <<<<<<<<<<<<<<
- * if err < 0:
- * raise Exception, Pm_GetErrorText(err)
- */
- __pyx_v_err = Pm_Close(((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":417
- *
- * err = Pm_Close(self.midi)
- * if err < 0: # <<<<<<<<<<<<<<
- * raise Exception, Pm_GetErrorText(err)
- *
- */
- __pyx_t_2 = (__pyx_v_err < 0);
- if (__pyx_t_2) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":418
- * err = Pm_Close(self.midi)
- * if err < 0:
- * raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_3 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_3), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("_pyportmidi.Input.__dealloc__");
- __pyx_L0:;
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_RefNannyFinishContext();
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":422
- *
- *
- * def _check_open(self): # <<<<<<<<<<<<<<
- * """ checks to see if the midi is open, and if not, raises an error.
- * """
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_5Input__check_open(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static char __pyx_doc_11_pyportmidi_5Input__check_open[] = " checks to see if the midi is open, and if not, raises an error.\n ";
-static PyObject *__pyx_pf_11_pyportmidi_5Input__check_open(PyObject *__pyx_v_self, PyObject *unused) {
- PyObject *__pyx_r = NULL;
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("_check_open");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":426
- * """
- *
- * if self.midi == NULL: # <<<<<<<<<<<<<<
- * raise Exception, "midi Input not open."
- *
- */
- __pyx_t_1 = (((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi == NULL);
- if (__pyx_t_1) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":427
- *
- * if self.midi == NULL:
- * raise Exception, "midi Input not open." # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_kp_s_14), 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_AddTraceback("_pyportmidi.Input._check_open");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":430
- *
- *
- * def Close(self): # <<<<<<<<<<<<<<
- * """
- * Close()
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_5Input_Close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static char __pyx_doc_11_pyportmidi_5Input_Close[] = "\nClose()\n closes a midi stream, flushing any pending buffers.\n (PortMidi attempts to close open streams when the application\n exits -- this is particularly difficult under Windows.)\n ";
-static PyObject *__pyx_pf_11_pyportmidi_5Input_Close(PyObject *__pyx_v_self, PyObject *unused) {
- PyObject *__pyx_v_err;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PmError __pyx_t_3;
- __Pyx_RefNannySetupContext("Close");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __pyx_v_err = Py_None; __Pyx_INCREF(Py_None);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":440
- * # return
- *
- * err = Pm_Close(self.midi) # <<<<<<<<<<<<<<
- * if err < 0:
- * raise Exception, Pm_GetErrorText(err)
- */
- __pyx_t_1 = PyInt_FromLong(Pm_Close(((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_v_err);
- __pyx_v_err = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":441
- *
- * err = Pm_Close(self.midi)
- * if err < 0: # <<<<<<<<<<<<<<
- * raise Exception, Pm_GetErrorText(err)
- * #self.midi = NULL
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_err, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":442
- * err = Pm_Close(self.midi)
- * if err < 0:
- * raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- * #self.midi = NULL
- *
- */
- __pyx_t_3 = ((PmError)PyInt_AsLong(__pyx_v_err)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_1), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("_pyportmidi.Input.Close");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF(__pyx_v_err);
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":447
- *
- *
- * def SetFilter(self, filters): # <<<<<<<<<<<<<<
- * """
- * SetFilter(<filters>) sets filters on an open input stream
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_5Input_SetFilter(PyObject *__pyx_v_self, PyObject *__pyx_v_filters); /*proto*/
-static char __pyx_doc_11_pyportmidi_5Input_SetFilter[] = "\n SetFilter(<filters>) sets filters on an open input stream\n to drop selected input types. By default, only active sensing\n messages are filtered. To prohibit, say, active sensing and\n sysex messages, call\n SetFilter(stream, FILT_ACTIVE | FILT_SYSEX);\n\n Filtering is useful when midi routing or midi thru functionality\n is being provided by the user application.\n For example, you may want to exclude timing messages\n (clock, MTC, start/stop/continue), while allowing note-related\n messages to pass. Or you may be using a sequencer or drum-machine\n for MIDI clock information but want to exclude any notes\n it may play.\n\n Note: SetFilter empties the buffer after setting the filter,\n just in case anything got through.\n ";
-static PyObject *__pyx_pf_11_pyportmidi_5Input_SetFilter(PyObject *__pyx_v_self, PyObject *__pyx_v_filters) {
- PmEvent __pyx_v_buffer[1];
- PmError __pyx_v_err;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- long __pyx_t_3;
- int __pyx_t_4;
- __Pyx_RefNannySetupContext("SetFilter");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_INCREF(__pyx_v_filters);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":469
- * cdef PmError err
- *
- * self._check_open() # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":472
- *
- *
- * err = Pm_SetFilter(self.midi, filters) # <<<<<<<<<<<<<<
- *
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- */
- __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_v_filters); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_err = Pm_SetFilter(((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi, __pyx_t_3);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":474
- * err = Pm_SetFilter(self.midi, filters)
- *
- * if err < 0: raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- *
- * while(Pm_Poll(self.midi) != pmNoError):
- */
- __pyx_t_4 = (__pyx_v_err < 0);
- if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":476
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- *
- * while(Pm_Poll(self.midi) != pmNoError): # <<<<<<<<<<<<<<
- *
- * err = Pm_Read(self.midi,buffer,1)
- */
- while (1) {
- __pyx_t_4 = (Pm_Poll(((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi) != pmNoError);
- if (!__pyx_t_4) break;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":478
- * while(Pm_Poll(self.midi) != pmNoError):
- *
- * err = Pm_Read(self.midi,buffer,1) # <<<<<<<<<<<<<<
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- *
- */
- __pyx_v_err = Pm_Read(((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi, __pyx_v_buffer, 1);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":479
- *
- * err = Pm_Read(self.midi,buffer,1)
- * if err < 0: raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- *
- * def SetChannelMask(self, mask):
- */
- __pyx_t_4 = (__pyx_v_err < 0);
- if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
- }
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("_pyportmidi.Input.SetFilter");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_DECREF(__pyx_v_filters);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":481
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- *
- * def SetChannelMask(self, mask): # <<<<<<<<<<<<<<
- * """
- * SetChannelMask(<mask>) filters incoming messages based on channel.
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_5Input_SetChannelMask(PyObject *__pyx_v_self, PyObject *__pyx_v_mask); /*proto*/
-static char __pyx_doc_11_pyportmidi_5Input_SetChannelMask[] = "\n SetChannelMask(<mask>) filters incoming messages based on channel.\n The mask is a 16-bit bitfield corresponding to appropriate channels\n Channel(<channel>) can assist in calling this function.\n i.e. to set receive only input on channel 1, call with\n SetChannelMask(Channel(1))\n Multiple channels should be OR'd together, like\n SetChannelMask(Channel(10) | Channel(11))\n note: PyPortMidi Channel function has been altered from\n the original PortMidi c call to correct for what\n seems to be a bug --- i.e. channel filters were\n all numbered from 0 to 15 instead of 1 to 16.\n ";
-static PyObject *__pyx_pf_11_pyportmidi_5Input_SetChannelMask(PyObject *__pyx_v_self, PyObject *__pyx_v_mask) {
- PmError __pyx_v_err;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- int __pyx_t_4;
- __Pyx_RefNannySetupContext("SetChannelMask");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_INCREF(__pyx_v_mask);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":497
- * cdef PmError err
- *
- * self._check_open() # <<<<<<<<<<<<<<
- *
- * err = Pm_SetChannelMask(self.midi,mask)
- */
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":499
- * self._check_open()
- *
- * err = Pm_SetChannelMask(self.midi,mask) # <<<<<<<<<<<<<<
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- *
- */
- __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_mask); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_err = Pm_SetChannelMask(((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi, __pyx_t_3);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":500
- *
- * err = Pm_SetChannelMask(self.midi,mask)
- * if err < 0: raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- *
- * def Poll(self):
- */
- __pyx_t_4 = (__pyx_v_err < 0);
- if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("_pyportmidi.Input.SetChannelMask");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_DECREF(__pyx_v_mask);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":502
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- *
- * def Poll(self): # <<<<<<<<<<<<<<
- * """
- * Poll tests whether input is available,
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_5Input_Poll(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static char __pyx_doc_11_pyportmidi_5Input_Poll[] = "\n Poll tests whether input is available,\n returning TRUE, FALSE, or an error value.\n ";
-static PyObject *__pyx_pf_11_pyportmidi_5Input_Poll(PyObject *__pyx_v_self, PyObject *unused) {
- PmError __pyx_v_err;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- __Pyx_RefNannySetupContext("Poll");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":508
- * """
- * cdef PmError err
- * self._check_open() # <<<<<<<<<<<<<<
- *
- * err = Pm_Poll(self.midi)
- */
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":510
- * self._check_open()
- *
- * err = Pm_Poll(self.midi) # <<<<<<<<<<<<<<
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- * return err
- */
- __pyx_v_err = Pm_Poll(((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":511
- *
- * err = Pm_Poll(self.midi)
- * if err < 0: raise Exception, Pm_GetErrorText(err) # <<<<<<<<<<<<<<
- * return err
- *
- */
- __pyx_t_3 = (__pyx_v_err < 0);
- if (__pyx_t_3) {
- __pyx_t_2 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":512
- * err = Pm_Poll(self.midi)
- * if err < 0: raise Exception, Pm_GetErrorText(err)
- * return err # <<<<<<<<<<<<<<
- *
- * def Read(self,length):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_err); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("_pyportmidi.Input.Poll");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":514
- * return err
- *
- * def Read(self,length): # <<<<<<<<<<<<<<
- * """
- * Read(length): returns up to <length> midi events stored in
- */
-
-static PyObject *__pyx_pf_11_pyportmidi_5Input_Read(PyObject *__pyx_v_self, PyObject *__pyx_v_length); /*proto*/
-static char __pyx_doc_11_pyportmidi_5Input_Read[] = "\nRead(length): returns up to <length> midi events stored in\nthe buffer and returns them as a list:\n[[[status,data1,data2,data3],timestamp],\n [[status,data1,data2,data3],timestamp],...]\nexample: Read(50) returns all the events in the buffer,\n up to 50 events.\n ";
-static PyObject *__pyx_pf_11_pyportmidi_5Input_Read(PyObject *__pyx_v_self, PyObject *__pyx_v_length) {
- PmEvent __pyx_v_buffer[1024];
- PyObject *__pyx_v_x;
- PyObject *__pyx_v_NumEvents;
- PyObject *__pyx_v_loop;
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- long __pyx_t_4;
- PmError __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- Py_ssize_t __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- __Pyx_RefNannySetupContext("Read");
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_INCREF(__pyx_v_length);
- __pyx_v_x = Py_None; __Pyx_INCREF(Py_None);
- __pyx_v_NumEvents = Py_None; __Pyx_INCREF(Py_None);
- __pyx_v_loop = Py_None; __Pyx_INCREF(Py_None);
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":525
- * cdef PmEvent buffer[1024]
- *
- * self._check_open() # <<<<<<<<<<<<<<
- *
- * x = []
- */
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":527
- * self._check_open()
- *
- * x = [] # <<<<<<<<<<<<<<
- *
- * if length > 1024: raise IndexError, 'maximum buffer length is 1024'
- */
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_DECREF(__pyx_v_x);
- __pyx_v_x = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":529
- * x = []
- *
- * if length > 1024: raise IndexError, 'maximum buffer length is 1024' # <<<<<<<<<<<<<<
- * if length < 1: raise IndexError, 'minimum buffer length is 1'
- * NumEvents = Pm_Read(self.midi,buffer,length)
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_length, __pyx_int_1024, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_3) {
- __Pyx_Raise(__pyx_builtin_IndexError, ((PyObject *)__pyx_kp_s_15), 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":530
- *
- * if length > 1024: raise IndexError, 'maximum buffer length is 1024'
- * if length < 1: raise IndexError, 'minimum buffer length is 1' # <<<<<<<<<<<<<<
- * NumEvents = Pm_Read(self.midi,buffer,length)
- * if NumEvents < 0: raise Exception, Pm_GetErrorText(NumEvents)
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_length, __pyx_int_1, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_3) {
- __Pyx_Raise(__pyx_builtin_IndexError, ((PyObject *)__pyx_kp_s_16), 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":531
- * if length > 1024: raise IndexError, 'maximum buffer length is 1024'
- * if length < 1: raise IndexError, 'minimum buffer length is 1'
- * NumEvents = Pm_Read(self.midi,buffer,length) # <<<<<<<<<<<<<<
- * if NumEvents < 0: raise Exception, Pm_GetErrorText(NumEvents)
- * x=[]
- */
- __pyx_t_4 = __Pyx_PyInt_AsLong(__pyx_v_length); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromLong(Pm_Read(((struct __pyx_obj_11_pyportmidi_Input *)__pyx_v_self)->midi, __pyx_v_buffer, __pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_v_NumEvents);
- __pyx_v_NumEvents = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":532
- * if length < 1: raise IndexError, 'minimum buffer length is 1'
- * NumEvents = Pm_Read(self.midi,buffer,length)
- * if NumEvents < 0: raise Exception, Pm_GetErrorText(NumEvents) # <<<<<<<<<<<<<<
- * x=[]
- * if NumEvents >= 1:
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_NumEvents, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_3) {
- __pyx_t_5 = ((PmError)PyInt_AsLong(__pyx_v_NumEvents)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyBytes_FromString(Pm_GetErrorText(__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_Raise(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), 0);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":533
- * NumEvents = Pm_Read(self.midi,buffer,length)
- * if NumEvents < 0: raise Exception, Pm_GetErrorText(NumEvents)
- * x=[] # <<<<<<<<<<<<<<
- * if NumEvents >= 1:
- * for loop in range(NumEvents):
- */
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_DECREF(__pyx_v_x);
- __pyx_v_x = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":534
- * if NumEvents < 0: raise Exception, Pm_GetErrorText(NumEvents)
- * x=[]
- * if NumEvents >= 1: # <<<<<<<<<<<<<<
- * for loop in range(NumEvents):
- * x.append([[buffer[loop].message & 0xff, (buffer[loop].message >> 8) & 0xFF, (buffer[loop].message >> 16) & 0xFF, (buffer[loop].message >> 24) & 0xFF], buffer[loop].timestamp])
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_NumEvents, __pyx_int_1, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_3) {
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":535
- * x=[]
- * if NumEvents >= 1:
- * for loop in range(NumEvents): # <<<<<<<<<<<<<<
- * x.append([[buffer[loop].message & 0xff, (buffer[loop].message >> 8) & 0xFF, (buffer[loop].message >> 16) & 0xFF, (buffer[loop].message >> 24) & 0xFF], buffer[loop].timestamp])
- * return x
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_NumEvents);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_NumEvents);
- __Pyx_GIVEREF(__pyx_v_NumEvents);
- __pyx_t_1 = PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
- __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
- } else {
- __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (;;) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
- } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
- if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
- } else {
- __pyx_t_1 = PyIter_Next(__pyx_t_2);
- if (!__pyx_t_1) {
- if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- break;
- }
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_DECREF(__pyx_v_loop);
- __pyx_v_loop = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":536
- * if NumEvents >= 1:
- * for loop in range(NumEvents):
- * x.append([[buffer[loop].message & 0xff, (buffer[loop].message >> 8) & 0xFF, (buffer[loop].message >> 16) & 0xFF, (buffer[loop].message >> 24) & 0xFF], buffer[loop].timestamp]) # <<<<<<<<<<<<<<
- * return x
- */
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyInt_to_py_PmMessage(((__pyx_v_buffer[__pyx_t_7]).message & 0xff)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = __Pyx_PyInt_to_py_PmMessage((((__pyx_v_buffer[__pyx_t_7]).message >> 8) & 0xFF)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyInt_to_py_PmMessage((((__pyx_v_buffer[__pyx_t_7]).message >> 16) & 0xFF)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_to_py_PmMessage((((__pyx_v_buffer[__pyx_t_7]).message >> 24) & 0xFF)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyList_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_11));
- PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- PyList_SET_ITEM(__pyx_t_11, 2, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- PyList_SET_ITEM(__pyx_t_11, 3, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_1 = 0;
- __pyx_t_8 = 0;
- __pyx_t_9 = 0;
- __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loop); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_to_py_PmTimestamp((__pyx_v_buffer[__pyx_t_7]).timestamp); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_9));
- PyList_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_11));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
- PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_11 = 0;
- __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_x, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":537
- * for loop in range(NumEvents):
- * x.append([[buffer[loop].message & 0xff, (buffer[loop].message >> 8) & 0xFF, (buffer[loop].message >> 16) & 0xFF, (buffer[loop].message >> 24) & 0xFF], buffer[loop].timestamp])
- * return x # <<<<<<<<<<<<<<
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_x);
- __pyx_r = __pyx_v_x;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_AddTraceback("_pyportmidi.Input.Read");
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_DECREF(__pyx_v_x);
- __Pyx_DECREF(__pyx_v_NumEvents);
- __Pyx_DECREF(__pyx_v_loop);
- __Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_DECREF(__pyx_v_length);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_tp_new_11_pyportmidi_Output(PyTypeObject *t, PyObject *a, PyObject *k) {
- PyObject *o = (*t->tp_alloc)(t, 0);
- if (!o) return 0;
- return o;
-}
-
-static void __pyx_tp_dealloc_11_pyportmidi_Output(PyObject *o) {
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_pf_11_pyportmidi_6Output___dealloc__(o);
- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static struct PyMethodDef __pyx_methods_11_pyportmidi_Output[] = {
- {__Pyx_NAMESTR("_check_open"), (PyCFunction)__pyx_pf_11_pyportmidi_6Output__check_open, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_6Output__check_open)},
- {__Pyx_NAMESTR("Close"), (PyCFunction)__pyx_pf_11_pyportmidi_6Output_Close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_6Output_Close)},
- {__Pyx_NAMESTR("Abort"), (PyCFunction)__pyx_pf_11_pyportmidi_6Output_Abort, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_6Output_Abort)},
- {__Pyx_NAMESTR("Write"), (PyCFunction)__pyx_pf_11_pyportmidi_6Output_Write, METH_O, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_6Output_Write)},
- {__Pyx_NAMESTR("WriteShort"), (PyCFunction)__pyx_pf_11_pyportmidi_6Output_WriteShort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_6Output_WriteShort)},
- {__Pyx_NAMESTR("WriteSysEx"), (PyCFunction)__pyx_pf_11_pyportmidi_6Output_WriteSysEx, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_6Output_WriteSysEx)},
- {0, 0, 0, 0}
-};
-
-static PyNumberMethods __pyx_tp_as_number_Output = {
- 0, /*nb_add*/
- 0, /*nb_subtract*/
- 0, /*nb_multiply*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_divide*/
- #endif
- 0, /*nb_remainder*/
- 0, /*nb_divmod*/
- 0, /*nb_power*/
- 0, /*nb_negative*/
- 0, /*nb_positive*/
- 0, /*nb_absolute*/
- 0, /*nb_nonzero*/
- 0, /*nb_invert*/
- 0, /*nb_lshift*/
- 0, /*nb_rshift*/
- 0, /*nb_and*/
- 0, /*nb_xor*/
- 0, /*nb_or*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_coerce*/
- #endif
- 0, /*nb_int*/
- #if PY_MAJOR_VERSION >= 3
- 0, /*reserved*/
- #else
- 0, /*nb_long*/
- #endif
- 0, /*nb_float*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_oct*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_hex*/
- #endif
- 0, /*nb_inplace_add*/
- 0, /*nb_inplace_subtract*/
- 0, /*nb_inplace_multiply*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_inplace_divide*/
- #endif
- 0, /*nb_inplace_remainder*/
- 0, /*nb_inplace_power*/
- 0, /*nb_inplace_lshift*/
- 0, /*nb_inplace_rshift*/
- 0, /*nb_inplace_and*/
- 0, /*nb_inplace_xor*/
- 0, /*nb_inplace_or*/
- 0, /*nb_floor_divide*/
- 0, /*nb_true_divide*/
- 0, /*nb_inplace_floor_divide*/
- 0, /*nb_inplace_true_divide*/
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
- 0, /*nb_index*/
- #endif
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_Output = {
- 0, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- 0, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_Output = {
- 0, /*mp_length*/
- 0, /*mp_subscript*/
- 0, /*mp_ass_subscript*/
-};
-
-static PyBufferProcs __pyx_tp_as_buffer_Output = {
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getreadbuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getwritebuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getsegcount*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getcharbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_getbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_releasebuffer*/
- #endif
-};
-
-PyTypeObject __pyx_type_11_pyportmidi_Output = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_pyportmidi.Output"), /*tp_name*/
- sizeof(struct __pyx_obj_11_pyportmidi_Output), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_11_pyportmidi_Output, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
- &__pyx_tp_as_number_Output, /*tp_as_number*/
- &__pyx_tp_as_sequence_Output, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_Output, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- &__pyx_tp_as_buffer_Output, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
- __Pyx_DOCSTR("\nclass Output:\n define an output MIDI stream. Takes the form:\n x = pypm.Output(MidiOutputDevice, latency)\n latency is in ms.\n If latency = 0 then timestamps for output are ignored.\n "), /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_11_pyportmidi_Output, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pf_11_pyportmidi_6Output___init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_11_pyportmidi_Output, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_11_pyportmidi_Input(PyTypeObject *t, PyObject *a, PyObject *k) {
- PyObject *o = (*t->tp_alloc)(t, 0);
- if (!o) return 0;
- return o;
-}
-
-static void __pyx_tp_dealloc_11_pyportmidi_Input(PyObject *o) {
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_pf_11_pyportmidi_5Input___dealloc__(o);
- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static struct PyMethodDef __pyx_methods_11_pyportmidi_Input[] = {
- {__Pyx_NAMESTR("_check_open"), (PyCFunction)__pyx_pf_11_pyportmidi_5Input__check_open, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_5Input__check_open)},
- {__Pyx_NAMESTR("Close"), (PyCFunction)__pyx_pf_11_pyportmidi_5Input_Close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_5Input_Close)},
- {__Pyx_NAMESTR("SetFilter"), (PyCFunction)__pyx_pf_11_pyportmidi_5Input_SetFilter, METH_O, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_5Input_SetFilter)},
- {__Pyx_NAMESTR("SetChannelMask"), (PyCFunction)__pyx_pf_11_pyportmidi_5Input_SetChannelMask, METH_O, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_5Input_SetChannelMask)},
- {__Pyx_NAMESTR("Poll"), (PyCFunction)__pyx_pf_11_pyportmidi_5Input_Poll, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_5Input_Poll)},
- {__Pyx_NAMESTR("Read"), (PyCFunction)__pyx_pf_11_pyportmidi_5Input_Read, METH_O, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_5Input_Read)},
- {0, 0, 0, 0}
-};
-
-static PyNumberMethods __pyx_tp_as_number_Input = {
- 0, /*nb_add*/
- 0, /*nb_subtract*/
- 0, /*nb_multiply*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_divide*/
- #endif
- 0, /*nb_remainder*/
- 0, /*nb_divmod*/
- 0, /*nb_power*/
- 0, /*nb_negative*/
- 0, /*nb_positive*/
- 0, /*nb_absolute*/
- 0, /*nb_nonzero*/
- 0, /*nb_invert*/
- 0, /*nb_lshift*/
- 0, /*nb_rshift*/
- 0, /*nb_and*/
- 0, /*nb_xor*/
- 0, /*nb_or*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_coerce*/
- #endif
- 0, /*nb_int*/
- #if PY_MAJOR_VERSION >= 3
- 0, /*reserved*/
- #else
- 0, /*nb_long*/
- #endif
- 0, /*nb_float*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_oct*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_hex*/
- #endif
- 0, /*nb_inplace_add*/
- 0, /*nb_inplace_subtract*/
- 0, /*nb_inplace_multiply*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_inplace_divide*/
- #endif
- 0, /*nb_inplace_remainder*/
- 0, /*nb_inplace_power*/
- 0, /*nb_inplace_lshift*/
- 0, /*nb_inplace_rshift*/
- 0, /*nb_inplace_and*/
- 0, /*nb_inplace_xor*/
- 0, /*nb_inplace_or*/
- 0, /*nb_floor_divide*/
- 0, /*nb_true_divide*/
- 0, /*nb_inplace_floor_divide*/
- 0, /*nb_inplace_true_divide*/
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
- 0, /*nb_index*/
- #endif
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_Input = {
- 0, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- 0, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_Input = {
- 0, /*mp_length*/
- 0, /*mp_subscript*/
- 0, /*mp_ass_subscript*/
-};
-
-static PyBufferProcs __pyx_tp_as_buffer_Input = {
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getreadbuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getwritebuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getsegcount*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getcharbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_getbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_releasebuffer*/
- #endif
-};
-
-PyTypeObject __pyx_type_11_pyportmidi_Input = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_pyportmidi.Input"), /*tp_name*/
- sizeof(struct __pyx_obj_11_pyportmidi_Input), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_11_pyportmidi_Input, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
- &__pyx_tp_as_number_Input, /*tp_as_number*/
- &__pyx_tp_as_sequence_Input, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_Input, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- &__pyx_tp_as_buffer_Input, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
- __Pyx_DOCSTR("\nclass Input:\n define an input MIDI stream. Takes the form:\n x = pypm.Input(MidiInputDevice)\n "), /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_11_pyportmidi_Input, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_pf_11_pyportmidi_5Input___init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_11_pyportmidi_Input, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static struct PyMethodDef __pyx_methods[] = {
- {__Pyx_NAMESTR("Initialize"), (PyCFunction)__pyx_pf_11_pyportmidi_Initialize, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_Initialize)},
- {__Pyx_NAMESTR("Terminate"), (PyCFunction)__pyx_pf_11_pyportmidi_Terminate, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_Terminate)},
- {__Pyx_NAMESTR("GetDefaultInputDeviceID"), (PyCFunction)__pyx_pf_11_pyportmidi_GetDefaultInputDeviceID, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("GetDefaultOutputDeviceID"), (PyCFunction)__pyx_pf_11_pyportmidi_GetDefaultOutputDeviceID, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("CountDevices"), (PyCFunction)__pyx_pf_11_pyportmidi_CountDevices, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("GetDeviceInfo"), (PyCFunction)__pyx_pf_11_pyportmidi_GetDeviceInfo, METH_O, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_GetDeviceInfo)},
- {__Pyx_NAMESTR("Time"), (PyCFunction)__pyx_pf_11_pyportmidi_Time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_Time)},
- {__Pyx_NAMESTR("GetErrorText"), (PyCFunction)__pyx_pf_11_pyportmidi_GetErrorText, METH_O, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_GetErrorText)},
- {__Pyx_NAMESTR("Channel"), (PyCFunction)__pyx_pf_11_pyportmidi_Channel, METH_O, __Pyx_DOCSTR(__pyx_doc_11_pyportmidi_Channel)},
- {0, 0, 0, 0}
-};
-
-static void __pyx_init_filenames(void); /*proto*/
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
- PyModuleDef_HEAD_INIT,
- __Pyx_NAMESTR("_pyportmidi"),
- 0, /* m_doc */
- -1, /* m_size */
- __pyx_methods /* m_methods */,
- NULL, /* m_reload */
- NULL, /* m_traverse */
- NULL, /* m_clear */
- NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
- {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
- {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
- {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
- {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
- {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
- {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
- {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
- {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
- {&__pyx_n_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 1},
- {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1},
- {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
- {&__pyx_kp_u_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 1, 0, 0},
- {&__pyx_kp_u_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 1, 0, 0},
- {&__pyx_kp_u_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 1, 0, 0},
- {&__pyx_kp_u_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 1, 0, 0},
- {&__pyx_kp_u_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 1, 0, 0},
- {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0},
- {&__pyx_kp_u_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 1, 0, 0},
- {&__pyx_kp_u_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 1, 0, 0},
- {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0},
- {&__pyx_kp_u_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0, 0},
- {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
- {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0},
- {&__pyx_kp_u_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 1, 0, 0},
- {&__pyx_kp_u_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0, 0},
- {&__pyx_kp_u_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 1, 0, 0},
- {&__pyx_kp_u_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0, 0},
- {&__pyx_kp_u_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0, 0},
- {&__pyx_kp_u_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0, 0},
- {&__pyx_kp_u_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0, 0},
- {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
- {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
- {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
- {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
- {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
- {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
- {&__pyx_n_s__Abort, __pyx_k__Abort, sizeof(__pyx_k__Abort), 0, 0, 1, 1},
- {&__pyx_n_s__B, __pyx_k__B, sizeof(__pyx_k__B), 0, 0, 1, 1},
- {&__pyx_n_s__Channel, __pyx_k__Channel, sizeof(__pyx_k__Channel), 0, 0, 1, 1},
- {&__pyx_n_s__Close, __pyx_k__Close, sizeof(__pyx_k__Close), 0, 0, 1, 1},
- {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
- {&__pyx_n_s__FALSE, __pyx_k__FALSE, sizeof(__pyx_k__FALSE), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_ACTIVE, __pyx_k__FILT_ACTIVE, sizeof(__pyx_k__FILT_ACTIVE), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_AFTERTOUCH, __pyx_k__FILT_AFTERTOUCH, sizeof(__pyx_k__FILT_AFTERTOUCH), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_CLOCK, __pyx_k__FILT_CLOCK, sizeof(__pyx_k__FILT_CLOCK), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_CONTROL, __pyx_k__FILT_CONTROL, sizeof(__pyx_k__FILT_CONTROL), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_F9, __pyx_k__FILT_F9, sizeof(__pyx_k__FILT_F9), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_FD, __pyx_k__FILT_FD, sizeof(__pyx_k__FILT_FD), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_MTC, __pyx_k__FILT_MTC, sizeof(__pyx_k__FILT_MTC), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_NOTE, __pyx_k__FILT_NOTE, sizeof(__pyx_k__FILT_NOTE), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_PITCHBEND, __pyx_k__FILT_PITCHBEND, sizeof(__pyx_k__FILT_PITCHBEND), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_PLAY, __pyx_k__FILT_PLAY, sizeof(__pyx_k__FILT_PLAY), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_PROGRAM, __pyx_k__FILT_PROGRAM, sizeof(__pyx_k__FILT_PROGRAM), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_REALTIME, __pyx_k__FILT_REALTIME, sizeof(__pyx_k__FILT_REALTIME), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_RESET, __pyx_k__FILT_RESET, sizeof(__pyx_k__FILT_RESET), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_SONG_POSITION, __pyx_k__FILT_SONG_POSITION, sizeof(__pyx_k__FILT_SONG_POSITION), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_SONG_SELECT, __pyx_k__FILT_SONG_SELECT, sizeof(__pyx_k__FILT_SONG_SELECT), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_SYSEX, __pyx_k__FILT_SYSEX, sizeof(__pyx_k__FILT_SYSEX), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_TICK, __pyx_k__FILT_TICK, sizeof(__pyx_k__FILT_TICK), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_TUNE, __pyx_k__FILT_TUNE, sizeof(__pyx_k__FILT_TUNE), 0, 0, 1, 1},
- {&__pyx_n_s__FILT_UNDEFINED, __pyx_k__FILT_UNDEFINED, sizeof(__pyx_k__FILT_UNDEFINED), 0, 0, 1, 1},
- {&__pyx_n_s__GetDeviceInfo, __pyx_k__GetDeviceInfo, sizeof(__pyx_k__GetDeviceInfo), 0, 0, 1, 1},
- {&__pyx_n_s__GetErrorText, __pyx_k__GetErrorText, sizeof(__pyx_k__GetErrorText), 0, 0, 1, 1},
- {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
- {&__pyx_n_s__Initialize, __pyx_k__Initialize, sizeof(__pyx_k__Initialize), 0, 0, 1, 1},
- {&__pyx_n_s__Input, __pyx_k__Input, sizeof(__pyx_k__Input), 0, 0, 1, 1},
- {&__pyx_n_s__InputDevice, __pyx_k__InputDevice, sizeof(__pyx_k__InputDevice), 0, 0, 1, 1},
- {&__pyx_n_s__Output, __pyx_k__Output, sizeof(__pyx_k__Output), 0, 0, 1, 1},
- {&__pyx_n_s__OutputDevice, __pyx_k__OutputDevice, sizeof(__pyx_k__OutputDevice), 0, 0, 1, 1},
- {&__pyx_n_s__Poll, __pyx_k__Poll, sizeof(__pyx_k__Poll), 0, 0, 1, 1},
- {&__pyx_n_s__Read, __pyx_k__Read, sizeof(__pyx_k__Read), 0, 0, 1, 1},
- {&__pyx_n_s__SetChannelMask, __pyx_k__SetChannelMask, sizeof(__pyx_k__SetChannelMask), 0, 0, 1, 1},
- {&__pyx_n_s__SetFilter, __pyx_k__SetFilter, sizeof(__pyx_k__SetFilter), 0, 0, 1, 1},
- {&__pyx_n_s__TRUE, __pyx_k__TRUE, sizeof(__pyx_k__TRUE), 0, 0, 1, 1},
- {&__pyx_n_s__Terminate, __pyx_k__Terminate, sizeof(__pyx_k__Terminate), 0, 0, 1, 1},
- {&__pyx_n_s__Time, __pyx_k__Time, sizeof(__pyx_k__Time), 0, 0, 1, 1},
- {&__pyx_n_s__Write, __pyx_k__Write, sizeof(__pyx_k__Write), 0, 0, 1, 1},
- {&__pyx_n_s__WriteShort, __pyx_k__WriteShort, sizeof(__pyx_k__WriteShort), 0, 0, 1, 1},
- {&__pyx_n_s__WriteSysEx, __pyx_k__WriteSysEx, sizeof(__pyx_k__WriteSysEx), 0, 0, 1, 1},
- {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
- {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
- {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1},
- {&__pyx_n_s___aborted, __pyx_k___aborted, sizeof(__pyx_k___aborted), 0, 0, 1, 1},
- {&__pyx_n_s___check_open, __pyx_k___check_open, sizeof(__pyx_k___check_open), 0, 0, 1, 1},
- {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
- {&__pyx_n_s__buffersize, __pyx_k__buffersize, sizeof(__pyx_k__buffersize), 0, 0, 1, 1},
- {&__pyx_n_s__data1, __pyx_k__data1, sizeof(__pyx_k__data1), 0, 0, 1, 1},
- {&__pyx_n_s__data2, __pyx_k__data2, sizeof(__pyx_k__data2), 0, 0, 1, 1},
- {&__pyx_n_s__debug, __pyx_k__debug, sizeof(__pyx_k__debug), 0, 0, 1, 1},
- {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
- {&__pyx_n_s__input, __pyx_k__input, sizeof(__pyx_k__input), 0, 0, 1, 1},
- {&__pyx_n_s__interf, __pyx_k__interf, sizeof(__pyx_k__interf), 0, 0, 1, 1},
- {&__pyx_n_s__latency, __pyx_k__latency, sizeof(__pyx_k__latency), 0, 0, 1, 1},
- {&__pyx_n_s__message, __pyx_k__message, sizeof(__pyx_k__message), 0, 0, 1, 1},
- {&__pyx_n_s__midi, __pyx_k__midi, sizeof(__pyx_k__midi), 0, 0, 1, 1},
- {&__pyx_n_s__msg, __pyx_k__msg, sizeof(__pyx_k__msg), 0, 0, 1, 1},
- {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
- {&__pyx_n_s__opened, __pyx_k__opened, sizeof(__pyx_k__opened), 0, 0, 1, 1},
- {&__pyx_n_s__output, __pyx_k__output, sizeof(__pyx_k__output), 0, 0, 1, 1},
- {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
- {&__pyx_n_s__status, __pyx_k__status, sizeof(__pyx_k__status), 0, 0, 1, 1},
- {&__pyx_n_s__timestamp, __pyx_k__timestamp, sizeof(__pyx_k__timestamp), 0, 0, 1, 1},
- {&__pyx_n_s__tostring, __pyx_k__tostring, sizeof(__pyx_k__tostring), 0, 0, 1, 1},
- {&__pyx_n_s__when, __pyx_k__when, sizeof(__pyx_k__when), 0, 0, 1, 1},
- {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x1 = PyInt_FromLong(0x1); if (unlikely(!__pyx_int_0x1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x2 = PyInt_FromLong(0x2); if (unlikely(!__pyx_int_0x2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x4 = PyInt_FromLong(0x4); if (unlikely(!__pyx_int_0x4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x8 = PyInt_FromLong(0x8); if (unlikely(!__pyx_int_0x8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x10 = PyInt_FromLong(0x10); if (unlikely(!__pyx_int_0x10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x20 = PyInt_FromLong(0x20); if (unlikely(!__pyx_int_0x20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x30 = PyInt_FromLong(0x30); if (unlikely(!__pyx_int_0x30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x40 = PyInt_FromLong(0x40); if (unlikely(!__pyx_int_0x40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x7F = PyInt_FromLong(0x7F); if (unlikely(!__pyx_int_0x7F)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x80 = PyInt_FromLong(0x80); if (unlikely(!__pyx_int_0x80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0xFF = PyInt_FromLong(0xFF); if (unlikely(!__pyx_int_0xFF)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x100 = PyInt_FromLong(0x100); if (unlikely(!__pyx_int_0x100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x200 = PyInt_FromLong(0x200); if (unlikely(!__pyx_int_0x200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x300 = PyInt_FromLong(0x300); if (unlikely(!__pyx_int_0x300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x400 = PyInt_FromLong(0x400); if (unlikely(!__pyx_int_0x400)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x800 = PyInt_FromLong(0x800); if (unlikely(!__pyx_int_0x800)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x1000 = PyInt_FromLong(0x1000); if (unlikely(!__pyx_int_0x1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x2000 = PyInt_FromLong(0x2000); if (unlikely(!__pyx_int_0x2000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x4000 = PyInt_FromLong(0x4000); if (unlikely(!__pyx_int_0x4000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x8000 = PyInt_FromLong(0x8000); if (unlikely(!__pyx_int_0x8000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0xFF00 = PyInt_FromLong(0xFF00); if (unlikely(!__pyx_int_0xFF00)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0x10000 = PyInt_FromLong(0x10000); if (unlikely(!__pyx_int_0x10000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0xFF0000 = PyInt_FromLong(0xFF0000); if (unlikely(!__pyx_int_0xFF0000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC init_pyportmidi(void); /*proto*/
-PyMODINIT_FUNC init_pyportmidi(void)
-#else
-PyMODINIT_FUNC PyInit__pyportmidi(void); /*proto*/
-PyMODINIT_FUNC PyInit__pyportmidi(void)
-#endif
-{
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- #if CYTHON_REFNANNY
- void* __pyx_refnanny = NULL;
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
- if (!__Pyx_RefNanny) {
- PyErr_Clear();
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
- if (!__Pyx_RefNanny)
- Py_FatalError("failed to import 'refnanny' module");
- }
- __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__pyportmidi(void)", __LINE__, __FILE__);
- #endif
- __pyx_init_filenames();
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #if PY_MAJOR_VERSION < 3
- __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- /*--- Library function declarations ---*/
- /*--- Threads initialization code ---*/
- #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
- #ifdef WITH_THREAD /* Python build with threading support? */
- PyEval_InitThreads();
- #endif
- #endif
- /*--- Module creation code ---*/
- #if PY_MAJOR_VERSION < 3
- __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_pyportmidi"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
- #else
- __pyx_m = PyModule_Create(&__pyx_moduledef);
- #endif
- if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- #if PY_MAJOR_VERSION < 3
- Py_INCREF(__pyx_m);
- #endif
- __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
- if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- /*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_module_is_main__pyportmidi) {
- if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- }
- /*--- Builtin init code ---*/
- if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Global init code ---*/
- /*--- Function export code ---*/
- /*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type_11_pyportmidi_Output) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "Output", (PyObject *)&__pyx_type_11_pyportmidi_Output) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_11_pyportmidi_Output = &__pyx_type_11_pyportmidi_Output;
- if (PyType_Ready(&__pyx_type_11_pyportmidi_Input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "Input", (PyObject *)&__pyx_type_11_pyportmidi_Input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_11_pyportmidi_Input = &__pyx_type_11_pyportmidi_Input;
- /*--- Type import code ---*/
- /*--- Function import code ---*/
- /*--- Execution code ---*/
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":7
- * # harrison@media.mit.edu
- * # written in Pyrex
- * __version__="0.07" # <<<<<<<<<<<<<<
- *
- * import array
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_17)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":9
- * __version__="0.07"
- *
- * import array # <<<<<<<<<<<<<<
- *
- * # CHANGES:
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__array), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__array, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":108
- * PtTimestamp Pt_Time()
- *
- * FILT_ACTIVE=0x1 # <<<<<<<<<<<<<<
- * FILT_SYSEX=0x2
- * FILT_CLOCK=0x4
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_ACTIVE, __pyx_int_0x1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":109
- *
- * FILT_ACTIVE=0x1
- * FILT_SYSEX=0x2 # <<<<<<<<<<<<<<
- * FILT_CLOCK=0x4
- * FILT_PLAY=0x8
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_SYSEX, __pyx_int_0x2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":110
- * FILT_ACTIVE=0x1
- * FILT_SYSEX=0x2
- * FILT_CLOCK=0x4 # <<<<<<<<<<<<<<
- * FILT_PLAY=0x8
- * FILT_F9=0x10
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_CLOCK, __pyx_int_0x4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":111
- * FILT_SYSEX=0x2
- * FILT_CLOCK=0x4
- * FILT_PLAY=0x8 # <<<<<<<<<<<<<<
- * FILT_F9=0x10
- * FILT_TICK=0x10
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_PLAY, __pyx_int_0x8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":112
- * FILT_CLOCK=0x4
- * FILT_PLAY=0x8
- * FILT_F9=0x10 # <<<<<<<<<<<<<<
- * FILT_TICK=0x10
- * FILT_FD=0x20
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_F9, __pyx_int_0x10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":113
- * FILT_PLAY=0x8
- * FILT_F9=0x10
- * FILT_TICK=0x10 # <<<<<<<<<<<<<<
- * FILT_FD=0x20
- * FILT_UNDEFINED=0x30
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_TICK, __pyx_int_0x10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":114
- * FILT_F9=0x10
- * FILT_TICK=0x10
- * FILT_FD=0x20 # <<<<<<<<<<<<<<
- * FILT_UNDEFINED=0x30
- * FILT_RESET=0x40
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_FD, __pyx_int_0x20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":115
- * FILT_TICK=0x10
- * FILT_FD=0x20
- * FILT_UNDEFINED=0x30 # <<<<<<<<<<<<<<
- * FILT_RESET=0x40
- * FILT_REALTIME=0x7F
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_UNDEFINED, __pyx_int_0x30) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":116
- * FILT_FD=0x20
- * FILT_UNDEFINED=0x30
- * FILT_RESET=0x40 # <<<<<<<<<<<<<<
- * FILT_REALTIME=0x7F
- * FILT_NOTE=0x80
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_RESET, __pyx_int_0x40) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":117
- * FILT_UNDEFINED=0x30
- * FILT_RESET=0x40
- * FILT_REALTIME=0x7F # <<<<<<<<<<<<<<
- * FILT_NOTE=0x80
- * FILT_CHANNEL_AFTERTOUCH=0x100
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_REALTIME, __pyx_int_0x7F) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":118
- * FILT_RESET=0x40
- * FILT_REALTIME=0x7F
- * FILT_NOTE=0x80 # <<<<<<<<<<<<<<
- * FILT_CHANNEL_AFTERTOUCH=0x100
- * FILT_POLY_AFTERTOUCH=0x200
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_NOTE, __pyx_int_0x80) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":119
- * FILT_REALTIME=0x7F
- * FILT_NOTE=0x80
- * FILT_CHANNEL_AFTERTOUCH=0x100 # <<<<<<<<<<<<<<
- * FILT_POLY_AFTERTOUCH=0x200
- * FILT_AFTERTOUCH=0x300
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_18, __pyx_int_0x100) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":120
- * FILT_NOTE=0x80
- * FILT_CHANNEL_AFTERTOUCH=0x100
- * FILT_POLY_AFTERTOUCH=0x200 # <<<<<<<<<<<<<<
- * FILT_AFTERTOUCH=0x300
- * FILT_PROGRAM=0x400
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_19, __pyx_int_0x200) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":121
- * FILT_CHANNEL_AFTERTOUCH=0x100
- * FILT_POLY_AFTERTOUCH=0x200
- * FILT_AFTERTOUCH=0x300 # <<<<<<<<<<<<<<
- * FILT_PROGRAM=0x400
- * FILT_CONTROL=0x800
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_AFTERTOUCH, __pyx_int_0x300) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":122
- * FILT_POLY_AFTERTOUCH=0x200
- * FILT_AFTERTOUCH=0x300
- * FILT_PROGRAM=0x400 # <<<<<<<<<<<<<<
- * FILT_CONTROL=0x800
- * FILT_PITCHBEND=0x1000
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_PROGRAM, __pyx_int_0x400) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":123
- * FILT_AFTERTOUCH=0x300
- * FILT_PROGRAM=0x400
- * FILT_CONTROL=0x800 # <<<<<<<<<<<<<<
- * FILT_PITCHBEND=0x1000
- * FILT_MTC=0x2000
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_CONTROL, __pyx_int_0x800) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":124
- * FILT_PROGRAM=0x400
- * FILT_CONTROL=0x800
- * FILT_PITCHBEND=0x1000 # <<<<<<<<<<<<<<
- * FILT_MTC=0x2000
- * FILT_SONG_POSITION=0x4000
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_PITCHBEND, __pyx_int_0x1000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":125
- * FILT_CONTROL=0x800
- * FILT_PITCHBEND=0x1000
- * FILT_MTC=0x2000 # <<<<<<<<<<<<<<
- * FILT_SONG_POSITION=0x4000
- * FILT_SONG_SELECT=0x8000
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_MTC, __pyx_int_0x2000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":126
- * FILT_PITCHBEND=0x1000
- * FILT_MTC=0x2000
- * FILT_SONG_POSITION=0x4000 # <<<<<<<<<<<<<<
- * FILT_SONG_SELECT=0x8000
- * FILT_TUNE=0x10000
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_SONG_POSITION, __pyx_int_0x4000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":127
- * FILT_MTC=0x2000
- * FILT_SONG_POSITION=0x4000
- * FILT_SONG_SELECT=0x8000 # <<<<<<<<<<<<<<
- * FILT_TUNE=0x10000
- * FALSE=0
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_SONG_SELECT, __pyx_int_0x8000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":128
- * FILT_SONG_POSITION=0x4000
- * FILT_SONG_SELECT=0x8000
- * FILT_TUNE=0x10000 # <<<<<<<<<<<<<<
- * FALSE=0
- * TRUE=1
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FILT_TUNE, __pyx_int_0x10000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":129
- * FILT_SONG_SELECT=0x8000
- * FILT_TUNE=0x10000
- * FALSE=0 # <<<<<<<<<<<<<<
- * TRUE=1
- *
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FALSE, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":130
- * FILT_TUNE=0x10000
- * FALSE=0
- * TRUE=1 # <<<<<<<<<<<<<<
- *
- * def Initialize():
- */
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TRUE, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/Users/rene/dev/portmedia/portmedia/portmidi/trunk/pm_python/pyportmidi/_pyportmidi.pyx":1
- * # pyPortMidi # <<<<<<<<<<<<<<
- * # Python bindings for PortMidi
- * # John Harrison
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Initialize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__");
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_20), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Terminate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_21), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__GetDeviceInfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__");
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_22), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_23), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__GetErrorText); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__");
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_24), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Channel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_25), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___check_open); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_26), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Close); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_27), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Abort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_28), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_29), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__WriteShort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_30), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__WriteSysEx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_31), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Input); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___check_open); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_32), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Input); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Close); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_33), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Input); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__SetFilter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_34), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Input); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__SetChannelMask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_35), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Input); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Poll); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_36), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Input); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Read); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_37), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- if (__pyx_m) {
- __Pyx_AddTraceback("init _pyportmidi");
- Py_DECREF(__pyx_m); __pyx_m = 0;
- } else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init _pyportmidi");
- }
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- #if PY_MAJOR_VERSION < 3
- return;
- #else
- return __pyx_m;
- #endif
-}
-
-static const char *__pyx_filenames[] = {
- "_pyportmidi.pyx",
-};
-
-/* Runtime support code */
-
-static void __pyx_init_filenames(void) {
- __pyx_f = __pyx_filenames;
-}
-
-static void __Pyx_RaiseDoubleKeywordsError(
- const char* func_name,
- PyObject* kw_name)
-{
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION >= 3
- "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
- #else
- "%s() got multiple values for keyword argument '%s'", func_name,
- PyString_AS_STRING(kw_name));
- #endif
-}
-
-static void __Pyx_RaiseArgtupleInvalid(
- const char* func_name,
- int exact,
- Py_ssize_t num_min,
- Py_ssize_t num_max,
- Py_ssize_t num_found)
-{
- Py_ssize_t num_expected;
- const char *number, *more_or_less;
-
- if (num_found < num_min) {
- num_expected = num_min;
- more_or_less = "at least";
- } else {
- num_expected = num_max;
- more_or_less = "at most";
- }
- if (exact) {
- more_or_less = "exactly";
- }
- number = (num_expected == 1) ? "" : "s";
- PyErr_Format(PyExc_TypeError,
- #if PY_VERSION_HEX < 0x02050000
- "%s() takes %s %d positional argument%s (%d given)",
- #else
- "%s() takes %s %zd positional argument%s (%zd given)",
- #endif
- func_name, more_or_less, num_expected, number, num_found);
-}
-
-static int __Pyx_ParseOptionalKeywords(
- PyObject *kwds,
- PyObject **argnames[],
- PyObject *kwds2,
- PyObject *values[],
- Py_ssize_t num_pos_args,
- const char* function_name)
-{
- PyObject *key = 0, *value = 0;
- Py_ssize_t pos = 0;
- PyObject*** name;
- PyObject*** first_kw_arg = argnames + num_pos_args;
-
- while (PyDict_Next(kwds, &pos, &key, &value)) {
- name = first_kw_arg;
- while (*name && (**name != key)) name++;
- if (*name) {
- values[name-argnames] = value;
- } else {
- #if PY_MAJOR_VERSION < 3
- if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
- #else
- if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
- #endif
- goto invalid_keyword_type;
- } else {
- for (name = first_kw_arg; *name; name++) {
- #if PY_MAJOR_VERSION >= 3
- if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
- PyUnicode_Compare(**name, key) == 0) break;
- #else
- if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
- _PyString_Eq(**name, key)) break;
- #endif
- }
- if (*name) {
- values[name-argnames] = value;
- } else {
- /* unexpected keyword found */
- for (name=argnames; name != first_kw_arg; name++) {
- if (**name == key) goto arg_passed_twice;
- #if PY_MAJOR_VERSION >= 3
- if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
- PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
- #else
- if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
- _PyString_Eq(**name, key)) goto arg_passed_twice;
- #endif
- }
- if (kwds2) {
- if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
- } else {
- goto invalid_keyword;
- }
- }
- }
- }
- }
- return 0;
-arg_passed_twice:
- __Pyx_RaiseDoubleKeywordsError(function_name, **name);
- goto bad;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%s() keywords must be strings", function_name);
- goto bad;
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%s() got an unexpected keyword argument '%s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
-bad:
- return -1;
-}
-
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
- PyObject *__import__ = 0;
- PyObject *empty_list = 0;
- PyObject *module = 0;
- PyObject *global_dict = 0;
- PyObject *empty_dict = 0;
- PyObject *list;
- __import__ = __Pyx_GetAttrString(__pyx_b, "__import__");
- if (!__import__)
- goto bad;
- if (from_list)
- list = from_list;
- else {
- empty_list = PyList_New(0);
- if (!empty_list)
- goto bad;
- list = empty_list;
- }
- global_dict = PyModule_GetDict(__pyx_m);
- if (!global_dict)
- goto bad;
- empty_dict = PyDict_New();
- if (!empty_dict)
- goto bad;
- module = PyObject_CallFunctionObjArgs(__import__,
- name, global_dict, empty_dict, list, NULL);
-bad:
- Py_XDECREF(empty_list);
- Py_XDECREF(__import__);
- Py_XDECREF(empty_dict);
- return module;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_PmDeviceID(PmDeviceID val) {
- const PmDeviceID neg_one = (PmDeviceID)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(PmDeviceID) < sizeof(long)) {
- return PyInt_FromLong((long)val);
- } else if (sizeof(PmDeviceID) == sizeof(long)) {
- if (is_unsigned)
- return PyLong_FromUnsignedLong((unsigned long)val);
- else
- return PyInt_FromLong((long)val);
- } else { /* (sizeof(PmDeviceID) > sizeof(long)) */
- if (is_unsigned)
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
- else
- return PyLong_FromLongLong((PY_LONG_LONG)val);
- }
-}
-
-static CYTHON_INLINE PmDeviceID __Pyx_PyInt_from_py_PmDeviceID(PyObject* x) {
- const PmDeviceID neg_one = (PmDeviceID)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(PmDeviceID) == sizeof(char)) {
- if (is_unsigned)
- return (PmDeviceID)__Pyx_PyInt_AsUnsignedChar(x);
- else
- return (PmDeviceID)__Pyx_PyInt_AsSignedChar(x);
- } else if (sizeof(PmDeviceID) == sizeof(short)) {
- if (is_unsigned)
- return (PmDeviceID)__Pyx_PyInt_AsUnsignedShort(x);
- else
- return (PmDeviceID)__Pyx_PyInt_AsSignedShort(x);
- } else if (sizeof(PmDeviceID) == sizeof(int)) {
- if (is_unsigned)
- return (PmDeviceID)__Pyx_PyInt_AsUnsignedInt(x);
- else
- return (PmDeviceID)__Pyx_PyInt_AsSignedInt(x);
- } else if (sizeof(PmDeviceID) == sizeof(long)) {
- if (is_unsigned)
- return (PmDeviceID)__Pyx_PyInt_AsUnsignedLong(x);
- else
- return (PmDeviceID)__Pyx_PyInt_AsSignedLong(x);
- } else if (sizeof(PmDeviceID) == sizeof(PY_LONG_LONG)) {
- if (is_unsigned)
- return (PmDeviceID)__Pyx_PyInt_AsUnsignedLongLong(x);
- else
- return (PmDeviceID)__Pyx_PyInt_AsSignedLongLong(x);
-#if 0
- } else if (sizeof(PmDeviceID) > sizeof(short) &&
- sizeof(PmDeviceID) < sizeof(int)) { /* __int32 ILP64 ? */
- if (is_unsigned)
- return (PmDeviceID)__Pyx_PyInt_AsUnsignedInt(x);
- else
- return (PmDeviceID)__Pyx_PyInt_AsSignedInt(x);
-#endif
- }
- PyErr_SetString(PyExc_TypeError, "PmDeviceID");
- return (PmDeviceID)-1;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_PtTimestamp(PtTimestamp val) {
- const PtTimestamp neg_one = (PtTimestamp)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(PtTimestamp) < sizeof(long)) {
- return PyInt_FromLong((long)val);
- } else if (sizeof(PtTimestamp) == sizeof(long)) {
- if (is_unsigned)
- return PyLong_FromUnsignedLong((unsigned long)val);
- else
- return PyInt_FromLong((long)val);
- } else { /* (sizeof(PtTimestamp) > sizeof(long)) */
- if (is_unsigned)
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
- else
- return PyLong_FromLongLong((PY_LONG_LONG)val);
- }
-}
-
-#if PY_MAJOR_VERSION < 3
-static PyObject *__Pyx_GetStdout(void) {
- PyObject *f = PySys_GetObject((char *)"stdout");
- if (!f) {
- PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
- }
- return f;
-}
-
-static int __Pyx_Print(PyObject *arg_tuple, int newline) {
- PyObject *f;
- PyObject* v;
- int i;
-
- if (!(f = __Pyx_GetStdout()))
- return -1;
- for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
- if (PyFile_SoftSpace(f, 1)) {
- if (PyFile_WriteString(" ", f) < 0)
- return -1;
- }
- v = PyTuple_GET_ITEM(arg_tuple, i);
- if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
- return -1;
- if (PyString_Check(v)) {
- char *s = PyString_AsString(v);
- Py_ssize_t len = PyString_Size(v);
- if (len > 0 &&
- isspace(Py_CHARMASK(s[len-1])) &&
- s[len-1] != ' ')
- PyFile_SoftSpace(f, 0);
- }
- }
- if (newline) {
- if (PyFile_WriteString("\n", f) < 0)
- return -1;
- PyFile_SoftSpace(f, 0);
- }
- return 0;
-}
-
-#else /* Python 3 has a print function */
-
-static int __Pyx_Print(PyObject *arg_tuple, int newline) {
- PyObject* kwargs = 0;
- PyObject* result = 0;
- PyObject* end_string;
- if (!__pyx_print) {
- __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
- if (!__pyx_print)
- return -1;
- }
- if (!newline) {
- if (!__pyx_print_kwargs) {
- __pyx_print_kwargs = PyDict_New();
- if (!__pyx_print_kwargs)
- return -1;
- end_string = PyUnicode_FromStringAndSize(" ", 1);
- if (!end_string)
- return -1;
- if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
- Py_DECREF(end_string);
- return -1;
- }
- Py_DECREF(end_string);
- }
- kwargs = __pyx_print_kwargs;
- }
- result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
- if (!result)
- return -1;
- Py_DECREF(result);
- return 0;
-}
-
-#endif
-
-#if PY_MAJOR_VERSION < 3
-
-static int __Pyx_PrintOne(PyObject *o) {
- PyObject *f;
- if (!(f = __Pyx_GetStdout()))
- return -1;
- if (PyFile_SoftSpace(f, 0)) {
- if (PyFile_WriteString(" ", f) < 0)
- return -1;
- }
- if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
- return -1;
- if (PyFile_WriteString("\n", f) < 0)
- return -1;
- return 0;
- /* the line below is just to avoid compiler
- * compiler warnings about unused functions */
- return __Pyx_Print(NULL, 0);
-}
-
-#else /* Python 3 has a print function */
-
-static int __Pyx_PrintOne(PyObject *o) {
- int res;
- PyObject* arg_tuple = PyTuple_New(1);
- if (unlikely(!arg_tuple))
- return -1;
- Py_INCREF(o);
- PyTuple_SET_ITEM(arg_tuple, 0, o);
- res = __Pyx_Print(arg_tuple, 1);
- Py_DECREF(arg_tuple);
- return res;
-}
-
-#endif
-
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
- PyObject *result;
- result = PyObject_GetAttr(dict, name);
- if (!result)
- PyErr_SetObject(PyExc_NameError, name);
- return result;
-}
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
-
- tmp_type = tstate->curexc_type;
- tmp_value = tstate->curexc_value;
- tmp_tb = tstate->curexc_traceback;
- tstate->curexc_type = type;
- tstate->curexc_value = value;
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-}
-
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
- PyThreadState *tstate = PyThreadState_GET();
- *type = tstate->curexc_type;
- *value = tstate->curexc_value;
- *tb = tstate->curexc_traceback;
-
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-}
-
-
-#if PY_MAJOR_VERSION < 3
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
- Py_XINCREF(type);
- Py_XINCREF(value);
- Py_XINCREF(tb);
- /* First, check the traceback argument, replacing None with NULL. */
- if (tb == Py_None) {
- Py_DECREF(tb);
- tb = 0;
- }
- else if (tb != NULL && !PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto raise_error;
- }
- /* Next, replace a missing value with None */
- if (value == NULL) {
- value = Py_None;
- Py_INCREF(value);
- }
- #if PY_VERSION_HEX < 0x02050000
- if (!PyClass_Check(type))
- #else
- if (!PyType_Check(type))
- #endif
- {
- /* Raising an instance. The value should be a dummy. */
- if (value != Py_None) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto raise_error;
- }
- /* Normalize to raise <class>, <instance> */
- Py_DECREF(value);
- value = type;
- #if PY_VERSION_HEX < 0x02050000
- if (PyInstance_Check(type)) {
- type = (PyObject*) ((PyInstanceObject*)type)->in_class;
- Py_INCREF(type);
- }
- else {
- type = 0;
- PyErr_SetString(PyExc_TypeError,
- "raise: exception must be an old-style class or instance");
- goto raise_error;
- }
- #else
- type = (PyObject*) Py_TYPE(type);
- Py_INCREF(type);
- if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto raise_error;
- }
- #endif
- }
-
- __Pyx_ErrRestore(type, value, tb);
- return;
-raise_error:
- Py_XDECREF(value);
- Py_XDECREF(type);
- Py_XDECREF(tb);
- return;
-}
-
-#else /* Python 3+ */
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
- if (tb == Py_None) {
- tb = 0;
- } else if (tb && !PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto bad;
- }
- if (value == Py_None)
- value = 0;
-
- if (PyExceptionInstance_Check(type)) {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto bad;
- }
- value = type;
- type = (PyObject*) Py_TYPE(value);
- } else if (!PyExceptionClass_Check(type)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto bad;
- }
-
- PyErr_SetObject(type, value);
-
- if (tb) {
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* tmp_tb = tstate->curexc_traceback;
- if (tb != tmp_tb) {
- Py_INCREF(tb);
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_tb);
- }
- }
-
-bad:
- return;
-}
-#endif
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_PmMessage(PmMessage val) {
- const PmMessage neg_one = (PmMessage)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(PmMessage) < sizeof(long)) {
- return PyInt_FromLong((long)val);
- } else if (sizeof(PmMessage) == sizeof(long)) {
- if (is_unsigned)
- return PyLong_FromUnsignedLong((unsigned long)val);
- else
- return PyInt_FromLong((long)val);
- } else { /* (sizeof(PmMessage) > sizeof(long)) */
- if (is_unsigned)
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
- else
- return PyLong_FromLongLong((PY_LONG_LONG)val);
- }
-}
-
-static CYTHON_INLINE PmMessage __Pyx_PyInt_from_py_PmMessage(PyObject* x) {
- const PmMessage neg_one = (PmMessage)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(PmMessage) == sizeof(char)) {
- if (is_unsigned)
- return (PmMessage)__Pyx_PyInt_AsUnsignedChar(x);
- else
- return (PmMessage)__Pyx_PyInt_AsSignedChar(x);
- } else if (sizeof(PmMessage) == sizeof(short)) {
- if (is_unsigned)
- return (PmMessage)__Pyx_PyInt_AsUnsignedShort(x);
- else
- return (PmMessage)__Pyx_PyInt_AsSignedShort(x);
- } else if (sizeof(PmMessage) == sizeof(int)) {
- if (is_unsigned)
- return (PmMessage)__Pyx_PyInt_AsUnsignedInt(x);
- else
- return (PmMessage)__Pyx_PyInt_AsSignedInt(x);
- } else if (sizeof(PmMessage) == sizeof(long)) {
- if (is_unsigned)
- return (PmMessage)__Pyx_PyInt_AsUnsignedLong(x);
- else
- return (PmMessage)__Pyx_PyInt_AsSignedLong(x);
- } else if (sizeof(PmMessage) == sizeof(PY_LONG_LONG)) {
- if (is_unsigned)
- return (PmMessage)__Pyx_PyInt_AsUnsignedLongLong(x);
- else
- return (PmMessage)__Pyx_PyInt_AsSignedLongLong(x);
-#if 0
- } else if (sizeof(PmMessage) > sizeof(short) &&
- sizeof(PmMessage) < sizeof(int)) { /* __int32 ILP64 ? */
- if (is_unsigned)
- return (PmMessage)__Pyx_PyInt_AsUnsignedInt(x);
- else
- return (PmMessage)__Pyx_PyInt_AsSignedInt(x);
-#endif
- }
- PyErr_SetString(PyExc_TypeError, "PmMessage");
- return (PmMessage)-1;
-}
-
-static CYTHON_INLINE PmTimestamp __Pyx_PyInt_from_py_PmTimestamp(PyObject* x) {
- const PmTimestamp neg_one = (PmTimestamp)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(PmTimestamp) == sizeof(char)) {
- if (is_unsigned)
- return (PmTimestamp)__Pyx_PyInt_AsUnsignedChar(x);
- else
- return (PmTimestamp)__Pyx_PyInt_AsSignedChar(x);
- } else if (sizeof(PmTimestamp) == sizeof(short)) {
- if (is_unsigned)
- return (PmTimestamp)__Pyx_PyInt_AsUnsignedShort(x);
- else
- return (PmTimestamp)__Pyx_PyInt_AsSignedShort(x);
- } else if (sizeof(PmTimestamp) == sizeof(int)) {
- if (is_unsigned)
- return (PmTimestamp)__Pyx_PyInt_AsUnsignedInt(x);
- else
- return (PmTimestamp)__Pyx_PyInt_AsSignedInt(x);
- } else if (sizeof(PmTimestamp) == sizeof(long)) {
- if (is_unsigned)
- return (PmTimestamp)__Pyx_PyInt_AsUnsignedLong(x);
- else
- return (PmTimestamp)__Pyx_PyInt_AsSignedLong(x);
- } else if (sizeof(PmTimestamp) == sizeof(PY_LONG_LONG)) {
- if (is_unsigned)
- return (PmTimestamp)__Pyx_PyInt_AsUnsignedLongLong(x);
- else
- return (PmTimestamp)__Pyx_PyInt_AsSignedLongLong(x);
-#if 0
- } else if (sizeof(PmTimestamp) > sizeof(short) &&
- sizeof(PmTimestamp) < sizeof(int)) { /* __int32 ILP64 ? */
- if (is_unsigned)
- return (PmTimestamp)__Pyx_PyInt_AsUnsignedInt(x);
- else
- return (PmTimestamp)__Pyx_PyInt_AsSignedInt(x);
-#endif
- }
- PyErr_SetString(PyExc_TypeError, "PmTimestamp");
- return (PmTimestamp)-1;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_PmTimestamp(PmTimestamp val) {
- const PmTimestamp neg_one = (PmTimestamp)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(PmTimestamp) < sizeof(long)) {
- return PyInt_FromLong((long)val);
- } else if (sizeof(PmTimestamp) == sizeof(long)) {
- if (is_unsigned)
- return PyLong_FromUnsignedLong((unsigned long)val);
- else
- return PyInt_FromLong((long)val);
- } else { /* (sizeof(PmTimestamp) > sizeof(long)) */
- if (is_unsigned)
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
- else
- return PyLong_FromLongLong((PY_LONG_LONG)val);
- }
-}
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
- const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned char" :
- "value too large to convert to unsigned char");
- }
- return (unsigned char)-1;
- }
- return (unsigned char)val;
- }
- return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
- const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned short" :
- "value too large to convert to unsigned short");
- }
- return (unsigned short)-1;
- }
- return (unsigned short)val;
- }
- return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
- const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned int" :
- "value too large to convert to unsigned int");
- }
- return (unsigned int)-1;
- }
- return (unsigned int)val;
- }
- return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
- const char neg_one = (char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to char" :
- "value too large to convert to char");
- }
- return (char)-1;
- }
- return (char)val;
- }
- return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
- const short neg_one = (short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to short" :
- "value too large to convert to short");
- }
- return (short)-1;
- }
- return (short)val;
- }
- return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
- const int neg_one = (int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to int" :
- "value too large to convert to int");
- }
- return (int)-1;
- }
- return (int)val;
- }
- return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
- const signed char neg_one = (signed char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed char" :
- "value too large to convert to signed char");
- }
- return (signed char)-1;
- }
- return (signed char)val;
- }
- return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
- const signed short neg_one = (signed short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed short" :
- "value too large to convert to signed short");
- }
- return (signed short)-1;
- }
- return (signed short)val;
- }
- return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
- const signed int neg_one = (signed int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed int" :
- "value too large to convert to signed int");
- }
- return (signed int)-1;
- }
- return (signed int)val;
- }
- return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
- const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned long");
- return (unsigned long)-1;
- }
- return (unsigned long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned long");
- return (unsigned long)-1;
- }
- return PyLong_AsUnsignedLong(x);
- } else {
- return PyLong_AsLong(x);
- }
- } else {
- unsigned long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned long)-1;
- val = __Pyx_PyInt_AsUnsignedLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
- const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG)-1;
- }
- return (unsigned PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG)-1;
- }
- return PyLong_AsUnsignedLongLong(x);
- } else {
- return PyLong_AsLongLong(x);
- }
- } else {
- unsigned PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
- const long neg_one = (long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long)-1;
- }
- return (long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long)-1;
- }
- return PyLong_AsUnsignedLong(x);
- } else {
- return PyLong_AsLong(x);
- }
- } else {
- long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (long)-1;
- val = __Pyx_PyInt_AsLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
- const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to PY_LONG_LONG");
- return (PY_LONG_LONG)-1;
- }
- return (PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to PY_LONG_LONG");
- return (PY_LONG_LONG)-1;
- }
- return PyLong_AsUnsignedLongLong(x);
- } else {
- return PyLong_AsLongLong(x);
- }
- } else {
- PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
- const signed long neg_one = (signed long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed long");
- return (signed long)-1;
- }
- return (signed long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed long");
- return (signed long)-1;
- }
- return PyLong_AsUnsignedLong(x);
- } else {
- return PyLong_AsLong(x);
- }
- } else {
- signed long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed long)-1;
- val = __Pyx_PyInt_AsSignedLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
- const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed PY_LONG_LONG");
- return (signed PY_LONG_LONG)-1;
- }
- return (signed PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed PY_LONG_LONG");
- return (signed PY_LONG_LONG)-1;
- }
- return PyLong_AsUnsignedLongLong(x);
- } else {
- return PyLong_AsLongLong(x);
- }
- } else {
- signed PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsSignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-
-static void __Pyx_AddTraceback(const char *funcname) {
- PyObject *py_srcfile = 0;
- PyObject *py_funcname = 0;
- PyObject *py_globals = 0;
- PyCodeObject *py_code = 0;
- PyFrameObject *py_frame = 0;
-
- #if PY_MAJOR_VERSION < 3
- py_srcfile = PyString_FromString(__pyx_filename);
- #else
- py_srcfile = PyUnicode_FromString(__pyx_filename);
- #endif
- if (!py_srcfile) goto bad;
- if (__pyx_clineno) {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
- #else
- py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
- #endif
- }
- else {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromString(funcname);
- #else
- py_funcname = PyUnicode_FromString(funcname);
- #endif
- }
- if (!py_funcname) goto bad;
- py_globals = PyModule_GetDict(__pyx_m);
- if (!py_globals) goto bad;
- py_code = PyCode_New(
- 0, /*int argcount,*/
- #if PY_MAJOR_VERSION >= 3
- 0, /*int kwonlyargcount,*/
- #endif
- 0, /*int nlocals,*/
- 0, /*int stacksize,*/
- 0, /*int flags,*/
- __pyx_empty_bytes, /*PyObject *code,*/
- __pyx_empty_tuple, /*PyObject *consts,*/
- __pyx_empty_tuple, /*PyObject *names,*/
- __pyx_empty_tuple, /*PyObject *varnames,*/
- __pyx_empty_tuple, /*PyObject *freevars,*/
- __pyx_empty_tuple, /*PyObject *cellvars,*/
- py_srcfile, /*PyObject *filename,*/
- py_funcname, /*PyObject *name,*/
- __pyx_lineno, /*int firstlineno,*/
- __pyx_empty_bytes /*PyObject *lnotab*/
- );
- if (!py_code) goto bad;
- py_frame = PyFrame_New(
- PyThreadState_GET(), /*PyThreadState *tstate,*/
- py_code, /*PyCodeObject *code,*/
- py_globals, /*PyObject *globals,*/
- 0 /*PyObject *locals*/
- );
- if (!py_frame) goto bad;
- py_frame->f_lineno = __pyx_lineno;
- PyTraceBack_Here(py_frame);
-bad:
- Py_XDECREF(py_srcfile);
- Py_XDECREF(py_funcname);
- Py_XDECREF(py_code);
- Py_XDECREF(py_frame);
-}
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
- while (t->p) {
- #if PY_MAJOR_VERSION < 3
- if (t->is_unicode) {
- *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
- } else if (t->intern) {
- *t->p = PyString_InternFromString(t->s);
- } else {
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
- }
- #else /* Python 3+ has unicode identifiers */
- if (t->is_unicode | t->is_str) {
- if (t->intern) {
- *t->p = PyUnicode_InternFromString(t->s);
- } else if (t->encoding) {
- *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
- } else {
- *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
- }
- } else {
- *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
- }
- #endif
- if (!*t->p)
- return -1;
- ++t;
- }
- return 0;
-}
-
-/* Type Conversion Functions */
-
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
- if (x == Py_True) return 1;
- else if ((x == Py_False) | (x == Py_None)) return 0;
- else return PyObject_IsTrue(x);
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
- PyNumberMethods *m;
- const char *name = NULL;
- PyObject *res = NULL;
-#if PY_VERSION_HEX < 0x03000000
- if (PyInt_Check(x) || PyLong_Check(x))
-#else
- if (PyLong_Check(x))
-#endif
- return Py_INCREF(x), x;
- m = Py_TYPE(x)->tp_as_number;
-#if PY_VERSION_HEX < 0x03000000
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Int(x);
- }
- else if (m && m->nb_long) {
- name = "long";
- res = PyNumber_Long(x);
- }
-#else
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Long(x);
- }
-#endif
- if (res) {
-#if PY_VERSION_HEX < 0x03000000
- if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
- if (!PyLong_Check(res)) {
-#endif
- PyErr_Format(PyExc_TypeError,
- "__%s__ returned non-%s (type %.200s)",
- name, name, Py_TYPE(res)->tp_name);
- Py_DECREF(res);
- return NULL;
- }
- }
- else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError,
- "an integer is required");
- }
- return res;
-}
-
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject* x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
-#if PY_VERSION_HEX < 0x02050000
- if (ival <= LONG_MAX)
- return PyInt_FromLong((long)ival);
- else {
- unsigned char *bytes = (unsigned char *) &ival;
- int one = 1; int little = (int)*(unsigned char*)&one;
- return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
- }
-#else
- return PyInt_FromSize_t(ival);
-#endif
-}
-
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
- unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
- if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
- return (size_t)-1;
- } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to size_t");
- return (size_t)-1;
- }
- return (size_t)val;
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/3rdparty/portmidi/pm_python/pyportmidi/_pyportmidi.pyx b/3rdparty/portmidi/pm_python/pyportmidi/_pyportmidi.pyx
deleted file mode 100644
index e43bd2b28b4..00000000000
--- a/3rdparty/portmidi/pm_python/pyportmidi/_pyportmidi.pyx
+++ /dev/null
@@ -1,537 +0,0 @@
-# pyPortMidi
-# Python bindings for PortMidi
-# John Harrison
-# http://sound.media.mit.edu/~harrison
-# harrison@media.mit.edu
-# written in Pyrex
-__version__="0.07"
-
-import array
-
-# CHANGES:
-
-# 0.0.5: (June 1st, 2009)
-# Output no longer calls abort when it deallocates.
-# Added abort and close methods.
-# Need to call Abort() explicityly if you want that to happen.
-
-
-#
-# 0.0.3: (March 15, 2005)
-# changed everything from tuples to lists
-# return 4 values for PmRead instead of 3 (for SysEx)
-# minor fixes for flexibility and error checking
-# flushed out DistUtils package and added Mac and Linux compile support
-# Markus Pfaff: added ability for WriteSysEx to accept lists as well
-# as strings
-
-# 0.0.2:
-# fixed pointer to function calls to avoid necessity of pyport library
-
-# 0.0.1:
-# initial release
-
-cdef extern from "portmidi.h":
- ctypedef enum PmError:
- pmNoError = 0,
- pmHostError = -10000,
- pmInvalidDeviceId, #/* out of range or output device when input is requested or vice versa */
- pmInsufficientMemory,
- pmBufferTooSmall,
- pmBufferOverflow,
- pmBadPtr,
- pmBadData, #/* illegal midi data, e.g. missing EOX */
- pmInternalError,
- pmBufferMaxSize, #/* buffer is already as large as it can be */
- PmError Pm_Initialize()
- PmError Pm_Terminate()
- ctypedef void PortMidiStream
- ctypedef PortMidiStream PmStream # CHECK THIS!
- ctypedef int PmDeviceID
- int Pm_HasHostError( PortMidiStream * stream )
- char *Pm_GetErrorText( PmError errnum )
- Pm_GetHostErrorText(char * msg, unsigned int len)
- ctypedef struct PmDeviceInfo:
- int structVersion
- char *interf #/* underlying MIDI API, e.g. MMSystem or DirectX */
- char *name #/* device name, e.g. USB MidiSport 1x1 */
- int input #/* true iff input is available */
- int output #/* true iff output is available */
- int opened #/* used by generic PortMidi code to do error checking on arguments */
- int Pm_CountDevices()
- PmDeviceID Pm_GetDefaultInputDeviceID()
- PmDeviceID Pm_GetDefaultOutputDeviceID()
- ctypedef long PmTimestamp
- ctypedef PmTimestamp (*PmTimeProcPtr)(void *time_info)
- #PmBefore is not defined...
- PmDeviceInfo* Pm_GetDeviceInfo( PmDeviceID id )
- PmError Pm_OpenInput( PortMidiStream** stream,
- PmDeviceID inputDevice,
- void *inputDriverInfo,
- long bufferSize,
- long (*PmPtr) (), # long = PtTimestamp
- void *time_info )
- PmError Pm_OpenOutput( PortMidiStream** stream,
- PmDeviceID outputDevice,
- void *outputDriverInfo,
- long bufferSize,
- #long (*PmPtr) (), # long = PtTimestamp
- PmTimeProcPtr time_proc, # long = PtTimestamp
- void *time_info,
- long latency )
- PmError Pm_SetFilter( PortMidiStream* stream, long filters )
- PmError Pm_Abort( PortMidiStream* stream )
- PmError Pm_Close( PortMidiStream* stream )
- ctypedef long PmMessage
- ctypedef struct PmEvent:
- PmMessage message
- PmTimestamp timestamp
- PmError Pm_Read( PortMidiStream *stream, PmEvent *buffer, long length )
- PmError Pm_Poll( PortMidiStream *stream)
- int Pm_Channel(int channel)
- PmError Pm_SetChannelMask(PortMidiStream *stream, int mask)
- PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, long length )
- PmError Pm_WriteSysEx( PortMidiStream *stream, PmTimestamp when, unsigned char *msg)
-
-cdef extern from "porttime.h":
- ctypedef enum PtError:
- ptNoError = 0,
- ptHostError = -10000,
- ptAlreadyStarted,
- ptAlreadyStopped,
- ptInsufficientMemory
- ctypedef long PtTimestamp
- ctypedef void (* PtCallback)( PtTimestamp timestamp, void *userData )
- PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
- PtTimestamp Pt_Time()
-
-FILT_ACTIVE=0x1
-FILT_SYSEX=0x2
-FILT_CLOCK=0x4
-FILT_PLAY=0x8
-FILT_F9=0x10
-FILT_TICK=0x10
-FILT_FD=0x20
-FILT_UNDEFINED=0x30
-FILT_RESET=0x40
-FILT_REALTIME=0x7F
-FILT_NOTE=0x80
-FILT_CHANNEL_AFTERTOUCH=0x100
-FILT_POLY_AFTERTOUCH=0x200
-FILT_AFTERTOUCH=0x300
-FILT_PROGRAM=0x400
-FILT_CONTROL=0x800
-FILT_PITCHBEND=0x1000
-FILT_MTC=0x2000
-FILT_SONG_POSITION=0x4000
-FILT_SONG_SELECT=0x8000
-FILT_TUNE=0x10000
-FALSE=0
-TRUE=1
-
-def Initialize():
- """
-Initialize: call this first
- """
- Pm_Initialize()
- Pt_Start(1, NULL, NULL) # /* equiv to TIME_START: start timer w/ ms accuracy */
-
-def Terminate():
- """
-Terminate: call this to clean up Midi streams when done.
-If you do not call this on Windows machines when you are
-done with MIDI, your system may crash.
- """
- Pm_Terminate()
-
-def GetDefaultInputDeviceID():
- return Pm_GetDefaultInputDeviceID()
-
-def GetDefaultOutputDeviceID():
- return Pm_GetDefaultOutputDeviceID()
-
-def CountDevices():
- return Pm_CountDevices()
-
-def GetDeviceInfo(i):
- """
-GetDeviceInfo(<device number>): returns 5 parameters
- - underlying MIDI API
- - device name
- - TRUE iff input is available
- - TRUE iff output is available
- - TRUE iff device stream is already open
- """
- cdef PmDeviceInfo *info
-
- # disregarding the constness from Pm_GetDeviceInfo, since pyrex doesn't do const.
- info = <PmDeviceInfo *>Pm_GetDeviceInfo(i)
-
- if info <> NULL: return info.interf, info.name, info.input, info.output, info.opened
- else: return
-
-def Time():
- """
-Time() returns the current time in ms
-of the PortMidi timer
- """
- return Pt_Time()
-
-def GetErrorText(err):
- """
-GetErrorText(<err num>) returns human-readable error
-messages translated from error numbers
- """
- return Pm_GetErrorText(err)
-
-def Channel(chan):
- """
-Channel(<chan>) is used with ChannelMask on input MIDI streams.
-Example: to receive input on channels 1 and 10 on a MIDI
- stream called MidiIn:
-MidiIn.SetChannelMask(pypm.Channel(1) | pypm.Channel(10))
-
-note: PyPortMidi Channel function has been altered from
- the original PortMidi c call to correct for what
- seems to be a bug --- i.e. channel filters were
- all numbered from 0 to 15 instead of 1 to 16.
- """
- return Pm_Channel(chan-1)
-
-cdef class Output:
- """
-class Output:
- define an output MIDI stream. Takes the form:
- x = pypm.Output(MidiOutputDevice, latency)
- latency is in ms.
- If latency = 0 then timestamps for output are ignored.
- """
- cdef int i
- cdef PmStream *midi
- cdef int debug
- cdef int _aborted
-
- def __init__(self, OutputDevice, latency=0):
-
- cdef PmError err
- #cdef PtTimestamp (*PmPtr) ()
- cdef PmTimeProcPtr PmPtr
-
- self.i = OutputDevice
- self.debug = 0
- self._aborted = 0
-
- if latency == 0:
- PmPtr = NULL
- else:
- PmPtr = <PmTimeProcPtr>&Pt_Time
- if self.debug: print "Opening Midi Output"
- # Why is bufferSize 0 here?
- err = Pm_OpenOutput(&(self.midi), self.i, NULL, 0, PmPtr, NULL, latency)
- if err < 0:
- s = Pm_GetErrorText(err)
- # Something's amiss here - if we try to throw an Exception
- # here, we crash.
- if not err == -10000:
- raise Exception,s
- else:
- print "Unable to open Midi OutputDevice=",OutputDevice," err=",s
-
- def __dealloc__(self):
- if self.debug: print "Closing MIDI output stream and destroying instance"
- #err = Pm_Abort(self.midi)
- #if err < 0: raise Exception, Pm_GetErrorText(err)
- err = Pm_Close(self.midi)
- if err < 0: raise Exception, Pm_GetErrorText(err)
-
-
- def _check_open(self):
- """ checks to see if the midi is open, and if not, raises an error.
- """
-
- if self.midi == NULL:
- raise Exception, "midi Output not open."
-
- if self._aborted:
- raise Exception, "midi Output aborted. Need to call Close after Abort."
-
- def Close(self):
- """
-Close()
- closes a midi stream, flushing any pending buffers.
- (PortMidi attempts to close open streams when the application
- exits -- this is particularly difficult under Windows.)
- """
- #if not self.midi:
- # return
-
- err = Pm_Close(self.midi)
- if err < 0:
- raise Exception, Pm_GetErrorText(err)
- #self.midi = NULL
-
-
- def Abort(self):
- """
-Abort() terminates outgoing messages immediately
- The caller should immediately close the output port;
- this call may result in transmission of a partial midi message.
- There is no abort for Midi input because the user can simply
- ignore messages in the buffer and close an input device at
- any time.
- """
- #if not self.midi:
- # return
-
- err = Pm_Abort(self.midi)
- if err < 0:
- raise Exception, Pm_GetErrorText(err)
-
- self._aborted = 1
-
-
- def Write(self, data):
- """
-Write(data)
- output a series of MIDI information in the form of a list:
- Write([[[status <,data1><,data2><,data3>],timestamp],
- [[status <,data1><,data2><,data3>],timestamp],...])
- <data> fields are optional
- example: choose program change 1 at time 20000 and
- send note 65 with velocity 100 500 ms later.
- Write([[[0xc0,0,0],20000],[[0x90,60,100],20500]])
- notes:
- 1. timestamps will be ignored if latency = 0.
- 2. To get a note to play immediately, send MIDI info with
- timestamp read from function Time.
- 3. understanding optional data fields:
- Write([[[0xc0,0,0],20000]]) is equivalent to
- Write([[[0xc0],20000]])
- """
- cdef PmEvent buffer[1024]
- cdef PmError err
- cdef int i
-
- self._check_open()
-
-
- if len(data) > 1024: raise IndexError, 'maximum list length is 1024'
- else:
- for loop1 in range(len(data)):
- if ((len(data[loop1][0]) > 4) |
- (len(data[loop1][0]) < 1)):
- raise IndexError, str(len(data[loop1][0]))+' arguments in event list'
- buffer[loop1].message = 0
- for i in range(len(data[loop1][0])):
- buffer[loop1].message = buffer[loop1].message + ((data[loop1][0][i]&0xFF) << (8*i))
- buffer[loop1].timestamp = data[loop1][1]
- if self.debug: print loop1," : ",buffer[loop1].message," : ",buffer[loop1].timestamp
- if self.debug: print "writing to midi buffer"
- err= Pm_Write(self.midi, buffer, len(data))
- if err < 0: raise Exception, Pm_GetErrorText(err)
-
- def WriteShort(self, status, data1 = 0, data2 = 0):
- """
-WriteShort(status <, data1><, data2>)
- output MIDI information of 3 bytes or less.
- data fields are optional
- status byte could be:
- 0xc0 = program change
- 0x90 = note on
- etc.
- data bytes are optional and assumed 0 if omitted
- example: note 65 on with velocity 100
- WriteShort(0x90,65,100)
- """
- cdef PmEvent buffer[1]
- cdef PmError err
- self._check_open()
-
- buffer[0].timestamp = Pt_Time()
- buffer[0].message = ((((data2) << 16) & 0xFF0000) | (((data1) << 8) & 0xFF00) | ((status) & 0xFF))
- if self.debug: print "Writing to MIDI buffer"
- err = Pm_Write(self.midi, buffer, 1) # stream, buffer, length
- if err < 0 : raise Exception, Pm_GetErrorText(err)
-
- def WriteSysEx(self, when, msg):
- """
- WriteSysEx(<timestamp>,<msg>)
- writes a timestamped system-exclusive midi message.
- <msg> can be a *list* or a *string*
- example:
- (assuming y is an input MIDI stream)
- y.WriteSysEx(0,'\\xF0\\x7D\\x10\\x11\\x12\\x13\\xF7')
- is equivalent to
- y.WriteSysEx(pypm.Time,
- [0xF0, 0x7D, 0x10, 0x11, 0x12, 0x13, 0xF7])
- """
- cdef PmError err
- cdef char *cmsg
- cdef PtTimestamp CurTime
-
- self._check_open()
-
- if type(msg) is list:
- msg = array.array('B',msg).tostring() # Markus Pfaff contribution
- cmsg = msg
-
- CurTime = Pt_Time()
- err = Pm_WriteSysEx(self.midi, when, <unsigned char *> cmsg)
- if err < 0 : raise Exception, Pm_GetErrorText(err)
- while Pt_Time() == CurTime: # wait for SysEx to go thru or...my
- pass # win32 machine crashes w/ multiple SysEx
-
-
-
-
-
-
-
-
-
-
-
-cdef class Input:
- """
-class Input:
- define an input MIDI stream. Takes the form:
- x = pypm.Input(MidiInputDevice)
- """
- cdef PmStream *midi
- cdef int debug
- cdef int i
-
- def __init__(self, InputDevice, buffersize=4096):
- cdef PmError err
- self.i = InputDevice
- self.debug = 0
- err= Pm_OpenInput(&(self.midi),self.i,NULL,buffersize,&Pt_Time,NULL)
- if err < 0: raise Exception, Pm_GetErrorText(err)
- if self.debug: print "MIDI input opened."
-
- def __dealloc__(self):
- cdef PmError err
- if self.debug: print "Closing MIDI input stream and destroying instance"
-
- err = Pm_Close(self.midi)
- if err < 0:
- raise Exception, Pm_GetErrorText(err)
-
-
-
- def _check_open(self):
- """ checks to see if the midi is open, and if not, raises an error.
- """
-
- if self.midi == NULL:
- raise Exception, "midi Input not open."
-
-
- def Close(self):
- """
-Close()
- closes a midi stream, flushing any pending buffers.
- (PortMidi attempts to close open streams when the application
- exits -- this is particularly difficult under Windows.)
- """
- #if not self.midi:
- # return
-
- err = Pm_Close(self.midi)
- if err < 0:
- raise Exception, Pm_GetErrorText(err)
- #self.midi = NULL
-
-
-
- def SetFilter(self, filters):
- """
- SetFilter(<filters>) sets filters on an open input stream
- to drop selected input types. By default, only active sensing
- messages are filtered. To prohibit, say, active sensing and
- sysex messages, call
- SetFilter(stream, FILT_ACTIVE | FILT_SYSEX);
-
- Filtering is useful when midi routing or midi thru functionality
- is being provided by the user application.
- For example, you may want to exclude timing messages
- (clock, MTC, start/stop/continue), while allowing note-related
- messages to pass. Or you may be using a sequencer or drum-machine
- for MIDI clock information but want to exclude any notes
- it may play.
-
- Note: SetFilter empties the buffer after setting the filter,
- just in case anything got through.
- """
- cdef PmEvent buffer[1]
- cdef PmError err
-
- self._check_open()
-
-
- err = Pm_SetFilter(self.midi, filters)
-
- if err < 0: raise Exception, Pm_GetErrorText(err)
-
- while(Pm_Poll(self.midi) != pmNoError):
-
- err = Pm_Read(self.midi,buffer,1)
- if err < 0: raise Exception, Pm_GetErrorText(err)
-
- def SetChannelMask(self, mask):
- """
- SetChannelMask(<mask>) filters incoming messages based on channel.
- The mask is a 16-bit bitfield corresponding to appropriate channels
- Channel(<channel>) can assist in calling this function.
- i.e. to set receive only input on channel 1, call with
- SetChannelMask(Channel(1))
- Multiple channels should be OR'd together, like
- SetChannelMask(Channel(10) | Channel(11))
- note: PyPortMidi Channel function has been altered from
- the original PortMidi c call to correct for what
- seems to be a bug --- i.e. channel filters were
- all numbered from 0 to 15 instead of 1 to 16.
- """
- cdef PmError err
-
- self._check_open()
-
- err = Pm_SetChannelMask(self.midi,mask)
- if err < 0: raise Exception, Pm_GetErrorText(err)
-
- def Poll(self):
- """
- Poll tests whether input is available,
- returning TRUE, FALSE, or an error value.
- """
- cdef PmError err
- self._check_open()
-
- err = Pm_Poll(self.midi)
- if err < 0: raise Exception, Pm_GetErrorText(err)
- return err
-
- def Read(self,length):
- """
-Read(length): returns up to <length> midi events stored in
-the buffer and returns them as a list:
-[[[status,data1,data2,data3],timestamp],
- [[status,data1,data2,data3],timestamp],...]
-example: Read(50) returns all the events in the buffer,
- up to 50 events.
- """
- cdef PmEvent buffer[1024]
-
- self._check_open()
-
- x = []
-
- if length > 1024: raise IndexError, 'maximum buffer length is 1024'
- if length < 1: raise IndexError, 'minimum buffer length is 1'
- NumEvents = Pm_Read(self.midi,buffer,length)
- if NumEvents < 0: raise Exception, Pm_GetErrorText(NumEvents)
- x=[]
- if NumEvents >= 1:
- for loop in range(NumEvents):
- x.append([[buffer[loop].message & 0xff, (buffer[loop].message >> 8) & 0xFF, (buffer[loop].message >> 16) & 0xFF, (buffer[loop].message >> 24) & 0xFF], buffer[loop].timestamp])
- return x
diff --git a/3rdparty/portmidi/pm_python/pyportmidi/midi.py b/3rdparty/portmidi/pm_python/pyportmidi/midi.py
deleted file mode 100644
index 71e4f2b4b8f..00000000000
--- a/3rdparty/portmidi/pm_python/pyportmidi/midi.py
+++ /dev/null
@@ -1,566 +0,0 @@
-"""
-Module for interacting with midi input and output.
-
-The midi module can send output to midi devices, and get input
-from midi devices. It can also list midi devices on the system.
-
-Including real midi devices, and virtual ones.
-
-It uses the portmidi library. Is portable to which ever platforms
-portmidi supports (currently windows, OSX, and linux).
-"""
-
-import atexit
-
-
-
-_init = False
-_pypm = None
-
-
-__all__ = [ "Input",
- "MidiException",
- "Output",
- "get_count",
- "get_default_input_id",
- "get_default_output_id",
- "get_device_info",
- "init",
- "quit",
- "time",
- ]
-
-__theclasses__ = ["Input", "Output"]
-
-
-def init():
- """initialize the midi module
- pyportmidi.init(): return None
-
- Call the initialisation function before using the midi module.
-
- It is safe to call this more than once.
- """
- global _init, _pypm
- if not _init:
- import pyportmidi._pyportmidi
- _pypm = pyportmidi._pyportmidi
-
- _pypm.Initialize()
- _init = True
- atexit.register(quit)
-
-
-def quit():
- """uninitialize the midi module
- pyportmidi.quit(): return None
-
-
- Called automatically atexit if you don't call it.
-
- It is safe to call this function more than once.
- """
- global _init, _pypm
- if _init:
- # TODO: find all Input and Output classes and close them first?
- _pypm.Terminate()
- _init = False
- del _pypm
-
-def _check_init():
- if not _init:
- raise RuntimeError("pyportmidi not initialised.")
-
-def get_count():
- """gets the number of devices.
- pyportmidi.get_count(): return num_devices
-
-
- Device ids range from 0 to get_count() -1
- """
- _check_init()
- return _pypm.CountDevices()
-
-
-
-
-def get_default_input_id():
- """gets default input device number
- pyportmidi.get_default_input_id(): return default_id
-
-
- Return the default device ID or -1 if there are no devices.
- The result can be passed to the Input()/Ouput() class.
-
- On the PC, the user can specify a default device by
- setting an environment variable. For example, to use device #1.
-
- set PM_RECOMMENDED_INPUT_DEVICE=1
-
- The user should first determine the available device ID by using
- the supplied application "testin" or "testout".
-
- In general, the registry is a better place for this kind of info,
- and with USB devices that can come and go, using integers is not
- very reliable for device identification. Under Windows, if
- PM_RECOMMENDED_OUTPUT_DEVICE (or PM_RECOMMENDED_INPUT_DEVICE) is
- *NOT* found in the environment, then the default device is obtained
- by looking for a string in the registry under:
- HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Input_Device
- and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device
- for a string. The number of the first device with a substring that
- matches the string exactly is returned. For example, if the string
- in the registry is "USB", and device 1 is named
- "In USB MidiSport 1x1", then that will be the default
- input because it contains the string "USB".
-
- In addition to the name, get_device_info() returns "interf", which
- is the interface name. (The "interface" is the underlying software
- system or API used by PortMidi to access devices. Examples are
- MMSystem, DirectX (not implemented), ALSA, OSS (not implemented), etc.)
- At present, the only Win32 interface is "MMSystem", the only Linux
- interface is "ALSA", and the only Max OS X interface is "CoreMIDI".
- To specify both the interface and the device name in the registry,
- separate the two with a comma and a space, e.g.:
- MMSystem, In USB MidiSport 1x1
- In this case, the string before the comma must be a substring of
- the "interf" string, and the string after the space must be a
- substring of the "name" name string in order to match the device.
-
- Note: in the current release, the default is simply the first device
- (the input or output device with the lowest PmDeviceID).
- """
- return _pypm.GetDefaultInputDeviceID()
-
-
-
-
-def get_default_output_id():
- """gets default output device number
- pyportmidi.get_default_output_id(): return default_id
-
-
- Return the default device ID or -1 if there are no devices.
- The result can be passed to the Input()/Ouput() class.
-
- On the PC, the user can specify a default device by
- setting an environment variable. For example, to use device #1.
-
- set PM_RECOMMENDED_OUTPUT_DEVICE=1
-
- The user should first determine the available device ID by using
- the supplied application "testin" or "testout".
-
- In general, the registry is a better place for this kind of info,
- and with USB devices that can come and go, using integers is not
- very reliable for device identification. Under Windows, if
- PM_RECOMMENDED_OUTPUT_DEVICE (or PM_RECOMMENDED_INPUT_DEVICE) is
- *NOT* found in the environment, then the default device is obtained
- by looking for a string in the registry under:
- HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Input_Device
- and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device
- for a string. The number of the first device with a substring that
- matches the string exactly is returned. For example, if the string
- in the registry is "USB", and device 1 is named
- "In USB MidiSport 1x1", then that will be the default
- input because it contains the string "USB".
-
- In addition to the name, get_device_info() returns "interf", which
- is the interface name. (The "interface" is the underlying software
- system or API used by PortMidi to access devices. Examples are
- MMSystem, DirectX (not implemented), ALSA, OSS (not implemented), etc.)
- At present, the only Win32 interface is "MMSystem", the only Linux
- interface is "ALSA", and the only Max OS X interface is "CoreMIDI".
- To specify both the interface and the device name in the registry,
- separate the two with a comma and a space, e.g.:
- MMSystem, In USB MidiSport 1x1
- In this case, the string before the comma must be a substring of
- the "interf" string, and the string after the space must be a
- substring of the "name" name string in order to match the device.
-
- Note: in the current release, the default is simply the first device
- (the input or output device with the lowest PmDeviceID).
- """
- _check_init()
- return _pypm.GetDefaultOutputDeviceID()
-
-
-def get_device_info(an_id):
- """ returns information about a midi device
- pyportmidi.get_device_info(an_id): return (interf, name, input, output, opened)
-
- interf - a text string describing the device interface, eg 'ALSA'.
- name - a text string for the name of the device, eg 'Midi Through Port-0'
- input - 0, or 1 if the device is an input device.
- output - 0, or 1 if the device is an output device.
- opened - 0, or 1 if the device is opened.
-
- If the id is out of range, the function returns None.
- """
- _check_init()
- return _pypm.GetDeviceInfo(an_id)
-
-
-class Input(object):
- """Input is used to get midi input from midi devices.
- Input(device_id)
- Input(device_id, buffer_size)
-
- buffer_size -the number of input events to be buffered waiting to
- be read using Input.read()
- """
-
- def __init__(self, device_id, buffer_size=4096):
- """
- The buffer_size specifies the number of input events to be buffered
- waiting to be read using Input.read().
- """
- _check_init()
-
- if device_id == -1:
- raise MidiException("Device id is -1, not a valid output id. -1 usually means there were no default Output devices.")
-
- try:
- r = get_device_info(device_id)
- except TypeError:
- raise TypeError("an integer is required")
- except OverflowError:
- raise OverflowError("long int too large to convert to int")
-
- # and now some nasty looking error checking, to provide nice error
- # messages to the kind, lovely, midi using people of whereever.
- if r:
- interf, name, input, output, opened = r
- if input:
- try:
- self._input = _pypm.Input(device_id, buffer_size)
- except TypeError:
- raise TypeError("an integer is required")
- self.device_id = device_id
-
- elif output:
- raise MidiException("Device id given is not a valid input id, it is an output id.")
- else:
- raise MidiException("Device id given is not a valid input id.")
- else:
- raise MidiException("Device id invalid, out of range.")
-
-
-
-
- def _check_open(self):
- if self._input is None:
- raise MidiException("midi not open.")
-
-
-
- def close(self):
- """ closes a midi stream, flushing any pending buffers.
- Input.close(): return None
-
- PortMidi attempts to close open streams when the application
- exits -- this is particularly difficult under Windows.
- """
- _check_init()
- if not (self._input is None):
- self._input.Close()
- self._input = None
-
-
-
- def read(self, num_events):
- """reads num_events midi events from the buffer.
- Input.read(num_events): return midi_event_list
-
- Reads from the Input buffer and gives back midi events.
- [[[status,data1,data2,data3],timestamp],
- [[status,data1,data2,data3],timestamp],...]
- """
- _check_init()
- self._check_open()
- return self._input.Read(num_events)
-
-
- def poll(self):
- """returns true if there's data, or false if not.
- Input.poll(): return Bool
-
- raises a MidiException on error.
- """
- _check_init()
- self._check_open()
-
- r = self._input.Poll()
- if r == _pypm.TRUE:
- return True
- elif r == _pypm.FALSE:
- return False
- else:
- err_text = GetErrorText(r)
- raise MidiException( (r, err_text) )
-
-
-
-
-class Output(object):
- """Output is used to send midi to an output device
- Output(device_id)
- Output(device_id, latency = 0)
- Output(device_id, buffer_size = 4096)
- Output(device_id, latency, buffer_size)
-
- The buffer_size specifies the number of output events to be
- buffered waiting for output. (In some cases -- see below --
- PortMidi does not buffer output at all and merely passes data
- to a lower-level API, in which case buffersize is ignored.)
-
- latency is the delay in milliseconds applied to timestamps to determine
- when the output should actually occur. (If latency is < 0, 0 is
- assumed.)
-
- If latency is zero, timestamps are ignored and all output is delivered
- immediately. If latency is greater than zero, output is delayed until
- the message timestamp plus the latency. (NOTE: time is measured
- relative to the time source indicated by time_proc. Timestamps are
- absolute, not relative delays or offsets.) In some cases, PortMidi
- can obtain better timing than your application by passing timestamps
- along to the device driver or hardware. Latency may also help you
- to synchronize midi data to audio data by matching midi latency to
- the audio buffer latency.
-
- """
-
- def __init__(self, device_id, latency = 0, buffer_size = 4096):
- """Output(device_id)
- Output(device_id, latency = 0)
- Output(device_id, buffer_size = 4096)
- Output(device_id, latency, buffer_size)
-
- The buffer_size specifies the number of output events to be
- buffered waiting for output. (In some cases -- see below --
- PortMidi does not buffer output at all and merely passes data
- to a lower-level API, in which case buffersize is ignored.)
-
- latency is the delay in milliseconds applied to timestamps to determine
- when the output should actually occur. (If latency is < 0, 0 is
- assumed.)
-
- If latency is zero, timestamps are ignored and all output is delivered
- immediately. If latency is greater than zero, output is delayed until
- the message timestamp plus the latency. (NOTE: time is measured
- relative to the time source indicated by time_proc. Timestamps are
- absolute, not relative delays or offsets.) In some cases, PortMidi
- can obtain better timing than your application by passing timestamps
- along to the device driver or hardware. Latency may also help you
- to synchronize midi data to audio data by matching midi latency to
- the audio buffer latency.
- """
-
- _check_init()
- self._aborted = 0
-
- if device_id == -1:
- raise MidiException("Device id is -1, not a valid output id. -1 usually means there were no default Output devices.")
-
- try:
- r = get_device_info(device_id)
- except TypeError:
- raise TypeError("an integer is required")
- except OverflowError:
- raise OverflowError("long int too large to convert to int")
-
- # and now some nasty looking error checking, to provide nice error
- # messages to the kind, lovely, midi using people of whereever.
- if r:
- interf, name, input, output, opened = r
- if output:
- try:
- self._output = _pypm.Output(device_id, latency)
- except TypeError:
- raise TypeError("an integer is required")
- self.device_id = device_id
-
- elif input:
- raise MidiException("Device id given is not a valid output id, it is an input id.")
- else:
- raise MidiException("Device id given is not a valid output id.")
- else:
- raise MidiException("Device id invalid, out of range.")
-
- def _check_open(self):
- if self._output is None:
- raise MidiException("midi not open.")
-
- if self._aborted:
- raise MidiException("midi aborted.")
-
-
- def close(self):
- """ closes a midi stream, flushing any pending buffers.
- Output.close(): return None
-
- PortMidi attempts to close open streams when the application
- exits -- this is particularly difficult under Windows.
- """
- _check_init()
- if not (self._output is None):
- self._output.Close()
- self._output = None
-
- def abort(self):
- """terminates outgoing messages immediately
- Output.abort(): return None
-
- The caller should immediately close the output port;
- this call may result in transmission of a partial midi message.
- There is no abort for Midi input because the user can simply
- ignore messages in the buffer and close an input device at
- any time.
- """
-
- _check_init()
- if self._output:
- self._output.Abort()
- self._aborted = 1
-
-
-
-
-
- def write(self, data):
- """writes a list of midi data to the Output
- Output.write(data)
-
- writes series of MIDI information in the form of a list:
- write([[[status <,data1><,data2><,data3>],timestamp],
- [[status <,data1><,data2><,data3>],timestamp],...])
- <data> fields are optional
- example: choose program change 1 at time 20000 and
- send note 65 with velocity 100 500 ms later.
- write([[[0xc0,0,0],20000],[[0x90,60,100],20500]])
- notes:
- 1. timestamps will be ignored if latency = 0.
- 2. To get a note to play immediately, send MIDI info with
- timestamp read from function Time.
- 3. understanding optional data fields:
- write([[[0xc0,0,0],20000]]) is equivalent to
- write([[[0xc0],20000]])
-
- Can send up to 1024 elements in your data list, otherwise an
- IndexError exception is raised.
- """
- _check_init()
- self._check_open()
-
- self._output.Write(data)
-
-
- def write_short(self, status, data1 = 0, data2 = 0):
- """write_short(status <, data1><, data2>)
- Output.write_short(status)
- Output.write_short(status, data1 = 0, data2 = 0)
-
- output MIDI information of 3 bytes or less.
- data fields are optional
- status byte could be:
- 0xc0 = program change
- 0x90 = note on
- etc.
- data bytes are optional and assumed 0 if omitted
- example: note 65 on with velocity 100
- write_short(0x90,65,100)
- """
- _check_init()
- self._check_open()
- self._output.WriteShort(status, data1, data2)
-
-
- def write_sys_ex(self, when, msg):
- """writes a timestamped system-exclusive midi message.
- Output.write_sys_ex(when, msg)
-
- msg - can be a *list* or a *string*
- when - a timestamp in miliseconds
- example:
- (assuming o is an onput MIDI stream)
- o.write_sys_ex(0,'\\xF0\\x7D\\x10\\x11\\x12\\x13\\xF7')
- is equivalent to
- o.write_sys_ex(pyportmidi.time(),
- [0xF0,0x7D,0x10,0x11,0x12,0x13,0xF7])
- """
- _check_init()
- self._check_open()
- self._output.WriteSysEx(when, msg)
-
-
- def note_on(self, note, velocity=None, channel = 0):
- """turns a midi note on. Note must be off.
- Output.note_on(note, velocity=None, channel = 0)
-
- Turn a note on in the output stream. The note must already
- be off for this to work correctly.
- """
- if velocity is None:
- velocity = 0
-
- if not (0 <= channel <= 15):
- raise ValueError("Channel not between 0 and 15.")
-
- self.write_short(0x90+channel, note, velocity)
-
- def note_off(self, note, velocity=None, channel = 0):
- """turns a midi note off. Note must be on.
- Output.note_off(note, velocity=None, channel = 0)
-
- Turn a note off in the output stream. The note must already
- be on for this to work correctly.
- """
- if velocity is None:
- velocity = 0
-
- if not (0 <= channel <= 15):
- raise ValueError("Channel not between 0 and 15.")
-
- self.write_short(0x80 + channel, note, velocity)
-
-
- def set_instrument(self, instrument_id, channel = 0):
- """select an instrument, with a value between 0 and 127
- Output.set_instrument(instrument_id, channel = 0)
-
- """
- if not (0 <= instrument_id <= 127):
- raise ValueError("Undefined instrument id: %d" % instrument_id)
-
- if not (0 <= channel <= 15):
- raise ValueError("Channel not between 0 and 15.")
-
- self.write_short(0xc0+channel, instrument_id)
-
-
-
-def time():
- """returns the current time in ms of the PortMidi timer
- pyportmidi.time(): return time
-
- The time is reset to 0, when the module is inited.
- """
- return _pypm.Time()
-
-
-
-
-
-
-
-
-class MidiException(Exception):
- """MidiException(errno) that can be raised.
- """
- def __init__(self, value):
- self.parameter = value
- def __str__(self):
- return repr(self.parameter)
-
-
-
diff --git a/3rdparty/portmidi/pm_python/setup.py b/3rdparty/portmidi/pm_python/setup.py
deleted file mode 100644
index 14ab1c758af..00000000000
--- a/3rdparty/portmidi/pm_python/setup.py
+++ /dev/null
@@ -1,185 +0,0 @@
-import sys
-import os
-import logging
-
-from distutils.core import setup, Command
-from distutils.extension import Extension
-try:
- from Cython.Distutils import build_ext
-except ImportError:
- logging.warn("Cython is preferred over pyrex for python3 compatibility.")
- from Pyrex.Distutils import build_ext
-
-
-
-
-
-DESCRIPTION = open('README_PYTHON.txt').read()
-CHANGES = open('CHANGES.txt').read()
-TODO = open('TODO.txt').read()
-
-EXTRAS = {}
-
-long_description = DESCRIPTION + CHANGES + TODO
-#import sys
-#if "checkdocs" in sys.argv:
-# print long_description
-
-
-METADATA = {
- 'name': 'pyportmidi',
- 'version': '0.0.7',
- 'license': 'MIT License',
- 'url': 'http://pypi.python.org/pyportmidi/',
- 'author': 'John Harrison, Roger B. Dannenberg, Rene Dudfield, others...',
- 'author_email': 'renesd@gmail.com',
- 'maintainer': 'Rene Dudfield',
- 'maintainer_email': 'renesd@gmail.com',
- 'description': 'Python Wrappings for PortMidi #python. CHANGES: new package layout.',
- 'long_description': long_description,
- 'classifiers': [
- 'Development Status :: 2 - Pre-Alpha',
- 'Intended Audience :: Developers',
- 'Intended Audience :: Information Technology',
- 'License :: OSI Approved :: BSD License',
- 'Operating System :: MacOS :: MacOS X',
- 'Operating System :: Microsoft :: Windows',
- 'Operating System :: POSIX :: Linux',
- 'Programming Language :: Cython',
- 'Programming Language :: C',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.5',
- 'Programming Language :: Python :: 2.6',
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.0',
- 'Programming Language :: Python :: 3.1',
- 'Programming Language :: Python :: 3.2',
- 'Topic :: Multimedia :: Sound/Audio :: MIDI',
- 'Topic :: Software Development :: Libraries',
- ],
-}
-
-
-if "bdist_msi" in sys.argv:
- # hack the version name to a format msi doesn't have trouble with
- METADATA["version"] = METADATA["version"].replace("pre", "a0")
- METADATA["version"] = METADATA["version"].replace("rc", "b0")
- METADATA["version"] = METADATA["version"].replace("release", "")
-
-
-
-
-
-# allow optionally using setuptools for bdist_egg.
-using_setuptools = False
-
-if "-setuptools" in sys.argv:
- using_setuptools = True
-
- from setuptools import setup, Command
- sys.argv.remove ("-setuptools")
-
- EXTRAS.update({'include_package_data': True,
- 'install_requires': [],
- 'zip_safe': False,
- 'test_suite' : 'pyportmidi.tests',
- }
- )
-
-
-# test command. For doing 'python setup.py test'
-class TestCommand(Command):
- user_options = [ ]
-
- def initialize_options(self):
- self._dir = os.getcwd()
-
- def finalize_options(self):
- pass
-
- def run(self):
- '''
- runs the tests with default options.
- '''
- import pyportmidi.tests
- pyportmidi.tests.main()
-
- #import subprocess
- #return subprocess.call([sys.executable, "run_tests.py"])
-
-
-cmdclass = {'build_ext': build_ext}
-
-# we use our test command.
-if not using_setuptools:
- import os
- cmdclass['test'] = TestCommand
-
-
-
-scripts = []
-
-PACKAGEDATA = {
- 'cmdclass': cmdclass,
-
- 'package_dir': {'pyportmidi': 'pyportmidi',
- #'pyportmidi.tests': 'test',
- #'pyportmidi.docs': 'docs',
- #'pyportmidi.examples': 'examples',
-
- },
- 'packages': ['pyportmidi',
- 'pyportmidi.tests',
- ],
- 'scripts': scripts,
-}
-
-
-PACKAGEDATA.update(METADATA)
-PACKAGEDATA.update(EXTRAS)
-
-
-
-if sys.platform == 'win32':
- print "Found Win32 platform"
- EXTENSION = dict(
- ext_modules=[
- Extension("pyportmidi._pyportmidi", [os.path.join("pyportmidi", "_pyportmidi.pyx")],
- library_dirs = ["../Release"],
- libraries = ["portmidi", "winmm"],
- include_dirs = ["../porttime"],
-# define_macros = [("_WIN32_", None)]) # needed by portmidi.h
- extra_compile_args = ["/DWIN32"]) # needed by portmidi.h
- ]
- )
-elif sys.platform == 'darwin':
- print "Found darwin (OS X) platform"
- library_dirs = ["/usr/local/lib"]
- include_dirs = ["/usr/local/include"]
- EXTENSION = dict(
- ext_modules=[
- Extension("pyportmidi._pyportmidi", [os.path.join("pyportmidi", "_pyportmidi.pyx")],
- library_dirs = library_dirs,
- include_dirs = include_dirs,
- libraries = ["portmidi"],
- extra_link_args=["-framework", "CoreFoundation",
- "-framework", "CoreMIDI",
- "-framework", "CoreAudio"])
- ]
- )
-else:
- print "Assuming Linux platform"
- EXTENSION = dict(
- ext_modules=[
- Extension("pyportmidi._pyportmidi", [os.path.join("pyportmidi", "_pyportmidi.pyx")],
- library_dirs=["./linux"],
- libraries = ["portmidi", "asound", "pthread"]
- )
- ]
-
- )
-
-PACKAGEDATA.update(EXTENSION)
-
-setup(**PACKAGEDATA)
diff --git a/3rdparty/portmidi/pm_qt/README_QT.txt b/3rdparty/portmidi/pm_qt/README_QT.txt
deleted file mode 100644
index 181ad9f5a16..00000000000
--- a/3rdparty/portmidi/pm_qt/README_QT.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-README_QT.txt for PortMidi
-Richard Starfield
-20 Sep 2010
-
-This is a QtCreator build file for PortMidi.
-
-To build PortMidi on Windows with QtCreator:
-
-Move portmidi/pm_qt/portmidi.pro to portmidi/portmidi.pro
-
-Open portmidi.pro in QtCreator, change to the release build option and build all to compile the static library.
-
-This has been tested in Windows. The project file does include Linux build switches but they haven't been tested yet.
-
-To compile a DLL instead of a static library change line 11 from "CONFIG += staticlib" to "CONFIG += DLL"
diff --git a/3rdparty/portmidi/pm_qt/portmidi.pro b/3rdparty/portmidi/pm_qt/portmidi.pro
deleted file mode 100644
index d2298f7596a..00000000000
--- a/3rdparty/portmidi/pm_qt/portmidi.pro
+++ /dev/null
@@ -1,47 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2010-09-02T12:50:47
-#
-#-------------------------------------------------
-
-QT -= core gui
-
-TARGET = portmidi
-TEMPLATE = lib
-CONFIG += staticlib # replace this with DLL for dynamic link on Windows
-
-INCLUDEPATH = pm_common/ porttime/
-
-win32 {
- INCLUDEPATH += pm_win/
- LIBS += -lwinmm
- SOURCES += pm_win/pmwinmm.c \
- pm_win/pmwin.c
- HEADERS += pm_win/pmwinmm.h
-}
-
-# this build hasn't been tested on Linux yet
-unix {
- DEFINES += PMALSA
- INCLUDEPATH += pm_linux/
- LIBS += -lasound
- SOURCES += pm_linux/finddefault.c \
- pm_linux/pmlinux.c \
- pm_linux/pmlinuxalsa.c
- HEADERS += pm_linux/pmlinux.h pm_linux/pmlinuxalsa.h
-}
-
-
-DEFINES -= UNICODE
-
-SOURCES += \
- pm_common/portmidi.c \
- pm_common/pmutil.c \
- porttime/porttime.c \
- porttime/ptwinmm.c
-
-HEADERS += \
- pm_common/pmutil.h \
- pm_common/pminternal.h \
- pm_common/portmidi.h \
- porttime/porttime.h
diff --git a/3rdparty/portmidi/pm_test/CMakeLists.txt b/3rdparty/portmidi/pm_test/CMakeLists.txt
index b89074b0bd5..ae0fe48b53d 100644
--- a/3rdparty/portmidi/pm_test/CMakeLists.txt
+++ b/3rdparty/portmidi/pm_test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# pm_test
+# CMake file to build tests in this directory: pm_test
# set the build directory to be in portmidi, not in portmidi/pm_test
# this is required for Xcode:
@@ -6,21 +6,41 @@ if(APPLE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
endif(APPLE)
-if(WIN32)
-include(../pm_win/static.cmake)
-endif(WIN32)
+# if(WIN32)
+# if(NOT BUILD_SHARED_LIBS)
+ # /MDd is multithread debug DLL, /MTd is multithread debug
+ # /MD is multithread DLL, /MT is multithread. Change to static:
+# include(../pm_win/static.cmake)
+# endif()
+# endif(WIN32)
+
+if(HAIKU)
+ add_compile_options(-fPIC) # Haiku x86_64 needs this explicitly
+endif()
-macro(make_a_test name)
+macro(add_test name)
add_executable(${name} ${name}.c)
- target_link_libraries(${name} portmidi-static ${PM_NEEDED_LIBS})
- add_dependencies(${name} portmidi-static)
-endmacro(make_a_test)
+ target_link_libraries(${name} PRIVATE portmidi)
+ set_property(TARGET ${name} PROPERTY MSVC_RUNTIME_LIBRARY
+ "MultiThreaded$<$<CONFIG:Debug>:Debug>${MSVCRT_DLL}")
+endmacro(add_test)
-make_a_test(test)
-make_a_test(midithread)
-make_a_test(midithru)
-make_a_test(sysex)
-make_a_test(latency)
-make_a_test(mm)
-make_a_test(midiclock)
-make_a_test(qtest)
+add_test(testio)
+add_test(midithread)
+add_test(midithru)
+add_test(sysex)
+add_test(latency)
+add_test(mm)
+add_test(midiclock)
+add_test(qtest)
+add_test(fast)
+add_test(fastrcv)
+add_test(pmlist)
+if(WIN32)
+# windows does not implement Pm_CreateVirtualInput or Pm_CreateVirtualOutput
+else(WIN32)
+add_test(recvvirtual)
+add_test(sendvirtual)
+add_test(multivirtual)
+add_test(virttest)
+endif(WIN32)
diff --git a/3rdparty/portmidi/pm_test/README.txt b/3rdparty/portmidi/pm_test/README.txt
new file mode 100644
index 00000000000..b5a83d693b8
--- /dev/null
+++ b/3rdparty/portmidi/pm_test/README.txt
@@ -0,0 +1,376 @@
+README.txt - for pm_test directory
+
+These are all test programs for PortMidi
+
+Because device numbers depend on the system, there is no automated
+script to run all tests on PortMidi.
+
+To run the full set of tests manually:
+
+Note: everything is run from the ../Debug or ../Release directory.
+Actual or example input is marked with >>, e.g., >>0 means type 0<ENTER>
+Comments are shown in square brackets [like this]
+
+1. ./qtest -- output should show a bunch of tests and no error message.
+
+2. ./testio [test input]
+Latency in ms: >>0
+enter your choice... >>1
+Type input number: >>6 [pick a working input device]
+[play some notes, look for note-on (0x90) with pitch and velocity data]
+
+3. ./testio [test input (fail w/assert)]
+Latency in ms: >>0
+enter your choice... >>2
+Type input number: >>6 [pick a working input device]
+[play some notes, program will abort after 5 messages
+(this test only applies to a Debug build, otherwise
+the assert() macro is disabled.)]
+
+4. ./testio [test input (fail w/NULL assign)]
+Latency in ms: >>0
+enter your choice... >>3
+Type input number: >>6 [pick a working input device]
+[play some notes, program will Segmentation fault after 5 messages
+(this test may not Segfault in the Release build; if not
+try testing with a Debug build.)]
+
+5. ./testio [test output, no latency]
+Latency in ms: >>0
+enter your choice... >>4
+Type output number: >>2 [pick a working output device]
+>> [type ENTER when prompted (7 times)]
+[hear note on, note off, note on, note off, chord]
+
+6. ./testio [test output, latency > 0]
+Latency in ms: >>300
+enter your choice... >>4
+Type output number: >>2 [pick a working output device]
+>> [type ENTER when prompted (7 times)]
+[hear note on, note off, note on, note off, arpeggiated chord
+ (delay of 300ms should be apparent)]
+
+7. ./testio [for both, no latency]
+Latency in ms: >>0
+enter your choice... >>5
+Type input number: >>6 [pick a working input device]
+Type output number: >>2 [pick a working output device]
+[play notes on input, hear them on output]
+
+8. ./testio [for both, latency > 0]
+Latency in ms: >>300
+enter your choice... >>5
+Type input number: >>6 [pick a working input device]
+Type output number: >>2 [pick a working output device]
+[play notes on input, hear them on output (delay of 300ms is apparent)]
+
+9. ./testio [stream test]
+Latency in ms: >>0 [does not matter]
+enter your choice... >>6
+Type output number: >>2 [pick a working output device]
+>> [type ENTER to start]
+[hear 4 notes: C D E F# at one note per second, then all turn off]
+ready to close and terminate... (type ENTER) :>> [type ENTER (twice)]
+
+10. ./testio [isochronous out]
+Latency in ms: >>300
+enter your choice... >>7
+Type output number: >>2 [pick a working output device]
+ready to send program 1 change... (type ENTER): >> [type ENTER]
+[hear 80 notes, exactly 4 notes per second, no jitter]
+
+11. ./latency [no MIDI, histogram]
+Choose timer period (in ms, >= 1): >>1
+? >>1 [No MIDI traffic option]
+[wait about 10 seconds]
+>> [type ENTER]
+[output should be something like ... Maximum latency: 1 milliseconds]
+
+12. ./latency [MIDI input, histogram]
+Choose timer period (in ms, >= 1): >>1
+? >>2 [MIDI input option]
+Midi input device number: >>6 [pick a working input device]
+[wait about 5 seconds, play input for 10 seconds ]
+>> [type ENTER]
+[output should be something like ... Maximum latency: 3 milliseconds]
+
+13. ./latency [MIDI output, histogram]
+Choose timer period (in ms, >= 1): >>1
+? >>3 [MIDI output option]
+Midi output device number: >>2 [pick a working output device]
+Midi output should be sent every __ callback iterations: >>50
+[wait until you hear notes for 5 or 10 seconds]
+>> [type ENTER to stop]
+[output should be something like ... Maximum latency: 2 milliseconds]
+
+14. ./latency [MIDI input and output, histogram]
+Choose timer period (in ms, >= 1): >>1
+? >>4 [MIDI input and output option]
+Midi input device number: >>6 [pick a working input device]
+Midi output device number: >>2 [pick a working output device]
+Midi output should be sent every __ callback iterations: >>50
+[wait until you hear notes, simultaneously play notes for 5 or 10 seconds]
+>> [type ENTER to stop]
+[output should be something like ... Maximum latency: 1 milliseconds]
+
+15. ./mm [test with device input]
+Type input device number: >>6 [pick a working input device]
+[play some notes, see notes printed]
+>>q [Type q ENTER when finished to exit]
+
+16. ./midithread -i 6 -o 2 [use working input/output device numbers]
+>>5 [enter a transposition number]
+[play some notes, hear parallel 4ths]
+>>q [quit after ENTER a couple of times]
+
+17. ./midiclock [in one shell]
+ ./mm [in another shell]
+[Goal is send clock messages to MIDI monitor program. This requires
+ either a hardware loopback (MIDI cable from OUT to IN on interface)
+ or a software loopback (macOS IAC bus or ALSA MIDI Through Port)]
+[For midiclock application:]
+ Type output device number: >>0 [pick a device with loopback]
+ Type ENTER to start MIDI CLOCK: >> [type ENTER]
+[For mm application:]
+ Type input device number: >>1 [pick device with loopback]
+ [Wait a few seconds]
+ >>s [to get Clock Count]
+ >>s [expect to get a higher Clock Count]
+[For midiclock application:]
+ >>c [turn off clocks]
+[For mm application:]
+ >>s [to get Clock Count]
+ >>s [expect to Clock Count stays the same]
+[For midiclock application:]
+ >>t [turn on time code, see Time Code Quarter Frame messages from mm]
+ >>q [to quit]
+[For mm application:]
+ >>q [to quit]
+
+18. ./midithru -i 6 -o 2 [use working input/output device numbers]
+[Play notes on input evice; notes are sent immediately and also with a
+ 2 sec delay to the output device; program terminates in 60 seconds or
+ when you play B3 (B below Middle C)]
+>> [ENTER to exit]
+
+19. ./recvvirtual [in one shell, macOS and Linux only]
+ ./testio [in another shell]
+[For testio application:]
+ Latency in ms: >>0
+ enter your choice... >>4 [test output]
+ Type output number: >>9 [select the "portmidi (output)" device]
+ [type ENTER to each prompt, see that recvvirtual "Got message 0"
+ through "Got message 9"]
+ >> [ENTER to quit]
+[For recvvirtual application:]
+ >> [ENTER to quit]
+
+20. ./sendvirtual [in one shell, macOS and Linux only]
+ ./mm [in another shell]
+[For mm application:]
+ Type input device number: >>10 [select the "portmidi" device]
+[For sendvirtual application:]
+ Type ENTER to send messages: >> [type ENTER]
+ [see NoteOn and off messages received by mm for Key 60-64]
+ >> [ENTER to quit]
+[For mm application:]
+ >>q [and ENTER twice to quit]
+
+21. ./sysex [no latency]
+[This requires either a hardware loopback (MIDI cable from OUT to IN
+ on interface) or a software loopback (macOS IAC bus or ALSA MIDI
+ Through Port)]
+>>l [for loopback test]
+Type output device number: >>0 [pick output device to loopback]
+Latency in milliseconds: >>0
+Type input device number: >>0 [pick input device for loopback]
+[Program will send 100,000 bytes. After awhile, program will quit.
+ You can read the Cummulative bytes/sec value.]
+
+22. ./sysex [latency > 0]
+[This requires either a hardware loopback (MIDI cable from OUT to IN
+ on interface) or a software loopback (macOS IAC bus or ALSA MIDI
+ Through Port)]
+>>l [for loopback test]
+Type output device number: >>0 [pick output device to loopback]
+Latency in milliseconds: >>100
+Type input device number: >>0 [pick input device for loopback]
+[Program will send 100,000 bytes. After awhile, program will quit. You
+ can read the Cummulative bytes/sec value; it is affected by latency.]
+
+23. ./fast [no latency]
+ ./fastrcv [in another shell]
+[This is a speed check, especially for macOSX IAC bus connections,
+ which are known to drop messages if you send messages too fast.
+ fast and fastrcv must use a loopback to function.]
+[In fastrcv:]
+ Input device number: >>1 [pick a non-hardware device if possible]
+[In fast:]
+ Latency in ms: >>0
+ Rate in messages per second: >>10000
+ Duration in seconds: >>10
+ Output device number: >>0 [pick a non-hardware device if possible]
+ sending output...
+[see message counts and times; on Linux you should get about 10000
+ messages/s; on macOS you should get about 1800 messages/s; Windows
+ does not have software ports, so data rate might be limited by the
+ loopback device you use.]
+
+Check output of fastrcv: there should be no errors, just msg/sec.]
+
+24. ./fast [latency > 0]
+ ./fastrcv [in another shell]
+[This is a speed check, especially for macOSX IAC bus connections,
+ which are known to drop messages if you send messages too fast.
+ fast and fastrcv must use a loopback to function.]
+[In fastrcv:]
+ Input device number: >>1 [pick a non-hardware device if possible]
+[In fast:]
+ Latency in ms: >>30 [Note for ALSA, use latency * msgs/ms < 400]
+ Rate in messages per second: >>10000
+ Duration in seconds: >>10
+ Output device number: >>0 [pick a non-hardware device if possible]
+ sending output...
+[see message counts and times; on Linux you should get about 10000
+ messages/s; on macOS you should get about 1800 messages/s; Windows
+ does not have software ports, so data rate might be limited by the
+ loopback device you use.]
+
+Check output of fastrcv: there should be no errors, just msg/sec.]
+
+25. ./fast [virtual output port, latency = 0, macOS and Linux only]
+ ./fastrcv [in another shell]
+[Start fast first:]
+ Latency in ms: >>0
+ Rate in messages per second: >>10000
+ Duration in seconds: >>10
+ Output device number: >>9 [enter number listed for "Create virtual
+ port named 'fast' (output)"]
+ Pausing so you can connect a receiver to the newly created
+ "fast" port. Type ENTER to proceed:
+[In fastrcv:]
+ Input device number: >>3 [pick the device named "fast (input)"]
+[In fast:]
+ >> [type ENTER to start]
+[see message counts and times as above ]
+
+Check output of fastrcv: there should be no errors, just msg/sec.]
+
+26. ./fast [virtual output port, latency > 0, macOS and Linux only]
+ ./fastrcv [in another shell]
+[Start fast first:]
+ Latency in ms: >>30 [Note for ALSA, use latency * msgs/ms < 400]
+ Rate in messages per second: >>10000
+ Duration in seconds: >>10
+ Output device number: >>9 [enter number listed for "Create virtual
+ port named 'fast' (output)"]
+ Pausing so you can connect a receiver to the newly created
+ "fast" port. Type ENTER to proceed:
+[In fastrcv:]
+ Input device number: >>3 [pick the device named "fast (input)"]
+[In fast:]
+ >> [type ENTER to start]
+[see message counts and times as above ]
+
+Check output of fastrcv: there should be no errors, just msg/sec.]
+
+27. ./fast [latency = 0, macOS and Linux only]
+ ./fastrcv [virtual input port, in another shell]
+[In fastrcv:]
+ Input device number: >>8 [enter number listed for "Create virtual
+ port named 'fastrcv' (input)"]
+[In fast:]
+ Latency in ms: >>0
+ Rate in messages per second: >>10000
+ Duration in seconds: >>10
+ Output device number: >>7 [pick the device named "fastrcv (output)"]
+ sending output...
+[see message counts and times as above ]
+
+Check output of fastrcv: there should be no errors, just msg/sec.]
+
+28. ./fast [latency > 0, macOS and Linux only]
+ ./fastrcv [virtual input port, in another shell]
+[In fastrcv:]
+ Input device number: >>8 [enter number listed for "Create virtual
+ port named 'fastrcv' (input)"]
+[In fast:]
+ Latency in ms: >>30 [Note for ALSA, use latency * msgs/ms < 400]
+ Rate in messages per second: >>10000
+ Duration in seconds: >>10
+ Output device number: >>7 [pick the device named "fastrcv (output)"]
+ sending output...
+[see message counts and times as above ]
+
+Check output of fastrcv: there should be no errors, just msg/sec.]
+
+29. ./midithru -v -n [virtual input and output, macOS and Linux only]
+ ./fast [latency = 0]
+ ./fastrcv [in another shell]
+[Start midithru first, it will run for 60 seconds]
+[In fastrcv:]
+ Input device number: >>3 [pick the device named
+ port named "midithru (input)"]
+[In fast:]
+ Latency in ms: >>0
+ Rate in messages per second: >>10000
+ Duration in seconds: >>10
+ Output device number: >>8 [pick the device named "midithru (output)"]
+ sending output...
+[see message counts and times as above, on Mac, output from fast to
+ midithru AND output from midithru to fastrcv are rate limited, so
+ as in other tests, it will take more than 10s to receive all the
+ messages and the receiving message rate will be about 1800 messages/second]
+
+30. ./multivirtual [macOS and Linux only]
+ ./testio
+ ./testio
+[Start multivirtual first]
+[In first testio:]
+ Latency in ms: >>0
+ enter your choice... >>5 [test both]
+ Type input number: >>1 [pick portmidi1 (input)
+ Type output number: >>4 [pick portmidi1 (output)
+[In second testio:]
+ Latency in ms: >>10
+ enter your choice... >>5 [test both]
+ Type input number: >>2 [pick portmidi2 (input)
+ Type output number: >>5 [pick portmidi2 (output)
+[In multivirtual:]
+ Type ENTER to send messages: >> [type ENTER to start]
+[see that each testio gets 11 messages (0 to 10) at reasonable times
+ (e.g. 2077 to 7580, and the "@" times (real times) should match the
+ timestamps). multivirtual should also report reasonable times and
+ line near the end of output should be "Got 11 messages from
+ portmidi1 and 11 from portmidi2; expected 11."]
+
+31. ./multivirtual [macOS and Linux only]
+ ./multivirtual
+[Second instance should report "PortMidi call failed...
+ PortMidi: Cannot create virtual device: name is taken"]
+
+32. pmdefaults (if built, requires Java and some CMake options)
+ [must be run from pm_java/pmdefaults]
+ ./testio
+[In pmdefaults:
+ Select an input device. Input should flash the green
+ test light.
+ Select an output device. Test button should play a note.
+ Save the selections.
+ Quit the program.]
+[In testio:]
+ Latency in ms: >>0
+ enter your choice... >>5 [test both]
+ [In the device list, default devices are marked. They
+ should match the devices selected with pmdefaults.]
+ ^C to quit.
+33. pmlist
+ ./pmlist [check the output]
+ [plug in or remove a device]
+ >> [type RETURN]
+ [check for changes in device list]
+ >>q
+
+
+
+
diff --git a/3rdparty/portmidi/pm_test/fast.c b/3rdparty/portmidi/pm_test/fast.c
new file mode 100644
index 00000000000..102697e456e
--- /dev/null
+++ b/3rdparty/portmidi/pm_test/fast.c
@@ -0,0 +1,290 @@
+/* fast.c -- send many MIDI messages very fast.
+ *
+ * This is a stress test created to explore reports of
+ * pm_write() call blocking (forever) on Linux when
+ * sending very dense MIDI sequences.
+ *
+ * Modified 8 Aug 2017 with -n to send expired timestamps
+ * to test a theory about why Linux ALSA hangs in Audacity.
+ *
+ * Modified 9 Aug 2017 with -m, -p to test when timestamps are
+ * wrapping from negative to positive or positive to negative.
+ *
+ * Roger B. Dannenberg, Aug 2017
+ */
+
+#include "portmidi.h"
+#include "porttime.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+#define DEVICE_INFO NULL
+#define DRIVER_INFO NULL
+#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
+
+#define STRING_MAX 80 /* used for console input */
+// need to get declaration for Sleep()
+#ifdef WIN32
+#include "windows.h"
+#else
+#include <unistd.h>
+#define Sleep(n) usleep(n * 1000)
+#endif
+
+
+int32_t latency = 0;
+int32_t msgrate = 0;
+int deviceno = -9999;
+int duration = 0;
+int expired_timestamps = FALSE;
+int use_timeoffset = 0;
+
+/* read a number from console */
+/**/
+int get_number(const char *prompt)
+{
+ int n = 0, i;
+ fputs(prompt, stdout);
+ while (n != 1) {
+ n = scanf("%d", &i);
+ while (getchar() != '\n') ;
+ }
+ return i;
+}
+
+
+/* get_time -- the time reference. Normally, this will be the default
+ * time, Pt_Time(), but if you use the -p or -m option, the time
+ * reference will start at an offset of -10s for -m, or
+ * maximum_time - 10s for -p, so that we can observe what happens
+ * with negative time or when time changes sign or wraps (by
+ * generating output for more than 10s).
+ */
+PmTimestamp get_time(void *info)
+{
+ PmTimestamp now = (PmTimestamp) (Pt_Time() + use_timeoffset);
+ return now;
+}
+
+
+void fast_test()
+{
+ PmStream *midi;
+ char line[STRING_MAX];
+ int pause = FALSE; /* pause if this is a virtual output port */
+ PmError err = pmNoError;
+ /* output buffer size should be a little more than
+ msgrate * latency / 1000. PortMidi will guarantee
+ a minimum of latency / 2 */
+ int buffer_size = msgrate * latency / 900;
+ PmTimestamp start, now;
+ int msgcnt = 0;
+ int polling_count = 0;
+ int pitch = 60;
+ int printtime = 1000;
+
+ /* It is recommended to start timer before PortMidi */
+ TIME_START;
+
+ /* open output device */
+ if (deviceno == Pm_CountDevices()) {
+ deviceno = Pm_CreateVirtualOutput("fast", NULL, DEVICE_INFO);
+ if (deviceno >= 0) {
+ err = Pm_OpenOutput(&midi, deviceno, DRIVER_INFO, buffer_size,
+ get_time, NULL, latency);
+ pause = TRUE;
+ }
+ } else if (err >= pmNoError) {
+ err = Pm_OpenOutput(&midi, deviceno, DRIVER_INFO, buffer_size,
+ get_time, NULL, latency);
+ }
+ if (err == pmHostError) {
+ Pm_GetHostErrorText(line, STRING_MAX);
+ printf("PortMidi found host error...\n %s\n", line);
+ goto done;
+ } else if (err < 0) {
+ printf("PortMidi call failed...\n %s\n", Pm_GetErrorText(err));
+ goto done;
+ }
+ printf("Midi Output opened with %ld ms latency.\n", (long) latency);
+ if (pause) {
+ printf("Pausing so you can connect a receiver to the newly created\n"
+ " \"fast\" port. Type ENTER to proceed: ");
+ while (getchar() != '\n') ;
+ }
+ /* wait a sec after printing previous line */
+ start = get_time(NULL) + 1000;
+ while (start > get_time(NULL)) {
+ Sleep(10);
+ }
+ printf("sending output...\n");
+ fflush(stdout); /* make sure message goes to console */
+
+ /* every 10ms send on/off pairs at timestamps set to current time */
+ now = get_time(NULL);
+ /* if expired_timestamps, we want to send timestamps that have
+ * expired. They should be sent immediately, but there's a suggestion
+ * that negative delay might cause problems in the ALSA implementation
+ * so this is something we can test using the -n flag.
+ */
+ if (expired_timestamps) {
+ now = now - 2 * latency;
+ }
+
+ while (((PmTimestamp) (now - start)) < duration * 1000 || pitch != 60) {
+ /* how many messages do we send? Total should be
+ * (elapsed * rate) / 1000
+ */
+ int send_total = (((PmTimestamp) ((now - start))) * msgrate) / 1000;
+ /* always send until pitch would be 60 so if we run again, the
+ next pitch (60) will be expected */
+ if (msgcnt < send_total) {
+ if ((msgcnt & 1) == 0) {
+ Pm_WriteShort(midi, now, Pm_Message(0x90, pitch, 100));
+ } else {
+ Pm_WriteShort(midi, now, Pm_Message(0x90, pitch, 0));
+ /* play 60, 61, 62, ... 71, then wrap back to 60, 61, ... */
+ pitch = (pitch - 59) % 12 + 60;
+ }
+ msgcnt += 1;
+ if (((PmTimestamp) (now - start)) >= printtime) {
+ printf("%d at %dms, polling count %d\n", msgcnt, now - start,
+ polling_count);
+ fflush(stdout); /* make sure message goes to console */
+ printtime += 1000; /* next msg in 1s */
+ }
+ }
+ now = get_time(NULL);
+ polling_count++;
+ }
+ /* close device (this not explicitly needed in most implementations) */
+ printf("ready to close and terminate... (type RETURN):");
+ while (getchar() != '\n') ;
+
+ Pm_Close(midi);
+ done:
+ Pm_Terminate();
+ printf("done closing and terminating...\n");
+}
+
+
+void show_usage()
+{
+ printf("Usage: fast [-h] [-l latency] [-r rate] [-d device] [-s dur] "
+ "[-n] [-p] [-m]\n"
+ ", where latency is in ms,\n"
+ " rate is messages per second,\n"
+ " device is the PortMidi device number,\n"
+ " dur is the length of the test in seconds,\n"
+ " -n means send timestamps in the past,\n"
+ " -p means use a large positive time offset,\n"
+ " -m means use a large negative time offset, and\n"
+ " -h means help.\n");
+}
+
+int main(int argc, char *argv[])
+{
+ int default_in;
+ int default_out;
+ char *deflt;
+ int i = 0;
+ int latency_valid = FALSE;
+ int rate_valid = FALSE;
+ int device_valid = FALSE;
+ int dur_valid = FALSE;
+
+ if (sizeof(void *) == 8)
+ printf("Apparently this is a 64-bit machine.\n");
+ else if (sizeof(void *) == 4)
+ printf ("Apparently this is a 32-bit machine.\n");
+
+ if (argc <= 1) {
+ show_usage();
+ } else {
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-h") == 0) {
+ show_usage();
+ } else if (strcmp(argv[i], "-l") == 0 && (i + 1 < argc)) {
+ i = i + 1;
+ latency = atoi(argv[i]);
+ printf("Latency will be %ld\n", (long) latency);
+ latency_valid = TRUE;
+ } else if (strcmp(argv[i], "-r") == 0) {
+ i = i + 1;
+ msgrate = atoi(argv[i]);
+ printf("Rate will be %d messages/second\n", msgrate);
+ rate_valid = TRUE;
+ } else if (strcmp(argv[i], "-d") == 0) {
+ i = i + 1;
+ deviceno = atoi(argv[i]);
+ printf("Device will be %d\n", deviceno);
+ } else if (strcmp(argv[i], "-s") == 0) {
+ i = i + 1;
+ duration = atoi(argv[i]);
+ printf("Duration will be %d seconds\n", duration);
+ dur_valid = TRUE;
+ } else if (strcmp(argv[i], "-n") == 0) {
+ printf("Sending expired timestamps (-n)\n");
+ expired_timestamps = TRUE;
+ } else if (strcmp(argv[i], "-p") == 0) {
+ printf("Time offset set to 2147473648 (-p)\n");
+ use_timeoffset = 2147473648;
+ } else if (strcmp(argv[i], "-m") == 0) {
+ printf("Time offset set to -10000 (-m)\n");
+ use_timeoffset = -10000;
+ } else {
+ show_usage();
+ }
+ }
+ }
+
+ if (!latency_valid) {
+ // coerce to known size
+ latency = (int32_t) get_number("Latency in ms: ");
+ }
+
+ if (!rate_valid) {
+ // coerce from "%d" to known size
+ msgrate = (int32_t) get_number("Rate in messages per second: ");
+ }
+
+ if (!dur_valid) {
+ duration = get_number("Duration in seconds: ");
+ }
+
+ /* list device information */
+ default_in = Pm_GetDefaultInputDeviceID();
+ default_out = Pm_GetDefaultOutputDeviceID();
+ for (i = 0; i < Pm_CountDevices(); i++) {
+ const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+ if (info->output) {
+ printf("%d: %s, %s", i, info->interf, info->name);
+ if (i == deviceno) {
+ device_valid = TRUE;
+ deflt = "selected ";
+ } else if (i == default_out) {
+ deflt = "default ";
+ } else {
+ deflt = "";
+ }
+ printf(" (%soutput)\n", deflt);
+ }
+ }
+ printf("%d: Create virtual port named \"fast\"", i);
+ if (i == deviceno) {
+ device_valid = TRUE;
+ deflt = "selected ";
+ } else {
+ deflt = "";
+ }
+ printf(" (%soutput)\n", deflt);
+
+ if (!device_valid) {
+ deviceno = get_number("Output device number: ");
+ }
+
+ fast_test();
+ return 0;
+}
diff --git a/3rdparty/portmidi/pm_test/fastrcv.c b/3rdparty/portmidi/pm_test/fastrcv.c
new file mode 100644
index 00000000000..daee40c5fa0
--- /dev/null
+++ b/3rdparty/portmidi/pm_test/fastrcv.c
@@ -0,0 +1,255 @@
+/* fastrcv.c -- send many MIDI messages very fast.
+ *
+ * This is a stress test created to explore reports of
+ * pm_write() call blocking (forever) on Linux when
+ * sending very dense MIDI sequences.
+ *
+ * Modified 8 Aug 2017 with -n to send expired timestamps
+ * to test a theory about why Linux ALSA hangs in Audacity.
+ *
+ * Roger B. Dannenberg, Aug 2017
+ */
+
+#include "portmidi.h"
+#include "porttime.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+#define INPUT_BUFFER_SIZE 1000 /* big to avoid losing any input */
+#define DEVICE_INFO NULL
+#define DRIVER_INFO NULL
+#define TIME_PROC ((PmTimeProcPtr) Pt_Time)
+#define TIME_INFO NULL
+#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
+
+#define STRING_MAX 80 /* used for console input */
+// need to get declaration for Sleep()
+#ifdef WIN32
+#include "windows.h"
+#else
+#include <unistd.h>
+#define Sleep(n) usleep(n * 1000)
+#endif
+
+
+int deviceno = -9999;
+int verbose = FALSE;
+
+
+static void prompt_and_exit(void)
+{
+ printf("type ENTER...");
+ while (getchar() != '\n') ;
+ /* this will clean up open ports: */
+ exit(-1);
+}
+
+
+static PmError checkerror(PmError err)
+{
+ if (err == pmHostError) {
+ /* it seems pointless to allocate memory and copy the string,
+ * so I will do the work of Pm_GetHostErrorText directly
+ */
+ char errmsg[80];
+ Pm_GetHostErrorText(errmsg, 80);
+ printf("PortMidi found host error...\n %s\n", errmsg);
+ prompt_and_exit();
+ } else if (err < 0) {
+ printf("PortMidi call failed...\n %s\n", Pm_GetErrorText(err));
+ prompt_and_exit();
+ }
+ return err;
+}
+
+
+/* read a number from console */
+/**/
+int get_number(const char *prompt)
+{
+ int n = 0, i;
+ fputs(prompt, stdout);
+ while (n != 1) {
+ n = scanf("%d", &i);
+ while (getchar() != '\n') ;
+ }
+ return i;
+}
+
+
+void fastrcv_test()
+{
+ PmStream * midi;
+ PmError status, length;
+ PmEvent buffer[1];
+ PmTimestamp start;
+ /* every 10ms read all messages, keep counts */
+ /* every 1000ms, print report */
+ int msgcnt = 0;
+ /* expect repeating sequence of 60 through 71, alternating on/off */
+ int expected_pitch = 60;
+ int expected_on = TRUE;
+ int report_time;
+ PmTimestamp last_timestamp = -1;
+ PmTimestamp last_delta = -1;
+
+ /* It is recommended to start timer before PortMidi */
+ TIME_START;
+
+ /* open output device */
+ if (deviceno == Pm_CountDevices()) {
+ int id = Pm_CreateVirtualInput("fastrcv", NULL, DEVICE_INFO);
+ if (id < 0) checkerror(id); /* error reporting */
+ checkerror(Pm_OpenInput(&midi, id, DRIVER_INFO,
+ INPUT_BUFFER_SIZE, TIME_PROC, TIME_INFO));
+ } else {
+ Pm_OpenInput(&midi, deviceno, DRIVER_INFO, INPUT_BUFFER_SIZE,
+ TIME_PROC, TIME_INFO);
+ }
+ printf("Midi Input opened.\n");
+
+ /* wait a sec after printing previous line */
+ start = Pt_Time() + 1000;
+ while (start > Pt_Time()) {
+ Sleep(10);
+ }
+
+ report_time = Pt_Time() + 1000; /* report every 1s */
+ while (TRUE) {
+ PmTimestamp now = Pt_Time();
+ status = Pm_Poll(midi);
+ if (status == TRUE) {
+ length = Pm_Read(midi, buffer, 1);
+ if (length > 0) {
+ int status = Pm_MessageStatus(buffer[0].message);
+ if (status == 0x80) { /* convert NoteOff to NoteOn, vel=0 */
+ status = 0x90;
+ buffer[0].message = Pm_Message(status,
+ Pm_MessageData1(buffer[0].message), 0);
+ }
+ /* only listen to NOTEON messages */
+ if (status == 0x90) {
+ int pitch = Pm_MessageData1(buffer[0].message);
+ int vel = Pm_MessageData2(buffer[0].message);
+ int is_on = (vel > 0);
+ if (verbose) {
+ printf("Note pitch %d vel %d\n", pitch, vel);
+ }
+ msgcnt++;
+ if (pitch != expected_pitch || expected_on != is_on) {
+ printf("Unexpected note-on: pitch %d vel %d, "
+ "expected: pitch %d Note%s\n", pitch, vel,
+ expected_pitch, (expected_on ? "On" : "Off"));
+ }
+ if (is_on) {
+ expected_on = FALSE;
+ expected_pitch = pitch;
+ } else {
+ expected_on = TRUE;
+ expected_pitch = (pitch + 1) % 72;
+ if (expected_pitch < 60) expected_pitch = 60;
+ }
+ if (last_timestamp >= 0) {
+ last_delta = buffer[0].timestamp - last_timestamp;
+ }
+ last_timestamp = buffer[0].timestamp;
+ }
+ }
+ }
+ if (now >= report_time) {
+ printf("%d msgs/sec", msgcnt);
+ /* if available, print the last timestamp and last delta time */
+ if (last_timestamp >= 0) {
+ printf(" last timestamp %d", (int) last_timestamp);
+ last_timestamp = -1;
+ }
+ if (last_delta >= 0) {
+ printf(" last delta time %d", (int) last_delta);
+ last_delta = -1;
+ }
+ printf("\n");
+ report_time += 1000;
+ msgcnt = 0;
+ }
+ }
+}
+
+
+void show_usage()
+{
+ printf("Usage: fastrcv [-h] [-v] [-d device], where\n"
+ "device is the PortMidi device number,\n"
+ "-h means help,\n"
+ "-v means verbose (print messages)\n");
+}
+
+int main(int argc, char *argv[])
+{
+ int default_in;
+ int default_out;
+ char *deflt;
+
+ int i = 0, n = 0;
+ int test_input = 0, test_output = 0, test_both = 0, somethingStupid = 0;
+ int stream_test = 0;
+ int device_valid = FALSE;
+
+ if (sizeof(void *) == 8)
+ printf("Apparently this is a 64-bit machine.\n");
+ else if (sizeof(void *) == 4)
+ printf ("Apparently this is a 32-bit machine.\n");
+
+ if (argc <= 1) {
+ show_usage();
+ } else {
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-h") == 0) {
+ show_usage();
+ } else if (strcmp(argv[i], "-v") == 0) {
+ verbose = TRUE;
+ } else if (strcmp(argv[i], "-d") == 0) {
+ i = i + 1;
+ deviceno = atoi(argv[i]);
+ printf("Device will be %d\n", deviceno);
+ } else {
+ show_usage();
+ }
+ }
+ }
+
+ /* list device information */
+ default_in = Pm_GetDefaultInputDeviceID();
+ default_out = Pm_GetDefaultOutputDeviceID();
+ for (i = 0; i < Pm_CountDevices(); i++) {
+ const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+ if (!info->output) {
+ printf("%d: %s, %s", i, info->interf, info->name);
+ if (i == deviceno) {
+ device_valid = TRUE;
+ deflt = "selected ";
+ } else if (i == default_out) {
+ deflt = "default ";
+ } else {
+ deflt = "";
+ }
+ printf(" (%sinput)\n", deflt);
+ }
+ }
+ printf("%d: Create virtual port named \"fastrcv\"", i);
+ if (i == deviceno) {
+ device_valid = TRUE;
+ deflt = "selected ";
+ } else {
+ deflt = "";
+ }
+ printf(" (%sinput)\n", deflt);
+
+ if (!device_valid) {
+ deviceno = get_number("Input device number: ");
+ }
+
+ fastrcv_test();
+ return 0;
+}
diff --git a/3rdparty/portmidi/pm_test/latency.c b/3rdparty/portmidi/pm_test/latency.c
index bfcdc0ca0a3..fe355511c1e 100644
--- a/3rdparty/portmidi/pm_test/latency.c
+++ b/3rdparty/portmidi/pm_test/latency.c
@@ -87,7 +87,7 @@ CHANGE LOG
#define min(a, b) ((a) <= (b) ? (a) : (b))
#endif
-int get_number(char *prompt);
+int get_number(const char *prompt);
PtTimestamp previous_callback_time = 0;
@@ -116,7 +116,7 @@ void pt_callback(PtTimestamp timestamp, void *userData)
/* send a note on/off if user requested it */
if (test_out && (iteration % output_period == 0)) {
PmEvent buffer[1];
- buffer[0].timestamp = Pt_Time(NULL);
+ buffer[0].timestamp = Pt_Time();
if (note_on) {
/* note off */
buffer[0].message = Pm_Message(0x90, 60, 0);
@@ -157,7 +157,6 @@ void pt_callback(PtTimestamp timestamp, void *userData)
int main()
{
- char line[STRING_MAX];
int i;
int len;
int choice;
@@ -231,17 +230,17 @@ int main()
}
}
- printf("%s%s", "Latency measurements will start in 5 seconds. ",
- "Type return to stop: ");
+ printf("Latency measurements will start in 5 seconds. "
+ "Type return to stop: ");
Pt_Start(period, &pt_callback, 0);
- fgets(line, STRING_MAX, stdin);
+ while (getchar() != '\n') ;
stop = Pt_Time();
Pt_Stop();
/* courteously turn off the last note, if necessary */
if (note_on) {
PmEvent buffer[1];
- buffer[0].timestamp = Pt_Time(NULL);
+ buffer[0].timestamp = Pt_Time();
buffer[0].message = Pm_Message(0x90, 60, 0);
Pm_Write(out, buffer, 1);
}
@@ -260,7 +259,7 @@ int main()
printf("\nNote that due to rounding, actual latency can be 1ms higher\n");
printf("than the numbers reported here.\n");
printf("Type return to exit...");
- fgets(line, STRING_MAX, stdin);
+ while (getchar() != '\n') ;
if(choice == 2)
Pm_Close(in);
@@ -276,15 +275,13 @@ int main()
/* read a number from console */
-int get_number(char *prompt)
-{
- char line[STRING_MAX];
+int get_number(const char *prompt)
+{
int n = 0, i;
- printf(prompt);
+ fputs(prompt, stdout);
while (n != 1) {
n = scanf("%d", &i);
- fgets(line, STRING_MAX, stdin);
-
+ while (getchar() != '\n') ;
}
return i;
}
diff --git a/3rdparty/portmidi/pm_test/latency.vcproj b/3rdparty/portmidi/pm_test/latency.vcproj
deleted file mode 100644
index 9a79300abdc..00000000000
--- a/3rdparty/portmidi/pm_test/latency.vcproj
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="latency"
- ProjectGUID="{41D78CBF-B04B-4561-BA4A-AC238C40633D}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="latency.dir\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Debug/latency.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Debug\latency.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Debug/latency.pdb"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- ImportLibrary="..\pm_test\Debug\latency.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="latency.dir\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Release/latency.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Release\latency.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Release/latency.pdb"
- SubSystem="1"
- ImportLibrary="..\pm_test\Release\latency.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_test\latency.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_test/midiclock.c b/3rdparty/portmidi/pm_test/midiclock.c
index 60fcf7a9aad..f0a68974a1c 100644
--- a/3rdparty/portmidi/pm_test/midiclock.c
+++ b/3rdparty/portmidi/pm_test/midiclock.c
@@ -24,7 +24,7 @@ typedef int boolean;
#define OUTPUT_BUFFER_SIZE 0
#define DRIVER_INFO NULL
-#define TIME_PROC ((int32_t (*)(void *)) Pt_Time)
+#define TIME_PROC ((PmTimeProcPtr) Pt_Time)
#define TIME_INFO NULL
#define LATENCY 0
#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
@@ -163,15 +163,13 @@ void timer_poll(PtTimestamp timestamp, void *userData)
/* read a number from console */
/**/
-int get_number(char *prompt)
+int get_number(const char *prompt)
{
- char line[STRING_MAX];
int n = 0, i;
- printf(prompt);
+ fputs(prompt, stdout);
while (n != 1) {
n = scanf("%d", &i);
- fgets(line, STRING_MAX, stdin);
-
+ while (getchar() != '\n') ;
}
return i;
}
@@ -236,7 +234,6 @@ private void doascii(char c)
*/
int main(int argc, char **argv)
{
- char s[STRING_MAX]; /* console input */
int outp;
PmError err;
int i;
@@ -256,22 +253,20 @@ int main(int argc, char **argv)
err = Pm_OpenOutput(&midi, outp, DRIVER_INFO, OUTPUT_BUFFER_SIZE,
TIME_PROC, TIME_INFO, LATENCY);
if (err) {
- printf(Pm_GetErrorText(err));
+ puts(Pm_GetErrorText(err));
goto error_exit_no_device;
}
active = true;
- printf("Type RETURN to start MIDI CLOCK:\n");
- if (!fgets(s, STRING_MAX, stdin)) goto error_exit;
+ printf("Type ENTER to start MIDI CLOCK:\n");
+ while (getchar() != '\n') ;
send_start_stop = true; /* send START and then CLOCKs */
while (!done) {
- if (fgets(s, STRING_MAX, stdin)) {
- doascii(s[0]);
- }
+ doascii(getchar());
+ while (getchar() != '\n') ;
}
- error_exit:
active = false;
Pt_Sleep(2); /* this is to allow callback to complete -- it's
real time, so it's either ok and it runs on
diff --git a/3rdparty/portmidi/pm_test/midiclock.vcproj b/3rdparty/portmidi/pm_test/midiclock.vcproj
deleted file mode 100644
index 2c9cf02e9c5..00000000000
--- a/3rdparty/portmidi/pm_test/midiclock.vcproj
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="midiclock"
- ProjectGUID="{9B448D22-EC7E-4BD8-A552-B268D843CC3C}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="midiclock.dir\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Debug/midiclock.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Debug\midiclock.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Debug/midiclock.pdb"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- ImportLibrary="..\pm_test\Debug\midiclock.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="midiclock.dir\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Release/midiclock.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Release\midiclock.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Release/midiclock.pdb"
- SubSystem="1"
- ImportLibrary="..\pm_test\Release\midiclock.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_test\midiclock.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_test/midithread.c b/3rdparty/portmidi/pm_test/midithread.c
index fab9794f2da..ea0613bc5eb 100644
--- a/3rdparty/portmidi/pm_test/midithread.c
+++ b/3rdparty/portmidi/pm_test/midithread.c
@@ -164,22 +164,36 @@ void process_midi(PtTimestamp timestamp, void *userData)
void exit_with_message(char *msg)
{
- char line[STRING_MAX];
printf("%s\n", msg);
- fgets(line, STRING_MAX, stdin);
+ while (getchar() != '\n') ;
exit(1);
}
-int main()
+int main(int argc, char *argv[])
{
- int id;
int32_t n;
const PmDeviceInfo *info;
char line[STRING_MAX];
int spin;
int done = FALSE;
-
- /* determine what type of test to run */
+ int i;
+ int input = -1, output = -1;
+
+ printf("Usage: midithread [-i input] [-o output]\n"
+ "where input and output are portmidi device numbers\n");
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-i") == 0) {
+ i++;
+ input = atoi(argv[i]);
+ printf("Input device number: %d\n", input);
+ } else if (strcmp(argv[i], "-o") == 0) {
+ i++;
+ output = atoi(argv[i]);
+ printf("Output device number: %d\n", output);
+ } else {
+ return -1;
+ }
+ }
printf("begin PortMidi multithread test...\n");
/* note that it is safe to call PortMidi from the main thread for
@@ -221,32 +235,32 @@ int main()
Pm_Initialize();
- id = Pm_GetDefaultOutputDeviceID();
- info = Pm_GetDeviceInfo(id);
+ output = (output < 0 ? Pm_GetDefaultOutputDeviceID() : output);
+ info = Pm_GetDeviceInfo(output);
if (info == NULL) {
- printf("Could not open default output device (%d).", id);
+ printf("Could not open output device (%d).", output);
exit_with_message("");
}
printf("Opening output device %s %s\n", info->interf, info->name);
/* use zero latency because we want output to be immediate */
- Pm_OpenOutput(&midi_out,
- id,
+ Pm_OpenOutput(&midi_out,
+ output,
DRIVER_INFO,
OUTPUT_BUFFER_SIZE,
TIME_PROC,
TIME_INFO,
LATENCY);
- id = Pm_GetDefaultInputDeviceID();
- info = Pm_GetDeviceInfo(id);
+ input = (input < 0 ? Pm_GetDefaultInputDeviceID() : input);
+ info = Pm_GetDeviceInfo(input);
if (info == NULL) {
- printf("Could not open default input device (%d).", id);
+ printf("Could not open default input device (%d).", input);
exit_with_message("");
}
printf("Opening input device %s %s\n", info->interf, info->name);
Pm_OpenInput(&midi_in,
- id,
+ input,
DRIVER_INFO,
INPUT_BUFFER_SIZE,
TIME_PROC,
@@ -257,18 +271,17 @@ int main()
this simple assignment is safe */
printf("Enter midi input; it will be transformed as specified by...\n");
- printf("%s\n%s\n%s\n",
- "Type 'q' to quit, 'm' to monitor next pitch, t to toggle thru or",
- "type a number to specify transposition.",
- "Must terminate with [ENTER]");
+ printf("Type 'q' to quit, 'm' to monitor next pitch, t to toggle thru or\n"
+ "type a number to specify transposition.\n"
+ "Must terminate with [ENTER]\n");
while (!done) {
int32_t msg;
int input;
int len;
- fgets(line, STRING_MAX, stdin);
+ if (!fgets(line, STRING_MAX, stdin)) break; /* no stdin? */
/* remove the newline: */
- len = strlen(line);
+ len = (int) strlen(line);
if (len > 0) line[len - 1] = 0; /* overwrite the newline char */
if (strcmp(line, "q") == 0) {
msg = QUIT_MSG;
@@ -323,7 +336,8 @@ int main()
Pm_Close(midi_in);
Pm_Close(midi_out);
- printf("finished portMidi multithread test...enter any character to quit [RETURN]...");
- fgets(line, STRING_MAX, stdin);
+ fputs("finished portMidi multithread test.\n"
+ "type ENTER to quit:", stdout);
+ while (getchar() != '\n') ;
return 0;
}
diff --git a/3rdparty/portmidi/pm_test/midithread.vcproj b/3rdparty/portmidi/pm_test/midithread.vcproj
deleted file mode 100644
index 83c82a7bec0..00000000000
--- a/3rdparty/portmidi/pm_test/midithread.vcproj
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="midithread"
- ProjectGUID="{EED7440D-04E3-4948-92DB-C85B4ADB1D82}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="midithread.dir\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Debug/midithread.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Debug\midithread.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Debug/midithread.pdb"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- ImportLibrary="..\pm_test\Debug\midithread.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="midithread.dir\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Release/midithread.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Release\midithread.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Release/midithread.pdb"
- SubSystem="1"
- ImportLibrary="..\pm_test\Release\midithread.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_test\midithread.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_test/midithru.c b/3rdparty/portmidi/pm_test/midithru.c
index 8ad723138e4..a9df5ccf5e6 100644
--- a/3rdparty/portmidi/pm_test/midithru.c
+++ b/3rdparty/portmidi/pm_test/midithru.c
@@ -1,18 +1,21 @@
/* midithru.c -- example program implementing background thru processing */
-/* suppose you want low-latency midi-thru processing, but your application
- wants to take advantage of the input buffer and timestamped data so that
- it does not have to operate with very low latency.
-
- This program illustrates how to use a timer callback from PortTime to
- implement a low-latency process that handles midi thru, including correctly
- merging midi data from the application with midi data from the input port.
-
- The main application, which runs in the main program thread, will use an
- interface similar to that of PortMidi, but since PortMidi does not allow
- concurrent threads to share access to a stream, the application will
- call private methods that transfer MIDI messages to and from the timer
- thread. All PortMidi API calls are made from the timer thread.
+/* suppose you want low-latency midi-thru processing, but your
+ application wants to take advantage of the input buffer and
+ timestamped data so that it does not have to operate with very low
+ latency.
+
+ This program illustrates how to use a timer callback from PortTime
+ to implement a low-latency process that handles midi thru,
+ including correctly merging midi data from the application with
+ midi data from the input port.
+
+ The main application, which runs in the main program thread, will
+ use an interface similar to that of PortMidi, but since PortMidi
+ does not allow concurrent threads to share access to a stream, the
+ application will call private methods that transfer MIDI messages
+ to and from the timer thread using lock-free queues. All PortMidi
+ API calls are made from the timer thread.
*/
/* DESIGN
@@ -78,11 +81,14 @@ global variable current_timestamp.
#define MIDI_SYSEX 0xf0
#define MIDI_EOX 0xf7
+#define STRING_MAX 80 /* used for console input */
-/* active is set true when midi processing should start */
+/* active is set true when midi processing should start, must be
+ * volatile to force thread to check for updates by other thread */
int active = FALSE;
-/* process_midi_exit_flag is set when the timer thread shuts down */
-int process_midi_exit_flag;
+/* process_midi_exit_flag is set when the timer thread shuts down;
+ * must be volatile so it is re-read in the while loop that waits on it */
+volatile int process_midi_exit_flag;
PmStream *midi_in;
PmStream *midi_out;
@@ -92,12 +98,43 @@ PmStream *midi_out;
#define OUT_QUEUE_SIZE 1024
PmQueue *in_queue;
PmQueue *out_queue;
-PmTimestamp current_timestamp = 0;
+/* this is volatile because it is set in the process_midi callback and
+ * the main thread reads it to sense elapsed time. Without volatile, the
+ * optimizer can put it in a register and not see the updates.
+ */
+volatile PmTimestamp current_timestamp = 0;
int thru_sysex_in_progress = FALSE;
int app_sysex_in_progress = FALSE;
PmTimestamp last_timestamp = 0;
+static void prompt_and_exit(void)
+{
+ printf("type ENTER...");
+ while (getchar() != '\n') ;
+ /* this will clean up open ports: */
+ exit(-1);
+}
+
+
+static PmError checkerror(PmError err)
+{
+ if (err == pmHostError) {
+ /* it seems pointless to allocate memory and copy the string,
+ * so I will do the work of Pm_GetHostErrorText directly
+ */
+ char errmsg[80];
+ Pm_GetHostErrorText(errmsg, 80);
+ printf("PortMidi found host error...\n %s\n", errmsg);
+ prompt_and_exit();
+ } else if (err < 0) {
+ printf("PortMidi call failed...\n %s\n", Pm_GetErrorText(err));
+ prompt_and_exit();
+ }
+ return err;
+}
+
+
/* time proc parameter for Pm_MidiOpen */
PmTimestamp midithru_time_proc(void *info)
{
@@ -117,8 +154,6 @@ void process_midi(PtTimestamp timestamp, void *userData)
PmEvent buffer; /* just one message at a time */
current_timestamp++; /* update every millisecond */
- /* if (current_timestamp % 1000 == 0)
- printf("time %d\n", current_timestamp); */
/* do nothing until initialization completes */
if (!active) {
@@ -222,14 +257,13 @@ void process_midi(PtTimestamp timestamp, void *userData)
void exit_with_message(char *msg)
{
#define STRING_MAX 80
- char line[STRING_MAX];
printf("%s\nType ENTER...", msg);
- fgets(line, STRING_MAX, stdin);
+ while (getchar() != '\n') ;
exit(1);
}
-void initialize()
+void initialize(int input, int output, int virtual)
/* set up midi processing thread and open midi streams */
{
/* note that it is safe to call PortMidi from the main thread for
@@ -246,7 +280,6 @@ void initialize()
*/
const PmDeviceInfo *info;
- int id;
/* make the message queues */
in_queue = Pm_QueueCreate(IN_QUEUE_SIZE, sizeof(PmEvent));
@@ -260,36 +293,63 @@ void initialize()
Pm_Initialize();
- id = Pm_GetDefaultOutputDeviceID();
- info = Pm_GetDeviceInfo(id);
- if (info == NULL) {
- printf("Could not open default output device (%d).", id);
- exit_with_message("");
+ if (output < 0) {
+ if (!virtual) {
+ output = Pm_GetDefaultOutputDeviceID();
+ }
}
- printf("Opening output device %s %s\n", info->interf, info->name);
-
- /* use zero latency because we want output to be immediate */
- Pm_OpenOutput(&midi_out,
- id,
- NULL /* driver info */,
- OUT_QUEUE_SIZE,
- &midithru_time_proc,
- NULL /* time info */,
- 0 /* Latency */);
-
- id = Pm_GetDefaultInputDeviceID();
- info = Pm_GetDeviceInfo(id);
- if (info == NULL) {
- printf("Could not open default input device (%d).", id);
- exit_with_message("");
+ if (output >= 0) {
+ info = Pm_GetDeviceInfo(output);
+ if (info == NULL) {
+ printf("Could not open default output device (%d).", output);
+ exit_with_message("");
+ }
+
+ printf("Opening output device %s %s\n", info->interf, info->name);
+
+ /* use zero latency because we want output to be immediate */
+ Pm_OpenOutput(&midi_out,
+ output,
+ NULL /* driver info */,
+ OUT_QUEUE_SIZE,
+ &midithru_time_proc,
+ NULL /* time info */,
+ 0 /* Latency */);
+ } else { /* send to virtual port */
+ int id;
+ printf("Opening virtual output device \"midithru\"\n");
+ id = Pm_CreateVirtualOutput("midithru", NULL, NULL);
+ if (id < 0) checkerror(id); /* error reporting */
+ checkerror(Pm_OpenOutput(&midi_out, id, NULL, OUT_QUEUE_SIZE,
+ &midithru_time_proc, NULL, 0));
+ }
+ if (input < 0) {
+ if (!virtual) {
+ input = Pm_GetDefaultInputDeviceID();
+ }
+ }
+ if (input >= 0) {
+ info = Pm_GetDeviceInfo(input);
+ if (info == NULL) {
+ printf("Could not open default input device (%d).", input);
+ exit_with_message("");
+ }
+
+ printf("Opening input device %s %s\n", info->interf, info->name);
+ Pm_OpenInput(&midi_in,
+ input,
+ NULL /* driver info */,
+ 0 /* use default input size */,
+ &midithru_time_proc,
+ NULL /* time info */);
+ } else { /* receive from virtual port */
+ int id;
+ printf("Opening virtual input device \"midithru\"\n");
+ id = Pm_CreateVirtualInput("midithru", NULL, NULL);
+ if (id < 0) checkerror(id); /* error reporting */
+ checkerror(Pm_OpenInput(&midi_in, id, NULL, 0,
+ &midithru_time_proc, NULL));
}
- printf("Opening input device %s %s\n", info->interf, info->name);
- Pm_OpenInput(&midi_in,
- id,
- NULL /* driver info */,
- 0 /* use default input size */,
- &midithru_time_proc,
- NULL /* time info */);
/* Note: if you set a filter here, then this will filter what goes
to the MIDI THRU port. You may not want to do this.
*/
@@ -330,15 +390,42 @@ int main(int argc, char *argv[])
{
PmTimestamp last_time = 0;
PmEvent buffer;
-
- /* determine what type of test to run */
+ int i;
+ int input = -1, output = -1;
+ int virtual = FALSE;
+ int delay_enable = TRUE;
+
+ printf("Usage: midithru [-i input] [-o output] [-v] [-n]\n"
+ "where input and output are portmidi device numbers\n"
+ "if -v and input and/or output are not specified,\n"
+ "then virtual ports are created and used instead.\n"
+ "-n turns off the default MIDI delay effect.\n");
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-i") == 0) {
+ i++;
+ input = atoi(argv[i]);
+ printf("Input device number: %d\n", input);
+ } else if (strcmp(argv[i], "-o") == 0) {
+ i++;
+ output = atoi(argv[i]);
+ printf("Output device number: %d\n", output);
+ } else if (strcmp(argv[i], "-v") == 0) {
+ virtual = TRUE;
+ } else if (strcmp(argv[i], "-n") == 0) {
+ delay_enable = FALSE;
+ printf("delay_effect is disabled\n");
+ } else {
+ return -1;
+ }
+ }
printf("begin PortMidi midithru program...\n");
- initialize(); /* set up and start midi processing */
+ initialize(input, output, virtual); /* set up and start midi processing */
- printf("%s\n%s\n",
- "This program will run for 60 seconds, or until you play middle C,",
- "echoing all input with a 2 second delay.");
+ printf("This program will run for 60 seconds, "
+ "or until you play B below middle C,\n"
+ "All input is sent immediately, implementing software MIDI THRU.\n"
+ "Also, all input is echoed with a 2 second delay.\n");
while (current_timestamp < 60000) {
/* just to make the point that this is not a low-latency process,
@@ -350,11 +437,13 @@ int main(int argc, char *argv[])
while (Pm_Dequeue(in_queue, &buffer) == 1) {
/* printf("timestamp %d\n", buffer.timestamp); */
/* printf("message %x\n", buffer.message); */
- buffer.timestamp = buffer.timestamp + 2000; /* delay */
- Pm_Enqueue(out_queue, &buffer);
- /* play middle C to break out of loop */
+ if (delay_enable) {
+ buffer.timestamp = buffer.timestamp + 2000; /* delay */
+ Pm_Enqueue(out_queue, &buffer);
+ }
+ /* play B3 to break out of loop */
if (Pm_MessageStatus(buffer.message) == 0x90 &&
- Pm_MessageData1(buffer.message) == 60) {
+ Pm_MessageData1(buffer.message) == 59) {
goto quit_now;
}
}
diff --git a/3rdparty/portmidi/pm_test/midithru.vcproj b/3rdparty/portmidi/pm_test/midithru.vcproj
deleted file mode 100644
index cf6dfdffe6c..00000000000
--- a/3rdparty/portmidi/pm_test/midithru.vcproj
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="midithru"
- ProjectGUID="{80193DD1-2C02-4A4C-BDF8-49623AD6F556}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="midithru.dir\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Debug/midithru.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Debug\midithru.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Debug/midithru.pdb"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- ImportLibrary="..\pm_test\Debug\midithru.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="midithru.dir\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Release/midithru.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Release\midithru.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Release/midithru.pdb"
- SubSystem="1"
- ImportLibrary="..\pm_test\Release\midithru.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_test\midithru.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_test/mm.c b/3rdparty/portmidi/pm_test/mm.c
index 0f2a52ee267..8fe5358b591 100644
--- a/3rdparty/portmidi/pm_test/mm.c
+++ b/3rdparty/portmidi/pm_test/mm.c
@@ -110,20 +110,18 @@ private void showhelp();
private void showbytes(PmMessage data, int len, boolean newline);
private void showstatus(boolean flag);
private void doascii(char c);
-private int get_number(char *prompt);
+private int get_number(const char *prompt);
/* read a number from console */
/**/
-int get_number(char *prompt)
+int get_number(const char *prompt)
{
- char line[STRING_MAX];
int n = 0, i;
- printf(prompt);
+ fputs(prompt, stdout);
while (n != 1) {
n = scanf("%d", &i);
- fgets(line, STRING_MAX, stdin);
-
+ while (getchar() != '\n') ;
}
return i;
}
@@ -136,7 +134,7 @@ void receive_poll(PtTimestamp timestamp, void *userData)
if (!active) return;
while ((count = Pm_Read(midi_in, &event, 1))) {
if (count == 1) output(event.message);
- else printf(Pm_GetErrorText(count));
+ else puts(Pm_GetErrorText(count));
}
}
@@ -160,7 +158,7 @@ int main(int argc, char **argv)
/* use porttime callback to empty midi queue and print */
Pt_Start(1, receive_poll, 0);
/* list device information */
- printf("MIDI input devices:\n");
+ puts("MIDI input devices:");
for (i = 0; i < Pm_CountDevices(); i++) {
const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
if (info->input) printf("%d: %s, %s\n", i, info->interf, info->name);
@@ -168,7 +166,7 @@ int main(int argc, char **argv)
inp = get_number("Type input device number: ");
err = Pm_OpenInput(&midi_in, inp, NULL, 512, NULL, NULL);
if (err) {
- printf(Pm_GetErrorText(err));
+ puts(Pm_GetErrorText(err));
Pt_Stop();
mmexit(1);
}
@@ -177,10 +175,8 @@ int main(int argc, char **argv)
printf("Midi Monitor ready.\n");
active = true;
while (!done) {
- char s[100];
- if (fgets(s, 100, stdin)) {
- doascii(s[0]);
- }
+ doascii(getchar());
+ while (getchar() != '\n') ;
}
active = false;
Pm_Close(midi_in);
@@ -484,8 +480,8 @@ private int put_pitch(int p)
"gs", "a", "bf", "b" };
/* note octave correction below */
sprintf(result, "%s%d", ptos[p % 12], (p / 12) - 1);
- printf(result);
- return strlen(result);
+ fputs(result, stdout);
+ return (int) strlen(result);
}
@@ -534,7 +530,8 @@ private void showhelp()
printf(" ------------- ----- ------------- -----\n");
printf(" Channels 1 - 16 Programs 1 - 128\n");
printf(" Controllers 0 - 127 After Touch 0 - 127\n");
- printf(" Loudness 0 - 127 Pitch Bend 0 - 16383, center = 8192\n");
+ printf(" Loudness 0 - 127 Pitch Bend 0 - 16383, "
+ "center = 8192\n");
printf(" Pitches 0 - 127, 60 = c4 = middle C\n");
printf(" \n");
printf("n toggles notes");
@@ -568,5 +565,5 @@ private void showhelp()
private void showstatus(boolean flag)
{
- printf(", now %s\n", flag ? "ON" : "OFF" );
+ printf(", now %s\n", flag ? "ON" : "OFF");
}
diff --git a/3rdparty/portmidi/pm_test/mm.vcproj b/3rdparty/portmidi/pm_test/mm.vcproj
deleted file mode 100644
index 78baa9f95ad..00000000000
--- a/3rdparty/portmidi/pm_test/mm.vcproj
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="mm"
- ProjectGUID="{EAADABB5-83D6-4669-98F8-6CDBE6AFD2BF}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="mm.dir\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Debug/mm.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Debug\mm.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Debug/mm.pdb"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- ImportLibrary="..\pm_test\Debug\mm.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="mm.dir\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Release/mm.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Release\mm.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Release/mm.pdb"
- SubSystem="1"
- ImportLibrary="..\pm_test\Release\mm.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_test\mm.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_test/multivirtual.c b/3rdparty/portmidi/pm_test/multivirtual.c
new file mode 100644
index 00000000000..059bc50e4f9
--- /dev/null
+++ b/3rdparty/portmidi/pm_test/multivirtual.c
@@ -0,0 +1,224 @@
+/* multivirtual.c -- test for creating two input and two output virtual ports */
+/*
+ * Roger B. Dannenberg
+ * Oct 2021
+ */
+#include "portmidi.h"
+#include "porttime.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+#define OUTPUT_BUFFER_SIZE 0
+#define DEVICE_INFO NULL
+#define DRIVER_INFO NULL
+#define TIME_PROC ((PmTimeProcPtr) Pt_Time)
+#define TIME_INFO NULL
+#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
+
+int latency = 0;
+
+static void prompt_and_exit(void)
+{
+ printf("type ENTER...");
+ while (getchar() != '\n') ;
+ /* this will clean up open ports: */
+ exit(-1);
+}
+
+
+static PmError checkerror(PmError err)
+{
+ if (err == pmHostError) {
+ /* it seems pointless to allocate memory and copy the string,
+ * so I will do the work of Pm_GetHostErrorText directly
+ */
+ char errmsg[80];
+ Pm_GetHostErrorText(errmsg, 80);
+ printf("PortMidi found host error...\n %s\n", errmsg);
+ prompt_and_exit();
+ } else if (err < 0) {
+ printf("PortMidi call failed...\n %s\n", Pm_GetErrorText(err));
+ prompt_and_exit();
+ }
+ return err;
+}
+
+static int msg_count[2] = {0, 0};
+
+void poll_input(PmStream *in, int which)
+{
+ PmEvent buffer[1];
+ int pitch, expected, length;
+ PmError status = Pm_Poll(in);
+ if (status == TRUE) {
+ length = Pm_Read(in, buffer, 1);
+ if (length > 0) {
+ printf("Got message %d from portmidi%d: "
+ "time %ld, %2x %2x %2x\n",
+ msg_count[which], which + 1, (long) buffer[0].timestamp,
+ (status = Pm_MessageStatus(buffer[0].message)),
+ (pitch = Pm_MessageData1(buffer[0].message)),
+ Pm_MessageData2(buffer[0].message));
+ if (status == 0x90) { /* 1 & 2 are on/off 60, 3 & 4 are 61, etc. */
+ expected = (((msg_count[which] - 1) / 2) % 12) + 60 +
+ which * 12;
+ if (pitch != expected) {
+ printf("WARNING: expected pitch %d, got pitch %d\n",
+ expected, pitch);
+ }
+ }
+ msg_count[which]++;
+ } else {
+ assert(0);
+ }
+ }
+}
+
+
+void wait_until(PmTimestamp when, PmStream *in1, PmStream *in2)
+{
+ while (when > Pt_Time()) {
+ poll_input(in1, 0);
+ poll_input(in2, 1);
+ Pt_Sleep(10);
+ }
+}
+
+
+/* create one virtual output device and one input device */
+void init(const char *name, PmStream **midi_out, PmStream **midi_in,
+ int *id_out, int *id_in)
+{
+ PmEvent buffer[1];
+
+ *id_out = checkerror(Pm_CreateVirtualOutput(name, NULL, DEVICE_INFO));
+ checkerror(Pm_OpenOutput(midi_out, *id_out, DRIVER_INFO, OUTPUT_BUFFER_SIZE,
+ TIME_PROC, TIME_INFO, latency));
+ printf("Virtual Output \"%s\" id %d created and opened.\n", name, *id_out);
+
+ *id_in = checkerror(Pm_CreateVirtualInput(name, NULL, DRIVER_INFO));
+ checkerror(Pm_OpenInput(midi_in, *id_in, NULL, 0, NULL, NULL));
+ printf("Virtual Input \"%s\" id %d created and opened.\n", name, *id_in);
+ Pm_SetFilter(*midi_in, PM_FILT_ACTIVE | PM_FILT_CLOCK | PM_FILT_SYSEX);
+ /* empty the buffer after setting filter, just in case anything
+ got through */
+ while (Pm_Read(*midi_in, buffer, 1)) ;
+}
+
+
+void main_test(int num)
+{
+ PmStream *midi1_out;
+ PmStream *midi2_out;
+ PmStream *midi1_in;
+ PmStream *midi2_in;
+ int id1_out;
+ int id2_out;
+ int id1_in;
+ int id2_in;
+ int32_t next_time;
+ PmEvent buffer[1];
+ PmTimestamp timestamp;
+ int pitch = 60;
+ int expected_count = num + 1; /* add 1 for MIDI Program message */
+
+ /* It is recommended to start timer before Midi; otherwise, PortMidi may
+ start the timer with its (default) parameters
+ */
+ TIME_START;
+
+ init("portmidi1", &midi1_out, &midi1_in, &id1_out, &id1_in);
+ init("portmidi2", &midi2_out, &midi2_in, &id2_out, &id2_in);
+
+ printf("Type ENTER to send messages: ");
+ while (getchar() != '\n') ;
+
+ buffer[0].timestamp = Pt_Time();
+#define PROGRAM 0
+ buffer[0].message = Pm_Message(0xC0, PROGRAM, 0);
+ Pm_Write(midi1_out, buffer, 1);
+ Pm_Write(midi2_out, buffer, 1);
+ next_time = Pt_Time() + 1000; /* wait 1s */
+ while (num > 0) {
+ wait_until(next_time, midi1_in, midi2_in);
+ Pm_WriteShort(midi1_out, next_time, Pm_Message(0x90, pitch, 100));
+ Pm_WriteShort(midi2_out, next_time, Pm_Message(0x90, pitch + 12, 100));
+ printf("Note On pitch %d\n", pitch);
+ num--;
+ next_time += 500;
+
+ wait_until(next_time, midi1_in, midi2_in);
+ Pm_WriteShort(midi1_out, next_time, Pm_Message(0x90, pitch, 0));
+ Pm_WriteShort(midi2_out, next_time, Pm_Message(0x90, pitch + 12, 0));
+ printf("Note Off pitch %d\n", pitch);
+ num--;
+ pitch = (pitch + 1) % 12 + 60;
+ next_time += 500;
+ }
+ wait_until(next_time, midi1_in, midi2_in); /* get final note-offs */
+
+ printf("Got %d messages from portmidi1 and %d from portmidi2; "
+ "expected %d.\n", msg_count[0], msg_count[1], expected_count);
+
+ /* close devices (this not explicitly needed in most implementations) */
+ printf("ready to close...");
+ checkerror(Pm_Close(midi1_out));
+ checkerror(Pm_Close(midi2_out));
+ checkerror(Pm_Close(midi1_in));
+ checkerror(Pm_Close(midi2_in));
+ printf("done closing.\nNow delete the virtual devices...");
+ checkerror(Pm_DeleteVirtualDevice(id1_out));
+ checkerror(Pm_DeleteVirtualDevice(id1_in));
+ checkerror(Pm_DeleteVirtualDevice(id2_out));
+ checkerror(Pm_DeleteVirtualDevice(id2_in));
+ printf("done deleting.\n");
+}
+
+
+void show_usage()
+{
+ printf("Usage: multivirtual [-h] [-l latency-in-ms] [n]\n"
+ " -h for this message,\n"
+ " -l ms designates latency for precise timing (default 0),\n"
+ " n is number of message to send each output, not counting\n"
+ " initial program change.\n"
+ "sends change program to 1, then one note per second with 0.5s on,\n"
+ "0.5s off, for n/2 seconds to both output ports portmidi1 and\n"
+ "portmidi2. portmidi1 gets pitches from C4 (60). portmidi2 gets\n"
+ "pitches an octave higher. Latency >0 uses the device driver for \n"
+ "precise timing (see PortMidi documentation). Inputs print what\n"
+ "they get and print WARNING if they get something unexpected.\n"
+ "The expected test is use two instances of testio to loop\n"
+ "portmidi1 back to portmidi1 and portmidi2 back to portmidi2.\n");
+ exit(0);
+}
+
+
+int main(int argc, char *argv[])
+{
+ int num = 10;
+ int i;
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-h") == 0) {
+ show_usage();
+ } else if (strcmp(argv[i], "-l") == 0 && (i + 1 < argc)) {
+ i = i + 1;
+ latency = atoi(argv[i]);
+ printf("Latency will be %d\n", latency);
+ } else {
+ num = atoi(argv[1]);
+ if (num <= 0) {
+ show_usage();
+ }
+ printf("Sending %d messages.\n", num);
+ }
+ }
+
+ main_test(num);
+
+ printf("finished sendvirtual test...type ENTER to quit...");
+ while (getchar() != '\n') ;
+ return 0;
+}
diff --git a/3rdparty/portmidi/pm_test/pmlist.c b/3rdparty/portmidi/pm_test/pmlist.c
new file mode 100644
index 00000000000..5e3d1dbc359
--- /dev/null
+++ b/3rdparty/portmidi/pm_test/pmlist.c
@@ -0,0 +1,63 @@
+/* pmlist.c -- list portmidi devices and numbers
+ *
+ * This program lists devices. When you type return, it
+ * restarts portmidi and lists devices again. It is mainly
+ * a test for shutting down and restarting.
+ *
+ * Roger B. Dannenberg, Feb 2022
+ */
+
+#include "portmidi.h"
+#include "porttime.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+#define DEVICE_INFO NULL
+#define DRIVER_INFO NULL
+#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
+
+#define STRING_MAX 80 /* used for console input */
+
+void show_usage()
+{
+ printf("Usage: pmlist [-h]\n -h means help.\n"
+ " Type return to rescan and list devices, q<ret> to quit\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+ if (argc > 1) {
+ show_usage();
+ exit(0);
+ }
+
+ while (1) {
+ char input[STRING_MAX];
+ const char *deflt;
+ const char *in_or_out;
+ int default_in, default_out, i;
+
+ // Pm_Initialize();
+ /* list device information */
+ default_in = Pm_GetDefaultInputDeviceID();
+ default_out = Pm_GetDefaultOutputDeviceID();
+ for (i = 0; i < Pm_CountDevices(); i++) {
+ const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+ printf("%d: %s, %s", i, info->interf, info->name);
+ deflt = "";
+ if (i == default_out || i == default_in) {
+ deflt = "default ";
+ }
+ in_or_out = (info->input ? "input" : "output");
+ printf(" (%s%s)\n", deflt, in_or_out);
+ }
+ if (fgets(input, STRING_MAX, stdin) && input[0] == 'q') {
+ return 0;
+ }
+ Pm_Terminate();
+ }
+ return 0;
+}
diff --git a/3rdparty/portmidi/pm_test/qtest.vcproj b/3rdparty/portmidi/pm_test/qtest.vcproj
deleted file mode 100644
index 70a8025b98d..00000000000
--- a/3rdparty/portmidi/pm_test/qtest.vcproj
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="qtest"
- ProjectGUID="{2204E68C-5C1F-440E-8CE6-7E273D4F6AD1}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="qtest.dir\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Debug/qtest.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Debug\qtest.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Debug/qtest.pdb"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- ImportLibrary="..\pm_test\Debug\qtest.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="qtest.dir\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Release/qtest.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Release\qtest.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Release/qtest.pdb"
- SubSystem="1"
- ImportLibrary="..\pm_test\Release\qtest.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_test\qtest.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_test/recvvirtual.c b/3rdparty/portmidi/pm_test/recvvirtual.c
new file mode 100644
index 00000000000..8ac97bed54c
--- /dev/null
+++ b/3rdparty/portmidi/pm_test/recvvirtual.c
@@ -0,0 +1,125 @@
+#include "portmidi.h"
+#include "porttime.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+#define INPUT_BUFFER_SIZE 100
+#define DRIVER_INFO NULL
+#define TIME_PROC ((PmTimeProcPtr) Pt_Time)
+#define TIME_INFO NULL
+#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
+
+#define STRING_MAX 80 /* used for console input */
+
+static void prompt_and_exit(void)
+{
+ printf("type ENTER...");
+ while (getchar() != '\n') ;
+ /* this will clean up open ports: */
+ exit(-1);
+}
+
+
+static PmError checkerror(PmError err)
+{
+ if (err == pmHostError) {
+ /* it seems pointless to allocate memory and copy the string,
+ * so I will do the work of Pm_GetHostErrorText directly
+ */
+ char errmsg[80];
+ Pm_GetHostErrorText(errmsg, 80);
+ printf("PortMidi found host error...\n %s\n", errmsg);
+ prompt_and_exit();
+ } else if (err < 0) {
+ printf("PortMidi call failed...\n %s\n", Pm_GetErrorText(err));
+ prompt_and_exit();
+ }
+ return err;
+}
+
+
+void main_test_input(int num)
+{
+ PmStream *midi;
+ PmError status, length;
+ PmEvent buffer[1];
+ int id;
+ int i = 0; /* count messages as they arrive */
+ /* It is recommended to start timer before Midi; otherwise, PortMidi may
+ start the timer with its (default) parameters
+ */
+ TIME_START;
+
+ /* create a virtual input device */
+ id = checkerror(Pm_CreateVirtualInput("portmidi", NULL, DRIVER_INFO));
+ checkerror(Pm_OpenInput(&midi, id, NULL, 0, NULL, NULL));
+
+ printf("Midi Input opened. Reading %d Midi messages...\n", num);
+ Pm_SetFilter(midi, PM_FILT_ACTIVE | PM_FILT_CLOCK | PM_FILT_SYSEX);
+ /* empty the buffer after setting filter, just in case anything
+ got through */
+ while (Pm_Poll(midi)) {
+ Pm_Read(midi, buffer, 1);
+ }
+ /* now start paying attention to messages */
+ while (i < num) {
+ status = Pm_Poll(midi);
+ if (status == TRUE) {
+ length = Pm_Read(midi, buffer, 1);
+ if (length > 0) {
+ printf("Got message %d: time %ld, %2lx %2lx %2lx\n",
+ i,
+ (long) buffer[0].timestamp,
+ (long) Pm_MessageStatus(buffer[0].message),
+ (long) Pm_MessageData1(buffer[0].message),
+ (long) Pm_MessageData2(buffer[0].message));
+ i++;
+ } else {
+ assert(0);
+ }
+ }
+ }
+
+ /* close device (this not explicitly needed in most implementations) */
+ printf("ready to close...");
+ Pm_Close(midi);
+ printf("done closing.\nNow delete the virtual device...");
+ checkerror(Pm_DeleteVirtualDevice(id));
+ printf("done deleting.\n");
+}
+
+
+void show_usage()
+{
+ printf("Usage: recvvirtual [-h] [n]\n use -h for this message,\n"
+ " n is number of message to wait for.\n");
+ exit(0);
+}
+
+
+int main(int argc, char *argv[])
+{
+ char line[STRING_MAX];
+ int num = 10;
+
+ if (argc > 2) {
+ show_usage();
+ } else if (argc == 2) {
+ if (strcmp(argv[1], "-h") == 0) {
+ show_usage();
+ } else {
+ num = atoi(argv[1]);
+ if (num <= 0) {
+ show_usage();
+ }
+ }
+ }
+
+ main_test_input(num);
+
+ printf("finished portMidi test...type ENTER to quit...");
+ while (getchar() != '\n') ;
+ return 0;
+}
diff --git a/3rdparty/portmidi/pm_test/sendvirtual.c b/3rdparty/portmidi/pm_test/sendvirtual.c
new file mode 100644
index 00000000000..14c6e9ea658
--- /dev/null
+++ b/3rdparty/portmidi/pm_test/sendvirtual.c
@@ -0,0 +1,148 @@
+/* sendvirtual.c -- test for creating a virtual device and sending to it */
+/*
+ * Roger B. Dannenberg
+ * Sep 2021
+ */
+#include "portmidi.h"
+#include "porttime.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+#define OUTPUT_BUFFER_SIZE 0
+#define DEVICE_INFO NULL
+#define DRIVER_INFO NULL
+#define TIME_PROC ((PmTimeProcPtr) Pt_Time)
+#define TIME_INFO NULL
+#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
+
+int latency = 0;
+
+static void prompt_and_exit(void)
+{
+ printf("type ENTER...");
+ while (getchar() != '\n') ;
+ /* this will clean up open ports: */
+ exit(-1);
+}
+
+
+static PmError checkerror(PmError err)
+{
+ if (err == pmHostError) {
+ /* it seems pointless to allocate memory and copy the string,
+ * so I will do the work of Pm_GetHostErrorText directly
+ */
+ char errmsg[80];
+ Pm_GetHostErrorText(errmsg, 80);
+ printf("PortMidi found host error...\n %s\n", errmsg);
+ prompt_and_exit();
+ } else if (err < 0) {
+ printf("PortMidi call failed...\n %s\n", Pm_GetErrorText(err));
+ prompt_and_exit();
+ }
+ return err;
+}
+
+
+void wait_until(PmTimestamp when)
+{
+ PtTimestamp now = Pt_Time();
+ if (when > now) {
+ Pt_Sleep(when - now);
+ }
+}
+
+
+void main_test_output(int num)
+{
+ PmStream *midi;
+ int32_t next_time;
+ PmEvent buffer[1];
+ PmTimestamp timestamp;
+ int pitch = 60;
+ int id;
+
+ /* It is recommended to start timer before Midi; otherwise, PortMidi may
+ start the timer with its (default) parameters
+ */
+ TIME_START;
+
+ /* create a virtual output device */
+ id = checkerror(Pm_CreateVirtualOutput("portmidi", NULL, DEVICE_INFO));
+ checkerror(Pm_OpenOutput(&midi, id, DRIVER_INFO, OUTPUT_BUFFER_SIZE,
+ TIME_PROC, TIME_INFO, latency));
+
+ printf("Midi Output Virtual Device \"portmidi\" created.\n");
+ printf("Type ENTER to send messages: ");
+ while (getchar() != '\n') ;
+
+ buffer[0].timestamp = Pt_Time();
+#define PROGRAM 0
+ buffer[0].message = Pm_Message(0xC0, PROGRAM, 0);
+ Pm_Write(midi, buffer, 1);
+ next_time = Pt_Time() + 1000; /* wait 1s */
+ while (num > 0) {
+ wait_until(next_time);
+ Pm_WriteShort(midi, next_time, Pm_Message(0x90, pitch, 100));
+ printf("Note On pitch %d\n", pitch);
+ num--;
+ next_time += 500;
+
+ wait_until(next_time);
+ Pm_WriteShort(midi, next_time, Pm_Message(0x90, pitch, 0));
+ printf("Note Off pitch %d\n", pitch);
+ num--;
+ pitch = (pitch + 1) % 12 + 60;
+ next_time += 500;
+ }
+
+ /* close device (this not explicitly needed in most implementations) */
+ printf("ready to close...");
+ Pm_Close(midi);
+ printf("done closing.\nNow delete the virtual device...");
+ checkerror(Pm_DeleteVirtualDevice(id));
+ printf("done deleting.\n");
+}
+
+
+void show_usage()
+{
+ printf("Usage: sendvirtual [-h] [-l latency-in-ms] [n]\n"
+ " -h for this message,\n"
+ " -l ms designates latency for precise timing (default 0),\n"
+ " n is number of message to send.\n"
+ "sends change program to 1, then one note per second with 0.5s on,\n"
+ "0.5s off, for n/2 seconds. Latency >0 uses the device driver for \n"
+ "precise timing (see PortMidi documentation).\n");
+ exit(0);
+}
+
+
+int main(int argc, char *argv[])
+{
+ int num = 10;
+ int i;
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-h") == 0) {
+ show_usage();
+ } else if (strcmp(argv[i], "-l") == 0 && (i + 1 < argc)) {
+ i = i + 1;
+ latency = atoi(argv[i]);
+ printf("Latency will be %d\n", latency);
+ } else {
+ num = atoi(argv[1]);
+ if (num <= 0) {
+ show_usage();
+ }
+ printf("Sending %d messages.\n", num);
+ }
+ }
+
+ main_test_output(num);
+
+ printf("finished sendvirtual test...type ENTER to quit...");
+ while (getchar() != '\n') ;
+ return 0;
+}
diff --git a/3rdparty/portmidi/pm_test/sysex.c b/3rdparty/portmidi/pm_test/sysex.c
index 7bbcf0eedfd..81964961670 100644
--- a/3rdparty/portmidi/pm_test/sysex.c
+++ b/3rdparty/portmidi/pm_test/sysex.c
@@ -21,6 +21,11 @@
#define Sleep(n) usleep(n * 1000)
#endif
+// enable some extra printing
+#ifndef VERBOSE
+#define VERBOSE 0
+#endif
+
#define MIDI_SYSEX 0xf0
#define MIDI_EOX 0xf7
@@ -35,15 +40,13 @@ int latency = 0;
/* read a number from console */
/**/
-int get_number(char *prompt)
+int get_number(const char *prompt)
{
- char line[STRING_MAX];
int n = 0, i;
- printf(prompt);
+ fputs(prompt, stdout);
while (n != 1) {
n = scanf("%d", &i);
- fgets(line, STRING_MAX, stdin);
-
+ while (getchar() != '\n') ;
}
return i;
}
@@ -58,7 +61,6 @@ void loopback_test()
PmStream *midi_in;
PmStream *midi_out;
unsigned char msg[1024];
- char line[80];
int32_t len;
int i;
int data;
@@ -90,7 +92,7 @@ void loopback_test()
srand((unsigned int) Pt_Time()); /* seed for random numbers */
begin_time = Pt_Time();
- while (1) {
+ while (total_bytes < 100000) {
PmError count;
int32_t start_time;
int error_position = -1; /* 0; -1; -1 for continuous */
@@ -100,9 +102,11 @@ void loopback_test()
/* set error_position above to 0 for interactive, -1 for */
/* continuous */
if (error_position >= 0) {
+ int c;
printf("Type return to send message, q to quit: ");
- fgets(line, STRING_MAX, stdin);
- if (line[0] == 'q') goto cleanup;
+ while ((c = getchar()) != '\n') {
+ if (c == 'q') goto cleanup;
+ }
}
/* compose the message */
@@ -125,17 +129,38 @@ void loopback_test()
printf("Before sending anything, a MIDI message was found in\n");
printf("the input buffer. Please try again.\n");
break;
- }
+ }
- /* send the message */
- printf("Sending %d byte sysex message.\n", len + 2);
- Pm_WriteSysEx(midi_out, 0, msg);
+ /* send the message two ways: 1) Pm_WriteSysEx, 2) Pm_Write */
+ if (total_bytes & 1) {
+ printf("Sending %d byte sysex msg via Pm_WriteSysEx.\n", len + 2);
+ Pm_WriteSysEx(midi_out, 0, msg);
+ } else {
+ PmEvent event = {0, 0};
+ int bits = 0;
+ printf("Sending %d byte sysex msg via Pm_Write(s).\n", len + 2);
+ for (i = 0; i < len + 2; i++) {
+ event.message |= (msg[i] << bits);
+ bits += 8;
+ if (bits == 32) { /* full message - send it */
+ Pm_Write(midi_out, &event, 1);
+ bits = 0;
+ event.message = 0;
+ }
+ }
+ if (bits > 0) { /* last message is partially full */
+ Pm_Write(midi_out, &event, 1);
+ }
+ }
/* receive the message and compare to msg[] */
data = 0;
shift = 0;
i = 0;
start_time = Pt_Time();
+ if (VERBOSE) {
+ printf("start_time %d\n", start_time);
+ }
error_position = -1;
/* allow up to 2 seconds for transmission */
while (data != MIDI_EOX && start_time + 2000 > Pt_Time()) {
@@ -144,10 +169,10 @@ void loopback_test()
Sleep(1); /* be nice: give some CPU time to the system */
continue; /* continue polling for input */
}
-
- /* printf("read %lx ", event.message);
- fflush(stdout); */
-
+ if (VERBOSE) {
+ printf("read %08x ", event.message);
+ fflush(stdout);
+ }
/* compare 4 bytes of data until you reach an eox */
for (shift = 0; shift < 32 && (data != MIDI_EOX); shift += 8) {
data = (event.message >> shift) & 0xFF;
@@ -160,18 +185,20 @@ void loopback_test()
}
}
if (error_position >= 0) {
- printf("Error at byte %d: sent %x recd %x.\n", error_position,
- expected, actual);
+ printf("Error at time %d byte %d: sent %x recd %x.\n", Pt_Time(),
+ error_position, expected, actual);
break;
} else if (i != len + 2) {
- printf("Error: byte %d not received.\n", i);
+ printf("Error at time %d: byte %d not received.\n", Pt_Time(), i);
break;
} else {
int seconds = (Pt_Time() - begin_time) / 1000;
- if (seconds == 0) seconds = 1;
+ if (seconds == 0) seconds = 1;
printf("Correctly received %d byte sysex message.\n", i);
- total_bytes += i;
- printf("Cummulative bytes/sec: %d\n", total_bytes / seconds);
+ total_bytes += i;
+ printf("Cummulative bytes/sec: %d, %d%% done.\n",
+ (int) (total_bytes / seconds),
+ (int) (100 * total_bytes / 100000));
}
}
cleanup:
@@ -378,7 +405,7 @@ void receive_sysex()
printf("Midi Input opened, type file for sysex data: ");
/* open file */
- fgets(line, STRING_MAX, stdin);
+ if (!fgets(line, STRING_MAX, stdin)) return; /* no more stdin? */
/* remove the newline character */
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
f = fopen(line, "w");
@@ -443,7 +470,7 @@ void send_sysex()
printf("Midi Output opened, type file with sysex data: ");
/* open file */
- fgets(line, STRING_MAX, stdin);
+ if (!fgets(line, STRING_MAX, stdin)) return; /* no more stdin? */
/* remove the newline character */
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
f = fopen(line, "r");
@@ -487,7 +514,6 @@ void send_sysex()
int main()
{
int i;
- char line[80];
/* list device information */
for (i = 0; i < Pm_CountDevices(); i++) {
@@ -498,11 +524,13 @@ int main()
printf("\n");
}
while (1) {
+ char cmd;
printf("Type r to receive sysex, s to send,"
" l for loopback test, m to send multiple,"
" n to receive multiple, q to quit: ");
- fgets(line, STRING_MAX, stdin);
- switch (line[0]) {
+ cmd = getchar();
+ while (getchar() != '\n') ;
+ switch (cmd) {
case 'r':
receive_sysex();
break;
diff --git a/3rdparty/portmidi/pm_test/sysex.vcproj b/3rdparty/portmidi/pm_test/sysex.vcproj
deleted file mode 100644
index dabeecb255c..00000000000
--- a/3rdparty/portmidi/pm_test/sysex.vcproj
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="sysex"
- ProjectGUID="{71B9BC6E-7B40-4FBC-BC7F-4372AF03D0FD}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="sysex.dir\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Debug/sysex.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Debug\sysex.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Debug/sysex.pdb"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- ImportLibrary="..\pm_test\Debug\sysex.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="sysex.dir\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Release/sysex.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Release\sysex.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Release/sysex.pdb"
- SubSystem="1"
- ImportLibrary="..\pm_test\Release\sysex.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_test\sysex.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_test/test.vcproj b/3rdparty/portmidi/pm_test/test.vcproj
deleted file mode 100644
index 7458c31e865..00000000000
--- a/3rdparty/portmidi/pm_test/test.vcproj
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="test"
- ProjectGUID="{0BEACB8B-4058-41A4-A9DE-1B1FB650B21A}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="test.dir\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- BasicRuntimeChecks="3"
- CompileAs="1"
- DebugInformationFormat="3"
- ExceptionHandling="0"
- InlineFunctionExpansion="0"
- Optimization="0"
- RuntimeLibrary="1"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- AssemblerListingLocation="Debug"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Debug/test.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\&quot;Debug\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Debug\test.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Debug/test.pdb"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- ImportLibrary="..\pm_test\Debug\test.lib"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="test.dir\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- CompileAs="1"
- ExceptionHandling="0"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="0"
- WarningLevel="3"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- AssemblerListingLocation="Release"
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="../pm_test/Release/test.pdb"
-/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="..\pm_common;..\porttime;"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\&quot;Release\&quot;"
- MkTypLibCompatible="FALSE"
- TargetEnvironment="1"
- GenerateStublessProxies="TRUE"
- TypeLibraryName="$(InputName).tlb"
- OutputDirectory="$(IntDir)"
- HeaderFileName="$(InputName).h"
- DLLDataFileName=""
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
- OutputFile="..\pm_test\Release\test.exe"
- Version="0.0"
- GenerateManifest="TRUE"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""
- ProgramDataBaseFile="../pm_test/Release/test.pdb"
- SubSystem="1"
- ImportLibrary="..\pm_test\Release\test.lib"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="">
- <File
- RelativePath="..\pm_test\test.c">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/pm_test/test.c b/3rdparty/portmidi/pm_test/testio.c
index 03d6331adef..c71ae087307 100644
--- a/3rdparty/portmidi/pm_test/test.c
+++ b/3rdparty/portmidi/pm_test/testio.c
@@ -12,9 +12,10 @@
#define TIME_INFO NULL
#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
-#define STRING_MAX 80 /* used for console input */
+#define WAIT_FOR_ENTER while (getchar() != '\n') ;
int32_t latency = 0;
+int verbose = FALSE;
/* crash the program to test whether midi ports are closed */
/**/
@@ -33,15 +34,13 @@ void doSomethingStupid() {
/* read a number from console */
/**/
-int get_number(char *prompt)
+int get_number(const char *prompt)
{
- char line[STRING_MAX];
int n = 0, i;
- printf(prompt);
+ fputs(prompt, stdout);
while (n != 1) {
n = scanf("%d", &i);
- fgets(line, STRING_MAX, stdin);
-
+ WAIT_FOR_ENTER
}
return i;
}
@@ -83,10 +82,10 @@ void main_test_input(unsigned int somethingStupid) {
while (i < num) {
status = Pm_Poll(midi);
if (status == TRUE) {
- length = Pm_Read(midi,buffer, 1);
+ length = Pm_Read(midi, buffer, 1);
if (length > 0) {
- printf("Got message %d: time %ld, %2lx %2lx %2lx\n",
- i,
+ printf("Got message %d @ time %ld: timestamp %ld, "
+ "%2lx %2lx %2lx\n", i, (long) Pt_Time(),
(long) buffer[0].timestamp,
(long) Pm_MessageStatus(buffer[0].message),
(long) Pm_MessageData1(buffer[0].message),
@@ -113,9 +112,9 @@ void main_test_input(unsigned int somethingStupid) {
-void main_test_output() {
+void main_test_output(int isochronous_test)
+{
PmStream * midi;
- char line[80];
int32_t off_time;
int chord[] = { 60, 67, 76, 83, 90 };
#define chord_size 5
@@ -142,65 +141,100 @@ void main_test_output() {
printf("Midi Output opened with %ld ms latency.\n", (long) latency);
/* output note on/off w/latency offset; hold until user prompts */
- printf("ready to send program 1 change... (type RETURN):");
- fgets(line, STRING_MAX, stdin);
+ printf("ready to send program 1 change... (type ENTER):");
+ WAIT_FOR_ENTER
/* if we were writing midi for immediate output, we could always use
timestamps of zero, but since we may be writing with latency, we
will explicitly set the timestamp to "now" by getting the time.
The source of timestamps should always correspond to the TIME_PROC
and TIME_INFO parameters used in Pm_OpenOutput(). */
- buffer[0].timestamp = TIME_PROC(TIME_INFO);
+ buffer[0].timestamp = Pt_Time();
/* Send a program change to increase the chances we will hear notes */
/* Program 0 is usually a piano, but you can change it here: */
#define PROGRAM 0
buffer[0].message = Pm_Message(0xC0, PROGRAM, 0);
Pm_Write(midi, buffer, 1);
- printf("ready to note-on... (type RETURN):");
- fgets(line, STRING_MAX, stdin);
- buffer[0].timestamp = TIME_PROC(TIME_INFO);
- buffer[0].message = Pm_Message(0x90, 60, 100);
- Pm_Write(midi, buffer, 1);
- printf("ready to note-off... (type RETURN):");
- fgets(line, STRING_MAX, stdin);
- buffer[0].timestamp = TIME_PROC(TIME_INFO);
- buffer[0].message = Pm_Message(0x90, 60, 0);
- Pm_Write(midi, buffer, 1);
-
- /* output short note on/off w/latency offset; hold until user prompts */
- printf("ready to note-on (short form)... (type RETURN):");
- fgets(line, STRING_MAX, stdin);
- Pm_WriteShort(midi, TIME_PROC(TIME_INFO),
- Pm_Message(0x90, 60, 100));
- printf("ready to note-off (short form)... (type RETURN):");
- fgets(line, STRING_MAX, stdin);
- Pm_WriteShort(midi, TIME_PROC(TIME_INFO),
- Pm_Message(0x90, 60, 0));
-
- /* output several note on/offs to test timing.
- Should be 1s between notes */
- printf("chord will arpeggiate if latency > 0\n");
- printf("ready to chord-on/chord-off... (type RETURN):");
- fgets(line, STRING_MAX, stdin);
- timestamp = TIME_PROC(TIME_INFO);
- for (i = 0; i < chord_size; i++) {
- buffer[i].timestamp = timestamp + 1000 * i;
- buffer[i].message = Pm_Message(0x90, chord[i], 100);
- }
- Pm_Write(midi, buffer, chord_size);
-
- off_time = timestamp + 1000 + chord_size * 1000;
- while (TIME_PROC(TIME_INFO) < off_time)
- /* busy wait */;
- for (i = 0; i < chord_size; i++) {
- buffer[i].timestamp = timestamp + 1000 * i;
- buffer[i].message = Pm_Message(0x90, chord[i], 0);
+ if (isochronous_test) { // play 4 notes per sec for 20s
+ int count;
+ PmTimestamp start;
+ if (latency < 100) {
+ printf("Warning: latency < 100, but this test sends messages"
+ " at times that are jittered by up to 100ms, so you"
+ " may hear uneven timing\n");
+ }
+ printf("Starting in 1s..."); fflush(stdout);
+ Pt_Sleep(1000);
+ start = Pt_Time();
+ for (count = 0; count < 80; count++) {
+ PmTimestamp next_time;
+ buffer[0].timestamp = start + count * 250;
+ buffer[0].message = Pm_Message(0x90, 69, 100);
+ buffer[1].timestamp = start + count * 250 + 200;
+ buffer[1].message = Pm_Message(0x90, 69, 0);
+ Pm_Write(midi, buffer, 2);
+ next_time = start + (count + 1) * 250;
+ // sleep for a random time up to 100ms to add jitter to
+ // the times at which we send messages. PortMidi timing
+ // should remove the jitter if latency > 100
+ while (Pt_Time() < next_time) {
+ Pt_Sleep(rand() % 100);
+ }
+ }
+ printf("Done sending 80 notes at 4 notes per second.\n");
+ } else {
+ printf("ready to note-on... (type ENTER):");
+ WAIT_FOR_ENTER
+ buffer[0].timestamp = Pt_Time();
+ buffer[0].message = Pm_Message(0x90, 60, 100);
+ Pm_Write(midi, buffer, 1);
+ printf("ready to note-off... (type ENTER):");
+ WAIT_FOR_ENTER
+ buffer[0].timestamp = Pt_Time();
+ buffer[0].message = Pm_Message(0x90, 60, 0);
+ Pm_Write(midi, buffer, 1);
+
+ /* output short note on/off w/latency offset; hold until user prompts */
+ printf("ready to note-on (short form)... (type ENTER):");
+ WAIT_FOR_ENTER
+ Pm_WriteShort(midi, Pt_Time(),
+ Pm_Message(0x90, 60, 100));
+ printf("ready to note-off (short form)... (type ENTER):");
+ WAIT_FOR_ENTER
+ Pm_WriteShort(midi, Pt_Time(),
+ Pm_Message(0x90, 60, 0));
+
+ /* output several note on/offs to test timing.
+ Should be 1s between notes */
+ if (latency == 0) {
+ printf("chord should not arpeggiate, latency == 0\n");
+ } else {
+ printf("chord should arpeggiate (latency = %ld > 0\n",
+ (long) latency);
+ }
+ printf("ready to chord-on/chord-off... (type ENTER):");
+ WAIT_FOR_ENTER
+ timestamp = Pt_Time();
+ printf("starting timestamp %ld\n", (long) timestamp);
+ for (i = 0; i < chord_size; i++) {
+ buffer[i].timestamp = timestamp + 1000 * i;
+ buffer[i].message = Pm_Message(0x90, chord[i], 100);
+ }
+ Pm_Write(midi, buffer, chord_size);
+
+ off_time = timestamp + 1000 + chord_size * 1000;
+ while (Pt_Time() < off_time)
+ Pt_Sleep(10); /* wait */
+ for (i = 0; i < chord_size; i++) {
+ buffer[i].timestamp = timestamp + 1000 * i;
+ buffer[i].message = Pm_Message(0x90, chord[i], 0);
+ }
+ Pm_Write(midi, buffer, chord_size);
}
- Pm_Write(midi, buffer, chord_size);
/* close device (this not explicitly needed in most implementations) */
- printf("ready to close and terminate... (type RETURN):");
- fgets(line, STRING_MAX, stdin);
+ printf("ready to close and terminate... (type ENTER):");
+ WAIT_FOR_ENTER
Pm_Close(midi);
Pm_Terminate();
@@ -215,7 +249,7 @@ void main_test_both()
PmStream * midi, * midiOut;
PmEvent buffer[1];
PmError status, length;
- int num = 10;
+ int num = 11;
in = get_number("Type input number: ");
out = get_number("Type output number: ");
@@ -238,7 +272,7 @@ void main_test_both()
INPUT_BUFFER_SIZE,
TIME_PROC,
TIME_INFO);
- printf("Midi Input opened. Reading %d Midi messages...\n",num);
+ printf("Midi Input opened. Reading %d Midi messages...\n", num);
Pm_SetFilter(midi, PM_FILT_ACTIVE | PM_FILT_CLOCK);
/* empty the buffer after setting filter, just in case anything
got through */
@@ -252,8 +286,8 @@ void main_test_both()
length = Pm_Read(midi,buffer,1);
if (length > 0) {
Pm_Write(midiOut, buffer, 1);
- printf("Got message %d: time %ld, %2lx %2lx %2lx\n",
- i,
+ printf("Got message %d @ time %ld: timestamp %ld, "
+ "%2lx %2lx %2lx\n", i, (long) Pt_Time(),
(long) buffer[0].timestamp,
(long) Pm_MessageStatus(buffer[0].message),
(long) Pm_MessageData1(buffer[0].message),
@@ -264,6 +298,8 @@ void main_test_both()
}
}
}
+ /* allow time for last message to go out */
+ Pt_Sleep(100 + latency);
/* close midi devices */
Pm_Close(midi);
@@ -281,19 +317,18 @@ void main_test_both()
*/
void main_test_stream() {
PmStream * midi;
- char line[80];
PmEvent buffer[16];
/* determine which output device to use */
int i = get_number("Type output number: ");
- latency = 500; /* ignore LATENCY for this test and
+ latency = 500; /* ignore LATENCY for this test and
fix the latency at 500ms */
/* It is recommended to start timer before PortMidi */
TIME_START;
- /* open output device */
+ /* open output device */
Pm_OpenOutput(&midi,
i,
DRIVER_INFO,
@@ -304,66 +339,66 @@ void main_test_stream() {
printf("Midi Output opened with %ld ms latency.\n", (long) latency);
/* output note on/off w/latency offset; hold until user prompts */
- printf("ready to send output... (type RETURN):");
- fgets(line, STRING_MAX, stdin);
+ printf("ready to send output... (type ENTER):");
+ WAIT_FOR_ENTER
/* if we were writing midi for immediate output, we could always use
timestamps of zero, but since we may be writing with latency, we
will explicitly set the timestamp to "now" by getting the time.
The source of timestamps should always correspond to the TIME_PROC
and TIME_INFO parameters used in Pm_OpenOutput(). */
- buffer[0].timestamp = TIME_PROC(TIME_INFO);
+ buffer[0].timestamp = Pt_Time();
buffer[0].message = Pm_Message(0xC0, 0, 0);
- buffer[1].timestamp = buffer[0].timestamp;
- buffer[1].message = Pm_Message(0x90, 60, 100);
- buffer[2].timestamp = buffer[0].timestamp + 1000;
- buffer[2].message = Pm_Message(0x90, 62, 100);
- buffer[3].timestamp = buffer[0].timestamp + 2000;
- buffer[3].message = Pm_Message(0x90, 64, 100);
- buffer[4].timestamp = buffer[0].timestamp + 3000;
- buffer[4].message = Pm_Message(0x90, 66, 100);
- buffer[5].timestamp = buffer[0].timestamp + 4000;
- buffer[5].message = Pm_Message(0x90, 60, 0);
- buffer[6].timestamp = buffer[0].timestamp + 4000;
- buffer[6].message = Pm_Message(0x90, 62, 0);
- buffer[7].timestamp = buffer[0].timestamp + 4000;
- buffer[7].message = Pm_Message(0x90, 64, 0);
- buffer[8].timestamp = buffer[0].timestamp + 4000;
- buffer[8].message = Pm_Message(0x90, 66, 0);
+ buffer[1].timestamp = buffer[0].timestamp;
+ buffer[1].message = Pm_Message(0x90, 60, 100);
+ buffer[2].timestamp = buffer[0].timestamp + 1000;
+ buffer[2].message = Pm_Message(0x90, 62, 100);
+ buffer[3].timestamp = buffer[0].timestamp + 2000;
+ buffer[3].message = Pm_Message(0x90, 64, 100);
+ buffer[4].timestamp = buffer[0].timestamp + 3000;
+ buffer[4].message = Pm_Message(0x90, 66, 100);
+ buffer[5].timestamp = buffer[0].timestamp + 4000;
+ buffer[5].message = Pm_Message(0x90, 60, 0);
+ buffer[6].timestamp = buffer[0].timestamp + 4000;
+ buffer[6].message = Pm_Message(0x90, 62, 0);
+ buffer[7].timestamp = buffer[0].timestamp + 4000;
+ buffer[7].message = Pm_Message(0x90, 64, 0);
+ buffer[8].timestamp = buffer[0].timestamp + 4000;
+ buffer[8].message = Pm_Message(0x90, 66, 0);
Pm_Write(midi, buffer, 9);
#ifdef SEND8
- /* Now, we're ready for the real test.
- Play 4 notes at now, now+500, now+1000, and now+1500
- Then wait until now+2000.
- Play 4 more notes as before.
- We should hear 8 evenly spaced notes. */
- now = TIME_PROC(TIME_INFO);
- for (i = 0; i < 4; i++) {
- buffer[i * 2].timestamp = now + (i * 500);
- buffer[i * 2].message = Pm_Message(0x90, 60, 100);
- buffer[i * 2 + 1].timestamp = now + 250 + (i * 500);
- buffer[i * 2 + 1].message = Pm_Message(0x90, 60, 0);
- }
+ /* Now, we're ready for the real test.
+ Play 4 notes at now, now+500, now+1000, and now+1500
+ Then wait until now+2000.
+ Play 4 more notes as before.
+ We should hear 8 evenly spaced notes. */
+ now = Pt_Time();
+ for (i = 0; i < 4; i++) {
+ buffer[i * 2].timestamp = now + (i * 500);
+ buffer[i * 2].message = Pm_Message(0x90, 60, 100);
+ buffer[i * 2 + 1].timestamp = now + 250 + (i * 500);
+ buffer[i * 2 + 1].message = Pm_Message(0x90, 60, 0);
+ }
Pm_Write(midi, buffer, 8);
while (Pt_Time() < now + 2500)
- /* busy wait */;
- /* now we are 500 ms behind schedule, but since the latency
- is 500, the delay should not be audible */
- now += 2000;
- for (i = 0; i < 4; i++) {
- buffer[i * 2].timestamp = now + (i * 500);
- buffer[i * 2].message = Pm_Message(0x90, 60, 100);
- buffer[i * 2 + 1].timestamp = now + 250 + (i * 500);
- buffer[i * 2 + 1].message = Pm_Message(0x90, 60, 0);
- }
+ Pt_Sleep(10);
+ /* now we are 500 ms behind schedule, but since the latency
+ is 500, the delay should not be audible */
+ now += 2000;
+ for (i = 0; i < 4; i++) {
+ buffer[i * 2].timestamp = now + (i * 500);
+ buffer[i * 2].message = Pm_Message(0x90, 60, 100);
+ buffer[i * 2 + 1].timestamp = now + 250 + (i * 500);
+ buffer[i * 2 + 1].message = Pm_Message(0x90, 60, 0);
+ }
Pm_Write(midi, buffer, 8);
#endif
/* close device (this not explicitly needed in most implementations) */
- printf("ready to close and terminate... (type RETURN):");
- fgets(line, STRING_MAX, stdin);
-
+ printf("ready to close and terminate... (type ENTER):");
+ WAIT_FOR_ENTER
+
Pm_Close(midi);
Pm_Terminate();
printf("done closing and terminating...\n");
@@ -372,8 +407,10 @@ void main_test_stream() {
void show_usage()
{
- printf("Usage: test [-h] [-l latency-in-ms]\n");
- exit(0);
+ printf("Usage: test [-h] [-l latency-in-ms] [-v]\n"
+ " -h for this help message (only)\n"
+ " -l for latency\n"
+ " -v for verbose (enables more output)\n");
}
int main(int argc, char *argv[])
@@ -381,11 +418,12 @@ int main(int argc, char *argv[])
int default_in;
int default_out;
int i = 0, n = 0;
- char line[STRING_MAX];
int test_input = 0, test_output = 0, test_both = 0, somethingStupid = 0;
+ int isochronous_test = 0;
int stream_test = 0;
int latency_valid = FALSE;
+ show_usage();
if (sizeof(void *) == 8)
printf("Apparently this is a 64-bit machine.\n");
else if (sizeof(void *) == 4)
@@ -393,14 +431,18 @@ int main(int argc, char *argv[])
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-h") == 0) {
- show_usage();
+ exit(0);
} else if (strcmp(argv[i], "-l") == 0 && (i + 1 < argc)) {
i = i + 1;
latency = atoi(argv[i]);
printf("Latency will be %ld\n", (long) latency);
latency_valid = TRUE;
+ } else if (strcmp(argv[i], "-v") == 0) {
+ printf("Verbose is now TRUE\n");
+ verbose = TRUE; /* not currently used for anything */
} else {
show_usage();
+ exit(0);
}
}
@@ -409,21 +451,21 @@ int main(int argc, char *argv[])
printf("Latency in ms: ");
if (scanf("%d", &lat) == 1) {
latency = (int32_t) lat; // coerce from "%d" to known size
- latency_valid = TRUE;
+ latency_valid = TRUE;
}
}
/* determine what type of test to run */
printf("begin portMidi test...\n");
- printf("%s%s%s%s%s",
- "enter your choice...\n 1: test input\n",
- " 2: test input (fail w/assert)\n",
- " 3: test input (fail w/NULL assign)\n",
- " 4: test output\n 5: test both\n",
- " 6: stream test\n");
+ printf("enter your choice...\n 1: test input\n"
+ " 2: test input (fail w/assert)\n"
+ " 3: test input (fail w/NULL assign)\n"
+ " 4: test output\n 5: test both\n"
+ " 6: stream test (for WinMM)\n"
+ " 7. isochronous out\n");
while (n != 1) {
n = scanf("%d", &i);
- fgets(line, STRING_MAX, stdin);
+ WAIT_FOR_ENTER
switch(i) {
case 1:
test_input = 1;
@@ -442,9 +484,13 @@ int main(int argc, char *argv[])
case 5:
test_both = 1;
break;
- case 6:
- stream_test = 1;
- break;
+ case 6:
+ stream_test = 1;
+ break;
+ case 7:
+ test_output = 1;
+ isochronous_test = 1;
+ break;
default:
printf("got %d (invalid input)\n", n);
break;
@@ -478,12 +524,12 @@ int main(int argc, char *argv[])
} else if (test_input) {
main_test_input(somethingStupid);
} else if (test_output) {
- main_test_output();
+ main_test_output(isochronous_test);
} else if (test_both) {
main_test_both();
}
printf("finished portMidi test...type ENTER to quit...");
- fgets(line, STRING_MAX, stdin);
+ WAIT_FOR_ENTER
return 0;
}
diff --git a/3rdparty/portmidi/pm_test/virttest.c b/3rdparty/portmidi/pm_test/virttest.c
new file mode 100644
index 00000000000..1aeb09b8c54
--- /dev/null
+++ b/3rdparty/portmidi/pm_test/virttest.c
@@ -0,0 +1,339 @@
+/* virttest.c -- test for creating/deleting virtual ports */
+/*
+ * Roger B. Dannenberg
+ * Oct 2021
+
+This test is performed by running 2 instances of the program. The
+first instance makes input and output ports named portmidi and waits
+for a message. The second tries to do the same, but will fail because
+portmidi already exists. It then opens portmidi (both input and
+output). In greater detail:
+
+FIRST INSTANCE SECOND INSTANCE
+-------------- ---------------
+
+initialize PortMidi initialize PortMidi
+create portmidi in
+create portmidi out
+wait for input
+ create portmidi in -> fails
+ open portmidi in/out
+ send to portmidi
+recv from portmidi
+send to portmidi
+wait 1s recv from portmidi
+ close portmidi in and out
+ terminate PortMidi
+list all devices:
+ - check for correct number
+ - check for good description of portmidi in port (open)
+ - check for good description of portmidi out port (open)
+close portmidi in
+list all devices:
+ - check for correct number
+ - check for good description of portmidi in port (closed)
+ - check for good description of portmidi out port (open)
+close portmidi out
+list all devices:
+ - check for correct number
+ - check for good description of portmidi in port (closed)
+ - check for good description of portmidi out port (closed)
+delete portmidi in
+ - check for correct number
+ - check for NULL description of portmidi in port
+ - check for good description of portmidi out port (closed)
+delete portmidi out
+ - check for correct number
+ - check for NULL description of portmidi in port
+ - check for NULL description of portmidi out port
+terminate portmidi
+REPEAT 3 TIMES wait 2 seconds to give head start to other instance
+ REPEAT 3 TIMES
+ */
+
+#include "portmidi.h"
+#include "porttime.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+#define OUTPUT_BUFFER_SIZE 0
+#define INPUT_BUFFER_SIZE 10
+#define DEVICE_INFO NULL
+#define DRIVER_INFO NULL
+#define TIME_PROC ((PmTimeProcPtr) Pt_Time)
+#define TIME_INFO NULL
+#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
+
+
+static void prompt_and_exit(void)
+{
+ printf("type ENTER...");
+ while (getchar() != '\n') ;
+ /* this will clean up open ports: */
+ exit(-1);
+}
+
+
+static PmError printerror(PmError err, const char *msg)
+{
+ if (err == pmHostError) {
+ /* it seems pointless to allocate memory and copy the string,
+ * so I will do the work of Pm_GetHostErrorText directly
+ */
+ char errmsg[80];
+ Pm_GetHostErrorText(errmsg, 80);
+ printf("%s\n %s\n", msg, errmsg);
+ } else if (err < 0) {
+ printf("%s\n %s\n", msg, Pm_GetErrorText(err));
+ }
+ return err;
+}
+
+
+static PmError checkerror(PmError err)
+{
+ if (err < 0) {
+ printerror(err, "PortMidi call failed...");
+ prompt_and_exit();
+ }
+ return err;
+}
+
+
+void wait_until(PmTimestamp when)
+{
+ PtTimestamp now = Pt_Time();
+ if (when > now) {
+ Pt_Sleep(when - now);
+ }
+}
+
+
+void show_usage()
+{
+ printf("Usage: virttest\n"
+ " run two instances to test virtual port create/delete\n");
+}
+
+
+void check_info(int id, char stat, int input, int virtual)
+{
+ const PmDeviceInfo *info = Pm_GetDeviceInfo(id);
+ if (stat == 'd') {
+ if (info) {
+ printf("Expected device %d to be deleted.\n", id);
+ prompt_and_exit();
+ }
+ return;
+ }
+ if (!info) {
+ printf("Expected device %d to not be deleted.\n", id);
+ prompt_and_exit();
+ }
+ if (strcmp("portmidi", info->name) != 0) {
+ printf("Device %d name is %s, not \"portmidi\".\n", id, info->name);
+ prompt_and_exit();
+ }
+ if (info->input != input || (!info->output) != input) {
+ printf("Device %d input/output fields are wrong.\n", id);
+ prompt_and_exit();
+ }
+ if ((!info->opened && stat == 'o') || (info->opened && stat == 'c')) {
+ printf("Device %d opened==%d, status should be %c.\n", id,
+ info->opened, stat);
+ prompt_and_exit();
+ }
+ if (info->is_virtual != virtual) {
+ printf("Expected device %d to be virtual.\n", id);
+ prompt_and_exit();
+ }
+}
+
+
+/* stat is 'o' for open, 'c' for closed, 'd' for deleted device */
+void check_ports(int cnt, int in_id, char in_stat,
+ int out_id, char out_stat, int virtual)
+{
+ if (cnt != Pm_CountDevices()) {
+ printf("Device count changed from %d to %d.\n", cnt, Pm_CountDevices());
+ prompt_and_exit();
+ }
+ check_info(in_id, in_stat, TRUE, virtual);
+ check_info(out_id, out_stat, FALSE, virtual);
+}
+
+
+void devices_list()
+{
+ int i;
+ for (i = 0; i < Pm_CountDevices(); i++) {
+ const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+ if (info) {
+ printf("%d: %s %s %s %s\n", i, info->name,
+ (info->input ? "input" : "output"),
+ (info->is_virtual ? "virtual" : "real_device"),
+ (info->opened ? "opened" : "closed"));
+ }
+ }
+}
+
+
+void test2()
+{
+ PmStream *out = NULL;
+ PmStream *in = NULL;
+ int out_id;
+ int in_id;
+ PmEvent buffer[1];
+ PmTimestamp timestamp;
+ int pitch = 60;
+ int device_count = 0;
+ int i;
+
+ printf("This must be virttest instance #2\n");
+
+ /* find and open portmidi in and out */
+ device_count = Pm_CountDevices();
+ for (i = 0; i < device_count; i++) {
+ const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+ if (info && strcmp(info->name, "portmidi") == 0) {
+ if (info->input) {
+ checkerror(Pm_OpenInput(&in, i, DRIVER_INFO,
+ INPUT_BUFFER_SIZE, TIME_PROC, TIME_INFO));
+ in_id = i;
+ } else {
+ checkerror(Pm_OpenOutput(&out, i, DRIVER_INFO,
+ OUTPUT_BUFFER_SIZE, NULL, NULL, 0));
+ out_id = i;
+ }
+ }
+ }
+ if (!in) {
+ printf("Did not open portmidi as input (virtual output).\n");
+ prompt_and_exit();
+ }
+ if (!out) {
+ printf("Did not open portmidi as output (virtual input).\n");
+ prompt_and_exit();
+ }
+ printf("Input device %d and output device %d are open.\n", in_id, out_id);
+
+ /* send a message */
+ buffer[0].timestamp = 0;
+ buffer[0].message = Pm_Message(0x90, pitch, 100);
+ checkerror(Pm_Write(out, buffer, 1));
+
+ /* wait for reply */
+ printf("Sent message, waiting for reply...\n");
+ while (Pm_Read(in, buffer, 1) < 1) Pt_Sleep(10);
+
+ printf("********** GOT THE MESSAGE, SHUTTING DOWN ************\n");
+
+ /* close in */
+ checkerror(Pm_Close(in));
+ check_ports(device_count, in_id, 'c', out_id, 'o', FALSE);
+ printf("Closed input %d\n", in_id);
+
+ /* close out */
+ checkerror(Pm_Close(out));
+ check_ports(device_count, in_id, 'c', out_id, 'c', FALSE);
+ printf("Closed output %d\n", out_id);
+
+ Pt_Sleep(1000);
+ /* wrap it up */
+ Pm_Terminate();
+ printf("Got reply and terminated...\n");
+ Pt_Sleep(2000); /* 2 seconds because other is waiting 1s. */
+ /* 1 more second to make sure other shuts down before test repeats. */
+}
+
+extern int pm_check_errors;
+
+void test()
+{
+ PmStream *out;
+ PmStream *in;
+ int out_id;
+ int in_id;
+ PmEvent buffer[1];
+ PmTimestamp timestamp;
+ int device_count = 0;
+
+ TIME_START;
+
+ printf("******** INITIALIZING PORTMIDI ***********\n");
+ timestamp = Pt_Time();
+ Pm_Initialize();
+ printf("Pm_Initialize took %dms\n", Pt_Time() - timestamp);
+ devices_list();
+
+ pm_check_errors = FALSE; /* otherwise, PM_CHECK_ERRORS, if defined, */
+ /* can cause this program to report an error and exit on pmNameConflict. */
+ in_id = Pm_CreateVirtualInput("portmidi", NULL, DEVICE_INFO);
+ pm_check_errors = TRUE; /* there should be no other errors */
+ if (in_id < 0) {
+ printerror(in_id, "Pm_CreateVirtualInput failed...");
+ test2();
+ return;
+ }
+ printf("Created portmidi virtual input; this is virttest instance #1\n");
+ out_id = checkerror(Pm_CreateVirtualOutput("portmidi", NULL, DRIVER_INFO));
+ device_count = Pm_CountDevices();
+
+ checkerror(Pm_OpenInput(&in, in_id, NULL, 0, NULL, NULL));
+ checkerror(Pm_OpenOutput(&out, out_id, DRIVER_INFO, OUTPUT_BUFFER_SIZE,
+ TIME_PROC, TIME_INFO, 0));
+ printf("Created/Opened input %d and output %d\n", in_id, out_id);
+ Pm_SetFilter(in, PM_FILT_ACTIVE | PM_FILT_CLOCK | PM_FILT_SYSEX);
+ /* empty the buffer after setting filter, just in case anything
+ got through */
+ while (Pm_Read(in, buffer, 1)) ;
+
+ /* wait for input */
+ printf("Waiting for input...\n");
+ while (Pm_Read(in, buffer, 1) < 1) Pt_Sleep(10);
+
+ /* send two replies (only one would be fine) */
+ checkerror(Pm_Write(out, buffer, 1));
+ printf("Received input, writing output...\n");
+
+ /* wait 1s so receiver can get the message before we shut down */
+ Pt_Sleep(1000);
+ printf("****** Closing everything and shutting down...\n");
+
+ /* expect 2 open ports */
+ check_ports(device_count, in_id, 'o', out_id, 'o', TRUE);
+ /* close in */
+ checkerror(Pm_Close(in));
+ check_ports(device_count, in_id, 'c', out_id, 'o', TRUE);
+
+ /* close out */
+ checkerror(Pm_Close(out));
+ check_ports(device_count, in_id, 'c', out_id, 'c', TRUE);
+
+ /* delete in */
+ checkerror(Pm_DeleteVirtualDevice(in_id));
+ check_ports(device_count, in_id, 'd', out_id, 'c', TRUE);
+
+ /* delete out */
+ checkerror(Pm_DeleteVirtualDevice(out_id));
+ check_ports(device_count, in_id, 'd', out_id, 'd', TRUE);
+
+ /* we are done */
+ Pm_Terminate();
+}
+
+
+int main(int argc, char *argv[])
+{
+ int i;
+ show_usage();
+ for (i = 0; i < 3; i++) {
+ test();
+ }
+ printf("finished virttest (SUCCESS). Type ENTER to quit...");
+ while (getchar() != '\n') ;
+ return 0;
+}
diff --git a/3rdparty/portmidi/pm_win/README_WIN.txt b/3rdparty/portmidi/pm_win/README_WIN.txt
index fb9cff1583d..77d18680783 100644
--- a/3rdparty/portmidi/pm_win/README_WIN.txt
+++ b/3rdparty/portmidi/pm_win/README_WIN.txt
@@ -2,7 +2,7 @@ File: PortMidi Win32 Readme
Author: Belinda Thom, June 16 2002
Revised by: Roger Dannenberg, June 2002, May 2004, June 2007,
Umpei Kurokawa, June 2007
- Roger Dannenberg Sep 2009
+ Roger Dannenberg Sep 2009, May 2022
Contents:
Using Portmidi
@@ -18,187 +18,32 @@ Contents:
USING PORTMIDI:
=============================================================================
-Using Microsoft Visual C++ project files (provided with PortMidi), there
-are two configurations of the PortMidi library. The Debug version is
-intended for debugging, especially in a console application. The Debug
-version enables some extra error checking and outputs some text as well
-as a prompt to type ENTER so that you don't lose any debugging text when
-the program exits. You can turn off this extra debugging info by taking
-out the compile-time definition for DEBUG. (But leave _DEBUG, which I
-think is important for compiling in Debug mode.) This debugging version also
-defines PM_CHECK_ERRORS, which forces a check for error return codes from
-every call to PortMidi. You can disable this checking (especially if you
-want to handle error codes in your own way) by removing PM_CHECK_ERRORS
-from the predefined symbols list in the Settings dialog box.
+I recommend building a static library and linking with your
+application. PortMidi is not large. See ../README.md for
+basic compiling instructions.
-PortMidi is designed to run without a console and should work perfectly
-well within a graphical user interface application. The Release version
-is both optimized and lacking the debugging printout code of the Debug
-version.
-
-Read the portmidi.h file for PortMidi API details on using the PortMidi API.
-See <...>\pm_test\test.c and other files in pm_test for usage examples.
-
-=============================================================================
-TO INSTALL PORTMIDI:
-=============================================================================
-1) get current source from the portmedia project at SourceForge.net
-
-2) copy source into directory: <...>\portmidi
-
-=============================================================================
-TO COMPILE PORTMIDI:
-=============================================================================
-
-3) cd to or open the portmidi directory
-
-4) start or click on the portmidi.sln workspace (note, all Visual Studio
- files are built by CMake. If you need a different version or have
- problems with paths, try rebuilding the Visual Studio project files
- using CMake -- See "Using other versions of visual C++" below.)
-
-5) the following projects exist within this workspace:
- - portmidi-static, portmidi-dynamic (versions of the PortMidi library)
- - test (simple midi I/O testing)
- - midithread (an example illustrating low-latency MIDI processing
- using a dedicated low-latency thread)
- - sysex (simple sysex message I/O testing)
- - latency (uses porttime to measure system latency)
- - midithru (an example illustrating software MIDI THRU)
- - qtest (a test of the new multicore-safe queue implementation)
- - mm (allows monitoring of midi messages)
- - pmjni (a dll to provide an interface to PortMidi for Java)
-
-6) set the Java SDK path using one of two methods:
- Method 1: open portmidi/CMakeLists.txt with CMake, configure, and
- generate -- this should find the Java SDK path and update your
- solution and project files
- Method 2: (does not require CMake):
- - open the pmjni project properties
- - visit Configuration Properties, C/C++, General
- - find Additional Include Directories property and open the editor (...)
- - at the end of the list, you will find two paths mentioning Java
- - these are absolute paths to the Java SDK; you'll need to install the
- Java SDK (from Sun) and update these directories in order to build
- this project.
- - similarly, the Linker->Input->Additional Dependencies list has a
- path to the jvm.lib file, which needs to be correct(ed).
-
-6) use Build->Batch Build ... to build everything in the project. If a
- build fails, try building again. There seem to be some missing
- dependencies, so you may have to "ALL_BUILD" several times before
- everything builds successfully.
-
-7) The settings for these projects were distributed in the zip file, so
- compile should just work.
-
-8) run test project; use the menu that shows up from the command prompt to
- test that portMidi works on your system. tests include:
- - verify midi output works
- - verify midi input works
-
-9) run other projects if you wish: sysex, latency, midithread, mm,
- qtest, midithru
-
-10) compile the java code:
- - cd pm_java
- - make.bat
- + If there is a problem running javac, note that you must have
- a path to javac.exe on your PATH environment variable. Edit
- your path (in Vista) using Control Panel > User Accounts >
- User Accounts > Change my environment variables; then select
- Path and click Edit... After changing, you will have to
- restart the command window to see any effect.
- + In Vista, you may get a warning about running
- UpdateRsrcJavaExe.exe. This is called by make.bat, and you
- should allow the program to run.
- + Note that make.bat does not build pmjni\jportmidi_JPortMidiApi.h
- because it is included in the distribution. You can rebuild it
- from sources as follows:
- cd pm_java
- javah jportmidi.JPortMidiApi
- move jportmidi_JPortMidiApi pmjni\jportmidi_JPortMidiApi.h
-
-11) you might wish to move pm_java/win32 to another location; run the
- pmdefaults.exe program from the (entire) win32 directory to use
- PmDefaults. This program let's you select default input/output
- midi devices for PortMidi applications.
-
-============================================================================
-ABOUT CMAKE
-============================================================================
-
-cmake was used to generate .vcproj files. cmake embeds absolute paths
-into .vcproj files, which makes the files non-portable to other systems.
-To work around this problem, pm_win\clean_up_vcproj.bat can be used to
-replace absolute paths with relative paths. To use it, you will need to
-install gawk and set your search path to allow you to execute gawk, e.g.
-my path includes "C:\Program Files\GnuWin32\bin;". You will also need to
-edit pm_win\clean_up_vcproj.awk, replacing C:\Users\rbd\portmidi with
-whatever absolute path cmake uses in your vcproj files.
-
-This is not a general or robust fix, but it seems to work with the
-vcproj files currently created by CMake.
-
-============================================================================
-USING OTHER VERSIONS OF VISUAL C++
-============================================================================
+The Windows version has a couple of extra switches: You can define
+DEBUG and MMDEBUG for a few extra messages (see the code).
-You can use cmake to make Visual Studio solution and project files.
-If you do not want to use the provided Version 9 project files, install
-cmake, run it, set the "Where is the source code" box to your portmidi
-directory, and click on Configure. A menu will allow you to choose the
-Visual Studio project version you want. Click Configure once again, then
-Generate, and you should be all set to open portmidi.sln.
+If PM_CHECK_ERRORS is defined, PortMidi reports and exits on any
+error. This requires terminal output to see, and aborts your
+application, so it's only intended for quick command line programs
+where you do not care to check return values and handle errors
+more robustly.
-============================================================================
-TO CREATE YOUR OWN PORTMIDI CLIENT APPLICATION:
-============================================================================
-
-NOTE: this section needs to be reviewed and tested. My suggestion would
-be to copy the test project file (test.dsp) and modify it. -RBD
+PortMidi is designed to run without a console and should work perfectly
+well within a graphical user interface application.
-The easiest way is to start a new project w/in the portMidi workspace:
+Read the portmidi.h file for PortMidi API details on using the PortMidi API.
+See <...>\pm_test\testio.c and other files in pm_test for usage examples.
-1) To open new project:
- - File->New->Projects
- - Location: <...>\portmidi\<yourProjectName>
- - check Add to current workspace
- - select Win32 Console Application (recommended for now)
- - do *NOT* select the "make dependency" box (you will explicitly do this
- in the next step)
- - Click OK
- - Select "An Empty Project" and click Finish
+There are many other programs in pm_test, including a MIDI monitor.
- In Visual C++ 2005 Express Edition,
- - File->New->Projects
- - Location: <...>\portmidi\<yourProjectName>
- - select Add to solution
- - select CLR Empty project in CLR
- - select Win32 Console Application in Win32
- - select Empty project in General
-
-2) Now this project will be the active project. Make it explicitly depend
- on PortMidi dll:
- - Project->Dependencies
- - Click pm_dll
-
-3) add whatever files you wish to add to your new project, using portMidi
- calls as desired (see USING PORTMIDI at top of this readme)
-
-4) when you include portMidi files, do so like this:
- - #include "..\pm_common\portmidi.h"
- - etc.
-
-5) build and run your project
============================================================================
DESIGN NOTES
============================================================================
-PortMidi for Win32 exists as a simple static library,
-with Win32-specific code in pmwin.c and MM-specific code in pmwinmm.c.
-
Orderly cleanup after errors are encountered is based on a fixed order of
steps and state changes to reflect each step. Here's the order:
@@ -218,8 +63,7 @@ To open input:
- return
- return
-SYSEX HANDLING -- the most complex, least exercised, and therefore most
- buggy part of PortMidi (but maybe bugs are finally gone)
+SYSEX HANDLING
There are three cases: simple output, stream output, input
Each must deal with:
@@ -327,15 +171,4 @@ part of PortMidi is allowed to directly copy sysex bytes to
"fill_base[*fill_offset_ptr++]" until *fill_offset_ptr reaches
fill_length. See the code for details.
------------
-
-Additional notes on using VS 2005 (maybe this is obsolete now?):
-
-1) Make sure "Configuration: All Configurations" is selected in all of the following Properties modifications!
-
-2) In my case the project defaulted to compiling all .c files with the C++ compiler, which was disastrous. I had to go to set Properties for each file, to wit: Expand Configuration Properties, Expand C/C++, Select Advanced, set the Compile As popup to Compile as C Code (/TC). (For better or worse, the project I inherited has a bunch of .c files that rely on C++ features, so I couldn't reliably set this the project properties level.)
-
-3) While you're there, make sure that the C/C++ -> General -> "Compile with Common Language Runtime support" is set to "No Common Language Runtime support" (the C compiler *can't* support CLR, but VS won't do anything useful like automatically set the two options to match)-.
-
-4) I never got VS precompiled header thing to work sensibly, so I took the path of least resistance and turned PCH's off for all my files. Properties -> Configuration Properties -> C/C++ -> Precompiled Headers -> Create/Use Precompiled Header popup set to "Not Using Precompiled Headers". The compiler is reasonably fast even if it has to parse all the header files, so unless someone wants to explain VS's PCHs to me, the hell with it, I say.
diff --git a/3rdparty/portmidi/pm_win/clean_cmake.bat b/3rdparty/portmidi/pm_win/clean_cmake.bat
deleted file mode 100644
index e9579e67d3f..00000000000
--- a/3rdparty/portmidi/pm_win/clean_cmake.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-del /Q ..\CMakeFiles
-del /Q ..\CMakeCache.txt
-del /Q ..\pm_test\CMakeFiles
-del /Q ..\pm_common\CMakeFiles
-del /Q ..\pm_dylib\CMakeFiles
-
diff --git a/3rdparty/portmidi/pm_win/clean_up_vcproj.awk b/3rdparty/portmidi/pm_win/clean_up_vcproj.awk
deleted file mode 100644
index a3eadfcb848..00000000000
--- a/3rdparty/portmidi/pm_win/clean_up_vcproj.awk
+++ /dev/null
@@ -1,70 +0,0 @@
-# gawk script to convert CMake-generated Visual Studio projects into
-# stand-alone project files
-#
-# Roger Dannenberg, October 2009
-#
-# the result uses relative path names (so you can install the project on
-# any machine and use it)
-#
-# NOTE: to run this, you must assign base_relative to the relative path
-# from the vcproj file to portmidi, e.g. base_relative=.. or base_relative=.
-
-BEGIN {
- state = "normal";
- #=================IMPORTANT====================
- # change the following path to the path in which
- # the CMakeLists.txt file resides:
- base_path = "C:\\\\Users\\\\rbd\\\\portmedia\\\\portmidi";
- #==============================================
-
- base_path_2 = base_path;
- gsub("\\\\\\\\", "/", base_path_2)
- cmake_stuff = 0; # flag to print <file> ... </file> text
-}
-# this case removes CMake phases from project
-state == "cmakelists" {
- # print "IN CMAKELISTS "
- file_text = file_text "\n" $0 # collect the <file> ... </file> section
- if (index($0, "CMakeLists.txt") > 0) {
- cmake_stuff = 1 # remember to delete this <file> ... </file> section
- }
-
- if (index($0, "</File>") > 0) {
- state = "normal";
- if (cmake_stuff == 0) {
- gsub(base_path, base_relative, file_text)
- gsub(base_path_2, base_relative, file_text)
- print file_text;
- }
- cmake_stuff = 0;
- };
- next
-}
-
-# this is the normal case, not in buildPhases list
-state == "normal" {
- # print "NOT IN BUILD PHASES"
- # take out all the absolute paths
- gsub(base_path, base_relative, $0);
- gsub(base_path_2, base_relative, $0);
- # special processing for <file> ... </file> text:
- if ($0 ~ "<File$") {
- file_text = $0;
- cmake_stuff = 0; # innocent (keep text) until proven guilty
- state = "cmakelists";
- next # do not print this line
- };
- # THIS CODE WOULD ALLOW portmidi-static and portmidi-dynamic IN
- # pm_commmon. I DECIDED TO TRY PUTTING THEM IN SEPARATE DIRECTORIES
- # INSTEAD.
- # Use static libraries for everything except portmidi-dynamic
- #if (($0 ~ "RuntimeLibrary=") && (base_relative ~ "dynamic")) {
- # if ($0 ~ 2) {
- # $0 = "\t\t\t\tRuntimeLibrary=\"0\"";
- # } else if ($0 ~ 3) {
- # $0 = "\t\t\t\tRuntimeLibrary=\"1\"";
- # }
- print $0;
- next
-}
-
diff --git a/3rdparty/portmidi/pm_win/clean_up_vcproj.bat b/3rdparty/portmidi/pm_win/clean_up_vcproj.bat
deleted file mode 100644
index 0557876431c..00000000000
--- a/3rdparty/portmidi/pm_win/clean_up_vcproj.bat
+++ /dev/null
@@ -1,76 +0,0 @@
-@echo off
-rem Start this program in portmidi\pm_win
-cd ..\pm_common
-
-rename portmidi-static.vcproj portmidi-static.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. portmidi-static.vcproj-cmake > portmidi-static.vcproj
-del portmidi-static.vcproj-cmake
-echo portmidi-static
-
-rename pmjni.vcproj pmjni.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. pmjni.vcproj-cmake > pmjni.vcproj
-del pmjni.vcproj-cmake
-echo pmjni
-
-cd ../pm_dylib
-
-rename portmidi-dynamic.vcproj portmidi-dynamic.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. portmidi-dynamic.vcproj-cmake > portmidi-dynamic.vcproj
-del portmidi-dynamic.vcproj-cmake
-echo portmidi-dynamic
-
-cd ..\pm_test
-
-rename latency.vcproj latency.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. latency.vcproj-cmake > latency.vcproj
-del latency.vcproj-cmake
-echo latency
-
-rename midiclock.vcproj midiclock.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. midiclock.vcproj-cmake > midiclock.vcproj
-del midiclock.vcproj-cmake
-echo midiclock
-
-rename midithread.vcproj midithread.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. midithread.vcproj-cmake > midithread.vcproj
-del midithread.vcproj-cmake
-echo midithread
-
-rename midithru.vcproj midithru.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. midithru.vcproj-cmake > midithru.vcproj
-del midithru.vcproj-cmake
-echo midithru
-
-rename mm.vcproj mm.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. mm.vcproj-cmake > mm.vcproj
-del mm.vcproj-cmake
-echo mm
-
-rename qtest.vcproj qtest.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. qtest.vcproj-cmake > qtest.vcproj
-del qtest.vcproj-cmake
-echo qtest
-
-rename sysex.vcproj sysex.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. sysex.vcproj-cmake > sysex.vcproj
-del sysex.vcproj-cmake
-echo sysex
-
-rename test.vcproj test.vcproj-cmake
-gawk -f ..\pm_win\clean_up_vcproj.awk -v base_relative=.. test.vcproj-cmake > test.vcproj
-del test.vcproj-cmake
-
-cd ..
-echo test
-
-rename ALL_BUILD.vcproj ALL_BUILD.vcproj-cmake
-gawk -f pm_win\clean_up_vcproj.awk -v base_relative=. ALL_BUILD.vcproj-cmake > ALL_BUILD.vcproj
-del ALL_BUILD.vcproj-cmake
-echo ALL_BUILD
-
-rename ZERO_CHECK.vcproj ZERO_CHECK.vcproj-cmake
-gawk -f pm_win\clean_up_vcproj.awk -v base_relative=. ZERO_CHECK.vcproj-cmake > ZERO_CHECK.vcproj
-del ZERO_CHECK.vcproj-cmake
-echo ZERO_CHECK
-
-cd pm_win
diff --git a/3rdparty/portmidi/pm_win/pmwin.c b/3rdparty/portmidi/pm_win/pmwin.c
index a57ed878df6..cca83be08ca 100644
--- a/3rdparty/portmidi/pm_win/pmwin.c
+++ b/3rdparty/portmidi/pm_win/pmwin.c
@@ -20,7 +20,6 @@
#ifdef DEBUG
#include "stdio.h"
#endif
-#undef UNICODE
#include <windows.h>
/* pm_exit is called when the program exits.
@@ -29,23 +28,21 @@
*/
static void pm_exit(void) {
pm_term();
-#ifdef DEBUG
-#define STRING_MAX 80
- {
- char line[STRING_MAX];
- printf("Type ENTER...\n");
- /* note, w/o this prompting, client console application can not see one
- of its errors before closing. */
- fgets(line, STRING_MAX, stdin);
- }
-#endif
}
+static BOOL WINAPI ctrl_c_handler(DWORD fdwCtrlType)
+{
+ exit(1); /* invokes pm_exit() */
+ ExitProcess(1); /* probably never called */
+ return TRUE;
+}
+
/* pm_init is the windows-dependent initialization.*/
void pm_init(void)
{
atexit(pm_exit);
+ SetConsoleCtrlHandler(ctrl_c_handler, TRUE);
#ifdef DEBUG
printf("registered pm_exit with atexit()\n");
#endif
@@ -59,40 +56,41 @@ void pm_term(void) {
}
-static PmDeviceID pm_get_default_device_id(int is_input, char *key) {
+static PmDeviceID pm_get_default_device_id(int is_input, const char *key) {
HKEY hkey;
#define PATTERN_MAX 256
char pattern[PATTERN_MAX];
- DWORD pattern_max = PATTERN_MAX;
+ long pattern_max = PATTERN_MAX;
DWORD dwType;
/* Find first input or device -- this is the default. */
PmDeviceID id = pmNoDevice;
int i, j;
Pm_Initialize(); /* make sure descriptors exist! */
- for (i = 0; i < pm_descriptor_index; i++) {
- if (descriptors[i].pub.input == is_input) {
+ for (i = 0; i < pm_descriptor_len; i++) {
+ if (pm_descriptors[i].pub.input == is_input) {
id = i;
break;
}
}
/* Look in registry for a default device name pattern. */
- if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey) !=
+ if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey) !=
ERROR_SUCCESS) {
return id;
}
- if (RegOpenKeyExA(hkey, "JavaSoft", 0, KEY_READ, &hkey) !=
+ if (RegOpenKeyEx(hkey, "JavaSoft", 0, KEY_READ, &hkey) !=
ERROR_SUCCESS) {
return id;
}
- if (RegOpenKeyExA(hkey, "Prefs", 0, KEY_READ, &hkey) !=
+ if (RegOpenKeyEx(hkey, "Prefs", 0, KEY_READ, &hkey) !=
ERROR_SUCCESS) {
return id;
}
- if (RegOpenKeyExA(hkey, "/Port/Midi", 0, KEY_READ, &hkey) !=
+ if (RegOpenKeyEx(hkey, "/Port/Midi", 0, KEY_READ, &hkey) !=
ERROR_SUCCESS) {
return id;
}
- if (RegQueryValueExA(hkey, key, NULL, &dwType, (BYTE *)pattern, &pattern_max) !=
+ if (RegQueryValueEx(hkey, key, NULL, &dwType, (BYTE *) pattern,
+ (DWORD *) &pattern_max) !=
ERROR_SUCCESS) {
return id;
}
@@ -118,15 +116,15 @@ static PmDeviceID pm_get_default_device_id(int is_input, char *key) {
}
-PmDeviceID Pm_GetDefaultInputDeviceID() {
+PmDeviceID Pm_GetDefaultInputDeviceID(void) {
return pm_get_default_device_id(TRUE,
- (char *)"/P/M_/R/E/C/O/M/M/E/N/D/E/D_/I/N/P/U/T_/D/E/V/I/C/E");
+ "/P/M_/R/E/C/O/M/M/E/N/D/E/D_/I/N/P/U/T_/D/E/V/I/C/E");
}
-PmDeviceID Pm_GetDefaultOutputDeviceID() {
+PmDeviceID Pm_GetDefaultOutputDeviceID(void) {
return pm_get_default_device_id(FALSE,
- (char *)"/P/M_/R/E/C/O/M/M/E/N/D/E/D_/O/U/T/P/U/T_/D/E/V/I/C/E");
+ "/P/M_/R/E/C/O/M/M/E/N/D/E/D_/O/U/T/P/U/T_/D/E/V/I/C/E");
}
diff --git a/3rdparty/portmidi/pm_win/pmwinmm.c b/3rdparty/portmidi/pm_win/pmwinmm.c
index f8b97301bc7..dfe0255ac22 100644
--- a/3rdparty/portmidi/pm_win/pmwinmm.c
+++ b/3rdparty/portmidi/pm_win/pmwinmm.c
@@ -1,16 +1,12 @@
/* pmwinmm.c -- system specific definitions */
-#ifdef _MSC_VER
- #pragma warning(disable: 4133) // stop warnings about implicit typecasts
-#endif
-
#ifndef _WIN32_WINNT
/* without this define, InitializeCriticalSectionAndSpinCount is
* undefined. This version level means "Windows 2000 and higher"
*/
#define _WIN32_WINNT 0x0500
#endif
-#undef UNICODE
+
#include "windows.h"
#include "mmsystem.h"
#include "portmidi.h"
@@ -20,28 +16,10 @@
#include <string.h>
#include "porttime.h"
-#ifndef _WINDOWS_H
-typedef unsigned int UINT32;
-#endif
-
-#ifndef _WINDOWS_H
-#ifdef _MSC_VER
-typedef unsigned __int64 UINT64;
-#else
-__extension__ typedef unsigned long long UINT64;
-#endif
-#endif
-
-#ifdef PTR64
-typedef UINT64 FPTR;
-#else
-typedef UINT32 FPTR;
-#endif
-
/* asserts used to verify portMidi code logic is sound; later may want
something more graceful */
#include <assert.h>
-#ifdef DEBUG
+#ifdef MMDEBUG
/* this printf stuff really important for debugging client app w/host errors.
probably want to do something else besides read/write from/to console
for portability, however */
@@ -59,13 +37,9 @@ static void CALLBACK winmm_in_callback(HMIDIIN hMidiIn,
UINT wMsg, DWORD_PTR dwInstance,
DWORD_PTR dwParam1, DWORD_PTR dwParam2);
static void CALLBACK winmm_streamout_callback(HMIDIOUT hmo, UINT wMsg,
- DWORD_PTR dwInstance, DWORD_PTR dwParam1,
+ DWORD_PTR dwInstance,
+ DWORD_PTR dwParam1,
DWORD_PTR dwParam2);
-#ifdef USE_SYSEX_BUFFERS
-static void CALLBACK winmm_out_callback(HMIDIOUT hmo, UINT wMsg,
- DWORD_PTR dwInstance, DWORD_PTR dwParam1,
- DWORD_PTR dwParam2);
-#endif
extern pm_fns_node pm_winmm_in_dictionary;
extern pm_fns_node pm_winmm_out_dictionary;
@@ -115,10 +89,6 @@ The following constants help to represent these design parameters:
#define MIDIHDR_SYSEX_BUFFER_LENGTH(x) ((x) + sizeof(long)*3)
/* A MIDIHDR with a sysex message is the buffer length plus the header size */
#define MIDIHDR_SYSEX_SIZE(x) (MIDIHDR_SYSEX_BUFFER_LENGTH(x) + sizeof(MIDIHDR))
-#ifdef USE_SYSEX_BUFFERS
-/* Size of a MIDIHDR with a buffer contaning multiple MIDIEVENT structures */
-#define MIDIHDR_SIZE(x) ((x) + sizeof(MIDIHDR))
-#endif
/*
==============================================================================
@@ -135,7 +105,7 @@ MIDIOUTCAPS midi_out_mapper_caps;
UINT midi_num_outputs = 0;
/* per device info */
-typedef struct midiwinmm_struct {
+typedef struct winmm_info_struct {
union {
HMIDISTRM stream; /* windows handle for stream */
HMIDIOUT out; /* windows handle for out calls */
@@ -151,13 +121,6 @@ typedef struct midiwinmm_struct {
int num_buffers; /* how many buffers allocated in buffers array */
int next_buffer; /* index of next buffer to send */
HANDLE buffer_signal; /* used to wait for buffer to become free */
-#ifdef USE_SYSEX_BUFFERS
- /* sysex buffers will be allocated only when
- * a sysex message is sent. The size of the buffer is fixed.
- */
- LPMIDIHDR sysex_buffers[NUM_SYSEX_BUFFERS]; /* pool of buffers for sysex data */
- int next_sysex_buffer; /* index of next sysexbuffer to send */
-#endif
unsigned long last_time; /* last output time */
int first_message; /* flag: treat first message differently */
int sysex_mode; /* middle of sending sysex */
@@ -167,9 +130,8 @@ typedef struct midiwinmm_struct {
unsigned long sync_time; /* when did we last determine delta? */
long delta; /* difference between stream time and
real time */
- int error; /* host error from doing port midi call */
CRITICAL_SECTION lock; /* prevents reentrant callbacks (input only) */
-} midiwinmm_node, *midiwinmm_type;
+} winmm_info_node, *winmm_info_type;
/*
@@ -198,9 +160,9 @@ static void pm_winmm_general_inputs(void)
if (wRtn == MMSYSERR_NOERROR) {
/* ignore errors here -- if pm_descriptor_max is exceeded, some
devices will not be accessible. */
- pm_add_device((char *)"MMSystem", midi_in_caps[i].szPname, TRUE,
- (void *)(FPTR)i,
- &pm_winmm_in_dictionary);
+#pragma warning(suppress: 4047) // coerce non-pointer to pointer is OK
+ pm_add_device("MMSystem", midi_in_caps[i].szPname, TRUE, FALSE,
+ (void *) (intptr_t) i, &pm_winmm_in_dictionary);
}
}
}
@@ -217,8 +179,9 @@ static void pm_winmm_mapper_input(void)
(LPMIDIINCAPS) & midi_in_mapper_caps,
sizeof(MIDIINCAPS));
if (wRtn == MMSYSERR_NOERROR) {
- pm_add_device((char *)"MMSystem", midi_in_mapper_caps.szPname, TRUE,
- (void *)(FPTR)MIDIMAPPER, &pm_winmm_in_dictionary);
+#pragma warning(suppress: 4047) // coerce non-pointer to pointer is OK
+ pm_add_device("MMSystem", midi_in_mapper_caps.szPname, TRUE, FALSE,
+ (void *) (intptr_t) MIDIMAPPER, &pm_winmm_in_dictionary);
}
}
@@ -228,7 +191,7 @@ static void pm_winmm_general_outputs(void)
UINT i;
DWORD wRtn;
midi_num_outputs = midiOutGetNumDevs();
- midi_out_caps = pm_alloc( sizeof(MIDIOUTCAPS) * midi_num_outputs );
+ midi_out_caps = pm_alloc(sizeof(MIDIOUTCAPS) * midi_num_outputs);
if (midi_out_caps == NULL) {
/* no error is reported -- see pm_winmm_general_inputs */
@@ -239,9 +202,9 @@ static void pm_winmm_general_outputs(void)
wRtn = midiOutGetDevCaps(i, (LPMIDIOUTCAPS) & midi_out_caps[i],
sizeof(MIDIOUTCAPS));
if (wRtn == MMSYSERR_NOERROR) {
- pm_add_device((char *)"MMSystem", midi_out_caps[i].szPname, FALSE,
- (void *)(FPTR)i,
- &pm_winmm_out_dictionary);
+#pragma warning(suppress: 4047) // coerce non-pointer to pointer is OK
+ pm_add_device("MMSystem", midi_out_caps[i].szPname, FALSE, FALSE,
+ (void *) (intptr_t) i, &pm_winmm_out_dictionary);
}
}
}
@@ -256,23 +219,18 @@ static void pm_winmm_mapper_output(void)
wRtn = midiOutGetDevCaps((UINT) MIDIMAPPER, (LPMIDIOUTCAPS)
& midi_out_mapper_caps, sizeof(MIDIOUTCAPS));
if (wRtn == MMSYSERR_NOERROR) {
- pm_add_device((char *)"MMSystem", midi_out_mapper_caps.szPname, FALSE,
- (void *)(FPTR)MIDIMAPPER, &pm_winmm_out_dictionary);
+#pragma warning(suppress: 4047) // coerce non-pointer to pointer is OK
+ pm_add_device("MMSystem", midi_out_mapper_caps.szPname, FALSE, FALSE,
+ (void *) (intptr_t) MIDIMAPPER, &pm_winmm_out_dictionary);
}
}
/*
-=========================================================================================
+============================================================================
host error handling
-=========================================================================================
+============================================================================
*/
-static unsigned int winmm_has_host_error(PmInternal * midi)
-{
- midiwinmm_type m = (midiwinmm_type)midi->descriptor;
- return m->error;
-}
-
/* str_copy_len -- like strcat, but won't overrun the destination string */
/*
@@ -280,41 +238,30 @@ static unsigned int winmm_has_host_error(PmInternal * midi)
*/
static int str_copy_len(char *dst, char *src, int len)
{
+ // Note: Visual C will suggest using a non-portable strncpy_s here
+#pragma warning(suppress: 4996) // suppress warning for just this line
strncpy(dst, src, len);
/* just in case suffex is greater then len, terminate with zero */
dst[len - 1] = 0;
- return strlen(dst);
+ return (int) strlen(dst);
}
-static void winmm_get_host_error(PmInternal * midi, char * msg, UINT len)
+static unsigned int winmm_check_host_error(PmInternal *midi)
{
- /* precondition: midi != NULL */
- midiwinmm_node * m = (midiwinmm_node *) midi->descriptor;
- char *hdr1 = (char *)"Host error: ";
- //char *hdr2 = (char *)"Host callback error: ";
-
- msg[0] = 0; /* initialize result string to empty */
-
- if (descriptors[midi->device_id].pub.input) {
- /* input and output use different winmm API calls */
- if (m) { /* make sure there is an open device to examine */
- if (m->error != MMSYSERR_NOERROR) {
- int n = str_copy_len(msg, hdr1, len);
- /* read and record host error */
- midiInGetErrorText(m->error, msg + n, len - n);
- //assert(err == MMSYSERR_NOERROR);
- m->error = MMSYSERR_NOERROR;
- }
- }
- } else { /* output port */
- if (m) {
- if (m->error != MMSYSERR_NOERROR) {
- int n = str_copy_len(msg, hdr1, len);
- midiOutGetErrorText(m->error, msg + n, len - n);
- //assert(err == MMSYSERR_NOERROR);
- m->error = MMSYSERR_NOERROR;
- }
+ return FALSE;
+}
+
+
+static void improve_winerr(int pm_hosterror, char *message)
+{
+ if (pm_hosterror == MMSYSERR_NOMEM) {
+ /* add explanation to Window's confusing error message */
+ /* if there's room: */
+ if (PM_HOST_ERROR_MSG_LEN - strlen(pm_hosterror_text) > 60) {
+#pragma warning(suppress: 4996) // don't use suggested strcat_s
+ strcat(pm_hosterror_text, " Probably this MIDI device is open "
+ "in another application.");
}
}
}
@@ -339,123 +286,59 @@ static MIDIHDR *allocate_buffer(long data_size)
return hdr;
}
-#ifdef USE_SYSEX_BUFFERS
-static MIDIHDR *allocate_sysex_buffer(long data_size)
-{
- /* we're actually allocating more than data_size because the buffer
- * will include the MIDIEVENT header in addition to the data
- */
- LPMIDIHDR hdr = (LPMIDIHDR) pm_alloc(MIDIHDR_SYSEX_SIZE(data_size));
- MIDIEVENT *evt;
- if (!hdr) return NULL;
- evt = (MIDIEVENT *) (hdr + 1); /* place MIDIEVENT after header */
- hdr->lpData = (LPSTR) evt;
- hdr->dwFlags = 0;
- hdr->dwUser = 0;
- return hdr;
-}
-#endif
-static PmError allocate_buffers(midiwinmm_type m, long data_size, long count)
+static PmError allocate_buffers(winmm_info_type info, long data_size,
+ long count)
{
int i;
/* buffers is an array of count pointers to MIDIHDR/MIDIEVENT struct */
- m->num_buffers = 0; /* in case no memory can be allocated */
- m->buffers = (LPMIDIHDR *) pm_alloc(sizeof(LPMIDIHDR) * count);
- if (!m->buffers) return pmInsufficientMemory;
- m->max_buffers = count;
+ info->num_buffers = 0; /* in case no memory can be allocated */
+ info->buffers = (LPMIDIHDR *) pm_alloc(sizeof(LPMIDIHDR) * count);
+ if (!info->buffers) return pmInsufficientMemory;
+ info->max_buffers = count;
for (i = 0; i < count; i++) {
LPMIDIHDR hdr = allocate_buffer(data_size);
if (!hdr) { /* free everything allocated so far and return */
- for (i = i - 1; i >= 0; i--) pm_free(m->buffers[i]);
- pm_free(m->buffers);
- m->max_buffers = 0;
+ for (i = i - 1; i >= 0; i--) pm_free(info->buffers[i]);
+ pm_free(info->buffers);
+ info->max_buffers = 0;
return pmInsufficientMemory;
}
- m->buffers[i] = hdr; /* this may be NULL if allocation fails */
+ info->buffers[i] = hdr; /* this may be NULL if allocation fails */
}
- m->num_buffers = count;
+ info->num_buffers = count;
return pmNoError;
}
-#ifdef USE_SYSEX_BUFFERS
-static PmError allocate_sysex_buffers(midiwinmm_type m, long data_size)
-{
- PmError rslt = pmNoError;
- /* sysex_buffers is an array of count pointers to MIDIHDR/MIDIEVENT struct */
- int i;
- for (i = 0; i < NUM_SYSEX_BUFFERS; i++) {
- LPMIDIHDR hdr = allocate_sysex_buffer(data_size);
-
- if (!hdr) rslt = pmInsufficientMemory;
- m->sysex_buffers[i] = hdr; /* this may be NULL if allocation fails */
- hdr->dwFlags = 0; /* mark as free */
- }
- return rslt;
-}
-#endif
-
-#ifdef USE_SYSEX_BUFFERS
-static LPMIDIHDR get_free_sysex_buffer(PmInternal *midi)
-{
- LPMIDIHDR r = NULL;
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- if (!m->sysex_buffers[0]) {
- if (allocate_sysex_buffers(m, SYSEX_BYTES_PER_BUFFER)) {
- return NULL;
- }
- }
- /* busy wait until we find a free buffer */
- while (TRUE) {
- int i;
- for (i = 0; i < NUM_SYSEX_BUFFERS; i++) {
- /* cycle through buffers, modulo NUM_SYSEX_BUFFERS */
- m->next_sysex_buffer++;
- if (m->next_sysex_buffer >= NUM_SYSEX_BUFFERS) m->next_sysex_buffer = 0;
- r = m->sysex_buffers[m->next_sysex_buffer];
- if ((r->dwFlags & MHDR_PREPARED) == 0) goto found_sysex_buffer;
- }
- /* after scanning every buffer and not finding anything, block */
- if (WaitForSingleObject(m->buffer_signal, 1000) == WAIT_TIMEOUT) {
-#ifdef DEBUG
- printf("PortMidi warning: get_free_sysex_buffer() wait timed out after 1000ms\n");
-#endif
- }
- }
-found_sysex_buffer:
- r->dwBytesRecorded = 0;
- r->dwBufferLength = 0; /* changed to correct value later */
- return r;
-}
-#endif
static LPMIDIHDR get_free_output_buffer(PmInternal *midi)
{
LPMIDIHDR r = NULL;
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+ winmm_info_type info = (winmm_info_type) midi->api_info;
while (TRUE) {
int i;
- for (i = 0; i < m->num_buffers; i++) {
- /* cycle through buffers, modulo m->num_buffers */
- m->next_buffer++;
- if (m->next_buffer >= m->num_buffers) m->next_buffer = 0;
- r = m->buffers[m->next_buffer];
+ for (i = 0; i < info->num_buffers; i++) {
+ /* cycle through buffers, modulo info->num_buffers */
+ info->next_buffer++;
+ if (info->next_buffer >= info->num_buffers) info->next_buffer = 0;
+ r = info->buffers[info->next_buffer];
if ((r->dwFlags & MHDR_PREPARED) == 0) goto found_buffer;
}
/* after scanning every buffer and not finding anything, block */
- if (WaitForSingleObject(m->buffer_signal, 1000) == WAIT_TIMEOUT) {
-#ifdef DEBUG
- printf("PortMidi warning: get_free_output_buffer() wait timed out after 1000ms\n");
+ if (WaitForSingleObject(info->buffer_signal, 1000) == WAIT_TIMEOUT) {
+#ifdef MMDEBUG
+ printf("PortMidi warning: get_free_output_buffer() "
+ "wait timed out after 1000ms\n");
#endif
/* if we're trying to send a sysex message, maybe the
* message is too big and we need more message buffers.
* Expand the buffer pool by 128KB using 1024-byte buffers.
*/
/* first, expand the buffers array if necessary */
- if (!m->buffers_expanded) {
+ if (!info->buffers_expanded) {
LPMIDIHDR *new_buffers = (LPMIDIHDR *) pm_alloc(
- (m->num_buffers + NUM_EXPANSION_BUFFERS) *
- sizeof(LPMIDIHDR));
+ (info->num_buffers + NUM_EXPANSION_BUFFERS) *
+ sizeof(LPMIDIHDR));
/* if no memory, we could return a no-memory error, but user
* probably will be unprepared to deal with it. Maybe the
* MIDI driver is temporarily hung so we should just wait.
@@ -463,21 +346,21 @@ static LPMIDIHDR get_free_output_buffer(PmInternal *midi)
*/
if (!new_buffers) continue;
/* copy buffers to new_buffers and replace buffers */
- memcpy(new_buffers, m->buffers,
- m->num_buffers * sizeof(LPMIDIHDR));
- pm_free(m->buffers);
- m->buffers = new_buffers;
- m->max_buffers = m->num_buffers + NUM_EXPANSION_BUFFERS;
- m->buffers_expanded = TRUE;
+ memcpy(new_buffers, info->buffers,
+ info->num_buffers * sizeof(LPMIDIHDR));
+ pm_free(info->buffers);
+ info->buffers = new_buffers;
+ info->max_buffers = info->num_buffers + NUM_EXPANSION_BUFFERS;
+ info->buffers_expanded = TRUE;
}
/* next, add one buffer and return it */
- if (m->num_buffers < m->max_buffers) {
+ if (info->num_buffers < info->max_buffers) {
r = allocate_buffer(EXPANSION_BUFFER_LEN);
/* again, if there's no memory, we may not really be
* dead -- maybe the system is temporarily hung and
* we can just wait longer for a message buffer */
if (!r) continue;
- m->buffers[m->num_buffers++] = r;
+ info->buffers[info->num_buffers++] = r;
goto found_buffer; /* break out of 2 loops */
}
/* else, we've allocated all NUM_EXPANSION_BUFFERS buffers,
@@ -493,63 +376,20 @@ found_buffer:
return r;
}
-#ifdef EXPANDING_SYSEX_BUFFERS
-note: this is not working code, but might be useful if you want
- to grow sysex buffers.
-static PmError resize_sysex_buffer(PmInternal *midi, long old_size, long new_size)
-{
- LPMIDIHDR big;
- int i;
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- /* buffer must be smaller than 64k, but be also a multiple of 4 */
- if (new_size > 65520) {
- if (old_size >= 65520)
- return pmBufferMaxSize;
- else
- new_size = 65520;
- }
- /* allocate a bigger message */
- big = allocate_sysex_buffer(new_size);
- /* printf("expand to %d bytes\n", new_size);*/
- if (!big) return pmInsufficientMemory;
- m->error = midiOutPrepareHeader(m->handle.out, big, sizeof(MIDIHDR));
- if (m->error) {
- pm_free(big);
- return pmHostError;
- }
- /* make sure we're not going to overwrite any memory */
- assert(old_size <= new_size);
- memcpy(big->lpData, m->hdr->lpData, old_size);
- /* keep track of how many sysex bytes are in message so far */
- big->dwBytesRecorded = m->hdr->dwBytesRecorded;
- big->dwBufferLength = new_size;
- /* find which buffer this was, and replace it */
- for (i = 0; i < NUM_SYSEX_BUFFERS; i++) {
- if (m->sysex_buffers[i] == m->hdr) {
- m->sysex_buffers[i] = big;
- m->sysex_buffer_size[i] = new_size;
- pm_free(m->hdr);
- m->hdr = big;
- break;
- }
- }
- assert(i != NUM_SYSEX_BUFFERS);
-
- return pmNoError;
-}
-#endif
-
/*
-=========================================================================================
+============================================================================
begin midi input implementation
-=========================================================================================
+============================================================================
*/
-static PmError allocate_input_buffer(HMIDIIN h, long buffer_len)
+static unsigned int allocate_input_buffer(HMIDIIN h, long buffer_len)
{
LPMIDIHDR hdr = allocate_buffer(buffer_len);
if (!hdr) return pmInsufficientMemory;
+ /* note: pm_hosterror is normally a boolean, but here, we store Win
+ * error code. The caller must test the value for nonzero, set
+ * pm_hosterror_text, and then set pm_hosterror to TRUE */
pm_hosterror = midiInPrepareHeader(h, hdr, sizeof(MIDIHDR));
if (pm_hosterror) {
pm_free(hdr);
@@ -560,49 +400,51 @@ static PmError allocate_input_buffer(HMIDIIN h, long buffer_len)
}
+static winmm_info_type winmm_info_create(void)
+{
+ winmm_info_type info = (winmm_info_type) pm_alloc(sizeof(winmm_info_node));
+ info->handle.in = NULL;
+ info->handle.out = NULL;
+ info->buffers = NULL; /* not used for input */
+ info->num_buffers = 0; /* not used for input */
+ info->max_buffers = 0; /* not used for input */
+ info->buffers_expanded = FALSE; /* not used for input */
+ info->next_buffer = 0; /* not used for input */
+ info->buffer_signal = 0; /* not used for input */
+ info->last_time = 0;
+ info->first_message = TRUE; /* not used for input */
+ info->sysex_mode = FALSE;
+ info->sysex_word = 0;
+ info->sysex_byte_count = 0;
+ info->hdr = NULL; /* not used for input */
+ info->sync_time = 0;
+ info->delta = 0;
+ return info;
+}
+
+
static PmError winmm_in_open(PmInternal *midi, void *driverInfo)
{
DWORD dwDevice;
int i = midi->device_id;
int max_sysex_len = midi->buffer_len * 4;
int num_input_buffers = max_sysex_len / INPUT_SYSEX_LEN;
- midiwinmm_type m;
+ winmm_info_type info;
- dwDevice = (DWORD)(FPTR)descriptors[i].descriptor;
+ dwDevice = (DWORD) (intptr_t) pm_descriptors[i].descriptor;
/* create system dependent device data */
- m = (midiwinmm_type) pm_alloc(sizeof(midiwinmm_node)); /* create */
- midi->descriptor = m;
- if (!m) goto no_memory;
- m->handle.in = NULL;
- m->buffers = NULL; /* not used for input */
- m->num_buffers = 0; /* not used for input */
- m->max_buffers = FALSE; /* not used for input */
- m->buffers_expanded = 0; /* not used for input */
- m->next_buffer = 0; /* not used for input */
- m->buffer_signal = 0; /* not used for input */
-#ifdef USE_SYSEX_BUFFERS
- for (i = 0; i < NUM_SYSEX_BUFFERS; i++)
- m->sysex_buffers[i] = NULL; /* not used for input */
- m->next_sysex_buffer = 0; /* not used for input */
-#endif
- m->last_time = 0;
- m->first_message = TRUE; /* not used for input */
- m->sysex_mode = FALSE;
- m->sysex_word = 0;
- m->sysex_byte_count = 0;
- m->hdr = NULL; /* not used for input */
- m->sync_time = 0;
- m->delta = 0;
- m->error = MMSYSERR_NOERROR;
- /* 4000 is based on Windows documentation -- that's the value used in the
- memory manager. It's small enough that it should not hurt performance even
- if it's not optimal.
+ info = winmm_info_create();
+ midi->api_info = info;
+ if (!info) goto no_memory;
+ /* 4000 is based on Windows documentation -- that's the value used
+ in the memory manager. It's small enough that it should not
+ hurt performance even if it's not optimal.
*/
- InitializeCriticalSectionAndSpinCount(&m->lock, 4000);
+ InitializeCriticalSectionAndSpinCount(&info->lock, 4000);
/* open device */
pm_hosterror = midiInOpen(
- &(m->handle.in), /* input device handle */
+ &(info->handle.in), /* input device handle */
dwDevice, /* device ID */
(DWORD_PTR) winmm_in_callback, /* callback address */
(DWORD_PTR) midi, /* callback instance data */
@@ -612,31 +454,34 @@ static PmError winmm_in_open(PmInternal *midi, void *driverInfo)
if (num_input_buffers < MIN_INPUT_BUFFERS)
num_input_buffers = MIN_INPUT_BUFFERS;
for (i = 0; i < num_input_buffers; i++) {
- if (allocate_input_buffer(m->handle.in, INPUT_SYSEX_LEN)) {
+ if (allocate_input_buffer(info->handle.in, INPUT_SYSEX_LEN)) {
/* either pm_hosterror was set, or the proper return code
is pmInsufficientMemory */
goto close_device;
}
}
/* start device */
- pm_hosterror = midiInStart(m->handle.in);
- if (pm_hosterror) goto reset_device;
- return pmNoError;
+ pm_hosterror = midiInStart(info->handle.in);
+ if (!pm_hosterror) {
+ return pmNoError;
+ }
/* undo steps leading up to the detected error */
-reset_device:
+
/* ignore return code (we already have an error to report) */
- midiInReset(m->handle.in);
+ midiInReset(info->handle.in);
close_device:
- midiInClose(m->handle.in); /* ignore return code */
+ midiInClose(info->handle.in); /* ignore return code */
free_descriptor:
- midi->descriptor = NULL;
- pm_free(m);
+ midi->api_info = NULL;
+ pm_free(info);
no_memory:
if (pm_hosterror) {
- midiInGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
+ int err = midiInGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
- //assert(err == MMSYSERR_NOERROR);
+ assert(err == MMSYSERR_NOERROR);
+ improve_winerr(pm_hosterror, (char *) pm_hosterror_text);
+ pm_hosterror = TRUE;
return pmHostError;
}
/* if !pm_hosterror, then the error must be pmInsufficientMemory */
@@ -646,12 +491,6 @@ no_memory:
to free the parameter midi */
}
-static PmError winmm_in_poll(PmInternal *midi) {
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- return m->error;
-}
-
-
/* winmm_in_close -- close an open midi input device */
/*
@@ -659,24 +498,24 @@ static PmError winmm_in_poll(PmInternal *midi) {
*/
static PmError winmm_in_close(PmInternal *midi)
{
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- if (!m) return pmBadPtr;
+ winmm_info_type info = (winmm_info_type) midi->api_info;
+ if (!info) return pmBadPtr;
/* device to close */
- if ((pm_hosterror = midiInStop(m->handle.in))) {
- midiInReset(m->handle.in); /* try to reset and close port */
- midiInClose(m->handle.in);
- } else if ((pm_hosterror = midiInReset(m->handle.in))) {
- midiInClose(m->handle.in); /* best effort to close midi port */
+ if ((pm_hosterror = midiInStop(info->handle.in))) {
+ midiInReset(info->handle.in); /* try to reset and close port */
+ midiInClose(info->handle.in);
+ } else if ((pm_hosterror = midiInReset(info->handle.in))) {
+ midiInClose(info->handle.in); /* best effort to close midi port */
} else {
- pm_hosterror = midiInClose(m->handle.in);
+ pm_hosterror = midiInClose(info->handle.in);
}
- midi->descriptor = NULL;
- DeleteCriticalSection(&m->lock);
- pm_free(m); /* delete */
+ midi->api_info = NULL;
+ DeleteCriticalSection(&info->lock);
+ pm_free(info); /* delete */
if (pm_hosterror) {
- midiInGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
+ int err = midiInGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
- //assert(err == MMSYSERR_NOERROR);
+ assert(err == MMSYSERR_NOERROR);
return pmHostError;
}
return pmNoError;
@@ -685,19 +524,19 @@ static PmError winmm_in_close(PmInternal *midi)
/* Callback function executed via midiInput SW interrupt (via midiInOpen). */
static void FAR PASCAL winmm_in_callback(
- HMIDIIN hMidiIn, /* midiInput device Handle */
- UINT wMsg, /* midi msg */
- DWORD_PTR dwInstance, /* application data */
- DWORD_PTR dwParam1, /* MIDI data */
+ HMIDIIN hMidiIn, /* midiInput device Handle */
+ UINT wMsg, /* midi msg */
+ DWORD_PTR dwInstance, /* application data */
+ DWORD_PTR dwParam1, /* MIDI data */
DWORD_PTR dwParam2) /* device timestamp (wrt most recent midiInStart) */
{
- //static int entry = 0;
- PmInternal *midi = (PmInternal *)(FPTR) dwInstance;
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+ static int entry = 0;
+ PmInternal *midi = (PmInternal *) dwInstance;
+ winmm_info_type info = (winmm_info_type) midi->api_info;
/* NOTE: we do not just EnterCriticalSection() here because an
* MIM_CLOSE message arrives when the port is closed, but then
- * the m->lock has been destroyed.
+ * the info->lock has been destroyed.
*/
switch (wMsg) {
@@ -708,8 +547,7 @@ static void FAR PASCAL winmm_in_callback(
* hardware interrupt? -- but I've seen reentrant behavior
* using a debugger, so it happens.
*/
- //long new_driver_time;
- EnterCriticalSection(&m->lock);
+ EnterCriticalSection(&info->lock);
/* dwParam1 is MIDI data received, packed into DWORD w/ 1st byte of
message LOB;
@@ -717,8 +555,6 @@ static void FAR PASCAL winmm_in_callback(
in [ms] from when midiInStart called.
each message is expanded to include the status byte */
- //new_driver_time = dwParam2;
-
if ((dwParam1 & 0x80) == 0) {
/* not a status byte -- ignore it. This happened running the
sysex.c test under Win2K with MidiMan USB 1x1 interface,
@@ -733,16 +569,16 @@ static void FAR PASCAL winmm_in_callback(
event.message = (PmMessage)dwParam1;
pm_read_short(midi, &event);
}
- LeaveCriticalSection(&m->lock);
+ LeaveCriticalSection(&info->lock);
break;
}
case MIM_LONGDATA: {
- MIDIHDR *lpMidiHdr = (MIDIHDR *)(FPTR)dwParam1;
+ MIDIHDR *lpMidiHdr = (MIDIHDR *) dwParam1;
unsigned char *data = (unsigned char *) lpMidiHdr->lpData;
unsigned int processed = 0;
int remaining = lpMidiHdr->dwBytesRecorded;
- EnterCriticalSection(&m->lock);
+ EnterCriticalSection(&info->lock);
/* printf("midi_in_callback -- lpMidiHdr %x, %d bytes, %2x...\n",
lpMidiHdr, lpMidiHdr->dwBytesRecorded, *data); */
if (midi->time_proc)
@@ -761,24 +597,24 @@ static void FAR PASCAL winmm_in_callback(
case, we do not want to send them back to the interface (if
we do, the interface will not close, and Windows OS may hang). */
if (lpMidiHdr->dwBytesRecorded > 0) {
- //MMRESULT rslt;
+ MMRESULT rslt;
lpMidiHdr->dwBytesRecorded = 0;
lpMidiHdr->dwFlags = 0;
/* note: no error checking -- can this actually fail? */
- midiInPrepareHeader(hMidiIn, lpMidiHdr, sizeof(MIDIHDR));
- //assert(rslt == MMSYSERR_NOERROR);
+ rslt = midiInPrepareHeader(hMidiIn, lpMidiHdr, sizeof(MIDIHDR));
+ assert(rslt == MMSYSERR_NOERROR);
/* note: I don't think this can fail except possibly for
* MMSYSERR_NOMEM, but the pain of reporting this
* unlikely but probably catastrophic error does not seem
* worth it.
*/
- midiInAddBuffer(hMidiIn, lpMidiHdr, sizeof(MIDIHDR));
- //assert(rslt == MMSYSERR_NOERROR);
- LeaveCriticalSection(&m->lock);
+ rslt = midiInAddBuffer(hMidiIn, lpMidiHdr, sizeof(MIDIHDR));
+ assert(rslt == MMSYSERR_NOERROR);
+ LeaveCriticalSection(&info->lock);
} else {
midiInUnprepareHeader(hMidiIn,lpMidiHdr,sizeof(MIDIHDR));
- LeaveCriticalSection(&m->lock);
+ LeaveCriticalSection(&info->lock);
pm_free(lpMidiHdr);
}
break;
@@ -799,15 +635,15 @@ static void FAR PASCAL winmm_in_callback(
}
/*
-=========================================================================================
+===========================================================================
begin midi output implementation
-=========================================================================================
+===========================================================================
*/
/* begin helper routines used by midiOutStream interface */
/* add_to_buffer -- adds timestamped short msg to buffer, returns fullp */
-static int add_to_buffer(midiwinmm_type m, LPMIDIHDR hdr,
+static int add_to_buffer(winmm_info_type m, LPMIDIHDR hdr,
unsigned long delta, unsigned long msg)
{
unsigned long *ptr = (unsigned long *)
@@ -823,14 +659,14 @@ static int add_to_buffer(midiwinmm_type m, LPMIDIHDR hdr,
}
-static PmTimestamp pm_time_get(midiwinmm_type m)
+static PmTimestamp pm_time_get(winmm_info_type info)
{
MMTIME mmtime;
- //MMRESULT wRtn;
+ MMRESULT wRtn;
mmtime.wType = TIME_TICKS;
mmtime.u.ticks = 0;
- midiStreamPosition(m->handle.stream, &mmtime, sizeof(mmtime));
- //assert(wRtn == MMSYSERR_NOERROR);
+ wRtn = midiStreamPosition(info->handle.stream, &mmtime, sizeof(mmtime));
+ assert(wRtn == MMSYSERR_NOERROR);
return mmtime.u.ticks;
}
@@ -842,49 +678,27 @@ static PmError winmm_out_open(PmInternal *midi, void *driverInfo)
{
DWORD dwDevice;
int i = midi->device_id;
- midiwinmm_type m;
+ winmm_info_type info;
MIDIPROPTEMPO propdata;
MIDIPROPTIMEDIV divdata;
int max_sysex_len = midi->buffer_len * 4;
int output_buffer_len;
int num_buffers;
- dwDevice = (DWORD)(FPTR) descriptors[i].descriptor;
- /* create system dependent device data */
- m = (midiwinmm_type) pm_alloc(sizeof(midiwinmm_node)); /* create */
- midi->descriptor = m;
- if (!m) goto no_memory;
- m->handle.out = NULL;
- m->buffers = NULL;
- m->num_buffers = 0;
- m->max_buffers = 0;
- m->buffers_expanded = FALSE;
- m->next_buffer = 0;
-#ifdef USE_SYSEX_BUFFERS
- m->sysex_buffers[0] = NULL;
- m->sysex_buffers[1] = NULL;
- m->next_sysex_buffer = 0;
-#endif
- m->last_time = 0;
- m->first_message = TRUE; /* we treat first message as special case */
- m->sysex_mode = FALSE;
- m->sysex_word = 0;
- m->sysex_byte_count = 0;
- m->hdr = NULL;
- m->sync_time = 0;
- m->delta = 0;
- m->error = MMSYSERR_NOERROR;
+ dwDevice = (DWORD) (intptr_t) pm_descriptors[i].descriptor;
+ /* create system dependent device data */
+ info = winmm_info_create();
+ midi->api_info = info;
+ if (!info) goto no_memory;
/* create a signal */
- m->buffer_signal = CreateEvent(NULL, FALSE, FALSE, NULL);
-
+ info->buffer_signal = CreateEvent(NULL, FALSE, FALSE, NULL);
/* this should only fail when there are very serious problems */
- assert(m->buffer_signal);
-
+ assert(info->buffer_signal);
/* open device */
if (midi->latency == 0) {
/* use simple midi out calls */
pm_hosterror = midiOutOpen(
- (LPHMIDIOUT) & m->handle.out, /* device Handle */
+ (LPHMIDIOUT) & info->handle.out, /* device Handle */
dwDevice, /* device ID */
/* note: same callback fn as for StreamOpen: */
(DWORD_PTR) winmm_streamout_callback, /* callback fn */
@@ -893,7 +707,7 @@ static PmError winmm_out_open(PmInternal *midi, void *driverInfo)
} else {
/* use stream-based midi output (schedulable in future) */
pm_hosterror = midiStreamOpen(
- &m->handle.stream, /* device Handle */
+ &info->handle.stream, /* device Handle */
(LPUINT) & dwDevice, /* device ID pointer */
1, /* reserved, must be 1 */
(DWORD_PTR) winmm_streamout_callback,
@@ -910,41 +724,32 @@ static PmError winmm_out_open(PmInternal *midi, void *driverInfo)
if (output_buffer_len < MIN_SIMPLE_SYSEX_LEN)
output_buffer_len = MIN_SIMPLE_SYSEX_LEN;
} else {
- //long dur = 0;
- //num_buffers = (int)(double)max((double)midi->buffer_len, (double)midi->latency / 2);
- if (midi->buffer_len > (midi->latency / 2))
- {
- num_buffers = midi->buffer_len;
- }
- else
- {
- num_buffers = (midi->latency / 2);
- }
-
+ long dur = 0;
+ num_buffers = max(midi->buffer_len, midi->latency / 2);
if (num_buffers < MIN_STREAM_BUFFERS)
num_buffers = MIN_STREAM_BUFFERS;
output_buffer_len = STREAM_BUFFER_LEN;
propdata.cbStruct = sizeof(MIDIPROPTEMPO);
propdata.dwTempo = 480000; /* microseconds per quarter */
- pm_hosterror = midiStreamProperty(m->handle.stream,
+ pm_hosterror = midiStreamProperty(info->handle.stream,
(LPBYTE) & propdata,
MIDIPROP_SET | MIDIPROP_TEMPO);
if (pm_hosterror) goto close_device;
divdata.cbStruct = sizeof(MIDIPROPTEMPO);
divdata.dwTimeDiv = 480; /* divisions per quarter */
- pm_hosterror = midiStreamProperty(m->handle.stream,
+ pm_hosterror = midiStreamProperty(info->handle.stream,
(LPBYTE) & divdata,
MIDIPROP_SET | MIDIPROP_TIMEDIV);
if (pm_hosterror) goto close_device;
}
/* allocate buffers */
- if (allocate_buffers(m, output_buffer_len, num_buffers))
+ if (allocate_buffers(info, output_buffer_len, num_buffers))
goto free_buffers;
/* start device */
if (midi->latency != 0) {
- pm_hosterror = midiStreamRestart(m->handle.stream);
+ pm_hosterror = midiStreamRestart(info->handle.stream);
if (pm_hosterror != MMSYSERR_NOERROR) goto free_buffers;
}
return pmNoError;
@@ -952,15 +757,16 @@ static PmError winmm_out_open(PmInternal *midi, void *driverInfo)
free_buffers:
/* buffers are freed below by winmm_out_delete */
close_device:
- midiOutClose(m->handle.out);
+ midiOutClose(info->handle.out);
free_descriptor:
- midi->descriptor = NULL;
+ midi->api_info = NULL;
winmm_out_delete(midi); /* frees buffers and m */
no_memory:
if (pm_hosterror) {
- midiOutGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
+ int err = midiOutGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
- //assert(err == MMSYSERR_NOERROR);
+ assert(err == MMSYSERR_NOERROR);
+ improve_winerr(pm_hosterror, (char *) pm_hosterror_text);
return pmHostError;
}
return pmInsufficientMemory;
@@ -973,50 +779,43 @@ static void winmm_out_delete(PmInternal *midi)
{
int i;
/* delete system dependent device data */
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- if (m) {
- if (m->buffer_signal) {
+ winmm_info_type info = (winmm_info_type) midi->api_info;
+ if (info) {
+ if (info->buffer_signal) {
/* don't report errors -- better not to stop cleanup */
- CloseHandle(m->buffer_signal);
+ CloseHandle(info->buffer_signal);
}
/* if using stream output, free buffers */
- for (i = 0; i < m->num_buffers; i++) {
- if (m->buffers[i]) pm_free(m->buffers[i]);
+ for (i = 0; i < info->num_buffers; i++) {
+ if (info->buffers[i]) pm_free(info->buffers[i]);
}
- m->num_buffers = 0;
- pm_free(m->buffers);
- m->max_buffers = 0;
-#ifdef USE_SYSEX_BUFFERS
- /* free sysex buffers */
- for (i = 0; i < NUM_SYSEX_BUFFERS; i++) {
- if (m->sysex_buffers[i]) pm_free(m->sysex_buffers[i]);
- }
-#endif
+ info->num_buffers = 0;
+ pm_free(info->buffers);
+ info->max_buffers = 0;
}
- midi->descriptor = NULL;
- pm_free(m); /* delete */
+ midi->api_info = NULL;
+ pm_free(info); /* delete */
}
/* see comments for winmm_in_close */
static PmError winmm_out_close(PmInternal *midi)
{
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- if (m->handle.out) {
+ winmm_info_type info = (winmm_info_type) midi->api_info;
+ if (info->handle.out) {
/* device to close */
if (midi->latency == 0) {
- pm_hosterror = midiOutClose(m->handle.out);
+ pm_hosterror = midiOutClose(info->handle.out);
} else {
- pm_hosterror = midiStreamClose(m->handle.stream);
+ pm_hosterror = midiStreamClose(info->handle.stream);
}
/* regardless of outcome, free memory */
winmm_out_delete(midi);
}
if (pm_hosterror) {
- midiOutGetErrorText(pm_hosterror,
- (char *) pm_hosterror_text,
+ int err = midiOutGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
- //assert(err == MMSYSERR_NOERROR);
+ assert(err == MMSYSERR_NOERROR);
return pmHostError;
}
return pmNoError;
@@ -1025,42 +824,53 @@ static PmError winmm_out_close(PmInternal *midi)
static PmError winmm_out_abort(PmInternal *midi)
{
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- m->error = MMSYSERR_NOERROR;
+ winmm_info_type info = (winmm_info_type) midi->api_info;
/* only stop output streams */
if (midi->latency > 0) {
- m->error = midiStreamStop(m->handle.stream);
+ pm_hosterror = midiStreamStop(info->handle.stream);
+ if (pm_hosterror) {
+ int err;
+ err = midiOutGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
+ PM_HOST_ERROR_MSG_LEN);
+ assert(err == MMSYSERR_NOERROR);
+ return pmHostError;
+ }
}
- return m->error ? pmHostError : pmNoError;
+ return pmNoError;
}
static PmError winmm_write_flush(PmInternal *midi, PmTimestamp timestamp)
{
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- assert(m);
- if (m->hdr) {
- m->error = midiOutPrepareHeader(m->handle.out, m->hdr,
- sizeof(MIDIHDR));
- if (m->error) {
+ winmm_info_type info = (winmm_info_type) midi->api_info;
+ assert(info);
+ if (info->hdr) {
+ pm_hosterror = midiOutPrepareHeader(info->handle.out, info->hdr,
+ sizeof(MIDIHDR));
+ if (pm_hosterror) {
/* do not send message */
} else if (midi->latency == 0) {
/* As pointed out by Nigel Brown, 20Sep06, dwBytesRecorded
* should be zero. This is set in get_free_sysex_buffer().
* The msg length goes in dwBufferLength in spite of what
* Microsoft documentation says (or doesn't say). */
- m->hdr->dwBufferLength = m->hdr->dwBytesRecorded;
- m->hdr->dwBytesRecorded = 0;
- m->error = midiOutLongMsg(m->handle.out, m->hdr, sizeof(MIDIHDR));
+ info->hdr->dwBufferLength = info->hdr->dwBytesRecorded;
+ info->hdr->dwBytesRecorded = 0;
+ pm_hosterror = midiOutLongMsg(info->handle.out, info->hdr,
+ sizeof(MIDIHDR));
} else {
- m->error = midiStreamOut(m->handle.stream, m->hdr,
- sizeof(MIDIHDR));
+ pm_hosterror = midiStreamOut(info->handle.stream, info->hdr,
+ sizeof(MIDIHDR));
}
midi->fill_base = NULL;
- m->hdr = NULL;
- if (m->error) {
- m->hdr->dwFlags = 0; /* release the buffer */
+ info->hdr = NULL;
+ if (pm_hosterror) {
+ int err;
+ info->hdr->dwFlags = 0; /* release the buffer */
+ err = midiOutGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
+ PM_HOST_ERROR_MSG_LEN);
+ assert(err == MMSYSERR_NOERROR);
return pmHostError;
}
}
@@ -1068,98 +878,40 @@ static PmError winmm_write_flush(PmInternal *midi, PmTimestamp timestamp)
}
-
-#ifdef GARBAGE
-static PmError winmm_write_sysex_byte(PmInternal *midi, unsigned char byte)
-{
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- unsigned char *msg_buffer;
-
- /* at the beginning of sysex, m->hdr is NULL */
- if (!m->hdr) { /* allocate a buffer if none allocated yet */
- m->hdr = get_free_output_buffer(midi);
- if (!m->hdr) return pmInsufficientMemory;
- m->sysex_byte_count = 0;
- }
- /* figure out where to write byte */
- msg_buffer = (unsigned char *) (m->hdr->lpData);
- assert(m->hdr->lpData == (char *) (m->hdr + 1));
-
- /* check for overflow */
- if (m->sysex_byte_count >= m->hdr->dwBufferLength) {
- /* allocate a bigger message -- double it every time */
- LPMIDIHDR big = allocate_buffer(m->sysex_byte_count * 2);
- /* printf("expand to %d bytes\n", m->sysex_byte_count * 2); */
- if (!big) return pmInsufficientMemory;
- m->error = midiOutPrepareHeader(m->handle.out, big,
- sizeof(MIDIHDR));
- if (m->error) {
- m->hdr = NULL;
- return pmHostError;
- }
- memcpy(big->lpData, msg_buffer, m->sysex_byte_count);
- msg_buffer = (unsigned char *) (big->lpData);
- if (m->buffers[0] == m->hdr) {
- m->buffers[0] = big;
- pm_free(m->hdr);
- /* printf("freed m->hdr\n"); */
- } else if (m->buffers[1] == m->hdr) {
- m->buffers[1] = big;
- pm_free(m->hdr);
- /* printf("freed m->hdr\n"); */
- }
- m->hdr = big;
- }
-
- /* append byte to message */
- msg_buffer[m->sysex_byte_count++] = byte;
-
- /* see if we have a complete message */
- if (byte == MIDI_EOX) {
- m->hdr->dwBytesRecorded = m->sysex_byte_count;
- /*
- { int i; int len = m->hdr->dwBytesRecorded;
- printf("OutLongMsg %d ", len);
- for (i = 0; i < len; i++) {
- printf("%2x ", msg_buffer[i]);
- }
- }
- */
- m->error = midiOutLongMsg(m->handle.out, m->hdr, sizeof(MIDIHDR));
- m->hdr = NULL; /* stop using this message buffer */
- if (m->error) return pmHostError;
- }
- return pmNoError;
-}
-#endif
-
-
static PmError winmm_write_short(PmInternal *midi, PmEvent *event)
{
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+ winmm_info_type info = (winmm_info_type) midi->api_info;
PmError rslt = pmNoError;
- assert(m);
+ assert(info);
if (midi->latency == 0) { /* use midiOut interface, ignore timestamps */
- m->error = midiOutShortMsg(m->handle.out, event->message);
- if (m->error) rslt = pmHostError;
+ pm_hosterror = midiOutShortMsg(info->handle.out, event->message);
+ if (pm_hosterror) {
+ int err;
+ info->hdr->dwFlags = 0; /* release the buffer */
+ err = midiOutGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
+ PM_HOST_ERROR_MSG_LEN);
+ assert(err == MMSYSERR_NOERROR);
+ return pmHostError;
+ }
} else { /* use midiStream interface -- pass data through buffers */
unsigned long when = event->timestamp;
unsigned long delta;
int full;
if (when == 0) when = midi->now;
/* when is in real_time; translate to intended stream time */
- when = when + m->delta + midi->latency;
+ when = when + info->delta + midi->latency;
/* make sure we don't go backward in time */
- if (when < m->last_time) when = m->last_time;
- delta = when - m->last_time;
- m->last_time = when;
+ if (when < info->last_time) when = info->last_time;
+ delta = when - info->last_time;
+ info->last_time = when;
/* before we insert any data, we must have a buffer */
- if (m->hdr == NULL) {
+ if (info->hdr == NULL) {
/* stream interface: buffers allocated when stream is opened */
- m->hdr = get_free_output_buffer(midi);
+ info->hdr = get_free_output_buffer(midi);
}
- full = add_to_buffer(m, m->hdr, delta, event->message);
+ full = add_to_buffer(info, info->hdr, delta, event->message);
+ /* note: winmm_write_flush sets pm_hosterror etc. on host error */
if (full) rslt = winmm_write_flush(midi, when);
}
return rslt;
@@ -1169,7 +921,7 @@ static PmError winmm_write_short(PmInternal *midi, PmEvent *event)
#ifndef winmm_begin_sysex
static PmError winmm_begin_sysex(PmInternal *midi, PmTimestamp timestamp)
{
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+ winmm_info_type m = (winmm_info_type) midi->api_info;
PmError rslt = pmNoError;
if (midi->latency == 0) {
@@ -1188,9 +940,9 @@ static PmError winmm_end_sysex(PmInternal *midi, PmTimestamp timestamp)
* what happens if we exit early and don't finish the sysex msg
* and clean up
*/
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+ winmm_info_type info = (winmm_info_type) midi->api_info;
PmError rslt = pmNoError;
- LPMIDIHDR hdr = m->hdr;
+ LPMIDIHDR hdr = info->hdr;
if (!hdr) return rslt; /* something bad happened earlier,
do not report an error because it would have been
reported (at least) once already */
@@ -1200,15 +952,15 @@ static PmError winmm_end_sysex(PmInternal *midi, PmTimestamp timestamp)
if (midi->latency == 0) {
#ifdef DEBUG_PRINT_BEFORE_SENDING_SYSEX
/* DEBUG CODE: */
- { int i; int len = m->hdr->dwBufferLength;
+ { int i; int len = info->hdr->dwBufferLength;
printf("OutLongMsg %d ", len);
for (i = 0; i < len; i++) {
- printf("%2x ", (unsigned char) (m->hdr->lpData[i]));
+ printf("%2x ", (unsigned char) (info->hdr->lpData[i]));
}
}
#endif
} else {
- /* Using stream interface. There are accumulated bytes in m->hdr
+ /* Using stream interface. There are accumulated bytes in info->hdr
to send using midiStreamOut
*/
/* add bytes recorded to MIDIEVENT length, but don't
@@ -1228,16 +980,15 @@ static PmError winmm_write_byte(PmInternal *midi, unsigned char byte,
{
/* write a sysex byte */
PmError rslt = pmNoError;
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- LPMIDIHDR hdr = m->hdr;
+ winmm_info_type info = (winmm_info_type) midi->api_info;
+ LPMIDIHDR hdr = info->hdr;
unsigned char *msg_buffer;
- assert(m);
+ assert(info);
if (!hdr) {
- m->hdr = hdr = get_free_output_buffer(midi);
+ info->hdr = hdr = get_free_output_buffer(midi);
assert(hdr);
- midi->fill_base = (unsigned char *)(FPTR) m->hdr->lpData;
- midi->fill_offset_ptr = (uint32_t *)&(hdr->dwBytesRecorded);
-
+ midi->fill_base = (unsigned char *) info->hdr->lpData;
+ midi->fill_offset_ptr = (uint32_t *) &(hdr->dwBytesRecorded);
/* when buffer fills, Pm_WriteSysEx will revert to calling
* pmwin_write_byte, which expect to have space, so leave
* one byte free for pmwin_write_byte. Leave another byte
@@ -1250,11 +1001,11 @@ static PmError winmm_write_byte(PmInternal *midi, unsigned char byte,
unsigned long *ptr;
if (when == 0) when = midi->now;
/* when is in real_time; translate to intended stream time */
- when = when + m->delta + midi->latency;
+ when = when + info->delta + midi->latency;
/* make sure we don't go backward in time */
- if (when < m->last_time) when = m->last_time;
- delta = when - m->last_time;
- m->last_time = when;
+ if (when < info->last_time) when = info->last_time;
+ delta = when - info->last_time;
+ info->last_time = when;
ptr = (unsigned long *) hdr->lpData;
*ptr++ = delta;
@@ -1276,31 +1027,10 @@ static PmError winmm_write_byte(PmInternal *midi, unsigned char byte,
return rslt;
}
-#ifdef EXPANDING_SYSEX_BUFFERS
-note: this code is here as an aid in case you want sysex buffers
- to expand to hold large messages completely. If so, you
- will want to change SYSEX_BYTES_PER_BUFFER above to some
- variable that remembers the buffer size. A good place to
- put this value would be in the hdr->dwUser field.
-
- rslt = resize_sysex_buffer(midi, m->sysex_byte_count,
- m->sysex_byte_count * 2);
-
- if (rslt == pmBufferMaxSize) /* if the buffer can't be resized */
-#endif
-#ifdef EXPANDING_SYSEX_BUFFERS
- int bytesRecorded = hdr->dwBytesRecorded; /* this field gets wiped out, so we'll save it */
- rslt = resize_sysex_buffer(midi, bytesRecorded, 2 * bytesRecorded);
- hdr->dwBytesRecorded = bytesRecorded;
-
- if (rslt == pmBufferMaxSize) /* if buffer can't be resized */
-#endif
-
-
static PmTimestamp winmm_synchronize(PmInternal *midi)
{
- midiwinmm_type m;
+ winmm_info_type info;
unsigned long pm_stream_time_2;
unsigned long real_time;
unsigned long pm_stream_time;
@@ -1309,60 +1039,30 @@ static PmTimestamp winmm_synchronize(PmInternal *midi)
if (midi->latency == 0) return 0;
/* figure out the time */
- m = (midiwinmm_type) midi->descriptor;
- pm_stream_time_2 = pm_time_get(m);
+ info = (winmm_info_type) midi->api_info;
+ pm_stream_time_2 = pm_time_get(info);
do {
/* read real_time between two reads of stream time */
pm_stream_time = pm_stream_time_2;
real_time = (*midi->time_proc)(midi->time_info);
- pm_stream_time_2 = pm_time_get(m);
+ pm_stream_time_2 = pm_time_get(info);
/* repeat if more than 1ms elapsed */
} while (pm_stream_time_2 > pm_stream_time + 1);
- m->delta = pm_stream_time - real_time;
- m->sync_time = real_time;
+ info->delta = pm_stream_time - real_time;
+ info->sync_time = real_time;
return real_time;
}
-#ifdef USE_SYSEX_BUFFERS
-/* winmm_out_callback -- recycle sysex buffers */
-static void CALLBACK winmm_out_callback(HMIDIOUT hmo, UINT wMsg,
- DWORD_PTR dwInstance, DWORD_PTR dwParam1,
- DWORD_PTR dwParam2)
-{
- PmInternal *midi = (PmInternal *) dwInstance;
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- LPMIDIHDR hdr = (LPMIDIHDR) dwParam1;
- int err = 0; /* set to 0 so that no buffer match will also be an error */
-
- /* Future optimization: eliminate UnprepareHeader calls -- they aren't
- necessary; however, this code uses the prepared-flag to indicate which
- buffers are free, so we need to do something to flag empty buffers if
- we leave them prepared
- */
- /*
- printf("out_callback: hdr %x, wMsg %x, MOM_DONE %x\n",
- hdr, wMsg, MOM_DONE);
- */
- if (wMsg == MOM_DONE) {
- MMRESULT ret = midiOutUnprepareHeader(m->handle.out, hdr,
- sizeof(MIDIHDR));
- assert(ret == MMSYSERR_NOERROR);
- }
- /* notify waiting sender that a buffer is available */
- err = SetEvent(m->buffer_signal);
- assert(err); /* false -> error */
-}
-#endif
/* winmm_streamout_callback -- unprepare (free) buffer header */
static void CALLBACK winmm_streamout_callback(HMIDIOUT hmo, UINT wMsg,
DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
- PmInternal *midi = (PmInternal *)(FPTR) dwInstance;
- LPMIDIHDR hdr = (LPMIDIHDR)(FPTR) dwParam1;
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- //int err;
+ PmInternal *midi = (PmInternal *) dwInstance;
+ winmm_info_type info = (winmm_info_type) midi->api_info;
+ LPMIDIHDR hdr = (LPMIDIHDR) dwParam1;
+ int err;
/* Even if an error is pending, I think we should unprepare msgs and
signal their arrival
@@ -1370,20 +1070,20 @@ static void CALLBACK winmm_streamout_callback(HMIDIOUT hmo, UINT wMsg,
/* printf("streamout_callback: hdr %x, wMsg %x, MOM_DONE %x\n",
hdr, wMsg, MOM_DONE); */
if (wMsg == MOM_DONE) {
- midiOutUnprepareHeader(m->handle.out, hdr,
+ MMRESULT ret = midiOutUnprepareHeader(info->handle.out, hdr,
sizeof(MIDIHDR));
- //assert(ret == MMSYSERR_NOERROR);
+ assert(ret == MMSYSERR_NOERROR);
}
/* signal client in case it is blocked waiting for buffer */
- SetEvent(m->buffer_signal);
- //assert(err); /* false -> error */
+ err = SetEvent(info->buffer_signal);
+ assert(err); /* false -> error */
}
/*
-=========================================================================================
+===========================================================================
begin exported functions
-=========================================================================================
+===========================================================================
*/
#define winmm_in_abort pm_fail_fn
@@ -1398,9 +1098,8 @@ pm_fns_node pm_winmm_in_dictionary = {
winmm_in_open,
winmm_in_abort,
winmm_in_close,
- winmm_in_poll,
- winmm_has_host_error,
- winmm_get_host_error
+ success_poll,
+ winmm_check_host_error
};
pm_fns_node pm_winmm_out_dictionary = {
@@ -1408,15 +1107,14 @@ pm_fns_node pm_winmm_out_dictionary = {
winmm_begin_sysex,
winmm_end_sysex,
winmm_write_byte,
- winmm_write_short, /* short realtime message */
+ /* short realtime message: */ winmm_write_short,
winmm_write_flush,
winmm_synchronize,
winmm_out_open,
winmm_out_abort,
winmm_out_close,
none_poll,
- winmm_has_host_error,
- winmm_get_host_error
+ winmm_check_host_error
};
@@ -1445,28 +1143,21 @@ void pm_winmm_init( void )
void pm_winmm_term( void )
{
int i;
-#ifdef DEBUG
- char msg[PM_HOST_ERROR_MSG_LEN];
+#ifdef MMDEBUG
int doneAny = 0;
printf("pm_winmm_term called\n");
#endif
- for (i = 0; i < pm_descriptor_index; i++) {
- PmInternal * midi = descriptors[i].internalDescriptor;
+ for (i = 0; i < pm_descriptor_len; i++) {
+ PmInternal *midi = pm_descriptors[i].pm_internal;
if (midi) {
- midiwinmm_type m = (midiwinmm_type) midi->descriptor;
- if (m->handle.out) {
+ winmm_info_type info = (winmm_info_type) midi->api_info;
+ if (info->handle.out) {
/* close next open device*/
-#ifdef DEBUG
+#ifdef MMDEBUG
if (doneAny == 0) {
printf("begin closing open devices...\n");
doneAny = 1;
}
- /* report any host errors; this EXTEREMELY useful when
- trying to debug client app */
- if (winmm_has_host_error(midi)) {
- winmm_get_host_error(midi, msg, PM_HOST_ERROR_MSG_LEN);
- printf("%s\n", msg);
- }
#endif
/* close all open ports */
(*midi->dictionary->close)(midi);
@@ -1481,11 +1172,11 @@ void pm_winmm_term( void )
pm_free(midi_out_caps);
midi_out_caps = NULL;
}
-#ifdef DEBUG
+#ifdef MMDEBUG
if (doneAny) {
printf("warning: devices were left open. They have been closed.\n");
}
printf("pm_winmm_term exiting\n");
#endif
- pm_descriptor_index = 0;
+ pm_descriptor_len = 0;
}
diff --git a/3rdparty/portmidi/pm_win/pmwinmm.h b/3rdparty/portmidi/pm_win/pmwinmm.h
index 94742001bcd..a429ca1afb9 100644
--- a/3rdparty/portmidi/pm_win/pmwinmm.h
+++ b/3rdparty/portmidi/pm_win/pmwinmm.h
@@ -1,4 +1,4 @@
-/* midiwin32.h -- system-specific definitions */
+/* pmwinmm.h -- system-specific definitions for windows multimedia API */
void pm_winmm_init( void );
void pm_winmm_term( void );
diff --git a/3rdparty/portmidi/pm_win/static.cmake b/3rdparty/portmidi/pm_win/static.cmake
index ebad662aeb4..88a115c9228 100644
--- a/3rdparty/portmidi/pm_win/static.cmake
+++ b/3rdparty/portmidi/pm_win/static.cmake
@@ -1,4 +1,12 @@
# static.cmake -- change flags to link with static runtime libraries
+#
+# Even when BUILD_SHARED_LIBS is OFF, CMake specifies linking wtih
+# multithread DLL, so you give inconsistent linking instructions
+# resulting in warning messages from MS Visual Studio. If you want
+# a static binary, I've found this approach works to eliminate
+# warnings and make everything static:
+#
+# Changes /MD (multithread DLL) to /MT (multithread static)
if(MSVC)
foreach(flag_var
diff --git a/3rdparty/portmidi/portmidi.sln b/3rdparty/portmidi/portmidi.sln
deleted file mode 100644
index e5521924d12..00000000000
--- a/3rdparty/portmidi/portmidi.sln
+++ /dev/null
@@ -1,147 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", ".\ALL_BUILD.vcproj", "{E1C2664B-91BB-4D4F-868C-433164F81101}"
- ProjectSection(ProjectDependencies) = postProject
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- {41D78CBF-B04B-4561-BA4A-AC238C40633D} = {41D78CBF-B04B-4561-BA4A-AC238C40633D}
- {9B448D22-EC7E-4BD8-A552-B268D843CC3C} = {9B448D22-EC7E-4BD8-A552-B268D843CC3C}
- {EED7440D-04E3-4948-92DB-C85B4ADB1D82} = {EED7440D-04E3-4948-92DB-C85B4ADB1D82}
- {80193DD1-2C02-4A4C-BDF8-49623AD6F556} = {80193DD1-2C02-4A4C-BDF8-49623AD6F556}
- {EAADABB5-83D6-4669-98F8-6CDBE6AFD2BF} = {EAADABB5-83D6-4669-98F8-6CDBE6AFD2BF}
- {87B548BD-F5CE-4D1F-9181-390966AC5855} = {87B548BD-F5CE-4D1F-9181-390966AC5855}
- {7283FAD1-7415-4061-A19A-FF5C7BCE9306} = {7283FAD1-7415-4061-A19A-FF5C7BCE9306}
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6} = {2985D5DA-D91E-44E0-924B-E612B6AA33F6}
- {2204E68C-5C1F-440E-8CE6-7E273D4F6AD1} = {2204E68C-5C1F-440E-8CE6-7E273D4F6AD1}
- {71B9BC6E-7B40-4FBC-BC7F-4372AF03D0FD} = {71B9BC6E-7B40-4FBC-BC7F-4372AF03D0FD}
- {0BEACB8B-4058-41A4-A9DE-1B1FB650B21A} = {0BEACB8B-4058-41A4-A9DE-1B1FB650B21A}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", ".\ZERO_CHECK.vcproj", "{28779535-7541-4FF5-AC12-FAFD66E894EC}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "latency", "pm_test\latency.vcproj", "{41D78CBF-B04B-4561-BA4A-AC238C40633D}"
- ProjectSection(ProjectDependencies) = postProject
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6} = {2985D5DA-D91E-44E0-924B-E612B6AA33F6}
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "midiclock", "pm_test\midiclock.vcproj", "{9B448D22-EC7E-4BD8-A552-B268D843CC3C}"
- ProjectSection(ProjectDependencies) = postProject
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6} = {2985D5DA-D91E-44E0-924B-E612B6AA33F6}
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "midithread", "pm_test\midithread.vcproj", "{EED7440D-04E3-4948-92DB-C85B4ADB1D82}"
- ProjectSection(ProjectDependencies) = postProject
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6} = {2985D5DA-D91E-44E0-924B-E612B6AA33F6}
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "midithru", "pm_test\midithru.vcproj", "{80193DD1-2C02-4A4C-BDF8-49623AD6F556}"
- ProjectSection(ProjectDependencies) = postProject
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6} = {2985D5DA-D91E-44E0-924B-E612B6AA33F6}
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mm", "pm_test\mm.vcproj", "{EAADABB5-83D6-4669-98F8-6CDBE6AFD2BF}"
- ProjectSection(ProjectDependencies) = postProject
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6} = {2985D5DA-D91E-44E0-924B-E612B6AA33F6}
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmjni", "pm_common\pmjni.vcproj", "{87B548BD-F5CE-4D1F-9181-390966AC5855}"
- ProjectSection(ProjectDependencies) = postProject
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portmidi-dynamic", "pm_dylib\portmidi-dynamic.vcproj", "{7283FAD1-7415-4061-A19A-FF5C7BCE9306}"
- ProjectSection(ProjectDependencies) = postProject
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portmidi-static", "pm_common\portmidi-static.vcproj", "{2985D5DA-D91E-44E0-924B-E612B6AA33F6}"
- ProjectSection(ProjectDependencies) = postProject
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qtest", "pm_test\qtest.vcproj", "{2204E68C-5C1F-440E-8CE6-7E273D4F6AD1}"
- ProjectSection(ProjectDependencies) = postProject
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6} = {2985D5DA-D91E-44E0-924B-E612B6AA33F6}
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sysex", "pm_test\sysex.vcproj", "{71B9BC6E-7B40-4FBC-BC7F-4372AF03D0FD}"
- ProjectSection(ProjectDependencies) = postProject
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6} = {2985D5DA-D91E-44E0-924B-E612B6AA33F6}
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "pm_test\test.vcproj", "{0BEACB8B-4058-41A4-A9DE-1B1FB650B21A}"
- ProjectSection(ProjectDependencies) = postProject
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6} = {2985D5DA-D91E-44E0-924B-E612B6AA33F6}
- {28779535-7541-4FF5-AC12-FAFD66E894EC} = {28779535-7541-4FF5-AC12-FAFD66E894EC}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E1C2664B-91BB-4D4F-868C-433164F81101}.Debug|Win32.ActiveCfg = Debug|Win32
- {E1C2664B-91BB-4D4F-868C-433164F81101}.Release|Win32.ActiveCfg = Release|Win32
- {28779535-7541-4FF5-AC12-FAFD66E894EC}.Debug|Win32.ActiveCfg = Debug|Win32
- {28779535-7541-4FF5-AC12-FAFD66E894EC}.Debug|Win32.Build.0 = Debug|Win32
- {28779535-7541-4FF5-AC12-FAFD66E894EC}.Release|Win32.ActiveCfg = Release|Win32
- {28779535-7541-4FF5-AC12-FAFD66E894EC}.Release|Win32.Build.0 = Release|Win32
- {41D78CBF-B04B-4561-BA4A-AC238C40633D}.Debug|Win32.ActiveCfg = Debug|Win32
- {41D78CBF-B04B-4561-BA4A-AC238C40633D}.Debug|Win32.Build.0 = Debug|Win32
- {41D78CBF-B04B-4561-BA4A-AC238C40633D}.Release|Win32.ActiveCfg = Release|Win32
- {41D78CBF-B04B-4561-BA4A-AC238C40633D}.Release|Win32.Build.0 = Release|Win32
- {9B448D22-EC7E-4BD8-A552-B268D843CC3C}.Debug|Win32.ActiveCfg = Debug|Win32
- {9B448D22-EC7E-4BD8-A552-B268D843CC3C}.Debug|Win32.Build.0 = Debug|Win32
- {9B448D22-EC7E-4BD8-A552-B268D843CC3C}.Release|Win32.ActiveCfg = Release|Win32
- {9B448D22-EC7E-4BD8-A552-B268D843CC3C}.Release|Win32.Build.0 = Release|Win32
- {EED7440D-04E3-4948-92DB-C85B4ADB1D82}.Debug|Win32.ActiveCfg = Debug|Win32
- {EED7440D-04E3-4948-92DB-C85B4ADB1D82}.Debug|Win32.Build.0 = Debug|Win32
- {EED7440D-04E3-4948-92DB-C85B4ADB1D82}.Release|Win32.ActiveCfg = Release|Win32
- {EED7440D-04E3-4948-92DB-C85B4ADB1D82}.Release|Win32.Build.0 = Release|Win32
- {80193DD1-2C02-4A4C-BDF8-49623AD6F556}.Debug|Win32.ActiveCfg = Debug|Win32
- {80193DD1-2C02-4A4C-BDF8-49623AD6F556}.Debug|Win32.Build.0 = Debug|Win32
- {80193DD1-2C02-4A4C-BDF8-49623AD6F556}.Release|Win32.ActiveCfg = Release|Win32
- {80193DD1-2C02-4A4C-BDF8-49623AD6F556}.Release|Win32.Build.0 = Release|Win32
- {EAADABB5-83D6-4669-98F8-6CDBE6AFD2BF}.Debug|Win32.ActiveCfg = Debug|Win32
- {EAADABB5-83D6-4669-98F8-6CDBE6AFD2BF}.Debug|Win32.Build.0 = Debug|Win32
- {EAADABB5-83D6-4669-98F8-6CDBE6AFD2BF}.Release|Win32.ActiveCfg = Release|Win32
- {EAADABB5-83D6-4669-98F8-6CDBE6AFD2BF}.Release|Win32.Build.0 = Release|Win32
- {87B548BD-F5CE-4D1F-9181-390966AC5855}.Debug|Win32.ActiveCfg = Debug|Win32
- {87B548BD-F5CE-4D1F-9181-390966AC5855}.Debug|Win32.Build.0 = Debug|Win32
- {87B548BD-F5CE-4D1F-9181-390966AC5855}.Release|Win32.ActiveCfg = Release|Win32
- {87B548BD-F5CE-4D1F-9181-390966AC5855}.Release|Win32.Build.0 = Release|Win32
- {7283FAD1-7415-4061-A19A-FF5C7BCE9306}.Debug|Win32.ActiveCfg = Debug|Win32
- {7283FAD1-7415-4061-A19A-FF5C7BCE9306}.Debug|Win32.Build.0 = Debug|Win32
- {7283FAD1-7415-4061-A19A-FF5C7BCE9306}.Release|Win32.ActiveCfg = Release|Win32
- {7283FAD1-7415-4061-A19A-FF5C7BCE9306}.Release|Win32.Build.0 = Release|Win32
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6}.Debug|Win32.ActiveCfg = Debug|Win32
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6}.Debug|Win32.Build.0 = Debug|Win32
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6}.Release|Win32.ActiveCfg = Release|Win32
- {2985D5DA-D91E-44E0-924B-E612B6AA33F6}.Release|Win32.Build.0 = Release|Win32
- {2204E68C-5C1F-440E-8CE6-7E273D4F6AD1}.Debug|Win32.ActiveCfg = Debug|Win32
- {2204E68C-5C1F-440E-8CE6-7E273D4F6AD1}.Debug|Win32.Build.0 = Debug|Win32
- {2204E68C-5C1F-440E-8CE6-7E273D4F6AD1}.Release|Win32.ActiveCfg = Release|Win32
- {2204E68C-5C1F-440E-8CE6-7E273D4F6AD1}.Release|Win32.Build.0 = Release|Win32
- {71B9BC6E-7B40-4FBC-BC7F-4372AF03D0FD}.Debug|Win32.ActiveCfg = Debug|Win32
- {71B9BC6E-7B40-4FBC-BC7F-4372AF03D0FD}.Debug|Win32.Build.0 = Debug|Win32
- {71B9BC6E-7B40-4FBC-BC7F-4372AF03D0FD}.Release|Win32.ActiveCfg = Release|Win32
- {71B9BC6E-7B40-4FBC-BC7F-4372AF03D0FD}.Release|Win32.Build.0 = Release|Win32
- {0BEACB8B-4058-41A4-A9DE-1B1FB650B21A}.Debug|Win32.ActiveCfg = Debug|Win32
- {0BEACB8B-4058-41A4-A9DE-1B1FB650B21A}.Debug|Win32.Build.0 = Debug|Win32
- {0BEACB8B-4058-41A4-A9DE-1B1FB650B21A}.Release|Win32.ActiveCfg = Release|Win32
- {0BEACB8B-4058-41A4-A9DE-1B1FB650B21A}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/3rdparty/portmidi/portmidi_cdt.zip b/3rdparty/portmidi/portmidi_cdt.zip
deleted file mode 100644
index eaa2d7970cb..00000000000
--- a/3rdparty/portmidi/portmidi_cdt.zip
+++ /dev/null
Binary files differ
diff --git a/3rdparty/portmidi/porttime/porttime-VC8.vcproj b/3rdparty/portmidi/porttime/porttime-VC8.vcproj
deleted file mode 100644
index 9a4562495b2..00000000000
--- a/3rdparty/portmidi/porttime/porttime-VC8.vcproj
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="porttime"
- ProjectGUID="{338224B8-D575-408D-BACF-95C557B429BE}"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- PrecompiledHeaderFile=".\Release/porttime.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\Release\porttime.lib"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\Release/porttime.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="_LIB;WIN32;_DEBUG"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- PrecompiledHeaderFile=".\Debug/porttime.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- WarningLevel="3"
- SuppressStartupBanner="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\Debug\porttime.lib"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\Debug/porttime.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
- >
- <File
- RelativePath="porttime.c"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="ptwinmm.c"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl"
- >
- <File
- RelativePath="porttime.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/porttime/porttime.dsp b/3rdparty/portmidi/porttime/porttime.dsp
deleted file mode 100644
index 2771842af31..00000000000
--- a/3rdparty/portmidi/porttime/porttime.dsp
+++ /dev/null
@@ -1,104 +0,0 @@
-# Microsoft Developer Studio Project File - Name="porttime" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=porttime - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "porttime.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "porttime.mak" CFG="porttime - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "porttime - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "porttime - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "porttime - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "porttime - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_LIB" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "USE_DLL_FOR_CLEANUP" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF
-
-# Begin Target
-
-# Name "porttime - Win32 Release"
-# Name "porttime - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\porttime.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\ptwinmm.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\porttime.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/3rdparty/portmidi/porttime/porttime.h b/3rdparty/portmidi/porttime/porttime.h
index f5ffd5c1f49..29d93dc2c59 100644
--- a/3rdparty/portmidi/porttime/porttime.h
+++ b/3rdparty/portmidi/porttime/porttime.h
@@ -1,4 +1,4 @@
-/* porttime.h -- portable interface to millisecond timer */
+/** @file porttime.h portable interface to millisecond timer. */
/* CHANGE LOG FOR PORTTIME
10-Jun-03 Mark Nelson & RBD
@@ -25,8 +25,16 @@ extern "C" {
#endif
#ifndef PMEXPORT
+#ifdef _WINDLL
+#define PMEXPORT __declspec(dllexport)
+#else
#define PMEXPORT
#endif
+#endif
+
+/** @defgroup grp_porttime PortTime: Millisecond Timer
+ @{
+*/
typedef enum {
ptNoError = 0, /* success */
@@ -34,55 +42,57 @@ typedef enum {
ptAlreadyStarted, /* cannot start timer because it is already started */
ptAlreadyStopped, /* cannot stop timer because it is already stopped */
ptInsufficientMemory /* memory could not be allocated */
-} PtError;
-
+} PtError; /**< @brief @enum PtError PortTime error code; a common return type.
+ * No error is indicated by zero; errors are indicated by < 0.
+ */
+/** real time or time offset in milliseconds. */
typedef int32_t PtTimestamp;
-typedef void (PtCallback)( PtTimestamp timestamp, void *userData );
+/** a function that gets a current time */
+typedef void (PtCallback)(PtTimestamp timestamp, void *userData);
-/*
- Pt_Start() starts a real-time service.
+/** start a real-time clock service.
- resolution is the timer resolution in ms. The time will advance every
- resolution ms.
+ @param resolution the timer resolution in ms. The time will advance every
+ \p resolution ms.
- callback is a function pointer to be called every resolution ms.
+ @param callback a function pointer to be called every resolution ms.
- userData is passed to callback as a parameter.
+ @param userData is passed to \p callback as a parameter.
- return value:
- Upon success, returns ptNoError. See PtError for other values.
+ @return #ptNoError on success. See #PtError for other values.
*/
PMEXPORT PtError Pt_Start(int resolution, PtCallback *callback, void *userData);
-/*
- Pt_Stop() stops the timer.
+/** stop the timer.
- return value:
- Upon success, returns ptNoError. See PtError for other values.
+ @return #ptNoError on success. See #PtError for other values.
*/
PMEXPORT PtError Pt_Stop(void);
-/*
- Pt_Started() returns true iff the timer is running.
+/** test if the timer is running.
+
+ @return TRUE or FALSE
*/
PMEXPORT int Pt_Started(void);
-/*
- Pt_Time() returns the current time in ms.
+/** get the current time in ms.
+
+ @return the current time
*/
PMEXPORT PtTimestamp Pt_Time(void);
-/*
- Pt_Sleep() pauses, allowing other threads to run.
+/** pauses the current thread, allowing other threads to run.
- duration is the length of the pause in ms. The true duration
+ @param duration the length of the pause in ms. The true duration
of the pause may be rounded to the nearest or next clock tick
- as determined by resolution in Pt_Start().
+ as determined by resolution in #Pt_Start().
*/
PMEXPORT void Pt_Sleep(int32_t duration);
+/** @} */
+
#ifdef __cplusplus
}
#endif
diff --git a/3rdparty/portmidi/porttime/porttime.vcproj b/3rdparty/portmidi/porttime/porttime.vcproj
deleted file mode 100644
index a386cce6257..00000000000
--- a/3rdparty/portmidi/porttime/porttime.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="PortTime"
- ProjectGUID="{338224B8-D575-408D-BACF-95C557B429BE}"
- TargetFrameworkVersion="131072"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- PrecompiledHeaderFile=".\$(OutDir)\porttime.pch"
- AssemblerListingLocation=".\$(OutDir)\"
- ObjectFile=".\$(OutDir)\"
- ProgramDataBaseFileName=".\$(OutDir)\"
- WarningLevel="3"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\$(OutDir)\porttime.lib"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\$(OutDir)\porttime.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="_LIB;WIN32;_DEBUG"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- PrecompiledHeaderFile=".\$(OutDir)\porttime.pch"
- AssemblerListingLocation=".\$(OutDir)\"
- ObjectFile=".\$(OutDir)\"
- ProgramDataBaseFileName=".\$(OutDir)\"
- WarningLevel="3"
- SuppressStartupBanner="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\$(OutDir)\porttime.lib"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=".\$(OutDir)\porttime.bsc"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\porttime.c"
- >
- </File>
- <File
- RelativePath=".\porttime.h"
- >
- </File>
- <File
- RelativePath=".\ptwinmm.c"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/portmidi/porttime/pthaiku.cpp b/3rdparty/portmidi/porttime/pthaiku.cpp
new file mode 100644
index 00000000000..9d8de14fd3d
--- /dev/null
+++ b/3rdparty/portmidi/porttime/pthaiku.cpp
@@ -0,0 +1,88 @@
+// pthaiku.cpp - portable timer implementation for Haiku
+
+#include "porttime.h"
+#include <Looper.h>
+#include <MessageRunner.h>
+#include <OS.h>
+
+namespace {
+ const uint32 timerMessage = 'PTTM';
+
+ struct TimerLooper : BLooper {
+ TimerLooper() : BLooper() {
+ }
+
+
+ virtual void MessageReceived(BMessage *message)
+ {
+ PtCallback *callback;
+ void *userData;
+ if (message->what == timerMessage && message->FindPointer("callback", (void**)&callback) == B_OK && message->FindPointer("userData", &userData) == B_OK) {
+ (*callback)(Pt_Time(), userData);
+ }
+ BLooper::MessageReceived(message);
+ }
+ };
+
+ bool time_started_flag = false;
+ bigtime_t time_offset;
+ TimerLooper *timerLooper;
+ BMessageRunner *timerRunner;
+}
+
+extern "C" {
+ PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
+ {
+ if (time_started_flag) return ptAlreadyStarted;
+ time_offset = system_time();
+ if (callback) {
+ timerLooper = new TimerLooper;
+ timerLooper->Run();
+ BMessenger target(timerLooper);
+ BMessage message(timerMessage);
+ message.AddPointer("callback", (void*)callback);
+ message.AddPointer("userData", userData);
+ bigtime_t interval = resolution * 1000;
+ timerRunner = new BMessageRunner(target, &message, interval);
+ if(timerRunner->InitCheck() != B_OK) {
+ delete timerRunner;
+ timerRunner = NULL;
+ timerLooper->PostMessage(B_QUIT_REQUESTED);
+ timerLooper = NULL;
+ return ptHostError;
+ }
+ }
+ time_started_flag = true;
+ return ptNoError;
+ }
+
+
+ PtError Pt_Stop()
+ {
+ if (!time_started_flag) return ptAlreadyStopped;
+ time_started_flag = false;
+ delete timerRunner;
+ timerRunner = NULL;
+ timerLooper->PostMessage(B_QUIT_REQUESTED);
+ timerLooper = NULL;
+ return ptNoError;
+ }
+
+
+ int Pt_Started()
+ {
+ return time_started_flag;
+ }
+
+
+ PtTimestamp Pt_Time()
+ {
+ return (system_time() - time_offset) / 1000;
+ }
+
+
+ void Pt_Sleep(int32_t duration)
+ {
+ snooze(duration * 1000);
+ }
+}
diff --git a/3rdparty/portmidi/porttime/ptlinux.c b/3rdparty/portmidi/porttime/ptlinux.c
index c58107c36ad..7302e212311 100644
--- a/3rdparty/portmidi/porttime/ptlinux.c
+++ b/3rdparty/portmidi/porttime/ptlinux.c
@@ -29,7 +29,7 @@ CHANGE LOG
#include <unistd.h>
#include <sys/types.h>
#include "porttime.h"
-#include "sys/time.h"
+#include "time.h"
#include "sys/resource.h"
#include "sys/timeb.h"
#include "pthread.h"
@@ -38,7 +38,7 @@ CHANGE LOG
#define FALSE 0
static int time_started_flag = FALSE;
-static struct timeval time_offset = {0, 0};
+static struct timespec time_offset = {0, 0};
static pthread_t pt_thread_pid;
static int pt_thread_created = FALSE;
@@ -79,7 +79,8 @@ static void *Pt_CallbackProc(void *p)
PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
{
if (time_started_flag) return ptNoError;
- gettimeofday(&time_offset, NULL); /* need this set before process runs */
+ /* need this set before process runs: */
+ clock_gettime(CLOCK_MONOTONIC_RAW, &time_offset);
if (callback) {
int res;
pt_callback_parameters *parms = (pt_callback_parameters *)
@@ -99,7 +100,7 @@ PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
}
-PtError Pt_Stop()
+PtError Pt_Stop(void)
{
/* printf("Pt_Stop called\n"); */
pt_callback_proc_id++;
@@ -112,20 +113,20 @@ PtError Pt_Stop()
}
-int Pt_Started()
+int Pt_Started(void)
{
return time_started_flag;
}
-PtTimestamp Pt_Time()
+PtTimestamp Pt_Time(void)
{
- long seconds, milliseconds;
- struct timeval now;
- gettimeofday(&now, NULL);
+ long seconds, ms;
+ struct timespec now;
+ clock_gettime(CLOCK_MONOTONIC_RAW, &now);
seconds = now.tv_sec - time_offset.tv_sec;
- milliseconds = now.tv_usec - time_offset.tv_usec;
- return seconds * 1000 + milliseconds;
+ ms = (now.tv_nsec - time_offset.tv_nsec) / 1000000; /* round down */
+ return seconds * 1000 + ms;
}
@@ -133,6 +134,3 @@ void Pt_Sleep(int32_t duration)
{
usleep(duration * 1000);
}
-
-
-
diff --git a/3rdparty/portmidi/porttime/ptmacosx_cf.c b/3rdparty/portmidi/porttime/ptmacosx_cf.c
index 3eb0de12f82..1bc9658d216 100644
--- a/3rdparty/portmidi/porttime/ptmacosx_cf.c
+++ b/3rdparty/portmidi/porttime/ptmacosx_cf.c
@@ -111,7 +111,7 @@ PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
}
-PtError Pt_Stop()
+PtError Pt_Stop(void)
{
printf("Pt_Stop called\n");
@@ -121,13 +121,13 @@ PtError Pt_Stop()
}
-int Pt_Started()
+int Pt_Started(void)
{
return time_started_flag;
}
-PtTimestamp Pt_Time()
+PtTimestamp Pt_Time(void)
{
CFAbsoluteTime now = CFAbsoluteTimeGetCurrent();
return (PtTimestamp) ((now - startTime) * 1000.0);
diff --git a/3rdparty/portmidi/porttime/ptmacosx_mach.c b/3rdparty/portmidi/porttime/ptmacosx_mach.c
index 7327818075f..bc6a1a01084 100644
--- a/3rdparty/portmidi/porttime/ptmacosx_mach.c
+++ b/3rdparty/portmidi/porttime/ptmacosx_mach.c
@@ -4,20 +4,29 @@
#include <stdio.h>
#include <CoreAudio/HostTime.h>
-#include <mach/mach.h>
-#include <mach/mach_error.h>
-#include <mach/mach_time.h>
-#include <mach/clock.h>
+#import <mach/mach.h>
+#import <mach/mach_error.h>
+#import <mach/mach_time.h>
+#import <mach/clock.h>
#include <unistd.h>
+#include <AvailabilityMacros.h>
#include "porttime.h"
#include "sys/time.h"
#include "pthread.h"
-#if !defined NSEC_PER_MSEC
-#define NSEC_PER_MSEC 1000000ull
+#ifndef NSEC_PER_MSEC
+#define NSEC_PER_MSEC 1000000
+#endif
+#define THREAD_IMPORTANCE 63
+
+// QOS headers are available as of macOS 10.10
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
+#include "sys/qos.h"
+#define HAVE_APPLE_QOS 1
+#else
+#undef HAVE_APPLE_QOS
#endif
-#define THREAD_IMPORTANCE 30
static int time_started_flag = FALSE;
static UInt64 start_time;
@@ -47,7 +56,7 @@ static void *Pt_CallbackProc(void *p)
(thread_policy_t)&extendedPolicy,
THREAD_EXTENDED_POLICY_COUNT);
if (error != KERN_SUCCESS) {
- mach_error((char *)"Couldn't set thread timeshare policy", error);
+ mach_error("Couldn't set thread timeshare policy", error);
}
precedencePolicy.importance = THREAD_IMPORTANCE;
@@ -55,22 +64,65 @@ static void *Pt_CallbackProc(void *p)
(thread_policy_t)&precedencePolicy,
THREAD_PRECEDENCE_POLICY_COUNT);
if (error != KERN_SUCCESS) {
- mach_error((char *)"Couldn't set thread precedence policy", error);
+ mach_error("Couldn't set thread precedence policy", error);
}
+ // Most important, set real-time constraints.
+
+ // Define the guaranteed and max fraction of time for the audio thread.
+ // These "duty cycle" values can range from 0 to 1. A value of 0.5
+ // means the scheduler would give half the time to the thread.
+ // These values have empirically been found to yield good behavior.
+ // Good means that audio performance is high and other threads won't starve.
+ const double kGuaranteedAudioDutyCycle = 0.75;
+ const double kMaxAudioDutyCycle = 0.85;
+
+ // Define constants determining how much time the audio thread can
+ // use in a given time quantum. All times are in milliseconds.
+
+ // About 128 frames @44.1KHz
+ const double kTimeQuantum = 2.9;
+
+ // Time guaranteed each quantum.
+ const double kAudioTimeNeeded = kGuaranteedAudioDutyCycle * kTimeQuantum;
+
+ // Maximum time each quantum.
+ const double kMaxTimeAllowed = kMaxAudioDutyCycle * kTimeQuantum;
+ // Get the conversion factor from milliseconds to absolute time
+ // which is what the time-constraints call needs.
+ mach_timebase_info_data_t tb_info;
+ mach_timebase_info(&tb_info);
+ double ms_to_abs_time =
+ ((double)tb_info.denom / (double)tb_info.numer) * 1000000;
+
+ thread_time_constraint_policy_data_t time_constraints;
+ time_constraints.period = (uint32_t)(kTimeQuantum * ms_to_abs_time);
+ time_constraints.computation = (uint32_t)(kAudioTimeNeeded * ms_to_abs_time);
+ time_constraints.constraint = (uint32_t)(kMaxTimeAllowed * ms_to_abs_time);
+ time_constraints.preemptible = 0;
+
+ error = thread_policy_set(mach_thread_self(),
+ THREAD_TIME_CONSTRAINT_POLICY,
+ (thread_policy_t)&time_constraints,
+ THREAD_TIME_CONSTRAINT_POLICY_COUNT);
+ if (error != KERN_SUCCESS) {
+ mach_error("Couldn't set thread precedence policy", error);
+ }
+
/* to kill a process, just increment the pt_callback_proc_id */
- /* printf("pt_callback_proc_id %d, id %d\n", pt_callback_proc_id, parameters->id); */
+ /* printf("pt_callback_proc_id %d, id %d\n", pt_callback_proc_id,
+ parameters->id); */
while (pt_callback_proc_id == parameters->id) {
/* wait for a multiple of resolution ms */
UInt64 wait_time;
int delay = mytime++ * parameters->resolution - Pt_Time();
- PtTimestamp timestamp;
+ PtTimestamp timestamp;
if (delay < 0) delay = 0;
wait_time = AudioConvertNanosToHostTime((UInt64)delay * NSEC_PER_MSEC);
wait_time += AudioGetCurrentHostTime();
- error = mach_wait_until(wait_time);
- timestamp = Pt_Time();
+ mach_wait_until(wait_time);
+ timestamp = Pt_Time();
(*(parameters->callback))(timestamp, parameters->userData);
}
free(parameters);
@@ -93,7 +145,26 @@ PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
parms->resolution = resolution;
parms->callback = callback;
parms->userData = userData;
+
+#ifdef HAVE_APPLE_QOS
+ pthread_attr_t qosAttribute;
+ pthread_attr_init(&qosAttribute);
+ pthread_attr_set_qos_class_np(&qosAttribute,
+ QOS_CLASS_USER_INTERACTIVE, 0);
+
+ res = pthread_create(&pt_thread_pid, &qosAttribute, Pt_CallbackProc,
+ parms);
+#else
res = pthread_create(&pt_thread_pid, NULL, Pt_CallbackProc, parms);
+#endif
+
+ struct sched_param sp;
+ memset(&sp, 0, sizeof(struct sched_param));
+ sp.sched_priority = sched_get_priority_max(SCHED_RR);
+ if (pthread_setschedparam(pthread_self(), SCHED_RR, &sp) == -1) {
+ return ptHostError;
+ }
+
if (res != 0) return ptHostError;
}
diff --git a/3rdparty/portmidi/porttime/ptwinmm.c b/3rdparty/portmidi/porttime/ptwinmm.c
index 17675bd6c6a..05f5c74eea3 100644
--- a/3rdparty/portmidi/porttime/ptwinmm.c
+++ b/3rdparty/portmidi/porttime/ptwinmm.c
@@ -38,7 +38,7 @@ PMEXPORT PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
}
-PMEXPORT PtError Pt_Stop()
+PMEXPORT PtError Pt_Stop(void)
{
if (!time_started_flag) return ptAlreadyStopped;
if (time_callback && timer_id) {
@@ -52,13 +52,13 @@ PMEXPORT PtError Pt_Stop()
}
-PMEXPORT int Pt_Started()
+PMEXPORT int Pt_Started(void)
{
return time_started_flag;
}
-PMEXPORT PtTimestamp Pt_Time()
+PMEXPORT PtTimestamp Pt_Time(void)
{
return timeGetTime() - time_offset;
}
diff --git a/3rdparty/softfloat/mamesf.h b/3rdparty/softfloat/mamesf.h
index 437f54834e3..08b03d55d75 100644
--- a/3rdparty/softfloat/mamesf.h
+++ b/3rdparty/softfloat/mamesf.h
@@ -1,13 +1,4 @@
/*----------------------------------------------------------------------------
-| One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
-*----------------------------------------------------------------------------*/
-#ifdef LSB_FIRST
-#define LITTLEENDIAN
-#else
-#define BIGENDIAN
-#endif
-
-/*----------------------------------------------------------------------------
| The macro `BITS64' can be defined to indicate that 64-bit integer types are
| supported by the compiler.
*----------------------------------------------------------------------------*/
diff --git a/3rdparty/softfloat/milieu.h b/3rdparty/softfloat/milieu.h
index 10687b755d0..523710d27f1 100644
--- a/3rdparty/softfloat/milieu.h
+++ b/3rdparty/softfloat/milieu.h
@@ -34,9 +34,3 @@ these four paragraphs for those parts of this code that are retained.
| Include common integer types and flags.
*----------------------------------------------------------------------------*/
#include "mamesf.h"
-
-/*----------------------------------------------------------------------------
-| Symbolic Boolean literals.
-*----------------------------------------------------------------------------*/
-#define FALSE 0
-#define TRUE 1
diff --git a/3rdparty/softfloat3/bochs_ext/extF80_scale.c b/3rdparty/softfloat3/bochs_ext/extF80_scale.c
new file mode 100644
index 00000000000..6a25764f128
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/extF80_scale.c
@@ -0,0 +1,156 @@
+/*============================================================================
+
+This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
+Package, Release 3e, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions, and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions, and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. Neither the name of the University nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=============================================================================*/
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "../source/include/softfloat.h"
+#include "../source/include/internals.h"
+#include "../source/8086/specialize.h"
+
+#include "fpu_constant.h"
+#include "softfloat-helpers.h"
+#include "softfloat-extra.h"
+#include "softfloat-specialize.h"
+
+/*----------------------------------------------------------------------------
+| Scales extended double-precision floating-point value in operand `a' by
+| value `b'. The function truncates the value in the second operand 'b' to
+| an integral value and adds that value to the exponent of the operand 'a'.
+| The operation performed according to the IEC/IEEE Standard for Binary
+| Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+
+extFloat80_t extFloat80_scale(extFloat80_t a, extFloat80_t b)
+{
+ uint16_t uiA64;
+ uint64_t uiA0;
+ bool signA;
+ int32_t expA;
+ uint64_t sigA;
+ uint16_t uiB64;
+ uint64_t uiB0;
+ bool signB;
+ int32_t expB;
+ uint64_t sigB;
+ struct exp32_sig64 normExpSig;
+
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a) || extF80_isUnsupported(b)) {
+invalid:
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ return packToExtF80(defaultNaNExtF80UI64, defaultNaNExtF80UI0);
+ }
+
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+ uiA64 = a.signExp;
+ uiA0 = a.signif;
+ signA = signExtF80UI64(uiA64);
+ expA = expExtF80UI64(uiA64);
+ sigA = uiA0;
+ uiB64 = b.signExp;
+ uiB0 = b.signif;
+ signB = signExtF80UI64(uiB64);
+ expB = expExtF80UI64(uiB64);
+ sigB = uiB0;
+ /*------------------------------------------------------------------------
+ *------------------------------------------------------------------------*/
+
+ if (expA == 0x7FFF) {
+ if ((sigA<<1) || ((expB == 0x7FFF) && (sigB<<1))) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(uiA64, uiA0, uiB64, uiB0);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+ if ((expB == 0x7FFF) && signB) goto invalid;
+ if (sigB && !expB)
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actally denormal
+
+ return a;
+ }
+ if (expB == 0x7FFF) {
+ if (sigB<<1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(uiA64, uiA0, uiB64, uiB0);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+ if ((expA | sigA) == 0) {
+ if (! signB) goto invalid;
+ return a;
+ }
+ if (sigA && !expA)
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+
+ if (signB) return packToExtF80(signA, 0, 0);
+ return packToExtF80(signA, 0x7FFF, uint64_t(0x8000000000000000));
+ }
+ if (! expA) {
+ if (sigB && !expB)
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ if (! sigA) return a;
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ normExpSig = softfloat_normSubnormalExtF80Sig(sigA);
+ expA = normExpSig.exp + 1;
+ sigA = normExpSig.sig;
+ if (expB < 0x3FFF)
+ return softfloat_normRoundPackToExtF80(signA, expA, sigA, 0, 80);
+ }
+ if (!expB) {
+ if (!sigB) return a;
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ normExpSig = softfloat_normSubnormalExtF80Sig(sigB);
+ expB = normExpSig.exp + 1;
+ sigB = normExpSig.sig;
+ }
+
+ if (expB > 0x400E) {
+ /* generate appropriate overflow/underflow */
+ return softfloat_roundPackToExtF80(signA, signB ? -0x3FFF : 0x7FFF, sigA, 0, 80);
+ }
+
+ if (expB < 0x3FFF) return a;
+
+ int shiftCount = 0x403E - expB;
+ sigB >>= shiftCount;
+ int32_t scale = (int32_t) sigB;
+ if (signB) scale = -scale; /* -32768..32767 */
+
+ return softfloat_roundPackToExtF80(signA, expA + scale, sigA, 0, 80);
+}
diff --git a/3rdparty/softfloat3/bochs_ext/f2xm1.c b/3rdparty/softfloat3/bochs_ext/f2xm1.c
new file mode 100644
index 00000000000..bc8544edd63
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/f2xm1.c
@@ -0,0 +1,491 @@
+/*============================================================================
+This source file is an extension to the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b, written for Bochs (x86 achitecture simulator)
+floating point emulation.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+=============================================================================*/
+
+/*============================================================================
+ * Written for Bochs (x86 achitecture simulator) by
+ * Stanislav Shwartsman [sshwarts at sourceforge net]
+ * ==========================================================================*/
+
+#define FLOAT128
+
+#include "../build/MAME/platform.h"
+
+#include "../source/include/softfloat.h"
+#include "../source/include/internals.h"
+#include "softfloat-extra.h"
+#include "softfloat-helpers.h"
+#include "softfloat-specialize.h"
+
+static const extFloat80_t floatx80_posone = packFloatx80(0, 0x3fff, uint64_t(0x8000000000000000));
+static const extFloat80_t floatx80_negone = packFloatx80(1, 0x3fff, uint64_t(0x8000000000000000));
+static const extFloat80_t floatx80_neghalf = packFloatx80(1, 0x3ffe, uint64_t(0x8000000000000000));
+static const float128_t float128_e =
+ packFloat128(uint64_t(0x40005BF0A8B14576), uint64_t(0x95355FB8AC404E7A));
+static const float128_t float128_ln2 =
+ packFloat128(uint64_t(0x3ffe62e42fefa39e), uint64_t(0xf35793c7673007e6));
+static const float128_t float128_ln10 =
+ packFloat128(uint64_t(0x400026bb1bbb5551), uint64_t(0x582dd4adac5705a6));
+
+#ifdef BETTER_THAN_PENTIUM
+
+#define LN2_SIG_HI uint64_t(0xb17217f7d1cf79ab)
+#define LN2_SIG_LO uint64_t(0xc9e3b39800000000) /* 96 bit precision */
+
+#define LN10_SIG_HI uint64_t(0xae585ba95bb0a2aa)
+#define LN10_SIG_LO uint64_t(0x763776d400000000) /* 96 bit precision */
+
+#else
+
+#define LN2_SIG_HI uint64_t(0xb17217f7d1cf79ab)
+#define LN2_SIG_LO uint64_t(0xc000000000000000) /* 67-bit precision */
+
+#define LN10_SIG_HI uint64_t(0xae585ba95bb0a2aa)
+#define LN10_SIG_LO uint64_t(0x7000000000000000) /* 67-bit precision */
+
+#endif
+
+#define EXP_ARR_SIZE 15
+
+static float128_t exp_arr[EXP_ARR_SIZE] =
+{
+ PACK_FLOAT_128(0x3fff000000000000, 0x0000000000000000), /* 1 */
+ PACK_FLOAT_128(0x3ffe000000000000, 0x0000000000000000), /* 2 */
+ PACK_FLOAT_128(0x3ffc555555555555, 0x5555555555555555), /* 3 */
+ PACK_FLOAT_128(0x3ffa555555555555, 0x5555555555555555), /* 4 */
+ PACK_FLOAT_128(0x3ff8111111111111, 0x1111111111111111), /* 5 */
+ PACK_FLOAT_128(0x3ff56c16c16c16c1, 0x6c16c16c16c16c17), /* 6 */
+ PACK_FLOAT_128(0x3ff2a01a01a01a01, 0xa01a01a01a01a01a), /* 7 */
+ PACK_FLOAT_128(0x3fefa01a01a01a01, 0xa01a01a01a01a01a), /* 8 */
+ PACK_FLOAT_128(0x3fec71de3a556c73, 0x38faac1c88e50017), /* 9 */
+ PACK_FLOAT_128(0x3fe927e4fb7789f5, 0xc72ef016d3ea6679), /* 10 */
+ PACK_FLOAT_128(0x3fe5ae64567f544e, 0x38fe747e4b837dc7), /* 11 */
+ PACK_FLOAT_128(0x3fe21eed8eff8d89, 0x7b544da987acfe85), /* 12 */
+ PACK_FLOAT_128(0x3fde6124613a86d0, 0x97ca38331d23af68), /* 13 */
+ PACK_FLOAT_128(0x3fda93974a8c07c9, 0xd20badf145dfa3e5), /* 14 */
+ PACK_FLOAT_128(0x3fd6ae7f3e733b81, 0xf11d8656b0ee8cb0) /* 15 */
+};
+
+extern float128_t EvalPoly(float128_t x, const float128_t *arr, int n);
+
+/* required -1 < x < 1 */
+static float128_t poly_exp(float128_t x)
+{
+/*
+ 2 3 4 5 6 7 8 9
+ x x x x x x x x x
+ e - 1 ~ x + --- + --- + --- + --- + --- + --- + --- + --- + ...
+ 2! 3! 4! 5! 6! 7! 8! 9!
+
+ 2 3 4 5 6 7 8
+ x x x x x x x x
+ = x [ 1 + --- + --- + --- + --- + --- + --- + --- + --- + ... ]
+ 2! 3! 4! 5! 6! 7! 8! 9!
+
+ 8 8
+ -- 2k -- 2k+1
+ p(x) = > C * x q(x) = > C * x
+ -- 2k -- 2k+1
+ k=0 k=0
+
+ x
+ e - 1 ~ x * [ p(x) + x * q(x) ]
+
+*/
+ float128_t t = EvalPoly(x, (const float128_t*) exp_arr, EXP_ARR_SIZE);
+ return f128_mul(t, x);
+}
+
+// =================================================
+// x
+// FX2M1 Compute 2 - 1
+// =================================================
+
+//
+// Uses the following identities:
+//
+// 1. ----------------------------------------------------------
+// x x*ln(2)
+// 2 = e
+//
+// 2. ----------------------------------------------------------
+// 2 3 4 5 n
+// x x x x x x x
+// e = 1 + --- + --- + --- + --- + --- + ... + --- + ...
+// 1! 2! 3! 4! 5! n!
+//
+extFloat80_t extFloat80_2xm1(extFloat80_t a)
+{
+ uint64_t zSig0, zSig1, zSig2;
+ struct exp32_sig64 normExpSig;
+
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a)) {
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ return floatx80_default_nan;
+ }
+
+ uint64_t aSig = extF80_fraction(a);
+ int32_t aExp = extF80_exp(a);
+ int aSign = extF80_sign(a);
+
+ if (aExp == 0x7FFF) {
+ if (aSig << 1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, 0, 0);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+
+ return (aSign) ? floatx80_negone : a;
+ }
+
+ if (! aExp) {
+ if (! aSig) return a;
+ softfloat_exceptionFlags |= softfloat_flag_inexact; // denormal also
+ normExpSig = softfloat_normSubnormalExtF80Sig(aSig);
+ aExp = normExpSig.exp + 1;
+ aSig = normExpSig.sig;
+
+ tiny_argument:
+ mul128By64To192(LN2_SIG_HI, LN2_SIG_LO, aSig, &zSig0, &zSig1, &zSig2);
+ if (0 < (int64_t) zSig0) {
+ shortShift128Left(zSig0, zSig1, 1, &zSig0, &zSig1);
+ --aExp;
+ }
+ return softfloat_roundPackToExtF80(aSign, aExp, zSig0, zSig1, 80);
+ }
+
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+
+ if (aExp < 0x3FFF)
+ {
+ if (aExp < FLOATX80_EXP_BIAS-68)
+ goto tiny_argument;
+
+ /* ******************************** */
+ /* using float128 for approximation */
+ /* ******************************** */
+
+ float128_t x = extF80_to_f128(a);
+ x = f128_mul(x, float128_ln2);
+ x = poly_exp(x);
+ return f128_to_extF80(x);
+ }
+ else
+ {
+ if (a.signExp == 0xBFFF && ! (aSig<<1))
+ return floatx80_neghalf;
+
+ return a;
+ }
+}
+
+// =================================================
+// x
+// Compute e
+// =================================================
+
+//
+// Uses the following identities:
+//
+// 1. ----------------------------------------------------------
+// 2 3 4 5 n
+// x x x x x x x
+// e = 1 + --- + --- + --- + --- + --- + ... + --- + ...
+// 1! 2! 3! 4! 5! n!
+//
+extFloat80_t extFloat80_etox(extFloat80_t a)
+{
+ uint64_t zSig0, zSig1, zSig2;
+ struct exp32_sig64 normExpSig;
+
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a)) {
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ return floatx80_default_nan;
+ }
+
+ uint64_t aSig = extF80_fraction(a);
+ int32_t aExp = extF80_exp(a);
+ int aSign = extF80_sign(a);
+
+ if (aExp == 0x7FFF) {
+ if (aSig << 1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, 0, 0);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+
+ return (aSign) ? floatx80_negone : a;
+ }
+
+ if (! aExp) {
+ if (! aSig) return a;
+ softfloat_exceptionFlags |= softfloat_flag_inexact; // denormal also
+ normExpSig = softfloat_normSubnormalExtF80Sig(aSig);
+ aExp = normExpSig.exp + 1;
+ aSig = normExpSig.sig;
+
+ mul128By64To192(0x1000000000000000, 0, aSig, &zSig0, &zSig1, &zSig2);
+ if (0 < (int64_t) zSig0) {
+ shortShift128Left(zSig0, zSig1, 1, &zSig0, &zSig1);
+ --aExp;
+ }
+ return softfloat_roundPackToExtF80(aSign, aExp, zSig0, zSig1, 80);
+ }
+
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+
+ const extFloat80_t base = f128_to_extF80(float128_e);
+ extFloat80_t val = floatx80_posone;
+ float128_t x;
+
+ while (!(extF80_lt(a, floatx80_posone))) {
+ val = extF80_mul(val, base);
+
+ if (extF80_exp(val) == 0x7FFF) { // inf
+ goto ret;
+ }
+
+ a = extF80_sub(a, floatx80_posone);
+ }
+
+ while (extF80_le(a, floatx80_negone)) {
+ val = extF80_div(val, base);
+
+ if (!extF80_exp(val)) { // subnormal
+ goto ret;
+ }
+
+ a = extF80_add(a, floatx80_posone);
+ }
+
+ret:
+ /* ******************************** */
+ /* using float128 for approximation */
+ /* ******************************** */
+ x = extF80_to_f128(a);
+ x = poly_exp(x);
+
+ val = extF80_mul(val, extF80_add(f128_to_extF80(x), floatx80_posone));
+
+ return val;
+}
+
+// =================================================
+// x
+// Compute 2
+// =================================================
+
+//
+// Uses the following identities:
+//
+// 1. ----------------------------------------------------------
+// x x*ln(2)
+// 2 = e
+//
+// 2. ----------------------------------------------------------
+// 2 3 4 5 n
+// x x x x x x x
+// e = 1 + --- + --- + --- + --- + --- + ... + --- + ...
+// 1! 2! 3! 4! 5! n!
+//
+extFloat80_t extFloat80_2tox(extFloat80_t a)
+{
+ uint64_t zSig0, zSig1, zSig2;
+ struct exp32_sig64 normExpSig;
+
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a)) {
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ return floatx80_default_nan;
+ }
+
+ uint64_t aSig = extF80_fraction(a);
+ int32_t aExp = extF80_exp(a);
+ int aSign = extF80_sign(a);
+
+ if (aExp == 0x7FFF) { // inf or NaN
+ if (aSig << 1) { // NaN
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, 0, 0);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+
+ return (aSign) ? floatx80_negone : a; // -inf or +inf
+ }
+
+ if (! aExp) { // subnormal
+ if (! aSig) return a;
+ softfloat_exceptionFlags |= softfloat_flag_inexact; // denormal also
+ normExpSig = softfloat_normSubnormalExtF80Sig(aSig);
+ aExp = normExpSig.exp + 1;
+ aSig = normExpSig.sig;
+
+ mul128By64To192(LN2_SIG_HI, LN2_SIG_LO, aSig, &zSig0, &zSig1, &zSig2);
+ if (0 < (int64_t) zSig0) {
+ shortShift128Left(zSig0, zSig1, 1, &zSig0, &zSig1);
+ --aExp;
+ }
+ return softfloat_roundPackToExtF80(aSign, aExp, zSig0, zSig1, 80);
+ }
+
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+
+ const extFloat80_t base = i32_to_extF80(2);
+ extFloat80_t val = floatx80_posone;
+ float128_t x;
+
+ while (!(extF80_lt(a, floatx80_posone))) {
+ val = extF80_mul(val, base);
+
+ if (extF80_exp(val) == 0x7FFF) { // inf
+ goto ret;
+ }
+
+ a = extF80_sub(a, floatx80_posone);
+ }
+
+ while (extF80_le(a, floatx80_negone)) {
+ val = extF80_div(val, base);
+
+ if (!extF80_exp(val)) { // subnormal
+ goto ret;
+ }
+
+ a = extF80_add(a, floatx80_posone);
+ }
+
+ret:
+ /* ******************************** */
+ /* using float128 for approximation */
+ /* ******************************** */
+ x = extF80_to_f128(a);
+ x = f128_mul(x, float128_ln2);
+ x = poly_exp(x);
+
+ val = extF80_mul(val, extF80_add(f128_to_extF80(x), floatx80_posone));
+
+ return val;
+}
+
+// =================================================
+// x
+// Compute 10
+// =================================================
+
+//
+// Uses the following identities:
+//
+// 1. ----------------------------------------------------------
+// x x*ln(10)
+// 2 = e
+//
+// 2. ----------------------------------------------------------
+// 2 3 4 5 n
+// x x x x x x x
+// e = 1 + --- + --- + --- + --- + --- + ... + --- + ...
+// 1! 2! 3! 4! 5! n!
+//
+extFloat80_t extFloat80_10tox(extFloat80_t a)
+{
+ uint64_t zSig0, zSig1, zSig2;
+ struct exp32_sig64 normExpSig;
+
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a)) {
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ return floatx80_default_nan;
+ }
+
+ uint64_t aSig = extF80_fraction(a);
+ int32_t aExp = extF80_exp(a);
+ int aSign = extF80_sign(a);
+
+ if (aExp == 0x7FFF) {
+ if (aSig << 1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, 0, 0);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+
+ return (aSign) ? floatx80_negone : a;
+ }
+
+ if (! aExp) {
+ if (! aSig) return a;
+ softfloat_exceptionFlags |= softfloat_flag_inexact; // denormal also
+ normExpSig = softfloat_normSubnormalExtF80Sig(aSig);
+ aExp = normExpSig.exp + 1;
+ aSig = normExpSig.sig;
+
+ mul128By64To192(LN10_SIG_HI, LN10_SIG_LO, aSig, &zSig0, &zSig1, &zSig2);
+ if (0 < (int64_t) zSig0) {
+ shortShift128Left(zSig0, zSig1, 1, &zSig0, &zSig1);
+ --aExp;
+ }
+ return softfloat_roundPackToExtF80(aSign, aExp, zSig0, zSig1, 80);
+ }
+
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+
+ const extFloat80_t base = i32_to_extF80(10);
+ extFloat80_t val = floatx80_posone;
+ float128_t x;
+
+ while (!(extF80_lt(a, floatx80_posone))) {
+ val = extF80_mul(val, base);
+
+ if (extF80_exp(val) == 0x7FFF) { // inf
+ goto ret;
+ }
+
+ a = extF80_sub(a, floatx80_posone);
+ }
+
+ while (extF80_le(a, floatx80_negone)) {
+ val = extF80_div(val, base);
+
+ if (!extF80_exp(val)) { // subnormal
+ goto ret;
+ }
+
+ a = extF80_add(a, floatx80_posone);
+ }
+
+ret:
+ /* ******************************** */
+ /* using float128 for approximation */
+ /* ******************************** */
+ x = extF80_to_f128(a);
+ x = f128_mul(x, float128_ln10);
+ x = poly_exp(x);
+
+ val = extF80_mul(val, extF80_add(f128_to_extF80(x), floatx80_posone));
+
+ return val;
+}
diff --git a/3rdparty/softfloat3/bochs_ext/fpatan.c b/3rdparty/softfloat3/bochs_ext/fpatan.c
new file mode 100644
index 00000000000..27ee41feddf
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/fpatan.c
@@ -0,0 +1,331 @@
+/*============================================================================
+This source file is an extension to the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b, written for Bochs (x86 achitecture simulator)
+floating point emulation.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+=============================================================================*/
+
+/*============================================================================
+ * Written for Bochs (x86 achitecture simulator) by
+ * Stanislav Shwartsman [sshwarts at sourceforge net]
+ * ==========================================================================*/
+
+#define FLOAT128
+
+#include "../source/include/softfloat.h"
+#include "../source/include/internals.h"
+#include "../source/8086/specialize.h"
+
+#include "fpu_constant.h"
+#include "softfloat-helpers.h"
+#include "softfloat-extra.h"
+#include "softfloat-specialize.h"
+
+#define FPATAN_ARR_SIZE 11
+
+static const extFloat80_t floatx80_one = packFloatx80(0, 0x3fff, uint64_t(0x8000000000000000));
+
+static const float128_t float128_one =
+ packFloat128(uint64_t(0x3fff000000000000), uint64_t(0x0000000000000000));
+static const float128_t float128_sqrt3 =
+ packFloat128(uint64_t(0x3fffbb67ae8584ca), uint64_t(0xa73b25742d7078b8));
+static const extFloat80_t floatx80_pi =
+ packFloatx80(0, 0x4000, uint64_t(0xc90fdaa22168c235));
+
+static const float128_t float128_pi2 =
+ packFloat128(uint64_t(0x3fff921fb54442d1), uint64_t(0x8469898CC5170416));
+static const float128_t float128_pi4 =
+ packFloat128(uint64_t(0x3ffe921fb54442d1), uint64_t(0x8469898CC5170416));
+static const float128_t float128_pi6 =
+ packFloat128(uint64_t(0x3ffe0c152382d736), uint64_t(0x58465BB32E0F580F));
+
+static float128_t atan_arr[FPATAN_ARR_SIZE] =
+{
+ PACK_FLOAT_128(0x3fff000000000000, 0x0000000000000000), /* 1 */
+ PACK_FLOAT_128(0xbffd555555555555, 0x5555555555555555), /* 3 */
+ PACK_FLOAT_128(0x3ffc999999999999, 0x999999999999999a), /* 5 */
+ PACK_FLOAT_128(0xbffc249249249249, 0x2492492492492492), /* 7 */
+ PACK_FLOAT_128(0x3ffbc71c71c71c71, 0xc71c71c71c71c71c), /* 9 */
+ PACK_FLOAT_128(0xbffb745d1745d174, 0x5d1745d1745d1746), /* 11 */
+ PACK_FLOAT_128(0x3ffb3b13b13b13b1, 0x3b13b13b13b13b14), /* 13 */
+ PACK_FLOAT_128(0xbffb111111111111, 0x1111111111111111), /* 15 */
+ PACK_FLOAT_128(0x3ffae1e1e1e1e1e1, 0xe1e1e1e1e1e1e1e2), /* 17 */
+ PACK_FLOAT_128(0xbffaaf286bca1af2, 0x86bca1af286bca1b), /* 19 */
+ PACK_FLOAT_128(0x3ffa861861861861, 0x8618618618618618) /* 21 */
+};
+
+extern float128_t OddPoly(float128_t x, const float128_t *arr, int n);
+
+/* |x| < 1/4 */
+static float128_t poly_atan(float128_t x1)
+{
+/*
+ // 3 5 7 9 11 13 15 17
+ // x x x x x x x x
+ // atan(x) ~ x - --- + --- - --- + --- - ---- + ---- - ---- + ----
+ // 3 5 7 9 11 13 15 17
+ //
+ // 2 4 6 8 10 12 14 16
+ // x x x x x x x x
+ // = x * [ 1 - --- + --- - --- + --- - ---- + ---- - ---- + ---- ]
+ // 3 5 7 9 11 13 15 17
+ //
+ // 5 5
+ // -- 4k -- 4k+2
+ // p(x) = > C * x q(x) = > C * x
+ // -- 2k -- 2k+1
+ // k=0 k=0
+ //
+ // 2
+ // atan(x) ~ x * [ p(x) + x * q(x) ]
+ //
+*/
+ return OddPoly(x1, (const float128_t*) atan_arr, FPATAN_ARR_SIZE);
+}
+
+// =================================================
+// FPATAN Compute arctan(y/x)
+// =================================================
+
+//
+// Uses the following identities:
+//
+// 1. ----------------------------------------------------------
+//
+// atan(-x) = -atan(x)
+//
+// 2. ----------------------------------------------------------
+//
+// x + y
+// atan(x) + atan(y) = atan -------, xy < 1
+// 1-xy
+//
+// x + y
+// atan(x) + atan(y) = atan ------- + PI, x > 0, xy > 1
+// 1-xy
+//
+// x + y
+// atan(x) + atan(y) = atan ------- - PI, x < 0, xy > 1
+// 1-xy
+//
+// 3. ----------------------------------------------------------
+//
+// atan(x) = atan(INF) + atan(- 1/x)
+//
+// x-1
+// atan(x) = PI/4 + atan( ----- )
+// x+1
+//
+// x * sqrt(3) - 1
+// atan(x) = PI/6 + atan( ----------------- )
+// x + sqrt(3)
+//
+// 4. ----------------------------------------------------------
+// 3 5 7 9 2n+1
+// x x x x n x
+// atan(x) = x - --- + --- - --- + --- - ... + (-1) ------ + ...
+// 3 5 7 9 2n+1
+//
+
+extFloat80_t extFloat80_atan(extFloat80_t a, extFloat80_t b)
+{
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a) || extF80_isUnsupported(b)) {
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ return floatx80_default_nan;
+ }
+
+ uint64_t aSig = extF80_fraction(a);
+ int32_t aExp = extF80_exp(a);
+ int aSign = extF80_sign(a);
+ uint64_t bSig = extF80_fraction(b);
+ int32_t bExp = extF80_exp(b);
+ int bSign = extF80_sign(b);
+
+ int zSign = aSign ^ bSign;
+
+ if (bExp == 0x7FFF)
+ {
+ extFloat80_t rv;
+ if (bSig<<1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, b.signExp, bSig);
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+ if (aExp == 0x7FFF) {
+ if (aSig<<1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, b.signExp, bSig);
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+ if (aSign) /* return 3PI/4 */
+ return softfloat_roundPackToExtF80(bSign, FLOATX80_3PI4_EXP, FLOAT_3PI4_HI, FLOAT_3PI4_LO, 80);
+ else /* return PI/4 */
+ return softfloat_roundPackToExtF80(bSign, FLOATX80_PI4_EXP, FLOAT_PI_HI, FLOAT_PI_LO, 80);
+ }
+
+ if (aSig && ! aExp)
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // denormal actually
+
+ /* return PI/2 */
+ return softfloat_roundPackToExtF80(bSign, FLOATX80_PI2_EXP, FLOAT_PI_HI, FLOAT_PI_LO, 80);
+ }
+ if (aExp == 0x7FFF)
+ {
+ if (aSig<<1) {
+ extFloat80_t rv;
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, b.signExp, bSig);
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+ if (bSig && ! bExp)
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // denormal actually
+
+return_PI_or_ZERO:
+
+ if (aSign) /* return PI */
+ return softfloat_roundPackToExtF80(bSign, FLOATX80_PI_EXP, FLOAT_PI_HI, FLOAT_PI_LO, 80);
+ else /* return 0 */
+ return packToExtF80(bSign, 0, 0);
+ }
+ if (! bExp)
+ {
+ if (! bSig) {
+ if (aSig && ! aExp)
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // denormal actually
+
+ goto return_PI_or_ZERO;
+ }
+
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // denormal actually
+ struct exp32_sig64 normExpSig = softfloat_normSubnormalExtF80Sig(bSig);
+ bExp = normExpSig.exp + 1;
+ bSig = normExpSig.sig;
+ }
+ if (! aExp)
+ {
+ if (! aSig) /* return PI/2 */
+ return softfloat_roundPackToExtF80(bSign, FLOATX80_PI2_EXP, FLOAT_PI_HI, FLOAT_PI_LO, 80);
+
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // denormal actually
+ struct exp32_sig64 normExpSig = softfloat_normSubnormalExtF80Sig(aSig);
+ aExp = normExpSig.exp + 1;
+ aSig = normExpSig.sig;
+ }
+
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+
+ /* |a| = |b| ==> return PI/4 */
+ if (aSig == bSig && aExp == bExp) {
+ if (aSign)
+ return softfloat_roundPackToExtF80(bSign, FLOATX80_3PI4_EXP, FLOAT_3PI4_HI, FLOAT_3PI4_LO, 80);
+ else
+ return softfloat_roundPackToExtF80(bSign, FLOATX80_PI4_EXP, FLOAT_PI_HI, FLOAT_PI_LO, 80);
+ }
+
+ /* ******************************** */
+ /* using float128 for approximation */
+ /* ******************************** */
+
+ float128_t a128 = softfloat_normRoundPackToF128(0, aExp-0x10, aSig, 0);
+ float128_t b128 = softfloat_normRoundPackToF128(0, bExp-0x10, bSig, 0);
+ float128_t x;
+ int swap = 0, add_pi6 = 0, add_pi4 = 0;
+
+ if (aExp > bExp || (aExp == bExp && aSig > bSig))
+ {
+ x = f128_div(b128, a128);
+ }
+ else {
+ x = f128_div(a128, b128);
+ swap = 1;
+ }
+
+ int32_t xExp = expF128UI64(x.v[1]);
+
+ if (xExp <= FLOATX80_EXP_BIAS-40)
+ goto approximation_completed;
+
+ if (x.v[1] >= uint64_t(0x3ffe800000000000)) // 3/4 < x < 1
+ {
+ /*
+ arctan(x) = arctan((x-1)/(x+1)) + pi/4
+ */
+ float128_t t1 = f128_sub(x, float128_one);
+ float128_t t2 = f128_add(x, float128_one);
+ x = f128_div(t1, t2);
+ add_pi4 = 1;
+ }
+ else
+ {
+ /* argument correction */
+ if (xExp >= 0x3FFD) // 1/4 < x < 3/4
+ {
+ /*
+ arctan(x) = arctan((x*sqrt(3)-1)/(x+sqrt(3))) + pi/6
+ */
+ float128_t t1 = f128_mul(x, float128_sqrt3);
+ float128_t t2 = f128_add(x, float128_sqrt3);
+ x = f128_sub(t1, float128_one);
+ x = f128_div(x, t2);
+ add_pi6 = 1;
+ }
+ }
+
+ x = poly_atan(x);
+ if (add_pi6) x = f128_add(x, float128_pi6);
+ if (add_pi4) x = f128_add(x, float128_pi4);
+
+approximation_completed:
+ if (swap) x = f128_sub(float128_pi2, x);
+ extFloat80_t result = f128_to_extF80(x);
+ if (zSign) floatx80_chs(result);
+ int rSign = extF80_sign(result);
+ if (!bSign && rSign)
+ return extF80_add(result, floatx80_pi);
+ if (bSign && !rSign)
+ return extF80_sub(result, floatx80_pi);
+ return result;
+}
+
+extFloat80_t packToExtF80(uint16_t signExp, uint64_t sig)
+{
+ extFloat80_t z;
+ z.signExp = signExp;
+ z.signif = sig;
+ return z;
+}
+
+extFloat80_t packToExtF80(bool sign, uint16_t exp, uint64_t sig)
+{
+ extFloat80_t z;
+ z.signExp = packToExtF80UI64(sign, exp);
+ z.signif = sig;
+ return z;
+}
+
+extFloat80_t extFloat80_68katan(extFloat80_t a)
+{
+ return extFloat80_atan(a, floatx80_one);
+}
+
+int extFloat80_is_nan(extFloat80_t a)
+{
+ return ((a.signExp & 0x7FFF) == 0x7FFF) && (int64_t)(a.signif << 1);
+}
diff --git a/3rdparty/softfloat3/bochs_ext/fprem.c b/3rdparty/softfloat3/bochs_ext/fprem.c
new file mode 100644
index 00000000000..16f6cccbc49
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/fprem.c
@@ -0,0 +1,255 @@
+/*============================================================================
+This source file is an extension to the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b, written for Bochs (x86 achitecture simulator)
+floating point emulation.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+=============================================================================*/
+
+/*============================================================================
+ * Written for Bochs (x86 achitecture simulator) by
+ * Stanislav Shwartsman [sshwarts at sourceforge net]
+ * ==========================================================================*/
+
+#define USE_estimateDiv128To64
+#define FLOAT128
+
+#include <stdint.h>
+
+#include "../build/MAME/platform.h"
+#include "../source/include/internals.h"
+#include "../source/include/softfloat.h"
+
+#include "../source/8086/specialize.h"
+
+#include "fpu_constant.h"
+#include "softfloat-extra.h"
+#include "softfloat-helpers.h"
+#include "softfloat-specialize.h"
+
+/* executes single exponent reduction cycle */
+static uint64_t remainder_kernel(uint64_t aSig0, uint64_t bSig, int expDiff, uint64_t *zSig0, uint64_t *zSig1)
+{
+ uint128 term, z;
+ uint64_t aSig1 = 0;
+ shortShift128Left(aSig1, aSig0, expDiff, &aSig1, &aSig0);
+ uint64_t q = estimateDiv128To64(aSig1, aSig0, bSig);
+ term = softfloat_mul64To128(bSig, q);
+ z = softfloat_sub128(aSig1, aSig0, term.v64, term.v0);
+ while ((int64_t) z.v64 < 0) {
+ --q;
+ z = softfloat_add128(z.v64, z.v0, 0, bSig);
+ }
+ *zSig0 = z.v0;
+ *zSig1 = z.v64;
+ return q;
+}
+
+static int do_fprem(extFloat80_t a, extFloat80_t b, extFloat80_t &r, uint64_t &q, int rounding_mode)
+{
+ int32_t aExp, bExp, zExp, expDiff;
+ uint64_t aSig0, aSig1 = 0, bSig;
+ int aSign;
+ struct exp32_sig64 normExpSig;
+ uint128 term;
+
+ q = 0;
+
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a) || extF80_isUnsupported(b)) {
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ r = floatx80_default_nan;
+ return -1;
+ }
+
+ aSig0 = extF80_fraction(a);
+ aExp = extF80_exp(a);
+ aSign = extF80_sign(a);
+ bSig = extF80_fraction(b);
+ bExp = extF80_exp(b);
+
+ if (aExp == 0x7FFF) {
+ if ((aSig0<<1) || ((bExp == 0x7FFF) && (bSig<<1))) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, a.signif, b.signExp, b.signif);
+ r.signExp = nan.v64;
+ r.signif = nan.v0;
+ return -1;
+ }
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ r = floatx80_default_nan;
+ return -1;
+ }
+ if (bExp == 0x7FFF) {
+ if (bSig << 1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, a.signif, b.signExp, b.signif);
+ r.signExp = nan.v64;
+ r.signif = nan.v0;
+ return -1;
+ }
+ if (! aExp && aSig0) {
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ normExpSig = softfloat_normSubnormalExtF80Sig(aSig0);
+ aExp = normExpSig.exp + 1;
+ aSig0 = normExpSig.sig;
+ r = (a.signif & uint64_t(0x8000000000000000)) ? packToExtF80(aSign, aExp, aSig0) : a;
+ return 0;
+ }
+ r = a;
+ return 0;
+
+ }
+ if (! bExp) {
+ if (! bSig) {
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ r = floatx80_default_nan;
+ return -1;
+ }
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ normExpSig = softfloat_normSubnormalExtF80Sig(bSig);
+ bExp = normExpSig.exp + 1;
+ bSig = normExpSig.sig;
+ }
+ if (! aExp) {
+ if (! aSig0) {
+ r = a;
+ return 0;
+ }
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ normExpSig = softfloat_normSubnormalExtF80Sig(aSig0);
+ aExp = normExpSig.exp + 1;
+ aSig0 = normExpSig.sig;
+ }
+
+ expDiff = aExp - bExp;
+ int overflow = 0;
+
+ if (expDiff >= 64) {
+ int n = (expDiff & 0x1f) | 0x20;
+ remainder_kernel(aSig0, bSig, n, &aSig0, &aSig1);
+ zExp = aExp - n;
+ overflow = 1;
+ }
+ else {
+ zExp = bExp;
+
+ if (expDiff < 0) {
+ if (expDiff < -1) {
+ r = (a.signif & uint64_t(0x8000000000000000)) ? packToExtF80(aSign, aExp, aSig0) : a;
+ return 0;
+ }
+ shortShift128Right(aSig0, 0, 1, &aSig0, &aSig1);
+ expDiff = 0;
+ }
+
+ if (expDiff > 0) {
+ q = remainder_kernel(aSig0, bSig, expDiff, &aSig0, &aSig1);
+ }
+ else {
+ if (bSig <= aSig0) {
+ aSig0 -= bSig;
+ q = 1;
+ }
+ }
+
+ if (rounding_mode == softfloat_round_near_even) {
+ uint64_t term0, term1;
+ shortShift128Right(bSig, 0, 1, &term0, &term1);
+
+ if (! softfloat_lt128(aSig0, aSig1, term0, term1)) {
+ int lt = softfloat_lt128(term0, term1, aSig0, aSig1);
+ int eq = softfloat_eq128(aSig0, aSig1, term0, term1);
+
+ if ((eq && (q & 1)) || lt) {
+ aSign = !aSign;
+ ++q;
+ }
+ if (lt) {
+ term = softfloat_sub128(bSig, 0, aSig0, aSig1);
+ aSig0 = term.v64;
+ aSig1 = term.v0;
+ }
+ }
+ }
+ }
+
+ r = softfloat_normRoundPackToExtF80(aSign, zExp, aSig0, aSig1, 80);
+ return overflow;
+}
+
+/*----------------------------------------------------------------------------
+| Returns the remainder of the extended double-precision floating-point value
+| `a' with respect to the corresponding value `b'. The operation is performed
+| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+
+int extFloat80_ieee754_remainder(extFloat80_t a, extFloat80_t b, extFloat80_t &r, uint64_t &q)
+{
+ return do_fprem(a, b, r, q, softfloat_round_near_even);
+}
+
+/*----------------------------------------------------------------------------
+| Returns the remainder of the extended double-precision floating-point value
+| `a' with respect to the corresponding value `b'. Unlike previous function
+| the function does not compute the remainder specified in the IEC/IEEE
+| Standard for Binary Floating-Point Arithmetic. This function operates
+| differently from the previous function in the way that it rounds the
+| quotient of 'a' divided by 'b' to an integer.
+*----------------------------------------------------------------------------*/
+
+int extFloat80_remainder(extFloat80_t a, extFloat80_t b, extFloat80_t &r, uint64_t &q)
+{
+ return do_fprem(a, b, r, q, softfloat_round_minMag);
+}
+
+static extFloat80_t propagateFloatx80NaNOneArg(extFloat80_t a)
+{
+ a.signif |= uint64_t(0x4000000000000000);
+ return a;
+}
+
+extFloat80_t extFloat80_getman(extFloat80_t a)
+{
+ const int aSign = (a.signExp >> 15);
+ int32_t aExp = a.signExp & 0x7fff;
+ uint64_t aFrac = a.signif;
+
+ if (aExp == 0x7fff)
+ {
+ if ((uint64_t)(aFrac << 1))
+ {
+ return propagateFloatx80NaNOneArg(a);
+ }
+
+ softfloat_raiseFlags(softfloat_flag_invalid);
+ return floatx80_default_nan;
+ }
+
+ if (!aExp)
+ {
+ if (!aSign)
+ {
+ return packFloatx80(aSign, 0, 0);
+ }
+ else
+ {
+ // normalize the subnormal value
+ const int leadingZeroes = softfloat_countLeadingZeros64(aFrac);
+ aFrac = aFrac << leadingZeroes;
+ aExp = -leadingZeroes;
+ }
+ }
+
+ return packFloatx80(aSign, 0x3fff, aFrac);
+}
diff --git a/3rdparty/softfloat3/bochs_ext/fpu_constant.h b/3rdparty/softfloat3/bochs_ext/fpu_constant.h
new file mode 100644
index 00000000000..827dbdec514
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/fpu_constant.h
@@ -0,0 +1,80 @@
+/*============================================================================
+This source file is an extension to the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b, written for Bochs (x86 achitecture simulator)
+floating point emulation.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+=============================================================================*/
+
+#ifndef _FPU_CONSTANTS_H_
+#define _FPU_CONSTANTS_H_
+
+// Pentium CPU uses only 68-bit precision M_PI approximation
+// #define BETTER_THAN_PENTIUM
+
+/*============================================================================
+ * Written for Bochs (x86 achitecture simulator) by
+ * Stanislav Shwartsman [sshwarts at sourceforge net]
+ * ==========================================================================*/
+
+//////////////////////////////
+// PI, PI/2, PI/4 constants
+//////////////////////////////
+
+#define FLOATX80_PI_EXP (0x4000)
+
+// 128-bit PI fraction
+#ifdef BETTER_THAN_PENTIUM
+#define FLOAT_PI_HI (uint64_t(0xc90fdaa22168c234))
+#define FLOAT_PI_LO (uint64_t(0xc4c6628b80dc1cd1))
+#else
+#define FLOAT_PI_HI (uint64_t(0xc90fdaa22168c234))
+#define FLOAT_PI_LO (uint64_t(0xC000000000000000))
+#endif
+
+#define FLOATX80_PI2_EXP (0x3FFF)
+#define FLOATX80_PI4_EXP (0x3FFE)
+
+//////////////////////////////
+// 3PI/4 constant
+//////////////////////////////
+
+#define FLOATX80_3PI4_EXP (0x4000)
+
+// 128-bit 3PI/4 fraction
+#ifdef BETTER_THAN_PENTIUM
+#define FLOAT_3PI4_HI (uint64_t(0x96cbe3f9990e91a7))
+#define FLOAT_3PI4_LO (uint64_t(0x9394c9e8a0a5159c))
+#else
+#define FLOAT_3PI4_HI (uint64_t(0x96cbe3f9990e91a7))
+#define FLOAT_3PI4_LO (uint64_t(0x9000000000000000))
+#endif
+
+//////////////////////////////
+// 1/LN2 constant
+//////////////////////////////
+
+#define FLOAT_LN2INV_EXP (0x3FFF)
+
+// 128-bit 1/LN2 fraction
+#ifdef BETTER_THAN_PENTIUM
+#define FLOAT_LN2INV_HI (uint64_t(0xb8aa3b295c17f0bb))
+#define FLOAT_LN2INV_LO (uint64_t(0xbe87fed0691d3e89))
+#else
+#define FLOAT_LN2INV_HI (uint64_t(0xb8aa3b295c17f0bb))
+#define FLOAT_LN2INV_LO (uint64_t(0xC000000000000000))
+#endif
+
+#endif
diff --git a/3rdparty/softfloat3/bochs_ext/fsincos.c b/3rdparty/softfloat3/bochs_ext/fsincos.c
new file mode 100644
index 00000000000..303d66cc5b8
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/fsincos.c
@@ -0,0 +1,457 @@
+/*============================================================================
+This source file is an extension to the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b, written for Bochs (x86 achitecture simulator)
+floating point emulation.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+=============================================================================*/
+
+/*============================================================================
+ * Written for Bochs (x86 achitecture simulator) by
+ * Stanislav Shwartsman [sshwarts at sourceforge net]
+ * ==========================================================================*/
+
+#define FLOAT128
+
+#define USE_estimateDiv128To64
+#define FLOAT128
+
+#include "../build/MAME/platform.h"
+#include "../source/include/internals.h"
+#include "../source/include/softfloat.h"
+
+#include "../source/8086/specialize.h"
+
+#include "fpu_constant.h"
+#include "softfloat-extra.h"
+#include "softfloat-helpers.h"
+#include "softfloat-specialize.h"
+
+static const extFloat80_t floatx80_one = packFloatx80(0, 0x3fff, uint64_t(0x8000000000000000));
+
+/* reduce trigonometric function argument using 128-bit precision
+ M_PI approximation */
+static uint64_t argument_reduction_kernel(uint64_t aSig0, int Exp, uint64_t *zSig0, uint64_t *zSig1)
+{
+ uint64_t term0, term1, term2;
+ uint64_t aSig1 = 0;
+
+ shortShift128Left(aSig1, aSig0, Exp, &aSig1, &aSig0);
+ uint64_t q = estimateDiv128To64(aSig1, aSig0, FLOAT_PI_HI);
+ mul128By64To192(FLOAT_PI_HI, FLOAT_PI_LO, q, &term0, &term1, &term2);
+ sub128(aSig1, aSig0, term0, term1, zSig1, zSig0);
+ while ((int64_t)(*zSig1) < 0) {
+ --q;
+ add192(*zSig1, *zSig0, term2, 0, FLOAT_PI_HI, FLOAT_PI_LO, zSig1, zSig0, &term2);
+ }
+ *zSig1 = term2;
+ return q;
+}
+
+static int reduce_trig_arg(int expDiff, int &zSign, uint64_t &aSig0, uint64_t &aSig1)
+{
+ uint64_t term0, term1, q = 0;
+
+ if (expDiff < 0) {
+ shortShift128Right(aSig0, 0, 1, &aSig0, &aSig1);
+ expDiff = 0;
+ }
+ if (expDiff > 0) {
+ q = argument_reduction_kernel(aSig0, expDiff, &aSig0, &aSig1);
+ }
+ else {
+ if (FLOAT_PI_HI <= aSig0) {
+ aSig0 -= FLOAT_PI_HI;
+ q = 1;
+ }
+ }
+
+ shortShift128Right(FLOAT_PI_HI, FLOAT_PI_LO, 1, &term0, &term1);
+ if (! softfloat_lt128(aSig0, aSig1, term0, term1))
+ {
+ int lt = softfloat_lt128(term0, term1, aSig0, aSig1);
+ int eq = softfloat_eq128(aSig0, aSig1, term0, term1);
+
+ if ((eq && (q & 1)) || lt) {
+ zSign = !zSign;
+ ++q;
+ }
+ if (lt) sub128(FLOAT_PI_HI, FLOAT_PI_LO, aSig0, aSig1, &aSig0, &aSig1);
+ }
+
+ return (int)(q & 3);
+}
+
+#define SIN_ARR_SIZE 11
+#define COS_ARR_SIZE 11
+
+static float128_t sin_arr[SIN_ARR_SIZE] =
+{
+ PACK_FLOAT_128(0x3fff000000000000, 0x0000000000000000), /* 1 */
+ PACK_FLOAT_128(0xbffc555555555555, 0x5555555555555555), /* 3 */
+ PACK_FLOAT_128(0x3ff8111111111111, 0x1111111111111111), /* 5 */
+ PACK_FLOAT_128(0xbff2a01a01a01a01, 0xa01a01a01a01a01a), /* 7 */
+ PACK_FLOAT_128(0x3fec71de3a556c73, 0x38faac1c88e50017), /* 9 */
+ PACK_FLOAT_128(0xbfe5ae64567f544e, 0x38fe747e4b837dc7), /* 11 */
+ PACK_FLOAT_128(0x3fde6124613a86d0, 0x97ca38331d23af68), /* 13 */
+ PACK_FLOAT_128(0xbfd6ae7f3e733b81, 0xf11d8656b0ee8cb0), /* 15 */
+ PACK_FLOAT_128(0x3fce952c77030ad4, 0xa6b2605197771b00), /* 17 */
+ PACK_FLOAT_128(0xbfc62f49b4681415, 0x724ca1ec3b7b9675), /* 19 */
+ PACK_FLOAT_128(0x3fbd71b8ef6dcf57, 0x18bef146fcee6e45) /* 21 */
+};
+
+static float128_t cos_arr[COS_ARR_SIZE] =
+{
+ PACK_FLOAT_128(0x3fff000000000000, 0x0000000000000000), /* 0 */
+ PACK_FLOAT_128(0xbffe000000000000, 0x0000000000000000), /* 2 */
+ PACK_FLOAT_128(0x3ffa555555555555, 0x5555555555555555), /* 4 */
+ PACK_FLOAT_128(0xbff56c16c16c16c1, 0x6c16c16c16c16c17), /* 6 */
+ PACK_FLOAT_128(0x3fefa01a01a01a01, 0xa01a01a01a01a01a), /* 8 */
+ PACK_FLOAT_128(0xbfe927e4fb7789f5, 0xc72ef016d3ea6679), /* 10 */
+ PACK_FLOAT_128(0x3fe21eed8eff8d89, 0x7b544da987acfe85), /* 12 */
+ PACK_FLOAT_128(0xbfda93974a8c07c9, 0xd20badf145dfa3e5), /* 14 */
+ PACK_FLOAT_128(0x3fd2ae7f3e733b81, 0xf11d8656b0ee8cb0), /* 16 */
+ PACK_FLOAT_128(0xbfca6827863b97d9, 0x77bb004886a2c2ab), /* 18 */
+ PACK_FLOAT_128(0x3fc1e542ba402022, 0x507a9cad2bf8f0bb) /* 20 */
+};
+
+extern float128_t OddPoly (float128_t x, const float128_t *arr, int n);
+
+/* 0 <= x <= pi/4 */
+inline float128_t poly_sin(float128_t x)
+{
+ // 3 5 7 9 11 13 15
+ // x x x x x x x
+ // sin (x) ~ x - --- + --- - --- + --- - ---- + ---- - ---- =
+ // 3! 5! 7! 9! 11! 13! 15!
+ //
+ // 2 4 6 8 10 12 14
+ // x x x x x x x
+ // = x * [ 1 - --- + --- - --- + --- - ---- + ---- - ---- ] =
+ // 3! 5! 7! 9! 11! 13! 15!
+ //
+ // 3 3
+ // -- 4k -- 4k+2
+ // p(x) = > C * x > 0 q(x) = > C * x < 0
+ // -- 2k -- 2k+1
+ // k=0 k=0
+ //
+ // 2
+ // sin(x) ~ x * [ p(x) + x * q(x) ]
+ //
+
+ return OddPoly(x, (const float128_t*) sin_arr, SIN_ARR_SIZE);
+}
+
+extern float128_t EvenPoly(float128_t x, const float128_t *arr, int n);
+
+/* 0 <= x <= pi/4 */
+inline float128_t poly_cos(float128_t x)
+{
+ // 2 4 6 8 10 12 14
+ // x x x x x x x
+ // cos (x) ~ 1 - --- + --- - --- + --- - ---- + ---- - ----
+ // 2! 4! 6! 8! 10! 12! 14!
+ //
+ // 3 3
+ // -- 4k -- 4k+2
+ // p(x) = > C * x > 0 q(x) = > C * x < 0
+ // -- 2k -- 2k+1
+ // k=0 k=0
+ //
+ // 2
+ // cos(x) ~ [ p(x) + x * q(x) ]
+ //
+
+ return EvenPoly(x, (const float128_t*) cos_arr, COS_ARR_SIZE);
+}
+
+inline void sincos_invalid(extFloat80_t *sin_a, extFloat80_t *cos_a, extFloat80_t a)
+{
+ if (sin_a) *sin_a = a;
+ if (cos_a) *cos_a = a;
+}
+
+inline void sincos_tiny_argument(extFloat80_t *sin_a, extFloat80_t *cos_a, extFloat80_t a)
+{
+ if (sin_a) *sin_a = a;
+ if (cos_a) *cos_a = floatx80_one;
+}
+
+static extFloat80_t sincos_approximation(int neg, float128_t r, uint64_t quotient)
+{
+ if (quotient & 0x1) {
+ r = poly_cos(r);
+ neg = 0;
+ } else {
+ r = poly_sin(r);
+ }
+
+ extFloat80_t result = f128_to_extF80(r);
+ if (quotient & 0x2)
+ neg = ! neg;
+
+ if (neg)
+ floatx80_chs(result);
+
+ return result;
+}
+
+// =================================================
+// FSINCOS Compute sin(x) and cos(x)
+// =================================================
+
+//
+// Uses the following identities:
+// ----------------------------------------------------------
+//
+// sin(-x) = -sin(x)
+// cos(-x) = cos(x)
+//
+// sin(x+y) = sin(x)*cos(y)+cos(x)*sin(y)
+// cos(x+y) = sin(x)*sin(y)+cos(x)*cos(y)
+//
+// sin(x+ pi/2) = cos(x)
+// sin(x+ pi) = -sin(x)
+// sin(x+3pi/2) = -cos(x)
+// sin(x+2pi) = sin(x)
+//
+
+int extFloat80_sincos(extFloat80_t a, extFloat80_t *sin_a, extFloat80_t *cos_a)
+{
+ uint64_t aSig0, aSig1 = 0;
+ int32_t aExp, zExp, expDiff;
+ int aSign, zSign;
+ int q = 0;
+
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a)) {
+ goto invalid;
+ }
+
+ aSig0 = extF80_fraction(a);
+ aExp = extF80_exp(a);
+ aSign = extF80_sign(a);
+
+ /* invalid argument */
+ if (aExp == 0x7FFF) {
+ if (aSig0 << 1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig0, 0, 0);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ sincos_invalid(sin_a, cos_a, rv);
+ return 0;
+ }
+
+ invalid:
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ sincos_invalid(sin_a, cos_a, floatx80_default_nan);
+ return 0;
+ }
+
+ if (! aExp) {
+ if (! aSig0) {
+ sincos_tiny_argument(sin_a, cos_a, a);
+ return 0;
+ }
+
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+
+ /* handle pseudo denormals */
+ if (! (aSig0 & uint64_t(0x8000000000000000)))
+ {
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+ if (sin_a)
+ softfloat_exceptionFlags |= softfloat_flag_underflow;
+ sincos_tiny_argument(sin_a, cos_a, a);
+ return 0;
+ }
+
+ struct exp32_sig64 normExpSig = softfloat_normSubnormalExtF80Sig(aSig0);
+ aExp = normExpSig.exp + 1;
+ aSig0 = normExpSig.sig;
+ }
+
+ zSign = aSign;
+ zExp = FLOATX80_EXP_BIAS;
+ expDiff = aExp - zExp;
+
+ /* argument is out-of-range */
+ if (expDiff >= 63)
+ return -1;
+
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+
+ if (expDiff < -1) { // doesn't require reduction
+ if (expDiff <= -68) {
+ a = packFloatx80(aSign, aExp, aSig0);
+ sincos_tiny_argument(sin_a, cos_a, a);
+ return 0;
+ }
+ zExp = aExp;
+ }
+ else {
+ q = reduce_trig_arg(expDiff, zSign, aSig0, aSig1);
+ }
+
+ /* **************************** */
+ /* argument reduction completed */
+ /* **************************** */
+
+ /* using float128 for approximation */
+ float128_t r = softfloat_normRoundPackToF128(0, zExp-0x10, aSig0, aSig1);
+
+ if (aSign) q = -q;
+ if (sin_a) *sin_a = sincos_approximation(zSign, r, q);
+ if (cos_a) *cos_a = sincos_approximation(zSign, r, q+1);
+
+ return 0;
+}
+
+int extFloat80_sin(extFloat80_t &a)
+{
+ return extFloat80_sincos(a, &a, 0);
+}
+
+int extFloat80_cos(extFloat80_t &a)
+{
+ return extFloat80_sincos(a, 0, &a);
+}
+
+// =================================================
+// FPTAN Compute tan(x)
+// =================================================
+
+//
+// Uses the following identities:
+//
+// 1. ----------------------------------------------------------
+//
+// sin(-x) = -sin(x)
+// cos(-x) = cos(x)
+//
+// sin(x+y) = sin(x)*cos(y)+cos(x)*sin(y)
+// cos(x+y) = sin(x)*sin(y)+cos(x)*cos(y)
+//
+// sin(x+ pi/2) = cos(x)
+// sin(x+ pi) = -sin(x)
+// sin(x+3pi/2) = -cos(x)
+// sin(x+2pi) = sin(x)
+//
+// 2. ----------------------------------------------------------
+//
+// sin(x)
+// tan(x) = ------
+// cos(x)
+//
+
+int extFloat80_tan(extFloat80_t &a)
+{
+ uint64_t aSig0, aSig1 = 0;
+ int32_t aExp, zExp, expDiff;
+ int aSign, zSign;
+ int q = 0;
+
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a)) {
+ goto invalid;
+ }
+
+ aSig0 = extF80_fraction(a);
+ aExp = extF80_exp(a);
+ aSign = extF80_sign(a);
+
+ /* invalid argument */
+ if (aExp == 0x7FFF) {
+ if (aSig0 << 1)
+ {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig0, 0, 0);
+ a.signExp = nan.v64;
+ a.signif = nan.v0;
+ return 0;
+ }
+
+ invalid:
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ a = floatx80_default_nan;
+ return 0;
+ }
+
+ if (! aExp) {
+ if (! aSig0) return 0;
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ /* handle pseudo denormals */
+ if (! (aSig0 & uint64_t(0x8000000000000000)))
+ {
+ softfloat_exceptionFlags |= softfloat_flag_inexact | softfloat_flag_underflow;
+ return 0;
+ }
+
+ struct exp32_sig64 normExpSig = softfloat_normSubnormalExtF80Sig(aSig0);
+ aExp = normExpSig.exp + 1;
+ aSig0 = normExpSig.sig;
+ }
+
+ zSign = aSign;
+ zExp = FLOATX80_EXP_BIAS;
+ expDiff = aExp - zExp;
+
+ /* argument is out-of-range */
+ if (expDiff >= 63)
+ return -1;
+
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+
+ if (expDiff < -1) { // doesn't require reduction
+ if (expDiff <= -68) {
+ a = packFloatx80(aSign, aExp, aSig0);
+ return 0;
+ }
+ zExp = aExp;
+ }
+ else {
+ q = reduce_trig_arg(expDiff, zSign, aSig0, aSig1);
+ }
+
+ /* **************************** */
+ /* argument reduction completed */
+ /* **************************** */
+
+ /* using float128 for approximation */
+ float128_t r = softfloat_normRoundPackToF128(0, zExp-0x10, aSig0, aSig1);
+
+ float128_t sin_r = poly_sin(r);
+ float128_t cos_r = poly_cos(r);
+
+ if (q & 0x1) {
+ r = f128_div(cos_r, sin_r);
+ zSign = ! zSign;
+ } else {
+ r = f128_div(sin_r, cos_r);
+ }
+
+ a = f128_to_extF80(r);
+ if (zSign)
+ floatx80_chs(a);
+
+ return 0;
+}
+
+extFloat80_t &floatx80_chs(extFloat80_t &reg)
+{
+ reg.signExp ^= 0x8000;
+ return reg;
+}
diff --git a/3rdparty/softfloat3/bochs_ext/fyl2x.c b/3rdparty/softfloat3/bochs_ext/fyl2x.c
new file mode 100644
index 00000000000..5b9f21bbf11
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/fyl2x.c
@@ -0,0 +1,409 @@
+/*============================================================================
+This source file is an extension to the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b, written for Bochs (x86 achitecture simulator)
+floating point emulation.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+=============================================================================*/
+
+/*============================================================================
+ * Written for Bochs (x86 achitecture simulator) by
+ * Stanislav Shwartsman [sshwarts at sourceforge net]
+ * ==========================================================================*/
+
+#define FLOAT128
+
+#include "../build/MAME/platform.h"
+#include "../source/include/internals.h"
+#include "../source/include/softfloat.h"
+
+#include "fpu_constant.h"
+#include "softfloat-extra.h"
+#include "softfloat-helpers.h"
+#include "softfloat-specialize.h"
+
+static const extFloat80_t floatx80_one = packFloatx80(0, 0x3fff, uint64_t(0x8000000000000000));
+static const extFloat80_t floatx80_ln_2 = packFloatx80(0, 0x3ffe, 0xb17217f7d1cf79acU);
+static const extFloat80_t floatx80_log10_2 = packFloatx80(0, 0x3ffd, 0x9a209a84fbcff798U);
+
+static const float128_t float128_one =
+ packFloat128(uint64_t(0x3fff000000000000), uint64_t(0x0000000000000000));
+static const float128_t float128_two =
+ packFloat128(uint64_t(0x4000000000000000), uint64_t(0x0000000000000000));
+
+static const float128_t float128_ln2inv2 =
+ packFloat128(uint64_t(0x400071547652b82f), uint64_t(0xe1777d0ffda0d23a));
+
+#define SQRT2_HALF_SIG uint64_t(0xb504f333f9de6484)
+
+extern float128_t OddPoly(float128_t x, const float128_t *arr, int n);
+
+#define L2_ARR_SIZE 9
+
+static float128_t ln_arr[L2_ARR_SIZE] =
+{
+ PACK_FLOAT_128(0x3fff000000000000, 0x0000000000000000), /* 1 */
+ PACK_FLOAT_128(0x3ffd555555555555, 0x5555555555555555), /* 3 */
+ PACK_FLOAT_128(0x3ffc999999999999, 0x999999999999999a), /* 5 */
+ PACK_FLOAT_128(0x3ffc249249249249, 0x2492492492492492), /* 7 */
+ PACK_FLOAT_128(0x3ffbc71c71c71c71, 0xc71c71c71c71c71c), /* 9 */
+ PACK_FLOAT_128(0x3ffb745d1745d174, 0x5d1745d1745d1746), /* 11 */
+ PACK_FLOAT_128(0x3ffb3b13b13b13b1, 0x3b13b13b13b13b14), /* 13 */
+ PACK_FLOAT_128(0x3ffb111111111111, 0x1111111111111111), /* 15 */
+ PACK_FLOAT_128(0x3ffae1e1e1e1e1e1, 0xe1e1e1e1e1e1e1e2) /* 17 */
+};
+
+static float128_t poly_ln(float128_t x1)
+{
+/*
+ //
+ // 3 5 7 9 11 13 15
+ // 1+u u u u u u u u
+ // 1/2 ln --- ~ u + --- + --- + --- + --- + ---- + ---- + ---- =
+ // 1-u 3 5 7 9 11 13 15
+ //
+ // 2 4 6 8 10 12 14
+ // u u u u u u u
+ // = u * [ 1 + --- + --- + --- + --- + ---- + ---- + ---- ] =
+ // 3 5 7 9 11 13 15
+ //
+ // 3 3
+ // -- 4k -- 4k+2
+ // p(u) = > C * u q(u) = > C * u
+ // -- 2k -- 2k+1
+ // k=0 k=0
+ //
+ // 1+u 2
+ // 1/2 ln --- ~ u * [ p(u) + u * q(u) ]
+ // 1-u
+ //
+*/
+ return OddPoly(x1, (const float128_t*) ln_arr, L2_ARR_SIZE);
+}
+
+/* required sqrt(2)/2 < x < sqrt(2) */
+static float128_t poly_l2(float128_t x)
+{
+ /* using float128 for approximation */
+ float128_t x_p1 = f128_add(x, float128_one);
+ float128_t x_m1 = f128_sub(x, float128_one);
+ x = f128_div(x_m1, x_p1);
+ x = poly_ln(x);
+ x = f128_mul(x, float128_ln2inv2);
+ return x;
+}
+
+static float128_t poly_l2p1(float128_t x)
+{
+ /* using float128 for approximation */
+ float128_t x_plus2 = f128_add(x, float128_two);
+ x = f128_div(x, x_plus2);
+ x = poly_ln(x);
+ x = f128_mul(x, float128_ln2inv2);
+ return x;
+}
+
+// =================================================
+// FYL2X Compute y * log (x)
+// 2
+// =================================================
+
+//
+// Uses the following identities:
+//
+// 1. ----------------------------------------------------------
+// ln(x)
+// log (x) = -------, ln (x*y) = ln(x) + ln(y)
+// 2 ln(2)
+//
+// 2. ----------------------------------------------------------
+// 1+u x-1
+// ln (x) = ln -----, when u = -----
+// 1-u x+1
+//
+// 3. ----------------------------------------------------------
+// 3 5 7 2n+1
+// 1+u u u u u
+// ln ----- = 2 [ u + --- + --- + --- + ... + ------ + ... ]
+// 1-u 3 5 7 2n+1
+//
+
+extFloat80_t extFloat80_fyl2x(extFloat80_t a, extFloat80_t b)
+{
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a) || extF80_isUnsupported(b)) {
+invalid:
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ return floatx80_default_nan;
+ }
+
+ uint64_t aSig = extF80_fraction(a);
+ int32_t aExp = extF80_exp(a);
+ int aSign = extF80_sign(a);
+ uint64_t bSig = extF80_fraction(b);
+ int32_t bExp = extF80_exp(b);
+ int bSign = extF80_sign(b);
+
+ int zSign = bSign ^ 1;
+
+ if (aExp == 0x7FFF) {
+ if ((aSig<<1) || ((bExp == 0x7FFF) && (bSig<<1))) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, b.signExp, bSig);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+ if (aSign) goto invalid;
+ else {
+ if (! bExp) {
+ if (! bSig) goto invalid;
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ }
+ return packFloatx80(bSign, 0x7FFF, uint64_t(0x8000000000000000));
+ }
+ }
+ if (bExp == 0x7FFF) {
+ if (bSig << 1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, b.signExp, bSig);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+ if (aSign && (uint64_t)(aExp | aSig)) goto invalid;
+ if (aSig && ! aExp)
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ if (aExp < 0x3FFF)
+ {
+ return packFloatx80(zSign, 0x7FFF, uint64_t(0x8000000000000000));
+ }
+ if (aExp == 0x3FFF && ! (aSig<<1)) goto invalid;
+ return packFloatx80(bSign, 0x7FFF, uint64_t(0x8000000000000000));
+ }
+ if (! aExp) {
+ if (! aSig) {
+ if ((bExp | bSig) == 0) goto invalid;
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // divide by zero
+ return packFloatx80(zSign, 0x7FFF, uint64_t(0x8000000000000000));
+ }
+ if (aSign) goto invalid;
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ struct exp32_sig64 normExpSig = softfloat_normSubnormalExtF80Sig(aSig);
+ aExp = normExpSig.exp + 1;
+ aSig = normExpSig.sig;
+ }
+ if (aSign) goto invalid;
+ if (! bExp) {
+ if (! bSig) {
+ if (aExp < 0x3FFF) return packFloatx80(zSign, 0, 0);
+ return packFloatx80(bSign, 0, 0);
+ }
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ struct exp32_sig64 normExpSig = softfloat_normSubnormalExtF80Sig(bSig);
+ bExp = normExpSig.exp + 1;
+ bSig = normExpSig.sig;
+ }
+ if (aExp == 0x3FFF && ! (aSig<<1))
+ return packFloatx80(bSign, 0, 0);
+
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+
+ int ExpDiff = aExp - 0x3FFF;
+ aExp = 0;
+ if (aSig >= SQRT2_HALF_SIG) {
+ ExpDiff++;
+ aExp--;
+ }
+
+ /* ******************************** */
+ /* using float128 for approximation */
+ /* ******************************** */
+
+ float128_t b128 = softfloat_normRoundPackToF128(bSign, bExp-0x10, bSig, 0);
+
+ uint64_t zSig0, zSig1;
+ shortShift128Right(aSig<<1, 0, 16, &zSig0, &zSig1);
+ float128_t x = packFloat128(0, aExp+0x3FFF, zSig0, zSig1);
+ x = poly_l2(x);
+ x = f128_add(x, i32_to_f128(ExpDiff));
+ x = f128_mul(x, b128);
+ return f128_to_extF80(x);
+}
+
+// =================================================
+// FYL2XP1 Compute y * log (x + 1)
+// 2
+// =================================================
+
+//
+// Uses the following identities:
+//
+// 1. ----------------------------------------------------------
+// ln(x)
+// log (x) = -------
+// 2 ln(2)
+//
+// 2. ----------------------------------------------------------
+// 1+u x
+// ln (x+1) = ln -----, when u = -----
+// 1-u x+2
+//
+// 3. ----------------------------------------------------------
+// 3 5 7 2n+1
+// 1+u u u u u
+// ln ----- = 2 [ u + --- + --- + --- + ... + ------ + ... ]
+// 1-u 3 5 7 2n+1
+//
+
+extFloat80_t extFloat80_fyl2xp1(extFloat80_t a, extFloat80_t b)
+{
+ int32_t aExp, bExp;
+ uint64_t aSig, bSig, zSig0, zSig1, zSig2;
+ int aSign, bSign;
+
+ // handle unsupported extended double-precision floating encodings
+ if (extF80_isUnsupported(a) || extF80_isUnsupported(b)) {
+invalid:
+ softfloat_exceptionFlags |= softfloat_flag_invalid;
+ return floatx80_default_nan;
+ }
+
+
+ aSig = extF80_fraction(a);
+ aExp = extF80_exp(a);
+ aSign = extF80_sign(a);
+ bSig = extF80_fraction(b);
+ bExp = extF80_exp(b);
+ bSign = extF80_sign(b);
+ int zSign = aSign ^ bSign;
+
+ if (aExp == 0x7FFF) {
+ if ((aSig<<1) != 0 || ((bExp == 0x7FFF) && (bSig<<1) != 0)) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, b.signExp, bSig);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+ if (aSign) goto invalid;
+ else {
+ if (! bExp) {
+ if (! bSig) goto invalid;
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ }
+ return packFloatx80(bSign, 0x7FFF, uint64_t(0x8000000000000000));
+ }
+ }
+ if (bExp == 0x7FFF)
+ {
+ if (bSig << 1) {
+ const uint128 nan = softfloat_propagateNaNExtF80UI(a.signExp, aSig, b.signExp, bSig);
+ extFloat80_t rv;
+ rv.signExp = nan.v64;
+ rv.signif = nan.v0;
+ return rv;
+ }
+ if (! aExp) {
+ if (! aSig) goto invalid;
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ }
+
+ return packFloatx80(zSign, 0x7FFF, uint64_t(0x8000000000000000));
+ }
+ if (! aExp) {
+ if (! aSig) {
+ if (bSig && ! bExp)
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+
+ return packFloatx80(zSign, 0, 0);
+ }
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ struct exp32_sig64 normExpSig = softfloat_normSubnormalExtF80Sig(aSig);
+ aExp = normExpSig.exp + 1;
+ aSig = normExpSig.sig;
+ }
+ if (! bExp) {
+ if (! bSig) return packFloatx80(zSign, 0, 0);
+ softfloat_exceptionFlags |= softfloat_flag_invalid; // actually denormal
+ struct exp32_sig64 normExpSig = softfloat_normSubnormalExtF80Sig(bSig);
+ bExp = normExpSig.exp + 1;
+ bSig = normExpSig.sig;
+ }
+
+ softfloat_exceptionFlags |= softfloat_flag_inexact;
+
+ if (aSign && aExp >= 0x3FFF)
+ return a;
+
+ if (aExp >= 0x3FFC) // big argument
+ {
+ return extFloat80_fyl2x(extF80_add(a, floatx80_one), b);
+ }
+
+ // handle tiny argument
+ if (aExp < FLOATX80_EXP_BIAS-70)
+ {
+ // first order approximation, return (a*b)/ln(2)
+ int32_t zExp = aExp + FLOAT_LN2INV_EXP - 0x3FFE;
+
+ mul128By64To192(FLOAT_LN2INV_HI, FLOAT_LN2INV_LO, aSig, &zSig0, &zSig1, &zSig2);
+ if (0 < (int64_t) zSig0) {
+ shortShift128Left(zSig0, zSig1, 1, &zSig0, &zSig1);
+ --zExp;
+ }
+
+ zExp = zExp + bExp - 0x3FFE;
+ mul128By64To192(zSig0, zSig1, bSig, &zSig0, &zSig1, &zSig2);
+ if (0 < (int64_t) zSig0) {
+ shortShift128Left(zSig0, zSig1, 1, &zSig0, &zSig1);
+ --zExp;
+ }
+
+ return softfloat_roundPackToExtF80(aSign ^ bSign, zExp, zSig0, zSig1, 80);
+ }
+
+ /* ******************************** */
+ /* using float128 for approximation */
+ /* ******************************** */
+
+ float128_t b128 = softfloat_normRoundPackToF128(bSign, bExp-0x10, bSig, 0);
+
+ shortShift128Right(aSig<<1, 0, 16, &zSig0, &zSig1);
+ float128_t x = packFloat128(aSign, aExp, zSig0, zSig1);
+ x = poly_l2p1(x);
+ x = f128_mul(x, b128);
+ return f128_to_extF80(x);
+}
+
+extFloat80_t extFloat80_lognp1(extFloat80_t a)
+{
+ return extFloat80_fyl2x(a, floatx80_ln_2);
+}
+
+extFloat80_t extFloat80_logn(extFloat80_t a)
+{
+ return extFloat80_fyl2x(a, floatx80_ln_2);
+}
+
+extFloat80_t extFloat80_log2(extFloat80_t a)
+{
+ return extFloat80_fyl2x(a, floatx80_one);
+}
+
+extFloat80_t extFloat80_log10(extFloat80_t a)
+{
+ return extFloat80_fyl2x(a, floatx80_log10_2);
+}
diff --git a/3rdparty/softfloat3/bochs_ext/poly.c b/3rdparty/softfloat3/bochs_ext/poly.c
new file mode 100644
index 00000000000..3498e29ec4d
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/poly.c
@@ -0,0 +1,91 @@
+/*============================================================================
+This source file is an extension to the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b, written for Bochs (x86 achitecture simulator)
+floating point emulation.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+=============================================================================*/
+
+/*============================================================================
+ * Written for Bochs (x86 achitecture simulator) by
+ * Stanislav Shwartsman [sshwarts at sourceforge net]
+ * ==========================================================================*/
+
+#include <assert.h>
+
+#include "../source/include/softfloat.h"
+
+// 2 3 4 n
+// f(x) ~ C + (C * x) + (C * x) + (C * x) + (C * x) + ... + (C * x)
+// 0 1 2 3 4 n
+//
+// -- 2k -- 2k+1
+// p(x) = > C * x q(x) = > C * x
+// -- 2k -- 2k+1
+//
+// f(x) ~ [ p(x) + x * q(x) ]
+//
+
+float128_t EvalPoly(float128_t x, const float128_t *arr, int n)
+{
+ float128_t r = arr[--n];
+
+ do {
+ r = f128_mulAdd(r, x, arr[--n]);
+// r = f128_mul(r, x);
+// r = f128_add(r, arr[--n]);
+
+ } while (n > 0);
+
+ return r;
+}
+
+// 2 4 6 8 2n
+// f(x) ~ C + (C * x) + (C * x) + (C * x) + (C * x) + ... + (C * x)
+// 0 1 2 3 4 n
+//
+// -- 4k -- 4k+2
+// p(x) = > C * x q(x) = > C * x
+// -- 2k -- 2k+1
+//
+// 2
+// f(x) ~ [ p(x) + x * q(x) ]
+//
+
+float128_t EvenPoly(float128_t x, const float128_t *arr, int n)
+{
+ return EvalPoly(f128_mul(x, x), arr, n);
+}
+
+// 3 5 7 9 2n+1
+// f(x) ~ (C * x) + (C * x) + (C * x) + (C * x) + (C * x) + ... + (C * x)
+// 0 1 2 3 4 n
+// 2 4 6 8 2n
+// = x * [ C + (C * x) + (C * x) + (C * x) + (C * x) + ... + (C * x)
+// 0 1 2 3 4 n
+//
+// -- 4k -- 4k+2
+// p(x) = > C * x q(x) = > C * x
+// -- 2k -- 2k+1
+//
+// 2
+// f(x) ~ x * [ p(x) + x * q(x) ]
+//
+
+float128_t OddPoly(float128_t x, const float128_t *arr, int n)
+{
+ return f128_mul(x, EvenPoly(x, arr, n));
+}
+
diff --git a/3rdparty/softfloat3/bochs_ext/softfloat-extra.h b/3rdparty/softfloat3/bochs_ext/softfloat-extra.h
new file mode 100644
index 00000000000..087656e5a58
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/softfloat-extra.h
@@ -0,0 +1,68 @@
+/*============================================================================
+
+This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
+Package, Release 3e, by John R. Hauser.
+
+Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
+University of California. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions, and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions, and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. Neither the name of the University nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=============================================================================*/
+
+#ifndef softfloat_extra_h
+#define softfloat_extra_h 1
+
+#include "../source/include/internals.h"
+
+// ======= floatx80 ======= //
+
+inline bool extF80_isUnsupported(extFloat80_t a)
+{
+ return ((a.signExp & 0x7FFF) && !(a.signif & uint64_t(0x8000000000000000)));
+}
+
+inline bool extF80_sign(extFloat80_t a)
+{
+ return signExtF80UI64(a.signExp);
+}
+
+inline int16_t extF80_exp(extFloat80_t a)
+{
+ return expExtF80UI64(a.signExp);
+}
+
+inline uint64_t extF80_fraction(extFloat80_t a)
+{
+ return a.signif;
+}
+
+extFloat80_t &floatx80_chs(extFloat80_t &reg);
+
+extFloat80_t packToExtF80(uint16_t signExp, uint64_t sig);
+extFloat80_t packToExtF80(bool sign, uint16_t exp, uint64_t sig);
+
+#endif
diff --git a/3rdparty/softfloat3/bochs_ext/softfloat-helpers.h b/3rdparty/softfloat3/bochs_ext/softfloat-helpers.h
new file mode 100644
index 00000000000..b8833a126e6
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/softfloat-helpers.h
@@ -0,0 +1,159 @@
+/*============================================================================
+This source file is an extension to the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b, written for Bochs (x86 achitecture simulator)
+floating point emulation.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+=============================================================================*/
+
+/*============================================================================
+ * Adapted for Bochs (x86 achitecture simulator) by
+ * Stanislav Shwartsman [sshwarts at sourceforge net]
+ * ==========================================================================*/
+
+#ifndef _SOFTFLOAT_HELPERS_H_
+#define _SOFTFLOAT_HELPERS_H_
+
+#include <assert.h>
+#include <stdint.h>
+
+#include "../source/include/primitives.h"
+#include "../source/include/primitiveTypes.h"
+
+/*----------------------------------------------------------------------------
+| Multiplies the 128-bit value formed by concatenating `a0' and `a1' by
+| `b' to obtain a 192-bit product. The product is broken into three 64-bit
+| pieces which are stored at the locations pointed to by `z0Ptr', `z1Ptr', and
+| `z2Ptr'.
+*----------------------------------------------------------------------------*/
+
+inline void mul128By64To192(uint64_t a64, uint64_t a0, uint64_t b, uint64_t *z0Ptr, uint64_t *z1Ptr, uint64_t *z2Ptr)
+{
+ uint64_t zPtr[4];
+
+ softfloat_mul128To256M(a64, a0, 0, b, (uint64_t*) zPtr);
+
+ assert(zPtr[indexWord(4, 3)] == 0);
+
+ *z0Ptr = zPtr[indexWord(4, 2)];
+ *z1Ptr = zPtr[indexWord(4, 1)];
+ *z2Ptr = zPtr[indexWord(4, 0)];
+}
+
+/*----------------------------------------------------------------------------
+| Shifts the 128-bit value formed by concatenating `a0' and `a1' left by the
+| number of bits given in `count'. Any bits shifted off are lost. The value
+| of `count' must be less than 64. The result is broken into two 64-bit
+| pieces which are stored at the locations pointed to by `z0Ptr' and `z1Ptr'.
+*----------------------------------------------------------------------------*/
+
+inline void shortShift128Left(uint64_t a0, uint64_t a1, int count, uint64_t *z0Ptr, uint64_t *z1Ptr)
+{
+ *z1Ptr = a1<<count;
+ *z0Ptr = (count == 0) ? a0 : (a0<<count) | (a1>>((-count) & 63));
+}
+
+/*----------------------------------------------------------------------------
+| Shifts the 128-bit value formed by concatenating `a0' and `a1' right by the
+| number of bits given in `count'. Any bits shifted off are lost. The value
+| of `count' must be less than 64. The result is broken into two 64-bit pieces
+| which are stored at the locations pointed to by `z0Ptr' and `z1Ptr'.
+*----------------------------------------------------------------------------*/
+
+inline void shortShift128Right(uint64_t a0, uint64_t a1, int count, uint64_t *z0Ptr, uint64_t *z1Ptr)
+{
+ uint64_t z0 = a0, z1 = a1;
+ int negCount = (-count) & 63;
+
+ if (count != 0) {
+ z1 = (a0<<negCount) | (a1>>count);
+ z0 = a0>>count;
+ }
+ *z1Ptr = z1;
+ *z0Ptr = z0;
+}
+
+/*----------------------------------------------------------------------------
+| Returns an approximation to the 64-bit integer quotient obtained by dividing
+| `b' into the 128-bit value formed by concatenating `a0' and `a1'. The
+| divisor `b' must be at least 2^63. If q is the exact quotient truncated
+| toward zero, the approximation returned lies between q and q + 2 inclusive.
+| If the exact quotient q is larger than 64 bits, the maximum positive 64-bit
+| unsigned integer is returned.
+*----------------------------------------------------------------------------*/
+
+#ifdef USE_estimateDiv128To64
+static uint64_t estimateDiv128To64(uint64_t a0, uint64_t a1, uint64_t b)
+{
+ uint128 term, rem;
+ uint64_t b0, b1;
+ uint64_t z;
+ if (b <= a0) return uint64_t(0xFFFFFFFFFFFFFFFF);
+ b0 = b>>32;
+ z = (b0<<32 <= a0) ? uint64_t(0xFFFFFFFF00000000) : (a0 / b0)<<32;
+ term = softfloat_mul64To128(b, z);
+ rem = softfloat_sub128(a0, a1, term.v64, term.v0);
+ while (((int64_t) rem.v64) < 0) {
+ z -= UINT64_C(0x100000000);
+ b1 = b<<32;
+ rem = softfloat_add128(rem.v64, rem.v0, b0, b1);
+ }
+ rem.v64 = (rem.v64<<32) | (rem.v0>>32);
+ z |= (b0<<32 <= rem.v64) ? 0xFFFFFFFF : rem.v64 / b0;
+ return z;
+}
+#endif
+
+/*----------------------------------------------------------------------------
+| Adds the 192-bit value formed by concatenating `a0', `a1', and `a2' to the
+| 192-bit value formed by concatenating `b0', `b1', and `b2'. Addition is
+| modulo 2^192, so any carry out is lost. The result is broken into three
+| 64-bit pieces which are stored at the locations pointed to by `z0Ptr',
+| `z1Ptr', and `z2Ptr'.
+*----------------------------------------------------------------------------*/
+
+inline void add192(uint64_t a0, uint64_t a1, uint64_t a2, uint64_t b0, uint64_t b1, uint64_t b2, uint64_t *z0Ptr, uint64_t *z1Ptr, uint64_t *z2Ptr)
+{
+ uint64_t z0, z1, z2;
+ unsigned carry0, carry1;
+
+ z2 = a2 + b2;
+ carry1 = (z2 < a2);
+ z1 = a1 + b1;
+ carry0 = (z1 < a1);
+ z0 = a0 + b0;
+ z1 += carry1;
+ z0 += (z1 < carry1);
+ z0 += carry0;
+ *z2Ptr = z2;
+ *z1Ptr = z1;
+ *z0Ptr = z0;
+}
+
+/*----------------------------------------------------------------------------
+| Subtracts the 128-bit value formed by concatenating `b0' and `b1' from the
+| 128-bit value formed by concatenating `a0' and `a1'. Subtraction is modulo
+| 2^128, so any borrow out (carry out) is lost. The result is broken into two
+| 64-bit pieces which are stored at the locations pointed to by `z0Ptr' and
+| `z1Ptr'.
+*----------------------------------------------------------------------------*/
+
+inline void sub128(uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1, uint64_t *z0Ptr, uint64_t *z1Ptr)
+{
+ *z1Ptr = a1 - b1;
+ *z0Ptr = a0 - b0 - (a1 < b1);
+}
+
+#endif
diff --git a/3rdparty/softfloat3/bochs_ext/softfloat-specialize.h b/3rdparty/softfloat3/bochs_ext/softfloat-specialize.h
new file mode 100644
index 00000000000..f4c5bd2b2cd
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/softfloat-specialize.h
@@ -0,0 +1,223 @@
+/*============================================================================
+This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2b.
+
+Written by John R. Hauser. This work was made possible in part by the
+International Computer Science Institute, located at Suite 600, 1947 Center
+Street, Berkeley, California 94704. Funding was partially provided by the
+National Science Foundation under grant MIP-9311980. The original version
+of this code was written as part of a project to build a fixed-point vector
+processor in collaboration with the University of California at Berkeley,
+overseen by Profs. Nelson Morgan and John Wawrzynek. More information
+is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
+arithmetic/SoftFloat.html'.
+
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has
+been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
+RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
+AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
+COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
+EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
+INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
+OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+
+Derivative works are acceptable, even for commercial purposes, so long as
+(1) the source code for the derivative work includes prominent notice that
+the work is derivative, and (2) the source code includes prominent notice with
+these four paragraphs for those parts of this code that are retained.
+=============================================================================*/
+
+#ifndef _SOFTFLOAT_SPECIALIZE_H_
+#define _SOFTFLOAT_SPECIALIZE_H_
+
+#include "../source/include/softfloat_types.h"
+#include "../source/8086/specialize.h"
+
+/*============================================================================
+ * Adapted for Bochs (x86 achitecture simulator) by
+ * Stanislav Shwartsman [sshwarts at sourceforge net]
+ * ==========================================================================*/
+
+const int16_t int16_indefinite = (int16_t) 0x8000;
+const int32_t int32_indefinite = (int32_t) 0x80000000;
+const int64_t int64_indefinite = (int64_t) uint64_t(0x8000000000000000);
+
+const uint16_t uint16_indefinite = 0xffff;
+const uint32_t uint32_indefinite = 0xffffffff;
+const uint64_t uint64_indefinite = uint64_t(0xffffffffffffffff);
+
+/*----------------------------------------------------------------------------
+| Commonly used half-precision floating point constants
+*----------------------------------------------------------------------------*/
+const uint16_t float16_negative_inf = 0xfc00;
+const uint16_t float16_positive_inf = 0x7c00;
+const uint16_t float16_negative_zero = 0x8000;
+const uint16_t float16_positive_zero = 0x0000;
+
+/*----------------------------------------------------------------------------
+| The pattern for a default generated half-precision NaN.
+*----------------------------------------------------------------------------*/
+const uint16_t float16_default_nan = 0xFE00;
+
+#define FLOAT16_EXP_BIAS 0xF
+
+/*----------------------------------------------------------------------------
+| Packs the sign `zSign', exponent `zExp', and significand `zSig' into a
+| single-precision floating-point value, returning the result. After being
+| shifted into the proper positions, the three fields are simply added
+| together to form the result. This means that any integer portion of `zSig'
+| will be added into the exponent. Since a properly normalized significand
+| will have an integer portion equal to 1, the `zExp' input should be 1 less
+| than the desired result exponent whenever `zSig' is a complete, normalized
+| significand.
+*----------------------------------------------------------------------------*/
+
+inline uint16_t packFloat16(int zSign, int zExp, uint16_t zSig)
+{
+ return (((uint16_t) zSign)<<15) + (((uint16_t) zExp)<<10) + zSig;
+}
+
+/*----------------------------------------------------------------------------
+| Commonly used single-precision floating point constants
+*----------------------------------------------------------------------------*/
+const uint32_t float32_negative_inf = 0xff800000;
+const uint32_t float32_positive_inf = 0x7f800000;
+const uint32_t float32_negative_zero = 0x80000000;
+const uint32_t float32_positive_zero = 0x00000000;
+const uint32_t float32_negative_one = 0xbf800000;
+const uint32_t float32_positive_one = 0x3f800000;
+const uint32_t float32_max_float = 0x7f7fffff;
+const uint32_t float32_min_float = 0xff7fffff;
+
+/*----------------------------------------------------------------------------
+| The pattern for a default generated single-precision NaN.
+*----------------------------------------------------------------------------*/
+const uint32_t float32_default_nan = 0xffc00000;
+
+#define FLOAT32_EXP_BIAS 0x7F
+
+/*----------------------------------------------------------------------------
+| Packs the sign `zSign', exponent `zExp', and significand `zSig' into a
+| single-precision floating-point value, returning the result. After being
+| shifted into the proper positions, the three fields are simply added
+| together to form the result. This means that any integer portion of `zSig'
+| will be added into the exponent. Since a properly normalized significand
+| will have an integer portion equal to 1, the `zExp' input should be 1 less
+| than the desired result exponent whenever `zSig' is a complete, normalized
+| significand.
+*----------------------------------------------------------------------------*/
+
+inline uint32_t packFloat32(int zSign, int16_t zExp, uint32_t zSig)
+{
+ return (((uint32_t) zSign)<<31) + (((uint32_t) zExp)<<23) + zSig;
+}
+
+/*----------------------------------------------------------------------------
+| Commonly used single-precision floating point constants
+*----------------------------------------------------------------------------*/
+const uint64_t float64_negative_inf = uint64_t(0xfff0000000000000);
+const uint64_t float64_positive_inf = uint64_t(0x7ff0000000000000);
+const uint64_t float64_negative_zero = uint64_t(0x8000000000000000);
+const uint64_t float64_positive_zero = uint64_t(0x0000000000000000);
+const uint64_t float64_negative_one = uint64_t(0xbff0000000000000);
+const uint64_t float64_positive_one = uint64_t(0x3ff0000000000000);
+const uint64_t float64_max_float = uint64_t(0x7fefffffffffffff);
+const uint64_t float64_min_float = uint64_t(0xffefffffffffffff);
+
+/*----------------------------------------------------------------------------
+| The pattern for a default generated double-precision NaN.
+*----------------------------------------------------------------------------*/
+const uint64_t float64_default_nan = uint64_t(0xFFF8000000000000);
+
+#define FLOAT64_EXP_BIAS 0x3FF
+
+/*----------------------------------------------------------------------------
+| Packs the sign `zSign', exponent `zExp', and significand `zSig' into a
+| double-precision floating-point value, returning the result. After being
+| shifted into the proper positions, the three fields are simply added
+| together to form the result. This means that any integer portion of `zSig'
+| will be added into the exponent. Since a properly normalized significand
+| will have an integer portion equal to 1, the `zExp' input should be 1 less
+| than the desired result exponent whenever `zSig' is a complete, normalized
+| significand.
+*----------------------------------------------------------------------------*/
+
+inline uint64_t packFloat64(int zSign, int16_t zExp, uint64_t zSig)
+{
+ return (((uint64_t) zSign)<<63) + (((uint64_t) zExp)<<52) + zSig;
+}
+
+/*----------------------------------------------------------------------------
+| The pattern for a default generated extended double-precision NaN. The
+| `high' and `low' values hold the most- and least-significant bits,
+| respectively.
+*----------------------------------------------------------------------------*/
+#define floatx80_default_nan_exp 0xFFFF
+#define floatx80_default_nan_fraction uint64_t(0xC000000000000000)
+
+#define FLOATX80_EXP_BIAS 0x3FFF
+
+/*----------------------------------------------------------------------------
+| Packs the sign `zSign', exponent `zExp', and significand `zSig' into an
+| extended double-precision floating-point value, returning the result.
+*----------------------------------------------------------------------------*/
+
+inline extFloat80_t packFloatx80(int zSign, int32_t zExp, uint64_t zSig)
+{
+ extFloat80_t z;
+ z.signif = zSig;
+ z.signExp = (zSign << 15) + zExp;
+ return z;
+}
+
+/*----------------------------------------------------------------------------
+| The pattern for a default generated extended double-precision NaN.
+*----------------------------------------------------------------------------*/
+static const extFloat80_t floatx80_default_nan =
+ packFloatx80(0, floatx80_default_nan_exp, floatx80_default_nan_fraction);
+
+#ifdef FLOAT128
+
+/*----------------------------------------------------------------------------
+| Packs the sign `zSign', the exponent `zExp', and the significand formed
+| by the concatenation of `zSig0' and `zSig1' into a quadruple-precision
+| floating-point value, returning the result. After being shifted into the
+| proper positions, the three fields `zSign', `zExp', and `zSig0' are simply
+| added together to form the most significant 32 bits of the result. This
+| means that any integer portion of `zSig0' will be added into the exponent.
+| Since a properly normalized significand will have an integer portion equal
+| to 1, the `zExp' input should be 1 less than the desired result exponent
+| whenever `zSig0' and `zSig1' concatenated form a complete, normalized
+| significand.
+*----------------------------------------------------------------------------*/
+
+inline float128_t packFloat128(int zSign, int32_t zExp, uint64_t zSig0, uint64_t zSig1)
+{
+ float128_t z;
+ z.v[0] = zSig1;
+ z.v[1] = (((uint64_t) zSign)<<63) + (((uint64_t) zExp)<<48) + zSig0;
+ return z;
+}
+
+/*----------------------------------------------------------------------------
+| Packs two 64-bit precision integers into into the quadruple-precision
+| floating-point value, returning the result.
+*----------------------------------------------------------------------------*/
+
+inline float128_t packFloat128(uint64_t zHi, uint64_t zLo)
+{
+ float128_t z;
+ z.v[0] = zLo;
+ z.v[1] = zHi;
+ return z;
+}
+
+#ifdef _MSC_VER
+#define PACK_FLOAT_128(hi,lo) { lo, hi }
+#else
+#define PACK_FLOAT_128(hi,lo) packFloat128(uint64_t(hi),uint64_t(lo))
+#endif
+
+#endif /* FLOAT128 */
+
+#endif
diff --git a/3rdparty/softfloat3/bochs_ext/softfloat3_ext.h b/3rdparty/softfloat3/bochs_ext/softfloat3_ext.h
new file mode 100644
index 00000000000..03b3688c740
--- /dev/null
+++ b/3rdparty/softfloat3/bochs_ext/softfloat3_ext.h
@@ -0,0 +1,21 @@
+int extFloat80_ieee754_remainder(extFloat80_t a, extFloat80_t b, extFloat80_t &r, uint64_t &q);
+int extFloat80_remainder(extFloat80_t a, extFloat80_t b, extFloat80_t &r, uint64_t &q);
+int extFloat80_sincos(extFloat80_t a, extFloat80_t *sin_a, extFloat80_t *cos_a);
+int extFloat80_sin(extFloat80_t &a);
+int extFloat80_cos(extFloat80_t &a);
+int extFloat80_tan(extFloat80_t &a);
+int extFloat80_is_nan(extFloat80_t a);
+extFloat80_t extFloat80_atan(extFloat80_t a, extFloat80_t b);
+extFloat80_t extFloat80_68katan(extFloat80_t a);
+extFloat80_t extFloat80_getman(extFloat80_t a);
+extFloat80_t extFloat80_fyl2x(extFloat80_t a, extFloat80_t b);
+extFloat80_t extFloat80_fyl2xp1(extFloat80_t a, extFloat80_t b);
+extFloat80_t extFloat80_2xm1(extFloat80_t a);
+extFloat80_t extFloat80_etox(extFloat80_t a);
+extFloat80_t extFloat80_2tox(extFloat80_t a);
+extFloat80_t extFloat80_10tox(extFloat80_t a);
+extFloat80_t extFloat80_lognp1(extFloat80_t a);
+extFloat80_t extFloat80_logn(extFloat80_t a);
+extFloat80_t extFloat80_log2(extFloat80_t a);
+extFloat80_t extFloat80_log10(extFloat80_t a);
+extFloat80_t extFloat80_scale(extFloat80_t a, extFloat80_t b);
diff --git a/3rdparty/softfloat3/build/MAME/platform.h b/3rdparty/softfloat3/build/MAME/platform.h
index 5dfa704955c..f49392880ce 100644
--- a/3rdparty/softfloat3/build/MAME/platform.h
+++ b/3rdparty/softfloat3/build/MAME/platform.h
@@ -33,7 +33,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================*/
-
+#
/*----------------------------------------------------------------------------
Softfloat 3 MAME modifications
*----------------------------------------------------------------------------*/
@@ -45,11 +45,7 @@ Softfloat 3 MAME modifications
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
-#ifdef __GNUC_STDC_INLINE__
-#define INLINE inline
-#else
-#define INLINE extern inline
-#endif
+#define INLINE static inline
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
@@ -60,6 +56,7 @@ Softfloat 3 MAME modifications
#include <intrin.h>
// MSVC has __lzcnt16 as well, but opts-GCC.h expects __lzcnt for uint16_t and uint32_t
+// FIXME: this requires the ABM instruction set extension and shouldn't be enabled if it isn't available
#if defined(_M_IX86) || defined(_M_AMD64)
#define __builtin_clz __lzcnt
#endif // defined(_M_IX86) || defined(_M_AMD64)
@@ -68,14 +65,14 @@ Softfloat 3 MAME modifications
#define __builtin_clzll __lzcnt64
#endif // defined(_M_AMD64)
-#else // defined(_MSC_VER)
+#else // defined(_MSC_VER) && !defined(__clang__))
-// true for GCC and Clang on Intel and ARM, and MSVC on Intel.
#define SOFTFLOAT_BUILTIN_CLZ 1
-#if defined(PTR64)
+
+#if defined(__SIZEOF_INT128__)
#define SOFTFLOAT_INTRINSIC_INT128 1
-#endif // defined(PTR64)
+#endif // defined(__SIZEOF_INT128__)
-#endif // defined(_MSC_VER)
+#endif // defined(_MSC_VER) && !defined(__clang__)
-#include "opts-GCC.h"
+#include "../../source/include/opts-GCC.h"
diff --git a/3rdparty/softfloat3/source/include/softfloat.h b/3rdparty/softfloat3/source/include/softfloat.h
index 9ed17c1b90d..863796d3b4b 100644
--- a/3rdparty/softfloat3/source/include/softfloat.h
+++ b/3rdparty/softfloat3/source/include/softfloat.h
@@ -46,6 +46,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef softfloat_h
#define softfloat_h 1
+// copy config #defines from 3rdparty.lua to match the build configuration
+#ifndef SOFTFLOAT_FAST_INT64
+#define SOFTFLOAT_FAST_INT64
+#define SOFTFLOAT_FAST_DIV32TO16
+#define SOFTFLOAT_FAST_DIV64TO32
+#define SOFTFLOAT_ROUND_ODD
+#endif
+
+#ifndef INLINE_LEVEL
+#define INLINE_LEVEL (5)
+#endif
+
+#ifndef INLINE
+#define INLINE static inline
+#endif
+
#include <stdbool.h>
#include <stdint.h>
#include "softfloat_types.h"
@@ -59,8 +75,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*----------------------------------------------------------------------------*/
extern THREAD_LOCAL uint_fast8_t softfloat_detectTininess;
enum {
- softfloat_tininess_beforeRounding = 0,
- softfloat_tininess_afterRounding = 1
+ softfloat_tininess_beforeRounding = 0,
+ softfloat_tininess_afterRounding = 1
};
/*----------------------------------------------------------------------------
@@ -69,12 +85,12 @@ enum {
*----------------------------------------------------------------------------*/
extern THREAD_LOCAL uint_fast8_t softfloat_roundingMode;
enum {
- softfloat_round_near_even = 0,
- softfloat_round_minMag = 1,
- softfloat_round_min = 2,
- softfloat_round_max = 3,
- softfloat_round_near_maxMag = 4,
- softfloat_round_odd = 6
+ softfloat_round_near_even = 0,
+ softfloat_round_minMag = 1,
+ softfloat_round_min = 2,
+ softfloat_round_max = 3,
+ softfloat_round_near_maxMag = 4,
+ softfloat_round_odd = 6
};
/*----------------------------------------------------------------------------
@@ -82,11 +98,11 @@ enum {
*----------------------------------------------------------------------------*/
extern THREAD_LOCAL uint_fast8_t softfloat_exceptionFlags;
enum {
- softfloat_flag_inexact = 1,
- softfloat_flag_underflow = 2,
- softfloat_flag_overflow = 4,
- softfloat_flag_infinite = 8,
- softfloat_flag_invalid = 16
+ softfloat_flag_inexact = 1,
+ softfloat_flag_underflow = 2,
+ softfloat_flag_overflow = 4,
+ softfloat_flag_infinite = 8,
+ softfloat_flag_invalid = 16
};
/*----------------------------------------------------------------------------
@@ -290,7 +306,7 @@ float64_t extF80M_to_f64( const extFloat80_t * );
void extF80M_to_f128M( const extFloat80_t *, float128_t * );
void
extF80M_roundToInt(
- const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * );
+ const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * );
void extF80M_add( const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
void extF80M_sub( const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
void extF80M_mul( const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
@@ -355,7 +371,7 @@ void f128M_sub( const float128_t *, const float128_t *, float128_t * );
void f128M_mul( const float128_t *, const float128_t *, float128_t * );
void
f128M_mulAdd(
- const float128_t *, const float128_t *, const float128_t *, float128_t *
+ const float128_t *, const float128_t *, const float128_t *, float128_t *
);
void f128M_div( const float128_t *, const float128_t *, float128_t * );
void f128M_rem( const float128_t *, const float128_t *, float128_t * );
diff --git a/3rdparty/softfloat3/source/include/softfloat_types.h b/3rdparty/softfloat3/source/include/softfloat_types.h
index b92d24625eb..3657ac0483d 100644
--- a/3rdparty/softfloat3/source/include/softfloat_types.h
+++ b/3rdparty/softfloat3/source/include/softfloat_types.h
@@ -39,6 +39,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h>
+// MAME: when #included from actual MAME code, we need the endianness to match what the build system set
+#ifdef LSB_FIRST
+#ifndef LITTLEENDIAN
+#define LITTLEENDIAN
+#endif
+#endif
+
/*----------------------------------------------------------------------------
| Types used to pass 16-bit, 32-bit, 64-bit, and 128-bit floating-point
| arguments and results to/from functions. These types must be exactly
diff --git a/3rdparty/sol2/sol/sol.hpp b/3rdparty/sol2/sol/sol.hpp
index 8b0b7d36ea4..04fd7e4958d 100644
--- a/3rdparty/sol2/sol/sol.hpp
+++ b/3rdparty/sol2/sol/sol.hpp
@@ -6747,12 +6747,9 @@ namespace sol {
/// one.
///
/// \group emplace
- template <class... Args>
- T& emplace(Args&&... args) noexcept {
- static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
-
- *this = nullopt;
- this->construct(std::forward<Args>(args)...);
+ T& emplace(T& arg) noexcept {
+ m_value = &arg;
+ return **this;
}
/// Swaps this optional with the other.
@@ -19416,7 +19413,13 @@ namespace sol { namespace function_detail {
}
template <bool is_yielding, bool no_trampoline>
- static int call(lua_State* L) noexcept(std::is_nothrow_copy_assignable_v<T>) {
+ static int call(lua_State* L)
+#if SOL_IS_ON(SOL_COMPILER_CLANG)
+ // apparent regression in clang 18 - llvm/llvm-project#91362
+#else
+ noexcept(std::is_nothrow_copy_assignable_v<T>)
+#endif
+ {
int nr;
if constexpr (no_trampoline) {
nr = real_call(L);
@@ -19456,7 +19459,13 @@ namespace sol { namespace function_detail {
}
template <bool is_yielding, bool no_trampoline>
- static int call(lua_State* L) noexcept(std::is_nothrow_copy_assignable_v<T>) {
+ static int call(lua_State* L)
+#if SOL_IS_ON(SOL_COMPILER_CLANG)
+ // apparent regression in clang 18 - llvm/llvm-project#91362
+#else
+ noexcept(std::is_nothrow_copy_assignable_v<T>)
+#endif
+ {
int nr;
if constexpr (no_trampoline) {
nr = real_call(L);
diff --git a/3rdparty/ymfm/buildall.cpp b/3rdparty/ymfm/examples/buildall/buildall.cpp
index 40bd75e2864..40bd75e2864 100644
--- a/3rdparty/ymfm/buildall.cpp
+++ b/3rdparty/ymfm/examples/buildall/buildall.cpp
diff --git a/3rdparty/ymfm/src/ymfm.h b/3rdparty/ymfm/src/ymfm.h
index 47ff90072cc..6427e34cda2 100644
--- a/3rdparty/ymfm/src/ymfm.h
+++ b/3rdparty/ymfm/src/ymfm.h
@@ -42,6 +42,7 @@
#include <cstdio>
#include <cstring>
#include <algorithm>
+#include <array>
#include <memory>
#include <string>
#include <vector>
@@ -110,17 +111,6 @@ inline int32_t clamp(int32_t value, int32_t minval, int32_t maxval)
//-------------------------------------------------
-// array_size - return the size of an array
-//-------------------------------------------------
-
-template<typename ArrayType, int ArraySize>
-constexpr uint32_t array_size(ArrayType (&array)[ArraySize])
-{
- return ArraySize;
-}
-
-
-//-------------------------------------------------
// count_leading_zeros - return the number of
// leading zeros in a 32-bit value; CPU-optimized
// versions for various architectures are included
@@ -254,7 +244,8 @@ inline int16_t roundtrip_fp(int32_t value)
// apply the shift back and forth to zero out bits that are lost
exponent -= 1;
- return (value >> exponent) << exponent;
+ int32_t mask = (1 << exponent) - 1;
+ return value & ~mask;
}
@@ -350,7 +341,7 @@ public:
{
// create file
char name[20];
- sprintf(name, "wavlog-%02d.wav", m_index);
+ snprintf(&name[0], sizeof(name), "wavlog-%02d.wav", m_index);
FILE *out = fopen(name, "wb");
// make the wav file header
@@ -483,6 +474,8 @@ public:
class ymfm_engine_callbacks
{
public:
+ virtual ~ymfm_engine_callbacks() = default;
+
// timer callback; called by the interface when a timer fires
virtual void engine_timer_expired(uint32_t tnum) = 0;
@@ -504,6 +497,8 @@ class ymfm_interface
template<typename RegisterType> friend class fm_engine_base;
public:
+ virtual ~ymfm_interface() = default;
+
// the following functions must be implemented by any derived classes; the
// default implementations are sufficient for some minimal operation, but will
// likely need to be overridden to integrate with the outside world; they are
diff --git a/3rdparty/ymfm/src/ymfm_fm.h b/3rdparty/ymfm/src/ymfm_fm.h
index 81795f8fe43..d40409fddfd 100644
--- a/3rdparty/ymfm/src/ymfm_fm.h
+++ b/3rdparty/ymfm/src/ymfm_fm.h
@@ -267,7 +267,7 @@ public:
// assign operators
void assign(uint32_t index, fm_operator<RegisterType> *op)
{
- assert(index < array_size(m_op));
+ assert(index < m_op.size());
m_op[index] = op;
if (op != nullptr)
op->set_choffs(m_choffs);
@@ -330,7 +330,7 @@ private:
uint32_t m_choffs; // channel offset in registers
int16_t m_feedback[2]; // feedback memory for operator 1
mutable int16_t m_feedback_in; // next input value for op 1 feedback (set in output)
- fm_operator<RegisterType> *m_op[4]; // up to 4 operators
+ std::array<fm_operator<RegisterType> *, 4> m_op; // up to 4 operators
RegisterType &m_regs; // direct reference to registers
fm_engine_base<RegisterType> &m_owner; // reference to the owning engine
};
diff --git a/3rdparty/ymfm/src/ymfm_fm.ipp b/3rdparty/ymfm/src/ymfm_fm.ipp
index 78e3a62d9c8..675424839ce 100644
--- a/3rdparty/ymfm/src/ymfm_fm.ipp
+++ b/3rdparty/ymfm/src/ymfm_fm.ipp
@@ -839,12 +839,12 @@ void fm_channel<RegisterType>::save_restore(ymfm_saved_state &state)
template<class RegisterType>
void fm_channel<RegisterType>::keyonoff(uint32_t states, keyon_type type, uint32_t chnum)
{
- for (uint32_t opnum = 0; opnum < array_size(m_op); opnum++)
+ for (uint32_t opnum = 0; opnum < m_op.size(); opnum++)
if (m_op[opnum] != nullptr)
m_op[opnum]->keyonoff(bitfield(states, opnum), type);
if (debug::LOG_KEYON_EVENTS && ((debug::GLOBAL_FM_CHANNEL_MASK >> chnum) & 1) != 0)
- for (uint32_t opnum = 0; opnum < array_size(m_op); opnum++)
+ for (uint32_t opnum = 0; opnum < m_op.size(); opnum++)
if (m_op[opnum] != nullptr)
debug::log_keyon("%c%s\n", bitfield(states, opnum) ? '+' : '-', m_regs.log_keyon(m_choffs, m_op[opnum]->opoffs()).c_str());
}
@@ -860,7 +860,7 @@ bool fm_channel<RegisterType>::prepare()
uint32_t active_mask = 0;
// prepare all operators and determine if they are active
- for (uint32_t opnum = 0; opnum < array_size(m_op); opnum++)
+ for (uint32_t opnum = 0; opnum < m_op.size(); opnum++)
if (m_op[opnum] != nullptr)
if (m_op[opnum]->prepare())
active_mask |= 1 << opnum;
@@ -880,7 +880,7 @@ void fm_channel<RegisterType>::clock(uint32_t env_counter, int32_t lfo_raw_pm)
m_feedback[0] = m_feedback[1];
m_feedback[1] = m_feedback_in;
- for (uint32_t opnum = 0; opnum < array_size(m_op); opnum++)
+ for (uint32_t opnum = 0; opnum < m_op.size(); opnum++)
if (m_op[opnum] != nullptr)
m_op[opnum]->clock(env_counter, lfo_raw_pm);
@@ -888,7 +888,7 @@ void fm_channel<RegisterType>::clock(uint32_t env_counter, int32_t lfo_raw_pm)
useful temporary code for envelope debugging
if (m_choffs == 0x101)
{
- for (uint32_t opnum = 0; opnum < array_size(m_op); opnum++)
+ for (uint32_t opnum = 0; opnum < m_op.size(); opnum++)
{
auto &op = *m_op[((opnum & 1) << 1) | ((opnum >> 1) & 1)];
printf(" %c%03X%c%c ",
@@ -1504,6 +1504,8 @@ void fm_engine_base<RegisterType>::update_timer(uint32_t tnum, uint32_t enable,
template<class RegisterType>
void fm_engine_base<RegisterType>::engine_timer_expired(uint32_t tnum)
{
+ assert(tnum == 0 || tnum == 1);
+
// update status
if (tnum == 0 && m_regs.enable_timer_a())
set_reset_status(STATUS_TIMERA, 0);
@@ -1515,7 +1517,7 @@ void fm_engine_base<RegisterType>::engine_timer_expired(uint32_t tnum)
for (uint32_t chnum = 0; chnum < CHANNELS; chnum++)
if (bitfield(RegisterType::CSM_TRIGGER_MASK, chnum))
{
- m_channel[chnum]->keyonoff(1, KEYON_CSM, chnum);
+ m_channel[chnum]->keyonoff(0xf, KEYON_CSM, chnum);
m_modified_channels |= 1 << chnum;
}
diff --git a/3rdparty/ymfm/src/ymfm_misc.h b/3rdparty/ymfm/src/ymfm_misc.h
index 0c3e2fa2310..628d128f699 100644
--- a/3rdparty/ymfm/src/ymfm_misc.h
+++ b/3rdparty/ymfm/src/ymfm_misc.h
@@ -90,5 +90,4 @@ protected:
}
-
#endif // YMFM_MISC_H
diff --git a/3rdparty/ymfm/src/ymfm_opl.cpp b/3rdparty/ymfm/src/ymfm_opl.cpp
index f3f62955ecb..8e8025fd9cc 100644
--- a/3rdparty/ymfm/src/ymfm_opl.cpp
+++ b/3rdparty/ymfm/src/ymfm_opl.cpp
@@ -386,9 +386,9 @@ std::string opl_registers_base<Revision>::log_keyon(uint32_t choffs, uint32_t op
uint32_t opnum = (opoffs & 31) - 2 * ((opoffs & 31) / 8) + 18 * bitfield(opoffs, 8);
char buffer[256];
- char *end = &buffer[0];
+ int end = 0;
- end += sprintf(end, "%2u.%02u freq=%04X fb=%u alg=%X mul=%X tl=%02X ksr=%u ns=%u ksl=%u adr=%X/%X/%X sl=%X sus=%u",
+ end += snprintf(&buffer[end], sizeof(buffer) - end, "%2u.%02u freq=%04X fb=%u alg=%X mul=%X tl=%02X ksr=%u ns=%u ksl=%u adr=%X/%X/%X sl=%X sus=%u",
chnum, opnum,
ch_block_freq(choffs),
ch_feedback(choffs),
@@ -405,25 +405,25 @@ std::string opl_registers_base<Revision>::log_keyon(uint32_t choffs, uint32_t op
op_eg_sustain(opoffs));
if (OUTPUTS > 1)
- end += sprintf(end, " out=%c%c%c%c",
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " out=%c%c%c%c",
ch_output_0(choffs) ? 'L' : '-',
ch_output_1(choffs) ? 'R' : '-',
ch_output_2(choffs) ? '0' : '-',
ch_output_3(choffs) ? '1' : '-');
if (op_lfo_am_enable(opoffs) != 0)
- end += sprintf(end, " am=%u", lfo_am_depth());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " am=%u", lfo_am_depth());
if (op_lfo_pm_enable(opoffs) != 0)
- end += sprintf(end, " pm=%u", lfo_pm_depth());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " pm=%u", lfo_pm_depth());
if (waveform_enable() && op_waveform(opoffs) != 0)
- end += sprintf(end, " wf=%u", op_waveform(opoffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " wf=%u", op_waveform(opoffs));
if (is_rhythm(choffs))
- end += sprintf(end, " rhy=1");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " rhy=1");
if (DYNAMIC_OPS)
{
operator_mapping map;
operator_map(map);
if (bitfield(map.chan[chnum], 16, 8) != 0xff)
- end += sprintf(end, " 4op");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " 4op");
}
return buffer;
@@ -685,9 +685,9 @@ std::string opll_registers::log_keyon(uint32_t choffs, uint32_t opoffs)
uint32_t opnum = opoffs;
char buffer[256];
- char *end = &buffer[0];
+ int end = 0;
- end += sprintf(end, "%u.%02u freq=%04X inst=%X fb=%u mul=%X",
+ end += snprintf(&buffer[end], sizeof(buffer) - end, "%u.%02u freq=%04X inst=%X fb=%u mul=%X",
chnum, opnum,
ch_block_freq(choffs),
ch_instrument(choffs),
@@ -695,11 +695,11 @@ std::string opll_registers::log_keyon(uint32_t choffs, uint32_t opoffs)
op_multiple(opoffs));
if (bitfield(opoffs, 0) == 1 || (is_rhythm(choffs) && choffs >= 6))
- end += sprintf(end, " vol=%X", op_volume(opoffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " vol=%X", op_volume(opoffs));
else
- end += sprintf(end, " tl=%02X", ch_total_level(choffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " tl=%02X", ch_total_level(choffs));
- end += sprintf(end, " ksr=%u ksl=%u adr=%X/%X/%X sl=%X sus=%u/%u",
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " ksr=%u ksl=%u adr=%X/%X/%X sl=%X sus=%u/%u",
op_ksr(opoffs),
op_ksl(opoffs),
op_attack_rate(opoffs),
@@ -710,13 +710,13 @@ std::string opll_registers::log_keyon(uint32_t choffs, uint32_t opoffs)
ch_sustain(choffs));
if (op_lfo_am_enable(opoffs))
- end += sprintf(end, " am=1");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " am=1");
if (op_lfo_pm_enable(opoffs))
- end += sprintf(end, " pm=1");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " pm=1");
if (op_waveform(opoffs) != 0)
- end += sprintf(end, " wf=1");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " wf=1");
if (is_rhythm(choffs))
- end += sprintf(end, " rhy=1");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " rhy=1");
return buffer;
}
@@ -1715,9 +1715,15 @@ uint8_t ymf278b::read_status()
uint8_t ymf278b::read_data_pcm()
{
- // write to FM
+ // read from PCM
if (bitfield(m_address, 9) != 0)
- return m_pcm.read(m_address & 0xff);
+ {
+ uint8_t result = m_pcm.read(m_address & 0xff);
+ if ((m_address & 0xff) == 0x02)
+ result |= 0x20;
+
+ return result;
+ }
return 0;
}
diff --git a/3rdparty/ymfm/src/ymfm_opl.h b/3rdparty/ymfm/src/ymfm_opl.h
index 843e5b274d2..71b098e974a 100644
--- a/3rdparty/ymfm/src/ymfm_opl.h
+++ b/3rdparty/ymfm/src/ymfm_opl.h
@@ -52,7 +52,7 @@ namespace ymfm
//
// System-wide registers:
// 01 xxxxxxxx Test register
-// --x----- Enable OPL compatibility mode [OPL2 only] (1 = enable)
+// --x----- Enable OPL compatibility mode [OPL2 only] (0 = enable)
// 02 xxxxxxxx Timer A value (4 * OPN)
// 03 xxxxxxxx Timer B value
// 04 x------- RST
@@ -243,7 +243,7 @@ public:
uint32_t op_decay_rate(uint32_t opoffs) const { return byte(0x60, 0, 4, opoffs); }
uint32_t op_sustain_level(uint32_t opoffs) const { return byte(0x80, 4, 4, opoffs); }
uint32_t op_release_rate(uint32_t opoffs) const { return byte(0x80, 0, 4, opoffs); }
- uint32_t op_waveform(uint32_t opoffs) const { return IsOpl2Plus ? byte(0xe0, 0, newflag() ? 3 : 2, opoffs) : 0; }
+ uint32_t op_waveform(uint32_t opoffs) const { return waveform_enable() ? byte(0xe0, 0, newflag() ? 3 : 2, opoffs) : 0; }
protected:
// return a bitfield extracted from a byte
diff --git a/3rdparty/ymfm/src/ymfm_opm.cpp b/3rdparty/ymfm/src/ymfm_opm.cpp
index 544bbe89a29..03f54fb9039 100644
--- a/3rdparty/ymfm/src/ymfm_opm.cpp
+++ b/3rdparty/ymfm/src/ymfm_opm.cpp
@@ -60,17 +60,17 @@ opm_registers::opm_registers() :
{
// waveform 0 is a sawtooth
uint8_t am = index ^ 0xff;
- int8_t pm = int8_t(index);
+ uint8_t pm = index;
m_lfo_waveform[0][index] = am | (pm << 8);
// waveform 1 is a square wave
am = bitfield(index, 7) ? 0 : 0xff;
- pm = int8_t(am ^ 0x80);
+ pm = am ^ 0x80;
m_lfo_waveform[1][index] = am | (pm << 8);
// waveform 2 is a triangle wave
am = bitfield(index, 7) ? (index << 1) : ((index ^ 0xff) << 1);
- pm = int8_t(bitfield(index, 6) ? am : ~am);
+ pm = bitfield(index, 6) ? am : ~am;
m_lfo_waveform[2][index] = am | (pm << 8);
// waveform 3 is noise; it is filled in dynamically
@@ -330,7 +330,7 @@ uint32_t opm_registers::compute_phase_step(uint32_t choffs, uint32_t opoffs, opd
if (pm_sensitivity < 6)
delta += lfo_raw_pm >> (6 - pm_sensitivity);
else
- delta += lfo_raw_pm << (pm_sensitivity - 5);
+ delta += uint32_t(lfo_raw_pm) << (pm_sensitivity - 5);
}
// apply delta and convert to a frequency number
@@ -354,9 +354,9 @@ std::string opm_registers::log_keyon(uint32_t choffs, uint32_t opoffs)
uint32_t opnum = opoffs;
char buffer[256];
- char *end = &buffer[0];
+ int end = 0;
- end += sprintf(end, "%u.%02u freq=%04X dt2=%u dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c",
+ end += snprintf(&buffer[end], sizeof(buffer) - end, "%u.%02u freq=%04X dt2=%u dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c",
chnum, opnum,
ch_block_freq(choffs),
op_detune2(opoffs),
@@ -376,14 +376,14 @@ std::string opm_registers::log_keyon(uint32_t choffs, uint32_t opoffs)
bool am = (lfo_am_depth() != 0 && ch_lfo_am_sens(choffs) != 0 && op_lfo_am_enable(opoffs) != 0);
if (am)
- end += sprintf(end, " am=%u/%02X", ch_lfo_am_sens(choffs), lfo_am_depth());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " am=%u/%02X", ch_lfo_am_sens(choffs), lfo_am_depth());
bool pm = (lfo_pm_depth() != 0 && ch_lfo_pm_sens(choffs) != 0);
if (pm)
- end += sprintf(end, " pm=%u/%02X", ch_lfo_pm_sens(choffs), lfo_pm_depth());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " pm=%u/%02X", ch_lfo_pm_sens(choffs), lfo_pm_depth());
if (am || pm)
- end += sprintf(end, " lfo=%02X/%c", lfo_rate(), "WQTN"[lfo_waveform()]);
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " lfo=%02X/%c", lfo_rate(), "WQTN"[lfo_waveform()]);
if (noise_enable() && opoffs == 31)
- end += sprintf(end, " noise=1");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " noise=1");
return buffer;
}
diff --git a/3rdparty/ymfm/src/ymfm_opn.cpp b/3rdparty/ymfm/src/ymfm_opn.cpp
index 053ad97701c..9a8f5e99feb 100644
--- a/3rdparty/ymfm/src/ymfm_opn.cpp
+++ b/3rdparty/ymfm/src/ymfm_opn.cpp
@@ -143,26 +143,23 @@ bool opn_registers_base<IsOpnA>::write(uint16_t index, uint8_t data, uint32_t &c
assert(index < REGISTERS);
// writes in the 0xa0-af/0x1a0-af region are handled as latched pairs
- // borrow unused registers 0xb8-bf/0x1b8-bf as temporary holding locations
+ // borrow unused registers 0xb8-bf as temporary holding locations
if ((index & 0xf0) == 0xa0)
{
if (bitfield(index, 0, 2) == 3)
return false;
uint32_t latchindex = 0xb8 | bitfield(index, 3);
- if (IsOpnA)
- latchindex |= index & 0x100;
// writes to the upper half just latch (only low 6 bits matter)
if (bitfield(index, 2))
- m_regdata[latchindex] = data | 0x80;
+ m_regdata[latchindex] = data & 0x3f;
- // writes to the lower half only commit if the latch is there
- else if (bitfield(m_regdata[latchindex], 7))
+ // writes to the lower half also apply said latch
+ else
{
m_regdata[index] = data;
- m_regdata[index | 4] = m_regdata[latchindex] & 0x3f;
- m_regdata[latchindex] = 0;
+ m_regdata[index | 4] = m_regdata[latchindex];
}
return false;
}
@@ -409,9 +406,9 @@ std::string opn_registers_base<IsOpnA>::log_keyon(uint32_t choffs, uint32_t opof
}
char buffer[256];
- char *end = &buffer[0];
+ int end = 0;
- end += sprintf(end, "%u.%02u freq=%04X dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X",
+ end += snprintf(&buffer[end], sizeof(buffer) - end, "%u.%02u freq=%04X dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X",
chnum, opnum,
block_freq,
op_detune(opoffs),
@@ -427,21 +424,21 @@ std::string opn_registers_base<IsOpnA>::log_keyon(uint32_t choffs, uint32_t opof
op_sustain_level(opoffs));
if (OUTPUTS > 1)
- end += sprintf(end, " out=%c%c",
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " out=%c%c",
ch_output_0(choffs) ? 'L' : '-',
ch_output_1(choffs) ? 'R' : '-');
if (op_ssg_eg_enable(opoffs))
- end += sprintf(end, " ssg=%X", op_ssg_eg_mode(opoffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " ssg=%X", op_ssg_eg_mode(opoffs));
bool am = (op_lfo_am_enable(opoffs) && ch_lfo_am_sens(choffs) != 0);
if (am)
- end += sprintf(end, " am=%u", ch_lfo_am_sens(choffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " am=%u", ch_lfo_am_sens(choffs));
bool pm = (ch_lfo_pm_sens(choffs) != 0);
if (pm)
- end += sprintf(end, " pm=%u", ch_lfo_pm_sens(choffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " pm=%u", ch_lfo_pm_sens(choffs));
if (am || pm)
- end += sprintf(end, " lfo=%02X", lfo_rate());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " lfo=%02X", lfo_rate());
if (multi_freq() && choffs == 2)
- end += sprintf(end, " multi=1");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " multi=1");
return buffer;
}
diff --git a/3rdparty/ymfm/src/ymfm_opn.h b/3rdparty/ymfm/src/ymfm_opn.h
index bab68ed93c5..daed8b0bf24 100644
--- a/3rdparty/ymfm/src/ymfm_opn.h
+++ b/3rdparty/ymfm/src/ymfm_opn.h
@@ -793,7 +793,7 @@ public:
ymf276(ymfm_interface &intf) : ym2612(intf) { }
// generate one sample of sound
- void generate(output_data *output, uint32_t numsamples);
+ void generate(output_data *output, uint32_t numsamples = 1);
};
}
diff --git a/3rdparty/ymfm/src/ymfm_opq.cpp b/3rdparty/ymfm/src/ymfm_opq.cpp
index 3467c0ddf95..78ae1616409 100644
--- a/3rdparty/ymfm/src/ymfm_opq.cpp
+++ b/3rdparty/ymfm/src/ymfm_opq.cpp
@@ -339,9 +339,9 @@ std::string opq_registers::log_keyon(uint32_t choffs, uint32_t opoffs)
uint32_t opnum = opoffs;
char buffer[256];
- char *end = &buffer[0];
+ int end = 0;
- end += sprintf(end, "%u.%02u freq=%04X dt=%+2d fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c",
+ end += snprintf(&buffer[end], sizeof(buffer) - end, "%u.%02u freq=%04X dt=%+2d fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c",
chnum, opnum,
(opoffs & 1) ? ch_block_freq_24(choffs) : ch_block_freq_13(choffs),
int32_t(op_detune(opoffs)) - 0x20,
@@ -360,14 +360,14 @@ std::string opq_registers::log_keyon(uint32_t choffs, uint32_t opoffs)
bool am = (lfo_enable() && op_lfo_am_enable(opoffs) && ch_lfo_am_sens(choffs) != 0);
if (am)
- end += sprintf(end, " am=%u", ch_lfo_am_sens(choffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " am=%u", ch_lfo_am_sens(choffs));
bool pm = (lfo_enable() && ch_lfo_pm_sens(choffs) != 0);
if (pm)
- end += sprintf(end, " pm=%u", ch_lfo_pm_sens(choffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " pm=%u", ch_lfo_pm_sens(choffs));
if (am || pm)
- end += sprintf(end, " lfo=%02X", lfo_rate());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " lfo=%02X", lfo_rate());
if (ch_reverb(choffs))
- end += sprintf(end, " reverb");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " reverb");
return buffer;
}
diff --git a/3rdparty/ymfm/src/ymfm_opx.h b/3rdparty/ymfm/src/ymfm_opx.h
new file mode 100644
index 00000000000..f8ee1c34f18
--- /dev/null
+++ b/3rdparty/ymfm/src/ymfm_opx.h
@@ -0,0 +1,290 @@
+// BSD 3-Clause License
+//
+// Copyright (c) 2021, Aaron Giles
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef YMFM_OPX_H
+#define YMFM_OPX_H
+
+#pragma once
+
+#include "ymfm.h"
+#include "ymfm_fm.h"
+
+namespace ymfm
+{
+
+//*********************************************************
+// REGISTER CLASSES
+//*********************************************************
+
+// ======================> opx_registers
+
+//
+// OPX register map:
+//
+// System-wide registers:
+//
+// Per-channel registers (channel in address bits 0-2)
+//
+// Per-operator registers (4 banks):
+// 00-0F x------- Enable
+// -xxxx--- EXT out
+// -------x Key on
+// 10-1F xxxxxxxx LFO frequency
+// 20-2F xx------ AM sensitivity (0-3)
+// --xxx--- PM sensitivity (0-7)
+// ------xx LFO waveform (0=disable, 1=saw, 2=
+// 30-3F -xxx---- Detune (0-7)
+// ----xxxx Multiple (0-15)
+// 40-4F -xxxxxxx Total level (0-127)
+// 50-5F xxx----- Key scale (0-7)
+// ---xxxxx Attack rate (0-31)
+// 60-6F ---xxxxx Decay rate (0-31)
+// 70-7F ---xxxxx Sustain rate (0-31)
+// 80-8F xxxx---- Sustain level (0-15)
+// ----xxxx Release rate (0-15)
+// 90-9F xxxxxxxx Frequency number (low 8 bits)
+// A0-AF xxxx---- Block (0-15)
+// ----xxxx Frequency number (high 4 bits)
+// B0-BF x------- Acc on
+// -xxx---- Feedback level (0-7)
+// -----xxx Waveform (0-7, 7=PCM)
+// C0-CF ----xxxx Algorithm (0-15)
+// D0-DF xxxx---- CH0 level (0-15)
+// ----xxxx CH1 level (0-15)
+// E0-EF xxxx---- CH2 level (0-15)
+// ----xxxx CH3 level (0-15)
+//
+
+class opx_registers : public fm_registers_base
+{
+ // LFO waveforms are 256 entries long
+ static constexpr uint32_t LFO_WAVEFORM_LENGTH = 256;
+
+public:
+ // constants
+ static constexpr uint32_t OUTPUTS = 8;
+ static constexpr uint32_t CHANNELS = 24;
+ static constexpr uint32_t ALL_CHANNELS = (1 << CHANNELS) - 1;
+ static constexpr uint32_t OPERATORS = CHANNELS * 2;
+ static constexpr uint32_t WAVEFORMS = 8;
+ static constexpr uint32_t REGISTERS = 0x800;
+ static constexpr uint32_t DEFAULT_PRESCALE = 8;
+ static constexpr uint32_t EG_CLOCK_DIVIDER = 2;
+ static constexpr uint32_t CSM_TRIGGER_MASK = ALL_CHANNELS;
+ static constexpr uint32_t REG_MODE = 0x14;
+ static constexpr uint8_t STATUS_TIMERA = 0x01;
+ static constexpr uint8_t STATUS_TIMERB = 0x02;
+ static constexpr uint8_t STATUS_BUSY = 0x80;
+ static constexpr uint8_t STATUS_IRQ = 0;
+
+ // constructor
+ opx_registers();
+
+ // reset to initial state
+ void reset();
+
+ // save/restore
+ void save_restore(ymfm_saved_state &state);
+
+ // map channel number to register offset
+ static constexpr uint32_t channel_offset(uint32_t chnum)
+ {
+ assert(chnum < CHANNELS);
+ return chnum;
+ }
+
+ // map operator number to register offset
+ static constexpr uint32_t operator_offset(uint32_t opnum)
+ {
+ assert(opnum < OPERATORS);
+ return opnum;
+ }
+
+ // return an array of operator indices for each channel
+ struct operator_mapping { uint32_t chan[CHANNELS]; };
+ void operator_map(operator_mapping &dest) const;
+
+ // handle writes to the register array
+ bool write(uint16_t index, uint8_t data, uint32_t &chan, uint32_t &opmask);
+
+ // clock the noise and LFO, if present, returning LFO PM value
+ int32_t clock_noise_and_lfo();
+
+ // return the AM offset from LFO for the given channel
+ uint32_t lfo_am_offset(uint32_t choffs) const;
+
+ // return the current noise state, gated by the noise clock
+ uint32_t noise_state() const { return m_noise_state; }
+
+ // caching helpers
+ void cache_operator_data(uint32_t choffs, uint32_t opoffs, opdata_cache &cache);
+
+ // compute the phase step, given a PM value
+ uint32_t compute_phase_step(uint32_t choffs, uint32_t opoffs, opdata_cache const &cache, int32_t lfo_raw_pm);
+
+ // log a key-on event
+ std::string log_keyon(uint32_t choffs, uint32_t opoffs);
+
+ // system-wide registers
+ uint32_t noise_frequency() const { return byte(0x0f, 0, 5); }
+ uint32_t noise_enable() const { return byte(0x0f, 7, 1); }
+ uint32_t timer_a_value() const { return word(0x10, 0, 8, 0x11, 0, 2); }
+ uint32_t timer_b_value() const { return byte(0x12, 0, 8); }
+ uint32_t csm() const { return byte(0x14, 7, 1); }
+ uint32_t reset_timer_b() const { return byte(0x14, 5, 1); }
+ uint32_t reset_timer_a() const { return byte(0x14, 4, 1); }
+ uint32_t enable_timer_b() const { return byte(0x14, 3, 1); }
+ uint32_t enable_timer_a() const { return byte(0x14, 2, 1); }
+ uint32_t load_timer_b() const { return byte(0x14, 1, 1); }
+ uint32_t load_timer_a() const { return byte(0x14, 0, 1); }
+ uint32_t lfo2_pm_depth() const { return byte(0x148, 0, 7); } // fake
+ uint32_t lfo2_rate() const { return byte(0x16, 0, 8); }
+ uint32_t lfo2_am_depth() const { return byte(0x17, 0, 7); }
+ uint32_t lfo_rate() const { return byte(0x18, 0, 8); }
+ uint32_t lfo_am_depth() const { return byte(0x19, 0, 7); }
+ uint32_t lfo_pm_depth() const { return byte(0x149, 0, 7); } // fake
+ uint32_t output_bits() const { return byte(0x1b, 6, 2); }
+ uint32_t lfo2_sync() const { return byte(0x1b, 5, 1); }
+ uint32_t lfo_sync() const { return byte(0x1b, 4, 1); }
+ uint32_t lfo2_waveform() const { return byte(0x1b, 2, 2); }
+ uint32_t lfo_waveform() const { return byte(0x1b, 0, 2); }
+
+ // per-channel registers
+ uint32_t ch_volume(uint32_t choffs) const { return byte(0x00, 0, 8, choffs); }
+ uint32_t ch_output_any(uint32_t choffs) const { return byte(0x20, 7, 1, choffs) | byte(0x30, 0, 1, choffs); }
+ uint32_t ch_output_0(uint32_t choffs) const { return byte(0x30, 0, 1, choffs); }
+ uint32_t ch_output_1(uint32_t choffs) const { return byte(0x20, 7, 1, choffs) | byte(0x30, 0, 1, choffs); }
+ uint32_t ch_output_2(uint32_t choffs) const { return 0; }
+ uint32_t ch_output_3(uint32_t choffs) const { return 0; }
+ uint32_t ch_key_on(uint32_t choffs) const { return byte(0x20, 6, 1, choffs); }
+ uint32_t ch_feedback(uint32_t choffs) const { return byte(0x20, 3, 3, choffs); }
+ uint32_t ch_algorithm(uint32_t choffs) const { return byte(0x20, 0, 3, choffs); }
+ uint32_t ch_block_freq(uint32_t choffs) const { return word(0x28, 0, 7, 0x30, 2, 6, choffs); }
+ uint32_t ch_lfo_pm_sens(uint32_t choffs) const { return byte(0x38, 4, 3, choffs); }
+ uint32_t ch_lfo_am_sens(uint32_t choffs) const { return byte(0x38, 0, 2, choffs); }
+ uint32_t ch_lfo2_pm_sens(uint32_t choffs) const { return byte(0x140, 4, 3, choffs); } // fake
+ uint32_t ch_lfo2_am_sens(uint32_t choffs) const { return byte(0x140, 0, 2, choffs); } // fake
+
+ // per-operator registers
+ uint32_t op_detune(uint32_t opoffs) const { return byte(0x40, 4, 3, opoffs); }
+ uint32_t op_multiple(uint32_t opoffs) const { return byte(0x40, 0, 4, opoffs); }
+ uint32_t op_fix_range(uint32_t opoffs) const { return byte(0x40, 4, 3, opoffs); }
+ uint32_t op_fix_frequency(uint32_t opoffs) const { return byte(0x40, 0, 4, opoffs); }
+ uint32_t op_waveform(uint32_t opoffs) const { return byte(0x100, 4, 3, opoffs); } // fake
+ uint32_t op_fine(uint32_t opoffs) const { return byte(0x100, 0, 4, opoffs); } // fake
+ uint32_t op_total_level(uint32_t opoffs) const { return byte(0x60, 0, 7, opoffs); }
+ uint32_t op_ksr(uint32_t opoffs) const { return byte(0x80, 6, 2, opoffs); }
+ uint32_t op_fix_mode(uint32_t opoffs) const { return byte(0x80, 5, 1, opoffs); }
+ uint32_t op_attack_rate(uint32_t opoffs) const { return byte(0x80, 0, 5, opoffs); }
+ uint32_t op_lfo_am_enable(uint32_t opoffs) const { return byte(0xa0, 7, 1, opoffs); }
+ uint32_t op_decay_rate(uint32_t opoffs) const { return byte(0xa0, 0, 5, opoffs); }
+ uint32_t op_detune2(uint32_t opoffs) const { return byte(0xc0, 6, 2, opoffs); }
+ uint32_t op_sustain_rate(uint32_t opoffs) const { return byte(0xc0, 0, 5, opoffs); }
+ uint32_t op_eg_shift(uint32_t opoffs) const { return byte(0x120, 6, 2, opoffs); } // fake
+ uint32_t op_reverb_rate(uint32_t opoffs) const { return byte(0x120, 0, 3, opoffs); } // fake
+ uint32_t op_sustain_level(uint32_t opoffs) const { return byte(0xe0, 4, 4, opoffs); }
+ uint32_t op_release_rate(uint32_t opoffs) const { return byte(0xe0, 0, 4, opoffs); }
+
+protected:
+ // return a bitfield extracted from a byte
+ uint32_t byte(uint32_t offset, uint32_t start, uint32_t count, uint32_t extra_offset = 0) const
+ {
+ return bitfield(m_regdata[offset + extra_offset], start, count);
+ }
+
+ // return a bitfield extracted from a pair of bytes, MSBs listed first
+ uint32_t word(uint32_t offset1, uint32_t start1, uint32_t count1, uint32_t offset2, uint32_t start2, uint32_t count2, uint32_t extra_offset = 0) const
+ {
+ return (byte(offset1, start1, count1, extra_offset) << count2) | byte(offset2, start2, count2, extra_offset);
+ }
+
+ // internal state
+ uint32_t m_lfo_counter[2]; // LFO counter
+ uint32_t m_noise_lfsr; // noise LFSR state
+ uint8_t m_noise_counter; // noise counter
+ uint8_t m_noise_state; // latched noise state
+ uint8_t m_noise_lfo; // latched LFO noise value
+ uint8_t m_lfo_am[2]; // current LFO AM value
+ uint8_t m_regdata[REGISTERS]; // register data
+ uint16_t m_phase_substep[OPERATORS]; // phase substep for fixed frequency
+ int16_t m_lfo_waveform[4][LFO_WAVEFORM_LENGTH]; // LFO waveforms; AM in low 8, PM in upper 8
+ uint16_t m_waveform[WAVEFORMS][WAVEFORM_LENGTH]; // waveforms
+};
+
+
+
+//*********************************************************
+// IMPLEMENTATION CLASSES
+//*********************************************************
+
+// ======================> ymf271
+
+class ymf271
+{
+public:
+ using fm_engine = fm_engine_base<opx_registers>;
+ static constexpr uint32_t OUTPUTS = fm_engine::OUTPUTS;
+ using output_data = fm_engine::output_data;
+
+ // constructor
+ ymf271(ymfm_interface &intf);
+
+ // reset
+ void reset();
+
+ // save/restore
+ void save_restore(ymfm_saved_state &state);
+
+ // pass-through helpers
+ uint32_t sample_rate(uint32_t input_clock) const { return m_fm.sample_rate(input_clock); }
+ void invalidate_caches() { m_fm.invalidate_caches(); }
+
+ // read access
+ uint8_t read_status();
+ uint8_t read(uint32_t offset);
+
+ // write access
+ void write_address(uint8_t data);
+ void write_data(uint8_t data);
+ void write(uint32_t offset, uint8_t data);
+
+ // generate one sample of sound
+ void generate(output_data *output, uint32_t numsamples = 1);
+
+protected:
+ // internal state
+ uint8_t m_address; // address register
+ fm_engine m_fm; // core FM engine
+};
+
+}
+
+
+#endif // YMFM_OPX_H
diff --git a/3rdparty/ymfm/src/ymfm_opz.cpp b/3rdparty/ymfm/src/ymfm_opz.cpp
index adeefd79f19..1178417bb8a 100644
--- a/3rdparty/ymfm/src/ymfm_opz.cpp
+++ b/3rdparty/ymfm/src/ymfm_opz.cpp
@@ -129,17 +129,17 @@ opz_registers::opz_registers() :
{
// waveform 0 is a sawtooth
uint8_t am = index ^ 0xff;
- int8_t pm = int8_t(index);
+ uint8_t pm = index;
m_lfo_waveform[0][index] = am | (pm << 8);
// waveform 1 is a square wave
am = bitfield(index, 7) ? 0 : 0xff;
- pm = int8_t(am ^ 0x80);
+ pm = am ^ 0x80;
m_lfo_waveform[1][index] = am | (pm << 8);
// waveform 2 is a triangle wave
am = bitfield(index, 7) ? (index << 1) : ((index ^ 0xff) << 1);
- pm = int8_t(bitfield(index, 6) ? am : ~am);
+ pm = bitfield(index, 6) ? am : ~am;
m_lfo_waveform[2][index] = am | (pm << 8);
// waveform 3 is noise; it is filled in dynamically
@@ -555,16 +555,16 @@ std::string opz_registers::log_keyon(uint32_t choffs, uint32_t opoffs)
uint32_t opnum = opoffs;
char buffer[256];
- char *end = &buffer[0];
+ int end = 0;
- end += sprintf(end, "%u.%02u", chnum, opnum);
+ end += snprintf(&buffer[end], sizeof(buffer) - end, "%u.%02u", chnum, opnum);
if (op_fix_mode(opoffs))
- end += sprintf(end, " fixfreq=%X fine=%X shift=%X", op_fix_frequency(opoffs), op_fine(opoffs), op_fix_range(opoffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " fixfreq=%X fine=%X shift=%X", op_fix_frequency(opoffs), op_fine(opoffs), op_fix_range(opoffs));
else
- end += sprintf(end, " freq=%04X dt2=%u fine=%X", ch_block_freq(choffs), op_detune2(opoffs), op_fine(opoffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " freq=%04X dt2=%u fine=%X", ch_block_freq(choffs), op_detune2(opoffs), op_fine(opoffs));
- end += sprintf(end, " dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c",
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " dt=%u fb=%u alg=%X mul=%X tl=%02X ksr=%u adsr=%02X/%02X/%02X/%X sl=%X out=%c%c",
op_detune(opoffs),
ch_feedback(choffs),
ch_algorithm(choffs),
@@ -580,32 +580,32 @@ std::string opz_registers::log_keyon(uint32_t choffs, uint32_t opoffs)
ch_output_1(choffs) ? 'R' : '-');
if (op_eg_shift(opoffs) != 0)
- end += sprintf(end, " egshift=%u", op_eg_shift(opoffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " egshift=%u", op_eg_shift(opoffs));
bool am = (lfo_am_depth() != 0 && ch_lfo_am_sens(choffs) != 0 && op_lfo_am_enable(opoffs) != 0);
if (am)
- end += sprintf(end, " am=%u/%02X", ch_lfo_am_sens(choffs), lfo_am_depth());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " am=%u/%02X", ch_lfo_am_sens(choffs), lfo_am_depth());
bool pm = (lfo_pm_depth() != 0 && ch_lfo_pm_sens(choffs) != 0);
if (pm)
- end += sprintf(end, " pm=%u/%02X", ch_lfo_pm_sens(choffs), lfo_pm_depth());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " pm=%u/%02X", ch_lfo_pm_sens(choffs), lfo_pm_depth());
if (am || pm)
- end += sprintf(end, " lfo=%02X/%c", lfo_rate(), "WQTN"[lfo_waveform()]);
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " lfo=%02X/%c", lfo_rate(), "WQTN"[lfo_waveform()]);
bool am2 = (lfo2_am_depth() != 0 && ch_lfo2_am_sens(choffs) != 0 && op_lfo_am_enable(opoffs) != 0);
if (am2)
- end += sprintf(end, " am2=%u/%02X", ch_lfo2_am_sens(choffs), lfo2_am_depth());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " am2=%u/%02X", ch_lfo2_am_sens(choffs), lfo2_am_depth());
bool pm2 = (lfo2_pm_depth() != 0 && ch_lfo2_pm_sens(choffs) != 0);
if (pm2)
- end += sprintf(end, " pm2=%u/%02X", ch_lfo2_pm_sens(choffs), lfo2_pm_depth());
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " pm2=%u/%02X", ch_lfo2_pm_sens(choffs), lfo2_pm_depth());
if (am2 || pm2)
- end += sprintf(end, " lfo2=%02X/%c", lfo2_rate(), "WQTN"[lfo2_waveform()]);
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " lfo2=%02X/%c", lfo2_rate(), "WQTN"[lfo2_waveform()]);
if (op_reverb_rate(opoffs) != 0)
- end += sprintf(end, " rev=%u", op_reverb_rate(opoffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " rev=%u", op_reverb_rate(opoffs));
if (op_waveform(opoffs) != 0)
- end += sprintf(end, " wf=%u", op_waveform(opoffs));
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " wf=%u", op_waveform(opoffs));
if (noise_enable() && opoffs == 31)
- end += sprintf(end, " noise=1");
+ end += snprintf(&buffer[end], sizeof(buffer) - end, " noise=1");
return buffer;
}
diff --git a/3rdparty/ymfm/src/ymfm_pcm.cpp b/3rdparty/ymfm/src/ymfm_pcm.cpp
index 50595133bf7..34417490ccd 100644
--- a/3rdparty/ymfm/src/ymfm_pcm.cpp
+++ b/3rdparty/ymfm/src/ymfm_pcm.cpp
@@ -46,7 +46,6 @@ namespace ymfm
void pcm_registers::reset()
{
std::fill_n(&m_regdata[0], REGISTERS, 0);
- m_regdata[0x02] = 0x20;
m_regdata[0xf8] = 0x1b;
}
diff --git a/3rdparty/ymfm/src/ymfm_ssg.h b/3rdparty/ymfm/src/ymfm_ssg.h
index 749ad146fe7..cb7ec9e7c41 100644
--- a/3rdparty/ymfm/src/ymfm_ssg.h
+++ b/3rdparty/ymfm/src/ymfm_ssg.h
@@ -49,6 +49,8 @@ namespace ymfm
class ssg_override
{
public:
+ virtual ~ssg_override() = default;
+
// reset our status
virtual void ssg_reset() = 0;
diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt
index 7f1b69f4a37..15ceebe787e 100644
--- a/3rdparty/zlib/CMakeLists.txt
+++ b/3rdparty/zlib/CMakeLists.txt
@@ -3,7 +3,9 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project(zlib C)
-set(VERSION "1.3")
+set(VERSION "1.3.1")
+
+option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON)
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
@@ -148,7 +150,9 @@ if(MINGW)
endif(MINGW)
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)
@@ -166,7 +170,7 @@ endif()
if(UNIX)
# On unix-like platforms the library is almost always called libz
set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
- if(NOT APPLE)
+ if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
elseif(BUILD_SHARED_LIBS AND WIN32)
@@ -193,21 +197,22 @@ endif()
#============================================================================
# Example binaries
#============================================================================
-
-add_executable(example test/example.c)
-target_link_libraries(example zlib)
-add_test(example example)
-
-add_executable(minigzip test/minigzip.c)
-target_link_libraries(minigzip zlib)
-
-if(HAVE_OFF64_T)
- add_executable(example64 test/example.c)
- target_link_libraries(example64 zlib)
- set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
- add_test(example64 example64)
-
- add_executable(minigzip64 test/minigzip.c)
- target_link_libraries(minigzip64 zlib)
- set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
+if(ZLIB_BUILD_EXAMPLES)
+ add_executable(example test/example.c)
+ target_link_libraries(example zlib)
+ add_test(example example)
+
+ add_executable(minigzip test/minigzip.c)
+ target_link_libraries(minigzip zlib)
+
+ if(HAVE_OFF64_T)
+ add_executable(example64 test/example.c)
+ target_link_libraries(example64 zlib)
+ set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
+ add_test(example64 example64)
+
+ add_executable(minigzip64 test/minigzip.c)
+ target_link_libraries(minigzip64 zlib)
+ set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
+ endif()
endif()
diff --git a/3rdparty/zlib/ChangeLog b/3rdparty/zlib/ChangeLog
index 8707988ac18..b801a1031ec 100644
--- a/3rdparty/zlib/ChangeLog
+++ b/3rdparty/zlib/ChangeLog
@@ -1,6 +1,16 @@
ChangeLog file for zlib
+Changes in 1.3.1 (22 Jan 2024)
+- Reject overflows of zip header fields in minizip
+- Fix bug in inflateSync() for data held in bit buffer
+- Add LIT_MEM define to use more memory for a small deflate speedup
+- Fix decision on the emission of Zip64 end records in minizip
+- Add bounds checking to ERR_MSG() macro, used by zError()
+- Neutralize zip file traversal attacks in miniunz
+- Fix a bug in ZLIB_DEBUG compiles in check_match()
+- Various portability and appearance improvements
+
Changes in 1.3 (18 Aug 2023)
- Remove K&R function definitions and zlib2ansi
- Fix bug in deflateBound() for level 0 and memLevel 9
diff --git a/3rdparty/zlib/FAQ b/3rdparty/zlib/FAQ
index 55f1cdc22f6..92f5d3e29fa 100644
--- a/3rdparty/zlib/FAQ
+++ b/3rdparty/zlib/FAQ
@@ -14,8 +14,7 @@ The latest zlib FAQ is at http://zlib.net/zlib_faq.html
2. Where can I get a Windows DLL version?
The zlib sources can be compiled without change to produce a DLL. See the
- file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the
- precompiled DLL are found in the zlib web site at http://zlib.net/ .
+ file win32/DLL_FAQ.txt in the zlib distribution.
3. Where can I get a Visual Basic interface to zlib?
diff --git a/3rdparty/zlib/Makefile.in b/3rdparty/zlib/Makefile.in
index 34d3cd722f8..cb8b00a9b07 100644
--- a/3rdparty/zlib/Makefile.in
+++ b/3rdparty/zlib/Makefile.in
@@ -1,5 +1,5 @@
# Makefile for zlib
-# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
+# Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type:
@@ -22,13 +22,13 @@ CFLAGS=-O
SFLAGS=-O
LDFLAGS=
-TEST_LDFLAGS=$(LDFLAGS) -L. libz.a
+TEST_LIBS=-L. libz.a
LDSHARED=$(CC)
CPP=$(CC) -E
STATICLIB=libz.a
SHAREDLIB=libz.so
-SHAREDLIBV=libz.so.1.3
+SHAREDLIBV=libz.so.1.3.1
SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIBV)
@@ -282,10 +282,10 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
-@rmdir objs
example$(EXE): example.o $(STATICLIB)
- $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ example.o $(TEST_LIBS)
minigzip$(EXE): minigzip.o $(STATICLIB)
- $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip.o $(TEST_LIBS)
examplesh$(EXE): example.o $(SHAREDLIBV)
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
@@ -294,10 +294,10 @@ minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
example64$(EXE): example64.o $(STATICLIB)
- $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ example64.o $(TEST_LIBS)
minigzip64$(EXE): minigzip64.o $(STATICLIB)
- $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip64.o $(TEST_LIBS)
install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
@@ -360,7 +360,7 @@ zconf: $(SRCDIR)zconf.h.in
cp -p $(SRCDIR)zconf.h.in zconf.h
minizip-test: static
- cd contrib/minizip && { CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; }
+ cd contrib/minizip && { CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; }
minizip-clean:
cd contrib/minizip && { $(MAKE) clean ; cd ../.. ; }
diff --git a/3rdparty/zlib/README b/3rdparty/zlib/README
index e02fc5aa206..c5f917540b6 100644
--- a/3rdparty/zlib/README
+++ b/3rdparty/zlib/README
@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY
-zlib 1.3 is a general purpose data compression library. All the code is
+zlib 1.3.1 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@@ -31,7 +31,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available at
https://marknelson.us/posts/1997/01/01/zlib-engine.html .
-The changes made in version 1.3 are documented in the file ChangeLog.
+The changes made in version 1.3.1 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory contrib/ .
@@ -83,7 +83,7 @@ Acknowledgments:
Copyright notice:
- (C) 1995-2023 Jean-loup Gailly and Mark Adler
+ (C) 1995-2024 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff --git a/3rdparty/zlib/configure b/3rdparty/zlib/configure
index cc867c94474..c55098afc4a 100644
--- a/3rdparty/zlib/configure
+++ b/3rdparty/zlib/configure
@@ -25,7 +25,7 @@ if test $SRCDIR = "."; then
ZINCOUT="-I."
SRCDIR=""
else
- ZINC='-include zconf.h'
+ ZINC='-I. -include zconf.h'
ZINCOUT='-I. -I$(SRCDIR)'
SRCDIR="$SRCDIR/"
fi
@@ -44,7 +44,8 @@ STATICLIB=libz.a
# extract zlib version numbers from zlib.h
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h`
-VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
+VER3=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\(\\.[0-9]\{1,\}\)\{1,2\}\).*/\1/p'`
+VER1=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\)\\..*/\1/p'`
# establish commands for library building
if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
@@ -263,7 +264,7 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
SHAREDLIB=libz$shared_ext
SHAREDLIBV=libz.$VER$shared_ext
SHAREDLIBM=libz.$VER1$shared_ext
- LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER"}
+ LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
if "${CROSS_PREFIX}libtool" -V 2>&1 | grep Apple > /dev/null; then
AR="${CROSS_PREFIX}libtool"
elif libtool -V 2>&1 | grep Apple > /dev/null; then
@@ -441,7 +442,7 @@ EOF
if test $shared -eq 1; then
echo Checking for shared library support... | tee -a configure.log
# we must test in two steps (cc then ld), required at least on SunOS 4.x
- if try $CC -w -c $SFLAGS $test.c &&
+ if try $CC -c $SFLAGS $test.c &&
try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
elif test -z "$old_cc" -a -z "$old_cflags"; then
diff --git a/3rdparty/zlib/contrib/delphi/ZLib.pas b/3rdparty/zlib/contrib/delphi/ZLib.pas
index 814ffa6706a..93fa4c9edb0 100644
--- a/3rdparty/zlib/contrib/delphi/ZLib.pas
+++ b/3rdparty/zlib/contrib/delphi/ZLib.pas
@@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
const OutBuf: Pointer; BufSize: Integer);
const
- zlib_version = '1.3.0';
+ zlib_version = '1.3.1';
type
EZlibError = class(Exception);
diff --git a/3rdparty/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs b/3rdparty/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs
index bffe6093c3b..9b6c3907460 100644
--- a/3rdparty/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs
+++ b/3rdparty/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs
@@ -34,7 +34,7 @@ namespace DotZLib
}
/// <summary>
- /// Initializes a new instance of the checksum generator basewith a specified value
+ /// Initializes a new instance of the checksum generator base with a specified value
/// </summary>
/// <param name="initialValue">The value to set the current checksum to</param>
public ChecksumGeneratorBase(uint initialValue)
diff --git a/3rdparty/zlib/contrib/dotzlib/DotZLib/UnitTests.cs b/3rdparty/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
index 209c8de4fb1..d81554b0aca 100644
--- a/3rdparty/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
+++ b/3rdparty/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
@@ -156,7 +156,7 @@ namespace DotZLibTests
public void Info_Version()
{
Info info = new Info();
- Assert.AreEqual("1.3.0", Info.Version);
+ Assert.AreEqual("1.3.1", Info.Version);
Assert.AreEqual(32, info.SizeOfUInt);
Assert.AreEqual(32, info.SizeOfULong);
Assert.AreEqual(32, info.SizeOfPointer);
diff --git a/3rdparty/zlib/contrib/infback9/inftree9.c b/3rdparty/zlib/contrib/infback9/inftree9.c
index dc38f24de96..ac707ed3fbd 100644
--- a/3rdparty/zlib/contrib/infback9/inftree9.c
+++ b/3rdparty/zlib/contrib/infback9/inftree9.c
@@ -1,5 +1,5 @@
/* inftree9.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2023 Mark Adler
+ * Copyright (C) 1995-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate9_copyright[] =
- " inflate9 1.3 Copyright 1995-2023 Mark Adler ";
+ " inflate9 1.3.1 Copyright 1995-2024 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -59,7 +59,7 @@ int inflate_table9(codetype type, unsigned short FAR *lens, unsigned codes,
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
- 133, 133, 133, 133, 144, 198, 203};
+ 133, 133, 133, 133, 144, 203, 77};
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
diff --git a/3rdparty/zlib/contrib/infback9/inftree9.h b/3rdparty/zlib/contrib/infback9/inftree9.h
index 2c1252f57de..ab2ea28b2ba 100644
--- a/3rdparty/zlib/contrib/infback9/inftree9.h
+++ b/3rdparty/zlib/contrib/infback9/inftree9.h
@@ -41,8 +41,8 @@ typedef struct {
examples/enough.c found in the zlib distribution. The arguments to that
program are the number of symbols, the initial root table size, and the
maximum bit length of a code. "enough 286 9 15" for literal/length codes
- returns returns 852, and "enough 32 6 15" for distance codes returns 594.
- The initial root table size (9 or 6) is found in the fifth argument of the
+ returns 852, and "enough 32 6 15" for distance codes returns 594. The
+ initial root table size (9 or 6) is found in the fifth argument of the
inflate_table() calls in infback9.c. If the root table size is changed,
then these maximum sizes would be need to be recalculated and updated. */
#define ENOUGH_LENS 852
diff --git a/3rdparty/zlib/contrib/iostream3/zfstream.h b/3rdparty/zlib/contrib/iostream3/zfstream.h
index 8574479ae1e..3dabc0f97d5 100644
--- a/3rdparty/zlib/contrib/iostream3/zfstream.h
+++ b/3rdparty/zlib/contrib/iostream3/zfstream.h
@@ -413,7 +413,7 @@ template<typename T1, typename T2>
class gzomanip2
{
public:
- // Allows insertor to peek at internals
+ // Allows inserter to peek at internals
template <typename Ta, typename Tb>
friend gzofstream&
operator<<(gzofstream&,
@@ -452,7 +452,7 @@ template<typename T1, typename T2>
: func(f), val1(v1), val2(v2)
{ }
-// Insertor applies underlying manipulator function to stream
+// Inserter applies underlying manipulator function to stream
template<typename T1, typename T2>
inline gzofstream&
operator<<(gzofstream& s, const gzomanip2<T1,T2>& m)
diff --git a/3rdparty/zlib/contrib/minizip/Makefile b/3rdparty/zlib/contrib/minizip/Makefile
index aac76e07f6b..3d927ec149e 100644
--- a/3rdparty/zlib/contrib/minizip/Makefile
+++ b/3rdparty/zlib/contrib/minizip/Makefile
@@ -1,4 +1,4 @@
-CC=cc
+CC?=cc
CFLAGS := $(CFLAGS) -O -I../..
UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
diff --git a/3rdparty/zlib/contrib/minizip/configure.ac b/3rdparty/zlib/contrib/minizip/configure.ac
index df80e5b7e13..15ec917189c 100644
--- a/3rdparty/zlib/contrib/minizip/configure.ac
+++ b/3rdparty/zlib/contrib/minizip/configure.ac
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_INIT([minizip], [1.3.0], [bugzilla.redhat.com])
+AC_INIT([minizip], [1.3.1], [bugzilla.redhat.com])
AC_CONFIG_SRCDIR([minizip.c])
AM_INIT_AUTOMAKE([foreign])
LT_INIT
diff --git a/3rdparty/zlib/contrib/minizip/ioapi.h b/3rdparty/zlib/contrib/minizip/ioapi.h
index c588a18d034..a2d2e6e60d9 100644
--- a/3rdparty/zlib/contrib/minizip/ioapi.h
+++ b/3rdparty/zlib/contrib/minizip/ioapi.h
@@ -144,7 +144,7 @@ typedef long (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream)
typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uLong offset, int origin);
-/* here is the "old" 32 bits structure structure */
+/* here is the "old" 32 bits structure */
typedef struct zlib_filefunc_def_s
{
open_file_func zopen_file;
diff --git a/3rdparty/zlib/contrib/minizip/miniunz.c b/3rdparty/zlib/contrib/minizip/miniunz.c
index a12aec8bea2..d627c4226bc 100644
--- a/3rdparty/zlib/contrib/minizip/miniunz.c
+++ b/3rdparty/zlib/contrib/minizip/miniunz.c
@@ -79,7 +79,7 @@
/* change_file_date : change the date/time of a file
filename : the filename of the file where date/time must be modified
- dosdate : the new date at the MSDos format (4 bytes)
+ dosdate : the new date at the MSDOS format (4 bytes)
tmu_date : the SAME new date at the tm_unz format */
static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_date) {
#ifdef _WIN32
@@ -186,7 +186,7 @@ static int makedir(const char *newdir) {
}
static void do_banner(void) {
- printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n");
+ printf("MiniUnz 1.1, demo of zLib + Unz package written by Gilles Vollant\n");
printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
}
@@ -356,6 +356,20 @@ static int do_extract_currentfile(unzFile uf, const int* popt_extract_without_pa
else
write_filename = filename_withoutpath;
+ if (write_filename[0]!='\0')
+ {
+ const char* relative_check = write_filename;
+ while (relative_check[1]!='\0')
+ {
+ if (relative_check[0]=='.' && relative_check[1]=='.')
+ write_filename = relative_check;
+ relative_check++;
+ }
+ }
+
+ while (write_filename[0]=='/' || write_filename[0]=='.')
+ write_filename++;
+
err = unzOpenCurrentFilePassword(uf,password);
if (err!=UNZ_OK)
{
diff --git a/3rdparty/zlib/contrib/minizip/unzip.c b/3rdparty/zlib/contrib/minizip/unzip.c
index ed763f89f1f..ea05b7d62a0 100644
--- a/3rdparty/zlib/contrib/minizip/unzip.c
+++ b/3rdparty/zlib/contrib/minizip/unzip.c
@@ -117,7 +117,7 @@
const char unz_copyright[] =
" unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
-/* unz_file_info_interntal contain internal info about a file in zipfile*/
+/* unz_file_info64_internal contain internal info about a file in zipfile*/
typedef struct unz_file_info64_internal_s
{
ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */
@@ -450,7 +450,7 @@ local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib
if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
return CENTRALDIRINVALID;
- /* number of the disk with the start of the zip64 end of central directory */
+ /* number of the disk with the start of the zip64 end of central directory */
if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
return CENTRALDIRINVALID;
if (uL != 0)
@@ -497,9 +497,9 @@ local unzFile unzOpenInternal(const void *path,
ZPOS64_T central_pos;
uLong uL;
- uLong number_disk; /* number of the current dist, used for
+ uLong number_disk; /* number of the current disk, used for
spanning ZIP, unsupported, always 0*/
- uLong number_disk_with_CD; /* number the the disk with central dir, used
+ uLong number_disk_with_CD; /* number the disk with central dir, used
for spanning ZIP, unsupported, always 0*/
ZPOS64_T number_entry_CD; /* total number of entries in
the central dir
diff --git a/3rdparty/zlib/contrib/minizip/unzip.h b/3rdparty/zlib/contrib/minizip/unzip.h
index 14105840f6d..5cfc9c6274e 100644
--- a/3rdparty/zlib/contrib/minizip/unzip.h
+++ b/3rdparty/zlib/contrib/minizip/unzip.h
@@ -306,7 +306,7 @@ extern int ZEXPORT unzGetCurrentFileInfo(unzFile file,
Get Info about the current file
if pfile_info!=NULL, the *pfile_info structure will contain some info about
the current file
- if szFileName!=NULL, the filemane string will be copied in szFileName
+ if szFileName!=NULL, the filename string will be copied in szFileName
(fileNameBufferSize is the size of the buffer)
if extraField!=NULL, the extra field information will be copied in extraField
(extraFieldBufferSize is the size of the buffer).
diff --git a/3rdparty/zlib/contrib/minizip/zip.c b/3rdparty/zlib/contrib/minizip/zip.c
index 3d3d4caddef..60bdffac348 100644
--- a/3rdparty/zlib/contrib/minizip/zip.c
+++ b/3rdparty/zlib/contrib/minizip/zip.c
@@ -575,7 +575,7 @@ local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib
if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
return 0;
- /* number of the disk with the start of the zip64 end of central directory */
+ /* number of the disk with the start of the zip64 end of central directory */
if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
return 0;
if (uL != 0)
@@ -614,9 +614,9 @@ local int LoadCentralDirectoryRecord(zip64_internal* pziinit) {
ZPOS64_T central_pos;
uLong uL;
- uLong number_disk; /* number of the current dist, used for
+ uLong number_disk; /* number of the current disk, used for
spanning ZIP, unsupported, always 0*/
- uLong number_disk_with_CD; /* number the the disk with central dir, used
+ uLong number_disk_with_CD; /* number of the disk with central dir, used
for spanning ZIP, unsupported, always 0*/
ZPOS64_T number_entry;
ZPOS64_T number_entry_CD; /* total number of entries in
@@ -1043,6 +1043,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c
return ZIP_PARAMERROR;
#endif
+ // The filename and comment length must fit in 16 bits.
+ if ((filename!=NULL) && (strlen(filename)>0xffff))
+ return ZIP_PARAMERROR;
+ if ((comment!=NULL) && (strlen(comment)>0xffff))
+ return ZIP_PARAMERROR;
+ // The extra field length must fit in 16 bits. If the member also requires
+ // a Zip64 extra block, that will also need to fit within that 16-bit
+ // length, but that will be checked for later.
+ if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff))
+ return ZIP_PARAMERROR;
+
zi = (zip64_internal*)file;
if (zi->in_opened_file_inzip == 1)
@@ -1597,7 +1608,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file, ZPOS64_T uncompressed_si
if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree)
{
- // we can not write more data to the buffer that we have room for.
+ // we cannot write more data to the buffer that we have room for.
return ZIP_BADZIPFILE;
}
@@ -1861,7 +1872,7 @@ extern int ZEXPORT zipClose(zipFile file, const char* global_comment) {
free_linkedlist(&(zi->central_dir));
pos = centraldir_pos_inzip - zi->add_position_when_writing_offset;
- if(pos >= 0xffffffff || zi->number_entry > 0xFFFF)
+ if(pos >= 0xffffffff || zi->number_entry >= 0xFFFF)
{
ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream);
Write_Zip64EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip);
diff --git a/3rdparty/zlib/contrib/minizip/zip.h b/3rdparty/zlib/contrib/minizip/zip.h
index 5fc08413241..3e230d3405f 100644
--- a/3rdparty/zlib/contrib/minizip/zip.h
+++ b/3rdparty/zlib/contrib/minizip/zip.h
@@ -177,9 +177,9 @@ extern int ZEXPORT zipOpenNewFileInZip64(zipFile file,
filename : the filename in zip (if NULL, '-' without quote will be used
*zipfi contain supplemental information
if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
- contains the extrafield data the the local header
+ contains the extrafield data for the local header
if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
- contains the extrafield data the the local header
+ contains the extrafield data for the global header
if comment != NULL, comment contain the comment string
method contain the compression method (0 for store, Z_DEFLATED for deflate)
level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
diff --git a/3rdparty/zlib/contrib/nuget/nuget.csproj b/3rdparty/zlib/contrib/nuget/nuget.csproj
new file mode 100644
index 00000000000..68627f034aa
--- /dev/null
+++ b/3rdparty/zlib/contrib/nuget/nuget.csproj
@@ -0,0 +1,43 @@
+<Project Sdk="Microsoft.Build.NoTargets/3.5.6">
+
+ <PropertyGroup>
+ <TargetFramework>net6.0</TargetFramework>
+ <PackageId>madler.zlib.redist</PackageId>
+ <PackageId Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(PackageId).win</PackageId>
+ <PackageId Condition="$([MSBuild]::IsOSPlatform('Linux'))">$(PackageId).linux</PackageId>
+ <PackageId Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(PackageId).osx</PackageId>
+ <Copyright>(C) 1995-2024 Jean-loup Gailly and Mark Adler</Copyright>
+ <version>1.3.1</version>
+ <PackageDescription>NuGet Package for consuming native builds of zlib into .NET without complexity.</PackageDescription>
+ <!--
+ Warns about not having any lib or ref assemblies (.NET Assemblies) in those directories.
+ Native only packages that is to be consumed in .NET should not require these.
+ -->
+ <NoWarn>NU5128</NoWarn>
+ <PackageOutputPath>$(MSBuildProjectDirectory)</PackageOutputPath>
+ <Authors>Jean-loup Gailly and Mark Adler</Authors>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Include="../../LICENSE" Pack="true" PackagePath="" />
+ <!-- Package up Windows builds. -->
+ <None Condition="$([MSBuild]::IsOSPlatform('Windows'))" Include="../vstudio/vc17/x86/ZlibDll$(Configuration)/zlibwapi.dll" Pack="true" PackagePath="runtimes/win-x86/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('Windows'))" Include="../vstudio/vc17/x64/ZlibDll$(Configuration)/zlibwapi.dll" Pack="true" PackagePath="runtimes/win-x64/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('Windows'))" Include="../vstudio/vc17/arm/ZlibDll$(Configuration)/zlibwapi.dll" Pack="true" PackagePath="runtimes/win-arm/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('Windows'))" Include="../vstudio/vc17/arm64/ZlibDll$(Configuration)/zlibwapi.dll" Pack="true" PackagePath="runtimes/win-arm64/native" />
+ <!-- Include debug symbols as well as we never know if they might actually be needed in the future. -->
+ <None Condition="$([MSBuild]::IsOSPlatform('Windows'))" Include="../vstudio/vc17/x86/ZlibDll$(Configuration)/zlibwapi.pdb" Pack="true" PackagePath="runtimes/win-x86/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('Windows'))" Include="../vstudio/vc17/x64/ZlibDll$(Configuration)/zlibwapi.pdb" Pack="true" PackagePath="runtimes/win-x64/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('Windows'))" Include="../vstudio/vc17/arm/ZlibDll$(Configuration)/zlibwapi.pdb" Pack="true" PackagePath="runtimes/win-arm/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('Windows'))" Include="../vstudio/vc17/arm64/ZlibDll$(Configuration)/zlibwapi.pdb" Pack="true" PackagePath="runtimes/win-arm64/native" />
+ <!-- Package up Linux builds. -->
+ <None Condition="$([MSBuild]::IsOSPlatform('Linux'))" Include="./linux-x86/libz.so" Pack="true" PackagePath="runtimes/linux-x86/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('Linux'))" Include="./linux-x64/libz.so" Pack="true" PackagePath="runtimes/linux-x64/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('Linux'))" Include="./linux-arm/libz.so" Pack="true" PackagePath="runtimes/linux-arm/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('Linux'))" Include="./linux-arm64/libz.so" Pack="true" PackagePath="runtimes/linux-arm64/native" />
+ <!-- Package up MacOS builds. -->
+ <None Condition="$([MSBuild]::IsOSPlatform('OSX'))" Include="./osx-x64/libz.dylib" Pack="true" PackagePath="runtimes/osx-x64/native" />
+ <None Condition="$([MSBuild]::IsOSPlatform('OSX'))" Include="./osx-arm64/libz.dylib" Pack="true" PackagePath="runtimes/osx-arm64/native" />
+ </ItemGroup>
+
+</Project>
diff --git a/3rdparty/zlib/contrib/nuget/nuget.sln b/3rdparty/zlib/contrib/nuget/nuget.sln
new file mode 100644
index 00000000000..46ee8deab8f
--- /dev/null
+++ b/3rdparty/zlib/contrib/nuget/nuget.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nuget", "nuget.csproj", "{B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/3rdparty/zlib/contrib/pascal/zlibpas.pas b/3rdparty/zlib/contrib/pascal/zlibpas.pas
index a2b24a593fa..0cf0e7b82dc 100644
--- a/3rdparty/zlib/contrib/pascal/zlibpas.pas
+++ b/3rdparty/zlib/contrib/pascal/zlibpas.pas
@@ -10,7 +10,7 @@ unit zlibpas;
interface
const
- ZLIB_VERSION = '1.3.0';
+ ZLIB_VERSION = '1.3.1';
ZLIB_VERNUM = $12a0;
type
diff --git a/3rdparty/zlib/contrib/puff/puff.c b/3rdparty/zlib/contrib/puff/puff.c
index 6737ff6153f..d759825ab1d 100644
--- a/3rdparty/zlib/contrib/puff/puff.c
+++ b/3rdparty/zlib/contrib/puff/puff.c
@@ -593,10 +593,10 @@ local int fixed(struct state *s)
* provided for each of the literal/length symbols, and for each of the
* distance symbols.
*
- * - If a symbol is not used in the block, this is represented by a zero as
- * as the code length. This does not mean a zero-length code, but rather
- * that no code should be created for this symbol. There is no way in the
- * deflate format to represent a zero-length code.
+ * - If a symbol is not used in the block, this is represented by a zero as the
+ * code length. This does not mean a zero-length code, but rather that no
+ * code should be created for this symbol. There is no way in the deflate
+ * format to represent a zero-length code.
*
* - The maximum number of bits in a code is 15, so the possible lengths for
* any code are 1..15.
diff --git a/3rdparty/zlib/contrib/vstudio/readme.txt b/3rdparty/zlib/contrib/vstudio/readme.txt
index 8f6a677c60b..061bbc0e2d7 100644
--- a/3rdparty/zlib/contrib/vstudio/readme.txt
+++ b/3rdparty/zlib/contrib/vstudio/readme.txt
@@ -1,4 +1,4 @@
-Building instructions for the DLL versions of Zlib 1.3.0
+Building instructions for the DLL versions of Zlib 1.3.1
========================================================
This directory contains projects that build zlib and minizip using
@@ -40,6 +40,12 @@ Build instructions for Visual Studio 2015 (32 bits or 64 bits)
- Decompress current zlib, including all contrib/* files
- Open contrib\vstudio\vc14\zlibvc.sln with Microsoft Visual C++ 2015
+Build instructions for Visual Studio 2022 (64 bits)
+--------------------------------------------------------------
+- Decompress current zlib, including all contrib/* files
+- Open contrib\vstudio\vc143\zlibvc.sln with Microsoft Visual C++ 2022
+
+
Important
---------
@@ -71,5 +77,5 @@ Additional notes
Gilles Vollant
info@winimage.com
-Visual Studio 2013 and 2015 Projects from Sean Hunt
+Visual Studio 2013, 2015, and 2022 Projects from Sean Hunt
seandhunt_7@yahoo.com
diff --git a/3rdparty/zlib/contrib/vstudio/vc10/zlib.rc b/3rdparty/zlib/contrib/vstudio/vc10/zlib.rc
index 57fb31a3216..a55f341c74c 100644
--- a/3rdparty/zlib/contrib/vstudio/vc10/zlib.rc
+++ b/3rdparty/zlib/contrib/vstudio/vc10/zlib.rc
@@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
- FILEVERSION 1, 3, 0, 0
- PRODUCTVERSION 1, 3, 0, 0
+ FILEVERSION 1, 3, 1, 0
+ PRODUCTVERSION 1, 3, 1, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
- VALUE "FileVersion", "1.3.0\0"
+ VALUE "FileVersion", "1.3.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
- VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
+ VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
diff --git a/3rdparty/zlib/contrib/vstudio/vc10/zlibvc.def b/3rdparty/zlib/contrib/vstudio/vc10/zlibvc.def
index c34923505a0..53947cc31b7 100644
--- a/3rdparty/zlib/contrib/vstudio/vc10/zlibvc.def
+++ b/3rdparty/zlib/contrib/vstudio/vc10/zlibvc.def
@@ -1,7 +1,7 @@
LIBRARY
; zlib data compression and ZIP file I/O library
-VERSION 1.3
+VERSION 1.3.1
EXPORTS
adler32 @1
diff --git a/3rdparty/zlib/contrib/vstudio/vc11/zlib.rc b/3rdparty/zlib/contrib/vstudio/vc11/zlib.rc
index 57fb31a3216..a55f341c74c 100644
--- a/3rdparty/zlib/contrib/vstudio/vc11/zlib.rc
+++ b/3rdparty/zlib/contrib/vstudio/vc11/zlib.rc
@@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
- FILEVERSION 1, 3, 0, 0
- PRODUCTVERSION 1, 3, 0, 0
+ FILEVERSION 1, 3, 1, 0
+ PRODUCTVERSION 1, 3, 1, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
- VALUE "FileVersion", "1.3.0\0"
+ VALUE "FileVersion", "1.3.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
- VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
+ VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
diff --git a/3rdparty/zlib/contrib/vstudio/vc11/zlibvc.def b/3rdparty/zlib/contrib/vstudio/vc11/zlibvc.def
index c34923505a0..53947cc31b7 100644
--- a/3rdparty/zlib/contrib/vstudio/vc11/zlibvc.def
+++ b/3rdparty/zlib/contrib/vstudio/vc11/zlibvc.def
@@ -1,7 +1,7 @@
LIBRARY
; zlib data compression and ZIP file I/O library
-VERSION 1.3
+VERSION 1.3.1
EXPORTS
adler32 @1
diff --git a/3rdparty/zlib/contrib/vstudio/vc12/zlib.rc b/3rdparty/zlib/contrib/vstudio/vc12/zlib.rc
index 57fb31a3216..a55f341c74c 100644
--- a/3rdparty/zlib/contrib/vstudio/vc12/zlib.rc
+++ b/3rdparty/zlib/contrib/vstudio/vc12/zlib.rc
@@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
- FILEVERSION 1, 3, 0, 0
- PRODUCTVERSION 1, 3, 0, 0
+ FILEVERSION 1, 3, 1, 0
+ PRODUCTVERSION 1, 3, 1, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
- VALUE "FileVersion", "1.3.0\0"
+ VALUE "FileVersion", "1.3.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
- VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
+ VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
diff --git a/3rdparty/zlib/contrib/vstudio/vc12/zlibvc.def b/3rdparty/zlib/contrib/vstudio/vc12/zlibvc.def
index c34923505a0..53947cc31b7 100644
--- a/3rdparty/zlib/contrib/vstudio/vc12/zlibvc.def
+++ b/3rdparty/zlib/contrib/vstudio/vc12/zlibvc.def
@@ -1,7 +1,7 @@
LIBRARY
; zlib data compression and ZIP file I/O library
-VERSION 1.3
+VERSION 1.3.1
EXPORTS
adler32 @1
diff --git a/3rdparty/zlib/contrib/vstudio/vc14/zlib.rc b/3rdparty/zlib/contrib/vstudio/vc14/zlib.rc
index 57fb31a3216..a55f341c74c 100644
--- a/3rdparty/zlib/contrib/vstudio/vc14/zlib.rc
+++ b/3rdparty/zlib/contrib/vstudio/vc14/zlib.rc
@@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
- FILEVERSION 1, 3, 0, 0
- PRODUCTVERSION 1, 3, 0, 0
+ FILEVERSION 1, 3, 1, 0
+ PRODUCTVERSION 1, 3, 1, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
- VALUE "FileVersion", "1.3.0\0"
+ VALUE "FileVersion", "1.3.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
- VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
+ VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
diff --git a/3rdparty/zlib/contrib/vstudio/vc14/zlibvc.def b/3rdparty/zlib/contrib/vstudio/vc14/zlibvc.def
index c34923505a0..53947cc31b7 100644
--- a/3rdparty/zlib/contrib/vstudio/vc14/zlibvc.def
+++ b/3rdparty/zlib/contrib/vstudio/vc14/zlibvc.def
@@ -1,7 +1,7 @@
LIBRARY
; zlib data compression and ZIP file I/O library
-VERSION 1.3
+VERSION 1.3.1
EXPORTS
adler32 @1
diff --git a/3rdparty/zlib/contrib/vstudio/vc17/miniunz.vcxproj b/3rdparty/zlib/contrib/vstudio/vc17/miniunz.vcxproj
new file mode 100644
index 00000000000..68ef16588b2
--- /dev/null
+++ b/3rdparty/zlib/contrib/vstudio/vc17/miniunz.vcxproj
@@ -0,0 +1,409 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C52F9E7B-498A-42BE-8DB4-85A15694382A}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <OutDir>arm64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir>arm64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <OutDir>arm64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir>arm64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <OutDir>arm\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir>arm\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <OutDir>arm\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir>arm\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <Midl />
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <Midl />
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <Midl />
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <Midl />
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\minizip\miniunz.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="zlibvc.vcxproj">
+ <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/3rdparty/zlib/contrib/vstudio/vc17/minizip.vcxproj b/3rdparty/zlib/contrib/vstudio/vc17/minizip.vcxproj
new file mode 100644
index 00000000000..dd3c52e70c9
--- /dev/null
+++ b/3rdparty/zlib/contrib/vstudio/vc17/minizip.vcxproj
@@ -0,0 +1,405 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniZip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniZip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniZip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniZip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</LinkIncremental>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <OutDir>arm64\MiniZip$(Configuration)\</OutDir>
+ <IntDir>arm64\MiniZip$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <OutDir>arm64\MiniZip$(Configuration)\</OutDir>
+ <IntDir>arm64\MiniZip$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <OutDir>arm\MiniZip$(Configuration)\</OutDir>
+ <IntDir>arm\MiniZip$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <OutDir>arm\MiniZip$(Configuration)\</OutDir>
+ <IntDir>arm\MiniZip$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <Midl />
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <Midl />
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <Midl />
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <Midl />
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\minizip\minizip.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="zlibvc.vcxproj">
+ <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/3rdparty/zlib/contrib/vstudio/vc17/testzlib.vcxproj b/3rdparty/zlib/contrib/vstudio/vc17/testzlib.vcxproj
new file mode 100644
index 00000000000..4cc99b3ffe1
--- /dev/null
+++ b/3rdparty/zlib/contrib/vstudio/vc17/testzlib.vcxproj
@@ -0,0 +1,473 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|ARM">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|ARM64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Win32">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|x64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}</ProjectGuid>
+ <RootNamespace>testzlib</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <OutDir>arm64\TestZlib$(Configuration)\</OutDir>
+ <IntDir>arm64\TestZlib$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <OutDir>arm64\TestZlib$(Configuration)\</OutDir>
+ <IntDir>arm64\TestZlib$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">
+ <OutDir>arm64\TestZlib$(Configuration)\</OutDir>
+ <IntDir>arm64\TestZlib$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <OutDir>arm\TestZlib$(Configuration)\</OutDir>
+ <IntDir>arm\TestZlib$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <OutDir>arm\TestZlib$(Configuration)\</OutDir>
+ <IntDir>arm\TestZlib$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">
+ <OutDir>arm\TestZlib$(Configuration)\</OutDir>
+ <IntDir>arm\TestZlib$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c" />
+ <ClCompile Include="..\..\..\compress.c" />
+ <ClCompile Include="..\..\..\crc32.c" />
+ <ClCompile Include="..\..\..\deflate.c" />
+ <ClCompile Include="..\..\..\infback.c" />
+ <ClCompile Include="..\..\..\inffast.c" />
+ <ClCompile Include="..\..\..\inflate.c" />
+ <ClCompile Include="..\..\..\inftrees.c" />
+ <ClCompile Include="..\..\testzlib\testzlib.c" />
+ <ClCompile Include="..\..\..\trees.c" />
+ <ClCompile Include="..\..\..\uncompr.c" />
+ <ClCompile Include="..\..\..\zutil.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/3rdparty/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj b/3rdparty/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj
new file mode 100644
index 00000000000..73bba55da80
--- /dev/null
+++ b/3rdparty/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj
@@ -0,0 +1,409 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C52F9E7B-498A-42BE-8DB4-85A15694366A}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <OutDir>arm64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <OutDir>arm64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <OutDir>arm\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <OutDir>arm\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <Midl />
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <Midl />
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <Midl />
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <Midl />
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\testzlib\testzlib.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="zlibvc.vcxproj">
+ <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/3rdparty/zlib/contrib/vstudio/vc17/zlib.rc b/3rdparty/zlib/contrib/vstudio/vc17/zlib.rc
new file mode 100644
index 00000000000..a55f341c74c
--- /dev/null
+++ b/3rdparty/zlib/contrib/vstudio/vc17/zlib.rc
@@ -0,0 +1,32 @@
+#include <windows.h>
+
+#define IDR_VERSION1 1
+IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
+ FILEVERSION 1, 3, 1, 0
+ PRODUCTVERSION 1, 3, 1, 0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS_DOS_WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0 // not used
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ //language ID = U.S. English, char set = Windows, Multilingual
+
+ BEGIN
+ VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
+ VALUE "FileVersion", "1.3.1\0"
+ VALUE "InternalName", "zlib\0"
+ VALUE "OriginalFilename", "zlibwapi.dll\0"
+ VALUE "ProductName", "ZLib.DLL\0"
+ VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
+ VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1252
+ END
+END
diff --git a/3rdparty/zlib/contrib/vstudio/vc17/zlibstat.vcxproj b/3rdparty/zlib/contrib/vstudio/vc17/zlibstat.vcxproj
new file mode 100644
index 00000000000..b946ac2a90f
--- /dev/null
+++ b/3rdparty/zlib/contrib/vstudio/vc17/zlibstat.vcxproj
@@ -0,0 +1,602 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|ARM">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|ARM64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Win32">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|x64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}</ProjectGuid>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <OutDir>arm64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir>arm64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <OutDir>arm64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir>arm64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">
+ <OutDir>arm64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir>arm64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <OutDir>arm\ZlibStat$(Configuration)\</OutDir>
+ <IntDir>arm\ZlibStat$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <OutDir>arm\ZlibStat$(Configuration)\</OutDir>
+ <IntDir>arm\ZlibStat$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">
+ <OutDir>arm\ZlibStat$(Configuration)\</OutDir>
+ <IntDir>arm\ZlibStat$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <Midl />
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:ARM64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <Midl />
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:ARM /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <Midl />
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:ARM64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <Midl />
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:ARM /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">
+ <Midl />
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:ARM64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">
+ <Midl />
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:ARM /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c" />
+ <ClCompile Include="..\..\..\compress.c" />
+ <ClCompile Include="..\..\..\crc32.c" />
+ <ClCompile Include="..\..\..\deflate.c" />
+ <ClCompile Include="..\..\..\gzclose.c" />
+ <ClCompile Include="..\..\..\gzlib.c" />
+ <ClCompile Include="..\..\..\gzread.c" />
+ <ClCompile Include="..\..\..\gzwrite.c" />
+ <ClCompile Include="..\..\..\infback.c" />
+ <ClCompile Include="..\..\..\inffast.c" />
+ <ClCompile Include="..\..\..\inflate.c" />
+ <ClCompile Include="..\..\..\inftrees.c" />
+ <ClCompile Include="..\..\minizip\ioapi.c" />
+ <ClCompile Include="..\..\..\trees.c" />
+ <ClCompile Include="..\..\..\uncompr.c" />
+ <ClCompile Include="..\..\minizip\unzip.c" />
+ <ClCompile Include="..\..\minizip\zip.c" />
+ <ClCompile Include="..\..\..\zutil.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="zlib.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="zlibvc.def" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/3rdparty/zlib/contrib/vstudio/vc17/zlibvc.def b/3rdparty/zlib/contrib/vstudio/vc17/zlibvc.def
new file mode 100644
index 00000000000..53947cc31b7
--- /dev/null
+++ b/3rdparty/zlib/contrib/vstudio/vc17/zlibvc.def
@@ -0,0 +1,158 @@
+LIBRARY
+; zlib data compression and ZIP file I/O library
+
+VERSION 1.3.1
+
+EXPORTS
+ adler32 @1
+ compress @2
+ crc32 @3
+ deflate @4
+ deflateCopy @5
+ deflateEnd @6
+ deflateInit2_ @7
+ deflateInit_ @8
+ deflateParams @9
+ deflateReset @10
+ deflateSetDictionary @11
+ gzclose @12
+ gzdopen @13
+ gzerror @14
+ gzflush @15
+ gzopen @16
+ gzread @17
+ gzwrite @18
+ inflate @19
+ inflateEnd @20
+ inflateInit2_ @21
+ inflateInit_ @22
+ inflateReset @23
+ inflateSetDictionary @24
+ inflateSync @25
+ uncompress @26
+ zlibVersion @27
+ gzprintf @28
+ gzputc @29
+ gzgetc @30
+ gzseek @31
+ gzrewind @32
+ gztell @33
+ gzeof @34
+ gzsetparams @35
+ zError @36
+ inflateSyncPoint @37
+ get_crc_table @38
+ compress2 @39
+ gzputs @40
+ gzgets @41
+ inflateCopy @42
+ inflateBackInit_ @43
+ inflateBack @44
+ inflateBackEnd @45
+ compressBound @46
+ deflateBound @47
+ gzclearerr @48
+ gzungetc @49
+ zlibCompileFlags @50
+ deflatePrime @51
+ deflatePending @52
+
+ unzOpen @61
+ unzClose @62
+ unzGetGlobalInfo @63
+ unzGetCurrentFileInfo @64
+ unzGoToFirstFile @65
+ unzGoToNextFile @66
+ unzOpenCurrentFile @67
+ unzReadCurrentFile @68
+ unzOpenCurrentFile3 @69
+ unztell @70
+ unzeof @71
+ unzCloseCurrentFile @72
+ unzGetGlobalComment @73
+ unzStringFileNameCompare @74
+ unzLocateFile @75
+ unzGetLocalExtrafield @76
+ unzOpen2 @77
+ unzOpenCurrentFile2 @78
+ unzOpenCurrentFilePassword @79
+
+ zipOpen @80
+ zipOpenNewFileInZip @81
+ zipWriteInFileInZip @82
+ zipCloseFileInZip @83
+ zipClose @84
+ zipOpenNewFileInZip2 @86
+ zipCloseFileInZipRaw @87
+ zipOpen2 @88
+ zipOpenNewFileInZip3 @89
+
+ unzGetFilePos @100
+ unzGoToFilePos @101
+
+ fill_win32_filefunc @110
+
+; zlibwapi v1.2.4 added:
+ fill_win32_filefunc64 @111
+ fill_win32_filefunc64A @112
+ fill_win32_filefunc64W @113
+
+ unzOpen64 @120
+ unzOpen2_64 @121
+ unzGetGlobalInfo64 @122
+ unzGetCurrentFileInfo64 @124
+ unzGetCurrentFileZStreamPos64 @125
+ unztell64 @126
+ unzGetFilePos64 @127
+ unzGoToFilePos64 @128
+
+ zipOpen64 @130
+ zipOpen2_64 @131
+ zipOpenNewFileInZip64 @132
+ zipOpenNewFileInZip2_64 @133
+ zipOpenNewFileInZip3_64 @134
+ zipOpenNewFileInZip4_64 @135
+ zipCloseFileInZipRaw64 @136
+
+; zlib1 v1.2.4 added:
+ adler32_combine @140
+ crc32_combine @142
+ deflateSetHeader @144
+ deflateTune @145
+ gzbuffer @146
+ gzclose_r @147
+ gzclose_w @148
+ gzdirect @149
+ gzoffset @150
+ inflateGetHeader @156
+ inflateMark @157
+ inflatePrime @158
+ inflateReset2 @159
+ inflateUndermine @160
+
+; zlib1 v1.2.6 added:
+ gzgetc_ @161
+ inflateResetKeep @163
+ deflateResetKeep @164
+
+; zlib1 v1.2.7 added:
+ gzopen_w @165
+
+; zlib1 v1.2.8 added:
+ inflateGetDictionary @166
+ gzvprintf @167
+
+; zlib1 v1.2.9 added:
+ inflateCodesUsed @168
+ inflateValidate @169
+ uncompress2 @170
+ gzfread @171
+ gzfwrite @172
+ deflateGetDictionary @173
+ adler32_z @174
+ crc32_z @175
+
+; zlib1 v1.2.12 added:
+ crc32_combine_gen @176
+ crc32_combine_gen64 @177
+ crc32_combine_op @178
diff --git a/3rdparty/zlib/contrib/vstudio/vc17/zlibvc.sln b/3rdparty/zlib/contrib/vstudio/vc17/zlibvc.sln
new file mode 100644
index 00000000000..67896b7470d
--- /dev/null
+++ b/3rdparty/zlib/contrib/vstudio/vc17/zlibvc.sln
@@ -0,0 +1,179 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.4.33015.44
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcxproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlibdll", "testzlibdll.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcxproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|ARM64 = Debug|ARM64
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ ReleaseWithoutAsm|ARM = ReleaseWithoutAsm|ARM
+ ReleaseWithoutAsm|ARM64 = ReleaseWithoutAsm|ARM64
+ ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
+ ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|ARM.ActiveCfg = Debug|ARM
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|ARM.Build.0 = Debug|ARM
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|ARM64.Build.0 = Debug|ARM64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|ARM.ActiveCfg = Release|ARM
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|ARM.Build.0 = Release|ARM
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|ARM64.ActiveCfg = Release|ARM64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|ARM64.Build.0 = Release|ARM64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|ARM.ActiveCfg = ReleaseWithoutAsm|ARM
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|ARM.Build.0 = ReleaseWithoutAsm|ARM
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|ARM64.ActiveCfg = ReleaseWithoutAsm|ARM64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|ARM64.Build.0 = ReleaseWithoutAsm|ARM64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|ARM.ActiveCfg = Debug|ARM
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|ARM.Build.0 = Debug|ARM
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|ARM64.Build.0 = Debug|ARM64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|ARM.ActiveCfg = Release|ARM
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|ARM.Build.0 = Release|ARM
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|ARM64.ActiveCfg = Release|ARM64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|ARM64.Build.0 = Release|ARM64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|ARM.ActiveCfg = ReleaseWithoutAsm|ARM
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|ARM.Build.0 = ReleaseWithoutAsm|ARM
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|ARM64.ActiveCfg = ReleaseWithoutAsm|ARM64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|ARM64.Build.0 = ReleaseWithoutAsm|ARM64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM.ActiveCfg = Debug|ARM
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM.Build.0 = Debug|ARM
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM64.Build.0 = Debug|ARM64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM.ActiveCfg = Release|ARM
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM.Build.0 = Release|ARM
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM64.ActiveCfg = Release|ARM64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM64.Build.0 = Release|ARM64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM.ActiveCfg = ReleaseWithoutAsm|ARM
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM.Build.0 = ReleaseWithoutAsm|ARM
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM64.ActiveCfg = ReleaseWithoutAsm|ARM64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM64.Build.0 = ReleaseWithoutAsm|ARM64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|ARM.ActiveCfg = Debug|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|ARM.Build.0 = Debug|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|ARM64.Build.0 = Debug|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|ARM.ActiveCfg = Release|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|ARM.Build.0 = Release|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|ARM64.ActiveCfg = Release|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|ARM64.Build.0 = Release|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|ARM.ActiveCfg = Release|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|ARM.Build.0 = Release|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|ARM64.ActiveCfg = Release|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|ARM64.Build.0 = Release|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM.ActiveCfg = Debug|ARM
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM.Build.0 = Debug|ARM
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM64.Build.0 = Debug|ARM64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM.ActiveCfg = Release|ARM
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM.Build.0 = Release|ARM
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM64.ActiveCfg = Release|ARM64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM64.Build.0 = Release|ARM64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM.ActiveCfg = Release|ARM
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM.Build.0 = Release|ARM
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM64.ActiveCfg = Release|ARM64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM64.Build.0 = Release|ARM64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|ARM.ActiveCfg = Debug|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|ARM.Build.0 = Debug|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|ARM64.Build.0 = Debug|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|ARM.ActiveCfg = Release|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|ARM.Build.0 = Release|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|ARM64.ActiveCfg = Release|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|ARM64.Build.0 = Release|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|ARM.ActiveCfg = Release|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|ARM.Build.0 = Release|ARM
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|ARM64.ActiveCfg = Release|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|ARM64.Build.0 = Release|ARM64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {EAA58685-56D9-43F2-8703-FD2CB020745E}
+ EndGlobalSection
+EndGlobal
diff --git a/3rdparty/zlib/contrib/vstudio/vc17/zlibvc.vcxproj b/3rdparty/zlib/contrib/vstudio/vc17/zlibvc.vcxproj
new file mode 100644
index 00000000000..10a7a901efe
--- /dev/null
+++ b/3rdparty/zlib/contrib/vstudio/vc17/zlibvc.vcxproj
@@ -0,0 +1,875 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|ARM">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|ARM64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Win32">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|x64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{8FD826F8-3739-44E6-8CC8-997122E53B8D}</ProjectGuid>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</GenerateManifest>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">zlibwapi</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <OutDir>arm64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <OutDir>arm\ZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm\ZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <OutDir>arm64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">
+ <OutDir>arm64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <OutDir>arm\ZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm\ZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">
+ <OutDir>arm\ZlibDll$(Configuration)\</OutDir>
+ <IntDir>arm\ZlibDll$(Configuration)\Tmp\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|ARM'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c" />
+ <ClCompile Include="..\..\..\compress.c" />
+ <ClCompile Include="..\..\..\crc32.c" />
+ <ClCompile Include="..\..\..\deflate.c" />
+ <ClCompile Include="..\..\..\gzclose.c" />
+ <ClCompile Include="..\..\..\gzlib.c" />
+ <ClCompile Include="..\..\..\gzread.c" />
+ <ClCompile Include="..\..\..\gzwrite.c" />
+ <ClCompile Include="..\..\..\infback.c" />
+ <ClCompile Include="..\..\..\inffast.c" />
+ <ClCompile Include="..\..\..\inflate.c" />
+ <ClCompile Include="..\..\..\inftrees.c" />
+ <ClCompile Include="..\..\minizip\ioapi.c" />
+ <ClCompile Include="..\..\minizip\iowin32.c" />
+ <ClCompile Include="..\..\..\trees.c" />
+ <ClCompile Include="..\..\..\uncompr.c" />
+ <ClCompile Include="..\..\minizip\unzip.c">
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\zip.c">
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <ClCompile Include="..\..\..\zutil.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="zlib.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="zlibvc.def" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\deflate.h" />
+ <ClInclude Include="..\..\..\infblock.h" />
+ <ClInclude Include="..\..\..\infcodes.h" />
+ <ClInclude Include="..\..\..\inffast.h" />
+ <ClInclude Include="..\..\..\inftrees.h" />
+ <ClInclude Include="..\..\..\infutil.h" />
+ <ClInclude Include="..\..\..\zconf.h" />
+ <ClInclude Include="..\..\..\zlib.h" />
+ <ClInclude Include="..\..\..\zutil.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/3rdparty/zlib/contrib/vstudio/vc9/zlib.rc b/3rdparty/zlib/contrib/vstudio/vc9/zlib.rc
index 57fb31a3216..a55f341c74c 100644
--- a/3rdparty/zlib/contrib/vstudio/vc9/zlib.rc
+++ b/3rdparty/zlib/contrib/vstudio/vc9/zlib.rc
@@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
- FILEVERSION 1, 3, 0, 0
- PRODUCTVERSION 1, 3, 0, 0
+ FILEVERSION 1, 3, 1, 0
+ PRODUCTVERSION 1, 3, 1, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
- VALUE "FileVersion", "1.3.0\0"
+ VALUE "FileVersion", "1.3.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
- VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
+ VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
diff --git a/3rdparty/zlib/contrib/vstudio/vc9/zlibvc.def b/3rdparty/zlib/contrib/vstudio/vc9/zlibvc.def
index c34923505a0..53947cc31b7 100644
--- a/3rdparty/zlib/contrib/vstudio/vc9/zlibvc.def
+++ b/3rdparty/zlib/contrib/vstudio/vc9/zlibvc.def
@@ -1,7 +1,7 @@
LIBRARY
; zlib data compression and ZIP file I/O library
-VERSION 1.3
+VERSION 1.3.1
EXPORTS
adler32 @1
diff --git a/3rdparty/zlib/deflate.c b/3rdparty/zlib/deflate.c
index bd011751920..012ea8148e8 100644
--- a/3rdparty/zlib/deflate.c
+++ b/3rdparty/zlib/deflate.c
@@ -1,5 +1,5 @@
/* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -52,7 +52,7 @@
#include "deflate.h"
const char deflate_copyright[] =
- " deflate 1.3 Copyright 1995-2023 Jean-loup Gailly and Mark Adler ";
+ " deflate 1.3.1 Copyright 1995-2024 Jean-loup Gailly and Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -493,7 +493,7 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
* symbols from which it is being constructed.
*/
- s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4);
+ s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS);
s->pending_buf_size = (ulg)s->lit_bufsize * 4;
if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
@@ -503,8 +503,14 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
deflateEnd (strm);
return Z_MEM_ERROR;
}
+#ifdef LIT_MEM
+ s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1));
+ s->l_buf = s->pending_buf + (s->lit_bufsize << 2);
+ s->sym_end = s->lit_bufsize - 1;
+#else
s->sym_buf = s->pending_buf + s->lit_bufsize;
s->sym_end = (s->lit_bufsize - 1) * 3;
+#endif
/* We avoid equality with lit_bufsize*3 because of wraparound at 64K
* on 16 bit machines and because stored blocks are restricted to
* 64K-1 bytes.
@@ -720,9 +726,15 @@ int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) {
if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
s = strm->state;
+#ifdef LIT_MEM
+ if (bits < 0 || bits > 16 ||
+ (uchf *)s->d_buf < s->pending_out + ((Buf_size + 7) >> 3))
+ return Z_BUF_ERROR;
+#else
if (bits < 0 || bits > 16 ||
s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
return Z_BUF_ERROR;
+#endif
do {
put = Buf_size - s->bi_valid;
if (put > bits)
@@ -1294,7 +1306,7 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) {
ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
- ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4);
+ ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, LIT_BUFS);
if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
ds->pending_buf == Z_NULL) {
@@ -1305,10 +1317,15 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) {
zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
- zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+ zmemcpy(ds->pending_buf, ss->pending_buf, ds->lit_bufsize * LIT_BUFS);
ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+#ifdef LIT_MEM
+ ds->d_buf = (ushf *)(ds->pending_buf + (ds->lit_bufsize << 1));
+ ds->l_buf = ds->pending_buf + (ds->lit_bufsize << 2);
+#else
ds->sym_buf = ds->pending_buf + ds->lit_bufsize;
+#endif
ds->l_desc.dyn_tree = ds->dyn_ltree;
ds->d_desc.dyn_tree = ds->dyn_dtree;
@@ -1539,13 +1556,21 @@ local uInt longest_match(deflate_state *s, IPos cur_match) {
*/
local void check_match(deflate_state *s, IPos start, IPos match, int length) {
/* check that the match is indeed a match */
- if (zmemcmp(s->window + match,
- s->window + start, length) != EQUAL) {
- fprintf(stderr, " start %u, match %u, length %d\n",
- start, match, length);
+ Bytef *back = s->window + (int)match, *here = s->window + start;
+ IPos len = length;
+ if (match == (IPos)-1) {
+ /* match starts one byte before the current window -- just compare the
+ subsequent length-1 bytes */
+ back++;
+ here++;
+ len--;
+ }
+ if (zmemcmp(back, here, len) != EQUAL) {
+ fprintf(stderr, " start %u, match %d, length %d\n",
+ start, (int)match, length);
do {
- fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
- } while (--length != 0);
+ fprintf(stderr, "(%02x %02x)", *back++, *here++);
+ } while (--len != 0);
z_error("invalid match");
}
if (z_verbose > 1) {
diff --git a/3rdparty/zlib/deflate.h b/3rdparty/zlib/deflate.h
index 8696791429f..300c6ada62b 100644
--- a/3rdparty/zlib/deflate.h
+++ b/3rdparty/zlib/deflate.h
@@ -1,5 +1,5 @@
/* deflate.h -- internal compression state
- * Copyright (C) 1995-2018 Jean-loup Gailly
+ * Copyright (C) 1995-2024 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -23,6 +23,10 @@
# define GZIP
#endif
+/* define LIT_MEM to slightly increase the speed of deflate (order 1% to 2%) at
+ the cost of a larger memory footprint */
+/* #define LIT_MEM */
+
/* ===========================================================================
* Internal compression state.
*/
@@ -217,7 +221,14 @@ typedef struct internal_state {
/* Depth of each subtree used as tie breaker for trees of equal frequency
*/
+#ifdef LIT_MEM
+# define LIT_BUFS 5
+ ushf *d_buf; /* buffer for distances */
+ uchf *l_buf; /* buffer for literals/lengths */
+#else
+# define LIT_BUFS 4
uchf *sym_buf; /* buffer for distances and literals/lengths */
+#endif
uInt lit_bufsize;
/* Size of match buffer for literals/lengths. There are 4 reasons for
@@ -239,7 +250,7 @@ typedef struct internal_state {
* - I can't count above 4
*/
- uInt sym_next; /* running index in sym_buf */
+ uInt sym_next; /* running index in symbol buffer */
uInt sym_end; /* symbol table full when sym_next reaches this */
ulg opt_len; /* bit length of current block with optimal trees */
@@ -318,6 +329,25 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf,
extern const uch ZLIB_INTERNAL _dist_code[];
#endif
+#ifdef LIT_MEM
+# define _tr_tally_lit(s, c, flush) \
+ { uch cc = (c); \
+ s->d_buf[s->sym_next] = 0; \
+ s->l_buf[s->sym_next++] = cc; \
+ s->dyn_ltree[cc].Freq++; \
+ flush = (s->sym_next == s->sym_end); \
+ }
+# define _tr_tally_dist(s, distance, length, flush) \
+ { uch len = (uch)(length); \
+ ush dist = (ush)(distance); \
+ s->d_buf[s->sym_next] = dist; \
+ s->l_buf[s->sym_next++] = len; \
+ dist--; \
+ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
+ s->dyn_dtree[d_code(dist)].Freq++; \
+ flush = (s->sym_next == s->sym_end); \
+ }
+#else
# define _tr_tally_lit(s, c, flush) \
{ uch cc = (c); \
s->sym_buf[s->sym_next++] = 0; \
@@ -337,6 +367,7 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf,
s->dyn_dtree[d_code(dist)].Freq++; \
flush = (s->sym_next == s->sym_end); \
}
+#endif
#else
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
# define _tr_tally_dist(s, distance, length, flush) \
diff --git a/3rdparty/zlib/doc/algorithm.txt b/3rdparty/zlib/doc/algorithm.txt
index c97f495020b..029e5a31349 100644
--- a/3rdparty/zlib/doc/algorithm.txt
+++ b/3rdparty/zlib/doc/algorithm.txt
@@ -77,7 +77,7 @@ table took no time (and if you had infinite memory), then there would only
be a first level table to cover all the way to the longest code. However,
building the table ends up taking a lot longer for more bits since short
codes are replicated many times in such a table. What inflate() does is
-simply to make the number of bits in the first table a variable, and then
+simply to make the number of bits in the first table a variable, and then
to set that variable for the maximum speed.
For inflate, which has 286 possible codes for the literal/length tree, the size
diff --git a/3rdparty/zlib/examples/gzlog.c b/3rdparty/zlib/examples/gzlog.c
index b977802dd6e..da1b02e7337 100644
--- a/3rdparty/zlib/examples/gzlog.c
+++ b/3rdparty/zlib/examples/gzlog.c
@@ -212,8 +212,8 @@
to the appropriate recovery below. If there is no foo.add file, provide
a zero data length to the recovery. In that case, the append recovery
restores the foo.gz to the previous compressed + uncompressed data state.
- For the the compress recovery, a missing foo.add file results in foo.gz
- being restored to the previous compressed-only data state.
+ For the compress recovery, a missing foo.add file results in foo.gz being
+ restored to the previous compressed-only data state.
- Append recovery:
- Pick up append at + step above
- Compress recovery:
diff --git a/3rdparty/zlib/examples/zran.c b/3rdparty/zlib/examples/zran.c
index 32c93686c60..d3135955b02 100644
--- a/3rdparty/zlib/examples/zran.c
+++ b/3rdparty/zlib/examples/zran.c
@@ -267,7 +267,7 @@ static inline void append_bits(unsigned value, int bits,
}
}
-// Insert enough bits in the form of empty deflate blocks in front of the the
+// Insert enough bits in the form of empty deflate blocks in front of the
// low bits bits of value, in order to bring the sequence to a byte boundary.
// Then feed that to inflate(). This does what inflatePrime() does, except that
// a negative value of bits is not supported. bits must be in 0..16. If the
diff --git a/3rdparty/zlib/gzguts.h b/3rdparty/zlib/gzguts.h
index f9375047e8c..eba72085bb7 100644
--- a/3rdparty/zlib/gzguts.h
+++ b/3rdparty/zlib/gzguts.h
@@ -1,5 +1,5 @@
/* gzguts.h -- zlib internal header definitions for gz* operations
- * Copyright (C) 2004-2019 Mark Adler
+ * Copyright (C) 2004-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -210,9 +210,5 @@ char ZLIB_INTERNAL *gz_strwinerror(DWORD error);
/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
value -- needed when comparing unsigned to z_off64_t, which is signed
(possible z_off64_t types off_t, off64_t, and long are all signed) */
-#ifdef INT_MAX
-# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
-#else
unsigned ZLIB_INTERNAL gz_intmax(void);
-# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
-#endif
+#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
diff --git a/3rdparty/zlib/gzlib.c b/3rdparty/zlib/gzlib.c
index 29fc4486fba..983153cc8e4 100644
--- a/3rdparty/zlib/gzlib.c
+++ b/3rdparty/zlib/gzlib.c
@@ -1,5 +1,5 @@
/* gzlib.c -- zlib functions common to reading and writing gzip files
- * Copyright (C) 2004-2019 Mark Adler
+ * Copyright (C) 2004-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -563,20 +563,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
#endif
}
-#ifndef INT_MAX
/* portably return maximum value for an int (when limits.h presumed not
available) -- we need to do this to cover cases where 2's complement not
used, since C standard permits 1's complement and sign-bit representations,
otherwise we could just use ((unsigned)-1) >> 1 */
unsigned ZLIB_INTERNAL gz_intmax(void) {
- unsigned p, q;
-
- p = 1;
+#ifdef INT_MAX
+ return INT_MAX;
+#else
+ unsigned p = 1, q;
do {
q = p;
p <<= 1;
p++;
} while (p > q);
return q >> 1;
-}
#endif
+}
diff --git a/3rdparty/zlib/inflate.c b/3rdparty/zlib/inflate.c
index b0757a9b249..94ecff015a9 100644
--- a/3rdparty/zlib/inflate.c
+++ b/3rdparty/zlib/inflate.c
@@ -1387,7 +1387,7 @@ int ZEXPORT inflateSync(z_streamp strm) {
/* if first time, start search in bit buffer */
if (state->mode != SYNC) {
state->mode = SYNC;
- state->hold <<= state->bits & 7;
+ state->hold >>= state->bits & 7;
state->bits -= state->bits & 7;
len = 0;
while (state->bits >= 8) {
diff --git a/3rdparty/zlib/inftrees.c b/3rdparty/zlib/inftrees.c
index 8a208c2daa8..98cfe164458 100644
--- a/3rdparty/zlib/inftrees.c
+++ b/3rdparty/zlib/inftrees.c
@@ -1,5 +1,5 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2023 Mark Adler
+ * Copyright (C) 1995-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate_copyright[] =
- " inflate 1.3 Copyright 1995-2023 Mark Adler ";
+ " inflate 1.3.1 Copyright 1995-2024 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -57,7 +57,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 198, 203};
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
diff --git a/3rdparty/zlib/inftrees.h b/3rdparty/zlib/inftrees.h
index a10712d8cb5..396f74b5da7 100644
--- a/3rdparty/zlib/inftrees.h
+++ b/3rdparty/zlib/inftrees.h
@@ -41,8 +41,8 @@ typedef struct {
examples/enough.c found in the zlib distribution. The arguments to that
program are the number of symbols, the initial root table size, and the
maximum bit length of a code. "enough 286 9 15" for literal/length codes
- returns returns 852, and "enough 30 6 15" for distance codes returns 592.
- The initial root table size (9 or 6) is found in the fifth argument of the
+ returns 852, and "enough 30 6 15" for distance codes returns 592. The
+ initial root table size (9 or 6) is found in the fifth argument of the
inflate_table() calls in inflate.c and infback.c. If the root table size is
changed, then these maximum sizes would be need to be recalculated and
updated. */
diff --git a/3rdparty/zlib/old/visual-basic.txt b/3rdparty/zlib/old/visual-basic.txt
index 57efe58124e..3c8d2a42dfc 100644
--- a/3rdparty/zlib/old/visual-basic.txt
+++ b/3rdparty/zlib/old/visual-basic.txt
@@ -115,7 +115,7 @@ SUCCESS Then
ReDim Preserve bytaryCpr(lngCprSiz - 1)
Open strCprPth For Binary Access Write As #1
Put #1, , bytaryCpr()
- Put #1, , lngOriSiz 'Add the the original size value to the end
+ Put #1, , lngOriSiz 'Add the original size value to the end
(last 4 bytes)
Close #1
Else
diff --git a/3rdparty/zlib/os400/README400 b/3rdparty/zlib/os400/README400
index 6dd41aa6510..30ed5a12c68 100644
--- a/3rdparty/zlib/os400/README400
+++ b/3rdparty/zlib/os400/README400
@@ -1,4 +1,4 @@
- ZLIB version 1.3.0 for OS/400 installation instructions
+ ZLIB version 1.3.1 for OS/400 installation instructions
1) Download and unpack the zlib tarball to some IFS directory.
(i.e.: /path/to/the/zlib/ifs/source/directory)
diff --git a/3rdparty/zlib/os400/zlib.inc b/3rdparty/zlib/os400/zlib.inc
index 0d9e2f2090b..744729ab9dd 100644
--- a/3rdparty/zlib/os400/zlib.inc
+++ b/3rdparty/zlib/os400/zlib.inc
@@ -1,7 +1,7 @@
* ZLIB.INC - Interface to the general purpose compression library
*
* ILE RPG400 version by Patrick Monnerat, DATASPHERE.
- * Version 1.3.0
+ * Version 1.3.1
*
*
* WARNING:
@@ -22,12 +22,12 @@
*
* Versioning information.
*
- D ZLIB_VERSION C '1.3.0'
+ D ZLIB_VERSION C '1.3.1'
D ZLIB_VERNUM C X'12a0'
D ZLIB_VER_MAJOR C 1
D ZLIB_VER_MINOR C 3
D ZLIB_VER_REVISION...
- D C 0
+ D C 1
D ZLIB_VER_SUBREVISION...
D C 0
*
diff --git a/3rdparty/zlib/qnx/package.qpg b/3rdparty/zlib/qnx/package.qpg
index d882af2bfb3..4877e0ef013 100644
--- a/3rdparty/zlib/qnx/package.qpg
+++ b/3rdparty/zlib/qnx/package.qpg
@@ -25,10 +25,10 @@
<QPG:Files>
<QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
<QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
- <QPG:Add file="../libz.so.1.3.0" install="/opt/lib/" user="root:bin" permission="644"/>
- <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.3.0"/>
- <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.3.0"/>
- <QPG:Add file="../libz.so.1.3.0" install="/opt/lib/" component="slib"/>
+ <QPG:Add file="../libz.so.1.3.1" install="/opt/lib/" user="root:bin" permission="644"/>
+ <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.3.1"/>
+ <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.3.1"/>
+ <QPG:Add file="../libz.so.1.3.1" install="/opt/lib/" component="slib"/>
</QPG:Files>
<QPG:PackageFilter>
@@ -63,7 +63,7 @@
</QPM:ProductDescription>
<QPM:ReleaseDescription>
- <QPM:ReleaseVersion>1.3.0</QPM:ReleaseVersion>
+ <QPM:ReleaseVersion>1.3.1</QPM:ReleaseVersion>
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
<QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
diff --git a/3rdparty/zlib/test/example.c b/3rdparty/zlib/test/example.c
index 582a17a3ce9..c3521dd5934 100644
--- a/3rdparty/zlib/test/example.c
+++ b/3rdparty/zlib/test/example.c
@@ -36,12 +36,12 @@ static uLong dictId; /* Adler32 value of the dictionary */
#ifdef Z_SOLO
-void *myalloc(void *q, unsigned n, unsigned m) {
+static void *myalloc(void *q, unsigned n, unsigned m) {
(void)q;
return calloc(n, m);
}
-void myfree(void *q, void *p) {
+static void myfree(void *q, void *p) {
(void)q;
free(p);
}
@@ -57,7 +57,7 @@ static free_func zfree = (free_func)0;
/* ===========================================================================
* Test compress() and uncompress()
*/
-void test_compress(Byte *compr, uLong comprLen, Byte *uncompr,
+static void test_compress(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
int err;
uLong len = (uLong)strlen(hello)+1;
@@ -81,7 +81,7 @@ void test_compress(Byte *compr, uLong comprLen, Byte *uncompr,
/* ===========================================================================
* Test read/write of .gz files
*/
-void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) {
+static void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) {
#ifdef NO_GZCOMPRESS
fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n");
#else
@@ -163,7 +163,7 @@ void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) {
/* ===========================================================================
* Test deflate() with small buffers
*/
-void test_deflate(Byte *compr, uLong comprLen) {
+static void test_deflate(Byte *compr, uLong comprLen) {
z_stream c_stream; /* compression stream */
int err;
uLong len = (uLong)strlen(hello)+1;
@@ -198,7 +198,7 @@ void test_deflate(Byte *compr, uLong comprLen) {
/* ===========================================================================
* Test inflate() with small buffers
*/
-void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
+static void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
int err;
z_stream d_stream; /* decompression stream */
@@ -237,7 +237,7 @@ void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
/* ===========================================================================
* Test deflate() with large buffers and dynamic change of compression level
*/
-void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr,
+static void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
z_stream c_stream; /* compression stream */
int err;
@@ -290,7 +290,7 @@ void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr,
/* ===========================================================================
* Test inflate() with large buffers
*/
-void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
+static void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
int err;
z_stream d_stream; /* decompression stream */
@@ -329,7 +329,7 @@ void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
/* ===========================================================================
* Test deflate() with full flush
*/
-void test_flush(Byte *compr, uLong *comprLen) {
+static void test_flush(Byte *compr, uLong *comprLen) {
z_stream c_stream; /* compression stream */
int err;
uInt len = (uInt)strlen(hello)+1;
@@ -364,7 +364,8 @@ void test_flush(Byte *compr, uLong *comprLen) {
/* ===========================================================================
* Test inflateSync()
*/
-void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) {
+static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr,
+ uLong uncomprLen) {
int err;
z_stream d_stream; /* decompression stream */
@@ -404,7 +405,7 @@ void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) {
/* ===========================================================================
* Test deflate() with preset dictionary
*/
-void test_dict_deflate(Byte *compr, uLong comprLen) {
+static void test_dict_deflate(Byte *compr, uLong comprLen) {
z_stream c_stream; /* compression stream */
int err;
@@ -438,7 +439,7 @@ void test_dict_deflate(Byte *compr, uLong comprLen) {
/* ===========================================================================
* Test inflate() with a preset dictionary
*/
-void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
+static void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
int err;
z_stream d_stream; /* decompression stream */
diff --git a/3rdparty/zlib/test/minigzip.c b/3rdparty/zlib/test/minigzip.c
index 8a21ddfb57e..134e10e6c3e 100644
--- a/3rdparty/zlib/test/minigzip.c
+++ b/3rdparty/zlib/test/minigzip.c
@@ -149,12 +149,12 @@ static void pwinerror (s)
# include <unistd.h> /* for unlink() */
#endif
-void *myalloc(void *q, unsigned n, unsigned m) {
+static void *myalloc(void *q, unsigned n, unsigned m) {
(void)q;
return calloc(n, m);
}
-void myfree(void *q, void *p) {
+static void myfree(void *q, void *p) {
(void)q;
free(p);
}
@@ -167,7 +167,7 @@ typedef struct gzFile_s {
z_stream strm;
} *gzFile;
-gzFile gz_open(const char *path, int fd, const char *mode) {
+static gzFile gz_open(const char *path, int fd, const char *mode) {
gzFile gz;
int ret;
@@ -201,15 +201,15 @@ gzFile gz_open(const char *path, int fd, const char *mode) {
return gz;
}
-gzFile gzopen(const char *path, const char *mode) {
+static gzFile gzopen(const char *path, const char *mode) {
return gz_open(path, -1, mode);
}
-gzFile gzdopen(int fd, const char *mode) {
+static gzFile gzdopen(int fd, const char *mode) {
return gz_open(NULL, fd, mode);
}
-int gzwrite(gzFile gz, const void *buf, unsigned len) {
+static int gzwrite(gzFile gz, const void *buf, unsigned len) {
z_stream *strm;
unsigned char out[BUFLEN];
@@ -227,7 +227,7 @@ int gzwrite(gzFile gz, const void *buf, unsigned len) {
return len;
}
-int gzread(gzFile gz, void *buf, unsigned len) {
+static int gzread(gzFile gz, void *buf, unsigned len) {
int ret;
unsigned got;
unsigned char in[1];
@@ -258,7 +258,7 @@ int gzread(gzFile gz, void *buf, unsigned len) {
return len - strm->avail_out;
}
-int gzclose(gzFile gz) {
+static int gzclose(gzFile gz) {
z_stream *strm;
unsigned char out[BUFLEN];
@@ -283,7 +283,7 @@ int gzclose(gzFile gz) {
return Z_OK;
}
-const char *gzerror(gzFile gz, int *err) {
+static const char *gzerror(gzFile gz, int *err) {
*err = gz->err;
return gz->msg;
}
@@ -295,7 +295,7 @@ static char *prog;
/* ===========================================================================
* Display error message and exit
*/
-void error(const char *msg) {
+static void error(const char *msg) {
fprintf(stderr, "%s: %s\n", prog, msg);
exit(1);
}
@@ -303,9 +303,9 @@ void error(const char *msg) {
#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
/* Try compressing the input file at once using mmap. Return Z_OK if
- * if success, Z_ERRNO otherwise.
+ * success, Z_ERRNO otherwise.
*/
-int gz_compress_mmap(FILE *in, gzFile out) {
+static int gz_compress_mmap(FILE *in, gzFile out) {
int len;
int err;
int ifd = fileno(in);
@@ -338,7 +338,7 @@ int gz_compress_mmap(FILE *in, gzFile out) {
* Compress input to output then close both files.
*/
-void gz_compress(FILE *in, gzFile out) {
+static void gz_compress(FILE *in, gzFile out) {
local char buf[BUFLEN];
int len;
int err;
@@ -366,7 +366,7 @@ void gz_compress(FILE *in, gzFile out) {
/* ===========================================================================
* Uncompress input to output then close both files.
*/
-void gz_uncompress(gzFile in, FILE *out) {
+static void gz_uncompress(gzFile in, FILE *out) {
local char buf[BUFLEN];
int len;
int err;
@@ -390,7 +390,7 @@ void gz_uncompress(gzFile in, FILE *out) {
* Compress the given file: create a corresponding .gz file and remove the
* original.
*/
-void file_compress(char *file, char *mode) {
+static void file_compress(char *file, char *mode) {
local char outfile[MAX_NAME_LEN];
FILE *in;
gzFile out;
@@ -426,7 +426,7 @@ void file_compress(char *file, char *mode) {
/* ===========================================================================
* Uncompress the given file and remove the original.
*/
-void file_uncompress(char *file) {
+static void file_uncompress(char *file) {
local char buf[MAX_NAME_LEN];
char *infile, *outfile;
FILE *out;
diff --git a/3rdparty/zlib/treebuild.xml b/3rdparty/zlib/treebuild.xml
index 1d1b007707c..930b00be4a8 100644
--- a/3rdparty/zlib/treebuild.xml
+++ b/3rdparty/zlib/treebuild.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" ?>
-<package name="zlib" version="1.3">
- <library name="zlib" dlversion="1.3" dlname="z">
+<package name="zlib" version="1.3.1">
+ <library name="zlib" dlversion="1.3.1" dlname="z">
<property name="description"> zip compression library </property>
<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
diff --git a/3rdparty/zlib/trees.c b/3rdparty/zlib/trees.c
index 8dbdc40bacc..6a523ef34e3 100644
--- a/3rdparty/zlib/trees.c
+++ b/3rdparty/zlib/trees.c
@@ -1,5 +1,5 @@
/* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2021 Jean-loup Gailly
+ * Copyright (C) 1995-2024 Jean-loup Gailly
* detect_data_type() function provided freely by Cosmin Truta, 2006
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -899,14 +899,19 @@ local void compress_block(deflate_state *s, const ct_data *ltree,
const ct_data *dtree) {
unsigned dist; /* distance of matched string */
int lc; /* match length or unmatched char (if dist == 0) */
- unsigned sx = 0; /* running index in sym_buf */
+ unsigned sx = 0; /* running index in symbol buffers */
unsigned code; /* the code to send */
int extra; /* number of extra bits to send */
if (s->sym_next != 0) do {
+#ifdef LIT_MEM
+ dist = s->d_buf[sx];
+ lc = s->l_buf[sx++];
+#else
dist = s->sym_buf[sx++] & 0xff;
dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
lc = s->sym_buf[sx++];
+#endif
if (dist == 0) {
send_code(s, lc, ltree); /* send a literal byte */
Tracecv(isgraph(lc), (stderr," '%c' ", lc));
@@ -931,8 +936,12 @@ local void compress_block(deflate_state *s, const ct_data *ltree,
}
} /* literal or match pair ? */
- /* Check that the overlay between pending_buf and sym_buf is ok: */
+ /* Check for no overlay of pending_buf on needed symbols */
+#ifdef LIT_MEM
+ Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow");
+#else
Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
+#endif
} while (sx < s->sym_next);
@@ -1082,9 +1091,14 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf,
* the current block must be flushed.
*/
int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc) {
+#ifdef LIT_MEM
+ s->d_buf[s->sym_next] = (ush)dist;
+ s->l_buf[s->sym_next++] = (uch)lc;
+#else
s->sym_buf[s->sym_next++] = (uch)dist;
s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
s->sym_buf[s->sym_next++] = (uch)lc;
+#endif
if (dist == 0) {
/* lc is the unmatched char */
s->dyn_ltree[lc].Freq++;
diff --git a/3rdparty/zlib/win32/DLL_FAQ.txt b/3rdparty/zlib/win32/DLL_FAQ.txt
index 12c009018c3..d8cf5f31e3d 100644
--- a/3rdparty/zlib/win32/DLL_FAQ.txt
+++ b/3rdparty/zlib/win32/DLL_FAQ.txt
@@ -3,7 +3,7 @@
This document describes the design, the rationale, and the usage
-of the official DLL build of zlib, named ZLIB1.DLL. If you have
+of the common DLL build of zlib, named ZLIB1.DLL. If you have
general questions about zlib, you should see the file "FAQ" found
in the zlib distribution, or at the following location:
http://www.gzip.org/zlib/zlib_faq.html
@@ -11,13 +11,9 @@ in the zlib distribution, or at the following location:
1. What is ZLIB1.DLL, and how can I get it?
- - ZLIB1.DLL is the official build of zlib as a DLL.
+ - ZLIB1.DLL is the common build of zlib as a DLL.
(Please remark the character '1' in the name.)
- Pointers to a precompiled ZLIB1.DLL can be found in the zlib
- web site at:
- http://www.zlib.net/
-
Applications that link to ZLIB1.DLL can rely on the following
specification:
@@ -379,18 +375,6 @@ in the zlib distribution, or at the following location:
code. But you can make your own private DLL build, under a
different file name, as suggested in the previous answer.
-
-17. I made my own ZLIB1.DLL build. Can I test it for compliance?
-
- - We prefer that you download the official DLL from the zlib
- web site. If you need something peculiar from this DLL, you
- can send your suggestion to the zlib mailing list.
-
- However, in case you do rebuild the DLL yourself, you can run
- it with the test programs found in the DLL distribution.
- Running these test programs is not a guarantee of compliance,
- but a failure can imply a detected problem.
-
**
This document is written and maintained by
diff --git a/3rdparty/zlib/win32/README-WIN32.txt b/3rdparty/zlib/win32/README-WIN32.txt
index 384c988fa84..14e6398ef3a 100644
--- a/3rdparty/zlib/win32/README-WIN32.txt
+++ b/3rdparty/zlib/win32/README-WIN32.txt
@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY
-zlib 1.3.0 is a general purpose data compression library. All the code is
+zlib 1.3.1 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@@ -16,13 +16,13 @@ is http://zlib.net/ . Before reporting a problem, please check this site to
verify that you have the latest version of zlib; otherwise get the latest
version and check whether the problem still exists or not.
-PLEASE read DLL_FAQ.txt, and the the zlib FAQ http://zlib.net/zlib_faq.html
-before asking for help.
+PLEASE read DLL_FAQ.txt, and the zlib FAQ http://zlib.net/zlib_faq.html before
+asking for help.
Manifest:
-The package zlib-1.3.0-win32-x86.zip will contain the following files:
+The package zlib-1.3.1-win32-x86.zip will contain the following files:
README-WIN32.txt This document
ChangeLog Changes since previous zlib packages
diff --git a/3rdparty/zlib/zconf.h b/3rdparty/zlib/zconf.h
index fb76ffe312a..62adc8d8431 100644
--- a/3rdparty/zlib/zconf.h
+++ b/3rdparty/zlib/zconf.h
@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -300,14 +300,6 @@
# endif
#endif
-#ifndef Z_ARG /* function prototypes for stdarg */
-# if defined(STDC) || defined(Z_HAVE_STDARG_H)
-# define Z_ARG(args) args
-# else
-# define Z_ARG(args) ()
-# endif
-#endif
-
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
diff --git a/3rdparty/zlib/zconf.h.cmakein b/3rdparty/zlib/zconf.h.cmakein
index 310c43928a2..0abe3bc9d8f 100644
--- a/3rdparty/zlib/zconf.h.cmakein
+++ b/3rdparty/zlib/zconf.h.cmakein
@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -302,14 +302,6 @@
# endif
#endif
-#ifndef Z_ARG /* function prototypes for stdarg */
-# if defined(STDC) || defined(Z_HAVE_STDARG_H)
-# define Z_ARG(args) args
-# else
-# define Z_ARG(args) ()
-# endif
-#endif
-
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
diff --git a/3rdparty/zlib/zconf.h.in b/3rdparty/zlib/zconf.h.in
index fb76ffe312a..62adc8d8431 100644
--- a/3rdparty/zlib/zconf.h.in
+++ b/3rdparty/zlib/zconf.h.in
@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -300,14 +300,6 @@
# endif
#endif
-#ifndef Z_ARG /* function prototypes for stdarg */
-# if defined(STDC) || defined(Z_HAVE_STDARG_H)
-# define Z_ARG(args) args
-# else
-# define Z_ARG(args) ()
-# endif
-#endif
-
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
diff --git a/3rdparty/zlib/zlib.3 b/3rdparty/zlib/zlib.3
index 4dd28967534..c716020ea9c 100644
--- a/3rdparty/zlib/zlib.3
+++ b/3rdparty/zlib/zlib.3
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "18 Aug 2023"
+.TH ZLIB 3 "22 Jan 2024"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
@@ -105,9 +105,9 @@ before asking for help.
Send questions and/or comments to zlib@gzip.org,
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
.SH AUTHORS AND LICENSE
-Version 1.3
+Version 1.3.1
.LP
-Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
+Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
.LP
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff --git a/3rdparty/zlib/zlib.3.pdf b/3rdparty/zlib/zlib.3.pdf
index da12d37183a..b224532bdd8 100644
--- a/3rdparty/zlib/zlib.3.pdf
+++ b/3rdparty/zlib/zlib.3.pdf
Binary files differ
diff --git a/3rdparty/zlib/zlib.h b/3rdparty/zlib/zlib.h
index 6b7244f9943..8d4b932eaf6 100644
--- a/3rdparty/zlib/zlib.h
+++ b/3rdparty/zlib/zlib.h
@@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.3, August 18th, 2023
+ version 1.3.1, January 22nd, 2024
- Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
+ Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -37,11 +37,11 @@
extern "C" {
#endif
-#define ZLIB_VERSION "1.3"
-#define ZLIB_VERNUM 0x1300
+#define ZLIB_VERSION "1.3.1"
+#define ZLIB_VERNUM 0x1310
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 3
-#define ZLIB_VER_REVISION 0
+#define ZLIB_VER_REVISION 1
#define ZLIB_VER_SUBREVISION 0
/*
@@ -936,10 +936,10 @@ ZEXTERN int ZEXPORT inflateSync(z_streamp strm);
inflateSync returns Z_OK if a possible full flush point has been found,
Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
- In the success case, the application may save the current current value of
- total_in which indicates where valid compressed data was found. In the
- error case, the application may repeatedly call inflateSync, providing more
- input each time, until success or end of the input data.
+ In the success case, the application may save the current value of total_in
+ which indicates where valid compressed data was found. In the error case,
+ the application may repeatedly call inflateSync, providing more input each
+ time, until success or end of the input data.
*/
ZEXTERN int ZEXPORT inflateCopy(z_streamp dest,
@@ -1758,14 +1758,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2);
seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
- len2.
+ len2. len2 must be non-negative.
*/
/*
ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);
Return the operator corresponding to length len2, to be used with
- crc32_combine_op().
+ crc32_combine_op(). len2 must be non-negative.
*/
ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);
diff --git a/3rdparty/zlib/zutil.h b/3rdparty/zlib/zutil.h
index 902a304cc2d..48dd7febae6 100644
--- a/3rdparty/zlib/zutil.h
+++ b/3rdparty/zlib/zutil.h
@@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -56,7 +56,7 @@ typedef unsigned long ulg;
extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */
-#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
#define ERR_RETURN(strm,err) \
return (strm->msg = ERR_MSG(err), (err))
@@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
#endif
-#if defined(MACOS) || defined(TARGET_OS_MAC)
+#if defined(MACOS)
# define OS_CODE 7
-# ifndef Z_SOLO
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# endif
-# endif
-# endif
#endif
#ifdef __acorn
@@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define OS_CODE 19
#endif
-#if defined(_BEOS_) || defined(RISCOS)
-# define fdopen(fd,mode) NULL /* No fdopen() */
-#endif
-
-#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
-# if defined(_WIN32_WCE)
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# else
-# define fdopen(fd,type) _fdopen(fd,type)
-# endif
-#endif
-
#if defined(__BORLANDC__) && !defined(MSDOS)
#pragma warn -8004
#pragma warn -8008